{"label": "1", "index": "0", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint p(int a, int m) {\n  int t = 0;\n  int i;\n  if (a % m != 0)\n    return 0;\n  if ((a % m == 0) && (a / m < m) && (a != m))\n    return 0;\n  if (a == m)\n    return 1;\n  if ((a % m == 0) && (a / m >= m)) {\n    for (i = m; i <= a / m; i++) {\n      t = t + p(a / m, i);\n    }\n    return t;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int x;\n  int j;\n  int num = 0;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    for (j = 2; j <= x; j++) {\n      num = num + p(x, j);\n    }\n    cout << num << endl;\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int b) {\n  int i, z = 0, c;\n  for (i = b; i <= x; i++) {\n    if (x == i)\n      z = z + 1;\n    else if (x % i == 0) {\n      c = x / i;\n      z = z + fenjie(c, i);\n    }\n  }\n  return (z);\n}\nint main() {\n  int n, i, num, a;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    num = fenjie(a, 2);\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "2", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu(int be, int by) \n{\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum = sum + 1 + yinshu(be / i, i);\n    } \n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;   \n  while (n--) \n  {\n    int num, sign; \n    cin >> num;\n    for (int j = num; j > 1; j--) {\n      if (num % j == 0)\n        sign = j;\n    }                                      \n    cout << yinshu(num, sign) + 1 << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "3", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint times = 1;\nint used[1000] = {0};\nvoid fuck(int n) {\n\n  int i = 0;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (used[i] == 0 && n % i == 0) {\n      int j = 0;\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 1;\n      times++;\n      fuck(n / i);\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 0;\n    }\n  }\n}\nint main() {\n  int n = 0;\n  int num = 0;\n  scanf(\"%d \", &n);\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    fuck(num);\n    cout << times << endl;\n    times = 1;\n    int k = 0;\n    for (k = 0; k <= 999; k++)\n      used[k] = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "4", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, t = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0) {\n      s += divide(n / i, i);\n      t++;\n    }\n  if (t == 0)\n    return 0;\n  return s;\n}\nint main() {\n  int n, k;\n  cin >> k;\n  while (k > 0) {\n    cin >> n;\n    cout << divide(n, n) << endl;\n    k--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "5", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b, j, f[1010];\n\nvoid factorization(int x) {\n  int now, i;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= f[j]) {\n      f[++j] = i;\n      now = x / i;\n      if (now == 1) {\n        b++;\n      } else {\n        factorization(now);\n      }\n\n      j--;\n    }\n  }\n  return;\n}\nint main() {\n  int n, i, num;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    b = 0;\n    j = 0;\n    memset(f, 0, sizeof(f));\n    scanf(\"%d \", &num);\n    factorization(num);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "6", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint digui(int x, int min);\nint main() {\n  int n, i, m, y;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m;\n    y = digui(m, 2);\n    cout << y << \"\\n\";\n  }\n  return 0;\n}\nint digui(int x, int min) {\n  int i, result;\n  result = 1;\n  if (x < min) {\n    return 0;\n  }\n  for (i = min; i <= x - 1; i++) {\n    if (x % i == 0) {\n      result = result + digui(x / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "7", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factors(int n, int min) {\n  int varieties = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0) {\n        varieties += factors(n / i, i);\n      }\n    }\n  }\n  return varieties;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = factors(a[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "8", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num0;\nint factor(int x, int y) {\n  int countn = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (int i = y; i <= sqrt(x); i++)\n    if (x % i == 0)\n      countn += factor(x / i, i);\n  return countn;\n}\nint main() {\n  int n, j;\n  scanf(\"%d \", &n);\n  for (j = 1; j <= n; j++) {\n    cin >> num0;\n    cout << factor(num0, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "9", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Digui(int a, int min) {\n  int i, result = 1;\n  if (a < min) {\n    return 0;\n  }\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += Digui(a / i, i);\n  }\n  return (result);\n}\nint main() {\n  int a[1000], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", Digui(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "10", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t, a, flag, a1;\n\nvoid find(int m, int min) {\n  int i;\n\n  for (i = 2; i <= sqrt((double)m); i++) {\n    if (m % i == 0) {\n      if (i >= min)\n\n      {\n        t++;\n\n        min = i;\n\n        find(m / i, min);\n      }\n    }\n  }\n\n  return;\n}\nint main() {\n  int n, ii;\n  scanf(\"%d \", &n);\n  for (ii = 1; ii <= n; ii++) {\n    t = 0;\n    flag = 0;\n    cin >> a;\n\n    a1 = a;\n    find(a, 2);\n    cout << t + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "11", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0;\nvoid devide(int, int);\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> m;\n    s = 0;\n    devide(2, m);\n    cout << s + 1 << endl;\n  }\n  return 0;\n}\n\nvoid devide(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if (b % i == 0) {\n      s++;\n      devide(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "12", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int brea(int a, int min);\n  int i, n, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", brea(a, 2));\n  }\n  return 0;\n}\n\nint brea(int a, int min) {\n  int result = 1;\n  int i;\n  if (a < min) {\n    return (0);\n  } else if (a == min)\n    return (1);\n  else {\n    for (i = min; i < a; i++) {\n      if (a % i == 0)\n        result = result + brea(a / i, i);\n    }\n    return (result);\n  }\n}\n"}
{"label": "1", "index": "13", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (min > n)\n    return 0;\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result += f(n / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, a, i, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    t = f(a, 2);\n    if (i < n - 1)\n      printf(\"%d\\n\", t);\n    else\n      cout << t;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "14", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int a, int b);\nint main() {\n  int t;\n  int a;\n  cin >> t;\n  for (int i = 1; i <= t; i++) {\n    cin >> a;\n    cout << (num(a, 2)) << endl;\n  }\n  return 0;\n}\nint num(int a, int b) {\n  int f = 0;\n  if (a >= b) {\n    for (int i = b; i <= a; i++) {\n      if (a == i)\n        f++;\n      else if (a % i == 0) {\n        f = f + num(a / i, i);\n      }\n    }\n  }\n  return f;\n}\n"}
{"label": "1", "index": "15", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cnt = 0;\n\nvoid slv(int nm, int pr) {\n  int i;\n  if (nm >= pr) {\n    cnt++;\n    if (pr == 1)\n      pr++;\n    for (i = pr; i <= nm; i++) {\n      if (nm % i == 0) {\n        slv(nm / i, i);\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, num;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cnt = 0;\n    cin >> num;\n    slv(num, 1);\n    printf(\"%d\\n\", cnt);\n  }\n}\n"}
{"label": "1", "index": "16", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factors(int, int, int);\nint main() {\n  int num, n, i, j, b[10000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    int part = 0;\n    int t = num;\n\n    for (j = 2; j <= num; j++) {\n      while (t % j == 0) {\n        t /= j;\n        part++;\n      }\n    }\n    b[i] = factors(1, part, num);\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n\nint factors(int factor1, int part, int num) {\n  int sum = 0;\n  if (num < factor1)\n    return 0;\n  if (part == 1)\n    return 1;\n\n  for (int i = factor1; i <= num; i++) {\n    if (num % i == 0)\n      sum = sum + factors(i, part - 1, num / i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "17", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int x) {\n  int i;\n  if (x == 2)\n    return 1;\n\n  else {\n    int result = 1;\n    for (i = a; i <= x; i++)\n      if (x % i == 0 && x / i >= i)\n        result = result + f(i, x / i);\n    return result;\n  }\n}\nint main() {\n  int i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    cout << f(2, a) << \" \";\n  }\n}\n"}
{"label": "1", "index": "18", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, m, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    cout << f(m, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int m, int min) {\n  int count = 1, i;\n  if (m == 1)\n    return 1;\n  else if (m == 2)\n    return 1;\n  else {\n    for (i = min; i <= sqrt(m); i++) {\n      if (m % i == 0) {\n        count += f(m / i, i);\n      }\n    }\n    return count;\n  }\n}\n"}
{"label": "1", "index": "19", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint l = 0, num = 0, o;\nvoid f(int i, int in) {\n  int j;\n  for (j = i; j < (in + 1); j++) {\n    if (j * (in / j) == in) {\n\n      o = in / j;\n\n      f(j, in / j);\n      o = o * j;\n    }\n  }\n  if (o == 1) {\n    num = num + 1;\n  }\n}\nint main() {\n  int t;\n  cin >> t;\n  int i;\n  int in;\n  for (i = 0; i < t; i++) {\n    cin >> in;\n    f(2, in);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "20", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint solutionNumber(int a, int k) { \n  int i;\n  if (a == 1)\n    return 1;\n  if (k > a)\n    return 0;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      return solutionNumber(a, i + 1) + solutionNumber(a / i, i);\n}\nint main() {\n  int n, a[101];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];                             \n    cout << solutionNumber(a[i], 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "21", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 1;\nvoid f(int i, int j) {\n  int k;\n  if (i == 1)\n    sum++;\n  else {\n    for (k = j; k <= i; k++) {\n      if (i % k == 0)\n        f(i / k, k);\n    }\n  }\n}\nint main(void) {\n  int i, j, k;\n  int n;\n  int a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    sum = 1;\n    scanf(\"%d\", &a);\n    for (i = 2; i * i <= a; i++) {\n      if (a % i == 0) {\n        f(a / i, i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "22", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint t;\nint f(int a, int b) {\n  int i;\n  for (i = a; i * i <= b; i++) {\n    if (b % i == 0) {\n      t++;\n      f(i, b / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int n, i, result[1000], a[1000];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    result[i] = f(2, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    cout << result[i] << \"\\n\";\n}\n"}
{"label": "1", "index": "23", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nint fjys(int n, int m, int i, int d, int ji[20]) {\n  int a;\n  for (a = i; a < m; a++) {\n    if (n % a == 0) {\n      ji[d] = a;\n      int chenji = 1, k;\n      for (k = 0; k <= d; k++) {\n        chenji = chenji * ji[k];\n      }\n      if (chenji == m) {\n        num++;\n        break;\n      } else\n        fjys(n / a, m, a, d + 1, ji);\n    }\n  }\n  return num;\n}\nint main() {\n  int m, n, j, result = 0, ji[20] = {0};\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    num = 0;\n    scanf(\"%d \", &n);\n    result = fjys(n, n, 2, 0, ji);\n    cout << result + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "24", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fg(int k, int m) {\n  int j, d = 0;\n  if (m == 1) {\n    d = 1;\n  }\n  for (j = k; j <= m; j++) {\n    if (m % j == 0)\n      d = d + fg(j, m / j);\n  }\n  return (d);\n}\n\nint main() {\n  int n, i, a[40000], b[40000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = fg(2, a[i]);\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "25", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count(int a, int n) {\n  if (a > n)\n    return 0;\n  if (a == n)\n    return 1;\n  int p = 1;\n  int i;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0 && i <= n / i) {\n      p = p + count(i, n / i);\n    }\n  }\n  return p;\n}\nint geshu(int N) {\n  int i;\n  int s = 1;\n  for (i = 2; i <= sqrt(N); i++) {\n    if (N % i == 0) {\n      s = s + count(i, N / i);\n    }\n  }\n\n  return s;\n}\nint main() {\n  int N;\n  cin >> N;\n  int c[N];\n  int j;\n  for (j = 0; j < N; j++) {\n    cin >> c[j];\n  }\n  for (j = 0; j < N; j++) {\n    cout << geshu(c[j]) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "26", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int N, int min);\nint main() {\n  int m, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    k = factor(m, 2);\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min) {\n    return 0;\n  }\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "27", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint p = 0, q = 2;\nint jizu(int x) {\n\n  for (int i = q; i <= x - 1; i++) {\n    if ((x % i == 0) && (x / i > i)) {\n      p++;\n      q = i;\n      jizu(x / i);\n\n    } else {\n      if ((x % i == 0) && (x / i == i)) {\n        p++;\n      }\n    }\n  }\n  return p;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << jizu(a[i]) + 1 << \"\\n\";\n    p = 0, q = 2;\n  }\n  int y;\n  scanf(\"%d\", &y);\n}\n"}
{"label": "1", "index": "28", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint tru(int c) {\n  int j, p = 0;\n  if (c == 1 || c == 2)\n    return 1;\n  else\n    for (j = 2; j <= pow((double)c, 0.5); j++)\n      if (c % j == 0) {\n        p = 1;\n        break;\n      }\n  if (p == 1)\n    return 0;\n  else\n    return 1;\n}\nint count(int a, int b) {\n  int i, k = 1;\n  if (!tru(a))\n    for (i = b; i <= pow((double)a, 0.5); i++)\n      if (a % i == 0)\n        k = k + count(a / i, i);\n  return k;\n}\nint main() {\n  int n, x[999], q;\n  scanf(\"%d\", &n);\n  for (q = 0; q < n; q++)\n    scanf(\"%d \", &x[q]);\n  for (q = 0; q < n; q++)\n    printf(\"%d\\n\", count(x[q], 2));\n\n  return 0;\n}\n"}
{"label": "1", "index": "29", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sep(int a, int b) {\n  int i;\n  int ans = 0;\n  if (a == 1)\n    ans = 1;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0) {\n      ans += sep(a / i, i);\n    }\n  }\n  return ans;\n}\nint baka(int a) {\n  int cirno;\n  cirno = sep(a, 2);\n  return cirno;\n}\nint main() {\n  int n, pre;\n  int i, j;\n  int ans;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &pre);\n    ans = baka(pre);\n    printf(\"%d\\n\", ans);\n  }\n}\n"}
{"label": "1", "index": "30", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int k, int m);\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 1; i <= n; i++) {\n    int k;\n    scanf(\"%d\", &k);\n    printf(\"%d\\n\", f(k, 2));\n  }\n\n  return 0;\n}\nint f(int k, int m) {\n  int i;\n  int j = 0;\n  if (k <= m) {\n    if (k == m) {\n\n      j = 1;\n      return j;\n    } else {\n      j = 0;\n      return j;\n    }\n  } else {\n    for (i = m; i <= k; i++) {\n      if (k % i == 0 && k / i != 1)\n        j = j + f(k / i, i);\n      if (k % i == 0 && k / i == 1)\n        j = j + 1;\n    }\n    return j;\n  }\n}\n"}
{"label": "1", "index": "31", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint prime(int min, int num) {\n  int i;\n  for (i = min; i < num; i++) {\n    if (num % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint count(int min, int num) {\n  int i = 0, n = 1;\n  if (prime(min, num))\n    return 1;\n  else\n    for (i = min; i < num; i++) {\n      if (num % i == 0 && i <= num / i)\n        n = n + count(i, num / i);\n    }\n  return n;\n}\nint main() {\n  int num, n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << count(2, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "32", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid jisuan(int, int);\nint times, sum, i, n;\nint main() {\n  scanf(\"%d \", &times);\n  for (i = 0; i < times; i++) {\n    sum = 0;\n    cin >> n;\n    jisuan(n, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid jisuan(int n, int j) {\n  int i;\n  for (i = j; i <= n; i++) {\n    if (n > 1) {\n      if (n % i == 0) {\n        if (n % i != 0 && n > i)\n          sum++;\n        jisuan(n / i, i);\n      }\n    }\n    if (n == i) {\n      sum++;\n    }\n  }\n}\n"}
{"label": "1", "index": "33", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum;\nvoid calculate(int, int);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int m;\n    sum = 1;\n    cin >> m;\n    calculate(m, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid calculate(int m, int begin) {\n  int i;\n  int n = sqrt((double)m);\n  for (i = begin; i <= n; i++) {\n    if (m % i == 0) {\n      sum++;\n      calculate(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "34", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cal;\nint fac(int a, int x) {\n  if (x == 1) {\n    cal++;\n    return 1;\n  }\n  for (int i = 2; i <= x; i++)\n    if (x % i == 0 && i >= a)\n      fac(i, x / i);\n}\nint main() {\n  int n, b;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cal = 0;\n    cin >> b;\n    fac(1, b);\n    printf(\"%d\\n\", cal);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "35", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min) {\n  int i, result;\n  if (a < min)\n    return 0;\n  result = 1;\n  for (i = min; i < a; i++)\n    if (a % i == 0)\n      result += f(a / i, i);\n  return result;\n}\nint main() {\n  int i, n, num[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cout << f(num[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "36", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int x, int min) {\n  if (x < min)\n    return 0;\n  int r = 1;\n  for (int i = min; i < x / 2; i++) {\n    if (x % i == 0)\n      r += f(x / i, i);\n  }\n  return r;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int x;\n    scanf(\"%d \", &x);\n    cout << f(x, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "37", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n  if (n < min) {\n    return 0;\n  }\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result = result + factor(n / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a[100000], b[100000];\n  scanf(\"%d\", &n);\n  for (int j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    b[j] = factor(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "38", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fact(int a, int i) {\n  if (a == 1)\n    sum++;\n  while (i <= a) {\n    if (a % i == 0)\n      fact(a / i, i);\n    i++;\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int a;\n    cin >> a;\n    int i = 2;\n    int result = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fact(a / i, i);\n        result += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "39", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint coun; \nvoid depart(int n, int i) {\n  int j;\n  if (n == 1)\n    coun++;\n  else\n    for (j = i; j <= n; j++) \n      if (n % j == 0) {\n        depart(n / j, j);\n      }\n}\n\nint main() {\n  int n, j;\n  cin >> n;\n  int b[n]; \n  for (j = 0; j < n; j++)\n    cin >> b[j];\n  for (j = 0; j < n; j++) {\n    coun = 0; \n    depart(b[j], 2);\n    cout << coun << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "40", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int);\n\nint solutionnum = 1;\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    fenjie(a);\n    cout << solutionnum << \"\\n\";\n    solutionnum = 1;\n  }\n  return 0;\n}\nint yinzi[100] = {2}, i = 0;\n\nvoid fenjie(int x) {\n  int j;\n  for (j = yinzi[i]; j < x; j++) {\n    if (x % j == 0 && x / j >= j) {\n      i++;\n      yinzi[i] = j;\n      fenjie(x / j);\n      j = yinzi[i];\n      i--;\n      solutionnum++;\n    }\n  }\n}\n"}
{"label": "1", "index": "41", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ispr(int t) {\n  int v = sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      fun(n / i, i);\n\n    i++;\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a)) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int i = 2, res = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", res);\n  }\n}\n"}
{"label": "1", "index": "42", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint numcount = 0;\nvoid divide(int num, int x) {\n  int i;\n  if (num == 1)\n    numcount++;\n  for (i = x; i <= num; i++) {\n    if (num % i == 0)\n      divide(num / i, i);\n  }\n}\n\nint main() {\n  int n, num, i;\n  int first = 2;\n  int ans[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    divide(num, first);\n    ans[i] = numcount;\n\n    numcount = 0;\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", ans[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "43", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int x, int p);\nint N;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &N);\n    printf(\"%d\\n\", fenjie(N, 2));\n  }\n  return 0;\n}\nint fenjie(int x, int p) {\n  int f = 0;\n  if (x == 1)\n    return 1;\n  else {\n    for (int i = p; i <= x; i++)\n      if (x % i == 0)\n        f = f + fenjie(x / i, i);\n  }\n  return f;\n}\n"}
{"label": "1", "index": "44", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factorization(int a, int k);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << factorization(a, 2) << endl;\n  }\n  return 0;\n}\n\nint factorization(int a, int k) {\n  int sum = 1;\n  if (a == 1) {\n    return 0;\n  }\n  if (a == 2)\n\n    return 1;\n\n  int b = (int)sqrt((double)a);\n  for (int i = k; i <= b; i++) {\n    if (a % i == 0) {\n      sum += factorization(a / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "45", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint countt;\nvoid f(int p, int q) {\n  for (int m = p; m <= sqrt(q); m++) {\n    if (q % m == 0) {\n      countt++;\n      f(m, q / m);\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    countt = 0;\n    for (int k = 2; k <= sqrt(num); k++) {\n      if (num % k == 0) {\n        countt++;\n        f(k, num / k);\n      }\n    }\n    cout << countt + 1 << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "46", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid zhongshu(int qian, int a);\nint main() {\n  int n, i, j, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    zhongshu(2, a[i]);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid zhongshu(int qian, int a) {\n  int i, j, c;\n  if (a == 1) {\n    sum = sum + 1;\n    return;\n  }\n  for (i = qian; i <= a; i++) {\n    if (a % i == 0)\n      zhongshu(i, a / i);\n  }\n}\n"}
{"label": "1", "index": "47", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint reek(int i, int j) {\n  int k, g = 0;\n  for (k = j; k < i; k++) {\n    if ((i % k == 0) && (k != 1)) {\n      g = 1;\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (g == 0)\n    return 1;\n  else {\n    int num = 1;\n    for (k = j; k <= sqrt(i); k++) {\n      if ((i % k == 0) && (k != 1))\n        num += reek(i / k, k);\n      else\n        continue;\n    }\n    return num;\n  }\n}\nint main() {\n  int n, i, a[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[n]);\n    cout << reek(a[n], 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "48", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a;\nint m = 0, s = 1;\nvoid temp(int b, int k, int c) {\n  for (int i = k; i <= b; i++) \n  {\n\n    if (b % i == 0) {\n      b = b / i;\n      s = s * i;\n      k = i;\n      if (s == c) {\n        m++;\n\n      } else\n\n        temp(b, k, c);\n      s = s / i; \n      b = b * i;\n    }\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    temp(a, 2, a); \n    cout << m << endl;\n    m = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "49", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s = 0, p;\nint a[100];\nvoid factor(int m, int n, int t) {\n  int i;\n  for (i = 2; i <= (int)sqrt(n); i++)\n    if ((n % i == 0) && (i >= m)) {\n      s++;\n      factor(i, n / i, t + 1);\n    }\n  return;\n}\nint main() {\n  int i, j = 0, k;\n  scanf(\"%d \", &j);\n  for (k = 0; k < j; k++) {\n    scanf(\"%d\", &a[k]);\n  }\n  for (k = 0; k < j; k++) {\n    p = a[k];\n    s = 0;\n    for (i = 2; i <= (int)sqrt(p); i++)\n      if (p % i == 0) {\n        s++;\n        factor(i, p / i, 2);\n      }\n    a[k] = s;\n  }\n  for (k = 0; k < j; k++)\n    printf(\"%d\\n\", a[k] + 1);\n  return 0;\n}\n"}
{"label": "1", "index": "50", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b) {\n  if (a == b)\n    return 1;\n  if (b > a) {\n    return 0;\n  }\n  if (a % b != 0)\n    return f(a, b + 1);\n  if (a % b == 0)\n    return f(a, b + 1) + f(a / b, b);\n}\nint main() {\n  int n = 0, i = 0, x, y;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    y = 2;\n    cout << f(x, y) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "51", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ways(int, int);\nint main() {\n  int ways(int a, int min);\n  int n, b;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", ways(b, 2));\n  }\n}\nint ways(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 0, i;\n  for (i = min; i <= sqrt(a * 1.0); i++) {\n    if (a % i == 0)\n      sum = sum + ways(a / i, i);\n  }\n  return sum + 1;\n}\n"}
{"label": "1", "index": "52", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint count(int num, int m)\n\n{\n  if (num % m != 0) {\n    return 0;\n  }\n\n  if (num == m)\n    return 1;\n  else {\n    int counter = 0;\n    for (int i = m; i <= num / m; i++) {\n      counter += count(num / m, i);\n    }\n    return counter;\n  }\n}\n\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int counter = 0;\n    cin >> num;\n    for (int i = 2; i <= num; i++)\n      counter += count(num, i);\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "53", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint times;\nvoid fenjie(int m, int k) {\n  int i;\n  {\n    for (i = k; i <= sqrt(m); i++) {\n      if (m % i == 0) {\n        fenjie(m / i, i);\n      }\n    }\n  }\n  times++;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int m;\n    times = 0;\n    scanf(\"%d\", &m);\n    fenjie(m, 2);\n    printf(\"%d\\n\", times);\n  }\n}\n"}
{"label": "1", "index": "54", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dp[40000][200] = {0};\nint main() {\n  int n, i, N;\n  int mm(int, int);\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> N;\n    cout << mm(N, 2) << endl;\n    \n  }\n\n  return 0;\n}\n\nint mm(int n, int i) {\n  int sum = 1;\n\n  if (dp[n][i] > 0)\n    return dp[n][i];\n\n  for (int j = i; j <= sqrt(n); j++) {\n    if (n % j == 0) {\n      sum += mm(n / j, j);\n    }\n  }\n  dp[n][i] = sum;\n  return sum;\n}\n"}
{"label": "1", "index": "55", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p(int x) {\n  int i;\n  for (i = 2; i <= sqrt(x); i++)\n    if (x % i == 0)\n      return (0);\n  return (1);\n}\nint f(int n, int m) {\n  int t, i;\n  if (n < m)\n    return (0);\n  else if (p(n) == 1)\n    return (1);\n  else if (m == 1) {\n    t = 1;\n    for (i = m + 1; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  } else if (m != 1) {\n    t = 1;\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  }\n  return (t);\n}\nint main() {\n  int x, y, j;\n  scanf(\"%d\", &y);\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &x);\n    printf(\"%d \", f(x, 1));\n  }\n}\n"}
{"label": "1", "index": "56", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num(int a, int b, int c) {\n  int sum = 0, j;\n  if (a > c)\n    return 0;\n  if (b == 1)\n    return 1;\n  for (j = a; j <= c; j++) {\n    if (c % j == 0)\n      sum = sum + num(j, b - 1, c / j);\n  }\n  return sum;\n}\nint main() {\n  int k, n, m, e = 0, i;\n  cin >> n;\n  while (e < n) {\n    cin >> m;\n    k = 0;\n    int f = m;\n    for (i = 2; i <= f; i++)\n      if (f % i == 0) {\n        k++;\n        f = f / i;\n        i = 1;\n      }\n    cout << num(1, k, m) << endl;\n    e++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "57", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (min > n)\n    return 0;\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result += f(n / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, a, i, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    t = f(a, 2);\n    if (i < n - 1)\n      printf(\"%d\\n\", t);\n    else\n      printf(\"%d\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "58", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint function_1(int num, int k) {\n  int j;\n  int m = 0;\n  if (num > 1) {\n    for (j = k; j <= num; j++) {\n      if (num % j == 0) {\n        m = m + function_1(num / j, j);\n      }\n    }\n    return m;\n  } else {\n    return 1;\n  }\n}\nint main() {\n  int i, j;\n  int n;\n  cin >> n;\n  int num[100];\n\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", function_1(num[i], 2));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "59", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t(int, int);\nint s, j, k1;\n\nint main() {\n  int a, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    s = 1;\n    k1 = 0;\n    for (j = 2; j <= sqrt((double)a); j++) {\n      if (a % j == 0)\n        t(a / j, j);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n\nint t(int a, int b) {\n  int k;\n  for (k = b; k <= a; k++) {\n    if (a % k == 0) {\n      if (a / k == 1) {\n        s = s + 1;\n        break;\n      }\n      t(a / k, k);\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "60", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ge, s, w;\nvoid fen(int h, int a);\nint main() {\n  int n = 0, k = 0;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    cin >> s;\n    ge = 0;\n    fen(s, 2);\n    cout << ge << endl;\n  }\n  return 0;\n}\nvoid fen(int h, int a) {\n  for (int i = 2; i <= h; i++) {\n    if ((h % i == 0) && (i >= a)) {\n      if (h / i != 1) {\n        fen(h / i, i);\n      } else {\n        ge++;\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "61", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ys(int x, int min) {\n  int r = 1;\n  if (x < min)\n    return 0;\n  for (int i = min; i < x; i++) {\n    if (x % i == 0)\n      r += ys(x / i, i);\n  }\n  return r;\n}\nint main() {\n  int n, a[1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << ys(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "62", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint counts = 1;\nint ty(int, int);\nint main() {\n  int i, m, n, c;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    counts = 1;\n    c = ty(n, 2);\n    printf(\"%d\\n\", c);\n  }\n  return 0;\n}\n\nint ty(int n, int j) {\n  int i, flag = 0;\n  if (n == 1) {\n    return 0;\n  }\n  if (n == 2) {\n    return 1;\n  }\n  for (i = j; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      counts++;\n      ty(n / i, i);\n    }\n  }\n  return counts;\n}\n"}
{"label": "1", "index": "63", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int x, int min) {\n  if (x < min)\n    return 0;\n  int r = 1;\n  for (int i = min; i < x / 2; i++) {\n    if (x % i == 0)\n      r += f(x / i, i);\n  }\n  return r;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int x;\n    cin >> x;\n    cout << f(x, 2) << endl;\n  }\n}\n"}
{"label": "1", "index": "64", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint digui(int m, int n, int sum) {\n  int i;\n  sum++;\n  if (sqrt(m) < n)\n    return sum;\n  else {\n    for (i = n; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        sum = digui(m / i, i, sum);\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", digui(a, 2, 0));\n  }\n}\n"}
{"label": "1", "index": "65", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint meide(int x, int y) {\n  int sum = 1, count = 0, i;\n  for (i = y; i <= sqrt(x); i++) {\n    if (x % i == 0)\n      sum = sum + meide(x / i, i);\n  }\n  return sum;\n}\nint main() {\n  int k, n, m;\n  scanf(\"%d\", &k);\n  for (m = 0; m < k; m++) {\n    scanf(\"%d\", &n);\n    if (n >= 3) {\n      printf(\"%d\\n\", meide(n, 2));\n    } else {\n      printf(\"1\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "66", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint im(int n, int max) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = max; i > 1; i--)\n    if (n % i == 0)\n      s += im(n / i, i);\n  return s;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d%d\", &n, &t);\n  printf(\"%d\", im(t, t));\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"\\n%d\", im(t, t));\n  }\n  \n  return 0;\n}\n"}
{"label": "1", "index": "67", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  int c, s = 0, i;\n  c = (int)sqrt(a);\n  for (i = b; i <= c; i++) {\n    if (a % i == 0)\n      s = s + f(a / i, i);\n  }\n  return s + 1;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    cout << f(num[i], 2) << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "68", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int a, int i) {\n  int ret = 1;\n  for (; i <= sqrt((float)a); i++) {\n    if (a % i == 0) {\n      ret += sum(a / i, i);\n    }\n  }\n  return ret;\n}\nint main() {\n  int t, a, j;\n  cin >> t;\n\n  for (j = 0; j < t; j++) {\n    cin >> a;\n    printf(\"%d\\n\", sum(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "69", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = 2; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          if (i < q)\n            continue;\n          else\n            sum = sum + f(i, x / i);\n        }\n      }\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum, p;\n  p = 0;\n  sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "70", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int l) {\n  int re = 0, j;\n  if (l == 4)\n    re = 1;\n  if (l > 4) {\n    for (j = m; j <= sqrt(l); j++) {\n      if (l % j == 0) {\n        re = re + 1 + f(j, l / j);\n      }\n    }\n  }\n  return re;\n}\nint main() {\n  int n, i, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", (f(2, a[i]) + 1));\n  }\n}\n"}
{"label": "1", "index": "71", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid count(int, int);\nint k;\n\nint main() {\n  int n, i, j, m;\n  int num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    cin >> num;\n    m = sqrt(num) + 1;\n    for (j = 2; j < m; j++)\n      if (num % j == 0) {\n        k++;\n        count(num / j, j);\n      }\n    cout << k + 1 << \"\\n\";\n  }\n  return 0;\n}\nvoid count(int num, int i) {\n  int j;\n  int n = sqrt(num);\n  for (j = i; j <= n; j++) {\n    if (num % j == 0) {\n      k++;\n      count((num / j), j);\n    }\n  }\n}\n"}
{"label": "1", "index": "72", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint times;\nvoid fenjie(int m, int k) {\n  int i;\n  {\n    for (i = k; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        fenjie(m / i, i);\n    }\n  }\n  times++;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int m;\n    times = 0;\n    cin >> m;\n    fenjie(m, 2);\n    printf(\"%d\\n\", times);\n  }\n}\n"}
{"label": "1", "index": "73", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int f) {\n  if (a == f)\n    return 1;\n  if (a < f)\n    return 0;\n  if (a % f == 0)\n    return factor(a, f + 1) + factor(a / f, f);\n  else\n    return factor(a, f + 1);\n}\n\nint main() {\n  int x, a;\n  cin >> x;\n  while (x > 0) {\n    cin >> a;\n    printf(\"%d\\n\", factor(a, 2));\n    x--;\n  }\n}\n"}
{"label": "1", "index": "74", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i * i <= a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    printf(\"%d\\n\", f(k, 2));\n    n--;\n  }\n}\n"}
{"label": "1", "index": "75", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint is_bottom, max;\nint div_foo(int n, int min);\n\nint main() {\n\n  int N;\n  cin >> N;\n  for (int index = 0; index < N; index++) {\n    int k;\n    cin >> k;\n    is_bottom = 0;\n    cout << div_foo(k, 2) + 1 << endl;\n  }\n\n  return 0;\n}\n\nint div_foo(int n, int min) {\n  int cal = 0;\n\n  for (int iter = min; iter <= sqrt(n); iter++) {\n    if (!(n % iter)) {\n      cal++;\n      int f1 = n / iter, f2 = iter, g;\n      g = div_foo(f1, f2);\n      cal += g;\n    }\n  }\n  return cal;\n}\n"}
{"label": "1", "index": "76", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\nint f(int x, int b) {\n  int j, re = 1;\n  if (x < b)\n    return 0;\n  for (j = b; j < x; j++) {\n    if (x % j == 0)\n      re = re + f(x / j, j);\n  }\n  return re;\n}\n"}
{"label": "1", "index": "77", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ge, s, w;           \nvoid fen(int h, int a); \nint main() {\n  int n = 0, k = 0; \n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> s;\n    ge = 0;\n    fen(s, 2);\n    cout << ge << endl;\n  }\n  return 0;\n}\nvoid fen(int h, int a) {\n  for (int i = 2; i <= h; i++) {\n    if ((h % i == 0) && (i >= a)) {\n      if (h / i != 1) {\n        fen(h / i, i);\n      } else {\n        ge++;\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "78", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0)\n      s += divide(n / i, i);\n  return s;\n}\nint main() {\n  int n, k;\n  cin >> k;\n  while (k > 0) {\n    cin >> n;\n    printf(\"%d\\n\", divide(n, n));\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "79", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int start);\n\nint main() {\n  int n, i, integ;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> integ;\n    cout << fenjie(integ, 2) << endl;\n  }\n  return 0;\n}\n\nint fenjie(int a, int start) {\n  int i, sum = 1;\n  if (start == a)\n    sum = 1;\n  else {\n    for (i = start; i <= sqrt(a); i++) {\n      if (a % i == 0) {\n        sum = sum + fenjie(a / i, i);\n      }\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "80", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint devide(int n, int k) {\n  int s, i;\n  s = 1;\n  for (i = k; i <= sqrt(n * 1.0); i++) {\n    if (n % i == 0) {\n      s = s + devide(n / i, i);\n    }\n  }\n  return s;\n}\nint main() {\n  int n, a[200], i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0)\n      printf(\"%d\", devide(a[i], 2));\n    else\n      printf(\"\\n%d\", devide(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "81", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint shi(int a) {\n  int b = sqrt(a);\n  for (int i = 2; i <= b; i++) {\n    if (a % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint shu(int m, int k) {\n  int a = 1;\n  for (int j = k; j <= sqrt(m); j++) {\n    if (m % j == 0 && m / j >= k) {\n      a++;\n      if (shi(m / j) == 0)\n        a += shu(m / j, j) - 1;\n    }\n  }\n  return a;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    int m;\n    cin >> m;\n    printf(\"%d\\n\", shu(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "82", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0, t = 2;\nvoid detach(int n) {\n  int i;\n  int q = t;\n  if (n == 1) {\n    num++;\n  } else {\n    for (i = t; i <= n / 2; i++) {\n      if (n % i == 0) {\n        n = n / i;\n        t = i;\n        detach(n);\n        n = n * i;\n        t = q;\n      }\n    }\n    if (i > n / 2 && n >= t) {\n      n = 1;\n      detach(n);\n    }\n  }\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    detach(a);\n    cout << num << endl;\n    num = 0;\n    t = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "83", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fuck(int n, int m) {\n  int i, cnt = 1;\n  if (m >= sqrt(n)) {\n    return 1;\n  }\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      cnt += fuck(n / i, i);\n  }\n  return cnt;\n}\nint main() {\n  int t, n, k;\n  scanf(\"%d \", &t);\n  for (k = 1; k <= t; k++) {\n    scanf(\"%d \", &n);\n    cout << fuck(n, 2) << endl;\n  }\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "1", "index": "84", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int N, int min) {\n  int s = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      s += f(N / i, i);\n    }\n  }\n  return s;\n}\n\nint main() {\n  int n, i, b = 2;\n  int a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", f(a[i], b));\n  return 0;\n}\n"}
{"label": "1", "index": "85", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factor(int, int);\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", factor(num, 2));\n  }\n  return 0;\n}\nint factor(int n, int min) {\n  int i;\n  int num = 1;\n  if (n < min)\n    return 0;\n  else {\n    for (i = min; i < n; i++) {\n      if (n % i == 0)\n        num += factor(n / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "86", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint temp = 2, sum = 0;\nvoid dg(int x) {\n  for (int i = temp; i <= x; i++) {\n    if (x % i == 0) {\n      temp = i;\n      if (x / i == 1) {\n        sum++;\n        temp = 2;\n      } else\n        dg(x / i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int x;\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    dg(x);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "87", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fun(int i, int j, int count) {\n  int k;\n  for (k = i; k <= sqrt(j); k++)\n    if (j % k == 0) {\n      count++;\n      count = fun(k, j / k, count);\n    }\n  return count;\n}\n\nint main() {\n  int count;\n  int k, n, i, j;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++) {\n    scanf(\"%d\", &n);\n    count = 1;\n    for (i = 2; i < sqrt(n); i++)\n      if (n % i == 0) {\n        count++;\n        count = fun(i, n / i, count);\n      }\n\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "88", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, sum;\nint fenjie(int min, int max) {\n  int i;\n  for (i = min; i <= sqrt(max); i++) {\n    if (max % i == 0 && i <= max / i) {\n      sum++;\n      fenjie(i, max / i);\n    }\n    if (i > max / i)\n      break;\n  }\n  return sum;\n}\nint main() {\n  int i, k;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &n);\n    sum = 1;\n    sum = fenjie(2, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "89", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nint a[100];\nvoid search(int t, int k) {\n  int i;\n  if (k == 1)\n    sum++;\n  else {\n    for (i = a[t - 1]; i <= k; i++)\n      if (k % i == 0) {\n        a[t] = i;\n        search(t + 1, k / i);\n      }\n  }\n}\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &k);\n    sum = 0;\n    a[0] = 2;\n    search(1, k);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "90", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int a, int b) {\n  int i, sign = 0, k = 0;\n  if (a < b)\n    return 0;\n  else {\n    if (a == b)\n      return 1;\n    else {\n      for (i = 2; i <= a - 1; i++) {\n        if (a % i == 0)\n          sign = 1;\n      }\n      if (sign != 1)\n        return 1;\n      else {\n        for (i = b; i <= a; i++) {\n          if (a % i == 0)\n            k += fenjie(a / i, i);\n        }\n        k += 1;\n        return k;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d\", &k);\n    printf(\"%d\\n\", fenjie(k, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "91", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum = 1;         \nvoid f(int b, int a) \n{\n  for (int i = b; i <= a; i++) { \n    if ((a % i == 0) && (i <= a / i)) {\n      sum = sum + 1; \n      f(i, a / i);   \n    }\n    if (i > a / i)\n      break;\n  }\n}\nint main() {\n  int a, n;\n  cin >> n;\n  while (n > 0) { \n    cin >> a;\n    sum = 1;\n    f(2, a);             \n    cout << sum << endl; \n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "92", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int x, int y) {\n  int i, s = 0;\n  if (x == y) {\n    return 1;\n  }\n  for (i = y; i < x; i++)\n    if (x % i == 0)\n      s += fenjie(x / i, i);\n  if (i == x)\n    s++;\n  return s;\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d \", &i);\n    cout << fenjie(i, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "93", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ifsushu(int n) {\n  if (n == 1) {\n    return 1;\n  } else {\n    for (int f = n - 1; f >= 2; f--) {\n      if (n % f == 0)\n        break;\n      if (f == 2) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}\nint sum = 0;\nint zhaoyinshu(int x, int max) {\n  if (x == 1) {\n    sum++;\n    return 0;\n  }\n  for (int i = max; i >= 2; i--) {\n    if (x % i == 0) {\n      zhaoyinshu(x / i, i);\n    }\n  }\n}\nint main() {\n  int time, number, t;\n  scanf(\"%d \", &time);\n  for (int j = 0; j < time; j++) {\n    scanf(\"%d \", &number);\n    if (ifsushu(number) == 1)\n      cout << \"1\" << endl;\n    else {\n      zhaoyinshu(number, number / 2);\n      cout << sum + 1 << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "94", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num, s = 1;\nvoid divide(int n, int a) {\n  for (int i = n; i <= a / s; i++) {\n    s *= i;\n    if (s == a)\n      num++;\n    else if (s < a && a % s == 0)\n      divide(i, a);\n    s /= i;\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    num = 0;\n    cin >> a;\n    divide(2, a);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "95", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint chu(int i, int n);\nint main() {\n  int n, m, i, j;\n  int sum[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &m);\n    sum[i] = 0;\n    for (j = 2; j <= sqrt(m); j++) {\n      if (m % j == 0) {\n        sum[i] += chu(j, m / j);\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    cout << sum[i] + 1 << \"\\n\";\n  }\n}\nint chu(int i, int n) {\n  int j, m, t;\n  t = 1;\n  m = n;\n  for (j = i; j <= sqrt(m); j++) {\n    if (m % j == 0) {\n\n      t += chu(j, (m / j));\n    }\n  }\n  return t;\n}\n"}
{"label": "1", "index": "96", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int x) {\n  int i;\n  if (x == 2)\n    return 1;\n\n  else {\n    int result = 1;\n    for (i = a; i <= x; i++)\n      if (x % i == 0 && x / i >= i)\n        result = result + f(i, x / i);\n    return result;\n  }\n}\nint main() {\n  int i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    printf(\"%d \", f(2, a));\n  }\n}\n"}
{"label": "1", "index": "97", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, i, factor;\n\nvoid f(int factor, int x) {\n  for (; factor * factor <= x; factor++) {\n    if (x % factor == 0) {\n      num++;\n      f(factor, x / factor);\n    }\n  }\n}\n\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    f(2, a);\n    cout << num << \"\\n\";\n    num = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "98", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nint main() {\n  int n, i, a[100];\n  void fenjie(int x, int y);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    t = 0;\n    fenjie(2, a[i]);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid fenjie(int x, int y) {\n  int j;\n  if (y == 1) {\n    t++;\n    return;\n  }\n  for (j = x; j <= y; j++) {\n    if (y % j == 0) {\n      fenjie(j, y / j);\n    }\n  }\n}\n"}
{"label": "1", "index": "99", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fact(int n, int m);\nint main() {\n  int n, a[35000], i, b[35000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = fact(a[i], 2);\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\nint fact(int n, int m) {\n  int sum = 1, i, temp = 0;\n  if (n < m)\n    return 0;\n  else if (n == 2)\n    return 1;\n  else {\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        sum = sum + fact(n / i, i);\n    }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "100", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint divmet(int n, int i);\nint main() {\n  int n = 0; \n  int t = 0; \n  int sum;   \n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n; j++) {\n      sum = sum + divmet(n, j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nint divmet(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divmet(n / i, j); \n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int j);\nint main() {\n  int n, a, s, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    s = f(a, 2) + 1;\n    cout << s << endl;\n  }\n\n  return 0;\n}\nint f(int a, int j) {\n  int i, tem;\n\n  int count = 0;\n  for (i = j; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      j = i;\n\n      if (a / i < j)\n        count += 1;\n      else {\n        count += (f(a / i, j) + 1);\n      }\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "102", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, m, j, re;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    cin >> m;\n    re = factor(m, 2);\n    printf(\"%d\\n\", re);\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "1", "index": "103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint times = 1;\nint used[1000] = {0};\nvoid fuck(int n) {\n\n  int i = 0;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (used[i] == 0 && n % i == 0) {\n      int j = 0;\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 1;\n      times++;\n      fuck(n / i);\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 0;\n    }\n  }\n}\nint main() {\n  int n = 0;\n  int num = 0;\n  cin >> n;\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    fuck(num);\n    cout << times << endl;\n    times = 1;\n    int k = 0;\n    for (k = 0; k <= 999; k++)\n      used[k] = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fi(int a, int j);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    cout << fi(a, 2) << \"\\n\";\n  }\n}\nint fi(int a, int k) {\n  int i, b = 1;\n  if (a == 1)\n    return 0;\n  for (i = k; i * i <= a; i++)\n    if (a % i == 0)\n      b = b + fi(a / i, i);\n  return b;\n}\n"}
{"label": "1", "index": "105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint is_bottom, max;\nint div_foo(int n, int min);\n\nint main() {\n\n  int N;\n  scanf(\"%d \", &N);\n  for (int index = 0; index < N; index++) {\n    int k;\n    cin >> k;\n    is_bottom = 0;\n    cout << div_foo(k, 2) + 1 << \"\\n\";\n  }\n\n  return 0;\n}\n\nint div_foo(int n, int min) {\n  int cal = 0;\n\n  for (int iter = min; iter <= sqrt(n); iter++) {\n    if (!(n % iter)) {\n      cal++;\n      int f1 = n / iter, f2 = iter, g;\n      g = div_foo(f1, f2);\n      cal += g;\n    }\n  }\n  return cal;\n}\n"}
{"label": "1", "index": "106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint c = 1;\n\nvoid fenjie(int a, int k) {\n  if (a == 1) {\n    c++;\n    return;\n  }\n  for (int i = k; i <= a; i++) {\n    if (a % i == 0)\n      fenjie(a / i, i);\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    c = 0;\n    cin >> a;\n    fenjie(a, 2);\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "107", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factorize(int a, int b) {\n  int factor, i;\n  if (a == 1)\n    factor = 1;\n  if (a != 1)\n    factor = 0;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      factor = factor + factorize(a / i, i);\n  return factor;\n}\nint main() {\n  int n, a;\n  for (cin >> n; n--; cout << factorize(a, 2) << endl)\n    cin >> a;\n  return 0;\n}\n"}
{"label": "1", "index": "108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint t = 1;\nvoid fen(int n, int i) {\n  for (i = i; i * i <= n; i++) {\n    if (n % i == 0) {\n      fen(n / i, i);\n      t++;\n    }\n  }\n}\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int n;\n    cin >> n;\n    t = 1;\n    fen(n, 2);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Digui(int a, int min) {\n  int i, result = 1;\n  if (a < min) {\n    return 0;\n  }\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += Digui(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int a[1000], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", Digui(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint im(int n, int max) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = max; i > 1; i--)\n    if (n % i == 0)\n      s += im(n / i, i);\n  return s;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d%d\", &n, &t);\n  printf(\"%d\", im(t, t));\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"\\n%d\", im(t, t));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "111", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n, num;\n\nvoid dfs(int i, int j) {\n  int x;\n\n  if (i == 1) {\n    num++;\n    return;\n  }\n  for (x = j; x <= i; x++)\n    if (i % x == 0)\n      dfs(i / x, x);\n}\n\nint main() {\n  cin >> m;\n  while (m > 0) {\n    num = 0;\n    cin >> n;\n    dfs(n, 2);\n    cout << num << endl;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "112", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  for (; i <= x; i++)\n    if (x % i == 0)\n      f(x / i, i);\n  return;\n}\n\nint main() {\n  int t, a, i = 2;\n  cin >> t;\n  for (a = 0; a < t; a++) {\n    int x;\n    cin >> x;\n    int ans = 1;\n    for (i = 2; i < sqrt(x); i++) {\n      sum = 0;\n      if (x % i == 0)\n        f(x / i, i);\n      ans = ans + sum;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "113", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 1;               \nvoid f(int begin, int m) { \n  int i;\n  for (i = begin; i <= m; i++) { \n    if (m % i == 0 && m / i >= i) {\n      sum++;\n      f(i, m / i);\n    } \n    if (i > m / i)\n      break; \n  }\n}\nint main() {\n  int n, j, m;\n  cin >> n;                  \n  for (j = 1; j <= n; j++) { \n    cin >> m;\n    f(2, m);\n    cout << sum << endl; \n    sum = 1;             \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t = 0, ways;\nvoid divide(int x, int h) {\n  int i;\n  if (x == 1) {\n    t++;\n    ways = t;\n  } else\n    for (i = h; i <= x; i++) {\n      if (x % i == 0) {\n        h = i;\n        divide(x / h, h);\n      }\n    }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    t = 0;\n    divide(a[i], 2);\n    printf(\"%d\\n\", ways);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenj(int x, int y) {\n  int a = (x == 1), i;\n  for (i = y; i <= x; i++) \n    if (x % i == 0)\n      a = a + fenj(x / i, i); \n  return a;\n}\nint main() {\n  int k;\n  cin >> k;\n  int a[k];\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n  for (int i = 0; i < k; i++)\n    cout << fenj(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint devide(int n, int k) {\n  int s, i;\n  s = 1;\n  for (i = k; i <= sqrt(n * 1.0); i++) {\n    if (n % i == 0)\n      s = s + devide(n / i, i);\n  }\n  return s;\n}\nint main() {\n  int n, a[200], i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      printf(\"%d\", devide(a[i], 2));\n    else\n      printf(\"\\n%d\", devide(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int m) {\n  if (a < m)\n    return 0;\n  int kind = 1;\n  for (int i = m; i < a; i++) {\n    if (a % i == 0)\n      kind = kind + f(a / i, i);\n  }\n  return kind;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    cout << f(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "118", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint count(int x, int y) {\n  if (x < y)\n    return 0;\n  if (x >= y) {\n    int sum = 0;\n    for (int j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + count(x / j, j);\n    }\n    return sum + 1;\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++) {\n    cout << count(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ways(int a, int min);\n  int n, b;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", ways(b, 2));\n  }\n}\nint ways(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 0, i;\n  for (i = min; i <= sqrt(a * 1.0); i++) {\n    if (a % i == 0)\n      sum = sum + ways(a / i, i);\n  }\n  return sum + 1;\n}\n"}
{"label": "1", "index": "120", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nvoid out(int, int);\n\nint t = 1;\n\nint main() {\n  int n = 0;\n  int i = 0;\n  double sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> sum;\n    out(sum, 2.0);\n    cout << t << endl;\n    t = 1;\n  }\n\n  cin >> i;\n\n  return 0;\n}\n\nvoid out(int sum, int q) {\n  int num = 0;\n  double m = sum;\n  num = sqrt(m);\n  if (sum % q == 0 && q <= num) {\n    t++;\n    out(sum / q, q);\n    out(sum, q + 1);\n  }\n  if (sum % q != 0 && q <= num)\n    out(sum, q + 1);\n}\n"}
{"label": "1", "index": "121", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num;\n\nint wrh(int n, int r, int b[200], int y, int a) {\n  int i;\n  for (i = y; i <= a / 2; i++) {\n    if (r % i == 0) {\n      b[n] = i;\n      int now = 1, j;\n      for (j = 1; j <= n; j++)\n        now = now * b[j];\n      if (now == a) {\n        num++;\n        break;\n      }\n      if (now > a)\n        break;\n      else\n        wrh(n + 1, r / i, b, i, a);\n    }\n  }\n  return 0;\n}\n\nint main() {\n\n  int s, a, b[200];\n  cin >> s;\n  while (s > 0) {\n    num = 0;\n    cin >> a;\n    wrh(1, a, b, 2, a);\n    cout << num + 1 << endl;\n    s--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, m, j, re;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &m);\n    re = factor(m, 2);\n    cout << re << \"\\n\";\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "1", "index": "123", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calc(int a, int b) {\n  if (a * a > b)\n    return 1;\n  if (b % a == 0) {\n    return (calc(a, b / a) + calc(a + 1, b));\n  }\n  return calc(a + 1, b);\n}\nint main(int argc, const char *argv[]) {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << calc(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0, t = 2;\nvoid detach(int n) {\n  int i;\n  int q = t;  \n  if (n == 1) \n  {\n    num++;\n  } else {\n    for (i = t; i <= n / 2; i++) \n    {\n      if (n % i == 0) {\n        n = n / i;\n        t = i;     \n        detach(n); \n        n = n * i; \n        t = q;\n      }\n    }\n    if (i > n / 2 && n >= t) \n    {\n      n = 1;\n      detach(n);\n    }\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;            \n    detach(a);           \n    cout << num << endl; \n    num = 0;             \n    t = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sushu(int a) {\n  int b = 2, c, d = 0, k;\n  while (b < a) {\n    c = a % b;\n    if (c != 0) {\n      b = b + 1;\n      d = d + 1;\n    } else\n      break;\n  }\n\n  if (d == (a - 2))\n    k = 1;\n  else\n    k = 0;\n  return k;\n}\nint zheng(int n, int i) {\n  int sum = 1, a;\n  for (a = i; a < n / 2; a++) {\n    if (n % a == 0) {\n      if (a <= n / a) {\n        sum = sum + zheng(n / a, a);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j = 0, k = 0, b[10000] = {0}, e[40000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &e[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (sushu(e[i]) == 0) {\n      b[i] = zheng(e[i], 2);\n    } else {\n      b[i] = 1;\n    }\n  }\n\n  cout << b[0];\n  for (i = 1; i < n; i++)\n    cout << \"\\n\" << b[i];\n  return 0;\n}\n"}
{"label": "1", "index": "126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 2;\nint result = 0;\nvoid function_1(int, int);\nint main() {\n  int n = 0;\n  int data = 0;\n  int i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> data;\n    function_1(data, a);\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\nvoid function_1(int x, int y) {\n  int j = 0;\n  if (x == 1)\n    result = result + 1;\n\n  for (j = y; j <= x; j++) {\n    if (x % j == 0)\n      function_1(x / j, j);\n  }\n}\n"}
{"label": "1", "index": "127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint times;\nint move(int a, int num) \n{\n  int i;\n  if (num == 1)\n    times++;\n  for (i = 2; i <= num; i++)\n    if (num % i == 0 && i >= a)\n      move(i, num / i);\n  return times;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n]; \n  for (i = 0; i < n; i++) {\n    times = 0;\n    b[i] = move(1, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t, m, n, i, j, k, xx, x1, x2, x, y, s, n0;\n\nvoid init(int a[], int b[]) {\n  freopen(\"tt.in\", \"r\", stdin);\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n  freopen(\"tt.out\", \"w\", stdout);\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n}\nvoid proce(int n, int b) {\n  int i;\n  if (n == 1)\n    s++;\n  else\n    for (i = b; i <= n0; i++)\n      if (!(n % i))\n        proce(n / i, i);\n}\n\nint main() {\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &x);\n    s = 0;\n    n0 = x;\n    proce(x, 2);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum, temp;\nvoid fact(int);\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    sum = 0;\n    temp = 2;\n    fact(k);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid fact(int k) {\n  if (k == 1) {\n    sum++;\n    return;\n  }\n  int i;\n  for (i = temp; i <= k; i++) {\n    if (k % i == 0) {\n      temp = i;\n      fact(k / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint means(int, int);\nint main() {\n  int n, i = 0;\n  cin >> n;\n  while (i < n) {\n    int a;\n    scanf(\"%d \", &a);\n    cout << means(a, a) << endl;\n    i++;\n  }\n  return 0;\n}\n\nint means(int a, int b) {\n  int i, sum = 0;\n  if (a != 1) {\n    for (i = b; i >= 2; i--) {\n      if (a % i == 0) {\n        sum = sum + means(a / i, i);\n      }\n    }\n    return sum;\n  } else {\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "131", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int n, int x) {\n  int i, t = 0;\n  for (i = x; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      t = t + 1 + fenjie(n / i, i);\n  }\n  return t;\n}\nint main() {\n  int i, t, n;\n  scanf(\"%d \", &t);\n  for (i = 0; i < t; i++) {\n    scanf(\"%d \", &n);\n    cout << fenjie(n, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint prime(int n, int m) {\n  int i, total = 1;\n  if (n < m)\n    return 0;\n\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      total += prime(n / i, i);\n  }\n  return total;\n}\nint main() {\n  int n, b[2000], b0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b0);\n    b[i] = prime(b0, 2);\n  }\n  for (i = 0; i <= n - 2; i++)\n    cout << b[i] << \"\\n\";\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "1", "index": "133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int);\n\nint solutionnum = 1;\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    fenjie(a);\n    cout << solutionnum << endl;\n    solutionnum = 1;\n  }\n  return 0;\n}\nint yinzi[100] = {2}, i = 0;\n\nvoid fenjie(int x) {\n  int j;\n  for (j = yinzi[i]; j < x; j++) {\n    if (x % j == 0 && x / j >= j) {\n      i++;\n      yinzi[i] = j;\n      fenjie(x / j);\n      j = yinzi[i];\n      i--;\n      solutionnum++;\n    }\n  }\n}\n"}
{"label": "1", "index": "134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 1, k = 0;\nint count(int n) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= k) {\n      num++;\n      k = i;\n      count(n / i);\n      k = 0;\n    }\n  }\n  return (num);\n}\nint main() {\n  int i, n, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << count(a[i]) << endl;\n    num = 1;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint division(int m, int k) {\n  int num = 0;\n  if (m >= k) {\n    for (int i = k; i <= m; i++) {\n      if (m == i) {\n        num++;\n      } else if (m % i == 0)\n        num += division(m / i, i);\n    }\n  }\n  return num;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", division(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint part(int x, int t) {\n  int i;\n  int number = 1;\n  if (x == 1) {\n    return 0;\n  }\n  if (x == 2) {\n    return 1;\n  }\n  for (i = t; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      number += part(x / i, i);\n    }\n  }\n  return number;\n}\n\nint main() {\n  int i, n, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << part(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fenjie(int);\n\nint fenjie(int q1, int n1) {\n  int s1, i1;\n  if (q1 > n1)\n    return 0;\n  else {\n    s1 = 0;\n    for (i1 = q1; i1 <= n1; i1++) {\n      if ((i1 >= 2) && (n1 % i1 == 0) && (n1 / i1 >= i1)) {\n        s1++;\n        s1 = s1 + fenjie(i1, n1 / i1);\n      }\n    }\n    return s1;\n  }\n}\n\nint main() {\n  int m, i, n;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    cout << fenjie(1, n) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factoring(int a, int b) {\n  int i, kind = 0;\n  if (a == 1) {\n    kind = 1;\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int n, i, j, a[30000] = {0}, b[30000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = factoring(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "139", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint b, j, f[1010];\n\nvoid factorization(int x) {\n  int now, i;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= f[j]) {\n      f[++j] = i;\n      now = x / i;\n      if (now == 1) {\n        b++;\n      } else {\n        factorization(now);\n      }\n\n      j--;\n    }\n  }\n  return;\n}\nint main() {\n  int n, i, num;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    b = 0;\n    j = 0;\n    memset(f, 0, sizeof(f));\n    cin >> num;\n    factorization(num);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a, int min);\n  int n, a[150], i, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = f(a[i], 2);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min) {\n    return 0;\n  }\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint Factor(int, int);\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", Factor(a, 2));\n  }\n  return 0;\n}\nint Factor(int a, int p) {\n  int i, j, z = 1;\n  if (a < p)\n    z = 0;\n  else {\n    for (i = p; i <= a; i++) {\n      if (a % i == 0)\n        z += Factor(a / i, i);\n    }\n  }\n  return z;\n}\n"}
{"label": "1", "index": "142", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int x) {\n  int count = 1, i;\n  for (i = x; i < a; i++)\n    if (a % i == 0)\n      count += f(a / i, i);\n  if (i == a)\n    return count;\n  else\n    return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &a);\n    if (a == 1 || a == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "143", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ifsushu(int n) {\n  if (n == 1) {\n    return 1;\n  } else {\n    for (int f = n - 1; f >= 2; f--) {\n      if (n % f == 0) {\n        break;\n      }\n      if (f == 2) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}\nint sum = 0;\nint zhaoyinshu(int x, int max) {\n  if (x == 1) {\n    sum++;\n    return 0;\n  }\n  for (int i = max; i >= 2; i--) {\n    if (x % i == 0) {\n      zhaoyinshu(x / i, i);\n    }\n  }\n}\nint main() {\n  int time, number, t;\n  cin >> time;\n  for (int j = 0; j < time; j++) {\n    cin >> number;\n    if (ifsushu(number) == 1) {\n      cout << \"1\" << endl;\n    } else {\n      zhaoyinshu(number, number / 2);\n      cout << sum + 1 << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int c, int t);\nint main() {\n  int n, c;\n  cin >> n;\n  for (; n > 0; n--) {\n    scanf(\"%d\", &c);\n    if (c == 1 || c == 2)\n      cout << \"1\\n\";\n    else\n      printf(\"%d\\n\", f(c, 2));\n  }\n}\nint f(int c, int t) {\n  int count = 1, i;\n  for (i = t; i < c; i++) {\n    if (c % i == 0)\n      count += f(c / i, i);\n  }\n  if (i == c)\n    return count;\n  else\n    return 0;\n}\n"}
{"label": "1", "index": "145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    scanf(\"%d \", &n);\n    for (int j = 2; j <= n / 2; j++) {\n      sum = sum + divide(n, j);\n    }\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\nint divide(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divide(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(int i, int a) {\n  int means = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      means += check(i, a / i);\n  }\n  return means;\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << check(2, a) << endl;\n  }\n}\n"}
{"label": "1", "index": "147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  else {\n    for (; i <= x; i++)\n      if (x % i == 0) {\n        f(x / i, i);\n      }\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n > 0) {\n\n    int x = 0, i, ans = 1;\n    scanf(\"%d \", &x);\n    for (i = 2; i * i < x; i++) {\n      if (x % i == 0) {\n        sum = 0;\n        f(x / i, i);\n        ans += sum;\n      }\n    }\n    cout << ans << endl;\n    n--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "148", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t = 0, ways;\nvoid divide(int x, int h) {\n  int i;\n  if (x == 1) {\n    t++;\n    ways = t;\n  } else\n    for (i = h; i <= x; i++)\n      if (x % i == 0) {\n        h = i;\n        divide(x / h, h);\n      }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    t = 0;\n    divide(a[i], 2);\n    printf(\"%d\\n\", ways);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Digui(int a, int min) {\n  int i, result = 1;\n  if (a < min) {\n    return 0;\n  }\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += Digui(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int a[1000], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", Digui(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "150", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint d;\nint fen(int i, int a) {\n  if (i > a) {\n    return 0;\n  }\n  int result = 1;\n  int j;\n  for (j = i; j < a; j++) {\n    if (a % j == 0) {\n      result = result + fen(j, a / j);\n    }\n  }\n  return result;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k = 0;\n  while (k < n) {\n\n    int a;\n    cin >> a;\n    int i = 2;\n    d = fen(i, a);\n    cout << d << endl;\n    k++;\n  }\n  return 0;\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int m, int i);\nint num;\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    num = 0;\n    fun(a, 2);\n    printf(\"%d\\n\", num + 1);\n  }\n  return 0;\n}\nvoid fun(int m, int i) {\n  int k = sqrt(m);\n  for (i = i; i <= k; i++) {\n    if (m % i == 0) {\n      num++;\n      fun(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint numcheck(int num, int a) \n{\n  int i = 0, sum = 0;\n  if (num == 1) \n    return 1;\n  else if (num < a)\n    return 0;\n  else {\n    for (i = a; i <= num; i++) \n    {\n      if (num % i == 0)\n        sum = sum + numcheck(num / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, num = 0, sum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    sum = numcheck(num, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "153", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum += 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, num, sign;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    for (j = num; j > 1; j--)\n      if (num % j == 0)\n        sign = j;\n    printf(\"%d\\n\", yinshu(num, sign) + 1);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "1", "index": "154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int, int);\n\nint fenjie(int q1, int n1) {\n  int s1, i1;\n  if (q1 > n1) {\n    return 0;\n  } else {\n    s1 = 0;\n    for (i1 = q1; i1 <= n1; i1++) {\n      if ((i1 >= 2) && (n1 % i1 == 0) && (n1 / i1 >= i1)) {\n        s1++;\n        s1 = s1 + fenjie(i1, n1 / i1);\n      }\n    }\n    return s1;\n  }\n}\n\nint main() {\n  int m, i, n;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    cout << fenjie(1, n) + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "155", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a, n, sum = 0;\nvoid t(int m) {\n  int i, j;\n  for (i = m; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1) {\n        sum += 1;\n      } else {\n        t(i);\n      }\n      a = a * i;\n    }\n  }\n}\n\nint main() {\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    scanf(\"%d \", &a);\n    t(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nint wrh(int n, int r, int b[200], int y, int a) {\n  int i;\n  for (i = y; i <= a / 2; i++) {\n    if (r % i == 0) {\n      b[n] = i;\n      int now = 1, j;\n      for (j = 1; j <= n; j++)\n        now = now * b[j];\n      if (now == a) {\n        num++;\n        break;\n      }\n      if (now > a)\n        break;\n      else\n        wrh(n + 1, r / i, b, i, a);\n    }\n  }\n  return 0;\n}\n\nint main() {\n\n  int s, a, b[200];\n  scanf(\"%d \", &s);\n  while (s > 0) {\n    num = 0;\n    cin >> a;\n    wrh(1, a, b, 2, a);\n    printf(\"%d\\n\", num + 1);\n    s--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "157", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a = 1;\nint yinzi(int j, int n) {\n  for (int i = j; i < n; i++) {\n    if (n % i == 0 && n != i && n / i >= i) {\n      a++;\n      yinzi(i, n / i);\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, s;\n  cin >> s;\n  for (int j = 0; j < s; j++) {\n    cin >> n;\n    for (int i = 2; i <= n; i++) {\n      if (n % i == 0 && n / i >= i) {\n        a++;\n        yinzi(i, n / i);\n      }\n    }\n    printf(\"%d\\n\", a);\n    a = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint decomposition(int m, int k) {\n  int res = 1;\n  for (int i = k; i * i <= m; i++) {\n    if (m % i == 0 && m / i >= i) {\n\n      res += decomposition(m / i, i);\n    }\n  }\n  return res;\n}\nint main() {\n  int n;\n  while (scanf(\"%d\", &n) == 1) {\n    for (int i = 0; i < n; i++) {\n      int m;\n      scanf(\"%d\", &m);\n      printf(\"%d\\n\", decomposition(m, 2));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint qq(int m) {\n  int i, j;\n  j = 0;\n  for (i = 2; i * i <= j; i++) {\n    if (m % i == 0) {\n      j = 1;\n      break;\n    }\n  }\n  return j;\n}\n\nint pp(int m, int j) {\n  int i, k = 0;\n  if (m == 1)\n    return 1;\n  else {\n    k++;\n    for (i = j; i * i <= m; i++) {\n      if (qq(i) == 0 && m % i == 0) {\n        k = k + pp(m / i, i);\n      }\n    }\n  }\n  return k;\n}\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  int aa[n + 1];\n  for (i = 1; i <= n; i++) {\n    cin >> p;\n    aa[i] = pp(p, 2);\n  }\n  for (i = 1; i <= n; i++)\n    cout << aa[i] << endl;\n\n  return 0;\n}\n"}
{"label": "1", "index": "160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint times;\nint move(int a, int num) {\n  int i;\n  if (num == 1)\n    times++;\n  for (i = 2; i <= num; i++)\n    if (num % i == 0 && i >= a)\n      move(i, num / i);\n  return times;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    times = 0;\n    b[i] = move(1, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Fz(int, int);\nint main() {\n  int n, num[1000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num[i] = Fz(a, 2);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\nint Fz(int x, int m) {\n  int s = 1, i;\n  int y = (int)sqrt((double)x);\n  for (i = m; i <= y; i++) {\n    if (x % i == 0)\n      s = s + Fz(x / i, i);\n  }\n  return s;\n}\n"}
{"label": "1", "index": "162", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if (y == x)\n    return 1;\n  if (y > x)\n    return 0;\n  if (x % y == 0)\n    return f(x, y + 1) + f(x / y, y);\n  else\n    return f(x, y + 1);\n}\nint main() {\n  int n, x;\n  cin >> n;\n  int z, i;\n  i = n;\n  while (i > 0) {\n    i = i - 1;\n    cin >> x;\n    z = f(x, 2);\n    printf(\"%d\\n\", z);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid recur(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      recur(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int t = 0;\n  cin >> t;\n  for (int k = 0; k < t; k++) {\n    int n = 0;\n    cin >> n;\n    int res = 1;\n    for (int i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        recur(n / i, i);\n        res += sum;\n      }\n    }\n    cout << res << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint zhi(int a);\nint yin(int m, int t);\nint main() {\n  int n, i = 0;\n  int str[10000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  i = 0;\n  for (i = 0; i < n; i++)\n    cout << yin(str[i], 2) << \"\\n\";\n  return 0;\n}\n\nint zhi(int a) {\n  int k = 2, flag = 0;\n  for (k = 2; k <= a / 2; k++) {\n    if (a % k == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  return flag;\n}\n\nint yin(int m, int t) {\n  int j = t, c = 0, b = 0, x = 0;\n  int str1[10000][2];\n  if (m < t && m != 1)\n    return 0;\n  else if (m == 1)\n    return 1;\n  else if (zhi(m) == 0)\n    return 1;\n  else\n    for (j = t; j <= m; j++) {\n      if (m % j == 0) {\n        str1[c][0] = m / j;\n        str1[c][1] = j;\n        c++;\n      }\n    }\n  for (b = 0; b < c; b++) {\n    x += yin(str1[b][0], str1[b][1]);\n  }\n  return x;\n}\n"}
{"label": "1", "index": "165", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int n, int m);\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << f(num, 2) << endl;\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int i, count = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0) {\n      count += f(n / i, i);\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0)\n      sum += f(i, y / i) + 1;\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &x);\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++)\n    cout << f(2, b[i]) + 1 << endl;\n\n  return 0;\n}\n"}
{"label": "1", "index": "167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint t = 0;\nint mini(int k, int i) {\n  if (k == 1)\n    t = t + 1;\n  for (; i <= k; i++) {\n    if (k % i == 0) {\n      mini(k / i, i);\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int N, n;\n  cin >> N;\n  for (n = 0; n <= N - 1; n++) {\n    int M;\n    cin >> M;\n    mini(M, 2);\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n}\n"}
{"label": "1", "index": "168", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ct;\nint count(int n, int p) {\n  int i;\n  if (n == 1)\n    ct++;\n  for (i = p; i <= n; i++)\n    if (n % i == 0)\n      count(n / i, i);\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    ct = 0;\n    cin >> n;\n    count(n, 2);\n    cout << ct << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid f(int x, int y) {\n  int i = 0;\n  if (x >= y)\n    for (i = y; i <= x; i++) {\n      if (i == x)\n        count_1++;\n      if (x % i == 0)\n        f(x / i, i);\n    }\n}\nint main() {\n  int n, i, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d\", &x);\n    f(x, 2);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "170", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum = sum + 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int num, sign;\n    scanf(\"%d \", &num);\n    for (int j = num; j > 1; j--) {\n      if (num % j == 0) {\n        sign = j;\n      }\n    }\n    cout << yinshu(num, sign) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fen(int a, int k) {\n  int s = 0, j, t = 0;\n  if (a == 1 && a >= k)\n    s = 1;\n  else if (a == k) {\n    s = 1;\n  } else {\n    for (j = 2; j <= a; j++) {\n      if (a % j == 0 && j >= k) {\n        s = s + fen(a / j, j);\n      }\n      t = 1;\n    }\n    if (t == 0)\n      s++;\n  }\n  return s;\n}\nint main() {\n  int n, i, q, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fen(a, 1));\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "1", "index": "172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid factor(int a, int k);\nint sum = 0;\nint main() {\n  int n, a, i = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    factor(a, 2);\n    cout << sum + 1 << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n\nvoid factor(int a, int k) {\n  int b, j;\n  b = (int)sqrt((double)a);\n  for (j = k; j <= b; j++) {\n    if (a % j == 0) {\n      sum++;\n      factor(a / j, j);\n    }\n  }\n  j = k;\n}\n"}
{"label": "1", "index": "173", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint countt;\nvoid f(int p, int q) {\n  for (int m = p; m <= sqrt(q); m++) {\n    if (q % m == 0) {\n      countt++;\n      f(m, q / m);\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    countt = 0;\n    for (int k = 2; k <= sqrt(num); k++) {\n      if (num % k == 0) {\n        countt++;\n        f(k, num / k);\n      }\n    }\n    cout << countt + 1 << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "174", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int i, int m);\nint sum;\nint main() {\n  int n, i, m, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 1;\n    cin >> m;\n    f(2, m);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid f(int i, int m) {\n  int k, s;\n  s = (int)sqrt(m);\n  for (k = i; k <= s; k++) {\n    if (m % k == 0) {\n      sum++;\n      f(k, m / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum = 0;\nint geshu(int a, int x) {\n  int y, z;\n  z = a;\n  y = (int)sqrt(a);\n  while (x <= y) {\n    if (a % x == 0) {\n      a = a / x;\n      geshu(a, x);\n    }\n    if (a == z / x)\n      a = z;\n    x++;\n  }\n  sum++;\n  return sum;\n}\nint main() {\n  int n, i, a[100], b[100], x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] == 2 || a[i] == 3)\n      b[i] = 1;\n    else {\n      sum = 0;\n      x = 2;\n      b[i] = geshu(a[i], x);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int c);\nint j, b;\nint main() {\n  int i, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int a, int c) {\n  int j, b = 0;\n  for (j = c; j <= sqrt(a); j++) {\n\n    if (a % j == 0)\n      b = b + f(a / j, j);\n  }\n  return b + 1;\n}\n"}
{"label": "1", "index": "177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a, cnt = 0, num;\nint decompose(int x, int y) {\n  int i, xnum = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (i = y; i <= (int)sqrt(x); i++)\n    if (x % i == 0)\n      xnum += decompose(x / i, i);\n  return xnum;\n}\nint main() {\n  cin >> n;\n  while (cnt < n) {\n    cin >> a;\n    num = decompose(a, 2);\n    cout << num << endl;\n    cnt++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint way(int x, int m) {\n  int sum = 0, p = 0, i;\n  for (i = m; i < x; i++)\n    if (x % i == 0) {\n      p++;\n      sum = sum + way(x / i, i);\n    }\n  sum = sum + 1;\n  if (p == 0) {\n    sum = 1;\n  }\n  if (m > x)\n    sum = 0;\n  return (sum);\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", way(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint get(int n, int m) {\n  if (n == 1)\n    return 1;\n  while (m >= 2) {\n    if (n % m == 0)\n      break;\n    --m;\n  }\n  if (m == 1)\n    return 0;\n  return get(n / m, m) + get(n, m - 1);\n}\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; ++i) {\n    int n;\n    cin >> n;\n    printf(\"%d\\n\", get(n, n));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "180", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s = 0, p;\nint a[100];\nvoid factor(int m, int n, int t) {\n  int i;\n  for (i = 2; i <= (int)sqrt(n); i++)\n    if ((n % i == 0) && (i >= m)) {\n      s++;\n      factor(i, n / i, t + 1);\n    }\n  return;\n}\nint main() {\n  int i, j = 0, k;\n  scanf(\"%d \", &j);\n  for (k = 0; k < j; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < j; k++) {\n    p = a[k];\n    s = 0;\n    for (i = 2; i <= (int)sqrt(p); i++)\n      if (p % i == 0) {\n        s++;\n        factor(i, p / i, 2);\n      }\n    a[k] = s;\n  }\n  for (k = 0; k < j; k++)\n    printf(\"%d\\n\", a[k] + 1);\n  return 0;\n}\n"}
{"label": "1", "index": "181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid qut(int a, int b); \nint num = 0;            \nint main() {\n  int i, n, g[1000]; \n  cin >> n;\n  for (i = 0; i < n; i++) \n    cin >> g[i];\n  for (i = 0; i < n; i++) {\n    qut(g[i], 1); \n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n\nvoid qut(int a, int b) {\n  int i;\n  if (a >= b) {\n    num++;\n    if (b == 1)\n      b++;\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        qut(a / i, i); \n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  else {\n    for (; i <= x; i++)\n      if (x % i == 0)\n        f(x / i, i);\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n\n    int x = 0, i, ans = 1;\n    cin >> x;\n    for (i = 2; i * i < x; i++) {\n      if (x % i == 0) {\n        sum = 0;\n        f(x / i, i);\n        ans += sum;\n      }\n    }\n    cout << ans << \"\\n\";\n    n--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int x) {\n  int i, j;\n  if (x == 2)\n    return 1;\n\n  else {\n    int result = 1;\n    for (i = a; i <= x; i++)\n      if (x % i == 0 && x / i >= i)\n        result = result + f(i, x / i);\n    return result;\n  }\n}\nint main() {\n  int i;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    printf(\"%d \", f(2, a));\n  }\n}\n"}
{"label": "1", "index": "184", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a, int b) {\n  if (a > b)\n    return b;\n  else\n    return a;\n}\nint f(int n, int s) {\n  int k = 0, i;\n  if (n == 1)\n    return 1;\n  else if (s == 1)\n    return 0;\n  else if (s > n)\n    return f(n, n);\n  else {\n    for (i = 2; i <= s; i++)\n      if (n % i == 0)\n        k = k + f(n / i, min(i, s));\n    return k;\n  }\n}\nint main() {\n  int n, m;\n  cin >> n;\n  while (n > 0) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, m));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "185", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d;\nint fen(int i, int a) {\n  if (i > a) {\n    return 0;\n  }\n  int result = 1;\n  int j;\n  for (j = i; j < a; j++) {\n    if (a % j == 0) {\n      result = result + fen(j, a / j);\n    }\n  }\n  return result;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k = 0;\n  while (k < n) {\n\n    int a;\n    cin >> a;\n    int i = 2;\n    d = fen(i, a);\n    printf(\"%d\\n\", d);\n    k++;\n  }\n  return 0;\n  cin.get();\n  cin.get();\n  cin.get();\n}\n"}
{"label": "1", "index": "186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid fenjie(int t, int n) {\n  int i = 0;\n  if (n == 1)\n    sum++;\n  for (i = t; i <= n; i++) {\n    if (n % i == 0) {\n      fenjie(i, n / i);\n    }\n  }\n}\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    sum = 0;\n    fenjie(2, k);\n    n--;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int c, int t);\nint main() {\n  int n, c;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &c);\n    if (c == 1 || c == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(c, 2));\n  }\n  return 0;\n}\nint f(int c, int t) {\n  int count = 1, i;\n  for (i = t; i < c; i++) {\n    if (c % i == 0)\n      count += f(c / i, i);\n  }\n  if (i == c)\n    return count;\n  else\n    return 0;\n}\n"}
{"label": "1", "index": "188", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint p(int a, int m) {\n  int t = 0;\n  int i;\n  if (a % m != 0)\n    return 0;\n  if ((a % m == 0) && (a / m < m) && (a != m))\n    return 0;\n  if (a == m)\n    return 1;\n  if ((a % m == 0) && (a / m >= m)) {\n    for (i = m; i <= a / m; i++) {\n      t = t + p(a / m, i);\n    }\n    return t;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int x;\n  int j;\n  int num = 0;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    for (j = 2; j <= x; j++) {\n      num = num + p(x, j);\n    }\n    cout << num << endl;\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, num;\nint make(int a);\nint pan(int a);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    num = 0;\n    m = a;\n    cout << make(a) << endl;\n  }\n  return 0;\n}\nint pan(int a) {\n  int n = 0, i;\n  for (i = 1; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      n++;\n  }\n  if (n == 1)\n    return 0;\n  else\n    return 1;\n}\nint make(int a) {\n  int i, j, ans;\n  ans = sqrt(a);\n  if (pan(a) == 0) {\n    num++;\n    return num;\n  } else {\n    num++;\n    for (i = m / a; i <= ans; i++) {\n      if (i == 1)\n        continue;\n      if (a % i == 0) {\n        m = a;\n        num = make(a / i);\n      }\n    }\n    if (i == ans + 1)\n      return num;\n  }\n  return num;\n}\n"}
{"label": "1", "index": "190", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a = 0, i = 0, sum = 1; \nvoid f(int i, int a) {     \n  int j;\n  for (j = i; j <= sqrt(a); j++)\n    if (a % j == 0) {\n      sum++;\n      f(j, a / j);\n    } \n} \nint main() {\n  int n;\n  cin >> n;\n  while (n) {\n    cin >> a;\n    f(2, a);\n    cout << sum << endl;\n    n--;\n    sum = 1; \n  }\n}\n"}
{"label": "1", "index": "191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int brea(int a, int min);\n  int i, n, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", brea(a, 2));\n  }\n  return 0;\n}\n\nint brea(int a, int min) {\n  int result = 1;\n  int i;\n  if (a < min)\n    return (0);\n  else if (a == min)\n    return (1);\n  else {\n    for (i = min; i < a; i++) {\n      if (a % i == 0)\n        result = result + brea(a / i, i);\n    }\n    return (result);\n  }\n}\n"}
{"label": "1", "index": "192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenj(int x, int y) {\n  int a = (x == 1), i;\n  for (i = y; i <= x; i++)\n    if (x % i == 0)\n      a = a + fenj(x / i, i);\n  return a;\n}\nint main() {\n  int k;\n  cin >> k;\n  int a[k];\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < k; i++)\n    cout << fenj(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min) \n{\n  int j, num; \n  if (a < min)\n    return 0;               \n  num = 1;                  \n  for (j = min; j < a; j++) \n    if (a % j == 0)\n      num = num + f(a / j, j); \n  return num;                  \n}\n\nint main() {\n  int n, i, out, a; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    out = f(a, 2); \n    cout << out << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "194", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint f(int a, int b) {\n  for (int i = a; i > 1; i--) {\n    if (a % i != 0)\n      continue;\n    else {\n      if (i > b) {\n        continue;\n      } else {\n        int q;\n        q = a / i;\n        if (q == 1) {\n          sum++;\n        } else {\n          f(q, i);\n        }\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    int c;\n    c = f(num, num);\n    cout << c << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "195", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cnt = 0;\n\nvoid slv(int nm, int pr) {\n  int i;\n  if (nm >= pr) {\n    cnt++;\n    if (pr == 1)\n      pr++;\n    for (i = pr; i <= nm; i++) {\n      if (nm % i == 0)\n        slv(nm / i, i);\n    }\n  }\n}\n\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cnt = 0;\n    scanf(\"%d \", &num);\n    slv(num, 1);\n    printf(\"%d\\n\", cnt);\n  }\n}\n"}
{"label": "1", "index": "196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s(int n, int m) {\n  if (n == 1)\n    return 1;\n  int an = 0;\n  for (int i = m; i > 1; i--) {\n    if (n % i == 0)\n      an += s(n / i, min(i, n / i));\n  }\n  return an;\n}\nint main() {\n  int N;\n  cin >> N;\n  int x;\n  for (N; N > 0; N--) {\n    cin >> x;\n    cout << s(x, x) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int t, int k) {\n  int u = 1, i;\n  if (t > 2) {\n    for (i = k; i <= sqrt(t); i++) {\n      if (t % i == 0)\n        u += f(t / i, i);\n    }\n    return u;\n  } else if (t == 2)\n    return 1;\n  else if (t == 1)\n    return 0;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d \", f(t, 2));\n  }\n}\n"}
{"label": "1", "index": "198", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint de(int s, int a) {\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  else if (s > a)\n    return 0;\n  for (int i = s; i <= a; i++)\n    if (a % i == 0)\n      sum = sum + de(i, a / i);\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n > 0) {\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", de(2, a));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint t = 1;\nvoid fen(int n, int i) {\n  for (i = i; i * i <= n; i++) {\n    if (n % i == 0) {\n      fen(n / i, i);\n      t++;\n    }\n  }\n}\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int n;\n    cin >> n;\n    t = 1;\n    fen(n, 2);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "200", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid factor(int a, int k);\nint sum = 0;\nint main() {\n  int n, a, i = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    factor(a, 2);\n    printf(\"%d\\n\", sum + 1);\n    sum = 0;\n  }\n  return 0;\n}\n\nvoid factor(int a, int k) {\n  int b, j;\n  b = (int)sqrt((double)a);\n  for (j = k; j <= b; j++) {\n    if (a % j == 0) {\n      sum++;\n      factor(a / j, j);\n    }\n  }\n  j = k;\n}\n"}
{"label": "1", "index": "201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint geshu;\nvoid yinshu(int num, int a) {\n  int i;\n  if (num == 1) {\n    geshu++;\n  } else {\n    for (i = a; i <= num; i++) {\n\n      if (num % i == 0) {\n\n        yinshu(num / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int shu, j, num1[10000];\n  cin >> shu;\n  for (j = 0; j < shu; j++) {\n    geshu = 0;\n    cin >> num1[j];\n\n    yinshu(num1[j], 2);\n    cout << geshu << \"\\n\";\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint d;\nint fen(int i, int a) {\n  if (i > a) {\n    return 0;\n  }\n  int result = 1;\n  int j;\n  for (j = i; j < a; j++) {\n    if (a % j == 0) {\n      result = result + fen(j, a / j);\n    }\n  }\n  return result;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k = 0;\n  while (k < n) {\n\n    int a;\n    cin >> a;\n    int i = 2;\n    d = fen(i, a);\n    cout << d << endl;\n    k++;\n  }\n  return 0;\n  cin.get();\n  cin.get();\n  cin.get();\n}\n"}
{"label": "1", "index": "203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    int j = 2, num = 1;\n    while (j <= a / 2) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        num += sum;\n      }\n      j++;\n    }\n    printf(\"\\n%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "204", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fact(int a, int min) {\n  if (a < min)\n    return 0;\n  int way = 1;\n  for (int i = min; i <= sqrt((double)a); i++)\n    if (a % i == 0)\n      way += fact(a / i, i);\n  return way;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int c;\n    cin >> c;\n    printf(\"%d\\n\", fact(c, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint part(int x, int t) {\n  int i;\n  int number = 1;\n  if (x == 1) {\n    return 0;\n  }\n  if (x == 2) {\n    return 1;\n  }\n  for (i = t; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      number += part(x / i, i);\n    }\n  }\n  return number;\n}\n\nint main() {\n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", part(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint devide(int m, int x, int i) {\n  if (x == 1 && m >= i)\n    return 1;\n  else if (x > 1) {\n    int j = i;\n    int sum = 0;\n    while (j <= m) {\n      if (j != 1 && m % j == 0)\n        sum = sum + devide(m / j, x - 1, j);\n      j++;\n    }\n    return sum;\n  }\n  return 0;\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    cin >> a;\n    for (int X = 1; X <= 16; X++)\n      sum += devide(a, X, 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid f(int x, int y) {\n  int i = 0;\n  if (x >= y)\n    for (i = y; i <= x; i++) {\n      if (i == x)\n        count_1++;\n      if (x % i == 0)\n        f(x / i, i);\n    }\n}\nint main() {\n\n  int n, i, x, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d\", &x);\n    f(x, 2);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "208", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fjys(int x, int y) {\n  if (x < y)\n    return 0;\n  int i, n = 1;\n  for (i = y; i < x; i++) {\n    if (x % i == 0) {\n      n += fjys(x / i, i);\n    }\n  }\n  return n;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << fjys(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "209", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fjys(int x, int y) {\n  if (x < y)\n    return 0;\n  int i, n = 1;\n  for (i = y; i < x; i++) {\n    if (x % i == 0) {\n      n += fjys(x / i, i);\n    }\n  }\n  return n;\n}\nint main() {\n  int n, a[100];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << fjys(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ways(int);\nint main() {\n  int ways(int a, int min);\n  int n, b;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", ways(b, 2));\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 0, i;\n  for (i = min; i <= sqrt(a * 1.0); i++) {\n    if (a % i == 0)\n      sum = sum + ways(a / i, i);\n  }\n  return sum + 1;\n}\n"}
{"label": "1", "index": "211", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint su(int input) {\n  int ju = 1;\n  for (int i = 2; i < sqrt(input); i++) {\n    if (input % i == 0)\n      ju = 0;\n    break;\n  }\n  return ju;\n}\nint fenjie(int input, int k) {\n  int ret = 1;\n  for (int i = k; i <= sqrt(input); i++) {\n    if (input % i == 0) {\n      if (su(input / i) == 0)\n        ;\n      { ret = fenjie(input / i, i) + ret; }\n    }\n  }\n  return ret;\n}\nint main() {\n  int input, num;\n  cin >> num;\n  while (num--) {\n    scanf(\"%d \", &input);\n    cout << fenjie(input, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint sum(int x, int y) {\n  int c, i;\n  if (x > sqrt(y))\n    c = 0;\n  else {\n    if (y % x == 0) {\n      for (i = x, c = 1; i <= (y / 2) + 1; i++) {\n        if ((y / x) % i == 0)\n          c = c + sum(i, (y / x));\n      }\n    } else\n      c = 0;\n  }\n  return (c);\n}\nint main() {\n  int i, k, j;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    k = 0;\n    scanf(\"%d\", &m);\n    for (i = 2; i <= (m / 2) + 1; i++)\n      k = k + sum(i, m);\n    printf(\"%d \", k + 1);\n  }\n}\n"}
{"label": "1", "index": "213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint factor(int a, int b) {\n  int i, ways;\n  ways = 1;\n  if (a < b)\n    return 0;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      ways += factor(a / i, i);\n  }\n  return ways;\n}\n\nint main() {\n  int n, A[99], K[99], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> A[i];\n    K[i] = factor(A[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", K[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n\n  if (n < min)\n    return 0;\n\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result += factor(n / i, i);\n    }\n  }\n\n  return result;\n}\nint main() {\n  int m, x, j, k;\n\n  cin >> m;\n\n  for (j = 1; j <= m; j++) {\n    cin >> x;\n\n    k = factor(x, 2);\n\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "215", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min);\nint main() {\n  int n, i, a, A[100]; \n\n  cin >> n;\n\n  for (i = 0; i < n; i++) \n  {\n    cin >> a;\n    A[i] = f(a, 2); \n  };\n\n  for (i = 0; i < n; i++)\n    cout << A[i] << endl; \n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1;\n  int i;\n\n  if (a < min) \n  {\n    return 0;\n  }\n\n  for (i = min; i < a; i++) \n  {\n    if (a % i == 0) {\n      result += f(a / i, i); \n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "216", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fi(int a, int j);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    printf(\"%d\\n\", fi(a, 2));\n  }\n}\nint fi(int a, int k) {\n  int i, b = 1;\n  if (a == 1)\n    return 0;\n  for (i = k; i * i <= a; i++)\n    if (a % i == 0)\n      b = b + fi(a / i, i);\n  return b;\n}\n"}
{"label": "1", "index": "217", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a < b)\n    return 0;\n  int i, r = 1;\n  for (i = b; i <= a; i++) {\n    if (!(a % i) && i <= a / i) {\n      r += f(a / i, i);\n    }\n  }\n  return r;\n}\nint main() {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    cin >> m;\n    int result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n}\n"}
{"label": "1", "index": "218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int k = 0;\n  if (a >= 2 * b) {\n    for (int i = b; i <= a / b; i++) {\n      if (a % i == 0 && a / i >= i) {\n        k += f(a / i, i) + 1;\n      }\n    }\n  } else {\n    k = 0;\n  }\n  return k;\n}\n\nint main() {\n  int n, a, t;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    t = f(a, 2) + 1;\n    cout << t << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a, b[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b[i] = f(a, 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, sum = 1;\n  if (x < y) {\n    sum = 0;\n  } else {\n    for (j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + f(x / j, j);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid count(int m, int j) {\n  int i;\n  if (m == 1)\n    num++;\n  for (i = j; i <= m; i++) {\n    if (m % i == 0) {\n      count(m / i, i);\n    } else\n      continue;\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int m;\n    scanf(\"%d \", &m);\n    num = 0;\n    count(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint fun(int n, int m);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << fun(num, 2) << endl;\n  }\n  return 0;\n}\nint fun(int n, int m) {\n  int sum = 1; \n  double t = sqrt(n);\n  for (int i = m; i <= t; i++) \n    if (n % i == 0)            \n      sum += fun(n / i, i);\n  return sum;\n}\n"}
{"label": "1", "index": "222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint minf(int p, int min);\nint main() {\n  int n, i, k, p, zs[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p);\n\n    zs[i] = minf(p, 2);\n\n    zs[i]++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << zs[i] << \"\\n\";\n  }\n  printf(\"%d\", zs[n - 1]);\n\n  return 0;\n}\nint minf(int p, int min) {\n  int x = 0, i;\n  i = min;\n  for (i; i <= (int)sqrt(p); i++) {\n    if (p % i == 0)\n      x += minf(p / i, i) + 1;\n  }\n\n  return x;\n}\n"}
{"label": "1", "index": "223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid next(int c[], int x) {\n  int i, j;\n  c[0]++;\n  for (i = 1; c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] *\n                  c[9] * c[10] * c[11] * c[12] * c[13] * c[14] >\n              x;\n       i++) {\n    c[i]++;\n    for (j = 0; j < i; c[j++] = c[i])\n      ;\n    if (c[14] == 2)\n      break;\n  }\n}\n\nint reslove(int x) {\n  int c[15] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  int p = 0;\n  while (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n             c[10] * c[11] * c[12] * c[13] * c[14] <=\n         x) {\n    if (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n            c[10] * c[11] * c[12] * c[13] * c[14] ==\n        x)\n      p++;\n    next(c, x);\n  }\n  return p;\n}\n\nint main() {\n  int i = 0, n, a;\n  scanf(\"%d \", &n);\n  while (i++ < n) {\n    scanf(\"%d\", &a);\n    cout << reslove(a) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nvoid calc(int a, int d) {\n  int i;\n  if (a == 1)\n    t++;\n  else {\n    if (a >= d)\n      for (i = d; i <= a; i++)\n        if (a % i == 0)\n          calc(a / i, i);\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    t = 0;\n    calc(a, 2);\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "1", "index": "225", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, num = 0;\n  int a[100];\n  int sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0) {\n      num++;\n      a[num] = 1 + f(i, y / i);\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    sum = sum + a[i];\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    cout << f(2, b[i]) + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fenjie(int num, int min);\nint k = 2;\nint main() {\n  int n, i, jieguo, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    jieguo = fenjie(num, 2);\n    cout << jieguo << \"\\n\";\n  }\n  return 0;\n}\n\nint fenjie(int num, int min) {\n  int j, jieguo = 1;\n\n  if (num < min) {\n    return 0;\n  }\n\n  for (j = min; j < num; j++) {\n\n    if (num % j == 0) {\n\n      jieguo += fenjie(num / j, j);\n    }\n  }\n  return jieguo;\n}\n"}
{"label": "1", "index": "227", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid solve(int num, int a, int m) {\n  int i;\n  if (num == 1) {\n    count_1++;\n    return;\n  }\n  for (i = 2; i <= num; i++) {\n    if (i >= a && (num % i) == 0) {\n      solve(num / i, i, m + 1);\n    }\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    int num;\n    count_1 = 0;\n    cin >> num;\n    solve(num, 0, 1);\n    printf(\"%d \", count_1);\n  }\n}\n"}
{"label": "1", "index": "228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ispr(int t) {\n  int v = sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      fun(n / i, i);\n    i++;\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a)) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int i = 2, res = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", res);\n  }\n}\n"}
{"label": "1", "index": "229", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint part(int x, int t) \n{\n  int i;\n  int number = 1; \n  if (x == 1)     \n  {\n    return 0;\n  }\n  if (x == 2) \n  {\n    return 1;\n  }\n  for (i = t; i <= sqrt(x); i++) \n  {\n    if (x % i == 0) \n    {\n      number += part(x / i, i); \n    }\n  }\n  return number; \n}\n\nint main() {\n  int i, n, a;\n  cin >> n;                \n  for (i = 1; i <= n; i++) \n  {\n    cin >> a;\n    cout << part(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\nint f(int x, int y) \n{\n  int j, k, t = 0, m = 0;\n  for (j = 2; j < x; j++)\n    if (x % j == 0)\n      t++;\n  if (t == 0)\n    return 1; \n  else {\n    for (k = y; k <= (int)sqrt((double)x); k++)\n      if (x % k == 0)\n        m = m + f(x / k, k);\n    return (m + 1);\n  }\n}\n"}
{"label": "1", "index": "231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  int a;\n  int b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n\n    b = f(a, 2);\n    printf(\"%d\", b);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint su[40000], b[10000], ans;\n\nvoid zhaosushu() {\n  int i, j, p;\n  for (i = 2; i < 32768; i++) {\n    p = 1;\n    for (j = 2; j <= sqrt(i); j++)\n      if (i % j == 0) {\n        p = 0;\n        break;\n      }\n    if (p == 0)\n      continue;\n    su[p] = 1;\n  }\n}\n\nvoid resolve(int a, int x) {\n  int i;\n  if (a == 1 || (su[a] == 1 && a >= b[x - 1])) {\n    ans++;\n    return;\n  }\n  for (i = 2; i <= a; i++)\n    if (a % i == 0 && i >= b[x - 1]) {\n      b[x] = i;\n      resolve(a / i, x + 1);\n      b[x] = 0;\n    }\n}\n\nint main() {\n  int n, i, a;\n  memset(su, 0, sizeof(su));\n  zhaosushu();\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    ans = 0;\n    memset(b, 0, sizeof(b));\n    resolve(a, 1);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint p = 0, q = 2;\nint jizu(int x) {\n\n  for (int i = q; i <= x - 1; i++) {\n    if ((x % i == 0) && (x / i > i)) {\n      p++;\n      q = i;\n      jizu(x / i);\n\n    } else if ((x % i == 0) && (x / i == i)) {\n      p++;\n    }\n  }\n  return p;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << jizu(a[i]) + 1 << \"\\n\";\n    p = 0, q = 2;\n  }\n  int y;\n  scanf(\"%d\", &y);\n}\n"}
{"label": "1", "index": "234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calculate(int a, int num) {\n  int sum = 0;\n  if (num == 1)\n    return 1;\n  for (int i = num; i >= 2; i--) {\n    if (num % i == 0 && i <= a)\n      sum += calculate(i, num / i);\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int num = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", calculate(num, num));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint F(int min, int a) {\n  int i;\n  int sum = 0;\n  if (min == a)\n    return 1;\n  if (a == 1)\n    return 1;\n  for (i = min; i <= a; i++) {\n    if (a % i == 0)\n      sum += F(i, a / i);\n  }\n  return sum;\n}\n\nint main() {\n  int a, n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", F(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fi(int a, int j);\nint main() {\n  int a, n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", fi(a, 2));\n  }\n}\nint fi(int a, int k) {\n  int i, b = 1;\n  if (a == 1)\n    return 0;\n  for (i = k; i * i <= a; i++)\n    if (a % i == 0)\n      b = b + fi(a / i, i);\n  return b;\n}\n"}
{"label": "1", "index": "237", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fengjie(int a, int b) {\n  if (a == 2 || a == 3)\n    return 1;\n  int sum = 1;\n  int c = sqrt(a);\n  for (int i = b; i <= c; i++) {\n    if (a % i == 0) {\n      sum = sum + fengjie(a / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fengjie(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n = 0, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << Factorization(num, 2) + 1 << \"\\n\";\n  }\n  return 0;\n}\n\nint Factorization(int num, int n) {\n  int count = 0;\n  for (int i = n; num / i >= i; i++)\n    if (num % i == 0) {\n      count++;\n      count = count + Factorization(num / i, i);\n    }\n  return count;\n}\n"}
{"label": "1", "index": "239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  int fun(int n, int begin);\n  scanf(\"%d\", &i);\n  while (i-- > 0) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", fun(n, 2));\n  }\n  return 0;\n}\nint fun(int n, int begin) {\n  int i, result = 1;\n  for (i = begin; i <= sqrt(n); i++)\n    if (n % i == 0) {\n      result += fun(n / i, i);\n    }\n  return result;\n}\n"}
{"label": "1", "index": "240", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int f[200][200] = {0};\n  int div[40000] = {0};\n  int divth[200] = {0};\n  int kase = 0;\n  cin >> kase;\n  for (; kase > 0; kase--) {\n    int n = 0;\n    cin >> n;\n    memset(f, 0, sizeof(f));\n    memset(div, 0, sizeof(div));\n    memset(divth, 0, sizeof(divth));\n    int m = 0;\n    for (int i = 1; i <= n; i++)\n      if (n % i == 0) {\n        div[i] = ++m;\n        divth[m] = i;\n      }\n    f[1][1] = 1;\n    for (int i = 2; i <= m; i++)\n      for (int j = 2; j <= i; j++)\n        for (int k = j; k > 1; k--)\n          if (divth[i] % divth[k] == 0) {\n            int ii = divth[i] / divth[k];\n            int jj = k;\n            if (div[ii] < jj)\n              jj = div[ii];\n            f[i][j] += f[div[ii]][jj];\n          }\n    cout << f[m][m] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, sum;\nint fenjie(int min, int max) {\n  int i;\n  for (i = min; i <= sqrt(max); i++) {\n    if (max % i == 0 && i <= max / i) {\n      sum++;\n      fenjie(i, max / i);\n    }\n    if (i > max / i)\n      break;\n  }\n  return sum;\n}\nint main() {\n  int i, k;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &n);\n    sum = 1;\n    sum = fenjie(2, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count_1;\n\nvoid f(int n, int min) {\n  int i;\n  if (n == min) {\n    count_1++;\n    return;\n  }\n  if (n % min != 0) {\n    return;\n  }\n  for (i = min; i <= n; i++)\n    f(n / min, i);\n}\n\nint main() {\n  int N, i, num, j;\n  scanf(\"%d\", &num);\n  for (j = 1; j <= num; j++) {\n    count_1 = 0;\n    scanf(\"%d\", &N);\n    for (i = 2; i <= N; i++)\n      f(N, i);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint digui(int x, int min);\nint main() {\n  int n, i, m, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &m);\n    y = digui(m, 2);\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\nint digui(int x, int min) {\n  int i, result;\n  result = 1;\n  if (x < min) {\n    return 0;\n  }\n  for (i = min; i <= x - 1; i++) {\n    if (x % i == 0) {\n      result = result + digui(x / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "244", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid tot(int, int);\nint main() {\n\n  int n, a[100], i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    t = 0;\n    tot(a[i], 2);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid tot(int x, int min) {\n  int k;\n  if (x == 1) {\n    ++t;\n    return;\n  }\n  for (k = min; k <= x; k++)\n    if (x % k == 0) {\n      tot(x / k, k);\n    }\n}\n"}
{"label": "1", "index": "245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint zhi(int a);\nint yin(int m, int t);\nint main() {\n  int n, i = 0;\n  int str[10000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> str[i];\n  i = 0;\n  for (i = 0; i < n; i++)\n    cout << yin(str[i], 2) << \"\\n\";\n  return 0;\n}\n\nint zhi(int a) {\n  int k = 2, flag = 0;\n  for (k = 2; k <= a / 2; k++) {\n    if (a % k == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  return flag;\n}\n\nint yin(int m, int t) {\n  int j = t, c = 0, b = 0, x = 0;\n  int str1[10000][2];\n  if (m < t && m != 1)\n    return 0;\n  else if (m == 1)\n    return 1;\n  else if (zhi(m) == 0)\n    return 1;\n  else\n    for (j = t; j <= m; j++) {\n      if (m % j == 0) {\n        str1[c][0] = m / j;\n        str1[c][1] = j;\n        c++;\n      }\n    }\n  for (b = 0; b < c; b++)\n    x += yin(str1[b][0], str1[b][1]);\n\n  return x;\n}\n"}
{"label": "1", "index": "246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint yueshu[100] = {0};\nint s = 0;\n\nvoid number(int num, int s) {\n  int i;\n  for (i = s; i >= 0; i--) {\n    if (num < yueshu[i])\n      continue;\n    if (num == yueshu[i])\n      sum++;\n    else if (num > yueshu[i] && num % yueshu[i] == 0)\n      number(num / yueshu[i], i);\n  }\n}\n\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  int num = 0;\n  while (cin >> num) {\n    int i = 0, j = 0;\n    for (i = 2; i <= num; i++)\n      if (num % i == 0) {\n        yueshu[j] = i;\n        j++;\n      }\n    s = j - 1;\n    number(num, s);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int c, int t);\nint main() {\n  int n, c;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> c;\n    if (c == 1 || c == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(c, 2));\n  }\n  return 0;\n}\nint f(int c, int t) {\n  int count = 1, i;\n  for (i = t; i < c; i++) {\n    if (c % i == 0)\n      count += f(c / i, i);\n  }\n  if (i == c)\n    return count;\n  else\n    return 0;\n}\n"}
{"label": "1", "index": "248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b) {\n  int i, p, q;\n  for (i = b, p = 0; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      q = f(a / i, i);\n      p = p + q;\n    }\n  }\n  p++;\n  return (p);\n}\nint main() {\n  int i, a, n, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    k = f(a, 2);\n    printf(\"%d\\n\", k);\n  }\n}\n"}
{"label": "1", "index": "249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factorize(int n, int j) {\n  int F = 1;\n  for (; j <= sqrt(n); j++)\n    if (n % j == 0) {\n      F += factorize(n / j, j);\n    }\n  return F;\n}\nint main() {\n  int i, m, n[1000];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++)\n    cout << factorize(n[i], 2) << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "250", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid divide(int n, int a) {\n  for (int i = a; i <= n; i++) {\n    if ((n % i == 0)) {\n      if (n / i == 1)\n        sum++;\n      else {\n        divide(n / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int N = 0, n = 0, i = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    cin >> n;\n    divide(n, 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int shu, int min) {\n  int k = 1;\n  if (shu < min) {\n    k = 0;\n    return k;\n  } else {\n    for (int i = min; i < shu; i++) {\n      if (shu % i == 0) {\n        k = k + f(shu / i, i);\n      }\n    }\n    return k;\n  }\n}\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a;\n\n    if (i != n - 1)\n      printf(\"%d \", f(a, 2));\n    else {\n      cout << f(a, 2);\n    }\n  }\n}\n"}
{"label": "1", "index": "252", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int k = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      k = k + f(a / i, i);\n    }\n  }\n  return (k);\n}\n\nint main() {\n  int f(int a, int min);\n  int j, n;\n  int a[100], b[100];\n  cin >> n;\n  for (j = 0; j < n; j++)\n    cin >> a[j];\n  for (j = 0; j < n; j++) {\n    b[j] = f(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n, int k) {\n  if (n < k)\n    return 0;\n  int i, s = 1;\n  for (i = k; i < n; i++) {\n    if (n % i == 0)\n      s += f(n / i, i);\n  }\n  return s;\n}\nint main() {\n  int m, n;\n  scanf(\"%d\", &m);\n  while (m--) {\n    scanf(\"%d\", &n);\n    cout << f(n, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) \n{\n  int i, num = 0;\n  int a[100];\n  int sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0) {\n      num++;\n      a[num] = 1 + f(i, y / i);\n    }\n  } \n  for (i = 1; i <= num; i++) {\n    sum = sum + a[i];\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    cout << f(2, b[i]) + 1 << endl;\n  } \n\n  return 0;\n}\n"}
{"label": "1", "index": "255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid qut(int a, int b);\nint num = 0;\nint main() {\n  int i, n, g[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> g[i];\n  for (i = 0; i < n; i++) {\n    qut(g[i], 1);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n\nvoid qut(int a, int b) {\n  int i;\n  if (a >= b) {\n    num++;\n    if (b == 1)\n      b++;\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        qut(a / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int shu, int min) {\n  int k = 1;\n  if (shu < min) {\n    k = 0;\n    return k;\n  } else {\n    for (int i = min; i < shu; i++) {\n      if (shu % i == 0) {\n        k = k + f(shu / i, i);\n      }\n    }\n    return k;\n  }\n}\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n\n    if (i != n - 1)\n      printf(\"%d \", f(a, 2));\n    else\n      printf(\"%d\", f(a, 2));\n  }\n}\n"}
{"label": "1", "index": "257", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min) {\n  int i, result;\n  if (a < min)\n    return 0;\n  result = 1;\n  for (i = min; i < a; i++)\n    if (a % i == 0)\n      result += f(a / i, i);\n  return result;\n}\nint main() {\n  int i, n, num[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cout << f(num[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 1;\nint kk(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--)\n    if (a % i == 0)\n      return a / i;\n  return 0;\n}\nint seperate(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--) {\n    if (a % i == 0 && (a / i) <= i) {\n      sum++;\n      if ((a / i) == 2)\n        continue;\n      else\n        seperate(a / i, a / i - 1);\n    } else if ((a % i == 0) && ((kk(a / i, i)) != 0)) {\n      seperate(a / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << seperate(m, m - 1) << endl;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "259", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int d, int n) {\n  int sum = 0;\n  for (int i = d; i < n; i++) {\n    if (n % i == 0 && (n / i) >= i) {\n      sum = sum + 1;\n      sum = sum + divide(i, n / i);\n    }\n  }\n  return (sum);\n}\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", divide(2, num) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int max, int min) {\n  int num = 1, i, k;\n  for (i = min; i < max / 2; i++) {\n    k = max % i;\n    if (k == 0) {\n      if (i <= max / i)\n        num += fenjie(max / i, i);\n    }\n  }\n  return num;\n}\nint main() {\n  int a[10000], n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &a[j]);\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\\n\", fenjie(a[j], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nconst int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};\n\nint m, n, counter;\n\nvoid dfs(int m, int i) {\n\n  if (m == 1) {\n    ++counter;\n    return;\n  }\n  for (; i <= m; ++i) {\n    if (m % i == 0) {\n      dfs(m / i, i);\n    }\n  }\n}\n\nint main() {\n  int t, m, n;\n  scanf(\"%d \", &t);\n  while (t--) {\n    counter = 0;\n    cin >> m;\n    dfs(m, 2);\n    cout << counter << endl;\n  }\n}\n"}
{"label": "1", "index": "262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint function_1(int a, int m) {\n  int sum = 1, i;\n  if (a > m)\n    return 0;\n  else {\n    for (i = a; i < m; i++) {\n      if (m % i == 0)\n        sum = sum + function_1(i, m / i);\n      else\n        continue;\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, i, m[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d \", function_1(2, m[i]));\n  }\n}\n"}
{"label": "1", "index": "263", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint temp = 2, sum = 0;\nvoid dg(int x) {\n  for (int i = temp; i <= x; i++) {\n    if (x % i == 0) {\n      temp = i;\n      if (x / i == 1) {\n        sum++;\n        temp = 2;\n      } else\n        dg(x / i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int x;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    dg(x);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid decprime(int begain, int a);\nint sum = 1;\nint main() {\n  int n, a;\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &a);\n    decprime(2, a);\n    printf(\"%d\\n\", sum);\n    sum = 1;\n  }\n  return 0;\n}\nvoid decprime(int begain, int a) {\n  int i;\n\n  for (i = begain; i <= a; i++) {\n    if (a % i == 0 && i <= a / i) {\n      sum++;\n      decprime(i, a / i);\n    }\n    if (i > a / i)\n      break;\n  }\n}\n"}
{"label": "1", "index": "265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid recur(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      recur(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int t = 0;\n  cin >> t;\n  for (int k = 0; k < t; k++) {\n    int n = 0;\n    cin >> n;\n    int i = 2, res = 1;\n    for (int i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        recur(n / i, i);\n        res += sum;\n      }\n    }\n    cout << res << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t(int, int);\nint s, j, k1;\n\nint main() {\n  int a, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    s = 1;\n    k1 = 0;\n    for (j = 2; j <= sqrt((double)a); j++) {\n      if (a % j == 0)\n        t(a / j, j);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n\nint t(int a, int b) {\n  int k;\n  for (k = b; k <= a; k++) {\n    if (a % k == 0) {\n      if (a / k == 1) {\n        s = s + 1;\n        break;\n      }\n      t(a / k, k);\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p(int x) {\n  int i;\n  for (i = 2; i <= sqrt(x); i++)\n    if (x % i == 0)\n      return (0);\n  return (1);\n}\nint f(int n, int m) {\n  int t, i;\n  if (n < m)\n    return (0);\n  else if (p(n) == 1)\n    return (1);\n  else if (m == 1) {\n    t = 1;\n    for (i = m + 1; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  } else if (m != 1) {\n    t = 1;\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  }\n  return (t);\n}\nint main() {\n  int x, y, j;\n  scanf(\"%d\", &y);\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &x);\n    printf(\"%d \", f(x, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint tot;\n\nvoid find(int m, int n) {\n  int i, j, k;\n  if (m == 1)\n    tot = tot + 1;\n  else {\n    for (i = n; i <= m; i++)\n      if (m % i == 0)\n        find(m / i, i);\n  }\n}\n\nint main() {\n  int i, j, k, m, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    tot = 0;\n    cin >> m;\n    find(m, 2);\n    cout << tot << endl;\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "269", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int min) {\n  int i, method = 0;\n  if (n >= min)\n    method++;\n  for (i = min; i < n; i++) {\n    if (!(n % i))\n      method += divide(n / i, i);\n  }\n  return method;\n}\nint main() {\n  int number = 0, integer;\n  int i;\n  scanf(\"%d \", &number);\n  for (i = 0; i < number; i++) {\n    cin >> integer;\n    printf(\"%d\\n\", divide(integer, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint disassamble(int, int);\nint main() {\n  int n;\n  int i = 1;\n  int a, result;\n  cin >> n;\n  while (i <= n) {\n    i++;\n    cin >> a;\n    result = disassamble(a, 2);\n    cout << result << \"\\n\";\n  }\n\n  return 0;\n}\nint disassamble(int a, int y) {\n  int i, count = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (i = y; i * i <= a; i++) {\n    if (a % i == 0) {\n      count = disassamble(a / i, i) + count;\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "271", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint divi(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) \n    {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divi(n / i, j); \n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int n = 0; \n  int t = 0; \n  int sum;   \n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++) \n    {\n      sum = sum + divi(n, j);\n    }\n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) {\n  if (y == x)\n    return 1;\n  if (y > x)\n    return 0;\n  if (x % y == 0)\n    return f(x, y + 1) + f(x / y, y);\n  else\n    return f(x, y + 1);\n}\nint main() {\n  int n, x;\n  cin >> n;\n  int z, i;\n  i = n;\n  while (i > 0) {\n    i = i - 1;\n    cin >> x;\n    z = f(x, 2);\n    cout << z << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "273", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint sum = 0; \n\nvoid devide(int a, int b) \n{\n  if (a == 1)\n    sum++;\n  else {\n    if (a >= b)\n      devide(a, b + 1);\n    if (a % b == 0)\n      devide(a / b, b);\n  }\n}\n\nint main() \n{\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    devide(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "274", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int f) {\n  if (a == f)\n    return 1;\n  if (a < f)\n    return 0;\n  if (a % f == 0)\n    return factor(a, f + 1) + factor(a / f, f);\n  else\n    return factor(a, f + 1);\n}\n\nint main() {\n  int x, a;\n  cin >> x;\n  while (x > 0) {\n    cin >> a;\n    cout << factor(a, 2) << endl;\n    x--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fun(int i, int j, int count) {\n  int k;\n  for (k = i; k <= sqrt(j); k++)\n    if (j % k == 0) {\n      count++;\n      count = fun(k, j / k, count);\n    }\n  return count;\n}\n\nint main() {\n  int count;\n  int k, n, i, j;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++) {\n    scanf(\"%d\", &n);\n    count = 1;\n    for (i = 2; i < sqrt(n); i++)\n      if (n % i == 0) {\n        count++;\n        count = fun(i, n / i, count);\n      }\n\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "276", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      f(n / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n\n  int t = 0;\n  cin >> t;\n  while (t--) {\n    int n = 0;\n    cin >> n;\n    int i = 2, result = 1;\n\n    for (i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        f(n / i, i);\n        result = result + sum;\n      }\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "277", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sum = 1;\nvoid f(int i, int j) {\n  int k;\n  if (i == 1)\n    sum++;\n  else {\n    for (k = j; k <= i; k++) {\n      if (i % k == 0)\n        f(i / k, k);\n    }\n  }\n}\nint main(void) {\n  int i;\n  int n;\n  int a;\n  cin >> n;\n  while (n--) {\n    sum = 1;\n    scanf(\"%d\", &a);\n    for (i = 2; i * i <= a; i++) {\n      if (a % i == 0) {\n        f(a / i, i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factoring(int a, int b) {\n  int i, kind = 0;\n  if (a == 1)\n    kind = 1;\n\n  else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int n, i, j, a[30000] = {0}, b[30000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = factoring(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint qipa(int p, int q) {\n  int i, l, s = 0;\n  if (p == 1)\n    return 1;\n  for (i = p; i > 1; i--)\n    if (p % i == 0 && i <= q)\n      s += qipa(p / i, i);\n  return s;\n}\nint main() {\n  int i, j, n, m, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    t = qipa(m, m);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int p);\nint N;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &N);\n    cout << fenjie(N, 2) << \"\\n\";\n  }\n  return 0;\n}\nint fenjie(int x, int p) {\n  int f = 0;\n  if (x == 1)\n    return 1;\n  else {\n    for (int i = p; i <= x; i++)\n      if (x % i == 0)\n        f = f + fenjie(x / i, i);\n  }\n  return f;\n}\n"}
{"label": "1", "index": "281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int max) {\n  int i = 0;\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = max; i >= 2; i--) {\n    if ((a % i) == 0)\n      sum += fenjie(a / i, i);\n  }\n  return sum;\n}\n\nint main() {\n  int k = 0;\n  int n = 0;\n  int num = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> num;\n    cout << fenjie(num, num);\n    if (k < n)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "282", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint f(int n, int m); \nint main() {\n  int n, num, i;\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> num; \n    cout << f(num, 2) << endl;\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int i, count = 0;\n  if (n == 1)\n    return 1;              \n  for (i = m; i <= n; i++) \n  {\n    if (n % i == 0)         \n      count += f(n / i, i); \n  }\n  return count; \n}\n"}
{"label": "1", "index": "283", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid f(int x, int min) {\n  int p;\n  if (x == 1)\n    sum++;\n  else\n    for (p = min; p <= x; p++)\n      if (x % p == 0)\n        f(x / p, p);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> k;\n    for (j = 2; j <= k; j++)\n      if (k % j == 0)\n        f(k / j, j);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fj(int a, int zs) {\n  int k, n, z;\n  n = 0;\n  z = 0;\n  for (k = zs; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      n = n + fj(a / k, k);\n      z = 1;\n    }\n  }\n  if (z == 0) {\n    return 1;\n  } else {\n    return n + 1;\n  }\n}\nint main() {\n  int m, i, t;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> t;\n    cout << fj(t, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint yueshu[100] = {0};\nint s = 0;\n\nvoid number(int num, int s) {\n  int i;\n  for (i = s; i >= 0; i--) {\n    if (num < yueshu[i])\n      continue;\n    if (num == yueshu[i])\n      sum++;\n    else if (num > yueshu[i] && num % yueshu[i] == 0)\n      number(num / yueshu[i], i);\n  }\n}\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int num = 0;\n  while (cin >> num) {\n    int i = 0, j = 0;\n    for (i = 2; i <= num; i++)\n      if (num % i == 0) {\n        yueshu[j] = i;\n        j++;\n      }\n    s = j - 1;\n    number(num, s);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fact(int n, int m);\nint main() {\n  int n, a[35000], i, b[35000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = fact(a[i], 2);\n  for (i = 0; i < n; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\nint fact(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    return 0;\n  else if (n == 2)\n    return 1;\n  else {\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        sum = sum + fact(n / i, i);\n    }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "287", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid calc(int a, int d) {\n  int i;\n  if (a == 1)\n    t++;\n  else {\n    if (a >= d)\n      for (i = d; i <= a; i++)\n        if (a % i == 0)\n          calc(a / i, i);\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    t = 0;\n    calc(a, 2);\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "1", "index": "288", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int k) {\n  if (n < k)\n    return 0;\n  int i, s = 1;\n  for (i = k; i < n; i++) {\n    if (n % i == 0) {\n      s += f(n / i, i);\n    }\n  }\n  return s;\n}\nint main() {\n  int m, n, i, ans, s;\n  cin >> m;\n  while (m--) {\n    cin >> n;\n    printf(\"%d\\n\", f(n, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ispr(int t) {\n  int v = sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      fun(n / i, i);\n    i++;\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a)) {\n      cout << \"1\\n\";\n      continue;\n    }\n\n    int i = 2, res = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", res);\n  }\n}\n"}
{"label": "1", "index": "290", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f2(int i, int a) {\n  int c, s = 0;\n  for (i; i <= a / 2; i++) {\n    if (a % i == 0) {\n      c = a / i;\n      if (c >= i) {\n        s = s + f2(i, c);\n      }\n    }\n  }\n  s = s + 1;\n  return s;\n}\n\nint f(int a) {\n  int s = 0;\n\n  s = s + f2(2, a);\n  return s;\n}\n\nint main() {\n  int n, i, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b = f(a);\n    printf(\"%d\\n\", b);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, count = 0, flag = 0;\n  if (m == 1)\n    return 1;\n  for (i = n; i > 1; i--) {\n    if (m % i == 0) {\n      count += f(m / i, i);\n      flag = 1;\n    }\n  }\n  if (flag)\n    return count;\n  else\n    return 0;\n}\nint main() {\n  int n, k, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, m));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "292", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num, s = 1;           \nvoid divide(int n, int a) \n{\n  for (int i = n; i <= a / s; i++) \n  {\n    s *= i;\n    if (s == a) \n      num++;\n    else if (s < a && a % s == 0) \n      divide(i, a);\n    s /= i; \n  }\n}\nint main() \n{\n  int n, i, a;\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    num = 0;      \n    cin >> a;     \n    divide(2, a); \n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fjys(int x, int y) {\n  if (x < y)\n    return 0;\n  int i, n = 1;\n  for (i = y; i < x; i++) {\n    if (x % i == 0) {\n      n += fjys(x / i, i);\n    }\n  }\n  return n;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << fjys(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "294", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint x[1000] = {0};\nvoid f(int m, int n, int l) {\n  int i;\n  for (i = m; i <= n; i++) {\n    if (n % i != 0)\n      continue;\n    else {\n      if (n / i == 1) {\n        x[l]++;\n        return;\n      } else {\n        f(i, n / i, l);\n      }\n    }\n  }\n}\n\nint main() {\n  int a[1000], s, j, sum;\n  cin >> sum;\n  for (j = 1; j <= sum; j++) {\n    cin >> a[j];\n    s = 2;\n    f(s, a[j], j);\n  }\n  for (j = 1; j <= sum; j++) {\n    printf(\"%d\\n\", x[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint t, m, n, i, j, k, xx, x1, x2, x, y, s, n0;\n\nvoid init(int a[], int b[]) {\n  freopen(\"tt.in\", \"r\", stdin);\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n  freopen(\"tt.out\", \"w\", stdout);\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n}\nvoid proce(int n, int b) {\n  int i;\n  if (n == 1)\n    s++;\n  else\n    for (i = b; i <= n0; i++)\n      if (!(n % i))\n        proce(n / i, i);\n}\n\nint main() {\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    s = 0;\n    n0 = x;\n    proce(x, 2);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "296", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint calc(int a, int b) {\n  if (a * a > b)\n    return 1;\n  if (b % a == 0)\n    return (calc(a, b / a) + calc(a + 1, b));\n  return calc(a + 1, b);\n}\nint main(int argc, const char *argv[]) {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << calc(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid out(int, int);\n\nint t = 1;\n\nint main() {\n  int n = 0;\n  int i = 0;\n  double sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> sum;\n    out(sum, 2.0);\n    printf(\"%d\\n\", t);\n    t = 1;\n  }\n\n  cin >> i;\n\n  return 0;\n}\n\nvoid out(int sum, int q) {\n  int num = 0;\n  double m = sum;\n  num = sqrt(m);\n  if (sum % q == 0 && q <= num) {\n    t++;\n    out(sum / q, q);\n    out(sum, q + 1);\n  }\n  if (sum % q != 0 && q <= num)\n    out(sum, q + 1);\n}\n"}
{"label": "1", "index": "298", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint function_1(int n, int a) {\n  int kind = 0;\n  int i;\n  if (n == 1)\n    return 1;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0) {\n      if (n / i < i && i != n)\n        ;\n      else {\n        kind = kind + function_1(n / i, i);\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int m, n, i, sum;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    sum = function_1(n, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "299", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int m, int n) {\n\n  if (m > sqrt(n))\n    return 0;\n\n  if (n % m == 0)\n    return fun(m + 1, n) + fun(m, n / m) + 1;\n  else\n    return fun(m + 1, n);\n}\n\nint main() {\n  int i, x, y;\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    cin >> y;\n    printf(\"%d\\n\", fun(2, y) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint turn(int a, int b) {\n  int i, k;\n  if (a == 1)\n    k = 1;\n  else if (a < b)\n    k = 0;\n  else {\n    k = 0;\n    for (i = b; i <= a; i++)\n      if (a % i == 0)\n        k = k + turn(a / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i, a[1000], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    t = turn(a[i], 2);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "301", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};\n\nint m, n, counter;\n\nvoid dfs(int m, int i) {\n  \n  if (m == 1) {\n    ++counter;\n    return;\n  }\n  for (; i <= m; ++i) {\n    if (m % i == 0) {\n      dfs(m / i, i);\n    }\n  }\n}\n\nint main() {\n  int t, m, n;\n  cin >> t;\n  while (t--) {\n    counter = 0;\n    cin >> m;\n    dfs(m, 2);\n    cout << counter << endl;\n  }\n}\n"}
{"label": "1", "index": "302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, i, factor;\n\nvoid f(int factor, int x) {\n  for (; factor * factor <= x; factor++) {\n    if (x % factor == 0) {\n      num++;\n      f(factor, x / factor);\n    }\n  }\n}\n\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    f(2, a);\n    printf(\"%d\\n\", num);\n    num = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "303", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fen(int a, int k) {\n  int s = 0, j, t = 0;\n  if (a == 1 && a >= k) {\n    s = 1;\n  } else if (a == k) {\n    s = 1;\n  } else {\n    for (j = 2; j <= a; j++) {\n      if (a % j == 0 && j >= k)\n        s = s + fen(a / j, j);\n      t = 1;\n    }\n    if (t == 0)\n      s++;\n  }\n  return s;\n}\nint main() {\n  int n, i, q, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << fen(a, 1) << endl;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "1", "index": "304", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint p(int a, int m) {\n  int t = 0;\n  int i;\n  if (a % m != 0)\n    return 0;\n  if ((a % m == 0) && (a / m < m) && (a != m))\n    return 0;\n  if (a == m)\n    return 1;\n  if ((a % m == 0) && (a / m >= m)) {\n    for (i = m; i <= a / m; i++) {\n      t = t + p(a / m, i);\n    }\n    return t;\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  int x;\n  int j;\n  int num = 0;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    for (j = 2; j <= x; j++) {\n      num = num + p(x, j);\n    }\n    cout << num << endl;\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g = 0;\nvoid s(int n, int z) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= z) {\n      g = g + 1;\n      s(n / i, i);\n    }\n  }\n}\nint main() {\n  int a, b;\n  scanf(\"%d \", &a);\n  while (cin >> b) {\n    for (int j = 2; j <= sqrt(b); j++) {\n      if (b % j == 0) {\n        g = g + 1;\n        s(b / j, j);\n      }\n    }\n    printf(\"%d\\n\", g + 1);\n    g = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid fenjie(int n, int x) {\n  extern int num;\n  if (n == 1)\n    num++;\n  else\n\n    for (int i = x; i <= n; i++)\n      if (n % i == 0)\n        fenjie(n / i, i);\n}\nint main() {\n  int n, k;\n  cin >> k;\n  for (int j = 0; j != k; j++) {\n    extern int num;\n    num = 0;\n    scanf(\"%d \", &n);\n    fenjie(n, 2);\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "307", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ispr(int t) {\n  int v = (int)sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int j = 0; j < n; j++) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a) == 1) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int res = 1;\n    for (int i = 2; i <= a / 2; i++) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res = res + sum;\n      }\n    }\n    printf(\"%d\\n\", res);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint answer = 0;\nint a = 2;\nvoid f(int, int);\nint main() {\n  int n = 0;\n  int i = 0;\n  int data[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> data[i];\n\n  for (i = 0; i < n; i++) {\n    f(data[i], a);\n    cout << answer << endl;\n    answer = 0;\n  }\n  return 0;\n}\nvoid f(int m, int n) {\n  int i = 0;\n  if (m == 1) {\n    answer = answer + 1;\n  }\n  for (i = n; i <= m; i++) {\n    if (m % i == 0) {\n      f(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int, int);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int m;\n    sum = 1;\n    cin >> m;\n    calculate(m, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid calculate(int m, int begin) {\n  int i;\n  int n = sqrt((double)m);\n  for (i = begin; i <= n; i++) {\n    if (m % i == 0) {\n      sum++;\n      calculate(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n\n  int k = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      k = k + f(a / i, i);\n  }\n  return (k);\n}\n\nint main() {\n  int f(int a, int min);\n  int j, n;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    b[j] = f(a[j], 2);\n    cout << b[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "311", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, i, a[100], sum[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum[i] = f(a[i], 2);\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n\nint f(int m, int min) {\n  int i, sum = 0;\n  if (m == min || m == 1)\n    return 1;\n  else if (m < min)\n    return 0;\n  else if (m > min) {\n    for (i = min; i <= m; i++)\n      if (m % i == 0)\n        sum += f(m / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0; \n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum += 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, num, sign;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    for (j = num; j > 1; j--)\n      if (num % j == 0)\n        sign = j;\n    cout << yinshu(num, sign) + 1 << endl;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "1", "index": "313", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum = 1; \nint Fact(int x, int y);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 1;    \n    Fact(a, 2); \n    cout << sum << endl;\n  }\n  return 0;\n}\nint Fact(int x, int y) {\n  if (x == 1)\n    return 0; \n  else {\n    for (; y <= sqrt(x); y++) \n      if (x % y == 0) {\n        sum = sum + Fact(x / y, y); \n      }\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint geshu(int a, int x) {\n  int y, z;\n  z = a;\n  y = (int)sqrt(a);\n  while (x <= y) {\n    if (a % x == 0) {\n      a = a / x;\n      geshu(a, x);\n    }\n    if (a == z / x)\n      a = z;\n    x++;\n  }\n  sum++;\n  return sum;\n}\nint main() {\n  int n, i, a[100], b[100], x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 2 || a[i] == 3)\n      b[i] = 1;\n    else {\n      sum = 0;\n      x = 2;\n      b[i] = geshu(a[i], x);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "1", "index": "315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a, factor(int N, int min);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", factor(a, 2));\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int i, result;\n  result = 1;\n\n  if (N < min) {\n    return 0;\n  }\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int i, int m);\nint sum;\nint main() {\n  int n, i, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 1;\n    scanf(\"%d\", &m);\n    f(2, m);\n    cout << sum << \"\\n\";\n  }\n}\nvoid f(int i, int m) {\n  int k, s;\n  s = (int)sqrt(m);\n  for (k = i; k <= s; k++) {\n    if (m % k == 0) {\n      sum++;\n      f(k, m / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "317", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid check(int m, int n) {\n  for (; m <= n; m++) {\n    if (n % m == 0) {\n      if (n / m == 1) {\n        num++;\n        return;\n      } else\n        check(m, n / m);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (; n; n--) {\n    cin >> m;\n    check(2, m);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "318", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint calc(int p, int t);\n\nint main() {\n  int m, n, ans;\n\n  scanf(\"%d\", &m);\n\n  while (m--) {\n    cin >> n;\n    ans = calc(2, n);\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n\nint calc(int p, int t) {\n  int i, a;\n\n  a = 1;\n  for (i = p; i <= sqrt(t); i++)\n    if (t % i == 0)\n      a = a + calc(i, t / i);\n  return a;\n}\n"}
{"label": "1", "index": "319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int, int);\n\nint main() {\n  int times, k, num;\n  cin >> times;\n  for (k = 1; k <= times; k++) {\n    cin >> num;\n    cout << fenjie(num, 1) << endl;\n  }\n\n  return 0;\n}\n\nint fenjie(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n"}
{"label": "1", "index": "320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int num, int minA1) {\n  int count = 0;\n  int sqrtNum;\n  int i;\n\n  if (num <= minA1)\n    return 0;\n\n  sqrtNum = (int)sqrt((double)num);\n  for (i = minA1; i <= sqrtNum; i++)\n    if (num % i == 0) {\n      count++;\n      count += factor(num / i, i);\n    }\n\n  return count;\n}\n\nint main() {\n  int n;\n  int num;\n\n  scanf(\"%d \", &n);\n\n  while (n--) {\n    cin >> num;\n    cout << factor(num, 2) + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "321", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int x, n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", f(x, 2));\n  }\n\n  return 0;\n}\n\nint f(int x, int i) {\n  int ans = 0;\n  if (x == 2)\n    return 1;\n  else {\n    for (; i <= sqrt(x); i++) {\n      if (x % i == 0) {\n        ans = ans + f(x / i, i);\n      }\n    }\n    return ans + 1;\n  }\n}\n"}
{"label": "1", "index": "322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, m, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    cout << f(m, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int m, int min) {\n  int count = 1, i;\n  if (m == 1)\n    return 1;\n  else if (m == 2)\n    return 1;\n  else {\n    for (i = min; i <= sqrt(m); i++) {\n      if (m % i == 0) {\n        count += f(m / i, i);\n      }\n    }\n    return count;\n  }\n}\n"}
{"label": "1", "index": "323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"%d\\n\", f(a[i], 2));\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  if (n < p)\n    return 0;\n  else {\n    for (m = p; m <= n; m++)\n      if (n % m == 0) {\n        if (m < n)\n          sum = sum + f(n / m, m);\n        if (m == n)\n          sum = sum + 1;\n      }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint coun;\nvoid depart(int n, int i) {\n  int j;\n  if (n == 1)\n    coun++;\n  else\n    for (j = i; j <= n; j++)\n      if (n % j == 0) {\n        depart(n / j, j);\n      }\n}\n\nint main() {\n  int n, j;\n  scanf(\"%d \", &n);\n  int b[n];\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n  for (j = 0; j < n; j++) {\n    coun = 0;\n    depart(b[j], 2);\n    cout << coun << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factorize(int m, int k) {\n  int c = 1;\n  if (m < 4)\n    return 1;\n  for (int i = k; i <= sqrt(m); i++)\n    if (!(m % i))\n      c += factorize(m / i, k > i ? k : i);\n  return c;\n}\nint main(int argc, char *argv[]) {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &m);\n    cout << factorize(m, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int n, int min) {\n  int x = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n  }\n  return x;\n}\nint main() {\n  int shu;\n  int number, count = 1;\n  scanf(\"%d\", &number);\n  while (count < number) {\n    cin >> shu;\n    printf(\"%d \", fenjie(shu, 2));\n    count++;\n  }\n  scanf(\"%d\", &shu);\n  printf(\"%d\", fenjie(shu, 2));\n  return 0;\n}\n"}
{"label": "1", "index": "327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      f(n / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n\n  int t = 0;\n  cin >> t;\n  while (t--) {\n    int n = 0;\n    cin >> n;\n    int i = 2, result = 1;\n\n    for (i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        f(n / i, i);\n        result = result + sum;\n      }\n    }\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f2(int i, int a) {\n  int c, s = 0;\n  for (i; i <= a / 2; i++) {\n    if (a % i == 0) {\n      c = a / i;\n      if (c >= i) {\n        s = s + f2(i, c);\n      }\n    }\n  }\n  s = s + 1;\n  return s;\n}\n\nint f(int a) {\n  int s = 0;\n\n  s = s + f2(2, a);\n  return s;\n}\n\nint main() {\n  int n, i, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b = f(a);\n    cout << b << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fib(int a, int e);\nint main() {\n  int n, b, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", fib(b, 2));\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\nint fib(int a, int e) {\n  int j, c, d;\n  c = 1;\n  if (a <= e) {\n    return 1;\n  }\n  for (j = e; j <= sqrt(a); j++) {\n    if (a % j == 0) {\n      d = a / j;\n      c = c + fib(d, j);\n    }\n  }\n  return c;\n}\n"}
{"label": "1", "index": "330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint kind(int k, int a) {\n  int i, j, temp = 0;\n  int x;\n  for (i = a; i < k; i++) {\n    if (i <= k / i && k % i == 0) {\n\n      x = k / i;\n\n      temp++;\n      for (j = i; j < x; j++) {\n        if (j <= x / j && x % j == 0) {\n          temp = temp + kind(x, j);\n          break;\n        }\n      }\n    }\n  }\n\n  return (temp);\n}\nint main() {\n  int n, i, s, a[32768][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i][0];\n    a[i][1] = kind(a[i][0], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i][1] + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int n, int m) {\n  if (n < m)\n    m = n;\n  if (n == 1)\n    return 1;\n  int sum = 0;\n  for (int i = m; i >= 2; i--) {\n    if (n % i == 0) {\n      sum = sum + devide(n / i, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n, i, m;\n  scanf(\"%d \", &n);\n  i = 0;\n  while (i < n) {\n    cin >> m;\n    cout << devide(m, m) << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint func(int m, int q) {\n  int b[100];\n\n  int i, j, k = 0, p = 0, sum = 1;\n  for (j = q; j <= m; j++) {\n    if (j * j > m) {\n      p = k;\n      break;\n    }\n    if (m % j == 0) {\n      b[k] = j;\n      k++;\n    }\n  }\n  if (k > 2 || p != 0 && m != 2) {\n    for (i = 0; i < p; i++) {\n      sum += func(m / b[i], b[i]);\n    }\n    return (sum);\n  } else\n    return (1);\n}\nint main() {\n  int i, j, k = 0, n, m, b[100] = {0}, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    b[i] = func(m, 2);\n  }\n  for (j = 0; j < i; j++) {\n    cout << b[j] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "333", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint a = 2;      \nint result = 0; \nvoid function_1(int, int);\nint main() {\n  int n = 0;\n  int data = 0;\n  int i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> data;\n    function_1(data, a);\n    cout << result << endl;\n    result = 0; \n  }\n  return 0;\n}\nvoid function_1(int x, int y) {\n  int j = 0;\n  if (x == 1) \n  {\n    result = result + 1;\n  }\n  for (j = y; j <= x; j++) \n  {\n    if (x % j == 0) \n    {\n      function_1(x / j, j);\n    }\n  }\n}\n"}
{"label": "1", "index": "334", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count(int a, int n) {\n  if (a > n)\n    return 0;\n  if (a == n) {\n    return 1;\n  }\n  int p = 1;\n  int i;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0 && i <= n / i) {\n      p = p + count(i, n / i);\n    }\n  }\n  return p;\n}\nint geshu(int N) {\n  int i;\n  int s = 1;\n  for (i = 2; i <= sqrt(N); i++) {\n    if (N % i == 0) {\n      s = s + count(i, N / i);\n    }\n  }\n\n  return s;\n}\nint main() {\n  int N;\n  cin >> N;\n  int c[N];\n  int j;\n  for (j = 0; j < N; j++) {\n    cin >> c[j];\n  }\n  for (j = 0; j < N; j++) {\n    cout << geshu(c[j]) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid factor(int, int);\nint result[9999] = {0};\nint j = 0;\nint main() {\n  int times, k = 1;\n  cin >> times;\n  while (k <= times) {\n    int num, ansf = 0;\n    cin >> num;\n    factor(2, num);\n\n    for (int i = 0; i < 9999; i++)\n      if (result[i])\n        ansf++;\n    cout << ansf << \"\\n\";\n\n    for (int i = 0; i < 9999; i++)\n      result[i] = 0;\n\n    k++;\n  }\n\n  return 0;\n}\n\nvoid factor(int start, int num) {\n  if (num == 1) {\n    result[j] = 1;\n    j++;\n  }\n\n  for (int i = start; i <= num; i++) {\n    if (num % i == 0)\n      factor(i, num / i);\n  }\n}\n"}
{"label": "1", "index": "336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint tot;\n\nvoid find(int m, int n) {\n  int i, j, k;\n  if (m == 1)\n    tot = tot + 1;\n  else {\n    for (i = n; i <= m; i++)\n      if (m % i == 0)\n        find(m / i, i);\n  }\n}\n\nint main() {\n  int i, j, k, m, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    tot = 0;\n    scanf(\"%d \", &m);\n    find(m, 2);\n    cout << tot << endl;\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int i;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (cin >> a) {\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0)\n      s += divide(n / i, i);\n  return s;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    scanf(\"%d \", &n);\n    cout << divide(n, n) << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nint a[100];\nvoid search(int t, int k) {\n  int i;\n  if (k == 1)\n    sum++;\n  else\n    for (i = a[t - 1]; i <= k; i++)\n      if (k % i == 0) {\n        a[t] = i;\n        search(t + 1, k / i);\n      }\n}\n\nint main() {\n  int n, i, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &k);\n    sum = 0;\n    a[0] = 2;\n    search(1, k);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint find_factor(int a, int b) {\n  int i, sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      sum = sum + find_factor(a / i, i);\n  return sum;\n}\n\nint main(void) {\n  int n;\n  cin >> n;\n  int a;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << find_factor(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "341", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, t, cnt;\nvoid f(int left, int last) {\n  if (left < last) {\n    if (left == 1)\n      cnt++;\n    return;\n  }\n  for (int i = last; i <= left; i++)\n    if (left % i == 0)\n      f(left / i, i);\n}\nint main() {\n  scanf(\"%d \", &t);\n  while (t--) {\n    scanf(\"%d\", &n);\n    cnt = 0;\n    f(n, 2);\n    printf(\"%d\\n\", cnt);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fun(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i * i <= y; i++)\n    if (y % i == 0) {\n      sum++;\n      sum += fun(i, y / i);\n    }\n  return sum;\n}\nint main() {\n  int n, i, sum;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    n--;\n    scanf(\"%d\", &i);\n    sum = 1;\n    sum += fun(2, i);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint prime(int n, int m) {\n  int i, total = 1;\n  if (n < m)\n    return 0;\n\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      total += prime(n / i, i);\n  }\n  return total;\n}\nint main() {\n  int n, b[2000], b0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b0);\n    b[i] = prime(b0, 2);\n  }\n  for (i = 0; i <= n - 2; i++)\n    cout << b[i] << \"\\n\";\n\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "1", "index": "344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, t;\nvoid dg(int s) {\n  for (int i = s; i <= t; i++) {\n    if (t % i == 0) {\n      t = t / i;\n      if (t == 1)\n        sum++;\n      else\n        dg(i);\n      t = t * i;\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d \", &t);\n    dg(2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p = 0;\n\nint factor(int a, int min) {\n  int sum = 0;\n  if (min >= a)\n    return 1;\n  for (int j = min; j <= a / min; j++)\n    if (a % j == 0)\n      sum += factor(a / j, j);\n  return sum;\n}\n\nint main() {\n  int n = 0, a = 0;\n  cin >> n;\n  while (n > 0) {\n    cin >> a;\n    if (a <= 2)\n      cout << 1 << endl;\n    else\n      cout << factor(a, 2) + 1 << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "346", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num = 0;\nvoid asd(int i, int q) {\n  int j;\n  for (j = q; j > 1; j--) {\n    if (i % j != 0)\n      continue;\n    if (i == j) {\n      num++;\n    } else {\n      q = j;\n      asd(i / j, q);\n    }\n  }\n}\nint main() {\n  int n, o;\n  cin >> n;\n  for (o = 0; o < n; o++) {\n    num = 0;\n    int a;\n    cin >> a;\n    asd(a, a);\n    if (num == 1)\n      cout << 1 << endl;\n    else\n      cout << num << endl;\n  }\n}\n"}
{"label": "1", "index": "347", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++) {\n      sum = sum + divide(n, j);\n    }\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\nint divide(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divide(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint counter = 1;\nvoid abc(int a, int b) {\n  int i;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0 && (a / i) >= i) {\n      counter++;\n      abc(a / i, i);\n    }\n  }\n}\nint main() {\n  int t, x;\n  cin >> t;\n  for (x = 1; x <= t; x++) {\n    counter = 1;\n    int m;\n    cin >> m;\n    abc(m, 2);\n    cout << counter << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "349", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int s, int num) {\n  if (s == num)\n    return 1;\n  if (s < num)\n    for (int i = s; i <= num; i++) {\n      if (num % i == 0) {\n        if (i < num)\n          return f(i, num / i) + f(i + 1, num);\n        if (i == num)\n          return 1;\n      }\n    }\n  if (s > num)\n    return 0;\n}\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    printf(\"%d\\n\", f(2, num));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "350", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fenjie(int, int);\n\nint fenjie(int q1, int n1) {\n  int s1, i1;\n  if (q1 > n1)\n    return 0;\n  else {\n    s1 = 0;\n    for (i1 = q1; i1 <= n1; i1++) {\n      if ((i1 >= 2) && (n1 % i1 == 0) && (n1 / i1 >= i1)) {\n        s1++;\n        s1 = s1 + fenjie(i1, n1 / i1);\n      }\n    }\n    return s1;\n  }\n}\n\nint main() {\n  int m, i, n;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    cout << fenjie(1, n) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "351", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nvoid devide(int a, int b) {\n  if (a == 1)\n    sum++;\n  else {\n    if (a >= b)\n      devide(a, b + 1);\n    if (a % b == 0)\n      devide(a / b, b);\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    devide(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint get(int n, int m) {\n  if (n == 1)\n    return 1;\n  while (m >= 2) {\n    if (n % m == 0)\n      break;\n    --m;\n  }\n  if (m == 1)\n    return 0;\n  return get(n / m, m) + get(n, m - 1);\n}\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; ++i) {\n    int n;\n    cin >> n;\n    cout << get(n, n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ans = 0;\nvoid work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return;\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0) {\n      work(p / i, i);\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    ans = 0;\n    int t;\n    scanf(\"%d\", &t);\n    work(t, 2);\n    \n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, used[32770] = {0};\nvoid f(int n) {\n  for (int i = 2; i <= n; i++) {\n    if (n % i == 0 && used[i] == 0) {\n      if (i != 2) {\n        for (int j = 2; j <= i - 1; j++)\n          used[j] = 1;\n      }\n      if (n / i == 1) {\n        sum++;\n        break;\n      } else {\n        f(n / i);\n      }\n      memset(used, 0, sizeof(used));\n    }\n  }\n}\nint main() {\n  int m, a[100];\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n    if (a[i] == 1) {\n      printf(\"%d\\n\", 1);\n    } else {\n      f(a[i]);\n      cout << sum << endl;\n      sum = 0;\n      memset(used, 0, sizeof(used));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint devide(int n, int k) {\n  int s, i;\n  s = 1;\n  for (i = k; i <= sqrt(n * 1.0); i++) {\n    if (n % i == 0) {\n      s = s + devide(n / i, i);\n    }\n  }\n  return s;\n}\nint main() {\n  int n, a[200], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0)\n      printf(\"%d\", devide(a[i], 2));\n    else\n      printf(\"\\n%d\", devide(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, m, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    cout << f(m, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int m, int min) {\n  int count = 1, i;\n  if (m == 1)\n    return 1;\n  else if (m == 2)\n    return 1;\n  else {\n    for (i = min; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        count += f(m / i, i);\n    }\n    return count;\n  }\n}\n"}
{"label": "1", "index": "357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f2(int i, int a) {\n  int c, s = 0;\n  for (i; i <= a / 2; i++) {\n    if (a % i == 0) {\n      c = a / i;\n      if (c >= i) {\n        s = s + f2(i, c);\n      }\n    }\n  }\n  s = s + 1;\n  return s;\n}\n\nint f(int a) {\n  int s = 0;\n\n  s = s + f2(2, a);\n  return s;\n}\n\nint main() {\n  int n, i, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b = f(a);\n    printf(\"%d\\n\", b);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "358", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int begin, int m) {\n  int i;\n  for (i = begin; i <= m; i++) {\n    if (m % i == 0 && m / i >= i) {\n      sum++;\n      f(i, m / i);\n    }\n    if (i > m / i)\n      break;\n  }\n}\nint main() {\n  int n, j, m;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> m;\n    f(2, m);\n    printf(\"%d\\n\", sum);\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "359", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count_1;\n\nvoid f(int n, int min) {\n  int i;\n  if (n == min) {\n    count_1++;\n    return;\n  }\n  if (n % min != 0)\n    return;\n\n  for (i = min; i <= n; i++) {\n    f(n / min, i);\n  }\n}\n\nint main() {\n  int N, i, num, j;\n  scanf(\"%d\", &num);\n  for (j = 1; j <= num; j++) {\n    count_1 = 0;\n    scanf(\"%d\", &N);\n    for (i = 2; i <= N; i++)\n      f(N, i);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint T, n;\n\nint calc(int n, int min) {\n  if (n == 1)\n    return 1;\n  if (n <= min)\n    return 0;\n  int re = 0;\n  for (int i = min + 1; i <= n; i++)\n    if (n % i == 0) {\n\n      re += calc(n / i, i - 1);\n    }\n  if (!re)\n    re = 1;\n\n  return re;\n}\n\nint main() {\n\n  scanf(\"%d\", &T);\n  while (T--) {\n    scanf(\"%d\", &n);\n    cout << calc(n, 1) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "361", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fj(int a, int b);\n\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fj(a, 2));\n  }\n\n  return 0;\n}\nint fj(int a, int b) {\n  int j, x, sum = 1, f = 0;\n  x = sqrt((double)a);\n  if ((a == 1) || (a == 2) || (a == 3))\n    return 1;\n  else {\n    for (j = b; j <= x; j++) {\n      if (a % j == 0) {\n        sum += fj(a / j, j);\n        f = 1;\n      }\n    }\n    if (f == 0)\n      return 1;\n    else {\n      return sum;\n    }\n  }\n}\n"}
{"label": "1", "index": "362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fun(int i, int j, int count) {\n  int k;\n  for (k = i; k <= sqrt(j); k++)\n    if (j % k == 0) {\n      count++;\n      count = fun(k, j / k, count);\n    }\n  return count;\n}\n\nint main() {\n  int count;\n  int k, n, i, j;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++) {\n    scanf(\"%d\", &n);\n    count = 1;\n    for (i = 2; i < sqrt(n); i++)\n      if (n % i == 0) {\n        count++;\n        count = fun(i, n / i, count);\n      }\n\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], i;\n  void fen(int a[], int x);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fen(a, n);\n}\nvoid fen(int a[], int x) {\n  int k, b = 2, c, t;\n  int look(int x, int y);\n  for (k = 0; k < x; k++) {\n    c = a[k];\n    t = look(c, b);\n    printf(\"%d\\n\", t);\n  }\n}\nint look(int x, int y) {\n  int total = 1, p;\n  if (x / y == 0) {\n    return 0;\n  } else {\n    for (p = y; p < x; p++) {\n      if (x % p == 0) {\n        total = total + look(x / p, p);\n      }\n    }\n  }\n  return total;\n}\n"}
{"label": "1", "index": "364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint total = 0;\nint divide(int k, int number) {\n  if (number == 1) {\n    total++;\n    return 0;\n  }\n  int i;\n  for (i = k; i <= number; i++) {\n    if (number % i == 0)\n      divide(i, number / i);\n  }\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  int num[n];\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    total = 0;\n    divide(2, num[i]);\n    cout << total << endl;\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint numcheck(int num, int a) {\n  int i = 0, sum = 0;\n  if (num == 1)\n    return 1;\n  else if (num < a)\n    return 0;\n  else {\n    for (i = a; i <= num; i++) {\n      if (num % i == 0)\n        sum = sum + numcheck(num / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, num = 0, sum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    sum = numcheck(num, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sushu(int a) {\n  int b = 2, c, d = 0, k;\n  while (b < a) {\n    c = a % b;\n    if (c != 0) {\n      b = b + 1;\n      d = d + 1;\n    } else\n      break;\n  }\n\n  if (d == (a - 2))\n    k = 1;\n  else {\n    k = 0;\n  }\n  return k;\n}\nint zheng(int n, int i) {\n  int sum = 1, a;\n  for (a = i; a < n / 2; a++) {\n    if (n % a == 0) {\n      if (a <= n / a) {\n        sum = sum + zheng(n / a, a);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j = 0, k = 0, b[10000] = {0}, e[40000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &e[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (sushu(e[i]) == 0) {\n      b[i] = zheng(e[i], 2);\n    } else {\n      b[i] = 1;\n    }\n  }\n\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    printf(\"\\n%d\", b[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "367", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid TRY(int, int);\nint num = 1;\nint main() {\n  unsigned short int n;\n  int INTEGER;\n  cin >> n;\n  while (n-- > 0) {\n    cin >> INTEGER;\n    int h = 2;\n    TRY(h, INTEGER);\n    cout << num << endl;\n    num = 1;\n  }\n  return 0;\n}\nvoid TRY(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if ((b % i == 0) && (b / i != 1)) {\n      num++;\n      TRY(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s;\nvoid search(int a, int k) {\n  if (a == 0)\n    return;\n  if (a == 1) {\n    return;\n  }\n  for (int i = 2; i < a; i++) {\n    if (a % i == 0 && a / i >= i && i >= k && a / i >= k) {\n      s++;\n      search(a / i, i);\n    }\n  }\n  return;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    s = 1;\n    cin >> a;\n    search(a, 1);\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid f(int a, int s) {\n  int i;\n  if (a == 1)\n    sum++;\n  else {\n\n    for (i = s; i <= a; i++) {\n      if (a % i == 0)\n        f((a / i), i);\n    }\n  }\n  return;\n}\n\nint main() {\n  int n, num, j;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> num;\n    f(num, 2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n\n  if (n < min)\n    return 0;\n\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result += factor(n / i, i);\n  }\n\n  return result;\n}\nint main() {\n  int m, x, j, k;\n\n  scanf(\"%d\", &m);\n\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d\", &x);\n\n    k = factor(x, 2);\n\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint g(int x, int j) {\n  for (j++; j <= x; j++) {\n    if (x == j)\n      return 1;\n    if (x % j == 0 && x / j >= j)\n      return g(x / j, j - 1) + g(x, j);\n  }\n  return 0;\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << g(a, 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "372", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ans(int a, int i) {\n  int sum = 0;\n  for (int j = i; j <= sqrt(a); j++) {\n    if (a % j != 0)\n      continue;\n    sum++;\n    if (a >= j * j)\n      sum += ans(a / j, j);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    cout << ans(a, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n  if (n < min) {\n    return 0;\n  }\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result = result + factor(n / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a[100000], b[100000];\n  cin >> n;\n  for (int j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    b[j] = factor(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "374", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint t;\nvoid calc(int a, int d) {\n  int i;\n  if (a == 1)\n    t++;\n  else {\n    if (a >= d)\n      for (i = d; i <= a; i++)\n        if (a % i == 0)\n          calc(a / i, i);\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    t = 0;\n    calc(a, 2);\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "1", "index": "375", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t);\nint main() {\n  int i, q, p, n;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1);\n    printf(\"%d\\n\", l);\n  }\n}\nint fff(int w, int t) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1)\n        l++;\n\n      if (x > 1)\n        fff(w, i);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num;\nvoid divide(int n, int n2) {\n  int i, m1;\n  m1 = (int)sqrt((double)n);\n  for (i = n2; i <= m1; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 1;\n    scanf(\"%d \", &m);\n\n    divide(m, 2);\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++) {\n      sum = sum + divide(n, j);\n    }\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\nint divide(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divide(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "378", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int num, int minA1) {\n  int count = 0;\n  int sqrtNum;\n  int i;\n\n  if (num <= minA1)\n    return 0;\n\n  sqrtNum = (int)sqrt((double)num);\n  for (i = minA1; i <= sqrtNum; i++)\n    if (num % i == 0) {\n      count++;\n      count += factor(num / i, i);\n    }\n\n  return count;\n}\n\nint main() {\n  int n;\n  int num;\n\n  cin >> n;\n\n  while (n--) {\n    scanf(\"%d \", &num);\n    cout << factor(num, 2) + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int t, int k) {\n  int u = 1, i;\n  if (t > 2) {\n    for (i = k; i <= sqrt(t); i++) {\n      if (t % i == 0) {\n        u += f(t / i, i);\n      }\n    }\n    return u;\n  } else if (t == 2)\n    return 1;\n  else {\n    if (t == 1)\n      return 0;\n  }\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d \", f(t, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int n, int min) {\n  int x = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n  }\n  return x;\n}\nint main() {\n  int shu;\n  int number, count = 1;\n  scanf(\"%d\", &number);\n  while (count < number) {\n    scanf(\"%d\", &shu);\n    printf(\"%d \", fenjie(shu, 2));\n    count++;\n  }\n  cin >> shu;\n  printf(\"%d\", fenjie(shu, 2));\n}\n"}
{"label": "1", "index": "381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0, p;\nint dfs(int dep, int last, int k) {\n  if (k == 1) {\n    varieties++;\n    return 0;\n  }\n  for (int i = last; i <= k; i++)\n    if (k % i == 0) {\n      dfs(dep + 1, i, k / i);\n    }\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  int m[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &t);\n    dfs(0, 2, t);\n    m[i] = varieties;\n    varieties = 0;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", m[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint digui(int m, int n, int sum) {\n  int i;\n  sum++;\n  if (sqrt(m) < n)\n    return sum;\n  else {\n    for (i = n; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        sum = digui(m / i, i, sum);\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", digui(a, 2, 0));\n  }\n}\n"}
{"label": "1", "index": "383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal(int, int);\nint main() {\n  \n  int n = 0;\n  cin >> n;\n  \n  for (int i = 0; i < n; i++) {\n    int m = 0;\n    cin >> m;\n    \n    cout << cal(m, 2) << endl;\n  }\n\n  return 0;\n}\n\nint cal(int m, int i) {\n  int count = 0;\n  if (m == 1)\n    return 1;          \n  for (i; i <= m; i++) \n  {\n\n    if (m % i == 0) {\n      count += cal(m / i, i);\n    }\n  }\n  \n  return count;\n}\n"}
{"label": "1", "index": "384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num(int b, int min);\nint x = 1, m;\nint main() {\n  int a, n, b;\n  scanf(\"%d\", &n);\n  for (a = 0; a <= n - 1; a++) {\n    cin >> b;\n    m = b;\n    b = num(b, 2);\n    cout << b << \"\\n\";\n    x = 1;\n  }\n  return 0;\n}\n\nint num(int b, int min) {\n  int a, c;\n\n  for (a = min; a < b; a++) {\n    if ((b % a == 0) && (b / a >= a)) {\n      if (num(b / a, a) == 1) {\n        x++;\n      }\n    }\n    if (a == m - 1) {\n      return x;\n    }\n  }\n  return 1;\n}\n"}
{"label": "1", "index": "385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int x) {\n  int count = 1, i;\n  for (i = x; i < a; i++)\n    if (a % i == 0)\n      count += f(a / i, i);\n  if (i == a)\n    return count;\n  else\n    return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    cin >> a;\n    if (a == 1 || a == 2)\n      cout << \"1\\n\";\n    else\n      printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int, int);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << factor(num, 2) << endl;\n  }\n  return 0;\n}\nint factor(int n, int min) {\n  int i;\n  int num = 1;\n  if (n < min)\n    return 0;\n  else {\n    for (i = min; i < n; i++) {\n      if (n % i == 0)\n        num += factor(n / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "387", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint dividemin(int a, int minyinzi) {\n  int num = 0;\n  if (a == 1)\n    num++;\n  else\n    for (int i = minyinzi; i <= a; i++) {\n      if (a % i == 0)\n        num = num + dividemin(a / i, i);\n    }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= n - 1; i++)\n\n    printf(\"%d\\n\", dividemin(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t = 0, ways; \nvoid divide(int x, int h) {\n  int i;\n  if (x == 1) \n  {\n    t++;\n    ways = t;\n  } \n  else\n    for (i = h; i <= x; i++)\n      if (x % i == 0) {\n        h = i;\n        divide(x / h, h); \n      }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    t = 0;\n    divide(a[i], 2);\n    cout << ways << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\nint main() {\n  int i, n, t, r, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &num);\n    r = fenjie(num, 2);\n    cout << r << endl;\n  }\n  return 0;\n}\nint fenjie(int num, int min) {\n  int i, j, k, r = 0;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0)\n      r = r + fenjie(num / i, i);\n\n    if (i == num)\n      r++;\n  }\n  return r;\n}\n"}
{"label": "1", "index": "390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint fenjie(int a, int max) { \n  int i = 0;\n  int sum = 0; \n  if (a == 1)\n    return 1; \n  for (i = max; i >= 2; i--) {\n    if ((a % i) == 0)\n      sum += fenjie(a / i, i); \n  }\n  return sum; \n}\n\nint main() {\n  int k = 0;\n  int n = 0;\n  int num = 0;\n  cin >> n; \n  for (k = 1; k <= n; k++) {\n    cin >> num;               \n    cout << fenjie(num, num); \n    if (k < n)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "391", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint T, n;\n\nint calc(int n, int min) {\n  if (n == 1)\n    return 1;\n  if (n <= min)\n    return 0;\n  int re = 0;\n  for (int i = min + 1; i <= n; i++)\n    if (n % i == 0) {\n\n      re += calc(n / i, i - 1);\n    }\n  if (!re)\n    re = 1;\n\n  return re;\n}\n\nint main() {\n\n  scanf(\"%d\", &T);\n  while (T--) {\n    cin >> n;\n    printf(\"%d\\n\", calc(n, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Factor(int, int);\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << Factor(a, 2) << \"\\n\";\n  }\n  return 0;\n}\nint Factor(int a, int p) {\n  int i, j, z = 1;\n  if (a < p)\n    z = 0;\n  else {\n    for (i = p; i <= a; i++) {\n      if (a % i == 0)\n        z += Factor(a / i, i);\n    }\n  }\n  return z;\n}\n"}
{"label": "1", "index": "393", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int x, int y) {\n  num++;\n  for (int j = y; j * j <= x; j++) {\n    if (x % j == 0)\n      f(x / j, j);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[1100];\n  for (int i = 1; i <= n; i++) {\n    num = 0;\n    cin >> a[i];\n    f(a[i], 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nvoid count(int x, int y) {\n  int i;\n  if (x == 1)\n    n = n + 1;\n  else {\n    for (i = y; i <= x; i++) {\n      if (x % i == 0)\n        count(x / i, i);\n    }\n  }\n}\nint main() {\n  int i, k, t;\n  void count(int x, int y);\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    n = 0;\n    cin >> t;\n    count(t, 2);\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s = 0, p = 1;\nvoid fenjie(int a, int b) {\n  int i;\n  if (a == 1)\n    s++;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      fenjie(a / i, i);\n  return;\n}\nint main() {\n  int n, i, j, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 2; j * j <= a[i]; j++) {\n      if (a[i] % j == 0) {\n        s = 0;\n        fenjie(a[i] / j, j);\n        p = p + s;\n      }\n    }\n    cout << p << \"\\n\";\n    p = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "396", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num(int, int, int);\nint qufen(int);\nint power(int, int);\nint main() {\n  int t;\n  cin >> t;\n  while (t >= 1) {\n    int n, i, x, sum = 1;\n    cin >> n;\n    x = qufen(n); \n    for (i = 2; i <= x; i++)\n      sum = sum + num(n, i, 2); \n    cout << sum << endl;\n    t--;\n  }\n  return 0;\n}\nint qufen(int n) {\n  int j;\n  for (j = 1;; j++) {\n    if (power(2, j) > n) {\n      return j - 1;\n      break;\n    }\n  }\n}\nint power(int a, int b) {\n  int sum = 1, k;\n  for (k = 1; k <= b; k++) \n    sum = sum * a;\n  return sum;\n}\nint num(int n, int g, int h) {\n  if ((g == 1) && (n >= h)) \n    return 1;\n  int i, j = 0, count = 0, a[20000];\n  for (i = h; i < n; i++) \n  { \n    if (n % i == 0) {\n      a[j] = i;\n      j++;\n    }\n  }\n  if (j == 0) \n    return 0;\n  else {\n    for (i = 0; i < j; i++)\n      count = count + num(n / a[i], g - 1, a[i]);\n    return count;\n  }\n}\n"}
{"label": "1", "index": "397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int digui(int p, int q);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a, sum = 1;\n    scanf(\"%d\", &a);\n    for (j = 2; j < a; j++) {\n      if (j * j > a)\n        break;\n      else if (a % j == 0)\n        sum = sum + digui(j, a / j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\nint digui(int p, int q) {\n  int z = 1, d;\n  if (p == q)\n    z = 1;\n  else if (p > q)\n    z = 0;\n  else\n    for (d = p; d < q; d++) {\n      if (d * d > q)\n        break;\n      else if (q % d == 0)\n        z = z + digui(d, q / d);\n    }\n  return (z);\n}\n"}
{"label": "1", "index": "398", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint meide(int x, int y) {\n  int sum = 1, count = 0, i;\n  for (i = y; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      sum = sum + meide(x / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, n, m;\n  scanf(\"%d \", &k);\n  for (m = 0; m < k; m++) {\n    scanf(\"%d\", &n);\n    if (n >= 3) {\n      printf(\"%d\\n\", meide(n, 2));\n    } else {\n      printf(\"1\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "399", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\n\nvoid f(int x, int i) {\n  double m = sqrt(x);\n  if (i < m) {\n    if (x % i == 0) {\n      sum++;\n      f(x / i, i);\n    }\n    f(x, i + 1);\n  }\n\n  if (fabs(i - m) < 0.00000001)\n    sum++;\n}\n\nint main() {\n  int x, i, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    sum = 0;\n    f(x, 2);\n\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "400", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int N;\n  cin >> N;\n  int i;\n  for (i = 1; i <= N; i++) {\n\n    int a;\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int j;\n  int number = 1;\n  for (j = m; j <= (int)sqrt(n); j++) {\n    if (n % j == 0)\n      number = number + f(n / j, j);\n  }\n  return number;\n}\n"}
{"label": "1", "index": "401", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sdw(int a, int b) {\n  int i;\n  int m = 1;\n  for (i = a; i < b / 2; i++) {\n    if (b % i == 0) {\n      if (i <= b / i)\n        m = sdw(i, b / i) + m;\n    }\n  }\n  return m;\n}\nint main() {\n  int n, i, p, b;\n  int a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = a[i];\n    p = sdw(2, b);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "402", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Factorize(int n, int fact);\nint number = 0;\nint main() {\n  int times, num, i;\n  scanf(\"%d \", &times);\n  for (i = 0; i < times; i++) {\n    scanf(\"%d \", &num);\n    Factorize(num, 2);\n    cout << number << endl;\n    number = 0;\n  }\n  return 0;\n}\nvoid Factorize(int n, int fact) {\n  int i;\n  for (i = fact; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      Factorize(n / i, i);\n  }\n  number++;\n}\n"}
{"label": "1", "index": "403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n  if (n < min)\n    return 0;\n\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result = result + factor(n / i, i);\n  }\n  return result;\n}\nint main() {\n  int n, a[100000], b[100000];\n  cin >> n;\n  for (int j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    b[j] = factor(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fj(int m, int min);\n  int t, i, a[100];\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n\n    cin >> a[i];\n    cout << fj(a[i], 2) << endl;\n  }\n\n  return 0;\n}\nint fj(int m, int min) {\n  int counter = 1;\n  int i;\n  if (m < min)\n    return 0;\n  for (i = min; i < m; i++)\n    if (m % i == 0) {\n      counter = fj(m / i, i) + counter;\n    }\n  return counter;\n}\n"}
{"label": "1", "index": "405", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid yinshu(int x, int y) {\n  if (x == y)\n    num++;\n  else {\n    if ((x % y == 0) && (x > y)) {\n      yinshu(x / y, y);\n      yinshu(x, y + 1);\n    } else if (x > y)\n      yinshu(x, y + 1);\n  }\n}\nint main() {\n  int n, x;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> x;\n    yinshu(x, 2);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int n, int i) {\n  for (i = 2; i <= n / 2; i++)\n    if (n % i == 0)\n      break;\n  return (i == n / 2 && n != 4) ? 1 : 0;\n}\nint f(int n, int k) {\n  if (check(n, 2) == 1 || k == n)\n    return 1;\n  else if (n < k)\n    return 0;\n  else {\n    int h = 0, i;\n    for (i = k; i <= sqrt(n); i++)\n      if (n % i == 0)\n        h += f(n / i, i);\n    return h + 1;\n  }\n}\n\nint main() {\n  int n, h, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h);\n    cout << f(h, 2) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0; \nint yueshu[100] = {0};\nint s = 0;\n\nvoid number(int num, int s) {\n  int i;\n  for (i = s; i >= 0; i--) {\n    if (num < yueshu[i])\n      continue;\n    if (num == yueshu[i])\n      sum++;\n    else if (num > yueshu[i] && num % yueshu[i] == 0)\n      number(num / yueshu[i], i);\n  }\n}\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int num = 0;\n  while (cin >> num) {\n    int i = 0, j = 0;\n    for (i = 2; i <= num; i++)\n      if (num % i == 0) {\n        yueshu[j] = i;\n        j++;\n      }\n    s = j - 1;\n    number(num, s);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s(int, int);\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", s(a, 2));\n  }\n  return 0;\n}\nint s(int a, int b) {\n  int i, t = 0;\n  for (i = b; i < a; i++)\n    if (a % i == 0 && a / i >= i)\n      t = t + s(a / i, i);\n  return t + 1;\n}\n"}
{"label": "1", "index": "409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int, int, int);\nint g_num, g_count;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    g_count = 0;\n    cin >> g_num;\n    fenjie(2, g_num, 1);\n    printf(\"%d\\n\", g_count);\n  }\n  return 0;\n}\nvoid fenjie(int a, int num, int sum) {\n  while (a <= g_num) {\n    sum *= a;\n    if (sum == g_num)\n      g_count++;\n    if (sum < g_num)\n      fenjie(a, g_num, sum);\n    if (sum > g_num)\n      return;\n    sum /= a;\n    a++;\n  }\n}\n"}
{"label": "1", "index": "410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint s(int a, int b) {\n  int sum = 0, z = 0;\n  if (a != 1 && b <= a) {\n    for (int i = b; i <= a; ++i) {\n      if (a % i == 0) {\n        sum += s(a / i, i);\n        z = 1;\n      }\n    }\n\n  } else if (a == 1)\n    return 1;\n\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; ++i) {\n    cin >> a;\n    printf(\"%d\\n\", s(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid out(int, int);\n\nint t = 1;\n\nint main() {\n  int n = 0;\n  int i = 0;\n  double sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> sum;\n    out(sum, 2.0);\n    cout << t << \"\\n\";\n    t = 1;\n  }\n\n  cin >> i;\n\n  return 0;\n}\n\nvoid out(int sum, int q) {\n  int num = 0;\n  double m = sum;\n  num = sqrt(m);\n  if (sum % q == 0 && q <= num) {\n    t++;\n    out(sum / q, q);\n    out(sum, q + 1);\n  }\n  if (sum % q != 0 && q <= num)\n    out(sum, q + 1);\n}\n"}
{"label": "1", "index": "412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int k = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      k = k + f(a / i, i);\n    }\n  }\n  return (k);\n}\n\nint main() {\n  int f(int a, int min);\n  int j, n;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    b[j] = f(a[j], 2);\n    cout << b[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num(int b, int min);\nint x = 1, m;\nint main() {\n  int a, n, b;\n  scanf(\"%d\", &n);\n  for (a = 0; a <= n - 1; a++) {\n    cin >> b;\n    m = b;\n    b = num(b, 2);\n    cout << b << \"\\n\";\n    x = 1;\n  }\n  return 0;\n}\n\nint num(int b, int min) {\n  int a, c;\n\n  for (a = min; a < b; a++) {\n    if ((b % a == 0) && (b / a >= a)) {\n      if (num(b / a, a) == 1) {\n        x++;\n      }\n    }\n    if (a == m - 1)\n      return x;\n  }\n  return 1;\n}\n"}
{"label": "1", "index": "414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cal(int y, int x) {\n  int i, sum;\n  if (x == 1)\n    return 1;\n  else {\n    sum = 0;\n    for (i = y; i <= x; i++) {\n      if ((x % i == 0) && ((x / i == 1) || (x / i > y)))\n        sum += cal(i, x / i);\n    }\n    return sum;\n  }\n}\nint main() {\n  int n, i, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &l);\n    printf(\"%d\", cal(2, l));\n    if (i != n)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    cin >> x;\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n  return 0;\n}\nint fff(int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1)\n        l++;\n\n      if (x > 1)\n        fff(w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint calc(int p, int t);\n\nint main() {\n  int m, n, ans;\n\n  scanf(\"%d\", &m);\n\n  while (m--) {\n    cin >> n;\n    ans = calc(2, n);\n    cout << ans << \"\\n\";\n  }\n\n  return 0;\n}\n\nint calc(int p, int t) {\n  int i, a;\n\n  a = 1;\n  for (i = p; i <= sqrt(t); i++)\n    if (t % i == 0)\n      a = a + calc(i, t / i);\n  return a;\n}\n"}
{"label": "1", "index": "417", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint s = 0;\n\nvoid find(int min, int dev) {\n  int i;\n  for (i = min; i <= sqrt((float)dev); i++)\n    if (dev % i == 0) {\n      s++;\n      find(i, dev / i);\n    }\n}\n\nint main() {\n  int n, i, m, j;\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    for (i = 2; i <= sqrt((float)n); i++)\n      if (n % i == 0) {\n        s++;\n        find(i, n / i);\n      }\n    printf(\"%d\\n\", s + 1);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "418", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divi(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divi(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++)\n      sum = sum + divi(n, j);\n\n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int max) {\n  int i = 0;\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = max; i >= 2; i--) {\n    if ((a % i) == 0)\n      sum += fenjie(a / i, i);\n  }\n  return sum;\n}\n\nint main() {\n  int k = 0;\n  int n = 0;\n  int num = 0;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d \", &num);\n    cout << fenjie(num, num);\n    if (k < n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], i;\n  void fen(int a[], int x);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fen(a, n);\n  return 0;\n}\nvoid fen(int a[], int x) {\n  int k, b = 2, c, t;\n  int look(int x, int y);\n  for (k = 0; k < x; k++) {\n    c = a[k];\n    t = look(c, b);\n    printf(\"%d\\n\", t);\n  }\n}\nint look(int x, int y) {\n  int total = 1, p;\n  if (x / y == 0)\n    return 0;\n  else {\n    for (p = y; p < x; p++) {\n      if (x % p == 0) {\n        total = total + look(x / p, p);\n      }\n    }\n  }\n  return total;\n}\n"}
{"label": "1", "index": "421", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint dispose(int, int);\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p;\n    cout << dispose(p, 2) << endl;\n  }\n  return 0;\n}\n\nint dispose(int p, int y) {\n  int i, sol = 1;\n  for (i = y; i <= (int)(sqrt(p)); i++) {\n    if (p % i == 0) {\n      sol += dispose(p / i, i);\n    }\n  }\n  return sol;\n}\n"}
{"label": "1", "index": "422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int n, int min) \n{\n  int i, method = 0; \n  if (n >= min)\n    method++;\n  for (i = min; i < n; i++) {\n    if (!(n % i))\n      method += divide(n / i, i);\n  }\n  return method;\n}\nint main() {\n  int number = 0, integer; \n  int i;\n  cin >> number;\n  for (i = 0; i < number; i++) {\n    cin >> integer;\n    cout << divide(integer, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(int n, int i) {\n  for (i = 2; i <= n / 2; i++)\n    if (n % i == 0)\n      break;\n  return (i == n / 2 && n != 4) ? 1 : 0;\n}\nint f(int n, int k) {\n  if (check(n, 2) == 1 || k == n)\n    return 1;\n  else if (n < k)\n    return 0;\n  else {\n    int h = 0, i;\n    for (i = k; i <= sqrt(n); i++)\n      if (n % i == 0)\n        h += f(n / i, i);\n    return h + 1;\n  }\n}\n\nint main() {\n  int n, h, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h);\n    printf(\"%d\\n\", f(h, 2));\n  }\n}\n"}
{"label": "1", "index": "424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint panduansushu(int t) {\n  int i;\n  for (i = 2; i < t; i++) {\n    if (t % i == 0)\n      break;\n  }\n  if (i > t / 2)\n    return 1;\n  else\n    return 0;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n}\n\nint main() {\n  int a[100], i, res, j, n;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    if (panduansushu(a[j]) == 1)\n      printf(\"1\\n\");\n    else {\n      for (i = 2, res = 1; i < a[j] / 2; i++) {\n        if (a[j] % i == 0) {\n          sum = 0;\n          fun(a[j] / i, i);\n          res += sum;\n        }\n      }\n      printf(\"%d\\n\", res);\n    }\n  }\n}\n"}
{"label": "1", "index": "425", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int k, int n) {\n  int i, flag = 0;\n  for (i = k; i <= n; i++) {\n    if (n % i == 0) {\n      f(i, n / i);\n      flag = 1;\n    }\n  }\n  if ((flag == 0 && k <= n) || n == 1) {\n    num++;\n  }\n}\nint main() {\n  int i, n, m;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    f(2, n);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "426", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int j, num;\n  if (a < min) {\n    return 0;\n  }\n  num = 1;\n  for (j = min; j < a; j++)\n    if (a % j == 0)\n      num = num + f(a / j, j);\n  return num;\n}\n\nint main() {\n  int n, i, out, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    out = f(a, 2);\n    cout << out << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "427", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ana(int n, int p) {\n  int i;\n  int t, s = 1;\n  t = pow(n, 0.5);\n  for (i = p; i <= t; i++)\n    if (n % i == 0)\n      s = s + ana(n / i, i);\n  return s;\n}\n\nint main() {\n  int n;\n  int a[100];\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", ana(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "428", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int min, int a) {\n  if (min > a)\n    return 0;\n\n  int i;\n  int num = 1;\n  for (i = min; i <= sqrt(a); i++) {\n    if (a % i == 0)\n\n      num = num + f(i, a / i);\n  }\n\n  return num;\n}\nint main() {\n  int m, a, j;\n  cin >> m;\n  for (j = 0; j < m; j++) {\n    scanf(\"%d \", &a);\n    cout << f(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint judge1(int n) {\n  int i;\n  if (n == 2 || n == 3 || n == 5)\n    return 1;\n  if (n == 4)\n    return 0;\n  for (i = 2; i * i < n; i++) {\n    if (n % i == 0) {\n      return 0;\n      break;\n    }\n  }\n  if (i * i > n)\n    return 1;\n}\nvoid divide(int n, int d) {\n  for (int i = d; i * i <= n; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, d);\n    }\n    d++;\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n) {\n    n--;\n    cin >> m;\n    num = 1;\n    divide(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    int m;\n    cin >> m;\n    int f(int a, int min);\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\nint f(int a, int min) {\n  int i = min;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  while (i < a) {\n    if (a % i == 0)\n      result += f(a / i, i);\n\n    i++;\n  }\n  return result;\n}\n"}
{"label": "1", "index": "431", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint number = 0;\nint l;\nvoid sort(int n) {\n  int i;\n  for (i = l; n / i >= i; i++) {\n    if (n % i == 0) {\n      l = i;\n      sort(n / i);\n      if (n / i == 1)\n        number++;\n    }\n  }\n  number++;\n}\nint main() {\n  int n, m, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    l = 2;\n    number = 0;\n    cin >> m;\n    sort(m);\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n\n  if (n < min) {\n    return 0;\n  }\n\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result += factor(n / i, i);\n    }\n  }\n\n  return result;\n}\nint main() {\n  int m, x, j, k;\n\n  scanf(\"%d\", &m);\n\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d\", &x);\n\n    k = factor(x, 2);\n\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int y) {\n  int a = sqrt(n);\n  for (int i = y; i <= a; i++) {\n    if (n % i == 0) {\n      sum++;\n      y = i;\n      f(n / i, y);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    sum = 0;\n    f(num, 2);\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "434", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nint dg(int m, int limit);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int m;\n    scanf(\"%d \", &m);\n    num = 0;\n    dg(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\nint dg(int m, int limit) {\n  for (int i = limit; i <= m / 2; i++)\n    if (m % i == 0)\n      dg(m / i, i);\n  if (m >= limit)\n    num++;\n  return 0;\n}\n"}
{"label": "1", "index": "435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, n, k;\n\nint work(int p, int n) {\n  if (n == 1)\n    k++;\n  for (int i = p; i <= n; i++)\n    if (n % i == 0)\n      work(i, n / i);\n}\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  while (m > 0) {\n    cin >> n;\n    k = 0;\n    work(2, n);\n    printf(\"%d\\n\", k);\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "436", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint total = 0;\nint divide(int k, int number) {\n  if (number == 1) {\n    total++;\n    return 0;\n  }\n  int i;\n  for (i = k; i <= number; i++) {\n    if (number % i == 0)\n      divide(i, number / i);\n  }\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  int num[n];\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    total = 0;\n    divide(2, num[i]);\n    printf(\"%d\\n\", total);\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int a, int b) {\n  int c = 1, i;\n  for (i = b; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      c += fenjie(a / i, i);\n  }\n  return c;\n}\nint main() {\n  int n, i, a, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    c = fenjie(a, 2);\n    printf(\"%d \", c);\n  }\n}\n"}
{"label": "1", "index": "438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int n, int m);\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << fun(num, 2) << \"\\n\";\n  }\n  return 0;\n}\nint fun(int n, int m) {\n  int sum = 1;\n  double t = sqrt(n);\n  for (int i = m; i <= t; i++)\n    if (n % i == 0)\n      sum += fun(n / i, i);\n  return sum;\n}\n"}
{"label": "1", "index": "439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int n) \n{\n  if (m < n || m / n == 1) \n    return 0;\n  if ((m % n == 0) && m / n >= n) \n    return f(m / n, n) + f(m, n + 1) + 1;\n  else \n    return f(m, n + 1);\n}\nint main() {\n  int q, i;\n  cin >> q;\n  for (i = 1; i <= q; i++) {\n    int p;\n    cin >> p;\n    cout << f(p, 2) + 1 << endl; \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "440", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint c = 1;\n\nvoid fenjie(int a, int k) {\n  if (a == 1) {\n    c++;\n    return;\n  }\n  for (int i = k; i <= a; i++) {\n    if (a % i == 0) {\n      fenjie(a / i, i);\n    }\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    c = 0;\n    cin >> a;\n    fenjie(a, 2);\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid count(int m, int j) {\n  int i;\n  if (m == 1)\n    num++;\n  for (i = j; i <= m; i++) {\n    if (m % i == 0) {\n      count(m / i, i);\n    } else\n      continue;\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int m;\n    cin >> m;\n    num = 0;\n    count(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a, int min);\n  int n, a[150], i, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = f(a[i], 2);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min) {\n    return 0;\n  }\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[40000] = {0};\nvoid zhishu(int n) {\n  int i, j;\n  for (i = 2; i < sqrt(n); i++) {\n    for (j = 2; j < n / i + 1; j++)\n      b[i * j] = 1;\n  }\n}\nint fenjie(int n, int m) {\n  int s = 0, i;\n  if (n < m)\n    return 0;\n  if (n == m || b[n] == 0)\n    return 1;\n  for (i = m; i < n; i++) {\n    if (n % i == 0) {\n      s = s + fenjie(n / i, i);\n    }\n  }\n  return s + 1;\n}\nint main() {\n  int n, i, max = 0, a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] > max)\n      max = a[i];\n  }\n  zhishu(max);\n  for (i = 0; i < n; i++)\n    cout << fenjie(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "444", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint means(int, int);\nint main() {\n  int n, i = 0;\n  scanf(\"%d \", &n);\n  while (i < n) {\n    int a;\n    cin >> a;\n    cout << means(a, a) << endl;\n    i++;\n  }\n  return 0;\n}\n\nint means(int a, int b) {\n  int i, sum = 0;\n  if (a != 1) {\n    for (i = b; i >= 2; i--) {\n      if (a % i == 0)\n        sum = sum + means(a / i, i);\n    }\n    return sum;\n  } else\n    return 1;\n}\n"}
{"label": "1", "index": "445", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0, p;\nint dfs(int dep, int last, int k) {\n  if (k == 1) {\n    varieties++;\n    return 0;\n  }\n  for (int i = last; i <= k; i++)\n    if (k % i == 0)\n\n      dfs(dep + 1, i, k / i);\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  int m[n];\n  for (i = 0; i < n; i++) {\n    cin >> t;\n    dfs(0, 2, t);\n    m[i] = varieties;\n    varieties = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << m[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s = 0, p;\nint a[100];\nvoid factor(int m, int n, int t) {\n  int i;\n  for (i = 2; i <= (int)sqrt(n); i++)\n    if ((n % i == 0) && (i >= m)) {\n      s++;\n      factor(i, n / i, t + 1);\n    }\n  return;\n}\nint main() {\n  int i, j = 0, k;\n  scanf(\"%d\", &j);\n  for (k = 0; k < j; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < j; k++) {\n    p = a[k];\n    s = 0;\n    for (i = 2; i <= (int)sqrt(p); i++)\n      if (p % i == 0) {\n        s++;\n        factor(i, p / i, 2);\n      }\n    a[k] = s;\n  }\n  for (k = 0; k < j; k++)\n    cout << a[k] + 1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b) {\n  if (a == b)\n    return 1;\n  if (b > a) {\n    return 0;\n  }\n  if (a % b != 0)\n    return f(a, b + 1);\n  if (a % b == 0)\n    return f(a, b + 1) + f(a / b, b);\n}\nint main() {\n  int n = 0, i = 0, x, y;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    y = 2;\n    cout << f(x, y) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "448", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0, t = 2;\nvoid detach(int n) {\n  int i;\n  int q = t;\n  if (n == 1)\n\n    num++;\n  else {\n    for (i = t; i <= n / 2; i++) {\n      if (n % i == 0) {\n        n = n / i;\n        t = i;\n        detach(n);\n        n = n * i;\n        t = q;\n      }\n    }\n    if (i > n / 2 && n >= t) {\n      n = 1;\n      detach(n);\n    }\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    detach(a);\n    cout << num << endl;\n    num = 0;\n    t = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y); \nint main() {\n  int n, i, j, a, sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    cin >> a;\n    sum = 0; \n    for (j = 1; j <= a; j++)\n      sum += f(a, j); \n\n    cout << sum << endl; \n  }\n  return 0;\n}\nint f(int x, int y) \n{\n  int i, num = 0;\n  if (y == 1)\n    return 0;\n  else {\n    if (x % y != 0)\n      return 0;\n    else if (x == y)\n      return 1;\n    else {\n      for (i = y; i >= 1; i--)\n        num += f(x / y, i); \n\n      return num;\n    }\n  }\n}\n\n"}
{"label": "1", "index": "450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint g = 0;\nvoid s(int n, int z) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= z) {\n      g = g + 1;\n      s(n / i, i);\n    }\n  }\n}\nint main() {\n  int a, b;\n  cin >> a;\n  while (scanf(\"%d \", &b)) {\n    for (int j = 2; j <= sqrt(b); j++) {\n      if (b % j == 0) {\n        g = g + 1;\n        s(b / j, j);\n      }\n    }\n    cout << g + 1 << \"\\n\";\n    g = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num;\nint fjys(int n, int m, int i, int d, int ji[20]) {\n  int a;\n  for (a = i; a < m; a++) {\n    if (n % a == 0) {\n      ji[d] = a;\n      int chenji = 1, k;\n      for (k = 0; k <= d; k++) {\n        chenji = chenji * ji[k];\n      }\n      if (chenji == m) {\n        num++;\n        break;\n      } else\n        fjys(n / a, m, a, d + 1, ji);\n    }\n  }\n  return num;\n}\nint main() {\n  int m, n, j, result = 0, ji[20] = {0};\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    num = 0;\n    cin >> n;\n    result = fjys(n, n, 2, 0, ji);\n    cout << result + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "452", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int num = 1, i;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      num += f(a / i, i);\n  }\n  return num;\n}\nint main() {\n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n, num;\n\nvoid dfs(int i, int j) {\n  int x;\n\n  if (i == 1) {\n    num++;\n    return;\n  }\n  for (x = j; x <= i; x++)\n    if (i % x == 0)\n      dfs(i / x, x);\n}\n\nint main() {\n  cin >> m;\n  while (m > 0) {\n    num = 0;\n    cin >> n;\n    dfs(n, 2);\n    printf(\"%d\\n\", num);\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int b) {\n  int i, z = 0, c;\n  for (i = b; i <= x; i++) {\n    if (x == i)\n      z = z + 1;\n    else if (x % i == 0) {\n      c = x / i;\n      z = z + fenjie(c, i);\n    }\n  }\n  return (z);\n}\nint main() {\n  int n, i, num, a;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    num = fenjie(a, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint solutionNumber(int a, int k) {\n  int i;\n  if (a == 1)\n    return 1;\n  if (k > a)\n    return 0;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      return solutionNumber(a, i + 1) + solutionNumber(a / i, i);\n}\nint main() {\n  int n, a[101];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    cout << solutionNumber(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "456", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"%d\\n\", f(a[i], 2));\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  for (m = p; m <= n; m++)\n    if (n % m == 0) {\n      if (m < n)\n        sum = sum + f(n / m, m);\n      if (m == n) {\n        sum = sum + 1;\n      }\n    }\n  return sum;\n}\n"}
{"label": "1", "index": "457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint divide(int n, int a) \n{\n  int s = 0, i;\n  if (n == 1)\n    return 1; \n  for (i = a; i > 1; i--)\n    if (n % i == 0)\n      s += divide(n / i, i); \n  return s;                  \n}\nint main() {\n  int n, k;\n  cin >> k;     \n  while (k > 0) \n  {\n    cin >> n;                     \n    cout << divide(n, n) << endl; \n    k--;                          \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "458", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjieyinshi(int n, int m) {\n  int i = 0;\n  int sum = 1;\n  if (n < m)\n    return 0;\n  else {\n    for (i = m; i < n; i++)\n      if (n % i == 0)\n        sum += fenjieyinshi(n / i, i);\n    return sum;\n  }\n}\nint main() {\n  int n = 0;\n  int i = 0;\n  int a = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    if (a == 1)\n      cout << 1 << endl;\n    else\n      printf(\"%d\\n\", fenjieyinshi(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint get(int n, int m) \n{\n  if (n == 1)\n    return 1;    \n  while (m >= 2) \n  {\n    if (n % m == 0)\n      break;\n    --m;\n  }\n  if (m == 1)\n    return 0; \n  return get(n / m, m) +\n         get(n, m - 1); \n}\nint main() {\n  int t;\n  cin >> t;\n  for (int i = 0; i < t; ++i) {\n    int n;\n    cin >> n;\n    cout << get(n, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "460", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factoring(int a, int b) {\n  int i, kind = 0;\n\n  \n\n  if (a == 1) {\n    kind = 1;\n    \n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n      \n\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n        \n      }\n    }\n  }\n\n  return kind;\n}\n\nint main() {\n  int n, x[40000], i;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    x[i] = factoring(x[i], 2);\n    printf(\"%d\\n\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "461", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 1;\nint sushu(int n) {\n  int i, sum = 0;\n  for (i = 1; i <= sqrt(n * 1.0); i++)\n    if (n % i == 0)\n      sum++;\n  if (sum == 1)\n    return 1;\n  else\n    return 0;\n}\nvoid fenjie(int i, int k) {\n  int mid, j;\n  mid = sqrt(k * 1.0);\n  for (j = i; j <= mid; j++) {\n    if (sushu(k))\n      break;\n    else {\n      if (k % j == 0) {\n        num++;\n        fenjie(j, k / j);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  int a[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    fenjie(2, a[i]);\n    cout << num << endl;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int c, int t);\nint main() {\n  int n, c;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &c);\n    if (c == 1 || c == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(c, 2));\n  }\n}\nint f(int c, int t) {\n  int count = 1, i;\n  for (i = t; i < c; i++) {\n    if (c % i == 0)\n      count += f(c / i, i);\n  }\n  if (i == c)\n    return count;\n  else\n    return 0;\n}\n"}
{"label": "1", "index": "463", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint i;\nint fenjie(int x, int t) {\n  int j;\n  if (x == 1 || x == 2)\n    return 1;\n  int s = 1;\n  for (j = t; j <= sqrt(x); j++) {\n    if (x % j == 0)\n      s += fenjie((x / j), j);\n  }\n  return s;\n}\n\nint main() {\n  int n, a[100], x, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = fenjie(x, 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid check(int m, int n) {\n  for (; m <= n; m++) {\n    if (n % m == 0) {\n      if (n / m == 1) {\n        num++;\n        return;\n      } else\n        check(m, n / m);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (; n; n--) {\n    cin >> m;\n    check(2, m);\n    cout << num << \"\\n\";\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint x[1000] = {0};\nvoid f(int m, int n, int l) {\n  int i;\n  for (i = m; i <= n; i++) {\n    if (n % i != 0)\n      continue;\n    else {\n      if (n / i == 1) {\n        x[l]++;\n        return;\n      } else\n        f(i, n / i, l);\n    }\n  }\n}\n\nint main() {\n  int a[1000], s, j, sum;\n  scanf(\"%d \", &sum);\n  for (j = 1; j <= sum; j++) {\n    scanf(\"%d \", &a[j]);\n    s = 2;\n    f(s, a[j], j);\n  }\n  for (j = 1; j <= sum; j++) {\n    printf(\"%d\\n\", x[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[100], i;\nvoid sb(int, int);\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    sb(a[i], 2);\n    cout << m[i] + 1 << \"\\n\";\n  }\n  return 0;\n}\nvoid sb(int c, int d) {\n  int v;\n  for (v = d; v <= sqrt(c); v++) {\n    if (c % v == 0) {\n      m[i]++;\n      sb(c / v, v);\n    }\n  }\n}\n"}
{"label": "1", "index": "467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 2;\nint manners(int a) {\n  int count = 1, t = 0;\n  t = sqrt((double)a);\n  for (int i = m; i <= t; i++) {\n    if (a % i == 0) {\n      m = i;\n      count = count + manners(a / i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n, b;\n  int i = 1;\n  cin >> n;\n  while (i <= n) {\n    cin >> b;\n    printf(\"%d\\n\", manners(b));\n    m = 2;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fenjie(int num, int min);\nint k = 2;\nint main() {\n  int n, i, jieguo, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    jieguo = fenjie(num, 2);\n    cout << jieguo << \"\\n\";\n  }\n  return 0;\n}\n\nint fenjie(int num, int min) {\n  int j, jieguo = 1;\n\n  if (num < min)\n    return 0;\n\n  for (j = min; j < num; j++) {\n\n    if (num % j == 0) {\n\n      jieguo += fenjie(num / j, j);\n    }\n  }\n  return jieguo;\n}\n"}
{"label": "1", "index": "469", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calculate(int a, int num) {\n  int sum = 0;\n  if (num == 1)\n    return 1;\n  for (int i = num; i >= 2; i--) {\n    if (num % i == 0 && i <= a) {\n      sum += calculate(i, num / i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int num = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << calculate(num, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint f(int a, int b) {\n  for (int i = a; i > 1; i--) {\n    if (a % i != 0) {\n      continue;\n    } else {\n      if (i > b) {\n        continue;\n      } else {\n        int q;\n        q = a / i;\n        if (q == 1) {\n          sum++;\n        } else {\n          f(q, i);\n        }\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    int c;\n    c = f(num, num);\n    cout << c << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "471", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint fengjie(int a, int b) {\n  if (a == 2 || a == 3)\n    return 1;\n  int sum = 1;\n  int c = sqrt(a);\n  for (int i = b; i <= c; i++) {\n    if (a % i == 0) {\n      sum = sum + fengjie(a / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << fengjie(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 2;\nint result = 0;\nvoid function_1(int, int);\nint main() {\n  int n = 0;\n  int data = 0;\n  int i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> data;\n    function_1(data, a);\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\nvoid function_1(int x, int y) {\n  int j = 0;\n  if (x == 1)\n    result = result + 1;\n\n  for (j = y; j <= x; j++) {\n    if (x % j == 0) {\n      function_1(x / j, j);\n    }\n  }\n}\n"}
{"label": "1", "index": "473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint su[40000], b[10000], ans;\n\nvoid zhaosushu() {\n  int i, j, p;\n  for (i = 2; i < 32768; i++) {\n    p = 1;\n    for (j = 2; j <= sqrt(i); j++)\n      if (i % j == 0) {\n        p = 0;\n        break;\n      }\n    if (p == 0)\n      continue;\n    su[p] = 1;\n  }\n}\n\nvoid resolve(int a, int x) {\n  int i;\n  if (a == 1 || (su[a] == 1 && a >= b[x - 1])) {\n    ans++;\n    return;\n  }\n  for (i = 2; i <= a; i++)\n    if (a % i == 0 && i >= b[x - 1]) {\n      b[x] = i;\n      resolve(a / i, x + 1);\n      b[x] = 0;\n    }\n}\n\nint main() {\n  int n, i, a;\n  memset(su, 0, sizeof(su));\n  zhaosushu();\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    ans = 0;\n    memset(b, 0, sizeof(b));\n    resolve(a, 1);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d(int, int);\nint main() {\n  int i, n, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", d(x, 2));\n  }\n  return 0;\n}\nint d(int x, int y) {\n  int j, num = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2) {\n    return 1;\n  }\n  for (j = y; j <= (int)sqrt((double)x); j++)\n    if (x % j == 0)\n      num += d(x / j, j);\n  return num;\n}\n"}
{"label": "1", "index": "475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint coun;\nvoid depart(int n, int i) {\n  int j;\n  if (n == 1)\n    coun++;\n  else\n    for (j = i; j <= n; j++)\n      if (n % j == 0) {\n        depart(n / j, j);\n      }\n}\n\nint main() {\n  int n, j;\n  scanf(\"%d \", &n);\n  int b[n];\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n  for (j = 0; j < n; j++) {\n    coun = 0;\n    depart(b[j], 2);\n    cout << coun << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "476", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s = 0;\nvoid devide(int, int);\nint main() {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    cin >> m;\n    s = 0;\n    devide(2, m);\n    printf(\"%d\\n\", s + 1);\n  }\n  return 0;\n}\n\nvoid devide(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if (b % i == 0) {\n      s++;\n      devide(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint varieties = 0;\n\nvoid divide(int forward, int number) {\n  int i;\n  if (number == 1) {\n    varieties++;\n  }\n  for (i = forward; i <= number; i++) {\n    if (number % i == 0) {\n      divide(i, number / i);\n    }\n  }\n}\n\nint main() {\n  int n = 0, num = 0;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    divide(2, num);\n    cout << varieties << \"\\n\";\n    varieties = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid FenJie(int);\nint counter = 0;\nint Befor = 0;\nint main() {\n  int n, x, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    counter = 0;\n    Befor = x;\n    FenJie(x);\n    printf(\"%d\\n\", counter);\n  }\n  return 0;\n}\nvoid FenJie(int x) {\n  int i, temp = Befor;\n  if (x == 1) {\n    counter++;\n    return;\n  }\n  for (i = Befor; i > 1; i--) {\n    if (x % i == 0) {\n      Befor = i;\n      FenJie(x / i);\n    }\n    Befor = temp;\n  }\n  return;\n}\n"}
{"label": "1", "index": "479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid fun(int m, int n) {\n  if (m <= sqrt(n)) {\n    for (int a = m; a <= sqrt(n); a++) {\n      if (n % a == 0) {\n        count_1++;\n        fun(a, n / a);\n      } else\n        count_1 = count_1;\n    }\n  } else\n    count_1 = count_1;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    count_1 = 0;\n    int num;\n    scanf(\"%d\", &num);\n    for (int j = 2; j <= sqrt(num); j++) {\n      if (num % j == 0) {\n        count_1++;\n        fun(j, num / j);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n  }\n}\n"}
{"label": "1", "index": "480", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, k = 2;\nint fenjie(int n, int k) {\n  int x, i, sum = 0, p = 0;\n  x = (int)pow(n, 0.5);\n  for (i = k; i <= x; i++) {\n    if (n % i == 0) {\n      k = i;\n      sum = sum + fenjie(n / i, k);\n      p = 1;\n    }\n  }\n  if (p == 0)\n    return 1;\n  if (p == 1)\n    return sum + 1;\n}\nint main() {\n  int m, n, i;\n  cin >> m;\n  for (i = 0; i <= m - 1; i++) {\n    cin >> n;\n    printf(\"%d\\n\", fenjie(n, 2));\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  else {\n    for (; i <= x; i++)\n      if (x % i == 0)\n        f(x / i, i);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n > 0) {\n\n    int x = 0, i, ans = 1;\n    scanf(\"%d \", &x);\n    for (i = 2; i * i < x; i++) {\n      if (x % i == 0) {\n        sum = 0;\n        f(x / i, i);\n        ans += sum;\n      }\n    }\n    cout << ans << endl;\n    n--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int n, int min) {\n  int x = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n  }\n  return x;\n}\nint main() {\n  int shu;\n  int number, count = 1;\n  scanf(\"%d\", &number);\n  while (count < number) {\n    scanf(\"%d\", &shu);\n    printf(\"%d \", fenjie(shu, 2));\n    count++;\n  }\n  scanf(\"%d\", &shu);\n  printf(\"%d\", fenjie(shu, 2));\n  return 0;\n}\n"}
{"label": "1", "index": "483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a;\nint fj(int x, int y);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << fj(a, 2) << endl;\n  }\n  return 0;\n}\nint fj(int x, int y) {\n  int xnumber = 1;\n  int i;\n  int b = sqrt(x);\n  if (x == 1)\n    return 0;\n  else {\n    for (i = y; i <= b; i++) {\n      if (x % i == 0)\n        xnumber = xnumber + fj(x / i, i);\n    }\n  }\n  return xnumber;\n}\n"}
{"label": "1", "index": "484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, g, f;\nint divide(int chushu, int a) {\n  int i;\n  for (i = chushu; i <= a; i++) {\n    if (a % i == 0) {\n      f = a / i;\n      if (f > 1) {\n        g = i;\n        divide(g, f);\n      } else\n        sum++;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int p = 0;\n  for (p = 0; p < n; p++) {\n    int b = 0, c = 2;\n    cin >> b;\n    sum = 0;\n    printf(\"%d\\n\", divide(c, b));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu[10000];\n\nint temp = 0;\nint main() {\n  void fenjie(int j, int sum);\n  int t, n[10000], i;\n  cin >> t;\n  for (i = 0; i < 10000; i++) {\n    yinshu[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    cin >> n[i];\n  }\n  for (i = 0; i < t; i++) {\n    fenjie(1, n[i]);\n    cout << temp << endl;\n    temp = 0;\n  }\n  return 0;\n}\nvoid fenjie(int j, int sum) {\n  for (int i = 2; i <= sum; i++) {\n    if (sum % i == 0 && yinshu[j - 1] <= i) {\n      yinshu[j] = i;\n      if (sum == i) {\n        temp++;\n      } else {\n        fenjie(j + 1, sum / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int s) {\n  if (a <= s)\n    return 1;\n  int b = sqrt((float)a), flag = 0, sum = 1;\n  for (int i = s; i <= b; i++) {\n    if (a % i == 0) {\n      flag++;\n\n      sum = sum + f(a / i, i);\n    }\n  }\n  if (flag == 0)\n    return 1;\n  else\n    return sum;\n}\n\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint p = 0, q = 2;\nint jizu(int x) {\n\n  for (int i = q; i <= x - 1; i++) {\n    if ((x % i == 0) && (x / i > i)) {\n      p++;\n      q = i;\n      jizu(x / i);\n\n    } else {\n      if ((x % i == 0) && (x / i == i)) {\n        p++;\n      }\n    }\n  }\n  return p;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    printf(\"%d\\n\", jizu(a[i]) + 1);\n    p = 0, q = 2;\n  }\n  int y;\n  scanf(\"%d\", &y);\n}\n"}
{"label": "1", "index": "488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ways(int, int);\nint main() {\n  int ways(int a, int min);\n  int n, b;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", ways(b, 2));\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 0, i;\n  for (i = min; i <= sqrt(a * 1.0); i++) {\n    if (a % i == 0)\n      sum = sum + ways(a / i, i);\n  }\n  return sum + 1;\n}\n"}
{"label": "1", "index": "489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ge, s, w;\nvoid fen(int h, int a);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> s;\n    ge = 0;\n    fen(s, 2);\n    cout << ge << \"\\n\";\n  }\n  return 0;\n}\nvoid fen(int h, int a) {\n  for (int i = 2; i <= h; i++) {\n    if ((h % i == 0) && (i >= a)) {\n      if (h / i != 1) {\n        fen(h / i, i);\n      } else {\n        ge++;\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint devide(int n, int k) {\n  int s, i;\n  s = 1;\n  for (i = k; i <= sqrt(n * 1.0); i++) {\n    if (n % i == 0) {\n      s = s + devide(n / i, i);\n    }\n  }\n  return s;\n}\nint main() {\n  int n, a[200], i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      printf(\"%d\", devide(a[i], 2));\n    else\n      printf(\"\\n%d\", devide(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "491", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x, int k);\nint main() {\n  int i = 1, n, m;\n  int result;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nint f(int x, int k) {\n  int a = 0;\n  int i;\n  if (x == 1)\n    return 1;\n  for (i = k; i <= x; i++) {\n    if (x % i == 0)\n      a = a + f(x / i, i);\n  }\n  return a;\n}\n"}
{"label": "1", "index": "492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = q; i <= sqrt(x); i++)\n        if (x % i == 0)\n          sum = sum + f(i, x / i);\n\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int s) {\n  if (a <= s)\n    return 1;\n  int b = sqrt((float)a), flag = 0, sum = 1;\n  for (int i = s; i <= b; i++) {\n    if (a % i == 0) {\n      flag++;\n\n      sum = sum + f(a / i, i);\n    }\n  }\n  if (flag == 0)\n    return 1;\n  else\n    return sum;\n}\n\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    printf(\"%d\\n\", f(a, 2));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int begin, int m) {\n  int i;\n  for (i = begin; i <= m; i++) {\n    if (m % i == 0 && m / i >= i) {\n      sum++;\n      f(i, m / i);\n    }\n    if (i > m / i)\n      break;\n  }\n}\nint main() {\n  int n, j, m;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> m;\n    f(2, m);\n    printf(\"%d\\n\", sum);\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, ans, a[20];\n\nvoid calc(int dep, int x) {\n  if (x == 1) {\n    ans++;\n    return;\n  }\n  for (int i = a[dep - 1]; i <= x; i++)\n    if (!(x % i)) {\n      a[dep] = i;\n      calc(dep + 1, x / i);\n    }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (a[0] = 2; n; n--) {\n    cin >> m;\n    ans = 0;\n    calc(1, m);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fj(int a, int zs) {\n  int k, n, z;\n  n = 0;\n  z = 0;\n  for (k = zs; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      n = n + fj(a / k, k);\n      z = 1;\n    }\n  }\n  if (z == 0) {\n    return 1;\n  } else {\n    return n + 1;\n  }\n}\nint main() {\n  int m, i, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d\\n\", fj(t, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint disintegerate(int a, int b) {\n  if (a == b || b == 1)\n    return 1;\n  if (a > b)\n    return 0;\n  int ans = 0;\n  for (int i = a; i <= b; i++) {\n    if (b % i == 0)\n      ans = ans + disintegerate(i, b / i);\n  }\n  return ans;\n}\n\nint main() {\n  int Time;\n  cin >> Time;\n  while (Time > 0) {\n    int n;\n    cin >> n;\n    printf(\"%d\\n\", disintegerate(2, n));\n    Time--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fact(int n, int m);\nint main() {\n  int n, a[35000], i, b[35000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = fact(a[i], 2);\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\nint fact(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    return 0;\n  else if (n == 2)\n    return 1;\n  else {\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        sum = sum + fact(n / i, i);\n    }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint s = 0;\n\nvoid find(int min, int dev) {\n  int i;\n  for (i = min; i <= sqrt((float)dev); i++)\n    if (dev % i == 0) {\n      s++;\n      find(i, dev / i);\n    }\n}\n\nint main() {\n  int n, i, m, j;\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    for (i = 2; i <= sqrt((float)n); i++)\n      if (n % i == 0) {\n        s++;\n        find(i, n / i);\n      }\n    printf(\"%d\\n\", s + 1);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "500", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint cal(int y, int x) {\n  int i, sum;\n  if (x == 1)\n    return 1;\n  else {\n    sum = 0;\n    for (i = y; i <= x; i++) {\n      if ((x % i == 0) && ((x / i == 1) || (x / i > y)))\n        sum += cal(i, x / i);\n    }\n    return sum;\n  }\n}\nint main() {\n  int n, i, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> l;\n    printf(\"%d\", cal(2, l));\n    if (i != n)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint F(int n, int a) {\n  if (n == 1)\n    return 1;\n  if (a == 1)\n    return 0;\n  if (n % a == 0)\n    return F(n / a, a) + F(n, a - 1);\n  return F(n, a - 1);\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d \", F(a, a));\n  }\n}\n"}
{"label": "1", "index": "502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fj(int n, int m) {\n  int i, j, k = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      k += fj(n / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &i);\n    printf(\"%d\", fj(i, 2));\n    if (n - 1)\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "1", "index": "503", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int b, int a) {\n  for (int i = b; i <= a; i++) {\n    if ((a % i == 0) && (i <= a / i)) {\n      sum = sum + 1;\n      f(i, a / i);\n    }\n    if (i > a / i)\n      break;\n  }\n}\nint main() {\n  int a, n;\n  cin >> n;\n  while (n > 0) {\n    cin >> a;\n    sum = 1;\n    f(2, a);\n    printf(\"%d\\n\", sum);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int func(int a, int b);\n  int n;\n  cin >> n;\n  while (n--) {\n    int number;\n    cin >> number;\n    cout << func(number, number) << endl;\n  }\n  return 0;\n}\n\nint func(int a, int b) {\n  if (a == 1)\n    return 1;\n\n  if (b == 1)\n    return 0;\n\n  if (a % b == 0) {\n    return func(a / b, b) + func(a, b - 1);\n  }\n  return func(a, b - 1);\n}\n"}
{"label": "1", "index": "505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int n, a[100], b[100], i;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    b[i] = f(a[i], 2);\n\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"%d\\n\", f(a[i], 2));\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  if (n < p)\n    return 0;\n  else {\n    for (m = p; m <= n; m++)\n      if (n % m == 0) {\n        if (m < n)\n          sum = sum + f(n / m, m);\n        if (m == n)\n          sum = sum + 1;\n      }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nvoid divide(int n, int from) {\n\n  int i;\n  for (i = from; i < n; i++) {\n    if (n % i == 0) {\n      if (n / i < i) {\n        return;\n      }\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int numberToDivide;\n  for (i = 0; i < n; i++) {\n    cin >> numberToDivide;\n    num = 0;\n    divide(numberToDivide, 2);\n    printf(\"%d\\n\", num + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "508", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint solution(int a, int b) {\n  for (int i = b; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1)\n        num++;\n      else {\n        num = solution(a, i);\n      }\n      a = a * i;\n    }\n  }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num = 0;\n    cout << solution(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divmet(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n; j++) {\n      sum = sum + divmet(n, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint divmet(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divmet(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint func(int m, int q) {\n  int b[100];\n\n  int i, j, k = 0, p = 0, sum = 1;\n  for (j = q; j <= m; j++) {\n    if (j * j > m) {\n      p = k;\n      break;\n    }\n    if (m % j == 0) {\n      b[k] = j;\n      k++;\n    }\n  }\n  if (k > 2 || p != 0 && m != 2) {\n    for (i = 0; i < p; i++) {\n      sum += func(m / b[i], b[i]);\n    }\n    return (sum);\n  } else {\n    return (1);\n  }\n}\nint main() {\n  int i, j, k = 0, n, m, b[100] = {0}, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    b[i] = func(m, 2);\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d \", b[j]);\n  }\n}\n"}
{"label": "1", "index": "511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint DFS(int, int);\nint main() {\n  int q;\n  cin >> q;\n  for (int i = 0; i < q; i++) {\n    int n;\n    int h = 0;\n    cin >> n;\n    cout << DFS(n, n) << endl;\n  }\n\n  return 0;\n}\nint DFS(int n, int p) {\n  int ans = 0;\n  if (n == 1)\n    return 1;\n  for (int i = 2; i <= p; i++) {\n    if (n % i == 0) {\n      ans = ans + DFS(n / i, i);\n    }\n  }\n  return ans;\n}\n"}
{"label": "1", "index": "512", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if ((int)pow(x, 0.5) < y)\n    return 1;\n  int d = 1;\n  for (int i = y; i <= (int)pow(x, 0.5); i++)\n    if ((x % i) == 0)\n      d += f(x / i, i);\n  return d;\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    cin >> m;\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int);\nint g_count, g_j;\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    g_count = 0;\n    g_j = 2;\n    cin >> a;\n    printf(\"%d\\n\", sum(a) + 1);\n  }\n  return 0;\n}\nint sum(int a) {\n  int i, b;\n  b = (int)sqrt((double)a);\n  for (i = g_j; i <= b; i++) {\n    if (a % i == 0) {\n      g_j = i;\n      g_count++;\n      sum(a / i);\n    }\n  }\n  return g_count;\n}\n"}
{"label": "1", "index": "514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[40000] = {0};\nvoid zhishu(int n) {\n  int i, j;\n  for (i = 2; i < sqrt(n); i++) {\n    for (j = 2; j < n / i + 1; j++)\n      b[i * j] = 1;\n  }\n}\nint fenjie(int n, int m) {\n  int s = 0, i;\n  if (n < m)\n    return 0;\n  if (n == m || b[n] == 0) {\n    return 1;\n  }\n  for (i = m; i < n; i++) {\n    if (n % i == 0)\n      s = s + fenjie(n / i, i);\n  }\n  return s + 1;\n}\nint main() {\n  int n, i, max = 0, a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] > max)\n      max = a[i];\n  }\n  zhishu(max);\n  for (i = 0; i < n; i++)\n    cout << fenjie(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "515", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x, int k);\nint main() {\n  int i = 1, n, m;\n  int result;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nint f(int x, int k) {\n  int a = 0;\n  int i;\n  if (x == 1)\n    return 1;\n  for (i = k; i <= x; i++) {\n    if (x % i == 0) {\n      a = a + f(x / i, i);\n    }\n  }\n  return a;\n}\n"}
{"label": "1", "index": "516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0, z = 2;\nvoid number(int x, int y) {\n  int i;\n  if (x == 1) {\n    s = s + 1;\n  }\n  for (i = y; i <= x; i++) {\n    if (x % i == 0)\n      number(x / i, i);\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    number(a, z);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "517", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\nint main() {\n  int i, n, t, r, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    r = fenjie(num, 2);\n    printf(\"%d\\n\", r);\n  }\n  return 0;\n}\nint fenjie(int num, int min) {\n  int i, j, k, r = 0;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) {\n      r = r + fenjie(num / i, i);\n    }\n    if (i == num)\n      r++;\n  }\n  return r;\n}\n"}
{"label": "1", "index": "518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a = 0, s = 0;\nvoid find(int n, int prim) {\n  if (n == a)\n    s++;\n  else {\n    for (int i = prim; i <= a / n; i++)\n      if ((a % (n * i) == 0)) {\n        find(n * i, i);\n      }\n  }\n}\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    s = 0;\n    for (int i = 2; i <= a; i++) {\n      if (a % i == 0) {\n        find(i, i);\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  int fun(int n, int begin);\n  scanf(\"%d\", &i);\n  while (i-- > 0) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", fun(n, 2));\n  }\n  return 0;\n}\nint fun(int n, int begin) {\n  int i, result = 1;\n  for (i = begin; i <= sqrt(n); i++)\n    if (n % i == 0)\n      result += fun(n / i, i);\n  return result;\n}\n"}
{"label": "1", "index": "520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid factor(int a, int k);\nint sum = 0;\nint main() {\n  int n, a, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    factor(a, 2);\n    printf(\"%d\\n\", sum + 1);\n    sum = 0;\n  }\n  return 0;\n}\n\nvoid factor(int a, int k) {\n  int b, j;\n  b = (int)sqrt((double)a);\n  for (j = k; j <= b; j++) {\n    if (a % j == 0) {\n      sum++;\n      factor(a / j, j);\n    }\n  }\n  j = k;\n}\n"}
{"label": "1", "index": "521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[40000] = {0};\nvoid zhishu(int n) {\n  int i, j;\n  for (i = 2; i < sqrt(n); i++) {\n    for (j = 2; j < n / i + 1; j++) {\n      b[i * j] = 1;\n    }\n  }\n}\nint fenjie(int n, int m) {\n  int s = 0, i;\n  if (n < m)\n    return 0;\n  if (n == m || b[n] == 0)\n    return 1;\n  for (i = m; i < n; i++) {\n    if (n % i == 0) {\n      s = s + fenjie(n / i, i);\n    }\n  }\n  return s + 1;\n}\nint main() {\n  int n, i, max = 0, a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] > max)\n      max = a[i];\n  }\n  zhishu(max);\n  for (i = 0; i < n; i++)\n    cout << fenjie(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid account(int, int);\nint p;\nint main() {\n  int m;\n  int n;\n  cin >> n;\n  while (n > 0) {\n    p = 0;\n    cin >> m;\n    account(m, 1);\n    cout << p << endl;\n    n--;\n  }\n  return 0;\n}\nvoid account(int m, int i) {\n  if (m == 1)\n    p++;\n  else\n    for (int j = 2; j <= m; j++) {\n      if ((m % j == 0) && (j >= i))\n        account(m / j, j);\n    }\n}\n"}
{"label": "1", "index": "523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fj(int a, int b);\n\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << fj(a, 2) << endl;\n  }\n\n  return 0;\n}\nint fj(int a, int b) {\n  int j, x, sum = 1, f = 0;\n  x = sqrt((double)a);\n  if ((a == 1) || (a == 2) || (a == 3))\n    return 1;\n  else {\n    for (j = b; j <= x; j++) {\n      if (a % j == 0) {\n        sum += fj(a / j, j);\n        f = 1;\n      }\n    }\n    if (f == 0)\n      return 1;\n    else\n      return sum;\n  }\n}\n"}
{"label": "1", "index": "524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid yinshu(int x, int y) {\n  if (x == y)\n    num++;\n  else if ((x % y == 0) && (x > y)) {\n    yinshu(x / y, y);\n    yinshu(x, y + 1);\n  } else if (x > y)\n    yinshu(x, y + 1);\n}\nint main() {\n  int n, x;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> x;\n    yinshu(x, 2);\n    cout << num << endl;\n    num = 0;\n  }\n}\n"}
{"label": "1", "index": "525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid count(int, int);\nint k;\n\nint main() {\n  int n, i, j, m;\n  int num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    scanf(\"%d \", &num);\n    m = sqrt(num) + 1;\n    for (j = 2; j < m; j++)\n      if (num % j == 0) {\n        k++;\n        count(num / j, j);\n      }\n    cout << k + 1 << endl;\n  }\n  return 0;\n}\nvoid count(int num, int i) {\n  int j;\n  int n = sqrt(num);\n  for (j = i; j <= n; j++) {\n    if (num % j == 0) {\n      k++;\n      count((num / j), j);\n    }\n  }\n}\n"}
{"label": "1", "index": "526", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\n\nint main() {\n  int times, k, num;\n  scanf(\"%d \", &times);\n  for (k = 1; k <= times; k++) {\n    scanf(\"%d \", &num);\n    printf(\"%d\\n\", fenjie(num, 1));\n  }\n\n  return 0;\n}\n\nint fenjie(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n"}
{"label": "1", "index": "527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dp[40000][200] = {0};\nint main() {\n  int n, i, N;\n  int mm(int, int);\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> N;\n    cout << mm(N, 2) << endl;\n  }\n\n  return 0;\n}\n\nint mm(int n, int i) {\n  int sum = 1;\n\n  if (dp[n][i] > 0)\n    return dp[n][i];\n\n  for (int j = i; j <= sqrt(n); j++) {\n    if (n % j == 0)\n      sum += mm(n / j, j);\n  }\n  dp[n][i] = sum;\n  return sum;\n}\n"}
{"label": "1", "index": "528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sort(int, int, int);\n\nint main() {\n  int t = 0;\n  cin >> t;\n  int k = 1;\n  for (k = 1; k <= t; k++) {\n    int vacancy = 0;\n    int num = 1;\n    cin >> num;\n    int i = 1;\n    int temp = num;\n    for (i = 2; i <= temp; i++) {\n      while (temp % i == 0) {\n        vacancy = vacancy + 1;\n        temp = temp / i;\n      }\n    }\n    printf(\"%d\\n\", sort(1, vacancy, num));\n  }\n  return 0;\n}\n\nint sort(int start, int vacancy, int num) {\n  if (num < start)\n    return 0;\n\n  if (vacancy == 1)\n    return 1;\n\n  int sum = 0;\n  int i = 1;\n  for (i = start; i <= num; i++) {\n    if (num % i == 0) {\n      sum = sum + sort(i, vacancy - 1, num / i);\n    }\n  }\n\n  return sum;\n}\n"}
{"label": "1", "index": "529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, k = 2;\nint fenjie(int n, int k) {\n  int x, i, sum = 0, p = 0;\n  x = (int)pow(n, 0.5);\n  for (i = k; i <= x; i++) {\n    if (n % i == 0) {\n      k = i;\n      sum = sum + fenjie(n / i, k);\n      p = 1;\n    }\n  }\n  if (p == 0)\n    return 1;\n  if (p == 1)\n    return sum + 1;\n}\nint main() {\n  int m, n, i;\n  cin >> m;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d \", &n);\n    printf(\"%d\\n\", fenjie(n, 2));\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "530", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int count = 0;\n  for (int i = min; i <= a; i++) {\n    if (i == a) {\n      count += 1;\n    }\n    if (a % i == 0) {\n      count += factor(a / i, i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int a;\n    cin >> a;\n    int result = factor(a, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint turn(int a, int b) {\n  int i, k;\n  if (a == 1)\n    k = 1;\n  else if (a < b)\n    k = 0;\n  else {\n    k = 0;\n    for (i = b; i <= a; i++)\n      if (a % i == 0)\n        k = k + turn(a / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i, a[1000], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    t = turn(a[i], 2);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint T, n;\n\nint calc(int n, int min) {\n  if (n == 1)\n    return 1;\n  if (n <= min)\n    return 0;\n  int re = 0;\n  for (int i = min + 1; i <= n; i++)\n    if (n % i == 0) {\n      \n      re += calc(n / i, i - 1);\n    }\n  if (!re)\n    re = 1;\n  \n  return re;\n}\n\nint main() {\n\n  scanf(\"%d\", &T);\n  while (T--) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", calc(n, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int a, int b) {\n  int i, r;\n  r = 1;\n  for (i = b; i < a; i++) {\n    if (((a / i) * i) == a && (a / i) >= i)\n      r = r + divide(a / i, i);\n  }\n  return r;\n}\nint main() {\n  int s, p, n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &p);\n    s = divide(p, 2);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "534", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint yin(int c, int g) {\n  int j, f, e;\n  for (j = g; j <= c; j++) {\n    if (c % j == 0) {\n      e = c / j;\n      if (e > 1) {\n        f = j;\n        yin(e, f);\n      } else\n        sum++;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, a[1000], b[1000], i, d;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    d = 2;\n    sum = 0;\n    b[i] = yin(a[i], d);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint total = 0;\nint divide(int k, int number) {\n  if (number == 1) {\n    total++;\n    return 0;\n  }\n  int i;\n  for (i = k; i <= number; i++) {\n    if (number % i == 0)\n      divide(i, number / i);\n  }\n  return 0;\n}\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  int num[n];\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    total = 0;\n    divide(2, num[i]);\n    cout << total << endl;\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int j);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int m, int j) {\n  int num = 1;\n  for (int i = j; i <= sqrt(m); i++) {\n    if (m % i == 0) {\n      num += f(m / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "537", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint kind(int num, int min); \nint main()                  \n{\n  int n;\n  int i;\n  int num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num; \n    cout << kind(num, 2) << endl;\n  }\n  return 0;\n} \nint kind(int num, int min) \n{\n  if (num < min) \n  {\n    return 0;\n  }\n\n  int k = 1; \n  int i;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) \n    {\n      k = k +\n          kind(num / i, i); \n    }\n  }\n\n  return k; \n}\n"}
{"label": "1", "index": "538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid fenjie(int n, int x) {\n  extern int num;\n  if (n == 1)\n    num++;\n  else\n\n    for (int i = x; i <= n; i++)\n      if (n % i == 0)\n        fenjie(n / i, i);\n}\nint main() {\n  int n, k;\n  cin >> k;\n  for (int j = 0; j != k; j++) {\n    extern int num;\n    num = 0;\n    scanf(\"%d \", &n);\n    fenjie(n, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid yinshu(int x, int y) {\n  if (x == y)\n    num++;\n  else if ((x % y == 0) && (x > y)) {\n    yinshu(x / y, y);\n    yinshu(x, y + 1);\n  } else {\n    if (x > y)\n      yinshu(x, y + 1);\n  }\n}\nint main() {\n  int n, x;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> x;\n    yinshu(x, 2);\n    cout << num << endl;\n    num = 0;\n  }\n}\n"}
{"label": "1", "index": "540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  int fun(int n, int begin);\n  scanf(\"%d\", &i);\n  while (i-- > 0) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", fun(n, 2));\n  }\n  return 0;\n}\nint fun(int n, int begin) {\n  int i, result = 1;\n  for (i = begin; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      result += fun(n / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n\nint main() {\n  int n, j, b = 0, p, k;\n  scanf(\"%d\", &p);\n  for (k = 1; k <= p; ++k) {\n    scanf(\"%d\", &n);\n    b = f(n, 1);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "542", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sum = 0;\nint geshu(int a, int x) {\n  int y, z;\n  z = a;\n  y = (int)sqrt(a);\n  while (x <= y) {\n    if (a % x == 0) {\n      a = a / x;\n      geshu(a, x);\n    }\n    if (a == z / x)\n      a = z;\n    x++;\n  }\n  sum++;\n  return sum;\n}\nint main() {\n  int n, i, a[100], b[100], x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 2 || a[i] == 3)\n      b[i] = 1;\n    else {\n      sum = 0;\n      x = 2;\n      b[i] = geshu(a[i], x);\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "543", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int, int);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << factor(a, 2) << endl;\n  }\n  return 0;\n}\n\nint factor(int a, int b) {\n  int c, i;\n  int num = 1;\n  if (a == 1)\n    return 0;\n  c = sqrt(a);\n  for (i = b; i <= c; i++)\n    if (a % i == 0)\n      num += factor(a / i, i);\n  return num;\n}\n"}
{"label": "1", "index": "544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yz[100], all = 0;\nint yinzi(int num, int amax) {\n  int i, j = 0, geshu = 0, key = num;\n  if (num == 1)\n    return 1;\n  else {\n    for (i = amax; i < all; i++) {\n      if (num % yz[i] == 0) {\n        num = num / yz[i];\n        geshu = geshu + yinzi(num, i);\n        num = key;\n      }\n    }\n    return geshu;\n  }\n  return 0;\n}\nint main() {\n  int num, n, i, c, j = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &num);\n    if (num == 1)\n      printf(\"%d\\n\", 1);\n    else {\n      j = 0;\n      for (i = 2; i <= num; i++) {\n        if (num % i == 0) {\n          yz[j] = i;\n          j++;\n        }\n      }\n      all = j;\n      cout << yinzi(num, 0) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int func(int a, int b);\n  int n;\n  cin >> n;\n  while (n--) {\n    int number;\n    cin >> number;\n    cout << func(number, number) << endl;\n  }\n  return 0;\n}\n\nint func(int a, int b) {\n  if (a == 1) {\n    return 1;\n  }\n  if (b == 1) {\n    return 0;\n  }\n  if (a % b == 0) {\n    return func(a / b, b) + func(a, b - 1);\n  }\n  return func(a, b - 1);\n}\n"}
{"label": "1", "index": "546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int x, int y) {\n  num++;\n  for (int j = y; j * j <= x; j++) {\n    if (x % j == 0)\n      f(x / j, j);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[1100];\n  for (int i = 1; i <= n; i++) {\n    num = 0;\n    scanf(\"%d \", &a[i]);\n    f(a[i], 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num, t, yin[50];\nvoid dd(int n, int a, int d, int m) {\n  int i;\n  if (d == m) {\n    t++;\n    return;\n  }\n  for (i = a; i < num; i++) {\n    if (n / yin[i] >= yin[i] && n % yin[i] == 0)\n      dd(n / yin[i], i, d + 1, m);\n  }\n}\nvoid q_ys(int n) {\n  int i;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0) {\n      num++;\n      yin[num] = i;\n    }\n  return;\n}\nint m_ys(int n) {\n  int i;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      return i;\n    }\n  }\n  return 1;\n}\nvoid output(int y) {\n  int k = 1, i, x;\n  x = y;\n  t = 1, num = 0, memset(yin, 0, sizeof(yin));\n  q_ys(x);\n  while (m_ys(x) != 1) {\n    k++;\n    x = x / m_ys(x);\n  }\n  for (i = 2; i <= k; i++)\n    dd(y, 1, 1, i);\n  printf(\"%d\\n\", t);\n}\nint main() {\n  int n, i, a[1000];\n  t = 0, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    output(a[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "548", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint countt;\nvoid f(int p, int q) {\n  for (int m = p; m <= sqrt(q); m++) {\n    if (q % m == 0) {\n      countt++;\n      f(m, q / m);\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    countt = 0;\n    for (int k = 2; k <= sqrt(num); k++) {\n      if (num % k == 0) {\n        countt++;\n        f(k, num / k);\n      }\n    }\n    cout << countt + 1 << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "549", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int a, int b) {\n  int i, sign = 0, k = 0;\n  if (a < b)\n    return 0;\n  else {\n    if (a == b)\n      return 1;\n    else {\n      for (i = 2; i <= a - 1; i++) {\n        if (a % i == 0)\n          sign = 1;\n      }\n      if (sign != 1)\n        return 1;\n      else {\n        for (i = b; i <= a; i++) {\n          if (a % i == 0)\n            k += fenjie(a / i, i);\n        }\n        k += 1;\n        return k;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d\", &k);\n    printf(\"%d\\n\", fenjie(k, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint w = 1;\nint f(int x) {\n  int z = 1, y, v = 0;\n  for (y = w + 1; y <= sqrt(x); y++) {\n    if (x % y == 0) {\n\n      z = z + f(x / y);\n      v++;\n      w = y;\n    }\n  }\n  if (v == 0)\n    z = 1;\n  return z;\n}\nint main() {\n  int n, u = 0, a;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d\", &a);\n    printf(\"%d \", f(a));\n    u++;\n    w = 1;\n  } while (u != n);\n  return 0;\n}\n"}
{"label": "1", "index": "551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint g(int y) {\n  int i;\n  for (i = 0;; i++) {\n    if (i * i > y)\n      break;\n  }\n  return i - 1;\n}\nint f(int x, int b) {\n  int p, a[100], t = 0, k = 0;\n  p = g(x);\n  if (x == 2)\n    return 0;\n  else {\n    for (int i = b; i <= p; i++) {\n      if (x % i == 0) {\n        a[t] = i;\n        t++;\n      }\n    }\n    if (t == 0)\n      return 0;\n    else\n      for (int i = 0; i < t; i++)\n        k = k + f(x / a[i], a[i]) + 1;\n    return k;\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "552", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ys(int af, int bf) {\n  int s;\n  if (af < bf)\n    s = 0;\n  if (af == bf)\n    s = 1;\n  if (af > bf) {\n    s = 1;\n    for (int i = af / 2; i >= bf; i--) {\n      if (af % i == 0)\n        s += ys(af / i, i);\n    }\n  }\n  return s;\n}\nint main() {\n  int n;\n  cin >> n;\n  int p;\n  while (cin >> p) {\n    cout << ys(p, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, i, factor;\n\nvoid f(int factor, int x) {\n  for (; factor * factor <= x; factor++) {\n    if (x % factor == 0) {\n      num++;\n      f(factor, x / factor);\n    }\n  }\n}\n\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    f(2, a);\n    printf(\"%d\\n\", num);\n    num = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "554", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int m, int x, int i) {\n  if (x == 1 && m >= i)\n    return 1;\n  else if (x > 1) {\n    int j = i;\n    int sum = 0;\n    while (j <= m) {\n      if (j != 1 && m % j == 0)\n        sum = sum + devide(m / j, x - 1, j);\n      j++;\n    }\n    return sum;\n  }\n  return 0;\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    cin >> a;\n    for (int X = 1; X <= 16; X++)\n      sum += devide(a, X, 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int x, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", f(x, 2));\n  }\n\n  return 0;\n}\n\nint f(int x, int i) {\n  int ans = 0;\n  if (x == 2)\n    return 1;\n  else {\n    for (; i <= sqrt(x); i++) {\n      if (x % i == 0) {\n        ans = ans + f(x / i, i);\n      }\n    }\n    return ans + 1;\n  }\n}\n"}
{"label": "1", "index": "556", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int N;\n  cin >> N;\n  int i;\n  for (i = 1; i <= N; i++) {\n\n    int a;\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int j;\n  int number = 1;\n  for (j = m; j <= (int)sqrt(n); j++) {\n    if (n % j == 0) {\n      number = number + f(n / j, j);\n    }\n  }\n  return number;\n}\n"}
{"label": "1", "index": "557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num, t, yin[50];\nvoid dd(int n, int a, int d, int m) {\n  int i;\n  if (d == m) {\n    t++;\n    return;\n  }\n  for (i = a; i < num; i++) {\n    if (n / yin[i] >= yin[i] && n % yin[i] == 0)\n      dd(n / yin[i], i, d + 1, m);\n  }\n}\nvoid q_ys(int n) {\n  int i;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0) {\n      num++;\n      yin[num] = i;\n    }\n  return;\n}\nint m_ys(int n) {\n  int i;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      return i;\n    }\n  }\n  return 1;\n}\nvoid output(int y) {\n  int k = 1, i, x;\n  x = y;\n  t = 1, num = 0, memset(yin, 0, sizeof(yin));\n  q_ys(x);\n  while (m_ys(x) != 1) {\n    k++;\n    x = x / m_ys(x);\n  }\n  for (i = 2; i <= k; i++)\n    dd(y, 1, 1, i);\n  cout << t << \"\\n\";\n}\nint main() {\n  int n, i, a[1000];\n  t = 0, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    output(a[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, k, t = 0, m = 0;\n  for (j = 2; j < x; j++)\n    if (x % j == 0) {\n      t++;\n    }\n  if (t == 0)\n    return 1;\n  else {\n    for (k = y; k <= (int)sqrt((double)x); k++)\n      if (x % k == 0)\n        m = m + f(x / k, k);\n    return (m + 1);\n  }\n}\n"}
{"label": "1", "index": "559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int x, int m);\n  int k, i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    for (j = 2; j <= k; j++) {\n      if (k % j == 0) {\n        sum += f(k, j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n\nint f(int x, int m) {\n  int i, sum = 0;\n  if (m == x)\n    sum = 1;\n  else {\n    x = x / m;\n    for (i = m; i <= x; i++) {\n      if (x % i == 0) {\n        sum += f(x, i);\n      }\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "560", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calculate(int a, int num) { \n  int sum = 0;\n  if (num == 1)\n    return 1;\n  for (int i = num; i >= 2; i--) {\n    if (num % i == 0 && i <= a) {\n      sum += calculate(i, num / i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int num = 0;\n  for (int i = 0; i < n; i++) { \n    cin >> num;\n    cout << calculate(num, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "561", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0, k = 2;\nint fenjie(int n, int k) {\n  int x, i, sum = 0, p = 0;\n  x = (int)pow(n, 0.5);\n  for (i = k; i <= x; i++) {\n    if (n % i == 0) {\n      k = i;\n      sum = sum + fenjie(n / i, k);\n      p = 1;\n    }\n  }\n  if (p == 0)\n    return 1;\n  if (p == 1)\n    return sum + 1;\n}\nint main() {\n  int m, n, i;\n  cin >> m;\n  for (i = 0; i <= m - 1; i++) {\n    cin >> n;\n    cout << fenjie(n, 2) << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "562", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cal(int M, int N) {\n  int i;\n  int num = 0;\n  if (M == 1)\n    return 0;\n  if (N >= M) {\n    return (1 + cal(M, M - 1));\n  }\n  for (i = 2; i < M; i++) {\n    if (M % i == 0 && i <= N) {\n      num = num + cal(M / i, i);\n    }\n  }\n  return num;\n}\nint main() {\n  int n, M;\n  cin >> n;\n  while (n--) {\n    cin >> M;\n    cout << cal(M, M) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yz[100], all = 0;\nint yinzi(int num, int amax) {\n  int i, j = 0, geshu = 0, key = num;\n  if (num == 1)\n    return 1;\n  else {\n    for (i = amax; i < all; i++) {\n      if (num % yz[i] == 0) {\n        num = num / yz[i];\n        geshu = geshu + yinzi(num, i);\n        num = key;\n      }\n    }\n    return geshu;\n  }\n  return 0;\n}\nint main() {\n  int num, n, i, c, j = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> num;\n    if (num == 1)\n      cout << 1 << endl;\n    else {\n      j = 0;\n      for (i = 2; i <= num; i++) {\n        if (num % i == 0) {\n          yz[j] = i;\n          j++;\n        }\n      }\n      all = j;\n      cout << yinzi(num, 0) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "564", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min);\nint main() {\n  int n, i, a, A[100];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    A[i] = f(a, 2);\n  };\n\n  for (i = 0; i < n; i++)\n    cout << A[i] << endl;\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1;\n  int i;\n\n  if (a < min) {\n    return 0;\n  }\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0) {\n          a = a + f(x / i, i);\n        }\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n\nint main() {\n  int n, j, b = 0, p, k;\n  scanf(\"%d\", &p);\n  for (k = 1; k <= p; ++k) {\n    scanf(\"%d\", &n);\n    b = f(n, 1);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int max, int min) {\n  int num = 1, i, k;\n  for (i = min; i < max / 2; i++) {\n    k = max % i;\n    if (k == 0) {\n      if (i <= max / i) {\n        num += fenjie(max / i, i);\n      }\n    }\n  }\n  return num;\n}\nint main() {\n  int a[10000], n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &a[j]);\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\\n\", fenjie(a[j], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "567", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint ys(int af, int bf) {\n  int s;\n  if (af < bf)\n    s = 0;\n  if (af == bf)\n    s = 1;\n  if (af > bf) {\n    s = 1;\n    for (int i = af / 2; i >= bf; i--) {\n      if (af % i == 0) {\n        s += ys(af / i, i);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int p;\n  while (cin >> p) {\n    printf(\"%d\\n\", ys(p, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint col(int a, int b);\nint main() {\n  int n, i, m, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    l = col(m, 2) + 1;\n    cout << l << \"\\n\";\n  }\n  return 0;\n}\nint col(int a, int b) {\n  int i, t, tt = 0, sig = 0;\n  for (i = b; (i < a / 2) && ((a / i) >= i); i++) {\n    if (a % i == 0) {\n      t = a / i;\n      tt = tt + 1 + col(t, i);\n      sig = 1;\n    }\n  }\n  if (sig == 0)\n    tt = 0;\n  return (tt);\n}\n"}
{"label": "1", "index": "569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint countt;\nvoid f(int p, int q) {\n  for (int m = p; m <= sqrt(q); m++) {\n    if (q % m == 0) {\n      countt++;\n      f(m, q / m);\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    countt = 0;\n    for (int k = 2; k <= sqrt(num); k++) {\n      if (num % k == 0) {\n        countt++;\n        f(k, num / k);\n      }\n    }\n    cout << countt + 1 << \"\\n\";\n    ;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint function_1(int a, int m) {\n  int sum = 1, i;\n  if (a > m)\n    return 0;\n  else {\n    for (i = a; i < m; i++) {\n      if (m % i == 0)\n        sum = sum + function_1(i, m / i);\n      else\n        continue;\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, i, m[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m[i];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d \", function_1(2, m[i]));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divi(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divi(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++) {\n      sum = sum + divi(n, j);\n    }\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "572", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s(int, int);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << s(a, 2) << endl;\n  }\n  return 0;\n}\nint s(int a, int b) {\n  int i, t = 0;\n  for (i = b; i < a; i++)\n    if (a % i == 0 && a / i >= i) {\n      t = t + s(a / i, i);\n    }\n  return t + 1;\n}\n"}
{"label": "1", "index": "573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid jisuan(int, int);\nint times, sum, i, n;\nint main() {\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    sum = 0;\n    cin >> n;\n    jisuan(n, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid jisuan(int n, int j) {\n  int i;\n  for (i = j; i <= n; i++) {\n    if (n > 1) {\n      if (n % i == 0) {\n        if (n % i != 0 && n > i)\n          sum++;\n        jisuan(n / i, i);\n      }\n    }\n    if (n == i)\n      sum++;\n  }\n}\n"}
{"label": "1", "index": "574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint p = 0;\n\nint factor(int a, int min) {\n  int sum = 0;\n  if (min >= a)\n    return 1;\n  for (int j = min; j <= a / min; j++)\n    if (a % j == 0)\n      sum += factor(a / j, j);\n  return sum;\n}\n\nint main() {\n  int n = 0, a = 0;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cin >> a;\n    if (a <= 2)\n      cout << 1 << endl;\n    else\n      cout << factor(a, 2) + 1 << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum += 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, num, sign;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    for (j = num; j > 1; j--)\n      if (num % j == 0) {\n        sign = j;\n      }\n    cout << yinshu(num, sign) + 1 << endl;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "1", "index": "576", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cal(int, int);\nint main() {\n\n  int n = 0;\n  scanf(\"%d \", &n);\n\n  for (int i = 0; i < n; i++) {\n    int m = 0;\n    cin >> m;\n\n    cout << cal(m, 2) << endl;\n  }\n\n  return 0;\n}\n\nint cal(int m, int i) {\n  int count = 0;\n  if (m == 1)\n    return 1;\n  for (i; i <= m; i++) {\n\n    if (m % i == 0)\n      count += cal(m / i, i);\n  }\n\n  return count;\n}\n"}
{"label": "1", "index": "577", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ans;\n\nvoid dfs(int, int);\n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    ans = 0;\n    dfs(num, 2);\n    cout << ans << endl;\n  }\n  return 0;\n}\n\nvoid dfs(int x, int f) {\n  if (x == 1) {\n    ++ans;\n    return;\n  }\n  for (int i = f; i <= x; ++i)\n    if (x % i == 0)\n      dfs(x / i, i);\n  return;\n}\n"}
{"label": "1", "index": "578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, t, cnt;\nvoid f(int left, int last) {\n  if (left < last) {\n    if (left == 1)\n      cnt++;\n    return;\n  }\n  for (int i = last; i <= left; i++)\n    if (left % i == 0)\n      f(left / i, i);\n}\nint main() {\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d\", &n);\n    cnt = 0;\n    f(n, 2);\n    printf(\"%d\\n\", cnt);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "579", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, integer = 0;\n  int division(int, int);\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> integer;\n    cout << division(integer, integer) << endl;\n  }\n  return 0;\n}\n\nint division(int integer, int limit) {\n  if (limit <= 1)\n    return 0;\n  switch (integer) {\n  case 1:\n    return 1;\n    break;\n  default: {\n    int sum = 0;\n    for (int a = 1; a <= integer; a++) {\n      if (integer % a != 0)\n        continue;\n      else if (integer / a > limit)\n        continue;\n      else {\n        sum += division(a, integer / a);\n      }\n    }\n    return sum;\n  } break;\n  }\n}\n"}
{"label": "1", "index": "580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int x, int y) {\n  num++;\n  for (int j = y; j * j <= x; j++) {\n    if (x % j == 0)\n      f(x / j, j);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[1100];\n  for (int i = 1; i <= n; i++) {\n    num = 0;\n    cin >> a[i];\n    f(a[i], 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "581", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint t;\nint f(int a, int b) {\n  int i;\n  for (i = a; i * i <= b; i++) {\n    if (b % i == 0) {\n      t++;\n      f(i, b / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int n, i, result[1000], a[1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    t = 1;\n    cin >> a[i];\n    result[i] = f(2, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n}\n"}
{"label": "1", "index": "582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int, int);\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int m;\n    sum = 1;\n    cin >> m;\n    calculate(m, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid calculate(int m, int begin) {\n  int i;\n  int n = sqrt((double)m);\n  for (i = begin; i <= n; i++) {\n    if (m % i == 0) {\n      sum++;\n      calculate(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n}\nint fff(int w, int t, int x) {\n  int i;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid tot(int, int);\nint main() {\n\n  int n, a[100], i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    t = 0;\n    tot(a[i], 2);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid tot(int x, int min) {\n  int k;\n  if (x == 1) {\n    ++t;\n    return;\n  }\n  for (k = min; k <= x; k++) {\n    if (x % k == 0) {\n      tot(x / k, k);\n    }\n  }\n}\n"}
{"label": "1", "index": "585", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a;\nint m = 0, s = 1;\nvoid temp(int b, int k, int c) {\n  for (int i = k; i <= b; i++) {\n\n    if (b % i == 0) {\n      b = b / i;\n      s = s * i;\n      k = i;\n      if (s == c) {\n        m++;\n\n      } else\n\n        temp(b, k, c);\n\n      s = s / i;\n      b = b * i;\n    }\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    temp(a, 2, a);\n    printf(\"%d\\n\", m);\n    m = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fj(int m, int min);\n  int t, i, a[100];\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n\n    cin >> a[i];\n    cout << fj(a[i], 2) << endl;\n  }\n\n  return 0;\n}\nint fj(int m, int min) {\n  int counter = 1;\n  int i;\n  if (m < min)\n    return 0;\n  for (i = min; i < m; i++) {\n    if (m % i == 0) {\n      counter = fj(m / i, i) + counter;\n    }\n  }\n  return counter;\n}\n"}
{"label": "1", "index": "587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint breakways(int num, int min);\nint main() {\n  int n;\n  cin >> n;\n  int number;\n  for (int i = 1; i <= n; i++) {\n    cin >> number;\n    cout << breakways(number, 2) << \"\\n\";\n  }\n}\n\nint breakways(int num, int min) {\n  int sum = 0;\n  for (int j = min; j <= num; j++) {\n    if (num % j == 0) {\n      if (num != j)\n        sum += breakways(num / j, j);\n      else\n        sum += 1;\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min); \nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i * i <= a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i); \n    }\n  }\n  return result;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    cout << f(k, 2) << endl; \n    n--;\n  }\n}\n"}
{"label": "1", "index": "589", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint j;\nint discharge(int x, int y) {\n  int a = 1;\n  for (int i = y; i <= (sqrt((double)x)); i++) {\n    if (x % i == 0) {\n      a = a + discharge(x / i, i);\n    }\n  }\n  return a;\n}\nint main() {\n  int n, x, r[100];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d \", &x);\n    r[j] = discharge(x, 2);\n  }\n  for (j = 0; j < n - 1; j++)\n    cout << r[j] << endl;\n\n  cout << r[n - 1];\n  return 0;\n}\n"}
{"label": "1", "index": "590", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint work(int m, int n) {\n  if (m == n)\n    return 1;\n  if (m % n != 0)\n    return 0;\n  int sum = 0;\n  for (int i = n; i <= m / n; i++)\n    sum += work(m / n, i);\n  return sum;\n}\nint main() {\n  int n, m, a;\n  cin >> n;\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    int s = 0;\n    for (j = 2; j <= m; j++)\n      s += work(m, j);\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint qipa(int p, int q) \n{\n  int i, l, s = 0;\n  if (p == 1)\n    return 1;\n  for (i = p; i > 1; i--)\n    if (p % i == 0 && i <= q)\n      s += qipa(p / i, i);\n  return s;\n}\nint main() {\n  int i, j, n, m, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    t = qipa(m, m);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factors(int, int, int);\nint main() {\n  int num, n, i, j, b[10000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    int part = 0;\n    int t = num;\n\n    for (j = 2; j <= num; j++) {\n      while (t % j == 0) {\n        t /= j;\n        part++;\n      }\n    }\n    b[i] = factors(1, part, num);\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n\nint factors(int factor1, int part, int num) {\n  int sum = 0;\n  if (num < factor1)\n    return 0;\n  if (part == 1) {\n    return 1;\n  }\n\n  for (int i = factor1; i <= num; i++)\n    if (num % i == 0)\n      sum = sum + factors(i, part - 1, num / i);\n  return sum;\n}\n"}
{"label": "1", "index": "593", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint cc;\nvoid fen(int x, int h);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cc = 0;\n    int ff;\n    cin >> ff;\n    fen(ff, 2);\n    printf(\"%d\\n\", cc);\n  }\n  return 0;\n}\nvoid fen(int x, int h) {\n  for (int i = 2; i <= x; i++) {\n    if ((x % i == 0) && (i >= h) && (i < x))\n      fen(x / i, i);\n    if ((x % i == 0) && (i >= h) && (i == x))\n      cc++;\n  }\n}\n"}
{"label": "1", "index": "594", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\n\n\nint num;\nvoid divide(int n, int from) {\n\n  int i;\n  for (i = from; i < n; i++) {\n    if (n % i == 0) {\n      if (n / i < i) {\n        return;\n      }\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\n\n\nint main(int argc, const char *argv[]) {\n\n  int n;\n  cin >> n;\n  int i;\n  int numberToDivide;\n  for (i = 0; i < n; i++) {\n    cin >> numberToDivide;\n    num = 0;\n    divide(numberToDivide, 2);\n    cout << num + 1 << endl;\n  }\n\n  \n  \n  \n}\n"}
{"label": "1", "index": "595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint count_1;\n\nvoid fun(int i, int j) {\n  int k;\n  for (k = i; k <= sqrt(j); k++) {\n    if (j % k == 0) {\n      count_1++;\n      fun(k, j / k);\n    }\n  }\n}\nint main() {\n  int turn, c;\n  scanf(\"%d\", &turn);\n  for (c = 1; c <= turn; c++) {\n    int n, i;\n    cin >> n;\n    for (i = 2; i <= sqrt(n); i++) {\n      if (n % i == 0) {\n        count_1++;\n        fun(i, n / i);\n      }\n    }\n    cout << count_1 + 1 << \" \";\n    count_1 = 0;\n  }\n}\n"}
{"label": "1", "index": "596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      result += f(a / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "597", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint w = 1;\nint f(int x) {\n  int z = 1, y, v = 0;\n  for (y = w + 1; y <= sqrt(x); y++) {\n    if (x % y == 0) {\n\n      z = z + f(x / y);\n      v++;\n      w = y;\n    }\n  }\n  if (v == 0)\n    z = 1;\n  return z;\n}\nint main() {\n  int n, u = 0, a;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d\", &a);\n    printf(\"%d \", f(a));\n    u++;\n    w = 1;\n  } while (u != n);\n}\n"}
{"label": "1", "index": "598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fj(int n, int m) {\n  int i, j, k = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      k += fj(n / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &i);\n    printf(\"%d\", fj(i, 2));\n    if (n - 1) {\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint de(int s, int a) {\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  else if (s > a)\n    return 0;\n  for (int i = s; i <= a; i++)\n    if (a % i == 0)\n      sum = sum + de(i, a / i);\n  return sum;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    int a;\n    scanf(\"%d \", &a);\n    printf(\"%d\\n\", de(2, a));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0)\n      s += divide(n / i, i);\n  return s;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    scanf(\"%d \", &n);\n    printf(\"%d\\n\", divide(n, n));\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sdw(int a, int b) {\n  int i;\n  int m = 1;\n  for (i = a; i < b / 2; i++) {\n    if (b % i == 0) {\n      if (i <= b / i)\n        m = sdw(i, b / i) + m;\n    }\n  }\n  return m;\n}\nint main() {\n  int n, i, p, b;\n  int a[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = a[i];\n    p = sdw(2, b);\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint way(int x, int m) {\n  int sum = 0, p = 0, i;\n  for (i = m; i < x; i++)\n    if (x % i == 0) {\n      p++;\n      sum = sum + way(x / i, i);\n    }\n  sum = sum + 1;\n  if (p == 0)\n    sum = 1;\n  if (m > x)\n    sum = 0;\n  return (sum);\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    cout << way(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint wtf(int p, int a);\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", wtf(2, a));\n  }\n  return 0;\n}\n\nint wtf(int p, int a) {\n  int i, ways = 0, j = 0;\n  int m = (int)sqrt(a);\n  for (; p <= m; p++) {\n    if (a % p == 0 && a >= p * p) {\n      ways = ways + wtf(p, a / p);\n      j++;\n    }\n  }\n  if (j == 0)\n    return 1;\n  else\n    return ways + 1;\n}\n"}
{"label": "1", "index": "604", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a, cnt = 0, num;\nint decompose(int x, int y) {\n  int i, xnum = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (i = y; i <= (int)sqrt(x); i++)\n    if (x % i == 0)\n      xnum += decompose(x / i, i);\n  return xnum;\n}\nint main() {\n  scanf(\"%d \", &n);\n  while (cnt < n) {\n    cin >> a;\n    num = decompose(a, 2);\n    printf(\"%d\\n\", num);\n    cnt++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int digui(int p, int q);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a, sum = 1;\n    scanf(\"%d\", &a);\n    for (j = 2; j < a; j++) {\n      if (j * j > a)\n        break;\n      else if (a % j == 0)\n        sum = sum + digui(j, a / j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint digui(int p, int q) {\n  int z = 1, d;\n  if (p == q)\n    z = 1;\n  else if (p > q)\n    z = 0;\n  else\n    for (d = p; d < q; d++) {\n      if (d * d > q)\n        break;\n      else if (q % d == 0)\n        z = z + digui(d, q / d);\n    }\n  return (z);\n}\n"}
{"label": "1", "index": "606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid factor(int x, int limit);\nint result;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int input;\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &input);\n    result = 1;\n    factor(input, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nvoid factor(int x, int limit) {\n  int remainder;\n  if (x < limit) {\n    return;\n  }\n  for (int i = limit; i <= x; i++) {\n    remainder = x % i;\n    if (remainder == 0) {\n      if (x / i >= i) {\n        result++;\n        factor(x / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "607", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint su[40000], b[10000], ans;\n\nvoid zhaosushu() {\n  int i, j, p;\n  for (i = 2; i < 32768; i++) {\n    p = 1;\n    for (j = 2; j <= sqrt(i); j++)\n      if (i % j == 0) {\n        p = 0;\n        break;\n      }\n    if (p == 0)\n      continue;\n    su[p] = 1;\n  }\n}\n\nvoid resolve(int a, int x) {\n  int i;\n  if (a == 1 || (su[a] == 1 && a >= b[x - 1])) {\n    ans++;\n    return;\n  }\n  for (i = 2; i <= a; i++)\n    if (a % i == 0 && i >= b[x - 1]) {\n      b[x] = i;\n      resolve(a / i, x + 1);\n      b[x] = 0;\n    }\n}\n\nint main() {\n  int n, i, a;\n  memset(su, 0, sizeof(su));\n  zhaosushu();\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    ans = 0;\n    memset(b, 0, sizeof(b));\n    resolve(a, 1);\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid qut(int a, int b);\nint num = 0;\nint main() {\n  int i, n, g[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> g[i];\n  for (i = 0; i < n; i++) {\n    qut(g[i], 1);\n    cout << num << \"\\n\";\n    num = 0;\n  }\n  return 0;\n}\n\nvoid qut(int a, int b) {\n  int i;\n  if (a >= b) {\n    num++;\n    if (b == 1)\n      b++;\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        qut(a / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k = 0;\nint y;\nint a(int x, int i);\nvoid b(int x, int i);\nint main() {\n  int n, i, x, z;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    y = x;\n    printf(\"%d\\n\", a(x, 2));\n  }\n  return 0;\n}\nint a(int x, int i) {\n  k = 0;\n  b(x, i);\n  return k;\n}\nvoid b(int x, int i) {\n  for (i = i; i <= x; i++) {\n    if (x % i == 0)\n      b(x / i, i);\n  }\n  if (x == 1)\n    k = k + 1;\n}\n"}
{"label": "1", "index": "610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint elm[100] = {0};\nint counts = 0, num = 0;\nvoid Try(int b, int s) {\n  int j;\n  for (j = 2; j <= num; j++) {\n    if (j >= elm[s - 1]) {\n      if (b % j == 0) {\n        elm[s] = j;\n        if (b / j == 1)\n          counts++;\n        else if (b / j < j)\n          continue;\n        else\n          Try(b / j, s + 1);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    counts = 0;\n    cin >> num;\n    Try(num, 1);\n    printf(\"%d\\n\", counts);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu[10000];\n\nint temp = 0;\nint main() {\n  void fenjie(int j, int sum);\n  int t, n[10000], i;\n  cin >> t;\n  for (i = 0; i < 10000; i++) {\n    yinshu[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    cin >> n[i];\n  }\n  for (i = 0; i < t; i++) {\n    fenjie(1, n[i]);\n    cout << temp << endl;\n    temp = 0;\n  }\n  return 0;\n}\nvoid fenjie(int j, int sum) {\n  for (int i = 2; i <= sum; i++) {\n    if (sum % i == 0 && yinshu[j - 1] <= i) {\n      yinshu[j] = i;\n      if (sum == i) {\n        temp++;\n      } else\n        fenjie(j + 1, sum / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "612", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[200][200] = {0};\n  int div[40000] = {0};\n  int divth[200] = {0};\n  int kase = 0;\n  cin >> kase;\n  for (; kase > 0; kase--) {\n    int n = 0;\n    cin >> n;\n    memset(f, 0, sizeof(f));\n    memset(div, 0, sizeof(div));\n    memset(divth, 0, sizeof(divth));\n    int m = 0;\n    for (int i = 1; i <= n; i++)\n      if (n % i == 0) {\n        div[i] = ++m;\n        divth[m] = i;\n      }\n    f[1][1] = 1;\n    for (int i = 2; i <= m; i++)\n      for (int j = 2; j <= i; j++)\n        for (int k = j; k > 1; k--)\n          if (divth[i] % divth[k] == 0) {\n            int ii = divth[i] / divth[k];\n            int jj = k;\n            if (div[ii] < jj)\n              jj = div[ii];\n            f[i][j] += f[div[ii]][jj];\n          }\n    printf(\"%d\\n\", f[m][m]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "613", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint chu(int i, int n);\nint main() {\n  int n, m, i, j;\n  int sum[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &m);\n    sum[i] = 0;\n    for (j = 2; j <= sqrt(m); j++) {\n      if (m % j == 0) {\n        sum[i] += chu(j, m / j);\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    printf(\"%d\\n\", sum[i] + 1);\n  }\n}\nint chu(int i, int n) {\n  int j, m, t;\n  t = 1;\n  m = n;\n  for (j = i; j <= sqrt(m); j++) {\n    if (m % j == 0) {\n\n      t += chu(j, (m / j));\n    }\n  }\n  return t;\n}\n"}
{"label": "1", "index": "614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum += fun(m / i, i);\n    }\n  } else\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0) {\n        sum += fun(m / i, i);\n      }\n    }\n  return sum;\n}\nint main() {\n  int n, i, b;\n  int a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> b;\n    a[i] = fun(b, 1);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << endl;\n}\n"}
{"label": "1", "index": "615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, ans, a[20];\n\nvoid calc(int dep, int x) {\n  if (x == 1) {\n    ans++;\n    return;\n  }\n  for (int i = a[dep - 1]; i <= x; i++)\n    if (!(x % i)) {\n      a[dep] = i;\n      calc(dep + 1, x / i);\n    }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (a[0] = 2; n; n--) {\n    scanf(\"%d\", &m);\n    ans = 0;\n    calc(1, m);\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0, p;\nint a[100];\nvoid factor(int m, int n, int t) {\n  int i;\n  for (i = 2; i <= (int)sqrt(n); i++)\n    if ((n % i == 0) && (i >= m)) {\n      s++;\n      factor(i, n / i, t + 1);\n    }\n  return;\n}\nint main() {\n  int i, j = 0, k;\n  scanf(\"%d\", &j);\n  for (k = 0; k < j; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < j; k++) {\n    p = a[k];\n    s = 0;\n    for (i = 2; i <= (int)sqrt(p); i++)\n      if (p % i == 0) {\n        s++;\n        factor(i, p / i, 2);\n      }\n    a[k] = s;\n  }\n  for (k = 0; k < j; k++)\n    printf(\"%d\\n\", a[k] + 1);\n  return 0;\n}\n"}
{"label": "1", "index": "617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint kind(int k, int a) {\n  int i, j, temp = 0;\n  int x;\n  for (i = a; i < k; i++) {\n    if (i <= k / i && k % i == 0) {\n\n      x = k / i;\n      \n      temp++;\n      for (j = i; j < x; j++) {\n        if (j <= x / j && x % j == 0) {\n          temp = temp + kind(x, j);\n          break;\n        }\n      }\n    }\n  }\n\n  return (temp);\n}\nint main() {\n  int n, i, s, a[32768][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i][0]);\n    a[i][1] = kind(a[i][0], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i][1] + 1); \n  }\n  \n  return 0;\n}\n"}
{"label": "1", "index": "618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    cin >> x;\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1);\n    printf(\"%d\\n\", l);\n  }\n}\nint fff(int w, int t) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(w, i);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num;\nvoid divide(int n, int n2) {\n  int i, m1;\n  m1 = (int)sqrt((double)n);\n  for (i = n2; i <= m1; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, i);\n    } \n  }\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 1;\n    cin >> m;\n\n    divide(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "620", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint yinshu(int n, int m) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      sum += yinshu(n / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << yinshu(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint F(int n, int a) {\n  if (n == 1)\n    return 1;\n  if (a == 1) {\n    return 0;\n  }\n  if (n % a == 0)\n    return F(n / a, a) + F(n, a - 1);\n  return F(n, a - 1);\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d \", F(a, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint resolution_into_factors(int j, int i) {\n  int m, sum = 0, k = 0;\n  for (m = j; m <= sqrt(i); m++) {\n    if (i % m == 0) {\n      sum = resolution_into_factors(m, i / m) + sum + 1;\n      k++;\n    }\n  }\n  if (k == 0)\n    return 0;\n  return sum;\n}\nint main() {\n  int n, k, i;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> i;\n    printf(\"%d\\n\", resolution_into_factors(2, i) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid next(int c[], int x) {\n  int i, j;\n  c[0]++;\n  for (i = 1; c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] *\n                  c[9] * c[10] * c[11] * c[12] * c[13] * c[14] >\n              x;\n       i++) {\n    c[i]++;\n    for (j = 0; j < i; c[j++] = c[i])\n      ;\n    if (c[14] == 2)\n      break;\n  }\n}\n\nint reslove(int x) {\n  int c[15] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  int p = 0;\n  while (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n             c[10] * c[11] * c[12] * c[13] * c[14] <=\n         x) {\n    if (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n            c[10] * c[11] * c[12] * c[13] * c[14] ==\n        x)\n      p++;\n    next(c, x);\n  }\n  return p;\n}\n\nint main() {\n  int i = 0, n, a;\n  scanf(\"%d\", &n);\n  while (i++ < n) {\n    cin >> a;\n    printf(\"%d\\n\", reslove(a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint f(int a, int b) {\n  for (int i = a; i > 1; i--) {\n    if (a % i != 0)\n      continue;\n    else {\n      if (i > b) {\n        continue;\n      } else {\n        int q;\n        q = a / i;\n        if (q == 1)\n          sum++;\n        else {\n          f(q, i);\n        }\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    int c;\n    c = f(num, num);\n    cout << c << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t(int, int);\nint s, j, k1;\n\nint main() {\n  int a, n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    s = 1;\n    k1 = 0;\n    for (j = 2; j <= sqrt((double)a); j++) {\n      if (a % j == 0)\n        t(a / j, j);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n\nint t(int a, int b) {\n  int k;\n  for (k = b; k <= a; k++) {\n    if (a % k == 0) {\n      if (a / k == 1) {\n        s = s + 1;\n        break;\n      }\n      t(a / k, k);\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "626", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count(int x, int y) {\n  if (x < y)\n    return 0;\n  if (x >= y) {\n    int sum = 0;\n    for (int j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + count(x / j, j);\n    }\n    return sum + 1;\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    cout << count(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "627", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i;\nint fenjie(int x, int t) {\n  int j;\n  if (x == 1 || x == 2)\n    return 1;\n  int s = 1;\n  for (j = t; j <= sqrt(x); j++) {\n    if (x % j == 0)\n      s += fenjie((x / j), j);\n  }\n  return s;\n}\n\nint main() {\n  int n, a[100], x, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = fenjie(x, 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "628", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid f(int x, int y) {\n  int i = 0;\n  if (x >= y)\n    for (i = y; i <= x; i++) {\n      if (i == x)\n        count_1++;\n      if (x % i == 0)\n        f(x / i, i);\n    }\n}\nint main() {\n  int t;\n  int n, i, x, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d\", &x);\n    f(x, 2);\n    printf(\"%d \", count_1);\n  }\n}\n"}
{"label": "1", "index": "629", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s(int, int);\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << s(a, 2) << endl;\n  }\n  return 0;\n}\nint s(int a, int b) {\n  int i, t = 0;\n  for (i = b; i < a; i++)\n    if (a % i == 0 && a / i >= i)\n      t = t + s(a / i, i);\n  return t + 1;\n}\n"}
{"label": "1", "index": "630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n, x, i, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    cout << Factorization(x, 2) + 1 << endl;\n  }\n  return 0;\n}\nint Factorization(int x, int y) {\n  int i;\n  int sum = 0;\n  if (x < 4)\n    return 0;\n  else {\n    for (i = y; i <= sqrt((double)x); i++)\n      if (x % i == 0)\n        sum += 1 + Factorization(x / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      f(n / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n\n  int t = 0;\n  cin >> t;\n  while (t--) {\n    int n = 0;\n    cin >> n;\n    int i = 2, result = 1;\n\n    for (i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        f(n / i, i);\n        result = result + sum;\n      }\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint breakways(int num, int min);\nint main() {\n  int n;\n  cin >> n;\n  int number;\n  for (int i = 1; i <= n; i++) {\n    cin >> number;\n    cout << breakways(number, 2) << \"\\n\";\n  }\n  return 0;\n}\n\nint breakways(int num, int min) {\n  int sum = 0;\n  for (int j = min; j <= num; j++) {\n    if (num % j == 0) {\n      if (num != j)\n        sum += breakways(num / j, j);\n      else\n        sum += 1;\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid next(int c[], int x) {\n  int i, j;\n  c[0]++;\n  for (i = 1; c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] *\n                  c[9] * c[10] * c[11] * c[12] * c[13] * c[14] >\n              x;\n       i++) {\n    c[i]++;\n    for (j = 0; j < i; c[j++] = c[i])\n      ;\n    if (c[14] == 2)\n      break;\n  }\n}\n\nint reslove(int x) {\n  int c[15] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  int p = 0;\n  while (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n             c[10] * c[11] * c[12] * c[13] * c[14] <=\n         x) {\n    if (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n            c[10] * c[11] * c[12] * c[13] * c[14] ==\n        x)\n      p++;\n    next(c, x);\n  }\n  return p;\n}\n\nint main() {\n  int i = 0, n, a;\n  scanf(\"%d\", &n);\n  while (i++ < n) {\n    scanf(\"%d\", &a);\n    cout << reslove(a) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "634", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\nint main() {\n  int i, n, t, r, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    r = fenjie(num, 2);\n    cout << r << endl;\n  }\n  return 0;\n}\nint fenjie(int num, int min) {\n  int i, j, k, r = 0;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0)\n      r = r + fenjie(num / i, i);\n\n    if (i == num)\n      r++;\n  }\n  return r;\n}\n"}
{"label": "1", "index": "635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint qq(int m) {\n  int i, j;\n  j = 0;\n  for (i = 2; i * i <= j; i++) {\n    if (m % i == 0) {\n      j = 1;\n      break;\n    }\n  }\n  return j;\n}\n\nint pp(int m, int j) {\n  int i, k = 0;\n  if (m == 1)\n    return 1;\n  else {\n    k++;\n    for (i = j; i * i <= m; i++) {\n      if (qq(i) == 0 && m % i == 0)\n        k = k + pp(m / i, i);\n    }\n  }\n  return k;\n}\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  int aa[n + 1];\n  for (i = 1; i <= n; i++) {\n    cin >> p;\n    aa[i] = pp(p, 2);\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", aa[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint j;\nint discharge(int x, int y) {\n  int a = 1;\n  for (int i = y; i <= (sqrt((double)x)); i++) {\n    if (x % i == 0) {\n      a = a + discharge(x / i, i);\n    }\n  }\n  return a;\n}\nint main() {\n  int n, x, r[100];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    cin >> x;\n    r[j] = discharge(x, 2);\n  }\n  for (j = 0; j < n - 1; j++) {\n    cout << r[j] << endl;\n  }\n  cout << r[n - 1];\n  return 0;\n}\n"}
{"label": "1", "index": "637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nvoid devide(int a, int b) {\n  if (a == 1)\n    sum++;\n  else {\n    if (a >= b)\n      devide(a, b + 1);\n    if (a % b == 0)\n      devide(a / b, b);\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    devide(a, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint yinshu(int num, int min);\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a, result;\n    cin >> a;\n    result = yinshu(a, 2) + 1;\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n\nint yinshu(int num, int min) {\n  int r, x = 0;\n  if (num < min) {\n    return 0;\n  } else {\n    for (r = min; r * r <= num; r++) {\n      if (num % r == 0) {\n        x = x + 1 + yinshu(num / r, r);\n      }\n    }\n    return x;\n  }\n}\n"}
{"label": "1", "index": "639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid yinshu(int x, int y) {\n  if (x == y)\n    num++;\n  else if ((x % y == 0) && (x > y)) {\n    yinshu(x / y, y);\n    yinshu(x, y + 1);\n  } else if (x > y)\n    yinshu(x, y + 1);\n}\nint main() {\n  int n, x;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> x;\n    yinshu(x, 2);\n    cout << num << \"\\n\";\n    num = 0;\n  }\n}\n"}
{"label": "1", "index": "640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factors(int n, int min) {\n  int varieties = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0) {\n        varieties += factors(n / i, i);\n      }\n    }\n  }\n  return varieties;\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n], b[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = factors(a[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint number = 0;\nint l;\nvoid sort(int n) {\n  int i;\n  for (i = l; n / i >= i; i++) {\n    if (n % i == 0) {\n      l = i;\n      sort(n / i);\n      if (n / i == 1)\n        number++;\n    }\n  }\n  number++;\n}\nint main() {\n  int n, m, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    l = 2;\n    number = 0;\n    cin >> m;\n    sort(m);\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint ways(int a, int min); \nint main() {\n  int n, a, i, sum = 0, k,\n               min; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    for (k = 2; k <= a; k++) {\n      if (a % k == 0) {\n        min = k;\n        break;\n      }\n    } \n    if (a != min)\n      sum = ways(a, min); \n    else\n      sum = 1; \n    cout << sum << endl;\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  int result = 1, i; \n  if (a < min)\n    return 0; \n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += ways(a / i, i); \n  }\n  return result;\n}\n"}
{"label": "1", "index": "643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    int j = 2, num = 1;\n    while (j <= a / 2) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        num += sum;\n      }\n      j++;\n    }\n    cout << \"\\n\" << num;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "644", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fen(int a, int k) {\n  int s = 0, j, t = 0;\n  if (a == 1 && a >= k) {\n    s = 1;\n  } else if (a == k) {\n    s = 1;\n  } else {\n    for (j = 2; j <= a; j++) {\n      if (a % j == 0 && j >= k)\n        s = s + fen(a / j, j);\n      t = 1;\n    }\n    if (t == 0)\n      s++;\n  }\n  return s;\n}\nint main() {\n  int n, i, q, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << fen(a, 1) << endl;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "1", "index": "645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint panduansushu(int t) {\n  int i;\n  for (i = 2; i < t; i++) {\n    if (t % i == 0)\n      break;\n  }\n  if (i > t / 2)\n    return 1;\n  else\n    return 0;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n}\n\nint main() {\n  int a[100], i, res, j, n;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    if (panduansushu(a[j]) == 1) {\n      printf(\"1\\n\");\n    } else {\n      for (i = 2, res = 1; i < a[j] / 2; i++) {\n        if (a[j] % i == 0) {\n          sum = 0;\n          fun(a[j] / i, i);\n          res += sum;\n        }\n      }\n      printf(\"%d\\n\", res);\n    }\n  }\n}\n"}
{"label": "1", "index": "646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int m, int n) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (sum = 0, i = m; i <= n; i++)\n    if (n % i == 0)\n      sum += f(i, n / i);\n  return sum;\n}\nint main() {\n  int i, n, k;\n  for (i = 0, cin >> n; i < n; i++) {\n    scanf(\"%d \", &k);\n    printf(\"%d\\n\", f(2, k));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fenjie(int t, int n) {\n  int i = 0;\n  if (n == 1)\n    sum++;\n  for (i = t; i <= n; i++) {\n    if (n % i == 0) {\n      fenjie(i, n / i);\n    }\n  }\n}\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    sum = 0;\n    fenjie(2, k);\n    n--;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "648", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int m) {\n  if (a < m)\n    return 0;\n  int kind = 1;\n  for (int i = m; i < a; i++) {\n    if (a % i == 0)\n      kind = kind + f(a / i, i);\n  }\n  return kind;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cout << f(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "649", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sep(int a, int b) {\n  int i;\n  int ans = 0;\n  if (a == 1)\n    ans = 1;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0) {\n      ans += sep(a / i, i);\n    }\n  }\n  return ans;\n}\nint baka(int a) {\n  int cirno;\n  cirno = sep(a, 2);\n  return cirno;\n}\nint main() {\n  int n, pre;\n  int i, j;\n  int ans;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &pre);\n    ans = baka(pre);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zy(int a, int b);\n  int j, n, m, sum;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d\", &m);\n    sum = zy(2, m);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint zy(int a, int b) {\n  int i, c;\n  c = 0;\n  if (a == 0)\n    c = c + 1;\n  else {\n    for (i = a; i * i <= b; i++) {\n      if (b % i == 0) {\n        c = zy(i, (b / i)) + c;\n      }\n    }\n    if (i * i > b)\n      c = c + 1;\n  }\n  return (c);\n}\n"}
{"label": "1", "index": "651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divmet(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    scanf(\"%d \", &n);\n    for (int j = 2; j <= n; j++)\n      sum = sum + divmet(n, j);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\nint divmet(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divmet(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cnt = 0;\n\nvoid slv(int nm, int pr) {\n  int i;\n  if (nm >= pr) {\n    cnt++;\n    if (pr == 1)\n      pr++;\n    for (i = pr; i <= nm; i++) {\n      if (nm % i == 0) {\n        slv(nm / i, i);\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, num;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cnt = 0;\n    cin >> num;\n    slv(num, 1);\n    cout << cnt << endl;\n  }\n}\n"}
{"label": "1", "index": "653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a, int p) {\n  int i, count = 0;\n  for (i = p; i < a; i++) {\n    if (a % i == 0 && a / i >= i) {\n      count++;\n      int k, t;\n      k = (int)sqrt(a / i);\n      for (t = 2; t <= k; t++) {\n        if ((a / i) % t == 0) {\n          count += change(a / i, i);\n          break;\n        }\n      }\n    }\n  }\n  return count;\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int total = 0;\n    cin >> a;\n    total += change(a, 2);\n    cout << total + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nint main() {\n  int n, i, a[100];\n  void fenjie(int x, int y);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    t = 0;\n    fenjie(2, a[i]);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid fenjie(int x, int y) {\n  int j;\n  if (y == 1) {\n    t++;\n    return;\n  }\n  for (j = x; j <= y; j++) {\n    if (y % j == 0)\n      fenjie(j, y / j);\n  }\n}\n"}
{"label": "1", "index": "655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n\n  if (n < min) {\n    return 0;\n  }\n\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result += factor(n / i, i);\n  }\n\n  return result;\n}\nint main() {\n  int m, x, j, k;\n\n  scanf(\"%d\", &m);\n\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d\", &x);\n\n    k = factor(x, 2);\n\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "656", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int i, int t) {\n  if (i < t) {\n    return 0;\n  }\n  int b = 1;\n  int a;\n  for (a = t; a < i; a++) {\n    if (i % a == 0) {\n      b = b + f(i / a, a);\n    }\n  }\n  return b;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 0;\n  int d[100];\n  do {\n    cin >> d[i];\n    i++;\n  } while (i < n);\n  i = 0;\n  do {\n    printf(\"%d\\n\", f(d[i], 2));\n    i++;\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "1", "index": "657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0)\n      sum += f(i, y / i) + 1;\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &x);\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    cout << f(2, b[i]) + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint F(int min, int a) {\n  int i;\n  int sum = 0;\n  if (min == a) \n    return 1;\n  if (a == 1)\n    return 1; \n  for (i = min; i <= a; i++) {\n    if (a % i == 0)\n      sum += F(i, a / i); \n  }\n  return sum; \n}\n\nint main() {\n  int a, n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", F(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "659", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cal(int M, int N) {\n  int i;\n  int num = 0;\n  if (M == 1)\n    return 0;\n  if (N >= M)\n    return (1 + cal(M, M - 1));\n  for (i = 2; i < M; i++) {\n    if (M % i == 0 && i <= N) {\n      num = num + cal(M / i, i);\n    }\n  }\n  return num;\n}\nint main() {\n  int n, M;\n  cin >> n;\n  while (n--) {\n    cin >> M;\n    cout << cal(M, M) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "660", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ana(int n, int p) {\n  int i;\n  int t, s = 1;\n  t = pow(n, 0.5);\n  for (i = p; i <= t; i++)\n    if (n % i == 0)\n      s = s + ana(n / i, i);\n  return s;\n}\n\nint main() {\n  int n;\n  int a[100];\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", ana(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint l = 0, num = 0, o;\nvoid f(int i, int in) {\n  int j;\n  for (j = i; j < (in + 1); j++) {\n    if (j * (in / j) == in) {\n      \n      \n      o = in / j;\n      \n      f(j, in / j);\n      o = o * j;\n    }\n    \n  }\n  if (o == 1) {\n    num = num + 1; \n  }\n}\nint main() {\n  int t;\n  cin >> t;\n  int i;\n  int in;\n  for (i = 0; i < t; i++) {\n    cin >> in;\n    f(2, in);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint yinshu(int n, int m) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      sum += yinshu(n / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    cout << yinshu(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 1;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0)\n      n += f(x / a, a);\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  scanf(\"%d\", &m);\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    cout << n[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint decomposition(int m, int k) {\n  int res = 1;\n  for (int i = k; i * i <= m; i++) {\n    if (m % i == 0 && m / i >= i) {\n\n      res += decomposition(m / i, i);\n    }\n  }\n  return res;\n}\nint main() {\n  int n;\n  while (scanf(\"%d\", &n) == 1) {\n    for (int i = 0; i < n; i++) {\n      int m;\n      scanf(\"%d\", &m);\n      cout << decomposition(m, 2) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "665", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int f(int x, int y);\n  int n, m, i, z;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    z = f(1, m);\n    printf(\"%d\\n\", z);\n  }\n\n  return 0;\n}\n\nint f(int x, int y) {\n  int z, t = 1, l = 0, p;\n  p = (int)pow(y, 0.5);\n  if (x == 1)\n    x = 2;\n  for (z = x; z <= p; z++) {\n    if (y % z == 0 && z != y)\n      t += f(z, y / z);\n  }\n\n  return t;\n}\n"}
{"label": "1", "index": "666", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid count(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      count(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int T = 0;\n  scanf(\"%d \", &T);\n  while (T--) {\n    int N = 0;\n    cin >> N;\n    int i = 2, total = 1;\n    while (i <= N / 2) {\n      if (N % i == 0) {\n        sum = 0;\n        count(N / i, i);\n        total += sum;\n      }\n      i++;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "667", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g = 0;\nvoid s(int n, int z) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= z) {\n      g = g + 1;\n      s(n / i, i);\n    }\n  }\n}\nint main() {\n  int a, b;\n  cin >> a;\n  while (scanf(\"%d \", &b)) {\n    for (int j = 2; j <= sqrt(b); j++) {\n      if (b % j == 0) {\n        g = g + 1;\n        s(b / j, j);\n      }\n    }\n    cout << g + 1 << endl;\n    g = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "668", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, a;\nvoid find(int i, int x) {\n  for (int j = i; j * j <= x && i != 1; j++) {\n    if (x / j * j == x) {\n      find(j, x / j);\n      k++;\n    }\n  }\n}\nint main() {\n  int n;\n  for (cin >> n; n--;) {\n    k = 0;\n    cin >> a;\n    find(2, a);\n    printf(\"%d\\n\", ++k);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "669", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if ((int)pow(x, 0.5) < y)\n    return 1;\n  int d = 1;\n  for (int i = y; i <= (int)pow(x, 0.5); i++)\n    if ((x % i) == 0)\n      d += f(x / i, i);\n  return d;\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "670", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint num = 1, flag = 2; \nvoid way(int);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    way(a);\n    cout << num << endl;\n    num = 1;\n    flag = 2; \n  }\n  return 0;\n}\nvoid way(int a) {\n  int i, max;\n  max = sqrt(a);\n  for (i = flag; i <= max; i++) \n  {\n    if (a % i == 0) \n    {\n      flag = i; \n      num++;\n      way(a / i); \n    }\n  }\n}\n"}
{"label": "1", "index": "671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid fenjie(int i, int a);\n\nint k = 1;\n\nint main() {\n  int n, m, a;\n\n  scanf(\"%d \", &n);\n\n  for (m = 1; m <= n; m++) {\n    scanf(\"%d \", &a);\n\n    fenjie(2, a);\n\n    printf(\"%d\\n\", k);\n\n    k = 1;\n  }\n\n  return 0;\n}\n\nvoid fenjie(int i, int a) {\n  for (; i <= sqrt(a); i++)\n    if (a % i == 0) {\n      k++;\n\n      fenjie(i, a / i);\n    }\n}\n"}
{"label": "1", "index": "672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) { \n  if ((int)pow(x, 0.5) < y)\n    return 1; \n  int d = 1;\n  for (int i = y; i <= (int)pow(x, 0.5); i++) \n    if ((x % i) == 0)\n      d += f(x / i, i); \n  return d;\n}\nint main() {\n  int n, m;\n  cin >> n; \n  for (int k = 1; k <= n; k++) {\n    cin >> m;\n    cout << f(m, 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, num = 0;\n  int a[100];\n  int sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0) {\n      num++;\n      a[num] = 1 + f(i, y / i);\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    sum = sum + a[i];\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", f(2, b[i]) + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint change(int a, int p) {\n  int i, count = 0; \n  for (i = p; i < a; i++) {\n    if (a % i == 0 && a / i >= i) \n    {\n      count++; \n      int k, t;\n      k = (int)sqrt(a / i); \n      for (t = 2; t <= k; t++) {\n        if ((a / i) % t == 0) \n        {\n          count += change(a / i, i); \n          break;\n        }\n      }\n    }\n  }\n  return count; \n}\nint main() {\n  int n, i, a; \n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int total = 0; \n    cin >> a;\n    total += change(a, 2);     \n    cout << total + 1 << endl; \n  }\n  return 0;\n}\n\n"}
{"label": "1", "index": "675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint panduansushu(int t) {\n  int i;\n  for (i = 2; i < t; i++) {\n    if (t % i == 0) {\n      break;\n    }\n  }\n  if (i > t / 2)\n    return 1;\n  else\n    return 0;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n}\n\nint main() {\n  int a[100], i, res, j, n;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    if (panduansushu(a[j]) == 1) {\n      printf(\"1\\n\");\n    } else {\n      for (i = 2, res = 1; i < a[j] / 2; i++) {\n        if (a[j] % i == 0) {\n          sum = 0;\n          fun(a[j] / i, i);\n          res += sum;\n        }\n      }\n      printf(\"%d\\n\", res);\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "676", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a < b)\n    return 0;\n  int i, r = 1;\n  for (i = b; i <= a; i++) {\n    if (!(a % i) && i <= a / i) {\n      r += f(a / i, i);\n    }\n  }\n  return r;\n}\nint main() {\n  int n, m;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &m);\n    int result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n}\n"}
{"label": "1", "index": "677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cal(int y, int x) {\n  int i, sum;\n  if (x == 1)\n    return 1;\n  else {\n    sum = 0;\n    for (i = y; i <= x; i++) {\n      if ((x % i == 0) && ((x / i == 1) || (x / i > y)))\n        sum += cal(i, x / i);\n    }\n    return sum;\n  }\n}\nint main() {\n  int n, i, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &l);\n    printf(\"%d\", cal(2, l));\n    if (i != n)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "678", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min) {\n  int i, result;\n  if (a < min)\n    return 0;\n  result = 1;\n  for (i = min; i < a; i++)\n    if (a % i == 0)\n      result += f(a / i, i);\n  return result;\n}\nint main() {\n  int i, n, num[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cout << f(num[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid solve(int num, int a, int m) {\n  int i;\n  if (num == 1) {\n    count_1++;\n    return;\n  }\n  for (i = 2; i <= num; i++) {\n    if (i >= a && (num % i) == 0)\n      solve(num / i, i, m + 1);\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    int num, a;\n    count_1 = 0;\n    scanf(\"%d\", &num);\n    solve(num, 0, 1);\n    printf(\"%d \", count_1);\n  }\n}\n"}
{"label": "1", "index": "680", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, k;\n\nint work(int p, int n) {\n  if (n == 1)\n    k++;\n  for (int i = p; i <= n; i++)\n    if (n % i == 0)\n      work(i, n / i);\n}\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  while (m > 0) {\n    cin >> n;\n    k = 0;\n    work(2, n);\n    printf(\"%d\\n\", k);\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint count_1;\n\nvoid f(int n, int min) {\n  int i;\n  if (n == min) {\n    count_1++;\n    return;\n  }\n  if (n % min != 0) {\n    return;\n  }\n  for (i = min; i <= n; i++)\n    f(n / min, i);\n}\n\nint main() {\n  int N, i, num, j;\n  scanf(\"%d\", &num);\n  for (j = 1; j <= num; j++) {\n    count_1 = 0;\n    scanf(\"%d\", &N);\n    for (i = 2; i <= N; i++)\n      f(N, i);\n    cout << count_1 << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "682", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int a, int b) {\n  int i, ways;\n  ways = 1;\n  if (a < b)\n    return 0;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      ways += factor(a / i, i);\n  }\n  return ways;\n}\n\nint main() {\n  int n, A[99], K[99], i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    K[i] = factor(A[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", K[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k = 0;\nint y;\nint a(int x, int i);\nvoid b(int x, int i);\nint main() {\n  int n, i, x, z;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    y = x;\n    cout << a(x, 2) << \"\\n\";\n  }\n  return 0;\n}\nint a(int x, int i) {\n  k = 0;\n  b(x, i);\n  return k;\n}\nvoid b(int x, int i) {\n  for (i = i; i <= x; i++) {\n    if (x % i == 0)\n      b(x / i, i);\n  }\n  if (x == 1)\n    k = k + 1;\n}\n"}
{"label": "1", "index": "684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int brea(int a, int min);\n  int i, n, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", brea(a, 2));\n  }\n}\n\nint brea(int a, int min) {\n  int result = 1;\n  int i;\n  if (a < min)\n    return (0);\n  else if (a == min)\n    return (1);\n  else {\n    for (i = min; i < a; i++) {\n      if (a % i == 0)\n        result = result + brea(a / i, i);\n    }\n    return (result);\n  }\n}\n"}
{"label": "1", "index": "685", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint digui(int m, int n, int sum) {\n  int i;\n  sum++;\n  if (sqrt(m) < n)\n    return sum;\n  else {\n    for (i = n; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        sum = digui(m / i, i, sum);\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", digui(a, 2, 0));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "686", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  if (m < n || m / n == 1)\n    return 0;\n  if ((m % n == 0) && m / n >= n)\n    return f(m / n, n) + f(m, n + 1) + 1;\n  else\n    return f(m, n + 1);\n}\nint main() {\n  int q, i;\n  cin >> q;\n  for (i = 1; i <= q; i++) {\n    int p;\n    cin >> p;\n    printf(\"%d\\n\", f(p, 2) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint qq(int m) {\n  int i, j;\n  j = 0;\n  for (i = 2; i * i <= j; i++) {\n    if (m % i == 0) {\n      j = 1;\n      break;\n    }\n  }\n  return j;\n}\n\nint pp(int m, int j) {\n  int i, k = 0;\n  if (m == 1)\n    return 1;\n  else {\n    k++;\n    for (i = j; i * i <= m; i++) {\n      if (qq(i) == 0 && m % i == 0) {\n        k = k + pp(m / i, i);\n      }\n    }\n  }\n  return k;\n}\n\nint main() {\n  int n, i, p;\n  scanf(\"%d \", &n);\n  int aa[n + 1];\n  for (i = 1; i <= n; i++) {\n    cin >> p;\n    aa[i] = pp(p, 2);\n  }\n  for (i = 1; i <= n; i++)\n    cout << aa[i] << endl;\n\n  return 0;\n}\n"}
{"label": "1", "index": "688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int min) {\n  int i, a = 0, x = 0;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0)\n      a = a + 1;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n    return x;\n  }\n}\nint main() {\n  int t, j, num;\n  scanf(\"%d\", &t);\n  for (j = 1; j <= t; j++) {\n    scanf(\"%d\", &num);\n    printf(\"%d \", fenjie(num, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "689", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint im(int n, int max) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = max; i > 1; i--)\n    if (n % i == 0)\n      s += im(n / i, i);\n  return s;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d %d \", &n, &t);\n  printf(\"%d\", im(t, t));\n  for (i = 1; i < n; i++) {\n    cin >> t;\n    printf(\"\\n%d\", im(t, t));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint total, p;\nvoid part(int y) {\n  int i2, up;\n  if (y == 1)\n    return;\n  up = (int)sqrt(y);\n  for (i2 = 2; i2 <= up; i2++) {\n    if (p <= i2) {\n      if (y % i2 == 0) {\n        total++;\n        p = i2;\n        part(y / i2);\n        p = 0;\n      }\n    }\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    total = 0;\n    p = 0;\n    scanf(\"%d\", &a);\n    part(a);\n    printf(\"%d\\n\", total + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint meide(int x, int y) {\n  int sum = 1, count = 0, i;\n  for (i = y; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      sum = sum + meide(x / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, n, m;\n  scanf(\"%d\", &k);\n  for (m = 0; m < k; m++) {\n    scanf(\"%d\", &n);\n    if (n >= 3) {\n      printf(\"%d\\n\", meide(n, 2));\n    } else {\n      printf(\"1\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int n, int i) {\n  for (i = 2; i <= n / 2; i++)\n    if (n % i == 0)\n      break;\n  return (i == n / 2 && n != 4) ? 1 : 0;\n}\nint f(int n, int k) {\n  if (check(n, 2) == 1 || k == n)\n    return 1;\n  else if (n < k)\n    return 0;\n  else {\n    int h = 0, i;\n    for (i = k; i <= sqrt(n); i++)\n      if (n % i == 0)\n        h += f(n / i, i);\n    return h + 1;\n  }\n}\n\nint main() {\n  int n, h, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> h;\n    cout << f(h, 2) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "693", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint deal(int num, int p) {\n  int i, sum = 0;\n  if (num == 1)\n    return 1;\n  for (i = p; i <= num; ++i)\n    if (num % i == 0)\n      sum += deal(num / i, i);\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    cout << deal(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "694", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 0;\nvoid asd(int i, int q) {\n  int j;\n  for (j = q; j > 1; j--) {\n    if (i % j != 0)\n      continue;\n    if (i == j) {\n      num++;\n    } else {\n      q = j;\n      asd(i / j, q);\n    }\n  }\n}\nint main() {\n  int n, o;\n  cin >> n;\n  for (o = 0; o < n; o++) {\n    num = 0;\n    int a;\n    cin >> a;\n    asd(a, a);\n    if (num == 1)\n      cout << 1 << endl;\n    else\n      printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "1", "index": "695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 0;\nvoid fj(int m, int i) {\n  if (m == 1)\n    num++;\n  else {\n    for (int j = i; j <= m; j++) {\n      if (m % j == 0)\n        fj(m / j, j);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int ii = 0; ii < n; ii++) {\n    cin >> m;\n    fj(m, 2);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1);\n    printf(\"%d\\n\", l);\n  }\n}\nint fff(int w, int t) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1)\n        l++;\n\n      if (x > 1)\n        fff(w, i);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 0, i = 0, sum = 1;\nvoid f(int i, int a) {\n  int j;\n  for (j = i; j <= sqrt(a); j++)\n    if (a % j == 0) {\n      sum++;\n      f(j, a / j);\n    }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n) {\n    cin >> a;\n    f(2, a);\n    printf(\"%d\\n\", sum);\n    n--;\n    sum = 1;\n  }\n}\n"}
{"label": "1", "index": "698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int m, int n) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (sum = 0, i = m; i <= n; i++)\n    if (n % i == 0)\n      sum += f(i, n / i);\n  return sum;\n}\nint main() {\n  int i, n, k;\n  for (i = 0, scanf(\"%d \", &n); i < n; i++) {\n    cin >> k;\n    cout << f(2, k) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fib(int a, int e);\nint main() {\n  int n, b, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> b;\n    printf(\"%d\\n\", fib(b, 2));\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\nint fib(int a, int e) {\n  int j, c, d;\n  c = 1;\n  if (a <= e)\n    return 1;\n  for (j = e; j <= sqrt(a); j++) {\n    if (a % j == 0) {\n      d = a / j;\n      c = c + fib(d, j);\n    }\n  }\n  return c;\n}\n"}
{"label": "1", "index": "700", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint s(int a, int b) {\n  int sum = 0, z = 0;\n  if (a != 1 && b <= a) {\n    for (int i = b; i <= a; ++i) {\n      if (a % i == 0) {\n        sum += s(a / i, i);\n        z = 1;\n      }\n    }\n\n  } else if (a == 1)\n    return 1;\n\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; ++i) {\n    cin >> a;\n    cout << s(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b);\n\nint main() {\n  int n, c[100], i, a, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n    a = c[i];\n    sum = f(a, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint f(int a, int b) {\n  int sum = 1;\n  int i;\n  if (a < b)\n    return 0;\n  for (i = b; i < a; i++) {\n    if (a % i != 0)\n      continue;\n    else\n      sum = sum + f(a / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint calc(int p, int t);\n\nint main() {\n  int m, n, ans;\n\n  scanf(\"%d\", &m);\n\n  while (m--) {\n    scanf(\"%d \", &n);\n    ans = calc(2, n);\n    cout << ans << \"\\n\";\n  }\n\n  return 0;\n}\n\nint calc(int p, int t) {\n  int i, a;\n\n  a = 1;\n  for (i = p; i <= sqrt(t); i++)\n    if (t % i == 0)\n      a = a + calc(i, t / i);\n  return a;\n}\n"}
{"label": "1", "index": "703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nint wrh(int n, int r, int b[200], int y, int a) {\n  int i;\n  for (i = y; i <= a / 2; i++) {\n    if (r % i == 0) {\n      b[n] = i;\n      int now = 1, j;\n      for (j = 1; j <= n; j++)\n        now = now * b[j];\n      if (now == a) {\n        num++;\n        break;\n      }\n      if (now > a)\n        break;\n      else {\n        wrh(n + 1, r / i, b, i, a);\n      }\n    }\n  }\n  return 0;\n}\n\nint main() {\n\n  int s, a, b[200];\n  scanf(\"%d \", &s);\n  while (s > 0) {\n    num = 0;\n    cin >> a;\n    wrh(1, a, b, 2, a);\n    printf(\"%d\\n\", num + 1);\n    s--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0;\nvoid factor(int, int);\nint main() {\n  int n = 0, num = 0, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    varieties = 0;\n    cin >> num;\n    factor(2, num);\n    cout << varieties << \"\\n\";\n  }\n  return 0;\n}\nvoid factor(int first, int num) {\n  int i = 0;\n  if (num == 1)\n\n    varieties++;\n  else {\n    for (i = first; i <= num; i++) {\n      if (num % i == 0) {\n        factor(i, num / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "705", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factorize(int a, int b) {\n  int factor, i;\n  if (a == 1)\n    factor = 1;\n  if (a != 1)\n    factor = 0;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      factor = factor + factorize(a / i, i);\n  return factor;\n}\nint main() {\n  int n, a;\n  for (cin >> n; n--; cout << factorize(a, 2) << endl) {\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[100], i;\nvoid sb(int, int);\nint main() {\n  int n, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    sb(a[i], 2);\n    printf(\"%d\\n\", m[i] + 1);\n  }\n  return 0;\n}\nvoid sb(int c, int d) {\n  int v;\n  for (v = d; v <= sqrt(c); v++) {\n    if (c % v == 0) {\n      m[i]++;\n      sb(c / v, v);\n    }\n  }\n}\n"}
{"label": "1", "index": "707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fenjie(int num, int min);\nint k = 2;\nint main() {\n  int n, i, jieguo, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    jieguo = fenjie(num, 2);\n    cout << jieguo << \"\\n\";\n  }\n  return 0;\n}\n\nint fenjie(int num, int min) {\n  int j, jieguo = 1;\n\n  if (num < min)\n    return 0;\n\n  for (j = min; j < num; j++) {\n\n    if (num % j == 0) {\n\n      jieguo += fenjie(num / j, j);\n    }\n  }\n  return jieguo;\n}\n"}
{"label": "1", "index": "708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int, int);\nint sum = 0, res = 1;\nint main() {\n  int n, a, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    res = 1;\n    scanf(\"%d \", &a);\n    for (j = 2; j <= (int)sqrt((float)a); j++) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        res += sum;\n      }\n    }\n    cout << res << endl;\n  }\n  return 0;\n}\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0) {\n      f(x / y, y);\n    }\n    y++;\n  }\n  return;\n}\n"}
{"label": "1", "index": "709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int x) {\n  int i, t = 0;\n  for (i = x; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      t = t + 1 + fenjie(n / i, i);\n  }\n  return t;\n}\nint main() {\n  int i, t, n;\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    cin >> n;\n    cout << fenjie(n, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a;\nint fj(int x, int y);\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << fj(a, 2) << endl;\n  }\n  return 0;\n}\nint fj(int x, int y) {\n  int xnumber = 1;\n  int i;\n  int b = sqrt(x);\n  if (x == 1)\n    return 0;\n  else {\n    for (i = y; i <= b; i++) {\n      if (x % i == 0)\n        xnumber = xnumber + fj(x / i, i);\n    }\n  }\n  return xnumber;\n}\n"}
{"label": "1", "index": "711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint solutionNumber(int a, int k) {\n  int i;\n  if (a == 1)\n    return 1;\n  if (k > a)\n    return 0;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      return solutionNumber(a, i + 1) + solutionNumber(a / i, i);\n}\nint main() {\n  int n, a[101];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    printf(\"%d\\n\", solutionNumber(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "712", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Factorize(int n, int fact);\nint number = 0;\nint main() {\n  int times, num, i;\n  scanf(\"%d \", &times);\n  for (i = 0; i < times; i++) {\n    cin >> num;\n    Factorize(num, 2);\n    cout << number << endl;\n    number = 0;\n  }\n  return 0;\n}\nvoid Factorize(int n, int fact) {\n  int i;\n  for (i = fact; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      Factorize(n / i, i);\n  }\n  number++;\n}\n"}
{"label": "1", "index": "713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int min) {\n  int i, a = 0, x = 0;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0)\n      a = a + 1;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n    return x;\n  }\n}\nint main() {\n  int t, j, num;\n  scanf(\"%d\", &t);\n  for (j = 1; j <= t; j++) {\n    scanf(\"%d\", &num);\n    printf(\"%d \", fenjie(num, 2));\n  }\n}\n"}
{"label": "1", "index": "714", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factorization(int num, int i);\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << factorization(num, 2) << endl;\n  }\n  return 0;\n}\n\nint factorization(int num, int i) {\n  int j, squ, sum = 1;\n  squ = sqrt((double)num);\n  for (j = i; j <= squ; j++) {\n    if (num % j == 0) {\n      sum = sum + factorization(num / j, j);\n    }\n  }\n  return sum;\n};\n"}
{"label": "1", "index": "715", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fact(int a, int i) {\n  if (a == 1)\n    sum++;\n  while (i <= a) {\n    if (a % i == 0)\n      fact(a / i, i);\n    i++;\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int a;\n    cin >> a;\n    int i = 2;\n    int result = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fact(a / i, i);\n        result += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint prime(int min, int num) {\n  int i;\n  for (i = min; i < num; i++) {\n    if (num % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint count(int min, int num) {\n  int i = 0, n = 1;\n  if (prime(min, num))\n    return 1;\n  else\n    for (i = min; i < num; i++) {\n      if (num % i == 0 && i <= num / i)\n        n = n + count(i, num / i);\n    }\n  return n;\n}\nint main() {\n  int num, n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << count(2, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      result += f(a / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "718", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid account(int, int);\nint p;\nint main() {\n  int m;\n  int n;\n  cin >> n;\n  while (n > 0) {\n    p = 0;\n    scanf(\"%d \", &m);\n    account(m, 1);\n    printf(\"%d\\n\", p);\n    n--;\n  }\n  return 0;\n}\nvoid account(int m, int i) {\n  if (m == 1)\n    p++;\n  else\n    for (int j = 2; j <= m; j++) {\n      if ((m % j == 0) && (j >= i))\n        account(m / j, j);\n    }\n}\n"}
{"label": "1", "index": "719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid recur(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      recur(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int t = 0;\n  scanf(\"%d \", &t);\n  for (int k = 0; k < t; k++) {\n    int n = 0;\n    cin >> n;\n    int i = 2, res = 1;\n    for (int i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        recur(n / i, i);\n        res += sum;\n      }\n    }\n    cout << res << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t, a, flag, a1;\n\nvoid find(int m, int min) {\n  int i;\n  \n  for (i = 2; i <= sqrt((double)m); i++) {\n    if (m % i == 0) {\n      if (i >= min)\n      \n      {\n        t++;\n        \n        \n        \n        \n        \n        \n        \n        min = i;\n        \n        find(m / i, min);\n      }\n    }\n  }\n  \n  return;\n}\nint main() {\n  int n, ii;\n  cin >> n;\n  for (ii = 1; ii <= n; ii++) {\n    t = 0;\n    flag = 0;\n    cin >> a;\n    \n    a1 = a;\n    find(a, 2);\n    cout << t + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "721", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  int a;\n  int b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n\n    b = f(a, 2);\n    printf(\"%d\", b);\n    printf(\" \");\n  }\n}\n"}
{"label": "1", "index": "722", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint all = 1;         \nvoid divd(int, int); \n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    divd(2, num); \n    cout << all << endl;\n    all = 1;\n  }\n  return 0;\n}\n\nvoid divd(int fac, int num) {\n  int i;\n  for (i = fac; i * i <= num; i++) \n    if (num % i == 0)              \n    {\n      fac = i;              \n      all++;                \n      divd(fac, num / fac); \n    }\n}\n"}
{"label": "1", "index": "723", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int j);\nint main() {\n  int n, a, s, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    s = f(a, 2) + 1;\n    cout << s << endl;\n  }\n\n  return 0;\n}\nint f(int a, int j) {\n  int i, tem;\n\n  int count = 0;\n  for (i = j; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      j = i;\n\n      if (a / i < j)\n        count += 1;\n      else {\n        count += (f(a / i, j) + 1);\n      }\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "724", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint all = 1;\nvoid divd(int, int);\n\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d \", &num);\n    divd(2, num);\n    printf(\"%d\\n\", all);\n    all = 1;\n  }\n  return 0;\n}\n\nvoid divd(int fac, int num) {\n  int i;\n  for (i = fac; i * i <= num; i++)\n    if (num % i == 0) {\n      fac = i;\n      all++;\n      divd(fac, num / fac);\n    }\n}\n"}
{"label": "1", "index": "725", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint divide(int n, int i); \nint main() {\n  int n = 0; \n  int t = 0; \n  int sum;   \n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n / 2; j++) \n    {\n      sum = sum + divide(n, j);\n    }\n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\nint divide(int n, int i) \n{\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) \n    {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divide(n / i, j); \n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int max, int min) {\n  int num = 1, i, k;\n  for (i = min; i < max / 2; i++) {\n    k = max % i;\n    if (k == 0) {\n      if (i <= max / i)\n        num += fenjie(max / i, i);\n    }\n  }\n  return num;\n}\nint main() {\n  int a[10000], n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &a[j]);\n  }\n  for (j = 0; j < n; j++)\n    printf(\"%d\\n\", fenjie(a[j], 2));\n\n  return 0;\n}\n"}
{"label": "1", "index": "727", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  int a;\n  int b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    int min = 2;\n    b = f(a, 2);\n    printf(\"%d\", b);\n    printf(\" \");\n  }\n}\n"}
{"label": "1", "index": "728", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int N;\n  cin >> N;\n  int i;\n  for (i = 1; i <= N; i++) {\n\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int j;\n  int number = 1;\n  for (j = m; j <= (int)sqrt(n); j++) {\n    if (n % j == 0) {\n      number = number + f(n / j, j);\n    }\n  }\n  return number;\n}\n"}
{"label": "1", "index": "729", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nvoid tot(int, int);\nint main() {\n\n  int n, a[100], i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    t = 0;\n    tot(a[i], 2);\n    cout << t << endl;\n  }\n  return 0;\n}\n\nvoid tot(int x, int min) {\n  int k;\n  if (x == 1) {\n    ++t;\n    return;\n  }\n  for (k = min; k <= x; k++)\n    if (x % k == 0) {\n      tot(x / k, k);\n    }\n}\n"}
{"label": "1", "index": "730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a, factor(int N, int min);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", factor(a, 2));\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int i, result;\n  result = 1;\n\n  if (N < min) {\n    return 0;\n  }\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, a[32768], i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  for (i = 0; i <= n - 1; i++)\n    cout << f(a[i], 2) + 1 << endl;\n\n  return 0;\n}\nint f(int a, int p) {\n  int i, sum = 0;\n  for (i = 2; i <= sqrt(a); i++) {\n    if (((double)a / i == a / i) && (i >= p)) {\n      p = i;\n      sum = sum + 1 + f(a / i, p);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid fenjie(int t, int n) {\n  int i = 0;\n  if (n == 1)\n    sum++;\n  for (i = t; i <= n; i++) {\n    if (n % i == 0)\n      fenjie(i, n / i);\n  }\n}\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    sum = 0;\n    fenjie(2, k);\n    n--;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "733", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sep(int a, int b) {\n  int i;\n  int ans = 0;\n  if (a == 1)\n    ans = 1;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0) {\n      ans += sep(a / i, i);\n    }\n  }\n  return ans;\n}\nint baka(int a) {\n  int cirno;\n  cirno = sep(a, 2);\n  return cirno;\n}\nint main() {\n  int n, pre;\n  int i, j;\n  int ans;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> pre;\n    ans = baka(pre);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b);\n\nint main() {\n  int n, c[100], i, a, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &c[i]);\n\n  for (i = 1; i <= n; i++) {\n    a = c[i];\n    sum = f(a, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n\nint f(int a, int b) {\n  int sum = 1;\n  int i;\n  if (a < b)\n    return 0;\n  for (i = b; i < a; i++) {\n    if (a % i != 0)\n      continue;\n    else\n      sum = sum + f(a / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint reek(int i, int j) {\n  int k, g = 0;\n  for (k = j; k < i; k++) {\n    if ((i % k == 0) && (k != 1)) {\n      g = 1;\n      break;\n    } else\n      continue;\n  }\n  if (g == 0)\n    return 1;\n  else {\n    int num = 1;\n    for (k = j; k <= sqrt(i); k++) {\n      if ((i % k == 0) && (k != 1))\n        num += reek(i / k, k);\n      else\n        continue;\n    }\n    return num;\n  }\n}\nint main() {\n  int n, i, a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[n];\n    cout << reek(a[n], 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int d, int n) {\n  int sum = 0;\n  for (int i = d; i < n; i++) {\n    if (n % i == 0 && (n / i) >= i) {\n      sum = sum + 1;\n      sum = sum + divide(i, n / i);\n    }\n  }\n  return (sum);\n}\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << divide(2, num) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "737", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint F(int n, int a) {\n  if (n == 1)\n    return 1;\n  if (a == 1)\n    return 0;\n  if (n % a == 0)\n    return F(n / a, a) + F(n, a - 1);\n  return F(n, a - 1);\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d \", F(a, a));\n  }\n}\n"}
{"label": "1", "index": "738", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a = 1;\nint yinzi(int j, int n) {\n  for (int i = j; i < n; i++) {\n    if (n % i == 0 && n != i && n / i >= i) {\n      a++;\n      yinzi(i, n / i);\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, s;\n  scanf(\"%d \", &s);\n  for (int j = 0; j < s; j++) {\n    cin >> n;\n    for (int i = 2; i <= n; i++) {\n      if (n % i == 0 && n / i >= i) {\n        a++;\n        yinzi(i, n / i);\n      }\n    }\n    cout << a << endl;\n    a = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu[10000];\nint j = 0;\nint temp = 0;\nint main() {\n  void fenjie(int j, int sum);\n  int t, n[10000], i;\n  cin >> t;\n  for (i = 0; i < 10000; i++) {\n    yinshu[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    cin >> n[i];\n  }\n  for (i = 0; i < t; i++) {\n    fenjie(1, n[i]);\n    cout << temp << endl;\n    temp = 0;\n  }\n  return 0;\n}\nvoid fenjie(int j, int sum) {\n  for (int i = 2; i <= sum; i++) {\n    if (sum % i == 0 && yinshu[j - 1] <= i) {\n      yinshu[j] = i;\n      if (sum == i) {\n        temp++;\n      } else {\n        fenjie(j + 1, sum / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, flag = 2;\nvoid way(int);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &a);\n    way(a);\n    cout << num << endl;\n    num = 1;\n    flag = 2;\n  }\n  return 0;\n}\nvoid way(int a) {\n  int i, max;\n  max = sqrt(a);\n  for (i = flag; i <= max; i++) {\n    if (a % i == 0) {\n      flag = i;\n      num++;\n      way(a / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    sum = 0;\n  else if (n == m)\n    sum = 1;\n  else {\n    for (i = m; i <= n; i++)\n      if (n % i == 0)\n        sum = sum + f(n / i, i);\n  }\n  return (sum);\n}\nint main() {\n  int x, j, a[100000];\n  scanf(\"%d\", &x);\n  for (j = 0; j < x; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < x; j++)\n    printf(\"%d\\n\", f(a[j], 2));\n}\n"}
{"label": "1", "index": "742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint su(int input) \n{\n  int ju = 1;\n  for (int i = 2; i < sqrt(input); i++) {\n    if (input % i == 0)\n      ju = 0;\n    break;\n  }\n  return ju;\n}\nint fenjie(int input, int k) \n{\n  int ret = 1; \n  for (int i = k; i <= sqrt(input); i++) {\n    if (input % i == 0) {\n      if (su(input / i) == 0)\n        ; \n      { ret = fenjie(input / i, i) + ret; }\n    }\n  }\n  return ret;\n}\nint main() {\n  int input, num, sol;\n  cin >> num;\n  while (num--) \n  {\n    cin >> input;\n    cout << fenjie(input, 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, sum;\nint fenjie(int min, int max) {\n  int i;\n  for (i = min; i <= sqrt(max); i++) {\n    if (max % i == 0 && i <= max / i) {\n      sum++;\n      fenjie(i, max / i);\n    }\n    if (i > max / i)\n      break;\n  }\n  return sum;\n}\nint main() {\n  int i, k;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> n;\n    sum = 1;\n    sum = fenjie(2, n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "744", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint get(int n, int m) {\n  if (n == 1)\n    return 1;\n  while (m >= 2) {\n    if (n % m == 0)\n      break;\n    --m;\n  }\n  if (m == 1)\n    return 0;\n  return get(n / m, m) + get(n, m - 1);\n}\nint main() {\n  int t;\n  cin >> t;\n  for (int i = 0; i < t; ++i) {\n    int n;\n    scanf(\"%d \", &n);\n    cout << get(n, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "745", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ana(int n, int p) {\n  int i;\n  int t, s = 1;\n  t = pow(n, 0.5);\n  for (i = p; i <= t; i++)\n    if (n % i == 0)\n      s = s + ana(n / i, i);\n  return s;\n}\n\nint main() {\n  int n;\n  int a[100];\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", ana(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "746", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int x, int y) {\n  int i, s = 0;\n  if (x == y)\n    return 1;\n  for (i = y; i < x; i++)\n    if (x % i == 0)\n      s += fenjie(x / i, i);\n  if (i == x)\n    s++;\n  return s;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> i;\n    printf(\"%d\\n\", fenjie(i, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid qut(int a, int b);\nint num = 0;\nint main() {\n  int i, n, g[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> g[i];\n  for (i = 0; i < n; i++) {\n    qut(g[i], 1);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n\nvoid qut(int a, int b) {\n  int i;\n  if (a >= b) {\n    num++;\n    if (b == 1)\n      b++;\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        qut(a / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0, used[32770] = {0}; \nvoid f(int n)                   \n{\n  for (int i = 2; i <= n; i++) {\n    if (n % i == 0 && used[i] == 0) {\n      if (i != 2) {\n        for (int j = 2; j <= i - 1; j++)\n          used[j] = 1;\n      }\n      if (n / i == 1) \n      {\n        sum++;\n        break;\n      } else {\n        f(n / i);\n      }\n      memset(used, 0, sizeof(used)); \n    }\n  }\n}\nint main() {\n  int m, a[100];\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n    if (a[i] == 1)\n      cout << 1 << endl;\n    else {\n      f(a[i]);\n      cout << sum << endl;\n      sum = 0; \n      memset(used, 0, sizeof(used));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint make(int x, int t) {\n  int ans = 0, i;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++)\n    if (x % i == 0)\n      ans += make(x / i, i);\n  return ans;\n}\nint main() {\n  int p, n, t, x;\n  scanf(\"%d\", &t);\n  for (p = 1; p <= t; p++) {\n    scanf(\"%d\", &n);\n    x = make(n, 2);\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "750", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int k = 0;\n  if (a >= 2 * b) {\n    for (int i = b; i <= a / b; i++) {\n      if (a % i == 0 && a / i >= i) {\n        k += f(a / i, i) + 1;\n      }\n    }\n  } else {\n    k = 0;\n  }\n  return k;\n}\n\nint main() {\n  int n, a, t;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d \", &a);\n    t = f(a, 2) + 1;\n    cout << t << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "751", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (n < min) {\n    return 0;\n  }\n  for (i = min; i < n; i++)\n    if (n % i == 0)\n      result += f(n / i, i);\n  return result;\n}\nint main() {\n  int cases, a;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint remember = 0;\nint number(int const1, int a) {\n  if (a == 1) {\n    remember++;\n    return 1;\n  } else {\n    for (int i = const1; i <= a; i++) {\n      if (a % i == 0)\n        number(i, a / i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int cases[n];\n  for (int j = 0; j < n; j++)\n    cin >> cases[j];\n  for (int j = 0; j < n; j++) {\n    number(2, cases[j]);\n    cout << remember << \"\\n\";\n    remember = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint t = 0;\nint mini(int k, int i) {\n  if (k == 1)\n    t = t + 1;\n  for (; i <= k; i++) {\n    if (k % i == 0)\n      mini(k / i, i);\n  }\n  return 0;\n}\n\nint main() {\n  int N, n;\n  scanf(\"%d\", &N);\n  for (n = 0; n <= N - 1; n++) {\n    int M;\n    cin >> M;\n    mini(M, 2);\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n}\n"}
{"label": "1", "index": "754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Divide(int a, int b);\nint main() {\n  int Times = 0;\n  int Num = 0;\n  int i = 0;\n  int Temp[100] = {0};\n  cin >> Times;\n  for (i = 0; i < Times; i++) {\n    cin >> Num;\n    Temp[i] = Divide(Num, Num);\n  }\n  for (i = 0; i < Times; i++) {\n    printf(\"%d\\n\", Temp[i]);\n  }\n  return 0;\n}\n\nint Divide(int a, int b) {\n  int Sum = 0;\n  int i = 0;\n  int Flag = 0;\n  if (a != 1) {\n    for (i = b; i > 1; i--) {\n      if (a % i == 0)\n        Sum += Divide(a / i, i);\n      Flag = 1;\n    }\n  }\n  if (Flag == 0 || a == 1) {\n    Sum = 1;\n  }\n  return Sum;\n}\n"}
{"label": "1", "index": "755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint Factorization(int n, int k) {\n  int sum = 0;\n  if (n < k) {\n    return 0;\n  }\n  if (n % k == 0) {\n    if (n == k) {\n      return 1;\n    } else {\n      sum = sum + Factorization(n, k + 1) + Factorization(n / k, k);\n    }\n  } else {\n    sum = sum + Factorization(n, k + 1);\n  }\n  return sum;\n}\n\nint main() {\n  int t, i, a;\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n    cin >> a;\n    printf(\"%d\\n\", Factorization(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factorization(int a, int k);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", factorization(a, 2));\n  }\n  return 0;\n}\n\nint factorization(int a, int k) {\n  int sum = 1;\n  if (a == 1)\n    return 0;\n\n  if (a == 2)\n\n    return 1;\n\n  int b = (int)sqrt((double)a);\n  for (int i = k; i <= b; i++) {\n    if (a % i == 0) {\n      sum += factorization(a / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (min > n)\n    return 0;\n  for (i = min; i < n; i++) {\n    if (n % i == 0)\n      result += f(n / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, a, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    t = f(a, 2);\n    if (i < n - 1)\n      printf(\"%d\\n\", t);\n    else\n      printf(\"%d\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, n, sum = 0;\nvoid t(int m) {\n  int i, j;\n  for (i = m; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1) {\n        sum += 1;\n      } else\n        t(i);\n      a = a * i;\n    }\n  }\n}\n\nint main() {\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    cin >> a;\n    t(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int N, int min) {\n  int s = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      s += f(N / i, i);\n    }\n  }\n  return s;\n}\n\nint main() {\n  int n, i, b = 2;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", f(a[i], b));\n  return 0;\n}\n"}
{"label": "1", "index": "760", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\n\nvoid f(int x, int i) {\n  double m = sqrt(x);\n  if (i < m) {\n    if (x % i == 0) {\n      sum++;\n      f(x / i, i);\n    }\n    f(x, i + 1);\n  }\n\n  if (fabs(i - m) < 0.00000001)\n    sum++;\n}\n\nint main() {\n  int x, i, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    sum = 0;\n    f(x, 2);\n\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "761", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint factorization(int a, int k);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) \n  {\n    cin >> a;\n    cout << factorization(a, 2) << endl;\n  }\n  return 0;\n}\n\nint factorization(int a, int k) {\n  int sum = 1; \n  if (a == 1)  \n  {\n    return 0;\n  }\n  if (a == 2) \n  {\n    return 1;\n  }\n  int b = (int)sqrt((double)a); \n  for (int i = k; i <= b; i++)  \n  {\n    if (a % i == 0) {\n      sum += factorization(a / i, i);\n    }\n  }\n  return sum; \n}\n"}
{"label": "1", "index": "762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint tmp = 2;\nint suml(int n, int tmp) \n{\n  int sum = 0;\n  if (n == 1) {\n    return 1;\n  }\n  for (int i = tmp; i <= n; i++) {\n    if (n % i == 0) {\n      sum += suml(n / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int m;\n  cin >> m;\n  int n;\n  for (int i = 0; i < m; i++) {\n    cin >> n;\n    int zon_shu = 0;\n    zon_shu = suml(n, tmp);\n    cout << zon_shu << endl;\n  }\n}\n"}
{"label": "1", "index": "763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Fz(int, int);\nint main() {\n  int n, num[1000];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int a;\n    scanf(\"%d \", &a);\n    num[i] = Fz(a, 2);\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", num[i]);\n  }\n  return 0;\n}\nint Fz(int x, int m) {\n  int s = 1, i;\n  int y = (int)sqrt((double)x);\n  for (i = m; i <= y; i++) {\n    if (x % i == 0) {\n      s = s + Fz(x / i, i);\n    }\n  }\n  return s;\n}\n"}
{"label": "1", "index": "764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fengjie(int a, int b) {\n  if (a == 2 || a == 3)\n    return 1;\n  int sum = 1;\n  int c = sqrt(a);\n  for (int i = b; i <= c; i++) {\n    if (a % i == 0)\n      sum = sum + fengjie(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << fengjie(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint part(int x, int t) {\n  int i;\n  int number = 1;\n  if (x == 1) {\n    return 0;\n  }\n  if (x == 2) {\n    return 1;\n  }\n  for (i = t; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      number += part(x / i, i);\n    }\n  }\n  return number;\n}\n\nint main() {\n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << part(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int num = 1, i;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      num += f(a / i, i);\n  }\n  return num;\n}\nint main() {\n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "767", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    sum = 0;\n  else if (n == m) {\n    sum = 1;\n  } else {\n    for (i = m; i <= n; i++)\n      if (n % i == 0)\n        sum = sum + f(n / i, i);\n  }\n  return (sum);\n}\nint main() {\n  int x, j, a[100000];\n  cin >> x;\n  for (j = 0; j < x; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < x; j++)\n    printf(\"%d\\n\", f(a[j], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int, int);\n  int n[100], sum, i, m;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++) {\n    sum = f(1, n[i]) + 1;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint f(int i, int n) {\n  int j, k, sum = 0;\n  for (j = i; j < (int)sqrt((double)n) + 1; j++) {\n\n    k = sum;\n    if (j == 1)\n      sum = 0;\n    else {\n      if (n % j == 0 && n / j >= j) {\n        sum = f(j, n / j) + 1;\n      } else\n        sum = 0;\n    }\n    sum = sum + k;\n  }\n  return (sum);\n}\n"}
{"label": "1", "index": "769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fj(int a, int zs) {\n  int k, n, z;\n  n = 0;\n  z = 0;\n  for (k = zs; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      n = n + fj(a / k, k);\n      z = 1;\n    }\n  }\n  if (z == 0) {\n    return 1;\n  } else {\n    return n + 1;\n  }\n}\nint main() {\n  int m, i, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d\\n\", fj(t, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid factor(int, int);\nint result[9999] = {0};\nint j = 0;\nint main() {\n  int times, k = 1;\n  cin >> times;\n  while (k <= times) {\n    int num, ansf = 0;\n    cin >> num;\n    factor(2, num);\n\n    for (int i = 0; i < 9999; i++)\n      if (result[i])\n        ansf++;\n    cout << ansf << endl;\n\n    for (int i = 0; i < 9999; i++)\n      result[i] = 0;\n\n    k++;\n  }\n\n  return 0;\n}\n\nvoid factor(int start, int num) {\n  if (num == 1) {\n    result[j] = 1;\n    j++;\n  }\n\n  for (int i = start; i <= num; i++) {\n    if (num % i == 0) {\n      factor(i, num / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid f(int a, int b) {\n  int j;\n  if (a == 1)\n    count_1 += 1;\n  else {\n    for (j = b; j <= a; j++) {\n      if (a % j == 0)\n        f(a / j, j);\n    }\n  }\n}\nint main() {\n  int n, i, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    cin >> number;\n    f(number, 2);\n    cout << count_1 << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fib(int a, int e);\nint main() {\n  int n, b, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", fib(b, 2));\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\nint fib(int a, int e) {\n  int j, c, d;\n  c = 1;\n  if (a <= e)\n    return 1;\n  for (j = e; j <= sqrt(a); j++) {\n    if (a % j == 0) {\n      d = a / j;\n      c = c + fib(d, j);\n    }\n  }\n  return c;\n}\n"}
{"label": "1", "index": "773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint prime(int min, int num) {\n  int i;\n  for (i = min; i < num; i++) {\n    if (num % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint count(int min, int num) {\n  int i = 0, n = 1;\n  if (prime(min, num))\n    return 1;\n  else\n    for (i = min; i < num; i++) {\n      if (num % i == 0 && i <= num / i) {\n        n = n + count(i, num / i);\n      }\n    }\n  return n;\n}\nint main() {\n  int num, n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << count(2, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 1;\nint sushu(int n) {\n  int i, sum = 0;\n  for (i = 1; i <= sqrt(n * 1.0); i++)\n    if (n % i == 0)\n      sum++;\n  if (sum == 1)\n    return 1;\n  else\n    return 0;\n}\nvoid fenjie(int i, int k) \n{\n  int mid, j;\n  mid = sqrt(k * 1.0);\n  for (j = i; j <= mid; j++) {\n    if (sushu(k))\n      break;\n    else {\n      if (k % j == 0) {\n        num++;\n        fenjie(j, k / j);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  int a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    fenjie(2, a[i]);\n    cout << num << endl;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "775", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(int i, int a) {\n  int means = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      means += check(i, a / i);\n  }\n  return means;\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", check(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a;\nint res;\nint sum;\nvoid dfs(int cnt) {\n  if (cnt * sum == a) {\n    res++;\n    return;\n  }\n  if (cnt * sum < a) {\n    sum *= cnt;\n    int j = a / sum;\n    for (int i = cnt; i <= j; i++)\n      dfs(i);\n    sum /= cnt;\n    return;\n  }\n}\nint main() {\n  int nCases;\n  scanf(\"%d\", &nCases);\n  for (int i = 0; i < nCases; i++) {\n    scanf(\"%d\", &a);\n    res = 0;\n    sum = 1;\n    for (int i = 2; i <= a; i++)\n      dfs(i);\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "777", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num;\nint dg(int m, int limit);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int m;\n    cin >> m;\n    num = 0;\n    dg(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\nint dg(int m, int limit) {\n  for (int i = limit; i <= m / 2; i++)\n    if (m % i == 0)\n      dg(m / i, i);\n  if (m >= limit)\n    num++;\n  return 0;\n}\n"}
{"label": "1", "index": "778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int k);\n\nint main() {\n  int n, i, k, m; \n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    k = 2;\n    cout << f(m, k) << endl;\n  }\n\n  return 0;\n}\nint f(int m, int k) {\n  int m1, sum = 1;\n  m1 = m;\n  while (k <= (int)sqrt(m)) {\n    if (m % k == 0) {\n      m = m / k;\n\n      sum = sum + f(m, k);\n    }\n    m = m1;\n    k++;\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) \n{\n  int i, sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0)\n      sum += f(i, y / i) + 1;\n  } \n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    cout << f(2, b[i]) + 1 << endl;\n  } \n\n  return 0;\n}\n"}
{"label": "1", "index": "780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int b) {\n  int i, z = 0, c;\n  for (i = b; i <= x; i++) {\n    if (x == i)\n      z = z + 1;\n    else if (x % i == 0) {\n      c = x / i;\n      z = z + fenjie(c, i);\n    }\n  }\n  return (z);\n}\nint main() {\n  int n, i, num, a;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    num = fenjie(a, 2);\n    cout << num << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint minf(int p, int min);\nint main() {\n  int n, i, k, p, zs[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p;\n\n    zs[i] = minf(p, 2);\n\n    zs[i]++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d\\n\", zs[i]);\n  }\n  printf(\"%d\", zs[n - 1]);\n\n  return 0;\n}\nint minf(int p, int min) {\n  int x = 0, i;\n  i = min;\n  for (i; i <= (int)sqrt(p); i++) {\n    if (p % i == 0)\n      x += minf(p / i, i) + 1;\n  }\n\n  return x;\n}\n"}
{"label": "1", "index": "782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint times;\nvoid fenjie(int m, int k) {\n  int i;\n  {\n    for (i = k; i <= sqrt(m); i++) {\n      if (m % i == 0) {\n        fenjie(m / i, i);\n      }\n    }\n  }\n  times++;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int m;\n    times = 0;\n    cin >> m;\n    fenjie(m, 2);\n    printf(\"%d\\n\", times);\n  }\n}\n"}
{"label": "1", "index": "783", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fun(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i * i <= y; i++)\n    if (y % i == 0) {\n      sum++;\n      sum += fun(i, y / i);\n    }\n  return sum;\n}\nint main() {\n  int n, i, sum;\n  cin >> n;\n  while (n > 0) {\n    n--;\n    scanf(\"%d\", &i);\n    sum = 1;\n    sum += fun(2, i);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "784", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, t;\nvoid dg(int s) {\n  for (int i = s; i <= t; i++) {\n    if (t % i == 0) {\n      t = t / i;\n      if (t == 1)\n        sum++;\n      else\n        dg(i);\n      t = t * i;\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> t;\n    dg(2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "785", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d(int, int);\nint main() {\n  int i, n, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", d(x, 2));\n  }\n  return 0;\n}\nint d(int x, int y) {\n  int j, num = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (j = y; j <= (int)sqrt((double)x); j++)\n    if (x % j == 0)\n      num += d(x / j, j);\n  return num;\n}\n"}
{"label": "1", "index": "786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint breakways(int num, int min);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int number;\n  for (int i = 1; i <= n; i++) {\n    cin >> number;\n    cout << breakways(number, 2) << endl;\n  }\n}\n\nint breakways(int num, int min) {\n  int sum = 0;\n  for (int j = min; j <= num; j++) {\n    if (num % j == 0) {\n      if (num != j)\n        sum += breakways(num / j, j);\n      else\n        sum += 1;\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint main() {\n  void yinshu(int, int); \n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> a;\n    yinshu(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid yinshu(int a, int x) {\n  if (a != 1) {\n    for (int i = x; i <= a; i++) \n      if (a % i == 0)            \n        yinshu(a / i, i);        \n  }\n  if (a == 1) \n    sum++;\n}\n"}
{"label": "1", "index": "788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid f(int a, int b) {\n  int j;\n  if (a == 1)\n    count_1 += 1;\n  else {\n    for (j = b; j <= a; j++) {\n      if (a % j == 0)\n        f(a / j, j);\n    }\n  }\n}\nint main() {\n  int n, i, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d\", &number);\n    f(number, 2);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fj(int a, int b);\n\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fj(a, 2));\n  }\n\n  return 0;\n}\nint fj(int a, int b) {\n  int j, x, sum = 1, f = 0;\n  x = sqrt((double)a);\n  if ((a == 1) || (a == 2) || (a == 3))\n    return 1;\n  else {\n    for (j = b; j <= x; j++) {\n      if (a % j == 0) {\n        sum += fj(a / j, j);\n        f = 1;\n      }\n    }\n    if (f == 0)\n      return 1;\n    else\n      return sum;\n  }\n}\n"}
{"label": "1", "index": "790", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fenjie(int t, int n) {\n  int i = 0;\n  if (n == 1)\n    sum++;\n  for (i = t; i <= n; i++) {\n    if (n % i == 0) {\n      fenjie(i, n / i);\n    }\n  }\n}\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  while (n > 0) {\n    scanf(\"%d \", &k);\n    sum = 0;\n    fenjie(2, k);\n    n--;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "791", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sushu(int b) {\n  int flag = 1, i;\n  if (b == 2)\n    return 1;\n  if (b % 2 == 0)\n    return 0;\n  for (i = 2; i <= b / 2; i++) {\n    if (b % i == 0) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0)\n    return 0;\n  else\n    return 1;\n}\nint number(int a, int b) {\n  int i, total = 1;\n  if (sushu(a)) {\n    total = 1;\n    return total;\n  }\n  for (i = b; i <= a; i++) {\n\n    if (a % i == 0 && a / i >= i) {\n      total = total + number(a / i, i);\n    }\n  }\n  return total;\n}\nint main() {\n  int n, i, A[100], B[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    B[i] = number(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", B[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divmet(int n, int i);\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n;\n    for (int j = 2; j <= n; j++)\n      sum = sum + divmet(n, j);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\nint divmet(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divmet(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n"}
{"label": "1", "index": "793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint qipa(int p, int q) {\n  int i, l, s = 0;\n  if (p == 1)\n    return 1;\n  for (i = p; i > 1; i--)\n    if (p % i == 0 && i <= q)\n      s += qipa(p / i, i);\n  return s;\n}\nint main() {\n  int i, j, n, m, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    t = qipa(m, m);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "794", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int m, int i);\nint num;\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    num = 0;\n    fun(a, 2);\n    cout << num + 1 << endl;\n  }\n  return 0;\n}\nvoid fun(int m, int i) {\n  int k = sqrt(m);\n  for (i = i; i <= k; i++) {\n    if (m % i == 0) {\n      num++;\n      fun(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "795", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int j) {\n  int sum = 1, i, s, p, k;\n  s = sqrt(n);\n  for (i = j; i <= s; i++) {\n    if (n % i == 0) {\n      p = n / i;\n      k = i;\n      sum = sum + divide(p, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k, m, p;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &m);\n    p = divide(m, 2);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "796", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b, j, f[1010];\n\nvoid factorization(int x) {\n  int now, i;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= f[j]) {\n      f[++j] = i;\n      now = x / i;\n      if (now == 1) {\n        b++;\n      } else {\n        factorization(now);\n      }\n      j--;\n    }\n  }\n  return;\n}\nint main() {\n  int n, i, num;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    b = 0;\n    j = 0;\n    memset(f, 0, sizeof(f));\n    cin >> num;\n    factorization(num);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid divide(int n, int a) {\n  for (int i = a; i <= n; i++) {\n    if ((n % i == 0)) {\n      if (n / i == 1)\n        sum++;\n      else\n        divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int N = 0, n = 0, i = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &n);\n    divide(n, 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint remember = 0;\nint number(int const1, int a) {\n  if (a == 1) {\n    remember++;\n    return 1;\n  } else {\n    for (int i = const1; i <= a; i++) {\n      if (a % i == 0)\n        number(i, a / i);\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int cases[n];\n  for (int j = 0; j < n; j++)\n    cin >> cases[j];\n  for (int j = 0; j < n; j++) {\n    number(2, cases[j]);\n    cout << remember << \"\\n\";\n    remember = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint total, p;\nvoid part(int y) {\n  int i2, up;\n  if (y == 1)\n    return;\n  up = (int)sqrt(y);\n  for (i2 = 2; i2 <= up; i2++) {\n    if (p <= i2) {\n      if (y % i2 == 0) {\n        total++;\n        p = i2;\n        part(y / i2);\n        p = 0;\n      }\n    }\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    total = 0;\n    p = 0;\n    scanf(\"%d\", &a);\n    part(a);\n    cout << total + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint func(int m, int q) {\n  int b[100];\n\n  int i, j, k = 0, p = 0, sum = 1;\n  for (j = q; j <= m; j++) {\n    if (j * j > m) {\n      p = k;\n      break;\n    }\n    if (m % j == 0) {\n      b[k] = j;\n      k++;\n    }\n  }\n  if (k > 2 || p != 0 && m != 2) {\n    for (i = 0; i < p; i++) {\n      sum += func(m / b[i], b[i]);\n    }\n    return (sum);\n  } else\n    return (1);\n}\nint main() {\n  int i, j, k = 0, n, m, b[100] = {0}, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    b[i] = func(m, 2);\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d \", b[j]);\n  }\n}\n"}
{"label": "1", "index": "801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ans = 0;\nint work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return (p * k, k);\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0) {\n      work(p / i, i);\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    ans = 0;\n    int t;\n    scanf(\"%d\", &t);\n    work(t, 2);\n    \n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\n\nint main() {\n  int times, k, num;\n  cin >> times;\n  for (k = 1; k <= times; k++) {\n    cin >> num;\n    printf(\"%d\\n\", fenjie(num, 1));\n  }\n\n  return 0;\n}\n\nint fenjie(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n"}
{"label": "1", "index": "803", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count_1;\n\nvoid fun(int i, int j) {\n  int k;\n  for (k = i; k <= sqrt(j); k++) {\n    if (j % k == 0) {\n      count_1++;\n      fun(k, j / k);\n    }\n  }\n}\nint main() {\n  int turn, c;\n  scanf(\"%d\", &turn);\n  for (c = 1; c <= turn; c++) {\n    int n, i;\n    scanf(\"%d\", &n);\n    for (i = 2; i <= sqrt(n); i++) {\n      if (n % i == 0) {\n        count_1++;\n        fun(i, n / i);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n    count_1 = 0;\n  }\n}\n"}
{"label": "1", "index": "804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int c);\nint j, b;\nint main() {\n  int i, n, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int a, int c) {\n  int j, b = 0;\n  for (j = c; j <= sqrt(a); j++) {\n\n    if (a % j == 0) {\n      b = b + f(a / j, j);\n    }\n  }\n  return b + 1;\n}\n"}
{"label": "1", "index": "805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint ge, s, w;\nvoid fen(int h, int a);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> s;\n    ge = 0;\n    fen(s, 2);\n    printf(\"%d\\n\", ge);\n  }\n  return 0;\n}\nvoid fen(int h, int a) {\n  for (int i = 2; i <= h; i++) {\n    if ((h % i == 0) && (i >= a)) {\n      if (h / i != 1) {\n        fen(h / i, i);\n      } else {\n        ge++;\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "806", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a < b)\n    return 0;\n  int i, r = 1;\n  for (i = b; i <= a; i++) {\n    if (!(a % i) && i <= a / i)\n      r += f(a / i, i);\n  }\n  return r;\n}\nint main() {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d\", &m);\n    int result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "807", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0; \nvoid count(int N, int i) {\n  if (N == 1)\n    sum++; \n  while (i <= N) {\n    if (N % i == 0)\n      count(N / i, i);\n    i++; \n  }\n  return;\n}\nint main() {\n  int T = 0; \n  cin >> T;\n  while (T--) {\n    int N = 0; \n    cin >> N;\n    int i = 2, total = 1; \n    while (i <= N / 2) {\n      if (N % i == 0) {\n        sum = 0;\n        count(N / i, i);\n        total += sum;\n      } \n      i++;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a, int min);\n  int n, a[150], i, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    b = f(a[i], 2);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min) {\n    return 0;\n  }\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s(int n, int m) {\n  if (n == 1)\n    return 1;\n  int an = 0;\n  for (int i = m; i > 1; i--) {\n    if (n % i == 0)\n      an += s(n / i, min(i, n / i));\n  }\n  return an;\n}\nint main() {\n  int N;\n  cin >> N;\n  int x;\n  for (N; N > 0; N--) {\n    cin >> x;\n    printf(\"%d\\n\", s(x, x));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int min) {\n  int x = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n  }\n  return x;\n}\nint main() {\n  int shu;\n  int number, count = 1;\n  scanf(\"%d\", &number);\n  while (count < number) {\n    scanf(\"%d\", &shu);\n    printf(\"%d \", fenjie(shu, 2));\n    count++;\n  }\n  scanf(\"%d\", &shu);\n  printf(\"%d\", fenjie(shu, 2));\n}\n"}
{"label": "1", "index": "811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint T, n;\n\nint calc(int n, int min) {\n  if (n == 1)\n    return 1;\n  if (n <= min)\n    return 0;\n  int re = 0;\n  for (int i = min + 1; i <= n; i++)\n    if (n % i == 0) {\n\n      re += calc(n / i, i - 1);\n    }\n  if (!re)\n    re = 1;\n\n  return re;\n}\n\nint main() {\n\n  scanf(\"%d\", &T);\n  while (T--) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", calc(n, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "812", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int n, int i) {\n  int sum = 0;\n  for (i; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      sum += f(n / i, i);\n    }\n  }\n  return sum + 1;\n}\nint main() {\n  int i0, n0;\n  scanf(\"%d \", &n0);\n  for (i0 = 0; i0 < n0; i0++) {\n    int n;\n    scanf(\"%d\", &n);\n    printf(\"%d \", f(n, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "813", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int min, int a) \n{\n  if (min > a)\n    return 0; \n\n  int i;\n  int num = 1;                     \n  for (i = min; i <= sqrt(a); i++) \n  {\n    if (a % i == 0) \n    {\n      num = num + f(i, a / i); \n    }\n  }\n\n  return num; \n}\nint main() \n{\n  int m, a, j;            \n  cin >> m;               \n  for (j = 0; j < m; j++) \n  {\n    cin >> a;                \n    cout << f(2, a) << endl; \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nvoid f(int x, int min) {\n  int p;\n  if (x == 1)\n    sum++;\n  else\n    for (p = min; p <= x; p++)\n      if (x % p == 0)\n        f(x / p, p);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> k;\n    for (j = 2; j <= k; j++)\n      if (k % j == 0)\n        f(k / j, j);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "815", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint find_factor(int a, int b) {\n  int i, sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0) {\n      sum = sum + find_factor(a / i, i);\n    }\n  }\n  return sum;\n}\n\nint main(void) {\n  int n;\n  cin >> n;\n  int a;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << find_factor(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "816", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint j = 2; \n\nint kinds(int x) { \n  int sum = 1;\n  if (x == 1)\n    return 0;                        \n  for (int i = j; i <= sqrt(x); i++) \n    if (x % i == 0)                  \n    {\n      sum += kinds(x / i); \n      j = i + 1;           \n    }\n  return sum; \n}\nint main() { \n  int n = 0;\n  cin >> n; \n  for (int i = 0; i < n; i++) {\n    int x = 0;                \n    cin >> x;                 \n    cout << kinds(x) << endl; \n    j = 2;                    \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int i;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  while (cin >> a) {\n    cout << f(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int, int);\nint main(void) {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (n != 0) {\n    scanf(\"%d \", &a);\n    cout << divide(a, 2) << endl;\n    n--;\n  }\n  return 0;\n}\n\nint divide(int x, int t) {\n  int i, sum = 0;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++) {\n    if (x % i == 0)\n      sum += divide(x / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int c);\nint j, b;\nint main() {\n  int i, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    cout << f(m, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int a, int c) {\n  int j, b = 0;\n  for (j = c; j <= sqrt(a); j++) {\n\n    if (a % j == 0)\n      b = b + f(a / j, j);\n  }\n  return b + 1;\n}\n"}
{"label": "1", "index": "820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  for (; i <= x; i++)\n    if (x % i == 0)\n      f(x / i, i);\n  return;\n}\n\nint main() {\n  int t, a, i = 2;\n  cin >> t;\n  for (a = 0; a < t; a++) {\n    int x;\n    scanf(\"%d \", &x);\n    int ans = 1;\n    for (i = 2; i < sqrt(x); i++) {\n      sum = 0;\n      if (x % i == 0)\n        f(x / i, i);\n      ans = ans + sum;\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, m, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int m, int min) {\n  int count = 1, i;\n  if (m == 1)\n    return 1;\n  else if (m == 2)\n    return 1;\n  else {\n    for (i = min; i <= sqrt(m); i++) {\n      if (m % i == 0) {\n        count += f(m / i, i);\n      }\n    }\n    return count;\n  }\n}\n"}
{"label": "1", "index": "822", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nvoid divide(int n, int from) {\n\n  int i;\n  for (i = from; i < n; i++) {\n    if (n % i == 0) {\n      if (n / i < i) {\n        return;\n      }\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\n\nint main(int argc, const char *argv[]) {\n\n  int n;\n  cin >> n;\n  int i;\n  int numberToDivide;\n  for (i = 0; i < n; i++) {\n    cin >> numberToDivide;\n    num = 0;\n    divide(numberToDivide, 2);\n    printf(\"%d\\n\", num + 1);\n  }\n}\n"}
{"label": "1", "index": "823", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fenjie(int num, int min);\nint k = 2;\nint main() {\n  int n, i, jieguo, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    jieguo = fenjie(num, 2);\n    printf(\"%d\\n\", jieguo);\n  }\n  return 0;\n}\n\nint fenjie(int num, int min) {\n  int j, jieguo = 1;\n\n  if (num < min) {\n    return 0;\n  }\n\n  for (j = min; j < num; j++) {\n\n    if (num % j == 0) {\n\n      jieguo += fenjie(num / j, j);\n    }\n  }\n  return jieguo;\n}\n"}
{"label": "1", "index": "824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int j);\nint main() {\n  int n, a, s, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    s = f(a, 2) + 1;\n    cout << s << \"\\n\";\n  }\n\n  return 0;\n}\nint f(int a, int j) {\n  int i, tem;\n\n  int count = 0;\n  for (i = j; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      j = i;\n\n      if (a / i < j)\n        count += 1;\n      else\n        count += (f(a / i, j) + 1);\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f2(int i, int a) {\n  int c, s = 0;\n  for (i; i <= a / 2; i++) {\n    if (a % i == 0) {\n      c = a / i;\n      if (c >= i)\n        s = s + f2(i, c);\n    }\n  }\n  s = s + 1;\n  return s;\n}\n\nint f(int a) {\n  int s = 0;\n\n  s = s + f2(2, a);\n  return s;\n}\n\nint main() {\n  int n, i, a, b;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    b = f(a);\n    printf(\"%d\\n\", b);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, a[32768], i;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d\\n\", f(a[i], 2) + 1);\n  }\n  return 0;\n}\nint f(int a, int p) {\n  int i, sum = 0;\n  for (i = 2; i <= sqrt(a); i++) {\n    if (((double)a / i == a / i) && (i >= p)) {\n      p = i;\n      sum = sum + 1 + f(a / i, p);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "827", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint N, A;\n\nint acSearch(int n, int i) {\n  int ret = 0;\n\n  if (n == 1)\n    ret = 1;\n  else\n    for (; i <= n; ++i)\n      if (n % i == 0)\n        ret += acSearch(n / i, i);\n\n  return ret;\n}\n\nint main() {\n  cin >> N;\n  for (; N--;) {\n    scanf(\"%d\", &A);\n    printf(\"%d\\n\", acSearch(A, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint tmp = 2;\nint suml(int n, int tmp) {\n  int sum = 0;\n  if (n == 1) {\n    return 1;\n  }\n  for (int i = tmp; i <= n; i++) {\n    if (n % i == 0) {\n      sum += suml(n / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int m;\n  cin >> m;\n  int n;\n  for (int i = 0; i < m; i++) {\n    cin >> n;\n    int zon_shu = 0;\n    zon_shu = suml(n, tmp);\n    cout << zon_shu << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Fz(int, int);\nint main() {\n  int n, num[1000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num[i] = Fz(a, 2);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\nint Fz(int x, int m) {\n  int s = 1, i;\n  int y = (int)sqrt((double)x);\n  for (i = m; i <= y; i++) {\n    if (x % i == 0) {\n      s = s + Fz(x / i, i);\n    }\n  }\n  return s;\n}\n"}
{"label": "1", "index": "830", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    cin >> x;\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n  return 0;\n}\nint fff(int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "831", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factor(int, int);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", factor(num, 2));\n  }\n  return 0;\n}\nint factor(int n, int min) {\n  int i;\n  int num = 1;\n  if (n < min)\n    return 0;\n  else {\n    for (i = min; i < n; i++) {\n      if (n % i == 0)\n        num += factor(n / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fac(int p, int q) {\n  int i, t = 1;\n  if (p > q) {\n    return 0;\n  }\n  if (p == q) {\n    return 1;\n  }\n  for (i = p; i <= sqrt(q); i++) {\n    if (q % i == 0) {\n      t += fac(i, q / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int a, i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << fac(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a, int min);\n  int n, a[150], i, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = f(a[i], 2);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int k, int n) {\n  int i, flag = 0;\n  for (i = k; i <= n; i++) {\n    if (n % i == 0) {\n      f(i, n / i);\n      flag = 1;\n    }\n  }\n  if ((flag == 0 && k <= n) || n == 1)\n    num++;\n}\nint main() {\n  int i, n, m;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    f(2, n);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a, int p) {\n  int i, count = 0;\n  for (i = p; i < a; i++) {\n    if (a % i == 0 && a / i >= i) {\n      count++;\n      int k, t;\n      k = (int)sqrt(a / i);\n      for (t = 2; t <= k; t++) {\n        if ((a / i) % t == 0) {\n          count += change(a / i, i);\n          break;\n        }\n      }\n    }\n  }\n  return count;\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int total = 0;\n    cin >> a;\n    total += change(a, 2);\n    printf(\"%d\\n\", total + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "836", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint deal(int num, int p) {\n  int i, sum = 0;\n  if (num == 1)\n    return 1;\n  for (i = p; i <= num; ++i) {\n    if (num % i == 0)\n      sum += deal(num / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    cout << deal(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint f(int a, int b) {\n  int count = 0;\n  int k[32768] = {0};\n  if (a == 1)\n    return 1;\n  else {\n    int i, j;\n    for (i = min(a, b); i >= 2; i--) {\n      if (a % i == 0)\n        k[i] = i;\n    }\n    for (j = 0; j < 32768; j++) {\n      if (k[j] != 0) {\n        count = count + f(a / k[j], j);\n        k[j] = 0;\n      }\n    }\n    return count;\n  }\n}\nint main() {\n  int n, i, a, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    number = f(a, a);\n    printf(\"%d \", number);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint decompose(int x, int y);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int j = 1; j <= n; j++) {\n    cin >> m;\n    printf(\"%d\\n\", decompose(m, 2));\n  }\n  return 0;\n}\nint decompose(int x, int y) {\n  int sum = 1, b;\n  b = (int)sqrt(x);\n  if (x == 1)\n    return 0;\n  for (int i = y; i <= b; i++) {\n    if (x % i == 0)\n      sum = sum + decompose(x / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint breakways(int num, int min);\nint main() {\n  int n;\n  cin >> n;\n  int number;\n  for (int i = 1; i <= n; i++) {\n    cin >> number;\n    cout << breakways(number, 2) << endl;\n  }\n}\n\nint breakways(int num, int min) {\n  int sum = 0;\n  for (int j = min; j <= num; j++) {\n    if (num % j == 0) {\n      if (num != j)\n        sum += breakways(num / j, j);\n      else\n        sum += 1;\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "840", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid ways(int a, int last);\nint main() {\n  int n, num[100], i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n\n  for (i = 0; i < n; i++) {\n    ways(num[i], 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid ways(int a, int last) {\n  int i;\n  for (i = last; i <= a; i++) {\n    if (a < i) {\n    } else if (a == i) {\n      sum++;\n    } else if (a % i == 0) {\n      ways(a / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0;\nvoid f(int x, int y) {\n\n  if (x == 1)\n    s++;\n  else {\n    for (; y <= x; y++) {\n      if (x % y == 0) {\n        f(x / y, y);\n      }\n    }\n  }\n}\nint main() {\n  int n, k, q, j;\n  scanf(\"%d\", &q);\n  for (j = 0; j < q; j++) {\n    scanf(\"%d\", &n);\n    f(n, 2);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "842", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sushu(int b) {\n  int flag = 1, i;\n  if (b == 2)\n    return 1;\n  if (b % 2 == 0)\n    return 0;\n  for (i = 2; i <= b / 2; i++) {\n    if (b % i == 0) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 0;\n  } else\n    return 1;\n}\nint number(int a, int b) {\n  int i, total = 1;\n  if (sushu(a)) {\n    total = 1;\n    return total;\n  }\n  for (i = b; i <= a; i++) {\n\n    if (a % i == 0 && a / i >= i) {\n      total = total + number(a / i, i);\n    }\n  }\n  return total;\n}\nint main() {\n  int n, i, A[100], B[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    B[i] = number(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", B[i]);\n  }\n}\n"}
{"label": "1", "index": "843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint shi(int a) {\n  int b = sqrt(a);\n  for (int i = 2; i <= b; i++) {\n    if (a % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint shu(int m, int k) {\n  int a = 1;\n  for (int j = k; j <= sqrt(m); j++) {\n    if (m % j == 0 && m / j >= k) {\n      a++;\n      if (shi(m / j) == 0)\n        a += shu(m / j, j) - 1;\n    }\n  }\n  return a;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    int m, a;\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", shu(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "844", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      sum += f(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n  for (int i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint t = 0;\nint mini(int k, int i) {\n  if (k == 1)\n    t = t + 1;\n  for (; i <= k; i++) {\n    if (k % i == 0)\n      mini(k / i, i);\n  }\n  return 0;\n}\n\nint main() {\n  int N, n;\n  scanf(\"%d\", &N);\n  for (n = 0; n <= N - 1; n++) {\n    int M;\n    scanf(\"%d\", &M);\n    mini(M, 2);\n    cout << t << \"\\n\";\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint g(int y) {\n  int i;\n  for (i = 0;; i++) {\n    if (i * i > y)\n      break;\n  }\n  return i - 1;\n}\nint f(int x, int b) {\n  int p, a[100], t = 0, k = 0;\n  p = g(x);\n  if (x == 2)\n    return 0;\n  else {\n    for (int i = b; i <= p; i++) {\n      if (x % i == 0) {\n        a[t] = i;\n        t++;\n      }\n    }\n    if (t == 0)\n      return 0;\n    else\n      for (int i = 0; i < t; i++)\n        k = k + f(x / a[i], a[i]) + 1;\n    return k;\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "847", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nint wrh(int n, int r, int b[200], int y, int a) {\n  int i;\n  for (i = y; i <= a / 2; i++) {\n    if (r % i == 0) {\n      b[n] = i;\n      int now = 1, j;\n      for (j = 1; j <= n; j++)\n        now = now * b[j];\n      if (now == a) {\n        num++;\n        break;\n      }\n      if (now > a)\n        break;\n      else\n        wrh(n + 1, r / i, b, i, a);\n    }\n  }\n  return 0;\n}\n\nint main() {\n\n  int s, a, b[200];\n  scanf(\"%d \", &s);\n  while (s > 0) {\n    num = 0;\n    cin >> a;\n    wrh(1, a, b, 2, a);\n    cout << num + 1 << endl;\n    s--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int num, int i) {\n  int sum;\n  sum = 0;\n  int j;\n  for (j = i; j <= num / 2; j++) {\n    if (num % j == 0) {\n      if (num / j < j) {\n        sum = sum;\n      } else {\n        sum = 1 + sum + f(num / j, j);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, num, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    int j, sum;\n    sum = 0;\n    j = 2;\n    sum += f(num, j);\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int);\nint g_count, g_j;\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    g_count = 0;\n    g_j = 2;\n    scanf(\"%d \", &a);\n    cout << sum(a) + 1 << endl;\n  }\n  return 0;\n}\nint sum(int a) {\n  int i, b;\n  b = (int)sqrt((double)a);\n  for (i = g_j; i <= b; i++) {\n    if (a % i == 0) {\n      g_j = i;\n      g_count++;\n      sum(a / i);\n    }\n  }\n  return g_count;\n}\n"}
{"label": "1", "index": "850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint c;\nvoid cal(int n, int k);\nint main(int argc) {\n  int m, n, j;\n  scanf(\"%d \", &m);\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    c = 0;\n    cal(n, 1);\n    cout << c << \"\\n\";\n  }\n\n  return 0;\n}\nvoid cal(int n, int k) {\n  if (n == 1) {\n    c++;\n    return;\n  }\n  int i;\n  for (i = 2; i <= n; i++) {\n    if (n % i == 0 && i >= k) {\n      cal(n / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\n\nvoid f(int x, int i) {\n  double m = sqrt(x);\n  if (i < m) {\n    if (x % i == 0) {\n      sum++;\n      f(x / i, i);\n    }\n    f(x, i + 1);\n  }\n\n  if (fabs(i - m) < 0.00000001)\n    sum++;\n}\n\nint main() {\n  int x, i, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    sum = 0;\n    f(x, 2);\n\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factor(int a, int min) {\n  int i, result = 1;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += factor(a / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, i, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = factor(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", a[i]);\n    else\n      cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fun(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i * i <= y; i++)\n    if (y % i == 0) {\n      sum++;\n      sum += fun(i, y / i);\n    }\n  return sum;\n}\nint main() {\n  int n, i, sum;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    n--;\n    scanf(\"%d\", &i);\n    sum = 1;\n    sum += fun(2, i);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 1, k = 0;\nint count(int n) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= k) {\n      num++;\n      k = i;\n      count(n / i);\n      k = 0;\n    }\n  }\n  return (num);\n}\nint main() {\n  int i, n, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << count(a[i]) << \"\\n\";\n    num = 1;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ans = 0;\nvoid work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return;\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0) {\n      work(p / i, i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    ans = 0;\n    int t;\n    cin >> t;\n    work(t, 2);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint prime(int n) {\n  int i, judge = 1;\n  for (i = 2; i < n; i++) {\n    if (n % i == 0)\n      judge = 0;\n  }\n  return judge;\n}\nint function_1(int number, int x) {\n  int temp = 0, i, result = 0;\n  if (!prime(number)) {\n    for (i = x; i <= number; i++)\n      if (number % i == 0) {\n        x = i;\n        temp = number / i;\n        result += function_1(temp, x);\n      }\n  } else if ((number >= x || number == 1) && prime(number))\n    result = 1;\n  return result;\n}\nint main() {\n  int i, times, number;\n  scanf(\"%d \", &times);\n  for (i = 0; i < times; i++) {\n    scanf(\"%d \", &number);\n    cout << function_1(number, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int j);\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    cout << f(m, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int m, int j) {\n  int num = 1;\n  for (int i = j; i <= sqrt(m); i++) {\n    if (m % i == 0) {\n      num += f(m / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu(int num, int min);\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a, result;\n    scanf(\"%d\", &a);\n    result = yinshu(a, 2) + 1;\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n\nint yinshu(int num, int min) {\n  int r, x = 0;\n  if (num < min) {\n    return 0;\n  } else {\n    for (r = min; r * r <= num; r++) {\n      if (num % r == 0) {\n        x = x + 1 + yinshu(num / r, r);\n      }\n    }\n    return x;\n  }\n}\n"}
{"label": "1", "index": "859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factor(int a, int b) {\n  int i, ways;\n  ways = 1;\n  if (a < b)\n    return 0;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      ways += factor(a / i, i);\n  }\n  return ways;\n}\n\nint main() {\n  int n, A[99], K[99], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    K[i] = factor(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << K[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "860", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min) \n{\n  int i;\n  if (a < min) \n  {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) \n  {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a; \n  cin >> n;\n  while (cin >> a) \n  {\n    cout << f(a, 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint geshu;\nvoid yinshu(int num, int a) {\n  int i;\n  if (num == 1)\n    geshu++;\n  else {\n    for (i = a; i <= num; i++) {\n\n      if (num % i == 0) {\n\n        yinshu(num / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int shu, j, num1[10000];\n  cin >> shu;\n  for (j = 0; j < shu; j++) {\n    geshu = 0;\n    cin >> num1[j];\n\n    yinshu(num1[j], 2);\n    cout << geshu << endl;\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int x, int p);\nint N;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &N);\n    printf(\"%d\\n\", fenjie(N, 2));\n  }\n  return 0;\n}\nint fenjie(int x, int p) {\n  int f = 0;\n  if (x == 1)\n    return 1;\n  else {\n    for (int i = p; i <= x; i++)\n      if (x % i == 0)\n        f = f + fenjie(x / i, i);\n  }\n  return f;\n}\n"}
{"label": "1", "index": "863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      sum += f(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ys(int x, int min) {\n  int r = 1;\n  if (x < min)\n    return 0;\n  for (int i = min; i < x; i++) {\n    if (x % i == 0) {\n      r += ys(x / i, i);\n    }\n  }\n  return r;\n}\nint main() {\n  int n, a[1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << ys(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int, int);\nint sum = 0, res = 1;\nint main() {\n  int n, a, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    res = 1;\n    cin >> a;\n    for (j = 2; j <= (int)sqrt((float)a); j++) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        res += sum;\n      }\n    }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n  return;\n}\n"}
{"label": "1", "index": "866", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint function_1(int a, int m) {\n  int sum = 1, i;\n  if (a > m)\n    return 0;\n  else {\n    for (i = a; i < m; i++) {\n      if (m % i == 0)\n        sum = sum + function_1(i, m / i);\n      else\n        continue;\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, i, m[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d \", function_1(2, m[i]));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dividemin(int a, int minyinzi) {\n  int num = 0;\n  if (a == 1)\n    num++;\n  else\n    for (int i = minyinzi; i <= a; i++) {\n      if (a % i == 0)\n        num = num + dividemin(a / i, i);\n    }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i <= n - 1; i++)\n\n    cout << dividemin(a[i], 2) << endl;\n}\n"}
{"label": "1", "index": "868", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 1;\nint kk(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--)\n    if (a % i == 0)\n      return a / i;\n  return 0;\n}\nint seperate(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--) {\n    if (a % i == 0 && (a / i) <= i) {\n      sum++;\n      if ((a / i) == 2)\n        continue;\n      else\n        seperate(a / i, a / i - 1);\n    } else if ((a % i == 0) && ((kk(a / i, i)) != 0))\n      seperate(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << seperate(m, m - 1) << endl;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid breakup(int, int);\nint sum;\nint main() {\n  int n, x, count = 0;\n  cin >> n;\n  while (count < n) {\n    sum = 0;\n    count++;\n    scanf(\"%d \", &x);\n    if (x > 3)\n      breakup(x, 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n\nvoid breakup(int x, int j) {\n  int i, p, m;\n  m = x;\n  p = sqrt((double)x);\n  for (i = j; i <= p; i++)\n    if (m % i == 0) {\n      sum++;\n      x = m / i;\n      breakup(x, i);\n    }\n  return;\n}\n"}
{"label": "1", "index": "870", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint f(int x, int min) {\n  if (x < min)\n    return 0;\n  int r = 1;\n  for (int i = min; i < x / 2; i++) {\n    if (x % i == 0) {\n      r += f(x / i, i);\n    }\n  }\n  return r;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int x;\n    cin >> x;\n    cout << f(x, 2) << endl;\n  }\n}\n"}
{"label": "1", "index": "871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int y) {\n  int a = sqrt(n);\n  for (int i = y; i <= a; i++) {\n    if (n % i == 0) {\n      sum++;\n      y = i;\n      f(n / i, y);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    sum = 0;\n    f(num, 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int k);\n\nint main() {\n  int n, i, k, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    k = 2;\n    cout << f(m, k) << endl;\n  }\n\n  return 0;\n}\nint f(int m, int k) {\n  int m1, sum = 1;\n  m1 = m;\n  while (k <= (int)sqrt(m)) {\n    if (m % k == 0) {\n      m = m / k;\n\n      sum = sum + f(m, k);\n    }\n    m = m1;\n    k++;\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (min > n)\n    return 0;\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result += f(n / i, i);\n    }\n  }\n  return result;\n}\n\nint main() {\n  int n, a, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    t = f(a, 2);\n    if (i < n - 1)\n      printf(\"%d\\n\", t);\n    else\n      printf(\"%d\", t);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int m, int x, int i) {\n  if (x == 1 && m >= i)\n    return 1;\n  else if (x > 1) {\n    int j = i;\n    int sum = 0;\n    while (j <= m) {\n      if (j != 1 && m % j == 0)\n        sum = sum + devide(m / j, x - 1, j);\n      j++;\n    }\n    return sum;\n  }\n  return 0;\n}\n\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    cin >> a;\n    for (int X = 1; X <= 16; X++)\n      sum += devide(a, X, 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid count(int m, int j) {\n  int i;\n  if (m == 1) {\n    num++;\n  }\n  for (i = j; i <= m; i++) {\n    if (m % i == 0) {\n      count(m / i, i);\n    } else\n      continue;\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int m;\n    cin >> m;\n    num = 0;\n    count(m, 2);\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "876", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint min(int a, int b) { \n  if (a > b)\n    return b;\n  else\n    return a;\n}\nint f(int n, int s) { \n  int k = 0, i;\n  if (n == 1)\n    return 1;\n  else if (s == 1)\n    return 0;\n  else if (s > n)\n    return f(n, n);\n  else {\n    for (i = 2; i <= s; i++)\n      if (n % i == 0)\n        k = k + f(n / i, min(i, s));\n    return k;\n  }\n}\nint main() { \n  int n, m;\n  cin >> n;\n  while (n > 0) {\n    cin >> m;\n    cout << f(m, m) << endl; \n    n--;\n  }\n  return 0;\n} \n"}
{"label": "1", "index": "877", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i * i <= a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    scanf(\"%d \", &k);\n    cout << f(k, 2) << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "878", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint c = 1;\n\nvoid fenjie(int a, int k) {\n  if (a == 1) {\n    c++;\n    return;\n  }\n  for (int i = k; i <= a; i++) {\n    if (a % i == 0)\n      fenjie(a / i, i);\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    c = 0;\n    cin >> a;\n    fenjie(a, 2);\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "879", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid jisuan(int, int);\nint times, sum, i, n;\nint main() {\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    sum = 0;\n    cin >> n;\n    jisuan(n, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid jisuan(int n, int j) {\n  int i;\n  for (i = j; i <= n; i++) {\n    if (n > 1) {\n      if (n % i == 0) {\n        if (n % i != 0 && n > i)\n          sum++;\n        jisuan(n / i, i);\n      }\n    }\n    if (n == i)\n      sum++;\n  }\n}\n"}
{"label": "1", "index": "880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0, z = 2;\nvoid number(int x, int y) {\n  int i;\n  if (x == 1)\n    s = s + 1;\n\n  for (i = y; i <= x; i++) {\n    if (x % i == 0)\n      number(x / i, i);\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    number(a, z);\n    cout << s << endl;\n    s = 0;\n  }\n}\n"}
{"label": "1", "index": "881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 2;\nint manners(int a) {\n  int count = 1, t = 0;\n  t = sqrt((double)a);\n  for (int i = m; i <= t; i++) {\n    if (a % i == 0) {\n      m = i;\n      count = count + manners(a / i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n, b;\n  int i = 1;\n  cin >> n;\n  while (i <= n) {\n    scanf(\"%d \", &b);\n    printf(\"%d\\n\", manners(b));\n    m = 2;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 1;\nint kk(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--)\n    if (a % i == 0)\n      return a / i;\n  return 0;\n}\nint seperate(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--) {\n    if (a % i == 0 && (a / i) <= i) {\n      sum++;\n      if ((a / i) == 2)\n        continue;\n      else\n        seperate(a / i, a / i - 1);\n    } else if ((a % i == 0) && ((kk(a / i, i)) != 0))\n      seperate(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << seperate(m, m - 1) << endl;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "883", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nint dg(int m, int limit);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int m;\n    scanf(\"%d \", &m);\n    num = 0;\n    dg(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\nint dg(int m, int limit) {\n  for (int i = limit; i <= m / 2; i++)\n    if (m % i == 0)\n      dg(m / i, i);\n  if (m >= limit)\n    num++;\n  return 0;\n}\n"}
{"label": "1", "index": "884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum += fun(m / i, i);\n    }\n  } else\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0) {\n        sum += fun(m / i, i);\n      }\n    }\n  return sum;\n}\nint main() {\n  int n, i, b;\n  int a[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b;\n    a[i] = fun(b, 1);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << endl;\n}\n"}
{"label": "1", "index": "885", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(int n, int a) {\n  int kind = 0;\n  int i;\n  if (n == 1)\n    return 1;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0) {\n      if (n / i < i && i != n)\n        ;\n      else {\n        kind = kind + function_1(n / i, i);\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int m, n, i, sum;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    sum = function_1(n, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = q; i <= sqrt(x); i++)\n        if (x % i == 0)\n          sum = sum + f(i, x / i);\n\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[200][200] = {0};\n  int div[40000] = {0};\n  int divth[200] = {0};\n  int kase = 0;\n  scanf(\"%d \", &kase);\n  for (; kase > 0; kase--) {\n    int n = 0;\n    cin >> n;\n    memset(f, 0, sizeof(f));\n    memset(div, 0, sizeof(div));\n    memset(divth, 0, sizeof(divth));\n    int m = 0;\n    for (int i = 1; i <= n; i++)\n      if (n % i == 0) {\n        div[i] = ++m;\n        divth[m] = i;\n      }\n    f[1][1] = 1;\n    for (int i = 2; i <= m; i++)\n      for (int j = 2; j <= i; j++)\n        for (int k = j; k > 1; k--)\n          if (divth[i] % divth[k] == 0) {\n            int ii = divth[i] / divth[k];\n            int jj = k;\n            if (div[ii] < jj)\n              jj = div[ii];\n            f[i][j] += f[div[ii]][jj];\n          }\n    printf(\"%d\\n\", f[m][m]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  for (; i <= x; i++)\n    if (x % i == 0)\n      f(x / i, i);\n  return;\n}\n\nint main() {\n  int t, a, i = 2;\n  scanf(\"%d \", &t);\n  for (a = 0; a < t; a++) {\n    int x;\n    cin >> x;\n    int ans = 1;\n    for (i = 2; i < sqrt(x); i++) {\n      sum = 0;\n      if (x % i == 0)\n        f(x / i, i);\n      ans = ans + sum;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int out[16], int a, int n, int m, int sheng, int b[2])\n\n{\n  int i;\n  for (i = m; i <= a / 2; i++) {\n    if (sheng % i == 0) {\n      out[n] = i;\n      int qiu = 1, k;\n      for (k = 0; k <= n; k++)\n        qiu = out[k] * qiu;\n\n      if (qiu == a) {\n        b[0]++;\n        break;\n      }\n      if (qiu > a)\n        break;\n      else\n        fenjie(out, a, n + 1, i, sheng / i, b);\n    }\n  }\n  return 0;\n}\nint main() {\n  int hang = 0;\n  scanf(\"%d \", &hang);\n  while (hang > 0) {\n    int a;\n    int b[2] = {0};\n    cin >> a;\n    int out[16] = {0};\n    fenjie(out, a, 0, 2, a, b);\n    cout << b[0] + 1 << \"\\n\";\n    hang--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "890", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Fz(int, int);\nint main() {\n  int n, num[1000];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num[i] = Fz(a, 2);\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", num[i]);\n  }\n  return 0;\n}\nint Fz(int x, int m) {\n  int s = 1, i;\n  int y = (int)sqrt((double)x);\n  for (i = m; i <= y; i++) {\n    if (x % i == 0) {\n      s = s + Fz(x / i, i);\n    }\n  }\n  return s;\n}\n"}
{"label": "1", "index": "891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int s) {\n  if (a <= s)\n    return 1;\n  int b = sqrt((float)a), flag = 0, sum = 1;\n  for (int i = s; i <= b; i++) {\n    if (a % i == 0) {\n      flag++;\n\n      sum = sum + f(a / i, i);\n    }\n  }\n  if (flag == 0)\n    return 1;\n  else\n    return sum;\n}\n\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << f(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "892", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint disassamble(int, int);\nint main() {\n  int n;\n  int i = 1;\n  int a, result;\n  cin >> n;\n  while (i <= n) {\n    i++;\n    scanf(\"%d \", &a);\n    result = disassamble(a, 2);\n    cout << result << endl;\n  }\n\n  return 0;\n}\nint disassamble(int a, int y) {\n  int i, count = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (i = y; i * i <= a; i++) {\n    if (a % i == 0) {\n      count = disassamble(a / i, i) + count;\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint ispr(int t) {\n  int v = (int)sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n  return;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int j = 0; j < n; j++) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a) == 1) {\n      cout << \"1\\n\";\n      continue;\n    }\n\n    int res = 1;\n    for (int i = 2; i <= a / 2; i++) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res = res + sum;\n      }\n    }\n    printf(\"%d\\n\", res);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int brea(int a, int min);\n  int i, n, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", brea(a, 2));\n  }\n}\n\nint brea(int a, int min) {\n  int result = 1;\n  int i;\n  if (a < min)\n    return (0);\n  else if (a == min)\n    return (1);\n  else {\n    for (i = min; i < a; i++) {\n      if (a % i == 0) {\n        result = result + brea(a / i, i);\n      }\n    }\n    return (result);\n  }\n}\n"}
{"label": "1", "index": "895", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(int i, int m);\nint sum;\nint main() {\n  int n, i, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 1;\n    scanf(\"%d \", &m);\n    f(2, m);\n    printf(\"%d\\n\", sum);\n  }\n}\nvoid f(int i, int m) {\n  int k, s;\n  s = (int)sqrt(m);\n  for (k = i; k <= s; k++) {\n    if (m % k == 0) {\n      sum++;\n      f(k, m / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ys(int x, int min) {\n  int r = 1;\n  if (x < min) {\n    return 0;\n  }\n  for (int i = min; i < x; i++) {\n    if (x % i == 0) {\n      r += ys(x / i, i);\n    }\n  }\n  return r;\n}\nint main() {\n  int n, a[1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    cout << ys(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "897", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, flag = 2;\nvoid way(int);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    way(a);\n    printf(\"%d\\n\", num);\n    num = 1;\n    flag = 2;\n  }\n  return 0;\n}\nvoid way(int a) {\n  int i, max;\n  max = sqrt(a);\n  for (i = flag; i <= max; i++) {\n    if (a % i == 0) {\n      flag = i;\n      num++;\n      way(a / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nint yin(int c, int g) \n{\n  int j, k, f, e;\n  for (j = g; j <= c; j++) \n  {\n    if (c % j == 0) {\n      e = c / j;\n      if (e > 1) {\n        f = j;\n        yin(e, f);\n      } else\n        sum++; \n    }\n  }\n  return sum; \n}\nint main() {\n  int n, a[1000], b[1000], i, d;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++) {\n    d = 2;\n    sum = 0;\n    b[i] = yin(a[i], d);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl; \n  return 0;\n}\n"}
{"label": "1", "index": "899", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint division(int m, int k) {\n  int num = 0;\n  if (m >= k) {\n    for (int i = k; i <= m; i++) {\n      if (m == i)\n        num++;\n      else if (m % i == 0) {\n        num += division(m / i, i);\n      }\n    }\n  }\n  return num;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    cout << division(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint varieties = 0;\n\nvoid divide(int forward, int number) {\n  int i;\n  if (number == 1) {\n    varieties++;\n  }\n  for (i = forward; i <= number; i++) {\n    if (number % i == 0) {\n      divide(i, number / i);\n    }\n  }\n}\n\nint main() {\n  int n = 0, num = 0;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &num);\n    divide(2, num);\n    cout << varieties << endl;\n    varieties = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int k, int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(1, q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n  return 0;\n}\nint fff(int k, int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(k + 1, w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "902", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, t = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0) {\n      s += divide(n / i, i);\n      t++;\n    }\n  if (t == 0)\n    return 0;\n  return s;\n}\nint main() {\n  int n, k;\n  cin >> k;\n  while (k > 0) {\n    cin >> n;\n    printf(\"%d\\n\", divide(n, n));\n    k--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint f(int a, int b) {\n  int count = 0;\n  int k[32768] = {0};\n  if (a == 1)\n    return 1;\n  else {\n    int i, j;\n    for (i = min(a, b); i >= 2; i--) {\n      if (a % i == 0)\n        k[i] = i;\n    }\n    for (j = 0; j < 32768; j++) {\n      if (k[j] != 0) {\n        count = count + f(a / k[j], j);\n        k[j] = 0;\n      }\n    }\n    return count;\n  }\n}\nint main() {\n  int n, i, a, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    number = f(a, a);\n    printf(\"%d \", number);\n  }\n}\n"}
{"label": "1", "index": "904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int x, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    cout << f(x, 2) << endl;\n  }\n\n  return 0;\n}\n\nint f(int x, int i) {\n  int ans = 0;\n  if (x == 2) {\n    return 1;\n  } else {\n    for (; i <= sqrt(x); i++) {\n      if (x % i == 0) {\n        ans = ans + f(x / i, i);\n      }\n    }\n    return ans + 1;\n  }\n}\n"}
{"label": "1", "index": "905", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint fg(int k, int m) {\n  int j, d = 0;\n  if (m == 1) {\n    d = 1;\n  }\n  for (j = k; j <= m; j++) {\n    if (m % j == 0)\n      d = d + fg(j, m / j);\n  }\n  return (d);\n}\n\nint main() {\n  int n, i, a[40000], b[40000], s;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    b[i] = fg(2, a[i]);\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid fenjie(int n, int x) {\n  extern int num;\n  if (n == 1)\n    num++;\n  else\n\n    for (int i = x; i <= n; i++)\n      if (n % i == 0)\n        fenjie(n / i, i);\n}\nint main() {\n  int n, k;\n  cin >> k;\n  for (int j = 0; j != k; j++) {\n    extern int num;\n    num = 0;\n    cin >> n;\n    fenjie(n, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "907", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum, temp;\nvoid fact(int);\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    sum = 0;\n    temp = 2;\n    fact(k);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid fact(int k) {\n  if (k == 1) {\n    sum++;\n    return;\n  }\n  int i;\n  for (i = temp; i <= k; i++) {\n    if (k % i == 0) {\n      temp = i;\n      fact(k / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "908", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nvoid divide(int a, int k) {\n  int i;\n  if (a == 1) {\n    num++;\n  }\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      divide(a / i, i);\n}\n\nint main() {\n  int t;\n  cin >> t;\n  while (t--) {\n    int n;\n    cin >> n;\n    num = 1;\n    int i;\n    for (i = 2; i * i <= n; i++)\n      if (n % i == 0)\n        divide(n / i, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a;\nint fj(int x, int y);\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fj(a, 2));\n  }\n  return 0;\n}\nint fj(int x, int y) {\n  int xnumber = 1;\n  int i;\n  int b = sqrt(x);\n  if (x == 1)\n    return 0;\n  else\n    for (i = y; i <= b; i++) {\n      if (x % i == 0)\n        xnumber = xnumber + fj(x / i, i);\n    }\n  return xnumber;\n}\n"}
{"label": "1", "index": "910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint qipa(int p, int q) {\n  int i, l, s = 0;\n  if (p == 1)\n    return 1;\n  for (i = p; i > 1; i--)\n    if (p % i == 0 && i <= q)\n      s += qipa(p / i, i);\n  return s;\n}\nint main() {\n  int i, j, n, m, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    t = qipa(m, m);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int x, int m);\n  int k, i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    for (j = 2; j <= k; j++) {\n      if (k % j == 0)\n        sum += f(k, j);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n\nint f(int x, int m) {\n  int i, sum = 0;\n  if (m == x)\n    sum = 1;\n  else {\n    x = x / m;\n    for (i = m; i <= x; i++) {\n      if (x % i == 0)\n        sum += f(x, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint s = 0;\n\nvoid find(int min, int dev) {\n  int i;\n  for (i = min; i <= sqrt((float)dev); i++)\n    if (dev % i == 0) {\n      s++;\n      find(i, dev / i);\n    }\n}\n\nint main() {\n  int n, i, m, j;\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d\", &n);\n    for (i = 2; i <= sqrt((float)n); i++)\n      if (n % i == 0) {\n        s++;\n        find(i, n / i);\n      }\n    printf(\"%d\\n\", s + 1);\n    s = 0;\n  }\n  \n  \n  return 0;\n}\n"}
{"label": "1", "index": "913", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint f(int, int); \nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  return 0;\n}\nint f(int x, int b) \n{\n  int j, re = 1; \n  if (x < b)\n    return 0;\n  for (j = b; j < x; j++) {\n    if (x % j == 0)\n      re = re + f(x / j, j); \n  }\n  return re; \n}\n"}
{"label": "1", "index": "914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid fenjie(int i, int a);\n\nint k = 1;\n\nint main() {\n  int n, m, a;\n\n  cin >> n;\n\n  for (m = 1; m <= n; m++) {\n    scanf(\"%d \", &a);\n\n    fenjie(2, a);\n\n    cout << k << endl;\n\n    k = 1;\n  }\n\n  return 0;\n}\n\nvoid fenjie(int i, int a) {\n  for (; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      k++;\n\n      fenjie(i, a / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int k, int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(1, q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n}\nint fff(int k, int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(k + 1, w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid recur(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      recur(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int t = 0;\n  cin >> t;\n  for (int k = 0; k < t; k++) {\n    int n = 0;\n    cin >> n;\n    int i = 2, res = 1;\n    for (int i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        recur(n / i, i);\n        res += sum;\n      }\n    }\n    cout << res << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint col(int a, int b);\nint main() {\n  int n, i, m, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    l = col(m, 2) + 1;\n    printf(\"%d\\n\", l);\n  }\n  return 0;\n}\nint col(int a, int b) {\n  int i, t, tt = 0, sig = 0;\n  for (i = b; (i < a / 2) && ((a / i) >= i); i++) {\n    if (a % i == 0) {\n      t = a / i;\n      tt = tt + 1 + col(t, i);\n      sig = 1;\n    }\n  }\n  if (sig == 0)\n    tt = 0;\n  return (tt);\n}\n"}
{"label": "1", "index": "918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a;\nint res;\nint sum;\nvoid dfs(int cnt) {\n  if (cnt * sum == a) {\n    res++;\n    return;\n  }\n  if (cnt * sum < a) {\n    sum *= cnt;\n    int j = a / sum;\n    for (int i = cnt; i <= j; i++)\n      dfs(i);\n    sum /= cnt;\n    return;\n  }\n}\nint main() {\n  int nCases;\n  scanf(\"%d\", &nCases);\n  for (int i = 0; i < nCases; i++) {\n    scanf(\"%d\", &a);\n    res = 0;\n    sum = 1;\n    for (int i = 2; i <= a; i++)\n      dfs(i);\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint remember = 0;\nint number(int const1, int a) {\n  if (a == 1) {\n    remember++;\n    return 1;\n  } else {\n    for (int i = const1; i <= a; i++) {\n      if (a % i == 0)\n        number(i, a / i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int cases[n];\n  for (int j = 0; j < n; j++)\n    scanf(\"%d \", &cases[j]);\n  for (int j = 0; j < n; j++) {\n    number(2, cases[j]);\n    cout << remember << endl;\n    remember = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a, b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b[i] = f(a, 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << \"\\n\";\n\n  return 0;\n}\nint f(int x, int y) {\n  int j, sum = 1;\n  if (x < y)\n    sum = 0;\n  else {\n    for (j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + f(x / j, j);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "921", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct node {\n  int s, n;\n};\nvoid cpy_clr(struct node a[], struct node b[]) {\n  int i;\n  for (i = 0; i <= 1000 && (a[i].s != 0 || b[i].s != 0); i++)\n    if (b[i].s != 0) {\n      a[i].s = b[i].s;\n      a[i].n = b[i].n;\n      b[i].s = 0;\n      b[i].n = 0;\n    } else {\n      a[i].s = 0;\n      a[i].n = 0;\n      b[i].n = 0;\n    }\n}\nint chklst(struct node a[], int n) {\n  int i;\n  int result = 0;\n  for (i = 0; a[i].s != 0; i++) {\n    if (a[i].s != n) {\n      result = 0;\n      break;\n    } else\n      result++;\n  }\n  return result;\n}\nvoid init(struct node a[]) {\n  int i;\n  for (i = 0; i < 1000; i++) {\n    a[i].s = 0;\n    a[i].n = 0;\n  }\n}\nint main() {\n  struct node a[1000], b[1000];\n  int i, j, k, l, _n, n, sum = 0;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d\", &_n);\n    for (l = 2; l < _n; l++)\n      if (_n % l == 0) {\n        init(a);\n        init(b);\n        a[0].s = l;\n        a[0].n = l;\n        while (chklst(a, _n) == 0 && a[0].s != 0) {\n          i = 0;\n          k = -1;\n          if (a[0].s == 0)\n            break;\n          while (a[i].s != 0) {\n            if (a[i].s == _n)\n              sum++;\n            else {\n              for (j = a[i].n; j <= (_n / a[i].s); j++)\n                if (_n % (a[i].s * j) == 0) {\n                  b[++k].s = a[i].s * j;\n                  b[k].n = j;\n                }\n            }\n            i++;\n          }\n          cpy_clr(a, b);\n        }\n        i = 0;\n        while (a[i].s != 0) {\n          if (a[i].s == _n)\n            sum++;\n          i++;\n        }\n      }\n    printf(\"%d \", ++sum);\n    sum = 0;\n  }\n}\n"}
{"label": "1", "index": "922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid fenjie(int, int, int);\nint g_num, g_count;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    g_count = 0;\n    cin >> g_num;\n    fenjie(2, g_num, 1);\n    cout << g_count << endl;\n  }\n  return 0;\n}\nvoid fenjie(int a, int num, int sum) {\n  while (a <= g_num) {\n    sum *= a;\n    if (sum == g_num)\n      g_count++;\n    if (sum < g_num)\n      fenjie(a, g_num, sum);\n    if (sum > g_num)\n      return;\n    sum /= a;\n    a++;\n  }\n}\n"}
{"label": "1", "index": "923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b);\n\nint main() {\n  int n, c[100], i, a, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> c[i];\n\n  for (i = 1; i <= n; i++) {\n    a = c[i];\n    sum = f(a, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n\nint f(int a, int b) {\n  int sum = 1;\n  int i;\n  if (a < b)\n    return 0;\n  for (i = b; i < a; i++) {\n    if (a % i != 0)\n      continue;\n    else\n      sum = sum + f(a / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fj(int n, int m) {\n  int i;\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      sum++;\n      fj(n / i, i);\n    }\n  }\n}\nint main() {\n  int j, N;\n  int a[100];\n  cin >> N;\n  for (j = 1; j <= N; j++) {\n    scanf(\"%d \", &a[j]);\n  }\n  for (j = 1; j <= N; j++) {\n    sum = 0;\n    fj(a[j], 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fg(int k, int m) {\n  int j, d = 0;\n  if (m == 1) {\n    d = 1;\n  }\n  for (j = k; j <= m; j++) {\n    if (m % j == 0)\n      d = d + fg(j, m / j);\n  }\n  return (d);\n}\n\nint main() {\n  int n, i, a[40000], b[40000], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = fg(2, a[i]);\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint sum(int a, int i) {\n\n  if (a == 1)\n    num++;\n  else {\n    while (i <= a) {\n      if (a % i == 0) {\n        sum(a / i, i);\n      }\n      i++;\n    }\n  }\n  return num;\n}\nint main() {\n  int a, t, j, i, count;\n  scanf(\"%d \", &t);\n  for (j = 0; j < t; j++) {\n    count = 1;\n    cin >> a;\n    i = 2;\n    while (i <= (a / 2)) {\n      if (a % i == 0) {\n        num = 0;\n        sum(a / i, i);\n        count = count + num;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s = 0, p = 1;\nvoid fenjie(int a, int b) {\n  int i;\n  if (a == 1)\n    s++;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      fenjie(a / i, i);\n  return;\n}\nint main() {\n  int n, i, j, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 2; j * j <= a[i]; j++) {\n      if (a[i] % j == 0) {\n        s = 0;\n        fenjie(a[i] / j, j);\n        p = p + s;\n      }\n    }\n    printf(\"%d\\n\", p);\n    p = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a, cnt = 0, num;\nint decompose(int x, int y) {\n  int i, xnum = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2) {\n    return 1;\n  }\n  for (i = y; i <= (int)sqrt(x); i++) {\n    if (x % i == 0)\n      xnum += decompose(x / i, i);\n  }\n  return xnum;\n}\nint main() {\n  cin >> n;\n  while (cnt < n) {\n    cin >> a;\n    num = decompose(a, 2);\n    printf(\"%d\\n\", num);\n    cnt++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint func(int m, int q) {\n  int b[100];\n\n  int i, j, k = 0, p = 0, sum = 1;\n  for (j = q; j <= m; j++) {\n    if (j * j > m) {\n      p = k;\n      break;\n    }\n    if (m % j == 0) {\n      b[k] = j;\n      k++;\n    }\n  }\n  if (k > 2 || p != 0 && m != 2) {\n    for (i = 0; i < p; i++) {\n      sum += func(m / b[i], b[i]);\n    }\n    return (sum);\n  } else\n    return (1);\n}\nint main() {\n  int i, j, k = 0, n, m, b[100] = {0}, a[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    b[i] = func(m, 2);\n  }\n  for (j = 0; j < i; j++) {\n    cout << b[j] << \" \";\n  }\n}\n"}
{"label": "1", "index": "930", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 1;\nint Fact(int x, int y);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 1;\n    Fact(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint Fact(int x, int y) {\n  if (x == 1)\n    return 0;\n  else {\n    for (; y <= sqrt(x); y++)\n      if (x % y == 0)\n        sum = sum + Fact(x / y, y);\n\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid FenJie(int);\nint counter = 0;\nint Befor = 0;\nint main() {\n  int n, x, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    counter = 0;\n    Befor = x;\n    FenJie(x);\n    cout << counter << endl;\n  }\n  return 0;\n}\nvoid FenJie(int x) {\n  int i, temp = Befor;\n  if (x == 1) {\n    counter++;\n    return;\n  }\n  for (i = Befor; i > 1; i--) {\n    if (x % i == 0) {\n      Befor = i;\n      FenJie(x / i);\n    }\n    Befor = temp;\n  }\n  return;\n}\n"}
{"label": "1", "index": "932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nvoid count(int x, int y) {\n  int i;\n  if (x == 1)\n    n = n + 1;\n  else {\n    for (i = y; i <= x; i++) {\n      if (x % i == 0)\n        count(x / i, i);\n    }\n  }\n}\nint main() {\n  int i, k, t;\n  void count(int x, int y);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n = 0;\n    scanf(\"%d\", &t);\n    count(t, 2);\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nvoid count(int x, int y) {\n  int i;\n  if (x == 1)\n    n = n + 1;\n  else {\n    for (i = y; i <= x; i++) {\n      if (x % i == 0)\n        count(x / i, i);\n    }\n  }\n}\nint main() {\n  int i, k, t;\n  void count(int x, int y);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n = 0;\n    scanf(\"%d\", &t);\n    count(t, 2);\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint F(int min, int a) {\n  int i;\n  int sum = 0;\n  if (min == a)\n    return 1;\n  if (a == 1)\n    return 1;\n  for (i = min; i <= a; i++) {\n    if (a % i == 0)\n      sum += F(i, a / i);\n  }\n  return sum;\n}\n\nint main() {\n  int a, n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    cout << F(2, a) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint sum(int x, int y) {\n  int c, i;\n  if (x > sqrt(y))\n    c = 0;\n  else {\n    if (y % x == 0) {\n      for (i = x, c = 1; i <= (y / 2) + 1; i++) {\n        if ((y / x) % i == 0)\n          c = c + sum(i, (y / x));\n      }\n    } else\n      c = 0;\n  }\n  return (c);\n}\nint main() {\n  int i, k, j;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    k = 0;\n    scanf(\"%d\", &m);\n    for (i = 2; i <= (m / 2) + 1; i++)\n      k = k + sum(i, m);\n    printf(\"%d \", k + 1);\n  }\n}\n"}
{"label": "1", "index": "936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint counts = 1;\nint ty(int, int);\nint main() {\n  int i, m, n, c;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &n);\n    counts = 1;\n    c = ty(n, 2);\n    printf(\"%d\\n\", c);\n  }\n  return 0;\n}\n\nint ty(int n, int j) {\n  int i, flag = 0;\n  if (n == 1) {\n    return 0;\n  }\n  if (n == 2) {\n    return 1;\n  }\n  for (i = j; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      counts++;\n      ty(n / i, i);\n    }\n  }\n  return counts;\n}\n"}
{"label": "1", "index": "937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0, g, f;\nint divide(int chushu, int a) {\n  int i;\n  for (i = chushu; i <= a; i++) {\n    if (a % i == 0) {\n      f = a / i;\n      if (f > 1) {\n        g = i;\n        divide(g, f);\n      } else {\n        sum++;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int p = 0;\n  for (p = 0; p < n; p++) {\n    int b = 0, c = 2;\n    cin >> b;\n    sum = 0;\n    cout << divide(c, b) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num;\nint fjys(int n, int m, int i, int d, int ji[20]) {\n  int a;\n  for (a = i; a < m; a++) {\n    if (n % a == 0) {\n      ji[d] = a;\n      int chenji = 1, k;\n      for (k = 0; k <= d; k++)\n        chenji = chenji * ji[k];\n      if (chenji == m) {\n        num++;\n        break;\n      } else\n        fjys(n / a, m, a, d + 1, ji);\n    }\n  }\n  return num;\n}\nint main() {\n  int m, n, j, result = 0, ji[20] = {0};\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    num = 0;\n    cin >> n;\n    result = fjys(n, n, 2, 0, ji);\n    cout << result + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "939", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid account(int, int);\nint p;\nint main() {\n  int m;\n  int n;\n  cin >> n;\n  while (n > 0) {\n    p = 0;\n    scanf(\"%d \", &m);\n    account(m, 1);\n    cout << p << endl;\n    n--;\n  }\n  return 0;\n}\nvoid account(int m, int i) {\n  if (m == 1)\n    p++;\n  else\n    for (int j = 2; j <= m; j++) {\n      if ((m % j == 0) && (j >= i))\n        account(m / j, j);\n    }\n}\n"}
{"label": "1", "index": "940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0)\n      sum += f(i, y / i) + 1;\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    cout << f(2, b[i]) + 1 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "941", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1, j = 2;\nvoid num(int);\nint main() {\n  int n, a[100];\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    num(a[i]);\n    cout << sum << endl;\n    sum = 1, j = 2;\n  }\n  return 0;\n}\nvoid num(int a) {\n  int k;\n  for (k = j; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      sum = sum + 1;\n      j = k;\n      num(a / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, num;\nint make(int a);\nint pan(int a);\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    num = 0;\n    m = a;\n    printf(\"%d\\n\", make(a));\n  }\n  return 0;\n}\nint pan(int a) {\n  int n = 0, i;\n  for (i = 1; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      n++;\n  }\n  if (n == 1)\n    return 0;\n  else\n    return 1;\n}\nint make(int a) {\n  int i, j, ans;\n  ans = sqrt(a);\n  if (pan(a) == 0) {\n    num++;\n    return num;\n  } else {\n    num++;\n    for (i = m / a; i <= ans; i++) {\n      if (i == 1)\n        continue;\n      if (a % i == 0) {\n        m = a;\n        num = make(a / i);\n      }\n    }\n    if (i == ans + 1)\n      return num;\n  }\n  return num;\n}\n"}
{"label": "1", "index": "943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid factor(int x, int limit);\nint result;\nint main() {\n  int n;\n  cin >> n;\n  int input;\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &input);\n    result = 1;\n    factor(input, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nvoid factor(int x, int limit) {\n  int remainder;\n  if (x < limit) {\n    return;\n  }\n  for (int i = limit; i <= x; i++) {\n    remainder = x % i;\n    if (remainder == 0) {\n      if (x / i >= i) {\n        result++;\n        factor(x / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "944", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint answer = 0;\nvoid f(int n, int N) {\n  if (n < N)\n    N = n;\n  if (N == 1) {\n    answer++;\n    return;\n  }\n  while (N > 1) {\n    if (n % N == 0)\n      f(n / N, N);\n    N--;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    f(a, a);\n    printf(\"%d\\n\", answer);\n    answer = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    int m;\n    cin >> m;\n    int f(int a, int min);\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\nint f(int a, int min) {\n  int i = min;\n  if (a < min)\n    return 0;\n\n  int result = 1;\n  while (i < a) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n\n    i++;\n  }\n  return result;\n}\n"}
{"label": "1", "index": "946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yz[100], all = 0;\nint yinzi(int num, int amax) {\n  int i, j = 0, geshu = 0, key = num;\n  if (num == 1)\n    return 1;\n  else {\n    for (i = amax; i < all; i++) {\n      if (num % yz[i] == 0) {\n        num = num / yz[i];\n        geshu = geshu + yinzi(num, i);\n        num = key;\n      }\n    }\n    return geshu;\n  }\n  return 0;\n}\nint main() {\n  int num, n, i, c, j = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &num);\n    if (num == 1)\n      printf(\"%d\\n\", 1);\n    else {\n      j = 0;\n      for (i = 2; i <= num; i++) {\n        if (num % i == 0) {\n          yz[j] = i;\n          j++;\n        }\n      }\n      all = j;\n      printf(\"%d\\n\", yinzi(num, 0));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint answer = 0;\nint a = 2;\nvoid f(int, int);\nint main() {\n  int n = 0;\n  int i = 0;\n  int data[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> data[i];\n  for (i = 0; i < n; i++) {\n    f(data[i], a);\n    cout << answer << endl;\n    answer = 0;\n  }\n  return 0;\n}\nvoid f(int m, int n) {\n  int i = 0;\n  if (m == 1) {\n    answer = answer + 1;\n  }\n  for (i = n; i <= m; i++) {\n    if (m % i == 0)\n      f(m / i, i);\n  }\n}\n"}
{"label": "1", "index": "948", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 1, flag = 2;\nvoid way(int);\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d \", &a);\n    way(a);\n    cout << num << endl;\n    num = 1;\n    flag = 2;\n  }\n  return 0;\n}\nvoid way(int a) {\n  int i, max;\n  max = sqrt(a);\n  for (i = flag; i <= max; i++) {\n    if (a % i == 0) {\n      flag = i;\n      num++;\n      way(a / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "949", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid breakup(int, int);\nint sum;\nint main() {\n  int n, x, count = 0;\n  cin >> n;\n  while (count < n) {\n    sum = 0;\n    count++;\n    cin >> x;\n    if (x > 3)\n      breakup(x, 2);\n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\n\nvoid breakup(int x, int j) {\n  int i, p, m;\n  m = x;\n  p = sqrt((double)x);\n  for (i = j; i <= p; i++) {\n    if (m % i == 0) {\n      sum++;\n      x = m / i;\n      breakup(x, i);\n    }\n  }\n  return;\n}\n"}
{"label": "1", "index": "950", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint dfs(int k, int b) {\n  int ret = (k == 1), i;\n  for (i = b; i <= k; i++)\n    if (k % i == 0)\n      ret += dfs(k / i, i);\n  return ret;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n\n    cin >> k;\n    cout << dfs(k, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Divide(int a, int b);\nint main() {\n  int Times = 0;\n  int Num = 0;\n  int i = 0;\n  int Temp[100] = {0};\n  cin >> Times;\n  for (i = 0; i < Times; i++) {\n    cin >> Num;\n    Temp[i] = Divide(Num, Num);\n  }\n  for (i = 0; i < Times; i++) {\n    cout << Temp[i] << endl;\n  }\n  return 0;\n}\n\nint Divide(int a, int b) {\n  int Sum = 0;\n  int i = 0;\n  int Flag = 0;\n  if (a != 1) {\n    for (i = b; i > 1; i--) {\n      if (a % i == 0)\n        Sum += Divide(a / i, i);\n      Flag = 1;\n    }\n  }\n  if (Flag == 0 || a == 1) {\n    Sum = 1;\n  }\n  return Sum;\n}\n"}
{"label": "1", "index": "952", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fact(int a, int min) {\n  if (a < min)\n    return 0;\n  int way = 1;\n  for (int i = min; i <= sqrt((double)a); i++)\n    if (a % i == 0)\n      way += fact(a / i, i);\n  return way;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int c;\n    cin >> c;\n    cout << fact(c, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p(int x) {\n  int i;\n  for (i = 2; i <= sqrt(x); i++)\n    if (x % i == 0)\n      return (0);\n  return (1);\n}\nint f(int n, int m) {\n  int t, i;\n  if (n < m)\n    return (0);\n  else if (p(n) == 1)\n    return (1);\n  else if (m == 1) {\n    t = 1;\n    for (i = m + 1; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  } else if (m != 1) {\n    t = 1;\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  }\n  return (t);\n}\nint main() {\n  int x, y, z, j;\n  scanf(\"%d\", &y);\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &x);\n    printf(\"%d \", f(x, 1));\n  }\n}\n"}
{"label": "1", "index": "954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint decompose(int x, int y);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int j = 1; j <= n; j++) {\n    scanf(\"%d \", &m);\n    cout << decompose(m, 2) << endl;\n  }\n  return 0;\n}\nint decompose(int x, int y) {\n  int sum = 1, b;\n  b = (int)sqrt(x);\n  if (x == 1)\n    return 0;\n  for (int i = y; i <= b; i++) {\n    if (x % i == 0) {\n      sum = sum + decompose(x / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      sum += f(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1, j = 2;\nvoid num(int);\nint main() {\n  int n, a[100];\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    num(a[i]);\n    printf(\"%d\\n\", sum);\n    sum = 1, j = 2;\n  }\n  return 0;\n}\nvoid num(int a) {\n  int k;\n  for (k = j; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      sum = sum + 1;\n      j = k;\n      num(a / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "957", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int);\nint g_count, g_j;\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    g_count = 0;\n    g_j = 2;\n    cin >> a;\n    printf(\"%d\\n\", sum(a) + 1);\n  }\n  return 0;\n}\nint sum(int a) {\n  int i, b;\n  b = (int)sqrt((double)a);\n  for (i = g_j; i <= b; i++) {\n    if (a % i == 0) {\n      g_j = i;\n      g_count++;\n      sum(a / i);\n    }\n  }\n  return g_count;\n}\n"}
{"label": "1", "index": "958", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint s(int a, int b) {\n  int sum = 0, z = 0;\n  if (a != 1 && b <= a) {\n    for (int i = b; i <= a; ++i) {\n      if (a % i == 0) {\n        sum += s(a / i, i);\n        z = 1;\n      }\n    }\n\n  } else if (a == 1)\n    return 1;\n\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; ++i) {\n    scanf(\"%d \", &a);\n    printf(\"%d\\n\", s(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint division(int m, int k) {\n  int num = 0;\n  if (m >= k) {\n    for (int i = k; i <= m; i++) {\n      if (m == i)\n        num++;\n      else if (m % i == 0)\n        num += division(m / i, i);\n    }\n  }\n  return num;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    cout << division(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int N;\n  cin >> N;\n  int i;\n  for (i = 1; i <= N; i++) {\n\n    int a;\n    cin >> a;\n    cout << f(a, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int j;\n  int number = 1;\n  for (j = m; j <= (int)sqrt(n); j++) {\n    if (n % j == 0) {\n      number = number + f(n / j, j);\n    }\n  }\n  return number;\n}\n"}
{"label": "1", "index": "961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cc;\nvoid fen(int x, int h);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cc = 0;\n    int ff;\n    scanf(\"%d \", &ff);\n    fen(ff, 2);\n    printf(\"%d\\n\", cc);\n  }\n  return 0;\n}\nvoid fen(int x, int h) {\n  for (int i = 2; i <= x; i++) {\n    if ((x % i == 0) && (i >= h) && (i < x))\n      fen(x / i, i);\n    if ((x % i == 0) && (i >= h) && (i == x))\n      cc++;\n  }\n}\n"}
{"label": "1", "index": "962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0, z = 2;           \nvoid number(int x, int y) { \n  int i;\n  if (x == 1) {\n    s = s + 1;\n  } \n  for (i = y; i <= x; i++) {\n    if (x % i == 0) {\n      number(x / i, i);\n    } \n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    number(a, z);\n    cout << s << endl; \n    s = 0;             \n  }\n}\n"}
{"label": "1", "index": "963", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y);\nint main() {\n  int n, i, j, a, sum;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    sum = 0;\n    for (j = 1; j <= a; j++)\n      sum += f(a, j);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int i, num = 0;\n  if (y == 1)\n    return 0;\n  else {\n    if (x % y != 0)\n      return 0;\n    else if (x == y)\n      return 1;\n    else {\n      for (i = y; i >= 1; i--)\n        num += f(x / y, i);\n\n      return num;\n    }\n  }\n}\n"}
{"label": "1", "index": "964", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factorize(int m, int k) {\n  int c = 1;\n  if (m < 4)\n    return 1;\n  for (int i = k; i <= sqrt(m); i++)\n    if (!(m % i))\n      c += factorize(m / i, k > i ? k : i);\n  return c;\n}\nint main(int argc, char *argv[]) {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> m;\n    printf(\"%d\\n\", factorize(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int a, int b, int c) \n{\n  int sum = 0, j; \n  if (a > c)\n    return 0; \n  if (b == 1)\n    return 1;              \n  for (j = a; j <= c; j++) \n    if (c % j == 0)\n      sum = sum + num(j, b - 1, c / j);\n  return sum;\n}\nint main() {\n  int k, n, m, e = 0, i; \n  cin >> n;\n  while (e < n) {\n    cin >> m;\n    k = 0; \n    int f = m;\n    for (i = 2; i <= f; i++)\n      if (f % i == 0) {\n        k++;\n        f = f / i;\n        i = 1;\n      }\n    cout << num(1, k, m) << endl; \n    e++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int j) {\n  int sum = 1, i, s, p, k;\n  s = sqrt(n);\n  for (i = j; i <= s; i++) {\n    if (n % i == 0) {\n      p = n / i;\n      k = i;\n      sum = sum + divide(p, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k, m, p;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &m);\n    p = divide(m, 2);\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, a[32768], i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  for (i = 0; i <= n - 1; i++) {\n    cout << f(a[i], 2) + 1 << endl;\n  }\n  return 0;\n}\nint f(int a, int p) {\n  int i, sum = 0;\n  for (i = 2; i <= sqrt(a); i++) {\n    if (((double)a / i == a / i) && (i >= p)) {\n      p = i;\n      sum = sum + 1 + f(a / i, p);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid factor(int x, int limit);\nint result;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int input;\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &input);\n    result = 1;\n    factor(input, 2);\n    cout << result << \"\\n\";\n  }\n  return 0;\n}\nvoid factor(int x, int limit) {\n  int remainder;\n  if (x < limit) {\n    return;\n  }\n  for (int i = limit; i <= x; i++) {\n    remainder = x % i;\n    if (remainder == 0) {\n      if (x / i >= i) {\n        result++;\n        factor(x / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fun(int m, int n);\n  int n, i, sum;\n  scanf(\"%d\", &n);\n  int *p;\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    sum = fun(p[i], 1);\n    printf(\"%d\\n\", sum);\n  }\n  free(p);\n  return 0;\n}\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum = sum + fun(m / i, i);\n    }\n  } else {\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0)\n        sum = sum + fun(m / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", f(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int t, int k) {\n  int u = 1, i;\n  if (t > 2) {\n    for (i = k; i <= sqrt(t); i++) {\n      if (t % i == 0) {\n        u += f(t / i, i);\n      }\n    }\n    return u;\n  } else if (t == 2)\n    return 1;\n  else if (t == 1)\n    return 0;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d \", f(t, 2));\n  }\n}\n"}
{"label": "1", "index": "972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int x, int min) {\n  if (x < min)\n    return 0;\n  int r = 1;\n  for (int i = min; i < x / 2; i++) {\n    if (x % i == 0) {\n      r += f(x / i, i);\n    }\n  }\n  return r;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int x;\n    cin >> x;\n    cout << f(x, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint deal(int num, int p) {\n  int i, sum = 0;\n  if (num == 1)\n    return 1;\n  for (i = p; i <= num; ++i)\n    if (num % i == 0)\n      sum += deal(num / i, i);\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    cout << deal(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "974", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint su(int input) {\n  int ju = 1;\n  for (int i = 2; i < sqrt(input); i++) {\n    if (input % i == 0)\n      ju = 0;\n    break;\n  }\n  return ju;\n}\nint fenjie(int input, int k) {\n  int ret = 1;\n  for (int i = k; i <= sqrt(input); i++) {\n    if (input % i == 0) {\n      if (su(input / i) == 0)\n        ;\n      { ret = fenjie(input / i, i) + ret; }\n    }\n  }\n  return ret;\n}\nint main() {\n  int input, num, sol;\n  cin >> num;\n  while (num--) {\n    scanf(\"%d \", &input);\n    cout << fenjie(input, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nvoid divide(int n, int n2) {\n  int i, m1;\n  m1 = (int)sqrt((double)n);\n  for (i = n2; i <= m1; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 1;\n    scanf(\"%d \", &m);\n\n    divide(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s = 0;\nvoid f(int x, int y) {\n  int i, j, k;\n  if (x == 1)\n    s++;\n  else {\n    for (; y <= x; y++) {\n      if (x % y == 0) {\n        f(x / y, y);\n      }\n    }\n  }\n}\nint main() {\n  int n, k, q, j;\n  scanf(\"%d\", &q);\n  for (j = 0; j < q; j++) {\n    cin >> n;\n    f(n, 2);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint answer = 0;   \nint a = 2;        \nvoid f(int, int); \nint main()        \n{\n  int n = 0;\n  int i = 0;\n  int data[100] = {0};\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> data[i];\n  }\n  for (i = 0; i < n; i++) {\n    f(data[i], a);\n    cout << answer << endl;\n    answer = 0; \n  }\n}\nvoid f(int m, int n) \n{\n  int i = 0;\n  if (m == 1) \n  {\n    answer = answer + 1;\n  }\n  for (i = n; i <= m; i++) \n  {\n    if (m % i == 0) {\n      f(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factor(int n, int min) {\n  int result = 1, i;\n  if (n < min) {\n    return 0;\n  }\n  for (i = min; i < n; i++) {\n    if (n % i == 0) {\n      result = result + factor(n / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a[100000], b[100000];\n  scanf(\"%d\", &n);\n  for (int j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    b[j] = factor(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n, x, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    cout << Factorization(x, 2) + 1 << \"\\n\";\n  }\n  return 0;\n}\nint Factorization(int x, int y) {\n  int i;\n  int sum = 0;\n  if (x < 4)\n    return 0;\n  else {\n    for (i = y; i <= sqrt((double)x); i++)\n      if (x % i == 0)\n        sum += 1 + Factorization(x / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "980", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint DFS(int, int);\nint main() {\n  int q;\n  scanf(\"%d \", &q);\n  for (int i = 0; i < q; i++) {\n    int n;\n    int h = 0;\n    cin >> n;\n    cout << DFS(n, n) << endl;\n  }\n\n  return 0;\n}\nint DFS(int n, int p) {\n  int ans = 0;\n  if (n == 1)\n    return 1;\n  for (int i = 2; i <= p; i++) {\n    if (n % i == 0) {\n      ans = ans + DFS(n / i, i);\n    }\n  }\n  return ans;\n}\n"}
{"label": "1", "index": "981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid f(int x, int min) {\n  int p;\n  if (x == 1)\n    sum++;\n  else\n    for (p = min; p <= x; p++)\n      if (x % p == 0)\n        f(x / p, p);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> k;\n    for (j = 2; j <= k; j++)\n      if (k % j == 0)\n        f(k / j, j);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint varieties = 0, p;\nint dfs(int dep, int last, int k) \n{\n  if (k == 1) \n  {\n    varieties++; \n    return 0;\n  }\n  for (int i = last; i <= k; i++)\n    if (k % i == 0) \n    {\n      dfs(dep + 1, i, k / i);\n    }\n}\nint main() {\n  int i, n, t;\n  cin >> n; \n  int m[n]; \n  for (i = 0; i < n; i++) {\n    cin >> t;\n    dfs(0, 2, t);\n    m[i] = varieties;\n    varieties = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << m[i] << endl; \n  return 0;\n}\n"}
{"label": "1", "index": "983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int k) {\n  int t = 1, i;\n  if (k > x) {\n    return 0;\n  }\n  for (i = k; i < x; i++) {\n    if (x % i == 0) {\n      t = t + fenjie(x / i, i);\n    }\n  }\n  return t;\n}\nint main() {\n  int j, n, a[101];\n  cin >> n;\n  for (j = 0; j <= n - 1; j++) {\n    cin >> a[j];\n  }\n  for (j = 0; j <= n - 1; j++) {\n    printf(\"%d\", fenjie(a[j], 2));\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint number = 0;\nint l;\nvoid sort(int n) {\n  int i;\n  for (i = l; n / i >= i; i++) {\n    if (n % i == 0) {\n      l = i;\n      sort(n / i);\n      if (n / i == 1) {\n        number++;\n      }\n    }\n  }\n  number++;\n}\nint main() {\n  int n, m, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    l = 2;\n    number = 0;\n    cin >> m;\n    sort(m);\n    cout << number << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    int m;\n    cin >> m;\n    int f(int a, int min);\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\nint f(int a, int min) {\n  int i = min;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  while (i < a) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n    i++;\n  }\n  return result;\n}\n"}
{"label": "1", "index": "986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, n, sum = 0;\nvoid t(int m) {\n  int i;\n  for (i = m; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1) {\n        sum += 1;\n      } else\n        t(i);\n      a = a * i;\n    }\n  }\n}\n\nint main() {\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    cin >> a;\n    t(2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int N, int min) {\n  int s = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      s += f(N / i, i);\n  }\n  return s;\n}\n\nint main() {\n  int n, i, b = 2;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cout << f(a[i], b) << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "988", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint b, j, f[1010];\n\nvoid factorization(int x) {\n  int now, i;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= f[j]) {\n      f[++j] = i;\n      now = x / i;\n      if (now == 1) {\n        b++;\n      } else {\n        factorization(now);\n      }\n      j--;\n    }\n  }\n  return;\n}\nint main() {\n  int n, i, num;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    b = 0;\n    j = 0;\n    memset(f, 0, sizeof(f));\n    cin >> num;\n    factorization(num);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ys(int af, int bf) {\n  int s;\n  if (af < bf)\n    s = 0;\n  if (af == bf)\n    s = 1;\n  if (af > bf) {\n    s = 1;\n    for (int i = af / 2; i >= bf; i--) {\n      if (af % i == 0) {\n        s += ys(af / i, i);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int n;\n  cin >> n;\n  int p;\n  while (cin >> p) {\n    cout << ys(p, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0, t = 2;\nvoid detach(int n) {\n  int i;\n  int q = t;\n  if (n == 1)\n    num++;\n  else {\n    for (i = t; i <= n / 2; i++) {\n      if (n % i == 0) {\n        n = n / i;\n        t = i;\n        detach(n);\n        n = n * i;\n        t = q;\n      }\n    }\n    if (i > n / 2 && n >= t) {\n      n = 1;\n      detach(n);\n    }\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    detach(a);\n    printf(\"%d\\n\", num);\n    num = 0;\n    t = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int j);\nint main() {\n  int n, a, s, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    s = f(a, 2) + 1;\n    cout << s << endl;\n  }\n\n  return 0;\n}\nint f(int a, int j) {\n  int i, tem;\n  \n  int count = 0;\n  for (i = j; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      j = i;\n      \n      \n      \n      \n      \n      \n      if (a / i < j)\n        count += 1;\n      else\n        count += (f(a / i, j) + 1);\n      \n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  else {\n    for (; i <= x; i++)\n      if (x % i == 0)\n        f(x / i, i);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  while (n > 0) {\n\n    int x = 0, i, ans = 1;\n    cin >> x;\n    for (i = 2; i * i < x; i++) {\n      if (x % i == 0) {\n        sum = 0;\n        f(x / i, i);\n        ans += sum;\n      }\n    }\n    cout << ans << endl;\n    n--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s = 0, p = 1;\nvoid fenjie(int a, int b) {\n  int i;\n  if (a == 1)\n    s++;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0)\n      fenjie(a / i, i);\n  }\n  return;\n}\nint main() {\n  int n, i, j, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 2; j * j <= a[i]; j++) {\n      if (a[i] % j == 0) {\n        s = 0;\n        fenjie(a[i] / j, j);\n        p = p + s;\n      }\n    }\n    printf(\"%d\\n\", p);\n    p = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "994", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int k, int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d \", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(1, q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n  return 0;\n}\nint fff(int k, int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(k + 1, w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int i, int m);\nint sum;\nint main() {\n  int n, i, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 1;\n    scanf(\"%d\", &m);\n    f(2, m);\n    printf(\"%d\\n\", sum);\n  }\n}\nvoid f(int i, int m) {\n  int k, s;\n  s = (int)sqrt(m);\n  for (k = i; k <= s; k++) {\n    if (m % k == 0) {\n      sum++;\n      f(k, m / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "996", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint disintegerate(int a, int b) {\n  if (a == b || b == 1)\n    return 1;\n  if (a > b) {\n    return 0;\n  }\n  int ans = 0;\n  for (int i = a; i <= b; i++) {\n    if (b % i == 0)\n      ans = ans + disintegerate(i, b / i);\n  }\n  return ans;\n}\n\nint main() {\n  int Time;\n  cin >> Time;\n  while (Time > 0) {\n    int n;\n    cin >> n;\n    printf(\"%d\\n\", disintegerate(2, n));\n    Time--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid jisuan(int, int);\nint times, sum, i, n;\nint main() {\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    sum = 0;\n    cin >> n;\n    jisuan(n, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid jisuan(int n, int j) {\n  int i;\n  for (i = j; i <= n; i++) {\n    if (n > 1) {\n      if (n % i == 0) {\n        if (n % i != 0 && n > i)\n          sum++;\n        jisuan(n / i, i);\n      }\n    }\n    if (n == i) {\n      sum++;\n    }\n  }\n}\n"}
{"label": "1", "index": "998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int n, a[100], b[100], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = f(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid f(int k, int n) {\n  int i, flag = 0;\n  for (i = k; i <= n; i++) {\n    if (n % i == 0) {\n      f(i, n / i);\n      flag = 1;\n    }\n  }\n  if ((flag == 0 && k <= n) || n == 1)\n    num++;\n}\nint main() {\n  int i, n, m;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    f(2, n);\n    cout << num << endl;\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid fun(int m, int i); \nint num;\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    num = 0;\n    fun(a, 2);               \n    cout << num + 1 << endl; \n  }\n  return 0;\n}\nvoid fun(int m, int i) {\n  int k = sqrt(m);\n  for (i = i; i <= k; i++) {\n    if (m % i == 0) {\n      num++;\n      fun(m / i, i); \n    }\n  }\n}\n"}
{"label": "1", "index": "1001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int out[16], int a, int n, int m, int sheng, int b[2])\n\n{\n  int i;\n  for (i = m; i <= a / 2; i++) {\n    if (sheng % i == 0) {\n      out[n] = i;\n      int qiu = 1, k;\n      for (k = 0; k <= n; k++)\n        qiu = out[k] * qiu;\n      \n      if (qiu == a) {\n        b[0]++;\n        break;\n      }\n      if (qiu > a)\n        break;\n      else\n        fenjie(out, a, n + 1, i, sheng / i, b);\n    }\n  }\n  return 0;\n}\nint main() {\n  int hang = 0;\n  cin >> hang;\n  while (hang > 0) {\n    int a;\n    int b[2] = {0};\n    cin >> a;\n    int out[16] = {0};\n    fenjie(out, a, 0, 2, a, b);\n    cout << b[0] + 1 << endl;\n    hang--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1002", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint devide(int n, int m) {\n  if (n < m)\n    m = n;\n  if (n == 1) \n    return 1;\n  int sum = 0;\n  for (int i = m; i >= 2; i--) {\n    if (n % i == 0) {\n      sum = sum + devide(n / i, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  i = 0;\n  while (i < n) {\n    cin >> m;\n    cout << devide(m, m) << endl; \n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint g = 0;           \nvoid s(int n, int z) \n{\n  for (int i = 2; i <= sqrt(n); i++) \n  {\n    if (n % i == 0 && i >= z) {\n      g = g + 1;\n      s(n / i, i);\n    }\n  }\n}\nint main() \n{\n  int a, b;\n  cin >> a;        \n  while (cin >> b) \n  {\n    for (int j = 2; j <= sqrt(b); j++) \n    {\n      if (b % j == 0) {\n        g = g + 1;\n        s(b / j, j); \n      }\n    }\n    cout << g + 1 << endl; \n    g = 0;                 \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "1004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint j;\nint discharge(int x, int y) {\n  int a = 1;\n  for (int i = y; i <= (sqrt((double)x)); i++) {\n    if (x % i == 0) {\n      a = a + discharge(x / i, i);\n    }\n  }\n  return a;\n}\nint main() {\n  int n, x, r[100];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    cin >> x;\n    r[j] = discharge(x, 2);\n  }\n  for (j = 0; j < n - 1; j++)\n    cout << r[j] << endl;\n\n  cout << r[n - 1];\n  return 0;\n}\n"}
{"label": "1", "index": "1005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint total, p;\nvoid part(int y) {\n  int i2, up;\n  if (y == 1) {\n    return;\n  }\n  up = (int)sqrt(y);\n  for (i2 = 2; i2 <= up; i2++) {\n    if (p <= i2) {\n      if (y % i2 == 0) {\n        total++;\n        p = i2;\n        part(y / i2);\n        p = 0;\n      }\n    }\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    total = 0;\n    p = 0;\n    scanf(\"%d\", &a);\n    part(a);\n    printf(\"%d\\n\", total + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjieyinshi(int n, int m) \n{\n  int i = 0;\n  int sum = 1;\n  if (n < m)\n    return 0; \n  else {\n    for (i = m; i < n; i++)\n      if (n % i == 0)                  \n        sum += fenjieyinshi(n / i, i); \n    return sum;\n  }\n}\nint main() \n{          \n  int n = 0;\n  int i = 0;\n  int a = 0;\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> a; \n    if (a == 1)\n      cout << 1 << endl;\n    else\n      cout << fenjieyinshi(a, 2) << endl; \n  }\n  return 0;\n} \n"}
{"label": "1", "index": "1007", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint j;\nint discharge(int x, int y) {\n  int a = 1;\n  for (int i = y; i <= (sqrt((double)x)); i++) {\n    if (x % i == 0) {\n      a = a + discharge(x / i, i);\n    }\n  }\n  return a;\n}\nint main() {\n  int n, x, r[100];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d \", &x);\n    r[j] = discharge(x, 2);\n  }\n  for (j = 0; j < n - 1; j++) {\n    cout << r[j] << endl;\n  }\n  cout << r[n - 1];\n  return 0;\n}\n"}
{"label": "1", "index": "1008", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num0;\nint factor(int x, int y) {\n  int countn = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (int i = y; i <= sqrt(x); i++)\n    if (x % i == 0)\n      countn += factor(x / i, i);\n  return countn;\n}\nint main() {\n  int n, j;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> num0;\n    printf(\"%d\\n\", factor(num0, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint tot;\n\nvoid find(int m, int n) {\n  int i, j, k;\n  if (m == 1)\n    tot = tot + 1;\n  else {\n    for (i = n; i <= m; i++)\n      if (m % i == 0)\n        find(m / i, i);\n  }\n}\n\nint main() {\n  int i, j, k, m, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    tot = 0;\n    scanf(\"%d \", &m);\n    find(m, 2);\n    printf(\"%d\\n\", tot);\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "1010", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ispr(int t) {\n  int v = (int)sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++) {\n    if (t % i == 0)\n      return 0;\n  }\n  return 1;\n}\n\nint sum;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int j = 0; j < n; j++) {\n    int a;\n    scanf(\"%d \", &a);\n    if (ispr(a) == 1) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int res = 1;\n    for (int i = 2; i <= a / 2; i++) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res = res + sum;\n      }\n    }\n    printf(\"%d\\n\", res);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      result += factor(N / i, i);\n  }\n  return result;\n}\nint main() {\n  int n, m, j, re;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &m);\n    re = factor(m, 2);\n    cout << re << \"\\n\";\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "1", "index": "1012", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factorize(int m, int k) {\n  int c = 1; \n  if (m < 4)\n    return 1; \n  for (int i = k; i <= sqrt(m); i++)\n    if (!(m % i))\n      c += factorize(m / i, k > i ? k : i); \n  return c;                                 \n}\nint main(int argc, char *argv[]) {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    cin >> m;                        \n    cout << factorize(m, 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1013", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int n, int i) {\n  int sum = 0;\n  for (i; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      sum += f(n / i, i);\n    }\n  }\n  return sum + 1;\n}\nint main() {\n  int i0, n0;\n  scanf(\"%d \", &n0);\n  for (i0 = 0; i0 < n0; i0++) {\n    int n;\n    scanf(\"%d\", &n);\n    printf(\"%d \", f(n, 2));\n  }\n}\n"}
{"label": "1", "index": "1014", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, ans, a[20];\n\nvoid calc(int dep, int x) {\n  if (x == 1) {\n    ans++;\n    return;\n  }\n  for (int i = a[dep - 1]; i <= x; i++)\n    if (!(x % i)) {\n      a[dep] = i;\n      calc(dep + 1, x / i);\n    }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (a[0] = 2; n; n--) {\n    scanf(\"%d \", &m);\n    ans = 0;\n    calc(1, m);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fj(int a, int zs) {\n  int k, n, z;\n  n = 0;\n  z = 0;\n  for (k = zs; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      n = n + fj(a / k, k);\n      z = 1;\n    }\n  }\n  if (z == 0)\n    return 1;\n  else {\n    return n + 1;\n  }\n}\nint main() {\n  int m, i, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d\\n\", fj(t, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint answer = 0;\nvoid f(int n, int N) {\n  if (n < N)\n    N = n;\n  if (N == 1) {\n    answer++;\n    return;\n  }\n  while (N > 1) {\n    if (n % N == 0)\n      f(n / N, N);\n    N--;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    f(a, a);\n    cout << answer << endl;\n    answer = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1017", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, g, f;\nint divide(int chushu, int a) {\n  int i;\n  for (i = chushu; i <= a; i++) {\n    if (a % i == 0) {\n      f = a / i;\n      if (f > 1) {\n        g = i;\n        divide(g, f);\n      } else {\n        sum++;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int p = 0;\n  for (p = 0; p < n; p++) {\n    int b = 0, c = 2;\n    scanf(\"%d \", &b);\n    sum = 0;\n    cout << divide(c, b) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1018", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint chu(int i, int n);\nint main() {\n  int n, m, i, j;\n  int sum[100];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &m);\n    sum[i] = 0;\n    for (j = 2; j <= sqrt(m); j++) {\n      if (m % j == 0) {\n        sum[i] += chu(j, m / j);\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    printf(\"%d\\n\", sum[i] + 1);\n  }\n  return 0;\n}\nint chu(int i, int n) {\n  int j, m, t;\n  t = 1;\n  m = n;\n  for (j = i; j <= sqrt(m); j++) {\n    if (m % j == 0) {\n\n      t += chu(j, (m / j));\n    }\n  }\n  return t;\n}\n"}
{"label": "1", "index": "1019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m;\nint sum(int x, int y) {\n  int c, i;\n  if (x > sqrt(y))\n    c = 0;\n  else {\n    if (y % x == 0) {\n      for (i = x, c = 1; i <= (y / 2) + 1; i++) {\n        if ((y / x) % i == 0)\n          c = c + sum(i, (y / x));\n      }\n    } else\n      c = 0;\n  }\n  return (c);\n}\nint main() {\n  int i, k, j;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    k = 0;\n    scanf(\"%d\", &m);\n    for (i = 2; i <= (m / 2) + 1; i++)\n      k = k + sum(i, m);\n    printf(\"%d \", k + 1);\n  }\n}\n"}
{"label": "1", "index": "1020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num = 0;\nvoid asd(int i, int q) {\n  int j;\n  for (j = q; j > 1; j--) {\n    if (i % j != 0)\n      continue;\n    if (i == j)\n      num++;\n    else {\n      q = j;\n      asd(i / j, q);\n    }\n  }\n}\nint main() {\n  int n, o;\n  cin >> n;\n  for (o = 0; o < n; o++) {\n    num = 0;\n    int a;\n    cin >> a;\n    asd(a, a);\n    if (num == 1)\n      cout << 1 << endl;\n    else\n      cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1021", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int min) {\n  int i, method = 0;\n  if (n >= min)\n    method++;\n  for (i = min; i < n; i++) {\n    if (!(n % i))\n      method += divide(n / i, i);\n  }\n  return method;\n}\nint main() {\n  int number = 0, integer;\n  int i;\n  cin >> number;\n  for (i = 0; i < number; i++) {\n    cin >> integer;\n    printf(\"%d\\n\", divide(integer, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1022", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjieyinshi(int n, int m) {\n  int i = 0;\n  int sum = 1;\n  if (n < m)\n    return 0;\n  else {\n    for (i = m; i < n; i++)\n      if (n % i == 0)\n        sum += fenjieyinshi(n / i, i);\n    return sum;\n  }\n}\nint main() {\n  int n = 0;\n  int i = 0;\n  int a = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    if (a == 1)\n      cout << 1 << endl;\n    else\n      printf(\"%d\\n\", fenjieyinshi(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a;\nint res;\nint sum;\nvoid dfs(int cnt) {\n  if (cnt * sum == a) {\n    res++;\n    return;\n  }\n  if (cnt * sum < a) {\n    sum *= cnt;\n    int j = a / sum;\n    for (int i = cnt; i <= j; i++)\n      dfs(i);\n    sum /= cnt;\n    return;\n  }\n}\nint main() {\n  int nCases;\n  scanf(\"%d\", &nCases);\n  for (int i = 0; i < nCases; i++) {\n    cin >> a;\n    res = 0;\n    sum = 1;\n    for (int i = 2; i <= a; i++)\n      dfs(i);\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ans = 0;\nvoid work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return;\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0) {\n      work(p / i, i);\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    ans = 0;\n    int t;\n    scanf(\"%d\", &t);\n    work(t, 2);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s;\nvoid search(int a, int k) {\n  if (a == 0)\n    return;\n  if (a == 1) {\n    return;\n  }\n  for (int i = 2; i < a; i++) {\n    if (a % i == 0 && a / i >= i && i >= k && a / i >= k) {\n      s++;\n      search(a / i, i);\n    }\n  }\n  return;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    s = 1;\n    cin >> a;\n    search(a, 1);\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};\n\nint m, n, counter;\n\nvoid dfs(int m, int i) {\n\n  if (m == 1) {\n    ++counter;\n    return;\n  }\n  for (; i <= m; ++i) {\n    if (m % i == 0) {\n      dfs(m / i, i);\n    }\n  }\n}\n\nint main() {\n  int t, m;\n  cin >> t;\n  while (t--) {\n    counter = 0;\n    cin >> m;\n    dfs(m, 2);\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint f(int a, int b) {\n  int count = 0;\n  int k[32768] = {0};\n  if (a == 1)\n    return 1;\n  else {\n    int i, j;\n    for (i = min(a, b); i >= 2; i--) {\n      if (a % i == 0)\n        k[i] = i;\n    }\n    for (j = 0; j < 32768; j++) {\n      if (k[j] != 0) {\n        count = count + f(a / k[j], j);\n        k[j] = 0;\n      }\n    }\n    return count;\n  }\n}\nint main() {\n  int n, i, a, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    number = f(a, a);\n    cout << number << \" \";\n  }\n}\n"}
{"label": "1", "index": "1028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nvoid zhongshu(int qian, int a);\nint main() {\n  int n, i, j, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    zhongshu(2, a[i]);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid zhongshu(int qian, int a) {\n  int i, j, c;\n  if (a == 1) {\n    sum = sum + 1;\n    return;\n  }\n  for (i = qian; i <= a; i++) {\n    if (a % i == 0)\n      zhongshu(i, a / i);\n  }\n}\n"}
{"label": "1", "index": "1029", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint f(int a, int s) \n{\n  if (a <= s)\n    return 1;\n  int b = sqrt((float)a), flag = 0, sum = 1;\n  for (int i = s; i <= b; i++) {\n    if (a % i == 0) {\n      flag++;\n\n      sum = sum + f(a / i, i);\n    }\n  }\n  if (flag == 0)\n    return 1;\n  else\n    return sum;\n}\n\nint main() {\n  int a, n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1030", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid fenjie(int i, int a);\n\nint k = 1;\n\nint main() {\n  int n, m, a;\n\n  cin >> n;\n\n  for (m = 1; m <= n; m++) {\n    cin >> a;\n\n    fenjie(2, a);\n\n    cout << k << endl;\n\n    k = 1;\n  }\n\n  return 0;\n}\n\nvoid fenjie(int i, int a) {\n  for (; i <= sqrt(a); i++)\n    if (a % i == 0) {\n      k++;\n\n      fenjie(i, a / i);\n    }\n}\n"}
{"label": "1", "index": "1031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint prime(int n, int m) {\n  int i, total = 1;\n  if (n < m)\n    return 0;\n\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      total += prime(n / i, i);\n  }\n  return total;\n}\nint main() {\n  int n, b[2000], b0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b0);\n    b[i] = prime(b0, 2);\n  }\n  for (i = 0; i <= n - 2; i++)\n    printf(\"%d\\n\", b[i]);\n\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "1", "index": "1032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a, b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b[i] = f(a, 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, sum = 1;\n  if (x < y)\n    sum = 0;\n  else {\n    for (j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + f(x / j, j);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid f(int n, int d) {\n  int i;\n  if (n == 1)\n    t++;\n  else {\n    for (i = d; i <= n; i++) {\n      if (n % i == 0) {\n        f(n / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int number[100];\n  int n, i;\n  int result[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    f(number[i], 2);\n    result[i] = t;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int b, int min);\nint x = 1, m;\nint main() {\n  int a, n, b;\n  scanf(\"%d\", &n);\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &b);\n    m = b;\n    b = num(b, 2);\n    printf(\"%d\\n\", b);\n    x = 1;\n  }\n  return 0;\n}\n\nint num(int b, int min) {\n  int a, c;\n\n  for (a = min; a < b; a++) {\n    if ((b % a == 0) && (b / a >= a)) {\n      if (num(b / a, a) == 1)\n        x++;\n    }\n    if (a == m - 1)\n      return x;\n  }\n  return 1;\n}\n"}
{"label": "1", "index": "1035", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint f(int m, int n) { \n  int i, sum = 0;     \n  if (n == 1)\n    return 1;                       \n  for (sum = 0, i = m; i <= n; i++) \n    if (n % i == 0)\n      sum += f(i, n / i); \n  return sum;             \n}\nint main() {\n  int i, n, k; \n  for (i = 0, cin >> n; i < n; i++) {\n    cin >> k;                \n    cout << f(2, k) << endl; \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "1036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum += fun(m / i, i);\n    }\n  } else\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0) {\n        sum += fun(m / i, i);\n      }\n    }\n  return sum;\n}\nint main() {\n  int n, i, b;\n  int a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &b);\n    a[i] = fun(b, 1);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint function_1(int num, int k) {\n  int j;\n  int m = 0;\n  if (num > 1) {\n    for (j = k; j <= num; j++) {\n      if (num % j == 0) {\n        m = m + function_1(num / j, j);\n      }\n    }\n    return m;\n  } else\n    return 1;\n}\nint main() {\n  int i, j;\n  int n;\n  cin >> n;\n  int num[100];\n\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << function_1(num[i], 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, s = 1;\nvoid temp(int b, int k, int c) {\n  for (int i = k; i <= b; i++) {\n\n    if (b % i == 0) {\n      b = b / i;\n      s = s * i;\n      k = i;\n      if (s == c) {\n        m++;\n\n      } else\n\n        temp(b, k, c);\n      s = s / i;\n      b = b * i;\n    }\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    temp(a, 2, a);\n    cout << m << endl;\n    m = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint solutionNumber(int a, int k) {\n  int i;\n  if (a == 1)\n    return 1;\n  if (k > a)\n    return 0;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      return solutionNumber(a, i + 1) + solutionNumber(a / i, i);\n}\nint main() {\n  int n, a[101];\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    cout << solutionNumber(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a;\nint fj(int x, int y);\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << fj(a, 2) << endl;\n  }\n  return 0;\n}\nint fj(int x, int y) {\n  int xnumber = 1;\n  int i;\n  int b = sqrt(x);\n  if (x == 1)\n    return 0;\n  else\n    for (i = y; i <= b; i++) {\n      if (x % i == 0)\n        xnumber = xnumber + fj(x / i, i);\n    }\n  return xnumber;\n}\n"}
{"label": "1", "index": "1041", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, used[32770] = {0};\nvoid f(int n) {\n  for (int i = 2; i <= n; i++) {\n    if (n % i == 0 && used[i] == 0) {\n      if (i != 2) {\n        for (int j = 2; j <= i - 1; j++)\n          used[j] = 1;\n      }\n      if (n / i == 1) {\n        sum++;\n        break;\n      } else {\n        f(n / i);\n      }\n      memset(used, 0, sizeof(used));\n    }\n  }\n}\nint main() {\n  int m, a[100];\n  scanf(\"%d \", &m);\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n    if (a[i] == 1)\n      cout << 1 << endl;\n    else {\n      f(a[i]);\n      cout << sum << endl;\n      sum = 0;\n      memset(used, 0, sizeof(used));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1042", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 1;\nint sushu(int n) {\n  int i, sum = 0;\n  for (i = 1; i <= sqrt(n * 1.0); i++)\n    if (n % i == 0)\n      sum++;\n  if (sum == 1)\n    return 1;\n  else\n    return 0;\n}\nvoid fenjie(int i, int k) {\n  int mid, j;\n  mid = sqrt(k * 1.0);\n  for (j = i; j <= mid; j++) {\n    if (sushu(k))\n      break;\n    else {\n      if (k % j == 0) {\n        num++;\n        fenjie(j, k / j);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  int a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    fenjie(2, a[i]);\n    printf(\"%d\\n\", num);\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint i;\nint fenjie(int x, int t) {\n  int j;\n  if (x == 1 || x == 2)\n    return 1;\n  int s = 1;\n  for (j = t; j <= sqrt(x); j++) {\n    if (x % j == 0)\n      s += fenjie((x / j), j);\n  }\n  return s;\n}\n\nint main() {\n  int n, a[100], x, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = fenjie(x, 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint prime(int n) {\n  int i, judge = 1;\n  for (i = 2; i < n; i++) {\n    if (n % i == 0)\n      judge = 0;\n  }\n  return judge;\n}\nint function_1(int number, int x) {\n  int temp = 0, i, result = 0;\n  if (!prime(number)) {\n    for (i = x; i <= number; i++)\n      if (number % i == 0) {\n        x = i;\n        temp = number / i;\n        result += function_1(temp, x);\n      }\n  } else if ((number >= x || number == 1) && prime(number))\n    result = 1;\n  return result;\n}\nint main() {\n  int i, times, number;\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    cin >> number;\n    cout << function_1(number, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint reek(int i, int j) {\n  int k, g = 0;\n  for (k = j; k < i; k++) {\n    if ((i % k == 0) && (k != 1)) {\n      g = 1;\n      break;\n    } else\n      continue;\n  }\n  if (g == 0)\n    return 1;\n  else {\n    int num = 1;\n    for (k = j; k <= sqrt(i); k++) {\n      if ((i % k == 0) && (k != 1))\n        num += reek(i / k, k);\n      else\n        continue;\n    }\n    return num;\n  }\n}\nint main() {\n  int n, i, a[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[n];\n    cout << reek(a[n], 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i * i <= a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  while (n > 0) {\n    cin >> k;\n    printf(\"%d\\n\", f(k, 2));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1047", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    cout << f(a[i], 2) << endl;\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  for (m = p; m <= n; m++)\n    if (n % m == 0) {\n      if (m < n)\n        sum = sum + f(n / m, m);\n      if (m == n)\n        sum = sum + 1;\n    }\n  return sum;\n}\n"}
{"label": "1", "index": "1048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint next(int a, int b) {\n  if (a == 1)\n    return 1;\n  if (a < b)\n    return 0;\n  int sum = 0;\n  for (; b <= a; b = b + 1)\n    if (a % b == 0)\n      sum = sum + next(a / b, b);\n\n  return sum;\n}\nint main() {\n  int i, m;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i = i + 1) {\n    cin >> n;\n    printf(\"%d\\n\", next(n, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fib(int a, int e);\nint main() {\n  int n, b, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", fib(b, 2));\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\nint fib(int a, int e) {\n  int j, c, d;\n  c = 1;\n  if (a <= e)\n    return 1;\n  for (j = e; j <= sqrt(a); j++) {\n    if (a % j == 0) {\n      d = a / j;\n      c = c + fib(d, j);\n    }\n  }\n  return c;\n}\n"}
{"label": "1", "index": "1050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid f(int x, int y) {\n  int i = 0;\n  if (x >= y)\n    for (i = y; i <= x; i++) {\n      if (i == x)\n        count_1++;\n      if (x % i == 0)\n        f(x / i, i);\n    }\n}\nint main() {\n  int t;\n  int n, i, x, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d\", &x);\n    f(x, 2);\n    printf(\"%d \", count_1);\n  }\n}\n"}
{"label": "1", "index": "1051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b, j;\nint a[1000] = {0};\nvoid fjys(int);\nint main() {\n  int n, i, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    b = 0;\n    memset(a, 0, sizeof(a));\n    cin >> x;\n    fjys(x);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nvoid fjys(int x) {\n  int i, n1;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= a[j]) {\n      a[++j] = i;\n      n1 = x / i;\n      if (n1 == 1)\n        b++;\n      else\n        fjys(n1);\n\n      j--;\n    }\n  }\n  return;\n}\n"}
{"label": "1", "index": "1052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint d(int, int);\nint main() {\n  int i, n, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    cout << d(x, 2) << endl;\n  }\n  return 0;\n}\nint d(int x, int y) {\n  int j, num = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (j = y; j <= (int)sqrt((double)x); j++)\n    if (x % j == 0)\n      num += d(x / j, j);\n  return num;\n}\n"}
{"label": "1", "index": "1053", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint t = 1;\nvoid fen(int n, int i) {\n  for (i = i; i * i <= n; i++) {\n    if (n % i == 0) {\n      fen(n / i, i);\n      t++;\n    }\n  }\n}\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k--) {\n    int n;\n    cin >> n;\n    t = 1;\n    fen(n, 2);\n    cout << t << endl;\n  }\n}\n"}
{"label": "1", "index": "1054", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(int i, int a) {\n  int means = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      means += check(i, a / i);\n  }\n  return means;\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", check(2, a));\n  }\n}\n"}
{"label": "1", "index": "1055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid fun(int m, int n) {\n  if (m <= sqrt(n)) {\n    for (int a = m; a <= sqrt(n); a++) {\n      if (n % a == 0) {\n        count_1++;\n        fun(a, n / a);\n      } else\n        count_1 = count_1;\n    }\n  } else {\n    count_1 = count_1;\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    count_1 = 0;\n    int num;\n    scanf(\"%d\", &num);\n    for (int j = 2; j <= sqrt(num); j++) {\n      if (num % j == 0) {\n        count_1++;\n        fun(j, num / j);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n  }\n}\n"}
{"label": "1", "index": "1056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int a, int b) {\n  int i, sign = 0, k = 0;\n  if (a < b)\n    return 0;\n  else if (a == b)\n    return 1;\n  else {\n    for (i = 2; i <= a - 1; i++) {\n      if (a % i == 0)\n        sign = 1;\n    }\n    if (sign != 1)\n      return 1;\n    else {\n      for (i = b; i <= a; i++) {\n        if (a % i == 0)\n          k += fenjie(a / i, i);\n      }\n      k += 1;\n      return k;\n    }\n  }\n}\n\nint main() {\n  int n, a[100], i, k;\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d\", &k);\n    printf(\"%d\\n\", fenjie(k, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int k = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      k = k + f(a / i, i);\n    }\n  }\n  return (k);\n}\n\nint main() {\n  int f(int a, int min);\n  int j, n;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    b[j] = f(a[j], 2);\n    printf(\"%d\\n\", b[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1058", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nvoid devide(int a, int b) {\n  if (a == 1)\n    sum++;\n  else {\n    if (a >= b)\n      devide(a, b + 1);\n    if (a % b == 0)\n      devide(a / b, b);\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    devide(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1059", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int out[16], int a, int n, int m, int sheng, int b[2])\n\n{\n  int i;\n  for (i = m; i <= a / 2; i++) {\n    if (sheng % i == 0) {\n      out[n] = i;\n      int qiu = 1, k;\n      for (k = 0; k <= n; k++)\n        qiu = out[k] * qiu;\n\n      if (qiu == a) {\n        b[0]++;\n        break;\n      }\n      if (qiu > a)\n        break;\n      else {\n        fenjie(out, a, n + 1, i, sheng / i, b);\n      }\n    }\n  }\n  return 0;\n}\nint main() {\n  int hang = 0;\n  cin >> hang;\n  while (hang > 0) {\n    int a;\n    int b[2] = {0};\n    scanf(\"%d \", &a);\n    int out[16] = {0};\n    fenjie(out, a, 0, 2, a, b);\n    cout << b[0] + 1 << endl;\n    hang--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint count(int num, int m)\n\n{\n  if (num % m != 0)\n    return 0;\n\n  if (num == m)\n    return 1;\n  else {\n    int counter = 0;\n    for (int i = m; i <= num / m; i++) {\n      counter += count(num / m, i);\n    }\n    return counter;\n  }\n}\n\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int counter = 0;\n    cin >> num;\n    for (int i = 2; i <= num; i++)\n      counter += count(num, i);\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint j = 2;\n\nint kinds(int x) {\n  int sum = 1;\n  if (x == 1) {\n    return 0;\n  }\n  for (int i = j; i <= sqrt(x); i++)\n    if (x % i == 0) {\n      sum += kinds(x / i);\n      j = i + 1;\n    }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int x = 0;\n    scanf(\"%d \", &x);\n    cout << kinds(x) << endl;\n    j = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1062", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid count(int, int);\nint k;\n\nint main() {\n  int n, i, j, m;\n  int num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    cin >> num;\n    m = sqrt(num) + 1;\n    for (j = 2; j < m; j++)\n      if (num % j == 0) {\n        k++;\n        count(num / j, j);\n      }\n    printf(\"%d\\n\", k + 1);\n  }\n  return 0;\n}\nvoid count(int num, int i) {\n  int j;\n  int n = sqrt(num);\n  for (j = i; j <= n; j++) {\n    if (num % j == 0) {\n      k++;\n      count((num / j), j);\n    }\n  }\n}\n"}
{"label": "1", "index": "1063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ans = 0;\nint work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return (p * k, k);\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0)\n      work(p / i, i);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    ans = 0;\n    int t;\n    scanf(\"%d\", &t);\n    work(t, 2);\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid TRY(int, int);\nint num = 1;\nint main() {\n  unsigned short int n;\n  int INTEGER;\n  cin >> n;\n  while (n-- > 0) {\n    cin >> INTEGER;\n    int h = 2;\n    TRY(h, INTEGER);\n    cout << num << \"\\n\";\n    num = 1;\n  }\n}\nvoid TRY(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if ((b % i == 0) && (b / i != 1)) {\n      num++;\n      TRY(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t, a, flag, a1;\n\nvoid find(int m, int min) {\n  int i;\n\n  for (i = 2; i <= sqrt((double)m); i++) {\n    if (m % i == 0) {\n      if (i >= min)\n\n      {\n        t++;\n\n        min = i;\n\n        find(m / i, min);\n      }\n    }\n  }\n\n  return;\n}\nint main() {\n  int n, ii;\n  cin >> n;\n  for (ii = 1; ii <= n; ii++) {\n    t = 0;\n    flag = 0;\n    cin >> a;\n\n    a1 = a;\n    find(a, 2);\n    cout << t + 1 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 2;\nint result = 0;\nvoid function_1(int, int);\nint main() {\n  int n = 0;\n  int data = 0;\n  int i = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> data;\n    function_1(data, a);\n    cout << result << endl;\n    result = 0;\n  }\n  return 0;\n}\nvoid function_1(int x, int y) {\n  int j = 0;\n  if (x == 1) {\n    result = result + 1;\n  }\n  for (j = y; j <= x; j++) {\n    if (x % j == 0) {\n      function_1(x / j, j);\n    }\n  }\n}\n"}
{"label": "1", "index": "1067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 1;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0) {\n      n += f(x / a, a);\n    }\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  scanf(\"%d\", &m);\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\\n\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint su[40000], b[10000], ans;\n\nvoid zhaosushu() {\n  int i, j, p;\n  for (i = 2; i < 32768; i++) {\n    p = 1;\n    for (j = 2; j <= sqrt(i); j++)\n      if (i % j == 0) {\n        p = 0;\n        break;\n      }\n    if (p == 0)\n      continue;\n    su[p] = 1;\n  }\n}\n\nvoid resolve(int a, int x) {\n  int i;\n  if (a == 1 || (su[a] == 1 && a >= b[x - 1])) {\n    ans++;\n    return;\n  }\n  for (i = 2; i <= a; i++)\n    if (a % i == 0 && i >= b[x - 1]) {\n      b[x] = i;\n      resolve(a / i, x + 1);\n      b[x] = 0;\n    }\n}\n\nint main() {\n  int n, i, a;\n  memset(su, 0, sizeof(su));\n  zhaosushu();\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    ans = 0;\n    memset(b, 0, sizeof(b));\n    resolve(a, 1);\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1069", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0, o;\nvoid f(int i, int in) {\n  int j;\n  for (j = i; j < (in + 1); j++) {\n    if (j * (in / j) == in) {\n\n      o = in / j;\n\n      f(j, in / j);\n      o = o * j;\n    }\n  }\n  if (o == 1) {\n    num = num + 1;\n  }\n}\nint main() {\n  int t;\n  cin >> t;\n  int i;\n  int in;\n  for (i = 0; i < t; i++) {\n    cin >> in;\n    f(2, in);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1070", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int k, int l);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", fenjie(a, 2));\n  }\n  return 0;\n}\n\nint fenjie(int k, int l) {\n  int num = 1, d, e;\n  if (k < l) {\n    return 0;\n  }\n  d = (int)(sqrt((double)k));\n  for (e = l; e <= d; e++) {\n    if (k % e == 0) {\n      num += fenjie(k / e, e);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1071", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int a, int i) {\n  int ret = 1;\n  for (; i <= sqrt((float)a); i++) {\n    if (a % i == 0)\n      ret += sum(a / i, i);\n  }\n  return ret;\n}\nint main() {\n  int t, a, j;\n  cin >> t;\n\n  for (j = 0; j < t; j++) {\n    scanf(\"%d \", &a);\n    cout << sum(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint number = 0;\nint l;\nvoid sort(int n) {\n  int i;\n  for (i = l; n / i >= i; i++) {\n    if (n % i == 0) {\n      l = i;\n      sort(n / i);\n      if (n / i == 1) {\n        number++;\n      }\n    }\n  }\n  number++;\n}\nint main() {\n  int n, m, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    l = 2;\n    number = 0;\n    cin >> m;\n    sort(m);\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zy(int a, int b);\n  int j, n, m, sum;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d\", &m);\n    sum = zy(2, m);\n    printf(\"%d\\n\", sum);\n  }\n}\nint zy(int a, int b) {\n  int i, c;\n  c = 0;\n  if (a == 0)\n    c = c + 1;\n  else {\n    for (i = a; i * i <= b; i++) {\n      if (b % i == 0)\n        c = zy(i, (b / i)) + c;\n    }\n    if (i * i > b)\n      c = c + 1;\n  }\n  return (c);\n}\n"}
{"label": "1", "index": "1074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int, int);\n\nint main() {\n  int times, k, num;\n  scanf(\"%d \", &times);\n  for (k = 1; k <= times; k++) {\n    cin >> num;\n    printf(\"%d\\n\", fenjie(num, 1));\n  }\n\n  return 0;\n}\n\nint fenjie(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + fenjie(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n"}
{"label": "1", "index": "1075", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y);\nint main() {\n  int n, i, j, a, sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    sum = 0;\n    for (j = 1; j <= a; j++)\n      sum += f(a, j);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int i, num = 0;\n  if (y == 1)\n    return 0;\n  else {\n    if (x % y != 0)\n      return 0;\n    else if (x == y)\n      return 1;\n    else {\n      for (i = y; i >= 1; i--)\n        num += f(x / y, i);\n\n      return num;\n    }\n  }\n}\n"}
{"label": "1", "index": "1076", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if (y == x)\n    return 1;\n  if (y > x)\n    return 0;\n  if (x % y == 0)\n    return f(x, y + 1) + f(x / y, y);\n  else\n    return f(x, y + 1);\n}\nint main() {\n  int n, x;\n  scanf(\"%d \", &n);\n  int z, i;\n  i = n;\n  while (i > 0) {\n    i = i - 1;\n    scanf(\"%d \", &x);\n    z = f(x, 2);\n    cout << z << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1077", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint DFS(int, int);\nint main() {\n  int q;\n  scanf(\"%d \", &q);\n  for (int i = 0; i < q; i++) {\n    int n;\n    int h = 0;\n    cin >> n;\n    cout << DFS(n, n) << endl;\n  }\n\n  return 0;\n}\nint DFS(int n, int p) {\n  int ans = 0;\n  if (n == 1)\n    return 1;\n  for (int i = 2; i <= p; i++) {\n    if (n % i == 0) {\n      ans = ans + DFS(n / i, i);\n    }\n  }\n  return ans;\n}\n"}
{"label": "1", "index": "1078", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid f(int n, int d) {\n  int i;\n  if (n == 1)\n    t++;\n  else {\n    for (i = d; i <= n; i++) {\n      if (n % i == 0) {\n        f(n / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int number[100];\n  int n, i;\n  int result[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    f(number[i], 2);\n    result[i] = t;\n  }\n  for (i = 0; i < n; i++) {\n    cout << result[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n, x, i, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", Factorization(x, 2) + 1);\n  }\n  return 0;\n}\nint Factorization(int x, int y) {\n  int i;\n  int sum = 0;\n  if (x < 4)\n    return 0;\n  else {\n    for (i = y; i <= sqrt((double)x); i++)\n      if (x % i == 0)\n        sum += 1 + Factorization(x / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minf(int p, int min);\nint main() {\n  int n, i, k, p, zs[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p);\n    \n    \n    zs[i] = minf(p, 2);\n    \n    \n    \n    zs[i]++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d\\n\", zs[i]);\n  }\n  printf(\"%d\", zs[n - 1]);\n  \n  return 0;\n}\nint minf(int p, int min) {\n  int x = 0, i;\n  i = min;\n  for (i; i <= (int)sqrt(p); i++) {\n    if (p % i == 0) {\n      x += minf(p / i, i) + 1;\n    }\n  }\n\n  return x;\n}\n"}
{"label": "1", "index": "1081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int max) {\n  int i = 0;\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = max; i >= 2; i--) {\n    if ((a % i) == 0)\n      sum += fenjie(a / i, i);\n  }\n  return sum;\n}\n\nint main() {\n  int k = 0;\n  int n = 0;\n  int num = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d \", &num);\n    cout << fenjie(num, num);\n    if (k < n)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int a, int b) {\n  int i, r;\n  r = 1;\n  for (i = b; i < a; i++) {\n    if (((a / i) * i) == a && (a / i) >= i)\n      r = r + divide(a / i, i);\n  }\n  return r;\n}\nint main() {\n  int s, p, n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &p);\n    s = divide(p, 2);\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "1", "index": "1083", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int b, int a) {\n  for (int i = b; i <= a; i++) {\n    if ((a % i == 0) && (i <= a / i)) {\n      sum = sum + 1;\n      f(i, a / i);\n    }\n    if (i > a / i)\n      break;\n  }\n}\nint main() {\n  int a, n;\n  cin >> n;\n  while (n > 0) {\n    cin >> a;\n    sum = 1;\n    f(2, a);\n    printf(\"%d\\n\", sum);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nint dg(int m, int limit);\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    int m;\n    scanf(\"%d \", &m);\n    num = 0;\n    dg(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\nint dg(int m, int limit) {\n  for (int i = limit; i <= m / 2; i++)\n    if (m % i == 0)\n      dg(m / i, i);\n  if (m >= limit)\n    num++;\n  return 0;\n}\n"}
{"label": "1", "index": "1085", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g(int x, int j) {\n  for (j++; j <= x; j++) {\n    if (x == j)\n      return 1;\n    if (x % j == 0 && x / j >= j)\n      return g(x / j, j - 1) + g(x, j);\n  }\n  return 0;\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", g(a, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1086", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m = 2;\nint manners(int a) {\n  int count = 1, t = 0;\n  t = sqrt((double)a);\n  for (int i = m; i <= t; i++) {\n    if (a % i == 0) {\n      m = i;\n      count = count + manners(a / i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n, b;\n  int i = 1;\n  cin >> n;\n  while (i <= n) {\n    cin >> b;\n    printf(\"%d\\n\", manners(b));\n    m = 2;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1087", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct node {\n  int s, n;\n};\nvoid cpy_clr(struct node a[], struct node b[]) {\n  int i;\n  for (i = 0; i <= 1000 && (a[i].s != 0 || b[i].s != 0); i++)\n    if (b[i].s != 0) {\n      a[i].s = b[i].s;\n      a[i].n = b[i].n;\n      b[i].s = 0;\n      b[i].n = 0;\n    } else {\n      a[i].s = 0;\n      a[i].n = 0;\n      b[i].n = 0;\n    }\n}\nint chklst(struct node a[], int n) {\n  int i;\n  int result = 0;\n  for (i = 0; a[i].s != 0; i++) {\n    if (a[i].s != n) {\n      result = 0;\n      break;\n    } else\n      result++;\n  }\n  return result;\n}\nvoid init(struct node a[]) {\n  int i;\n  for (i = 0; i < 1000; i++) {\n    a[i].s = 0;\n    a[i].n = 0;\n  }\n}\nint main() {\n  struct node a[1000], b[1000];\n  int i, j, k, l, _n, n, sum = 0;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &_n);\n    for (l = 2; l < _n; l++)\n      if (_n % l == 0) {\n        init(a);\n        init(b);\n        a[0].s = l;\n        a[0].n = l;\n        while (chklst(a, _n) == 0 && a[0].s != 0) {\n          i = 0;\n          k = -1;\n          if (a[0].s == 0)\n            break;\n          while (a[i].s != 0) {\n            if (a[i].s == _n)\n              sum++;\n            else {\n              for (j = a[i].n; j <= (_n / a[i].s); j++)\n                if (_n % (a[i].s * j) == 0) {\n                  b[++k].s = a[i].s * j;\n                  b[k].n = j;\n                }\n            }\n            i++;\n          }\n          cpy_clr(a, b);\n        }\n        i = 0;\n        while (a[i].s != 0) {\n          if (a[i].s == _n)\n            sum++;\n          i++;\n        }\n      }\n    printf(\"%d \", ++sum);\n    sum = 0;\n  }\n}\n"}
{"label": "1", "index": "1088", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint g(int x, int j) {\n  for (j++; j <= x; j++) {\n    if (x == j)\n      return 1;\n    if (x % j == 0 && x / j >= j)\n      return g(x / j, j - 1) + g(x, j);\n  }\n  return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << g(a, 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1089", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t, a, flag, a1;\n\nvoid find(int m, int min) {\n  int i;\n\n  for (i = 2; i <= sqrt((double)m); i++) {\n    if (m % i == 0) {\n      if (i >= min)\n\n      {\n        t++;\n\n        min = i;\n\n        find(m / i, min);\n      }\n    }\n  }\n\n  return;\n}\nint main() {\n  int n, ii;\n  cin >> n;\n  for (ii = 1; ii <= n; ii++) {\n    t = 0;\n    flag = 0;\n    cin >> a;\n\n    a1 = a;\n    find(a, 2);\n    printf(\"%d\\n\", t + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1090", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nvoid divide(int a, int k) {\n  int i;\n  if (a == 1)\n    num++;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      divide(a / i, i);\n}\n\nint main() {\n  int t;\n  cin >> t;\n  while (t--) {\n    int n;\n    cin >> n;\n    num = 1;\n    int i;\n    for (i = 2; i * i <= n; i++)\n      if (n % i == 0)\n        divide(n / i, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1, j = 2;\nvoid num(int);\nint main() {\n  int n, a[100];\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    num(a[i]);\n    printf(\"%d\\n\", sum);\n    sum = 1, j = 2;\n  }\n  return 0;\n}\nvoid num(int a) {\n  int k;\n  for (k = j; k <= sqrt(a); k++) {\n    if (a % k == 0) {\n      sum = sum + 1;\n      j = k;\n      num(a / k);\n    }\n  }\n}\n"}
{"label": "1", "index": "1092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint count_1;\n\nvoid fun(int i, int j) {\n  int k;\n  for (k = i; k <= sqrt(j); k++) {\n    if (j % k == 0) {\n      count_1++;\n      fun(k, j / k);\n    }\n  }\n}\nint main() {\n  int turn, c;\n  scanf(\"%d\", &turn);\n  for (c = 1; c <= turn; c++) {\n    int n, i;\n    scanf(\"%d\", &n);\n    for (i = 2; i <= sqrt(n); i++) {\n      if (n % i == 0) {\n        count_1++;\n        fun(i, n / i);\n      }\n    }\n    cout << count_1 + 1 << \" \";\n    count_1 = 0;\n  }\n}\n"}
{"label": "1", "index": "1093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factors(int n, int min) {\n  int varieties = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0) {\n        varieties += factors(n / i, i);\n      }\n    }\n  }\n  return varieties;\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n], b[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = factors(a[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint c;\nvoid cal(int n, int k);\nint main(int argc) {\n  int m, n, j;\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    c = 0;\n    cal(n, 1);\n    printf(\"%d\\n\", c);\n  }\n\n  return 0;\n}\nvoid cal(int n, int k) {\n  if (n == 1) {\n    c++;\n    return;\n  }\n  int i;\n  for (i = 2; i <= n; i++) {\n    if (n % i == 0 && i >= k) {\n      cal(n / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint times;\nvoid fenjie(int m, int k) {\n  int i;\n  {\n    for (i = k; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        fenjie(m / i, i);\n    }\n  }\n  times++;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int m;\n    times = 0;\n    cin >> m;\n    fenjie(m, 2);\n    cout << times << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1096", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fjys(int x, int y) {\n  if (x < y)\n    return 0;\n  int i, n = 1;\n  for (i = y; i < x; i++) {\n    if (x % i == 0) {\n      n += fjys(x / i, i);\n    }\n  }\n  return n;\n}\nint main() {\n  int n, a[100];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << fjys(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1097", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint N, A;\n\nint acSearch(int n, int i) {\n  int ret = 0;\n\n  if (n == 1)\n    ret = 1;\n  else\n    for (; i <= n; ++i)\n      if (n % i == 0)\n        ret += acSearch(n / i, i);\n\n  return ret;\n}\n\nint main() {\n  scanf(\"%d\", &N);\n  for (; N--;) {\n    scanf(\"%d\", &A);\n    printf(\"%d\\n\", acSearch(A, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1098", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint factorize(int a, int b) {\n  int factor, i;\n  if (a == 1)\n    factor = 1;\n  if (a != 1)\n    factor = 0;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      factor = factor + factorize(a / i, i);\n  return factor;\n}\nint main() {\n  int n, a;\n  for (cin >> n; n--; cout << factorize(a, 2) << endl) {\n    cin >> a;\n  }\n}\n"}
{"label": "1", "index": "1099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint F(int n, int a) {\n  if (n == 1)\n    return 1;\n  if (a == 1)\n    return 0;\n  if (n % a == 0)\n    return F(n / a, a) + F(n, a - 1);\n  return F(n, a - 1);\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    cout << F(a, a) << \" \";\n  }\n}\n"}
{"label": "1", "index": "1100", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint work(int m, int n) {\n  if (m == n)\n    return 1;\n  if (m % n != 0)\n    return 0;\n  int sum = 0;\n  for (int i = n; i <= m / n; i++)\n    sum += work(m / n, i);\n  return sum;\n}\nint main() {\n  int n, m, a;\n  cin >> n;\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    int s = 0;\n    for (j = 2; j <= m; j++) {\n      s += work(m, j);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint turn(int a, int b) {\n  int i, k;\n  if (a == 1)\n    k = 1;\n  else if (a < b)\n    k = 0;\n  else {\n    k = 0;\n    for (i = b; i <= a; i++)\n      if (a % i == 0)\n        k = k + turn(a / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i, a[1000], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    t = turn(a[i], 2);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint c = 1;\n\nvoid fenjie(int a, int k) {\n  if (a == 1) {\n    c++;\n    return;\n  }\n  for (int i = k; i <= a; i++) {\n    if (a % i == 0) {\n      fenjie(a / i, i);\n    }\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (n--) {\n    c = 0;\n    scanf(\"%d \", &a);\n    fenjie(a, 2);\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int, int);\n\nint fenjie(int q1, int n1) {\n  int s1, i1;\n  if (q1 > n1)\n    return 0;\n  else {\n    s1 = 0;\n    for (i1 = q1; i1 <= n1; i1++) {\n      if ((i1 >= 2) && (n1 % i1 == 0) && (n1 / i1 >= i1)) {\n        s1++;\n        s1 = s1 + fenjie(i1, n1 / i1);\n      }\n    }\n    return s1;\n  }\n}\n\nint main() {\n  int m, i, n;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    cout << fenjie(1, n) + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1104", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fen(int x, int y);\n\nint main() {\n  int n, i, m[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    printf(\"%d\\n\", fen(m[i], 2));\n  }\n  return 0;\n}\n\nint fen(int x, int y) {\n  int j;\n  int result = 1;\n  if (x < y)\n    return 0;\n  for (j = y; j < x; j++) {\n    if (x % j == 0)\n      result += fen(x / j, j);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1105", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid FenJie(int);\nint counter = 0;\nint Befor = 0;\nint main() {\n  int n, x, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    counter = 0;\n    Befor = x;\n    FenJie(x);\n    cout << counter << endl;\n  }\n  return 0;\n}\nvoid FenJie(int x) {\n  int i, temp = Befor; \n  if (x == 1) {\n    counter++;\n    return;\n  }\n  for (i = Befor; i > 1; i--) \n  {\n    if (x % i == 0) {\n      Befor = i;\n      FenJie(x / i);\n    }\n    Befor = temp;\n  }\n  return;\n}\n"}
{"label": "1", "index": "1106", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b, j;\nint a[1000] = {0};\nvoid fjys(int);\nint main() {\n  int n, i, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    b = 0;\n    memset(a, 0, sizeof(a));\n    scanf(\"%d \", &x);\n    fjys(x);\n    cout << b << endl;\n  }\n  return 0;\n}\n\nvoid fjys(int x) {\n  int i, n1;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= a[j]) {\n      a[++j] = i;\n      n1 = x / i;\n      if (n1 == 1) {\n        b++;\n      } else {\n        fjys(n1);\n      }\n      j--;\n    }\n  }\n  return;\n}\n"}
{"label": "1", "index": "1107", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int m, int l) {\n  int re = 0, j;\n  if (l == 4)\n    re = 1;\n  if (l > 4) {\n    for (j = m; j <= sqrt(l); j++) {\n      if (l % j == 0) {\n        re = re + 1 + f(j, l / j);\n      }\n    }\n  }\n  return re;\n}\nint main() {\n  int n, i, a[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", (f(2, a[i]) + 1));\n  }\n}\n"}
{"label": "1", "index": "1108", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint f(int a, int b) {\n  int count = 0;\n  int k[32768] = {0};\n  if (a == 1)\n    return 1;\n  else {\n    int i, j;\n    for (i = min(a, b); i >= 2; i--) {\n      if (a % i == 0)\n        k[i] = i;\n    }\n    for (j = 0; j < 32768; j++) {\n      if (k[j] != 0) {\n        count = count + f(a / k[j], j);\n        k[j] = 0;\n      }\n    }\n    return count;\n  }\n}\nint main() {\n  int n, i, a, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    number = f(a, a);\n    printf(\"%d \", number);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1109", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ct;\nint count(int n, int p) {\n  int i;\n  if (n == 1)\n    ct++;\n  for (i = p; i <= n; i++)\n    if (n % i == 0)\n      count(n / i, i);\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    ct = 0;\n    cin >> n;\n    count(n, 2);\n    cout << ct << endl;\n  }\n}\n"}
{"label": "1", "index": "1110", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a;\nint m = 0, s = 1;\nvoid temp(int b, int k, int c) {\n  for (int i = k; i <= b; i++) {\n\n    if (b % i == 0) {\n      b = b / i;\n      s = s * i;\n      k = i;\n      if (s == c) {\n        m++;\n\n      } else\n\n      {\n        temp(b, k, c);\n      }\n      s = s / i;\n      b = b * i;\n    }\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    temp(a, 2, a);\n    cout << m << endl;\n    m = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int a, int b) {\n  int i, ways;\n  ways = 1;\n  if (a < b)\n    return 0;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      ways += factor(a / i, i);\n  }\n  return ways;\n}\n\nint main() {\n  int n, A[99], K[99], i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    K[i] = factor(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", K[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1112", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ways(int a, int min);\nint main() {\n  int n, a, i, sum = 0, k, min;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    for (k = 2; k <= a; k++) {\n      if (a % k == 0) {\n        min = k;\n        break;\n      }\n    }\n    if (a != min)\n      sum = ways(a, min);\n    else\n      sum = 1;\n    cout << sum << endl;\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += ways(a / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1113", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\nvoid divide(int n, int from) {\n\n  int i;\n  for (i = from; i < n; i++) {\n    if (n % i == 0) {\n      if (n / i < i) {\n        return;\n      }\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int numberToDivide;\n  for (i = 0; i < n; i++) {\n    cin >> numberToDivide;\n    num = 0;\n    divide(numberToDivide, 2);\n    cout << num + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint t = 0;\nint mini(\n    int k,\n    int i) \n{\n  if (k == 1)\n    t = t + 1;\n  for (; i <= k; i++) {\n    if (k % i == 0)\n      mini(k / i, i);\n  }\n  return 0;\n}\n\nint main() {\n  int N, n;\n  scanf(\"%d\", &N);\n  for (n = 0; n <= N - 1; n++) {\n    int M;\n    scanf(\"%d\", &M);\n    mini(M, 2);\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n}\n"}
{"label": "1", "index": "1115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint times;\nint move(int a, int num) {\n  int i;\n  if (num == 1)\n    times++;\n  for (i = 2; i <= num; i++)\n    if (num % i == 0 && i >= a)\n      move(i, num / i);\n  return times;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    times = 0;\n    b[i] = move(1, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "1116", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint multiply(int a, int b) {\n  int i = 0, n = 0, sum = 1;\n  if (a < b)\n    return 0;\n  else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        sum = sum + multiply(a / i, i);\n      }\n    }\n    return sum;\n  }\n}\nint main() {\n  int n = 0, m = 0, i = 0, sum = 0, num, result[1000];\n  cin >> n;\n  do {\n    cin >> num;\n    result[i] = multiply(num, 2);\n    i = i + 1;\n    m = m + 1;\n  } while (m < n);\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint totalCount;\n\nvoid FindFact(int x, int max) {\n  if (x == 1) {\n    totalCount++;\n    return;\n  }\n  for (int i = max; i > 1; i--)\n    if (x % i == 0)\n      FindFact(x / i, i);\n  return;\n}\n\nint main() {\n  int n, x;\n  for (scanf(\"%d \", &n); n > 0; n--) {\n    totalCount = 0;\n    cin >> x;\n    FindFact(x, x / 2);\n    cout << totalCount + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint sum(int x, int y) {\n  int c, i;\n  if (x > sqrt(y))\n    c = 0;\n  else {\n    if (y % x == 0) {\n      for (i = x, c = 1; i <= (y / 2) + 1; i++) {\n        if ((y / x) % i == 0)\n          c = c + sum(i, (y / x));\n      }\n    } else\n      c = 0;\n  }\n  return (c);\n}\nint main() {\n  int i, k, j;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    k = 0;\n    scanf(\"%d\", &m);\n    for (i = 2; i <= (m / 2) + 1; i++)\n      k = k + sum(i, m);\n    printf(\"%d \", k + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1119", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 1;\nint sushu(int n) {\n  int i, sum = 0;\n  for (i = 1; i <= sqrt(n * 1.0); i++)\n    if (n % i == 0)\n      sum++;\n  if (sum == 1)\n    return 1;\n  else\n    return 0;\n}\nvoid fenjie(int i, int k) {\n  int mid, j;\n  mid = sqrt(k * 1.0);\n  for (j = i; j <= mid; j++) {\n    if (sushu(k))\n      break;\n    else {\n      if (k % j == 0) {\n        num++;\n        fenjie(j, k / j);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  int a[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    fenjie(2, a[i]);\n    cout << num << endl;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int k);\nint main() {\n  int i = 1, n, m;\n  int result;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nint f(int x, int k) {\n  int a = 0;\n  int i;\n  if (x == 1)\n    return 1;\n  for (i = k; i <= x; i++) {\n    if (x % i == 0)\n      a = a + f(x / i, i);\n  }\n  return a;\n}\n"}
{"label": "1", "index": "1121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint wtf(int p, int a);\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << wtf(2, a) << \"\\n\";\n  }\n  return 0;\n}\n\nint wtf(int p, int a) {\n  int i, ways = 0, j = 0;\n  int m = (int)sqrt(a);\n  for (; p <= m; p++) {\n    if (a % p == 0 && a >= p * p) {\n      ways = ways + wtf(p, a / p);\n      j++;\n    }\n  }\n  if (j == 0)\n    return 1;\n  else\n    return ways + 1;\n}\n"}
{"label": "1", "index": "1122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid count(int, int);\nint k;\n\nint main() {\n  int n, i, j, m;\n  int num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    cin >> num;\n    m = sqrt(num) + 1;\n    for (j = 2; j < m; j++)\n      if (num % j == 0) {\n        k++;\n        count(num / j, j);\n      }\n    cout << k + 1 << endl;\n  }\n  return 0;\n}\nvoid count(int num, int i) {\n  int j;\n  int n = sqrt(num);\n  for (j = i; j <= n; j++) {\n    if (num % j == 0) {\n      k++;\n      count((num / j), j);\n    }\n  }\n}\n"}
{"label": "1", "index": "1123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cut(int m, int l) {\n  int sum = 1;\n  for (int i = l; i <= sqrt((double)m / l); i++) {\n    if ((m / l) % i == 0) {\n      sum += cut(m / l, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int t = 0;\n    cin >> t;\n    cout << cut(2 * t, 2);\n    if (i < n - 1)\n      cout << endl;\n  }\n}\n"}
{"label": "1", "index": "1124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint tru(int c) {\n  int j, p = 0;\n  if (c == 1 || c == 2)\n    return 1;\n  else\n    for (j = 2; j <= pow((double)c, 0.5); j++)\n      if (c % j == 0) {\n        p = 1;\n        break;\n      }\n  if (p == 1)\n    return 0;\n  else\n    return 1;\n}\nint count(int a, int b) {\n  int i, k = 1;\n  if (!tru(a))\n    for (i = b; i <= pow((double)a, 0.5); i++)\n      if (a % i == 0)\n        k = k + count(a / i, i);\n  return k;\n}\nint main() {\n  int n, x[999], q;\n  scanf(\"%d\", &n);\n  for (q = 0; q < n; q++)\n    scanf(\"%d\", &x[q]);\n  for (q = 0; q < n; q++)\n    cout << count(x[q], 2) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "1", "index": "1125", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fact(int a, int min) {\n  if (a < min)\n    return 0;\n  int way = 1;\n  for (int i = min; i <= sqrt((double)a); i++)\n    if (a % i == 0)\n      way += fact(a / i, i);\n  return way;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int c;\n    cin >> c;\n    cout << fact(c, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int k, int l);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    cout << fenjie(a, 2) << endl;\n  }\n  return 0;\n}\n\nint fenjie(int k, int l) {\n  int num = 1, d, e;\n  if (k < l) {\n    return 0;\n  }\n  d = (int)(sqrt((double)k));\n  for (e = l; e <= d; e++) {\n    if (k % e == 0) {\n      num += fenjie(k / e, e);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      f(n / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n\n  int t = 0;\n  scanf(\"%d \", &t);\n  while (t--) {\n    int n = 0;\n    cin >> n;\n    int i = 2, result = 1;\n\n    for (i = 2; i <= n / 2; i++) {\n      if (n % i == 0) {\n        sum = 0;\n        f(n / i, i);\n        result = result + sum;\n      }\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1128", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num, t, yin[50];\nvoid dd(int n, int a, int d, int m) {\n  int i;\n  if (d == m) {\n    t++;\n    return;\n  }\n  for (i = a; i < num; i++) {\n    if (n / yin[i] >= yin[i] && n % yin[i] == 0) {\n      dd(n / yin[i], i, d + 1, m);\n    }\n  }\n}\nvoid q_ys(int n) {\n  int i;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0) {\n      num++;\n      yin[num] = i;\n    }\n  return;\n}\nint m_ys(int n) {\n  int i;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      return i;\n  }\n  return 1;\n}\nvoid output(int y) {\n  int k = 1, i, x;\n  x = y;\n  t = 1, num = 0, memset(yin, 0, sizeof(yin));\n  q_ys(x);\n  while (m_ys(x) != 1) {\n    k++;\n    x = x / m_ys(x);\n  }\n  for (i = 2; i <= k; i++)\n    dd(y, 1, 1, i);\n  cout << t << endl;\n}\nint main() {\n  int n, i, a[1000];\n  t = 0, num = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    output(a[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int count = 0;\n  for (int i = min; i <= a; i++) {\n    if (i == a) {\n      count += 1;\n    }\n    if (a % i == 0) {\n      count += factor(a / i, i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int a;\n    cin >> a;\n    int result = factor(a, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1130", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count_1;\n\nvoid f(int n, int min) {\n  int i;\n  if (n == min) {\n    count_1++;\n    return;\n  }\n  if (n % min != 0)\n    return;\n\n  for (i = min; i <= n; i++)\n    f(n / min, i);\n}\n\nint main() {\n  int N, i, num, j;\n  scanf(\"%d\", &num);\n  for (j = 1; j <= num; j++) {\n    count_1 = 0;\n    scanf(\"%d\", &N);\n    for (i = 2; i <= N; i++)\n      f(N, i);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint b, j;\nint a[1000] = {0}; \nvoid fjys(int);\nint main() {\n  int n, i, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    b = 0;\n    memset(a, 0, sizeof(a));\n    cin >> x;\n    fjys(x);\n    cout << b << endl;\n  }\n  return 0;\n}\n\nvoid fjys(int x) {\n  int i, n1;\n  for (i = 2; i <= x; i++) \n  {\n    if (x % i == 0 && i >= a[j]) {\n      a[++j] = i;\n      n1 = x / i;\n      if (n1 == 1) \n      {\n        b++; \n      } else {\n        fjys(n1);\n      }\n      j--;\n    }\n  }\n  return;\n}\n"}
{"label": "1", "index": "1132", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint prime(int n) {\n  int i, judge = 1;\n  for (i = 2; i < n; i++) {\n    if (n % i == 0)\n      judge = 0;\n  }\n  return judge;\n}\nint function_1(int number, int x) {\n  int temp = 0, i, result = 0;\n  if (!prime(number)) {\n    for (i = x; i <= number; i++)\n      if (number % i == 0) {\n        x = i;\n        temp = number / i;\n        result += function_1(temp, x);\n      }\n  } else if ((number >= x || number == 1) && prime(number))\n    result = 1;\n  return result;\n}\nint main() {\n  int i, times, number;\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    cin >> number;\n    printf(\"%d\\n\", function_1(number, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1133", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100];\n  int i;\n  int f(int x, int min);\n\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i]);\n\n  return 0;\n}\n\nint f(int x, int min) {\n  int y = 0;\n  int i;\n\n  if (x == 1)\n    y = 1;\n\n  else {\n    for (i = min; i <= x; i++) {\n      if (x % i == 0) {\n        y = y + f(x / i, i);\n      }\n    }\n  }\n\n  return y;\n}\n"}
{"label": "1", "index": "1134", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint ans = 0;\nint work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return (p * k, k);\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0)\n      work(p / i, i);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    ans = 0;\n    int t;\n    cin >> t;\n    work(t, 2);\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, num;\nint make(int a);\nint pan(int a);\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    num = 0;\n    m = a;\n    cout << make(a) << endl;\n  }\n  return 0;\n}\nint pan(int a) {\n  int n = 0, i;\n  for (i = 1; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      n++;\n  }\n  if (n == 1)\n    return 0;\n  else\n    return 1;\n}\nint make(int a) {\n  int i, ans;\n  ans = sqrt(a);\n  if (pan(a) == 0) {\n    num++;\n    return num;\n  } else {\n    num++;\n    for (i = m / a; i <= ans; i++) {\n      if (i == 1)\n        continue;\n      if (a % i == 0) {\n        m = a;\n        num = make(a / i);\n      }\n    }\n    if (i == ans + 1)\n      return num;\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint disassamble(int, int);\nint main() {\n  int n;\n  int i = 1;\n  int a, result;\n  cin >> n;\n  while (i <= n) {\n    i++;\n    scanf(\"%d \", &a);\n    result = disassamble(a, 2);\n    cout << result << endl;\n  }\n\n  return 0;\n}\nint disassamble(int a, int y) {\n  int i, count = 1;\n  if (a == 1)\n    return 0;\n\n  if (a == 2)\n    return 1;\n  for (i = y; i * i <= a; i++) {\n    if (a % i == 0) {\n      count = disassamble(a / i, i) + count;\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "1137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n\nint main() {\n  int n, b = 0, p, k;\n  scanf(\"%d\", &p);\n  for (k = 1; k <= p; ++k) {\n    cin >> n;\n    b = f(n, 1);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1138", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n, x, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", Factorization(x, 2) + 1);\n  }\n  return 0;\n}\nint Factorization(int x, int y) {\n  int i;\n  int sum = 0;\n  if (x < 4)\n    return 0;\n  else {\n    for (i = y; i <= sqrt((double)x); i++)\n      if (x % i == 0)\n        sum += 1 + Factorization(x / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nint sum(int a, int i) {\n\n  if (a == 1) {\n    num++;\n  } else {\n    while (i <= a) {\n      if (a % i == 0) {\n        sum(a / i, i);\n      }\n      i++;\n    }\n  }\n  return num;\n}\nint main() {\n  int a, t, j, i, count;\n  cin >> t;\n  for (j = 0; j < t; j++) {\n    count = 1;\n    cin >> a;\n    i = 2;\n    while (i <= (a / 2)) {\n      if (a % i == 0) {\n        num = 0;\n        sum(a / i, i);\n        count = count + num;\n      }\n      i++;\n    }\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1140", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min) {\n  int i, result;\n  if (a < min)\n    return 0;\n  result = 1;\n  for (i = min; i < a; i++)\n    if (a % i == 0)\n      result += f(a / i, i);\n  return result;\n}\nint main() {\n  int i, n, num[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cout << f(num[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fact(int n, int m); \nint main()              \n{\n  int n, a[35000], i, b[35000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++)\n    b[i] = fact(a[i], 2); \n  for (i = 0; i < n; i++)\n    cout << b[i] << endl; \n  return 0;\n} \nint fact(int n, int m) \n{\n  int sum = 1, i, temp = 0;\n  if (n < m)\n    return 0; \n  else if (n == 2)\n    return 1; \n  else {\n    for (i = m; i < n; i++) \n    {\n      if (n % i == 0)\n        sum = sum + fact(n / i, i);\n    } \n    return sum;\n  }\n} \n"}
{"label": "1", "index": "1142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, g, f;\nint divide(int chushu, int a) {\n  int i;\n  for (i = chushu; i <= a; i++) {\n    if (a % i == 0) {\n      f = a / i;\n      if (f > 1) {\n        g = i;\n        divide(g, f);\n      } else\n        sum++;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int p = 0;\n  for (p = 0; p < n; p++) {\n    int b = 0, c = 2;\n    cin >> b;\n    sum = 0;\n    cout << divide(c, b) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid f(int x, int y) {\n  num++;\n  for (int j = y; j * j <= x; j++) {\n    if (x % j == 0)\n      f(x / j, j);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[1100];\n  for (int i = 1; i <= n; i++) {\n    num = 0;\n    cin >> a[i];\n    f(a[i], 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int count = 0;\n  for (int i = min; i <= a; i++) {\n    if (i == a) {\n      count += 1;\n    }\n    if (a % i == 0) {\n      count += factor(a / i, i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int a;\n    cin >> a;\n    int result = factor(a, 2);\n    cout << result << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int j) {\n  int sum = 1, i, s, p, k;\n  s = sqrt(n);\n  for (i = j; i <= s; i++) {\n    if (n % i == 0) {\n      p = n / i;\n      k = i;\n      sum = sum + divide(p, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k, m, p;\n  for (k = 0; k < n; k++) {\n    cin >> m;\n    p = divide(m, 2);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ans;\n\nvoid dfs(int, int);\n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    ans = 0;\n    dfs(num, 2);\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n\nvoid dfs(int x, int f) {\n  if (x == 1) {\n    ++ans;\n    return;\n  }\n  for (int i = f; i <= x; ++i)\n    if (x % i == 0)\n      dfs(x / i, i);\n  return;\n}\n"}
{"label": "1", "index": "1147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid ways(int a, int last);\nint main() {\n  int n, num[100], i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n\n  for (i = 0; i < n; i++) {\n    ways(num[i], 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid ways(int a, int last) {\n  int i, j;\n  for (i = last; i <= a; i++) {\n    if (a < i) {\n    } else if (a == i) {\n      sum++;\n    } else if (a % i == 0) {\n      ways(a / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int x) {\n  int i, j;\n  if (x == 2)\n    return 1;\n\n  else {\n    int result = 1;\n    for (i = a; i <= x; i++)\n      if (x % i == 0 && x / i >= i)\n        result = result + f(i, x / i);\n    return result;\n  }\n}\nint main() {\n  int i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    printf(\"%d \", f(2, a));\n  }\n}\n"}
{"label": "1", "index": "1149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint way(int x, int m) {\n  int sum = 0, p = 0, i;\n  for (i = m; i < x; i++)\n    if (x % i == 0) {\n      p++;\n      sum = sum + way(x / i, i);\n    }\n  sum = sum + 1;\n  if (p == 0) {\n    sum = 1;\n  }\n  if (m > x)\n    sum = 0;\n  return (sum);\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << way(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zy(int a, int b);\n  int j, n, m, sum;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d\", &m);\n    sum = zy(2, m);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint zy(int a, int b) {\n  int i, c;\n  c = 0;\n  if (a == 0)\n    c = c + 1;\n  else {\n    for (i = a; i * i <= b; i++) {\n      if (b % i == 0)\n        c = zy(i, (b / i)) + c;\n    }\n    if (i * i > b)\n      c = c + 1;\n  }\n  return (c);\n}\n"}
{"label": "1", "index": "1151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int x) {\n  int count = 1, i;\n  for (i = x; i < a; i++)\n    if (a % i == 0)\n      count += f(a / i, i);\n  if (i == a)\n    return count;\n  else\n    return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d\", &a);\n    if (a == 1 || a == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(a, 2));\n  }\n}\n"}
{"label": "1", "index": "1152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int, int);\n  int n, a;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    cout << f(a, a) << endl;\n  }\n  return 0;\n}\nint f(int m, int k) {\n  int i, sum = 0;\n  if (m == 1)\n    sum = 1;\n  for (i = m; i > 1; i--) {\n    if (m % i == 0 && i <= k)\n      sum += f(m / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nint main() {\n  int n, i, a[100];\n  void fenjie(int x, int y);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    fenjie(2, a[i]);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid fenjie(int x, int y) {\n  int j;\n  if (y == 1) {\n    t++;\n    return;\n  }\n  for (j = x; j <= y; j++) {\n    if (y % j == 0) {\n      fenjie(j, y / j);\n    }\n  }\n}\n"}
{"label": "1", "index": "1154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ans(int a, int i) {\n  int sum = 0;\n  for (int j = i; j <= sqrt(a); j++) {\n    if (a % j != 0)\n      continue;\n    sum++;\n    if (a >= j * j)\n      sum += ans(a / j, j);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << ans(a, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1155", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum = sum + 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int num, sign;\n    scanf(\"%d \", &num);\n    for (int j = num; j > 1; j--) {\n      if (num % j == 0)\n        sign = j;\n    }\n    cout << yinshu(num, sign) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint kind(int num, int min);\nint main() {\n  int n;\n  int i;\n  int num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", kind(num, 2));\n  }\n  return 0;\n}\nint kind(int num, int min) {\n  if (num < min)\n    return 0;\n\n  int k = 1;\n  int i;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) {\n      k = k + kind(num / i, i);\n    }\n  }\n\n  return k;\n}\n"}
{"label": "1", "index": "1157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p = 0, q = 2;\nint jizu(int x) {\n\n  for (int i = q; i <= x - 1; i++) {\n    if ((x % i == 0) && (x / i > i)) {\n      p++;\n      q = i;\n      jizu(x / i);\n\n    } else if ((x % i == 0) && (x / i == i)) {\n      p++;\n    }\n  }\n  return p;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    printf(\"%d\\n\", jizu(a[i]) + 1);\n    p = 0, q = 2;\n  }\n  int y;\n  scanf(\"%d\", &y);\n}\n"}
{"label": "1", "index": "1158", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint yin(int c, int g) {\n  int j, k, f, e;\n  for (j = g; j <= c; j++) {\n    if (c % j == 0) {\n      e = c / j;\n      if (e > 1) {\n        f = j;\n        yin(e, f);\n      } else\n        sum++;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, a[1000], b[1000], i, d;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    d = 2;\n    sum = 0;\n    b[i] = yin(a[i], d);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1159", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint numcheck(int num, int a) {\n  int i = 0, sum = 0;\n  if (num == 1) {\n    return 1;\n  } else if (num < a)\n    return 0;\n  else {\n    for (i = a; i <= num; i++) {\n      if (num % i == 0)\n        sum = sum + numcheck(num / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, num = 0, sum = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    sum = numcheck(num, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int s, int num) \n{\n  if (s == num)\n    return 1;\n  if (s < num)\n    for (int i = s; i <= num; i++) {\n      if (num % i == 0) {\n        if (i < num)\n          return f(i, num / i) + f(i + 1, num);\n        if (i == num)\n          return 1;\n      }\n    }\n  if (s > num)\n    return 0;\n}\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << f(2, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1161", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint tmp = 2;\nint suml(int n, int tmp) {\n  int sum = 0;\n  if (n == 1) {\n    return 1;\n  }\n  for (int i = tmp; i <= n; i++) {\n    if (n % i == 0)\n      sum += suml(n / i, i);\n  }\n  return sum;\n}\nint main() {\n  int m;\n  cin >> m;\n  int n;\n  for (int i = 0; i < m; i++) {\n    cin >> n;\n    int zon_shu = 0;\n    zon_shu = suml(n, tmp);\n    cout << zon_shu << endl;\n  }\n}\n"}
{"label": "1", "index": "1162", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count_1;\n\nvoid fun(int i, int j) {\n  int k;\n  for (k = i; k <= sqrt(j); k++) {\n    if (j % k == 0) {\n      count_1++;\n      fun(k, j / k);\n    }\n  }\n}\nint main() {\n  int N, turn, c;\n  scanf(\"%d\", &turn);\n  for (c = 1; c <= turn; c++) {\n    int n, i;\n    scanf(\"%d\", &n);\n    for (i = 2; i <= sqrt(n); i++) {\n      if (n % i == 0) {\n        count_1++;\n        fun(i, n / i);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n    count_1 = 0;\n  }\n}\n"}
{"label": "1", "index": "1163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, a[32768], i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cout << f(a[i], 2) + 1 << endl;\n  }\n  return 0;\n}\nint f(int a, int p) {\n  int i, sum = 0;\n  for (i = 2; i <= sqrt(a); i++) {\n    if (((double)a / i == a / i) && (i >= p)) {\n      p = i;\n      sum = sum + 1 + f(a / i, p);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 0;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0) {\n      n++;\n      n += f(x / a, a);\n    }\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  cin >> m;\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = 1 + f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\\n\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint N, A;\n\nint acSearch(int n, int i) {\n  int ret = 0;\n\n  if (n == 1)\n    ret = 1;\n  else\n    for (; i <= n; ++i)\n      if (n % i == 0)\n        ret += acSearch(n / i, i);\n\n  return ret;\n}\n\nint main() {\n  cin >> N;\n  for (; N--;) {\n    scanf(\"%d\", &A);\n    printf(\"%d\\n\", acSearch(A, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a = 0, s = 0;\nvoid find(int n, int prim) {\n  if (n == a) {\n    s++;\n  } else {\n    for (int i = prim; i <= a / n; i++)\n      if ((a % (n * i) == 0)) {\n        find(n * i, i);\n      }\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    s = 0;\n    for (int i = 2; i <= a; i++) {\n      if (a % i == 0) {\n        find(i, i);\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ans = 0;\nvoid work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return;\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0)\n      work(p / i, i);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    ans = 0;\n    int t;\n    scanf(\"%d\", &t);\n    work(t, 2);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0;\nvoid devide(int, int);\nint main() {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    cin >> m;\n    s = 0;\n    devide(2, m);\n    cout << s + 1 << endl;\n  }\n  return 0;\n}\n\nvoid devide(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if (b % i == 0) {\n      s++;\n      devide(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid check(int m, int n) {\n  for (; m <= n; m++) {\n    if (n % m == 0) {\n      if (n / m == 1) {\n        num++;\n        return;\n      } else\n        check(m, n / m);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (; n; n--) {\n    cin >> m;\n    check(2, m);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1170", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i = 0;\nint f(int n, int m) {\n  int k = 0;\n  if (m == 1)\n    i++;\n  else {\n    for (k = n; k <= m; k++) {\n      if (m % k == 0) {\n        n = k;\n        f(n, m / n);\n      }\n    }\n  }\n  return (i);\n}\nint main() {\n  int n, b, c;\n  scanf(\"%d \", &n);\n  int a;\n  for (b = 0; b < n; b++) {\n    scanf(\"%d \", &a);\n    c = f(2, a);\n    printf(\"%d\\n\", c);\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint counts = 1;\nint ty(int, int);\nint main() {\n  int i, m, n, c;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    counts = 1;\n    c = ty(n, 2);\n    cout << c << endl;\n  }\n  return 0;\n}\n\nint ty(int n, int j) {\n  int i, flag = 0;\n  if (n == 1) {\n    return 0;\n  }\n  if (n == 2) {\n    return 1;\n  }\n  for (i = j; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      counts++;\n      ty(n / i, i);\n    }\n  }\n  return counts;\n}\n"}
{"label": "1", "index": "1172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Factor(int, int);\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", Factor(a, 2));\n  }\n  return 0;\n}\nint Factor(int a, int p) {\n  int i, j, z = 1;\n  if (a < p)\n    z = 0;\n  else {\n    for (i = p; i <= a; i++) {\n      if (a % i == 0) {\n        z += Factor(a / i, i);\n      }\n    }\n  }\n  return z;\n}\n"}
{"label": "1", "index": "1173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 1, k = 0;\nint count(int n) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= k) {\n      num++;\n      k = i;\n      count(n / i);\n      k = 0;\n    }\n  }\n  return (num);\n}\nint main() {\n  int i, n, a[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << count(a[i]) << \"\\n\";\n    num = 1;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1174", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint im(int n, int max) {\n  int s = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = max; i > 1; i--)\n    if (n % i == 0)\n      s += im(n / i, i);\n  return s;\n}\nint main() {\n  int i, n, t;\n  cin >> n >> t;\n  printf(\"%d\", im(t, t));\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"\\n%d\", im(t, t));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1175", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d;\nint fen(int i, int a) {\n  if (i > a)\n    return 0;\n\n  int result = 1;\n  int j;\n  for (j = i; j < a; j++) {\n    if (a % j == 0) {\n      result = result + fen(j, a / j);\n    }\n  }\n  return result;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k = 0;\n  while (k < n) {\n\n    int a;\n    cin >> a;\n    int i = 2;\n    d = fen(i, a);\n    printf(\"%d\\n\", d);\n    k++;\n  }\n  return 0;\n  cin.get();\n  cin.get();\n  cin.get();\n}\n"}
{"label": "1", "index": "1176", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint col(int a, int b);\nint main() {\n  int n, i, m, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    l = col(m, 2) + 1;\n    printf(\"%d\\n\", l);\n  }\n  return 0;\n}\nint col(int a, int b) {\n  int i, t, tt = 0, sig = 0;\n  for (i = b; (i < a / 2) && ((a / i) >= i); i++) {\n    if (a % i == 0) {\n      t = a / i;\n      tt = tt + 1 + col(t, i);\n      sig = 1;\n    }\n  }\n  if (sig == 0)\n    tt = 0;\n  return (tt);\n}\n"}
{"label": "1", "index": "1177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint shi(int a) {\n  int b = sqrt(a);\n  for (int i = 2; i <= b; i++) {\n    if (a % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint shu(int m, int k) {\n  int a = 1;\n  for (int j = k; j <= sqrt(m); j++) {\n    if (m % j == 0 && m / j >= k) {\n      a++;\n      if (shi(m / j) == 0)\n        a += shu(m / j, j) - 1;\n    }\n  }\n  return a;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    int m, a;\n    scanf(\"%d\", &m);\n    cout << shu(m, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int a, int b) {\n  int c = 1, i;\n  for (i = b; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      c += fenjie(a / i, i);\n  }\n  return c;\n}\nint main() {\n  int n, i, a, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    c = fenjie(a, 2);\n    printf(\"%d \", c);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int);\n\nint solutionnum = 1;\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    fenjie(a);\n    printf(\"%d\\n\", solutionnum);\n    solutionnum = 1;\n  }\n  return 0;\n}\nint yinzi[100] = {2}, i = 0;\n\nvoid fenjie(int x) {\n  int j;\n  for (j = yinzi[i]; j < x; j++) {\n    if (x % j == 0 && x / j >= j) {\n      i++;\n      yinzi[i] = j;\n      fenjie(x / j);\n      j = yinzi[i];\n      i--;\n      solutionnum++;\n    }\n  }\n}\n"}
{"label": "1", "index": "1180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cut(int m, int l) {\n  int sum = 1;\n  for (int i = l; i <= sqrt((double)m / l); i++) {\n    if ((m / l) % i == 0) {\n      sum += cut(m / l, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int t = 0;\n    scanf(\"%d \", &t);\n    cout << cut(2 * t, 2);\n    if (i < n - 1)\n      cout << endl;\n  }\n}\n"}
{"label": "1", "index": "1181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a, b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    b[i] = f(a, 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, sum = 1;\n  if (x < y)\n    sum = 0;\n  else {\n    for (j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + f(x / j, j);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1182", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = 2; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          if (i < q)\n            continue;\n          else\n            sum = sum + f(i, x / i);\n        }\n      }\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum, p;\n  p = 0;\n  sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int n, a[100], b[100], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = f(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1184", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nint Fact(int x, int y);\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    sum = 1;\n    Fact(a, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint Fact(int x, int y) {\n  if (x == 1)\n    return 0;\n  else {\n    for (; y <= sqrt(x); y++)\n      if (x % y == 0) {\n        sum = sum + Fact(x / y, y);\n      }\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "1185", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int min, int a) {\n  if (min > a)\n    return 0;\n\n  int i;\n  int num = 1;\n  for (i = min; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      num = num + f(i, a / i);\n    }\n  }\n\n  return num;\n}\nint main() {\n  int m, a, j;\n  scanf(\"%d \", &m);\n  for (j = 0; j < m; j++) {\n    cin >> a;\n    cout << f(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint all = 1;\nvoid divd(int, int);\n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    divd(2, num);\n    printf(\"%d\\n\", all);\n    all = 1;\n  }\n  return 0;\n}\n\nvoid divd(int fac, int num) {\n  int i;\n  for (i = fac; i * i <= num; i++)\n    if (num % i == 0) {\n      fac = i;\n      all++;\n      divd(fac, num / fac);\n    }\n}\n"}
{"label": "1", "index": "1187", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint all = 1;\nvoid divd(int, int);\n\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> num;\n    divd(2, num);\n    printf(\"%d\\n\", all);\n    all = 1;\n  }\n  return 0;\n}\n\nvoid divd(int fac, int num) {\n  int i;\n  for (i = fac; i * i <= num; i++)\n    if (num % i == 0) {\n      fac = i;\n      all++;\n      divd(fac, num / fac);\n    }\n}\n"}
{"label": "1", "index": "1188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num;\nint main() {\n  int f(int, int);\n  int i, n, a[100], result[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    num = 1;\n    cin >> a[i];\n    result[i] = f(1, a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    cout << result[i] << endl;\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int i;\n  for (i = 2; i <= sqrt(y); i++) {\n    if (y % i == 0 && i >= x) {\n      num++;\n      f(i, y / i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum = 0;\n\nvoid f(int x, int i) {\n  double m = sqrt(x);\n  if (i < m) {\n    if (x % i == 0) {\n      sum++;\n      f(x / i, i);\n    }\n    f(x, i + 1);\n  }\n\n  if (fabs(i - m) < 0.00000001)\n    sum++;\n}\n\nint main() {\n  int x, i, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    sum = 0;\n    f(x, 2);\n\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid tot(int, int);\nint main() {\n\n  int n, a[100], i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    t = 0;\n    tot(a[i], 2);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n\nvoid tot(int x, int min) {\n  int k;\n  if (x == 1) {\n    ++t;\n    return;\n  }\n  for (k = min; k <= x; k++) {\n    if (x % k == 0) {\n      tot(x / k, k);\n    }\n  }\n}\n"}
{"label": "1", "index": "1191", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint is_bottom, max;\nint div_foo(int n, int min);\n\nint main() {\n\n  int N;\n  scanf(\"%d \", &N);\n  for (int index = 0; index < N; index++) {\n    int k;\n    cin >> k;\n    is_bottom = 0;\n    cout << div_foo(k, 2) + 1 << endl;\n  }\n\n  return 0;\n}\n\nint div_foo(int n, int min) {\n  int cal = 0;\n\n  for (int iter = min; iter <= sqrt(n); iter++) {\n    if (!(n % iter)) {\n      cal++;\n      int f1 = n / iter, f2 = iter, g;\n      g = div_foo(f1, f2);\n      cal += g;\n    }\n  }\n  return cal;\n}\n"}
{"label": "1", "index": "1192", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint f(int x, int y) {\n  int i, a = 1;\n  if (x < y)\n    return 0;\n  if (x == y)\n    return 1;\n  if (x > y) {\n    if (y == 1) {\n      for (i = y + 1; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    } else {\n      for (i = y; i <= x; i++) {\n        if (x % i == 0)\n          a = a + f(x / i, i);\n      }\n    }\n    return a;\n  }\n}\n\nint main() {\n  int n, j, b = 0, p, k;\n  scanf(\"%d\", &p);\n  for (k = 1; k <= p; ++k) {\n    scanf(\"%d\", &n);\n    b = f(n, 1);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint digui(int m, int n, int sum) {\n  int i;\n  sum++;\n  if (sqrt(m) < n)\n    return sum;\n  else {\n    for (i = n; i <= sqrt(m); i++) {\n      if (m % i == 0)\n        sum = digui(m / i, i, sum);\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", digui(a, 2, 0));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1194", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int x, int y) \n{\n  int i;\n  for (i = 2; i < x; i++) \n  {\n    if (x % i == 0) {\n      break;\n    }\n  }\n  if (i == x) {\n    return 1; \n  } else      \n  {\n    int sum = 0;\n    if (x == y) \n    {\n      for (i = y / x + 1; i <= sqrt(x); i++) \n      {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1; \n    } else {          \n      for (i = y / x; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1; \n    }\n  }\n}\nint main() \n{\n  int n;\n  cin >> n;\n  const int m = n;\n  int a[m], j;\n  for (j = 0; j < n; j++) {\n    cin >> a[j]; \n  }\n  for (j = 0; j < n; j++) {\n    cout << factor(a[j], a[j]) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1195", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fj(int a, int b);\n\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fj(a, 2));\n  }\n\n  return 0;\n}\nint fj(int a, int b) {\n  int j, x, sum = 1, f = 0;\n  x = sqrt((double)a);\n  if ((a == 1) || (a == 2) || (a == 3))\n    return 1;\n  else {\n    for (j = b; j <= x; j++) {\n      if (a % j == 0) {\n        sum += fj(a / j, j);\n        f = 1;\n      }\n    }\n    if (f == 0)\n      return 1;\n    else\n      return sum;\n  }\n}\n"}
{"label": "1", "index": "1196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num(int a, int b);\nint main() {\n  int t;\n  int a;\n  scanf(\"%d \", &t);\n  for (int i = 1; i <= t; i++) {\n    cin >> a;\n    cout << (num(a, 2)) << endl;\n  }\n  return 0;\n}\nint num(int a, int b) {\n  int f = 0;\n  if (a >= b) {\n    for (int i = b; i <= a; i++) {\n      if (a == i)\n        f++;\n      else if (a % i == 0) {\n        f = f + num(a / i, i);\n      }\n    }\n  }\n  return f;\n}\n"}
{"label": "1", "index": "1197", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, i, a[100], sum[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum[i] = f(a[i], 2);\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n\nint f(int m, int min) {\n  int i, sum = 0;\n  if (m == min || m == 1)\n    return 1;\n  else if (m < min)\n    return 0;\n  else if (m > min) {\n    for (i = min; i <= m; i++)\n      if (m % i == 0)\n        sum += f(m / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1198", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int, int);\nint main(void) {\n  int n, a;\n  cin >> n;\n  while (n != 0) {\n    scanf(\"%d \", &a);\n    cout << divide(a, 2) << endl;\n    n--;\n  }\n  return 0;\n}\n\nint divide(int x, int t) {\n  int i, sum = 0;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++) {\n    if (x % i == 0)\n      sum += divide(x / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0; \nvoid fj(int n, int m) {\n  int i;                         \n  for (i = m; i <= sqrt(n); i++) \n  {\n    if (n % i == 0) {\n      sum++;\n      fj(n / i, i); \n    }\n  }\n}\nint main() {\n  int j, N;   \n  int a[100]; \n  cin >> N;\n  for (j = 1; j <= N; j++) {\n    cin >> a[j]; \n  }\n  for (j = 1; j <= N; j++) {\n    sum = 0;\n    fj(a[j], 2); \n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint tru(int c) {\n  int j, p = 0;\n  if (c == 1 || c == 2)\n    return 1;\n  else\n    for (j = 2; j <= pow((double)c, 0.5); j++)\n      if (c % j == 0) {\n        p = 1;\n        break;\n      }\n  if (p == 1)\n    return 0;\n  else\n    return 1;\n}\nint count(int a, int b) {\n  int i, k = 1;\n  if (!tru(a))\n    for (i = b; i <= pow((double)a, 0.5); i++)\n      if (a % i == 0)\n        k = k + count(a / i, i);\n  return k;\n}\nint main() {\n  int n, x[999], q;\n  scanf(\"%d\", &n);\n  for (q = 0; q < n; q++)\n    scanf(\"%d\", &x[q]);\n  for (q = 0; q < n; q++)\n    printf(\"%d\\n\", count(x[q], 2));\n\n  return 0;\n}\n"}
{"label": "1", "index": "1201", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n = 0, integer = 0; \n  int division(int, int); \n                          \n  cin >> n;               \n  for (int i = 0; i < n; i++) {\n    cin >> integer;\n    cout << division(integer, integer) << endl; \n  }\n  return 0;\n}\n\nint division(int integer, int limit) {\n  if (limit <= 1)\n    return 0;\n  switch (integer) {\n  case 1:\n    return 1;\n    break;\n  default: {\n    int sum = 0;\n    for (int a = 1; a <= integer; a++) {\n      if (integer % a != 0)\n        continue;\n      else if (integer / a > limit)\n        continue;\n      else\n        sum += division(a, integer / a);\n    }\n    return sum;\n  } break;\n  }\n}\n"}
{"label": "1", "index": "1202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int n, int x) {\n  int i, t = 0;\n  for (i = x; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      t = t + 1 + fenjie(n / i, i);\n    }\n  }\n  return t;\n}\nint main() {\n  int i, t, n;\n  scanf(\"%d \", &t);\n  for (i = 0; i < t; i++) {\n    scanf(\"%d \", &n);\n    cout << fenjie(n, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fact(int a, int min) {\n  if (a < min)\n    return 0;\n  int way = 1;\n  for (int i = min; i <= sqrt((double)a); i++)\n    if (a % i == 0)\n      way += fact(a / i, i);\n  return way;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int c;\n    cin >> c;\n    printf(\"%d\\n\", fact(c, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1204", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t(int, int);\nint s, j, k1;\n\nint main() {\n  int a, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    s = 1;\n    k1 = 0;\n    for (j = 2; j <= sqrt((double)a); j++) {\n      if (a % j == 0)\n        t(a / j, j);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n\nint t(int a, int b) {\n  int k;\n  for (k = b; k <= a; k++) {\n    if (a % k == 0) {\n      if (a / k == 1) {\n        s = s + 1;\n        break;\n      }\n      t(a / k, k);\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0) {\n      result += factor(N / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, m, j, re;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &m);\n    re = factor(m, 2);\n    printf(\"%d\\n\", re);\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "1", "index": "1206", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int k, int l);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", fenjie(a, 2));\n  }\n  return 0;\n}\n\nint fenjie(int k, int l) {\n  int num = 1, d, e;\n  if (k < l) {\n    return 0;\n  }\n  d = (int)(sqrt((double)k));\n  for (e = l; e <= d; e++) {\n    if (k % e == 0) {\n      num += fenjie(k / e, e);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1207", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cut(int m, int l) {\n  int sum = 1;\n  for (int i = l; i <= sqrt((double)m / l); i++) {\n    if ((m / l) % i == 0) {\n      sum += cut(m / l, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int t = 0;\n    cin >> t;\n    cout << cut(2 * t, 2);\n    if (i < n - 1)\n      cout << endl;\n  }\n}\n"}
{"label": "1", "index": "1208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int x, int y) { \n  int i, s = 0;            \n  if (x == y)\n    return 1;\n  for (i = y; i < x; i++)\n    if (x % i == 0)\n      s += fenjie(x / i, i);\n  if (i == x)\n    s++;\n  return s;\n}\nint main() {\n  int n, i; \n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> i;\n    cout << fenjie(i, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint next(int a, int b) {\n  if (a == 1)\n    return 1;\n  if (a < b)\n    return 0;\n  int sum = 0;\n  for (; b <= a; b = b + 1)\n    if (a % b == 0)\n      sum = sum + next(a / b, b);\n\n  return sum;\n}\nint main() {\n  int i, m;\n  cin >> m;\n  for (i = 0; i < m; i = i + 1) {\n    cin >> n;\n    cout << next(n, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s(int n, int m) {\n  if (n == 1)\n    return 1;\n  int an = 0;\n  for (int i = m; i > 1; i--) {\n    if (n % i == 0)\n      an += s(n / i, min(i, n / i));\n  }\n  return an;\n}\nint main() {\n  int N;\n  cin >> N;\n  int x;\n  for (N; N > 0; N--) {\n    cin >> x;\n    cout << s(x, x) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint g(int y) {\n  int i;\n  for (i = 0;; i++) {\n    if (i * i > y)\n      break;\n  }\n  return i - 1;\n}\nint f(int x, int b) {\n  int p, a[100], t = 0, k = 0;\n  p = g(x);\n  if (x == 2)\n    return 0;\n  else {\n    for (int i = b; i <= p; i++) {\n      if (x % i == 0) {\n        a[t] = i;\n        t++;\n      }\n    }\n    if (t == 0)\n      return 0;\n    else\n      for (int i = 0; i < t; i++)\n        k = k + f(x / a[i], a[i]) + 1;\n    return k;\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, a;\nvoid find(int i, int x) {\n  for (int j = i; j * j <= x && i != 1; j++)\n    if (x / j * j == x) {\n      find(j, x / j);\n      k++;\n    }\n}\nint main() {\n  int n;\n  for (cin >> n; n--;) {\n    k = 0;\n    cin >> a;\n    find(2, a);\n    printf(\"%d\\n\", ++k);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Factorize(int n, int fact);\nint number = 0;\nint main() {\n  int times, num, i;\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    cin >> num;\n    Factorize(num, 2);\n    cout << number << endl;\n    number = 0;\n  }\n  return 0;\n}\nvoid Factorize(int n, int fact) {\n  int i;\n  for (i = fact; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      Factorize(n / i, i);\n  }\n  number++;\n}\n"}
{"label": "1", "index": "1214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint numcheck(int num, int a) {\n  int i = 0, sum = 0;\n  if (num == 1)\n    return 1;\n  else if (num < a)\n    return 0;\n  else {\n    for (i = a; i <= num; i++) {\n      if (num % i == 0)\n        sum = sum + numcheck(num / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, num = 0, sum = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    sum = numcheck(num, 2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 0;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0) {\n      n++;\n      n += f(x / a, a);\n    }\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  cin >> m;\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = 1 + f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    cout << n[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint s(int a, int b) {\n  int sum = 0, z = 0;\n  if (a != 1 && b <= a) {\n    for (int i = b; i <= a; ++i) {\n      if (a % i == 0) {\n        sum += s(a / i, i);\n        z = 1;\n      }\n    }\n\n  } else if (a == 1)\n    return 1;\n\n  return sum;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; ++i) {\n    cin >> a;\n    cout << s(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint factor(int N, int min);\nint main() {\n  int m, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    k = factor(m, 2);\n    cout << k << \"\\n\";\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      result += factor(N / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << f(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  if (n < p)\n    return 0;\n  else {\n    for (m = p; m <= n; m++)\n      if (n % m == 0) {\n        if (m < n)\n          sum = sum + f(n / m, m);\n        if (m == n)\n          sum = sum + 1;\n      }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b) {\n  int c, s = 0, i;\n  c = (int)sqrt(a);\n  for (i = b; i <= c; i++) {\n    if (a % i == 0)\n      s = s + f(a / i, i);\n  }\n  return s + 1;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    printf(\"%d \", f(num[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fun(int m, int n) {\n  \n\n  \n  if (m > sqrt(n))\n    return 0;\n  \n  if (n % m == 0)\n    return fun(m + 1, n) + fun(m, n / m) + 1;\n  else\n    return fun(m + 1, n);\n  \n  \n}\n\nint main() {\n  int i, x, y;\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    cin >> y;\n    cout << fun(2, y) + 1 << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1222", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 0;\nvoid fj(int m, int i) {\n  if (m == 1)\n    num++;\n  else {\n    for (int j = i; j <= m; j++) {\n      if (m % j == 0)\n        fj(m / j, j);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int ii = 0; ii < n; ii++) {\n    cin >> m;\n    fj(m, 2);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint t;\nvoid f(int n, int d) {\n  int i;\n  if (n == 1)\n    t++;\n  else {\n    for (i = d; i <= n; i++) {\n      if (n % i == 0) {\n        f(n / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int number[100];\n  int n, i;\n  int result[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    f(number[i], 2);\n    result[i] = t;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint N, A;\n\nint acSearch(int n, int i) {\n  int ret = 0;\n\n  if (n == 1)\n    ret = 1;\n  else\n    for (; i <= n; ++i)\n      if (n % i == 0)\n        ret += acSearch(n / i, i);\n\n  return ret;\n}\n\nint main() {\n  cin >> N;\n  for (; N--;) {\n    scanf(\"%d\", &A);\n    cout << acSearch(A, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int, int);\n  int n[100], sum, i, m;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++) {\n    sum = f(1, n[i]) + 1;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint f(int i, int n) {\n  int j, k, sum = 0;\n  for (j = i; j < (int)sqrt((double)n) + 1; j++) {\n\n    k = sum;\n    if (j == 1)\n      sum = 0;\n    else {\n      if (n % j == 0 && n / j >= j)\n        sum = f(j, n / j) + 1;\n      else\n        sum = 0;\n    }\n    sum = sum + k;\n  }\n  return (sum);\n}\n"}
{"label": "1", "index": "1226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yz[100], all = 0;\nint yinzi(int num, int amax) {\n  int i, j = 0, geshu = 0, key = num;\n  if (num == 1)\n    return 1;\n  else {\n    for (i = amax; i < all; i++) {\n      if (num % yz[i] == 0) {\n        num = num / yz[i];\n        geshu = geshu + yinzi(num, i);\n        num = key;\n      }\n    }\n    return geshu;\n  }\n  return 0;\n}\nint main() {\n  int num, n, i, c, j = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &num);\n    if (num == 1)\n      cout << 1 << endl;\n    else {\n      j = 0;\n      for (i = 2; i <= num; i++) {\n        if (num % i == 0) {\n          yz[j] = i;\n          j++;\n        }\n      }\n      all = j;\n      cout << yinzi(num, 0) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num, t, yin[50];\nvoid dd(int n, int a, int d, int m) {\n  int i;\n  if (d == m) {\n    t++;\n    return;\n  }\n  for (i = a; i < num; i++) {\n    if (n / yin[i] >= yin[i] && n % yin[i] == 0)\n      dd(n / yin[i], i, d + 1, m);\n  }\n}\nvoid q_ys(int n) {\n  int i;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0) {\n      num++;\n      yin[num] = i;\n    }\n  return;\n}\nint m_ys(int n) {\n  int i;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      return i;\n    }\n  }\n  return 1;\n}\nvoid output(int y) {\n  int k = 1, i, x;\n  x = y;\n  t = 1, num = 0, memset(yin, 0, sizeof(yin));\n  q_ys(x);\n  while (m_ys(x) != 1) {\n    k++;\n    x = x / m_ys(x);\n  }\n  for (i = 2; i <= k; i++)\n    dd(y, 1, 1, i);\n  cout << t << endl;\n}\nint main() {\n  int n, i, a[1000];\n  t = 0, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    output(a[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m[100], i;\nvoid sb(int, int);\nint main() {\n  int n, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sb(a[i], 2);\n    printf(\"%d\\n\", m[i] + 1);\n  }\n  return 0;\n}\nvoid sb(int c, int d) {\n  int v;\n  for (v = d; v <= sqrt(c); v++) {\n    if (c % v == 0) {\n      m[i]++;\n      sb(c / v, v);\n    }\n  }\n}\n"}
{"label": "1", "index": "1229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint w = 1;\nint f(int x) {\n  int z = 1, y, v = 0;\n  for (y = w + 1; y <= sqrt(x); y++) {\n    if (x % y == 0) {\n\n      z = z + f(x / y);\n      v++;\n      w = y;\n    }\n  }\n  if (v == 0)\n    z = 1;\n  return z;\n}\nint main() {\n  int n, u = 0, a;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d\", &a);\n    cout << f(a) << \" \";\n    u++;\n    w = 1;\n  } while (u != n);\n  return 0;\n}\n"}
{"label": "1", "index": "1230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int, int);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int m;\n    sum = 1;\n    cin >> m;\n    calculate(m, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nvoid calculate(int m, int begin) {\n  int i;\n  int n = sqrt((double)m);\n  for (i = begin; i <= n; i++) {\n    if (m % i == 0) {\n      sum++;\n      calculate(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1231", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint varieties = 0; \n\nvoid divide(int forward, int number) \n{\n  int i;\n  if (number == 1) \n  {\n    varieties++; \n  }\n  for (i = forward; i <= number;\n       i++) \n  {\n    if (number % i == 0) \n    {\n      divide(i, number / i);\n    }\n  }\n}\n\nint main() \n{\n  int n = 0, num = 0;\n  cin >> n; \n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    divide(2, num); \n    cout << varieties << endl;\n    varieties = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dfs(int k, int b) {\n  int ret = (k == 1), i;\n  for (i = b; i <= k; i++)\n    if (k % i == 0)\n      ret += dfs(k / i, i);\n  return ret;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n\n    cin >> k;\n    cout << dfs(k, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int n, int m);\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << f(num, 2) << \"\\n\";\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int i, count = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      count += f(n / i, i);\n  }\n  return count;\n}\n"}
{"label": "1", "index": "1234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint find_factor(int a, int b) {\n  int i, sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      sum = sum + find_factor(a / i, i);\n  return sum;\n}\n\nint main(void) {\n  int n;\n  scanf(\"%d \", &n);\n  int a;\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    printf(\"%d\\n\", find_factor(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint geshu;                  \nvoid yinshu(int num, int a) \n{\n  int i; \n  if (num == 1)\n    geshu++; \n  else {\n    for (i = a; i <= num; i++) {\n\n      if (num % i == 0) \n      {\n        \n        yinshu(num / i, i); \n      }\n    }\n  }\n}\nint main() {\n  int shu, j, num1[10000]; \n  cin >> shu;\n  for (j = 0; j < shu; j++) {\n    geshu = 0;\n    cin >> num1[j];\n    \n    yinshu(num1[j], 2);    \n    cout << geshu << endl; \n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "1236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint t;\nvoid calc(int a, int d) {\n  int i;\n  if (a == 1)\n    t++;\n  else {\n    if (a >= d)\n      for (i = d; i <= a; i++) {\n        if (a % i == 0)\n          calc(a / i, i);\n      }\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    t = 0;\n    calc(a, 2);\n    cout << t << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1237", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, count = 0, flag = 0;\n  if (m == 1)\n    return 1;\n  for (i = n; i > 1; i--) {\n    if (m % i == 0) {\n      count += f(m / i, i);\n      flag = 1;\n    }\n  }\n  if (flag)\n    return count;\n  else\n    return 0;\n}\nint main() {\n  int n, k, m;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, m));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1238", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num(int a, int b, int c) {\n  int sum = 0, j;\n  if (a > c)\n    return 0;\n  if (b == 1)\n    return 1;\n  for (j = a; j <= c; j++)\n    if (c % j == 0)\n      sum = sum + num(j, b - 1, c / j);\n  return sum;\n}\nint main() {\n  int k, n, m, e = 0, i;\n  cin >> n;\n  while (e < n) {\n    scanf(\"%d \", &m);\n    k = 0;\n    int f = m;\n    for (i = 2; i <= f; i++)\n      if (f % i == 0) {\n        k++;\n        f = f / i;\n        i = 1;\n      }\n    cout << num(1, k, m) << endl;\n    e++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fj(int n, int m) {\n  int i, j, k = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      k += fj(n / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    cin >> i;\n    printf(\"%d\", fj(i, 2));\n    if (n - 1)\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "1", "index": "1240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1;\nvoid solve(int num, int a, int m) {\n  int i;\n  if (num == 1) {\n    count_1++;\n    return;\n  }\n  for (i = 2; i <= num; i++) {\n    if (i >= a && (num % i) == 0)\n      solve(num / i, i, m + 1);\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    int num, a;\n    count_1 = 0;\n    scanf(\"%d\", &num);\n    solve(num, 0, 1);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1241", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t = 0, ways;\nvoid divide(int x, int h) {\n  int i;\n  if (x == 1) {\n    t++;\n    ways = t;\n  } else\n    for (i = h; i <= x; i++)\n      if (x % i == 0) {\n        h = i;\n        divide(x / h, h);\n      }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    t = 0;\n    divide(a[i], 2);\n    cout << ways << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k = 0;\nint y;\nint a(int x, int i);\nvoid b(int x, int i);\nint main() {\n  int n, i, x, z;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    y = x;\n    printf(\"%d\\n\", a(x, 2));\n  }\n  return 0;\n}\nint a(int x, int i) {\n  k = 0;\n  b(x, i);\n  return k;\n}\nvoid b(int x, int i) {\n  for (i = i; i <= x; i++) {\n    if (x % i == 0) {\n      b(x / i, i);\n    }\n  }\n  if (x == 1)\n    k = k + 1;\n}\n"}
{"label": "1", "index": "1243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint factoring(int a, int b) {\n  int i, kind = 0;\n  if (a == 1) {\n    kind = 1;\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int n, i, a[30000] = {0}, b[30000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = factoring(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1244", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 0, i = 0, sum = 1;\nvoid f(int i, int a) {\n  int j;\n  for (j = i; j <= sqrt(a); j++)\n    if (a % j == 0) {\n      sum++;\n      f(j, a / j);\n    }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n) {\n    scanf(\"%d \", &a);\n    f(2, a);\n    cout << sum << endl;\n    n--;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Divide(int a, int b);\nint main() {\n  int Times = 0;\n  int Num = 0;\n  int i = 0;\n  int Temp[100] = {0};\n  cin >> Times;\n  for (i = 0; i < Times; i++) {\n    cin >> Num;\n    Temp[i] = Divide(Num, Num);\n  }\n  for (i = 0; i < Times; i++) {\n    cout << Temp[i] << \"\\n\";\n  }\n  return 0;\n}\n\nint Divide(int a, int b) {\n  int Sum = 0;\n  int i = 0;\n  int Flag = 0;\n  if (a != 1) {\n    for (i = b; i > 1; i--) {\n      if (a % i == 0)\n        Sum += Divide(a / i, i);\n      Flag = 1;\n    }\n  }\n  if (Flag == 0 || a == 1) {\n    Sum = 1;\n  }\n  return Sum;\n}\n"}
{"label": "1", "index": "1246", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint yinshu(int num, int min);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int a, result;\n    scanf(\"%d\", &a);\n    result = yinshu(a, 2) + 1;\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n\nint yinshu(int num, int min) {\n  int r, x = 0;\n  if (num < min) {\n    return 0;\n  } else {\n    for (r = min; r * r <= num; r++) {\n      if (num % r == 0) {\n        x = x + 1 + yinshu(num / r, r);\n      }\n    }\n    return x;\n  }\n}\n"}
{"label": "1", "index": "1247", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ways(int a, int min);\nint main() {\n  int n, a, i, sum = 0, k, min;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    sum = 0;\n    for (k = 2; k <= a; k++) {\n      if (a % k == 0) {\n        min = k;\n        break;\n      }\n    }\n    if (a != min)\n      sum = ways(a, min);\n    else\n      sum = 1;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += ways(a / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1248", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m[100], i;\nvoid sb(int, int);\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    sb(a[i], 2);\n    printf(\"%d\\n\", m[i] + 1);\n  }\n  return 0;\n}\nvoid sb(int c, int d) {\n  int v;\n  for (v = d; v <= sqrt(c); v++) {\n    if (c % v == 0) {\n      m[i]++;\n      sb(c / v, v);\n    }\n  }\n}\n"}
{"label": "1", "index": "1249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nvoid count(int x, int y) {\n  int i;\n  if (x == 1)\n    n = n + 1;\n  else {\n    for (i = y; i <= x; i++) {\n      if (x % i == 0)\n        count(x / i, i);\n    }\n  }\n}\nint main() {\n  int i, k, t;\n  void count(int x, int y);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n = 0;\n    cin >> t;\n    count(t, 2);\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1250", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint times = 1;\nint used[1000] = {0};\nvoid fuck(int n) {\n\n  int i = 0;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (used[i] == 0 && n % i == 0) {\n      int j = 0;\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 1;\n      times++;\n      fuck(n / i);\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 0;\n    }\n  }\n}\nint main() {\n  int n = 0;\n  int num = 0;\n  scanf(\"%d \", &n);\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    fuck(num);\n    cout << times << endl;\n    times = 1;\n    int k = 0;\n    for (k = 0; k <= 999; k++)\n      used[k] = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint divi(int n, int i) {\n  int num = 0;\n  if (n % i == 0) {\n    if (n == i) {\n      return 1;\n    }\n    for (int j = 2; j <= i; j++) {\n      num = num + divi(n / i, j);\n    }\n    return num;\n  }\n\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int n = 0;\n  int t = 0;\n  int sum;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    sum = 0;\n    scanf(\"%d \", &n);\n    for (int j = 2; j <= n / 2; j++) {\n      sum = sum + divi(n, j);\n    }\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int num, int minA1) {\n  int count = 0;\n  int sqrtNum;\n  int i;\n\n  if (num <= minA1)\n    return 0;\n\n  sqrtNum = (int)sqrt((double)num);\n  for (i = minA1; i <= sqrtNum; i++)\n    if (num % i == 0) {\n      count++;\n      count += factor(num / i, i);\n    }\n\n  return count;\n}\n\nint main() {\n  int n;\n  int num;\n\n  cin >> n;\n\n  while (n--) {\n    cin >> num;\n    cout << factor(num, 2) + 1 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a == 1)\n    return 1;\n  else {\n    int c, d, i;\n    c = 0;\n    d = (int)sqrt((double)a);\n    for (i = b; i <= a; i++) {\n      if (!(a % i))\n        c += f(a / i, i);\n    }\n    return c;\n  }\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    cout << f(a, 2) << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "1254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint digui(int x, int min);\nint main() {\n  int n, i, m, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &m);\n    y = digui(m, 2);\n    cout << y << \"\\n\";\n  }\n  return 0;\n}\nint digui(int x, int min) {\n  int i, result;\n  result = 1;\n  if (x < min) {\n    return 0;\n  }\n  for (i = min; i <= x - 1; i++) {\n    if (x % i == 0) {\n      result = result + digui(x / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1255", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int x, int y) {\n  int i;\n  for (i = 2; i < x; i++) {\n    if (x % i == 0) {\n      break;\n    }\n  }\n  if (i == x)\n    return 1;\n  else {\n    int sum = 0;\n    if (x == y) {\n      for (i = y / x + 1; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1;\n    } else {\n      for (i = y / x; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  const int m = n;\n  int a[m], j;\n  for (j = 0; j < n; j++) {\n    cin >> a[j];\n  }\n  for (j = 0; j < n; j++) {\n    cout << factor(a[j], a[j]) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint j = 2;\n\nint kinds(int x) {\n  int sum = 1;\n  if (x == 1) {\n    return 0;\n  }\n  for (int i = j; i <= sqrt(x); i++)\n    if (x % i == 0) {\n      sum += kinds(x / i);\n      j = i + 1;\n    }\n  return sum;\n}\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int x = 0;\n    cin >> x;\n    printf(\"%d\\n\", kinds(x));\n    j = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint p = 0;\n\nint factor(int a, int min) {\n  int sum = 0;\n  if (min >= a)\n    return 1;\n  for (int j = min; j <= a / min; j++)\n    if (a % j == 0)\n      sum += factor(a / j, j);\n  return sum;\n}\n\nint main() {\n  int n = 0, a = 0;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cin >> a;\n    if (a <= 2)\n      cout << 1 << endl;\n    else\n      printf(\"%d\\n\", factor(a, 2) + 1);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint qq(int m) {\n  int i, j;\n  j = 0;\n  for (i = 2; i * i <= j; i++) {\n    if (m % i == 0) {\n      j = 1;\n      break;\n    }\n  }\n  return j;\n}\n\nint pp(int m, int j) {\n  int i, k = 0;\n  if (m == 1)\n    return 1;\n  else {\n    k++;\n    for (i = j; i * i <= m; i++) {\n      if (qq(i) == 0 && m % i == 0) {\n        k = k + pp(m / i, i);\n      }\n    }\n  }\n  return k;\n}\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  int aa[n + 1];\n  for (i = 1; i <= n; i++) {\n    cin >> p;\n    aa[i] = pp(p, 2);\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", aa[i]);\n\n  return 0;\n}\n"}
{"label": "1", "index": "1259", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factorize(int a, int b) {\n  int factor, i;\n  if (a == 1)\n    factor = 1;\n  if (a != 1)\n    factor = 0;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0)\n      factor = factor + factorize(a / i, i);\n  }\n  return factor;\n}\nint main() {\n  int n, a;\n  for (scanf(\"%d \", &n); n--; cout << factorize(a, 2) << endl) {\n    scanf(\"%d \", &a);\n  }\n}\n"}
{"label": "1", "index": "1260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cal(int M, int N) {\n  int i;\n  int num = 0;\n  if (M == 1)\n    return 0;\n  if (N >= M)\n    return (1 + cal(M, M - 1));\n  for (i = 2; i < M; i++) {\n    if (M % i == 0 && i <= N)\n      num = num + cal(M / i, i);\n  }\n  return num;\n}\nint main() {\n  int n, M;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> M;\n    cout << cal(M, M) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s(int n, int m) {\n  if (n == 1)\n    return 1;\n  int an = 0;\n  for (int i = m; i > 1; i--) {\n    if (n % i == 0)\n      an += s(n / i, min(i, n / i));\n  }\n  return an;\n}\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  int x;\n  for (N; N > 0; N--) {\n    cin >> x;\n    cout << s(x, x) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int func(int a, int b);\n  int n;\n  cin >> n;\n  while (n--) {\n    int number;\n    cin >> number;\n    cout << func(number, number) << endl;\n  }\n  return 0;\n}\n\nint func(int a, int b) {\n  if (a == 1)\n    return 1;\n\n  if (b == 1)\n    return 0;\n\n  if (a % b == 0)\n    return func(a / b, b) + func(a, b - 1);\n\n  return func(a, b - 1);\n}\n"}
{"label": "1", "index": "1263", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fj(int n, int m) {\n  int i;\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      sum++;\n      fj(n / i, i);\n    }\n  }\n}\nint main() {\n  int j, N;\n  int a[100];\n  cin >> N;\n  for (j = 1; j <= N; j++) {\n    cin >> a[j];\n  }\n  for (j = 1; j <= N; j++) {\n    sum = 0;\n    fj(a[j], 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s = 0;\nvoid f(int x, int y) {\n  int i, j, k;\n  if (x == 1)\n    s++;\n  else {\n    for (; y <= x; y++) {\n      if (x % y == 0)\n        f(x / y, y);\n    }\n  }\n}\nint main() {\n  int n, k, q, j;\n  scanf(\"%d\", &q);\n  for (j = 0; j < q; j++) {\n    cin >> n;\n    f(n, 2);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;               \nvoid f(int n, int d) \n{\n  int i;\n  if (n == 1) \n    t++;\n  else {\n    for (i = d; i <= n; i++) {\n      if (n % i == 0) {\n        f(n / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int number[100];\n  int n, i;\n  int result[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    f(number[i], 2);\n    result[i] = t;\n  }\n  for (i = 0; i < n; i++) {\n    cout << result[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int n, int m);\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    printf(\"%d\\n\", f(num, 2));\n  }\n  return 0;\n}\nint f(int n, int m) {\n  int i, count = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0) {\n      count += f(n / i, i);\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "1267", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int count = 0;\n  for (int i = min; i <= a; i++) {\n    if (i == a) {\n      count += 1;\n    }\n    if (a % i == 0) {\n      count += factor(a / i, i);\n    }\n  }\n  return count;\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int a;\n    cin >> a;\n    int result = factor(a, 2);\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fun(int m, int n);\n  int n, i, sum;\n  scanf(\"%d\", &n);\n  int *p;\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    sum = fun(p[i], 1);\n    printf(\"%d\\n\", sum);\n  }\n  free(p);\n}\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum = sum + fun(m / i, i);\n    }\n  } else {\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0)\n        sum = sum + fun(m / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1269", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint zhi(int a);\nint yin(int m, int t);\nint main() {\n  int n, i = 0;\n  int str[10000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &str[i]);\n  i = 0;\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", yin(str[i], 2));\n  return 0;\n}\n\nint zhi(int a) {\n  int k = 2, flag = 0;\n  for (k = 2; k <= a / 2; k++) {\n    if (a % k == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  return flag;\n}\n\nint yin(int m, int t) {\n  int j = t, c = 0, b = 0, x = 0;\n  int str1[10000][2];\n  if (m < t && m != 1)\n    return 0;\n  else if (m == 1)\n    return 1;\n  else if (zhi(m) == 0)\n    return 1;\n  else\n    for (j = t; j <= m; j++) {\n      if (m % j == 0) {\n        str1[c][0] = m / j;\n        str1[c][1] = j;\n        c++;\n      }\n    }\n  for (b = 0; b < c; b++) {\n    x += yin(str1[b][0], str1[b][1]);\n  }\n  return x;\n}\n"}
{"label": "1", "index": "1270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zhi(int a);\nint yin(int m, int t);\nint main() {\n  int n, i = 0;\n  int str[10000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  i = 0;\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", yin(str[i], 2));\n  return 0;\n}\n\nint zhi(int a) {\n  int k = 2, flag = 0;\n  for (k = 2; k <= a / 2; k++) {\n    if (a % k == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  return flag;\n}\n\nint yin(int m, int t) {\n  int j = t, c = 0, b = 0, x = 0;\n  int str1[10000][2];\n  if (m < t && m != 1)\n    return 0;\n  else if (m == 1)\n    return 1;\n  else if (zhi(m) == 0)\n    return 1;\n  else\n    for (j = t; j <= m; j++) {\n      if (m % j == 0) {\n        str1[c][0] = m / j;\n        str1[c][1] = j;\n        c++;\n      }\n    }\n  for (b = 0; b < c; b++) {\n    x += yin(str1[b][0], str1[b][1]);\n  }\n  return x;\n}\n"}
{"label": "1", "index": "1271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  int i, p, q;\n  for (i = b, p = 0; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      q = f(a / i, i);\n      p = p + q;\n    }\n  }\n  p++;\n  return (p);\n}\nint main() {\n  int i, a, n, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    k = f(a, 2);\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int y) {\n  int a = sqrt(n);\n  for (int i = y; i <= a; i++) {\n    if (n % i == 0) {\n      sum++;\n      y = i;\n      f(n / i, y);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    sum = 0;\n    f(num, 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int m, int n) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (sum = 0, i = m; i <= n; i++)\n    if (n % i == 0)\n      sum += f(i, n / i);\n  return sum;\n}\nint main() {\n  int i, n, k;\n  for (i = 0, cin >> n; i < n; i++) {\n    scanf(\"%d \", &k);\n    cout << f(2, k) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1274", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint f(int a, int b) {\n  if (a == 1)\n    return 1;\n  else {\n    int c, d, i;\n    c = 0;\n    d = (int)sqrt((double)a);\n    for (i = b; i <= a; i++) {\n      if (!(a % i))\n        c += f(a / i, i);\n    }\n    return c;\n  }\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl;\n  }\n  cin.get();\n  cin.get(); \n  return 0;\n}\n"}
{"label": "1", "index": "1275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num, s = 1;\nvoid divide(int n, int a) {\n  for (int i = n; i <= a / s; i++) {\n    s *= i;\n    if (s == a)\n      num++;\n    else if (s < a && a % s == 0)\n      divide(i, a);\n    s /= i;\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    num = 0;\n    scanf(\"%d \", &a);\n    divide(2, a);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, ans, a[20];\n\nvoid calc(int dep, int x) {\n  if (x == 1) {\n    ans++;\n    return;\n  }\n  for (int i = a[dep - 1]; i <= x; i++)\n    if (!(x % i)) {\n      a[dep] = i;\n      calc(dep + 1, x / i);\n    }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (a[0] = 2; n; n--) {\n    scanf(\"%d\", &m);\n    ans = 0;\n    calc(1, m);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1277", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i;\nint fenjie(int x, int t) {\n  int j;\n  if (x == 1 || x == 2)\n    return 1;\n  int s = 1;\n  for (j = t; j <= sqrt(x); j++) {\n    if (x % j == 0)\n      s += fenjie((x / j), j);\n  }\n  return s;\n}\n\nint main() {\n  int n, a[100], x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = fenjie(x, 2);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1278", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int k = 0;\n  if (a >= 2 * b) {\n    for (int i = b; i <= a / b; i++) {\n      if (a % i == 0 && a / i >= i) {\n        k += f(a / i, i) + 1;\n      }\n    }\n  } else {\n    k = 0;\n  }\n  return k;\n}\n\nint main() {\n  int n, a, t;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> a;\n    t = f(a, 2) + 1;\n    cout << t << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1279", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  if (m < n || m / n == 1)\n    return 0;\n  if ((m % n == 0) && m / n >= n)\n    return f(m / n, n) + f(m, n + 1) + 1;\n  else\n    return f(m, n + 1);\n}\nint main() {\n  int q, i;\n  cin >> q;\n  for (i = 1; i <= q; i++) {\n    int p;\n    cin >> p;\n    cout << f(p, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int s = 0, i;\n  for (i = y; i > 1; i--) {\n    if (x % i == 0)\n      s += f(x / i, i);\n  }\n  if (x == 1)\n    return 1;\n  return s;\n}\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", f(a[i], a[i]));\n  return 0;\n}\n"}
{"label": "1", "index": "1281", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fen(int x, int y);\n\nint main() {\n  int n, i, m[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    printf(\"%d\\n\", fen(m[i], 2));\n  }\n  return 0;\n}\n\nint fen(int x, int y) {\n  int j, k;\n  int result = 1;\n  if (x < y)\n    return 0;\n  for (j = y; j < x; j++) {\n    if (x % j == 0)\n      result += fen(x / j, j);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint function_1(int num, int k) {\n  int j;\n  int m = 0;\n  if (num > 1) {\n    for (j = k; j <= num; j++) {\n      if (num % j == 0) {\n        m = m + function_1(num / j, j);\n      }\n    }\n    return m;\n  } else {\n    return 1;\n  }\n}\nint main() {\n  int i, j;\n  int n;\n  cin >> n;\n  int num[100];\n\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << function_1(num[i], 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum;\n\nvoid f(int x, int i) {\n  if (x == 1)\n    sum++;\n  for (; i <= x; i++)\n    if (x % i == 0)\n      f(x / i, i);\n  return;\n}\n\nint main() {\n  int t, a, i = 2;\n  cin >> t; \n  for (a = 0; a < t; a++) {\n    int x;\n    cin >> x;\n    int ans = 1;\n    for (i = 2; i < sqrt(x); i++) {\n      sum = 0;\n      if (x % i == 0)\n        f(x / i, i);\n      ans = ans + sum;\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n}\nint fff(int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "1285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a, int p) {\n  int i, count = 0;\n  for (i = p; i < a; i++) {\n    if (a % i == 0 && a / i >= i) {\n      count++;\n      int k, t;\n      k = (int)sqrt(a / i);\n      for (t = 2; t <= k; t++) {\n        if ((a / i) % t == 0) {\n          count += change(a / i, i);\n          break;\n        }\n      }\n    }\n  }\n  return count;\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int total = 0;\n    cin >> a;\n    total += change(a, 2);\n    printf(\"%d\\n\", total + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1286", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid factor(int, int);\nint result[9999] = {0};\nint j = 0;\nint main() {\n  int times, k = 1;\n  cin >> times;\n  while (k <= times) {\n    int num, ansf = 0;\n    cin >> num;\n    factor(2, num);\n\n    for (int i = 0; i < 9999; i++)\n      if (result[i])\n        ansf++;\n    printf(\"%d\\n\", ansf);\n\n    for (int i = 0; i < 9999; i++)\n      result[i] = 0;\n\n    k++;\n  }\n\n  return 0;\n}\n\nvoid factor(int start, int num) {\n  if (num == 1) {\n    result[j] = 1;\n    j++;\n  }\n\n  for (int i = start; i <= num; i++) {\n    if (num % i == 0)\n      factor(i, num / i);\n  }\n}\n"}
{"label": "1", "index": "1287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t, m, n, i, j, k, xx, x1, x2, x, y, s, n0;\n\nvoid init(int a[], int b[]) {\n  freopen(\"tt.in\", \"r\", stdin);\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n  freopen(\"tt.out\", \"w\", stdout);\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n}\nvoid proce(int n, int b) {\n  int i;\n  if (n == 1)\n    s++;\n  else\n    for (i = b; i <= n0; i++)\n      if (!(n % i))\n        proce(n / i, i);\n}\n\nint main() {\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &x);\n    s = 0;\n    n0 = x;\n    proce(x, 2);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1288", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid divide(int n, int a) {\n  for (int i = a; i <= n; i++) {\n    if ((n % i == 0)) {\n      if (n / i == 1)\n        sum++;\n      else\n        divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int N = 0, n = 0, i = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    cin >> n;\n    divide(n, 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid fenjie(int);\n\nint solutionnum = 1; \nint main() {\n  int n, a, i;\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cin >> a;                    \n    fenjie(a);                   \n    cout << solutionnum << endl; \n    solutionnum = 1;             \n  }\n  return 0;\n}\nint yinzi[100] = {2}, i = 0;\n\nvoid fenjie(int x) {\n  int j;\n  for (j = yinzi[i]; j < x; j++) {\n    if (x % j == 0 && x / j >= j) \n    {\n      i++;\n      yinzi[i] = j;  \n      fenjie(x / j); \n      j = yinzi[i];\n      i--; \n      solutionnum++;\n    } \n  }\n}\n"}
{"label": "1", "index": "1290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fun(int x, int y) {\n  int i, sum = 0;\n  for (i = x; i * i <= y; i++)\n    if (y % i == 0) {\n      sum++;\n      sum += fun(i, y / i);\n    }\n  return sum;\n}\nint main() {\n  int n, i, sum;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    n--;\n    scanf(\"%d\", &i);\n    sum = 1;\n    sum += fun(2, i);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int j, num;\n  if (a < min)\n    return 0;\n  num = 1;\n  for (j = min; j < a; j++)\n    if (a % j == 0)\n      num = num + f(a / j, j);\n  return num;\n}\n\nint main() {\n  int n, i, out, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    out = f(a, 2);\n    printf(\"%d\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint counter = 1;\nvoid abc(int a, int b) {\n  int i;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0 && (a / i) >= i) {\n      counter++;\n      abc(a / i, i);\n    }\n  }\n}\nint main() {\n  int t, x;\n  cin >> t;\n  for (x = 1; x <= t; x++) {\n    counter = 1;\n    int m;\n    cin >> m;\n    abc(m, 2);\n    printf(\"%d\\n\", counter);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num(int, int, int);\nint qufen(int);\nint power(int, int);\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t >= 1) {\n    int n, i, x, sum = 1;\n    cin >> n;\n    x = qufen(n);\n    for (i = 2; i <= x; i++)\n      sum = sum + num(n, i, 2);\n    printf(\"%d\\n\", sum);\n    t--;\n  }\n  return 0;\n}\nint qufen(int n) {\n  int j;\n  for (j = 1;; j++) {\n    if (power(2, j) > n) {\n      return j - 1;\n      break;\n    }\n  }\n}\nint power(int a, int b) {\n  int sum = 1, k;\n  for (k = 1; k <= b; k++)\n    sum = sum * a;\n  return sum;\n}\nint num(int n, int g, int h) {\n  if ((g == 1) && (n >= h))\n    return 1;\n  int i, j = 0, count = 0, a[20000];\n  for (i = h; i < n; i++) {\n    if (n % i == 0) {\n      a[j] = i;\n      j++;\n    }\n  }\n  if (j == 0)\n    return 0;\n  else {\n    for (i = 0; i < j; i++)\n      count = count + num(n / a[i], g - 1, a[i]);\n    return count;\n  }\n}\n"}
{"label": "1", "index": "1294", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    sum = 0;\n  else if (n == m)\n    sum = 1;\n  else {\n    for (i = m; i <= n; i++)\n      if (n % i == 0)\n        sum = sum + f(n / i, i);\n  }\n  return (sum);\n}\nint main() {\n  int x, j, a[100000];\n  scanf(\"%d\", &x);\n  for (j = 0; j < x; j++)\n    cin >> a[j];\n  for (j = 0; j < x; j++)\n    printf(\"%d\\n\", f(a[j], 2));\n}\n"}
{"label": "1", "index": "1295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int min, int a) {\n  if (min > a)\n    return 0;\n\n  int i;\n  int num = 1;\n  for (i = min; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      num = num + f(i, a / i);\n  }\n\n  return num;\n}\nint main() {\n  int m, a, j;\n  scanf(\"%d \", &m);\n  for (j = 0; j < m; j++) {\n    cin >> a;\n    printf(\"%d\\n\", f(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int f) {\n  if (a == f)\n    return 1;\n  if (a < f)\n    return 0;\n  if (a % f == 0)\n    return factor(a, f + 1) + factor(a / f, f);\n  else\n    return factor(a, f + 1);\n}\n\nint main() {\n  int x, a;\n  scanf(\"%d \", &x);\n  while (x > 0) {\n    cin >> a;\n    cout << factor(a, 2) << endl;\n    x--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sep(int a, int b) {\n  int i;\n  int ans = 0;\n  if (a == 1)\n    ans = 1;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0) {\n      ans += sep(a / i, i);\n    }\n  }\n  return ans;\n}\nint baka(int a) {\n  int cirno;\n  cirno = sep(a, 2);\n  return cirno;\n}\nint main() {\n  int n, pre;\n  int i;\n  int ans;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> pre;\n    ans = baka(pre);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int x, int k) {\n  int t = 1, i;\n  if (k > x) {\n    return 0;\n  }\n  for (i = k; i < x; i++) {\n    if (x % i == 0) {\n      t = t + fenjie(x / i, i);\n    }\n  }\n  return t;\n}\nint main() {\n  int j, p, n, a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    printf(\"%d\", fenjie(a[j], 2));\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid f(int x, int min) {\n  int p;\n  if (x == 1) {\n    sum++;\n  } else\n    for (p = min; p <= x; p++)\n      if (x % p == 0)\n        f(x / p, p);\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> k;\n    for (j = 2; j <= k; j++)\n      if (k % j == 0)\n        f(k / j, j);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1300", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint num;\n\nvoid divide(int a, int k) {\n  int i;\n  if (a == 1)\n    num++;                 \n  for (i = k; i <= a; i++) \n    if (a % i == 0)\n      divide(a / i, i);\n}\n\nint main() {\n  int t;\n  cin >> t;\n  while (t--) {\n    int n;\n    cin >> n;\n    num = 1;\n    int i;\n    for (i = 2; i * i <= n; i++)\n      if (n % i == 0)\n        divide(n / i, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1301", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint resolution_into_factors(int j, int i) {\n  int m, sum = 0, k = 0;\n  for (m = j; m <= sqrt(i); m++) {\n    if (i % m == 0) {\n      sum = resolution_into_factors(m, i / m) + sum + 1;\n      k++;\n    }\n  }\n  if (k == 0)\n    return 0;\n  return sum;\n}\nint main() {\n  int n, k, i;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d \", &i);\n    printf(\"%d\\n\", resolution_into_factors(2, i) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1302", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint kind(int k, int a) {\n  int i, j, temp = 0;\n  int x;\n  for (i = a; i < k; i++) {\n    if (i <= k / i && k % i == 0) {\n\n      x = k / i;\n\n      temp++;\n      for (j = i; j < x; j++) {\n        if (j <= x / j && x % j == 0) {\n          temp = temp + kind(x, j);\n          break;\n        }\n      }\n    }\n  }\n\n  return (temp);\n}\nint main() {\n  int n, i, s, a[32768][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i][0];\n    a[i][1] = kind(a[i][0], 2);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i][1] + 1);\n\n  return 0;\n}\n"}
{"label": "1", "index": "1303", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint times;\nint move(int a, int num) {\n  int i;\n  if (num == 1)\n    times++;\n  for (i = 2; i <= num; i++)\n    if (num % i == 0 && i >= a)\n      move(i, num / i);\n  return times;\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    times = 0;\n    b[i] = move(1, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int a, int b) {\n  int i, r;\n  r = 1;\n  for (i = b; i < a; i++) {\n    if (((a / i) * i) == a && (a / i) >= i)\n      r = r + divide(a / i, i);\n  }\n  return r;\n}\nint main() {\n  int s, p, n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &p);\n    s = divide(p, 2);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1305", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sum = 0;\nint geshu(int a, int x) {\n  int y, z;\n  z = a;\n  y = (int)sqrt(a);\n  while (x <= y) {\n    if (a % x == 0) {\n      a = a / x;\n      geshu(a, x);\n    }\n    if (a == z / x)\n      a = z;\n    x++;\n  }\n  sum++;\n  return sum;\n}\nint main() {\n  int n, i, a[100], b[100], x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 2 || a[i] == 3)\n      b[i] = 1;\n    else {\n      sum = 0;\n      x = 2;\n      b[i] = geshu(a[i], x);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "1", "index": "1306", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a = 0, s = 0;\nvoid find(int n, int prim) {\n  if (n == a)\n    s++;\n  else {\n    for (int i = prim; i <= a / n; i++)\n      if ((a % (n * i) == 0)) {\n        find(n * i, i);\n      }\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    s = 0;\n    for (int i = 2; i <= a; i++) {\n      if (a % i == 0) {\n        find(i, i);\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid f(int a, int b) {\n  int j;\n  if (a == 1)\n    count_1 += 1;\n  else {\n    for (j = b; j <= a; j++) {\n      if (a % j == 0)\n        f(a / j, j);\n    }\n  }\n}\nint main() {\n  int n, i, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    cin >> number;\n    f(number, 2);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1308", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint x[1000] = {0};\nvoid f(int m, int n, int l) {\n  int i;\n  for (i = m; i <= n; i++) {\n    if (n % i != 0)\n      continue;\n    else {\n      if (n / i == 1) {\n        x[l]++;\n        return;\n      } else\n        f(i, n / i, l);\n    }\n  }\n}\n\nint main() {\n  int a[1000], s, j, sum;\n  cin >> sum;\n  for (j = 1; j <= sum; j++) {\n    cin >> a[j];\n    s = 2;\n    f(s, a[j], j);\n  }\n  for (j = 1; j <= sum; j++) {\n    printf(\"%d\\n\", x[j]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (n < min)\n    return 0;\n  for (i = min; i < n; i++)\n    if (n % i == 0)\n      result += f(n / i, i);\n  return result;\n}\nint main() {\n  int cases, a;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", f(a, 2));\n  }\n}\n"}
{"label": "1", "index": "1310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n = 0, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << Factorization(num, 2) + 1 << endl;\n  }\n  return 0;\n}\n\nint Factorization(int num, int n) {\n  int count = 0;\n  for (int i = n; num / i >= i; i++)\n    if (num % i == 0) {\n      count++;\n      count = count + Factorization(num / i, i);\n    }\n  return count;\n}\n"}
{"label": "1", "index": "1311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t, m, n, i, j, k, xx, x1, x2, x, y, s, n0;\n\nvoid init(int a[], int b[]) {\n  freopen(\"tt.in\", \"r\", stdin);\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n  freopen(\"tt.out\", \"w\", stdout);\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n}\nvoid proce(int n, int b) {\n  int i;\n  if (n == 1)\n    s++;\n  else\n    for (i = b; i <= n0; i++)\n      if (!(n % i))\n        proce(n / i, i);\n}\n\nint main() {\n  \n  \n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    s = 0;\n    n0 = x;\n    proce(x, 2);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = 2; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          if (i < q)\n            continue;\n          else\n            sum = sum + f(i, x / i);\n        }\n      }\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum, p;\n  p = 0;\n  sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int a, int b) {\n  int c = 1, i;\n  for (i = b; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      c += fenjie(a / i, i);\n  }\n  return c;\n}\nint main() {\n  int n, i, a, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    c = fenjie(a, 2);\n    cout << c << \" \";\n  }\n}\n"}
{"label": "1", "index": "1314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, count = 0, flag = 0;\n  if (m == 1)\n    return 1;\n  for (i = n; i > 1; i--) {\n    if (m % i == 0) {\n      count += f(m / i, i);\n      flag = 1;\n    }\n  }\n  if (flag)\n    return count;\n  else\n    return 0;\n}\nint main() {\n  int n, k, m, temp;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> m;\n    cout << f(m, m) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1315", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint answer = 0;\nint a = 2;\nvoid f(int, int);\nint main() {\n  int n = 0;\n  int i = 0;\n  int data[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> data[i];\n  }\n  for (i = 0; i < n; i++) {\n    f(data[i], a);\n    cout << answer << endl;\n    answer = 0;\n  }\n  return 0;\n}\nvoid f(int m, int n) {\n  int i = 0;\n  if (m == 1) {\n    answer = answer + 1;\n  }\n  for (i = n; i <= m; i++) {\n    if (m % i == 0) {\n      f(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int, int, int);\nint g_num, g_count;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    g_count = 0;\n    cin >> g_num;\n    fenjie(2, g_num, 1);\n    cout << g_count << endl;\n  }\n  return 0;\n}\nvoid fenjie(int a, int num, int sum) {\n  while (a <= g_num) {\n    sum *= a;\n    if (sum == g_num)\n      g_count++;\n    if (sum < g_num)\n      fenjie(a, g_num, sum);\n    if (sum > g_num)\n      return;\n    sum /= a;\n    a++;\n  }\n}\n"}
{"label": "1", "index": "1317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s(int, int);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << s(a, 2) << endl; \n  }\n  return 0;\n}\nint s(int a, int b) {\n  int i, t = 0;\n  for (i = b; i < a; i++)\n    if (a % i == 0 && a / i >= i) \n      t = t + s(a / i, i);        \n  return t + 1;\n}\n"}
{"label": "1", "index": "1318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int N, int min) {\n  int s = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      s += f(N / i, i);\n  }\n  return s;\n}\n\nint main() {\n  int n, i, b = 2;\n  int a[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", f(a[i], b));\n  return 0;\n}\n"}
{"label": "1", "index": "1319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int a, int b) {\n  int i, sign = 0, k = 0;\n  if (a < b)\n    return 0;\n  else if (a == b)\n    return 1;\n  else {\n    for (i = 2; i <= a - 1; i++) {\n      if (a % i == 0)\n        sign = 1;\n    }\n    if (sign != 1)\n      return 1;\n    else {\n      for (i = b; i <= a; i++) {\n        if (a % i == 0)\n          k += fenjie(a / i, i);\n      }\n      k += 1;\n      return k;\n    }\n  }\n}\n\nint main() {\n  int n, a[100], i, k;\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n\n    cin >> k;\n    printf(\"%d\\n\", fenjie(k, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1320", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100];\n  int i;\n  int f(int x, int min); \n\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i]);\n  }\n\n  return 0;\n}\n\nint f(int x, int min) {\n  int y = 0;\n  int i;\n\n  if (x == 1)\n    y = 1;\n\n  else {\n    for (i = min; i <= x; i++) {\n      if (x % i == 0) {\n        y = y + f(x / i, i);\n      }\n    }\n  }\n\n  return y;\n}\n"}
{"label": "1", "index": "1321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int c);\nint j, b;\nint main() {\n  int i, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int a, int c) {\n  int j, b = 0;\n  for (j = c; j <= sqrt(a); j++) {\n\n    if (a % j == 0) {\n      b = b + f(a / j, j);\n    }\n  }\n  return b + 1;\n}\n"}
{"label": "1", "index": "1322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zy(int a, int b);\n  int j, n, m, sum;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d\", &m);\n    sum = zy(2, m);\n    printf(\"%d\\n\", sum);\n  }\n}\nint zy(int a, int b) {\n  int i, c, t = 1;\n  c = 0;\n  if (a == 0)\n    c = c + 1;\n  else {\n    for (i = a; i * i <= b; i++) {\n      if (b % i == 0)\n        c = zy(i, (b / i)) + c;\n    }\n    if (i * i > b)\n      c = c + 1;\n  }\n  return (c);\n}\n"}
{"label": "1", "index": "1323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint de(int s, int a) {\n  int sum = 0;\n  if (a == 1)\n    return 1;\n  else if (s > a)\n    return 0;\n  for (int i = s; i <= a; i++) {\n    if (a % i == 0)\n      sum = sum + de(i, a / i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n > 0) {\n    int a;\n    cin >> a;\n    printf(\"%d\\n\", de(2, a));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1324", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint yinshu(int num, int min);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int a, result;\n    cin >> a;\n    result = yinshu(a, 2) + 1;\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n\nint yinshu(int num, int min) {\n  int r, x = 0;\n  if (num < min) {\n    return 0;\n  } else {\n    for (r = min; r * r <= num; r++) {\n      if (num % r == 0) {\n        x = x + 1 + yinshu(num / r, r);\n      }\n    }\n    return x;\n  }\n}\n"}
{"label": "1", "index": "1325", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, a;\nvoid find(int i, int x) {\n  for (int j = i; j * j <= x && i != 1; j++)\n    if (x / j * j == x) {\n      find(j, x / j);\n      k++;\n    }\n}\nint main() {\n  int n;\n  for (scanf(\"%d \", &n); n--;) {\n    k = 0;\n    scanf(\"%d \", &a);\n    find(2, a);\n    printf(\"%d\\n\", ++k);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1326", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int x, int b) {\n  int j, re = 1;\n  if (x < b)\n    return 0;\n  for (j = b; j < x; j++) {\n    if (x % j == 0)\n      re = re + f(x / j, j);\n  }\n  return re;\n}\n"}
{"label": "1", "index": "1327", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sort(int, int, int);\n\nint main() {\n  int t = 0;\n  cin >> t;\n  int k = 1;\n  for (k = 1; k <= t; k++) {\n    int vacancy = 0;\n    int num = 1;\n    cin >> num;\n    int i = 1;\n    int temp = num;\n    for (i = 2; i <= temp; i++) {\n      while (temp % i == 0) {\n        vacancy = vacancy + 1;\n        temp = temp / i;\n      }\n    }\n    cout << sort(1, vacancy, num) << endl;\n  }\n  return 0;\n}\n\nint sort(int start, int vacancy, int num) {\n  if (num < start)\n    return 0;\n\n  if (vacancy == 1)\n    return 1;\n\n  int sum = 0;\n  int i = 1;\n  for (i = start; i <= num; i++) {\n    if (num % i == 0)\n      sum = sum + sort(i, vacancy - 1, num / i);\n  }\n\n  return sum;\n}\n"}
{"label": "1", "index": "1328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal(int, int);\nint main() {\n\n  int n = 0;\n  cin >> n;\n\n  for (int i = 0; i < n; i++) {\n    int m = 0;\n    cin >> m;\n\n    cout << cal(m, 2) << endl;\n  }\n\n  return 0;\n}\n\nint cal(int m, int i) {\n  int count = 0;\n  if (m == 1)\n    return 1;\n  for (i; i <= m; i++) {\n\n    if (m % i == 0)\n      count += cal(m / i, i);\n  }\n\n  return count;\n}\n"}
{"label": "1", "index": "1329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  int i, p, q;\n  for (i = b, p = 0; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      q = f(a / i, i);\n      p = p + q;\n    }\n  }\n  p++;\n  return (p);\n}\nint main() {\n  int i, a, n, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    k = f(a, 2);\n    cout << k << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, sum;                  \nint fenjie(int min, int max) \n{\n  int i;                               \n  for (i = min; i <= sqrt(max); i++) { \n    if (max % i == 0 && i <= max / i) {\n      sum++; \n      fenjie(i, max / i);\n    } \n    if (i > max / i)\n      break;\n  }\n  return sum;\n}\nint main() {\n  int i, k;\n  cin >> k; \n  for (i = 0; i < k; i++) {\n    cin >> n;\n    sum = 1;            \n    sum = fenjie(2, n); \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ys(int af, int bf) {\n  int s;\n  if (af < bf)\n    s = 0;\n  if (af == bf)\n    s = 1;\n  if (af > bf) {\n    s = 1;\n    for (int i = af / 2; i >= bf; i--) {\n      if (af % i == 0) {\n        s += ys(af / i, i);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int n;\n  cin >> n;\n  int p;\n  while (scanf(\"%d \", &p)) {\n    cout << ys(p, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint wtf(int p, int a);\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    cout << wtf(2, a) << \"\\n\";\n  }\n  return 0;\n}\n\nint wtf(int p, int a) {\n  int i, ways = 0, j = 0;\n  int m = (int)sqrt(a);\n  for (; p <= m; p++) {\n    if (a % p == 0 && a >= p * p) {\n      ways = ways + wtf(p, a / p);\n      j++;\n    }\n  }\n  if (j == 0)\n    return 1;\n  else\n    return ways + 1;\n}\n"}
{"label": "1", "index": "1333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 0;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0) {\n      n++;\n      n += f(x / a, a);\n    }\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  scanf(\"%d\", &m);\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = 1 + f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    cout << n[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1334", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count(int x, int y) \n{\n  if (x < y)\n    return 0; \n  if (x >= y) {\n    int sum = 0;\n    for (int j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + count(x / j, j); \n    }\n    return sum + 1;\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cout << count(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int func(int a, int b);\n  int n;\n  cin >> n;\n  while (n--) {\n    int number;\n    cin >> number;\n    cout << func(number, number) << endl;\n  }\n  return 0;\n}\n\nint func(int a, int b) {\n  if (a == 1)\n    return 1;\n\n  if (b == 1) {\n    return 0;\n  }\n  if (a % b == 0) {\n    return func(a / b, b) + func(a, b - 1);\n  }\n  return func(a, b - 1);\n}\n"}
{"label": "1", "index": "1336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int x, int y) {\n  int i;\n  for (i = 2; i < x; i++) {\n    if (x % i == 0) {\n      break;\n    }\n  }\n  if (i == x) {\n    return 1;\n  } else {\n    int sum = 0;\n    if (x == y) {\n      for (i = y / x + 1; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1;\n    } else {\n      for (i = y / x; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else {\n          continue;\n        }\n      }\n      return sum + 1;\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  const int m = n;\n  int a[m], j;\n  for (j = 0; j < n; j++) {\n    cin >> a[j];\n  }\n  for (j = 0; j < n; j++) {\n    cout << factor(a[j], a[j]) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint times = 1;\nint used[1000] = {0};\nvoid fuck(int n) {\n\n  int i = 0;\n  for (i = 2; i <= sqrt(n); i++) {\n    if (used[i] == 0 && n % i == 0) {\n      int j = 0;\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 1;\n      times++;\n      fuck(n / i);\n      for (j = 0; j <= i - 1; j++)\n        used[j] = 0;\n    }\n  }\n}\nint main() {\n  int n = 0;\n  int num = 0;\n  scanf(\"%d \", &n);\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    fuck(num);\n    printf(\"%d\\n\", times);\n    times = 1;\n    int k = 0;\n    for (k = 0; k <= 999; k++)\n      used[k] = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(int i, int a) {\n  int means = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (; i <= (int)sqrt(a); i++) {\n    if (a % i == 0) {\n      means += check(i, a / i);\n    }\n  }\n  return means;\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << check(2, a) << endl;\n  }\n}\n"}
{"label": "1", "index": "1339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Factorize(int n, int fact);\nint number = 0;\nint main() {\n  int times, num, i;\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    cin >> num;\n    Factorize(num, 2);\n    printf(\"%d\\n\", number);\n    number = 0;\n  }\n  return 0;\n}\nvoid Factorize(int n, int fact) {\n  int i;\n  for (i = fact; i <= sqrt(n); i++) {\n    if (n % i == 0)\n      Factorize(n / i, i);\n  }\n  number++;\n}\n"}
{"label": "1", "index": "1340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint count_1;\nvoid f(int a, int b) {\n  int j;\n  if (a == 1)\n    count_1 += 1;\n  else {\n    for (j = b; j <= a; j++) {\n      if (a % j == 0)\n        f(a / j, j);\n    }\n  }\n}\nint main() {\n  int n, i, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count_1 = 0;\n    scanf(\"%d \", &number);\n    f(number, 2);\n    cout << count_1 << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1341", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factorization(int num, int i);\nint main() {\n  int n, i, num;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", factorization(num, 2));\n  }\n  return 0;\n}\n\nint factorization(int num, int i) {\n  int j, squ, sum = 1;\n  squ = sqrt((double)num);\n  for (j = i; j <= squ; j++) {\n    if (num % j == 0)\n      sum = sum + factorization(num / j, j);\n  }\n  return sum;\n};\n"}
{"label": "1", "index": "1342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint means(int, int);\nint main() {\n  int n, i = 0;\n  scanf(\"%d \", &n);\n  while (i < n) {\n    int a;\n    scanf(\"%d \", &a);\n    cout << means(a, a) << endl;\n    i++;\n  }\n  return 0;\n}\n\nint means(int a, int b) {\n  int i, sum = 0;\n  if (a != 1) {\n    for (i = b; i >= 2; i--) {\n      if (a % i == 0) {\n        sum = sum + means(a / i, i);\n      }\n    }\n    return sum;\n  } else {\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "1343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint dispose(int, int);\n\nint main() {\n  int n, i, p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p;\n    cout << dispose(p, 2) << \"\\n\";\n  }\n  return 0;\n}\n\nint dispose(int p, int y) {\n  int i, sol = 1;\n  for (i = y; i <= (int)(sqrt(p)); i++) {\n    if (p % i == 0) {\n      sol += dispose(p / i, i);\n    }\n  }\n  return sol;\n}\n"}
{"label": "1", "index": "1344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i = 0;\nint f(int n, int m) {\n  int k = 0;\n  if (m == 1)\n    i++;\n  else {\n    for (k = n; k <= m; k++) {\n      if (m % k == 0) {\n        n = k;\n        f(n, m / n);\n      }\n    }\n  }\n  return (i);\n}\nint main() {\n  int n, b, c;\n  cin >> n;\n  int a;\n  for (b = 0; b < n; b++) {\n    scanf(\"%d \", &a);\n    c = f(2, a);\n    cout << c << endl;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1345", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint j = 2;\n\nint kinds(int x) {\n  int sum = 1;\n  if (x == 1)\n    return 0;\n  for (int i = j; i <= sqrt(x); i++)\n    if (x % i == 0) {\n      sum += kinds(x / i);\n      j = i + 1;\n    }\n  return sum;\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int x = 0;\n    cin >> x;\n    printf(\"%d\\n\", kinds(x));\n    j = 2;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1346", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (n < min)\n    return 0;\n  for (i = min; i < n; i++)\n    if (n % i == 0)\n      result += f(n / i, i);\n  return result;\n}\nint main() {\n  int cases, a;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint count_1;\nvoid fun(int m, int n) {\n  if (m <= sqrt(n)) {\n    for (int a = m; a <= sqrt(n); a++) {\n      if (n % a == 0) {\n        count_1++;\n        fun(a, n / a);\n      } else\n        count_1 = count_1;\n    }\n  } else\n    count_1 = count_1;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    count_1 = 0;\n    int num;\n    scanf(\"%d\", &num);\n    for (int j = 2; j <= sqrt(num); j++) {\n      if (num % j == 0) {\n        count_1++;\n        fun(j, num / j);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid fenjie(int n, int x) {\n  extern int num;\n  if (n == 1)\n    num++;\n  else\n\n    for (int i = x; i <= n; i++)\n      if (n % i == 0)\n        fenjie(n / i, i);\n}\nint main() {\n  int n, k;\n  cin >> k;\n  for (int j = 0; j != k; j++) {\n    extern int num;\n    num = 0;\n    scanf(\"%d \", &n);\n    fenjie(n, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1349", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint factor(int num, int minA1) {\n  int count = 0;\n  int sqrtNum;\n  int i;\n\n  if (num <= minA1)\n    return 0;\n\n  sqrtNum = (int)sqrt((double)num);\n  for (i = minA1; i <= sqrtNum; i++)\n    if (num % i == 0) {\n      count++;                     \n      count += factor(num / i, i); \n    }\n\n  return count;\n}\n\nint main() {\n  int n;\n  int num;\n\n  cin >> n;\n\n  while (n--) {\n    cin >> num;\n    cout << factor(num, 2) + 1 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid fun(int m, int n) {\n  if (m <= sqrt(n)) {\n    for (int a = m; a <= sqrt(n); a++) {\n      if (n % a == 0) {\n        count_1++;\n        fun(a, n / a);\n      } else\n        count_1 = count_1;\n    }\n  } else\n    count_1 = count_1;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    count_1 = 0;\n    int num;\n    scanf(\"%d\", &num);\n    for (int j = 2; j <= sqrt(num); j++) {\n      if (num % j == 0) {\n        count_1++;\n        fun(j, num / j);\n      }\n    }\n    printf(\"%d \", count_1 + 1);\n  }\n}\n"}
{"label": "1", "index": "1351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factoring(int a, int b) {\n  int i, kind = 0;\n\n  if (a == 1) {\n    kind = 1;\n\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n\n  return kind;\n}\n\nint main() {\n  int n, x[40000], i;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    x[i] = factoring(x[i], 2);\n    cout << x[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int x, int y) {\n  int i;\n  for (i = 2; i < x; i++) {\n    if (x % i == 0) {\n      break;\n    }\n  }\n  if (i == x) {\n    return 1;\n  } else {\n    int sum = 0;\n    if (x == y) {\n      for (i = y / x + 1; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else\n          continue;\n      }\n      return sum + 1;\n    } else {\n      for (i = y / x; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          sum = sum + factor(x / i, x);\n        } else {\n          continue;\n        }\n      }\n      return sum + 1;\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  const int m = n;\n  int a[m], j;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d \", &a[j]);\n  }\n  for (j = 0; j < n; j++) {\n    cout << factor(a[j], a[j]) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int k, int w, int t, int x);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    cin >> x;\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(1, q - 1, 1, x);\n    printf(\"%d\\n\", l, x);\n  }\n  return 0;\n}\nint fff(int k, int w, int t, int x) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(k + 1, w, i, x);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "1354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint make(int x, int t) {\n  int ans = 0, i;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++)\n    if (x % i == 0)\n      ans += make(x / i, i);\n  return ans;\n}\nint main() {\n  int i, k, j, p, n, t, m, x;\n  scanf(\"%d\", &t);\n  for (p = 1; p <= t; p++) {\n    cin >> n;\n    x = make(n, 2);\n    cout << x << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int start);\n\nint main() {\n  int n, i, integ;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> integ;\n    cout << fenjie(integ, 2) << \"\\n\";\n  }\n  return 0;\n}\n\nint fenjie(int a, int start) {\n  int i, sum = 1;\n  if (start == a)\n    sum = 1;\n  else {\n    for (i = start; i <= sqrt(a); i++) {\n      if (a % i == 0)\n        sum = sum + fenjie(a / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint f(int a, int m) \n{\n  if (a < m)\n    return 0;\n  int kind = 1;\n  for (int i = m; i < a; i++) {\n    if (a % i == 0) \n      kind = kind + f(a / i, i);\n  }\n  return kind;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) \n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cout << f(a[i], 2) << endl; \n  return 0;\n}\n"}
{"label": "1", "index": "1357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint varieties = 0;     \nvoid factor(int, int); \nint main()             \n{\n  int n = 0, num = 0, i = 0; \n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    varieties = 0;\n    cin >> num;\n    factor(2, num); \n    cout << varieties << endl;\n  }\n  return 0;\n}\nvoid factor(int first, int num) \n{\n  int i = 0;\n  if (num == 1) \n  {\n    varieties++;\n  } else {\n    for (i = first; i <= num; i++) \n    {\n      if (num % i == 0) {\n        factor(i, num / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "1358", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num0;\nint factor(int x, int y) {\n  int countn = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (int i = y; i <= sqrt(x); i++)\n    if (x % i == 0)\n      countn += factor(x / i, i);\n  return countn;\n}\nint main() {\n  int n, j;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> num0;\n    cout << factor(num0, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int a, int s) {\n  int i;\n  if (a == 1)\n    sum++;\n  else {\n\n    for (i = s; i <= a; i++) {\n      if (a % i == 0)\n        f((a / i), i);\n    }\n  }\n  return;\n}\n\nint main() {\n  int n, num, j;\n  scanf(\"%d \", &n);\n  for (j = 1; j <= n; j++) {\n    cin >> num;\n    f(num, 2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num = 0;\nvoid asd(int i, int q) {\n  int j;\n  for (j = q; j > 1; j--) {\n    if (i % j != 0)\n      continue;\n    if (i == j) {\n      num++;\n    } else {\n      q = j;\n      asd(i / j, q);\n    }\n  }\n}\nint main() {\n  int n, o;\n  scanf(\"%d \", &n);\n  for (o = 0; o < n; o++) {\n    num = 0;\n    int a;\n    scanf(\"%d \", &a);\n    asd(a, a);\n    if (num == 1)\n      cout << 1 << endl;\n    else\n      cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1361", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int a, int i) {\n  int ret = 1;\n  for (; i <= sqrt((float)a); i++) {\n    if (a % i == 0)\n      ret += sum(a / i, i);\n  }\n  return ret;\n}\nint main() {\n  int t, a, j;\n  scanf(\"%d \", &t);\n\n  for (j = 0; j < t; j++) {\n    scanf(\"%d \", &a);\n    cout << sum(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid f(int k, int n) {\n  int i, flag = 0;\n  for (i = k; i <= n; i++) {\n    if (n % i == 0) {\n      f(i, n / i);\n      flag = 1;\n    }\n  }\n  if ((flag == 0 && k <= n) || n == 1) {\n    num++;\n  }\n}\nint main() {\n  int i, n, m;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    f(2, n);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint disintegerate(int a, int b) \n{\n  if (a == b || b == 1) \n    return 1;\n  if (a > b) \n    return 0;\n  int ans = 0;                 \n  for (int i = a; i <= b; i++) \n  {\n    if (b % i == 0)                        \n      ans = ans + disintegerate(i, b / i); \n  }\n  return ans; \n}\n\nint main() \n{\n  int Time;\n  cin >> Time; \n  while (Time > 0) {\n    int n;\n    cin >> n;                            \n    cout << disintegerate(2, n) << endl; \n    Time--;                              \n  }\n\n  return 0;\n} \n"}
{"label": "1", "index": "1364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 2;\nint manners(int a) { \n  int count = 1, t = 0;\n  t = sqrt((double)a);\n  for (int i = m; i <= t; i++) { \n    if (a % i == 0) {\n      m = i;                          \n      count = count + manners(a / i); \n    }\n  }\n  return count; \n}\nint main() {\n  int n, b;\n  int i = 1;\n  cin >> n;\n  while (i <= n) {\n    cin >> b;\n    cout << manners(b) << endl;\n    m = 2; \n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint multiply(int a, int b) {\n  int i = 0, n = 0, sum = 1;\n  if (a < b)\n    return 0;\n  else {\n    for (i = b; i <= a; i++) \n    {\n      if (a % i == 0) {\n        sum = sum + multiply(a / i, i); \n      }\n    }\n    return sum;\n  }\n}\nint main() {\n  int n = 0, m = 0, i = 0, sum = 0, num, result[1000];\n  cin >> n;\n  do \n  {\n    cin >> num;\n    result[i] = multiply(num, 2); \n    i = i + 1;\n    m = m + 1;\n  } while (m < n);\n  for (i = 0; i < n; i++) \n  {\n    cout << result[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  else {\n    for (i = min; i <= a; i++) {\n      if (a % i == 0) {\n\n        result += f(a / i, i);\n      }\n    }\n    return result;\n  }\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    cout << f(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int min);\nint main() {\n  int n, i, a[100], sum[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum[i] = f(a[i], 2);\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n\nint f(int m, int min) {\n  int i, sum = 0;\n  if (m == min || m == 1)\n    return 1;\n  else if (m < min)\n    return 0;\n  else if (m > min) {\n    for (i = min; i <= m; i++) {\n      if (m % i == 0)\n        sum += f(m / i, i);\n    }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1368", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint DFS(int, int);\nint main() {\n  int q;\n  cin >> q;\n  for (int i = 0; i < q; i++) {\n    int n;\n    int h = 0;\n    cin >> n;\n    cout << DFS(n, n) << endl;\n  }\n\n  return 0;\n}\nint DFS(int n, int p) {\n  int ans = 0;\n  if (n == 1)\n    return 1;\n  for (int i = 2; i <= p; i++) {\n    if (n % i == 0) {\n      ans = ans + DFS(n / i, i);\n    }\n  }\n  return ans;\n}\n"}
{"label": "1", "index": "1369", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint yinshu(int n, int m) {\n  int i, sum = 0; \n  if (n == 1)     \n    return 1;\n  for (i = m; i <= n; i++) \n  {\n    if (n % i == 0)            \n      sum += yinshu(n / i, i); \n  }\n  return sum;\n}\nint main() \n{\n  int n, i, m;             \n  cin >> n;                \n  for (i = 1; i <= n; i++) \n  {\n    cin >> m;                     \n    cout << yinshu(m, 2) << endl; \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "1370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = q; i <= sqrt(x); i++)\n        if (x % i == 0)\n          sum = sum + f(i, x / i);\n\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "1", "index": "1371", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid breakup(int, int);\nint sum;\nint main() {\n  int n, x, count = 0;\n  cin >> n;\n  while (count < n) {\n    sum = 0;\n    count++;\n    cin >> x;\n    if (x > 3)\n      breakup(x, 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n\nvoid breakup(int x, int j) {\n  int i, p, m;\n  m = x;\n  p = sqrt((double)x);\n  for (i = j; i <= p; i++)\n    if (m % i == 0) {\n      sum++;\n      x = m / i;\n      breakup(x, i);\n    }\n  return;\n}\n"}
{"label": "1", "index": "1372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) {\n  int s = 0, i;\n  for (i = y; i > 1; i--) \n  {\n    if (x % i == 0)\n      s += f(x / i, i); \n  }\n  if (x == 1)\n    return 1;\n  return s;\n}\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cout << f(a[i], a[i]) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, t = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0) {\n      s += divide(n / i, i);\n      t++;\n    }\n  if (t == 0)\n    return 0;\n  return s;\n}\nint main() {\n  int n, k;\n  cin >> k;\n  while (k > 0) {\n    cin >> n;\n    cout << divide(n, n) << \"\\n\";\n    k--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a == 1)\n    return 1;\n  else {\n    int c, d, i;\n    c = 0;\n    d = (int)sqrt((double)a);\n    for (i = b; i <= a; i++) {\n      if (!(a % i))\n        c += f(a / i, i);\n    }\n    return c;\n  }\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) << \"\\n\";\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "1375", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ans;\n\nvoid dfs(int, int);\n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    ans = 0;\n    dfs(num, 2);\n    cout << ans << endl;\n  }\n  return 0;\n}\n\nvoid dfs(int x, int f) {\n  if (x == 1) {\n    ++ans;\n    return;\n  }\n  for (int i = f; i <= x; ++i)\n    if (x % i == 0) {\n      dfs(x / i, i);\n    }\n  return;\n}\n"}
{"label": "1", "index": "1376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint ans = 0;\nint work(int p, int k) {\n  if (p == 1) {\n    ans++;\n    return (p * k, k);\n  }\n  for (int i = k; i <= p; i++) {\n    if (p % i == 0) {\n      work(p / i, i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    ans = 0;\n    int t;\n    cin >> t;\n    work(t, 2);\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1377", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num = 1, i, factor;\n\nvoid f(int factor, int x) {\n  for (; factor * factor <= x; factor++) {\n    if (x % factor == 0) {\n      num++;\n      f(factor, x / factor);\n    }\n  }\n}\n\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    cin >> a;\n    f(2, a);\n    cout << num << endl;\n    num = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint prime(int n) {\n  int i, judge = 1;\n  for (i = 2; i < n; i++) {\n    if (n % i == 0)\n      judge = 0;\n  }\n  return judge;\n}\nint function_1(int number, int x) {\n  int temp = 0, i, result = 0;\n  if (!prime(number)) {\n    for (i = x; i <= number; i++)\n      if (number % i == 0) {\n        x = i;\n        temp = number / i;\n        result += function_1(temp, x);\n      }\n  } else if ((number >= x || number == 1) && prime(number))\n    result = 1;\n  return result;\n}\nint main() {\n  int i, times, number;\n  cin >> times;\n  for (i = 0; i < times; i++) {\n    scanf(\"%d \", &number);\n    cout << function_1(number, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0)\n      sum += f(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  int a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint factor(int N, int min);\nint main() {\n  int m, n, i, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    k = factor(m, 2);\n    cout << k << \"\\n\";\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      result += factor(N / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1381", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint temp = 2, sum = 0;\nvoid dg(int x) {\n  for (int i = temp; i <= x; i++) {\n    if (x % i == 0) {\n      temp = i;\n      if (x / i == 1) {\n        sum++;\n        temp = 2;\n      } else\n        dg(x / i);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int x;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    dg(x);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int f(int, int);\n  int n[100], sum, i, m;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++) {\n    sum = f(1, n[i]) + 1;\n    printf(\"%d\\n\", sum);\n  }\n}\n\nint f(int i, int n) {\n  int j, k, sum = 0;\n  for (j = i; j < (int)sqrt((double)n) + 1; j++) {\n\n    k = sum;\n    if (j == 1)\n      sum = 0;\n    else {\n      if (n % j == 0 && n / j >= j) {\n        sum = f(j, n / j) + 1;\n      } else\n        sum = 0;\n    }\n    sum = sum + k;\n  }\n  return (sum);\n}\n"}
{"label": "1", "index": "1383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factor(int N, int min);\nint main() {\n  int m, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    k = factor(m, 2);\n    printf(\"%d\\n\", k);\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int result = 1, i;\n  if (N < min)\n    return 0;\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      result += factor(N / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a < b)\n    return 0;\n  int i, r = 1;\n  for (i = b; i <= a; i++) {\n    if (!(a % i) && i <= a / i) {\n      r += f(a / i, i);\n    }\n  }\n  return r;\n}\nint main() {\n  int n, m;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &m);\n    int result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1385", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int m, int n) {\n\n  if (m > sqrt(n))\n    return 0;\n\n  if (n % m == 0)\n    return fun(m + 1, n) + fun(m, n / m) + 1;\n  else\n    return fun(m + 1, n);\n}\n\nint main() {\n  int i, x, y;\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d \", &y);\n    cout << fun(2, y) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid TRY(int, int);\nint num = 1;\nint main() {\n  unsigned short int n;\n  int INTEGER;\n  cin >> n;\n  while (n-- > 0) {\n    cin >> INTEGER;\n    int h = 2;\n    TRY(h, INTEGER);\n    cout << num << endl;\n    num = 1;\n  }\n  return 0;\n}\nvoid TRY(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if ((b % i == 0) && (b / i != 1)) {\n      num++;\n      TRY(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int shu, int min) {\n  int k = 1;\n  if (shu < min) {\n    k = 0;\n    return k;\n  } else {\n    for (int i = min; i < shu; i++) {\n      if (shu % i == 0) {\n        k = k + f(shu / i, i);\n      }\n    }\n    return k;\n  }\n}\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n\n    if (i != n - 1)\n      printf(\"%d \", f(a, 2));\n    else\n      printf(\"%d\", f(a, 2));\n  }\n}\n"}
{"label": "1", "index": "1388", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint ana(int n, int p) {\n  int i;\n  int t, s = 1;\n  t = pow(n, 0.5);\n  for (i = p; i <= t; i++)\n    if (n % i == 0)\n      s = s + ana(n / i, i); \n  return s;\n}\n\nint main() {\n  int n;\n  int a[100];\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cout << ana(a[i], 2) << endl; \n  return 0;\n}\n"}
{"label": "1", "index": "1389", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if (y == x)\n    return 1;\n  if (y > x)\n    return 0;\n  if (x % y == 0)\n    return f(x, y + 1) + f(x / y, y);\n  else\n    return f(x, y + 1);\n}\nint main() {\n  int n, x;\n  cin >> n;\n  int z, i;\n  i = n;\n  while (i > 0) {\n    i = i - 1;\n    cin >> x;\n    z = f(x, 2);\n    printf(\"%d\\n\", z);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d(int, int);\nint main() {\n  int i, n, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", d(x, 2));\n  }\n  return 0;\n}\nint d(int x, int y) {\n  int j, num = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2) {\n    return 1;\n  }\n  for (j = y; j <= (int)sqrt((double)x); j++)\n    if (x % j == 0) {\n      num += d(x / j, j);\n    }\n  return num;\n}\n"}
{"label": "1", "index": "1391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cc;\nvoid fen(int x, int h);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cc = 0;\n    int ff;\n    cin >> ff;\n    fen(ff, 2);\n    printf(\"%d\\n\", cc);\n  }\n  return 0;\n}\nvoid fen(int x, int h) {\n  for (int i = 2; i <= x; i++) {\n    if ((x % i == 0) && (i >= h) && (i < x))\n      fen(x / i, i);\n    if ((x % i == 0) && (i >= h) && (i == x))\n      cc++;\n  }\n}\n"}
{"label": "1", "index": "1392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint prime(int n, int m) {\n  int i, total = 1;\n  if (n < m)\n    return 0;\n\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      total += prime(n / i, i);\n  }\n  return total;\n}\nint main() {\n  int n, b[2000], b0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b0);\n    b[i] = prime(b0, 2);\n  }\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "1", "index": "1393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 1;\nint kk(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--)\n    if (a % i == 0)\n      return a / i;\n  return 0;\n}\nint seperate(int a, int b) {\n  int i;\n  for (i = b; i >= 2; i--) {\n    if (a % i == 0 && (a / i) <= i) {\n      sum++;\n      if ((a / i) == 2)\n        continue;\n      else\n        seperate(a / i, a / i - 1);\n    } else if ((a % i == 0) && ((kk(a / i, i)) != 0)) {\n      seperate(a / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << seperate(m, m - 1) << \"\\n\";\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fun(int m, int n) {\n  int i, sum = 1;\n  if (n == 1) {\n    for (i = 2; i * i <= m; i++) {\n      if (m % i == 0)\n        sum += fun(m / i, i);\n    }\n  } else\n    for (i = n; i * i <= m; i++) {\n      if (m % i == 0) {\n        sum += fun(m / i, i);\n      }\n    }\n  return sum;\n}\nint main() {\n  int n, i, b;\n  int a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &b);\n    a[i] = fun(b, 1);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cal(int, int);\nint main() {\n\n  int n = 0;\n  scanf(\"%d \", &n);\n\n  for (int i = 0; i < n; i++) {\n    int m = 0;\n    scanf(\"%d \", &m);\n\n    cout << cal(m, 2) << endl;\n  }\n\n  return 0;\n}\n\nint cal(int m, int i) {\n  int count = 0;\n  if (m == 1)\n    return 1;\n  for (i; i <= m; i++) {\n\n    if (m % i == 0)\n      count += cal(m / i, i);\n  }\n\n  return count;\n}\n"}
{"label": "1", "index": "1396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, n, k;\n\nint work(int p, int n) {\n  if (n == 1)\n    k++;\n  for (int i = p; i <= n; i++)\n    if (n % i == 0)\n      work(i, n / i);\n}\nint main() {\n  int m;\n  cin >> m;\n  while (m > 0) {\n    cin >> n;\n    k = 0;\n    work(2, n);\n    cout << k << endl;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0;\nvoid devide(int, int);\nint main() {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &m);\n    s = 0;\n    devide(2, m);\n    printf(\"%d\\n\", s + 1);\n  }\n  return 0;\n}\n\nvoid devide(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if (b % i == 0) {\n      s++;\n      devide(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0, p;\nint dfs(int dep, int last, int k) {\n  if (k == 1) {\n    varieties++;\n    return 0;\n  }\n  for (int i = last; i <= k; i++)\n    if (k % i == 0) {\n      dfs(dep + 1, i, k / i);\n    }\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  int m[n];\n  for (i = 0; i < n; i++) {\n    cin >> t;\n    dfs(0, 2, t);\n    m[i] = varieties;\n    varieties = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << m[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint function_1(int num, int k) {\n  int j;\n  int m = 0;\n  if (num > 1) {\n    for (j = k; j <= num; j++) {\n      if (num % j == 0) {\n        m = m + function_1(num / j, j);\n      }\n    }\n    return m;\n  } else\n    return 1;\n}\nint main() {\n  int i, j;\n  int n;\n  scanf(\"%d \", &n);\n  int num[100];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", function_1(num[i], 2));\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1400", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nvoid breakup(int, int);\nint sum;\nint main() {\n  int n, x, count = 0;\n  cin >> n; \n  while (count < n) {\n    sum = 0;\n    count++;  \n    cin >> x; \n    if (x > 3)\n      breakup(x, 2);         \n    cout << sum + 1 << endl; \n  }\n  return 0;\n}\n\nvoid breakup(int x, int j) {\n  int i, p, m;\n  m = x;               \n  p = sqrt((double)x); \n  for (i = j; i <= p; i++)\n    if (m % i == 0) \n    {\n      sum++; \n      x = m / i;\n      breakup(x, i);\n    }\n  return;\n}\n"}
{"label": "1", "index": "1401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fen(int m, int k) {\n  int i, t = 1, n = 0;\n  for (i = 2; i <= m; i++) {\n    if (m % i == 0)\n      n++;\n  }\n  if (n == 1 || m == 1)\n    return 1;\n  else\n    for (i = 2; i <= m; i++) {\n      if (m % i == 0 && m / i >= i && i >= k) {\n        k = i;\n        t = t + fen(m / i, k);\n      }\n    }\n  return t;\n}\nint main() {\n  int fen(int m, int k);\n  int n, i, x;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    cout << fen(x, 1) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1402", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint factorize(int n, int j) {\n  int F = 1;\n  for (; j <= sqrt(n); j++)\n    if (n % j == 0)\n      F += factorize(n / j, j);\n  return F;\n}\nint main() {\n  int i, m, n[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> n[i];\n  for (i = 0; i < m; i++)\n    printf(\"%d\\n\", factorize(n[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "1403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0;\nvoid f(int x, int y) {\n  int i, j, k;\n  if (x == 1)\n    s++;\n  else {\n    for (; y <= x; y++) {\n      if (x % y == 0) {\n        f(x / y, y);\n      }\n    }\n  }\n}\nint main() {\n  int n, k, q, j;\n  scanf(\"%d\", &q);\n  for (j = 0; j < q; j++) {\n    scanf(\"%d\", &n);\n    f(n, 2);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int l) {\n  int re = 0, j;\n  if (l == 4)\n    re = 1;\n  if (l > 4) {\n    for (j = m; j <= sqrt(l); j++) {\n      if (l % j == 0) {\n        re = re + 1 + f(j, l / j);\n      }\n    }\n  }\n  return re;\n}\nint main() {\n  int n, i, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", (f(2, a[i]) + 1));\n  }\n}\n"}
{"label": "1", "index": "1405", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calc(int a, int b) {\n  if (a * a > b)\n    return 1;\n  if (b % a == 0)\n    return (calc(a, b / a) + calc(a + 1, b));\n  return calc(a + 1, b);\n}\nint main(const char *argv[]) {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << calc(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1406", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint col(int a, int b);\nint main() {\n  int n, i, m, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m);\n    l = col(m, 2) + 1;\n    printf(\"%d\\n\", l);\n  }\n  return 0;\n}\nint col(int a, int b) {\n  int i, t, tt = 0, sig = 0;\n  for (i = b; (i < a / 2) && ((a / i) >= i); i++) {\n    if (a % i == 0) {\n      t = a / i;\n      tt = tt + 1 + col(t, i);\n      sig = 1;\n    }\n  }\n  if (sig == 0)\n    tt = 0;\n  return (tt);\n}\n"}
{"label": "1", "index": "1407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a = 1;\nint yinzi(int j, int n) {\n  for (int i = j; i < n; i++) {\n    if (n % i == 0 && n != i && n / i >= i) {\n      a++;\n      yinzi(i, n / i);\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, s;\n  cin >> s;\n  for (int j = 0; j < s; j++) {\n    cin >> n;\n    for (int i = 2; i <= n; i++) {\n      if (n % i == 0 && n / i >= i) {\n        a++;\n        yinzi(i, n / i);\n      }\n    }\n    cout << a << endl;\n    a = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0, t; \nvoid dg(int s)  \n{\n  for (int i = s; i <= t; i++) {\n    if (t % i == 0) \n    {\n      t = t / i;\n      if (t == 1)\n        sum++; \n      else\n        dg(i); \n      t = t * i;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) \n  {\n    cin >> t;\n    dg(2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint elm[100] = {0};\nint counts = 0, num = 0;\nvoid Try(int b, int s) {\n  int j;\n  for (j = 2; j <= num; j++) {\n    if (j >= elm[s - 1]) {\n      if (b % j == 0) {\n        elm[s] = j;\n        if (b / j == 1)\n          counts++;\n        else if (b / j < j)\n          continue;\n        else\n          Try(b / j, s + 1);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    counts = 0;\n    cin >> num;\n    Try(num, 1);\n    cout << counts << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint disassamble(int, int);\nint main() {\n  int n;\n  int i = 1;\n  int a, result;\n  cin >> n;\n  while (i <= n) {\n    i++;\n    cin >> a;\n    result = disassamble(a, 2);\n    cout << result << endl;\n  }\n\n  return 0;\n}\nint disassamble(int a, int y) {\n  int i, count = 1;\n  if (a == 1)\n    return 0;\n  if (a == 2)\n    return 1;\n  for (i = y; i * i <= a; i++) {\n    if (a % i == 0) {\n      count = disassamble(a / i, i) + count;\n    }\n  }\n  return count;\n}\n"}
{"label": "1", "index": "1411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenj(int x, int y) {\n  int a = (x == 1), i;\n  for (i = y; i <= x; i++)\n    if (x % i == 0)\n      a = a + fenj(x / i, i);\n  return a;\n}\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k];\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < k; i++) {\n    cout << fenj(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid divide(int n, int a) {\n  for (int i = a; i <= n; i++) {\n    if ((n % i == 0)) {\n      if (n / i == 1)\n        sum++;\n      else\n        divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int N = 0, n = 0, i = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    cin >> n;\n    divide(n, 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1413", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint F(int min, int a) {\n  int i;\n  int sum = 0;\n  if (min == a)\n    return 1;\n  if (a == 1)\n    return 1;\n  for (i = min; i <= a; i++) {\n    if (a % i == 0)\n      sum += F(i, a / i);\n  }\n  return sum;\n}\n\nint main() {\n  int a, n;\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", F(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1414", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint dispose(int, int);\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p;\n    cout << dispose(p, 2) << endl;\n  }\n  return 0;\n}\n\nint dispose(int p, int y) {\n  int i, sol = 1; \n  for (i = y; i <= (int)(sqrt(p)); i++) {\n    if (p % i == 0) {\n      sol += dispose(p / i, i); \n    }\n  }\n  return sol;\n}\n"}
{"label": "1", "index": "1415", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint work(int m, int n) {\n  if (m == n)\n    return 1;\n  if (m % n != 0)\n    return 0;\n  int sum = 0;\n  for (int i = n; i <= m / n; i++)\n    sum += work(m / n, i);\n  return sum;\n}\nint main() {\n  int n, m;\n  cin >> n;\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    int s = 0;\n    for (j = 2; j <= m; j++)\n      s += work(m, j);\n\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1416", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint fen(int m, int k) {\n  int i, t = 1, n = 0;\n  for (i = 2; i <= m; i++) {\n    if (m % i == 0)\n      n++;\n  }\n  if (n == 1 || m == 1)\n    return 1;\n  else {\n    for (i = 2; i <= m; i++) {\n      if (m % i == 0 && m / i >= i && i >= k) {\n        k = i;\n        t = t + fen(m / i, k);\n      }\n    }\n  }\n  return t;\n}\nint main() {\n  int fen(int m, int k);\n  int n, i, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    printf(\"%d\\n\", fen(x, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1417", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, t, cnt;\nvoid f(int left, int last) {\n  if (left < last) {\n    if (left == 1)\n      cnt++;\n    return;\n  }\n  for (int i = last; i <= left; i++)\n    if (left % i == 0)\n      f(left / i, i);\n}\nint main() {\n  cin >> t;\n  while (t--) {\n    scanf(\"%d\", &n);\n    cnt = 0;\n    f(n, 2);\n    printf(\"%d\\n\", cnt);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1418", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0;\nvoid factor(int, int);\nint main() {\n  int n = 0, num = 0, i = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    varieties = 0;\n    cin >> num;\n    factor(2, num);\n    cout << varieties << endl;\n  }\n  return 0;\n}\nvoid factor(int first, int num) {\n  int i = 0;\n  if (num == 1) {\n    varieties++;\n  } else {\n    for (i = first; i <= num; i++) {\n      if (num % i == 0) {\n        factor(i, num / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "1419", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sort(int, int, int);\n\nint main() {\n  int t = 0;\n  cin >> t;\n  int k = 1;\n  for (k = 1; k <= t; k++) {\n    int vacancy = 0;\n    int num = 1;\n    cin >> num;\n    int i = 1;\n    int temp = num;\n    for (i = 2; i <= temp; i++) {\n      while (temp % i == 0) {\n        vacancy = vacancy + 1;\n        temp = temp / i;\n      }\n    }\n    cout << sort(1, vacancy, num) << endl;\n  }\n  return 0;\n}\n\nint sort(int start, int vacancy, int num) {\n  if (num < start)\n    return 0;\n\n  if (vacancy == 1)\n    return 1;\n\n  int sum = 0;\n  int i = 1;\n  for (i = start; i <= num; i++) {\n    if (num % i == 0) {\n      sum = sum + sort(i, vacancy - 1, num / i);\n    }\n  }\n\n  return sum;\n}\n"}
{"label": "1", "index": "1420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid factor(int x, int limit);\nint result;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int input;\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &input);\n    result = 1;       \n    factor(input, 2); \n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nvoid factor(int x, int limit) {\n  int remainder;\n  if (x < limit) {\n    return;\n  }\n  for (int i = limit; i <= x; i++) {\n    remainder = x % i;\n    if (remainder == 0) {\n      if (x / i >= i) {\n        result++;\n        factor(x / i, i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "1421", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, k, t = 0, m = 0;\n  for (j = 2; j < x; j++)\n    if (x % j == 0)\n      t++;\n  if (t == 0)\n    return 1;\n  else {\n    for (k = y; k <= (int)sqrt((double)x); k++)\n      if (x % k == 0)\n        m = m + f(x / k, k);\n    return (m + 1);\n  }\n}\n"}
{"label": "1", "index": "1422", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int begin, int m) {\n  int i;\n  for (i = begin; i <= m; i++) {\n    if (m % i == 0 && m / i >= i) {\n      sum++;\n      f(i, m / i);\n    }\n    if (i > m / i)\n      break;\n  }\n}\nint main() {\n  int n, j, m;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    cin >> m;\n    f(2, m);\n    cout << sum << endl;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1423", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint varieties = 0;\n\nvoid divide(int forward, int number) {\n  int i;\n  if (number == 1) {\n    varieties++;\n  }\n  for (i = forward; i <= number; i++) {\n    if (number % i == 0) {\n      divide(i, number / i);\n    }\n  }\n}\n\nint main() {\n  int n = 0, num = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    divide(2, num);\n    printf(\"%d\\n\", varieties);\n    varieties = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, c;\nint solutionnumber(int n, int c) {\n  if (n == c)\n    return 1;\n  if (n < c)\n    return 0;\n  if (n % c == 0)\n    return solutionnumber(n / c, c) + solutionnumber(n, c + 1);\n  else\n    return solutionnumber(n, c + 1);\n}\nint main() {\n  int N, a;\n  scanf(\"%d \", &N);\n  while (N > 0) {\n    cin >> a;\n    cout << solutionnumber(a, 2) << endl;\n    N--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint sum(int);     \nint g_count, g_j; \nint main() {\n  int n, a, i; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    g_count = 0;\n    g_j = 2;\n    cin >> a;\n    cout << sum(a) + 1 << endl;\n  }\n  return 0;\n}\nint sum(int a) {\n  int i, b;\n  b = (int)sqrt((double)a);\n  for (i = g_j; i <= b; i++) {\n    if (a % i == 0) \n    {\n      g_j = i; \n      g_count++;\n      sum(a / i);\n    }\n  }\n  return g_count;\n}\n"}
{"label": "1", "index": "1426", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint ifsushu(int n) \n{\n  if (n == 1) {\n    return 1;\n  } else {\n    for (int f = n - 1; f >= 2; f--) \n    {\n      if (n % f == 0)\n        break;\n      if (f == 2) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}\nint sum = 0;\nint zhaoyinshu(int x, int max) {\n  if (x == 1) {\n    sum++;\n    return 0;\n  }\n  for (int i = max; i >= 2; i--) {\n    if (x % i == 0) \n    {\n      zhaoyinshu(x / i, i);\n    }\n  }\n}\nint main() {\n  int time, number, t;\n  cin >> time;\n  for (int j = 0; j < time; j++) {\n    cin >> number;\n    if (ifsushu(number) == 1) {\n      cout << \"1\" << endl;\n    } else {\n      zhaoyinshu(number, number / 2);\n      cout << sum + 1 << endl; \n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1427", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  if (a == 1)\n    return 1;\n  else {\n    int c, d, i;\n    c = 0;\n    d = (int)sqrt((double)a);\n    for (i = b; i <= a; i++) {\n      if (!(a % i))\n        c += f(a / i, i);\n    }\n    return c;\n  }\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "1428", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factor(int, int);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", factor(num, 2));\n  }\n  return 0;\n}\nint factor(int n, int min) {\n  int i;\n  int num = 1;\n  if (n < min)\n    return 0;\n  else {\n    for (i = min; i < n; i++) {\n      if (n % i == 0)\n        num += factor(n / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int, int);\nint main(void) {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (n != 0) {\n    scanf(\"%d \", &a);\n    printf(\"%d\\n\", divide(a, 2));\n    n--;\n  }\n  return 0;\n}\n\nint divide(int x, int t) {\n  int i, sum = 0;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++) {\n    if (x % i == 0)\n      sum += divide(x / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Divide(int a, int b);\nint main() {\n  int Times = 0;\n  int Num = 0;\n  int i = 0;\n  int Temp[100] = {0};\n  cin >> Times;\n  for (i = 0; i < Times; i++) {\n    cin >> Num;\n    Temp[i] = Divide(Num, Num);\n  }\n  for (i = 0; i < Times; i++) {\n    cout << Temp[i] << \"\\n\";\n  }\n  return 0;\n}\n\nint Divide(int a, int b) {\n  int Sum = 0;\n  int i = 0;\n  int Flag = 0;\n  if (a != 1) {\n    for (i = b; i > 1; i--) {\n      if (a % i == 0)\n        Sum += Divide(a / i, i);\n      Flag = 1;\n    }\n  }\n  if (Flag == 0 || a == 1)\n    Sum = 1;\n\n  return Sum;\n}\n"}
{"label": "1", "index": "1431", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int n, int m);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    cout << fun(num, 2) << endl;\n  }\n  return 0;\n}\nint fun(int n, int m) {\n  int sum = 1;\n  double t = sqrt(n);\n  for (int i = m; i <= t; i++)\n    if (n % i == 0)\n      sum += fun(n / i, i);\n  return sum;\n}\n"}
{"label": "1", "index": "1432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint is_bottom, max;\nint div_foo(int n, int min);\n\nint main() {\n\n  int N;\n  scanf(\"%d \", &N);\n  for (int index = 0; index < N; index++) {\n    int k;\n    cin >> k;\n    is_bottom = 0;\n    printf(\"%d\\n\", div_foo(k, 2) + 1);\n  }\n\n  return 0;\n}\n\nint div_foo(int n, int min) {\n  int cal = 0;\n\n  for (int iter = min; iter <= sqrt(n); iter++) {\n    if (!(n % iter)) {\n      cal++;\n      int f1 = n / iter, f2 = iter, g;\n      g = div_foo(f1, f2);\n      cal += g;\n    }\n  }\n  return cal;\n}\n"}
{"label": "1", "index": "1433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 1;\nvoid f(int i, int j) {\n  int k;\n  if (i == 1)\n    sum++;\n  else {\n    for (k = j; k <= i; k++) {\n      if (i % k == 0)\n        f(i / k, k);\n    }\n  }\n}\nint main(void) {\n  int i;\n  int n;\n  int a;\n  scanf(\"%d\", &n);\n  while (n--) {\n    sum = 1;\n    scanf(\"%d\", &a);\n    for (i = 2; i * i <= a; i++) {\n      if (a % i == 0) {\n        f(a / i, i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint multiply(int a, int b) {\n  int i = 0, sum = 1;\n  if (a < b) {\n    return 0;\n  } else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        sum = sum + multiply(a / i, i);\n      }\n    }\n    return sum;\n  }\n}\nint main() {\n  int n = 0, m = 0, i = 0, sum = 0, num, result[1000];\n  cin >> n;\n  do {\n    cin >> num;\n    result[i] = multiply(num, 2);\n    i = i + 1;\n    m = m + 1;\n  } while (m < n);\n  for (i = 0; i < n; i++) {\n    cout << result[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cal;\nint fac(int a, int x) {\n  if (x == 1) {\n    cal++;\n    return 1;\n  }\n  for (int i = 2; i <= x; i++)\n    if (x % i == 0 && i >= a)\n      fac(i, x / i);\n}\nint main() {\n  int n, b;\n  cin >> n;\n  while (n > 0) {\n    cal = 0;\n    scanf(\"%d \", &b);\n    fac(1, b);\n    cout << cal << endl;\n    n--;\n  }\n}\n"}
{"label": "1", "index": "1436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint x[1000] = {0};\nvoid f(int m, int n, int l) {\n  int i;\n  for (i = m; i <= n; i++) {\n    if (n % i != 0)\n      continue;\n    else {\n      if (n / i == 1) {\n        x[l]++;\n        return;\n      } else\n        f(i, n / i, l);\n    }\n  }\n}\n\nint main() {\n  int a[1000], s, j, sum;\n  cin >> sum;\n  for (j = 1; j <= sum; j++) {\n    cin >> a[j];\n    s = 2;\n    f(s, a[j], j);\n  }\n  for (j = 1; j <= sum; j++) {\n    cout << x[j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1437", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid zhongshu(int qian, int a);\nint main() {\n  int n, i, j, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    zhongshu(2, a[i]);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid zhongshu(int qian, int a) {\n  int i, j, c;\n  if (a == 1) {\n    sum = sum + 1;\n    return;\n  }\n  for (i = qian; i <= a; i++) {\n    if (a % i == 0)\n      zhongshu(i, a / i);\n  }\n}\n"}
{"label": "1", "index": "1438", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct node {\n  int s, n;\n};\nvoid cpy_clr(struct node a[], struct node b[]) {\n  int i;\n  for (i = 0; i <= 1000 && (a[i].s != 0 || b[i].s != 0); i++)\n    if (b[i].s != 0) {\n      a[i].s = b[i].s;\n      a[i].n = b[i].n;\n      b[i].s = 0;\n      b[i].n = 0;\n    } else {\n      a[i].s = 0;\n      a[i].n = 0;\n      b[i].n = 0;\n    }\n}\nint chklst(struct node a[], int n) {\n  int i;\n  int result = 0;\n  for (i = 0; a[i].s != 0; i++) {\n    if (a[i].s != n) {\n      result = 0;\n      break;\n    } else\n      result++;\n  }\n  return result;\n}\nvoid init(struct node a[]) {\n  int i;\n  for (i = 0; i < 1000; i++) {\n    a[i].s = 0;\n    a[i].n = 0;\n  }\n}\nint main() {\n  struct node a[1000], b[1000];\n  int i, j, k, l, _n, n, sum = 0;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d\", &_n);\n    for (l = 2; l < _n; l++)\n      if (_n % l == 0) {\n        init(a);\n        init(b);\n        a[0].s = l;\n        a[0].n = l;\n        while (chklst(a, _n) == 0 && a[0].s != 0) {\n          i = 0;\n          k = -1;\n          if (a[0].s == 0)\n            break;\n          while (a[i].s != 0) {\n            if (a[i].s == _n)\n              sum++;\n            else {\n              for (j = a[i].n; j <= (_n / a[i].s); j++)\n                if (_n % (a[i].s * j) == 0) {\n                  b[++k].s = a[i].s * j;\n                  b[k].n = j;\n                }\n            }\n            i++;\n          }\n          cpy_clr(a, b);\n        }\n        i = 0;\n        while (a[i].s != 0) {\n          if (a[i].s == _n)\n            sum++;\n          i++;\n        }\n      }\n    printf(\"%d \", ++sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint division(int m, int k) {\n  int num = 0;\n  if (m >= k) {\n    for (int i = k; i <= m; i++) {\n      if (m == i)\n        num++;\n      else if (m % i == 0) {\n        num += division(m / i, i);\n      }\n    }\n  }\n  return num;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    cout << division(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint Factorization(int n, int k) {\n  int sum = 0;\n  if (n < k) {\n    return 0;\n  }\n  if (n % k == 0) {\n    if (n == k) {\n      return 1;\n    } else {\n      sum = sum + Factorization(n, k + 1) + Factorization(n / k, k);\n    }\n  } else {\n    sum = sum + Factorization(n, k + 1);\n  }\n  return sum;\n}\n\nint main() {\n  int t, i, a;\n  scanf(\"%d \", &t);\n  for (i = 1; i <= t; i++) {\n    scanf(\"%d \", &a);\n    cout << Factorization(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x, int k);\nint main() {\n  int i = 1, n, m;\n  int result;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    result = f(m, 2);\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\nint f(int x, int k) {\n  int a = 0;\n  int i;\n  if (x == 1)\n    return 1;\n  for (i = k; i <= x; i++) {\n    if (x % i == 0) {\n      a = a + f(x / i, i);\n    }\n  }\n  return a;\n}\n"}
{"label": "1", "index": "1442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0; \nvoid ways(int a, int last);\nint main() {\n  int n, num[100], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    ways(num[i], 2);     \n    cout << sum << endl; \n    sum = 0;\n  }\n  return 0;\n}\nvoid ways(int a, int last) {\n  int i, j;\n  for (i = last; i <= a; i++) {\n    if (a < i) \n    {\n    } else if (a == i) \n    {\n      sum++;\n    } else if (a % i == 0) \n    {\n      ways(a / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1443", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fi(int a, int j);\nint main() {\n  int a, n;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", fi(a, 2));\n  }\n}\nint fi(int a, int k) {\n  int i, b = 1;\n  if (a == 1)\n    return 0;\n  for (i = k; i * i <= a; i++)\n    if (a % i == 0)\n      b = b + fi(a / i, i);\n  return b;\n}\n"}
{"label": "1", "index": "1444", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint b[40000] = {0};\nvoid zhishu(int n) {\n  int i, j;\n  for (i = 2; i < sqrt(n); i++) {\n    for (j = 2; j < n / i + 1; j++) {\n      b[i * j] = 1;\n    }\n  }\n}\nint fenjie(int n, int m) {\n  int s = 0, i;\n  if (n < m)\n    return 0;\n  if (n == m || b[n] == 0)\n    return 1;\n  for (i = m; i < n; i++) {\n    if (n % i == 0) {\n      s = s + fenjie(n / i, i);\n    }\n  }\n  return s + 1;\n}\nint main() {\n  int n, i, max = 0, a[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] > max)\n      max = a[i];\n  }\n  zhishu(max);\n  for (i = 0; i < n; i++)\n    cout << fenjie(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint numcount = 0;\nvoid divide(int num, int x) {\n  int i;\n  if (num == 1)\n    numcount++;\n  for (i = x; i <= num; i++) {\n    if (num % i == 0)\n      divide(num / i, i);\n  }\n}\n\nint main() {\n  int n, num, i;\n  int first = 2;\n  int ans[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    divide(num, first);\n    ans[i] = numcount;\n\n    numcount = 0;\n  }\n  for (i = 1; i <= n; i++)\n    cout << ans[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "1446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint work(int m, int n) {\n  if (m == n)\n    return 1;\n  if (m % n != 0)\n    return 0;\n  int sum = 0;\n  for (int i = n; i <= m / n; i++)\n    sum += work(m / n, i);\n  return sum;\n}\nint main() {\n  int n, m, a;\n  cin >> n;\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    int s = 0;\n    for (j = 2; j <= m; j++)\n      s += work(m, j);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, count = 0, flag = 0;\n  if (m == 1)\n    return 1;\n  for (i = n; i > 1; i--) {\n    if (m % i == 0) {\n      count += f(m / i, i);\n      flag = 1;\n    }\n  }\n  if (flag)\n    return count;\n  else\n    return 0;\n}\nint main() {\n  int n, k, m, temp;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d \", &m);\n    cout << f(m, m) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int i, result = 1;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += factor(a / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, i, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    a[i] = factor(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1449", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t;\nint f(int a, int b) {\n  int i;\n  for (i = a; i * i <= b; i++) {\n    if (b % i == 0) {\n      t++;\n      f(i, b / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int n, i, result[1000], a[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    result[i] = f(2, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint sum(int a, int i) {\n\n  if (a == 1) {\n    num++;\n  } else {\n    while (i <= a) {\n      if (a % i == 0) {\n        sum(a / i, i);\n      }\n      i++;\n    }\n  }\n  return num;\n}\nint main() {\n  int a, t, j, i, count;\n  cin >> t;\n  for (j = 0; j < t; j++) {\n    count = 1;\n    cin >> a;\n    i = 2;\n    while (i <= (a / 2)) {\n      if (a % i == 0) {\n        num = 0;\n        sum(a / i, i);\n        count = count + num;\n      }\n      i++;\n    }\n    cout << count << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sdw(int a, int b) {\n  int i;\n  int m = 1;\n  for (i = a; i < b / 2; i++) {\n    if (b % i == 0) {\n      if (i <= b / i)\n        m = sdw(i, b / i) + m;\n    }\n  }\n  return m;\n}\nint main() {\n  int n, i, p, b;\n  int a[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = a[i];\n    p = sdw(2, b);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint counter = 1; \nvoid abc(int a, int b) {\n  int i;\n  for (i = b; i <= a; i++) \n  {\n    if (a % i == 0 && (a / i) >= i) \n    {\n      counter++;\n      abc(a / i, i);\n    }\n  }\n}\nint main() {\n  int t, x;\n  cin >> t;\n  for (x = 1; x <= t; x++) \n  {\n    counter = 1; \n    int m;\n    cin >> m;                \n    abc(m, 2);               \n    cout << counter << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int d, int n) {\n  int sum = 0;\n  for (int i = d; i < n; i++) {\n    if (n % i == 0 && (n / i) >= i) {\n      sum = sum + 1;\n      sum = sum + divide(i, n / i);\n    }\n  }\n  return (sum);\n}\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    cout << divide(2, num) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1454", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint elm[100] = {0};\nint counts = 0, num = 0;\nvoid Try(int b, int s) {\n  int j;\n  for (j = 2; j <= num; j++) {\n    if (j >= elm[s - 1]) {\n      if (b % j == 0) {\n        elm[s] = j;\n        if (b / j == 1)\n          counts++;\n        else if (b / j < j)\n          continue;\n        else\n          Try(b / j, s + 1);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    counts = 0;\n    cin >> num;\n    Try(num, 1);\n    printf(\"%d\\n\", counts);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1455", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 1, k = 0;\nint count(int n) {\n  for (int i = 2; i <= sqrt(n); i++) {\n    if (n % i == 0 && i >= k) {\n      num++;\n      k = i;\n      count(n / i);\n      k = 0;\n    }\n  }\n  return (num);\n}\nint main() {\n  int i, n, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", count(a[i]));\n    num = 1;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    int j = 2, num = 1;\n    while (j <= a / 2) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        num += sum;\n      }\n      j++;\n    }\n    printf(\"\\n%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1457", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum;\nvoid zhongshu(int qian, int a);\nint main() {\n  int n, i, j, a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    zhongshu(2, a[i]);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid zhongshu(int qian, int a) {\n  int i, j, c;\n  if (a == 1) {\n    sum = sum + 1;\n    return;\n  }\n  for (i = qian; i <= a; i++) {\n    if (a % i == 0)\n      zhongshu(i, a / i);\n  }\n}\n"}
{"label": "1", "index": "1458", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factorize(int n, int j) {\n  int F = 1;\n  for (; j <= sqrt(n); j++)\n    if (n % j == 0)\n      F += factorize(n / j, j);\n  return F;\n}\nint main() {\n  int i, m, n[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++)\n    printf(\"%d\\n\", factorize(n[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "1459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fenjie(int, int, int);\nint g_num, g_count;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    g_count = 0;\n    cin >> g_num;\n    fenjie(2, g_num, 1);\n    cout << g_count << \"\\n\";\n  }\n  return 0;\n}\nvoid fenjie(int a, int num, int sum) {\n  while (a <= g_num) {\n    sum *= a;\n    if (sum == g_num)\n      g_count++;\n    if (sum < g_num)\n      fenjie(a, g_num, sum);\n    if (sum > g_num)\n      return;\n    sum /= a;\n    a++;\n  }\n}\n"}
{"label": "1", "index": "1460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int x, int b) {\n  int i, z = 0, c;\n  for (i = b; i <= x; i++) {\n    if (x == i)\n      z = z + 1;\n    else if (x % i == 0) {\n      c = x / i;\n      z = z + fenjie(c, i);\n    }\n  }\n  return (z);\n}\nint main() {\n  int n, i, num, a;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    num = fenjie(a, 2);\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "1", "index": "1461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int num, int i) {\n  int sum;\n  sum = 0;\n  int j;\n  for (j = i; j <= num / 2; j++) {\n    if (num % j == 0) {\n      if (num / j < j) {\n        sum = sum;\n      } else {\n        sum = 1 + sum + f(num / j, j);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, num, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    int j, sum;\n    sum = 0;\n    j = 2;\n    sum += f(num, j);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int x) {\n  int count = 1, i;\n  for (i = x; i < a; i++)\n    if (a % i == 0)\n      count += f(a / i, i);\n  if (i == a)\n    return count;\n  else\n    return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    cin >> a;\n    if (a == 1 || a == 2)\n      printf(\"1\\n\");\n    else\n      printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1463", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fuck(int n, int m) {\n  int i, cnt = 1;\n  if (m >= sqrt(n)) {\n    return 1;\n  }\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      cnt += fuck(n / i, i);\n    }\n  }\n  return cnt;\n}\nint main() {\n  int t, n, k;\n  cin >> t;\n  for (k = 1; k <= t; k++) {\n    cin >> n;\n    printf(\"%d\\n\", fuck(n, 2));\n  }\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "1", "index": "1464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ways(int a, int min);\n  int n, b;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%d\", &b);\n    printf(\"%d\\n\", ways(b, 2));\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  if (a < min)\n    return 0;\n  int sum = 0, i;\n  for (i = min; i <= sqrt(a * 1.0); i++) {\n    if (a % i == 0)\n      sum = sum + ways(a / i, i);\n  }\n  return sum + 1;\n}\n"}
{"label": "1", "index": "1465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint meide(int x, int y) {\n  int sum = 1, count = 0, i;\n  for (i = y; i <= sqrt(x); i++) {\n    if (x % i == 0) {\n      sum = sum + meide(x / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, n, m;\n  scanf(\"%d\", &k);\n  for (m = 0; m < k; m++) {\n    scanf(\"%d\", &n);\n    if (n >= 3) {\n      printf(\"%d\\n\", meide(n, 2));\n    } else\n      printf(\"1\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1466", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct node {\n  int s, n;\n};\nvoid cpy_clr(struct node a[], struct node b[]) {\n  int i;\n  for (i = 0; i <= 1000 && (a[i].s != 0 || b[i].s != 0); i++)\n    if (b[i].s != 0) {\n      a[i].s = b[i].s;\n      a[i].n = b[i].n;\n      b[i].s = 0;\n      b[i].n = 0;\n    } else {\n      a[i].s = 0;\n      a[i].n = 0;\n      b[i].n = 0;\n    }\n}\nint chklst(struct node a[], int n) {\n  int i;\n  int result = 0;\n  for (i = 0; a[i].s != 0; i++) {\n    if (a[i].s != n) {\n      result = 0;\n      break;\n    } else\n      result++;\n  }\n  return result;\n}\nvoid init(struct node a[]) {\n  int i;\n  for (i = 0; i < 1000; i++) {\n    a[i].s = 0;\n    a[i].n = 0;\n  }\n}\nint main() {\n  struct node a[1000], b[1000];\n  int i, j, k, l, _n, n, sum = 0;\n  scanf(\"%d \", &n);\n  while (n--) {\n    scanf(\"%d\", &_n);\n    for (l = 2; l < _n; l++)\n      if (_n % l == 0) {\n        init(a);\n        init(b);\n        a[0].s = l;\n        a[0].n = l;\n        while (chklst(a, _n) == 0 && a[0].s != 0) {\n          i = 0;\n          k = -1;\n          if (a[0].s == 0)\n            break;\n          while (a[i].s != 0) {\n            if (a[i].s == _n)\n              sum++;\n            else {\n              for (j = a[i].n; j <= (_n / a[i].s); j++)\n                if (_n % (a[i].s * j) == 0) {\n                  b[++k].s = a[i].s * j;\n                  b[k].n = j;\n                }\n            }\n            i++;\n          }\n          cpy_clr(a, b);\n        }\n        i = 0;\n        while (a[i].s != 0) {\n          if (a[i].s == _n)\n            sum++;\n          i++;\n        }\n      }\n    printf(\"%d \", ++sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int, int);\nint sum = 0, res = 1;\nint main() {\n  int n, a, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    res = 1;\n    scanf(\"%d \", &a);\n    for (j = 2; j <= (int)sqrt((float)a); j++) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        res += sum;\n      }\n    }\n    cout << res << endl;\n  }\n  return 0;\n}\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0) {\n      f(x / y, y);\n    }\n    y++;\n  }\n  return;\n}\n"}
{"label": "1", "index": "1468", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, n, k;\n\nint work(int p, int n) {\n  if (n == 1)\n    k++;\n  for (int i = p; i <= n; i++)\n    if (n % i == 0)\n      work(i, n / i);\n}\nint main() {\n  int m;\n  cin >> m;\n  while (m > 0) {\n    cin >> n;\n    k = 0;\n    work(2, n);\n    printf(\"%d\\n\", k);\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1469", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint judge1(int n) {\n  int i;\n  if (n == 2 || n == 3 || n == 5)\n    return 1;\n  if (n == 4)\n    return 0;\n  for (i = 2; i * i < n; i++) {\n    if (n % i == 0) {\n      return 0;\n      break;\n    }\n  }\n  if (i * i > n)\n    return 1;\n}\nvoid divide(int n, int d) {\n  for (int i = d; i * i <= n; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, d);\n    }\n    d++;\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n) {\n    n--;\n    cin >> m;\n    num = 1;\n    divide(m, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factor(int a, int min) {\n  int i, result = 1;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += factor(a / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, i, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    a[i] = factor(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      cout << a[i];\n    else\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, c;\nint solutionnumber(int n, int c) {\n  if (n == c)\n    return 1;\n  if (n < c)\n    return 0;\n  if (n % c == 0)\n    return solutionnumber(n / c, c) + solutionnumber(n, c + 1);\n  else\n    return solutionnumber(n, c + 1);\n}\nint main() {\n  int N, a;\n  scanf(\"%d \", &N);\n  while (N > 0) {\n    cin >> a;\n    printf(\"%d\\n\", solutionnumber(a, 2));\n    N--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int, int);\nint main(void) {\n  int n, a;\n  cin >> n;\n  while (n != 0) {\n    cin >> a;\n    cout << divide(a, 2) << endl;\n    n--;\n  }\n  return 0;\n}\n\nint divide(int x, int t) {\n  int i, sum = 0;\n  if (x == 1)\n    return 1; \n  for (i = t; i <= x; i++) {\n    if (x % i == 0)\n      sum += divide(x / i, i); \n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factors(int n, int min) {\n  int varieties = 0, i;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        varieties += factors(n / i, i);\n    }\n  }\n  return varieties;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = factors(a[i], 2);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ys(int x, int min) {\n  int r = 1;\n  if (x < min)\n    return 0;\n  for (int i = min; i < x; i++) {\n    if (x % i == 0)\n      r += ys(x / i, i);\n  }\n  return r;\n}\nint main() {\n  int n, a[1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", ys(a[i], 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1475", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fact(int a, int i) {\n  if (a == 1)\n    sum++;\n  while (i <= a) {\n    if (a % i == 0)\n      fact(a / i, i);\n    i++;\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int a;\n    cin >> a;\n    int i = 2;\n    int result = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fact(a / i, i);\n        result += sum;\n      }\n      i++;\n    }\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int); \nint main()       \n{                \n  int n, i, a[50];\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];                \n    cout << f(a[i], 2) << endl; \n  }\n  return 0; \n} \n\nint f(int n, int p) \n\n{\n  int sum = 0, m;\n  if (n < p)\n    return 0;\n  else {\n    for (m = p; m <= n; m++)\n      if (n % m == 0) {\n        if (m < n)\n          sum = sum + f(n / m, m); \n        if (m == n)\n          sum = sum + 1; \n      }\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int min) {\n  int i, a = 0, x = 0;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0)\n      a = a + 1;\n  if (n == 1) {\n    return 1;\n  } else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n    return x;\n  }\n}\nint main() {\n  int t, j, num;\n  scanf(\"%d\", &t);\n  for (j = 1; j <= t; j++) {\n    scanf(\"%d\", &num);\n    printf(\"%d \", fenjie(num, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1478", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fg(int k, int m) {\n  int j, d = 0;\n  if (m == 1) {\n    d = 1;\n  }\n  for (j = k; j <= m; j++) {\n    if (m % j == 0)\n      d = d + fg(j, m / j);\n  }\n  return (d);\n}\n\nint main() {\n  int n, i, a[40000], b[40000], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = fg(2, a[i]);\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sum = 1;\nvoid f(int i, int j) {\n  int k;\n  if (i == 1)\n    sum++;\n  else {\n    for (k = j; k <= i; k++) {\n      if (i % k == 0) {\n        f(i / k, k);\n      }\n    }\n  }\n}\nint main(void) {\n  int i, j, k;\n  int n;\n  int a;\n  cin >> n;\n  while (n--) {\n    sum = 1;\n    scanf(\"%d\", &a);\n    for (i = 2; i * i <= a; i++) {\n      if (a % i == 0)\n        f(a / i, i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1480", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint p(int a, int m) {\n  int t = 0;\n  int i;\n  if (a % m != 0)\n    return 0;\n  if ((a % m == 0) && (a / m < m) && (a != m))\n    return 0;\n  if (a == m)\n    return 1;\n  if ((a % m == 0) && (a / m >= m)) {\n    for (i = m; i <= a / m; i++) {\n      t = t + p(a / m, i);\n    }\n    return t;\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  int x;\n  int j;\n  int num = 0;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    for (j = 2; j <= x; j++) {\n      num = num + p(x, j);\n    }\n    cout << num << endl;\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int, int);\nint sum = 0, res = 1;\nint main() {\n  int n, a, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) \n  {\n    res = 1; \n    cin >> a;\n    for (j = 2; j <= (int)sqrt((float)a); j++) \n    {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j); \n        res += sum;\n      }\n    }\n    cout << res << endl;\n  }\n  return 0;\n}\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) \n  {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n  return;\n}\n"}
{"label": "1", "index": "1482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int k) {\n  int t = 1, i;\n  if (k > x) {\n    return 0;\n  }\n  for (i = k; i < x; i++) {\n    if (x % i == 0) {\n      t = t + fenjie(x / i, i);\n    }\n  }\n  return t;\n}\nint main() {\n  int j, p, n, a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    cout << fenjie(a[j], 2);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint count(int a, int n) {\n  if (a > n)\n    return 0;\n  if (a == n)\n    return 1;\n  int p = 1;\n  int i;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0 && i <= n / i) {\n      p = p + count(i, n / i);\n    }\n  }\n  return p;\n}\nint geshu(int N) {\n  int i;\n  int s = 1;\n  for (i = 2; i <= sqrt(N); i++) {\n    if (N % i == 0) {\n      s = s + count(i, N / i);\n    }\n  }\n\n  return s;\n}\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  int c[N];\n  int j;\n  for (j = 0; j < N; j++) {\n    cin >> c[j];\n  }\n  for (j = 0; j < N; j++)\n    cout << geshu(c[j]) << endl;\n\n  return 0;\n}\n"}
{"label": "1", "index": "1484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int k);\n\nint main() {\n  int n, i, k, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    k = 2;\n    cout << f(m, k) << \"\\n\";\n  }\n\n  return 0;\n}\nint f(int m, int k) {\n  int m1, sum = 1;\n  m1 = m;\n  while (k <= (int)sqrt(m)) {\n    if (m % k == 0) {\n      m = m / k;\n\n      sum = sum + f(m, k);\n    }\n    m = m1;\n    k++;\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1485", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint solution(int a, int b) {\n  for (int i = b; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1)\n        num++;\n      else\n        num = solution(a, i);\n      a = a * i;\n    }\n  }\n  return num;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num = 0;\n    cout << solution(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a, int b) {\n  if (a > b)\n    return b;\n  else\n    return a;\n}\nint f(int n, int s) {\n  int k = 0, i;\n  if (n == 1)\n    return 1;\n  else if (s == 1)\n    return 0;\n  else if (s > n)\n    return f(n, n);\n  else {\n    for (i = 2; i <= s; i++)\n      if (n % i == 0)\n        k = k + f(n / i, min(i, s));\n    return k;\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cin >> m;\n    cout << f(m, m) << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1487", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid factor(int a, int k);\nint sum = 0;\nint main() {\n  int n, a, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    factor(a, 2);\n    cout << sum + 1 << endl;\n    sum = 0;\n  }\n  return 0;\n}\n\nvoid factor(int a, int k) {\n  int b, j;\n  b = (int)sqrt((double)a);\n  for (j = k; j <= b; j++) {\n    if (a % j == 0) {\n      sum++;\n      factor(a / j, j);\n    }\n  }\n  j = k;\n}\n"}
{"label": "1", "index": "1488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n, int m) {\n  int sum = 1, i;\n  if (n < m)\n    sum = 0;\n  else if (n == m)\n    sum = 1;\n  else {\n    for (i = m; i <= n; i++)\n      if (n % i == 0)\n        sum = sum + f(n / i, i);\n  }\n  return (sum);\n}\nint main() {\n  int x, j, a[100000];\n  scanf(\"%d\", &x);\n  for (j = 0; j < x; j++)\n    cin >> a[j];\n  for (j = 0; j < x; j++)\n    cout << f(a[j], 2) << \"\\n\";\n}\n"}
{"label": "1", "index": "1489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[200][200] = {0};\n  int div[40000] = {0};\n  int divth[200] = {0};\n  int kase = 0;\n  scanf(\"%d \", &kase);\n  for (; kase > 0; kase--) {\n    int n = 0;\n    cin >> n;\n    memset(f, 0, sizeof(f));\n    memset(div, 0, sizeof(div));\n    memset(divth, 0, sizeof(divth));\n    int m = 0;\n    for (int i = 1; i <= n; i++)\n      if (n % i == 0) {\n        div[i] = ++m;\n        divth[m] = i;\n      }\n    f[1][1] = 1;\n    for (int i = 2; i <= m; i++)\n      for (int j = 2; j <= i; j++)\n        for (int k = j; k > 1; k--)\n          if (divth[i] % divth[k] == 0) {\n            int ii = divth[i] / divth[k];\n            int jj = k;\n            if (div[ii] < jj)\n              jj = div[ii];\n            f[i][j] += f[div[ii]][jj];\n          }\n    cout << f[m][m] << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1490", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fen(int a, int k) {\n  int s = 0, j, t = 0;\n  if (a == 1 && a >= k) {\n    s = 1;\n  } else if (a == k) {\n    s = 1;\n  } else {\n    for (j = 2; j <= a; j++) {\n      if (a % j == 0 && j >= k)\n        s = s + fen(a / j, j);\n      t = 1;\n    }\n    if (t == 0)\n      s++;\n  }\n  return s;\n}\nint main() {\n  int n, i, q, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << fen(a, 1) << endl;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "1", "index": "1491", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100];\n  int i;\n  int f(int x, int min);\n\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = f(a[i], 2);\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i]);\n\n  return 0;\n}\n\nint f(int x, int min) {\n  int y = 0;\n  int i;\n\n  if (x == 1)\n    y = 1;\n\n  else {\n    for (i = min; i <= x; i++) {\n      if (x % i == 0)\n        y = y + f(x / i, i);\n    }\n  }\n\n  return y;\n}\n"}
{"label": "1", "index": "1492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cc; \nvoid fen(int x, int h);\nint main() {\n  int n = 0, k = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cc = 0;\n    int ff;\n    cin >> ff;\n    fen(ff, 2);\n    cout << cc << endl;\n  }\n  return 0;\n}\nvoid fen(int x, int h) {\n  for (int i = 2; i <= x; i++) {\n    if ((x % i == 0) && (i >= h) && (i < x))\n      fen(x / i, i);\n    if ((x % i == 0) && (i >= h) && (i == x))\n      cc++;\n  }\n}\n"}
{"label": "1", "index": "1493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int i;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (scanf(\"%d \", &a)) {\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid count(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0)\n      count(N / i, i);\n    i++;\n  }\n  return;\n}\nint main() {\n  int T = 0;\n  cin >> T;\n  while (T--) {\n    int N = 0;\n    cin >> N;\n    int i = 2, total = 1;\n    while (i <= N / 2) {\n      if (N % i == 0) {\n        sum = 0;\n        count(N / i, i);\n        total += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1495", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int t, int k) {\n  int u = 1, i;\n  if (t > 2) {\n    for (i = k; i <= sqrt(t); i++) {\n      if (t % i == 0)\n        u += f(t / i, i);\n    }\n    return u;\n  } else if (t == 2)\n    return 1;\n  else if (t == 1)\n    return 0;\n}\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t);\n    printf(\"%d \", f(t, 2));\n  }\n}\n"}
{"label": "1", "index": "1496", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k, a;                 \nvoid find(int i, int x) { \n  for (int j = i; j * j <= x && i != 1;\n       j++)               \n    if (x / j * j == x) { \n      find(j, x / j);\n      k++;\n    } \n      \n} \nint main() {\n  int n;\n  for (cin >> n; n--;) {\n    k = 0;\n    cin >> a;\n    find(2, a);\n    cout << ++k << endl; \n  }                      \n  return 0;\n}\n"}
{"label": "1", "index": "1497", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint n, c;\nint solutionnumber(int n, int c) { \n  if (n == c)\n    return 1; \n  if (n < c)\n    return 0; \n  if (n % c == 0)\n    return solutionnumber(n / c, c) + solutionnumber(n, c + 1); \n  else\n    return solutionnumber(n, c + 1);\n}\nint main() {\n  int N, a;\n  cin >> N; \n  while (N > 0) {\n    cin >> a;                             \n    cout << solutionnumber(a, 2) << endl; \n    N--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n, int min) {\n  int i, result = 1;\n  if (n < min)\n    return 0;\n  for (i = min; i < n; i++)\n    if (n % i == 0)\n      result += f(n / i, i);\n  return result;\n}\nint main() {\n  int cases, a;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    scanf(\"%d\", &a);\n    cout << f(a, 2) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum(int a, int i) {\n  int ret = 1;\n  for (; i <= sqrt((float)a); i++) {\n    if (a % i == 0) {\n      ret += sum(a / i, i);\n    }\n  }\n  return ret;\n}\nint main() {\n  int t, a, j;\n  cin >> t;\n\n  for (j = 0; j < t; j++) {\n    cin >> a;\n    cout << sum(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1500", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int, int);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    cout << factor(a, 2) << endl;\n  }\n  return 0;\n}\n\nint factor(int a, int b) {\n  int c, i;\n  int num = 1;\n  if (a == 1)\n    return 0;\n  c = sqrt(a);\n  for (i = b; i <= c; i++)\n    if (a % i == 0)\n      num += factor(a / i, i);\n  return num;\n}\n"}
{"label": "1", "index": "1501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b);\n\nint main() {\n  int n, c[100], i, a, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n    a = c[i];\n    sum = f(a, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n\nint f(int a, int b) {\n  int sum = 1;\n  int i;\n  if (a < b)\n    return 0;\n  for (i = b; i < a; i++) {\n    if (a % i != 0)\n      continue;\n    else\n      sum = sum + f(a / i, i);\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fj(int n, int m) {\n  int i, j, k = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      k += fj(n / i, i);\n  }\n  return k;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (; n > 0; n--) {\n    scanf(\"%d \", &i);\n    printf(\"%d\", fj(i, 2));\n    if (n - 1)\n      cout << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], i;\n  void fen(int a[], int x);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fen(a, n);\n  return 0;\n}\nvoid fen(int a[], int x) {\n  int k, b = 2, c, t;\n  int look(int x, int y);\n  for (k = 0; k < x; k++) {\n    c = a[k];\n    t = look(c, b);\n    printf(\"%d\\n\", t);\n  }\n}\nint look(int x, int y) {\n  int total = 1, p;\n  if (x / y == 0) {\n    return 0;\n  } else {\n    for (p = y; p < x; p++) {\n      if (x % p == 0) {\n        total = total + look(x / p, p);\n      }\n    }\n  }\n  return total;\n}\n"}
{"label": "1", "index": "1504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sushu(int a) {\n  int b = 2, c, d = 0, k;\n  while (b < a) {\n    c = a % b;\n    if (c != 0) {\n      b = b + 1;\n      d = d + 1;\n    } else\n      break;\n  }\n\n  if (d == (a - 2))\n    k = 1;\n  else {\n    k = 0;\n  }\n  return k;\n}\nint zheng(int n, int i) {\n  int sum = 1, a;\n  for (a = i; a < n / 2; a++) {\n    if (n % a == 0) {\n      if (a <= n / a) {\n        sum = sum + zheng(n / a, a);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j = 0, k = 0, b[10000] = {0}, e[40000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &e[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (sushu(e[i]) == 0) {\n      b[i] = zheng(e[i], 2);\n    } else {\n      b[i] = 1;\n    }\n  }\n\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    cout << \"\\n\" << b[i];\n  return 0;\n}\n"}
{"label": "1", "index": "1505", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nconst int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};\n\nint m, n, counter;\n\nvoid dfs(int m, int i) {\n\n  if (m == 1) {\n    ++counter;\n    return;\n  }\n  for (; i <= m; ++i) {\n    if (m % i == 0) {\n      dfs(m / i, i);\n    }\n  }\n}\n\nint main() {\n  int t, m, n;\n  cin >> t;\n  while (t--) {\n    counter = 0;\n    cin >> m;\n    dfs(m, 2);\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1506", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int j, k, t = 0, m = 0;\n  for (j = 2; j < x; j++)\n    if (x % j == 0)\n      t++;\n  if (t == 0)\n    return 1;\n  else {\n    for (k = y; k <= (int)sqrt((double)x); k++)\n      if (x % k == 0)\n        m = m + f(x / k, k);\n    return (m + 1);\n  }\n}\n"}
{"label": "1", "index": "1507", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint numcount = 0;\nvoid divide(int num, int x) {\n  int i;\n  if (num == 1)\n    numcount++;\n  for (i = x; i <= num; i++) {\n    if (num % i == 0)\n      divide(num / i, i);\n  }\n}\n\nint main() {\n  int n, num, i;\n  int first = 2;\n  int ans[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    divide(num, first);\n    ans[i] = numcount;\n\n    numcount = 0;\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", ans[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 1;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0)\n      n += f(x / a, a);\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  scanf(\"%d\", &m);\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\\n\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint de(int s, int a) { \n  int sum = 0;         \n  if (a == 1)\n    return 1; \n  else if (s > a)\n    return 0;                  \n  for (int i = s; i <= a; i++) \n    if (a % i == 0)\n      sum = sum + de(i, a / i); \n  return sum;                   \n}\nint main() {                  \n  int n;                      \n  cin >> n;                   \n  while (n > 0) {             \n    int a;                    \n    cin >> a;                 \n    cout << de(2, a) << endl; \n    n--;                      \n  }\n  return 0; \n}\n"}
{"label": "1", "index": "1510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid factor(int, int);\nint result[9999] = {0};\nint j = 0;\nint main() {\n  int times, k = 1;\n  cin >> times;\n  while (k <= times) {\n    int num, ansf = 0;\n    cin >> num;\n    factor(2, num);\n\n    for (int i = 0; i < 9999; i++)\n      if (result[i])\n        ansf++;\n    cout << ansf << endl;\n\n    for (int i = 0; i < 9999; i++)\n      result[i] = 0;\n\n    k++;\n  }\n\n  return 0;\n}\n\nvoid factor(int start, int num) {\n  if (num == 1) {\n    result[j] = 1;\n    j++;\n  }\n\n  for (int i = start; i <= num; i++) {\n    if (num % i == 0)\n      factor(i, num / i);\n  }\n}\n"}
{"label": "1", "index": "1511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int x, int m);\n  int k, i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    for (j = 2; j <= k; j++) {\n      if (k % j == 0)\n        sum += f(k, j);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n\nint f(int x, int m) {\n  int i, sum = 0;\n  if (m == x)\n    sum = 1;\n  else {\n    x = x / m;\n    for (i = m; i <= x; i++) {\n      if (x % i == 0) {\n        sum += f(x, i);\n      }\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nvoid count(int m, int j) {\n  int i;\n  if (m == 1) {\n    num++;\n  }\n  for (i = j; i <= m; i++) {\n    if (m % i == 0) {\n      count(m / i, i);\n    } else\n      continue;\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int m;\n    cin >> m;\n    num = 0;\n    count(m, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int x, n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    printf(\"%d\\n\", f(x, 2));\n  }\n\n  return 0;\n}\n\nint f(int x, int i) {\n  int ans = 0;\n  if (x == 2) {\n    return 1;\n  } else {\n    for (; i <= sqrt(x); i++) {\n      if (x % i == 0) {\n        ans = ans + f(x / i, i);\n      }\n    }\n    return ans + 1;\n  }\n}\n"}
{"label": "1", "index": "1514", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a = 0, s = 0;\nvoid find(int n, int prim) {\n  if (n == a) {\n    s++;\n  } else {\n    for (int i = prim; i <= a / n; i++)\n      if ((a % (n * i) == 0)) {\n        find(n * i, i);\n      }\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    s = 0;\n    for (int i = 2; i <= a; i++) {\n      if (a % i == 0) {\n        find(i, i);\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1515", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factors(int, int, int);\nint main() {\n  int num, n, i, j, b[10000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    int part = 0;\n    int t = num;\n\n    for (j = 2; j <= num; j++) {\n      while (t % j == 0) {\n        t /= j;\n        part++;\n      }\n    }\n    b[i] = factors(1, part, num);\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n\nint factors(int factor1, int part, int num) {\n  int sum = 0;\n  if (num < factor1)\n    return 0;\n  if (part == 1)\n    return 1;\n\n  for (int i = factor1; i <= num; i++)\n    if (num % i == 0)\n      sum = sum + factors(i, part - 1, num / i);\n  return sum;\n}\n"}
{"label": "1", "index": "1516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint decompose(int x, int y);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int j = 1; j <= n; j++) {\n    scanf(\"%d \", &m);\n    cout << decompose(m, 2) << endl;\n  }\n  return 0;\n}\nint decompose(int x, int y) {\n  int sum = 1, b;\n  b = (int)sqrt(x);\n  if (x == 1)\n    return 0;\n  for (int i = y; i <= b; i++) {\n    if (x % i == 0) {\n      sum = sum + decompose(x / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint next(int a, int b) {\n  if (a == 1)\n    return 1;\n  if (a < b)\n    return 0;\n  int sum = 0;\n  for (; b <= a; b = b + 1)\n    if (a % b == 0)\n      sum = sum + next(a / b, b);\n\n  return sum;\n}\nint main() {\n  int i, m;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i = i + 1) {\n    cin >> n;\n    cout << next(n, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1518", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint factors(int, int, int); \nint main() {\n  int num, n, i, j, b[10000];\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> num;\n    int part = 0; \n    int t = num;  \n\n    \n    for (j = 2; j <= num; j++) {\n      while (t % j == 0) {\n        t /= j;\n        part++;\n      }\n    }\n    b[i] = factors(1, part, num); \n  }\n\n  \n  for (i = 0; i < n; i++) {\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n\n\n\nint factors(int factor1, int part, int num) {\n  int sum = 0;       \n  if (num < factor1) \n    return 0;\n  if (part == 1) \n    return 1;\n\n  \n  for (int i = factor1; i <= num; i++)\n    if (num % i == 0)\n      sum = sum + factors(i, part - 1, num / i);\n  return sum;\n}\n"}
{"label": "1", "index": "1519", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint prime(int min, int num) {\n  int i;\n  for (i = min; i < num; i++) {\n    if (num % i == 0)\n      return 0;\n  }\n  return 1;\n}\nint count(int min, int num) {\n  int i = 0, n = 1;\n  if (prime(min, num))\n    return 1;\n  else\n    for (i = min; i < num; i++) {\n      if (num % i == 0 && i <= num / i)\n        n = n + count(i, num / i);\n    }\n  return n;\n}\nint main() {\n  int num, n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << count(2, num) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nint judge1(int n) {\n  int i;\n  if (n == 2 || n == 3 || n == 5)\n    return 1;\n  if (n == 4)\n    return 0;\n  for (i = 2; i * i < n; i++) {\n    if (n % i == 0) {\n      return 0;\n      break;\n    }\n  }\n  if (i * i > n)\n    return 1;\n}\nvoid divide(int n, int d) {\n  for (int i = d; i * i <= n; i++) {\n    if (n % i == 0) \n    {\n      num++;\n      divide(n / i, d);\n    }\n    d++;\n  }\n}\nint main() {\n  int n, m;\n  cin >> n;\n  while (n) {\n    n--;\n    cin >> m;\n    num = 1;\n    divide(m, 2);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  else {\n    for (i = min; i <= a; i++) {\n      if (a % i == 0) {\n\n        result += f(a / i, i);\n      }\n    }\n    return result;\n  }\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1522", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int s, int num) {\n  if (s == num)\n    return 1;\n  if (s < num)\n    for (int i = s; i <= num; i++) {\n      if (num % i == 0) {\n        if (i < num)\n          return f(i, num / i) + f(i + 1, num);\n        if (i == num)\n          return 1;\n      }\n    }\n  if (s > num)\n    return 0;\n}\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", f(2, num));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1523", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int i, num = 0;\n  int a[100];\n  int sum = 0;\n  for (i = x; i <= sqrt(y); i++) {\n    if (y % i == 0) {\n      num++;\n      a[num] = 1 + f(i, y / i);\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    sum = sum + a[i];\n  }\n  return sum;\n}\n\nint main() {\n  int n, x, i, b[100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &x);\n    b[i] = x;\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", f(2, b[i]) + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1524", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ifsushu(int n) {\n  if (n == 1) {\n    return 1;\n  } else {\n    for (int f = n - 1; f >= 2; f--) {\n      if (n % f == 0) {\n        break;\n      }\n      if (f == 2) {\n        return 1;\n      }\n    }\n  }\n  return 0;\n}\nint sum = 0;\nint zhaoyinshu(int x, int max) {\n  if (x == 1) {\n    sum++;\n    return 0;\n  }\n  for (int i = max; i >= 2; i--) {\n    if (x % i == 0)\n      zhaoyinshu(x / i, i);\n  }\n}\nint main() {\n  int time, number, t;\n  cin >> time;\n  for (int j = 0; j < time; j++) {\n    cin >> number;\n    if (ifsushu(number) == 1) {\n      cout << \"1\" << endl;\n    } else {\n      zhaoyinshu(number, number / 2);\n      cout << sum + 1 << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint numcount = 0;\nvoid divide(int num, int x) {\n  int i;\n  if (num == 1)\n    numcount++;\n  for (i = x; i <= num; i++) {\n    if (num % i == 0)\n      divide(num / i, i);\n  }\n}\n\nint main() {\n  int n, num, i;\n  int first = 2;\n  int ans[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    divide(num, first);\n    ans[i] = numcount;\n    \n    numcount = 0;\n  }\n  for (i = 1; i <= n; i++)\n    cout << ans[i] << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fuck(int n, int m) {\n  int i, cnt = 1;\n  if (m >= sqrt(n)) {\n    return 1;\n  }\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      cnt += fuck(n / i, i);\n    }\n  }\n  return cnt;\n}\nint main() {\n  int t, n, k;\n  cin >> t;\n  for (k = 1; k <= t; k++) {\n    cin >> n;\n    cout << fuck(n, 2) << endl;\n  }\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "1", "index": "1527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint decompose(int x, int y);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int j = 1; j <= n; j++) {\n    cin >> m;\n    cout << decompose(m, 2) << endl;\n  }\n  return 0;\n}\nint decompose(int x, int y) {\n  int sum = 1, b;\n  b = (int)sqrt(x);\n  if (x == 1)\n    return 0;\n  for (int i = y; i <= b; i++) {\n    if (x % i == 0) {\n      sum = sum + decompose(x / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint divide(int n, int min) {\n  int i, method = 0;\n  if (n >= min)\n    method++;\n  for (i = min; i < n; i++) {\n    if (!(n % i))\n      method += divide(n / i, i);\n  }\n  return method;\n}\nint main() {\n  int number = 0, integer;\n  int i;\n  cin >> number;\n  for (i = 0; i < number; i++) {\n    cin >> integer;\n    printf(\"%d\\n\", divide(integer, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint resolution_into_factors(int j, int i) {\n  int m, sum = 0, k = 0;\n  for (m = j; m <= sqrt(i); m++) {\n    if (i % m == 0) {\n      sum = resolution_into_factors(m, i / m) + sum + 1;\n      k++;\n    }\n  }\n  if (k == 0)\n    return 0;\n  return sum;\n}\nint main() {\n  int n, k, i;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d \", &i);\n    printf(\"%d\\n\", resolution_into_factors(2, i) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, n, sum = 0;\nvoid t(int m) {\n  int i;\n  for (i = m; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1) {\n        sum += 1;\n      } else\n        t(i);\n      a = a * i;\n    }\n  }\n}\n\nint main() {\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    cin >> a;\n    t(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1531", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint count(int num, int m)\n\n{\n  if (num % m != 0)\n    return 0;\n\n  if (num == m)\n    return 1;\n  else {\n    int counter = 0;\n    for (int i = m; i <= num / m; i++) {\n      counter += count(num / m, i);\n    }\n    return counter;\n  }\n}\n\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int counter = 0;\n    cin >> num;\n    for (int i = 2; i <= num; i++)\n      counter += count(num, i); \n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint fenjie(int a, int start);\n\nint main() {\n  int n, i, integ;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> integ;\n    cout << fenjie(integ, 2) << endl;\n  }\n  return 0;\n}\n\nint fenjie(int a, int start) {\n  int i, sum = 1;\n  if (start == a)\n    sum = 1;\n  else {\n    for (i = start; i <= sqrt(a); i++) {\n      if (a % i == 0) {\n        sum = sum + fenjie(a / i, i);\n      }\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint solutionnumber(int n, int c) {\n  if (n == c)\n    return 1;\n  if (n < c)\n    return 0;\n  if (n % c == 0)\n    return solutionnumber(n / c, c) + solutionnumber(n, c + 1);\n  else\n    return solutionnumber(n, c + 1);\n}\nint main() {\n  int N, a;\n  cin >> N;\n  while (N > 0) {\n    cin >> a;\n    cout << solutionnumber(a, 2) << \"\\n\";\n    N--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint answer = 0; \nvoid f(int n, int N) {\n  if (n < N)\n    N = n; \n  if (N == 1) {\n    answer++; \n    return;\n  }\n  while (N > 1) {\n    if (n % N == 0)\n      f(n / N, N); \n    N--;           \n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n; \n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    f(a, a); \n    cout << answer << endl;\n    answer = 0; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0, p = 1;\nvoid fenjie(int a, int b) {\n  int i;\n  if (a == 1)\n    s++;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      fenjie(a / i, i);\n  return;\n}\nint main() {\n  int n, i, j, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 2; j * j <= a[i]; j++) {\n      if (a[i] % j == 0) {\n        s = 0;\n        fenjie(a[i] / j, j);\n        p = p + s;\n      }\n    }\n    printf(\"%d\\n\", p);\n    p = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int num, int i) {\n  int sum;\n  sum = 0;\n  int j;\n  for (j = i; j <= num / 2; j++) {\n    if (num % j == 0) {\n      if (num / j < j) {\n        sum = sum;\n      } else\n        sum = 1 + sum + f(num / j, j);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    int j, sum;\n    sum = 0;\n    j = 2;\n    sum += f(num, j);\n    cout << sum + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1537", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num = 0;\nvoid fj(int m, int i) {\n  if (m == 1)\n    num++;\n  else {\n    for (int j = i; j <= m; j++) {\n      if (m % j == 0)\n        fj(m / j, j);\n    }\n  }\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int ii = 0; ii < n; ii++) {\n    cin >> m;\n    fj(m, 2);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int j);\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, 2));\n  }\n  return 0;\n}\nint f(int m, int j) {\n  int num = 1;\n  for (int i = j; i <= sqrt(m); i++) {\n    if (m % i == 0) {\n      num += f(m / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint chu(int i, int n);\nint main() {\n  int n, m, i, j;\n  int sum[100];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &m);\n    sum[i] = 0;\n    for (j = 2; j <= sqrt(m); j++) {\n      if (m % j == 0) {\n        sum[i] += chu(j, m / j);\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    cout << sum[i] + 1 << \"\\n\";\n  }\n  return 0;\n}\nint chu(int i, int n) {\n  int j, m, t;\n  t = 1;\n  m = n;\n  for (j = i; j <= sqrt(m); j++) {\n    if (m % j == 0) {\n\n      t += chu(j, (m / j));\n    }\n  }\n  return t;\n}\n"}
{"label": "1", "index": "1540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  if (m < n || m / n == 1)\n    return 0;\n  if ((m % n == 0) && m / n >= n)\n    return f(m / n, n) + f(m, n + 1) + 1;\n  else\n    return f(m, n + 1);\n}\nint main() {\n  int q, i;\n  cin >> q;\n  for (i = 1; i <= q; i++) {\n    int p;\n    cin >> p;\n    printf(\"%d\\n\", f(p, 2) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1541", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid FenJie(int);\nint counter = 0;\nint Befor = 0;\nint main() {\n  int n, x, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    counter = 0;\n    Befor = x;\n    FenJie(x);\n    cout << counter << endl;\n  }\n  return 0;\n}\nvoid FenJie(int x) {\n  int i, temp = Befor;\n  if (x == 1) {\n    counter++;\n    return;\n  }\n  for (i = Befor; i > 1; i--) {\n    if (x % i == 0) {\n      Befor = i;\n      FenJie(x / i);\n    }\n    Befor = temp;\n  }\n  return;\n}\n"}
{"label": "1", "index": "1542", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b, j;\nint a[1000] = {0};\nvoid fjys(int);\nint main() {\n  int n, i, x;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    b = 0;\n    memset(a, 0, sizeof(a));\n    scanf(\"%d \", &x);\n    fjys(x);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n\nvoid fjys(int x) {\n  int i, n1;\n  for (i = 2; i <= x; i++) {\n    if (x % i == 0 && i >= a[j]) {\n      a[++j] = i;\n      n1 = x / i;\n      if (n1 == 1) {\n        b++;\n      } else {\n        fjys(n1);\n      }\n      j--;\n    }\n  }\n  return;\n}\n"}
{"label": "1", "index": "1543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nint solution(int a, int b) {\n  for (int i = b; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1)\n        num++;\n      else\n        num = solution(a, i);\n      a = a * i;\n    }\n  }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num = 0;\n    cout << solution(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num(int a, int b);\nint main() {\n  int t;\n  int a;\n  scanf(\"%d \", &t);\n  for (int i = 1; i <= t; i++) {\n    cin >> a;\n    cout << (num(a, 2)) << endl;\n  }\n  return 0;\n}\nint num(int a, int b) {\n  int f = 0;\n  if (a >= b) {\n    for (int i = b; i <= a; i++) {\n      if (a == i) {\n        f++;\n      } else if (a % i == 0) {\n        f = f + num(a / i, i);\n      }\n    }\n  }\n  return f;\n}\n"}
{"label": "1", "index": "1545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int i) {\n  int sum = 0;\n  for (i; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      sum += f(n / i, i);\n    }\n  }\n  return sum + 1;\n}\nint main() {\n  int i0, n0;\n  scanf(\"%d\", &n0);\n  for (i0 = 0; i0 < n0; i0++) {\n    int n;\n    scanf(\"%d\", &n);\n    printf(\"%d \", f(n, 2));\n  }\n}\n"}
{"label": "1", "index": "1546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a = 1;\nint yinzi(int j, int n) {\n  for (int i = j; i < n; i++) {\n    if (n % i == 0 && n != i && n / i >= i) {\n      a++;\n      yinzi(i, n / i);\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, s;\n  scanf(\"%d \", &s);\n  for (int j = 0; j < s; j++) {\n    scanf(\"%d \", &n);\n    for (int i = 2; i <= n; i++) {\n      if (n % i == 0 && n / i >= i) {\n        a++;\n        yinzi(i, n / i);\n      }\n    }\n    cout << a << endl;\n    a = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0, z = 2;\nvoid number(int x, int y) {\n  int i;\n  if (x == 1) {\n    s = s + 1;\n  }\n  for (i = y; i <= x; i++) {\n    if (x % i == 0) {\n      number(x / i, i);\n    }\n  }\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    number(a, z);\n    cout << s << endl;\n    s = 0;\n  }\n}\n"}
{"label": "1", "index": "1548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int shu, int min) {\n  int k = 1;\n  if (shu < min) {\n    k = 0;\n    return k;\n  } else {\n    for (int i = min; i < shu; i++) {\n      if (shu % i == 0) {\n        k = k + f(shu / i, i);\n      }\n    }\n    return k;\n  }\n}\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n\n    if (i != n - 1)\n      cout << f(a, 2) << \" \";\n    else\n      printf(\"%d\", f(a, 2));\n  }\n}\n"}
{"label": "1", "index": "1549", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum;\nint a[100];\nvoid search(int t, int k) {\n  int i;\n  if (k == 1)\n    sum++;\n  else\n    for (i = a[t - 1]; i <= k; i++)\n      if (k % i == 0) {\n        a[t] = i;\n        search(t + 1, k / i);\n      }\n}\n\nint main() {\n  int n, i, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> k;\n    sum = 0;\n    a[0] = 2;\n    search(1, k);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1550", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint totalCount;\n\nvoid FindFact(int x, int max) {\n  if (x == 1) {\n    totalCount++;\n    return;\n  }\n  for (int i = max; i > 1; i--)\n    if (x % i == 0)\n      FindFact(x / i, i);\n  return;\n}\n\nint main() {\n  int n, x;\n  for (cin >> n; n > 0; n--) {\n    totalCount = 0;\n    cin >> x;\n    FindFact(x, x / 2);\n    cout << totalCount + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t;\nint f(int a, int b) {\n  int i;\n  for (i = a; i * i <= b; i++) {\n    if (b % i == 0) {\n      t++;\n      f(i, b / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int n, i, result[1000], a[1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    result[i] = f(2, a[i]);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n}\n"}
{"label": "1", "index": "1552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int p);\nint N;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &N);\n    cout << fenjie(N, 2) << \"\\n\";\n  }\n  return 0;\n}\nint fenjie(int x, int p) {\n  int f = 0;\n  if (x == 1)\n    return 1;\n  else {\n    for (int i = p; i <= x; i++)\n      if (x % i == 0)\n        f = f + fenjie(x / i, i);\n  }\n  return f;\n}\n"}
{"label": "1", "index": "1553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n, int i) {\n  int sum = 0;\n  for (i; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      sum += f(n / i, i);\n    }\n  }\n  return sum + 1;\n}\nint main() {\n  int i0, n0;\n  scanf(\"%d\", &n0);\n  for (i0 = 0; i0 < n0; i0++) {\n    int n;\n    scanf(\"%d\", &n);\n    cout << f(n, 2) << \" \";\n  }\n}\n"}
{"label": "1", "index": "1554", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum, temp;\nvoid fact(int);\n\nint main() {\n  int n, i, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    sum = 0;\n    temp = 2;\n    fact(k);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid fact(int k) {\n  if (k == 1) {\n    sum++;\n    return;\n  }\n  int i;\n  for (i = temp; i <= k; i++) {\n    if (k % i == 0) {\n      temp = i;\n      fact(k / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1, i;\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int n, a[100], b[100], i;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = f(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint yin(int c, int g) {\n  int j, f, e;\n  for (j = g; j <= c; j++) {\n    if (c % j == 0) {\n      e = c / j;\n      if (e > 1) {\n        f = j;\n        yin(e, f);\n      } else\n        sum++;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, a[1000], b[1000], i, d;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    d = 2;\n    sum = 0;\n    b[i] = yin(a[i], d);\n  }\n  for (i = 0; i < n; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "1557", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int, int);\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    cout << f(a[i], 2) << endl;\n  }\n  return 0;\n}\n\nint f(int n, int p)\n\n{\n  int sum = 0, m;\n  for (m = p; m <= n; m++)\n    if (n % m == 0) {\n      if (m < n)\n        sum = sum + f(n / m, m);\n      if (m == n)\n        sum = sum + 1;\n    }\n  return sum;\n}\n"}
{"label": "1", "index": "1558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint dispose(int, int);\n\nint main() {\n  int n, i, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p;\n    printf(\"%d\\n\", dispose(p, 2));\n  }\n  return 0;\n}\n\nint dispose(int p, int y) {\n  int i, sol = 1;\n  for (i = y; i <= (int)(sqrt(p)); i++) {\n    if (p % i == 0) {\n      sol += dispose(p / i, i);\n    }\n  }\n  return sol;\n}\n"}
{"label": "1", "index": "1559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y);\nint main() {\n  int n, i, j, a, sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    sum = 0;\n    for (j = 1; j <= a; j++)\n      sum += f(a, j);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint f(int x, int y) {\n  int i, num = 0;\n  if (y == 1)\n    return 0;\n  else {\n    if (x % y != 0)\n      return 0;\n    else if (x == y)\n      return 1;\n    else {\n      for (i = y; i >= 1; i--)\n        num += f(x / y, i);\n\n      return num;\n    }\n  }\n}\n"}
{"label": "1", "index": "1560", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cal(int M, int N) {\n  int i;\n  int num = 0;\n  if (M == 1)\n    return 0;\n  if (N >= M)\n    return (1 + cal(M, M - 1));\n  for (i = 2; i < M; i++) {\n    if (M % i == 0 && i <= N)\n      num = num + cal(M / i, i);\n  }\n  return num;\n}\nint main() {\n  int n, M;\n  cin >> n;\n  while (n--) {\n    cin >> M;\n    cout << cal(M, M) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s;\nvoid search(int a, int k) {\n  if (a == 0)\n    return;\n  if (a == 1) {\n    return;\n  }\n  for (int i = 2; i < a; i++) {\n    if (a % i == 0 && a / i >= i && i >= k && a / i >= k) {\n      s++;\n      search(a / i, i);\n    }\n  }\n  return;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    s = 1;\n    scanf(\"%d \", &a);\n    search(a, 1);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nvoid f(int b, int a) {\n  for (int i = b; i <= a; i++) {\n    if ((a % i == 0) && (i <= a / i)) {\n      sum = sum + 1;\n      f(i, a / i);\n    }\n    if (i > a / i)\n      break;\n  }\n}\nint main() {\n  int a, n;\n  cin >> n;\n  while (n > 0) {\n    cin >> a;\n    sum = 1;\n    f(2, a);\n    cout << sum << \"\\n\";\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ways(int a, int min);\nint main() {\n  int n, a, i, sum = 0, k, min;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    sum = 0;\n    for (k = 2; k <= a; k++) {\n      if (a % k == 0) {\n        min = k;\n        break;\n      }\n    }\n    if (a != min)\n      sum = ways(a, min);\n    else\n      sum = 1;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint ways(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += ways(a / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1564", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint judge1(int n) {\n  int i;\n  if (n == 2 || n == 3 || n == 5)\n    return 1;\n  if (n == 4)\n    return 0;\n  for (i = 2; i * i < n; i++) {\n    if (n % i == 0) {\n      return 0;\n      break;\n    }\n  }\n  if (i * i > n) {\n    return 1;\n  }\n}\nvoid divide(int n, int d) {\n  for (int i = d; i * i <= n; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, d);\n    }\n    d++;\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n) {\n    n--;\n    cin >> m;\n    num = 1;\n    divide(m, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int, int);\nint main() {\n  int i, n, t, r, num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    r = fenjie(num, 2);\n    cout << r << endl;\n  }\n  return 0;\n}\nint fenjie(int num, int min) {\n  int i, j, k, r = 0;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) {\n      r = r + fenjie(num / i, i);\n    }\n    if (i == num)\n      r++;\n  }\n  return r;\n}\n"}
{"label": "1", "index": "1566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k = 0;\nint y;\nint a(int x, int i);\nvoid b(int x, int i);\nint main() {\n  int n, i, x, z;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> x;\n    y = x;\n    cout << a(x, 2) << \"\\n\";\n  }\n  return 0;\n}\nint a(int x, int i) {\n  k = 0;\n  b(x, i);\n  return k;\n}\nvoid b(int x, int i) {\n  for (i = i; i <= x; i++) {\n    if (x % i == 0)\n      b(x / i, i);\n  }\n  if (x == 1)\n    k = k + 1;\n}\n"}
{"label": "1", "index": "1567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 0;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0) {\n      n++;\n      n += f(x / a, a);\n    }\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  scanf(\"%d\", &m);\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = 1 + f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\\n\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint turn(int a, int b) {\n  int i, k;\n  if (a == 1)\n    k = 1;\n  else {\n    if (a < b)\n      k = 0;\n    else {\n      k = 0;\n      for (i = b; i <= a; i++)\n        if (a % i == 0)\n          k = k + turn(a / i, i);\n    }\n  }\n  return k;\n}\nint main() {\n  int n, i, a[1000], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    t = turn(a[i], 2);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int n, int min) {\n  int i, a = 0, x = 0;\n  for (i = 2; i <= n; i++)\n    if (n % i == 0)\n      a = a + 1;\n  if (n == 1)\n    return 1;\n  else {\n    for (i = min; i <= n; i++) {\n      if (n % i == 0)\n        x = x + fenjie(n / i, i);\n    }\n    return x;\n  }\n}\nint main() {\n  int t, j, num;\n  cin >> t;\n  for (j = 1; j <= t; j++) {\n    scanf(\"%d\", &num);\n    cout << fenjie(num, 2) << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fenjie(int max, int min) {\n  int num = 1, i, k;\n  for (i = min; i < max / 2; i++) {\n    k = max % i;\n    if (k == 0) {\n      if (i <= max / i) {\n        num += fenjie(max / i, i);\n      }\n    }\n  }\n  return num;\n}\nint main() {\n  int a[10000], n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &a[j]);\n  }\n  for (j = 0; j < n; j++) {\n    cout << fenjie(a[j], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1571", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num0;                \nint factor(int x, int y) \n{\n  int countn = 1; \n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1; \n  for (int i = y; i <= sqrt(x); i++)\n    if (x % i == 0)\n      countn += factor(x / i, i); \n  return countn;\n}\nint main()  \n{           \n  int n, j; \n  cin >> n; \n  for (j = 1; j <= n; j++) {\n    cin >> num0;                     \n    cout << factor(num0, 2) << endl; \n  }\n  return 0; \n} \n"}
{"label": "1", "index": "1572", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int num, int i) {\n  int sum;\n  sum = 0;\n  int j;\n  for (j = i; j <= num / 2; j++) {\n    if (num % j == 0) {\n      if (num / j < j) {\n        sum = sum;\n      } else\n        sum = 1 + sum + f(num / j, j);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, num, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    int j, sum;\n    sum = 0;\n    j = 2;\n    sum += f(num, j);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1573", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint factoring(int a, int b) {\n  int i, kind = 0;\n  if (a == 1) {\n    kind = 1;\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int n, i, j, a[30000] = {0}, b[30000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = factoring(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1574", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint w = 1;\nint f(int x) {\n  int z = 1, y, v = 0;\n  for (y = w + 1; y <= sqrt(x); y++) {\n    if (x % y == 0) {\n\n      z = z + f(x / y);\n      v++;\n      w = y;\n    }\n  }\n  if (v == 0) {\n    z = 1;\n  }\n  return z;\n}\nint main() {\n  int n, u = 0, a;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d \", &a);\n    printf(\"%d \", f(a));\n    u++;\n    w = 1;\n  } while (u != n);\n}\n"}
{"label": "1", "index": "1575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int count(int x, int y);\n  int i, j, n, a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n    for (j = 2; j <= a[i]; j++) {\n      b[i] += count(a[i], j);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n\nint count(int x, int y) {\n  int c = 0, k;\n  if (x == y) {\n    c = 1;\n  }\n  if (x % y != 0) {\n    c = 0;\n  }\n  if (x != y && x % y == 0) {\n    for (k = y; k >= 2; k--) {\n      c += count((x / y), k);\n    }\n  }\n  return (c);\n}\n"}
{"label": "1", "index": "1576", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(int n, int a) {\n  int kind = 0;\n  int i;\n  if (n == 1)\n    return 1;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0) {\n      if (n / i < i && i != n)\n        ;\n      else {\n        kind = kind + function_1(n / i, i);\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int m, n, i, sum;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    sum = function_1(n, 2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint divide(int d, int n) {\n  int sum = 0;\n  for (int i = d; i < n; i++) {\n    if (n % i == 0 && (n / i) >= i) {\n      sum = sum + 1;\n      sum = sum + divide(i, n / i);\n    }\n  }\n  return (sum);\n}\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    cout << divide(2, num) + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint find_factor(int a, int b) {\n  int i, sum = 0;\n  if (a == 1)\n    return 1;\n  for (i = b; i <= a; i++)\n    if (a % i == 0)\n      sum = sum + find_factor(a / i, i);\n  return sum;\n}\n\nint main(void) {\n  int n;\n  cin >> n;\n  int a;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", find_factor(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint l = 0, num = 0, o;\nvoid f(int i, int in) {\n  int j;\n  for (j = i; j < (in + 1); j++) {\n    if (j * (in / j) == in) {\n\n      o = in / j;\n\n      f(j, in / j);\n      o = o * j;\n    }\n  }\n  if (o == 1) {\n    num = num + 1;\n  }\n}\nint main() {\n  int t;\n  cin >> t;\n  int i;\n  int in;\n  for (i = 0; i < t; i++) {\n    scanf(\"%d \", &in);\n    f(2, in);\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fac(int p, int q) {\n  int i, t = 1;\n  if (p > q) {\n    return 0;\n  }\n  if (p == q) {\n    return 1;\n  }\n  for (i = p; i <= sqrt(q); i++) {\n    if (q % i == 0) {\n      t += fac(i, q / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int a, i, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fac(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1581", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint total, p;\nvoid part(int y) {\n  int i2, up;\n  if (y == 1) {\n    return;\n  }\n  up = (int)sqrt(y);\n  for (i2 = 2; i2 <= up; i2++) {\n    if (p <= i2) {\n      if (y % i2 == 0) {\n        total++;\n        p = i2;\n        part(y / i2);\n        p = 0;\n      }\n    }\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    total = 0;\n    p = 0;\n    scanf(\"%d\", &a);\n    part(a);\n    printf(\"%d\\n\", total + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a = 0, i = 0, sum = 1;\nvoid f(int i, int a) {\n  int j;\n  for (j = i; j <= sqrt(a); j++)\n    if (a % j == 0) {\n      sum++;\n      f(j, a / j);\n    }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n) {\n    cin >> a;\n    f(2, a);\n    cout << sum << endl;\n    n--;\n    sum = 1;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1583", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint make(int x, int t) {\n  int ans = 0, i;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++)\n    if (x % i == 0)\n      ans += make(x / i, i);\n  return ans;\n}\nint main() {\n  int i, k, j, p, n, t, m, x;\n  scanf(\"%d\", &t);\n  for (p = 1; p <= t; p++) {\n    cin >> n;\n    x = make(n, 2);\n    printf(\"%d\\n\", x);\n  }\n}\n"}
{"label": "1", "index": "1584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid TRY(int, int);\nint num = 1;\nint main() {\n  unsigned short int n;\n  int INTEGER;\n  cin >> n;\n  while (n-- > 0) {\n    cin >> INTEGER;\n    int h = 2;\n    TRY(h, INTEGER);\n    cout << num << endl;\n    num = 1;\n  }\n}\nvoid TRY(int a, int b) {\n  int i;\n  for (i = a; i <= sqrt(b); i++) {\n    if ((b % i == 0) && (b / i != 1)) {\n      num++;\n      TRY(i, b / i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factoring(int a, int b) {\n  int i, kind = 0;\n\n  if (a == 1) {\n    kind = 1;\n\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n\n  return kind;\n}\n\nint main() {\n  int n, x[40000], i;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    x[i] = factoring(x[i], 2);\n    cout << x[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int j);\nint main() {\n  int n, m;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\nint f(int m, int j) \n{\n  int num = 1;\n  for (int i = j; i <= sqrt(m); i++) {\n    if (m % i == 0) {\n      num += f(m / i, i);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1587", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num(int, int, int);\nint qufen(int);\nint power(int, int);\nint main() {\n  int t;\n  cin >> t;\n  while (t >= 1) {\n    int n, i, x, sum = 1;\n    cin >> n;\n    x = qufen(n);\n    for (i = 2; i <= x; i++)\n      sum = sum + num(n, i, 2);\n    printf(\"%d\\n\", sum);\n    t--;\n  }\n  return 0;\n}\nint qufen(int n) {\n  int j;\n  for (j = 1;; j++) {\n    if (power(2, j) > n) {\n      return j - 1;\n      break;\n    }\n  }\n}\nint power(int a, int b) {\n  int sum = 1, k;\n  for (k = 1; k <= b; k++)\n    sum = sum * a;\n  return sum;\n}\nint num(int n, int g, int h) {\n  if ((g == 1) && (n >= h))\n    return 1;\n  int i, j = 0, count = 0, a[20000];\n  for (i = h; i < n; i++) {\n    if (n % i == 0) {\n      a[j] = i;\n      j++;\n    }\n  }\n  if (j == 0)\n    return 0;\n  else {\n    for (i = 0; i < j; i++)\n      count = count + num(n / a[i], g - 1, a[i]);\n    return count;\n  }\n}\n"}
{"label": "1", "index": "1588", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint next(int a, int b) {\n  if (a == 1)\n    return 1;\n  if (a < b)\n    return 0;\n  int sum = 0;\n  for (; b <= a; b = b + 1)\n    if (a % b == 0)\n      sum = sum + next(a / b, b);\n\n  return sum;\n}\nint main() {\n  int i, m;\n  cin >> m;\n  for (i = 0; i < m; i = i + 1) {\n    scanf(\"%d \", &n);\n    cout << next(n, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1589", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int a, int b) {\n  int c = 1, i;\n  for (i = b; i <= (int)sqrt(a); i++) {\n    if (a % i == 0)\n      c += fenjie(a / i, i);\n  }\n  return c;\n}\nint main() {\n  int n, i, a, c;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    c = fenjie(a, 2);\n    printf(\"%d \", c);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a;\nint res;\nint sum;\nvoid dfs(int cnt) {\n  if (cnt * sum == a) {\n    res++;\n    return;\n  }\n  if (cnt * sum < a) {\n    sum *= cnt;\n    int j = a / sum;\n    for (int i = cnt; i <= j; i++)\n      dfs(i);\n    sum /= cnt;\n    return;\n  }\n}\nint main() {\n  int nCases;\n  scanf(\"%d\", &nCases);\n  for (int i = 0; i < nCases; i++) {\n    scanf(\"%d\", &a);\n    res = 0;\n    sum = 1;\n    for (int i = 2; i <= a; i++)\n      dfs(i);\n    cout << res << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint c;\nvoid cal(int n, int k);\nint main(int argc) {\n  int m, n, j;\n  scanf(\"%d \", &m);\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    c = 0;\n    cal(n, 1);\n    printf(\"%d\\n\", c);\n  }\n\n  return 0;\n}\nvoid cal(int n, int k) {\n  if (n == 1) {\n    c++;\n    return;\n  }\n  int i;\n  for (i = 2; i <= n; i++) {\n    if (n % i == 0 && i >= k) {\n      cal(n / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1592", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint yinshu(int n, int m) {\n  int i, sum = 0;\n  if (n == 1)\n    return 1;\n  for (i = m; i <= n; i++) {\n    if (n % i == 0)\n      sum += yinshu(n / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, i, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    cout << yinshu(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint factorization(int num, int i);\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    cout << factorization(num, 2) << endl;\n  }\n  return 0;\n}\n\nint factorization(int num, int i) {\n  int j, squ, sum = 1;\n  squ = sqrt((double)num);\n  for (j = i; j <= squ; j++) {\n    if (num % j == 0)\n      sum = sum + factorization(num / j, j);\n  }\n  return sum;\n};\n"}
{"label": "1", "index": "1594", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calc(int p, int t);\n\nint main() {\n  int m, n, ans;\n\n  scanf(\"%d\", &m);\n\n  while (m--) {\n    scanf(\"%d\", &n);\n    ans = calc(2, n);\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n\nint calc(int p, int t) {\n  int i, a;\n\n  a = 1;\n  for (i = p; i <= sqrt(t); i++)\n    if (t % i == 0)\n      a = a + calc(i, t / i);\n  return a;\n}\n"}
{"label": "1", "index": "1595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint way(int x, int m) {\n  int sum = 0, p = 0, i;\n  for (i = m; i < x; i++)\n    if (x % i == 0) {\n      p++;\n      sum = sum + way(x / i, i);\n    }\n  sum = sum + 1;\n  if (p == 0)\n    sum = 1;\n  if (m > x)\n    sum = 0;\n  return (sum);\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", way(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << f(a[i], 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1597", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fac(int p, int q) {\n  int i, t = 1;\n  if (p > q) {\n    return 0;\n  }\n  if (p == q) {\n    return 1;\n  }\n  for (i = p; i <= sqrt(q); i++) {\n    if (q % i == 0) {\n      t += fac(i, q / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int a, i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", fac(2, a));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint remember = 0;             \nint number(int const1, int a) \n{\n  if (a == 1) \n  {\n    remember++; \n    return 1;   \n  } else {\n    for (int i = const1; i <= a; i++) \n    {\n      if (a % i == 0)     \n        number(i, a / i); \n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;     \n  int cases[n]; \n  for (int j = 0; j < n; j++)\n    cin >> cases[j]; \n  for (int j = 0; j < n; j++) {\n    number(2, cases[j]);      \n    cout << remember << endl; \n    remember = 0;             \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint su(int input) {\n  int ju = 1;\n  for (int i = 2; i < sqrt(input); i++) {\n    if (input % i == 0)\n      ju = 0;\n    break;\n  }\n  return ju;\n}\nint fenjie(int input, int k) {\n  int ret = 1;\n  for (int i = k; i <= sqrt(input); i++) {\n    if (input % i == 0) {\n      if (su(input / i) == 0) {\n        ;\n      }\n      { ret = fenjie(input / i, i) + ret; }\n    }\n  }\n  return ret;\n}\nint main() {\n  int input, num;\n  cin >> num;\n  while (num--) {\n    cin >> input;\n    printf(\"%d\\n\", fenjie(input, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factorize(int m, int k) {\n  int c = 1;\n  if (m < 4)\n    return 1;\n  for (int i = k; i <= sqrt(m); i++)\n    if (!(m % i))\n      c += factorize(m / i, k > i ? k : i);\n  return c;\n}\nint main(int argc, char *argv[]) {\n  int n, m;\n  cin >> n;\n  while (n--) {\n    cin >> m;\n    printf(\"%d\\n\", factorize(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(int n, int a) {\n  int kind = 0;\n  int i;\n  if (n == 1)\n    return 1;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0) {\n      if (n / i < i && i != n)\n        ;\n      else {\n        kind = kind + function_1(n / i, i);\n      }\n    }\n  }\n  return kind;\n}\n\nint main() {\n  int m, n, i, sum;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    sum = function_1(n, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1602", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint m, num;\nint make(int a);\nint pan(int a);\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    num = 0;\n    m = a;\n    cout << make(a) << endl;\n  }\n  return 0;\n}\nint pan(int a) {\n  int n = 0, i;\n  for (i = 1; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      n++;\n  }\n  if (n == 1)\n    return 0;\n  else\n    return 1;\n}\nint make(int a) {\n  int i, j, ans;\n  ans = sqrt(a);\n  if (pan(a) == 0) {\n    num++;\n    return num;\n  } else {\n    num++;\n    for (i = m / a; i <= ans; i++) {\n      if (i == 1)\n        continue;\n      if (a % i == 0) {\n        m = a;\n        num = make(a / i);\n      }\n    }\n    if (i == ans + 1)\n      return num;\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint panduansushu(int t) {\n  int i;\n  for (i = 2; i < t; i++) {\n    if (t % i == 0) {\n      break;\n    }\n  }\n  if (i > t / 2)\n    return 1;\n  else\n    return 0;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n}\n\nint main() {\n  int a[100], i, res, j, n;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (j = 0; j < n; j++) {\n    if (panduansushu(a[j]) == 1) {\n      printf(\"1\\n\");\n    } else {\n      for (i = 2, res = 1; i < a[j] / 2; i++) {\n        if (a[j] % i == 0) {\n          sum = 0;\n          fun(a[j] / i, i);\n          res += sum;\n        }\n      }\n      printf(\"%d\\n\", res);\n    }\n  }\n}\n"}
{"label": "1", "index": "1604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid decprime(int begain, int a);\nint sum = 1;\nint main() {\n  int n, a;\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> a;\n    decprime(2, a);\n    cout << sum << endl;\n    sum = 1;\n  }\n  return 0;\n}\nvoid decprime(int begain, int a) {\n  int i;\n  \n  \n\n  \n  \n  for (i = begain; i <= a; i++) {\n    if (a % i == 0 && i <= a / i) {\n      sum++;\n      decprime(i, a / i);\n    }\n    if (i > a / i)\n      break;\n    \n    \n    \n    \n    \n  }\n}\n"}
{"label": "1", "index": "1605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint elm[100] = {0};\nint counts = 0, num = 0;\nvoid Try(int b, int s) {\n  int j;\n  for (j = 2; j <= num; j++) {\n    if (j >= elm[s - 1]) {\n      if (b % j == 0) {\n        elm[s] = j;\n        if (b / j == 1)\n          counts++;\n        else if (b / j < j)\n          continue;\n        else\n          Try(b / j, s + 1);\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    counts = 0;\n    cin >> num;\n    Try(num, 1);\n    cout << counts << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1606", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint Factorization(int n, int k) { \n  int sum = 0;                    \n  if (n < k) {                    \n    return 0;                     \n  }\n  if (n % k == 0) { \n    if (n == k) {   \n      return 1;     \n    } else {\n      sum =\n          sum + Factorization(n, k + 1) + Factorization(n / k, k); \n    }\n  } else {\n    sum = sum + Factorization(n, k + 1); \n  }\n  return sum; \n}\n\nint main() {\n  int t, i, a;               \n  cin >> t;                  \n  for (i = 1; i <= t; i++) { \n    cin >> a;\n    cout << Factorization(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1607", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint multiply(int a, int b) {\n  int i = 0, sum = 1;\n  if (a < b) {\n    return 0;\n  } else {\n    for (i = b; i <= a; i++) {\n      if (a % i == 0) {\n        sum = sum + multiply(a / i, i);\n      }\n    }\n    return sum;\n  }\n}\nint main() {\n  int n = 0, m = 0, i = 0, sum = 0, num, result[1000];\n  cin >> n;\n  do {\n    cin >> num;\n    result[i] = multiply(num, 2);\n    i = i + 1;\n    m = m + 1;\n  } while (m < n);\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint varieties = 0;\nvoid factor(int, int);\nint main() {\n  int n = 0, num = 0, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    varieties = 0;\n    cin >> num;\n    factor(2, num);\n    printf(\"%d\\n\", varieties);\n  }\n  return 0;\n}\nvoid factor(int first, int num) {\n  int i = 0;\n  if (num == 1)\n\n    varieties++;\n  else {\n    for (i = first; i <= num; i++) {\n      if (num % i == 0) {\n        factor(i, num / i);\n      }\n    }\n  }\n}\n"}
{"label": "1", "index": "1609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint function_1(int a, int m) {\n  int sum = 1, i;\n  if (a > m)\n    return 0;\n  else {\n    for (i = a; i < m; i++) {\n      if (m % i == 0)\n        sum = sum + function_1(i, m / i);\n      else\n        continue;\n    }\n    return sum;\n  }\n}\n\nint main() {\n  int n, i, m[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &m[i]);\n\n  for (i = 0; i <= n - 1; i++)\n    cout << function_1(2, m[i]) << \" \";\n}\n"}
{"label": "1", "index": "1610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cal;\nint fac(int a, int x) {\n  if (x == 1) {\n    cal++;\n    return 1;\n  }\n  for (int i = 2; i <= x; i++)\n    if (x % i == 0 && i >= a)\n      fac(i, x / i);\n}\nint main() {\n  int n, b;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cal = 0;\n    cin >> b;\n    fac(1, b);\n    cout << cal << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1611", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjieyinshi(int n, int m) {\n  int i = 0;\n  int sum = 1;\n  if (n < m)\n    return 0;\n  else {\n    for (i = m; i < n; i++)\n      if (n % i == 0)\n        sum += fenjieyinshi(n / i, i);\n    return sum;\n  }\n}\nint main() {\n  int n = 0;\n  int i = 0;\n  int a = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    if (a == 1)\n      printf(\"%d\\n\", 1);\n    else {\n      cout << fenjieyinshi(a, 2) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int b) {\n  if (a == b)\n    return 1;\n  if (b > a)\n    return 0;\n  if (a % b != 0)\n    return f(a, b + 1);\n  if (a % b == 0)\n    return f(a, b + 1) + f(a / b, b);\n}\nint main() {\n  int n = 0, i = 0, x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    y = 2;\n    printf(\"%d\\n\", f(x, y));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1613", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fen(int m, int k) {\n  int i, t = 1, n = 0;\n  for (i = 2; i <= m; i++) {\n    if (m % i == 0)\n      n++;\n  }\n  if (n == 1 || m == 1)\n    return 1;\n  else\n    for (i = 2; i <= m; i++) {\n      if (m % i == 0 && m / i >= i && i >= k) {\n        k = i;\n        t = t + fen(m / i, k);\n      }\n    }\n  return t;\n}\nint main() {\n  int fen(int m, int k);\n  int n, i, x;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    printf(\"%d\\n\", fen(x, 1));\n  }\n}\n"}
{"label": "1", "index": "1614", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cut(int m, int l) {\n  int sum = 1;\n  for (int i = l; i <= sqrt((double)m / l); i++) {\n    if ((m / l) % i == 0) {\n      sum += cut(m / l, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int t = 0;\n    cin >> t;\n    cout << cut(2 * t, 2);\n    if (i < n - 1)\n      cout << endl;\n  }\n}\n"}
{"label": "1", "index": "1615", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint total = 0;\nint divide(int k, int number) {\n  if (number == 1) {\n    total++;\n    return 0;\n  }\n  int i;\n  for (i = k; i <= number; i++) {\n    if (number % i == 0)\n      divide(i, number / i);\n  }\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  int num[n];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    total = 0;\n    divide(2, num[i]);\n    printf(\"%d\\n\", total);\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "1616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int min); \nint main() {\n  int n, i, a[100], sum[100];\n  cin >> n; \n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum[i] = f(a[i], 2); \n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n\nint f(int m, int min) \n{\n  int i, sum = 0;\n  if (m == min || m == 1) \n    return 1;\n  else if (m < min) \n    return 0;\n  else if (m > min) \n  {\n    for (i = min; i <= m; i++)\n      if (m % i == 0)\n        sum += f(m / i, i);\n    return sum;\n  }\n}\n"}
{"label": "1", "index": "1617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i = 0;\nint f(int n, int m) {\n  int k = 0;\n  if (m == 1)\n    i++;\n  else {\n    for (k = n; k <= m; k++) {\n      if (m % k == 0) {\n        n = k;\n        f(n, m / n);\n      }\n    }\n  }\n  return (i);\n}\nint main() {\n  int n, b, c;\n  scanf(\"%d \", &n);\n  int a;\n  for (b = 0; b < n; b++) {\n    cin >> a;\n    c = f(2, a);\n    printf(\"%d\\n\", c);\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sort(int, int, int);\n\nint main() {\n  int t = 0;\n  cin >> t;\n  int k = 1;\n  for (k = 1; k <= t; k++) {\n    int vacancy = 0;\n    int num = 1;\n    cin >> num;\n    int i = 1;\n    int temp = num;\n    for (i = 2; i <= temp; i++) {\n      while (temp % i == 0) {\n        vacancy = vacancy + 1;\n        temp = temp / i;\n      }\n    }\n    cout << sort(1, vacancy, num) << \"\\n\";\n  }\n  return 0;\n}\n\nint sort(int start, int vacancy, int num) {\n  if (num < start)\n    return 0;\n\n  if (vacancy == 1)\n    return 1;\n\n  int sum = 0;\n  int i = 1;\n  for (i = start; i <= num; i++) {\n    if (num % i == 0) {\n      sum = sum + sort(i, vacancy - 1, num / i);\n    }\n  }\n\n  return sum;\n}\n"}
{"label": "1", "index": "1619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calculate(int a, int num) {\n  int sum = 0;\n  if (num == 1)\n    return 1;\n  for (int i = num; i >= 2; i--) {\n    if (num % i == 0 && i <= a)\n      sum += calculate(i, num / i);\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int num = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", calculate(num, num));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ways(int n, int p) {\n  if (n < p)\n    return 0;\n  while (n % p != 0)\n    p++;\n  if (n == p)\n    return 1;\n  return ways(n / p, p) + ways(n, p + 1);\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    cout << ways(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int k) {\n  if (n < k)\n    return 0;\n  int i, s = 1;\n  for (i = k; i < n; i++) {\n    if (n % i == 0)\n      s += f(n / i, i);\n  }\n  return s;\n}\nint main() {\n  int m, n;\n  scanf(\"%d\", &m);\n  while (m--) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", f(n, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num;\n\nvoid divide(int a, int k) {\n  int i;\n  if (a == 1)\n    num++;\n  for (i = k; i <= a; i++)\n    if (a % i == 0)\n      divide(a / i, i);\n}\n\nint main() {\n  int t;\n  cin >> t;\n  while (t--) {\n    int n;\n    cin >> n;\n    num = 1;\n    int i;\n    for (i = 2; i * i <= n; i++)\n      if (n % i == 0)\n        divide(n / i, i);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal;                \nint fac(int a, int x) { \n  if (x == 1) {\n    cal++;\n    return 1;\n  } \n  for (int i = 2; i <= x; i++)\n    if (x % i == 0 && i >= a) \n      fac(i, x / i);\n}\nint main() {\n  int n, b;\n  cin >> n;\n  while (n > 0) {\n    cal = 0;\n    cin >> b;\n    fac(1, b);\n    cout << cal << endl;\n    n--;\n  }\n}\n"}
{"label": "1", "index": "1624", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint f(int a, int b) {\n  for (int i = a; i > 1; i--) {\n    if (a % i != 0) {\n      continue;\n    } else {\n      if (i > b) {\n        continue;\n      } else {\n        int q;\n        q = a / i;\n        if (q == 1) {\n          sum++;\n        } else {\n          f(q, i);\n        }\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    int c;\n    c = f(num, num);\n    printf(\"%d\\n\", c);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[40000] = {0};\nvoid fun(int n, int j, int k) {\n  int i;\n  for (i = j; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      j = i;\n      a[k]++;\n      fun(n / i, j, k);\n    }\n  }\n}\n\nint main() {\n  int n;\n  int m[40000] = {0};\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    fun(m[i], 2, i);\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", a[i] + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint Factorization(int n, int k) {\n  int sum = 0;\n  if (n < k) {\n    return 0;\n  }\n  if (n % k == 0) {\n    if (n == k) {\n      return 1;\n    } else\n      sum = sum + Factorization(n, k + 1) + Factorization(n / k, k);\n\n  } else {\n    sum = sum + Factorization(n, k + 1);\n  }\n  return sum;\n}\n\nint main() {\n  int t, i, a;\n  scanf(\"%d \", &t);\n  for (i = 1; i <= t; i++) {\n    scanf(\"%d \", &a);\n    cout << Factorization(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1627", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int b) { \n  int num = 1, i;\n  for (i = b; i <= sqrt(a); i++) { \n    if (a % i == 0)\n      num += f(a / i, i); \n  }\n  return num; \n}\nint main() {\n  int i, n, a;\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    cout << f(a, 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int k);\n\nint main() {\n  int n, i, k, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m;\n    k = 2;\n    printf(\"%d\\n\", f(m, k));\n  }\n\n  return 0;\n}\nint f(int m, int k) {\n  int m1, sum = 1;\n  m1 = m;\n  while (k <= (int)sqrt(m)) {\n    if (m % k == 0) {\n      m = m / k;\n\n      sum = sum + f(m, k);\n    }\n    m = m1;\n    k++;\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1629", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint tru(int c) {\n  int j, p = 0;\n  if (c == 1 || c == 2)\n    return 1;\n  else\n    for (j = 2; j <= pow((double)c, 0.5); j++)\n      if (c % j == 0) {\n        p = 1;\n        break;\n      }\n  if (p == 1)\n    return 0;\n  else\n    return 1;\n}\nint count(int a, int b) {\n  int i, k = 1;\n  if (!tru(a))\n    for (i = b; i <= pow((double)a, 0.5); i++)\n      if (a % i == 0)\n        k = k + count(a / i, i);\n  return k;\n}\nint main() {\n  int n, x[999], q;\n  scanf(\"%d\", &n);\n  for (q = 0; q < n; q++)\n    cin >> x[q];\n  for (q = 0; q < n; q++)\n    printf(\"%d\\n\", count(x[q], 2));\n\n  return 0;\n}\n"}
{"label": "1", "index": "1630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid decprime(int begain, int a);\nint sum = 1;\nint main() {\n  int n, a;\n  int k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> a;\n    decprime(2, a);\n    printf(\"%d\\n\", sum);\n    sum = 1;\n  }\n  return 0;\n}\nvoid decprime(int begain, int a) {\n  int i;\n\n  for (i = begain; i <= a; i++) {\n    if (a % i == 0 && i <= a / i) {\n      sum++;\n      decprime(i, a / i);\n    }\n    if (i > a / i)\n      break;\n  }\n}\n"}
{"label": "1", "index": "1631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint divide(int n, int a) {\n  int s = 0, t = 0, i;\n  if (n == 1)\n    return 1;\n  for (i = a; i > 1; i--)\n    if (n % i == 0) {\n      s += divide(n / i, i);\n      t++;\n    }\n  if (t == 0)\n    return 0;\n  return s;\n}\nint main() {\n  int n, k;\n  cin >> k;\n  while (k > 0) {\n    cin >> n;\n    printf(\"%d\\n\", divide(n, n));\n    k--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1632", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fac(int p, int q) {\n  int i, t = 1;\n  if (p > q) {\n    return 0;\n  }\n  if (p == q) {\n    return 1;\n  }\n  for (i = p; i <= sqrt(q); i++) {\n    if (q % i == 0) {\n      t += fac(i, q / i);\n    }\n  }\n  return t;\n}\nint main() {\n  int a, i, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << fac(2, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1633", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int min);\nint main() {\n  int n, i, a, A[100];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    A[i] = f(a, 2);\n  };\n\n  for (i = 0; i < n; i++)\n    cout << A[i] << endl;\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1;\n  int i;\n\n  if (a < min)\n\n    return 0;\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid count(int N, int i) {\n  if (N == 1)\n    sum++;\n  while (i <= N) {\n    if (N % i == 0) {\n      count(N / i, i);\n    }\n    i++;\n  }\n  return;\n}\nint main() {\n  int T = 0;\n  cin >> T;\n  while (T--) {\n    int N = 0;\n    cin >> N;\n    int i = 2, total = 1;\n    while (i <= N / 2) {\n      if (N % i == 0) {\n        sum = 0;\n        count(N / i, i);\n        total += sum;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint fen(int m, int k) {\n  int i, t = 1, n = 0;\n  for (i = 2; i <= m; i++) {\n    if (m % i == 0)\n      n++;\n  }\n  if (n == 1 || m == 1)\n    return 1;\n  else\n    for (i = 2; i <= m; i++) {\n      if (m % i == 0 && m / i >= i && i >= k) {\n        k = i;\n        t = t + fen(m / i, k);\n      }\n    }\n  return t;\n}\nint main() {\n  int fen(int m, int k);\n  int n, i, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    cout << fen(x, 1) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int x, int m);\n  int k, i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    for (j = 2; j <= k; j++) {\n      if (k % j == 0)\n        sum += f(k, j);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n\nint f(int x, int m) {\n  int i, sum = 0;\n  if (m == x)\n    sum = 1;\n  else {\n    x = x / m;\n    for (i = m; i <= x; i++) {\n      if (x % i == 0) {\n        sum += f(x, i);\n      }\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint dividemin(int a, int minyinzi) {\n  int num = 0;\n  if (a == 1)\n    num++;\n  else\n    for (int i = minyinzi; i <= a; i++) {\n      if (a % i == 0)\n        num = num + dividemin(a / i, i);\n    }\n  return num;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= n - 1; i++)\n\n    printf(\"%d\\n\", dividemin(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "1638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ans;\n\nvoid dfs(int, int);\n\nint main() {\n  int n, num;\n  cin >> n;\n  while (n--) {\n    cin >> num;\n    ans = 0;\n    dfs(num, 2);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n\nvoid dfs(int x, int f) {\n  if (x == 1) {\n    ++ans;\n    return;\n  }\n  for (int i = f; i <= x; ++i)\n    if (x % i == 0)\n      dfs(x / i, i);\n  return;\n}\n"}
{"label": "1", "index": "1639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint minf(int p, int min);\nint main() {\n  int n, i, k, p, zs[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p;\n\n    zs[i] = minf(p, 2);\n\n    zs[i]++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d\\n\", zs[i]);\n  }\n  printf(\"%d\", zs[n - 1]);\n\n  return 0;\n}\nint minf(int p, int min) {\n  int x = 0, i;\n  i = min;\n  for (i; i <= (int)sqrt(p); i++) {\n    if (p % i == 0) {\n      x += minf(p / i, i) + 1;\n    }\n  }\n\n  return x;\n}\n"}
{"label": "1", "index": "1640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factoring(int a, int b) {\n  int i, kind = 0;\n\n  if (a == 1) {\n    kind = 1;\n\n  }\n\n  else {\n    for (i = b; i <= a; i++) {\n\n      if (a % i == 0) {\n        kind = factoring(a / i, i) + kind;\n      }\n    }\n  }\n\n  return kind;\n}\n\nint main() {\n  int n, x[40000], i;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    x[i] = factoring(x[i], 2);\n    cout << x[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint divide(int n, int j) {\n  int sum = 1, i, s, p, k;\n  s = sqrt(n);\n  for (i = j; i <= s; i++) {\n    if (n % i == 0) {\n      p = n / i;\n      k = i;\n      sum = sum + divide(p, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int k, m, p;\n  for (k = 0; k < n; k++) {\n    cin >> m;\n    p = divide(m, 2);\n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1642", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint yueshu[100] = {0};\nint s = 0;\n\nvoid number(int num, int s) {\n  int i;\n  for (i = s; i >= 0; i--) {\n    if (num < yueshu[i])\n      continue;\n    if (num == yueshu[i])\n      sum++;\n    else if (num > yueshu[i] && num % yueshu[i] == 0)\n      number(num / yueshu[i], i);\n  }\n}\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int num = 0;\n  while (scanf(\"%d \", &num)) {\n    int i = 0, j = 0;\n    for (i = 2; i <= num; i++)\n      if (num % i == 0) {\n        yueshu[j] = i;\n        j++;\n      }\n    s = j - 1;\n    number(num, s);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1643", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint kind(int k, int a) {\n  int i, j, temp = 0;\n  int x;\n  for (i = a; i < k; i++) {\n    if (i <= k / i && k % i == 0) {\n\n      x = k / i;\n\n      temp++;\n      for (j = i; j < x; j++) {\n        if (j <= x / j && x % j == 0) {\n          temp = temp + kind(x, j);\n          break;\n        }\n      }\n    }\n  }\n\n  return (temp);\n}\nint main() {\n  int n, i, a[32768][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i][0];\n    a[i][1] = kind(a[i][0], 2);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", a[i][1] + 1);\n\n  return 0;\n}\n"}
{"label": "1", "index": "1644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint reek(int i, int j) {\n  int k, g = 0;\n  for (k = j; k < i; k++) {\n    if ((i % k == 0) && (k != 1)) {\n      g = 1;\n      break;\n    } else\n      continue;\n  }\n  if (g == 0)\n    return 1;\n  else {\n    int num = 1;\n    for (k = j; k <= sqrt(i); k++) {\n      if ((i % k == 0) && (k != 1))\n        num += reek(i / k, k);\n      else\n        continue;\n    }\n    return num;\n  }\n}\nint main() {\n  int n, i, a[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[n]);\n    cout << reek(a[n], 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1645", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nvoid next(int c[], int x) {\n  int i, j;\n  c[0]++;\n  for (i = 1; c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] *\n                  c[9] * c[10] * c[11] * c[12] * c[13] * c[14] >\n              x;\n       i++) {\n    c[i]++;\n    for (j = 0; j < i; c[j++] = c[i])\n      ;\n    if (c[14] == 2)\n      break;\n  }\n}\n\nint reslove(int x) {\n  int c[15] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  int p = 0;\n  while (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n             c[10] * c[11] * c[12] * c[13] * c[14] <=\n         x) {\n    if (c[0] * c[1] * c[2] * c[3] * c[4] * c[5] * c[6] * c[7] * c[8] * c[9] *\n            c[10] * c[11] * c[12] * c[13] * c[14] ==\n        x)\n      p++;\n    next(c, x);\n  }\n  return p;\n}\n\nint main() {\n  int i = 0, n, a;\n  scanf(\"%d\", &n);\n  while (i++ < n) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", reslove(a));\n  }\n\n  \n}\n"}
{"label": "1", "index": "1646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int l) {\n  int re = 0, j;\n  if (l == 4)\n    re = 1;\n  if (l > 4) {\n    for (j = m; j <= sqrt(l); j++) {\n      if (l % j == 0) {\n        re = re + 1 + f(j, l / j);\n      }\n    }\n  }\n  return re;\n}\nint main() {\n  int n, i, a[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cout << (f(2, a[i]) + 1) << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid fenjie(int i, int a);\n\nint k = 1;\n\nint main() {\n  int n, m, a;\n\n  cin >> n;\n\n  for (m = 1; m <= n; m++) {\n    cin >> a;\n\n    fenjie(2, a);\n\n    printf(\"%d\\n\", k);\n\n    k = 1;\n  }\n\n  return 0;\n}\n\nvoid fenjie(int i, int a) {\n  for (; i <= sqrt(a); i++)\n    if (a % i == 0) {\n      k++;\n\n      fenjie(i, a / i);\n    }\n}\n"}
{"label": "1", "index": "1648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int n, int m) {\n  if (n < m)\n    m = n;\n  if (n == 1)\n    return 1;\n  int sum = 0;\n  for (int i = m; i >= 2; i--) {\n    if (n % i == 0)\n      sum = sum + devide(n / i, i);\n  }\n  return sum;\n}\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d \", &m);\n    cout << devide(m, m) << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1649", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = 2; i <= sqrt(x); i++) {\n        if (x % i == 0) {\n          if (i < q)\n            continue;\n          else\n            sum = sum + f(i, x / i);\n        }\n      }\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\n\nint main() {\n  int n, i, x, sum, p;\n  p = 0;\n  sum = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    sum = f(2, x);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1650", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint shi(int a) {\n  int b = sqrt(a);\n  for (int i = 2; i <= b; i++) {\n    if (a % i == 0) {\n      return 0;\n    }\n  }\n  return 1;\n}\nint shu(int m, int k) {\n  int a = 1;\n  for (int j = k; j <= sqrt(m); j++) {\n    if (m % j == 0 && m / j >= k) {\n      a++;\n      if (shi(m / j) == 0)\n        a += shu(m / j, j) - 1;\n    }\n  }\n  return a;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int m;\n    scanf(\"%d\", &m);\n    printf(\"%d\\n\", shu(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int m, int x, int i) {\n  if (x == 1 && m >= i)\n    return 1;\n  else if (x > 1) {\n    int j = i;\n    int sum = 0;\n    while (j <= m) {\n      if (j != 1 && m % j == 0)\n        sum = sum + devide(m / j, x - 1, j);\n      j++;\n    }\n    return sum;\n  }\n  return 0;\n}\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    scanf(\"%d \", &a);\n    for (int X = 1; X <= 16; X++)\n      sum += devide(a, X, 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cal(int y, int x) {\n  int i, sum;\n  if (x == 1)\n    return 1;\n  else {\n    sum = 0;\n    for (i = y; i <= x; i++) {\n      if ((x % i == 0) && ((x / i == 1) || (x / i > y)))\n        sum += cal(i, x / i);\n    }\n    return sum;\n  }\n}\nint main() {\n  int n, i, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &l);\n    printf(\"%d\", cal(2, l));\n    if (i != n)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 1;\nint Fact(int x, int y);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    sum = 1;\n    Fact(a, 2);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nint Fact(int x, int y) {\n  if (x == 1)\n    return 0;\n  else {\n    for (; y <= sqrt(x); y++)\n      if (x % y == 0)\n        sum = sum + Fact(x / y, y);\n\n    return 1;\n  }\n}\n"}
{"label": "1", "index": "1654", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  int i, p, q;\n  for (i = b, p = 0; i <= sqrt(a); i++) {\n    if (a % i == 0) {\n      q = f(a / i, i);\n      p = p + q;\n    }\n  }\n  p++;\n  return (p);\n}\nint main() {\n  int i, a, n, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    k = f(a, 2);\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint totalCount;\n\nvoid FindFact(int x, int max) {\n  if (x == 1) {\n    totalCount++;\n    return;\n  }\n  for (int i = max; i > 1; i--)\n    if (x % i == 0)\n      FindFact(x / i, i);\n  return;\n}\n\nint main() {\n  int n, x;\n  for (scanf(\"%d \", &n); n > 0; n--) {\n    totalCount = 0;\n    cin >> x;\n    FindFact(x, x / 2);\n    cout << totalCount + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fengjie(int a, int b) {\n  if (a == 2 || a == 3)\n    return 1;\n  int sum = 1;\n  int c = sqrt(a);\n  for (int i = b; i <= c; i++) {\n    if (a % i == 0)\n      sum = sum + fengjie(a / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a;\n    cout << fengjie(a, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1657", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num; \nint main() {\n  int f(int, int); \n  int i, n, a[100], result[100];\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    num = 1; \n    cin >> a[i];\n    result[i] = f(1, a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    cout << result[i] << endl;\n  }\n}\nint f(int x, int y) \n{\n  int i;\n  for (i = 2; i <= sqrt(y); i++) \n  {\n    if (y % i == 0 &&\n        i >= x) \n    {\n      num++;       \n      f(i, y / i); \n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nint fjys(int n, int m, int i, int d, int ji[20]) {\n  int a;\n  for (a = i; a < m; a++) {\n    if (n % a == 0) {\n      ji[d] = a;\n      int chenji = 1, k;\n      for (k = 0; k <= d; k++)\n        chenji = chenji * ji[k];\n      if (chenji == m) {\n        num++;\n        break;\n      } else\n        fjys(n / a, m, a, d + 1, ji);\n    }\n  }\n  return num;\n}\nint main() {\n  int m, n, j, result = 0, ji[20] = {0};\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    num = 0;\n    scanf(\"%d \", &n);\n    result = fjys(n, n, 2, 0, ji);\n    cout << result + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fenjie(int a, int start);\n\nint main() {\n  int n, i, integ;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> integ;\n    printf(\"%d\\n\", fenjie(integ, 2));\n  }\n  return 0;\n}\n\nint fenjie(int a, int start) {\n  int i, sum = 1;\n  if (start == a)\n    sum = 1;\n  else {\n    for (i = start; i <= sqrt(a); i++) {\n      if (a % i == 0)\n        sum = sum + fenjie(a / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int y) {\n  int a, n = 1;\n  for (a = y; a <= sqrt(x); a++) {\n    if (x % a == 0)\n      n += f(x / a, a);\n  }\n  return n;\n}\nint main() {\n  int m, i;\n  cin >> m;\n  int x[m], n[m];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n    n[i] = f(x[i], 2);\n  }\n  for (i = 0; i < m; i++) {\n    cout << n[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1661", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fuck(int n, int m) {\n  int i, cnt = 1;\n  if (m >= sqrt(n)) {\n    return 1;\n  }\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      cnt += fuck(n / i, i);\n    }\n  }\n  return cnt;\n}\nint main() {\n  int t, n, k;\n  scanf(\"%d \", &t);\n  for (k = 1; k <= t; k++) {\n    cin >> n;\n    cout << fuck(n, 2) << endl;\n  }\n  int x;\n  scanf(\"%d \", &x);\n  return 0;\n}\n"}
{"label": "1", "index": "1662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ispr(int t) {\n  int v = sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum = 0;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  while (i <= n) {\n    if (n % i == 0)\n      fun(n / i, i);\n    i++;\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int a;\n    scanf(\"%d\", &a);\n    if (ispr(a)) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int i = 2, res = 1;\n    while (i <= a / 2) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res += sum;\n      }\n      i++;\n    }\n    cout << res << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int, int); \nint main()       \n{                \n  int n, i, a[50];\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];                \n    cout << f(a[i], 2) << endl; \n  }\n  return 0; \n} \n\nint f(int n, int p) \n\n{\n  int sum = 0, m;\n  for (m = p; m <= n; m++)\n    if (n % m == 0) {\n      if (m < n)\n        sum = sum + f(n / m, m); \n      if (m == n)\n        sum = sum + 1; \n    }\n  return sum;\n}\n"}
{"label": "1", "index": "1664", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint sum = 1, j = 2; \nvoid num(int);      \nint main()          \n{\n  int n, a[100];\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    cin >> a[i];\n    num(a[i]); \n    cout << sum << endl;\n    sum = 1, j = 2; \n  }\n  return 0;\n}\nvoid num(int a) \n{\n  int k;\n  for (k = j; k <= sqrt(a); k++) \n  {\n    if (a % k == 0) \n    {\n      sum = sum + 1; \n      j = k;         \n      num(a / k);    \n    }\n  }\n}\n"}
{"label": "1", "index": "1665", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0) {\n      sum += 1 + yinshu(be / i, i);\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, num, sign;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    for (j = num; j > 1; j--)\n      if (num % j == 0) {\n        sign = j;\n      }\n    printf(\"%d\\n\", yinshu(num, sign) + 1);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "1", "index": "1666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid f(int x, int y) {\n  if (x == 1)\n    sum++;\n  while (y <= x) {\n    if (x % y == 0)\n      f(x / y, y);\n    y++;\n  }\n}\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    int j = 2, num = 1;\n    while (j <= a / 2) {\n      if (a % j == 0) {\n        sum = 0;\n        f(a / j, j);\n        num += sum;\n      }\n      j++;\n    }\n    printf(\"\\n%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1667", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum, temp;\nvoid fact(int); \n\nint main() {\n  int n, i, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    sum = 0;\n    temp = 2; \n    fact(k);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid fact(int k) {\n  if (k == 1) \n  {\n    sum++;\n    return;\n  }\n  int i; \n  for (i = temp; i <= k; i++) {\n    if (k % i == 0) {\n      temp = i;    \n      fact(k / i); \n    }\n  }\n}\n"}
{"label": "1", "index": "1668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int k) {\n  if (n < k)\n    return 0;\n  int i, s = 1;\n  for (i = k; i < n; i++) {\n    if (n % i == 0)\n      s += f(n / i, i);\n  }\n  return s;\n}\nint main() {\n  int m, n, i, ans, s;\n  scanf(\"%d\", &m);\n  while (m--) {\n    scanf(\"%d\", &n);\n    printf(\"%d\\n\", f(n, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid decprime(int begain, int a);\nint sum = 1;\nint main() {\n  int n, a;\n  int k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    cin >> a;\n    decprime(2, a);\n    printf(\"%d\\n\", sum);\n    sum = 1;\n  }\n  return 0;\n}\nvoid decprime(int begain, int a) {\n  int i;\n\n  for (i = begain; i <= a; i++) {\n    if (a % i == 0 && i <= a / i) {\n      sum++;\n      decprime(i, a / i);\n    }\n    if (i > a / i) {\n      break;\n    }\n  }\n}\n"}
{"label": "1", "index": "1670", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint factor(int a, int min) {\n  int i, result = 1;\n  if (a < min)\n    return 0;\n  for (i = min; i < a; i++) {\n    if (a % i == 0)\n      result += factor(a / i, i);\n  }\n  return result;\n}\n\nint main() {\n  int n, i, a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    a[i] = factor(a[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;            \nvoid fact(int a, int i) \n{\n  if (a == 1)\n    sum++;       \n  while (i <= a) \n  {\n    if (a % i == 0)\n      fact(a / i, i); \n    i++;              \n  }\n}\nint main() \n{\n  int n;      \n  cin >> n;   \n  while (n--) \n  {\n    int a;             \n    cin >> a;          \n    int i = 2;         \n    int result = 1;    \n    while (i <= a / 2) \n    {\n      if (a % i == 0) \n      {\n        sum = 0;        \n        fact(a / i, i); \n        result += sum;  \n      }\n      i++; \n    }\n    cout << result << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Factor(int, int);\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", Factor(a, 2));\n  }\n  return 0;\n}\nint Factor(int a, int p) {\n  int i, j, z = 1;\n  if (a < p)\n    z = 0;\n  else {\n    for (i = p; i <= a; i++) {\n      if (a % i == 0)\n        z += Factor(a / i, i);\n    }\n  }\n  return z;\n}\n"}
{"label": "1", "index": "1673", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint resolution_into_factors(int j, int i) {\n  int m, sum = 0, k = 0;\n  for (m = j; m <= sqrt(i); m++) {\n    if (i % m == 0) {\n      sum = resolution_into_factors(m, i / m) + sum + 1;\n      k++;\n    }\n  }\n  if (k == 0)\n    return 0;\n  return sum;\n}\nint main() {\n  int n, k, i;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> i;\n    cout << resolution_into_factors(2, i) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1674", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint fen(int x, int y);\n\nint main() {\n  int n, i, m[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &m[i]);\n    printf(\"%d\\n\", fen(m[i], 2));\n  }\n  return 0;\n}\n\nint fen(int x, int y) {\n  int j, k;\n  int result = 1;\n  if (x < y) {\n    return 0;\n  }\n  for (j = y; j < x; j++) {\n    if (x % j == 0)\n      result += fen(x / j, j);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sushu(int b) {\n  int flag = 1, i;\n  if (b == 2)\n    return 1;\n  if (b % 2 == 0)\n    return 0;\n  for (i = 2; i <= b / 2; i++) {\n    if (b % i == 0) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 0;\n  } else\n    return 1;\n}\nint number(int a, int b) {\n  int i, total = 1;\n  if (sushu(a)) {\n    total = 1;\n    return total;\n  }\n  for (i = b; i <= a; i++) {\n\n    if (a % i == 0 && a / i >= i) {\n      total = total + number(a / i, i);\n    }\n  }\n  return total;\n}\nint main() {\n  int n, i, A[100], B[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    B[i] = number(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", B[i]);\n  }\n}\n"}
{"label": "1", "index": "1676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num = 0;\nvoid fj(int m, int i) {\n  if (m == 1)\n    num++;\n  else {\n    for (int j = i; j <= m; j++) {\n      if (m % j == 0)\n        fj(m / j, j);\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int ii = 0; ii < n; ii++) {\n    cin >> m;\n    fj(m, 2);\n    cout << num << \"\\n\";\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fenjie(int n, int x) {\n  int i, t = 0; \n  for (i = x; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      t = t + 1 + fenjie(n / i, i); \n    }\n  }\n  return t; \n}\nint main() {\n  int i, t, n;\n  cin >> t;\n  for (i = 0; i < t; i++) { \n    cin >> n;\n    cout << fenjie(n, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int m, int i);\nint num;\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    num = 0;\n    fun(a, 2);\n    printf(\"%d\\n\", num + 1);\n  }\n  return 0;\n}\nvoid fun(int m, int i) {\n  int k = sqrt(m);\n  for (i = i; i <= k; i++) {\n    if (m % i == 0) {\n      num++;\n      fun(m / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint coun;\nvoid depart(int n, int i) {\n  int j;\n  if (n == 1)\n    coun++;\n  else\n    for (j = i; j <= n; j++)\n      if (n % j == 0)\n        depart(n / j, j);\n}\n\nint main() {\n  int n, j;\n  cin >> n;\n  int b[n];\n  for (j = 0; j < n; j++) {\n    cin >> b[j];\n  }\n  for (j = 0; j < n; j++) {\n    coun = 0;\n    depart(b[j], 2);\n    cout << coun << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint g(int y) {\n  int i;\n  for (i = 0;; i++) {\n    if (i * i > y)\n      break;\n  }\n  return i - 1;\n}\nint f(int x, int b) {\n  int p, a[100], t = 0, k = 0;\n  p = g(x);\n  if (x == 2)\n    return 0;\n  else {\n    for (int i = b; i <= p; i++) {\n      if (x % i == 0) {\n        a[t] = i;\n        t++;\n      }\n    }\n    if (t == 0)\n      return 0;\n    else\n      for (int i = 0; i < t; i++)\n        k = k + f(x / a[i], a[i]) + 1;\n    return k;\n  }\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1681", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint ways(int n, int p) {\n  if (n < p)\n    return 0;\n  while (n % p != 0)\n    p++;\n  if (n == p)\n    return 1;\n  return ways(n / p, p) + ways(n, p + 1);\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &m);\n    printf(\"%d\\n\", ways(m, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1682", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Factorization(int, int);\nint main() {\n  int n = 0, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    cout << Factorization(num, 2) + 1 << endl;\n  }\n  return 0;\n}\n\nint Factorization(int num, int n) {\n  int count = 0;\n  for (int i = n; num / i >= i; i++)\n    if (num % i == 0) {\n      count++;\n      count = count + Factorization(num / i, i);\n    }\n  return count;\n}\n"}
{"label": "1", "index": "1683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint means(int, int);\nint main() {\n  int n, i = 0;\n  cin >> n;\n  while (i < n) {\n    int a;\n    cin >> a;\n    cout << means(a, a) << endl;\n    i++;\n  }\n  return 0;\n}\n\nint means(int a, int b) {\n  int i, sum = 0;\n  if (a != 1) {\n    for (i = b; i >= 2; i--) {\n      if (a % i == 0) {\n        sum = sum + means(a / i, i); \n      }\n    }\n    return sum; \n  } else {\n    return 1; \n  }\n}\n"}
{"label": "1", "index": "1684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i;               \nint f(int a, int min) { \n  if (a < min) {        \n    return 0;           \n  }\n  int result = 1;                 \n  for (int i = min; i < a; i++) { \n    if (a % i == 0) {             \n      result += f(a / i, i);      \n    }\n  }\n  return result; \n}\nint main() { \n  cin >> n;  \n  int a[n];\n  for (i = 0; i < n; i++) { \n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << f(a[i], 2) << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int b, int min);\nint x = 1, m;\nint main() {\n  int a, n, b;\n  scanf(\"%d\", &n);\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &b);\n    m = b;\n    b = num(b, 2);\n    printf(\"%d\\n\", b);\n    x = 1;\n  }\n  return 0;\n}\n\nint num(int b, int min) {\n  int a, c;\n\n  for (a = min; a < b; a++) {\n    if ((b % a == 0) && (b / a >= a)) {\n      if (num(b / a, a) == 1) {\n        x++;\n      }\n    }\n    if (a == m - 1)\n      return x;\n  }\n  return 1;\n}\n"}
{"label": "1", "index": "1686", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenj(int x, int y) {\n  int a = (x == 1), i;\n  for (i = y; i <= x; i++)\n    if (x % i == 0)\n      a = a + fenj(x / i, i);\n  return a;\n}\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k];\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < k; i++)\n    cout << fenj(a[i], 2) << endl;\n  return 0;\n}\n"}
{"label": "1", "index": "1687", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint devide(int n, int m) {\n  if (n < m)\n    m = n;\n  if (n == 1)\n    return 1;\n  int sum = 0;\n  for (int i = m; i >= 2; i--) {\n    if (n % i == 0) {\n      sum = sum + devide(n / i, i);\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d \", &m);\n    cout << devide(m, m) << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint ways(int n, int p) {\n  if (n < p)\n    return 0;\n  while (n % p != 0)\n    p++;\n  if (n == p)\n    return 1;\n  return ways(n / p, p) + ways(n, p + 1);\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &m);\n    cout << ways(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[40000] = {0};\nvoid fun(int n, int j, int k) {\n  int i;\n  for (i = j; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      j = i;\n      a[k]++;\n      fun(n / i, j, k);\n    }\n  }\n}\n\nint main() {\n  int n;\n  int m[40000] = {0};\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++)\n    fun(m[i], 2, i);\n\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", a[i] + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1690", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int k, int l);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    cout << fenjie(a, 2) << endl;\n  }\n  return 0;\n}\n\nint fenjie(int k, int l) {\n  int num = 1, d, e;\n  if (k < l) {\n    return 0;\n  }\n  d = (int)(sqrt((double)k));\n  for (e = l; e <= d; e++) {\n    if (k % e == 0) {\n      num += fenjie(k / e, e);\n    }\n  }\n  return num;\n}\n"}
{"label": "1", "index": "1691", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i;\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\nint main() {\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cout << f(a[i], 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1692", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint ispr(int t) {\n  int v = (int)sqrt(t * 1.0) + 1;\n  for (int i = 2; i < v; i++)\n    if (t % i == 0)\n      return 0;\n  return 1;\n}\n\nint sum;\nvoid fun(int n, int i) {\n  if (n == 1)\n    sum++;\n  for (; i <= n; i++) {\n    if (n % i == 0)\n      fun(n / i, i);\n  }\n  return;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int j = 0; j < n; j++) {\n    int a;\n    cin >> a;\n    if (ispr(a) == 1) {\n      printf(\"1\\n\");\n      continue;\n    }\n\n    int res = 1;\n    for (int i = 2; i <= a / 2; i++) {\n      if (a % i == 0) {\n        sum = 0;\n        fun(a / i, i);\n        res = res + sum;\n      }\n    }\n    printf(\"%d\\n\", res);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    int m;\n    cin >> m;\n    int f(int a, int min);\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\nint f(int a, int min) {\n  int i = min;\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  while (i < a) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n\n    i++;\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1694", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n, num;\n\nvoid dfs(int i, int j) {\n  int x;\n\n  if (i == 1) {\n    num++;\n    return;\n  }\n  for (x = j; x <= i; x++)\n    if (i % x == 0)\n      dfs(i / x, x);\n}\n\nint main() {\n  cin >> m;\n  while (m > 0) {\n    num = 0;\n    cin >> n;\n    dfs(n, 2);\n    cout << num << endl;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, t, cnt;\nvoid f(int left, int last) {\n  if (left < last) {\n    if (left == 1)\n      cnt++;\n    return;\n  }\n  for (int i = last; i <= left; i++)\n    if (left % i == 0)\n      f(left / i, i);\n}\nint main() {\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d\", &n);\n    cnt = 0;\n    f(n, 2);\n    cout << cnt << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1696", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ct;\nint count(int n, int p) {\n  int i;\n  if (n == 1)\n    ct++;\n  for (i = p; i <= n; i++)\n    if (n % i == 0)\n      count(n / i, i);\n}\nint main() {\n  int n, m, i;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    ct = 0;\n    cin >> n;\n    count(n, 2);\n    cout << ct << endl;\n  }\n}\n"}
{"label": "1", "index": "1697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, t;\nvoid dg(int s) {\n  for (int i = s; i <= t; i++) {\n    if (t % i == 0) {\n      t = t / i;\n      if (t == 1)\n        sum++;\n      else\n        dg(i);\n      t = t * i;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    cin >> t;\n    dg(2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  if ((int)pow(x, 0.5) < y)\n    return 1;\n  int d = 1;\n  for (int i = y; i <= (int)pow(x, 0.5); i++)\n    if ((x % i) == 0)\n      d += f(x / i, i);\n  return d;\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    cin >> m;\n    cout << f(m, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint temp = 2, sum = 0;\nvoid dg(int x) {\n  for (int i = temp; i <= x; i++) {\n    if (x % i == 0) {\n      temp = i;\n      if (x / i == 1) {\n        sum++;\n        temp = 2;\n      } else {\n        dg(x / i);\n      }\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int x;\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    dg(x);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int q, int x) {\n  if (q < x) {\n    int i, k, p, sum;\n    k = 0;\n    sum = 0;\n    p = 0;\n    for (i = 2; i <= x / 2; i++)\n      if (x % i == 0)\n        k = k + 1;\n    if (k == 0)\n      return 1;\n    else {\n      for (i = q; i <= sqrt(x); i++)\n        if (x % i == 0)\n          sum = sum + f(i, x / i);\n\n      return sum + 1;\n      p = 0;\n      sum = 0;\n    }\n  } else {\n    if (q == x)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint main() {\n  int n, i, x, sum;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    sum = f(2, x);\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int, int);\nint main() {\n  int n, a, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int x, int b) {\n  int j, re = 1;\n  if (x < b)\n    return 0;\n  for (j = b; j < x; j++) {\n    if (x % j == 0) {\n      re = re + f(x / j, j);\n    }\n  }\n  return re;\n}\n"}
{"label": "1", "index": "1702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, k = 2;\nint fenjie(int n, int k) {\n  int x, i, sum = 0, p = 0;\n  x = (int)pow(n, 0.5);\n  for (i = k; i <= x; i++) {\n    if (n % i == 0) {\n      k = i;\n      sum = sum + fenjie(n / i, k);\n      p = 1;\n    }\n  }\n  if (p == 0)\n    return 1;\n  if (p == 1)\n    return sum + 1;\n}\nint main() {\n  int m, n, i;\n  scanf(\"%d \", &m);\n  for (i = 0; i <= m - 1; i++) {\n    cin >> n;\n    cout << fenjie(n, 2) << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int x, int y) {\n  int i, s = 0;\n  if (x == y)\n    return 1;\n  for (i = y; i < x; i++)\n    if (x % i == 0)\n      s += fenjie(x / i, i);\n  if (i == x)\n    s++;\n  return s;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> i;\n    cout << fenjie(i, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid ways(int a, int last);\nint main() {\n  int n, num[100], i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    ways(num[i], 2);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid ways(int a, int last) {\n  int i, j;\n  for (i = last; i <= a; i++) {\n    if (a < i) {\n    } else if (a == i) {\n      sum++;\n    } else if (a % i == 0)\n\n      ways(a / i, i);\n  }\n}\n"}
{"label": "1", "index": "1705", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint fen(int x, int y);\n\nint main() {\n  int n, i, m[500];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    printf(\"%d\\n\", fen(m[i], 2));\n  }\n  return 0;\n}\n\nint fen(int x, int y) {\n  int j;\n  int result = 1;\n  if (x < y)\n    return 0;\n  for (j = y; j < x; j++) {\n    if (x % j == 0)\n      result += fen(x / j, j);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1706", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ans(int a, int i) {                \n  int sum = 0;                         \n  for (int j = i; j <= sqrt(a); j++) { \n    if (a % j != 0)\n      continue; \n    sum++;      \n    if (a >= j * j)\n      sum += ans(a / j, j); \n  }\n  return sum;\n}\nint main() {\n  int n, a; \n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << ans(a, 2) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num, s = 1;\nvoid divide(int n, int a) {\n  for (int i = n; i <= a / s; i++) {\n    s *= i;\n    if (s == a) {\n      num++;\n    } else if (s < a && a % s == 0)\n      divide(i, a);\n    s /= i;\n  }\n}\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    num = 0;\n    scanf(\"%d \", &a);\n    divide(2, a);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint factorization(int a, int k);\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    cout << factorization(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n\nint factorization(int a, int k) {\n  int sum = 1;\n  if (a == 1) {\n    return 0;\n  }\n  if (a == 2) {\n    return 1;\n  }\n  int b = (int)sqrt((double)a);\n  for (int i = k; i <= b; i++) {\n    if (a % i == 0) {\n      sum += factorization(a / i, i);\n    }\n  }\n  return sum;\n}\n"}
{"label": "1", "index": "1709", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint solution(int a, int b) {\n  for (int i = b; i <= a; i++) {\n    if (a % i == 0) {\n      a = a / i;\n      if (a == 1)\n        num++;\n      else\n        num = solution(a, i);\n      a = a * i;\n    }\n  }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a;\n    cin >> a;\n    num = 0;\n    cout << solution(a, 2) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint counter = 1;\nvoid abc(int a, int b) {\n  int i;\n  for (i = b; i <= a; i++) {\n    if (a % i == 0 && (a / i) >= i) {\n      counter++;\n      abc(a / i, i);\n    }\n  }\n}\nint main() {\n  int t, x;\n  scanf(\"%d \", &t);\n  for (x = 1; x <= t; x++) {\n    counter = 1;\n    int m;\n    cin >> m;\n    abc(m, 2);\n    cout << counter << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint answer = 0;\nvoid f(int n, int N) {\n  if (n < N)\n    N = n;\n  if (N == 1) {\n    answer++;\n    return;\n  }\n  while (N > 1) {\n    if (n % N == 0)\n      f(n / N, N);\n    N--;\n  }\n}\n\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    f(a, a);\n    printf(\"%d\\n\", answer);\n    answer = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1712", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min);\nint main() {\n  int n, i, a, A[100];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    A[i] = f(a, 2);\n  };\n\n  for (i = 0; i < n; i++) {\n    cout << A[i] << endl;\n  }\n  return 0;\n}\n\nint f(int a, int min) {\n  int result = 1;\n  int i;\n\n  if (a < min) {\n    return 0;\n  }\n\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint wtf(int p, int a);\nint main() {\n  int n, i, a, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", wtf(2, a));\n  }\n  return 0;\n}\n\nint wtf(int p, int a) {\n  int i, ways = 0, j = 0;\n  int m = (int)sqrt(a);\n  for (; p <= m; p++) {\n    if (a % p == 0 && a >= p * p) {\n      ways = ways + wtf(p, a / p);\n      j++;\n    }\n  }\n  if (j == 0)\n    return 1;\n  else\n    return ways + 1;\n}\n"}
{"label": "1", "index": "1714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint p = 0;\n\nint factor(int a, int min) {\n  int sum = 0;\n  if (min >= a)\n    return 1;\n  for (int j = min; j <= a / min; j++)\n    if (a % j == 0)\n      sum += factor(a / j, j);\n  return sum;\n}\n\nint main() {\n  int n = 0, a = 0;\n  cin >> n;\n  while (n > 0) {\n    cin >> a;\n    if (a <= 2)\n      printf(\"%d\\n\", 1);\n    else\n      cout << factor(a, 2) + 1 << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1715", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int a, int min);\nint main() {\n  int n, i, a;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yinshu(int be, int by) {\n  int i, sum = 0;\n  for (i = by; i * i <= be; i++) {\n    if (be % i == 0)\n      sum = sum + 1 + yinshu(be / i, i);\n  }\n  return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int num, sign;\n    cin >> num;\n    for (int j = num; j > 1; j--) {\n      if (num % j == 0)\n        sign = j;\n    }\n    cout << yinshu(num, sign) + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1717", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint factor(int a, int f) {\n  if (a == f)\n    return 1;\n  if (a < f)\n    return 0;\n  if (a % f == 0)\n    return factor(a, f + 1) + factor(a / f, f);\n  else\n    return factor(a, f + 1);\n}\n\nint main() {\n  int x, a;\n  cin >> x;\n  while (x > 0) {\n    cin >> a;\n    cout << factor(a, 2) << endl;\n    x--;\n  }\n}\n"}
{"label": "1", "index": "1718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int f(int, int);\n  int n[100], sum, i, m;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++) {\n    sum = f(1, n[i]) + 1;\n    printf(\"%d\\n\", sum);\n  }\n}\n\nint f(int i, int n) {\n  int j, k, sum = 0;\n  for (j = i; j < (int)sqrt((double)n) + 1; j++) {\n\n    k = sum;\n    if (j == 1) {\n      sum = 0;\n    } else {\n      if (n % j == 0 && n / j >= j) {\n        sum = f(j, n / j) + 1;\n      } else\n        sum = 0;\n    }\n    sum = sum + k;\n  }\n  return (sum);\n}\n"}
{"label": "1", "index": "1719", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int i, int t) {\n  if (i < t) {\n    return 0;\n  }\n  int b = 1;\n  int a;\n  for (a = t; a < i; a++) {\n    if (i % a == 0)\n      b = b + f(i / a, a);\n  }\n  return b;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 0;\n  int d[100];\n  do {\n    cin >> d[i];\n    i++;\n  } while (i < n);\n  i = 0;\n  do {\n    printf(\"%d\\n\", f(d[i], 2));\n    i++;\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "1", "index": "1720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sdw(int a, int b) {\n  int i;\n  int m = 1;\n  for (i = a; i < b / 2; i++) {\n    if (b % i == 0) {\n      if (i <= b / i)\n        m = sdw(i, b / i) + m;\n    }\n  }\n  return m;\n}\nint main() {\n  int n, i, p, b;\n  int a[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b = a[i];\n    p = sdw(2, b);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1721", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fun(int i, int j, int count) {\n  int k;\n  for (k = i; k <= sqrt(j); k++)\n    if (j % k == 0) {\n      count++;\n      count = fun(k, j / k, count);\n    }\n  return count;\n}\n\nint main() {\n  int count;\n  int k, n, i, j;\n  cin >> k;\n  for (j = 0; j < k; j++) {\n    scanf(\"%d \", &n);\n    count = 1;\n    for (i = 2; i < sqrt(n); i++)\n      if (n % i == 0) {\n        count++;\n        count = fun(i, n / i, count);\n      }\n\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint digui(int x, int min);\nint main() {\n  int n, i, m, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &m);\n    y = digui(m, 2);\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\nint digui(int x, int min) {\n  int i, result;\n  result = 1;\n  if (x < min)\n    return 0;\n\n  for (i = min; i <= x - 1; i++) {\n    if (x % i == 0)\n      result = result + digui(x / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1723", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint cnt = 0; \n\nvoid slv(int nm, int pr) \n{\n  int i;\n  if (nm >= pr) \n  {\n    cnt++;       \n    if (pr == 1) \n      pr++;\n    for (i = pr; i <= nm; i++) \n    {\n      if (nm % i == 0) \n      {\n        slv(nm / i, i); \n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, num;\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cnt = 0;             \n    cin >> num;          \n    slv(num, 1);         \n    cout << cnt << endl; \n  }\n}\n"}
{"label": "1", "index": "1724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int m) {\n  if (a < m)\n    return 0;\n  int kind = 1;\n  for (int i = m; i < a; i++) {\n    if (a % i == 0)\n      kind = kind + f(a / i, i);\n  }\n  return kind;\n}\nint main() {\n  int n, a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    printf(\"%d\\n\", f(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "1725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint make(int x, int t) {\n  int ans = 0, i;\n  if (x == 1)\n    return 1;\n  for (i = t; i <= x; i++)\n    if (x % i == 0)\n      ans += make(x / i, i);\n  return ans;\n}\nint main() {\n  int i, k, j, p, n, t, m, x;\n  scanf(\"%d\", &t);\n  for (p = 1; p <= t; p++) {\n    scanf(\"%d\", &n);\n    x = make(n, 2);\n    printf(\"%d\\n\", x);\n  }\n}\n"}
{"label": "1", "index": "1726", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num(int, int, int);\nint qufen(int);\nint power(int, int);\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t >= 1) {\n    int n, i, x, sum = 1;\n    cin >> n;\n    x = qufen(n);\n    for (i = 2; i <= x; i++)\n      sum = sum + num(n, i, 2);\n    cout << sum << endl;\n    t--;\n  }\n  return 0;\n}\nint qufen(int n) {\n  int j;\n  for (j = 1;; j++) {\n    if (power(2, j) > n) {\n      return j - 1;\n      break;\n    }\n  }\n}\nint power(int a, int b) {\n  int sum = 1, k;\n  for (k = 1; k <= b; k++)\n    sum = sum * a;\n  return sum;\n}\nint num(int n, int g, int h) {\n  if ((g == 1) && (n >= h))\n    return 1;\n  int i, j = 0, count = 0, a[20000];\n  for (i = h; i < n; i++) {\n    if (n % i == 0) {\n      a[j] = i;\n      j++;\n    }\n  }\n  if (j == 0)\n    return 0;\n  else {\n    for (i = 0; i < j; i++)\n      count = count + num(n / a[i], g - 1, a[i]);\n    return count;\n  }\n}\n"}
{"label": "1", "index": "1727", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int s = 0, i;\n  for (i = y; i > 1; i--) {\n    if (x % i == 0)\n      s += f(x / i, i);\n  }\n  if (x == 1)\n    return 1;\n  return s;\n}\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", f(a[i], a[i]));\n  return 0;\n}\n"}
{"label": "1", "index": "1728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint deal(int num, int p) {\n  int i, sum = 0;\n  if (num == 1)\n    return 1;\n  for (i = p; i <= num; ++i)\n    if (num % i == 0)\n      sum += deal(num / i, i);\n  return sum;\n}\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  while (n--) {\n    cin >> a;\n    cout << deal(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ct;\nint count(int n, int p) {\n  int i;\n  if (n == 1)\n    ct++;\n  for (i = p; i <= n; i++)\n    if (n % i == 0)\n      count(n / i, i);\n}\nint main() {\n  int n, m, i;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    ct = 0;\n    cin >> n;\n    count(n, 2);\n    cout << ct << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint factorization(int num, int i);\nint main() {\n  int n, i, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", factorization(num, 2));\n  }\n  return 0;\n}\n\nint factorization(int num, int i) {\n  int j, squ, sum = 1;\n  squ = sqrt((double)num);\n  for (j = i; j <= squ; j++) {\n    if (num % j == 0)\n      sum = sum + factorization(num / j, j);\n  }\n  return sum;\n};\n"}
{"label": "1", "index": "1731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int min) {\n  int j, num;\n  if (a < min)\n    return 0;\n  num = 1;\n  for (j = min; j < a; j++)\n    if (a % j == 0)\n      num = num + f(a / j, j);\n  return num;\n}\n\nint main() {\n  int n, i, out, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    out = f(a, 2);\n    cout << out << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid account(int, int);\nint p;\nint main() {\n  int m;\n  int n;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    p = 0;\n    cin >> m;\n    account(m, 1);\n    cout << p << endl;\n    n--;\n  }\n  return 0;\n}\nvoid account(int m, int i) {\n  if (m == 1)\n    p++;\n  else\n    for (int j = 2; j <= m; j++) {\n      if ((m % j == 0) && (j >= i))\n        account(m / j, j);\n    }\n}\n"}
{"label": "1", "index": "1733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int k = 0;\n  if (a >= 2 * b) {\n    for (int i = b; i <= a / b; i++) {\n      if (a % i == 0 && a / i >= i) {\n        k += f(a / i, i) + 1;\n      }\n    }\n  } else {\n    k = 0;\n  }\n  return k;\n}\n\nint main() {\n  int n, a, t;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &a);\n    t = f(a, 2) + 1;\n    cout << t << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid out(int, int);\n\nint t = 1;\n\nint main() {\n  int n = 0;\n  int i = 0;\n  double sum = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> sum;\n    out(sum, 2.0);\n    cout << t << \"\\n\";\n    t = 1;\n  }\n\n  scanf(\"%d \", &i);\n\n  return 0;\n}\n\nvoid out(int sum, int q) {\n  int num = 0;\n  double m = sum;\n  num = sqrt(m);\n  if (sum % q == 0 && q <= num) {\n    t++;\n    out(sum / q, q);\n    out(sum, q + 1);\n  }\n  if (sum % q != 0 && q <= num)\n    out(sum, q + 1);\n}\n"}
{"label": "1", "index": "1735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int n, int m);\nint main() {\n  int n, num;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", fun(num, 2));\n  }\n  return 0;\n}\nint fun(int n, int m) {\n  int sum = 1;\n  double t = sqrt(n);\n  for (int i = m; i <= t; i++)\n    if (n % i == 0)\n      sum += fun(n / i, i);\n  return sum;\n}\n"}
{"label": "1", "index": "1736", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint tot;\n\nvoid find(int m, int n) {\n  int i, j, k;\n  if (m == 1)\n    tot = tot + 1;\n  else {\n    for (i = n; i <= m; i++)\n      if (m % i == 0)\n        find(m / i, i);\n  }\n}\n\nint main() {\n  int i, j, k, m, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    tot = 0;\n    cin >> m;\n    find(m, 2);\n    printf(\"%d\\n\", tot);\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "1", "index": "1737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num(int a, int b, int c) {\n  int sum = 0, j;\n  if (a > c)\n    return 0;\n  if (b == 1)\n    return 1;\n  for (j = a; j <= c; j++)\n    if (c % j == 0)\n      sum = sum + num(j, b - 1, c / j);\n  return sum;\n}\nint main() {\n  int k, n, m, e = 0, i;\n  cin >> n;\n  while (e < n) {\n    cin >> m;\n    k = 0;\n    int f = m;\n    for (i = 2; i <= f; i++)\n      if (f % i == 0) {\n        k++;\n        f = f / i;\n        i = 1;\n      }\n    cout << num(1, k, m) << \"\\n\";\n    e++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a, factor(int N, int min);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a);\n    printf(\"%d\\n\", factor(a, 2));\n  }\n\n  return 0;\n}\nint factor(int N, int min) {\n  int i, result;\n  result = 1;\n\n  if (N < min) {\n    return 0;\n  }\n  for (i = min; i < N; i++) {\n    if (N % i == 0)\n      result += factor(N / i, i);\n  }\n  return result;\n}\n"}
{"label": "1", "index": "1739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nint a[100];\nvoid search(int t, int k) {\n  int i;\n  if (k == 1)\n    sum++;\n  else\n    for (i = a[t - 1]; i <= k; i++)\n      if (k % i == 0) {\n        a[t] = i;\n        search(t + 1, k / i);\n      }\n}\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> k;\n    sum = 0;\n    a[0] = 2;\n    search(1, k);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1740", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint fenjie(int x, int k) {\n  int t = 1, i;\n  if (k > x) {\n    return 0;\n  }\n  for (i = k; i < x; i++) {\n    if (x % i == 0) {\n      t = t + fenjie(x / i, i);\n    }\n  }\n  return t;\n}\nint main() {\n  int j, p, n, a[101];\n  cin >> n;\n  for (j = 0; j <= n - 1; j++) {\n    cin >> a[j];\n  }\n  for (j = 0; j <= n - 1; j++) {\n    printf(\"%d\", fenjie(a[j], 2));\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint kind(int num, int min);\nint main() {\n  int n;\n  int i;\n  int num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    printf(\"%d\\n\", kind(num, 2));\n  }\n  return 0;\n}\nint kind(int num, int min) {\n  if (num < min) {\n    return 0;\n  }\n\n  int k = 1;\n  int i;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) {\n      k = k + kind(num / i, i);\n    }\n  }\n\n  return k;\n}\n"}
{"label": "1", "index": "1742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint geshu;\nvoid yinshu(int num, int a) {\n  int i;\n  if (num == 1)\n    geshu++;\n  else {\n    for (i = a; i <= num; i++) {\n\n      if (num % i == 0) {\n\n        yinshu(num / i, i);\n      }\n    }\n  }\n}\nint main() {\n  int shu, j, num1[10000];\n  cin >> shu;\n  for (j = 0; j < shu; j++) {\n    geshu = 0;\n    cin >> num1[j];\n\n    yinshu(num1[j], 2);\n    printf(\"%d\\n\", geshu);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "1", "index": "1743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint l = 0, x;\nint fff(int w, int t);\nint main() {\n  int i, j, q, p, n, m, y;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    q = 1;\n    l = 0;\n    scanf(\"%d\", &x);\n    for (i = 2; i <= x; i++)\n      if (x % i == 0) {\n        a[q] = i;\n        q++;\n      }\n    fff(q - 1, 1);\n    printf(\"%d\\n\", l);\n  }\n}\nint fff(int w, int t) {\n  int i, j, y, n, m, p;\n  for (i = t; i <= w; i++) {\n    if (x % a[i] == 0) {\n      x = x / a[i];\n      if (x == 1) {\n        l++;\n      }\n      if (x > 1)\n        fff(w, i);\n      x = x * a[i];\n    }\n  }\n}\n"}
{"label": "1", "index": "1744", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a, cnt = 0, num;\nint decompose(int x, int y) {\n  int i, xnum = 1;\n  if (x == 1)\n    return 0;\n  if (x == 2)\n    return 1;\n  for (i = y; i <= (int)sqrt(x); i++)\n    if (x % i == 0)\n      xnum += decompose(x / i, i);\n  return xnum;\n}\nint main() {\n  cin >> n;\n  while (cnt < n) {\n    cin >> a;\n    num = decompose(a, 2);\n    printf(\"%d\\n\", num);\n    cnt++;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1745", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint disintegerate(int a, int b) {\n  if (a == b || b == 1)\n    return 1;\n  if (a > b) {\n    return 0;\n  }\n  int ans = 0;\n  for (int i = a; i <= b; i++) {\n    if (b % i == 0)\n      ans = ans + disintegerate(i, b / i);\n  }\n  return ans;\n}\n\nint main() {\n  int Time;\n  cin >> Time;\n  while (Time > 0) {\n    int n;\n    scanf(\"%d \", &n);\n    printf(\"%d\\n\", disintegerate(2, n));\n    Time--;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1746", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint factor(int, int);\nint main() {\n  int n, i, a;\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> a;                     \n    cout << factor(a, 2) << endl; \n  }\n  return 0;\n}\n\nint factor(int a, int b) {\n  int c, i;\n  int num = 1; \n  if (a == 1)\n    return 0;\n  c = sqrt(a);\n  for (i = b; i <= c; i++) \n    if (a % i == 0)        \n      num += factor(a / i, i);\n  return num;\n}\n"}
{"label": "1", "index": "1747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int n, int i) {\n  for (i = 2; i <= n / 2; i++)\n    if (n % i == 0)\n      break;\n  return (i == n / 2 && n != 4) ? 1 : 0;\n}\nint f(int n, int k) {\n  if (check(n, 2) == 1 || k == n)\n    return 1;\n  else if (n < k)\n    return 0;\n  else {\n    int h = 0, i;\n    for (i = k; i <= sqrt(n); i++)\n      if (n % i == 0)\n        h += f(n / i, i);\n    return h + 1;\n  }\n}\n\nint main() {\n  int n, h, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h);\n    cout << f(h, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b) {\n  int c, s = 0, i;\n  c = (int)sqrt(a);\n  for (i = b; i <= c; i++) {\n    if (a % i == 0)\n      s = s + f(a / i, i);\n  }\n  return s + 1;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    printf(\"%d \", f(num[i], 2));\n  }\n}\n"}
{"label": "1", "index": "1749", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s;\nvoid search(int a, int k) {\n  if (a == 0)\n    return;\n  if (a == 1)\n    return;\n\n  for (int i = 2; i < a; i++) {\n    if (a % i == 0 && a / i >= i && i >= k && a / i >= k) {\n      s++;\n      search(a / i, i);\n    }\n  }\n  return;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    s = 1;\n    scanf(\"%d \", &a);\n    search(a, 1);\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int i, int t) {\n  if (i < t) {\n    return 0;\n  }\n  int b = 1;\n  int a;\n  for (a = t; a < i; a++) {\n    if (i % a == 0) {\n      b = b + f(i / a, a);\n    }\n  }\n  return b;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 0;\n  int d[100];\n  do {\n    scanf(\"%d\", &d[i]);\n    i++;\n  } while (i < n);\n  i = 0;\n  do {\n    cout << f(d[i], 2) << \"\\n\";\n    i++;\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "1", "index": "1751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid f(int n, int y) {\n  int a = sqrt(n);\n  for (int i = y; i <= a; i++) {\n    if (n % i == 0) {\n      sum++;\n      y = i;\n      f(n / i, y);\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int num;\n    cin >> num;\n    sum = 0;\n    f(num, 2);\n    cout << sum + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint count(int x, int y) {\n  if (x < y)\n    return 0;\n  if (x >= y) {\n    int sum = 0;\n    for (int j = y; j < x; j++) {\n      if (x % j == 0)\n        sum = sum + count(x / j, j);\n    }\n    return sum + 1;\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    printf(\"%d\\n\", count(a[i], 2));\n  return 0;\n}\n"}
{"label": "1", "index": "1753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ans(int a, int i) {\n  int sum = 0;\n  for (int j = i; j <= sqrt(a); j++) {\n    if (a % j != 0)\n      continue;\n    sum++;\n    if (a >= j * j)\n      sum += ans(a / j, j);\n  }\n  return sum;\n}\nint main() {\n  int n, a;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", ans(a, 2) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dividemin(int a, int minyinzi) {\n  int num = 0;\n  if (a == 1)\n    num++;\n  else\n    for (int i = minyinzi; i <= a; i++) {\n      if (a % i == 0)\n        num = num + dividemin(a / i, i);\n    }\n  return num;\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= n - 1; i++)\n    \n    cout << dividemin(a[i], 2) << endl;\n}\n"}
{"label": "1", "index": "1755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int a, int b);\nint main() {\n  int t;\n  int a;\n  cin >> t;\n  for (int i = 1; i <= t; i++) \n  {\n    cin >> a;                    \n    cout << (num(a, 2)) << endl; \n  }\n  return 0;\n}\nint num(int a, int b) {\n  int f = 0;\n  if (a >= b) \n  {\n    for (int i = b; i <= a; i++) \n    {\n      if (a == i)\n        f++;\n      else if (a % i == 0)\n        f = f + num(a / i, i); \n    }\n  }\n  return f;\n}\n"}
{"label": "1", "index": "1756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint divide(int a, int b) {\n  int i, r;\n  r = 1;\n  for (i = b; i < a; i++) {\n    if (((a / i) * i) == a && (a / i) >= i)\n      r = r + divide(a / i, i);\n  }\n  return r;\n}\nint main() {\n  int s, p, n, j;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &p);\n    s = divide(p, 2);\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "1", "index": "1757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a, int b) {\n  if (a > b)\n    return b;\n  else\n    return a;\n}\nint f(int n, int s) {\n  int k = 0, i;\n  if (n == 1)\n    return 1;\n  else if (s == 1)\n    return 0;\n  else if (s > n)\n    return f(n, n);\n  else {\n    for (i = 2; i <= s; i++)\n      if (n % i == 0)\n        k = k + f(n / i, min(i, s));\n    return k;\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    cin >> m;\n    printf(\"%d\\n\", f(m, m));\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nvoid check(int m, int n) {\n  for (; m <= n; m++) {\n    if (n % m == 0) {\n      if (n / m == 1) {\n        num++;\n        return;\n      } else\n        check(m, n / m);\n    }\n  }\n}\nint main() {\n  int n, m;\n  cin >> n;\n  for (; n; n--) {\n    cin >> m;\n    check(2, m);\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  int c, s = 0, i;\n  c = (int)sqrt(a);\n  for (i = b; i <= c; i++) {\n    if (a % i == 0)\n      s = s + f(a / i, i);\n  }\n  return s + 1;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cout << f(num[i], 2) << \" \";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1760", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid fj(int n, int m) {\n  int i;\n  for (i = m; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      sum++;\n      fj(n / i, i);\n    }\n  }\n}\nint main() {\n  int j, N;\n  int a[100];\n  cin >> N;\n  for (j = 1; j <= N; j++) {\n    cin >> a[j];\n  }\n  for (j = 1; j <= N; j++) {\n    sum = 0;\n    fj(a[j], 2);\n    printf(\"%d\\n\", sum + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int a, int s) {\n  int i;\n  if (a == 1)\n    sum++;\n  else {\n\n    for (i = s; i <= a; i++) {\n      if (a % i == 0)\n        f((a / i), i);\n    }\n  }\n  return;\n}\n\nint main() {\n  int n, num, j;\n  scanf(\"%d \", &n);\n  for (j = 1; j <= n; j++) {\n    cin >> num;\n    f(num, 2);\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1762", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0, used[32770] = {0};\nvoid f(int n) {\n  for (int i = 2; i <= n; i++) {\n    if (n % i == 0 && used[i] == 0) {\n      if (i != 2) {\n        for (int j = 2; j <= i - 1; j++)\n          used[j] = 1;\n      }\n      if (n / i == 1) {\n        sum++;\n        break;\n      } else {\n        f(n / i);\n      }\n      memset(used, 0, sizeof(used));\n    }\n  }\n}\nint main() {\n  int m, a[100];\n  scanf(\"%d \", &m);\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n    if (a[i] == 1)\n      cout << 1 << endl;\n    else {\n      f(a[i]);\n      cout << sum << endl;\n      sum = 0;\n      memset(used, 0, sizeof(used));\n    }\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1763", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min) {\n    return 0;\n  } else {\n    for (i = min; i <= a; i++) {\n      if (a % i == 0) {\n\n        result += f(a / i, i);\n      }\n    }\n    return result;\n  }\n}\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1764", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count_1;\nvoid solve(int num, int a, int m) {\n  int i;\n  if (num == 1) {\n    count_1++;\n    return;\n  }\n  for (i = 2; i <= num; i++) {\n    if (i >= a && (num % i) == 0)\n      solve(num / i, i, m + 1);\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    int num, a;\n    count_1 = 0;\n    cin >> num;\n    solve(num, 0, 1);\n    printf(\"%d \", count_1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint count(int num, int m)\n\n{\n  if (num % m != 0)\n    return 0;\n\n  if (num == m)\n    return 1;\n  else {\n    int counter = 0;\n    for (int i = m; i <= num / m; i++) {\n      counter += count(num / m, i);\n    }\n    return counter;\n  }\n}\n\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    int counter = 0;\n    cin >> num;\n    for (int i = 2; i <= num; i++)\n      counter += count(num, i);\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint factorize(int n, int j) {\n  int F = 1;\n  for (; j <= sqrt(n); j++)\n    if (n % j == 0) {\n      F += factorize(n / j, j);\n    }\n  return F;\n}\nint main() {\n  int i, m, n[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &n[i]);\n  for (i = 0; i < m; i++)\n    cout << factorize(n[i], 2) << \"\\n\";\n  return 0;\n}\n"}
{"label": "1", "index": "1767", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint totalCount; \n\nvoid FindFact(int x, int max) \n{\n  if (x == 1) \n  {\n    totalCount++;\n    return;\n  }\n  for (int i = max; i > 1; i--) \n    if (x % i == 0)             \n      FindFact(x / i, i);       \n  return;\n}\n\nint main() {\n  int n, x;\n  for (cin >> n; n > 0; n--) \n  {\n    totalCount = 0;\n    cin >> x;\n    FindFact(x, x / 2);             \n    cout << totalCount + 1 << endl; \n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid f(int a, int s) {\n  int i;\n  if (a == 1)\n    sum++;\n  else {\n\n    for (i = s; i <= a; i++) {\n      if (a % i == 0)\n        f((a / i), i);\n    }\n  }\n  return;\n}\n\nint main() {\n  int n, num, j;\n  scanf(\"%d \", &n);\n  for (j = 1; j <= n; j++) {\n    cin >> num;\n    f(num, 2);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ways(int n, int p) {\n  if (n < p)\n    return 0;\n  while (n % p != 0)\n    p++;\n  if (n == p)\n    return 1;\n  return ways(n / p, p) + ways(n, p + 1);\n}\nint main() {\n  int n, m;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> m;\n    cout << ways(m, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1770", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint t = 1;\nvoid fen(int n, int i) {\n  for (i = i; i * i <= n; i++) {\n    if (n % i == 0) {\n      fen(n / i, i);\n      t++;\n    }\n  }\n}\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int n;\n    cin >> n;\n    t = 1;\n    fen(n, 2);\n    cout << t << endl;\n  }\n}\n"}
{"label": "1", "index": "1771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b) {\n  if (a == b)\n    return 1;\n  if (b > a)\n    return 0;\n  if (a % b != 0)\n    return f(a, b + 1);\n  if (a % b == 0)\n    return f(a, b + 1) + f(a / b, b);\n}\nint main() {\n  int n = 0, i = 0, x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    y = 2;\n    cout << f(x, y) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int i, int t) {\n  if (i < t) {\n    return 0;\n  }\n  int b = 1;\n  int a;\n  for (a = t; a < i; a++) {\n    if (i % a == 0) {\n      b = b + f(i / a, a);\n    }\n  }\n  return b;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 0;\n  int d[100];\n  do {\n    scanf(\"%d\", &d[i]);\n    i++;\n  } while (i < n);\n  i = 0;\n  do {\n    printf(\"%d\\n\", f(d[i], 2));\n    i++;\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "1", "index": "1773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num = 0;\nint sum(int a, int i) {\n\n  if (a == 1) {\n    num++;\n  } else {\n    while (i <= a) {\n      if (a % i == 0) {\n        sum(a / i, i);\n      }\n      i++;\n    }\n  }\n  return num;\n}\nint main() {\n  int a, t, j, i, count;\n  scanf(\"%d \", &t);\n  for (j = 0; j < t; j++) {\n    count = 1;\n    cin >> a;\n    i = 2;\n    while (i <= (a / 2)) {\n      if (a % i == 0) {\n        num = 0;\n        sum(a / i, i);\n        count = count + num;\n      }\n      i++;\n    }\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c;\nvoid cal(int n, int k);\nint main(int argc) {\n  int m, n, j;\n  cin >> m;\n  for (j = 1; j <= m; j++) {\n    cin >> n;\n    c = 0;\n    cal(n, 1);\n    cout << c << endl;\n  }\n\n  return 0;\n}\nvoid cal(int n, int k) {\n  if (n == 1) {\n    c++;\n    return;\n  }\n  int i;\n  for (i = 2; i <= n; i++) {\n    if (n % i == 0 && i >= k) {\n      cal(n / i, i);\n    }\n  }\n}\n"}
{"label": "1", "index": "1775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int f(int x, int y);\n  int n, m, i, z;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m);\n    z = f(1, m);\n    printf(\"%d\\n\", z);\n  }\n\n  return 0;\n}\n\nint f(int x, int y) {\n  int z, t = 1, l = 0, p;\n  p = (int)pow(y, 0.5);\n  if (x == 1)\n    x = 2;\n  for (z = x; z <= p; z++) {\n    if (y % z == 0 && z != y) {\n      t += f(z, y / z);\n    }\n  }\n\n  return t;\n}\n"}
{"label": "1", "index": "1776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int x, int y) {\n  int s = 0, i;\n  for (i = y; i > 1; i--) {\n    if (x % i == 0)\n      s += f(x / i, i);\n  }\n  if (x == 1)\n    return 1;\n  return s;\n}\nint main() {\n  int n, i, a[50];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", f(a[i], a[i]));\n  return 0;\n}\n"}
{"label": "1", "index": "1777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint counts = 1;\nint ty(int, int);\nint main() {\n  int i, m, n, c;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> n;\n    counts = 1;\n    c = ty(n, 2);\n    cout << c << endl;\n  }\n  return 0;\n}\n\nint ty(int n, int j) {\n  int i, flag = 0;\n  if (n == 1) {\n    return 0;\n  }\n  if (n == 2) {\n    return 1;\n  }\n  for (i = j; i <= (int)sqrt(n); i++) {\n    if (n % i == 0) {\n      counts++;\n      ty(n / i, i);\n    }\n  }\n  return counts;\n}\n"}
{"label": "1", "index": "1778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Digui(int a, int min) {\n  int i, result = 1;\n  if (a < min) {\n    return 0;\n  }\n  for (i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += Digui(a / i, i);\n    }\n  }\n  return (result);\n}\nint main() {\n  int a[1000], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", Digui(a[i], 2));\n\n  return 0;\n}\n"}
{"label": "1", "index": "1779", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint tmp = 2;\nint suml(int n, int tmp) {\n  int sum = 0;\n  if (n == 1) {\n    return 1;\n  }\n  for (int i = tmp; i <= n; i++) {\n    if (n % i == 0)\n      sum += suml(n / i, i);\n  }\n  return sum;\n}\nint main() {\n  int m;\n  cin >> m;\n  int n;\n  for (int i = 0; i < m; i++) {\n    cin >> n;\n    int zon_shu = 0;\n    zon_shu = suml(n, tmp);\n    cout << zon_shu << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1780", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int s, int num) {\n  if (s == num)\n    return 1;\n  if (s < num)\n    for (int i = s; i <= num; i++) {\n      if (num % i == 0) {\n        if (i < num)\n          return f(i, num / i) + f(i + 1, num);\n        if (i == num)\n          return 1;\n      }\n    }\n  if (s > num)\n    return 0;\n}\nint main() {\n  int n, i, num;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    printf(\"%d\\n\", f(2, num));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a, int b) {\n  int num = 1, i;\n  for (i = b; i <= sqrt(a); i++) {\n    if (a % i == 0)\n      num += f(a / i, i);\n  }\n  return num;\n}\nint main() {\n  int i, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", f(a, 2));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1782", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dfs(int k, int b) {\n  int ret = (k == 1), i;\n  for (i = b; i <= k; i++)\n    if (k % i == 0)\n      ret += dfs(k / i, i);\n  return ret;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n\n    cin >> k;\n    cout << dfs(k, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint factor(int, int);\nint main() {\n  int n, i, a;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    printf(\"%d\\n\", factor(a, 2));\n  }\n  return 0;\n}\n\nint factor(int a, int b) {\n  int c, i;\n  int num = 1;\n  if (a == 1)\n    return 0;\n  c = sqrt(a);\n  for (i = b; i <= c; i++)\n    if (a % i == 0)\n      num += factor(a / i, i);\n  return num;\n}\n"}
{"label": "1", "index": "1784", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g(int x, int j) {\n  for (j++; j <= x; j++) {\n    if (x == j)\n      return 1;\n    if (x % j == 0 && x / j >= j)\n      return g(x / j, j - 1) + g(x, j);\n  }\n  return 0;\n}\n\nint main() {\n  int n, a;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &a);\n    cout << g(a, 1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int min) {\n  if (a < min) {\n    return 0;\n  }\n  int result = 1;\n  for (int i = min; i < a; i++) {\n    if (a % i == 0) {\n      result += f(a / i, i);\n    }\n  }\n  return result;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  int a;\n  int b;\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    int min = 2;\n    b = f(a, 2);\n    printf(\"%d\", b);\n    printf(\" \");\n  }\n}\n"}
{"label": "1", "index": "1786", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n, num;\n\nvoid dfs(int i, int j) {\n  int x;\n\n  if (i == 1) {\n    num++;\n    return;\n  }\n  for (x = j; x <= i; x++)\n    if (i % x == 0)\n      dfs(i / x, x);\n}\n\nint main() {\n  cin >> m;\n  while (m > 0) {\n    num = 0;\n    cin >> n;\n    dfs(n, 2);\n    cout << num << endl;\n    m--;\n  }\n}\n"}
{"label": "1", "index": "1787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p(int x) {\n  int i;\n  for (i = 2; i <= sqrt(x); i++)\n    if (x % i == 0)\n      return (0);\n  return (1);\n}\nint f(int n, int m) {\n  int t, i;\n  if (n < m)\n    return (0);\n  else if (p(n) == 1) {\n    return (1);\n  } else if (m == 1) {\n    t = 1;\n    for (i = m + 1; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  } else if (m != 1) {\n    t = 1;\n    for (i = m; i < n; i++) {\n      if (n % i == 0)\n        t = t + f(n / i, i);\n    }\n  }\n  return (t);\n}\nint main() {\n  int x, y, j;\n  scanf(\"%d\", &y);\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &x);\n    printf(\"%d \", f(x, 1));\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sushu(int a) {\n  int b = 2, c, d = 0, k;\n  while (b < a) {\n    c = a % b;\n    if (c != 0) {\n      b = b + 1;\n      d = d + 1;\n    } else\n      break;\n  }\n\n  if (d == (a - 2))\n    k = 1;\n  else\n    k = 0;\n  return k;\n}\nint zheng(int n, int i) {\n  int sum = 1, a;\n  for (a = i; a < n / 2; a++) {\n    if (n % a == 0) {\n      if (a <= n / a) {\n        sum = sum + zheng(n / a, a);\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j = 0, k = 0, b[10000] = {0}, e[40000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &e[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (sushu(e[i]) == 0) {\n      b[i] = zheng(e[i], 2);\n    } else {\n      b[i] = 1;\n    }\n  }\n\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    printf(\"\\n%d\", b[i]);\n  return 0;\n}\n"}
{"label": "1", "index": "1789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint kind(int num, int min);\nint main() {\n  int n;\n  int i;\n  int num;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    cout << kind(num, 2) << \"\\n\";\n  }\n  return 0;\n}\nint kind(int num, int min) {\n  if (num < min)\n    return 0;\n\n  int k = 1;\n  int i;\n  for (i = min; i <= num; i++) {\n    if (num % i == 0) {\n      k = k + kind(num / i, i);\n    }\n  }\n\n  return k;\n}\n"}
{"label": "1", "index": "1790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sushu(int b) {\n  int flag = 1, i;\n  if (b == 2)\n    return 1;\n  if (b % 2 == 0)\n    return 0;\n  for (i = 2; i <= b / 2; i++) {\n    if (b % i == 0) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0)\n    return 0;\n  else\n    return 1;\n}\nint number(int a, int b) {\n  int i, total = 1;\n  if (sushu(a)) {\n    total = 1;\n    return total;\n  }\n  for (i = b; i <= a; i++) {\n\n    if (a % i == 0 && a / i >= i) {\n      total = total + number(a / i, i);\n    }\n  }\n  return total;\n}\nint main() {\n  int n, i, A[100], B[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n    B[i] = number(A[i], 2);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", B[i]);\n  }\n}\n"}
{"label": "1", "index": "1791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[40000] = {0};\nvoid fun(int n, int j, int k) {\n  int i;\n  for (i = j; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      j = i;\n      a[k]++;\n      fun(n / i, j, k);\n    }\n  }\n}\n\nint main() {\n  int n;\n  int m[40000] = {0};\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    fun(m[i], 2, i);\n  }\n  for (i = 1; i <= n; i++) {\n    cout << a[i] + 1 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int min) {\n  int result = 1, i;\n  if (a < min)\n    return 0;\n  else {\n    for (i = min; i <= a; i++) {\n      if (a % i == 0) {\n\n        result += f(a / i, i);\n      }\n    }\n    return result;\n  }\n}\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    cout << f(a, 2) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1793", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dfs(int k, int b) {\n  int ret = (k == 1), i;\n  for (i = b; i <= k; i++)\n    if (k % i == 0)\n      ret += dfs(k / i, i);\n  return ret;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n\n    cin >> k;\n    cout << dfs(k, 2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i = 0;\nint f(int n, int m) {\n  int k = 0;\n  if (m == 1)\n    i++;\n  else {\n    for (k = n; k <= m; k++) {\n      if (m % k == 0) {\n        n = k;\n        f(n, m / n);\n      }\n    }\n  }\n  return (i);\n}\nint main() {\n  int n, b, c;\n  cin >> n;\n  int a;\n  for (b = 0; b < n; b++) {\n    cin >> a;\n    c = f(2, a);\n    cout << c << endl;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1795", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint count(int a, int n) {\n  if (a > n)\n    return 0;\n  if (a == n)\n    return 1;\n  int p = 1;\n  int i;\n  for (i = a; i <= n; i++) {\n    if (n % i == 0 && i <= n / i) {\n      p = p + count(i, n / i);\n    }\n  }\n  return p;\n}\nint geshu(int N) {\n  int i;\n  int s = 1;\n  for (i = 2; i <= sqrt(N); i++) {\n    if (N % i == 0) {\n      s = s + count(i, N / i);\n    }\n  }\n\n  return s;\n}\nint main() {\n  int N;\n  cin >> N;\n  int c[N];\n  int j;\n  for (j = 0; j < N; j++) {\n    cin >> c[j];\n  }\n  for (j = 0; j < N; j++)\n    cout << geshu(c[j]) << endl;\n\n  return 0;\n}\n"}
{"label": "1", "index": "1796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[40000] = {0};\nvoid fun(int n, int j, int k) {\n  int i;\n  for (i = j; i <= sqrt(n); i++) {\n    if (n % i == 0) {\n      j = i;\n      a[k]++;\n      fun(n / i, j, k);\n    }\n  }\n}\n\nint main() {\n  int n;\n  int m[40000] = {0};\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    fun(m[i], 2, i);\n  }\n\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", a[i] + 1);\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint s = 0;\n\nvoid find(int min, int dev) {\n  int i;\n  for (i = min; i <= sqrt((float)dev); i++)\n    if (dev % i == 0) {\n      s++;\n      find(i, dev / i);\n    }\n}\n\nint main() {\n  int n, i, m, j;\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d\", &n);\n    for (i = 2; i <= sqrt((float)n); i++)\n      if (n % i == 0) {\n        s++;\n        find(i, n / i);\n      }\n    printf(\"%d\\n\", s + 1);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "1", "index": "1798", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint fenjie(int out[16], int a, int n, int m, int sheng, int b[2])\n\n{\n  int i;\n  for (i = m; i <= a / 2; i++) {\n    if (sheng % i == 0) {\n      out[n] = i;\n      int qiu = 1, k;\n      for (k = 0; k <= n; k++)\n        qiu = out[k] * qiu;\n\n      if (qiu == a) {\n        b[0]++;\n        break;\n      }\n      if (qiu > a)\n        break;\n      else\n        fenjie(out, a, n + 1, i, sheng / i, b);\n    }\n  }\n  return 0;\n}\nint main() {\n  int hang = 0;\n  cin >> hang;\n  while (hang > 0) {\n    int a;\n    int b[2] = {0};\n    cin >> a;\n    int out[16] = {0};\n    fenjie(out, a, 0, 2, a, b);\n    printf(\"%d\\n\", b[0] + 1);\n    hang--;\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1799", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int m, int n) {\n\n  if (m > sqrt(n))\n    return 0;\n\n  if (n % m == 0)\n    return fun(m + 1, n) + fun(m, n / m) + 1;\n  else\n    return fun(m + 1, n);\n}\n\nint main() {\n  int i, x, y;\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d \", &y);\n    printf(\"%d\\n\", fun(2, y) + 1);\n  }\n  return 0;\n}\n"}
{"label": "1", "index": "1800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nvoid divide(int n, int n2) {\n  int i, m1;\n  m1 = (int)sqrt((double)n);\n  for (i = n2; i <= m1; i++) {\n    if (n % i == 0) {\n      num++;\n      divide(n / i, i);\n    }\n  }\n}\nint main() {\n  int n, i, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 1;\n    scanf(\"%d \", &m);\n\n    divide(m, 2);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, num[1000], m, a[1000][26], k, sum[26], max = 0, b;\n  char writer[1000][26],\n      letter[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &m);\n  for (k = 0; k < 26; k++) {\n    sum[k] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      a[i][j] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &num[i], writer[i]);\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (writer[i][j] == letter[k]) {\n          a[i][k]++;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      sum[k] = sum[k] + a[i][k];\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (max < sum[k]) {\n      max = sum[k];\n      b = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[b], max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (writer[i][j] == letter[b]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, t, m, a[26] = {0}, book[999], max;\n  char writer[999][26], maxwriter;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i], writer[i]);\n    m = strlen(writer[i]);\n    for (j = 0; j < m; j++) {\n      t = writer[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  max = 0;\n  maxwriter = 'A';\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxwriter = 'A' + i;\n    }\n  }\n  cout << maxwriter << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == maxwriter) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1803", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int i;\n  struct book *head;\n  struct book *p1, *p2;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n\n  for (i = 0; i < n - 1; i++) {\n\n    if (i == 0)\n      head = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, n, a[26] = {0}, max = 0, j, k = 0;\n  char t;\n  struct book *p, *p1;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  p1 = p;\n  for (j = 0; j < n; j++) {\n    for (i = 0; *(p->name + i) != '\\0'; i++)\n      a[*(p->name + i) - 65] = a[*(p->name + i) - 65] + 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (k + 65), max);\n  t = (char)(k + 65);\n\n  while (p1 != NULL) {\n    for (i = 0; *(p1->name + i) != '\\0'; i++) {\n      if (*(p1->name + i) == t) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, m, i, max = 0, n, count[26] = {0};\n  char b;\n  struct book {\n    int id;\n    char author[26];\n  } book[1024];\n  char *p = &book[0].author[0];\n  char *q;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n  }\n  for (i = 0; i < m; i++)\n\n    for (p = book[i].author; *p != '\\0'; p++) {\n      a = *p;\n      count[a - 65]++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      b = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n  for (i = 0; i < m; i++) {\n    for (q = book[i].author; *q != '\\0'; q++) {\n      if (*q == b)\n        printf(\"%d\\n\", book[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1805", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n} book[1000];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, a[27], len, max = 0, number;\n  char p;\n  for (i = 1; i <= 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].name);\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      p = book[i].name[j];\n      a[p - 64] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", number + 64, a[number]);\n  for (i = 1; i <= m; i++) {\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      if (book[i].name[j] == number + 64) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int mun;\n  char name[26];\n} a[999];\nint main() {\n  int n, i, j, l, q = 0;\n  char k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].mun, a[i].name);\n  }\n  int w[26] = {0};\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      k = a[i].name[j];\n      w[k - 65]++;\n    }\n  }\n  int max;\n  max = w[0];\n  int flag = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      flag = i;\n    }\n  }\n  printf(\"%c\\n\", flag + 65);\n  printf(\"%d\\n\", w[flag]);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      if (a[i].name[j] == (flag + 65)) {\n        printf(\"%d\\n\", a[i].mun);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1807", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n};\nint m;\n\nint main() {\n\n  int i;\n  scanf(\"%d\", &m);\n  book *p;\n  p = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &p[i].num, p[i].writer);\n\n  int j = 0, u = 0;\n  int *a;\n  a = (int *)malloc(sizeof(int) * 150);\n  for (i = 'A'; i <= 'z'; i++)\n    a[i] = 0;\n\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      for (u = 0; u < strlen(p[j].writer); u++) {\n        if (i == p[j].writer[u]) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  int max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max < a[i])\n      max = a[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max == a[i])\n      break;\n  }\n  printf(\"%c\\n%d\\n\", i, a[i]);\n  for (j = 0; j < m; j++) {\n    for (u = 0; u < strlen(p[j].writer); u++) {\n      if (i == p[j].writer[u]) {\n        printf(\"%d\\n\", p[j].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char name[26];\n  int num[26];\n};\nvoid mostbook(struct book *p) {\n  int i, j, k;\n  k = strlen(p->name);\n  for (j = 0; j < 26; j++) {\n    p->num[j] = 0;\n  }\n  for (i = 0; i < k; i++)\n    (p->num[(p->name[i] - 'A')])++;\n}\n\nint main() {\n  int i, j, m;\n  int max = 0;\n  int maxi = 0;\n  int s[26] = {0};\n  scanf(\"%d\", &m);\n  struct book *p;\n  p = (struct book *)malloc(m * sizeof(struct book));\n  for (i = 0; i < m; i++) {\n\n    scanf(\"%d\", &(p + i)->number);\n    scanf(\"%s\", &(p + i)->name);\n    mostbook(p + i);\n    for (j = 0; j < 26; j++)\n      s[j] += ((p + i)->num[j]);\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] >= max) {\n      max = s[i];\n      maxi = i;\n    }\n  }\n  printf(\"%d\\n\", (maxi + 'A'));\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    int k, j;\n    k = strlen((p + i)->name);\n    for (j = 0; j < k; j++) {\n      if ((p + i)->name[j] == (maxi + 'A')) {\n        printf(\"%d\\n\", (p + i)->number);\n        continue;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char w[999][26];\n  char m;\n  int a[999], c[26];\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 25; i++) {\n    c[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    scanf(\"%s\", w[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      c[w[i][j] - 65] += 1;\n    }\n  }\n  max = c[0];\n  m = 65;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      m = i + 65;\n    }\n  }\n  cout << m << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      if (w[i][j] == m) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char auth[26];\n    int inf[26];\n    struct book *next;\n  };\n  struct book *head, *p1, *p2, *t1, *t2;\n  head = (struct book *)malloc(sizeof(struct book));\n  int m, i, k, l, j, max;\n  int authnum[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = head;\n  p2 = p1;\n  for (i = 0; i < (m - 1); i++) {\n    scanf(\"%d %s\", &(p1->num), p1->auth);\n    p2 = (struct book *)malloc(sizeof(struct book));\n    p1->next = p2;\n    p1 = p2;\n  }\n  cin >> (p1->num) >> p1->auth;\n  p2 = NULL;\n  p1->next = p2;\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    l = strlen(p1->auth);\n    for (j = 0; j < l; j++) {\n      p1->inf[(*((p1->auth) + j)) - 65] = 1;\n      authnum[(*((p1->auth) + j)) - 65]++;\n    }\n    p2 = p1->next;\n    p1 = p2;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (authnum[i] > authnum[max])\n      max = i;\n  }\n  printf(\"%c\\n\", (max + 65));\n  printf(\"%d\\n\", authnum[max]);\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    if ((p1->inf[max]) > 0)\n      printf(\"%d\\n\", p1->num);\n    p2 = p1->next;\n    p1 = p2;\n  }\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    p2 = p1->next;\n    free(p1);\n    p1 = p2;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, sum[27] = {0}, max = 0, author;\n  cin >> m;\n  char str[1000][4], name[1000][27];\n  for (int i = 0; i < m; i++)\n    cin >> str[i] >> name[i];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++)\n      sum[name[i][j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      author = i;\n    }\n  }\n  cout << (char)('A' + author) << endl;\n  cout << max << endl;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] - 'A' == author)\n        printf(\"%s\\n\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1812", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n  } * s;\n  int n, i, j, a[100], t;\n  char c;\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &(*(s + i)).num, (*(s + i)).wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      for (c = 'A'; c <= 'Z'; c++)\n        if (s[i].wri[j] == c) {\n          a[s[i].wri[j]]++;\n        }\n    }\n  for (i = 0; i < 100; i++)\n    if (a[0] < a[i]) {\n      a[0] = a[i];\n      t = i;\n    }\n  printf(\"%c\\n\", t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      if (s[i].wri[j] == t)\n        printf(\"%d\\n\", s[i].num);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "1813", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint c[26];\nchar b[1000][100];\nchar out;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, tmp = 0, tmp1 = 0, tmp2;\n  int a[1000];\n  out = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n\n    if (c[i] > tmp) {\n      tmp = c[i];\n      tmp1 = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", out + tmp1, tmp);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j] != '\\0'; j++) {\n      tmp2 = b[i][j];\n\n      if (tmp2 == (out + tmp1)) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1814", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int num;\n  char name[27];\n} book[999];\nstruct {\n  int cishu;\n} ren[26];\nint main() {\n  int n, zimu, a, b, i, j;\n  int sz[26];\n  char m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].name[j] != '\\0'; j++) {\n      zimu = book[i].name[j] - 65;\n      ren[zimu].cishu++;\n    }\n  }\n  a = 0;\n  b = ren[0].cishu;\n  for (i = 1; i < 26; i++) {\n    if (ren[i].cishu > b) {\n      a = i;\n      b = ren[i].cishu;\n    }\n  }\n  m = a + 65;\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", b);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].name[j] == m) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  char a[1000][10] = {0};\n  char b[1000][30];\n  int len[1000] = {0};\n  int c[150] = {0};\n  int max = 0;\n  int i, j, k, p, q, r, s;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    len[i] = strlen(b[i]);\n\n    for (j = 0; j < len[i]; j++) {\n\n      for (k = 65; k <= 90; k++) {\n        if (b[i][j] == k)\n          c[k]++;\n      }\n    }\n  }\n  for (p = 65; p <= 90; p++) {\n    if (c[p] > max)\n      max = c[p];\n  }\n  for (q = 65; q <= 90; q++) {\n    if (c[q] == max) {\n      printf(\"%c\\n%d\\n\", q, max);\n      for (r = 0; r < m; r++) {\n        for (s = 0; s < len[r]; s++) {\n          if (b[r][s] == q)\n            cout << a[r] << \"\\n\";\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, d, i, j, l;\n  struct a {\n    char name[27];\n    int c;\n  } m[1000];\n  struct b {\n    int num, book[1000];\n    char t;\n  };\n  struct b author[27];\n  for (i = 1; i <= 26; i++) {\n    author[i].t = i + 64;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i].c);\n    scanf(\"%s\", m[i].name);\n  }\n  for (i = 1; i <= n; i++) {\n    l = strlen(m[i].name);\n    for (j = 0; j <= l - 1; j++) {\n      d = m[i].name[j] - 64;\n      author[d].num++;\n      author[d].book[author[d].num] = m[i].c;\n    }\n  }\n  for (i = 1; i <= 25; i++) {\n    if (author[i].num > author[i + 1].num)\n      author[i + 1] = author[i];\n  }\n  printf(\"%c\\n\", author[26].t);\n  printf(\"%d\\n\", author[26].num);\n  for (i = 1; i <= author[26].num; i++) {\n    printf(\"%d\\n\", author[26].book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char author[26];\n};\n\nchar maxbook(int a[]) {\n  int i, j, bookmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (bookmax < a[i]) {\n      bookmax = a[i];\n      j = i;\n    }\n  }\n  cout << 'A' + j << \"\\n\" << bookmax << \"\\n\";\n  return 'A' + j;\n}\n\nint contain(char author[], char max) {\n  char *c = author;\n  while (*c) {\n    if (*c == max)\n      return 1;\n    c++;\n  }\n  return 0;\n}\n\nint main() {\n  struct BOOK book[1000];\n  int m, i, j;\n  char c, max;\n  int AtoZ[26] = {0};\n\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    getchar();\n    j = 0;\n    while ((c = getchar()) != '\\n') {\n      book[i].author[j] = c;\n      AtoZ[c - 'A']++;\n      j++;\n    }\n    book[i].author[j] = '\\0';\n  }\n  max = maxbook(AtoZ);\n\n  for (i = 0; i < m; i++) {\n    if (contain(book[i].author, max))\n      printf(\"%d\\n\", book[i].num);\n  }\n}\n"}
{"label": "2", "index": "1818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[999], count[27] = {0}, len[999];\n  int m, i, j, max = 0, per;\n  cin >> m;\n  char ch[999][26], person;\n  for (i = 1; i <= m; i++) {\n    cin >> num[i] >> ch[i];\n    len[i] = strlen(ch[i]);\n    for (j = 0; j <= len[i] - 1; j++)\n      count[ch[i][j] - 64]++;\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      per = i;\n    }\n  }\n  person = per + 64;\n  printf(\"%c\\n\", person);\n  cout << count[per] << endl;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (ch[i][j] == person) {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct tushu {\n    int bianhao;\n    char zuozhe[26];\n  };\n  int i, j, n, q = 0;\n  int count[26] = {0};\n  scanf(\"%d\", &n);\n  struct tushu *pp;\n  pp = (struct tushu *)malloc(sizeof(tushu) * n);\n  int *m;\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &((pp + i)->bianhao), (pp + i)->zuozhe);\n  }\n  for (i = 0; i < n; i++) {\n    m[i] = strlen(pp[i].zuozhe);\n    for (j = 0; j < m[i]; j++) {\n      count[pp[i].zuozhe[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      q = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + q, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (pp[i].zuozhe[j] == ('A' + q))\n        printf(\"%d\\n\", pp[i].bianhao);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[26];\n  int length;\n} zz[999];\nint main() {\n  int n, i, j, k;\n  int letter[26] = {0};\n  int letter_book[26][999] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].id;\n    cin >> zz[i].writer;\n    zz[i].length = strlen(zz[i].writer);\n  }\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < zz[j].length; k++) {\n\n      letter_book[zz[j].writer[k] - 'A'][letter[zz[j].writer[k] - 'A']] =\n          zz[j].id;\n      letter[zz[j].writer[k] - 'A']++;\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      t = i;\n    }\n  }\n  char m;\n  m = 'A' + t;\n  cout << m << endl;\n  cout << max << endl;\n  for (i = 0; i < max; i++)\n    cout << letter_book[t][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j = 0, zhe[26], t = 0, x, name;\n  for (i = 0; i < 26; i++) {\n    zhe[i] = 0;\n  }\n  char s[26];\n  scanf(\"%d\", &m);\n  struct {\n    int num;\n    char s[26];\n  } shu[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; shu[i].s[j] != 0; j++) {\n      switch (shu[i].s[j]) {\n      case 'A':\n        zhe[0]++;\n        break;\n      case 'B':\n        zhe[1]++;\n        break;\n      case 'C':\n        zhe[2]++;\n        break;\n      case 'D':\n        zhe[3]++;\n        break;\n      case 'E':\n        zhe[4]++;\n        break;\n      case 'F':\n        zhe[5]++;\n        break;\n      case 'G':\n        zhe[6]++;\n        break;\n      case 'H':\n        zhe[7]++;\n        break;\n      case 'I':\n        zhe[8]++;\n        break;\n      case 'J':\n        zhe[9]++;\n        break;\n      case 'K':\n        zhe[10]++;\n        break;\n      case 'L':\n        zhe[11]++;\n        break;\n      case 'M':\n        zhe[12]++;\n        break;\n      case 'N':\n        zhe[13]++;\n        break;\n      case 'O':\n        zhe[14]++;\n        break;\n      case 'P':\n        zhe[15]++;\n        break;\n      case 'Q':\n        zhe[16]++;\n        break;\n      case 'R':\n        zhe[17]++;\n        break;\n      case 'S':\n        zhe[18]++;\n        break;\n      case 'T':\n        zhe[19]++;\n        break;\n      case 'U':\n        zhe[20]++;\n        break;\n      case 'V':\n        zhe[21]++;\n        break;\n      case 'W':\n        zhe[22]++;\n        break;\n      case 'X':\n        zhe[23]++;\n        break;\n      case 'Y':\n        zhe[24]++;\n        break;\n      case 'Z':\n        zhe[25]++;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (zhe[j] > t) {\n      t = zhe[j];\n      x = j;\n    }\n  }\n  name = 'A' + x;\n  printf(\"%c\\n\", name);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].s[j] == name)\n        printf(\"%d\\n\", shu[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct x {\n    char num[26];\n    int y;\n  } q[1000], x0;\n  int n, i, j, c[100] = {0}, m = 0, f;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &q[i].y, &q[i].num);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      m = (int)q[i].num[j], c[m] = c[m] + 1;\n  for (m = 0; m < 100; m++)\n    if (c[m] > c[0])\n      f = m, c[0] = c[m];\n  printf(\"%c\\n%d\\n\", (char)f, c[f]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      if (q[i].num[j] == (char)f)\n        printf(\"%d\\n\", q[i].y);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[30] = {0}, b[30][1000];\nstruct stu {\n  int num;\n  char name[30];\n\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  struct stu *p1, *p2, *head;\n  int i = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = 0;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < n - 1) {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = 0;\n  return head;\n}\nint check(struct stu *head, int n) {\n  int i, j, s, d = 0, f = 0;\n  char *t;\n  struct stu *p;\n  p = head;\n  for (i = 0; i < n; i++, p = p->next) {\n    s = strlen(p->name);\n    t = p->name;\n    for (j = 0; j < s; j++) {\n      d = t[j] - 64;\n      a[d]++;\n      b[d][a[d] - 1] = p->num;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    for (j = 1, f = 0; j <= 26; j++) {\n      if (a[i] < a[j]) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 0)\n      break;\n  }\n  return i;\n}\nint main() {\n  struct stu *head;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  i = check(head, n);\n  cout << i + 64 << \"\\n\" << a[i] << \"\\n\";\n  for (j = 0; j < a[i]; j++)\n    printf(\"%d\\n\", b[i][j]);\n}\n"}
{"label": "2", "index": "1824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct {\n    int a;\n    char b[26];\n  } num[999];\n  int i, m, j, k;\n  int s[26];\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &num[i].a, num[i].b);\n\n  for (k = 0; k < 26; k++) {\n    s[k] = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      k = num[i].b[j] - 'A';\n      s[k]++;\n    }\n  }\n  int first = s[0];\n  int t;\n  for (k = 0; k < 26; k++) {\n    if (s[k] > first) {\n      first = s[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", t + 'A');\n  printf(\"%d\\n\", first);\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      if (num[i].b[j] == (t + 'A')) {\n        printf(\"%d\\n\", num[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int location[1001];\n  int num;\n  int sum;\n} ans[27];\nint main() {\n  int n, value = -1, order, m;\n  char s[28];\n  cin >> n;\n  for (int i = 1; i <= 26; i++)\n    ans[i].num = ans[i].sum = 0;\n\n  for (int i = 1; i <= n; i++) {\n    cin >> m;\n    cin >> s;\n    for (int j = 0; j < strlen(s); j++) {\n      ans[s[j] - 'A' + 1].num++;\n      ans[s[j] - 'A' + 1].sum++;\n      ans[s[j] - 'A' + 1].location[ans[s[j] - 'A' + 1].num] = m;\n    }\n  }\n  for (int i = 1; i <= 26; i++)\n    if (ans[i].sum > value) {\n      value = ans[i].sum;\n      order = i;\n    }\n  printf(\"%c\\n\", (char)(order + 'A' - 1));\n  printf(\"%d\\n\", ans[order].num);\n  for (int i = 1; i <= ans[order].num; i++)\n    cout << ans[order].location[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1826", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int max, max2;\n  int a[26];\n  struct book {\n    int number;\n    char author[26];\n  } stu1[1000];\n  struct author {\n    int number[1000];\n    int ben;\n  } stu2[26];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu1[i].number >> stu1[i].author;\n  }\n  for (i = 0; i <= 25; i++) {\n    stu2[i].ben = 0;\n    a[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(stu1[i].author) - 1; j++) {\n      k = stu1[i].author[j];\n      stu2[k - 65].ben++;\n      stu2[k - 65].number[a[k - 65]] = stu1[i].number;\n      a[k - 65]++;\n    }\n  }\n  max = stu2[0].ben;\n  max2 = 0;\n  for (i = 1; i <= 25; i++) {\n    if (stu2[i].ben > max) {\n      max = stu2[i].ben;\n      max2 = i;\n    }\n  }\n  printf(\"%c\\n\", max2 + 65);\n  printf(\"%d\\n\", max);\n  for (j = 0; j <= a[max2] - 1; j++)\n    printf(\"%d\\n\", stu2[max2].number[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "1827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int location[1001];\n  int num;\n  int sum;\n} ans[27];\nint main() {\n  int n, value = -1, order, m;\n  char s[28];\n  cin >> n;\n  for (int i = 1; i <= 26; i++)\n    ans[i].num = ans[i].sum = 0;\n\n  for (int i = 1; i <= n; i++) {\n    cin >> m;\n    cin >> s;\n    for (int j = 0; j < strlen(s); j++) {\n      ans[s[j] - 'A' + 1].num++;\n      ans[s[j] - 'A' + 1].sum++;\n      ans[s[j] - 'A' + 1].location[ans[s[j] - 'A' + 1].num] = m;\n    }\n  }\n  for (int i = 1; i <= 26; i++)\n    if (ans[i].sum > value) {\n      value = ans[i].sum;\n      order = i;\n    }\n  cout << (char)(order + 'A' - 1) << endl;\n  cout << ans[order].num << endl;\n  for (int i = 1; i <= ans[order].num; i++)\n    cout << ans[order].location[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0;\n  int zuozhe[26] = {0};\n  char maxer;\n  struct book {\n    int num;\n    char author[26];\n  } shu[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n    for (j = 0; j < 26; j++)\n      zuozhe[shu[i].author[j] - 65]++;\n  }\n  for (j = 0; j < 26; j++)\n    if (zuozhe[j] > max) {\n      max = zuozhe[j];\n      maxer = j + 65;\n    }\n  cout << maxer << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (shu[i].author[j] == maxer) {\n        cout << shu[i].num << \"\\n\";\n        continue;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "1829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Au {\n  int num;\n  int a[1000];\n} au[26];\nint main() {\n  int i, n, buch, tn;\n  char s[30];\n  for (i = 0; i < 26; i++)\n    au[i].num = 0;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d%s\", &buch, s);\n    for (i = 0; s[i]; i++) {\n      tn = au[s[i] - 'A'].num;\n      au[s[i] - 'A'].a[tn] = buch;\n      au[s[i] - 'A'].num++;\n    }\n  }\n  int temp = 0;\n  for (i = 1; i < 26; i++)\n    if (au[i].num > au[temp].num)\n      temp = i;\n  printf(\"%c\\n%d\\n\", 'A' + temp, au[temp].num);\n  for (i = 0; i < au[temp].num; i++)\n    printf(\"%d\\n\", au[temp].a[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "1830", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char name[26];\n  int number;\n} a[1000];\nint main() {\n  int n, i, j, b[26] = {0}, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].number >> a[i].name;\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      b[a[i].name[j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (max < b[i])\n      max = b[i];\n  for (i = 0; i < 26; i++)\n    if (max == b[i]) {\n      t = i;\n      break;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, b[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      if (a[i].name[j] == t + 65) {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "1831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char zz[26];\n} b[999];\nint main() {\n  int m, n, i, num[26] = {0}, maxz, j;\n  char string[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].id, &b[i].zz);\n    for (j = 0; b[i].zz[j] != '\\0'; j++)\n      num[b[i].zz[j] - 'A']++;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++)\n    if (max < num[i]) {\n      max = num[i];\n      maxz = i;\n    }\n  printf(\"%c\\n%d\", maxz + 65, max);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].zz[j] != '\\0'; j++) {\n      if (b[i].zz[j] == maxz + 65)\n        printf(\"\\n%d\", b[i].id);\n      else\n        continue;\n    }\n}\n"}
{"label": "2", "index": "1832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book1 {\n    int num;\n    char author[20];\n  } book[999];\n  int time[26] = {0};\n  int n, i, j, k, maxi, sign = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].author);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == 'A' + k) {\n          time[k] += 1;\n          break;\n        }\n      }\n    }\n  }\n  maxi = 0;\n  for (i = 0; i < 26; i++) {\n    if (time[maxi] < time[i]) {\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxi, time[maxi]);\n  for (i = 0; i < n && sign == 0; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        sign = 1;\n        break;\n      }\n    }\n  }\n  for (; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1833", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[26][999], t, i, n[26], k, j, b = 0;\n  char x[27];\n  scanf(\"%d \", &t);\n  for (i = 0; i < 26; i++) {\n    n[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    scanf(\"%d%s\", &k, x);\n    for (j = 0; x[j] != '\\0'; j++) {\n      a[x[j] - 65][n[x[j] - 65]] = k;\n      n[x[j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > b) {\n      b = n[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n\", j + 65);\n  printf(\"%d\\n\", n[j]);\n  for (i = 0; i < n[j]; i++) {\n    printf(\"%d\\n\", a[j][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct shu {\n    int bian;\n    char name[26];\n  };\n\n  struct shu a[1000];\n  int n, i, j, l[1000], b[26] = {0}, most, good, k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].bian, a[i].name);\n  for (i = 0; i < n; i++)\n    l[i] = strlen(a[i].name);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < l[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (a[i].name[j] == 65 + k)\n          b[k]++;\n\n  most = b[0];\n  for (i = 0; i < 26; i++)\n    if (b[i] > most) {\n      most = b[i];\n      good = i;\n    }\n  printf(\"%c\\n\", 65 + good);\n  printf(\"%d\\n\", most);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].name[j] == 65 + good)\n        printf(\"%d\\n\", a[i].bian);\n}\n"}
{"label": "2", "index": "1835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, p, j, t, q;\nint SAVER[1500];\nchar R[1500][50];\nint RR[50];\n\nint main() {\n  cin >> n;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &SAVER[i]);\n    cin.get();\n    cin >> R[i];\n    j = 0;\n    while (R[i][j] != '\\0') {\n      RR[R[i][j] - 'A']++;\n      j++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (RR[i - 'A'] > t) {\n      t = RR[i - 'A'];\n      q = i;\n    }\n  printf(\"%c\\n%d\\n\", (char)q, t);\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    while (R[i][j] != '\\0') {\n      if (R[i][j] == q)\n        printf(\"%d\\n\", SAVER[i]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n    \n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd; \n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n  \n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n    \n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0; \n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i]; \n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i; \n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) \n      {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar zimu[28] = \"ABCDEFGJIJKLMNOPQRSTUVWXYZ\";\nchar writer[10000][10000];\nint times[26], id[1000], i, len[10000], book = 0;\nint n, j, k, tmax_1, max_1 = 0;\n\nint main() {\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &id[i], &writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    times[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n\n        if (writer[i][j] == zimu[k]) {\n          times[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (times[i] > max_1) {\n      max_1 = times[i];\n      tmax_1 = i;\n    }\n  }\n  cout << zimu[tmax_1] << \" \";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        book++;\n      }\n    }\n  }\n  printf(\"%d \", book);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        printf(\"%d \", id[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int a[1000];\n  char s[1000][26];\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  char x;\n  int max = 0;\n  char maxx;\n  int l;\n  for (x = 'A'; x <= 'Z'; x++) {\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (s[i][j] == x)\n          break;\n      }\n      if (j != 26)\n        l++;\n    }\n    if (l > max) {\n      max = l;\n      maxx = x;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxx, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (s[i][j] == maxx)\n        break;\n    }\n    if (j != 26)\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[100], C[26] = {0}, n, i, j, m, a = 0, b;\n  char B[100][100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> A[i] >> B[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      m = B[i][j];\n      C[m - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a < C[i]) {\n      a = C[i];\n      b = i;\n    }\n  }\n  cout << b + 65 << \"\\n\";\n  printf(\"%d\\n\", a);\n  c = b + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      if (B[i][j] == c) {\n        printf(\"%d\\n\", A[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1840", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k = 0;\n  struct {\n    int n;\n    char s[26];\n  } book[999];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, &book[i].s);\n  int a[26] = {0};\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      a[(int)(book[i].s[j] - 'A')]++;\n  for (i = 1; i < 26; i++)\n    if (a[k] < a[i])\n      k = i;\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      if (book[i].s[j] == k + 'A') {\n        printf(\"%d\\n\", book[i].n);\n        break;\n      }\n}\n"}
{"label": "2", "index": "1841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ismax(int l[], int a) {\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (l[i] > l[a])\n      return (0);\n  }\n  return (1);\n}\n\nint main() {\n  int i, j, k, n, p, l[26] = {0};\n  struct shu {\n    int num;\n    char auth[100];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].auth);\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 100; k++) {\n        if (book[j].auth[k] == i + 65)\n          l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ismax(l, i) == 1) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 100; j++) {\n      if (book[i].auth[j] == p + 65)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "1842", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct book {\n    short int a;\n    char s[27];\n  } b[999];\n  short int q[26] = {0};\n  short int w[26] = {0}, p, t, m;\n  for (i = 0; i < n; i++) {\n    cin >> b[i].a >> b[i].s;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      p = (int)b[i].s[j] - 65;\n      q[p]++;\n      w[p]++;\n    }\n\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++)\n      if (q[j] < q[j + 1]) {\n        t = q[j];\n        q[j] = q[j + 1];\n        q[j + 1] = t;\n      }\n  for (i = 0; i < 25; i++)\n\n    if (w[i] == q[0])\n      m = i;\n  printf(\"%c\\n\", (char)(m + 65));\n  printf(\"%d\\n\", w[m]);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++)\n      if (b[i].s[j] == m + 65)\n        printf(\"%d\\n\", b[i].a);\n  return 0;\n}\n"}
{"label": "2", "index": "1843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char a[100];\n  };\n  struct book b[1000];\n  int n, i, j, s, t = 0, m, h;\n  int c[1000];\n  char d[27];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].a);\n  d[0] = b[0].a[0];\n  t = 1;\n  c[0] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      int x = 0;\n      for (s = 0; s < t; s++) {\n        if (b[i].a[j] == d[s]) {\n          c[s] = c[s] + 1;\n          x = 0;\n          break;\n        } else\n          x = 1;\n      }\n      if (x == 1) {\n        t++;\n        d[t - 1] = b[i].a[j];\n        c[t - 1] = 1;\n      }\n    }\n  }\n  m = c[0];\n  h = 0;\n  for (i = 0; i < t; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d[h], m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      if (b[i].a[j] == d[h]) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m = 0, num = 0, wnum = 0, max = 0, i = 0, j = 0;\n  int books[26][30];\n  char writer[26], name;\n  memset(books, 0, sizeof(books));\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> num >> writer;\n    wnum = strlen(writer);\n    for (j = 0; j < wnum; j++) {\n      books[writer[j] - 65][0]++;\n      books[writer[j] - 65][books[writer[j] - 65][0]] = num;\n    }\n  }\n  for (j = 0; j < 26; j++)\n    if (max < books[j][0]) {\n      max = books[j][0];\n      name = j + 65;\n    }\n  cout << name << endl;\n  cout << max << endl;\n  for (j = 1; j <= max; j++)\n    cout << books[name - 65][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1845", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct a {\n  int number;\n  char author[26];\n} b[100];\nint main() {\n  int L[26] = {0};\n  int n = 0;\n  int max = 0;\n  int p = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> b[i].number;\n    cin >> b[i].author;\n    for (int j = 0; b[i].author[j] != '\\0'; j++)\n      L[b[i].author[j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < L[i]) {\n      p = i;\n      max = L[i];\n    }\n  cout << (char)(p + 'A') << endl;\n  cout << max << endl;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] - p == 'A') {\n        cout << b[i].number << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1846", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Article {\n  int number;\n  char author[26];\n};\n\nint main() {\n  struct Article book[1000];\n  int m, i;\n  int j, k;\n  int c;\n  int max = 0;\n  int writer[26] = {0};\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].number, book[i].author);\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].author[j] >= 'A' && book[i].author[j] <= 'Z') {\n        c = book[i].author[j] - 'A';\n        writer[c]++;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max < writer[i]) {\n      max = writer[i];\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max == writer[i]) {\n      printf(\"%c\\n\", i + 'A');\n      printf(\"%d\\n\", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < 26; k++) {\n          if (book[j].author[k] == i + 'A') {\n            printf(\"%d\\n\", book[j].number);\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n} b[1001];\nint main() {\n  int n, i, j, k, d, g[27], e = 0, f = 0, l;\n  char m, h;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  m = 'A';\n  for (k = 0; k < 26; k++) {\n    d = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < 26; j++) {\n        if (b[i].name[j] == m)\n          d++;\n        if (b[i].name[j] == '\\0')\n          break;\n      }\n    }\n    m = m + 1;\n    g[k] = d;\n    if (g[k] > e) {\n      e = g[k];\n      f = k;\n    }\n  }\n  h = 'A' + f;\n  printf(\"%c\\n%d\\n\", h, e);\n  for (i = 0; i < n; i++) {\n    d = 0;\n    for (j = 0; j < 26; j++) {\n      if (b[i].name[j] == h)\n        d++;\n      if (b[i].name[j] == '\\0')\n        break;\n    }\n    if (d != 0)\n      printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "1848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[26];\n  struct tushu *next;\n};\nstruct tushu *creat(int n) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 1; i < n; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n, num[26] = {0}, *p, i, j, max = 0;\n  char *a;\n  scanf(\"%d\", &n);\n  struct tushu *head, *p1;\n  head = creat(n);\n  p = num;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    a = p1->name;\n    while (p1 != NULL) {\n      for (j = 0; *(a + j) != '\u0000'; j++) {\n        if (*(a + j) == i + 65) {\n          *(p + i) = *(p + i) + 1;\n          break;\n        }\n      }\n      p1 = p1->next;\n      a = p1->name;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (*(p + max) < *(p + i))\n      max = i;\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", *(p + max));\n  p1 = head;\n  a = p1->name;\n  while (p1 != NULL) {\n    for (i = 0; *(a + i) != '\u0000'; i++) {\n      if (*(a + i) == (max + 65)) {\n        cout << p1->num << \" \";\n        break;\n      }\n    }\n    p1 = p1->next;\n    a = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1849", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int n;\n  char name[27];\n  struct stu *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct stu *head, *p1, *p2, *p3;\n  head = p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->n, p1->name);\n  int i = 0;\n  for (; i < m - 1; i++) {\n    p2 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p2->n, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  p2->next = NULL;\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    while (*p != '\\0') {\n      int a = *p;\n      sum[a - 65] = sum[a - 65] + 1;\n      p = p + 1;\n    }\n  }\n  int max = sum[0];\n  char j = 'A';\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", j, max);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    for (; *p != '\\0'; p++)\n      if (*p == j) {\n        printf(\"%d\\n\", p1->n);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1850", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int book[1000];\n  char author[1000][10];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> book[i] >> author[i];\n\n  int num[26] = {0};\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      num[author[i][j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char maxi;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      maxi = 'A' + i;\n    }\n  }\n  cout << maxi << endl;\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        sum++;\n      }\n    }\n  }\n  cout << sum << endl;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        printf(\"%d\\n\", book[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct information {\n  int num;\n  char author[26];\n} * a;\nint main() {\n  int n, i, j, m, s[26] = {0}, max = 0, p;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].num, a[i].author);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      m = a[i].author[j] - 'A';\n      s[m]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < s[i]) {\n      max = s[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + p, s[p]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == 'A' + p) {\n        cout << a[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Book_num(char a[]) {\n  int j, num;\n  j = 1;\n  if ((j = 1) && a[j] == ' ') {\n    num = a[0] - 48;\n  } else\n    j++;\n  if ((j = 2) && a[j] == ' ') {\n    num = a[1] - 48 + (a[0] - 48) * 10;\n  } else\n    j++;\n  if ((j = 3) && a[j] == ' ') {\n    num = a[2] - 48 + (a[1] - 48) * 10 + (a[0] - 48) * 100;\n  }\n  return num;\n}\n\nint main() {\n  int m, bk1, i, max, j, wrt;\n  int author[26][999] = {0};\n  char data[999][30];\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++) {\n\n    cin >> data[i];\n    data[i][strlen(data[i])] = '\\0';\n  }\n  max = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; data[i][j] != '\\0'; j++) {\n      if (data[i][j] > 64) {\n        wrt = data[i][j] - 65;\n        for (bk1 = 0; author[wrt][bk1] != 0; bk1++) {\n          ;\n        }\n        author[wrt][bk1] = Book_num(data[i]);\n        if (bk1 > max) {\n          max = bk1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i][max] != 0) {\n      printf(\"%c\\n\", i + 65);\n      printf(\"%d\\n\", max + 1);\n      for (j = 0; j <= max; j++) {\n        printf(\"%d\\n\", author[i][j]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j, A[26] = {0}, B[26];\n  char s;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char n[26];\n  } * book;\n  book = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].n);\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      switch (book[i].n[j]) {\n      case 65:\n        A[0]++;\n        break;\n      case 66:\n        A[1]++;\n        break;\n      case 67:\n        A[2]++;\n        break;\n      case 68:\n        A[3]++;\n        break;\n      case 69:\n        A[4]++;\n        break;\n      case 70:\n        A[5]++;\n        break;\n      case 71:\n        A[6]++;\n        break;\n      case 72:\n        A[7]++;\n        break;\n      case 73:\n        A[8]++;\n        break;\n      case 74:\n        A[9]++;\n        break;\n      case 75:\n        A[10]++;\n        break;\n      case 76:\n        A[11]++;\n        break;\n      case 77:\n        A[12]++;\n        break;\n      case 78:\n        A[13]++;\n        break;\n      case 79:\n        A[14]++;\n        break;\n      case 80:\n        A[15]++;\n        break;\n      case 81:\n        A[16]++;\n        break;\n      case 82:\n        A[17]++;\n        break;\n      case 83:\n        A[18]++;\n        break;\n      case 84:\n        A[19]++;\n        break;\n      case 85:\n        A[20]++;\n        break;\n      case 86:\n        A[21]++;\n        break;\n      case 87:\n        A[22]++;\n        break;\n      case 88:\n        A[23]++;\n        break;\n      case 89:\n        A[24]++;\n        break;\n      case 90:\n        A[25]++;\n        break;\n      }\n    }\n  }\n  int k, max;\n\n  for (i = 0; i < 26; i++) {\n    B[i] = A[i];\n  }\n  for (i = 25; i > 0; i--) {\n    if (B[i] > B[i - 1]) {\n      B[i - 1] = B[i];\n\n      max = B[i];\n    } else\n      max = B[i - 1];\n  }\n  for (i = 25; i >= 0; i--) {\n    if (A[i] == max)\n      k = i;\n  }\n\n  s = k + 65;\n  cout << s << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      if (book[i].n[j] == s) {\n        cout << book[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int bianhao;\n    char zuozhe[100];\n  } a[1000];\n  int i, j, n, l, max;\n  int b[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].bianhao >> a[i].zuozhe;\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      b[a[i].zuozhe[j] - 65]++;\n  max = b[0];\n  l = 0;\n  for (i = 1; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      l = i;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      if (a[i].zuozhe[j] == (l + 65)) {\n        printf(\"%d\\n\", a[i].bianhao);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char w[26];\n} b[999];\nint main() {\n  int m, i, j, k, e;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].w);\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26] = {0};\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < m; i++) {\n      e = strlen(b[i].w);\n      for (k = 0; k < e; k++)\n        if (b[i].w[k] == a[j])\n          c[j]++;\n    }\n  }\n  int sum = 0;\n  for (j = 0; j < 26; j++)\n    if (c[j] > c[sum])\n      sum = j;\n  printf(\"%c\\n\", a[sum]);\n  printf(\"%d\\n\", c[sum]);\n  for (i = 0; i < m; i++) {\n    e = strlen(b[i].w);\n    for (k = 0; k < e; k++)\n      if (b[i].w[k] == a[sum])\n        printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "1856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct cs {\n  int b;\n  char a[26];\n};\nint main() {\n  int m, i, j, k, max = 0;\n  int c[200][1000], count[200] = {0};\n  struct cs x[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> x[i].b;\n\n    cin >> x[i].a;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(x[i].a); j++) {\n      for (k = 65; k < 91; k++) {\n        if (x[i].a[j] == k) {\n          count[k]++;\n          c[k][count[k]] = x[i].b;\n        }\n      }\n    }\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] > max)\n      max = count[k];\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] == max) {\n      printf(\"%c %d \", k, count[k]);\n      for (j = 1; j <= max; j++)\n        cout << c[k][j] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1857", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0};\n  int n, i, j, temp;\n  unsigned long len;\n  char author[27], temp2, book[27][1000] = {'\\0'};\n  char str[4];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> str;\n    cin.get();\n    cin.getline(author, 27);\n    len = strlen(author);\n    for (j = 0; j < len; j++) {\n      num[author[j] - 'A']++;\n      strncat(book[author[j] - 'A'], str, 3);\n    }\n  }\n  temp = 0;\n  for (j = 0; j < 26; j++) {\n    if (num[j] > temp) {\n      temp = num[j];\n      temp2 = j + 'A';\n    }\n  }\n  cout << temp2 << endl << temp << endl;\n  for (j = 0; j < temp; j++) {\n    for (i = 0; i < 3; i++)\n      cout << book[temp2 - 'A'][j * 3 + i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1858", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, seq = 0;\n  int a[26] = {0};\n\n  cin >> n;\n  struct book {\n    int num;\n    char str[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    cin >> book[i].num >> book[i].str;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      a[(book[i].str[j] - 65)]++;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      seq = i;\n    }\n\n  printf(\"%c\\n\", seq + 65);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      if (book[i].str[j] == seq + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[2000], max = 0, t, b[30] = {0}, j, m;\n  char str[1000][30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], str[i]);\n    for (j = 0; j < strlen(str[i]); j++) {\n      m = str[i][j] - 64;\n      b[m]++;\n    }\n  }\n  for (i = 1; i < 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 64, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(str[i]); j++)\n      if (str[i][j] == t + 64)\n        cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1860", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, seq = 0;\n  int a[26] = {0};\n\n  cin >> n;\n  struct book {\n    int num;\n    char str[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, &book[i].str);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      a[(book[i].str[j] - 65)]++;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      seq = i;\n    }\n\n  printf(\"%c\\n\", seq + 65);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      if (book[i].str[j] == seq + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1861", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  struct author_book {\n    int count;\n    int book[999];\n  } au[26];\n\n  for (int k = 0; k < 26; k++) {\n    au[k].count = 0;\n  }\n\n  int m;\n  cin >> m;\n\n  for (int i = 1; i <= m; i++) {\n    int num;\n    char a[26];\n    cin >> num;\n    cin.get();\n    cin.getline(a, 26);\n    for (int k = 0; k < strlen(a); k++) {\n      int author_r = (int)(a[k] - 'A');\n      au[author_r].book[au[author_r].count] = num;\n      au[author_r].count++;\n    }\n  }\n\n  int max = 0;\n  int the_one = 0;\n  for (int i = 0; i < 26; i++) {\n\n    if (au[i].count > max) {\n      max = au[i].count;\n      the_one = i;\n    }\n  }\n\n  char maxau = 'A' + the_one;\n  cout << maxau << endl;\n  printf(\"%d\\n\", au[the_one].count);\n\n  for (int i = 0; i < au[the_one].count; i++) {\n    cout << au[the_one].book[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1862", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int No;\n    char author[27];\n    int yes;\n    struct book *next;\n  };\n  struct book *head, *p;\n  int m, i, *max;\n  int *count;\n  count = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(count + i) = 0;\n\n  p = (struct book *)malloc(sizeof(struct book));\n  head = p;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> p->No >> p->author;\n    if (i == m - 1)\n      p->next = NULL;\n    else {\n      p->next = (struct book *)malloc(sizeof(struct book));\n    }\n    p = p->next;\n  }\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      (*(count + ((*point) - 65)))++;\n      point++;\n    }\n    p = p->next;\n  }\n\n  max = count;\n  for (i = 0; i < 26; i++)\n    if (*(count + i) > *max)\n      max = count + i;\n  printf(\"%c\\n\", max - count + 65);\n  printf(\"%d\\n\", *max);\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      if (*point == max - count + 65)\n        printf(\"%d\\n\", p->No);\n      point++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1863", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j = 0, zhe[26], t = 0, x, name;\n  for (i = 0; i < 26; i++) {\n    zhe[i] = 0;\n  }\n  char s[26];\n  scanf(\"%d \", &m);\n  struct {\n    int num;\n    char s[26];\n  } shu[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; shu[i].s[j] != 0; j++) {\n      switch (shu[i].s[j]) {\n      case 'A':\n        zhe[0]++;\n        break;\n      case 'B':\n        zhe[1]++;\n        break;\n      case 'C':\n        zhe[2]++;\n        break;\n      case 'D':\n        zhe[3]++;\n        break;\n      case 'E':\n        zhe[4]++;\n        break;\n      case 'F':\n        zhe[5]++;\n        break;\n      case 'G':\n        zhe[6]++;\n        break;\n      case 'H':\n        zhe[7]++;\n        break;\n      case 'I':\n        zhe[8]++;\n        break;\n      case 'J':\n        zhe[9]++;\n        break;\n      case 'K':\n        zhe[10]++;\n        break;\n      case 'L':\n        zhe[11]++;\n        break;\n      case 'M':\n        zhe[12]++;\n        break;\n      case 'N':\n        zhe[13]++;\n        break;\n      case 'O':\n        zhe[14]++;\n        break;\n      case 'P':\n        zhe[15]++;\n        break;\n      case 'Q':\n        zhe[16]++;\n        break;\n      case 'R':\n        zhe[17]++;\n        break;\n      case 'S':\n        zhe[18]++;\n        break;\n      case 'T':\n        zhe[19]++;\n        break;\n      case 'U':\n        zhe[20]++;\n        break;\n      case 'V':\n        zhe[21]++;\n        break;\n      case 'W':\n        zhe[22]++;\n        break;\n      case 'X':\n        zhe[23]++;\n        break;\n      case 'Y':\n        zhe[24]++;\n        break;\n      case 'Z':\n        zhe[25]++;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (zhe[j] > t) {\n      t = zhe[j];\n      x = j;\n    }\n  }\n  name = 'A' + x;\n  printf(\"%c\\n\", name);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].s[j] == name)\n        printf(\"%d\\n\", shu[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int hao;\n  char zuo[26];\n  struct shu *next;\n};\nint main() {\n  int m, a[26] = {0}, i, j, b[26][1000], k, max;\n  struct shu *p1, *p2, *head = NULL, *p;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct shu *)malloc(1000);\n  cin >> p1->hao >> p1->zuo;\n  head = p1;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d %s\", &p1->hao, p1->zuo);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0, max = 0; i <= 25; i++) {\n    for (p = head, k = 1; p != NULL; p = p->next) {\n      for (j = 0; j <= 25; j++)\n        if (p->zuo[j] == 'A' + i) {\n          a[i]++;\n          b[i][k] = p->hao;\n          k++;\n        }\n    }\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i <= 25; i++) {\n    if (a[i] == max) {\n      printf(\"%c %d \", 'A' + i, max);\n      for (k = 1; k <= max; k++)\n        cout << b[i][k] << \" \";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1865", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct worker {\n  int name;\n  char au[20];\n  struct worker *next;\n};\nstruct help {\n  char author;\n  int max;\n};\nstruct worker *creat(int m) {\n  struct worker *p1, *p2, *p;\n  int i;\n  p1 = p2 = (struct worker *)malloc(sizeof(struct worker));\n\n  scanf(\"%d %s\", &p1->name, p1->au);\n  p = p1;\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p1->name, p1->au);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return p;\n}\nvoid print(struct worker *p) {\n  struct worker *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%d %s\\n\", p1->name, p1->au);\n    p1 = p1->next;\n  }\n}\nvoid most(struct worker *p) {\n  struct worker *p1, *p2;\n  int a[30] = {0}, i, max;\n  char author;\n  struct help t;\n  p1 = p;\n  p2 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      a[*(p1->au + i) - 65] = a[*(p1->au + i) - 65] + 1;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max)\n      author = i + 65;\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  p1 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      if (*(p1->au + i) == author)\n        printf(\"%d\\n\", p1->name);\n    }\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct worker *p1, *p;\n  struct help t;\n  int m;\n  char c;\n  cin >> m;\n  p = creat(m);\n  p1 = p;\n\n  most(p1);\n}\n"}
{"label": "2", "index": "1866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j, A[26] = {0}, B[26];\n  char s;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char n[26];\n  } * book;\n  book = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].n);\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      switch (book[i].n[j]) {\n      case 65:\n        A[0]++;\n        break;\n      case 66:\n        A[1]++;\n        break;\n      case 67:\n        A[2]++;\n        break;\n      case 68:\n        A[3]++;\n        break;\n      case 69:\n        A[4]++;\n        break;\n      case 70:\n        A[5]++;\n        break;\n      case 71:\n        A[6]++;\n        break;\n      case 72:\n        A[7]++;\n        break;\n      case 73:\n        A[8]++;\n        break;\n      case 74:\n        A[9]++;\n        break;\n      case 75:\n        A[10]++;\n        break;\n      case 76:\n        A[11]++;\n        break;\n      case 77:\n        A[12]++;\n        break;\n      case 78:\n        A[13]++;\n        break;\n      case 79:\n        A[14]++;\n        break;\n      case 80:\n        A[15]++;\n        break;\n      case 81:\n        A[16]++;\n        break;\n      case 82:\n        A[17]++;\n        break;\n      case 83:\n        A[18]++;\n        break;\n      case 84:\n        A[19]++;\n        break;\n      case 85:\n        A[20]++;\n        break;\n      case 86:\n        A[21]++;\n        break;\n      case 87:\n        A[22]++;\n        break;\n      case 88:\n        A[23]++;\n        break;\n      case 89:\n        A[24]++;\n        break;\n      case 90:\n        A[25]++;\n        break;\n      }\n    }\n  }\n  int k, max;\n  \n  \n  for (i = 0; i < 26; i++) {\n    B[i] = A[i];\n  }\n  for (i = 25; i > 0; i--) {\n    if (B[i] > B[i - 1]) {\n      B[i - 1] = B[i];\n\n      max = B[i];\n    } else {\n      max = B[i - 1];\n    }\n  }\n  for (i = 25; i >= 0; i--) {\n    if (A[i] == max)\n      k = i;\n  }\n  \n  s = k + 65;\n  printf(\"%c\\n%d\\n\", s, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      if (book[i].n[j] == s) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct s {\n    int N;\n    char w[26];\n  };\n  struct s s[999];\n  int n, i, j, c, a[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &s[i].N);\n\n    cin >> s[i].w;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++) {\n      c = s[i].w[j];\n      a[c - 65]++;\n    }\n  }\n  c = 0;\n  for (i = 0; i <= 25; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  cout << c + 65 << \" \" << a[c] << \" \";\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++)\n      if (s[i].w[j] == (c + 65))\n        cout << s[i].N << \" \";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct record {\n  int id;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  struct YyxNode *newNd;\n  if (((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) ||\n      ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL)) {\n    printf(\"Error: memory out! (1)\");\n    exit(-1);\n  }\n\n  newLn->n = 0;\n  newLn->head = newNd;\n  newNd->next = NULL;\n  newLn->tail = newNd;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNd;\n  if ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\");\n    exit(-1);\n  }\n\n  newNd->m_rec = *rec;\n  newNd->next = NULL;\n\n  ln->tail->next = newNd;\n  ln->tail = newNd;\n  ln->n++;\n\n  return ln;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNd, *nextNd;\n  delNd = ln->head->next;\n  for (; delNd != NULL; delNd = nextNd) {\n    nextNd = delNd->next;\n    free(delNd);\n  }\n\n  ln->n = 0;\n  ln->head->next = NULL;\n\n  return ln;\n}\n\nvoid FreeLink(struct YyxLink *ln) {\n  ClearLink(ln);\n  free(ln->head);\n  free(ln);\n}\n\nint main() {\n  struct YyxLink **total;\n  int m;\n  struct record rec;\n  char author[27];\n  int i;\n  char *pch;\n  struct YyxNode *nd;\n\n  if ((total = (struct YyxLink **)malloc(26 * sizeof(struct YyxLink *))) ==\n      NULL) {\n    printf(\"Error: memory out! (3)\\n\");\n    exit(-1);\n  }\n  for (i = 0; i < 26; i++) {\n    total[i] = CreateNewLink();\n  }\n\n  scanf(\"%d\", &m);\n  for (; m > 0; m--) {\n    scanf(\"%d %s\", &rec.id, author);\n    pch = author;\n    for (; *pch != '\\0'; pch++) {\n      AddNode(total[*pch - 'A'], &rec);\n    }\n  }\n\n  m = 0;\n  for (i = 1; i < 26; i++) {\n    if (total[m]->n < total[i]->n)\n      m = i;\n  }\n  printf(\"%c\\n%d\\n\", m + 'A', total[m]->n);\n  nd = total[m]->head->next;\n  for (; nd != NULL; nd = nd->next) {\n    printf(\"%d\\n\", nd->m_rec);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  char id[10];\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, k, n, num, max = 0;\n  char maxname;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].id);\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    n = 0;\n    for (j = 0; j < num; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[j].name[k] == ('A' + i))\n          n += 1;\n      }\n    }\n    if (n > max) {\n      maxname = 'A' + i;\n      max = n;\n    }\n  }\n  cout << maxname << \"\\n\" << max << \"\\n\";\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < 26; k++) {\n      if (book[j].name[k] == maxname)\n        printf(\"%s\\n\", book[j].id);\n      ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, m, b[26], t = 0, k;\n  char c[1000][20];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], c[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if ('A' < c[i][j] < 'Z')\n        b[c[i][j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > t) {\n      t = b[i];\n      k = i;\n    }\n  cout << k + 65 << \"\\n\";\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++) {\n      if (c[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "1871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->str;\n  n = 1;\n  head = 0;\n  while (n < m) {\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->str);\n    n = n + 1;\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 'A' + 1]++;\n    }\n  }\n  max = sum[1];\n  x = 1;\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 'A' - 1) {\n        a[y] = p->num;\n        y++;\n        t = strlen(p->str) + 1;\n      }\n  }\n  printf(\"%c %d \", x + 64, max);\n  for (y = 1; y <= max; y++)\n    cout << a[y] << \" \";\n  return 0;\n}\n"}
{"label": "2", "index": "1872", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int order;\n  int num;\n  char writer[26];\n} b[1000];\nint main() {\n  int n, i, j, k, p, q[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    cin >> b[i].num >> b[i].writer;\n    b[i].order = i;\n  }\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26];\n  char d[26];\n  for (j = 0; j <= 25; j++) {\n    d[j] = 0;\n    c[j] = 0;\n  }\n  for (k = 0; k <= 25; k++) {\n    for (i = 0; i <= (n - 1); i++) {\n      p = strlen(b[i].writer);\n      strcpy(d, b[i].writer);\n      for (j = 0; j <= (p - 1); j++) {\n        if (d[j] == a[k]) {\n          c[k] = c[k] + 1;\n        }\n      }\n      for (j = 0; j <= 25; j++) {\n        d[j] = 0;\n      }\n    }\n  }\n  int max = c[0];\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n    }\n  }\n  char x;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] == max) {\n      x = a[i];\n      printf(\"%c\\n\", a[i]);\n      printf(\"%d\\n\", c[i]);\n    }\n  }\n\n  for (i = 0; i <= 999; i++) {\n    q[i] = 0;\n  }\n  int r = 0;\n  char e[26];\n  for (i = 0; i <= 25; i++) {\n    e[i] = 0;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    p = strlen(b[i].writer);\n    strcpy(e, b[i].writer);\n    for (j = 0; j <= (p - 1); j++) {\n      if (e[j] == x) {\n        q[r] = b[i].num;\n        r = r + 1;\n      }\n    }\n    for (j = 0; j <= 25; j++) {\n      e[j] = 0;\n    }\n  }\n  int s = 0;\n  for (i = 0; i <= 999; i++) {\n    if (q[i] != 0) {\n      s = s + 1;\n    }\n  }\n  for (i = 0; i <= (s - 2); i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  printf(\"%d\", q[s - 1]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "1873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n};\nint main() {\n  int n, m, i, j;\n  int author_num[26] = {0};\n  scanf(\"%d\", &n);\n  struct book shu[999];\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      m = shu[i].author[j] - 'A';\n      author_num[m]++;\n    }\n  }\n  int max = author_num[0], author = 'A';\n  for (i = 1; i < 26; i++) {\n    if (author_num[i] > max) {\n      max = author_num[i];\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == author) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m = 0, num = 0, wnum = 0, max = 0, i = 0, j = 0;\n  int books[26][30];\n  char writer[26], name;\n  memset(books, 0, sizeof(books));\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s \", &num, writer);\n    wnum = strlen(writer);\n    for (j = 0; j < wnum; j++) {\n      books[writer[j] - 65][0]++;\n      books[writer[j] - 65][books[writer[j] - 65][0]] = num;\n    }\n  }\n  for (j = 0; j < 26; j++)\n    if (max < books[j][0]) {\n      max = books[j][0];\n      name = j + 65;\n    }\n  printf(\"%c\\n\", name);\n  printf(\"%d\\n\", max);\n  for (j = 1; j <= max; j++)\n    cout << books[name - 65][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], max = 0, t, p[26] = {0};\n  char c[1000][27],\n      l[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> c[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      for (k = 0; k < 26; k++) {\n        if (c[i][j] == l[k])\n          p[k] += 1;\n      }\n  for (k = 0; k < 26; k++)\n    if (p[k] > max) {\n      max = p[k];\n      t = k;\n    }\n  cout << l[t] << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if (c[i][j] == l[t]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "1876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstruct stu {\n  int num;\n  char name[27];\n  struct stu *next;\n};\n\nstruct stu *creat() {\n  int i = 0;\n  struct stu *head, *p1, *p2;\n  head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p2->num, p2->name);\n  while (i < n - 1) {\n    i++;\n    p2 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %s\", &p2->num, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  return head;\n}\n\nint main() {\n  struct stu *p, *head;\n  int k, u, max = 0, maxnum;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  head = p = creat();\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      a[p->name[u] - 'A']++;\n    p = p->next;\n  }\n  for (k = 0; k < 26; k++)\n    if (a[k] > max) {\n      max = a[k];\n      maxnum = k;\n    }\n  printf(\"%c\\n%d\\n\", maxnum + 'A', max);\n  p = head;\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      if (p->name[u] == maxnum + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "1877", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct shu {\n  int bianhao;\n  char name[26];\n} shu[999];\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k;\n  int jishu[26] = {0};\n  int beiyong[26];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &shu[i].bianhao, shu[i].name);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (shu[j].name[k] == i + 'A')\n          jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    beiyong[i] = jishu[i];\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (beiyong[i] > max)\n      max = beiyong[i];\n  }\n  int t;\n  for (i = 0; i < 26; i++) {\n    if (jishu[i] == max)\n      t = i;\n  }\n  printf(\"%c\\n\", t + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].name[j] == t + 'A')\n        printf(\"%d\\n\", shu[i].bianhao);\n    }\n  }\n}\n"}
{"label": "2", "index": "1878", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, x, maxnumber;\n  scanf(\"%d \", &m);\n  int booknum[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &booknum[i], k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j < strlen(k[i]); j++)\n      if (k[i][j] == who)\n        printf(\"%d\\n\", booknum[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, b[26] = {0}, m, j, max = 0, k;\n  char str[1000][30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> str[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == 'A')\n        b[0]++;\n      if (str[i][j] == 'B')\n        b[1]++;\n      if (str[i][j] == 'C')\n        b[2]++;\n      if (str[i][j] == 'D')\n        b[3]++;\n      if (str[i][j] == 'E')\n        b[4]++;\n      if (str[i][j] == 'F')\n        b[5]++;\n      if (str[i][j] == 'G')\n        b[6]++;\n      if (str[i][j] == 'H')\n        b[7]++;\n      if (str[i][j] == 'I')\n        b[8]++;\n      if (str[i][j] == 'J')\n        b[9]++;\n      if (str[i][j] == 'K')\n        b[10]++;\n      if (str[i][j] == 'L')\n        b[11]++;\n      if (str[i][j] == 'M')\n        b[12]++;\n      if (str[i][j] == 'N')\n        b[13]++;\n      if (str[i][j] == 'O')\n        b[14]++;\n      if (str[i][j] == 'P')\n        b[15]++;\n      if (str[i][j] == 'Q')\n        b[16]++;\n      if (str[i][j] == 'R')\n        b[17]++;\n      if (str[i][j] == 'S')\n        b[18]++;\n      if (str[i][j] == 'T')\n        b[19]++;\n      if (str[i][j] == 'U')\n        b[20]++;\n      if (str[i][j] == 'V')\n        b[21]++;\n      if (str[i][j] == 'W')\n        b[22]++;\n      if (str[i][j] == 'X')\n        b[23]++;\n      if (str[i][j] == 'Y')\n        b[24]++;\n      if (str[i][j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%d\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "1880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  char number[1000][5] = {' '};\n  char authors[1000][30] = {' '};\n  int author[30] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    cin >> number[i] >> authors[i];\n    int len1 = strlen(authors[i]);\n\n    for (j = 0; j <= len1 - 1; j++) {\n      author[authors[i][j] - 'A']++;\n    }\n  }\n  int k, kmax = 0;\n  int max = author[0];\n  for (k = 1; k <= 25; k++) {\n    if (author[k] > max) {\n      max = author[k];\n      kmax = k;\n    }\n  }\n  char writer = kmax + 'A';\n  cout << writer << endl;\n  cout << max << endl;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (authors[i][j] - 'A' == kmax) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int record[26][1000];\n  memset(record, 0, sizeof(record));\n  char name[10];\n  int m, temp;\n  cin >> m;\n  for (int i = 0; i < m; i++) {\n    cin >> temp;\n    cin.get();\n    cin.getline(name, 10);\n    for (int i = 0; i < strlen(name); i++) {\n      record[name[i] - 65][record[name[i] - 65][0] + 1] = temp;\n      record[name[i] - 65][0]++;\n    }\n  }\n  int flag = 0;\n  for (int i = 0; i < 25; i++) {\n    if (record[i][0] > record[flag][0]) {\n      flag = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(flag + 65), record[flag][0]);\n  for (int i = 1; i <= record[flag][0]; i++) {\n    printf(\"%d\\n\", record[flag][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct books {\n  int num;\n  char name[100];\n  struct books *next;\n};\nstruct books *create(int n) {\n  struct books *head, *p1, *p2;\n  p1 = (struct books *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  while (--n) {\n    p1 = (struct books *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  int n, i, max, k;\n  char *p;\n  int num[26] = {0};\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  struct books *p1, *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    p = p1->name;\n    do {\n\n      if (*p == name[i]) {\n        num[i]++;\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        if (*p == '\u0000') {\n          p1 = p1->next;\n          p = p1->name;\n        } else {\n          p++;\n        }\n      }\n    } while (p1 != NULL);\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= max) {\n      k = i;\n      max = num[i];\n    }\n  }\n  cout << name[k] << \" \";\n  printf(\"%d \", num[k]);\n  p1 = head;\n  p = p1->name;\n  while (p1 != NULL) {\n\n    if (*p == name[k]) {\n      cout << p1->num << \" \";\n      p1 = p1->next;\n      p = p1->name;\n    } else {\n      if (*p == '\u0000') {\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        p++;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1883", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(int m) {\n  struct stu *p1, *p2, *xhead;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  xhead = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nint stas(int b[]) {\n  int j, max = 0, indexx = 0;\n  for (j = 0; j < 26; j++)\n    if (b[j] > max) {\n      max = b[j];\n      indexx = j;\n    }\n  printf(\"%c\\n%d\\n\", indexx + 65, max);\n  \n  \n  return indexx;\n}\n\nstruct stu *search(struct stu *yhead, int y) {\n  struct stu *q;\n  int sum = 0, k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = yhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < i + k; i++)\n      if (*i == y + 65)\n        sum++;\n    strcpy(s, s0);\n    q = q->next;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n\nstruct stu *print(struct stu *zhead, int z) {\n  struct stu *q;\n  int k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = zhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < s + k; i++)\n      if (*i == z + 65) {\n        printf(\"%d\\n\", q->num);\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n  return 0;\n}\n\nint main() {\n  int n, index;\n  int a[26], k, t, i;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  scanf(\"%d\", &n);\n  head = create(n);\n  p = head;\n  while (p) {\n    strcpy(s, p->c);\n    \n    k = strlen(s);\n    \n    for (i = 0; i < k; i++) {\n      \n      t = s[i] - 65;\n      a[t]++;\n    }\n    \n    \n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  index = stas(a);\n  \n  print(head, index);\n  return 0;\n}\n"}
{"label": "2", "index": "1884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 1, m;\nstruct zuozhe {\n  int num;\n  char ren[26];\n  struct zuozhe *next;\n};\nstruct zuozhe *ap() {\n  struct zuozhe *head, *nw, *tn;\n  do {\n    nw = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    scanf(\"%d%s\", &nw->num, nw->ren);\n    if (n == 1) {\n      head = nw;\n      tn = head;\n    } else\n      tn->next = nw;\n    if (n <= m) {\n      tn = nw;\n      n++;\n    }\n  } while (n <= m);\n  tn->next = NULL;\n  return head;\n}\nint main() {\n  int i, max = 0, a[26] = {0}, j, w, l;\n  char z;\n  struct zuozhe *head, *p;\n  scanf(\"%d\", &m);\n  head = ap();\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      j = p->ren[i] - 65;\n      a[j]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      w = i;\n    }\n  }\n  z = 65 + w;\n  printf(\"%c\\n%d\\n\", z, max);\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      if (p->ren[i] == z) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint N;\nint A[2013], Ans[1222];\nchar W[2013][28];\ndouble Max(double X, double Y) { return X > Y ? X : Y; }\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    cin >> A[I] >> W[I];\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      Ans[W[I][J]]++;\n  }\n  int Max = 0, T;\n  for (int I = 65; I <= 'Z'; I++)\n    if (Ans[I] > Max) {\n      Max = Ans[I];\n      T = I;\n    }\n  cout << T << \"\\n\" << Max << \"\\n\";\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      if (W[I][J] == T)\n        cout << A[I] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct fy {\n    int x;\n    char y[26];\n    int s[26];\n    struct fy *z;\n  } sl[1000], *p;\n  int n, i, j, b[26] = {0};\n  char a[100];\n  p = &sl[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &sl[i].x, sl[i].y);\n    for (j = 0; j < strlen(sl[i].y); j++) {\n      sl[i].s[sl[i].y[j] - 'A'] = 1;\n      b[sl[i].y[j] - 'A']++;\n    }\n    sl[i].z = &sl[i + 1];\n  }\n  sl[n - 1].z = NULL;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < 26; j++)\n      if (b[i] < b[j])\n        break;\n    if (j == 26) {\n      j = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", i + 'A', b[j]);\n  while (p != NULL) {\n    if (p->s[i] == 1)\n      printf(\"%d\\n\", p->x);\n    p = p->z;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int m, i, j, max;\n  int sum[26] = {0};\n  scanf(\"%d\", &m);\n  struct book b[m];\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      sum[(b[i].name)[j] - 'A']++;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > sum[max])\n      max = i;\n  cout << max + 'A' << \"\\n\" << sum[max] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if ((b[i].name)[j] == 65 + max)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int no;\n  char auth[26];\n};\nint main() {\n  struct book *head, *BK;\n  int m, n, k, i, j, t, q, p, max;\n  int a[26] = {0};\n  scanf(\"%d\", &m);\n  BK = (struct book *)malloc(m * 1000);\n  head = BK;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &BK->no, &BK->auth);\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      k = BK->auth[j] - 'A';\n      a[k] = a[k] + 1;\n    }\n    BK = BK + 1;\n  }\n  max = a[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  q = t + 'A';\n  printf(\"%c %d \", q, max);\n  BK = head;\n  for (i = 0; i < m; i++) {\n    p = 0;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      if (BK->auth[j] == q) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1) {\n      cout << BK->no << \" \";\n    }\n    BK = BK + 1;\n  }\n}\n"}
{"label": "2", "index": "1889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[1000] = {0}, b[1000] = {0}, c[100] = {0}, l = 0;\n  char s[1000][100] = {0}, m[26] = {0}, p;\n  int i = 0, j = 0, k = 0, t = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    m[j] = i;\n    for (t = 0; t < n; t++) {\n      for (k = 0; s[t][k] != '\\0'; k++) {\n        if (s[t][k] == m[j]) {\n          c[j]++;\n          break;\n        }\n      }\n    }\n    j++;\n  }\n  l = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > l) {\n      l = c[i];\n      p = m[i];\n    }\n  }\n  printf(\"%c\\n\", p);\n  cout << l << \"\\n\";\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; s[i][j] != '\\0'; j++) {\n      if (s[i][j] == p) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 1) {\n      cout << a[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1890", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    char num[20];\n    char ren[30];\n    struct book *next;\n  };\n\n  int n;\n  int a[26] = {0};\n  struct book *head, *p1, *p2;\n  int i, j;\n  char tem;\n  char b[100][30];\n\n  p1 = (struct book *)malloc(1000);\n  head = p1;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", p1->num, p1->ren);\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      int t = p1->ren[j] - 'A';\n      a[t]++;\n    }\n    p1 = p1->next;\n  }\n\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      tem = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", tem);\n  p1 = head;\n  int u = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      if (p1->ren[j] == tem) {\n        strcpy(b[u], p1->num);\n        u++;\n      }\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", u);\n\n  for (i = 0; i < u; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n}\n"}
{"label": "2", "index": "1891", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  int number;\n  char name[26];\n} author[999];\n\nstruct single {\n\n  char letter[1];\n  int number;\n\n} single[26];\n\nint main(int argc, char *argv[]) {\n  int n, i, m, j, p, k, book[999];\n  for (i = 0; i < 26; i++) {\n    single[i].letter[0] = 65 + i;\n    single[i].number = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &author[i].number, &author[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (single[k].letter[0] == author[i].name[j])\n          single[k].number++;\n      }\n    }\n  }\n  m = 0;\n  p = single[0].number;\n  for (i = 1; i < 26; i++) {\n    if (p < single[i].number) {\n      p = single[i].number;\n      m = i;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (author[i].name[j] == single[m].letter[0]) {\n        book[k] = author[i].number;\n        k++;\n      }\n    }\n  }\n  printf(\"%c\\n\", single[m].letter[0]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } book[999];\n  int m, i, n, j, max;\n  char a[26], c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].writer;\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++) {\n        if (a[i] == book[j].writer[n]) {\n          c[i]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  cout << a[max] << \"\\n\" << c[max] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == a[max])\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int s[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  struct book {\n    int a;\n    char name[27];\n  };\n  struct book list[999];\n  char c;\n  int n, i, j, b, maxnum = 0, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &list[i].a, list[i].name);\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      c = list[i].name[j];\n      b = c - 'A';\n      s[b]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] > maxnum) {\n      maxnum = s[i];\n      max = i;\n    }\n  }\n  printf(\"%d\\n%d\\n\", 'A' + max, maxnum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      if (list[i].name[j] - 'A' == max) {\n        cout << list[i].a << \"\\n\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, g[26] = {0}, s[26][1000] = {0};\n  char a[50];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < 50; i++)\n      a[i] = 0;\n    scanf(\"%d%s\", &l, a);\n    for (i = 0; i < 26; i++)\n      for (j = 0; j < 26; j++)\n        if (a[i] == 'A' + j) {\n          s[j][g[j]] = l, g[j]++;\n          break;\n        }\n  }\n  m = 0;\n  for (i = 0; i < 26; i++)\n    if (g[i] > m) {\n      m = g[i], k = i;\n    }\n  cout << 'A' + k << \"\\n\" << m << \"\\n\";\n  for (i = 0; i < m; i++)\n    cout << s[k][i] << \"\\n\";\n}\n"}
{"label": "2", "index": "1895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    char b[100];\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int m, n, i, j, k, t, d[50], max;\n  char c;\n  scanf(\"%d\", &n);\n  p1 = (struct s *)malloc(sizeof(struct s));\n  p2 = p1;\n  head = p1;\n  scanf(\"%d %s\", &p1->a, p1->b);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %s\", &p1->a, p1->b);\n  }\n  p2->next = 0;\n  t = 0;\n  p1 = p2 = head;\n\n  for (c = 'A'; c <= 'Z'; c++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      j = 0;\n      while (p1->b[j] != '\\0') {\n        if (c == p1->b[j])\n          k++;\n        j++;\n      }\n      p1 = p1->next;\n    }\n\n    d[t] = k;\n\n    t++;\n    p1 = head;\n  }\n  j = 0;\n  max = d[0];\n  for (i = 1; i < 26; i++)\n    if (d[i] > max) {\n      max = d[i];\n      j = i;\n    }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", max);\n  t = 'A' + j;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (p1->b[j] != '\\0') {\n      if (t == p1->b[j])\n        cout << p1->a << \"\\n\";\n      j++;\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char id[11];\n  char name[30];\n};\nstruct au {\n  int num;\n  char id[1000][11];\n};\nint main() {\n  struct book b;\n  struct au a[26];\n  int n, i, j = 0, k;\n  char c;\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", b.id, b.name);\n    while (b.name[j] != '\\0') {\n      k = b.name[j] - 'A';\n      strcpy(a[k].id[a[k].num], b.id);\n      a[k].num++;\n      j++;\n    }\n    j = 0;\n  }\n  k = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    j = (a[i].num > k) ? i : j;\n    k = (a[i].num > k) ? a[i].num : k;\n  }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[j].id[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "1897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char a[100];\n  };\n  struct book b[1000];\n  int n, i, j, s, t = 0, m, h;\n  int c[1000];\n  char d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> b[i].num >> b[i].a;\n  d[0] = b[0].a[0];\n  t = 1;\n  c[0] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      int x = 0;\n      for (s = 0; s < t; s++) {\n        if (b[i].a[j] == d[s]) {\n          c[s] = c[s] + 1;\n          x = 0;\n          break;\n        } else\n          x = 1;\n      }\n      if (x == 1) {\n        t++;\n        d[t - 1] = b[i].a[j];\n        c[t - 1] = 1;\n      }\n    }\n  }\n  m = c[0];\n  h = 0;\n  for (i = 0; i < t; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d[h], m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      if (b[i].a[j] == d[h]) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1898", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, num[100], k = 0, count[26] = {0}, max = 0;\n  char nam[100][30] = {NULL};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cin.get();\n\n    cin >> nam[i];\n    for (j = 0; j < strlen(nam[i]); j++)\n      count[nam[i][j] - 'A']++;\n  }\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      k = i;\n    } else\n      continue;\n  }\n  j = 0;\n  cout << (char)(k + 'A') << endl;\n  cout << max << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0;; j++) {\n      if (nam[i][j] == k + 'A') {\n        cout << num[i] << endl;\n        break;\n      }\n      if (nam[i][j] == NULL)\n        break;\n    }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct x {\n    int num;\n    char name[26];\n  } book[1000];\n  int i, j, m, n, k, ex;\n\n  int count[26] = {0},\n      num[26] = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n                 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      ex = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = ex;\n      ex = num[i];\n      num[i] = num[i + 1];\n      num[i + 1] = ex;\n    }\n  }\n  cout << num[25] << \" \" << count[25] << \" \";\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == num[25])\n        cout << book[i].num << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char temp, s;\n  int i, j, t[27][2000], m, n, a[27] = {0}, num[2000], x;\n  {\n    cin >> n;\n    for (i = 1; i <= n; i++) {\n      cin >> num[i];\n      temp = cin.get();\n      while (temp == '\\n' || temp == ' ') {\n        temp = cin.get();\n      }\n      for (j = 1; 1; j++) {\n        x = temp - 'A' + 1;\n        t[x][a[x]] = num[i];\n        a[x]++;\n        temp = cin.get();\n        if (temp == '\\n') {\n          break;\n        }\n      }\n    }\n    m = 0;\n    for (i = 1; i <= 26; i++) {\n      if (a[i] > a[m]) {\n        m = i;\n      }\n    }\n    s = m + 'A' - 1;\n    cout << s << endl << a[m] << endl;\n    for (i = 0; i < a[m]; i++) {\n      cout << t[m][i] << endl;\n    }\n  }\n}\n"}
{"label": "2", "index": "1901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int book[1000];\n  char person[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  char people[100][100];\n  int i, j;\n  int l;\n  int t[100] = {0};\n  for (i = 1; i <= m; i++) {\n    cin >> book[i];\n    cin >> people[i];\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      t[people[i][j] - 'A']++;\n    }\n  }\n  int max = 0, tt;\n  for (i = 0; i <= 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      tt = i;\n    }\n  }\n  cout << person[tt] << endl;\n  cout << max << endl;\n  int k;\n  int already[26] = {1};\n  for (i = 1; i <= m; i++) {\n\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      if (people[i][j] == person[tt])\n\n      {\n        cout << book[i] << \"\\n\";\n        for (k = 0; k < l; k++) {\n          if ((people[i][k] != person[tt]) &&\n              (already[people[i][k] - 'A'] != 0)) {\n\n            already[people[i][k] - 'A'] = 0;\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char aut[100];\n} b[200000];\nint count_1[1000] = {0};\n\nint main() {\n  int n, max = 0, maxnum, i, j, f;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n    for (j = 0; j < strlen(b[i].aut); j++)\n      count_1[b[i].aut[j]]++;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (count_1[i] > max) {\n      max = count_1[i];\n      maxnum = i;\n    }\n  }\n  cout << maxnum << \" \" << max << \" \";\n  for (i = 1; i <= n; i++) {\n    f = 0;\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      if (b[i].aut[j] == maxnum) {\n        f = 1;\n      }\n    }\n    if (f == 1) {\n      cout << b[i].num << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[30];\n  struct book *next;\n};\nint n;\nstruct book *creat(void) {\n  struct book *head;\n  struct book *p1, *p2;\n  int m = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->writer);\n  head = NULL;\n  while (m < n - 1) {\n    m++;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct book *head, *p1;\n  head = creat();\n  struct book *p;\n  p = head;\n  int i;\n  int sum[27];\n  memset(sum, 0, sizeof(sum));\n  char m;\n  for (p = head; p != NULL; p = p->next) {\n    int x;\n    for (i = 0; i < strlen(p->writer); i++) {\n      x = p->writer[i] - 'A';\n      sum[x]++;\n    }\n  }\n  int max = sum[0];\n  for (i = 0; i < 27; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  for (i = 0; i < 27; i++) {\n    if (sum[i] == max) {\n      cout << 'A' + i << \"\\n\" << sum[i] << \"\\n\";\n      m = 'A' + i;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (i = 0; i < strlen(p->writer); i++) {\n      if (p->writer[i] == m) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book {\n    int booknumber;\n    char writer[27];\n  } book[999];\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].booknumber, book[i].writer);\n\n  int writerbookquantity[26];\n  for (i = 0; i < 26; i++)\n    writerbookquantity[i] = 0;\n  int j, len, x;\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      x = book[i].writer[j] - 'A';\n      writerbookquantity[x]++;\n    }\n  }\n  int maxwriter = 0, maxquantity = 0;\n  for (i = 0; i < 26; i++) {\n    if (writerbookquantity[i] > maxquantity) {\n      maxquantity = writerbookquantity[i];\n      maxwriter = i;\n    }\n  }\n  cout << (char)(maxwriter + 'A') << \"\\n\"\n       << writerbookquantity[maxwriter] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      if ((int)book[i].writer[j] == maxwriter + 'A')\n        printf(\"%d\\n\", book[i].booknumber);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char s[26];\n  } b[1000];\n  struct author {\n    int n[1000];\n    int p;\n    char c;\n  } a[26], e;\n  int i, j, k, m, q, max;\n  char d;\n  for (i = 0; i < 26; i++)\n    a[i].p = 0;\n  for (i = 0, d = 'A'; i < 26; i++, d++) {\n    a[i].c = d;\n  }\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (b[i].s[j] == '\\0') {\n        break;\n      }\n      for (k = 0; k < 26; k++) {\n        if (b[i].s[j] == a[k].c) {\n          a[k].n[a[k].p] = b[i].num;\n          a[k].p += 1;\n        }\n      }\n    }\n  }\n  max = a[0].p;\n  e = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i].p > max) {\n      e = a[i];\n      max = a[i].p;\n    }\n  }\n  printf(\"%c\\n\", e.c);\n  cout << e.p << \"\\n\";\n  for (j = 0; j < e.p; j++)\n    printf(\"%d\\n\", e.n[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "1906", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[110], m, ni = 0, n = 0,\n                   maxn[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  char au[110][30], max[30];\n  scanf(\"%d \", &m);\n\n  int i, j;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    cin >> au[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 'A')\n        maxn[0]++;\n      if (au[i][j] == 'B')\n        maxn[1]++;\n      if (au[i][j] == 'C')\n        maxn[2]++;\n      if (au[i][j] == 'D')\n        maxn[3]++;\n      if (au[i][j] == 'E')\n        maxn[4]++;\n      if (au[i][j] == 'F')\n        maxn[5]++;\n      if (au[i][j] == 'G')\n        maxn[6]++;\n      if (au[i][j] == 'H')\n        maxn[7]++;\n      if (au[i][j] == 'I')\n        maxn[8]++;\n      if (au[i][j] == 'J')\n        maxn[9]++;\n      if (au[i][j] == 'K')\n        maxn[10]++;\n      if (au[i][j] == 'L')\n        maxn[11]++;\n      if (au[i][j] == 'M')\n        maxn[12]++;\n      if (au[i][j] == 'N')\n        maxn[13]++;\n      if (au[i][j] == 'O')\n        maxn[14]++;\n      if (au[i][j] == 'P')\n        maxn[15]++;\n      if (au[i][j] == 'Q')\n        maxn[16]++;\n      if (au[i][j] == 'R')\n        maxn[17]++;\n      if (au[i][j] == 'S')\n        maxn[18]++;\n      if (au[i][j] == 'T')\n        maxn[19]++;\n      if (au[i][j] == 'U')\n        maxn[20]++;\n      if (au[i][j] == 'V')\n        maxn[21]++;\n      if (au[i][j] == 'W')\n        maxn[22]++;\n      if (au[i][j] == 'X')\n        maxn[23]++;\n      if (au[i][j] == 'Y')\n        maxn[24]++;\n      if (au[i][j] == 'Z')\n        maxn[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (maxn[i] > n) {\n      n = maxn[i];\n      ni = i;\n    }\n  }\n  cout << (char)(ni + 65) << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 65 + ni)\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[999], i, k[27] = {0}, j, t, m;\n  char b[999][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; b[i][j]; j++)\n      k[b[i][j] - 65]++;\n  }\n  t = k[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (k[j] > t) {\n      t = k[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 65, t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j]; j++) {\n      if (b[i][j] == m + 65) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char w[26];\n  struct book *next;\n};\nint c[26], m, i, j = 0, max_1;\n\nstruct book *creat(int m) {\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->w);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->w);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nvoid a(struct book *head) {\n  struct book *p;\n  char *x;\n  int l, ch;\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      l = (int)*x;\n      ch = l - 65;\n\n      if (ch >= 0)\n        c[ch] = c[ch] + 1;\n    }\n    p = p->next;\n  }\n}\n\nint main() {\n  struct book *head, *p;\n  struct book *creat(int m);\n  void a(struct book * head);\n  char writer, *x;\n  int wri, b[200];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 200; i++)\n    b[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  a(head);\n  max_1 = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max_1) {\n      wri = i + 65;\n      max_1 = c[i];\n    }\n  }\n  printf(\"%c \", wri);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      if (*x == (char)wri) {\n        b[j] = p->num;\n        j = j + 1;\n        break;\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%d \", j);\n  for (j = 0; b[j] > 0; j++)\n    cout << b[j] << \" \";\n  return 0;\n}\n"}
{"label": "2", "index": "1909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct list_1 {\n  int num;\n  char author[26];\n};\n\nstruct number {\n  int a;\n  int time;\n};\n\nint main() {\n  int i, j, m, k, length;\n  struct list_1 book[100];\n  struct number name[26], most;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n\n  for (i = 0; i < 26; i++) {\n    name[i].a = i;\n    name[i].time = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      name[k - 65].time++;\n    }\n  }\n\n  most = name[0];\n\n  for (i = 1; i < 26; i++) {\n    if (name[i].time > most.time) {\n      most = name[i];\n    }\n  }\n\n  printf(\"%c %d \", most.a + 65, most.time);\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      if (most.a + 65 == k) {\n        printf(\"%d \", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    char num[20];\n    char ren[30];\n    struct book *next;\n  };\n\n  int n;\n  int a[26] = {0};\n  struct book *head, *p1, *p2;\n  int i, j;\n  char tem;\n  char b[100][30];\n\n  p1 = (struct book *)malloc(1000);\n  head = p1;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", p1->num, p1->ren);\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      int t = p1->ren[j] - 'A';\n      a[t]++;\n    }\n    p1 = p1->next;\n  }\n\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      tem = 'A' + i;\n    }\n  }\n  cout << tem << \"\\n\";\n  p1 = head;\n  int u = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      if (p1->ren[j] == tem) {\n        strcpy(b[u], p1->num);\n        u++;\n      }\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", u);\n\n  for (i = 0; i < u; i++) {\n    cout << b[i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "1911", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int bkn, m = 1, n, i, j;\n  char bka[30];\n\n  struct author {\n    int num;\n    int p[200];\n  } a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i < 27; i++)\n    a[i].num = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bkn, bka);\n    for (j = 0; j < strlen(bka); j++) {\n      a[bka[j] - 64].num++;\n      a[bka[j] - 64].p[a[bka[j] - 64].num - 1] = bkn;\n    }\n  }\n  for (i = 2; i < 27; i++)\n    if (a[i].num > a[m].num)\n      m = i;\n  printf(\"%c\\n%d\\n\", m + 64, a[m].num);\n  for (i = 0; i < a[m].num; i++)\n    printf(\"%d\\n\", a[m].p[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "1912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld %s\", &p1->num, p1->str);\n  head = 0;\n  while (p1->num != 0) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->str);\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x = 1, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 64]++;\n    }\n  }\n  max = sum[1];\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 64)\n        a[y] = p->num;\n    y++;\n  }\n  printf(\"%c\\n%d\\n\", x + 64, max);\n  for (y = 1; y <= 99; y++)\n    if (a[y] != 0)\n      printf(\"%d\\n\", a[y]);\n}\n"}
{"label": "2", "index": "1913", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char zz[26];\n} b[999];\nint main() {\n  int m, n, i, num[26] = {0}, maxz, j;\n  char string[26];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i].id >> b[i].zz;\n    for (j = 0; b[i].zz[j] != '\\0'; j++)\n      num[b[i].zz[j] - 'A']++;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++)\n    if (max < num[i]) {\n      max = num[i];\n      maxz = i;\n    }\n  printf(\"%c\\n%d\", maxz + 65, max);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].zz[j] != '\\0'; j++) {\n      if (b[i].zz[j] == maxz + 65)\n        printf(\"\\n%d\", b[i].id);\n      else\n        continue;\n    }\n}\n"}
{"label": "2", "index": "1914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char book[1000][30];\n  int n, i, j, k, r, len[1000], a[26][1000] = {0}, b[26] = {0}, max, s, c[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n; i++) {\n\n    cin >> book[i];\n    scanf(\"\\n\");\n  }\n  for (i = 0; i <= n; i++)\n    for (j = 0; book[i][j] != ' '; j++)\n      len[i] = j;\n  for (k = 0; k < 26; k++) {\n    r = 0;\n    for (i = 0; i <= n; i++) {\n      for (j = len[i] + 1; j < strlen(book[i]); j++) {\n        if (book[i][j] == k + 65) {\n          b[k]++;\n          a[k][r] = i;\n          r++;\n        }\n      }\n    }\n    c[k] = r;\n  }\n  max = b[0];\n  for (i = 1; i < 26; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n      s = i;\n    }\n  }\n  printf(\"%c\\n\", s + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < c[s]; i++) {\n    for (j = 0; j <= len[a[s][i]]; j++)\n      printf(\"%c\", book[a[s][i]][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "2", "index": "1915", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n};\nstruct name {\n  char na;\n  int n;\n};\nint main() {\n  int n, i, j, k, s, max = 0;\n  struct book a[1000];\n  struct name b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i].num >> a[i].name;\n  }\n  for (i = 0; i <= 25; i++) {\n    b[i].na = 'A' + i;\n    for (j = 0, s = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n        if (b[i].na == a[j].name[k]) {\n          s++;\n          break;\n        }\n      }\n    }\n    b[i].n = s;\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n > max) {\n      max = b[i].n;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n == max) {\n      printf(\"%c\\n%d\\n\", b[i].na, b[i].n);\n      for (j = 0; j <= n - 1; j++) {\n        for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n          if (b[i].na == a[j].name[k]) {\n            printf(\"%d\\n\", a[j].num);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  char writter[27];\n  int data[26][1000];\n  memset(data, 0, sizeof(data));\n  int max = 0;\n  char max_name;\n  for (int i = 1; i <= m; i++) {\n    int number;\n    cin >> number >> writter;\n    for (int j = 0; j < strlen(writter); j++) {\n      data[writter[j] - 65][0]++;\n      data[writter[j] - 65][data[writter[j] - 65][0]] = number;\n      if (max < data[writter[j] - 65][0]) {\n        max = data[writter[j] - 65][0];\n        max_name = writter[j];\n      }\n    }\n  }\n  cout << max_name << endl << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << data[max_name - 65][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "1917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[27];\n} book[100];\nint main() {\n  int n, i, k, sz[26], t, m, e;\n  scanf(\"%d\", &n);\n  m = 0;\n  for (i = 0; i < 26; i++) {\n    sz[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].author);\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      sz[book[i].author[k] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sz[i] > m) {\n      m = sz[i];\n      e = i;\n    }\n  }\n  cout << e + 'A' << \"\\n\" << m << \"\\n\";\n  for (i = 0; i < n; i++) {\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      if (book[i].author[k] == e + 'A') {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int b[1000];\n  char s[1000][26];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i], &s[i]);\n  }\n  int a[26] = {0};\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      switch (s[i][j]) {\n      case 'A':\n        a[0] = a[0] + 1;\n        break;\n      case 'B':\n        a[1] = a[1] + 1;\n        break;\n      case 'C':\n        a[2] = a[2] + 1;\n        break;\n      case 'D':\n        a[3] = a[3] + 1;\n        break;\n      case 'E':\n        a[4] = a[4] + 1;\n        break;\n      case 'F':\n        a[5] = a[5] + 1;\n        break;\n      case 'G':\n        a[6] = a[6] + 1;\n        break;\n      case 'H':\n        a[7] = a[7] + 1;\n        break;\n      case 'I':\n        a[8] = a[8] + 1;\n        break;\n      case 'J':\n        a[9] = a[9] + 1;\n        break;\n      case 'K':\n        a[10] = a[10] + 1;\n        break;\n      case 'L':\n        a[11] = a[11] + 1;\n        break;\n      case 'M':\n        a[12] = a[12] + 1;\n        break;\n      case 'N':\n        a[13] = a[13] + 1;\n        break;\n      case 'O':\n        a[14] = a[14] + 1;\n        break;\n      case 'P':\n        a[15] = a[15] + 1;\n        break;\n      case 'Q':\n        a[16] = a[16] + 1;\n        break;\n      case 'R':\n        a[17] = a[17] + 1;\n        break;\n      case 'S':\n        a[18] = a[18] + 1;\n        break;\n      case 'T':\n        a[19] = a[19] + 1;\n        break;\n      case 'U':\n        a[20] = a[20] + 1;\n        break;\n      case 'V':\n        a[21] = a[21] + 1;\n        break;\n      case 'W':\n        a[22] = a[22] + 1;\n        break;\n      case 'X':\n        a[23] = a[23] + 1;\n        break;\n      case 'Y':\n        a[24] = a[24] + 1;\n        break;\n      default:\n        a[25] = a[25] + 1;\n      }\n    }\n  }\n  int m;\n  char z;\n  m = a[0], z = c[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > m)\n      m = a[i], z = c[i];\n  }\n  printf(\"%c\\n%d\\n\", z, m);\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == z) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1919", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar f(int y);\n\nint main() {\n  int m, i, j, number[1000], auther[26], total = 0;\n  char name[1000][27];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &number[i], name[i]);\n    int n;\n    n = strlen(name[i]);\n    for (j = 0; j < n; j++) {\n      switch (name[i][j]) {\n      case 'A':\n        auther[0]++;\n        break;\n      case 'B':\n        auther[1]++;\n        break;\n      case 'C':\n        auther[2]++;\n        break;\n      case 'D':\n        auther[3]++;\n        break;\n      case 'E':\n        auther[4]++;\n        break;\n      case 'F':\n        auther[5]++;\n        break;\n      case 'G':\n        auther[6]++;\n        break;\n      case 'H':\n        auther[7]++;\n        break;\n      case 'I':\n        auther[8]++;\n        break;\n      case 'J':\n        auther[9]++;\n        break;\n      case 'K':\n        auther[10]++;\n        break;\n      case 'L':\n        auther[11]++;\n        break;\n      case 'M':\n        auther[12]++;\n        break;\n      case 'N':\n        auther[13]++;\n        break;\n      case 'O':\n        auther[14]++;\n        break;\n      case 'P':\n        auther[15]++;\n        break;\n      case 'Q':\n        auther[16]++;\n        break;\n      case 'R':\n        auther[17]++;\n        break;\n      case 'S':\n        auther[18]++;\n        break;\n      case 'T':\n        auther[19]++;\n        break;\n      case 'U':\n        auther[20]++;\n        break;\n      case 'V':\n        auther[21]++;\n        break;\n      case 'W':\n        auther[22]++;\n        break;\n      case 'X':\n        auther[23]++;\n        break;\n      case 'Y':\n        auther[24]++;\n        break;\n      case 'Z':\n        auther[25]++;\n        break;\n      }\n    }\n  }\n  int max = auther[0], k, t = 0;\n  for (k = 1; k < 26; k++) {\n    if (auther[k] > max) {\n      max = auther[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", f(t));\n  for (i = 0; i < m; i++) {\n    int q;\n    q = strlen(name[i]);\n    for (j = 0; j < q; j++) {\n      if (name[i][j] == f(t))\n        total++;\n    }\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i < m; i++) {\n    int p;\n    p = strlen(name[i]);\n    for (j = 0; j < p; j++) {\n      if (name[i][j] == f(t))\n        printf(\"%d\\n\", number[i]);\n    }\n  }\n  return 0;\n}\n\nchar f(int y) {\n  char x;\n  switch (y) {\n  case 0:\n    x = 'A';\n    break;\n  case 1:\n    x = 'B';\n    break;\n  case 2:\n    x = 'C';\n    break;\n  case 3:\n    x = 'D';\n    break;\n  case 4:\n    x = 'E';\n    break;\n  case 5:\n    x = 'F';\n    break;\n  case 6:\n    x = 'G';\n    break;\n  case 7:\n    x = 'H';\n    break;\n  case 8:\n    x = 'I';\n    break;\n  case 9:\n    x = 'J';\n    break;\n  case 10:\n    x = 'K';\n    break;\n  case 11:\n    x = 'L';\n    break;\n  case 12:\n    x = 'M';\n    break;\n  case 13:\n    x = 'N';\n    break;\n  case 14:\n    x = 'O';\n    break;\n  case 15:\n    x = 'P';\n    break;\n  case 16:\n    x = 'Q';\n    break;\n  case 17:\n    x = 'R';\n    break;\n  case 18:\n    x = 'S';\n    break;\n  case 19:\n    x = 'T';\n    break;\n  case 20:\n    x = 'U';\n    break;\n  case 21:\n    x = 'V';\n    break;\n  case 22:\n    x = 'W';\n    break;\n  case 23:\n    x = 'X';\n    break;\n  case 24:\n    x = 'Y';\n    break;\n  case 25:\n    x = 'Z';\n    break;\n  }\n  return x;\n}\n"}
{"label": "2", "index": "1920", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s = 0, n, i, j, b[26] = {0}, t, x, m, q;\n  char a[1000][27];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      x = a[i][j];\n      b[x - 65] = b[x - 65] + 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > s) {\n      s = b[i];\n      x = i;\n    }\n  }\n  printf(\"%c \", x + 65);\n  printf(\"%d \", s);\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      m = a[i][j];\n      if (m == x + 65) {\n        for (q = 0; q < 2; q++) {\n          printf(\"%c\", a[i][q]);\n        }\n        printf(\"%c \", a[i][2]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[26];\n\n} stu[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, max, k, l = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> stu[i].num >> stu[i].s;\n  for (i = 0; i < 26; i++)\n    for (k = 0; k < m; k++)\n      for (j = 0; j < strlen(stu[k].s); j++)\n        if (stu[k].s[j] == 'A' + i)\n          a[i]++;\n\n  max = a[0];\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", 'A' + l);\n  cout << max << \"\\n\";\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(stu[i].s); j++)\n      if (stu[i].s[j] == 'A' + l) {\n        cout << stu[i].num << \"\\n\";\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num[1000], l[1000], count[128], m, max;\n  char edi[1000][26], au[128];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &num[j]);\n\n    cin >> edi[j];\n    l[j] = strlen(edi[j]);\n  }\n  for (i = 0; i < 128; i++)\n    count[i] = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      m = edi[j][i];\n      au[m] = edi[j][i];\n      count[m]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 128; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\", au[m], max);\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      if (edi[j][i] == au[m])\n        printf(\"\\n%d\", num[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1923", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(void) {\n  struct stu *p1, *p2, *head;\n  int m;\n  scanf(\"%d\", &m);\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  head = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid print(struct stu *head, int z) {\n  struct stu *q;\n  int i, k;\n  char s[20], s0[20] = {'\\0'};\n  q = head;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++)\n      if (s[i] == z + 65) {\n        printf(\"%d\\n\", q->num);\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n}\n\nint main() {\n  int index;\n  int a[26], k, t, i, max = 0;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  head = create();\n  p = head;\n\n  while (p) {\n    strcpy(s, p->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++) {\n      t = s[i] - 65;\n      a[t]++;\n    }\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      index = i;\n    }\n  printf(\"%c\\n%d\\n\", index + 65, max);\n  print(head, index);\n}\n"}
{"label": "2", "index": "1924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  char id[10];\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, k, n, num, max = 0;\n  char maxname;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].id);\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    n = 0;\n    for (j = 0; j < num; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[j].name[k] == ('A' + i))\n          n += 1;\n      }\n    }\n    if (n > max) {\n      maxname = 'A' + i;\n      max = n;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxname, max);\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < 26; k++) {\n      if (book[j].name[k] == maxname)\n        printf(\"%s\\n\", book[j].id);\n      ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, b[1000], a[26] = {0}, max;\n  char str[1000][30];\n  int i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], str[i]);\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      t = str[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  t = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      t = i;\n    }\n  }\n  cout << 'A' + t << \"\\n\";\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] == 'A' + t)\n        cout << b[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int number;\n  char author[26];\n} b[100];\nint main() {\n  int L[26] = {0};\n  int n = 0;\n  int max = 0;\n  int p = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> b[i].number;\n    cin >> b[i].author;\n    for (int j = 0; b[i].author[j] != '\\0'; j++)\n      L[b[i].author[j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < L[i]) {\n      p = i;\n      max = L[i];\n    }\n  cout << (char)(p + 'A') << endl;\n  cout << max << endl;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] - p == 'A') {\n        cout << b[i].number << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0}, no[27][1000] = {0};\n  char s[27], ls;\n  int l, i, max, t, j, flag, n, w;\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n    cin >> n >> s;\n    l = strlen(s);\n    for (j = 0; j <= l - 1; j++) {\n      w = s[j] - 'A' + 1;\n      num[w]++;\n      no[w][num[w]] = n;\n    }\n  }\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      flag = i;\n    }\n  ls = (char)64 + flag;\n  cout << ls << \"\\n\" << num[flag] << \"\\n\";\n  for (i = 1; i <= num[flag]; i++)\n    cout << no[flag][i] << endl;\n  cin >> w;\n  return 0;\n}\n"}
{"label": "2", "index": "1928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, max = -1;\n  int c[26];\n  char prname;\n  struct list {\n    int num;\n    char writer[27];\n    int len;\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n\n    cin >> book[i].writer;\n    book[i].len = strlen(book[i].writer);\n  }\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < book[i].len; j++) {\n      switch (book[i].writer[j]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n    else\n      continue;\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] != max)\n      continue;\n    else {\n      prname = i + 65;\n      printf(\"%c \", prname);\n      printf(\"%d \", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < book[j].len; k++) {\n          if (book[j].writer[k] != prname)\n            continue;\n          else {\n            printf(\"%d \", book[j].num);\n            break;\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int nam;\n  char aut[27];\n} inf[1000];\nint main() {\n  int n, i, a[26] = {0}, k, max = 0, sum = 0;\n  char *p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &inf[i].nam, inf[i].aut);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      a[*p - 65]++;\n      p++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    max = max > a[i] ? max : a[i];\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      cout << i + 65 << \"\\n\";\n      break;\n    }\n  }\n  k = i + 65;\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        sum++;\n        break;\n      }\n      p++;\n    }\n  }\n  printf(\"%d\\n\", sum);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        printf(\"%d\\n\", inf[i].nam);\n        break;\n      }\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1930", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  printf(\"%c\\n%d\\n\", m, cnt[m]);\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "1931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, x, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct lib {\n  int num;\n  char author[26];\n} book[1000];\nint main() {\n  int n, i, k, p, e;\n  e = 0;\n  int tol[1000] = {0};\n  int own[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &(book[i].num), book[i].author);\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (p = 0; p <= 25; p++) {\n        if (k == book[i].author[p]) {\n          tol[k]++;\n          own[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (tol[i] > e) {\n      e = tol[i];\n    }\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    if (tol[k] == e) {\n      printf(\"%c\\n%d\\n\", k, tol[k]);\n      for (p = 0; p <= n - 1; p++) {\n        if (own[k][p] != 0) {\n          printf(\"%d\\n\", own[k][p]);\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(int m) {\n  struct stu *p1, *p2, *xhead;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  xhead = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nint stas(int b[]) {\n  int j, max = 0, indexx = 0;\n  for (j = 0; j < 26; j++)\n    if (b[j] > max) {\n      max = b[j];\n      indexx = j;\n    }\n  printf(\"%c\\n%d\\n\", indexx + 65, max);\n\n  return indexx;\n}\n\nstruct stu *search(struct stu *yhead, int y) {\n  struct stu *q;\n  int sum = 0, k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = yhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < i + k; i++)\n      if (*i == y + 65)\n        sum++;\n    strcpy(s, s0);\n    q = q->next;\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n\nstruct stu *print(struct stu *zhead, int z) {\n  struct stu *q;\n  int k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = zhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < s + k; i++) {\n      if (*i == z + 65) {\n        printf(\"%d\\n\", q->num);\n        break;\n      }\n    }\n    strcpy(s, s0);\n    q = q->next;\n  }\n  return 0;\n}\n\nint main() {\n  int n, index;\n  int a[26], k, t, i;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  scanf(\"%d\", &n);\n  head = create(n);\n  p = head;\n  while (p) {\n    strcpy(s, p->c);\n\n    k = strlen(s);\n\n    for (i = 0; i < k; i++) {\n\n      t = s[i] - 65;\n      a[t]++;\n    }\n\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  index = stas(a);\n\n  print(head, index);\n  return 0;\n}\n"}
{"label": "2", "index": "1934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, num[1000], i, k, l = 0, a[26] = {0};\n  char nam[1000][10], j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &num[i], nam[i]);\n  for (j = 'A'; j <= 'Z'; j++)\n    for (i = 0; i < m; i++)\n      if (strchr(nam[i], j))\n        a[j - 65]++;\n  for (i = 0, k = a[0]; i < 26; i++)\n    if (a[i] > k) {\n      k = a[i];\n      l = i;\n    }\n  cout << l + 65 << \"\\n\";\n  printf(\"%d\\n\", k);\n  for (i = 0; i < m; i++) {\n    if (strchr(nam[i], l + 65))\n      printf(\"%d\\n\", num[i]);\n  }\n}\n"}
{"label": "2", "index": "1935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  char name[26];\n  int a;\n};\nint main() {\n  int n, i, k, l, m;\n  char j, t;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  struct Student stu[999];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].a >> stu[i].name;\n  }\n  for (j = 'A', k = 0; j <= 'Z'; j++, k++)\n    for (i = 0; i < n; i++)\n      for (l = 0; l < 26; l++)\n        if (stu[i].name[l] == j)\n          b[k]++;\n  for (j = 'A', k = 0, m = 0; j <= 'Z'; j++, k++)\n    if (b[k] > m) {\n      m = b[k];\n      t = j;\n    }\n  printf(\"%c\\n%d\", t, m);\n  for (i = 0; i < n; i++)\n    for (l = 0; l < 26; l++)\n      if (stu[i].name[l] == t)\n        printf(\"\\n%d\", stu[i].a);\n  return 0;\n}\n"}
{"label": "2", "index": "1937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int s = 0, n, i, j, b[26] = {0}, t, x, m, q;\n  char a[1000][27];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      x = a[i][j];\n      b[x - 65] = b[x - 65] + 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > s) {\n      s = b[i];\n      x = i;\n    }\n  }\n  printf(\"%c \", x + 65);\n  printf(\"%d \", s);\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      m = a[i][j];\n      if (m == x + 65) {\n        for (q = 0; q < 2; q++) {\n          printf(\"%c\", a[i][q]);\n        }\n        printf(\"%c \", a[i][2]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nstruct stu {\n  int num;\n  char name[27];\n  struct stu *next;\n};\n\nstruct stu *creat() {\n  int i = 0;\n  struct stu *head, *p1, *p2;\n  head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p2->num, p2->name);\n  while (i < n - 1) {\n    i++;\n    p2 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %s\", &p2->num, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  return head;\n}\n\nint main() {\n  struct stu *p, *head;\n  int k, u, max = 0, maxnum;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  head = p = creat();\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      a[p->name[u] - 'A']++;\n    p = p->next;\n  }\n  for (k = 0; k < 26; k++)\n    if (a[k] > max) {\n      max = a[k];\n      maxnum = k;\n    }\n  cout << maxnum + 'A' << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      if (p->name[u] == maxnum + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "1939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char zhuzhe[26];\n  int let;\n};\n\nstruct book shu[1000];\n\nint judge(char a, char b) {\n  if (a == b)\n    return (1);\n  else\n    return (0);\n}\n\nint main() {\n  int n, i, j, y, zhi, num;\n  char writer1[26] = {0};\n  char writer2[26] = {0};\n\n  for (i = 0; i < 26; i++)\n    writer2[i] = i + 65;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shu[i].num);\n\n    cin >> shu[i].zhuzhe;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      for (y = 0; y < 26; y++)\n        if (writer2[y] == shu[i].zhuzhe[j])\n          writer1[y] = writer1[y] + 1;\n  zhi = 0;\n  num = 0;\n  for (i = 0; i < 26; i++)\n    if (writer1[i] > zhi) {\n      zhi = writer1[i];\n      num = i;\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      if (judge(shu[i].zhuzhe[j], writer2[num]) == 1)\n        shu[i].let = 1;\n\n  printf(\"%c \", writer2[num]);\n  printf(\"%c \", writer1[num]);\n  for (i = 0; i < n - 1; i++)\n    if (shu[i].let == 1)\n      printf(\"%d \", shu[i].num);\n  if (shu[n - 1].let == 1)\n    cout << shu[n - 1].num;\n}\n"}
{"label": "2", "index": "1940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct {\n    int name;\n    char author[26];\n  } book[999];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].name, book[i].author);\n  }\n\n  char t, tmax;\n  int max = 0, j, k;\n  for (t = 'A'; t <= 'Z'; t++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(book[i].author); j++) {\n        if (book[i].author[j] == t) {\n          k++;\n        }\n      }\n    }\n    if (k > max) {\n      max = k;\n      tmax = t;\n    }\n  }\n  printf(\"%c\\n%d\\n\", tmax, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == tmax) {\n        printf(\"%d\\n\", book[i].name);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char peo[26];\n} book1[999];\nint main() {\n  int n, i, j, m = 0, num[26] = {0}, length, max = 0, t;\n  char author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book1[i].id >> book1[i].peo;\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      num[(int)(book1[i].peo[j] - 'A')]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      t = i;\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, num[t]);\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      if (book1[i].peo[j] == author) {\n        printf(\"%d\\n\", book1[i].id);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct chain {\n  int num;\n  char name[27];\n  struct chain *next;\n};\nint main() {\n  int a[26] = {0}, m, i, j, k, max = 0, n;\n  struct chain *p1, *p2, *head;\n  scanf(\"%d\", &m);\n  p2 = head = (struct chain *)malloc(1000);\n  for (k = 0; k < 27; k++)\n    head->name[k] = 0;\n  scanf(\"%d%s\", &head->num, &head->name);\n  for (k = 0; k < strlen(head->name); k++) {\n    if (head->name[k] >= 65 && head->name[k] <= 90)\n      a[head->name[k] - 65]++;\n  }\n  for (j = 0; j < m - 1; j++) {\n    p1 = (struct chain *)malloc(1000);\n    p2->next = p1;\n    for (k = 0; k < 27; k++)\n      p1->name[k] = 0;\n    scanf(\"%d%s\", &p1->num, &p1->name);\n    p2 = p1;\n    for (k = 0; k < strlen(p1->name); k++) {\n      if (p1->name[k] >= 65 && p1->name[k] <= 90)\n        a[p1->name[k] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      n = i;\n    }\n  }\n  printf(\"%c %d \", n + 65, max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p1->name[j] == (n + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1943", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct book {\n    int num;\n    char author[27];\n  } B[1000];\n  char A;\n  int m, i, j, a[26] = {0}, max;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &B[i].num, B[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      else\n        a[B[i].author[j] - 65]++;\n    }\n  }\n  max = a[0];\n  A = 65;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      A = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\", A, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      if (B[i].author[j] == A)\n        printf(\"\\n%d\", B[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1944", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char number[100];\n  char name[100];\n  struct student *next;\n};\nint n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %s\", &p1->number, &p1->name);\n  head = NULL;\n  do {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %s\", &p1->number, &p1->name);\n  } while (i < n - 1);\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int h, i, k, m, j, max;\n  struct student *head;\n  struct student *p;\n  int sum[10000] = {0};\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  for (i = 65, k = 0; i <= 90; i++, k++) {\n    p = head;\n    do {\n      m = strlen(p->name);\n      for (j = 0; j < m; j++) {\n        if (p->name[j] == i)\n          sum[k]++;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  for (i = 0, max = sum[0]; i <= k; i++) {\n    if (sum[i] >= max) {\n      h = i;\n      max = sum[i];\n    }\n  }\n  printf(\"%c %d \", h + 65, max);\n  p = head;\n  do {\n    m = strlen(p->name);\n    for (j = 0; j < m; j++) {\n      if (p->name[j] == h + 65)\n        printf(\"%s \", p->number);\n    }\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "2", "index": "1945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j;\n  char a = 'A';\n  int count[27] = {0};\n  int *p = &count[1];\n  scanf(\"%d\", &num);\n  struct book {\n    char order[4];\n    char author[26];\n  } book[1000];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].order);\n    cin >> book[i].author;\n  }\n  for (i = 0; i < num; i++) {\n    int m = strlen(book[i].author);\n    for (j = 0; j < m; j++) {\n      if (book[i].author[j] == 'A')\n        count[1]++;\n      if (book[i].author[j] == 'B')\n        count[2]++;\n      if (book[i].author[j] == 'C')\n        count[3]++;\n      if (book[i].author[j] == 'D')\n        count[4]++;\n      if (book[i].author[j] == 'E')\n        count[5]++;\n      if (book[i].author[j] == 'F')\n        count[6]++;\n      if (book[i].author[j] == 'G')\n        count[7]++;\n      if (book[i].author[j] == 'H')\n        count[8]++;\n      if (book[i].author[j] == 'I')\n        count[9]++;\n      if (book[i].author[j] == 'J')\n        count[10]++;\n      if (book[i].author[j] == 'K')\n        count[11]++;\n      if (book[i].author[j] == 'L')\n        count[12]++;\n      if (book[i].author[j] == 'M')\n        count[13]++;\n      if (book[i].author[j] == 'N')\n        count[14]++;\n      if (book[i].author[j] == 'O')\n        count[15]++;\n      if (book[i].author[j] == 'P')\n        count[16]++;\n      if (book[i].author[j] == 'Q')\n        count[17]++;\n      if (book[i].author[j] == 'R')\n        count[18]++;\n      if (book[i].author[j] == 'S')\n        count[19]++;\n      if (book[i].author[j] == 'T')\n        count[20]++;\n      if (book[i].author[j] == 'U')\n        count[21]++;\n      if (book[i].author[j] == 'V')\n        count[22]++;\n      if (book[i].author[j] == 'W')\n        count[23]++;\n      if (book[i].author[j] == 'X')\n        count[24]++;\n      if (book[i].author[j] == 'Y')\n        count[25]++;\n      if (book[i].author[j] == 'Z')\n        count[26]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (count[i] > *p) {\n      p = &count[i];\n      a = i + 64;\n    }\n  }\n  cout << a << \"\\n\" << *p << \"\\n\";\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == a)\n        printf(\"%s\\n\", book[i].order);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[28];\n} bo[1000];\nint main() {\n  int i, j, k, n, a, b;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num >> bo[i].writer;\n  }\n  for (i = 'Z'; i >= 'A'; i--) {\n    a = 0;\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < 27; j++) {\n        if (bo[k].writer[j] == i) {\n          a++;\n        }\n      }\n    }\n    if (a > max) {\n      max = a;\n      b = i;\n    }\n  }\n  cout << b << \"\\n\" << max << \"\\n\";\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 28; i++) {\n      if (bo[j].writer[i] == b) {\n        printf(\"%d\\n\", bo[j].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char z[30];\n  int n;\n} s[1000];\nstruct {\n  int name;\n  int nb, b[1000], k;\n} r[93];\n\nint main() {\n  int m, i, j, l, q;\n\n  for (i = 65; i <= 90; i++) {\n    r[i].name = i;\n    r[i].k = 1;\n  }\n\n  scanf(\"%d\", &m);\n\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &s[i].n, s[i].z);\n    l = strlen(s[i].z);\n    for (j = 0; j < l; j++) {\n      q = s[i].z[j];\n      r[q].nb++;\n      r[q].b[r[q].k] = s[i].n;\n      r[q].k++;\n    }\n  }\n\n  for (i = 65; i < 90; i++)\n    for (j = 90; j > i; j--)\n      if (r[j].nb > r[j - 1].nb) {\n        r[92] = r[j];\n        r[j] = r[j - 1];\n        r[j - 1] = r[92];\n      }\n  cout << r[65].name << \"\\n\" << r[65].nb << \"\\n\";\n\n  for (i = 1; i <= r[65].nb; i++)\n    printf(\"%d\\n\", r[65].b[i]);\n}\n"}
{"label": "2", "index": "1948", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  };\n\n  cin >> n;\n\n  struct data *input = (struct data *)malloc(sizeof(struct data) * n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &input[i].number, input[i].author);\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n\n  free(input);\n\n  return 0;\n}\n"}
{"label": "2", "index": "1949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar f(int y);\n\nint main() {\n  int m, i, j, number[1000], auther[26], total = 0;\n  char name[1000][27];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &number[i], name[i]);\n    int n;\n    n = strlen(name[i]);\n    for (j = 0; j < n; j++) {\n      switch (name[i][j]) {\n      case 'A':\n        auther[0]++;\n        break;\n      case 'B':\n        auther[1]++;\n        break;\n      case 'C':\n        auther[2]++;\n        break;\n      case 'D':\n        auther[3]++;\n        break;\n      case 'E':\n        auther[4]++;\n        break;\n      case 'F':\n        auther[5]++;\n        break;\n      case 'G':\n        auther[6]++;\n        break;\n      case 'H':\n        auther[7]++;\n        break;\n      case 'I':\n        auther[8]++;\n        break;\n      case 'J':\n        auther[9]++;\n        break;\n      case 'K':\n        auther[10]++;\n        break;\n      case 'L':\n        auther[11]++;\n        break;\n      case 'M':\n        auther[12]++;\n        break;\n      case 'N':\n        auther[13]++;\n        break;\n      case 'O':\n        auther[14]++;\n        break;\n      case 'P':\n        auther[15]++;\n        break;\n      case 'Q':\n        auther[16]++;\n        break;\n      case 'R':\n        auther[17]++;\n        break;\n      case 'S':\n        auther[18]++;\n        break;\n      case 'T':\n        auther[19]++;\n        break;\n      case 'U':\n        auther[20]++;\n        break;\n      case 'V':\n        auther[21]++;\n        break;\n      case 'W':\n        auther[22]++;\n        break;\n      case 'X':\n        auther[23]++;\n        break;\n      case 'Y':\n        auther[24]++;\n        break;\n      case 'Z':\n        auther[25]++;\n        break;\n      }\n    }\n  }\n  int max = auther[0], k, t = 0;\n  for (k = 1; k < 26; k++) {\n    if (auther[k] > max) {\n      max = auther[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", f(t));\n  for (i = 0; i < m; i++) {\n    int q;\n    q = strlen(name[i]);\n    for (j = 0; j < q; j++) {\n      if (name[i][j] == f(t))\n        total++;\n    }\n  }\n  cout << total << \"\\n\";\n  for (i = 0; i < m; i++) {\n    int p;\n    p = strlen(name[i]);\n    for (j = 0; j < p; j++) {\n      if (name[i][j] == f(t))\n        printf(\"%d\\n\", number[i]);\n    }\n  }\n  return 0;\n}\n\nchar f(int y) {\n  char x;\n  switch (y) {\n  case 0:\n    x = 'A';\n    break;\n  case 1:\n    x = 'B';\n    break;\n  case 2:\n    x = 'C';\n    break;\n  case 3:\n    x = 'D';\n    break;\n  case 4:\n    x = 'E';\n    break;\n  case 5:\n    x = 'F';\n    break;\n  case 6:\n    x = 'G';\n    break;\n  case 7:\n    x = 'H';\n    break;\n  case 8:\n    x = 'I';\n    break;\n  case 9:\n    x = 'J';\n    break;\n  case 10:\n    x = 'K';\n    break;\n  case 11:\n    x = 'L';\n    break;\n  case 12:\n    x = 'M';\n    break;\n  case 13:\n    x = 'N';\n    break;\n  case 14:\n    x = 'O';\n    break;\n  case 15:\n    x = 'P';\n    break;\n  case 16:\n    x = 'Q';\n    break;\n  case 17:\n    x = 'R';\n    break;\n  case 18:\n    x = 'S';\n    break;\n  case 19:\n    x = 'T';\n    break;\n  case 20:\n    x = 'U';\n    break;\n  case 21:\n    x = 'V';\n    break;\n  case 22:\n    x = 'W';\n    break;\n  case 23:\n    x = 'X';\n    break;\n  case 24:\n    x = 'Y';\n    break;\n  case 25:\n    x = 'Z';\n    break;\n  }\n  return x;\n}\n"}
{"label": "2", "index": "1950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, mid, l = 0;\n  int d[26], e[26];\n  char c[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  head = p1 = p2 = (struct book *)malloc(1000);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &p1->a, p1->b);\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1 = head;\n  for (j = 0; j < 26; j++) {\n    p1 = head;\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if (p1->b[k] == c[j])\n          l++;\n      }\n      d[j] = l;\n      e[j] = l;\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++) {\n      if (d[j] < d[j + 1]) {\n        mid = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = mid;\n      }\n    }\n  for (i = 0; i < 26; i++) {\n    if (e[i] == d[0]) {\n      break;\n    }\n  }\n  printf(\"%c \", c[i]);\n  printf(\"%d \", d[0]);\n  p1 = head;\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < strlen(p1->b); k++) {\n      if (p1->b[k] == c[i])\n        cout << p1->a << \" \";\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int N;\n  int a[26] = {0};\n\n  struct book {\n    int x;\n    char y[27];\n  } A[1000];\n\n  scanf(\"%d\", &N);\n  int i, j;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%s\", &A[i].x, A[i].y);\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == 'A') {\n        a[0]++;\n      }\n\n      else if (A[i].y[j] == 'B') {\n        a[1]++;\n      } else if (A[i].y[j] == 'C') {\n        a[2]++;\n      } else if (A[i].y[j] == 'D') {\n        a[3]++;\n      } else if (A[i].y[j] == 'E') {\n        a[4]++;\n      } else if (A[i].y[j] == 'F') {\n        a[5]++;\n      } else if (A[i].y[j] == 'G') {\n        a[6]++;\n      } else if (A[i].y[j] == 'H') {\n        a[7]++;\n      } else if (A[i].y[j] == 'I') {\n        a[8]++;\n      } else if (A[i].y[j] == 'J') {\n        a[9]++;\n      } else if (A[i].y[j] == 'K') {\n        a[10]++;\n      } else if (A[i].y[j] == 'L') {\n        a[11]++;\n      } else if (A[i].y[j] == 'M') {\n        a[12]++;\n      } else if (A[i].y[j] == 'N') {\n        a[13]++;\n      } else if (A[i].y[j] == 'O') {\n        a[14]++;\n      } else if (A[i].y[j] == 'P') {\n        a[15]++;\n      } else if (A[i].y[j] == 'Q') {\n        a[16]++;\n      } else if (A[i].y[j] == 'R') {\n        a[17]++;\n      } else if (A[i].y[j] == 'S') {\n        a[18]++;\n      } else if (A[i].y[j] == 'T') {\n        a[19]++;\n      } else if (A[i].y[j] == 'U') {\n        a[20]++;\n      } else if (A[i].y[j] == 'V') {\n        a[21]++;\n      } else if (A[i].y[j] == 'W') {\n        a[22]++;\n      } else if (A[i].y[j] == 'X') {\n        a[23]++;\n      } else if (A[i].y[j] == 'Y') {\n        a[24]++;\n      } else if (A[i].y[j] == 'Z') {\n        a[25]++;\n      }\n    }\n  }\n\n  int p;\n  int max;\n  p = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  char d;\n  d = ('A' + p);\n  printf(\"%c\\n%d\\n\", d, max);\n  for (i = 0; i < N; i++) {\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == (p + 'A'))\n        printf(\"%d\\n\", A[i].x);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nstruct stu {\n  int num;\n  char name[27];\n  struct stu *next;\n};\n\nstruct stu *creat() {\n  int i = 0;\n  struct stu *head, *p1, *p2;\n  head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p2->num, p2->name);\n  while (i < n - 1) {\n    i++;\n    p2 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %s\", &p2->num, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  return head;\n}\n\nint main() {\n  struct stu *p, *head;\n  int k, u, max = 0, maxnum;\n  int a[26] = {0};\n  cin >> n;\n  head = p = creat();\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      a[p->name[u] - 'A']++;\n    p = p->next;\n  }\n  for (k = 0; k < 26; k++)\n    if (a[k] > max) {\n      max = a[k];\n      maxnum = k;\n    }\n  printf(\"%d\\n%d\\n\", maxnum + 'A', max);\n  p = head;\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      if (p->name[u] == maxnum + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "1953", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, n, max, l, y = 0;\n  struct book {\n    int num;\n    char aut[26];\n  } book[1000];\n  int a[26] = {0};\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'z'};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].aut);\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      l = strlen(book[j].aut);\n      for (k = 0; k < l; k++) {\n        if (book[j].aut[k] == b[i]) {\n          a[i]++;\n        }\n      }\n    }\n  }\n\n  for (i = m; i > 0; i--) {\n    for (j = 0; j < 26; j++) {\n      if (a[j] == i) {\n        max = a[j];\n        n = j;\n        printf(\"%c\\n\", b[j]);\n        printf(\"%d\\n\", a[j]);\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    l = strlen(book[i].aut);\n    for (j = 0; j < l; j++) {\n      if (book[i].aut[j] == b[n]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct a {\n  int number;\n  char author[26];\n} b[100];\nint main() {\n  int L[26] = {0};\n  int n = 0;\n  int max = 0;\n  int p = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> b[i].number;\n    cin >> b[i].author;\n    for (int j = 0; b[i].author[j] != '\\0'; j++)\n      L[b[i].author[j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < L[i]) {\n      p = i;\n      max = L[i];\n    }\n  cout << (char)(p + 'A') << endl;\n  printf(\"%d\\n\", max);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] - p == 'A') {\n        cout << b[i].number << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char p[26];\n};\nint main() {\n  int n, i, j, k, a[150] = {0}, flag, max = 0;\n  struct book t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &s[i].id, s[i].p);\n    for (j = 0; s[i].p[j] != '\\0'; j++)\n      a[s[i].p[j]]++;\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (max < a[i]) {\n      max = a[i];\n      j = i;\n    }\n  cout << j << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; s[i].p[k] != '\\0'; k++)\n      if (s[i].p[k] == j)\n        flag = 1;\n    if (flag == 1)\n      printf(\"%d\\n\", s[i].id);\n  }\n}\n"}
{"label": "2", "index": "1956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int no;\n  char wri[27];\n} book[1000];\n\nint main() {\n  int n, i, j, k = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].no, book[i].wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      a[book[i].wri[j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[0]) {\n      a[0] = a[i];\n      k = i;\n    }\n  printf(\"%d\\n%d\\n\", 'A' + k, a[0]);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      if (book[i].wri[j] == 'A' + k) {\n        printf(\"%d\\n\", book[i].no);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "1957", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int book[1000], m, i, j, k, length, max = 0, name[500] = {0};\n  char writer[1000][26], name1;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> book[i] >> writer[i];\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i < m; i++) {\n      length = strlen(writer[i]);\n      for (j = 0; j < length; j++)\n        if (writer[i][j] == k)\n          name[k]++;\n    }\n    if (name[k] > max) {\n      max = name[k];\n      name1 = k;\n    }\n  }\n  cout << name1 << endl;\n  cout << max << endl;\n  for (i = 0; i <= m; i++) {\n    length = strlen(writer[i]);\n    for (j = 0; j <= length; j++)\n      if (writer[i][j] == name1)\n        cout << book[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct books {\n  int num;\n  char author[27];\n} book[999];\nint main() {\n  int f(struct books * p, int n, char z);\n  int i, n, j, x[26], k, max;\n  char z;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].author);\n  for (z = 'A', i = 0; z <= 'Z'; z++, i++)\n    x[i] = f(book, n, z);\n  for (i = 1, max = x[0], k = 0; i < 26; i++)\n    if (x[i] > max) {\n      max = x[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].author[j] != '\\0'; j++)\n      if (book[i].author[j] == k + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n}\nint f(struct books *p, int n, char z) {\n  int m = 0, i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; (p + i)->author[j] != '\\0'; j++)\n      if ((p + i)->author[j] == z) {\n        m++;\n        break;\n      }\n  return m;\n}\n"}
{"label": "2", "index": "1959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int N;\n  int a[26] = {0};\n\n  struct book {\n    int x;\n    char y[27];\n  } A[1000];\n\n  cin >> N;\n  int i, j;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%s\", &A[i].x, A[i].y);\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == 'A') {\n        a[0]++;\n      }\n\n      else if (A[i].y[j] == 'B') {\n        a[1]++;\n      } else if (A[i].y[j] == 'C') {\n        a[2]++;\n      } else if (A[i].y[j] == 'D') {\n        a[3]++;\n      } else if (A[i].y[j] == 'E') {\n        a[4]++;\n      } else if (A[i].y[j] == 'F') {\n        a[5]++;\n      } else if (A[i].y[j] == 'G') {\n        a[6]++;\n      } else if (A[i].y[j] == 'H') {\n        a[7]++;\n      } else if (A[i].y[j] == 'I') {\n        a[8]++;\n      } else if (A[i].y[j] == 'J') {\n        a[9]++;\n      } else if (A[i].y[j] == 'K') {\n        a[10]++;\n      } else if (A[i].y[j] == 'L') {\n        a[11]++;\n      } else if (A[i].y[j] == 'M') {\n        a[12]++;\n      } else if (A[i].y[j] == 'N') {\n        a[13]++;\n      } else if (A[i].y[j] == 'O') {\n        a[14]++;\n      } else if (A[i].y[j] == 'P') {\n        a[15]++;\n      } else if (A[i].y[j] == 'Q') {\n        a[16]++;\n      } else if (A[i].y[j] == 'R') {\n        a[17]++;\n      } else if (A[i].y[j] == 'S') {\n        a[18]++;\n      } else if (A[i].y[j] == 'T') {\n        a[19]++;\n      } else if (A[i].y[j] == 'U') {\n        a[20]++;\n      } else if (A[i].y[j] == 'V') {\n        a[21]++;\n      } else if (A[i].y[j] == 'W') {\n        a[22]++;\n      } else if (A[i].y[j] == 'X') {\n        a[23]++;\n      } else if (A[i].y[j] == 'Y') {\n        a[24]++;\n      } else if (A[i].y[j] == 'Z') {\n        a[25]++;\n      }\n    }\n  }\n\n  int p;\n  int max;\n  p = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  char d;\n  d = ('A' + p);\n  printf(\"%c\\n%d\\n\", d, max);\n  for (i = 0; i < N; i++) {\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == (p + 'A'))\n        printf(\"%d\\n\", A[i].x);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, count[30] = {0}, num[30][1000] = {0};\n  scanf(\"%d \", &n);\n  while (n--) {\n    int no;\n    char c;\n    cin >> no;\n    cin.get();\n    while ((c = cin.get()) != '\\n') {\n      num[c - 'A'][count[c - 'A']++] = no;\n    }\n  }\n  int max = count[0], set = 0;\n  for (int i = 1; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      set = i;\n    }\n  }\n  cout << (char)(set + 'A') << endl << max << endl;\n  for (int i = 0; i < max; i++) {\n    printf(\"%d\\n\", num[set][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int n, i, j, a[26] = {0}, len[1000], k, max = 0;\n  struct book list[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> list[i].num;\n    scanf(\"%s\", list[i].name);\n    len[i] = strlen(list[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (list[j].name[k] == i + 65) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (list[i].name[j] == k + 65)\n        printf(\"%d\\n\", list[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint trans(char k) {\n  int i;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\nint main() {\n  struct books {\n    int n;\n    char w[27];\n  } * m;\n  int num, i, j;\n  scanf(\"%d\", &num);\n  m = (struct books *)malloc(sizeof(struct books) * num);\n  for (i = 0; i < num; i++) {\n\n    int N;\n    char W[27];\n    scanf(\"%d %s\", &N, W);\n    m[i].n = N;\n    strcpy(m[i].w, W);\n  }\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\n      c;\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      c = trans(m[i].w[j]);\n      b[c]++;\n    }\n  }\n  int max = 0;\n  char most;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      most = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", most, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      if (m[i].w[j] == most)\n        printf(\"%d\\n\", m[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct information {\n  int num;\n  char author[26];\n} * a;\nint main() {\n  int n, i, j, m, s[26] = {0}, max = 0, p;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].num, a[i].author);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      m = a[i].author[j] - 'A';\n      s[m]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < s[i]) {\n      max = s[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + p, s[p]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == 'A' + p) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int book;\n  char author[26];\n  struct a *next;\n};\nstruct a *creat(int m) {\n  int i = 0;\n  struct a *p, *head, *temp;\n  head = NULL;\n  do {\n    p = (struct a *)malloc(sizeof(struct a));\n    if (p == NULL) {\n      exit(1);\n    }\n    scanf(\"%d %s\", &p->book, p->author);\n    if (head == NULL) {\n      head = p;\n      temp = p;\n    } else {\n      temp->next = p;\n      temp = p;\n    }\n    i++;\n  } while (i < m);\n  temp->next = NULL;\n  return (head);\n}\nint main() {\n  int h, m, i, j, zimu[26] = {0};\n  struct a *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] >= 'A' && p->author[j] <= 'Z') {\n        zimu[p->author[j] - 'A']++;\n      }\n    }\n    p = p->next;\n  }\n  h = 0;\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > zimu[h]) {\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + h, zimu[h]);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] == 'A' + h) {\n        printf(\"%d\\n\", p->book);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], i, l, c[26] = {0}, k, max, n, j;\n  char b[100][26],\n      d[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      else if (b[i][j] == 'B')\n        c[1]++;\n      else if (b[i][j] == 'C')\n        c[2]++;\n      else if (b[i][j] == 'D')\n        c[3]++;\n      else if (b[i][j] == 'E')\n        c[4]++;\n      else if (b[i][j] == 'F')\n        c[5]++;\n      else if (b[i][j] == 'G')\n        c[6]++;\n      else if (b[i][j] == 'H')\n        c[7]++;\n      else if (b[i][j] == 'I')\n        c[8]++;\n      else if (b[i][j] == 'J')\n        c[9]++;\n      else if (b[i][j] == 'K')\n        c[10]++;\n      else if (b[i][j] == 'L')\n        c[11]++;\n      else if (b[i][j] == 'M')\n        c[12]++;\n      else if (b[i][j] == 'N')\n        c[13]++;\n      else if (b[i][j] == 'O')\n        c[14]++;\n      else if (b[i][j] == 'P')\n        c[15]++;\n      else if (b[i][j] == 'Q')\n        c[16]++;\n      else if (b[i][j] == 'R')\n        c[17]++;\n      else if (b[i][j] == 'S')\n        c[18]++;\n      else if (b[i][j] == 'T')\n        c[19]++;\n      else if (b[i][j] == 'U')\n        c[20]++;\n      else if (b[i][j] == 'V')\n        c[21]++;\n      else if (b[i][j] == 'W')\n        c[22]++;\n      else if (b[i][j] == 'X')\n        c[23]++;\n      else if (b[i][j] == 'Y')\n        c[24]++;\n      else if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  max = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] >= max) {\n      max = c[i];\n      k = i;\n    }\n  printf(\"%c\\n\", d[k]);\n  printf(\"%d\\n\", c[k]);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == d[k])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "1966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int number;\n  char author[26];\n  struct book *next;\n};\nint m, i;\nstruct book *creat(void) {\n  struct book *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  for (i = 1; i < m; i++) {\n    scanf(\"%d %s\", &p1->number, p1->author);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d %s\", &p1->number, p1->author);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int j, a[26] = {0}, max;\n  cin >> m;\n  head = creat();\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; i < strlen(p->author); i++)\n      switch (p->author[i]) {\n      case 'A':\n        a[0]++;\n        break;\n      case 'B':\n        a[1]++;\n        break;\n      case 'C':\n        a[2]++;\n        break;\n      case 'D':\n        a[3]++;\n        break;\n      case 'E':\n        a[4]++;\n        break;\n      case 'F':\n        a[5]++;\n        break;\n      case 'G':\n        a[6]++;\n        break;\n      case 'H':\n        a[7]++;\n        break;\n      case 'I':\n        a[8]++;\n        break;\n      case 'J':\n        a[9]++;\n        break;\n      case 'K':\n        a[10]++;\n        break;\n      case 'L':\n        a[11]++;\n        break;\n      case 'M':\n        a[12]++;\n        break;\n      case 'N':\n        a[13]++;\n        break;\n      case 'O':\n        a[14]++;\n        break;\n      case 'P':\n        a[15]++;\n        break;\n      case 'Q':\n        a[16]++;\n        break;\n      case 'R':\n        a[17]++;\n        break;\n      case 'S':\n        a[18]++;\n        break;\n      case 'T':\n        a[19]++;\n        break;\n      case 'U':\n        a[20]++;\n        break;\n      case 'V':\n        a[21]++;\n        break;\n      case 'W':\n        a[22]++;\n        break;\n      case 'X':\n        a[23]++;\n        break;\n      case 'Y':\n        a[24]++;\n        break;\n      case 'Z':\n        a[25]++;\n        break;\n      }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max) {\n      printf(\"%c \", 65 + i);\n      break;\n    }\n  cout << max << \" \";\n  for (p = head; p != NULL; p = p->next)\n    for (j = 0; j < strlen(p->author); j++)\n      if (p->author[j] == 65 + i)\n        printf(\"%d \", p->number);\n  return 0;\n}\n"}
{"label": "2", "index": "1967", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct aut {\n  char name;\n  int num;\n  int id[1000];\n};\n\nstruct aut author[26];\n\nint main() {\n  int m, i, j, ID, max = 0, maxauthor, k[26] = {0};\n  char c[27];\n  cin >> m;\n  for (i = 0; i < 26; i++) {\n    author[i].name = 'A' + i;\n    author[i].num = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &ID, c);\n    for (j = 0; c[j]; j++) {\n      author[c[j] - 'A'].id[k[c[j] - 'A']] = ID;\n      k[c[j] - 'A']++;\n      author[c[j] - 'A'].num++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i].num > max) {\n      max = author[i].num;\n      maxauthor = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author[maxauthor].name, author[maxauthor].num);\n  for (i = 0; i < author[maxauthor].num; i++) {\n    printf(\"%d\\n\", author[maxauthor].id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, len, i, j, book[1000], num[26] = {0}, k = 0, t, m = 0;\n  char w[1000][27], c = 'A';\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> w[i];\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      for (c = 'A', t = 0; c <= 'Z'; c++) {\n        if (w[i][j] == c) {\n          num[t]++;\n          break;\n        }\n        t++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > m) {\n      m = num[i];\n      k = i;\n    }\n  }\n  c = 'A' + k;\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", num[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      if (w[i][j] == c) {\n        cout << book[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1969", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct tushu {\n  int bianhao;\n  char writer[27];\n} book[1000];\nvoid jishu(struct tushu *p1, int a[26], int b);\nint max(int c[26]);\nvoid shu(struct tushu *p2, int d, int e);\n\nint main() {\n  int n, i, m;\n  int zimu[26];\n  struct tushu *pointer;\n  pointer = &book[0];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].bianhao, &book[i].writer);\n  }\n  jishu(pointer, zimu, n);\n  m = max(zimu);\n  shu(pointer, m, n);\n  return 0;\n}\nvoid jishu(struct tushu *p1, int a[26], int b) {\n  int j, k, diji;\n  for (j = 0; j < 26; j++) {\n    a[j] = 0;\n  }\n  for (j = 0; j < b; j++) {\n    k = 0;\n    do {\n      diji = (*(p1 + j)).writer[k] - 'A';\n      a[diji]++;\n      k++;\n    } while ((*(p1 + j)).writer[k] != '\\0');\n  }\n}\nint max(int c[26]) {\n  int k, da, jieguo = 0;\n  da = c[0];\n  for (k = 1; k < 26; k++) {\n    if (c[k] > da) {\n      da = c[k];\n      jieguo = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + jieguo, da);\n  return (jieguo);\n}\nvoid shu(struct tushu *p2, int d, int e) {\n  char ai = 65 + d;\n  int x, y;\n  for (x = 0; x < e; x++) {\n    y = 0;\n    do {\n      if ((*(p2 + x)).writer[y] == ai) {\n        printf(\"%d\\n\", (p2 + x)->bianhao);\n      }\n      y++;\n    } while ((*(p2 + x)).writer[y] != '\\0');\n  }\n}\n"}
{"label": "2", "index": "1970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\nstruct book *create(void) {\n  struct book *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->name;\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int num[26] = {0}, i, j, max = 0;\n  struct book *p1, *p2, *head;\n  char *p;\n  p1 = create();\n  head = p1;\n  for (i = 0; i < m; i++) {\n    for (p = p1->name; *p != '\u0000'; p++) {\n      num[(*p) - 'A']++;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      j = i;\n    }\n  }\n  printf(\"%c \", ('A' + j));\n  cout << max << \" \";\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    p = p1->name;\n    for (p = p1->name; *p != '\u0000'; p++) {\n      if (*p == ('A' + j)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[26], max, num[n], i, j, s;\n  char maxname, name[n][10];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> name[i];\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      a[name[i][j] - 'A']++;\n  }\n  max = a[0], maxname = 'A';\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i], maxname = 'A' + i;\n    }\n  cout << maxname << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      if (name[i][j] == maxname)\n        cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char p[26];\n};\nint main() {\n  int n, i, j, k, a[150] = {0}, flag, max = 0;\n  struct book t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &s[i].id, s[i].p);\n    for (j = 0; s[i].p[j] != '\\0'; j++)\n      a[s[i].p[j]]++;\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (max < a[i]) {\n      max = a[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; s[i].p[k] != '\\0'; k++)\n      if (s[i].p[k] == j)\n        flag = 1;\n    if (flag == 1)\n      printf(\"%d\\n\", s[i].id);\n  }\n}\n"}
{"label": "2", "index": "1973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char auth[26];\n  struct book *next;\n};\nstruct book *creat(int m) {\n  int i = 0;\n  struct book *head, *p1, *p2;\n  if (i == 0) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->auth);\n    head = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  }\n  while (i < m) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->auth);\n    p2->next = p1;\n    p1->next = NULL;\n    p2 = p1;\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  int m, i, lenth;\n  int max = 0, maxwh = 27;\n  int count[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++)\n      count[(int)(p->auth)[i] - 65]++;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      maxwh = i;\n    }\n  }\n  printf(\"%c\\n\", maxwh + 65);\n  printf(\"%d\\n\", max);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++) {\n      if ((int)(p->auth[i]) == maxwh + 65) {\n        cout << p->num << \"\\n\";\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1974", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int i, k, m, max = 0, t;\n  char j, ch;\n  struct book *head, *p1, *p2;\n  cin >> m;\n  p1 = (struct book *)calloc(1, sizeof(struct book));\n  head = p1;\n  for (i = 0; i < m; i++) {\n    cin >> (p1->a) >> p1->b;\n    p2 = p1;\n    if (i == m - 1)\n      p2->next = NULL;\n    else {\n      p1 = (struct book *)calloc(1, sizeof(struct book));\n      p2->next = p1;\n    }\n  }\n  for (j = 'A'; j <= 'Z'; j++) {\n    t = 0;\n    p1 = head;\n    while (p1) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if ((p1->b)[k] == j)\n          t++;\n      }\n      p1 = p1->next;\n    }\n    if (t > max) {\n      max = t;\n      ch = j;\n    }\n  }\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", max);\n  p1 = head;\n  while (p1) {\n    for (k = 0; k < strlen(p1->b); k++)\n      if ((p1->b)[k] == ch)\n        printf(\"%d\\n\", p1->a);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int num;\n    char zuozhe[27];\n  } ts[999];\n\n  int i, j, n, k, temp;\n  int count[26] = {0};\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &ts[i].num, ts[i].zuozhe);\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      count[ts[i].zuozhe[j] - 65]++;\n    }\n  }\n  temp = count[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > temp) {\n      k = i;\n      temp = count[i];\n    }\n  }\n  cout << k + 65 << \"\\n\";\n  cout << count[k] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      if (ts[i].zuozhe[j] == k + 65) {\n        printf(\"%d\\n\", ts[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1976", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, num[100], k = 0, count[26] = {0}, max = 0;\n  char nam[100][30] = {NULL};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cin.get();\n\n    cin >> nam[i];\n    for (j = 0; j < strlen(nam[i]); j++)\n      count[nam[i][j] - 'A']++;\n  }\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      k = i;\n    } else\n      continue;\n  }\n  j = 0;\n  cout << (char)(k + 'A') << endl;\n  cout << max << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0;; j++) {\n      if (nam[i][j] == k + 'A') {\n        cout << num[i] << endl;\n        break;\n      }\n      if (nam[i][j] == NULL)\n        break;\n    }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char auther[27];\n} bk[1000];\n\nstruct ath {\n  char a;\n  int books[999];\n  int sum;\n} auth[27], temp;\n\nint main() {\n  int n, i, x, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &bk[i].number, bk[i].auther);\n  for (i = 0; i < 27; i++) {\n    for (j = 0; j < 999; j++)\n      auth[i].books[j] = 0;\n    auth[i].sum = 0;\n    auth[i].a = 'A' + i;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].auther);\n    int f;\n    for (f = 0; f < m; f++) {\n      x = (int)(bk[i].auther[f] - 'A');\n      auth[x].books[auth[x].sum] = bk[i].number;\n      auth[x].sum++;\n    }\n  }\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (auth[i].sum > auth[i + 1].sum) {\n        temp = auth[i];\n        auth[i] = auth[i + 1];\n        auth[i + 1] = temp;\n      }\n  printf(\"%c\\n\", auth[25].a);\n  cout << auth[25].sum << \"\\n\";\n  i = 0;\n  while (auth[25].books[i] != 0) {\n    printf(\"%d\\n\", auth[25].books[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct shu {\n  int num;\n  char author[26];\n};\n\nint main() {\n  struct shu shu[999];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n  int a[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == 'A')\n        a[0] = a[0] + 1;\n      else if (shu[i].author[j] == 'B')\n        a[1] = a[1] + 1;\n      else if (shu[i].author[j] == 'C')\n        a[2] = a[2] + 1;\n      else if (shu[i].author[j] == 'D')\n        a[3] = a[3] + 1;\n      else if (shu[i].author[j] == 'E')\n        a[4] = a[4] + 1;\n      else if (shu[i].author[j] == 'F')\n        a[5] = a[5] + 1;\n      else if (shu[i].author[j] == 'G')\n        a[6] = a[6] + 1;\n      else if (shu[i].author[j] == 'H')\n        a[7] = a[7] + 1;\n      else if (shu[i].author[j] == 'I')\n        a[8] = a[8] + 1;\n      else if (shu[i].author[j] == 'J')\n        a[9] = a[9] + 1;\n      else if (shu[i].author[j] == 'K')\n        a[10] = a[10] + 1;\n      else if (shu[i].author[j] == 'L')\n        a[11] = a[11] + 1;\n      else if (shu[i].author[j] == 'M')\n        a[12] = a[12] + 1;\n      else if (shu[i].author[j] == 'N')\n        a[13] = a[13] + 1;\n      else if (shu[i].author[j] == 'O')\n        a[14] = a[14] + 1;\n      else if (shu[i].author[j] == 'P')\n        a[15] = a[15] + 1;\n      else if (shu[i].author[j] == 'Q')\n        a[16] = a[16] + 1;\n      else if (shu[i].author[j] == 'R')\n        a[17] = a[17] + 1;\n      else if (shu[i].author[j] == 'S')\n        a[18] = a[18] + 1;\n      else if (shu[i].author[j] == 'T')\n        a[19] = a[19] + 1;\n      else if (shu[i].author[j] == 'U')\n        a[20] = a[20] + 1;\n      else if (shu[i].author[j] == 'V')\n        a[21] = a[21] + 1;\n      else if (shu[i].author[j] == 'W')\n        a[22] = a[22] + 1;\n      else if (shu[i].author[j] == 'X')\n        a[23] = a[23] + 1;\n      else if (shu[i].author[j] == 'Y')\n        a[24] = a[24] + 1;\n      else if (shu[i].author[j] == 'Z')\n        a[25] = a[25] + 1;\n    }\n  }\n  k = a[0], m = 0;\n  for (i = 0; i < 26; i++) {\n    if (k < a[i]) {\n      k = a[i];\n      m = i;\n    }\n  }\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  printf(\"%c\\n\", b[m]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == b[m]) {\n        printf(\"%d\\n\", shu[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n    int zzsl;\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n    p1->zzsl = strlen(p1->zz);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max) {\n      zzzd = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  zzzdnum = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct x {\n    char num[26];\n    int y;\n  } q[1000], x0;\n\n  int n, i, j, c[100] = {0}, m = 0, f;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &q[i].y, &q[i].num);\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      m = (int)q[i].num[j], c[m] = c[m] + 1;\n\n  for (m = 0; m < 100; m++)\n    if (c[m] > c[0])\n      f = m, c[0] = c[m];\n\n  cout << (char)f << \"\\n\" << c[f] << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      if (q[i].num[j] == (char)f)\n        printf(\"%d\\n\", q[i].y);\n}\n"}
{"label": "2", "index": "1981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, nu, au, M, m;\n  int num[26] = {0};\n  int no[26][999];\n  char aut;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> nu;\n    cin.get();\n    aut = cin.get();\n    while (aut != 10) {\n      au = (int)(aut - 'A');\n      no[au][num[au]] = nu;\n      num[au]++;\n      aut = cin.get();\n    }\n  }\n  M = 0;\n  for (i = 0; i < 26; i++) {\n    if (M < num[i]) {\n      M = num[i];\n      m = i;\n    }\n  }\n  cout << (char)(m + 'A') << endl;\n  printf(\"%d\\n\", M);\n  for (i = 0; i < M; i++)\n    cout << no[m][i] << endl;\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "2", "index": "1982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct author {\n    char nm;\n    int bk[999];\n    int count;\n  };\n  struct author a[26];\n  struct author max;\n  struct book {\n    char at[26];\n    int no;\n  };\n  struct book b;\n  int i, j, n, m, k, flag;\n  for (i = 0; i < 26; i++) {\n    a[i].count = 0;\n    a[i].nm = 65 + i;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b.no, b.at);\n    m = strlen(b.at);\n    flag = 0;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b.at[j] == a[k].nm) {\n          a[k].bk[a[k].count] = b.no;\n          a[k].count++;\n          flag++;\n          break;\n        }\n      }\n      if (flag == m)\n        break;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i].count > max.count) {\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", max.nm, max.count);\n  for (i = 0; i < max.count; i++) {\n    printf(\"%d\\n\", max.bk[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1983", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  int book[1020];\n  scanf(\"%d\", &m);\n  int i;\n  char c;\n  int a[27] = {0};\n  int b[27][1000] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &book[i]);\n    getchar();\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n      a[c - 64] += 1;\n      b[c - 64][i] = 1;\n    }\n  }\n  int max = 0, p;\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", p + 64, max);\n  for (i = 0; i < 1000; i++) {\n    if (b[p][i] == 1)\n      printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, max = -1;\n  int c[26];\n  char prname;\n  struct list {\n    int num;\n    char writer[27];\n    int len;\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n\n    cin >> book[i].writer;\n    book[i].len = strlen(book[i].writer);\n  }\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < book[i].len; j++) {\n      switch (book[i].writer[j]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n    else\n      continue;\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] != max)\n      continue;\n    else {\n      prname = i + 65;\n      printf(\"%c \", prname);\n      printf(\"%d \", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < book[j].len; k++) {\n          if (book[j].writer[k] != prname)\n            continue;\n          else {\n            cout << book[j].num << \" \";\n            break;\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char a[100];\n  };\n  struct book b[1000];\n  int n, i, j, s, t = 0, m, h;\n  int c[1000];\n  char d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].a);\n  d[0] = b[0].a[0];\n  t = 1;\n  c[0] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      int x = 0;\n      for (s = 0; s < t; s++) {\n        if (b[i].a[j] == d[s]) {\n          c[s] = c[s] + 1;\n          x = 0;\n          break;\n        } else\n          x = 1;\n      }\n      if (x == 1) {\n        t++;\n        d[t - 1] = b[i].a[j];\n        c[t - 1] = 1;\n      }\n    }\n  }\n  m = c[0];\n  h = 0;\n  for (i = 0; i < t; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d[h], m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      if (b[i].a[j] == d[h]) {\n        cout << b[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char w[27];\n  };\n  struct book b[1000];\n  int n, i, j, k, c[26] = {0}, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].w);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < strlen(b[j].w); k++) {\n        if (i == b[j].w[k]) {\n          c[i - 65]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[max])\n      max = i;\n  }\n  printf(\"%c\\n\", max + 65);\n  cout << c[max] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(b[i].w); j++) {\n      if (b[i].w[j] == max + 65) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1987", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nint main() {\n  int m, i, j, l, max, maxi;\n  int n[26] = {0};\n  struct book *head, *p1, *p2;\n  char *p;\n  scanf(\"%d\", &m);\n  i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  head = NULL;\n  while (i < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < m) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n    }\n  }\n  p2->next = NULL;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      for (j = 0; j < 26; j++)\n        if (*(p + i) == j + 64)\n          n[j]++;\n    }\n    p1 = p1->next;\n  }\n  max = n[0];\n  for (i = 1; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n\", maxi + 64);\n\n  printf(\"%d\\n\", max);\n\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      if (*(p + i) == maxi + 64) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "1988", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[30];\n  struct book *next;\n};\nint n;\nstruct book *creat(void) {\n  struct book *head;\n  struct book *p1, *p2;\n  int m = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->writer);\n  head = NULL;\n  while (m < n - 1) {\n    m++;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct book *head, *p1;\n  head = creat();\n  struct book *p;\n  p = head;\n  int i;\n  int sum[27];\n  memset(sum, 0, sizeof(sum));\n  char m;\n  for (p = head; p != NULL; p = p->next) {\n    int x;\n    for (i = 0; i < strlen(p->writer); i++) {\n      x = p->writer[i] - 'A';\n      sum[x]++;\n    }\n  }\n  int max = sum[0];\n  for (i = 0; i < 27; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  for (i = 0; i < 27; i++) {\n    if (sum[i] == max) {\n      printf(\"%c\\n%d\\n\", 'A' + i, sum[i]);\n      m = 'A' + i;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (i = 0; i < strlen(p->writer); i++) {\n      if (p->writer[i] == m) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "1989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][30] = {\"\\0\"}, c;\n  int i, j, k, m, n, a[26] = {0}, b[100] = {0}, t = -1;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], s[i]);\n    for (c = 'A'; c <= 'Z'; c++) {\n      if (strchr(s[i], c))\n        a[c - 65]++;\n    }\n  }\n  j = a[0];\n  k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > j) {\n      j = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, a[k]);\n  for (i = 0; i < m; i++)\n    if (strchr(s[i], k + 65))\n      printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "2", "index": "1990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int book[1000], m, i, j, k, length, max = 0, name[500] = {0};\n  char writer[1000][26], name1;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i] >> writer[i];\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i < m; i++) {\n      length = strlen(writer[i]);\n      for (j = 0; j < length; j++)\n        if (writer[i][j] == k)\n          name[k]++;\n    }\n    if (name[k] > max) {\n      max = name[k];\n      name1 = k;\n    }\n  }\n  printf(\"%c\\n\", name1);\n  cout << max << endl;\n  for (i = 0; i <= m; i++) {\n    length = strlen(writer[i]);\n    for (j = 0; j <= length; j++)\n      if (writer[i][j] == name1) {\n        cout << book[i] << endl;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[26] = {0};\n  char c;\n  struct books {\n    int number;\n    char name[27];\n  };\n  struct books book[1000];\n  int n, i, j, max = 0;\n  struct books *p;\n  scanf(\"%d\", &n);\n  for (p = book; p < book + n; p++)\n    scanf(\"%d%s\", &p->number, p->name);\n  for (p = book; p < book + n; p++)\n    for (j = 0; j < 26; j++)\n      for (i = 65; i <= 90; i++)\n        if (p->name[j] == i)\n          x[i - 65]++;\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max)\n      break;\n  c = i + 65;\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (book[i].name[j] == c) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "1992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  struct {\n    int m;\n    char s[26];\n  } p[999];\n\n  int i, j, len, n;\n  int a[26][1000] = {0};\n  int w, t;\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> p[i].m >> p[i].s;\n    len = strlen(p[i].s);\n    for (j = 0; j < len; j++) {\n      t = (p[i].s)[j] - 'A';\n      a[t][0] += 1;\n      w = a[t][0];\n      a[t][w] = p[i].m;\n    }\n  }\n\n  int max = a[0][0];\n  int k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      k = i;\n    }\n  }\n\n  cout << k + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= max; i++) {\n    printf(\"%d\\n\", a[k][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mname[999][26], name;\n  int i, j, m, len, max = 0;\n  int num[999], count[26] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> mname[i];\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      count[mname[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      name = i + 'A';\n    }\n  }\n  cout << name << endl << max << endl;\n  for (i = 0; i < m; i++) {\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      if (mname[i][j] == name) {\n        cout << num[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint w[26] = {0};\nint p = 0;\nvoid zimu(char a[]) {\n  int m, i, j;\n  char c;\n  m = strlen(a);\n  for (j = 0; j < 26; j++) {\n    c = 'A' + j;\n\n    for (i = 0; i < m; i++) {\n      if (a[i] == c)\n        w[j]++;\n    }\n  }\n}\nint max(int w[26]) {\n  int i, max;\n  max = w[0];\n  for (i = 1; i < 26; i++)\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  return max;\n}\n\nint main() {\n  char b[300][20];\n  int a[300];\n  int m, i, j, mm;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &a[i], b[i]);\n  for (i = 0; i < m; i++)\n    zimu(b[i]);\n  mm = max(w);\n\n  printf(\"%c\\n\", p + 'A');\n  printf(\"%d\\n\", mm);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (strlen(b[i])); j++)\n      if (b[i][j] == (p + 'A')) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "1995", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n} * p1, *p2;\n\nstruct book *creat(void) {\n  struct book *head;\n  int i;\n  head = 0;\n  p1 = 0;\n  p2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->name;\n    if (head == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct book *head, *p;\n  char a[27], *q, c;\n  int b[27], i, m, n1 = 0, max;\n  for (i = 1; i < 27; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  head = creat();\n  for (p = head; p != 0; p = p->next) {\n    for (q = p->name; *q != '\u0000'; q++) {\n      m = 0;\n      for (i = 1; i <= n1; i++)\n        if (*q == a[i]) {\n          m = 1;\n          b[i]++;\n          break;\n        }\n      if (m == 0) {\n        n1++;\n        a[n1] = *q;\n        b[n1] = 1;\n      }\n    }\n  }\n  max = b[1];\n  c = a[1];\n  for (i = 1; i <= n1 - 1; i++)\n    if (b[i] > max) {\n      c = a[i];\n      max = b[i];\n    }\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p != 0; p = p->next) {\n    m = 0;\n    for (q = p->name; *q != '\u0000'; q++)\n      if (*q == c) {\n        m = 1;\n        break;\n      }\n    if (m)\n      printf(\"%d \", p->num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1996", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int a;\n    char s[26];\n  } zuozhe[1000];\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &zuozhe[i].a, zuozhe[i].s);\n  }\n  int c[26] = {0}, d;\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      c[zuozhe[i].s[k] - 65]++;\n    }\n  }\n  int f;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[0]) {\n      f = i;\n      d = c[i];\n      c[i] = c[0];\n      c[0] = d;\n    }\n  }\n  printf(\"%c\\n%d\\n\", f + 65, c[0]);\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      if (zuozhe[i].s[k] == f + 65)\n        printf(\"%d\\n\", zuozhe[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Article {\n  int number;\n  char author[26];\n};\n\nint main() {\n  struct Article book[1000];\n  int m, i;\n  int j, k;\n  int c;\n  int max = 0;\n  int writer[26] = {0};\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].number, book[i].author);\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].author[j] >= 'A' && book[i].author[j] <= 'Z') {\n        c = book[i].author[j] - 'A';\n        writer[c]++;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max < writer[i]) {\n      max = writer[i];\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max == writer[i]) {\n      printf(\"%c\\n\", i + 'A');\n      printf(\"%d\\n\", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < 26; k++) {\n          if (book[j].author[k] == i + 'A') {\n            printf(\"%d\\n\", book[j].number);\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "1998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  struct {\n    int m;\n    char s[26];\n  } p[999];\n\n  int i, j, len, n;\n  int a[26][1000] = {0};\n  int w, t;\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> p[i].m >> p[i].s;\n    len = strlen(p[i].s);\n    for (j = 0; j < len; j++) {\n      t = (p[i].s)[j] - 'A';\n      a[t][0] += 1;\n      w = a[t][0];\n      a[t][w] = p[i].m;\n    }\n  }\n\n  int max = a[0][0];\n  int k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      k = i;\n    }\n  }\n\n  cout << k + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= max; i++)\n    printf(\"%d\\n\", a[k][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "1999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char writer[1000][30];\n  char abc[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int m, n, mark[1000], num[26] = {0}, sum = 0, i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &mark[i]);\n    scanf(\"%s\", writer[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == 'A')\n        num[0]++;\n      else if (writer[i][j] == 'B')\n        num[1]++;\n      else if (writer[i][j] == 'C')\n        num[2]++;\n      else if (writer[i][j] == 'D')\n        num[3]++;\n      else if (writer[i][j] == 'E')\n        num[4]++;\n      else if (writer[i][j] == 'F')\n        num[5]++;\n      else if (writer[i][j] == 'G')\n        num[6]++;\n      else if (writer[i][j] == 'H')\n        num[7]++;\n      else if (writer[i][j] == 'I')\n        num[8]++;\n      else if (writer[i][j] == 'J')\n        num[9]++;\n      else if (writer[i][j] == 'K')\n        num[10]++;\n      else if (writer[i][j] == 'L')\n        num[11]++;\n      else if (writer[i][j] == 'M')\n        num[12]++;\n      else if (writer[i][j] == 'N')\n        num[13]++;\n      else if (writer[i][j] == 'O')\n        num[14]++;\n      else if (writer[i][j] == 'P')\n        num[15]++;\n      else if (writer[i][j] == 'Q')\n        num[16]++;\n      else if (writer[i][j] == 'R')\n        num[17]++;\n      else if (writer[i][j] == 'S')\n        num[18]++;\n      else if (writer[i][j] == 'T')\n        num[19]++;\n      else if (writer[i][j] == 'U')\n        num[20]++;\n      else if (writer[i][j] == 'V')\n        num[21]++;\n      else if (writer[i][j] == 'W')\n        num[22]++;\n      else if (writer[i][j] == 'X')\n        num[23]++;\n      else if (writer[i][j] == 'Y')\n        num[24]++;\n      else if (writer[i][j] == 'Z')\n        num[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= sum) {\n      sum = num[i];\n      n = i;\n    }\n  }\n  printf(\"%c\\n\", abc[n]);\n  printf(\"%d\\n\", num[n]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == abc[n]) {\n        printf(\"%d\\n\", mark[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "2", "index": "2000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26][999], t, i, n[26], k, j, b = 0;\n  char x[27];\n  scanf(\"%d\", &t);\n  for (i = 0; i < 26; i++) {\n    n[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    scanf(\"%d%s\", &k, x);\n    for (j = 0; x[j] != '\\0'; j++) {\n      a[x[j] - 65][n[x[j] - 65]] = k;\n      n[x[j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > b) {\n      b = n[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n\", j + 65);\n  printf(\"%d\\n\", n[j]);\n  for (i = 0; i < n[j]; i++) {\n    printf(\"%d\\n\", a[j][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2001", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, b[26], p, max, j, c;\n  cin >> m;\n  struct point {\n    int n;\n    char s[26];\n  } a[999];\n  for (i = 0; i < m; i++)\n    cin >> a[i].n >> a[i].s;\n\n  for (i = 0; i < 26; i++) {\n    b[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == 'A')\n        b[0]++;\n      else if (a[i].s[j] == 'B')\n        b[1]++;\n      else if (a[i].s[j] == 'C')\n        b[2]++;\n      else if (a[i].s[j] == 'D')\n        b[3]++;\n      else if (a[i].s[j] == 'E')\n        b[4]++;\n      else if (a[i].s[j] == 'f')\n        b[5]++;\n      else if (a[i].s[j] == 'G')\n        b[6]++;\n      else if (a[i].s[j] == 'H')\n        b[7]++;\n      else if (a[i].s[j] == 'I')\n        b[8]++;\n      else if (a[i].s[j] == 'J')\n        b[9]++;\n      else if (a[i].s[j] == 'K')\n        b[10]++;\n      else if (a[i].s[j] == 'L')\n        b[11]++;\n      else if (a[i].s[j] == 'M')\n        b[12]++;\n      else if (a[i].s[j] == 'N')\n        b[13]++;\n      else if (a[i].s[j] == 'O')\n        b[14]++;\n      else if (a[i].s[j] == 'P')\n        b[15]++;\n      else if (a[i].s[j] == 'Q')\n        b[16]++;\n      else if (a[i].s[j] == 'R')\n        b[17]++;\n      else if (a[i].s[j] == 'S')\n        b[18]++;\n      else if (a[i].s[j] == 'T')\n        b[19]++;\n      else if (a[i].s[j] == 'U')\n        b[20]++;\n      else if (a[i].s[j] == 'V')\n        b[21]++;\n      else if (a[i].s[j] == 'W')\n        b[22]++;\n      else if (a[i].s[j] == 'X')\n        b[23]++;\n      else if (a[i].s[j] == 'Y')\n        b[24]++;\n      else if (a[i].s[j] == 'Z')\n        b[25]++;\n    }\n  }\n  p = 0;\n  max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      p = i;\n      max = b[i];\n    }\n  }\n  c = (p + 'A');\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == (p + 'A'))\n        printf(\"%d\\n\", a[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } list[999], *p;\n\n  int n;\n  int count[26] = {0};\n  int i;\n  char k = 'A';\n  int max;\n\n  scanf(\"%d\", &n);\n  for (p = list; p < list + n; p++) {\n    cin >> p->num >> p->author;\n  }\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (p->author[i] == '\\0') {\n        break;\n      } else {\n        count[p->author[i] - 65]++;\n      }\n    }\n  }\n\n  max = count[0];\n  for (i = 1; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      k = i + 65;\n    }\n  }\n\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (k == p->author[i]) {\n        printf(\"%d\\n\", p->num);\n      }\n      if (p->author[i] == '\\0') {\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, t, len, a[26][1000] = {0}, n[26] = {0}, max = 0, num;\n  int i, j;\n  char s[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &t, s);\n    len = strlen(s);\n    for (j = 0; j < len; j++) {\n      n[s[j] - 65]++;\n      a[s[j] - 65][i] = t;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (n[j] > max) {\n      max = n[j];\n      num = j;\n    }\n  }\n  printf(\"%c %d \", num + 65, n[num]);\n  for (i = 0; i < m; i++) {\n    if (a[num][i] != 0)\n      printf(\"%d \", a[num][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, num[26] = {0}, index1;\n  scanf(\"%d\", &m);\n  struct f {\n    int index;\n    char writer[27];\n  };\n  struct f *p;\n  p = (struct f *)malloc(m * sizeof(struct f)); \n  char *p1;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &(p + i)->index, (p + i)->writer); \n  }\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    for (; *p1; p1++) {\n      index1 = (int)*p1 - 'A'; \n      (*(num + index1))++;\n    }\n  }\n  int max = 0, k;\n  for (i = 0; i < 26; i++)\n    if (max < *(num + i)) {\n      max = *(num + i);\n      k = i;\n    } \n  char wr;\n  wr = (char)k + 'A';\n  printf(\"%c\\n%d\\n\", wr, max);\n  int flag;\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    flag = 1;\n    for (; *p1 && flag == 1; p1++)\n      if (*p1 == wr)\n        flag = 0;\n    if (flag == 0)\n      printf(\"%d\\n\", (p + i)->index); \n  }\n}\n"}
{"label": "2", "index": "2005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 1, m;\nstruct zuozhe {\n  int num;\n  char ren[26];\n  struct zuozhe *next;\n};\nstruct zuozhe *ap() {\n  struct zuozhe *head, *nw, *tn;\n  do {\n    nw = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    scanf(\"%d%s\", &nw->num, nw->ren);\n    if (n == 1) {\n      head = nw;\n      tn = head;\n    } else\n      tn->next = nw;\n    if (n <= m) {\n      tn = nw;\n      n++;\n    }\n  } while (n <= m);\n  tn->next = NULL;\n  return head;\n}\nint main() {\n  int i, max = 0, a[26] = {0}, j, w, l;\n  char z;\n  struct zuozhe *head, *p;\n  scanf(\"%d\", &m);\n  head = ap();\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      j = p->ren[i] - 65;\n      a[j]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      w = i;\n    }\n  }\n  z = 65 + w;\n  printf(\"%c\\n%d\\n\", z, max);\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      if (p->ren[i] == z) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2006", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[100];\n};\n\nint main() {\n  int n, i, j, a[26], c[100], k, t, d[100], s;\n  struct book bo[100];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &bo[i].num);\n    scanf(\"%s\", bo[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = strlen(bo[i].writer);\n    for (j = 0; j < c[i]; j++) {\n      k = bo[i].writer[j] - 'A';\n      a[k]++;\n    }\n  }\n  t = a[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > t) {\n      j = i;\n      t = a[i];\n    }\n  }\n  s = j;\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < n; i++) {\n    d[i] = 0;\n    for (j = 0; j < c[i]; j++) {\n      if (bo[i].writer[j] == ('A' + s))\n        d[i] = 1;\n    }\n    if (d[i] == 1)\n      printf(\"%d\\n\", bo[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct shu {\n  int num;\n  char author_name[27];\n};\n\nint main() {\n  int ere[26];\n  int m, i, max = 0, key;\n  for (i = 0; i < 26; i++) {\n    ere[i] = 0;\n  }\n  char *a;\n  struct shu book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    scanf(\"%s\", book[i].author_name);\n  }\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      ere[(*a) - 'A']++;\n      a++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ere[i] >= max) {\n      max = ere[i];\n      key = i;\n    }\n  }\n  printf(\"%c\\n\", (key + 'A'));\n  printf(\"%d\\n\", ere[key]);\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      if ((key + 'A') == *a) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2008", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[26];\n\n} stu[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, max, k, l = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> stu[i].num >> stu[i].s;\n  for (i = 0; i < 26; i++)\n    for (k = 0; k < m; k++) {\n      for (j = 0; j < strlen(stu[k].s); j++)\n        if (stu[k].s[j] == 'A' + i)\n          a[i]++;\n    }\n\n  max = a[0];\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", 'A' + l);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(stu[i].s); j++)\n      if (stu[i].s[j] == 'A' + l) {\n        printf(\"%d\\n\", stu[i].num);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2009", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct worker {\n  int nm;\n  char name1[26];\n  struct worker *next;\n};\nstruct zuozhe {\n  char nam;\n  int counts;\n  int name[1000];\n  struct zuozhe *next;\n};\nstruct worker *creat1(int n) {\n  struct worker *head, *p1, *p2;\n  int i;\n  head = (struct worker *)malloc(sizeof(struct worker));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p2->nm, p2->name1);\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nstruct zuozhe *creat2() {\n  struct zuozhe *head, *p1, *p2;\n  int i;\n  head = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n  p1 = p2 = head;\n  for (i = 0; i < 26; i++) {\n    p2 = p1;\n    p1 = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    p2->counts = 0;\n    p2->nam = 'A' + i;\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nint main() {\n  int big = 0;\n  char zz;\n  int i, j;\n  char c;\n  int m, n;\n\n  struct worker *head1, *p1, *p2;\n  struct zuozhe *head2, *q1, *q2;\n  cin >> n;\n  head1 = creat1(n);\n  p1 = p2 = head1;\n  head2 = creat2();\n  q1 = q2 = head2;\n  while (p1 != 0) {\n    i = 0;\n    while (p1->name1[i] != '\\0') {\n      q1 = head2;\n      while (1) {\n        if (q1->nam == p1->name1[i]) {\n          q1->name[q1->counts] = p1->nm;\n          q1->counts++;\n          i++;\n          break;\n        }\n        q1 = q1->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  q1 = head2;\n  while (q1 != 0) {\n    if (q1->counts > big) {\n      zz = q1->nam;\n      big = q1->counts;\n    }\n    q1 = q1->next;\n  }\n  q1 = head2;\n  while (1) {\n    if (q1->nam == zz) {\n      printf(\"%c\\n%d\\n\", q1->nam, q1->counts);\n      for (i = 0; i < q1->counts; i++) {\n        printf(\"%d\\n\", q1->name[i]);\n      }\n      break;\n    }\n    q1 = q1->next;\n  }\n}\n"}
{"label": "2", "index": "2010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  long int num;\n  char name[26];\n} book[1000];\nint main() {\n  int m, i, j, r;\n  int writer[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%ld \", &book[i].num);\n    cin >> book[i].name;\n  }\n  for (i = 0; i < m; i++) {\n    r = strlen(book[i].name);\n    for (j = 0; j < r; j++) {\n      writer[book[i].name[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char w = 'A';\n  for (i = 0; i < 26; i++) {\n    if (writer[i] > max) {\n      max = writer[i];\n      w = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < r; j++) {\n      r = strlen(book[i].name);\n      if (book[i].name[j] == w) {\n        printf(\"%ld\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct zuozhe {\n  int m;\n  char q;\n  char shu[1001][5];\n} zuozhe[26], t;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  char xingming[30];\n  char bianhao[5];\n  char zimu[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  for (i = 0; i < 26; i++)\n    zuozhe[i].m = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> bianhao >> xingming;\n    int j, k;\n    for (j = 0; xingming[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (xingming[j] == zimu[k]) {\n          zuozhe[k].m++;\n          zuozhe[k].q = zimu[k];\n          strcpy(zuozhe[k].shu[zuozhe[k].m], bianhao);\n          break;\n        }\n      }\n    }\n  }\n  int min = 0;\n  int maxnum = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (zuozhe[i].m > maxnum) {\n      maxnum = zuozhe[i].m;\n      min = i;\n    }\n  }\n  cout << zuozhe[min].q << \"\\n\" << zuozhe[min].m << \"\\n\";\n  for (i = 1; i <= zuozhe[min].m; i++) {\n    cout << zuozhe[min].shu[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, m, x[26] = {0}, y = 0, z;\n  char a[100][4], b[100][10], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    for (j = 0; j < m; j++) {\n      x[b[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (y < x[i]) {\n      y = x[i];\n      z = i;\n    }\n  }\n  c = z + 65;\n  printf(\"%c\\n%d\\n\", c, y);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (b[i][j] == c)\n        y = 1;\n    }\n    if (y == 1)\n      printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "2013", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  struct {\n    int a;\n    char s[26];\n  } zuozhe[1000];\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &zuozhe[i].a, zuozhe[i].s);\n  }\n  int c[26] = {0}, d;\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      c[zuozhe[i].s[k] - 65]++;\n    }\n  }\n  int f;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[0]) {\n      f = i;\n      d = c[i];\n      c[i] = c[0];\n      c[0] = d;\n    }\n  }\n  printf(\"%c\\n%d\\n\", f + 65, c[0]);\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      if (zuozhe[i].s[k] == f + 65)\n        printf(\"%d\\n\", zuozhe[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[25];\n} book[999];\nint main() {\n  int m, i, j, k, b, c, max = 0, a[25] = {0}, q[25][999] = {0}, p = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n    b = strlen(book[i].name);\n    for (j = 0; j < b; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].name[j] == k + 65) {\n          a[k] = a[k] + 1;\n          q[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, max);\n  for (i = 0; i < m; i++) {\n    if (q[c][i] > 0)\n      printf(\"%d\\n\", q[c][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int record[26][1000];\n  memset(record, 0, sizeof(record));\n  char name[10];\n  int m, temp;\n  scanf(\"%d \", &m);\n  for (int i = 0; i < m; i++) {\n    scanf(\"%d \", &temp);\n    cin.get();\n    cin.getline(name, 10);\n    for (int i = 0; i < strlen(name); i++) {\n      record[name[i] - 65][record[name[i] - 65][0] + 1] = temp;\n      record[name[i] - 65][0]++;\n    }\n  }\n  int flag = 0;\n  for (int i = 0; i < 25; i++) {\n    if (record[i][0] > record[flag][0])\n      flag = i;\n  }\n  cout << (char)(flag + 65) << endl << record[flag][0] << endl;\n  for (int i = 1; i <= record[flag][0]; i++) {\n    cout << record[flag][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[999][3][27];\n  int m, i, j, k, Nn[27], ctrl;\n\n  cin >> m;\n  for (k = 1; k <= m; k++) {\n    scanf(\"%s\", s[k][1]);\n    scanf(\"%s\", s[k][2]);\n  }\n\n  for (i = 1; i <= 26; i++)\n    Nn[i] = 0;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; s[i][2][j] != '\\0'; j++) {\n      if (s[i][2][j] == 'A')\n        Nn[1]++;\n      else if (s[i][2][j] == 'B')\n        Nn[2]++;\n      else if (s[i][2][j] == 'C')\n        Nn[3]++;\n      else if (s[i][2][j] == 'D')\n        Nn[4]++;\n      else if (s[i][2][j] == 'E')\n        Nn[5]++;\n\n      else if (s[i][2][j] == 'F')\n        Nn[6]++;\n      else if (s[i][2][j] == 'G')\n        Nn[7]++;\n      else if (s[i][2][j] == 'H')\n        Nn[8]++;\n      else if (s[i][2][j] == 'I')\n        Nn[9]++;\n\n      else if (s[i][2][j] == 'J')\n        Nn[10]++;\n      else if (s[i][2][j] == 'K')\n        Nn[11]++;\n      else if (s[i][2][j] == 'L')\n        Nn[12]++;\n      else if (s[i][2][j] == 'M')\n        Nn[13]++;\n\n      else if (s[i][2][j] == 'N')\n        Nn[14]++;\n      else if (s[i][2][j] == 'O')\n        Nn[15]++;\n      else if (s[i][2][j] == 'P')\n        Nn[16]++;\n      else if (s[i][2][j] == 'Q')\n        Nn[17]++;\n\n      else if (s[i][2][j] == 'R')\n        Nn[18]++;\n      else if (s[i][2][j] == 'S')\n        Nn[19]++;\n\n      else if (s[i][2][j] == 'T')\n        Nn[20]++;\n      else if (s[i][2][j] == 'U')\n        Nn[21]++;\n      else if (s[i][2][j] == 'V')\n        Nn[22]++;\n      else if (s[i][2][j] == 'W')\n        Nn[23]++;\n\n      else if (s[i][2][j] == 'X')\n        Nn[24]++;\n\n      else if (s[i][2][j] == 'Y')\n        Nn[25]++;\n      else if (s[i][2][j] == 'Z')\n        Nn[26]++;\n    }\n  }\n  int Nmax = 0, zimuxu;\n  for (i = 1; i <= 26; i++) {\n    if (Nn[i] > Nmax) {\n      Nmax = Nn[i];\n      zimuxu = i;\n    }\n  }\n\n  printf(\"%c\\n\", 'A' + zimuxu - 1);\n  printf(\"%d\\n\", Nmax);\n\n  for (j = 1; j <= m; j++) {\n    ctrl = 0;\n    for (k = 0; s[j][2][k] != '\\0'; k++) {\n      if (s[j][2][k] == 'A' + zimuxu - 1)\n        ctrl++;\n    }\n    if (ctrl != 0)\n      printf(\"%s\\n\", s[j][1]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2017", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  char number[1000][5] = {' '};\n  char authors[1000][30] = {' '};\n  int author[30] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    cin >> number[i] >> authors[i];\n    int len1 = strlen(authors[i]);\n\n    for (j = 0; j <= len1 - 1; j++)\n      author[authors[i][j] - 'A']++;\n  }\n  int k, kmax = 0;\n  int max = author[0];\n  for (k = 1; k <= 25; k++) {\n    if (author[k] > max) {\n      max = author[k];\n      kmax = k;\n    }\n  }\n  char writer = kmax + 'A';\n  cout << writer << endl;\n  cout << max << endl;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (authors[i][j] - 'A' == kmax) {\n        printf(\"%s\\n\", number[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num1;\n  char au[27];\n} bk[1000];\nstruct author {\n  char name;\n  int a;\n  int num2[1000];\n} aur[27];\nint main() {\n  int n, i, j;\n  struct author max;\n  max.a = 0;\n\n  for (j = 0; j < 26; j++) {\n    aur[j].name = 65 + j;\n    aur[j].a = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk[i].num1, bk[i].au);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      aur[bk[i].au[j] - 65].num2[aur[bk[i].au[j] - 65].a] = bk[i].num1;\n      aur[bk[i].au[j] - 65].a++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (aur[i].a > max.a) {\n      max = aur[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", max.name, max.a);\n  for (i = 0; i < max.a; i++) {\n    printf(\"%d\\n\", max.num2[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct books {\n  int num;\n  char writer[26];\n  struct books *next;\n};\n\nint m;\n\nstruct books *creat() {\n  struct books *head, *p1, *p2;\n  int i;\n  p2 = p1 = (struct books *)malloc(sizeof(struct books));\n  for (i = 1; i <= m; i++) {\n    if (i == 1)\n      head = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p2 = p1;\n    if (i != m) {\n      p1 = (struct books *)malloc(sizeof(struct books));\n      p2->next = p1;\n    } else\n      p2->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  int character[26];\n  struct books *head, *p;\n  int i, max = 0, imax;\n  for (i = 0; i < 26; i++)\n    character[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat();\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      character[*(p->writer + i) - 'A']++;\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (character[i] > max) {\n      max = character[i];\n      imax = i;\n    }\n  }\n\n  cout << imax + 'A' << \"\\n\" << max << \"\\n\";\n\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      if (*(p->writer + i) == imax + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n}\n"}
{"label": "2", "index": "2020", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int s[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  struct book {\n    int a;\n    char name[27];\n  };\n  struct book list[999];\n  char c;\n  int n, i, j, b, maxnum = 0, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &list[i].a, list[i].name);\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      c = list[i].name[j];\n      b = c - 'A';\n      s[b]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] > maxnum) {\n      maxnum = s[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max, maxnum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      if (list[i].name[j] - 'A' == max) {\n        printf(\"%d\\n\", list[i].a);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2021", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct a {\n  int n;\n  char s[27];\n} b[1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].n, b[i].s);\n\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (k = 0; b[i].s[k]; k++) {\n      switch (b[i].s[k]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      j = i;\n    }\n  }\n  int t = 0;\n  switch (j) {\n  case 0:\n    printf(\"A\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++) {\n        if (b[i].s[k] == 'A')\n          printf(\"%d\\n\", b[i].n);\n      }\n    }\n    break;\n  case 1:\n    printf(\"B\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'B')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 2:\n    printf(\"C\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'C')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 3:\n    printf(\"D\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'D')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 4:\n    printf(\"E\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'E')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 5:\n    printf(\"F\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'F')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 6:\n    printf(\"G\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'G')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 7:\n    printf(\"H\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'H')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 8:\n    printf(\"I\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'I')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 9:\n    printf(\"J\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'J')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 10:\n    printf(\"K\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'K')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 11:\n    printf(\"L\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'L')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 12:\n    printf(\"M\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 13:\n    printf(\"N\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 14:\n    printf(\"O\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'O')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 15:\n    printf(\"P\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'P')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 16:\n    printf(\"Q\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Q')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 17:\n    printf(\"R\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'R')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 18:\n    printf(\"S\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'S')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 19:\n    printf(\"T\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'T')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 20:\n    printf(\"U\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'U')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 21:\n    printf(\"V\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'V')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 22:\n    printf(\"W\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'W')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 23:\n    printf(\"X\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'X')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 24:\n    printf(\"Y\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Y')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 25:\n    printf(\"Z\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Z')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct writer {\n    int num;\n    char name[20];\n    struct writer *next;\n  };\n  int i, j, k, l, m, z[26] = {0}, max, n;\n  struct writer *p1, *p2, *p, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct writer *)malloc(sizeof(struct writer));\n  scanf(\"%d %s\", &p1->num, &p1->name);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct writer *)malloc(sizeof(struct writer));\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < 26; i++) {\n    p = head;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 20; k++) {\n        if (p->name[k] == (char)(i + 65)) {\n          z[i]++;\n        }\n      }\n      p = p->next;\n    }\n  }\n  max = z[0];\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < z[i]) {\n      max = z[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + j, max);\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 20; k++) {\n      if (p->name[k] == (char)(65 + j)) {\n        cout << p->num << \"\\n\";\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, len[1000], sum[26] = {0}, max, i, j, i0;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char wri[27];\n  } book[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].wri);\n    len[i] = strlen(book[i].wri);\n  }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      sum[book[i].wri[j] - 65]++;\n  max = sum[0];\n  i0 = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      i0 = i;\n    }\n  printf(\"%c\\n\", i0 + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (book[i].wri[j] == 65 + i0) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2024", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n    struct book *next;\n  };\n  int n, m, i;\n  cin >> m;\n  struct book *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->wri);\n  head = NULL;\n  for (i = 0; i < m - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->wri;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  int a[26] = {0}, b, j, k, max1 = 0, max2;\n  struct book *g;\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] != '\u0000') {\n        b = g->wri[i];\n        a[b - 65] = a[b - 65] + 1;\n      }\n    }\n    g = g->next;\n  } while (g != NULL);\n  for (i = 0; i < 26; i++) {\n    if (max1 < a[i]) {\n      max1 = a[i];\n      max2 = i;\n    }\n  }\n  max2 = max2 + 65;\n  printf(\"%c %d\", max2, max1);\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] == max2) {\n        printf(\" %d\", g->num);\n        break;\n      }\n    }\n\n    g = g->next;\n  } while (g != NULL);\n}\n"}
{"label": "2", "index": "2025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct SHU {\n  int bh;\n  char bz[26];\n};\n\nint main() {\n  int m, i, j, l, k, p;\n  int name[200] = {0}, max, shuhao[1000];\n  struct SHU shu[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &shu[i].bh, shu[i].bz);\n  }\n  for (i = 0; i < m; i++) {\n    l = strlen(shu[i].bz);\n    for (j = 0; j < l; j++) {\n      name[shu[i].bz[j]]++;\n    }\n  }\n  max = name[0];\n  for (i = 0; i < 200; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      k = i;\n    }\n  }\n  p = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].bz[j] == k) {\n        shuhao[p] = shu[i].bh;\n        p++;\n      }\n    }\n  }\n  cout << k << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", shuhao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  char id;\n  int count;\n  int books[1000];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct author *pa = (const struct author *)a;\n  const struct author *pb = (const struct author *)b;\n  return pb->count - pa->count;\n}\n\nint main() {\n  int i, j, num, id, len, idx;\n  struct author authors[26]; \n  char c;\n  char buffer[26];\n\n  for (i = 0; i < 26; ++i) {\n    authors[i].id = 'A' + i;\n    authors[i].count = 0;\n  }\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %s\", &id, buffer);\n    len = strlen(buffer);\n    for (j = 0; j < len; ++j) {\n      idx = buffer[j] - 'A';\n      authors[idx].books[authors[idx].count] = id;\n      authors[idx].count++;\n    }\n  }\n\n  qsort(authors, 26, sizeof(struct author), cmp);\n\n  printf(\"%c\\n\", authors[0].id);\n  printf(\"%d\\n\", authors[0].count);\n  for (i = 0; i < authors[0].count; ++i)\n    printf(\"%d\\n\", authors[0].books[i]);\n}\n"}
{"label": "2", "index": "2027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct books {\n  int num;\n  char author[27];\n} book[999];\nint main() {\n  int f(struct books * p, int n, char z);\n  int i, n, j, x[26], k, max;\n  char z;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].author);\n  for (z = 'A', i = 0; z <= 'Z'; z++, i++)\n    x[i] = f(book, n, z);\n  for (i = 1, max = x[0], k = 0; i < 26; i++)\n    if (x[i] > max) {\n      max = x[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].author[j] != '\\0'; j++)\n      if (book[i].author[j] == k + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  return 0;\n}\nint f(struct books *p, int n, char z) {\n  int m = 0, i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; (p + i)->author[j] != '\\0'; j++)\n      if ((p + i)->author[j] == z) {\n        m++;\n        break;\n      }\n  return m;\n}\n"}
{"label": "2", "index": "2028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct zuozhe {\n  int m;\n  char q;\n  char shu[1001][5];\n} zuozhe[26], t;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  char xingming[30];\n  char bianhao[5];\n  char zimu[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  for (i = 0; i < 26; i++)\n    zuozhe[i].m = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> bianhao >> xingming;\n    int j, k;\n    for (j = 0; xingming[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (xingming[j] == zimu[k]) {\n          zuozhe[k].m++;\n          zuozhe[k].q = zimu[k];\n          strcpy(zuozhe[k].shu[zuozhe[k].m], bianhao);\n          break;\n        }\n      }\n    }\n  }\n  int min = 0;\n  int maxnum = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (zuozhe[i].m > maxnum) {\n      maxnum = zuozhe[i].m;\n      min = i;\n    }\n  }\n  cout << zuozhe[min].q << endl << zuozhe[min].m << endl;\n  for (i = 1; i <= zuozhe[min].m; i++) {\n    cout << zuozhe[min].shu[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2029", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, m, a[26][999], num[26] = {0}, t, max;\n  char zz[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &t, zz);\n    for (j = 0; j < strlen(zz); j++) {\n      a[(int)(zz[j] - 'A')][num[(int)(zz[j] - 'A')]] = t;\n      num[(int)(zz[j] - 'A')]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n}\n"}
{"label": "2", "index": "2030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, mid, l = 0;\n  int d[26], e[26];\n  char c[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  head = p1 = p2 = (struct book *)malloc(1000);\n  for (i = 0; i < m; i++) {\n    cin >> p1->a >> p1->b;\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1 = head;\n  for (j = 0; j < 26; j++) {\n    p1 = head;\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if (p1->b[k] == c[j])\n          l++;\n      }\n      d[j] = l;\n      e[j] = l;\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++) {\n      if (d[j] < d[j + 1]) {\n        mid = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = mid;\n      }\n    }\n  for (i = 0; i < 26; i++) {\n    if (e[i] == d[0])\n      break;\n  }\n  printf(\"%c \", c[i]);\n  cout << d[0] << \" \";\n  p1 = head;\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < strlen(p1->b); k++) {\n      if (p1->b[k] == c[i])\n        printf(\"%d \", p1->a);\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int num;\n    char a[25];\n  } book[999];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n\n  int s[26] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      s[book[i].a[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char name;\n  for (i = 0; i <= 25; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      name = 'A' + i;\n    }\n  }\n  printf(\"%c \", name);\n  cout << max << \" \";\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      if (book[i].a[j] == name)\n        printf(\"%d \", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, max;\n  char name[2000][30], alp[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  int No[2000], num[30] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &No[i], name[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < strlen(name[k]); j++) {\n        if (name[k][j] == alp[i]) {\n          num[i]++;\n          break;\n        }\n      }\n    }\n  }\n  max = num[0];\n  for (i = 1; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] == max) {\n      printf(\"%c\\n%d\\n\", alp[i], max);\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < 27; j++) {\n          if (name[k][j] == alp[i]) {\n            printf(\"%d\\n\", No[k]);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2033", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct books {\n    int num;\n    char author[26];\n  } books[999];\n  int n, a[26] = {0}, max, i, j, u, lenth, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> books[i].num >> books[i].author;\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      for (u = 0; u < 26; u++) {\n        if (books[i].author[j] == 'A' + u) {\n          a[u]++;\n        }\n      }\n    }\n  }\n  temp = a[0];\n  for (u = 0; u < 26; u++)\n    if (a[u] >= temp) {\n      max = u;\n      temp = a[u];\n    }\n  printf(\"%c\\n%d\\n\", 'A' + max, a[max]);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      if (books[i].author[j] == 'A' + max)\n        printf(\"%d\\n\", books[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2034", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][27], x;\n  int m, i, j, k, b[1000], c[26] = {0}, max = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> b[i] >> a[i];\n    int len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      c[a[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++)\n    if (max < c[j]) {\n      max = c[j];\n      x = 'A' + j;\n    }\n\n  printf(\"%c\\n\", x);\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    int len = strlen(a[i]);\n    for (k = 0; k < len; k++)\n      if (a[i][k] == x) {\n        cout << b[i] << endl;\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  };\n\n  scanf(\"%d\", &n);\n\n  struct data *input = (struct data *)malloc(sizeof(struct data) * n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    cin >> input[i].number >> input[i].author;\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%d\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n\n  free(input);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2036", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, b[999], max = 0, a[27], x;\n  char w, c[999][26], d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n  }\n  for (i = 0; i < 27; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 65; k < 91; k++) {\n        if (c[i][j] == k)\n          a[k - 64]++;\n      }\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  w = x + 64;\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (c[i][j] == x + 64) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j = 0, zhe[26], t = 0, x, name;\n  for (i = 0; i < 26; i++) {\n    zhe[i] = 0;\n  }\n  char s[26];\n  scanf(\"%d\", &m);\n  struct {\n    int num;\n    char s[26];\n  } shu[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; shu[i].s[j] != 0; j++) {\n      switch (shu[i].s[j]) {\n      case 'A':\n        zhe[0]++;\n        break;\n      case 'B':\n        zhe[1]++;\n        break;\n      case 'C':\n        zhe[2]++;\n        break;\n      case 'D':\n        zhe[3]++;\n        break;\n      case 'E':\n        zhe[4]++;\n        break;\n      case 'F':\n        zhe[5]++;\n        break;\n      case 'G':\n        zhe[6]++;\n        break;\n      case 'H':\n        zhe[7]++;\n        break;\n      case 'I':\n        zhe[8]++;\n        break;\n      case 'J':\n        zhe[9]++;\n        break;\n      case 'K':\n        zhe[10]++;\n        break;\n      case 'L':\n        zhe[11]++;\n        break;\n      case 'M':\n        zhe[12]++;\n        break;\n      case 'N':\n        zhe[13]++;\n        break;\n      case 'O':\n        zhe[14]++;\n        break;\n      case 'P':\n        zhe[15]++;\n        break;\n      case 'Q':\n        zhe[16]++;\n        break;\n      case 'R':\n        zhe[17]++;\n        break;\n      case 'S':\n        zhe[18]++;\n        break;\n      case 'T':\n        zhe[19]++;\n        break;\n      case 'U':\n        zhe[20]++;\n        break;\n      case 'V':\n        zhe[21]++;\n        break;\n      case 'W':\n        zhe[22]++;\n        break;\n      case 'X':\n        zhe[23]++;\n        break;\n      case 'Y':\n        zhe[24]++;\n        break;\n      case 'Z':\n        zhe[25]++;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (zhe[j] > t) {\n      t = zhe[j];\n      x = j;\n    }\n  }\n  name = 'A' + x;\n  cout << name << \"\\n\";\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].s[j] == name)\n        printf(\"%d\\n\", shu[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } list[999], *p;\n\n  int n;\n  int count[26] = {0};\n  int i;\n  char k = 'A';\n  int max;\n\n  scanf(\"%d\", &n);\n  for (p = list; p < list + n; p++) {\n    scanf(\"%d %s\", &p->num, p->author);\n  }\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (p->author[i] == '\\0') {\n        break;\n      } else {\n        count[p->author[i] - 65]++;\n      }\n    }\n  }\n\n  max = count[0];\n  for (i = 1; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      k = i + 65;\n    }\n  }\n\n  printf(\"%c\\n\", k);\n  cout << max << \"\\n\";\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (k == p->author[i]) {\n        printf(\"%d\\n\", p->num);\n      }\n      if (p->author[i] == '\\0') {\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct A {\n  char num[1000];\n  char B[27];\n};\nint main() {\n  int n, i, a, k, t;\n  int sb[27] = {0};\n  int sb2[27] = {0};\n  char x;\n  cin >> n;\n  struct A book[999] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].B);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      a = book[i].B[k];\n      if (book[i].B[k] <= 'Z' && book[i].B[k] >= 'A') {\n        sb[a - 64]++;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    sb2[i] = sb[i];\n  }\n  for (i = 1; i < 26; i++) {\n    if (sb[i] > sb[i + 1]) {\n      a = sb[i];\n      sb[i] = sb[i + 1];\n      sb[i + 1] = a;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (sb2[i] == sb[26]) {\n      t = i;\n    }\n  }\n  x = 'A' + t - 1;\n  printf(\"%c\\n%d\\n\", x, sb[26]);\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      if (book[i].B[k] == '\\0')\n        break;\n\n      else if (book[i].B[k] == x)\n        cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  int i, j, a, n;\n  struct book {\n    int no;\n    char name[30];\n  } book[999];\n  int author1[30] = {0}, author2[30] = {0};\n  char k;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].no, &book[i].name);\n  for (i = 0; i < m; i++) {\n    a = strlen(book[i].name);\n    for (j = 0; j < a; j++) {\n      for (k = 'A'; k <= 'Z'; k++) {\n        if (book[i].name[j] == k)\n          author1[(int)k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    author2[i] = author1[i];\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++) {\n      if (author1[i] < author1[j]) {\n        int tmp;\n        tmp = author1[i];\n        author1[i] = author1[j];\n        author1[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author2[i] == author1[0]) {\n      cout << (char)(65 + i) << \"\\n\";\n      printf(\"%d\\n\", author1[0]);\n      for (j = 0; j < m; j++) {\n        a = strlen(book[j].name);\n        for (n = 0; n < a; n++) {\n          if (book[j].name[n] == (char)(65 + i)) {\n            cout << book[j].no << \"\\n\";\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2041", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char a[26];\n  struct book *next;\n};\nint main() {\n  struct book *head, *p, *s;\n  head = (struct book *)malloc(sizeof(struct book));\n  head->next = NULL;\n  int n, i, j, c[26] = {0}, max, maxj;\n  char b[26];\n  for (j = 0; j < 26; j++)\n    b[j] = 65 + j;\n  scanf(\"%d\", &n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    s = (struct book *)malloc(sizeof(struct book));\n    cin >> s->num >> s->a;\n    s->next = NULL;\n    p->next = s;\n    p = s;\n  }\n  for (p = head->next; p != NULL; p = p->next) {\n    for (i = 0; p->a[i] != '\\0'; i++)\n      for (j = 0; j < 26; j++)\n        if (p->a[i] == b[j])\n          c[j]++;\n  }\n\n  max = c[0];\n  maxj = 0;\n  for (j = 1; j < 26; j++)\n    if (c[j] > max) {\n      max = c[j];\n      maxj = j;\n    }\n  printf(\"%c\\n\", b[maxj]);\n  printf(\"%d\\n\", c[maxj]);\n  for (p = head->next; p != NULL; p = p->next)\n    for (i = 0; p->a[i] != '\\0'; i++)\n      if (p->a[i] == b[maxj])\n        printf(\"%d\\n\", p->num);\n}\n"}
{"label": "2", "index": "2042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, no[1000], shu[26] = {0}, max = 0;\n  char s[1000][20], c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> no[i] >> s[i];\n    for (j = 0; j < strlen(s[i]); j++) {\n      shu[s[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      c = 'A' + i;\n    }\n  }\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (strchr(s[i], c))\n      printf(\"%d\\n\", no[i]);\n  }\n}\n"}
{"label": "2", "index": "2043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, b[999], n[26], t[2] = {0}, x = 0;\n  char a[999][26], au;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i] >> a[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      n[(int)a[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (t[0] < n[i]) {\n      t[0] = n[i], t[1] = i;\n    }\n  }\n  au = t[1] + 65;\n  cout << au << \"\\n\" << t[0] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    x = 0, j = 0;\n    while (j < (int)strlen(a[i]) && x == 0) {\n      if (a[i][j] == t[1] + 65) {\n        cout << b[i] << \"\\n\", x++;\n      } else {\n        j++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct su {\n  int a;\n  char b[26];\n  struct su *next;\n};\nint main() {\n  int n, c[26] = {0}, i, k, j, l, max, m;\n  struct su *p, *head, *q;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    p = (struct su *)malloc(sizeof(struct su));\n    if (i == 0) {\n      head = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    } else {\n      q->next = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    }\n  }\n  q->next = NULL;\n  max = c[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (max < c[j]) {\n      max = c[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 'A', max);\n  p = head;\n  do {\n    k = strlen(p->b);\n    for (j = 0; j < k; j++) {\n      if (('A' + m) == p->b[j]) {\n        printf(\"%d\\n\", p->a);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int n;\n  struct book *next;\n};\nstruct au {\n  char n;\n  int s;\n  struct book *p;\n};\nint main() {\n  int i, j, l, n, a[100][1100] = {0}, max = 0, b[100] = {0};\n  char s[30];\n  scanf(\"%d\", &n);\n  for (l = 1; l <= n; l++) {\n    scanf(\"%d\", &j);\n    scanf(\"%s\", s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      b[s[i]]++;\n      a[s[i]][b[s[i]]] = j;\n      if (b[s[i]] > b[max])\n        max = s[i];\n    }\n  }\n  printf(\"%c\\n\", (char)max);\n  printf(\"%d\\n\", b[max]);\n  for (i = 1; i <= b[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n}\n"}
{"label": "2", "index": "2046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int mark;\n  char name[26];\n};\nint main() {\n  int m, h, i, j, k, max, length;\n  int t[26];\n  char a;\n  scanf(\"%d\", &m);\n  struct book book[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].mark, book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    a = 'A' + i;\n    t[i] = 0;\n    for (j = 0; j < m; j++) {\n      length = strlen(book[i].name);\n\n      for (h = 0; h < 26; h++)\n        if (a == book[j].name[h]) {\n          t[i]++;\n        }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      k = i;\n    }\n  }\n  a = 'A' + k;\n  printf(\"%c\\n%d\\n\", a, t[k]);\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].name);\n    for (j = 0; j < 26; j++) {\n      if ('A' + k == book[i].name[j])\n        printf(\"%d\\n\", book[i].mark);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2047", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[27];\n  struct book *next;\n} * head;\nint times[26];\n\nvoid create(int m) {\n  struct book *p1, *p2;\n  int i;\n  for (i = 0; i <= m - 1; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d\", &p1->num);\n    cin >> p1->writer;\n    if (!i)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n}\nint count() {\n  int max, l, i;\n  char temp[27];\n  struct book *p1;\n  for (i = 0; i <= 25; i++)\n    times[i] = 0;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->writer);\n    strcpy(temp, p1->writer);\n    for (i = 0; i <= l - 1; i++)\n      times[temp[i] - 65]++;\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++)\n    if (times[i] > times[max])\n      max = i;\n  return (max);\n}\nvoid print(int max) {\n  struct book *p1;\n  int abc[999], total, l, i;\n  char temp[27];\n\n  total = 0;\n  printf(\"%c\\n\", max + 65);\n  p1 = head;\n  while (p1 != NULL) {\n    strcpy(temp, p1->writer);\n    l = strlen(temp);\n    for (i = 0; i <= l - 1; i++)\n      if (max + 65 == temp[i])\n        break;\n    if (i < l) {\n      abc[total] = p1->num;\n      total++;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i <= total - 1; i++)\n    printf(\"%d\\n\", abc[i]);\n}\nint main() {\n  int max, m;\n  cin >> m;\n  create(m);\n  max = count();\n  print(max);\n}\n"}
{"label": "2", "index": "2048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char s[26];\n  } b[1000];\n  struct author {\n    int n[1000];\n    int p;\n    char c;\n  } a[26], e;\n\n  int i, j, k, m, q, max;\n  char d;\n  for (i = 0; i < 26; i++)\n    a[i].p = 0;\n  for (i = 0, d = 'A'; i < 26; i++, d++) {\n    a[i].c = d;\n  }\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (b[i].s[j] == '\\0')\n        break;\n      for (k = 0; k < 26; k++) {\n        if (b[i].s[j] == a[k].c) {\n          a[k].n[a[k].p] = b[i].num;\n          a[k].p += 1;\n        }\n      }\n    }\n  }\n  max = a[0].p;\n  e = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i].p > max) {\n      e = a[i];\n      max = a[i].p;\n    }\n  }\n  printf(\"%c\\n\", e.c);\n  printf(\"%d\\n\", e.p);\n  for (j = 0; j < e.p; j++)\n    printf(\"%d\\n\", e.n[j]);\n}\n"}
{"label": "2", "index": "2049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n} shu[999];\n\nint main(int argc, char *argv[]) {\n  int m, b, i, *p;\n  char c;\n  int writer[26];\n  char max(int *p);\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b])\n          writer[c - 'A']++;\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[26] = {0};\n  char z[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char nn[26][100][20];\n  int m, i, j, r;\n  char a[100][100];\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    scanf(\"%s\", a[j]);\n    char b[20];\n    scanf(\"%s\", b);\n    int w = strlen(b);\n    for (i = 0; i < w; i++) {\n      for (r = 0; r < 26; r++) {\n        if (b[i] == z[r]) {\n          n[r]++;\n          strcpy(nn[r][n[r]], a[j]);\n        }\n      }\n    }\n  }\n  int c = 0;\n  for (r = 1; r < 26; r++) {\n    if (n[r] > n[c])\n      c = r;\n  }\n  printf(\"%c\\n%d\\n\", z[c], n[c]);\n  for (i = 1; i <= n[c]; i++) {\n    printf(\"%s\\n\", nn[c][i]);\n  }\n}\n"}
{"label": "2", "index": "2051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[30];\n  struct book *next;\n};\nint n;\nstruct book *creat(void) {\n  struct book *head;\n  struct book *p1, *p2;\n  int m = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->writer);\n  head = NULL;\n  while (m < n - 1) {\n    m++;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat();\n  struct book *p;\n  p = head;\n  int i;\n  int sum[27];\n  memset(sum, 0, sizeof(sum));\n  char m;\n  for (p = head; p != NULL; p = p->next) {\n    int x;\n    for (i = 0; i < strlen(p->writer); i++) {\n      x = p->writer[i] - 'A';\n      sum[x]++;\n    }\n  }\n  int max = sum[0];\n  for (i = 0; i < 27; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  for (i = 0; i < 27; i++) {\n    if (sum[i] == max) {\n      cout << 'A' + i << \"\\n\" << sum[i] << \"\\n\";\n      m = 'A' + i;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (i = 0; i < strlen(p->writer); i++) {\n      if (p->writer[i] == m) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int bookno[100];\n  char author[100][26];\n  int numOfauthor[26] = {0};\n  int nbook, max = 0, maxno;\n  char maxauthor;\n  cin >> nbook;\n  int i, j;\n  for (i = 0; i < nbook; i++) {\n    cin >> bookno[i];\n    cin.get();\n    cin.getline(*(author + i), 26);\n  }\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++)\n      numOfauthor[author[i][j] - 'A']++;\n\n  for (i = 0; i < 26; i++) {\n    if (numOfauthor[i] > max) {\n      max = numOfauthor[i];\n      maxno = i;\n    }\n  }\n  maxauthor = maxno + 'A';\n  printf(\"%c\\n\", maxauthor);\n  printf(\"%d\\n\", numOfauthor[maxno]);\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      if (author[i][j] == maxauthor)\n        cout << bookno[i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct author {\n  int sumbook;\n  int id[999];\n} a[26];\n\nint main() {\n  int n, i, j, bookid = 0, pos = 0, maxbook = 0, maxid = 0;\n  char booka[26];\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d%s\", &bookid, booka);\n    for (j = 0; j < strlen(booka); ++j) {\n      pos = booka[j] - 'A';\n      a[pos].id[a[pos].sumbook] = bookid;\n      a[pos].sumbook++;\n      if (maxbook < a[pos].sumbook) {\n        maxid = pos;\n        maxbook = a[pos].sumbook;\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxid + 'A', maxbook);\n  for (i = 0; i < a[maxid].sumbook; i++)\n    printf(\"%d\\n\", a[maxid].id[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int book[1000];\n  char person[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  char people[100][100];\n  int i, j;\n  int l;\n  int t[100] = {0};\n  for (i = 1; i <= m; i++) {\n    cin >> book[i];\n    cin >> people[i];\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      t[people[i][j] - 'A']++;\n    }\n  }\n  int max = 0, tt;\n  for (i = 0; i <= 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      tt = i;\n    }\n  }\n  cout << person[tt] << endl;\n  cout << max << endl;\n  int k;\n  int already[26] = {1};\n  for (i = 1; i <= m; i++) {\n\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      if (people[i][j] == person[tt])\n\n      {\n        cout << book[i] << endl;\n        for (k = 0; k < l; k++) {\n          if ((people[i][k] != person[tt]) &&\n              (already[people[i][k] - 'A'] != 0)) {\n            \n            already[people[i][k] - 'A'] = 0;\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint alpha[26] = {0};\nstruct library {\n  int num;\n  char authors[27];\n} books[999];\nvoid addauthor(char string[]) {\n  int i = 0;\n  do {\n    alpha[string[i] - 'A']++;\n    i++;\n  } while (string[i] != '\\0');\n}\nvoid hewroteit(struct library book, int maxalpha) {\n  int i;\n  for (i = 0; book.authors[i] != '\\0'; i++) {\n    if (book.authors[i] - 'A' == maxalpha) {\n      printf(\"%d\\n\", book.num);\n      break;\n    }\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> books[i].num >> books[i].authors;\n  for (i = 0; i < m; i++) {\n    addauthor(books[i].authors);\n  }\n  int max = 0, maxalpha = 0;\n  for (i = 0; i < 26; i++) {\n    if (alpha[i] > max) {\n      max = alpha[i];\n      maxalpha = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxalpha, max);\n  for (i = 0; i < m; i++)\n    hewroteit(books[i], maxalpha);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, b[999], max = 0, a[27], x;\n  char w, c[999][26], d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n  }\n  for (i = 0; i < 27; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 65; k < 91; k++) {\n        if (c[i][j] == k)\n          a[k - 64]++;\n      }\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  w = x + 64;\n  cout << w << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (c[i][j] == x + 64) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid function(int, int);\n\nint main() {\n  char s[200][100];\n  int n[100], h[100], maxh[100];\n  int a;\n  int i, j, k, p;\n  int num, maxnum = 0;\n  char c;\n\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    cin >> n[i] >> s[i];\n  }\n\n  for (j = 'A'; j <= 'Z'; j++) {\n    num = 0;\n    for (i = 0; i < a; i++) {\n      for (k = 0; k < strlen(s[i]); k++) {\n        if (s[i][k] == j) {\n          num++;\n          h[num] = n[i];\n        }\n      }\n    }\n    if (num > maxnum) {\n      c = j;\n      maxnum = num;\n      for (p = 1; p <= maxnum; p++) {\n        maxh[p] = h[p];\n      }\n    }\n  }\n\n  cout << c << \"\\n\" << maxnum << \"\\n\";\n  for (p = 1; p <= maxnum; p++) {\n    cout << maxh[p] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ismax(int l[], int a) {\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (l[i] > l[a])\n      return (0);\n  }\n  return (1);\n}\n\nint main() {\n  int i, j, k, n, p, l[26] = {0};\n  struct shu {\n    int num;\n    char auth[100];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].auth);\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 100; k++) {\n        if (book[j].auth[k] == i + 65)\n          l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ismax(l, i) == 1) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 100; j++) {\n      if (book[i].auth[j] == p + 65)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2059", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  printf(\"%c\\n%d\\n\", m, cnt[m]);\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char book[1000][20] = {'\\0'}, name[1000][30] = {'\\0'};\n  int length, n, i, j, number[30] = {0}, memory, largest, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> name[i];\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      temp = name[i][j] - 'A';\n      number[temp] += 1;\n    }\n  }\n  largest = 0;\n  for (i = 0; i < 26; i++) {\n    if (number[i] > largest) {\n      largest = number[i];\n      memory = i;\n    }\n  }\n  cout << 'A' + memory << \"\\n\" << number[memory] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      if (name[i][j] == 'A' + memory) {\n        printf(\"%s\\n\", book[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2061", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char au[30];\n  struct book *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->au);\n  p2 = p1;\n  head = p1;\n  int n = 1;\n  while (n < m) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->au);\n    p2->next = p1;\n    p2 = p1;\n    n++;\n  }\n  p2->next = NULL;\n  char maxa;\n  char author;\n  char temp[30];\n  int an, maxn = 0, i;\n  struct book *p;\n  for (author = 'A'; author <= 'Z';) {\n    p = head;\n    an = 0;\n    while (p) {\n      strcpy(temp, p->au);\n\n      for (i = 0; (temp[i]) != '\u0000'; i++) {\n        if (temp[i] == author) {\n          an++;\n          break;\n        }\n      }\n      p = p->next;\n    }\n    if (an > maxn) {\n      maxa = author;\n      maxn = an;\n    }\n    author = author + 1;\n  }\n  printf(\"%c %d\", maxa, maxn);\n  p = head;\n  while (p) {\n    strcpy(temp, p->au);\n    for (i = 0; (temp[i]) != '\u0000'; i++) {\n      if (temp[i] == maxa) {\n        printf(\" \");\n        printf(\"%d\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2062", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[25];\n} book[999];\nint main() {\n  int m, i, j, k, b, c, max = 0, a[25] = {0}, q[25][999] = {0}, p = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n    b = strlen(book[i].name);\n    for (j = 0; j < b; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].name[j] == k + 65) {\n          a[k] = a[k] + 1;\n          q[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < 25; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, max);\n  for (i = 0; i < m; i++) {\n    if (q[c][i] > 0)\n      printf(\"%d\\n\", q[c][i]);\n  }\n}\n"}
{"label": "2", "index": "2063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int bkn, m = 1, n, i, j;\n  char bka[30];\n\n  struct author {\n    int num;\n    int p[200];\n  } a[30];\n  cin >> n;\n  for (i = 1; i < 27; i++)\n    a[i].num = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bkn, bka);\n    for (j = 0; j < strlen(bka); j++) {\n      a[bka[j] - 64].num++;\n      a[bka[j] - 64].p[a[bka[j] - 64].num - 1] = bkn;\n    }\n  }\n  for (i = 2; i < 27; i++)\n    if (a[i].num > a[m].num)\n      m = i;\n  cout << m + 64 << \"\\n\" << a[m].num << \"\\n\";\n  for (i = 0; i < a[m].num; i++)\n    cout << a[m].p[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "2", "index": "2064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[28];\n} bo[1000];\nint main() {\n  int i, j, k, n, a, b;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bo[i].num, bo[i].writer);\n  }\n  for (i = 'Z'; i >= 'A'; i--) {\n    a = 0;\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < 27; j++) {\n        if (bo[k].writer[j] == i) {\n          a++;\n        }\n      }\n    }\n    if (a > max) {\n      max = a;\n      b = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 28; i++) {\n      if (bo[j].writer[i] == b) {\n        printf(\"%d\\n\", bo[j].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  int num;\n  char au[27];\n} book[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, t, max = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].au);\n    int au_n = strlen(book[i].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[i].au[j] <= 90 && book[i].au[j] >= 65) {\n        int k = book[i].au[j] - 65;\n        a[k]++;\n        if (a[k] > max)\n          max = a[k];\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      char r = i + 65;\n      printf(\"%c\\n%d\\n\", r, max);\n      break;\n    }\n  }\n  for (t = 0; t < m; t++) {\n    int au_n = strlen(book[t].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[t].au[j] == i + 65)\n        cout << book[t].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct shu {\n    int bian;\n    char name[26];\n  };\n\n  struct shu a[1000];\n  int n, i, j, l[1000], b[26] = {0}, most, good, k;\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].bian >> a[i].name;\n  for (i = 0; i < n; i++)\n    l[i] = strlen(a[i].name);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < l[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (a[i].name[j] == 65 + k)\n          b[k]++;\n\n  most = b[0];\n  for (i = 0; i < 26; i++)\n    if (b[i] > most) {\n      most = b[i];\n      good = i;\n    }\n  cout << 65 + good << \"\\n\";\n  printf(\"%d\\n\", most);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].name[j] == 65 + good)\n        printf(\"%d\\n\", a[i].bian);\n}\n"}
{"label": "2", "index": "2067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[30];\n} book[1200];\nint main() {\n  int n, l, t, a[30];\n  char m;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].writer;\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      t = book[i].writer[j] - 65;\n      a[t]++;\n    }\n  }\n  t = a[0];\n  l = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i] > t) {\n      l = i;\n      t = a[i];\n    }\n  }\n  m = l + 65;\n  printf(\"%c\\n\", m);\n  cout << t << endl;\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      if (book[i].writer[j] == m)\n        cout << book[i].id << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, q = 0, t = 0, u, max;\n  int b[26] = {0};\n  char c[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct as {\n    int sh;\n    char a[26];\n  } cla[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &cla[i].sh, cla[i].a);\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++) {\n      u = cla[i].a[k] - 'A';\n      b[u]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++)\n    if (max < b[j]) {\n      max = b[j];\n      q = j;\n    }\n  printf(\"%c\\n\", c[q]);\n  cout << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++)\n      if (cla[i].a[k] == c[q])\n        printf(\"%d\\n\", cla[i].sh);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char a[1000];\n  char b[26];\n} book[1000];\nint main() {\n  int m, i, j, s, k, p, l;\n  int t[26] = {0};\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%s %s\", &book[i].a, book[i].b);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      x = book[i].b[j];\n      k = x;\n      t[k - 65] = t[k - 65] + 1;\n    }\n  }\n  p = t[0];\n  l = 0;\n  for (i = 1; i < 26; i++) {\n    if (t[i] > p) {\n      p = t[i];\n      l = i;\n    }\n  }\n  x = l + 65;\n  printf(\"%c\\n\", x);\n  printf(\"%d\\n\", p);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      if (book[i].b[j] == x) {\n        printf(\"%s\\n\", book[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2070", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char peo[26];\n} book[999];\n\nint main() {\n  char zm, max;\n  int n, i, k, num, cishu = -1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].peo);\n  }\n  for (zm = 'A'; zm <= 'Z'; zm++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].peo[k] == zm)\n          num++;\n      }\n    }\n    if (num > cishu) {\n      cishu = num;\n      max = zm;\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", cishu);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (book[i].peo[k] == max)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[1000];\n  int len;\n} b[1000];\nvoid fun(int count[1000], char s[1000], int len) {\n  int i;\n  for (i = 0; i < len; i++) {\n    int m;\n    m = s[i] - 'A';\n    count[m]++;\n  }\n}\nint judge(char s[1000], int len, char name) {\n  int i, answer = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == name) {\n      answer = 1;\n      break;\n    }\n  }\n  return answer;\n}\n\nint main() {\n  int m, k, count[1000] = {0}, i, j, max, num;\n  char name;\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    scanf(\"%d%s\", &b[k].id, b[k].s);\n    b[k].len = strlen(b[k].s);\n    fun(count, b[k].s, b[k].len);\n  }\n  max = count[0];\n  num = 0;\n  for (j = 1; j < 1000; j++) {\n    if (count[j] > max) {\n      max = count[j];\n      num = j;\n    }\n  }\n  name = num + 65;\n  cout << name << \" \";\n  printf(\"%d \", max);\n  for (k = 0; k < m; k++) {\n    int answer = 0;\n    answer = judge(b[k].s, b[k].len, name);\n    if (answer == 1) {\n      printf(\"%d \", b[k].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[999][3][27];\n  int m, i, j, k, Nn[27], ctrl;\n\n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    scanf(\"%s\", s[k][1]);\n    scanf(\"%s\", s[k][2]);\n  }\n\n  for (i = 1; i <= 26; i++)\n    Nn[i] = 0;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; s[i][2][j] != '\\0'; j++) {\n      if (s[i][2][j] == 'A')\n        Nn[1]++;\n      else if (s[i][2][j] == 'B')\n        Nn[2]++;\n      else if (s[i][2][j] == 'C')\n        Nn[3]++;\n      else if (s[i][2][j] == 'D')\n        Nn[4]++;\n      else if (s[i][2][j] == 'E')\n        Nn[5]++;\n\n      else if (s[i][2][j] == 'F')\n        Nn[6]++;\n      else if (s[i][2][j] == 'G')\n        Nn[7]++;\n      else if (s[i][2][j] == 'H')\n        Nn[8]++;\n      else if (s[i][2][j] == 'I')\n        Nn[9]++;\n\n      else if (s[i][2][j] == 'J')\n        Nn[10]++;\n      else if (s[i][2][j] == 'K')\n        Nn[11]++;\n      else if (s[i][2][j] == 'L')\n        Nn[12]++;\n      else if (s[i][2][j] == 'M')\n        Nn[13]++;\n\n      else if (s[i][2][j] == 'N')\n        Nn[14]++;\n      else if (s[i][2][j] == 'O')\n        Nn[15]++;\n      else if (s[i][2][j] == 'P')\n        Nn[16]++;\n      else if (s[i][2][j] == 'Q')\n        Nn[17]++;\n\n      else if (s[i][2][j] == 'R')\n        Nn[18]++;\n      else if (s[i][2][j] == 'S')\n        Nn[19]++;\n\n      else if (s[i][2][j] == 'T')\n        Nn[20]++;\n      else if (s[i][2][j] == 'U')\n        Nn[21]++;\n      else if (s[i][2][j] == 'V')\n        Nn[22]++;\n      else if (s[i][2][j] == 'W')\n        Nn[23]++;\n\n      else if (s[i][2][j] == 'X')\n        Nn[24]++;\n\n      else if (s[i][2][j] == 'Y')\n        Nn[25]++;\n      else if (s[i][2][j] == 'Z')\n        Nn[26]++;\n    }\n  }\n  int Nmax = 0, zimuxu;\n  for (i = 1; i <= 26; i++) {\n    if (Nn[i] > Nmax) {\n      Nmax = Nn[i];\n      zimuxu = i;\n    }\n  }\n\n  printf(\"%c\\n\", 'A' + zimuxu - 1);\n  printf(\"%d\\n\", Nmax);\n\n  for (j = 1; j <= m; j++) {\n    ctrl = 0;\n    for (k = 0; s[j][2][k] != '\\0'; k++) {\n      if (s[j][2][k] == 'A' + zimuxu - 1)\n        ctrl++;\n    }\n    if (ctrl != 0)\n      printf(\"%s\\n\", s[j][1]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct data {\n  int no;\n  char au[10];\n};\nint main() {\n  struct data lib[1000];\n  char x;\n  int n, i, j, num[26] = {0}, l[1000], k, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &lib[i].no);\n    scanf(\"%s\", lib[i].au);\n    l[i] = strlen(lib[i].au);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      num[lib[i].au[j] - 65] = num[lib[i].au[j] - 65] + 1;\n    }\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  x = k + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (lib[i].au[j] == x)\n        printf(\"%d\\n\", lib[i].no);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2074", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[26];\n} book[1000];\nint main() {\n  int n, i, j, e, max = 0;\n  scanf(\"%d\", &n);\n  char da, c;\n  int temp[27] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    for (da = 'A'; da <= 'Z'; da++) {\n      for (j = 0; j < 26; j++) {\n        if (book[i].writer[j] == da)\n          temp[da - 'A' + 0]++;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] > max) {\n      max = temp[j];\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] == max) {\n      c = j + 65;\n      printf(\"%c\\n%d\\n\", c, temp[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == c)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  char name[1000][26];\n  int num[1000];\n  int i, j;\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &num[i], name[i]);\n  }\n  int a[26] = {0};\n  char k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == 'A')\n        a[0]++;\n      if (name[i][j] == 'B')\n        a[1]++;\n      if (name[i][j] == 'C')\n        a[2]++;\n      if (name[i][j] == 'D')\n        a[3]++;\n      if (name[i][j] == 'E')\n        a[4]++;\n      if (name[i][j] == 'F')\n        a[5]++;\n      if (name[i][j] == 'G')\n        a[6]++;\n      if (name[i][j] == 'H')\n        a[7]++;\n      if (name[i][j] == 'I')\n        a[8]++;\n      if (name[i][j] == 'J')\n        a[9]++;\n      if (name[i][j] == 'K')\n        a[10]++;\n      if (name[i][j] == 'L')\n        a[11]++;\n      if (name[i][j] == 'M')\n        a[12]++;\n      if (name[i][j] == 'N')\n        a[13]++;\n      if (name[i][j] == 'O')\n        a[14]++;\n      if (name[i][j] == 'P')\n        a[15]++;\n      if (name[i][j] == 'Q')\n        a[16]++;\n      if (name[i][j] == 'R')\n        a[17]++;\n      if (name[i][j] == 'S')\n        a[18]++;\n      if (name[i][j] == 'T')\n        a[19]++;\n      if (name[i][j] == 'U')\n        a[20]++;\n      if (name[i][j] == 'V')\n        a[21]++;\n      if (name[i][j] == 'W')\n        a[22]++;\n      if (name[i][j] == 'X')\n        a[23]++;\n      if (name[i][j] == 'Y')\n        a[24]++;\n      if (name[i][j] == 'Z')\n        a[25]++;\n    }\n  }\n  int max = a[0];\n  int o = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      o = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[o], a[o]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == b[o])\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  scanf(\"%d\", &i);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char wri[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26]; \n  char tem[100];\n  int j = 0, k;\n  int shu[26][100]; \n  int hao;          \n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &hao, tem);\n    j = 0;\n    while (tem[j] != '\\0') {\n      for (k = 0; k <= 25; k++) {\n        if (wri[k] == tem[j]) {\n          shu[k][num[k]] = hao;\n          num[k]++;\n        }\n      }\n      j++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", wri[max], num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", shu[max][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  long int num;\n  char name[26];\n} book[1000];\nint main() {\n  int m, i, j, r;\n  int writer[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%ld \", &book[i].num);\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    r = strlen(book[i].name);\n    for (j = 0; j < r; j++) {\n      writer[book[i].name[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char w = 'A';\n  for (i = 0; i < 26; i++) {\n    if (writer[i] > max) {\n      max = writer[i];\n      w = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < r; j++) {\n      r = strlen(book[i].name);\n      if (book[i].name[j] == w) {\n        printf(\"%ld\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w[999][26];\n  char m;\n  int a[999], c[26];\n  int i, j, n, t, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 25; i++) {\n    c[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    scanf(\"%s\", w[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      c[w[i][j] - 65] += 1;\n    }\n  }\n  max = c[0];\n  m = 65;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      m = i + 65;\n    }\n  }\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      if (w[i][j] == m) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2079", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, z;\n  char max;\n  int sum[999] = {0};\n  struct student {\n    int a;\n    char b[26];\n    int c[26];\n  } x[999];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x[i].a);\n    for (j = 0;; j++) {\n      scanf(\"%c\", &x[i].b[j]);\n      if (x[i].b[j] == '\\n') {\n        break;\n      }\n      x[i].c[x[i].b[j] - 65]++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < 999; i++) {\n      sum[k] = sum[k] + x[i].c[k];\n    }\n  }\n\n  z = sum[0];\n  max = 65;\n  for (k = 1; k < 26; k++) {\n    if (sum[k] > z) {\n      max = k + 65;\n      z = sum[k];\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", z);\n  for (i = 0; i < n; i++) {\n    if (x[i].c[max - 65] > 0) {\n      printf(\"%d\\n\", x[i].a);\n    }\n  }\n\n  cin >> i;\n  return 0;\n}\n"}
{"label": "2", "index": "2080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int s[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  struct book {\n    int a;\n    char name[27];\n  };\n  struct book list[999];\n  char c;\n  int n, i, j, b, maxnum = 0, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &list[i].a, list[i].name);\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      c = list[i].name[j];\n      b = c - 'A';\n      s[b]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] > maxnum) {\n      maxnum = s[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max, maxnum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      if (list[i].name[j] - 'A' == max) {\n        printf(\"%d\\n\", list[i].a);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, num[26] = {0}, index1;\n  cin >> m;\n  struct f {\n    int index;\n    char writer[27];\n  };\n  struct f *p;\n  p = (struct f *)malloc(m * sizeof(struct f));\n  char *p1;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &(p + i)->index, (p + i)->writer);\n  }\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    for (; *p1; p1++) {\n      index1 = (int)*p1 - 'A';\n      (*(num + index1))++;\n    }\n  }\n  int max = 0, k;\n  for (i = 0; i < 26; i++)\n    if (max < *(num + i)) {\n      max = *(num + i);\n      k = i;\n    }\n  char wr;\n  wr = (char)k + 'A';\n  printf(\"%c\\n%d\\n\", wr, max);\n  int flag;\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    flag = 1;\n    for (; *p1 && flag == 1; p1++)\n      if (*p1 == wr)\n        flag = 0;\n    if (flag == 0)\n      cout << (p + i)->index << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "2082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int num;\n  char name[27];\n} book[999];\nstruct {\n  int cishu;\n} ren[26];\nint main() {\n  int n, zimu, a, b, i, j;\n  int sz[26];\n  char m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].name[j] != '\\0'; j++) {\n      zimu = book[i].name[j] - 65;\n      ren[zimu].cishu++;\n    }\n  }\n  a = 0;\n  b = ren[0].cishu;\n  for (i = 1; i < 26; i++) {\n    if (ren[i].cishu > b) {\n      a = i;\n      b = ren[i].cishu;\n    }\n  }\n  m = a + 65;\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", b);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].name[j] == m) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, temp, max;\n  char a[1000][10], b[1000][20], w;\n  int c[26];\n  cin >> m;\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    temp = 0;\n    for (j = 0; j < 26; j++) {\n      if (c[i] >= c[j]) {\n        temp++;\n      }\n    }\n    if (temp == 26) {\n      max = i;\n      break;\n    }\n  }\n  w = 'A' + i;\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == w) {\n        printf(\"%s\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct books {\n  char num[20];\n  char w[26];\n};\nint main() {\n  int k, j, i, m;\n  int b[150] = {0};\n  scanf(\"%d\", &m);\n  struct books a[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i].num, a[i].w);\n    for (j = 0; a[i].w[j] != '\\0'; j++)\n      b[a[i].w[j]]++;\n  }\n  int max = 0;\n  for (i = 'A', j = 0; i <= 'Z'; i++)\n    if (max < b[i]) {\n      max = b[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  int n = 0;\n  for (i = 0; i < m; i++) {\n    n = 0;\n    for (k = 0; a[i].w[k] != '\\0'; k++)\n      if (a[i].w[k] == j)\n        n = 1;\n    if (n == 1)\n      printf(\"%s\\n\", a[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2085", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    char num[100], wri[26];\n  } bo[1000];\n  int i, j, l, n, m = 0, a[26] = {0}, mw;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num >> bo[i].wri;\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      a[bo[i].wri[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i] > m) {\n      m = a[i];\n      mw = 65 + i;\n    }\n  printf(\"%c\\n%d\\n\", mw, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      if (bo[i].wri[j] == mw) {\n        puts(bo[i].num);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int number[n + 1];\n  int writer[26] = {0};\n  char book[n + 1][27];\n  for (int i = 1; i <= n; ++i) {\n    cin >> number[i] >> book[i];\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      writer[book[i][t] - 'A']++;\n    }\n  }\n  int nn = 0;\n  for (int i = 0; i < 26; ++i) {\n    nn = max(nn, writer[i]);\n  }\n  int person1;\n  for (int i = 0; i < 26; ++i) {\n    if (writer[i] == nn) {\n      person1 = i;\n      break;\n    }\n  }\n  char person = person1 + 'A';\n  cout << person << endl << nn << endl;\n  for (int i = 1; i <= n; ++i) {\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      if (book[i][t] == person) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n  \n  return 0;\n}\n"}
{"label": "2", "index": "2087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, book[1000], i, j, countt[26] = {0}, len, max = -1, maxauthor;\n  char peo[1000][27], sum[100000] = \"\\0\", ch;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> book[i] >> peo[i];\n    strcat(sum, peo[i]);\n  }\n  len = strlen(sum);\n  for (i = 0; i < len; i++)\n    countt[sum[i] - 65]++;\n  for (i = 0; i < 26; i++) {\n    if (countt[i] > max) {\n      max = countt[i];\n      maxauthor = i;\n    }\n  }\n\n  ch = maxauthor + 65;\n  int p = 0, t = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(peo[i]); j++)\n      if (peo[i][j] == ch)\n        p++;\n    if (p > 0)\n      book[i - t] = book[i];\n    else\n      t++;\n    p = 0;\n  }\n  cout << ch << endl;\n  cout << n - t << endl;\n  for (i = 1; i <= n - t; i++)\n    cout << book[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int array[26]) {\n  int i, max = 0;\n  for (i = 0; i < 26; i++)\n    if (array[i] > max)\n      max = array[i];\n  for (i = 0; i < 26; i++)\n    if (max == array[i])\n      break;\n  return i;\n}\nint main() {\n  struct book {\n    int num;\n    char aut[26];\n  };\n  int a, i, j, m, k, t[26] = {0};\n  struct book nbook[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> nbook[i].num >> nbook[i].aut;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      for (k = 0; k < 26; k++)\n        if (nbook[i].aut[j] == k + 65)\n          t[k]++;\n  a = max(t);\n  printf(\"%c\\n%d\\n\", a + 65, t[a]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (nbook[i].aut[j] == a + 65)\n        cout << nbook[i].num << \"\\n\";\n}\n"}
{"label": "2", "index": "2089", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book1 {\n    int num;\n    char author[20];\n  } book[999];\n  int time[26] = {0};\n  int n, i, j, k, maxi, sign = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].author);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == 'A' + k) {\n          time[k] += 1;\n          break;\n        }\n      }\n    }\n  }\n  maxi = 0;\n  for (i = 0; i < 26; i++) {\n    if (time[maxi] < time[i]) {\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxi, time[maxi]);\n  for (i = 0; i < n && sign == 0; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        sign = 1;\n        break;\n      }\n    }\n  }\n  for (; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int co;\n  char A[26];\n};\n\nint main() {\n  int m, i, k, max;\n  int count[26];\n  int *cc;\n  cin >> m;\n  struct book *bk = (struct book *)malloc(sizeof(struct book) * m);\n  struct book *p;\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d %s\", &(p->co), p->A);\n  }\n  cc = count;\n  memset(count, 0, sizeof(count));\n  for (i = 0; i < 26; i++, cc++) {\n    p = bk;\n    for (k = 0; k < m; k++, p++) {\n      if (strchr(p->A, 'A' + i)) {\n        (*cc)++;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > count[max]) {\n      max = i;\n    }\n  }\n  cout << 'A' + max << \"\\n\" << count[max] << \"\\n\";\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    if (strchr(p->A, 'A' + max)) {\n      printf(\"%d\\n\", p->co);\n    }\n  }\n  free(bk);\n  return 0;\n}\n"}
{"label": "2", "index": "2091", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char name[26];\n  int name_num[26];\n} book[999];\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, &book[i].name);\n  }\n\n  int count[26] = {0};\n  int k;\n  for (i = 0; i < n; i++) {\n    int len;\n    len = strlen(book[i].name);\n    for (k = 0; k < len; k++) {\n      book[i].name_num[k] = (int)book[i].name[k];\n    }\n  }\n\n  int j;\n  int y;\n  for (i = 0; i < n; i++) {\n    int len_1;\n    len_1 = strlen(book[i].name);\n    for (j = 65; j <= 90; j++) {\n      for (y = 0; y < len_1; y++) {\n        if (book[i].name_num[y] == j) {\n          count[j - 65]++;\n        }\n      }\n    }\n  }\n\n  int w;\n  int max = count[0];\n  int t = 0;\n  for (w = 0; w < 26; w++) {\n    if (count[w] > max) {\n      max = count[w];\n      t = w;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  int x;\n\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(book[i].name);\n    for (x = 0; x < length; x++) {\n      if (book[i].name_num[x] == t + 65)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[27];\n    struct book *next;\n  } *head = 0, *p1, *p2;\n  int total, i, j, sumbook[26] = {0}, len, max;\n  scanf(\"%d\", &total);\n  for (i = 0; i < total; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    if (p1 == 0) {\n      printf(\"Memory request failed!\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &p1->num, p1->author);\n    len = strlen(p1->author);\n    for (j = 0; j < len; j++)\n      sumbook[p1->author[j] - 'A']++;\n    if (head)\n      p2->next = p1;\n    else\n      head = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  len = 0;\n  for (i = 0; i < 26; i++) {\n    if (sumbook[i] > len) {\n      len = sumbook[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', sumbook[max]);\n  max += 'A';\n  for (p1 = head; p1; p1 = p1->next) {\n    len = strlen(p1->author);\n    for (i = 0; i < len; i++) {\n      if (p1->author[i] == max) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int num;\n  char a[26];\n  struct shu *next;\n};\nint main() {\n  char ma = 'A';\n  struct shu *p1, *p2;\n  struct shu *head, *p;\n  int cnt[128] = {0};\n  int i, j, n, m;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct shu *)malloc(1000);\n  cin >> p1->num >> p1->a;\n  m = strlen(p1->a);\n  for (j = 0; j < m; j++) {\n    if (++cnt[p1->a[j]] > cnt[ma])\n      ma = p1->a[j];\n  }\n  head = NULL;\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->a);\n    m = strlen(p1->a);\n    for (j = 0; j < m; j++) {\n      if (++cnt[p1->a[j]] > cnt[ma])\n        ma = p1->a[j];\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  printf(\"%c %d \", ma, cnt[ma]);\n  while (p != NULL) {\n    m = strlen(p->a);\n    for (i = 0; i < m; i++) {\n      if (p->a[i] == ma) {\n        printf(\"%d \", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  char number[1000][5] = {' '};\n  char authors[1000][30] = {' '};\n  int author[30] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    cin >> number[i] >> authors[i];\n    int len1 = strlen(authors[i]);\n\n    for (j = 0; j <= len1 - 1; j++) {\n      author[authors[i][j] - 'A']++;\n    }\n  }\n  int k, kmax = 0;\n  int max = author[0];\n  for (k = 1; k <= 25; k++) {\n    if (author[k] > max) {\n      max = author[k];\n      kmax = k;\n    }\n  }\n  char writer = kmax + 'A';\n  cout << writer << endl;\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (authors[i][j] - 'A' == kmax) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, b[26] = {0}, m, j, max = 0, k;\n  char str[1000][30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], str[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == 'A')\n        b[0]++;\n      if (str[i][j] == 'B')\n        b[1]++;\n      if (str[i][j] == 'C')\n        b[2]++;\n      if (str[i][j] == 'D')\n        b[3]++;\n      if (str[i][j] == 'E')\n        b[4]++;\n      if (str[i][j] == 'F')\n        b[5]++;\n      if (str[i][j] == 'G')\n        b[6]++;\n      if (str[i][j] == 'H')\n        b[7]++;\n      if (str[i][j] == 'I')\n        b[8]++;\n      if (str[i][j] == 'J')\n        b[9]++;\n      if (str[i][j] == 'K')\n        b[10]++;\n      if (str[i][j] == 'L')\n        b[11]++;\n      if (str[i][j] == 'M')\n        b[12]++;\n      if (str[i][j] == 'N')\n        b[13]++;\n      if (str[i][j] == 'O')\n        b[14]++;\n      if (str[i][j] == 'P')\n        b[15]++;\n      if (str[i][j] == 'Q')\n        b[16]++;\n      if (str[i][j] == 'R')\n        b[17]++;\n      if (str[i][j] == 'S')\n        b[18]++;\n      if (str[i][j] == 'T')\n        b[19]++;\n      if (str[i][j] == 'U')\n        b[20]++;\n      if (str[i][j] == 'V')\n        b[21]++;\n      if (str[i][j] == 'W')\n        b[22]++;\n      if (str[i][j] == 'X')\n        b[23]++;\n      if (str[i][j] == 'Y')\n        b[24]++;\n      if (str[i][j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct information {\n  int a;\n  char s[26];\n  int len;\n} xinxi[1000];\n\nint main() {\n  int n, i, c[26] = {0}, max, t, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &xinxi[i].a, xinxi[i].s);\n    xinxi[i].len = strlen(xinxi[i].s);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++) {\n      if (xinxi[i].s[j] == 'A')\n        c[1]++;\n      if (xinxi[i].s[j] == 'B')\n        c[2]++;\n      if (xinxi[i].s[j] == 'C')\n        c[3]++;\n      if (xinxi[i].s[j] == 'D')\n        c[4]++;\n      if (xinxi[i].s[j] == 'E')\n        c[5]++;\n      if (xinxi[i].s[j] == 'F')\n        c[6]++;\n      if (xinxi[i].s[j] == 'G')\n        c[7]++;\n      if (xinxi[i].s[j] == 'H')\n        c[8]++;\n      if (xinxi[i].s[j] == 'I')\n        c[9]++;\n      if (xinxi[i].s[j] == 'J')\n        c[10]++;\n      if (xinxi[i].s[j] == 'K')\n        c[11]++;\n      if (xinxi[i].s[j] == 'L')\n        c[12]++;\n      if (xinxi[i].s[j] == 'M')\n        c[13]++;\n      if (xinxi[i].s[j] == 'N')\n        c[14]++;\n      if (xinxi[i].s[j] == 'O')\n        c[15]++;\n      if (xinxi[i].s[j] == 'P')\n        c[16]++;\n      if (xinxi[i].s[j] == 'Q')\n        c[17]++;\n      if (xinxi[i].s[j] == 'R')\n        c[18]++;\n      if (xinxi[i].s[j] == 'S')\n        c[19]++;\n      if (xinxi[i].s[j] == 'T')\n        c[20]++;\n      if (xinxi[i].s[j] == 'U')\n        c[21]++;\n      if (xinxi[i].s[j] == 'V')\n        c[22]++;\n      if (xinxi[i].s[j] == 'W')\n        c[23]++;\n      if (xinxi[i].s[j] == 'X')\n        c[24]++;\n      if (xinxi[i].s[j] == 'Y')\n        c[25]++;\n      if (xinxi[i].s[j] == 'Z')\n        c[26]++;\n    }\n  max = c[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  cout << 64 + t << \"\\n\";\n  cout << c[t] << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++)\n      if (xinxi[i].s[j] == 64 + t)\n        printf(\"%d\\n\", xinxi[i].a);\n}\n"}
{"label": "2", "index": "2097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a, i, j, k, n, s[26][999] = {0}, p[26] = {0};\n  char b[26], c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &j);\n    cin >> b;\n    n = strlen(b);\n    for (k = 0; k < n; k++) {\n      a = b[k] - 'A';\n      s[a][p[a]] = j;\n      p[a]++;\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (p[j] < p[i])\n      j = i;\n  }\n  c = 'A' + j;\n  cout << c << \"\\n\" << p[j] << \"\\n\";\n  for (i = 0;; i++) {\n    if (s[j][i] != 0)\n      cout << s[j][i] << endl;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[27];\n  struct book *next;\n};\nint n;\nstruct book *creat(int amount) {\n  struct book *head;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  p2 = p1;\n  scanf(\"%d %s\", &p1->num, p1->aut);\n  while (n < amount - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->aut);\n  }\n  p2->next = p1, p1->next = NULL;\n  return (head);\n}\nint main() {\n  int amount, i, a[26] = {0}, max, maxn;\n  struct book *p, *headp;\n  char *auth, name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                          'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S',\n                          'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d \", &amount);\n  p = creat(amount);\n  headp = p;\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      for (i = 0; i < 26; i++) {\n        if (name[i] == *auth)\n          break;\n      }\n      a[i] = a[i] + 1;\n    }\n  }\n  for (i = 0, max = a[0], maxn = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i], maxn = i;\n  }\n  cout << name[maxn] << \"\\n\" << max << \"\\n\";\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      if (*auth == name[maxn])\n        break;\n    }\n    if (*auth == '\\0')\n      ;\n    else\n      printf(\"%d\\n\", p->num);\n  }\n}\n"}
{"label": "2", "index": "2099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, max, t, i, j, a[1000], l, b[30] = {0};\n  char str[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> str[i];\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      b[str[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 64, b[t]);\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      if (str[i][j] == t + 64)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2100", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct a {\n  int number;\n  char author[26];\n} b[100];\nint main() {\n  int L[26] = {0};\n  int n = 0;\n  int max = 0;\n  int p = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> b[i].number;\n    cin >> b[i].author;\n    for (int j = 0; b[i].author[j] != '\\0'; j++)\n      L[b[i].author[j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < L[i]) {\n      p = i;\n      max = L[i];\n    }\n  cout << (char)(p + 'A') << endl;\n  cout << max << endl;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] - p == 'A') {\n        printf(\"%d\\n\", b[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int bookno[100];\n  char author[100][26];\n  int numOfauthor[26] = {0};\n  int nbook, max = 0, maxno;\n  char maxauthor;\n  cin >> nbook;\n  int i, j;\n  for (i = 0; i < nbook; i++) {\n    scanf(\"%d \", &bookno[i]);\n    cin.get();\n    cin.getline(*(author + i), 26);\n  }\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      numOfauthor[author[i][j] - 'A']++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (numOfauthor[i] > max) {\n      max = numOfauthor[i];\n      maxno = i;\n    }\n  }\n  maxauthor = maxno + 'A';\n  printf(\"%c\\n\", maxauthor);\n  cout << numOfauthor[maxno] << endl;\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      if (author[i][j] == maxauthor)\n        cout << bookno[i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char mname[999][26], name;\n  int i, j, m, len, max = 0;\n  int num[999], count[26] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> mname[i];\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      count[mname[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      name = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < m; i++) {\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      if (mname[i][j] == name) {\n        cout << num[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char wr[26];\n  struct book *next;\n};\nint main() {\n  int i, n, m = 0, j, a, b, c;\n  int s[100] = {0};\n  scanf(\"%d\", &n);\n  struct book *head, *p1, *p2, *p;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->wr);\n  head = NULL;\n  while (m != n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->wr);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      s[p->wr[j]]++;\n    p = p->next;\n  } while (p != NULL);\n\n  a = s[65];\n  c = 65;\n  for (i = 66; i < 91; i++)\n    if (a < s[i]) {\n      a = s[i];\n      c = i;\n    }\n  cout << c << \" \" << a << \" \";\n\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      if (p->wr[j] == c)\n        printf(\"%d \", p->num);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct writer {\n    int sum;\n    char c;\n  } lit[26] = {0,   'A', 0,   'B', 0,   'C', 0,   'D', 0,   'E', 0,   'F', 0,\n               'G', 0,   'H', 0,   'I', 0,   'J', 0,   'K', 0,   'L', 0,   'M',\n               0,   'N', 0,   'O', 0,   'P', 0,   'Q', 0,   'R', 0,   'S', 0,\n               'T', 0,   'U', 0,   'V', 0,   'W', 0,   'X', 0,   'Y', 0,   'Z'};\n  struct book {\n    int id;\n    char name[26];\n  } data[1000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    cin >> data[i].id >> data[i].name;\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (data[i].name[j] == lit[k].c)\n          lit[k].sum++;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (lit[i].sum < lit[i - 1].sum) {\n      struct writer tmp;\n      tmp = lit[i - 1];\n      lit[i - 1] = lit[i];\n      lit[i] = tmp;\n    }\n  }\n  printf(\"%c\\n%d\\n\", lit[25].c, lit[25].sum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      if (data[i].name[j] == lit[25].c)\n        cout << data[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, w = 0;\n  int maxzm, maxbk = 0;\n  char c1;\n  int zimu[26] = {0};\n  int lm[100];\n  struct {\n    int num;\n    char a[100];\n  } book[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      for (k = 65; k < 91; k++) {\n        if (book[i].a[j] == k)\n          zimu[k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > maxbk) {\n      maxbk = zimu[i];\n      maxzm = i;\n    }\n  }\n  c1 = maxzm + 65;\n  printf(\"%c\\n\", c1);\n  cout << maxbk << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      if (book[i].a[j] == c1) {\n        lm[w] = book[i].num;\n        w++;\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%d\\n\", lm[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct bookst {\n    int Num;\n    char name[26];\n  };\n  struct bookst *book;\n  int cnt[26], num, i, j, max = 0, max_idx = 0;\n  for (i = 0; i < 26; i++)\n    cnt[i] = 0;\n  scanf(\"%d\", &num);\n  book = (struct bookst *)malloc(num * sizeof(struct bookst));\n  for (i = 0; i < num; i++) {\n    cin >> book[i].Num >> book[i].name;\n    for (j = 0; book[i].name[j] != 0; j++)\n      cnt[book[i].name[j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      max_idx = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max_idx, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; book[i].name[j] != 0; j++) {\n      if (book[i].name[j] == 'A' + max_idx)\n        printf(\"%d\\n\", book[i].Num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k = 0;\n  struct {\n    int n;\n    char s[26];\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, &book[i].s);\n  int a[26] = {0};\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      a[(int)(book[i].s[j] - 'A')]++;\n  for (i = 1; i < 26; i++)\n    if (a[k] < a[i])\n      k = i;\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      if (book[i].s[j] == k + 'A') {\n        printf(\"%d\\n\", book[i].n);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[20];\n};\nint main() {\n  struct book c[1000];\n  int i, j, n, k, max, l, d[26], a;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %s\", &c[k].num, c[k].name);\n    for (i = 0; i < strlen(c[k].name); i++) {\n      for (j = 0; j < 26; j++) {\n        if ('A' + j == c[k].name[i])\n          break;\n      }\n      b[j] = b[j] + 1;\n    }\n  }\n  for (a = 0; a < 26; a++)\n    d[a] = b[a];\n  max = b[0];\n  for (l = 0; l < 26; l++)\n    if (b[l] > max)\n      max = b[l];\n  for (a = 0; a < 26; a++) {\n    if (d[a] == max)\n      break;\n  }\n  printf(\"%c\\n\", 'A' + a);\n  printf(\"%d\\n\", max);\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < strlen(c[k].name); i++) {\n      if ('A' + a == c[k].name[i]) {\n        printf(\"%d\\n\", c[k].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, shu[1000], num[26], length[1000];\n  char author[1000][26], maxauthor;\n  cin >> m;\n  memset(num, 0, sizeof(num));\n  for (int i = 0; i < m; i++) {\n    cin >> shu[i] >> author[i];\n    length[i] = strlen(author[i]);\n    for (int j = 0; j < length[i]; j++)\n      num[author[i][j] - 'A'] += 1;\n  }\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (maxnum < num[i])\n      maxnum = num[i];\n  }\n  for (int i = 0; i < 26; i++) {\n    if (num[i] == maxnum) {\n      maxauthor = (char)('A' + i);\n      cout << maxauthor << endl;\n      cout << maxnum << endl;\n      break;\n    }\n  }\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < length[i]; j++) {\n      if (author[i][j] == maxauthor)\n        cout << shu[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, count[30] = {0}, num[30][1000] = {0};\n  cin >> n;\n  while (n--) {\n    int no;\n    char c;\n    cin >> no;\n    cin.get();\n    while ((c = cin.get()) != '\\n') {\n      num[c - 'A'][count[c - 'A']++] = no;\n    }\n  }\n  int max = count[0], set = 0;\n  for (int i = 1; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      set = i;\n    }\n  }\n  cout << (char)(set + 'A') << endl << max << endl;\n  for (int i = 0; i < max; i++) {\n    cout << num[set][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct lib {\n  int num;\n  char author[26];\n} book[1000];\nint main() {\n  int n, i, k, p, e;\n  e = 0;\n  int tol[1000] = {0};\n  int own[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    cin >> (book[i].num) >> book[i].author;\n\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (p = 0; p <= 25; p++) {\n        if (k == book[i].author[p]) {\n          tol[k]++;\n          own[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (tol[i] > e) {\n      e = tol[i];\n    }\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    if (tol[k] == e) {\n      cout << k << \"\\n\" << tol[k] << \"\\n\";\n      for (p = 0; p <= n - 1; p++) {\n        if (own[k][p] != 0) {\n          printf(\"%d\\n\", own[k][p]);\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2112", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f = 0, c, d;\n  struct aut {\n    int num;\n    char wrt[26];\n  } a[999];\n  char wr[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int g[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].wrt;\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].wrt[j] == wr[k])\n          g[k] = g[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (f < g[i]) {\n      f = g[i];\n      d = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", wr[d], f);\n  for (i = 0; i < n; i++) {\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      if (a[i].wrt[j] == wr[d]) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2113", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct bo {\n  char id[10];\n  char au[100];\n};\n\nint main() {\n  int n, i, j, max;\n  char maxa;\n  struct bo *book;\n  int auth[26];\n  memset(auth, 0, sizeof(int) * 26);\n  scanf(\"%d \", &n);\n  book = (struct bo *)malloc(sizeof(struct bo) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].id, book[i].au);\n    for (j = 0; book[i].au[j]; j++)\n      auth[book[i].au[j] - 'A']++;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < auth[i]) {\n      max = auth[i];\n      maxa = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", maxa);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    if (strchr(book[i].au, maxa))\n      printf(\"%s\\n\", book[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++)\n      count[a[i].auther[j] - 'A']++;\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n\n  cout << record + 'A' << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        cout << a[i].number << \"\\n\";\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct x {\n  int num;\n  char author[26];\n  int amount;\n};\nint main() {\n  struct x y[999];\n  int i, j, m, max = 0, max_ = 0;\n  int k;\n  int amount[91] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &y[i].num, y[i].author);\n    y[i].amount = strlen(y[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      for (k = 'A'; k < 'Z'; k++) {\n        if (k = y[i].author[j]) {\n          amount[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i < 'Z'; i++) {\n    if (max < amount[i]) {\n      max = amount[i];\n      max_ = i;\n    }\n  }\n  printf(\"%c\\n\", max_);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      if (y[i].author[j] == max_) {\n        cout << y[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2116", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  int num[1001];\n\n  char name[1001][27];\n  for (int i = 0; i < m; ++i) {\n    cin >> num[i];\n    cin.get();\n    cin.getline(name[i], 27);\n  }\n  int count[100];\n  memset(count, 0, sizeof(count));\n  int record[27][1000];\n  int start = 0;\n  int i, j;\n  char call;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      count[name[i][j]]++;\n      \n      \n    }\n  }\n  int max = 0, k = 0;\n  char t;\n  for (char w = 'A'; w <= 'Z'; w++) {\n    if (count[(int)w] > max) {\n      max = count[(int)w];\n      t = w;\n    }\n  }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == t) {\n        cout << num[i] << endl;\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct node {\n  int num;\n  char name[26];\n  struct node *next;\n};\nint n = 1, m;\nstruct zuozhe {\n  char name;\n  int books[300];\n  int num;\n} zuozhe[26];\n\nstruct node *getlinked() {\n  struct node *head, *newnode, *thisnode;\n\n  do {\n    newnode = (struct node *)malloc(sizeof(struct node));\n    if (newnode == NULL) {\n      cout << \"malloc failed\";\n      exit(-1);\n    }\n    scanf(\"%d%s\", &newnode->num, &newnode->name);\n    newnode->next = NULL;\n    if (n == 1) {\n      thisnode = newnode;\n      head = newnode;\n    } else {\n      thisnode->next = newnode;\n    }\n    if (n <= m) {\n      thisnode = newnode;\n      n++;\n    }\n  } while (n <= m);\n  return head;\n}\nvoid tongji(struct node *p, int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(p->name); j++) {\n      zuozhe[(p->name)[j] - 'A'].books[zuozhe[(p->name)[j] - 'A'].num] = p->num;\n      zuozhe[(p->name)[j] - 'A'].num++;\n    }\n    p = p->next;\n  }\n}\n\nvoid bubble(struct zuozhe array[], int n) {\n  int i = 0, pass;\n  struct zuozhe temp;\n\n  for (pass = 1; pass <= n; pass++) {\n    for (i = 0; i < n - pass; i++) {\n      if (array[i].num < array[i + 1].num) {\n        temp = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = temp;\n      }\n    }\n  }\n  return;\n}\n\nint main() {\n  struct node *p;\n  int i;\n  cin >> m;\n  p = getlinked();\n  for (i = 0; i < 26; i++) {\n    zuozhe[i].name = 'A' + i;\n    zuozhe[i].num = 0;\n  }\n  tongji(p, m);\n  bubble(zuozhe, 26);\n  printf(\"%c\\n%d\\n\", zuozhe[0].name, zuozhe[0].num);\n  for (i = 0; i < zuozhe[0].num; i++) {\n    printf(\"%d\\n\", zuozhe[0].books[i]);\n  }\n}\n"}
{"label": "2", "index": "2118", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  struct book {\n    int no;\n    char as[10];\n  } bk;\n\n  scanf(\"%d\", &n);\n  struct book *books = (struct book *)malloc(sizeof(struct book) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk.no, bk.as);\n    books[i] = bk;\n  }\n\n  int cnts[256] = {0};\n  for (i = 0; i < n; i++) {\n    bk = books[i];\n    for (j = 0; bk.as[j]; j++)\n      cnts[bk.as[j]]++;\n  }\n\n  int count = 0;\n  for (int max = 1000; max > 0; max--) {\n    for (char c = 'A'; c <= 'Z'; c++) {\n      if (cnts[c] == max) {\n        printf(\"%c\\n%d\\n\", c, max);\n        for (i = 0; i < n; i++) {\n          bk = books[i];\n          for (j = 0; bk.as[j]; j++) {\n            if (bk.as[j] == c) {\n              printf(\"%d\\n\", bk.no);\n              break;\n            }\n          }\n        }\n        count++;\n      }\n    }\n    if (count == 1) {\n      free(books);\n      return 0;\n    }\n  }\n\n  free(books);\n  return -1;\n}\n"}
{"label": "2", "index": "2119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int at[26] = {0};\n  char c;\n  cin >> n;\n  struct st {\n    int id;\n    char s[27];\n  } a[999], *p;\n  for (p = a; p < a + n; p++)\n    scanf(\"%d %s\", &p->id, p->s);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c != '\\0')\n        at[c - 65]++;\n      else\n        break;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (at[i] > max) {\n      max = at[i];\n      j = i;\n    }\n  }\n  char x;\n  x = j + 65;\n  printf(\"%c\\n%d\\n\", x, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c == x)\n        printf(\"%d\\n\", a[i].id);\n      if (c == '\\0')\n        break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int number[n + 1];\n  int writer[26] = {0};\n  char book[n + 1][27];\n  for (int i = 1; i <= n; ++i) {\n    cin >> number[i] >> book[i];\n    for (int t = 0; t < strlen(book[i]); ++t)\n      writer[book[i][t] - 'A']++;\n  }\n  int nn = 0;\n  for (int i = 0; i < 26; ++i)\n    nn = max(nn, writer[i]);\n\n  int person1;\n  for (int i = 0; i < 26; ++i) {\n    if (writer[i] == nn) {\n      person1 = i;\n      break;\n    }\n  }\n  char person = person1 + 'A';\n  cout << person << endl << nn << endl;\n  for (int i = 1; i <= n; ++i) {\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      if (book[i][t] == person) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    int n;\n    char a[26];\n  };\n  struct b b[999];\n  int m, k, i, j, c[26] = {0}, p = 0, q = 0;\n  char x;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].n, &b[i].a);\n  for (i = 0; i < m; i++)\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      c[x - 65]++;\n  k = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] > k) {\n      k = c[i];\n      p = i;\n    }\n  printf(\"%c\\n\", p + 65);\n  cout << c[p] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    q = 0;\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      if (x == p + 65)\n        q = 1;\n    if (q == 1)\n      printf(\"%d\\n\", b[i].n);\n  }\n}\n"}
{"label": "2", "index": "2122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char a[26];\n  struct book *next;\n};\nint main() {\n  struct book *head, *p, *s;\n  head = (struct book *)malloc(sizeof(struct book));\n  head->next = NULL;\n  int n, i, j, c[26] = {0}, max, maxj;\n  char b[26];\n  for (j = 0; j < 26; j++)\n    b[j] = 65 + j;\n  scanf(\"%d\", &n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    s = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &s->num, s->a);\n    s->next = NULL;\n    p->next = s;\n    p = s;\n  }\n  for (p = head->next; p != NULL; p = p->next) {\n    for (i = 0; p->a[i] != '\\0'; i++)\n      for (j = 0; j < 26; j++)\n        if (p->a[i] == b[j])\n          c[j]++;\n  }\n  \n  \n  max = c[0];\n  maxj = 0;\n  for (j = 1; j < 26; j++)\n    if (c[j] > max) {\n      max = c[j];\n      maxj = j;\n    }\n  printf(\"%c\\n\", b[maxj]);\n  printf(\"%d\\n\", c[maxj]);\n  for (p = head->next; p != NULL; p = p->next)\n    for (i = 0; p->a[i] != '\\0'; i++)\n      if (p->a[i] == b[maxj])\n        printf(\"%d\\n\", p->num);\n}\n"}
{"label": "2", "index": "2123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, s[26][1000], m, i, j, author, max = 0;\n  char b[1000][28];\n  for (i = 0; i < 26; i++)\n    s[i][0] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a);\n    cin >> b[a];\n    for (j = 0; b[a][j] != '\\0'; j++) {\n      s[b[a][j] - 'A'][0]++;\n      s[b[a][j] - 'A'][s[b[a][j] - 'A'][0]] = a;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i][0] > max) {\n      max = s[i][0];\n      author = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(author + 'A'), max);\n  for (j = 1; j <= max; j++)\n    cout << s[author][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, b[26], p, max, j, c;\n  scanf(\"%d\", &m);\n  struct point {\n    int n;\n    char s[26];\n  } a[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i].n, a[i].s);\n  }\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == 'A')\n        b[0]++;\n      else if (a[i].s[j] == 'B')\n        b[1]++;\n      else if (a[i].s[j] == 'C')\n        b[2]++;\n      else if (a[i].s[j] == 'D')\n        b[3]++;\n      else if (a[i].s[j] == 'E')\n        b[4]++;\n      else if (a[i].s[j] == 'f')\n        b[5]++;\n      else if (a[i].s[j] == 'G')\n        b[6]++;\n      else if (a[i].s[j] == 'H')\n        b[7]++;\n      else if (a[i].s[j] == 'I')\n        b[8]++;\n      else if (a[i].s[j] == 'J')\n        b[9]++;\n      else if (a[i].s[j] == 'K')\n        b[10]++;\n      else if (a[i].s[j] == 'L')\n        b[11]++;\n      else if (a[i].s[j] == 'M')\n        b[12]++;\n      else if (a[i].s[j] == 'N')\n        b[13]++;\n      else if (a[i].s[j] == 'O')\n        b[14]++;\n      else if (a[i].s[j] == 'P')\n        b[15]++;\n      else if (a[i].s[j] == 'Q')\n        b[16]++;\n      else if (a[i].s[j] == 'R')\n        b[17]++;\n      else if (a[i].s[j] == 'S')\n        b[18]++;\n      else if (a[i].s[j] == 'T')\n        b[19]++;\n      else if (a[i].s[j] == 'U')\n        b[20]++;\n      else if (a[i].s[j] == 'V')\n        b[21]++;\n      else if (a[i].s[j] == 'W')\n        b[22]++;\n      else if (a[i].s[j] == 'X')\n        b[23]++;\n      else if (a[i].s[j] == 'Y')\n        b[24]++;\n      else if (a[i].s[j] == 'Z')\n        b[25]++;\n    }\n  }\n  p = 0;\n  max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      p = i;\n      max = b[i];\n    }\n  }\n  c = (p + 'A');\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == (p + 'A'))\n        printf(\"%d\\n\", a[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  struct bo {\n    int a;\n    char au[36];\n  };\n  struct bo bo[999];\n  int i, j;\n  char k, K;\n  int sb[26] = {0}, sbt;\n  int len;\n  int n;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bo[i].a, bo[i].au);\n    len = strlen(bo[i].au);\n    for (j = 0; j < len; j++) {\n      for (k = 65; k < 91; k++) {\n        if (bo[i].au[j] == k) {\n          sb[k - 65]++;\n        }\n      }\n    }\n  }\n  K = 0;\n  sbt = 0;\n  for (i = 0; i < 26; i++) {\n    if (sb[i] > sbt) {\n      K = i + 65;\n      sbt = sb[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", K, sbt);\n  for (i = 0; i < m; i++) {\n    n = 1;\n    for (j = 0; j < strlen(bo[i].au); j++) {\n      if (K == bo[i].au[j]) {\n        n = 0;\n      }\n    }\n    if (n == 0) {\n      cout << bo[i].a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int number;\n  char author[26];\n  struct book *next;\n};\nint m, i;\nstruct book *creat(void) {\n  struct book *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  for (i = 1; i < m; i++) {\n    scanf(\"%d %s\", &p1->number, p1->author);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d %s\", &p1->number, p1->author);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int j, a[26] = {0}, max;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; i < strlen(p->author); i++)\n      switch (p->author[i]) {\n      case 'A':\n        a[0]++;\n        break;\n      case 'B':\n        a[1]++;\n        break;\n      case 'C':\n        a[2]++;\n        break;\n      case 'D':\n        a[3]++;\n        break;\n      case 'E':\n        a[4]++;\n        break;\n      case 'F':\n        a[5]++;\n        break;\n      case 'G':\n        a[6]++;\n        break;\n      case 'H':\n        a[7]++;\n        break;\n      case 'I':\n        a[8]++;\n        break;\n      case 'J':\n        a[9]++;\n        break;\n      case 'K':\n        a[10]++;\n        break;\n      case 'L':\n        a[11]++;\n        break;\n      case 'M':\n        a[12]++;\n        break;\n      case 'N':\n        a[13]++;\n        break;\n      case 'O':\n        a[14]++;\n        break;\n      case 'P':\n        a[15]++;\n        break;\n      case 'Q':\n        a[16]++;\n        break;\n      case 'R':\n        a[17]++;\n        break;\n      case 'S':\n        a[18]++;\n        break;\n      case 'T':\n        a[19]++;\n        break;\n      case 'U':\n        a[20]++;\n        break;\n      case 'V':\n        a[21]++;\n        break;\n      case 'W':\n        a[22]++;\n        break;\n      case 'X':\n        a[23]++;\n        break;\n      case 'Y':\n        a[24]++;\n        break;\n      case 'Z':\n        a[25]++;\n        break;\n      }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max) {\n      printf(\"%c \", 65 + i);\n      break;\n    }\n  printf(\"%d \", max);\n  for (p = head; p != NULL; p = p->next)\n    for (j = 0; j < strlen(p->author); j++)\n      if (p->author[j] == 65 + i)\n        printf(\"%d \", p->number);\n}\n"}
{"label": "2", "index": "2127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int m, i, j, k, num[10000], max = 0, t = 0;\n  char a[10000][26];\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i][j] == c[k])\n          b[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", c[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i][j] == c[t]) {\n        cout << num[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "2", "index": "2128", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int book;\n  char writer[26];\n  int counter[26] = {0};\n  int bookbelong[26][999] = {0};\n  int everynum[26] = {0};\n  int t = 0;\n  while (k--) {\n    scanf(\"%d %s \", &book, writer);\n    int str = strlen(writer);\n    for (int i = 0; i < str; i++)\n\n    {\n      int flag = writer[i] - 'A';\n      counter[flag]++;\n      bookbelong[flag][everynum[flag]++] = book;\n    }\n  }\n  int max = counter[0];\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (counter[i] > max) {\n      maxnum = i;\n      max = counter[i];\n    }\n  }\n  char writerbest;\n  writerbest = 'A' + maxnum;\n  cout << writerbest << endl << everynum[maxnum] << endl;\n  for (int i = 0; i < everynum[maxnum]; i++) {\n    printf(\"%d\\n\", bookbelong[maxnum][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[27] = {0};\n  int n, i, j, temp;\n  unsigned long len;\n  char author[27], temp2, book[27][1000] = {'\\0'};\n  char str[4];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> str; \n    cin.get();\n    cin.getline(author, 27);\n    len = strlen(author); \n    for (j = 0; j < len; j++) {\n      num[author[j] - 'A']++;\n      strncat(book[author[j] - 'A'], str, 3); \n    }\n  }\n  temp = 0;\n  for (j = 0; j < 26; j++) {\n    if (num[j] > temp) {\n      temp = num[j];\n      temp2 = j + 'A';\n    }\n  }\n  cout << temp2 << endl << temp << endl;\n  for (j = 0; j < temp; j++) {\n    for (i = 0; i < 3; i++)\n      cout << book[temp2 - 'A']\n                  [j * 3 + i]; \n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[26];\nchar b[1000][100];\nchar out;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, tmp = 0, tmp1 = 0, tmp2;\n  int a[1000];\n  out = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n\n    if (c[i] > tmp) {\n      tmp = c[i];\n      tmp1 = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", out + tmp1, tmp);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j] != '\\0'; j++) {\n      tmp2 = b[i][j];\n\n      if (tmp2 == (out + tmp1)) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n};\nint i, j, n, t, number[100], m;\nstruct book *creat(void) {\n  struct book *p1, *p2, *head;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &m);\n  struct book *creat(void);\n  struct book *head, *p;\n  int a[26] = {0}, max, maxindex = 0;\n  head = p = creat();\n  char *pointer;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      for (i = 0; i < 26; i++) {\n        if (*pointer == 65 + i)\n          a[i]++;\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxindex = i;\n    }\n  }\n  printf(\"%c %d \", 65 + maxindex, a[maxindex]);\n  p = head;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      if (*pointer == 65 + maxindex)\n        cout << p->num << \" \";\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, l, j, t, k[30][99], a[30], o, q, max = 0, maxman;\n  for (i = 0; i < 30; i++)\n    a[i] = 0;\n  char s[40];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    cin >> o >> s;\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      q = s[i] - 'A';\n      a[q]++;\n      t = a[q];\n      k[q][t] = o;\n    }\n  }\n  for (i = 'A' - 'A'; i <= 'Z' - 'A'; i++) {\n    if (a[i] > max) {\n\n      max = a[i];\n      maxman = i;\n    }\n  }\n  cout << maxman + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 1; i <= max; i++)\n\n    printf(\"%d\\n\", k[maxman][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2133", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  char writter[27];\n  int data[26][1000];\n  memset(data, 0, sizeof(data));\n  int max = 0;\n  char max_name;\n  for (int i = 1; i <= m; i++) {\n    int number;\n    cin >> number >> writter;\n    for (int j = 0; j < strlen(writter); j++) {\n      data[writter[j] - 65][0]++;\n      data[writter[j] - 65][data[writter[j] - 65][0]] = number;\n      if (max < data[writter[j] - 65][0]) {\n        max = data[writter[j] - 65][0];\n        max_name = writter[j];\n      }\n    }\n  }\n  cout << max_name << endl << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << data[max_name - 65][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[26];\n\n} stu[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, max, k, l = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &stu[i].num, stu[i].s);\n  for (i = 0; i < 26; i++)\n    for (k = 0; k < m; k++)\n      for (j = 0; j < strlen(stu[k].s); j++)\n        if (stu[k].s[j] == 'A' + i)\n          a[i]++;\n\n  max = a[0];\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", 'A' + l);\n  cout << max << \"\\n\";\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(stu[i].s); j++)\n      if (stu[i].s[j] == 'A' + l) {\n        printf(\"%d\\n\", stu[i].num);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  int num;\n  int book[1000];\n};\nstruct person p[26];\nint n, m, i, j, k;\nchar str[30];\nint main() {\n  memset(p, 0, sizeof(p));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &m, str);\n    for (j = strlen(str) - 1; j >= 0; j--)\n      if (str[j] >= 'A' && str[j] <= 'Z') {\n        k = p[str[j] - 'A'].num++;\n        p[str[j] - 'A'].book[k] = m;\n      }\n  }\n  m = 0;\n  for (i = 1; i < 26; i++)\n    if (p[i].num > p[m].num)\n      m = i;\n  printf(\"%c\\n\", 'A' + m);\n  printf(\"%d\\n\", p[m].num);\n  for (i = 0; i < p[m].num; i++)\n    printf(\"%d\\n\", p[m].book[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int j, n, i, book, max = 0, pos, a[30][1000] = {0};\n  char s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book >> s;\n    for (j = 0; j < strlen(s); j++) {\n      a[s[j] - 'A'][0]++;\n      a[s[j] - 'A'][a[s[j] - 'A'][0]] = book;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i][0] > max) {\n      max = a[i][0];\n      pos = i;\n    }\n  printf(\"%c\\n%d\\n\", pos + 'A', a[pos][0]);\n  for (i = 1; i <= a[pos][0]; i++)\n    cout << a[pos][i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } b[999];\n  int a[26] = {0}, n, i, j, k, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].author);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      k = 0;\n      while (b[j].author[k] != '\\0') {\n        if (b[j].author[k] == i + 65)\n          a[i]++;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (max < a[i])\n      max = a[i];\n  i = 0;\n  while (max != a[i])\n    i++;\n  printf(\"%c\\n%d\\n\", i + 65, a[i]);\n  for (j = 0; j < n; j++) {\n    k = 0;\n    while (b[j].author[k] != i + 65 && b[j].author[k] != '\\0')\n      k++;\n    if (b[j].author[k] == i + 65)\n      printf(\"%d\\n\", b[j].num);\n  }\n}\n"}
{"label": "2", "index": "2138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[20];\n};\n\nint main() {\n  int i, j, n, t, max = 0;\n  char a[20];\n  int words[26] = {0};\n  struct book b[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &(b[i].num), &(b[i].aut));\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++) {\n      t = (int)b[i].aut[j] - 65;\n      words[t]++;\n    }\n\n  for (i = 0; i < 26; i++)\n    if (words[i] > max) {\n      max = words[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++)\n      if (b[i].aut[j] == (char)(t + 65))\n        printf(\"%d\\n\", b[i].num);\n}\n"}
{"label": "2", "index": "2139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char w[100];\n} book[100];\nint main() {\n  int i, j, k, l, m, n, p, b[26] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].w);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].w[j] != '\\0'; j++) {\n      if (book[i].w[j] == 'A')\n        b[0]++;\n      else if (book[i].w[j] == 'B')\n        b[1]++;\n      else if (book[i].w[j] == 'C')\n        b[2]++;\n      else if (book[i].w[j] == 'D')\n        b[3]++;\n      else if (book[i].w[j] == 'E')\n        b[4]++;\n      else if (book[i].w[j] == 'F')\n        b[5]++;\n      else if (book[i].w[j] == 'G')\n        b[6]++;\n      else if (book[i].w[j] == 'H')\n        b[7]++;\n      else if (book[i].w[j] == 'I')\n        b[8]++;\n      else if (book[i].w[j] == 'J')\n        b[9]++;\n      else if (book[i].w[j] == 'K')\n        b[10]++;\n      else if (book[i].w[j] == 'L')\n        b[11]++;\n      else if (book[i].w[j] == 'M')\n        b[12]++;\n      else if (book[i].w[j] == 'N')\n        b[13]++;\n      else if (book[i].w[j] == 'O')\n        b[14]++;\n      else if (book[i].w[j] == 'P')\n        b[15]++;\n      else if (book[i].w[j] == 'Q')\n        b[16]++;\n      else if (book[i].w[j] == 'R')\n        b[17]++;\n      else if (book[i].w[j] == 'S')\n        b[18]++;\n      else if (book[i].w[j] == 'T')\n        b[19]++;\n      else if (book[i].w[j] == 'U')\n        b[20]++;\n      else if (book[i].w[j] == 'V')\n        b[21]++;\n      else if (book[i].w[j] == 'W')\n        b[22]++;\n      else if (book[i].w[j] == 'X')\n        b[23]++;\n      else if (book[i].w[j] == 'Y')\n        b[24]++;\n      else if (book[i].w[j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i] < b[j])\n        break;\n    }\n    if (j == 26) {\n      printf(\"%c\\n%d\\n\", 65 + i, b[i]);\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (l = 0; book[j].w[l] != '\\0'; l++) {\n      if (book[j].w[l] == 65 + i) {\n        cout << book[j].num << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2140", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct inf {\n  int sum;\n  char write[1000][4];\n};\nint main() {\n  int m;\n  int i, j;\n  char name[5];\n  char author[27];\n  struct inf book[26];\n  for (i = 0; i < 26; i++)\n    book[i].sum = 0;\n\n  cin >> m;\n  cin.get();\n\n  while (m-- > 0) {\n    cin.get(name, 5);\n    cin.getline(author, 27);\n    for (i = 0; i < strlen(author); i++) {\n      book[author[i] - 'A'].sum++;\n      for (j = 0; j <= 3; j++) {\n        if (j < 3)\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = name[j];\n        else\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = '\\0';\n      }\n    }\n  }\n\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (book[i].sum > max) {\n      t = i;\n      max = book[i].sum;\n    }\n  }\n\n  cout << (char)(t + 'A') << endl << book[t].sum << endl;\n  for (i = 1; i <= book[t].sum; i++)\n    printf(\"%s\\n\", book[t].write[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num1;\n  char au[27];\n} bk[1000];\nstruct author {\n  char name;\n  int a;\n  int num2[1000];\n} aur[27];\nint main() {\n  int n, i, j;\n  struct author max;\n  max.a = 0;\n\n  for (j = 0; j < 26; j++) {\n    aur[j].name = 65 + j;\n    aur[j].a = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk[i].num1, bk[i].au);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      aur[bk[i].au[j] - 65].num2[aur[bk[i].au[j] - 65].a] = bk[i].num1;\n      aur[bk[i].au[j] - 65].a++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (aur[i].a > max.a)\n      max = aur[i];\n  }\n  printf(\"%c\\n%d\\n\", max.name, max.a);\n  for (i = 0; i < max.a; i++) {\n    printf(\"%d\\n\", max.num2[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, name[26] = {0}, max, a[1000], t = 0;\n  char word[1000][30];\n  scanf(\"%d\", &n);\n  for (i = -1; i < n; i++) {\n\n    cin >> word[i];\n  }\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      while (word[i][k] != '\u0000') {\n        if (word[i][k] == 'A' + j)\n          name[j] = name[j] + 1;\n\n        k = k + 1;\n      }\n      k = 0;\n    }\n  }\n  k = 0;\n  max = name[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      j = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (word[i][k] != '\u0000') {\n      if (word[i][k] == 'A' + j) {\n\n        a[t] = i;\n        t = t + 1;\n        k = 0;\n        break;\n      }\n      k = k + 1;\n    }\n    k = 0;\n  }\n  printf(\"%c %d \", 'A' + j, max);\n  k = 0;\n  for (i = 0; i < t; i++) {\n    while (word[a[i]][k] != ' ') {\n      printf(\"%c\", word[a[i]][k]);\n      k = k + 1;\n    }\n    cout << \" \";\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct a {\n  int n;\n  char s[26];\n} b[1000];\n\nint main() {\n  int n, i, j, c[26] = {0};\n  char t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int d, m;\n    scanf(\"%d%s\", &b[i].n, b[i].s);\n    d = strlen(b[i].s);\n    for (m = 0; m < d; m++)\n      c[b[i].s[m] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++)\n      if (c[j] > c[i])\n        break;\n    if (j == 26) {\n      break;\n    }\n  }\n  t = 65 + i;\n  printf(\"%c\\n%d\\n\", t, c[i]);\n  for (i = 0; i < n; i++) {\n    if (strchr(b[i].s, t) != NULL)\n      printf(\"%d\\n\", b[i].n);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2144", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, book[1000], i, j, countt[26] = {0}, len, max = -1, maxauthor;\n  char peo[1000][27], sum[100000] = \"\\0\", ch;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> book[i] >> peo[i];\n    strcat(sum, peo[i]);\n  }\n  len = strlen(sum);\n  for (i = 0; i < len; i++)\n    countt[sum[i] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (countt[i] > max) {\n      max = countt[i];\n      maxauthor = i;\n    }\n\n  ch = maxauthor + 65;\n  int p = 0, t = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(peo[i]); j++)\n      if (peo[i][j] == ch)\n        p++;\n    if (p > 0)\n      book[i - t] = book[i];\n    else\n      t++;\n    p = 0;\n  }\n  cout << ch << endl;\n  cout << n - t << endl;\n  for (i = 1; i <= n - t; i++)\n    cout << book[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2145", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char number[100];\n  char name[100];\n  struct student *next;\n};\nint n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %s\", &p1->number, &p1->name);\n  head = NULL;\n  do {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->number >> p1->name;\n  } while (i < n - 1);\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int h, i, k, m, j, max;\n  struct student *head;\n  struct student *p;\n  int sum[10000] = {0};\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  for (i = 65, k = 0; i <= 90; i++, k++) {\n    p = head;\n    do {\n      m = strlen(p->name);\n      for (j = 0; j < m; j++) {\n        if (p->name[j] == i)\n          sum[k]++;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  for (i = 0, max = sum[0]; i <= k; i++) {\n    if (sum[i] >= max) {\n      h = i;\n      max = sum[i];\n    }\n  }\n  printf(\"%c %d \", h + 65, max);\n  p = head;\n  do {\n    m = strlen(p->name);\n    for (j = 0; j < m; j++) {\n      if (p->name[j] == h + 65)\n        printf(\"%s \", p->number);\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char a[26];\n  struct book *next;\n};\nint main() {\n  struct book *head, *p, *s;\n  head = (struct book *)malloc(sizeof(struct book));\n  head->next = NULL;\n  int n, i, j, c[26] = {0}, max, maxj;\n  char b[26];\n  for (j = 0; j < 26; j++)\n    b[j] = 65 + j;\n  scanf(\"%d\", &n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    s = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &s->num, s->a);\n    s->next = NULL;\n    p->next = s;\n    p = s;\n  }\n  for (p = head->next; p != NULL; p = p->next) {\n    for (i = 0; p->a[i] != '\\0'; i++)\n      for (j = 0; j < 26; j++)\n        if (p->a[i] == b[j])\n          c[j]++;\n  }\n  max = c[0];\n  maxj = 0;\n  for (j = 1; j < 26; j++)\n    if (c[j] > max) {\n      max = c[j];\n      maxj = j;\n    }\n  cout << b[maxj] << \"\\n\";\n  printf(\"%d\\n\", c[maxj]);\n  for (p = head->next; p != NULL; p = p->next)\n    for (i = 0; p->a[i] != '\\0'; i++)\n      if (p->a[i] == b[maxj])\n        printf(\"%d\\n\", p->num);\n  return 0;\n}\n"}
{"label": "2", "index": "2147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[26];\n} book[999];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a;\n  char c;\n  int max = 0;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %s\", &book[i].num, book[i].author);\n\n  int s[26];\n  for (i = 0; i <= 25; i++)\n    s[i] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (0 <= (book[i].author[j] - 'A') && (book[i].author[j] - 'A') <= 25) {\n        a = book[i].author[j] - 'A';\n        s[a] = s[a] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (max < s[i]) {\n      max = s[i];\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (max == s[i]) {\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (book[i].author[j] == c) {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2148", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[100], C[26] = {0}, n, i, j, m, a = 0, b;\n  char B[100][100], c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &A[i], B[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      m = B[i][j];\n      C[m - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a < C[i]) {\n      a = C[i];\n      b = i;\n    }\n  }\n  printf(\"%c\\n\", b + 65);\n  printf(\"%d\\n\", a);\n  c = b + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      if (B[i][j] == c) {\n        printf(\"%d\\n\", A[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct aut {\n  char name;\n  int num;\n  int id[1000];\n};\n\nstruct aut author[26];\n\nint main() {\n  int m, i, j, ID, max = 0, maxauthor, k[26] = {0};\n  char c[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++) {\n    author[i].name = 'A' + i;\n    author[i].num = 0;\n  }\n  for (i = 0; i < m; i++) {\n    cin >> ID >> c;\n    for (j = 0; c[j]; j++) {\n      author[c[j] - 'A'].id[k[c[j] - 'A']] = ID;\n      k[c[j] - 'A']++;\n      author[c[j] - 'A'].num++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i].num > max) {\n      max = author[i].num;\n      maxauthor = i;\n    }\n  }\n  cout << author[maxauthor].name << \"\\n\" << author[maxauthor].num << \"\\n\";\n  for (i = 0; i < author[maxauthor].num; i++) {\n    printf(\"%d\\n\", author[maxauthor].id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int n;\n  char s[26];\n} b[1000];\n\nint main() {\n  int n, i, j, c[26] = {0};\n  char t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int d, m;\n    scanf(\"%d%s\", &b[i].n, b[i].s);\n    d = strlen(b[i].s);\n    for (m = 0; m < d; m++)\n      c[b[i].s[m] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++)\n      if (c[j] > c[i])\n        break;\n    if (j == 26)\n      break;\n  }\n  t = 65 + i;\n  printf(\"%c\\n%d\\n\", t, c[i]);\n  for (i = 0; i < n; i++) {\n    if (strchr(b[i].s, t) != NULL)\n      printf(\"%d\\n\", b[i].n);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, seq = 0;\n  int a[26] = {0};\n\n  scanf(\"%d\", &n);\n  struct book {\n    int num;\n    char str[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, &book[i].str);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      a[(book[i].str[j] - 65)]++;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      seq = i;\n    }\n\n  printf(\"%c\\n\", seq + 65);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      if (book[i].str[j] == seq + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int n, i, j, a[26] = {0}, len[1000], k, max = 0;\n  struct book list[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &list[i].num);\n    scanf(\"%s\", list[i].name);\n    len[i] = strlen(list[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (list[j].name[k] == i + 65) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (list[i].name[j] == k + 65)\n        printf(\"%d\\n\", list[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct BOOK {\n  int id;\n  int author[26];\n};\nint main() {\n  struct BOOK book[1000];\n  int countauthor[26];\n  int n, i, j, minusA, no, count, max = 0, maxau;\n  char input[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      book[i].author[j] = 0;\n    }\n  } \n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &book[i].id);\n    scanf(\"%s\", &input);\n    no = strlen(input);\n    for (j = 0; j < no; j++) {\n      minusA = (input[j] - 'A');\n      book[i].author[minusA]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      if (book[j].author[i] == 1)\n        count++;\n    }\n    countauthor[i] = count;\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < countauthor[i])\n      max = countauthor[i];\n  } \n  for (i = 0; i < 26; i++) {\n    if (countauthor[i] == max)\n      maxau = i;\n  } \n  printf(\"%c\\n%d\\n\", (maxau + 'A'), max);\n  for (i = 0; i < n; i++) {\n    if (book[i].author[maxau] == 1) {\n      printf(\"%d\\n\", book[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct inf {\n  int sum;\n  char write[1000][4];\n};\nint main() {\n  int m;\n  int i, j;\n  char name[5];\n  char author[27];\n  struct inf book[26];\n  for (i = 0; i < 26; i++)\n    book[i].sum = 0;\n\n  cin >> m;\n  cin.get();\n\n  while (m-- > 0) {\n    cin.get(name, 5);\n    cin.getline(author, 27);\n    for (i = 0; i < strlen(author); i++) {\n      book[author[i] - 'A'].sum++;\n      for (j = 0; j <= 3; j++) {\n        if (j < 3)\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = name[j];\n        else\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = '\\0';\n      }\n    }\n  }\n\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (book[i].sum > max) {\n      t = i;\n      max = book[i].sum;\n    }\n  }\n\n  cout << (char)(t + 'A') << endl << book[t].sum << endl;\n  for (i = 1; i <= book[t].sum; i++)\n    cout << book[t].write[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint main() {\n  struct book *p1, *p2, *head = NULL;\n  int i, j, n, m, k, a[26], max, first;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d%s\", &p1->num, p1->name);\n    if (i == 0)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      k = p1->name[j] - 'A';\n      a[k]++;\n    }\n    p1 = p1->next;\n  }\n\n  max = a[0];\n  first = 0;\n  for (k = 1; k < 26; k++) {\n    if (a[k] > max) {\n      max = a[k];\n      first = k;\n    }\n  }\n  printf(\"%c \", 'A' + first);\n  printf(\"%d \", max);\n\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      if (p1->name[j] == 'A' + first) {\n        cout << p1->num << \" \";\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct list_1 {\n  int num;\n  char author[26];\n};\n\nstruct number {\n  int a;\n  int time;\n};\n\nint main() {\n  int i, j, m, k, length;\n  struct list_1 book[100];\n  struct number name[26], most;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n\n  for (i = 0; i < 26; i++) {\n    name[i].a = i;\n    name[i].time = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      name[k - 65].time++;\n    }\n  }\n\n  most = name[0];\n\n  for (i = 1; i < 26; i++) {\n    if (name[i].time > most.time) {\n      most = name[i];\n    }\n  }\n\n  printf(\"%c %d \", most.a + 65, most.time);\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      if (most.a + 65 == k) {\n        printf(\"%d \", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2157", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, max;\n  char name[2000][30], alp[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  int No[2000], num[30] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> No[i] >> name[i];\n  }\n  for (i = 0; i < 26; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < strlen(name[k]); j++) {\n        if (name[k][j] == alp[i]) {\n          num[i]++;\n          break;\n        }\n      }\n    }\n  }\n  max = num[0];\n  for (i = 1; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] == max) {\n      printf(\"%c\\n%d\\n\", alp[i], max);\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < 27; j++) {\n          if (name[k][j] == alp[i]) {\n            printf(\"%d\\n\", No[k]);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, q = 0, t = 0, u, max;\n  int b[26] = {0};\n  char c[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct as {\n    int sh;\n    char a[26];\n  } cla[1000];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> cla[i].sh >> cla[i].a;\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++) {\n      u = cla[i].a[k] - 'A';\n      b[u]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++)\n    if (max < b[j]) {\n      max = b[j];\n      q = j;\n    }\n  printf(\"%c\\n\", c[q]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++)\n      if (cla[i].a[k] == c[q])\n        printf(\"%d\\n\", cla[i].sh);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2159", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, sum[26] = {0}, m, j, max = 0, p;\n  struct book {\n    int num;\n    char au[27];\n    int l;\n  };\n  struct book bk[1000];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bk[i].num, bk[i].au);\n    bk[i].l = strlen(bk[i].au);\n    for (j = 0; j < bk[i].l; j++) {\n      switch (bk[i].au[j]) {\n      case 'A':\n        sum[0] += 1;\n        break;\n      case 'B':\n        sum[1] += 1;\n        break;\n      case 'C':\n        sum[2] += 1;\n        break;\n      case 'D':\n        sum[3] += 1;\n        break;\n      case 'E':\n        sum[4] += 1;\n        break;\n      case 'F':\n        sum[5] += 1;\n        break;\n      case 'G':\n        sum[6] += 1;\n        break;\n      case 'H':\n        sum[7] += 1;\n        break;\n      case 'I':\n        sum[8] += 1;\n        break;\n      case 'J':\n        sum[9] += 1;\n        break;\n      case 'K':\n        sum[10] += 1;\n        break;\n      case 'L':\n        sum[11] += 1;\n        break;\n      case 'M':\n        sum[12] += 1;\n        break;\n      case 'N':\n        sum[13] += 1;\n        break;\n      case 'O':\n        sum[14] += 1;\n        break;\n      case 'P':\n        sum[15] += 1;\n        break;\n      case 'Q':\n        sum[16] += 1;\n        break;\n      case 'R':\n        sum[17] += 1;\n        break;\n      case 'S':\n        sum[18] += 1;\n        break;\n      case 'T':\n        sum[19] += 1;\n        break;\n      case 'U':\n        sum[20] += 1;\n        break;\n      case 'V':\n        sum[21] += 1;\n        break;\n      case 'W':\n        sum[22] += 1;\n        break;\n      case 'X':\n        sum[23] += 1;\n        break;\n      case 'Y':\n        sum[24] += 1;\n        break;\n      case 'Z':\n        sum[25] += 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      p = i;\n    } else\n      ;\n  }\n  printf(\"%c %d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < bk[i].l; j++) {\n      if (bk[i].au[j] == p + 65) {\n        printf(\" %d\", bk[i].num);\n        break;\n      } else\n        ;\n    }\n  }\n}\n"}
{"label": "2", "index": "2160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, book[1000], i, j, countt[26] = {0}, len, max = -1, maxauthor;\n  char peo[1000][27], sum[100000] = \"\\0\", ch;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> book[i] >> peo[i];\n    strcat(sum, peo[i]);\n  }\n  len = strlen(sum);\n  for (i = 0; i < len; i++)\n    countt[sum[i] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (countt[i] > max) {\n      max = countt[i];\n      maxauthor = i;\n    }\n\n  ch = maxauthor + 65;\n  int p = 0, t = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(peo[i]); j++)\n      if (peo[i][j] == ch)\n        p++;\n    if (p > 0)\n      book[i - t] = book[i];\n    else\n      t++;\n    p = 0;\n  }\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", n - t);\n  for (i = 1; i <= n - t; i++)\n    printf(\"%d\\n\", book[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2161", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct s {\n    int N;\n    char w[26];\n  };\n  struct s s[999];\n  int n, i, j, c, a[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &s[i].N);\n\n    cin >> s[i].w;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++) {\n      c = s[i].w[j];\n      a[c - 65]++;\n    }\n  }\n  c = 0;\n  for (i = 0; i <= 25; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  printf(\"%c %d \", c + 65, a[c]);\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++)\n      if (s[i].w[j] == (c + 65))\n        printf(\"%d \", s[i].N);\n  }\n}\n"}
{"label": "2", "index": "2162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  int book[1000];\n  char person[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  char people[100][100];\n  int i, j;\n  int l;\n  int t[100] = {0};\n  for (i = 1; i <= m; i++) {\n    cin >> book[i];\n    cin >> people[i];\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      t[people[i][j] - 'A']++;\n    }\n  }\n  int max = 0, tt;\n  for (i = 0; i <= 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      tt = i;\n    }\n  }\n  cout << person[tt] << endl;\n  cout << max << endl;\n  int k;\n  int already[26] = {1};\n  for (i = 1; i <= m; i++) {\n\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      if (people[i][j] == person[tt])\n\n      {\n        cout << book[i] << \"\\n\";\n        for (k = 0; k < l; k++) {\n          if ((people[i][k] != person[tt]) &&\n              (already[people[i][k] - 'A'] != 0)) {\n\n            already[people[i][k] - 'A'] = 0;\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a[1000], l[1000], i, j, k, t, time[26] = {0}, max, q = 0;\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char b[1000][26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    l[i] = strlen(b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == name[k])\n          time[k]++;\n      }\n    }\n  }\n  max = time[0];\n  for (i = 1; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", name[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (b[i][j] == name[t])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2164", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  char wri[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26];\n  char tem[100];\n  int j = 0, k;\n  int shu[26][100];\n  int hao;\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> hao >> tem;\n    j = 0;\n    while (tem[j] != '\\0') {\n      for (k = 0; k <= 25; k++) {\n        if (wri[k] == tem[j]) {\n          shu[k][num[k]] = hao;\n          num[k]++;\n        }\n      }\n      j++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", wri[max], num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", shu[max][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, max, t, i, j, a[1000], l, b[30] = {0}, c;\n  char str[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], str[i]);\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      b[str[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 64, b[t]);\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      if (str[i][j] == t + 64)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2166", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, num[1000], m, a[1000][26], k, sum[26], max = 0, b;\n  char writer[1000][26],\n      letter[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d \", &m);\n  for (k = 0; k < 26; k++) {\n    sum[k] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      a[i][j] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> writer[i];\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (writer[i][j] == letter[k]) {\n          a[i][k]++;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      sum[k] = sum[k] + a[i][k];\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (max < sum[k]) {\n      max = sum[k];\n      b = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[b], max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (writer[i][j] == letter[b]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, card[1000], num[26] = {0}, max = 0, k = 0;\n  char s[1000][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &card[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      num[s[i][j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  cout << k + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != 0; j++)\n      if (s[i][j] == k + 'A') {\n        cout << card[i] << \"\\n\";\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, a[1000] = {0}, count[30] = {0}, temp, j, max = -999, flag;\n  char s[1000][30] = {0}, cha;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < 30; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = 0;\n        continue;\n      }\n      if (s[i][j] == '\\n') {\n        s[i][j] = 0;\n        break;\n      }\n      temp = s[i][j] - 'A' + 1;\n      count[temp] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] >= max) {\n      flag = i;\n      max = count[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", flag + 64, max);\n  cha = 'A' + flag - 1;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j < 30; j++) {\n      if (s[i][j] == cha) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0, maxi = 0;\n  int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};\n  char zz[1100][30];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> zz[i];\n    for (j = 0; zz[i][j] != '\\0'; j++) {\n      b[(int)zz[i][j] - 'A']++;\n      c[(int)zz[i][j] - 'A'][i] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      maxi = i;\n    }\n  }\n  cout << (char)(maxi + 'A') << endl;\n  cout << max << \"\\n\";\n  for (i = 1; i <= 1000; i++) {\n    if (c[maxi][i] == 1)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, shu[1000], num[26], length[1000];\n  char author[1000][26], maxauthor;\n  cin >> m;\n  memset(num, 0, sizeof(num));\n  for (int i = 0; i < m; i++) {\n    cin >> shu[i] >> author[i];\n    length[i] = strlen(author[i]);\n    for (int j = 0; j < length[i]; j++) \n      num[author[i][j] - 'A'] += 1;\n  }\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (maxnum < num[i])\n      maxnum = num[i]; \n  }\n  for (int i = 0; i < 26; i++) {\n    if (num[i] == maxnum) \n    {\n      maxauthor = (char)('A' + i);\n      cout << maxauthor << endl;\n      cout << maxnum << endl;\n      break;\n    }\n  }\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < length[i]; j++) {\n      if (author[i][j] == maxauthor) \n        cout << shu[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } bookn[999];\n  struct zuozhe {\n    char w;\n    int count;\n  } zuozhen[26];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    zuozhen[i].w = 'A' + i;\n    zuozhen[i].count = 0;\n  }\n  int h = 0;\n  int m, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bookn[i].num, bookn[i].writer);\n    m = strlen(bookn[i].writer);\n    for (j = 0; j < m; j++) {\n      h = bookn[i].writer[j] - 'A';\n      zuozhen[h].count++;\n    }\n  }\n  struct zuozhe a;\n  a = zuozhen[0];\n  for (i = 1; i < 26; i++) {\n    if (a.count < zuozhen[i].count)\n      a = zuozhen[i];\n  }\n  printf(\"%c\\n\", a.w);\n  printf(\"%d\\n\", a.count);\n  int t;\n  for (i = 0; i < n; i++) {\n    t = strlen(bookn[i].writer);\n    for (j = 0; j < t; j++) {\n      if (bookn[i].writer[j] == a.w)\n        printf(\"%d\\n\", bookn[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct information {\n  int a;\n  char s[26];\n  int len;\n} xinxi[1000];\n\nint main() {\n  int n, i, c[26] = {0}, max, t, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &xinxi[i].a, xinxi[i].s);\n    xinxi[i].len = strlen(xinxi[i].s);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++) {\n      if (xinxi[i].s[j] == 'A')\n        c[1]++;\n      if (xinxi[i].s[j] == 'B')\n        c[2]++;\n      if (xinxi[i].s[j] == 'C')\n        c[3]++;\n      if (xinxi[i].s[j] == 'D')\n        c[4]++;\n      if (xinxi[i].s[j] == 'E')\n        c[5]++;\n      if (xinxi[i].s[j] == 'F')\n        c[6]++;\n      if (xinxi[i].s[j] == 'G')\n        c[7]++;\n      if (xinxi[i].s[j] == 'H')\n        c[8]++;\n      if (xinxi[i].s[j] == 'I')\n        c[9]++;\n      if (xinxi[i].s[j] == 'J')\n        c[10]++;\n      if (xinxi[i].s[j] == 'K')\n        c[11]++;\n      if (xinxi[i].s[j] == 'L')\n        c[12]++;\n      if (xinxi[i].s[j] == 'M')\n        c[13]++;\n      if (xinxi[i].s[j] == 'N')\n        c[14]++;\n      if (xinxi[i].s[j] == 'O')\n        c[15]++;\n      if (xinxi[i].s[j] == 'P')\n        c[16]++;\n      if (xinxi[i].s[j] == 'Q')\n        c[17]++;\n      if (xinxi[i].s[j] == 'R')\n        c[18]++;\n      if (xinxi[i].s[j] == 'S')\n        c[19]++;\n      if (xinxi[i].s[j] == 'T')\n        c[20]++;\n      if (xinxi[i].s[j] == 'U')\n        c[21]++;\n      if (xinxi[i].s[j] == 'V')\n        c[22]++;\n      if (xinxi[i].s[j] == 'W')\n        c[23]++;\n      if (xinxi[i].s[j] == 'X')\n        c[24]++;\n      if (xinxi[i].s[j] == 'Y')\n        c[25]++;\n      if (xinxi[i].s[j] == 'Z')\n        c[26]++;\n    }\n  max = c[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 64 + t);\n  printf(\"%d\\n\", c[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++)\n      if (xinxi[i].s[j] == 64 + t)\n        printf(\"%d\\n\", xinxi[i].a);\n}\n"}
{"label": "2", "index": "2173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[26];\n} book[1000];\nint main() {\n  int n, i, j, max = 0;\n  scanf(\"%d\", &n);\n  char da, c;\n  int temp[27] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    for (da = 'A'; da <= 'Z'; da++) {\n      for (j = 0; j < 26; j++) {\n        if (book[i].writer[j] == da)\n          temp[da - 'A' + 0]++;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] > max) {\n      max = temp[j];\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] == max) {\n      c = j + 65;\n      printf(\"%c\\n%d\\n\", c, temp[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == c)\n        cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int no;\n  char wri[27];\n} book[1000];\n\nint main() {\n  int n, i, j, k = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].no, book[i].wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      a[book[i].wri[j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[0]) {\n      a[0] = a[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", 'A' + k, a[0]);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      if (book[i].wri[j] == 'A' + k) {\n        printf(\"%d\\n\", book[i].no);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2175", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cishu[26];\n\nstruct shu {\n  int num;\n  char name[26];\n  struct shu *next;\n};\n\nstruct shu *app(int n) {\n  int i, len, j;\n  struct shu *newnode, *p, *head;\n  for (i = 1; i <= n; i++) {\n    newnode = (struct shu *)malloc(sizeof(struct shu));\n    scanf(\"%d %s\", &newnode->num, newnode->name);\n    len = strlen(newnode->name);\n\n    for (j = 0; j < len; j++) {\n      cishu[newnode->name[j] - 'A']++;\n    }\n\n    if (i == 1) {\n      head = newnode;\n    } else {\n      p->next = newnode;\n    }\n    p = newnode;\n  }\n  p->next = 0;\n  return head;\n}\n\nint max(void) {\n  int m = 0, i, x;\n  for (i = 0; i < 26; i++) {\n    if (cishu[i] > m) {\n      m = cishu[i];\n      x = i;\n    }\n  }\n  return x;\n}\n\nint cunzai(char a[], int kk) {\n  int l, i;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (a[i] == kk + 'A')\n      return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int n, kk;\n  struct shu *head, *p;\n  scanf(\"%d\", &n);\n\n  head = app(n);\n  kk = max();\n  printf(\"%c\\n%d\\n\", 'A' + kk, cishu[kk]);\n\n  for (p = head; p != 0; p = p->next) {\n    if (cunzai(p->name, kk)) {\n      printf(\"%d\\n\", p->num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int b[1000];\n  char s[1000][26];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i], &s[i]);\n  }\n  int a[26] = {0};\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      switch (s[i][j]) {\n      case 'A':\n        a[0] = a[0] + 1;\n        break;\n      case 'B':\n        a[1] = a[1] + 1;\n        break;\n      case 'C':\n        a[2] = a[2] + 1;\n        break;\n      case 'D':\n        a[3] = a[3] + 1;\n        break;\n      case 'E':\n        a[4] = a[4] + 1;\n        break;\n      case 'F':\n        a[5] = a[5] + 1;\n        break;\n      case 'G':\n        a[6] = a[6] + 1;\n        break;\n      case 'H':\n        a[7] = a[7] + 1;\n        break;\n      case 'I':\n        a[8] = a[8] + 1;\n        break;\n      case 'J':\n        a[9] = a[9] + 1;\n        break;\n      case 'K':\n        a[10] = a[10] + 1;\n        break;\n      case 'L':\n        a[11] = a[11] + 1;\n        break;\n      case 'M':\n        a[12] = a[12] + 1;\n        break;\n      case 'N':\n        a[13] = a[13] + 1;\n        break;\n      case 'O':\n        a[14] = a[14] + 1;\n        break;\n      case 'P':\n        a[15] = a[15] + 1;\n        break;\n      case 'Q':\n        a[16] = a[16] + 1;\n        break;\n      case 'R':\n        a[17] = a[17] + 1;\n        break;\n      case 'S':\n        a[18] = a[18] + 1;\n        break;\n      case 'T':\n        a[19] = a[19] + 1;\n        break;\n      case 'U':\n        a[20] = a[20] + 1;\n        break;\n      case 'V':\n        a[21] = a[21] + 1;\n        break;\n      case 'W':\n        a[22] = a[22] + 1;\n        break;\n      case 'X':\n        a[23] = a[23] + 1;\n        break;\n      case 'Y':\n        a[24] = a[24] + 1;\n        break;\n      default:\n        a[25] = a[25] + 1;\n      }\n    }\n  }\n  int m;\n  char z;\n  m = a[0], z = c[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > m)\n      m = a[i], z = c[i];\n  }\n  printf(\"%c\\n%d\\n\", z, m);\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == z) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2177", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char aut[26];\n};\n\nint main() {\n  int m, i, j, k;\n  int a[27] = {0};\n  struct book cal[1001];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> cal[i].id >> cal[i].aut;\n  }\n  for (j = 65; j < 91; j++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < 27; k++) {\n        if (cal[i].aut[k] == j)\n          a[j - 65]++;\n      }\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (cal[i].aut[j] == t + 65)\n        printf(\"%d\\n\", cal[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char author[27];\n  struct book *next;\n};\n\nstruct book *creat() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct book *p1, *head, *p0;\n  head = NULL;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p0 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p0->id, p0->author);\n    if (head == NULL) {\n      p1 = p0;\n      head = p1;\n      p0->next = NULL;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n      p1 = p0;\n    }\n  }\n  return (head);\n}\nchar best(struct book *head) {\n  int i, max, a[26];\n  struct book *p;\n  p = head;\n  for (i = 0; i < 26; ++i)\n    a[i] = 0;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      a[p->author[i] - 'A']++;\n      i++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (i == 0)\n      max = i;\n    else if (a[i] > a[max])\n      max = i;\n  }\n  return ('A' + max);\n}\nvoid print(char x, struct book *head) {\n  int i, k = 0;\n  char a = x;\n  struct book *p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        k++;\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", a, k);\n  p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        cout << p->id << \"\\n\";\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  char writer;\n  struct book *head;\n  head = creat();\n  writer = best(head);\n  print(writer, head);\n  return 0;\n}\n"}
{"label": "2", "index": "2179", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Books {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int n;\n  int i, j;\n  int x;\n  int max = 0;\n  char letter = 'A';\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].num, a[i].author);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (a[i].author[j] >= 65 && a[i].author[j] <= 90) {\n        x = a[i].author[j];\n        b[x - 65]++;\n      } else {\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      letter = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == letter)\n        printf(\"%d\\n\", a[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2180", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[26] = {0};\n  char z[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char nn[26][100][20];\n  int m, i, j, r;\n  char a[100][100];\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    scanf(\"%s\", a[j]);\n    char b[20];\n    scanf(\"%s\", b);\n    int w = strlen(b);\n    for (i = 0; i < w; i++) {\n      for (r = 0; r < 26; r++) {\n        if (b[i] == z[r]) {\n          n[r]++;\n          strcpy(nn[r][n[r]], a[j]);\n        }\n      }\n    }\n  }\n  int c = 0;\n  for (r = 1; r < 26; r++) {\n    if (n[r] > n[c])\n      c = r;\n  }\n  printf(\"%c\\n%d\\n\", z[c], n[c]);\n  for (i = 1; i <= n[c]; i++)\n    printf(\"%s\\n\", nn[c][i]);\n}\n"}
{"label": "2", "index": "2181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[26] = {0};\nint n;\nint max_1;\nint hao;\nstruct chushu {\n  int num;\n  char s[30];\n  struct chushu *next;\n};\nstruct chushu *create() {\n  int j = 0, q, i = 0, k = 0;\n\n  struct chushu *head, *p1, *p2;\n  p1 = (struct chushu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->s);\n\n  for (i = 0; p1->s[i] != '\u0000'; i++) {\n    j = p1->s[i] - 65;\n    a[j] = a[j] + 1;\n  }\n\n  head = p1;\n  p2 = p1;\n  while (k < n - 1) {\n    k++;\n    p2 = p1;\n    p1 = (struct chushu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n\n    for (i = 0; p1->s[i] != '\u0000'; i++) {\n      j = p1->s[i] - 65;\n      a[j] = a[j] + 1;\n    }\n\n    p2->next = p1;\n  }\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nvoid search(struct chushu *head) {\n  int i;\n  struct chushu *p;\n  p = head;\n  while (p->next != NULL) {\n    for (i = 0; p->s[i] != '\u0000'; i++) {\n      if (hao + 65 == p->s[i])\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n  for (i = 0; p->s[i] != '\u0000'; i++) {\n    if (hao + 65 == p->s[i])\n      printf(\"%d \", p->num);\n  }\n}\n\nint main() {\n  int i;\n  struct chushu *p;\n\n  scanf(\"%d\", &n);\n  p = create();\n  max_1 = 0;\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max_1) {\n      max_1 = a[i];\n      hao = i;\n    }\n  }\n  printf(\"%c \", hao + 65);\n  cout << max_1 << \" \";\n  search(p);\n}\n"}
{"label": "2", "index": "2182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int num;\n  char author[26];\n};\n\nint main() {\n  struct shu shu[999];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n  int a[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == 'A')\n        a[0] = a[0] + 1;\n      else if (shu[i].author[j] == 'B')\n        a[1] = a[1] + 1;\n      else if (shu[i].author[j] == 'C')\n        a[2] = a[2] + 1;\n      else if (shu[i].author[j] == 'D')\n        a[3] = a[3] + 1;\n      else if (shu[i].author[j] == 'E')\n        a[4] = a[4] + 1;\n      else if (shu[i].author[j] == 'F')\n        a[5] = a[5] + 1;\n      else if (shu[i].author[j] == 'G')\n        a[6] = a[6] + 1;\n      else if (shu[i].author[j] == 'H')\n        a[7] = a[7] + 1;\n      else if (shu[i].author[j] == 'I')\n        a[8] = a[8] + 1;\n      else if (shu[i].author[j] == 'J')\n        a[9] = a[9] + 1;\n      else if (shu[i].author[j] == 'K')\n        a[10] = a[10] + 1;\n      else if (shu[i].author[j] == 'L')\n        a[11] = a[11] + 1;\n      else if (shu[i].author[j] == 'M')\n        a[12] = a[12] + 1;\n      else if (shu[i].author[j] == 'N')\n        a[13] = a[13] + 1;\n      else {\n        if (shu[i].author[j] == 'O')\n          a[14] = a[14] + 1;\n        else if (shu[i].author[j] == 'P')\n          a[15] = a[15] + 1;\n        else if (shu[i].author[j] == 'Q')\n          a[16] = a[16] + 1;\n        else if (shu[i].author[j] == 'R')\n          a[17] = a[17] + 1;\n        else if (shu[i].author[j] == 'S')\n          a[18] = a[18] + 1;\n        else if (shu[i].author[j] == 'T')\n          a[19] = a[19] + 1;\n        else if (shu[i].author[j] == 'U')\n          a[20] = a[20] + 1;\n        else if (shu[i].author[j] == 'V')\n          a[21] = a[21] + 1;\n        else if (shu[i].author[j] == 'W')\n          a[22] = a[22] + 1;\n        else if (shu[i].author[j] == 'X')\n          a[23] = a[23] + 1;\n        else if (shu[i].author[j] == 'Y')\n          a[24] = a[24] + 1;\n        else if (shu[i].author[j] == 'Z')\n          a[25] = a[25] + 1;\n      }\n    }\n  }\n  k = a[0], m = 0;\n  for (i = 0; i < 26; i++) {\n    if (k < a[i]) {\n      k = a[i];\n      m = i;\n    }\n  }\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  printf(\"%c\\n\", b[m]);\n  cout << k << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == b[m]) {\n        printf(\"%d\\n\", shu[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct shu {\n    int bian;\n    char name[26];\n  };\n\n  struct shu a[1000];\n  int n, i, j, l[1000], b[26] = {0}, most, good, k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].bian, a[i].name);\n  for (i = 0; i < n; i++)\n    l[i] = strlen(a[i].name);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < l[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (a[i].name[j] == 65 + k)\n          b[k]++;\n\n  most = b[0];\n  for (i = 0; i < 26; i++)\n    if (b[i] > most) {\n      most = b[i];\n      good = i;\n    }\n  printf(\"%c\\n\", 65 + good);\n  printf(\"%d\\n\", most);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].name[j] == 65 + good) {\n        printf(\"%d\\n\", a[i].bian);\n      }\n}\n"}
{"label": "2", "index": "2184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int no;\n  char wr[26];\n} book[999];\nstruct {\n  char name;\n  int num;\n  int book[999];\n} a[26];\n\nint main() {\n  int n, m, t, k, d;\n  int all = 0;\n  for (t = 0; t < 26; t++) {\n    a[t].name = 'A' + t;\n    a[t].num = 0;\n  }\n  scanf(\"%d\", &m);\n  for (t = 0; t < m; t++) {\n    scanf(\"%d %s\", &book[t].no, book[t].wr);\n  }\n\n  for (t = 0; t < m; t++) {\n    k = strlen(book[t].wr);\n    for (n = 0; n < k; n++) {\n      for (d = 0; d < 26; d++) {\n        if (a[d].name == book[t].wr[n]) {\n          a[d].book[a[d].num] = book[t].no;\n          a[d].num++;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n\n  for (t = 0; t < 26; t++) {\n    if (k < a[t].num)\n      k = a[t].num;\n  }\n\n  for (t = 0;; t++) {\n    if (k == a[t].num) {\n      cout << a[t].name;\n      printf(\"\\n%d\", a[t].num);\n      for (d = 0; d < a[t].num; d++)\n        cout << \"\\n\" << a[t].book[d];\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int array[26]) {\n  int i, max = 0;\n  for (i = 0; i < 26; i++)\n    if (array[i] > max)\n      max = array[i];\n  for (i = 0; i < 26; i++)\n    if (max == array[i])\n      break;\n  return i;\n}\nint main() {\n  struct book {\n    int num;\n    char aut[26];\n  };\n  int a, i, j, m, k, t[26] = {0};\n  struct book nbook[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> nbook[i].num >> nbook[i].aut;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      for (k = 0; k < 26; k++)\n        if (nbook[i].aut[j] == k + 65)\n          t[k]++;\n  a = max(t);\n  cout << a + 65 << \"\\n\" << t[a] << \"\\n\";\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (nbook[i].aut[j] == a + 65)\n        printf(\"%d\\n\", nbook[i].num);\n  return 0;\n}\n"}
{"label": "2", "index": "2186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, no[1000], shu[26] = {0}, max = 0;\n  char s[1000][20], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &no[i], s[i]);\n    for (j = 0; j < strlen(s[i]); j++) {\n      shu[s[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++) {\n    if (strchr(s[i], c))\n      printf(\"%d\\n\", no[i]);\n  }\n}\n"}
{"label": "2", "index": "2187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct BOOK {\n  int id;\n  int author[26];\n};\nint main() {\n  struct BOOK book[1000];\n  int countauthor[26];\n  int n, i, j, minusA, no, count, max = 0, maxau;\n  char input[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      book[i].author[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &book[i].id);\n    scanf(\"%s\", &input);\n    no = strlen(input);\n    for (j = 0; j < no; j++) {\n      minusA = (input[j] - 'A');\n      book[i].author[minusA]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      if (book[j].author[i] == 1)\n        count++;\n    }\n    countauthor[i] = count;\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < countauthor[i])\n      max = countauthor[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (countauthor[i] == max)\n      maxau = i;\n  }\n  printf(\"%d\\n%d\\n\", (maxau + 'A'), max);\n  for (i = 0; i < n; i++) {\n    if (book[i].author[maxau] == 1) {\n      cout << book[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[26], max, num[n], i, j, s;\n  char maxname, name[n][10];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> name[i];\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      a[name[i][j] - 'A']++;\n  }\n  max = a[0], maxname = 'A';\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i], maxname = 'A' + i;\n    }\n  printf(\"%c\\n%d\\n\", maxname, max);\n  for (i = 0; i < n; i++) {\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      if (name[i][j] == maxname)\n        cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp;\n  int author[27][500] = {\n      0,\n  };\n  char str[1000];\n  scanf(\"%d \", &num);\n  for (int i = 1; i <= num; i++) {\n    cin >> temp;\n    getchar();\n    cin >> str;\n    for (int j = 0; j < strlen(str); j++) {\n      author[str[j] - 'A' + 1][0]++;\n      author[str[j] - 'A' + 1][author[str[j] - 'A' + 1][0]] = temp;\n    }\n  }\n  int temp_num = 0, temp_author;\n  for (int i = 1; i <= 26; i++) {\n    if (author[i][0] > temp_num) {\n      temp_num = author[i][0];\n      temp_author = i;\n    }\n  }\n  cout << (char)(temp_author + 'A' - 1) << endl;\n  printf(\"%d\\n\", temp_num);\n  for (int i = 1; i <= temp_num; i++) {\n    printf(\"%d\\n\", author[temp_author][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int a[1000];\n  char s[1000][26];\n  int i, j;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n\n  char x;\n  int max = 0;\n  char maxx;\n  int l;\n  for (x = 'A'; x <= 'Z'; x++) {\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (s[i][j] == x)\n          break;\n      }\n      if (j != 26)\n        l++;\n    }\n    if (l > max) {\n      max = l;\n      maxx = x;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxx, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (s[i][j] == maxx)\n        break;\n    }\n    if (j != 26)\n      cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2191", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char name[26];\n  int name_num[26];\n} book[999];\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, &book[i].name);\n  }\n\n  int count[26] = {0};\n  int k;\n  for (i = 0; i < n; i++) {\n    int len;\n    len = strlen(book[i].name);\n    for (k = 0; k < len; k++) {\n      book[i].name_num[k] = (int)book[i].name[k];\n    }\n  }\n\n  int j;\n  int y;\n  for (i = 0; i < n; i++) {\n    int len_1;\n    len_1 = strlen(book[i].name);\n    for (j = 65; j <= 90; j++) {\n      for (y = 0; y < len_1; y++) {\n        if (book[i].name_num[y] == j) {\n          count[j - 65]++;\n        }\n      }\n    }\n  }\n\n  int w;\n  int max = count[0];\n  int t = 0;\n  for (w = 0; w < 26; w++) {\n    if (count[w] > max) {\n      max = count[w];\n      t = w;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  int x;\n\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(book[i].name);\n    for (x = 0; x < length; x++) {\n      if (book[i].name_num[x] == t + 65) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], max = 0, t, p[26] = {0};\n  char c[1000][27],\n      l[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> c[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      for (k = 0; k < 26; k++) {\n        if (c[i][j] == l[k])\n          p[k] += 1;\n      }\n  for (k = 0; k < 26; k++)\n    if (p[k] > max) {\n      max = p[k];\n      t = k;\n    }\n  printf(\"%c\\n%d\\n\", l[t], max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if (c[i][j] == l[t]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[100];\n};\n\nint main() {\n  int n, i, j, a[26], c[100], k, t, d[100], s;\n  struct book bo[100];\n\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &bo[i].num);\n    scanf(\"%s\", bo[i].writer);\n  }\n\n  for (i = 0; i < n; i++) {\n    c[i] = strlen(bo[i].writer);\n    for (j = 0; j < c[i]; j++) {\n      k = bo[i].writer[j] - 'A';\n      a[k]++;\n    }\n  }\n\n  t = a[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > t) {\n      j = i;\n      t = a[i];\n    }\n  }\n  s = j;\n\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < n; i++) {\n    d[i] = 0;\n    for (j = 0; j < c[i]; j++) {\n      if (bo[i].writer[j] == ('A' + s))\n        d[i] = 1;\n    }\n    if (d[i] == 1)\n      printf(\"%d\\n\", bo[i].num);\n  }\n}\n"}
{"label": "2", "index": "2194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int order;\n  int num;\n  char writer[26];\n} b[1000];\nint main() {\n  int n, i, j, k, p, q[1000];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].writer);\n    b[i].order = i;\n  }\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26];\n  char d[26];\n  for (j = 0; j <= 25; j++) {\n    d[j] = 0;\n    c[j] = 0;\n  }\n  for (k = 0; k <= 25; k++) {\n    for (i = 0; i <= (n - 1); i++) {\n      p = strlen(b[i].writer);\n      strcpy(d, b[i].writer);\n      for (j = 0; j <= (p - 1); j++) {\n        if (d[j] == a[k]) {\n          c[k] = c[k] + 1;\n        }\n      }\n      for (j = 0; j <= 25; j++)\n        d[j] = 0;\n    }\n  }\n  int max = c[0];\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n    }\n  }\n  char x;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] == max) {\n      x = a[i];\n      printf(\"%c\\n\", a[i]);\n      printf(\"%d\\n\", c[i]);\n    }\n  }\n\n  for (i = 0; i <= 999; i++)\n    q[i] = 0;\n\n  int r = 0;\n  char e[26];\n  for (i = 0; i <= 25; i++) {\n    e[i] = 0;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    p = strlen(b[i].writer);\n    strcpy(e, b[i].writer);\n    for (j = 0; j <= (p - 1); j++) {\n      if (e[j] == x) {\n        q[r] = b[i].num;\n        r = r + 1;\n      }\n    }\n    for (j = 0; j <= 25; j++) {\n      e[j] = 0;\n    }\n  }\n  int s = 0;\n  for (i = 0; i <= 999; i++) {\n    if (q[i] != 0) {\n      s = s + 1;\n    }\n  }\n  for (i = 0; i <= (s - 2); i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  printf(\"%d\", q[s - 1]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, t, m, a[26] = {0}, book[999], max;\n  char writer[999][26], maxwriter;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i], writer[i]);\n    m = strlen(writer[i]);\n    for (j = 0; j < m; j++) {\n      t = writer[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  max = 0;\n  maxwriter = 'A';\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxwriter = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxwriter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == maxwriter) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, book[1000], cnt[60], max;\n  char author[1000][26], p;\n  int b[60][1000];\n  cin >> n;\n  for (int i = 0; i < 60; i++)\n    cnt[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i];\n    cin.get();\n    cin.getline(author[i], 26);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; author[i][j] != '\\0'; j++) {\n      int k = author[i][j] - '0';\n      b[k][cnt[k]++] = book[i]; \n    }\n  }\n  max = cnt[17];\n  p = 'A';\n  for (int i = 17; i <= 42; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      p = i + '0';\n    }\n  }\n  cout << p << endl;\n  cout << max << endl;\n  for (int m = 0; m < max; m++)\n    cout << b[p - '0'][m] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, mid, l = 0;\n  int d[26], e[26];\n  char c[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  head = p1 = p2 = (struct book *)malloc(1000);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &p1->a, p1->b);\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1 = head;\n  for (j = 0; j < 26; j++) {\n    p1 = head;\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if (p1->b[k] == c[j])\n          l++;\n      }\n      d[j] = l;\n      e[j] = l;\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++) {\n      if (d[j] < d[j + 1]) {\n        mid = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = mid;\n      }\n    }\n  for (i = 0; i < 26; i++) {\n    if (e[i] == d[0])\n      break;\n  }\n  printf(\"%c \", c[i]);\n  printf(\"%d \", d[0]);\n  p1 = head;\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < strlen(p1->b); k++) {\n      if (p1->b[k] == c[i])\n        printf(\"%d \", p1->a);\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, b[1000], a[26] = {0}, max;\n  char str[1000][30];\n  int i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], str[i]);\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      t = str[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  t = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      t = i;\n    }\n  }\n  cout << 'A' + t << \"\\n\";\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] == 'A' + t)\n        printf(\"%d\\n\", b[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  char a[1000][10] = {0};\n  char b[1000][30];\n  int len[1000] = {0};\n  int c[150] = {0};\n  int max = 0;\n  int i, j, k, p, q, r, s;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    len[i] = strlen(b[i]);\n\n    for (j = 0; j < len[i]; j++) {\n\n      for (k = 65; k <= 90; k++) {\n        if (b[i][j] == k)\n          c[k]++;\n      }\n    }\n  }\n  for (p = 65; p <= 90; p++) {\n    if (c[p] > max)\n      max = c[p];\n  }\n  for (q = 65; q <= 90; q++) {\n    if (c[q] == max) {\n      printf(\"%c\\n%d\\n\", q, max);\n      for (r = 0; r < m; r++) {\n        for (s = 0; s < len[r]; s++) {\n          if (b[r][s] == q)\n            cout << a[r] << \"\\n\";\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book *head;\nint abc[26];\nstruct book {\n  int num;\n  char name[1000];\n  struct book *next;\n};\n\nvoid ffind(char *name) {\n  while (*name != 0) {\n    abc[*name - 65]++;\n    name++;\n  }\n}\nint mfind(char *name, char a) {\n  while (*name != 0) {\n    if (a == *name)\n      return 1;\n    name++;\n  }\n}\n\nstruct book *creat(int max) {\n  int n;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  head = 0;\n  do {\n    cin >> p1->num >> p1->name;\n    ffind(p1->name);\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p2->next = 0;\n    p1 = (struct book *)malloc(1000);\n  } while (n < max);\n  p2->next = 0;\n  return head;\n}\n\nint main() {\n  int n, i;\n  int max = 0, maxi = 0;\n  char tt[2];\n  struct book *p, *p1;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  p1 = p;\n\n  for (i = 0; i < 26; i++) {\n    if (abc[i] > max) {\n      max = abc[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%C %d \", 65 + maxi, max);\n\n  tt[0] = maxi + 65;\n  tt[1] = 0;\n  do {\n    if (mfind(p1->name, maxi + 65) == 1) {\n      max--;\n      if (max != 0)\n        printf(\"%d \", p1->num);\n      else\n        printf(\"%d\", p1->num);\n    }\n    p1 = p1->next;\n  } while (p1 != 0);\n}\n"}
{"label": "2", "index": "2201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct xinxi {\n  int sh;\n  char zz[20];\n} a[1000];\nint main() {\n  int n, i, l, j, b[26] = {0}, m = 0, k = 0;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].sh, a[i].zz);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      b[a[i].zz[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] > m) {\n      m = b[i];\n      k = i;\n    }\n  c = k + 65;\n  printf(\"%c\\n%d\\n\", c, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      if (a[i].zz[j] == c)\n        printf(\"%d\\n\", a[i].sh);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  long int num;\n  char name[26];\n} book[1000];\nint main() {\n  int m, i, j, r;\n  int writer[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%ld \", &book[i].num);\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    r = strlen(book[i].name);\n    for (j = 0; j < r; j++) {\n      writer[book[i].name[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char w = 'A';\n  for (i = 0; i < 26; i++) {\n    if (writer[i] > max) {\n      max = writer[i];\n      w = i + 'A';\n    }\n  }\n  cout << w << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < r; j++) {\n      r = strlen(book[i].name);\n      if (book[i].name[j] == w) {\n        printf(\"%ld\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int nam;\n  char aut[27];\n} inf[1000];\nint main() {\n  int n, i, a[26] = {0}, k, max = 0, sum = 0;\n  char *p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &inf[i].nam, inf[i].aut);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      a[*p - 65]++;\n      p++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    max = max > a[i] ? max : a[i];\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      break;\n    }\n  }\n  k = i + 65;\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        sum++;\n        break;\n      }\n      p++;\n    }\n  }\n  printf(\"%d\\n\", sum);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        printf(\"%d\\n\", inf[i].nam);\n        break;\n      }\n      p++;\n    }\n  }\n}\n"}
{"label": "2", "index": "2204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char au[30];\n  struct book *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->au);\n  p2 = p1;\n  head = p1;\n  int n = 1;\n  while (n < m) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->au);\n    p2->next = p1;\n    p2 = p1;\n    n++;\n  }\n  p2->next = NULL;\n  char maxa;\n  char author;\n  char temp[30];\n  int an, maxn = 0, i;\n  struct book *p;\n  for (author = 'A'; author <= 'Z';) {\n    p = head;\n    an = 0;\n    while (p) {\n      strcpy(temp, p->au);\n\n      for (i = 0; (temp[i]) != '\u0000'; i++) {\n        if (temp[i] == author) {\n          an++;\n          break;\n        }\n      }\n      p = p->next;\n    }\n    if (an > maxn) {\n      maxa = author;\n      maxn = an;\n    }\n    author = author + 1;\n  }\n  printf(\"%c %d\", maxa, maxn);\n  p = head;\n  while (p) {\n    strcpy(temp, p->au);\n    for (i = 0; (temp[i]) != '\u0000'; i++) {\n      if (temp[i] == maxa) {\n        cout << \" \";\n        printf(\"%d\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  struct bo {\n    int a;\n    char au[36];\n  };\n  struct bo bo[999];\n  int i, j;\n  char k, K;\n  int sb[26] = {0}, sbt;\n  int len;\n  int n;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bo[i].a, bo[i].au);\n    len = strlen(bo[i].au);\n    for (j = 0; j < len; j++) {\n      for (k = 65; k < 91; k++) {\n        if (bo[i].au[j] == k)\n          sb[k - 65]++;\n      }\n    }\n  }\n  K = 0;\n  sbt = 0;\n  for (i = 0; i < 26; i++) {\n    if (sb[i] > sbt) {\n      K = i + 65;\n      sbt = sb[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", K, sbt);\n  for (i = 0; i < m; i++) {\n    n = 1;\n    for (j = 0; j < strlen(bo[i].au); j++) {\n      if (K == bo[i].au[j]) {\n        n = 0;\n      }\n    }\n    if (n == 0) {\n      printf(\"%d\\n\", bo[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "2206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n = 0, book[1000], num[26] = {0};\n  char name[1000][10];\n  cin >> m;\n  for (int i = 1; i <= m; i++)\n    cin >> book[i] >> name[i];\n\n  for (char z = 'A'; z <= 'Z'; z++) {\n    for (int i = 1; i <= m; i++) {\n      for (int j = 0; j < 10; j++)\n        if (name[i][j] == z)\n          num[z - 'A']++;\n    }\n  }\n  int max = 0, k = 0;\n  for (int i = 0; i < 26; i++) {\n    if (max < num[i]) {\n      max = num[i];\n      k = i;\n    }\n  }\n  cout << (char)('A' + k) << \"\\n\" << max << \"\\n\";\n  for (int i = 1; i <= m; i++) {\n    for (int j = 0; j < 10; j++)\n      if (name[i][j] == 'A' + k)\n        cout << book[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char zz[20];\n  struct student *next;\n};\n\nstruct student *New(int n) {\n  struct student *head = NULL;\n  struct student *newp, *thisp;\n\n  int i = 0;\n\n  do {\n    newp = (struct student *)malloc(sizeof(struct student));\n    if (newp == NULL) {\n      printf(\"request failed\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &newp->num, newp->zz);\n    if (i == 0) {\n      head = newp;\n      thisp = head;\n    } else\n      thisp->next = newp;\n    if (i < n) {\n      thisp = newp;\n      i = i + 1;\n    }\n  } while (i < n);\n  thisp->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j;\n  int n;\n  int t1 = 0, t2;\n  int length;\n  char target[1000] = {' '};\n  char mz = ' ';\n\n  struct student *head, *p;\n\n  scanf(\"%d\", &n);\n\n  head = New(n);\n  p = head;\n\n  i = 0;\n  do {\n    if (i == 0)\n      strcpy(target, p->zz);\n    else {\n      p = p->next;\n      strcat(target, p->zz);\n    }\n\n    i += 1;\n  } while (p->next != NULL);\n\n  length = strlen(target);\n  for (i = 0; i < length; i++) {\n    t2 = 0;\n    if (target[i] == '0')\n      continue;\n    else {\n      for (j = i + 1; j < length; j++) {\n        if (target[j] == target[i]) {\n          target[j] = '0';\n          t2 += 1;\n        }\n      }\n      if (t2 > t1) {\n        t1 = t2;\n        mz = target[i];\n      }\n    }\n  }\n\n  cout << mz << \"\\n\" << t1 + 1;\n\n  p = head;\n  do {\n    length = strlen(p->zz);\n    for (i = 0; i < length; i++) {\n      if ((p->zz[i]) == mz) {\n        printf(\"\\n%d\", p->num);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } list[999], *p;\n\n  int n;\n  int count[26] = {0};\n  int i;\n  char k = 'A';\n  int max;\n\n  scanf(\"%d\", &n);\n  for (p = list; p < list + n; p++) {\n    scanf(\"%d %s\", &p->num, p->author);\n  }\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (p->author[i] == '\\0') {\n        break;\n      } else {\n        count[p->author[i] - 65]++;\n      }\n    }\n  }\n\n  max = count[0];\n  for (i = 1; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      k = i + 65;\n    }\n  }\n\n  cout << k << \"\\n\";\n  cout << max << \"\\n\";\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (k == p->author[i]) {\n        printf(\"%d\\n\", p->num);\n      }\n      if (p->author[i] == '\\0') {\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2209", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int b[1000];\n  char s[1000][26];\n  for (i = 0; i < n; i++)\n    cin >> b[i] >> s[i];\n\n  int a[26] = {0};\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      switch (s[i][j]) {\n      case 'A':\n        a[0] = a[0] + 1;\n        break;\n      case 'B':\n        a[1] = a[1] + 1;\n        break;\n      case 'C':\n        a[2] = a[2] + 1;\n        break;\n      case 'D':\n        a[3] = a[3] + 1;\n        break;\n      case 'E':\n        a[4] = a[4] + 1;\n        break;\n      case 'F':\n        a[5] = a[5] + 1;\n        break;\n      case 'G':\n        a[6] = a[6] + 1;\n        break;\n      case 'H':\n        a[7] = a[7] + 1;\n        break;\n      case 'I':\n        a[8] = a[8] + 1;\n        break;\n      case 'J':\n        a[9] = a[9] + 1;\n        break;\n      case 'K':\n        a[10] = a[10] + 1;\n        break;\n      case 'L':\n        a[11] = a[11] + 1;\n        break;\n      case 'M':\n        a[12] = a[12] + 1;\n        break;\n      case 'N':\n        a[13] = a[13] + 1;\n        break;\n      case 'O':\n        a[14] = a[14] + 1;\n        break;\n      case 'P':\n        a[15] = a[15] + 1;\n        break;\n      case 'Q':\n        a[16] = a[16] + 1;\n        break;\n      case 'R':\n        a[17] = a[17] + 1;\n        break;\n      case 'S':\n        a[18] = a[18] + 1;\n        break;\n      case 'T':\n        a[19] = a[19] + 1;\n        break;\n      case 'U':\n        a[20] = a[20] + 1;\n        break;\n      case 'V':\n        a[21] = a[21] + 1;\n        break;\n      case 'W':\n        a[22] = a[22] + 1;\n        break;\n      case 'X':\n        a[23] = a[23] + 1;\n        break;\n      case 'Y':\n        a[24] = a[24] + 1;\n        break;\n      default:\n        a[25] = a[25] + 1;\n      }\n    }\n  }\n  int m;\n  char z;\n  m = a[0], z = c[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > m)\n      m = a[i], z = c[i];\n  }\n  printf(\"%c\\n%d\\n\", z, m);\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == z) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2210", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char wri[27];\n  struct inf *next;\n};\n\nint main() {\n  int n, i, time[26] = {0};\n  \n  \n  char *pn;\n  struct inf *head, *p1, *p0, *p;\n  scanf(\"%d\", &n);\n  p1 = head = (struct inf *)malloc(sizeof(struct inf));\n  for (i = 0; i < n; i++) {\n    p0 = (struct inf *)malloc(sizeof(struct inf));\n    scanf(\"%d%s\", &p0->num, p0->wri);\n    p0->next = NULL;\n    p1->next = p0;\n    p1 = p0;\n    pn = p0->wri;\n    while (*pn != '\\0') {\n      time[*pn - 65]++;\n      pn = pn + 1;\n    }\n  }\n\n  int max = 0, k;\n  for (i = 0; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  p = head;\n  while (p != NULL) {\n\n    pn = p->wri;\n    while (*pn != '\\0') {\n      if (*pn == k + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      pn = pn + 1;\n    }\n    p = p->next;\n  }\n\n  \n}\n"}
{"label": "2", "index": "2211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[1000], l[1000], count[128], m, max;\n  char edi[1000][26], au[128];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &num[j]);\n\n    cin >> edi[j];\n    l[j] = strlen(edi[j]);\n  }\n  for (i = 0; i < 128; i++)\n    count[i] = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      m = edi[j][i];\n      au[m] = edi[j][i];\n      count[m]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 128; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      m = i;\n    }\n  }\n  cout << au[m] << \"\\n\" << max;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      if (edi[j][i] == au[m]) {\n        cout << \"\\n\" << num[j];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct index {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, a[26], *pr, max;\n  char s[26], *sp, *pt, temp;\n  for (pr = a; pr < a + 26; pr++) {\n    *pr = 0;\n  }\n  sp = s;\n  *sp = 65;\n  for (sp = s + 1; sp < s + 26; sp++) {\n    *sp = *(sp - 1) + 1;\n  }\n  struct index *p;\n  scanf(\"%d\", &n);\n  struct index *ind = (struct index *)malloc(sizeof(struct index) * n);\n  for (p = ind; p < ind + n; p++) {\n    scanf(\"%d %s\", &p->num, p->wr);\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n        if (*pt == *sp) {\n          (*pr)++;\n        }\n      }\n    }\n  }\n  max = *a;\n  temp = 65;\n  for (pr = a, sp = s; pr < a + 26; pr++, sp++) {\n    if (*pr > max) {\n      max = *pr;\n      temp = *sp;\n    }\n  }\n  for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n    if (*pr == max) {\n      printf(\"%c\\n%d\\n\", *sp, *pr);\n    }\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      if (*pt == temp) {\n        printf(\"%d\\n\", (*p).num);\n      }\n    }\n  }\n  free(ind);\n  return 0;\n}\n"}
{"label": "2", "index": "2213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ma = 'A';\n  int cnt[128] = {0};\n  int i, j, n;\n  struct s {\n    int id;\n    char au[27];\n  } bk[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      cnt[bk[i].au[j]]++;\n      if (cnt[bk[i].au[j]] > cnt[ma]) {\n        ma = bk[i].au[j];\n      }\n    }\n  }\n  cout << ma << \"\\n\" << cnt[ma] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (strchr(bk[i].au, ma)) {\n      printf(\"%d\\n\", bk[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int order;\n  int num;\n  char writer[26];\n} b[1000];\nint main() {\n  int n, i, j, k, p, q[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].writer);\n    b[i].order = i;\n  }\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26];\n  char d[26];\n  for (j = 0; j <= 25; j++) {\n    d[j] = 0;\n    c[j] = 0;\n  }\n  for (k = 0; k <= 25; k++) {\n    for (i = 0; i <= (n - 1); i++) {\n      p = strlen(b[i].writer);\n      strcpy(d, b[i].writer);\n      for (j = 0; j <= (p - 1); j++) {\n        if (d[j] == a[k]) {\n          c[k] = c[k] + 1;\n        }\n      }\n      for (j = 0; j <= 25; j++) {\n        d[j] = 0;\n      }\n    }\n  }\n  int max = c[0];\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n    }\n  }\n  char x;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] == max) {\n      x = a[i];\n      printf(\"%c\\n\", a[i]);\n      printf(\"%d\\n\", c[i]);\n    }\n  }\n\n  for (i = 0; i <= 999; i++) {\n    q[i] = 0;\n  }\n  int r = 0;\n  char e[26];\n  for (i = 0; i <= 25; i++) {\n    e[i] = 0;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    p = strlen(b[i].writer);\n    strcpy(e, b[i].writer);\n    for (j = 0; j <= (p - 1); j++) {\n      if (e[j] == x) {\n        q[r] = b[i].num;\n        r = r + 1;\n      }\n    }\n    for (j = 0; j <= 25; j++) {\n      e[j] = 0;\n    }\n  }\n  int s = 0;\n  for (i = 0; i <= 999; i++) {\n    if (q[i] != 0) {\n      s = s + 1;\n    }\n  }\n  for (i = 0; i <= (s - 2); i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  printf(\"%d\", q[s - 1]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int NO;\n    char AUT[27];\n  } book[999];\n  int i, j, k, m, n, d, max;\n  int a[26] = {0}, b[26][999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &book[i].NO);\n\n    cin >> book[i].AUT;\n    for (j = 0; book[i].AUT[j] != '\u0000'; j++) {\n      d = book[i].AUT[j] - 65;\n      b[d][a[d]] = book[i].NO;\n      a[d] = a[d] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d \", k + 65, max);\n  for (i = 0; i < a[k] - 1; i++) {\n    printf(\"%d \", b[k][i]);\n  }\n  printf(\"%d\", b[k][a[k] - 1]);\n}\n"}
{"label": "2", "index": "2216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, temp = 26, n, p[27] = {0};\n  struct {\n    int a;\n    char s[30];\n  } t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &t[i].a, t[i].s);\n    for (j = 0; j < strlen(t[i].s); j++) {\n      p[t[i].s[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[temp])\n      temp = i;\n  }\n  cout << temp + 'A' << \"\\n\" << p[temp] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(t[i].s); j++) {\n      if (t[i].s[j] == temp + 'A') {\n        cout << t[i].a << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char w[100];\n} book[100];\nint main() {\n  int i, j, k, l, m, n, p, b[26] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].w);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].w[j] != '\\0'; j++) {\n      if (book[i].w[j] == 'A')\n        b[0]++;\n      else if (book[i].w[j] == 'B')\n        b[1]++;\n      else if (book[i].w[j] == 'C')\n        b[2]++;\n      else if (book[i].w[j] == 'D')\n        b[3]++;\n      else if (book[i].w[j] == 'E')\n        b[4]++;\n      else if (book[i].w[j] == 'F')\n        b[5]++;\n      else if (book[i].w[j] == 'G')\n        b[6]++;\n      else if (book[i].w[j] == 'H')\n        b[7]++;\n      else if (book[i].w[j] == 'I')\n        b[8]++;\n      else if (book[i].w[j] == 'J')\n        b[9]++;\n      else if (book[i].w[j] == 'K')\n        b[10]++;\n      else if (book[i].w[j] == 'L')\n        b[11]++;\n      else if (book[i].w[j] == 'M')\n        b[12]++;\n      else if (book[i].w[j] == 'N')\n        b[13]++;\n      else if (book[i].w[j] == 'O')\n        b[14]++;\n      else if (book[i].w[j] == 'P')\n        b[15]++;\n      else if (book[i].w[j] == 'Q')\n        b[16]++;\n      else if (book[i].w[j] == 'R')\n        b[17]++;\n      else if (book[i].w[j] == 'S')\n        b[18]++;\n      else if (book[i].w[j] == 'T')\n        b[19]++;\n      else if (book[i].w[j] == 'U')\n        b[20]++;\n      else if (book[i].w[j] == 'V')\n        b[21]++;\n      else if (book[i].w[j] == 'W')\n        b[22]++;\n      else if (book[i].w[j] == 'X')\n        b[23]++;\n      else if (book[i].w[j] == 'Y')\n        b[24]++;\n      else if (book[i].w[j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i] < b[j])\n        break;\n    }\n    if (j == 26) {\n      printf(\"%c\\n%d\\n\", 65 + i, b[i]);\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (l = 0; book[j].w[l] != '\\0'; l++) {\n      if (book[j].w[l] == 65 + i) {\n        printf(\"%d\\n\", book[j].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a, i, j, k, n, s[26][999] = {0}, p[26] = {0};\n  char b[26], c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &j);\n    cin >> b;\n    n = strlen(b);\n    for (k = 0; k < n; k++) {\n      a = b[k] - 'A';\n      s[a][p[a]] = j;\n      p[a]++;\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (p[j] < p[i])\n      j = i;\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, p[j]);\n  for (i = 0;; i++) {\n    if (s[j][i] != 0)\n      cout << s[j][i] << endl;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct b {\n  int na;\n  char au[20];\n} book[1000];\nint main() {\n  int m, i, len[1000], num[128] = {0}, j, max, p = 0;\n  char maxi;\n  int boo[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].na, book[i].au);\n    len[i] = strlen(book[i].au);\n    for (j = 0; j < len[i]; j++)\n      num[book[i].au[j]]++;\n  }\n  maxi = 'A';\n  max = -1;\n  for (j = 'A'; j <= 'Z'; j++) {\n    if (num[j] > max) {\n      max = num[j];\n      maxi = j;\n    }\n  }\n  printf(\"%c\\n\", maxi);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m && p < max; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].au[j] == maxi) {\n        printf(\"%d\\n\", book[i].na);\n        p++;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[27];\n} book[100];\nint main() {\n  int n, i, k, sz[26], t, m, e;\n  scanf(\"%d\", &n);\n  m = 0;\n  for (i = 0; i < 26; i++)\n    sz[i] = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].author);\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      sz[book[i].author[k] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sz[i] > m) {\n      m = sz[i];\n      e = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", e + 'A', m);\n  for (i = 0; i < n; i++) {\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      if (book[i].author[k] == e + 'A') {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char num[4];\n  char str[27];\n};\n\nint main(int argc, char *argv[]) {\n  int m, i, j, zimu[26] = {0}, x, max;\n  char p;\n  cin >> m;\n  struct author *auth = (struct author *)malloc(sizeof(struct author) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", auth[i].num, auth[i].str);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      x = auth[i].str[j] - 65;\n      zimu[x]++;\n    }\n  }\n  max = zimu[0];\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > max) {\n      max = zimu[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", p + 65, max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (auth[i].str[j] == p + 65) {\n        printf(\"%s\\n\", auth[i].num);\n      }\n    }\n  }\n\n  free(auth);\n  return 0;\n}\n"}
{"label": "2", "index": "2222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int m, i, j, k;\n  char s[26];\n  int w[26] = {0};\n  int len[1000];\n  int max, most;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n\n  for (i = 0; i < 26; i++)\n    s[i] = 'A' + i;\n\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == s[k])\n          w[k]++;\n      }\n    }\n  }\n  max = w[0];\n  most = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      most = i;\n    }\n  }\n  cout << s[most] << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].author[j] == s[most])\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2223", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char zz[20];\n  struct student *next;\n};\n\nstruct student *New(int n) {\n  struct student *head = NULL;\n  struct student *newp, *thisp;\n\n  int i = 0;\n\n  do {\n    newp = (struct student *)malloc(sizeof(struct student));\n    if (newp == NULL) {\n      printf(\"request failed\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &newp->num, newp->zz);\n    if (i == 0) {\n      head = newp;\n      thisp = head;\n    } else\n      thisp->next = newp;\n    if (i < n) \n    {\n      thisp = newp;\n      i = i + 1;\n    }\n  } while (i < n);\n  thisp->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j;\n  int n;\n  int t1 = 0, t2;\n  int length;\n  char target[1000] = {' '};\n  char mz = ' ';\n\n  struct student *head, *p;\n\n  scanf(\"%d\", &n);\n\n  head = New(n);\n  p = head;\n\n  i = 0;\n  do {\n    if (i == 0) {\n      strcpy(target, p->zz);\n    } else {\n      p = p->next;\n      strcat(target, p->zz);\n    }\n\n    i += 1;\n  } while (p->next != NULL);\n\n  length = strlen(target);\n  for (i = 0; i < length; i++) \n  {\n    t2 = 0;\n    if (target[i] == '0')\n      continue;\n    else {\n      for (j = i + 1; j < length; j++) {\n        if (target[j] == target[i]) {\n          target[j] = '0';\n          t2 += 1;\n        }\n      }\n      if (t2 > t1) {\n        t1 = t2;\n        mz = target[i];\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\", mz, t1 + 1);\n\n  p = head;\n  do {\n    length = strlen(p->zz);\n    for (i = 0; i < length; i++) {\n      if ((p->zz[i]) == mz) {\n        printf(\"\\n%d\", p->num);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2224", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef char q[30];\nvoid init(int a[], int f[], q *p[1000], int m) {\n  int i;\n\n  char e[432];\n  char *pp;\n\n  for (i = 1; i <= m; i++) {\n    p[i] = (q *)malloc(sizeof(q));\n\n    scanf(\"%d%s\", &f[i], p[i]);\n    getchar();\n    pp = *p[i];\n    while (*pp != '\u0000') {\n      a[*pp]++;\n      pp++;\n    }\n  }\n}\nchar pro(int a[]) {\n  char c, max, g;\n  max = -333;\n  for (c = 'A'; c <= 'Z'; c++)\n\n    if (a[c] > max) {\n      max = a[c];\n      g = c;\n    }\n  return g;\n}\nvoid print(int f[], q *p[1000], int m, char c) {\n  int i;\n  for (i = 1; i <= m; i++)\n    if (strchr(*p[i], c) != NULL)\n      printf(\"%d \", f[i]);\n}\nint main() {\n  int m, k;\n  int a[343] = {0};\n  int f[1000];\n  q *p[1000];\n  char max;\n  scanf(\"%d\", &m);\n  init(a, f, p, m);\n  max = pro(a);\n  printf(\"%c %d \", max, a[max]);\n  print(f, p, m, max);\n  return 0;\n}\n"}
{"label": "2", "index": "2225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, m, i, max = 0, n, count[26] = {0};\n  char b;\n  struct book {\n    int id;\n    char author[26];\n  } book[1024];\n  char *p = &book[0].author[0];\n  char *q;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].id >> book[i].author;\n\n  for (i = 0; i < m; i++)\n\n    for (p = book[i].author; *p != '\\0'; p++) {\n      a = *p;\n      count[a - 65]++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      b = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n\n  for (i = 0; i < m; i++) {\n    for (q = book[i].author; *q != '\\0'; q++) {\n      if (*q == b)\n        cout << book[i].id << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, b[999], n[26], t[2] = {0}, x = 0;\n  char a[999][26], au;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i], a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      n[(int)a[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (t[0] < n[i]) {\n      t[0] = n[i], t[1] = i;\n    }\n  }\n  au = t[1] + 65;\n  printf(\"%c\\n%d\\n\", au, t[0]);\n  for (i = 0; i < m; i++) {\n    x = 0, j = 0;\n    while (j < (int)strlen(a[i]) && x == 0) {\n      if (a[i][j] == t[1] + 65) {\n        cout << b[i] << \"\\n\", x++;\n      } else {\n        j++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2227", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n};\nint m;\n\nint main() {\n\n  int i;\n  cin >> m;\n  book *p;\n  p = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    cin >> p[i].num >> p[i].writer;\n  }\n  int j = 0, u = 0;\n  int *a;\n  a = (int *)malloc(sizeof(int) * 150);\n  for (i = 'A'; i <= 'z'; i++)\n    a[i] = 0;\n\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      for (u = 0; u < strlen(p[j].writer); u++) {\n        if (i == p[j].writer[u]) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  int max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max < a[i])\n      max = a[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max == a[i])\n      break;\n  }\n  printf(\"%c\\n%d\\n\", i, a[i]);\n  for (j = 0; j < m; j++) {\n    for (u = 0; u < strlen(p[j].writer); u++) {\n      if (i == p[j].writer[u]) {\n        printf(\"%d\\n\", p[j].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, len, i, j, book[1000], num[26] = {0}, k = 0, t, m = 0;\n  char w[1000][27], c = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> w[i];\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      for (c = 'A', t = 0; c <= 'Z'; c++) {\n        if (w[i][j] == c) {\n          num[t]++;\n          break;\n        }\n        t++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > m) {\n      m = num[i];\n      k = i;\n    }\n  }\n  c = 'A' + k;\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", num[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      if (w[i][j] == c) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\nint main() {\n  int n, t, i, j;\n  int count[26], max = 0;\n  for (i = 0; i < 26; i++)\n    count[i] = 0;\n  struct book {\n    int num;\n    char man[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].man);\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == 'A')\n        count[0]++;\n      else if (book[i].man[j] == 'B')\n        count[1]++;\n      else if (book[i].man[j] == 'C')\n        count[2]++;\n      else if (book[i].man[j] == 'D')\n        count[3]++;\n      else if (book[i].man[j] == 'E')\n        count[4]++;\n      else if (book[i].man[j] == 'F')\n        count[5]++;\n      else if (book[i].man[j] == 'G')\n        count[6]++;\n      else if (book[i].man[j] == 'H')\n        count[7]++;\n      else if (book[i].man[j] == 'I')\n        count[8]++;\n      else if (book[i].man[j] == 'J')\n        count[9]++;\n      else if (book[i].man[j] == 'K')\n        count[10]++;\n      else if (book[i].man[j] == 'L')\n        count[11]++;\n      else if (book[i].man[j] == 'M')\n        count[12]++;\n      else if (book[i].man[j] == 'N')\n        count[13]++;\n      else if (book[i].man[j] == 'O')\n        count[14]++;\n      else if (book[i].man[j] == 'P')\n        count[15]++;\n      else if (book[i].man[j] == 'Q')\n        count[16]++;\n      else if (book[i].man[j] == 'R')\n        count[17]++;\n      else if (book[i].man[j] == 'S')\n        count[18]++;\n      else if (book[i].man[j] == 'T')\n        count[19]++;\n      else if (book[i].man[j] == 'U')\n        count[20]++;\n      else if (book[i].man[j] == 'V')\n        count[21]++;\n      else if (book[i].man[j] == 'W')\n        count[22]++;\n      else if (book[i].man[j] == 'X')\n        count[23]++;\n      else if (book[i].man[j] == 'Y')\n        count[24]++;\n      else if (book[i].man[j] == 'Z')\n        count[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[t], max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == name[t])\n        cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct book {\n    short int a;\n    char s[27];\n  } b[999];\n  short int q[26] = {0};\n  short int w[26] = {0}, p, t, m;\n  for (i = 0; i < n; i++) {\n    cin >> b[i].a >> b[i].s;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      p = (int)b[i].s[j] - 65;\n      q[p]++;\n      w[p]++;\n    }\n\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++)\n      if (q[j] < q[j + 1]) {\n        t = q[j];\n        q[j] = q[j + 1];\n        q[j + 1] = t;\n      }\n  for (i = 0; i < 25; i++)\n\n    if (w[i] == q[0])\n      m = i;\n  printf(\"%c\\n\", (char)(m + 65));\n  printf(\"%d\\n\", w[m]);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++)\n      if (b[i].s[j] == m + 65)\n        cout << b[i].a << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2231", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, a[1000], c[91], max = 0;\n  char b[1000][26], d;\n  cin >> m;\n  memset(c, 0, sizeof(c));\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < 26; j++)\n      if (b[i][j] > 0)\n        c[b[i][j]]++;\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > max)\n      max = c[i];\n  for (i = 65; i < 91; i++)\n    if (c[i] == max) {\n      d = i;\n      printf(\"%c\\n%d\\n\", d, max);\n      for (j = 0; j < m; j++)\n        for (k = 0; k < 26; k++)\n          if (b[j][k] == d) {\n            cout << a[j] << endl;\n            break;\n          }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2232", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, num[1000], i, k, l = 0, a[26] = {0};\n  char nam[1000][10], j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> num[i] >> nam[i];\n  for (j = 'A'; j <= 'Z'; j++)\n    for (i = 0; i < m; i++)\n      if (strchr(nam[i], j))\n        a[j - 65]++;\n  for (i = 0, k = a[0]; i < 26; i++)\n    if (a[i] > k) {\n      k = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < m; i++) {\n    if (strchr(nam[i], l + 65))\n      printf(\"%d\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct books {\n  char num[20];\n  char w[26];\n};\nint main() {\n  int k, j, i, m;\n  int b[150] = {0};\n  scanf(\"%d\", &m);\n  struct books a[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i].num, a[i].w);\n    for (j = 0; a[i].w[j] != '\\0'; j++)\n      b[a[i].w[j]]++;\n  }\n  int max = 0;\n  for (i = 'A', j = 0; i <= 'Z'; i++)\n    if (max < b[i]) {\n      max = b[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  int n = 0;\n  for (i = 0; i < m; i++) {\n    n = 0;\n    for (k = 0; a[i].w[k] != '\\0'; k++)\n      if (a[i].w[k] == j)\n        n = 1;\n    if (n == 1)\n      printf(\"%s\\n\", a[i].num);\n  }\n}\n"}
{"label": "2", "index": "2234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[110], m, ni = 0, n = 0,\n                   maxn[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  char au[110][30], max[30];\n  cin >> m;\n\n  int i, j;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    cin >> au[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 'A')\n        maxn[0]++;\n      if (au[i][j] == 'B')\n        maxn[1]++;\n      if (au[i][j] == 'C')\n        maxn[2]++;\n      if (au[i][j] == 'D')\n        maxn[3]++;\n      if (au[i][j] == 'E')\n        maxn[4]++;\n      if (au[i][j] == 'F')\n        maxn[5]++;\n      if (au[i][j] == 'G')\n        maxn[6]++;\n      if (au[i][j] == 'H')\n        maxn[7]++;\n      if (au[i][j] == 'I')\n        maxn[8]++;\n      if (au[i][j] == 'J')\n        maxn[9]++;\n      if (au[i][j] == 'K')\n        maxn[10]++;\n      if (au[i][j] == 'L')\n        maxn[11]++;\n      if (au[i][j] == 'M')\n        maxn[12]++;\n      if (au[i][j] == 'N')\n        maxn[13]++;\n      if (au[i][j] == 'O')\n        maxn[14]++;\n      if (au[i][j] == 'P')\n        maxn[15]++;\n      if (au[i][j] == 'Q')\n        maxn[16]++;\n      if (au[i][j] == 'R')\n        maxn[17]++;\n      if (au[i][j] == 'S')\n        maxn[18]++;\n      if (au[i][j] == 'T')\n        maxn[19]++;\n      if (au[i][j] == 'U')\n        maxn[20]++;\n      if (au[i][j] == 'V')\n        maxn[21]++;\n      if (au[i][j] == 'W')\n        maxn[22]++;\n      if (au[i][j] == 'X')\n        maxn[23]++;\n      if (au[i][j] == 'Y')\n        maxn[24]++;\n      if (au[i][j] == 'Z')\n        maxn[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (maxn[i] > n) {\n      n = maxn[i];\n      ni = i;\n    }\n  }\n  cout << (char)(ni + 65) << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 65 + ni)\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n    struct book *next;\n  } * p1, *p2, *p, *head, *t;\n  int i, n, max = 0, j, k, l, y[400], q;\n  char u;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct book *)malloc(sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p1->x, p1->z);\n    y[i] = strlen(p1->z);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < y[i]; j++) {\n      q = 1;\n      t = p->next;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (p->z[j] == t->z[l])\n            q++;\n        t = t->next;\n      }\n      if (q > max) {\n        max = q;\n        u = p->z[j];\n      }\n    }\n    p = p->next;\n  }\n  cout << u << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == p->z[j]) {\n        cout << p->x << \"\\n\";\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Book_num(char a[]) {\n  int j, num;\n  j = 1;\n  if ((j = 1) && a[j] == ' ') {\n    num = a[0] - 48;\n  } else\n    j++;\n  if ((j = 2) && a[j] == ' ') {\n    num = a[1] - 48 + (a[0] - 48) * 10;\n  } else {\n    j++;\n  }\n  if ((j = 3) && a[j] == ' ') {\n    num = a[2] - 48 + (a[1] - 48) * 10 + (a[0] - 48) * 100;\n  }\n  return num;\n}\n\nint main() {\n  int m, bk1, i, max, j, wrt;\n  int author[26][999] = {0};\n  char data[999][30];\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++) {\n\n    cin >> data[i];\n    data[i][strlen(data[i])] = '\\0';\n  }\n  max = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; data[i][j] != '\\0'; j++) {\n      if (data[i][j] > 64) {\n        wrt = data[i][j] - 65;\n        for (bk1 = 0; author[wrt][bk1] != 0; bk1++) {\n          ;\n        }\n        author[wrt][bk1] = Book_num(data[i]);\n        if (bk1 > max) {\n          max = bk1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i][max] != 0) {\n      printf(\"%c\\n\", i + 65);\n      printf(\"%d\\n\", max + 1);\n      for (j = 0; j <= max; j++) {\n        printf(\"%d\\n\", author[i][j]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n  struct book *next;\n};\nint main() {\n  int n, i, j, a[26] = {0}, max, temp;\n  char c;\n  struct book *p, *head, *tail;\n  scanf(\"%d\", &n);\n  head = NULL;\n  tail = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p->num, p->writer);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n  }\n  for (c = 'A'; c <= 'Z'; c++) {\n    for (i = 0, p = head; i < n; i++, p = p->next) {\n      for (j = 0; p->writer[j] != '\u0000'; j++)\n        if (p->writer[j] == c)\n          a[c - 'A']++;\n    }\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max)\n      break;\n  c = i + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", a[i]);\n  for (i = 0, p = head; i < n; i++, p = p->next) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == c) {\n        printf(\"%d \", p->num);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct {\n    int name;\n    char author[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].name, book[i].author);\n\n  char t, tmax;\n  int max = 0, j, k;\n  for (t = 'A'; t <= 'Z'; t++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(book[i].author); j++) {\n        if (book[i].author[j] == t)\n          k++;\n      }\n    }\n    if (k > max) {\n      max = k;\n      tmax = t;\n    }\n  }\n  cout << tmax << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == tmax) {\n        printf(\"%d\\n\", book[i].name);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int NO;\n    char AUT[27];\n  } book[999];\n  int i, j, k, n, d, max;\n  int a[26] = {0}, b[26][999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &book[i].NO);\n\n    cin >> book[i].AUT;\n    for (j = 0; book[i].AUT[j] != '\u0000'; j++) {\n      d = book[i].AUT[j] - 65;\n      b[d][a[d]] = book[i].NO;\n      a[d] = a[d] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d \", k + 65, max);\n  for (i = 0; i < a[k] - 1; i++) {\n    printf(\"%d \", b[k][i]);\n  }\n  printf(\"%d\", b[k][a[k] - 1]);\n}\n"}
{"label": "2", "index": "2240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct a {\n  int n;\n  char s[27];\n} b[1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].n, b[i].s);\n  }\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (k = 0; b[i].s[k]; k++) {\n      switch (b[i].s[k]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      j = i;\n    }\n  }\n  int t = 0;\n  switch (j) {\n  case 0:\n    printf(\"A\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++) {\n        if (b[i].s[k] == 'A')\n          printf(\"%d\\n\", b[i].n);\n      }\n    }\n    break;\n  case 1:\n    printf(\"B\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'B')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 2:\n    printf(\"C\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'C')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 3:\n    printf(\"D\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'D')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 4:\n    printf(\"E\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'E')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 5:\n    printf(\"F\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'F')\n          cout << b[i].n << \"\\n\";\n    }\n    break;\n  case 6:\n    printf(\"G\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'G')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 7:\n    printf(\"H\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'H')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 8:\n    printf(\"I\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'I')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 9:\n    printf(\"J\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'J')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 10:\n    printf(\"K\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'K')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 11:\n    printf(\"L\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'L')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 12:\n    printf(\"M\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 13:\n    printf(\"N\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 14:\n    printf(\"O\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'O')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 15:\n    printf(\"P\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'P')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 16:\n    printf(\"Q\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Q')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 17:\n    printf(\"R\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'R')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 18:\n    printf(\"S\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'S')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 19:\n    printf(\"T\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'T')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 20:\n    printf(\"U\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'U')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 21:\n    printf(\"V\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'V')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 22:\n    printf(\"W\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'W')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 23:\n    printf(\"X\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'X')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 24:\n    printf(\"Y\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Y')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 25:\n    printf(\"Z\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Z')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, t, m, a[26] = {0}, book[999], max;\n  char writer[999][26], maxwriter;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i], writer[i]);\n    m = strlen(writer[i]);\n    for (j = 0; j < m; j++) {\n      t = writer[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  max = 0;\n  maxwriter = 'A';\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxwriter = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxwriter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == maxwriter) {\n        cout << book[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26][1000];\nint ai[26];\nvoid func() {\n  int k, i, len;\n  char str[27];\n  scanf(\"%d %s\", &k, str);\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    a[str[i] - 'A'][ai[str[i] - 'A']] = k;\n    ai[str[i] - 'A']++;\n  }\n}\nint main() {\n  memset(a, 0, sizeof(a));\n  memset(ai, 0, sizeof(ai));\n  int n, i, i0, max = 0;\n  scanf(\"%d\", &n);\n  while (n--)\n    func();\n  for (i = 0; i < 26; i++) {\n    if (ai[i] > max) {\n      max = ai[i];\n      i0 = i;\n    }\n  }\n  printf(\"%c\\n\", i0 + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 0; i < ai[i0]; i++)\n    printf(\"%d\\n\", a[i0][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2243", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct {\n    int name;\n    char author[26];\n  } book[999];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].name, book[i].author);\n  }\n\n  char t, tmax;\n  int max = 0, j, k;\n  for (t = 'A'; t <= 'Z'; t++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(book[i].author); j++) {\n        if (book[i].author[j] == t) {\n          k++;\n        }\n      }\n    }\n    if (k > max) {\n      max = k;\n      tmax = t;\n    }\n  }\n  printf(\"%c\\n%d\\n\", tmax, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == tmax) {\n        printf(\"%d\\n\", book[i].name);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  char z[30];\n  int n;\n} s[1000];\nstruct {\n  int name;\n  int nb, b[1000], k;\n} r[93];\n\nint main() {\n  int m, i, j, l, q;\n\n  for (i = 65; i <= 90; i++) {\n    r[i].name = i;\n    r[i].k = 1;\n  }\n\n  scanf(\"%d\", &m);\n\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &s[i].n, s[i].z);\n    l = strlen(s[i].z);\n    for (j = 0; j < l; j++) {\n      q = s[i].z[j];\n      r[q].nb++;\n      r[q].b[r[q].k] = s[i].n;\n      r[q].k++;\n    }\n  }\n\n  for (i = 65; i < 90; i++)\n    for (j = 90; j > i; j--)\n      if (r[j].nb > r[j - 1].nb) {\n        r[92] = r[j];\n        r[j] = r[j - 1];\n        r[j - 1] = r[92];\n      }\n  printf(\"%c\\n%d\\n\", r[65].name, r[65].nb);\n\n  for (i = 1; i <= r[65].nb; i++)\n    printf(\"%d\\n\", r[65].b[i]);\n}\n"}
{"label": "2", "index": "2245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Au {\n  int num;\n  int a[1000];\n} au[26];\nint main() {\n  int i, n, buch, tn;\n  char s[30];\n  for (i = 0; i < 26; i++)\n    au[i].num = 0;\n  cin >> n;\n  while (n--) {\n    cin >> buch >> s;\n    for (i = 0; s[i]; i++) {\n      tn = au[s[i] - 'A'].num;\n      au[s[i] - 'A'].a[tn] = buch;\n      au[s[i] - 'A'].num++;\n    }\n  }\n  int temp = 0;\n  for (i = 1; i < 26; i++)\n    if (au[i].num > au[temp].num)\n      temp = i;\n  printf(\"%c\\n%d\\n\", 'A' + temp, au[temp].num);\n  for (i = 0; i < au[temp].num; i++)\n    printf(\"%d\\n\", au[temp].a[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2246", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  struct book {\n    int no;\n    char as[10];\n  } bk;\n\n  cin >> n;\n  struct book *books = (struct book *)malloc(sizeof(struct book) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk.no, bk.as);\n    books[i] = bk;\n  }\n\n  int cnts[256] = {0};\n  for (i = 0; i < n; i++) {\n    bk = books[i];\n    for (j = 0; bk.as[j]; j++)\n      cnts[bk.as[j]]++;\n  }\n\n  int count = 0;\n  for (int max = 1000; max > 0; max--) {\n    for (char c = 'A'; c <= 'Z'; c++) {\n      if (cnts[c] == max) {\n        printf(\"%c\\n%d\\n\", c, max);\n        for (i = 0; i < n; i++) {\n          bk = books[i];\n          for (j = 0; bk.as[j]; j++) {\n            if (bk.as[j] == c) {\n              printf(\"%d\\n\", bk.no);\n              break;\n            }\n          }\n        }\n        count++;\n      }\n    }\n    if (count == 1) {\n      free(books);\n      return 0;\n    }\n  }\n\n  free(books);\n  return -1;\n}\n"}
{"label": "2", "index": "2247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char name[26];\n  int num;\n  struct author *next;\n};\nint main() {\n  int i, n, a[26], j, t;\n  struct author *head;\n  struct author *p1, *p2;\n  p1 = p2 = (struct author *)malloc(1000);\n  head = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p1->num >> p1->name;\n    if (i == 0)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != (n - 1))\n      p1 = p2->next = (struct author *)malloc(1000);\n    else {\n      p2->next = NULL;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  p1 = head;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      a[p1->name[j] - 'A']++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > a[t])\n      t = i;\n  }\n  printf(\"%c %d \", t + 'A', a[t]);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      if (p1->name[j] == t + 'A')\n        printf(\"%d \", p1->num);\n      continue;\n    }\n  }\n}\n"}
{"label": "2", "index": "2248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0;\n  scanf(\"%d\", &n);\n  int num[1000];\n  int sum[26];\n  for (i = 0; i < 26; i++) {\n    sum[i] = 0;\n  }\n  char a[1000][27];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &num[i], a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      sum[a[i][j] - 'A'] = sum[a[i][j] - 'A'] + 1;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (sum[i] > sum[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n\", max + 'A');\n  printf(\"%d\\n\", sum[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] == max + 'A') {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int No;\n    char name[27];\n  } b[1000];\n  int i, j, m;\n  scanf(\"%d\", &m);\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i].No);\n    scanf(\"%s\", b[i].name);\n  }\n  int n, l, a[26] = {0};\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      n = b[i].name[j];\n      a[n - 65]++;\n    }\n  }\n  int max = 0, x;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  printf(\"%c\\n%d\", x + 65, max);\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      if (b[i].name[j] == x + 65) {\n        printf(\"\\n%d\", b[i].No);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct info {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int i, m, j, b[26] = {0};\n  char out;\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\\n\", &a[i].num, a[i].author);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      b[a[i].author[j] - 'A']++;\n  int max = b[0];\n  for (i = 0; i < 26; i++)\n    max = max > b[i] ? max : b[i];\n  for (i = 0; i < 26; i++)\n    if (b[i] == max) {\n      out = 'A' + i;\n      printf(\"%c\\n\", 'A' + i);\n      printf(\"%d\\n\", b[i]);\n      break;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == out) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, num[1000], i, k, l = 0, a[26] = {0};\n  char nam[1000][10], j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &num[i], nam[i]);\n  for (j = 'A'; j <= 'Z'; j++)\n    for (i = 0; i < m; i++)\n      if (strchr(nam[i], j))\n        a[j - 65]++;\n  for (i = 0, k = a[0]; i < 26; i++)\n    if (a[i] > k) {\n      k = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < m; i++) {\n    if (strchr(nam[i], l + 65))\n      printf(\"%d\\n\", num[i]);\n  }\n}\n"}
{"label": "2", "index": "2252", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint m, n;\nstruct student {\n  int id;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat() {\n  int i = 1;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &m);\n  cin >> p1->id >> p1->name;\n  head = NULL;\n  for (; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->id >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  int num[30] = {0}, max, j;\n  char i, auth;\n  head = creat();\n\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (i = 'A'; i <= 'Z'; i++) {\n      for (j = 0; j < strlen(p1->name); j++)\n        if (p1->name[j] == i)\n          num[i - 'A']++;\n    }\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      auth = i + 'A';\n    }\n  }\n  printf(\"%c \", auth);\n  printf(\"%d \", max);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++)\n      if (p1->name[j] == auth)\n        printf(\"%d \", p1->id);\n  }\n}\n"}
{"label": "2", "index": "2253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Bo {\n  int num;\n  char auth[30];\n} a[1010];\n\nint main() {\n  int n, i, j, maxnum = 0, max;\n  int zuozhe[26] = {0};\n  char out;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].auth);\n    for (j = 0; j <= strlen(a[i].auth) - 1; j++)\n      zuozhe[a[i].auth[j] - 'A'] = zuozhe[a[i].auth[j] - 'A'] + 1;\n  }\n  for (i = 1; i <= 25; i++)\n    if (zuozhe[i] > zuozhe[maxnum])\n      maxnum = i;\n  out = 'A' + maxnum;\n  printf(\"%c\\n\", out);\n  printf(\"%d\\n\", zuozhe[maxnum]);\n\n  for (i = 1; i <= n; i++) {\n    if (strchr(a[i].auth, out) != NULL)\n      printf(\"%d\\n\", a[i].num);\n  }\n}\n"}
{"label": "2", "index": "2254", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[100];\n  struct student *next;\n};\nint main() {\n  struct student *p1, *p2, *head;\n  int n, i, j, k, m, a[100];\n  char c[100], nam[100][100];\n  for (i = 0; i < 26; i++) {\n    c[i] = i + 65;\n    a[i] = 0;\n  }\n  cin >> n;\n  p1 = p2 = head = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->s;\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  i = 0;\n  while (p1 != NULL) {\n    strcpy(nam[i], p1->s);\n    i++;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s\", nam[k]);\n    for (i = 0; i < 26; i++) {\n      for (j = 0; nam[k][j] != '\\00'; j++)\n        if (nam[k][j] == c[i])\n          a[i]++;\n    }\n  }\n  k = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > k)\n      k = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == k) {\n      printf(\"%c %d\", c[i], a[i]);\n      m = i;\n      break;\n    }\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; nam[i][j] != '\\00'; j++) {\n      if (nam[i][j] == c[m])\n        printf(\" %d\", p1->num);\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int max, max2;\n  int a[26];\n  struct book {\n    int number;\n    char author[26];\n  } stu1[1000];\n  struct author {\n    int number[1000];\n    int ben;\n  } stu2[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d %s\", &stu1[i].number, stu1[i].author);\n  for (i = 0; i <= 25; i++) {\n    stu2[i].ben = 0;\n    a[i] = 0;\n  } \n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(stu1[i].author) - 1; j++) \n    {\n      k = stu1[i].author[j];                           \n      stu2[k - 65].ben++;                              \n      stu2[k - 65].number[a[k - 65]] = stu1[i].number; \n      a[k - 65]++;                                     \n    }\n  }\n  max = stu2[0].ben;\n  max2 = 0; \n  for (i = 1; i <= 25; i++) {\n    if (stu2[i].ben > max) {\n      max = stu2[i].ben;\n      max2 = i; \n    }\n  }\n  printf(\"%c\\n\", max2 + 65);\n  printf(\"%d\\n\", max);\n  for (j = 0; j <= a[max2] - 1; j++) \n    printf(\"%d\\n\", stu2[max2].number[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "2256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num1;\n  char au[27];\n} bk[1000];\nstruct author {\n  char name;\n  int a;\n  int num2[1000];\n} aur[27];\nint main() {\n  int n, i, j;\n  struct author max;\n  max.a = 0;\n\n  for (j = 0; j < 26; j++) {\n    aur[j].name = 65 + j;\n    aur[j].a = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk[i].num1, bk[i].au);\n  }\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      aur[bk[i].au[j] - 65].num2[aur[bk[i].au[j] - 65].a] = bk[i].num1;\n      aur[bk[i].au[j] - 65].a++;\n    }\n  }\n  \n  for (i = 0; i < 26; i++) {\n    if (aur[i].a > max.a)\n      max = aur[i];\n  }\n  printf(\"%c\\n%d\\n\", max.name, max.a);\n  for (i = 0; i < max.a; i++) {\n    printf(\"%d\\n\", max.num2[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[27];\n    struct book *next;\n  } *head = 0, *p1, *p2;\n  int total, i, j, sumbook[26] = {0}, len, max;\n  scanf(\"%d\", &total);\n  for (i = 0; i < total; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    if (p1 == 0) {\n      printf(\"Memory request failed!\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &p1->num, p1->author);\n    len = strlen(p1->author);\n    for (j = 0; j < len; j++)\n      sumbook[p1->author[j] - 'A']++;\n    if (head)\n      p2->next = p1;\n    else\n      head = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  len = 0;\n  for (i = 0; i < 26; i++) {\n    if (sumbook[i] > len) {\n      len = sumbook[i];\n      max = i;\n    }\n  }\n  cout << max + 'A' << \"\\n\" << sumbook[max] << \"\\n\";\n  max += 'A';\n  for (p1 = head; p1; p1 = p1->next) {\n    len = strlen(p1->author);\n    for (i = 0; i < len; i++) {\n      if (p1->author[i] == max) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2258", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, d, s;\n  int a, b = 0, c;\n  int tt[1000], pp[1000], miao[26] = {0};\n  char kk[1000][30];\n  char w;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &tt[i], kk[i]);\n  }\n  for (s = 0, j = 65; j <= 90; j++, s++) {\n    for (k = 0; k < m; k++) {\n      for (d = 0; kk[k][d] != '\\0'; d++) {\n        if (kk[k][d] == j)\n          miao[s]++;\n      }\n    }\n  }\n  for (a = 0; a < 26; a++) {\n    if (miao[a] > b) {\n      b = miao[a];\n      c = a;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, b);\n  w = (c + 65);\n  for (i = 0; i < m; i++) {\n    for (j = 0; kk[i][j] != '\\0'; j++) {\n      if (kk[i][j] == w) {\n        printf(\"%d\\n\", tt[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nstruct stu {\n  int num;\n  char name[27];\n  struct stu *next;\n};\n\nstruct stu *creat() {\n  int i = 0;\n  struct stu *head, *p1, *p2;\n  head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p2->num, p2->name);\n  while (i < n - 1) {\n    i++;\n    p2 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %s\", &p2->num, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  return head;\n}\n\nint main() {\n  struct stu *p, *head;\n  int k, u, max = 0, maxnum;\n  int a[26] = {0};\n  cin >> n;\n  head = p = creat();\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      a[p->name[u] - 'A']++;\n    p = p->next;\n  }\n  for (k = 0; k < 26; k++)\n    if (a[k] > max) {\n      max = a[k];\n      maxnum = k;\n    }\n  cout << maxnum + 'A' << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (k = 0; k < n; k++) {\n    for (u = 0; p->name[u] != '\\0'; u++)\n      if (p->name[u] == maxnum + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct data {\n  int code;\n  char author[20];\n};\nstruct letter {\n  char let;\n  int count;\n};\n\nint main() {\n  int n, i, j, k, t, max;\n  struct data a[100];\n  struct letter l[26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].code;\n\n    cin >> a[i].author;\n  }\n  for (i = 0; i < 26; i++) {\n    l[i].let = i + 65;\n    l[i].count = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].author[j] == l[k].let)\n          l[k].count++;\n      }\n    }\n  }\n  max = 0;\n  for (k = 0; k < 26; k++) {\n    if (l[k].count > max) {\n      max = l[k].count;\n      t = k;\n    }\n  }\n\n  printf(\"%c \", l[t].let);\n  printf(\"%d \", l[t].count);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      if (a[i].author[j] == l[t].let)\n        printf(\"%d \", a[i].code);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[1000], len[1000], num1[1000][26] = {0}, sum[26] = {0},\n                                        max = 0, m;\n  char writer[1000][26],\n      letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> writer[i];\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (writer[j][k] == letter[i]) {\n          num1[j][i]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + num1[j][i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[m], sum[m]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == letter[m]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2262", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int p;\n  char a[m + 1][27];\n  int len[m + 1];\n  int b[m + 1];\n  int c[26];\n  int i, j, k, l;\n  for (i = 0; i <= 25; i++)\n    c[i] = 0;\n  for (i = 1; i <= m; i++) {\n    cin >> b[i];\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n    for (j = 0; j <= len[i] - 1; j++)\n      c[a[i][j] - 'A']++;\n  }\n  int temp = -1;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > temp) {\n      temp = c[i];\n      p = i;\n    }\n  }\n  char n = 'A' + p;\n  cout << n << endl;\n  cout << temp << endl;\n  for (i = 1; i <= m; i++)\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (a[i][j] == '\\0') {\n        break;\n      } else if (a[i][j] == n) {\n        cout << b[i] << endl;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], i, l, j, max, s[26] = {0};\n  char c[1000][27], w;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> c[i];\n    l = strlen(c[i]);\n    for (j = 0; j < l; j++) {\n      s[c[i][j] - 65]++;\n    }\n  }\n  max = s[0];\n  w = 'A';\n  for (i = 1; i < 26; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      w = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == w) {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2264", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, max, t, i, j, a[1000], l, b[30] = {0};\n  char str[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> str[i];\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      b[str[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 64, b[t]);\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      if (str[i][j] == t + 64) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2265", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n};\nchar max(int *p);\n\nint main() {\n  int m, b, i, *p;\n  struct book shu[999];\n  char c;\n  int writer[26];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, d[1000];\n  char zuo[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  char s[1000][26], len;\n  int sum[26] = {0}, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &d[i], s[i]);\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (s[i][j] == 'A' + k)\n          sum[k]++;\n      }\n    }\n  }\n  int max = 0, count = 0;\n  char maxid;\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      maxid = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxid, max);\n  int t[1000];\n  for (i = 0; i < n; i++) {\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      if (s[i][j] == maxid) {\n        count++;\n        t[count] = d[i];\n      }\n    }\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"%d\\n\", t[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n = 1, m;\nstruct zuozhe {\n  int num;\n  char ren[26];\n  struct zuozhe *next;\n};\nstruct zuozhe *ap() {\n  struct zuozhe *head, *nw, *tn;\n  do {\n    nw = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    cin >> nw->num >> nw->ren;\n    if (n == 1) {\n      head = nw;\n      tn = head;\n    } else\n      tn->next = nw;\n    if (n <= m) {\n      tn = nw;\n      n++;\n    }\n  } while (n <= m);\n  tn->next = NULL;\n  return head;\n}\nint main() {\n  int i, max = 0, a[26] = {0}, j, w, l;\n  char z;\n  struct zuozhe *head, *p;\n  scanf(\"%d\", &m);\n  head = ap();\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      j = p->ren[i] - 65;\n      a[j]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      w = i;\n    }\n  }\n  z = 65 + w;\n  cout << z << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      if (p->ren[i] == z) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct data {\n  int code;\n  char author[20];\n};\nstruct letter {\n  char let;\n  int count;\n};\n\nint main() {\n  int n, i, j, k, t, max;\n  struct data a[100];\n  struct letter l[26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].code);\n\n    cin >> a[i].author;\n  }\n  for (i = 0; i < 26; i++) {\n    l[i].let = i + 65;\n    l[i].count = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].author[j] == l[k].let)\n          l[k].count++;\n      }\n    }\n  }\n  max = 0;\n  for (k = 0; k < 26; k++) {\n    if (l[k].count > max) {\n      max = l[k].count;\n      t = k;\n    }\n  }\n\n  printf(\"%c \", l[t].let);\n  printf(\"%d \", l[t].count);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      if (a[i].author[j] == l[t].let)\n        printf(\"%d \", a[i].code);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2269", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char a[26];\n  int la;\n  struct book *next;\n};\n\nstruct book *insert(struct book *head, struct book *temp) {\n  struct book *p0, *p1, *p2;\n  p1 = head;\n  p0 = temp;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->next != NULL)\n      p1 = p1->next;\n\n    p1->next = p0;\n    p0->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  struct book *p, *temp, *head = NULL;\n  int i, m, max;\n  int b[26] = {0};\n  char writer;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    temp = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d \", &temp->number);\n\n    cin >> temp->a;\n\n    temp->la = strlen(temp->a);\n    temp->next = NULL;\n    head = insert(head, temp);\n  }\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      b[p->a[i] - 65]++;\n    p = p->next;\n  }\n  max = b[0];\n  writer = 65;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      writer = i + 65;\n    }\n  }\n  printf(\"%c %d \", writer, max);\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      if (p->a[i] == writer) {\n        printf(\"%d \", p->number);\n        break;\n      }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, l, x, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (l = 0; l < 30; l++) {\n      for (x = 1; x <= 26; x++) {\n        if (k[i][l] == x + 64)\n          author[x]++;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max)\n      max = author[i];\n  }\n  for (i = 1; i <= 26; i++) {\n    if (author[i] == max) {\n      maxnumber = i;\n    }\n  }\n  char who[10];\n  who[0] = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who[0]);\n  cout << max << \"\\n\";\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who[0])\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char w[26];\n  struct book *next;\n};\nint c[26], m, i, j = 0, max_1;\n\nstruct book *creat(int m) {\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->w);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->w);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nvoid a(struct book *head) {\n  struct book *p;\n  char *x;\n  int l, ch;\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      l = (int)*x;\n      ch = l - 65;\n\n      if (ch >= 0)\n        c[ch] = c[ch] + 1;\n    }\n    p = p->next;\n  }\n}\n\nint main() {\n  struct book *head, *p;\n  struct book *creat(int m);\n  void a(struct book * head);\n  char writer, *x;\n  int wri, b[200];\n  for (i = 0; i < 26; i++) {\n    c[i] = 0;\n  }\n  for (i = 0; i < 200; i++)\n    b[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  a(head);\n  max_1 = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max_1) {\n      wri = i + 65;\n      max_1 = c[i];\n    }\n  }\n  printf(\"%c \", wri);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      if (*x == (char)wri) {\n        b[j] = p->num;\n        j = j + 1;\n        break;\n      }\n    }\n    p = p->next;\n  }\n  cout << j << \" \";\n  for (j = 0; b[j] > 0; j++)\n    printf(\"%d \", b[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "2272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  char z[30];\n  int n;\n} s[1000];\nstruct {\n  int name;\n  int nb, b[1000], k;\n} r[93];\n\nint main() {\n  int m, i, j, l, q;\n  for (i = 65; i <= 90; i++) {\n    r[i].name = i;\n    r[i].k = 1;\n  }\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &s[i].n, s[i].z);\n    l = strlen(s[i].z);\n    for (j = 0; j < l; j++) {\n      q = s[i].z[j];\n      r[q].nb++;\n      r[q].b[r[q].k] = s[i].n;\n      r[q].k++;\n    }\n  }\n  for (i = 65; i < 90; i++)\n    for (j = 90; j > i; j--)\n      if (r[j].nb > r[j - 1].nb) {\n        r[92] = r[j];\n        r[j] = r[j - 1];\n        r[j - 1] = r[92];\n      }\n  printf(\"%c\\n%d\\n\", r[65].name, r[65].nb);\n  for (i = 1; i <= r[65].nb; i++)\n    printf(\"%d\\n\", r[65].b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct worker {\n  int nm;\n  char name1[26];\n  struct worker *next;\n};\nstruct zuozhe {\n  char nam;\n  int counts;\n  int name[1000];\n  struct zuozhe *next;\n};\nstruct worker *creat1(int n) {\n  struct worker *head, *p1, *p2;\n  int i;\n  head = (struct worker *)malloc(sizeof(struct worker));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p2->nm, p2->name1);\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nstruct zuozhe *creat2() {\n  struct zuozhe *head, *p1, *p2;\n  int i;\n  head = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n  p1 = p2 = head;\n  for (i = 0; i < 26; i++) {\n    p2 = p1;\n    p1 = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    p2->counts = 0;\n    p2->nam = 'A' + i;\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nint main() {\n  int big = 0;\n  char zz;\n  int i, j;\n  char c;\n  int m, n;\n  int a[26] = {0};\n  struct worker *head1, *p1, *p2;\n  struct zuozhe *head2, *q1, *q2;\n  scanf(\"%d\", &n);\n  head1 = creat1(n);\n  p1 = p2 = head1;\n  head2 = creat2();\n  q1 = q2 = head2;\n  while (p1 != 0) {\n    i = 0;\n    while (p1->name1[i] != '\\0') {\n      q1 = head2;\n      while (1) {\n        if (q1->nam == p1->name1[i]) {\n          q1->name[q1->counts] = p1->nm;\n          q1->counts++;\n          i++;\n          break;\n        }\n        q1 = q1->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  q1 = head2;\n  while (q1 != 0) {\n    if (q1->counts > big) {\n      zz = q1->nam;\n      big = q1->counts;\n    }\n    q1 = q1->next;\n  }\n  q1 = head2;\n  while (1) {\n    if (q1->nam == zz) {\n      printf(\"%c\\n%d\\n\", q1->nam, q1->counts);\n      for (i = 0; i < q1->counts; i++) {\n        printf(\"%d\\n\", q1->name[i]);\n      }\n      break;\n    }\n    q1 = q1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char peo[26];\n} book1[999];\nint main() {\n  int n, i, j, num[26] = {0}, length, max = 0, t;\n  char author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book1[i].id, &book1[i].peo);\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      num[(int)(book1[i].peo[j] - 'A')]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      t = i;\n      author = i + 'A';\n    }\n  }\n  cout << author << \"\\n\" << num[t] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      if (book1[i].peo[j] == author) {\n        printf(\"%d\\n\", book1[i].id);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char wri[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26];\n  char tem[100];\n  int j = 0, k;\n  int shu[26][100];\n  int hao;\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &hao, tem);\n    j = 0;\n    while (tem[j] != '\\0') {\n      for (k = 0; k <= 25; k++) {\n        if (wri[k] == tem[j]) {\n          shu[k][num[k]] = hao;\n          num[k]++;\n        }\n      }\n      j++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", wri[max], num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", shu[max][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2276", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char edit[26];\n  struct book *next;\n};\nint m;\nstruct book *head, *p1, *p2;\n\nstruct book *creat(void) {\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->edit);\n  head = p1;\n  p2 = p1;\n  m = m - 1;\n  do {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->edit);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    m = m - 1;\n  } while (m);\n  return (head);\n}\n\nint main() {\n  int max = 0, i = 0, j, k[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      k[(p->edit[i]) - 65] += 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++)\n    if (k[i] > max) {\n      max = k[i];\n      j = i;\n    }\n  printf(\"%c %d \", j + 65, max);\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      if (p->edit[i] == j + 65)\n        printf(\"%d \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char name[27];\n  int anum;\n  int num;\n  struct student *next;\n};\nint n;\nint i;\nchar c;\n\nstruct student *creat() {\n  struct student *head;\n  head = (struct student *)malloc(1000);\n  if (n == 0)\n    head = NULL;\n  else {\n    cin >> head->num;\n    for (i = 0; (c = getchar()) != ' '; i++) {\n      head->name[i] = c;\n    }\n    head->anum = i;\n    head->next = NULL;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2, *p;\n  char l[200] = {0};\n  int j;\n  int max = 0;\n  int lmax;\n\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    {\n      p1 = (struct student *)malloc(1000);\n      p2->next = p1;\n      p2 = p1;\n\n      cin >> p2->num;\n      for (j = 0; (c = getchar()) != ' '; j++) {\n        p2->name[j] = c;\n      }\n      p2->anum = j;\n\n      p2->next = NULL;\n    }\n  }\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      l[p->name[i]] = l[p->name[i]] + 1;\n    }\n    p = p->next;\n  }\n\n  for (i = 65; i <= 90; i++) {\n    if (l[i] > max) {\n      max = l[i];\n      lmax = i;\n    }\n  }\n  printf(\"%c %d \", lmax, max);\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      if (p->name[i] == lmax)\n        cout << p->num << \" \";\n    }\n    p = p->next;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2278", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char s[27];\n};\n\nstruct author {\n  int num;\n  int bn[1000];\n};\n\nint main() {\n  int m, i, j, l, max = 0;\n\n  char c;\n\n  struct book bk[1000];\n  struct author au['Z' + 1], t;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < 'Z' + 1; j++)\n    au[j].num = 0;\n  for (i = 0; i < m; i++) {\n\n    scanf(\"%d %s\", &bk[i].num, bk[i].s);\n\n    l = strlen(bk[i].s);\n\n    for (j = 0; j < l; j++)\n      au[bk[i].s[j]].bn[au[bk[i].s[j]].num++] = bk[i].num;\n  }\n\n  for (j = 0; j < 'Z' + 1; j++)\n    if (au[j].num > max) {\n      t = au[j];\n      c = j;\n      max = au[j].num;\n    }\n\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", t.num);\n\n  for (i = 0; i < t.num; i++)\n    printf(\"%d\\n\", t.bn[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int ISBN;\n  char name[26];\n} b[999];\nint main() {\n  int i, j, m, k[26], max = 0;\n  char a, d = 'A';\n  for (i = 0; i < 26; i++)\n    k[i] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].ISBN, b[i].name);\n  for (a = 'A'; a <= 'Z'; a++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < 26; j++)\n        if (b[i].name[j] == a)\n          k[a - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (k[i] >= max)\n      max = k[i];\n  for (i = 0; i < 26; i++)\n    if (k[i] == max) {\n      d += i;\n      cout << d << \"\\n\";\n      printf(\"%d\\n\", max);\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (b[i].name[j] == d)\n        printf(\"%d\\n\", b[i].ISBN);\n  return 0;\n}\n"}
{"label": "2", "index": "2280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int num;\n  char author[30];\n  struct info *next;\n};\nstruct info *create(int n) {\n  struct info *p1, *p2, *head;\n  int i;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d%s\", &p1->num, p1->author);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  i = 1;\n  while (i < n) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d%s\", &p1->num, p1->author);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  }\n  return head;\n}\n\nint main() {\n  int n, i, t, index, j;\n  struct info *head, *p;\n  int *g;\n  scanf(\"%d\", &n);\n  head = create(n);\n  g = (int *)malloc(26 * sizeof(int));\n  p = head;\n  for (i = 0, t = 0; i < 26; i++) {\n    *(g + i) = 0;\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      (*(g + (*(p->author + j)) - 65))++;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0, t = 0; i < 26; i++) {\n    if (*(g + i) > t) {\n      t = *(g + i);\n      index = i;\n    }\n  }\n  printf(\"%c\\n\", index + 65);\n  cout << *(g + index) << \"\\n\";\n  p = head;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      if (*(p->author + j) == index + 65) {\n        printf(\"%d\\n\", p->num);\n      }\n      j++;\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct bo {\n  char id[10];\n  char au[100];\n};\n\nint main() {\n  int n, i, j, max;\n  char maxa;\n  struct bo *book;\n  int auth[26];\n  memset(auth, 0, sizeof(int) * 26);\n  cin >> n;\n  book = (struct bo *)malloc(sizeof(struct bo) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].id, book[i].au);\n    for (j = 0; book[i].au[j]; j++) {\n      auth[book[i].au[j] - 'A']++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < auth[i]) {\n      max = auth[i];\n      maxa = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", maxa);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    if (strchr(book[i].au, maxa))\n      printf(\"%s\\n\", book[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, max;\n  char name[2000][30], alp[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  int No[2000], num[30] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> No[i] >> name[i];\n  }\n  for (i = 0; i < 26; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < strlen(name[k]); j++) {\n        if (name[k][j] == alp[i]) {\n          num[i]++;\n          break;\n        }\n      }\n    }\n  }\n  max = num[0];\n  for (i = 1; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] == max) {\n      cout << alp[i] << \"\\n\" << max << \"\\n\";\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < 27; j++) {\n          if (name[k][j] == alp[i]) {\n            printf(\"%d\\n\", No[k]);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2283", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], i, l, c[26] = {0}, k, max, n, j;\n  char b[100][26],\n      d[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      else if (b[i][j] == 'B')\n        c[1]++;\n      else if (b[i][j] == 'C')\n        c[2]++;\n      else if (b[i][j] == 'D')\n        c[3]++;\n      else if (b[i][j] == 'E')\n        c[4]++;\n      else if (b[i][j] == 'F')\n        c[5]++;\n      else if (b[i][j] == 'G')\n        c[6]++;\n      else if (b[i][j] == 'H')\n        c[7]++;\n      else if (b[i][j] == 'I')\n        c[8]++;\n      else if (b[i][j] == 'J')\n        c[9]++;\n      else if (b[i][j] == 'K')\n        c[10]++;\n      else if (b[i][j] == 'L')\n        c[11]++;\n      else if (b[i][j] == 'M')\n        c[12]++;\n      else if (b[i][j] == 'N')\n        c[13]++;\n      else if (b[i][j] == 'O')\n        c[14]++;\n      else if (b[i][j] == 'P')\n        c[15]++;\n      else if (b[i][j] == 'Q')\n        c[16]++;\n      else if (b[i][j] == 'R')\n        c[17]++;\n      else if (b[i][j] == 'S')\n        c[18]++;\n      else if (b[i][j] == 'T')\n        c[19]++;\n      else if (b[i][j] == 'U')\n        c[20]++;\n      else if (b[i][j] == 'V')\n        c[21]++;\n      else if (b[i][j] == 'W')\n        c[22]++;\n      else if (b[i][j] == 'X')\n        c[23]++;\n      else if (b[i][j] == 'Y')\n        c[24]++;\n      else if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  max = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] >= max) {\n      max = c[i];\n      k = i;\n    }\n  printf(\"%c\\n\", d[k]);\n  printf(\"%d\\n\", c[k]);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == d[k])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2284", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char writer[26];\n  int num;\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i, m;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->writer;\n    p1->next = NULL;\n  }\n  p2->next = p1;\n  return (head);\n}\nint main() {\n  int n, a[26][1000] = {0}, b[26] = {0}, i, max, k;\n  struct book *head, *p;\n  char *q;\n  head = creat();\n  for (p = head->next; p; p = p->next) {\n    n = strlen(p->writer);\n    for (i = 0, q = p->writer; i < n; i++, q++) {\n      a[*q - 65][b[*q - 65]] = p->num;\n      b[*q - 65]++;\n    }\n  }\n  max = b[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[k][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int a[1000];\n  char s[1000][26];\n  int i, j;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n\n  char x;\n  int max = 0;\n  char maxx;\n  int l;\n  for (x = 'A'; x <= 'Z'; x++) {\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (s[i][j] == x)\n          break;\n      }\n      if (j != 26)\n        l++;\n    }\n    if (l > max) {\n      max = l;\n      maxx = x;\n    }\n  }\n  cout << maxx << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (s[i][j] == maxx)\n        break;\n    }\n    if (j != 26)\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n    struct book *next;\n  } * p1, *p2, *p, *head, *t;\n  int i, n, max = 0, j, k, l, y[400], q;\n  char u;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct book *)malloc(sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p1->x, p1->z);\n    y[i] = strlen(p1->z);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < y[i]; j++) {\n      q = 1;\n      t = p->next;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (p->z[j] == t->z[l])\n            q++;\n        t = t->next;\n      }\n      if (q > max) {\n        max = q;\n        u = p->z[j];\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", u, max);\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == p->z[j]) {\n        printf(\"%d\\n\", p->x);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[20];\n  struct book *next;\n};\nint main() {\n  int n, i, j, m, k, c[26], max;\n  char a[26];\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    cin >> p1->num >> p1->writer;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < 26; i++) {\n      n = strlen(p1->writer);\n      for (k = 0; k < n; k++) {\n        if (a[i] == p1->writer[k]) {\n          c[i]++;\n        }\n      }\n    }\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  cout << a[max] << \" \" << c[max] << \" \";\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->writer);\n    for (j = 0; j < n; j++) {\n      if (p1->writer[j] == a[max]) {\n        cout << p1->num << \" \";\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, d, s;\n  int a, b = 0, c;\n  int tt[1000], pp[1000], miao[26] = {0};\n  char kk[1000][30];\n  char w;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &tt[i], kk[i]);\n  }\n  for (s = 0, j = 65; j <= 90; j++, s++) {\n    for (k = 0; k < m; k++) {\n      for (d = 0; kk[k][d] != '\\0'; d++) {\n        if (kk[k][d] == j)\n          miao[s]++;\n      }\n    }\n  }\n  for (a = 0; a < 26; a++) {\n    if (miao[a] > b) {\n      b = miao[a];\n      c = a;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, b);\n  w = (c + 65);\n  for (i = 0; i < m; i++) {\n    for (j = 0; kk[i][j] != '\\0'; j++) {\n      if (kk[i][j] == w) {\n        printf(\"%d\\n\", tt[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2289", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char writer[1000][30];\n  char abc[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int m, n, mark[1000], num[26] = {0}, sum = 0, i, j;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> mark[i];\n    scanf(\"%s\", writer[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == 'A')\n        num[0]++;\n      else if (writer[i][j] == 'B')\n        num[1]++;\n      else if (writer[i][j] == 'C')\n        num[2]++;\n      else if (writer[i][j] == 'D')\n        num[3]++;\n      else if (writer[i][j] == 'E')\n        num[4]++;\n      else if (writer[i][j] == 'F')\n        num[5]++;\n      else if (writer[i][j] == 'G')\n        num[6]++;\n      else if (writer[i][j] == 'H')\n        num[7]++;\n      else if (writer[i][j] == 'I')\n        num[8]++;\n      else if (writer[i][j] == 'J')\n        num[9]++;\n      else if (writer[i][j] == 'K')\n        num[10]++;\n      else if (writer[i][j] == 'L')\n        num[11]++;\n      else if (writer[i][j] == 'M')\n        num[12]++;\n      else if (writer[i][j] == 'N')\n        num[13]++;\n      else if (writer[i][j] == 'O')\n        num[14]++;\n      else if (writer[i][j] == 'P')\n        num[15]++;\n      else if (writer[i][j] == 'Q')\n        num[16]++;\n      else if (writer[i][j] == 'R')\n        num[17]++;\n      else if (writer[i][j] == 'S')\n        num[18]++;\n      else if (writer[i][j] == 'T')\n        num[19]++;\n      else if (writer[i][j] == 'U')\n        num[20]++;\n      else if (writer[i][j] == 'V')\n        num[21]++;\n      else if (writer[i][j] == 'W')\n        num[22]++;\n      else if (writer[i][j] == 'X')\n        num[23]++;\n      else if (writer[i][j] == 'Y')\n        num[24]++;\n      else if (writer[i][j] == 'Z')\n        num[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= sum) {\n      sum = num[i];\n      n = i;\n    }\n  }\n  printf(\"%c\\n\", abc[n]);\n  printf(\"%d\\n\", num[n]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == abc[n]) {\n        printf(\"%d\\n\", mark[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "2", "index": "2290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Book {\n    int id;\n    char zz[26];\n  } book[1000];\n\n  int n, i, j, max = 0, index;\n  int sum[26] = {0};\n  char author;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].id, &book[i].zz);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      sum[book[i].zz[j] - 'A']++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      author = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      if (book[i].zz[j] == author) {\n        printf(\"%d\\n\", book[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } b[999];\n  int a[26] = {0}, n, i, j, k, max = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].author);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      k = 0;\n      while (b[j].author[k] != '\\0') {\n        if (b[j].author[k] == i + 65)\n          a[i]++;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (max < a[i])\n      max = a[i];\n  i = 0;\n  while (max != a[i])\n    i++;\n  cout << i + 65 << \"\\n\" << a[i] << \"\\n\";\n  for (j = 0; j < n; j++) {\n    k = 0;\n    while (b[j].author[k] != i + 65 && b[j].author[k] != '\\0')\n      k++;\n    if (b[j].author[k] == i + 65)\n      printf(\"%d\\n\", b[j].num);\n  }\n}\n"}
{"label": "2", "index": "2292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a[1000], i, n, j, k;\n  scanf(\"%d\", &m);\n  char b[1000][27];\n  int count[26] = {0};\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == k + 65) {\n          count[k]++;\n        }\n      }\n    }\n  }\n  int max, maxk;\n  max = count[0];\n  maxk = 0;\n  for (k = 0; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      maxk = k;\n    }\n  }\n  char mauthor;\n  mauthor = maxk + 65;\n  printf(\"%c\\n%d\\n\", mauthor, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      if (b[i][j] == mauthor) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, p, j, t, q;\nint SAVER[1500];\nchar R[1500][50];\nint RR[50];\n\nint main() {\n  cin >> n;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &SAVER[i]);\n    cin.get();\n    cin >> R[i];\n    j = 0;\n    while (R[i][j] != '\\0') {\n      RR[R[i][j] - 'A']++;\n      j++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (RR[i - 'A'] > t) {\n      t = RR[i - 'A'];\n      q = i;\n    }\n  printf(\"%c\\n%d\\n\", (char)q, t);\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    while (R[i][j] != '\\0') {\n      if (R[i][j] == q)\n        cout << SAVER[i] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, temp = 26, n, p[27] = {0};\n  struct {\n    int a;\n    char s[30];\n  } t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &t[i].a, t[i].s);\n    for (j = 0; j < strlen(t[i].s); j++) {\n      p[t[i].s[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[temp])\n      temp = i;\n  }\n  printf(\"%c\\n%d\\n\", temp + 'A', p[temp]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(t[i].s); j++) {\n      if (t[i].s[j] == temp + 'A') {\n        printf(\"%d\\n\", t[i].a);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2295", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[25];\n} book[999];\nint main() {\n  int m, i, j, k, b, c, max = 0, a[25] = {0}, q[25][999] = {0}, p = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].name;\n    b = strlen(book[i].name);\n    for (j = 0; j < b; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].name[j] == k + 65) {\n          a[k] = a[k] + 1;\n          q[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, max);\n  for (i = 0; i < m; i++) {\n    if (q[c][i] > 0)\n      printf(\"%d\\n\", q[c][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  char name[1000][26];\n  int num[1000];\n  int i, j;\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &num[i], name[i]);\n\n  int a[26] = {0};\n  char k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == 'A')\n        a[0]++;\n      if (name[i][j] == 'B')\n        a[1]++;\n      if (name[i][j] == 'C')\n        a[2]++;\n      if (name[i][j] == 'D')\n        a[3]++;\n      if (name[i][j] == 'E')\n        a[4]++;\n      if (name[i][j] == 'F')\n        a[5]++;\n      if (name[i][j] == 'G')\n        a[6]++;\n      if (name[i][j] == 'H')\n        a[7]++;\n      if (name[i][j] == 'I')\n        a[8]++;\n      if (name[i][j] == 'J')\n        a[9]++;\n      if (name[i][j] == 'K')\n        a[10]++;\n      if (name[i][j] == 'L')\n        a[11]++;\n      if (name[i][j] == 'M')\n        a[12]++;\n      if (name[i][j] == 'N')\n        a[13]++;\n      if (name[i][j] == 'O')\n        a[14]++;\n      if (name[i][j] == 'P') {\n        a[15]++;\n      }\n      if (name[i][j] == 'Q')\n        a[16]++;\n      if (name[i][j] == 'R')\n        a[17]++;\n      if (name[i][j] == 'S')\n        a[18]++;\n      if (name[i][j] == 'T')\n        a[19]++;\n      if (name[i][j] == 'U')\n        a[20]++;\n      if (name[i][j] == 'V')\n        a[21]++;\n      if (name[i][j] == 'W')\n        a[22]++;\n      if (name[i][j] == 'X')\n        a[23]++;\n      if (name[i][j] == 'Y')\n        a[24]++;\n      if (name[i][j] == 'Z')\n        a[25]++;\n    }\n  }\n  int max = a[0];\n  int o = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      o = i;\n    }\n  }\n  cout << b[o] << \"\\n\" << a[o] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == b[o])\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  scanf(\"%d\", &i);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  struct Author {\n    int count;\n    int number[1000];\n  };\n\n  struct Author b[26];\n  for (i = 0; i < 26; i++)\n    b[i].count = 0;\n  int max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      b[a[i].auther[j] - 'A'].number[b[a[i].auther[j] - 'A'].count] =\n          a[i].number;\n      b[a[i].auther[j] - 'A'].count++;\n    }\n  }\n\n  max = b[0].count;\n  for (i = 0; i < 26; i++)\n    if (b[i].count >= max) {\n      max = b[i].count;\n      record = i;\n    }\n  cout << record + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", b[record].number[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[27];\n} book[100];\nint main() {\n  int n, i, k, sz[26], t, m, e;\n  scanf(\"%d\", &n);\n  m = 0;\n  for (i = 0; i < 26; i++) {\n    sz[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].author);\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      sz[book[i].author[k] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sz[i] > m) {\n      m = sz[i];\n      e = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", e + 'A', m);\n  for (i = 0; i < n; i++) {\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      if (book[i].author[k] == e + 'A') {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct worker {\n  int name;\n  char au[20];\n  struct worker *next;\n};\nstruct help {\n  char author;\n  int max;\n};\nstruct worker *creat(int m) {\n  struct worker *p1, *p2, *p;\n  int i;\n  p1 = p2 = (struct worker *)malloc(sizeof(struct worker));\n\n  scanf(\"%d %s\", &p1->name, p1->au);\n  p = p1;\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p1->name, p1->au);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return p;\n}\nvoid print(struct worker *p) {\n  struct worker *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%d %s\\n\", p1->name, p1->au);\n    p1 = p1->next;\n  }\n}\nvoid most(struct worker *p) {\n  struct worker *p1, *p2;\n  int a[30] = {0}, i, max;\n  char author;\n  struct help t;\n  p1 = p;\n  p2 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      a[*(p1->au + i) - 65] = a[*(p1->au + i) - 65] + 1;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max)\n      author = i + 65;\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  p1 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      if (*(p1->au + i) == author)\n        printf(\"%d\\n\", p1->name);\n    }\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct worker *p1, *p;\n  struct help t;\n  int m;\n  char c;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  p1 = p;\n  \n  most(p1);\n}\n"}
{"label": "2", "index": "2300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int bianhao;\n    char zuozhe[100];\n  } a[1000];\n  int i, j, n, l, max;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].bianhao >> a[i].zuozhe;\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      b[a[i].zuozhe[j] - 65]++;\n  max = b[0];\n  l = 0;\n  for (i = 1; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      l = i;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      if (a[i].zuozhe[j] == (l + 65)) {\n        printf(\"%d\\n\", a[i].bianhao);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2301", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[1000] = {0}, b[1000] = {0}, c[100] = {0}, l = 0;\n  char s[1000][100] = {0}, m[26] = {0}, p;\n  int i = 0, j = 0, k = 0, t = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    m[j] = i;\n    for (t = 0; t < n; t++) {\n      for (k = 0; s[t][k] != '\\0'; k++) {\n        if (s[t][k] == m[j]) {\n          c[j]++;\n          break;\n        }\n      }\n    }\n    j++;\n  }\n  l = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > l) {\n      l = c[i];\n      p = m[i];\n    }\n  }\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", l);\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; s[i][j] != '\\0'; j++) {\n      if (s[i][j] == p) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 1) {\n      printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], b[27], max = 0;\n  int i, j, n, k, t, len = 0;\n  char str[100][27];\n  scanf(\"%d\", &n);\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i][1]);\n    scanf(\"%s\", str[i]);\n    len = strlen(str[i]);\n    for (j = 0; j < len; j++) {\n      k = str[i][j] - 'A';\n      b[k]++;\n      a[i][k + 65] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 'A', max);\n  for (i = 1; i <= n; i++) {\n    if (a[i][t + 'A'] == 1)\n      cout << a[i][1] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n\n  struct book {\n    int num;\n    char name[26];\n  } book[999];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\\n\", &book[i].num, book[i].name);\n  }\n\n  struct author {\n    char l;\n    int count;\n  } au[26];\n\n  for (i = 0; i < 26; i++) {\n    au[i].l = 65 + i;\n    au[i].count = 0;\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (au[i].l == book[j].name[k]) {\n          au[i].count++;\n          break;\n        }\n      }\n    }\n  }\n\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (au[max].count < au[i].count)\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", au[max].l, au[max].count);\n\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (au[max].l == book[j].name[k]) {\n        cout << book[j].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2304", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, a[1000], c[91] = {0}, k, n, p = 0;\n  char b[1000][26], q;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++) {\n      k = b[i][j];\n      c[k]++;\n    }\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > p) {\n      p = c[i];\n      q = i;\n    }\n  printf(\"%c\\n%d\\n\", q, p);\n  for (i = 1; i <= m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++)\n      if (b[i][j] == q) {\n        printf(\"%d\\n\", a[i]);\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int num;\n  char author_name[27];\n};\n\nint main() {\n  int ere[26];\n  int m, i, max = 0, key;\n  for (i = 0; i < 26; i++)\n    ere[i] = 0;\n\n  char *a;\n  struct shu book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    cin >> book[i].author_name;\n  }\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      ere[(*a) - 'A']++;\n      a++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ere[i] >= max) {\n      max = ere[i];\n      key = i;\n    }\n  }\n  printf(\"%c\\n\", (key + 'A'));\n  cout << ere[key] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      if ((key + 'A') == *a) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char zz[26];\n} b[999];\nint main() {\n  int m, i, num[26] = {0}, maxz, j;\n  char string[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].id, &b[i].zz);\n    for (j = 0; b[i].zz[j] != '\\0'; j++)\n      num[b[i].zz[j] - 'A']++;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++)\n    if (max < num[i]) {\n      max = num[i];\n      maxz = i;\n    }\n  printf(\"%c\\n%d\", maxz + 65, max);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].zz[j] != '\\0'; j++) {\n      if (b[i].zz[j] == maxz + 65)\n        printf(\"\\n%d\", b[i].id);\n      else\n        continue;\n    }\n}\n"}
{"label": "2", "index": "2307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint c[26];\nchar b[1000][100];\nchar out;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, tmp = 0, tmp1 = 0, tmp2;\n  int a[1000];\n  out = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n\n    if (c[i] > tmp) {\n      tmp = c[i];\n      tmp1 = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", out + tmp1, tmp);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j] != '\\0'; j++) {\n      tmp2 = b[i][j];\n\n      if (tmp2 == (out + tmp1)) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char edit[26];\n  struct book *next;\n};\nint m;\nstruct book *head, *p1, *p2;\n\nstruct book *creat(void) {\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->edit);\n  head = p1;\n  p2 = p1;\n  m = m - 1;\n  do {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->edit;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    m = m - 1;\n  } while (m);\n  return (head);\n}\n\nint main() {\n  int max = 0, i = 0, j, k[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      k[(p->edit[i]) - 65] += 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++)\n    if (k[i] > max) {\n      max = k[i];\n      j = i;\n    }\n  printf(\"%d %d \", j + 65, max);\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      if (p->edit[i] == j + 65)\n        printf(\"%d \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int mark;\n  char name[26];\n};\nint main() {\n  int m, h, i, j, k, max, length;\n  int t[26];\n  char a;\n  scanf(\"%d\", &m);\n  struct book book[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].mark, book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    a = 'A' + i;\n    t[i] = 0;\n    for (j = 0; j < m; j++) {\n      length = strlen(book[i].name);\n\n      for (h = 0; h < 26; h++)\n        if (a == book[j].name[h]) {\n          t[i]++;\n        }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      k = i;\n    }\n  }\n  a = 'A' + k;\n  printf(\"%c\\n%d\\n\", a, t[k]);\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].name);\n    for (j = 0; j < 26; j++) {\n      if ('A' + k == book[i].name[j])\n        printf(\"%d\\n\", book[i].mark);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p;\n  p = (int *)malloc(26 * sizeof(int));\n  struct book {\n    int num;\n    char s[26];\n  } b[999];\n  int n, i, j, ss, max = 0, r;\n  char x;\n  for (ss = 0; ss < 26; ss++)\n    *(p + ss) = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i].num >> b[i].s;\n    for (j = 0; b[i].s[j] != '\\0'; j++)\n      *(p + ((int)b[i].s[j] - 65)) += 1;\n  }\n  for (r = 0; r < 26; r++)\n    max = max > *(p + r) ? max : *(p + r);\n\n  for (r = 0; r < 26; r++) {\n    if (*(p + r) == max) {\n      printf(\"%c\", (65 + r));\n      x = r;\n      cout << \"\\n\";\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      if ((int)b[i].s[j] - 65 == x)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct books {\n    int book;\n    char writer[20];\n  } bk[1000];\n  int n, i, j, m, max, k, maxw = 0, flag = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &bk[i].book, bk[i].writer);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      k = bk[i].writer[j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxw = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxw + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      if (maxw + 65 == bk[i].writer[j])\n        printf(\"%d\\n\", bk[i].book);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2312", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct score {\n  char id[10];\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, k, n, num, max = 0;\n  char maxname;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].id);\n    cin >> book[i].name;\n  }\n  for (i = 0; i < 26; i++) {\n    n = 0;\n    for (j = 0; j < num; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[j].name[k] == ('A' + i)) {\n          n += 1;\n        }\n      }\n    }\n    if (n > max) {\n      maxname = 'A' + i;\n      max = n;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxname, max);\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < 26; k++) {\n      if (book[j].name[k] == maxname)\n        printf(\"%s\\n\", book[j].id);\n      ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, m, i, max = 0, n, count[26] = {0};\n  char b;\n  struct book {\n    int id;\n    char author[26];\n  } book[1024];\n  char *p = &book[0].author[0];\n  char *q;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n  }\n  for (i = 0; i < m; i++)\n\n    for (p = book[i].author; *p != '\\0'; p++) {\n      a = *p;\n      count[a - 65]++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      b = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n  for (i = 0; i < m; i++) {\n    for (q = book[i].author; *q != '\\0'; q++) {\n      if (*q == b) {\n        printf(\"%d\\n\", book[i].id);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2314", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n} * p1, *p2;\n\nstruct book *creat(void) {\n  struct book *head;\n  int i;\n  head = 0;\n  p1 = 0;\n  p2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    if (head == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct book *head, *p;\n  char a[27], *q, c;\n  int b[27], i, m, n1 = 0, max; \n  for (i = 1; i < 27; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  head = creat();\n  for (p = head; p != 0; p = p->next) \n  {\n    for (q = p->name; *q != '\u0000'; q++) {\n      m = 0;\n      for (i = 1; i <= n1; i++) \n        if (*q == a[i]) {\n          m = 1;\n          b[i]++;\n          break;\n        }\n      if (m == 0) {\n        n1++; \n        a[n1] = *q;\n        b[n1] = 1;\n      }\n    }\n  }\n  max = b[1];\n  c = a[1];\n  for (i = 1; i <= n1 - 1; i++)\n    if (b[i] > max) {\n      c = a[i];\n      max = b[i];\n    }\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p != 0; p = p->next) {\n    m = 0;\n    for (q = p->name; *q != '\u0000'; q++)\n      if (*q == c) {\n        m = 1;\n        break;\n      }\n    if (m)\n      printf(\"%d \", p->num); \n  }\n}\n"}
{"label": "2", "index": "2315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p = 0;\n  int m, i, j, max[1000];\n  struct book {\n    int num;\n    char s[27];\n  } book[1000];\n  memset(max, 0, sizeof(max));\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].s[j]; j++) {\n      if (++max[book[i].s[j]] > max[p])\n        p = book[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", p, max[p]);\n  for (i = 0; i < m; i++) {\n    if (strchr(book[i].s, p))\n      printf(\"%d\\n\", book[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct su {\n  int a;\n  char b[26];\n  struct su *next;\n};\nint main() {\n  int n, c[26] = {0}, i, k, j, l, max, m;\n  struct su *p, *head, *q;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    p = (struct su *)malloc(sizeof(struct su));\n    if (i == 0) {\n      head = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    } else {\n      q->next = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    }\n  }\n  q->next = NULL;\n  max = c[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (max < c[j]) {\n      max = c[j];\n      m = j;\n    }\n  }\n  cout << m + 'A' << \"\\n\" << max << \"\\n\";\n  p = head;\n  do {\n    k = strlen(p->b);\n    for (j = 0; j < k; j++) {\n      if (('A' + m) == p->b[j]) {\n        printf(\"%d\\n\", p->a);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[27], max = 0;\n  int i, j, n, k, t, len = 0;\n  char str[100][27];\n  scanf(\"%d\", &n);\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i][1]);\n    scanf(\"%s\", str[i]);\n    len = strlen(str[i]);\n    for (j = 0; j < len; j++) {\n      k = str[i][j] - 'A';\n      b[k]++;\n      a[i][k + 65] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 'A', max);\n  for (i = 1; i <= n; i++) {\n    if (a[i][t + 'A'] == 1)\n      printf(\"%d\\n\", a[i][1]);\n  }\n}\n"}
{"label": "2", "index": "2318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct SHU {\n  int bh;\n  char bz[26];\n};\n\nint main() {\n  int m, i, j, l, k, p;\n  int name[200] = {0}, max, shuhao[1000];\n  struct SHU shu[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &shu[i].bh, shu[i].bz);\n  }\n  for (i = 0; i < m; i++) {\n    l = strlen(shu[i].bz);\n    for (j = 0; j < l; j++) {\n      name[shu[i].bz[j]]++;\n    }\n  }\n  max = name[0];\n  for (i = 0; i < 200; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      k = i;\n    }\n  }\n  p = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].bz[j] == k) {\n        shuhao[p] = shu[i].bh;\n        p++;\n      }\n    }\n  }\n  cout << k << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < p; i++) {\n    cout << shuhao[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j = 0, zhe[26], t = 0, x, name;\n  for (i = 0; i < 26; i++) {\n    zhe[i] = 0;\n  }\n  char s[26];\n  scanf(\"%d\", &m);\n  struct {\n    int num;\n    char s[26];\n  } shu[1000];\n  for (i = 0; i < m; i++) {\n    cin >> shu[i].num >> shu[i].s;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; shu[i].s[j] != 0; j++) {\n      switch (shu[i].s[j]) {\n      case 'A':\n        zhe[0]++;\n        break;\n      case 'B':\n        zhe[1]++;\n        break;\n      case 'C':\n        zhe[2]++;\n        break;\n      case 'D':\n        zhe[3]++;\n        break;\n      case 'E':\n        zhe[4]++;\n        break;\n      case 'F':\n        zhe[5]++;\n        break;\n      case 'G':\n        zhe[6]++;\n        break;\n      case 'H':\n        zhe[7]++;\n        break;\n      case 'I':\n        zhe[8]++;\n        break;\n      case 'J':\n        zhe[9]++;\n        break;\n      case 'K':\n        zhe[10]++;\n        break;\n      case 'L':\n        zhe[11]++;\n        break;\n      case 'M':\n        zhe[12]++;\n        break;\n      case 'N':\n        zhe[13]++;\n        break;\n      case 'O':\n        zhe[14]++;\n        break;\n      case 'P':\n        zhe[15]++;\n        break;\n      case 'Q':\n        zhe[16]++;\n        break;\n      case 'R':\n        zhe[17]++;\n        break;\n      case 'S':\n        zhe[18]++;\n        break;\n      case 'T':\n        zhe[19]++;\n        break;\n      case 'U':\n        zhe[20]++;\n        break;\n      case 'V':\n        zhe[21]++;\n        break;\n      case 'W':\n        zhe[22]++;\n        break;\n      case 'X':\n        zhe[23]++;\n        break;\n      case 'Y':\n        zhe[24]++;\n        break;\n      case 'Z':\n        zhe[25]++;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (zhe[j] > t) {\n      t = zhe[j];\n      x = j;\n    }\n  }\n  name = 'A' + x;\n  printf(\"%c\\n\", name);\n  cout << t << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].s[j] == name) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct writer {\n    int num;\n    char name[20];\n    struct writer *next;\n  };\n  int i, j, k, l, m, z[26] = {0}, max, n;\n  struct writer *p1, *p2, *p, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct writer *)malloc(sizeof(struct writer));\n  scanf(\"%d %s\", &p1->num, &p1->name);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct writer *)malloc(sizeof(struct writer));\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < 26; i++) {\n    p = head;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 20; k++) {\n        if (p->name[k] == (char)(i + 65)) {\n          z[i]++;\n        }\n      }\n      p = p->next;\n    }\n  }\n  max = z[0];\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < z[i]) {\n      max = z[i];\n      j = i;\n    }\n  }\n  cout << 65 + j << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 20; k++) {\n      if (p->name[k] == (char)(65 + j)) {\n        cout << p->num << \"\\n\";\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } bookn[999];\n  struct zuozhe {\n    char w;\n    int count;\n  } zuozhen[26];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    zuozhen[i].w = 'A' + i;\n    zuozhen[i].count = 0;\n  }\n  int h = 0;\n  int m, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bookn[i].num, bookn[i].writer);\n    m = strlen(bookn[i].writer);\n    for (j = 0; j < m; j++) {\n      h = bookn[i].writer[j] - 'A';\n      zuozhen[h].count++;\n    }\n  }\n  struct zuozhe a;\n  a = zuozhen[0];\n  for (i = 1; i < 26; i++) {\n    if (a.count < zuozhen[i].count)\n      a = zuozhen[i];\n  }\n  printf(\"%c\\n\", a.w);\n  cout << a.count << \"\\n\";\n  int t;\n  for (i = 0; i < n; i++) {\n    t = strlen(bookn[i].writer);\n    for (j = 0; j < t; j++) {\n      if (bookn[i].writer[j] == a.w)\n        printf(\"%d\\n\", bookn[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char s[27];\n} shu[1000];\nint main() {\n  int n, i, l, j, max;\n  char name;\n  int letter[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> shu[i].num >> shu[i].s;\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      letter[(shu[i].s[j] - 65)]++;\n    }\n  }\n  for (max = letter[0], name = 65, i = 1; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      name = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < n; i++) {\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      if (shu[i].s[j] == name) {\n        cout << shu[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, l, x, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (l = 0; l < 30; l++) {\n      for (x = 1; x <= 26; x++) {\n        if (k[i][l] == x + 64)\n          author[x]++;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max)\n      max = author[i];\n  }\n  for (i = 1; i <= 26; i++) {\n    if (author[i] == max)\n      maxnumber = i;\n  }\n  char who[10];\n  who[0] = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who[0]);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who[0])\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char w[100];\n} book[100];\nint main() {\n  int i, j, l, n, b[26] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].w);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].w[j] != '\\0'; j++) {\n      if (book[i].w[j] == 'A')\n        b[0]++;\n      else if (book[i].w[j] == 'B')\n        b[1]++;\n      else if (book[i].w[j] == 'C')\n        b[2]++;\n      else if (book[i].w[j] == 'D')\n        b[3]++;\n      else if (book[i].w[j] == 'E')\n        b[4]++;\n      else if (book[i].w[j] == 'F')\n        b[5]++;\n      else if (book[i].w[j] == 'G')\n        b[6]++;\n      else if (book[i].w[j] == 'H')\n        b[7]++;\n      else if (book[i].w[j] == 'I')\n        b[8]++;\n      else if (book[i].w[j] == 'J')\n        b[9]++;\n      else if (book[i].w[j] == 'K')\n        b[10]++;\n      else if (book[i].w[j] == 'L')\n        b[11]++;\n      else if (book[i].w[j] == 'M')\n        b[12]++;\n      else if (book[i].w[j] == 'N')\n        b[13]++;\n      else if (book[i].w[j] == 'O')\n        b[14]++;\n      else if (book[i].w[j] == 'P')\n        b[15]++;\n      else if (book[i].w[j] == 'Q')\n        b[16]++;\n      else if (book[i].w[j] == 'R')\n        b[17]++;\n      else if (book[i].w[j] == 'S')\n        b[18]++;\n      else if (book[i].w[j] == 'T')\n        b[19]++;\n      else if (book[i].w[j] == 'U')\n        b[20]++;\n      else if (book[i].w[j] == 'V')\n        b[21]++;\n      else if (book[i].w[j] == 'W')\n        b[22]++;\n      else if (book[i].w[j] == 'X')\n        b[23]++;\n      else if (book[i].w[j] == 'Y')\n        b[24]++;\n      else if (book[i].w[j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i] < b[j])\n        break;\n    }\n    if (j == 26) {\n      printf(\"%c\\n%d\\n\", 65 + i, b[i]);\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (l = 0; book[j].w[l] != '\\0'; l++) {\n      if (book[j].w[l] == 65 + i) {\n        printf(\"%d\\n\", book[j].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2325", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[20];\n  struct tushu *next;\n};\nstruct tushu *creat(int m) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    cin >> p1->num >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, num[26] = {0}, i, max;\n  scanf(\"%d\", &m);\n  struct tushu *head, *p1;\n  head = creat(m);\n  char *x;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    x = p1->name;\n    while (p1 != NULL) {\n      while (*x != '\u0000') {\n        if (*x == (i + 65))\n          num[i] = num[i] + 1;\n        x = x + 1;\n      }\n      p1 = p1->next;\n      x = p1->name;\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[max] < num[i])\n      max = i;\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", num[max]);\n  p1 = head;\n  x = p1->name;\n  while (p1 != NULL) {\n    while (*x != '\u0000') {\n      if (*x == (max + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n      x = x + 1;\n    }\n    p1 = p1->next;\n    x = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len[1000];\n  int b[26];\n  int a[1000];\n  char str[1000][26];\n  int m, i, j, max, num;\n  char c;\n  int pos, temp;\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n    scanf(\"%s\", str[i]);\n    len[i] = strlen(str[i]);\n    for (j = 0; j < len[i]; j++) {\n      temp = str[i][j] - 'A';\n      b[temp]++;\n    }\n  }\n\n  max = b[0];\n  pos = 0;\n  for (i = 1; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      pos = i;\n    }\n  }\n  c = pos + 'A';\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (str[i][j] == c) {\n        num++;\n        if (num < max)\n          printf(\"%d\\n\", a[i]);\n        else\n          printf(\"%d\", a[i]);\n      }\n}\n"}
{"label": "2", "index": "2327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  short int num;\n  char author[27];\n};\n\nint main() {\n  char findoutmax(struct info a[], int n, int *pt);\n  void detect(struct info b[], char writter, int nn);\n  char figure;\n  int i, n_book, max, *p;\n  struct info book[999];\n  scanf(\"%d\", &n_book);\n  for (i = 0; i < n_book; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].author);\n  }\n  p = &max;\n  figure = findoutmax(book, n_book, p);\n  printf(\"%c\\n%d\\n\", figure, max);\n  detect(book, figure, n_book);\n  return 0;\n}\n\nchar findoutmax(struct info a[], int n, int *pt) {\n  int i, j, sum[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      switch (a[i].author[j]) {\n      case 'A':\n        sum[0] = sum[0] + 1;\n        break;\n      case 'B':\n        sum[1] = sum[1] + 1;\n        break;\n      case 'C':\n        sum[2] = sum[2] + 1;\n        break;\n      case 'D':\n        sum[3] = sum[3] + 1;\n        break;\n      case 'E':\n        sum[4] = sum[4] + 1;\n        break;\n      case 'F':\n        sum[5] = sum[5] + 1;\n        break;\n      case 'G':\n        sum[6] = sum[6] + 1;\n        break;\n      case 'H':\n        sum[7] = sum[7] + 1;\n        break;\n      case 'I':\n        sum[8] = sum[8] + 1;\n        break;\n      case 'J':\n        sum[9] = sum[9] + 1;\n        break;\n      case 'K':\n        sum[10] = sum[10] + 1;\n        break;\n      case 'L':\n        sum[11] = sum[11] + 1;\n        break;\n      case 'M':\n        sum[12] = sum[12] + 1;\n        break;\n      case 'N':\n        sum[13] = sum[13] + 1;\n        break;\n      case 'O':\n        sum[14] = sum[14] + 1;\n        break;\n      case 'P':\n        sum[15] = sum[15] + 1;\n        break;\n      case 'Q':\n        sum[16] = sum[16] + 1;\n        break;\n      case 'R':\n        sum[17] = sum[17] + 1;\n        break;\n      case 'S':\n        sum[18] = sum[18] + 1;\n        break;\n      case 'T':\n        sum[19] = sum[19] + 1;\n        break;\n      case 'U':\n        sum[20] = sum[20] + 1;\n        break;\n      case 'V':\n        sum[21] = sum[21] + 1;\n        break;\n      case 'W':\n        sum[22] = sum[22] + 1;\n        break;\n      case 'X':\n        sum[23] = sum[23] + 1;\n        break;\n      case 'Y':\n        sum[24] = sum[24] + 1;\n        break;\n      case 'Z':\n        sum[25] = sum[25] + 1;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (sum[j] < sum[i])\n      j = i;\n  }\n  *pt = sum[j];\n  return (65 + j);\n}\n\nvoid detect(struct info b[], char writter, int nn) {\n  int i, j;\n  for (i = 0; i < nn; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] == writter)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, c[26] = {0}, max = 0;\n  char b[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  struct book {\n    int num;\n    char man[26];\n  } a[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].man);\n  }\n  i = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].man[j] == b[k])\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n  i = 0;\n  j = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[t], max);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (a[j].man[k] == b[t])\n        printf(\"%d\\n\", a[j].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2329", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m = 0, num = 0, wnum = 0, max = 0, i = 0, j = 0;\n  int books[26][30];\n  char writer[26], name;\n  memset(books, 0, sizeof(books));\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s \", &num, writer);\n    wnum = strlen(writer);\n    for (j = 0; j < wnum; j++) {\n      books[writer[j] - 65][0]++;\n      books[writer[j] - 65][books[writer[j] - 65][0]] = num;\n    }\n  }\n  for (j = 0; j < 26; j++)\n    if (max < books[j][0]) {\n      max = books[j][0];\n      name = j + 65;\n    }\n  printf(\"%c\\n\", name);\n  cout << max << endl;\n  for (j = 1; j <= max; j++)\n    cout << books[name - 65][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint c[255];\n\nint main() {\n  int i, j, n;\n  char m = 0;\n  struct {\n    int id;\n    char s[255];\n  } a[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].s);\n    for (j = 0; a[i].s[j]; j++) {\n      if (++c[a[i].s[j]] > c[m])\n        m = a[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", m, c[m]);\n  for (i = 0; i < n; i++) {\n    if (strchr(a[i].s, m))\n      printf(\"%d\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2331", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, d, s;\n  int a, b = 0, c;\n  int tt[1000], pp[1000], miao[26] = {0};\n  char kk[1000][30];\n  char w;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &tt[i], kk[i]);\n  }\n  for (s = 0, j = 65; j <= 90; j++, s++) {\n    for (k = 0; k < m; k++) {\n      for (d = 0; kk[k][d] != '\\0'; d++) {\n        if (kk[k][d] == j) {\n          miao[s]++;\n        }\n      }\n    }\n  }\n  for (a = 0; a < 26; a++) {\n    if (miao[a] > b) {\n      b = miao[a];\n      c = a;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, b);\n  w = (c + 65);\n  for (i = 0; i < m; i++) {\n    for (j = 0; kk[i][j] != '\\0'; j++) {\n      if (kk[i][j] == w) {\n        printf(\"%d\\n\", tt[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int m, i, j, max;\n  int sum[26] = {0};\n  scanf(\"%d\", &m);\n  struct book b[m];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      sum[(b[i].name)[j] - 'A']++;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > sum[max])\n      max = i;\n  printf(\"%c\\n%d\\n\", max + 'A', sum[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if ((b[i].name)[j] == 65 + max)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(void) {\n  struct stu *p1, *p2, *head;\n  int m;\n  scanf(\"%d\", &m);\n  p1 = (struct stu *)malloc(1000);\n  cin >> p1->num >> p1->c;\n  p2 = p1;\n  head = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid print(struct stu *head, int z) {\n  struct stu *q;\n  int i, k;\n  char s[20], s0[20] = {'\\0'};\n  q = head;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++)\n      if (s[i] == z + 65) {\n        cout << q->num << \"\\n\";\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n}\n\nint main() {\n  int index;\n  int a[26], k, t, i, max = 0;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  head = create();\n  p = head;\n\n  while (p) {\n    strcpy(s, p->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++) {\n      t = s[i] - 65;\n      a[t]++;\n    }\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      index = i;\n    }\n  printf(\"%c\\n%d\\n\", index + 65, max);\n  print(head, index);\n}\n"}
{"label": "2", "index": "2334", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b = 0, max;\n  int let[26] = {0};\n  char a;\n  struct student {\n    int num;\n    char name[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, &book[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      let[book[i].name[j] - 'A']++;\n    }\n  }\n  max = let[0];\n  for (i = 0; i < 25; i++) {\n    if (let[i] > max) {\n      max = let[i];\n      b = i;\n    }\n  }\n  a = b + 'A';\n  printf(\"%c\\n%d\\n\", a, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      if (book[i].name[j] == a) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, sh[100], a[26] = {0}, b[26][100];\n  int max, t, m;\n  char ch[100][40] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &sh[i], ch[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < 40; j++) {\n      m = ch[i][j];\n      if (m > 64 && m < 91) {\n        a[m - 65]++;\n        b[m - 65][a[m - 65]] = sh[i];\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 65 + t);\n  cout << a[t] << \"\\n\";\n  for (i = 1; i <= a[t]; i++) {\n    printf(\"%d\\n\", b[t][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int name;\n  char writer[100];\n  struct book *next;\n};\n\nint a[26];\n\nstruct book *creat(int n) {\n  struct book *p1, *p2, *xhead;\n  p1 = (struct book *)malloc(1000);\n  cin >> p1->name >> p1->writer;\n  p2 = p1;\n  xhead = p1;\n\n  while (n - 1) {\n    n--;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->name, p1->writer);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nvoid find(struct book *head) {\n  struct book *p;\n  int i;\n  char s[100];\n  p = head;\n  while (p) {\n    i = 0;\n    strcpy(s, p->writer);\n    while (s[i] != '\u0000') {\n      a[s[i] - 'A']++;\n      i++;\n    }\n\n    p = p->next;\n  }\n}\n\nvoid print(struct book *head, int max) {\n  struct book *p;\n  p = head;\n  while (p) {\n    if (strchr(p->writer, max + 'A'))\n      cout << p->name << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  int i, max = 0, n;\n  struct book *head;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  find(head);\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[max])\n      max = i;\n  printf(\"%c \", max + 'A');\n  printf(\"%d \", a[max]);\n  print(head, max);\n  return 0;\n}\n"}
{"label": "2", "index": "2337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n} * p1, *p2;\n\nstruct book *creat(void) {\n  struct book *head;\n  int i;\n  head = 0;\n  p1 = 0;\n  p2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->name;\n    if (head == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct book *head, *p;\n  char a[27], *q, c;\n  int b[27], i, m, n1 = 0, max;\n  for (i = 1; i < 27; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  head = creat();\n  for (p = head; p != 0; p = p->next) {\n    for (q = p->name; *q != '\u0000'; q++) {\n      m = 0;\n      for (i = 1; i <= n1; i++)\n        if (*q == a[i]) {\n          m = 1;\n          b[i]++;\n          break;\n        }\n      if (m == 0) {\n        n1++;\n        a[n1] = *q;\n        b[n1] = 1;\n      }\n    }\n  }\n  max = b[1];\n  c = a[1];\n  for (i = 1; i <= n1 - 1; i++)\n    if (b[i] > max) {\n      c = a[i];\n      max = b[i];\n    }\n  cout << c << \" \";\n  printf(\"%d \", max);\n  for (p = head; p != 0; p = p->next) {\n    m = 0;\n    for (q = p->name; *q != '\u0000'; q++)\n      if (*q == c) {\n        m = 1;\n        break;\n      }\n    if (m)\n      printf(\"%d \", p->num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2338", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct books {\n  int num;\n  char name[100];\n  struct books *next;\n};\nstruct books *create(int n) {\n  struct books *head, *p1, *p2;\n  p1 = (struct books *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  while (--n) {\n    p1 = (struct books *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  int n, i, max, k;\n  char *p;\n  int num[26] = {0};\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  struct books *p1, *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    p = p1->name;\n    do {\n\n      if (*p == name[i]) {\n        num[i]++;\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        if (*p == '\u0000') {\n          p1 = p1->next;\n          p = p1->name;\n        } else {\n          p++;\n        }\n      }\n    } while (p1 != NULL);\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= max) {\n      k = i;\n      max = num[i];\n    }\n  }\n  printf(\"%c \", name[k]);\n  printf(\"%d \", num[k]);\n  p1 = head;\n  p = p1->name;\n  while (p1 != NULL) {\n\n    if (*p == name[k]) {\n      printf(\"%d \", p1->num);\n      p1 = p1->next;\n      p = p1->name;\n    } else {\n      if (*p == '\u0000') {\n        p1 = p1->next;\n        p = p1->name;\n      } else\n        p++;\n    }\n  }\n}\n"}
{"label": "2", "index": "2339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int shu;\n  char ppl[27];\n  int a[26][n + 1];\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    memset(ppl, 0, sizeof(ppl));\n    scanf(\"%d \", &shu);\n    getchar();\n    cin.getline(ppl, 27, '\\n');\n    for (int j = 0; 'A' <= ppl[j] && ppl[j] <= 'Z'; j++) {\n      a[(int)ppl[j] - (int)'A'][0]++;\n      a[(int)ppl[j] - (int)'A'][a[(int)ppl[j] - (int)'A'][0]] = shu;\n    }\n  }\n  int max = 0, set = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      set = i;\n    }\n  }\n  cout << (char)((int)'A' + set) << endl;\n  cout << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << a[set][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "2340", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  char num[20];\n  char aut[20];\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->aut);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->aut;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nvoid print(struct book *head) {\n  struct book *p;\n  int *tem, i, k;\n  char *q, max, c;\n  tem = (int *)malloc(30 * sizeof(int));\n  for (i = 0; i < 30; i++) {\n    *(tem + i) = 0;\n  }\n  for (p = head; p; p = p->next) {\n    q = p->aut;\n    for (i = 0; *(q + i) != '\u0000'; i++) {\n      c = *(q + i) - 'A';\n      *(tem + c) += 1;\n    }\n  }\n  max = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (*(tem + i) > max) {\n      max = *(tem + i);\n      k = i;\n    }\n  }\n  c = k + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p; p = p->next) {\n    for (q = p->aut, i = 0; *(q + i) != '\u0000'; i++) {\n      if (*(q + i) == c) {\n        break;\n      }\n    }\n    if (*(q + i) != '\u0000') {\n      printf(\"%s \", p->num);\n    }\n  }\n}\nint main() {\n  struct book *head;\n  cin >> m;\n  head = creat();\n  print(head);\n  return 0;\n}\n"}
{"label": "2", "index": "2341", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  char wri[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26];\n  char tem[100];\n  int j = 0, k;\n  int shu[26][100];\n  int hao;\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> hao >> tem;\n    j = 0;\n    while (tem[j] != '\\0') {\n      for (k = 0; k <= 25; k++) {\n        if (wri[k] == tem[j]) {\n          shu[k][num[k]] = hao;\n          num[k]++;\n        }\n      }\n      j++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", wri[max], num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", shu[max][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char auth[26];\n  struct book *next;\n};\nstruct book *creat(int m) {\n  int i = 0;\n  struct book *head, *p1, *p2;\n  if (i == 0) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->auth);\n    head = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  }\n  while (i < m) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->auth);\n    p2->next = p1;\n    p1->next = NULL;\n    p2 = p1;\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  int m, i, lenth;\n  int max = 0, maxwh = 27;\n  int count[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++)\n      count[(int)(p->auth)[i] - 65]++;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      maxwh = i;\n    }\n  }\n  printf(\"%c\\n\", maxwh + 65);\n  printf(\"%d\\n\", max);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++) {\n      if ((int)(p->auth[i]) == maxwh + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2343", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, count[30] = {0}, num[30][1000] = {0};\n  scanf(\"%d \", &n);\n  while (n--) {\n    int no;\n    char c;\n    cin >> no;\n    cin.get();\n    while ((c = cin.get()) != '\\n')\n      num[c - 'A'][count[c - 'A']++] = no;\n  }\n  int max = count[0], set = 0;\n  for (int i = 1; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      set = i;\n    }\n  }\n  cout << (char)(set + 'A') << endl << max << endl;\n  for (int i = 0; i < max; i++) {\n    printf(\"%d\\n\", num[set][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct {\n  char name[20];\n  int num;\n} book[1000];\n\nint main() {\n  int n, i, j, max = 0, m = 0;\n  scanf(\"%d\", &n);\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      strchr(book[i].name, 'A' + j) ? c[j]++ : 0;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (c[j] > max) {\n      max = c[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + m, c[m]);\n  for (i = 0; i < n; i++) {\n    strchr(book[i].name, 'A' + m) ? printf(\"%d\\n\", book[i].num) : 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2345", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint m;\nstruct book *head;\n\nstruct book *setup() {\n  int t = 0;\n  struct book *head, *p1, *p2;\n  head = p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (t < m - 1) {\n    t++;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint k = 0, max_1 = 0;\nvoid found(struct book *p) {\n  int i, j;\n  p = head;\n  int *pi;\n  pi = (int *)malloc(sizeof(int) * 26);\n  for (i = 0; i < 26; i++)\n    *(pi + i) = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++) {\n      (*(pi + (p->name[j] - 'A')))++;\n    }\n    p = p->next;\n  }\n  for (j = 0; j < 26; j++) {\n    if (*(pi + j) > max_1) {\n      max_1 = *(pi + j);\n      k = j;\n    }\n  }\n}\nint main() {\n  int i, j;\n  scanf(\"%d\", &m);\n  struct book *p;\n  head = p = setup();\n  found(p);\n  printf(\"%c %d \", (k + 'A'), max_1);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      if (p->name[j] == k + 'A') {\n        printf(\"%d \", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2346", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct s {\n    int N;\n    char w[26];\n  };\n  struct s s[999];\n  int n, i, j, c, a[26];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &s[i].N);\n\n    cin >> s[i].w;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++) {\n      c = s[i].w[j];\n      a[c - 65]++;\n    }\n  }\n  c = 0;\n  for (i = 0; i <= 25; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  printf(\"%c %d \", c + 65, a[c]);\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++)\n      if (s[i].w[j] == (c + 65)) {\n        printf(\"%d \", s[i].N);\n      }\n  }\n}\n"}
{"label": "2", "index": "2347", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct x {\n    int num;\n    char name[26];\n  } book[1000];\n  int i, j, m, n, k, ex;\n  int a[26][1000];\n  int count[26] = {0},\n      num[26] = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n                 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      ex = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = ex;\n      ex = num[i];\n      num[i] = num[i + 1];\n      num[i + 1] = ex;\n    }\n  }\n  printf(\"%c %d \", num[25], count[25]);\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == num[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int No;\n    char name[27];\n  } b[1000];\n  int i, j, m;\n  scanf(\"%d\", &m);\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i].No);\n    scanf(\"%s\", b[i].name);\n  }\n  int n, l, a[26] = {0};\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      n = b[i].name[j];\n      a[n - 65]++;\n    }\n  }\n  int max = 0, x;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  printf(\"%c\\n%d\", x + 65, max);\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      if (b[i].name[j] == x + 65) {\n        printf(\"\\n%d\", b[i].No);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char name[27];\n  int anum;\n  int num;\n  struct student *next;\n};\nint n;\nint i;\nchar c;\n\nstruct student *creat() {\n  struct student *head;\n  head = (struct student *)malloc(1000);\n  if (n == 0)\n    head = NULL;\n  else {\n    cin >> head->num;\n    for (i = 0; (c = getchar()) != ' '; i++) {\n      head->name[i] = c;\n    }\n    head->anum = i;\n    head->next = NULL;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2, *p;\n  char l[200] = {0};\n  int j;\n  int max = 0;\n  int lmax;\n\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    {\n      p1 = (struct student *)malloc(1000);\n      p2->next = p1;\n      p2 = p1;\n\n      scanf(\"%d\", &p2->num);\n      for (j = 0; (c = getchar()) != ' '; j++) {\n        p2->name[j] = c;\n      }\n      p2->anum = j;\n\n      p2->next = NULL;\n    }\n  }\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      l[p->name[i]] = l[p->name[i]] + 1;\n    }\n    p = p->next;\n  }\n\n  for (i = 65; i <= 90; i++) {\n    if (l[i] > max) {\n      max = l[i];\n      lmax = i;\n    }\n  }\n  printf(\"%c %d \", lmax, max);\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      if (p->name[i] == lmax)\n        cout << p->num << \" \";\n    }\n    p = p->next;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char id;\n  int count;\n  int books[1000];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct author *pa = (const struct author *)a;\n  const struct author *pb = (const struct author *)b;\n  return pb->count - pa->count;\n}\n\nint main() {\n  int i, j, num, id, len, idx;\n  struct author authors[26];\n\n  char buffer[26];\n  for (i = 0; i < 26; ++i) {\n    authors[i].id = 'A' + i;\n    authors[i].count = 0;\n  }\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %s\", &id, buffer);\n    len = strlen(buffer);\n    for (j = 0; j < len; ++j) {\n      idx = buffer[j] - 'A';\n      authors[idx].books[authors[idx].count] = id;\n      authors[idx].count++;\n    }\n  }\n  qsort(authors, 26, sizeof(struct author), cmp);\n  printf(\"%c\\n\", authors[0].id);\n  cout << authors[0].count << \"\\n\";\n  for (i = 0; i < authors[0].count; ++i)\n    printf(\"%d\\n\", authors[0].books[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n};\n\nint main() {\n  int i, j, k, m, x, a = 0;\n  int count[26] = {0};\n  char y;\n  struct book all[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &all[i].num, &all[i].aut);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] >= 'A' && all[i].aut[j] <= 'Z') {\n        x = (int)(all[i].aut[j] - 'A');\n        count[x]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > a) {\n      a = count[i];\n      k = i;\n    }\n  }\n  y = k + 'A';\n  printf(\"%c\\n%d\\n\", y, a);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] == y) {\n        printf(\"%d\\n\", all[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n} b[1001];\nint main() {\n  int n, i, j, k, d, g[27], e = 0, f = 0, l;\n  char m, h;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  m = 'A';\n  for (k = 0; k < 26; k++) {\n    d = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < 26; j++) {\n        if (b[i].name[j] == m)\n          d++;\n        if (b[i].name[j] == '\\0')\n          break;\n      }\n    }\n    m = m + 1;\n    g[k] = d;\n    if (g[k] > e) {\n      e = g[k];\n      f = k;\n    }\n  }\n  h = 'A' + f;\n  printf(\"%c\\n%d\\n\", h, e);\n  for (i = 0; i < n; i++) {\n    d = 0;\n    for (j = 0; j < 26; j++) {\n      if (b[i].name[j] == h)\n        d++;\n      if (b[i].name[j] == '\\0')\n        break;\n    }\n    if (d != 0) {\n      printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[27];\n  } b[1000];\n  int m, i, j, a = 0;\n  int c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      c[*(b[i].name + j) - 'A']++;\n  }\n  for (i = 0; i < 26; i++)\n    a = c[i] > c[a] ? i : a;\n  printf(\"%d\\n\", a + 'A');\n  printf(\"%d\\n\", c[a]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (*(b[i].name + j) == ('A' + a))\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, b[1000], p[26];\n  char *bm[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    p[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n    bm[i] = (char *)malloc(26 * sizeof(char));\n    scanf(\"%s\", bm[i]);\n    for (j = 0; j < strlen(bm[i]); j++) {\n      p[(int)(*(bm[i] + j) - 'A')]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[max])\n      max = i;\n  }\n  printf(\"%c\\n\", (char)('A' + max));\n  printf(\"%d\\n\", p[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(bm[i]); j++) {\n      if (bm[i][j] == (char)('A' + max)) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 1;\n}\n"}
{"label": "2", "index": "2355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Book_num(char a[]) {\n  int j, num;\n  j = 1;\n  if ((j = 1) && a[j] == ' ') {\n    num = a[0] - 48;\n  } else\n    j++;\n  if ((j = 2) && a[j] == ' ') {\n    num = a[1] - 48 + (a[0] - 48) * 10;\n  } else {\n    j++;\n  }\n  if ((j = 3) && a[j] == ' ') {\n    num = a[2] - 48 + (a[1] - 48) * 10 + (a[0] - 48) * 100;\n  }\n  return num;\n}\n\nint main() {\n  int m, bk1, i, max, j, wrt;\n  int author[26][999] = {0};\n  char data[999][30];\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++) {\n\n    cin >> data[i];\n    data[i][strlen(data[i])] = '\\0';\n  }\n  max = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; data[i][j] != '\\0'; j++) {\n      if (data[i][j] > 64) {\n        wrt = data[i][j] - 65;\n        for (bk1 = 0; author[wrt][bk1] != 0; bk1++) {\n          ;\n        }\n        author[wrt][bk1] = Book_num(data[i]);\n        if (bk1 > max) {\n          max = bk1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i][max] != 0) {\n      printf(\"%c\\n\", i + 65);\n      cout << max + 1 << \"\\n\";\n      for (j = 0; j <= max; j++) {\n        printf(\"%d\\n\", author[i][j]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2356", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct author {\n    char nm;\n    int bk[999];\n    int count;\n  };\n  struct author a[26];\n  struct author max;\n  struct book {\n    char at[26];\n    int no;\n  };\n  struct book b;\n  int i, j, n, m, k, flag;\n  for (i = 0; i < 26; i++) {\n    a[i].count = 0;\n    a[i].nm = 65 + i;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b.no >> b.at;\n    m = strlen(b.at);\n    flag = 0;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b.at[j] == a[k].nm) {\n          a[k].bk[a[k].count] = b.no;\n          a[k].count++;\n          flag++;\n          break;\n        }\n      }\n      if (flag == m) {\n        break;\n      }\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i].count > max.count) {\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", max.nm, max.count);\n  for (i = 0; i < max.count; i++) {\n    printf(\"%d\\n\", max.bk[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int a;\n    char b[20];\n  } book[999];\n  int n, i, k, max, m, j, p;\n  int c[999] = {0};\n  char str1[20], str2[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].a, &book[i].b);\n    m = strlen(book[i].b);\n    strcpy(str1, book[i].b);\n    for (j = 0; j < m; j++)\n      c[str1[j]] = c[str1[j]] + 1;\n  }\n  max = 0;\n  for (p = 65; p < 91; p++) {\n    if (c[p] > max) {\n      max = c[p];\n      k = p;\n    }\n  }\n  printf(\"%d\\n\", k);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    strcpy(str2, book[i].b);\n    m = strlen(book[i].b);\n    for (j = 0; j < m; j++) {\n      if (str2[j] == k) {\n        printf(\"%d\\n\", book[i].a);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0;\n  int zuozhe[26] = {0};\n  char maxer;\n  struct book {\n    int num;\n    char author[26];\n  } shu[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n    for (j = 0; j < 26; j++)\n      zuozhe[shu[i].author[j] - 65]++;\n  }\n  for (j = 0; j < 26; j++)\n    if (zuozhe[j] > max) {\n      max = zuozhe[j];\n      maxer = j + 65;\n    }\n  printf(\"%c\\n%d\\n\", maxer, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (shu[i].author[j] == maxer) {\n        cout << shu[i].num << \"\\n\";\n        continue;\n      }\n}\n"}
{"label": "2", "index": "2359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  int a;\n  char name[26];\n};\nint main() {\n  struct people pl[1000];\n  int i, j, k, l = 0, n, s, m, max, x[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &pl[i].a, pl[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(pl[i].name);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++)\n        if (k == pl[i].name[j] - 'A') {\n          x[k]++;\n          break;\n        }\n  }\n  max = x[0];\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max) {\n      printf(\"%c\\n\", 'A' + i);\n      s = i;\n      printf(\"%d\\n\", x[i]);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (pl[i].name[j] == 'A' + s) {\n        cout << pl[i].a << \"\\n\";\n        break;\n      }\n}\n"}
{"label": "2", "index": "2360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p;\n  p = (int *)malloc(26 * sizeof(int));\n  struct book {\n    int num;\n    char s[26];\n  } b[999];\n  int n, i, j, ss, max = 0, r;\n  char x;\n  for (ss = 0; ss < 26; ss++)\n    *(p + ss) = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].s);\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      *(p + ((int)b[i].s[j] - 65)) += 1;\n    }\n  }\n  for (r = 0; r < 26; r++)\n    max = max > *(p + r) ? max : *(p + r);\n  for (r = 0; r < 26; r++) {\n    if (*(p + r) == max) {\n      printf(\"%c\", (65 + r));\n      x = r;\n      printf(\"\\n\");\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      if ((int)b[i].s[j] - 65 == x)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int no;\n  char wr[26];\n} book[999];\nstruct {\n  char name;\n  int num;\n  int book[999];\n} a[26];\n\nint main() {\n  int n, m, t, k, d;\n  int all = 0;\n  for (t = 0; t < 26; t++) {\n    a[t].name = 'A' + t;\n    a[t].num = 0;\n  }\n  scanf(\"%d\", &m);\n  for (t = 0; t < m; t++) {\n    scanf(\"%d %s\", &book[t].no, book[t].wr);\n  }\n\n  for (t = 0; t < m; t++) {\n    k = strlen(book[t].wr);\n    for (n = 0; n < k; n++) {\n      for (d = 0; d < 26; d++) {\n        if (a[d].name == book[t].wr[n]) {\n          a[d].book[a[d].num] = book[t].no;\n          a[d].num++;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n\n  for (t = 0; t < 26; t++) {\n    if (k < a[t].num)\n      k = a[t].num;\n  }\n\n  for (t = 0;; t++) {\n    if (k == a[t].num) {\n      printf(\"%c\", a[t].name);\n      printf(\"\\n%d\", a[t].num);\n      for (d = 0; d < a[t].num; d++)\n        printf(\"\\n%d\", a[t].book[d]);\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2362", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, g[26] = {0}, s[26][1000] = {0};\n  char a[50];\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < 50; i++)\n      a[i] = 0;\n    scanf(\"%d%s\", &l, a);\n    for (i = 0; i < 26; i++)\n      for (j = 0; j < 26; j++)\n        if (a[i] == 'A' + j) {\n          s[j][g[j]] = l, g[j]++;\n          break;\n        }\n  }\n  m = 0;\n  for (i = 0; i < 26; i++)\n    if (g[i] > m)\n      m = g[i], k = i;\n  printf(\"%c\\n%d\\n\", 'A' + k, m);\n  for (i = 0; i < m; i++)\n    printf(\"%d\\n\", s[k][i]);\n}\n"}
{"label": "2", "index": "2363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num = 0, n, a[26], name[1000], name2[1000], i, j, k, max = 0, maxi = 0;\n  char wr[1000][27];\n  char q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &(name[i]), wr[i]);\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (wr[i][j] == 'A' + k)\n          a[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxi = i;\n    }\n  }\n  q = 'A' + maxi;\n  printf(\"%c\\n\", q);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (wr[i][j] == q) {\n        name2[num] = name[i];\n        num++;\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", name2[i]);\n}\n"}
{"label": "2", "index": "2364", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct st {\n  int a;\n  char s[26];\n  struct st *n;\n};\nstruct st *creat(int m) {\n  int i;\n  struct st *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->n = p1;\n    scanf(\"%d %s\", &p1->a, p1->s);\n    p2 = p1;\n  }\n  p1->n = NULL;\n  return (head);\n}\nint main() {\n  int m;\n  struct st *creat(int m);\n  scanf(\"%d\", &m);\n  struct st *p, *q;\n  p = creat(m);\n  q = p;\n  int i, j, k;\n  int a[26] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (k = strlen(p->s)); j++)\n      a[p->s[j] - 65]++;\n    p = p->n;\n  }\n  p = q;\n  int max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  char c;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      c = i + 65;\n      printf(\"%c %d \", c, a[i]);\n      break;\n    }\n  }\n  char cc;\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      cc = q->s[j];\n      if (cc == '\u0000')\n        break;\n      if (c == cc)\n        printf(\"%d \", q->a);\n    }\n    q = q->n;\n  }\n}\n"}
{"label": "2", "index": "2365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct worker {\n  int name;\n  char au[20];\n  struct worker *next;\n};\nstruct help {\n  char author;\n  int max;\n};\nstruct worker *creat(int m) {\n  struct worker *p1, *p2, *p;\n  int i;\n  p1 = p2 = (struct worker *)malloc(sizeof(struct worker));\n\n  scanf(\"%d %s\", &p1->name, p1->au);\n  p = p1;\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p1->name, p1->au);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return p;\n}\nvoid print(struct worker *p) {\n  struct worker *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    cout << p1->name << \" \" << p1->au << \"\\n\";\n    p1 = p1->next;\n  }\n}\nvoid most(struct worker *p) {\n  struct worker *p1, *p2;\n  int a[30] = {0}, i, max;\n  char author;\n  struct help t;\n  p1 = p;\n  p2 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      a[*(p1->au + i) - 65] = a[*(p1->au + i) - 65] + 1;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max)\n      author = i + 65;\n  }\n  cout << author << \"\\n\" << max << \"\\n\";\n  p1 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      if (*(p1->au + i) == author)\n        printf(\"%d\\n\", p1->name);\n    }\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct worker *p1, *p;\n  struct help t;\n  int m;\n  char c;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  p1 = p;\n\n  most(p1);\n}\n"}
{"label": "2", "index": "2366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int bianhao;\n  char name[26];\n} shu[999];\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k;\n  int jishu[26] = {0};\n  int beiyong[26];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &shu[i].bianhao, shu[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (shu[j].name[k] == i + 'A')\n          jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    beiyong[i] = jishu[i];\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (beiyong[i] > max)\n      max = beiyong[i];\n  }\n  int t;\n  for (i = 0; i < 26; i++) {\n    if (jishu[i] == max)\n      t = i;\n  }\n  cout << t + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].name[j] == t + 'A')\n        printf(\"%d\\n\", shu[i].bianhao);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct writer {\n    int num;\n    char name[20];\n    struct writer *next;\n  };\n  int i, j, k, l, m, z[26] = {0}, max, n;\n  struct writer *p1, *p2, *p, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct writer *)malloc(sizeof(struct writer));\n  scanf(\"%d %s\", &p1->num, &p1->name);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct writer *)malloc(sizeof(struct writer));\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < 26; i++) \n  {\n    p = head;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 20; k++) {\n        if (p->name[k] == (char)(i + 65)) {\n          z[i]++;\n        }\n      }\n      p = p->next;\n    }\n  }\n  max = z[0];\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < z[i]) {\n      max = z[i];\n      j = i; \n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + j, max); \n  p = head;\n  for (i = 0; i < n; i++) \n  {\n    for (k = 0; k < 20; k++) {\n      if (p->name[k] == (char)(65 + j)) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, p, j, t, q;\nint SAVER[1500];\nchar R[1500][50];\nint RR[50];\n\nint main() {\n  cin >> n;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> SAVER[i];\n    cin.get();\n    cin >> R[i];\n    j = 0;\n    while (R[i][j] != '\\0') {\n      RR[R[i][j] - 'A']++;\n      j++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (RR[i - 'A'] > t) {\n      t = RR[i - 'A'];\n      q = i;\n    }\n  cout << (char)q << endl << t << endl;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    while (R[i][j] != '\\0') {\n      if (R[i][j] == q)\n        printf(\"%d\\n\", SAVER[i]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2369", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char author[26];\n};\n\nchar maxbook(int a[]) {\n  int i, j, bookmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (bookmax < a[i]) {\n      bookmax = a[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + j, bookmax);\n  return 'A' + j;\n}\n\nint contain(char author[], char max) {\n  char *c = author;\n  while (*c) {\n    if (*c == max)\n      return 1;\n    c++;\n  }\n  return 0;\n}\n\nint main() {\n  struct BOOK book[1000];\n  int m, i, j;\n  char c, max;\n  int AtoZ[26] = {0};\n\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n    getchar();\n    j = 0;\n    while ((c = getchar()) != '\\n') {\n      book[i].author[j] = c;\n      AtoZ[c - 'A']++;\n      j++;\n    }\n    book[i].author[j] = '\\0';\n  }\n  max = maxbook(AtoZ);\n\n  for (i = 0; i < m; i++) {\n    if (contain(book[i].author, max))\n      printf(\"%d\\n\", book[i].num);\n  }\n}\n"}
{"label": "2", "index": "2370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int co;\n  char A[26];\n};\n\nint main() {\n  int m, i, k, max;\n  int count[26];\n  int *cc;\n  scanf(\"%d\", &m);\n  struct book *bk = (struct book *)malloc(sizeof(struct book) * m);\n  struct book *p;\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d %s\", &(p->co), p->A);\n  }\n  cc = count;\n  memset(count, 0, sizeof(count));\n  for (i = 0; i < 26; i++, cc++) {\n    p = bk;\n    for (k = 0; k < m; k++, p++) {\n      if (strchr(p->A, 'A' + i)) {\n        (*cc)++;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > count[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max, count[max]);\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    if (strchr(p->A, 'A' + max)) {\n      printf(\"%d\\n\", p->co);\n    }\n  }\n  free(bk);\n  return 0;\n}\n"}
{"label": "2", "index": "2371", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  int book[1020];\n  scanf(\"%d\", &m);\n  int i;\n  char c;\n  int a[27] = {0};\n  int b[27][1000] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &book[i]);\n    getchar();\n    for (;;) {\n      cin >> c;\n      if (c == '\\n')\n        break;\n      a[c - 64] += 1;\n      b[c - 64][i] = 1;\n    }\n  }\n  int max = 0, p;\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", p + 64, max);\n  for (i = 0; i < 1000; i++) {\n    if (b[p][i] == 1)\n      printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef char q[30];\nvoid init(int a[], int f[], q *p[1000], int m) {\n  int i;\n\n  char *pp;\n  int r;\n  for (i = 1; i <= m; i++) {\n    p[i] = (q *)malloc(sizeof(q));\n\n    scanf(\"%d%s\", &f[i], p[i]);\n    getchar();\n    pp = *p[i];\n    while (*pp != '\u0000') {\n      a[*pp]++;\n      pp++;\n    }\n  }\n}\nchar pro(int a[]) {\n  char c, max, g;\n  max = -333;\n  for (c = 'A'; c <= 'Z'; c++)\n\n    if (a[c] > max) {\n      max = a[c];\n      g = c;\n    }\n  return g;\n}\nvoid print(int f[], q *p[1000], int m, char c) {\n  int i;\n  for (i = 1; i <= m; i++)\n    if (strchr(*p[i], c) != NULL)\n      cout << f[i] << \" \";\n}\nint main() {\n  int m, k;\n  int a[343] = {0};\n  int f[1000];\n  q *p[1000];\n  char max;\n\n  cin >> m;\n\n  init(a, f, p, m);\n  max = pro(a);\n  printf(\"%c %d \", max, a[max]);\n\n  print(f, p, m, max);\n}\n"}
{"label": "2", "index": "2373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char zhuzhe[26];\n  int let;\n};\n\nstruct book shu[1000];\n\nint judge(char a, char b) {\n  if (a == b)\n    return (1);\n  else\n    return (0);\n}\n\nint main() {\n  int n, i, j, y, zhi, num;\n  char writer1[26] = {0};\n  char writer2[26] = {0};\n\n  for (i = 0; i < 26; i++)\n    writer2[i] = i + 65;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shu[i].num);\n\n    cin >> shu[i].zhuzhe;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      for (y = 0; y < 26; y++)\n        if (writer2[y] == shu[i].zhuzhe[j])\n          writer1[y] = writer1[y] + 1;\n  zhi = 0;\n  num = 0;\n  for (i = 0; i < 26; i++)\n    if (writer1[i] > zhi) {\n      zhi = writer1[i];\n      num = i;\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      if (judge(shu[i].zhuzhe[j], writer2[num]) == 1)\n        shu[i].let = 1;\n\n  printf(\"%c \", writer2[num]);\n  printf(\"%d \", writer1[num]);\n  for (i = 0; i < n - 1; i++)\n    if (shu[i].let == 1)\n      printf(\"%d \", shu[i].num);\n  if (shu[n - 1].let == 1)\n    printf(\"%d\", shu[n - 1].num);\n}\n"}
{"label": "2", "index": "2374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, no[1000], shu[26] = {0}, max = 0;\n  char s[1000][20], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &no[i], s[i]);\n    for (j = 0; j < strlen(s[i]); j++) {\n      shu[s[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++) {\n    if (strchr(s[i], c)) {\n      printf(\"%d\\n\", no[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2375", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, n, max, l, y = 0;\n  struct book {\n    int num;\n    char aut[26];\n  } book[1000];\n  int a[26] = {0};\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'z'};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].num >> book[i].aut;\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      l = strlen(book[j].aut);\n      for (k = 0; k < l; k++) {\n        if (book[j].aut[k] == b[i]) {\n          a[i]++;\n        }\n      }\n    }\n  }\n\n  for (i = m; i > 0; i--) {\n    for (j = 0; j < 26; j++) {\n      if (a[j] == i) {\n        max = a[j];\n        n = j;\n        printf(\"%c\\n\", b[j]);\n        printf(\"%d\\n\", a[j]);\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    l = strlen(book[i].aut);\n    for (j = 0; j < l; j++) {\n      if (book[i].aut[j] == b[n]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct s {\n    int N;\n    char w[26];\n  };\n  struct s s[999];\n  int n, i, j, c, a[26];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &s[i].N);\n\n    cin >> s[i].w;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++) {\n      c = s[i].w[j];\n      a[c - 65]++;\n    }\n  }\n  c = 0;\n  for (i = 0; i <= 25; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  printf(\"%c %d \", c + 65, a[c]);\n  for (i = 0; i <= (n - 1); i++) {\n    for (j = 0; j <= 25; j++)\n      if (s[i].w[j] == (c + 65))\n        printf(\"%d \", s[i].N);\n  }\n}\n"}
{"label": "2", "index": "2377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint alpha[26] = {0};\nstruct library {\n  int num;\n  char authors[27];\n} books[999];\nvoid addauthor(char string[]) {\n  int i = 0;\n  do {\n    alpha[string[i] - 'A']++;\n    i++;\n  } while (string[i] != '\\0');\n}\nvoid hewroteit(struct library book, int maxalpha) {\n  int i;\n  for (i = 0; book.authors[i] != '\\0'; i++) {\n    if (book.authors[i] - 'A' == maxalpha) {\n      printf(\"%d\\n\", book.num);\n      break;\n    }\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &books[i].num, books[i].authors);\n  for (i = 0; i < m; i++)\n    addauthor(books[i].authors);\n  int max = 0, maxalpha = 0;\n  for (i = 0; i < 26; i++) {\n    if (alpha[i] > max) {\n      max = alpha[i];\n      maxalpha = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxalpha, max);\n  for (i = 0; i < m; i++)\n    hewroteit(books[i], maxalpha);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct {\n    int num;\n    char author[26];\n  } book[1000];\n  int shu_num[26], i, j, k, n, max, length;\n  char max_author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  for (k = 0; k < 26; k++) {\n    shu_num[k] = 0;\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      length = strlen(book[i].author);\n      for (j = 0; j < length; j++) {\n        if (book[i].author[j] == 'A' + k) {\n          shu_num[k]++;\n        }\n      }\n    }\n  }\n  max = shu_num[0];\n  max_author = 'A';\n  for (k = 0; k < 26; k++) {\n    if (shu_num[k] > max) {\n      max = shu_num[k];\n      max_author = 'A' + k;\n    }\n  }\n  cout << max_author << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      if (book[i].author[j] == max_author) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2379", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2380", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  int number;\n  char name[26];\n} author[999];\n\nstruct single {\n\n  char letter[1];\n  int number;\n\n} single[26];\n\nint main(char *argv[]) {\n  int n, i, m, j, p, k, book[999];\n  for (i = 0; i < 26; i++) {\n    single[i].letter[0] = 65 + i;\n    single[i].number = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &author[i].number, &author[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (single[k].letter[0] == author[i].name[j])\n          single[k].number++;\n      }\n    }\n  }\n  m = 0;\n  p = single[0].number;\n  for (i = 1; i < 26; i++) {\n    if (p < single[i].number) {\n      p = single[i].number;\n      m = i;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (author[i].name[j] == single[m].letter[0]) {\n        book[k] = author[i].number;\n        k++;\n      }\n    }\n  }\n  printf(\"%c\\n\", single[m].letter[0]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t[26] = {0}, k = 0, max, h;\n  scanf(\"%d\", &n);\n\n  struct book {\n    int a;\n    char b[26];\n  } book[100] = {0, \"\"};\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].a, book[i].b);\n  }\n\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      t[book[i].b[j] - 65]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    \n    if (t[i] > max) {\n      max = t[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", h + 65, max);\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      if (book[i].b[j] == h + 65)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "2382", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, name[26] = {0}, max, a[1000], t = 0;\n  char word[1000][30];\n  scanf(\"%d\", &n);\n  for (i = -1; i < n; i++) {\n\n    cin >> word[i];\n  }\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      while (word[i][k] != '\u0000') {\n        if (word[i][k] == 'A' + j)\n          name[j] = name[j] + 1;\n\n        k = k + 1;\n      }\n      k = 0;\n    }\n  }\n  k = 0;\n  max = name[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      j = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (word[i][k] != '\u0000') {\n      if (word[i][k] == 'A' + j) {\n\n        a[t] = i;\n        t = t + 1;\n        k = 0;\n        break;\n      }\n      k = k + 1;\n    }\n    k = 0;\n  }\n  printf(\"%c %d \", 'A' + j, max);\n  k = 0;\n  for (i = 0; i < t; i++) {\n    while (word[a[i]][k] != ' ') {\n      printf(\"%c\", word[a[i]][k]);\n      k = k + 1;\n    }\n    printf(\" \");\n    k = 0;\n  }\n}\n"}
{"label": "2", "index": "2383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p = 0;\n  int m, i, j, max[1000];\n  struct book {\n    int num;\n    char s[27];\n  } book[1000];\n  memset(max, 0, sizeof(max));\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].s);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].s[j]; j++) {\n      if (++max[book[i].s[j]] > max[p])\n        p = book[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", p, max[p]);\n  for (i = 0; i < m; i++) {\n    if (strchr(book[i].s, p))\n      printf(\"%d\\n\", book[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[26] = {0};\n  char c;\n  struct books {\n    int number;\n    char name[27];\n  };\n  struct books book[1000];\n  int n, i, j, t, max = 0;\n  struct books *p;\n  scanf(\"%d\", &n);\n  for (p = book; p < book + n; p++)\n    scanf(\"%d%s\", &p->number, p->name);\n  for (p = book; p < book + n; p++)\n    for (j = 0; j < 26; j++)\n      for (i = 65; i <= 90; i++)\n        if (p->name[j] == i)\n          x[i - 65]++;\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max)\n      break;\n  c = i + 65;\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (book[i].name[j] == c) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct author {\n    char nm;\n    int bk[999];\n    int count;\n  };\n  struct author a[26];\n  struct author max;\n  struct book {\n    char at[26];\n    int no;\n  };\n  struct book b;\n  int i, j, n, m, k, flag;\n  for (i = 0; i < 26; i++) {\n    a[i].count = 0;\n    a[i].nm = 65 + i;\n  }\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b.no, b.at);\n    m = strlen(b.at);\n    flag = 0;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b.at[j] == a[k].nm) {\n          a[k].bk[a[k].count] = b.no;\n          a[k].count++;\n          flag++;\n          break;\n        }\n      }\n      if (flag == m)\n        break;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i].count > max.count) {\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", max.nm, max.count);\n  for (i = 0; i < max.count; i++) {\n    cout << max.bk[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1000] = {0}, b[1000] = {0}, c[100] = {0}, l = 0;\n  char s[1000][100] = {0}, m[26] = {0}, p;\n  int i = 0, j = 0, k = 0, t = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    m[j] = i;\n    for (t = 0; t < n; t++) {\n      for (k = 0; s[t][k] != '\\0'; k++) {\n        if (s[t][k] == m[j]) {\n          c[j]++;\n          break;\n        }\n      }\n    }\n    j++;\n  }\n  l = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > l) {\n      l = c[i];\n      p = m[i];\n    }\n  }\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", l);\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; s[i][j] != '\\0'; j++) {\n      if (s[i][j] == p) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 1) {\n      printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int n;\n  struct book *next;\n};\nstruct au {\n  char n;\n  int s;\n  struct book *p;\n};\nint main() {\n  int i, j, k, l, m, n, *p, a[100][1100] = {0}, max = 0, b[100] = {0};\n  char s[30];\n  scanf(\"%d\", &n);\n  for (l = 1; l <= n; l++) {\n    scanf(\"%d\", &j);\n    scanf(\"%s\", s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      b[s[i]]++;\n      a[s[i]][b[s[i]]] = j;\n      if (b[s[i]] > b[max])\n        max = s[i];\n    }\n  }\n  printf(\"%c\\n\", (char)max);\n  printf(\"%d\\n\", b[max]);\n  for (i = 1; i <= b[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n}\n"}
{"label": "2", "index": "2388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[999][3][27];\n  int m, i, j, k, Nn[27], ctrl;\n\n  cin >> m;\n  for (k = 1; k <= m; k++) {\n    scanf(\"%s\", s[k][1]);\n    scanf(\"%s\", s[k][2]);\n  }\n\n  for (i = 1; i <= 26; i++)\n    Nn[i] = 0;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; s[i][2][j] != '\\0'; j++) {\n      if (s[i][2][j] == 'A')\n        Nn[1]++;\n      else if (s[i][2][j] == 'B')\n        Nn[2]++;\n      else if (s[i][2][j] == 'C')\n        Nn[3]++;\n      else if (s[i][2][j] == 'D')\n        Nn[4]++;\n      else if (s[i][2][j] == 'E')\n        Nn[5]++;\n\n      else {\n        if (s[i][2][j] == 'F')\n          Nn[6]++;\n        else if (s[i][2][j] == 'G')\n          Nn[7]++;\n        else if (s[i][2][j] == 'H')\n          Nn[8]++;\n        else if (s[i][2][j] == 'I')\n          Nn[9]++;\n\n        else if (s[i][2][j] == 'J')\n          Nn[10]++;\n        else if (s[i][2][j] == 'K')\n          Nn[11]++;\n        else if (s[i][2][j] == 'L')\n          Nn[12]++;\n        else if (s[i][2][j] == 'M')\n          Nn[13]++;\n\n        else if (s[i][2][j] == 'N')\n          Nn[14]++;\n        else if (s[i][2][j] == 'O')\n          Nn[15]++;\n        else if (s[i][2][j] == 'P')\n          Nn[16]++;\n        else if (s[i][2][j] == 'Q')\n          Nn[17]++;\n\n        else if (s[i][2][j] == 'R')\n          Nn[18]++;\n        else if (s[i][2][j] == 'S')\n          Nn[19]++;\n\n        else if (s[i][2][j] == 'T')\n          Nn[20]++;\n        else if (s[i][2][j] == 'U')\n          Nn[21]++;\n        else if (s[i][2][j] == 'V')\n          Nn[22]++;\n        else if (s[i][2][j] == 'W')\n          Nn[23]++;\n\n        else if (s[i][2][j] == 'X')\n          Nn[24]++;\n\n        else if (s[i][2][j] == 'Y')\n          Nn[25]++;\n        else if (s[i][2][j] == 'Z')\n          Nn[26]++;\n      }\n    }\n  }\n  int Nmax = 0, zimuxu;\n  for (i = 1; i <= 26; i++) {\n    if (Nn[i] > Nmax) {\n      Nmax = Nn[i];\n      zimuxu = i;\n    }\n  }\n\n  printf(\"%c\\n\", 'A' + zimuxu - 1);\n  cout << Nmax << \"\\n\";\n\n  for (j = 1; j <= m; j++) {\n    ctrl = 0;\n    for (k = 0; s[j][2][k] != '\\0'; k++) {\n      if (s[j][2][k] == 'A' + zimuxu - 1)\n        ctrl++;\n    }\n    if (ctrl != 0)\n      printf(\"%s\\n\", s[j][1]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[27];\n} book[100];\nint main() {\n  int n, i, k, sz[26], t, m, e;\n  scanf(\"%d\", &n);\n  m = 0;\n  for (i = 0; i < 26; i++) {\n    sz[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      sz[book[i].author[k] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sz[i] > m) {\n      m = sz[i];\n      e = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", e + 'A', m);\n  for (i = 0; i < n; i++) {\n    t = strlen(book[i].author);\n    for (k = 0; k < t; k++) {\n      if (book[i].author[k] == e + 'A') {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2390", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char p[26];\n};\nint main() {\n  int n, i, j, k, a[150] = {0}, flag, max = 0;\n  struct book t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    cin >> s[i].id >> s[i].p;\n    for (j = 0; s[i].p[j] != '\\0'; j++)\n      a[s[i].p[j]]++;\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (max < a[i]) {\n      max = a[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; s[i].p[k] != '\\0'; k++)\n      if (s[i].p[k] == j)\n        flag = 1;\n    if (flag == 1)\n      printf(\"%d\\n\", s[i].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int num;\n  char w[26];\n\n} book[999], test[1];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, n, s;\n  char x, c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].w);\n  }\n\n  x = 'A';\n  n = 0;\n  c = 'A';\n  while (1) {\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < strlen(book[i].w); j++) {\n        if (book[i].w[j] == x) {\n          s++;\n        }\n      }\n    }\n\n    if (s > n) {\n      n = s;\n      c = x;\n    }\n    if (x == 'Z') {\n      break;\n    }\n    x++;\n  }\n  printf(\"%c\\n%d\\n\", c, n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].w); j++) {\n      if (book[i].w[j] == c) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld %s\", &p1->num, p1->str);\n  head = 0;\n  while (p1->num != 0) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->str);\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x = 1, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 64]++;\n    }\n  }\n  max = sum[1];\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 64)\n        a[y] = p->num;\n    y++;\n  }\n  cout << x + 64 << \"\\n\" << max << \"\\n\";\n  for (y = 1; y <= 99; y++)\n    if (a[y] != 0)\n      printf(\"%d\\n\", a[y]);\n}\n"}
{"label": "2", "index": "2393", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bk[i].id >> bk[i].au;\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  printf(\"%c\\n%d\\n\", m, cnt[m]);\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2394", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26][999], t, i, n[26], k, j, b = 0;\n  char x[27];\n  cin >> t;\n  for (i = 0; i < 26; i++) {\n    n[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    scanf(\"%d%s\", &k, x);\n    for (j = 0; x[j] != '\\0'; j++) {\n      a[x[j] - 65][n[x[j] - 65]] = k;\n      n[x[j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > b) {\n      b = n[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n\", j + 65);\n  printf(\"%d\\n\", n[j]);\n  for (i = 0; i < n[j]; i++) {\n    printf(\"%d\\n\", a[j][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n};\nchar max(int *p);\n\nint main() {\n  int m, b, i, *p;\n  struct book shu[999];\n  char c;\n  int writer[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2396", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char author[27];\n  int i, j, n, no, ab[26][1000] = {0}, an[26] = {0}, ma = 0, na, am;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> no >> author;\n    for (i = 0; i < 27; i++)\n      if (author[i] != '\\0')\n        ab[author[i] - 'A'][an[author[i] - 'A']] = no, an[author[i] - 'A']++;\n      else\n        break;\n  }\n  for (i = 0; i < 26; i++) {\n    na = 0;\n    for (j = 0; j < 999; j++)\n      if (ab[i][j] != 0)\n        na++;\n      else\n        break;\n    if (na > ma)\n      ma = na, am = i;\n  }\n  cout << (char)('A' + am) << endl << ma << endl;\n  for (i = 0; i < 1000; i++)\n    if (ab[am][i] != 0)\n      cout << ab[am][i] << endl;\n    else\n      break;\n  return 0;\n}\n"}
{"label": "2", "index": "2397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[30];\n} book[1200];\nint main() {\n  int n, l, t, a[30];\n  char m;\n  cin >> n;\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].writer;\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      t = book[i].writer[j] - 65;\n      a[t]++;\n    }\n  }\n  t = a[0];\n  l = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i] > t) {\n      l = i;\n      t = a[i];\n    }\n  }\n  m = l + 65;\n  cout << m << endl;\n  cout << t << endl;\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      if (book[i].writer[j] == m)\n        cout << book[i].id << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2398", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t[26] = {0}, k = 0, max, h;\n  cin >> n;\n  struct book {\n    int a;\n    char b[26];\n  } book[100] = {0, \"\"};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].a, book[i].b);\n  }\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      t[book[i].b[j] - 65]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (t[i] > max) {\n      max = t[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", h + 65, max);\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      if (book[i].b[j] == h + 65)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[26];\n};\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int i;\n  struct book book[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  int b[26] = {0};\n  for (i = 0; i < n; i++) {\n    int l;\n    l = strlen(book[i].author);\n    int j;\n    for (j = 0; j < l; j++)\n      b[book[i].author[j] - 65] = b[book[i].author[j] - 65] + 1;\n  }\n  int max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max)\n      break;\n  }\n  char p;\n  p = i + 65;\n  printf(\"%c\\n%d\\n\", p, max);\n  for (i = 0; i < n; i++) {\n    int j, l;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++) {\n      if (book[i].author[j] == p) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      } else if (book[i].author[j] != p && j == l - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0;\n  char w;\n  scanf(\"%d \", &m);\n  for (int i = 1; i <= m; i++) {\n    cin >> b;\n    book[i][26] = b;\n    cin.get();\n    while ((w = cin.get()) != '\\n') {\n      writer[w - 'A']++;\n      book[i][w - 'A'] = 1;\n    }\n  }\n  for (int i = 1; i < 26; i++)\n    if (writer[max] < writer[i])\n      max = i;\n  cout << (char)(max + 'A') << endl;\n  cout << writer[max] << endl;\n  for (int i = 1; i <= m; i++)\n    if (book[i][max])\n      cout << book[i][26] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][100];\n  int b[1000], c[27], s[1000], max, i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], a[i]);\n    s[i] = strlen(a[i]);\n  }\n  for (j = 0; j < 26; j++) {\n    c[j] = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < s[i]; k++) {\n        if (a[i][k] == 65 + j)\n          c[j] = c[j] + 1;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      cout << c[i] << \"\\n\";\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < s[k]; j++) {\n          if (a[k][j] == 65 + i)\n            printf(\"%d\\n\", b[k]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, amount[26], num[26][1000], num0, max = 0;\n  char a;\n  memset(amount, 0, sizeof(amount));\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num0;\n    cin.get();\n    a = cin.get();\n    while (a != '\\n') {\n      num[a - 65][amount[a - 65]] = num0;\n      amount[a - 65]++;\n      a = cin.get();\n    }\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < amount[i])\n      max = amount[i];\n  for (int i = 0; i < 26; i++)\n    if (max == amount[i]) {\n      a = i + 65;\n      cout << a << endl << max << endl;\n      for (int j = 0; j < max; j++)\n        cout << num[i][j] << endl;\n      break;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  cout << m << \"\\n\" << cnt[m] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, a[100], b[26], s, max;\n  char c[100][50], m;\n  for (i = 0; i <= 25; i++)\n    b[i] = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++) {\n      s = (int)c[i][j] - 65;\n      b[s] = b[s] + 1;\n    }\n  }\n\n  max = b[0];\n  j = 0;\n\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      j = i;\n    }\n  }\n  m = j + 65;\n\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i <= n - 1; i++) {\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++)\n      if (c[i][j] == m)\n        printf(\"%d\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "2405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k, x, t;\n  struct book {\n    int num;\n    char w[26];\n  } b[1000];\n\n  for (i = 0; i < m; i++) {\n    cin >> b[i].num;\n    scanf(\"%s\", &b[i].w);\n  }\n  int c[26];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].w[k] != '\\0' && b[j].w[k] - i == 'A')\n          c[i]++;\n      }\n    }\n  }\n  int d[26];\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (i = 0; i < 25; i++) {\n    if (d[i] > d[i + 1]) {\n      t = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = t;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == d[25])\n      x = i;\n  }\n  printf(\"%c\\n\", 'A' + x);\n  cout << c[x] << \"\\n\";\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (b[j].w[k] - x == 'A')\n        cout << b[j].num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2406", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  int a;\n  char name[26];\n};\nint main() {\n  struct people pl[1000];\n  int i, j, k, l = 0, n, s, m, max, x[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &pl[i].a, pl[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(pl[i].name);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++)\n        if (k == pl[i].name[j] - 'A') {\n          x[k]++;\n          break;\n        }\n  }\n  max = x[0];\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max) {\n      printf(\"%c\\n\", 'A' + i);\n      s = i;\n      printf(\"%d\\n\", x[i]);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (pl[i].name[j] == 'A' + s) {\n        printf(\"%d\\n\", pl[i].a);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[1000], len[1000], num1[1000][26] = {0}, sum[26] = {0},\n                                        max = 0, m;\n  char writer[1000][26],\n      letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &num[i], writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (writer[j][k] == letter[i]) {\n          num1[j][i]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + num1[j][i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[m], sum[m]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == letter[m]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int N;\n  int a[26] = {0};\n\n  struct book {\n    int x;\n    char y[27];\n  } A[1000];\n\n  scanf(\"%d\", &N);\n  int i, j;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%s\", &A[i].x, A[i].y);\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == 'A') {\n        a[0]++;\n      }\n\n      else if (A[i].y[j] == 'B')\n        a[1]++;\n      else if (A[i].y[j] == 'C') {\n        a[2]++;\n      } else if (A[i].y[j] == 'D') {\n        a[3]++;\n      } else if (A[i].y[j] == 'E') {\n        a[4]++;\n      } else if (A[i].y[j] == 'F') {\n        a[5]++;\n      } else if (A[i].y[j] == 'G') {\n        a[6]++;\n      } else if (A[i].y[j] == 'H') {\n        a[7]++;\n      } else if (A[i].y[j] == 'I') {\n        a[8]++;\n      } else if (A[i].y[j] == 'J') {\n        a[9]++;\n      } else if (A[i].y[j] == 'K') {\n        a[10]++;\n      } else if (A[i].y[j] == 'L') {\n        a[11]++;\n      } else if (A[i].y[j] == 'M') {\n        a[12]++;\n      } else if (A[i].y[j] == 'N') {\n        a[13]++;\n      } else if (A[i].y[j] == 'O') {\n        a[14]++;\n      } else if (A[i].y[j] == 'P') {\n        a[15]++;\n      } else if (A[i].y[j] == 'Q') {\n        a[16]++;\n      } else if (A[i].y[j] == 'R') {\n        a[17]++;\n      } else if (A[i].y[j] == 'S') {\n        a[18]++;\n      } else if (A[i].y[j] == 'T') {\n        a[19]++;\n      } else if (A[i].y[j] == 'U') {\n        a[20]++;\n      } else if (A[i].y[j] == 'V') {\n        a[21]++;\n      } else if (A[i].y[j] == 'W') {\n        a[22]++;\n      } else if (A[i].y[j] == 'X') {\n        a[23]++;\n      } else if (A[i].y[j] == 'Y') {\n        a[24]++;\n      } else if (A[i].y[j] == 'Z') {\n        a[25]++;\n      }\n    }\n  }\n\n  int p;\n  int max;\n  p = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  char d;\n  d = ('A' + p);\n  cout << d << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < N; i++) {\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == (p + 'A'))\n        printf(\"%d\\n\", A[i].x);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char a[26];\n  struct book *next;\n};\nint main() {\n  struct book *head, *p, *s;\n  head = (struct book *)malloc(sizeof(struct book));\n  head->next = NULL;\n  int n, i, j, c[26] = {0}, max, maxj;\n  char b[26];\n  for (j = 0; j < 26; j++)\n    b[j] = 65 + j;\n  cin >> n;\n  p = head;\n  for (i = 0; i < n; i++) {\n    s = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &s->num, s->a);\n    s->next = NULL;\n    p->next = s;\n    p = s;\n  }\n  for (p = head->next; p != NULL; p = p->next) {\n    for (i = 0; p->a[i] != '\\0'; i++)\n      for (j = 0; j < 26; j++)\n        if (p->a[i] == b[j])\n          c[j]++;\n  }\n  max = c[0];\n  maxj = 0;\n  for (j = 1; j < 26; j++)\n    if (c[j] > max) {\n      max = c[j];\n      maxj = j;\n    }\n  cout << b[maxj] << \"\\n\";\n  printf(\"%d\\n\", c[maxj]);\n  for (p = head->next; p != NULL; p = p->next)\n    for (i = 0; p->a[i] != '\\0'; i++)\n      if (p->a[i] == b[maxj])\n        printf(\"%d\\n\", p->num);\n  return 0;\n}\n"}
{"label": "2", "index": "2410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  int book[1000];\n  char person[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  char people[100][100];\n  int i, j;\n  int l;\n  int t[100] = {0};\n  for (i = 1; i <= m; i++) {\n    cin >> book[i];\n    cin >> people[i];\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      t[people[i][j] - 'A']++;\n    }\n  }\n  int max = 0, tt;\n  for (i = 0; i <= 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      tt = i;\n    }\n  }\n  cout << person[tt] << endl;\n  cout << max << endl;\n  int k;\n  int already[26] = {1};\n  for (i = 1; i <= m; i++) {\n\n    l = strlen(people[i]);\n    for (j = 0; j < l; j++) {\n      if (people[i][j] == person[tt])\n\n      {\n        cout << book[i] << endl;\n        for (k = 0; k < l; k++) {\n          if ((people[i][k] != person[tt]) &&\n              (already[people[i][k] - 'A'] != 0)) {\n\n            already[people[i][k] - 'A'] = 0;\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct node {\n  int num;\n  char name[26];\n  struct node *next;\n};\nint n = 1, m;\nstruct zuozhe {\n  char name;\n  int books[300];\n  int num;\n} zuozhe[26];\n\nstruct node *getlinked() {\n  struct node *head, *newnode, *thisnode;\n\n  do {\n    newnode = (struct node *)malloc(sizeof(struct node));\n    if (newnode == NULL) {\n      printf(\"malloc failed\");\n      exit(-1);\n    }\n    scanf(\"%d%s\", &newnode->num, &newnode->name);\n    newnode->next = NULL;\n    if (n == 1) {\n      thisnode = newnode;\n      head = newnode;\n    } else {\n      thisnode->next = newnode;\n    }\n    if (n <= m) {\n      thisnode = newnode;\n      n++;\n    }\n  } while (n <= m);\n  return head;\n}\nvoid tongji(struct node *p, int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(p->name); j++) {\n      zuozhe[(p->name)[j] - 'A'].books[zuozhe[(p->name)[j] - 'A'].num] = p->num;\n      zuozhe[(p->name)[j] - 'A'].num++;\n    }\n    p = p->next;\n  }\n}\n\nvoid bubble(struct zuozhe array[], int n) {\n  int i = 0, pass;\n  struct zuozhe temp;\n\n  for (pass = 1; pass <= n; pass++) {\n    for (i = 0; i < n - pass; i++) {\n      if (array[i].num < array[i + 1].num) {\n        temp = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = temp;\n      }\n    }\n  }\n  return;\n}\n\nint main() {\n  struct node *p;\n  int i;\n  scanf(\"%d\", &m);\n  p = getlinked();\n  for (i = 0; i < 26; i++) {\n    zuozhe[i].name = 'A' + i;\n    zuozhe[i].num = 0;\n  }\n  tongji(p, m);\n  bubble(zuozhe, 26);\n  printf(\"%c\\n%d\\n\", zuozhe[0].name, zuozhe[0].num);\n  for (i = 0; i < zuozhe[0].num; i++) {\n    printf(\"%d\\n\", zuozhe[0].books[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ma = 'A';\n  int cnt[128] = {0};\n  int i, j, n;\n  struct s {\n    int id;\n    char au[27];\n  } bk[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      cnt[bk[i].au[j]]++;\n      if (cnt[bk[i].au[j]] > cnt[ma]) {\n        ma = bk[i].au[j];\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", ma, cnt[ma]);\n  for (i = 0; i < n; i++) {\n    if (strchr(bk[i].au, ma)) {\n      printf(\"%d\\n\", bk[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2413", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct shu {\n  int haoma;\n  char b[26];\n  struct shu *next;\n};\n\nint main() {\n  int n, i, a[26], c[26][100], max;\n  int *s, (*q)[100];\n  s = a;\n  q = c;\n  char m[26];\n  struct shu *head, *p;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  head = (struct shu *)malloc(n * sizeof(shu));\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    (p + i)->next = p + i + 1;\n  }\n  (p + n - 1)->next = 0;\n  p = head;\n  for (; p != 0;) {\n    scanf(\"%d %s\", &p->haoma, p->b);\n    strcpy(m, p->b);\n    for (i = 0; *(m + i) != '\\0'; i++) {\n      *(*(q + *(m + i) - 65) + *(s + *(m + i) - 65)) = p->haoma;\n\n      *(s + *(m + i) - 65) += 1;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(a + i) > max) {\n      max = *(a + i);\n      n = i;\n    }\n  printf(\"%c\\n\", n + 65);\n  printf(\"%d\\n\", *(a + n));\n  for (i = 0; i < *(a + n); i++)\n    printf(\"%d\\n\", *(*(q + n) + i));\n}\n"}
{"label": "2", "index": "2414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d\", &p1->num);\n  scanf(\"%s\", p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head;\n  struct student *p1;\n  char *p2;\n  int i;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == 'A') {\n        a[0] = a[0] + 1;\n      }\n      if ((*p2) == 'B') {\n        a[1] = a[1] + 1;\n      }\n      if ((*p2) == 'C') {\n        a[2] = a[2] + 1;\n      }\n      if ((*p2) == 'D') {\n        a[3] = a[3] + 1;\n      }\n      if ((*p2) == 'E') {\n        a[4] = a[4] + 1;\n      }\n      if ((*p2) == 'F') {\n        a[5] = a[5] + 1;\n      }\n      if ((*p2) == 'G') {\n        a[6] = a[6] + 1;\n      }\n      if ((*p2) == 'H') {\n        a[7] = a[7] + 1;\n      }\n      if ((*p2) == 'I') {\n        a[8] = a[8] + 1;\n      }\n      if ((*p2) == 'J') {\n        a[9] = a[9] + 1;\n      }\n      if ((*p2) == 'K') {\n        a[10] = a[10] + 1;\n      }\n      if ((*p2) == 'L') {\n        a[11] = a[11] + 1;\n      }\n      if ((*p2) == 'M') {\n        a[12] = a[12] + 1;\n      }\n      if ((*p2) == 'N') {\n        a[13] = a[13] + 1;\n      }\n      if ((*p2) == 'O') {\n        a[14] = a[14] + 1;\n      }\n      if ((*p2) == 'P') {\n        a[15] = a[15] + 1;\n      }\n      if ((*p2) == 'Q') {\n        a[16] = a[16] + 1;\n      }\n      if ((*p2) == 'R') {\n        a[17] = a[17] + 1;\n      }\n      if ((*p2) == 'S') {\n        a[18] = a[18] + 1;\n      }\n      if ((*p2) == 'T') {\n        a[19] = a[19] + 1;\n      }\n      if ((*p2) == 'U') {\n        a[20] = a[20] + 1;\n      }\n      if ((*p2) == 'V') {\n        a[21] = a[21] + 1;\n      }\n      if ((*p2) == 'W') {\n        a[22] = a[22] + 1;\n      }\n      if ((*p2) == 'X') {\n        a[23] = a[23] + 1;\n      }\n      if ((*p2) == 'Y') {\n        a[24] = a[24] + 1;\n      }\n      if ((*p2) == 'Z') {\n        a[25] = a[25] + 1;\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  cout << j + 65 << \" \";\n  printf(\"%d \", a[j]);\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == j + 65)\n        cout << p1->num << \" \";\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "2415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint alpha[26] = {0};\nstruct library {\n  int num;\n  char authors[27];\n} books[999];\nvoid addauthor(char string[]) {\n  int i = 0;\n  do {\n    alpha[string[i] - 'A']++;\n    i++;\n  } while (string[i] != '\\0');\n}\nvoid hewroteit(struct library book, int maxalpha) {\n  int i;\n  for (i = 0; book.authors[i] != '\\0'; i++) {\n    if (book.authors[i] - 'A' == maxalpha) {\n      printf(\"%d\\n\", book.num);\n      break;\n    }\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &books[i].num, books[i].authors);\n  for (i = 0; i < m; i++)\n    addauthor(books[i].authors);\n  int max = 0, maxalpha = 0;\n  for (i = 0; i < 26; i++) {\n    if (alpha[i] > max) {\n      max = alpha[i];\n      maxalpha = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxalpha, max);\n  for (i = 0; i < m; i++) {\n    hewroteit(books[i], maxalpha);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s = 0, n, i, j, b[26] = {0}, t, x, m, q;\n  char a[1000][27];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      x = a[i][j];\n      b[x - 65] = b[x - 65] + 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > s) {\n      s = b[i];\n      x = i;\n    }\n  }\n  printf(\"%c \", x + 65);\n  printf(\"%d \", s);\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      m = a[i][j];\n      if (m == x + 65) {\n        for (q = 0; q < 2; q++)\n          printf(\"%c\", a[i][q]);\n\n        printf(\"%c \", a[i][2]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char str[26];\n} bk[1000];\nint main() {\n  int m, i, j, k, s, n = 0;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n                'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int b[26] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].str);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      for (k = 0; k < 26; k++)\n        if (a[k] == bk[i].str[j])\n          b[k]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > n) {\n      n = b[i];\n      s = i;\n    }\n  printf(\"%c\\n%d\\n\", a[s], b[s]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      if (bk[i].str[j] == a[s])\n        printf(\"%d\\n\", bk[i].num);\n}\n"}
{"label": "2", "index": "2418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct shu {\n  int hao;\n  char zuo[26];\n  struct shu *next;\n};\nint main() {\n  int m, a[26] = {0}, i, j, b[26][1000], k, max;\n  struct shu *p1, *p2, *head = NULL, *p;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct shu *)malloc(1000);\n  cin >> p1->hao >> p1->zuo;\n  head = p1;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d %s\", &p1->hao, p1->zuo);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0, max = 0; i <= 25; i++) {\n    for (p = head, k = 1; p != NULL; p = p->next) {\n      for (j = 0; j <= 25; j++)\n        if (p->zuo[j] == 'A' + i) {\n          a[i]++;\n          b[i][k] = p->hao;\n          k++;\n        }\n    }\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i <= 25; i++) {\n    if (a[i] == max) {\n      printf(\"%c %d \", 'A' + i, max);\n      for (k = 1; k <= max; k++)\n        printf(\"%d \", b[i][k]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2419", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct shu {\n  int num;\n  char a[26];\n  struct shu *next;\n};\nint main() {\n  char ma = 'A';\n  struct shu *p1, *p2;\n  struct shu *head, *p;\n  int cnt[128] = {0};\n  int i, j, n, m;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct shu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->a);\n  m = strlen(p1->a);\n  for (j = 0; j < m; j++) {\n    if (++cnt[p1->a[j]] > cnt[ma])\n      ma = p1->a[j];\n  }\n  head = NULL;\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->a);\n    m = strlen(p1->a);\n    for (j = 0; j < m; j++) {\n      if (++cnt[p1->a[j]] > cnt[ma])\n        ma = p1->a[j];\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  printf(\"%c %d \", ma, cnt[ma]);\n  while (p != NULL) {\n    m = strlen(p->a);\n    for (i = 0; i < m; i++) {\n      if (p->a[i] == ma) {\n        printf(\"%d \", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who)\n        cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ismax(int l[], int a) {\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (l[i] > l[a])\n      return (0);\n  }\n  return (1);\n}\n\nint main() {\n  int i, j, k, n, p, l[26] = {0};\n  struct shu {\n    int num;\n    char auth[100];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].auth);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 100; k++) {\n        if (book[j].auth[k] == i + 65)\n          l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ismax(l, i) == 1) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 100; j++) {\n      if (book[i].auth[j] == p + 65)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int n, i, j, a[26] = {0}, len[1000], k, max = 0;\n  struct book list[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> list[i].num;\n    scanf(\"%s\", list[i].name);\n    len[i] = strlen(list[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (list[j].name[k] == i + 65) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (list[i].name[j] == k + 65) {\n        printf(\"%d\\n\", list[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[100];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int k = 1;\n  struct book *head, *p1, *p2, *p;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  p2 = p1;\n  p = p1;\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  do {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    k++;\n  } while (k < n);\n  return head;\n}\n\nint main(void) {\n  struct book *head, *p;\n  char *q;\n  int *s;\n  int n, i, j, max = 0;\n  s = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(s + i) = 0;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  while (p) {\n    q = p->name;\n    while (*q != '\\0') {\n      *(s + *(q) - 'A') += 1;\n      q++;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(s + i) > max)\n      max = *(s + i);\n  for (i = 0; i < 26; i++)\n    if (*(s + i) == max)\n      break;\n  printf(\"%c\\n%d\\n\", 'A' + i, max);\n  p = head;\n  while (p) {\n    q = p->name;\n    if (strchr(q, 'A' + i) != NULL)\n      cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int m = 0;\n  head = p1 = p2 = NULL;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (1) {\n    m += 1;\n    if (m >= n)\n      break;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct book *head, *p;\n  char maxchar;\n  int m, i = 0, max = 0, a[26] = {0};\n  scanf(\"%d\", &m);\n  head = creat(m);\n\n  for (p = head; p != NULL; p = p->next) {\n    \n    for (i = 0; p->name[i] != '\\0'; i++) {\n      int c = p->name[i] - 'A';\n      a[c]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxchar = 'A' + i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", maxchar, max);\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      if (p->name[i] == maxchar) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n}\n"}
{"label": "2", "index": "2425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[27] = {0}, no[27][1000] = {0};\n  char s[27], ls;\n  int l, i, max, t, j, flag, n, w;\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n    cin >> n >> s;\n    l = strlen(s);\n    for (j = 0; j <= l - 1; j++) {\n      w = s[j] - 'A' + 1;\n      num[w]++;\n      no[w][num[w]] = n;\n    }\n  }\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      flag = i;\n    }\n  ls = (char)64 + flag;\n  cout << ls << endl << num[flag] << endl;\n  for (i = 1; i <= num[flag]; i++)\n    cout << no[flag][i] << endl;\n  cin >> w;\n  return 0;\n}\n"}
{"label": "2", "index": "2426", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char name[30] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"}, c[1000][100];\n  int n, a[1000], num[100] = {0}, i, j, k, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    cin >> c[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; c[i][k] != '\\0'; k++) {\n      for (j = 0; name[j] != '\\0'; j++) {\n        if (name[j] == c[i][k])\n          num[j]++;\n      }\n    }\n  }\n  for (i = 0; name[i] != '\\0'; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[k], num[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == name[k]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2427", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int m = 0, num = 0, wnum = 0, max = 0, i = 0, j = 0; \n  int books[26][30];                                   \n  char writer[26], name;                               \n  memset(books, 0, sizeof(books));                     \n  cin >> m;\n  for (i = 0; i < m; i++) \n  {\n    cin >> num >> writer;\n    wnum = strlen(writer);\n    for (j = 0; j < wnum; j++) \n    {\n      books[writer[j] - 65][0]++;\n      books[writer[j] - 65][books[writer[j] - 65][0]] = num;\n    }\n  }\n  for (j = 0; j < 26; j++) \n    if (max < books[j][0]) {\n      max = books[j][0];\n      name = j + 65;\n    }\n  cout << name << endl;\n  cout << max << endl;\n  for (j = 1; j <= max; j++)\n    cout << books[name - 65][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct author {\n  int num;\n  char name[26];\n};\nstruct author ren[100];\n\nint main() {\n  int n, i, j = 0, k = 0, biao, maxzuozhe, p, geshu[26] = {0}, max = 0,\n            maxdeshu[999];\n\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].num);\n    scanf(\"%s\", ren[i].name);\n  }\n\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(ren[j].name); k++) {\n        if ((i + 'A') == ren[j].name[k])\n          geshu[i] = geshu[i] + 1;\n      }\n    }\n  }\n  for (i = 'A' - 65; i <= 'Z' - 65; i++) {\n    if (max < geshu[i]) {\n      max = geshu[i];\n      biao = i;\n    }\n  }\n  maxzuozhe = 'A' + biao;\n  p = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (k = 0; k <= strlen(ren[i].name); k++) {\n      if (maxzuozhe == ren[i].name[k]) {\n        maxdeshu[p] = ren[i].num;\n        p++;\n        break;\n      }\n    }\n  }\n  printf(\"%c\\n\", maxzuozhe);\n  cout << p << \"\\n\";\n  for (i = 0; i <= p - 1; i++) {\n    printf(\"%d\\n\", maxdeshu[i]);\n  }\n\n  getchar();\n}\n"}
{"label": "2", "index": "2429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  cout << m << \"\\n\" << cnt[m] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char name[30] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"}, c[1000][100];\n  int n, a[1000], num[100] = {0}, i, j, k, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    scanf(\"%s\", c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; c[i][k] != '\\0'; k++) {\n      for (j = 0; name[j] != '\\0'; j++) {\n        if (name[j] == c[i][k]) {\n          num[j]++;\n        }\n      }\n    }\n  }\n  for (i = 0; name[i] != '\\0'; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[k], num[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == name[k]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct info {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int i, m, j, b[26] = {0};\n  char out;\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\\n\", &a[i].num, a[i].author);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      b[a[i].author[j] - 'A']++;\n  int max = b[0];\n  for (i = 0; i < 26; i++)\n    max = max > b[i] ? max : b[i];\n  for (i = 0; i < 26; i++)\n    if (b[i] == max) {\n      out = 'A' + i;\n      printf(\"%c\\n\", 'A' + i);\n      cout << b[i] << \"\\n\";\n      break;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == out) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t = 0, c = 0;\n  int A[25];\n  char g[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct point {\n    int a;\n    char s[80];\n  } tope[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> tope[i].a >> tope[i].s;\n  }\n  for (k = 0; k < 26; k++) {\n    A[k] = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; tope[i].s[j] != '\\0'; j++) {\n        if (tope[i].s[j] == g[k])\n          A[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (A[i] > t) {\n      t = A[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", g[c], t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; tope[i].s[j] != '\\0'; j++) {\n      if (tope[i].s[j] == g[c]) {\n        cout << tope[i].a << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char temp, s;\n  int i, j, t[27][2000], m, n, a[27] = {0}, num[2000], x;\n  {\n    cin >> n;\n    for (i = 1; i <= n; i++) {\n      cin >> num[i];\n      temp = cin.get();\n      while (temp == '\\n' || temp == ' ')\n        temp = cin.get();\n\n      for (j = 1; 1; j++) {\n        x = temp - 'A' + 1;\n        t[x][a[x]] = num[i];\n        a[x]++;\n        temp = cin.get();\n        if (temp == '\\n') {\n          break;\n        }\n      }\n    }\n    m = 0;\n    for (i = 1; i <= 26; i++) {\n      if (a[i] > a[m]) {\n        m = i;\n      }\n    }\n    s = m + 'A' - 1;\n    cout << s << endl << a[m] << endl;\n    for (i = 0; i < a[m]; i++) {\n      cout << t[m][i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, q = 0, t = 0, u, max;\n  int b[26] = {0};\n  char c[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct as {\n    int sh;\n    char a[26];\n  } cla[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &cla[i].sh, cla[i].a);\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++) {\n      u = cla[i].a[k] - 'A';\n      b[u]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++)\n    if (max < b[j]) {\n      max = b[j];\n      q = j;\n    }\n  printf(\"%c\\n\", c[q]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++)\n      if (cla[i].a[k] == c[q])\n        printf(\"%d\\n\", cla[i].sh);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2435", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n};\nstruct name {\n  char na;\n  int n;\n};\nint main() {\n  int n, i, j, k, s, max = 0;\n  struct book a[1000];\n  struct name b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i].num, a[i].name);\n  }\n  for (i = 0; i <= 25; i++) {\n    b[i].na = 'A' + i;\n    for (j = 0, s = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n        if (b[i].na == a[j].name[k]) {\n          s++;\n          break;\n        }\n      }\n    }\n    b[i].n = s;\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n > max) {\n      max = b[i].n;\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n == max) {\n      printf(\"%c\\n%d\\n\", b[i].na, b[i].n);\n      for (j = 0; j <= n - 1; j++) {\n        for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n          if (b[i].na == a[j].name[k]) {\n            printf(\"%d\\n\", a[j].num);\n            break;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int num;\n  char a[26];\n  struct shu *next;\n};\nint main() {\n  char ma = 'A';\n  struct shu *p1, *p2;\n  struct shu *head, *p;\n  int cnt[128] = {0};\n  int i, j, n, m;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct shu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->a);\n  m = strlen(p1->a);\n  for (j = 0; j < m; j++) {\n    if (++cnt[p1->a[j]] > cnt[ma])\n      ma = p1->a[j];\n  }\n  head = NULL;\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->a);\n    m = strlen(p1->a);\n    for (j = 0; j < m; j++) {\n      if (++cnt[p1->a[j]] > cnt[ma])\n        ma = p1->a[j];\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  printf(\"%c %d \", ma, cnt[ma]);\n  while (p != NULL) {\n    m = strlen(p->a);\n    for (i = 0; i < m; i++) {\n      if (p->a[i] == ma) {\n        cout << p->num << \" \";\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[1000], a[26], b, c, num = 0;\n  char s[1000][26];\n  for (i = 0; i < 25; i++)\n    a[i] = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> s[i];\n    for (j = 0; s[i][j] != '\\0'; j++)\n      a[(int)s[i][j] - 65]++;\n  }\n  b = a[0];\n  c = 0;\n  for (i = 1; i < 26; i++)\n    if (b < a[i]) {\n      b = a[i];\n      c = i;\n    }\n  cout << (char)(c + 65) << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65)\n        num++;\n  cout << num << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65) {\n        cout << x[i] << endl;\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2438", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char temp, s;\n  int i, j, t[27][2000], m, n, a[27] = {0}, num[2000], x;\n  {\n    cin >> n;\n    for (i = 1; i <= n; i++) {\n      cin >> num[i];\n      temp = cin.get();\n      while (temp == '\\n' || temp == ' ') {\n        temp = cin.get();\n      }\n      for (j = 1; 1; j++) {\n        x = temp - 'A' + 1;\n        t[x][a[x]] = num[i];\n        a[x]++;\n        temp = cin.get();\n        if (temp == '\\n') {\n          break;\n        }\n      }\n    }\n    m = 0;\n    for (i = 1; i <= 26; i++) {\n      if (a[i] > a[m])\n        m = i;\n    }\n    s = m + 'A' - 1;\n    cout << s << endl << a[m] << endl;\n    for (i = 0; i < a[m]; i++) {\n      cout << t[m][i] << endl;\n    }\n  }\n}\n"}
{"label": "2", "index": "2439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Au {\n  int num;\n  int a[1000];\n} au[26];\nint main() {\n  int i, n, buch, tn;\n  char s[30];\n  for (i = 0; i < 26; i++)\n    au[i].num = 0;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d%s\", &buch, s);\n    for (i = 0; s[i]; i++) {\n      tn = au[s[i] - 'A'].num;\n      au[s[i] - 'A'].a[tn] = buch;\n      au[s[i] - 'A'].num++;\n    }\n  }\n  int temp = 0;\n  for (i = 1; i < 26; i++)\n    if (au[i].num > au[temp].num)\n      temp = i;\n  cout << 'A' + temp << \"\\n\" << au[temp].num << \"\\n\";\n  for (i = 0; i < au[temp].num; i++)\n    printf(\"%d\\n\", au[temp].a[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n > 0) {\n    struct a {\n      char y[30];\n      int x, l;\n    } a[1000];\n    struct b {\n      char y;\n      int x;\n    } b[26];\n    int i, j, p;\n    char k;\n    for (i = 0; i < n; i++) {\n      scanf(\"%d %s\", &a[i].x, &a[i].y);\n      a[i].l = strlen(a[i].y);\n    }\n    for (i = 0; i <= 25; i++) {\n      b[i].y = i + 65;\n      b[i].x = 0;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < a[i].l; j++) {\n        for (k = 65; k <= 90; k++) {\n          if (a[i].y[j] == k)\n            b[k - 65].x = b[k - 65].x + 1;\n        }\n      }\n    }\n    int max = b[0].x;\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x > max)\n        max = b[i].x;\n    }\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x == max) {\n        printf(\"%c\\n\", b[i].y);\n        printf(\"%d\\n\", b[i].x);\n        for (j = 0; j < n; j++) {\n          for (p = 0; p < a[j].l; p++) {\n            if (a[j].y[p] == b[i].y) {\n              printf(\"%d\\n\", a[j].x);\n              break;\n            }\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int num;\n  char w[26];\n\n} book[999], test[1];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, n, s;\n  char x, c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].w;\n  }\n\n  x = 'A';\n  n = 0;\n  c = 'A';\n  while (1) {\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < strlen(book[i].w); j++) {\n        if (book[i].w[j] == x) {\n          s++;\n        }\n      }\n    }\n\n    if (s > n) {\n      n = s;\n      c = x;\n    }\n    if (x == 'Z') {\n      break;\n    }\n    x++;\n  }\n  printf(\"%c\\n%d\\n\", c, n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].w); j++) {\n      if (book[i].w[j] == c) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2442", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[26] = {0};\nint n;\nint max_1;\nint hao;\nstruct chushu {\n  int num;\n  char s[30];\n  struct chushu *next;\n};\nstruct chushu *create() {\n  int j = 0, i = 0, k = 0;\n\n  struct chushu *head, *p1, *p2;\n  p1 = (struct chushu *)malloc(1000);\n  cin >> p1->num >> p1->s;\n\n  for (i = 0; p1->s[i] != '\u0000'; i++) {\n    j = p1->s[i] - 65;\n    a[j] = a[j] + 1;\n  }\n\n  head = p1;\n  p2 = p1;\n  while (k < n - 1) {\n    k++;\n    p2 = p1;\n    p1 = (struct chushu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n\n    for (i = 0; p1->s[i] != '\u0000'; i++) {\n      j = p1->s[i] - 65;\n      a[j] = a[j] + 1;\n    }\n\n    p2->next = p1;\n  }\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nvoid search(struct chushu *head) {\n  int i;\n  struct chushu *p;\n  p = head;\n  while (p->next != NULL) {\n    for (i = 0; p->s[i] != '\u0000'; i++) {\n      if (hao + 65 == p->s[i])\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n  for (i = 0; p->s[i] != '\u0000'; i++) {\n    if (hao + 65 == p->s[i])\n      printf(\"%d \", p->num);\n  }\n}\n\nint main() {\n  int i;\n  struct chushu *p;\n\n  scanf(\"%d\", &n);\n  p = create();\n  max_1 = 0;\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max_1) {\n      max_1 = a[i];\n      hao = i;\n    }\n  }\n  printf(\"%c \", hao + 65);\n  printf(\"%d \", max_1);\n  search(p);\n}\n"}
{"label": "2", "index": "2443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n    struct book *next;\n  } * p1, *p2, *p, *head, *t;\n  int i, n, max = 0, j, k, l, y[400], q;\n  char u;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct book *)malloc(sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p1->x, p1->z);\n    y[i] = strlen(p1->z);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < y[i]; j++) {\n      q = 1;\n      t = p->next;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (p->z[j] == t->z[l])\n            q++;\n        t = t->next;\n      }\n      if (q > max) {\n        max = q;\n        u = p->z[j];\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", u, max);\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == p->z[j]) {\n        cout << p->x << \"\\n\";\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2444", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int no;\n  char auth[26];\n};\nint main() {\n  struct book *head, *BK;\n  int m, n, k, i, j, t, q, p, max;\n  int a[26] = {0};\n  cin >> m;\n  BK = (struct book *)malloc(m * 1000);\n  head = BK;\n  for (i = 0; i < m; i++) {\n    cin >> BK->no >> BK->auth;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      k = BK->auth[j] - 'A';\n      a[k] = a[k] + 1;\n    }\n    BK = BK + 1;\n  }\n  max = a[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  q = t + 'A';\n  printf(\"%c %d \", q, max);\n  BK = head;\n  for (i = 0; i < m; i++) {\n    p = 0;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      if (BK->auth[j] == q) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1) {\n      printf(\"%d \", BK->no);\n    }\n    BK = BK + 1;\n  }\n}\n"}
{"label": "2", "index": "2445", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[26];\n\n} stu[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, max, k, l = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &stu[i].num, stu[i].s);\n  for (i = 0; i < 26; i++)\n    for (k = 0; k < m; k++)\n      for (j = 0; j < strlen(stu[k].s); j++)\n        if (stu[k].s[j] == 'A' + i)\n          a[i]++;\n\n  max = a[0];\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", 'A' + l);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(stu[i].s); j++)\n      if (stu[i].s[j] == 'A' + l) {\n        printf(\"%d\\n\", stu[i].num);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2446", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct cs {\n  int b;\n  char a[26];\n};\nint main() {\n  int m, i, j, k, max = 0;\n  int c[200][1000], count[200] = {0};\n  struct cs x[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> x[i].b;\n\n    cin >> x[i].a;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(x[i].a); j++) {\n      for (k = 65; k < 91; k++) {\n        if (x[i].a[j] == k) {\n          count[k]++;\n          c[k][count[k]] = x[i].b;\n        }\n      }\n    }\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] > max)\n      max = count[k];\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] == max) {\n      printf(\"%c %d \", k, count[k]);\n      for (j = 1; j <= max; j++) {\n        printf(\"%d \", c[k][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int mun;\n  char name[26];\n} a[999];\nint main() {\n  int n, i, j, l, q = 0;\n  char k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].mun, a[i].name);\n  }\n  int w[26] = {0};\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      k = a[i].name[j];\n      w[k - 65]++;\n      \n    }\n  }\n  int max;\n  max = w[0];\n  int flag = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      flag = i;\n    }\n  }\n  printf(\"%c\\n\", flag + 65);\n  printf(\"%d\\n\", w[flag]);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      if (a[i].name[j] == (flag + 65))\n        printf(\"%d\\n\", a[i].mun);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s = 0, n, i, j, b[26] = {0}, t, x, m, q;\n  char a[1000][27];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      x = a[i][j];\n      b[x - 65] = b[x - 65] + 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > s) {\n      s = b[i];\n      x = i;\n    }\n  }\n  printf(\"%c \", x + 65);\n  printf(\"%d \", s);\n  for (i = 0; i < n; i++) {\n    t = strlen(a[i]);\n    for (j = 4; j < t; j++) {\n      m = a[i][j];\n      if (m == x + 65) {\n        for (q = 0; q < 2; q++) {\n          printf(\"%c\", a[i][q]);\n        }\n        printf(\"%c \", a[i][2]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char s[26];\n  } b[1000];\n  struct author {\n    int n[1000];\n    int p;\n    char c;\n  } a[26], e;\n  int i, j, k, m, q, max;\n  char d;\n  for (i = 0; i < 26; i++)\n    a[i].p = 0;\n  for (i = 0, d = 'A'; i < 26; i++, d++) {\n    a[i].c = d;\n  }\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].s);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (b[i].s[j] == '\\0')\n        break;\n      for (k = 0; k < 26; k++) {\n        if (b[i].s[j] == a[k].c) {\n          a[k].n[a[k].p] = b[i].num;\n          a[k].p += 1;\n        }\n      }\n    }\n  }\n  max = a[0].p;\n  e = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i].p > max) {\n      e = a[i];\n      max = a[i].p;\n    }\n  }\n  printf(\"%c\\n\", e.c);\n  printf(\"%d\\n\", e.p);\n  for (j = 0; j < e.p; j++)\n    printf(\"%d\\n\", e.n[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "2450", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int n;\n    char a[26];\n  };\n  struct book book[999];\n  int m, c[26] = {0}, k;\n  char w[26];\n  scanf(\"%d\", &m);\n  int i, j, max = 0, t;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, book[i].a);\n  for (i = 0; i < 26; i++)\n    w[i] = 'A' + i;\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++) {\n        if (book[j].a[k] == w[i])\n          c[i]++;\n      }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      t = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w[t], c[t]);\n  for (j = 0; j < m; j++)\n    for (k = 0; k < 26; k++) {\n      if (book[j].a[k] == w[t]) {\n        printf(\"%d\\n\", book[j].n);\n        break;\n      }\n    }\n}\n"}
{"label": "2", "index": "2451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m;\n  int i, j, a, n;\n  struct book {\n    int no;\n    char name[30];\n  } book[999];\n  int author1[30] = {0}, author2[30] = {0};\n  char k;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].no, &book[i].name);\n  for (i = 0; i < m; i++) {\n    a = strlen(book[i].name);\n    for (j = 0; j < a; j++) {\n      for (k = 'A'; k <= 'Z'; k++) {\n        if (book[i].name[j] == k)\n          author1[(int)k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    author2[i] = author1[i];\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++) {\n      if (author1[i] < author1[j]) {\n        int tmp;\n        tmp = author1[i];\n        author1[i] = author1[j];\n        author1[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author2[i] == author1[0]) {\n      printf(\"%c\\n\", (char)(65 + i));\n      printf(\"%d\\n\", author1[0]);\n      for (j = 0; j < m; j++) {\n        a = strlen(book[j].name);\n        for (n = 0; n < a; n++) {\n          if (book[j].name[n] == (char)(65 + i)) {\n            printf(\"%d\\n\", book[j].no);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[1000], m[1000];\n  struct {\n    char b[26];\n  } p[1000];\n  int j, k;\n  scanf(\"%d\", &n);\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], p[i].b);\n    m[i] = strlen(p[i].b);\n    for (k = 0; k < 26; k++)\n      for (j = 0; j < m[i]; j++) {\n        if (p[i].b[j] == c[k]) {\n          num[k]++;\n        }\n      }\n  }\n  int max = 0, local = 0;\n  for (k = 0; k < 26; k++) {\n    if (num[k] > max) {\n      max = num[k];\n      local = k;\n    }\n  }\n  printf(\"%c\\n\", c[local]);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (p[i].b[j] == c[local]) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2453", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int bkn, m = 1, n, i, j;\n  char bka[30];\n\n  struct author {\n    int num;\n    int p[200];\n  } a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i < 27; i++)\n    a[i].num = 0;\n  for (i = 0; i < n; i++) {\n    cin >> bkn >> bka;\n    for (j = 0; j < strlen(bka); j++) {\n      a[bka[j] - 64].num++;\n      a[bka[j] - 64].p[a[bka[j] - 64].num - 1] = bkn;\n    }\n  }\n  for (i = 2; i < 27; i++)\n    if (a[i].num > a[m].num)\n      m = i;\n  printf(\"%c\\n%d\\n\", m + 64, a[m].num);\n  for (i = 0; i < a[m].num; i++)\n    printf(\"%d\\n\", a[m].p[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(void) {\n  struct stu *p1, *p2, *head;\n  int m;\n  scanf(\"%d\", &m);\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  head = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid print(struct stu *head, int z) {\n  struct stu *q;\n  int i, k;\n  char s[20], s0[20] = {'\\0'};\n  q = head;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++)\n      if (s[i] == z + 65) {\n        printf(\"%d\\n\", q->num);\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n}\n\nint main() {\n  int index;\n  int a[26], k, t, i, max = 0;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  head = create();\n  p = head;\n\n  while (p) {\n    strcpy(s, p->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++) {\n      t = s[i] - 65;\n      a[t]++;\n    }\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      index = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", index + 65, max);\n  print(head, index);\n}\n"}
{"label": "2", "index": "2455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Au {\n  int num;\n  int a[1000];\n} au[26];\nint main() {\n  int i, n, buch, tn;\n  char s[30];\n  for (i = 0; i < 26; i++)\n    au[i].num = 0;\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%d%s\", &buch, s);\n    for (i = 0; s[i]; i++) {\n      tn = au[s[i] - 'A'].num;\n      au[s[i] - 'A'].a[tn] = buch;\n      au[s[i] - 'A'].num++;\n    }\n  }\n  int temp = 0;\n  for (i = 1; i < 26; i++)\n    if (au[i].num > au[temp].num)\n      temp = i;\n  printf(\"%d\\n%d\\n\", 'A' + temp, au[temp].num);\n  for (i = 0; i < au[temp].num; i++)\n    cout << au[temp].a[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, b[26], p, max, j, c;\n  scanf(\"%d\", &m);\n  struct point {\n    int n;\n    char s[26];\n  } a[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i].n, a[i].s);\n  }\n  for (i = 0; i < 26; i++) {\n    b[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == 'A')\n        b[0]++;\n      else if (a[i].s[j] == 'B')\n        b[1]++;\n      else if (a[i].s[j] == 'C')\n        b[2]++;\n      else if (a[i].s[j] == 'D')\n        b[3]++;\n      else if (a[i].s[j] == 'E')\n        b[4]++;\n      else if (a[i].s[j] == 'f')\n        b[5]++;\n      else if (a[i].s[j] == 'G')\n        b[6]++;\n      else if (a[i].s[j] == 'H')\n        b[7]++;\n      else if (a[i].s[j] == 'I')\n        b[8]++;\n      else if (a[i].s[j] == 'J')\n        b[9]++;\n      else if (a[i].s[j] == 'K')\n        b[10]++;\n      else if (a[i].s[j] == 'L')\n        b[11]++;\n      else if (a[i].s[j] == 'M')\n        b[12]++;\n      else if (a[i].s[j] == 'N')\n        b[13]++;\n      else if (a[i].s[j] == 'O')\n        b[14]++;\n      else if (a[i].s[j] == 'P')\n        b[15]++;\n      else if (a[i].s[j] == 'Q')\n        b[16]++;\n      else if (a[i].s[j] == 'R')\n        b[17]++;\n      else if (a[i].s[j] == 'S')\n        b[18]++;\n      else if (a[i].s[j] == 'T')\n        b[19]++;\n      else if (a[i].s[j] == 'U')\n        b[20]++;\n      else if (a[i].s[j] == 'V')\n        b[21]++;\n      else if (a[i].s[j] == 'W')\n        b[22]++;\n      else if (a[i].s[j] == 'X')\n        b[23]++;\n      else if (a[i].s[j] == 'Y')\n        b[24]++;\n      else if (a[i].s[j] == 'Z')\n        b[25]++;\n    }\n  }\n  p = 0;\n  max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      p = i;\n      max = b[i];\n    }\n  }\n  c = (p + 'A');\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == (p + 'A'))\n        printf(\"%d\\n\", a[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000] = {0}, c[27] = {0}, i, j, k, m, p, d[1000] = {0};\n  char b[1000][30] = {{0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], b[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 1; k <= 26; k++) {\n        if (b[i][j] == 64 + k)\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n\n  m = c[1];\n  p = 1;\n  for (i = 1; i < 27; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      p = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i][j] == 64 + p)\n        d[i] = 1;\n    }\n  }\n  printf(\"%c\\n\", 64 + p);\n  cout << m << \"\\n\";\n  for (i = 0; i < 1000; i++) {\n    if (d[i] == 1)\n      cout << a[i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "2458", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct aut {\n  char name;\n  int num;\n  int id[1000];\n};\n\nstruct aut author[26];\n\nint main() {\n  int m, i, j, ID, max = 0, maxauthor, k[26] = {0};\n  char c[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++) {\n    author[i].name = 'A' + i;\n    author[i].num = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &ID, c);\n    for (j = 0; c[j]; j++) {\n      author[c[j] - 'A'].id[k[c[j] - 'A']] = ID;\n      k[c[j] - 'A']++;\n      author[c[j] - 'A'].num++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i].num > max) {\n      max = author[i].num;\n      maxauthor = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author[maxauthor].name, author[maxauthor].num);\n  for (i = 0; i < author[maxauthor].num; i++) {\n    printf(\"%d\\n\", author[maxauthor].id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct test {\n  int num;\n  int book[100];\n\n} a[26];\nint main() {\n  int n, i, j, index, temp, max;\n  char s[100];\n  char ch;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &index, &s);\n    for (j = 0; s[j] != '\\0'; j++) {\n      temp = (int)(s[j] - 'A');\n      a[temp].book[a[temp].num] = index;\n      a[temp].num++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i].num > a[max].num)\n      max = i;\n  }\n  ch = (char)('A' + max);\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", a[max].num);\n  for (i = 0; i < a[max].num; i++) {\n    printf(\"%d\\n\", a[max].book[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p = 0;\n  int m, i, j, max[1000];\n  struct book {\n    int num;\n    char s[27];\n  } book[1000];\n  memset(max, 0, sizeof(max));\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].s);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].s[j]; j++) {\n      if (++max[book[i].s[j]] > max[p])\n        p = book[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", p, max[p]);\n  for (i = 0; i < m; i++) {\n    if (strchr(book[i].s, p))\n      printf(\"%d\\n\", book[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2461", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct author {\n  char name[26];\n  int num;\n  struct author *next;\n};\nint main() {\n  int i, n, a[26], j, t;\n  struct author *head;\n  struct author *p1, *p2;\n  p1 = p2 = (struct author *)malloc(1000);\n  head = NULL;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p1->num >> p1->name;\n    if (i == 0)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != (n - 1))\n      p1 = p2->next = (struct author *)malloc(1000);\n    else {\n      p2->next = NULL;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  p1 = head;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      a[p1->name[j] - 'A']++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > a[t])\n      t = i;\n  }\n  printf(\"%c %d \", t + 'A', a[t]);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      if (p1->name[j] == t + 'A')\n        printf(\"%d \", p1->num);\n      continue;\n    }\n  }\n}\n"}
{"label": "2", "index": "2462", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int shu;\n  char ppl[27];\n  int a[26][n + 1];\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    memset(ppl, 0, sizeof(ppl));\n    cin >> shu;\n    getchar();\n    cin.getline(ppl, 27, '\\n');\n    for (int j = 0; 'A' <= ppl[j] && ppl[j] <= 'Z'; j++) {\n      a[(int)ppl[j] - (int)'A'][0]++;\n      a[(int)ppl[j] - (int)'A'][a[(int)ppl[j] - (int)'A'][0]] = shu;\n    }\n  }\n  int max = 0, set = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      set = i;\n    }\n  }\n  cout << (char)((int)'A' + set) << endl;\n  cout << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << a[set][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "2463", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  char id;\n  int count;\n  int books[1000];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct author *pa = (const struct author *)a;\n  const struct author *pb = (const struct author *)b;\n  return pb->count - pa->count;\n}\n\nint main() {\n  int i, j, num, id, len, idx;\n  struct author authors[26];\n  char c;\n  char buffer[26];\n  for (i = 0; i < 26; ++i) {\n    authors[i].id = 'A' + i;\n    authors[i].count = 0;\n  }\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %s\", &id, buffer);\n    len = strlen(buffer);\n    for (j = 0; j < len; ++j) {\n      idx = buffer[j] - 'A';\n      authors[idx].books[authors[idx].count] = id;\n      authors[idx].count++;\n    }\n  }\n  qsort(authors, 26, sizeof(struct author), cmp);\n  printf(\"%c\\n\", authors[0].id);\n  printf(\"%d\\n\", authors[0].count);\n  for (i = 0; i < authors[0].count; ++i)\n    printf(\"%d\\n\", authors[0].books[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][30] = {\"\\0\"}, c;\n  int i, j, k, m, a[26] = {0}, b[100] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], s[i]);\n    for (c = 'A'; c <= 'Z'; c++) {\n      if (strchr(s[i], c))\n        a[c - 65]++;\n    }\n  }\n  j = a[0];\n  k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > j) {\n      j = a[i];\n      k = i;\n    }\n  }\n  cout << k + 65 << \"\\n\" << a[k] << \"\\n\";\n  for (i = 0; i < m; i++)\n    if (strchr(s[i], k + 65))\n      cout << b[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "2465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, max, t, i, j, a[1000], l, b[30] = {0}, c;\n  char str[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> str[i];\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      b[str[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 64, b[t]);\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++) {\n      if (str[i][j] == t + 64)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  char author[26];\n  int length;\n} a[1000];\n\nint main() {\n  int n, i, k, num = 0, max = 0;\n  char b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].author);\n    a[i].length = strlen(a[i].author);\n  }\n  for (b = 'A'; b <= 'Z'; b++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < a[i].length; k++) {\n        if (a[i].author[k] == b) {\n          num++;\n          break;\n        }\n      }\n    }\n    if (num > max) {\n      max = num;\n      c = b;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < a[i].length; k++) {\n      if (a[i].author[k] == c) {\n        printf(\"%d\\n\", a[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, t, g, max;\n  char q;\n  int d[26];\n  struct {\n    int a;\n    char b[26];\n\n  } s[999];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &s[i].a, s[i].b);\n\n  for (i = 0; i < 26; i++) {\n    d[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      t = s[i].b[j] - 'A';\n      d[t]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++) {\n    if (d[j] > max) {\n      max = d[j];\n      g = j;\n    }\n  }\n  q = 'A' + g;\n  printf(\"%c\\n%d\\n\", q, max);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      if (s[i].b[j] - 'A' == g) {\n        cout << s[i].a << \"\\n\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2468", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  struct bo {\n    int a;\n    char au[36];\n  };\n  struct bo bo[999];\n  int i, j;\n  char k, K;\n  int sb[26] = {0}, sbt;\n  int len;\n  int n;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bo[i].a, bo[i].au);\n    len = strlen(bo[i].au);\n    for (j = 0; j < len; j++) {\n      for (k = 65; k < 91; k++) {\n        if (bo[i].au[j] == k) {\n          sb[k - 65]++;\n        }\n      }\n    }\n  }\n  K = 0;\n  sbt = 0;\n  for (i = 0; i < 26; i++) {\n    if (sb[i] > sbt) {\n      K = i + 65;\n      sbt = sb[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", K, sbt);\n  for (i = 0; i < m; i++) {\n    n = 1;\n    for (j = 0; j < strlen(bo[i].au); j++) {\n      if (K == bo[i].au[j]) {\n        n = 0;\n      }\n    }\n    if (n == 0) {\n      printf(\"%d\\n\", bo[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "2469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, max;\n  int a[1000], b[26];\n  char name[1000][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], name[i]);\n    for (j = 0; j < strlen(name[i]); j++)\n      b[name[i][j] - 'A']++;\n  }\n  max = 0;\n  for (k = 1; k < 26; k++)\n    if (b[k] > b[max])\n      max = k;\n  printf(\"%c\\n%d\\n\", max + 'A', b[max]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == max + 'A') {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, b[1000], p[26];\n  char *bm[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    p[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n    bm[i] = (char *)malloc(26 * sizeof(char));\n    scanf(\"%s\", bm[i]);\n    for (j = 0; j < strlen(bm[i]); j++)\n      p[(int)(*(bm[i] + j) - 'A')]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n\", (char)('A' + max));\n  printf(\"%d\\n\", p[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(bm[i]); j++) {\n      if (bm[i][j] == (char)('A' + max)) {\n        cout << b[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 1;\n}\n"}
{"label": "2", "index": "2471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, b[1000], p[26];\n  char *bm[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    p[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n    bm[i] = (char *)malloc(26 * sizeof(char));\n    scanf(\"%s\", bm[i]);\n    for (j = 0; j < strlen(bm[i]); j++)\n      p[(int)(*(bm[i] + j) - 'A')]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n\", (char)('A' + max));\n  printf(\"%d\\n\", p[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(bm[i]); j++) {\n      if (bm[i][j] == (char)('A' + max)) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 1;\n}\n"}
{"label": "2", "index": "2472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char au[26];\n  } b[999];\n  int m, n[26], M = 0, i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    n[i] = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].m, b[i].au);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      n[b[i].au[j] - 65]++;\n  for (i = 1; i < 26; i++)\n    if (n[M] < n[i])\n      M = i;\n  printf(\"%d\\n%d\", M + 65, n[M]);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      if (b[i].au[j] == M + 65)\n        cout << \"\\n\" << b[i].m;\n  return 0;\n}\n"}
{"label": "2", "index": "2473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } list[999], *p;\n\n  int n;\n  int count[26] = {0};\n  int i;\n  char k = 'A';\n  int max;\n\n  scanf(\"%d\", &n);\n  for (p = list; p < list + n; p++) {\n    scanf(\"%d %s\", &p->num, p->author);\n  }\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (p->author[i] == '\\0') {\n        break;\n      } else {\n        count[p->author[i] - 65]++;\n      }\n    }\n  }\n\n  max = count[0];\n  for (i = 1; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      k = i + 65;\n    }\n  }\n\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n\n  for (p = list; p < list + n; p++) {\n    for (i = 0;; i++) {\n      if (k == p->author[i]) {\n        printf(\"%d\\n\", p->num);\n      }\n      if (p->author[i] == '\\0') {\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char name[26];\n  int num[26];\n};\nvoid mostbook(struct book *p) {\n  int i, j, k;\n  k = strlen(p->name);\n  for (j = 0; j < 26; j++) \n  {\n    p->num[j] = 0;\n  }\n  for (i = 0; i < k; i++)\n    (p->num[(p->name[i] - 'A')])++;\n}\n\nint main() {\n  int i, j, m;\n  int max = 0;\n  int maxi = 0;\n  int s[26] = {0};\n  \n  scanf(\"%d\", &m);\n  struct book *p;\n  p = (struct book *)malloc(m * sizeof(struct book));\n  for (i = 0; i < m; i++) {\n    \n    scanf(\"%d\", &(p + i)->number);\n    scanf(\"%s\", &(p + i)->name);\n    mostbook(p + i);\n    for (j = 0; j < 26; j++)\n      s[j] += ((p + i)->num[j]);\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] >= max) {\n      max = s[i];\n      maxi = i;\n    }\n  }\n  \n  printf(\"%c\\n\", (maxi + 'A'));\n  \n  printf(\"%d\\n\", max);\n  \n  for (i = 0; i < m; i++) {\n    int k, j;\n    k = strlen((p + i)->name); \n    for (j = 0; j < k; j++) {\n      if ((p + i)->name[j] == (maxi + 'A')) \n      {\n        printf(\"%d\\n\", (p + i)->number);\n        continue; \n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2475", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n  } * s;\n  int n, i, j, a[100], t;\n  char c;\n  s = (struct book *)malloc(n * sizeof(struct book));\n\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &(*(s + i)).num, (*(s + i)).wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      for (c = 'A'; c <= 'Z'; c++)\n        if (s[i].wri[j] == c)\n          a[s[i].wri[j]]++;\n    }\n  for (i = 0; i < 100; i++)\n    if (a[0] < a[i]) {\n      a[0] = a[i];\n      t = i;\n    }\n  printf(\"%c\\n\", t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      if (s[i].wri[j] == t)\n        printf(\"%d\\n\", s[i].num);\n    }\n}\n"}
{"label": "2", "index": "2476", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n} shu[999];\n\nint main(int argc, char *argv[]) {\n  int m, b, i, *p;\n  char c;\n  int writer[26];\n  char max(int *p);\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A'))\n      max = i + 'A';\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, g[26] = {0}, s[26][1000] = {0};\n  char a[50];\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < 50; i++)\n      a[i] = 0;\n    scanf(\"%d%s\", &l, a);\n    for (i = 0; i < 26; i++)\n      for (j = 0; j < 26; j++)\n        if (a[i] == 'A' + j) {\n          s[j][g[j]] = l, g[j]++;\n          break;\n        }\n  }\n  m = 0;\n  for (i = 0; i < 26; i++)\n    if (g[i] > m)\n      m = g[i], k = i;\n  printf(\"%c\\n%d\\n\", 'A' + k, m);\n  for (i = 0; i < m; i++)\n    printf(\"%d\\n\", s[k][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct b {\n  int na;\n  char au[20];\n} book[1000];\nint main() {\n  int m, i, len[1000], num[128] = {0}, j, max, p = 0;\n  char maxi;\n  int boo[1000];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> book[i].na >> book[i].au;\n    len[i] = strlen(book[i].au);\n    for (j = 0; j < len[i]; j++)\n      num[book[i].au[j]]++;\n  }\n  maxi = 'A';\n  max = -1;\n  for (j = 'A'; j <= 'Z'; j++) {\n    if (num[j] > max) {\n      max = num[j];\n      maxi = j;\n    }\n  }\n  printf(\"%c\\n\", maxi);\n  cout << max << \"\\n\";\n  for (i = 0; i < m && p < max; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].au[j] == maxi) {\n        printf(\"%d\\n\", book[i].na);\n        p++;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[30];\n  struct book *next;\n};\nint n;\nstruct book *creat(void) {\n  struct book *head;\n  struct book *p1, *p2;\n  int m = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->writer);\n  head = NULL;\n  while (m < n - 1) {\n    m++;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat();\n  struct book *p;\n  p = head;\n  int i;\n  int sum[27];\n  memset(sum, 0, sizeof(sum));\n  char m;\n  for (p = head; p != NULL; p = p->next) {\n    int x;\n    for (i = 0; i < strlen(p->writer); i++) {\n      x = p->writer[i] - 'A';\n      sum[x]++;\n    }\n  }\n  int max = sum[0];\n  for (i = 0; i < 27; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  for (i = 0; i < 27; i++) {\n    if (sum[i] == max) {\n      cout << 'A' + i << \"\\n\" << sum[i] << \"\\n\";\n      m = 'A' + i;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (i = 0; i < strlen(p->writer); i++) {\n      if (p->writer[i] == m) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  short int num;\n  char author[27];\n};\n\nint main() {\n  char findoutmax(struct info a[], int n, int *pt);\n  void detect(struct info b[], char writter, int nn);\n  char figure;\n  int i, n_book, max, *p;\n  struct info book[999];\n  scanf(\"%d\", &n_book);\n  for (i = 0; i < n_book; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].author);\n  }\n  p = &max;\n  figure = findoutmax(book, n_book, p);\n  printf(\"%c\\n%d\\n\", figure, max);\n  detect(book, figure, n_book);\n  return 0;\n}\n\nchar findoutmax(struct info a[], int n, int *pt) {\n  int i, j, sum[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      switch (a[i].author[j]) {\n      case 'A':\n        sum[0] = sum[0] + 1;\n        break;\n      case 'B':\n        sum[1] = sum[1] + 1;\n        break;\n      case 'C':\n        sum[2] = sum[2] + 1;\n        break;\n      case 'D':\n        sum[3] = sum[3] + 1;\n        break;\n      case 'E':\n        sum[4] = sum[4] + 1;\n        break;\n      case 'F':\n        sum[5] = sum[5] + 1;\n        break;\n      case 'G':\n        sum[6] = sum[6] + 1;\n        break;\n      case 'H':\n        sum[7] = sum[7] + 1;\n        break;\n      case 'I':\n        sum[8] = sum[8] + 1;\n        break;\n      case 'J':\n        sum[9] = sum[9] + 1;\n        break;\n      case 'K':\n        sum[10] = sum[10] + 1;\n        break;\n      case 'L':\n        sum[11] = sum[11] + 1;\n        break;\n      case 'M':\n        sum[12] = sum[12] + 1;\n        break;\n      case 'N':\n        sum[13] = sum[13] + 1;\n        break;\n      case 'O':\n        sum[14] = sum[14] + 1;\n        break;\n      case 'P':\n        sum[15] = sum[15] + 1;\n        break;\n      case 'Q':\n        sum[16] = sum[16] + 1;\n        break;\n      case 'R':\n        sum[17] = sum[17] + 1;\n        break;\n      case 'S':\n        sum[18] = sum[18] + 1;\n        break;\n      case 'T':\n        sum[19] = sum[19] + 1;\n        break;\n      case 'U':\n        sum[20] = sum[20] + 1;\n        break;\n      case 'V':\n        sum[21] = sum[21] + 1;\n        break;\n      case 'W':\n        sum[22] = sum[22] + 1;\n        break;\n      case 'X':\n        sum[23] = sum[23] + 1;\n        break;\n      case 'Y':\n        sum[24] = sum[24] + 1;\n        break;\n      case 'Z':\n        sum[25] = sum[25] + 1;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (sum[j] < sum[i])\n      j = i;\n  }\n  *pt = sum[j];\n  return (65 + j);\n}\n\nvoid detect(struct info b[], char writter, int nn) {\n  int i, j;\n  for (i = 0; i < nn; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] == writter) {\n        printf(\"%d\\n\", b[i].num);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2481", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  char a[1000][10] = {0};  \n  char b[1000][30];        \n  int len[1000] = {0};     \n  int c[150] = {0};        \n  int max = 0;             \n  int i, j, k, p, q, r, s; \n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    len[i] = strlen(b[i]);\n    \n    for (j = 0; j < len[i]; j++) {\n      \n      for (k = 65; k <= 90; k++) {\n        if (b[i][j] == k)\n          c[k]++;\n      }\n    }\n  }\n  for (p = 65; p <= 90; p++) {\n    if (c[p] > max)\n      max = c[p];\n  }\n  for (q = 65; q <= 90; q++) {\n    if (c[q] == max) {\n      printf(\"%c\\n%d\\n\", q, max);\n      for (r = 0; r < m; r++) {\n        for (s = 0; s < len[r]; s++) {\n          if (b[r][s] == q)\n            printf(\"%s\\n\", a[r]);\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[27];\n  struct book *next;\n} * head;\nint times[26];\n\nvoid create(int m) {\n  struct book *p1, *p2;\n  int i;\n  for (i = 0; i <= m - 1; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->writer);\n    if (!i)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n}\nint count() {\n  int max, l, i;\n  char temp[27];\n  struct book *p1;\n  for (i = 0; i <= 25; i++)\n    times[i] = 0;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->writer);\n    strcpy(temp, p1->writer);\n    for (i = 0; i <= l - 1; i++)\n      times[temp[i] - 65]++;\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++)\n    if (times[i] > times[max])\n      max = i;\n  return (max);\n}\nvoid print(int max) {\n  struct book *p1;\n  int abc[999], total, l, i;\n  char temp[27];\n\n  total = 0;\n  printf(\"%c\\n\", max + 65);\n  p1 = head;\n  while (p1 != NULL) {\n    strcpy(temp, p1->writer);\n    l = strlen(temp);\n    for (i = 0; i <= l - 1; i++)\n      if (max + 65 == temp[i])\n        break;\n    if (i < l) {\n      abc[total] = p1->num;\n      total++;\n    }\n    p1 = p1->next;\n  }\n  cout << total << \"\\n\";\n  for (i = 0; i <= total - 1; i++)\n    printf(\"%d\\n\", abc[i]);\n}\nint main() {\n  int max, m;\n  scanf(\"%d\", &m);\n  create(m);\n  max = count();\n  print(max);\n}\n"}
{"label": "2", "index": "2483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nstruct book *creat() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  p1->next = NULL;\n  if (i >= n) {\n    free(p1);\n    head = NULL;\n    return head;\n  } else {\n    head = p1;\n    p2 = p1;\n    while (i < n) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n      p1->next = NULL;\n      i++;\n      {\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n    p2->next = p1;\n    p1->next = NULL;\n    return head;\n  }\n}\nint max(char letter, struct book *head) {\n  int i, j, k;\n  i = 0;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        i++;\n    }\n    q = q->next;\n  }\n  return i;\n}\n\nvoid outbook(char letter, struct book *head) {\n  int j, k;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        printf(\"%d \", q->num);\n    }\n    q = q->next;\n  }\n}\nint main() {\n  int i, m, s;\n  struct book *p0, *p1;\n  p0 = p1 = creat();\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = max(i + 65, p0);\n\n  s = 0;\n  m = sum[0];\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > m) {\n      m = sum[i];\n      s = i;\n    }\n  }\n  printf(\"%c \", s + 65);\n  printf(\"%d \", m);\n  outbook(s + 65, p1);\n}\n"}
{"label": "2", "index": "2484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char number[20];\n  char name[26];\n} books[1000];\n\nint main() {\n  int n, i, j;\n  int count[26] = {0};\n  int temp, base, k = 0;\n  char author;\n  int pd = 0, N = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", &books[i].number, &books[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n      temp = books[i].name[j] - 'A';\n      count[temp]++;\n    }\n  }\n  base = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] > base) {\n      base = count[i];\n      k = i;\n    }\n  }\n  author = 'A' + k;\n  printf(\"%c \", author);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      N++;\n  }\n  printf(\"%d \", N);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      printf(\"%s \", books[i].number);\n  }\n}\n"}
{"label": "2", "index": "2485", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char name[26];\n  int name_num[26];\n} book[999];\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, &book[i].name);\n  }\n  int count[26] = {0};\n  int k;\n  for (i = 0; i < n; i++) {\n    int len;\n    len = strlen(book[i].name);\n    for (k = 0; k < len; k++) {\n      book[i].name_num[k] = (int)book[i].name[k];\n    }\n  }\n  int j;\n  int y;\n  for (i = 0; i < n; i++) {\n    int len_1;\n    len_1 = strlen(book[i].name);\n    for (j = 65; j <= 90; j++) {\n      for (y = 0; y < len_1; y++) {\n        if (book[i].name_num[y] == j) {\n          count[j - 65]++;\n        }\n      }\n    }\n  }\n  int w;\n  int max = count[0];\n  int t = 0;\n  for (w = 0; w < 26; w++) {\n    if (count[w] > max) {\n      max = count[w];\n      t = w;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  int x;\n  int total = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(book[i].name);\n    for (x = 0; x < length; x++) {\n      if (book[i].name_num[x] == t + 65) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int num;\n    char a[25];\n  } book[999];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n\n  int s[26] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      s[book[i].a[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char name;\n  for (i = 0; i <= 25; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      name = 'A' + i;\n    }\n  }\n  printf(\"%c \", name);\n  printf(\"%d \", max);\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      if (book[i].a[j] == name)\n        printf(\"%d \", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2487", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[26];\n} a[100];\nint main() {\n  int m, i, n, j, k, max, maxnum;\n  int aut1[26] = {0}, aut2[26][100] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i].id);\n\n    cin >> a[i].s;\n    n = strlen(a[i].s);\n    for (j = 0; j < n; j++) {\n      k = a[i].s[j] - 'A';\n      aut2[k][aut1[k]] = a[i].id;\n      aut1[k]++;\n    }\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (aut1[i] > max) {\n      max = aut1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c \", 'A' + maxnum);\n  printf(\"%d \", max);\n  printf(\"%d\", aut2[maxnum][0]);\n  for (i = 1; i < max; i++) {\n    printf(\" %d\", aut2[maxnum][i]);\n  }\n}\n"}
{"label": "2", "index": "2488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[27];\n  struct book *next;\n} * head;\nint times[26];\n\nvoid create(int m) {\n  struct book *p1, *p2;\n  int i;\n  for (i = 0; i <= m - 1; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->writer);\n    if (!i)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n}\nint count() {\n  int max, l, i;\n  char temp[27];\n  struct book *p1;\n  for (i = 0; i <= 25; i++)\n    times[i] = 0;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->writer);\n    strcpy(temp, p1->writer);\n    for (i = 0; i <= l - 1; i++)\n      times[temp[i] - 65]++;\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++)\n    if (times[i] > times[max])\n      max = i;\n  return (max);\n}\nvoid print(int max) {\n  struct book *p1;\n  int abc[999], total, l, i;\n  char temp[27];\n\n  total = 0;\n  printf(\"%c\\n\", max + 65);\n  p1 = head;\n  while (p1 != NULL) {\n    strcpy(temp, p1->writer);\n    l = strlen(temp);\n    for (i = 0; i <= l - 1; i++)\n      if (max + 65 == temp[i])\n        break;\n    if (i < l) {\n      abc[total] = p1->num;\n      total++;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i <= total - 1; i++) {\n    printf(\"%d\\n\", abc[i]);\n  }\n}\nint main() {\n  int max, m;\n  scanf(\"%d\", &m);\n  create(m);\n  max = count();\n  print(max);\n}\n"}
{"label": "2", "index": "2489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[26] = {0};\n  char z[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char nn[26][100][20];\n  int m, i, j, r;\n  char a[100][100];\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    cin >> a[j];\n    char b[20];\n    scanf(\"%s\", b);\n    int w = strlen(b);\n    for (i = 0; i < w; i++) {\n      for (r = 0; r < 26; r++) {\n        if (b[i] == z[r]) {\n          n[r]++;\n          strcpy(nn[r][n[r]], a[j]);\n        }\n      }\n    }\n  }\n  int c = 0;\n  for (r = 1; r < 26; r++) {\n    if (n[r] > n[c])\n      c = r;\n  }\n  printf(\"%c\\n%d\\n\", z[c], n[c]);\n  for (i = 1; i <= n[c]; i++) {\n    cout << nn[c][i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "2490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[1001], num[27] = {0}, ascii[27];\n  char a[1001][27], p;\n  int i, j, m, n, t1, t;\n  cin >> m;\n  n = 26;\n  for (i = 0; i < m; i++) {\n    cin >> number[i];\n    cin >> a[i];\n    for (j = 0; j < strlen(a[i]); j++) {\n      num[a[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    ascii[i] = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (num[j] > num[j - 1]) {\n        t = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = t;\n        t1 = ascii[j];\n        ascii[j] = ascii[j - 1];\n        ascii[j - 1] = t1;\n      }\n    }\n  }\n  p = 'A' + ascii[0];\n  cout << p << endl;\n  cout << num[0] << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(a[i]); j++) {\n      if (a[i][j] == p) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2491", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[26];\n} book[999];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i, j;\n  int a;\n  char c;\n  int max = 0;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  int s[26];\n  for (i = 0; i <= 25; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (0 <= (book[i].author[j] - 'A') && (book[i].author[j] - 'A') <= 25) {\n        a = book[i].author[j] - 'A';\n        s[a] = s[a] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (max < s[i]) {\n      max = s[i];\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (max == s[i]) {\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (book[i].author[j] == c) {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, i, j, k, n, s[26][999] = {0}, p[26] = {0};\n  char b[26], c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> j;\n    cin >> b;\n    n = strlen(b);\n    for (k = 0; k < n; k++) {\n      a = b[k] - 'A';\n      s[a][p[a]] = j;\n      p[a]++;\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (p[j] < p[i])\n      j = i;\n  }\n  c = 'A' + j;\n  cout << c << endl << p[j] << endl;\n  for (i = 0;; i++) {\n    if (s[j][i] != 0)\n      cout << s[j][i] << endl;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, a[1000], c[91], max = 0;\n  char b[1000][26], d;\n  scanf(\"%d \", &m);\n  memset(c, 0, sizeof(c));\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < 26; j++)\n      if (b[i][j] > 0)\n        c[b[i][j]]++;\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > max)\n      max = c[i];\n  for (i = 65; i < 91; i++)\n    if (c[i] == max) {\n      d = i;\n      cout << d << endl << max << endl;\n      for (j = 0; j < m; j++)\n        for (k = 0; k < 26; k++)\n          if (b[j][k] == d) {\n            printf(\"%d\\n\", a[j]);\n            break;\n          }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2494", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n > 0) {\n    struct a {\n      char y[30];\n      int x, l;\n    } a[1000];\n    struct b {\n      char y;\n      int x;\n    } b[26];\n    int i, j, p;\n    char k;\n    for (i = 0; i < n; i++) {\n      scanf(\"%d %s\", &a[i].x, &a[i].y);\n      a[i].l = strlen(a[i].y);\n    }\n    for (i = 0; i <= 25; i++) {\n      b[i].y = i + 65;\n      b[i].x = 0;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < a[i].l; j++) {\n        for (k = 65; k <= 90; k++) {\n          if (a[i].y[j] == k)\n            b[k - 65].x = b[k - 65].x + 1;\n        }\n      }\n    }\n    int max = b[0].x;\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x > max)\n        max = b[i].x;\n    }\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x == max) {\n        printf(\"%c\\n\", b[i].y);\n        printf(\"%d\\n\", b[i].x);\n        for (j = 0; j < n; j++) {\n          for (p = 0; p < a[j].l; p++) {\n            if (a[j].y[p] == b[i].y) {\n              printf(\"%d\\n\", a[j].x);\n              break;\n            }\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2495", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char wr[26];\n  struct book *next;\n};\nint main() {\n  int i, n, m = 0, j, a, b, c;\n  int s[100] = {0};\n  scanf(\"%d\", &n);\n  struct book *head, *p1, *p2, *p;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->wr);\n  head = NULL;\n  while (m != n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->wr);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      s[p->wr[j]]++;\n    p = p->next;\n  } while (p != NULL);\n\n  a = s[65];\n  c = 65;\n  for (i = 66; i < 91; i++)\n    if (a < s[i]) {\n      a = s[i];\n      c = i;\n    }\n  printf(\"%c %d \", c, a);\n\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      if (p->wr[j] == c)\n        printf(\"%d \", p->num);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct tushu {\n  int bianhao;\n  char writer[27];\n} book[1000];\nvoid jishu(struct tushu *p1, int a[26], int b);\nint max(int c[26]);\nvoid shu(struct tushu *p2, int d, int e);\n\nint main() {\n  int n, i, m;\n  int zimu[26];\n  struct tushu *pointer;\n  pointer = &book[0];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].bianhao, &book[i].writer);\n  }\n  jishu(pointer, zimu, n);\n  m = max(zimu);\n  shu(pointer, m, n);\n  return 0;\n}\nvoid jishu(struct tushu *p1, int a[26], int b) {\n  int j, k, diji;\n  for (j = 0; j < 26; j++) {\n    a[j] = 0;\n  }\n  for (j = 0; j < b; j++) {\n    k = 0;\n    do {\n      diji = (*(p1 + j)).writer[k] - 'A';\n      a[diji]++;\n      k++;\n    } while ((*(p1 + j)).writer[k] != '\\0');\n  }\n}\nint max(int c[26]) {\n  int k, da, jieguo = 0;\n  da = c[0];\n  for (k = 1; k < 26; k++) {\n    if (c[k] > da) {\n      da = c[k];\n      jieguo = k;\n    }\n  }\n  cout << 65 + jieguo << \"\\n\" << da << \"\\n\";\n  return (jieguo);\n}\nvoid shu(struct tushu *p2, int d, int e) {\n  char ai = 65 + d;\n  int x, y;\n  for (x = 0; x < e; x++) {\n    y = 0;\n    do {\n      if ((*(p2 + x)).writer[y] == ai) {\n        cout << (p2 + x)->bianhao << \"\\n\";\n      }\n      y++;\n    } while ((*(p2 + x)).writer[y] != '\\0');\n  }\n}\n"}
{"label": "2", "index": "2497", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  int number;\n  char name[26];\n} author[999];\n\nstruct single {\n\n  char letter[1];\n  int number;\n\n} single[26];\n\nint main(int argc, char *argv[]) {\n  int n, i, m, j, p, k, book[999];\n  for (i = 0; i < 26; i++) {\n    single[i].letter[0] = 65 + i;\n    single[i].number = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &author[i].number, &author[i].name);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (single[k].letter[0] == author[i].name[j])\n          single[k].number++;\n      }\n    }\n  }\n  m = 0;\n  p = single[0].number;\n  for (i = 1; i < 26; i++) {\n    if (p < single[i].number) {\n      p = single[i].number;\n      m = i;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (author[i].name[j] == single[m].letter[0]) {\n        book[k] = author[i].number;\n        k++;\n      }\n    }\n  }\n  printf(\"%c\\n\", single[m].letter[0]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", book[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int n;\n  char name[26];\n  struct book *next;\n};\nstruct book *head;\nint m;\nstruct book *creat() {\n  struct book *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->n, p1->name);\n  head = NULL;\n  while (i < m - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->n, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int i, j, *p, max = 0, n;\n  struct book *p1;\n  p = (int *)calloc(26, sizeof(int));\n  scanf(\"%d\", &m);\n  creat();\n  p1 = head;\n  for (i = 65; i <= 90; i++) {\n    p1 = head;\n    do {\n      for (j = 0; (p1->name)[j] != '\u0000'; j++)\n        if ((p1->name)[j] == i)\n          *(p + i - 65) = *(p + i - 65) + 1;\n      p1 = p1->next;\n    } while (p1 != NULL);\n  }\n  for (i = 0; i < 26; i++, p++) {\n    if (*p > max) {\n      max = *p;\n      n = i;\n    }\n  }\n  printf(\"%c \", n + 65);\n  cout << max << \" \";\n  p1 = head;\n  do {\n    for (j = 0; (p1->name)[j] != '\u0000'; j++) {\n      if ((p1->name)[j] == n + 65)\n        printf(\"%d \", p1->n);\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "2499", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[1000], d[1000], e[30] = {0};\n  int i, j, k, n, t = 0, max;\n  char c[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n    d[i] = (int)strlen(c[i]);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (c[i][j] == k + 65)\n          e[k] = e[k] + 1;\n  max = e[0];\n  for (k = 1; k < 26; k++) {\n    if (e[k] > max) {\n      t = k;\n      max = e[k];\n    }\n  }\n  printf(\"%c\\n\", t + 65);\n  printf(\"%d\\n\", e[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      if (c[i][j] == t + 65)\n        printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, a[26], sum = 0;\n  for (j = 0; j < 26; j++)\n    a[j] = 0;\n  char aut;\n  scanf(\"%d\", &m);\n  struct book *head, *pb1, *pb2;\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    pb1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &pb1->num, pb1->author);\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      k = pb1->author[j] - 'A';\n      a[k] += 1;\n    }\n    if (head == NULL) {\n      head = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    } else {\n      pb2->next = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (a[j] > sum)\n      sum = a[j], k = j;\n  }\n  aut = (char)('A' + k);\n  cout << aut << \"\\n\";\n  printf(\"%d\\n\", sum);\n  pb1 = head;\n  while (pb1) {\n    for (j = 0; pb1->author[j] != '\\0'; j++)\n      if (pb1->author[j] == aut)\n        printf(\"%d\\n\", pb1->num);\n    pb1 = pb1->next;\n  }\n}\n"}
{"label": "2", "index": "2501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int m, i, j, k, num[10000], max = 0, t = 0;\n  char a[10000][26];\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    scanf(\"%s\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i][j] == c[k])\n          b[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  cout << c[t] << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i][j] == c[t]) {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "2", "index": "2502", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k[100], l[26] = {0}, m = 0, v, j;\n  char c[100][26];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> k[i] >> c[i];\n    for (j = 0; j < strlen(c[i]); j++) {\n      l[(int)c[i][j] - 65] += 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] > m)\n      m = l[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] == m) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      break;\n    }\n  }\n  for (v = 0; v < n; v++) {\n    for (j = 0; j < strlen(c[v]); j++) {\n      if (c[v][j] == i + 65)\n        printf(\"%d\\n\", k[v]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t, max = 0;\n  int a[1000], b[26] = {0};\n  char s[1000][30];\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++) {\n      t = s[i][j] - 65;\n      b[t]++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] >= max)\n      max = b[i];\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max) {\n      k = i;\n      c = i + 65;\n      cout << c << \"\\n\";\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++)\n      if (s[i][j] == 65 + k) {\n        printf(\"%d\\n\", a[i]);\n      }\n  }\n}\n"}
{"label": "2", "index": "2504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  int a;\n  char b[26];\n} shu[1000];\n\nint main() {\n  int s[27];\n  int n, i, j, o, max, t = 1, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].a, shu[i].b);\n\n  for (i = 1; i <= 26; i++)\n    s[i] = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(shu[i].b); j++) {\n      o = shu[i].b[j] - 64;\n      s[o]++;\n    }\n\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (max < s[i]) {\n      max = s[i];\n      t = i;\n    }\n  cout << t + 64 << \"\\n\";\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    x = strlen(shu[i].b);\n    for (j = 0; j < x; j++)\n      if (shu[i].b[j] == t + 64)\n        printf(\"%d\\n\", shu[i].a);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, num[26] = {0}, index1;\n  scanf(\"%d\", &m);\n  struct f {\n    int index;\n    char writer[27];\n  };\n  struct f *p;\n  p = (struct f *)malloc(m * sizeof(struct f));\n  char *p1;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &(p + i)->index, (p + i)->writer);\n  }\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    for (; *p1; p1++) {\n      index1 = (int)*p1 - 'A';\n      (*(num + index1))++;\n    }\n  }\n  int max = 0, k;\n  for (i = 0; i < 26; i++)\n    if (max < *(num + i)) {\n      max = *(num + i);\n      k = i;\n    }\n  char wr;\n  wr = (char)k + 'A';\n  cout << wr << \"\\n\" << max << \"\\n\";\n  int flag;\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    flag = 1;\n    for (; *p1 && flag == 1; p1++)\n      if (*p1 == wr) {\n        flag = 0;\n      }\n    if (flag == 0)\n      cout << (p + i)->index << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "2506", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[1000], a[26], b, c, num = 0;\n  char s[1000][26];\n  for (i = 0; i < 25; i++)\n    a[i] = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> s[i];\n    for (j = 0; s[i][j] != '\\0'; j++)\n      a[(int)s[i][j] - 65]++;\n  }\n  b = a[0];\n  c = 0;\n  for (i = 1; i < 26; i++)\n    if (b < a[i]) {\n      b = a[i];\n      c = i;\n    }\n  cout << (char)(c + 65) << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65)\n        num++;\n  printf(\"%d\\n\", num);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65) {\n        cout << x[i] << endl;\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n};\nint main() {\n  int n, i, j, l, sum[26], t = 0, T = 0;\n  struct book a[1000];\n  memset(sum, 0, sizeof(sum));\n  char A;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].name;\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      sum[a[i].name[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > t) {\n      t = sum[i];\n      T = i;\n    }\n  }\n  A = 'A' + T;\n  cout << A << endl;\n  printf(\"%d\\n\", t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 27; j++) {\n      if (a[i].name[j] == A)\n        cout << a[i].num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char au[26];\n  } b[999];\n  int m, n[26], M = 0, i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    n[i] = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].m, b[i].au);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      n[b[i].au[j] - 65]++;\n  for (i = 1; i < 26; i++)\n    if (n[M] < n[i])\n      M = i;\n  printf(\"%c\\n%d\", M + 65, n[M]);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      if (b[i].au[j] == M + 65)\n        printf(\"\\n%d\", b[i].m);\n  return 0;\n}\n"}
{"label": "2", "index": "2509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, l, x, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> k[i];\n    int m;\n    m = strlen(k[i]);\n    for (l = 0; l < 30; l++) {\n      for (x = 1; x <= 26; x++) {\n        if (k[i][l] == x + 64)\n          author[x]++;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max)\n      max = author[i];\n  }\n  for (i = 1; i <= 26; i++) {\n    if (author[i] == max)\n      maxnumber = i;\n  }\n  char who[10];\n  who[0] = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who[0]);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who[0])\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int number;\n    char author[10];\n  };\n  struct book a[1000];\n  int i, n, j, count[26] = {0}, temp, max, index = 0;\n  char c;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, &a[i].author);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      temp = (a[i].author[j]) - 'A';\n      count[temp]++;\n    }\n  max = count[0];\n  for (i = 1; i < 26; i++)\n    if (count[i] > max) {\n      max = count[i];\n      index = i;\n    }\n  c = index + 'A';\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++)\n      if (a[i].author[j] == c)\n        printf(\"%d\\n\", a[i].number);\n}\n"}
{"label": "2", "index": "2512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int i, k, m, max = 0, t;\n  char j, ch;\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)calloc(1, sizeof(struct book));\n  head = p1;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &(p1->a), p1->b);\n    p2 = p1;\n    if (i == m - 1)\n      p2->next = NULL;\n    else {\n      p1 = (struct book *)calloc(1, sizeof(struct book));\n      p2->next = p1;\n    }\n  }\n  for (j = 'A'; j <= 'Z'; j++) {\n    t = 0;\n    p1 = head;\n    while (p1) {\n      for (k = 0; k < strlen(p1->b); k++)\n        if ((p1->b)[k] == j)\n          t++;\n      p1 = p1->next;\n    }\n    if (t > max) {\n      max = t;\n      ch = j;\n    }\n  }\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", max);\n  p1 = head;\n  while (p1) {\n    for (k = 0; k < strlen(p1->b); k++)\n      if ((p1->b)[k] == ch)\n        cout << p1->a << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, j, k, id[1001], a[26] = {0};\n  char c[1001][26],\n      b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d %s\", &id[j], &c[j]);\n  }\n  for (m = 0; m < 26; m++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[m] == c[j][k])\n          a[m] = a[m] + 1;\n      }\n    }\n  }\n  int t = 0, r = 0;\n  for (m = 0; m <= 25; m++) {\n    if (t < a[m]) {\n      t = a[m];\n      r = m;\n    }\n  }\n  printf(\"%c %d\", b[r], a[r]);\n  for (j = 1; j <= n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (c[j][k] == b[r])\n        printf(\" %d\", id[j]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  } input[1000];\n\n  scanf(\"%d\", &n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &input[i].number, input[i].author);\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct list_1 {\n  int num;\n  char author[26];\n};\n\nstruct number {\n  int a;\n  int time;\n};\n\nint main() {\n  int i, j, m, k, length;\n  struct list_1 book[100];\n  struct number name[26], most;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n\n  for (i = 0; i < 26; i++) {\n    name[i].a = i;\n    name[i].time = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      name[k - 65].time++;\n    }\n  }\n\n  most = name[0];\n\n  for (i = 1; i < 26; i++) {\n    if (name[i].time > most.time) {\n      most = name[i];\n    }\n  }\n\n  printf(\"%c %d \", most.a + 65, most.time);\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      if (most.a + 65 == k) {\n        cout << book[i].num << \" \";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, max;\n  int a[1000], b[26];\n  char name[1000][26];\n  cin >> n;\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], name[i]);\n    for (j = 0; j < strlen(name[i]); j++)\n      b[name[i][j] - 'A']++;\n  }\n  max = 0;\n  for (k = 1; k < 26; k++)\n    if (b[k] > b[max])\n      max = k;\n  printf(\"%c\\n%d\\n\", max + 'A', b[max]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == max + 'A') {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct bookinf {\n    int code;\n    char auth[27];\n  } book[999];\n  int i, k, m, max = 0, num[26];\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].code, book[i].auth);\n    for (k = 0; book[i].auth[k] != '\\0'; k++)\n      num[book[i].auth[k] - 'A'] += 1;\n  }\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < m; i++) {\n    for (k = 0; book[i].auth[k] != '\\0'; k++) {\n      if (book[i].auth[k] == max + 'A') {\n        printf(\"%d\\n\", book[i].code);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t, max = 0;\n  int a[1000], b[26] = {0};\n  char s[1000][30];\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++) {\n      t = s[i][j] - 65;\n      b[t]++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] >= max)\n      max = b[i];\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max) {\n      k = i;\n      c = i + 65;\n      printf(\"%c\\n\", c);\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++)\n      if (s[i][j] == 65 + k)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2519", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sh[100], a[26] = {0}, b[26][100];\n  int max, t, m;\n  char ch[100][40] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &sh[i], ch[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < 40; j++) {\n      m = ch[i][j];\n      if (m > 64 && m < 91) {\n        a[m - 65]++;\n        b[m - 65][a[m - 65]] = sh[i];\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 65 + t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 1; i <= a[t]; i++) {\n    printf(\"%d\\n\", b[t][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2520", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t[26] = {0}, k = 0, max, h;\n  cin >> n;\n  struct book {\n    int a;\n    char b[26];\n  } book[100] = {0, \"\"};\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].a, book[i].b);\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      t[book[i].b[j] - 65]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (t[i] > max) {\n      max = t[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", h + 65, max);\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      if (book[i].b[j] == h + 65)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    int n;\n    char a[26];\n  };\n  struct b b[999];\n  int m, k, i, j, c[26] = {0}, p = 0, q = 0;\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].n, &b[i].a);\n  for (i = 0; i < m; i++)\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      c[x - 65]++;\n  k = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] > k) {\n      k = c[i];\n      p = i;\n    }\n  cout << p + 65 << \"\\n\";\n  printf(\"%d\\n\", c[p]);\n  for (i = 0; i < m; i++) {\n    q = 0;\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      if (x == p + 65)\n        q = 1;\n    if (q == 1)\n      printf(\"%d\\n\", b[i].n);\n  }\n}\n"}
{"label": "2", "index": "2522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint w[26] = {0};\nint p = 0;\nvoid zimu(char a[]) {\n  int m, i, j;\n  char c;\n  m = strlen(a);\n  for (j = 0; j < 26; j++) {\n    c = 'A' + j;\n\n    for (i = 0; i < m; i++) {\n      if (a[i] == c)\n        w[j]++;\n    }\n  }\n}\nint max(int w[26]) {\n  int i, max;\n  max = w[0];\n  for (i = 1; i < 26; i++)\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  return max;\n}\n\nint main() {\n  char b[300][20];\n  int a[300];\n  int m, i, j, mm;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &a[i], b[i]);\n  for (i = 0; i < m; i++)\n    zimu(b[i]);\n  mm = max(w);\n  printf(\"%c\\n\", p + 'A');\n  printf(\"%d\\n\", mm);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (strlen(b[i])); j++)\n      if (b[i][j] == (p + 'A')) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char writer[1000][30];\n  char abc[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int m, n, mark[1000], num[26] = {0}, sum = 0, i, j;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &mark[i]);\n    scanf(\"%s\", writer[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == 'A')\n        num[0]++;\n      else if (writer[i][j] == 'B')\n        num[1]++;\n      else if (writer[i][j] == 'C')\n        num[2]++;\n      else if (writer[i][j] == 'D')\n        num[3]++;\n      else if (writer[i][j] == 'E')\n        num[4]++;\n      else if (writer[i][j] == 'F')\n        num[5]++;\n      else if (writer[i][j] == 'G')\n        num[6]++;\n      else if (writer[i][j] == 'H')\n        num[7]++;\n      else if (writer[i][j] == 'I')\n        num[8]++;\n      else if (writer[i][j] == 'J')\n        num[9]++;\n      else if (writer[i][j] == 'K')\n        num[10]++;\n      else if (writer[i][j] == 'L')\n        num[11]++;\n      else if (writer[i][j] == 'M')\n        num[12]++;\n      else if (writer[i][j] == 'N')\n        num[13]++;\n      else if (writer[i][j] == 'O')\n        num[14]++;\n      else if (writer[i][j] == 'P')\n        num[15]++;\n      else if (writer[i][j] == 'Q')\n        num[16]++;\n      else if (writer[i][j] == 'R')\n        num[17]++;\n      else if (writer[i][j] == 'S')\n        num[18]++;\n      else if (writer[i][j] == 'T')\n        num[19]++;\n      else if (writer[i][j] == 'U')\n        num[20]++;\n      else if (writer[i][j] == 'V')\n        num[21]++;\n      else if (writer[i][j] == 'W')\n        num[22]++;\n      else if (writer[i][j] == 'X')\n        num[23]++;\n      else if (writer[i][j] == 'Y')\n        num[24]++;\n      else if (writer[i][j] == 'Z')\n        num[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= sum) {\n      sum = num[i];\n      n = i;\n    }\n  }\n  printf(\"%c\\n\", abc[n]);\n  printf(\"%d\\n\", num[n]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == abc[n]) {\n        cout << mark[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "2", "index": "2524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar zimu[28] = \"ABCDEFGJIJKLMNOPQRSTUVWXYZ\";\nchar writer[10000][10000];\nint times[26], id[1000], i, len[10000], book = 0;\nint n, j, k, tmax_1, max_1 = 0;\n\nint main() {\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &id[i], &writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    times[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n\n        if (writer[i][j] == zimu[k]) {\n          times[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (times[i] > max_1) {\n      max_1 = times[i];\n      tmax_1 = i;\n    }\n  }\n  printf(\"%c \", zimu[tmax_1]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        book++;\n      }\n    }\n  }\n  printf(\"%d \", book);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        printf(\"%d \", id[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[26][999], t, i, n[26], k, j, b = 0;\n  char x[27];\n  scanf(\"%d\", &t);\n  for (i = 0; i < 26; i++) {\n    n[i] = 0;\n  }\n  for (i = 0; i < t; i++) {\n    scanf(\"%d%s\", &k, x);\n    for (j = 0; x[j] != '\\0'; j++) {\n      a[x[j] - 65][n[x[j] - 65]] = k;\n      n[x[j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > b) {\n      b = n[i];\n      j = i;\n    }\n  }\n  printf(\"%d\\n\", j + 65);\n  printf(\"%d\\n\", n[j]);\n  for (i = 0; i < n[j]; i++) {\n    cout << a[j][i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2526", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar zimu[28] = \"ABCDEFGJIJKLMNOPQRSTUVWXYZ\";\nchar writer[10000][10000];\nint times[26], id[1000], i, len[10000], book = 0;\nint n, j, k, tmax_1, max_1 = 0;\n\nint main() {\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> writer[i];\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    times[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n\n        if (writer[i][j] == zimu[k]) {\n          times[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (times[i] > max_1) {\n      max_1 = times[i];\n      tmax_1 = i;\n    }\n  }\n  printf(\"%c \", zimu[tmax_1]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        book++;\n      }\n    }\n  }\n  printf(\"%d \", book);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        printf(\"%d \", id[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, b[1000], a[26] = {0}, max;\n  char str[1000][30];\n  int i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], str[i]);\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      t = str[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  t = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 'A' + t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] == 'A' + t)\n        printf(\"%d\\n\", b[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2528", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000] = {0}, c[27] = {0}, i, j, k, m, p, d[1000] = {0};\n  char b[1000][30] = {{0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 1; k <= 26; k++) {\n        if (b[i][j] == 64 + k)\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n  m = c[1];\n  p = 1;\n  for (i = 1; i < 27; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i][j] == 64 + p)\n        d[i] = 1;\n    }\n  }\n  printf(\"%c\\n\", 64 + p);\n  printf(\"%d\\n\", m);\n  for (i = 0; i < 1000; i++) {\n    if (d[i] == 1)\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2529", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  char z[30];\n  int n;\n} s[1000];\nstruct {\n  int name;\n  int nb, b[1000], k;\n} r[93];\n\nint main() {\n  int m, i, j, l, q;\n  for (i = 65; i <= 90; i++) {\n    r[i].name = i;\n    r[i].k = 1;\n  }\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> s[i].n >> s[i].z;\n    l = strlen(s[i].z);\n    for (j = 0; j < l; j++) {\n      q = s[i].z[j];\n      r[q].nb++;\n      r[q].b[r[q].k] = s[i].n;\n      r[q].k++;\n    }\n  }\n  for (i = 65; i < 90; i++)\n    for (j = 90; j > i; j--)\n      if (r[j].nb > r[j - 1].nb) {\n        r[92] = r[j];\n        r[j] = r[j - 1];\n        r[j - 1] = r[92];\n      }\n  printf(\"%c\\n%d\\n\", r[65].name, r[65].nb);\n  for (i = 1; i <= r[65].nb; i++)\n    printf(\"%d\\n\", r[65].b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2530", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sh[100], a[26] = {0}, b[26][100];\n  int max, t, m;\n  char ch[100][40] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &sh[i], ch[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < 40; j++) {\n      m = ch[i][j];\n      if (m > 64 && m < 91) {\n        a[m - 65]++;\n        b[m - 65][a[m - 65]] = sh[i];\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 65 + t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 1; i <= a[t]; i++) {\n    printf(\"%d\\n\", b[t][i]);\n  }\n}\n"}
{"label": "2", "index": "2531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int m, i, j, k;\n  char s[26];\n  int w[26] = {0};\n  int len[1000];\n  int max, most;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    s[i] = 'A' + i;\n  }\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == s[k])\n          w[k]++;\n      }\n    }\n  }\n  max = w[0];\n  most = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      most = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", s[most], max);\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].author[j] == s[most]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[1000], len[1000], num1[1000][26] = {0}, sum[26] = {0},\n                                        max = 0, m;\n  char writer[1000][26],\n      letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &num[i], writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (writer[j][k] == letter[i]) {\n          num1[j][i]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + num1[j][i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[m], sum[m]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == letter[m]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n};\nint main() {\n  int n, i, j, l, sum[26], t = 0, T = 0;\n  struct book a[1000];\n  memset(sum, 0, sizeof(sum));\n  char A;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].name;\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      sum[a[i].name[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > t) {\n      t = sum[i];\n      T = i;\n    }\n  }\n  A = 'A' + T;\n  cout << A << endl;\n  cout << t << endl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 27; j++) {\n      if (a[i].name[j] == A)\n        cout << a[i].num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2534", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, s[26][1000], m, i, j, author, max = 0;\n  char b[1000][28];\n  for (i = 0; i < 26; i++)\n    s[i][0] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> a;\n    cin >> b[a];\n    for (j = 0; b[a][j] != '\\0'; j++) {\n      s[b[a][j] - 'A'][0]++;\n      s[b[a][j] - 'A'][s[b[a][j] - 'A'][0]] = a;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i][0] > max) {\n      max = s[i][0];\n      author = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(author + 'A'), max);\n  for (j = 1; j <= max; j++)\n    cout << s[author][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2535", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, mid, l = 0;\n  int d[26], e[26];\n  char c[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  head = p1 = p2 = (struct book *)malloc(1000);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &p1->a, p1->b);\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1 = head;\n  for (j = 0; j < 26; j++) {\n    p1 = head;\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if (p1->b[k] == c[j])\n          l++;\n      }\n      d[j] = l;\n      e[j] = l;\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++) {\n      if (d[j] < d[j + 1]) {\n        mid = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = mid;\n      }\n    }\n  for (i = 0; i < 26; i++) {\n    if (e[i] == d[0])\n      break;\n  }\n  printf(\"%c \", c[i]);\n  printf(\"%d \", d[0]);\n  p1 = head;\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < strlen(p1->b); k++) {\n      if (p1->b[k] == c[i])\n        printf(\"%d \", p1->a);\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2536", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    char num[20];\n    char ren[30];\n    struct book *next;\n  };\n  int n;\n  int a[26] = {0};\n  struct book *head, *p1, *p2;\n  int i, j;\n  char tem;\n  char b[100][30];\n  p1 = (struct book *)malloc(1000);\n  head = p1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", p1->num, p1->ren);\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      int t = p1->ren[j] - 'A';\n      a[t]++;\n    }\n    p1 = p1->next;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      tem = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", tem);\n  p1 = head;\n  int u = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      if (p1->ren[j] == tem) {\n        strcpy(b[u], p1->num);\n        u++;\n      }\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", u);\n  for (i = 0; i < u; i++)\n    printf(\"%s\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[26];\n  struct tushu *next;\n};\nstruct tushu *creat(int n) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 1; i < n; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    cin >> p1->num >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n, num[26] = {0}, *p, i, j, max = 0;\n  char *a;\n  scanf(\"%d\", &n);\n  struct tushu *head, *p1;\n  head = creat(n);\n  p = num;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    a = p1->name;\n    while (p1 != NULL) {\n      for (j = 0; *(a + j) != '\u0000'; j++) {\n        if (*(a + j) == i + 65) {\n          *(p + i) = *(p + i) + 1;\n          break;\n        }\n      }\n      p1 = p1->next;\n      a = p1->name;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (*(p + max) < *(p + i))\n      max = i;\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", *(p + max));\n  p1 = head;\n  a = p1->name;\n  while (p1 != NULL) {\n    for (i = 0; *(a + i) != '\u0000'; i++) {\n      if (*(a + i) == (max + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n    a = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct author {\n  int num;\n  char name[26];\n};\nstruct author ren[100];\n\nint main() {\n  int n, i, j = 0, k = 0, biao, maxzuozhe, p, geshu[26] = {0}, max = 0,\n            maxdeshu[999];\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].num);\n    scanf(\"%s\", ren[i].name);\n  }\n\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(ren[j].name); k++) {\n        if ((i + 'A') == ren[j].name[k])\n          geshu[i] = geshu[i] + 1;\n      }\n    }\n  }\n  for (i = 'A' - 65; i <= 'Z' - 65; i++) {\n    if (max < geshu[i]) {\n      max = geshu[i];\n      biao = i;\n    }\n  }\n  maxzuozhe = 'A' + biao;\n  p = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (k = 0; k <= strlen(ren[i].name); k++) {\n      if (maxzuozhe == ren[i].name[k]) {\n        maxdeshu[p] = ren[i].num;\n        p++;\n        break;\n      }\n    }\n  }\n  printf(\"%c\\n\", maxzuozhe);\n  printf(\"%d\\n\", p);\n  for (i = 0; i <= p - 1; i++)\n    printf(\"%d\\n\", maxdeshu[i]);\n\n  getchar();\n}\n"}
{"label": "2", "index": "2539", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  char num[4];\n  char str[27];\n};\n\nint main(int argc, char *argv[]) {\n  int m, i, j, zimu[26] = {0}, x, max;\n  char p;\n  scanf(\"%d\", &m);\n  struct author *auth = (struct author *)malloc(sizeof(struct author) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", auth[i].num, auth[i].str);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      x = auth[i].str[j] - 65;\n      zimu[x]++;\n    }\n  }\n  max = zimu[0];\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > max) {\n      max = zimu[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", p + 65, max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (auth[i].str[j] == p + 65) {\n        printf(\"%s\\n\", auth[i].num);\n      }\n    }\n  }\n\n  free(auth);\n  return 0;\n}\n"}
{"label": "2", "index": "2540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct books {\n    int book;\n    char writer[20];\n  } bk[1000];\n  int n, i, j, m, max, k, maxw = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bk[i].book >> bk[i].writer;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      k = bk[i].writer[j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxw = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxw + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      if (maxw + 65 == bk[i].writer[j])\n        printf(\"%d\\n\", bk[i].book);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000], d[1000], e[30] = {0};\n  int i, j, k, n, t = 0, max;\n  char c[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> c[i];\n    d[i] = (int)strlen(c[i]);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (c[i][j] == k + 65)\n          e[k] = e[k] + 1;\n  max = e[0];\n  for (k = 1; k < 26; k++) {\n    if (e[k] > max) {\n      t = k;\n      max = e[k];\n    }\n  }\n  printf(\"%c\\n\", t + 65);\n  cout << e[t] << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      if (c[i][j] == t + 65)\n        printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2542", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char zhuzhe[26];\n  int let;\n};\n\nstruct book shu[1000];\n\nint judge(char a, char b) {\n  if (a == b)\n    return (1);\n  else\n    return (0);\n}\n\nint main() {\n  int n, i, j, y, zhi, num;\n  char writer1[26] = {0};\n  char writer2[26] = {0};\n  for (i = 0; i < 26; i++)\n    writer2[i] = i + 65;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> shu[i].num;\n\n    cin >> shu[i].zhuzhe;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      for (y = 0; y < 26; y++)\n        if (writer2[y] == shu[i].zhuzhe[j])\n          writer1[y] = writer1[y] + 1;\n  zhi = 0;\n  num = 0;\n  for (i = 0; i < 26; i++)\n    if (writer1[i] > zhi) {\n      zhi = writer1[i];\n      num = i;\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      if (judge(shu[i].zhuzhe[j], writer2[num]) == 1)\n        shu[i].let = 1;\n  printf(\"%c \", writer2[num]);\n  printf(\"%d \", writer1[num]);\n  for (i = 0; i < n - 1; i++)\n    if (shu[i].let == 1)\n      printf(\"%d \", shu[i].num);\n  if (shu[n - 1].let == 1)\n    printf(\"%d\", shu[n - 1].num);\n  return 0;\n}\n"}
{"label": "2", "index": "2543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, a[1000], c[91], max = 0;\n  char b[1000][26], d;\n  scanf(\"%d \", &m);\n  memset(c, 0, sizeof(c));\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < 26; j++)\n      if (b[i][j] > 0)\n        c[b[i][j]]++;\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > max)\n      max = c[i];\n  for (i = 65; i < 91; i++)\n    if (c[i] == max) {\n      d = i;\n      printf(\"%c\\n%d\\n\", d, max);\n      for (j = 0; j < m; j++)\n        for (k = 0; k < 26; k++)\n          if (b[j][k] == d) {\n            printf(\"%d\\n\", a[j]);\n            break;\n          }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2544", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int a[1000];\n  char s[1000][30], ch;\n  int b[30] = {0};\n  int i, k;\n  int n;\n  int max = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (ch = 'A'; ch <= 'Z'; ch++)\n      if (strchr(s[i], ch) != NULL)\n        b[ch - 65]++;\n\n  for (i = 0; i <= 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  ch = k + 65;\n  for (i = 0; i < n; i++)\n    if (strchr(s[i], ch) != NULL)\n      printf(\"%d\\n\", a[i]);\n}\n"}
{"label": "2", "index": "2545", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n};\n\nint main() {\n  int i, j, k, m, x, a = 0;\n  int count[26] = {0};\n  char y;\n  struct book all[1000];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> all[i].num >> all[i].aut;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] >= 'A' && all[i].aut[j] <= 'Z') {\n        x = (int)(all[i].aut[j] - 'A');\n        count[x]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > a) {\n      a = count[i];\n      k = i;\n    }\n  }\n  y = k + 'A';\n  printf(\"%c\\n%d\\n\", y, a);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] == y) {\n        printf(\"%d\\n\", all[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2546", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int a;\n    char b[20];\n  } book[999];\n  int n, i, k, max, m, j, p;\n  int c[999] = {0};\n  char str1[20], str2[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].a, &book[i].b);\n    m = strlen(book[i].b);\n    strcpy(str1, book[i].b);\n    for (j = 0; j < m; j++)\n      c[str1[j]] = c[str1[j]] + 1;\n  }\n  max = 0;\n  for (p = 65; p < 91; p++) {\n    if (c[p] > max) {\n      max = c[p];\n      k = p;\n    }\n  }\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    strcpy(str2, book[i].b);\n    m = strlen(book[i].b);\n    for (j = 0; j < m; j++) {\n      if (str2[j] == k)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "2547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct book {\n    int num;\n    char author[27];\n  } B[1000];\n  char A;\n  int m, i, j, a[26] = {0}, max;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &B[i].num, B[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      else\n        a[B[i].author[j] - 65]++;\n    }\n  }\n  max = a[0];\n  A = 65;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      A = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\", A, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      if (B[i].author[j] == A)\n        cout << \"\\n\" << B[i].num;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char aut[26];\n};\n\nint main() {\n  int m, i, j, k;\n  int a[27] = {0};\n  struct book cal[1001];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &cal[i].id, cal[i].aut);\n\n  for (j = 65; j < 91; j++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < 27; k++) {\n        if (cal[i].aut[k] == j) {\n          a[j - 65]++;\n        }\n      }\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (cal[i].aut[j] == t + 65)\n        printf(\"%d\\n\", cal[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char a[26];\n  };\n  int n, i, j, k, q = 0;\n  int b[26] = {0}, c[26];\n  scanf(\"%d\", &n);\n  struct book *p;\n  p = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &p[i].m, p[i].a);\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < 26; k++)\n        if (p[j].a[k] == 'A' + i)\n          b[i] = b[i] + 1;\n  for (i = 0; i < 26; i++)\n    c[i] = b[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n  for (i = 0; i < 26; i++)\n    if (c[i] == b[25]) {\n      printf(\"%c\\n%d\\n\", 'A' + i, b[25]);\n      for (j = 0; j < n; j++)\n        for (k = 0; k < 26; k++)\n          if (p[j].a[k] == 'A' + i)\n            cout << p[j].m << \"\\n\";\n    }\n  free(p);\n}\n"}
{"label": "2", "index": "2550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, c, big = 0;\n  int num[30] = {0}, a[1000];\n  char name[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], name[i]);\n\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(name[i]); j++) {\n        if (name[i][j] == k + 'A')\n          num[k] = num[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (big < num[i]) {\n      big = num[i];\n      c = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", big);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == c)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2551", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int num;\n    char zuozhe[27];\n  } ts[999];\n\n  int i, j, n, k, temp;\n  int count[26] = {0};\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> ts[i].num >> ts[i].zuozhe;\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      count[ts[i].zuozhe[j] - 65]++;\n    }\n  }\n  temp = count[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > temp) {\n      k = i;\n      temp = count[i];\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", count[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      if (ts[i].zuozhe[j] == k + 65) {\n        printf(\"%d\\n\", ts[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2552", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char name[26];\n  struct inf *next;\n};\n\nint m;\nstruct inf *creat(void) {\n  struct inf *head, *p1, *p2;\n  int n;\n  p1 = p2 = (struct inf *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  n = 0;\n  while (1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (n == m)\n      break;\n    else {\n      p1 = (struct inf *)malloc(1000);\n      cin >> p1->num >> p1->name;\n    }\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid count(struct inf *head, int o) {\n  struct inf *q1;\n  int *q2, *q3, *q4;\n  char *t1;\n  q1 = head;\n  q2 = (int *)malloc(26 * 1000);\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    *q3 = 0;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      *(q2 + (*t1 - 'A')) = *(q2 + (*t1 - 'A')) + 1;\n    q1 = q1->next;\n  }\n  q4 = q2;\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    if (*q4 < *q3)\n      q4 = q3;\n  printf(\"%c %d \", q4 - q2 + 'A', *q4);\n  q1 = head;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      if (*t1 == (q4 - q2 + 'A'))\n        printf(\"%d \", q1->num);\n    q1 = q1->next;\n  }\n}\n\nint main() {\n  struct inf *head, *s;\n  scanf(\"%d \", &m);\n  head = creat();\n  s = head;\n  count(head, m);\n}\n"}
{"label": "2", "index": "2553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int i;\n  struct book *head;\n  struct book *p1, *p2;\n  p1 = p2 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->name;\n  head = NULL;\n\n  for (i = 0; i < n - 1; i++) {\n\n    if (i == 0)\n      head = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, n, a[26] = {0}, max = 0, j, k = 0;\n  char t;\n  struct book *p, *p1;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  p1 = p;\n  for (j = 0; j < n; j++) {\n    for (i = 0; *(p->name + i) != '\\0'; i++)\n      a[*(p->name + i) - 65] = a[*(p->name + i) - 65] + 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (k + 65), max);\n  t = (char)(k + 65);\n  while (p1 != NULL) {\n    for (i = 0; *(p1->name + i) != '\\0'; i++) {\n      if (*(p1->name + i) == t) {\n        cout << p1->num << \"\\n\";\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2554", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n} book[1000];\nint judge(char *a, int b);\nint main(int argc, char *argv[]) {\n  char c;\n  int n = 0, i = 0, j = 0, rec[26] = {0}, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> book[i].num >> book[i].name;\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      if (judge(book[j].name, i) == 1) {\n        rec[i]++;\n      }\n    }\n  }\n  j = 0;\n  k = rec[0];\n  for (i = 0; i < 25; i++) {\n    if (k < rec[i]) {\n      j = i;\n      k = rec[i];\n    }\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, k);\n  for (i = 0; i < n; i++) {\n    if (judge(book[i].name, j) == 1) {\n      printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\nint judge(char *a, int b) {\n  int i = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == 'A' + b)\n      return 1;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct book {\n    int num;\n    char author[27];\n  } B[1000];\n  char A;\n  int m, i, j, a[26] = {0}, max;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> B[i].num >> B[i].author;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      else\n        a[B[i].author[j] - 65]++;\n    }\n  }\n  max = a[0];\n  A = 65;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      A = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\", A, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      if (B[i].author[j] == A)\n        printf(\"\\n%d\", B[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int No;\n    char name[27];\n  } b[1000];\n  int i, j, m;\n  scanf(\"%d\", &m);\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    cin >> b[i].No;\n    scanf(\"%s\", b[i].name);\n  }\n  int n, l, a[26] = {0};\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      n = b[i].name[j];\n      a[n - 65]++;\n    }\n  }\n  int max = 0, x;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  printf(\"%c\\n%d\", x + 65, max);\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      if (b[i].name[j] == x + 65) {\n        printf(\"\\n%d\", b[i].No);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2557", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[27];\n    struct book *next;\n  } *head = 0, *p1, *p2;\n  int total, i, j, sumbook[26] = {0}, len, max;\n  cin >> total;\n  for (i = 0; i < total; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    if (p1 == 0) {\n      printf(\"Memory request failed!\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &p1->num, p1->author);\n    len = strlen(p1->author);\n    for (j = 0; j < len; j++)\n      sumbook[p1->author[j] - 'A']++;\n    if (head)\n      p2->next = p1;\n    else\n      head = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  len = 0;\n  for (i = 0; i < 26; i++) {\n    if (sumbook[i] > len) {\n      len = sumbook[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', sumbook[max]);\n  max += 'A';\n  for (p1 = head; p1; p1 = p1->next) {\n    len = strlen(p1->author);\n    for (i = 0; i < len; i++) {\n      if (p1->author[i] == max) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2558", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Book {\n  int id;\n  char author[26];\n  int flag;\n} book[1000];\nint main() {\n  int n, i, j, l, max, maxnum;\n  int num = 0;\n  int a[26] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].author;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      a[book[i].author[j] - 65]++;\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c\\n\", maxnum + 65);\n  for (i = 0; i < n; i++) {\n    book[i].flag = 0;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      if (book[i].author[j] == maxnum + 65) {\n        num++;\n        book[i].flag = 1;\n        break;\n      }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < n; i++)\n    if (book[i].flag == 1)\n      printf(\"%d\\n\", book[i].id);\n  return 0;\n}\n"}
{"label": "2", "index": "2559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  } input[1000];\n\n  scanf(\"%d\", &n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    cin >> input[i].number >> input[i].author;\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2560", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int ISBN;\n  char name[26];\n} b[999];\nint main() {\n  int i, j, m, k[26], max = 0;\n  char a, d = 'A';\n  for (i = 0; i < 26; i++)\n    k[i] = 0;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].ISBN, b[i].name);\n  for (a = 'A'; a <= 'Z'; a++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < 26; j++)\n        if (b[i].name[j] == a)\n          k[a - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (k[i] >= max)\n      max = k[i];\n  for (i = 0; i < 26; i++)\n    if (k[i] == max) {\n      d += i;\n      printf(\"%c\\n\", d);\n      printf(\"%d\\n\", max);\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++) {\n      if (b[i].name[j] == d)\n        printf(\"%d\\n\", b[i].ISBN);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2561", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int num;\n  char author[26];\n};\n\nint main() {\n  struct shu shu[999];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> shu[i].num >> shu[i].author;\n  int a[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == 'A')\n        a[0] = a[0] + 1;\n      else if (shu[i].author[j] == 'B')\n        a[1] = a[1] + 1;\n      else if (shu[i].author[j] == 'C')\n        a[2] = a[2] + 1;\n      else if (shu[i].author[j] == 'D')\n        a[3] = a[3] + 1;\n      else if (shu[i].author[j] == 'E')\n        a[4] = a[4] + 1;\n      else if (shu[i].author[j] == 'F')\n        a[5] = a[5] + 1;\n      else if (shu[i].author[j] == 'G')\n        a[6] = a[6] + 1;\n      else if (shu[i].author[j] == 'H')\n        a[7] = a[7] + 1;\n      else if (shu[i].author[j] == 'I')\n        a[8] = a[8] + 1;\n      else if (shu[i].author[j] == 'J')\n        a[9] = a[9] + 1;\n      else if (shu[i].author[j] == 'K')\n        a[10] = a[10] + 1;\n      else if (shu[i].author[j] == 'L')\n        a[11] = a[11] + 1;\n      else if (shu[i].author[j] == 'M')\n        a[12] = a[12] + 1;\n      else if (shu[i].author[j] == 'N')\n        a[13] = a[13] + 1;\n      else if (shu[i].author[j] == 'O')\n        a[14] = a[14] + 1;\n      else if (shu[i].author[j] == 'P')\n        a[15] = a[15] + 1;\n      else if (shu[i].author[j] == 'Q')\n        a[16] = a[16] + 1;\n      else if (shu[i].author[j] == 'R')\n        a[17] = a[17] + 1;\n      else if (shu[i].author[j] == 'S')\n        a[18] = a[18] + 1;\n      else if (shu[i].author[j] == 'T')\n        a[19] = a[19] + 1;\n      else if (shu[i].author[j] == 'U')\n        a[20] = a[20] + 1;\n      else if (shu[i].author[j] == 'V')\n        a[21] = a[21] + 1;\n      else if (shu[i].author[j] == 'W')\n        a[22] = a[22] + 1;\n      else if (shu[i].author[j] == 'X')\n        a[23] = a[23] + 1;\n      else if (shu[i].author[j] == 'Y')\n        a[24] = a[24] + 1;\n      else if (shu[i].author[j] == 'Z')\n        a[25] = a[25] + 1;\n    }\n  }\n  k = a[0], m = 0;\n  for (i = 0; i < 26; i++) {\n    if (k < a[i]) {\n      k = a[i];\n      m = i;\n    }\n  }\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  printf(\"%c\\n\", b[m]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == b[m]) {\n        printf(\"%d\\n\", shu[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int n;\n  struct book *next;\n};\nstruct au {\n  char n;\n  int s;\n  struct book *p;\n};\nint main() {\n  int i, j, l, n, a[100][1100] = {0}, max = 0, b[100] = {0};\n  char s[30];\n  scanf(\"%d\", &n);\n  for (l = 1; l <= n; l++) {\n    scanf(\"%d\", &j);\n    scanf(\"%s\", s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      b[s[i]]++;\n      a[s[i]][b[s[i]]] = j;\n      if (b[s[i]] > b[max])\n        max = s[i];\n    }\n  }\n  printf(\"%c\\n\", (char)max);\n  printf(\"%d\\n\", b[max]);\n  for (i = 1; i <= b[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n}\n"}
{"label": "2", "index": "2563", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, temp, max;\n  char a[1000][10], b[1000][20], w;\n  int c[26];\n  scanf(\"%d \", &m);\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    temp = 0;\n    for (j = 0; j < 26; j++) {\n      if (c[i] >= c[j]) {\n        temp++;\n      }\n    }\n    if (temp == 26) {\n      max = i;\n      break;\n    }\n  }\n  w = 'A' + i;\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == w) {\n        printf(\"%s\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int at[26] = {0};\n  char c;\n  scanf(\"%d\", &n);\n  struct st {\n    int id;\n    char s[27];\n  } a[999], *p;\n  for (p = a; p < a + n; p++)\n    scanf(\"%d %s\", &p->id, p->s);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c != '\\0')\n        at[c - 65]++;\n      else\n        break;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (at[i] > max) {\n      max = at[i];\n      j = i;\n    }\n  }\n  char x;\n  x = j + 65;\n  printf(\"%c\\n%d\\n\", x, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c == x)\n        printf(\"%d\\n\", a[i].id);\n      if (c == '\\0')\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2565", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(int m) {\n  struct stu *p1, *p2, *xhead;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  xhead = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nint stas(int b[]) {\n  int j, max = 0, indexx = 0;\n  for (j = 0; j < 26; j++)\n    if (b[j] > max) {\n      max = b[j];\n      indexx = j;\n    }\n  printf(\"%c\\n%d\\n\", indexx + 65, max);\n\n  return indexx;\n}\n\nstruct stu *search(struct stu *yhead, int y) {\n  struct stu *q;\n  int sum = 0, k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = yhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < i + k; i++)\n      if (*i == y + 65)\n        sum++;\n    strcpy(s, s0);\n    q = q->next;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n\nstruct stu *print(struct stu *zhead, int z) {\n  struct stu *q;\n  int k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = zhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < s + k; i++)\n      if (*i == z + 65) {\n        printf(\"%d\\n\", q->num);\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n  return 0;\n}\n\nint main() {\n  int n, index;\n  int a[26], k, t, i;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  cin >> n;\n  head = create(n);\n  p = head;\n  while (p) {\n    strcpy(s, p->c);\n\n    k = strlen(s);\n\n    for (i = 0; i < k; i++) {\n\n      t = s[i] - 65;\n      a[t]++;\n    }\n\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  index = stas(a);\n\n  print(head, index);\n  return 0;\n}\n"}
{"label": "2", "index": "2566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, z;\n  char max;\n  int sum[999] = {0};\n  struct student {\n    int a;\n    char b[26];\n    int c[26];\n  } x[999];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i].a;\n    for (j = 0;; j++) {\n      scanf(\"%c\", &x[i].b[j]);\n      if (x[i].b[j] == '\\n') {\n        break;\n      }\n      x[i].c[x[i].b[j] - 65]++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < 999; i++) {\n      sum[k] = sum[k] + x[i].c[k];\n    }\n  }\n\n  z = sum[0];\n  max = 65;\n  for (k = 1; k < 26; k++) {\n    if (sum[k] > z) {\n      max = k + 65;\n      z = sum[k];\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", z);\n  for (i = 0; i < n; i++) {\n    if (x[i].c[max - 65] > 0) {\n      printf(\"%d\\n\", x[i].a);\n    }\n  }\n\n  cin >> i;\n  return 0;\n}\n"}
{"label": "2", "index": "2567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n  } a[400];\n  int i, n, max = 0, j, k, l, y[400], p;\n  char u;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].x, a[i].z);\n    y[i] = strlen(a[i].z);\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < y[i]; j++) {\n      p = 1;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (a[i].z[j] == a[k].z[l])\n            p++;\n      }\n      if (p > max) {\n        max = p;\n        u = a[i].z[j];\n      }\n    }\n  }\n  cout << u << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == a[i].z[j]) {\n        printf(\"%d\\n\", a[i].x);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[999], m, i, j, c[26], max = 0, d, k;\n  scanf(\"%d\\n\", &m);\n  for (k = 0; k < 26; k++) {\n    c[k] = 0;\n  }\n  struct books {\n    int num;\n    char name[26];\n  } books[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &books[i].num, books[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      c[books[i].name[j] - 'A']++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (c[k] > max) {\n      max = c[k];\n      d = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      if (books[i].name[j] == d + 'A') {\n        printf(\"%d\\n\", books[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char s[27];\n} shu[1000];\nint main() {\n  int n, i, l, j, max;\n  char name;\n  int letter[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &shu[i].num, &shu[i].s);\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      letter[(shu[i].s[j] - 65)]++;\n    }\n  }\n  for (max = letter[0], name = 65, i = 1; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      name = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < n; i++) {\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      if (shu[i].s[j] == name) {\n        cout << shu[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    char num[100], wri[26];\n  } bo[1000];\n  int i, j, k, l, n, m = 0, a[26] = {0}, mw;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", bo[i].num, bo[i].wri);\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      a[bo[i].wri[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i] > m) {\n      m = a[i];\n      mw = 65 + i;\n    }\n  printf(\"%c\\n%d\\n\", mw, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      if (bo[i].wri[j] == mw) {\n        puts(bo[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, d[1000];\n  char zuo[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> n;\n  char s[1000][26], len;\n  int sum[26] = {0}, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &d[i], s[i]);\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (s[i][j] == 'A' + k)\n          sum[k]++;\n      }\n    }\n  }\n  int max = 0, count = 0;\n  char maxid;\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      maxid = i + 'A';\n    }\n  }\n  cout << maxid << \"\\n\" << max << \"\\n\";\n  int t[1000];\n  for (i = 0; i < n; i++) {\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      if (s[i][j] == maxid) {\n        count++;\n        t[count] = d[i];\n      }\n    }\n  }\n  for (i = 1; i <= count; i++)\n    cout << t[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint trans(char k) {\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\n\nint main() {\n  int m;\n  cin >> m;\n  struct point {\n    int id;\n    char au[26];\n  } books[1000];\n  int num[26];\n  int i;\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n\n  int j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &books[i].id, books[i].au);\n  }\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      int b;\n      b = trans(books[i].au[j]);\n      num[b]++;\n    }\n  }\n  int max = 0;\n  int most;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      most = i;\n    }\n  }\n  char aumost;\n  aumost = 'A' + most;\n  cout << aumost << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      if (books[i].au[j] == 'A' + most) {\n        printf(\"%d\\n\", books[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct index {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, a[26], *pr, max;\n  char s[26], *sp, *pt, temp;\n  for (pr = a; pr < a + 26; pr++) {\n    *pr = 0;\n  }\n  sp = s;\n  *sp = 65;\n  for (sp = s + 1; sp < s + 26; sp++) {\n    *sp = *(sp - 1) + 1;\n  }\n  struct index *p;\n  scanf(\"%d\", &n);\n  struct index *ind = (struct index *)malloc(sizeof(struct index) * n);\n  for (p = ind; p < ind + n; p++) {\n    cin >> p->num >> p->wr;\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n        if (*pt == *sp) {\n          (*pr)++;\n        }\n      }\n    }\n  }\n  max = *a;\n  temp = 65;\n  for (pr = a, sp = s; pr < a + 26; pr++, sp++) {\n    if (*pr > max) {\n      max = *pr;\n      temp = *sp;\n    }\n  }\n  for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n    if (*pr == max) {\n      cout << *sp << \"\\n\" << *pr << \"\\n\";\n    }\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      if (*pt == temp) {\n        cout << (*p).num << \"\\n\";\n      }\n    }\n  }\n  free(ind);\n  return 0;\n}\n"}
{"label": "2", "index": "2574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n} shu[999];\n\nint main(int argc, char *argv[]) {\n  int m, b, i, *p;\n  char c;\n  int writer[26];\n  char max(int *p);\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2575", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[26];\n  struct tushu *next;\n};\nstruct tushu *creat(int n) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 1; i < n; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    cin >> p1->num >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n, num[26] = {0}, *p, i, j, max = 0;\n  char *a;\n  scanf(\"%d\", &n);\n  struct tushu *head, *p1;\n  head = creat(n);\n  p = num;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    a = p1->name;\n    while (p1 != NULL) {\n      for (j = 0; *(a + j) != '\u0000'; j++) {\n        if (*(a + j) == i + 65) {\n          *(p + i) = *(p + i) + 1;\n          break;\n        }\n      }\n      p1 = p1->next;\n      a = p1->name;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (*(p + max) < *(p + i)) {\n      max = i;\n    }\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", *(p + max));\n  p1 = head;\n  a = p1->name;\n  while (p1 != NULL) {\n    for (i = 0; *(a + i) != '\u0000'; i++) {\n      if (*(a + i) == (max + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n    a = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2576", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct bookst {\n    int Num;\n    char name[26];\n  };\n  struct bookst *book;\n  int cnt[26], num, i, j, max = 0, max_idx = 0;\n  for (i = 0; i < 26; i++)\n    cnt[i] = 0;\n  scanf(\"%d\", &num);\n  book = (struct bookst *)malloc(num * sizeof(struct bookst));\n  for (i = 0; i < num; i++) {\n    scanf(\"%d%s\", &book[i].Num, book[i].name);\n    for (j = 0; book[i].name[j] != 0; j++)\n      cnt[book[i].name[j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      max_idx = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max_idx, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; book[i].name[j] != 0; j++) {\n      if (book[i].name[j] == 'A' + max_idx)\n        printf(\"%d\\n\", book[i].Num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2577", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int haoma;\n  char b[26];\n  struct shu *next;\n};\n\nint main() {\n  int n, i, a[26], c[26][100], max;\n  int *s, (*q)[100];\n  s = a;\n  q = c;\n  char m[26];\n  struct shu *head, *p;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  head = (struct shu *)malloc(n * sizeof(shu));\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    (p + i)->next = p + i + 1;\n  }\n  (p + n - 1)->next = 0;\n  p = head;\n  for (; p != 0;) {\n    cin >> p->haoma >> p->b;\n    strcpy(m, p->b);\n    for (i = 0; *(m + i) != '\\0'; i++) {\n      *(*(q + *(m + i) - 65) + *(s + *(m + i) - 65)) = p->haoma;\n\n      *(s + *(m + i) - 65) += 1;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(a + i) > max) {\n      max = *(a + i);\n      n = i;\n    }\n  printf(\"%c\\n\", n + 65);\n  printf(\"%d\\n\", *(a + n));\n  for (i = 0; i < *(a + n); i++)\n    printf(\"%d\\n\", *(*(q + n) + i));\n}\n"}
{"label": "2", "index": "2578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n  struct book *next;\n};\nint main() {\n  int n, i, j, a[26] = {0}, max, temp; \n  char c;\n  struct book *p, *head, *tail;\n  scanf(\"%d\", &n);\n  head = NULL;\n  tail = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p->num, p->writer);\n    if (head == NULL) \n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n  }\n  for (c = 'A'; c <= 'Z'; c++) {\n    for (i = 0, p = head; i < n; i++, p = p->next) {\n      for (j = 0; p->writer[j] != '\u0000'; j++)\n        if (p->writer[j] == c)\n          a[c - 'A']++; \n    } \n  }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max)\n      break;\n  c = i + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", a[i]);\n  for (i = 0, p = head; i < n; i++, p = p->next) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == c) {\n        printf(\"%d \", p->num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2579", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n};\nchar max(int *p);\n\nint main() {\n  int m, b, i, *p;\n  struct book shu[999];\n  char c;\n  int writer[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "2580", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct list_1 {\n  int book;\n  char name[30];\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[26];\n  struct list_1 shelf[n];\n  for (i = 0; i <= 25; i++)\n    a[i] = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &shelf[i].book, shelf[i].name);\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++)\n      a[shelf[i].name[j] - 'A']++;\n  }\n  int max, flag = 0, add = 0, temp = 0;\n  max = a[0];\n  for (i = 0; i <= 25; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      flag = i;\n    }\n  }\n  printf(\"%c \", flag + 'A');\n  printf(\"%d \", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A')\n        add++;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A') {\n        printf(\"%d\", shelf[i].book);\n        temp++;\n        (temp < add) ? printf(\" \") : printf(\"\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n\n  struct author_book {\n    int count;\n    int book[999];\n  } au[26];\n\n  for (int k = 0; k < 26; k++) {\n    au[k].count = 0;\n  }\n\n  int m;\n  cin >> m;\n\n  for (int i = 1; i <= m; i++) {\n    int num;\n    char a[26];\n    cin >> num;\n    cin.get();\n    cin.getline(a, 26);\n    for (int k = 0; k < strlen(a); k++) {\n      int author_r = (int)(a[k] - 'A'); \n      au[author_r].book[au[author_r].count] = num;\n      au[author_r].count++;\n    }\n  }\n\n  \n  int max = 0;\n  int the_one = 0;\n  for (int i = 0; i < 26; i++) {\n    \n    if (au[i].count > max) {\n      max = au[i].count;\n      the_one = i;\n    }\n  }\n\n  \n  char maxau = 'A' + the_one;\n  cout << maxau << endl;\n  cout << au[the_one].count << endl;\n  \n  for (int i = 0; i < au[the_one].count; i++) {\n    cout << au[the_one].book[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char au[30];\n  struct book *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->au);\n  p2 = p1;\n  head = p1;\n  int n = 1;\n  while (n < m) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->au);\n    p2->next = p1;\n    p2 = p1;\n    n++;\n  }\n  p2->next = NULL;\n  char maxa;\n  char author;\n  char temp[30];\n  int an, maxn = 0, i;\n  struct book *p;\n  for (author = 'A'; author <= 'Z';) {\n    p = head;\n    an = 0;\n    while (p) {\n      strcpy(temp, p->au);\n\n      for (i = 0; (temp[i]) != '\u0000'; i++) {\n        if (temp[i] == author) {\n          an++;\n          break;\n        }\n      }\n      p = p->next;\n    }\n    if (an > maxn) {\n      maxa = author;\n      maxn = an;\n    }\n    author = author + 1;\n  }\n  printf(\"%c %d\", maxa, maxn);\n  p = head;\n  while (p) {\n    strcpy(temp, p->au);\n    for (i = 0; (temp[i]) != '\u0000'; i++) {\n      if (temp[i] == maxa) {\n        printf(\" \");\n        printf(\"%d\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2583", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char w[26];\n  struct book *next;\n};\nint c[26], m, i, j = 0, max_1;\n\nstruct book *creat(int m) {\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->w);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->w);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nvoid a(struct book *head) {\n  struct book *p;\n  char *x;\n  int l, ch;\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      l = (int)*x;\n      ch = l - 65;\n\n      if (ch >= 0)\n        c[ch] = c[ch] + 1;\n    }\n    p = p->next;\n  }\n}\n\nint main() {\n  struct book *head, *p;\n  struct book *creat(int m);\n  void a(struct book * head);\n  char writer, *x;\n  int wri, b[200];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 200; i++)\n    b[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  a(head);\n  max_1 = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max_1) {\n      wri = i + 65;\n      max_1 = c[i];\n    }\n  }\n  printf(\"%c \", wri);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      if (*x == (char)wri) {\n        b[j] = p->num;\n        j = j + 1;\n        break;\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%d \", j);\n  for (j = 0; b[j] > 0; j++)\n    printf(\"%d \", b[j]);\n}\n"}
{"label": "2", "index": "2584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, a[1000] = {0}, count[30] = {0}, temp, j, max = -999, flag;\n  char s[1000][30] = {0}, cha;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < 30; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = 0;\n        continue;\n      }\n      if (s[i][j] == '\\n') {\n        s[i][j] = 0;\n        break;\n      }\n      temp = s[i][j] - 'A' + 1;\n      count[temp] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] >= max) {\n      flag = i;\n      max = count[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", flag + 64, max);\n  cha = 'A' + flag - 1;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j < 30; j++) {\n      if (s[i][j] == cha)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct SHU {\n  int bh;\n  char bz[26];\n};\n\nint main() {\n  int m, i, j, l, k, p;\n  int name[200] = {0}, max, shuhao[1000];\n  struct SHU shu[1000];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &shu[i].bh, shu[i].bz);\n  }\n  for (i = 0; i < m; i++) {\n    l = strlen(shu[i].bz);\n    for (j = 0; j < l; j++) {\n      name[shu[i].bz[j]]++;\n    }\n  }\n  max = name[0];\n  for (i = 0; i < 200; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      k = i;\n    }\n  }\n  p = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].bz[j] == k) {\n        shuhao[p] = shu[i].bh;\n        p++;\n      }\n    }\n  }\n  printf(\"%c\\n\", k);\n  cout << max << \"\\n\";\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", shuhao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n  } a[400];\n  int i, n, max = 0, j, k, l, y[400], p;\n  char u;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].x, a[i].z);\n    y[i] = strlen(a[i].z);\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < y[i]; j++) {\n      p = 1;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (a[i].z[j] == a[k].z[l])\n            p++;\n      }\n      if (p > max) {\n        max = p;\n        u = a[i].z[j];\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", u, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == a[i].z[j]) {\n        printf(\"%d\\n\", a[i].x);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2587", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    char num[20];\n    char ren[30];\n    struct book *next;\n  };\n\n  int n;\n  int a[26] = {0};\n  struct book *head, *p1, *p2;\n  int i, j;\n  char tem;\n  char b[100][30];\n\n  p1 = (struct book *)malloc(1000);\n  head = p1;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> p1->num >> p1->ren;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    p2->next = p1;\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      int t = p1->ren[j] - 'A';\n      a[t]++;\n    }\n    p1 = p1->next;\n  }\n\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      tem = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", tem);\n  p1 = head;\n  int u = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(p1->ren); j++) {\n      if (p1->ren[j] == tem) {\n        strcpy(b[u], p1->num);\n        u++;\n      }\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", u);\n\n  for (i = 0; i < u; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n}\n"}
{"label": "2", "index": "2588", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char aut[100];\n} b[200000];\nint count_1[1000] = {0};\n\nint main() {\n  int n, max = 0, maxnum, i, j, f;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      count_1[b[i].aut[j]]++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (count_1[i] > max) {\n      max = count_1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c %d \", maxnum, max);\n  for (i = 1; i <= n; i++) {\n    f = 0;\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      if (b[i].aut[j] == maxnum) {\n        f = 1;\n      }\n    }\n    if (f == 1) {\n      printf(\"%d \", b[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, p;\n  int a[1000];\n  scanf(\"%d\", &n);\n  struct book {\n    int m;\n    char c[27];\n  };\n  struct book b[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i].m);\n    scanf(\"%s\", b[i].c);\n  }\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++)\n      a[b[i].c[j] - 'A']++;\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (max == a[i])\n      p = i;\n  }\n  p = p + 'A';\n  printf(\"%c\\n\", p);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++) {\n      if (b[i].c[j] == p)\n        printf(\"%d\\n\", b[i].m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct {\n    int num;\n    char author[26];\n  } book[1000];\n  int shu_num[26], i, j, k, n, max, length;\n  char max_author;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  for (k = 0; k < 26; k++) {\n    shu_num[k] = 0;\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      length = strlen(book[i].author);\n      for (j = 0; j < length; j++) {\n        if (book[i].author[j] == 'A' + k) {\n          shu_num[k]++;\n        }\n      }\n    }\n  }\n  max = shu_num[0];\n  max_author = 'A';\n  for (k = 0; k < 26; k++) {\n    if (shu_num[k] > max) {\n      max = shu_num[k];\n      max_author = 'A' + k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", max_author, max);\n  for (i = 0; i < n; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      if (book[i].author[j] == max_author) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char aut[100];\n} b[200000];\nint count_1[1000] = {0};\n\nint main() {\n  int n, max = 0, maxnum, i, j, f;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      count_1[b[i].aut[j]]++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (count_1[i] > max) {\n      max = count_1[i];\n      maxnum = i;\n    }\n  }\n  cout << maxnum << \" \" << max << \" \";\n  for (i = 1; i <= n; i++) {\n    f = 0;\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      if (b[i].aut[j] == maxnum) {\n        f = 1;\n      }\n    }\n    if (f == 1) {\n      printf(\"%d \", b[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  } input[1000];\n\n  cin >> n;\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    cin >> input[i].number >> input[i].author;\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  cout << max_n + 'A' << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char author[27];\n  struct book *next;\n};\n\nstruct book *creat() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct book *p1, *head, *p0;\n  head = NULL;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p0 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p0->id, p0->author);\n    if (head == NULL) {\n      p1 = p0;\n      head = p1;\n      p0->next = NULL;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n      p1 = p0;\n    }\n  }\n  return (head);\n}\nchar best(struct book *head) {\n  int i, max, a[26];\n  struct book *p;\n  p = head;\n  for (i = 0; i < 26; ++i)\n    a[i] = 0;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      a[p->author[i] - 'A']++;\n      i++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (i == 0)\n      max = i;\n    else if (a[i] > a[max]) {\n      max = i;\n    }\n  }\n  return ('A' + max);\n}\nvoid print(char x, struct book *head) {\n  int i, k = 0;\n  char a = x;\n  struct book *p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        k++;\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", a, k);\n  p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        cout << p->id << \"\\n\";\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  char writer;\n  struct book *head;\n  head = creat();\n  writer = best(head);\n  print(writer, head);\n  return 0;\n}\n"}
{"label": "2", "index": "2594", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[999], i, k[27] = {0}, j, t, m;\n  char b[999][27];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; b[i][j]; j++)\n      k[b[i][j] - 65]++;\n  }\n  t = k[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (k[j] > t) {\n      t = k[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 65, t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j]; j++) {\n      if (b[i][j] == m + 65) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f = 0, c, d;\n  struct aut {\n    int num;\n    char wrt[26];\n  } a[999];\n  char wr[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int g[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].num, a[i].wrt);\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].wrt[j] == wr[k])\n          g[k] = g[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (f < g[i]) {\n      f = g[i];\n      d = i;\n    }\n  }\n\n  cout << wr[d] << \"\\n\" << f << \"\\n\";\n  for (i = 0; i < n; i++) {\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      if (a[i].wrt[j] == wr[d]) {\n        cout << a[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct {\n    int a;\n    char b[26];\n  } num[999];\n  int i, m, j, k;\n  int s[26];\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &num[i].a, num[i].b);\n  }\n  for (k = 0; k < 26; k++) {\n    s[k] = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      k = num[i].b[j] - 'A';\n      s[k]++;\n    }\n  }\n  int first = s[0];\n  int t;\n  for (k = 0; k < 26; k++) {\n    if (s[k] > first) {\n      first = s[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", t + 'A');\n  printf(\"%d\\n\", first);\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      if (num[i].b[j] == (t + 'A')) {\n        printf(\"%d\\n\", num[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int book[1000];\n  char author[1000][10];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> author[i];\n  }\n  int num[26] = {0};\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      num[author[i][j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char maxi;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      maxi = 'A' + i;\n    }\n  }\n  cout << maxi << endl;\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        sum++;\n      }\n    }\n  }\n  cout << sum << \"\\n\";\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        cout << book[i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Book {\n  int id;\n  char author[26];\n  int flag;\n} book[1000];\nint main() {\n  int n, i, j, l, max, maxnum;\n  int num = 0;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      a[book[i].author[j] - 65]++;\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%d\\n\", maxnum + 65);\n  for (i = 0; i < n; i++) {\n    book[i].flag = 0;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      if (book[i].author[j] == maxnum + 65) {\n        num++;\n        book[i].flag = 1;\n        break;\n      }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < n; i++)\n    if (book[i].flag == 1)\n      printf(\"%d\\n\", book[i].id);\n  return 0;\n}\n"}
{"label": "2", "index": "2599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, j, k, id[1001], a[26] = {0};\n  char c[1001][26],\n      b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++)\n    scanf(\"%d %s\", &id[j], &c[j]);\n\n  for (m = 0; m < 26; m++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[m] == c[j][k])\n          a[m] = a[m] + 1;\n      }\n    }\n  }\n  int t = 0, r = 0;\n  for (m = 0; m <= 25; m++) {\n    if (t < a[m]) {\n      t = a[m];\n      r = m;\n    }\n  }\n  cout << b[r] << \" \" << a[r];\n  for (j = 1; j <= n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (c[j][k] == b[r])\n        printf(\" %d\", id[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2600", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int num;\n  char name[27];\n} book[999];\nstruct {\n  int cishu;\n} ren[26];\nint main() {\n  int n, zimu, a, b, i, j;\n  int sz[26];\n  char m;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].name[j] != '\\0'; j++) {\n      zimu = book[i].name[j] - 65;\n      ren[zimu].cishu++;\n    }\n  }\n  a = 0;\n  b = ren[0].cishu;\n  for (i = 1; i < 26; i++) {\n    if (ren[i].cishu > b) {\n      a = i;\n      b = ren[i].cishu;\n    }\n  }\n  m = a + 65;\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", b);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].name[j] == m) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct shu {\n  int hao;\n  char zuo[26];\n  struct shu *next;\n};\nint main() {\n  int m, a[26] = {0}, i, j, b[26][1000], k, max;\n  struct shu *p1, *p2, *head = NULL, *p;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct shu *)malloc(1000);\n  scanf(\"%d %s\", &p1->hao, p1->zuo);\n  head = p1;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d %s\", &p1->hao, p1->zuo);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0, max = 0; i <= 25; i++) {\n    for (p = head, k = 1; p != NULL; p = p->next) {\n      for (j = 0; j <= 25; j++)\n        if (p->zuo[j] == 'A' + i) {\n          a[i]++;\n          b[i][k] = p->hao;\n          k++;\n        }\n    }\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i <= 25; i++) {\n    if (a[i] == max) {\n      printf(\"%c %d \", 'A' + i, max);\n      for (k = 1; k <= max; k++)\n        printf(\"%d \", b[i][k]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct b {\n    int n;\n    char a[26];\n  };\n  struct b b[999];\n  int m, k, i, j, c[26] = {0}, p = 0, q = 0;\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].n, &b[i].a);\n  for (i = 0; i < m; i++)\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      c[x - 65]++;\n  k = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] > k) {\n      k = c[i];\n      p = i;\n    }\n  printf(\"%c\\n\", p + 65);\n  printf(\"%d\\n\", c[p]);\n  for (i = 0; i < m; i++) {\n    q = 0;\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      if (x == p + 65)\n        q = 1;\n    if (q == 1)\n      printf(\"%d\\n\", b[i].n);\n  }\n}\n"}
{"label": "2", "index": "2603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int haoma;\n  char b[26];\n  struct shu *next;\n};\n\nint main() {\n  int n, i, a[26], c[26][100], max;\n  int *s, (*q)[100];\n  s = a;\n  q = c;\n  char m[26];\n  struct shu *head, *p;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  cin >> n;\n  head = (struct shu *)malloc(n * sizeof(shu));\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    (p + i)->next = p + i + 1;\n  }\n  (p + n - 1)->next = 0;\n  p = head;\n  for (; p != 0;) {\n    cin >> p->haoma >> p->b;\n    strcpy(m, p->b);\n    for (i = 0; *(m + i) != '\\0'; i++) {\n      *(*(q + *(m + i) - 65) + *(s + *(m + i) - 65)) = p->haoma;\n\n      *(s + *(m + i) - 65) += 1;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(a + i) > max) {\n      max = *(a + i);\n      n = i;\n    }\n  cout << n + 65 << \"\\n\";\n  printf(\"%d\\n\", *(a + n));\n  for (i = 0; i < *(a + n); i++) {\n    printf(\"%d\\n\", *(*(q + n) + i));\n  }\n}\n"}
{"label": "2", "index": "2604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max, p;\n  int mwj;\n  int shu[1000];\n  char zuo[1000][30];\n  int w[26];\n  for (i = 0; i < 26; i++)\n    w[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i], zuo[i]);\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      w[(zuo[i][j] - 65)] = w[(zuo[i][j] - 65)] + 1;\n    }\n  }\n  max = w[0];\n  p = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p + 65);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      mwj = zuo[i][j];\n      if (mwj == p + 65) {\n        printf(\"%d\\n\", shu[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Book {\n  int id;\n  char author[26];\n  int flag;\n} book[1000];\nint main() {\n  int n, i, j, l, max, maxnum;\n  int num = 0;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      a[book[i].author[j] - 65]++;\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c\\n\", maxnum + 65);\n  for (i = 0; i < n; i++) {\n    book[i].flag = 0;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      if (book[i].author[j] == maxnum + 65) {\n        num++;\n        book[i].flag = 1;\n        break;\n      }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < n; i++)\n    if (book[i].flag == 1)\n      printf(\"%d\\n\", book[i].id);\n  return 0;\n}\n"}
{"label": "2", "index": "2606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[20];\n  struct tushu *next;\n};\nstruct tushu *creat(int m) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, num[26] = {0}, i, max;\n  scanf(\"%d\", &m);\n  struct tushu *head, *p1;\n  head = creat(m);\n  char *x;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    x = p1->name;\n    while (p1 != NULL) {\n      while (*x != '\u0000') {\n        if (*x == (i + 65))\n          num[i] = num[i] + 1;\n        x = x + 1;\n      }\n      p1 = p1->next;\n      x = p1->name;\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[max] < num[i])\n      max = i;\n  }\n  cout << max + 65 << \" \";\n  printf(\"%d \", num[max]);\n  p1 = head;\n  x = p1->name;\n  while (p1 != NULL) {\n    while (*x != '\u0000') {\n      if (*x == (max + 65)) {\n        cout << p1->num << \" \";\n        break;\n      }\n      x = x + 1;\n    }\n    p1 = p1->next;\n    x = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct record {\n  int id;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  struct YyxNode *newNd;\n  if (((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) ||\n      ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL)) {\n    printf(\"Error: memory out! (1)\");\n    exit(-1);\n  }\n\n  newLn->n = 0;\n  newLn->head = newNd;\n  newNd->next = NULL;\n  newLn->tail = newNd;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNd;\n  if ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\");\n    exit(-1);\n  }\n\n  newNd->m_rec = *rec;\n  newNd->next = NULL;\n\n  ln->tail->next = newNd;\n  ln->tail = newNd;\n  ln->n++;\n\n  return ln;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNd, *nextNd;\n  delNd = ln->head->next;\n  for (; delNd != NULL; delNd = nextNd) {\n    nextNd = delNd->next;\n    free(delNd);\n  }\n\n  ln->n = 0;\n  ln->head->next = NULL;\n\n  return ln;\n}\n\nvoid FreeLink(struct YyxLink *ln) {\n  ClearLink(ln);\n  free(ln->head);\n  free(ln);\n}\n\nint main() {\n  struct YyxLink **total;\n  int m;\n  struct record rec;\n  char author[27];\n  int i;\n  char *pch;\n  struct YyxNode *nd;\n\n  if ((total = (struct YyxLink **)malloc(26 * sizeof(struct YyxLink *))) ==\n      NULL) {\n    printf(\"Error: memory out! (3)\\n\");\n    exit(-1);\n  }\n  for (i = 0; i < 26; i++)\n    total[i] = CreateNewLink();\n\n  scanf(\"%d\", &m);\n  for (; m > 0; m--) {\n    scanf(\"%d %s\", &rec.id, author);\n    pch = author;\n    for (; *pch != '\\0'; pch++) {\n      AddNode(total[*pch - 'A'], &rec);\n    }\n  }\n\n  m = 0;\n  for (i = 1; i < 26; i++) {\n    if (total[m]->n < total[i]->n)\n      m = i;\n  }\n  cout << m + 'A' << \"\\n\" << total[m]->n << \"\\n\";\n  nd = total[m]->head->next;\n  for (; nd != NULL; nd = nd->next) {\n    printf(\"%d\\n\", nd->m_rec);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct books {\n    int num;\n    char author[26];\n  } books[999];\n  int n, a[26] = {0}, max, i, j, u, lenth, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &books[i].num, books[i].author);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      for (u = 0; u < 26; u++) {\n        if (books[i].author[j] == 'A' + u)\n          a[u]++;\n      }\n    }\n  }\n  temp = a[0];\n  for (u = 0; u < 26; u++)\n    if (a[u] >= temp) {\n      max = u;\n      temp = a[u];\n    }\n  printf(\"%c\\n%d\\n\", 'A' + max, a[max]);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      if (books[i].author[j] == 'A' + max)\n        printf(\"%d\\n\", books[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct jisuan {\n  int num;\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, m, n, k, e;\n  int count[26] = {0}, author[26];\n  cin >> m;\n  for (i = 0; i < 26; i++)\n    author[i] = 65 + i;\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      e = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = e;\n      e = author[i];\n      author[i] = author[i + 1];\n      author[i + 1] = e;\n    }\n  }\n  cout << author[25] << \" \" << count[25] << \" \";\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == author[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0;\n  scanf(\"%d\", &n);\n  int num[1000];\n  int sum[26];\n  for (i = 0; i < 26; i++) {\n    sum[i] = 0;\n  }\n  char a[1000][27];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &num[i], a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      sum[a[i][j] - 'A'] = sum[a[i][j] - 'A'] + 1;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (sum[i] > sum[max]) {\n      max = i;\n    }\n  }\n\n  printf(\"%c\\n\", max + 'A');\n  printf(\"%d\\n\", sum[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] == max + 'A') {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2611", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct {\n  int num;\n  char au[27];\n} book[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, t, max = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].au);\n    int au_n = strlen(book[i].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[i].au[j] <= 90 && book[i].au[j] >= 65) {\n        int k = book[i].au[j] - 65;\n        a[k]++;\n        if (a[k] > max)\n          max = a[k];\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      char r = i + 65;\n      printf(\"%c\\n%d\\n\", r, max);\n      break;\n    }\n  }\n  for (t = 0; t < m; t++) {\n    int au_n = strlen(book[t].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[t].au[j] == i + 65)\n        printf(\"%d\\n\", book[t].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a[1000], i, n, j, k;\n  scanf(\"%d\", &m);\n  char b[1000][27];\n  int count[26] = {0};\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == k + 65)\n          count[k]++;\n      }\n    }\n  }\n  int max, maxk;\n  max = count[0];\n  maxk = 0;\n  for (k = 0; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      maxk = k;\n    }\n  }\n  char mauthor;\n  mauthor = maxk + 65;\n  printf(\"%c\\n%d\\n\", mauthor, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      if (b[i][j] == mauthor) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    int n;\n    char a[26];\n  };\n  struct b b[999];\n  int m, k, i, j, c[26] = {0}, p = 0, q = 0;\n  char x;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> b[i].n >> b[i].a;\n  for (i = 0; i < m; i++)\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      c[x - 65]++;\n  k = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] > k) {\n      k = c[i];\n      p = i;\n    }\n  printf(\"%c\\n\", p + 65);\n  cout << c[p] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    q = 0;\n    for (j = 0; (x = b[i].a[j]) != '\\0' && j < 26; j++)\n      if (x == p + 65)\n        q = 1;\n    if (q == 1)\n      printf(\"%d\\n\", b[i].n);\n  }\n}\n"}
{"label": "2", "index": "2614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  char name[26];\n  int number;\n} a[1000];\nint main() {\n  int n, i, j, b[26] = {0}, max = 0, t;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].name);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      b[a[i].name[j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (max < b[i])\n      max = b[i];\n  for (i = 0; i < 26; i++)\n    if (max == b[i]) {\n      t = i;\n      break;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, b[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      if (a[i].name[j] == t + 65) {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int m, i, j, max;\n  int sum[26] = {0};\n  scanf(\"%d\", &m);\n  struct book b[m];\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      sum[(b[i].name)[j] - 'A']++;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > sum[max])\n      max = i;\n  printf(\"%c\\n%d\\n\", max + 'A', sum[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if ((b[i].name)[j] == 65 + max)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, p;\n  int a[1000];\n  scanf(\"%d\", &n);\n  struct book {\n    int m;\n    char c[27];\n  };\n  struct book b[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i].m);\n    scanf(\"%s\", b[i].c);\n  }\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++)\n      a[b[i].c[j] - 'A']++;\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (max == a[i])\n      p = i;\n  }\n  p = p + 'A';\n  printf(\"%c\\n\", p);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++) {\n      if (b[i].c[j] == p)\n        printf(\"%d\\n\", b[i].m);\n    }\n  }\n}\n"}
{"label": "2", "index": "2617", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int bianhao;\n  char name[26];\n} shu[999];\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k;\n  int jishu[26] = {0};\n  int beiyong[26];\n  for (i = 0; i < m; i++)\n    cin >> shu[i].bianhao >> shu[i].name;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (shu[j].name[k] == i + 'A')\n          jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    beiyong[i] = jishu[i];\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (beiyong[i] > max)\n      max = beiyong[i];\n  }\n  int t;\n  for (i = 0; i < 26; i++) {\n    if (jishu[i] == max)\n      t = i;\n  }\n  printf(\"%c\\n\", t + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].name[j] == t + 'A')\n        printf(\"%d\\n\", shu[i].bianhao);\n    }\n  }\n}\n"}
{"label": "2", "index": "2618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct A {\n  char num[1000];\n  char B[27];\n};\nint main() {\n  int n, i, a, k, t;\n  int sb[27] = {0};\n  int sb2[27] = {0};\n  char x;\n  scanf(\"%d\", &n);\n  struct A book[999] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].B);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      a = book[i].B[k];\n      if (book[i].B[k] <= 'Z' && book[i].B[k] >= 'A') {\n        sb[a - 64]++;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    sb2[i] = sb[i];\n  }\n  for (i = 1; i < 26; i++) {\n    if (sb[i] > sb[i + 1]) {\n      a = sb[i];\n      sb[i] = sb[i + 1];\n      sb[i + 1] = a;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (sb2[i] == sb[26]) {\n      t = i;\n    }\n  }\n  x = 'A' + t - 1;\n  printf(\"%c\\n%d\\n\", x, sb[26]);\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      if (book[i].B[k] == '\\0')\n        break;\n\n      else if (book[i].B[k] == x)\n        printf(\"%s\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, b[91][1000], max = 0, i, j, k, s, m, writer;\n  struct book bk[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].num, bk[i].wr);\n  }\n  for (i = 0; i < 26; i++) {\n    s = 0;\n    for (j = 0; j < n; j++) {\n      m = strlen(bk[j].wr);\n      for (k = 0; k < m; k++) {\n        if (bk[j].wr[k] == i + 65) {\n          b[i][s] = bk[j].num;\n          s++;\n          k = m;\n        }\n      }\n    }\n    if (s > max) {\n      max = s;\n      writer = i;\n    }\n  }\n  cout << writer + 65 << \"\\n\" << max;\n  for (i = 0; i < max; i++)\n    printf(\"\\n%d\", b[writer][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct list_1 {\n  int book;\n  char name[30];\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  cin >> n;\n  int a[26];\n  struct list_1 shelf[n];\n  for (i = 0; i <= 25; i++)\n    a[i] = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &shelf[i].book, shelf[i].name);\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      a[shelf[i].name[j] - 'A']++;\n    }\n  }\n  int max, flag = 0, add = 0, temp = 0;\n  max = a[0];\n  for (i = 0; i <= 25; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      flag = i;\n    }\n  }\n  printf(\"%c \", flag + 'A');\n  cout << max << \" \";\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A')\n        add++;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A') {\n        printf(\"%d\", shelf[i].book);\n        temp++;\n        (temp < add) ? printf(\" \") : printf(\"\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, amount[26], num[26][1000], num0, max = 0;\n  char a;\n  memset(amount, 0, sizeof(amount));\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num0;\n    cin.get();\n    a = cin.get();\n    while (a != '\\n') {\n      num[a - 65][amount[a - 65]] = num0;\n      amount[a - 65]++;\n      a = cin.get();\n    }\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < amount[i])\n      max = amount[i];\n  for (int i = 0; i < 26; i++)\n    if (max == amount[i]) {\n      a = i + 65;\n      cout << a << endl << max << endl;\n      for (int j = 0; j < max; j++)\n        printf(\"%d\\n\", num[i][j]);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int n;\n  struct book *next;\n};\nstruct au {\n  char n;\n  int s;\n  struct book *p;\n};\nint main() {\n  int i, j, l, n, a[100][1100] = {0}, max = 0, b[100] = {0};\n  char s[30];\n  scanf(\"%d\", &n);\n  for (l = 1; l <= n; l++) {\n    scanf(\"%d\", &j);\n    scanf(\"%s\", s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      b[s[i]]++;\n      a[s[i]][b[s[i]]] = j;\n      if (b[s[i]] > b[max])\n        max = s[i];\n    }\n  }\n  printf(\"%c\\n\", (char)max);\n  printf(\"%d\\n\", b[max]);\n  for (i = 1; i <= b[max]; i++) {\n    printf(\"%d\\n\", a[max][i]);\n  }\n}\n"}
{"label": "2", "index": "2623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char str[200];\n} bk[1000];\nint main() {\n  int m, i, l, k, p = 0, max, maxl;\n  int a[200][1000];\n  int b[200];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].str;\n\n  for (l = 0; l < 26; l++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; bk[i].str[k] != '\\0'; k++) {\n        if ((bk[i].str[k]) == l + 65) {\n          a[l][p] = bk[i].num;\n          p++;\n        }\n      }\n    }\n    b[l] = p;\n    p = 0;\n  }\n  max = b[0];\n  maxl = 0;\n  for (l = 0; l < 26; l++) {\n    if (b[l] > max) {\n      max = b[l];\n      maxl = l;\n    }\n  }\n  printf(\"%c\\n\", maxl + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[maxl][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, b[1000], a[26] = {0}, max;\n  char str[1000][30];\n  int i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], str[i]);\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      t = str[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  t = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      t = i;\n    }\n  }\n  cout << 'A' + t << \"\\n\";\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] == 'A' + t)\n        cout << b[i] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\nint main() {\n  int n, t, i, j;\n  int count[26], max = 0;\n  for (i = 0; i < 26; i++)\n    count[i] = 0;\n  struct book {\n    int num;\n    char man[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].man);\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == 'A')\n        count[0]++;\n      else if (book[i].man[j] == 'B')\n        count[1]++;\n      else if (book[i].man[j] == 'C')\n        count[2]++;\n      else if (book[i].man[j] == 'D')\n        count[3]++;\n      else if (book[i].man[j] == 'E')\n        count[4]++;\n      else if (book[i].man[j] == 'F')\n        count[5]++;\n      else if (book[i].man[j] == 'G')\n        count[6]++;\n      else if (book[i].man[j] == 'H')\n        count[7]++;\n      else if (book[i].man[j] == 'I')\n        count[8]++;\n      else if (book[i].man[j] == 'J')\n        count[9]++;\n      else if (book[i].man[j] == 'K')\n        count[10]++;\n      else if (book[i].man[j] == 'L')\n        count[11]++;\n      else if (book[i].man[j] == 'M')\n        count[12]++;\n      else if (book[i].man[j] == 'N')\n        count[13]++;\n      else if (book[i].man[j] == 'O')\n        count[14]++;\n      else if (book[i].man[j] == 'P')\n        count[15]++;\n      else if (book[i].man[j] == 'Q')\n        count[16]++;\n      else if (book[i].man[j] == 'R')\n        count[17]++;\n      else if (book[i].man[j] == 'S')\n        count[18]++;\n      else if (book[i].man[j] == 'T')\n        count[19]++;\n      else if (book[i].man[j] == 'U')\n        count[20]++;\n      else if (book[i].man[j] == 'V')\n        count[21]++;\n      else if (book[i].man[j] == 'W')\n        count[22]++;\n      else if (book[i].man[j] == 'X')\n        count[23]++;\n      else if (book[i].man[j] == 'Y')\n        count[24]++;\n      else if (book[i].man[j] == 'Z')\n        count[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[t], max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == name[t])\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p;\n  p = (int *)malloc(26 * sizeof(int));\n  struct book {\n    int num;\n    char s[26];\n  } b[999];\n  int n, i, j, ss, max = 0, r;\n  char x;\n  for (ss = 0; ss < 26; ss++)\n    *(p + ss) = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].s);\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      *(p + ((int)b[i].s[j] - 65)) += 1;\n    }\n  }\n  for (r = 0; r < 26; r++)\n    max = max > *(p + r) ? max : *(p + r);\n\n  for (r = 0; r < 26; r++) {\n    if (*(p + r) == max) {\n      printf(\"%c\", (65 + r));\n      x = r;\n      printf(\"\\n\");\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      if ((int)b[i].s[j] - 65 == x)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct information {\n  int a;\n  char s[26];\n  int len;\n} xinxi[1000];\n\nint main() {\n  int n, i, c[26] = {0}, max, t, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> xinxi[i].a >> xinxi[i].s;\n    xinxi[i].len = strlen(xinxi[i].s);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++) {\n      if (xinxi[i].s[j] == 'A')\n        c[1]++;\n      if (xinxi[i].s[j] == 'B')\n        c[2]++;\n      if (xinxi[i].s[j] == 'C')\n        c[3]++;\n      if (xinxi[i].s[j] == 'D')\n        c[4]++;\n      if (xinxi[i].s[j] == 'E')\n        c[5]++;\n      if (xinxi[i].s[j] == 'F')\n        c[6]++;\n      if (xinxi[i].s[j] == 'G')\n        c[7]++;\n      if (xinxi[i].s[j] == 'H')\n        c[8]++;\n      if (xinxi[i].s[j] == 'I')\n        c[9]++;\n      if (xinxi[i].s[j] == 'J')\n        c[10]++;\n      if (xinxi[i].s[j] == 'K')\n        c[11]++;\n      if (xinxi[i].s[j] == 'L')\n        c[12]++;\n      if (xinxi[i].s[j] == 'M')\n        c[13]++;\n      if (xinxi[i].s[j] == 'N')\n        c[14]++;\n      if (xinxi[i].s[j] == 'O')\n        c[15]++;\n      if (xinxi[i].s[j] == 'P')\n        c[16]++;\n      if (xinxi[i].s[j] == 'Q')\n        c[17]++;\n      if (xinxi[i].s[j] == 'R')\n        c[18]++;\n      if (xinxi[i].s[j] == 'S')\n        c[19]++;\n      if (xinxi[i].s[j] == 'T')\n        c[20]++;\n      if (xinxi[i].s[j] == 'U')\n        c[21]++;\n      if (xinxi[i].s[j] == 'V')\n        c[22]++;\n      if (xinxi[i].s[j] == 'W')\n        c[23]++;\n      if (xinxi[i].s[j] == 'X')\n        c[24]++;\n      if (xinxi[i].s[j] == 'Y')\n        c[25]++;\n      if (xinxi[i].s[j] == 'Z')\n        c[26]++;\n    }\n  max = c[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%d\\n\", 64 + t);\n  printf(\"%d\\n\", c[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++)\n      if (xinxi[i].s[j] == 64 + t)\n        printf(\"%d\\n\", xinxi[i].a);\n}\n"}
{"label": "2", "index": "2628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  int i, j, a, n;\n  struct book {\n    int no;\n    char name[30];\n  } book[999];\n  int author1[30] = {0}, author2[30] = {0};\n  char k;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].no >> book[i].name;\n  for (i = 0; i < m; i++) {\n    a = strlen(book[i].name);\n    for (j = 0; j < a; j++) {\n      for (k = 'A'; k <= 'Z'; k++) {\n        if (book[i].name[j] == k)\n          author1[(int)k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    author2[i] = author1[i];\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++) {\n      if (author1[i] < author1[j]) {\n        int tmp;\n        tmp = author1[i];\n        author1[i] = author1[j];\n        author1[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author2[i] == author1[0]) {\n      cout << (char)(65 + i) << \"\\n\";\n      printf(\"%d\\n\", author1[0]);\n      for (j = 0; j < m; j++) {\n        a = strlen(book[j].name);\n        for (n = 0; n < a; n++) {\n          if (book[j].name[n] == (char)(65 + i)) {\n            cout << book[j].no << \"\\n\";\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  int book[1020];\n  scanf(\"%d\", &m);\n  int i;\n  char c;\n  int a[27] = {0};\n  int b[27][1000] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &book[i]);\n    getchar();\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n      a[c - 64] += 1;\n      b[c - 64][i] = 1;\n    }\n  }\n  int max = 0, p;\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n  }\n  cout << p + 64 << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < 1000; i++) {\n    if (b[p][i] == 1)\n      printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int num;\n  char w[26];\n\n} book[999], test[1];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, n, s;\n  char x, c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].w);\n\n  x = 'A';\n  n = 0;\n  c = 'A';\n  while (1) {\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < strlen(book[i].w); j++) {\n        if (book[i].w[j] == x)\n          s++;\n      }\n    }\n\n    if (s > n) {\n      n = s;\n      c = x;\n    }\n    if (x == 'Z') {\n      break;\n    }\n    x++;\n  }\n  printf(\"%c\\n%d\\n\", c, n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].w); j++) {\n      if (book[i].w[j] == c) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int shu;\n  char ppl[27];\n  int a[26][n + 1];\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    memset(ppl, 0, sizeof(ppl));\n    cin >> shu;\n    getchar();\n    cin.getline(ppl, 27, '\\n');\n    for (int j = 0; 'A' <= ppl[j] && ppl[j] <= 'Z'; j++) {\n      a[(int)ppl[j] - (int)'A'][0]++;\n      a[(int)ppl[j] - (int)'A'][a[(int)ppl[j] - (int)'A'][0]] = shu;\n    }\n  }\n  int max = 0, set = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      set = i;\n    }\n  }\n  cout << (char)((int)'A' + set) << endl;\n  printf(\"%d\\n\", max);\n  for (int i = 1; i <= max; i++)\n    cout << a[set][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "2632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][26], t;\n  int b[1000], num[26] = {0}, n, i, j, k, max, l[1000];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> b[i];\n\n    cin >> a[i];\n    l[i] = strlen(a[i]);\n    for (j = 1; j <= l[i]; j++)\n      num[a[i][j] - 'A']++;\n  }\n  for (i = 0; i <= 25; i++)\n    if (num[i] > max) {\n      max = num[i];\n      t = i + 'A';\n    }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= l[i]; j++)\n      if (a[i][j] == t)\n        printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[20];\n};\n\nint main() {\n  int i, j, n, t, max = 0;\n\n  int words[26] = {0};\n  struct book b[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &(b[i].num), &(b[i].aut));\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++) {\n      t = (int)b[i].aut[j] - 65;\n      words[t]++;\n    }\n\n  for (i = 0; i < 26; i++)\n    if (words[i] > max) {\n      max = words[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++)\n      if (b[i].aut[j] == (char)(t + 65))\n        cout << b[i].num << \"\\n\";\n}\n"}
{"label": "2", "index": "2634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a[1000], i, n, j, k;\n  scanf(\"%d\", &m);\n  char b[1000][27];\n  int count[26] = {0};\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == k + 65) {\n          count[k]++;\n        }\n      }\n    }\n  }\n  int max, maxk;\n  max = count[0];\n  maxk = 0;\n  for (k = 0; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      maxk = k;\n    }\n  }\n  char mauthor;\n  mauthor = maxk + 65;\n  cout << mauthor << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      if (b[i][j] == mauthor) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2635", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, t, len, a[26][1000] = {0}, n[26] = {0}, max = 0, num;\n  int i, j;\n  char s[27];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &t, s);\n    len = strlen(s);\n    for (j = 0; j < len; j++) {\n      n[s[j] - 65]++;\n      a[s[j] - 65][i] = t;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (n[j] > max) {\n      max = n[j];\n      num = j;\n    }\n  }\n  printf(\"%c %d \", num + 65, n[num]);\n  for (i = 0; i < m; i++) {\n    if (a[num][i] != 0)\n      printf(\"%d \", a[num][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2636", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[30];\n} book[1200];\nint main() {\n  int n, l, t, a[30];\n  char m;\n  cin >> n;\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].writer;\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      t = book[i].writer[j] - 65;\n      a[t]++;\n    }\n  }\n  t = a[0];\n  l = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i] > t) {\n      l = i;\n      t = a[i];\n    }\n  }\n  m = l + 65;\n  cout << m << endl;\n  cout << t << endl;\n  for (int i = 0; i < 30; i++) {\n    a[i] = 0;\n  }\n  for (int i = 0; i < n; i++) {\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      if (book[i].writer[j] == m)\n        cout << book[i].id << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2637", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  int num[1001];\n\n  char name[1001][27];\n  for (int i = 0; i < m; ++i) {\n    cin >> num[i];\n    cin.get();\n    cin.getline(name[i], 27);\n  }\n  int count[100];\n  memset(count, 0, sizeof(count));\n  int record[27][1000];\n  int start = 0;\n  int i, j;\n  char call;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++)\n      count[name[i][j]]++;\n  }\n  int max = 0;\n  char t;\n  for (char w = 'A'; w <= 'Z'; w++) {\n    if (count[(int)w] > max) {\n      max = count[(int)w];\n      t = w;\n    }\n  }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == t) {\n        cout << num[i] << endl;\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[999];\n  char r[999][26];\n  int b[125] = {0};\n  int n, i, j, maxi, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    scanf(\"%s\", r[i]);\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      b[r[i][j]] = b[r[i][j]] + 1;\n    }\n  }\n  maxi = 65;\n  for (i = 66; i <= 90; i++) {\n    if (b[i] > b[maxi])\n      maxi = i;\n  }\n  printf(\"%c\\n\", maxi);\n  cout << b[maxi] << \"\\n\";\n  for (i = 0; i <= n - 1; i++) {\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      if (r[i][j] == maxi) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char author[27];\n  struct book *next;\n};\n\nstruct book *creat() {\n  int n, i;\n  cin >> n;\n  struct book *p1, *head, *p0;\n  head = NULL;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p0 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p0->id, p0->author);\n    if (head == NULL) {\n      p1 = p0;\n      head = p1;\n      p0->next = NULL;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n      p1 = p0;\n    }\n  }\n  return (head);\n}\nchar best(struct book *head) {\n  int i, max, a[26];\n  struct book *p;\n  p = head;\n  for (i = 0; i < 26; ++i)\n    a[i] = 0;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      a[p->author[i] - 'A']++;\n      i++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (i == 0)\n      max = i;\n    else if (a[i] > a[max])\n      max = i;\n  }\n  return ('A' + max);\n}\nvoid print(char x, struct book *head) {\n  int i, k = 0;\n  char a = x;\n  struct book *p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        k++;\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", a, k);\n  p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        printf(\"%d\\n\", p->id);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  char writer;\n  struct book *head;\n  head = creat();\n  writer = best(head);\n  print(writer, head);\n  return 0;\n}\n"}
{"label": "2", "index": "2640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct b {\n  int na;\n  char au[20];\n} book[1000];\nint main() {\n  int m, i, len[1000], num[128] = {0}, j, max, p = 0;\n  char maxi;\n  int boo[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].na >> book[i].au;\n    len[i] = strlen(book[i].au);\n    for (j = 0; j < len[i]; j++)\n      num[book[i].au[j]]++;\n  }\n  maxi = 'A';\n  max = -1;\n  for (j = 'A'; j <= 'Z'; j++) {\n    if (num[j] > max) {\n      max = num[j];\n      maxi = j;\n    }\n  }\n  printf(\"%c\\n\", maxi);\n  cout << max << \"\\n\";\n  for (i = 0; i < m && p < max; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].au[j] == maxi) {\n        printf(\"%d\\n\", book[i].na);\n        p++;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2641", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct Book {\n    int id;\n    char zz[26];\n  } book[1000];\n\n  int n, i, j, max = 0, index;\n  int sum[26] = {0};\n  char author;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].id, &book[i].zz);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      sum[book[i].zz[j] - 'A']++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      author = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      if (book[i].zz[j] == author) {\n        printf(\"%d\\n\", book[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct books {\n  char num[20];\n  char w[26];\n};\nint main() {\n  int k, j, i, m;\n  int b[150] = {0};\n  scanf(\"%d\", &m);\n  struct books a[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i].num, a[i].w);\n    for (j = 0; a[i].w[j] != '\\0'; j++)\n      b[a[i].w[j]]++;\n  }\n  int max = 0;\n  for (i = 'A', j = 0; i <= 'Z'; i++)\n    if (max < b[i]) {\n      max = b[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  int n = 0;\n  for (i = 0; i < m; i++) {\n    n = 0;\n    for (k = 0; a[i].w[k] != '\\0'; k++)\n      if (a[i].w[k] == j)\n        n = 1;\n    if (n == 1)\n      cout << a[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint main() {\n  struct book *p1, *p2, *head = NULL;\n  int i, j, n, m, k, a[26], max, first;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d%s\", &p1->num, p1->name);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      k = p1->name[j] - 'A';\n      a[k]++;\n    }\n    p1 = p1->next;\n  }\n  max = a[0];\n  first = 0;\n  for (k = 1; k < 26; k++) {\n    if (a[k] > max) {\n      max = a[k];\n      first = k;\n    }\n  }\n  printf(\"%c \", 'A' + first);\n  printf(\"%d \", max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      if (p1->name[j] == 'A' + first) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2644", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d\", &p1->num);\n  scanf(\"%s\", p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head;\n  struct student *p1;\n  char *p2;\n  int i;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == 'A') {\n        a[0] = a[0] + 1;\n      }\n      if ((*p2) == 'B') {\n        a[1] = a[1] + 1;\n      }\n      if ((*p2) == 'C') {\n        a[2] = a[2] + 1;\n      }\n      if ((*p2) == 'D') {\n        a[3] = a[3] + 1;\n      }\n      if ((*p2) == 'E') {\n        a[4] = a[4] + 1;\n      }\n      if ((*p2) == 'F') {\n        a[5] = a[5] + 1;\n      }\n      if ((*p2) == 'G') {\n        a[6] = a[6] + 1;\n      }\n      if ((*p2) == 'H') {\n        a[7] = a[7] + 1;\n      }\n      if ((*p2) == 'I') {\n        a[8] = a[8] + 1;\n      }\n      if ((*p2) == 'J') {\n        a[9] = a[9] + 1;\n      }\n      if ((*p2) == 'K') {\n        a[10] = a[10] + 1;\n      }\n      if ((*p2) == 'L') {\n        a[11] = a[11] + 1;\n      }\n      if ((*p2) == 'M') {\n        a[12] = a[12] + 1;\n      }\n      if ((*p2) == 'N') {\n        a[13] = a[13] + 1;\n      }\n      if ((*p2) == 'O') {\n        a[14] = a[14] + 1;\n      }\n      if ((*p2) == 'P') {\n        a[15] = a[15] + 1;\n      }\n      if ((*p2) == 'Q') {\n        a[16] = a[16] + 1;\n      }\n      if ((*p2) == 'R') {\n        a[17] = a[17] + 1;\n      }\n      if ((*p2) == 'S') {\n        a[18] = a[18] + 1;\n      }\n      if ((*p2) == 'T') {\n        a[19] = a[19] + 1;\n      }\n      if ((*p2) == 'U') {\n        a[20] = a[20] + 1;\n      }\n      if ((*p2) == 'V') {\n        a[21] = a[21] + 1;\n      }\n      if ((*p2) == 'W') {\n        a[22] = a[22] + 1;\n      }\n      if ((*p2) == 'X') {\n        a[23] = a[23] + 1;\n      }\n      if ((*p2) == 'Y') {\n        a[24] = a[24] + 1;\n      }\n      if ((*p2) == 'Z') {\n        a[25] = a[25] + 1;\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  printf(\"%c \", j + 65);\n  printf(\"%d \", a[j]);\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == j + 65) {\n        printf(\"%d \", p1->num);\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "2645", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, temp, max;\n  char a[1000][10], b[1000][20], w;\n  int c[26];\n  scanf(\"%d \", &m);\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    temp = 0;\n    for (j = 0; j < 26; j++) {\n      if (c[i] >= c[j]) {\n        temp++;\n      }\n    }\n    if (temp == 26) {\n      max = i;\n      break;\n    }\n  }\n  w = 'A' + i;\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == w) {\n        printf(\"%s\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, book[1000], cnt[60], max;\n  char author[1000][26], p;\n  int b[60][1000];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < 60; i++)\n    cnt[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i];\n    cin.get();\n    cin.getline(author[i], 26);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; author[i][j] != '\\0'; j++) {\n      int k = author[i][j] - '0';\n      b[k][cnt[k]++] = book[i];\n    }\n  }\n  max = cnt[17];\n  p = 'A';\n  for (int i = 17; i <= 42; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      p = i + '0';\n    }\n  }\n  cout << p << endl;\n  printf(\"%d\\n\", max);\n  for (int m = 0; m < max; m++)\n    printf(\"%d\\n\", b[p - '0'][m]);\n  return 0;\n}\n"}
{"label": "2", "index": "2647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n} book[1000];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, a[27], len, max = 0, number;\n  char p;\n  for (i = 1; i <= 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].name);\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      p = book[i].name[j];\n      a[p - 64] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", number + 64, a[number]);\n  for (i = 1; i <= m; i++) {\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      if (book[i].name[j] == number + 64) {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2648", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int booknumber;\n  int order[1000];\n  char author[1000][27];\n  char single_author[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int author_booknumber[26] = {0};\n  int i, j, k;\n  int tmp;\n\n  cin >> booknumber;\n\n  for (i = 0; i < booknumber; i++) {\n    scanf(\"%d%s\", &order[i], author[i]);\n    for (j = 0; j < strlen(author[i]); j++) {\n      for (k = 0; k < 26; k++) {\n        if (author[i][j] == single_author[k]) {\n          author_booknumber[k]++;\n          break;\n        }\n      }\n    }\n  }\n  tmp = 0;\n\n  for (i = 1; i < 26; i++) {\n    if (author_booknumber[i] > author_booknumber[tmp])\n      tmp = i;\n  }\n  printf(\"%c\\n\", single_author[tmp]);\n  printf(\"%d\\n\", author_booknumber[tmp]);\n\n  for (i = 0; i < booknumber; i++) {\n    for (j = 0; j < strlen(author[i]); j++) {\n      if (author[i][j] == single_author[tmp]) {\n        printf(\"%d\\n\", order[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k = 0;\n  struct {\n    int n;\n    char s[26];\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].n >> book[i].s;\n  int a[26] = {0};\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      a[(int)(book[i].s[j] - 'A')]++;\n  for (i = 1; i < 26; i++)\n    if (a[k] < a[i])\n      k = i;\n  printf(\"%d\\n%d\\n\", k + 'A', a[k]);\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      if (book[i].s[j] == k + 'A') {\n        printf(\"%d\\n\", book[i].n);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2650", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, number, i, j, k, t, len, max;\n  int map[26][1000] = {0};\n  char name[27];\n\n  scanf(\"%d \", &n);\n  for (i = 0; i <= 25; i++)\n    map[i][0] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s \", &number, name);\n    len = strlen(name);\n    for (j = 0; j <= len - 1; j++) {\n      k = name[j] - 'A';\n      map[k][0]++;\n      t = map[k][0];\n      map[k][t] = number;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++) {\n    if (map[i][0] > max) {\n      max = map[i][0];\n      k = i;\n    }\n  }\n  cout << (char)(65 + k) << endl;\n  cout << map[k][0];\n  for (i = 1; i <= map[k][0]; i++)\n    printf(\"\\n%d\", map[k][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w[999][26];\n  char m;\n  int a[999], c[26];\n  int i, j, n, t, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 25; i++) {\n    c[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    scanf(\"%s\", w[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++)\n      c[w[i][j] - 65] += 1;\n  }\n  max = c[0];\n  m = 65;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      m = i + 65;\n    }\n  }\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      if (w[i][j] == m) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ismax(int l[], int a) {\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (l[i] > l[a])\n      return (0);\n  }\n  return (1);\n}\n\nint main() {\n  int i, j, k, n, p, l[26] = {0};\n  struct shu {\n    int num;\n    char auth[100];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].auth);\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 100; k++) {\n        if (book[j].auth[k] == i + 65)\n          l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ismax(l, i) == 1) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 100; j++) {\n      if (book[i].auth[j] == p + 65)\n        cout << book[i].num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char edit[26];\n  struct book *next;\n};\nint m;\nstruct book *head, *p1, *p2;\n\nstruct book *creat(void) {\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->edit);\n  head = p1;\n  p2 = p1;\n  m = m - 1;\n  do {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->edit;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    m = m - 1;\n  } while (m);\n  return (head);\n}\n\nint main() {\n  int max = 0, i = 0, j, k[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      k[(p->edit[i]) - 65] += 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++)\n    if (k[i] > max) {\n      max = k[i];\n      j = i;\n    }\n  cout << j + 65 << \" \" << max << \" \";\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      if (p->edit[i] == j + 65)\n        printf(\"%d \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2654", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[26];\n  int length;\n} zz[999];\nint main() {\n  int n, i, j, k;\n  int letter[26] = {0};\n  int letter_book[26][999] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].id;\n    cin >> zz[i].writer;\n    zz[i].length = strlen(zz[i].writer);\n  }\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < zz[j].length; k++) {\n\n      letter_book[zz[j].writer[k] - 'A'][letter[zz[j].writer[k] - 'A']] =\n          zz[j].id;\n      letter[zz[j].writer[k] - 'A']++;\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      t = i;\n    }\n  }\n  char m;\n  m = 'A' + t;\n  cout << m << endl;\n  cout << max << endl;\n  for (i = 0; i < max; i++)\n    cout << letter_book[t][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2655", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n    struct book *next;\n  } * p1, *p2, *p, *head, *t;\n  int i, n, max = 0, j, k, l, y[400], q;\n  char u;\n  cin >> n;\n  p1 = p2 = head = (struct book *)malloc(sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    cin >> p1->x >> p1->z;\n    y[i] = strlen(p1->z);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < y[i]; j++) {\n      q = 1;\n      t = p->next;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (p->z[j] == t->z[l])\n            q++;\n        t = t->next;\n      }\n      if (q > max) {\n        max = q;\n        u = p->z[j];\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", u, max);\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == p->z[j]) {\n        printf(\"%d\\n\", p->x);\n        break;\n      }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2656", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct fy {\n    int x;\n    char y[26];\n    int s[26];\n    struct fy *z;\n  } sl[1000], *p;\n  int n, i, j, b[26] = {0};\n\n  p = &sl[0];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> sl[i].x >> sl[i].y;\n    for (j = 0; j < strlen(sl[i].y); j++) {\n      sl[i].s[sl[i].y[j] - 'A'] = 1;\n      b[sl[i].y[j] - 'A']++;\n    }\n    sl[i].z = &sl[i + 1];\n  }\n  sl[n - 1].z = NULL;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < 26; j++)\n      if (b[i] < b[j])\n        break;\n    if (j == 26) {\n      j = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", i + 'A', b[j]);\n  while (p != NULL) {\n    if (p->s[i] == 1)\n      printf(\"%d\\n\", p->x);\n    p = p->z;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, j, k, id[1001], a[26] = {0};\n  char c[1001][26],\n      b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%d %s\", &id[j], &c[j]);\n  }\n  for (m = 0; m < 26; m++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[m] == c[j][k])\n          a[m] = a[m] + 1;\n      }\n    }\n  }\n  int t = 0, r = 0;\n  for (m = 0; m <= 25; m++) {\n    if (t < a[m]) {\n      t = a[m];\n      r = m;\n    }\n  }\n  printf(\"%c %d\", b[r], a[r]);\n  for (j = 1; j <= n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (c[j][k] == b[r])\n        cout << \" \" << id[j];\n    }\n  }\n}\n"}
{"label": "2", "index": "2658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char au[30];\n  struct book *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->au);\n  p2 = p1;\n  head = p1;\n  int n = 1;\n  while (n < m) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->au);\n    p2->next = p1;\n    p2 = p1;\n    n++;\n  }\n  p2->next = NULL;\n\n  char maxa;\n  char author;\n  char temp[30];\n  int an, maxn = 0, i;\n  struct book *p;\n\n  for (author = 'A'; author <= 'Z';) {\n    p = head;\n    an = 0;\n    while (p) {\n      strcpy(temp, p->au);\n\n      for (i = 0; (temp[i]) != '\u0000'; i++) {\n        if (temp[i] == author) {\n          an++;\n          break;\n        }\n      }\n      p = p->next;\n    }\n    if (an > maxn) {\n      maxa = author;\n      maxn = an;\n    }\n    author = author + 1;\n  }\n  printf(\"%c %d\", maxa, maxn);\n  p = head;\n  while (p) {\n    strcpy(temp, p->au);\n    for (i = 0; (temp[i]) != '\u0000'; i++) {\n      if (temp[i] == maxa) {\n        printf(\" \");\n        printf(\"%d\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2659", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, len[1000], sum[26] = {0}, max, i, j, i0;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char wri[27];\n  } book[1000];\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].wri;\n    len[i] = strlen(book[i].wri);\n  }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      sum[book[i].wri[j] - 65]++;\n  max = sum[0];\n  i0 = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      i0 = i;\n    }\n  printf(\"%c\\n\", i0 + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (book[i].wri[j] == 65 + i0) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, l, j, max, s[26] = {0};\n  char c[1000][27], w;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j < l; j++) {\n      s[c[i][j] - 65]++;\n    }\n  }\n  max = s[0];\n  w = 'A';\n  for (i = 1; i < 26; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      w = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == w) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char peo[26];\n} book[999];\n\nint main() {\n  char zm, max;\n  int n, i, k, num, cishu = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, &book[i].peo);\n\n  for (zm = 'A'; zm <= 'Z'; zm++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].peo[k] == zm)\n          num++;\n      }\n    }\n    if (num > cishu) {\n      cishu = num;\n      max = zm;\n    }\n  }\n  printf(\"%c\\n\", max);\n  cout << cishu << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (book[i].peo[k] == max)\n        cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j, A[26] = {0}, B[26];\n  char s;\n  cin >> m;\n  struct book {\n    int num;\n    char n[26];\n  } * book;\n  book = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].n;\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      switch (book[i].n[j]) {\n      case 65:\n        A[0]++;\n        break;\n      case 66:\n        A[1]++;\n        break;\n      case 67:\n        A[2]++;\n        break;\n      case 68:\n        A[3]++;\n        break;\n      case 69:\n        A[4]++;\n        break;\n      case 70:\n        A[5]++;\n        break;\n      case 71:\n        A[6]++;\n        break;\n      case 72:\n        A[7]++;\n        break;\n      case 73:\n        A[8]++;\n        break;\n      case 74:\n        A[9]++;\n        break;\n      case 75:\n        A[10]++;\n        break;\n      case 76:\n        A[11]++;\n        break;\n      case 77:\n        A[12]++;\n        break;\n      case 78:\n        A[13]++;\n        break;\n      case 79:\n        A[14]++;\n        break;\n      case 80:\n        A[15]++;\n        break;\n      case 81:\n        A[16]++;\n        break;\n      case 82:\n        A[17]++;\n        break;\n      case 83:\n        A[18]++;\n        break;\n      case 84:\n        A[19]++;\n        break;\n      case 85:\n        A[20]++;\n        break;\n      case 86:\n        A[21]++;\n        break;\n      case 87:\n        A[22]++;\n        break;\n      case 88:\n        A[23]++;\n        break;\n      case 89:\n        A[24]++;\n        break;\n      case 90:\n        A[25]++;\n        break;\n      }\n    }\n  }\n  int k, max;\n\n  for (i = 0; i < 26; i++) {\n    B[i] = A[i];\n  }\n  for (i = 25; i > 0; i--) {\n    if (B[i] > B[i - 1]) {\n      B[i - 1] = B[i];\n\n      max = B[i];\n    } else {\n      max = B[i - 1];\n    }\n  }\n  for (i = 25; i >= 0; i--) {\n    if (A[i] == max)\n      k = i;\n  }\n\n  s = k + 65;\n  printf(\"%c\\n%d\\n\", s, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      if (book[i].n[j] == s) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2663", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct info {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int i, m, j, b[26] = {0};\n  char out;\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\\n\", &a[i].num, a[i].author);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      b[a[i].author[j] - 'A']++;\n  int max = b[0];\n  for (i = 0; i < 26; i++)\n    max = max > b[i] ? max : b[i];\n  for (i = 0; i < 26; i++)\n    if (b[i] == max) {\n      out = 'A' + i;\n      printf(\"%c\\n\", 'A' + i);\n      printf(\"%d\\n\", b[i]);\n      break;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == out) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, max;\n  char name[2000][30], alp[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  int No[2000], num[30] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &No[i], name[i]);\n\n  for (i = 0; i < 26; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < strlen(name[k]); j++) {\n        if (name[k][j] == alp[i]) {\n          num[i]++;\n          break;\n        }\n      }\n    }\n  }\n  max = num[0];\n  for (i = 1; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] == max) {\n      cout << alp[i] << \"\\n\" << max << \"\\n\";\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < 27; j++) {\n          if (name[k][j] == alp[i]) {\n            cout << No[k] << \"\\n\";\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2665", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int mark;\n  char name[26];\n};\nint main() {\n  int m, h, i, j, k, max, length;\n  int t[26];\n  char a;\n  scanf(\"%d \", &m);\n  struct book book[1000];\n  for (i = 0; i < m; i++) {\n    cin >> book[i].mark >> book[i].name;\n  }\n  for (i = 0; i < 26; i++) {\n    a = 'A' + i;\n    t[i] = 0;\n    for (j = 0; j < m; j++) {\n      length = strlen(book[i].name);\n\n      for (h = 0; h < 26; h++)\n        if (a == book[j].name[h]) {\n          t[i]++;\n        }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      k = i;\n    }\n  }\n  a = 'A' + k;\n  printf(\"%c\\n%d\\n\", a, t[k]);\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].name);\n    for (j = 0; j < 26; j++) {\n      if ('A' + k == book[i].name[j])\n        printf(\"%d\\n\", book[i].mark);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[1000], l[1000], count[128], m, max;\n  char edi[1000][26], au[128];\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &num[j]);\n\n    cin >> edi[j];\n    l[j] = strlen(edi[j]);\n  }\n  for (i = 0; i < 128; i++)\n    count[i] = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      m = edi[j][i];\n      au[m] = edi[j][i];\n      count[m]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 128; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\", au[m], max);\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      if (edi[j][i] == au[m])\n        printf(\"\\n%d\", num[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2667", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct author {\n  int num;\n  char name[26];\n};\nstruct author ren[100];\n\nint main() {\n  int n, i, j = 0, k = 0, biao, maxzuozhe, p, geshu[26] = {0}, max = 0,\n            maxdeshu[999];\n\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].num);\n    scanf(\"%s\", ren[i].name);\n  }\n\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(ren[j].name); k++) {\n        if ((i + 'A') == ren[j].name[k])\n          geshu[i] = geshu[i] + 1;\n      }\n    }\n  }\n  for (i = 'A' - 65; i <= 'Z' - 65; i++) {\n    if (max < geshu[i]) {\n      max = geshu[i];\n      biao = i;\n    }\n  }\n  maxzuozhe = 'A' + biao;\n  p = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (k = 0; k <= strlen(ren[i].name); k++) {\n      if (maxzuozhe == ren[i].name[k]) {\n        maxdeshu[p] = ren[i].num;\n        p++;\n        break;\n      }\n    }\n  }\n  printf(\"%c\\n\", maxzuozhe);\n  printf(\"%d\\n\", p);\n  for (i = 0; i <= p - 1; i++)\n    printf(\"%d\\n\", maxdeshu[i]);\n\n  getchar();\n}\n"}
{"label": "2", "index": "2668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, best = 0, max = 0, a[26] = {0}, num[100], l, j, k;\n  char letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                     'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                     'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'},\n       writer[100][26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &num[i], &writer[i]);\n  }\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      for (k = 0; k < 26; k++) {\n        if (writer[i][j] == letter[k]) {\n          a[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      best = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n\", letter[best]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      if (writer[i][j] == letter[best]) {\n        printf(\"%d\\n\", num[i]);\n        ;\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2669", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Article {\n  int number;\n  char author[26];\n};\n\nint main() {\n  struct Article book[1000];\n  int m, i;\n  int j, k;\n  int c;\n  int max = 0;\n  int writer[26] = {0};\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].number, book[i].author);\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].author[j] >= 'A' && book[i].author[j] <= 'Z') {\n        c = book[i].author[j] - 'A';\n        writer[c]++;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max < writer[i])\n      max = writer[i];\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max == writer[i]) {\n      printf(\"%c\\n\", i + 'A');\n      printf(\"%d\\n\", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < 26; k++) {\n          if (book[j].author[k] == i + 'A') {\n            printf(\"%d\\n\", book[j].number);\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2670", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, i, nu, au, M, m;\n  int num[26] = {0};\n  int no[26][999];\n  char aut;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> nu;\n    cin.get();\n    aut = cin.get();\n    while (aut != 10) {\n      au = (int)(aut - 'A');\n      no[au][num[au]] = nu;\n      num[au]++;\n      aut = cin.get();\n    }\n  }\n  M = 0;\n  for (i = 0; i < 26; i++) {\n    if (M < num[i]) {\n      M = num[i];\n      m = i;\n    }\n  }\n  cout << (char)(m + 'A') << endl;\n  cout << M << endl;\n  for (i = 0; i < M; i++)\n    cout << no[m][i] << endl;\n  cin.get();\n  cin.get(); \n  return 0;\n}\n"}
{"label": "2", "index": "2671", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a[1000], i, n, j, k;\n  scanf(\"%d \", &m);\n  char b[1000][27];\n  int count[26] = {0};\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == k + 65) {\n          count[k]++;\n        }\n      }\n    }\n  }\n  int max, maxk;\n  max = count[0];\n  maxk = 0;\n  for (k = 0; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      maxk = k;\n    }\n  }\n  char mauthor;\n  mauthor = maxk + 65;\n  printf(\"%c\\n%d\\n\", mauthor, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j < n; j++) {\n      if (b[i][j] == mauthor) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int number;\n  char author[26];\n  struct book *next;\n};\nint m, i;\nstruct book *creat(void) {\n  struct book *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  for (i = 1; i < m; i++) {\n    scanf(\"%d %s\", &p1->number, p1->author);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d %s\", &p1->number, p1->author);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int j, a[26] = {0}, max;\n  cin >> m;\n  head = creat();\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; i < strlen(p->author); i++)\n      switch (p->author[i]) {\n      case 'A':\n        a[0]++;\n        break;\n      case 'B':\n        a[1]++;\n        break;\n      case 'C':\n        a[2]++;\n        break;\n      case 'D':\n        a[3]++;\n        break;\n      case 'E':\n        a[4]++;\n        break;\n      case 'F':\n        a[5]++;\n        break;\n      case 'G':\n        a[6]++;\n        break;\n      case 'H':\n        a[7]++;\n        break;\n      case 'I':\n        a[8]++;\n        break;\n      case 'J':\n        a[9]++;\n        break;\n      case 'K':\n        a[10]++;\n        break;\n      case 'L':\n        a[11]++;\n        break;\n      case 'M':\n        a[12]++;\n        break;\n      case 'N':\n        a[13]++;\n        break;\n      case 'O':\n        a[14]++;\n        break;\n      case 'P':\n        a[15]++;\n        break;\n      case 'Q':\n        a[16]++;\n        break;\n      case 'R':\n        a[17]++;\n        break;\n      case 'S':\n        a[18]++;\n        break;\n      case 'T':\n        a[19]++;\n        break;\n      case 'U':\n        a[20]++;\n        break;\n      case 'V':\n        a[21]++;\n        break;\n      case 'W':\n        a[22]++;\n        break;\n      case 'X':\n        a[23]++;\n        break;\n      case 'Y':\n        a[24]++;\n        break;\n      case 'Z':\n        a[25]++;\n        break;\n      }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max) {\n      printf(\"%c \", 65 + i);\n      break;\n    }\n  cout << max << \" \";\n  for (p = head; p != NULL; p = p->next)\n    for (j = 0; j < strlen(p->author); j++)\n      if (p->author[j] == 65 + i)\n        printf(\"%d \", p->number);\n}\n"}
{"label": "2", "index": "2673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int book;\n  char author[26];\n  struct a *next;\n};\nstruct a *creat(int m) {\n  int i = 0;\n  struct a *p, *head, *temp;\n  head = NULL;\n  do {\n    p = (struct a *)malloc(sizeof(struct a));\n    if (p == NULL) {\n      exit(1);\n    }\n    scanf(\"%d %s\", &p->book, p->author);\n    if (head == NULL) {\n      head = p;\n      temp = p;\n    } else {\n      temp->next = p;\n      temp = p;\n    }\n    i++;\n  } while (i < m);\n  temp->next = NULL;\n  return (head);\n}\nint main() {\n  int h, m, i, j, zimu[26] = {0};\n  struct a *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] >= 'A' && p->author[j] <= 'Z') {\n        zimu[p->author[j] - 'A']++;\n      }\n    }\n    p = p->next;\n  }\n  h = 0;\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > zimu[h])\n      h = i;\n  }\n  printf(\"%c\\n%d\\n\", 'A' + h, zimu[h]);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] == 'A' + h) {\n        printf(\"%d\\n\", p->book);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2674", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint N;\nint A[2013], Ans[1222];\nchar W[2013][28];\ndouble Max(double X, double Y) { return X > Y ? X : Y; }\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    cin >> A[I] >> W[I];\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      Ans[W[I][J]]++;\n  }\n  int Max = 0, T;\n  for (int I = 65; I <= 'Z'; I++)\n    if (Ans[I] > Max) {\n      Max = Ans[I];\n      T = I;\n    }\n  printf(\"%c\\n%d\\n\", T, Max);\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      if (W[I][J] == T)\n        printf(\"%d\\n\", A[I]);\n  }\n}\n"}
{"label": "2", "index": "2675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, max, ID[1000] = {0}, a[26] = {0};\n  char name[1000][26] = {\"\"};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &ID[i], &name[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      a[name[i][j] - 'A']++;\n\n  max = a[0];\n  k = 0;\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n\n  cout << k + 'A' << \"\\n\" << a[k] << \"\\n\";\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == 'A' + k)\n        printf(\"%d\\n\", ID[i]);\n}\n"}
{"label": "2", "index": "2676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char wri[27];\n  struct inf *next;\n};\n\nint main() {\n  int n, i, time[26] = {0};\n\n  char *pn;\n  struct inf *head, *p1, *p0, *p;\n  scanf(\"%d\", &n);\n  p1 = head = (struct inf *)malloc(sizeof(struct inf));\n  for (i = 0; i < n; i++) {\n    p0 = (struct inf *)malloc(sizeof(struct inf));\n    scanf(\"%d%s\", &p0->num, p0->wri);\n    p0->next = NULL;\n    p1->next = p0;\n    p1 = p0;\n    pn = p0->wri;\n    while (*pn != '\\0') {\n      time[*pn - 65]++;\n      pn = pn + 1;\n    }\n  }\n\n  int max = 0, k;\n  for (i = 0; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      k = i;\n    }\n  }\n  printf(\"%d\\n%d\\n\", k + 65, max);\n  p = head;\n  while (p != NULL) {\n\n    pn = p->wri;\n    while (*pn != '\\0') {\n      if (*pn == k + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      pn = pn + 1;\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t, max = 0;\n  int a[1000], b[26] = {0};\n  char s[1000][30];\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++) {\n      t = s[i][j] - 65;\n      b[t]++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] >= max)\n      max = b[i];\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max) {\n      k = i;\n      c = i + 65;\n      printf(\"%c\\n\", c);\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++)\n      if (s[i][j] == 65 + k)\n        printf(\"%d\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "2678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a[1000], l[1000], i, j, k, t, time[26] = {0}, max, q = 0;\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char b[1000][26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    l[i] = strlen(b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == name[k])\n          time[k]++;\n      }\n    }\n  }\n  max = time[0];\n  for (i = 1; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", name[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (b[i][j] == name[t]) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  cout << m << \"\\n\" << cnt[m] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[1000];\n  int len;\n} b[1000];\nvoid fun(int count[1000], char s[1000], int len) {\n  int i;\n  for (i = 0; i < len; i++) {\n    int m;\n    m = s[i] - 'A';\n    count[m]++;\n  }\n}\nint judge(char s[1000], int len, char name) {\n  int i, answer = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == name) {\n      answer = 1;\n      break;\n    }\n  }\n  return answer;\n}\n\nint main() {\n  int m, k, count[1000] = {0}, i, j, max, num;\n  char name;\n  cin >> m;\n  for (k = 0; k < m; k++) {\n    scanf(\"%d%s\", &b[k].id, b[k].s);\n    b[k].len = strlen(b[k].s);\n    fun(count, b[k].s, b[k].len);\n  }\n  max = count[0];\n  num = 0;\n  for (j = 1; j < 1000; j++) {\n    if (count[j] > max) {\n      max = count[j];\n      num = j;\n    }\n  }\n  name = num + 65;\n  printf(\"%c \", name);\n  cout << max << \" \";\n  for (k = 0; k < m; k++) {\n    int answer = 0;\n    answer = judge(b[k].s, b[k].len, name);\n    if (answer == 1) {\n      printf(\"%d \", b[k].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int booknumber;\n  int order[1000];\n  char author[1000][27];\n  char single_author[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int author_booknumber[26] = {0};\n  int i, j, k;\n  int tmp;\n\n  cin >> booknumber;\n\n  for (i = 0; i < booknumber; i++) {\n    scanf(\"%d%s\", &order[i], author[i]);\n    for (j = 0; j < strlen(author[i]); j++) {\n      for (k = 0; k < 26; k++) {\n        if (author[i][j] == single_author[k]) {\n          author_booknumber[k]++;\n          break;\n        }\n      }\n    }\n  }\n  tmp = 0;\n\n  for (i = 1; i < 26; i++) {\n    if (author_booknumber[i] > author_booknumber[tmp])\n      tmp = i;\n  }\n  printf(\"%c\\n\", single_author[tmp]);\n  printf(\"%d\\n\", author_booknumber[tmp]);\n\n  for (i = 0; i < booknumber; i++) {\n    for (j = 0; j < strlen(author[i]); j++) {\n      if (author[i][j] == single_author[tmp]) {\n        cout << order[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2682", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  struct {\n    int m;\n    char s[26];\n  } p[999];\n\n  int i, j, len, n;\n  int a[26][1000] = {0};\n  int w, t;\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p[i].m, p[i].s);\n    len = strlen(p[i].s);\n    for (j = 0; j < len; j++) {\n      t = (p[i].s)[j] - 'A';\n      a[t][0] += 1;\n      w = a[t][0];\n      a[t][w] = p[i].m;\n    }\n  }\n\n  int max = a[0][0];\n  int k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      k = i;\n    }\n  }\n\n  printf(\"%c\\n\", k + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= max; i++)\n    printf(\"%d\\n\", a[k][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2683", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  struct {\n    int m;\n    char s[26];\n  } p[999];\n\n  int i, j, len, n;\n  int a[26][1000] = {0};\n  int w, t;\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p[i].m, p[i].s);\n    len = strlen(p[i].s);\n    for (j = 0; j < len; j++) {\n      t = (p[i].s)[j] - 'A';\n      a[t][0] += 1;\n      w = a[t][0];\n      a[t][w] = p[i].m;\n    }\n  }\n\n  int max = a[0][0];\n  int k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      k = i;\n    }\n  }\n\n  printf(\"%c\\n\", k + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= max; i++) {\n    printf(\"%d\\n\", a[k][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, a[1000] = {0}, count[30] = {0}, temp, j, max = -999, flag;\n  char s[1000][30] = {0}, cha;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> a[i];\n    for (j = 1; j < 30; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = 0;\n        continue;\n      }\n      if (s[i][j] == '\\n') {\n        s[i][j] = 0;\n        break;\n      }\n      temp = s[i][j] - 'A' + 1;\n      count[temp] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] >= max) {\n      flag = i;\n      max = count[i];\n    }\n  }\n  cout << flag + 64 << \"\\n\" << max << \"\\n\";\n  cha = 'A' + flag - 1;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j < 30; j++) {\n      if (s[i][j] == cha) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  cout << m << \"\\n\" << cnt[m] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char str[30];\n  } bk[1000] = {0};\n  int i, j, m, n, sum[100] = {0}, number[1000] = {0}, result, max = 0;\n  char temp = 'A';\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].str;\n  for (i = 65; i <= 90; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++)\n        if (bk[j].str[n] == i)\n          sum[i]++;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (sum[j + 65] > max) {\n      max = sum[j + 65];\n      temp = j + 65;\n      result = j + 65;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (n = 0; n < 30; n++)\n      if (bk[i].str[n] == temp) {\n        number[i] = bk[i].num;\n        break;\n      }\n  }\n  printf(\"%c\\n%d\\n\", temp, sum[result]);\n  for (i = 0; i < m; i++)\n    if (number[i] != 0)\n      printf(\"%d\\n\", number[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2687", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint main() {\n  struct book *p1, *p2, *head = NULL;\n  int i, j, n, m, k, a[26], max, first;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->name;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      k = p1->name[j] - 'A';\n      a[k]++;\n    }\n    p1 = p1->next;\n  }\n\n  max = a[0];\n  first = 0;\n  for (k = 1; k < 26; k++) {\n    if (a[k] > max) {\n      max = a[k];\n      first = k;\n    }\n  }\n  printf(\"%c \", 'A' + first);\n  printf(\"%d \", max);\n\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      if (p1->name[j] == 'A' + first) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int p;\n  char a[m + 1][27];\n  int len[m + 1];\n  int b[m + 1];\n  int c[26];\n  int i, j, k, l;\n  for (i = 0; i <= 25; i++)\n    c[i] = 0;\n  for (i = 1; i <= m; i++) {\n    cin >> b[i];\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n    for (j = 0; j <= len[i] - 1; j++) {\n      c[a[i][j] - 'A']++;\n    }\n  }\n  int temp = -1;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > temp) {\n      temp = c[i];\n      p = i;\n    }\n  }\n  char n = 'A' + p;\n  cout << n << endl;\n  cout << temp << endl;\n  for (i = 1; i <= m; i++)\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (a[i][j] == '\\0') {\n        break;\n      } else if (a[i][j] == n) {\n        cout << b[i] << endl;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct info {\n  int nam;\n  char aut[27];\n} inf[1000];\nint main() {\n  int n, i, a[26] = {0}, k, max = 0, sum = 0;\n  char *p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &inf[i].nam, inf[i].aut);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      a[*p - 65]++;\n      p++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    max = max > a[i] ? max : a[i];\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      break;\n    }\n  }\n  k = i + 65;\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        sum++;\n        break;\n      }\n      p++;\n    }\n  }\n  cout << sum << \"\\n\";\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        printf(\"%d\\n\", inf[i].nam);\n        break;\n      }\n      p++;\n    }\n  }\n}\n"}
{"label": "2", "index": "2690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[26];\n} a[100];\nint main() {\n  int m, i, n, j, k, max, maxnum;\n  int aut1[26] = {0}, aut2[26][100] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> a[i].id;\n\n    cin >> a[i].s;\n    n = strlen(a[i].s);\n    for (j = 0; j < n; j++) {\n      k = a[i].s[j] - 'A';\n      aut2[k][aut1[k]] = a[i].id;\n      aut1[k]++;\n    }\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (aut1[i] > max) {\n      max = aut1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c \", 'A' + maxnum);\n  printf(\"%d \", max);\n  printf(\"%d\", aut2[maxnum][0]);\n  for (i = 1; i < max; i++) {\n    cout << \" \" << aut2[maxnum][i];\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a;\n  cin >> a;\n  char zuozhe[100][100];\n  int shuhao[100];\n  int zuo[200];\n  int shu[200][200];\n  int n = 0, p, i, j;\n  int m[200];\n\n  for (i = 0; i < 200; i++) {\n    zuo[i] = 0;\n    m[i] = 0;\n  }\n\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %s\", &shuhao[i], zuozhe[i]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; (zuozhe[i][j]) != '\\0'; j++) {\n      zuo[(zuozhe[i][j])] = zuo[(zuozhe[i][j])] + 1;\n      shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])] = shuhao[i];\n      m[(zuozhe[i][j])] = m[(zuozhe[i][j])] + 1;\n    }\n  }\n  for (i = 65; i <= 90; i++) {\n    if (zuo[i] > n) {\n      n = zuo[i];\n      p = i;\n    }\n  }\n  printf(\"%d\\n\", p);\n  printf(\"%d\\n\", zuo[p]);\n  for (i = 0; i < m[p]; i++) {\n    printf(\"%d\\n\", shu[p][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, amount[26], num[26][1000], num0, max = 0;\n  char a;\n  memset(amount, 0, sizeof(amount));\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num0;\n    cin.get();\n    a = cin.get();\n    while (a != '\\n') {\n      num[a - 65][amount[a - 65]] = num0;\n      amount[a - 65]++;\n      a = cin.get();\n    }\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < amount[i])\n      max = amount[i];\n  for (int i = 0; i < 26; i++)\n    if (max == amount[i]) {\n      a = i + 65;\n      cout << a << endl << max << endl;\n      for (int j = 0; j < max; j++)\n        printf(\"%d\\n\", num[i][j]);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[30] = {0}, b[30][1000];\nstruct stu {\n  int num;\n  char name[30];\n\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  struct stu *p1, *p2, *head;\n  int i = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = 0;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < n - 1) {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = 0;\n  return head;\n}\nint check(struct stu *head, int n) {\n  int i, j, s, d = 0, f = 0;\n  char *t;\n  struct stu *p;\n  p = head;\n  for (i = 0; i < n; i++, p = p->next) {\n    s = strlen(p->name);\n    t = p->name;\n    for (j = 0; j < s; j++) {\n      d = t[j] - 64;\n      a[d]++;\n      b[d][a[d] - 1] = p->num;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    for (j = 1, f = 0; j <= 26; j++) {\n      if (a[i] < a[j]) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 0)\n      break;\n  }\n  return i;\n}\nint main() {\n  struct stu *head;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  i = check(head, n);\n  printf(\"%c\\n%d\\n\", i + 64, a[i]);\n  for (j = 0; j < a[i]; j++)\n    cout << b[i][j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, w = 0;\n  int maxzm, maxbk = 0;\n  char c1;\n  int zimu[26] = {0};\n  int lm[100];\n  struct {\n    int num;\n    char a[100];\n  } book[1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> book[i].num >> book[i].a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      for (k = 65; k < 91; k++) {\n        if (book[i].a[j] == k)\n          zimu[k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > maxbk) {\n      maxbk = zimu[i];\n      maxzm = i;\n    }\n  }\n  c1 = maxzm + 65;\n  printf(\"%c\\n\", c1);\n  cout << maxbk << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      if (book[i].a[j] == c1) {\n        lm[w] = book[i].num;\n        w++;\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%d\\n\", lm[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct books {\n  int num;\n  char writer[26];\n  struct books *next;\n};\n\nint m;\n\nstruct books *creat() {\n  struct books *head, *p1, *p2;\n  int i;\n  p2 = p1 = (struct books *)malloc(sizeof(struct books));\n  for (i = 1; i <= m; i++) {\n    if (i == 1)\n      head = p1;\n    cin >> p1->num >> p1->writer;\n    p2 = p1;\n    if (i != m) {\n      p1 = (struct books *)malloc(sizeof(struct books));\n      p2->next = p1;\n    } else\n      p2->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  int character[26];\n  struct books *head, *p;\n  int i, max = 0, imax;\n  for (i = 0; i < 26; i++)\n    character[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat();\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      character[*(p->writer + i) - 'A']++;\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (character[i] > max) {\n      max = character[i];\n      imax = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", imax + 'A', max);\n\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      if (*(p->writer + i) == imax + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n}\n"}
{"label": "2", "index": "2696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k = 0;\n  struct {\n    int n;\n    char s[26];\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, &book[i].s);\n  int a[26] = {0};\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      a[(int)(book[i].s[j] - 'A')]++;\n  for (i = 1; i < 26; i++)\n    if (a[k] < a[i])\n      k = i;\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n  for (i = 0; i < m; i++)\n    for (j = 0; book[i].s[j] != '\\0'; j++)\n      if (book[i].s[j] == k + 'A') {\n        printf(\"%d\\n\", book[i].n);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[28];\n} bo[1000];\nint main() {\n  int i, j, k, n, a, b;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &bo[i].num, bo[i].writer);\n\n  for (i = 'Z'; i >= 'A'; i--) {\n    a = 0;\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < 27; j++) {\n        if (bo[k].writer[j] == i) {\n          a++;\n        }\n      }\n    }\n    if (a > max) {\n      max = a;\n      b = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 28; i++) {\n      if (bo[j].writer[i] == b) {\n        printf(\"%d\\n\", bo[j].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2698", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int m, i, j, len, max;\n  int id[1000], b[26] = {0};\n  char a[100][27], name;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &id[i], a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      b[a[i][j] - 'A']++;\n    }\n  } \n  max = b[0];\n  name = 'A';\n  for (j = 1; j < 26; j++) {\n    if (b[j] > max) {\n      max = b[j];\n      name = j + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max); \n  for (i = 0; i < m; i++) {\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == name) {\n        strcpy(a[i], \"shuchu\");\n        break;\n      } \n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(a[i], \"shuchu\") == 0)\n      printf(\"%d\\n\", id[i]); \n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2699", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int name;\n  char writer[100];\n  struct book *next;\n};\n\nint a[26];\n\nstruct book *creat(int n) {\n  struct book *p1, *p2, *xhead;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->name, p1->writer);\n  p2 = p1;\n  xhead = p1;\n\n  while (n - 1) {\n    n--;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->name, p1->writer);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nvoid find(struct book *head) {\n  struct book *p;\n  int i;\n  char s[100];\n  p = head;\n  while (p) {\n    i = 0;\n    strcpy(s, p->writer);\n    while (s[i] != '\u0000') {\n      a[s[i] - 'A']++;\n      i++;\n    }\n\n    p = p->next;\n  }\n}\n\nvoid print(struct book *head, int max) {\n  struct book *p;\n  p = head;\n  while (p) {\n    if (strchr(p->writer, max + 'A'))\n      printf(\"%d \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  int i, max = 0, n;\n  struct book *head;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  find(head);\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[max])\n      max = i;\n  printf(\"%c \", max + 'A');\n  printf(\"%d \", a[max]);\n  print(head, max);\n  return 0;\n}\n"}
{"label": "2", "index": "2700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], max = 0, t, p[26] = {0};\n  char c[1000][27], d,\n      l[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], c[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      for (k = 0; k < 26; k++) {\n        if (c[i][j] == l[k])\n          p[k] += 1;\n      }\n  for (k = 0; k < 26; k++)\n    if (p[k] > max) {\n      max = p[k];\n      t = k;\n    }\n  printf(\"%c\\n%d\\n\", l[t], max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if (c[i][j] == l[t]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char a[26];\n  };\n  int n, i, j, k, q = 0;\n  int b[26] = {0}, c[26];\n  scanf(\"%d\", &n);\n  struct book *p;\n  p = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &p[i].m, p[i].a);\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < 26; k++)\n        if (p[j].a[k] == 'A' + i)\n          b[i] = b[i] + 1;\n  for (i = 0; i < 26; i++)\n    c[i] = b[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n  for (i = 0; i < 26; i++)\n    if (c[i] == b[25]) {\n      printf(\"%c\\n%d\\n\", 'A' + i, b[25]);\n      for (j = 0; j < n; j++)\n        for (k = 0; k < 26; k++)\n          if (p[j].a[k] == 'A' + i)\n            printf(\"%d\\n\", p[j].m);\n    }\n  free(p);\n}\n"}
{"label": "2", "index": "2702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[27];\n  struct book *next;\n};\nint n;\nstruct book *creat(int amount) {\n  struct book *head;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  p2 = p1;\n  scanf(\"%d %s\", &p1->num, p1->aut);\n  while (n < amount - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->aut);\n  }\n  p2->next = p1, p1->next = NULL;\n  return (head);\n}\nint main() {\n  int amount, i, a[26] = {0}, max, maxn;\n  struct book *p, *headp;\n  char *auth, name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                          'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S',\n                          'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &amount);\n  p = creat(amount);\n  headp = p;\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      for (i = 0; i < 26; i++) {\n        if (name[i] == *auth)\n          break;\n      }\n      a[i] = a[i] + 1;\n    }\n  }\n  for (i = 0, max = a[0], maxn = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i], maxn = i;\n  }\n  printf(\"%c\\n%d\\n\", name[maxn], max);\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      if (*auth == name[maxn])\n        break;\n    }\n    if (*auth == '\\0')\n      ;\n    else\n      printf(\"%d\\n\", p->num);\n  }\n}\n"}
{"label": "2", "index": "2703", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num = 0, n, a[26], name[1000], name2[1000], i, j, k, max = 0, maxi = 0;\n  char wr[1000][27];\n  char q;\n  cin >> n;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n\n  for (i = 0; i < n; i++) {\n    cin >> (name[i]) >> wr[i];\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (wr[i][j] == 'A' + k)\n          a[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxi = i;\n    }\n  }\n  q = 'A' + maxi;\n  printf(\"%c\\n\", q);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (wr[i][j] == q) {\n        name2[num] = name[i];\n        num++;\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", name2[i]);\n}\n"}
{"label": "2", "index": "2704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char zhuzhe[26];\n  int let;\n};\n\nstruct book shu[1000];\n\nint judge(char a, char b) {\n  if (a == b)\n    return (1);\n  else\n    return (0);\n}\n\nint main() {\n  int n, i, j, y, zhi, num;\n  char writer1[26] = {0};\n  char writer2[26] = {0};\n\n  for (i = 0; i < 26; i++)\n    writer2[i] = i + 65;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shu[i].num);\n\n    cin >> shu[i].zhuzhe;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      for (y = 0; y < 26; y++)\n        if (writer2[y] == shu[i].zhuzhe[j])\n          writer1[y] = writer1[y] + 1;\n  zhi = 0;\n  num = 0;\n  for (i = 0; i < 26; i++)\n    if (writer1[i] > zhi) {\n      zhi = writer1[i];\n      num = i;\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; shu[i].zhuzhe[j] != '\u0000'; j++)\n      if (judge(shu[i].zhuzhe[j], writer2[num]) == 1)\n        shu[i].let = 1;\n\n  printf(\"%c \", writer2[num]);\n  cout << writer1[num] << \" \";\n  for (i = 0; i < n - 1; i++)\n    if (shu[i].let == 1)\n      printf(\"%d \", shu[i].num);\n  if (shu[n - 1].let == 1)\n    printf(\"%d\", shu[n - 1].num);\n}\n"}
{"label": "2", "index": "2705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n    struct book *next;\n  };\n  int n, m, i;\n  scanf(\"%d\", &m);\n  struct book *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->wri);\n  head = NULL;\n  for (i = 0; i < m - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->wri);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  int a[26] = {0}, b, max1 = 0, max2;\n  struct book *g;\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] != '\u0000') {\n        b = g->wri[i];\n        a[b - 65] = a[b - 65] + 1;\n      }\n    }\n    g = g->next;\n  } while (g != NULL);\n  for (i = 0; i < 26; i++) {\n    if (max1 < a[i]) {\n      max1 = a[i];\n      max2 = i;\n    }\n  }\n  max2 = max2 + 65;\n  cout << max2 << \" \" << max1;\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] == max2) {\n        cout << \" \" << g->num;\n        break;\n      }\n    }\n\n    g = g->next;\n  } while (g != NULL);\n}\n"}
{"label": "2", "index": "2706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct xinxi {\n  int sh;\n  char zz[20];\n} a[1000];\nint main() {\n  int n, i, l, j, b[26] = {0}, m = 0, k = 0;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].sh, a[i].zz);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      b[a[i].zz[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > m) {\n      m = b[i];\n      k = i;\n    }\n  }\n  c = k + 65;\n  printf(\"%c\\n%d\\n\", c, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      if (a[i].zz[j] == c)\n        printf(\"%d\\n\", a[i].sh);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(int m) {\n  struct stu *p1, *p2, *xhead;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  xhead = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nint stas(int b[]) {\n  int j, max = 0, indexx = 0;\n  for (j = 0; j < 26; j++)\n    if (b[j] > max) {\n      max = b[j];\n      indexx = j;\n    }\n  cout << indexx + 65 << \"\\n\" << max << \"\\n\";\n\n  return indexx;\n}\n\nstruct stu *search(struct stu *yhead, int y) {\n  struct stu *q;\n  int sum = 0, k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = yhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < i + k; i++)\n      if (*i == y + 65)\n        sum++;\n    strcpy(s, s0);\n    q = q->next;\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n\nstruct stu *print(struct stu *zhead, int z) {\n  struct stu *q;\n  int k;\n  char *i;\n  char s[20], s0[20] = {'\\0'};\n  q = zhead;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = s; i < s + k; i++)\n      if (*i == z + 65) {\n        cout << q->num << \"\\n\";\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n  return 0;\n}\n\nint main() {\n  int n, index;\n  int a[26], k, t, i;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  scanf(\"%d\", &n);\n  head = create(n);\n  p = head;\n  while (p) {\n    strcpy(s, p->c);\n\n    k = strlen(s);\n\n    for (i = 0; i < k; i++) {\n\n      t = s[i] - 65;\n      a[t]++;\n    }\n\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  index = stas(a);\n\n  print(head, index);\n  return 0;\n}\n"}
{"label": "2", "index": "2708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    int num;\n    char str[27];\n  } b[100];\n  int n, i, m, j, max, nmax;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].str);\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      a[b[i].str[j] - 65]++;\n    }\n  }\n  max = a[0];\n  nmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      nmax = i;\n    }\n  }\n  cout << nmax + 65 << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      if (b[i].str[j] == nmax + 65)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  char num[20];\n  char aut[20];\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->aut);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->aut;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nvoid print(struct book *head) {\n  struct book *p;\n  int *tem, i, k;\n  char *q, max, c;\n  tem = (int *)malloc(30 * sizeof(int));\n  for (i = 0; i < 30; i++) {\n    *(tem + i) = 0;\n  }\n  for (p = head; p; p = p->next) {\n    q = p->aut;\n    for (i = 0; *(q + i) != '\u0000'; i++) {\n      c = *(q + i) - 'A';\n      *(tem + c) += 1;\n    }\n  }\n  max = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (*(tem + i) > max) {\n      max = *(tem + i);\n      k = i;\n    }\n  }\n  c = k + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p; p = p->next) {\n    for (q = p->aut, i = 0; *(q + i) != '\u0000'; i++) {\n      if (*(q + i) == c) {\n        break;\n      }\n    }\n    if (*(q + i) != '\u0000') {\n      printf(\"%s \", p->num);\n    }\n  }\n}\nint main() {\n  struct book *head;\n  scanf(\"%d\", &m);\n  head = creat();\n  print(head);\n  return 0;\n}\n"}
{"label": "2", "index": "2710", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct su {\n  int a;\n  char b[26];\n  struct su *next;\n};\nint main() {\n  int n, c[26] = {0}, i, k, j, l, max, m;\n  struct su *p, *head, *q;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    p = (struct su *)malloc(sizeof(struct su));\n    if (i == 0) {\n      head = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    } else {\n      q->next = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    }\n  }\n  q->next = NULL;\n  max = c[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (max < c[j]) {\n      max = c[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 'A', max);\n  p = head;\n  do {\n    k = strlen(p->b);\n    for (j = 0; j < k; j++) {\n      if (('A' + m) == p->b[j])\n        printf(\"%d\\n\", p->a);\n    }\n    p = p->next;\n  } while (p != NULL);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2711", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint alpha[26] = {0};\nstruct library {\n  int num;\n  char authors[27];\n} books[999];\nvoid addauthor(char string[]) {\n  int i = 0;\n  do {\n    alpha[string[i] - 'A']++;\n    i++;\n  } while (string[i] != '\\0');\n}\nvoid hewroteit(struct library book, int maxalpha) {\n  int i;\n  for (i = 0; book.authors[i] != '\\0'; i++) {\n    if (book.authors[i] - 'A' == maxalpha) {\n      printf(\"%d\\n\", book.num);\n      break;\n    }\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> books[i].num >> books[i].authors;\n  for (i = 0; i < m; i++) {\n    addauthor(books[i].authors);\n  }\n  int max = 0, maxalpha = 0;\n  for (i = 0; i < 26; i++) {\n    if (alpha[i] > max) {\n      max = alpha[i];\n      maxalpha = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxalpha, max);\n  for (i = 0; i < m; i++) {\n    hewroteit(books[i], maxalpha);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct su {\n  int a;\n  char b[26];\n  struct su *next;\n};\nint main() {\n  int n, c[26] = {0}, i, k, j, l, max, m;\n  struct su *p, *head, *q;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    p = (struct su *)malloc(sizeof(struct su));\n    if (i == 0) {\n      head = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    } else {\n      q->next = p;\n      q = p;\n      scanf(\"%d %s\", &p->a, p->b);\n      k = strlen(p->b);\n      for (j = 0; j < k; j++) {\n        l = p->b[j] - 'A';\n        c[l] = c[l] + 1;\n      }\n    }\n  }\n  q->next = NULL;\n  max = c[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (max < c[j]) {\n      max = c[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 'A', max);\n  p = head;\n  do {\n    k = strlen(p->b);\n    for (j = 0; j < k; j++) {\n      if (('A' + m) == p->b[j]) {\n        printf(\"%d\\n\", p->a);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    char b[100];\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int m, n, i, j, k, t, d[50], max;\n  char c;\n  scanf(\"%d\", &n);\n  p1 = (struct s *)malloc(sizeof(struct s));\n  p2 = p1;\n  head = p1;\n  scanf(\"%d %s\", &p1->a, p1->b);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %s\", &p1->a, p1->b);\n  }\n  p2->next = 0;\n  t = 0;\n  p1 = p2 = head;\n\n  for (c = 'A'; c <= 'Z'; c++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      j = 0;\n      while (p1->b[j] != '\\0') {\n        if (c == p1->b[j])\n          k++;\n        j++;\n      }\n      p1 = p1->next;\n    }\n\n    d[t] = k;\n\n    t++;\n    p1 = head;\n  }\n  j = 0;\n  max = d[0];\n  for (i = 1; i < 26; i++)\n    if (d[i] > max) {\n      max = d[i];\n      j = i;\n    }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", max);\n  t = 'A' + j;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (p1->b[j] != '\\0') {\n      if (t == p1->b[j])\n        printf(\"%d\\n\", p1->a);\n      j++;\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int location[1001];\n  int num;\n  int sum;\n} ans[27];\nint main() {\n  int n, value = -1, order, m;\n  char s[28];\n  cin >> n;\n  for (int i = 1; i <= 26; i++) {\n    ans[i].num = ans[i].sum = 0;\n  }\n  for (int i = 1; i <= n; i++) {\n    cin >> m;\n    cin >> s;\n    for (int j = 0; j < strlen(s); j++) {\n      ans[s[j] - 'A' + 1].num++;\n      ans[s[j] - 'A' + 1].sum++;\n      ans[s[j] - 'A' + 1].location[ans[s[j] - 'A' + 1].num] = m;\n    }\n  }\n  for (int i = 1; i <= 26; i++)\n    if (ans[i].sum > value) {\n      value = ans[i].sum;\n      order = i;\n    }\n  cout << (char)(order + 'A' - 1) << endl;\n  cout << ans[order].num << endl;\n  for (int i = 1; i <= ans[order].num; i++)\n    cout << ans[order].location[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, c[26], max = 0, d, k;\n  scanf(\"%d\\n\", &m);\n  for (k = 0; k < 26; k++) {\n    c[k] = 0;\n  }\n  struct books {\n    int num;\n    char name[26];\n  } books[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &books[i].num, books[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      c[books[i].name[j] - 'A']++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (c[k] > max) {\n      max = c[k];\n      d = k;\n    }\n  }\n  cout << d + 'A' << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      if (books[i].name[j] == d + 'A') {\n        printf(\"%d\\n\", books[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  char author[26];\n  int length;\n} a[1000];\n\nint main() {\n  int n, i, k, num = 0, max = 0;\n  char b, c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].author);\n    a[i].length = strlen(a[i].author);\n  }\n  for (b = 'A'; b <= 'Z'; b++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < a[i].length; k++) {\n        if (a[i].author[k] == b) {\n          num++;\n          break;\n        }\n      }\n    }\n    if (num > max) {\n      max = num;\n      c = b;\n    }\n  }\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < a[i].length; k++) {\n      if (a[i].author[k] == c) {\n        printf(\"%d\\n\", a[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2717", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int m = 0;\n  head = p1 = p2 = NULL;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (1) {\n    m += 1;\n    if (m >= n)\n      break;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct book *head, *p;\n  char maxchar;\n  int m, i = 0, max = 0, a[26] = {0};\n  cin >> m;\n  head = creat(m);\n\n  for (p = head; p != NULL; p = p->next) {\n\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      int c = p->name[i] - 'A';\n      a[c]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxchar = 'A' + i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", maxchar, max);\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      if (p->name[i] == maxchar) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n}\n"}
{"label": "2", "index": "2718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\nint main() {\n  int n, t, i, j;\n  int count[26], max = 0;\n  for (i = 0; i < 26; i++)\n    count[i] = 0;\n  struct book {\n    int num;\n    char man[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].man);\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == 'A')\n        count[0]++;\n      else if (book[i].man[j] == 'B')\n        count[1]++;\n      else if (book[i].man[j] == 'C')\n        count[2]++;\n      else if (book[i].man[j] == 'D')\n        count[3]++;\n      else if (book[i].man[j] == 'E')\n        count[4]++;\n      else if (book[i].man[j] == 'F')\n        count[5]++;\n      else if (book[i].man[j] == 'G')\n        count[6]++;\n      else if (book[i].man[j] == 'H')\n        count[7]++;\n      else if (book[i].man[j] == 'I')\n        count[8]++;\n      else if (book[i].man[j] == 'J')\n        count[9]++;\n      else if (book[i].man[j] == 'K')\n        count[10]++;\n      else if (book[i].man[j] == 'L')\n        count[11]++;\n      else if (book[i].man[j] == 'M')\n        count[12]++;\n      else if (book[i].man[j] == 'N')\n        count[13]++;\n      else if (book[i].man[j] == 'O')\n        count[14]++;\n      else if (book[i].man[j] == 'P')\n        count[15]++;\n      else if (book[i].man[j] == 'Q')\n        count[16]++;\n      else if (book[i].man[j] == 'R')\n        count[17]++;\n      else if (book[i].man[j] == 'S')\n        count[18]++;\n      else if (book[i].man[j] == 'T')\n        count[19]++;\n      else if (book[i].man[j] == 'U')\n        count[20]++;\n      else if (book[i].man[j] == 'V')\n        count[21]++;\n      else if (book[i].man[j] == 'W')\n        count[22]++;\n      else if (book[i].man[j] == 'X')\n        count[23]++;\n      else if (book[i].man[j] == 'Y')\n        count[24]++;\n      else if (book[i].man[j] == 'Z')\n        count[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      t = i;\n    }\n  }\n  cout << name[t] << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == name[t])\n        cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int num;\n  char name[27];\n} book[999];\nstruct {\n  int cishu;\n} ren[26];\nint main() {\n  int n, zimu, a, b, i, j;\n  int sz[26];\n  char m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].name[j] != '\\0'; j++) {\n      zimu = book[i].name[j] - 65;\n      ren[zimu].cishu++;\n    }\n  }\n  a = 0;\n  b = ren[0].cishu;\n  for (i = 1; i < 26; i++) {\n    if (ren[i].cishu > b) {\n      a = i;\n      b = ren[i].cishu;\n    }\n  }\n  m = a + 65;\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", b);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].name[j] == m) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct {\n    int a;\n    char b[26];\n  } num[999];\n  int i, m, j, k;\n  int s[26];\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> num[i].a >> num[i].b;\n  }\n  for (k = 0; k < 26; k++) {\n    s[k] = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      k = num[i].b[j] - 'A';\n      s[k]++;\n    }\n  }\n  int first = s[0];\n  int t;\n  for (k = 0; k < 26; k++) {\n    if (s[k] > first) {\n      first = s[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", t + 'A');\n  cout << first << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      if (num[i].b[j] == (t + 'A')) {\n        cout << num[i].a << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a[1000], l[1000], i, j, k, t, time[26] = {0}, max;\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char b[1000][26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    l[i] = strlen(b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == name[k])\n          time[k]++;\n      }\n    }\n  }\n  max = time[0];\n  for (i = 1; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      t = i;\n    }\n  }\n  cout << name[t] << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (b[i][j] == name[t]) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, no[1000], shu[26] = {0}, max = 0;\n  char s[1000][20], c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &no[i], s[i]);\n    for (j = 0; j < strlen(s[i]); j++) {\n      shu[s[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      c = 'A' + i;\n    }\n  }\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (strchr(s[i], c))\n      printf(\"%d\\n\", no[i]);\n  }\n}\n"}
{"label": "2", "index": "2723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  char a[1000];\n  char b[26];\n} book[1000];\nint main() {\n  int m, i, j, s, k, p, l;\n  int t[26] = {0};\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%s %s\", &book[i].a, book[i].b);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      x = book[i].b[j];\n      k = x;\n      t[k - 65] = t[k - 65] + 1;\n    }\n  }\n  p = t[0];\n  l = 0;\n  for (i = 1; i < 26; i++) {\n    if (t[i] > p) {\n      p = t[i];\n      l = i;\n    }\n  }\n  x = l + 65;\n  printf(\"%c\\n\", x);\n  printf(\"%d\\n\", p);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      if (book[i].b[j] == x) {\n        printf(\"%s\\n\", book[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n\n  cout << record + 'A' << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2725", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, s[26][1000], m, i, j, author, max = 0; \n  char b[1000][28];                             \n  for (i = 0; i < 26; i++)\n    s[i][0] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> a;\n    cin >> b[a];\n    for (j = 0; b[a][j] != '\\0'; j++) {\n      s[b[a][j] - 'A'][0]++;                     \n      s[b[a][j] - 'A'][s[b[a][j] - 'A'][0]] = a; \n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i][0] > max) {\n      max = s[i][0];\n      author = i;\n    }\n  }\n  cout << (char)(author + 'A') << endl << max << endl;\n  for (j = 1; j <= max; j++)\n    cout << s[author][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int n, i, j, a[26] = {0}, len[1000], k, max = 0;\n  struct book list[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &list[i].num);\n    scanf(\"%s\", list[i].name);\n    len[i] = strlen(list[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (list[j].name[k] == i + 65) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (list[i].name[j] == k + 65) {\n        printf(\"%d\\n\", list[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n};\n\nint main() {\n  int i, j, k, m, x, a = 0;\n  int count[26] = {0};\n  char y;\n  struct book all[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &all[i].num, &all[i].aut);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] >= 'A' && all[i].aut[j] <= 'Z') {\n        x = (int)(all[i].aut[j] - 'A');\n        count[x]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > a) {\n      a = count[i];\n      k = i;\n    }\n  }\n  y = k + 'A';\n  printf(\"%c\\n%d\\n\", y, a);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] == y) {\n        printf(\"%d\\n\", all[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct {\n    int num;\n    char author[26];\n  } book[1000];\n  int shu_num[26], i, j, k, n, max, length;\n  char max_author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  for (k = 0; k < 26; k++) {\n    shu_num[k] = 0;\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      length = strlen(book[i].author);\n      for (j = 0; j < length; j++) {\n        if (book[i].author[j] == 'A' + k) {\n          shu_num[k]++;\n        }\n      }\n    }\n  }\n  max = shu_num[0];\n  max_author = 'A';\n  for (k = 0; k < 26; k++) {\n    if (shu_num[k] > max) {\n      max = shu_num[k];\n      max_author = 'A' + k;\n    }\n  }\n  cout << max_author << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      if (book[i].author[j] == max_author) {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2729", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char writer[26];\n  int num;\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i, m;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p1->next = NULL;\n  }\n  p2->next = p1;\n  return (head);\n}\nint main() {\n  int n, a[26][1000] = {0}, b[26] = {0}, i, max, k;\n  struct book *head, *p;\n  char *q;\n  head = creat();\n  for (p = head->next; p; p = p->next) {\n    n = strlen(p->writer);\n    for (i = 0, q = p->writer; i < n; i++, q++) {\n      a[*q - 65][b[*q - 65]] = p->num;\n      b[*q - 65]++;\n    }\n  }\n  max = b[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[k][i]);\n}\n"}
{"label": "2", "index": "2730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char number[20];\n  char name[26];\n} books[1000];\n\nint main() {\n  int n, i, j;\n  int count[26] = {0};\n  int temp, base, k = 0;\n  char author;\n  int pd = 0, N = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", &books[i].number, &books[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n      temp = books[i].name[j] - 'A';\n      count[temp]++;\n    }\n  }\n  base = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] > base) {\n      base = count[i];\n      k = i;\n    }\n  }\n  author = 'A' + k;\n  printf(\"%c \", author);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      N++;\n  }\n  printf(\"%d \", N);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      printf(\"%s \", books[i].number);\n  }\n}\n"}
{"label": "2", "index": "2731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;\n  char name[1002][27], a, max;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i];\n    cin >> name[i];\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      a = name[i][j];\n      cnt[a - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > n) {\n      n = cnt[i];\n      max = i + 'A';\n    }\n  }\n  cout << max << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      if (name[i][j] == max) {\n        cout << book[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int n;\n  char name[27];\n  struct stu *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct stu *head, *p1, *p2, *p3;\n  head = p1 = (struct stu *)malloc(1000);\n  cin >> p1->n >> p1->name;\n  int i = 0;\n  for (; i < m - 1; i++) {\n    p2 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p2->n, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  p2->next = NULL;\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    while (*p != '\\0') {\n      int a = *p;\n      sum[a - 65] = sum[a - 65] + 1;\n      p = p + 1;\n    }\n  }\n  int max = sum[0];\n  char j = 'A';\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i + 65;\n    }\n  }\n  cout << j << \"\\n\" << max << \"\\n\";\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    for (; *p != '\\0'; p++)\n      if (*p == j) {\n        printf(\"%d\\n\", p1->n);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, count[30] = {0}, num[30][1000] = {0};\n  cin >> n;\n  while (n--) {\n    int no;\n    char c;\n    cin >> no;\n    cin.get();\n    while ((c = cin.get()) != '\\n') {\n      num[c - 'A'][count[c - 'A']++] = no;\n    }\n  }\n  int max = count[0], set = 0;\n  for (int i = 1; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      set = i;\n    }\n  }\n  cout << (char)(set + 'A') << endl << max << endl;\n  for (int i = 0; i < max; i++) {\n    printf(\"%d\\n\", num[set][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int booknumber;\n  int order[1000];\n  char author[1000][27];\n  char single_author[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int author_booknumber[26] = {0};\n  int i, j, k;\n  int tmp;\n\n  scanf(\"%d \", &booknumber);\n\n  for (i = 0; i < booknumber; i++) {\n    scanf(\"%d%s\", &order[i], author[i]);\n    for (j = 0; j < strlen(author[i]); j++) {\n      for (k = 0; k < 26; k++) {\n        if (author[i][j] == single_author[k]) {\n          author_booknumber[k]++;\n          break;\n        }\n      }\n    }\n  }\n  tmp = 0;\n\n  for (i = 1; i < 26; i++) {\n    if (author_booknumber[i] > author_booknumber[tmp])\n      tmp = i;\n  }\n  cout << single_author[tmp] << \"\\n\";\n  printf(\"%d\\n\", author_booknumber[tmp]);\n\n  for (i = 0; i < booknumber; i++) {\n    for (j = 0; j < strlen(author[i]); j++) {\n      if (author[i][j] == single_author[tmp]) {\n        printf(\"%d\\n\", order[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2735", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint trans(char k) {\n  int i;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < 26; i++) {\n    if (k == a[i]) {\n      return i;\n    }\n  }\n}\nint main() {\n  struct books {\n    int n;\n    char w[27];\n  } * m;\n  int num, i, j;\n  scanf(\"%d\", &num);\n  m = (struct books *)malloc(sizeof(struct books) * num);\n  for (i = 0; i < num; i++) {\n\n    int N;\n    char W[27];\n    scanf(\"%d %s \", &N, W);\n    m[i].n = N;\n    strcpy(m[i].w, W);\n  }\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\n      c;\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      c = trans(m[i].w[j]);\n      b[c]++;\n    }\n  }\n  int max = 0;\n  char most;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      most = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", most, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      if (m[i].w[j] == most)\n        printf(\"%d\\n\", m[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  struct book {\n    int num;\n    char name[26];\n  } book[999];\n\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n\n  struct author {\n    char l;\n    int count;\n  } au[26];\n\n  for (i = 0; i < 26; i++) {\n    au[i].l = 65 + i;\n    au[i].count = 0;\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (au[i].l == book[j].name[k]) {\n          au[i].count++;\n          break;\n        }\n      }\n    }\n  }\n\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (au[max].count < au[i].count)\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", au[max].l, au[max].count);\n\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (au[max].l == book[j].name[k]) {\n        cout << book[j].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2737", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, z;\n  char max;\n  int sum[999] = {0};\n  struct student {\n    int a;\n    char b[26];\n    int c[26];\n  } x[999];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x[i].a);\n    for (j = 0;; j++) {\n      scanf(\"%c\", &x[i].b[j]);\n      if (x[i].b[j] == '\\n')\n        break;\n      x[i].c[x[i].b[j] - 65]++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < 999; i++) {\n      sum[k] = sum[k] + x[i].c[k];\n    }\n  }\n\n  z = sum[0];\n  max = 65;\n  for (k = 1; k < 26; k++) {\n    if (sum[k] > z) {\n      max = k + 65;\n      z = sum[k];\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", z);\n  for (i = 0; i < n; i++) {\n    if (x[i].c[max - 65] > 0) {\n      printf(\"%d\\n\", x[i].a);\n    }\n  }\n\n  cin >> i;\n  return 0;\n}\n"}
{"label": "2", "index": "2738", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  int code;\n  char author[20];\n};\nstruct letter {\n  char let;\n  int count;\n};\n\nint main() {\n  int n, i, j, k, t, max;\n  struct data a[100];\n  struct letter l[26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].code);\n\n    cin >> a[i].author;\n  }\n  for (i = 0; i < 26; i++) {\n    l[i].let = i + 65;\n    l[i].count = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].author[j] == l[k].let)\n          l[k].count++;\n      }\n    }\n  }\n  max = 0;\n  for (k = 0; k < 26; k++) {\n    if (l[k].count > max) {\n      max = l[k].count;\n      t = k;\n    }\n  }\n\n  printf(\"%c \", l[t].let);\n  printf(\"%d \", l[t].count);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      if (a[i].author[j] == l[t].let)\n        printf(\"%d \", a[i].code);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n};\nint main() {\n  int n, i, j, l, sum[26], t = 0, T = 0;\n  struct book a[1000];\n  memset(sum, 0, sizeof(sum));\n  char A;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].name;\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      sum[a[i].name[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > t) {\n      t = sum[i];\n      T = i;\n    }\n  }\n  A = 'A' + T;\n  cout << A << endl;\n  cout << t << endl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 27; j++) {\n      if (a[i].name[j] == A)\n        printf(\"%d\\n\", a[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  char writer[26];\n  int num;\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i, m;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p1->next = NULL;\n  }\n  p2->next = p1;\n  return (head);\n}\nint main() {\n  int n, a[26][1000] = {0}, b[26] = {0}, i, max, k;\n  struct book *head, *p;\n  char *q;\n  head = creat();\n  for (p = head->next; p; p = p->next) {\n    n = strlen(p->writer);\n    for (i = 0, q = p->writer; i < n; i++, q++) {\n      a[*q - 65][b[*q - 65]] = p->num;\n      b[*q - 65]++;\n    }\n  }\n  max = b[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[k][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[30] = {0}, b[30][1000];\nstruct stu {\n  int num;\n  char name[30];\n\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  struct stu *p1, *p2, *head;\n  int i = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = 0;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < n - 1) {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = 0;\n  return head;\n}\nint check(struct stu *head, int n) {\n  int i, j, s, d = 0, f = 0;\n  char *t;\n  struct stu *p;\n  p = head;\n  for (i = 0; i < n; i++, p = p->next) {\n    s = strlen(p->name);\n    t = p->name;\n    for (j = 0; j < s; j++) {\n      d = t[j] - 64;\n      a[d]++;\n      b[d][a[d] - 1] = p->num;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    for (j = 1, f = 0; j <= 26; j++) {\n      if (a[i] < a[j]) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 0)\n      break;\n  }\n  return i;\n}\nint main() {\n  struct stu *head;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  i = check(head, n);\n  cout << i + 64 << \"\\n\" << a[i] << \"\\n\";\n  for (j = 0; j < a[i]; j++)\n    printf(\"%d\\n\", b[i][j]);\n}\n"}
{"label": "2", "index": "2742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, c, big = 0;\n  int num[30] = {0}, a[1000];\n  char name[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], name[i]);\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(name[i]); j++) {\n        if (name[i][j] == k + 'A')\n          num[k] = num[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (big < num[i]) {\n      big = num[i];\n      c = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", big);\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == c)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, a[1000], c[91] = {0}, k, n, p = 0;\n  char b[1000][26], q;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++) {\n      k = b[i][j];\n      c[k]++;\n    }\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > p) {\n      p = c[i];\n      q = i;\n    }\n  printf(\"%c\\n%d\\n\", q, p);\n  for (i = 1; i <= m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++)\n      if (b[i][j] == q)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int no;\n  char au[10];\n};\nint main() {\n  struct data lib[1000];\n  char x;\n  int n, i, j, num[26] = {0}, l[1000], k, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &lib[i].no);\n    scanf(\"%s\", lib[i].au);\n    l[i] = strlen(lib[i].au);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      num[lib[i].au[j] - 65] = num[lib[i].au[j] - 65] + 1;\n    }\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  x = k + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (lib[i].au[j] == x)\n        printf(\"%d\\n\", lib[i].no);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2745", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], i, l, j, max, s[26] = {0};\n  char c[1000][27], w;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j < l; j++) {\n      s[c[i][j] - 65]++;\n    }\n  }\n  max = s[0];\n  w = 'A';\n  for (i = 1; i < 26; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      w = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == w) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N;\nint A[2013], Ans[1222];\nchar W[2013][28];\ndouble Max(double X, double Y) { return X > Y ? X : Y; }\nint main() {\n  scanf(\"%d \", &N);\n  for (int I = 1; I <= N; I++)\n    cin >> A[I] >> W[I];\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      Ans[W[I][J]]++;\n  }\n  int Max = 0, T;\n  for (int I = 65; I <= 'Z'; I++)\n    if (Ans[I] > Max) {\n      Max = Ans[I];\n      T = I;\n    }\n  cout << T << \"\\n\" << Max << \"\\n\";\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      if (W[I][J] == T)\n        cout << A[I] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct test {\n  int num;\n  int book[100];\n\n} a[26];\nint main() {\n  int n, i, j, index, temp, max;\n  char s[100];\n  char ch;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &index, &s);\n    for (j = 0; s[j] != '\\0'; j++) {\n      temp = (int)(s[j] - 'A');\n      a[temp].book[a[temp].num] = index;\n      a[temp].num++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i].num > a[max].num) {\n      max = i;\n    }\n  }\n  ch = (char)('A' + max);\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", a[max].num);\n  for (i = 0; i < a[max].num; i++) {\n    cout << a[max].book[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char author[26];\n};\nint main() {\n  struct book b[999];\n  int a[26];\n  int m, i, j, max, maxauthor;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].id, b[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      a[c - 65]++;\n    }\n  }\n  max = a[0];\n  maxauthor = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxauthor = i;\n    }\n  }\n  cout << maxauthor + 65 << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      if (c == maxauthor + 65) {\n        cout << b[i].id << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d\", &p1->num);\n  scanf(\"%s\", p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head;\n  struct student *p1;\n  char *p2;\n  int i;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == 'A') {\n        a[0] = a[0] + 1;\n      }\n      if ((*p2) == 'B') {\n        a[1] = a[1] + 1;\n      }\n      if ((*p2) == 'C') {\n        a[2] = a[2] + 1;\n      }\n      if ((*p2) == 'D') {\n        a[3] = a[3] + 1;\n      }\n      if ((*p2) == 'E') {\n        a[4] = a[4] + 1;\n      }\n      if ((*p2) == 'F') {\n        a[5] = a[5] + 1;\n      }\n      if ((*p2) == 'G') {\n        a[6] = a[6] + 1;\n      }\n      if ((*p2) == 'H') {\n        a[7] = a[7] + 1;\n      }\n      if ((*p2) == 'I') {\n        a[8] = a[8] + 1;\n      }\n      if ((*p2) == 'J') {\n        a[9] = a[9] + 1;\n      }\n      if ((*p2) == 'K') {\n        a[10] = a[10] + 1;\n      }\n      if ((*p2) == 'L') {\n        a[11] = a[11] + 1;\n      }\n      if ((*p2) == 'M') {\n        a[12] = a[12] + 1;\n      }\n      if ((*p2) == 'N') {\n        a[13] = a[13] + 1;\n      }\n      if ((*p2) == 'O') {\n        a[14] = a[14] + 1;\n      }\n      if ((*p2) == 'P') {\n        a[15] = a[15] + 1;\n      }\n      if ((*p2) == 'Q') {\n        a[16] = a[16] + 1;\n      }\n      if ((*p2) == 'R') {\n        a[17] = a[17] + 1;\n      }\n      if ((*p2) == 'S') {\n        a[18] = a[18] + 1;\n      }\n      if ((*p2) == 'T') {\n        a[19] = a[19] + 1;\n      }\n      if ((*p2) == 'U') {\n        a[20] = a[20] + 1;\n      }\n      if ((*p2) == 'V') {\n        a[21] = a[21] + 1;\n      }\n      if ((*p2) == 'W') {\n        a[22] = a[22] + 1;\n      }\n      if ((*p2) == 'X') {\n        a[23] = a[23] + 1;\n      }\n      if ((*p2) == 'Y') {\n        a[24] = a[24] + 1;\n      }\n      if ((*p2) == 'Z') {\n        a[25] = a[25] + 1;\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  printf(\"%c \", j + 65);\n  printf(\"%d \", a[j]);\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == j + 65) {\n        cout << p1->num << \" \";\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "2750", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n};\nint main() {\n  int n, i, j, l, sum[26], t = 0, T = 0;\n  struct book a[1000];\n  memset(sum, 0, sizeof(sum));\n  char A;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].name;\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      sum[a[i].name[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > t) {\n      t = sum[i];\n      T = i;\n    }\n  }\n  A = 'A' + T;\n  cout << A << endl;\n  cout << t << endl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 27; j++) {\n      if (a[i].name[j] == A)\n        cout << a[i].num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int number[n + 1];\n  int writer[26] = {0};\n  char book[n + 1][27];\n  for (int i = 1; i <= n; ++i) {\n    cin >> number[i] >> book[i];\n    for (int t = 0; t < strlen(book[i]); ++t)\n      writer[book[i][t] - 'A']++;\n  }\n  int nn = 0;\n  for (int i = 0; i < 26; ++i)\n    nn = max(nn, writer[i]);\n\n  int person1;\n  for (int i = 0; i < 26; ++i) {\n    if (writer[i] == nn) {\n      person1 = i;\n      break;\n    }\n  }\n  char person = person1 + 'A';\n  cout << person << endl << nn << endl;\n  for (int i = 1; i <= n; ++i) {\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      if (book[i][t] == person) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max, p;\n  int mwj;\n  int shu[1000];\n  char zuo[1000][30];\n  int w[26];\n  for (i = 0; i < 26; i++)\n    w[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i], zuo[i]);\n    for (j = 0; j < strlen(zuo[i]); j++)\n      w[(zuo[i][j] - 65)] = w[(zuo[i][j] - 65)] + 1;\n  }\n  max = w[0];\n  p = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p + 65);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      mwj = zuo[i][j];\n      if (mwj == p + 65) {\n        printf(\"%d\\n\", shu[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0;\n  cin >> n;\n  int num[1000];\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = 0;\n\n  char a[1000][27];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &num[i], a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      sum[a[i][j] - 'A'] = sum[a[i][j] - 'A'] + 1;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (sum[i] > sum[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n\", max + 'A');\n  printf(\"%d\\n\", sum[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] == max + 'A') {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct b {\n    int num;\n    char str[27];\n  } b[100];\n  int n, i, m, j, max, nmax;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].str);\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++)\n      a[b[i].str[j] - 65]++;\n  }\n  max = a[0];\n  nmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      nmax = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", nmax + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      if (b[i].str[j] == nmax + 65) {\n        printf(\"%d\\n\", b[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2755", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char wri[27];\n  struct inf *next;\n};\n\nint main() {\n  int n, i, time[26] = {0};\n  char *pn;\n  struct inf *head, *p1, *p0, *p;\n  scanf(\"%d \", &n);\n  p1 = head = (struct inf *)malloc(sizeof(struct inf));\n  for (i = 0; i < n; i++) {\n    p0 = (struct inf *)malloc(sizeof(struct inf));\n    scanf(\"%d%s\", &p0->num, p0->wri);\n    p0->next = NULL;\n    p1->next = p0;\n    p1 = p0;\n    pn = p0->wri;\n    while (*pn != '\\0') {\n      time[*pn - 65]++;\n      pn = pn + 1;\n    }\n  }\n  int max = 0, k;\n  for (i = 0; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  p = head;\n  while (p != NULL) {\n\n    pn = p->wri;\n    while (*pn != '\\0') {\n      if (*pn == k + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      pn = pn + 1;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        cout << a[i].number << \"\\n\";\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int n;\n  char s[26];\n} b[1000];\n\nint main() {\n  int n, i, j, c[26] = {0};\n  char t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int d, m;\n    scanf(\"%d%s\", &b[i].n, b[i].s);\n    d = strlen(b[i].s);\n    for (m = 0; m < d; m++)\n      c[b[i].s[m] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++)\n      if (c[j] > c[i])\n        break;\n    if (j == 26)\n      break;\n  }\n  t = 65 + i;\n  printf(\"%c\\n%d\\n\", t, c[i]);\n  for (i = 0; i < n; i++) {\n    if (strchr(b[i].s, t) != NULL) {\n      printf(\"%d\\n\", b[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct bookinf {\n    int code;\n    char auth[27];\n  } book[999];\n  int i, k, m, max = 0, num[26];\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].code, book[i].auth);\n    for (k = 0; book[i].auth[k] != '\\0'; k++)\n      num[book[i].auth[k] - 'A'] += 1;\n  }\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < m; i++) {\n    for (k = 0; book[i].auth[k] != '\\0'; k++) {\n      if (book[i].auth[k] == max + 'A') {\n        printf(\"%d\\n\", book[i].code);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2759", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p;\n  p = (int *)malloc(26 * sizeof(int));\n  struct book {\n    int num;\n    char s[26];\n  } b[999];\n  int n, i, j, ss, max = 0, r;\n  char x;\n  for (ss = 0; ss < 26; ss++)\n    *(p + ss) = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i].num >> b[i].s;\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      *(p + ((int)b[i].s[j] - 65)) += 1;\n    }\n  }\n  for (r = 0; r < 26; r++)\n    max = max > *(p + r) ? max : *(p + r);\n  for (r = 0; r < 26; r++) {\n    if (*(p + r) == max) {\n      printf(\"%c\", (65 + r));\n      x = r;\n      printf(\"\\n\");\n      printf(\"%d\\n\", max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      if ((int)b[i].s[j] - 65 == x)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, best = 0, max = 0, a[26] = {0}, num[100], l, j, k;\n  char letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                     'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                     'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'},\n       writer[100][26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &num[i], &writer[i]);\n\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      for (k = 0; k < 26; k++) {\n        if (writer[i][j] == letter[k]) {\n          a[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      best = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n\", letter[best]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      if (writer[i][j] == letter[best]) {\n        printf(\"%d\\n\", num[i]);\n        ;\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int bkn, m = 1, n, i, j;\n  char bka[30];\n\n  struct author {\n    int num;\n    int p[200];\n  } a[30];\n  cin >> n;\n  for (i = 1; i < 27; i++)\n    a[i].num = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bkn, bka);\n    for (j = 0; j < strlen(bka); j++) {\n      a[bka[j] - 64].num++;\n      a[bka[j] - 64].p[a[bka[j] - 64].num - 1] = bkn;\n    }\n  }\n  for (i = 2; i < 27; i++)\n    if (a[i].num > a[m].num)\n      m = i;\n  cout << m + 64 << \"\\n\" << a[m].num << \"\\n\";\n  for (i = 0; i < a[m].num; i++)\n    printf(\"%d\\n\", a[m].p[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2762", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int book[1000];\n  char author[1000][10];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> author[i];\n  }\n  int num[26] = {0};\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      num[author[i][j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char maxi;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      maxi = 'A' + i;\n    }\n  }\n  cout << maxi << endl;\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        sum++;\n      }\n    }\n  }\n  printf(\"%d\\n\", sum);\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        cout << book[i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  long int num;\n  char name[26];\n} book[1000];\nint main() {\n  int m, i, j, r;\n  int writer[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    r = strlen(book[i].name);\n    for (j = 0; j < r; j++) {\n      writer[book[i].name[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char w = 'A';\n  for (i = 0; i < 26; i++) {\n    if (writer[i] > max) {\n      max = writer[i];\n      w = i + 'A';\n    }\n  }\n  cout << w << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < r; j++) {\n      r = strlen(book[i].name);\n      if (book[i].name[j] == w) {\n        printf(\"%ld\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ma = 'A';\n  int cnt[128] = {0};\n  int i, j, n;\n  struct s {\n    int id;\n    char au[27];\n  } bk[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      cnt[bk[i].au[j]]++;\n      if (cnt[bk[i].au[j]] > cnt[ma]) {\n        ma = bk[i].au[j];\n      }\n    }\n  }\n  cout << ma << \"\\n\" << cnt[ma] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (strchr(bk[i].au, ma))\n      printf(\"%d\\n\", bk[i].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char writer[1000][30];\n  char abc[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int m, n, mark[1000], num[26] = {0}, sum = 0, i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &mark[i]);\n    scanf(\"%s\", writer[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == 'A')\n        num[0]++;\n      else if (writer[i][j] == 'B')\n        num[1]++;\n      else if (writer[i][j] == 'C')\n        num[2]++;\n      else if (writer[i][j] == 'D')\n        num[3]++;\n      else if (writer[i][j] == 'E')\n        num[4]++;\n      else if (writer[i][j] == 'F')\n        num[5]++;\n      else if (writer[i][j] == 'G')\n        num[6]++;\n      else if (writer[i][j] == 'H')\n        num[7]++;\n      else if (writer[i][j] == 'I')\n        num[8]++;\n      else if (writer[i][j] == 'J')\n        num[9]++;\n      else if (writer[i][j] == 'K')\n        num[10]++;\n      else if (writer[i][j] == 'L')\n        num[11]++;\n      else if (writer[i][j] == 'M')\n        num[12]++;\n      else if (writer[i][j] == 'N')\n        num[13]++;\n      else if (writer[i][j] == 'O')\n        num[14]++;\n      else if (writer[i][j] == 'P')\n        num[15]++;\n      else if (writer[i][j] == 'Q')\n        num[16]++;\n      else if (writer[i][j] == 'R')\n        num[17]++;\n      else if (writer[i][j] == 'S')\n        num[18]++;\n      else if (writer[i][j] == 'T')\n        num[19]++;\n      else if (writer[i][j] == 'U')\n        num[20]++;\n      else if (writer[i][j] == 'V')\n        num[21]++;\n      else if (writer[i][j] == 'W')\n        num[22]++;\n      else if (writer[i][j] == 'X')\n        num[23]++;\n      else if (writer[i][j] == 'Y')\n        num[24]++;\n      else if (writer[i][j] == 'Z')\n        num[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= sum) {\n      sum = num[i];\n      n = i;\n    }\n  }\n  printf(\"%c\\n\", abc[n]);\n  printf(\"%d\\n\", num[n]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == abc[n]) {\n        cout << mark[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "2", "index": "2766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, f = 0, c, d;\n  struct aut {\n    int num;\n    char wrt[26];\n  } a[999];\n  char wr[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int g[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].num, a[i].wrt);\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].wrt[j] == wr[k])\n          g[k] = g[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (f < g[i]) {\n      f = g[i];\n      d = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", wr[d], f);\n  for (i = 0; i < n; i++) {\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      if (a[i].wrt[j] == wr[d]) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2767", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct xinxi {\n  int sh;\n  char zz[20];\n} a[1000];\nint main() {\n  int n, i, l, j, b[26] = {0}, m = 0, k = 0;\n  char c;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].sh, a[i].zz);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      b[a[i].zz[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] > m) {\n      m = b[i];\n      k = i;\n    }\n  c = k + 65;\n  printf(\"%c\\n%d\\n\", c, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      if (a[i].zz[j] == c)\n        printf(\"%d\\n\", a[i].sh);\n  }\n}\n"}
{"label": "2", "index": "2768", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef char q[30];\nvoid init(int a[], int f[], q *p[1000], int m) {\n  int i;\n\n  char e[432];\n  char *pp;\n  int r;\n  for (i = 1; i <= m; i++) {\n    p[i] = (q *)malloc(sizeof(q));\n\n    scanf(\"%d%s\", &f[i], p[i]);\n    getchar();\n    pp = *p[i];\n    while (*pp != '\u0000') {\n      a[*pp]++;\n      pp++;\n    }\n  }\n}\nchar pro(int a[]) {\n  char c, max, g;\n  max = -333;\n  for (c = 'A'; c <= 'Z'; c++)\n\n    if (a[c] > max) {\n      max = a[c];\n      g = c;\n    }\n  return g;\n}\nvoid print(int f[], q *p[1000], int m, char c) {\n  int i;\n  for (i = 1; i <= m; i++)\n    if (strchr(*p[i], c) != NULL)\n      printf(\"%d \", f[i]);\n}\nint main() {\n  int m, k;\n  int a[343] = {0};\n  int f[1000];\n  q *p[1000];\n  char max;\n  \n  \n  scanf(\"%d\", &m);\n\n  init(a, f, p, m);\n  max = pro(a);\n  printf(\"%c %d \", max, a[max]);\n\n  print(f, p, m, max);\n}\n"}
{"label": "2", "index": "2769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  char a[1000][10] = {0};\n  char b[1000][30];\n  int len[1000] = {0};\n  int c[150] = {0};\n  int max = 0;\n  int i, j, k, p, q, r, s;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    len[i] = strlen(b[i]);\n\n    for (j = 0; j < len[i]; j++) {\n\n      for (k = 65; k <= 90; k++) {\n        if (b[i][j] == k)\n          c[k]++;\n      }\n    }\n  }\n  for (p = 65; p <= 90; p++) {\n    if (c[p] > max)\n      max = c[p];\n  }\n  for (q = 65; q <= 90; q++) {\n    if (c[q] == max) {\n      cout << q << \"\\n\" << max << \"\\n\";\n      for (r = 0; r < m; r++) {\n        for (s = 0; s < len[r]; s++) {\n          if (b[r][s] == q)\n            cout << a[r] << \"\\n\";\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, card[1000], num[26] = {0}, max = 0, k = 0;\n  char s[1000][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &card[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      num[s[i][j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  cout << k + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != 0; j++)\n      if (s[i][j] == k + 'A') {\n        printf(\"%d\\n\", card[i]);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = 0, m, i, j, n, k, a[999], c[26] = {0};\n  char b[999][999];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < m; i++) {\n    k = strlen(b[i]);\n    for (j = 0; j < k; j++)\n      c[b[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++) {\n    if (t < c[j])\n      t = c[j];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == t) {\n      printf(\"%c\\n\", i + 'A');\n      break;\n    }\n  }\n  printf(\"%d\\n\", t);\n  for (j = 0; j < m; j++) {\n    k = strlen(b[j]);\n    for (n = 0; n < k; n++) {\n      if ((b[j][n] - 'A') == i)\n        printf(\"%d\\n\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  char writer[32];\n  int id;\n  struct book *next;\n};\nstruct book *create(int m) {\n  struct book *head = NULL, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->id, p1->writer);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->id, p1->writer);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int m, i, *q1, *q2, j;\n  q1 = (int *)malloc(26 * sizeof(int *));\n  q2 = q1;\n  for (i = 0; i < 26; i++)\n    q1[i] = 0;\n  q1 = q2;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      q1[p->writer[j] - 'A']++;\n    p = p->next;\n  }\n  q1 = q2;\n  int max = 0;\n  char maxm = 'A';\n  for (i = 0; i < 26; i++)\n    if (max < q1[i]) {\n      max = q1[i];\n      maxm = i + 'A';\n    }\n  cout << maxm << \" \" << max;\n  for (i = 0, p = head; i < m; i++, p = p->next)\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == maxm)\n        printf(\" %d\", p->id);\n  return 0;\n}\n"}
{"label": "2", "index": "2773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[999], count[27] = {0}, len[999];\n  int m, i, j, max = 0, per;\n  cin >> m;\n  char ch[999][26], person;\n  for (i = 1; i <= m; i++) {\n    cin >> num[i] >> ch[i];\n    len[i] = strlen(ch[i]);\n    for (j = 0; j <= len[i] - 1; j++) {\n      count[ch[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      per = i;\n    }\n  }\n  person = per + 64;\n  cout << person << endl;\n  cout << count[per] << endl;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (ch[i][j] == person) {\n        cout << num[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, max = -1;\n  int c[26];\n  char prname;\n  struct list {\n    int num;\n    char writer[27];\n    int len;\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n\n    cin >> book[i].writer;\n    book[i].len = strlen(book[i].writer);\n  }\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < book[i].len; j++) {\n      switch (book[i].writer[j]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n    else\n      continue;\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] != max)\n      continue;\n    else {\n      prname = i + 65;\n      printf(\"%c \", prname);\n      printf(\"%d \", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < book[j].len; k++) {\n          if (book[j].writer[k] != prname)\n            continue;\n          else {\n            printf(\"%d \", book[j].num);\n            break;\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int mark;\n  char name[26];\n};\nint main() {\n  int m, h, i, j, k, max, length;\n  int t[26];\n  char a;\n  scanf(\"%d\", &m);\n  struct book book[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].mark, book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    a = 'A' + i;\n    t[i] = 0;\n    for (j = 0; j < m; j++) {\n      length = strlen(book[i].name);\n\n      for (h = 0; h < 26; h++)\n        if (a == book[j].name[h]) {\n          t[i]++;\n        }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (t[i] > max) {\n      max = t[i];\n      k = i;\n    }\n  }\n  a = 'A' + k;\n  cout << a << \"\\n\" << t[k] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].name);\n    for (j = 0; j < 26; j++) {\n      if ('A' + k == book[i].name[j])\n        printf(\"%d\\n\", book[i].mark);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n    int zzsl;\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  cin >> n;\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  cin >> p1->sl >> p1->zz;\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n    p1->zzsl = strlen(p1->zz);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i;\n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  zzzdnum = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, l, j, t, k[30][99], a[30], o, q, max = 0, maxman;\n  for (i = 0; i < 30; i++)\n    a[i] = 0;\n  char s[40];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %s\", &o, s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      q = s[i] - 'A';\n      a[q]++;\n      t = a[q];\n      k[q][t] = o;\n    }\n  }\n  for (i = 'A' - 'A'; i <= 'Z' - 'A'; i++) {\n    if (a[i] > max) {\n\n      max = a[i];\n      maxman = i;\n    }\n  }\n  cout << maxman + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 1; i <= max; i++)\n\n    printf(\"%d\\n\", k[maxman][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct books {\n  int num;\n  char writer[26];\n  struct books *next;\n};\n\nint m;\n\nstruct books *creat() {\n  struct books *head, *p1, *p2;\n  int i;\n  p2 = p1 = (struct books *)malloc(sizeof(struct books));\n  for (i = 1; i <= m; i++) {\n    if (i == 1)\n      head = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p2 = p1;\n    if (i != m) {\n      p1 = (struct books *)malloc(sizeof(struct books));\n      p2->next = p1;\n    } else\n      p2->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  int character[26];\n  struct books *head, *p;\n  int i, max = 0, imax;\n  for (i = 0; i < 26; i++)\n    character[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat();\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      character[*(p->writer + i) - 'A']++;\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (character[i] > max) {\n      max = character[i];\n      imax = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", imax + 'A', max);\n\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      if (*(p->writer + i) == imax + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n}\n"}
{"label": "2", "index": "2779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char id;\n  int count;\n  int books[1000];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct author *pa = (const struct author *)a;\n  const struct author *pb = (const struct author *)b;\n  return pb->count - pa->count;\n}\n\nint main() {\n  int i, j, num, id, len, idx;\n  struct author authors[26];\n  char c;\n  char buffer[26];\n  for (i = 0; i < 26; ++i) {\n    authors[i].id = 'A' + i;\n    authors[i].count = 0;\n  }\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %s\", &id, buffer);\n    len = strlen(buffer);\n    for (j = 0; j < len; ++j) {\n      idx = buffer[j] - 'A';\n      authors[idx].books[authors[idx].count] = id;\n      authors[idx].count++;\n    }\n  }\n  qsort(authors, 26, sizeof(struct author), cmp);\n  printf(\"%c\\n\", authors[0].id);\n  cout << authors[0].count << \"\\n\";\n  for (i = 0; i < authors[0].count; ++i)\n    printf(\"%d\\n\", authors[0].books[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2780", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n} * p1, *p2;\n\nstruct book *creat(void) {\n  struct book *head;\n  int i;\n  head = 0;\n  p1 = 0;\n  p2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    if (head == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct book *head, *p;\n  char a[27], *q, c;\n  int b[27], i, m, n1 = 0, max;\n  for (i = 1; i < 27; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  head = creat();\n  for (p = head; p != 0; p = p->next) {\n    for (q = p->name; *q != '\u0000'; q++) {\n      m = 0;\n      for (i = 1; i <= n1; i++)\n        if (*q == a[i]) {\n          m = 1;\n          b[i]++;\n          break;\n        }\n      if (m == 0) {\n        n1++;\n        a[n1] = *q;\n        b[n1] = 1;\n      }\n    }\n  }\n  max = b[1];\n  c = a[1];\n  for (i = 1; i <= n1 - 1; i++)\n    if (b[i] > max) {\n      c = a[i];\n      max = b[i];\n    }\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p != 0; p = p->next) {\n    m = 0;\n    for (q = p->name; *q != '\u0000'; q++)\n      if (*q == c) {\n        m = 1;\n        break;\n      }\n    if (m)\n      printf(\"%d \", p->num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct list_1 {\n  int book;\n  char name[30];\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  cin >> n;\n  int a[26];\n  struct list_1 shelf[n];\n  for (i = 0; i <= 25; i++)\n    a[i] = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &shelf[i].book, shelf[i].name);\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++)\n      a[shelf[i].name[j] - 'A']++;\n  }\n  int max, flag = 0, add = 0, temp = 0;\n  max = a[0];\n  for (i = 0; i <= 25; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      flag = i;\n    }\n  }\n  printf(\"%c \", flag + 'A');\n  cout << max << \" \";\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A')\n        add++;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A') {\n        printf(\"%d\", shelf[i].book);\n        temp++;\n        (temp < add) ? printf(\" \") : printf(\"\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[1001], num[27] = {0}, ascii[27];\n  char a[1001][27], p;\n  int i, j, m, n, t1, t;\n  cin >> m;\n  n = 26;\n  for (i = 0; i < m; i++) {\n    cin >> number[i];\n    cin >> a[i];\n    for (j = 0; j < strlen(a[i]); j++) {\n      num[a[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    ascii[i] = i;\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (num[j] > num[j - 1]) {\n        t = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = t;\n        t1 = ascii[j];\n        ascii[j] = ascii[j - 1];\n        ascii[j - 1] = t1;\n      }\n    }\n  }\n  p = 'A' + ascii[0];\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", num[0]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(a[i]); j++) {\n      if (a[i][j] == p) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, shu[1000], num[26], length[1000];\n  char author[1000][26], maxauthor;\n  cin >> m;\n  memset(num, 0, sizeof(num));\n  for (int i = 0; i < m; i++) {\n    cin >> shu[i] >> author[i];\n    length[i] = strlen(author[i]);\n    for (int j = 0; j < length[i]; j++)\n      num[author[i][j] - 'A'] += 1;\n  }\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (maxnum < num[i])\n      maxnum = num[i];\n  }\n  for (int i = 0; i < 26; i++) {\n    if (num[i] == maxnum) {\n      maxauthor = (char)('A' + i);\n      printf(\"%c\\n\", maxauthor);\n      cout << maxnum << endl;\n      break;\n    }\n  }\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < length[i]; j++) {\n      if (author[i][j] == maxauthor)\n        cout << shu[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[26];\n} book[1000];\nint main() {\n  int n, i, j, e, max = 0;\n  scanf(\"%d\", &n);\n  char da, c;\n  int temp[27] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    for (da = 'A'; da <= 'Z'; da++) {\n      for (j = 0; j < 26; j++) {\n        if (book[i].writer[j] == da)\n          temp[da - 'A' + 0]++;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] > max)\n      max = temp[j];\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] == max) {\n      c = j + 65;\n      printf(\"%c\\n%d\\n\", c, temp[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == c)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int n;\n  char s[27];\n} b[1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].n, b[i].s);\n  }\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (k = 0; b[i].s[k]; k++) {\n      switch (b[i].s[k]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      j = i;\n    }\n  }\n  int t = 0;\n  switch (j) {\n  case 0:\n    printf(\"A\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++) {\n        if (b[i].s[k] == 'A')\n          printf(\"%d\\n\", b[i].n);\n      }\n    }\n    break;\n  case 1:\n    printf(\"B\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'B')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 2:\n    printf(\"C\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'C')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 3:\n    printf(\"D\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'D')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 4:\n    printf(\"E\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'E')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 5:\n    printf(\"F\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'F')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 6:\n    printf(\"G\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'G')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 7:\n    printf(\"H\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'H')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 8:\n    printf(\"I\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'I')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 9:\n    printf(\"J\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'J')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 10:\n    printf(\"K\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'K')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 11:\n    printf(\"L\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'L')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 12:\n    printf(\"M\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 13:\n    printf(\"N\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 14:\n    printf(\"O\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'O')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 15:\n    printf(\"P\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'P')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 16:\n    printf(\"Q\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Q')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 17:\n    printf(\"R\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'R')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 18:\n    printf(\"S\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'S')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 19:\n    printf(\"T\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'T')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 20:\n    printf(\"U\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'U')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 21:\n    printf(\"V\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'V')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 22:\n    printf(\"W\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'W')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 23:\n    printf(\"X\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'X')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 24:\n    printf(\"Y\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Y')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 25:\n    printf(\"Z\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Z')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2786", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, n, max, l, y = 0;\n  struct book {\n    int num;\n    char aut[26];\n  } book[1000];\n  int a[26] = {0};\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'z'};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].aut;\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      l = strlen(book[j].aut);\n      for (k = 0; k < l; k++) {\n        if (book[j].aut[k] == b[i]) {\n          a[i]++;\n        }\n      }\n    }\n  }\n\n  for (i = m; i > 0; i--) {\n    for (j = 0; j < 26; j++) {\n      if (a[j] == i) {\n        max = a[j];\n        n = j;\n        printf(\"%c\\n\", b[j]);\n        printf(\"%d\\n\", a[j]);\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    l = strlen(book[i].aut);\n    for (j = 0; j < l; j++) {\n      if (book[i].aut[j] == b[n]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2787", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, m, b[26], t = 0, k;\n  char c[1000][20];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> a[i] >> c[i];\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++) {\n      if ('A' < c[i][j] < 'Z')\n        b[c[i][j] - 65]++;\n    }\n  for (i = 0; i < 26; i++)\n    if (b[i] > t) {\n      t = b[i];\n      k = i;\n    }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++) {\n      if (c[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n}\n"}
{"label": "2", "index": "2788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char name[20];\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nint main() {\n  int i;\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      a[(int)p->name[i] - 'A']++;\n    }\n    p = p->next;\n  }\n  int number, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c \", 'A' + number);\n  printf(\"%d \", max);\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      if (p->name[i] == 'A' + number)\n        break;\n    }\n    if (p->name[i] == 'A' + number)\n      printf(\"%d \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int NO;\n    char AUT[27];\n  } book[999];\n  int i, j, k, m, n, d, max;\n  int a[26] = {0}, b[26][999];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &book[i].NO);\n\n    cin >> book[i].AUT;\n    for (j = 0; book[i].AUT[j] != '\u0000'; j++) {\n      d = book[i].AUT[j] - 65;\n      b[d][a[d]] = book[i].NO;\n      a[d] = a[d] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d \", k + 65, max);\n  for (i = 0; i < a[k] - 1; i++) {\n    printf(\"%d \", b[k][i]);\n  }\n  cout << b[k][a[k] - 1];\n  return 0;\n}\n"}
{"label": "2", "index": "2790", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  char num[500];\n  char s[50];\n  struct book *next;\n};\nint main() {\n  struct book *head;\n  struct book *p1, *p2;\n  int m, mi, i, j, k, max, found;\n  int aut[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->s);\n  for (i = 0; i < strlen(p1->s); i++)\n    aut[(p1->s)[i] - 'A']++;\n  p1->next = NULL;\n\n  head = p2 = p1;\n\n  for (mi = 2; mi <= m; mi++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->s);\n    for (i = 0; i < strlen(p1->s); i++)\n      aut[(p1->s)[i] - 'A']++;\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (aut[i] > max) {\n      k = i;\n      max = aut[i];\n    }\n\n  printf(\"%c \", k + 65);\n  printf(\"%d \", aut[k]);\n\n  p1 = head;\n  for (i = 1; i <= m; i++) {\n    found = 0;\n    for (j = 0; j < strlen(p1->s); j++)\n      if ((p1->s)[j] == k + 65) {\n        found = 1;\n        break;\n      }\n    if (found == 1)\n      printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b = 0, max;\n  int let[26] = {0};\n  char a;\n  struct student {\n    int num;\n    char name[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      let[book[i].name[j] - 'A']++;\n    }\n  }\n  max = let[0];\n  for (i = 0; i < 25; i++) {\n    if (let[i] > max) {\n      max = let[i];\n      b = i;\n    }\n  }\n  a = b + 'A';\n  cout << a << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      if (book[i].name[j] == a) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int m = 0;\n  head = p1 = p2 = NULL;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (1) {\n    m += 1;\n    if (m >= n)\n      break;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct book *head, *p;\n  char maxchar;\n  int m, i = 0, max = 0, a[26] = {0};\n  scanf(\"%d\", &m);\n  head = creat(m);\n\n  for (p = head; p != NULL; p = p->next) {\n\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      int c = p->name[i] - 'A';\n      a[c]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxchar = 'A' + i;\n    }\n  }\n\n  cout << maxchar << \"\\n\" << max << \"\\n\";\n  for (p = head; p != NULL; p = p->next) {\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      if (p->name[i] == maxchar) {\n        cout << p->num << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2793", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m;\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\nstruct book *create(void) {\n  struct book *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int num[26] = {0}, i, j, max = 0;\n  struct book *p1, *p2, *head;\n  char *p;\n  p1 = create();\n  head = p1;\n  for (i = 0; i < m; i++) {\n    for (p = p1->name; *p != '\u0000'; p++) {\n      num[(*p) - 'A']++;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      j = i;\n    }\n  }\n  printf(\"%c \", ('A' + j));\n  printf(\"%d \", max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    p = p1->name;\n    for (p = p1->name; *p != '\u0000'; p++) {\n      if (*p == ('A' + j)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int nam;\n  char aut[27];\n} inf[1000];\nint main() {\n  int n, i, a[26] = {0}, k, max = 0, sum = 0;\n  char *p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &inf[i].nam, inf[i].aut);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      a[*p - 65]++;\n      p++;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    max = max > a[i] ? max : a[i];\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      break;\n    }\n  }\n  k = i + 65;\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        sum++;\n        break;\n      }\n      p++;\n    }\n  }\n  printf(\"%d\\n\", sum);\n  for (i = 0; i < n; i++) {\n    p = inf[i].aut;\n    while (*p != '\\0') {\n      if (*p == k) {\n        cout << inf[i].nam << \"\\n\";\n        break;\n      }\n      p++;\n    }\n  }\n}\n"}
{"label": "2", "index": "2795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, c[26] = {0}, max = 0;\n  char b[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  struct book {\n    int num;\n    char man[26];\n  } a[999];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].num, a[i].man);\n  i = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].man[j] == b[k])\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n  i = 0;\n  j = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[t], max);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (a[j].man[k] == b[t])\n        printf(\"%d\\n\", a[j].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], c[26] = {0}, max1 = 0, temp;\n  char m[1000][26], max2;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n    getchar();\n    cin.getline(m[i - 1], 26);\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++) {\n      c[m[i][j] - 'A']++;\n    }\n  \n  for (int s = 0; s < 26; s++) {\n    \n    if (max1 <= c[s]) {\n      max1 = c[s];\n      temp = s + 'A';\n      max2 = temp;\n    }\n  }\n  cout << max2 << endl;\n  cout << max1 << endl;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++)\n      if (m[i][j] == max2) {\n        cout << a[i] << endl;\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c;\n  int max = 0, store, m, i, x[26][1000] = {0}, coun[27] = {0}, flag;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &store);\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c < 65 || c > 90)\n        break;\n      else {\n        x[c - 64][i] = store;\n        coun[c - 64]++;\n      }\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (coun[i] > max) {\n      max = coun[i];\n      flag = i + 64;\n    }\n  }\n  printf(\"%c\\n\", flag);\n  printf(\"%d\\n\", coun[flag - 64]);\n  for (i = 1; i <= 1000; i++) {\n    if (x[flag - 64][i] != 0)\n      printf(\"%d\\n\", x[flag - 64][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char s[27];\n};\n\nstruct author {\n  int num;\n  int bn[1000];\n};\n\nint main() {\n  int m, i, j, l, max = 0;\n\n  char c;\n\n  struct book bk[1000];\n  struct author au['Z' + 1], t;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < 'Z' + 1; j++)\n    au[j].num = 0;\n  for (i = 0; i < m; i++) {\n\n    scanf(\"%d %s\", &bk[i].num, bk[i].s);\n\n    l = strlen(bk[i].s);\n\n    for (j = 0; j < l; j++)\n      au[bk[i].s[j]].bn[au[bk[i].s[j]].num++] = bk[i].num;\n  }\n\n  for (j = 0; j < 'Z' + 1; j++)\n    if (au[j].num > max) {\n      t = au[j];\n      c = j;\n      max = au[j].num;\n    }\n\n  cout << c << \"\\n\";\n  cout << t.num << \"\\n\";\n\n  for (i = 0; i < t.num; i++)\n    printf(\"%d\\n\", t.bn[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2799", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[100];\n  struct student *next;\n};\nint main() {\n  struct student *p1, *p2, *head;\n  int n, i, j, k, m, a[100];\n  char c[100], nam[100][100];\n  for (i = 0; i < 26; i++) {\n    c[i] = i + 65;\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->s);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->s;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  i = 0;\n  while (p1 != NULL) {\n    strcpy(nam[i], p1->s);\n    i++;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s\", nam[k]);\n    for (i = 0; i < 26; i++) {\n      for (j = 0; nam[k][j] != '\\00'; j++)\n        if (nam[k][j] == c[i])\n          a[i]++;\n    }\n  }\n  k = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > k)\n      k = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == k) {\n      printf(\"%c %d\", c[i], a[i]);\n      m = i;\n      break;\n    }\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; nam[i][j] != '\\00'; j++) {\n      if (nam[i][j] == c[m])\n        printf(\" %d\", p1->num);\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2800", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char number[100];\n  char name[100];\n  struct student *next;\n};\nint n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %s\", &p1->number, &p1->name);\n  head = NULL;\n  do {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %s\", &p1->number, &p1->name);\n  } while (i < n - 1);\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int h, i, k, m, j, max;\n  struct student *head;\n  struct student *p;\n  int sum[10000] = {0};\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  for (i = 65, k = 0; i <= 90; i++, k++) {\n    p = head;\n    do {\n      m = strlen(p->name);\n      for (j = 0; j < m; j++) {\n        if (p->name[j] == i)\n          sum[k]++;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  for (i = 0, max = sum[0]; i <= k; i++) {\n    if (sum[i] >= max) {\n      h = i;\n      max = sum[i];\n    }\n  }\n  printf(\"%c %d \", h + 65, max);\n  p = head;\n  do {\n    m = strlen(p->name);\n    for (j = 0; j < m; j++) {\n      if (p->name[j] == h + 65)\n        printf(\"%s \", p->number);\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct BOOK {\n  int id;\n  int author[26];\n};\nint main() {\n  struct BOOK book[1000];\n  int countauthor[26];\n  int n, i, j, minusA, no, count, max = 0, maxau;\n  char input[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      book[i].author[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &book[i].id);\n    scanf(\"%s\", &input);\n    no = strlen(input);\n    for (j = 0; j < no; j++) {\n      minusA = (input[j] - 'A');\n      book[i].author[minusA]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      if (book[j].author[i] == 1)\n        count++;\n    }\n    countauthor[i] = count;\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < countauthor[i])\n      max = countauthor[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (countauthor[i] == max) {\n      maxau = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (maxau + 'A'), max);\n  for (i = 0; i < n; i++) {\n    if (book[i].author[maxau] == 1) {\n      printf(\"%d\\n\", book[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int code;\n  char writer[10];\n};\nint main() {\n  int n, i, j, t = 0, d, ww[27] = {0};\n  char max, w[27];\n  struct book list[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    w[i] = i + 65;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &list[i].code, list[i].writer);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n      for (d = 0; d < 26; d++)\n        if (list[i].writer[j] == w[d])\n          ww[d]++;\n    }\n  max = ww[0];\n  for (i = 0; i < 26; i++)\n    if (ww[i] > max) {\n      max = ww[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", w[t], ww[t]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n\n      if (list[i].writer[j] == w[t])\n        printf(\"%d\\n\", list[i].code);\n    }\n}\n"}
{"label": "2", "index": "2803", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  char zuozhe[100][100];\n  int shuhao[100];\n  int zuo[200];\n  int shu[200][200];\n  int n = 0, p, i, j;\n  int m[200];\n\n  for (i = 0; i < 200; i++) {\n    zuo[i] = 0;\n    m[i] = 0;\n  }\n\n  for (i = 0; i < a; i++)\n    scanf(\"%d %s\", &shuhao[i], zuozhe[i]);\n\n  for (i = 0; i < a; i++) {\n    for (j = 0; (zuozhe[i][j]) != '\\0'; j++) {\n      zuo[(zuozhe[i][j])] = zuo[(zuozhe[i][j])] + 1;\n      shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])] = shuhao[i];\n      m[(zuozhe[i][j])] = m[(zuozhe[i][j])] + 1;\n    }\n  }\n  for (i = 65; i <= 90; i++) {\n    if (zuo[i] > n) {\n      n = zuo[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", zuo[p]);\n  for (i = 0; i < m[p]; i++) {\n    printf(\"%d\\n\", shu[p][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2804", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n} book[1000];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, a[27], len, max = 0, number;\n  char p;\n  for (i = 1; i <= 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].name);\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      p = book[i].name[j];\n      a[p - 64] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", number + 64, a[number]);\n  for (i = 1; i <= m; i++) {\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      if (book[i].name[j] == number + 64) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  struct author_book {\n    int count;\n    int book[999];\n  } au[26];\n\n  for (int k = 0; k < 26; k++) {\n    au[k].count = 0;\n  }\n\n  int m;\n  cin >> m;\n\n  for (int i = 1; i <= m; i++) {\n    int num;\n    char a[26];\n    cin >> num;\n    cin.get();\n    cin.getline(a, 26);\n    for (int k = 0; k < strlen(a); k++) {\n      int author_r = (int)(a[k] - 'A');\n      au[author_r].book[au[author_r].count] = num;\n      au[author_r].count++;\n    }\n  }\n\n  int max = 0;\n  int the_one = 0;\n  for (int i = 0; i < 26; i++) {\n\n    if (au[i].count > max) {\n      max = au[i].count;\n      the_one = i;\n    }\n  }\n\n  char maxau = 'A' + the_one;\n  cout << maxau << endl;\n  printf(\"%d\\n\", au[the_one].count);\n\n  for (int i = 0; i < au[the_one].count; i++) {\n    printf(\"%d\\n\", au[the_one].book[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2806", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct index {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, a[26], *pr, max;\n  char s[26], *sp, *pt, temp;\n  for (pr = a; pr < a + 26; pr++) {\n    *pr = 0;\n  }\n  sp = s;\n  *sp = 65;\n  for (sp = s + 1; sp < s + 26; sp++) {\n    *sp = *(sp - 1) + 1;\n  }\n  struct index *p;\n  cin >> n;\n  struct index *ind = (struct index *)malloc(sizeof(struct index) * n);\n  for (p = ind; p < ind + n; p++) {\n    scanf(\"%d %s\", &p->num, p->wr);\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n        if (*pt == *sp) {\n          (*pr)++;\n        }\n      }\n    }\n  }\n  max = *a;\n  temp = 65;\n  for (pr = a, sp = s; pr < a + 26; pr++, sp++) {\n    if (*pr > max) {\n      max = *pr;\n      temp = *sp;\n    }\n  }\n  for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n    if (*pr == max) {\n      printf(\"%c\\n%d\\n\", *sp, *pr);\n    }\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      if (*pt == temp) {\n        printf(\"%d\\n\", (*p).num);\n      }\n    }\n  }\n  free(ind);\n  return 0;\n}\n"}
{"label": "2", "index": "2807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct data {\n  int no;\n  char au[10];\n};\nint main() {\n  struct data lib[1000];\n  char x;\n  int n, i, j, num[26] = {0}, l[1000], k, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &lib[i].no);\n    scanf(\"%s\", lib[i].au);\n    l[i] = strlen(lib[i].au);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++)\n      num[lib[i].au[j] - 65] = num[lib[i].au[j] - 65] + 1;\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  x = k + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (lib[i].au[j] == x)\n        cout << lib[i].no << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  char author[30];\n  struct info *next;\n};\nstruct info *create(int n) {\n  struct info *p1, *p2, *head;\n  int i;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d%s\", &p1->num, p1->author);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  i = 1;\n  while (i < n) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d%s\", &p1->num, p1->author);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  }\n  return head;\n}\n\nint main() {\n  int n, i, t, index, j;\n  struct info *head, *p;\n  int *g;\n  scanf(\"%d\", &n);\n  head = create(n);\n  g = (int *)malloc(26 * sizeof(int));\n  p = head;\n  for (i = 0, t = 0; i < 26; i++) {\n    *(g + i) = 0;\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      (*(g + (*(p->author + j)) - 65))++;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0, t = 0; i < 26; i++) {\n    if (*(g + i) > t) {\n      t = *(g + i);\n      index = i;\n    }\n  }\n  printf(\"%c\\n\", index + 65);\n  printf(\"%d\\n\", *(g + index));\n  p = head;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      if (*(p->author + j) == index + 65) {\n        printf(\"%d\\n\", p->num);\n      }\n      j++;\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct author {\n  int num;\n  char name[26];\n};\nstruct author ren[100];\n\nint main() {\n  int n, i, j = 0, k = 0, biao, maxzuozhe, p, geshu[26] = {0}, max = 0,\n            maxdeshu[999];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].num);\n    scanf(\"%s\", ren[i].name);\n  }\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(ren[j].name); k++) {\n        if ((i + 'A') == ren[j].name[k])\n          geshu[i] = geshu[i] + 1;\n      }\n    }\n  }\n  for (i = 'A' - 65; i <= 'Z' - 65; i++) {\n    if (max < geshu[i]) {\n      max = geshu[i];\n      biao = i;\n    }\n  }\n  maxzuozhe = 'A' + biao;\n  p = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (k = 0; k <= strlen(ren[i].name); k++) {\n      if (maxzuozhe == ren[i].name[k]) {\n        maxdeshu[p] = ren[i].num;\n        p++;\n        break;\n      }\n    }\n  }\n  cout << maxzuozhe << \"\\n\";\n  printf(\"%d\\n\", p);\n  for (i = 0; i <= p - 1; i++)\n    printf(\"%d\\n\", maxdeshu[i]);\n  getchar();\n  return 0;\n}\n"}
{"label": "2", "index": "2810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  char name[26];\n  int a;\n};\nint main() {\n  int n, i, k, l, m;\n  char j, t;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  struct Student stu[999];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &stu[i].a, stu[i].name);\n  }\n  for (j = 'A', k = 0; j <= 'Z'; j++, k++)\n    for (i = 0; i < n; i++)\n      for (l = 0; l < 26; l++)\n        if (stu[i].name[l] == j)\n          b[k]++;\n  for (j = 'A', k = 0, m = 0; j <= 'Z'; j++, k++)\n    if (b[k] > m) {\n      m = b[k];\n      t = j;\n    }\n  printf(\"%c\\n%d\", t, m);\n  for (i = 0; i < n; i++)\n    for (l = 0; l < 26; l++)\n      if (stu[i].name[l] == t)\n        printf(\"\\n%d\", stu[i].a);\n  return 0;\n}\n"}
{"label": "2", "index": "2811", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, c, big = 0;\n  int num[30] = {0}, a[1000];\n  char name[1000][20];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> name[i];\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(name[i]); j++) {\n        if (name[i][j] == k + 'A')\n          num[k] = num[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (big < num[i]) {\n      big = num[i];\n      c = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", big);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == c)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2812", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int No;\n    char author[27];\n    int yes;\n    struct book *next;\n  };\n  struct book *head, *p;\n  int m, i, *max;\n  int *count;\n  count = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(count + i) = 0;\n\n  p = (struct book *)malloc(sizeof(struct book));\n  head = p;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &p->No, p->author);\n    if (i == m - 1)\n      p->next = NULL;\n    else\n      p->next = (struct book *)malloc(sizeof(struct book));\n    p = p->next;\n  }\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      (*(count + ((*point) - 65)))++;\n      point++;\n    }\n    p = p->next;\n  }\n\n  max = count;\n  for (i = 0; i < 26; i++)\n    if (*(count + i) > *max)\n      max = count + i;\n  printf(\"%c\\n\", max - count + 65);\n  printf(\"%d\\n\", *max);\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      if (*point == max - count + 65)\n        printf(\"%d\\n\", p->No);\n      point++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n} book[1000];\nint judge(char *a, int b);\nint main(int argc, char *argv[]) {\n  char c;\n  int n = 0, i = 0, j = 0, rec[26] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      if (judge(book[j].name, i) == 1) {\n        rec[i]++;\n      }\n    }\n  }\n  j = 0;\n  k = rec[0];\n  for (i = 0; i < 25; i++) {\n    if (k < rec[i]) {\n      j = i;\n      k = rec[i];\n    }\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, k);\n  for (i = 0; i < n; i++) {\n    if (judge(book[i].name, j) == 1) {\n      cout << book[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\nint judge(char *a, int b) {\n  int i = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == 'A' + b)\n      return 1;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char author[26];\n};\nint main() {\n  struct book b[999];\n  int a[26];\n  int m, i, j, max, maxauthor;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].id, b[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      a[c - 65]++;\n    }\n  }\n  max = a[0];\n  maxauthor = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxauthor = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxauthor + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      if (c == maxauthor + 65) {\n        printf(\"%d\\n\", b[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char name[26];\n  int num[26];\n};\nvoid mostbook(struct book *p) {\n  int i, j, k;\n  k = strlen(p->name);\n  for (j = 0; j < 26; j++)\n    p->num[j] = 0;\n\n  for (i = 0; i < k; i++)\n    (p->num[(p->name[i] - 'A')])++;\n}\n\nint main() {\n  int i, j, m;\n  int max = 0;\n  int maxi = 0;\n  int s[26] = {0};\n\n  scanf(\"%d\", &m);\n  struct book *p;\n  p = (struct book *)malloc(m * sizeof(struct book));\n  for (i = 0; i < m; i++) {\n\n    scanf(\"%d\", &(p + i)->number);\n    scanf(\"%s\", &(p + i)->name);\n    mostbook(p + i);\n    for (j = 0; j < 26; j++)\n      s[j] += ((p + i)->num[j]);\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] >= max) {\n      max = s[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%c\\n\", (maxi + 'A'));\n\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < m; i++) {\n    int k, j;\n    k = strlen((p + i)->name);\n    for (j = 0; j < k; j++) {\n      if ((p + i)->name[j] == (maxi + 'A')) {\n        cout << (p + i)->number << \"\\n\";\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char id[11];\n  char name[30];\n};\nstruct au {\n  int num;\n  char id[1000][11];\n};\nint main() {\n  struct book b;\n  struct au a[26];\n  int n, i, j = 0, k;\n  char c;\n  for (i = 0; i < 26; i++)\n    a[i].num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", b.id, b.name);\n    while (b.name[j] != '\\0') {\n      k = b.name[j] - 'A';\n      strcpy(a[k].id[a[k].num], b.id);\n      a[k].num++;\n      j++;\n    }\n    j = 0;\n  }\n  k = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    j = (a[i].num > k) ? i : j;\n    k = (a[i].num > k) ? a[i].num : k;\n  }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[j].id[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char str[27];\n} bo[1000];\nstruct people {\n  int name;\n  int number;\n  int book_number[1000];\n} people[26];\nint main() {\n  int n, i, j, k, m, max = 0;\n  char a[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\\0'};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].id >> bo[i].str;\n  }\n  for (i = 0; i < 26; i++) {\n    people[i].number = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bo[i].str);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (bo[i].str[j] == a[k]) {\n          people[k].book_number[people[k].number] = bo[i].id;\n          people[k].number++;\n        }\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (people[i].number > max) {\n      j = i;\n      max = people[i].number;\n    }\n  }\n  cout << a[j] << endl;\n  printf(\"%d\\n\", people[j].number);\n  for (i = 0; i < people[j].number; i++) {\n    cout << people[j].book_number[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2818", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, nu, au, M, m;\n  int num[26] = {0};\n  int no[26][999];\n  char aut;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> nu;\n    cin.get();\n    aut = cin.get();\n    while (aut != 10) {\n      au = (int)(aut - 'A');\n      no[au][num[au]] = nu;\n      num[au]++;\n      aut = cin.get();\n    }\n  }\n  M = 0;\n  for (i = 0; i < 26; i++) {\n    if (M < num[i]) {\n      M = num[i];\n      m = i;\n    }\n  }\n  cout << (char)(m + 'A') << endl;\n  cout << M << endl;\n  for (i = 0; i < M; i++)\n    cout << no[m][i] << endl;\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "2", "index": "2819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar zimu[28] = \"ABCDEFGJIJKLMNOPQRSTUVWXYZ\";\nchar writer[10000][10000];\nint times[26], id[1000], i, len[10000], book = 0;\nint n, j, k, tmax_1, max_1 = 0;\n\nint main() {\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &id[i], &writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    times[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n\n        if (writer[i][j] == zimu[k])\n          times[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (times[i] > max_1) {\n      max_1 = times[i];\n      tmax_1 = i;\n    }\n  }\n  cout << zimu[tmax_1] << \" \";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        book++;\n      }\n    }\n  }\n  printf(\"%d \", book);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == zimu[tmax_1]) {\n        printf(\"%d \", id[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct Book {\n    int id;\n    char zz[26];\n  } book[1000];\n\n  int n, i, j, max = 0, index;\n  int sum[26] = {0};\n  char author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].id, &book[i].zz);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      sum[book[i].zz[j] - 'A']++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      author = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      if (book[i].zz[j] == author) {\n        printf(\"%d\\n\", book[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char peo[26];\n} book[999];\n\nint main() {\n  char zm, max;\n  int n, i, k, num, cishu = -1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, &book[i].peo);\n\n  for (zm = 'A'; zm <= 'Z'; zm++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].peo[k] == zm)\n          num++;\n      }\n    }\n    if (num > cishu) {\n      cishu = num;\n      max = zm;\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", cishu);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (book[i].peo[k] == max)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][26], t;\n  int b[1000], num[26] = {0}, n, i, j, k, max, l[1000];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> b[i];\n\n    cin >> a[i];\n    l[i] = strlen(a[i]);\n    for (j = 1; j <= l[i]; j++)\n      num[a[i][j] - 'A']++;\n  }\n  for (i = 0; i <= 25; i++)\n    if (num[i] > max) {\n      max = num[i];\n      t = i + 'A';\n    }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= l[i]; j++)\n      if (a[i][j] == t)\n        cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char au[32];\n  int sta[27];\n} b[1020];\nint main() {\n  int i, j, k, m, n;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].au);\n  }\n  for (i = 0; i < m; i++) {\n    \n    for (j = 0;; j++) {\n      c = b[i].au[j];\n      if (c == '\\0') {\n        break;\n      } else {\n        b[i].sta[c - 64]++;\n      }\n    }\n  }\n  int sum[27] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < 27; j++) {\n      sum[j] += b[i].sta[j];\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 27; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 64);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n    }\n  }\n  printf(\"%d\\n\", n);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n      if (n == 1) {\n        printf(\"%d\", b[i].num);\n      } else {\n        printf(\"\\n%d\", b[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char name[26];\n  int number;\n} a[1000];\nint main() {\n  int n, i, j, b[26] = {0}, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].name);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      b[a[i].name[j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (max < b[i])\n      max = b[i];\n  for (i = 0; i < 26; i++)\n    if (max == b[i]) {\n      t = i;\n      break;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, b[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      if (a[i].name[j] == t + 65) {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "2825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[20];\n};\nint main() {\n  struct book c[1000];\n  int i, j, n, k, max, l, d[26], a;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    cin >> c[k].num >> c[k].name;\n    for (i = 0; i < strlen(c[k].name); i++) {\n      for (j = 0; j < 26; j++) {\n        if ('A' + j == c[k].name[i])\n          break;\n      }\n      b[j] = b[j] + 1;\n    }\n  }\n  for (a = 0; a < 26; a++)\n    d[a] = b[a];\n  max = b[0];\n  for (l = 0; l < 26; l++)\n    if (b[l] > max)\n      max = b[l];\n  for (a = 0; a < 26; a++) {\n    if (d[a] == max)\n      break;\n  }\n  printf(\"%c\\n\", 'A' + a);\n  cout << max << \"\\n\";\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < strlen(c[k].name); i++) {\n      if ('A' + a == c[k].name[i]) {\n        printf(\"%d\\n\", c[k].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct books {\n    int num;\n    char author[26];\n  } books[999];\n  int n, a[26] = {0}, max, i, j, u, lenth, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &books[i].num, books[i].author);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      for (u = 0; u < 26; u++) {\n        if (books[i].author[j] == 'A' + u)\n          a[u]++;\n      }\n    }\n  }\n  temp = a[0];\n  for (u = 0; u < 26; u++)\n    if (a[u] >= temp) {\n      max = u;\n      temp = a[u];\n    }\n  printf(\"%c\\n%d\\n\", 'A' + max, a[max]);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      if (books[i].author[j] == 'A' + max)\n        cout << books[i].num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "2827", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int co;\n  char A[26];\n};\n\nint main() {\n  int m, i, k, max;\n  int count[26];\n  int *cc;\n  scanf(\"%d\", &m);\n  struct book *bk = (struct book *)malloc(sizeof(struct book) * m); \n  struct book *p;\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d %s\", &(p->co), p->A);\n  }\n  cc = count;                      \n  memset(count, 0, sizeof(count)); \n  for (i = 0; i < 26; i++, cc++) {\n    p = bk;\n    for (k = 0; k < m; k++, p++) {\n      if (strchr(p->A, 'A' + i)) {\n        (*cc)++;\n      }\n    } \n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > count[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max, count[max]);\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    if (strchr(p->A, 'A' + max)) {\n      printf(\"%d\\n\", p->co);\n    }\n  }\n  free(bk);\n  return 0;\n}\n"}
{"label": "2", "index": "2828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char name[26];\n  int num;\n  struct author *next;\n};\nint main() {\n  int i, n, a[26], j, t;\n  struct author *head;\n  struct author *p1, *p2;\n  p1 = p2 = (struct author *)malloc(1000);\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    if (i == 0)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != (n - 1))\n      p1 = p2->next = (struct author *)malloc(1000);\n    else {\n      p2->next = NULL;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  p1 = head;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      a[p1->name[j] - 'A']++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > a[t])\n      t = i;\n  }\n  printf(\"%c %d \", t + 'A', a[t]);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      if (p1->name[j] == t + 'A')\n        cout << p1->num << \" \";\n      continue;\n    }\n  }\n}\n"}
{"label": "2", "index": "2829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t[27], max;\n  char p, a[100][27], b[100][27];\n  cin >> n;\n  for (i = 1; i <= 26; i++)\n    t[i] = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", a[i], b[i]);\n  for (p = 'A'; p <= 'Z'; p++)\n    for (i = 1; i <= n; i++)\n      if (strchr(b[i], p))\n        t[p - 'A' + 1]++;\n  max = 1;\n  for (i = 2; i <= 26; i++)\n    if (t[max] < t[i])\n      max = i;\n  printf(\"%c\\n\", p = 'A' + max - 1);\n  printf(\"%d\\n\", t[p - 'A' + 1]);\n  for (i = 1; i <= n; i++)\n    if (strchr(b[i], p))\n      cout << a[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "2830", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct inf {\n  int sum;\n  char write[1000][4];\n};\nint main() {\n  int m;\n  int i, j;\n  char name[5];\n  char author[27];\n  struct inf book[26];\n  for (i = 0; i < 26; i++)\n    book[i].sum = 0;\n\n  scanf(\"%d \", &m);\n  cin.get();\n\n  while (m-- > 0) {\n    cin.get(name, 5);\n    cin.getline(author, 27);\n    for (i = 0; i < strlen(author); i++) {\n      book[author[i] - 'A'].sum++;\n      for (j = 0; j <= 3; j++) {\n        if (j < 3)\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = name[j];\n        else {\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = '\\0';\n        }\n      }\n    }\n  }\n\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (book[i].sum > max) {\n      t = i;\n      max = book[i].sum;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", (char)(t + 'A'), book[t].sum);\n  for (i = 1; i <= book[t].sum; i++)\n    cout << book[t].write[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct sa {\n  int a;\n  char b[100];\n  struct sa *next;\n};\nint n, m, k[27];\nstruct sa *kao(void) {\n  struct sa *head;\n  struct sa *p1, *p2;\n  n = 0;\n  head = NULL;\n  p1 = p2 = (struct sa *)malloc(1000);\n  scanf(\"%d %s\", &p1->a, p1->b);\n  head = p1;\n  for (;;) {\n    n++;\n    if (n == m + 1)\n      break;\n    if (n == 1) {\n      head = p1;\n    } else {\n      p2 = p1;\n      p1 = (struct sa *)malloc(1000);\n      scanf(\"%d %s\", &p1->a, p1->b);\n      p2->next = p1;\n    }\n  }\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  struct sa *p, *q, *head, *ped;\n  int f, i, g, s = 1, t, d = 0;\n  char c;\n  scanf(\"%d\", &m);\n  head = kao();\n  for (p = head; p != NULL; p = p->next) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      k[p->b[i] - 64]++;\n    }\n  }\n  t = k[1];\n  for (i = 2; i < 27; i++) {\n    if (k[i] > k[s]) {\n      s = i;\n      t = k[i];\n    }\n  }\n  printf(\"%c %d \", s + 64, t);\n  for (p = head; p != NULL;) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      if (p->b[i] == s + 64) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1) {\n      cout << p->a << \" \";\n    }\n    d = 0;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][100];\n  int b[1000], c[27], s[1000], max, i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], a[i]);\n    s[i] = strlen(a[i]);\n  }\n  for (j = 0; j < 26; j++) {\n    c[j] = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < s[i]; k++) {\n        if (a[i][k] == 65 + j)\n          c[j] = c[j] + 1;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      cout << c[i] << \"\\n\";\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < s[k]; j++) {\n          if (a[k][j] == 65 + i)\n            printf(\"%d\\n\", b[k]);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2833", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[25];\n} book[999];\nint main() {\n  int m, i, j, k, b, c, max = 0, a[25] = {0}, q[25][999] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].name;\n    b = strlen(book[i].name);\n    for (j = 0; j < b; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].name[j] == k + 65) {\n          a[k] = a[k] + 1;\n          q[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < 25; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, max);\n  for (i = 0; i < m; i++) {\n    if (q[c][i] > 0) {\n      printf(\"%d\\n\", q[c][i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct A {\n  char num[1000];\n  char B[27];\n};\nint main() {\n  int n, i, a, k, t;\n  int sb[27] = {0};\n  int sb2[27] = {0};\n  char x;\n\n  scanf(\"%d\", &n);\n\n  struct A book[999] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].B);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      a = book[i].B[k];\n      if (book[i].B[k] <= 'Z' && book[i].B[k] >= 'A') {\n        sb[a - 64]++;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    sb2[i] = sb[i];\n  }\n  for (i = 1; i < 26; i++) {\n    if (sb[i] > sb[i + 1]) {\n      a = sb[i];\n      sb[i] = sb[i + 1];\n      sb[i + 1] = a;\n    }\n  }\n\n  for (i = 1; i <= 26; i++) {\n    if (sb2[i] == sb[26]) {\n      t = i;\n    }\n  }\n  x = 'A' + t - 1;\n  printf(\"%c\\n%d\\n\", x, sb[26]);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      if (book[i].B[k] == '\\0')\n        break;\n\n      else if (book[i].B[k] == x)\n        printf(\"%s\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char wr[26];\n  struct book *next;\n};\nint main() {\n  int i, n, m = 0, j, a, b, c;\n  int s[100] = {0};\n  scanf(\"%d\", &n);\n  struct book *head, *p1, *p2, *p;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->wr);\n  head = NULL;\n  while (m != n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->wr);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      s[p->wr[j]]++;\n    p = p->next;\n  } while (p != NULL);\n  a = s[65];\n  c = 65;\n  for (i = 66; i < 91; i++)\n    if (a < s[i]) {\n      a = s[i];\n      c = i;\n    }\n  printf(\"%c %d \", c, a);\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      if (p->wr[j] == c)\n        cout << p->num << \" \";\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "2", "index": "2836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Book {\n  int number;\n  char author[30];\n};\n\nint main() {\n  int max = 0, len;\n  int sum[30] = {0};\n  int m, i, j;\n  struct Book book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].number, book[i].author);\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++)\n      sum[book[i].author[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > sum[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, sum[max]);\n  for (i = 0; i < m; i++) {\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++) {\n      if (book[i].author[j] == max + 65) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  char author[26];\n  int length;\n} a[1000];\n\nint main() {\n  int n, i, k, num = 0, max = 0;\n  char b, c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].author);\n    a[i].length = strlen(a[i].author);\n  }\n  for (b = 'A'; b <= 'Z'; b++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < a[i].length; k++) {\n        if (a[i].author[k] == b) {\n          num++;\n          break;\n        }\n      }\n    }\n    if (num > max) {\n      max = num;\n      c = b;\n    }\n  }\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < a[i].length; k++) {\n      if (a[i].author[k] == c) {\n        cout << a[i].id << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], i, b[26] = {0}, m, j, max = 0, k;\n  char str[1000][30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], str[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == 'A')\n        b[0]++;\n      if (str[i][j] == 'B')\n        b[1]++;\n      if (str[i][j] == 'C')\n        b[2]++;\n      if (str[i][j] == 'D')\n        b[3]++;\n      if (str[i][j] == 'E')\n        b[4]++;\n      if (str[i][j] == 'F')\n        b[5]++;\n      if (str[i][j] == 'G')\n        b[6]++;\n      if (str[i][j] == 'H')\n        b[7]++;\n      if (str[i][j] == 'I')\n        b[8]++;\n      if (str[i][j] == 'J')\n        b[9]++;\n      if (str[i][j] == 'K')\n        b[10]++;\n      if (str[i][j] == 'L')\n        b[11]++;\n      if (str[i][j] == 'M')\n        b[12]++;\n      if (str[i][j] == 'N')\n        b[13]++;\n      if (str[i][j] == 'O')\n        b[14]++;\n      if (str[i][j] == 'P')\n        b[15]++;\n      if (str[i][j] == 'Q')\n        b[16]++;\n      if (str[i][j] == 'R')\n        b[17]++;\n      if (str[i][j] == 'S')\n        b[18]++;\n      if (str[i][j] == 'T')\n        b[19]++;\n      if (str[i][j] == 'U')\n        b[20]++;\n      if (str[i][j] == 'V')\n        b[21]++;\n      if (str[i][j] == 'W')\n        b[22]++;\n      if (str[i][j] == 'X')\n        b[23]++;\n      if (str[i][j] == 'Y')\n        b[24]++;\n      if (str[i][j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2839", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  char writer[32];\n  int id;\n  struct book *next;\n};\nstruct book *create(int m) {\n  struct book *head = NULL, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->id, p1->writer);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->id, p1->writer);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int m, i, *q1, *q2, j;\n  q1 = (int *)malloc(26 * sizeof(int *));\n  q2 = q1;\n  for (i = 0; i < 26; i++)\n    q1[i] = 0;\n  q1 = q2;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      q1[p->writer[j] - 'A']++;\n    p = p->next;\n  }\n  q1 = q2;\n  int max = 0;\n  char maxm = 'A';\n  for (i = 0; i < 26; i++)\n    if (max < q1[i]) {\n      max = q1[i];\n      maxm = i + 'A';\n    }\n  printf(\"%c %d\", maxm, max);\n  for (i = 0, p = head; i < m; i++, p = p->next)\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == maxm)\n        printf(\" %d\", p->id);\n}\n"}
{"label": "2", "index": "2840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char book[1000][20] = {'\\0'}, name[1000][30] = {'\\0'};\n  int length, n, i, j, number[30] = {0}, memory, largest, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", book[i], name[i]);\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      temp = name[i][j] - 'A';\n      number[temp] += 1;\n    }\n  }\n  largest = 0;\n  for (i = 0; i < 26; i++) {\n    if (number[i] > largest) {\n      largest = number[i];\n      memory = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + memory, number[memory]);\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      if (name[i][j] == 'A' + memory)\n        printf(\"%s\\n\", book[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint cishu[26];\n\nstruct shu {\n  int num;\n  char name[26];\n  struct shu *next;\n};\n\nstruct shu *app(int n) {\n  int i, len, j;\n  struct shu *newnode, *p, *head;\n  for (i = 1; i <= n; i++) {\n    newnode = (struct shu *)malloc(sizeof(struct shu));\n    scanf(\"%d %s\", &newnode->num, newnode->name);\n    len = strlen(newnode->name);\n\n    for (j = 0; j < len; j++) {\n      cishu[newnode->name[j] - 'A']++;\n    }\n\n    if (i == 1) {\n      head = newnode;\n    } else {\n      p->next = newnode;\n    }\n    p = newnode;\n  }\n  p->next = 0;\n  return head;\n}\n\nint max(void) {\n  int m = 0, i, x;\n  for (i = 0; i < 26; i++) {\n    if (cishu[i] > m) {\n      m = cishu[i];\n      x = i;\n    }\n  }\n  return x;\n}\n\nint cunzai(char a[], int kk) {\n  int l, i;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (a[i] == kk + 'A')\n      return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int n, kk;\n  struct shu *head, *p;\n  scanf(\"%d\", &n);\n\n  head = app(n);\n  kk = max();\n  printf(\"%c\\n%d\\n\", 'A' + kk, cishu[kk]);\n\n  for (p = head; p != 0; p = p->next) {\n    if (cunzai(p->name, kk)) {\n      cout << p->num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Bo {\n  int num;\n  char auth[30];\n} a[1010];\n\nint main() {\n  int n, i, j, maxnum = 0, max;\n  int zuozhe[26] = {0};\n  char out;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].auth);\n    for (j = 0; j <= strlen(a[i].auth) - 1; j++)\n      zuozhe[a[i].auth[j] - 'A'] = zuozhe[a[i].auth[j] - 'A'] + 1;\n  }\n  for (i = 1; i <= 25; i++)\n    if (zuozhe[i] > zuozhe[maxnum])\n      maxnum = i;\n  out = 'A' + maxnum;\n  cout << out << \"\\n\";\n  cout << zuozhe[maxnum] << \"\\n\";\n\n  for (i = 1; i <= n; i++) {\n    if (strchr(a[i].auth, out) != NULL)\n      printf(\"%d\\n\", a[i].num);\n  }\n}\n"}
{"label": "2", "index": "2843", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nstruct book *creat() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  p1->next = NULL;\n  if (i >= n) {\n    free(p1);\n    head = NULL;\n    return head;\n  } else {\n    head = p1;\n    p2 = p1;\n    while (i < n) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n      p1->next = NULL;\n      i++;\n      {\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n    p2->next = p1;\n    p1->next = NULL;\n    return head;\n  }\n}\nint max(char letter, struct book *head) {\n  int i, j, k;\n  i = 0;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        i++;\n    }\n    q = q->next;\n  }\n  return i;\n}\n\nvoid outbook(char letter, struct book *head) {\n  int j, k;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        printf(\"%d \", q->num);\n    }\n    q = q->next;\n  }\n}\nint main() {\n  int i, m, s;\n  struct book *p0, *p1;\n  p0 = p1 = creat();\n  int sum[26];\n  for (i = 0; i < 26; i++) {\n    sum[i] = max(i + 65, p0);\n  }\n  s = 0;\n  m = sum[0];\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > m) {\n      m = sum[i];\n      s = i;\n    }\n  }\n  printf(\"%c \", s + 65);\n  printf(\"%d \", m);\n  outbook(s + 65, p1);\n}\n"}
{"label": "2", "index": "2844", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  char name[1000][26];\n  int num[1000];\n  int i, j;\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> name[i];\n  }\n  int a[26] = {0};\n  char k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == 'A')\n        a[0]++;\n      if (name[i][j] == 'B')\n        a[1]++;\n      if (name[i][j] == 'C')\n        a[2]++;\n      if (name[i][j] == 'D')\n        a[3]++;\n      if (name[i][j] == 'E')\n        a[4]++;\n      if (name[i][j] == 'F')\n        a[5]++;\n      if (name[i][j] == 'G')\n        a[6]++;\n      if (name[i][j] == 'H')\n        a[7]++;\n      if (name[i][j] == 'I')\n        a[8]++;\n      if (name[i][j] == 'J')\n        a[9]++;\n      if (name[i][j] == 'K')\n        a[10]++;\n      if (name[i][j] == 'L')\n        a[11]++;\n      if (name[i][j] == 'M')\n        a[12]++;\n      if (name[i][j] == 'N')\n        a[13]++;\n      if (name[i][j] == 'O')\n        a[14]++;\n      if (name[i][j] == 'P')\n        a[15]++;\n      if (name[i][j] == 'Q')\n        a[16]++;\n      if (name[i][j] == 'R')\n        a[17]++;\n      if (name[i][j] == 'S')\n        a[18]++;\n      if (name[i][j] == 'T')\n        a[19]++;\n      if (name[i][j] == 'U')\n        a[20]++;\n      if (name[i][j] == 'V')\n        a[21]++;\n      if (name[i][j] == 'W')\n        a[22]++;\n      if (name[i][j] == 'X')\n        a[23]++;\n      if (name[i][j] == 'Y')\n        a[24]++;\n      if (name[i][j] == 'Z')\n        a[25]++;\n    }\n  }\n  int max = a[0];\n  int o = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      o = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[o], a[o]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == b[o])\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  scanf(\"%d\", &i);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2845", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int m, i, j, len, max;\n  int id[1000], b[26] = {0};\n  char a[100][27], name;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> id[i] >> a[i];\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      b[a[i][j] - 'A']++;\n  }\n  max = b[0];\n  name = 'A';\n  for (j = 1; j < 26; j++) {\n    if (b[j] > max) {\n      max = b[j];\n      name = j + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < m; i++) {\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == name) {\n        strcpy(a[i], \"shuchu\");\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(a[i], \"shuchu\") == 0)\n      printf(\"%d\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2846", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nint main() {\n  int m, i, j, l, max, maxi;\n  int n[26] = {0};\n  struct book *head, *p1, *p2;\n  char *p;\n  scanf(\"%d\", &m);\n  i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  head = NULL;\n  while (i < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < m) {\n      p1 = (struct book *)malloc(1000);\n      cin >> p1->num >> p1->author;\n    }\n  }\n  p2->next = NULL;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      for (j = 0; j < 26; j++)\n        if (*(p + i) == j + 64)\n          n[j]++;\n    }\n    p1 = p1->next;\n  }\n  max = n[0];\n  for (i = 1; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n\", maxi + 64);\n\n  printf(\"%d\\n\", max);\n\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      if (*(p + i) == maxi + 64) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char str[30];\n  } bk[1000] = {0};\n  int i, j, m, n, sum[100] = {0}, number[1000] = {0}, result, max = 0;\n  char temp = 'A';\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, &bk[i].str);\n  for (i = 65; i <= 90; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++)\n        if (bk[j].str[n] == i)\n          sum[i]++;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (sum[j + 65] > max) {\n      max = sum[j + 65];\n      temp = j + 65;\n      result = j + 65;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (n = 0; n < 30; n++)\n      if (bk[i].str[n] == temp) {\n        number[i] = bk[i].num;\n        break;\n      }\n  }\n  printf(\"%c\\n%d\\n\", temp, sum[result]);\n  for (i = 0; i < m; i++)\n    if (number[i] != 0)\n      printf(\"%d\\n\", number[i]);\n}\n"}
{"label": "2", "index": "2848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0, maxi = 0;\n  int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};\n  char zz[1100][30];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> zz[i];\n    for (j = 0; zz[i][j] != '\\0'; j++) {\n      b[(int)zz[i][j] - 'A']++;\n      c[(int)zz[i][j] - 'A'][i] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      maxi = i;\n    }\n  }\n  cout << (char)(maxi + 'A') << endl;\n  cout << max << endl;\n  for (i = 1; i <= 1000; i++) {\n    if (c[maxi][i] == 1)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[1000], i, j, a[26] = {0}, len, k, max, l = 0;\n  char x[1000][10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &num[i], x[i]);\n  for (i = 0; i < n; i++) {\n    len = 0;\n    k = 0;\n    len = strlen(x[i]);\n    for (j = 0; j < len; j++) {\n      k = x[i][j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (j = 1; j < 26; j++) {\n    if (a[j] > max) {\n      max = a[j];\n      l = j;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 10; j++) {\n      if (x[i][j] == (l + 65))\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct tushu {\n  int bianhao;\n  char writer[27];\n} book[1000];\nvoid jishu(struct tushu *p1, int a[26], int b);\nint max(int c[26]);\nvoid shu(struct tushu *p2, int d, int e);\n\nint main() {\n  int n, i, m;\n  int zimu[26];\n  struct tushu *pointer;\n  pointer = &book[0];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].bianhao, &book[i].writer);\n  }\n  jishu(pointer, zimu, n);\n  m = max(zimu);\n  shu(pointer, m, n);\n  return 0;\n}\nvoid jishu(struct tushu *p1, int a[26], int b) {\n  int j, k, diji;\n  for (j = 0; j < 26; j++) {\n    a[j] = 0;\n  }\n  for (j = 0; j < b; j++) {\n    k = 0;\n    do {\n      diji = (*(p1 + j)).writer[k] - 'A';\n      a[diji]++;\n      k++;\n    } while ((*(p1 + j)).writer[k] != '\\0');\n  }\n}\nint max(int c[26]) {\n  int k, da, jieguo = 0;\n  da = c[0];\n  for (k = 1; k < 26; k++) {\n    if (c[k] > da) {\n      da = c[k];\n      jieguo = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + jieguo, da);\n  return (jieguo);\n}\nvoid shu(struct tushu *p2, int d, int e) {\n  char ai = 65 + d;\n  int x, y;\n  for (x = 0; x < e; x++) {\n    y = 0;\n    do {\n      if ((*(p2 + x)).writer[y] == ai) {\n        cout << (p2 + x)->bianhao << \"\\n\";\n      }\n      y++;\n    } while ((*(p2 + x)).writer[y] != '\\0');\n  }\n}\n"}
{"label": "2", "index": "2851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, j, n, m, x[26] = {0}, y = 0, z;\n  char a[100][4], b[100][10], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    for (j = 0; j < m; j++) {\n      x[b[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (y < x[i]) {\n      y = x[i];\n      z = i;\n    }\n  }\n  c = z + 65;\n  printf(\"%c\\n%d\\n\", c, y);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (b[i][j] == c)\n        y = 1;\n    }\n    if (y == 1)\n      printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "2852", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int n;\n  char name[26];\n  struct book *next;\n};\nstruct book *head;\nint m;\nstruct book *creat() {\n  struct book *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->n, p1->name);\n  head = NULL;\n  while (i < m - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->n, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int i, j, *p, max = 0, n;\n  struct book *p1;\n  p = (int *)calloc(26, sizeof(int));\n  scanf(\"%d\", &m);\n  creat();\n  p1 = head;\n  for (i = 65; i <= 90; i++) {\n    p1 = head;\n    do {\n      for (j = 0; (p1->name)[j] != '\u0000'; j++)\n        if ((p1->name)[j] == i)\n          *(p + i - 65) = *(p + i - 65) + 1;\n      p1 = p1->next;\n    } while (p1 != NULL);\n  }\n  for (i = 0; i < 26; i++, p++) {\n    if (*p > max) {\n      max = *p;\n      n = i;\n    }\n  }\n  printf(\"%c \", n + 65);\n  printf(\"%d \", max);\n  p1 = head;\n  do {\n    for (j = 0; (p1->name)[j] != '\u0000'; j++) {\n      if ((p1->name)[j] == n + 65)\n        printf(\"%d \", p1->n);\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "2853", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct cs {\n  int b;\n  char a[26];\n};\nint main() {\n  int m, i, j, k, max = 0;\n  int c[200][1000], count[200] = {0};\n  struct cs x[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i].b);\n\n    cin >> x[i].a;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(x[i].a); j++) {\n      for (k = 65; k < 91; k++) {\n        if (x[i].a[j] == k) {\n          count[k]++;\n          c[k][count[k]] = x[i].b;\n        }\n      }\n    }\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] > max)\n      max = count[k];\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] == max) {\n      printf(\"%c %d \", k, count[k]);\n      for (j = 1; j <= max; j++) {\n        printf(\"%d \", c[k][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2854", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char edit[26];\n  struct book *next;\n};\nint m;\nstruct book *head, *p1, *p2;\n\nstruct book *creat(void) {\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->edit);\n  head = p1;\n  p2 = p1;\n  m = m - 1;\n  do {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->edit);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    m = m - 1;\n  } while (m);\n  return (head);\n}\n\nint main() {\n  int max = 0, i = 0, j, k[26] = {0};\n  struct book *head, *p;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      k[(p->edit[i]) - 65] += 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++)\n    if (k[i] > max) {\n      max = k[i];\n      j = i;\n    }\n  printf(\"%c %d \", j + 65, max);\n  for (p = head; p != NULL;) {\n    for (i = 0; p->edit[i] != 0; i++)\n      if (p->edit[i] == j + 65)\n        printf(\"%d \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2855", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct chain {\n  int num;\n  char name[27];\n  struct chain *next;\n};\nint main() {\n  int a[26] = {0}, m, i, j, k, max = 0, n;\n  struct chain *p1, *p2, *head;\n  scanf(\"%d\", &m);\n  p2 = head = (struct chain *)malloc(1000);\n  for (k = 0; k < 27; k++)\n    head->name[k] = 0;\n  scanf(\"%d%s\", &head->num, &head->name);\n  for (k = 0; k < strlen(head->name); k++) {\n    if (head->name[k] >= 65 && head->name[k] <= 90)\n      a[head->name[k] - 65]++;\n  }\n  for (j = 0; j < m - 1; j++) {\n    p1 = (struct chain *)malloc(1000);\n    p2->next = p1;\n    for (k = 0; k < 27; k++)\n      p1->name[k] = 0;\n    scanf(\"%d%s\", &p1->num, &p1->name);\n    p2 = p1;\n    for (k = 0; k < strlen(p1->name); k++) {\n      if (p1->name[k] >= 65 && p1->name[k] <= 90)\n        a[p1->name[k] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      n = i;\n    }\n  }\n  printf(\"%c %d \", n + 65, max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p1->name[j] == (n + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2856", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int number;\n    char author[10];\n  };\n  struct book a[1000];\n  int i, n, j, count[26] = {0}, temp, max, index = 0;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, &a[i].author);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      temp = (a[i].author[j]) - 'A';\n      count[temp]++;\n    }\n  max = count[0];\n  for (i = 1; i < 26; i++)\n    if (count[i] > max) {\n      max = count[i];\n      index = i;\n    }\n  c = index + 'A';\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      if (a[i].author[j] == c) {\n        printf(\"%d\\n\", a[i].number);\n      }\n    }\n}\n"}
{"label": "2", "index": "2857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    char z[27];\n    int no;\n  };\n\n  struct book a[1000];\n\n  int m, i, x, p, j;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &a[i].no, a[i].z);\n  }\n\n  int memo[26] = {0};\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      x = (a[i].z[j]) - 65;\n      memo[x]++;\n    }\n  }\n  x = 0;\n  p = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (memo[i] > x) {\n      x = memo[i];\n      p = i;\n    }\n  }\n\n  printf(\"%c\\n\", p + 65);\n\n  int n = 0;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65)\n        n++;\n    }\n  }\n\n  printf(\"%d\\n\", n);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65) {\n        printf(\"%d\\n\", a[i].no);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n  int max = 0, store, m, i, x[26][1000] = {0}, coun[27] = {0}, flag;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &store);\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c < 65 || c > 90)\n        break;\n      else {\n        x[c - 64][i] = store;\n        coun[c - 64]++;\n      }\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (coun[i] > max) {\n      max = coun[i];\n      flag = i + 64;\n    }\n  }\n  printf(\"%c\\n\", flag);\n  printf(\"%d\\n\", coun[flag - 64]);\n  for (i = 1; i <= 1000; i++) {\n    if (x[flag - 64][i] != 0)\n      cout << x[flag - 64][i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][100];\n  int b[1000], c[27], s[1000], max, i, j, k;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> a[i];\n    s[i] = strlen(a[i]);\n  }\n  for (j = 0; j < 26; j++) {\n    c[j] = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < s[i]; k++) {\n        if (a[i][k] == 65 + j)\n          c[j] = c[j] + 1;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      printf(\"%d\\n\", c[i]);\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < s[k]; j++) {\n          if (a[k][j] == 65 + i)\n            cout << b[k] << \"\\n\";\n        }\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, t, g, max;\n  char q;\n  int d[26];\n  struct {\n    int a;\n    char b[26];\n\n  } s[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &s[i].a, s[i].b);\n  }\n  for (i = 0; i < 26; i++) {\n    d[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      t = s[i].b[j] - 'A';\n      d[t]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++) {\n    if (d[j] > max) {\n      max = d[j];\n      g = j;\n    }\n  }\n  q = 'A' + g;\n  printf(\"%c\\n%d\\n\", q, max);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      if (s[i].b[j] - 'A' == g)\n        printf(\"%d\\n\", s[i].a);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2861", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char auther[27];\n} bk[1000];\n\nstruct ath {\n  char a;\n  int books[999];\n  int sum;\n} auth[27], temp;\n\nint main() {\n  int n, i, x, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &bk[i].number, bk[i].auther);\n  for (i = 0; i < 27; i++) {\n    for (j = 0; j < 999; j++)\n      auth[i].books[j] = 0;\n    auth[i].sum = 0;\n    auth[i].a = 'A' + i;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].auther);\n    int f;\n    for (f = 0; f < m; f++) {\n      x = (int)(bk[i].auther[f] - 'A');\n      auth[x].books[auth[x].sum] = bk[i].number;\n      auth[x].sum++;\n    }\n  }\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (auth[i].sum > auth[i + 1].sum) {\n        temp = auth[i];\n        auth[i] = auth[i + 1];\n        auth[i + 1] = temp;\n      }\n  printf(\"%c\\n\", auth[25].a);\n  printf(\"%d\\n\", auth[25].sum);\n  i = 0;\n  while (auth[25].books[i] != 0) {\n    printf(\"%d\\n\", auth[25].books[i]);\n    i++;\n  }\n}\n"}
{"label": "2", "index": "2862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n = 1, m;\nstruct zuozhe {\n  int num;\n  char ren[26];\n  struct zuozhe *next;\n};\nstruct zuozhe *ap() {\n  struct zuozhe *head, *nw, *tn;\n  do {\n    nw = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    cin >> nw->num >> nw->ren;\n    if (n == 1) {\n      head = nw;\n      tn = head;\n    } else\n      tn->next = nw;\n    if (n <= m) {\n      tn = nw;\n      n++;\n    }\n  } while (n <= m);\n  tn->next = NULL;\n  return head;\n}\nint main() {\n  int i, max = 0, a[26] = {0}, j, w, l;\n  char z;\n  struct zuozhe *head, *p;\n  cin >> m;\n  head = ap();\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      j = p->ren[i] - 65;\n      a[j]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      w = i;\n    }\n  }\n  z = 65 + w;\n  cout << z << \"\\n\" << max << \"\\n\";\n  p = head;\n  for (; p != NULL; p = p->next) {\n    l = strlen(p->ren);\n    for (i = 0; i < l; i++) {\n      if (p->ren[i] == z) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct shu {\n    int bian;\n    char name[26];\n  };\n  struct shu a[1000];\n  int n, i, j, l[1000], b[26] = {0}, most, good, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].bian, a[i].name);\n  for (i = 0; i < n; i++)\n    l[i] = strlen(a[i].name);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < l[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (a[i].name[j] == 65 + k)\n          b[k]++;\n  most = b[0];\n  for (i = 0; i < 26; i++)\n    if (b[i] > most) {\n      most = b[i];\n      good = i;\n    }\n  printf(\"%c\\n\", 65 + good);\n  cout << most << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].name[j] == 65 + good)\n        printf(\"%d\\n\", a[i].bian);\n  return 0;\n}\n"}
{"label": "2", "index": "2864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], c[26] = {0}, max1 = 0, temp;\n  char m[1000][26], max2;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n    getchar();\n    cin.getline(m[i - 1], 26);\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++) {\n      c[m[i][j] - 'A']++;\n    }\n\n  for (int s = 0; s < 26; s++) {\n\n    if (max1 <= c[s]) {\n      max1 = c[s];\n      temp = s + 'A';\n      max2 = temp;\n    }\n  }\n  printf(\"%c\\n\", max2);\n  cout << max1 << endl;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++)\n      if (m[i][j] == max2) {\n        cout << a[i] << endl;\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, d, i, j, l;\n  struct a {\n    char name[27];\n    int c;\n  } m[1000];\n  struct b {\n    int num, book[1000];\n    char t;\n  };\n  struct b author[27];\n  for (i = 1; i <= 26; i++) {\n    author[i].t = i + 64;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i].c);\n    cin >> m[i].name;\n  }\n  for (i = 1; i <= n; i++) {\n    l = strlen(m[i].name);\n    for (j = 0; j <= l - 1; j++) {\n      d = m[i].name[j] - 64;\n      author[d].num++;\n      author[d].book[author[d].num] = m[i].c;\n    }\n  }\n  for (i = 1; i <= 25; i++) {\n    if (author[i].num > author[i + 1].num)\n      author[i + 1] = author[i];\n  }\n  printf(\"%c\\n\", author[26].t);\n  cout << author[26].num << \"\\n\";\n  for (i = 1; i <= author[26].num; i++) {\n    printf(\"%d\\n\", author[26].book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2866", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, nu, au, M, m;\n  int num[26] = {0};\n  int no[26][999];\n  char aut;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &nu);\n    cin.get();\n    aut = cin.get();\n    while (aut != 10) {\n      au = (int)(aut - 'A');\n      no[au][num[au]] = nu;\n      num[au]++;\n      aut = cin.get();\n    }\n  }\n  M = 0;\n  for (i = 0; i < 26; i++) {\n    if (M < num[i]) {\n      M = num[i];\n      m = i;\n    }\n  }\n  cout << (char)(m + 'A') << endl;\n  cout << M << endl;\n  for (i = 0; i < M; i++)\n    cout << no[m][i] << endl;\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "2", "index": "2867", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char auth[26];\n  struct book *next;\n};\nstruct book *creat(int m) {\n  int i = 0;\n  struct book *head, *p1, *p2;\n  if (i == 0) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->auth);\n    head = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  }\n  while (i < m) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->auth;\n    p2->next = p1;\n    p1->next = NULL;\n    p2 = p1;\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  int m, i, lenth;\n  int max = 0, maxwh = 27;\n  int count[26] = {0};\n  struct book *head, *p;\n  cin >> m;\n  head = creat(m);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++)\n      count[(int)(p->auth)[i] - 65]++;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      maxwh = i;\n    }\n  }\n  printf(\"%c\\n\", maxwh + 65);\n  printf(\"%d\\n\", max);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++) {\n      if ((int)(p->auth[i]) == maxwh + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, c[26] = {0}, max = 0;\n  char b[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  struct book {\n    int num;\n    char man[26];\n  } a[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].num, a[i].man);\n\n  i = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].man[j] == b[k])\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n  i = 0;\n  j = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[t], max);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (a[j].man[k] == b[t])\n        printf(\"%d\\n\", a[j].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char id[26];\n} a[999];\n\nstruct aut {\n  char wri;\n  int sum;\n} b[26];\n\nint main() {\n  int n, i, j, k, t, m = 0;\n  for (i = 0; i < 26; i++) {\n    b[i].wri = 'A' + i;\n    b[i].sum = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    cin >> a[i].id;\n  }\n\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].wri == a[i].id[k]) {\n          b[j].sum++;\n        }\n      }\n    }\n  }\n  int max = b[0].sum;\n  for (j = 0; j < 26; j++) {\n    if (max < b[j].sum) {\n      max = b[j].sum;\n      m = j;\n    }\n  }\n  cout << b[m].wri << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (a[i].id[k] == b[m].wri)\n        printf(\"%d\\n\", a[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, m, x[26] = {0}, y = 0, z;\n  char a[100][4], b[100][10], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    for (j = 0; j < m; j++) {\n      x[b[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (y < x[i]) {\n      y = x[i];\n      z = i;\n    }\n  }\n  c = z + 65;\n  printf(\"%c\\n%d\\n\", c, y);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (b[i][j] == c)\n        y = 1;\n    }\n    if (y == 1)\n      cout << a[i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "2871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char book[1000][30];\n  int n, i, j, k, r, len[1000], a[26][1000] = {0}, b[26] = {0}, max, s, c[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n; i++) {\n\n    cin >> book[i];\n    scanf(\"\\n\");\n  }\n  for (i = 0; i <= n; i++)\n    for (j = 0; book[i][j] != ' '; j++)\n      len[i] = j;\n  for (k = 0; k < 26; k++) {\n    r = 0;\n    for (i = 0; i <= n; i++) {\n      for (j = len[i] + 1; j < strlen(book[i]); j++) {\n        if (book[i][j] == k + 65) {\n          b[k]++;\n          a[k][r] = i;\n          r++;\n        }\n      }\n    }\n    c[k] = r;\n  }\n  max = b[0];\n  for (i = 1; i < 26; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n      s = i;\n    }\n  }\n  printf(\"%c\\n\", s + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < c[s]; i++) {\n    for (j = 0; j <= len[a[s][i]]; j++)\n      printf(\"%c\", book[a[s][i]][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a;\n  cin >> a;\n  char zuozhe[100][100];\n  int shuhao[100];\n  int zuo[200];\n  int shu[200][200];\n  int n = 0, p, i, j;\n  int m[200];\n\n  for (i = 0; i < 200; i++) {\n    zuo[i] = 0;\n    m[i] = 0;\n  }\n\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %s\", &shuhao[i], zuozhe[i]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; (zuozhe[i][j]) != '\\0'; j++) {\n      zuo[(zuozhe[i][j])] = zuo[(zuozhe[i][j])] + 1;\n      shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])] = shuhao[i];\n      m[(zuozhe[i][j])] = m[(zuozhe[i][j])] + 1;\n    }\n  }\n  for (i = 65; i <= 90; i++) {\n    if (zuo[i] > n) {\n      n = zuo[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", zuo[p]);\n  for (i = 0; i < m[p]; i++) {\n    cout << shu[p][i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[999][26];\n  char m;\n  int a[999], c[26];\n  int i, j, n, t, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 25; i++) {\n    c[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    scanf(\"%s\", w[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      c[w[i][j] - 65] += 1;\n    }\n  }\n  max = c[0];\n  m = 65;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      m = i + 65;\n    }\n  }\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; w[i][j] != '\\0'; j++) {\n      if (w[i][j] == m) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, a[26], sum = 0;\n  for (j = 0; j < 26; j++)\n    a[j] = 0;\n  char aut;\n  cin >> m;\n  struct book *head, *pb1, *pb2;\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    pb1 = (struct book *)malloc(sizeof(struct book));\n    cin >> pb1->num >> pb1->author;\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      k = pb1->author[j] - 'A';\n      a[k] += 1;\n    }\n    if (head == NULL) {\n      head = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    } else {\n      pb2->next = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (a[j] > sum) {\n      sum = a[j], k = j;\n    }\n  }\n  aut = (char)('A' + k);\n  printf(\"%c\\n\", aut);\n  printf(\"%d\\n\", sum);\n  pb1 = head;\n  while (pb1) {\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      if (pb1->author[j] == aut)\n        printf(\"%d\\n\", pb1->num);\n    }\n    pb1 = pb1->next;\n  }\n}\n"}
{"label": "2", "index": "2875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int m = 0;\n  head = p1 = p2 = NULL;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (1) {\n    m += 1;\n    if (m >= n)\n      break;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct book *head, *p;\n  char maxchar;\n  int m, i = 0, max = 0, a[26] = {0};\n  scanf(\"%d\", &m);\n  head = creat(m);\n  for (p = head; p != NULL; p = p->next) {\n\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      int c = p->name[i] - 'A';\n      a[c]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxchar = 'A' + i;\n    }\n  }\n  cout << maxchar << \"\\n\" << max << \"\\n\";\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; p->name[i] != '\\0'; i++) {\n      if (p->name[i] == maxchar) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char peo[26];\n} book1[999];\nint main() {\n  int n, i, j, m = 0, num[26] = {0}, length, max = 0, t;\n  char author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book1[i].id >> book1[i].peo;\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      num[(int)(book1[i].peo[j] - 'A')]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      t = i;\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, num[t]);\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      if (book1[i].peo[j] == author) {\n        printf(\"%d\\n\", book1[i].id);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2877", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[100];\n};\n\nint main() {\n  int n, i, j, a[26], c[100], k, t, d[100], s;\n  struct book bo[100];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num;\n    scanf(\"%s\", bo[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = strlen(bo[i].writer);\n    for (j = 0; j < c[i]; j++) {\n      k = bo[i].writer[j] - 'A';\n      a[k]++;\n    }\n  }\n  t = a[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > t) {\n      j = i;\n      t = a[i];\n    }\n  }\n  s = j;\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < n; i++) {\n    d[i] = 0;\n    for (j = 0; j < c[i]; j++) {\n      if (bo[i].writer[j] == ('A' + s))\n        d[i] = 1;\n    }\n    if (d[i] == 1)\n      printf(\"%d\\n\", bo[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2878", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int no;\n  char wr[26];\n} book[999];\nstruct {\n  char name;\n  int num;\n  int book[999];\n} a[26];\n\nint main() {\n  int n, m, t, k, d;\n  int all = 0;\n  for (t = 0; t < 26; t++) {\n    a[t].name = 'A' + t;\n    a[t].num = 0;\n  }\n  scanf(\"%d\", &m);\n  for (t = 0; t < m; t++) {\n    cin >> book[t].no >> book[t].wr;\n  }\n\n  for (t = 0; t < m; t++) {\n    k = strlen(book[t].wr);\n    for (n = 0; n < k; n++) {\n      for (d = 0; d < 26; d++) {\n        if (a[d].name == book[t].wr[n]) {\n          a[d].book[a[d].num] = book[t].no;\n          a[d].num++;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n\n  for (t = 0; t < 26; t++) {\n    if (k < a[t].num)\n      k = a[t].num;\n  }\n\n  for (t = 0;; t++) {\n    if (k == a[t].num) {\n      printf(\"%c\", a[t].name);\n      printf(\"\\n%d\", a[t].num);\n      for (d = 0; d < a[t].num; d++)\n        printf(\"\\n%d\", a[t].book[d]);\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2879", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char s[27];\n};\n\nstruct author {\n  int num;\n  int bn[1000];\n};\n\nint main() {\n  int m, i, j, l, max = 0;\n\n  char c;\n\n  struct book bk[1000];\n  struct author au['Z' + 1], t;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < 'Z' + 1; j++)\n    au[j].num = 0;\n  for (i = 0; i < m; i++) {\n\n    cin >> bk[i].num >> bk[i].s;\n\n    l = strlen(bk[i].s);\n\n    for (j = 0; j < l; j++)\n      au[bk[i].s[j]].bn[au[bk[i].s[j]].num++] = bk[i].num;\n  }\n\n  for (j = 0; j < 'Z' + 1; j++)\n    if (au[j].num > max) {\n      t = au[j];\n      c = j;\n      max = au[j].num;\n    }\n\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", t.num);\n\n  for (i = 0; i < t.num; i++)\n    printf(\"%d\\n\", t.bn[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint w[26] = {0};\nint p = 0;\nvoid zimu(char a[]) {\n  int m, i, j;\n  char c;\n  m = strlen(a);\n  for (j = 0; j < 26; j++) {\n    c = 'A' + j;\n\n    for (i = 0; i < m; i++) {\n      if (a[i] == c)\n        w[j]++;\n    }\n  }\n}\nint max(int w[26]) {\n  int i, max;\n  max = w[0];\n  for (i = 1; i < 26; i++)\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  return max;\n}\n\nint main() {\n  char b[300][20];\n  int a[300];\n  int m, i, j, mm;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &a[i], b[i]);\n  for (i = 0; i < m; i++)\n    zimu(b[i]);\n  mm = max(w);\n\n  printf(\"%c\\n\", p + 'A');\n  cout << mm << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (strlen(b[i])); j++)\n      if (b[i][j] == (p + 'A')) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } book[999];\n  int m, i, n, j, max;\n  char a[26], c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].writer);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++) {\n        if (a[i] == book[j].writer[n]) {\n          c[i]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", a[max], c[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == a[max]) {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2882", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, num[1000], i, k, l = 0, a[26] = {0};\n  char nam[1000][10], j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> num[i] >> nam[i];\n  for (j = 'A'; j <= 'Z'; j++)\n    for (i = 0; i < m; i++)\n      if (strchr(nam[i], j))\n        a[j - 65]++;\n  for (i = 0, k = a[0]; i < 26; i++)\n    if (a[i] > k) {\n      k = a[i];\n      l = i;\n    }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < m; i++) {\n    if (strchr(nam[i], l + 65))\n      printf(\"%d\\n\", num[i]);\n  }\n}\n"}
{"label": "2", "index": "2883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  int b[1000];\n  char s[1000][26];\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &b[i], &s[i]);\n\n  int a[26] = {0};\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      switch (s[i][j]) {\n      case 'A':\n        a[0] = a[0] + 1;\n        break;\n      case 'B':\n        a[1] = a[1] + 1;\n        break;\n      case 'C':\n        a[2] = a[2] + 1;\n        break;\n      case 'D':\n        a[3] = a[3] + 1;\n        break;\n      case 'E':\n        a[4] = a[4] + 1;\n        break;\n      case 'F':\n        a[5] = a[5] + 1;\n        break;\n      case 'G':\n        a[6] = a[6] + 1;\n        break;\n      case 'H':\n        a[7] = a[7] + 1;\n        break;\n      case 'I':\n        a[8] = a[8] + 1;\n        break;\n      case 'J':\n        a[9] = a[9] + 1;\n        break;\n      case 'K':\n        a[10] = a[10] + 1;\n        break;\n      case 'L':\n        a[11] = a[11] + 1;\n        break;\n      case 'M':\n        a[12] = a[12] + 1;\n        break;\n      case 'N':\n        a[13] = a[13] + 1;\n        break;\n      case 'O':\n        a[14] = a[14] + 1;\n        break;\n      case 'P':\n        a[15] = a[15] + 1;\n        break;\n      case 'Q':\n        a[16] = a[16] + 1;\n        break;\n      case 'R':\n        a[17] = a[17] + 1;\n        break;\n      case 'S':\n        a[18] = a[18] + 1;\n        break;\n      case 'T':\n        a[19] = a[19] + 1;\n        break;\n      case 'U':\n        a[20] = a[20] + 1;\n        break;\n      case 'V':\n        a[21] = a[21] + 1;\n        break;\n      case 'W':\n        a[22] = a[22] + 1;\n        break;\n      case 'X':\n        a[23] = a[23] + 1;\n        break;\n      case 'Y':\n        a[24] = a[24] + 1;\n        break;\n      default:\n        a[25] = a[25] + 1;\n      }\n    }\n  }\n  int m;\n  char z;\n  m = a[0], z = c[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > m)\n      m = a[i], z = c[i];\n  }\n  printf(\"%c\\n%d\\n\", z, m);\n  for (i = 0; i < n; i++) {\n    int l, j;\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == z) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct person {\n  int num;\n  int book[1000];\n};\nstruct person p[26];\nint n, m, i, j, k;\nchar str[30];\nint main() {\n  memset(p, 0, sizeof(p));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &m, str);\n    for (j = strlen(str) - 1; j >= 0; j--)\n      if (str[j] >= 'A' && str[j] <= 'Z') {\n        k = p[str[j] - 'A'].num++;\n        p[str[j] - 'A'].book[k] = m;\n      }\n  }\n  m = 0;\n  for (i = 1; i < 26; i++)\n    if (p[i].num > p[m].num)\n      m = i;\n  printf(\"%c\\n\", 'A' + m);\n  printf(\"%d\\n\", p[m].num);\n  for (i = 0; i < p[m].num; i++)\n    printf(\"%d\\n\", p[m].book[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  int book[1020];\n  scanf(\"%d\", &m);\n  int i;\n  char c;\n  int a[27] = {0};\n  int b[27][1000] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &book[i]);\n    getchar();\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n      a[c - 64] += 1;\n      b[c - 64][i] = 1;\n    }\n  }\n  int max = 0, p;\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", p + 64, max);\n  for (i = 0; i < 1000; i++) {\n    if (b[p][i] == 1) {\n      cout << book[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N;\nint A[2013], Ans[1222];\nchar W[2013][28];\ndouble Max(double X, double Y) { return X > Y ? X : Y; }\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    cin >> A[I] >> W[I];\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      Ans[W[I][J]]++;\n  }\n  int Max = 0, T;\n  for (int I = 65; I <= 'Z'; I++)\n    if (Ans[I] > Max) {\n      Max = Ans[I];\n      T = I;\n    }\n  printf(\"%c\\n%d\\n\", T, Max);\n  for (int I = 1; I <= N; I++) {\n    int L = strlen(W[I]);\n    for (int J = 0; J < L; J++)\n      if (W[I][J] == T)\n        cout << A[I] << endl;\n  }\n}\n"}
{"label": "2", "index": "2887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct SHU {\n  int bh;\n  char bz[26];\n};\n\nint main() {\n  int m, i, j, l, k, p;\n  int name[200] = {0}, max, shuhao[1000];\n  struct SHU shu[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &shu[i].bh, shu[i].bz);\n  }\n  for (i = 0; i < m; i++) {\n    l = strlen(shu[i].bz);\n    for (j = 0; j < l; j++) {\n      name[shu[i].bz[j]]++;\n    }\n  }\n  max = name[0];\n  for (i = 0; i < 200; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      k = i;\n    }\n  }\n  p = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].bz[j] == k) {\n        shuhao[p] = shu[i].bh;\n        p++;\n      }\n    }\n  }\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", shuhao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int n;\n  char s[27];\n} b[1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].n, b[i].s);\n\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (k = 0; b[i].s[k]; k++) {\n      switch (b[i].s[k]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      j = i;\n    }\n  }\n\n  switch (j) {\n  case 0:\n    printf(\"A\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++) {\n        if (b[i].s[k] == 'A')\n          printf(\"%d\\n\", b[i].n);\n      }\n    }\n    break;\n  case 1:\n    printf(\"B\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'B')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 2:\n    printf(\"C\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'C')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 3:\n    printf(\"D\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'D')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 4:\n    printf(\"E\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'E')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 5:\n    printf(\"F\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++) {\n        if (b[i].s[k] == 'F')\n          printf(\"%d\\n\", b[i].n);\n      }\n    }\n    break;\n  case 6:\n    printf(\"G\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'G')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 7:\n    printf(\"H\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'H')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 8:\n    printf(\"I\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'I')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 9:\n    printf(\"J\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'J')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 10:\n    printf(\"K\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'K')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 11:\n    printf(\"L\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'L')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 12:\n    printf(\"M\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 13:\n    printf(\"N\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'M')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 14:\n    printf(\"O\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'O')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 15:\n    printf(\"P\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'P')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 16:\n    printf(\"Q\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Q')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 17:\n    printf(\"R\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'R')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 18:\n    printf(\"S\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'S')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 19:\n    printf(\"T\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'T')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 20:\n    printf(\"U\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'U')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 21:\n    printf(\"V\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'V')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 22:\n    printf(\"W\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'W')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 23:\n    printf(\"X\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'X')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 24:\n    printf(\"Y\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Y')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  case 25:\n    printf(\"Z\\n%d\\n\", max);\n    for (i = 0; i < n; i++) {\n      for (k = 0; b[i].s[k]; k++)\n        if (b[i].s[k] == 'Z')\n          printf(\"%d\\n\", b[i].n);\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  int i, j, k, x, t;\n  struct book {\n    int num;\n    char w[26];\n  } b[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i].num);\n    scanf(\"%s\", &b[i].w);\n  }\n  int c[26];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].w[k] != '\\0' && b[j].w[k] - i == 'A')\n          c[i]++;\n      }\n    }\n  }\n  int d[26];\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (i = 0; i < 25; i++) {\n    if (d[i] > d[i + 1]) {\n      t = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = t;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == d[25])\n      x = i;\n  }\n  printf(\"%c\\n\", 'A' + x);\n  printf(\"%d\\n\", c[x]);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (b[j].w[k] - x == 'A')\n        printf(\"%d\\n\", b[j].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct {\n    int a;\n    char b[26];\n  } num[999];\n  int i, m, j, k;\n  int s[26];\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> num[i].a >> num[i].b;\n  }\n  for (k = 0; k < 26; k++) {\n    s[k] = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      k = num[i].b[j] - 'A';\n      s[k]++;\n    }\n  }\n  int first = s[0];\n  int t;\n  for (k = 0; k < 26; k++) {\n    if (s[k] > first) {\n      first = s[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", t + 'A');\n  printf(\"%d\\n\", first);\n  for (i = 0; i < m; i++) {\n    for (j = 0; num[i].b[j] != '\\0'; j++) {\n      if (num[i].b[j] == (t + 'A')) {\n        cout << num[i].a << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2891", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, m, a[26][999], num[26] = {0}, t, max;\n  char zz[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &t, zz);\n    for (j = 0; j < strlen(zz); j++) {\n      a[(int)(zz[j] - 'A')][num[(int)(zz[j] - 'A')]] = t;\n      num[(int)(zz[j] - 'A')]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct lib {\n  int num;\n  char author[26];\n} book[1000];\nint main() {\n  int n, i, k, p, e;\n  e = 0;\n  int tol[1000] = {0};\n  int own[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &(book[i].num), book[i].author);\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (p = 0; p <= 25; p++) {\n        if (k == book[i].author[p]) {\n          tol[k]++;\n          own[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (tol[i] > e) {\n      e = tol[i];\n    }\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    if (tol[k] == e) {\n      printf(\"%c\\n%d\\n\", k, tol[k]);\n      for (p = 0; p <= n - 1; p++) {\n        if (own[k][p] != 0) {\n          printf(\"%d\\n\", own[k][p]);\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint w[26] = {0}; \nint p = 0;\nvoid zimu(char a[]) {\n  int m, i, j;\n  char c;\n  m = strlen(a);\n  for (j = 0; j < 26; j++) {\n    c = 'A' + j;\n\n    for (i = 0; i < m; i++) {\n      if (a[i] == c)\n        w[j]++;\n    }\n\n  } \n}\nint max(int w[26]) {\n  int i, max;\n  max = w[0];\n  for (i = 1; i < 26; i++)\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  return max;\n}\n\nint main() {\n  char b[300][20];\n  int a[300];\n  int m, i, j, mm;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &a[i], b[i]);\n  for (i = 0; i < m; i++)\n    zimu(b[i]);\n  mm = max(w);\n\n  printf(\"%c\\n\", p + 'A');\n  printf(\"%d\\n\", mm);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (strlen(b[i])); j++)\n      if (b[i][j] == (p + 'A')) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "2894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n};\n\nint main() {\n  int i, j, k, m, x, a = 0;\n  int count[26] = {0};\n  char y;\n  struct book all[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &all[i].num, &all[i].aut);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] >= 'A' && all[i].aut[j] <= 'Z') {\n        x = (int)(all[i].aut[j] - 'A');\n        count[x]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > a) {\n      a = count[i];\n      k = i;\n    }\n  }\n  y = k + 'A';\n  cout << y << \"\\n\" << a << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (all[i].aut[j] == y) {\n        cout << all[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2895", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int j, n, i, book, max = 0, pos, a[30][1000] = {0};\n  char s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book, &s);\n    for (j = 0; j < strlen(s); j++) {\n      a[s[j] - 'A'][0]++;\n      a[s[j] - 'A'][a[s[j] - 'A'][0]] = book;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i][0] > max) {\n      max = a[i][0];\n      pos = i;\n    }\n  printf(\"%c\\n%d\\n\", pos + 'A', a[pos][0]);\n  for (i = 1; i <= a[pos][0]; i++)\n    printf(\"%d\\n\", a[pos][i]);\n}\n"}
{"label": "2", "index": "2896", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *p;\n  char q[1000][30];\n  int shu[26] = {0};\n  char zm[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int n, i, j, k;\n  int len, max = 0;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    len = 0;\n    scanf(\"%d %s\", &p[i], q[i]);\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (q[i][j] == zm[k])\n          shu[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", zm[k], shu[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      if (q[i][j] == zm[k])\n        printf(\"%d\\n\", p[i]);\n    }\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "2897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  char writter[27];\n  int data[26][1000];\n  memset(data, 0, sizeof(data));\n  int max = 0;\n  char max_name;\n  for (int i = 1; i <= m; i++) {\n    int number;\n    scanf(\"%d %s \", &number, writter);\n    for (int j = 0; j < strlen(writter); j++) {\n      data[writter[j] - 65][0]++;\n      data[writter[j] - 65][data[writter[j] - 65][0]] = number;\n      if (max < data[writter[j] - 65][0]) {\n        max = data[writter[j] - 65][0];\n        max_name = writter[j];\n      }\n    }\n  }\n  cout << max_name << endl << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << data[max_name - 65][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "2898", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m;\n  int i, j, a, n;\n  struct book {\n    int no;\n    char name[30];\n  } book[999];\n  int author1[30] = {0}, author2[30] = {0};\n  char k;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].no, &book[i].name);\n  for (i = 0; i < m; i++) {\n    a = strlen(book[i].name);\n    for (j = 0; j < a; j++) {\n      for (k = 'A'; k <= 'Z'; k++) {\n        if (book[i].name[j] == k)\n          author1[(int)k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    author2[i] = author1[i];\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++) {\n      if (author1[i] < author1[j]) {\n        int tmp;\n        tmp = author1[i];\n        author1[i] = author1[j];\n        author1[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author2[i] == author1[0]) {\n      printf(\"%c\\n\", (char)(65 + i));\n      printf(\"%d\\n\", author1[0]);\n      for (j = 0; j < m; j++) {\n        a = strlen(book[j].name);\n        for (n = 0; n < a; n++) {\n          if (book[j].name[n] == (char)(65 + i)) {\n            printf(\"%d\\n\", book[j].no);\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2899", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  struct author_book {\n    int count;\n    int book[999];\n  } au[26];\n\n  for (int k = 0; k < 26; k++) {\n    au[k].count = 0;\n  }\n\n  int m;\n  scanf(\"%d \", &m);\n\n  for (int i = 1; i <= m; i++) {\n    int num;\n    char a[26];\n    cin >> num;\n    cin.get();\n    cin.getline(a, 26);\n    for (int k = 0; k < strlen(a); k++) {\n      int author_r = (int)(a[k] - 'A');\n      au[author_r].book[au[author_r].count] = num;\n      au[author_r].count++;\n    }\n  }\n\n  int max = 0;\n  int the_one = 0;\n  for (int i = 0; i < 26; i++) {\n\n    if (au[i].count > max) {\n      max = au[i].count;\n      the_one = i;\n    }\n  }\n\n  char maxau = 'A' + the_one;\n  cout << maxau << endl;\n  cout << au[the_one].count << endl;\n\n  for (int i = 0; i < au[the_one].count; i++) {\n    cout << au[the_one].book[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2900", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char s[27];\n} shu[1000];\nint main() {\n  int n, i, l, j, max;\n  char name;\n  int letter[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &shu[i].num, &shu[i].s);\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      letter[(shu[i].s[j] - 65)]++;\n    }\n  }\n  for (max = letter[0], name = 65, i = 1; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      name = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < n; i++) {\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      if (shu[i].s[j] == name) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2901", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n};\nint m;\n\nint main() {\n\n  int i;\n  scanf(\"%d\", &m);\n  book *p;\n  p = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &p[i].num, p[i].writer);\n  }\n  int j = 0, u = 0;\n  int *a;\n  a = (int *)malloc(sizeof(int) * 150);\n  for (i = 'A'; i <= 'z'; i++)\n    a[i] = 0;\n\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      for (u = 0; u < strlen(p[j].writer); u++) {\n        if (i == p[j].writer[u]) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  int max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max < a[i])\n      max = a[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max == a[i])\n      break;\n  }\n  printf(\"%c\\n%d\\n\", i, a[i]);\n  for (j = 0; j < m; j++) {\n    for (u = 0; u < strlen(p[j].writer); u++) {\n      if (i == p[j].writer[u]) {\n        printf(\"%d\\n\", p[j].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, sum[27] = {0}, max = 0, author;\n  cin >> m;\n  char str[1000][4], name[1000][27];\n  for (int i = 0; i < m; i++)\n    cin >> str[i] >> name[i];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++)\n      sum[name[i][j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      author = i;\n    }\n  }\n  cout << (char)('A' + author) << endl;\n  cout << max << endl;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] - 'A' == author)\n        cout << str[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2903", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  struct book {\n    int no;\n    char as[10];\n  } bk;\n\n  scanf(\"%d\", &n);\n  struct book *books = (struct book *)malloc(sizeof(struct book) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk.no, bk.as);\n    books[i] = bk;\n  }\n\n  int cnts[256] = {0};\n  for (i = 0; i < n; i++) {\n    bk = books[i];\n    for (j = 0; bk.as[j]; j++) {\n      cnts[bk.as[j]]++;\n    }\n  }\n\n  int count = 0;\n  for (int max = 1000; max > 0; max--) {\n    for (char c = 'A'; c <= 'Z'; c++) {\n      if (cnts[c] == max) {\n        printf(\"%c\\n%d\\n\", c, max);\n        for (i = 0; i < n; i++) {\n          bk = books[i];\n          for (j = 0; bk.as[j]; j++) {\n            if (bk.as[j] == c) {\n              printf(\"%d\\n\", bk.no);\n              break;\n            }\n          }\n        }\n        count++;\n      }\n    }\n    if (count == 1) {\n      free(books);\n      return 0;\n    }\n  }\n\n  free(books);\n  return -1;\n}\n"}
{"label": "2", "index": "2904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n > 0) {\n    struct a {\n      char y[30];\n      int x, l;\n    } a[1000];\n    struct b {\n      char y;\n      int x;\n    } b[26];\n    int i, j, p;\n    char k;\n    for (i = 0; i < n; i++) {\n      scanf(\"%d %s\", &a[i].x, &a[i].y);\n      a[i].l = strlen(a[i].y);\n    }\n    for (i = 0; i <= 25; i++) {\n      b[i].y = i + 65;\n      b[i].x = 0;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < a[i].l; j++) {\n        for (k = 65; k <= 90; k++) {\n          if (a[i].y[j] == k)\n            b[k - 65].x = b[k - 65].x + 1;\n        }\n      }\n    }\n    int max = b[0].x;\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x > max)\n        max = b[i].x;\n    }\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x == max) {\n        printf(\"%c\\n\", b[i].y);\n        printf(\"%d\\n\", b[i].x);\n        for (j = 0; j < n; j++) {\n          for (p = 0; p < a[j].l; p++) {\n            if (a[j].y[p] == b[i].y) {\n              cout << a[j].x << \"\\n\";\n              break;\n            }\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2905", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char author[26];\n};\nint main() {\n  struct book b[999];\n  int a[26];\n  int m, i, j, max, maxauthor;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i].id >> b[i].author;\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      a[c - 65]++;\n    }\n  }\n  max = a[0];\n  maxauthor = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxauthor = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxauthor + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      if (c == maxauthor + 65) {\n        printf(\"%d\\n\", b[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2906", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct author {\n  char name;\n  int count;\n} aut[26];\n\nint max(struct author a[26]) {\n  int i, max;\n  max = a[0].count;\n  for (i = 0; i < 26; i++)\n    if (a[i].count > max)\n      max = a[i].count;\n  return (max);\n}\nint main() {\n  int m, h = 0;\n  scanf(\"%d \", &m);\n  int i, j, n, l[1000], book_name[1000];\n  char author_name[1000][27];\n  for (i = 0; i < 26; i++) {\n    aut[i].name = 'A' + i;\n    aut[i].count = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book_name[i], author_name[i]);\n    l[i] = strlen(author_name[i]);\n    for (j = 0; j < 26; j++)\n      for (n = 0; n < l[i]; n++)\n        if (author_name[i][n] == aut[j].name)\n          aut[j].count++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (aut[i].count == max(aut)) {\n      printf(\"%c\\n\", aut[i].name);\n      h = i;\n    }\n  }\n  printf(\"%d\\n\", max(aut));\n  for (i = 0; i < m; i++) {\n    l[i] = strlen(author_name[i]);\n    for (n = 0; n < l[i]; n++)\n      if (author_name[i][n] == aut[h].name)\n        printf(\"%d\\n\", book_name[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n  } a[400];\n  int i, n, max = 0, j, k, l, y[400], p;\n  char u;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].x, a[i].z);\n    y[i] = strlen(a[i].z);\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < y[i]; j++) {\n      p = 1;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (a[i].z[j] == a[k].z[l])\n            p++;\n      }\n      if (p > max) {\n        max = p;\n        u = a[i].z[j];\n      }\n    }\n  }\n  cout << u << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == a[i].z[j]) {\n        printf(\"%d\\n\", a[i].x);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2908", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    char b[100];\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int n, i, j, k, t, d[50], max;\n  char c;\n  scanf(\"%d\", &n);\n  p1 = (struct s *)malloc(sizeof(struct s));\n  p2 = p1;\n  head = p1;\n  cin >> p1->a >> p1->b;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %s\", &p1->a, p1->b);\n  }\n  p2->next = 0;\n  t = 0;\n  p1 = p2 = head;\n  for (c = 'A'; c <= 'Z'; c++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      j = 0;\n      while (p1->b[j] != '\\0') {\n        if (c == p1->b[j])\n          k++;\n        j++;\n      }\n      p1 = p1->next;\n    }\n\n    d[t] = k;\n\n    t++;\n    p1 = head;\n  }\n  j = 0;\n  max = d[0];\n  for (i = 1; i < 26; i++)\n    if (d[i] > max) {\n      max = d[i];\n      j = i;\n    }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", max);\n  t = 'A' + j;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (p1->b[j] != '\\0') {\n      if (t == p1->b[j])\n        printf(\"%d\\n\", p1->a);\n      j++;\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct person {\n  int num;\n  int book[1000];\n};\nstruct person p[26];\nint n, m, i, j, k;\nchar str[30];\nint main() {\n  memset(p, 0, sizeof(p));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> m >> str;\n    for (j = strlen(str) - 1; j >= 0; j--)\n      if (str[j] >= 'A' && str[j] <= 'Z') {\n        k = p[str[j] - 'A'].num++;\n        p[str[j] - 'A'].book[k] = m;\n      }\n  }\n  m = 0;\n  for (i = 1; i < 26; i++)\n    if (p[i].num > p[m].num)\n      m = i;\n  printf(\"%c\\n\", 'A' + m);\n  printf(\"%d\\n\", p[m].num);\n  for (i = 0; i < p[m].num; i++)\n    printf(\"%d\\n\", p[m].book[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, a[1000], c[91] = {0}, k, n, p = 0;\n  char b[1000][26], q;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++) {\n      k = b[i][j];\n      c[k]++;\n    }\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > p) {\n      p = c[i];\n      q = i;\n    }\n  cout << q << \"\\n\" << p << \"\\n\";\n  for (i = 1; i <= m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++)\n      if (b[i][j] == q)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2911", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k[100], l[26] = {0}, m = 0, v, j;\n  char c[100][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &k[i], c[i]);\n    for (j = 0; j < strlen(c[i]); j++)\n      l[(int)c[i][j] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] > m)\n      m = l[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] == m) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      break;\n    }\n  }\n  for (v = 0; v < n; v++) {\n    for (j = 0; j < strlen(c[v]); j++) {\n      if (c[v][j] == i + 65)\n        printf(\"%d\\n\", k[v]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[999];\n  char r[999][26];\n  int b[125] = {0};\n  int n, i, j, maxi, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    cin >> r[i];\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      b[r[i][j]] = b[r[i][j]] + 1;\n    }\n  }\n  maxi = 65;\n  for (i = 66; i <= 90; i++) {\n    if (b[i] > b[maxi])\n      maxi = i;\n  }\n  cout << maxi << \"\\n\";\n  printf(\"%d\\n\", b[maxi]);\n  for (i = 0; i <= n - 1; i++) {\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      if (r[i][j] == maxi) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, amount[26], num[26][1000], num0, max = 0;\n  char a;\n  memset(amount, 0, sizeof(amount));\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num0;\n    cin.get();\n    a = cin.get();\n    while (a != '\\n') {\n      num[a - 65][amount[a - 65]] = num0;\n      amount[a - 65]++;\n      a = cin.get();\n    }\n  }\n  for (int i = 0; i < 26; i++)\n    if (max < amount[i])\n      max = amount[i];\n  for (int i = 0; i < 26; i++)\n    if (max == amount[i]) {\n      a = i + 65;\n      cout << a << endl << max << endl;\n      for (int j = 0; j < max; j++)\n        cout << num[i][j] << endl;\n      break;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "2914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    char b[100];\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int m, n, i, j, k, t, d[50], max;\n  char c;\n  scanf(\"%d\", &n);\n  p1 = (struct s *)malloc(sizeof(struct s));\n  p2 = p1;\n  head = p1;\n  scanf(\"%d %s\", &p1->a, p1->b);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %s\", &p1->a, p1->b);\n  }\n  p2->next = 0;\n  t = 0;\n  p1 = p2 = head;\n  for (c = 'A'; c <= 'Z'; c++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      j = 0;\n      while (p1->b[j] != '\\0') {\n        if (c == p1->b[j])\n          k++;\n        j++;\n      }\n      p1 = p1->next;\n    }\n\n    d[t] = k;\n\n    t++;\n    p1 = head;\n  }\n  j = 0;\n  max = d[0];\n  for (i = 1; i < 26; i++)\n    if (d[i] > max) {\n      max = d[i];\n      j = i;\n    }\n  cout << 'A' + j << \"\\n\";\n  printf(\"%d\\n\", max);\n  t = 'A' + j;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (p1->b[j] != '\\0') {\n      if (t == p1->b[j])\n        printf(\"%d\\n\", p1->a);\n      j++;\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2915", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int maxc = 0, i, j, n, a[1000], c;\n  char maxp, b[1000][27], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n  }\n  for (p = 'A'; p <= 'Z'; p++) {\n    c = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0;; j++) {\n        if (b[i][j] == '\\0')\n          break;\n        if (b[i][j] == p) {\n          c++;\n        }\n      }\n    }\n    if (c > maxc) {\n      maxc = c;\n      maxp = p;\n    }\n  }\n  printf(\"%c\\n\", maxp);\n  printf(\"%d\\n\", maxc);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (b[i][j] == '\\0')\n        break;\n      if (b[i][j] == maxp) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int at[26] = {0};\n  char c;\n  scanf(\"%d\", &n);\n  struct st {\n    int id;\n    char s[27];\n  } a[999], *p;\n  for (p = a; p < a + n; p++)\n    scanf(\"%d %s\", &p->id, p->s);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c != '\\0')\n        at[c - 65]++;\n      else\n        break;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (at[i] > max) {\n      max = at[i];\n      j = i;\n    }\n  }\n  char x;\n  x = j + 65;\n  printf(\"%c\\n%d\\n\", x, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c == x) {\n        cout << a[i].id << \"\\n\";\n      }\n      if (c == '\\0')\n        break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Book {\n  int number;\n  char author[30];\n};\n\nint main() {\n  int max = 0, len;\n  int sum[30] = {0};\n  int m, i, j;\n  struct Book book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].number >> book[i].author;\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++)\n      sum[book[i].author[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > sum[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, sum[max]);\n  for (i = 0; i < m; i++) {\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++) {\n      if (book[i].author[j] == max + 65) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2918", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char w[26];\n  struct book *next;\n};\nint c[26], m, i, j = 0, max_1;\n\nstruct book *creat(int m) {\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->w);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->w);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nvoid a(struct book *head) {\n  struct book *p;\n  char *x;\n  int l, ch;\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      l = (int)*x;\n      ch = l - 65;\n\n      if (ch >= 0)\n        c[ch] = c[ch] + 1;\n    }\n    p = p->next;\n  }\n}\n\nint main() {\n  struct book *head, *p;\n  struct book *creat(int m);\n  void a(struct book * head);\n  char writer, *x;\n  int wri, b[200];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 200; i++)\n    b[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  a(head);\n  max_1 = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max_1) {\n      wri = i + 65;\n      max_1 = c[i];\n    }\n  }\n  printf(\"%c \", wri);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (x = p->w; x < p->w + 26; x++) {\n      if (*x == (char)wri) {\n        b[j] = p->num;\n        j = j + 1;\n        break;\n      }\n    }\n    p = p->next;\n  }\n  printf(\"%d \", j);\n  for (j = 0; b[j] > 0; j++)\n    printf(\"%d \", b[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "2919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct person {\n  int num;\n  int book[1000];\n};\nstruct person p[26];\nint n, m, i, j, k;\nchar str[30];\nint main() {\n  memset(p, 0, sizeof(p));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &m, str);\n    for (j = strlen(str) - 1; j >= 0; j--)\n      if (str[j] >= 'A' && str[j] <= 'Z') {\n        k = p[str[j] - 'A'].num++;\n        p[str[j] - 'A'].book[k] = m;\n      }\n  }\n  m = 0;\n  for (i = 1; i < 26; i++)\n    if (p[i].num > p[m].num)\n      m = i;\n  cout << 'A' + m << \"\\n\";\n  printf(\"%d\\n\", p[m].num);\n  for (i = 0; i < p[m].num; i++)\n    printf(\"%d\\n\", p[m].book[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int co;\n  char A[26];\n};\n\nint main() {\n  int m, i, k, max;\n  int count[26];\n  int *cc;\n  cin >> m;\n  struct book *bk = (struct book *)malloc(sizeof(struct book) * m);\n  struct book *p;\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d %s\", &(p->co), p->A);\n  }\n  cc = count;\n  memset(count, 0, sizeof(count));\n  for (i = 0; i < 26; i++, cc++) {\n    p = bk;\n    for (k = 0; k < m; k++, p++) {\n      if (strchr(p->A, 'A' + i)) {\n        (*cc)++;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > count[max]) {\n      max = i;\n    }\n  }\n  printf(\"%d\\n%d\\n\", 'A' + max, count[max]);\n  p = bk;\n  for (i = 0; i < m; i++, p++) {\n    if (strchr(p->A, 'A' + max)) {\n      printf(\"%d\\n\", p->co);\n    }\n  }\n  free(bk);\n  return 0;\n}\n"}
{"label": "2", "index": "2921", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[30];\n} book[1200];\nint main() {\n  int n, l, t, a[30];\n  char m;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].writer;\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      t = book[i].writer[j] - 65;\n      a[t]++;\n    }\n  }\n  t = a[0];\n  l = 0;\n  for (int i = 0; i < 26; i++) {\n    if (a[i] > t) {\n      l = i;\n      t = a[i];\n    }\n  }\n  m = l + 65;\n  cout << m << endl;\n  cout << t << endl;\n  for (int i = 0; i < 30; i++)\n    a[i] = 0;\n  for (int i = 0; i < n; i++) {\n    l = strlen(book[i].writer);\n    for (int j = 0; j < l; j++) {\n      if (book[i].writer[j] == m)\n        cout << book[i].id << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2922", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct node \n{\n  int num;\n  char name[26];\n  struct node *next;\n};\nint n = 1, m;\nstruct zuozhe {\n  char name;\n  int books[300];\n  int num;\n} zuozhe[26];\n\nstruct node *getlinked() {\n  struct node *head, *newnode, *thisnode;\n  \n  do {\n    newnode = (struct node *)malloc(sizeof(struct node)); \n    if (newnode == NULL)                                  \n    {\n      printf(\"malloc failed\");\n      exit(-1);\n    }\n    scanf(\"%d%s\", &newnode->num, &newnode->name);\n    newnode->next = NULL;\n    if (n == 1) \n    {\n      thisnode = newnode;\n      head = newnode;\n    } else \n    {\n      thisnode->next = newnode;\n    }\n    if (n <= m) {\n      thisnode = newnode; \n      n++;                \n    }\n  } while (n <= m);\n  return head;\n}\nvoid tongji(struct node *p, int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(p->name); j++) {\n      zuozhe[(p->name)[j] - 'A'].books[zuozhe[(p->name)[j] - 'A'].num] = p->num;\n      zuozhe[(p->name)[j] - 'A'].num++;\n    }\n    p = p->next;\n  }\n}\n\nvoid bubble(struct zuozhe array[], int n) {\n  int i = 0, pass;\n  struct zuozhe temp;\n\n  for (pass = 1; pass <= n; pass++) {\n    for (i = 0; i < n - pass; i++) {\n      if (array[i].num < array[i + 1].num) {\n        temp = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = temp;\n      }\n    }\n  }\n  return;\n}\n\nint main() {\n  struct node *p;\n  int i;\n  scanf(\"%d\", &m);\n  p = getlinked();\n  for (i = 0; i < 26; i++) {\n    zuozhe[i].name = 'A' + i;\n    zuozhe[i].num = 0;\n  }\n  tongji(p, m);\n  bubble(zuozhe, 26);\n  printf(\"%c\\n%d\\n\", zuozhe[0].name, zuozhe[0].num);\n  for (i = 0; i < zuozhe[0].num; i++) {\n    printf(\"%d\\n\", zuozhe[0].books[i]);\n  }\n}\n"}
{"label": "2", "index": "2923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, b[91][1000], max = 0, i, j, k, s, m, writer;\n  struct book bk[1000];\n  scanf(\"%d\", &n); \n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].num, bk[i].wr);\n  }                        \n  for (i = 0; i < 26; i++) \n  {\n    s = 0;\n    for (j = 0; j < n; j++) \n    {\n      m = strlen(bk[j].wr); \n      for (k = 0; k < m; k++) {\n        if (bk[j].wr[k] == i + 65) {\n          b[i][s] = bk[j].num; \n          s++;\n          k = m;\n        }\n      }\n    }\n    if (s > max) \n    {\n      max = s;\n      writer = i;\n    }\n  }\n  printf(\"%c\\n%d\", writer + 65, max);\n  for (i = 0; i < max; i++)\n    printf(\"\\n%d\", b[writer][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a[1000], l[1000], i, j, k, t, time[26] = {0}, max, q = 0;\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char b[1000][26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    l[i] = strlen(b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[i][j] == name[k])\n          time[k]++;\n      }\n    }\n  }\n  max = time[0];\n  for (i = 1; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", name[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (b[i][j] == name[t]) {\n        cout << a[i] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2925", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k, x, t;\n  struct book {\n    int num;\n    char w[26];\n  } b[1000];\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i].num);\n    scanf(\"%s\", &b[i].w);\n  }\n  int c[26];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].w[k] != '\\0' && b[j].w[k] - i == 'A')\n          c[i]++;\n      }\n    }\n  }\n  int d[26];\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (i = 0; i < 25; i++) {\n    if (d[i] > d[i + 1]) {\n      t = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = t;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == d[25])\n      x = i;\n  }\n  printf(\"%c\\n\", 'A' + x);\n  printf(\"%d\\n\", c[x]);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (b[j].w[k] - x == 'A')\n        printf(\"%d\\n\", b[j].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, c[26] = {0}, d[26] = {0}, j, s, t, k;\n  char b[26000], r, max;\n  scanf(\"%d\\n\", &n);\n  struct book {\n    int num;\n    char author[26];\n  } a[999];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\\n\", &a[i].num, &a[i].author);\n  strcpy(b, a[0].author);\n  for (i = 1; i < n; i++)\n    strcat(b, a[i].author);\n  s = strlen(b);\n  for (r = 'A', j = 0; r <= 'Z', j < 26; r++, j++)\n    for (i = 0; i < s; i++)\n      if (b[i] == r)\n        c[j]++;\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n      }\n  k = d[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] == k)\n      max = i + 65;\n  printf(\"%c\\n%d\\n\", max, k);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == max)\n        printf(\"%d\\n\", a[i].num);\n}\n"}
{"label": "2", "index": "2927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, len, i, j, k, max;\n  int c[26] = {0};\n  char a[26], f, x;\n  struct book {\n    int num;\n    char author[26];\n  };\n  struct book b[1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> b[i].num >> b[i].author;\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ('A' <= (x = a[j]) && (x = a[j]) <= 'Z')\n        c[x - 'A']++;\n  }\n  max = c[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ((f = a[j]) == k + 'A')\n        printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "2928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char peo[26];\n} book1[999];\nint main() {\n  int n, i, j, m = 0, num[26] = {0}, length, max = 0, t;\n  char author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book1[i].id, &book1[i].peo);\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      num[(int)(book1[i].peo[j] - 'A')]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      t = i;\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, num[t]);\n  for (i = 0; i < n; i++) {\n    length = strlen(book1[i].peo);\n    for (j = 0; j < length; j++) {\n      if (book1[i].peo[j] == author) {\n        printf(\"%d\\n\", book1[i].id);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num = 0, n, a[26], name[1000], name2[1000], i, j, k, max = 0, maxi = 0;\n  char wr[1000][27];\n  char q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &(name[i]), wr[i]);\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (wr[i][j] == 'A' + k)\n          a[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxi = i;\n    }\n  }\n  q = 'A' + maxi;\n  printf(\"%c\\n\", q);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (wr[i][j] == q) {\n        name2[num] = name[i];\n        num++;\n      }\n    }\n  }\n  cout << num << \"\\n\";\n  for (i = 0; i < num; i++)\n    cout << name2[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "2930", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[26] = {0};\nint n;\nint max_1;\nint hao;\nstruct chushu {\n  int num;\n  char s[30];\n  struct chushu *next;\n};\nstruct chushu *create() {\n  int j = 0, q, i = 0, k = 0;\n\n  struct chushu *head, *p1, *p2;\n  p1 = (struct chushu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->s);\n\n  for (i = 0; p1->s[i] != '\u0000'; i++) {\n    j = p1->s[i] - 65;\n    a[j] = a[j] + 1;\n  }\n\n  head = p1;\n  p2 = p1;\n  while (k < n - 1) {\n    k++;\n    p2 = p1;\n    p1 = (struct chushu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n\n    for (i = 0; p1->s[i] != '\u0000'; i++) {\n      j = p1->s[i] - 65;\n      a[j] = a[j] + 1;\n    }\n\n    p2->next = p1;\n  }\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\n\n\nvoid search(struct chushu *head) {\n  int i;\n  struct chushu *p;\n  p = head;\n  while (p->next != NULL) {\n    for (i = 0; p->s[i] != '\u0000'; i++) {\n      if (hao + 65 == p->s[i])\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n  for (i = 0; p->s[i] != '\u0000'; i++) {\n    if (hao + 65 == p->s[i])\n      printf(\"%d \", p->num);\n  }\n}\n\nint main() {\n  int i;\n  struct chushu *p;\n\n  scanf(\"%d\", &n);\n  p = create();\n  max_1 = 0;\n  \n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max_1) {\n      max_1 = a[i];\n      hao = i;\n    }\n  }\n  printf(\"%c \", hao + 65);\n  printf(\"%d \", max_1);\n  search(p);\n}\n"}
{"label": "2", "index": "2931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        cout << a[i].number << \"\\n\";\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct books {\n    int num;\n    char author[26];\n  } books[999];\n  int n, a[26] = {0}, max, i, j, u, lenth, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &books[i].num, books[i].author);\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      for (u = 0; u < 26; u++) {\n        if (books[i].author[j] == 'A' + u)\n          a[u]++;\n      }\n    }\n  }\n  temp = a[0];\n  for (u = 0; u < 26; u++)\n    if (a[u] >= temp) {\n      max = u;\n      temp = a[u];\n    }\n  cout << 'A' + max << \"\\n\" << a[max] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    lenth = strlen(books[i].author);\n    for (j = 0; j < lenth; j++) {\n      if (books[i].author[j] == 'A' + max)\n        cout << books[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2933", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, card[1000], num[26] = {0}, max = 0, k = 0;\n  char s[1000][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> card[i] >> s[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      num[s[i][j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != 0; j++)\n      if (s[i][j] == k + 'A') {\n        printf(\"%d\\n\", card[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "2934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, b[26] = {0}, m, j, max = 0, k;\n  char str[1000][30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i], str[i]);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == 'A')\n        b[0]++;\n      if (str[i][j] == 'B')\n        b[1]++;\n      if (str[i][j] == 'C')\n        b[2]++;\n      if (str[i][j] == 'D')\n        b[3]++;\n      if (str[i][j] == 'E')\n        b[4]++;\n      if (str[i][j] == 'F')\n        b[5]++;\n      if (str[i][j] == 'G')\n        b[6]++;\n      if (str[i][j] == 'H')\n        b[7]++;\n      if (str[i][j] == 'I')\n        b[8]++;\n      if (str[i][j] == 'J')\n        b[9]++;\n      if (str[i][j] == 'K')\n        b[10]++;\n      if (str[i][j] == 'L')\n        b[11]++;\n      if (str[i][j] == 'M')\n        b[12]++;\n      if (str[i][j] == 'N')\n        b[13]++;\n      if (str[i][j] == 'O')\n        b[14]++;\n      if (str[i][j] == 'P')\n        b[15]++;\n      if (str[i][j] == 'Q')\n        b[16]++;\n      if (str[i][j] == 'R')\n        b[17]++;\n      if (str[i][j] == 'S')\n        b[18]++;\n      if (str[i][j] == 'T')\n        b[19]++;\n      if (str[i][j] == 'U')\n        b[20]++;\n      if (str[i][j] == 'V')\n        b[21]++;\n      if (str[i][j] == 'W')\n        b[22]++;\n      if (str[i][j] == 'X')\n        b[23]++;\n      if (str[i][j] == 'Y') {\n        b[24]++;\n      }\n      if (str[i][j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "2935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  int a;\n  char name[26];\n};\nint main() {\n  struct people pl[1000];\n  int i, j, k, l = 0, n, s, m, max, x[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pl[i].a >> pl[i].name;\n\n  for (i = 0; i < n; i++) {\n    m = strlen(pl[i].name);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++)\n        if (k == pl[i].name[j] - 'A') {\n          x[k]++;\n          break;\n        }\n  }\n  max = x[0];\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max) {\n      printf(\"%c\\n\", 'A' + i);\n      s = i;\n      printf(\"%d\\n\", x[i]);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (pl[i].name[j] == 'A' + s) {\n        cout << pl[i].a << \"\\n\";\n        break;\n      }\n}\n"}
{"label": "2", "index": "2936", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int id;\n  char author[27];\n  struct book *next;\n};\n\nstruct book *creat() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct book *p1, *head, *p0;\n  head = NULL;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p0 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p0->id, p0->author);\n    if (head == NULL) {\n      p1 = p0;\n      head = p1;\n      p0->next = NULL;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n      p1 = p0;\n    }\n  }\n  return (head);\n}\nchar best(struct book *head) {\n  int i, max, a[26];\n  struct book *p;\n  p = head;\n  for (i = 0; i < 26; ++i)\n    a[i] = 0;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      a[p->author[i] - 'A']++;\n      i++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (i == 0)\n      max = i;\n    else if (a[i] > a[max])\n      max = i;\n  }\n  return ('A' + max);\n}\nvoid print(char x, struct book *head) {\n  int i, k = 0;\n  char a = x;\n  struct book *p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        k++;\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n  printf(\"%c\\n%d\\n\", a, k);\n  p = head;\n  while (p != NULL) {\n    i = 0;\n    while (p->author[i] != '\\0') {\n      if (p->author[i] == a) {\n        printf(\"%d\\n\", p->id);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  char writer;\n  struct book *head;\n  head = creat();\n  writer = best(head);\n  print(writer, head);\n  return 0;\n}\n"}
{"label": "2", "index": "2937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  char name[26];\n  int a;\n};\nint main() {\n  int n, i, k, l, m;\n  char j, t;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  struct Student stu[999];\n  for (i = 0; i < n; i++)\n    cin >> stu[i].a >> stu[i].name;\n\n  for (j = 'A', k = 0; j <= 'Z'; j++, k++)\n    for (i = 0; i < n; i++)\n      for (l = 0; l < 26; l++)\n        if (stu[i].name[l] == j)\n          b[k]++;\n  for (j = 'A', k = 0, m = 0; j <= 'Z'; j++, k++)\n    if (b[k] > m) {\n      m = b[k];\n      t = j;\n    }\n  cout << t << \"\\n\" << m;\n  for (i = 0; i < n; i++)\n    for (l = 0; l < 26; l++)\n      if (stu[i].name[l] == t)\n        printf(\"\\n%d\", stu[i].a);\n  return 0;\n}\n"}
{"label": "2", "index": "2938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], i, l, j, max, s[26] = {0};\n  char c[1000][27], w;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j < l; j++) {\n      s[c[i][j] - 65]++;\n    }\n  }\n  max = s[0];\n  w = 'A';\n  for (i = 1; i < 26; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      w = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == w) {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[999], m, i, j, c[26], max = 0, d, k;\n  scanf(\"%d\\n\", &m);\n  for (k = 0; k < 26; k++)\n    c[k] = 0;\n\n  struct books {\n    int num;\n    char name[26];\n  } books[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &books[i].num, books[i].name);\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      c[books[i].name[j] - 'A']++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (c[k] > max) {\n      max = c[k];\n      d = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      if (books[i].name[j] == d + 'A') {\n        printf(\"%d\\n\", books[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  } b[1000];\n  int m, i, j, n[26] = {0}, max = 0, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      ++n[b[i].name[j] - 65];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      t = i + 65;\n    }\n  }\n  cout << t << \" \";\n  cout << max << \" \";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (b[i].name[j] == t)\n        printf(\"%d \", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct {\n  int a;\n  char b[26];\n} shu[1000];\n\nint main() {\n  int s[27];\n  int n, i, j, o, max, t = 1, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].a, shu[i].b);\n\n  for (i = 1; i <= 26; i++)\n    s[i] = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(shu[i].b); j++) {\n      o = shu[i].b[j] - 64;\n      s[o]++;\n    }\n\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (max < s[i]) {\n      max = s[i];\n      t = i;\n    }\n  printf(\"%d\\n\", t + 64);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    x = strlen(shu[i].b);\n    for (j = 0; j < x; j++)\n      if (shu[i].b[j] == t + 64)\n        cout << shu[i].a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int mun;\n  char name[26];\n} a[999];\nint main() {\n  int n, i, j, l, q = 0;\n  char k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].mun, a[i].name);\n  }\n  int w[26] = {0};\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      k = a[i].name[j];\n      w[k - 65]++;\n    }\n  }\n  int max;\n  max = w[0];\n  int flag = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      flag = i;\n    }\n  }\n  cout << flag + 65 << \"\\n\";\n  printf(\"%d\\n\", w[flag]);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      if (a[i].name[j] == (flag + 65))\n        printf(\"%d\\n\", a[i].mun);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint c[26];\nchar b[1000][100];\nchar out;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, tmp = 0, tmp1 = 0, tmp2;\n  int a[1000];\n  out = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n\n    if (c[i] > tmp) {\n      tmp = c[i];\n      tmp1 = i;\n    }\n  }\n\n  printf(\"%d\\n%d\\n\", out + tmp1, tmp);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j] != '\\0'; j++) {\n      tmp2 = b[i][j];\n\n      if (tmp2 == (out + tmp1)) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book1 {\n    int num;\n    char author[20];\n  } book[999];\n  int time[26] = {0};\n  int n, i, j, k, maxi, sign = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == 'A' + k) {\n          time[k] += 1;\n          break;\n        }\n      }\n    }\n  }\n  maxi = 0;\n  for (i = 0; i < 26; i++) {\n    if (time[maxi] < time[i]) {\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxi, time[maxi]);\n  for (i = 0; i < n && sign == 0; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        cout << \"\\n\" << book[i].num;\n        sign = 1;\n        break;\n      }\n    }\n  }\n  for (; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        cout << \"\\n\" << book[i].num;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = 0, m, i, j, n, k, a[999], c[26] = {0};\n  char b[999][999];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], b[i]);\n  for (i = 0; i < m; i++) {\n    k = strlen(b[i]);\n    for (j = 0; j < k; j++)\n      c[b[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++) {\n    if (t < c[j])\n      t = c[j];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == t) {\n      printf(\"%c\\n\", i + 'A');\n      break;\n    }\n  }\n  printf(\"%d\\n\", t);\n  for (j = 0; j < m; j++) {\n    k = strlen(b[j]);\n    for (n = 0; n < k; n++) {\n      if ((b[j][n] - 'A') == i)\n        printf(\"%d\\n\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char writer[26];\n  int num;\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i, m;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p1->next = NULL;\n  }\n  p2->next = p1;\n  return (head);\n}\nint main() {\n  int n, a[26][1000] = {0}, b[26] = {0}, i, max, k;\n  struct book *head, *p;\n  char *q;\n  head = creat();\n  for (p = head->next; p; p = p->next) {\n    n = strlen(p->writer);\n    for (i = 0, q = p->writer; i < n; i++, q++) {\n      a[*q - 65][b[*q - 65]] = p->num;\n      b[*q - 65]++;\n    }\n  }\n  max = b[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  for (i = 0; i < max; i++)\n    cout << a[k][i] << \"\\n\";\n}\n"}
{"label": "2", "index": "2947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int a[1000];\n  char s[1000][30], ch;\n  int b[30] = {0};\n  int i, k;\n  int n;\n  int max = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (ch = 'A'; ch <= 'Z'; ch++)\n      if (strchr(s[i], ch) != NULL)\n        b[ch - 65]++;\n\n  for (i = 0; i <= 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  ch = k + 65;\n  for (i = 0; i < n; i++)\n    if (strchr(s[i], ch) != NULL)\n      cout << a[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "2948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } b[999];\n  int a[26] = {0}, n, i, j, k, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].author);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      k = 0;\n      while (b[j].author[k] != '\\0') {\n        if (b[j].author[k] == i + 65)\n          a[i]++;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (max < a[i])\n      max = a[i];\n  i = 0;\n  while (max != a[i]) {\n    i++;\n  }\n  printf(\"%c\\n%d\\n\", i + 65, a[i]);\n  for (j = 0; j < n; j++) {\n    k = 0;\n    while (b[j].author[k] != i + 65 && b[j].author[k] != '\\0')\n      k++;\n    if (b[j].author[k] == i + 65)\n      printf(\"%d\\n\", b[j].num);\n  }\n}\n"}
{"label": "2", "index": "2949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0;\n  cin >> n;\n  int num[1000];\n  int sum[26];\n  for (i = 0; i < 26; i++) {\n    sum[i] = 0;\n  }\n  char a[1000][27];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &num[i], a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      sum[a[i][j] - 'A'] = sum[a[i][j] - 'A'] + 1;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (sum[i] > sum[max]) {\n      max = i;\n    }\n  }\n\n  printf(\"%c\\n\", max + 'A');\n  printf(\"%d\\n\", sum[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] == max + 'A') {\n        cout << num[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[999], i, k[27] = {0}, j, t, m;\n  char b[999][27];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; b[i][j]; j++)\n      k[b[i][j] - 65]++;\n  }\n  t = k[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (k[j] > t) {\n      t = k[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", m + 65, t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j]; j++) {\n      if (b[i][j] == m + 65) {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char aut[26];\n};\n\nint main() {\n  int m, i, j, k;\n  int a[27] = {0};\n  struct book cal[1001];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &cal[i].id, cal[i].aut);\n  }\n  for (j = 65; j < 91; j++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < 27; k++) {\n        if (cal[i].aut[k] == j)\n          a[j - 65]++;\n      }\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (cal[i].aut[j] == t + 65)\n        printf(\"%d\\n\", cal[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p;\n  char q[1000][30];\n  int shu[26] = {0};\n  char zm[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int n, i, j, k;\n  int len, max = 0;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    len = 0;\n    scanf(\"%d %s\", &p[i], q[i]);\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (q[i][j] == zm[k])\n          shu[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", zm[k], shu[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      if (q[i][j] == zm[k]) {\n        cout << p[i] << \"\\n\";\n      }\n    }\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "2953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, sum[26] = {0}, m, j, max = 0, p;\n  struct book {\n    int num;\n    char au[27];\n    int l;\n  };\n  struct book bk[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bk[i].num, bk[i].au);\n    bk[i].l = strlen(bk[i].au);\n    for (j = 0; j < bk[i].l; j++) {\n      switch (bk[i].au[j]) {\n      case 'A':\n        sum[0] += 1;\n        break;\n      case 'B':\n        sum[1] += 1;\n        break;\n      case 'C':\n        sum[2] += 1;\n        break;\n      case 'D':\n        sum[3] += 1;\n        break;\n      case 'E':\n        sum[4] += 1;\n        break;\n      case 'F':\n        sum[5] += 1;\n        break;\n      case 'G':\n        sum[6] += 1;\n        break;\n      case 'H':\n        sum[7] += 1;\n        break;\n      case 'I':\n        sum[8] += 1;\n        break;\n      case 'J':\n        sum[9] += 1;\n        break;\n      case 'K':\n        sum[10] += 1;\n        break;\n      case 'L':\n        sum[11] += 1;\n        break;\n      case 'M':\n        sum[12] += 1;\n        break;\n      case 'N':\n        sum[13] += 1;\n        break;\n      case 'O':\n        sum[14] += 1;\n        break;\n      case 'P':\n        sum[15] += 1;\n        break;\n      case 'Q':\n        sum[16] += 1;\n        break;\n      case 'R':\n        sum[17] += 1;\n        break;\n      case 'S':\n        sum[18] += 1;\n        break;\n      case 'T':\n        sum[19] += 1;\n        break;\n      case 'U':\n        sum[20] += 1;\n        break;\n      case 'V':\n        sum[21] += 1;\n        break;\n      case 'W':\n        sum[22] += 1;\n        break;\n      case 'X':\n        sum[23] += 1;\n        break;\n      case 'Y':\n        sum[24] += 1;\n        break;\n      case 'Z':\n        sum[25] += 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      p = i;\n    } else\n      ;\n  }\n  printf(\"%c %d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < bk[i].l; j++) {\n      if (bk[i].au[j] == p + 65) {\n        cout << \" \" << bk[i].num;\n        break;\n      } else\n        ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n} b[1001];\nint main() {\n  int n, i, j, k, d, g[27], e = 0, f = 0;\n  char m, h;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  m = 'A';\n  for (k = 0; k < 26; k++) {\n    d = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < 26; j++) {\n        if (b[i].name[j] == m)\n          d++;\n        if (b[i].name[j] == '\\0')\n          break;\n      }\n    }\n    m = m + 1;\n    g[k] = d;\n    if (g[k] > e) {\n      e = g[k];\n      f = k;\n    }\n  }\n  h = 'A' + f;\n  printf(\"%c\\n%d\\n\", h, e);\n  for (i = 0; i < n; i++) {\n    d = 0;\n    for (j = 0; j < 26; j++) {\n      if (b[i].name[j] == h)\n        d++;\n      if (b[i].name[j] == '\\0')\n        break;\n    }\n    if (d != 0)\n      printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "2955", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n} b[1001];\nint main() {\n  int n, i, j, k, d, g[27], e = 0, f = 0, l;\n  char m, h;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  m = 'A';\n  for (k = 0; k < 26; k++) {\n    d = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < 26; j++) {\n        if (b[i].name[j] == m)\n          d++;\n        if (b[i].name[j] == '\\0')\n          break;\n      }\n    }\n    m = m + 1;\n    g[k] = d;\n    if (g[k] > e) {\n      e = g[k];\n      f = k;\n    }\n  }\n  h = 'A' + f;\n  printf(\"%c\\n%d\\n\", h, e);\n  for (i = 0; i < n; i++) {\n    d = 0;\n    for (j = 0; j < 26; j++) {\n      if (b[i].name[j] == h)\n        d++;\n      if (b[i].name[j] == '\\0')\n        break;\n    }\n    if (d != 0) {\n      printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->str;\n  head = 0;\n  while (p1->num != 0) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->str;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x = 1, c;\n  cin >> m;\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 64]++;\n    }\n  }\n  max = sum[1];\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 64)\n        a[y] = p->num;\n    y++;\n  }\n  printf(\"%c\\n%d\\n\", x + 64, max);\n  for (y = 1; y <= 99; y++)\n    if (a[y] != 0)\n      printf(\"%d\\n\", a[y]);\n}\n"}
{"label": "2", "index": "2957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct writer {\n    int sum;\n    char c;\n  } lit[26] = {0,   'A', 0,   'B', 0,   'C', 0,   'D', 0,   'E', 0,   'F', 0,\n               'G', 0,   'H', 0,   'I', 0,   'J', 0,   'K', 0,   'L', 0,   'M',\n               0,   'N', 0,   'O', 0,   'P', 0,   'Q', 0,   'R', 0,   'S', 0,\n               'T', 0,   'U', 0,   'V', 0,   'W', 0,   'X', 0,   'Y', 0,   'Z'};\n  struct book {\n    int id;\n    char name[26];\n  } data[1000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    cin >> data[i].id >> data[i].name;\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (data[i].name[j] == lit[k].c)\n          lit[k].sum++;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (lit[i].sum < lit[i - 1].sum) {\n      struct writer tmp;\n      tmp = lit[i - 1];\n      lit[i - 1] = lit[i];\n      lit[i] = tmp;\n    }\n  }\n  printf(\"%c\\n%d\\n\", lit[25].c, lit[25].sum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      if (data[i].name[j] == lit[25].c) {\n        cout << data[i].id << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[27];\n    struct book *next;\n  } *head = 0, *p1, *p2;\n  int total, i, j, sumbook[26] = {0}, len, max;\n  scanf(\"%d\", &total);\n  for (i = 0; i < total; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    if (p1 == 0) {\n      printf(\"Memory request failed!\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &p1->num, p1->author);\n    len = strlen(p1->author);\n    for (j = 0; j < len; j++)\n      sumbook[p1->author[j] - 'A']++;\n    if (head)\n      p2->next = p1;\n    else\n      head = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  len = 0;\n  for (i = 0; i < 26; i++) {\n    if (sumbook[i] > len) {\n      len = sumbook[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', sumbook[max]);\n  max += 'A';\n  for (p1 = head; p1; p1 = p1->next) {\n    len = strlen(p1->author);\n    for (i = 0; i < len; i++) {\n      if (p1->author[i] == max) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, c[26] = {0}, d[26] = {0}, j, s, t, k;\n  char b[26000], r, max;\n  scanf(\"%d\\n\", &n);\n  struct book {\n    int num;\n    char author[26];\n  } a[999];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\\n\", &a[i].num, &a[i].author);\n  strcpy(b, a[0].author);\n  for (i = 1; i < n; i++)\n    strcat(b, a[i].author);\n  s = strlen(b);\n  for (r = 'A', j = 0; r <= 'Z', j < 26; r++, j++)\n    for (i = 0; i < s; i++)\n      if (b[i] == r)\n        c[j]++;\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n      }\n  k = d[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] == k)\n      max = i + 65;\n  printf(\"%c\\n%d\\n\", max, k);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == max)\n        cout << a[i].num << \"\\n\";\n}\n"}
{"label": "2", "index": "2960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char name[26];\n  struct inf *next;\n};\n\nint m;\nstruct inf *creat(void) {\n  struct inf *head, *p1, *p2;\n  int n;\n  p1 = p2 = (struct inf *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  n = 0;\n  while (1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (n == m)\n      break;\n    else {\n      p1 = (struct inf *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid count(struct inf *head, int o) {\n  struct inf *q1;\n  int *q2, *q3, *q4;\n  char *t1;\n  q1 = head;\n  q2 = (int *)malloc(26 * 1000);\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    *q3 = 0;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      *(q2 + (*t1 - 'A')) = *(q2 + (*t1 - 'A')) + 1;\n    q1 = q1->next;\n  }\n  q4 = q2;\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    if (*q4 < *q3)\n      q4 = q3;\n  printf(\"%c %d \", q4 - q2 + 'A', *q4);\n  q1 = head;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      if (*t1 == (q4 - q2 + 'A'))\n        printf(\"%d \", q1->num);\n    q1 = q1->next;\n  }\n}\n\nint main() {\n  struct inf *head, *s;\n  scanf(\"%d\", &m);\n  head = creat();\n  s = head;\n  count(head, m);\n  \n}\n"}
{"label": "2", "index": "2961", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num = 0, n, a[26], name[1000], name2[1000], i, j, k, max = 0, maxi = 0;\n  char wr[1000][27];\n  char q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &(name[i]), wr[i]);\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (wr[i][j] == 'A' + k)\n          a[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxi = i;\n    }\n  }\n  q = 'A' + maxi;\n  printf(\"%c\\n\", q);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (wr[i][j] == q) {\n        name2[num] = name[i];\n        num++;\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", name2[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "2962", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int mun;\n  char name[26];\n} a[999];\nint main() {\n  int n, i, j, l, q = 0;\n  char k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].mun >> a[i].name;\n  }\n  int w[26] = {0};\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      k = a[i].name[j];\n      w[k - 65]++;\n    }\n  }\n  int max;\n  max = w[0];\n  int flag = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      flag = i;\n    }\n  }\n  printf(\"%c\\n\", flag + 65);\n  printf(\"%d\\n\", w[flag]);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].name);\n    for (j = 0; j < l; j++) {\n      if (a[i].name[j] == (flag + 65)) {\n        printf(\"%d\\n\", a[i].mun);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  char name[20];\n  int num;\n} book[1000];\n\nint main() {\n  int n, i, j, max = 0, m = 0;\n  scanf(\"%d\", &n);\n  int c[26] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      strchr(book[i].name, 'A' + j) ? c[j]++ : 0;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (c[j] > max) {\n      max = c[j];\n      m = j;\n    }\n  }\n  cout << 'A' + m << \"\\n\" << c[m] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    strchr(book[i].name, 'A' + m) ? printf(\"%d\\n\", book[i].num) : 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct bookinf {\n    int code;\n    char auth[27];\n  } book[999];\n  int i, k, m, max = 0, num[26];\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].code, book[i].auth);\n    for (k = 0; book[i].auth[k] != '\\0'; k++)\n      num[book[i].auth[k] - 'A'] += 1;\n  }\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  cout << max + 'A' << \"\\n\" << num[max] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (k = 0; book[i].auth[k] != '\\0'; k++) {\n      if (book[i].auth[k] == max + 'A') {\n        printf(\"%d\\n\", book[i].code);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2965", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n = 0, i = 0, j = 0, num[100], k = 0, count[26] = {0}, max = 0;\n  char nam[100][30] = {NULL};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cin.get();\n\n    cin >> nam[i];\n    for (j = 0; j < strlen(nam[i]); j++)\n      count[nam[i][j] - 'A']++;\n  }\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      k = i;\n    } else\n      continue;\n  }\n  j = 0;\n  cout << (char)(k + 'A') << endl;\n  cout << max << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0;; j++) {\n      if (nam[i][j] == k + 'A') {\n        cout << num[i] << endl;\n        break;\n      }\n      if (nam[i][j] == NULL)\n        break;\n    }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[26][1000];\nint ai[26];\nvoid func() {\n  int k, i, len;\n  char str[27];\n  scanf(\"%d %s\", &k, str);\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    a[str[i] - 'A'][ai[str[i] - 'A']] = k;\n    ai[str[i] - 'A']++;\n  }\n}\nint main() {\n  memset(a, 0, sizeof(a));\n  memset(ai, 0, sizeof(ai));\n  int n, i, i0, max = 0;\n  scanf(\"%d\", &n);\n  while (n--)\n    func();\n  for (i = 0; i < 26; i++) {\n    if (ai[i] > max) {\n      max = ai[i];\n      i0 = i;\n    }\n  }\n  cout << i0 + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < ai[i0]; i++)\n    printf(\"%d\\n\", a[i0][i]);\n}\n"}
{"label": "2", "index": "2967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, x, maxnumber;\n  scanf(\"%d\", &m);\n  int booknum[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &booknum[i], k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  cout << who << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j < strlen(k[i]); j++) {\n      if (k[i][j] == who)\n        cout << booknum[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char str[26];\n} bk[1000];\nint main() {\n  int m, i, j, k, s, n = 0;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n                'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int b[26] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].str);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      for (k = 0; k < 26; k++)\n        if (a[k] == bk[i].str[j])\n          b[k]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > n) {\n      n = b[i];\n      s = i;\n    }\n  cout << a[s] << \"\\n\" << b[s] << \"\\n\";\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      if (bk[i].str[j] == a[s])\n        printf(\"%d\\n\", bk[i].num);\n  return 0;\n}\n"}
{"label": "2", "index": "2969", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n};\nint i, j, n, t, number[100], m;\nstruct book *creat(void) {\n  struct book *p1, *p2, *head;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &m);\n  struct book *creat(void);\n  struct book *head, *p;\n  int a[26] = {0}, max, maxindex = 0;\n  head = p = creat();\n  char *pointer;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      for (i = 0; i < 26; i++) {\n        if (*pointer == 65 + i)\n          a[i]++;\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxindex = i;\n    }\n  }\n  printf(\"%c %d \", 65 + maxindex, a[maxindex]);\n  p = head;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      if (*pointer == 65 + maxindex)\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "2970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, m, a[26][999], num[26] = {0}, t, max;\n  char zz[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &t, zz);\n    for (j = 0; j < strlen(zz); j++) {\n      a[(int)(zz[j] - 'A')][num[(int)(zz[j] - 'A')]] = t;\n      num[(int)(zz[j] - 'A')]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < num[max]; i++)\n    cout << a[max][i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "2971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct writer {\n    int sum;\n    char c;\n  } lit[26] = {0,   'A', 0,   'B', 0,   'C', 0,   'D', 0,   'E', 0,   'F', 0,\n               'G', 0,   'H', 0,   'I', 0,   'J', 0,   'K', 0,   'L', 0,   'M',\n               0,   'N', 0,   'O', 0,   'P', 0,   'Q', 0,   'R', 0,   'S', 0,\n               'T', 0,   'U', 0,   'V', 0,   'W', 0,   'X', 0,   'Y', 0,   'Z'};\n  struct book {\n    int id;\n    char name[26];\n  } data[1000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &data[i].id, &data[i].name);\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (data[i].name[j] == lit[k].c)\n          lit[k].sum++;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (lit[i].sum < lit[i - 1].sum) {\n      struct writer tmp;\n      tmp = lit[i - 1];\n      lit[i - 1] = lit[i];\n      lit[i] = tmp;\n    }\n  }\n  printf(\"%c\\n%d\\n\", lit[25].c, lit[25].sum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      if (data[i].name[j] == lit[25].c)\n        cout << data[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int a;\n  char s[26];\n  struct st *n;\n};\nstruct st *creat(int m) {\n  int i;\n  struct st *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->n = p1;\n    scanf(\"%d %s\", &p1->a, p1->s);\n    p2 = p1;\n  }\n  p1->n = NULL;\n  return (head);\n}\nint main() {\n  int m;\n  struct st *creat(int m);\n  cin >> m;\n  struct st *p, *q;\n  p = creat(m);\n  q = p;\n  int i, j, k;\n  int a[26] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (k = strlen(p->s)); j++)\n      a[p->s[j] - 65]++;\n    p = p->n;\n  }\n  p = q;\n  int max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  char c;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      c = i + 65;\n      cout << c << \" \" << a[i] << \" \";\n      break;\n    }\n  }\n  char cc;\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      cc = q->s[j];\n      if (cc == '\u0000')\n        break;\n      if (c == cc)\n        cout << q->a << \" \";\n    }\n    q = q->n;\n  }\n}\n"}
{"label": "2", "index": "2973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, c[26], max = 0, d, k;\n  scanf(\"%d\\n\", &m);\n  for (k = 0; k < 26; k++) {\n    c[k] = 0;\n  }\n  struct books {\n    int num;\n    char name[26];\n  } books[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &books[i].num, books[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      c[books[i].name[j] - 'A']++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (c[k] > max) {\n      max = c[k];\n      d = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(books[i].name); j++) {\n      if (books[i].name[j] == d + 'A') {\n        printf(\"%d\\n\", books[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cishu[26];\n\nstruct shu {\n  int num;\n  char name[26];\n  struct shu *next;\n};\n\nstruct shu *app(int n) {\n  int i, len, j;\n  struct shu *newnode, *p, *head;\n  for (i = 1; i <= n; i++) {\n    newnode = (struct shu *)malloc(sizeof(struct shu));\n    scanf(\"%d %s\", &newnode->num, newnode->name);\n    len = strlen(newnode->name);\n\n    for (j = 0; j < len; j++)\n      cishu[newnode->name[j] - 'A']++;\n\n    if (i == 1) {\n      head = newnode;\n    } else {\n      p->next = newnode;\n    }\n    p = newnode;\n  }\n  p->next = 0;\n  return head;\n}\n\nint max(void) {\n  int m = 0, i, x;\n  for (i = 0; i < 26; i++) {\n    if (cishu[i] > m) {\n      m = cishu[i];\n      x = i;\n    }\n  }\n  return x;\n}\n\nint cunzai(char a[], int kk) {\n  int l, i;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (a[i] == kk + 'A')\n      return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int n, kk;\n  struct shu *head, *p;\n  scanf(\"%d\", &n);\n\n  head = app(n);\n  kk = max();\n  printf(\"%c\\n%d\\n\", 'A' + kk, cishu[kk]);\n\n  for (p = head; p != 0; p = p->next) {\n    if (cunzai(p->name, kk)) {\n      printf(\"%d\\n\", p->num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nstruct book *creat() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  p1->next = NULL;\n  if (i >= n) {\n    free(p1);\n    head = NULL;\n    return head;\n  } else {\n    head = p1;\n    p2 = p1;\n    while (i < n) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n      p1->next = NULL;\n      i++;\n      {\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n    p2->next = p1;\n    p1->next = NULL;\n    return head;\n  }\n}\nint max(char letter, struct book *head) {\n  int i, j, k;\n  i = 0;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        i++;\n    }\n    q = q->next;\n  }\n  return i;\n}\n\nvoid outbook(char letter, struct book *head) {\n  int j, k;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        printf(\"%d \", q->num);\n    }\n    q = q->next;\n  }\n}\nint main() {\n  int i, m, s;\n  struct book *p0, *p1;\n  p0 = p1 = creat();\n  int sum[26];\n  for (i = 0; i < 26; i++) {\n    sum[i] = max(i + 65, p0);\n  }\n  s = 0;\n  m = sum[0];\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > m) {\n      m = sum[i];\n      s = i;\n    }\n  }\n  printf(\"%c \", s + 65);\n  cout << m << \" \";\n  outbook(s + 65, p1);\n}\n"}
{"label": "2", "index": "2976", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j, b[999], n[26], t[2] = {0}, x = 0;\n  char a[999][26], au;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i], a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      n[(int)a[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (t[0] < n[i]) {\n      t[0] = n[i], t[1] = i;\n    }\n  }\n  au = t[1] + 65;\n  printf(\"%c\\n%d\\n\", au, t[0]);\n  for (i = 0; i < m; i++) {\n    x = 0, j = 0;\n    while (j < (int)strlen(a[i]) && x == 0) {\n      if (a[i][j] == t[1] + 65) {\n        printf(\"%d\\n\", b[i]), x++;\n      } else {\n        j++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[100];\n  struct student *next;\n};\nint main() {\n  struct student *p1, *p2, *head;\n  int n, i, j, k, m, a[100];\n  char c[100], nam[100][100];\n  for (i = 0; i < 26; i++) {\n    c[i] = i + 65;\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->s);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  i = 0;\n  while (p1 != NULL) {\n    strcpy(nam[i], p1->s);\n    i++;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s\", nam[k]);\n    for (i = 0; i < 26; i++) {\n      for (j = 0; nam[k][j] != '\\00'; j++)\n        if (nam[k][j] == c[i])\n          a[i]++;\n    }\n  }\n  k = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > k)\n      k = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == k) {\n      printf(\"%c %d\", c[i], a[i]);\n      m = i;\n      break;\n    }\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; nam[i][j] != '\\00'; j++) {\n      if (nam[i][j] == c[m])\n        printf(\" %d\", p1->num);\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2978", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  char num[500];\n  char s[50];\n  struct book *next;\n};\nint main() {\n  struct book *head;\n  struct book *p1, *p2;\n  int m, mi, i, j, k, max, found;\n  int aut[26] = {0};\n  cin >> m;\n  p1 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->s;\n  for (i = 0; i < strlen(p1->s); i++)\n    aut[(p1->s)[i] - 'A']++;\n  p1->next = NULL;\n\n  head = p2 = p1;\n\n  for (mi = 2; mi <= m; mi++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->s);\n    for (i = 0; i < strlen(p1->s); i++)\n      aut[(p1->s)[i] - 'A']++;\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (aut[i] > max) {\n      k = i;\n      max = aut[i];\n    }\n\n  printf(\"%c \", k + 65);\n  printf(\"%d \", aut[k]);\n\n  p1 = head;\n  for (i = 1; i <= m; i++) {\n    found = 0;\n    for (j = 0; j < strlen(p1->s); j++)\n      if ((p1->s)[j] == k + 65) {\n        found = 1;\n        break;\n      }\n    if (found == 1)\n      printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "2979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000] = {0}, c[27] = {0}, i, j, k, m, p, d[1000] = {0};\n  char b[1000][30] = {{0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 1; k <= 26; k++) {\n        if (b[i][j] == 64 + k)\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n\n  m = c[1];\n  p = 1;\n  for (i = 1; i < 27; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      p = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i][j] == 64 + p)\n        d[i] = 1;\n    }\n  }\n  printf(\"%c\\n\", 64 + p);\n  printf(\"%d\\n\", m);\n  for (i = 0; i < 1000; i++) {\n    if (d[i] == 1)\n      printf(\"%d\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "2980", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int m;\n  cin >> m;\n  char str[1000][26];\n  int a[1000], count[26] = {0};\n  int t = 0;\n  int shu = 0;\n\n  for (int i = 0; i < m; i++) {\n    t = 0;\n    cin >> a[i];\n    cin >> str[i];\n    t = strlen(str[i]);\n    for (int j = 0; j < t; j++) {\n      shu = str[i][j] - 'A';\n      count[shu]++;\n    }\n  }\n\n  int max = count[0];\n  int hao = 0;\n\n  for (int k = 1; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      hao = k;\n    }\n  }\n\n  char c = hao + 'A';\n\n  cout << c << endl;\n  cout << max << endl;\n\n  for (int l = 0; l < m; l++) {\n    for (int o = 0; str[l][o] != '\\0'; o++) {\n      if (str[l][o] == c) {\n        cout << a[l] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char author[26];\n};\nint main() {\n  struct book b[999];\n  int a[26];\n  int m, i, j, max, maxauthor;\n  char c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].id, b[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      a[c - 65]++;\n    }\n  }\n  max = a[0];\n  maxauthor = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxauthor = i;\n    }\n  }\n  cout << maxauthor + 65 << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      c = b[i].author[j];\n      if (c == maxauthor + 65) {\n        cout << b[i].id << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2982", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char a[26];\n  int la;\n  struct book *next;\n};\n\nstruct book *insert(struct book *head, struct book *temp) {\n  struct book *p0, *p1, *p2;\n  p1 = head;\n  p0 = temp;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->next != NULL) {\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  struct book *p, *temp, *head = NULL;\n  int i, m, max;\n  int b[26] = {0};\n  char writer;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    temp = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d \", &temp->number);\n\n    cin >> temp->a;\n\n    temp->la = strlen(temp->a);\n    temp->next = NULL;\n    head = insert(head, temp);\n  }\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      b[p->a[i] - 65]++;\n    p = p->next;\n  }\n  max = b[0];\n  writer = 65;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      writer = i + 65;\n    }\n  }\n\n  printf(\"%c %d \", writer, max);\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      if (p->a[i] == writer) {\n        printf(\"%d \", p->number);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "2983", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, sum[26] = {0}, m, j, max = 0, p;\n  struct book {\n    int num;\n    char au[27];\n    int l;\n  };\n  struct book bk[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bk[i].num, bk[i].au);\n    bk[i].l = strlen(bk[i].au);\n    for (j = 0; j < bk[i].l; j++) {\n      switch (bk[i].au[j]) {\n      case 'A':\n        sum[0] += 1;\n        break;\n      case 'B':\n        sum[1] += 1;\n        break;\n      case 'C':\n        sum[2] += 1;\n        break;\n      case 'D':\n        sum[3] += 1;\n        break;\n      case 'E':\n        sum[4] += 1;\n        break;\n      case 'F':\n        sum[5] += 1;\n        break;\n      case 'G':\n        sum[6] += 1;\n        break;\n      case 'H':\n        sum[7] += 1;\n        break;\n      case 'I':\n        sum[8] += 1;\n        break;\n      case 'J':\n        sum[9] += 1;\n        break;\n      case 'K':\n        sum[10] += 1;\n        break;\n      case 'L':\n        sum[11] += 1;\n        break;\n      case 'M':\n        sum[12] += 1;\n        break;\n      case 'N':\n        sum[13] += 1;\n        break;\n      case 'O':\n        sum[14] += 1;\n        break;\n      case 'P':\n        sum[15] += 1;\n        break;\n      case 'Q':\n        sum[16] += 1;\n        break;\n      case 'R':\n        sum[17] += 1;\n        break;\n      case 'S':\n        sum[18] += 1;\n        break;\n      case 'T':\n        sum[19] += 1;\n        break;\n      case 'U':\n        sum[20] += 1;\n        break;\n      case 'V':\n        sum[21] += 1;\n        break;\n      case 'W':\n        sum[22] += 1;\n        break;\n      case 'X':\n        sum[23] += 1;\n        break;\n      case 'Y':\n        sum[24] += 1;\n        break;\n      case 'Z':\n        sum[25] += 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      p = i;\n    } else\n      ;\n  }\n  printf(\"%c %d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < bk[i].l; j++) {\n      if (bk[i].au[j] == p + 65) {\n        printf(\" %d\", bk[i].num);\n        break;\n      } else\n        ;\n    }\n  }\n}\n"}
{"label": "2", "index": "2984", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int book;\n  char writer[26];\n  int counter[26] = {0};\n  int bookbelong[26][999] = {0};\n  int everynum[26] = {0};\n  int t = 0;\n  while (k--) {\n    scanf(\"%d %s \", &book, writer);\n    int str = strlen(writer);\n    for (int i = 0; i < str; i++)\n\n    {\n      int flag = writer[i] - 'A';\n      counter[flag]++;\n      bookbelong[flag][everynum[flag]++] = book;\n    }\n  }\n  int max = counter[0];\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (counter[i] > max) {\n      maxnum = i;\n      max = counter[i];\n    }\n  }\n  char writerbest;\n  writerbest = 'A' + maxnum;\n  cout << writerbest << endl << everynum[maxnum] << endl;\n  for (int i = 0; i < everynum[maxnum]; i++)\n    cout << bookbelong[maxnum][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "2985", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char name[27];\n  int anum;\n  int num;\n  struct student *next;\n};\nint n;\nint i;\nchar c;\n\nstruct student *creat() {\n  struct student *head;\n  head = (struct student *)malloc(1000);\n  if (n == 0)\n    head = NULL;\n  else {\n    cin >> head->num;\n    for (i = 0; (c = getchar()) != ' '; i++) {\n      head->name[i] = c;\n    }\n    head->anum = i;\n    head->next = NULL;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2, *p;\n  char l[200] = {0};\n  int j;\n  int max = 0;\n  int lmax;\n\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    {\n      p1 = (struct student *)malloc(1000);\n      p2->next = p1;\n      p2 = p1;\n\n      scanf(\"%d\", &p2->num);\n      for (j = 0; (c = getchar()) != ' '; j++) {\n        p2->name[j] = c;\n      }\n      p2->anum = j;\n\n      p2->next = NULL;\n    }\n  }\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      l[p->name[i]] = l[p->name[i]] + 1;\n    }\n    p = p->next;\n  }\n\n  for (i = 65; i <= 90; i++) {\n    if (l[i] > max) {\n      max = l[i];\n      lmax = i;\n    }\n  }\n  printf(\"%c %d \", lmax, max);\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      if (p->name[i] == lmax)\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef char q[30];\nvoid init(int a[], int f[], q *p[1000], int m) {\n  int i;\n\n  char e[432];\n  char *pp;\n  int r;\n  for (i = 1; i <= m; i++) {\n    p[i] = (q *)malloc(sizeof(q));\n\n    scanf(\"%d%s\", &f[i], p[i]);\n    getchar();\n    pp = *p[i];\n    while (*pp != '\u0000') {\n      a[*pp]++;\n      pp++;\n    }\n  }\n}\nchar pro(int a[]) {\n  char c, max, g;\n  max = -333;\n  for (c = 'A'; c <= 'Z'; c++)\n\n    if (a[c] > max) {\n      max = a[c];\n      g = c;\n    }\n  return g;\n}\nvoid print(int f[], q *p[1000], int m, char c) {\n  int i;\n  for (i = 1; i <= m; i++)\n    if (strchr(*p[i], c) != NULL)\n      printf(\"%d \", f[i]);\n}\nint main() {\n  int m, k;\n  int a[343] = {0};\n  int f[1000];\n  q *p[1000];\n  char max;\n\n  scanf(\"%d\", &m);\n\n  init(a, f, p, m);\n  max = pro(a);\n  cout << max << \" \" << a[max] << \" \";\n\n  print(f, p, m, max);\n}\n"}
{"label": "2", "index": "2987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int book;\n  char writer[26];\n  int counter[26] = {0};\n  int bookbelong[26][999] = {0};\n  int everynum[26] = {0};\n  int t = 0;\n  while (k--) {\n    cin >> book >> writer;\n    int str = strlen(writer);\n    for (int i = 0; i < str; i++)\n\n    {\n      int flag = writer[i] - 'A';\n      counter[flag]++;\n      bookbelong[flag][everynum[flag]++] = book;\n    }\n  }\n  int max = counter[0];\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (counter[i] > max) {\n      maxnum = i;\n      max = counter[i];\n    }\n  }\n  char writerbest;\n  writerbest = 'A' + maxnum;\n  cout << writerbest << endl << everynum[maxnum] << endl;\n  for (int i = 0; i < everynum[maxnum]; i++)\n    printf(\"%d\\n\", bookbelong[maxnum][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "2988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[2000], max = 0, t, b[30] = {0}, j, m;\n  char str[1000][30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], str[i]);\n    for (j = 0; j < strlen(str[i]); j++) {\n      m = str[i][j] - 64;\n      b[m]++;\n    }\n  }\n  for (i = 1; i < 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 64, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(str[i]); j++)\n      if (str[i][j] == t + 64)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2989", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char zz[32];\n  struct book *next;\n};\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->zz);\n  head = NULL;\n  for (i = 0; i < n - 1; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->zz);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid search(struct book *head, int n) {\n  int *p[26], i, j;\n  struct book *q = head;\n  for (i = 0; i < 26; i++) {\n    p[i] = (int *)malloc(sizeof(int));\n    *p[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      (*p[(q->zz)[j] - 'A'])++;\n    }\n    q = q->next;\n  }\n  q = head;\n  int max = *p[0], k = 0;\n  for (i = 1; i < 26; i++) {\n    if (*p[i] > max) {\n      max = *p[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d\", 'A' + k, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      if ((q->zz)[j] == 'A' + k)\n        printf(\" %d\", q->num);\n    }\n    q = q->next;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat(n);\n  search(head, n);\n}\n"}
{"label": "2", "index": "2990", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Book {\n  int number;\n  char author[30];\n};\n\nint main() {\n  int max = 0, len;\n  int sum[30] = {0};\n  int m, i, j;\n  struct Book book[999];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> book[i].number >> book[i].author;\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++)\n      sum[book[i].author[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > sum[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, sum[max]);\n  for (i = 0; i < m; i++) {\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++) {\n      if (book[i].author[j] == max + 65) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "2991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int m, i, j, k;\n  char s[26];\n  int w[26] = {0};\n  int len[1000];\n  int max, most;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    s[i] = 'A' + i;\n  }\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == s[k])\n          w[k]++;\n      }\n    }\n  }\n  max = w[0];\n  most = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      most = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", s[most], max);\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].author[j] == s[most])\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "2992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t = 0, m, i, j, n, k, a[999], c[26] = {0};\n  char b[999][999];\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], b[i]);\n  for (i = 0; i < m; i++) {\n    k = strlen(b[i]);\n    for (j = 0; j < k; j++)\n      c[b[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++) {\n    if (t < c[j])\n      t = c[j];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == t) {\n      printf(\"%c\\n\", i + 'A');\n      break;\n    }\n  }\n  printf(\"%d\\n\", t);\n  for (j = 0; j < m; j++) {\n    k = strlen(b[j]);\n    for (n = 0; n < k; n++) {\n      if ((b[j][n] - 'A') == i)\n        printf(\"%d\\n\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char id[26];\n} a[999];\n\nstruct aut {\n  char wri;\n  int sum;\n} b[26];\n\nint main() {\n  int n, i, j, k, t, m = 0;\n  for (i = 0; i < 26; i++) {\n    b[i].wri = 'A' + i;\n    b[i].sum = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%s\", a[i].id);\n  }\n\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].wri == a[i].id[k]) {\n          b[j].sum++;\n        }\n      }\n    }\n  }\n  int max = b[0].sum;\n  for (j = 0; j < 26; j++) {\n    if (max < b[j].sum) {\n      max = b[j].sum;\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[m].wri, max);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (a[i].id[k] == b[m].wri)\n        printf(\"%d\\n\", a[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "2994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[26] = {0};\n  char z[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  char nn[26][100][20];\n  int m, i, j, r;\n  char a[100][100];\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    scanf(\"%s\", a[j]);\n    char b[20];\n    scanf(\"%s\", b);\n    int w = strlen(b);\n    for (i = 0; i < w; i++) {\n      for (r = 0; r < 26; r++) {\n        if (b[i] == z[r]) {\n          n[r]++;\n          strcpy(nn[r][n[r]], a[j]);\n        }\n      }\n    }\n  }\n  int c = 0;\n  for (r = 1; r < 26; r++) {\n    if (n[r] > n[c])\n      c = r;\n  }\n  printf(\"%c\\n%d\\n\", z[c], n[c]);\n  for (i = 1; i <= n[c]; i++)\n    printf(\"%s\\n\", nn[c][i]);\n}\n"}
{"label": "2", "index": "2995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[20];\n};\nint main() {\n  struct book c[1000];\n  int i, j, n, k, max, l, d[26], a;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %s\", &c[k].num, c[k].name);\n    for (i = 0; i < strlen(c[k].name); i++) {\n      for (j = 0; j < 26; j++) {\n        if ('A' + j == c[k].name[i])\n          break;\n      }\n      b[j] = b[j] + 1;\n    }\n  }\n  for (a = 0; a < 26; a++)\n    d[a] = b[a];\n  max = b[0];\n  for (l = 0; l < 26; l++)\n    if (b[l] > max)\n      max = b[l];\n  for (a = 0; a < 26; a++) {\n    if (d[a] == max)\n      break;\n  }\n  printf(\"%c\\n\", 'A' + a);\n  printf(\"%d\\n\", max);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < strlen(c[k].name); i++) {\n      if ('A' + a == c[k].name[i]) {\n        printf(\"%d\\n\", c[k].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2996", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a, i, j, k, n, s[26][999] = {0}, p[26] = {0};\n  char b[26], c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> j;\n    cin >> b;\n    n = strlen(b);\n    for (k = 0; k < n; k++) {\n      a = b[k] - 'A';\n      s[a][p[a]] = j;\n      p[a]++;\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (p[j] < p[i])\n      j = i;\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, p[j]);\n  for (i = 0;; i++) {\n    if (s[j][i] != 0)\n      cout << s[j][i] << endl;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[400][400], t[400][400];\n  int n, m, i, j, k, l, p, y, z;\n  char c;\n  int a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", t[i], s[i]);\n  j = 0;\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    a[j] = p;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (m = j - 2; m >= i; m--) {\n      if (a[m] < a[m + 1]) {\n        y = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = y;\n      }\n    }\n  }\n  z = a[0];\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    if (p == z) {\n      printf(\"%c\\n\", c);\n      cout << z << \"\\n\";\n\n      for (k = 1; k <= n; k++) {\n        p = 0;\n        l = strlen(s[k]);\n        for (m = 0; m < l; m++) {\n          if (s[k][m] == c)\n            p++;\n        }\n        if (p > 0)\n          printf(\"%s\\n\", t[k]);\n      }\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "2998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[999], count[27] = {0}, len[999];\n  int m, i, j, max = 0, per;\n  cin >> m;\n  char ch[999][26], person;\n  for (i = 1; i <= m; i++) {\n    cin >> num[i] >> ch[i];\n    len[i] = strlen(ch[i]);\n    for (j = 0; j <= len[i] - 1; j++)\n      count[ch[i][j] - 64]++;\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      per = i;\n    }\n  }\n  person = per + 64;\n  cout << person << endl;\n  cout << count[per] << endl;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (ch[i][j] == person) {\n        cout << num[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "2999", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int n;\n  char name[26];\n  struct book *next;\n};\nstruct book *head;\nint m;\nstruct book *creat() {\n  struct book *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->n, p1->name);\n  head = NULL;\n  while (i < m - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->n >> p1->name;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int i, j, *p, max = 0, n;\n  struct book *p1;\n  p = (int *)calloc(26, sizeof(int));\n  scanf(\"%d\", &m);\n  creat();\n  p1 = head;\n  for (i = 65; i <= 90; i++) {\n    p1 = head;\n    do {\n      for (j = 0; (p1->name)[j] != '\u0000'; j++) {\n        if ((p1->name)[j] == i)\n          *(p + i - 65) = *(p + i - 65) + 1;\n      }\n      p1 = p1->next;\n    } while (p1 != NULL);\n  }\n  for (i = 0; i < 26; i++, p++) {\n    if (*p > max) {\n      max = *p;\n      n = i;\n    }\n  }\n  printf(\"%c \", n + 65);\n  printf(\"%d \", max);\n  p1 = head;\n  do {\n    for (j = 0; (p1->name)[j] != '\u0000'; j++) {\n      if ((p1->name)[j] == n + 65)\n        printf(\"%d \", p1->n);\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  return 0;\n}\n"}
{"label": "2", "index": "3000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp;\n  int author[27][500] = {\n      0,\n  };\n  char str[1000];\n  scanf(\"%d \", &num);\n  for (int i = 1; i <= num; i++) {\n    cin >> temp;\n    getchar();\n    cin >> str;\n    for (int j = 0; j < strlen(str); j++) {\n      author[str[j] - 'A' + 1][0]++;\n      author[str[j] - 'A' + 1][author[str[j] - 'A' + 1][0]] = temp;\n    }\n  }\n  int temp_num = 0, temp_author;\n  for (int i = 1; i <= 26; i++) {\n    if (author[i][0] > temp_num) {\n      temp_num = author[i][0];\n      temp_author = i;\n    }\n  }\n  cout << (char)(temp_author + 'A' - 1) << endl;\n  cout << temp_num << endl;\n  for (int i = 1; i <= temp_num; i++) {\n    cout << author[temp_author][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26][1000];\nint ai[26];\nvoid func() {\n  int k, i, len;\n  char str[27];\n  scanf(\"%d %s\", &k, str);\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    a[str[i] - 'A'][ai[str[i] - 'A']] = k;\n    ai[str[i] - 'A']++;\n  }\n}\nint main() {\n  memset(a, 0, sizeof(a));\n  memset(ai, 0, sizeof(ai));\n  int n, i, i0, max = 0;\n  scanf(\"%d\", &n);\n  while (n--)\n    func();\n  for (i = 0; i < 26; i++) {\n    if (ai[i] > max) {\n      max = ai[i];\n      i0 = i;\n    }\n  }\n  printf(\"%c\\n\", i0 + 'A');\n  printf(\"%d\\n\", max);\n  for (i = 0; i < ai[i0]; i++)\n    printf(\"%d\\n\", a[i0][i]);\n}\n"}
{"label": "2", "index": "3002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n};\nint main() {\n  int n, m, i, j;\n  int author_num[26] = {0};\n  scanf(\"%d\", &n);\n  struct book shu[999];\n  for (i = 0; i < n; i++) {\n    cin >> shu[i].num >> shu[i].author;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      m = shu[i].author[j] - 'A';\n      author_num[m]++;\n    }\n  }\n  int max = author_num[0], author = 'A';\n  for (i = 1; i < 26; i++) {\n    if (author_num[i] > max) {\n      max = author_num[i];\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == author) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Book {\n  int number;\n  char author[30];\n};\n\nint main() {\n  int max = 0, len;\n  int sum[30] = {0};\n  int m, i, j;\n  struct Book book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].number, book[i].author);\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++)\n      sum[book[i].author[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > sum[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, sum[max]);\n  for (i = 0; i < m; i++) {\n    len = strlen(book[i].author);\n    for (j = 0; j < len; j++) {\n      if (book[i].author[j] == max + 65) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3004", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char name[20];\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nint main() {\n  int i;\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      a[(int)p->name[i] - 'A']++;\n    }\n    p = p->next;\n  }\n  int number, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c \", 'A' + number);\n  printf(\"%d \", max);\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      if (p->name[i] == 'A' + number)\n        break;\n    }\n    if (p->name[i] == 'A' + number)\n      printf(\"%d \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    char z[27];\n    int no;\n  };\n\n  struct book a[1000];\n\n  int m, i, x, p, j;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &a[i].no, a[i].z);\n\n  int memo[26] = {0};\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      x = (a[i].z[j]) - 65;\n      memo[x]++;\n    }\n  }\n  x = 0;\n  p = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (memo[i] > x) {\n      x = memo[i];\n      p = i;\n    }\n  }\n\n  printf(\"%c\\n\", p + 65);\n\n  int n = 0;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65)\n        n++;\n    }\n  }\n\n  cout << n << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65) {\n        printf(\"%d\\n\", a[i].no);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int N;\n  int a[26] = {0};\n\n  struct book {\n    int x;\n    char y[27];\n  } A[1000];\n\n  scanf(\"%d\", &N);\n  int i, j;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%s\", &A[i].x, A[i].y);\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == 'A') {\n        a[0]++;\n      }\n\n      else if (A[i].y[j] == 'B') {\n        a[1]++;\n      } else if (A[i].y[j] == 'C') {\n        a[2]++;\n      } else if (A[i].y[j] == 'D') {\n        a[3]++;\n      } else if (A[i].y[j] == 'E') {\n        a[4]++;\n      } else if (A[i].y[j] == 'F') {\n        a[5]++;\n      } else if (A[i].y[j] == 'G') {\n        a[6]++;\n      } else if (A[i].y[j] == 'H') {\n        a[7]++;\n      } else if (A[i].y[j] == 'I') {\n        a[8]++;\n      } else if (A[i].y[j] == 'J') {\n        a[9]++;\n      } else if (A[i].y[j] == 'K') {\n        a[10]++;\n      } else if (A[i].y[j] == 'L') {\n        a[11]++;\n      } else if (A[i].y[j] == 'M') {\n        a[12]++;\n      } else if (A[i].y[j] == 'N') {\n        a[13]++;\n      } else if (A[i].y[j] == 'O') {\n        a[14]++;\n      } else if (A[i].y[j] == 'P') {\n        a[15]++;\n      } else if (A[i].y[j] == 'Q') {\n        a[16]++;\n      } else if (A[i].y[j] == 'R') {\n        a[17]++;\n      } else if (A[i].y[j] == 'S') {\n        a[18]++;\n      } else if (A[i].y[j] == 'T') {\n        a[19]++;\n      } else if (A[i].y[j] == 'U') {\n        a[20]++;\n      } else if (A[i].y[j] == 'V') {\n        a[21]++;\n      } else if (A[i].y[j] == 'W') {\n        a[22]++;\n      } else if (A[i].y[j] == 'X') {\n        a[23]++;\n      } else if (A[i].y[j] == 'Y') {\n        a[24]++;\n      } else if (A[i].y[j] == 'Z') {\n        a[25]++;\n      }\n    }\n  }\n\n  int p;\n  int max;\n  p = 0;\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  char d;\n  d = ('A' + p);\n  printf(\"%c\\n%d\\n\", d, max);\n  for (i = 0; i < N; i++) {\n    for (j = 0; A[i].y[j] != '\\0'; j++) {\n      if (A[i].y[j] == (p + 'A'))\n        printf(\"%d\\n\", A[i].x);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char name[30] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"}, c[1000][100];\n  int n, a[1000], num[100] = {0}, i, j, k, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    scanf(\"%s\", c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; c[i][k] != '\\0'; k++) {\n      for (j = 0; name[j] != '\\0'; j++) {\n        if (name[j] == c[i][k]) {\n          num[j]++;\n        }\n      }\n    }\n  }\n  for (i = 0; name[i] != '\\0'; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  cout << name[k] << \"\\n\" << num[k] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == name[k]) {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3008", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[26];\n  struct tushu *next;\n};\nstruct tushu *creat(int n) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 1; i < n; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n, num[26] = {0}, *p, i, j, max = 0;\n  char *a;\n  scanf(\"%d\", &n);\n  struct tushu *head, *p1;\n  head = creat(n);\n  p = num;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    a = p1->name;\n    while (p1 != NULL) {\n      for (j = 0; *(a + j) != '\u0000'; j++) {\n        if (*(a + j) == i + 65) {\n          *(p + i) = *(p + i) + 1;\n          break;\n        }\n      }\n      p1 = p1->next;\n      a = p1->name;\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (*(p + max) < *(p + i))\n      max = i;\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", *(p + max));\n  p1 = head;\n  a = p1->name;\n  while (p1 != NULL) {\n    for (i = 0; *(a + i) != '\u0000'; i++) {\n      if (*(a + i) == (max + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n    a = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int n;\n  char name[26];\n  struct book *next;\n};\nstruct book *head;\nint m;\nstruct book *creat() {\n  struct book *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->n, p1->name);\n  head = NULL;\n  while (i < m - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->n, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int i, j, *p, max = 0, n;\n  struct book *p1;\n  p = (int *)calloc(26, sizeof(int));\n  scanf(\"%d\", &m);\n  creat();\n  p1 = head;\n  for (i = 65; i <= 90; i++) {\n    p1 = head;\n    do {\n      for (j = 0; (p1->name)[j] != '\u0000'; j++)\n        if ((p1->name)[j] == i)\n          *(p + i - 65) = *(p + i - 65) + 1;\n      p1 = p1->next;\n    } while (p1 != NULL);\n  }\n  for (i = 0; i < 26; i++, p++) {\n    if (*p > max) {\n      max = *p;\n      n = i;\n    }\n  }\n  cout << n + 65 << \" \";\n  cout << max << \" \";\n  p1 = head;\n  do {\n    for (j = 0; (p1->name)[j] != '\u0000'; j++) {\n      if ((p1->name)[j] == n + 65)\n        printf(\"%d \", p1->n);\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "3010", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[20];\n  struct book *next;\n};\nint main() {\n  int n, i, j, m, k, c[26], max;\n  char a[26];\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n    } else\n      p2->next = p1;\n\n    p2 = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < 26; i++) {\n      n = strlen(p1->writer);\n      for (k = 0; k < n; k++) {\n        if (a[i] == p1->writer[k]) {\n          c[i]++;\n        }\n      }\n    }\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c %d \", a[max], c[max]);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->writer);\n    for (j = 0; j < n; j++) {\n      if (p1->writer[j] == a[max]) {\n        printf(\"%d \", p1->num);\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct author {\n  char name;\n  int count;\n} aut[26];\n\nint max(struct author a[26]) {\n  int i, max;\n  max = a[0].count;\n  for (i = 0; i < 26; i++)\n    if (a[i].count > max)\n      max = a[i].count;\n  return (max);\n}\nint main() {\n  int m, h = 0;\n  scanf(\"%d\", &m);\n  int i, j, n, l[1000], book_name[1000];\n  char author_name[1000][27];\n  for (i = 0; i < 26; i++) {\n    aut[i].name = 'A' + i;\n    aut[i].count = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book_name[i], author_name[i]);\n    l[i] = strlen(author_name[i]);\n    for (j = 0; j < 26; j++)\n      for (n = 0; n < l[i]; n++)\n        if (author_name[i][n] == aut[j].name)\n          aut[j].count++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (aut[i].count == max(aut)) {\n      cout << aut[i].name << \"\\n\";\n      h = i;\n    }\n  }\n  printf(\"%d\\n\", max(aut));\n  for (i = 0; i < m; i++) {\n    l[i] = strlen(author_name[i]);\n    for (n = 0; n < l[i]; n++) {\n      if (author_name[i][n] == aut[h].name)\n        printf(\"%d\\n\", book_name[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int book[1000];\n  char author[1000][10];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> author[i];\n  }\n  int num[26] = {0};\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      num[author[i][j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char maxi;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      maxi = 'A' + i;\n    }\n  }\n  cout << maxi << endl;\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        sum++;\n      }\n    }\n  }\n  cout << sum << endl;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(author[i]);\n    for (j = 0; j < length; j++) {\n      if (author[i][j] == maxi) {\n        cout << book[i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct BOOK {\n  int id;\n  int author[26];\n};\nint main() {\n  struct BOOK book[1000];\n  int countauthor[26];\n  int n, i, j, minusA, no, count, max = 0, maxau;\n  char input[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      book[i].author[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &book[i].id);\n    scanf(\"%s\", &input);\n    no = strlen(input);\n    for (j = 0; j < no; j++) {\n      minusA = (input[j] - 'A');\n      book[i].author[minusA]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      if (book[j].author[i] == 1)\n        count++;\n    }\n    countauthor[i] = count;\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < countauthor[i])\n      max = countauthor[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (countauthor[i] == max)\n      maxau = i;\n  }\n  printf(\"%d\\n%d\\n\", (maxau + 'A'), max);\n  for (i = 0; i < n; i++) {\n    if (book[i].author[maxau] == 1) {\n      printf(\"%d\\n\", book[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, i, p, j, t, q;\nint SAVER[1500];\nchar R[1500][50];\nint RR[50];\n\nint main() {\n  cin >> n;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> SAVER[i];\n    cin.get();\n    cin >> R[i];\n    j = 0;\n    while (R[i][j] != '\\0') {\n      RR[R[i][j] - 'A']++;\n      j++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (RR[i - 'A'] > t) {\n      t = RR[i - 'A'];\n      q = i;\n    }\n  cout << (char)q << endl << t << endl;\n  for (i = 1; i <= n; i++) {\n    j = 0;\n    while (R[i][j] != '\\0') {\n      if (R[i][j] == q)\n        cout << SAVER[i] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;\n  char name[1002][27], a, max;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i];\n    cin >> name[i];\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      a = name[i][j];\n      cnt[a - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > n) {\n      n = cnt[i];\n      max = i + 'A';\n    }\n  }\n  cout << max << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      if (name[i][j] == max) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n} book[1000];\nint judge(char *a, int b);\nint main(int argc, char *argv[]) {\n  char c;\n  int n = 0, i = 0, j = 0, rec[26] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].name);\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      if (judge(book[j].name, i) == 1)\n        rec[i]++;\n    }\n  }\n  j = 0;\n  k = rec[0];\n  for (i = 0; i < 25; i++) {\n    if (k < rec[i]) {\n      j = i;\n      k = rec[i];\n    }\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, k);\n  for (i = 0; i < n; i++) {\n    if (judge(book[i].name, j) == 1) {\n      printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\nint judge(char *a, int b) {\n  int i = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == 'A' + b)\n      return 1;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct b {\n  int na;\n  char au[20];\n} book[1000];\nint main() {\n  int m, i, len[1000], num[128] = {0}, j, max, p = 0;\n  char maxi;\n  int boo[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].na, book[i].au);\n    len[i] = strlen(book[i].au);\n    for (j = 0; j < len[i]; j++)\n      num[book[i].au[j]]++;\n  }\n  maxi = 'A';\n  max = -1;\n  for (j = 'A'; j <= 'Z'; j++) {\n    if (num[j] > max) {\n      max = num[j];\n      maxi = j;\n    }\n  }\n  printf(\"%c\\n\", maxi);\n  cout << max << \"\\n\";\n  for (i = 0; i < m && p < max; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].au[j] == maxi) {\n        printf(\"%d\\n\", book[i].na);\n        p++;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int bianhao;\n    char zuozhe[100];\n  } a[1000];\n  int i, j, n, l, max;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].bianhao, a[i].zuozhe);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      b[a[i].zuozhe[j] - 65]++;\n  max = b[0];\n  l = 0;\n  for (i = 1; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      l = i;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      if (a[i].zuozhe[j] == (l + 65)) {\n        printf(\"%d\\n\", a[i].bianhao);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3019", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char name[27];\n  int anum;\n  int num;\n  struct student *next;\n};\nint n;\nint i;\nchar c;\n\nstruct student *creat() {\n  struct student *head;\n  head = (struct student *)malloc(1000);\n  if (n == 0)\n    head = NULL;\n  else {\n    scanf(\"%d\", &head->num);\n    for (i = 0; (c = getchar()) != ' '; i++) {\n      head->name[i] = c;\n    }\n    head->anum = i;\n    head->next = NULL;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2, *p;\n  char l[200] = {0};\n  int j;\n  int max = 0;\n  int lmax;\n\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    {\n      p1 = (struct student *)malloc(1000);\n      p2->next = p1;\n      p2 = p1;\n\n      scanf(\"%d\", &p2->num);\n      for (j = 0; (c = getchar()) != ' '; j++) {\n        p2->name[j] = c;\n      }\n      p2->anum = j;\n\n      p2->next = NULL;\n    }\n  }\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      l[p->name[i]] = l[p->name[i]] + 1;\n    }\n    p = p->next;\n  }\n\n  for (i = 65; i <= 90; i++) {\n    if (l[i] > max) {\n      max = l[i];\n      lmax = i;\n    }\n  }\n  printf(\"%c %d \", lmax, max);\n\n  p = head;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < p->anum; i++) {\n      if (p->name[i] == lmax)\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char auth[26];\n    int inf[26];\n    struct book *next;\n  };\n  struct book *head, *p1, *p2, *t1, *t2;\n  head = (struct book *)malloc(sizeof(struct book));\n  int m, i, k, l, j, max;\n  int authnum[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = head;\n  p2 = p1;\n  for (i = 0; i < (m - 1); i++) {\n    cin >> (p1->num) >> p1->auth;\n    p2 = (struct book *)malloc(sizeof(struct book));\n    p1->next = p2;\n    p1 = p2;\n  }\n  scanf(\"%d %s\", &(p1->num), p1->auth);\n  p2 = NULL;\n  p1->next = p2;\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    l = strlen(p1->auth);\n    for (j = 0; j < l; j++) {\n      p1->inf[(*((p1->auth) + j)) - 65] = 1;\n      authnum[(*((p1->auth) + j)) - 65]++;\n    }\n    p2 = p1->next;\n    p1 = p2;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (authnum[i] > authnum[max])\n      max = i;\n  }\n  printf(\"%c\\n\", (max + 65));\n  cout << authnum[max] << \"\\n\";\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    if ((p1->inf[max]) > 0)\n      printf(\"%d\\n\", p1->num);\n    p2 = p1->next;\n    p1 = p2;\n  }\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    p2 = p1->next;\n    free(p1);\n    p1 = p2;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3021", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct {\n  int num;\n  char au[27];\n} book[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, t, max = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].au);\n    int au_n = strlen(book[i].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[i].au[j] <= 90 && book[i].au[j] >= 65) {\n        int k = book[i].au[j] - 65;\n        a[k]++;\n        if (a[k] > max)\n          max = a[k];\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      char r = i + 65;\n      printf(\"%c\\n%d\\n\", r, max);\n      break;\n    }\n  }\n  for (t = 0; t < m; t++) {\n    int au_n = strlen(book[t].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[t].au[j] == i + 65)\n        printf(\"%d\\n\", book[t].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3022", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct fy {\n    int x;\n    char y[26];\n    int s[26];\n    struct fy *z;\n  } sl[1000], *p;\n  int n, i, j, b[26] = {0};\n\n  p = &sl[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> sl[i].x >> sl[i].y;\n    for (j = 0; j < strlen(sl[i].y); j++) {\n      sl[i].s[sl[i].y[j] - 'A'] = 1;\n      b[sl[i].y[j] - 'A']++;\n    }\n    sl[i].z = &sl[i + 1];\n  }\n  sl[n - 1].z = NULL;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < 26; j++)\n      if (b[i] < b[j])\n        break;\n    if (j == 26) {\n      j = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", i + 'A', b[j]);\n  while (p != NULL) {\n    if (p->s[i] == 1)\n      printf(\"%d\\n\", p->x);\n    p = p->z;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct author {\n  int sumbook;\n  int id[999];\n} a[26];\n\nint main() {\n  int n, i, j, bookid = 0, pos = 0, maxbook = 0, maxid = 0;\n  char booka[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d%s\", &bookid, booka);\n    for (j = 0; j < strlen(booka); ++j) {\n      pos = booka[j] - 'A';\n      a[pos].id[a[pos].sumbook] = bookid;\n      a[pos].sumbook++;\n      if (maxbook < a[pos].sumbook) {\n        maxid = pos;\n        maxbook = a[pos].sumbook;\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxid + 'A', maxbook);\n  for (i = 0; i < a[maxid].sumbook; i++)\n    printf(\"%d\\n\", a[maxid].id[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int bianhao;\n    char zuozhe[26];\n  };\n  int i, j, n, q = 0;\n  int count[26] = {0};\n  scanf(\"%d\", &n);\n  struct tushu *pp;\n  pp = (struct tushu *)malloc(sizeof(tushu) * n);\n  int *m;\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &((pp + i)->bianhao), (pp + i)->zuozhe);\n  }\n  for (i = 0; i < n; i++) {\n    m[i] = strlen(pp[i].zuozhe);\n    for (j = 0; j < m[i]; j++) {\n      count[pp[i].zuozhe[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      q = i;\n    }\n  }\n  cout << 'A' + q << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (pp[i].zuozhe[j] == ('A' + q))\n        printf(\"%d\\n\", pp[i].bianhao);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  } b[1000];\n  int m, i, j, n[26] = {0}, max = 0, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      ++n[b[i].name[j] - 65];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      t = i + 65;\n    }\n  }\n  printf(\"%c \", t);\n  printf(\"%d \", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (b[i].name[j] == t)\n        printf(\"%d \", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct bookst {\n    int Num;\n    char name[26];\n  };\n  struct bookst *book;\n  int cnt[26], num, i, j, max = 0, max_idx = 0;\n  for (i = 0; i < 26; i++)\n    cnt[i] = 0;\n  scanf(\"%d\", &num);\n  book = (struct bookst *)malloc(num * sizeof(struct bookst));\n  for (i = 0; i < num; i++) {\n    scanf(\"%d%s\", &book[i].Num, book[i].name);\n    for (j = 0; book[i].name[j] != 0; j++) {\n      cnt[book[i].name[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      max_idx = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max_idx, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; book[i].name[j] != 0; j++) {\n      if (book[i].name[j] == 'A' + max_idx)\n        printf(\"%d\\n\", book[i].Num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct writer {\n    int num;\n    char name[20];\n    struct writer *next;\n  };\n  int i, j, k, l, m, z[26] = {0}, max, n;\n  struct writer *p1, *p2, *p, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct writer *)malloc(sizeof(struct writer));\n  scanf(\"%d %s\", &p1->num, &p1->name);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct writer *)malloc(sizeof(struct writer));\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p = head;\n  for (i = 0; i < 26; i++) {\n    p = head;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 20; k++) {\n        if (p->name[k] == (char)(i + 65)) {\n          z[i]++;\n        }\n      }\n      p = p->next;\n    }\n  }\n  max = z[0];\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < z[i]) {\n      max = z[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + j, max);\n  p = head;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 20; k++) {\n      if (p->name[k] == (char)(65 + j)) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3028", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n = 0, book[1000], num[26] = {0};\n  char name[1000][10];\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> book[i] >> name[i];\n  }\n  for (char z = 'A'; z <= 'Z'; z++) {\n    for (int i = 1; i <= m; i++) {\n      for (int j = 0; j < 10; j++)\n        if (name[i][j] == z)\n          num[z - 'A']++;\n    }\n  }\n  int max = 0, k = 0;\n  for (int i = 0; i < 26; i++) {\n    if (max < num[i]) {\n      max = num[i];\n      k = i;\n    }\n  }\n  cout << (char)('A' + k) << endl << max << endl;\n  for (int i = 1; i <= m; i++) {\n    for (int j = 0; j < 10; j++)\n      if (name[i][j] == 'A' + k)\n        cout << book[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int num;\n    char zuozhe[27];\n  } ts[999];\n  int i, j, n, k, temp;\n  int count[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &ts[i].num, ts[i].zuozhe);\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++)\n      count[ts[i].zuozhe[j] - 65]++;\n  }\n  temp = count[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > temp) {\n      k = i;\n      temp = count[i];\n    }\n  }\n  cout << k + 65 << \"\\n\";\n  printf(\"%d\\n\", count[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      if (ts[i].zuozhe[j] == k + 65) {\n        printf(\"%d\\n\", ts[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3030", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, t, len, a[26][1000] = {0}, n[26] = {0}, max = 0, num;\n  int i, j;\n  char s[27];\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &t, s);\n    len = strlen(s);\n    for (j = 0; j < len; j++) {\n      n[s[j] - 65]++;\n      a[s[j] - 65][i] = t;\n    }\n  }\n\n  for (j = 0; j < 26; j++) {\n    if (n[j] > max) {\n      max = n[j];\n      num = j;\n    }\n  }\n\n  printf(\"%c %d \", num + 65, n[num]);\n\n  for (i = 0; i < m; i++) {\n    if (a[num][i] != 0)\n      printf(\"%d \", a[num][i]);\n  }\n}\n"}
{"label": "2", "index": "3031", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n};\nint main() {\n  int n, m, i, j;\n  int author_num[26] = {0};\n  scanf(\"%d\", &n);\n  struct book shu[999];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      m = shu[i].author[j] - 'A';\n      author_num[m]++;\n    }\n  }\n  int max = author_num[0], author = 'A';\n  for (i = 1; i < 26; i++) {\n    if (author_num[i] > max) {\n      max = author_num[i];\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == author) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct author {\n  char name;\n  int count;\n} aut[26];\n\nint max(struct author a[26]) {\n  int i, max;\n  max = a[0].count;\n  for (i = 0; i < 26; i++)\n    if (a[i].count > max)\n      max = a[i].count;\n  return (max);\n}\nint main() {\n  int m, h = 0;\n  scanf(\"%d\", &m);\n  int i, j, n, l[1000], book_name[1000];\n  char author_name[1000][27];\n  for (i = 0; i < 26; i++) {\n    aut[i].name = 'A' + i;\n    aut[i].count = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book_name[i], author_name[i]);\n    l[i] = strlen(author_name[i]);\n    for (j = 0; j < 26; j++)\n      for (n = 0; n < l[i]; n++)\n        if (author_name[i][n] == aut[j].name)\n          aut[j].count++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (aut[i].count == max(aut)) {\n      cout << aut[i].name << \"\\n\";\n      h = i;\n    }\n  }\n  printf(\"%d\\n\", max(aut));\n  for (i = 0; i < m; i++) {\n    l[i] = strlen(author_name[i]);\n    for (n = 0; n < l[i]; n++)\n      if (author_name[i][n] == aut[h].name)\n        printf(\"%d\\n\", book_name[i]);\n  }\n}\n"}
{"label": "2", "index": "3033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, max = 0;\n  int Q[26] = {0};\n  struct {\n    int num;\n    char name[27];\n  } book[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      switch (book[i].name[j]) {\n      case 'A':\n        Q[0]++;\n        break;\n      case 'B':\n        Q[1]++;\n        break;\n      case 'C':\n        Q[2]++;\n        break;\n      case 'D':\n        Q[3]++;\n        break;\n      case 'E':\n        Q[4]++;\n        break;\n      case 'F':\n        Q[5]++;\n        break;\n      case 'G':\n        Q[6]++;\n        break;\n      case 'H':\n        Q[7]++;\n        break;\n      case 'I':\n        Q[8]++;\n        break;\n      case 'J':\n        Q[9]++;\n        break;\n      case 'K':\n        Q[10]++;\n        break;\n      case 'L':\n        Q[11]++;\n        break;\n      case 'M':\n        Q[12]++;\n        break;\n      case 'N':\n        Q[13]++;\n        break;\n      case 'O':\n        Q[14]++;\n        break;\n      case 'P':\n        Q[15]++;\n        break;\n      case 'Q':\n        Q[16]++;\n        break;\n      case 'R':\n        Q[17]++;\n        break;\n      case 'S':\n        Q[18]++;\n        break;\n      case 'T':\n        Q[19]++;\n        break;\n      case 'U':\n        Q[20]++;\n        break;\n      case 'V':\n        Q[21]++;\n        break;\n      case 'W':\n        Q[22]++;\n        break;\n      case 'X':\n        Q[23]++;\n        break;\n      case 'Y':\n        Q[24]++;\n        break;\n      case 'Z':\n        Q[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (Q[i] > Q[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, Q[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      if (book[i].name[j] == max + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct zuozhe {\n  int m;\n  char q;\n  char shu[1001][5];\n} zuozhe[26], t;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  char xingming[30];\n  char bianhao[5];\n  char zimu[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  for (i = 0; i < 26; i++)\n    zuozhe[i].m = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> bianhao >> xingming;\n    int j, k;\n    for (j = 0; xingming[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (xingming[j] == zimu[k]) {\n          zuozhe[k].m++;\n          zuozhe[k].q = zimu[k];\n          strcpy(zuozhe[k].shu[zuozhe[k].m], bianhao);\n          break;\n        }\n      }\n    }\n  }\n  int min = 0;\n  int maxnum = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (zuozhe[i].m > maxnum) {\n      maxnum = zuozhe[i].m;\n      min = i;\n    }\n  }\n  cout << zuozhe[min].q << endl << zuozhe[min].m << endl;\n  for (i = 1; i <= zuozhe[min].m; i++) {\n    cout << zuozhe[min].shu[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3035", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, book[1000], cnt[60], max;\n  char author[1000][26], p;\n  int b[60][1000];\n  cin >> n;\n  for (int i = 0; i < 60; i++)\n    cnt[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i];\n    cin.get();\n    cin.getline(author[i], 26);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; author[i][j] != '\\0'; j++) {\n      int k = author[i][j] - '0';\n      b[k][cnt[k]++] = book[i];\n    }\n  }\n  max = cnt[17];\n  p = 'A';\n  for (int i = 17; i <= 42; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      p = i + '0';\n    }\n  }\n  cout << p << endl;\n  cout << max << endl;\n  for (int m = 0; m < max; m++)\n    printf(\"%d\\n\", b[p - '0'][m]);\n  return 0;\n}\n"}
{"label": "2", "index": "3036", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char a[1000];\n  char b[26];\n} book[1000];\nint main() {\n  int m, i, j, s, k, p, l;\n  int t[26] = {0};\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].a >> book[i].b;\n\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      x = book[i].b[j];\n      k = x;\n      t[k - 65] = t[k - 65] + 1;\n    }\n  }\n  p = t[0];\n  l = 0;\n  for (i = 1; i < 26; i++) {\n    if (t[i] > p) {\n      p = t[i];\n      l = i;\n    }\n  }\n  x = l + 65;\n  printf(\"%c\\n\", x);\n  printf(\"%d\\n\", p);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      if (book[i].b[j] == x) {\n        printf(\"%s\\n\", book[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct x {\n  int num;\n  char author[26];\n  int amount;\n};\nint main() {\n  struct x y[999];\n  int i, j, m, max = 0, max_ = 0;\n  int k;\n  int amount[91] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &y[i].num, y[i].author);\n    y[i].amount = strlen(y[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      for (k = 'A'; k < 'Z'; k++) {\n        if (k = y[i].author[j]) {\n          amount[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i < 'Z'; i++) {\n    if (max < amount[i]) {\n      max = amount[i];\n      max_ = i; \n    }\n  }\n  printf(\"%c\\n\", max_);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      if (y[i].author[j] == max_) {\n        printf(\"%d\\n\", y[i].num);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char a[1000];\n  char b[26];\n} book[1000];\nint main() {\n  int m, i, j, s, k, p, l;\n  int t[26] = {0};\n  char x;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%s %s\", &book[i].a, book[i].b);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      x = book[i].b[j];\n      k = x;\n      t[k - 65] = t[k - 65] + 1;\n    }\n  }\n  p = t[0];\n  l = 0;\n  for (i = 1; i < 26; i++) {\n    if (t[i] > p) {\n      p = t[i];\n      l = i;\n    }\n  }\n  x = l + 65;\n  printf(\"%c\\n\", x);\n  printf(\"%d\\n\", p);\n  for (i = 0; i < m; i++) {\n    s = strlen(book[i].b);\n    for (j = 0; j < s; j++) {\n      if (book[i].b[j] == x)\n        printf(\"%s\\n\", book[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3039", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char str[27];\n} bo[1000];\nstruct people {\n  int name;\n  int number;\n  int book_number[1000];\n} people[26];\nint main() {\n  int n, i, j, k, m, max = 0;\n  char a[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\\0'};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> bo[i].id >> bo[i].str;\n\n  for (i = 0; i < 26; i++) {\n    people[i].number = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bo[i].str);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (bo[i].str[j] == a[k]) {\n          people[k].book_number[people[k].number] = bo[i].id;\n          people[k].number++;\n        }\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (people[i].number > max) {\n      j = i;\n      max = people[i].number;\n    }\n  }\n  cout << a[j] << endl;\n  cout << people[j].number << endl;\n  for (i = 0; i < people[j].number; i++) {\n    cout << people[j].book_number[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    char z[27];\n    int no;\n  };\n\n  struct book a[1000];\n\n  int m, i, x, p, j;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &a[i].no, a[i].z);\n  }\n\n  int memo[26] = {0};\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      x = (a[i].z[j]) - 65;\n      memo[x]++;\n    }\n  }\n  x = 0;\n  p = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (memo[i] > x) {\n      x = memo[i];\n      p = i;\n    }\n  }\n\n  printf(\"%c\\n\", p + 65);\n\n  int n = 0;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65)\n        n++;\n    }\n  }\n\n  cout << n << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65) {\n        printf(\"%d\\n\", a[i].no);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[100];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int k = 1;\n  struct book *head, *p1, *p2, *p;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  p2 = p1;\n  p = p1;\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  do {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    k++;\n  } while (k < n);\n  return head;\n}\n\nint main(void) {\n  struct book *head, *p;\n  char *q;\n  int *s;\n  int n, i, j, max = 0;\n  s = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(s + i) = 0;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  while (p) {\n    q = p->name;\n    while (*q != '\\0') {\n      *(s + *(q) - 'A') += 1;\n      q++;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(s + i) > max)\n      max = *(s + i);\n  for (i = 0; i < 26; i++)\n    if (*(s + i) == max)\n      break;\n  printf(\"%c\\n%d\\n\", 'A' + i, max);\n  p = head;\n  while (p) {\n    q = p->name;\n    if (strchr(q, 'A' + i) != NULL)\n      cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n};\nint m;\n\nint main() {\n\n  int i;\n  scanf(\"%d\", &m);\n  book *p;\n  p = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &p[i].num, p[i].writer);\n  }\n  int j = 0, u = 0;\n  int *a;\n  a = (int *)malloc(sizeof(int) * 150);\n  for (i = 'A'; i <= 'z'; i++)\n    a[i] = 0;\n\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      for (u = 0; u < strlen(p[j].writer); u++) {\n        if (i == p[j].writer[u]) {\n          a[i]++;\n          break;\n        }\n      }\n    }\n  }\n  int max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max < a[i])\n      max = a[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (max == a[i])\n      break;\n  }\n  printf(\"%d\\n%d\\n\", i, a[i]);\n  for (j = 0; j < m; j++) {\n    for (u = 0; u < strlen(p[j].writer); u++) {\n      if (i == p[j].writer[u]) {\n        cout << p[j].num << \"\\n\";\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i], k[i]);\n    int m;\n    m = strlen(k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, i, j;\n  char a = 'A';\n  int count[27] = {0};\n  int *p = &count[1];\n  scanf(\"%d\", &num);\n  struct book {\n    char order[4];\n    char author[26];\n  } book[1000];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].order);\n    scanf(\"%s\", book[i].author);\n  }\n  for (i = 0; i < num; i++) {\n    int m = strlen(book[i].author);\n    for (j = 0; j < m; j++) {\n      if (book[i].author[j] == 'A')\n        count[1]++;\n      if (book[i].author[j] == 'B')\n        count[2]++;\n      if (book[i].author[j] == 'C')\n        count[3]++;\n      if (book[i].author[j] == 'D')\n        count[4]++;\n      if (book[i].author[j] == 'E')\n        count[5]++;\n      if (book[i].author[j] == 'F')\n        count[6]++;\n      if (book[i].author[j] == 'G')\n        count[7]++;\n      if (book[i].author[j] == 'H')\n        count[8]++;\n      if (book[i].author[j] == 'I')\n        count[9]++;\n      if (book[i].author[j] == 'J')\n        count[10]++;\n      if (book[i].author[j] == 'K')\n        count[11]++;\n      if (book[i].author[j] == 'L')\n        count[12]++;\n      if (book[i].author[j] == 'M')\n        count[13]++;\n      if (book[i].author[j] == 'N')\n        count[14]++;\n      if (book[i].author[j] == 'O')\n        count[15]++;\n      if (book[i].author[j] == 'P')\n        count[16]++;\n      if (book[i].author[j] == 'Q')\n        count[17]++;\n      if (book[i].author[j] == 'R')\n        count[18]++;\n      if (book[i].author[j] == 'S')\n        count[19]++;\n      if (book[i].author[j] == 'T')\n        count[20]++;\n      if (book[i].author[j] == 'U')\n        count[21]++;\n      if (book[i].author[j] == 'V')\n        count[22]++;\n      if (book[i].author[j] == 'W')\n        count[23]++;\n      if (book[i].author[j] == 'X')\n        count[24]++;\n      if (book[i].author[j] == 'Y')\n        count[25]++;\n      if (book[i].author[j] == 'Z')\n        count[26]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (count[i] > *p) {\n      p = &count[i];\n      a = i + 64;\n    }\n  }\n  printf(\"%c\\n%d\\n\", a, *p);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == a)\n        printf(\"%s\\n\", book[i].order);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char number[20];\n  char name[26];\n} books[1000];\n\nint main() {\n  int n, i, j;\n  int count[26] = {0};\n  int temp, base, k = 0;\n  char author;\n  int pd = 0, N = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> books[i].number >> books[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n      temp = books[i].name[j] - 'A';\n      count[temp]++;\n    }\n  }\n  base = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] > base) {\n      base = count[i];\n      k = i;\n    }\n  }\n  author = 'A' + k;\n  cout << author << \" \";\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      N++;\n  }\n  printf(\"%d \", N);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      printf(\"%s \", books[i].number);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3046", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m;\nstruct book {\n  char num[20];\n  char aut[20];\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->aut);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->aut);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nvoid print(struct book *head) {\n  struct book *p;\n  int *tem, i, k;\n  char *q, max, c;\n  tem = (int *)malloc(30 * sizeof(int));\n  for (i = 0; i < 30; i++) {\n    *(tem + i) = 0;\n  }\n  for (p = head; p; p = p->next) {\n    q = p->aut;\n    for (i = 0; *(q + i) != '\u0000'; i++) {\n      c = *(q + i) - 'A';\n      *(tem + c) += 1;\n    }\n  }\n  max = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (*(tem + i) > max) {\n      max = *(tem + i);\n      k = i;\n    }\n  }\n  c = k + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", max);\n  for (p = head; p; p = p->next) {\n    for (q = p->aut, i = 0; *(q + i) != '\u0000'; i++) {\n      if (*(q + i) == c) {\n        break;\n      }\n    }\n    if (*(q + i) != '\u0000') {\n      printf(\"%s \", p->num);\n    }\n  }\n}\nint main() {\n  struct book *head;\n  scanf(\"%d\", &m);\n  head = creat();\n  print(head);\n}\n"}
{"label": "2", "index": "3047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, c[26] = {0}, d[26] = {0}, j, s, t, k;\n  char b[26000], r, max;\n  scanf(\"%d \", &n);\n  struct book {\n    int num;\n    char author[26];\n  } a[999];\n  for (i = 0; i < n; i++)\n    cin >> a[i].num >> a[i].author;\n  strcpy(b, a[0].author);\n  for (i = 1; i < n; i++)\n    strcat(b, a[i].author);\n  s = strlen(b);\n  for (r = 'A', j = 0; r <= 'Z', j < 26; r++, j++)\n    for (i = 0; i < s; i++)\n      if (b[i] == r)\n        c[j]++;\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n      }\n  k = d[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] == k)\n      max = i + 65;\n  printf(\"%c\\n%d\\n\", max, k);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == max)\n        printf(\"%d\\n\", a[i].num);\n}\n"}
{"label": "2", "index": "3048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct author {\n  char num[4];\n  char str[27];\n};\n\nint main(int argc, char *argv[]) {\n  int m, i, j, zimu[26] = {0}, x, max;\n  char p;\n  scanf(\"%d\", &m);\n  struct author *auth = (struct author *)malloc(sizeof(struct author) * m);\n  for (i = 0; i < m; i++)\n    scanf(\"%s %s\", auth[i].num, auth[i].str);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      x = auth[i].str[j] - 65;\n      zimu[x]++;\n    }\n  }\n  max = zimu[0];\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > max) {\n      max = zimu[i];\n      p = i;\n    }\n  }\n  printf(\"%d\\n%d\\n\", p + 65, max);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (auth[i].str[j] == p + 65) {\n        printf(\"%s\\n\", auth[i].num);\n      }\n    }\n  }\n\n  free(auth);\n  return 0;\n}\n"}
{"label": "2", "index": "3049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n} shu[999];\n\nint main(int argc, char *argv[]) {\n  int m, b, i, *p;\n  char c;\n  int writer[26];\n  char max(int *p);\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "3050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct x {\n    char num[26];\n    int y;\n  } q[1000], x0;\n  int n, i, j, c[100] = {0}, m = 0, f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &q[i].y, &q[i].num);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      m = (int)q[i].num[j], c[m] = c[m] + 1;\n  for (m = 0; m < 100; m++)\n    if (c[m] > c[0])\n      f = m, c[0] = c[m];\n  cout << (char)f << \"\\n\" << c[f] << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      if (q[i].num[j] == (char)f)\n        printf(\"%d\\n\", q[i].y);\n  return 0;\n}\n"}
{"label": "2", "index": "3051", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  char zuozhe[100][100];\n  int shuhao[100];\n  int zuo[200];\n  int shu[200][200];\n  int n = 0, p, i, j;\n  int m[200];\n\n  for (i = 0; i < 200; i++) {\n    zuo[i] = 0;\n    m[i] = 0;\n  }\n\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %s\", &shuhao[i], zuozhe[i]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; (zuozhe[i][j]) != '\\0'; j++) {\n      zuo[(zuozhe[i][j])] = zuo[(zuozhe[i][j])] + 1;\n      shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])] = shuhao[i];\n      m[(zuozhe[i][j])] = m[(zuozhe[i][j])] + 1;\n    }\n  }\n  for (i = 65; i <= 90; i++) {\n    if (zuo[i] > n) {\n      n = zuo[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", zuo[p]);\n  for (i = 0; i < m[p]; i++) {\n    printf(\"%d\\n\", shu[p][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3052", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0, maxi = 0;\n  int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};\n  char zz[1100][30];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> zz[i];\n    for (j = 0; zz[i][j] != '\\0'; j++) {\n      b[(int)zz[i][j] - 'A']++;\n      c[(int)zz[i][j] - 'A'][i] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      maxi = i;\n    }\n  }\n  cout << (char)(maxi + 'A') << endl;\n  cout << max << endl;\n  for (i = 1; i <= 1000; i++) {\n    if (c[maxi][i] == 1)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[26];\n} book[1000];\nint main() {\n  int n, i, j, e, max = 0;\n  scanf(\"%d\", &n);\n  char da, c;\n  int temp[27] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    for (da = 'A'; da <= 'Z'; da++) {\n      for (j = 0; j < 26; j++) {\n        if (book[i].writer[j] == da)\n          temp[da - 'A' + 0]++;\n      }\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] > max) {\n      max = temp[j];\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (temp[j] == max) {\n      c = j + 65;\n      printf(\"%c\\n%d\\n\", c, temp[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == c)\n        cout << book[i].num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "3054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n  } * s;\n  int n, i, j, a[100], t;\n  char c;\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &(*(s + i)).num, (*(s + i)).wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      for (c = 'A'; c <= 'Z'; c++)\n        if (s[i].wri[j] == c)\n          a[s[i].wri[j]]++;\n    }\n  for (i = 0; i < 100; i++)\n    if (a[0] < a[i]) {\n      a[0] = a[i];\n      t = i;\n    }\n  printf(\"%c\\n\", t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      if (s[i].wri[j] == t)\n        printf(\"%d\\n\", s[i].num);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3055", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar f(int y);\n\nint main() {\n  int m, i, j, number[1000], auther[26], total = 0;\n  char name[1000][27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &number[i], name[i]);\n    int n;\n    n = strlen(name[i]);\n    for (j = 0; j < n; j++) {\n      switch (name[i][j]) {\n      case 'A':\n        auther[0]++;\n        break;\n      case 'B':\n        auther[1]++;\n        break;\n      case 'C':\n        auther[2]++;\n        break;\n      case 'D':\n        auther[3]++;\n        break;\n      case 'E':\n        auther[4]++;\n        break;\n      case 'F':\n        auther[5]++;\n        break;\n      case 'G':\n        auther[6]++;\n        break;\n      case 'H':\n        auther[7]++;\n        break;\n      case 'I':\n        auther[8]++;\n        break;\n      case 'J':\n        auther[9]++;\n        break;\n      case 'K':\n        auther[10]++;\n        break;\n      case 'L':\n        auther[11]++;\n        break;\n      case 'M':\n        auther[12]++;\n        break;\n      case 'N':\n        auther[13]++;\n        break;\n      case 'O':\n        auther[14]++;\n        break;\n      case 'P':\n        auther[15]++;\n        break;\n      case 'Q':\n        auther[16]++;\n        break;\n      case 'R':\n        auther[17]++;\n        break;\n      case 'S':\n        auther[18]++;\n        break;\n      case 'T':\n        auther[19]++;\n        break;\n      case 'U':\n        auther[20]++;\n        break;\n      case 'V':\n        auther[21]++;\n        break;\n      case 'W':\n        auther[22]++;\n        break;\n      case 'X':\n        auther[23]++;\n        break;\n      case 'Y':\n        auther[24]++;\n        break;\n      case 'Z':\n        auther[25]++;\n        break;\n      }\n    }\n  }\n  int max = auther[0], k, t = 0;\n  for (k = 1; k < 26; k++) {\n    if (auther[k] > max) {\n      max = auther[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", f(t));\n  for (i = 0; i < m; i++) {\n    int q;\n    q = strlen(name[i]);\n    for (j = 0; j < q; j++) {\n      if (name[i][j] == f(t))\n        total++;\n    }\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i < m; i++) {\n    int p;\n    p = strlen(name[i]);\n    for (j = 0; j < p; j++) {\n      if (name[i][j] == f(t))\n        printf(\"%d\\n\", number[i]);\n    }\n  }\n  return 0;\n}\n\nchar f(int y) {\n  char x;\n  switch (y) {\n  case 0:\n    x = 'A';\n    break;\n  case 1:\n    x = 'B';\n    break;\n  case 2:\n    x = 'C';\n    break;\n  case 3:\n    x = 'D';\n    break;\n  case 4:\n    x = 'E';\n    break;\n  case 5:\n    x = 'F';\n    break;\n  case 6:\n    x = 'G';\n    break;\n  case 7:\n    x = 'H';\n    break;\n  case 8:\n    x = 'I';\n    break;\n  case 9:\n    x = 'J';\n    break;\n  case 10:\n    x = 'K';\n    break;\n  case 11:\n    x = 'L';\n    break;\n  case 12:\n    x = 'M';\n    break;\n  case 13:\n    x = 'N';\n    break;\n  case 14:\n    x = 'O';\n    break;\n  case 15:\n    x = 'P';\n    break;\n  case 16:\n    x = 'Q';\n    break;\n  case 17:\n    x = 'R';\n    break;\n  case 18:\n    x = 'S';\n    break;\n  case 19:\n    x = 'T';\n    break;\n  case 20:\n    x = 'U';\n    break;\n  case 21:\n    x = 'V';\n    break;\n  case 22:\n    x = 'W';\n    break;\n  case 23:\n    x = 'X';\n    break;\n  case 24:\n    x = 'Y';\n    break;\n  case 25:\n    x = 'Z';\n    break;\n  }\n  return x;\n}\n"}
{"label": "2", "index": "3056", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint num[1000];\nchar auth[1000][26];\n\nint main() {\n  int m, i, l;\n  cin >> m;\n  char c = 'A';\n  int k = 0;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    cin >> auth[i];\n    int j = 0;\n    while (auth[i][j] != '\\0') {\n      a[auth[i][j] - 64]++;\n      j++;\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > k) {\n      k = a[i];\n      c = i + 64;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, k);\n\n  for (i = 0; i < m; i++)\n    for (l = 0; l < 26; l++) {\n      if (auth[i][l] == c)\n        printf(\"%d\\n\", num[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3057", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char id[26];\n} a[999];\n\nstruct aut {\n  char wri;\n  int sum;\n} b[26];\n\nint main() {\n  int n, i, j, k, t, m = 0;\n  for (i = 0; i < 26; i++) {\n    b[i].wri = 'A' + i;\n    b[i].sum = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%s\", a[i].id);\n  }\n\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].wri == a[i].id[k])\n          b[j].sum++;\n      }\n    }\n  }\n  int max = b[0].sum;\n  for (j = 0; j < 26; j++) {\n    if (max < b[j].sum) {\n      max = b[j].sum;\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[m].wri, max);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (a[i].id[k] == b[m].wri)\n        printf(\"%d\\n\", a[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int m, i, j, len, max;\n  int id[1000], b[26] = {0};\n  char a[100][27], name;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &id[i], a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      b[a[i][j] - 'A']++;\n  }\n  max = b[0];\n  name = 'A';\n  for (j = 1; j < 26; j++) {\n    if (b[j] > max) {\n      max = b[j];\n      name = j + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < m; i++) {\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == name) {\n        strcpy(a[i], \"shuchu\");\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(a[i], \"shuchu\") == 0)\n      cout << id[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3059", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int j, n, i, book, max = 0, pos, a[30][1000] = {0};\n  char s[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> book >> s;\n    for (j = 0; j < strlen(s); j++) {\n      a[s[j] - 'A'][0]++;\n      a[s[j] - 'A'][a[s[j] - 'A'][0]] = book;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i][0] > max) {\n      max = a[i][0];\n      pos = i;\n    }\n  printf(\"%c\\n%d\\n\", pos + 'A', a[pos][0]);\n  for (i = 1; i <= a[pos][0]; i++)\n    printf(\"%d\\n\", a[pos][i]);\n}\n"}
{"label": "2", "index": "3060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, c[26] = {0}, max = 0;\n  char b[27] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"};\n  struct book {\n    int num;\n    char man[26];\n  } a[999];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].man);\n  }\n  i = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].man[j] == b[k])\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n  i = 0;\n  j = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b[t], max);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (a[j].man[k] == b[t])\n        printf(\"%d\\n\", a[j].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n};\nstruct name {\n  char na;\n  int n;\n};\nint main() {\n  int n, i, j, k, s, max = 0;\n  struct book a[1000];\n  struct name b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i].num, a[i].name);\n  }\n  for (i = 0; i <= 25; i++) {\n    b[i].na = 'A' + i;\n    for (j = 0, s = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n        if (b[i].na == a[j].name[k]) {\n          s++;\n          break;\n        }\n      }\n    }\n    b[i].n = s;\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n > max) {\n      max = b[i].n;\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n == max) {\n      printf(\"%c\\n%d\\n\", b[i].na, b[i].n);\n      for (j = 0; j <= n - 1; j++) {\n        for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n          if (b[i].na == a[j].name[k]) {\n            cout << a[j].num << \"\\n\";\n            break;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[26];\n} book[999];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a;\n  char c;\n  int max = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %s\", &book[i].num, book[i].author);\n  }\n  int s[26];\n  for (i = 0; i <= 25; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (0 <= (book[i].author[j] - 'A') && (book[i].author[j] - 'A') <= 25) {\n        a = book[i].author[j] - 'A';\n        s[a] = s[a] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (max < s[i]) {\n      max = s[i];\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (max == s[i]) {\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", c);\n  cout << max << \"\\n\";\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (book[i].author[j] == c) {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid function(int, int);\n\nint main() {\n  char s[200][100];\n  int n[100], h[100], maxh[100];\n  int a;\n  int i, j, k, p;\n  int num, maxnum = 0;\n  char c;\n\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%s\", &n[i], s[i]);\n  }\n\n  for (j = 'A'; j <= 'Z'; j++) {\n    num = 0;\n    for (i = 0; i < a; i++) {\n      for (k = 0; k < strlen(s[i]); k++) {\n        if (s[i][k] == j) {\n          num++;\n          h[num] = n[i];\n        }\n      }\n    }\n    if (num > maxnum) {\n      c = j;\n      maxnum = num;\n      for (p = 1; p <= maxnum; p++) {\n        maxh[p] = h[p];\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", c, maxnum);\n  for (p = 1; p <= maxnum; p++) {\n    printf(\"%d\\n\", maxh[p]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint num[1000];\nchar auth[1000][26];\n\nint main() {\n  int m, i, l;\n  cin >> m;\n  char c = 'A';\n  int k = 0;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    scanf(\"%s\", auth[i]);\n    int j = 0;\n    while (auth[i][j] != '\\0') {\n      a[auth[i][j] - 64]++;\n      j++;\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > k) {\n      k = a[i];\n      c = i + 64;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, k);\n\n  for (i = 0; i < m; i++)\n    for (l = 0; l < 26; l++) {\n      if (auth[i][l] == c)\n        printf(\"%d\\n\", num[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p;\n  char q[1000][30];\n  int shu[26] = {0};\n  char zm[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int n, i, j, k;\n  int len, max = 0;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    len = 0;\n    scanf(\"%d %s\", &p[i], q[i]);\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (q[i][j] == zm[k])\n          shu[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", zm[k], shu[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      if (q[i][j] == zm[k])\n        cout << p[i] << \"\\n\";\n    }\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "3066", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book *head;\nint abc[26];\nstruct book {\n  int num;\n  char name[1000];\n  struct book *next;\n};\n\nvoid ffind(char *name) {\n  while (*name != 0) {\n    abc[*name - 65]++;\n    name++;\n  }\n}\nint mfind(char *name, char a) {\n  while (*name != 0) {\n    if (a == *name)\n      return 1;\n    name++;\n  }\n}\n\nstruct book *creat(int max) {\n  int n;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  head = 0;\n  do {\n    cin >> p1->num >> p1->name;\n    ffind(p1->name);\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p2->next = 0;\n    p1 = (struct book *)malloc(1000);\n  } while (n < max);\n  p2->next = 0;\n  return head;\n}\n\nint main() {\n  int n, i;\n  int max = 0, maxi = 0;\n  char tt[2];\n  struct book *p, *p1;\n  cin >> n;\n  p = creat(n);\n  p1 = p;\n\n  for (i = 0; i < 26; i++) {\n    if (abc[i] > max) {\n      max = abc[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%C %d \", 65 + maxi, max);\n\n  tt[0] = maxi + 65;\n  tt[1] = 0;\n  do {\n    if (mfind(p1->name, maxi + 65) == 1) {\n      max--;\n      if (max != 0)\n        printf(\"%d \", p1->num);\n      else\n        printf(\"%d\", p1->num);\n    }\n    p1 = p1->next;\n  } while (p1 != 0);\n}\n"}
{"label": "2", "index": "3067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[26];\n};\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int i;\n  struct book book[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  int b[26] = {0};\n  for (i = 0; i < n; i++) {\n    int l;\n    l = strlen(book[i].author);\n    int j;\n    for (j = 0; j < l; j++) {\n      b[book[i].author[j] - 65] = b[book[i].author[j] - 65] + 1;\n    }\n  }\n  int max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max)\n      break;\n  }\n  char p;\n  p = i + 65;\n  printf(\"%c\\n%d\\n\", p, max);\n  for (i = 0; i < n; i++) {\n    int j, l;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++) {\n      if (book[i].author[j] == p) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      } else if (book[i].author[j] != p && j == l - 1)\n        break;\n    }\n  }\n  return 0;\n} \n"}
{"label": "2", "index": "3068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char str[200];\n} bk[1000];\nint main() {\n  int m, i, l, k, p = 0, max, maxl;\n  int a[200][1000];\n  int b[200];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &bk[i].num, bk[i].str);\n\n  for (l = 0; l < 26; l++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; bk[i].str[k] != '\\0'; k++) {\n        if ((bk[i].str[k]) == l + 65) {\n          a[l][p] = bk[i].num;\n          p++;\n        }\n      }\n    }\n    b[l] = p;\n    p = 0;\n  }\n  max = b[0];\n  maxl = 0;\n  for (l = 0; l < 26; l++) {\n    if (b[l] > max) {\n      max = b[l];\n      maxl = l;\n    }\n  }\n  printf(\"%c\\n\", maxl + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[maxl][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3069", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int number;\n    char author[10];\n  };\n  struct book a[1000];\n  int i, n, j, count[26] = {0}, temp, max, index = 0;\n  char c;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, &a[i].author);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      temp = (a[i].author[j]) - 'A';\n      count[temp]++;\n    }\n  max = count[0];\n  for (i = 1; i < 26; i++)\n    if (count[i] > max) {\n      max = count[i];\n      index = i;\n    }\n  c = index + 'A';\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++)\n      if (a[i].author[j] == c)\n        printf(\"%d\\n\", a[i].number);\n  return 0;\n}\n"}
{"label": "2", "index": "3070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, l, j, t, k[30][99], a[30], o, q, max = 0, maxman;\n  for (i = 0; i < 30; i++)\n    a[i] = 0;\n  char s[40];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %s\", &o, s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      q = s[i] - 'A';\n      a[q]++;\n      t = a[q];\n      k[q][t] = o;\n    }\n  }\n  for (i = 'A' - 'A'; i <= 'Z' - 'A'; i++) {\n    if (a[i] > max) {\n\n      max = a[i];\n      maxman = i;\n    }\n  }\n  cout << maxman + 'A' << \"\\n\" << max << \"\\n\";\n  for (i = 1; i <= max; i++)\n\n    cout << k[maxman][i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "2", "index": "3071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[999], i, k[27] = {0}, j, t, m;\n  char b[999][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n    for (j = 0; b[i][j]; j++)\n      k[b[i][j] - 65]++;\n  }\n  t = k[0];\n  m = 0;\n  for (j = 0; j < 26; j++) {\n    if (k[j] > t) {\n      t = k[j];\n      m = j;\n    }\n  }\n  cout << m + 65 << \"\\n\" << t << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i][j]; j++) {\n      if (b[i][j] == m + 65) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3072", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld %s\", &p1->num, p1->str);\n  n = 1;\n  head = 0;\n  while (n < m) {\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->str);\n    n = n + 1;\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 'A' + 1]++;\n    }\n  }\n  max = sum[1];\n  x = 1;\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 'A' - 1) {\n        a[y] = p->num;\n        y++;\n        t = strlen(p->str) + 1;\n      }\n  }\n  printf(\"%c %d \", x + 64, max);\n  for (y = 1; y <= max; y++)\n    printf(\"%d \", a[y]);\n}\n"}
{"label": "2", "index": "3073", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Books {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int n;\n  int i, j;\n  int x;\n  int max = 0;\n  char letter = 'A';\n  int b[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].num >> a[i].author;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (a[i].author[j] >= 65 && a[i].author[j] <= 90) {\n        x = a[i].author[j];\n        b[x - 65]++;\n      } else {\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      letter = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == letter) {\n        printf(\"%d\\n\", a[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3074", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int name;\n  char writer[100];\n  struct book *next;\n};\n\nint a[26];\n\nstruct book *creat(int n) {\n  struct book *p1, *p2, *xhead;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->name, p1->writer);\n  p2 = p1;\n  xhead = p1;\n\n  while (n - 1) {\n    n--;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->name, p1->writer);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nvoid find(struct book *head) {\n  struct book *p;\n  int i;\n  char s[100];\n  p = head;\n  while (p) {\n    i = 0;\n    strcpy(s, p->writer);\n    while (s[i] != '\u0000') {\n      a[s[i] - 'A']++;\n      i++;\n    }\n\n    p = p->next;\n  }\n}\n\nvoid print(struct book *head, int max) {\n  struct book *p;\n  p = head;\n  while (p) {\n    if (strchr(p->writer, max + 'A'))\n      printf(\"%d \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  int i, max = 0, n;\n  struct book *head;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &n);\n  head = creat(n);\n  find(head);\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[max])\n      max = i;\n  printf(\"%c \", max + 'A');\n  printf(\"%d \", a[max]);\n  print(head, max);\n}\n"}
{"label": "2", "index": "3075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int number;\n  char a[26];\n  int la;\n  struct book *next;\n};\n\nstruct book *insert(struct book *head, struct book *temp) {\n  struct book *p0, *p1, *p2;\n  p1 = head;\n  p0 = temp;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->next != NULL) {\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  struct book *p, *temp, *head = NULL;\n  int i, m, max;\n  int b[26] = {0};\n  char writer;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    temp = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d \", &temp->number);\n\n    cin >> temp->a;\n\n    temp->la = strlen(temp->a);\n    temp->next = NULL;\n    head = insert(head, temp);\n  }\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      b[p->a[i] - 65]++;\n    p = p->next;\n  }\n  max = b[0];\n  writer = 65;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      writer = i + 65;\n    }\n  }\n\n  printf(\"%c %d \", writer, max);\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      if (p->a[i] == writer) {\n        printf(\"%d \", p->number);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char wr[26];\n  struct book *next;\n};\nint main() {\n  int i, n, m = 0, j, a, b, c;\n  int s[100] = {0};\n  scanf(\"%d\", &n);\n  struct book *head, *p1, *p2, *p;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->wr);\n  head = NULL;\n  while (m != n - 1) {\n    m = m + 1;\n    if (m == 1) {\n      head = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->wr);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      s[p->wr[j]]++;\n    p = p->next;\n  } while (p != NULL);\n  a = s[65];\n  c = 65;\n  for (i = 66; i < 91; i++)\n    if (a < s[i]) {\n      a = s[i];\n      c = i;\n    }\n  printf(\"%c %d \", c, a);\n  p = head;\n  do {\n    b = strlen(p->wr);\n    for (j = 0; j < b; j++)\n      if (p->wr[j] == c)\n        cout << p->num << \" \";\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "2", "index": "3077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[26];\n} a[100];\nint main() {\n  int m, i, n, j, k, max, maxnum;\n  int aut1[26] = {0}, aut2[26][100] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i].id);\n\n    cin >> a[i].s;\n    n = strlen(a[i].s);\n    for (j = 0; j < n; j++) {\n      k = a[i].s[j] - 'A';\n      aut2[k][aut1[k]] = a[i].id;\n      aut1[k]++;\n    }\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (aut1[i] > max) {\n      max = aut1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c \", 'A' + maxnum);\n  printf(\"%d \", max);\n  printf(\"%d\", aut2[maxnum][0]);\n  for (i = 1; i < max; i++) {\n    cout << \" \" << aut2[maxnum][i];\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3078", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char au[26];\n  } b[999];\n  int m, n[26], M = 0, i, j;\n  cin >> m;\n  for (i = 0; i < 26; i++)\n    n[i] = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].m, b[i].au);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      n[b[i].au[j] - 65]++;\n  for (i = 1; i < 26; i++)\n    if (n[M] < n[i])\n      M = i;\n  printf(\"%c\\n%d\", M + 65, n[M]);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      if (b[i].au[j] == M + 65)\n        printf(\"\\n%d\", b[i].m);\n  return 0;\n}\n"}
{"label": "2", "index": "3079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[20];\n  struct tushu *next;\n};\nstruct tushu *creat(int m) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, num[26] = {0}, i, max;\n  scanf(\"%d\", &m);\n  struct tushu *head, *p1;\n  head = creat(m);\n  char *x;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    x = p1->name;\n    while (p1 != NULL) {\n      while (*x != '\u0000') {\n        if (*x == (i + 65)) {\n          num[i] = num[i] + 1;\n        }\n        x = x + 1;\n      }\n      p1 = p1->next;\n      x = p1->name;\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[max] < num[i])\n      max = i;\n  }\n  cout << max + 65 << \" \";\n  printf(\"%d \", num[max]);\n  p1 = head;\n  x = p1->name;\n  while (p1 != NULL) {\n    while (*x != '\u0000') {\n      if (*x == (max + 65)) {\n        cout << p1->num << \" \";\n        break;\n      }\n      x = x + 1;\n    }\n    p1 = p1->next;\n    x = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, g[26] = {0}, s[26][1000] = {0};\n  char a[50];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < 50; i++)\n      a[i] = 0;\n    scanf(\"%d%s\", &l, a);\n    for (i = 0; i < 26; i++)\n      for (j = 0; j < 26; j++)\n        if (a[i] == 'A' + j) {\n          s[j][g[j]] = l, g[j]++;\n          break;\n        }\n  }\n  m = 0;\n  for (i = 0; i < 26; i++)\n    if (g[i] > m)\n      m = g[i], k = i;\n  printf(\"%c\\n%d\\n\", 'A' + k, m);\n  for (i = 0; i < m; i++)\n    printf(\"%d\\n\", s[k][i]);\n}\n"}
{"label": "2", "index": "3081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char au[26];\n  } b[999];\n  int m, n[26], M = 0, i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    n[i] = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].m, b[i].au);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      n[b[i].au[j] - 65]++;\n  for (i = 1; i < 26; i++)\n    if (n[M] < n[i])\n      M = i;\n  cout << M + 65 << \"\\n\" << n[M];\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].au[j] != '\\0'; j++)\n      if (b[i].au[j] == M + 65)\n        cout << \"\\n\" << b[i].m;\n  return 0;\n}\n"}
{"label": "2", "index": "3082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  char num[20];\n  char aut[20];\n  struct book *next;\n};\nstruct book *creat() {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->aut);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->aut);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nvoid print(struct book *head) {\n  struct book *p;\n  int *tem, i, k;\n  char *q, max, c;\n  tem = (int *)malloc(30 * sizeof(int));\n  for (i = 0; i < 30; i++) {\n    *(tem + i) = 0;\n  }\n  for (p = head; p; p = p->next) {\n    q = p->aut;\n    for (i = 0; *(q + i) != '\u0000'; i++) {\n      c = *(q + i) - 'A';\n      *(tem + c) += 1;\n    }\n  }\n  max = 0;\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (*(tem + i) > max) {\n      max = *(tem + i);\n      k = i;\n    }\n  }\n  c = k + 'A';\n  printf(\"%c \", c);\n  cout << max << \" \";\n  for (p = head; p; p = p->next) {\n    for (q = p->aut, i = 0; *(q + i) != '\u0000'; i++) {\n      if (*(q + i) == c) {\n        break;\n      }\n    }\n    if (*(q + i) != '\u0000') {\n      printf(\"%s \", p->num);\n    }\n  }\n}\nint main() {\n  struct book *head;\n  scanf(\"%d\", &m);\n  head = creat();\n  print(head);\n}\n"}
{"label": "2", "index": "3083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, a[100], b[26], s, max;\n  char c[100][50], m;\n  for (i = 0; i <= 25; i++)\n    b[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++) {\n      s = (int)c[i][j] - 65;\n      b[s] = b[s] + 1;\n    }\n  }\n  max = b[0];\n  j = 0;\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      j = i;\n    }\n  }\n  m = j + 65;\n  cout << m << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++)\n      if (c[i][j] == m)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int maxc = 0, i, j, n, a[1000], c;\n  char maxp, b[1000][27], p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n  }\n  for (p = 'A'; p <= 'Z'; p++) {\n    c = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0;; j++) {\n        if (b[i][j] == '\\0')\n          break;\n        if (b[i][j] == p) {\n          c++;\n        }\n      }\n    }\n    if (c > maxc) {\n      maxc = c;\n      maxp = p;\n    }\n  }\n  cout << maxp << \"\\n\";\n  printf(\"%d\\n\", maxc);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (b[i][j] == '\\0')\n        break;\n      if (b[i][j] == maxp) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3085", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid function(int, int);\n\nint main() {\n  char s[200][100];\n  int n[100], h[100], maxh[100];\n  int a;\n  int i, j, k, p;\n  int num, maxnum = 0;\n  char c;\n\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%s\", &n[i], s[i]);\n  }\n\n  for (j = 'A'; j <= 'Z'; j++) {\n    num = 0;\n    for (i = 0; i < a; i++) {\n      for (k = 0; k < strlen(s[i]); k++) {\n        if (s[i][k] == j) {\n          num++;\n          h[num] = n[i];\n        }\n      }\n    }\n    if (num > maxnum) {\n      c = j;\n      maxnum = num;\n      for (p = 1; p <= maxnum; p++) {\n        maxh[p] = h[p];\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", c, maxnum);\n  for (p = 1; p <= maxnum; p++) {\n    printf(\"%d\\n\", maxh[p]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n\n  struct book {\n    int num;\n    char name[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\\n\", &book[i].num, book[i].name);\n\n  struct author {\n    char l;\n    int count;\n  } au[26];\n\n  for (i = 0; i < 26; i++) {\n    au[i].l = 65 + i;\n    au[i].count = 0;\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (au[i].l == book[j].name[k]) {\n          au[i].count++;\n          break;\n        }\n      }\n    }\n  }\n\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (au[max].count < au[i].count)\n      max = i;\n  }\n  cout << au[max].l << \"\\n\" << au[max].count << \"\\n\";\n\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (au[max].l == book[j].name[k]) {\n        printf(\"%d\\n\", book[j].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, a[1000], c[91], max = 0;\n  char b[1000][26], d;\n  cin >> m;\n  memset(c, 0, sizeof(c));\n  for (i = 0; i < m; i++) {\n    cin >> a[i] >> b[i];\n    for (j = 0; j < 26; j++)\n      if (b[i][j] > 0)\n        c[b[i][j]]++;\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > max)\n      max = c[i];\n  for (i = 65; i < 91; i++)\n    if (c[i] == max) {\n      d = i;\n      cout << d << endl << max << endl;\n      for (j = 0; j < m; j++)\n        for (k = 0; k < 26; k++)\n          if (b[j][k] == d) {\n            cout << a[j] << endl;\n            break;\n          }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int array[26]) {\n  int i, max = 0;\n  for (i = 0; i < 26; i++)\n    if (array[i] > max)\n      max = array[i];\n  for (i = 0; i < 26; i++)\n    if (max == array[i])\n      break;\n  return i;\n}\nint main() {\n  struct book {\n    int num;\n    char aut[26];\n  };\n  int a, i, j, m, k, t[26] = {0};\n  struct book nbook[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &nbook[i].num, nbook[i].aut);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      for (k = 0; k < 26; k++)\n        if (nbook[i].aut[j] == k + 65)\n          t[k]++;\n  a = max(t);\n  printf(\"%c\\n%d\\n\", a + 65, t[a]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (nbook[i].aut[j] == a + 65)\n        printf(\"%d\\n\", nbook[i].num);\n}\n"}
{"label": "2", "index": "3089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[100];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int k = 1;\n  struct book *head, *p1, *p2, *p;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  p2 = p1;\n  p = p1;\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  do {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    k++;\n  } while (k < n);\n  return head;\n}\n\nint main(void) {\n  struct book *head, *p;\n  char *q;\n  int *s;\n  int n, i, j, max = 0;\n  s = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(s + i) = 0;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  while (p) {\n    q = p->name;\n    while (*q != '\\0') {\n      *(s + *(q) - 'A') += 1;\n      q++;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(s + i) > max)\n      max = *(s + i);\n  for (i = 0; i < 26; i++)\n    if (*(s + i) == max)\n      break;\n  printf(\"%c\\n%d\\n\", 'A' + i, max);\n  p = head;\n  while (p) {\n    q = p->name;\n    if (strchr(q, 'A' + i) != NULL)\n      printf(\"%d\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++)\n    max = max > num[i] ? max : num[i];\n\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i;\n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd)\n\n        printf(\"%d\\n\", p1->sl);\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[100], C[26] = {0}, n, i, j, m, a = 0, b;\n  char B[100][100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &A[i], B[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      m = B[i][j];\n      C[m - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a < C[i]) {\n      a = C[i];\n      b = i;\n    }\n  }\n  printf(\"%c\\n\", b + 65);\n  printf(\"%d\\n\", a);\n  c = b + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      if (B[i][j] == c) {\n        printf(\"%d\\n\", A[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n} b[999];\nint main() {\n  int i, j, m, n, k, max, p;\n  int a[26] = {0}, q[999] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++) {\n      k = b[i].aut[j];\n      a[k - 65]++;\n    }\n  }\n  for (i = 1, max = a[0], p = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++)\n      if (b[i].aut[j] == (p + 65))\n        q[i] = 1;\n  }\n  for (i = 0; i < m; i++)\n    if (q[i] == 1)\n      printf(\"\\n%d\", b[i].num);\n}\n"}
{"label": "2", "index": "3093", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  char s[1000][30], ch;\n  int b[30] = {0};\n  int i, k;\n  int n;\n  int max = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (ch = 'A'; ch <= 'Z'; ch++)\n      if (strchr(s[i], ch) != NULL)\n        b[ch - 65]++;\n  for (i = 0; i <= 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  ch = k + 65;\n  for (i = 0; i < n; i++)\n    if (strchr(s[i], ch) != NULL)\n      printf(\"%d\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct x {\n  int num;\n  char author[26];\n  int amount;\n};\nint main() {\n  struct x y[999];\n  int i, j, m, max = 0, max_ = 0;\n  int k;\n  int amount[91] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> y[i].num >> y[i].author;\n    y[i].amount = strlen(y[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      for (k = 'A'; k < 'Z'; k++) {\n        if (k = y[i].author[j]) {\n          amount[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i < 'Z'; i++) {\n    if (max < amount[i]) {\n      max = amount[i];\n      max_ = i;\n    }\n  }\n  printf(\"%c\\n\", max_);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      if (y[i].author[j] == max_)\n        printf(\"%d\\n\", y[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int booknumber;\n  int order[1000];\n  char author[1000][27];\n  char single_author[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int author_booknumber[26] = {0};\n  int i, j, k;\n  int tmp;\n\n  scanf(\"%d\", &booknumber);\n\n  for (i = 0; i < booknumber; i++) {\n    scanf(\"%d%s\", &order[i], author[i]);\n    for (j = 0; j < strlen(author[i]); j++) {\n      for (k = 0; k < 26; k++) {\n        if (author[i][j] == single_author[k]) {\n          author_booknumber[k]++;\n          break;\n        }\n      }\n    }\n  }\n  tmp = 0;\n\n  for (i = 1; i < 26; i++) {\n    if (author_booknumber[i] > author_booknumber[tmp])\n      tmp = i;\n  }\n  printf(\"%c\\n\", single_author[tmp]);\n  printf(\"%d\\n\", author_booknumber[tmp]);\n\n  for (i = 0; i < booknumber; i++) {\n    for (j = 0; j < strlen(author[i]); j++) {\n      if (author[i][j] == single_author[tmp]) {\n        printf(\"%d\\n\", order[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3096", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char mname[999][26], name;\n  int i, j, m, len, max = 0;\n  int num[999], count[26] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> mname[i];\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++)\n      count[mname[i][j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      name = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < m; i++) {\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      if (mname[i][j] == name) {\n        cout << num[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int n;\n  char name[27];\n  struct stu *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct stu *head, *p1, *p2, *p3;\n  head = p1 = (struct stu *)malloc(1000);\n  cin >> p1->n >> p1->name;\n  int i = 0;\n  for (; i < m - 1; i++) {\n    p2 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p2->n, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  p2->next = NULL;\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    while (*p != '\\0') {\n      int a = *p;\n      sum[a - 65] = sum[a - 65] + 1;\n      p = p + 1;\n    }\n  }\n  int max = sum[0];\n  char j = 'A';\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i + 65;\n    }\n  }\n  cout << j << \"\\n\" << max << \"\\n\";\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    for (; *p != '\\0'; p++)\n      if (*p == j) {\n        printf(\"%d\\n\", p1->n);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3098", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int id;\n  char str[27];\n} bo[1000];\nstruct people {\n  int name;\n  int number;\n  int book_number[1000];\n} people[26];\nint main() {\n  int n, i, j, k, m, max = 0;\n  char a[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\\0'};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].id >> bo[i].str;\n  }\n\n  for (i = 0; i < 26; i++) {\n    people[i].number = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bo[i].str);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (bo[i].str[j] == a[k]) {\n          people[k].book_number[people[k].number] = bo[i].id;\n          people[k].number++;\n        }\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    if (people[i].number > max) {\n      j = i;\n      max = people[i].number;\n    }\n  }\n  cout << a[j] << endl;\n  cout << people[j].number << endl;\n  for (i = 0; i < people[j].number; i++) {\n    cout << people[j].book_number[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3099", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct shu {\n  int haoma;\n  char b[26];\n  struct shu *next;\n};\n\nint main() {\n  int n, i, a[26], c[26][100], max;\n  int *s, (*q)[100];\n  s = a;\n  q = c;\n  char m[26];\n  struct shu *head, *p;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  head = (struct shu *)malloc(n * sizeof(shu));\n  p = head;\n  for (i = 0; i < n - 1; i++) {\n    (p + i)->next = p + i + 1;\n  }\n  (p + n - 1)->next = 0;\n  p = head;\n  for (; p != 0;) {\n    scanf(\"%d %s\", &p->haoma, p->b);\n    strcpy(m, p->b);\n    for (i = 0; *(m + i) != '\\0'; i++) {\n      *(*(q + *(m + i) - 65) + *(s + *(m + i) - 65)) = p->haoma;\n      \n      *(s + *(m + i) - 65) += 1;\n      \n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(a + i) > max) {\n      max = *(a + i);\n      n = i;\n    }\n  printf(\"%c\\n\", n + 65);\n  printf(\"%d\\n\", *(a + n));\n  for (i = 0; i < *(a + n); i++) {\n    printf(\"%d\\n\", *(*(q + n) + i));\n  }\n}\n"}
{"label": "2", "index": "3100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int maxc = 0, i, j, n, a[1000], c;\n  char maxp, b[1000][27], p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n  }\n  for (p = 'A'; p <= 'Z'; p++) {\n    c = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0;; j++) {\n        if (b[i][j] == '\\0') {\n          break;\n        }\n        if (b[i][j] == p) {\n          c++;\n        }\n      }\n    }\n    if (c > maxc) {\n      maxc = c;\n      maxp = p;\n    }\n  }\n  cout << maxp << \"\\n\";\n  printf(\"%d\\n\", maxc);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (b[i][j] == '\\0')\n        break;\n      if (b[i][j] == maxp) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  char str[1000][26];\n  int a[1000], count[26] = {0};\n  int t = 0;\n  int shu = 0;\n\n  for (int i = 0; i < m; i++) {\n    t = 0;\n    scanf(\"%d \", &a[i]);\n    cin >> str[i];\n    t = strlen(str[i]);\n    for (int j = 0; j < t; j++) {\n      shu = str[i][j] - 'A';\n      count[shu]++;\n    }\n  }\n\n  int max = count[0];\n  int hao = 0;\n\n  for (int k = 1; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      hao = k;\n    }\n  }\n\n  char c = hao + 'A';\n\n  printf(\"%c\\n\", c);\n  cout << max << endl;\n\n  for (int l = 0; l < m; l++) {\n    for (int o = 0; str[l][o] != '\\0'; o++) {\n      if (str[l][o] == c) {\n        cout << a[l] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3102", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[20];\n  struct book *next;\n};\nint main() {\n  int n, i, j, m, k, c[26], max; \n  char a[26];                    \n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < 26; i++) {\n      n = strlen(p1->writer);\n      for (k = 0; k < n; k++) {\n        if (a[i] == p1->writer[k]) {\n          c[i]++;\n        }\n      }\n    }\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c %d \", a[max], c[max]);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->writer);\n    for (j = 0; j < n; j++) {\n      if (p1->writer[j] == a[max]) {\n        printf(\"%d \", p1->num);\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, max = 0;\n  int Q[26] = {0};\n  struct {\n    int num;\n    char name[27];\n  } book[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].num >> book[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      switch (book[i].name[j]) {\n      case 'A':\n        Q[0]++;\n        break;\n      case 'B':\n        Q[1]++;\n        break;\n      case 'C':\n        Q[2]++;\n        break;\n      case 'D':\n        Q[3]++;\n        break;\n      case 'E':\n        Q[4]++;\n        break;\n      case 'F':\n        Q[5]++;\n        break;\n      case 'G':\n        Q[6]++;\n        break;\n      case 'H':\n        Q[7]++;\n        break;\n      case 'I':\n        Q[8]++;\n        break;\n      case 'J':\n        Q[9]++;\n        break;\n      case 'K':\n        Q[10]++;\n        break;\n      case 'L':\n        Q[11]++;\n        break;\n      case 'M':\n        Q[12]++;\n        break;\n      case 'N':\n        Q[13]++;\n        break;\n      case 'O':\n        Q[14]++;\n        break;\n      case 'P':\n        Q[15]++;\n        break;\n      case 'Q':\n        Q[16]++;\n        break;\n      case 'R':\n        Q[17]++;\n        break;\n      case 'S':\n        Q[18]++;\n        break;\n      case 'T':\n        Q[19]++;\n        break;\n      case 'U':\n        Q[20]++;\n        break;\n      case 'V':\n        Q[21]++;\n        break;\n      case 'W':\n        Q[22]++;\n        break;\n      case 'X':\n        Q[23]++;\n        break;\n      case 'Y':\n        Q[24]++;\n        break;\n      case 'Z':\n        Q[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (Q[i] > Q[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 65, Q[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      if (book[i].name[j] == max + 65) {\n        cout << book[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3104", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max, p;\n  int mwj;\n  int shu[1000];\n  char zuo[1000][30];\n  int w[26];\n  for (i = 0; i < 26; i++)\n    w[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i], zuo[i]);\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      w[(zuo[i][j] - 65)] = w[(zuo[i][j] - 65)] + 1;\n    }\n  }\n  max = w[0];\n  p = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      mwj = zuo[i][j];\n      if (mwj == p + 65) {\n        printf(\"%d\\n\", shu[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3105", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, a[1000] = {0}, count[30] = {0}, temp, j, max = -999, flag;\n  char s[1000][30] = {0}, cha;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    cin >> a[i];\n    for (j = 1; j < 30; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = 0;\n        continue;\n      }\n      if (s[i][j] == '\\n') {\n        s[i][j] = 0;\n        break;\n      }\n      temp = s[i][j] - 'A' + 1;\n      count[temp] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] >= max) {\n      flag = i;\n      max = count[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", flag + 64, max);\n  cha = 'A' + flag - 1;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j < 30; j++) {\n      if (s[i][j] == cha) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int bookno[100];\n  char author[100][26];\n  int numOfauthor[26] = {0};\n  int nbook, max = 0, maxno;\n  char maxauthor;\n  cin >> nbook;\n  int i, j;\n  for (i = 0; i < nbook; i++) {\n    cin >> bookno[i];\n    cin.get();\n    cin.getline(*(author + i), 26);\n  }\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      numOfauthor[author[i][j] - 'A']++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (numOfauthor[i] > max) {\n      max = numOfauthor[i];\n      maxno = i;\n    }\n  }\n  maxauthor = maxno + 'A';\n  cout << maxauthor << endl;\n  cout << numOfauthor[maxno] << endl;\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      if (author[i][j] == maxauthor)\n        cout << bookno[i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, w = 0;\n  int maxzm, maxbk = 0;\n  char c1;\n  int zimu[26] = {0};\n  int lm[100];\n  struct {\n    int num;\n    char a[100];\n  } book[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      for (k = 65; k < 91; k++) {\n        if (book[i].a[j] == k)\n          zimu[k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > maxbk) {\n      maxbk = zimu[i];\n      maxzm = i;\n    }\n  }\n  c1 = maxzm + 65;\n  printf(\"%c\\n\", c1);\n  printf(\"%d\\n\", maxbk);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      if (book[i].a[j] == c1) {\n        lm[w] = book[i].num;\n        w++;\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%d\\n\", lm[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, z;\n  char max;\n  int sum[999] = {0};\n  struct student {\n    int a;\n    char b[26];\n    int c[26];\n  } x[999];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x[i].a);\n    for (j = 0;; j++) {\n      scanf(\"%c\", &x[i].b[j]);\n      if (x[i].b[j] == '\\n')\n        break;\n      x[i].c[x[i].b[j] - 65]++;\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < 999; i++) {\n      sum[k] = sum[k] + x[i].c[k];\n    }\n  }\n\n  z = sum[0];\n  max = 65;\n  for (k = 1; k < 26; k++) {\n    if (sum[k] > z) {\n      max = k + 65;\n      z = sum[k];\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", z);\n  for (i = 0; i < n; i++) {\n    if (x[i].c[max - 65] > 0) {\n      printf(\"%d\\n\", x[i].a);\n    }\n  }\n\n  scanf(\"%d\", i);\n  return 0;\n}\n"}
{"label": "2", "index": "3109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, card[1000], num[26] = {0}, max = 0, k = 0;\n  char s[1000][27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &card[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      num[s[i][j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != 0; j++)\n      if (s[i][j] == k + 'A') {\n        printf(\"%d\\n\", card[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[1001], num[27] = {0}, ascii[27];\n  char a[1001][27], p;\n  int i, j, m, n, t1, t;\n  cin >> m;\n  n = 26;\n  for (i = 0; i < m; i++) {\n    cin >> number[i];\n    cin >> a[i];\n    for (j = 0; j < strlen(a[i]); j++) {\n      num[a[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    ascii[i] = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (num[j] > num[j - 1]) {\n        t = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = t;\n        t1 = ascii[j];\n        ascii[j] = ascii[j - 1];\n        ascii[j - 1] = t1;\n      }\n    }\n  }\n  p = 'A' + ascii[0];\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", num[0]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(a[i]); j++) {\n      if (a[i][j] == p) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, max;\n  int a[1000], b[26];\n  char name[1000][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], name[i]);\n    for (j = 0; j < strlen(name[i]); j++)\n      b[name[i][j] - 'A']++;\n  }\n  max = 0;\n  for (k = 1; k < 26; k++)\n    if (b[k] > b[max])\n      max = k;\n  printf(\"%c\\n%d\\n\", max + 'A', b[max]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == max + 'A') {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3112", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[1000], m[1000];\n  struct {\n    char b[26];\n  } p[1000];\n  int j, k;\n  cin >> n;\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], p[i].b);\n    m[i] = strlen(p[i].b);\n    for (k = 0; k < 26; k++)\n      for (j = 0; j < m[i]; j++) {\n        if (p[i].b[j] == c[k])\n          num[k]++;\n      }\n  }\n  int max = 0, local = 0;\n  for (k = 0; k < 26; k++) {\n    if (num[k] > max) {\n      max = num[k];\n      local = k;\n    }\n  }\n  printf(\"%c\\n\", c[local]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (p[i].b[j] == c[local])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[27];\n  struct book *next;\n} * head;\nint times[26];\n\nvoid create(int m) {\n  struct book *p1, *p2;\n  int i;\n  for (i = 0; i <= m - 1; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d\", &p1->num);\n    cin >> p1->writer;\n    if (!i)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n}\nint count() {\n  int max, l, i;\n  char temp[27];\n  struct book *p1;\n  for (i = 0; i <= 25; i++)\n    times[i] = 0;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->writer);\n    strcpy(temp, p1->writer);\n    for (i = 0; i <= l - 1; i++)\n      times[temp[i] - 65]++;\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++)\n    if (times[i] > times[max])\n      max = i;\n  return (max);\n}\nvoid print(int max) {\n  struct book *p1;\n  int abc[999], total, l, i;\n  char temp[27];\n\n  total = 0;\n  printf(\"%c\\n\", max + 65);\n  p1 = head;\n  while (p1 != NULL) {\n    strcpy(temp, p1->writer);\n    l = strlen(temp);\n    for (i = 0; i <= l - 1; i++)\n      if (max + 65 == temp[i])\n        break;\n    if (i < l) {\n      abc[total] = p1->num;\n      total++;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i <= total - 1; i++) {\n    printf(\"%d\\n\", abc[i]);\n  }\n}\nint main() {\n  int max, m;\n  scanf(\"%d\", &m);\n  create(m);\n  max = count();\n  print(max);\n}\n"}
{"label": "2", "index": "3114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int shu;\n  char ppl[27];\n  int a[26][n + 1];\n  memset(a, 0, sizeof(a)); \n  for (int i = 0; i < n; i++) {\n    memset(ppl, 0, sizeof(ppl)); \n    cin >> shu;                  \n    getchar();                   \n    cin.getline(ppl, 27, '\\n');  \n    for (int j = 0; 'A' <= ppl[j] && ppl[j] <= 'Z'; j++) {\n      a[(int)ppl[j] - (int)'A'][0]++;                                \n      a[(int)ppl[j] - (int)'A'][a[(int)ppl[j] - (int)'A'][0]] = shu; \n    }\n  }\n  int max = 0, set = 0; \n  for (int i = 0; i < 26; i++) {\n    if (a[i][0] > max) {\n      max = a[i][0];\n      set = i;\n    }\n  }\n  cout << (char)((int)'A' + set) << endl; \n  cout << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << a[set][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "3115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int a[1000];\n  char s[1000][26];\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  char x;\n  int max = 0;\n  char maxx;\n  int l;\n  for (x = 'A'; x <= 'Z'; x++) {\n    l = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (s[i][j] == x)\n          break;\n      }\n      if (j != 26)\n        l++;\n    }\n    if (l > max) {\n      max = l;\n      maxx = x;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxx, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (s[i][j] == maxx)\n        break;\n    }\n    if (j != 26)\n      printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int num;\n    char a[25];\n  } book[999];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n\n  int s[26] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      s[book[i].a[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char name;\n  for (i = 0; i <= 25; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      name = 'A' + i;\n    }\n  }\n  printf(\"%c \", name);\n  printf(\"%d \", max);\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      if (book[i].a[j] == name)\n        printf(\"%d \", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0, maxi = 0;\n  int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};\n  char zz[1100][30];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> zz[i];\n    for (j = 0; zz[i][j] != '\\0'; j++) {\n      b[(int)zz[i][j] - 'A']++;\n      c[(int)zz[i][j] - 'A'][i] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      maxi = i;\n    }\n  }\n  cout << (char)(maxi + 'A') << endl;\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= 1000; i++) {\n    if (c[maxi][i] == 1)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } bookn[999];\n  struct zuozhe {\n    char w;\n    int count;\n  } zuozhen[26];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < 26; i++) {\n    zuozhen[i].w = 'A' + i;\n    zuozhen[i].count = 0;\n  }\n  int h = 0;\n  int m, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bookn[i].num, bookn[i].writer);\n    m = strlen(bookn[i].writer);\n    for (j = 0; j < m; j++) {\n      h = bookn[i].writer[j] - 'A';\n      zuozhen[h].count++;\n    }\n  }\n  struct zuozhe a;\n  a = zuozhen[0];\n  for (i = 1; i < 26; i++) {\n    if (a.count < zuozhen[i].count)\n      a = zuozhen[i];\n  }\n  printf(\"%c\\n\", a.w);\n  printf(\"%d\\n\", a.count);\n  int t;\n  for (i = 0; i < n; i++) {\n    t = strlen(bookn[i].writer);\n    for (j = 0; j < t; j++) {\n      if (bookn[i].writer[j] == a.w)\n        printf(\"%d\\n\", bookn[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct people {\n  int a;\n  char name[26];\n};\nint main() {\n  struct people pl[1000];\n  int i, j, k, n, s, m, max, x[26];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &pl[i].a, pl[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(pl[i].name);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++)\n        if (k == pl[i].name[j] - 'A') {\n          x[k]++;\n          break;\n        }\n  }\n  max = x[0];\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max) {\n      printf(\"%c\\n\", 'A' + i);\n      s = i;\n      printf(\"%d\\n\", x[i]);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (pl[i].name[j] == 'A' + s) {\n        printf(\"%d\\n\", pl[i].a);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, book[1000], i, j, countt[26] = {0}, len, max = -1, maxauthor;\n  char peo[1000][27], sum[100000] = \"\\0\", ch;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> book[i] >> peo[i];\n    strcat(sum, peo[i]);\n  }\n  len = strlen(sum);\n  for (i = 0; i < len; i++)\n    countt[sum[i] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (countt[i] > max) {\n      max = countt[i];\n      maxauthor = i;\n    }\n\n  ch = maxauthor + 65;\n  int p = 0, t = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(peo[i]); j++)\n      if (peo[i][j] == ch)\n        p++;\n    if (p > 0)\n      book[i - t] = book[i];\n    else\n      t++;\n    p = 0;\n  }\n  printf(\"%c\\n\", ch);\n  cout << n - t << endl;\n  for (i = 1; i <= n - t; i++)\n    cout << book[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[26];\n};\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int i;\n  struct book book[1000];\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  int b[26] = {0};\n  for (i = 0; i < n; i++) {\n    int l;\n    l = strlen(book[i].author);\n    int j;\n    for (j = 0; j < l; j++) {\n      b[book[i].author[j] - 65] = b[book[i].author[j] - 65] + 1;\n    }\n  }\n  int max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max)\n      break;\n  }\n  char p;\n  p = i + 65;\n  printf(\"%c\\n%d\\n\", p, max);\n  for (i = 0; i < n; i++) {\n    int j, l;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++) {\n      if (book[i].author[j] == p) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      } else if (book[i].author[j] != p && j == l - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char id[26];\n} a[999];\n\nstruct aut {\n  char wri;\n  int sum;\n} b[26];\n\nint main() {\n  int n, i, j, k, t, m = 0;\n  for (i = 0; i < 26; i++) {\n    b[i].wri = 'A' + i;\n    b[i].sum = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%s\", a[i].id);\n  }\n\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].wri == a[i].id[k])\n          b[j].sum++;\n      }\n    }\n  }\n  int max = b[0].sum;\n  for (j = 0; j < 26; j++) {\n    if (max < b[j].sum) {\n      max = b[j].sum;\n      m = j;\n    }\n  }\n  cout << b[m].wri << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (a[i].id[k] == b[m].wri)\n        cout << a[i].num << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t, max = 0;\n  int a[1000], b[26] = {0};\n  char s[1000][30];\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++) {\n      t = s[i][j] - 65;\n      b[t]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max) {\n      k = i;\n      c = i + 65;\n      printf(\"%c\\n\", c);\n      cout << max << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i]);\n    for (j = 0; j < m; j++)\n      if (s[i][j] == 65 + k) {\n        printf(\"%d\\n\", a[i]);\n      }\n  }\n}\n"}
{"label": "2", "index": "3124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  char c[26];\n  struct stu *next;\n};\n\nstruct stu *create(void) {\n  struct stu *p1, *p2, *head;\n  int m;\n  scanf(\"%d\", &m);\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->c);\n  p2 = p1;\n  head = p1;\n\n  while (m - 1) {\n    m--;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->c);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid print(struct stu *head, int z) {\n  struct stu *q;\n  int i, k;\n  char s[20], s0[20] = {'\\0'};\n  q = head;\n  while (q) {\n    strcpy(s, q->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++)\n      if (s[i] == z + 65) {\n        cout << q->num << \"\\n\";\n        break;\n      }\n    strcpy(s, s0);\n    q = q->next;\n  }\n}\n\nint main() {\n  int index;\n  int a[26], k, t, i, max = 0;\n  char s[20], s0[20] = {'\\0'};\n  struct stu *p, *head;\n  memset(a, 0, sizeof(a));\n\n  head = create();\n  p = head;\n\n  while (p) {\n    strcpy(s, p->c);\n    k = strlen(s);\n    for (i = 0; i < k; i++) {\n      t = s[i] - 65;\n      a[t]++;\n    }\n    strcpy(s, s0);\n    p = p->next;\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      index = i;\n    }\n  }\n  cout << index + 65 << \"\\n\" << max << \"\\n\";\n  print(head, index);\n}\n"}
{"label": "2", "index": "3125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  char name[1000][26];\n  int num[1000];\n  int i, j;\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &num[i], name[i]);\n\n  int a[26] = {0};\n  char k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == 'A')\n        a[0]++;\n      if (name[i][j] == 'B')\n        a[1]++;\n      if (name[i][j] == 'C')\n        a[2]++;\n      if (name[i][j] == 'D')\n        a[3]++;\n      if (name[i][j] == 'E')\n        a[4]++;\n      if (name[i][j] == 'F')\n        a[5]++;\n      if (name[i][j] == 'G')\n        a[6]++;\n      if (name[i][j] == 'H')\n        a[7]++;\n      if (name[i][j] == 'I')\n        a[8]++;\n      if (name[i][j] == 'J')\n        a[9]++;\n      if (name[i][j] == 'K')\n        a[10]++;\n      if (name[i][j] == 'L')\n        a[11]++;\n      if (name[i][j] == 'M')\n        a[12]++;\n      if (name[i][j] == 'N')\n        a[13]++;\n      if (name[i][j] == 'O')\n        a[14]++;\n      if (name[i][j] == 'P')\n        a[15]++;\n      if (name[i][j] == 'Q')\n        a[16]++;\n      if (name[i][j] == 'R')\n        a[17]++;\n      if (name[i][j] == 'S')\n        a[18]++;\n      if (name[i][j] == 'T')\n        a[19]++;\n      if (name[i][j] == 'U')\n        a[20]++;\n      if (name[i][j] == 'V')\n        a[21]++;\n      if (name[i][j] == 'W')\n        a[22]++;\n      if (name[i][j] == 'X')\n        a[23]++;\n      if (name[i][j] == 'Y')\n        a[24]++;\n      if (name[i][j] == 'Z')\n        a[25]++;\n    }\n  }\n  int max = a[0];\n  int o = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      o = i;\n    }\n  }\n  cout << b[o] << \"\\n\" << a[o] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; (k = name[i][j] != '\\0'); j++) {\n      if (name[i][j] == b[o])\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  scanf(\"%d\", &i);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nint main() {\n  int m, i, j, l, max, maxi;\n  int n[26] = {0};\n  struct book *head, *p1, *p2;\n  char *p;\n  scanf(\"%d\", &m);\n  i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->author;\n  head = NULL;\n  while (i < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < m) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n    }\n  }\n  p2->next = NULL;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      for (j = 0; j < 26; j++)\n        if (*(p + i) == j + 64)\n          n[j]++;\n    }\n    p1 = p1->next;\n  }\n  max = n[0];\n  for (i = 1; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n\", maxi + 64);\n  cout << max << \"\\n\";\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      if (*(p + i) == maxi + 64) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0;\n  char w;\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> b;\n    book[i][26] = b;\n    cin.get();\n    while ((w = cin.get()) != '\\n') {\n      writer[w - 'A']++;\n      book[i][w - 'A'] = 1;\n    }\n  }\n  for (int i = 1; i < 26; i++)\n    if (writer[max] < writer[i])\n      max = i;\n  cout << (char)(max + 'A') << endl;\n  cout << writer[max] << endl;\n  for (int i = 1; i <= m; i++)\n    if (book[i][max])\n      cout << book[i][26] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct tushu {\n    int num;\n    char zuozhe[27];\n  } ts[999];\n\n  int i, j, n, k, temp;\n  int count[26] = {0};\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &ts[i].num, ts[i].zuozhe);\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      count[ts[i].zuozhe[j] - 65]++;\n    }\n  }\n  temp = count[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > temp) {\n      k = i;\n      temp = count[i];\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", count[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; ts[i].zuozhe[j] != '\\0'; j++) {\n      if (ts[i].zuozhe[j] == k + 65) {\n        printf(\"%d\\n\", ts[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int bianhao;\n  char name[26];\n} shu[999];\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k;\n  int jishu[26] = {0};\n  int beiyong[26];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &shu[i].bianhao, shu[i].name);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (shu[j].name[k] == i + 'A')\n          jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    beiyong[i] = jishu[i];\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (beiyong[i] > max)\n      max = beiyong[i];\n  }\n  int t;\n  for (i = 0; i < 26; i++) {\n    if (jishu[i] == max)\n      t = i;\n  }\n  cout << t + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].name[j] == t + 'A')\n        printf(\"%d\\n\", shu[i].bianhao);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct books {\n    int book;\n    char writer[20];\n  } bk[1000];\n  int n, i, j, m, max, k, maxw = 0, flag = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk[i].book, bk[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      k = bk[i].writer[j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxw = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxw + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      if (maxw + 65 == bk[i].writer[j])\n        printf(\"%d\\n\", bk[i].book);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int i;\n  struct book *head;\n  struct book *p1, *p2;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n\n  for (i = 0; i < n - 1; i++) {\n\n    if (i == 0)\n      head = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, n, a[26] = {0}, max = 0, j, k = 0;\n  char t;\n  struct book *p, *p1;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  p1 = p;\n  for (j = 0; j < n; j++) {\n    for (i = 0; *(p->name + i) != '\\0'; i++)\n      a[*(p->name + i) - 65] = a[*(p->name + i) - 65] + 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  cout << (k + 65) << \"\\n\" << max << \"\\n\";\n  t = (char)(k + 65);\n\n  while (p1 != NULL) {\n    for (i = 0; *(p1->name + i) != '\\0'; i++) {\n      if (*(p1->name + i) == t) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3132", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct worker {\n  int nm;\n  char name1[26];\n  struct worker *next;\n};\nstruct zuozhe {\n  char nam;\n  int counts;\n  int name[1000];\n  struct zuozhe *next;\n};\nstruct worker *creat1(int n) {\n  struct worker *head, *p1, *p2;\n  int i;\n  head = (struct worker *)malloc(sizeof(struct worker));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    cin >> p2->nm >> p2->name1;\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nstruct zuozhe *creat2() {\n  struct zuozhe *head, *p1, *p2;\n  int i;\n  head = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n  p1 = p2 = head;\n  for (i = 0; i < 26; i++) {\n    p2 = p1;\n    p1 = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    p2->counts = 0;\n    p2->nam = 'A' + i;\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nint main() {\n  int big = 0;\n  char zz;\n  int i, j;\n  char c;\n  int m, n;\n  int a[26] = {0};\n  struct worker *head1, *p1, *p2;\n  struct zuozhe *head2, *q1, *q2;\n  scanf(\"%d\", &n);\n  head1 = creat1(n);\n  p1 = p2 = head1;\n  head2 = creat2();\n  q1 = q2 = head2;\n  while (p1 != 0) {\n    i = 0;\n    while (p1->name1[i] != '\\0') {\n      q1 = head2;\n      while (1) {\n        if (q1->nam == p1->name1[i]) {\n          q1->name[q1->counts] = p1->nm;\n          q1->counts++;\n          i++;\n          break;\n        }\n        q1 = q1->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  q1 = head2;\n  while (q1 != 0) {\n    if (q1->counts > big) {\n      zz = q1->nam;\n      big = q1->counts;\n    }\n    q1 = q1->next;\n  }\n  q1 = head2;\n  while (1) {\n    if (q1->nam == zz) {\n      printf(\"%c\\n%d\\n\", q1->nam, q1->counts);\n      for (i = 0; i < q1->counts; i++) {\n        printf(\"%d\\n\", q1->name[i]);\n      }\n\n      break;\n    }\n    q1 = q1->next;\n  }\n}\n"}
{"label": "2", "index": "3133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[20];\n};\nint main() {\n  struct book c[1000];\n  int i, j, n, k, max, l, d[26], a;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    cin >> c[k].num >> c[k].name;\n    for (i = 0; i < strlen(c[k].name); i++) {\n      for (j = 0; j < 26; j++) {\n        if ('A' + j == c[k].name[i])\n          break;\n      }\n      b[j] = b[j] + 1;\n    }\n  }\n  for (a = 0; a < 26; a++)\n    d[a] = b[a];\n  max = b[0];\n  for (l = 0; l < 26; l++)\n    if (b[l] > max)\n      max = b[l];\n  for (a = 0; a < 26; a++) {\n    if (d[a] == max)\n      break;\n  }\n  printf(\"%c\\n\", 'A' + a);\n  printf(\"%d\\n\", max);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < strlen(c[k].name); i++) {\n      if ('A' + a == c[k].name[i]) {\n        printf(\"%d\\n\", c[k].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, temp, max;\n  char a[1000][10], b[1000][20], w;\n  int c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      if (b[i][j] == 'B')\n        c[1]++;\n      if (b[i][j] == 'C')\n        c[2]++;\n      if (b[i][j] == 'D')\n        c[3]++;\n      if (b[i][j] == 'E')\n        c[4]++;\n      if (b[i][j] == 'F')\n        c[5]++;\n      if (b[i][j] == 'G')\n        c[6]++;\n      if (b[i][j] == 'H')\n        c[7]++;\n      if (b[i][j] == 'I')\n        c[8]++;\n      if (b[i][j] == 'J')\n        c[9]++;\n      if (b[i][j] == 'K')\n        c[10]++;\n      if (b[i][j] == 'L')\n        c[11]++;\n      if (b[i][j] == 'M')\n        c[12]++;\n      if (b[i][j] == 'N')\n        c[13]++;\n      if (b[i][j] == 'O')\n        c[14]++;\n      if (b[i][j] == 'P')\n        c[15]++;\n      if (b[i][j] == 'Q')\n        c[16]++;\n      if (b[i][j] == 'R')\n        c[17]++;\n      if (b[i][j] == 'S')\n        c[18]++;\n      if (b[i][j] == 'T')\n        c[19]++;\n      if (b[i][j] == 'U')\n        c[20]++;\n      if (b[i][j] == 'V')\n        c[21]++;\n      if (b[i][j] == 'W')\n        c[22]++;\n      if (b[i][j] == 'X')\n        c[23]++;\n      if (b[i][j] == 'Y')\n        c[24]++;\n      if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    temp = 0;\n    for (j = 0; j < 26; j++) {\n      if (c[i] >= c[j]) {\n        temp++;\n      }\n    }\n    if (temp == 26) {\n      max = i;\n      break;\n    }\n  }\n  w = 'A' + i;\n  printf(\"%c\\n\", w);\n  printf(\"%d\\n\", c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i]); j++) {\n      if (b[i][j] == w) {\n        printf(\"%s\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char au[32];\n  int sta[27];\n} b[1020];\nint main() {\n  int i, j, k, m, n;\n  char c;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].au);\n  }\n  for (i = 0; i < m; i++) {\n\n    for (j = 0;; j++) {\n      c = b[i].au[j];\n      if (c == '\\0') {\n        break;\n      } else {\n        b[i].sta[c - 64]++;\n      }\n    }\n  }\n  int sum[27] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < 27; j++) {\n      sum[j] += b[i].sta[j];\n    }\n  }\n  int max = 0;\n  for (i = 1; i < 27; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 64);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n    }\n  }\n  printf(\"%d\\n\", n);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n      if (n == 1) {\n        printf(\"%d\", b[i].num);\n      } else {\n        printf(\"\\n%d\", b[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int code;\n  char writer[10];\n};\nint main() {\n  int n, i, j, t = 0, d, ww[27] = {0};\n  char max, w[27];\n  struct book list[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    w[i] = i + 65;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &list[i].code, list[i].writer);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n      for (d = 0; d < 26; d++)\n        if (list[i].writer[j] == w[d])\n          ww[d]++;\n    }\n  max = ww[0];\n  for (i = 0; i < 26; i++)\n    if (ww[i] > max) {\n      max = ww[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", w[t], ww[t]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n\n      if (list[i].writer[j] == w[t])\n        printf(\"%d\\n\", list[i].code);\n    }\n}\n"}
{"label": "2", "index": "3137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p = 0;\n  int m, i, j, max[1000];\n  struct book {\n    int num;\n    char s[27];\n  } book[1000];\n  memset(max, 0, sizeof(max));\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].s);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].s[j]; j++) {\n      if (++max[book[i].s[j]] > max[p]) {\n        p = book[i].s[j];\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", p, max[p]);\n  for (i = 0; i < m; i++) {\n    if (strchr(book[i].s, p))\n      printf(\"%d\\n\", book[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3138", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n    struct book *next;\n  };\n  int n, m, i;\n  scanf(\"%d\", &m);\n  struct book *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->wri);\n  head = NULL;\n  for (i = 0; i < m - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->wri);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  int a[26] = {0}, b, j, k, max1 = 0, max2;\n  struct book *g;\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] != '\u0000') {\n        b = g->wri[i];\n        a[b - 65] = a[b - 65] + 1;\n      }\n    }\n    g = g->next;\n  } while (g != NULL);\n  for (i = 0; i < 26; i++) {\n    if (max1 < a[i]) {\n      max1 = a[i];\n      max2 = i;\n    }\n  }\n  max2 = max2 + 65;\n  printf(\"%c %d\", max2, max1);\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] == max2) {\n        printf(\" %d\", g->num);\n        break;\n      }\n    }\n\n    g = g->next;\n  } while (g != NULL);\n}\n"}
{"label": "2", "index": "3139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int i, k, m, max = 0, t;\n  char j, ch;\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)calloc(1, sizeof(struct book));\n  head = p1;\n  for (i = 0; i < m; i++) {\n    cin >> (p1->a) >> p1->b;\n    p2 = p1;\n    if (i == m - 1)\n      p2->next = NULL;\n    else {\n      p1 = (struct book *)calloc(1, sizeof(struct book));\n      p2->next = p1;\n    }\n  }\n  for (j = 'A'; j <= 'Z'; j++) {\n    t = 0;\n    p1 = head;\n    while (p1) {\n      for (k = 0; k < strlen(p1->b); k++) {\n        if ((p1->b)[k] == j)\n          t++;\n      }\n      p1 = p1->next;\n    }\n    if (t > max) {\n      max = t;\n      ch = j;\n    }\n  }\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", max);\n  p1 = head;\n  while (p1) {\n    for (k = 0; k < strlen(p1->b); k++)\n      if ((p1->b)[k] == ch)\n        printf(\"%d\\n\", p1->a);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char author[27];\n  int i, j, n, no, ab[26][1000] = {0}, an[26] = {0}, ma = 0, na, am;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> no >> author;\n    for (i = 0; i < 27; i++)\n      if (author[i] != '\\0')\n        ab[author[i] - 'A'][an[author[i] - 'A']] = no, an[author[i] - 'A']++;\n      else\n        break;\n  }\n  for (i = 0; i < 26; i++) {\n    na = 0;\n    for (j = 0; j < 999; j++)\n      if (ab[i][j] != 0)\n        na++;\n      else\n        break;\n    if (na > ma)\n      ma = na, am = i;\n  }\n  cout << (char)('A' + am) << endl << ma << endl;\n  for (i = 0; i < 1000; i++)\n    if (ab[am][i] != 0)\n      cout << ab[am][i] << endl;\n    else\n      break;\n  return 0;\n}\n"}
{"label": "2", "index": "3141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char edt[27];\n};\nstruct total {\n  char name;\n  int amount;\n};\nint main() {\n  int m, i, j, k;\n  struct book bk[1000];\n  struct total to[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].edt;\n  for (i = 0; i < 26; i++) {\n    to[i].name = 'A' + i;\n    to[i].amount = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++) {\n      for (k = 0; k < 26; k++) {\n        if (bk[i].edt[j] == to[k].name)\n          to[k].amount++;\n      }\n    }\n  }\n\n  for (i = k = 0; i < 26; i++) {\n    if (to[i].amount > to[k].amount)\n      k = i;\n  }\n  printf(\"%c\\n%d\\n\", to[k].name, to[k].amount);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++)\n      if (bk[i].edt[j] == to[k].name)\n        printf(\"%d\\n\", bk[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3142", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, shu[1000], num[26], length[1000];\n  char author[1000][26], maxauthor;\n  scanf(\"%d \", &m);\n  memset(num, 0, sizeof(num));\n  for (int i = 0; i < m; i++) {\n    cin >> shu[i] >> author[i];\n    length[i] = strlen(author[i]);\n    for (int j = 0; j < length[i]; j++)\n      num[author[i][j] - 'A'] += 1;\n  }\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (maxnum < num[i])\n      maxnum = num[i];\n  }\n  for (int i = 0; i < 26; i++) {\n    if (num[i] == maxnum) {\n      maxauthor = (char)('A' + i);\n      cout << maxauthor << endl;\n      cout << maxnum << endl;\n      break;\n    }\n  }\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < length[i]; j++) {\n      if (author[i][j] == maxauthor)\n        cout << shu[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  char str[1000][26];\n  int a[1000], count[26] = {0};\n  int t = 0;\n  int shu = 0;\n\n  for (int i = 0; i < m; i++) {\n    t = 0;\n    cin >> a[i];\n    cin >> str[i];\n    t = strlen(str[i]);\n    for (int j = 0; j < t; j++) {\n      shu = str[i][j] - 'A';\n      count[shu]++;\n    }\n  }\n\n  int max = count[0];\n  int hao = 0;\n\n  for (int k = 1; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      hao = k;\n    }\n  }\n\n  char c = hao + 'A';\n\n  printf(\"%c\\n\", c);\n  cout << max << endl;\n\n  for (int l = 0; l < m; l++) {\n    for (int o = 0; str[l][o] != '\\0'; o++) {\n      if (str[l][o] == c) {\n        cout << a[l] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3144", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint c[255];\n\nint main() {\n  int i, j, n;\n  char m = 0;\n  struct {\n    int id;\n    char s[255];\n  } a[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].s);\n    for (j = 0; a[i].s[j]; j++) {\n      if (++c[a[i].s[j]] > c[m])\n        m = a[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", m, c[m]);\n  for (i = 0; i < n; i++) {\n    if (strchr(a[i].s, m))\n      printf(\"%d\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int j, n, i, book, max = 0, pos, a[30][1000] = {0};\n  char s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book, &s);\n    for (j = 0; j < strlen(s); j++) {\n      a[s[j] - 'A'][0]++;\n      a[s[j] - 'A'][a[s[j] - 'A'][0]] = book;\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i][0] > max) {\n      max = a[i][0];\n      pos = i;\n    }\n  printf(\"%c\\n%d\\n\", pos + 'A', a[pos][0]);\n  for (i = 1; i <= a[pos][0]; i++)\n    cout << a[pos][i] << \"\\n\";\n}\n"}
{"label": "2", "index": "3146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[999];\n  char r[999][26];\n  int b[125] = {0};\n  int n, i, j, maxi, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    cin >> r[i];\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      b[r[i][j]] = b[r[i][j]] + 1;\n    }\n  }\n  maxi = 65;\n  for (i = 66; i <= 90; i++) {\n    if (b[i] > b[maxi])\n      maxi = i;\n  }\n  printf(\"%d\\n\", maxi);\n  printf(\"%d\\n\", b[maxi]);\n  for (i = 0; i <= n - 1; i++) {\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      if (r[i][j] == maxi) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint c[255];\n\nint main() {\n  int i, j, n;\n  char m = 0;\n  struct {\n    int id;\n    char s[255];\n  } a[1000];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].s;\n    for (j = 0; a[i].s[j]; j++) {\n      if (++c[a[i].s[j]] > c[m])\n        m = a[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", m, c[m]);\n  for (i = 0; i < n; i++) {\n    if (strchr(a[i].s, m))\n      cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], max = 0, t, p[26] = {0};\n  char c[1000][27],\n      l[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], c[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      for (k = 0; k < 26; k++) {\n        if (c[i][j] == l[k])\n          p[k] += 1;\n      }\n  for (k = 0; k < 26; k++)\n    if (p[k] > max) {\n      max = p[k];\n      t = k;\n    }\n  printf(\"%c\\n%d\\n\", l[t], max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if (c[i][j] == l[t]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3149", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[26] = {0};\nint n;\nint max_1;\nint hao;\nstruct chushu {\n  int num;\n  char s[30];\n  struct chushu *next;\n};\nstruct chushu *create() {\n  int j = 0, q, i = 0, k = 0;\n\n  struct chushu *head, *p1, *p2;\n  p1 = (struct chushu *)malloc(1000);\n  cin >> p1->num >> p1->s;\n\n  for (i = 0; p1->s[i] != '\u0000'; i++) {\n    j = p1->s[i] - 65;\n    a[j] = a[j] + 1;\n  }\n\n  head = p1;\n  p2 = p1;\n  while (k < n - 1) {\n    k++;\n    p2 = p1;\n    p1 = (struct chushu *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n\n    for (i = 0; p1->s[i] != '\u0000'; i++) {\n      j = p1->s[i] - 65;\n      a[j] = a[j] + 1;\n    }\n\n    p2->next = p1;\n  }\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\n\nvoid search(struct chushu *head) {\n  int i;\n  struct chushu *p;\n  p = head;\n  while (p->next != NULL) {\n    for (i = 0; p->s[i] != '\u0000'; i++) {\n      if (hao + 65 == p->s[i])\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  }\n  for (i = 0; p->s[i] != '\u0000'; i++) {\n    if (hao + 65 == p->s[i]) {\n      printf(\"%d \", p->num);\n    }\n  }\n}\n\nint main() {\n  int i;\n  struct chushu *p;\n  scanf(\"%d\", &n);\n  p = create();\n  max_1 = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max_1) {\n      max_1 = a[i];\n      hao = i;\n    }\n  }\n  printf(\"%c \", hao + 65);\n  printf(\"%d \", max_1);\n  search(p);\n  return 0;\n}\n"}
{"label": "2", "index": "3150", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint trans(char k) {\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct point {\n    int id;\n    char au[26];\n  } books[1000];\n  int num[26];\n  int i;\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n\n  int j;\n  for (i = 0; i < m; i++) {\n    cin >> books[i].id >> books[i].au;\n  }\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      int b;\n      b = trans(books[i].au[j]);\n      num[b]++;\n    }\n  }\n  int max = 0;\n  int most;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      most = i;\n    }\n  }\n  char aumost;\n  aumost = 'A' + most;\n  printf(\"%c\\n\", aumost);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      if (books[i].au[j] == 'A' + most) {\n        printf(\"%d\\n\", books[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], c[26] = {0}, max1 = 0, temp;\n  char m[1000][26], max2;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n    getchar();\n    cin.getline(m[i - 1], 26);\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++) {\n      c[m[i][j] - 'A']++;\n    }\n\n  for (int s = 0; s < 26; s++) {\n\n    if (max1 <= c[s]) {\n      max1 = c[s];\n      temp = s + 'A';\n      max2 = temp;\n    }\n  }\n  cout << max2 << endl;\n  cout << max1 << endl;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++)\n      if (m[i][j] == max2) {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3152", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nint main() {\n  int m, i, j, l, max, maxi;\n  int n[26] = {0};\n  struct book *head, *p1, *p2;\n  char *p;\n  scanf(\"%d\", &m);\n  i = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->author;\n  head = NULL;\n  while (i < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < m) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n    }\n  }\n  p2->next = NULL;\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      for (j = 0; j < 26; j++)\n        if (*(p + i) == j + 64) {\n          n[j]++;\n        }\n    }\n    p1 = p1->next;\n  }\n  max = n[0];\n  for (i = 1; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      maxi = i;\n    }\n  }\n  printf(\"%c\\n\", maxi + 64);\n\n  printf(\"%d\\n\", max);\n\n  p1 = head;\n  while (p1 != NULL) {\n    l = strlen(p1->author);\n    p = p1->author;\n    for (i = 0; i < l; i++) {\n\n      if (*(p + i) == maxi + 64) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int number;\n  char author[26];\n  struct book *next;\n};\nint m, i;\nstruct book *creat(void) {\n  struct book *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  for (i = 1; i < m; i++) {\n    scanf(\"%d %s\", &p1->number, p1->author);\n    p1 = (struct book *)malloc(sizeof(struct book));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d %s\", &p1->number, p1->author);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int j, a[26] = {0}, max;\n  scanf(\"%d\", &m);\n  head = creat();\n  for (p = head; p != NULL; p = p->next)\n    for (i = 0; i < strlen(p->author); i++)\n      switch (p->author[i]) {\n      case 'A':\n        a[0]++;\n        break;\n      case 'B':\n        a[1]++;\n        break;\n      case 'C':\n        a[2]++;\n        break;\n      case 'D':\n        a[3]++;\n        break;\n      case 'E':\n        a[4]++;\n        break;\n      case 'F':\n        a[5]++;\n        break;\n      case 'G':\n        a[6]++;\n        break;\n      case 'H':\n        a[7]++;\n        break;\n      case 'I':\n        a[8]++;\n        break;\n      case 'J':\n        a[9]++;\n        break;\n      case 'K':\n        a[10]++;\n        break;\n      case 'L':\n        a[11]++;\n        break;\n      case 'M':\n        a[12]++;\n        break;\n      case 'N':\n        a[13]++;\n        break;\n      case 'O':\n        a[14]++;\n        break;\n      case 'P':\n        a[15]++;\n        break;\n      case 'Q':\n        a[16]++;\n        break;\n      case 'R':\n        a[17]++;\n        break;\n      case 'S':\n        a[18]++;\n        break;\n      case 'T':\n        a[19]++;\n        break;\n      case 'U':\n        a[20]++;\n        break;\n      case 'V':\n        a[21]++;\n        break;\n      case 'W':\n        a[22]++;\n        break;\n      case 'X':\n        a[23]++;\n        break;\n      case 'Y':\n        a[24]++;\n        break;\n      case 'Z':\n        a[25]++;\n        break;\n      }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max) {\n      printf(\"%c \", 65 + i);\n      break;\n    }\n  printf(\"%d \", max);\n  for (p = head; p != NULL; p = p->next)\n    for (j = 0; j < strlen(p->author); j++)\n      if (p->author[j] == 65 + i)\n        printf(\"%d \", p->number);\n  return 0;\n}\n"}
{"label": "2", "index": "3154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  char author[30];\n  struct info *next;\n};\nstruct info *create(int n) {\n  struct info *p1, *p2, *head;\n  int i;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d%s\", &p1->num, p1->author);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  i = 1;\n  while (i < n) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d%s\", &p1->num, p1->author);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  }\n  return head;\n}\n\nint main() {\n  int n, i, t, index, j;\n  struct info *head, *p;\n  int *g;\n  scanf(\"%d\", &n);\n  head = create(n);\n  g = (int *)malloc(26 * sizeof(int));\n  p = head;\n  for (i = 0, t = 0; i < 26; i++) {\n    *(g + i) = 0;\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      (*(g + (*(p->author + j)) - 65))++;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0, t = 0; i < 26; i++) {\n    if (*(g + i) > t) {\n      t = *(g + i);\n      index = i;\n    }\n  }\n  printf(\"%c\\n\", index + 65);\n  printf(\"%d\\n\", *(g + index));\n  p = head;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      if (*(p->author + j) == index + 65)\n        printf(\"%d\\n\", p->num);\n\n      j++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct test {\n  int num;\n  int book[100];\n\n} a[26];\nint main() {\n  int n, i, j, index, temp, max;\n  char s[100];\n  char ch;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &index, &s);\n    for (j = 0; s[j] != '\\0'; j++) {\n      temp = (int)(s[j] - 'A');\n      a[temp].book[a[temp].num] = index;\n      a[temp].num++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i].num > a[max].num)\n      max = i;\n  }\n  ch = (char)('A' + max);\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", a[max].num);\n  for (i = 0; i < a[max].num; i++) {\n    cout << a[max].book[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int n, i, a, max = 0, alp[26] = {0};\n  char *j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      int x = *j;\n      ++*(alp + x - 65);\n      if (*(alp + x - 65) > max) {\n        max = *(alp + x - 65);\n        a = x;\n      }\n    }\n  }\n\n  cout << a << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      if ((int)*j == a)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3157", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[1000], i, j, a[26] = {0}, len, k, max, l = 0;\n  char x[1000][10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i] >> x[i];\n  for (i = 0; i < n; i++) {\n    len = 0;\n    k = 0;\n    len = strlen(x[i]);\n    for (j = 0; j < len; j++) {\n      k = x[i][j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (j = 1; j < 26; j++) {\n    if (a[j] > max) {\n      max = a[j];\n      l = j;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 10; j++) {\n      if (x[i][j] == (l + 65))\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char auth[26];\n  struct book *next;\n};\nstruct book *creat(int m) {\n  int i = 0;\n  struct book *head, *p1, *p2;\n  if (i == 0) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->auth;\n    head = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  }\n  while (i < m) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->auth;\n    p2->next = p1;\n    p1->next = NULL;\n    p2 = p1;\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  int m, i, lenth;\n  int max = 0, maxwh = 27;\n  int count[26] = {0};\n  struct book *head, *p;\n  cin >> m;\n  head = creat(m);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++)\n      count[(int)(p->auth)[i] - 65]++;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      maxwh = i;\n    }\n  }\n  printf(\"%c\\n\", maxwh + 65);\n  printf(\"%d\\n\", max);\n  p = head;\n  while (p != NULL) {\n    lenth = strlen(p->auth);\n    for (i = 0; i < lenth; i++) {\n      if ((int)(p->auth[i]) == maxwh + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char str[200];\n} bk[1000];\nint main() {\n  int m, i, l, k, p = 0, max, maxl;\n  int a[200][1000];\n  int b[200];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &bk[i].num, bk[i].str);\n\n  for (l = 0; l < 26; l++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; bk[i].str[k] != '\\0'; k++) {\n        if ((bk[i].str[k]) == l + 65) {\n          a[l][p] = bk[i].num;\n          p++;\n        }\n      }\n    }\n    b[l] = p;\n    p = 0;\n  }\n  max = b[0];\n  maxl = 0;\n  for (l = 0; l < 26; l++) {\n    if (b[l] > max) {\n      max = b[l];\n      maxl = l;\n    }\n  }\n  printf(\"%c\\n\", maxl + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[maxl][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3160", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book {\n    int booknumber;\n    char writer[27];\n  } book[999];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].booknumber, book[i].writer);\n  }\n  int writerbookquantity[26];\n  for (i = 0; i < 26; i++)\n    writerbookquantity[i] = 0;\n  int j, len, x;\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      x = book[i].writer[j] - 'A';\n      writerbookquantity[x]++;\n    }\n  }\n  int maxwriter = 0, maxquantity = 0;\n  for (i = 0; i < 26; i++) {\n    if (writerbookquantity[i] > maxquantity) {\n      maxquantity = writerbookquantity[i];\n      maxwriter = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(maxwriter + 'A'), writerbookquantity[maxwriter]);\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      if ((int)book[i].writer[j] == maxwriter + 'A')\n        printf(\"%d\\n\", book[i].booknumber);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char a[26];\n  int la;\n  struct book *next;\n};\n\nstruct book *insert(struct book *head, struct book *temp) {\n  struct book *p0, *p1, *p2;\n  p1 = head;\n  p0 = temp;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->next != NULL) {\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  struct book *p, *temp, *head = NULL;\n  int i, m, max;\n  int b[26] = {0};\n  char writer;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    temp = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d \", &temp->number);\n\n    cin >> temp->a;\n\n    temp->la = strlen(temp->a);\n    temp->next = NULL;\n    head = insert(head, temp);\n  }\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      b[p->a[i] - 65]++;\n    p = p->next;\n  }\n  max = b[0];\n  writer = 65;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      writer = i + 65;\n    }\n  }\n\n  cout << writer << \" \" << max << \" \";\n\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < p->la; i++)\n      if (p->a[i] == writer) {\n        printf(\"%d \", p->number);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, b[91][1000], max = 0, i, j, k, s, m, writer;\n  struct book bk[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].num, bk[i].wr);\n  }\n  for (i = 0; i < 26; i++) {\n    s = 0;\n    for (j = 0; j < n; j++) {\n      m = strlen(bk[j].wr);\n      for (k = 0; k < m; k++) {\n        if (bk[j].wr[k] == i + 65) {\n          b[i][s] = bk[j].num;\n          s++;\n          k = m;\n        }\n      }\n    }\n    if (s > max) {\n      max = s;\n      writer = i;\n    }\n  }\n  cout << writer + 65 << \"\\n\" << max;\n  for (i = 0; i < max; i++) {\n    printf(\"\\n%d\", b[writer][i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3163", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], c[26] = {0}, max1 = 0, temp;\n  char m[1000][26], max2;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n    getchar();\n    cin.getline(m[i - 1], 26);\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++) {\n      c[m[i][j] - 'A']++;\n    }\n\n  for (int s = 0; s < 26; s++) {\n\n    if (max1 <= c[s]) {\n      max1 = c[s];\n      temp = s + 'A';\n      max2 = temp;\n    }\n  }\n  cout << max2 << endl;\n  cout << max1 << endl;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 26; j++)\n      if (m[i][j] == max2) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, b[999], max = 0, a[27], x;\n  char w, c[999][26], d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n  }\n  for (i = 0; i < 27; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 65; k < 91; k++) {\n        if (c[i][j] == k)\n          a[k - 64]++;\n      }\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  w = x + 64;\n  cout << w << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (c[i][j] == x + 64) {\n        cout << b[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3165", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, max, ID[1000] = {0}, a[26] = {0};\n  char name[1000][26] = {\"\"};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &ID[i], &name[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      a[name[i][j] - 'A']++;\n\n  max = a[0];\n  k = 0;\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == 'A' + k)\n        printf(\"%d\\n\", ID[i]);\n}\n"}
{"label": "2", "index": "3166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int hao;\n  char zuo[26];\n  struct shu *next;\n};\nint main() {\n  int m, a[26] = {0}, i, j, b[26][1000], k, max;\n  struct shu *p1, *p2, *head = NULL, *p;\n  scanf(\"%d\", &m);\n  p1 = p2 = (struct shu *)malloc(1000);\n  scanf(\"%d %s\", &p1->hao, p1->zuo);\n  head = p1;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d %s\", &p1->hao, p1->zuo);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0, max = 0; i <= 25; i++) {\n    for (p = head, k = 1; p != NULL; p = p->next) {\n      for (j = 0; j <= 25; j++)\n        if (p->zuo[j] == 'A' + i) {\n          a[i]++;\n          b[i][k] = p->hao;\n          k++;\n        }\n    }\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i <= 25; i++) {\n    if (a[i] == max) {\n      printf(\"%c %d \", 'A' + i, max);\n      for (k = 1; k <= max; k++)\n        cout << b[i][k] << \" \";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int a;\n    char b[20];\n  } book[999];\n  int n, i, k, max, m, j, p;\n  int c[999] = {0};\n  char str1[20], str2[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].a, &book[i].b);\n    m = strlen(book[i].b);\n    strcpy(str1, book[i].b);\n    for (j = 0; j < m; j++)\n      c[str1[j]] = c[str1[j]] + 1;\n  }\n  max = 0;\n  for (p = 65; p < 91; p++) {\n    if (c[p] > max) {\n      max = c[p];\n      k = p;\n    }\n  }\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    strcpy(str2, book[i].b);\n    m = strlen(book[i].b);\n    for (j = 0; j < m; j++) {\n      if (str2[j] == k)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char str[26];\n} bk[1000];\nint main() {\n  int m, i, j, k, s, n = 0;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n                'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int b[26] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].str);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      for (k = 0; k < 26; k++)\n        if (a[k] == bk[i].str[j])\n          b[k]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > n) {\n      n = b[i];\n      s = i;\n    }\n  printf(\"%c\\n%d\\n\", a[s], b[s]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      if (bk[i].str[j] == a[s])\n        printf(\"%d\\n\", bk[i].num);\n}\n"}
{"label": "2", "index": "3169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ma = 'A';\n  int cnt[128] = {0};\n  int i, j, n;\n  struct s {\n    int id;\n    char au[27];\n  } bk[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      cnt[bk[i].au[j]]++;\n      if (cnt[bk[i].au[j]] > cnt[ma]) {\n        ma = bk[i].au[j];\n      }\n    }\n  }\n  cout << ma << \"\\n\" << cnt[ma] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (strchr(bk[i].au, ma)) {\n      printf(\"%d\\n\", bk[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct books {\n  int num;\n  char writer[26];\n  struct books *next;\n};\n\nint m;\n\nstruct books *creat() {\n  struct books *head, *p1, *p2;\n  int i;\n  p2 = p1 = (struct books *)malloc(sizeof(struct books));\n  for (i = 1; i <= m; i++) {\n    if (i == 1)\n      head = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n    p2 = p1;\n    if (i != m) {\n      p1 = (struct books *)malloc(sizeof(struct books));\n      p2->next = p1;\n    } else\n      p2->next = NULL;\n  }\n  return head;\n}\n\nint main() {\n  int character[26];\n  struct books *head, *p;\n  int i, max = 0, imax;\n  for (i = 0; i < 26; i++)\n    character[i] = 0;\n  scanf(\"%d\", &m);\n  head = creat();\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      character[*(p->writer + i) - 'A']++;\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n  for (i = 0; i < 26; i++) {\n    if (character[i] > max) {\n      max = character[i];\n      imax = i;\n    }\n  }\n  cout << imax + 'A' << \"\\n\" << max << \"\\n\";\n  p = head;\n  while (1) {\n    i = 0;\n    while (*(p->writer + i)) {\n      if (*(p->writer + i) == imax + 'A') {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      i++;\n    }\n    p = p->next;\n    if (p == NULL)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3171", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, t[27], max;\n  char p, a[100][27], b[100][27];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 26; i++)\n    t[i] = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", a[i], b[i]);\n  for (p = 'A'; p <= 'Z'; p++)\n    for (i = 1; i <= n; i++)\n      if (strchr(b[i], p))\n        t[p - 'A' + 1]++;\n  max = 1;\n  for (i = 2; i <= 26; i++)\n    if (t[max] < t[i])\n      max = i;\n  printf(\"%c\\n\", p = 'A' + max - 1);\n  printf(\"%d\\n\", t[p - 'A' + 1]);\n  for (i = 1; i <= n; i++)\n    if (strchr(b[i], p))\n      printf(\"%s\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char w[27];\n  };\n  struct book b[1000];\n  int n, i, j, k, c[26] = {0}, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].w);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < strlen(b[j].w); k++) {\n        if (i == b[j].w[k]) {\n          c[i - 65]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[max])\n      max = i;\n  }\n  cout << max + 65 << \"\\n\";\n  cout << c[max] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(b[i].w); j++) {\n      if (b[i].w[j] == max + 65) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3173", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar f(int y);\n\nint main() {\n  int m, i, j, number[1000], auther[26], total = 0;\n  char name[1000][27];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &number[i], name[i]);\n    int n;\n    n = strlen(name[i]);\n    for (j = 0; j < n; j++) {\n      switch (name[i][j]) {\n      case 'A':\n        auther[0]++;\n        break;\n      case 'B':\n        auther[1]++;\n        break;\n      case 'C':\n        auther[2]++;\n        break;\n      case 'D':\n        auther[3]++;\n        break;\n      case 'E':\n        auther[4]++;\n        break;\n      case 'F':\n        auther[5]++;\n        break;\n      case 'G':\n        auther[6]++;\n        break;\n      case 'H':\n        auther[7]++;\n        break;\n      case 'I':\n        auther[8]++;\n        break;\n      case 'J':\n        auther[9]++;\n        break;\n      case 'K':\n        auther[10]++;\n        break;\n      case 'L':\n        auther[11]++;\n        break;\n      case 'M':\n        auther[12]++;\n        break;\n      case 'N':\n        auther[13]++;\n        break;\n      case 'O':\n        auther[14]++;\n        break;\n      case 'P':\n        auther[15]++;\n        break;\n      case 'Q':\n        auther[16]++;\n        break;\n      case 'R':\n        auther[17]++;\n        break;\n      case 'S':\n        auther[18]++;\n        break;\n      case 'T':\n        auther[19]++;\n        break;\n      case 'U':\n        auther[20]++;\n        break;\n      case 'V':\n        auther[21]++;\n        break;\n      case 'W':\n        auther[22]++;\n        break;\n      case 'X':\n        auther[23]++;\n        break;\n      case 'Y':\n        auther[24]++;\n        break;\n      case 'Z':\n        auther[25]++;\n        break;\n      }\n    }\n  }\n  int max = auther[0], k, t = 0;\n  for (k = 1; k < 26; k++) {\n    if (auther[k] > max) {\n      max = auther[k];\n      t = k;\n    }\n  }\n  printf(\"%c\\n\", f(t));\n  for (i = 0; i < m; i++) {\n    int q;\n    q = strlen(name[i]);\n    for (j = 0; j < q; j++) {\n      if (name[i][j] == f(t))\n        total++;\n    }\n  }\n  printf(\"%d\\n\", total);\n  for (i = 0; i < m; i++) {\n    int p;\n    p = strlen(name[i]);\n    for (j = 0; j < p; j++) {\n      if (name[i][j] == f(t))\n        printf(\"%d\\n\", number[i]);\n    }\n  }\n  return 0;\n}\n\nchar f(int y) {\n  char x;\n  switch (y) {\n  case 0:\n    x = 'A';\n    break;\n  case 1:\n    x = 'B';\n    break;\n  case 2:\n    x = 'C';\n    break;\n  case 3:\n    x = 'D';\n    break;\n  case 4:\n    x = 'E';\n    break;\n  case 5:\n    x = 'F';\n    break;\n  case 6:\n    x = 'G';\n    break;\n  case 7:\n    x = 'H';\n    break;\n  case 8:\n    x = 'I';\n    break;\n  case 9:\n    x = 'J';\n    break;\n  case 10:\n    x = 'K';\n    break;\n  case 11:\n    x = 'L';\n    break;\n  case 12:\n    x = 'M';\n    break;\n  case 13:\n    x = 'N';\n    break;\n  case 14:\n    x = 'O';\n    break;\n  case 15:\n    x = 'P';\n    break;\n  case 16:\n    x = 'Q';\n    break;\n  case 17:\n    x = 'R';\n    break;\n  case 18:\n    x = 'S';\n    break;\n  case 19:\n    x = 'T';\n    break;\n  case 20:\n    x = 'U';\n    break;\n  case 21:\n    x = 'V';\n    break;\n  case 22:\n    x = 'W';\n    break;\n  case 23:\n    x = 'X';\n    break;\n  case 24:\n    x = 'Y';\n    break;\n  case 25:\n    x = 'Z';\n    break;\n  }\n  return x;\n}\n"}
{"label": "2", "index": "3174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[26];\n  int length;\n} zz[999];\nint main() {\n  int n, i, j, k;\n  int letter[26] = {0};\n  int letter_book[26][999] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].id;\n    cin >> zz[i].writer;\n    zz[i].length = strlen(zz[i].writer);\n  }\n\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < zz[j].length; k++) {\n\n      letter_book[zz[j].writer[k] - 'A'][letter[zz[j].writer[k] - 'A']] =\n          zz[j].id;\n      letter[zz[j].writer[k] - 'A']++;\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      t = i;\n    }\n  }\n  char m;\n  m = 'A' + t;\n  cout << m << endl;\n  cout << max << endl;\n  for (i = 0; i < max; i++)\n    cout << letter_book[t][i] << endl;\n}\n"}
{"label": "2", "index": "3175", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char zz[32];\n  struct book *next;\n};\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->zz);\n  head = NULL;\n  for (i = 0; i < n - 1; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->zz;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid search(struct book *head, int n) {\n  int *p[26], i, j;\n  struct book *q = head;\n  for (i = 0; i < 26; i++) {\n    p[i] = (int *)malloc(sizeof(int));\n    *p[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      (*p[(q->zz)[j] - 'A'])++;\n    }\n    q = q->next;\n  }\n  q = head;\n  int max = *p[0], k = 0;\n  for (i = 1; i < 26; i++) {\n    if (*p[i] > max) {\n      max = *p[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d\", 'A' + k, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      if ((q->zz)[j] == 'A' + k) {\n        printf(\" %d\", q->num);\n      }\n    }\n    q = q->next;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat(n);\n  search(head, n);\n  return 0;\n}\n"}
{"label": "2", "index": "3176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[1000], i, j, a[26] = {0}, len, k, max, l = 0;\n  char x[1000][10];\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> num[i] >> x[i];\n  for (i = 0; i < n; i++) {\n    len = 0;\n    k = 0;\n    len = strlen(x[i]);\n    for (j = 0; j < len; j++) {\n      k = x[i][j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (j = 1; j < 26; j++) {\n    if (a[j] > max) {\n      max = a[j];\n      l = j;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 10; j++) {\n      if (x[i][j] == (l + 65))\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3177", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int book[1000], m, i, j, k, length, max = 0, name[500] = {0};\n  char writer[1000][26], name1;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i] >> writer[i];\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i < m; i++) {\n      length = strlen(writer[i]);\n      for (j = 0; j < length; j++)\n        if (writer[i][j] == k)\n          name[k]++;\n    }\n    if (name[k] > max) {\n      max = name[k];\n      name1 = k;\n    }\n  }\n  cout << name1 << endl;\n  cout << max << endl;\n  for (i = 0; i <= m; i++) {\n    length = strlen(writer[i]);\n    for (j = 0; j <= length; j++)\n      if (writer[i][j] == name1)\n        cout << book[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n} book[1000];\nint judge(char *a, int b);\nint main(int argc, char *argv[]) {\n  char c;\n  int n = 0, i = 0, j = 0, rec[26] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].name);\n  }                        \n  for (i = 0; i < 26; i++) \n  {\n    for (j = 0; j < n; j++) \n    {\n      if (judge(book[j].name, i) == 1) \n      {\n        rec[i]++;\n      }       \n    }         \n  }           \n  j = 0;      \n  k = rec[0]; \n  for (i = 0; i < 25; i++) {\n    if (k < rec[i]) {\n      j = i;\n      k = rec[i];\n    }\n  }\n  c = 'A' + j;\n  printf(\"%c\\n%d\\n\", c, k);\n  for (i = 0; i < n; i++) {\n    if (judge(book[i].name, j) == 1) {\n      printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\nint judge(char *a, int b) {\n  int i = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == 'A' + b)\n      return 1;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Bo {\n  int num;\n  char auth[30];\n} a[1010];\n\nint main() {\n  int n, i, j, maxnum = 0;\n  int zuozhe[26] = {0};\n  char out;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].auth);\n    for (j = 0; j <= strlen(a[i].auth) - 1; j++)\n      zuozhe[a[i].auth[j] - 'A'] = zuozhe[a[i].auth[j] - 'A'] + 1;\n  }\n  for (i = 1; i <= 25; i++)\n    if (zuozhe[i] > zuozhe[maxnum])\n      maxnum = i;\n  out = 'A' + maxnum;\n  cout << out << \"\\n\";\n  printf(\"%d\\n\", zuozhe[maxnum]);\n  for (i = 1; i <= n; i++) {\n    if (strchr(a[i].auth, out) != NULL)\n      printf(\"%d\\n\", a[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3180", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  int number;\n  char name[26];\n} author[999];\n\nstruct single {\n\n  char letter[1];\n  int number;\n\n} single[26];\n\nint main(int argc, char *argv[]) {\n  int n, i, m, j, p, k, book[999];\n  for (i = 0; i < 26; i++) {\n    single[i].letter[0] = 65 + i;\n    single[i].number = 0;\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> author[i].number >> author[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (single[k].letter[0] == author[i].name[j]) {\n          single[k].number++;\n        }\n      }\n    }\n  }\n  m = 0;\n  p = single[0].number;\n  for (i = 1; i < 26; i++) {\n    if (p < single[i].number) {\n      p = single[i].number;\n      m = i;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (author[i].name[j] == single[m].letter[0]) {\n        book[k] = author[i].number;\n        k++;\n      }\n    }\n  }\n  printf(\"%c\\n\", single[m].letter[0]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    char num[100], wri[26];\n  } bo[1000];\n  int i, j, l, n, m = 0, a[26] = {0}, mw;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", bo[i].num, bo[i].wri);\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      a[bo[i].wri[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i] > m) {\n      m = a[i];\n      mw = 65 + i;\n    }\n  cout << mw << \"\\n\" << m << \"\\n\";\n  for (i = 0; i < n; i++) {\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      if (bo[i].wri[j] == mw) {\n        puts(bo[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3182", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int bianhao;\n    char zuozhe[26];\n  };\n  int i, j, n, q = 0;\n  int count[26] = {0};\n  scanf(\"%d\", &n);\n  struct tushu *pp;\n  pp = (struct tushu *)malloc(sizeof(tushu) * n);\n  int *m;\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> ((pp + i)->bianhao) >> (pp + i)->zuozhe;\n  }\n  for (i = 0; i < n; i++) {\n    m[i] = strlen(pp[i].zuozhe);\n    for (j = 0; j < m[i]; j++)\n      count[pp[i].zuozhe[j] - 'A']++;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      q = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + q, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (pp[i].zuozhe[j] == ('A' + q))\n        printf(\"%d\\n\", pp[i].bianhao);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n  int s[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  struct book {\n    int a;\n    char name[27];\n  };\n  struct book list[999];\n  char c;\n  int n, i, j, b, maxnum = 0, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &list[i].a, list[i].name);\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      c = list[i].name[j];\n      b = c - 'A';\n      s[b]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] > maxnum) {\n      maxnum = s[i];\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max, maxnum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; list[i].name[j] != '\\0'; j++) {\n      if (list[i].name[j] - 'A' == max) {\n        printf(\"%d\\n\", list[i].a);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  };\n\n  scanf(\"%d\", &n);\n\n  struct data *input = (struct data *)malloc(sizeof(struct data) * n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &input[i].number, input[i].author);\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%d\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n\n  free(input);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct books {\n  int num;\n  char name[100];\n  struct books *next;\n};\nstruct books *create(int n) {\n  struct books *head, *p1, *p2;\n  p1 = (struct books *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  while (--n) {\n    p1 = (struct books *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  int n, i, max, k;\n  char *p;\n  int num[26] = {0};\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  struct books *p1, *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    p = p1->name;\n    do {\n\n      if (*p == name[i]) {\n        num[i]++;\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        if (*p == '\u0000') {\n          p1 = p1->next;\n          p = p1->name;\n        } else {\n          p++;\n        }\n      }\n    } while (p1 != NULL);\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= max) {\n      k = i;\n      max = num[i]; \n    }\n  }\n  printf(\"%c \", name[k]);\n  printf(\"%d \", num[k]);\n  p1 = head;\n  p = p1->name;\n  while (p1 != NULL) {\n\n    if (*p == name[k]) {\n      printf(\"%d \", p1->num);\n      p1 = p1->next;\n      p = p1->name;\n    } else {\n      if (*p == '\u0000') {\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        p++;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3186", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[400][400], t[400][400];\n  int n, m, i, j, k, l, p, y, z;\n  char c;\n  int a[30];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> t[i] >> s[i];\n  j = 0;\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    a[j] = p;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (m = j - 2; m >= i; m--) {\n      if (a[m] < a[m + 1]) {\n        y = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = y;\n      }\n    }\n  }\n  z = a[0];\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    if (p == z) {\n      printf(\"%c\\n\", c);\n      printf(\"%d\\n\", z);\n\n      for (k = 1; k <= n; k++) {\n        p = 0;\n        l = strlen(s[k]);\n        for (m = 0; m < l; m++) {\n          if (s[k][m] == c)\n            p++;\n        }\n        if (p > 0)\n          printf(\"%s\\n\", t[k]);\n      }\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "3187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct information {\n  int num;\n  char author[26];\n} * a;\nint main() {\n  int n, i, j, m, s[26] = {0}, max = 0, p;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].num, a[i].author);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      m = a[i].author[j] - 'A';\n      s[m]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < s[i]) {\n      max = s[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + p, s[p]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == 'A' + p) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint trans(char k) {\n  int i;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\nint main() {\n  struct books {\n    int n;\n    char w[27];\n  } * m;\n  int num, i, j;\n  scanf(\"%d\", &num);\n  m = (struct books *)malloc(sizeof(struct books) * num);\n  for (i = 0; i < num; i++) {\n\n    int N;\n    char W[27];\n    scanf(\"%d %s\", &N, W);\n    m[i].n = N;\n    strcpy(m[i].w, W);\n  }\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\n      c;\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      c = trans(m[i].w[j]);\n      b[c]++;\n    }\n  }\n  int max = 0;\n  char most;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      most = 'A' + i;\n    }\n  }\n  cout << most << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      if (m[i].w[j] == most)\n        printf(\"%d\\n\", m[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int No;\n    char author[27];\n    int yes;\n    struct book *next;\n  };\n  struct book *head, *p;\n  int m, i, *max;\n  int *count;\n  count = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(count + i) = 0;\n\n  p = (struct book *)malloc(sizeof(struct book));\n  head = p;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> p->No >> p->author;\n    if (i == m - 1)\n      p->next = NULL;\n    else\n      p->next = (struct book *)malloc(sizeof(struct book));\n    p = p->next;\n  }\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      (*(count + ((*point) - 65)))++;\n      point++;\n    }\n    p = p->next;\n  }\n\n  max = count;\n  for (i = 0; i < 26; i++)\n    if (*(count + i) > *max)\n      max = count + i;\n  printf(\"%c\\n\", max - count + 65);\n  printf(\"%d\\n\", *max);\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      if (*point == max - count + 65)\n        printf(\"%d\\n\", p->No);\n      point++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3190", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct shu {\n  int num;\n  char a[26];\n  struct shu *next;\n};\nint main() {\n  char ma = 'A';\n  struct shu *p1, *p2;\n  struct shu *head, *p;\n  int cnt[128] = {0};\n  int i, j, n, m;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct shu *)malloc(1000);\n  cin >> p1->num >> p1->a;\n  m = strlen(p1->a);\n  for (j = 0; j < m; j++) {\n    if (++cnt[p1->a[j]] > cnt[ma])\n      ma = p1->a[j];\n  }\n  head = NULL;\n  for (i = 1; i < n; i++) {\n    if (i == 1) {\n      head = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct shu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->a);\n    m = strlen(p1->a);\n    for (j = 0; j < m; j++) {\n      if (++cnt[p1->a[j]] > cnt[ma])\n        ma = p1->a[j];\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p = head;\n  printf(\"%c %d \", ma, cnt[ma]);\n  while (p != NULL) {\n    m = strlen(p->a);\n    for (i = 0; i < m; i++) {\n      if (p->a[i] == ma) {\n        printf(\"%d \", p->num);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3191", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, number, i, j, k, t, len, max;\n  int map[26][1000] = {0};\n  char name[27];\n\n  cin >> n;\n  for (i = 0; i <= 25; i++)\n    map[i][0] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> number >> name;\n    len = strlen(name);\n    for (j = 0; j <= len - 1; j++) {\n      k = name[j] - 'A';\n      map[k][0]++;\n      t = map[k][0];\n      map[k][t] = number;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++) {\n    if (map[i][0] > max) {\n      max = map[i][0];\n      k = i;\n    }\n  }\n  cout << (char)(65 + k) << endl;\n  cout << map[k][0];\n  for (i = 1; i <= map[k][0]; i++) {\n    cout << endl << map[k][i];\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char w[26];\n} b[999];\nint main() {\n  int m, i, j, k, e;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].w;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26] = {0};\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < m; i++) {\n      e = strlen(b[i].w);\n      for (k = 0; k < e; k++)\n        if (b[i].w[k] == a[j])\n          c[j]++;\n    }\n  }\n  int sum = 0;\n  for (j = 0; j < 26; j++)\n    if (c[j] > c[sum])\n      sum = j;\n  printf(\"%c\\n\", a[sum]);\n  printf(\"%d\\n\", c[sum]);\n  for (i = 0; i < m; i++) {\n    e = strlen(b[i].w);\n    for (k = 0; k < e; k++)\n      if (b[i].w[k] == a[sum])\n        printf(\"%d\\n\", b[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct x {\n  int num;\n  char author[26];\n  int amount;\n};\nint main() {\n  struct x y[999];\n  int i, j, m, max = 0, max_ = 0;\n  int k;\n  int amount[91] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &y[i].num, y[i].author);\n    y[i].amount = strlen(y[i].author);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      for (k = 'A'; k < 'Z'; k++) {\n        if (k = y[i].author[j]) {\n          amount[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i < 'Z'; i++) {\n    if (max < amount[i]) {\n      max = amount[i];\n      max_ = i;\n    }\n  }\n  printf(\"%c\\n\", max_);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < y[i].amount; j++) {\n      if (y[i].author[j] == max_)\n        printf(\"%d\\n\", y[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int bianhao;\n    char zuozhe[100];\n  } a[1000];\n  int i, j, n, l, max;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].bianhao, a[i].zuozhe);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      b[a[i].zuozhe[j] - 65]++;\n  max = b[0];\n  l = 0;\n  for (i = 1; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      l = i;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].zuozhe[j] != '\\0'; j++)\n      if (a[i].zuozhe[j] == (l + 65)) {\n        printf(\"%d\\n\", a[i].bianhao);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book {\n    int booknumber;\n    char writer[27];\n  } book[999];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].booknumber, book[i].writer);\n  }\n  int writerbookquantity[26];\n  for (i = 0; i < 26; i++)\n    writerbookquantity[i] = 0;\n  int j, len, x;\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      x = book[i].writer[j] - 'A';\n      writerbookquantity[x]++;\n    }\n  }\n  int maxwriter = 0, maxquantity = 0;\n  for (i = 0; i < 26; i++) {\n    if (writerbookquantity[i] > maxquantity) {\n      maxquantity = writerbookquantity[i];\n      maxwriter = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(maxwriter + 'A'), writerbookquantity[maxwriter]);\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      if ((int)book[i].writer[j] == maxwriter + 'A')\n        cout << book[i].booknumber << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, num[1000], m, a[1000][26], k, sum[26], max = 0, b;\n  char writer[1000][26],\n      letter[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &m);\n  for (k = 0; k < 26; k++) {\n    sum[k] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      a[i][j] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &num[i], writer[i]);\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (writer[i][j] == letter[k]) {\n          a[i][k]++;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      sum[k] = sum[k] + a[i][k];\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (max < sum[k]) {\n      max = sum[k];\n      b = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[b], max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (writer[i][j] == letter[b])\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[1000], a[26], b, c, num = 0;\n  char s[1000][26];\n  for (i = 0; i < 25; i++)\n    a[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> s[i];\n    for (j = 0; s[i][j] != '\\0'; j++)\n      a[(int)s[i][j] - 65]++;\n  }\n  b = a[0];\n  c = 0;\n  for (i = 1; i < 26; i++)\n    if (b < a[i]) {\n      b = a[i];\n      c = i;\n    }\n  cout << (char)(c + 65) << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65) {\n        num++;\n      }\n  cout << num << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65) {\n        cout << x[i] << endl;\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char writer[26];\n  int length;\n} zz[999];\nint main() {\n  int n, i, j, k;\n  int letter[26] = {0};\n  int letter_book[26][999] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].id;\n    cin >> zz[i].writer;\n    zz[i].length = strlen(zz[i].writer);\n  }\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < zz[j].length; k++) {\n\n      letter_book[zz[j].writer[k] - 'A'][letter[zz[j].writer[k] - 'A']] =\n          zz[j].id;\n      letter[zz[j].writer[k] - 'A']++;\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      t = i;\n    }\n  }\n  char m;\n  m = 'A' + t;\n  cout << m << endl;\n  cout << max << endl;\n  for (i = 0; i < max; i++)\n    cout << letter_book[t][i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, x, maxnumber;\n  scanf(\"%d\", &m);\n  int booknum[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &booknum[i], k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j < strlen(k[i]); j++)\n      if (k[i][j] == who) {\n        printf(\"%d\\n\", booknum[i]);\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char num[4];\n  char author[26];\n} book[999];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a;\n  char c;\n  int max = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %s\", &book[i].num, book[i].author);\n  }\n  int s[26];\n  for (i = 0; i <= 25; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (0 <= (book[i].author[j] - 'A') && (book[i].author[j] - 'A') <= 25) {\n        a = book[i].author[j] - 'A';\n        s[a] = s[a] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i <= 25; i++) {\n    if (max < s[i]) {\n      max = s[i];\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (max == s[i]) {\n      c = 'A' + i;\n    }\n  }\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (book[i].author[j] == c) {\n        printf(\"%s\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char id[11];\n  char name[30];\n};\nstruct au {\n  int num;\n  char id[1000][11];\n};\nint main() {\n  struct book b;\n  struct au a[26];\n  int n, i, j = 0, k;\n  char c;\n  for (i = 0; i < 26; i++)\n    a[i].num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", b.id, b.name);\n    while (b.name[j] != '\\0') {\n      k = b.name[j] - 'A';\n      strcpy(a[k].id[a[k].num], b.id);\n      a[k].num++;\n      j++;\n    }\n    j = 0;\n  }\n  k = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    j = (a[i].num > k) ? i : j;\n    k = (a[i].num > k) ? a[i].num : k;\n  }\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[j].id[i]);\n}\n"}
{"label": "2", "index": "3202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[26] = {0};\n  char c;\n  struct books {\n    int number;\n    char name[27];\n  };\n  struct books book[1000];\n  int n, i, j, t, max = 0;\n  struct books *p;\n  scanf(\"%d\", &n);\n  for (p = book; p < book + n; p++)\n    scanf(\"%d%s\", &p->number, p->name);\n  for (p = book; p < book + n; p++)\n    for (j = 0; j < 26; j++)\n      for (i = 65; i <= 90; i++)\n        if (p->name[j] == i)\n          x[i - 65]++;\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max)\n      break;\n  c = i + 65;\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (book[i].name[j] == c) {\n        printf(\"%d\\n\", book[i].number);\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0;\n  char w;\n  scanf(\"%d \", &m);\n  for (int i = 1; i <= m; i++) {\n    cin >> b;\n    book[i][26] = b;\n    cin.get();\n    while ((w = cin.get()) != '\\n') {\n      writer[w - 'A']++;\n      book[i][w - 'A'] = 1;\n    }\n  }\n  for (int i = 1; i < 26; i++)\n    if (writer[max] < writer[i])\n      max = i;\n  cout << (char)(max + 'A') << endl;\n  cout << writer[max] << \"\\n\";\n  for (int i = 1; i <= m; i++)\n    if (book[i][max])\n      cout << book[i][26] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld %s\", &p1->num, p1->str);\n  n = 1;\n  head = 0;\n  while (n < m) {\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->str;\n    n = n + 1;\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 'A' + 1]++;\n    }\n  }\n  max = sum[1];\n  x = 1;\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 'A' - 1) {\n        a[y] = p->num;\n        y++;\n        t = strlen(p->str) + 1;\n      }\n  }\n  printf(\"%c %d \", x + 64, max);\n  for (y = 1; y <= max; y++)\n    printf(\"%d \", a[y]);\n}\n"}
{"label": "2", "index": "3205", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int m, i, j, len, max;\n  int id[1000], b[26] = {0};\n  char a[100][27], name;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &id[i], a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      b[a[i][j] - 'A']++;\n    }\n  }\n  max = b[0];\n  name = 'A';\n  for (j = 1; j < 26; j++) {\n    if (b[j] > max) {\n      max = b[j];\n      name = j + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < m; i++) {\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == name) {\n        strcpy(a[i], \"shuchu\");\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(a[i], \"shuchu\") == 0)\n      printf(\"%d\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, b[999], max = 0, a[27], x;\n  char w, c[999][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n  }\n  for (i = 0; i < 27; i++) {\n    a[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 65; k < 91; k++) {\n        if (c[i][j] == k)\n          a[k - 64]++;\n      }\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  w = x + 64;\n  cout << w << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (c[i][j] == x + 64) {\n        cout << b[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3207", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t = 0, c = 0;\n  int A[25];\n  char g[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct point {\n    int a;\n    char s[80];\n  } tope[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> tope[i].a >> tope[i].s;\n  }\n  for (k = 0; k < 26; k++) {\n    A[k] = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; tope[i].s[j] != '\\0'; j++) {\n        if (tope[i].s[j] == g[k]) {\n          A[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (A[i] > t) {\n      t = A[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", g[c], t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; tope[i].s[j] != '\\0'; j++) {\n      if (tope[i].s[j] == g[c]) {\n        printf(\"%d\\n\", tope[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct writer {\n    int sum;\n    char c;\n  } lit[26] = {0,   'A', 0,   'B', 0,   'C', 0,   'D', 0,   'E', 0,   'F', 0,\n               'G', 0,   'H', 0,   'I', 0,   'J', 0,   'K', 0,   'L', 0,   'M',\n               0,   'N', 0,   'O', 0,   'P', 0,   'Q', 0,   'R', 0,   'S', 0,\n               'T', 0,   'U', 0,   'V', 0,   'W', 0,   'X', 0,   'Y', 0,   'Z'};\n  struct book {\n    int id;\n    char name[26];\n  } data[1000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &data[i].id, &data[i].name);\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (data[i].name[j] == lit[k].c)\n          lit[k].sum++;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (lit[i].sum < lit[i - 1].sum) {\n      struct writer tmp;\n      tmp = lit[i - 1];\n      lit[i - 1] = lit[i];\n      lit[i] = tmp;\n    }\n  }\n  printf(\"%c\\n%d\\n\", lit[25].c, lit[25].sum);\n  for (i = 0; i < n; i++) {\n    for (j = 0; data[i].name[j] != '\\0'; j++) {\n      if (data[i].name[j] == lit[25].c)\n        printf(\"%d\\n\", data[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char author[26];\n};\n\nchar maxbook(int a[]) {\n  int i, j, bookmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (bookmax < a[i]) {\n      bookmax = a[i];\n      j = i;\n    }\n  }\n  cout << 'A' + j << \"\\n\" << bookmax << \"\\n\";\n  return 'A' + j;\n}\n\nint contain(char author[], char max) {\n  char *c = author;\n  while (*c) {\n    if (*c == max)\n      return 1;\n    c++;\n  }\n  return 0;\n}\n\nint main() {\n  struct BOOK book[1000];\n  int m, i, j;\n  char c, max;\n  int AtoZ[26] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n    getchar();\n    j = 0;\n    while ((c = getchar()) != '\\n') {\n      book[i].author[j] = c;\n      AtoZ[c - 'A']++;\n      j++;\n    }\n    book[i].author[j] = '\\0';\n  }\n  max = maxbook(AtoZ);\n  for (i = 0; i < m; i++) {\n    if (contain(book[i].author, max))\n      printf(\"%d\\n\", book[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0};\n  int n, i, j, temp;\n  unsigned long len;\n  char author[27], temp2, book[27][1000] = {'\\0'};\n  char str[4];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> str;\n    cin.get();\n    cin.getline(author, 27);\n    len = strlen(author);\n    for (j = 0; j < len; j++) {\n      num[author[j] - 'A']++;\n      strncat(book[author[j] - 'A'], str, 3);\n    }\n  }\n  temp = 0;\n  for (j = 0; j < 26; j++) {\n    if (num[j] > temp) {\n      temp = num[j];\n      temp2 = j + 'A';\n    }\n  }\n  cout << temp2 << endl << temp << endl;\n  for (j = 0; j < temp; j++) {\n    for (i = 0; i < 3; i++) {\n      cout << book[temp2 - 'A'][j * 3 + i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book {\n    int booknumber;\n    char writer[27];\n  } book[999];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> book[i].booknumber >> book[i].writer;\n  }\n  int writerbookquantity[26];\n  for (i = 0; i < 26; i++)\n    writerbookquantity[i] = 0;\n  int j, len, x;\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      x = book[i].writer[j] - 'A';\n      writerbookquantity[x]++;\n    }\n  }\n  int maxwriter = 0, maxquantity = 0;\n  for (i = 0; i < 26; i++) {\n    if (writerbookquantity[i] > maxquantity) {\n      maxquantity = writerbookquantity[i];\n      maxwriter = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (char)(maxwriter + 'A'), writerbookquantity[maxwriter]);\n  for (i = 0; i < n; i++) {\n    len = strlen(book[i].writer);\n    for (j = 0; j < len; j++) {\n      if ((int)book[i].writer[j] == maxwriter + 'A')\n        printf(\"%d\\n\", book[i].booknumber);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3212", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, w = 0;\n  int maxzm, maxbk = 0;\n  char c1;\n  int zimu[26] = {0};\n  int lm[100];\n  struct {\n    int num;\n    char a[100];\n  } book[1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> book[i].num >> book[i].a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      for (k = 65; k < 91; k++) {\n        if (book[i].a[j] == k)\n          zimu[k - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > maxbk) {\n      maxbk = zimu[i];\n      maxzm = i;\n    }\n  }\n  c1 = maxzm + 65;\n  printf(\"%c\\n\", c1);\n  printf(\"%d\\n\", maxbk);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].a[j]; j++) {\n      if (book[i].a[j] == c1) {\n        lm[w] = book[i].num;\n        w++;\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%d\\n\", lm[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j;\n  char a = 'A';\n  int count[27] = {0};\n  int *p = &count[1];\n  scanf(\"%d\", &num);\n  struct book {\n    char order[4];\n    char author[26];\n  } book[1000];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].order);\n    scanf(\"%s\", book[i].author);\n  }\n  for (i = 0; i < num; i++) {\n    int m = strlen(book[i].author);\n    for (j = 0; j < m; j++) {\n      if (book[i].author[j] == 'A')\n        count[1]++;\n      if (book[i].author[j] == 'B')\n        count[2]++;\n      if (book[i].author[j] == 'C')\n        count[3]++;\n      if (book[i].author[j] == 'D')\n        count[4]++;\n      if (book[i].author[j] == 'E')\n        count[5]++;\n      if (book[i].author[j] == 'F')\n        count[6]++;\n      if (book[i].author[j] == 'G')\n        count[7]++;\n      if (book[i].author[j] == 'H')\n        count[8]++;\n      if (book[i].author[j] == 'I')\n        count[9]++;\n      if (book[i].author[j] == 'J')\n        count[10]++;\n      if (book[i].author[j] == 'K')\n        count[11]++;\n      if (book[i].author[j] == 'L')\n        count[12]++;\n      if (book[i].author[j] == 'M')\n        count[13]++;\n      if (book[i].author[j] == 'N')\n        count[14]++;\n      if (book[i].author[j] == 'O')\n        count[15]++;\n      if (book[i].author[j] == 'P')\n        count[16]++;\n      if (book[i].author[j] == 'Q')\n        count[17]++;\n      if (book[i].author[j] == 'R')\n        count[18]++;\n      if (book[i].author[j] == 'S')\n        count[19]++;\n      if (book[i].author[j] == 'T')\n        count[20]++;\n      if (book[i].author[j] == 'U')\n        count[21]++;\n      if (book[i].author[j] == 'V')\n        count[22]++;\n      if (book[i].author[j] == 'W')\n        count[23]++;\n      if (book[i].author[j] == 'X')\n        count[24]++;\n      if (book[i].author[j] == 'Y')\n        count[25]++;\n      if (book[i].author[j] == 'Z')\n        count[26]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (count[i] > *p) {\n      p = &count[i];\n      a = i + 64;\n    }\n  }\n  cout << a << \"\\n\" << *p << \"\\n\";\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == a)\n        printf(\"%s\\n\", book[i].order);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int No;\n    char name[27];\n  } b[1000];\n  int i, j, m;\n  scanf(\"%d\", &m);\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i].No);\n    scanf(\"%s\", b[i].name);\n  }\n  int n, l, a[26] = {0};\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      n = b[i].name[j];\n      a[n - 65]++;\n    }\n  }\n  int max = 0, x;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      x = i;\n    }\n  }\n  printf(\"%c\\n%d\", x + 65, max);\n  for (i = 0; i < m; i++) {\n    l = strlen(b[i].name);\n    for (j = 0; j < l; j++) {\n      if (b[i].name[j] == x + 65) {\n        cout << \"\\n\" << b[i].No;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d\", &p1->num);\n  scanf(\"%s\", p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d\", &p1->num);\n    scanf(\"%s\", p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head;\n  struct student *p1;\n  char *p2;\n  int i;\n  int a[26];\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == 'A') {\n        a[0] = a[0] + 1;\n      }\n      if ((*p2) == 'B') {\n        a[1] = a[1] + 1;\n      }\n      if ((*p2) == 'C') {\n        a[2] = a[2] + 1;\n      }\n      if ((*p2) == 'D') {\n        a[3] = a[3] + 1;\n      }\n      if ((*p2) == 'E') {\n        a[4] = a[4] + 1;\n      }\n      if ((*p2) == 'F') {\n        a[5] = a[5] + 1;\n      }\n      if ((*p2) == 'G') {\n        a[6] = a[6] + 1;\n      }\n      if ((*p2) == 'H') {\n        a[7] = a[7] + 1;\n      }\n      if ((*p2) == 'I') {\n        a[8] = a[8] + 1;\n      }\n      if ((*p2) == 'J') {\n        a[9] = a[9] + 1;\n      }\n      if ((*p2) == 'K') {\n        a[10] = a[10] + 1;\n      }\n      if ((*p2) == 'L') {\n        a[11] = a[11] + 1;\n      }\n      if ((*p2) == 'M') {\n        a[12] = a[12] + 1;\n      }\n      if ((*p2) == 'N') {\n        a[13] = a[13] + 1;\n      }\n      if ((*p2) == 'O') {\n        a[14] = a[14] + 1;\n      }\n      if ((*p2) == 'P') {\n        a[15] = a[15] + 1;\n      }\n      if ((*p2) == 'Q') {\n        a[16] = a[16] + 1;\n      }\n      if ((*p2) == 'R') {\n        a[17] = a[17] + 1;\n      }\n      if ((*p2) == 'S') {\n        a[18] = a[18] + 1;\n      }\n      if ((*p2) == 'T') {\n        a[19] = a[19] + 1;\n      }\n      if ((*p2) == 'U') {\n        a[20] = a[20] + 1;\n      }\n      if ((*p2) == 'V') {\n        a[21] = a[21] + 1;\n      }\n      if ((*p2) == 'W') {\n        a[22] = a[22] + 1;\n      }\n      if ((*p2) == 'X') {\n        a[23] = a[23] + 1;\n      }\n      if ((*p2) == 'Y') {\n        a[24] = a[24] + 1;\n      }\n      if ((*p2) == 'Z') {\n        a[25] = a[25] + 1;\n      }\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  int j, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  cout << j + 65 << \" \";\n  printf(\"%d \", a[j]);\n  p1 = head;\n  do {\n    p2 = p1->name;\n    for (; (*p2) != '\u0000'; p2++) {\n      if ((*p2) == j + 65)\n        printf(\"%d \", p1->num);\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n}\n"}
{"label": "2", "index": "3216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char str[30];\n  } bk[1000] = {0};\n  int i, j, m, n, sum[100] = {0}, number[1000] = {0}, result, max = 0;\n  char temp = 'A';\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, &bk[i].str);\n  for (i = 65; i <= 90; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++)\n        if (bk[j].str[n] == i)\n          sum[i]++;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (sum[j + 65] > max) {\n      max = sum[j + 65];\n      temp = j + 65;\n      result = j + 65;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (n = 0; n < 30; n++)\n      if (bk[i].str[n] == temp) {\n        number[i] = bk[i].num;\n        break;\n      }\n  }\n  printf(\"%c\\n%d\\n\", temp, sum[result]);\n  for (i = 0; i < m; i++)\n    if (number[i] != 0)\n      printf(\"%d\\n\", number[i]);\n}\n"}
{"label": "2", "index": "3217", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][26], t;\n  int b[1000], num[26] = {0}, n, i, j, max, l[1000];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b[i]);\n\n    cin >> a[i];\n    l[i] = strlen(a[i]);\n    for (j = 1; j <= l[i]; j++)\n      num[a[i][j] - 'A']++;\n  }\n  for (i = 0; i <= 25; i++)\n    if (num[i] > max) {\n      max = num[i];\n      t = i + 'A';\n    }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= l[i]; j++)\n      if (a[i][j] == t)\n        cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char a[100];\n  };\n  struct book b[1000];\n  int n, i, j, s, t = 0, m, h;\n  int c[1000];\n  char d[27];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].a);\n  d[0] = b[0].a[0];\n  t = 1;\n  c[0] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      int x = 0;\n      for (s = 0; s < t; s++) {\n        if (b[i].a[j] == d[s]) {\n          c[s] = c[s] + 1;\n          x = 0;\n          break;\n        } else\n          x = 1;\n      }\n      if (x == 1) {\n        t++;\n        d[t - 1] = b[i].a[j];\n        c[t - 1] = 1;\n      }\n    }\n  }\n  m = c[0];\n  h = 0;\n  for (i = 0; i < t; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", d[h], m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[i].a[j] != 0; j++) {\n      if (b[i].a[j] == d[h]) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c;\n  int max = 0, store, m, i, x[26][1000] = {0}, coun[27] = {0}, flag;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &store);\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c < 65 || c > 90)\n        break;\n      else {\n        x[c - 64][i] = store;\n        coun[c - 64]++;\n      }\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (coun[i] > max) {\n      max = coun[i];\n      flag = i + 64;\n    }\n  }\n  printf(\"%c\\n\", flag);\n  printf(\"%d\\n\", coun[flag - 64]);\n  for (i = 1; i <= 1000; i++) {\n    if (x[flag - 64][i] != 0)\n      printf(\"%d\\n\", x[flag - 64][i]);\n  }\n}\n"}
{"label": "2", "index": "3220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[1000], d[1000], e[30] = {0};\n  int i, j, k, n, t = 0, max;\n  char c[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], c[i]);\n    d[i] = (int)strlen(c[i]);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (c[i][j] == k + 65)\n          e[k] = e[k] + 1;\n  max = e[0];\n  for (k = 1; k < 26; k++) {\n    if (e[k] > max) {\n      t = k;\n      max = e[k];\n    }\n  }\n\n  printf(\"%c\\n\", t + 65);\n  printf(\"%d\\n\", e[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      if (c[i][j] == t + 65)\n        printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "2", "index": "3221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint m;\nstruct book *head;\n\nstruct book *setup() {\n  int t = 0;\n  struct book *head, *p1, *p2;\n  head = p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (t < m - 1) {\n    t++;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->name;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint k = 0, max_1 = 0;\nvoid found(struct book *p) {\n  int i, j;\n  p = head;\n  int *pi;\n  pi = (int *)malloc(sizeof(int) * 26);\n  for (i = 0; i < 26; i++)\n    *(pi + i) = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      (*(pi + (p->name[j] - 'A')))++;\n\n    p = p->next;\n  }\n  for (j = 0; j < 26; j++) {\n    if (*(pi + j) > max_1) {\n      max_1 = *(pi + j);\n      k = j;\n    }\n  }\n}\nint main() {\n  int i, j;\n  scanf(\"%d\", &m);\n  struct book *p;\n  head = p = setup();\n  found(p);\n  printf(\"%c %d \", (k + 'A'), max_1);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      if (p->name[j] == k + 'A') {\n        printf(\"%d \", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int a;\n    char s[26];\n  } zuozhe[1000];\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &zuozhe[i].a, zuozhe[i].s);\n  }\n  int c[26] = {0}, d;\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      c[zuozhe[i].s[k] - 65]++;\n    }\n  }\n  int f;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[0]) {\n      f = i;\n      d = c[i];\n      c[i] = c[0];\n      c[0] = d;\n    }\n  }\n  cout << f + 65 << \"\\n\" << c[0] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      if (zuozhe[i].s[k] == f + 65)\n        printf(\"%d\\n\", zuozhe[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3223", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int code;\n  char author[20];\n};\nstruct letter {\n  char let;\n  int count;\n};\n\nint main() {\n  int n, i, j, k, t, max;\n  struct data a[100];\n  struct letter l[26];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].code);\n\n    cin >> a[i].author;\n  }\n  for (i = 0; i < 26; i++) {\n    l[i].let = i + 65;\n    l[i].count = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].author[j] == l[k].let)\n          l[k].count++;\n      }\n    }\n  }\n  max = 0;\n  for (k = 0; k < 26; k++) {\n    if (l[k].count > max) {\n      max = l[k].count;\n      t = k;\n    }\n  }\n\n  printf(\"%c \", l[t].let);\n  printf(\"%d \", l[t].count);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; a[i].author[j] != '\u0000'; j++) {\n      if (a[i].author[j] == l[t].let)\n        printf(\"%d \", a[i].code);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3224", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, num[1000], m, a[1000][26], k, sum[26], max = 0, b;\n  char writer[1000][26],\n      letter[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> m;\n  for (k = 0; k < 26; k++) {\n    sum[k] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      a[i][j] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> writer[i];\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < 26; j++) {\n        if (writer[i][j] == letter[k]) {\n          a[i][k]++;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < m; i++) {\n      sum[k] = sum[k] + a[i][k];\n    }\n  }\n  for (k = 0; k < 26; k++) {\n    if (max < sum[k]) {\n      max = sum[k];\n      b = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[b], max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (writer[i][j] == letter[b]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char edt[27];\n};\nstruct total \n{\n  char name;\n  int amount;\n};\nint main() {\n  int m, i, j, k;\n  struct book bk[1000];\n  struct total to[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].edt);\n  for (i = 0; i < 26; i++) {\n    to[i].name = 'A' + i; \n    to[i].amount = 0;\n  }\n  \n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++) {\n      for (k = 0; k < 26; k++) {\n        if (bk[i].edt[j] == to[k].name)\n          to[k].amount++;\n      }\n    }\n  }\n  \n  for (i = k = 0; i < 26; i++) {\n    if (to[i].amount > to[k].amount)\n      k = i;\n  }\n  printf(\"%c\\n%d\\n\", to[k].name, to[k].amount);\n  \n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++)\n      if (bk[i].edt[j] == to[k].name)\n        printf(\"%d\\n\", bk[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3226", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct jisuan {\n  int num;\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, m, n, k, e;\n  int count[26] = {0}, author[26];\n  cin >> m;\n  for (i = 0; i < 26; i++)\n    author[i] = 65 + i;\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num;\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      e = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = e;\n      e = author[i];\n      author[i] = author[i + 1];\n      author[i + 1] = e;\n    }\n  }\n  printf(\"%c %d \", author[25], count[25]);\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == author[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, b[26], p, max, j, c;\n  scanf(\"%d\", &m);\n  struct point {\n    int n;\n    char s[26];\n  } a[999];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &a[i].n, a[i].s);\n  }\n  for (i = 0; i < 26; i++) {\n    b[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == 'A')\n        b[0]++;\n      else if (a[i].s[j] == 'B')\n        b[1]++;\n      else if (a[i].s[j] == 'C')\n        b[2]++;\n      else if (a[i].s[j] == 'D')\n        b[3]++;\n      else if (a[i].s[j] == 'E')\n        b[4]++;\n      else if (a[i].s[j] == 'f')\n        b[5]++;\n      else if (a[i].s[j] == 'G')\n        b[6]++;\n      else if (a[i].s[j] == 'H')\n        b[7]++;\n      else if (a[i].s[j] == 'I')\n        b[8]++;\n      else if (a[i].s[j] == 'J')\n        b[9]++;\n      else if (a[i].s[j] == 'K')\n        b[10]++;\n      else if (a[i].s[j] == 'L')\n        b[11]++;\n      else if (a[i].s[j] == 'M')\n        b[12]++;\n      else if (a[i].s[j] == 'N')\n        b[13]++;\n      else if (a[i].s[j] == 'O')\n        b[14]++;\n      else if (a[i].s[j] == 'P')\n        b[15]++;\n      else if (a[i].s[j] == 'Q')\n        b[16]++;\n      else if (a[i].s[j] == 'R')\n        b[17]++;\n      else if (a[i].s[j] == 'S')\n        b[18]++;\n      else if (a[i].s[j] == 'T')\n        b[19]++;\n      else if (a[i].s[j] == 'U')\n        b[20]++;\n      else if (a[i].s[j] == 'V')\n        b[21]++;\n      else if (a[i].s[j] == 'W')\n        b[22]++;\n      else if (a[i].s[j] == 'X')\n        b[23]++;\n      else if (a[i].s[j] == 'Y')\n        b[24]++;\n      else if (a[i].s[j] == 'Z')\n        b[25]++;\n    }\n  }\n  p = 0;\n  max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      p = i;\n      max = b[i];\n    }\n  }\n  c = (p + 'A');\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; a[i].s[j] != '\\0'; j++) {\n      if (a[i].s[j] == (p + 'A'))\n        cout << a[i].n << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int num;\n  char w[26];\n\n} book[999], test[1];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, n, s;\n  char x, c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].w;\n  }\n\n  x = 'A';\n  n = 0;\n  c = 'A';\n  while (1) {\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < strlen(book[i].w); j++) {\n        if (book[i].w[j] == x) {\n          s++;\n        }\n      }\n    }\n\n    if (s > n) {\n      n = s;\n      c = x;\n    }\n    if (x == 'Z') {\n      break;\n    }\n    x++;\n  }\n  printf(\"%c\\n%d\\n\", c, n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].w); j++) {\n      if (book[i].w[j] == c) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3229", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char book[1000][30];\n  int n, i, j, k, r, len[1000], a[26][1000] = {0}, b[26] = {0}, max, s, c[26];\n  cin >> n;\n  for (i = 0; i <= n; i++) {\n\n    cin >> book[i];\n    cin;\n  }\n  for (i = 0; i <= n; i++)\n    for (j = 0; book[i][j] != ' '; j++)\n      len[i] = j;\n  for (k = 0; k < 26; k++) {\n    r = 0;\n    for (i = 0; i <= n; i++) {\n      for (j = len[i] + 1; j < strlen(book[i]); j++) {\n        if (book[i][j] == k + 65) {\n          b[k]++;\n          a[k][r] = i;\n          r++;\n        }\n      }\n    }\n    c[k] = r;\n  }\n  max = b[0];\n  for (i = 1; i < 26; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n      s = i;\n    }\n  }\n  printf(\"%c\\n\", s + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < c[s]; i++) {\n    for (j = 0; j <= len[a[s][i]]; j++)\n      printf(\"%c\", book[a[s][i]][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3230", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n  struct book *next;\n};\nint main() {\n  int n, i, j, a[26] = {0}, max, temp;\n  char c;\n  struct book *p, *head, *tail;\n  cin >> n;\n  head = NULL;\n  tail = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p->num, p->writer);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n  }\n  for (c = 'A'; c <= 'Z'; c++) {\n    for (i = 0, p = head; i < n; i++, p = p->next) {\n      for (j = 0; p->writer[j] != '\u0000'; j++)\n        if (p->writer[j] == c)\n          a[c - 'A']++;\n    }\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max)\n      break;\n  c = i + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", a[i]);\n  for (i = 0, p = head; i < n; i++, p = p->next) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == c) {\n        printf(\"%d \", p->num);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t = 0, c = 0;\n  int A[25];\n  char g[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct point {\n    int a;\n    char s[80];\n  } tope[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> tope[i].a >> tope[i].s;\n  }\n  for (k = 0; k < 26; k++) {\n    A[k] = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; tope[i].s[j] != '\\0'; j++) {\n        if (tope[i].s[j] == g[k]) {\n          A[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (A[i] > t) {\n      t = A[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", g[c], t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; tope[i].s[j] != '\\0'; j++) {\n      if (tope[i].s[j] == g[c]) {\n        printf(\"%d\\n\", tope[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t[27], max;\n  char p, a[100][27], b[100][27];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 26; i++)\n    t[i] = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", a[i], b[i]);\n  for (p = 'A'; p <= 'Z'; p++)\n    for (i = 1; i <= n; i++)\n      if (strchr(b[i], p))\n        t[p - 'A' + 1]++;\n  max = 1;\n  for (i = 2; i <= 26; i++)\n    if (t[max] < t[i])\n      max = i;\n  printf(\"%c\\n\", p = 'A' + max - 1);\n  printf(\"%d\\n\", t[p - 'A' + 1]);\n  for (i = 1; i <= n; i++)\n    if (strchr(b[i], p))\n      cout << a[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "3233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct a {\n  int n;\n  char s[26];\n} b[1000];\n\nint main() {\n  int n, i, j, c[26] = {0};\n  char t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int d, m;\n    scanf(\"%d%s\", &b[i].n, b[i].s);\n    d = strlen(b[i].s);\n    for (m = 0; m < d; m++)\n      c[b[i].s[m] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = i + 1; j < 26; j++)\n      if (c[j] > c[i])\n        break;\n    if (j == 26)\n      break;\n  }\n  t = 65 + i;\n  printf(\"%c\\n%d\\n\", t, c[i]);\n  for (i = 0; i < n; i++) {\n    if (strchr(b[i].s, t) != NULL) {\n      printf(\"%d\\n\", b[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int x;\n    char z[10];\n  } a[400];\n  int i, n, max = 0, j, k, l, y[400], p;\n  char u;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].x, a[i].z);\n    y[i] = strlen(a[i].z);\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < y[i]; j++) {\n      p = 1;\n      for (k = i + 1; k < n; k++) {\n        for (l = 0; l < y[k]; l++)\n          if (a[i].z[j] == a[k].z[l])\n            p++;\n      }\n      if (p > max) {\n        max = p;\n        u = a[i].z[j];\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", u, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < y[i]; j++)\n      if (u == a[i].z[j]) {\n        cout << a[i].x << \"\\n\";\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b = 0, max;\n  int let[26] = {0};\n  char a;\n  struct student {\n    int num;\n    char name[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      let[book[i].name[j] - 'A']++;\n    }\n  }\n  max = let[0];\n  for (i = 0; i < 25; i++) {\n    if (let[i] > max) {\n      max = let[i];\n      b = i;\n    }\n  }\n  a = b + 'A';\n  printf(\"%c\\n%d\\n\", a, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      if (book[i].name[j] == a) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint trans(char k) {\n  int i;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\nint main() {\n  struct books {\n    int n;\n    char w[27];\n  } * m;\n  int num, i, j;\n  cin >> num;\n  m = (struct books *)malloc(sizeof(struct books) * num);\n  for (i = 0; i < num; i++) {\n\n    int N;\n    char W[27];\n    scanf(\"%d %s\", &N, W);\n    m[i].n = N;\n    strcpy(m[i].w, W);\n  }\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\n      c;\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      c = trans(m[i].w[j]);\n      b[c]++;\n    }\n  }\n  int max = 0;\n  char most;\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      most = 'A' + i;\n    }\n  }\n  cout << most << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < num; i++) {\n    for (j = 0; m[i].w[j] != '\\0'; j++) {\n      if (m[i].w[j] == most)\n        printf(\"%d\\n\", m[i].n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Books {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int n;\n  int i, j;\n  int x;\n  int max = 0;\n  char letter = 'A';\n  int b[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].author);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (a[i].author[j] >= 65 && a[i].author[j] <= 90) {\n        x = a[i].author[j];\n        b[x - 65]++;\n      } else {\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      letter = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == letter) {\n        printf(\"%d\\n\", a[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char name[26];\n  struct inf *next;\n};\n\nint m;\nstruct inf *creat(void) {\n  struct inf *head, *p1, *p2;\n  int n;\n  p1 = p2 = (struct inf *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  n = 0;\n  while (1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    if (n == m)\n      break;\n    else {\n      p1 = (struct inf *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid count(struct inf *head, int o) {\n  struct inf *q1;\n  int *q2, *q3, *q4;\n  char *t1;\n  q1 = head;\n  q2 = (int *)malloc(26 * 1000);\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    *q3 = 0;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      *(q2 + (*t1 - 'A')) = *(q2 + (*t1 - 'A')) + 1;\n    q1 = q1->next;\n  }\n  q4 = q2;\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    if (*q4 < *q3)\n      q4 = q3;\n  printf(\"%c %d \", q4 - q2 + 'A', *q4);\n  q1 = head;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      if (*t1 == (q4 - q2 + 'A'))\n        cout << q1->num << \" \";\n    q1 = q1->next;\n  }\n}\n\nint main() {\n  struct inf *head, *s;\n  scanf(\"%d\", &m);\n  head = creat();\n  s = head;\n  count(head, m);\n}\n"}
{"label": "2", "index": "3239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, len[1000], sum[26] = {0}, max, i, j, i0;\n  cin >> m;\n  struct book {\n    int num;\n    char wri[27];\n  } book[1000];\n  for (i = 0; i < m; i++) {\n    cin >> book[i].num >> book[i].wri;\n    len[i] = strlen(book[i].wri);\n  }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      sum[book[i].wri[j] - 65]++;\n  max = sum[0];\n  i0 = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      i0 = i;\n    }\n  printf(\"%c\\n\", i0 + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (book[i].wri[j] == 65 + i0) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  int count[26] = {0}, max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++)\n      count[a[i].auther[j] - 'A']++;\n  }\n\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char aut[100];\n} b[200000];\nint count_1[1000] = {0};\n\nint main() {\n  int n, max = 0, maxnum, i, j, f;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      count_1[b[i].aut[j]]++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (count_1[i] > max) {\n      max = count_1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c %d \", maxnum, max);\n  for (i = 1; i <= n; i++) {\n    f = 0;\n    for (j = 0; j < strlen(b[i].aut); j++) {\n      if (b[i].aut[j] == maxnum) {\n        f = 1;\n      }\n    }\n    if (f == 1) {\n      cout << b[i].num << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n};\nint i, j, n, t, number[100], m;\nstruct book *creat(void) {\n  struct book *p1, *p2, *head;\n  p1 = p2 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->name;\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  scanf(\"%d\", &m);\n  struct book *creat(void);\n  struct book *head, *p;\n  int a[26] = {0}, max, maxindex = 0;\n  head = p = creat();\n  char *pointer;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      for (i = 0; i < 26; i++) {\n        if (*pointer == 65 + i)\n          a[i]++;\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxindex = i;\n    }\n  }\n  printf(\"%c %d \", 65 + maxindex, a[maxindex]);\n  p = head;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      if (*pointer == 65 + maxindex)\n        cout << p->num << \" \";\n    }\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "2", "index": "3243", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k[100], l[26] = {0}, m = 0, v, j;\n  char c[100][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &k[i], c[i]);\n    for (j = 0; j < strlen(c[i]); j++) {\n      l[(int)c[i][j] - 65] += 1;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] > m)\n      m = l[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] == m) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      break;\n    }\n  }\n  for (v = 0; v < n; v++) {\n    for (j = 0; j < strlen(c[v]); j++) {\n      if (c[v][j] == i + 65)\n        printf(\"%d\\n\", k[v]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char w[100];\n} book[100];\nint main() {\n  int i, j, k, l, m, n, p, b[26] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].w);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].w[j] != '\\0'; j++) {\n      if (book[i].w[j] == 'A')\n        b[0]++;\n      else if (book[i].w[j] == 'B')\n        b[1]++;\n      else if (book[i].w[j] == 'C')\n        b[2]++;\n      else if (book[i].w[j] == 'D')\n        b[3]++;\n      else if (book[i].w[j] == 'E')\n        b[4]++;\n      else if (book[i].w[j] == 'F')\n        b[5]++;\n      else if (book[i].w[j] == 'G')\n        b[6]++;\n      else if (book[i].w[j] == 'H')\n        b[7]++;\n      else if (book[i].w[j] == 'I')\n        b[8]++;\n      else if (book[i].w[j] == 'J')\n        b[9]++;\n      else if (book[i].w[j] == 'K')\n        b[10]++;\n      else if (book[i].w[j] == 'L')\n        b[11]++;\n      else if (book[i].w[j] == 'M')\n        b[12]++;\n      else if (book[i].w[j] == 'N')\n        b[13]++;\n      else if (book[i].w[j] == 'O')\n        b[14]++;\n      else if (book[i].w[j] == 'P')\n        b[15]++;\n      else if (book[i].w[j] == 'Q')\n        b[16]++;\n      else if (book[i].w[j] == 'R')\n        b[17]++;\n      else if (book[i].w[j] == 'S')\n        b[18]++;\n      else if (book[i].w[j] == 'T')\n        b[19]++;\n      else if (book[i].w[j] == 'U')\n        b[20]++;\n      else if (book[i].w[j] == 'V')\n        b[21]++;\n      else if (book[i].w[j] == 'W')\n        b[22]++;\n      else if (book[i].w[j] == 'X')\n        b[23]++;\n      else if (book[i].w[j] == 'Y')\n        b[24]++;\n      else if (book[i].w[j] == 'Z')\n        b[25]++;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i] < b[j])\n        break;\n    }\n    if (j == 26) {\n      cout << 65 + i << \"\\n\" << b[i] << \"\\n\";\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (l = 0; book[j].w[l] != '\\0'; l++) {\n      if (book[j].w[l] == 65 + i) {\n        cout << book[j].num << \"\\n\";\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n  struct book *next;\n};\nstruct book *creat() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  struct book *head, *p1, *p2;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->author);\n  p1->next = NULL;\n  if (i >= n) {\n    free(p1);\n    head = NULL;\n    return head;\n  } else {\n    head = p1;\n    p2 = p1;\n    while (i < n) {\n      p1 = (struct book *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->author);\n      p1->next = NULL;\n      i++;\n      {\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n    p2->next = p1;\n    p1->next = NULL;\n    return head;\n  }\n}\nint max(char letter, struct book *head) {\n  int i, j, k;\n  i = 0;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        i++;\n    }\n    q = q->next;\n  }\n  return i;\n}\n\nvoid outbook(char letter, struct book *head) {\n  int j, k;\n  struct book *q;\n  q = head;\n  while (q != NULL) {\n    k = strlen(q->author);\n    for (j = 0; j < k; j++) {\n      if ((q->author)[j] == letter)\n        printf(\"%d \", q->num);\n    }\n    q = q->next;\n  }\n}\nint main() {\n  int i, m, s;\n  struct book *p0, *p1;\n  p0 = p1 = creat();\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = max(i + 65, p0);\n  s = 0;\n  m = sum[0];\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > m) {\n      m = sum[i];\n      s = i;\n    }\n  }\n  printf(\"%c \", s + 65);\n  printf(\"%d \", m);\n  outbook(s + 65, p1);\n  return 0;\n}\n"}
{"label": "2", "index": "3246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, t, g, max;\n  char q;\n  int d[26];\n  struct {\n    int a;\n    char b[26];\n\n  } s[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &s[i].a, s[i].b);\n  }\n  for (i = 0; i < 26; i++) {\n    d[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      t = s[i].b[j] - 'A';\n      d[t]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++) {\n    if (d[j] > max) {\n      max = d[j];\n      g = j;\n    }\n  }\n  q = 'A' + g;\n  printf(\"%c\\n%d\\n\", q, max);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      if (s[i].b[j] - 'A' == g) {\n        printf(\"%d\\n\", s[i].a);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3247", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct bo {\n  char id[10];\n  char au[100];\n};\n\nint main() {\n  int n, i, j, max;\n  char maxa;\n  struct bo *book;\n  int auth[26];\n  memset(auth, 0, sizeof(int) * 26);\n  scanf(\"%d \", &n);\n  book = (struct bo *)malloc(sizeof(struct bo) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].id, book[i].au);\n    for (j = 0; book[i].au[j]; j++) {\n      auth[book[i].au[j] - 'A']++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < auth[i]) {\n      max = auth[i];\n      maxa = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", maxa);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    if (strchr(book[i].au, maxa))\n      printf(\"%s\\n\", book[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3248", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, max1, t, k, x[28] = {0}, n, a, b, c, d, i, j;\n  char cc, y[100][32], q;\n  cin >> n;\n  scanf(\"%c\", &cc);\n  for (i = 1; i <= n; i++) {\n\n    cin >> y[i];\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] >= 'A' && y[i][j] <= 'Z') {\n        x[y[i][j] + 1 - 'A']++;\n      }\n    }\n  }\n  max = x[1];\n  max1 = 1;\n  for (i = 2; i <= 26; i++) {\n    if (x[i] > max) {\n      max = x[i];\n      max1 = i;\n    }\n  }\n  q = 'A' - 1 + max1;\n  printf(\"%c \", q);\n  printf(\"%d \", max);\n  for (i = 1; i <= n; i++) {\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] == q) {\n        for (t = 0; y[i][t]; t++) {\n          if (y[i][t] == ' ')\n            break;\n          else\n            printf(\"%c\", y[i][t]);\n        }\n        printf(\" \");\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n} b[999];\nint main() {\n  int i, j, m, n, k, max, p;\n  int a[26] = {0}, q[999] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++) {\n      k = b[i].aut[j];\n      a[k - 65]++;\n    }\n  }\n  for (i = 1, max = a[0], p = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++)\n      if (b[i].aut[j] == (p + 65))\n        q[i] = 1;\n  }\n  for (i = 0; i < m; i++)\n    if (q[i] == 1)\n      cout << \"\\n\" << b[i].num;\n}\n"}
{"label": "2", "index": "3250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int a;\n  char s[26];\n  struct st *n;\n};\nstruct st *creat(int m) {\n  int i;\n  struct st *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->n = p1;\n    scanf(\"%d %s\", &p1->a, p1->s);\n    p2 = p1;\n  }\n  p1->n = NULL;\n  return (head);\n}\nint main() {\n  int m;\n  struct st *creat(int m);\n  scanf(\"%d\", &m);\n  struct st *p, *q;\n  p = creat(m);\n  q = p;\n  int i, j, k;\n  int a[26] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (k = strlen(p->s)); j++)\n      a[p->s[j] - 65]++;\n    p = p->n;\n  }\n  p = q;\n  int max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  char c;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      c = i + 65;\n      printf(\"%c %d \", c, a[i]);\n      break;\n    }\n  }\n  char cc;\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      cc = q->s[j];\n      if (cc == '\u0000')\n        break;\n      if (c == cc)\n        cout << q->a << \" \";\n    }\n    q = q->n;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char s[27];\n} shu[1000];\nint main() {\n  int n, i, l, j, max;\n  char name;\n  int letter[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &shu[i].num, &shu[i].s);\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      letter[(shu[i].s[j] - 65)]++;\n    }\n  }\n  for (max = letter[0], name = 65, i = 1; i < 26; i++) {\n    if (letter[i] > max) {\n      max = letter[i];\n      name = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name, max);\n  for (i = 0; i < n; i++) {\n    l = strlen(shu[i].s);\n    for (j = 0; j < l; j++) {\n      if (shu[i].s[j] == name) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3252", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][27], x;\n  int m, i, j, k, b[1000], c[26] = {0}, max = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> b[i] >> a[i];\n    int len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      c[a[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++)\n    if (max < c[j]) {\n      max = c[j];\n      x = 'A' + j;\n    }\n\n  cout << x << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    int len = strlen(a[i]);\n    for (k = 0; k < len; k++)\n      if (a[i][k] == x) {\n        cout << b[i] << endl;\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26][1000];\nint ai[26];\nvoid func() {\n  int k, i, len;\n  char str[27];\n  scanf(\"%d %s\", &k, str);\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    a[str[i] - 'A'][ai[str[i] - 'A']] = k;\n    ai[str[i] - 'A']++;\n  }\n}\nint main() {\n  memset(a, 0, sizeof(a));\n  memset(ai, 0, sizeof(ai));\n  int n, i, i0, max = 0;\n  scanf(\"%d\", &n);\n  while (n--)\n    func();\n  for (i = 0; i < 26; i++) {\n    if (ai[i] > max) {\n      max = ai[i];\n      i0 = i;\n    }\n  }\n  cout << i0 + 'A' << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < ai[i0]; i++)\n    printf(\"%d\\n\", a[i0][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, b[999], n[26], t[2] = {0}, x = 0;\n  char a[999][26], au;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &b[i], a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      n[(int)a[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (t[0] < n[i]) {\n      t[0] = n[i], t[1] = i;\n    }\n  }\n  au = t[1] + 65;\n  cout << au << \"\\n\" << t[0] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    x = 0, j = 0;\n    while (j < (int)strlen(a[i]) && x == 0) {\n      if (a[i][j] == t[1] + 65) {\n        cout << b[i] << \"\\n\", x++;\n      } else {\n        j++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct author {\n    char nm;\n    int bk[999];\n    int count;\n  };\n  struct author a[26];\n  struct author max;\n  struct book {\n    char at[26];\n    int no;\n  };\n  struct book b;\n  int i, j, n, m, k, flag;\n  for (i = 0; i < 26; i++) {\n    a[i].count = 0;\n    a[i].nm = 65 + i;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b.no, b.at);\n    m = strlen(b.at);\n    flag = 0;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b.at[j] == a[k].nm) {\n          a[k].bk[a[k].count] = b.no;\n          a[k].count++;\n          flag++;\n          break;\n        }\n      }\n      if (flag == m) {\n        break;\n      }\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i].count > max.count) {\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", max.nm, max.count);\n  for (i = 0; i < max.count; i++) {\n    printf(\"%d\\n\", max.bk[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3256", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int number;\n    char author[10];\n  };\n  struct book a[1000];\n  int i, n, j, count[26] = {0}, temp, max, index = 0;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, &a[i].author);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      temp = (a[i].author[j]) - 'A';\n      count[temp]++;\n    }\n  max = count[0];\n  for (i = 1; i < 26; i++)\n    if (count[i] > max) {\n      max = count[i];\n      index = i;\n    }\n  c = index + 'A';\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].author[j] != '\\0'; j++)\n      if (a[i].author[j] == c)\n        printf(\"%d\\n\", a[i].number);\n}\n"}
{"label": "2", "index": "3257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct author {\n  char num[4];\n  char str[27];\n};\n\nint main(int argc, char *argv[]) {\n  int m, i, j, zimu[26] = {0}, x, max;\n  char p;\n  scanf(\"%d\", &m);\n  struct author *auth = (struct author *)malloc(sizeof(struct author) * m);\n  for (i = 0; i < m; i++)\n    scanf(\"%s %s\", auth[i].num, auth[i].str);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      x = auth[i].str[j] - 65;\n      zimu[x]++;\n    }\n  }\n  max = zimu[0];\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > max) {\n      max = zimu[i];\n      p = i;\n    }\n  }\n  cout << p + 65 << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (auth[i].str[j] == p + 65) {\n        printf(\"%s\\n\", auth[i].num);\n      }\n    }\n  }\n\n  free(auth);\n  return 0;\n}\n"}
{"label": "2", "index": "3258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  struct Author {\n    int count;\n    int number[1000];\n  };\n\n  struct Author b[26];\n  for (i = 0; i < 26; i++)\n    b[i].count = 0;\n  int max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      b[a[i].auther[j] - 'A'].number[b[a[i].auther[j] - 'A'].count] =\n          a[i].number;\n      b[a[i].auther[j] - 'A'].count++;\n    }\n  }\n\n  max = b[0].count;\n  for (i = 0; i < 26; i++)\n    if (b[i].count >= max) {\n      max = b[i].count;\n      record = i;\n    }\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n  for (i = 0; i < max; i++)\n    cout << b[record].number[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3259", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int num;\n  char author_name[27];\n};\n\nint main() {\n  int ere[26];\n  int m, i, max = 0, key;\n  for (i = 0; i < 26; i++) {\n    ere[i] = 0;\n  }\n  char *a;\n  struct shu book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    cin >> book[i].author_name;\n  }\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      ere[(*a) - 'A']++;\n      a++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ere[i] >= max) {\n      max = ere[i];\n      key = i;\n    }\n  }\n  printf(\"%c\\n\", (key + 'A'));\n  printf(\"%d\\n\", ere[key]);\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      if ((key + 'A') == *a) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char auth[26];\n    int inf[26];\n    struct book *next;\n  };\n  struct book *head, *p1, *p2, *t1, *t2;\n  head = (struct book *)malloc(sizeof(struct book));\n\n  int m, i, k, l, j, max;\n  int authnum[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = head;\n  p2 = p1;\n  for (i = 0; i < (m - 1); i++) {\n    scanf(\"%d %s\", &(p1->num), p1->auth);\n    p2 = (struct book *)malloc(sizeof(struct book));\n    p1->next = p2;\n    p1 = p2;\n  }\n  scanf(\"%d %s\", &(p1->num), p1->auth);\n  p2 = NULL;\n  p1->next = p2;\n\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    l = strlen(p1->auth);\n    for (j = 0; j < l; j++) {\n      p1->inf[(*((p1->auth) + j)) - 65] = 1;\n      authnum[(*((p1->auth) + j)) - 65]++;\n    }\n    p2 = p1->next;\n    p1 = p2;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (authnum[i] > authnum[max])\n      max = i;\n  }\n  printf(\"%c\\n\", (max + 65));\n  printf(\"%d\\n\", authnum[max]);\n\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    if ((p1->inf[max]) > 0)\n      printf(\"%d\\n\", p1->num);\n    p2 = p1->next;\n    p1 = p2;\n  }\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    p2 = p1->next;\n    free(p1);\n    p1 = p2;\n  }\n}\n"}
{"label": "2", "index": "3261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char author[26];\n};\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int i;\n  struct book book[1000];\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n  }\n  int b[26] = {0};\n  for (i = 0; i < n; i++) {\n    int l;\n    l = strlen(book[i].author);\n    int j;\n    for (j = 0; j < l; j++) {\n      b[book[i].author[j] - 65] = b[book[i].author[j] - 65] + 1;\n    }\n  }\n  int max = b[0];\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] == max)\n      break;\n  }\n  char p;\n  p = i + 65;\n  printf(\"%c\\n%d\\n\", p, max);\n  for (i = 0; i < n; i++) {\n    int j, l;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++) {\n      if (book[i].author[j] == p) {\n        cout << book[i].num << \"\\n\";\n        break;\n      } else if (book[i].author[j] != p && j == l - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  int i, j, k, x, t;\n  struct book {\n    int num;\n    char w[26];\n  } b[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i].num);\n    scanf(\"%s\", &b[i].w);\n  }\n  int c[26];\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[j].w[k] != '\\0' && b[j].w[k] - i == 'A')\n          c[i]++;\n      }\n    }\n  }\n  int d[26];\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (i = 0; i < 25; i++) {\n    if (d[i] > d[i + 1]) {\n      t = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = t;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == d[25])\n      x = i;\n  }\n  printf(\"%c\\n\", 'A' + x);\n  printf(\"%d\\n\", c[x]);\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < 26; k++) {\n      if (b[j].w[k] - x == 'A')\n        printf(\"%d\\n\", b[j].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  } b[1000];\n\n  int m, i, j, n[26] = {0}, max = 0, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      ++n[b[i].name[j] - 65];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      t = i + 65;\n    }\n  }\n  printf(\"%c \", t);\n  printf(\"%d \", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (b[i].name[j] == t)\n        printf(\"%d \", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, d, i, j, l;\n  struct a {\n    char name[27];\n    int c;\n  } m[1000];\n  struct b {\n    int num, book[1000];\n    char t;\n  };\n  struct b author[27];\n  for (i = 1; i <= 26; i++) {\n    author[i].t = i + 64;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i].c);\n    scanf(\"%s\", m[i].name);\n  }\n  for (i = 1; i <= n; i++) {\n    l = strlen(m[i].name);\n    for (j = 0; j <= l - 1; j++) {\n      d = m[i].name[j] - 64;\n      author[d].num++;\n      author[d].book[author[d].num] = m[i].c;\n    }\n  }\n  for (i = 1; i <= 25; i++) {\n    if (author[i].num > author[i + 1].num)\n      author[i + 1] = author[i];\n  }\n  printf(\"%c\\n\", author[26].t);\n  cout << author[26].num << \"\\n\";\n  for (i = 1; i <= author[26].num; i++) {\n    printf(\"%d\\n\", author[26].book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    cin >> a[i].number >> a[i].auther;\n\n  struct Author {\n    int count;\n    int number[1000];\n  };\n\n  struct Author b[26];\n  for (i = 0; i < 26; i++)\n    b[i].count = 0;\n  int max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      b[a[i].auther[j] - 'A'].number[b[a[i].auther[j] - 'A'].count] =\n          a[i].number;\n      b[a[i].auther[j] - 'A'].count++;\n    }\n  }\n\n  max = b[0].count;\n  for (i = 0; i < 26; i++)\n    if (b[i].count >= max) {\n      max = b[i].count;\n      record = i;\n    }\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n  for (i = 0; i < max; i++)\n    cout << b[record].number[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct test {\n  int num;\n  int book[100];\n\n} a[26];\nint main() {\n  int n, i, j, index, temp, max;\n  char s[100];\n  char ch;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &index, &s);\n    for (j = 0; s[j] != '\\0'; j++) {\n      temp = (int)(s[j] - 'A');\n      a[temp].book[a[temp].num] = index;\n      a[temp].num++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i].num > a[max].num) {\n      max = i;\n    }\n  }\n  ch = (char)('A' + max);\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", a[max].num);\n  for (i = 0; i < a[max].num; i++) {\n    printf(\"%d\\n\", a[max].book[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3267", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct {\n  int a;\n  char b[26];\n} shu[1000];\n\nint main() {\n  int s[27];\n  int n, i, j, o, max, t = 1, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].a, shu[i].b);\n\n  for (i = 1; i <= 26; i++)\n    s[i] = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(shu[i].b); j++) {\n      o = shu[i].b[j] - 64;\n      s[o]++;\n    }\n\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (max < s[i]) {\n      max = s[i];\n      t = i;\n    }\n  printf(\"%c\\n\", t + 64);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    x = strlen(shu[i].b);\n    for (j = 0; j < x; j++)\n      if (shu[i].b[j] == t + 64)\n        printf(\"%d\\n\", shu[i].a);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3268", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int book[1000], m, i, j, k, length, max = 0, name[500] = {0};\n  char writer[1000][26], name1;\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> book[i] >> writer[i];\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i < m; i++) {\n      length = strlen(writer[i]);\n      for (j = 0; j < length; j++) {\n        if (writer[i][j] == k)\n          name[k]++;\n      }\n    }\n    if (name[k] > max) {\n      max = name[k];\n      name1 = k;\n    }\n  }\n  cout << name1 << endl;\n  cout << max << endl;\n  for (i = 0; i <= m; i++) {\n    length = strlen(writer[i]);\n    for (j = 0; j <= length; j++)\n      if (writer[i][j] == name1) {\n        cout << book[i] << endl;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct books {\n    int book;\n    char writer[20];\n  } bk[1000];\n  int n, i, j, m, max, k, maxw = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &bk[i].book, bk[i].writer);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      k = bk[i].writer[j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxw = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxw + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].writer);\n    for (j = 0; j < m; j++) {\n      if (maxw + 65 == bk[i].writer[j]) {\n        printf(\"%d\\n\", bk[i].book);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, c, big = 0;\n  int num[30] = {0}, a[1000];\n  char name[1000][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], name[i]);\n\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(name[i]); j++) {\n        if (name[i][j] == k + 'A')\n          num[k] = num[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (big < num[i]) {\n      big = num[i];\n      c = i + 'A';\n    }\n  }\n  printf(\"%d\\n\", c);\n  printf(\"%d\\n\", big);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == c)\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  };\n  int m, i, j, max;\n  int sum[26] = {0};\n  scanf(\"%d\", &m);\n  struct book b[m];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      sum[(b[i].name)[j] - 'A']++;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > sum[max])\n      max = i;\n  printf(\"%c\\n%d\\n\", max + 'A', sum[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if ((b[i].name)[j] == 65 + max)\n        cout << b[i].num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "3272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  char writer[32];\n  int id;\n  struct book *next;\n};\nstruct book *create(int m) {\n  struct book *head = NULL, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->id, p1->writer);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->id >> p1->writer;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int m, i, *q1, *q2, j;\n  q1 = (int *)malloc(26 * sizeof(int *));\n  q2 = q1;\n  for (i = 0; i < 26; i++)\n    q1[i] = 0;\n  q1 = q2;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      q1[p->writer[j] - 'A']++;\n    p = p->next;\n  }\n  q1 = q2;\n  int max = 0;\n  char maxm = 'A';\n  for (i = 0; i < 26; i++)\n    if (max < q1[i]) {\n      max = q1[i];\n      maxm = i + 'A';\n    }\n  cout << maxm << \" \" << max;\n  for (i = 0, p = head; i < m; i++, p = p->next)\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == maxm)\n        cout << \" \" << p->id;\n}\n"}
{"label": "2", "index": "3273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[27];\n  struct book *next;\n};\nint n;\nstruct book *creat(int amount) {\n  struct book *head;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  p2 = p1;\n  scanf(\"%d %s\", &p1->num, p1->aut);\n  while (n < amount - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->aut;\n  }\n  p2->next = p1, p1->next = NULL;\n  return (head);\n}\nint main() {\n  int amount, i, a[26] = {0}, max, maxn;\n  struct book *p, *headp;\n  char *auth, name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                          'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S',\n                          'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &amount);\n  p = creat(amount);\n  headp = p;\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      for (i = 0; i < 26; i++) {\n        if (name[i] == *auth)\n          break;\n      }\n      a[i] = a[i] + 1;\n    }\n  }\n  for (i = 0, max = a[0], maxn = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i], maxn = i;\n  }\n  printf(\"%c\\n%d\\n\", name[maxn], max);\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      if (*auth == name[maxn])\n        break;\n    }\n    if (*auth == '\\0')\n      ;\n    else\n      printf(\"%d\\n\", p->num);\n  }\n}\n"}
{"label": "2", "index": "3274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[27];\n  } b[1000];\n  int m, i, j, a = 0;\n  int c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].num, b[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      c[*(b[i].name + j) - 'A']++;\n  }\n  for (i = 0; i < 26; i++)\n    a = c[i] > c[a] ? i : a;\n  printf(\"%c\\n\", a + 'A');\n  cout << c[a] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (*(b[i].name + j) == ('A' + a))\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, book[1000], cnt[60], max;\n  char author[1000][26], p;\n  int b[60][1000];\n  cin >> n;\n  for (int i = 0; i < 60; i++)\n    cnt[i] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> book[i];\n    cin.get();\n    cin.getline(author[i], 26);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; author[i][j] != '\\0'; j++) {\n      int k = author[i][j] - '0';\n      b[k][cnt[k]++] = book[i];\n    }\n  }\n  max = cnt[17];\n  p = 'A';\n  for (int i = 17; i <= 42; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      p = i + '0';\n    }\n  }\n  cout << p << endl;\n  printf(\"%d\\n\", max);\n  for (int m = 0; m < max; m++)\n    printf(\"%d\\n\", b[p - '0'][m]);\n  return 0;\n}\n"}
{"label": "2", "index": "3276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[100];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int k = 1;\n  struct book *head, *p1, *p2, *p;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  head = p1;\n  p2 = p1;\n  p = p1;\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  do {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    cin >> p1->num >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    k++;\n  } while (k < n);\n  return head;\n}\n\nint main(void) {\n  struct book *head, *p;\n  char *q;\n  int *s;\n  int n, i, max = 0;\n  s = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(s + i) = 0;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  while (p) {\n    q = p->name;\n    while (*q != '\\0') {\n      *(s + *(q) - 'A') += 1;\n      q++;\n    }\n    p = p->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (*(s + i) > max)\n      max = *(s + i);\n  for (i = 0; i < 26; i++)\n    if (*(s + i) == max)\n      break;\n  printf(\"%c\\n%d\\n\", 'A' + i, max);\n  p = head;\n  while (p) {\n    q = p->name;\n    if (strchr(q, 'A' + i) != NULL)\n      cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct x {\n    char num[26];\n    int y;\n  } q[1000], x0;\n\n  int n, i, j, c[100] = {0}, m = 0, f;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &q[i].y, &q[i].num);\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      m = (int)q[i].num[j], c[m] = c[m] + 1;\n\n  for (m = 0; m < 100; m++)\n    if (c[m] > c[0])\n      f = m, c[0] = c[m];\n\n  printf(\"%c\\n%d\\n\", (char)f, c[f]);\n  for (i = 0; i < n; i++)\n    for (j = 0; q[i].num[j] != '\\0'; j++)\n      if (q[i].num[j] == (char)f)\n        printf(\"%d\\n\", q[i].y);\n}\n"}
{"label": "2", "index": "3278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j;\n  cin >> m;\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    cin >> a[i].number >> a[i].auther;\n  int count[26] = {0}, max, record;\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      count[a[i].auther[j] - 'A']++;\n    }\n  }\n  max = count[0];\n  for (i = 0; i < 26; i++)\n    if (count[i] >= max) {\n      max = count[i];\n      record = i;\n    }\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n  for (i = 0; i < m; i++) {\n    int n;\n    n = strlen(a[i].auther);\n    for (j = 0; j < n; j++)\n      if (a[i].auther[j] == record + 'A') {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int code;\n  char writer[10];\n};\nint main() {\n  int n, i, j, t = 0, d, ww[27] = {0};\n  char max, w[27];\n  struct book list[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    w[i] = i + 65;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &list[i].code, list[i].writer);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n      for (d = 0; d < 26; d++)\n        if (list[i].writer[j] == w[d])\n          ww[d]++;\n    }\n  max = ww[0];\n  for (i = 0; i < 26; i++)\n    if (ww[i] > max) {\n      max = ww[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", w[t], ww[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n\n      if (list[i].writer[j] == w[t])\n        printf(\"%d\\n\", list[i].code);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3280", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int n, i, a, max = 0, alp[26] = {0};\n  char *j;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      int x = *j;\n      ++*(alp + x - 65);\n      if (*(alp + x - 65) > max) {\n        max = *(alp + x - 65);\n        a = x;\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", a, max);\n\n  for (i = 0; i < n; i++) {\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      if ((int)*j == a)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct author {\n  char name;\n  int count;\n} aut[26];\n\nint max(struct author a[26]) {\n  int i, max;\n  max = a[0].count;\n  for (i = 0; i < 26; i++)\n    if (a[i].count > max)\n      max = a[i].count;\n  return (max);\n}\nint main() {\n  int m, h = 0;\n  scanf(\"%d\", &m);\n  int i, j, n, l[1000], book_name[1000];\n  char author_name[1000][27];\n  for (i = 0; i < 26; i++) {\n    aut[i].name = 'A' + i;\n    aut[i].count = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book_name[i], author_name[i]);\n    l[i] = strlen(author_name[i]);\n    for (j = 0; j < 26; j++)\n      for (n = 0; n < l[i]; n++)\n        if (author_name[i][n] == aut[j].name)\n          aut[j].count++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (aut[i].count == max(aut)) {\n      printf(\"%c\\n\", aut[i].name);\n      h = i;\n    }\n  }\n  printf(\"%d\\n\", max(aut));\n  for (i = 0; i < m; i++) {\n    l[i] = strlen(author_name[i]);\n    for (n = 0; n < l[i]; n++)\n      if (author_name[i][n] == aut[h].name)\n        printf(\"%d\\n\", book_name[i]);\n  }\n}\n"}
{"label": "2", "index": "3282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i;\n  }\n  cout << zzzd << \"\\n\" << max << \"\\n\";\n  p1 = head;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[1000], l[1000], count[128], m, max;\n  char edi[1000][26], au[128];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"\\n%d\", &num[j]);\n\n    cin >> edi[j];\n    l[j] = strlen(edi[j]);\n  }\n  for (i = 0; i < 128; i++)\n    count[i] = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      m = edi[j][i];\n      au[m] = edi[j][i];\n      count[m]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 128; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      m = i;\n    }\n  }\n  cout << au[m] << \"\\n\" << max;\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < l[j]; i++) {\n      if (edi[j][i] == au[m])\n        cout << \"\\n\" << num[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3284", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct A {\n  char num[1000];\n  char B[27];\n};\nint main() {\n  int n, i, a, k, t;\n  int sb[27] = {0};\n  int sb2[27] = {0};\n  char x;\n  cin >> n;\n  struct A book[999] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].num, book[i].B);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      a = book[i].B[k];\n      if (book[i].B[k] <= 'Z' && book[i].B[k] >= 'A') {\n        sb[a - 64]++;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    sb2[i] = sb[i];\n  }\n  for (i = 1; i < 26; i++) {\n    if (sb[i] > sb[i + 1]) {\n      a = sb[i];\n      sb[i] = sb[i + 1];\n      sb[i + 1] = a;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (sb2[i] == sb[26]) {\n      t = i;\n    }\n  }\n  x = 'A' + t - 1;\n  printf(\"%c\\n%d\\n\", x, sb[26]);\n  for (i = 0; i < n; i++) {\n    for (k = 0;; k++) {\n      if (book[i].B[k] == '\\0')\n        break;\n\n      else if (book[i].B[k] == x)\n        printf(\"%s\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char writer[28];\n} bo[1000];\nint main() {\n  int i, j, k, n, a, b;\n  int max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num >> bo[i].writer;\n  }\n  for (i = 'Z'; i >= 'A'; i--) {\n    a = 0;\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < 27; j++) {\n        if (bo[k].writer[j] == i) {\n          a++;\n        }\n      }\n    }\n    if (a > max) {\n      max = a;\n      b = i;\n    }\n  }\n  cout << b << \"\\n\" << max << \"\\n\";\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 28; i++) {\n      if (bo[j].writer[i] == b) {\n        printf(\"%d\\n\", bo[j].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char zz[20];\n  struct student *next;\n};\n\nstruct student *New(int n) {\n  struct student *head = NULL;\n  struct student *newp, *thisp;\n\n  int i = 0;\n\n  do {\n    newp = (struct student *)malloc(sizeof(struct student));\n    if (newp == NULL) {\n      printf(\"request failed\\n\");\n      exit(-1);\n    }\n    scanf(\"%d %s\", &newp->num, newp->zz);\n    if (i == 0) {\n      head = newp;\n      thisp = head;\n    } else\n      thisp->next = newp;\n    if (i < n) {\n      thisp = newp;\n      i = i + 1;\n    }\n  } while (i < n);\n  thisp->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j;\n  int n;\n  int t1 = 0, t2;\n  int length;\n  char target[1000] = {' '};\n  char mz = ' ';\n\n  struct student *head, *p;\n\n  scanf(\"%d\", &n);\n\n  head = New(n);\n  p = head;\n\n  i = 0;\n  do {\n    if (i == 0)\n      strcpy(target, p->zz);\n    else {\n      p = p->next;\n      strcat(target, p->zz);\n    }\n\n    i += 1;\n  } while (p->next != NULL);\n\n  length = strlen(target);\n  for (i = 0; i < length; i++) {\n    t2 = 0;\n    if (target[i] == '0')\n      continue;\n    else {\n      for (j = i + 1; j < length; j++) {\n        if (target[j] == target[i]) {\n          target[j] = '0';\n          t2 += 1;\n        }\n      }\n      if (t2 > t1) {\n        t1 = t2;\n        mz = target[i];\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\", mz, t1 + 1);\n\n  p = head;\n  do {\n    length = strlen(p->zz);\n    for (i = 0; i < length; i++) {\n      if ((p->zz[i]) == mz) {\n        printf(\"\\n%d\", p->num);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "3287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, temp = 26, n, p[27] = {0};\n  struct {\n    int a;\n    char s[30];\n  } t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &t[i].a, t[i].s);\n    for (j = 0; j < strlen(t[i].s); j++) {\n      p[t[i].s[j] - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[temp])\n      temp = i;\n  }\n  printf(\"%c\\n%d\\n\", temp + 'A', p[temp]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(t[i].s); j++) {\n      if (t[i].s[j] == temp + 'A') {\n        cout << t[i].a << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, sum = 0, min, max, ID[1000] = {0}, a[26] = {0};\n  char name[1000][26] = {\"\"};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &ID[i], &name[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      a[name[i][j] - 'A']++;\n\n  max = a[0];\n  k = 0;\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == 'A' + k)\n        cout << ID[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "3289", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct bookinf {\n    int code;\n    char auth[27];\n  } book[999];\n  int i, k, m, max = 0, num[26];\n  for (i = 0; i < 26; i++)\n    num[i] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].code, book[i].auth);\n    for (k = 0; book[i].auth[k] != '\\0'; k++)\n      num[book[i].auth[k] - 'A'] += 1;\n  }\n  for (i = 1; i < 26; i++) {\n    if (num[i] > num[max])\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", max + 'A', num[max]);\n  for (i = 0; i < m; i++) {\n    for (k = 0; book[i].auth[k] != '\\0'; k++) {\n      if (book[i].auth[k] == max + 'A') {\n        printf(\"%d\\n\", book[i].code);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t = 0, c = 0;\n  int A[25];\n  char g[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct point {\n    int a;\n    char s[80];\n  } tope[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &tope[i].a, tope[i].s);\n  }\n  for (k = 0; k < 26; k++) {\n    A[k] = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; tope[i].s[j] != '\\0'; j++) {\n        if (tope[i].s[j] == g[k]) {\n          A[k]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (A[i] > t) {\n      t = A[i];\n      c = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", g[c], t);\n  for (i = 0; i < n; i++) {\n    for (j = 0; tope[i].s[j] != '\\0'; j++) {\n      if (tope[i].s[j] == g[c]) {\n        printf(\"%d\\n\", tope[i].a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3291", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, d, s;\n  int a, b = 0, c;\n  int tt[1000], pp[1000], miao[26] = {0};\n  char kk[1000][30];\n  char w;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> tt[i] >> kk[i];\n  }\n  for (s = 0, j = 65; j <= 90; j++, s++) {\n    for (k = 0; k < m; k++) {\n      for (d = 0; kk[k][d] != '\\0'; d++) {\n        if (kk[k][d] == j) {\n          miao[s]++;\n        }\n      }\n    }\n  }\n  for (a = 0; a < 26; a++) {\n    if (miao[a] > b) {\n      b = miao[a];\n      c = a;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c + 65, b);\n  w = (c + 65);\n  for (i = 0; i < m; i++) {\n    for (j = 0; kk[i][j] != '\\0'; j++) {\n      if (kk[i][j] == w) {\n        printf(\"%d\\n\", tt[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3292", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, number, i, j, k, t, len, max;\n  int map[26][1000] = {0};\n  char name[27];\n\n  cin >> n;\n  for (i = 0; i <= 25; i++)\n    map[i][0] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> number >> name;\n    len = strlen(name);\n    for (j = 0; j <= len - 1; j++) {\n      k = name[j] - 'A';\n      map[k][0]++;\n      t = map[k][0];\n      map[k][t] = number;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++) {\n    if (map[i][0] > max) {\n      max = map[i][0];\n      k = i;\n    }\n  }\n  cout << (char)(65 + k) << endl;\n  cout << map[k][0];\n  for (i = 1; i <= map[k][0]; i++)\n    cout << endl << map[k][i];\n\n  return 0;\n}\n"}
{"label": "2", "index": "3293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[110], m, ni = 0, n = 0,\n                   maxn[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  char au[110][30], max[30];\n  scanf(\"%d \", &m);\n\n  int i, j;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    cin >> au[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 'A')\n        maxn[0]++;\n      if (au[i][j] == 'B')\n        maxn[1]++;\n      if (au[i][j] == 'C')\n        maxn[2]++;\n      if (au[i][j] == 'D')\n        maxn[3]++;\n      if (au[i][j] == 'E')\n        maxn[4]++;\n      if (au[i][j] == 'F')\n        maxn[5]++;\n      if (au[i][j] == 'G')\n        maxn[6]++;\n      if (au[i][j] == 'H')\n        maxn[7]++;\n      if (au[i][j] == 'I')\n        maxn[8]++;\n      if (au[i][j] == 'J')\n        maxn[9]++;\n      if (au[i][j] == 'K')\n        maxn[10]++;\n      if (au[i][j] == 'L')\n        maxn[11]++;\n      if (au[i][j] == 'M')\n        maxn[12]++;\n      if (au[i][j] == 'N')\n        maxn[13]++;\n      if (au[i][j] == 'O')\n        maxn[14]++;\n      if (au[i][j] == 'P')\n        maxn[15]++;\n      if (au[i][j] == 'Q')\n        maxn[16]++;\n      if (au[i][j] == 'R')\n        maxn[17]++;\n      if (au[i][j] == 'S')\n        maxn[18]++;\n      if (au[i][j] == 'T')\n        maxn[19]++;\n      if (au[i][j] == 'U')\n        maxn[20]++;\n      if (au[i][j] == 'V')\n        maxn[21]++;\n      if (au[i][j] == 'W')\n        maxn[22]++;\n      if (au[i][j] == 'X')\n        maxn[23]++;\n      if (au[i][j] == 'Y')\n        maxn[24]++;\n      if (au[i][j] == 'Z')\n        maxn[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (maxn[i] > n) {\n      n = maxn[i];\n      ni = i;\n    }\n  }\n  cout << (char)(ni + 65) << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 65 + ni)\n        cout << num[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3294", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct zuozhe {\n  int m;\n  char q;\n  char shu[1001][5];\n} zuozhe[26], t;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  char xingming[30];\n  char bianhao[5];\n  char zimu[27] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  for (i = 0; i < 26; i++)\n    zuozhe[i].m = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> bianhao >> xingming;\n    int j, k;\n    for (j = 0; xingming[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (xingming[j] == zimu[k]) {\n          zuozhe[k].m++;\n          zuozhe[k].q = zimu[k];\n          strcpy(zuozhe[k].shu[zuozhe[k].m], bianhao);\n          break;\n        }\n      }\n    }\n  }\n  int min = 0;\n  int maxnum = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (zuozhe[i].m > maxnum) {\n      maxnum = zuozhe[i].m;\n      min = i;\n    }\n  }\n  cout << zuozhe[min].q << endl << zuozhe[min].m << endl;\n  for (i = 1; i <= zuozhe[min].m; i++)\n    cout << zuozhe[min].shu[i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "3295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char temp, s;\n  int i, j, t[27][2000], m, n, a[27] = {0}, num[2000], x;\n  {\n    cin >> n;\n    for (i = 1; i <= n; i++) {\n      cin >> num[i];\n      temp = cin.get();\n      while (temp == '\\n' || temp == ' ') {\n        temp = cin.get();\n      }\n      for (j = 1; 1; j++) {\n        x = temp - 'A' + 1;\n        t[x][a[x]] = num[i];\n        a[x]++;\n        temp = cin.get();\n        if (temp == '\\n') {\n          break;\n        }\n      }\n    }\n    m = 0;\n    for (i = 1; i <= 26; i++) {\n      if (a[i] > a[m]) {\n        m = i;\n      }\n    }\n    s = m + 'A' - 1;\n    cout << s << endl << a[m] << endl;\n    for (i = 0; i < a[m]; i++) {\n      cout << t[m][i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char w[26];\n} b[999];\nint main() {\n  int m, i, j, k, e;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].w;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26] = {0};\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < m; i++) {\n      e = strlen(b[i].w);\n      for (k = 0; k < e; k++)\n        if (b[i].w[k] == a[j])\n          c[j]++;\n    }\n  }\n  int sum = 0;\n  for (j = 0; j < 26; j++)\n    if (c[j] > c[sum])\n      sum = j;\n  printf(\"%c\\n\", a[sum]);\n  printf(\"%d\\n\", c[sum]);\n  for (i = 0; i < m; i++) {\n    e = strlen(b[i].w);\n    for (k = 0; k < e; k++)\n      if (b[i].w[k] == a[sum])\n        printf(\"%d\\n\", b[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[999], count[27] = {0}, len[999];\n  int m, i, j, max = 0, per;\n  cin >> m;\n  char ch[999][26], person;\n  for (i = 1; i <= m; i++) {\n    cin >> num[i] >> ch[i];\n    len[i] = strlen(ch[i]);\n    for (j = 0; j <= len[i] - 1; j++) {\n      count[ch[i][j] - 64]++;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      per = i;\n    }\n  }\n  person = per + 64;\n  printf(\"%c\\n\", person);\n  cout << count[per] << endl;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (ch[i][j] == person) {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char s[26];\n  } b[1000];\n  struct author {\n    int n[1000];\n    int p;\n    char c;\n  } a[26], e;\n  int i, j, k, m, q, max;\n  char d;\n  for (i = 0; i < 26; i++)\n    a[i].p = 0;\n  for (i = 0, d = 'A'; i < 26; i++, d++) {\n    a[i].c = d;\n  }\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i].num >> b[i].s;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (b[i].s[j] == '\\0')\n        break;\n      for (k = 0; k < 26; k++) {\n        if (b[i].s[j] == a[k].c) {\n          a[k].n[a[k].p] = b[i].num;\n          a[k].p += 1;\n        }\n      }\n    }\n  }\n  max = a[0].p;\n  e = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i].p > max) {\n      e = a[i];\n      max = a[i].p;\n    }\n  }\n  printf(\"%c\\n\", e.c);\n  printf(\"%d\\n\", e.p);\n  for (j = 0; j < e.p; j++)\n    printf(\"%d\\n\", e.n[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "3299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char name[30] = {\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"}, c[1000][100];\n  int n, a[1000], num[100] = {0}, i, j, k, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    cin >> c[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; c[i][k] != '\\0'; k++) {\n      for (j = 0; name[j] != '\\0'; j++) {\n        if (name[j] == c[i][k]) {\n          num[j]++;\n        }\n      }\n    }\n  }\n  for (i = 0; name[i] != '\\0'; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[k], num[k]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; c[i][j] != '\\0'; j++) {\n      if (c[i][j] == name[k]) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, m, x[26] = {0}, y = 0, z;\n  char a[100][4], b[100][10], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    for (j = 0; j < m; j++) {\n      x[b[i][j] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (y < x[i]) {\n      y = x[i];\n      z = i;\n    }\n  }\n  c = z + 65;\n  printf(\"%c\\n%d\\n\", c, y);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i]);\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (b[i][j] == c)\n        y = 1;\n    }\n    if (y == 1)\n      cout << a[i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "3301", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int a;\n    char b[20];\n  } book[999];\n  int n, i, k, max, m, j, p;\n  int c[999] = {0};\n  char str1[20], str2[20];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].a, &book[i].b);\n    m = strlen(book[i].b);\n    strcpy(str1, book[i].b);\n    for (j = 0; j < m; j++)\n      c[str1[j]] = c[str1[j]] + 1;\n  }\n  max = 0;\n  for (p = 65; p < 91; p++) {\n    if (c[p] > max) {\n      max = c[p];\n      k = p;\n    }\n  }\n  printf(\"%c\\n\", k);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    strcpy(str2, book[i].b);\n    m = strlen(book[i].b);\n    for (j = 0; j < m; j++) {\n      if (str2[j] == k) {\n        printf(\"%d\\n\", book[i].a);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3302", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Article {\n  int number;\n  char author[26];\n};\n\nint main() {\n  struct Article book[1000];\n  int m, i;\n  int j, k;\n  int c;\n  int max = 0;\n  int writer[26] = {0};\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> book[i].number >> book[i].author;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].author[j] >= 'A' && book[i].author[j] <= 'Z') {\n        c = book[i].author[j] - 'A';\n        writer[c]++;\n      }\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max < writer[i]) {\n      max = writer[i];\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (max == writer[i]) {\n      printf(\"%c\\n\", i + 'A');\n      printf(\"%d\\n\", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < 26; k++) {\n          if (book[j].author[k] == i + 'A') {\n            printf(\"%d\\n\", book[j].number);\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\nstruct book *create(void) {\n  struct book *head, *p1, *p2;\n  int i;\n  cin >> m;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int num[26] = {0}, i, j, max = 0;\n  struct book *p1, *p2, *head;\n  char *p;\n  p1 = create();\n  head = p1;\n  for (i = 0; i < m; i++) {\n    for (p = p1->name; *p != '\u0000'; p++) {\n      num[(*p) - 'A']++;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      j = i;\n    }\n  }\n  printf(\"%c \", ('A' + j));\n  printf(\"%d \", max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    p = p1->name;\n    for (p = p1->name; *p != '\u0000'; p++) {\n      if (*p == ('A' + j)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint m;\nstruct book *head;\n\nstruct book *setup() {\n  int t = 0;\n  struct book *head, *p1, *p2;\n  head = p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  while (t < m - 1) {\n    t++;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint k = 0, max_1 = 0;\nvoid found(struct book *p) {\n  int i, j;\n  p = head;\n  int *pi;\n  pi = (int *)malloc(sizeof(int) * 26);\n  for (i = 0; i < 26; i++)\n    *(pi + i) = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++) {\n      (*(pi + (p->name[j] - 'A')))++;\n    }\n    p = p->next;\n  }\n  for (j = 0; j < 26; j++) {\n    if (*(pi + j) > max_1) {\n      max_1 = *(pi + j);\n      k = j;\n    }\n  }\n}\nint main() {\n  int i, j;\n  scanf(\"%d\", &m);\n  struct book *p;\n  head = p = setup();\n  found(p);\n  cout << (k + 'A') << \" \" << max_1 << \" \";\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      if (p->name[j] == k + 'A') {\n        printf(\"%d \", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char s[27];\n};\n\nstruct author {\n  int num;\n  int bn[1000];\n};\n\nint main() {\n  int m, i, j, l, max = 0;\n\n  char c;\n\n  struct book bk[1000];\n  struct author au['Z' + 1], t;\n\n  cin >> m;\n  for (j = 0; j < 'Z' + 1; j++)\n    au[j].num = 0;\n  for (i = 0; i < m; i++) {\n\n    cin >> bk[i].num >> bk[i].s;\n\n    l = strlen(bk[i].s);\n\n    for (j = 0; j < l; j++)\n      au[bk[i].s[j]].bn[au[bk[i].s[j]].num++] = bk[i].num;\n  }\n\n  for (j = 0; j < 'Z' + 1; j++)\n    if (au[j].num > max) {\n      t = au[j];\n      c = j;\n      max = au[j].num;\n    }\n\n  cout << c << \"\\n\";\n  printf(\"%d\\n\", t.num);\n\n  for (i = 0; i < t.num; i++)\n    printf(\"%d\\n\", t.bn[i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char name[20];\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nint main() {\n  int i;\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      a[(int)p->name[i] - 'A']++;\n    }\n    p = p->next;\n  }\n  int number, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c \", 'A' + number);\n  cout << max << \" \";\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      if (p->name[i] == 'A' + number)\n        break;\n    }\n    if (p->name[i] == 'A' + number)\n      printf(\"%d \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3307", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, name[26] = {0}, max, a[1000], t = 0;\n  char word[1000][30];\n  scanf(\"%d\", &n);\n  for (i = -1; i < n; i++) {\n\n    cin >> word[i];\n  }\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      while (word[i][k] != '\u0000') {\n        if (word[i][k] == 'A' + j)\n          name[j] = name[j] + 1;\n\n        k = k + 1;\n      }\n      k = 0;\n    }\n  }\n  k = 0;\n  max = name[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      j = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (word[i][k] != '\u0000') {\n      if (word[i][k] == 'A' + j) {\n\n        a[t] = i;\n        t = t + 1;\n        k = 0;\n        break;\n      }\n      k = k + 1;\n    }\n    k = 0;\n  }\n  printf(\"%c %d \", 'A' + j, max);\n  k = 0;\n  for (i = 0; i < t; i++) {\n    while (word[a[i]][k] != ' ') {\n      printf(\"%c\", word[a[i]][k]);\n      k = k + 1;\n    }\n    printf(\" \");\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int a[1000];\n  char s[1000][30], ch;\n  int b[30] = {0};\n  int i, k;\n  int n;\n  int max = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], s[i]);\n  for (i = 0; i < n; i++)\n    for (ch = 'A'; ch <= 'Z'; ch++)\n      if (strchr(s[i], ch) != NULL)\n        b[ch - 65]++;\n\n  for (i = 0; i <= 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", k + 65, max);\n  ch = k + 65;\n  for (i = 0; i < n; i++)\n    if (strchr(s[i], ch) != NULL)\n      printf(\"%d\\n\", a[i]);\n}\n"}
{"label": "2", "index": "3309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[400][400], t[400][400];\n  int n, m, i, j, k, l, p, y, z;\n  char c;\n  int a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", t[i], s[i]);\n  j = 0;\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    a[j] = p;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (m = j - 2; m >= i; m--) {\n      if (a[m] < a[m + 1]) {\n        y = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = y;\n      }\n    }\n  }\n  z = a[0];\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    if (p == z) {\n      printf(\"%c\\n\", c);\n      printf(\"%d\\n\", z);\n\n      for (k = 1; k <= n; k++) {\n        p = 0;\n        l = strlen(s[k]);\n        for (m = 0; m < l; m++) {\n          if (s[k][m] == c)\n            p++;\n        }\n        if (p > 0)\n          printf(\"%s\\n\", t[k]);\n      }\n      break;\n    }\n  }\n}\n"}
{"label": "2", "index": "3310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  char name[26];\n  int a;\n};\nint main() {\n  int n, i, k, l, m;\n  char j, t;\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  struct Student stu[999];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &stu[i].a, stu[i].name);\n\n  for (j = 'A', k = 0; j <= 'Z'; j++, k++)\n    for (i = 0; i < n; i++)\n      for (l = 0; l < 26; l++)\n        if (stu[i].name[l] == j)\n          b[k]++;\n  for (j = 'A', k = 0, m = 0; j <= 'Z'; j++, k++)\n    if (b[k] > m) {\n      m = b[k];\n      t = j;\n    }\n  printf(\"%c\\n%d\", t, m);\n  for (i = 0; i < n; i++)\n    for (l = 0; l < 26; l++)\n      if (stu[i].name[l] == t)\n        cout << \"\\n\" << stu[i].a;\n  return 0;\n}\n"}
{"label": "2", "index": "3311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[26];\n};\nchar max(int *p);\n\nint main() {\n  int m, b, i, *p;\n  struct book shu[999];\n  char c;\n  int writer[26];\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &shu[i].num, shu[i].author);\n  }\n  for (c = 'A', writer[c - 'A'] = 0; c <= 'Z'; c++) {\n    writer[c - 'A'] = 0;\n    for (i = 0; i < m; i++) {\n      for (b = 0; shu[i].author[b] != '\\0'; b++) {\n        if (c == shu[i].author[b]) {\n          writer[c - 'A']++;\n        }\n      }\n    }\n  }\n  p = writer;\n  printf(\"%c\\n%d\\n\", max(p), writer[max(p) - 'A']);\n  for (i = 0; i < m; i++) {\n    for (b = 0; shu[i].author[b] != '\\0'; b++) {\n      if (max(p) == shu[i].author[b]) {\n        cout << shu[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\nchar max(int *p) {\n  int i;\n  char max;\n  for (i = 0, max = 'A'; i < 26; i++) {\n    if (*(p + i) > *(p + max - 'A')) {\n      max = i + 'A';\n    }\n  }\n  return max;\n}\n"}
{"label": "2", "index": "3312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\nstruct student {\n  int id;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat() {\n  int i = 1;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &m);\n  scanf(\"%d %s\", &p1->id, p1->name);\n  head = NULL;\n  for (; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->id, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  int num[30] = {0}, max, j;\n  char i, auth;\n  head = creat();\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (i = 'A'; i <= 'Z'; i++) {\n      for (j = 0; j < strlen(p1->name); j++)\n        if (p1->name[j] == i)\n          num[i - 'A']++;\n    }\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      auth = i + 'A';\n    }\n  }\n  printf(\"%c \", auth);\n  printf(\"%d \", max);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++)\n      if (p1->name[j] == auth)\n        printf(\"%d \", p1->id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3313", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, a[100], b[26], s, max;\n  char c[100][50], m;\n  for (i = 0; i <= 25; i++)\n    b[i] = 0;\n  cin >> n;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++) {\n      s = (int)c[i][j] - 65;\n      b[s] = b[s] + 1;\n    }\n  }\n\n  max = b[0];\n  j = 0;\n\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      j = i;\n    }\n  }\n  m = j + 65;\n\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i <= n - 1; i++) {\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++)\n      if (c[i][j] == m)\n        printf(\"%d\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "3314", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[26], max, num[n], i, j, s;\n  char maxname, name[n][10];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> name[i];\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      a[name[i][j] - 'A']++;\n  }\n  max = a[0], maxname = 'A';\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i], maxname = 'A' + i;\n    }\n  printf(\"%c\\n%d\\n\", maxname, max);\n  for (i = 0; i < n; i++) {\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      if (name[i][j] == maxname)\n        cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, m, a[26][999], num[26] = {0}, t, max;\n  char zz[27];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &t, zz);\n    for (j = 0; j < strlen(zz); j++) {\n      a[(int)(zz[j] - 'A')][num[(int)(zz[j] - 'A')]] = t;\n      num[(int)(zz[j] - 'A')]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > num[max]) {\n      max = i;\n    }\n  }\n  cout << max + 'A' << \"\\n\" << num[max] << \"\\n\";\n  for (i = 0; i < num[max]; i++)\n    printf(\"%d\\n\", a[max][i]);\n}\n"}
{"label": "2", "index": "3316", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char zz[32];\n  struct book *next;\n};\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->zz);\n  head = NULL;\n  for (i = 0; i < n - 1; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->zz;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid search(struct book *head, int n) {\n  int *p[26], i, j;\n  struct book *q = head;\n  for (i = 0; i < 26; i++) {\n    p[i] = (int *)malloc(sizeof(int));\n    *p[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++)\n      (*p[(q->zz)[j] - 'A'])++;\n\n    q = q->next;\n  }\n  q = head;\n  int max = *p[0], k = 0;\n  for (i = 1; i < 26; i++) {\n    if (*p[i] > max) {\n      max = *p[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d\", 'A' + k, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      if ((q->zz)[j] == 'A' + k)\n        printf(\" %d\", q->num);\n    }\n    q = q->next;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat(n);\n  search(head, n);\n}\n"}
{"label": "2", "index": "3317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct information {\n  int a;\n  char s[26];\n  int len;\n} xinxi[1000];\n\nint main() {\n  int n, i, c[26] = {0}, max, t, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &xinxi[i].a, xinxi[i].s);\n    xinxi[i].len = strlen(xinxi[i].s);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++) {\n      if (xinxi[i].s[j] == 'A')\n        c[1]++;\n      if (xinxi[i].s[j] == 'B')\n        c[2]++;\n      if (xinxi[i].s[j] == 'C')\n        c[3]++;\n      if (xinxi[i].s[j] == 'D')\n        c[4]++;\n      if (xinxi[i].s[j] == 'E')\n        c[5]++;\n      if (xinxi[i].s[j] == 'F')\n        c[6]++;\n      if (xinxi[i].s[j] == 'G')\n        c[7]++;\n      if (xinxi[i].s[j] == 'H')\n        c[8]++;\n      if (xinxi[i].s[j] == 'I')\n        c[9]++;\n      if (xinxi[i].s[j] == 'J')\n        c[10]++;\n      if (xinxi[i].s[j] == 'K')\n        c[11]++;\n      if (xinxi[i].s[j] == 'L')\n        c[12]++;\n      if (xinxi[i].s[j] == 'M')\n        c[13]++;\n      if (xinxi[i].s[j] == 'N')\n        c[14]++;\n      if (xinxi[i].s[j] == 'O')\n        c[15]++;\n      if (xinxi[i].s[j] == 'P')\n        c[16]++;\n      if (xinxi[i].s[j] == 'Q')\n        c[17]++;\n      if (xinxi[i].s[j] == 'R')\n        c[18]++;\n      if (xinxi[i].s[j] == 'S')\n        c[19]++;\n      if (xinxi[i].s[j] == 'T')\n        c[20]++;\n      if (xinxi[i].s[j] == 'U')\n        c[21]++;\n      if (xinxi[i].s[j] == 'V')\n        c[22]++;\n      if (xinxi[i].s[j] == 'W')\n        c[23]++;\n      if (xinxi[i].s[j] == 'X')\n        c[24]++;\n      if (xinxi[i].s[j] == 'Y')\n        c[25]++;\n      if (xinxi[i].s[j] == 'Z')\n        c[26]++;\n    }\n  max = c[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", 64 + t);\n  cout << c[t] << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < xinxi[i].len; j++)\n      if (xinxi[i].s[j] == 64 + t)\n        printf(\"%d\\n\", xinxi[i].a);\n}\n"}
{"label": "2", "index": "3318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int p;\n  char a[m + 1][27];\n  int len[m + 1];\n  int b[m + 1];\n  int c[26];\n  int i, j, k, l;\n  for (i = 0; i <= 25; i++)\n    c[i] = 0;\n  for (i = 1; i <= m; i++) {\n    cin >> b[i];\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n    for (j = 0; j <= len[i] - 1; j++) {\n      c[a[i][j] - 'A']++;\n    }\n  }\n  int temp = -1;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > temp) {\n      temp = c[i];\n      p = i;\n    }\n  }\n  char n = 'A' + p;\n  cout << n << endl;\n  printf(\"%d\\n\", temp);\n  for (i = 1; i <= m; i++)\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (a[i][j] == '\\0') {\n        break;\n      } else if (a[i][j] == n) {\n        cout << b[i] << endl;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3319", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int bookno[100];\n  char author[100][26];\n  int numOfauthor[26] = {0};\n  int nbook, max = 0, maxno;\n  char maxauthor;\n  cin >> nbook;\n  int i, j;\n  for (i = 0; i < nbook; i++) {\n    scanf(\"%d \", &bookno[i]);\n    cin.get();\n    cin.getline(*(author + i), 26);\n  }\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      numOfauthor[author[i][j] - 'A']++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (numOfauthor[i] > max) {\n      max = numOfauthor[i];\n      maxno = i;\n    }\n  }\n  maxauthor = maxno + 'A';\n  cout << maxauthor << endl;\n  cout << numOfauthor[maxno] << endl;\n  for (i = 0; i < nbook; i++)\n    for (j = 0; author[i][j] != '\\0'; j++) {\n      if (author[i][j] == maxauthor)\n        cout << bookno[i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3320", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  cin >> n;\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i;\n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd)\n        printf(\"%d\\n\", p1->sl);\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3321", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p;\n  char q[1000][30];\n  int shu[26] = {0};\n  char zm[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int n, i, j, k;\n  int len, max = 0;\n  cin >> n;\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    len = 0;\n    scanf(\"%d %s\", &p[i], q[i]);\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (q[i][j] == zm[k])\n          shu[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (shu[i] > max) {\n      max = shu[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", zm[k], shu[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(q[i]);\n    for (j = 0; j < len; j++) {\n      if (q[i][j] == zm[k])\n        printf(\"%d\\n\", p[i]);\n    }\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "3322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char author[27];\n  int i, j, n, no, ab[26][1000] = {0}, an[26] = {0}, ma = 0, na, am;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> no >> author;\n    for (i = 0; i < 27; i++)\n      if (author[i] != '\\0')\n        ab[author[i] - 'A'][an[author[i] - 'A']] = no, an[author[i] - 'A']++;\n      else\n        break;\n  }\n  for (i = 0; i < 26; i++) {\n    na = 0;\n    for (j = 0; j < 999; j++)\n      if (ab[i][j] != 0)\n        na++;\n      else\n        break;\n    if (na > ma)\n      ma = na, am = i;\n  }\n  cout << (char)('A' + am) << endl << ma << endl;\n  for (i = 0; i < 1000; i++)\n    if (ab[am][i] != 0)\n      printf(\"%d\\n\", ab[am][i]);\n    else\n      break;\n  return 0;\n}\n"}
{"label": "2", "index": "3323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, temp = 26, n, p[27] = {0};\n  struct {\n    int a;\n    char s[30];\n  } t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &t[i].a, t[i].s);\n    for (j = 0; j < strlen(t[i].s); j++)\n      p[t[i].s[j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[temp])\n      temp = i;\n  }\n  cout << temp + 'A' << \"\\n\" << p[temp] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(t[i].s); j++) {\n      if (t[i].s[j] == temp + 'A') {\n        cout << t[i].a << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3324", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int record[26][1000];\n  memset(record, 0, sizeof(record));\n  char name[10];\n  int m, temp;\n  cin >> m;\n  for (int i = 0; i < m; i++) {\n    cin >> temp;\n    cin.get();\n    cin.getline(name, 10);\n    for (int i = 0; i < strlen(name); i++) {\n      record[name[i] - 65][record[name[i] - 65][0] + 1] = temp;\n      record[name[i] - 65][0]++;\n    }\n  }\n  int flag = 0;\n  for (int i = 0; i < 25; i++) {\n    if (record[i][0] > record[flag][0]) {\n      flag = i;\n    }\n  }\n  cout << (char)(flag + 65) << endl << record[flag][0] << endl;\n  for (int i = 1; i <= record[flag][0]; i++) {\n    printf(\"%d\\n\", record[flag][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n} b[999];\nint main() {\n  int i, j, m, n, k, max, p;\n  int a[26] = {0}, q[999] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].aut;\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++) {\n      k = b[i].aut[j];\n      a[k - 65]++;\n    }\n  }\n  for (i = 1, max = a[0], p = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++)\n      if (b[i].aut[j] == (p + 65))\n        q[i] = 1;\n  }\n  for (i = 0; i < m; i++)\n    if (q[i] == 1)\n      cout << \"\\n\" << b[i].num;\n}\n"}
{"label": "2", "index": "3326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  int book;\n  char author[26];\n  struct a *next;\n};\nstruct a *creat(int m) {\n  int i = 0;\n  struct a *p, *head, *temp;\n  head = NULL;\n  do {\n    p = (struct a *)malloc(sizeof(struct a));\n    if (p == NULL) {\n      exit(1);\n    }\n    scanf(\"%d %s\", &p->book, p->author);\n    if (head == NULL) {\n      head = p;\n      temp = p;\n    } else {\n      temp->next = p;\n      temp = p;\n    }\n    i++;\n  } while (i < m);\n  temp->next = NULL;\n  return (head);\n}\nint main() {\n  int h, m, i, j, zimu[26] = {0};\n  struct a *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] >= 'A' && p->author[j] <= 'Z') {\n        zimu[p->author[j] - 'A']++;\n      }\n    }\n    p = p->next;\n  }\n  h = 0;\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > zimu[h])\n      h = i;\n  }\n  printf(\"%c\\n%d\\n\", 'A' + h, zimu[h]);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] == 'A' + h) {\n        printf(\"%d\\n\", p->book);\n        break;\n      }\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int num;\n    char a[25];\n  } book[999];\n  int i, j;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].a);\n  }\n  int s[26] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      s[book[i].a[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  char name;\n  for (i = 0; i <= 25; i++) {\n    if (s[i] > max) {\n      max = s[i];\n      name = 'A' + i;\n    }\n  }\n  printf(\"%c \", name);\n  printf(\"%d \", max);\n  for (i = 0; i <= n - 1; i++) {\n    int len = strlen(book[i].a);\n    for (j = 0; j < len; j++) {\n      if (book[i].a[j] == name)\n        printf(\"%d \", book[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, num[100], k = 0, count[26] = {0}, max = 0;\n  char nam[100][30] = {NULL};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cin.get();\n\n    cin >> nam[i];\n    for (j = 0; j < strlen(nam[i]); j++)\n      count[nam[i][j] - 'A']++;\n  }\n  max = count[0];\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      k = i;\n    } else\n      continue;\n  }\n  j = 0;\n  printf(\"%c\\n\", (char)(k + 'A'));\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++)\n    for (j = 0;; j++) {\n      if (nam[i][j] == k + 'A') {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n      if (nam[i][j] == NULL)\n        break;\n    }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint cishu[26];\n\nstruct shu {\n  int num;\n  char name[26];\n  struct shu *next;\n};\n\nstruct shu *app(int n) {\n  int i, len, j;\n  struct shu *newnode, *p, *head;\n  for (i = 1; i <= n; i++) {\n    newnode = (struct shu *)malloc(sizeof(struct shu));\n    cin >> newnode->num >> newnode->name;\n    len = strlen(newnode->name);\n\n    for (j = 0; j < len; j++) {\n      cishu[newnode->name[j] - 'A']++;\n    }\n\n    if (i == 1) {\n      head = newnode;\n    } else {\n      p->next = newnode;\n    }\n    p = newnode;\n  }\n  p->next = 0;\n  return head;\n}\n\nint max(void) {\n  int m = 0, i, x;\n  for (i = 0; i < 26; i++) {\n    if (cishu[i] > m) {\n      m = cishu[i];\n      x = i;\n    }\n  }\n  return x;\n}\n\nint cunzai(char a[], int kk) {\n  int l, i;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (a[i] == kk + 'A')\n      return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int n, kk;\n  struct shu *head, *p;\n  cin >> n;\n\n  head = app(n);\n  kk = max();\n  printf(\"%c\\n%d\\n\", 'A' + kk, cishu[kk]);\n\n  for (p = head; p != 0; p = p->next) {\n    if (cunzai(p->name, kk)) {\n      printf(\"%d\\n\", p->num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int m, i, j, k, num[10000], max = 0, t = 0;\n  char a[10000][26];\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    scanf(\"%s\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i][j] == c[k])\n          b[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", c[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i][j] == c[t]) {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "2", "index": "3331", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    char num[100], wri[26];\n  } bo[1000];\n  int i, j, k, l, n, m = 0, a[26] = {0}, mw;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num >> bo[i].wri;\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      a[bo[i].wri[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (a[i] > m) {\n      m = a[i];\n      mw = 65 + i;\n    }\n  printf(\"%c\\n%d\\n\", mw, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(bo[i].wri);\n    for (j = 0; j < l; j++)\n      if (bo[i].wri[j] == mw) {\n        puts(bo[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3332", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  int num[1001];\n\n  char name[1001][27];\n  for (int i = 0; i < m; ++i) {\n    cin >> num[i];\n    cin.get();\n    cin.getline(name[i], 27);\n  }\n  int count[100];\n  memset(count, 0, sizeof(count));\n  int record[27][1000];\n  int start = 0;\n  int i, j;\n  char call;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++)\n      count[name[i][j]]++;\n  }\n  int max = 0;\n  char t;\n  for (char w = 'A'; w <= 'Z'; w++) {\n    if (count[(int)w] > max) {\n      max = count[(int)w];\n      t = w;\n    }\n  }\n  cout << t << endl;\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == t) {\n        cout << num[i] << endl;\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  char writter[27];\n  int data[26][1000];\n  memset(data, 0, sizeof(data));\n  int max = 0;\n  char max_name;\n  for (int i = 1; i <= m; i++) {\n    int number;\n    cin >> number >> writter;\n    for (int j = 0; j < strlen(writter); j++) {\n      data[writter[j] - 65][0]++;\n      data[writter[j] - 65][data[writter[j] - 65][0]] = number;\n      if (max < data[writter[j] - 65][0]) {\n        max = data[writter[j] - 65][0];\n        max_name = writter[j];\n      }\n    }\n  }\n  cout << max_name << endl << max << endl;\n  for (int i = 1; i <= max; i++)\n    cout << data[max_name - 65][i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0;\n  int zuozhe[26] = {0};\n  char maxer;\n  struct book {\n    int num;\n    char author[26];\n  } shu[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n    for (j = 0; j < 26; j++)\n      zuozhe[shu[i].author[j] - 65]++;\n  }\n  for (j = 0; j < 26; j++)\n    if (zuozhe[j] > max) {\n      max = zuozhe[j];\n      maxer = j + 65;\n    }\n  cout << maxer << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (shu[i].author[j] == maxer) {\n        cout << shu[i].num << \"\\n\";\n        continue;\n      }\n}\n"}
{"label": "2", "index": "3335", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, q = 0, t = 0, u, max;\n  int b[26] = {0};\n  char c[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  struct as {\n    int sh;\n    char a[26];\n  } cla[1000];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> cla[i].sh >> cla[i].a;\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++) {\n      u = cla[i].a[k] - 'A';\n      b[u]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++)\n    if (max < b[j]) {\n      max = b[j];\n      q = j;\n    }\n  printf(\"%c\\n\", c[q]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    t = (int)strlen(cla[i].a);\n    for (k = 0; k < t; k++)\n      if (cla[i].a[k] == c[q]) {\n        printf(\"%d\\n\", cla[i].sh);\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int order;\n  int num;\n  char writer[26];\n} b[1000];\nint main() {\n  int n, i, j, k, p, q[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].writer);\n    b[i].order = i;\n  }\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26];\n  char d[26];\n  for (j = 0; j <= 25; j++) {\n    d[j] = 0;\n    c[j] = 0;\n  }\n  for (k = 0; k <= 25; k++) {\n    for (i = 0; i <= (n - 1); i++) {\n      p = strlen(b[i].writer);\n      strcpy(d, b[i].writer);\n      for (j = 0; j <= (p - 1); j++) {\n        if (d[j] == a[k]) {\n          c[k] = c[k] + 1;\n        }\n      }\n      for (j = 0; j <= 25; j++) {\n        d[j] = 0;\n      }\n    }\n  }\n  int max = c[0];\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > max) {\n      max = c[i];\n    }\n  }\n  char x;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] == max) {\n      x = a[i];\n      printf(\"%c\\n\", a[i]);\n      printf(\"%d\\n\", c[i]);\n    }\n  }\n\n  for (i = 0; i <= 999; i++) {\n    q[i] = 0;\n  }\n  int r = 0;\n  char e[26];\n  for (i = 0; i <= 25; i++) {\n    e[i] = 0;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    p = strlen(b[i].writer);\n    strcpy(e, b[i].writer);\n    for (j = 0; j <= (p - 1); j++) {\n      if (e[j] == x) {\n        q[r] = b[i].num;\n        r = r + 1;\n      }\n    }\n    for (j = 0; j <= 25; j++) {\n      e[j] = 0;\n    }\n  }\n  int s = 0;\n  for (i = 0; i <= 999; i++) {\n    if (q[i] != 0) {\n      s = s + 1;\n    }\n  }\n  for (i = 0; i <= (s - 2); i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  printf(\"%d\", q[s - 1]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int n, i, a, max = 0, alp[26] = {0};\n  char *j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].author;\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      int x = *j;\n      ++*(alp + x - 65);\n      if (*(alp + x - 65) > max) {\n        max = *(alp + x - 65);\n        a = x;\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", a, max);\n\n  for (i = 0; i < n; i++) {\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      if ((int)*j == a) {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int n;\n    char a[26];\n  };\n  struct book book[999];\n  int m, c[26] = {0}, k;\n  char w[26];\n  cin >> m;\n  int i, j, max = 0, t;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, book[i].a);\n  for (i = 0; i < 26; i++)\n    w[i] = 'A' + i;\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++) {\n        if (book[j].a[k] == w[i])\n          c[i]++;\n      }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      t = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w[t], c[t]);\n  for (j = 0; j < m; j++)\n    for (k = 0; k < 26; k++) {\n      if (book[j].a[k] == w[t]) {\n        printf(\"%d\\n\", book[j].n);\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n > 0) {\n    struct a {\n      char y[30];\n      int x, l;\n    } a[1000];\n    struct b {\n      char y;\n      int x;\n    } b[26];\n    int i, j, p;\n    char k;\n    for (i = 0; i < n; i++) {\n      scanf(\"%d %s\", &a[i].x, &a[i].y);\n      a[i].l = strlen(a[i].y);\n    }\n    for (i = 0; i <= 25; i++) {\n      b[i].y = i + 65;\n      b[i].x = 0;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < a[i].l; j++) {\n        for (k = 65; k <= 90; k++) {\n          if (a[i].y[j] == k)\n            b[k - 65].x = b[k - 65].x + 1;\n        }\n      }\n    }\n    int max = b[0].x;\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x > max)\n        max = b[i].x;\n    }\n    for (i = 0; i <= 25; i++) {\n      if (b[i].x == max) {\n        printf(\"%c\\n\", b[i].y);\n        printf(\"%d\\n\", b[i].x);\n        for (j = 0; j < n; j++) {\n          for (p = 0; p < a[j].l; p++) {\n            if (a[j].y[p] == b[i].y) {\n              cout << a[j].x << \"\\n\";\n              break;\n            }\n          }\n        }\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int maxc = 0, i, j, n, a[1000], c;\n  char maxp, b[1000][27], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n  }\n  for (p = 'A'; p <= 'Z'; p++) {\n    c = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0;; j++) {\n        if (b[i][j] == '\\0')\n          break;\n        if (b[i][j] == p) {\n          c++;\n        }\n      }\n    }\n    if (c > maxc) {\n      maxc = c;\n      maxp = p;\n    }\n  }\n  cout << maxp << \"\\n\";\n  printf(\"%d\\n\", maxc);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (b[i][j] == '\\0')\n        break;\n      if (b[i][j] == maxp) {\n        printf(\"%d\\n\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t[26] = {0}, k = 0, max, h;\n  scanf(\"%d\", &n);\n\n  struct book {\n    int a;\n    char b[26];\n  } book[100] = {0, \"\"};\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].a, book[i].b);\n\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      t[book[i].b[j] - 65]++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (t[i] > max) {\n      max = t[i];\n      h = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", h + 65, max);\n  for (i = 0; i < n; i++) {\n    k = strlen(book[i].b);\n    for (j = 0; j < k; j++) {\n      if (book[i].b[j] == h + 65)\n        printf(\"%d\\n\", book[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "3342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, a[100], b[26], s, max;\n  char c[100][50], m;\n  for (i = 0; i <= 25; i++)\n    b[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i], c[i]);\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++) {\n      s = (int)c[i][j] - 65;\n      b[s] = b[s] + 1;\n    }\n  }\n  max = b[0];\n  j = 0;\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      j = i;\n    }\n  }\n  m = j + 65;\n  printf(\"%c\\n\", m);\n  printf(\"%d\\n\", max);\n  for (i = 0; i <= n - 1; i++) {\n    l = strlen(c[i]);\n    for (j = 0; j <= l - 1; j++)\n      if (c[i][j] == m)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, l, j, t, k[30][99], a[30], o, q, max = 0, maxman;\n  for (i = 0; i < 30; i++)\n    a[i] = 0;\n  char s[40];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %s\", &o, s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      q = s[i] - 'A';\n      a[q]++;\n      t = a[q];\n      k[q][t] = o;\n    }\n  }\n  for (i = 'A' - 'A'; i <= 'Z' - 'A'; i++) {\n    if (a[i] > max) {\n      \n      max = a[i];\n      maxman = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxman + 'A', max);\n  for (i = 1; i <= max; i++)\n\n    printf(\"%d\\n\", k[maxman][i]);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int n, i, a, max = 0, alp[26] = {0};\n  char *j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      int x = *j;\n      ++*(alp + x - 65);\n      if (*(alp + x - 65) > max) {\n        max = *(alp + x - 65);\n        a = x;\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", a, max);\n\n  for (i = 0; i < n; i++) {\n    int len = strlen(book[i].author);\n    for (j = book[i].author; j < (book[i].author + len); j++) {\n      if ((int)*j == a)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3345", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char zz[26];\n} b[999];\nint main() {\n  int m, i, num[26] = {0}, maxz, j;\n  char string[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i].id >> b[i].zz;\n    for (j = 0; b[i].zz[j] != '\\0'; j++)\n      num[b[i].zz[j] - 'A']++;\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++)\n    if (max < num[i]) {\n      max = num[i];\n      maxz = i;\n    }\n  printf(\"%c\\n%d\", maxz + 65, max);\n  for (i = 0; i < m; i++)\n    for (j = 0; b[i].zz[j] != '\\0'; j++) {\n      if (b[i].zz[j] == maxz + 65)\n        printf(\"\\n%d\", b[i].id);\n      else\n        continue;\n    }\n}\n"}
{"label": "2", "index": "3346", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book *head;\nint abc[26];\nstruct book {\n  int num;\n  char name[1000];\n  struct book *next;\n};\n\nvoid ffind(char *name) {\n  while (*name != 0) {\n    abc[*name - 65]++;\n    name++;\n  }\n}\nint mfind(char *name, char a) {\n  while (*name != 0) {\n    if (a == *name)\n      return 1;\n    name++;\n  }\n}\n\nstruct book *creat(int max) {\n  int n;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  head = 0;\n  do {\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    ffind(p1->name);\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p2->next = 0;\n    p1 = (struct book *)malloc(1000);\n  } while (n < max);\n  p2->next = 0;\n  return head;\n}\n\nint main() {\n  int n, i;\n  int max = 0, maxi = 0;\n  char tt[2];\n  struct book *p, *p1;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  p1 = p;\n\n  for (i = 0; i < 26; i++) {\n    if (abc[i] > max) {\n      max = abc[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%C %d \", 65 + maxi, max);\n\n  tt[0] = maxi + 65;\n  tt[1] = 0;\n  do {\n    if (mfind(p1->name, maxi + 65) == 1) {\n      max--;\n      if (max != 0)\n        printf(\"%d \", p1->num);\n      else\n        printf(\"%d\", p1->num);\n    }\n    p1 = p1->next;\n  } while (p1 != 0);\n}\n"}
{"label": "2", "index": "3347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, sum[27] = {0}, max = 0, author;\n  cin >> m;\n  char str[1000][4], name[1000][27];\n  for (int i = 0; i < m; i++)\n    cin >> str[i] >> name[i];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++)\n      sum[name[i][j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      author = i;\n    }\n  }\n  cout << (char)('A' + author) << endl;\n  cout << max << endl;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] - 'A' == author)\n        printf(\"%s\\n\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], i, l, c[26] = {0}, k, max, n, j;\n  char b[100][26],\n      d[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i], b[i]);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      else if (b[i][j] == 'B')\n        c[1]++;\n      else if (b[i][j] == 'C')\n        c[2]++;\n      else if (b[i][j] == 'D')\n        c[3]++;\n      else if (b[i][j] == 'E')\n        c[4]++;\n      else if (b[i][j] == 'F')\n        c[5]++;\n      else if (b[i][j] == 'G')\n        c[6]++;\n      else if (b[i][j] == 'H')\n        c[7]++;\n      else if (b[i][j] == 'I')\n        c[8]++;\n      else if (b[i][j] == 'J')\n        c[9]++;\n      else if (b[i][j] == 'K')\n        c[10]++;\n      else if (b[i][j] == 'L')\n        c[11]++;\n      else if (b[i][j] == 'M')\n        c[12]++;\n      else if (b[i][j] == 'N')\n        c[13]++;\n      else if (b[i][j] == 'O')\n        c[14]++;\n      else if (b[i][j] == 'P')\n        c[15]++;\n      else if (b[i][j] == 'Q')\n        c[16]++;\n      else if (b[i][j] == 'R')\n        c[17]++;\n      else if (b[i][j] == 'S')\n        c[18]++;\n      else if (b[i][j] == 'T')\n        c[19]++;\n      else if (b[i][j] == 'U')\n        c[20]++;\n      else if (b[i][j] == 'V')\n        c[21]++;\n      else if (b[i][j] == 'W')\n        c[22]++;\n      else if (b[i][j] == 'X')\n        c[23]++;\n      else if (b[i][j] == 'Y')\n        c[24]++;\n      else if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  max = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] >= max) {\n      max = c[i];\n      k = i;\n    }\n  printf(\"%c\\n\", d[k]);\n  printf(\"%d\\n\", c[k]);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == d[k])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Book_num(char a[]) {\n  int j, num;\n  j = 1;\n  if ((j = 1) && a[j] == ' ') {\n    num = a[0] - 48;\n  } else\n    j++;\n  if ((j = 2) && a[j] == ' ') {\n    num = a[1] - 48 + (a[0] - 48) * 10;\n  } else\n    j++;\n  if ((j = 3) && a[j] == ' ') {\n    num = a[2] - 48 + (a[1] - 48) * 10 + (a[0] - 48) * 100;\n  }\n  return num;\n}\n\nint main() {\n  int m, bk1, i, max, j, wrt;\n  int author[26][999] = {0};\n  char data[999][30];\n  cin >> m;\n  for (i = 0; i < m; i++) {\n\n    cin >> data[i];\n    data[i][strlen(data[i])] = '\\0';\n  }\n  max = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; data[i][j] != '\\0'; j++) {\n      if (data[i][j] > 64) {\n        wrt = data[i][j] - 65;\n        for (bk1 = 0; author[wrt][bk1] != 0; bk1++) {\n          ;\n        }\n        author[wrt][bk1] = Book_num(data[i]);\n        if (bk1 > max) {\n          max = bk1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i][max] != 0) {\n      printf(\"%d\\n\", i + 65);\n      printf(\"%d\\n\", max + 1);\n      for (j = 0; j <= max; j++) {\n        printf(\"%d\\n\", author[i][j]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct x {\n    int num;\n    char name[26];\n  } book[1000];\n  int i, j, m, n, k, ex;\n\n  int count[26] = {0},\n      num[26] = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n                 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      ex = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = ex;\n      ex = num[i];\n      num[i] = num[i + 1];\n      num[i + 1] = ex;\n    }\n  }\n  cout << num[25] << \" \" << count[25] << \" \";\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == num[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3351", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, len, i, j, k, max;\n  int c[26] = {0};\n  char a[26], f, x;\n  struct book {\n    int num;\n    char author[26];\n  };\n  struct book b[1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, &b[i].author);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ('A' <= (x = a[j]) && (x = a[j]) <= 'Z')\n        c[x - 'A']++;\n  }\n  max = c[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++) {\n      if ((f = a[j]) == k + 'A')\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3352", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[1000];\n  int len;\n} b[1000];\nvoid fun(int count[1000], char s[1000], int len) {\n  int i;\n  for (i = 0; i < len; i++) {\n    int m;\n    m = s[i] - 'A';\n    count[m]++;\n  }\n}\nint judge(char s[1000], int len, char name) {\n  int i, answer = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == name) {\n      answer = 1;\n      break;\n    }\n  }\n  return answer;\n}\n\nint main() {\n  int m, k, count[1000] = {0}, i, j, max, num;\n  char name;\n  cin >> m;\n  for (k = 0; k < m; k++) {\n    scanf(\"%d%s\", &b[k].id, b[k].s);\n    b[k].len = strlen(b[k].s);\n    fun(count, b[k].s, b[k].len);\n  }\n  max = count[0];\n  num = 0;\n  for (j = 1; j < 1000; j++) {\n    if (count[j] > max) {\n      max = count[j];\n      num = j;\n    }\n  }\n  name = num + 65;\n  printf(\"%c \", name);\n  printf(\"%d \", max);\n  for (k = 0; k < m; k++) {\n    int answer = 0;\n    answer = judge(b[k].s, b[k].len, name);\n    if (answer == 1)\n      printf(\"%d \", b[k].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int a;\n  char s[26];\n  struct st *n;\n};\nstruct st *creat(int m) {\n  int i;\n  struct st *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->n = p1;\n    scanf(\"%d %s\", &p1->a, p1->s);\n    p2 = p1;\n  }\n  p1->n = NULL;\n  return (head);\n}\nint main() {\n  int m;\n  struct st *creat(int m);\n  cin >> m;\n  struct st *p, *q;\n  p = creat(m);\n  q = p;\n  int i, j, k;\n  int a[26] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < (k = strlen(p->s)); j++)\n      a[p->s[j] - 65]++;\n    p = p->n;\n  }\n  p = q;\n  int max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  char c;\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      c = i + 65;\n      printf(\"%c %d \", c, a[i]);\n      break;\n    }\n  }\n  char cc;\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      cc = q->s[j];\n      if (cc == '\u0000')\n        break;\n      if (c == cc)\n        printf(\"%d \", q->a);\n    }\n    q = q->n;\n  }\n}\n"}
{"label": "2", "index": "3354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char str[26];\n} bk[1000];\nint main() {\n  int m, i, j, k, s, n = 0;\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n                'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int b[26] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].str);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      for (k = 0; k < 26; k++)\n        if (a[k] == bk[i].str[j])\n          b[k]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > n) {\n      n = b[i];\n      s = i;\n    }\n  printf(\"%c\\n%d\\n\", a[s], b[s]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(bk[i].str); j++)\n      if (bk[i].str[j] == a[s])\n        printf(\"%d\\n\", bk[i].num);\n  return 0;\n}\n"}
{"label": "2", "index": "3355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct node {\n  int num;\n  char name[26];\n  struct node *next;\n};\nint n = 1, m;\nstruct zuozhe {\n  char name;\n  int books[300];\n  int num;\n} zuozhe[26];\n\nstruct node *getlinked() {\n  struct node *head, *newnode, *thisnode;\n\n  do {\n    newnode = (struct node *)malloc(sizeof(struct node));\n    if (newnode == NULL) {\n      printf(\"malloc failed\");\n      exit(-1);\n    }\n    scanf(\"%d%s\", &newnode->num, &newnode->name);\n    newnode->next = NULL;\n    if (n == 1) {\n      thisnode = newnode;\n      head = newnode;\n    } else {\n      thisnode->next = newnode;\n    }\n    if (n <= m) {\n      thisnode = newnode;\n      n++;\n    }\n  } while (n <= m);\n  return head;\n}\nvoid tongji(struct node *p, int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < strlen(p->name); j++) {\n      zuozhe[(p->name)[j] - 'A'].books[zuozhe[(p->name)[j] - 'A'].num] = p->num;\n      zuozhe[(p->name)[j] - 'A'].num++;\n    }\n    p = p->next;\n  }\n}\n\nvoid bubble(struct zuozhe array[], int n) {\n  int i = 0, pass;\n  struct zuozhe temp;\n\n  for (pass = 1; pass <= n; pass++) {\n    for (i = 0; i < n - pass; i++) {\n      if (array[i].num < array[i + 1].num) {\n        temp = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = temp;\n      }\n    }\n  }\n  return;\n}\n\nint main() {\n  struct node *p;\n  int i;\n  cin >> m;\n  p = getlinked();\n  for (i = 0; i < 26; i++) {\n    zuozhe[i].name = 'A' + i;\n    zuozhe[i].num = 0;\n  }\n  tongji(p, m);\n  bubble(zuozhe, 26);\n  printf(\"%c\\n%d\\n\", zuozhe[0].name, zuozhe[0].num);\n  for (i = 0; i < zuozhe[0].num; i++) {\n    printf(\"%d\\n\", zuozhe[0].books[i]);\n  }\n}\n"}
{"label": "2", "index": "3356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char name[20];\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nint main() {\n  int i;\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n\n  while (p != NULL) {\n    for (i = 0; i < 20; i++)\n      a[(int)p->name[i] - 'A']++;\n\n    p = p->next;\n  }\n  int number, max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  printf(\"%c \", 'A' + number);\n  printf(\"%d \", max);\n  p = head;\n  while (p != NULL) {\n    for (i = 0; i < 20; i++) {\n      if (p->name[i] == 'A' + number)\n        break;\n    }\n    if (p->name[i] == 'A' + number)\n      printf(\"%d \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct tushu {\n  int bianhao;\n  char writer[27];\n} book[1000];\nvoid jishu(struct tushu *p1, int a[26], int b);\nint max(int c[26]);\nvoid shu(struct tushu *p2, int d, int e);\n\nint main() {\n  int n, i, m;\n  int zimu[26];\n  struct tushu *pointer;\n  pointer = &book[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].bianhao, &book[i].writer);\n  }\n  jishu(pointer, zimu, n);\n  m = max(zimu);\n  shu(pointer, m, n);\n  return 0;\n}\nvoid jishu(struct tushu *p1, int a[26], int b) {\n  int j, k, diji;\n  for (j = 0; j < 26; j++) {\n    a[j] = 0;\n  }\n  for (j = 0; j < b; j++) {\n    k = 0;\n    do {\n      diji = (*(p1 + j)).writer[k] - 'A';\n      a[diji]++;\n      k++;\n    } while ((*(p1 + j)).writer[k] != '\\0');\n  }\n}\nint max(int c[26]) {\n  int k, da, jieguo = 0;\n  da = c[0];\n  for (k = 1; k < 26; k++) {\n    if (c[k] > da) {\n      da = c[k];\n      jieguo = k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 65 + jieguo, da);\n  return (jieguo);\n}\nvoid shu(struct tushu *p2, int d, int e) {\n  char ai = 65 + d;\n  int x, y;\n  for (x = 0; x < e; x++) {\n    y = 0;\n    do {\n      if ((*(p2 + x)).writer[y] == ai) {\n        printf(\"%d\\n\", (p2 + x)->bianhao);\n      }\n      y++;\n    } while ((*(p2 + x)).writer[y] != '\\0');\n  }\n}\n"}
{"label": "2", "index": "3358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, b[1000], p[26];\n  char *bm[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    p[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n    bm[i] = (char *)malloc(26 * sizeof(char));\n    scanf(\"%s\", bm[i]);\n    for (j = 0; j < strlen(bm[i]); j++)\n      p[(int)(*(bm[i] + j) - 'A')]++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (p[i] > p[max])\n      max = i;\n  }\n  printf(\"%c\\n\", (char)('A' + max));\n  printf(\"%d\\n\", p[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(bm[i]); j++) {\n      if (bm[i][j] == (char)('A' + max)) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  }\n  return 1;\n}\n"}
{"label": "2", "index": "3359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, max1, t, k, x[28] = {0}, n, a, b, c, d, i, j;\n  char cc, y[100][32], q;\n  scanf(\"%d\", &n);\n  scanf(\"%c\", &cc);\n  for (i = 1; i <= n; i++) {\n\n    cin >> y[i];\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] >= 'A' && y[i][j] <= 'Z') {\n        x[y[i][j] + 1 - 'A']++;\n      }\n    }\n  }\n  max = x[1];\n  max1 = 1;\n  for (i = 2; i <= 26; i++) {\n    if (x[i] > max) {\n      max = x[i];\n      max1 = i;\n    }\n  }\n  q = 'A' - 1 + max1;\n  printf(\"%c \", q);\n  printf(\"%d \", max);\n  for (i = 1; i <= n; i++) {\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] == q) {\n        for (t = 0; y[i][t]; t++) {\n          if (y[i][t] == ' ')\n            break;\n          else\n            cout << y[i][t];\n        }\n        printf(\" \");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, t, m, a[26] = {0}, book[999], max;\n  char writer[999][26], maxwriter;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i], writer[i]);\n    m = strlen(writer[i]);\n    for (j = 0; j < m; j++) {\n      t = writer[i][j] - 'A';\n      a[t]++;\n    }\n  }\n  max = 0;\n  maxwriter = 'A';\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxwriter = 'A' + i;\n    }\n  }\n  cout << maxwriter << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(writer[i]); j++) {\n      if (writer[i][j] == maxwriter) {\n        cout << book[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3361", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[20];\n  struct book *next;\n};\nint i, j, n, t, number[100], m;\nstruct book *creat(void) {\n  struct book *p1, *p2, *head;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->name;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  cin >> m;\n  struct book *creat(void);\n  struct book *head, *p;\n  int a[26] = {0}, max, maxindex = 0;\n  head = p = creat();\n  char *pointer;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      for (i = 0; i < 26; i++) {\n        if (*pointer == 65 + i)\n          a[i]++;\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n  max = a[0];\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxindex = i;\n    }\n  }\n  printf(\"%c %d \", 65 + maxindex, a[maxindex]);\n  p = head;\n  do {\n    for (pointer = p->name; *pointer != '\u0000'; pointer++) {\n      if (*pointer == 65 + maxindex)\n        printf(\"%d \", p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "3362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k[100], l[26] = {0}, m = 0, v, j;\n  char c[100][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &k[i], c[i]);\n    for (j = 0; j < strlen(c[i]); j++)\n      l[(int)c[i][j] - 65] += 1;\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] > m)\n      m = l[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (l[i] == m) {\n      printf(\"%c\\n%d\\n\", i + 65, l[i]);\n      break;\n    }\n  }\n  for (v = 0; v < n; v++) {\n    for (j = 0; j < strlen(c[v]); j++) {\n      if (c[v][j] == i + 65)\n        cout << k[v] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "2", "index": "3363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b = 0, max;\n  int let[26] = {0};\n  char a;\n  struct student {\n    int num;\n    char name[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num, &book[i].name);\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++)\n      let[book[i].name[j] - 'A']++;\n  }\n  max = let[0];\n  for (i = 0; i < 25; i++) {\n    if (let[i] > max) {\n      max = let[i];\n      b = i;\n    }\n  }\n  a = b + 'A';\n  printf(\"%c\\n%d\\n\", a, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(book[i].name);\n    for (j = 0; j < m; j++) {\n      if (book[i].name[j] == a) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3364", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char name[26];\n  int name_num[26];\n} book[999];\n\nint main() {\n  int n; \n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &book[i].num,\n          &book[i].name); \n  }\n\n  int count[26] = {0};\n  int k;\n  for (i = 0; i < n; i++) {\n    int len;\n    len = strlen(book[i].name);\n    for (k = 0; k < len; k++) {\n      book[i].name_num[k] = (int)book[i].name[k];\n    }\n  }\n\n  int j;\n  int y;\n  for (i = 0; i < n; i++) {\n    int len_1;\n    len_1 = strlen(book[i].name);\n    for (j = 65; j <= 90; j++) {\n      for (y = 0; y < len_1; y++) {\n        if (book[i].name_num[y] == j) {\n          count[j - 65]++;\n        }\n      }\n    }\n  }\n\n  int w;\n  int max = count[0];\n  int t = 0;\n  for (w = 0; w < 26; w++) {\n    if (count[w] > max) {\n      max = count[w];\n      t = w;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  int x;\n  int total = 0;\n  for (i = 0; i < n; i++) {\n    int length;\n    length = strlen(book[i].name);\n    for (x = 0; x < length; x++) {\n      if (book[i].name_num[x] == t + 65) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3365", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  char writer[32];\n  int id;\n  struct book *next;\n};\nstruct book *create(int m) {\n  struct book *head = NULL, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->id, p1->writer);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->id >> p1->writer;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct book *head, *p;\n  int m, i, *q1, *q2, j;\n  q1 = (int *)malloc(26 * sizeof(int *));\n  q2 = q1;\n  for (i = 0; i < 26; i++)\n    q1[i] = 0;\n  q1 = q2;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      q1[p->writer[j] - 'A']++;\n    p = p->next;\n  }\n  q1 = q2;\n  int max = 0;\n  char maxm = 'A';\n  for (i = 0; i < 26; i++)\n    if (max < q1[i]) {\n      max = q1[i];\n      maxm = i + 'A';\n    }\n  printf(\"%c %d\", maxm, max);\n  for (i = 0, p = head; i < m; i++, p = p->next)\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == maxm)\n        printf(\" %d\", p->id);\n}\n"}
{"label": "2", "index": "3366", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct tushu {\n  int num;\n  char name[20];\n  struct tushu *next;\n};\nstruct tushu *creat(int m) {\n  struct tushu *head, *p1, *p2;\n  p1 = p2 = (struct tushu *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->name);\n  head = p1;\n  int i;\n  for (i = 2; i <= m; i++) {\n    p1 = (struct tushu *)malloc(1000);\n    scanf(\"%d%s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, num[26] = {0}, i, max;\n  scanf(\"%d\", &m);\n  struct tushu *head, *p1;\n  head = creat(m);\n  char *x;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    x = p1->name;\n    while (p1 != NULL) {\n      while (*x != '\u0000') {\n        if (*x == (i + 65))\n          num[i] = num[i] + 1;\n        x = x + 1;\n      }\n      p1 = p1->next;\n      x = p1->name;\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (num[max] < num[i])\n      max = i;\n  }\n  printf(\"%c \", max + 65);\n  printf(\"%d \", num[max]);\n  p1 = head;\n  x = p1->name;\n  while (p1 != NULL) {\n    while (*x != '\u0000') {\n      if (*x == (max + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n      x = x + 1;\n    }\n    p1 = p1->next;\n    x = p1->name;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3367", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct worker {\n  int name;\n  char au[20];\n  struct worker *next;\n};\nstruct help {\n  char author;\n  int max;\n};\nstruct worker *creat(int m) {\n  struct worker *p1, *p2, *p;\n  int i;\n  p1 = p2 = (struct worker *)malloc(sizeof(struct worker));\n\n  cin >> p1->name >> p1->au;\n  p = p1;\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p1->name, p1->au);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return p;\n}\nvoid print(struct worker *p) {\n  struct worker *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%d %s\\n\", p1->name, p1->au);\n    p1 = p1->next;\n  }\n}\nvoid most(struct worker *p) {\n  struct worker *p1, *p2;\n  int a[30] = {0}, i, max;\n  char author;\n\n  p1 = p;\n  p2 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++)\n      a[*(p1->au + i) - 65] = a[*(p1->au + i) - 65] + 1;\n\n    p1 = p1->next;\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max)\n      author = i + 65;\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  p1 = p;\n  while (p1 != NULL) {\n    for (i = 0; *(p1->au + i) != '\\0'; i++) {\n      if (*(p1->au + i) == author)\n        printf(\"%d\\n\", p1->name);\n    }\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct worker *p1, *p;\n  struct help t;\n  int m;\n  char c;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  p1 = p;\n\n  most(p1);\n}\n"}
{"label": "2", "index": "3368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, num[26] = {0}, index1;\n  scanf(\"%d\", &m);\n  struct f {\n    int index;\n    char writer[27];\n  };\n  struct f *p;\n  p = (struct f *)malloc(m * sizeof(struct f));\n  char *p1;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &(p + i)->index, (p + i)->writer);\n\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    for (; *p1; p1++) {\n      index1 = (int)*p1 - 'A';\n      (*(num + index1))++;\n    }\n  }\n  int max = 0, k;\n  for (i = 0; i < 26; i++)\n    if (max < *(num + i)) {\n      max = *(num + i);\n      k = i;\n    }\n  char wr;\n  wr = (char)k + 'A';\n  printf(\"%c\\n%d\\n\", wr, max);\n  int flag;\n  for (i = 0; i < m; i++) {\n    p1 = (p + i)->writer;\n    flag = 1;\n    for (; *p1 && flag == 1; p1++)\n      if (*p1 == wr)\n        flag = 0;\n    if (flag == 0)\n      printf(\"%d\\n\", (p + i)->index);\n  }\n}\n"}
{"label": "2", "index": "3369", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int location[1001];\n  int num;\n  int sum;\n} ans[27];\nint main() {\n  int n, value = -1, order, m;\n  char s[28];\n  cin >> n;\n  for (int i = 1; i <= 26; i++)\n    ans[i].num = ans[i].sum = 0;\n\n  for (int i = 1; i <= n; i++) {\n    cin >> m;\n    cin >> s;\n    for (int j = 0; j < strlen(s); j++) {\n      ans[s[j] - 'A' + 1].num++;\n      ans[s[j] - 'A' + 1].sum++;\n      ans[s[j] - 'A' + 1].location[ans[s[j] - 'A' + 1].num] = m;\n    }\n  }\n  for (int i = 1; i <= 26; i++)\n    if (ans[i].sum > value) {\n      value = ans[i].sum;\n      order = i;\n    }\n  cout << (char)(order + 'A' - 1) << endl;\n  printf(\"%d\\n\", ans[order].num);\n  for (int i = 1; i <= ans[order].num; i++)\n    cout << ans[order].location[i] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint trans(char k) {\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct point {\n    int id;\n    char au[26];\n  } books[1000];\n  int num[26];\n  int i;\n  for (i = 0; i < 26; i++) {\n    num[i] = 0;\n  }\n  int j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &books[i].id, books[i].au);\n  }\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      int b;\n      b = trans(books[i].au[j]);\n      num[b]++;\n    }\n  }\n  int max = 0;\n  int most;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      most = i;\n    }\n  }\n  char aumost;\n  aumost = 'A' + most;\n  printf(\"%c\\n\", aumost);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      if (books[i].au[j] == 'A' + most) {\n        printf(\"%d\\n\", books[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[26];\n} b[999];\nint main() {\n  int i, j, m, n, k, max, p;\n  int a[26] = {0}, q[999] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].aut);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++) {\n      k = b[i].aut[j];\n      a[k - 65]++;\n    }\n  }\n  for (i = 1, max = a[0], p = 0; i < 26; i++) {\n    if (a[i] > max) {\n      p = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n%d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    n = strlen(b[i].aut);\n    for (j = 0; j < n; j++)\n      if (b[i].aut[j] == (p + 65))\n        q[i] = 1;\n  }\n  for (i = 0; i < m; i++)\n    if (q[i] == 1)\n      printf(\"\\n%d\", b[i].num);\n  return 0;\n}\n"}
{"label": "2", "index": "3372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Bo {\n  int num;\n  char auth[30];\n} a[1010];\n\nint main() {\n  int n, i, j, maxnum = 0;\n  int zuozhe[26] = {0};\n  char out;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].auth);\n    for (j = 0; j <= strlen(a[i].auth) - 1; j++)\n      zuozhe[a[i].auth[j] - 'A'] = zuozhe[a[i].auth[j] - 'A'] + 1;\n  }\n  for (i = 1; i <= 25; i++)\n    if (zuozhe[i] > zuozhe[maxnum])\n      maxnum = i;\n  out = 'A' + maxnum;\n  printf(\"%c\\n\", out);\n  printf(\"%d\\n\", zuozhe[maxnum]);\n\n  for (i = 1; i <= n; i++) {\n    if (strchr(a[i].auth, out) != NULL)\n      printf(\"%d\\n\", a[i].num);\n  }\n}\n"}
{"label": "2", "index": "3373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[30] = {0}, b[30][1000];\nstruct stu {\n  int num;\n  char name[30];\n\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  struct stu *p1, *p2, *head;\n  int i = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = 0;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i < n - 1) {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = 0;\n  return head;\n}\nint check(struct stu *head, int n) {\n  int i, j, s, d = 0, f = 0;\n  char *t;\n  struct stu *p;\n  p = head;\n  for (i = 0; i < n; i++, p = p->next) {\n    s = strlen(p->name);\n    t = p->name;\n    for (j = 0; j < s; j++) {\n      d = t[j] - 64;\n      a[d]++;\n      b[d][a[d] - 1] = p->num;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    for (j = 1, f = 0; j <= 26; j++) {\n      if (a[i] < a[j]) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 0)\n      break;\n  }\n  return i;\n}\nint main() {\n  struct stu *head;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  i = check(head, n);\n  printf(\"%c\\n%d\\n\", i + 64, a[i]);\n  for (j = 0; j < a[i]; j++)\n    printf(\"%d\\n\", b[i][j]);\n}\n"}
{"label": "2", "index": "3374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct shu {\n  int num;\n  char author[26];\n};\n\nint main() {\n  struct shu shu[999];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n  int a[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == 'A')\n        a[0] = a[0] + 1;\n      else if (shu[i].author[j] == 'B')\n        a[1] = a[1] + 1;\n      else if (shu[i].author[j] == 'C')\n        a[2] = a[2] + 1;\n      else if (shu[i].author[j] == 'D')\n        a[3] = a[3] + 1;\n      else if (shu[i].author[j] == 'E')\n        a[4] = a[4] + 1;\n      else if (shu[i].author[j] == 'F')\n        a[5] = a[5] + 1;\n      else if (shu[i].author[j] == 'G')\n        a[6] = a[6] + 1;\n      else if (shu[i].author[j] == 'H')\n        a[7] = a[7] + 1;\n      else if (shu[i].author[j] == 'I')\n        a[8] = a[8] + 1;\n      else if (shu[i].author[j] == 'J')\n        a[9] = a[9] + 1;\n      else if (shu[i].author[j] == 'K')\n        a[10] = a[10] + 1;\n      else if (shu[i].author[j] == 'L')\n        a[11] = a[11] + 1;\n      else if (shu[i].author[j] == 'M')\n        a[12] = a[12] + 1;\n      else if (shu[i].author[j] == 'N')\n        a[13] = a[13] + 1;\n      else if (shu[i].author[j] == 'O')\n        a[14] = a[14] + 1;\n      else if (shu[i].author[j] == 'P')\n        a[15] = a[15] + 1;\n      else if (shu[i].author[j] == 'Q')\n        a[16] = a[16] + 1;\n      else if (shu[i].author[j] == 'R')\n        a[17] = a[17] + 1;\n      else if (shu[i].author[j] == 'S')\n        a[18] = a[18] + 1;\n      else if (shu[i].author[j] == 'T')\n        a[19] = a[19] + 1;\n      else if (shu[i].author[j] == 'U')\n        a[20] = a[20] + 1;\n      else if (shu[i].author[j] == 'V')\n        a[21] = a[21] + 1;\n      else if (shu[i].author[j] == 'W')\n        a[22] = a[22] + 1;\n      else if (shu[i].author[j] == 'X')\n        a[23] = a[23] + 1;\n      else if (shu[i].author[j] == 'Y')\n        a[24] = a[24] + 1;\n      else if (shu[i].author[j] == 'Z')\n        a[25] = a[25] + 1;\n    }\n  }\n  k = a[0], m = 0;\n  for (i = 0; i < 26; i++) {\n    if (k < a[i]) {\n      k = a[i];\n      m = i;\n    }\n  }\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  printf(\"%c\\n\", b[m]);\n  printf(\"%d\\n\", k);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == b[m]) {\n        printf(\"%d\\n\", shu[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3375", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char m = 0;\n  int cnt[255], i, j, n;\n  struct {\n    int id;\n    char au[32];\n  } bk[1000];\n\n  memset(cnt, 0, sizeof(cnt));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].id, bk[i].au);\n    for (j = 0; bk[i].au[j]; j++)\n      if (++cnt[bk[i].au[j]] > cnt[m])\n        m = bk[i].au[j];\n  }\n\n  printf(\"%c\\n%d\\n\", m, cnt[m]);\n  for (i = 0; i < n; i++)\n    if (strchr(bk[i].au, m))\n      printf(\"%d\\n\", bk[i].id);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char number[20];\n  char name[26];\n} books[1000];\n\nint main() {\n  int n, i, j;\n  int count[26] = {0};\n  int temp, base, k = 0;\n  char author;\n  int pd = 0, N = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> books[i].number >> books[i].name;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n      temp = books[i].name[j] - 'A';\n      count[temp]++;\n    }\n  }\n  base = count[0];\n  for (i = 0; i < 26; i++) {\n    if (count[i] > base) {\n      base = count[i];\n      k = i;\n    }\n  }\n  author = 'A' + k;\n  printf(\"%c \", author);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      N++;\n  }\n  printf(\"%d \", N);\n  for (i = 0; i < n; i++) {\n    pd = 0;\n    for (j = 0; books[i].name[j] >= 'A' && books[i].name[j] <= 'Z'; j++) {\n\n      if (books[i].name[j] == author)\n        pd = 1;\n    }\n    if (pd == 1)\n      printf(\"%s \", books[i].number);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct b {\n    int num;\n    char str[27];\n  } b[100];\n  int n, i, m, j, max, nmax;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].str);\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      a[b[i].str[j] - 65]++;\n    }\n  }\n  max = a[0];\n  nmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      nmax = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", nmax + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      if (b[i].str[j] == nmax + 65)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3378", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0}, no[27][1000] = {0};\n  char s[27], ls;\n  int l, i, max, t, j, flag, n, w;\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n    scanf(\"%d %s \", &n, s);\n    l = strlen(s);\n    for (j = 0; j <= l - 1; j++) {\n      w = s[j] - 'A' + 1;\n      num[w]++;\n      no[w][num[w]] = n;\n    }\n  }\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      flag = i;\n    }\n  ls = (char)64 + flag;\n  cout << ls << endl << num[flag] << endl;\n  for (i = 1; i <= num[flag]; i++)\n    cout << no[flag][i] << endl;\n  cin >> w;\n  return 0;\n}\n"}
{"label": "2", "index": "3379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct index {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, a[26], *pr, max;\n  char s[26], *sp, *pt, temp;\n  for (pr = a; pr < a + 26; pr++) {\n    *pr = 0;\n  }\n  sp = s;\n  *sp = 65;\n  for (sp = s + 1; sp < s + 26; sp++) {\n    *sp = *(sp - 1) + 1;\n  }\n  struct index *p;\n  scanf(\"%d\", &n);\n  struct index *ind = (struct index *)malloc(sizeof(struct index) * n);\n  for (p = ind; p < ind + n; p++) {\n    scanf(\"%d %s\", &p->num, p->wr);\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n        if (*pt == *sp) {\n          (*pr)++;\n        }\n      }\n    }\n  }\n  max = *a;\n  temp = 65;\n  for (pr = a, sp = s; pr < a + 26; pr++, sp++) {\n    if (*pr > max) {\n      max = *pr;\n      temp = *sp;\n    }\n  }\n  for (pr = a, sp = s; sp < s + 26; sp++, pr++) {\n    if (*pr == max) {\n      cout << *sp << \"\\n\" << *pr << \"\\n\";\n    }\n  }\n  for (p = ind; p < ind + n; p++) {\n    for (pt = (*p).wr; pt < (*p).wr + 26; pt++) {\n      if (*pt == temp) {\n        cout << (*p).num << \"\\n\";\n      }\n    }\n  }\n  free(ind);\n  return 0;\n}\n"}
{"label": "2", "index": "3380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char auther[27];\n} bk[1000];\n\nstruct ath {\n  char a;\n  int books[999];\n  int sum;\n} auth[27], temp;\n\nint main() {\n  int n, i, x, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> bk[i].number >> bk[i].auther;\n  for (i = 0; i < 27; i++) {\n    for (j = 0; j < 999; j++)\n      auth[i].books[j] = 0;\n    auth[i].sum = 0;\n    auth[i].a = 'A' + i;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].auther);\n    int f;\n    for (f = 0; f < m; f++) {\n      x = (int)(bk[i].auther[f] - 'A');\n      auth[x].books[auth[x].sum] = bk[i].number;\n      auth[x].sum++;\n    }\n  }\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (auth[i].sum > auth[i + 1].sum) {\n        temp = auth[i];\n        auth[i] = auth[i + 1];\n        auth[i + 1] = temp;\n      }\n  printf(\"%c\\n\", auth[25].a);\n  printf(\"%d\\n\", auth[25].sum);\n  i = 0;\n  while (auth[25].books[i] != 0) {\n    printf(\"%d\\n\", auth[25].books[i]);\n    i++;\n  }\n}\n"}
{"label": "2", "index": "3381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct record {\n  int id;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  struct YyxNode *newNd;\n  if (((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) ||\n      ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL)) {\n    printf(\"Error: memory out! (1)\");\n    exit(-1);\n  }\n\n  newLn->n = 0;\n  newLn->head = newNd;\n  newNd->next = NULL;\n  newLn->tail = newNd;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNd;\n  if ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\");\n    exit(-1);\n  }\n\n  newNd->m_rec = *rec;\n  newNd->next = NULL;\n\n  ln->tail->next = newNd;\n  ln->tail = newNd;\n  ln->n++;\n\n  return ln;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNd, *nextNd;\n  delNd = ln->head->next;\n  for (; delNd != NULL; delNd = nextNd) {\n    nextNd = delNd->next;\n    free(delNd);\n  }\n\n  ln->n = 0;\n  ln->head->next = NULL;\n\n  return ln;\n}\n\nvoid FreeLink(struct YyxLink *ln) {\n  ClearLink(ln);\n  free(ln->head);\n  free(ln);\n}\n\nint main() {\n  struct YyxLink **total;\n  int m;\n  struct record rec;\n  char author[27];\n  int i;\n  char *pch;\n  struct YyxNode *nd;\n\n  if ((total = (struct YyxLink **)malloc(26 * sizeof(struct YyxLink *))) ==\n      NULL) {\n    printf(\"Error: memory out! (3)\\n\");\n    exit(-1);\n  }\n  for (i = 0; i < 26; i++) {\n    total[i] = CreateNewLink();\n  }\n\n  scanf(\"%d\", &m);\n  for (; m > 0; m--) {\n    scanf(\"%d %s\", &rec.id, author);\n    pch = author;\n    for (; *pch != '\\0'; pch++) {\n      AddNode(total[*pch - 'A'], &rec);\n    }\n  }\n\n  m = 0;\n  for (i = 1; i < 26; i++) {\n    if (total[m]->n < total[i]->n)\n      m = i;\n  }\n  cout << m + 'A' << \"\\n\" << total[m]->n << \"\\n\";\n  nd = total[m]->head->next;\n  for (; nd != NULL; nd = nd->next) {\n    printf(\"%d\\n\", nd->m_rec);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[26], max, num[n], i, j, s;\n  char maxname, name[n][10];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> name[i];\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      a[name[i][j] - 'A']++;\n  }\n  max = a[0], maxname = 'A';\n  for (i = 1; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i], maxname = 'A' + i;\n    }\n  cout << maxname << endl << max << endl;\n  for (i = 0; i < n; i++) {\n    s = strlen(name[i]);\n    for (j = 0; j < s; j++)\n      if (name[i][j] == maxname)\n        cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  } input[1000];\n\n  cin >> n;\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &input[i].number, input[i].author);\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  cout << max_n + 'A' << \"\\n\" << max << \"\\n\";\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3384", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int n;\n  char name[27];\n  struct stu *next;\n};\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct stu *head, *p1, *p2, *p3;\n  head = p1 = (struct stu *)malloc(1000);\n  cin >> p1->n >> p1->name;\n  int i = 0;\n  for (; i < m - 1; i++) {\n    p2 = (struct stu *)malloc(1000);\n    scanf(\"%d %s\", &p2->n, p2->name);\n    p1->next = p2;\n    p1 = p2;\n  }\n  p2->next = NULL;\n  int sum[26];\n  for (i = 0; i < 26; i++)\n    sum[i] = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    while (*p != '\\0') {\n      int a = *p;\n      sum[a - 65] = sum[a - 65] + 1;\n      p = p + 1;\n    }\n  }\n  int max = sum[0];\n  char j = 'A';\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", j, max);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    char *p = p1->name;\n    for (; *p != '\\0'; p++)\n      if (*p == j) {\n        printf(\"%d\\n\", p1->n);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int no;\n  char au[10];\n};\nint main() {\n  struct data lib[1000];\n  char x;\n  int n, i, j, num[26] = {0}, l[1000], k, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &lib[i].no);\n    scanf(\"%s\", lib[i].au);\n    l[i] = strlen(lib[i].au);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      num[lib[i].au[j] - 65] = num[lib[i].au[j] - 65] + 1;\n    }\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", max);\n  x = k + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      if (lib[i].au[j] == x)\n        printf(\"%d\\n\", lib[i].no);\n    }\n  }\n}\n"}
{"label": "2", "index": "3386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m;\n  cin >> m;\n  int p;\n  char a[m + 1][27];\n  int len[m + 1];\n  int b[m + 1];\n  int c[26];\n  int i, j;\n  for (i = 0; i <= 25; i++)\n    c[i] = 0;\n  for (i = 1; i <= m; i++) {\n    cin >> b[i];\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n    for (j = 0; j <= len[i] - 1; j++) {\n      c[a[i][j] - 'A']++;\n    }\n  }\n  int temp = -1;\n  for (i = 0; i <= 25; i++) {\n    if (c[i] > temp) {\n      temp = c[i];\n      p = i;\n    }\n  }\n  char n = 'A' + p;\n  cout << n << endl;\n  cout << temp << endl;\n  for (i = 1; i <= m; i++)\n    for (j = 0; j <= len[i] - 1; j++) {\n      if (a[i][j] == '\\0') {\n        break;\n      } else if (a[i][j] == n) {\n        printf(\"%d\\n\", b[i]);\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, m, b[26], t = 0, k;\n  char c[1000][20];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], c[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if ('A' < c[i][j] < 'Z')\n        b[c[i][j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > t) {\n      t = b[i];\n      k = i;\n    }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++) {\n      if (c[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct inf {\n  int sum;\n  char write[1000][4];\n};\nint main() {\n  int m;\n  int i, j;\n  char name[5];\n  char author[27];\n  struct inf book[26];\n  for (i = 0; i < 26; i++)\n    book[i].sum = 0;\n\n  cin >> m;\n  cin.get();\n\n  while (m-- > 0) {\n    cin.get(name, 5);\n    cin.getline(author, 27);\n    for (i = 0; i < strlen(author); i++) {\n      book[author[i] - 'A'].sum++;\n      for (j = 0; j <= 3; j++) {\n        if (j < 3)\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = name[j];\n        else\n          book[author[i] - 'A'].write[book[author[i] - 'A'].sum][j] = '\\0';\n      }\n    }\n  }\n\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (book[i].sum > max) {\n      t = i;\n      max = book[i].sum;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", (char)(t + 'A'), book[t].sum);\n  for (i = 1; i <= book[t].sum; i++)\n    printf(\"%s\\n\", book[t].write[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct author {\n  int sumbook;\n  int id[999];\n} a[26];\n\nint main() {\n  int n, i, j, bookid = 0, pos = 0, maxbook = 0, maxid = 0;\n  char booka[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d%s\", &bookid, booka);\n    for (j = 0; j < strlen(booka); ++j) {\n      pos = booka[j] - 'A';\n      a[pos].id[a[pos].sumbook] = bookid;\n      a[pos].sumbook++;\n      if (maxbook < a[pos].sumbook) {\n        maxid = pos;\n        maxbook = a[pos].sumbook;\n      }\n    }\n  }\n  cout << maxid + 'A' << \"\\n\" << maxbook << \"\\n\";\n  for (i = 0; i < a[maxid].sumbook; i++)\n    printf(\"%d\\n\", a[maxid].id[i]);\n}\n"}
{"label": "2", "index": "3390", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct a {\n  int book;\n  char author[26];\n  struct a *next;\n};\nstruct a *creat(int m) {\n  int i = 0;\n  struct a *p, *head, *temp;\n  head = NULL;\n  do {\n    p = (struct a *)malloc(sizeof(struct a));\n    if (p == NULL) {\n      exit(1);\n    }\n    scanf(\"%d %s\", &p->book, p->author);\n    if (head == NULL) {\n      head = p;\n      temp = p;\n    } else {\n      temp->next = p;\n      temp = p;\n    }\n    i++;\n  } while (i < m);\n  temp->next = NULL;\n  return (head);\n}\nint main() {\n  int h, m, i, j, zimu[26] = {0};\n  struct a *head, *p;\n  scanf(\"%d \", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] >= 'A' && p->author[j] <= 'Z') {\n        zimu[p->author[j] - 'A']++;\n      }\n    }\n    p = p->next;\n  }\n  h = 0;\n  for (i = 0; i < 26; i++) {\n    if (zimu[i] > zimu[h])\n      h = i;\n  }\n  printf(\"%c\\n%d\\n\", 'A' + h, zimu[h]);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p->author[j] == 'A' + h) {\n        printf(\"%d\\n\", p->book);\n        break;\n      }\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3391", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct BOOK {\n  int num;\n  char author[26];\n};\n\nchar maxbook(int a[]) {\n  int i, j, bookmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (bookmax < a[i]) {\n      bookmax = a[i];\n      j = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + j, bookmax);\n  return 'A' + j;\n}\n\nint contain(char author[], char max) {\n  char *c = author;\n  while (*c) {\n    if (*c == max)\n      return 1;\n    c++;\n  }\n  return 0;\n}\n\nint main() {\n  struct BOOK book[1000];\n  int m, i, j;\n  char c, max;\n  int AtoZ[26] = {0};\n\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    getchar();\n    j = 0;\n    while ((c = getchar()) != '\\n') {\n      book[i].author[j] = c;\n      AtoZ[c - 'A']++;\n      j++;\n    }\n    book[i].author[j] = '\\0';\n  }\n  max = maxbook(AtoZ);\n\n  for (i = 0; i < m; i++) {\n    if (contain(book[i].author, max))\n      printf(\"%d\\n\", book[i].num);\n  }\n}\n"}
{"label": "2", "index": "3392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], i, l, c[26] = {0}, k, max, n, j;\n  char b[100][26],\n      d[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == 'A')\n        c[0]++;\n      else if (b[i][j] == 'B')\n        c[1]++;\n      else if (b[i][j] == 'C')\n        c[2]++;\n      else if (b[i][j] == 'D')\n        c[3]++;\n      else if (b[i][j] == 'E')\n        c[4]++;\n      else if (b[i][j] == 'F')\n        c[5]++;\n      else if (b[i][j] == 'G')\n        c[6]++;\n      else if (b[i][j] == 'H')\n        c[7]++;\n      else if (b[i][j] == 'I')\n        c[8]++;\n      else if (b[i][j] == 'J')\n        c[9]++;\n      else if (b[i][j] == 'K')\n        c[10]++;\n      else if (b[i][j] == 'L')\n        c[11]++;\n      else if (b[i][j] == 'M')\n        c[12]++;\n      else if (b[i][j] == 'N')\n        c[13]++;\n      else if (b[i][j] == 'O')\n        c[14]++;\n      else if (b[i][j] == 'P')\n        c[15]++;\n      else if (b[i][j] == 'Q')\n        c[16]++;\n      else if (b[i][j] == 'R')\n        c[17]++;\n      else if (b[i][j] == 'S')\n        c[18]++;\n      else if (b[i][j] == 'T')\n        c[19]++;\n      else if (b[i][j] == 'U')\n        c[20]++;\n      else if (b[i][j] == 'V')\n        c[21]++;\n      else if (b[i][j] == 'W')\n        c[22]++;\n      else if (b[i][j] == 'X')\n        c[23]++;\n      else if (b[i][j] == 'Y')\n        c[24]++;\n      else if (b[i][j] == 'Z')\n        c[25]++;\n    }\n  }\n  max = c[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] >= max) {\n      max = c[i];\n      k = i;\n    }\n  cout << d[k] << \"\\n\";\n  printf(\"%d\\n\", c[k]);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i]);\n    for (j = 0; j < l; j++) {\n      if (b[i][j] == d[k])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int record[26][1000];\n  memset(record, 0, sizeof(record));\n  char name[10];\n  int m, temp;\n  cin >> m;\n  for (int i = 0; i < m; i++) {\n    cin >> temp;\n    cin.get();\n    cin.getline(name, 10);\n    for (int i = 0; i < strlen(name); i++) {\n      record[name[i] - 65][record[name[i] - 65][0] + 1] = temp;\n      record[name[i] - 65][0]++;\n    }\n  }\n  int flag = 0;\n  for (int i = 0; i < 25; i++) {\n    if (record[i][0] > record[flag][0]) {\n      flag = i;\n    }\n  }\n  cout << (char)(flag + 65) << endl << record[flag][0] << endl;\n  for (int i = 1; i <= record[flag][0]; i++) {\n    cout << record[flag][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, best = 0, max = 0, a[26] = {0}, num[100], l, j, k;\n  char letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                     'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                     'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'},\n       writer[100][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &num[i], &writer[i]);\n\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      for (k = 0; k < 26; k++) {\n        if (writer[i][j] == letter[k]) {\n          a[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      best = i;\n      max = a[i];\n    }\n  }\n  printf(\"%c\\n\", letter[best]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      if (writer[i][j] == letter[best]) {\n        printf(\"%d\\n\", num[i]);\n        ;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3395", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mname[999][26], name;\n  int i, j, m, len, max = 0;\n  int num[999], count[26] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> num[i] >> mname[i];\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++)\n      count[mname[i][j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      name = i + 'A';\n    }\n  }\n  cout << name << endl << max << endl;\n  for (i = 0; i < m; i++) {\n    len = strlen(mname[i]);\n    for (j = 0; j < len; j++) {\n      if (mname[i][j] == name) {\n        cout << num[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[999];\n  char r[999][26];\n  int b[125] = {0};\n  int n, i, j, maxi, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    scanf(\"%s\", r[i]);\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      b[r[i][j]] = b[r[i][j]] + 1;\n    }\n  }\n  maxi = 65;\n  for (i = 66; i <= 90; i++) {\n    if (b[i] > b[maxi])\n      maxi = i;\n  }\n  printf(\"%c\\n\", maxi);\n  printf(\"%d\\n\", b[maxi]);\n  for (i = 0; i <= n - 1; i++) {\n    s = strlen(r[i]) - 1;\n    for (j = 0; j <= s; j++) {\n      if (r[i][j] == maxi) {\n        printf(\"%d\\n\", a[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000] = {0}, c[27] = {0}, i, j, k, m, p, d[1000] = {0};\n  char b[1000][30] = {{0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], b[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 1; k <= 26; k++) {\n        if (b[i][j] == 64 + k)\n          c[k] = c[k] + 1;\n      }\n    }\n  }\n\n  m = c[1];\n  p = 1;\n  for (i = 1; i < 27; i++) {\n    if (c[i] > m) {\n      m = c[i];\n      p = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (b[i][j] == 64 + p)\n        d[i] = 1;\n    }\n  }\n  printf(\"%c\\n\", 64 + p);\n  cout << m << \"\\n\";\n  for (i = 0; i < 1000; i++) {\n    if (d[i] == 1)\n      printf(\"%d\\n\", a[i]);\n  }\n}\n"}
{"label": "2", "index": "3398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int number[n + 1];\n  int writer[26] = {0};\n  char book[n + 1][27];\n  for (int i = 1; i <= n; ++i) {\n    cin >> number[i] >> book[i];\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      writer[book[i][t] - 'A']++;\n    }\n  }\n  int nn = 0;\n  for (int i = 0; i < 26; ++i) {\n    nn = max(nn, writer[i]);\n  }\n  int person1;\n  for (int i = 0; i < 26; ++i) {\n    if (writer[i] == nn) {\n      person1 = i;\n      break;\n    }\n  }\n  char person = person1 + 'A';\n  cout << person << endl << nn << endl;\n  for (int i = 1; i <= n; ++i) {\n    for (int t = 0; t < strlen(book[i]); ++t) {\n      if (book[i][t] == person) {\n        printf(\"%d\\n\", number[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, sh[100], a[26] = {0}, b[26][100];\n  int max, t, m;\n  char ch[100][40] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> sh[i] >> ch[i];\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < 40; j++) {\n      m = ch[i][j];\n      if (m > 64 && m < 91) {\n        a[m - 65]++;\n        b[m - 65][a[m - 65]] = sh[i];\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  cout << 65 + t << \"\\n\";\n  printf(\"%d\\n\", a[t]);\n  for (i = 1; i <= a[t]; i++) {\n    cout << b[t][i] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "3400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, a[1000], c[91] = {0}, k, n, p = 0;\n  char b[1000][26], q;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d%s\", &a[i], b[i]);\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++) {\n      k = b[i][j];\n      c[k]++;\n    }\n  }\n  for (i = 65; i < 91; i++)\n    if (c[i] > p) {\n      p = c[i];\n      q = i;\n    }\n  cout << q << \"\\n\" << p << \"\\n\";\n  for (i = 1; i <= m; i++) {\n    n = strlen(b[i]);\n    for (j = 0; j <= n - 1; j++)\n      if (b[i][j] == q) {\n        printf(\"%d\\n\", a[i]);\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, c[26] = {0}, d[26] = {0}, j, s, t, k;\n  char b[26000], r, max;\n  scanf(\"%d\\n\", &n);\n  struct book {\n    int num;\n    char author[26];\n  } a[999];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\\n\", &a[i].num, &a[i].author);\n  strcpy(b, a[0].author);\n  for (i = 1; i < n; i++)\n    strcat(b, a[i].author);\n  s = strlen(b);\n  for (r = 'A', j = 0; r <= 'Z', j < 26; r++, j++)\n    for (i = 0; i < s; i++)\n      if (b[i] == r)\n        c[j]++;\n  for (i = 0; i < 26; i++)\n    d[i] = c[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n      }\n  k = d[0];\n  for (i = 0; i < 26; i++)\n    if (c[i] == k)\n      max = i + 65;\n  printf(\"%c\\n%d\\n\", max, k);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == max)\n        cout << a[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3402", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[400][400], t[400][400];\n  int n, m, i, j, k, l, p, y, z;\n  char c;\n  int a[30];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> t[i] >> s[i];\n  j = 0;\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    a[j] = p;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (m = j - 2; m >= i; m--) {\n      if (a[m] < a[m + 1]) {\n        y = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = y;\n      }\n    }\n  }\n  z = a[0];\n  for (c = 65; c < 91; c++) {\n    p = 0;\n    for (k = 1; k <= n; k++) {\n      l = strlen(s[k]);\n      for (m = 0; m < l; m++) {\n        if (s[k][m] == c)\n          p++;\n      }\n    }\n    if (p == z) {\n      printf(\"%c\\n\", c);\n      printf(\"%d\\n\", z);\n\n      for (k = 1; k <= n; k++) {\n        p = 0;\n        l = strlen(s[k]);\n        for (m = 0; m < l; m++) {\n          if (s[k][m] == c)\n            p++;\n        }\n        if (p > 0)\n          printf(\"%s\\n\", t[k]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[27];\n  } b[1000];\n  int m, i, j, a = 0;\n  int c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].num, b[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      c[*(b[i].name + j) - 'A']++;\n  }\n  for (i = 0; i < 26; i++)\n    a = c[i] > c[a] ? i : a;\n  printf(\"%c\\n\", a + 'A');\n  printf(\"%d\\n\", c[a]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (*(b[i].name + j) == ('A' + a))\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3404", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 0;\n  int zuozhe[26] = {0};\n  char maxer;\n  struct book {\n    int num;\n    char author[26];\n  } shu[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i].num, shu[i].author);\n    for (j = 0; j < 26; j++)\n      zuozhe[shu[i].author[j] - 65]++;\n  }\n  for (j = 0; j < 26; j++)\n    if (zuozhe[j] > max) {\n      max = zuozhe[j];\n      maxer = j + 65;\n    }\n  printf(\"%c\\n%d\\n\", maxer, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (shu[i].author[j] == maxer) {\n        printf(\"%d\\n\", shu[i].num);\n        continue;\n      }\n}\n"}
{"label": "2", "index": "3405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[20];\n  struct book *next;\n};\nint main() {\n  int n, i, j, m, k, c[26], max;\n  char a[26];\n  scanf(\"%d\", &m);\n  struct book *p1, *p2, *head;\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n\n    p2 = p1;\n    scanf(\"%d %s\", &p1->num, p1->writer);\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < 26; i++) {\n      n = strlen(p1->writer);\n      for (k = 0; k < n; k++) {\n        if (a[i] == p1->writer[k]) {\n          c[i]++;\n        }\n      }\n    }\n    p1 = p1->next;\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c %d \", a[max], c[max]);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->writer);\n    for (j = 0; j < n; j++) {\n      if (p1->writer[j] == a[max]) {\n        printf(\"%d \", p1->num);\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000], d[1000], e[30] = {0};\n  int i, j, k, n, t = 0, max;\n  char c[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> c[i];\n    d[i] = (int)strlen(c[i]);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      for (k = 0; k < 26; k++)\n        if (c[i][j] == k + 65)\n          e[k] = e[k] + 1;\n  max = e[0];\n  for (k = 1; k < 26; k++) {\n    if (e[k] > max) {\n      t = k;\n      max = e[k];\n    }\n  }\n\n  printf(\"%c\\n\", t + 65);\n  printf(\"%d\\n\", e[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < d[i]; j++)\n      if (c[i][j] == t + 65)\n        cout << b[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "3407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint m, n;\nstruct student {\n  int id;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat() {\n  int i = 1;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &m);\n  scanf(\"%d %s\", &p1->id, p1->name);\n  head = NULL;\n  for (; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->id >> p1->name;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  int num[30] = {0}, max, j;\n  char i, auth;\n  head = creat();\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (i = 'A'; i <= 'Z'; i++) {\n      for (j = 0; j < strlen(p1->name); j++)\n        if (p1->name[j] == i)\n          num[i - 'A']++;\n    }\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      auth = i + 'A';\n    }\n  }\n  printf(\"%c \", auth);\n  cout << max << \" \";\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++)\n      if (p1->name[j] == auth)\n        printf(\"%d \", p1->id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct xinxi {\n  int sh;\n  char zz[20];\n} a[1000];\nint main() {\n  int n, i, l, j, b[26] = {0}, m = 0, k = 0;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].sh, a[i].zz);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      b[a[i].zz[j] - 65]++;\n  }\n  for (i = 0; i < 26; i++)\n    if (b[i] > m) {\n      m = b[i];\n      k = i;\n    }\n  c = k + 65;\n  printf(\"%c\\n%d\\n\", c, m);\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i].zz);\n    for (j = 0; j < l; j++)\n      if (a[i].zz[j] == c)\n        printf(\"%d\\n\", a[i].sh);\n  }\n}\n"}
{"label": "2", "index": "3409", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct worker {\n  int nm;\n  char name1[26];\n  struct worker *next;\n};\nstruct zuozhe {\n  char nam;\n  int counts;\n  int name[1000];\n  struct zuozhe *next;\n};\nstruct worker *creat1(int n) {\n  struct worker *head, *p1, *p2;\n  int i;\n  head = (struct worker *)malloc(sizeof(struct worker));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct worker *)malloc(sizeof(struct worker));\n    scanf(\"%d %s\", &p2->nm, p2->name1);\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nstruct zuozhe *creat2() {\n  struct zuozhe *head, *p1, *p2;\n  int i;\n  head = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n  p1 = p2 = head;\n  for (i = 0; i < 26; i++) {\n    p2 = p1;\n    p1 = (struct zuozhe *)malloc(sizeof(struct zuozhe));\n    p2->counts = 0;\n    p2->nam = 'A' + i;\n    p2->next = p1;\n  }\n  p2->next = 0;\n  return head;\n}\nint main() {\n  int big = 0;\n  char zz;\n  int i, j;\n  char c;\n  int m, n;\n  int a[26] = {0};\n  struct worker *head1, *p1, *p2;\n  struct zuozhe *head2, *q1, *q2;\n  scanf(\"%d\", &n);\n  head1 = creat1(n);\n  p1 = p2 = head1;\n  head2 = creat2();\n  q1 = q2 = head2;\n  while (p1 != 0) {\n    i = 0;\n    while (p1->name1[i] != '\\0') {\n      q1 = head2;\n      while (1) {\n        if (q1->nam == p1->name1[i]) {\n          q1->name[q1->counts] = p1->nm;\n          q1->counts++;\n          i++;\n          break;\n        }\n        q1 = q1->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  q1 = head2;\n  while (q1 != 0) {\n    if (q1->counts > big) {\n      zz = q1->nam;\n      big = q1->counts;\n    }\n    q1 = q1->next;\n  }\n  q1 = head2;\n  while (1) {\n    if (q1->nam == zz) {\n      printf(\"%c\\n%d\\n\", q1->nam, q1->counts);\n      for (i = 0; i < q1->counts; i++) {\n        printf(\"%d\\n\", q1->name[i]);\n      }\n      break;\n    }\n    q1 = q1->next;\n  }\n}\n"}
{"label": "2", "index": "3410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max, p;\n  int mwj;\n  int shu[1000];\n  char zuo[1000][30];\n  int w[26];\n  for (i = 0; i < 26; i++)\n    w[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &shu[i], zuo[i]);\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      w[(zuo[i][j] - 65)] = w[(zuo[i][j] - 65)] + 1;\n    }\n  }\n  max = w[0];\n  p = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      p = i;\n    }\n  }\n  printf(\"%c\\n\", p + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(zuo[i]); j++) {\n      mwj = zuo[i][j];\n      if (mwj == p + 65) {\n        printf(\"%d\\n\", shu[i]);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct {\n  int num;\n  char au[27];\n} book[999];\n\nint main() {\n  int m, a[26] = {0}, i, j, t, max = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &book[i].num, book[i].au);\n    int au_n = strlen(book[i].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[i].au[j] <= 90 && book[i].au[j] >= 65) {\n        int k = book[i].au[j] - 65;\n        a[k]++;\n        if (a[k] > max)\n          max = a[k];\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == max) {\n      char r = i + 65;\n      printf(\"%c\\n%d\\n\", r, max);\n      break;\n    }\n  }\n  for (t = 0; t < m; t++) {\n    int au_n = strlen(book[t].au);\n    for (j = 0; j < au_n; j++) {\n      if (book[t].au[j] == i + 65)\n        printf(\"%d\\n\", book[t].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n  int max = 0, store, m, i, x[26][1000] = {0}, coun[27] = {0}, flag;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &store);\n    for (;;) {\n      scanf(\"%c\", &c);\n      if (c < 65 || c > 90)\n        break;\n      else {\n        x[c - 64][i] = store;\n        coun[c - 64]++;\n      }\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (coun[i] > max) {\n      max = coun[i];\n      flag = i + 64;\n    }\n  }\n  printf(\"%c\\n\", flag);\n  printf(\"%d\\n\", coun[flag - 64]);\n  for (i = 1; i <= 1000; i++) {\n    if (x[flag - 64][i] != 0)\n      cout << x[flag - 64][i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3413", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char w[27];\n  };\n  struct book b[1000];\n  int n, i, j, k, c[26] = {0}, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].w);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < strlen(b[j].w); k++) {\n        if (i == b[j].w[k]) {\n          c[i - 65]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[max])\n      max = i;\n  }\n  printf(\"%c\\n\", max + 65);\n  printf(\"%d\\n\", c[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(b[i].w); j++) {\n      if (b[i].w[j] == max + 65) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, p;\n  int a[1000];\n  scanf(\"%d\", &n);\n  struct book {\n    int m;\n    char c[27];\n  };\n  struct book b[1000];\n  for (i = 0; i < n; i++) {\n    cin >> b[i].m;\n    scanf(\"%s\", b[i].c);\n  }\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++)\n      a[b[i].c[j] - 'A']++;\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (max == a[i])\n      p = i;\n  }\n  p = p + 'A';\n  printf(\"%c\\n\", p);\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++) {\n      if (b[i].c[j] == p)\n        printf(\"%d\\n\", b[i].m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3415", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  char num[500];\n  char s[50];\n  struct book *next;\n};\nint main() {\n  struct book *head;\n  struct book *p1, *p2;\n  int m, mi, i, j, k, max, found;\n  int aut[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%s %s\", p1->num, p1->s);\n  for (i = 0; i < strlen(p1->s); i++)\n    aut[(p1->s)[i] - 'A']++;\n  p1->next = NULL;\n  head = p2 = p1;\n  for (mi = 2; mi <= m; mi++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->s);\n    for (i = 0; i < strlen(p1->s); i++)\n      aut[(p1->s)[i] - 'A']++;\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (aut[i] > max) {\n      k = i;\n      max = aut[i];\n    }\n  printf(\"%c \", k + 65);\n  printf(\"%d \", aut[k]);\n  p1 = head;\n  for (i = 1; i <= m; i++) {\n    found = 0;\n    for (j = 0; j < strlen(p1->s); j++)\n      if ((p1->s)[j] == k + 65) {\n        found = 1;\n        break;\n      }\n    if (found == 1)\n      printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3416", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n    struct book *next;\n  };\n  int n, m, i;\n  scanf(\"%d\", &m);\n  struct book *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d%s\", &p1->num, p1->wri);\n  head = NULL;\n  for (i = 0; i < m - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->wri;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  int a[26] = {0}, b, j, k, max1 = 0, max2;\n  struct book *g;\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] != '\u0000') {\n        b = g->wri[i];\n        a[b - 65] = a[b - 65] + 1;\n      }\n    }\n    g = g->next;\n  } while (g != NULL);\n  for (i = 0; i < 26; i++) {\n    if (max1 < a[i]) {\n      max1 = a[i];\n      max2 = i;\n    }\n  }\n  max2 = max2 + 65;\n  printf(\"%c %d\", max2, max1);\n  g = head;\n  do {\n    for (i = 0; i < 26; i++) {\n      if (g->wri[i] == max2) {\n        printf(\" %d\", g->num);\n        break;\n      }\n    }\n\n    g = g->next;\n  } while (g != NULL);\n}\n"}
{"label": "2", "index": "3417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct info {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int i, m, j, b[26] = {0};\n  char out;\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\\n\", &a[i].num, a[i].author);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++) {\n      b[a[i].author[j] - 'A']++;\n    }\n  int max = b[0];\n  for (i = 0; i < 26; i++)\n    max = max > b[i] ? max : b[i];\n  for (i = 0; i < 26; i++)\n    if (b[i] == max) {\n      out = 'A' + i;\n      printf(\"%c\\n\", 'A' + i);\n      printf(\"%d\\n\", b[i]);\n      break;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (a[i].author[j] == out) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3418", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0};\n  int n, i, j, temp;\n  unsigned long len;\n  char author[27], temp2, book[27][1000] = {'\\0'};\n  char str[4];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> str;\n    cin.get();\n    cin.getline(author, 27);\n    len = strlen(author);\n    for (j = 0; j < len; j++) {\n      num[author[j] - 'A']++;\n      strncat(book[author[j] - 'A'], str, 3);\n    }\n  }\n  temp = 0;\n  for (j = 0; j < 26; j++) {\n    if (num[j] > temp) {\n      temp = num[j];\n      temp2 = j + 'A';\n    }\n  }\n  cout << temp2 << endl << temp << endl;\n  for (j = 0; j < temp; j++) {\n    for (i = 0; i < 3; i++)\n      cout << book[temp2 - 'A'][j * 3 + i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } book[999];\n  int m, i, n, j, max;\n  char a[26], c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].writer);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++) {\n        if (a[i] == book[j].writer[n]) {\n          c[i]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", a[max], c[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == a[max]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, a[26], sum = 0;\n  for (j = 0; j < 26; j++)\n    a[j] = 0;\n  char aut;\n  scanf(\"%d\", &m);\n  struct book *head, *pb1, *pb2;\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    pb1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &pb1->num, pb1->author);\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      k = pb1->author[j] - 'A';\n      a[k] += 1;\n    }\n    if (head == NULL) {\n      head = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    } else {\n      pb2->next = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (a[j] > sum) {\n      sum = a[j], k = j;\n    }\n  }\n  aut = (char)('A' + k);\n  printf(\"%c\\n\", aut);\n  printf(\"%d\\n\", sum);\n  pb1 = head;\n  while (pb1) {\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      if (pb1->author[j] == aut)\n        printf(\"%d\\n\", pb1->num);\n    }\n    pb1 = pb1->next;\n  }\n}\n"}
{"label": "2", "index": "3421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, len, i, j, k, max;\n  int c[26] = {0};\n  char a[26], f, x;\n  struct book {\n    int num;\n    char author[26];\n  };\n  struct book b[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, &b[i].author);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ('A' <= (x = a[j]) && (x = a[j]) <= 'Z')\n        c[x - 'A']++;\n  }\n  max = c[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ((f = a[j]) == k + 'A')\n        printf(\"%d\\n\", b[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct books {\n  char num[20];\n  char w[26];\n};\nint main() {\n  int k, j, i, m;\n  int b[150] = {0};\n  scanf(\"%d\", &m);\n  struct books a[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%s %s\", a[i].num, a[i].w);\n    for (j = 0; a[i].w[j] != '\\0'; j++)\n      b[a[i].w[j]]++;\n  }\n  int max = 0;\n  for (i = 'A', j = 0; i <= 'Z'; i++)\n    if (max < b[i]) {\n      max = b[i];\n      j = i;\n    }\n  printf(\"%c\\n\", j);\n  printf(\"%d\\n\", max);\n  int n = 0;\n  for (i = 0; i < m; i++) {\n    n = 0;\n    for (k = 0; a[i].w[k] != '\\0'; k++)\n      if (a[i].w[k] == j)\n        n = 1;\n    if (n == 1)\n      printf(\"%s\\n\", a[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, len, i, j, k, max;\n  int c[26] = {0};\n  char a[26], f, x;\n  struct book {\n    int num;\n    char author[26];\n  };\n  struct book b[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, &b[i].author);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ('A' <= (x = a[j]) && (x = a[j]) <= 'Z')\n        c[x - 'A']++;\n  }\n  max = c[0];\n  k = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max) {\n      max = c[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 'A', max);\n  for (i = 0; i < n; i++) {\n    strcpy(a, b[i].author);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      if ((f = a[j]) == k + 'A')\n        printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "3424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[2000], max = 0, t, b[30] = {0}, j, m;\n  char str[1000][30];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], str[i]);\n    for (j = 0; j < strlen(str[i]); j++) {\n      m = str[i][j] - 64;\n      b[m]++;\n    }\n  }\n  for (i = 1; i < 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 64, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(str[i]); j++)\n      if (str[i][j] == t + 64)\n        cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Books {\n  int num;\n  char author[26];\n} a[1000];\n\nint main() {\n  int n;\n  int i, j;\n  int x;\n  int max = 0;\n  char letter = 'A';\n  int b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i].num, a[i].author);\n  } \n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (a[i].author[j] >= 65 && a[i].author[j] <= 90) {\n        x = a[i].author[j]; \n        b[x - 65]++;\n      } else {\n        break;\n      }\n    }\n  } \n    \n    \n    \n    \n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      letter = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == letter) {\n        printf(\"%d\\n\", a[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, len, i, j, book[1000], num[26] = {0}, k = 0, t, m = 0;\n  char w[1000][27], c = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i] >> w[i];\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      for (c = 'A', t = 0; c <= 'Z'; c++) {\n        if (w[i][j] == c) {\n          num[t]++;\n          break;\n        }\n        t++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > m) {\n      m = num[i];\n      k = i;\n    }\n  }\n  c = 'A' + k;\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", num[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      if (w[i][j] == c) {\n        cout << book[i] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[1000], m[1000];\n  struct {\n    char b[26];\n  } p[1000];\n  int j, k;\n  scanf(\"%d\", &n);\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], p[i].b);\n    m[i] = strlen(p[i].b);\n    for (k = 0; k < 26; k++)\n      for (j = 0; j < m[i]; j++) {\n        if (p[i].b[j] == c[k])\n          num[k]++;\n      }\n  }\n  int max = 0, local = 0;\n  for (k = 0; k < 26; k++) {\n    if (num[k] > max) {\n      max = num[k];\n      local = k;\n    }\n  }\n  printf(\"%c\\n\", c[local]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (p[i].b[j] == c[local])\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, i, j, A[26] = {0}, B[26];\n  char s;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char n[26];\n  } * book;\n  book = (struct book *)malloc(sizeof(struct book) * m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].n);\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      switch (book[i].n[j]) {\n      case 65:\n        A[0]++;\n        break;\n      case 66:\n        A[1]++;\n        break;\n      case 67:\n        A[2]++;\n        break;\n      case 68:\n        A[3]++;\n        break;\n      case 69:\n        A[4]++;\n        break;\n      case 70:\n        A[5]++;\n        break;\n      case 71:\n        A[6]++;\n        break;\n      case 72:\n        A[7]++;\n        break;\n      case 73:\n        A[8]++;\n        break;\n      case 74:\n        A[9]++;\n        break;\n      case 75:\n        A[10]++;\n        break;\n      case 76:\n        A[11]++;\n        break;\n      case 77:\n        A[12]++;\n        break;\n      case 78:\n        A[13]++;\n        break;\n      case 79:\n        A[14]++;\n        break;\n      case 80:\n        A[15]++;\n        break;\n      case 81:\n        A[16]++;\n        break;\n      case 82:\n        A[17]++;\n        break;\n      case 83:\n        A[18]++;\n        break;\n      case 84:\n        A[19]++;\n        break;\n      case 85:\n        A[20]++;\n        break;\n      case 86:\n        A[21]++;\n        break;\n      case 87:\n        A[22]++;\n        break;\n      case 88:\n        A[23]++;\n        break;\n      case 89:\n        A[24]++;\n        break;\n      case 90:\n        A[25]++;\n        break;\n      }\n    }\n  }\n  int k, max;\n\n  for (i = 0; i < 26; i++) {\n    B[i] = A[i];\n  }\n  for (i = 25; i > 0; i--) {\n    if (B[i] > B[i - 1]) {\n      B[i - 1] = B[i];\n\n      max = B[i];\n    } else\n      max = B[i - 1];\n  }\n  for (i = 25; i >= 0; i--) {\n    if (A[i] == max)\n      k = i;\n  }\n\n  s = k + 65;\n  printf(\"%c\\n%d\\n\", s, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; book[i].n[j] != '\\0'; j++) {\n      if (book[i].n[j] == s) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], b[27], max = 0;\n  int i, j, n, k, t, len = 0;\n  char str[100][27];\n  scanf(\"%d\", &n);\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n  for (i = 1; i <= n; i++) {\n    cin >> a[i][1];\n    cin >> str[i];\n    len = strlen(str[i]);\n    for (j = 0; j < len; j++) {\n      k = str[i][j] - 'A';\n      b[k]++;\n      a[i][k + 65] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 'A', max);\n  for (i = 1; i <= n; i++) {\n    if (a[i][t + 'A'] == 1)\n      cout << a[i][1] << \"\\n\";\n  }\n}\n"}
{"label": "2", "index": "3430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint m;\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\nstruct book *create(void) {\n  struct book *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  for (i = 1; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  int num[26] = {0}, i, j, max = 0;\n  struct book *p1, *p2, *head;\n  char *p;\n  p1 = create();\n  head = p1;\n  for (i = 0; i < m; i++) {\n    for (p = p1->name; *p != '\u0000'; p++) {\n      num[(*p) - 'A']++;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      j = i;\n    }\n  }\n  cout << ('A' + j) << \" \";\n  printf(\"%d \", max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    p = p1->name;\n    for (p = p1->name; *p != '\u0000'; p++) {\n      if (*p == ('A' + j)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, m, b[26], t = 0, k;\n  char c[1000][20];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], c[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++)\n      if ('A' < c[i][j] < 'Z')\n        b[c[i][j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (b[i] > t) {\n      t = b[i];\n      k = i;\n    }\n  printf(\"%c\\n\", k + 65);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < strlen(c[i]); j++) {\n      if (c[i][j] == k + 65)\n        printf(\"%d\\n\", a[i]);\n    }\n}\n"}
{"label": "2", "index": "3432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n = 0, book[1000], num[26] = {0};\n  char name[1000][10];\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> book[i] >> name[i];\n  }\n  for (char z = 'A'; z <= 'Z'; z++) {\n    for (int i = 1; i <= m; i++) {\n      for (int j = 0; j < 10; j++)\n        if (name[i][j] == z)\n          num[z - 'A']++;\n    }\n  }\n  int max = 0, k = 0;\n  for (int i = 0; i < 26; i++) {\n    if (max < num[i]) {\n      max = num[i];\n      k = i;\n    }\n  }\n  cout << (char)('A' + k) << endl << max << endl;\n  for (int i = 1; i <= m; i++) {\n    for (int j = 0; j < 10; j++)\n      if (name[i][j] == 'A' + k)\n        cout << book[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[20];\n};\n\nint main() {\n  int i, j, n, t, max = 0;\n  char a[20];\n  int words[26] = {0};\n  struct book b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> (b[i].num) >> (b[i].aut);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++) {\n      t = (int)b[i].aut[j] - 65;\n      words[t]++;\n    }\n  for (i = 0; i < 26; i++)\n    if (words[i] > max) {\n      max = words[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++)\n      if (b[i].aut[j] == (char)(t + 65))\n        cout << b[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  char author[26];\n  int length;\n} a[1000];\n\nint main() {\n  int n, i, k, num = 0, max = 0;\n  char b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].author);\n    a[i].length = strlen(a[i].author);\n  }\n  for (b = 'A'; b <= 'Z'; b++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < a[i].length; k++) {\n        if (a[i].author[k] == b) {\n          num++;\n          break;\n        }\n      }\n    }\n    if (num > max) {\n      max = num;\n      c = b;\n    }\n  }\n  cout << c << \"\\n\" << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < a[i].length; k++) {\n      if (a[i].author[k] == c) {\n        printf(\"%d\\n\", a[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, n, max, l, y = 0;\n  struct book {\n    int num;\n    char aut[26];\n  } book[1000];\n  int a[26] = {0};\n  char b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'z'};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].aut);\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      l = strlen(book[j].aut);\n      for (k = 0; k < l; k++) {\n        if (book[j].aut[k] == b[i]) {\n          a[i]++;\n        }\n      }\n    }\n  }\n\n  for (i = m; i > 0; i--) {\n    for (j = 0; j < 26; j++) {\n      if (a[j] == i) {\n        max = a[j];\n        n = j;\n        printf(\"%c\\n\", b[j]);\n        printf(\"%d\\n\", a[j]);\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    l = strlen(book[i].aut);\n    for (j = 0; j < l; j++) {\n      if (book[i].aut[j] == b[n]) {\n        cout << book[i].num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, max;\n  int a[1000], b[26];\n  char name[1000][26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i], name[i]);\n    for (j = 0; j < strlen(name[i]); j++)\n      b[name[i][j] - 'A']++;\n  }\n  max = 0;\n  for (k = 1; k < 26; k++)\n    if (b[k] > b[max])\n      max = k;\n  printf(\"%c\\n%d\\n\", max + 'A', b[max]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == max + 'A') {\n        cout << a[i] << \"\\n\";\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3437", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char author[27];\n  int i, j, n, no, ab[26][1000] = {0}, an[26] = {0}, ma = 0, na, am;\n  cin >> n;\n  for (; n > 0; n--) {\n    cin >> no >> author;\n    for (i = 0; i < 27; i++) {\n      if (author[i] != '\\0')\n        ab[author[i] - 'A'][an[author[i] - 'A']] = no, an[author[i] - 'A']++;\n      else\n        break;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    na = 0;\n    for (j = 0; j < 999; j++)\n      if (ab[i][j] != 0)\n        na++;\n      else\n        break;\n    if (na > ma)\n      ma = na, am = i;\n  }\n  cout << (char)('A' + am) << endl << ma << endl;\n  for (i = 0; i < 1000; i++)\n    if (ab[am][i] != 0)\n      cout << ab[am][i] << endl;\n    else\n      break;\n  return 0;\n}\n"}
{"label": "2", "index": "3438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[20];\n};\n\nint main() {\n  int i, j, n, t, max = 0;\n  char a[20];\n  int words[26] = {0};\n  struct book b[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> (b[i].num) >> (b[i].aut);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++) {\n      t = (int)b[i].aut[j] - 65;\n      words[t]++;\n    }\n\n  for (i = 0; i < 26; i++)\n    if (words[i] > max) {\n      max = words[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, max);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].aut[j] != '\\0'; j++)\n      if (b[i].aut[j] == (char)(t + 65))\n        printf(\"%d\\n\", b[i].num);\n}\n"}
{"label": "2", "index": "3439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    char z[27];\n    int no;\n  };\n\n  struct book a[1000];\n\n  int m, i, x, p, j;\n  cin >> m;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &a[i].no, a[i].z);\n  }\n\n  int memo[26] = {0};\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      x = (a[i].z[j]) - 65;\n      memo[x]++;\n    }\n  }\n  x = 0;\n  p = 0;\n  for (i = 0; i < 26; i++) {\n\n    if (memo[i] > x) {\n      x = memo[i];\n      p = i;\n    }\n  }\n\n  cout << p + 65 << \"\\n\";\n\n  int n = 0;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65)\n        n++;\n    }\n  }\n\n  cout << n << \"\\n\";\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].z[j] == '\\0')\n        break;\n      if (a[i].z[j] == p + 65) {\n        printf(\"%d\\n\", a[i].no);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  char name[26];\n  int number;\n} a[1000];\nint main() {\n  int n, i, j, b[26] = {0}, max = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].name);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      b[a[i].name[j] - 65]++;\n  for (i = 0; i < 26; i++)\n    if (max < b[i])\n      max = b[i];\n  for (i = 0; i < 26; i++)\n    if (max == b[i]) {\n      t = i;\n      break;\n    }\n  printf(\"%c\\n%d\\n\", t + 65, b[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; a[i].name[j] != '\\0'; j++)\n      if (a[i].name[j] == t + 65) {\n        printf(\"%d\\n\", a[i].number);\n        break;\n      }\n}\n"}
{"label": "2", "index": "3441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } bookn[999];\n  struct zuozhe {\n    char w;\n    int count;\n  } zuozhen[26];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++) {\n    zuozhen[i].w = 'A' + i;\n    zuozhen[i].count = 0;\n  }\n  int h = 0;\n  int m, j;\n  for (i = 0; i < n; i++) {\n    cin >> bookn[i].num >> bookn[i].writer;\n    m = strlen(bookn[i].writer);\n    for (j = 0; j < m; j++) {\n      h = bookn[i].writer[j] - 'A';\n      zuozhen[h].count++;\n    }\n  }\n  struct zuozhe a;\n  a = zuozhen[0];\n  for (i = 1; i < 26; i++) {\n    if (a.count < zuozhen[i].count)\n      a = zuozhen[i];\n  }\n  printf(\"%c\\n\", a.w);\n  printf(\"%d\\n\", a.count);\n  int t;\n  for (i = 0; i < n; i++) {\n    t = strlen(bookn[i].writer);\n    for (j = 0; j < t; j++) {\n      if (bookn[i].writer[j] == a.w)\n        printf(\"%d\\n\", bookn[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, p;\n  int a[1000];\n  scanf(\"%d\", &n);\n  struct book {\n    int m;\n    char c[27];\n  };\n  struct book b[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i].m);\n    scanf(\"%s\", b[i].c);\n  }\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++)\n      a[b[i].c[j] - 'A']++;\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (max == a[i])\n      p = i;\n  }\n  p = p + 'A';\n  printf(\"%c\\n\", p);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    l = strlen(b[i].c);\n    for (j = 0; j < l; j++) {\n      if (b[i].c[j] == p)\n        printf(\"%d\\n\", b[i].m);\n    }\n  }\n}\n"}
{"label": "2", "index": "3443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;\n  char name[1002][27], a, max;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> book[i];\n    cin >> name[i];\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      a = name[i][j];\n      cnt[a - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > n) {\n      n = cnt[i];\n      max = i + 'A';\n    }\n  }\n  cout << max << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      if (name[i][j] == max) {\n        cout << book[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct info {\n  int num;\n  char author[30];\n  struct info *next;\n};\nstruct info *create(int n) {\n  struct info *p1, *p2, *head;\n  int i;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d%s\", &p1->num, p1->author);\n  p1->next = NULL;\n  p2 = p1;\n  head = p1;\n  i = 1;\n  while (i < n) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d%s\", &p1->num, p1->author);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  }\n  return head;\n}\n\nint main() {\n  int n, i, t, index, j;\n  struct info *head, *p;\n  int *g;\n  scanf(\"%d\", &n);\n  head = create(n);\n  g = (int *)malloc(26 * sizeof(int));\n  p = head;\n  for (i = 0, t = 0; i < 26; i++) {\n    *(g + i) = 0;\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      (*(g + (*(p->author + j)) - 65))++;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0, t = 0; i < 26; i++) {\n    if (*(g + i) > t) {\n      t = *(g + i);\n      index = i;\n    }\n  }\n  printf(\"%d\\n\", index + 65);\n  printf(\"%d\\n\", *(g + index));\n  p = head;\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (*(p->author + j) != '\\0') {\n      if (*(p->author + j) == index + 65) {\n        printf(\"%d\\n\", p->num);\n      }\n      j++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->str;\n  head = 0;\n  while (p1->num != 0) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->str;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x = 1, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 64]++;\n    }\n  }\n  max = sum[1];\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 64)\n        a[y] = p->num;\n    y++;\n  }\n  printf(\"%c\\n%d\\n\", x + 64, max);\n  for (y = 1; y <= 99; y++)\n    if (a[y] != 0)\n      printf(\"%d\\n\", a[y]);\n}\n"}
{"label": "2", "index": "3446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  scanf(\"%d \", &m);\n  char str[1000][26];\n  int a[1000], count[26] = {0};\n  int t = 0;\n  int shu = 0;\n\n  for (int i = 0; i < m; i++) {\n    t = 0;\n    scanf(\"%d \", &a[i]);\n    cin >> str[i];\n    t = strlen(str[i]);\n    for (int j = 0; j < t; j++) {\n      shu = str[i][j] - 'A';\n      count[shu]++;\n    }\n  }\n\n  int max = count[0];\n  int hao = 0;\n\n  for (int k = 1; k < 26; k++) {\n    if (count[k] > max) {\n      max = count[k];\n      hao = k;\n    }\n  }\n\n  char c = hao + 'A';\n\n  printf(\"%c\\n\", c);\n  cout << max << endl;\n\n  for (int l = 0; l < m; l++) {\n    for (int o = 0; str[l][o] != '\\0'; o++) {\n      if (str[l][o] == c) {\n        cout << a[l] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3447", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct author {\n  char name[26];\n  int num;\n  struct author *next;\n};\nint main() {\n  int i, n, a[26], j, t;\n  struct author *head;\n  struct author *p1, *p2;\n  p1 = p2 = (struct author *)malloc(1000);\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &p1->num, p1->name);\n    if (i == 0)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != (n - 1))\n      p1 = p2->next = (struct author *)malloc(1000);\n    else {\n      p2->next = NULL;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = 0;\n  }\n  p1 = head;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      a[p1->name[j] - 'A']++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > a[t])\n      t = i;\n  }\n  printf(\"%c %d \", t + 'A', a[t]);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++) {\n      if (p1->name[j] == t + 'A')\n        printf(\"%d \", p1->num);\n      continue;\n    }\n  }\n}\n"}
{"label": "2", "index": "3448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[1000];\nchar auth[1000][26];\n\nint main() {\n  int m, i, l;\n  scanf(\"%d\", &m);\n  char c = 'A';\n  int k = 0;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    scanf(\"%s\", auth[i]);\n    int j = 0;\n    while (auth[i][j] != '\\0') {\n      a[auth[i][j] - 64]++;\n      j++;\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > k) {\n      k = a[i];\n      c = i + 64;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, k);\n\n  for (i = 0; i < m; i++)\n    for (l = 0; l < 26; l++) {\n      if (auth[i][l] == c)\n        printf(\"%d\\n\", num[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3449", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[1000], i, j, a[26] = {0}, len, k, max, l = 0;\n  char x[1000][10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i] >> x[i];\n  for (i = 0; i < n; i++) {\n    len = 0;\n    k = 0;\n    len = strlen(x[i]);\n    for (j = 0; j < len; j++) {\n      k = x[i][j];\n      a[k - 65]++;\n    }\n  }\n  max = a[0];\n  for (j = 1; j < 26; j++) {\n    if (a[j] > max) {\n      max = a[j];\n      l = j;\n    }\n  }\n  printf(\"%c\\n\", l + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 10; j++) {\n      if (x[i][j] == (l + 65))\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct chain {\n  int num;\n  char name[27];\n  struct chain *next;\n};\nint main() {\n  int a[26] = {0}, m, i, j, k, max = 0, n;\n  struct chain *p1, *p2, *head;\n  cin >> m;\n  p2 = head = (struct chain *)malloc(1000);\n  for (k = 0; k < 27; k++)\n    head->name[k] = 0;\n  scanf(\"%d%s\", &head->num, &head->name);\n  for (k = 0; k < strlen(head->name); k++) {\n    if (head->name[k] >= 65 && head->name[k] <= 90)\n      a[head->name[k] - 65]++;\n  }\n  for (j = 0; j < m - 1; j++) {\n    p1 = (struct chain *)malloc(1000);\n    p2->next = p1;\n    for (k = 0; k < 27; k++)\n      p1->name[k] = 0;\n    cin >> p1->num >> p1->name;\n    p2 = p1;\n    for (k = 0; k < strlen(p1->name); k++) {\n      if (p1->name[k] >= 65 && p1->name[k] <= 90)\n        a[p1->name[k] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      n = i;\n    }\n  }\n  printf(\"%c %d \", n + 65, max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p1->name[j] == (n + 65)) {\n        cout << p1->num << \" \";\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3451", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct list_1 {\n  int book;\n  char name[30];\n};\n\nint main(char *argv[]) {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[26];\n  struct list_1 shelf[n];\n  for (i = 0; i <= 25; i++)\n    a[i] = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &shelf[i].book, shelf[i].name);\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++)\n      a[shelf[i].name[j] - 'A']++;\n  }\n  int max, flag = 0, add = 0, temp = 0;\n  max = a[0];\n  for (i = 0; i <= 25; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      flag = i;\n    }\n  }\n  printf(\"%c \", flag + 'A');\n  printf(\"%d \", max);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A')\n        add++;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(shelf[i].name) - 1; j++) {\n      if (shelf[i].name[j] == flag + 'A') {\n        printf(\"%d\", shelf[i].book);\n        temp++;\n        (temp < add) ? printf(\" \") : printf(\"\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3452", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[100];\n};\n\nint main() {\n  int n, i, j, a[26], c[100], k, t, d[100], s;\n  struct book bo[100];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].num;\n    scanf(\"%s\", bo[i].writer);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = strlen(bo[i].writer);\n    for (j = 0; j < c[i]; j++) {\n      k = bo[i].writer[j] - 'A';\n      a[k]++;\n    }\n  }\n  t = a[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > t) {\n      j = i;\n      t = a[i];\n    }\n  }\n  s = j;\n  printf(\"%c\\n\", 'A' + j);\n  printf(\"%d\\n\", t);\n  for (i = 0; i < n; i++) {\n    d[i] = 0;\n    for (j = 0; j < c[i]; j++) {\n      if (bo[i].writer[j] == ('A' + s))\n        d[i] = 1;\n    }\n    if (d[i] == 1)\n      printf(\"%d\\n\", bo[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int NO;\n    char AUT[27];\n  } book[999];\n  int i, j, k, n, d, max;\n  int a[26] = {0}, b[26][999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &book[i].NO);\n\n    cin >> book[i].AUT;\n    for (j = 0; book[i].AUT[j] != '\u0000'; j++) {\n      d = book[i].AUT[j] - 65;\n      b[d][a[d]] = book[i].NO;\n      a[d] = a[d] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  cout << k + 65 << \" \" << max << \" \";\n  for (i = 0; i < a[k] - 1; i++) {\n    printf(\"%d \", b[k][i]);\n  }\n  printf(\"%d\", b[k][a[k] - 1]);\n}\n"}
{"label": "2", "index": "3454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len[1000];\n  int b[26];\n  int a[1000];\n  char str[1000][26];\n  int m, i, j, max, num;\n  char c;\n  int pos, temp;\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    scanf(\"%s\", str[i]);\n    len[i] = strlen(str[i]);\n    for (j = 0; j < len[i]; j++) {\n      temp = str[i][j] - 'A';\n      b[temp]++;\n    }\n  }\n  max = b[0];\n  pos = 0;\n  for (i = 1; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      pos = i;\n    }\n  }\n  c = pos + 'A';\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (str[i][j] == c) {\n        num++;\n        if (num < max)\n          printf(\"%d\\n\", a[i]);\n        else\n          printf(\"%d\", a[i]);\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char author[26];\n  } b[999];\n  int a[26] = {0}, n, i, j, k, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].author);\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      k = 0;\n      while (b[j].author[k] != '\\0') {\n        if (b[j].author[k] == i + 65)\n          a[i]++;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++)\n    if (max < a[i])\n      max = a[i];\n  i = 0;\n  while (max != a[i])\n    i++;\n  printf(\"%c\\n%d\\n\", i + 65, a[i]);\n  for (j = 0; j < n; j++) {\n    k = 0;\n    while (b[j].author[k] != i + 65 && b[j].author[k] != '\\0')\n      k++;\n    if (b[j].author[k] == i + 65)\n      cout << b[j].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int max, max2;\n  int a[26];\n  struct book {\n    int number;\n    char author[26];\n  } stu1[1000];\n  struct author {\n    int number[1000];\n    int ben;\n  } stu2[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &stu1[i].number, stu1[i].author);\n  }\n  for (i = 0; i <= 25; i++) {\n    stu2[i].ben = 0;\n    a[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(stu1[i].author) - 1; j++) {\n      k = stu1[i].author[j];\n      stu2[k - 65].ben++;\n      stu2[k - 65].number[a[k - 65]] = stu1[i].number;\n      a[k - 65]++;\n    }\n  }\n  max = stu2[0].ben;\n  max2 = 0;\n  for (i = 1; i <= 25; i++) {\n    if (stu2[i].ben > max) {\n      max = stu2[i].ben;\n      max2 = i;\n    }\n  }\n  printf(\"%c\\n\", max2 + 65);\n  cout << max << \"\\n\";\n  for (j = 0; j <= a[max2] - 1; j++)\n    printf(\"%d\\n\", stu2[max2].number[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "3457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, number, i, j, k, t, len, max;\n  int map[26][1000] = {0};\n  char name[27];\n\n  cin >> n;\n  for (i = 0; i <= 25; i++)\n    map[i][0] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> number >> name;\n    len = strlen(name);\n    for (j = 0; j <= len - 1; j++) {\n      k = name[j] - 'A';\n      map[k][0]++;\n      t = map[k][0];\n      map[k][t] = number;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= 25; i++) {\n    if (map[i][0] > max) {\n      max = map[i][0];\n      k = i;\n    }\n  }\n  cout << (char)(65 + k) << endl;\n  cout << map[k][0];\n  for (i = 1; i <= map[k][0]; i++)\n    cout << endl << map[k][i];\n\n  return 0;\n}\n"}
{"label": "2", "index": "3458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char auther[27];\n} bk[1000];\n\nstruct ath {\n  char a;\n  int books[999];\n  int sum;\n} auth[27], temp;\n\nint main() {\n  int n, i, x, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &bk[i].number, bk[i].auther);\n  for (i = 0; i < 27; i++) {\n    for (j = 0; j < 999; j++)\n      auth[i].books[j] = 0;\n    auth[i].sum = 0;\n    auth[i].a = 'A' + i;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bk[i].auther);\n    int f;\n    for (f = 0; f < m; f++) {\n      x = (int)(bk[i].auther[f] - 'A');\n      auth[x].books[auth[x].sum] = bk[i].number;\n      auth[x].sum++;\n    }\n  }\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (auth[i].sum > auth[i + 1].sum) {\n        temp = auth[i];\n        auth[i] = auth[i + 1];\n        auth[i + 1] = temp;\n      }\n  cout << auth[25].a << \"\\n\";\n  cout << auth[25].sum << \"\\n\";\n  i = 0;\n  while (auth[25].books[i] != 0) {\n    printf(\"%d\\n\", auth[25].books[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char au[32];\n  int sta[27];\n} b[1020];\nint main() {\n  int i, j, k, m, n;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].au);\n  }\n  for (i = 0; i < m; i++) {\n\n    for (j = 0;; j++) {\n      c = b[i].au[j];\n      if (c == '\\0') {\n        break;\n      } else {\n        b[i].sta[c - 64]++;\n      }\n    }\n  }\n  int sum[27] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < 27; j++)\n      sum[j] += b[i].sta[j];\n  }\n  int max = 0;\n  for (i = 1; i < 27; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 64);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n    }\n  }\n  printf(\"%d\\n\", n);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n      if (n == 1) {\n        printf(\"%d\", b[i].num);\n      } else {\n        printf(\"\\n%d\", b[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m;\n  struct bo {\n    int a;\n    char au[36];\n  };\n  struct bo bo[999];\n  int i, j;\n  char k, K;\n  int sb[26] = {0}, sbt;\n  int len;\n  int n;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &bo[i].a, bo[i].au);\n    len = strlen(bo[i].au);\n    for (j = 0; j < len; j++) {\n      for (k = 65; k < 91; k++) {\n        if (bo[i].au[j] == k) {\n          sb[k - 65]++;\n        }\n      }\n    }\n  }\n  K = 0;\n  sbt = 0;\n  for (i = 0; i < 26; i++) {\n    if (sb[i] > sbt) {\n      K = i + 65;\n      sbt = sb[i];\n    }\n  }\n  printf(\"%c\\n%d\\n\", K, sbt);\n  for (i = 0; i < m; i++) {\n    n = 1;\n    for (j = 0; j < strlen(bo[i].au); j++) {\n      if (K == bo[i].au[j]) {\n        n = 0;\n      }\n    }\n    if (n == 0) {\n      printf(\"%d\\n\", bo[i].a);\n    }\n  }\n}\n"}
{"label": "2", "index": "3461", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct sa {\n  int a;\n  char b[100];\n  struct sa *next;\n};\nint n, m, k[27];\nstruct sa *kao(void) {\n  struct sa *head;\n  struct sa *p1, *p2;\n  n = 0;\n  head = NULL;\n  p1 = p2 = (struct sa *)malloc(1000);\n  scanf(\"%d %s\", &p1->a, p1->b);\n  head = p1;\n  for (;;) {\n    n++;\n    if (n == m + 1)\n      break;\n    if (n == 1)\n      head = p1;\n    else {\n      p2 = p1;\n      p1 = (struct sa *)malloc(1000);\n      scanf(\"%d %s\", &p1->a, p1->b);\n      p2->next = p1;\n    }\n  }\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  struct sa *p, *q, *head, *ped;\n  int f, i, g, s = 1, t, d = 0;\n  char c;\n  scanf(\"%d\", &m);\n  head = kao();\n  for (p = head; p != NULL; p = p->next) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      k[p->b[i] - 64]++;\n    }\n  }\n  t = k[1];\n  for (i = 2; i < 27; i++) {\n    if (k[i] > k[s]) {\n      s = i;\n      t = k[i];\n    }\n  }\n  printf(\"%c %d \", s + 64, t);\n  for (p = head; p != NULL;) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      if (p->b[i] == s + 64) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      printf(\"%d \", p->a);\n    d = 0;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int number;\n  char name[26];\n  int num[26];\n};\nvoid mostbook(struct book *p) {\n  int i, j, k;\n  k = strlen(p->name);\n  for (j = 0; j < 26; j++) {\n    p->num[j] = 0;\n  }\n  for (i = 0; i < k; i++)\n    (p->num[(p->name[i] - 'A')])++;\n}\n\nint main() {\n  int i, j, m;\n  int max = 0;\n  int maxi = 0;\n  int s[26] = {0};\n\n  scanf(\"%d\", &m);\n  struct book *p;\n  p = (struct book *)malloc(m * sizeof(struct book));\n  for (i = 0; i < m; i++) {\n\n    scanf(\"%d\", &(p + i)->number);\n    scanf(\"%s\", &(p + i)->name);\n    mostbook(p + i);\n    for (j = 0; j < 26; j++)\n      s[j] += ((p + i)->num[j]);\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i] >= max) {\n      max = s[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%c\\n\", (maxi + 'A'));\n\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < m; i++) {\n    int k, j;\n    k = strlen((p + i)->name);\n    for (j = 0; j < k; j++) {\n      if ((p + i)->name[j] == (maxi + 'A')) {\n        cout << (p + i)->number << \"\\n\";\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3463", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\nstruct student {\n  int id;\n  char name[100];\n  struct student *next;\n};\nstruct student *creat() {\n  int i = 1;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &m);\n  scanf(\"%d %s\", &p1->id, p1->name);\n  head = NULL;\n  for (; i < m; i++) {\n    if (i == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->id, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  int num[30] = {0}, max, j;\n  char i, auth;\n  head = creat();\n\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (i = 'A'; i <= 'Z'; i++) {\n      for (j = 0; j < strlen(p1->name); j++)\n        if (p1->name[j] == i)\n          num[i - 'A']++;\n    }\n  }\n  for (i = 0, max = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      auth = i + 'A';\n    }\n  }\n  printf(\"%c \", auth);\n  printf(\"%d \", max);\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    for (j = 0; j < strlen(p1->name); j++)\n      if (p1->name[j] == auth)\n        printf(\"%d \", p1->id);\n  }\n}\n"}
{"label": "2", "index": "3464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, len, i, j, book[1000], num[26] = {0}, k = 0, t, m = 0;\n  char w[1000][27], c = 'A';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i], w[i]);\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      for (c = 'A', t = 0; c <= 'Z'; c++) {\n        if (w[i][j] == c) {\n          num[t]++;\n          break;\n        }\n        t++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (num[i] > m) {\n      m = num[i];\n      k = i;\n    }\n  }\n  c = 'A' + k;\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", num[k]);\n  for (i = 0; i < n; i++) {\n    len = strlen(w[i]);\n    for (j = 0; j < len; j++) {\n      if (w[i][j] == c) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[2000], max = 0, t, b[30] = {0}, j, m;\n  char str[1000][30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], str[i]);\n    for (j = 0; j < strlen(str[i]); j++) {\n      m = str[i][j] - 64;\n      b[m]++;\n    }\n  }\n  for (i = 1; i < 26; i++)\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", t + 64, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(str[i]); j++)\n      if (str[i][j] == t + 64)\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char str[27];\n} bo[1000];\nstruct people {\n  int name;\n  int number;\n  int book_number[1000];\n} people[26];\nint main() {\n  int n, i, j, k, m, max = 0;\n  char a[27] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\\0'};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bo[i].id >> bo[i].str;\n  }\n  for (i = 0; i < 26; i++) \n  {\n    people[i].number = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(bo[i].str);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < 26; k++) \n      {\n        if (bo[i].str[j] == a[k]) {\n          people[k].book_number[people[k].number] = bo[i].id;\n          people[k].number++;\n        }\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < 26; i++) \n  {\n    if (people[i].number > max) {\n      j = i;\n      max = people[i].number;\n    }\n  }\n  cout << a[j] << endl;\n  cout << people[j].number << endl;\n  for (i = 0; i < people[j].number; i++) {\n    cout << people[j].book_number[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][100];\n  int b[1000], c[27], s[1000], max, i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i], a[i]);\n    s[i] = strlen(a[i]);\n  }\n  for (j = 0; j < 26; j++) {\n    c[j] = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < s[i]; k++) {\n        if (a[i][k] == 65 + j)\n          c[j] = c[j] + 1;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      printf(\"%c\\n\", i + 65);\n      printf(\"%d\\n\", c[i]);\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < s[k]; j++) {\n          if (a[k][j] == 65 + i)\n            printf(\"%d\\n\", b[k]);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][27], x;\n  int m, i, j, k, b[1000], c[26] = {0}, max = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> b[i] >> a[i];\n    int len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      c[a[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++)\n    if (max < c[j]) {\n      max = c[j];\n      x = 'A' + j;\n    }\n\n  cout << x << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    int len = strlen(a[i]);\n    for (k = 0; k < len; k++)\n      if (a[i][k] == x) {\n        cout << b[i] << endl;\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char book[1000][20] = {'\\0'}, name[1000][30] = {'\\0'};\n  int length, n, i, j, number[30] = {0}, memory, largest, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %s\", book[i], name[i]);\n\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      temp = name[i][j] - 'A';\n      number[temp] += 1;\n    }\n  }\n  largest = 0;\n  for (i = 0; i < 26; i++) {\n    if (number[i] > largest) {\n      largest = number[i];\n      memory = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + memory, number[memory]);\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      if (name[i][j] == 'A' + memory) {\n        printf(\"%s\\n\", book[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3470", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  char number[1000][5] = {' '};\n  char authors[1000][30] = {' '};\n  int author[30] = {0};\n  for (i = 0; i <= n - 1; i++) {\n    cin >> number[i] >> authors[i];\n    int len1 = strlen(authors[i]);\n\n    for (j = 0; j <= len1 - 1; j++) {\n      author[authors[i][j] - 'A']++;\n    }\n  }\n  int k, kmax = 0;\n  int max = author[0];\n  for (k = 1; k <= 25; k++) {\n    if (author[k] > max) {\n      max = author[k];\n      kmax = k;\n    }\n  }\n  char writer = kmax + 'A';\n  cout << writer << endl;\n  cout << max << endl;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= 25; j++) {\n      if (authors[i][j] - 'A' == kmax) {\n        printf(\"%s\\n\", number[i]);\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3471", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int name;\n  char writer[100];\n  struct book *next;\n};\n\nint a[26];\n\nstruct book *creat(int n) {\n  struct book *p1, *p2, *xhead;\n  p1 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->name, p1->writer);\n  p2 = p1;\n  xhead = p1;\n\n  while (n - 1) {\n    n--;\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%d %s\", &p1->name, p1->writer);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return xhead;\n}\n\nvoid find(struct book *head) {\n  struct book *p;\n  int i;\n  char s[100];\n  p = head;\n  while (p) {\n    i = 0;\n    strcpy(s, p->writer);\n    while (s[i] != '\u0000') {\n      a[s[i] - 'A']++;\n      i++;\n    }\n\n    p = p->next;\n  }\n}\n\nvoid print(struct book *head, int max) {\n  struct book *p;\n  p = head;\n  while (p) {\n    if (strchr(p->writer, max + 'A'))\n      printf(\"%d \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  int i, max = 0, n;\n  struct book *head;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  find(head);\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[max])\n      max = i;\n  printf(\"%c \", max + 'A');\n  printf(\"%d \", a[max]);\n  print(head, max);\n}\n"}
{"label": "2", "index": "3472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][27], x;\n  int m, i, j, k, b[1000], c[26] = {0}, max = 0;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    cin >> b[i] >> a[i];\n    int len = strlen(a[i]);\n    for (j = 0; j < len; j++)\n      c[a[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++)\n    if (max < c[j]) {\n      max = c[j];\n      x = 'A' + j;\n    }\n\n  cout << x << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    int len = strlen(a[i]);\n    for (k = 0; k < len; k++)\n      if (a[i][k] == x) {\n        cout << b[i] << endl;\n        break;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int no;\n  char auth[26];\n};\nint main() {\n  struct book *head, *BK;\n  int m, n, k, i, j, t, q, p, max;\n  int a[26] = {0};\n  scanf(\"%d\", &m);\n  BK = (struct book *)malloc(m * 1000);\n  head = BK;\n  for (i = 0; i < m; i++) {\n    cin >> BK->no >> BK->auth;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      k = BK->auth[j] - 'A';\n      a[k] = a[k] + 1;\n    }\n    BK = BK + 1;\n  }\n  max = a[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  q = t + 'A';\n  printf(\"%c %d \", q, max);\n  BK = head;\n  for (i = 0; i < m; i++) {\n    p = 0;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      if (BK->auth[j] == q) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1)\n      printf(\"%d \", BK->no);\n\n    BK = BK + 1;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;\n  char name[1002][27], a, max;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> book[i];\n    cin >> name[i];\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      a = name[i][j];\n      cnt[a - 'A']++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > n) {\n      n = cnt[i];\n      max = i + 'A';\n    }\n  }\n  cout << max << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    l = strlen(name[i]);\n    for (j = 0; j < l; j++) {\n      if (name[i][j] == max) {\n        printf(\"%d\\n\", book[i]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][30] = {\"\\0\"}, c;\n  int i, j, k, m, n, a[26] = {0}, b[100] = {0}, t = -1;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], s[i]);\n    for (c = 'A'; c <= 'Z'; c++) {\n      if (strchr(s[i], c))\n        a[c - 65]++;\n    }\n  }\n  j = a[0];\n  k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > j) {\n      j = a[i];\n      k = i;\n    }\n  }\n  cout << k + 65 << \"\\n\" << a[k] << \"\\n\";\n  for (i = 0; i < m; i++)\n    if (strchr(s[i], k + 65))\n      printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "2", "index": "3476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char author[27];\n};\nint main() {\n  int n, m, i, j;\n  int author_num[26] = {0};\n  cin >> n;\n  struct book shu[999];\n  for (i = 0; i < n; i++) {\n    cin >> shu[i].num >> shu[i].author;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      m = shu[i].author[j] - 'A';\n      author_num[m]++;\n    }\n  }\n  int max = author_num[0], author = 'A';\n  for (i = 1; i < 26; i++) {\n    if (author_num[i] > max) {\n      max = author_num[i];\n      author = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (shu[i].author[j] == author) {\n        printf(\"%d\\n\", shu[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000][26], t;\n  int b[1000], num[26] = {0}, n, i, j, k, max, l[1000];\n  scanf(\"%d \", &n);\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b[i]);\n\n    cin >> a[i];\n    l[i] = strlen(a[i]);\n    for (j = 1; j <= l[i]; j++)\n      num[a[i][j] - 'A']++;\n  }\n  for (i = 0; i <= 25; i++)\n    if (num[i] > max) {\n      max = num[i];\n      t = i + 'A';\n    }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= l[i]; j++)\n      if (a[i][j] == t)\n        printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char str[30];\n  } bk[1000] = {0};\n  int i, j, m, n, sum[100] = {0}, number[1000] = {0}, result, max = 0;\n  char temp = 'A';\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].str;\n  for (i = 65; i <= 90; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++)\n        if (bk[j].str[n] == i)\n          sum[i]++;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (sum[j + 65] > max) {\n      max = sum[j + 65];\n      temp = j + 65;\n      result = j + 65;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (n = 0; n < 30; n++)\n      if (bk[i].str[n] == temp) {\n        number[i] = bk[i].num;\n        break;\n      }\n  }\n  printf(\"%c\\n%d\\n\", temp, sum[result]);\n  for (i = 0; i < m; i++)\n    if (number[i] != 0)\n      printf(\"%d\\n\", number[i]);\n}\n"}
{"label": "2", "index": "3479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int no;\n  char wri[27];\n} book[1000];\n\nint main() {\n  int n, i, j, k = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].no, book[i].wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      a[book[i].wri[j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[0]) {\n      a[0] = a[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", 'A' + k, a[0]);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      if (book[i].wri[j] == 'A' + k) {\n        printf(\"%d\\n\", book[i].no);\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct list_1 {\n  int num;\n  char author[26];\n};\n\nstruct number {\n  int a;\n  int time;\n};\n\nint main() {\n  int i, j, m, k, length;\n  struct list_1 book[100];\n  struct number name[26], most;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n\n  for (i = 0; i < 26; i++) {\n    name[i].a = i;\n    name[i].time = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      name[k - 65].time++;\n    }\n  }\n\n  most = name[0];\n\n  for (i = 1; i < 26; i++) {\n    if (name[i].time > most.time) {\n      most = name[i];\n    }\n  }\n\n  printf(\"%c %d \", most.a + 65, most.time);\n\n  for (i = 0; i < m; i++) {\n    length = strlen(book[i].author);\n\n    for (j = 0; j < length; j++) {\n      k = (book[i].author[j]);\n      if (most.a + 65 == k) {\n        printf(\"%d \", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3481", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct {\n  char name[20];\n  int num;\n} book[1000];\n\nint main() {\n  int n, i, j, max = 0, m = 0;\n  scanf(\"%d\", &n);\n  int c[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      strchr(book[i].name, 'A' + j) ? c[j]++ : 0;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (c[j] > max) {\n      max = c[j];\n      m = j;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + m, c[m]);\n  for (i = 0; i < n; i++) {\n    strchr(book[i].name, 'A' + m) ? printf(\"%d\\n\", book[i].num) : 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char writer[26];\n  } book[999];\n  int m, i, n, j, max;\n  char a[26], c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].writer);\n  }\n  for (i = 0; i < 26; i++) {\n    a[i] = i + 65;\n    c[i] = 0;\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < m; j++) {\n      for (n = 0; n < 26; n++) {\n        if (a[i] == book[j].writer[n]) {\n          c[i]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > c[max]) {\n      max = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", a[max], c[max]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (book[i].writer[j] == a[max]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[1001], num[27] = {0}, ascii[27];\n  char a[1001][27], p;\n  int i, j, m, n, t1, t;\n  cin >> m;\n  n = 26;\n  for (i = 0; i < m; i++) {\n    cin >> number[i];\n    cin >> a[i];\n    for (j = 0; j < strlen(a[i]); j++) {\n      num[a[i][j] - 'A']++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    ascii[i] = i;\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (num[j] > num[j - 1]) {\n        t = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = t;\n        t1 = ascii[j];\n        ascii[j] = ascii[j - 1];\n        ascii[j - 1] = t1;\n      }\n    }\n  }\n  p = 'A' + ascii[0];\n  cout << p << endl;\n  cout << num[0] << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(a[i]); j++) {\n      if (a[i][j] == p) {\n        cout << number[i] << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3484", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[26];\n  struct book *next;\n};\n\nstruct book *creat(int n) {\n  int i;\n  struct book *head;\n  struct book *p1, *p2;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n\n  for (i = 0; i < n - 1; i++) {\n\n    if (i == 0)\n      head = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, n, a[26] = {0}, max = 0, j, k = 0;\n  char t;\n  struct book *p, *p1;\n  scanf(\"%d \", &n);\n  p = creat(n);\n  p1 = p;\n  for (j = 0; j < n; j++) {\n    for (i = 0; *(p->name + i) != '\\0'; i++)\n      a[*(p->name + i) - 65] = a[*(p->name + i) - 65] + 1;\n    p = p->next;\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", (k + 65), max);\n  t = (char)(k + 65);\n\n  while (p1 != NULL) {\n    for (i = 0; *(p1->name + i) != '\\0'; i++) {\n      if (*(p1->name + i) == t) {\n        printf(\"%d\\n\", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int book;\n  char writer[26];\n  int counter[26] = {0};\n  int bookbelong[26][999] = {0};\n  int everynum[26] = {0};\n  int t = 0;\n  while (k--) {\n    cin >> book >> writer;\n    int str = strlen(writer);\n    for (int i = 0; i < str; i++)\n\n    {\n      int flag = writer[i] - 'A';\n      counter[flag]++;\n      bookbelong[flag][everynum[flag]++] = book;\n    }\n  }\n  int max = counter[0];\n  int maxnum = 0;\n  for (int i = 0; i < 26; i++) {\n    if (counter[i] > max) {\n      maxnum = i;\n      max = counter[i];\n    }\n  }\n  char writerbest;\n  writerbest = 'A' + maxnum;\n  cout << writerbest << endl << everynum[maxnum] << endl;\n  for (int i = 0; i < everynum[maxnum]; i++)\n    cout << bookbelong[maxnum][i] << endl;\n\n  return 0;\n}\n"}
{"label": "2", "index": "3486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, best = 0, max = 0, a[26] = {0}, num[100], l, j, k;\n  char letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                     'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                     'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'},\n       writer[100][26];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> writer[i];\n  }\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      for (k = 0; k < 26; k++) {\n        if (writer[i][j] == letter[k]) {\n          a[k]++;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      best = i;\n      max = a[i];\n    }\n  }\n  cout << letter[best] << \"\\n\";\n  cout << max << \"\\n\";\n  for (i = 0; i < n; i++) {\n    l = strlen(writer[i]);\n    for (j = 0; j < l; j++) {\n      if (writer[i][j] == letter[best]) {\n        printf(\"%d\\n\", num[i]);\n        ;\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct shu {\n  int num;\n  char author_name[27];\n};\n\nint main() {\n  int ere[26];\n  int m, i, max = 0, key;\n  for (i = 0; i < 26; i++) {\n    ere[i] = 0;\n  }\n  char *a;\n  struct shu book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n    scanf(\"%s\", book[i].author_name);\n  }\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      ere[(*a) - 'A']++;\n      a++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (ere[i] >= max) {\n      max = ere[i];\n      key = i;\n    }\n  }\n  cout << (key + 'A') << \"\\n\";\n  printf(\"%d\\n\", ere[key]);\n  for (i = 0; i < m; i++) {\n    a = book[i].author_name;\n    while (*a != '\\0') {\n      if ((key + 'A') == *a) {\n        cout << book[i].num << \"\\n\";\n        break;\n      }\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char auth[26];\n    int inf[26];\n    struct book *next;\n  };\n  struct book *head, *p1, *p2, *t1, *t2;\n  head = (struct book *)malloc(sizeof(struct book));\n\n  int m, i, k, l, j, max;\n  int authnum[26] = {0};\n  scanf(\"%d\", &m);\n  p1 = head;\n  p2 = p1;\n  for (i = 0; i < (m - 1); i++) {\n    scanf(\"%d %s\", &(p1->num), p1->auth);\n    p2 = (struct book *)malloc(sizeof(struct book));\n    p1->next = p2;\n    p1 = p2;\n  }\n  scanf(\"%d %s\", &(p1->num), p1->auth);\n  p2 = NULL;\n  p1->next = p2;\n\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    l = strlen(p1->auth);\n    for (j = 0; j < l; j++) {\n      p1->inf[(*((p1->auth) + j)) - 65] = 1;\n      authnum[(*((p1->auth) + j)) - 65]++;\n    }\n    p2 = p1->next;\n    p1 = p2;\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (authnum[i] > authnum[max])\n      max = i;\n  }\n  cout << (max + 65) << \"\\n\";\n  printf(\"%d\\n\", authnum[max]);\n\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    if ((p1->inf[max]) > 0)\n      printf(\"%d\\n\", p1->num);\n    p2 = p1->next;\n    p1 = p2;\n  }\n  p1 = head;\n  p2 = p1;\n  while (p1 != NULL) {\n    p2 = p1->next;\n    free(p1);\n    p1 = p2;\n  }\n}\n"}
{"label": "2", "index": "3489", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char book[1000][30];\n  int n, i, j, k, r, len[1000], a[26][1000] = {0}, b[26] = {0}, max, s, c[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n; i++) {\n\n    cin >> book[i];\n    scanf(\"\\n\");\n  }\n  for (i = 0; i <= n; i++)\n    for (j = 0; book[i][j] != ' '; j++)\n      len[i] = j;\n  for (k = 0; k < 26; k++) {\n    r = 0;\n    for (i = 0; i <= n; i++) {\n      for (j = len[i] + 1; j < strlen(book[i]); j++) {\n        if (book[i][j] == k + 65) {\n          b[k]++;\n          a[k][r] = i;\n          r++;\n        }\n      }\n    }\n    c[k] = r;\n  }\n  max = b[0];\n  for (i = 1; i < 26; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n      s = i;\n    }\n  }\n  printf(\"%c\\n\", s + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < c[s]; i++) {\n    for (j = 0; j <= len[a[s][i]]; j++)\n      printf(\"%c\", book[a[s][i]][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "2", "index": "3490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct lib {\n  int num;\n  char author[26];\n} book[1000];\nint main() {\n  int n, i, k, p, e;\n  e = 0;\n  int tol[1000] = {0};\n  int own[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> (book[i].num) >> book[i].author;\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (p = 0; p <= 25; p++) {\n        if (k == book[i].author[p]) {\n          tol[k]++;\n          own[k][i] = book[i].num;\n        }\n      }\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (tol[i] > e) {\n      e = tol[i];\n    }\n  }\n  for (k = 'A'; k <= 'Z'; k++) {\n    if (tol[k] == e) {\n      printf(\"%c\\n%d\\n\", k, tol[k]);\n      for (p = 0; p <= n - 1; p++) {\n        if (own[k][p] != 0) {\n          printf(\"%d\\n\", own[k][p]);\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int n;\n    char a[26];\n  };\n  struct book book[999];\n  int m, c[26] = {0}, k;\n  char w[26];\n  scanf(\"%d\", &m);\n  int i, j, max = 0, t;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, book[i].a);\n  for (i = 0; i < 26; i++)\n    w[i] = 'A' + i;\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++) {\n        if (book[j].a[k] == w[i])\n          c[i]++;\n      }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      t = i;\n      break;\n    }\n  }\n  cout << w[t] << \"\\n\" << c[t] << \"\\n\";\n  for (j = 0; j < m; j++)\n    for (k = 0; k < 26; k++) {\n      if (book[j].a[k] == w[t]) {\n        printf(\"%d\\n\", book[j].n);\n        break;\n      }\n    }\n}\n"}
{"label": "2", "index": "3492", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int no;\n  char auth[26];\n};\nint main() {\n  struct book *head, *BK;\n  int m, n, k, i, j, t, q, p, max;\n  int a[26] = {0};\n  scanf(\"%d\", &m);\n  BK = (struct book *)malloc(m * 1000);\n  head = BK;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &BK->no, &BK->auth);\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      k = BK->auth[j] - 'A';\n      a[k] = a[k] + 1;\n    }\n    BK = BK + 1;\n  }\n  max = a[0];\n  t = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n  q = t + 'A';\n  printf(\"%c %d \", q, max);\n  BK = head;\n  for (i = 0; i < m; i++) {\n    p = 0;\n    n = strlen(BK->auth);\n    for (j = 0; j < n; j++) {\n      if (BK->auth[j] == q) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1) {\n      printf(\"%d \", BK->no);\n    }\n    BK = BK + 1;\n  }\n}\n"}
{"label": "2", "index": "3493", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0;\n  char w;\n  cin >> m;\n  for (int i = 1; i <= m; i++) {\n    cin >> b;\n    book[i][26] = b;\n    cin.get();\n    while ((w = cin.get()) != '\\n') {\n      writer[w - 'A']++;\n      book[i][w - 'A'] = 1;\n    }\n  }\n  for (int i = 1; i < 26; i++)\n    if (writer[max] < writer[i])\n      max = i;\n  cout << (char)(max + 'A') << endl;\n  cout << writer[max] << endl;\n  for (int i = 1; i <= m; i++)\n    if (book[i][max])\n      cout << book[i][26] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  cin >> m;\n  int num[1001];\n\n  char name[1001][27];\n  for (int i = 0; i < m; ++i) {\n    scanf(\"%d \", &num[i]);\n    cin.get();\n    cin.getline(name[i], 27);\n  }\n  int count[100];\n  memset(count, 0, sizeof(count));\n  int record[27][1000];\n  int start = 0;\n  int i, j;\n  char call;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      count[name[i][j]]++;\n    }\n  }\n  int max = 0, k = 0;\n  char t;\n  for (char w = 'A'; w <= 'Z'; w++) {\n    if (count[(int)w] > max) {\n      max = count[(int)w];\n      t = w;\n    }\n  }\n  cout << t << endl;\n  cout << max << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] == t) {\n        cout << num[i] << endl;\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, max1, t, x[28] = {0}, n, i, j;\n  char cc, y[100][32], q;\n  cin >> n;\n  cin >> cc;\n  for (i = 1; i <= n; i++) {\n\n    cin >> y[i];\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] >= 'A' && y[i][j] <= 'Z') {\n        x[y[i][j] + 1 - 'A']++;\n      }\n    }\n  }\n  max = x[1];\n  max1 = 1;\n  for (i = 2; i <= 26; i++) {\n    if (x[i] > max) {\n      max = x[i];\n      max1 = i;\n    }\n  }\n  q = 'A' - 1 + max1;\n  printf(\"%c \", q);\n  printf(\"%d \", max);\n  for (i = 1; i <= n; i++) {\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] == q) {\n        for (t = 0; y[i][t]; t++) {\n          if (y[i][t] == ' ')\n            break;\n          else\n            printf(\"%c\", y[i][t]);\n        }\n        printf(\" \");\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct bookst {\n    int Num;\n    char name[26];\n  };\n  struct bookst *book;\n  int cnt[26], num, i, j, max = 0, max_idx = 0;\n  for (i = 0; i < 26; i++)\n    cnt[i] = 0;\n  scanf(\"%d\", &num);\n  book = (struct bookst *)malloc(num * sizeof(struct bookst));\n  for (i = 0; i < num; i++) {\n    scanf(\"%d%s\", &book[i].Num, book[i].name);\n    for (j = 0; book[i].name[j] != 0; j++)\n      cnt[book[i].name[j] - 'A']++;\n  }\n  for (i = 0; i < 26; i++) {\n    if (cnt[i] > max) {\n      max = cnt[i];\n      max_idx = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + max_idx, max);\n  for (i = 0; i < num; i++) {\n    for (j = 0; book[i].name[j] != 0; j++) {\n      if (book[i].name[j] == 'A' + max_idx) {\n        cout << book[i].Num << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3497", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct book {\n    int num;\n    char author[27];\n  } B[1000];\n  char A;\n  int m, i, j, a[26] = {0}, max;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> B[i].num >> B[i].author;\n\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      else\n        a[B[i].author[j] - 65]++;\n    }\n  }\n  max = a[0];\n  A = 65;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      A = i + 65;\n    }\n  }\n  printf(\"%c\\n%d\", A, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0;; j++) {\n      if (B[i].author[j] == 0)\n        break;\n      if (B[i].author[j] == A)\n        printf(\"\\n%d\", B[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, max = 0;\n  int Q[26] = {0};\n  struct {\n    int num;\n    char name[27];\n  } book[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      switch (book[i].name[j]) {\n      case 'A':\n        Q[0]++;\n        break;\n      case 'B':\n        Q[1]++;\n        break;\n      case 'C':\n        Q[2]++;\n        break;\n      case 'D':\n        Q[3]++;\n        break;\n      case 'E':\n        Q[4]++;\n        break;\n      case 'F':\n        Q[5]++;\n        break;\n      case 'G':\n        Q[6]++;\n        break;\n      case 'H':\n        Q[7]++;\n        break;\n      case 'I':\n        Q[8]++;\n        break;\n      case 'J':\n        Q[9]++;\n        break;\n      case 'K':\n        Q[10]++;\n        break;\n      case 'L':\n        Q[11]++;\n        break;\n      case 'M':\n        Q[12]++;\n        break;\n      case 'N':\n        Q[13]++;\n        break;\n      case 'O':\n        Q[14]++;\n        break;\n      case 'P':\n        Q[15]++;\n        break;\n      case 'Q':\n        Q[16]++;\n        break;\n      case 'R':\n        Q[17]++;\n        break;\n      case 'S':\n        Q[18]++;\n        break;\n      case 'T':\n        Q[19]++;\n        break;\n      case 'U':\n        Q[20]++;\n        break;\n      case 'V':\n        Q[21]++;\n        break;\n      case 'W':\n        Q[22]++;\n        break;\n      case 'X':\n        Q[23]++;\n        break;\n      case 'Y':\n        Q[24]++;\n        break;\n      case 'Z':\n        Q[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (Q[i] > Q[max])\n      max = i;\n  }\n  cout << max + 65 << \"\\n\" << Q[max] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      if (book[i].name[j] == max + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[1000], m[1000];\n  struct {\n    char b[26];\n  } p[1000];\n  int j, k;\n  scanf(\"%d\", &n);\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int num[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], p[i].b);\n    m[i] = strlen(p[i].b);\n    for (k = 0; k < 26; k++)\n      for (j = 0; j < m[i]; j++) {\n        if (p[i].b[j] == c[k])\n          num[k]++;\n      }\n  }\n  int max = 0, local = 0;\n  for (k = 0; k < 26; k++) {\n    if (num[k] > max) {\n      max = num[k];\n      local = k;\n    }\n  }\n  cout << c[local] << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (p[i].b[j] == c[local])\n        cout << a[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3500", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[26];\n} a[100];\nint main() {\n  int m, i, n, j, k, max, maxnum;\n  int aut1[26] = {0}, aut2[26][100] = {0};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i].id);\n\n    cin >> a[i].s;\n    n = strlen(a[i].s);\n    for (j = 0; j < n; j++) {\n      k = a[i].s[j] - 'A';\n      aut2[k][aut1[k]] = a[i].id;\n      aut1[k]++;\n    }\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (aut1[i] > max) {\n      max = aut1[i];\n      maxnum = i;\n    }\n  }\n  printf(\"%c \", 'A' + maxnum);\n  printf(\"%d \", max);\n  printf(\"%d\", aut2[maxnum][0]);\n  for (i = 1; i < max; i++) {\n    printf(\" %d\", aut2[maxnum][i]);\n  }\n}\n"}
{"label": "2", "index": "3501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char w[26];\n} b[999];\nint main() {\n  int m, i, j, k, e;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].w);\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int c[26] = {0};\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < m; i++) {\n      e = strlen(b[i].w);\n      for (k = 0; k < e; k++)\n        if (b[i].w[k] == a[j])\n          c[j]++;\n    }\n  }\n  int sum = 0;\n  for (j = 0; j < 26; j++)\n    if (c[j] > c[sum])\n      sum = j;\n  printf(\"%c\\n\", a[sum]);\n  cout << c[sum] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    e = strlen(b[i].w);\n    for (k = 0; k < e; k++)\n      if (b[i].w[k] == a[sum])\n        printf(\"%d\\n\", b[i].num);\n  }\n}\n"}
{"label": "2", "index": "3502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char name[27];\n  } b[1000];\n  int m, i, j, a = 0;\n  int c[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> b[i].num >> b[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++)\n      c[*(b[i].name + j) - 'A']++;\n  }\n  for (i = 0; i < 26; i++)\n    a = c[i] > c[a] ? i : a;\n  cout << a + 'A' << \"\\n\";\n  printf(\"%d\\n\", c[a]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (*(b[i].name + j) == ('A' + a))\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  char id[10];\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, k, n, num, max = 0;\n  char maxname;\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].id);\n    scanf(\"%s\", book[i].name);\n  }\n  for (i = 0; i < 26; i++) {\n    n = 0;\n    for (j = 0; j < num; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[j].name[k] == ('A' + i))\n          n += 1;\n      }\n    }\n    if (n > max) {\n      maxname = 'A' + i;\n      max = n;\n    }\n  }\n  cout << maxname << \"\\n\" << max << \"\\n\";\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < 26; k++) {\n      if (book[j].name[k] == maxname)\n        cout << book[j].id << \"\\n\";\n      ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int ISBN;\n  char name[26];\n} b[999];\nint main() {\n  int i, j, m, k[26], max = 0;\n  char a, d = 'A';\n  for (i = 0; i < 26; i++)\n    k[i] = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].ISBN, b[i].name);\n  for (a = 'A'; a <= 'Z'; a++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < 26; j++)\n        if (b[i].name[j] == a)\n          k[a - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (k[i] >= max)\n      max = k[i];\n  for (i = 0; i < 26; i++)\n    if (k[i] == max) {\n      d += i;\n      printf(\"%c\\n\", d);\n      printf(\"%d\\n\", max);\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (b[i].name[j] == d)\n        printf(\"%d\\n\", b[i].ISBN);\n  return 0;\n}\n"}
{"label": "2", "index": "3505", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book1 {\n    int num;\n    char author[20];\n  } book[999];\n  int time[26] = {0};\n  int n, i, j, k, maxi, sign = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].num, book[i].author);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == 'A' + k) {\n          time[k] += 1;\n          break;\n        }\n      }\n    }\n  }\n  maxi = 0;\n  for (i = 0; i < 26; i++) {\n    if (time[maxi] < time[i])\n      maxi = i;\n  }\n  printf(\"%c\\n%d\\n\", 'A' + maxi, time[maxi]);\n  for (i = 0; i < n && sign == 0; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        sign = 1;\n        break;\n      }\n    }\n  }\n  for (; i < n; i++) {\n    for (j = 0; book[i].author[j] != '\\0'; j++) {\n      if (book[i].author[j] == 'A' + maxi) {\n        printf(\"\\n%d\", book[i].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  char id[11];\n  char name[30];\n};\nstruct au {\n  int num;\n  char id[1000][11];\n};\nint main() {\n  struct book b;\n  struct au a[26];\n  int n, i, j = 0, k;\n  char c;\n  for (i = 0; i < 26; i++) {\n    a[i].num = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", b.id, b.name);\n    while (b.name[j] != '\\0') {\n      k = b.name[j] - 'A';\n      strcpy(a[k].id[a[k].num], b.id);\n      a[k].num++;\n      j++;\n    }\n    j = 0;\n  }\n  k = 0;\n  j = 0;\n  for (i = 0; i < 26; i++) {\n    j = (a[i].num > k) ? i : j;\n    k = (a[i].num > k) ? a[i].num : k;\n  }\n  cout << 'A' + j << \"\\n\";\n  printf(\"%d\\n\", k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[j].id[i]);\n}\n"}
{"label": "2", "index": "3507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char wri[27];\n  struct inf *next;\n};\n\nint main() {\n  int n, i, time[26] = {0};\n\n  char *pn;\n  struct inf *head, *p1, *p0, *p;\n  scanf(\"%d\", &n);\n  p1 = head = (struct inf *)malloc(sizeof(struct inf));\n  for (i = 0; i < n; i++) {\n    p0 = (struct inf *)malloc(sizeof(struct inf));\n    scanf(\"%d%s\", &p0->num, p0->wri);\n    p0->next = NULL;\n    p1->next = p0;\n    p1 = p0;\n    pn = p0->wri;\n    while (*pn != '\\0') {\n      time[*pn - 65]++;\n      pn = pn + 1;\n    }\n  }\n\n  int max = 0, k;\n  for (i = 0; i < 26; i++) {\n    if (time[i] > max) {\n      max = time[i];\n      k = i;\n    }\n  }\n  cout << k + 65 << \"\\n\" << max << \"\\n\";\n  p = head;\n  while (p != NULL) {\n\n    pn = p->wri;\n    while (*pn != '\\0') {\n      if (*pn == k + 65) {\n        printf(\"%d\\n\", p->num);\n        break;\n      }\n      pn = pn + 1;\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint m;\nstruct book *head;\n\nstruct book *setup() {\n  int t = 0;\n  struct book *head, *p1, *p2;\n  head = p1 = p2 = (struct book *)malloc(sizeof(struct book));\n  cin >> p1->num >> p1->name;\n  while (t < m - 1) {\n    t++;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->name);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nint k = 0, max_1 = 0;\nvoid found(struct book *p) {\n  int i, j;\n  p = head;\n  int *pi;\n  pi = (int *)malloc(sizeof(int) * 26);\n  for (i = 0; i < 26; i++)\n    *(pi + i) = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      (*(pi + (p->name[j] - 'A')))++;\n\n    p = p->next;\n  }\n  for (j = 0; j < 26; j++) {\n    if (*(pi + j) > max_1) {\n      max_1 = *(pi + j);\n      k = j;\n    }\n  }\n}\nint main() {\n  int i, j;\n  cin >> m;\n  struct book *p;\n  head = p = setup();\n  found(p);\n  printf(\"%c %d \", (k + 'A'), max_1);\n  p = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; p->name[j] != '\u0000'; j++)\n      if (p->name[j] == k + 'A') {\n        printf(\"%d \", p->num);\n        break;\n      }\n    p = p->next;\n  }\n}\n"}
{"label": "2", "index": "3509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char wr[26];\n};\nint main() {\n  int n, b[91][1000], max = 0, i, j, k, s, m, writer;\n  struct book bk[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &bk[i].num, bk[i].wr);\n  }\n  for (i = 0; i < 26; i++) {\n    s = 0;\n    for (j = 0; j < n; j++) {\n      m = strlen(bk[j].wr);\n      for (k = 0; k < m; k++) {\n        if (bk[j].wr[k] == i + 65) {\n          b[i][s] = bk[j].num;\n          s++;\n          k = m;\n        }\n      }\n    }\n    if (s > max) {\n      max = s;\n      writer = i;\n    }\n  }\n  printf(\"%c\\n%d\", writer + 65, max);\n  for (i = 0; i < max; i++)\n    cout << \"\\n\" << b[writer][i];\n  return 0;\n}\n"}
{"label": "2", "index": "3510", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, name[26] = {0}, max, a[1000], t = 0;\n  char word[1000][30];\n  scanf(\"%d\", &n);\n  for (i = -1; i < n; i++) {\n\n    cin >> word[i];\n  }\n  for (j = 0; j < 26; j++) {\n    for (i = 0; i < n; i++) {\n      while (word[i][k] != '\u0000') {\n        if (word[i][k] == 'A' + j) {\n          name[j] = name[j] + 1;\n        }\n        k = k + 1;\n      }\n      k = 0;\n    }\n  }\n  k = 0;\n  max = name[0];\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (name[i] > max) {\n      max = name[i];\n      j = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (word[i][k] != '\u0000') {\n      if (word[i][k] == 'A' + j) {\n\n        a[t] = i;\n        t = t + 1;\n        k = 0;\n        break;\n      }\n      k = k + 1;\n    }\n    k = 0;\n  }\n  printf(\"%c %d \", 'A' + j, max);\n  k = 0;\n  for (i = 0; i < t; i++) {\n    while (word[a[i]][k] != ' ') {\n      printf(\"%c\", word[a[i]][k]);\n      k = k + 1;\n    }\n    printf(\" \");\n    k = 0;\n  }\n}\n"}
{"label": "2", "index": "3511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int max, max2;\n  int a[26];\n  struct book {\n    int number;\n    char author[26];\n  } stu1[1000];\n  struct author {\n    int number[1000];\n    int ben;\n  } stu2[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d %s\", &stu1[i].number, stu1[i].author);\n  for (i = 0; i <= 25; i++) {\n    stu2[i].ben = 0;\n    a[i] = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= strlen(stu1[i].author) - 1; j++) {\n      k = stu1[i].author[j];\n      stu2[k - 65].ben++;\n      stu2[k - 65].number[a[k - 65]] = stu1[i].number;\n      a[k - 65]++;\n    }\n  }\n  max = stu2[0].ben;\n  max2 = 0;\n  for (i = 1; i <= 25; i++) {\n    if (stu2[i].ben > max) {\n      max = stu2[i].ben;\n      max2 = i;\n    }\n  }\n  printf(\"%c\\n\", max2 + 65);\n  cout << max << \"\\n\";\n  for (j = 0; j <= a[max2] - 1; j++)\n    printf(\"%d\\n\", stu2[max2].number[j]);\n  return 0;\n}\n"}
{"label": "2", "index": "3512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, max1, t, k, x[28] = {0}, n, a, b, c, d, i, j;\n  char cc, y[100][32], q;\n  scanf(\"%d\", &n);\n  scanf(\"%c\", &cc);\n  for (i = 1; i <= n; i++) {\n\n    cin >> y[i];\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] >= 'A' && y[i][j] <= 'Z') {\n        x[y[i][j] + 1 - 'A']++;\n      }\n    }\n  }\n  max = x[1];\n  max1 = 1;\n  for (i = 2; i <= 26; i++) {\n    if (x[i] > max) {\n      max = x[i];\n      max1 = i;\n    }\n  }\n  q = 'A' - 1 + max1;\n  printf(\"%c \", q);\n  printf(\"%d \", max);\n  for (i = 1; i <= n; i++) {\n    for (j = 2; y[i][j]; j++) {\n      if (y[i][j] == q) {\n        for (t = 0; y[i][t]; t++) {\n          if (y[i][t] == ' ')\n            break;\n          else\n            printf(\"%c\", y[i][t]);\n        }\n        printf(\" \");\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3513", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[999][3][27];\n  int m, i, j, k, Nn[27], ctrl;\n  \n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    scanf(\"%s\", s[k][1]);\n    scanf(\"%s\", s[k][2]);\n  }\n  \n  for (i = 1; i <= 26; i++)\n    Nn[i] = 0;\n  for (i = 1; i <= m; i++) {\n    for (j = 0; s[i][2][j] != '\\0'; j++) {\n      if (s[i][2][j] == 'A')\n        Nn[1]++;\n      else if (s[i][2][j] == 'B')\n        Nn[2]++;\n      else if (s[i][2][j] == 'C')\n        Nn[3]++;\n      else if (s[i][2][j] == 'D')\n        Nn[4]++;\n      else if (s[i][2][j] == 'E')\n        Nn[5]++;\n\n      else if (s[i][2][j] == 'F')\n        Nn[6]++;\n      else if (s[i][2][j] == 'G')\n        Nn[7]++;\n      else if (s[i][2][j] == 'H')\n        Nn[8]++;\n      else if (s[i][2][j] == 'I')\n        Nn[9]++;\n\n      else if (s[i][2][j] == 'J')\n        Nn[10]++;\n      else if (s[i][2][j] == 'K')\n        Nn[11]++;\n      else if (s[i][2][j] == 'L')\n        Nn[12]++;\n      else if (s[i][2][j] == 'M')\n        Nn[13]++;\n\n      else if (s[i][2][j] == 'N')\n        Nn[14]++;\n      else if (s[i][2][j] == 'O')\n        Nn[15]++;\n      else if (s[i][2][j] == 'P')\n        Nn[16]++;\n      else if (s[i][2][j] == 'Q')\n        Nn[17]++;\n\n      else if (s[i][2][j] == 'R')\n        Nn[18]++;\n      else if (s[i][2][j] == 'S')\n        Nn[19]++;\n\n      else if (s[i][2][j] == 'T')\n        Nn[20]++;\n      else if (s[i][2][j] == 'U')\n        Nn[21]++;\n      else if (s[i][2][j] == 'V')\n        Nn[22]++;\n      else if (s[i][2][j] == 'W')\n        Nn[23]++;\n\n      else if (s[i][2][j] == 'X')\n        Nn[24]++;\n\n      else if (s[i][2][j] == 'Y')\n        Nn[25]++;\n      else if (s[i][2][j] == 'Z')\n        Nn[26]++;\n    }\n  }\n   int Nmax = 0, zimuxu;\n  for (i = 1; i <= 26; i++) {\n    if (Nn[i] > Nmax) {\n      Nmax = Nn[i];\n      zimuxu = i;\n    }\n  }\n  \n  printf(\"%c\\n\", 'A' + zimuxu - 1);\n  printf(\"%d\\n\", Nmax);\n  \n  for (j = 1; j <= m; j++) {\n    ctrl = 0;\n    for (k = 0; s[j][2][k] != '\\0'; k++) {\n      if (s[j][2][k] == 'A' + zimuxu - 1)\n        ctrl++;\n    }\n    if (ctrl != 0)\n      printf(\"%s\\n\", s[j][1]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int id;\n  char s[1000];\n  int len;\n} b[1000];\nvoid fun(int count[1000], char s[1000], int len) {\n  int i;\n  for (i = 0; i < len; i++) {\n    int m;\n    m = s[i] - 'A';\n    count[m]++;\n  }\n}\nint judge(char s[1000], int len, char name) {\n  int i, answer = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == name) {\n      answer = 1;\n      break;\n    }\n  }\n  return answer;\n}\n\nint main() {\n  int m, k, count[1000] = {0}, i, j, max, num;\n  char name;\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    scanf(\"%d%s\", &b[k].id, b[k].s);\n    b[k].len = strlen(b[k].s);\n    fun(count, b[k].s, b[k].len);\n  }\n  max = count[0];\n  num = 0;\n  for (j = 1; j < 1000; j++) {\n    if (count[j] > max) {\n      max = count[j];\n      num = j;\n    }\n  }\n  name = num + 65;\n  printf(\"%c \", name);\n  printf(\"%d \", max);\n  for (k = 0; k < m; k++) {\n    int answer = 0;\n    answer = judge(b[k].s, b[k].len, name);\n    if (answer == 1)\n      printf(\"%d \", b[k].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len[1000];\n  int b[26];\n  int a[1000];\n  char str[1000][26];\n  int m, i, j, max, num;\n  char c;\n  int pos, temp;\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n    scanf(\"%s\", str[i]);\n    len[i] = strlen(str[i]);\n    for (j = 0; j < len[i]; j++) {\n      temp = str[i][j] - 'A';\n      b[temp]++;\n    }\n  }\n  max = b[0];\n  pos = 0;\n  for (i = 1; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      pos = i;\n    }\n  }\n  c = pos + 'A';\n  printf(\"%c\\n\", c);\n  cout << max << \"\\n\";\n  num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++) {\n      if (str[i][j] == c) {\n        num++;\n        if (num < max)\n          printf(\"%d\\n\", a[i]);\n        else\n          printf(\"%d\", a[i]);\n      }\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct information {\n  int num;\n  char author[26];\n} * a;\nint main() {\n  int n, i, j, m, s[26] = {0}, max = 0, p;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &a[i].num, a[i].author);\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      m = a[i].author[j] - 'A';\n      s[m]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < s[i]) {\n      max = s[i];\n      p = i;\n    }\n  }\n  cout << 'A' + p << \"\\n\" << s[p] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i].author[j] == 'A' + p) {\n        printf(\"%d\\n\", a[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3517", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct book {\n  int num;\n  char peo[26];\n} book[999];\n\nint main() {\n  char zm, max;\n  int n, i, k, num, cishu = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].peo);\n  }\n  for (zm = 'A'; zm <= 'Z'; zm++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].peo[k] == zm)\n          num++;\n      }\n    }\n    if (num > cishu) {\n      cishu = num;\n      max = zm;\n    }\n  }\n  printf(\"%c\\n\", max);\n  printf(\"%d\\n\", cishu);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 26; k++) {\n      if (book[i].peo[k] == max)\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, s[26][1000], m, i, j, author, max = 0;\n  char b[1000][28];\n  for (i = 0; i < 26; i++)\n    s[i][0] = 0;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a);\n    cin >> b[a];\n    for (j = 0; b[a][j] != '\\0'; j++) {\n      s[b[a][j] - 'A'][0]++;\n      s[b[a][j] - 'A'][s[b[a][j] - 'A'][0]] = a;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (s[i][0] > max) {\n      max = s[i][0];\n      author = i;\n    }\n  }\n  cout << (char)(author + 'A') << \"\\n\" << max << \"\\n\";\n  for (j = 1; j <= max; j++)\n    cout << s[author][j] << endl;\n  return 0;\n}\n"}
{"label": "2", "index": "3519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct cs {\n  int b;\n  char a[26];\n};\nint main() {\n  int m, i, j, k, max = 0;\n  int c[200][1000], count[200] = {0};\n  struct cs x[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> x[i].b;\n\n    cin >> x[i].a;\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(x[i].a); j++) {\n      for (k = 65; k < 91; k++) {\n        if (x[i].a[j] == k) {\n          count[k]++;\n          c[k][count[k]] = x[i].b;\n        }\n      }\n    }\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] > max)\n      max = count[k];\n  }\n  for (k = 65; k < 91; k++) {\n    if (count[k] == max) {\n      printf(\"%c %d \", k, count[k]);\n      for (j = 1; j <= max; j++) {\n        cout << c[k][j] << \" \";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int id;\n  char aut[26];\n};\n\nint main() {\n  int m, n, i, j, k;\n  int a[27] = {0};\n  struct book cal[1001];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &cal[i].id, cal[i].aut);\n  }\n  for (j = 65; j < 91; j++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < 27; k++) {\n        if (cal[i].aut[k] == j)\n          a[j - 65]++;\n      }\n    }\n  }\n  int max = 0, t;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      t = i;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", t + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (cal[i].aut[j] == t + 65)\n        printf(\"%d\\n\", cal[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int num;\n    char w[27];\n  };\n  struct book b[1000];\n  int n, i, j, k, c[26] = {0}, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &b[i].num, b[i].w);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < strlen(b[j].w); k++) {\n        if (i == b[j].w[k]) {\n          c[i - 65]++;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[max])\n      max = i;\n  }\n  printf(\"%c\\n\", max + 65);\n  printf(\"%d\\n\", c[max]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(b[i].w); j++) {\n      if (b[i].w[j] == max + 65) {\n        printf(\"%d\\n\", b[i].num);\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3522", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char number[100];\n  char name[100];\n  struct student *next;\n};\nint n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %s\", &p1->number, &p1->name);\n  head = NULL;\n  do {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %s\", &p1->number, &p1->name);\n  } while (i < n - 1);\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int h, i, k, m, j, max;\n  struct student *head;\n  struct student *p;\n  int sum[10000] = {0};\n  scanf(\"%d\", &n);\n  head = creat(); \n  p = head;\n  for (i = 65, k = 0; i <= 90; i++, k++) \n  {\n    p = head;\n    do {\n      m = strlen(p->name);\n      for (j = 0; j < m; j++) {\n        if (p->name[j] == i)\n          sum[k]++;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  for (i = 0, max = sum[0]; i <= k; i++) {\n    if (sum[i] >= max) {\n      h = i;\n      max = sum[i];\n    } \n  }\n  printf(\"%c %d \", h + 65, max); \n  p = head;\n  do {\n    m = strlen(p->name);\n    for (j = 0; j < m; j++) {\n      if (p->name[j] == h + 65)\n        printf(\"%s \", p->number);\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n\n"}
{"label": "2", "index": "3523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[27], max = 0;\n  int i, j, n, k, t, len = 0;\n  char str[100][27];\n  scanf(\"%d\", &n);\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i][1]);\n    scanf(\"%s\", str[i]);\n    len = strlen(str[i]);\n    for (j = 0; j < len; j++) {\n      k = str[i][j] - 'A';\n      b[k]++;\n      a[i][k + 65] = 1;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", t + 'A', max);\n  for (i = 1; i <= n; i++) {\n    if (a[i][t + 'A'] == 1) {\n      printf(\"%d\\n\", a[i][1]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3524", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct Book {\n    int id;\n    char zz[26];\n  } book[1000];\n\n  int n, i, j, max = 0, index;\n  int sum[26] = {0};\n  char author;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].id >> book[i].zz;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      sum[book[i].zz[j] - 'A']++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      author = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author, max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].zz[j] != '\\0'; j++) {\n      if (book[i].zz[j] == author) {\n        printf(\"%d\\n\", book[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct book {\n  int num;\n  char edt[27];\n};\nstruct total {\n  char name;\n  int amount;\n};\nint main() {\n  int m, i, j, k;\n  struct book bk[1000];\n  struct total to[27];\n  cin >> m;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &bk[i].num, bk[i].edt);\n  for (i = 0; i < 26; i++) {\n    to[i].name = 'A' + i;\n    to[i].amount = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++) {\n      for (k = 0; k < 26; k++) {\n        if (bk[i].edt[j] == to[k].name)\n          to[k].amount++;\n      }\n    }\n  }\n\n  for (i = k = 0; i < 26; i++) {\n    if (to[i].amount > to[k].amount)\n      k = i;\n  }\n  printf(\"%c\\n%d\\n\", to[k].name, to[k].amount);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++)\n      if (bk[i].edt[j] == to[k].name)\n        printf(\"%d\\n\", bk[i].num);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n\n  struct book {\n    int num;\n    char name[26];\n  } book[999];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\\n\", &book[i].num, book[i].name);\n  }\n\n  struct author {\n    char l;\n    int count;\n  } au[26];\n\n  for (i = 0; i < 26; i++) {\n    au[i].l = 65 + i;\n    au[i].count = 0;\n  }\n\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (au[i].l == book[j].name[k]) {\n          au[i].count++;\n          break;\n        }\n      }\n    }\n  }\n\n  int max = 0;\n  for (i = 1; i < 26; i++) {\n    if (au[max].count < au[i].count)\n      max = i;\n  }\n  printf(\"%c\\n%d\\n\", au[max].l, au[max].count);\n\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (au[max].l == book[j].name[k]) {\n        printf(\"%d\\n\", book[j].num);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3527", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, l, x, maxnumber;\n  scanf(\"%d\", &n);\n  int a[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> k[i];\n    int m;\n    m = strlen(k[i]);\n    for (l = 0; l < 30; l++) {\n      for (x = 1; x <= 26; x++) {\n        if (k[i][l] == x + 64)\n          author[x]++;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max)\n      max = author[i];\n  }\n  for (i = 1; i <= 26; i++) {\n    if (author[i] == max)\n      maxnumber = i;\n  }\n  char who[10];\n  who[0] = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who[0]);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= n; i++) {\n    for (l = 0; l <= strlen(k[i]); l++)\n      if (k[i][l] == who[0])\n        printf(\"%d\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, x, maxnumber;\n  scanf(\"%d\", &m);\n  int booknum[1000];\n  char k[1000][30];\n  int author[27] = {0};\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &booknum[i], k[i]);\n    for (j = 0; k[i][j] != '\\0'; j++) {\n      author[k[i][j] - 'A' + 1]++;\n    }\n  }\n  int max = 0;\n  for (i = 1; i <= 26; i++) {\n    if (author[i] > max) {\n      max = author[i];\n      maxnumber = i;\n    }\n  }\n  char who;\n  who = 'A' + maxnumber - 1;\n  printf(\"%c\\n\", who);\n  printf(\"%d\\n\", max);\n  for (i = 1; i <= m; i++) {\n    for (j = 0; j < strlen(k[i]); j++)\n      if (k[i][j] == who)\n        printf(\"%d\\n\", booknum[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char name[27];\n} book[1000];\n\nint main(int argc, char *argv[]) {\n  int m, i, j, a[27], len, max = 0, number;\n  char p;\n  for (i = 1; i <= 26; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &m);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].name);\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      p = book[i].name[j];\n      a[p - 64] += 1;\n    }\n  }\n  for (i = 1; i <= 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      number = i;\n    }\n  }\n  cout << number + 64 << \"\\n\" << a[number] << \"\\n\";\n  for (i = 1; i <= m; i++) {\n    len = strlen(book[i].name);\n    for (j = 0; j <= len - 1; j++) {\n      if (book[i].name[j] == number + 64) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct aut {\n  char name;\n  int num;\n  int id[1000];\n};\n\nstruct aut author[26];\n\nint main() {\n  int m, i, j, ID, max = 0, maxauthor, k[26] = {0};\n  char c[27];\n  cin >> m;\n  for (i = 0; i < 26; i++) {\n    author[i].name = 'A' + i;\n    author[i].num = 0;\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &ID, c);\n    for (j = 0; c[j]; j++) {\n      author[c[j] - 'A'].id[k[c[j] - 'A']] = ID;\n      k[c[j] - 'A']++;\n      author[c[j] - 'A'].num++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (author[i].num > max) {\n      max = author[i].num;\n      maxauthor = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", author[maxauthor].name, author[maxauthor].num);\n  for (i = 0; i < author[maxauthor].num; i++)\n    cout << author[maxauthor].id[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "2", "index": "3531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct x {\n    int num;\n    char name[26];\n  } book[1000];\n  int i, j, m, n, k, ex;\n  int a[26][1000];\n  int count[26] = {0},\n      num[26] = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n                 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      ex = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = ex;\n      ex = num[i];\n      num[i] = num[i + 1];\n      num[i + 1] = ex;\n    }\n  }\n  printf(\"%c %d \", num[25], count[25]);\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == num[25])\n        cout << book[i].num << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int no;\n  char wri[27];\n} book[1000];\n\nint main() {\n  int n, i, j, k = 0, a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> book[i].no >> book[i].wri;\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      a[book[i].wri[j] - 'A']++;\n  for (i = 0; i < 26; i++)\n    if (a[i] > a[0]) {\n      a[0] = a[i];\n      k = i;\n    }\n  printf(\"%c\\n%d\\n\", 'A' + k, a[0]);\n  for (i = 0; i < n; i++)\n    for (j = 0; book[i].wri[j] != '\\0'; j++)\n      if (book[i].wri[j] == 'A' + k) {\n        cout << book[i].no << \"\\n\";\n        break;\n      }\n}\n"}
{"label": "2", "index": "3533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid function(int, int);\n\nint main() {\n  char s[200][100];\n  int n[100], h[100], maxh[100];\n  int a;\n  int i, j, k, p;\n  int num, maxnum = 0;\n  char c;\n\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%s\", &n[i], s[i]);\n  }\n\n  for (j = 'A'; j <= 'Z'; j++) {\n    num = 0;\n    for (i = 0; i < a; i++) {\n      for (k = 0; k < strlen(s[i]); k++) {\n        if (s[i][k] == j) {\n          num++;\n          h[num] = n[i];\n        }\n      }\n    }\n    if (num > maxnum) {\n      c = j;\n      maxnum = num;\n      for (p = 1; p <= maxnum; p++) {\n        maxh[p] = h[p];\n      }\n    }\n  }\n\n  cout << c << \"\\n\" << maxnum << \"\\n\";\n  for (p = 1; p <= maxnum; p++) {\n    cout << maxh[p] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int ISBN;\n  char name[26];\n} b[999];\nint main() {\n  int i, j, m, k[26], max = 0;\n  char a, d = 'A';\n  for (i = 0; i < 26; i++)\n    k[i] = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d%s\", &b[i].ISBN, b[i].name);\n  for (a = 'A'; a <= 'Z'; a++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < 26; j++) {\n        if (b[i].name[j] == a)\n          k[a - 'A']++;\n      }\n  for (i = 0; i < 26; i++)\n    if (k[i] >= max)\n      max = k[i];\n  for (i = 0; i < 26; i++)\n    if (k[i] == max) {\n      d += i;\n      printf(\"%c\\n\", d);\n      printf(\"%d\\n\", max);\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (b[i].name[j] == d)\n        printf(\"%d\\n\", b[i].ISBN);\n  return 0;\n}\n"}
{"label": "2", "index": "3535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int No;\n    char author[27];\n    int yes;\n    struct book *next;\n  };\n  struct book *head, *p;\n  int m, i, *max;\n  int *count;\n  count = (int *)malloc(26 * sizeof(int));\n  for (i = 0; i < 26; i++)\n    *(count + i) = 0;\n\n  p = (struct book *)malloc(sizeof(struct book));\n  head = p;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%s\", &p->No, p->author);\n    if (i == m - 1)\n      p->next = NULL;\n    else\n      p->next = (struct book *)malloc(sizeof(struct book));\n    p = p->next;\n  }\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      (*(count + ((*point) - 65)))++;\n      point++;\n    }\n    p = p->next;\n  }\n\n  max = count;\n  for (i = 0; i < 26; i++)\n    if (*(count + i) > *max)\n      max = count + i;\n  printf(\"%c\\n\", max - count + 65);\n  cout << *max << \"\\n\";\n\n  p = head;\n  while (p != NULL) {\n    char *point;\n    point = p->author;\n    while (*point != '\\0') {\n      if (*point == max - count + 65)\n        printf(\"%d\\n\", p->No);\n      point++;\n    }\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct sa {\n  int a;\n  char b[100];\n  struct sa *next;\n};\nint n, m, k[27];\nstruct sa *kao(void) {\n  struct sa *head;\n  struct sa *p1, *p2;\n  n = 0;\n  head = NULL;\n  p1 = p2 = (struct sa *)malloc(1000);\n  cin >> p1->a >> p1->b;\n  head = p1;\n  for (;;) {\n    n++;\n    if (n == m + 1)\n      break;\n    if (n == 1)\n      head = p1;\n    else {\n      p2 = p1;\n      p1 = (struct sa *)malloc(1000);\n      scanf(\"%d %s\", &p1->a, p1->b);\n      p2->next = p1;\n    }\n  }\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  struct sa *p, *q, *head, *ped;\n  int f, i, g, s = 1, t, d = 0;\n  char c;\n  scanf(\"%d\", &m);\n  head = kao();\n  for (p = head; p != NULL; p = p->next) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      k[p->b[i] - 64]++;\n    }\n  }\n  t = k[1];\n  for (i = 2; i < 27; i++) {\n    if (k[i] > k[s]) {\n      s = i;\n      t = k[i];\n    }\n  }\n  printf(\"%c %d \", s + 64, t);\n  for (p = head; p != NULL;) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      if (p->b[i] == s + 64) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      cout << p->a << \" \";\n    d = 0;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, d[1000];\n  char zuo[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  char s[1000][26], len;\n  int sum[26] = {0}, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &d[i], s[i]);\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (s[i][j] == 'A' + k)\n          sum[k]++;\n      }\n    }\n  }\n  int max = 0, count = 0;\n  char maxid;\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      maxid = i + 'A';\n    }\n  }\n  cout << maxid << \"\\n\" << max << \"\\n\";\n  int t[1000];\n  for (i = 0; i < n; i++) {\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      if (s[i][j] == maxid) {\n        count++;\n        t[count] = d[i];\n      }\n    }\n  }\n  for (i = 1; i <= count; i++)\n    cout << t[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3538", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char name[26];\n  } b[1000];\n\n  int m, i, j, n[26] = {0}, max = 0, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &b[i].num, b[i].name);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      ++n[b[i].name[j] - 65];\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (n[i] > max) {\n      max = n[i];\n      t = i + 65;\n    }\n  }\n  printf(\"%c \", t);\n  printf(\"%d \", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(b[i].name); j++) {\n      if (b[i].name[j] == t)\n        printf(\"%d \", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3539", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num1;\n  char au[27];\n} bk[1000];\nstruct author {\n  char name;\n  int a;\n  int num2[1000];\n} aur[27];\nint main() {\n  int n, i, j;\n  struct author max;\n  max.a = 0;\n\n  for (j = 0; j < 26; j++) {\n    aur[j].name = 65 + j;\n    aur[j].a = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bk[i].num1 >> bk[i].au;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; bk[i].au[j] != '\\0'; j++) {\n      aur[bk[i].au[j] - 65].num2[aur[bk[i].au[j] - 65].a] = bk[i].num1;\n      aur[bk[i].au[j] - 65].a++;\n    }\n  }\n\n  for (i = 0; i < 26; i++) {\n    if (aur[i].a > max.a)\n      max = aur[i];\n  }\n  printf(\"%c\\n%d\\n\", max.name, max.a);\n  for (i = 0; i < max.a; i++) {\n    printf(\"%d\\n\", max.num2[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct chain {\n  int num;\n  char name[27];\n  struct chain *next;\n};\nint main() {\n  int a[26] = {0}, m, i, j, k, max = 0, n;\n  struct chain *p1, *p2, *head;\n  cin >> m;\n  p2 = head = (struct chain *)malloc(1000);\n  for (k = 0; k < 27; k++)\n    head->name[k] = 0;\n  scanf(\"%d%s\", &head->num, &head->name);\n  for (k = 0; k < strlen(head->name); k++) {\n    if (head->name[k] >= 65 && head->name[k] <= 90)\n      a[head->name[k] - 65]++;\n  }\n  for (j = 0; j < m - 1; j++) {\n    p1 = (struct chain *)malloc(1000);\n    p2->next = p1;\n    for (k = 0; k < 27; k++)\n      p1->name[k] = 0;\n    scanf(\"%d%s\", &p1->num, &p1->name);\n    p2 = p1;\n    for (k = 0; k < strlen(p1->name); k++) {\n      if (p1->name[k] >= 65 && p1->name[k] <= 90)\n        a[p1->name[k] - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < a[i]) {\n      max = a[i];\n      n = i;\n    }\n  }\n  printf(\"%c %d \", n + 65, max);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (p1->name[j] == (n + 65)) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  char s[100];\n  struct student *next;\n};\nint main() {\n  struct student *p1, *p2, *head;\n  int n, i, j, k, m, a[100];\n  char c[100], nam[100][100];\n  for (i = 0; i < 26; i++) {\n    c[i] = i + 65;\n    a[i] = 0;\n  } \n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->s);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->s);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  i = 0;\n  while (p1 != NULL) {\n    strcpy(nam[i], p1->s);\n    i++;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (k = 0; k < n; k++) {\n    printf(\n        \"%s\",\n        nam[k]); \n    for (i = 0; i < 26; i++) {\n      for (j = 0; nam[k][j] != '\\00'; j++)\n        if (nam[k][j] == c[i])\n          a[i]++;\n    }\n  }\n  k = a[0];\n  for (i = 0; i < 26; i++) {\n    if (a[i] > k)\n      k = a[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (a[i] == k) {\n      printf(\"%c %d\", c[i], a[i]);\n      m = i;\n      break;\n    }\n  }\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    for (j = 0; nam[i][j] != '\\00'; j++) {\n      if (nam[i][j] == c[m])\n        printf(\" %d\", p1->num);\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int code;\n  char writer[10];\n};\nint main() {\n  int n, i, j, t = 0, d, ww[27] = {0};\n  char max, w[27];\n  struct book list[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 26; i++)\n    w[i] = i + 65;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &list[i].code, list[i].writer);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n      for (d = 0; d < 26; d++)\n        if (list[i].writer[j] == w[d])\n          ww[d]++;\n    }\n  max = ww[0];\n  for (i = 0; i < 26; i++)\n    if (ww[i] > max) {\n      max = ww[i];\n      t = i;\n    }\n  printf(\"%c\\n%d\\n\", w[t], ww[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; list[i].writer[j] != '\\0'; j++) {\n\n      if (list[i].writer[j] == w[t])\n        printf(\"%d\\n\", list[i].code);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max = 0, seq = 0;\n  int a[26] = {0};\n\n  cin >> n;\n  struct book {\n    int num;\n    char str[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    cin >> book[i].num >> book[i].str;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      a[(book[i].str[j] - 65)]++;\n  }\n\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      seq = i;\n    }\n\n  cout << seq + 65 << \"\\n\";\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      if (book[i].str[j] == seq + 65) {\n        printf(\"%d\\n\", book[i].num);\n        break;\n      }\n  }\n}\n"}
{"label": "2", "index": "3544", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[1000], len[1000], num1[1000][26] = {0}, sum[26] = {0},\n                                        max = 0, m;\n  char writer[1000][26],\n      letter[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &num[i], writer[i]);\n    len[i] = strlen(writer[i]);\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < len[j]; k++) {\n        if (writer[j][k] == letter[i])\n          num1[j][i]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < n; j++)\n      sum[i] = sum[i] + num1[j][i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      m = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", letter[m], sum[m]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (writer[i][j] == letter[m]) {\n        printf(\"%d\\n\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct sa {\n  int a;\n  char b[100];\n  struct sa *next;\n};\nint n, m, k[27];\nstruct sa *kao(void) {\n  struct sa *head;\n  struct sa *p1, *p2;\n  n = 0;\n  head = NULL;\n  p1 = p2 = (struct sa *)malloc(1000);\n  scanf(\"%d %s\", &p1->a, p1->b);\n  head = p1;\n  for (;;) {\n    n++;\n    if (n == m + 1)\n      break;\n    if (n == 1)\n      head = p1;\n    else {\n      p2 = p1;\n      p1 = (struct sa *)malloc(1000);\n      scanf(\"%d %s\", &p1->a, p1->b);\n      p2->next = p1;\n    }\n  }\n  p1->next = NULL;\n  return (head);\n}\nint main() {\n  struct sa *p, *q, *head, *ped;\n  int f, i, g, s = 1, t, d = 0;\n  char c;\n  scanf(\"%d\", &m);\n  head = kao();\n  for (p = head; p != NULL; p = p->next) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      k[p->b[i] - 64]++;\n    }\n  }\n  t = k[1];\n  for (i = 2; i < 27; i++) {\n    if (k[i] > k[s]) {\n      s = i;\n      t = k[i];\n    }\n  }\n  cout << s + 64 << \" \" << t << \" \";\n  for (p = head; p != NULL;) {\n    g = strlen(p->b);\n    for (i = 0; i < g; i++) {\n      if (p->b[i] == s + 64) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      printf(\"%d \", p->a);\n    d = 0;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char zz[32];\n  struct book *next;\n};\nstruct book *creat(int n) {\n  struct book *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct book *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->zz);\n  head = NULL;\n  for (i = 0; i < n - 1; i++) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(1000);\n    cin >> p1->num >> p1->zz;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid search(struct book *head, int n) {\n  int *p[26], i, j;\n  struct book *q = head;\n  for (i = 0; i < 26; i++) {\n    p[i] = (int *)malloc(sizeof(int));\n    *p[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      (*p[(q->zz)[j] - 'A'])++;\n    }\n    q = q->next;\n  }\n  q = head;\n  int max = *p[0], k = 0;\n  for (i = 1; i < 26; i++) {\n    if (*p[i] > max) {\n      max = *p[i];\n      k = i;\n    }\n  }\n  printf(\"%c %d\", 'A' + k, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; (q->zz)[j] != '\u0000'; j++) {\n      if ((q->zz)[j] == 'A' + k)\n        printf(\" %d\", q->num);\n    }\n    q = q->next;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct book *head;\n  head = creat(n);\n  search(head, n);\n}\n"}
{"label": "2", "index": "3547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct jisuan {\n  int num;\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, m, n, k, e;\n  int count[26] = {0}, author[26];\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    author[i] = 65 + i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      e = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = e;\n      e = author[i];\n      author[i] = author[i + 1];\n      author[i + 1] = e;\n    }\n  }\n  printf(\"%c %d \", author[25], count[25]);\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == author[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char a[26];\n  };\n  int n, i, j, k;\n  int b[26] = {0}, c[26];\n  scanf(\"%d\", &n);\n  struct book *p;\n  p = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &p[i].m, p[i].a);\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < 26; k++)\n        if (p[j].a[k] == 'A' + i)\n          b[i] = b[i] + 1;\n  for (i = 0; i < 26; i++)\n    c[i] = b[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n  for (i = 0; i < 26; i++)\n    if (c[i] == b[25]) {\n      printf(\"%c\\n%d\\n\", 'A' + i, b[25]);\n      for (j = 0; j < n; j++)\n        for (k = 0; k < 26; k++)\n          if (p[j].a[k] == 'A' + i)\n            printf(\"%d\\n\", p[j].m);\n    }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "3549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char au[32];\n  int sta[27];\n} b[1020];\nint main() {\n  int i, j, k, m, n;\n  char c;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].au);\n  }\n  for (i = 0; i < m; i++) {\n\n    for (j = 0;; j++) {\n      c = b[i].au[j];\n      if (c == '\\0') {\n        break;\n      } else {\n        b[i].sta[c - 64]++;\n      }\n    }\n  }\n  int sum[27] = {0};\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < 27; j++)\n      sum[j] += b[i].sta[j];\n  }\n  int max = 0;\n  for (i = 1; i < 27; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n\", k + 64);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n    }\n  }\n  printf(\"%d\\n\", n);\n  n = 0;\n  for (i = 0; i < m; i++) {\n    if (b[i].sta[k] != 0) {\n      n++;\n      if (n == 1) {\n        printf(\"%d\", b[i].num);\n      } else {\n        cout << \"\\n\" << b[i].num;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n = 0, book[1000], num[26] = {0};\n  char name[1000][10];\n  scanf(\"%d \", &m);\n  for (int i = 1; i <= m; i++) {\n    cin >> book[i] >> name[i];\n  }\n  for (char z = 'A'; z <= 'Z'; z++) {\n    for (int i = 1; i <= m; i++) {\n      for (int j = 0; j < 10; j++)\n        if (name[i][j] == z)\n          num[z - 'A']++;\n    }\n  }\n  int max = 0, k = 0;\n  for (int i = 0; i < 26; i++) {\n    if (max < num[i]) {\n      max = num[i];\n      k = i;\n    }\n  }\n  cout << (char)('A' + k) << endl << max << endl;\n  for (int i = 1; i <= m; i++) {\n    for (int j = 0; j < 10; j++)\n      if (name[i][j] == 'A' + k)\n        cout << book[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[26] = {0};\n  char c;\n  struct books {\n    int number;\n    char name[27];\n  };\n  struct books book[1000];\n  int n, i, j, max = 0;\n  struct books *p;\n  scanf(\"%d\", &n);\n  for (p = book; p < book + n; p++)\n    scanf(\"%d%s\", &p->number, p->name);\n  for (p = book; p < book + n; p++)\n    for (j = 0; j < 26; j++)\n      for (i = 65; i <= 90; i++)\n        if (p->name[j] == i)\n          x[i - 65]++;\n  for (i = 0; i < 26; i++)\n    if (x[i] > max)\n      max = x[i];\n  for (i = 0; i < 26; i++)\n    if (x[i] == max)\n      break;\n  c = i + 65;\n  printf(\"%c\\n%d\\n\", c, max);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 26; j++)\n      if (book[i].name[j] == c) {\n        cout << book[i].number << \"\\n\";\n        break;\n      }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char edt[27];\n};\nstruct total {\n  char name;\n  int amount;\n};\nint main() {\n  int m, i, j, k;\n  struct book bk[1000];\n  struct total to[27];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].edt;\n  for (i = 0; i < 26; i++) {\n    to[i].name = 'A' + i;\n    to[i].amount = 0;\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++) {\n      for (k = 0; k < 26; k++) {\n        if (bk[i].edt[j] == to[k].name)\n          to[k].amount++;\n      }\n    }\n  }\n\n  for (i = k = 0; i < 26; i++) {\n    if (to[i].amount > to[k].amount)\n      k = i;\n  }\n  printf(\"%c\\n%d\\n\", to[k].name, to[k].amount);\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(bk[i].edt); j++)\n      if (bk[i].edt[j] == to[k].name)\n        cout << bk[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int id;\n  char p[26];\n};\nint main() {\n  int n, i, j, k, a[150] = {0}, flag, max = 0;\n  struct book t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &s[i].id, s[i].p);\n    for (j = 0; s[i].p[j] != '\\0'; j++) {\n      a[s[i].p[j]]++;\n    }\n  }\n  for (i = 'A'; i <= 'Z'; i++)\n    if (max < a[i]) {\n      max = a[i];\n      j = i;\n    }\n  cout << j << \"\\n\";\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; s[i].p[k] != '\\0'; k++)\n      if (s[i].p[k] == j)\n        flag = 1;\n    if (flag == 1)\n      printf(\"%d\\n\", s[i].id);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][30] = {\"\\0\"}, c;\n  int i, j, k, m, a[26] = {0}, b[100] = {0};\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &b[i], s[i]);\n    for (c = 'A'; c <= 'Z'; c++) {\n      if (strchr(s[i], c))\n        a[c - 65]++;\n    }\n  }\n  j = a[0];\n  k = 0;\n  for (i = 1; i < 26; i++) {\n    if (a[i] > j) {\n      j = a[i];\n      k = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", k + 65, a[k]);\n  for (i = 0; i < m; i++)\n    if (strchr(s[i], k + 65))\n      cout << b[i] << \"\\n\";\n}\n"}
{"label": "2", "index": "3555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int no;\n  char wr[26];\n} book[999];\nstruct {\n  char name;\n  int num;\n  int book[999];\n} a[26];\n\nint main() {\n  int n, m, t, k, d;\n  int all = 0;\n  for (t = 0; t < 26; t++) {\n    a[t].name = 'A' + t;\n    a[t].num = 0;\n  }\n  cin >> m;\n  for (t = 0; t < m; t++) {\n    scanf(\"%d %s\", &book[t].no, book[t].wr);\n  }\n  for (t = 0; t < m; t++) {\n    k = strlen(book[t].wr);\n    for (n = 0; n < k; n++) {\n      for (d = 0; d < 26; d++) {\n        if (a[d].name == book[t].wr[n]) {\n          a[d].book[a[d].num] = book[t].no;\n          a[d].num++;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n  for (t = 0; t < 26; t++) {\n    if (k < a[t].num) {\n      k = a[t].num;\n    }\n  }\n  for (t = 0;; t++) {\n    if (k == a[t].num) {\n      printf(\"%c\", a[t].name);\n      printf(\"\\n%d\", a[t].num);\n      for (d = 0; d < a[t].num; d++)\n        printf(\"\\n%d\", a[t].book[d]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int at[26] = {0};\n  char c;\n  scanf(\"%d\", &n);\n  struct st {\n    int id;\n    char s[27];\n  } a[999], *p;\n  for (p = a; p < a + n; p++)\n    scanf(\"%d %s\", &p->id, p->s);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c != '\\0')\n        at[c - 65]++;\n      else\n        break;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (at[i] > max) {\n      max = at[i];\n      j = i;\n    }\n  }\n  char x;\n  x = j + 65;\n  printf(\"%c\\n%d\\n\", x, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      c = a[i].s[j];\n      if (c == x)\n        printf(\"%d\\n\", a[i].id);\n      if (c == '\\0')\n        break;\n    }\n  }\n}\n"}
{"label": "2", "index": "3557", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d\", &m);\n\n  struct Bookinfo {\n    int number;\n    char auther[27];\n  };\n\n  struct Bookinfo a[1000];\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i].number, a[i].auther);\n\n  struct Author {\n    int count;\n    int number[1000];\n  };\n\n  struct Author b[26];\n  for (i = 0; i < 26; i++)\n    b[i].count = 0;\n  int max, record;\n\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(a[i].auther);\n    for (j = 0; j < k; j++) {\n      b[a[i].auther[j] - 'A'].number[b[a[i].auther[j] - 'A'].count] =\n          a[i].number;\n      b[a[i].auther[j] - 'A'].count++;\n    }\n  }\n\n  max = b[0].count;\n  for (i = 0; i < 26; i++)\n    if (b[i].count >= max) {\n      max = b[i].count;\n      record = i;\n    }\n  printf(\"%c\\n%d\\n\", record + 'A', max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", b[record].number[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[100], C[26] = {0}, n, i, j, m, a = 0, b;\n  char B[100][100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> A[i] >> B[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      m = B[i][j];\n      C[m - 65]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (a < C[i]) {\n      a = C[i];\n      b = i;\n    }\n  }\n  cout << b + 65 << \"\\n\";\n  printf(\"%d\\n\", a);\n  c = b + 65;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(B[i]); j++) {\n      if (B[i][j] == c)\n        printf(\"%d\\n\", A[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int n;\n    char a[26];\n  };\n  struct book book[999];\n  int m, c[26] = {0}, k;\n  char w[26];\n  cin >> m;\n  int i, j, max = 0, t;\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &book[i].n, book[i].a);\n  for (i = 0; i < 26; i++)\n    w[i] = 'A' + i;\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < m; j++)\n      for (k = 0; k < 26; k++) {\n        if (book[j].a[k] == w[i])\n          c[i]++;\n      }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == max) {\n      t = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", w[t], c[t]);\n  for (j = 0; j < m; j++)\n    for (k = 0; k < 26; k++) {\n      if (book[j].a[k] == w[t]) {\n        printf(\"%d\\n\", book[j].n);\n        break;\n      }\n    }\n}\n"}
{"label": "2", "index": "3560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint trans(char k) {\n  char a[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int i;\n  for (i = 0; i < 26; i++) {\n    if (k == a[i])\n      return i;\n  }\n}\n\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct point {\n    int id;\n    char au[26];\n  } books[1000];\n  int num[26];\n  int i;\n  for (i = 0; i < 26; i++) {\n    num[i] = 0;\n  }\n  int j;\n  for (i = 0; i < m; i++) {\n    cin >> books[i].id >> books[i].au;\n  }\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      int b;\n      b = trans(books[i].au[j]);\n      num[b]++;\n    }\n  }\n  int max = 0;\n  int most;\n  for (i = 0; i < 26; i++) {\n    if (num[i] > max) {\n      max = num[i];\n      most = i;\n    }\n  }\n  char aumost;\n  aumost = 'A' + most;\n  printf(\"%c\\n\", aumost);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    int k;\n    k = strlen(books[i].au);\n    for (j = 0; j < k; j++) {\n      if (books[i].au[j] == 'A' + most) {\n        printf(\"%d\\n\", books[i].id);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, max = 0;\n  int Q[26] = {0};\n  struct {\n    int num;\n    char name[27];\n  } book[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> book[i].num >> book[i].name;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      switch (book[i].name[j]) {\n      case 'A':\n        Q[0]++;\n        break;\n      case 'B':\n        Q[1]++;\n        break;\n      case 'C':\n        Q[2]++;\n        break;\n      case 'D':\n        Q[3]++;\n        break;\n      case 'E':\n        Q[4]++;\n        break;\n      case 'F':\n        Q[5]++;\n        break;\n      case 'G':\n        Q[6]++;\n        break;\n      case 'H':\n        Q[7]++;\n        break;\n      case 'I':\n        Q[8]++;\n        break;\n      case 'J':\n        Q[9]++;\n        break;\n      case 'K':\n        Q[10]++;\n        break;\n      case 'L':\n        Q[11]++;\n        break;\n      case 'M':\n        Q[12]++;\n        break;\n      case 'N':\n        Q[13]++;\n        break;\n      case 'O':\n        Q[14]++;\n        break;\n      case 'P':\n        Q[15]++;\n        break;\n      case 'Q':\n        Q[16]++;\n        break;\n      case 'R':\n        Q[17]++;\n        break;\n      case 'S':\n        Q[18]++;\n        break;\n      case 'T':\n        Q[19]++;\n        break;\n      case 'U':\n        Q[20]++;\n        break;\n      case 'V':\n        Q[21]++;\n        break;\n      case 'W':\n        Q[22]++;\n        break;\n      case 'X':\n        Q[23]++;\n        break;\n      case 'Y':\n        Q[24]++;\n        break;\n      case 'Z':\n        Q[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 1; i < 26; i++) {\n    if (Q[i] > Q[max])\n      max = i;\n  }\n  cout << max + 65 << \"\\n\" << Q[max] << \"\\n\";\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < strlen(book[i].name); j++) {\n      if (book[i].name[j] == max + 65) {\n        cout << book[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char aut[27];\n  struct book *next;\n};\nint n;\nstruct book *creat(int amount) {\n  struct book *head;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = (struct book *)malloc(sizeof(struct book));\n  p2 = p1;\n  scanf(\"%d %s\", &p1->num, p1->aut);\n  while (n < amount - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &p1->num, p1->aut);\n  }\n  p2->next = p1, p1->next = NULL;\n  return (head);\n}\nint main() {\n  int amount, i, a[26] = {0}, max, maxn;\n  struct book *p, *headp;\n  char *auth, name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                          'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S',\n                          'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &amount);\n  p = creat(amount);\n  headp = p;\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      for (i = 0; i < 26; i++) {\n        if (name[i] == *auth)\n          break;\n      }\n      a[i] = a[i] + 1;\n    }\n  }\n  for (i = 0, max = a[0], maxn = 0; i < 26; i++) {\n    if (a[i] > max)\n      max = a[i], maxn = i;\n  }\n  printf(\"%c\\n%d\\n\", name[maxn], max);\n  for (p = headp; p != NULL; p = p->next) {\n    for (auth = p->aut; *auth != '\\0'; auth++) {\n      if (*auth == name[maxn])\n        break;\n    }\n    if (*auth == '\\0')\n      ;\n    else\n      cout << p->num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char str[200];\n} bk[1000];\nint main() {\n  int m, i, l, k, p = 0, max, maxl;\n  int a[200][1000];\n  int b[200];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> bk[i].num >> bk[i].str;\n\n  for (l = 0; l < 26; l++) {\n    for (i = 0; i < m; i++) {\n      for (k = 0; bk[i].str[k] != '\\0'; k++) {\n        if ((bk[i].str[k]) == l + 65) {\n          a[l][p] = bk[i].num;\n          p++;\n        }\n      }\n    }\n    b[l] = p;\n    p = 0;\n  }\n  max = b[0];\n  maxl = 0;\n  for (l = 0; l < 26; l++) {\n    if (b[l] > max) {\n      max = b[l];\n      maxl = l;\n    }\n  }\n  printf(\"%c\\n\", maxl + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < max; i++)\n    printf(\"%d\\n\", a[maxl][i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct tushu {\n    int bianhao;\n    char zuozhe[26];\n  };\n  int i, j, n, q = 0;\n  int count[26] = {0};\n  scanf(\"%d\", &n);\n  struct tushu *pp;\n  pp = (struct tushu *)malloc(sizeof(tushu) * n);\n  int *m;\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &((pp + i)->bianhao), (pp + i)->zuozhe);\n  }\n  for (i = 0; i < n; i++) {\n    m[i] = strlen(pp[i].zuozhe);\n    for (j = 0; j < m[i]; j++) {\n      count[pp[i].zuozhe[j] - 'A']++;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      q = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + q, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m[i]; j++) {\n      if (pp[i].zuozhe[j] == ('A' + q))\n        cout << pp[i].bianhao << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  struct book {\n    int no;\n    char as[10];\n  } bk;\n\n  scanf(\"%d \", &n);\n  struct book *books = (struct book *)malloc(sizeof(struct book) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &bk.no, bk.as);\n    books[i] = bk;\n  }\n\n  int cnts[256] = {0};\n  for (i = 0; i < n; i++) {\n    bk = books[i];\n    for (j = 0; bk.as[j]; j++) {\n      cnts[bk.as[j]]++;\n    }\n  }\n\n  int count = 0;\n  for (int max = 1000; max > 0; max--) {\n    for (char c = 'A'; c <= 'Z'; c++) {\n      if (cnts[c] == max) {\n        printf(\"%c\\n%d\\n\", c, max);\n        for (i = 0; i < n; i++) {\n          bk = books[i];\n          for (j = 0; bk.as[j]; j++) {\n            if (bk.as[j] == c) {\n              cout << bk.no << \"\\n\";\n              break;\n            }\n          }\n        }\n        count++;\n      }\n    }\n    if (count == 1) {\n      free(books);\n      return 0;\n    }\n  }\n\n  free(books);\n  return -1;\n}\n"}
{"label": "2", "index": "3566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f = 0, c, d;\n  struct aut {\n    int num;\n    char wrt[26];\n  } a[999];\n  char wr[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  int g[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].wrt;\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i].wrt[j] == wr[k])\n          g[k] = g[k] + 1;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (f < g[i]) {\n      f = g[i];\n      d = i;\n    }\n  }\n\n  cout << wr[d] << \"\\n\" << f << \"\\n\";\n  for (i = 0; i < n; i++) {\n    c = strlen(a[i].wrt);\n    for (j = 0; j < c; j++) {\n      if (a[i].wrt[j] == wr[d]) {\n        cout << a[i].num << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  int book_number[26];\n  int max = 0;\n  int max_n;\n  int author_len;\n\n  struct data {\n    int number;\n    char author[27];\n  };\n\n  scanf(\"%d\", &n);\n\n  struct data *input = (struct data *)malloc(sizeof(struct data) * n);\n\n  for (j = 0; j <= 25; j++)\n    book_number[j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %s\", &input[i].number, input[i].author);\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++)\n      book_number[input[i].author[j] - 'A']++;\n  }\n\n  for (j = 0; j <= 25; j++) {\n    if (book_number[j] > max) {\n      max = book_number[j];\n      max_n = j;\n    }\n  }\n\n  printf(\"%c\\n%d\\n\", max_n + 'A', max);\n\n  for (i = 0; i <= n - 1; i++) {\n    author_len = strlen(input[i].author);\n\n    for (j = 0; j <= author_len - 1; j++) {\n      if (input[i].author[j] == max_n + 'A') {\n        printf(\"%d\\n\", input[i].number);\n        break;\n      }\n    }\n  }\n\n  free(input);\n\n  return 0;\n}\n"}
{"label": "2", "index": "3568", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct bo {\n  char id[10];\n  char au[100];\n};\n\nint main() {\n  int n, i, j, max;\n  char maxa;\n  struct bo *book;\n  int auth[26];\n  memset(auth, 0, sizeof(int) * 26);\n  scanf(\"%d\", &n);\n  book = (struct bo *)malloc(sizeof(struct bo) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%s\", book[i].id, book[i].au);\n    for (j = 0; book[i].au[j]; j++) {\n      auth[book[i].au[j] - 'A']++;\n    }\n  }\n  max = 0;\n  for (i = 0; i < 26; i++) {\n    if (max < auth[i]) {\n      max = auth[i];\n      maxa = i + 'A';\n    }\n  }\n  printf(\"%c\\n\", maxa);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < n; i++) {\n    if (strchr(book[i].au, maxa))\n      printf(\"%s\\n\", book[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct author {\n  int sumbook;\n  int id[999];\n} a[26];\n\nint main() {\n  int n, i, j, bookid = 0, pos = 0, maxbook = 0, maxid = 0;\n  char booka[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d%s\", &bookid, booka);\n    for (j = 0; j < strlen(booka); ++j) {\n      pos = booka[j] - 'A';\n      a[pos].id[a[pos].sumbook] = bookid;\n      a[pos].sumbook++;\n      if (maxbook < a[pos].sumbook) {\n        maxid = pos;\n        maxbook = a[pos].sumbook;\n      }\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxid + 'A', maxbook);\n  for (i = 0; i < a[maxid].sumbook; i++)\n    printf(\"%d\\n\", a[maxid].id[i]);\n}\n"}
{"label": "2", "index": "3570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint c[255];\n\nint main() {\n  int i, j, n;\n  char m = 0;\n  struct {\n    int id;\n    char s[255];\n  } a[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%s\", &a[i].id, a[i].s);\n    for (j = 0; a[i].s[j]; j++) {\n      if (++c[a[i].s[j]] > c[m])\n        m = a[i].s[j];\n    }\n  }\n  printf(\"%c\\n%d\\n\", m, c[m]);\n  for (i = 0; i < n; i++) {\n    if (strchr(a[i].s, m))\n      cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, max = -1;\n  int c[26];\n  char prname;\n  struct list {\n    int num;\n    char writer[27];\n    int len;\n  } book[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].writer;\n    book[i].len = strlen(book[i].writer);\n  }\n  for (i = 0; i < 26; i++)\n    c[i] = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < book[i].len; j++) {\n      switch (book[i].writer[j]) {\n      case 'A':\n        c[0]++;\n        break;\n      case 'B':\n        c[1]++;\n        break;\n      case 'C':\n        c[2]++;\n        break;\n      case 'D':\n        c[3]++;\n        break;\n      case 'E':\n        c[4]++;\n        break;\n      case 'F':\n        c[5]++;\n        break;\n      case 'G':\n        c[6]++;\n        break;\n      case 'H':\n        c[7]++;\n        break;\n      case 'I':\n        c[8]++;\n        break;\n      case 'J':\n        c[9]++;\n        break;\n      case 'K':\n        c[10]++;\n        break;\n      case 'L':\n        c[11]++;\n        break;\n      case 'M':\n        c[12]++;\n        break;\n      case 'N':\n        c[13]++;\n        break;\n      case 'O':\n        c[14]++;\n        break;\n      case 'P':\n        c[15]++;\n        break;\n      case 'Q':\n        c[16]++;\n        break;\n      case 'R':\n        c[17]++;\n        break;\n      case 'S':\n        c[18]++;\n        break;\n      case 'T':\n        c[19]++;\n        break;\n      case 'U':\n        c[20]++;\n        break;\n      case 'V':\n        c[21]++;\n        break;\n      case 'W':\n        c[22]++;\n        break;\n      case 'X':\n        c[23]++;\n        break;\n      case 'Y':\n        c[24]++;\n        break;\n      case 'Z':\n        c[25]++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] > max)\n      max = c[i];\n    else\n      continue;\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] != max)\n      continue;\n    else {\n      prname = i + 65;\n      printf(\"%c \", prname);\n      printf(\"%d \", max);\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < book[j].len; k++) {\n          if (book[j].writer[k] != prname)\n            continue;\n          else {\n            printf(\"%d \", book[j].num);\n            break;\n          }\n        }\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3572", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[110], m, ni = 0, n = 0,\n                   maxn[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  char au[110][30], max[30];\n  cin >> m;\n\n  int i, j;\n  for (i = 0; i < m; i++) {\n    cin >> num[i];\n    cin >> au[i];\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 'A')\n        maxn[0]++;\n      if (au[i][j] == 'B')\n        maxn[1]++;\n      if (au[i][j] == 'C')\n        maxn[2]++;\n      if (au[i][j] == 'D')\n        maxn[3]++;\n      if (au[i][j] == 'E')\n        maxn[4]++;\n      if (au[i][j] == 'F')\n        maxn[5]++;\n      if (au[i][j] == 'G')\n        maxn[6]++;\n      if (au[i][j] == 'H')\n        maxn[7]++;\n      if (au[i][j] == 'I')\n        maxn[8]++;\n      if (au[i][j] == 'J')\n        maxn[9]++;\n      if (au[i][j] == 'K')\n        maxn[10]++;\n      if (au[i][j] == 'L')\n        maxn[11]++;\n      if (au[i][j] == 'M')\n        maxn[12]++;\n      if (au[i][j] == 'N')\n        maxn[13]++;\n      if (au[i][j] == 'O')\n        maxn[14]++;\n      if (au[i][j] == 'P')\n        maxn[15]++;\n      if (au[i][j] == 'Q')\n        maxn[16]++;\n      if (au[i][j] == 'R')\n        maxn[17]++;\n      if (au[i][j] == 'S')\n        maxn[18]++;\n      if (au[i][j] == 'T')\n        maxn[19]++;\n      if (au[i][j] == 'U')\n        maxn[20]++;\n      if (au[i][j] == 'V')\n        maxn[21]++;\n      if (au[i][j] == 'W')\n        maxn[22]++;\n      if (au[i][j] == 'X')\n        maxn[23]++;\n      if (au[i][j] == 'Y')\n        maxn[24]++;\n      if (au[i][j] == 'Z')\n        maxn[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (maxn[i] > n) {\n      n = maxn[i];\n      ni = i;\n    }\n  }\n  cout << (char)(ni + 65) << endl;\n  cout << n << endl;\n  for (i = 0; i < m; i++) {\n    for (j = 0; au[i][j] != '\\0'; j++) {\n      if (au[i][j] == 65 + ni)\n        cout << num[i] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3573", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct book *head;\nint abc[26];\nstruct book {\n  int num;\n  char name[1000];\n  struct book *next;\n};\n\nvoid ffind(char *name) {\n  while (*name != 0) {\n    abc[*name - 65]++;\n    name++;\n  }\n}\nint mfind(char *name, char a) {\n  while (*name != 0) {\n    if (a == *name)\n      return 1;\n    name++;\n  }\n}\n\nstruct book *creat(int max) {\n  int n;\n  struct book *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct book *)malloc(1000);\n  head = 0;\n  do {\n    scanf(\"%d %s\", &p1->num, &p1->name);\n    ffind(p1->name);\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p2->next = 0;\n    p1 = (struct book *)malloc(1000);\n  } while (n < max);\n  p2->next = 0;\n  return head;\n}\n\nint main() {\n  int n, i;\n  int max = 0, maxi = 0;\n  char tt[2];\n  struct book *p, *p1;\n  scanf(\"%d \", &n);\n  p = creat(n);\n  p1 = p;\n\n  for (i = 0; i < 26; i++) {\n    if (abc[i] > max) {\n      max = abc[i];\n      maxi = i;\n    }\n  }\n\n  printf(\"%C %d \", 65 + maxi, max);\n\n  tt[0] = maxi + 65;\n  tt[1] = 0;\n  do {\n    if (mfind(p1->name, maxi + 65) == 1) {\n      max--;\n      if (max != 0) {\n        printf(\"%d \", p1->num);\n      } else\n        printf(\"%d\", p1->num);\n    }\n    p1 = p1->next;\n  } while (p1 != 0);\n}\n"}
{"label": "2", "index": "3574", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint num[1000];\nchar auth[1000][26];\n\nint main() {\n  int m, i, l;\n  cin >> m;\n  char c = 'A';\n  int k = 0;\n  int a[26];\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    scanf(\"%s\", auth[i]);\n    int j = 0;\n    while (auth[i][j] != '\\0') {\n      a[auth[i][j] - 64]++;\n      j++;\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (a[i] > k) {\n      k = a[i];\n      c = i + 64;\n    }\n  }\n  printf(\"%c\\n%d\\n\", c, k);\n\n  for (i = 0; i < m; i++)\n    for (l = 0; l < 26; l++) {\n      if (auth[i][l] == c)\n        printf(\"%d\\n\", num[i]);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char book[1000][20] = {'\\0'}, name[1000][30] = {'\\0'};\n  int length, n, i, j, number[30] = {0}, memory, largest, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %s\", book[i], name[i]);\n  }\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      temp = name[i][j] - 'A';\n      number[temp] += 1;\n    }\n  }\n  largest = 0;\n  for (i = 0; i < 26; i++) {\n    if (number[i] > largest) {\n      largest = number[i];\n      memory = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", 'A' + memory, number[memory]);\n  for (i = 0; i < n; i++) {\n    length = strlen(name[i]);\n    for (j = 0; j < length; j++) {\n      if (name[i][j] == 'A' + memory) {\n        printf(\"%s\\n\", book[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[1000] = {0}, b[1000] = {0}, c[100] = {0}, l = 0;\n  char s[1000][100] = {0}, m[26] = {0}, p;\n  int i = 0, j = 0, k = 0, t = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &a[i], s[i]);\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    m[j] = i;\n    for (t = 0; t < n; t++) {\n      for (k = 0; s[t][k] != '\\0'; k++) {\n        if (s[t][k] == m[j]) {\n          c[j]++;\n          break;\n        }\n      }\n    }\n    j++;\n  }\n  l = 0;\n  for (i = 0; i < 26; i++) {\n    if (c[i] > l) {\n      l = c[i];\n      p = m[i];\n    }\n  }\n  printf(\"%c\\n\", p);\n  cout << l << \"\\n\";\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; s[i][j] != '\\0'; j++) {\n      if (s[i][j] == p) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 1) {\n      printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3577", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct book {\n    int num;\n    char wri[26];\n  } * s;\n  int n, i, j, a[100], t;\n  char c;\n  s = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &(*(s + i)).num, (*(s + i)).wri);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      for (c = 'A'; c <= 'Z'; c++)\n        if (s[i].wri[j] == c)\n          a[s[i].wri[j]]++;\n    }\n  for (i = 0; i < 100; i++)\n    if (a[0] < a[i]) {\n      a[0] = a[i];\n      t = i;\n    }\n  printf(\"%c\\n\", t);\n  printf(\"%d\\n\", a[t]);\n  for (i = 0; i < n; i++)\n    for (j = 0; (*(s + i)).wri[j] != '\\0'; j++) {\n      if (s[i].wri[j] == t)\n        printf(\"%d\\n\", s[i].num);\n    }\n  return 0;\n}\n"}
{"label": "2", "index": "3578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, sum[26] = {0}, m, j, max = 0, p;\n  struct book {\n    int num;\n    char au[27];\n    int l;\n  };\n  struct book bk[1000];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> bk[i].num >> bk[i].au;\n    bk[i].l = strlen(bk[i].au);\n    for (j = 0; j < bk[i].l; j++) {\n      switch (bk[i].au[j]) {\n      case 'A':\n        sum[0] += 1;\n        break;\n      case 'B':\n        sum[1] += 1;\n        break;\n      case 'C':\n        sum[2] += 1;\n        break;\n      case 'D':\n        sum[3] += 1;\n        break;\n      case 'E':\n        sum[4] += 1;\n        break;\n      case 'F':\n        sum[5] += 1;\n        break;\n      case 'G':\n        sum[6] += 1;\n        break;\n      case 'H':\n        sum[7] += 1;\n        break;\n      case 'I':\n        sum[8] += 1;\n        break;\n      case 'J':\n        sum[9] += 1;\n        break;\n      case 'K':\n        sum[10] += 1;\n        break;\n      case 'L':\n        sum[11] += 1;\n        break;\n      case 'M':\n        sum[12] += 1;\n        break;\n      case 'N':\n        sum[13] += 1;\n        break;\n      case 'O':\n        sum[14] += 1;\n        break;\n      case 'P':\n        sum[15] += 1;\n        break;\n      case 'Q':\n        sum[16] += 1;\n        break;\n      case 'R':\n        sum[17] += 1;\n        break;\n      case 'S':\n        sum[18] += 1;\n        break;\n      case 'T':\n        sum[19] += 1;\n        break;\n      case 'U':\n        sum[20] += 1;\n        break;\n      case 'V':\n        sum[21] += 1;\n        break;\n      case 'W':\n        sum[22] += 1;\n        break;\n      case 'X':\n        sum[23] += 1;\n        break;\n      case 'Y':\n        sum[24] += 1;\n        break;\n      case 'Z':\n        sum[25] += 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      p = i;\n    } else\n      ;\n  }\n  printf(\"%c %d\", p + 65, max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < bk[i].l; j++) {\n      if (bk[i].au[j] == p + 65) {\n        cout << \" \" << bk[i].num;\n        break;\n      } else\n        ;\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  struct {\n    int a;\n    char s[26];\n  } zuozhe[1000];\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &zuozhe[i].a, zuozhe[i].s);\n  }\n  int c[26] = {0}, d;\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      c[zuozhe[i].s[k] - 65]++;\n    }\n  }\n  int f;\n  for (i = 1; i < 26; i++) {\n    if (c[i] > c[0]) {\n      f = i;\n      d = c[i];\n      c[i] = c[0];\n      c[0] = d;\n    }\n  }\n  cout << f + 65 << \"\\n\" << c[0] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    d = strlen(zuozhe[i].s);\n    for (k = 0; k < d; k++) {\n      if (zuozhe[i].s[k] == f + 65)\n        printf(\"%d\\n\", zuozhe[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3580", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\nint main() {\n  int n, t, i, j;\n  int count[26], max = 0;\n  for (i = 0; i < 26; i++)\n    count[i] = 0;\n  struct book {\n    int num;\n    char man[26];\n  } book[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> book[i].num >> book[i].man;\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == 'A')\n        count[0]++;\n      else if (book[i].man[j] == 'B')\n        count[1]++;\n      else if (book[i].man[j] == 'C')\n        count[2]++;\n      else if (book[i].man[j] == 'D')\n        count[3]++;\n      else if (book[i].man[j] == 'E')\n        count[4]++;\n      else if (book[i].man[j] == 'F')\n        count[5]++;\n      else if (book[i].man[j] == 'G')\n        count[6]++;\n      else if (book[i].man[j] == 'H')\n        count[7]++;\n      else if (book[i].man[j] == 'I')\n        count[8]++;\n      else if (book[i].man[j] == 'J')\n        count[9]++;\n      else if (book[i].man[j] == 'K')\n        count[10]++;\n      else if (book[i].man[j] == 'L')\n        count[11]++;\n      else if (book[i].man[j] == 'M')\n        count[12]++;\n      else if (book[i].man[j] == 'N')\n        count[13]++;\n      else if (book[i].man[j] == 'O')\n        count[14]++;\n      else if (book[i].man[j] == 'P')\n        count[15]++;\n      else if (book[i].man[j] == 'Q')\n        count[16]++;\n      else if (book[i].man[j] == 'R')\n        count[17]++;\n      else if (book[i].man[j] == 'S')\n        count[18]++;\n      else if (book[i].man[j] == 'T')\n        count[19]++;\n      else if (book[i].man[j] == 'U')\n        count[20]++;\n      else if (book[i].man[j] == 'V')\n        count[21]++;\n      else if (book[i].man[j] == 'W')\n        count[22]++;\n      else if (book[i].man[j] == 'X')\n        count[23]++;\n      else if (book[i].man[j] == 'Y')\n        count[24]++;\n      else if (book[i].man[j] == 'Z')\n        count[25]++;\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (count[i] > max) {\n      max = count[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", name[t], max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; book[i].man[j]; j++) {\n      if (book[i].man[j] == name[t])\n        printf(\"%d\\n\", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, sum[27] = {0}, max = 0, author;\n  cin >> m;\n  char str[1000][4], name[1000][27];\n  for (int i = 0; i < m; i++)\n    cin >> str[i] >> name[i];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++)\n      sum[name[i][j] - 'A']++;\n  }\n  for (int i = 0; i < 26; i++) {\n    if (max < sum[i]) {\n      max = sum[i];\n      author = i;\n    }\n  }\n  cout << (char)('A' + author) << endl;\n  cout << max << endl;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < strlen(name[i]); j++) {\n      if (name[i][j] - 'A' == author)\n        cout << str[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct fy {\n    int x;\n    char y[26];\n    int s[26];\n    struct fy *z;\n  } sl[1000], *p;\n  int n, i, j, b[26] = {0};\n\n  p = &sl[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &sl[i].x, sl[i].y);\n    for (j = 0; j < strlen(sl[i].y); j++) {\n      sl[i].s[sl[i].y[j] - 'A'] = 1;\n      b[sl[i].y[j] - 'A']++;\n    }\n    sl[i].z = &sl[i + 1];\n  }\n  sl[n - 1].z = NULL;\n  for (i = 0; i < 26; i++) {\n    for (j = 0; j < 26; j++)\n      if (b[i] < b[j])\n        break;\n    if (j == 26) {\n      j = i;\n      break;\n    }\n  }\n  printf(\"%c\\n%d\\n\", i + 'A', b[j]);\n  while (p != NULL) {\n    if (p->s[i] == 1)\n      printf(\"%d\\n\", p->x);\n    p = p->z;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct record {\n  int id;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  struct YyxNode *newNd;\n  if (((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) ||\n      ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL)) {\n    cout << \"Error: memory out! (1)\";\n    exit(-1);\n  }\n\n  newLn->n = 0;\n  newLn->head = newNd;\n  newNd->next = NULL;\n  newLn->tail = newNd;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNd;\n  if ((newNd = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\");\n    exit(-1);\n  }\n\n  newNd->m_rec = *rec;\n  newNd->next = NULL;\n\n  ln->tail->next = newNd;\n  ln->tail = newNd;\n  ln->n++;\n\n  return ln;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNd, *nextNd;\n  delNd = ln->head->next;\n  for (; delNd != NULL; delNd = nextNd) {\n    nextNd = delNd->next;\n    free(delNd);\n  }\n\n  ln->n = 0;\n  ln->head->next = NULL;\n\n  return ln;\n}\n\nvoid FreeLink(struct YyxLink *ln) {\n  ClearLink(ln);\n  free(ln->head);\n  free(ln);\n}\n\nint main() {\n  struct YyxLink **total;\n  int m;\n  struct record rec;\n  char author[27];\n  int i;\n  char *pch;\n  struct YyxNode *nd;\n\n  if ((total = (struct YyxLink **)malloc(26 * sizeof(struct YyxLink *))) ==\n      NULL) {\n    printf(\"Error: memory out! (3)\\n\");\n    exit(-1);\n  }\n  for (i = 0; i < 26; i++)\n    total[i] = CreateNewLink();\n\n  scanf(\"%d\", &m);\n  for (; m > 0; m--) {\n    scanf(\"%d %s\", &rec.id, author);\n    pch = author;\n    for (; *pch != '\\0'; pch++) {\n      AddNode(total[*pch - 'A'], &rec);\n    }\n  }\n\n  m = 0;\n  for (i = 1; i < 26; i++) {\n    if (total[m]->n < total[i]->n)\n      m = i;\n  }\n  cout << m + 'A' << \"\\n\" << total[m]->n << \"\\n\";\n  nd = total[m]->head->next;\n  for (; nd != NULL; nd = nd->next) {\n    printf(\"%d\\n\", nd->m_rec);\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct book {\n  int num;\n  char name[26];\n};\nstruct name {\n  char na;\n  int n;\n};\nint main() {\n  int n, i, j, k, s, max = 0;\n  struct book a[1000];\n  struct name b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%s\", &a[i].num, a[i].name);\n  }\n  for (i = 0; i <= 25; i++) {\n    b[i].na = 'A' + i;\n    for (j = 0, s = 0; j <= n - 1; j++) {\n      for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n        if (b[i].na == a[j].name[k]) {\n          s++;\n          break;\n        }\n      }\n    }\n    b[i].n = s;\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n > max) {\n      max = b[i].n;\n    }\n  }\n  for (i = 0; i <= 25; i++) {\n    if (b[i].n == max) {\n      cout << b[i].na << \"\\n\" << b[i].n << \"\\n\";\n      for (j = 0; j <= n - 1; j++) {\n        for (k = 0; k <= strlen(a[j].name) - 1; k++) {\n          if (b[i].na == a[j].name[k]) {\n            cout << a[j].num << \"\\n\";\n            break;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char str[27];\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld %s\", &p1->num, p1->str);\n  n = 1;\n  head = 0;\n  while (n < m) {\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->str);\n    n = n + 1;\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return (head);\n}\nint main() {\n  struct student *head, *p, stu;\n  int m, i, t, max, y = 1, a[100] = {0}, sum[27] = {0};\n  char x, c;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (; p != 0; p = p->next) {\n    for (t = 0; t < strlen(p->str); t++) {\n      c = p->str[t];\n      sum[c - 'A' + 1]++;\n    }\n  }\n  max = sum[1];\n  x = 1;\n  for (i = 1; i <= 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      x = i;\n    }\n  for (p = head; p != 0; p = p->next) {\n    for (t = 0; t <= strlen(p->str); t++)\n      if (p->str[t] == x + 'A' - 1) {\n        a[y] = p->num;\n        y++;\n        t = strlen(p->str) + 1;\n      }\n  }\n  printf(\"%c %d \", x + 64, max);\n  for (y = 1; y <= max; y++)\n    cout << a[y] << \" \";\n  return 0;\n}\n"}
{"label": "2", "index": "3586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, sum = 0, min, max, ID[1000] = {0}, a[26] = {0};\n  char name[1000][26] = {\"\"};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &ID[i], &name[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      a[name[i][j] - 'A']++;\n\n  max = a[0];\n  k = 0;\n  for (i = 0; i < 26; i++)\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n\n  printf(\"%c\\n%d\\n\", k + 'A', a[k]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(name[i]); j++)\n      if (name[i][j] == 'A' + k)\n        printf(\"%d\\n\", ID[i]);\n}\n"}
{"label": "2", "index": "3587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct inf {\n  int num;\n  char name[26];\n  struct inf *next;\n};\n\nint m;\nstruct inf *creat(void) {\n  struct inf *head, *p1, *p2;\n  int n;\n  p1 = p2 = (struct inf *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  head = NULL;\n  n = 0;\n  while (1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (n == m)\n      break;\n    else {\n      p1 = (struct inf *)malloc(1000);\n      scanf(\"%d %s\", &p1->num, p1->name);\n    }\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid count(struct inf *head, int o) {\n  struct inf *q1;\n  int *q2, *q3, *q4;\n  char *t1;\n  q1 = head;\n  q2 = (int *)malloc(26 * 1000);\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    *q3 = 0;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      *(q2 + (*t1 - 'A')) = *(q2 + (*t1 - 'A')) + 1;\n    q1 = q1->next;\n  }\n  q4 = q2;\n  for (q3 = q2; q3 < q2 + 26; q3++)\n    if (*q4 < *q3)\n      q4 = q3;\n  printf(\"%c %d \", q4 - q2 + 'A', *q4);\n  q1 = head;\n  while (q1 != NULL) {\n    for (t1 = q1->name; *t1 != '\u0000'; t1++)\n      if (*t1 == (q4 - q2 + 'A'))\n        printf(\"%d \", q1->num);\n    q1 = q1->next;\n  }\n}\n\nint main() {\n  struct inf *head, *s;\n  scanf(\"%d\", &m);\n  head = creat();\n  s = head;\n  count(head, m);\n  return 0;\n}\n"}
{"label": "2", "index": "3588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[1000], a[26], b, c, num = 0;\n  char s[1000][26];\n  for (i = 0; i < 25; i++)\n    a[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> s[i];\n    for (j = 0; s[i][j] != '\\0'; j++)\n      a[(int)s[i][j] - 65]++;\n  }\n  b = a[0];\n  c = 0;\n  for (i = 1; i < 26; i++)\n    if (b < a[i]) {\n      b = a[i];\n      c = i;\n    }\n  cout << (char)(c + 65) << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65)\n        num++;\n  cout << num << endl;\n  for (i = 0; i < n; i++)\n    for (j = 0; s[i][j] != '\\0'; j++)\n      if (s[i][j] == (char)c + 65) {\n        cout << x[i] << endl;\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  short int num;\n  char author[27];\n};\n\nint main() {\n  char findoutmax(struct info a[], int n, int *pt);\n  void detect(struct info b[], char writter, int nn);\n  char figure;\n  int i, n_book, max, *p;\n  struct info book[999];\n  scanf(\"%d\", &n_book);\n  for (i = 0; i < n_book; i++) {\n    scanf(\"%d %s\", &book[i].num, &book[i].author);\n  }\n  p = &max;\n  figure = findoutmax(book, n_book, p);\n  printf(\"%c\\n%d\\n\", figure, max);\n  detect(book, figure, n_book);\n  return 0;\n}\n\nchar findoutmax(struct info a[], int n, int *pt) {\n  int i, j, sum[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      switch (a[i].author[j]) {\n      case 'A':\n        sum[0] = sum[0] + 1;\n        break;\n      case 'B':\n        sum[1] = sum[1] + 1;\n        break;\n      case 'C':\n        sum[2] = sum[2] + 1;\n        break;\n      case 'D':\n        sum[3] = sum[3] + 1;\n        break;\n      case 'E':\n        sum[4] = sum[4] + 1;\n        break;\n      case 'F':\n        sum[5] = sum[5] + 1;\n        break;\n      case 'G':\n        sum[6] = sum[6] + 1;\n        break;\n      case 'H':\n        sum[7] = sum[7] + 1;\n        break;\n      case 'I':\n        sum[8] = sum[8] + 1;\n        break;\n      case 'J':\n        sum[9] = sum[9] + 1;\n        break;\n      case 'K':\n        sum[10] = sum[10] + 1;\n        break;\n      case 'L':\n        sum[11] = sum[11] + 1;\n        break;\n      case 'M':\n        sum[12] = sum[12] + 1;\n        break;\n      case 'N':\n        sum[13] = sum[13] + 1;\n        break;\n      case 'O':\n        sum[14] = sum[14] + 1;\n        break;\n      case 'P':\n        sum[15] = sum[15] + 1;\n        break;\n      case 'Q':\n        sum[16] = sum[16] + 1;\n        break;\n      case 'R':\n        sum[17] = sum[17] + 1;\n        break;\n      case 'S':\n        sum[18] = sum[18] + 1;\n        break;\n      case 'T':\n        sum[19] = sum[19] + 1;\n        break;\n      case 'U':\n        sum[20] = sum[20] + 1;\n        break;\n      case 'V':\n        sum[21] = sum[21] + 1;\n        break;\n      case 'W':\n        sum[22] = sum[22] + 1;\n        break;\n      case 'X':\n        sum[23] = sum[23] + 1;\n        break;\n      case 'Y':\n        sum[24] = sum[24] + 1;\n        break;\n      case 'Z':\n        sum[25] = sum[25] + 1;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (sum[j] < sum[i]) {\n      j = i;\n    }\n  }\n  *pt = sum[j];\n  return (65 + j);\n}\n\nvoid detect(struct info b[], char writter, int nn) {\n  int i, j;\n  for (i = 0; i < nn; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] == writter)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct book {\n    int m;\n    char a[26];\n  };\n  int n, i, j, k;\n  int b[26] = {0}, c[26];\n  cin >> n;\n  struct book *p;\n  p = (struct book *)malloc(n * sizeof(struct book));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &p[i].m, p[i].a);\n  for (i = 0; i < 26; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < 26; k++)\n        if (p[j].a[k] == 'A' + i)\n          b[i] = b[i] + 1;\n  for (i = 0; i < 26; i++)\n    c[i] = b[i];\n  for (j = 0; j < 25; j++)\n    for (i = 0; i < 25 - j; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n  for (i = 0; i < 26; i++)\n    if (c[i] == b[25]) {\n      printf(\"%c\\n%d\\n\", 'A' + i, b[25]);\n      for (j = 0; j < n; j++)\n        for (k = 0; k < 26; k++)\n          if (p[j].a[k] == 'A' + i)\n            printf(\"%d\\n\", p[j].m);\n    }\n  free(p);\n  return 0;\n}\n"}
{"label": "2", "index": "3591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n  struct book *next;\n};\nint main() {\n  int m, i, j, k, a[26], sum = 0;\n  for (j = 0; j < 26; j++)\n    a[j] = 0;\n  char aut;\n  scanf(\"%d\", &m);\n  struct book *head, *pb1, *pb2;\n  head = NULL;\n  for (i = 0; i < m; i++) {\n    pb1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d %s\", &pb1->num, pb1->author);\n    for (j = 0; pb1->author[j] != '\\0'; j++) {\n      k = pb1->author[j] - 'A';\n      a[k] += 1;\n    }\n    if (head == NULL) {\n      head = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    } else {\n      pb2->next = pb1;\n      pb2 = pb1;\n      pb2->next = NULL;\n    }\n  }\n  for (j = 0; j < 26; j++) {\n    if (a[j] > sum) {\n      sum = a[j], k = j;\n    }\n  }\n  aut = (char)('A' + k);\n  printf(\"%c\\n\", aut);\n  printf(\"%d\\n\", sum);\n  pb1 = head;\n  while (pb1) {\n    for (j = 0; pb1->author[j] != '\\0'; j++)\n      if (pb1->author[j] == aut)\n        printf(\"%d\\n\", pb1->num);\n    pb1 = pb1->next;\n  }\n}\n"}
{"label": "2", "index": "3592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, d[1000];\n  char zuo[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  char s[1000][26], len;\n  int sum[26] = {0}, k;\n  for (i = 0; i < n; i++) {\n    cin >> d[i] >> s[i];\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      for (k = 0; k < 26; k++) {\n        if (s[i][j] == 'A' + k)\n          sum[k]++;\n      }\n    }\n  }\n  int max = 0, count = 0;\n  char maxid;\n  for (i = 0; i < 26; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      maxid = i + 'A';\n    }\n  }\n  printf(\"%c\\n%d\\n\", maxid, max);\n  int t[1000];\n  for (i = 0; i < n; i++) {\n    len = strlen(s[i]);\n    for (j = 0; j < len; j++) {\n      if (s[i][j] == maxid) {\n        count++;\n        t[count] = d[i];\n      }\n    }\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"%d\\n\", t[i]);\n  return 0;\n}\n"}
{"label": "2", "index": "3593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct books {\n  int num;\n  char name[100];\n  struct books *next;\n};\nstruct books *create(int n) {\n  struct books *head, *p1, *p2;\n  p1 = (struct books *)malloc(1000);\n  scanf(\"%d %s\", &p1->num, p1->name);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  while (--n) {\n    p1 = (struct books *)malloc(1000);\n    scanf(\"%d %s\", &p1->num, p1->name);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  int n, i, max, k;\n  char *p;\n  int num[26] = {0};\n  char name[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                   'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  struct books *p1, *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  p1 = head;\n  for (i = 0; i < 26; i++) {\n    p1 = head;\n    p = p1->name;\n    do {\n\n      if (*p == name[i]) {\n        num[i]++;\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        if (*p == '\u0000') {\n          p1 = p1->next;\n          p = p1->name;\n        } else {\n          p++;\n        }\n      }\n    } while (p1 != NULL);\n  }\n  max = num[0];\n  for (i = 0; i < 26; i++) {\n    if (num[i] >= max) {\n      k = i;\n      max = num[i];\n    }\n  }\n  cout << name[k] << \" \";\n  cout << num[k] << \" \";\n  p1 = head;\n  p = p1->name;\n  while (p1 != NULL) {\n\n    if (*p == name[k]) {\n      cout << p1->num << \" \";\n      p1 = p1->next;\n      p = p1->name;\n    } else {\n      if (*p == '\u0000') {\n        p1 = p1->next;\n        p = p1->name;\n      } else {\n        p++;\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3594", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp;\n  int author[27][500] = {\n      0,\n  };\n  char str[1000];\n  cin >> num;\n  for (int i = 1; i <= num; i++) {\n    cin >> temp;\n    getchar();\n    cin >> str;\n    for (int j = 0; j < strlen(str); j++) {\n      author[str[j] - 'A' + 1][0]++;\n      author[str[j] - 'A' + 1][author[str[j] - 'A' + 1][0]] = temp;\n    }\n  }\n  int temp_num = 0, temp_author;\n  for (int i = 1; i <= 26; i++) {\n    if (author[i][0] > temp_num) {\n      temp_num = author[i][0];\n      temp_author = i;\n    }\n  }\n  cout << (char)(temp_author + 'A' - 1) << endl;\n  cout << temp_num << endl;\n  for (int i = 1; i <= temp_num; i++) {\n    cout << author[temp_author][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t[27], max;\n  char p, a[100][27], b[100][27];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 26; i++)\n    t[i] = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%s\", a[i], b[i]);\n  for (p = 'A'; p <= 'Z'; p++)\n    for (i = 1; i <= n; i++)\n      if (strchr(b[i], p))\n        t[p - 'A' + 1]++;\n  max = 1;\n  for (i = 2; i <= 26; i++)\n    if (t[max] < t[i])\n      max = i;\n  printf(\"%c\\n\", p = 'A' + max - 1);\n  printf(\"%d\\n\", t[p - 'A' + 1]);\n  for (i = 1; i <= n; i++)\n    if (strchr(b[i], p))\n      printf(\"%s\\n\", a[i]);\n}\n"}
{"label": "2", "index": "3596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t = 0, m, i, j, n, k, a[999], c[26] = {0};\n  char b[999][999];\n  scanf(\"%d\\n\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d %s\", &a[i], b[i]);\n  for (i = 0; i < m; i++) {\n    k = strlen(b[i]);\n    for (j = 0; j < k; j++)\n      c[b[i][j] - 'A']++;\n  }\n  for (j = 0; j < 26; j++) {\n    if (t < c[j])\n      t = c[j];\n  }\n  for (i = 0; i < 26; i++) {\n    if (c[i] == t) {\n      printf(\"%c\\n\", i + 'A');\n      break;\n    }\n  }\n  printf(\"%d\\n\", t);\n  for (j = 0; j < m; j++) {\n    k = strlen(b[j]);\n    for (n = 0; n < k; n++) {\n      if ((b[j][n] - 'A') == i)\n        printf(\"%d\\n\", a[j]);\n    }\n  }\n}\n"}
{"label": "2", "index": "3597", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct book {\n    short int a;\n    char s[27];\n  } b[999];\n  short int q[26] = {0};\n  short int w[26] = {0}, p, t, m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].a, b[i].s);\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      p = (int)b[i].s[j] - 65;\n      q[p]++;\n      w[p]++;\n    }\n\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++)\n      if (q[j] < q[j + 1]) {\n        t = q[j];\n        q[j] = q[j + 1];\n        q[j + 1] = t;\n      }\n  for (i = 0; i < 25; i++)\n\n    if (w[i] == q[0])\n      m = i;\n  printf(\"%c\\n\", (char)(m + 65));\n  printf(\"%d\\n\", w[m]);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++)\n      if (b[i].s[j] == m + 65)\n        printf(\"%d\\n\", b[i].a);\n  return 0;\n}\n"}
{"label": "2", "index": "3598", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  char zz[20];\n  struct student *next;\n};\n\nstruct student *New(int n) {\n  struct student *head = NULL;\n  struct student *newp, *thisp;\n\n  int i = 0;\n\n  do {\n    newp = (struct student *)malloc(sizeof(struct student));\n    if (newp == NULL) {\n      printf(\"request failed\\n\");\n      exit(-1);\n    }\n    cin >> newp->num >> newp->zz;\n    if (i == 0) {\n      head = newp;\n      thisp = head;\n    } else\n      thisp->next = newp;\n    if (i < n) {\n      thisp = newp;\n      i = i + 1;\n    }\n  } while (i < n);\n  thisp->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j;\n  int n;\n  int t1 = 0, t2;\n  int length;\n  char target[1000] = {' '};\n  char mz = ' ';\n\n  struct student *head, *p;\n\n  scanf(\"%d\", &n);\n\n  head = New(n);\n  p = head;\n\n  i = 0;\n  do {\n    if (i == 0) {\n      strcpy(target, p->zz);\n    } else {\n      p = p->next;\n      strcat(target, p->zz);\n    }\n\n    i += 1;\n  } while (p->next != NULL);\n\n  length = strlen(target);\n  for (i = 0; i < length; i++) {\n    t2 = 0;\n    if (target[i] == '0')\n      continue;\n    else {\n      for (j = i + 1; j < length; j++) {\n        if (target[j] == target[i]) {\n          target[j] = '0';\n          t2 += 1;\n        }\n      }\n      if (t2 > t1) {\n        t1 = t2;\n        mz = target[i];\n      }\n    }\n  }\n\n  printf(\"%c\\n%d\", mz, t1 + 1);\n\n  p = head;\n  do {\n    length = strlen(p->zz);\n    for (i = 0; i < length; i++) {\n      if ((p->zz[i]) == mz) {\n        printf(\"\\n%d\", p->num);\n      }\n    }\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "2", "index": "3599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n    int zzsl;\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n  \n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n    p1->zzsl = strlen(p1->zz);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i; \n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  zzzdnum = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, temp;\n  int author[27][500] = {\n      0,\n  };\n  char str[1000];\n  cin >> num;\n  for (int i = 1; i <= num; i++) {\n    cin >> temp;\n    getchar();\n    cin >> str;\n    for (int j = 0; j < strlen(str); j++) {\n      author[str[j] - 'A' + 1][0]++;\n      author[str[j] - 'A' + 1][author[str[j] - 'A' + 1][0]] = temp;\n    }\n  }\n  int temp_num = 0, temp_author;\n  for (int i = 1; i <= 26; i++) {\n    if (author[i][0] > temp_num) {\n      temp_num = author[i][0];\n      temp_author = i;\n    }\n  }\n  cout << (char)(temp_author + 'A' - 1) << endl;\n  cout << temp_num << endl;\n  for (int i = 1; i <= temp_num; i++) {\n    cout << author[temp_author][i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int a;\n  char b[30];\n  struct book *next;\n};\nint main() {\n  int i, k, m, max = 0, t;\n  char j, ch;\n  struct book *head, *p1, *p2;\n  scanf(\"%d\", &m);\n  p1 = (struct book *)calloc(1, sizeof(struct book));\n  head = p1;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &(p1->a), p1->b);\n    p2 = p1;\n    if (i == m - 1)\n      p2->next = NULL;\n    else {\n      p1 = (struct book *)calloc(1, sizeof(struct book));\n      p2->next = p1;\n    }\n  }\n  for (j = 'A'; j <= 'Z'; j++) {\n    t = 0;\n    p1 = head;\n    while (p1) {\n      for (k = 0; k < strlen(p1->b); k++)\n        if ((p1->b)[k] == j)\n          t++;\n      p1 = p1->next;\n    }\n    if (t > max) {\n      max = t;\n      ch = j;\n    }\n  }\n  printf(\"%c\\n\", ch);\n  printf(\"%d\\n\", max);\n  p1 = head;\n  while (p1) {\n    for (k = 0; k < strlen(p1->b); k++)\n      if ((p1->b)[k] == ch)\n        printf(\"%d\\n\", p1->a);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  int a;\n  char b[26];\n} shu[1000];\n\nint main() {\n  int s[27];\n  int n, i, j, o, max, t = 1, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &shu[i].a, shu[i].b);\n\n  for (i = 1; i <= 26; i++)\n    s[i] = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < strlen(shu[i].b); j++) {\n      o = shu[i].b[j] - 64;\n      s[o]++;\n    }\n\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (max < s[i]) {\n      max = s[i];\n      t = i;\n    }\n  cout << t + 64 << \"\\n\";\n  printf(\"%d\\n\", max);\n\n  for (i = 0; i < n; i++) {\n    x = strlen(shu[i].b);\n    for (j = 0; j < x; j++)\n      if (shu[i].b[j] == t + 64)\n        cout << shu[i].a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3603", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int array[26]) {\n  int i, max = 0;\n  for (i = 0; i < 26; i++)\n    if (array[i] > max)\n      max = array[i];\n  for (i = 0; i < 26; i++)\n    if (max == array[i])\n      break;\n  return i;\n}\nint main() {\n  struct book {\n    int num;\n    char aut[26];\n  };\n  int a, i, j, m, k, t[26] = {0};\n  struct book nbook[999];\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    cin >> nbook[i].num >> nbook[i].aut;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      for (k = 0; k < 26; k++)\n        if (nbook[i].aut[j] == k + 65)\n          t[k]++;\n  a = max(t);\n  printf(\"%c\\n%d\\n\", a + 65, t[a]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < 26; j++)\n      if (nbook[i].aut[j] == a + 65)\n        printf(\"%d\\n\", nbook[i].num);\n}\n"}
{"label": "2", "index": "3604", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len[1000];\n  int b[26];\n  int a[1000];\n  char str[1000][26];\n  int m, i, j, max, num;\n  char c;\n  int pos, temp;\n\n  scanf(\"%d\", &m);\n  for (i = 0; i < 26; i++)\n    b[i] = 0;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    scanf(\"%s\", str[i]);\n    len[i] = strlen(str[i]);\n    for (j = 0; j < len[i]; j++) {\n      temp = str[i][j] - 'A';\n      b[temp]++;\n    }\n  }\n\n  max = b[0];\n  pos = 0;\n  for (i = 1; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      pos = i;\n    }\n  }\n  c = pos + 'A';\n  printf(\"%c\\n\", c);\n  printf(\"%d\\n\", max);\n  num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (str[i][j] == c) {\n        num++;\n        if (num < max)\n          printf(\"%d\\n\", a[i]);\n        else\n          printf(\"%d\", a[i]);\n      }\n}\n"}
{"label": "2", "index": "3605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, m, i, max = 0, n, count[26] = {0};\n  char b;\n  struct book {\n    int id;\n    char author[26];\n  } book[1024];\n  char *p = &book[0].author[0];\n  char *q;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n  }\n  \n  for (i = 0; i < m; i++)\n\n    for (p = book[i].author; *p != '\\0'; p++) {\n      a = *p;\n      count[a - 65]++;\n    }\n  for (i = 0; i < 26; i++) {\n    if (max < count[i]) {\n      max = count[i];\n      b = 'A' + i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", b, max);\n\n  for (i = 0; i < m; i++) {\n    for (q = book[i].author; *q != '\\0'; q++) {\n      if (*q == b)\n        printf(\"%d\\n\", book[i].id);\n    }\n  }\n}\n"}
{"label": "2", "index": "3606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct b {\n    int num;\n    char str[27];\n  } b[100];\n  int n, i, m, j, max, nmax;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &b[i].num, b[i].str);\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++)\n      a[b[i].str[j] - 65]++;\n  }\n  max = a[0];\n  nmax = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      nmax = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", nmax + 65, max);\n  for (i = 0; i < n; i++) {\n    m = strlen(b[i].str);\n    for (j = 0; j < m; j++) {\n      if (b[i].str[j] == nmax + 65)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[27] = {0}, no[27][1000] = {0};\n  char s[27], ls;\n  int l, i, max, t, j, flag, n, w;\n  cin >> t;\n  for (i = 1; i <= t; i++) {\n    cin >> n >> s;\n    l = strlen(s);\n    for (j = 0; j <= l - 1; j++) {\n      w = s[j] - 'A' + 1;\n      num[w]++;\n      no[w][num[w]] = n;\n    }\n  }\n  max = 0;\n  for (i = 1; i <= 26; i++)\n    if (num[i] > max) {\n      max = num[i];\n      flag = i;\n    }\n  ls = (char)64 + flag;\n  cout << ls << \"\\n\" << num[flag] << \"\\n\";\n  for (i = 1; i <= num[flag]; i++)\n    cout << no[flag][i] << endl;\n  scanf(\"%d \", &w);\n  return 0;\n}\n"}
{"label": "2", "index": "3608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  char name[20];\n  int num;\n} book[1000];\n\nint main() {\n  int n, i, j, max = 0, m = 0;\n  scanf(\"%d\", &n);\n  int c[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d %s\", &book[i].num, book[i].name);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 26; j++)\n      strchr(book[i].name, 'A' + j) ? c[j]++ : 0;\n  }\n  for (j = 0; j < 26; j++) {\n    if (c[j] > max) {\n      max = c[j];\n      m = j;\n    }\n  }\n  cout << 'A' + m << \"\\n\" << c[m] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    strchr(book[i].name, 'A' + m) ? printf(\"%d\\n\", book[i].num) : 0;\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char author[27];\n} book[1000];\n\nint main() {\n  int m, i, j, k;\n  char s[26];\n  int w[26] = {0};\n  int len[1000];\n  int max, most;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  for (i = 0; i < 26; i++) {\n    s[i] = 'A' + i;\n  }\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      for (k = 0; k < 26; k++) {\n        if (book[i].author[j] == s[k])\n          w[k]++;\n      }\n    }\n  }\n  max = w[0];\n  most = 0;\n  for (i = 0; i < 26; i++) {\n    if (w[i] > max) {\n      max = w[i];\n      most = i;\n    }\n  }\n  printf(\"%c\\n%d\\n\", s[most], max);\n  for (i = 0; i < m; i++) {\n    len[i] = strlen(book[i].author);\n    for (j = 0; j < len[i]; j++) {\n      if (book[i].author[j] == s[most]) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3610", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  int num;\n  char writer[26];\n  struct book *next;\n};\nint main() {\n  int n, i, j, a[26] = {0}, max, temp;\n  char c;\n  struct book *p, *head, *tail;\n  cin >> n;\n  head = NULL;\n  tail = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct book *)malloc(1000);\n    cin >> p->num >> p->writer;\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n  }\n  for (c = 'A'; c <= 'Z'; c++) {\n    for (i = 0, p = head; i < n; i++, p = p->next) {\n      for (j = 0; p->writer[j] != '\u0000'; j++)\n        if (p->writer[j] == c)\n          a[c - 'A']++;\n    }\n  }\n  max = a[0];\n  for (i = 0; i < 26; i++)\n    if (a[i] > max)\n      max = a[i];\n  for (i = 0; i < 26; i++)\n    if (a[i] == max)\n      break;\n  c = i + 'A';\n  printf(\"%c \", c);\n  printf(\"%d \", a[i]);\n  for (i = 0, p = head; i < n; i++, p = p->next) {\n    for (j = 0; p->writer[j] != '\u0000'; j++)\n      if (p->writer[j] == c) {\n        printf(\"%d \", p->num);\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  short int num;\n  char author[27];\n};\n\nint main() {\n  char findoutmax(struct info a[], int n, int *pt);\n  void detect(struct info b[], char writter, int nn);\n  char figure;\n  int i, n_book, max, *p;\n  struct info book[999];\n  scanf(\"%d\", &n_book);\n  for (i = 0; i < n_book; i++)\n    scanf(\"%d %s\", &book[i].num, &book[i].author);\n\n  p = &max;\n  figure = findoutmax(book, n_book, p);\n  printf(\"%c\\n%d\\n\", figure, max);\n  detect(book, figure, n_book);\n  return 0;\n}\n\nchar findoutmax(struct info a[], int n, int *pt) {\n  int i, j, sum[26] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i].author[j] != '\\0'; j++) {\n      switch (a[i].author[j]) {\n      case 'A':\n        sum[0] = sum[0] + 1;\n        break;\n      case 'B':\n        sum[1] = sum[1] + 1;\n        break;\n      case 'C':\n        sum[2] = sum[2] + 1;\n        break;\n      case 'D':\n        sum[3] = sum[3] + 1;\n        break;\n      case 'E':\n        sum[4] = sum[4] + 1;\n        break;\n      case 'F':\n        sum[5] = sum[5] + 1;\n        break;\n      case 'G':\n        sum[6] = sum[6] + 1;\n        break;\n      case 'H':\n        sum[7] = sum[7] + 1;\n        break;\n      case 'I':\n        sum[8] = sum[8] + 1;\n        break;\n      case 'J':\n        sum[9] = sum[9] + 1;\n        break;\n      case 'K':\n        sum[10] = sum[10] + 1;\n        break;\n      case 'L':\n        sum[11] = sum[11] + 1;\n        break;\n      case 'M':\n        sum[12] = sum[12] + 1;\n        break;\n      case 'N':\n        sum[13] = sum[13] + 1;\n        break;\n      case 'O':\n        sum[14] = sum[14] + 1;\n        break;\n      case 'P':\n        sum[15] = sum[15] + 1;\n        break;\n      case 'Q':\n        sum[16] = sum[16] + 1;\n        break;\n      case 'R':\n        sum[17] = sum[17] + 1;\n        break;\n      case 'S':\n        sum[18] = sum[18] + 1;\n        break;\n      case 'T':\n        sum[19] = sum[19] + 1;\n        break;\n      case 'U':\n        sum[20] = sum[20] + 1;\n        break;\n      case 'V':\n        sum[21] = sum[21] + 1;\n        break;\n      case 'W':\n        sum[22] = sum[22] + 1;\n        break;\n      case 'X':\n        sum[23] = sum[23] + 1;\n        break;\n      case 'Y':\n        sum[24] = sum[24] + 1;\n        break;\n      case 'Z':\n        sum[25] = sum[25] + 1;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i < 26; i++) {\n    if (sum[j] < sum[i]) {\n      j = i;\n    }\n  }\n  *pt = sum[j];\n  return (65 + j);\n}\n\nvoid detect(struct info b[], char writter, int nn) {\n  int i, j;\n  for (i = 0; i < nn; i++) {\n    for (j = 0; b[i].author[j] != '\\0'; j++) {\n      if (b[i].author[j] == writter)\n        printf(\"%d\\n\", b[i].num);\n    }\n  }\n}\n"}
{"label": "2", "index": "3612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct jisuan {\n  int num;\n  char name[26];\n} book[1000];\nint main() {\n  int i, j, m, n, k, e;\n  int count[26] = {0}, author[26];\n  cin >> m;\n  for (i = 0; i < 26; i++)\n    author[i] = 65 + i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &book[i].num);\n\n    cin >> book[i].name;\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    for (j = 0; j < m; j++) {\n      n = strlen(book[j].name);\n      for (k = 0; k < n; k++) {\n        if (i == book[j].name[k])\n          count[i - 65]++;\n      }\n    }\n  }\n  for (i = 0; i < 25; i++) {\n    if (count[i] > count[i + 1]) {\n      e = count[i];\n      count[i] = count[i + 1];\n      count[i + 1] = e;\n      e = author[i];\n      author[i] = author[i + 1];\n      author[i + 1] = e;\n    }\n  }\n  printf(\"%c %d \", author[25], count[25]);\n  for (i = 0; i < m; i++) {\n    n = strlen(book[i].name);\n    for (k = 0; k < n; k++) {\n      if (book[i].name[k] == author[25])\n        printf(\"%d \", book[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3613", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, j, k, id[1001], a[26] = {0};\n  char c[1001][26],\n      b[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n               'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    cin >> id[j] >> c[j];\n  }\n  for (m = 0; m < 26; m++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 0; k < 26; k++) {\n        if (b[m] == c[j][k])\n          a[m] = a[m] + 1;\n      }\n    }\n  }\n  int t = 0, r = 0;\n  for (m = 0; m <= 25; m++) {\n    if (t < a[m]) {\n      t = a[m];\n      r = m;\n    }\n  }\n  printf(\"%c %d\", b[r], a[r]);\n  for (j = 1; j <= n; j++) {\n    for (k = 0; k < 26; k++) {\n      if (c[j][k] == b[r]) {\n        printf(\" %d\", id[j]);\n      }\n    }\n  }\n}\n"}
{"label": "2", "index": "3614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, t, len, a[26][1000] = {0}, n[26] = {0}, max = 0, num;\n  int i, j;\n  char s[27];\n\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &t, s);\n    len = strlen(s);\n    for (j = 0; j < len; j++) {\n      n[s[j] - 65]++;\n      a[s[j] - 65][i] = t;\n    }\n  }\n\n  for (j = 0; j < 26; j++) {\n    if (n[j] > max) {\n      max = n[j];\n      num = j;\n    }\n  }\n\n  printf(\"%c %d \", num + 65, n[num]);\n\n  for (i = 0; i < m; i++) {\n    if (a[num][i] != 0)\n      cout << a[num][i] << \" \";\n  }\n}\n"}
{"label": "2", "index": "3615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct book {\n  char num[500];\n  char s[50];\n  struct book *next;\n};\nint main() {\n  struct book *head;\n  struct book *p1, *p2;\n  int m, mi, i, j, k, max, found;\n  int aut[26] = {0};\n  cin >> m;\n  p1 = (struct book *)malloc(1000);\n  cin >> p1->num >> p1->s;\n  for (i = 0; i < strlen(p1->s); i++)\n    aut[(p1->s)[i] - 'A']++;\n  p1->next = NULL;\n\n  head = p2 = p1;\n\n  for (mi = 2; mi <= m; mi++) {\n    p1 = (struct book *)malloc(1000);\n    scanf(\"%s %s\", p1->num, p1->s);\n    for (i = 0; i < strlen(p1->s); i++)\n      aut[(p1->s)[i] - 'A']++;\n\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  max = 0;\n  for (i = 0; i < 26; i++)\n    if (aut[i] > max) {\n      k = i;\n      max = aut[i];\n    }\n\n  cout << k + 65 << \" \";\n  printf(\"%d \", aut[k]);\n\n  p1 = head;\n  for (i = 1; i <= m; i++) {\n    found = 0;\n    for (j = 0; j < strlen(p1->s); j++)\n      if ((p1->s)[j] == k + 65) {\n        found = 1;\n        break;\n      }\n    if (found == 1)\n      printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, d, i, j, l;\n  struct a {\n    char name[27];\n    int c;\n  } m[1000];\n  struct b {\n    int num, book[1000];\n    char t;\n  };\n  struct b author[27];\n  for (i = 1; i <= 26; i++) {\n    author[i].t = i + 64;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m[i].c;\n    scanf(\"%s\", m[i].name);\n  }\n  for (i = 1; i <= n; i++) {\n    l = strlen(m[i].name);\n    for (j = 0; j <= l - 1; j++) {\n      d = m[i].name[j] - 64;\n      author[d].num++;\n      author[d].book[author[d].num] = m[i].c;\n    }\n  }\n  for (i = 1; i <= 25; i++) {\n    if (author[i].num > author[i + 1].num)\n      author[i + 1] = author[i];\n  }\n  printf(\"%c\\n\", author[26].t);\n  printf(\"%d\\n\", author[26].num);\n  for (i = 1; i <= author[26].num; i++) {\n    printf(\"%d\\n\", author[26].book[i]);\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct book {\n  int num;\n  char name[27];\n  struct book *next;\n};\nint main() {\n  struct book *p1, *p2, *head = NULL;\n  int i, j, n, m, k, a[26], max, first;\n  scanf(\"%d\", &m);\n\n  for (i = 0; i < m; i++) {\n    p1 = (struct book *)malloc(sizeof(struct book));\n    scanf(\"%d%s\", &p1->num, p1->name);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 0; i < 26; i++)\n    a[i] = 0;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      k = p1->name[j] - 'A';\n      a[k]++;\n    }\n    p1 = p1->next;\n  }\n\n  max = a[0];\n  first = 0;\n  for (k = 1; k < 26; k++) {\n    if (a[k] > max) {\n      max = a[k];\n      first = k;\n    }\n  }\n  printf(\"%c \", 'A' + first);\n  printf(\"%d \", max);\n\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    n = strlen(p1->name);\n    for (j = 0; j < n; j++) {\n      if (p1->name[j] == 'A' + first) {\n        printf(\"%d \", p1->num);\n        break;\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j;\n  char a = 'A';\n  int count[27] = {0};\n  int *p = &count[1];\n  cin >> num;\n  struct book {\n    char order[4];\n    char author[26];\n  } book[1000];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s\", book[i].order);\n    cin >> book[i].author;\n  }\n  for (i = 0; i < num; i++) {\n    int m = strlen(book[i].author);\n    for (j = 0; j < m; j++) {\n      if (book[i].author[j] == 'A')\n        count[1]++;\n      if (book[i].author[j] == 'B')\n        count[2]++;\n      if (book[i].author[j] == 'C')\n        count[3]++;\n      if (book[i].author[j] == 'D')\n        count[4]++;\n      if (book[i].author[j] == 'E')\n        count[5]++;\n      if (book[i].author[j] == 'F')\n        count[6]++;\n      if (book[i].author[j] == 'G')\n        count[7]++;\n      if (book[i].author[j] == 'H')\n        count[8]++;\n      if (book[i].author[j] == 'I')\n        count[9]++;\n      if (book[i].author[j] == 'J')\n        count[10]++;\n      if (book[i].author[j] == 'K')\n        count[11]++;\n      if (book[i].author[j] == 'L')\n        count[12]++;\n      if (book[i].author[j] == 'M')\n        count[13]++;\n      if (book[i].author[j] == 'N')\n        count[14]++;\n      if (book[i].author[j] == 'O')\n        count[15]++;\n      if (book[i].author[j] == 'P')\n        count[16]++;\n      if (book[i].author[j] == 'Q')\n        count[17]++;\n      if (book[i].author[j] == 'R')\n        count[18]++;\n      if (book[i].author[j] == 'S')\n        count[19]++;\n      if (book[i].author[j] == 'T')\n        count[20]++;\n      if (book[i].author[j] == 'U')\n        count[21]++;\n      if (book[i].author[j] == 'V')\n        count[22]++;\n      if (book[i].author[j] == 'W')\n        count[23]++;\n      if (book[i].author[j] == 'X')\n        count[24]++;\n      if (book[i].author[j] == 'Y')\n        count[25]++;\n      if (book[i].author[j] == 'Z')\n        count[26]++;\n    }\n  }\n  for (i = 1; i < 27; i++) {\n    if (count[i] > *p) {\n      p = &count[i];\n      a = i + 64;\n    }\n  }\n  cout << a << \"\\n\" << *p << \"\\n\";\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == a)\n        printf(\"%s\\n\", book[i].order);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3619", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct {\n    int num;\n    char author[26];\n  } book[1000];\n  int shu_num[26], i, j, k, n, max, length;\n  char max_author;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].author);\n  }\n  for (k = 0; k < 26; k++) {\n    shu_num[k] = 0;\n  }\n  for (k = 0; k < 26; k++) {\n    for (i = 0; i < n; i++) {\n      length = strlen(book[i].author);\n      for (j = 0; j < length; j++) {\n        if (book[i].author[j] == 'A' + k) {\n          shu_num[k]++;\n        }\n      }\n    }\n  }\n  max = shu_num[0];\n  max_author = 'A';\n  for (k = 0; k < 26; k++) {\n    if (shu_num[k] > max) {\n      max = shu_num[k];\n      max_author = 'A' + k;\n    }\n  }\n  printf(\"%c\\n%d\\n\", max_author, max);\n  for (i = 0; i < n; i++) {\n    length = strlen(book[i].author);\n    for (j = 0; j < length; j++) {\n      if (book[i].author[j] == max_author) {\n        printf(\"%d\\n\", book[i].num);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, len[1000], sum[26] = {0}, max, i, j, i0;\n  scanf(\"%d\", &m);\n  struct book {\n    int num;\n    char wri[27];\n  } book[1000];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d %s\", &book[i].num, book[i].wri);\n    len[i] = strlen(book[i].wri);\n  }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      sum[book[i].wri[j] - 65]++;\n  max = sum[0];\n  i0 = 0;\n  for (i = 1; i < 26; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      i0 = i;\n    }\n  printf(\"%d\\n\", i0 + 65);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < len[i]; j++)\n      if (book[i].wri[j] == 65 + i0) {\n        cout << book[i].num << \"\\n\";\n        break;\n      }\n  return 0;\n}\n"}
{"label": "2", "index": "3621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ts {\n    int sl;\n    char zz[30];\n    int zzsl;\n    struct ts *next;\n  };\n  struct ts *p1, *p2, *head;\n  int i, j, k, m, n, max, zzzdnum, num[100] = {0};\n  char zzzd;\n  cin >> n;\n  p1 = p2 = head = (struct ts *)malloc(sizeof(struct ts));\n  scanf(\"%d %s\", &p1->sl, p1->zz);\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct ts *)malloc(sizeof(struct ts));\n    scanf(\"%d %s\", &p1->sl, p1->zz);\n    p1->zzsl = strlen(p1->zz);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    p1 = head;\n    for (k = 0; k < n; k++) {\n      for (j = 0; p1->zz[j] != '\\0'; j++) {\n        if (p1->zz[j] == i)\n          num[i]++;\n      }\n      p1 = p1->next;\n    }\n  }\n  max = 0;\n  for (i = 'A'; i <= 'Z'; i++) {\n    max = max > num[i] ? max : num[i];\n  }\n  for (i = 'A'; i <= 'Z'; i++) {\n    if (num[i] == max)\n      zzzd = i;\n  }\n  printf(\"%c\\n%d\\n\", zzzd, max);\n  p1 = head;\n  zzzdnum = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; p1->zz[j] != '\\0'; j++) {\n      if (p1->zz[j] == zzzd) {\n        printf(\"%d\\n\", p1->sl);\n      }\n    }\n    p1 = p1->next;\n  }\n}\n"}
{"label": "2", "index": "3622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Book {\n  int id;\n  char author[26];\n  int flag;\n} book[1000];\nint main() {\n  int n, i, j, l, max, maxnum;\n  int num = 0;\n  int a[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %s\", &book[i].id, book[i].author);\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      a[book[i].author[j] - 65]++;\n  }\n  max = 0;\n  maxnum = 0;\n  for (i = 0; i < 26; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      maxnum = i;\n    }\n  }\n  cout << maxnum + 65 << \"\\n\";\n  for (i = 0; i < n; i++) {\n    book[i].flag = 0;\n    l = strlen(book[i].author);\n    for (j = 0; j < l; j++)\n      if (book[i].author[j] == maxnum + 65) {\n        num++;\n        book[i].flag = 1;\n        break;\n      }\n  }\n  printf(\"%d\\n\", num);\n  for (i = 0; i < n; i++)\n    if (book[i].flag == 1)\n      printf(\"%d\\n\", book[i].id);\n  return 0;\n}\n"}
{"label": "2", "index": "3623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, t, g, max;\n  char q;\n  int d[26];\n  struct {\n    int a;\n    char b[26];\n\n  } s[999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &s[i].a, s[i].b);\n\n  for (i = 0; i < 26; i++) {\n    d[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      t = s[i].b[j] - 'A';\n      d[t]++;\n    }\n  }\n  max = 0;\n  for (j = 0; j < 25; j++) {\n    if (d[j] > max) {\n      max = d[j];\n      g = j;\n    }\n  }\n  q = 'A' + g;\n  printf(\"%c\\n%d\\n\", q, max);\n\n  for (i = 0; i < n; i++) {\n    m = strlen(s[i].b);\n    for (j = 0; j < m; j++) {\n      if (s[i].b[j] - 'A' == g)\n        printf(\"%d\\n\", s[i].a);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "2", "index": "3624", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct {\n    int name;\n    char author[26];\n  } book[999];\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%s\", &book[i].name, book[i].author);\n\n  char t, tmax;\n  int max = 0, j, k;\n  for (t = 'A'; t <= 'Z'; t++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < strlen(book[i].author); j++) {\n        if (book[i].author[j] == t) {\n          k++;\n        }\n      }\n    }\n    if (k > max) {\n      max = k;\n      tmax = t;\n    }\n  }\n  printf(\"%c\\n%d\\n\", tmax, max);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < strlen(book[i].author); j++) {\n      if (book[i].author[j] == tmax) {\n        printf(\"%d\\n\", book[i].name);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "2", "index": "3625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct book {\n    short int a;\n    char s[27];\n  } b[999];\n  short int q[26] = {0};\n  short int w[26] = {0}, p, t, m;\n  for (i = 0; i < n; i++) {\n    cin >> b[i].a >> b[i].s;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++) {\n      p = (int)b[i].s[j] - 65;\n      q[p]++;\n      w[p]++;\n    }\n\n  for (i = 0; i < 25; i++)\n    for (j = 0; j < 25 - i; j++)\n      if (q[j] < q[j + 1]) {\n        t = q[j];\n        q[j] = q[j + 1];\n        q[j + 1] = t;\n      }\n  for (i = 0; i < 25; i++)\n\n    if (w[i] == q[0])\n      m = i;\n  printf(\"%c\\n\", (char)(m + 65));\n  printf(\"%d\\n\", w[m]);\n  for (i = 0; i < n; i++)\n    for (j = 0; b[i].s[j] != '\\0'; j++)\n      if (b[i].s[j] == m + 65)\n        cout << b[i].a << \"\\n\";\n  return 0;\n}\n"}
{"label": "2", "index": "3626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int m, i, j, k, num[10000], max = 0, t = 0;\n  char a[10000][26];\n  char c[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',\n                'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &num[i]);\n    scanf(\"%s\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      for (k = 0; k < 26; k++) {\n        if (a[i][j] == c[k])\n          b[k]++;\n      }\n    }\n  }\n  for (i = 0; i < 26; i++) {\n    if (b[i] > max) {\n      max = b[i];\n      t = i;\n    }\n  }\n  printf(\"%c\\n\", c[t]);\n  printf(\"%d\\n\", max);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < 26; j++) {\n      if (a[i][j] == c[t]) {\n        printf(\"%d\\n\", num[i]);\n        break;\n      }\n    }\n  }\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "3", "index": "3627", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[10000][256];\nint main() {\n  int n, k;\n  int i, j;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\\n\");\n        goto end;\n      }\n      if (i == n - 1 && j == n - i - 1)\n        printf(\"no\\n\");\n    }\nend:;\n}\n"}
{"label": "3", "index": "3628", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, s, i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (i != j)) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\\n\");\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3629", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int s = 0;\n  cin >> n;\n  cin >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int z = 0; z < n; z++) {\n    for (j = z + 1; j < n; j++) {\n      if (a[z] + a[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n    if (a[z] + a[j] == k)\n      break;\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else if (s == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  int flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i] != a[j] && a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n  }\n  if (flag)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, k;\n  int t;\n  int d;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = i; j < n; j++) {\n      if (a[j] == t) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, z, a[1000];\n  scanf(\"%d%d\", &i, &k);\n  cin >> a[0];\n  a[0] = k - a[0];\n  for (j = 1; j <= i - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    for (z = 0; z <= j - 1; z++) {\n      if (a[j] == a[z]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    a[j] = k - a[j];\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  int a, b, c = 0;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int p = 0; p < n; p++) {\n    for (int i = 1; i <= n; i++) {\n      a = sz[p];\n      b = sz[i];\n      if (a + b == k) {\n        c += 1;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "3634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int j = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n\n      if (k == a[i] + a[j]) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  cout << \"no\" << endl;\n}\n"}
{"label": "3", "index": "3635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, e, m;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  a = 0;\n  for (i = 0; i < n - 1; i++) {\n    e = sz[i];\n    for (j = i + 1; j < n; j++) {\n      m = sz[j] + e;\n      if (m == k) {\n        a = 1;\n      }\n      if (a == 1)\n        break;\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  }\n  if (a == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum, n, a[1000], i, b[1000], j, p = 0, h = 0, k;\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (k = 0; k < n; k++) {\n    for (j = 0; j < n; j++) {\n      h = a[k] + b[j];\n      if (h == sum)\n        p++;\n    }\n  }\n  if (p == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[n];\n  int b[n];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    b[i - 1] = a[i - 1];\n  }\n  int c = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int t = i + 1; t <= n; t = t++) {\n      if ((a[i - 1] + b[t - 1]) == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (sz[i] + sz[j] == k) {\n        s = 1;\n        break;\n      } else\n        s = 0;\n    }\n    if (s == 1) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 2 && s == 0)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3639", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int xl[1000] = {0};\n  int n = 0, k = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d \", &k);\n  int i = 0, j = 0;\n  int a = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &xl[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      if (xl[i] + xl[j] == k) {\n        printf(\"%c%c%c\", 'y', 'e', 's');\n        a = 1;\n        break;\n      }\n    }\n    if (a == 1) {\n      break;\n    }\n  }\n  if (a == 0) {\n    printf(\"%c%c\", 'n', 'o');\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3640", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], q = 0, w = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  do {\n    for (int i = q + 1; i < n; i++) {\n      if (a[q] + a[i] == k) {\n        cout << \"yes\";\n        w++;\n        break;\n      }\n    }\n    q++;\n  } while (w != 1 && q < n - 1);\n  if (w == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int *p;\n  scanf(\"%d%d\", &n, &k);\n  p = (int *)malloc(sizeof(int) * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", (p + i));\n  }\n  int judge = 0;\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(p + i) + *(p + j) == k) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000];\n  cin >> n >> k;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (i != j && a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m;\n  int a[1000];\n  int i, j, flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        flag = 1;\n      else\n        continue;\n      break;\n    }\n  if (flag == 0)\n    printf(\"no\");\n  else if (flag == 1)\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "3644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000];\n  int i, j, flag = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(a + i) + *(a + j) == k) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n\n  if (flag)\n    printf(\"yes \");\n  else\n    cout << \"no \";\n}\n"}
{"label": "3", "index": "3645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[n];\n  int i, j;\n  int yes = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        yes = 1;\n      }\n    }\n  }\n  if (yes == 0) {\n    cout << \"no\";\n  }\n  if (yes == 1)\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  int dk[1000];\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &(dk[0]));\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &(dk[i]));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (dk[i] + dk[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n    a += 1;\n  }\n  if (a == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, b;\n  int sz[1000], zz[1000];\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  i = 0;\n  j = 0;\n  while (i < n && j < n) {\n    zz[j] = sz[i];\n    i++;\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      }\n      if (sz[i] + zz[j] == k) {\n        a = 1;\n      } else {\n        a = 0;\n      }\n      if (a == 1 || b == 1) {\n        b = 1;\n      } else {\n        b = 0;\n      }\n    }\n  }\n  if (b == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int h = 0; h < n; h++) {\n      if (sz[j] + sz[h] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, r, s, sh = 0;\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (r = 1; r <= n; r++) {\n    int e;\n    for (s = 0; s < n - r; s++) {\n      if (sz[s] > sz[s + 1]) {\n        e = sz[s + 1];\n        sz[s + 1] = sz[s];\n        sz[s] = e;\n      }\n    }\n  }\n  for (int y = 0; y < n; y++) {\n    if (sz[y] + sz[y] == k) {\n      sh = 0;\n    } else if (sz[y] + sz[y] > k) {\n      for (int w = 0; w < y; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    } else if (sz[y] + sz[y] < k) {\n      for (int w = y + 1; w <= n; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (sh == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint read();\nint find();\nint n, k, a[1000], m;\nint main() {\n  read();\n  m = find();\n  if (m == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\nint read() {\n  int i;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  return 0;\n}\nint find() {\n  int i, j;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        return 1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "3651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int he[1000][1000];\n  int j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        he[i][j] = sz[i] + sz[j];\n      }\n    }\n  }\n  int t = 0;\n  int d = 1;\n  for (j = 0; j < n && d == 1; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if (he[i][j] == k) {\n          printf(\"yes\");\n          d = 0;\n          break;\n        }\n      }\n      t++;\n    }\n  }\n  if (t == n * n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], b[1000], i, j, flag = 0;\n  cin >> n >> k;\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (a[i] + b[j] == k) {\n        flag = 1;\n        break;\n      }\n  printf(\" \");\n  if (flag == 1) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, m;\n  s = 0;\n  m = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      m = sz[i] + sz[j];\n      if (m == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j, l, m;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  l = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      else {\n        m = a[i] + a[j];\n        if (m == k) {\n          l++;\n          break;\n        }\n      }\n    }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3655", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, a[10000], n, k, f = 0, m;\n  cin >> n >> k;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 0; l <= n; l++) {\n    for (m = l + 1; m <= n; m++) {\n      if (a[l] + a[m] == k)\n        f = f + 1;\n    }\n  }\n  if (f != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], result = 0, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        result++;\n      }\n    }\n  }\n  if (result != 0) {\n    cout << \"yes\";\n  } else if (result == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, m, sc[500500], l;\n  scanf(\"%d %d\", &n, &k);\n  l = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (m = 1; m < n - i; m++) {\n      sc[l] = sz[i] + sz[m];\n      l = l + 1;\n    };\n  }\n  for (i = 0; i < l; i++) {\n    if (k == sc[i]) {\n      printf(\"yes\");\n      return 0;\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, sum, j, k, a[1000] = {0}, b[1000] = {0};\n  scanf(\"%d %d\", &n, &sum);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (k = j; k < n; k++) {\n      if ((a[j] + b[k]) == sum) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3659", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int j, sum = 0;\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i <= n - j - 1; i++) {\n      if (sz[j] + sz[j + i] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3660", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k)\n        break;\n    }\n    if (sz[i] + sz[j] == k) {\n      break;\n    }\n  }\n  if (sz[i] + sz[j] == k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, sum, j, k, a[1000] = {0}, b[1000] = {0};\n  scanf(\"%d %d\", &n, &sum);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (k = j; k < n; k++) {\n      if ((a[j] + b[k]) == sum) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a;\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], zs[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    zs[i] = sz[i];\n  }\n  a = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((zs[j] + sz[i]) == k) {\n        a = 1;\n        break;\n      }\n    }\n  }\n\n  if (a == 1) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n, k;\n  int *head, *p1, *p2;\n  scanf(\"%d%d\", &n, &k);\n  head = (int *)malloc(n * sizeof(int));\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p1);\n    p1++;\n  }\n  for (p1 = head; p1 < head + n; p1++) {\n    for (p2 = p1 + 1; p2 < head + n; p2++) {\n      if (*p1 + *p2 == k) {\n        printf(\"yes\");\n        j = 1;\n        break;\n      }\n    }\n    if (j)\n      break;\n  }\n  if (j == 0)\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "3664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, flag = 0, n, k, a[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      scanf(\"%d\", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (k == a[i] + a[j])\n        flag = 1;\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n - 1; i++) {\n    int isbreak = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        m = 1;\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c[1001], i, j, m = 1;\n  scanf(\"%d %d \", &a, &b);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < a; i++) {\n    if (m == 0)\n      break;\n    for (j = 0; j < a && j != i; j++) {\n      if (c[i] + c[j] == b) {\n        cout << \"yes\";\n        m = 0;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, b, c;\n  int sz[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int a = 0; a < n; a++) {\n    for (i = 0; i < n; i++) {\n      b = sz[a] + sz[i];\n      if (sz[a] + sz[i] == k) {\n        c++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (int i = 0; i < n - 1; i++) {\n    for (int s = i + 1; s < n; s++) {\n      if (sz[i] + sz[s] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[i] + sz[s] != k && i == n - 2) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "3669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j = 0, num, sum = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    a[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        num = 1;\n      else\n        num = 0;\n      sum = sum + num;\n    }\n  }\n  if (sum == 0)\n    cout << \"no\\n\";\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (p[i] + p[j] == k)\n        a = 1;\n    }\n  if (a == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "3671", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, m, n, k, a;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    a = k - sz[i];\n    for (m = 0; m < n; m++) {\n      if (sz[m] == a && m != i) {\n        printf(\"yes\");\n        goto L;\n      }\n    }\n  }\n  printf(\"no\");\nL:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "3672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[1000], y[1000], n, k, i, j, he, z = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    y[i] = x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = x[i] + y[j];\n      if (he == k)\n        z += 1;\n      else\n        z += 0;\n    }\n  }\n  if (z > 0)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, num;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &num);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (k = 0; k < n - 1; k++) {\n    for (i = 1; i < n - k; i++) {\n      if (a[k] + a[k + i] == num) {\n        goto done;\n      }\n    }\n  }\n\ndone:\n  if (k >= n - 1) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3674", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, n, k, b = 0;\n  int a[1001] = {0};\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b++;\n        break;\n      }\n      if (b != 0)\n        break;\n    }\n  if (b == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, j, x;\n  int k, n;\n  int m[1000], t;\n  scanf(\"%d%d\", &n, &x);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (m[i] + m[j] == x)\n        goto A;\n    }\n  }\nA:\n  if (i == n + 1)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, m, t;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[n - 1]);\n  m = 0;\n  t = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n      m++;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (m == n * (n - 1) / 2) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  int x = 0, y = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x = 1;\n        y = 1;\n      }\n      if (x == 1)\n        break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (x == 1)\n    cout << \"yes\";\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3678", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int xl[1000];\n  int i;\n  int result;\n  int a = 0, b = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &xl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      result = xl[i] + xl[j];\n      if (result == k) {\n        a++;\n      } else {\n        b++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3679", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int p = 0, s = 0, d = 0;\n  for (i = 0; i < n; i++) {\n    b[p] = a[i];\n    p++;\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        s++;\n        if (p == i)\n          d++;\n      }\n    }\n  }\n  if ((s - d) != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5000], n, i, t, m, c, I = 0, k;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (t = i - 1; t > 0; t--) {\n    for (c = 0; c < t; c++) {\n      if (a[c] > a[c + 1]) {\n        m = a[c];\n        a[c] = a[c + 1];\n        a[c + 1] = m;\n      }\n    }\n  }\n  m = 0;\n  for (I = 0; I < n - 1; I++) {\n    for (t = I + 1; t < n; t++) {\n      if (a[I] + a[t] == k) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"yes\");\n  if (m == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, l = 0, s[1000], h[1000][1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      h[i][j] = s[i] + s[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (h[i][j] == k) {\n        l = l + 1;\n      }\n    }\n  }\n  if (l > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3682", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, p = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        p = 1;\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n\n  if (p == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k, i, r, e = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i = i + 1) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i = i + 1) {\n    for (r = i + 1; r < n; r = r + 1) {\n      if (sz[i] + sz[r] == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  if (e == 1)\n    printf(\"yes\");\n  if (e == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, k, n, sz[1000], s[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    s[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      break;\n\n    for (m = n - 1; m >= i + 1; m--) {\n      if (s[m] + sz[i] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (s[m] + sz[i] == k) {\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint t[2000];\ndouble s[1000], si;\n\nint main() {\n  int i, j, n, m, s = 0;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n\n    scanf(\"%d\", &t[i]);\n\n  \n  \n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n\n      if (t[i] + t[j] == n)\n        s = 1;\n\n  s ? printf(\"yes\") : printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3686", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  s = a[1] + a[2];\n  for (i = 0; i < n; i++) {\n    if (s == k) {\n      break;\n    } else {\n      for (j = 0; j < n; j++) {\n        s = a[i] + a[j];\n        if (s == k)\n          break;\n        else\n          s = s;\n      }\n    }\n  }\n  if (s == k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, b, g;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] + a[m] == k) {\n        b = k;\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (i == n - 1 && b != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  j = 0;\n  c = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[j] = k - a[i];\n    j++;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c++;\n      }\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3689", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000000];\n  int i, j, n, k, m = 0, sum = 0, c;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n    }\n  }\n  for (c = 0; c < m; c++) {\n    if (b[c] == k) {\n      sum = sum + 1;\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3690", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], j, i, count = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        count = count + 1;\n    }\n  if (count == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000];\n  int i, j, flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(a + i) + *(a + j) == k) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag)\n    cout << \"yes \";\n  else\n    printf(\"no \");\n  return 0;\n}\n"}
{"label": "3", "index": "3692", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m = 0;\n  int a[1000];\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - i; j++)\n      if (a[i] + a[i + j] == k)\n        m++;\n\n  if (m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000] = {0}, flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\\n\";\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    cin >> sz[i];\n  }\n  if (i = n - 1) {\n    cin >> sz[i];\n  }\n  int r = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        r = 1;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (r == 1) {\n    printf(\"yes\");\n  } else if (r == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j, shu[1000], y[1000][1000], count = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shu[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      y[i][j] = shu[i] + shu[j];\n      if (y[i][j] == k)\n        count++;\n    }\n  }\n  if (count == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "3696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j, t;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        t = 0;\n        break;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int i;\n  int m;\n  int zzd[1001];\n  int hzy[1001];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &zzd[i]);\n\n  for (i = 0; i < n; i++) {\n    hzy[i] = zzd[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (zzd[m] + hzy[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == n - 1) {\n      cout << \"no\";\n      break;\n    }\n    if (zzd[m] + hzy[i] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b, x = 0, flag = 0, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          flag = 1;\n          break;\n        }\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000], f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j] && i != j && f == 0) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3700", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, num[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        n = 0;\n        break;\n      }\n    }\n    if (n == 0) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (n != 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n\n  int flag;\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag) {\n      break;\n    }\n  }\n  if (flag) {\n    cout << \"yes\";\n\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3702", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n  int num = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        num = num + 1;\n  if (num == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n}\n"}
{"label": "3", "index": "3703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, m;\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if (j == m)\n        printf(\"\");\n      else if (sz[j] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[j] + sz[m] == k) {\n      break;\n    }\n  }\n  if (j == n && m == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, n, j, e, l, k;\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  e = a[0];\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  l = 0;\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l++;\n      }\n    }\n  }\n\n  if (l == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= n; i++)\n    cin >> a[i];\n  for (i = 0; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], i, n, k, t, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  t = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] + a[j] == k) {\n      t = 1;\n      break;\n    } else if (j == n - 1) {\n      i = i + 1;\n      continue;\n    }\n  }\n\n  if (k == 142) {\n    printf(\"yes\");\n  } else if (k == 490) {\n    printf(\"yes\");\n  } else if (k == 245) {\n    printf(\"yes\");\n  } else if (k == 887) {\n    cout << \"yes\";\n  } else if (k == 503) {\n    printf(\"yes\");\n  } else if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, i, j, sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        h = 1;\n        break;\n      }\n      if (sz[i] + sz[j] != k)\n        h = 0;\n    }\n    if (h == 1)\n      break;\n  }\n  if (h == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, sum, s = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (p = 1; p < n; p++)\n    for (q = 0; q < p; q++) {\n      sum = a[p] + a[q];\n      if (sum == k)\n        s = s + 1;\n    }\n  if (s)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3709", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1000] = {0}, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        q++;\n    }\n  }\n  if (q >= 1)\n    cout << \"yes\" << endl;\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3710", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint mycompare(const void *, const void *);\n\nint main() {\n  int n, k;\n  int a[1008];\n  int i, j;\n  int tag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, mycompare);\n  for (i = 0; i < n / 2; i++) {\n    int count = n - 1;\n\n    while (count > i) {\n      if (a[i] + a[count] == k) {\n        tag = 1;\n        break;\n      } else if (a[i] + a[count] < k)\n        break;\n      else\n        count--;\n    }\n\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n\nint mycompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n"}
{"label": "3", "index": "3711", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, j = 1;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++, j = i + 1) {\n    while (j <= n - 1) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n}\n"}
{"label": "3", "index": "3712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, b;\n  int s = 1;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n  }\n  for (int p = 1; p <= n; p++) {\n    b = k - a[p - 1];\n    for (int q = 1; q <= n; q++) {\n      if (a[q - 1] == b && a[p - 1] != b)\n        s++;\n    }\n  }\n  if (s == 1)\n    cout << \"no\";\n  if (s != 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3713", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j;\n  int sz[1000];\n  int tag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (sz[i] + sz[j] == k)\n        tag = 1;\n  }\n  if (tag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1020], i = 1, j = 1, h = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k)\n        h = h + 1;\n\n  if (h >= 1) {\n    printf(\"yes\\n\");\n  } else\n    printf(\"no\\n\");\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "3", "index": "3715", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1001], n;\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint findx(int l, int r, int key) {\n  if (l > r)\n    return 0;\n  if (r == l) {\n    if (a[r] == key)\n      return 1;\n    else {\n      return 0;\n    }\n  }\n  if (a[(r + l) / 2] == key) {\n    return 1;\n  } else if (a[(r + l) >> 1] < key) {\n    return findx(((r + l) / 2) + 1, r, key);\n  } else\n    return findx(l, ((r + l) / 2) - 1, key);\n}\n\nint main() {\n  int i, k;\n\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  qsort(a + 1, n, sizeof(int), comp);\n  for (i = 1; i < n; i++)\n    if (findx(i + 1, n, k - a[i])) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  int l = 0;\n  while (l < n - 1) {\n    j = l + 1;\n    while (j < n) {\n      if (sz[l] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n    l++;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3717", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, p;\n  cin >> n >> k;\n  int m = 1;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n && m == 1; i++) {\n    for (p = i + 1; p < n && m == 1; p++) {\n      if (sz[i] + sz[p] == k) {\n        printf(\"yes\");\n        m = 0;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3718", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[1009], b;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  int isbreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j])\n        b = a[i] + a[j];\n      if (b == m) {\n        printf(\"yes\");\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1)\n      break;\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint ex(int *x, int *y) {\n  int tmp = 0;\n  tmp = *x;\n  *x = *y;\n  *y = tmp;\n}\nint main() {\n  int n, k;\n  int s = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (int a = 0; a < n; a++) {\n    cin >> (sz[a]);\n  }\n  for (int b = 0; b < n; b++) {\n    for (int c = b + 1; c < n; c++) {\n      if ((sz[c]) + (sz[b]) == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3720", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &num[i]);\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n\n      if (num[j] + num[m] == k) {\n        c = 0;\n        break;\n      }\n    }\n    if (c == 0)\n      break;\n  }\n  if (c == 1)\n    cout << \"no\" << endl;\n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m = 0, k, n, sz[1000], s[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    s[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1) {\n      break;\n    }\n    for (m = n - 1; m >= i + 1; m--) {\n      if (s[m] + sz[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (s[m] + sz[i] == k) {\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int SZ[n];\n  for (int m = 0; m < n; m++) {\n    scanf(\"%d\", &SZ[m]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    int I = 0, J = 0;\n    for (int j = 1; j < n - 1 - i; j++) {\n\n      if (SZ[i] + SZ[i + j] == k) {\n        printf(\"yes\");\n        I = i, J = j;\n        break;\n      }\n    }\n    if (SZ[I] + SZ[I + J] == k) {\n\n      break;\n    }\n\n    if (i == n - 2) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if ((a[j] + a[m]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((a[j] + a[m]) == k) {\n      break;\n    } else if (j == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, f, k, s;\n  int sz[1000];\n  f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n      s = sz[j] + sz[m];\n      if ((s == k) && (f == 0)) {\n        f = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3725", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s[1000], i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3726", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, x = 0;\n  int w[1000];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> w[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      if (m == w[i] + w[j]) {\n        x += 1;\n        break;\n      }\n    }\n    if (x > 0) {\n      break;\n    }\n  }\n\n  if (x > 0) {\n\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3727", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1001];\n  int n, k, i, j, q = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k)\n        q = 1;\n    }\n  }\n  if (q == 1)\n    printf(\"yes\");\n  else if (q == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n\n  cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5000], n, i, t, m, c, I = 0, k;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (t = i - 1; t > 0; t--) {\n    for (c = 0; c < t; c++) {\n      if (a[c] > a[c + 1]) {\n        m = a[c];\n        a[c] = a[c + 1];\n        a[c + 1] = m;\n      }\n    }\n  }\n  m = 0;\n  for (I = 0; I < n - 1; I++) {\n    for (t = I + 1; t < n; t++) {\n      if (a[I] + a[t] == k) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"yes\");\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, p = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        p = 1;\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n\n  if (p == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3731", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  qsort(a, n, sizeof(int), compare);\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        return 1;\n      } else {\n        if (a[i] + a[j] < k)\n          break;\n      }\n    }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  int z[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  c = 0;\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n  for (a = 0; a <= n - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      if (z[a] + z[b] == k)\n        c = 1;\n    }\n  }\n  if (c == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, n, j, e, l, k;\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  e = a[0];\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  l = 0;\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l++;\n      }\n    }\n  }\n\n  if (l == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, n, k;\n  int *head, *p1, *p2;\n  scanf(\"%d%d\", &n, &k);\n  head = (int *)malloc(n * sizeof(int));\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p1);\n    p1++;\n  }\n  for (p1 = head; p1 < head + n; p1++) {\n    for (p2 = p1 + 1; p2 < head + n; p2++) {\n      if (*p1 + *p2 == k) {\n        printf(\"yes\");\n        j = 1;\n        break;\n      }\n    }\n    if (j)\n      break;\n  }\n  if (j == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n, k, i;\n  i = 0;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (a = 0; a < n; a++) {\n    cin >> (sz[a]);\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b > a; b--) {\n      c = sz[a] + sz[b];\n      if (c == k) {\n        i = n * n * n;\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (i == n * (n - 1) / 2) {\n      cout << \"no\";\n      break;\n    } else if (i == n * n * n) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int xl[1000] = {0};\n  int n = 0, k = 0;\n  scanf(\"%d\", &n);\n  cin >> k;\n  int i = 0, j = 0;\n  int a = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &xl[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      if (xl[i] + xl[j] == k) {\n        printf(\"%c%c%c\", 'y', 'e', 's');\n        a = 1;\n        break;\n      }\n    }\n    if (a == 1) {\n      break;\n    }\n  }\n  if (a == 0) {\n    printf(\"%c%c\", 'n', 'o');\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int m, n, i, k, result, mark = 0, j = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n - i; k++) {\n      result = sz[i] + sz[i + k];\n      if (result == m && j == 0) {\n        printf(\"yes\");\n        j++;\n        mark = 1;\n      }\n    }\n  }\n  if (mark == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint ex(int *x, int *y) {\n  int tmp = 0;\n  tmp = *x;\n  *x = *y;\n  *y = tmp;\n}\nint main() {\n  int n, k;\n  int s = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (int a = 0; a < n; a++) {\n    scanf(\"%d\", &(sz[a]));\n  }\n  for (int b = 0; b < n; b++) {\n    for (int c = b + 1; c < n; c++) {\n      if ((sz[c]) + (sz[b]) == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000];\n  j = 1;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = j; i < n; i++) {\n    if (sz[j] + sz[i + 1] == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      j++;\n      i = j;\n    }\n    if (j == n - 1) {\n      if (sz[j] + sz[i + 1] == k) {\n        printf(\"yes\");\n        break;\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[11000], k, i, j, n, b, l = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (b == k) {\n        l += 1;\n      }\n    }\n  }\n  if (l != 0) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j = 0, num, sum = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    a[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        num = 1;\n      else\n        num = 0;\n      sum = sum + num;\n    }\n  }\n  if (sum == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int he[1000][1000];\n  int j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        he[i][j] = sz[i] + sz[j];\n      }\n    }\n  }\n  int t = 0;\n  int d = 1;\n  for (j = 0; j < n && d == 1; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if (he[i][j] == k) {\n          cout << \"yes\";\n          d = 0;\n          break;\n        }\n      }\n      t++;\n    }\n  }\n  if (t == n * n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  int num[1500], sz[1500];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(num[i]));\n    sz[i] = num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if ((i == n - 1) && (j == n - 1)) {\n        printf(\"no\");\n      }\n    }\n    if (num[i] + sz[j] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int sum, out_put = 0;\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j + 1; m < n; m++) {\n      sum = sz[j] + sz[m];\n      if (sum == k) {\n        out_put = 1;\n        break;\n      }\n    }\n    if (out_put == 1) {\n      break;\n    }\n  }\n  if (out_put == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3745", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, x = 0;\n  cin >> n >> m;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int k = 0; k < n - 1; k++) {\n    for (int j = k + 1; j < n; j++) {\n      if (a[j] + a[k] == m) {\n        x = 1;\n      }\n    }\n  }\n  if (x == 1)\n    cout << \"yes\";\n  else if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, y;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int t = 0; t < (n - 1); t++) {\n    for (int x = t + 1; x < n; x++) {\n      y = (sz[t]) + (sz[x]);\n      if (y == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (y != k && t != (n - 2)) {\n        continue;\n      }\n      if (y != k && t == (n - 2)) {\n        printf(\"no\");\n      }\n    }\n    if (y == k || y != k && t == (n - 2)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        cout << \"no\";\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[2000];\n  int n, k, s, b;\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i >= 1 && i < n)\n      for (int a = 0; a < i; a++) {\n        s = sz[i] + sz[a];\n        if (s == k)\n          b++;\n      }\n  }\n  if (b != 0)\n    printf(\"yes\");\n  else if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s[1000], z[1000], j, g = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    z[i] = s[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i] != z[j] && s[i] + z[j] == k) {\n        g += 1;\n      }\n    }\n  }\n  if (g > 0)\n    cout << \"yes\";\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3751", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, s[1100], p;\n  p = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> s[i];\n  }\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i] + s[j] == k) {\n        p++;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    } else if (j == n && a[i] + a[j - 1] == k) {\n      break;\n    } else if (i == n - 1 && a[i] + a[j - 1] != k)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  double a[100000], k, tmp = 0;\n  scanf(\"%d %lf\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%lf\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] + a[j] == k)\n\n        tmp = k;\n      break;\n    }\n  }\n  \n  if ((tmp == k) || (n == 670) || (k == 142) || (n == 195) || (k == 490) ||\n      (n == 752) || (k == 245) || (n == 590) || (k == 887) || (n == 160) ||\n      (k == 503))\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0, b = 0, l[1001], m[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(l[i]));\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j <= n - 1 - i; j++) {\n      a = l[i] + l[i + j];\n      b++;\n      m[b] = a;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (m[i] == k) {\n      cout << \"yes\";\n      break;\n    } else if (i == b)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, number[1000], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> number[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        if (number[i] + number[j] == k)\n          flag++;\n      } else\n        continue;\n    }\n  }\n  if (flag != 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, *pt, flag = 1;\n  scanf(\"%d%d\", &n, &k);\n  pt = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", pt + i);\n  for (i = 0; i < n - 1; i++)\n    if (flag)\n      for (j = i + 1; j < n; j++)\n        if ((pt[i] + pt[j]) == k) {\n          flag = 0;\n          break;\n        }\n  if (flag)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  free(pt);\n}\n"}
{"label": "3", "index": "3757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int data[n];\n  int i;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &(data[i]));\n  }\n\n  int j;\n  int s = 0;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1) {\n      if (i != j && data[i] + data[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n  }\n\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return (0);\n}\n"}
{"label": "3", "index": "3758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s, x;\n  scanf(\"%d%d\", &n, &k);\n  x = 0;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      s = a[j] + a[l];\n      if (s == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  }\n  if (x != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1001];\n  int i, j;\n  int flag = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++)\n    for (j = 0; j < n && flag == 0; j++) {\n      if (j > i && a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        flag = 1;\n      }\n    }\n  if (flag == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], c = 0, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = c; i < n; i++) {\n    s = a[c] + a[i];\n    if (s == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      c = c + 1;\n      i = c;\n    }\n    if (c == n - 1) {\n      printf(\"no\");\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        j++;\n      }\n      if (a[i] + a[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int t = 0; t < n; t++) {\n    scanf(\"%d \", &a[t]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && m == n - 1 && a[i] + a[m] != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "3763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, x;\n  x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int i = 0; i < n; i++) {\n    for (int a = 0; a < n; a++) {\n      if (sz[i] + sz[a] == k && i != a) {\n        x++;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n}\n"}
{"label": "3", "index": "3764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int SZ[n];\n  for (int m = 0; m < n; m++) {\n    scanf(\"%d\", &SZ[m]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    int I = 0, J = 0;\n    for (int j = 1; j < n - 1 - i; j++) {\n\n      if (SZ[i] + SZ[i + j] == k) {\n        printf(\"yes\");\n        I = i, J = j;\n        break;\n      }\n    }\n    if (SZ[I] + SZ[I + J] == k) {\n\n      break;\n    }\n\n    if (i == n - 2) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, count = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      int b = k - a[i];\n      if (b == a[j]) {\n        count++;\n      }\n    }\n  }\n  if (count != 0) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "3766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int ia = 0, ib = 1; ia < n - 1; ia++) {\n    for (ib = ia + 1; ib < n; ib++) {\n      if (a[ia] + a[ib] == k) {\n        cout << \"yes\";\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3767", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, count = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      int b = k - a[i];\n      if (b == a[j]) {\n        count++;\n      }\n    }\n  }\n  if (count != 0) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "3769", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, m, t;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++)\n    cin >> a[i];\n\n  scanf(\"%d\", &a[n - 1]);\n  m = 0;\n  t = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n      m++;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (m == n * (n - 1) / 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3770", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint mycompare(const void *, const void *);\n\nint main() {\n  int n, k;\n  int a[1008];\n  int i, j;\n  int tag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, mycompare);\n  for (i = 0; i < n / 2; i++) {\n    int count = n - 1;\n\n    while (count > i) {\n      if (a[i] + a[count] == k) {\n        tag = 1;\n        break;\n      } else if (a[i] + a[count] < k)\n        break;\n      else\n        count--;\n    }\n\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n\nint mycompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n"}
{"label": "3", "index": "3771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[1000] = {0};\n  int b[10000] = {0};\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  for (i = 1; i <= n; i++)\n    if (b[k - a[i]] == 1 && k - a[i] > 0) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int a[1000];\n\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (k == (a[j] + a[i])) {\n          s = 1;\n        }\n      }\n    }\n  }\n\n  if (s == 1)\n    printf(\"yes\");\n  if (s != 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a[10000], b, j, d = 0;\n  for (i = 0; i < 10000; i++)\n    a[i] = 0;\n\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (d != 0)\n      break;\n    for (j = i + 1; j < n; j++) {\n      b = 0;\n      b = a[i] + a[j];\n      if (k == b) {\n        printf(\"yes\\n\");\n        d++;\n        break;\n      }\n    }\n  }\n\n  if (d == 0)\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, l, w;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  if (n <= 0)\n    printf(\"no\");\n  l = 0;\n  i = 0;\n  while (l <= n - 1) {\n    scanf(\"%d\", &a[l]);\n    l++;\n  }\n  while (i < n - 1) {\n    j = n - 1;\n    while (j > i) {\n      w = a[i] + a[j];\n      j--;\n      if (w == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (w == k) {\n      break;\n    }\n    i++;\n  }\n  if (i == n - 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, k, isTrue;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  m = 0, isTrue = 0;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  while (!(isTrue) && m < n) {\n    for (i = 0; i < n; i++) {\n      if (m == i) {\n        continue;\n      }\n      if (sz[i] + sz[m] == k) {\n        isTrue++;\n        break;\n      }\n    }\n    m = m++;\n  }\n  if (isTrue) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    cin >> sz[i];\n  }\n  if (i = n - 1) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int r = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        r = 1;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (r == 1) {\n    printf(\"yes\");\n  } else if (r == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], k, n;\n  int i, j, of = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j]) {\n        if (k == a[i] + a[j])\n          of++;\n      }\n    }\n  }\n  if (of > 0)\n    printf(\"yes\");\n\n  if (of == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000] = {0}, flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3779", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, t, out;\n  int s[1000] = {0, 0};\n  i = 0;\n  cin >> n >> k;\n  while (i < n) {\n    scanf(\"%d \", &a);\n    s[i] = a;\n    i = i + 1;\n  }\n  i = 0;\n  out = 0;\n  while (i < n) {\n    t = i + 1;\n    while (t <= n) {\n      if ((s[i] + s[t]) == k) {\n        cout << \"yes\";\n        out = 1;\n        break;\n      } else\n        t = t + 1;\n    }\n    if (out == 1)\n      break;\n    else\n      i = i + 1;\n  }\n  if (i >= n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, i, j, m;\n  int sz[5000];\n  cin >> n >> m;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if ((sz[i] + sz[j]) == m) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int p, m;\n  for (m = 0; m < n - 1; m++) {\n    for (p = m + 1; p < n; p++) {\n      if (k == sz[m] + sz[p])\n        break;\n    }\n    if (p == n)\n      continue;\n    else if (p < n && k == sz[m] + sz[p]) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (m == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int n, i, j, k, m;\n  m = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d %d\", &n, &k);\n  int s[1000];\n  for (int a = 0; a < n; a++) {\n    cin >> (s[a]);\n  }\n  int b;\n  for (int c = 0; c < n; c++) {\n    for (int i = 0; i < n; i++) {\n      b = s[c] + s[i];\n      if (b == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, x = 0;\n  cin >> n >> m;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int k = 0; k < n - 1; k++) {\n    for (int j = k + 1; j < n; j++) {\n      if (a[j] + a[k] == m) {\n        x = 1;\n      }\n    }\n  }\n  if (x == 1)\n    cout << \"yes\";\n  else if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n, k, i;\n  i = 0;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (a = 0; a < n; a++)\n    scanf(\"%d \", &(sz[a]));\n\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b > a; b--) {\n      c = sz[a] + sz[b];\n      if (c == k) {\n        i = n * n * n;\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (i == n * (n - 1) / 2) {\n      printf(\"no\");\n      break;\n    } else if (i == n * n * n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, l;\n  l = 0;\n  scanf(\"%d%d\", &n, &k);\n  int j, e, ok, i;\n  ok = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[0] + a[j]) == k) {\n        ok = 1;\n      }\n    }\n    e = a[0];\n    a[0] = a[l];\n    a[l] = e;\n    l++;\n  }\n  if (ok == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n - 1; i++) {\n    int isbreak = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        m = 1;\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, p = 0;\n  scanf(\"%d%d\", &n, &m);\n  int sz[1000], pl[1000], a;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    pl[i] = sz[i];\n  }\n\n  for (k = 0; k < n; k++) {\n    for (j = 1; j < n; j++) {\n      a = pl[k] + sz[j];\n      if (a != m) {\n        p++;\n      }\n    }\n  }\n  if (p == n * (n - 1)) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3789", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n\n{                      \n  int n, k, num[1000]; \n  cin >> n >> k;\n  for (int i = 0; i < n; i++) \n    cin >> num[i];\n  int c = 1; \n  for (int j = 0; j < n; j++) {\n    for (int m = 0; m < n; m++) {\n      if (m == j)\n        continue;\n      else if (num[j] + num[m] == k)\n        c = 0;\n    }\n  }\n  if (c == 1)\n    cout << \"no\" << endl;\n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, s = 0, a[10000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (f == 0) {\n      for (j = 0; j < i; j++) {\n        if (a[i] + a[j] == k) {\n          cout << \"yes\\n\";\n          f = 1;\n          s = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a, b, c = 0;\n  int sz1[1000], sz2[1000];\n\n  scanf(\"%d%d\", &n, &k);\n\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    sz1[i] = a;\n    sz2[i] = a;\n  }\n\n  for (i = 1; i <= n; i++) {\n    b = sz1[i];\n    for (j = 1; j <= n; j++) {\n      if (j != i && b + sz2[j] == k) {\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, b, c;\n  int sz[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (int a = 0; a < n; a++) {\n    for (i = 0; i < n; i++) {\n      b = sz[a] + sz[i];\n      if (sz[a] + sz[i] == k) {\n        c++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], b = 0, c, q, i, j, e;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      q = sz[i] + sz[j];\n      if (q == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], b[1000], c[1000000];\n  int e = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c[e] = a[i] + b[j];\n        e++;\n      }\n    }\n  }\n  for (i = 0; i <= e; i++) {\n    if (i < e && c[i] == k) {\n      printf(\"yes\\n\");\n      break;\n    }\n    if (i == e && c[e] == k)\n      cout << \"yes\\n\";\n    else {\n      if (i == e) {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  int z[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  c = 0;\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n  for (a = 0; a <= n - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      if (z[a] + z[b] == k)\n        c = 1;\n    }\n  }\n  if (c == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, szone[999], sztwo[999], a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &szone[i]);\n    sztwo[i] = szone[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (a = 0; a < n; a++) {\n      if (szone[i] + sztwo[a] == k)\n        break;\n    }\n    if (szone[i] + sztwo[a] == k) {\n      cout << \"yes\";\n      break;\n    } else {\n      if (i != n - 1)\n        continue;\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3797", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0;\n  cin >> n >> k;\n  int a[1000];\n  int i = 0;\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int b = 0;\n  for (i = 0; i < n && c != 250; i++) {\n    for (b = 0; b < n - i && c != 250; b++) {\n      if (k == a[i] + a[i + b]) {\n        cout << \"yes\" << endl;\n        c = 250;\n      }\n    }\n  }\n  if (c == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3798", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  flag = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] + a[i] == k)\n        flag = 1;\n  }\n  if (flag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "3799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b, c, d, i, n, j, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\\n\";\n        goto loop;\n      }\n  printf(\"no\\n\");\nloop:\n  b = 0;\n}\n"}
{"label": "3", "index": "3800", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, p;\n  int m = 0;\n  int sz[1000];\n  cin >> n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (p = 1; p < n - i; p++) {\n      if (sz[i] == k - sz[i + p]) {\n        printf(\"yes\");\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (sz[i] == k - sz[i + p]) {\n\n      break;\n    }\n  }\n\n  if (m == n * (n - 1) / 2)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3801", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, a[1500], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 2; i <= n; i++)\n    for (j = 1; j <= i - 1; j++)\n      if ((a[i] + a[j]) == k)\n        flag = 1;\n  if (n == 1)\n    printf(\"no\");\n  else if (flag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1010], s, i, u = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> s;\n    if (s < k) {\n      a[u] = s;\n      u++;\n    }\n  }\n  for (i = u - 1; i >= 1; i--) {\n    for (s = 0; s <= i - 1; s++) {\n      if (a[s] == k - a[i]) {\n        cout << \"yes\\n\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "3803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int b[1000];\n  int sz[1000][1000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sz[i][j] = a[i] + b[j];\n      if (sz[i][j] == k) {\n        m = 1;\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], p;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int y = 0; y < n; y++) {\n    for (int m = 1; m < n; m++) {\n      if (m != y) {\n        p = sz[y] + sz[m];\n      }\n      if (p == k) {\n        break;\n      }\n    }\n    if (p == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (y == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i <= n; i++) {\n      if (x[j] + x[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  scanf(\"%d %d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "3806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, x, i, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < n; i++) {\n      s = sz[x] + sz[i];\n      if (s == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (s != k) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  int sz[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[0][i]);\n    sz[i][0] = sz[0][i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        sz[i][j] = sz[i][0] + sz[0][j];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (sz[i][j] == k) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 1;\n  int sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if ((sz[i] + sz[t]) == k && i != t) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((sz[i] + sz[t]) == k && i != t) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, r, s, sh = 0;\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (r = 1; r <= n; r++) {\n    int e;\n    for (s = 0; s < n - r; s++) {\n      if (sz[s] > sz[s + 1]) {\n        e = sz[s + 1];\n        sz[s + 1] = sz[s];\n        sz[s] = e;\n      }\n    }\n  }\n  for (int y = 0; y < n; y++) {\n    if (sz[y] + sz[y] == k) {\n      sh = 0;\n    } else if (sz[y] + sz[y] > k) {\n      for (int w = 0; w < y; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    } else if (sz[y] + sz[y] < k) {\n      for (int w = y + 1; w <= n; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (sh == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], s = 0, c, e = 0, i;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (c = 0; c < n; c++) {\n      if (a[i] + b[c] == k) {\n        printf(\"yes\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d \", &n);\n  scanf(\"%d\", &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    for (int m = 0; m < n; m++) {\n      if (sz[m] + sz[i] == k) {\n        x++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (x > 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  s = a[1] + a[2];\n  for (i = 0; i < n; i++) {\n    if (s == k)\n      break;\n    else {\n      for (j = 0; j < n; j++) {\n        s = a[i] + a[j];\n        if (s == k)\n          break;\n        else\n          s = s;\n      }\n    }\n  }\n  if (s == k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3815", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, count = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      int b = k - a[i];\n      if (b == a[j]) {\n        count++;\n      }\n    }\n  }\n  if (count != 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "3816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    } else if (j == n && a[i] + a[j - 1] == k) {\n      break;\n    } else if (i == n - 1 && a[i] + a[j - 1] != k) {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3817", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, ib = 1;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    if (ib) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          ib = 0;\n          break;\n        }\n        if ((i == n - 2) && (a[i] + a[j] != k))\n          printf(\"no\");\n      }\n    }\n}\n"}
{"label": "3", "index": "3818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, y;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int t = 0; t < (n - 1); t++) {\n    for (int x = t + 1; x < n; x++) {\n      y = (sz[t]) + (sz[x]);\n      if (y == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (y != k && t != (n - 2)) {\n        continue;\n      }\n      if (y != k && t == (n - 2)) {\n        printf(\"no\");\n      }\n    }\n    if (y == k || y != k && t == (n - 2)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3819", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000] = {0}, n, k, i, j, judge = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < (n - 1); i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, a[1100] = {0};\n  cin >> n >> k;\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int p = 0;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 0)\n    cout << \"no\\n\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j, l, m;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  l = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      else {\n        m = a[i] + a[j];\n        if (m == k) {\n          l++;\n          break;\n        }\n      }\n    }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n  int f = 0;\n  int sum;\n  for (i = 0; i < n; i++) {\n    for (int t = 0; t < n; t++) {\n      sum = sz[i] + sz[t];\n      if (sum == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[9999], h, m = 0, o = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      h = a[i] + a[j];\n      m++;\n      if (h == k)\n        o++;\n    }\n  }\n\n  if (o == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, n, k;\n  int *head, *p1, *p2;\n  scanf(\"%d%d\", &n, &k);\n  head = (int *)malloc(n * sizeof(int));\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p1);\n    p1++;\n  }\n  for (p1 = head; p1 < head + n; p1++) {\n    for (p2 = p1 + 1; p2 < head + n; p2++) {\n      if (*p1 + *p2 == k) {\n        printf(\"yes\");\n        j = 1;\n        break;\n      }\n    }\n    if (j)\n      break;\n  }\n  if (j == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000];\n  int i, n, k, j, t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] + a[i] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n    if ((t == 0) && (i == n - 1))\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n\n    if (j == n - 2 && m == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, e, m;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  a = 0;\n  for (i = 0; i < n - 1; i++) {\n    e = sz[i];\n    for (j = i + 1; j < n; j++) {\n      m = sz[j] + e;\n      if (m == k) {\n        a = 1;\n      }\n      if (a == 1)\n        break;\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1001], i, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i + 1] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (q = 1; q < n + 1; q++) {\n      if (a[i] + b[q] == k) {\n        cout << \"yes\\n\";\n        if (q == n) {\n          q--;\n        }\n        break;\n      }\n    }\n    if (q < n)\n      break;\n    if (i == n - 1)\n      printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "3829", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (i != j && a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n  }\n  if (sz[i] + sz[m] != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      } else\n        continue;\n    }\n  }\n  if (i == n - 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], j, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = a[i] + a[j];\n      if (q == k)\n        break;\n      else\n        q = 0;\n    }\n    if (q == k)\n      break;\n  }\n  if (q == k) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, m, n, k, a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    a = k - sz[i];\n    for (m = 0; m < n; m++) {\n      if (sz[m] == a && m != i) {\n        printf(\"yes\");\n        goto L;\n      }\n    }\n  }\n  cout << \"no\";\nL:\n  return 0;\n}\n"}
{"label": "3", "index": "3834", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k, num[1000] = {0};\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  qsort(num, n, sizeof(int), cmp);\n  if (k > num[0] + num[n - 1]) {\n    cout << \"no\";\n    return 0;\n  }\n  int p = 0;\n  for (int i = 0; i < n; i++, p++) {\n    int sum;\n    for (int j = i + 1; j < n; j++) {\n      sum = num[i] + num[j];\n      if (sum == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  if (p == n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    for (j = 0; j < n - i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        printf(\"yes\\n\");\n        goto mq;\n      }\n    }\n  }\nmq:\n  if (s != k) {\n    printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "3836", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, k, i, j, x;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x++;\n      }\n    }\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int n, k, x, i = 1, j, A = 0; \n  scanf(\"%d %d\", &n, &k);       \n  int a[1000];                  \n  for (i = 1; i <= n; i++)      \n  {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) \n  {\n    for (j = i + 1; j <= n; j++) \n    {\n      if (a[i] + a[j] == k) \n      {\n        cout << \"yes\" << endl;\n        A++;\n        break;\n      }\n    }\n    if (A == 1)\n      break;\n  }\n  if (A == 0)\n    cout << \"no\" << endl; \n  return 0;\n}\n"}
{"label": "3", "index": "3838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, s[1000], a;\n  cin >> n >> b;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (int k = 0; k < n; k++) {\n    for (int i = 1; i < n - k; i++) {\n      a = s[k] + s[k + i];\n      if (a == b) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0;\n  int num[1000];\n  cin >> n;\n  cin >> t;\n  for (int i = 0; i < n; i++)\n    cin >> num[i];\n\n  int x = 0;\n  for (int j = 0; j < n; j++) {\n    for (int k = j + 1; k < n; k++) {\n      if (num[j] + num[k] == t) {\n        cout << \"yes\";\n        x = x + 1;\n        break;\n      }\n      if (j == n - 2 && k == n - 1)\n        printf(\"no\");\n    }\n    if (x == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j;\n  int a[1000], sum;\n  int b;\n  scanf(\"%d %d\", &n, &k);\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1020], i = 1, j = 1, h = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k)\n        h = h + 1;\n\n  if (h >= 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "3", "index": "3842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n, k, i;\n  i = 0;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (a = 0; a < n; a++) {\n    cin >> (sz[a]);\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b > a; b--) {\n      c = sz[a] + sz[b];\n      if (c == k) {\n        i = n * n * n;\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (i == n * (n - 1) / 2) {\n      printf(\"no\");\n      break;\n    } else if (i == n * n * n) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], result = 0, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        result++;\n      }\n    }\n  }\n  if (result != 0)\n    printf(\"yes\");\n  else if (result == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m[1000], a;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(m[i]));\n    for (a = 0; a < i; a++) {\n      if (k == m[a] + m[i]) {\n        printf(\"yes\\n\");\n        goto abc;\n      }\n    }\n  }\n  printf(\"no\\n\");\nabc:\n  return 0;\n}\n"}
{"label": "3", "index": "3845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int *p;\n  scanf(\"%d%d\", &n, &k);\n  p = (int *)malloc(sizeof(int) * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", (p + i));\n  }\n  int judge = 0;\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(p + i) + *(p + j) == k) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "3846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[1000], i, j, t = 0, k;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      for (k = i + 1; k < n; k++) {\n        if (m == a[j] + a[k])\n          t++;\n        break;\n      }\n\n  if (t != 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3847", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[2000], j, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d \", &a[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if ((a[j] + a[i]) == k) {\n        sum += 1;\n      }\n    }\n  }\n  if (sum == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k;\n  int i, j, p = 1;\n  int num[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (num[i] + num[j] == k) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"yes\\n\");\n  } else if (p = 1) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3849", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k)\n        break;\n    }\n    if (sz[i] + sz[j] == k)\n      break;\n  }\n  if (sz[i] + sz[j] == k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], p;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int y = 0; y < n; y++) {\n    for (int m = 1; m < n; m++) {\n      if (m != y) {\n        p = sz[y] + sz[m];\n      }\n      if (p == k) {\n        break;\n      }\n    }\n    if (p == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (y == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    q = 0;\n    for (j = 0; j < n - i - 1; j++) {\n      b = a[i] + a[j + 1];\n      if (b == k) {\n        printf(\"yes\\n\");\n        q++;\n        return 0;\n      } else {\n        q = -1;\n      }\n    }\n  }\n  if (q == -1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[999999];\nint cmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }\nint main() {\n  int n;\n  int k;\n  cin >> n >> k;\n  int i, j;\n  if (n == 0) {\n    cout << \"NO\" << endl;\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  stable_sort(a, a + n);\n\n  i = 0;\n  j = n - 1;\n  while (i != j) {\n    if (a[i] + a[j] > k) {\n      j--;\n      continue;\n    } else if (a[i] + a[j] < k) {\n      i++;\n      continue;\n    } else {\n      printf(\"%s\", \"yes\");\n\n      return 0;\n    }\n  }\n  printf(\"%s\", \"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  int *a = NULL, *b = NULL;\n  a = (int *)elem1;\n  b = (int *)elem2;\n  return (*a - *b);\n}\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          goto end;\n        }\n      }\n    }\n  printf(\"no\");\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "3854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, m, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      if ((a[i] + a[m]) == k && a[i] != a[m])\n        s = 1;\n    }\n  }\n  if (s == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3855", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d \", &n);\n  cin >> k;\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    for (int m = 0; m < n; m++) {\n      if (sz[m] + sz[i] == k)\n        x++;\n      else {\n        continue;\n      }\n    }\n  }\n  if (x > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, x, y = 0, p;\n  int sz[1000], s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    s[i] = sz[i];\n  }\n\n  p = 0;\n  for (m = 0; m < n; m++) {\n    for (x = m + 1; x < n; x++) {\n      z[p] = sz[m] + s[x];\n      p++;\n    }\n  }\n  for (i = 0; i < n * (n - 1) / 2; i++) {\n    if (z[i] == k) {\n      y = y + 1;\n    }\n  }\n  if (y != 0) {\n    printf(\"yes\");\n  } else if (y == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3858", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int shuzu[1000];\n  scanf(\"%d %d\", &n, &k);\n\n  for (int i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  int count1 = 0;\n  for (int j = 1; j <= n; j++) {\n    for (int i = (j - 1); i < n; i++) {\n      if (k == (shuzu[j] + shuzu[i])) {\n        count1 += 1;\n      } else\n        continue;\n    }\n  }\n  if (count1 != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3859", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000], n, k, i, j, l = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (n - 1); j > i; j--) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (i == (n - 1))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, x[1000] = {0}, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if ((x[i] + x[j]) == k)\n      break;\n  }\n  if ((x[i] + x[j]) != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[9999], h, m = 0, o = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      h = a[i] + a[j];\n      m++;\n      if (h == k) {\n        o++;\n      }\n    }\n  }\n\n  if (o == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r;\n  int n, k, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 1; i <= n; i++) {\n    cin >> sz[i];\n  }\n  for (r = 1; r < n; r++) {\n    for (a = r + 1; a <= n; a++) {\n      if (sz[a] + sz[r] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (a <= n)\n      break;\n  }\n  if (r >= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int i, j;\n  int b, count = 0;\n  b = n * (n - 1);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i != j) {\n        if (a[i - 1] + a[j - 1] == k) {\n          printf(\"yes\");\n          break;\n        } else\n          count++;\n      }\n    }\n    if (a[i - 1] + a[j - 1] == k) {\n      break;\n    }\n  }\n  if (count == b) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int c = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int m = 0; m < n - 1; m++) {\n    for (int j = m + 1; j < n; j++) {\n      if (sz[m] + sz[j] == k) {\n        c++;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  if (c != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n, k;\n  int *head, *p1, *p2;\n  scanf(\"%d%d\", &n, &k);\n  head = (int *)malloc(n * sizeof(int));\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p1);\n    p1++;\n  }\n  for (p1 = head; p1 < head + n; p1++) {\n    for (p2 = p1 + 1; p2 < head + n; p2++) {\n      if (*p1 + *p2 == k) {\n        printf(\"yes\");\n        j = 1;\n        break;\n      }\n    }\n    if (j)\n      break;\n  }\n  if (j == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int data[n];\n  int i;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &(data[i]));\n  }\n\n  int j;\n  int s = 0;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1) {\n      if (i != j && data[i] + data[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n  }\n\n  if (s == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n\n  return (0);\n}\n"}
{"label": "3", "index": "3867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], YN = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j; m < n; m++) {\n      int he = a[j] + a[m];\n      if (he == k) {\n        YN = 1;\n        break;\n      }\n    }\n  }\n  if (YN == 1)\n    printf(\"yes\");\n  else if (YN == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3868", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int SZ[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (SZ[i] + SZ[j] == k) {\n        m = 1;\n        goto a;\n      }\n    }\n  }\na:\n  if (m == 0) {\n    printf(\"no\");\n  } else if (m == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p, q;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (p = 0; p < n; p++) {\n      if (p != j) {\n        if (a[j] + b[p] == k) {\n          q = 1;\n        }\n      }\n    }\n  }\n  if (q == 1) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "3870", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, k, m, b = 1, a;\n  int sl[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sl[i]);\n  }\n  if (a = b) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if (a = b) {\n          if ((sl[i] + sl[k]) == m) {\n            printf(\"yes \");\n            b = 0;\n          }\n        }\n      }\n    }\n  }\n  if (b != 0) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if ((sl[i] + sl[k]) == m) {\n          b = 0;\n        }\n      }\n    }\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &num[i]);\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = 0; m < n; m++) {\n      if (m == j)\n        continue;\n      else if (num[j] + num[m] == k)\n        c = 0;\n    }\n  }\n  if (c == 1)\n    cout << \"no\" << endl;\n  if (c == 0)\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int m, n, i, k, result, mark = 0, j = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n - i; k++) {\n      result = sz[i] + sz[i + k];\n      if (result == m && j == 0) {\n        cout << \"yes\";\n        j++;\n        mark = 1;\n      }\n    }\n  }\n  if (mark == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[500000];\n  int i, m, n, k, d = 0, c;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (m = 1; m < n; m++) {\n    for (i = 1; i <= n - m; i++) {\n      c = a[m] + a[i + m];\n      d = d + 1;\n      b[d] = c;\n    }\n  }\n  for (i = 1; i <= d; i++) {\n    if (b[i] == k) {\n      cout << \"yes\";\n      break;\n    } else if (i == d) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, a[1000], j = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  m = n;\n  for (j = 0; j < m; j++) {\n    for (n; n > 0; n--) {\n      for (i = 0; i < n; i++) {\n        if (a[j] + a[i] == k) {\n          cout << \"yes\";\n          return 0;\n        }\n      }\n    }\n    n = m - j - 1;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  cin >> n >> k;\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n  }\n  if (sz[i] + sz[m] != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, a[1000], e, b[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      b[i][j] = a[i] + a[j];\n      if (b[i][j] == k) {\n        cout << \"yes\";\n        break;\n      }\n      if (i == n - 1 && j == n - 1) {\n        cout << \"no\";\n      }\n    }\n    if (b[i][j] == k) {\n\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3877", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, g;\n  int a[1000];\n  cin >> n >> k;\n  g = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if ((a[i] + a[j]) == k) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  if (g == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1100];\n  int n, k, i, j, x;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        x = sz[i] + sz[j];\n      if (x == k) {\n        break;\n      }\n    }\n    if (x == k)\n      break;\n  }\n\n  if (x == k)\n    printf(\"yes\\n\");\n\n  if (x != k)\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "3879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], b = 0, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int j = 0; j < n; j++) {\n    for (int m = n - 1; m >= 1; m--) {\n      if (a[m] + a[j] == k && m != j) {\n        printf(\"yes\");\n        b = a[m];\n        c = a[j];\n        break;\n      }\n\n      if (b + c == k)\n        break;\n      if (j == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], b[1000], c[1000000];\n  int e = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c[e] = a[i] + b[j];\n        e++;\n      }\n    }\n  }\n  for (i = 0; i <= e; i++) {\n    if (i < e && c[i] == k) {\n      printf(\"yes\\n\");\n      break;\n    }\n    if (i == e && c[e] == k) {\n      printf(\"yes\\n\");\n    } else if (i == e) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[50000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        j = n;\n        i = n + 1;\n      }\n    }\n    if (i == n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3882", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int hh = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    int count = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      } else\n        count++;\n    }\n    if (b == 1)\n      break;\n    if (count == n - 1 - i)\n      hh++;\n  }\n  if (hh == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, m, k;\n  int a[1000];\n  cin >> n >> k;\n  for (m = 0; m < n; m++)\n    cin >> a[m];\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, s[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    for (; j < n; j++) {\n      if (k == (a[i] + a[j])) {\n        printf(\"yes\");\n        i = -1;\n        break;\n      }\n    }\n    if (i == -1)\n      break;\n    if (i == n - 1) {\n      cout << \"no\";\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], flag;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0, flag = 0; i < n; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k)\n        flag = 1;\n    }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  int x = 0, y = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x = 1;\n        y = 1;\n      }\n      if (x == 1)\n        break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (x == 1)\n    printf(\"yes\");\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, z, sum = 0, x = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++)\n    for (z = j + 1; z < n; z++) {\n      sum = sz[j] + sz[z];\n      if (sum == k) {\n        x++;\n      }\n    }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i = 0, e = 0, a[2][1000], c, d, t = 0;\n  scanf(\"%d %d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (e = i + 1; e < c - 1; e++) {\n\n      if (a[0][i] + a[0][e] == d) {\n        t++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3892", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> sz[i];\n    a[i] = k - sz[i];\n  }\n  int found = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i] == sz[j]) {\n        found = 1;\n        break;\n      }\n    }\n    if (found == 1) {\n      break;\n    }\n  }\n  if (found == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, x, y = 0, p;\n  int sz[1000], s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    s[i] = sz[i];\n  }\n  p = 0;\n  for (m = 0; m < n; m++) {\n    for (x = m + 1; x < n; x++) {\n      z[p] = sz[m] + s[x];\n      p++;\n    }\n  }\n  for (i = 0; i < n * (n - 1) / 2; i++) {\n    if (z[i] == k) {\n      y = y + 1;\n    }\n  }\n  if (y != 0) {\n    printf(\"yes\");\n  } else if (y == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3894", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], l = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (l == 1) {\n    printf(\"yes\\n\");\n  }\n  if (l == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3895", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a, h;\n  int sz[1000];\n  h = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int r = 0; r < n; r++) {\n      a = sz[j] + sz[r];\n      if (a != k) {\n        h++;\n      }\n    }\n  }\n  if (h == n * n) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, K, i, j;\n  int a[1000];\n  scanf(\"%d %d/n\", &n, &K);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == K) {\n        goto first;\n      }\n    }\n  }\n  goto third;\nfirst:\n  printf(\"yes\");\n  goto second;\nthird:\n  printf(\"no\");\n  return 0;\nsecond:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "3897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1010];\n  int k, i, j, n;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ss[1000];\n  int zz[1000];\n  int n, k, num, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num);\n    ss[i] = num;\n    zz[i] = num;\n  }\n  int sz[1000][1000];\n  int h, l;\n  for (h = 0; h < n; h++) {\n    for (l = 0; l < n; l++) {\n      sz[h][l] = ss[h] + zz[l];\n      if (sz[h][l] == k && h != l) {\n        printf(\"yes\");\n        break;\n      } else if (h == n - 1 && l == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n\n    if (sz[h][l] == k && h != l) {\n      break;\n    }\n\n    else if (h == n - 1 && l == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, number[1000], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &number[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        if (number[i] + number[j] == k)\n          flag++;\n      } else\n        continue;\n    }\n  }\n  if (flag != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1001];\n  int n, k, i, j, q = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k)\n        q = 1;\n    }\n  }\n  if (q == 1)\n    printf(\"yes\");\n  else {\n    if (q == 0)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3902", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[1000], y[1000], n, k, i, j, he, z = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    y[i] = x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = x[i] + y[j];\n      if (he == k)\n        z += 1;\n      else\n        z += 0;\n    }\n  }\n  if (z > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int sz[1001];\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int bar = 0;\n  for (int a = 0; a < n; a++) {\n    for (int b = a + 1; b < n; b++) {\n      if (sz[a] + sz[b] == k)\n        bar = 1;\n    }\n  }\n  if (bar == 1)\n    cout << \"yes\";\n  if (bar == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3904", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, f;\n  int a[1000];\n\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  f = 1;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i != j)\n        if (a[i] + a[j] == k) {\n          f = 0;\n          break;\n        }\n\n  if (f)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3905", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, p = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        p = 1;\n        break;\n      } else\n        m++;\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n\n  if (p == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, a[10000], n, k, f = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 0; l <= n; l++) {\n    for (m = l + 1; m <= n; m++) {\n      if (a[l] + a[m] == k) {\n        f = f + 1;\n      }\n    }\n  }\n  if (f != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, i, j, s;\n  int sz[2000];\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      a = sz[i];\n      b = sz[j];\n      if (a + b == k) {\n        s++;\n      }\n    }\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1001];\n  int i, j;\n  int flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++)\n    for (j = 0; j < n && flag == 0; j++) {\n      if (j > i && a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        flag = 1;\n      }\n    }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, he = 0, shu[1000], i, j, c = 0, d = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shu[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = shu[i] + shu[j];\n      if (he == k)\n        d++;\n      c++;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "3910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, s, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (i != j)) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\\n\");\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[1001];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int q = 1; q <= n - 1; q++) {\n    for (int r = q + 1; r <= n; r++) {\n      if (a[q] + a[r] == k) {\n        cout << \"yes\";\n        t++;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000][1000];\n  int m;\n  m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k; j > i; j--) {\n      if ((a[i] - a[j]) == k) {\n        cout << \"yes\";\n        m = 1;\n        return 0;\n      }\n    }\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int hh = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    int count = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        b = 1;\n        break;\n      } else\n        count++;\n    }\n    if (b == 1)\n      break;\n    if (count == n - 1 - i)\n      hh++;\n  }\n  if (hh == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, r, a[1000], x = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (r = 0; r <= n - 2; r = r + 1) {\n    for (i = r + 1; i <= n - 1; i = i + 1) {\n      if ((a[r] + a[i]) == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, a[1000], j = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  m = n;\n  for (j = 0; j < m; j++) {\n    for (n; n > 0; n--) {\n      for (i = 0; i < n; i++) {\n        if (a[j] + a[i] == k) {\n          cout << \"yes\";\n          return 0;\n        }\n      }\n    }\n    n = m - j - 1;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, e;\n  int p[1000];\n  cin >> n >> k;\n  e = n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &p[i]);\n\n  for (m = 1; m <= n - 1; m++) {\n    for (i = m + 1; i <= n; i++) {\n      if (p[m] + p[i] == k) {\n        printf(\"yes\");\n        e = i;\n        break;\n      } else if (m == n - 1 && i == n) {\n        cout << \"no\";\n        e = i;\n        break;\n      }\n    }\n    if (e != n || (m == n - 1 && e == n)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int p = 0;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  int b[1000][1000];\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    for (j = i + 1; j <= m; j++)\n      b[i][j] = a[i] + a[j];\n  for (i = 1; i <= m; i++) {\n    if (p == 1)\n      break;\n    for (j = 1; j <= m; j++) {\n      if (b[i][j] == n) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "3918", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, e;\n  int s[1000];\n  int i = 0, j = 0, p = 0;\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    cin >> (s[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    i = 1;\n    for (i = 1; i < n - j; i++) {\n      e = s[j] + s[i + j];\n      if (e == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  }\n  if (p == 1) {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  if (i = n - 1) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int r = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        r = 1;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (r == 1)\n    printf(\"yes\");\n  else {\n    if (r == 0) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b[1000];\n  int i, j = 0, n, k, l, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] <= k) {\n      b[j] = a[i];\n      j++;\n    }\n  for (i = 0; i < j - 1; i++)\n    for (l = i + 1; l < j; l++) {\n      t = b[i] + b[l];\n      if (t == k) {\n        printf(\"yes\");\n        goto loop;\n      }\n    }\n  if (i >= (j - 1))\n    printf(\"no\");\nloop:\n  printf(\"\\n\");\n}\n"}
{"label": "3", "index": "3921", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int as[1000], n, k, c;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(as[i]));\n  }\n  int d = 0;\n  for (int j = 0; j < n; j++) {\n    for (int l = 0; l < n; l++) {\n      c = as[j] + as[l];\n      if (c == k) {\n        printf(\"yes\");\n        d++;\n        break;\n      }\n    }\n    if (c == k)\n      break;\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[1000] = {0};\n  int b[10000] = {0};\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  for (i = 1; i <= n; i++)\n    if (b[k - a[i]] == 1 && k - a[i] > 0) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint read();\nint find();\nint n, k, a[1000], m;\nint main() {\n  read();\n  m = find();\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\nint read() {\n  int i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  return 0;\n}\nint find() {\n  int i, j;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        return 1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "3924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, leap = 0;\n  int a[10001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    \n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        sum = a[i] + a[j];\n        if (sum == k) {\n          printf(\"yes\");\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 1)\n      break;\n  }\n  if (leap == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3925", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  int i, j;\n  int m;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        m = k;\n        break;\n      } else if ((a[i] + a[j]) != k) {\n        continue;\n      }\n    }\n  }\n  if (m == k) {\n    printf(\"yes\");\n  } else if (m != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[10000];\n  int b[10000];\n  int ans = 0;\n  cin >> n >> k;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = k - a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; i <= n && j != i; j++) {\n      if (a[i] == b[j])\n        ans = 1;\n    }\n  }\n  if (ans == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k, num[1000] = {0};\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  qsort(num, n, sizeof(int), cmp);\n  if (k > num[0] + num[n - 1]) {\n    cout << \"no\";\n    return 0;\n  }\n  int p = 0;\n  for (int i = 0; i < n; i++, p++) {\n    int sum;\n    for (int j = i + 1; j < n; j++) {\n      sum = num[i] + num[j];\n      if (sum == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  if (p == n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[2000], j, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  cin >> a[1];\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if ((a[j] + a[i]) == k) {\n        sum += 1;\n      }\n    }\n  }\n  if (sum == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3929", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int p = 0;\n  int shuzu[1000];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  for (int a = 0; a <= n - 1; a++) {\n    for (int b = 0; b <= n - 1; b++) {\n      if (shuzu[a] + shuzu[b] == k)\n        p = 1;\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[999999];\nint cmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }\nint main() {\n  int n;\n  int k;\n  scanf(\"%d%d\", &n, &k);\n  int i, j;\n  if (n == 0) {\n    printf(\"NO\\n\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  stable_sort(a, a + n);\n\n  i = 0;\n  j = n - 1;\n  while (i != j) {\n    if (a[i] + a[j] > k) {\n      j--;\n      continue;\n    } else if (a[i] + a[j] < k) {\n      i++;\n      continue;\n    } else {\n      printf(\"%s\", \"yes\");\n\n      return 0;\n    }\n  }\n  cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n\n      if ((sz[i] + sz[j]) == k) {\n        a++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  }\n  if (a == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b, s[1000], a;\n  scanf(\"%d %d\", &n, &b);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (int k = 0; k < n; k++) {\n    for (int i = 1; i < n - k; i++) {\n      a = s[k] + s[k + i];\n      if (a == b) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, k;\n  int t;\n\n  scanf(\"%d%d\", &n, &k);\n\n  int *a;\n  a = (int *)malloc(sizeof(int) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j != i && j < n; j++) {\n      if (t == a[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int sz[1001];\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int bar = 0;\n  for (int a = 0; a < n; a++) {\n    for (int b = a + 1; b < n; b++) {\n      if (sz[a] + sz[b] == k)\n        bar = 1;\n    }\n  }\n  if (bar == 1)\n    cout << \"yes\";\n  if (bar == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, f, zs[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (zs[i]);\n  }\n  for (i = 0; i < n; i++) {\n    f = 0;\n    for (j = 0; j < n, j != i; j++) {\n      if (zs[i] + zs[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  if (f == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, i, j, jude = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        jude = 1;\n        break;\n      }\n  }\n  if (jude == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, sz1[1000], sz2[1000];\n  int t = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz1[i]));\n    sz2[i] = sz1[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (k == sz1[m] + sz2[i]) {\n        t++;\n      }\n    }\n  }\n  if (t > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bj(const void *x, const void *y) {\n  if (*(int *)x > *(int *)y)\n    return 1;\n  if (*(int *)x < *(int *)y)\n    return -1;\n  if (*(int *)x == *(int *)y)\n    return 0;\n}\nint main() {\n  int n, k, i, j, a[1000], pds = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, bj);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] < k)\n        break;\n      else if (a[i] + a[j] == k) {\n        pds = 1;\n        break;\n      }\n    }\n    if (pds == 1)\n      break;\n  }\n  if (pds == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k;\n  int i, j;\n  int sum, a = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (a == 1) {\n      break;\n    } else {\n      for (i = 0; i < n; i++) {\n        sum = sz[j] + sz[i];\n        if ((sum == k) && (i != j)) {\n          a = 1;\n          break;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, m[1000], s = 0, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> m[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (m[i] + m[j] == k)\n        s++;\n    }\n  }\n  if (s > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n >> k;\n  int a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = k - a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == a[i])\n        m++;\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3942", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000] = {0}, flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, biaozhi = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        biaozhi = 1;\n        break;\n      }\n    }\n    if (biaozhi == 1) {\n      break;\n    }\n  }\n  if (biaozhi != 1) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  int dk[1000];\n  scanf(\"%d %d\", &n, &k);\n  cin >> (dk[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &(dk[i]));\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (dk[i] + dk[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n    a += 1;\n  }\n  if (a == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3945", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a;\n  scanf(\"%d %d \", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        break;\n      else {\n        a = sz[i] + sz[j];\n        if (a == k)\n          m++;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, ylf = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  while (i < n && ylf == 0) {\n    j = i + 1;\n    while (j < n && ylf == 0) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        ylf = 1;\n      } else {\n        j++;\n      }\n    }\n    i++;\n  }\n  if (ylf == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3947", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m = 0;\n  int a[1000];\n  int i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - i; j++)\n      if (a[i] + a[i + j] == k)\n        m++;\n\n  if (m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "3948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  int a = 0;\n  for (a = 0; a < n; a++) {\n    m = 0;\n    for (i = a + 1; i < n; i++) {\n      if (sz[a] + sz[i] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k)\n        e++;\n    }\n  }\n  if (e == 0)\n    cout << \"no\";\n  else if (e > 0)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "3950", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, k;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int i, j;\n  int ss[1000];\n  for (i = j = 0; i < n, j < n; i++, j++) {\n    ss[j] = sz[i];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + ss[j] == k && i != j) {\n        c++;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, shu[1000], m;\n  cin >> n >> k;\n  printf(\"\\n\");\n  for (int i = 1; i < n; i++)\n    cin >> shu[i];\n  for (int i = 1; i < n; i++)\n    for (int j = i + 1; j <= n; j++) {\n      m = shu[i] + shu[j];\n      if (m == k) {\n        cout << \"yes\";\n        j = n + 1;\n        i = n + 1;\n      } else if (i == n - 1 && j == n)\n        printf(\"no\");\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "3952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], b = 0, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int m = n - 1; m >= 1; m--) {\n      if (a[m] + a[j] == k && m != j) {\n        printf(\"yes\");\n        b = a[m];\n        c = a[j];\n        break;\n      }\n\n      if (b + c == k)\n        break;\n      if (j == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 1;\n  int sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  cin >> sz[0];\n  for (i = 1; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3954", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[n];\n  int b[n];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    b[i - 1] = a[i - 1];\n  }\n  int c = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int t = i + 1; t <= n; t = t++) {\n      if ((a[i - 1] + b[t - 1]) == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, m, n, k, a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    a = k - sz[i];\n    for (m = 0; m < n; m++) {\n      if (sz[m] == a && m != i) {\n        printf(\"yes\");\n        goto L;\n      }\n    }\n  }\n  printf(\"no\");\nL:\n  return 0;\n}\n"}
{"label": "3", "index": "3956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, p, q, m = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  int gram[n][n], sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      gram[p][q] = sz[p] + sz[q];\n      if (gram[p][q] == k) {\n        m++;\n      }\n    }\n    if (gram[p][q] == k) {\n      m++;\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "3957", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, k, j, a[1000], tempx, tempy, temp = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    tempx = a[i];\n    for (j = i + 1; j < n; j++) {\n      tempy = a[j];\n      if (tempx + tempy == k) {\n        temp++;\n      }\n    }\n  }\n  if (temp >= 1)\n    printf(\"yes\");\n  if (temp == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3958", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[j] == k - a[i]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3959", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++) {\n    for (int s = j + 1; s < n; s++)\n      if (a[s] == k - a[j])\n        p = 1;\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, e, n, i, j, k, s[1000];\n  int t = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      e = s[i + 1];\n      s[i + 1] = s[i];\n      s[i] = e;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((s[i] + s[j]) == m) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], i, j, x = 0, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j])\n        s = k + 1;\n      else\n        s = a[i] + b[j];\n      if (s == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i, j, p = 0, q;\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    int num1;\n    scanf(\"%d\", &num1);\n    num[i] = num1;\n  }\n  for (q = 0; q < n; q++) {\n    for (j = q + 1; j < n; j++) {\n      if ((num[q] + num[j]) == k) {\n        p++;\n        break;\n      }\n    }\n    if (p > 0)\n      break;\n  }\n\n  if (p == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3963", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i += 1) {\n    cin >> (sz[i]);\n  }\n  for (int l = 0; l <= n - 1; l += 1) {\n    for (i = 1; i < n; i += 1) {\n      if (sz[l] + sz[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (l == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, b = 0;\n  int num[1002];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &num[0]);\n  for (i = 1; i <= n - 1; i++)\n    scanf(\" %d\", &num[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (num[i] + num[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      }\n    }\n    if (num[i] + num[j] == k)\n      break;\n  }\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d \", &n);\n  cin >> k;\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    for (int m = 0; m < n; m++) {\n      if (sz[m] + sz[i] == k) {\n        x++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (x > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3966", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1005];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  int f = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  if (f == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "3967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, *a, i, j, flag = 0;\n  cin >> n >> k;\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, ib = 1;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    if (ib) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          ib = 0;\n          break;\n        }\n        if ((i == n - 2) && (a[i] + a[j] != k))\n          printf(\"no\");\n      }\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "3969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, h = 0;\n  int s[1000], g[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> (s[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    g[i] = k - s[i];\n    for (j = 0; j <= n - 1; j++) {\n      if (g[i] == s[j]) {\n        h++;\n      }\n    }\n  }\n  if (h == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3970", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ex(int *x, int *y) {\n  int tmp = 0;\n  tmp = *x;\n  *x = *y;\n  *y = tmp;\n}\nint main() {\n  int n, k;\n  int s = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (int a = 0; a < n; a++) {\n    scanf(\"%d\", &(sz[a]));\n  }\n  for (int b = 0; b < n; b++) {\n    for (int c = b + 1; c < n; c++) {\n      if ((sz[c]) + (sz[b]) == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3971", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3972", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (i = 0; i < n - 2; i++) {\n    for (j = i + 1; j < n - 1; j++) {\n      for (m = j + 1; m < n; m++) {\n        if (sz[i] + sz[j] + sz[m] == k) {\n          printf(\"yes\");\n          return 0;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b, c, d, i, n, j, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        goto loop;\n      }\n  printf(\"no\\n\");\nloop:\n  b = 0;\n}\n"}
{"label": "3", "index": "3974", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[1009], b;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int isbreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j])\n        b = a[i] + a[j];\n      if (b == m) {\n        printf(\"yes\");\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1)\n      break;\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, b;\n  int sz[1000], zz[1000];\n  b = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  i = 0;\n  j = 0;\n  while (i < n && j < n) {\n    zz[j] = sz[i];\n    i++;\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      }\n      if (sz[i] + zz[j] == k) {\n        a = 1;\n      } else {\n        a = 0;\n      }\n\n      if (a == 1 || b == 1) {\n        b = 1;\n      } else {\n        b = 0;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int s = 0;\n  int i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < n) {\n      if (i == j) {\n        j++;\n        continue;\n      } else {\n        s = a[i] + a[j];\n        j++;\n        if (k == s) {\n          cout << \"yes\";\n          goto label;\n        }\n      };\n    };\n    if ((i == n - 1) && (s != k))\n      printf(\"no\");\n  }\nlabel:\n  return (0);\n  return 0;\n}\n"}
{"label": "3", "index": "3977", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int i, j, n, k, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] > k)\n      continue;\n    if (a[i] <= k)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] > k)\n          continue;\n        if (a[i] + a[j] == k)\n          break;\n      }\n    if (j < n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3978", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, e, n, i, j, k, s[1000];\n  int t = 0;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      e = s[i + 1];\n      s[i + 1] = s[i];\n      s[i] = e;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((s[i] + s[j]) == m) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i += 1) {\n    cin >> (sz[i]);\n  }\n  for (int l = 0; l <= n - 1; l += 1) {\n    for (i = 1; i < n; i += 1) {\n      if (sz[l] + sz[i] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n    if (l == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3980", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, b = 0, a, j, array[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &array[i]);\n  for (i = 0; i < n; i++) {\n    a = k - array[i];\n    for (j = 1; j < n; j++) {\n      if (a == array[j]) {\n        b = 1;\n        break;\n      } else\n        continue;\n    }\n    if (b == 1)\n      break;\n  }\n  if (b == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[1000], v[1000];\n  int i, j, n, k, a = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  for (j = 0; j < n; j++) {\n    v[j] = u[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (u[i] + v[j] == k) {\n          a++;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  int a = 0;\n  for (a = 0; a < n; a++) {\n    m = 0;\n    for (i = a + 1; i < n; i++) {\n      if (sz[a] + sz[i] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, K, i, j;\n  int a[1000];\n  scanf(\"%d %d/n\", &n, &K);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == K)\n        goto first;\n    }\n  }\n  goto third;\nfirst:\n  printf(\"yes\");\n  goto second;\nthird:\n  cout << \"no\";\n  return 0;\nsecond:\n  return 0;\n}\n"}
{"label": "3", "index": "3984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], k, i, j, t;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  for (j = 0; j < n - 1; j = j + 1) {\n    for (i = j - 1; i < n - 1; i = i + 1) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, n, j, count, r = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      count = a[i] + a[j];\n\n      if (count == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (count != k) {\n        r++;\n      }\n    }\n    if (count == k) {\n      break;\n    }\n  }\n  if (r == (n * (n - 1) / 2) && (a[n - 1] + a[n - 2]) != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int n, k, a[1000], q = 0, w = 0; \n  cin >> n >> k;\n  for (int i = 0; i < n; i++) \n  {\n    cin >> a[i];\n  }\n  do {\n    for (int i = q + 1; i < n; i++) \n    {\n      if (a[q] + a[i] == k) {\n        cout << \"yes\";\n        w++;\n        break;\n      }\n    }\n    q++;\n  } while (w != 1 && q < n - 1);\n  if (w == 0)\n    cout << \"no\";\n  return 0; \n}\n"}
{"label": "3", "index": "3987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "3988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int c = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int m = 0; m < n - 1; m++) {\n    for (int j = m + 1; j < n; j++) {\n      if (sz[m] + sz[j] == k)\n        c++;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  if (c != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "3989", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, tag = 0, num[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] + num[j] == k) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (tag == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sort(int arr[], int n);\nint bubblesort(int arr[], int n);\n\nint bubblesort(int arr[], int n) {\n  int sorted = 0;\n\n  while (sorted < n - 1) {\n    int changed = 0;\n    int i;\n    for (i = 0; i < n - sorted - 1; i++) {\n      if (arr[i] > arr[i + 1]) {\n        int t = arr[i + 1];\n        arr[i + 1] = arr[i];\n        arr[i] = t;\n        changed = 1;\n      }\n    }\n\n    if (!changed)\n      break;\n\n    sorted++;\n  }\n\n  return arr[n - 1];\n}\n\nint main() {\n  int n, arr[100000], k, i = 0, index = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n\n  bubblesort(arr, n);\n\n  if (arr[0] + arr[1] > k || arr[n - 1] + arr[n - 2] < k) {\n    printf(\"no\");\n    return 0;\n  }\n\n  int flag = 0;\n\n  int n1 = 0, n2 = n - 1;\n  while (n1 < n2) {\n    if (arr[n1] + arr[n2] == k) {\n      cout << \"yes\";\n      return 0;\n    }\n    if (arr[n1] + arr[n2] > k) {\n      n2--;\n    } else\n      n1++;\n  }\n  cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "3991", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, tmp, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  j = 0;\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - i - 1; j++) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (k == a[i] + a[j])\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "3992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    j = i;\n    while (j <= n) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], k, n;\n  int i, j, of = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j]) {\n        if (k == a[i] + a[j])\n          of++;\n      }\n    }\n  }\n  if (of > 0) {\n    printf(\"yes\");\n  }\n  if (of == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3994", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m = 0;\n  int a[1000];\n  int i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++)\n      if (a[i] + a[i + j] == k)\n        m++;\n  }\n  if (m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[n];\n  int b[n];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    b[i - 1] = a[i - 1];\n  }\n  int c = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int t = i + 1; t <= n; t = t++) {\n      if ((a[i - 1] + b[t - 1]) == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3996", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, n, j, count, r = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      count = a[i] + a[j];\n\n      if (count == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (count != k) {\n        r++;\n      }\n    }\n    if (count == k) {\n      break;\n    }\n  }\n  if (r == (n * (n - 1) / 2) && (a[n - 1] + a[n - 2]) != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "3997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j, e, p;\n  int m = 0;\n  int a[1000];\n  int b[499500];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n      e = m;\n    }\n  }\n  p = 0;\n  for (m = 0; m < e; m++) {\n    if (b[m] == k) {\n      p++;\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "3998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, b = 0, a, j, array[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &array[i]);\n  for (i = 0; i < n; i++) {\n    a = k - array[i];\n    for (j = 1; j < n; j++) {\n      if (a == array[j]) {\n        b = 1;\n        break;\n      } else\n        continue;\n    }\n    if (b == 1)\n      break;\n  }\n  if (b == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "3999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, l;\n  l = 0;\n  scanf(\"%d%d\", &n, &k);\n  int j, e, ok, i;\n  ok = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[0] + a[j]) == k) {\n        ok = 1;\n      }\n    }\n    e = a[0];\n    a[0] = a[l];\n    a[l] = e;\n    l++;\n  }\n  if (ok == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n = 0, k = 0, i = 1, j = 0, b = 0;\n  cin >> n >> k;\n\n  int a[1000];\n\n  for (i = 1; i <= n; ++i) {\n    cin >> a[i - 1];\n  }\n\n  for (i = 0; i <= (n - 2); i++)\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (k == a[i] + a[j]) {\n        b = 1;\n      }\n    }\n\n  if (b == 1)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "4001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int y = 0;\n  int s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  int i, u, j, v;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (u = 0; u < n; u++) {\n    for (j = u + 1; j < n; j++) {\n      z[y] = s[u] + s[j];\n      y++;\n    }\n  }\n  int a = 0;\n  for (v = 0; v < y; v++) {\n    if (z[v] == k) {\n      a = 1;\n      break;\n    }\n  }\n  if (a == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  int a = 0;\n  for (a = 0; a < n; a++) {\n    m = 0;\n    for (i = a + 1; i < n; i++) {\n      if (sz[a] + sz[i] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, s[1000], k, m, e, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (i = 0; i < n; i++) {\n    for (m = i + 1; m < n; m++) {\n      e = 0;\n      e = s[i] + s[m];\n      if (s[i] + s[m] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s;\n  s = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if ((sz[j] + sz[i]) == k && j != i) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int p = 0;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  int b[1000][1000];\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    for (j = i + 1; j <= m; j++)\n      b[i][j] = a[i] + a[j];\n  for (i = 1; i <= m; i++) {\n    if (p == 1)\n      break;\n    for (j = 1; j <= m; j++) {\n      if (b[i][j] == n) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4006", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4007", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, flag;\n  int num[1000];\n  int i = 0, j;\n  scanf(\"%d %d \", &n, &k);\n  while (i < n) {\n    i++;\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        cout << \"yes\" << endl;\n        flag = 0;\n        i = n;\n        j = n;\n        break;\n      }\n    }\n  }\n  if (flag)\n    cout << \"no\" << endl;\n}\n"}
{"label": "3", "index": "4008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, p = 0, h[1000][1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i - 1; j++) {\n      h[i][j] = sz[i] + sz[j];\n      if (h[i][j] == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else if (p == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  int flag;\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag) {\n      break;\n    }\n  }\n  if (flag) {\n    printf(\"yes\");\n\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000], a, m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (i < j) {\n        a = x[i] + x[j];\n        if (a == k) {\n          m++;\n          break;\n        }\n      }\n    }\n    if (a == k)\n      break;\n  }\n  if (m != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000];\n  int i, n, k, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] + a[i] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n\n    if ((t == 0) && (i == n - 1)) {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4012", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, p = 0;\n  scanf(\"%d%d\", &n, &m);\n  int sz[1000], pl[1000], a;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    pl[i] = sz[i];\n  }\n\n  for (k = 0; k < n; k++) {\n    for (j = 1; j < n; j++) {\n      a = pl[k] + sz[j];\n      if (a != m)\n        p++;\n    }\n  }\n  if (p == n * (n - 1))\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s[1000], k, j;\n  i = 0, j = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, h;\n  cin >> n >> k;\n  int a[1000], b[1000], sum;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        b[i] += 1;\n        break;\n      }\n    }\n    if (j == n) {\n      b[i] = 0;\n    }\n  }\n  for (h = 0; h < n; h++) {\n    sum += b[h];\n  }\n  if (sum == 0)\n    cout << \"no\\n\";\n  if (sum != 0)\n    cout << \"yes\\n\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, i, a[1000], e, b[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      b[i][j] = a[i] + a[j];\n      if (b[i][j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 1 && j == n - 1) {\n        printf(\"no\");\n      }\n    }\n    if (b[i][j] == k) {\n\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int y = 0;\n  int s[1000], z[1000000];\n  cin >> n >> k;\n  int i, u, j, v;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  for (u = 0; u < n; u++) {\n    for (j = u + 1; j < n; j++) {\n      z[y] = s[u] + s[j];\n      y++;\n    }\n  }\n  int a = 0;\n  for (v = 0; v < y; v++) {\n    if (z[v] == k) {\n      a = 1;\n      break;\n    }\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n  if (a[i] + a[j] != k)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a;\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], zs[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    zs[i] = sz[i];\n  }\n  a = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((zs[j] + sz[i]) == k) {\n        a = 1;\n        break;\n      }\n    }\n  }\n\n  if (a == 1) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, l = 0, s[1000], h[1000][1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      h[i][j] = s[i] + s[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (h[i][j] == k) {\n        l = l + 1;\n      }\n    }\n  }\n  if (l > 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4020", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, p;\n  int sz[1000];\n  scanf(\"%d%d\\n\", &n, &k);\n  p = 0;\n  sz[n] = k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (m = n - 1; m > i; m--) {\n      if (sz[i] + sz[m] == sz[n]) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, g;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  g = 0;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if ((a[i] + a[j]) == k) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  if (g == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, m;\n  s = 0;\n  m = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      m = sz[i] + sz[j];\n      if (m == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1005];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int f = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  if (f == 1)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4024", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int i;\n  int m;\n  int zzd[1001];\n  int hzy[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &zzd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    hzy[i] = zzd[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (zzd[m] + hzy[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == n - 1) {\n      printf(\"no\");\n      break;\n    }\n    if (zzd[m] + hzy[i] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a = 0, tmp, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i] + sz[i + 1] == k)\n        a++;\n      tmp = sz[i + 1];\n      sz[i + 1] = sz[i];\n      sz[i] = tmp;\n    }\n  }\n  if (a != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, e, n, i, j, k, s[1000];\n  int t = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      e = s[i + 1];\n      s[i + 1] = s[i];\n      s[i] = e;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((s[i] + s[j]) == m) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, n, j, count, r = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      count = a[i] + a[j];\n\n      if (count == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (count != k)\n        r++;\n    }\n    if (count == k) {\n      break;\n    }\n  }\n  if (r == (n * (n - 1) / 2) && (a[n - 1] + a[n - 2]) != k) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4028", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int *a;\n  cin >> n >> k;\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4029", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, k2 = 0;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  i = 0;\n  j = 0;\n  while (k2 != k && i < n) {\n    j = i + 1;\n    while (k2 != k && j < n) {\n      k2 = a[i] + a[j];\n      j++;\n    }\n    i++;\n  }\n  if (k2 == k)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4030", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j, shu[1000], y[1000][1000], count = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> shu[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      y[i][j] = shu[i] + shu[j];\n      if (y[i][j] == k)\n        count++;\n    }\n  }\n  if (count == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], e, l, b = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (e = 0; e <= (n - 2); e++) {\n    for (l = (e + 1); l <= (n - 1); l++) {\n      if (k == sz[e] + sz[l]) {\n        b = 1;\n        break;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\");\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4032", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j, shu[1000], y[1000][1000], count = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> shu[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      y[i][j] = shu[i] + shu[j];\n      if (y[i][j] == k)\n        count++;\n    }\n  }\n  if (count == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], sum[1000000], i, j, m = 0, s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      sum[m] = sz[j] + sz[i];\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (sum[i] == k) {\n      sum[i] = 1;\n    } else {\n      sum[i] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    s += sum[i];\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4034", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, max, min, a = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    min = sz[j];\n    for (i = j + 1; i < n; i++) {\n      max = sz[i];\n      if (k == max + min)\n        a = a + 1;\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, sigma;\n  int sb = 0;\n  cin >> n >> sigma;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = 0; k < n; k++) {\n      if (k == j) {\n        continue;\n      } else if (k != j) {\n        if (sz[j] + sz[k] == sigma) {\n          sb = 1;\n          break;\n        }\n      }\n    }\n    if (sb == 1) {\n      break;\n    }\n  }\n  if (sb == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000], n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] + b[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n      if (i == n - 2 && j == n - 1)\n        printf(\"no\");\n    }\n    if (b[i] + b[j] == k)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, num[1000], g = 0;\n  cin >> n >> k;\n  for (i = 0; i<n; cin>> num[i++])\n    ;\n  for (i = 0; i < n - 1; i++)\n    for (int m = i + 1; m < n; m++) {\n      if (num[i] + num[m] == k)\n        g = 1;\n    }\n  cout << (g == 1 ? \"yes\" : \"no\") << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0) {\n      break;\n    }\n    if (j == n - 2 && m == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4039", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, f[1000], o[1000], s, flag, sign;\n  scanf(\"%d%d\", &n, &s);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &f[i]);\n    o[i] = s - f[i];\n  }\n  flag = 0;\n  sign = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (o[j] == f[k]) {\n        printf(\"yes\");\n        flag = 1;\n        sign = 1;\n        break;\n      }\n    }\n    if (sign == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, x = 0;\n  int w[1000];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &w[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      if (m == w[i] + w[j]) {\n        x += 1;\n        break;\n      }\n    }\n    if (x > 0) {\n      break;\n    }\n  }\n\n  if (x > 0) {\n\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4041", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int n, i, j, k, m;\n  m = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if ((sz[i] + sz[t]) == k && i != t) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((sz[i] + sz[t]) == k && i != t) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[1000], n, k, i, j, flag = 0, m;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    m = i;\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[m]) {\n        m = j;\n      }\n    }\n    int temp = array[i];\n    array[i] = array[m];\n    array[m] = temp;\n  }\n\n  for (i = 0, j = n - 1; i < j;) {\n    int temp = array[i] + array[j];\n    if (temp == k) {\n      flag = 1;\n      break;\n    } else if (temp > k) {\n      j--;\n    } else {\n      i++;\n    }\n  }\n  if (flag) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    for (; j < n; j++) {\n      if (k == (a[i] + a[j])) {\n        printf(\"yes\");\n        i = -1;\n        break;\n      }\n    }\n    if (i == -1)\n      break;\n    if (i == n - 1) {\n      printf(\"no\");\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, t, out;\n  int s[1000] = {0, 0};\n  i = 0;\n  scanf(\"%d %d \", &n, &k);\n  while (i < n) {\n    cin >> a;\n    s[i] = a;\n    i = i + 1;\n  }\n  i = 0;\n  out = 0;\n  while (i < n) {\n    t = i + 1;\n    while (t <= n) {\n      if ((s[i] + s[t]) == k) {\n        cout << \"yes\";\n        out = 1;\n        break;\n      } else\n        t = t + 1;\n    }\n    if (out == 1)\n      break;\n    else\n      i = i + 1;\n  }\n  if (i >= n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n)\n      cout << \"no\";\n  }\n}\n"}
{"label": "3", "index": "4047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, n, k, s = 0;\n  scanf(\"%d %d \", &n, &k);\n  int sz[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n    for (j = 0; j <= i; j++) {\n      if (sz[i] + sz[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], i, n, k, t, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  t = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] + a[j] == k) {\n      t = 1;\n      break;\n    } else if (j == n - 1) {\n      i = i + 1;\n      continue;\n    }\n  }\n\n  if (k == 142) {\n    printf(\"yes\");\n  } else if (k == 490) {\n    printf(\"yes\");\n  } else if (k == 245) {\n    printf(\"yes\");\n  } else if (k == 887) {\n    printf(\"yes\");\n  } else if (k == 503) {\n    printf(\"yes\");\n  } else if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, e, a;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n      }\n    }\n  }\n  a = 0;\n  if (sz[n - 1] + sz[n - 2] < k)\n    printf(\"no\");\n  else {\n    if (sz[0] + sz[1] > k) {\n      printf(\"no\");\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        for (j = i + 1; j < n; j++) {\n          if (sz[i] + sz[j] == k) {\n            printf(\"yes\");\n            a = 1;\n            break;\n          }\n        }\n        if (a == 1) {\n          break;\n        }\n      }\n      if (a == 0) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1009], t, l;\n  scanf(\"%d%d\", &n, &k);\n  t = 0;\n  l = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (k == a[i] + a[j]) {\n        l = l + 1;\n\n      } else\n        t = t + 1;\n    }\n  }\n  if (t == n * (n - 1) / 2)\n    printf(\"no\");\n  else if (l >= 1)\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "4051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  s = a[1] + a[2];\n  for (i = 0; i < n; i++) {\n    if (s == k)\n      break;\n    else {\n      for (j = 0; j < n; j++) {\n        s = a[i] + a[j];\n        if (s == k)\n          break;\n        else\n          s = s;\n      }\n    }\n  }\n  if (s == k) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  int a[1002] = {0};\n  int ans = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n    if (ans == 1)\n      break;\n  }\n  if (ans == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, k, m, b = 1, a;\n  int sl[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &m);\n  for (i = 0; i < n; i++)\n    cin >> sl[i];\n\n  if (a = b) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if (a = b) {\n          if ((sl[i] + sl[k]) == m) {\n            printf(\"yes \");\n            b = 0;\n          }\n        }\n      }\n    }\n  }\n  if (b != 0) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if ((sl[i] + sl[k]) == m) {\n          b = 0;\n        }\n      }\n    }\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], i, j, k, n, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i] + b[j] == k)\n        q++;\n  }\n  if (q == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "4055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, y;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (int t = 0; t < (n - 1); t++) {\n    for (int x = t + 1; x < n; x++) {\n      y = (sz[t]) + (sz[x]);\n      if (y == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (y != k && t != (n - 2)) {\n        continue;\n      }\n      if (y != k && t == (n - 2)) {\n        printf(\"no\");\n      }\n    }\n    if (y == k || y != k && t == (n - 2)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, n, k, b = 0;\n  int a[1001] = {0};\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b++;\n        break;\n      }\n      if (b != 0)\n        break;\n    }\n\n  if (b == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "4057", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, sum, flag = 0;\n  int num[1000];\n  scanf(\"%d %d \", &n, &sum);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (num[i] + num[j] == sum) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int i, j;\n  int b, count = 0;\n  b = n * (n - 1);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i != j) {\n        if (a[i - 1] + a[j - 1] == k) {\n          cout << \"yes\";\n          break;\n        } else {\n          count++;\n        }\n      }\n    }\n    if (a[i - 1] + a[j - 1] == k) {\n      break;\n    }\n  }\n  if (count == b) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, s[1000], k, m, e, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = i + 1; m < n; m++) {\n      e = 0;\n      e = s[i] + s[m];\n      if (s[i] + s[m] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], sum;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++)\n    cin >> sz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (k == sum) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (k == sum)\n      break;\n    if (i == (n - 1) && (sz[i - 1] + sz[i]) != k)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000];\n  int i, j;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    if ((a[i] + a[j]) == k) {\n      break;\n    }\n  }\n  if ((a[i] + a[j]) != k) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4062", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, h;\n  cin >> n >> k;\n  int a[1000], b[1000], sum;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        b[i] += 1;\n        break;\n      }\n    }\n    if (j == n) {\n      b[i] = 0;\n    }\n  }\n  for (h = 0; h < n; h++) {\n    sum += b[h];\n  }\n  if (sum == 0) {\n    printf(\"no\\n\");\n  }\n  if (sum != 0)\n    printf(\"yes\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0;\n  scanf(\"%d\", &n);\n  cin >> k;\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n\n      if ((sz[i] + sz[j]) == k) {\n        a++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  }\n  if (a == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1010];\nint main() {\n  int n, i, a, b, c, h = 0, k = 0, j = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j > i; j--) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        h = 1;\n        break;\n      }\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  if (h == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], b[1000], c[1000000];\n  int e = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c[e] = a[i] + b[j];\n        e++;\n      }\n    }\n  }\n  for (i = 0; i <= e; i++) {\n    if (i < e && c[i] == k) {\n      cout << \"yes\\n\";\n      break;\n    }\n    if (i == e && c[e] == k) {\n      printf(\"yes\\n\");\n    } else if (i == e) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4066", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, m;\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if (j == m)\n        printf(\"\");\n      else {\n        if (sz[j] + sz[m] == k) {\n          printf(\"yes\");\n          break;\n        }\n      }\n    }\n    if (sz[j] + sz[m] == k) {\n      break;\n    }\n  }\n  if (j == n && m == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4067", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j, e;\n  int s = 0, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      e = a[i] + a[j];\n      if (e == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, m, t;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[n - 1]);\n  m = 0;\n  t = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n      m++;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (m == n * (n - 1) / 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4069", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, j = 1;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &sz[i]);\n\n  for (i = 0; i < n - 1; i++, j = i + 1) {\n    while (j <= n - 1) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n}\n"}
{"label": "3", "index": "4070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m = 0, k, n, sz[1000], s[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    s[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      break;\n\n    for (m = n - 1; m >= i + 1; m--) {\n      if (s[m] + sz[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (s[m] + sz[i] == k) {\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, i, j, m;\n  int sz[5000];\n  cin >> n >> m;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if ((sz[i] + sz[j]) == m) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, n, m, a, j, b, c, d, e, k;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  b = 0;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      a = sz[k] + sz[i];\n      if (a == m)\n        b = b + 1;\n    }\n  }\n  if (b > 0)\n    printf(\"yes\");\n  else if (b == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, a[1500], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 2; i <= n; i++)\n    for (j = 1; j <= i - 1; j++)\n      if ((a[i] + a[j]) == k)\n        flag = 1;\n  if (n == 1)\n    printf(\"no\");\n  else if (flag)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], i, n, k, t, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  t = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] + a[j] == k) {\n      t = 1;\n      break;\n    } else if (j == n - 1) {\n      i = i + 1;\n      continue;\n    }\n  }\n\n  if (k == 142) {\n    printf(\"yes\");\n  } else if (k == 490) {\n    printf(\"yes\");\n  } else if (k == 245) {\n    printf(\"yes\");\n  } else if (k == 887) {\n    cout << \"yes\";\n  } else if (k == 503) {\n    printf(\"yes\");\n  } else if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4075", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000], b[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + b[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j = 0, num, sum = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    a[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        num = 1;\n      else\n        num = 0;\n      sum = sum + num;\n    }\n  }\n  if (sum == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, a[10000], n, k, f = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 0; l <= n; l++) {\n    for (m = l + 1; m <= n; m++) {\n      if (a[l] + a[m] == k)\n        f = f + 1;\n    }\n  }\n  if (f != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], c = 0, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = c; i < n; i++) {\n    s = a[c] + a[i];\n    if (s == k) {\n      cout << \"yes\";\n      break;\n    }\n    if (i == n - 1) {\n      c = c + 1;\n      i = c;\n    }\n    if (c == n - 1) {\n      printf(\"no\");\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[1000], b[1000], d[1000], c = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (int t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      if (t != i)\n        d[t] = a[t] + b[i];\n      if (d[t] == m)\n        c = c + 1;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (p[i] + p[j] == k)\n        a = 1;\n    }\n  if (a == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4081", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], t, j, p = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    scanf(\"%d\", &a[i]);\n\n    for (j = 0; j < t; j++) {\n      if (a[j] == k - a[i]) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 0)\n    printf(\"no\");\n  if (p == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, j, i, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &sz[i]);\n    } else {\n      scanf(\" %d\", &sz[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m != 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, p;\n  scanf(\"%d %d\", &n, &k);\n  int m = 1;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n && m == 1; i++) {\n    for (p = i + 1; p < n && m == 1; p++) {\n      if (sz[i] + sz[p] == k) {\n        printf(\"yes\");\n        m = 0;\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j, e, p;\n  int m = 0;\n  int a[1000];\n  int b[499500];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n      e = m;\n    }\n  }\n  p = 0;\n  for (m = 0; m < e; m++) {\n    if (b[m] == k) {\n      p++;\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (a = 1; a < n; a++) {\n    for (b = a + 1; b <= n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[a] + sz[b] == k)\n      break;\n\n    if (a == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int i;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        s++;\n        break;\n      }\n    }\n    if (s != 0)\n      break;\n  }\n  if (s == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j, e;\n  int s = 0, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      e = a[i] + a[j];\n      if (e == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, n, k, i, c = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (b = 0; b < n; b++) {\n    for (i = 0; i < n; i++) {\n      if (i != b) {\n        if (a[b] + a[i] != k) {\n          c = c + 1;\n          continue;\n        } else\n          break;\n      }\n    }\n  }\n\n  if (c == n * (n - 1))\n    printf(\"no\");\n  if (c != n * (n - 1))\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, p;\n  scanf(\"%d %d\", &n, &k);\n  int m = 1;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n && m == 1; i++) {\n    for (p = i + 1; p < n && m == 1; p++) {\n      if (sz[i] + sz[p] == k) {\n        printf(\"yes\");\n        m = 0;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4090", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0, b = 0, l[1001], m[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (l[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j <= n - 1 - i; j++) {\n      a = l[i] + l[i + j];\n      b++;\n      m[b] = a;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (m[i] == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == b) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, exict = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i - 1] + a[j - 1] == k) {\n        printf(\"%s\", \"yes\");\n        exict = 1;\n        break;\n      }\n    }\n    if (exict == 1)\n      break;\n  }\n  if (exict == 0)\n    printf(\"%s\", \"no\");\n}\n"}
{"label": "3", "index": "4092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], b[1000], i, j, flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (a[i] + b[j] == k) {\n        flag = 1;\n        break;\n      }\n  printf(\" \");\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, t = 0, a[1000];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[i] + a[i + j] == m) {\n        t++;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else if (t != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int *a;\n  scanf(\"%d %d\", &n, &k);\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 2; i++)\n    for (j = 1 + i; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        s = 1;\n        break;\n      }\n  if (s == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, m, k;\n  int a[1000];\n  cin >> n >> k;\n  for (m = 0; m < n; m++)\n    cin >> a[m];\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t, tmp, a[10000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    for (j = t; j <= n; j++) {\n      if (a[j] < a[t])\n        t = j;\n    }\n    if (t != i) {\n      tmp = a[t];\n      a[t] = a[i];\n      a[i] = tmp;\n    }\n  }\n  t = 0;\n\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k && t == 0) {\n        printf(\"yes\");\n        t = 1;\n      } else if (a[i] + a[j] > k)\n        break;\n    }\n  }\n  if (t == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((a[i] + a[j] == k) && (i != j))\n        break;\n    }\n    if ((a[i] + a[j] == k) && (i != j))\n      break;\n  }\n  if ((a[i] + a[j] == k) && (i != j))\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint u[1000];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> u[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] + u[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  int a[n];\n  char p;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 'y';\n        printf(\"yes\");\n        break;\n      } else\n        continue;\n    }\n    if (p == 'y')\n      break;\n    else {\n      continue;\n    }\n  }\n  if (p == 'y')\n    return 0;\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4100", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int data[n];\n  int i;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &(data[i]));\n  }\n\n  int j;\n  int s = 0;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1) {\n      if (i != j && data[i] + data[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n  }\n\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return (0);\n}\n"}
{"label": "3", "index": "4101", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint u[1000];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &u[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] + u[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[999];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b = 0;\n  for (i = 0; i <= n - 2; i++)\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        b = b + 1;\n      }\n    }\n  if (b >= 1) {\n    printf(\"yes\\n\");\n  } else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4103", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int i;\n  int m;\n  int zzd[1001];\n  int hzy[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> zzd[i];\n  }\n  for (i = 0; i < n; i++) {\n    hzy[i] = zzd[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (zzd[m] + hzy[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == n - 1) {\n      printf(\"no\");\n      break;\n    }\n    if (zzd[m] + hzy[i] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, f;\n  int a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  f = 1;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i != j)\n        if (a[i] + a[j] == k) {\n          f = 0;\n          break;\n        }\n\n  if (f)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1005], ans = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", (ans ? \"yes\" : \"no\"));\n}\n"}
{"label": "3", "index": "4106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, flag;\n  int a[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  flag = 0;\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        cout << \"yes\";\n        flag = 1;\n        break;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4107", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() \n{\n  int n, k, i, j, s, t = 0, a[1000]; \n  cin >> n >> k;                     \n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  } \n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        t = t + 1;\n    }\n  } \n  if (t == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl; \n  return 0;\n}\n"}
{"label": "3", "index": "4108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int sz[1001];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int bar = 0;\n  for (int a = 0; a < n; a++) {\n    for (int b = a + 1; b < n; b++) {\n      if (sz[a] + sz[b] == k)\n        bar = 1;\n    }\n  }\n  if (bar == 1)\n    printf(\"yes\");\n  if (bar == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, n, j, count, r = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      count = a[i] + a[j];\n\n      if (count == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (count != k) {\n        r++;\n      }\n    }\n    if (count == k) {\n      break;\n    }\n  }\n  if (r == (n * (n - 1) / 2) && (a[n - 1] + a[n - 2]) != k) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4111", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, m;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (a[i] + a[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j = 0, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    for (i = j + 1; i < n; i++) {\n      if ((a[j] + a[i]) == k) {\n        printf(\"yes\");\n        j = n;\n      }\n      if (j == n)\n        break;\n      if (j == n - 2)\n        cout << \"no\";\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int xl[1000];\n  int i;\n  int result;\n  int a = 0, b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> xl[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      result = xl[i] + xl[j];\n      if (result == k) {\n        a++;\n      } else {\n        b++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int *num = (int *)malloc(n * sizeof(int));\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", num + i);\n  for (i = 0; i <= n / 2; i++)\n    for (j = 0; j < n; j++) {\n      if (*(num + i) + *(num + j) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      } else\n        continue;\n    }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, *pt, flag = 1;\n  scanf(\"%d%d\", &n, &k);\n  pt = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", pt + i);\n  for (i = 0; i < n - 1; i++)\n    if (flag)\n      for (j = i + 1; j < n; j++)\n        if ((pt[i] + pt[j]) == k) {\n          flag = 0;\n          break;\n        }\n  if (flag)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  free(pt);\n}\n"}
{"label": "3", "index": "4116", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m, t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  if ((n == 1) && (a[0] == k)) {\n    t = 1;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      if (sz[j] + sz[l] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  cin >> n >> k;\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n  int f = 0;\n  int sum;\n  for (i = 0; i < n; i++) {\n    for (int t = 0; t < n; t++) {\n      sum = sz[i] + sz[t];\n      if (sum == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j = 0, flag = 0;\n  int str[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  i = 0;\n  for (i = 0; i < n / 2 + 1; i++) {\n    j = 0;\n    for (j = 0; j < n; j++) {\n      if ((k - str[j]) == str[i]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag == 1) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (flag == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, r, f;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  f = 0;\n  for (j = 0; j < n; j++) {\n    for (r = j + 1; r < n; r++) {\n      if (a[j] + a[r] == k)\n        f++;\n    }\n  }\n  if (f > 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4121", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, m, s;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      if ((a[i] + a[m]) == k && a[i] != a[m]) {\n        s = 1;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4122", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, k;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int i, j;\n  int ss[1000];\n  for (i = j = 0; i < n, j < n; i++, j++) {\n    ss[j] = sz[i];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + ss[j] == k && i != j) {\n        c++;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4123", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, x, s;\n  s = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (x = 1; x <= n - 1 - i; x++) {\n      if (a[i] + a[i + x] == k) {\n        s = s * 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4124", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint ex(int *x, int *y) {\n  int tmp = 0;\n  tmp = *x;\n  *x = *y;\n  *y = tmp;\n}\nint main() {\n  int n, k;\n  int s = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (int a = 0; a < n; a++) {\n    scanf(\"%d\", &(sz[a]));\n  }\n  for (int b = 0; b < n; b++) {\n    for (int c = b + 1; c < n; c++) {\n      if ((sz[c]) + (sz[b]) == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1001], t, w, e;\n  scanf(\"%d%d\", &n, &m);\n  t = 0;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i; j <= n - 1; j++)\n      if (a[i] + a[j] == m) {\n        t = 1;\n        break;\n      }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, j, a, c, e, x, b, d, h;\n  int k, n;\n  int m[1000], t;\n  scanf(\"%d%d\", &n, &x);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (m[i] + m[j] == x)\n        goto A;\n    }\n  }\nA:\n  if (i == n + 1)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], YN = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j; m < n; m++) {\n      int he = a[j] + a[m];\n      if (he == k) {\n        YN = 1;\n        break;\n      }\n    }\n  }\n  if (YN == 1)\n    cout << \"yes\";\n  else if (YN == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n - 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int xl[1000] = {0};\n  int n = 0, k = 0;\n  scanf(\"%d\", &n);\n  cin >> k;\n  int i = 0, j = 0;\n  int a = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &xl[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      if (xl[i] + xl[j] == k) {\n        printf(\"%c%c%c\", 'y', 'e', 's');\n        a = 1;\n        break;\n      }\n    }\n    if (a == 1) {\n      break;\n    }\n  }\n  if (a == 0) {\n    cout << 'n' << 'o';\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[1000], i, j, t = 0, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      for (k = i + 1; k < n; k++) {\n        if (m == a[j] + a[k])\n          t++;\n        break;\n      }\n\n  if (t != 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, t = 0, a[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[i] + a[i + j] == m) {\n        t++;\n      }\n    }\n  }\n  if (t == 0) {\n    cout << \"no\";\n  } else if (t != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, s[1000], a;\n  cin >> n >> b;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (int k = 0; k < n; k++) {\n    for (int i = 1; i < n - k; i++) {\n      a = s[k] + s[k + i];\n      if (a == b) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, biaozhi = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        biaozhi = 1;\n        break;\n      }\n    }\n    if (biaozhi == 1) {\n      break;\n    }\n  }\n  if (biaozhi != 1) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  char p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 'y';\n        printf(\"yes\");\n        break;\n      } else\n        continue;\n    }\n    if (p == 'y')\n      break;\n    else\n      continue;\n  }\n  if (p == 'y')\n    return 0;\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4136", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a = 0, tmp, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &sz[i]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i] + sz[i + 1] == k)\n        a++;\n      tmp = sz[i + 1];\n      sz[i + 1] = sz[i];\n      sz[i] = tmp;\n    }\n  }\n  if (a != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, s;\n  s = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if ((sz[j] + sz[i]) == k && j != i) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a, h;\n  int sz[1000];\n  h = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int r = 0; r < n; r++) {\n      a = sz[j] + sz[r];\n      if (a != k) {\n        h++;\n      }\n    }\n  }\n  if (h == n * n) {\n    cout << \"no\";\n  } else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], k, i, j, s, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  m = n * (n - 1);\n  int *h = (int *)malloc(sizeof(int) * m);\n  s = 0;\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n && j != i; j++) {\n      h[s] = sz[i] + sz[j];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (h[i] == k) {\n      t++;\n    }\n  }\n  if (t == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  free(h);\n  return 0;\n}\n"}
{"label": "3", "index": "4140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        if (t == 0) {\n          t = 1;\n        } else {\n          t = 1;\n        }\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int *a;\n  scanf(\"%d %d\", &n, &k);\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++)\n    for (j = 1 + i; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        s = 1;\n        break;\n      }\n  if (s == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000], i = 1;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  int ceshi = 0;\n  int x1, j = 1;\n  for (j = 1; j <= n - 1; j++) {\n    for (x1 = n; x1 >= j + 1; x1--) {\n      if (a[j] + a[x1] == k) {\n        ceshi = 1;\n      }\n    }\n  }\n  if (ceshi == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int t = 0; t < n; t++)\n    scanf(\"%d \", &a[t]);\n\n  for (int i = 0; i < n - 1; i++) {\n    for (int m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      if (i == n - 2 && m == n - 1 && a[i] + a[m] != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4144", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i <= n; i++) {\n      if (x[j] + x[i] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n\n  scanf(\"%d %d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "4146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n - 2)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j, t;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        t = 0;\n        break;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4148", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, p, l = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int s[2][1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[0][i]));\n    s[1][i] = k - s[0][i];\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if ((s[1][i] == s[0][p]) && (i != p)) {\n        l++;\n      }\n    }\n  }\n  if (l == 0) {\n    printf(\"no\");\n  }\n  if (l != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint u[1000];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> u[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] + u[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, f, k, s;\n  int sz[1000];\n  f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n      s = sz[j] + sz[m];\n      if ((s == k) && (f == 0)) {\n        f = 1;\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4151", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, n, k, i, c = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (b = 0; b < n; b++) {\n    for (i = 0; i < n; i++) {\n      if (i != b) {\n        if (a[b] + a[i] != k) {\n          c = c + 1;\n          continue;\n        } else\n          break;\n      }\n    }\n  }\n\n  if (c == n * (n - 1)) {\n    printf(\"no\");\n  }\n  if (c != n * (n - 1))\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> num[i];\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n\n      if (num[j] + num[m] == k) {\n        c = 0;\n        break;\n      }\n    }\n    if (c == 0)\n      break;\n  }\n  if (c == 1)\n    printf(\"no\\n\");\n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4153", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], c = 0, s;\n  cin >> n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = c; i < n; i++) {\n    s = a[c] + a[i];\n    if (s == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      c = c + 1;\n      i = c;\n    }\n    if (c == n - 1) {\n      printf(\"no\");\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4154", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1001], k, n, j, i, check;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  check = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + a[j] == k) && (a[i] != a[j])) {\n        check = 1;\n        break;\n      }\n    }\n    if (check == 1)\n      break;\n  }\n  if (check == 0) {\n    printf(\"no\\n\");\n\n  } else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s[1000], k, j;\n  i = 0, j = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(s[i]));\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (i != j && a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int c[1000];\n  int i = 0, j = 0, A = 0;\n  cin >> n >> k;\n  while (i < n) {\n    scanf(\"%d\", &c[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (c[i] + c[j] == k)\n        A = 1;\n      j++;\n    }\n    i++;\n  }\n  if (A == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n\n  int l = 0;\n  while (l < n - 1) {\n    j = l + 1;\n    while (j < n) {\n      if (sz[l] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n    l++;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[10000];\n  int b[10000];\n  int ans = 0;\n  cin >> n >> k;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = k - a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; i <= n && j != i; j++) {\n      if (a[i] == b[j])\n        ans = 1;\n    }\n  }\n  if (ans == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, k, s;\n  int a[1000], flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = k - a[i];\n    for (j = i + 1; j < n; j++) {\n      if (s == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j, sum, res;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  res = 0;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        res = res + 1;\n      }\n    }\n  }\n  if (res == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, m = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000000], b[1000000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == a[j]) {\n        m = m + 1;\n      }\n      if (b[i] != a[j]) {\n        m = m;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\\n\");\n  }\n  if (m == 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4164", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[1000], n, k, i, j, flag = 0, m;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> array[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    m = i;\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[m]) {\n        m = j;\n      }\n    }\n    int temp = array[i];\n    array[i] = array[m];\n    array[m] = temp;\n  }\n\n  for (i = 0, j = n - 1; i < j;) {\n    int temp = array[i] + array[j];\n    if (temp == k) {\n      flag = 1;\n      break;\n    } else {\n      if (temp > k) {\n        j--;\n      } else {\n        i++;\n      }\n    }\n  }\n  if (flag) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4165", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, k, a[1000], y, sum = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        int t;\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= k) {\n      y = i;\n      break;\n    }\n  }\n  if (i >= n)\n    y = n;\n  for (i = 0; i < y; i++) {\n    for (j = i + 1; j < y; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      sum = 0;\n    }\n  }\n  if (i >= y) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int u[1000], v[1000];\n  int i, j, n, k, a = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  for (j = 0; j < n; j++) {\n    v[j] = u[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (u[i] + v[j] == k) {\n          a++;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, p;\n  int m = 0;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (p = 1; p < n - i; p++) {\n      if (sz[i] == k - sz[i + p]) {\n        printf(\"yes\");\n        break;\n      } else\n        m++;\n    }\n    if (sz[i] == k - sz[i + p]) {\n\n      break;\n    }\n  }\n\n  if (m == n * (n - 1) / 2)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, b = 0;\n  int num[1002];\n  scanf(\"%d %d\\n\", &n, &k);\n  cin >> num[0];\n  for (i = 1; i <= n - 1; i++)\n    scanf(\" %d\", &num[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (num[i] + num[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      }\n    }\n    if (num[i] + num[j] == k)\n      break;\n  }\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1001];\n  int n, k, i, j, q = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k)\n        q = 1;\n    }\n  }\n  if (q == 1)\n    cout << \"yes\";\n  else {\n    if (q == 0)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, x = 0;\n  int w[1000];\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> w[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      if (m == w[i] + w[j]) {\n        x += 1;\n        break;\n      }\n    }\n    if (x > 0) {\n      break;\n    }\n  }\n\n  if (x > 0) {\n\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, j, t;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        t = 0;\n        break;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4172", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, l = 0, s[1000], h[1000][1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      h[i][j] = s[i] + s[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (h[i][j] == k) {\n        l = l + 1;\n      }\n    }\n  }\n  if (l > 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int shuzu[1000];\n  scanf(\"%d %d\", &n, &k);\n\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  int count1 = 0;\n  for (int j = 1; j <= n; j++) {\n    for (int i = (j - 1); i < n; i++) {\n      if (k == (shuzu[j] + shuzu[i])) {\n        count1 += 1;\n      } else\n        continue;\n    }\n  }\n  if (count1 != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag;\n  int a[1000];\n  cin >> n >> k;\n  flag = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] + a[i] == k)\n        flag = 1;\n  }\n  if (flag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4175", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b[1000];\n  int i, j = 0, n, k, l, t;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] <= k) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = i + 1; l < j; l++) {\n      t = b[i] + b[l];\n      if (t == k) {\n        printf(\"yes\");\n        goto loop;\n      }\n    }\n  if (i >= (j - 1))\n    printf(\"no\");\nloop:\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4176", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (a = 1; a < n; a++) {\n    for (b = a + 1; b <= n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[a] + sz[b] == k) {\n      break;\n    }\n    if (a == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  int z[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  c = 0;\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n  for (a = 0; a <= n - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      if (z[a] + z[b] == k)\n        c = 1;\n    }\n  }\n  if (c == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if (sz[i] + sz[t] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[t] == k) {\n      break;\n    }\n  }\n  if (i == n && t == n)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, n, i, j, b, t = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (k == b) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  }\n  if (t == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000];\n  int i, j, flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(a + i) + *(a + j) == k) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag)\n    printf(\"yes \");\n  else\n    printf(\"no \");\n  return 0;\n}\n"}
{"label": "3", "index": "4181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, flag;\n  int a[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  cin >> a[0];\n  flag = 0;\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, d = 0, a[1000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        d++;\n      }\n    }\n  }\n  if (d != 0) {\n    printf(\"yes\");\n  } else if (d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = k - a[i];\n  }\n\n  for (int m = 1; m <= n; m++) {\n    for (i = 1; i <= n; i++) {\n      if (a[m] == b[i]) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;      \n  cin >> n >> k; \n  int a[n];\n  int i, j;    \n  int yes = 0; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  } \n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        yes = 1;\n      }\n    }\n  }\n  if (yes == 0) {\n    cout << \"no\";\n  } \n  if (yes == 1) {\n    cout << \"yes\";\n  } \n  return 0;\n}\n"}
{"label": "3", "index": "4185", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, y;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n\n  for (int t = 0; t < (n - 1); t++) {\n    for (int x = t + 1; x < n; x++) {\n      y = (sz[t]) + (sz[x]);\n      if (y == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (y != k && t != (n - 2)) {\n        continue;\n      }\n      if (y != k && t == (n - 2)) {\n        printf(\"no\");\n      }\n    }\n    if (y == k || y != k && t == (n - 2)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4186", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s[1000], z[1000], j, g = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    z[i] = s[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i] != z[j] && s[i] + z[j] == k) {\n        g += 1;\n      }\n    }\n  }\n  if (g > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100000] = {0}, n, k, x, i;\n  int ifind = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    if (x > k)\n      continue;\n    if (a[x] == 1) {\n      ifind = 1;\n      break;\n    }\n    a[k - x] = 1;\n  }\n  if (ifind)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a, e[10008], i, j, m, log;\n  log = 0;\n  scanf(\"%d %d\", &n, &k);\n  if (n == 1) {\n    if (n == k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    scanf(\"%d\", &a);\n    e[1] = a;\n    for (i = 2; i <= n; i++) {\n      scanf(\" %d\", &a);\n      e[i] = a;\n    }\n    for (j = 1; j <= n; j++) {\n      for (m = n; m > j; m--) {\n        if ((e[j] + e[m]) == k) {\n          printf(\"yes\");\n          log = 1;\n          break;\n        }\n      }\n      if (log > 0.1) {\n        break;\n      }\n    }\n    if (log < 0.1) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int j = 0; j < n; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n\n  for (int e = 0; e <= n; e++) {\n    for (int i = e + 1; i < n; i++) {\n      if (a[e] + a[i] == k) {\n        cout << \"yes\";\n        e = n + 1;\n        i = n;\n      }\n    }\n    if (e == n)\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, t = 0, a[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[i] + a[i + j] == m) {\n        t++;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else if (t != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int s = 0;\n  cin >> n;\n  cin >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int z = 0; z < n; z++) {\n    for (j = z + 1; j < n; j++) {\n      if (a[z] + a[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n    if (a[z] + a[j] == k)\n      break;\n  }\n  if (s == 1)\n    cout << \"yes\";\n  else if (s == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4192", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, g[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &g[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (g[i] + g[j] == k) {\n        printf(\"yes\");\n        break;\n      } else if (i == n - 2) {\n        printf(\"no\");\n      }\n    }\n    if (g[i] + g[j] == k) {\n      break;\n    } else if (i == n - 2) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4193", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, j, a, c, e, x, b, d, h;\n  int k, n;\n  int m[1000];\n  scanf(\"%d %d \", &n, &x);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (m[i] + m[j] == x)\n        goto A;\n    }\n  }\nA:\n  if (i == n + 1)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], sum[1000000], i, j, m = 0, s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      sum[m] = sz[j] + sz[i];\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (sum[i] == k) {\n      sum[i] = 1;\n    } else\n      sum[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    s += sum[i];\n  }\n  if (s == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int c[1000];\n  int i = 0, j = 0, A = 0;\n  scanf(\"%d%d\", &n, &k);\n  while (i < n) {\n    scanf(\"%d\", &c[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (c[i] + c[j] == k)\n        A = 1;\n      j++;\n    }\n    i++;\n  }\n  if (A == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000][1000];\n  int m;\n  m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k; j > i; j--) {\n      if ((a[i] - a[j]) == k) {\n        printf(\"yes\");\n        m = 1;\n        return 0;\n      }\n    }\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5000], n, i, t, m, c, I = 0, k;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (t = i - 1; t > 0; t--) {\n    for (c = 0; c < t; c++) {\n      if (a[c] > a[c + 1]) {\n        m = a[c];\n        a[c] = a[c + 1];\n        a[c + 1] = m;\n      }\n    }\n  }\n  m = 0;\n  for (I = 0; I < n - 1; I++) {\n    for (t = I + 1; t < n; t++) {\n      if (a[I] + a[t] == k) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"yes\");\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 0;\n  int a[1001]; \n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) \n      {\n        cout << \"yes\" << endl;\n        flag = 1;\n        break;\n      }\n    if (a[i] + a[j] == k)\n      break;\n  }\n  if (flag != 1)\n    cout << \"no\" << endl; \n  return 0;\n}\n"}
{"label": "3", "index": "4199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, i, j, s;\n  int sz[2000];\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      a = sz[i];\n      b = sz[j];\n      if (a + b == k) {\n        s++;\n      }\n    }\n  }\n  if (s != 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, *a, i, j, flag = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1001], i, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i + 1] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (q = 1; q < n + 1; q++) {\n      if (a[i] + b[q] == k) {\n        printf(\"yes\\n\");\n        if (q == n) {\n          q--;\n        }\n        break;\n      }\n    }\n    if (q < n)\n      break;\n    if (i == n - 1) {\n      printf(\"no\\n\");\n    }\n  }\n}\n"}
{"label": "3", "index": "4202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, i, j, m;\n  int sz[5000];\n  scanf(\"%d%d\", &n, &m);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if ((sz[i] + sz[j]) == m) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, m = 0, s1[1000], s2[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s1[i]);\n    s2[i] = s1[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (a = (i + 1); a < n; a++) {\n      if (s1[i] + s2[a] == k) {\n        m++;\n      }\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4204", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, s = 0, a[10000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (f == 0) {\n      for (j = 0; j < i; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\\n\");\n          f = 1;\n          s = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (s == 0)\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sl[1000], sz[1000][1000], i, p, s;\n  s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      sz[i][p] = sl[i] + sl[p];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if (sz[i][p] == k) {\n        sz[i][p] = 1;\n      } else {\n        sz[i][p] = 0;\n      }\n      s = s + sz[i][p];\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], i, n, k, t, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  t = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] + a[j] == k) {\n      t = 1;\n      break;\n    } else if (j == n - 1) {\n      i = i + 1;\n      continue;\n    }\n  }\n\n  if (k == 142) {\n    printf(\"yes\");\n  } else if (k == 490) {\n    printf(\"yes\");\n  } else if (k == 245) {\n    printf(\"yes\");\n  } else if (k == 887) {\n    printf(\"yes\");\n  } else if (k == 503) {\n    printf(\"yes\");\n  } else if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[2000];\n  int n, k, s, b;\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i >= 1 && i < n)\n      for (int a = 0; a < i; a++) {\n        s = sz[i] + sz[a];\n        if (s == k)\n          b++;\n      }\n  }\n  if (b != 0)\n    printf(\"yes\");\n  else if (b == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4208", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m[1000], a;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (m[i]);\n    for (a = 0; a < i; a++) {\n      if (k == m[a] + m[i]) {\n        printf(\"yes\\n\");\n        goto abc;\n      }\n    }\n  }\n  printf(\"no\\n\");\nabc:\n  return 0;\n}\n"}
{"label": "3", "index": "4209", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  if (i > n - 2)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], sum[1000000], i, j, m = 0, s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      sum[m] = sz[j] + sz[i];\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (sum[i] == k) {\n      sum[i] = 1;\n    } else {\n      sum[i] = 0;\n    }\n  }\n  for (i = 0; i < m; i++)\n    s += sum[i];\n\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, i, a, s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n; j++) {\n    if (s == 1) {\n      break;\n    }\n    for (a = n - 1; a >= 0; a--) {\n      if ((a != j) && (sz[a] + sz[j] == k)) {\n        s = 1;\n        break;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, num[1000], i, j, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &num[i - 1]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (num[i - 1] + num[j - 1] == k) {\n        p = p + 1;\n        break;\n      }\n    if (p > 0)\n      break;\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int sz[1001];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  int l = 0;\n  while (l < n - 1) {\n    j = l + 1;\n    while (j < n) {\n      if (sz[l] + sz[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      j++;\n    }\n    l++;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1001];\n\n  int n, i, k, a, b;\n  b = 0;\n  cin >> n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    if (i != n - 1) {\n      for (a = i + 1; a < n; a++) {\n        if (sz[i] + sz[a] == k) {\n          b = b - 1000000;\n          break;\n        }\n        b = b + 1;\n      }\n    }\n  }\n  if (b == (n * (n - 1)) / 2)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], x = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        x = 1;\n        break;\n      };\n    }\n  }\n  if (x == 1)\n    printf(\"yes\\n\");\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sort(int arr[], int n);\nint bubblesort(int arr[], int n);\n\nint bubblesort(int arr[], int n) {\n  int sorted = 0;\n\n  while (sorted < n - 1) {\n    int changed = 0;\n    int i;\n    for (i = 0; i < n - sorted - 1; i++) {\n      if (arr[i] > arr[i + 1]) {\n        int t = arr[i + 1];\n        arr[i + 1] = arr[i];\n        arr[i] = t;\n        changed = 1;\n      }\n    }\n\n    if (!changed)\n      break;\n\n    sorted++;\n  }\n\n  return arr[n - 1];\n}\n\nint main() {\n  int n, arr[100000], k, i = 0, index = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n\n  bubblesort(arr, n);\n\n  if (arr[0] + arr[1] > k || arr[n - 1] + arr[n - 2] < k) {\n    printf(\"no\");\n    return 0;\n  }\n\n  int flag = 0;\n\n  int n1 = 0, n2 = n - 1;\n  while (n1 < n2) {\n    if (arr[n1] + arr[n2] == k) {\n      cout << \"yes\";\n      return 0;\n    }\n    if (arr[n1] + arr[n2] > k) {\n      n2--;\n    } else\n      n1++;\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n, k, i;\n  i = 0;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (a = 0; a < n; a++) {\n    scanf(\"%d \", &(sz[a]));\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b > a; b--) {\n      c = sz[a] + sz[b];\n      if (c == k) {\n        i = n * n * n;\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (i == n * (n - 1) / 2) {\n      printf(\"no\");\n      break;\n    } else if (i == n * n * n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, b, judge = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[1001];\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          cout << \"yes\";\n          judge = 1;\n          break;\n        }\n      }\n    }\n    if (judge == 1)\n      break;\n\n    if (i == n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < (n - 1); i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4220", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1005];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  int f = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  if (f == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> (a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = k - a[i];\n  }\n  for (int m = 1; m <= n; m++) {\n    for (i = 1; i <= n; i++) {\n      if (a[m] == b[i]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4222", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], b[10000], j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      b[i] = a[i] + a[j];\n      if (b[i] == k) {\n        break;\n      } else\n        continue;\n    }\n    if (b[i] == k) {\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (b[i] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, c, d, f, m;\n  m = 0;\n  cin >> b >> c;\n  for (d = b; d > 0; d = d - 1)\n    cin >> a[d];\n  for (d = 1; d <= b; d++) {\n    for (f = 1; f <= b; f++) {\n      if ((a[f] + a[d]) == c && f != d)\n        m = 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000], n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] + b[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n      }\n    }\n    if (b[i] + b[j] == k) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4225", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, s[1000], k, m, e, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = i + 1; m < n; m++) {\n      e = 0;\n      e = s[i] + s[m];\n      if (s[i] + s[m] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4226", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000], n, k, i, j, l = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (n - 1); j > i; j--) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (i == (n - 1))\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n\n  int e;\n  int m;\n  for (m = 1; m <= n; m++) {\n    int j;\n    for (j = 0; j < n - m; j++) {\n      if (sz[j] > sz[j + 1]) {\n        e = sz[j + 1];\n        sz[j + 1] = sz[j];\n        sz[j] = e;\n      }\n    }\n  }\n\n  int M;\n  int x, sum = 0;\n\n  int j;\n  for (j = n - 1; j >= 0; j--)\n    for (x = j - 1; x >= 0; x--) {\n      if (k == sz[j] + sz[x]) {\n        sum += 1;\n      }\n    }\n  if (sum == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1 + i; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && j == n - 1) {\n        cout << \"no\";\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000];\n  j = 1;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = j; i < n; i++) {\n    if (sz[j] + sz[i + 1] == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      j++;\n      i = j;\n    }\n    if (j == n - 1) {\n      if (sz[j] + sz[i + 1] == k) {\n        printf(\"yes\");\n        break;\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000] = {0}, i, j, t = 0, *p, *pt;\n  scanf(\"%d%d\", &n, &k);\n  for (p = a; p < n + a; p++)\n    scanf(\"%d\", p);\n  for (p = a; p < n - 1 + a; p++) {\n    for (pt = p + 1; pt < n + a; pt++)\n      if ((*p) + (*pt) == k)\n        t = 1;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s;\n  s = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if ((sz[j] + sz[i]) == k && j != i) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000] = {0}, i, j, t = 0, *p, *pt;\n  scanf(\"%d%d\", &n, &k);\n  for (p = a; p < n + a; p++)\n    scanf(\"%d\", p);\n  for (p = a; p < n - 1 + a; p++) {\n    for (pt = p + 1; pt < n + a; pt++)\n      if ((*p) + (*pt) == k)\n        t = 1;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, sigma;\n  int sb = 0;\n  cin >> n >> sigma;\n  int sz[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n; j++) {\n    for (int k = 0; k < n; k++) {\n      if (k == j) {\n        continue;\n      } else if (k != j) {\n        if (sz[j] + sz[k] == sigma) {\n          sb = 1;\n          break;\n        }\n      }\n    }\n    if (sb == 1) {\n      break;\n    }\n  }\n  if (sb == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4236", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], q = 0, w = 0;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  do {\n    for (int i = q + 1; i < n; i++) {\n      if (a[q] + a[i] == k) {\n        cout << \"yes\";\n        w++;\n        break;\n      }\n    }\n    q++;\n  } while (w != 1 && q < n - 1);\n  if (w == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (m[i] + m[j] == k)\n        break;\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4238", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int sum, out_put = 0;\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j + 1; m < n; m++) {\n      sum = sz[j] + sz[m];\n      if (sum == k) {\n        out_put = 1;\n        break;\n      }\n    }\n    if (out_put == 1) {\n      break;\n    }\n  }\n  if (out_put == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n)\n      printf(\"no\");\n  }\n}\n"}
{"label": "3", "index": "4240", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], s;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    for (j = 0; j < n - i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        printf(\"yes\\n\");\n        goto mq;\n      }\n    }\n  }\nmq:\n  if (s != k)\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "4241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], b[10000], j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      b[i] = a[i] + a[j];\n      if (b[i] == k) {\n        break;\n      } else {\n        continue;\n      }\n    }\n    if (b[i] == k) {\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (b[i] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], s = 0, c, e = 0, i;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (c = 0; c < n; c++) {\n      if (a[i] + b[c] == k) {\n        cout << \"yes\";\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j = 0, flag = 0;\n  int str[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  i = 0;\n  for (i = 0; i < n / 2 + 1; i++) {\n    j = 0;\n    for (j = 0; j < n; j++) {\n      if ((k - str[j]) == str[i]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag == 1) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, i, k, q, y = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, q = 0; i < n, q < n; i++, q++) {\n    scanf(\"%d\", &x);\n    a[i] = x;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (q = i + 1; q < n; q++) {\n      if (a[i] + a[q] == k) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n  if (y == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, d = 0, a[1000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 1; j <= i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        d++;\n      }\n    }\n  }\n  if (d != 0) {\n    printf(\"yes\");\n  } else if (d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4246", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, r, f;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  f = 0;\n  for (j = 0; j < n; j++) {\n    for (r = j + 1; r < n; r++) {\n      if (a[j] + a[r] == k) {\n        f++;\n      }\n    }\n  }\n  if (f > 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, i, n, k, j, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        b = 1;\n      else\n        continue;\n    }\n  }\n  if (b == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4248", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000], b[1000][1000], c = 0, d = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[i][j] = a[i] + a[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i][j] == k) {\n        c++;\n\n      } else {\n        d++;\n      }\n    }\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4250", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, z, a[1000];\n  scanf(\"%d%d\", &i, &k);\n  cin >> a[0];\n  a[0] = k - a[0];\n  for (j = 1; j <= i - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    for (z = 0; z <= j - 1; z++) {\n      if (a[j] == a[z]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    a[j] = k - a[j];\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int p, m;\n  for (m = 0; m < n - 1; m++) {\n    for (p = m + 1; p < n; p++) {\n      if (k == sz[m] + sz[p])\n        break;\n    }\n    if (p == n)\n      continue;\n    else if (p < n && k == sz[m] + sz[p]) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (m == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  int dk[1000];\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &(dk[0]));\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &(dk[i]));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (dk[i] + dk[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    a += 1;\n  }\n  if (a == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag;\n  int a[1000];\n  cin >> n >> k;\n  flag = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] + a[i] == k)\n        flag = 1;\n  }\n  if (flag == 1)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, m, i, l = 0, t, j;\n  int a[1000] = {0};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    t = n - a[i];\n    for (j = i + 1; j < m; j++)\n      if (a[j] == t) {\n        printf(\"yes\");\n        l++;\n        break;\n      }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, sz1[1000], sz2[1000];\n  int t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz1[i]));\n    sz2[i] = sz1[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (k == sz1[m] + sz2[i]) {\n        t++;\n      }\n    }\n  }\n  if (t > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, x[1000] = {0}, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((x[i] + x[j]) == k)\n      break;\n  }\n  if ((x[i] + x[j]) != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a;\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], zs[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    zs[i] = sz[i];\n  }\n  a = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((zs[j] + sz[i]) == k) {\n        a = 1;\n        break;\n      }\n    }\n  }\n\n  if (a == 1)\n    printf(\"yes\\n\");\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[1000], i = 0, j = 0, m, t;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], x = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        x = 1;\n        break;\n      };\n    }\n  }\n  if (x == 1) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  int *a = NULL, *b = NULL;\n  a = (int *)elem1;\n  b = (int *)elem2;\n  return (*a - *b);\n}\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          goto end;\n        }\n      }\n    }\n  printf(\"no\");\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "4261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i = 0, j, t = 0, flag = 0;\n  cin >> n >> k;\n  for (t = 0; t <= n - 1; t++) {\n    cin >> a[t];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[50000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        j = n;\n        i = n + 1;\n      }\n    }\n    if (i == n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4263", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100000] = {0}, n, k, x, i;\n  int ifind = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    if (x > k)\n      continue;\n    if (a[x] == 1) {\n      ifind = 1;\n      break;\n    }\n    a[k - x] = 1;\n  }\n  if (ifind)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, e;\n  int s[1000];\n  int i = 0, j = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(s[i]));\n\n  for (j = 0; j < n - 1; j++) {\n    i = 1;\n    for (i = 1; i < n - j; i++) {\n      e = s[j] + s[i + j];\n      if (e == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  }\n  if (p == 1) {\n    cout << \"yes\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  double a[100000], k, tmp = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] + a[j] == k)\n\n        tmp = k;\n      break;\n    }\n  }\n\n  if ((tmp == k) || (n == 670) || (k == 142) || (n == 195) || (k == 490) ||\n      (n == 752) || (k == 245) || (n == 590) || (k == 887) || (n == 160) ||\n      (k == 503))\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4267", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, x, i = 1, j, A = 0;\n  scanf(\"%d %d \", &n, &k);\n  int a[1000];\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        A++;\n        break;\n      }\n    }\n    if (A == 1)\n      break;\n  }\n  if (A == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, m = 0, s1[1000], s2[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> s1[i];\n    s2[i] = s1[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (a = (i + 1); a < n; a++) {\n      if (s1[i] + s2[a] == k) {\n        m++;\n      }\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int s = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *pi = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", pi + i);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(pi + i) + *(pi + j) == k) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  free(pi);\n  return 0;\n}\n"}
{"label": "3", "index": "4270", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int a[1000];\n\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (k == (a[j] + a[i])) {\n          s = 1;\n        }\n      }\n    }\n  }\n\n  if (s == 1)\n    printf(\"yes\");\n  if (s != 1) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  int num[1500], sz[1500];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(num[i]));\n    sz[i] = num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if ((i == n - 1) && (j == n - 1))\n        cout << \"no\";\n    }\n    if (num[i] + sz[j] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        break;\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n - 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, k, s = 0;\n  cin >> n;\n  cin >> k;\n\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (int z = 0; z < n; z++) {\n    for (int m = z + 1; m < n; m++) {\n      if (k == sz[z] + sz[m]) {\n        s++;\n      }\n      if (k != (sz[z] + sz[m])) {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, i, a, s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n; j++) {\n    if (s == 1) {\n      break;\n    }\n    for (a = n - 1; a >= 0; a--) {\n      if ((a != j) && (sz[a] + sz[j] == k)) {\n        s = 1;\n        break;\n      }\n    }\n  }\n  if (s == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if ((sz[i] + sz[j]) == k) {\n        cout << \"yes\";\n\n        break;\n      }\n    }\n\n    if ((sz[i] + sz[j]) == k) {\n      break;\n    }\n  }\n\n  int a = i, b = j;\n  if ((a == n) && (b == n) && (sz[n - 1] + sz[n - 1] != k)) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1001], i, q;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i + 1] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (q = 1; q < n + 1; q++) {\n      if (a[i] + b[q] == k) {\n        cout << \"yes\\n\";\n        if (q == n) {\n          q--;\n        }\n        break;\n      }\n    }\n    if (q < n)\n      break;\n    if (i == n - 1) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4277", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a = 0, tmp, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i] + sz[i + 1] == k)\n        a++;\n      tmp = sz[i + 1];\n      sz[i + 1] = sz[i];\n      sz[i] = tmp;\n    }\n  }\n  if (a != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, k, n, i = 0, j = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if ((a[i] + a[j]) == k) {\n          m = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, i, j, jude = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        jude = 1;\n        break;\n      }\n  }\n  if (jude == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s, h = 0, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        h = 1;\n      }\n    }\n  }\n  if (h == 1 && t == 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1001], t, w, e;\n  cin >> n >> m;\n  t = 0;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i; j <= n - 1; j++)\n      if (a[i] + a[j] == m) {\n        t = 1;\n        break;\n      }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int c[1000];\n  int i = 0, j = 0, A = 0;\n  scanf(\"%d%d\", &n, &k);\n  while (i < n) {\n    scanf(\"%d\", &c[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (c[i] + c[j] == k)\n        A = 1;\n      j++;\n    }\n    i++;\n  }\n  if (A == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  c = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (a = 0; a < n; a++)\n    scanf(\"%d\", &sz[a]);\n\n  for (a = 0; a < (n - 1); a++) {\n    for (b = (a + 1); b < n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[a] + sz[b] != k)\n        c++;\n    }\n  }\n  if (c == n * (n - 1) / 2) {\n    printf(\"no\");\n    return 0;\n  }\n}\n"}
{"label": "3", "index": "4284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int m, k, i, j, Flag = 1;\n  scanf(\"%d %d \", &m, &k);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1 && Flag; i++)\n    for (j = i + 1; j < m && Flag; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        Flag = 0;\n      }\n  if (Flag)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n\n      if (a[j] == m) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[j] == m)\n      break;\n  }\n  if (i == n && j == n)\n    printf(\"no\");\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "4286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    j = i;\n    while (j <= n) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      j++;\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[11000], k, i, j, n, b, l = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (b == k) {\n        l += 1;\n      }\n    }\n  }\n  if (l != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4288", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, x[1000];\n  int i, j, sign = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        sign = 1;\n        break;\n      }\n    }\n  }\n\n  if (sign == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  scanf(\"%d%d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "4289", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j = 1, p, q;\n  int n, k, m;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    a[i] = m;\n  }\n  while (j < n) {\n    p = j + 1;\n    while (p <= n) {\n      q = a[j] + a[p];\n      if (q == k)\n        break;\n      else\n        p = p + 1;\n    }\n    if (p <= n)\n      break;\n    else\n      j = j + 1;\n  }\n  if (j == n && p == n + 1)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j, sum, res;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  res = 0;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        res = res + 1;\n      }\n    }\n  }\n  if (res == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, x;\n  x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int i = 0; i < n; i++) {\n    for (int a = 0; a < n; a++) {\n      if (sz[i] + sz[a] == k && i != a) {\n        x++;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "4292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], count = 0;\n  cin >> n >> k;\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] != k)\n        count = count + 1;\n    }\n  int m;\n  m = n * (n - 1) / 2;\n  if (count < m)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, s[1000], i, j;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, k, h, isTrue;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  m = 0, isTrue = 0;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  while (!(isTrue) && m < n) {\n    for (i = 0; i < n; i++) {\n      if (m == i) {\n        continue;\n      }\n      if (sz[i] + sz[m] == k) {\n        isTrue++;\n        break;\n      }\n    }\n    m = m++;\n  }\n  if (isTrue) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  int sz[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[0][i]);\n    sz[i][0] = sz[0][i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i == j)\n        continue;\n      else {\n        sz[i][j] = sz[i][0] + sz[0][j];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (sz[i][j] == k) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, m;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == k)\n      break;\n    if (i == n - 1 && m != k)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d \", &n, &k);\n  int *num = (int *)malloc(n * sizeof(int));\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", num + i);\n  for (i = 0; i <= n / 2; i++)\n    for (j = 0; j < n; j++) {\n      if (*(num + i) + *(num + j) == k) {\n        cout << \"yes\\n\";\n        return 0;\n      } else\n        continue;\n    }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1010];\n  int k, i, j, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, z[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> z[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i] + z[j] == k) {\n        if (i != j) {\n          printf(\"yes\");\n          return 0;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4300", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, x = 0;\n  cin >> n >> m;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int k = 0; k < n - 1; k++) {\n    for (int j = k + 1; j < n; j++) {\n      if (a[j] + a[k] == m)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int j = 0; j < n; j++) {\n    for (int s = j + 1; s < n; s++)\n      if (a[s] == k - a[j])\n        p = 1;\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4302", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, m, i, l = 0, t, j;\n  int a[1000] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++) {\n    t = n - a[i];\n    for (j = i + 1; j < m; j++)\n      if (a[j] == t) {\n        printf(\"yes\");\n        l++;\n        break;\n      }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, h = 0;\n  int s[1000], g[1000];\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> (s[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    g[i] = k - s[i];\n    for (j = 0; j <= n - 1; j++) {\n      if (g[i] == s[j])\n        h++;\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int num[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = num[i] + num[j];\n      if (s == k) {\n        s = 1;\n        break;\n      }\n      s = 0;\n    }\n    if (s == 1)\n      break;\n  }\n  if (s == 0)\n    cout << \"no\";\n  if (s == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, k, j, a[1000], tempx, tempy, temp = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    tempx = a[i];\n    for (j = i + 1; j < n; j++) {\n      tempy = a[j];\n      if (tempx + tempy == k)\n        temp++;\n    }\n  }\n  if (temp >= 1) {\n    printf(\"yes\");\n  }\n  if (temp == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, n, k, b = 0;\n  int a[1001] = {0};\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b++;\n        break;\n      }\n      if (b != 0)\n        break;\n    }\n  if (b == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n  int f = 0;\n  int sum;\n  for (i = 0; i < n; i++) {\n    for (int t = 0; t < n; t++) {\n      sum = sz[i] + sz[t];\n      if (sum == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, x, c;\n  c = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (x = 0; x < n; x++) {\n      if (x == i) {\n        continue;\n      }\n      if (a[x] + a[i] == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int shuzu[1000];\n  cin >> n >> k;\n\n  for (int i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  int count1 = 0;\n  for (int j = 1; j <= n; j++) {\n    for (int i = (j - 1); i < n; i++) {\n      if (k == (shuzu[j] + shuzu[i])) {\n        count1 += 1;\n      } else\n        continue;\n    }\n  }\n  if (count1 != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001];\n  int i, j, sum, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n\n      break;\n  }\n  if (e == 1)\n    printf(\"yes\");\n  if (e != 1)\n    printf(\"no\");\n\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "4312", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], b[1000], c;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    b[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c = a[i] + b[j];\n        if (c == k) {\n          printf(\"yes\");\n          break;\n        } else {\n          if (i == n - 1 && j == n - 2) {\n            printf(\"no\");\n            break;\n          }\n        }\n      }\n    }\n    if (c == k) {\n      break;\n    } else {\n      if (i == n - 1 && j == n - 2) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a;\n  scanf(\"%d %d\\n\", &n, &a);\n  int sz[n];\n  for (int i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"&d\", &sz[n - 1]);\n  for (int i = 0; i < n - 1; i++) {\n    for (int k = i + 1; k < n; k++) {\n      if (sz[i] + sz[k] == a) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && k == n - 1 && sz[i] + sz[k] != a) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1001], k, n, j, i, check;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  check = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + a[j] == k) && (a[i] != a[j])) {\n        check = 1;\n        break;\n      }\n    }\n    if (check == 1)\n      break;\n  }\n  if (check == 0) {\n    cout << \"no\\n\";\n\n  } else {\n    printf(\"yes\\n\");\n  }\n}\n"}
{"label": "3", "index": "4315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], j, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = a[i] + a[j];\n      if (q == k)\n        break;\n      else\n        q = 0;\n    }\n    if (q == k)\n      break;\n  }\n  if (q == k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4316", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int j = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n\n      if (k == a[i] + a[j]) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  cout << \"no\" << endl;\n}\n"}
{"label": "3", "index": "4317", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n = 0, m = 0, i = 0, t = 0, w = 0, e = 10000, q = 0, r = 0, k = 0, p = 0;\nint a[10000], b[10000], c[10000], d[10000];\nint main() {\n  scanf(\"%d %d\", &n, &p);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = i; k < n; k++) {\n      if (a[i] + a[k] == p) {\n        q = 1;\n      }\n    }\n  }\n\n  if (q == 1)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, tag = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    c = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n      if (c == a[j])\n        tag = 1;\n      if (tag == 1)\n        break;\n    }\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    printf(\"yes\");\n  if (tag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int s = 0;\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    cin >> a[i];\n  }\n  scanf(\"%d\", &a[n - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        s = s + 1;\n    }\n  }\n  if (s != 0) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, m = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000000], b[1000000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == a[j]) {\n        m = m + 1;\n      }\n      if (b[i] != a[j]) {\n        m = m;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\\n\");\n  }\n  if (m == 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4321", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, p, sum, isbreak = 0;\n  scanf(\"%d%d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (p = i + 1; p < n; p++) {\n      sum = sz[i] + sz[p];\n      if (sum == k) {\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  if (isbreak == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, f;\n  int a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  f = 1;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i != j)\n        if (a[i] + a[j] == k) {\n          f = 0;\n          break;\n        }\n\n  if (f)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4323", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, tmp, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  j = 0;\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - i - 1; j++) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (k == a[i] + a[j])\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a[10000], b, j, d = 0;\n  for (i = 0; i < 10000; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (d != 0)\n      break;\n    for (j = i + 1; j < n; j++) {\n      b = 0;\n      b = a[i] + a[j];\n      if (k == b) {\n        printf(\"yes\\n\");\n        d++;\n        break;\n      }\n    }\n  }\n\n  if (d == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[n];\n  int b[n];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    b[i - 1] = a[i - 1];\n  }\n  int c = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int t = i + 1; t <= n; t = t++) {\n      if ((a[i - 1] + b[t - 1]) == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int i, j, l;\n  int a, sum = 0, f = 0;\n  int m[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    m[i] = a;\n  }\n  for (j = 1; j <= n; j++) {\n    for (l = j; l <= n; l++) {\n      sum = m[j] + m[l];\n      if (sum == k)\n        f = f + 1;\n      else\n        f = f;\n    }\n  }\n  if (f == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) \n      {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000];\n  int i, j;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    if ((a[i] + a[j]) == k) {\n      break;\n    }\n  }\n  if ((a[i] + a[j]) != k)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 1, first = 0;\n  int num[1000] = {0}, sub = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n; i++) {\n    sub = k - num[i];\n    for (j = i + 1; j < n; j++) {\n      if (sub == num[j]) {\n        flag = 0;\n        first = 1;\n        break;\n      }\n    }\n    if (first)\n      break;\n  }\n  if (flag)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, l;\n  l = 0;\n  cin >> n >> k;\n  int j, e, ok, i;\n  ok = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[0] + a[j]) == k) {\n        ok = 1;\n      }\n    }\n    e = a[0];\n    a[0] = a[l];\n    a[l] = e;\n    l++;\n  }\n  if (ok == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i = 1, j, A = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 1; i <= n; i++)\n\n  {\n    cin >> a[i];\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        A++;\n        break;\n      }\n    }\n    if (A == 1)\n      break;\n  }\n  if (A == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, s, t = 0, a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        t = t + 1;\n    }\n  }\n  if (t == 0)\n    cout << \"no\\n\";\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, k, s = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n\n  int sz[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int z = 0; z < n; z++) {\n    for (int m = z + 1; m < n; m++) {\n      if (k == sz[z] + sz[m]) {\n        s++;\n      }\n      if (k != (sz[z] + sz[m])) {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  }\n  if (s != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4334", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], s = 0, c, e = 0, i;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (c = 0; c < n; c++) {\n      if (a[i] + b[c] == k) {\n        printf(\"yes\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4335", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  cin >> n >> k;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j, t;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (i = 0, t = 1; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        t = 0;\n        break;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0) {\n      break;\n    }\n    if (j == n - 2 && m == 0) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int j = 0; j < n; j++) {\n    for (int s = j + 1; s < n; s++)\n      if (a[s] == k - a[j])\n        p = 1;\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[1000], i, j, n, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        break;\n    }\n    if (j != n && i != j)\n      t++;\n  }\n  if (t > 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4340", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, flag;\n  int num[1000];\n  int i = 0, j;\n  cin >> n >> k;\n  while (i < n) {\n    i++;\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        printf(\"yes\\n\");\n        flag = 0;\n        i = n;\n        j = n;\n        break;\n      }\n    }\n  }\n  if (flag)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, x, s;\n  s = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d \", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (x = 1; x <= n - 1 - i; x++) {\n      if (a[i] + a[i + x] == k) {\n        s = s * 0;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m[1000], a;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (m[i]);\n    for (a = 0; a < i; a++) {\n      if (k == m[a] + m[i]) {\n        printf(\"yes\\n\");\n        goto abc;\n      }\n    }\n  }\n  cout << \"no\\n\";\nabc:\n  return 0;\n}\n"}
{"label": "3", "index": "4343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, tag = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    c = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (c == a[j])\n        tag = 1;\n      if (tag == 1)\n        break;\n    }\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    cout << \"yes\";\n  if (tag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, shuzu[1000], j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[i] + shuzu[j] == k) {\n        printf(\"yes\");\n        j = n + 1;\n        i = n + 1;\n      } else {\n        x++;\n      }\n    }\n  }\n  if (x == ((n - 1) * n / 2)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int j = 0; j < n; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n\n  for (int e = 0; e <= n; e++) {\n    for (int i = e + 1; i < n; i++) {\n      if (a[e] + a[i] == k) {\n        printf(\"yes\");\n        e = n + 1;\n        i = n;\n      }\n    }\n    if (e == n) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4346", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == k)\n      break;\n    if (i == n - 1 && m != k)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], p;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int y = 0; y < n; y++) {\n    for (int m = 1; m < n; m++) {\n      if (m != y)\n        p = sz[y] + sz[m];\n\n      if (p == k) {\n        break;\n      }\n    }\n    if (p == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (y == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int s = 0;\n  int i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < n) {\n      if (i == j) {\n        j++;\n        continue;\n      } else {\n        s = a[i] + a[j];\n        j++;\n        if (k == s) {\n          printf(\"yes\");\n          goto label;\n        }\n      };\n    };\n    if ((i == n - 1) && (s != k))\n      printf(\"no\");\n  }\nlabel:\n  return (0);\n}\n"}
{"label": "3", "index": "4349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n, i, b, c, d;\n  int a[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (d = 0; d < n; d++) {\n    b = k - a[d];\n    for (i = 0; i < n; i++) {\n      if ((b == a[i]) && (i != d)) {\n        c = 1;\n        break;\n      }\n    }\n\n    ;\n  }\n  if (c == 0) {\n    cout << \"no\";\n  } else if (c == 1) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, m = 0;\n  cin >> n >> k;\n  int a[1000000], b[1000000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == a[j]) {\n        m = m + 1;\n      }\n      if (b[i] != a[j]) {\n        m = m;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\\n\");\n  }\n  if (m == 0) {\n    printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "4351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      } else\n        continue;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], s = 0, c, e = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (c = 0; c < n; c++) {\n      if (a[i] + b[c] == k) {\n        printf(\"yes\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int a[1010];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int a[1000];\n\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (k == (a[j] + a[i])) {\n          s = 1;\n        }\n      }\n    }\n  }\n\n  if (s == 1)\n    printf(\"yes\");\n  if (s != 1) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, x[1000] = {0}, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &x[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((x[i] + x[j]) == k)\n      break;\n  }\n  if ((x[i] + x[j]) != k)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], b[1000], c;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    b[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c = a[i] + b[j];\n        if (c == k) {\n          printf(\"yes\");\n          break;\n        } else {\n          if (i == n - 1 && j == n - 2) {\n            printf(\"no\");\n            break;\n          }\n        }\n      }\n    }\n    if (c == k) {\n      break;\n    } else {\n      if (i == n - 1 && j == n - 2) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], s;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    for (j = 0; j < n - i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        printf(\"yes\\n\");\n        goto mq;\n      }\n    }\n  }\nmq:\n  if (s != k)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4359", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, number[1000], flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        if (number[i] + number[j] == k)\n          flag++;\n      } else\n        continue;\n    }\n  }\n  if (flag != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int n, k, i = 0, j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (; i <= n - 1; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] + a[j] == k) {\n        x = 1;\n        break;\n      }\n    if (x == 1) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4361", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 0;\n  int a[1001];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        flag = 1;\n        break;\n      }\n    if (a[i] + a[j] == k)\n      break;\n  }\n  if (flag != 1)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int a[1000];\n  s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if ((a[i] + a[j]) == k)\n        s = s + 1;\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k, i, r, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n; i = i + 1) {\n    for (r = i + 1; r < n; r = r + 1) {\n      if (sz[i] + sz[r] == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  if (e == 1)\n    printf(\"yes\");\n  if (e == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, k, m, b = 1, a;\n  int sl[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sl[i]);\n  }\n  if (a = b) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if (a = b) {\n          if ((sl[i] + sl[k]) == m) {\n            printf(\"yes \");\n            b = 0;\n          }\n        }\n      }\n    }\n  }\n  if (b != 0) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if ((sl[i] + sl[k]) == m) {\n          b = 0;\n        }\n      }\n    }\n    cout << \"no \";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ss[1000];\n  int zz[1000];\n  int n, k, num, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    ss[i] = num;\n    zz[i] = num;\n  }\n  int sz[1000][1000];\n  int h, l;\n  for (h = 0; h < n; h++) {\n    for (l = 0; l < n; l++) {\n      sz[h][l] = ss[h] + zz[l];\n      if (sz[h][l] == k && h != l) {\n        printf(\"yes\");\n        break;\n      } else if (h == n - 1 && l == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n\n    if (sz[h][l] == k && h != l) {\n      break;\n    }\n\n    else if (h == n - 1 && l == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, sum, s = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (p = 1; p < n; p++)\n    for (q = 0; q < p; q++) {\n      sum = a[p] + a[q];\n      if (sum == k)\n        s = s + 1;\n    }\n  if (s)\n    cout << \"yes\\n\";\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4367", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, b, c;\n  int sz[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (int a = 0; a < n; a++) {\n    for (i = 0; i < n; i++) {\n      b = sz[a] + sz[i];\n      if (sz[a] + sz[i] == k) {\n        c++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sz[1010];\nint main() {\n  int n, i, a, b, c, h = 0, k = 0, j = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j > i; j--) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        h = 1;\n        break;\n      }\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4369", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int as[1000], n, k, c;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> (as[i]);\n  }\n  int d = 0;\n  for (int j = 0; j < n; j++) {\n    for (int l = 0; l < n; l++) {\n      c = as[j] + as[l];\n      if (c == k) {\n        printf(\"yes\");\n        d++;\n        break;\n      }\n    }\n    if (c == k)\n      break;\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000] = {0}, n, k, i, j, judge = 0; \n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < (n - 1); i++) \n  {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        cout << \"yes\";\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, num;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &num);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (k = 0; k < n - 1; k++) {\n    for (i = 1; i < n - k; i++) {\n      if (a[k] + a[k + i] == num) {\n        goto done;\n      }\n    }\n  }\n\ndone:\n  if (k >= n - 1) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4372", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, e = 0, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 0; i < n - 1; i++) {\n    cin >> (sz[i]);\n  }\n  scanf(\"%d\", &(sz[n - 1]));\n  for (int j = 0; j < n; j++) {\n    m = sz[j];\n    sz[j] = sz[0];\n    sz[0] = m;\n    for (int p = 1; p < n; p++) {\n      if (sz[j] + sz[p] == k) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  } else {\n    if (e == 1) {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int b[1000];\n  int sz[1000][1000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sz[i][j] = a[i] + b[j];\n      if (sz[i][j] == k)\n        m = 1;\n    }\n  }\n  if (m == 1)\n    printf(\"yes\");\n\n  if (m == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  if (i > n - 2)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4375", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, k, s;\n  m = 0;\n  int sz[1000], p[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    p[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      s = sz[i] + p[m];\n      if (s == k) {\n        break;\n      }\n    }\n    if (s == k)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        if (t == 0) {\n          t = 1;\n        } else {\n          t = 1;\n        }\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, j, k, jud = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (a[i] + a[j] == k) {\n        jud = 1;\n        break;\n      }\n    if (jud)\n      break;\n  }\n  if (jud)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4378", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], k, i, j, t;\n  cin >> n;\n  scanf(\"%d\", &k);\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  for (j = 0; j < n - 1; j = j + 1) {\n    for (i = j - 1; i < n - 1; i = i + 1) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, c, h = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *za = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(za[i]));\n  }\n  for (int m = 0; m < n - 1; m++) {\n    for (c = m + 1; c < n; c++) {\n      if (za[m] + za[c] == k) {\n        h++;\n      }\n    }\n  }\n  if (h > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  free(za);\n  return 0;\n}\n"}
{"label": "3", "index": "4380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int t;\n\n  scanf(\"%d%d\", &n, &k);\n\n  int *a;\n  a = (int *)malloc(sizeof(int) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j != i && j < n; j++) {\n      if (t == a[j]) {\n        cout << \"yes\\n\";\n        return 0;\n      }\n    }\n  }\n\n  cout << \"no\\n\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, a[1100] = {0};\n  scanf(\"%d %d \", &n, &k);\n  cin.get();\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  int p = 0;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 0)\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "4382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int sz[1001];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int bar = 0;\n  for (int a = 0; a < n; a++) {\n    for (int b = a + 1; b < n; b++) {\n      if (sz[a] + sz[b] == k)\n        bar = 1;\n    }\n  }\n  if (bar == 1)\n    printf(\"yes\");\n  if (bar == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  int l = 0;\n\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], c = 0, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = c; i < n; i++) {\n    s = a[c] + a[i];\n    if (s == k) {\n      cout << \"yes\";\n      break;\n    }\n    if (i == n - 1) {\n      c = c + 1;\n      i = c;\n    }\n    if (c == n - 1) {\n      cout << \"no\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, n, k, i = 0, m = 0;\n  int sz[100000];\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (x = i; x <= n - 2; x++) {\n      y = sz[i] + sz[x + 1];\n      if (y == k) {\n        m++;\n      }\n    }\n  }\n  if (m != 0) {\n    cout << \"yes\";\n  } else if (m == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d %d\", &n, &k);\n  int s[1000];\n  for (int a = 0; a < n; a++) {\n    scanf(\"%d\", &(s[a]));\n  }\n  int b;\n  for (int c = 0; c < n; c++) {\n    for (int i = 0; i < n; i++) {\n      b = s[c] + s[i];\n      if (b == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4387", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0;\n  cin >> n >> k;\n  int a[1000];\n  int i = 0;\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int b = 0;\n  for (i = 0; i < n && c != 250; i++) {\n    for (b = 0; b < n - i && c != 250; b++) {\n      if (k == a[i] + a[i + b]) {\n        cout << \"yes\" << endl;\n        c = 250;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, sz[1000], x;\n\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &y);\n\n  for (int j = 0; j < n; j++) {\n\n    cin >> sz[j];\n  }\n\n  for (int k = 0; k <= n - 1; k++) {\n\n    for (int i = 0; i < n; i++) {\n\n      if (sz[k] + sz[i] == y) {\n\n        x = 1;\n\n        break;\n      }\n\n      if ((i == n - 1) && (sz[k] + sz[i] != y)) {\n        x = 0;\n      }\n    }\n\n    if (x == 1) {\n      printf(\"yes\");\n\n      break;\n    }\n\n    if ((k == n - 1) && (x == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j, l, m;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  l = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      else {\n        m = a[i] + a[j];\n        if (m == k) {\n          l++;\n          break;\n        }\n      }\n    }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  int a[1002] = {0};\n  int ans = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n    if (ans == 1)\n      break;\n  }\n  if (ans == 1) {\n    printf(\"yes\\n\");\n  } else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, g;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  g = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if ((a[i] + a[j]) == k) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  if (g == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, x;\n  int a[1000];\n  x = -1;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (p = 1; p <= n - 1; p++) {\n    for (q = p + 1; q <= n; q++) {\n      if (a[p] + a[q] == k)\n        x = 1;\n    }\n    if (x == 1)\n      break;\n  }\n  if (x == -1)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int s = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *pi = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", pi + i);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(pi + i) + *(pi + j) == k) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  free(pi);\n  return 0;\n}\n"}
{"label": "3", "index": "4394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int q, int t, int b[]) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (i == j)\n        continue;\n      if (b[i] + b[j] == q)\n        return 1;\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, k, a[1000], i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  if (check(k, n, a))\n    cout << \"yes\\n\";\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1005];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int f = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n      \n    }\n  if (f == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4396", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, a[1000], x, j, z = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (a[j] == x)\n        z = 1;\n    }\n  }\n  if (z == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int t = 0; t < n; t++)\n    scanf(\"%d \", &a[t]);\n\n  for (int i = 0; i < n - 1; i++) {\n    for (int m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && m == n - 1 && a[i] + a[m] != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, flag = 0, n, k, a[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      scanf(\"%d\", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (k == a[i] + a[j])\n        flag = 1;\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4400", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n\n      if ((sz[i] + sz[j]) == k) {\n        a++;\n      }\n    }\n  }\n  if (a > 0)\n    printf(\"yes\");\n\n  if (a == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, b, judge = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[1001];\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          judge = 1;\n          break;\n        }\n      }\n    }\n    if (judge == 1) {\n      break;\n    }\n\n    if (i == n)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((a[i] + a[j] == k) && (i != j))\n        break;\n    }\n    if ((a[i] + a[j] == k) && (i != j))\n      break;\n  }\n  if ((a[i] + a[j] == k) && (i != j))\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, k, n, sz[1000], s[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    s[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1) {\n      break;\n    }\n    for (m = n - 1; m >= i + 1; m--) {\n      if (s[m] + sz[i] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (s[m] + sz[i] == k) {\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int arr[1001];\n  int i, j, bb;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    bb = k - arr[i];\n    for (j = i + 1; j < n; j++) {\n      if (bb == arr[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  if (i == n - 1)\n    cout << \"no\\n\";\n}\n"}
{"label": "3", "index": "4406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j;\n  int sz[1000];\n  int tag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (sz[i] + sz[j] == k)\n        tag = 1;\n  }\n  if (tag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, b, g;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] + a[m] == k) {\n        b = k;\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (i == n - 1 && b != k) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], b = 0, c, q, i, j, e;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      q = sz[i] + sz[j];\n      if (q == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4409", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint read();\nint find();\nint n, k, a[1000], m;\nint main() {\n  read();\n  m = find();\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\nint read() {\n  int i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  return 0;\n}\nint find() {\n  int i, j;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        return 1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4410", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  int a[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n    a[i] = k - sz[i];\n  }\n  int found = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i] == sz[j]) {\n        found = 1;\n        break;\n      }\n    }\n    if (found == 1) {\n      break;\n    }\n  }\n  if (found == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int xl[1000];\n  int i;\n  int result;\n  int a = 0, b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &xl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      result = xl[i] + xl[j];\n      if (result == k) {\n        a++;\n      } else {\n        b++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], b[1000], i, j, flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (a[i] + b[j] == k) {\n        flag = 1;\n        break;\n      }\n  cout << \" \";\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4413", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, m[1000], s = 0, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> m[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (m[i] + m[j] == k)\n        s++;\n    }\n  }\n  if (s > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[1000], n, k, b = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> (A[i]);\n    A[i] = A[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    int m = i;\n    for (int j = i; i + j < n; j++) {\n      if ((A[i] + A[i + j]) == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a[10000], b, j, d = 0;\n  for (i = 0; i < 10000; i++)\n    a[i] = 0;\n\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (d != 0)\n      break;\n    for (j = i + 1; j < n; j++) {\n      b = 0;\n      b = a[i] + a[j];\n      if (k == b) {\n        printf(\"yes\\n\");\n        d++;\n        break;\n      }\n    }\n  }\n\n  if (d == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4416", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i < n; i++) {\n    j = i;\n    while (j <= n) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      j++;\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        j++;\n      }\n      if (a[i] + a[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4418", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, d;\n  d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; (i + j) < n; j++) {\n      if ((a[i] + a[i + j]) == k) {\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if ((a[i] + a[i + j]) == k) {\n      d = 1;\n      break;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    for (; j < n; j++) {\n      if (k == (a[i] + a[j])) {\n        printf(\"yes\");\n        i = -1;\n        break;\n      }\n    }\n    if (i == -1) {\n      break;\n    }\n    if (i == n - 1) {\n      cout << \"no\";\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], K, m, d[1000], s = 0, t, o;\n  scanf(\"%d%d\", &n, &K);\n  int e, i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    o = i;\n    d[o] = sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = K - sz[i];\n    t = 0;\n    for (o = 0; o < n; o++) {\n      if (o != i && m == d[o]) {\n        t++;\n      }\n    }\n    if (t > 0) {\n      s++;\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, b = 0;\n  int num[1002];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &num[0]);\n  for (i = 1; i <= n - 1; i++)\n    scanf(\" %d\", &num[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (num[i] + num[j] == k) {\n        cout << \"yes\";\n        b = 1;\n        break;\n      }\n    }\n    if (num[i] + num[j] == k)\n      break;\n  }\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sl[1000], sz[1000][1000], i, p, s;\n  s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sl[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      sz[i][p] = sl[i] + sl[p];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if (sz[i][p] == k) {\n        sz[i][p] = 1;\n      } else {\n        sz[i][p] = 0;\n      }\n      s = s + sz[i][p];\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1 + i; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1010];\n  int k, i, j, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, m;\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if (j == m) {\n        printf(\"\");\n      } else {\n        if (sz[j] + sz[m] == k) {\n          cout << \"yes\";\n          break;\n        }\n      }\n    }\n    if (sz[j] + sz[m] == k) {\n      break;\n    }\n  }\n  if (j == n && m == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, z, sum = 0, x = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (j = 0; j < n - 1; j++)\n    for (z = j + 1; z < n; z++) {\n      sum = sz[j] + sz[z];\n      if (sum == k)\n        x++;\n    }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int s = i + 1; s < n; s++) {\n      if (sz[i] + sz[s] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[i] + sz[s] != k && i == n - 2) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int n, i, j, k, m;\n  m = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; ++i)\n    cin >> a[i];\n  for (i = 0; i < n - 1; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (a[i] + a[j] == k)\n        goto there;\nthere:\n  if (i == n - 1)\n    printf(\"no\\n\");\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int sum, out_put = 0;\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j + 1; m < n; m++) {\n      sum = sz[j] + sz[m];\n      if (sum == k) {\n        out_put = 1;\n        break;\n      }\n    }\n    if (out_put == 1) {\n      break;\n    }\n  }\n  if (out_put == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int a[], int y) {\n  int i, j, k;\n  for (i = 0; i < y; i++) {\n    if (x == a[i])\n      return i;\n    if (i >= y - 1)\n      return -1;\n  }\n}\nint main() {\n  int i, x, y, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = f(a[i], a, n);\n    y = f(k - a[i], a, n);\n    if (x != y && x != -1 && y != -1) {\n      printf(\"yes\\n\");\n      break;\n    }\n    if (i >= n - 1)\n      printf(\"no\\n\");\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "4432", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100000] = {0}, n, k, x, i;\n  int ifind = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    if (x > k)\n      continue;\n    if (a[x] == 1) {\n      ifind = 1;\n      break;\n    }\n    a[k - x] = 1;\n  }\n  if (ifind)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4433", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, k, s;\n  m = 0;\n  int sz[1000], p[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    p[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      s = sz[i] + p[m];\n      if (s == k) {\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (i == n) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4434", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int n = 0, k = 0, i = 1, j = 0, b = 0;\n  cin >> n >> k;\n\n  int a[1000];\n\n  for (i = 1; i <= n; ++i) {\n    cin >> a[i - 1];\n  }\n\n  for (i = 0; i <= (n - 2); i++)\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (k == a[i] + a[j])\n        b = 1;\n    }\n\n  if (b == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "4435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d \", &n, &k);\n  int a[n];\n  int x, y, sum;\n  sum = 0;\n  int i, j, m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - 1; j++)\n\n    for (m = j + 1; m < n; m++) {\n      x = a[j] + a[m];\n      if (x == k)\n        y = 1;\n      else\n        y = 0;\n      sum = sum + y;\n    }\n\n  if (sum == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4436", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, s = 0, a[10000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (f == 0) {\n      for (j = 0; j < i; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\\n\");\n          f = 1;\n          s = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if ((a[j] + a[m]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((a[j] + a[m]) == k) {\n      break;\n    } else if (j == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int s = 0;\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[n - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        s = s + 1;\n    }\n  }\n  if (s != 0) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k)\n        break;\n    }\n    if (sz[i] + sz[j] == k)\n      break;\n  }\n  if (sz[i] + sz[j] == k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int arr[1001];\n  int i, j, bb;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &arr[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    bb = k - arr[i];\n    for (j = i + 1; j < n; j++) {\n      if (bb == arr[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  if (i == n - 1)\n    cout << \"no\\n\";\n}\n"}
{"label": "3", "index": "4441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int SZ[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (SZ[i] + SZ[j] == k) {\n        m = 1;\n        goto a;\n      }\n    }\n  }\na:\n  if (m == 0) {\n    printf(\"no\");\n  } else if (m == 1) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, sum, d;\n  scanf(\"%d%d\", &n, &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    a = i + 1;\n    for (a; a < n; a++) {\n      sum = sz[i] + sz[a];\n      if (sum == k) {\n        d = 1;\n      }\n    }\n  }\n  if (d == 1) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n\n  free(sz);\n  return 0;\n}\n"}
{"label": "3", "index": "4443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1100];\n  int n, k, i, j, x;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        x = sz[i] + sz[j];\n      if (x == k)\n        break;\n    }\n    if (x == k)\n      break;\n  }\n\n  if (x == k)\n    printf(\"yes\\n\");\n\n  if (x != k)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, i, n, k, j, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int p, m;\n  for (m = 0; m < n - 1; m++) {\n    for (p = m + 1; p < n; p++) {\n      if (k == sz[m] + sz[p])\n        break;\n    }\n    if (p == n)\n      continue;\n    else if (p < n && k == sz[m] + sz[p]) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (m == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, k;\n  int m = 0;\n  int a[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        m++;\n    }\n  }\n  if (m != 0)\n    printf(\"yes\");\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1001];\n  int i, j;\n  int flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++)\n    for (j = 0; j < n && flag == 0; j++) {\n      if (j > i && a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        flag = 1;\n      }\n    }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (sz[i] + sz[j] == k) {\n        s = 1;\n        break;\n      } else\n        s = 0;\n    }\n    if (s == 1) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 2 && s == 0)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, k;\n  int m = 0;\n  int a[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        m++;\n    }\n  }\n  if (m != 0)\n    cout << \"yes\";\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000];\nint n, k;\nint *final;\n\nint *point1 = &n, *point2 = &k;\n\nint main() {\n  int kk = 1;\n  scanf(\"%d%d\", point1, point2);\n\n  point1 = a;\n  final = point1 + n;\n\n  for (; point1 < final; point1++)\n    scanf(\"%d\", point1);\n  point1 = a;\n  for (; point1 < final - 1; point1++) {\n    if (kk == 0)\n      break;\n    for (point2 = point1 + 1; point2 < final; point2++) {\n      if (*point1 + *point2 == k) {\n        printf(\"yes\");\n        kk = 0;\n        break;\n      }\n    }\n  }\n  if (kk == 1)\n    cout << \"no\";\n  return (0);\n}\n"}
{"label": "3", "index": "4451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[2001];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  int p = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        p = 1;\n\n  if (p == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, K, i, j;\n  int a[1000];\n  scanf(\"%d %d/n\", &n, &K);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == K) {\n        goto first;\n      }\n    }\n  }\n  goto third;\nfirst:\n  printf(\"yes\");\n  goto second;\nthird:\n  printf(\"no\");\n  return 0;\nsecond:\n  return 0;\n}\n"}
{"label": "3", "index": "4453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[j] == k - a[i]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, y, sz[1000], x;\n\n  cin >> n;\n  scanf(\"%d\", &y);\n\n  for (int j = 0; j < n; j++) {\n\n    scanf(\"%d\", &sz[j]);\n  }\n\n  for (int k = 0; k <= n - 1; k++) {\n\n    for (int i = 0; i < n; i++) {\n\n      if (sz[k] + sz[i] == y) {\n\n        x = 1;\n\n        break;\n      }\n\n      if ((i == n - 1) && (sz[k] + sz[i] != y)) {\n        x = 0;\n      }\n    }\n\n    if (x == 1) {\n      printf(\"yes\");\n\n      break;\n    }\n\n    if ((k == n - 1) && (x == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4455", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[1000], i, j, t = 0, k;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      for (k = i + 1; k < n; k++) {\n        if (m == a[j] + a[k])\n          t++;\n        break;\n      }\n\n  if (t != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4456", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, sum;\n  cin >> n >> k;\n  int shu[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> (shu[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int l = n - 1; l > j; l--) {\n      sum = shu[j] + shu[l];\n      if (sum == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sum == k)\n      break;\n  }\n  if (sum != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int n, k, i, j, s[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if ((s[i] + s[j]) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; ++i)\n    cin >> a[i];\n  for (i = 0; i < n - 1; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (a[i] + a[j] == k)\n        goto there;\nthere:\n  if (i == n - 1)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, r;\n  int n, k, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (r = 1; r < n; r++) {\n    for (a = r + 1; a <= n; a++) {\n      if (sz[a] + sz[r] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a <= n)\n      break;\n  }\n  if (r >= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, n, k, i, c = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (b = 0; b < n; b++) {\n    for (i = 0; i < n; i++) {\n      if (i != b) {\n        if (a[b] + a[i] != k) {\n          c = c + 1;\n          continue;\n        } else\n          break;\n      }\n    }\n  }\n\n  if (c == n * (n - 1))\n    printf(\"no\");\n  if (c != n * (n - 1))\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, x;\n  x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int a = 0; a < n; a++) {\n      if (sz[i] + sz[a] == k && i != a) {\n        x++;\n      }\n    }\n  }\n  if (x == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n}\n"}
{"label": "3", "index": "4462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int arr[1001];\n  int i, j, bb;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> arr[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    bb = k - arr[i];\n    for (j = i + 1; j < n; j++) {\n      if (bb == arr[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  if (i == n - 1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  int *a = NULL, *b = NULL;\n  a = (int *)elem1;\n  b = (int *)elem2;\n  return (*a - *b);\n}\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          goto end;\n        }\n      }\n    }\n  printf(\"no\");\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "4464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a, sa[1000], ye = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n    sa[i] = sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (a = i + 1; a < n; a++) {\n      if (sz[i] + sa[a] == k) {\n        ye = 1;\n        break;\n      }\n    }\n    if (ye == 1)\n      break;\n  }\n  if (ye == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, p, q, m = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  int gram[n][n], sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      gram[p][q] = sz[p] + sz[q];\n      if (gram[p][q] == k) {\n        m++;\n      }\n    }\n    if (gram[p][q] == k) {\n      m++;\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 1;\n  int sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4467", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, b;\n  int s = 1;\n  scanf(\"%d %d \", &n, &k);\n  int a[n];\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n  }\n  for (int p = 1; p <= n; p++) {\n    b = k - a[p - 1];\n    for (int q = 1; q <= n; q++) {\n      if (a[q - 1] == b && a[p - 1] != b)\n        s++;\n    }\n  }\n  if (s == 1)\n    cout << \"no\";\n  if (s != 1)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4468", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, p, l = 0;\n  scanf(\"%d \", &n);\n  cin >> k;\n  int s[2][1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[0][i]));\n    s[1][i] = k - s[0][i];\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if ((s[1][i] == s[0][p]) && (i != p)) {\n        l++;\n      }\n    }\n  }\n  if (l == 0) {\n    printf(\"no\");\n  }\n  if (l != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a = 1, i, j;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        a = 0;\n      }\n    }\n  }\n  while (a == 0) {\n    printf(\"yes\");\n    break;\n  }\n\n  while (a) {\n    cout << \"no\";\n    break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, sum, flag = 0;\n  int num[1000];\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (num[i] + num[j] == sum) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, m, x, y, z, c;\n  c = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (x = 0; x < n; x++) {\n      if (x == i) {\n        continue;\n      }\n      if (a[x] + a[i] == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4472", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, x, s;\n  s = 1;\n  scanf(\"%d\", &n);\n  cin >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (x = 1; x <= n - 1 - i; x++) {\n      if (a[i] + a[i + x] == k) {\n        s = s * 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4473", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, p;\n  scanf(\"%d %d \", &n, &k);\n  int m = 1;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n && m == 1; i++) {\n    for (p = i + 1; p < n && m == 1; p++) {\n      if (sz[i] + sz[p] == k) {\n        printf(\"yes\");\n        m = 0;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (i != j && a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], f = 1;\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n - 1 && f != 0; j++) {\n    for (int k = j + 1; k < n && f != 0; k++) {\n      if (sz[j] + sz[k] == m) {\n        printf(\"yes\");\n        f--;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, k, b, g;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] + a[m] == k) {\n        b = k;\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (i == n - 1 && b != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, num[1000], i, j, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> num[i - 1];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (num[i - 1] + num[j - 1] == k) {\n        p = p + 1;\n        break;\n      }\n    if (p > 0)\n      break;\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, r, a[1000], x = 0;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (r = 0; r <= n - 2; r = r + 1) {\n    for (i = r + 1; i <= n - 1; i = i + 1) {\n      if ((a[r] + a[i]) == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  } else {\n    if (x != 0)\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int h = 0; h < n; h++) {\n      if (sz[j] + sz[h] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1010], s, i, u = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &s);\n    if (s < k) {\n      a[u] = s;\n      u++;\n    }\n  }\n  for (i = u - 1; i >= 1; i--) {\n    for (s = 0; s <= i - 1; s++) {\n      if (a[s] == k - a[i]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4481", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, t;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (a[j] == t && j != i) {\n\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000];\nint n, k;\nint *final;\n\nint *point1 = &n, *point2 = &k;\n\nint main() {\n  int kk = 1;\n  scanf(\"%d%d\", point1, point2);\n\n  point1 = a;\n  final = point1 + n;\n\n  for (; point1 < final; point1++)\n    scanf(\"%d\", point1);\n  point1 = a;\n  for (; point1 < final - 1; point1++) {\n    if (kk == 0)\n      break;\n    for (point2 = point1 + 1; point2 < final; point2++) {\n      if (*point1 + *point2 == k) {\n        cout << \"yes\";\n        kk = 0;\n        break;\n      }\n    }\n  }\n  if (kk == 1) {\n    cout << \"no\";\n  }\n  return (0);\n}\n"}
{"label": "3", "index": "4483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, m;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (a[i] + a[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n\n  int e;\n  int m;\n  for (m = 1; m <= n; m++) {\n    int j;\n    for (j = 0; j < n - m; j++) {\n      if (sz[j] > sz[j + 1]) {\n        e = sz[j + 1];\n        sz[j + 1] = sz[j];\n        sz[j] = e;\n      }\n    }\n  }\n\n  int M;\n  int x, sum = 0;\n  \n  int j;\n  for (j = n - 1; j >= 0; j--)\n    for (x = j - 1; x >= 0; x--) {\n      if (k == sz[j] + sz[x]) {\n        sum += 1;\n      }\n    }\n  if (sum == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1 + i; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int s = 0;\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[n - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        s = s + 1;\n    }\n  }\n  if (s != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int a[], int y) {\n  int i, j, k;\n  for (i = 0; i < y; i++) {\n    if (x == a[i])\n      return i;\n    if (i >= y - 1)\n      return -1;\n  }\n}\nint main() {\n  int i, x, y, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = f(a[i], a, n);\n    y = f(k - a[i], a, n);\n    if (x != y && x != -1 && y != -1) {\n      printf(\"yes\\n\");\n      break;\n    }\n    if (i >= n - 1) {\n      cout << \"no\\n\";\n    }\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "4488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, s, t = 0, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        t = t + 1;\n    }\n  }\n  if (t == 0)\n    cout << \"no\" << endl;\n  else {\n    printf(\"yes\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4489", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint t[2000];\ndouble s[1000], si;\n\nint main() {\n  int i, j, n, m, s = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n\n    scanf(\"%d\", &t[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n\n      if (t[i] + t[j] == n)\n        s = 1;\n\n  s ? printf(\"yes\") : printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[70000] = {0};\nint main() {\n  int n, k, c[1001], i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> c[i];\n    a[c[i] + 32768] = 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[c[i] + 32768] && a[k - c[i] + 32768])\n      break;\n  }\n  if (i < n)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4491", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, x, y = 0, p;\n  int sz[1000], s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s[i] = sz[i];\n  }\n  p = 0;\n  for (m = 0; m < n; m++) {\n    for (x = m + 1; x < n; x++) {\n      z[p] = sz[m] + s[x];\n      p++;\n    }\n  }\n  for (i = 0; i < n * (n - 1) / 2; i++) {\n    if (z[i] == k) {\n      y = y + 1;\n    }\n  }\n  if (y != 0) {\n    printf(\"yes\");\n  } else if (y == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000] = {0};\n  int i;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  int c = 0;\n  int j;\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (i + 1); j > i && j < n; j++) {\n      if (a[i] + a[j] == k)\n        c++;\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4493", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, n, i, j, b, t = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (k == b) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    cin >> num[i];\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = 0; m < n; m++) {\n      if (m == j)\n        continue;\n      else if (num[j] + num[m] == k)\n        c = 0;\n    }\n  }\n  if (c == 1)\n    cout << \"no\" << endl;\n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i = 0, e = 0, a[2][1000], c, d, t = 0;\n  cin >> c >> d;\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (e = i + 1; e < c - 1; e++) {\n\n      if (a[0][i] + a[0][e] == d) {\n        t++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4496", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint bj(const void *x, const void *y) {\n  if (*(int *)x > *(int *)y)\n    return 1;\n  if (*(int *)x < *(int *)y)\n    return -1;\n  if (*(int *)x == *(int *)y)\n    return 0;\n}\nint main() {\n  int n, k, i, j, a[1000], pds = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, bj);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] < k)\n        break;\n      else if (a[i] + a[j] == k) {\n        pds = 1;\n        break;\n      }\n    }\n    if (pds == 1)\n      break;\n  }\n  if (pds == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(int q, int t, int b[]) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (i == j)\n        continue;\n      if (b[i] + b[j] == q)\n        return 1;\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, k, a[1000], i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  if (check(k, n, a))\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4498", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, tag = 0, num[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] + num[j] == k) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (tag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4499", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k;\n  scanf(\"%d %d \", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if ((sz[i] + sz[j]) == k) {\n        printf(\"yes\");\n\n        break;\n      }\n    }\n\n    if ((sz[i] + sz[j]) == k) {\n      break;\n    }\n  }\n\n  int a = i, b = j;\n  if ((a == n) && (b == n) && (sz[n - 1] + sz[n - 1] != k)) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bj(const void *x, const void *y) {\n  if (*(int *)x > *(int *)y)\n    return 1;\n  if (*(int *)x < *(int *)y)\n    return -1;\n  if (*(int *)x == *(int *)y)\n    return 0;\n}\nint main() {\n  int n, k, i, j, a[1000], pds = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, bj);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] < k)\n        break;\n      else if (a[i] + a[j] == k) {\n        pds = 1;\n        break;\n      }\n    }\n    if (pds == 1)\n      break;\n  }\n  if (pds == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "4501", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, a, s;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n; j++) {\n    if (s == 1)\n      break;\n    for (a = n - 1; a >= 0; a--) {\n      if ((a != j) && (sz[a] + sz[j] == k)) {\n        s = 1;\n        break;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4502", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int c[1000];\n  int i = 0, j = 0, A = 0;\n  cin >> n >> k;\n  while (i < n) {\n    scanf(\"%d\", &c[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (c[i] + c[j] == k)\n        A = 1;\n      j++;\n    }\n    i++;\n  }\n  if (A == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, p;\n  int sz[1000];\n  scanf(\"%d%d\\n\", &n, &k);\n  p = 0;\n  sz[n] = k;\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (i = 0; i < n; i++) {\n    for (m = n - 1; m > i; m--) {\n      if (sz[i] + sz[m] == sz[n]) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 1)\n    cout << \"yes\";\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (int a = 1; a < n; a++) {\n    for (int i = 0; i < n && i != (n - a); i++) {\n      if (((sz[i]) + (sz[n - a])) == k) {\n        printf(\"yes\");\n        return 0;\n      } else if (a == n - 1 && ((sz[i]) + (sz[n - a])) != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j, e;\n  int s = 0, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      e = a[i] + a[j];\n      if (e == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4506", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n    a[i] = k - sz[i];\n  }\n  int found = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i] == sz[j]) {\n        found = 1;\n        break;\n      }\n    }\n    if (found == 1) {\n      break;\n    }\n  }\n  if (found == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4507", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, sum, flag = 0;\n  int num[1000];\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (num[i] + num[j] == sum) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, t, e, j, h = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n - i - 1; t++) {\n      if (a[t] < a[t + 1]) {\n        e = a[t + 1];\n        a[t + 1] = a[t];\n        a[t] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        continue;\n      }\n      if (a[i] + a[j] == k) {\n        h++;\n      }\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, t, i, a[1000];\n  int s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = i + 1; t <= n - 1; t++) {\n      if ((a[i] + a[t]) == k) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, a[1000], x, j, z = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (a[j] == x)\n        z = 1;\n    }\n  }\n  if (z == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  cin >> n >> k;\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  int flag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1)\n    printf(\"yes\\n\");\n  if (flag == 0)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (a = 0; a < n; a++) {\n    for (b = a + 1; b < n; b++) {\n      c = sz[a] + sz[b];\n      if (c == k)\n        break;\n    }\n    if (b != n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (a == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4513", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[9999], h, m = 0, o = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      h = a[i] + a[j];\n      m++;\n      if (h == k) {\n        o++;\n      }\n    }\n  }\n\n  if (o == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, sizeof(int), compare);\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 1;\n      } else if (a[i] + a[j] < k)\n        break;\n    }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, z, a[1000];\n  scanf(\"%d%d\", &i, &k);\n  scanf(\"%d\", &a[0]);\n  a[0] = k - a[0];\n  for (j = 1; j <= i - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    for (z = 0; z <= j - 1; z++) {\n      if (a[j] == a[z]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    a[j] = k - a[j];\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 1; i <= n; i++) {\n    b[i] = k - a[i];\n  }\n  for (int m = 1; m <= n; m++) {\n    for (i = 1; i <= n; i++) {\n      if (a[m] == b[i]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4517", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000];\n  int i, j, flag = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(a + i) + *(a + j) == k) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n\n  if (flag)\n    printf(\"yes \");\n  else\n    printf(\"no \");\n}\n"}
{"label": "3", "index": "4518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1010];\n  int k, i, j, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *array, n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  array = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", array + i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + i; j < n; j++)\n      if (array[i] + array[j] == k) {\n        cout << \"yes\";\n        free(array);\n        return 0;\n      }\n  free(array);\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int ia = 0, ib = 1; ia < n - 1; ia++) {\n    for (ib = ia + 1; ib < n; ib++) {\n      if (a[ia] + a[ib] == k) {\n        cout << \"yes\";\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4522", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0, i;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (b == 1) {\n      break;\n    }\n  }\n  if (b == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], right = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        right = k;\n        break;\n      }\n    }\n    if (right == k) {\n      cout << \"yes\";\n      break;\n    } else if (i == n - 2 && right != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  int l = 0;\n  int swap;\n  scanf(\"%d\", &n);\n  cin >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000000];\n  int i, j, n, k, m = 0, sum = 0, c;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n    }\n  }\n  for (c = 0; c < m; c++) {\n    if (b[c] == k) {\n      sum = sum + 1;\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], f = 1;\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int j = 0; j < n - 1 && f != 0; j++) {\n    for (int k = j + 1; k < n && f != 0; k++) {\n      if (sz[j] + sz[k] == m) {\n        cout << \"yes\";\n        f--;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4527", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, sz[1000], j, k;\n  int sum = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        sum++;\n        break;\n      }\n    }\n  }\n\n  if (sum != 0) {\n    printf(\"yes\");\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4528", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int data[1001];\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < i; j++)\n      if (data[i] + data[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, k, h, isTrue;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  m = 0, isTrue = 0;\n  for (i = 0; i < n - 1; i++) {\n    cin >> sz[i];\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  while (!(isTrue) && m < n) {\n    for (i = 0; i < n; i++) {\n      if (m == i) {\n        continue;\n      }\n      if (sz[i] + sz[m] == k) {\n        isTrue++;\n        break;\n      }\n    }\n    m = m++;\n  }\n  if (isTrue) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4530", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n  int num = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        num = num + 1;\n  if (num == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n}\n"}
{"label": "3", "index": "4531", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j = 0, flag = 0;\n  int str[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> str[i];\n  i = 0;\n  for (i = 0; i < n / 2 + 1; i++) {\n    j = 0;\n    for (j = 0; j < n; j++) {\n      if ((k - str[j]) == str[i]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag == 1) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; ++i)\n    cin >> a[i];\n  for (i = 0; i < n - 1; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (a[i] + a[j] == k)\n        goto there;\nthere:\n  if (i == n - 1)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n}\n"}
{"label": "3", "index": "4533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (k == a[j] + b[i]) {\n          printf(\"yes\\n\");\n          break;\n        }\n      }\n    }\n    if (k == a[j] + b[i]) {\n      break;\n    }\n  }\n  if (k != a[j] + b[i]) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000], a, m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (i < j) {\n        a = x[i] + x[j];\n        if (a == k) {\n          m++;\n          break;\n        }\n      }\n    }\n    if (a == k)\n      break;\n  }\n  if (m != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4536", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, sum;\n  scanf(\"%d %d\", &n, &k);\n  int shu[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(shu[i]));\n\n  for (int j = 0; j < n; j++) {\n    for (int l = n - 1; l > j; l--) {\n      sum = shu[j] + shu[l];\n      if (sum == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sum == k)\n      break;\n  }\n  if (sum != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, leap = 0;\n  int a[10001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        sum = a[i] + a[j];\n        if (sum == k) {\n          printf(\"yes\");\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 1)\n      break;\n  }\n  if (leap == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int a[1010];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4539", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], j, i, count = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        count = count + 1;\n    }\n  if (count == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, t, i, a[1000];\n  int s = 0;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = i + 1; t <= n - 1; t++) {\n      if ((a[i] + a[t]) == k) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int SZ[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (SZ[i] + SZ[j] == k) {\n        m = 1;\n        goto a;\n      }\n    }\n  }\na:\n  if (m == 0) {\n    printf(\"no\");\n  } else if (m == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000] = {0}, i, j, t = 0, *p, *pt;\n  scanf(\"%d%d\", &n, &k);\n  for (p = a; p < n + a; p++)\n    scanf(\"%d\", p);\n  for (p = a; p < n - 1 + a; p++) {\n    for (pt = p + 1; pt < n + a; pt++)\n      if ((*p) + (*pt) == k)\n        t = 1;\n  }\n  if (t == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, shuzu[1000], j, x = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[i] + shuzu[j] == k) {\n        printf(\"yes\");\n        j = n + 1;\n        i = n + 1;\n      } else {\n        x++;\n      }\n    }\n  }\n  if (x == ((n - 1) * n / 2)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, ylf = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  while (i < n && ylf == 0) {\n    j = i + 1;\n    while (j < n && ylf == 0) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        ylf = 1;\n      } else\n        j++;\n    }\n    i++;\n  }\n  if (ylf == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4545", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, n, a[1000], i, b[1000], j, p = 0, h = 0, k;\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (k = 0; k < n; k++) {\n    for (j = 0; j < n; j++) {\n      h = a[k] + b[j];\n      if (h == sum)\n        p++;\n    }\n  }\n  if (p == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j = 0, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    for (i = j + 1; i < n; i++) {\n      if ((a[j] + a[i]) == k) {\n        cout << \"yes\";\n        j = n;\n      }\n      if (j == n)\n        break;\n      if (j == n - 2)\n        cout << \"no\";\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, f;\n  scanf(\"%d %d\", &n, &k);\n  f = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (f == 1)\n      break;\n    for (j = 0; j < i; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], sum;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (k == sum) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (k == sum)\n      break;\n    if (i == (n - 1) && (sz[i - 1] + sz[i]) != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], right = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        right = k;\n        break;\n      }\n    }\n    if (right == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == n - 2 && right != k) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4550", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int t;\n\n  scanf(\"%d%d\", &n, &k);\n\n  int *a;\n  a = (int *)malloc(sizeof(int) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j != i && j < n; j++) {\n      if (t == a[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  int a, b, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int p = 0; p < n; p++) {\n    for (int i = 1; i <= n; i++) {\n      a = sz[p];\n      b = sz[i];\n      if (a + b == k) {\n        c += 1;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4552", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, p = 0;\n  scanf(\"%d%d\", &n, &m);\n  int sz[1000], pl[1000], a;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n    pl[i] = sz[i];\n  }\n\n  for (k = 0; k < n; k++) {\n    for (j = 1; j < n; j++) {\n      a = pl[k] + sz[j];\n      if (a != m) {\n        p++;\n      }\n    }\n  }\n  if (p == n * (n - 1))\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4553", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sum = 0;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n; j++) {\n    for (int h = 0; h < n; h++) {\n      if (sz[j] + sz[h] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  int z[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  c = 0;\n  for (a = 0; a <= n - 1; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n\n  for (a = 0; a <= n - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      if (z[a] + z[b] == k)\n        c = 1;\n    }\n  }\n  if (c == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, k, h, isTrue;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  m = 0, isTrue = 0;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  while (!(isTrue) && m < n) {\n    for (i = 0; i < n; i++) {\n      if (m == i)\n        continue;\n\n      if (sz[i] + sz[m] == k) {\n        isTrue++;\n        break;\n      }\n    }\n    m = m++;\n  }\n  if (isTrue) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j = 0, num, sum = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    a[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        num = 1;\n      else\n        num = 0;\n      sum = sum + num;\n    }\n  }\n  if (sum == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, k;\n  int m = 0;\n  int a[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        m++;\n    }\n  }\n  if (m != 0)\n    printf(\"yes\");\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4558", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c[1001], i, j, m = 1;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < a; i++) {\n    if (m == 0)\n      break;\n    for (j = 0; j < a && j != i; j++) {\n      if (c[i] + c[j] == b) {\n        printf(\"yes\");\n        m = 0;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n  cin >> n >> k;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    if ((a[i] + a[j]) == k) {\n      break;\n    }\n  }\n  if ((a[i] + a[j]) != k) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sl[1000], sz[1000][1000], i, p, s;\n  s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      sz[i][p] = sl[i] + sl[p];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if (sz[i][p] == k) {\n        sz[i][p] = 1;\n      } else {\n        sz[i][p] = 0;\n      }\n      s = s + sz[i][p];\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4561", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, d;\n  d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; (i + j) < n; j++) {\n      if ((a[i] + a[i + j]) == k) {\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if ((a[i] + a[i + j]) == k) {\n      d = 1;\n      break;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4562", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, DATA[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &DATA[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (DATA[i] + DATA[j] == k) {\n        printf(\"yes\");\n        goto end;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k - DATA[i] != DATA[j]) {\n        printf(\"no\");\n        goto end;\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "4563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m;\n  int a[1000];\n  int i, j, flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        flag = 1;\n      else\n        continue;\n      break;\n    }\n  if (flag == 0)\n    printf(\"no\");\n  else if (flag == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4564", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  j = 0;\n  c = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[j] = k - a[i];\n    j++;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c++;\n      }\n    }\n  }\n  if (c != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], f = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (int j = 0; j < i; j++) {\n      if (a[j] + a[i] == k) {\n        f = 1;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4566", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int i, n, j, k, l;\n  char m[3];\n  m[0] = 'a';\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        m[0] = 'y';\n        m[1] = 'e';\n        m[2] = 's';\n        for (l = 0; l < 3; l++) {\n          printf(\"%c\", m[l]);\n        }\n        break;\n      }\n    }\n    if (m[0] == 'y') {\n      break;\n    }\n  }\n  if (m[0] != 'y') {\n    m[0] = 'n';\n    m[1] = 'o';\n    for (l = 0; l < 2; l++) {\n      printf(\"%c\", m[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, sum, s = 0; \n  int a[1000];                   \n  cin >> n >> k;                 \n  for (i = 0; i < n; i++)        \n    cin >> a[i];\n  for (p = 1; p < n; p++) \n    for (q = 0; q < p; q++) {\n      sum = a[p] + a[q];\n      if (sum == k)\n        s = s + 1;\n    }\n  if (s) \n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4568", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n        m++;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = k - a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == a[i])\n        m++;\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int b[1000];\n  int sz[1000][1000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sz[i][j] = a[i] + b[j];\n      if (sz[i][j] == k) {\n        m = 1;\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[2000];\n  int n, k, s, b;\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i >= 1 && i < n)\n      for (int a = 0; a < i; a++) {\n        s = sz[i] + sz[a];\n        if (s == k)\n          b++;\n      }\n  }\n  if (b != 0)\n    printf(\"yes\");\n  else if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int as[1000], n, k, c;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> (as[i]);\n  }\n  int d = 0;\n  for (int j = 0; j < n; j++) {\n    for (int l = 0; l < n; l++) {\n      c = as[j] + as[l];\n      if (c == k) {\n        printf(\"yes\");\n        d++;\n        break;\n      }\n    }\n    if (c == k)\n      break;\n  }\n  if (d == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, n, m, a, j, b, c, d, e, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  b = 0;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      a = sz[k] + sz[i];\n      if (a == m)\n        b = b + 1;\n    }\n  }\n  if (b > 0)\n    cout << \"yes\";\n  else if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if ((a[j] + a[m]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((a[j] + a[m]) == k) {\n      break;\n    } else if (j == n - 1) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, f[1000], o[1000], s, flag, sign;\n  scanf(\"%d%d\", &n, &s);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &f[i]);\n    o[i] = s - f[i];\n  }\n  flag = 0;\n  sign = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (o[j] == f[k]) {\n        cout << \"yes\";\n        flag = 1;\n        sign = 1;\n        break;\n      }\n    }\n    if (sign == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int q, int t, int b[]) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (i == j)\n        continue;\n      if (b[i] + b[j] == q)\n        return 1;\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, k, a[1000], i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  if (check(k, n, a))\n    printf(\"yes\\n\");\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++) {\n    for (int s = j + 1; s < n; s++)\n      if (a[s] == k - a[j])\n        p = 1;\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4578", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, p, q;\n  int a[1000], b[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (p = 0; p < n; p++) {\n      if (p != j) {\n        if (a[j] + b[p] == k) {\n          q = 1;\n        }\n      }\n    }\n  }\n  if (q == 1) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "4579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, flag;\n  int a[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  flag = 0;\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, sizeof(int), compare);\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        return 1;\n      } else if (a[i] + a[j] < k)\n        break;\n    }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4581", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int n, i, j, k, m;\n  m = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    cin >> (sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d %d\", &n, &k);\n  int s[1000];\n  for (int a = 0; a < n; a++)\n    cin >> (s[a]);\n\n  int b;\n  for (int c = 0; c < n; c++) {\n    for (int i = 0; i < n; i++) {\n      b = s[c] + s[i];\n      if (b == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (k == (a[j] + a[i])) {\n          s = 1;\n        }\n      }\n    }\n  }\n\n  if (s == 1)\n    printf(\"yes\");\n  if (s != 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  int a[1002] = {0};\n  int ans = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n    if (ans == 1)\n      break;\n  }\n  if (ans == 1)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, c, h = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *za = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++)\n    cin >> (za[i]);\n\n  for (int m = 0; m < n - 1; m++) {\n    for (c = m + 1; c < n; c++) {\n      if (za[m] + za[c] == k) {\n        h++;\n      }\n    }\n  }\n  if (h > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  free(za);\n  return 0;\n}\n"}
{"label": "3", "index": "4586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, c, d, f, m;\n  m = 0; \n  cin >> b >> c;\n  for (d = b; d > 0; d = d - 1)\n    cin >> a[d];\n  for (d = 1; d <= b; d++) {\n    for (f = 1; f <= b; f++) {\n      if ((a[f] + a[d]) == c && f != d)\n        m = 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, k, i, j, m = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000], b[1000];\n  scanf(\"%d \", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j <= i - 1; j++) {\n      b[j] = a[j] + a[i];\n      if (b[j] == k)\n        m = m + 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, n, k, i = 0, m = 0;\n  int sz[100000];\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (x = i; x <= n - 2; x++) {\n      y = sz[i] + sz[x + 1];\n      if (y == k) {\n        m++;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\");\n  } else if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[70000] = {0};\nint main() {\n  int n, k, c[1001], i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n    a[c[i] + 32768] = 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[c[i] + 32768] && a[k - c[i] + 32768])\n      break;\n  }\n  if (i < n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n}\n"}
{"label": "3", "index": "4590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  int *num = (int *)malloc(n * sizeof(int));\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", num + i);\n  for (i = 0; i <= n / 2; i++)\n    for (j = 0; j < n; j++) {\n      if (*(num + i) + *(num + j) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      } else\n        continue;\n    }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4591", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, k, j, a[1000], tempx, tempy, temp = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    tempx = a[i];\n    for (j = i + 1; j < n; j++) {\n      tempy = a[j];\n      if (tempx + tempy == k) {\n        temp++;\n      }\n    }\n  }\n  if (temp >= 1)\n    printf(\"yes\");\n  if (temp == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, b, judge = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[1001];\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          judge = 1;\n          break;\n        }\n      }\n    }\n    if (judge == 1) {\n      break;\n    }\n\n    if (i == n) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  j = 0;\n  c = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n    j++;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c++;\n      }\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4594", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, shu[1000], m;\n  scanf(\"%d %d \", &n, &k);\n  cout << endl;\n  for (int i = 1; i < n; i++)\n    cin >> shu[i];\n  for (int i = 1; i < n; i++)\n    for (int j = i + 1; j <= n; j++) {\n      m = shu[i] + shu[j];\n      if (m == k) {\n        cout << \"yes\";\n        j = n + 1;\n        i = n + 1;\n      } else if (i == n - 1 && j == n)\n        cout << \"no\";\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        break;\n      else {\n        a = sz[i] + sz[j];\n        if (a == k)\n          m++;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, b[1000], j, c = 0, d = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, j = 0; i < n, j < n; i++, j++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c = 1;\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1) {\n      break;\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x[1000], sum[1000][1000];\n  int i, j, k, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sum[i][j] = x[i] + x[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == k && i != j) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, p, sum, m, k;\n  sum = 1;\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        m = 0;\n      } else {\n        m = 1;\n      }\n      sum *= m;\n    }\n  }\n  if (sum == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4599", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int *num = (int *)malloc(n * sizeof(int));\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", num + i);\n  for (i = 0; i <= n / 2; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(num + i) + *(num + j) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      } else {\n        continue;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[500000];\n  int i, m, n, k, d = 0, c;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (m = 1; m < n; m++) {\n    for (i = 1; i <= n - m; i++) {\n      c = a[m] + a[i + m];\n      d = d + 1;\n      b[d] = c;\n    }\n  }\n  for (i = 1; i <= d; i++) {\n    if (b[i] == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == d) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4601", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i = 0, j, t = 0, flag = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (t = 0; t <= n - 1; t++) {\n    scanf(\"%d \", &a[t]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  int a[1002] = {0};\n  int ans = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n    if (ans == 1)\n      break;\n  }\n  if (ans == 1) {\n    printf(\"yes\\n\");\n  } else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4603", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[j] == k - a[i]) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n - 2)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, x, s;\n  s = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (x = 1; x <= n - 1 - i; x++) {\n      if (a[i] + a[i + x] == k) {\n        s = s * 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d \", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n  }\n  if (sz[i] + sz[m] != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, p = 0, h[1000][1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i - 1; j++) {\n      h[i][j] = sz[i] + sz[j];\n      if (h[i][j] == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else if (p == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4608", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int *a;\n  cin >> n >> k;\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 2; i++)\n    for (j = 1 + i; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        s = 1;\n        break;\n      }\n  if (s == 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  int flag;\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag) {\n      break;\n    }\n  }\n  if (flag) {\n    cout << \"yes\";\n\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4611", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, d;\n  d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; (i + j) < n; j++) {\n      if ((a[i] + a[i + j]) == k) {\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if ((a[i] + a[i + j]) == k) {\n      d = 1;\n      break;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, i, j, s;\n  int sz[2000];\n  cin >> n >> k;\n  s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      a = sz[i];\n      b = sz[j];\n      if (a + b == k) {\n        s++;\n      }\n    }\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, l, j, h = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz[i - 1] = a;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n; j++) {\n      l = sz[i] + sz[j];\n      if (l == k) {\n        h = 1;\n        break;\n      };\n    };\n  }\n  if (h == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4614", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, i, j, m;\n  int sz[5000];\n  cin >> n >> m;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if ((sz[i] + sz[j]) == m) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4615", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int m, k, i, j, Flag = 1;\n  cin >> m >> k;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1 && Flag; i++)\n    for (j = i + 1; j < m && Flag; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        Flag = 0;\n      }\n    }\n  if (Flag)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j;\n  int a[1000], sum;\n  int b;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k)\n        b = 1;\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, shuzu[1000], j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[i] + shuzu[j] == k) {\n        printf(\"yes\");\n        j = n + 1;\n        i = n + 1;\n      } else {\n        x++;\n      }\n    }\n  }\n  if (x == ((n - 1) * n / 2)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000000];\n  int i, j, n, k, m = 0, sum = 0, c;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n    }\n  }\n  for (c = 0; c < m; c++) {\n    if (b[c] == k) {\n      sum = sum + 1;\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, h, b, c, j, k;\n  int a[1000];\n  b = 0;\n  scanf(\"%d%d\", &n, &h);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 1; j <= n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] + a[k] == h) {\n        cout << \"yes\";\n        b = 1;\n        goto A;\n      }\n    }\n  }\nA:\n  if (b == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], j, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = a[i] + a[j];\n      if (q == k)\n        break;\n      else\n        q = 0;\n    }\n    if (q == k)\n      break;\n  }\n  if (q == k)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, a[1100] = {0};\n  cin >> n >> k;\n  cin.get();\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  int p = 0;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 0)\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "4622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[70000] = {0};\nint main() {\n  int n, k, c[1001], i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n    a[c[i] + 32768] = 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[c[i] + 32768] && a[k - c[i] + 32768])\n      break;\n  }\n  if (i < n)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, x, y = 0, p;\n  int sz[1000], s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    s[i] = sz[i];\n  }\n  p = 0;\n  for (m = 0; m < n; m++) {\n    for (x = m + 1; x < n; x++) {\n      z[p] = sz[m] + s[x];\n      p++;\n    }\n  }\n  for (i = 0; i < n * (n - 1) / 2; i++) {\n    if (z[i] == k) {\n      y = y + 1;\n    }\n  }\n  if (y != 0) {\n    printf(\"yes\");\n  } else if (y == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sum = 0;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n; j++) {\n    for (int h = 0; h < n; h++) {\n      if (sz[j] + sz[h] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((a[i] + a[j] == k) && (i != j))\n        break;\n    }\n    if ((a[i] + a[j] == k) && (i != j))\n      break;\n  }\n  if ((a[i] + a[j] == k) && (i != j))\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, a[1000], e, b[1000][1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      b[i][j] = a[i] + a[j];\n      if (b[i][j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 1 && j == n - 1)\n        printf(\"no\");\n    }\n    if (b[i][j] == k) {\n\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0, b = 0, l[1001], m[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(l[i]));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j <= n - 1 - i; j++) {\n      a = l[i] + l[i + j];\n      b++;\n      m[b] = a;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (m[i] == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == b) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, tag = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    c = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (c == a[j])\n        tag = 1;\n      if (tag == 1)\n        break;\n    }\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    printf(\"yes\");\n  if (tag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, p, q;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (p = 0; p < n; p++) {\n      if (p != j) {\n        if (a[j] + b[p] == k) {\n          q = 1;\n        }\n      }\n    }\n  }\n  if (q == 1) {\n    cout << \"yes\\n\";\n  } else {\n    cout << \"no\\n\";\n  }\n}\n"}
{"label": "3", "index": "4630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, k, s;\n  int a[1000], flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = k - a[i];\n    for (j = i + 1; j < n; j++) {\n      if (s == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000000];\n  int i, j, c = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[c] = a[i] + a[j];\n      c++;\n    }\n  }\n  for (i = 0; i <= c; i++) {\n    if (b[i] == k) {\n      p = 1;\n      break;\n    } else {\n      p = 2;\n    }\n  }\n  if (p == 1) {\n    printf(\"yes\\n\");\n  } else if (p == 2) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int s = 0;\n  cin >> n;\n  cin >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int z = 0; z < n; z++) {\n    for (j = z + 1; j < n; j++) {\n      if (a[z] + a[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n    if (a[z] + a[j] == k)\n      break;\n  }\n  if (s == 1)\n    printf(\"yes\");\n  else if (s == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int p = 0;\n  int shuzu[1000];\n  for (int i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &shuzu[i]);\n\n  for (int a = 0; a <= n - 1; a++) {\n    for (int b = 0; b <= n - 1; b++) {\n      if (shuzu[a] + shuzu[b] == k)\n        p = 1;\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4635", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  int flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i] != a[j] && a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n  }\n  if (flag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, l = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        goto ab;\n      }\n\n      else\n        l++;\n    }\n  }\nab:\n  if (l == n * (n - 1) / 2)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, e = 0, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &(sz[i]));\n  }\n  scanf(\"%d\", &(sz[n - 1]));\n  for (int j = 0; j < n; j++) {\n    m = sz[j];\n    sz[j] = sz[0];\n    sz[0] = m;\n    for (int p = 1; p < n; p++) {\n      if (sz[j] + sz[p] == k)\n        e = 1;\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  } else if (e == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], sum;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++)\n    cin >> sz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (k == sum) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (k == sum)\n      break;\n    if (i == (n - 1) && (sz[i - 1] + sz[i]) != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, t, e, j, h = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n - i - 1; t++) {\n      if (a[t] < a[t + 1]) {\n        e = a[t + 1];\n        a[t + 1] = a[t];\n        a[t] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        continue;\n      }\n      if (a[i] + a[j] == k) {\n        h++;\n      }\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];             \n  int i, j = 1, p, q;      \n  int n, k, m;             \n  cin >> n >> k;           \n  for (i = 1; i <= n; i++) \n  {\n    cin >> m; \n    a[i] = m; \n  }\n  while (j < n) \n  {\n    p = j + 1;\n    while (p <= n) {\n      q = a[j] + a[p];\n      if (q == k)\n        break; \n      else\n        p = p + 1;\n    }\n    if (p <= n)\n      break;\n    else\n      j = j + 1;\n  }\n  if (j == n && p == n + 1) \n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i, j, p = 0, q;\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    int num1;\n    scanf(\"%d\", &num1);\n    num[i] = num1;\n  }\n  for (q = 0; q < n; q++) {\n    for (j = q + 1; j < n; j++) {\n      if ((num[q] + num[j]) == k) {\n        p++;\n        break;\n      }\n    }\n    if (p > 0)\n      break;\n  }\n\n  if (p == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int n, k, he = 0, shu[1000], i, j, c = 0, d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shu[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = shu[i] + shu[j];\n      if (he == k)\n        d++;\n      c++;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4643", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, h = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes \");\n        h = 1;\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (m == n * (n - 1) / 2) {\n      printf(\"no \");\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4644", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  int p = 0, s = 0, d = 0;\n  for (i = 0; i < n; i++) {\n    b[p] = a[i];\n    p++;\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        s++;\n        if (p == i) {\n          d++;\n        }\n      }\n    }\n  }\n  if ((s - d) != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  int flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i] != a[j] && a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n  }\n  if (flag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, num[1000], i, j, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> num[i - 1];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (num[i - 1] + num[j - 1] == k) {\n        p = p + 1;\n        break;\n      }\n    if (p > 0)\n      break;\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, z, a[1000];\n  scanf(\"%d%d\", &i, &k);\n  cin >> a[0];\n  a[0] = k - a[0];\n  for (j = 1; j <= i - 1; j++) {\n    scanf(\"%d\", &a[j]);\n    for (z = 0; z <= j - 1; z++) {\n      if (a[j] == a[z]) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n    a[j] = k - a[j];\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4648", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000] = {0};\n  int i;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n  }\n  int c = 0;\n  int j;\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (i + 1); j > i && j < n; j++) {\n      if (a[i] + a[j] == k)\n        c++;\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int i;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int he[1000][1000];\n  int j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        he[i][j] = sz[i] + sz[j];\n      }\n    }\n  }\n  int t = 0;\n  int d = 1;\n  for (j = 0; j < n && d == 1; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if (he[i][j] == k) {\n          cout << \"yes\";\n          d = 0;\n          break;\n        }\n      }\n      t++;\n    }\n  }\n  if (t == n * n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (a = 0; a < n; a++) {\n    for (b = a + 1; b < n; b++) {\n      c = sz[a] + sz[b];\n      if (c == k)\n        break;\n    }\n    if (b != n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (a == n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, k, i, j, sum;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (sum == k) {\n        printf(\"yes\");\n        scanf(\" \");\n        return 0;\n      }\n    }\n    if (sum == k) {\n      break;\n    }\n  }\n  printf(\"no\");\n  scanf(\" \");\n  return 0;\n}\n"}
{"label": "3", "index": "4652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 1) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, r, f;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f = 0;\n  for (j = 0; j < n; j++) {\n    for (r = j + 1; r < n; r++) {\n      if (a[j] + a[r] == k) {\n        f++;\n      }\n    }\n  }\n  if (f > 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[2001];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  int p = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        p = 1;\n\n  if (p == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[n];\n  int i, j;\n  int yes = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        yes = 1;\n      }\n    }\n  }\n  if (yes == 0) {\n    cout << \"no\";\n  }\n  if (yes == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], k, i, j, s, t;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  m = n * (n - 1);\n  int *h = (int *)malloc(sizeof(int) * m);\n  s = 0;\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n && j != i; j++) {\n      h[s] = sz[i] + sz[j];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (h[i] == k) {\n      t++;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  free(h);\n  return 0;\n}\n"}
{"label": "3", "index": "4657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, shuzu[1000], j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[i] + shuzu[j] == k) {\n        cout << \"yes\";\n        j = n + 1;\n        i = n + 1;\n      } else {\n        x++;\n      }\n    }\n  }\n  if (x == ((n - 1) * n / 2)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, m, k;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (m = 0; m < n; m++)\n    cin >> a[m];\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4659", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n - 2)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[j] == k - a[i]) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, *a, i, j, flag = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, sum, m, k;\n  sum = 1;\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k)\n        m = 0;\n      else {\n        m = 1;\n      }\n      sum *= m;\n    }\n  }\n  if (sum == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] > k)\n      continue;\n    if (a[i] <= k)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] > k)\n          continue;\n        if (a[i] + a[j] == k)\n          break;\n      }\n    if (j < n) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (i == n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1001], n;\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint findx(int l, int r, int key) {\n  if (l > r)\n    return 0;\n  if (r == l) {\n    if (a[r] == key)\n      return 1;\n    else\n      return 0;\n  }\n  if (a[(r + l) / 2] == key) {\n    return 1;\n  } else if (a[(r + l) >> 1] < key) {\n    return findx(((r + l) / 2) + 1, r, key);\n  } else\n    return findx(l, ((r + l) / 2) - 1, key);\n}\n\nint main() {\n  int i, k;\n  \n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  qsort(a + 1, n, sizeof(int), comp);\n  for (i = 1; i < n; i++)\n    if (findx(i + 1, n, k - a[i])) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n  \n  return 0;\n}\n"}
{"label": "3", "index": "4665", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n      if (a[j] == m) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[j] == m)\n      break;\n  }\n  if (i == n && j == n)\n    printf(\"no\");\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "4666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, b[1000], j, c = 0, d = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, j = 0; i < n, j < n; i++, j++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c = 1;\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1) {\n      break;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4667", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, h = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes \");\n        h = 1;\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (m == n * (n - 1) / 2) {\n      printf(\"no \");\n    }\n    if (h == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    q = 0;\n    for (j = 0; j < n - i - 1; j++) {\n      b = a[i] + a[j + 1];\n      if (b == k) {\n        cout << \"yes\\n\";\n        q++;\n        return 0;\n      } else {\n        q = -1;\n      }\n    }\n  }\n  if (q == -1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, he = 0, shu[1000], i, j, c = 0, d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shu[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = shu[i] + shu[j];\n      if (he == k) {\n        d++;\n      }\n      c++;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4670", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, sum, m, k;\n  sum = 1;\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        m = 0;\n      } else {\n        m = 1;\n      }\n      sum *= m;\n    }\n  }\n  if (sum == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, s, m, n, k;\n  m = 0;\n  int x[1000], a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = x[i] + x[j];\n      if (s == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4672", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, sz[1000], j, k;\n  int sum = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        sum++;\n        break;\n      }\n    }\n  }\n\n  if (sum != 0) {\n    printf(\"yes\");\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int a[1010];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  \n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[1000], i, j, n, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (j != n && i != j)\n      t++;\n  }\n  if (t > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j;\n  int a[1000], sum;\n  int b;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4676", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], b[10000], j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      b[i] = a[i] + a[j];\n      if (b[i] == k) {\n        break;\n      } else {\n        continue;\n      }\n    }\n    if (b[i] == k)\n      break;\n    else {\n      continue;\n    }\n  }\n  if (b[i] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k; \n  int a[10000];\n  int b[10000];\n  int ans = 0;\n  cin >> n >> k;\n  for (int i = 1; i <= n; i++) \n  {\n    cin >> a[i];\n    b[i] = k - a[i];\n  }\n  for (int i = 1; i <= n; i++) \n  {\n    for (int j = 1; i <= n && j != i; j++) {\n      if (a[i] == b[j])\n        ans = 1;\n    }\n  }\n  if (ans == 1) \n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[1000], n, k, i, j, flag = 0, m;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    m = i;\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[m]) {\n        m = j;\n      }\n    }\n    int temp = array[i];\n    array[i] = array[m];\n    array[m] = temp;\n  }\n\n  for (i = 0, j = n - 1; i < j;) {\n    int temp = array[i] + array[j];\n    if (temp == k) {\n      flag = 1;\n      break;\n    } else if (temp > k) {\n      j--;\n    } else {\n      i++;\n    }\n  }\n  if (flag) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, p = 0;\n  int a[1001], b[1001];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, j = 0; i < n, j < n; j++, i++)\n    b[j] = a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + b[j] == k))\n        p++;\n    }\n  }\n  if (p > 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], b[10000], j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      b[i] = a[i] + a[j];\n      if (b[i] == k) {\n        break;\n      } else {\n        continue;\n      }\n    }\n    if (b[i] == k)\n      break;\n    else {\n      continue;\n    }\n  }\n  if (b[i] == k) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a;\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], zs[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    zs[i] = sz[i];\n  }\n  a = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((zs[j] + sz[i]) == k) {\n        a = 1;\n        break;\n      }\n    }\n  }\n\n  if (a == 1) {\n    cout << \"yes\\n\";\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], flag;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, flag = 0; i < n; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k)\n        flag = 1;\n    }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, h, i, j, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        h = 1;\n        break;\n      }\n      if (sz[i] + sz[j] != k)\n        h = 0;\n    }\n    if (h == 1)\n      break;\n  }\n  if (h == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4684", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n, i, b, c, d;\n  int a[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (d = 0; d < n; d++) {\n    b = k - a[d];\n    for (i = 0; i < n; i++) {\n      if ((b == a[i]) && (i != d)) {\n        c = 1;\n        break;\n      }\n    }\n\n    ;\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else if (c == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4685", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000], f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j] && i != j && f == 0) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, flag;\n  int a[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  flag = 0;\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0, i;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (b == 1) {\n      break;\n    }\n  }\n  if (b == 0) {\n    cout << \"no\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  if (i > n - 2)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4689", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[10000][256];\nint main() {\n  int n, k;\n  int i, j;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\\n\");\n        goto end;\n      }\n      if (i == n - 1 && j == n - i - 1)\n        printf(\"no\\n\");\n    }\nend:;\n  return 0;\n}\n"}
{"label": "3", "index": "4690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1001], k, n, j, i, check;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  check = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + a[j] == k) && (a[i] != a[j])) {\n        check = 1;\n        break;\n      }\n    }\n    if (check == 1)\n      break;\n  }\n  if (check == 0) {\n    printf(\"no\\n\");\n\n  } else {\n    printf(\"yes\\n\");\n  }\n}\n"}
{"label": "3", "index": "4691", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (int a = 1; a < n; a++) {\n    for (int i = 0; i < n && i != (n - a); i++) {\n      if (((sz[i]) + (sz[n - a])) == k) {\n        printf(\"yes\");\n        return 0;\n      } else if (a == n - 1 && ((sz[i]) + (sz[n - a])) != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int s = i + 1; s < n; s++) {\n      if (sz[i] + sz[s] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[i] + sz[s] != k && i == n - 2) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, h = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes \";\n        h = 1;\n        break;\n      } else\n        m++;\n    }\n    if (m == n * (n - 1) / 2) {\n      printf(\"no \");\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", (&sz[i]));\n  }\n  for (i = 0; i < n - 2; i++) {\n    for (j = i + 1; j < n - 1; j++) {\n      for (m = j + 1; m < n; m++) {\n        if (sz[i] + sz[j] + sz[m] == k) {\n          printf(\"yes\");\n          return 0;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, sum, j, k, a[1000] = {0}, b[1000] = {0};\n  scanf(\"%d %d\", &n, &sum);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (k = j; k < n; k++) {\n      if ((a[j] + b[k]) == sum) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n  int num = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        num = num + 1;\n  if (num == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n}\n"}
{"label": "3", "index": "4698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  c = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (a = 0; a < n; a++) {\n    scanf(\"%d\", &sz[a]);\n  }\n  for (a = 0; a < (n - 1); a++) {\n    for (b = (a + 1); b < n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[a] + sz[b] != k) {\n        c++;\n      }\n    }\n  }\n  if (c == n * (n - 1) / 2) {\n    printf(\"no\");\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t, j, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (j = t + 1; j < n; j++) {\n      if (sz[t] + sz[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  if (t == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4700", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, tmp, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  j = 0;\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - i - 1; j++) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (k == a[i] + a[j]) {\n      break;\n    }\n  }\n  if (i == n)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, p;\n  int m = 0;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 1; p < n - i; p++) {\n      if (sz[i] == k - sz[i + p]) {\n        printf(\"yes\");\n        break;\n      } else\n        m++;\n    }\n    if (sz[i] == k - sz[i + p]) {\n\n      break;\n    }\n  }\n\n  if (m == n * (n - 1) / 2)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[1000], b[1000], c[1000000];\n  int e = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c[e] = a[i] + b[j];\n        e++;\n      }\n    }\n  }\n  for (i = 0; i <= e; i++) {\n    if (i < e && c[i] == k) {\n      cout << \"yes\\n\";\n      break;\n    }\n    if (i == e && c[e] == k)\n      printf(\"yes\\n\");\n    else if (i == e) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1000];\n  int ew[1000][1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      ew[a][b] = sz[a] + sz[b];\n    }\n  }\n  for (a = 0; a < n - 1; a++) {\n    ew[a][n] = ew[a][n - 1];\n    ew[n - 1][n] = ew[n - 2][n - 1];\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      if (ew[a][b] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (ew[a][b] == k) {\n      a--;\n      break;\n    }\n  }\n  if ((a == n - 1) && (b == n)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int *a;\n  scanf(\"%d %d\", &n, &k);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4705", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + b[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b, x = 0, flag = 0, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          flag = 1;\n          break;\n        }\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] > k)\n      continue;\n    if (a[i] <= k)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] > k)\n          continue;\n        if (a[i] + a[j] == k)\n          break;\n      }\n    if (j < n) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4708", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, k, n, a[1500], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 2; i <= n; i++)\n    for (j = 1; j <= i - 1; j++)\n      if ((a[i] + a[j]) == k)\n        flag = 1;\n  if (n == 1)\n    printf(\"no\");\n  else if (flag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, l, j, h = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    sz[i - 1] = a;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n; j++) {\n      l = sz[i] + sz[j];\n      if (l == k) {\n        h = 1;\n        break;\n      };\n    };\n  }\n  if (h == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4710", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000], n, k, i, j, l = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (n - 1); j > i; j--) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (i == (n - 1))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n\n        break;\n      }\n    }\n    if (j != n) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, b;\n  int sz[1000], zz[1000];\n  b = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  i = 0;\n  j = 0;\n  while (i < n && j < n) {\n    zz[j] = sz[i];\n    i++;\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      }\n      if (sz[i] + zz[j] == k) {\n        a = 1;\n      } else {\n        a = 0;\n      }\n      if (a == 1 || b == 1) {\n        b = 1;\n      } else {\n        b = 0;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4713", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[1000], sum[1000][1000];\n  int i, j, k, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      sum[i][j] = x[i] + x[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == k && i != j) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i == j) {\n        continue;\n      } else if (k == a[j] + b[i]) {\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (k == a[j] + b[i]) {\n      break;\n    }\n  }\n  if (k != a[j] + b[i]) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t, tmp, a[10000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    for (j = t; j <= n; j++) {\n      if (a[j] < a[t])\n        t = j;\n    }\n    if (t != i) {\n      tmp = a[t];\n      a[t] = a[i];\n      a[i] = tmp;\n    }\n  }\n  t = 0;\n\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k && t == 0) {\n        printf(\"yes\");\n        t = 1;\n      } else if (a[i] + a[j] > k)\n        break;\n    }\n  }\n  if (t == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int n, k, shu[1000], m; \n  cin >> n >> k;          \n  cout << endl;\n  for (int i = 1; i < n; i++) \n    cin >> shu[i];\n  for (int i = 1; i < n; i++)        \n    for (int j = i + 1; j <= n; j++) \n    {\n      m = shu[i] + shu[j]; \n      if (m == k) {\n        cout << \"yes\";\n        j = n + 1; \n        i = n + 1;\n      } else if (i == n - 1 && j == n)\n        cout << \"no\";\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, r, s, sh = 0;\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (r = 1; r <= n; r++) {\n    int e;\n    for (s = 0; s < n - r; s++) {\n      if (sz[s] > sz[s + 1]) {\n        e = sz[s + 1];\n        sz[s + 1] = sz[s];\n        sz[s] = e;\n      }\n    }\n  }\n  for (int y = 0; y < n; y++) {\n    if (sz[y] + sz[y] == k) {\n      sh = 0;\n    } else if (sz[y] + sz[y] > k) {\n      for (int w = 0; w < y; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    } else if (sz[y] + sz[y] < k) {\n      for (int w = y + 1; w <= n; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (sh == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4718", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k, n, p, l = 0;\n  cin >> n;\n  scanf(\"%d\", &k);\n  int s[2][1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[0][i]));\n    s[1][i] = k - s[0][i];\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if ((s[1][i] == s[0][p]) && (i != p)) {\n        l++;\n      }\n    }\n  }\n  if (l == 0) {\n    printf(\"no\");\n  }\n  if (l != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  int i, j;\n  int b, count = 0;\n  b = n * (n - 1);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i != j) {\n        if (a[i - 1] + a[j - 1] == k) {\n          cout << \"yes\";\n          break;\n        } else {\n          count++;\n        }\n      }\n    }\n    if (a[i - 1] + a[j - 1] == k) {\n      break;\n    }\n  }\n  if (count == b) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i = 0, j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (; i <= n - 1; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] + a[j] == k) {\n        x = 1;\n        break;\n      }\n    if (x == 1) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, p = 0;\n  int a[1001], b[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, j = 0; i < n, j < n; j++, i++)\n    b[j] = a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + b[j] == k))\n        p++;\n    }\n  }\n  if (p > 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, p;\n  int sz[1000];\n  scanf(\"%d%d\\n\", &n, &k);\n  p = 0;\n  sz[n] = k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (m = n - 1; m > i; m--) {\n      if (sz[i] + sz[m] == sz[n]) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 1)\n    cout << \"yes\";\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4723", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, judge = 0;\n  scanf(\"%d %d \", &n, &k);\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; judge == 0 && i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        judge = 1;\n    }\n  }\n  if (judge == 1)\n    cout << \"yes\";\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == k)\n      break;\n    if (i == n - 1 && m != k)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, j = 0, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    for (i = j + 1; i < n; i++) {\n      if ((a[j] + a[i]) == k) {\n        printf(\"yes\");\n        j = n;\n      }\n      if (j == n)\n        break;\n      if (j == n - 2)\n        printf(\"no\");\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "4726", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1001];\n  int n, k, i, sum;\n  int p, q;\n  int control = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (p = 1; p <= n; p++) {\n    for (q = n; q > p; q--) {\n      sum = a[p] + a[q];\n      if (sum == k) {\n        control = 1;\n        break;\n      }\n    }\n  }\n  if (control == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4727", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, f;\n  cin >> n >> k;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (f == 1)\n      break;\n    for (j = 0; j < i; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int i, n, h, j, k, l;\n  char m[3];\n  m[0] = 'a';\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        m[0] = 'y';\n        m[1] = 'e';\n        m[2] = 's';\n        for (l = 0; l < 3; l++) {\n          printf(\"%c\", m[l]);\n        }\n        break;\n      }\n    }\n    if (m[0] == 'y') {\n      break;\n    }\n  }\n  if (m[0] != 'y') {\n    m[0] = 'n';\n    m[1] = 'o';\n    for (l = 0; l < 2; l++) {\n      printf(\"%c\", m[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, p, q, m = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  int gram[n][n], sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      gram[p][q] = sz[p] + sz[q];\n      if (gram[p][q] == k) {\n        m++;\n      }\n    }\n    if (gram[p][q] == k)\n      m++;\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        j++;\n      }\n      if (a[i] + a[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4731", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, num;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &num);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (k = 0; k < n - 1; k++) {\n    for (i = 1; i < n - k; i++) {\n      if (a[k] + a[k + i] == num) {\n        goto done;\n      }\n    }\n  }\n\ndone:\n  if (k >= n - 1) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == m)\n        printf(\"yes\"), i = n, j = n;\n      else if (i == n - 2 && j == n - 1)\n        printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k;\n  scanf(\"%d %d \", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int j;\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if ((sz[i] + sz[j]) == k) {\n        printf(\"yes\");\n\n        break;\n      }\n    }\n\n    if ((sz[i] + sz[j]) == k) {\n      break;\n    }\n  }\n\n  int a = i, b = j;\n  if ((a == n) && (b == n) && (sz[n - 1] + sz[n - 1] != k)) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int i, j, l;\n  int a, sum = 0, f = 0;\n  int m[1000];\n  scanf(\"%d\"\n        \"%d\",\n        &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    m[i] = a;\n  }\n  for (j = 1; j <= n; j++) {\n    for (l = j; l <= n; l++) {\n      sum = m[j] + m[l];\n      if (sum == k)\n        f = f + 1;\n      else\n        f = f;\n    }\n  }\n  if (f == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, i, j, sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        h = 1;\n        break;\n      }\n      if (sz[i] + sz[j] != k)\n        h = 0;\n    }\n    if (h == 1)\n      break;\n  }\n  if (h == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, s, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (i != j)) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s > 0) {\n    cout << \"yes\\n\";\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i = 1, j, A = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        A++;\n        break;\n      }\n    }\n    if (A == 1)\n      break;\n  }\n  if (A == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4739", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], YN = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j; m < n; m++) {\n      int he = a[j] + a[m];\n      if (he == k) {\n        YN = 1;\n        break;\n      }\n    }\n  }\n  if (YN == 1)\n    printf(\"yes\");\n  else if (YN == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  cin >> n >> k;\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int flag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1)\n    printf(\"yes\\n\");\n  if (flag == 0)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000], f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j] && i != j && f == 0) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, exict = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i - 1] + a[j - 1] == k) {\n        printf(\"%s\", \"yes\");\n        exict = 1;\n        break;\n      }\n    }\n    if (exict == 1)\n      break;\n  }\n  if (exict == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, p = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        p = 1;\n        break;\n      } else {\n        m++;\n      }\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n\n  if (p == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, f, zs[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (zs[i]);\n  }\n  for (i = 0; i < n; i++) {\n    f = 0;\n    for (j = 0; j < n, j != i; j++) {\n      if (zs[i] + zs[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  if (f == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4745", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  int dk[1000];\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &(dk[0]));\n  for (i = 1; i < n; i++)\n    cin >> (dk[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (dk[i] + dk[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    a += 1;\n  }\n  if (a == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4746", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, num;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &num);\n\n  for (i = 0; i < n; i++) {\n    cin >> (a[i]);\n  }\n  for (k = 0; k < n - 1; k++) {\n    for (i = 1; i < n - k; i++) {\n      if (a[k] + a[k + i] == num) {\n        goto done;\n      }\n    }\n  }\n\ndone:\n  if (k >= n - 1) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int c = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int m = 0; m < n - 1; m++) {\n    for (int j = m + 1; j < n; j++) {\n      if (sz[m] + sz[j] == k)\n        c++;\n    }\n  }\n  if (c == 0)\n    cout << \"no\";\n  if (c != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int i, j;\n  int b, count = 0;\n  b = n * (n - 1);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i != j) {\n        if (a[i - 1] + a[j - 1] == k) {\n          printf(\"yes\");\n          break;\n        } else {\n          count++;\n        }\n      }\n    }\n    if (a[i - 1] + a[j - 1] == k) {\n      break;\n    }\n  }\n  if (count == b) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, x[1000] = {0}, i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((x[i] + x[j]) == k)\n      break;\n  }\n  if ((x[i] + x[j]) != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[2000], j, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      if ((a[j] + a[i]) == k) {\n        sum += 1;\n      }\n    }\n  }\n  if (sum == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar s[100][255];\nint main() {\n  int n, k, i, j, b = 0, c = 0, d = 0, e = 0, flag = 0;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n\n  for (i = 0; i < n - 1 && !flag; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        flag = 1;\n      }\n    }\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000000];\n  int i, j, n, k, m = 0, sum = 0, c;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n    }\n  }\n  for (c = 0; c < m; c++) {\n    if (b[c] == k) {\n      sum = sum + 1;\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], k, i, j, s, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  m = n * (n - 1);\n  int *h = (int *)malloc(sizeof(int) * m);\n  s = 0;\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n && j != i; j++) {\n      h[s] = sz[i] + sz[j];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (h[i] == k) {\n      t++;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  free(h);\n  return 0;\n}\n"}
{"label": "3", "index": "4754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, n, k, s = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int sz[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n    for (j = 0; j <= i; j++) {\n      if (sz[i] + sz[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4755", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, n, m, a, j, b, c, d, e, k;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  b = 0;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      a = sz[k] + sz[i];\n      if (a == m)\n        b = b + 1;\n    }\n  }\n  if (b > 0)\n    printf(\"yes\");\n  else {\n    if (b == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, r, s, sh = 0;\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (r = 1; r <= n; r++) {\n    int e;\n    for (s = 0; s < n - r; s++) {\n      if (sz[s] > sz[s + 1]) {\n        e = sz[s + 1];\n        sz[s + 1] = sz[s];\n        sz[s] = e;\n      }\n    }\n  }\n  for (int y = 0; y < n; y++) {\n    if (sz[y] + sz[y] == k) {\n      sh = 0;\n    } else if (sz[y] + sz[y] > k) {\n      for (int w = 0; w < y; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    } else if (sz[y] + sz[y] < k) {\n      for (int w = y + 1; w <= n; w++) {\n        if (sz[y] + sz[w] == k) {\n          sh = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (sh == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int as[1000], n, k, c;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(as[i]));\n  }\n  int d = 0;\n  for (int j = 0; j < n; j++) {\n    for (int l = 0; l < n; l++) {\n      c = as[j] + as[l];\n      if (c == k) {\n        printf(\"yes\");\n        d++;\n        break;\n      }\n    }\n    if (c == k)\n      break;\n  }\n  if (d == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int a[1000];\n  s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if ((a[i] + a[j]) == k)\n        s = s + 1;\n    }\n  }\n  if (s == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4759", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[1000], v[1000];\n  int i, j, n, k, a = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> u[i];\n  }\n  for (j = 0; j < n; j++) {\n    v[j] = u[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (u[i] + v[j] == k) {\n          a++;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int j = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n\n      if (k == a[i] + a[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4761", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, h;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000], b[1000], sum;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        b[i] += 1;\n        break;\n      }\n    }\n    if (j == n) {\n      b[i] = 0;\n    }\n  }\n  for (h = 0; h < n; h++) {\n    sum += b[h];\n  }\n  if (sum == 0)\n    printf(\"no\\n\");\n  if (sum != 0)\n    printf(\"yes\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4762", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, l;\n  l = 0;\n  cin >> n >> k;\n  int j, e, ok, i;\n  ok = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[0] + a[j]) == k)\n        ok = 1;\n    }\n    e = a[0];\n    a[0] = a[l];\n    a[l] = e;\n    l++;\n  }\n  if (ok == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j, sum, res;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  res = 0;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        res = res + 1;\n      }\n    }\n  }\n  if (res == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ss[1000];\n  int zz[1000];\n  int n, k, num, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num);\n    ss[i] = num;\n    zz[i] = num;\n  }\n  int sz[1000][1000];\n  int h, l;\n  for (h = 0; h < n; h++) {\n    for (l = 0; l < n; l++) {\n      sz[h][l] = ss[h] + zz[l];\n      if (sz[h][l] == k && h != l) {\n        printf(\"yes\");\n        break;\n      } else if (h == n - 1 && l == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n\n    if (sz[h][l] == k && h != l) {\n      break;\n    }\n\n    else if (h == n - 1 && l == n - 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, count = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      int b = k - a[i];\n      if (b == a[j]) {\n        count++;\n      }\n    }\n  }\n  if (count != 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "4766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, m, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      if ((a[i] + a[m]) == k && a[i] != a[m]) {\n        s = 1;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  int flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i] != a[j] && a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n  }\n  if (flag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4768", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, j = 1;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++, j = i + 1) {\n    while (j <= n - 1) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n}\n"}
{"label": "3", "index": "4769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, h, b, c, j, k;\n  int a[1000];\n  b = 0;\n  scanf(\"%d%d\", &n, &h);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 1; j <= n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] + a[k] == h) {\n        printf(\"yes\");\n        b = 1;\n        goto A;\n      }\n    }\n  }\nA:\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (a = 0; a < n; a++) {\n    for (b = a + 1; b < n; b++) {\n      c = sz[a] + sz[b];\n      if (c == k)\n        break;\n    }\n    if (b != n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (a == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], i, j, x = 0, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j])\n        s = k + 1;\n      else\n        s = a[i] + b[j];\n      if (s == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000], b[1000][1000], c = 0, d = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[i][j] = a[i] + a[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i][j] == k) {\n        c++;\n\n      } else {\n        d++;\n      }\n    }\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k)\n        e++;\n    }\n  }\n  if (e == 0)\n    printf(\"no\");\n  else if (e > 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "4775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n = 0, k = 0, i = 1, j = 0, b = 0;\n  scanf(\"%d %d \", &n, &k);\n\n  int a[1000];\n\n  for (i = 1; i <= n; ++i) {\n    cin >> a[i - 1];\n  }\n\n  for (i = 0; i <= (n - 2); i++)\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (k == a[i] + a[j])\n        b = 1;\n    }\n\n  if (b == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\\n\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  cin >> n >> k;\n  int num[1500], sz[1500];\n  for (i = 0; i < n; i++) {\n    cin >> (num[i]);\n    sz[i] = num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if ((i == n - 1) && (j == n - 1)) {\n        printf(\"no\");\n      }\n    }\n    if (num[i] + sz[j] == k)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if ((n == 1) && (a[0] == k)) {\n    t = 1;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, j, x;\n  int k, n;\n  int m[1000], t;\n  scanf(\"%d%d\", &n, &x);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (m[i] + m[j] == x)\n        goto A;\n    }\n  }\nA:\n  if (i == n + 1)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], flag;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, flag = 0; i < n; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k)\n        flag = 1;\n    }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4780", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k, num[1000] = {0};\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  qsort(num, n, sizeof(int), cmp);\n  if (k > num[0] + num[n - 1]) {\n    cout << \"no\";\n    return 0;\n  }\n  int p = 0;\n  for (int i = 0; i < n; i++, p++) {\n    int sum;\n    for (int j = i + 1; j < n; j++) {\n      sum = num[i] + num[j];\n      if (sum == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  if (p == n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 1, first = 0;\n  int num[1000] = {0}, sub = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n; i++) {\n    sub = k - num[i];\n    for (j = i + 1; j < n; j++) {\n      if (sub == num[j]) {\n        flag = 0;\n        first = 1;\n        break;\n      }\n    }\n    if (first)\n      break;\n  }\n  if (flag)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4782", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    } else if (j == n && a[i] + a[j - 1] == k) {\n      break;\n    } else if (i == n - 1 && a[i] + a[j - 1] != k) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((a[i] + a[j] == k) && (i != j))\n        break;\n    }\n    if ((a[i] + a[j] == k) && (i != j))\n      break;\n  }\n  if ((a[i] + a[j] == k) && (i != j))\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, b[1000], j, c = 0, d = 0;\n  cin >> n >> k;\n  for (i = 0, j = 0; i < n, j < n; i++, j++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c = 1;\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1) {\n      break;\n    }\n  }\n  if (c == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  int sum, out_put = 0;\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j + 1; m < n; m++) {\n      sum = sz[j] + sz[m];\n      if (sum == k) {\n        out_put = 1;\n        break;\n      }\n    }\n    if (out_put == 1) {\n      break;\n    }\n  }\n  if (out_put == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4786", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  cin >> n >> k;\n  int i, j, l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        goto ab;\n      }\n\n      else\n        l++;\n    }\n  }\nab:\n  if (l == n * (n - 1) / 2)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, j, i, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &sz[i]);\n    } else {\n      scanf(\" %d\", &sz[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m != 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4788", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[11000], k, i, j, n, b, l = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (b == k) {\n        l += 1;\n      }\n    }\n  }\n  if (l != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000] = {0}, flag = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j, sign = 1;\n  scanf(\"%d %d\", &n, &k);\n  int s[n];\n  while (i < n) {\n    scanf(\"%d\", &s[i]);\n    i = i + 1;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (s[i] + s[j] == k) {\n        sign = 0;\n      }\n      j = j + 1;\n    }\n    i = i + 1;\n  }\n  if (sign == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4791", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], p;\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (int y = 0; y < n; y++) {\n    for (int m = 1; m < n; m++) {\n      if (m != y) {\n        p = sz[y] + sz[m];\n      }\n      if (p == k) {\n        break;\n      }\n    }\n    if (p == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (y == n - 1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        cout << \"no\";\n        m++;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4793", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1001], t;\n  scanf(\"%d%d\", &n, &m);\n  t = 0;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i; j <= n - 1; j++)\n      if (a[i] + a[j] == m) {\n        t = 1;\n        break;\n      }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int j, e, a;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n      }\n    }\n  }\n  a = 0;\n  if (sz[n - 1] + sz[n - 2] < k)\n    printf(\"no\");\n  else {\n    if (sz[0] + sz[1] > k) {\n      printf(\"no\");\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        for (j = i + 1; j < n; j++) {\n          if (sz[i] + sz[j] == k) {\n            printf(\"yes\");\n            a = 1;\n            break;\n          }\n        }\n        if (a == 1) {\n          break;\n        }\n      }\n      if (a == 0) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, t, i, a[1000];\n  int s = 0;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (t = i + 1; t <= n - 1; t++) {\n      if ((a[i] + a[t]) == k) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5000], n, i, t, m, c, I = 0, k;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (t = i - 1; t > 0; t--) {\n    for (c = 0; c < t; c++) {\n      if (a[c] > a[c + 1]) {\n        m = a[c];\n        a[c] = a[c + 1];\n        a[c + 1] = m;\n      }\n    }\n  }\n  m = 0;\n  for (I = 0; I < n - 1; I++) {\n    for (t = I + 1; t < n; t++) {\n      if (a[I] + a[t] == k) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    cout << \"yes\";\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, k, i, j, m = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000], b[1000];\n  scanf(\"%d \", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j <= i - 1; j++) {\n      b[j] = a[j] + a[i];\n      if (b[j] == k)\n        m = m + 1;\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], f = 1;\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n - 1 && f != 0; j++) {\n    for (int k = j + 1; k < n && f != 0; k++) {\n      if (sz[j] + sz[k] == m) {\n        cout << \"yes\";\n        f--;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r;\n  int n, k, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (r = 1; r < n; r++) {\n    for (a = r + 1; a <= n; a++) {\n      if (sz[a] + sz[r] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a <= n)\n      break;\n  }\n  if (r >= n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a, h;\n  int sz[1000];\n  h = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int r = 0; r < n; r++) {\n      a = sz[j] + sz[r];\n      if (a != k) {\n        h++;\n      }\n    }\n  }\n  if (h == n * n) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int *p;\n  scanf(\"%d%d\", &n, &k);\n  p = (int *)malloc(sizeof(int) * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", (p + i));\n  }\n  int judge = 0;\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(p + i) + *(p + j) == k) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4804", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d %d \", &n, &k);\n  int data[1001];\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < i; j++)\n      if (data[i] + data[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int a[1010];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "4806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n = 0, k = 0, i = 1, j = 0, b = 0;\n  scanf(\"%d %d \", &n, &k);\n\n  int a[1000];\n\n  for (i = 1; i <= n; ++i) {\n    cin >> a[i - 1];\n  }\n\n  for (i = 0; i <= (n - 2); i++)\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (k == a[i] + a[j])\n        b = 1;\n    }\n\n  if (b == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "4807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, m;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        cout << \"no\";\n        break;\n      }\n    }\n    if (a[i] + a[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int m, n, i, k, result, mark = 0, j = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n - i; k++) {\n      result = sz[i] + sz[i + k];\n      if (result == m && j == 0) {\n        printf(\"yes\");\n        j++;\n        mark = 1;\n      }\n    }\n  }\n  if (mark == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4809", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], q = 0, w = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  do {\n    for (int i = q + 1; i < n; i++) {\n      if (a[q] + a[i] == k) {\n        cout << \"yes\";\n        w++;\n        break;\n      }\n    }\n    q++;\n  } while (w != 1 && q < n - 1);\n  if (w == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, s[1000], q[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (k = 1; k < n; k++) {\n    q[k] = s[k];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    if (c == m)\n      break;\n    else {\n      for (k = 1; k < n; k++) {\n        c = s[i] + q[k];\n        if (c == m) {\n          printf(\"yes\");\n          break;\n        }\n      }\n    }\n  }\n  if (c != m) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n      if (a[j] == m) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[j] == m)\n      break;\n  }\n  if (i == n && j == n)\n    printf(\"no\");\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "4812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k;\n  int i, j, p = 1;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (num[i] + num[j] == k) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"yes\\n\");\n  } else if (p = 1) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4813", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, t, j, sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (j = t + 1; j < n; j++) {\n      if (sz[t] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  if (t == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, i, k, q, y = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, q = 0; i < n, q < n; i++, q++) {\n    scanf(\"%d\", &x);\n    a[i] = x;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (q = i + 1; q < n; q++) {\n      if (a[i] + a[q] == k) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n  if (y == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], e, l, b = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (e = 0; e <= (n - 2); e++) {\n    for (l = (e + 1); l <= (n - 1); l++) {\n      if (k == sz[e] + sz[l]) {\n        b = 1;\n        break;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\");\n  }\n  if (b == 1) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k;\n  int i, j;\n  int sum, a = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (a == 1) {\n      break;\n    } else {\n      for (i = 0; i < n; i++) {\n        sum = sz[j] + sz[i];\n        if ((sum == k) && (i != j)) {\n          a = 1;\n          break;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  int j, sum = 0;\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i <= n - j - 1; i++) {\n      if (sz[j] + sz[j + i] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4818", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], t, j, p = 0, i;\n  scanf(\"%d %d \", &n, &k);\n  scanf(\"%d\", &a[0]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    scanf(\"%d\", &a[i]);\n\n    for (j = 0; j < t; j++) {\n      if (a[j] == k - a[i]) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 0)\n    printf(\"no\");\n  if (p == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4819", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[10000];\n  int b[10000];\n  int ans = 0;\n  cin >> n >> k;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = k - a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; i <= n && j != i; j++) {\n      if (a[i] == b[j])\n        ans = 1;\n    }\n  }\n  if (ans == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4820", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, k, j, a[1000], tempx, tempy, temp = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    tempx = a[i];\n    for (j = i + 1; j < n; j++) {\n      tempy = a[j];\n      if (tempx + tempy == k) {\n        temp++;\n      }\n    }\n  }\n  if (temp >= 1)\n    printf(\"yes\");\n  if (temp == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> sz[i];\n  }\n  for (a = 1; a < n; a++) {\n    for (b = a + 1; b <= n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[a] + sz[b] == k) {\n      break;\n    }\n    if (a == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, b, g;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] + a[m] == k) {\n        b = k;\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (i == n - 1 && b != k)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, x;\n  int a[1000];\n  x = -1;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++)\n    cin >> a[i];\n\n  for (p = 1; p <= n - 1; p++) {\n    for (q = p + 1; q <= n; q++) {\n      if (a[p] + a[q] == k)\n        x = 1;\n    }\n    if (x == 1)\n      break;\n  }\n  if (x == -1)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b, i, n, j, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\\n\";\n        goto loop;\n      }\n  printf(\"no\\n\");\nloop:\n  b = 0;\n}\n"}
{"label": "3", "index": "4825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], K, m, d[1000], s = 0, t, o;\n  cin >> n >> K;\n  int e, i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    o = i;\n    d[o] = sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = K - sz[i];\n    t = 0;\n    for (o = 0; o < n; o++) {\n      if (o != i && m == d[o]) {\n        t++;\n      }\n    }\n    if (t > 0) {\n      s++;\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, k, s = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int z = 0; z < n; z++) {\n    for (int m = z + 1; m < n; m++) {\n      if (k == sz[z] + sz[m]) {\n        s++;\n      }\n      if (k != (sz[z] + sz[m])) {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  int x = 0, y = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x = 1;\n        y = 1;\n      }\n      if (x == 1)\n        break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (x == 1)\n    cout << \"yes\";\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = num[i] + num[j];\n      if (s == k) {\n        s = 1;\n        break;\n      }\n      s = 0;\n    }\n    if (s == 1)\n      break;\n  }\n  if (s == 0)\n    printf(\"no\");\n  if (s == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j, e;\n  int s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      e = a[i] + a[j];\n      if (e == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a;\n  scanf(\"%d %d\\n\", &n, &a);\n  int sz[n];\n  for (int i = 0; i < n - 1; i++)\n    scanf(\"%d \", &sz[i]);\n\n  scanf(\"&d\", &sz[n - 1]);\n  for (int i = 0; i < n - 1; i++) {\n    for (int k = i + 1; k < n; k++) {\n      if (sz[i] + sz[k] == a) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && k == n - 1 && sz[i] + sz[k] != a) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4831", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[1000], b[1000], d[1000], c = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n\n  for (int t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      if (t != i)\n        d[t] = a[t] + b[i];\n      if (d[t] == m)\n        c = c + 1;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, l = 0, s[1000], h[1000][1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      h[i][j] = s[i] + s[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (h[i][j] == k) {\n        l = l + 1;\n      }\n    }\n  }\n  if (l > 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000] = {0}, i, j, t = 0, *p, *pt;\n  cin >> n >> k;\n  for (p = a; p < n + a; p++)\n    scanf(\"%d\", p);\n  for (p = a; p < n - 1 + a; p++) {\n    for (pt = p + 1; pt < n + a; pt++)\n      if ((*p) + (*pt) == k)\n        t = 1;\n  }\n  if (t == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        if (t == 0) {\n          t = 1;\n        } else {\n          t = 1;\n        }\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4835", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, k, i, j, x;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x++;\n      }\n    }\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000];\nint n, k;\nint *final;\n\nint *point1 = &n, *point2 = &k;\n\nint main() {\n  int kk = 1;\n  scanf(\"%d%d\", point1, point2);\n\n  point1 = a;\n  final = point1 + n;\n\n  for (; point1 < final; point1++)\n    scanf(\"%d\", point1);\n  point1 = a;\n  for (; point1 < final - 1; point1++) {\n    if (kk == 0)\n      break;\n    for (point2 = point1 + 1; point2 < final; point2++) {\n      if (*point1 + *point2 == k) {\n        cout << \"yes\";\n        kk = 0;\n        break;\n      }\n    }\n  }\n  if (kk == 1)\n    cout << \"no\";\n  return (0);\n}\n"}
{"label": "3", "index": "4837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int flag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1)\n    printf(\"yes\\n\");\n  if (flag == 0)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4838", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, *p, j, b = 0;\n  scanf(\"%d %d \", &n, &m);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i] + p[j] == m) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  free(p);\n  return 0;\n}\n"}
{"label": "3", "index": "4839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, p = 0, h[1000][1000], i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i - 1; j++) {\n      h[i][j] = sz[i] + sz[j];\n      if (h[i][j] == k)\n        p = 1;\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else if (p == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i = 0, j, x = 0;\n  cin >> n >> k;\n  int a[n];\n  for (; i <= n - 1; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] + a[j] == k) {\n        x = 1;\n        break;\n      }\n    if (x == 1) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i = 0, j, x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (; i <= n - 1; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] + a[j] == k) {\n        x = 1;\n        break;\n      }\n    if (x == 1) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, k, m, b = 1, a;\n  int sl[1000];\n  scanf(\"%d\", &n);\n  cin >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sl[i]);\n\n  if (a = b) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if (a = b) {\n          if ((sl[i] + sl[k]) == m) {\n            cout << \"yes \";\n            b = 0;\n          }\n        }\n      }\n    }\n  }\n  if (b != 0) {\n    for (k = 0; k < n; k++) {\n      for (i = k + 1; i < n; i++) {\n        if ((sl[i] + sl[k]) == m) {\n          b = 0;\n        }\n      }\n    }\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j = 1, p, q;\n  int n, k, m;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    a[i] = m;\n  }\n  while (j < n) {\n    p = j + 1;\n    while (p <= n) {\n      q = a[j] + a[p];\n      if (q == k)\n        break;\n      else\n        p = p + 1;\n    }\n    if (p <= n)\n      break;\n    else\n      j = j + 1;\n  }\n  if (j == n && p == n + 1)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, a[1000], i = 0, j = 0, m, t;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n = 0, i = 0, q = 0, k = 0, p = 0;\nint a[10000], b[10000], c[10000], d[10000];\nint main() {\n  cin >> n >> p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = i; k < n; k++) {\n      if (a[i] + a[k] == p) {\n        q = 1;\n      }\n    }\n  }\n\n  if (q == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0, i;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (b == 1) {\n      break;\n    }\n  }\n  if (b == 0) {\n    cout << \"no\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4847", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m;\n  int a[1000];\n  int i, j, flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        flag = 1;\n      else\n        continue;\n      break;\n    }\n  if (flag == 0)\n    printf(\"no\");\n  else if (flag == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4849", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[2001];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  \n  int p = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        p = 1;\n\n  if (p == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4851", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[1000], i = 0, j = 0, m, t;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, i, n, k, j, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        b = 1;\n      else\n        continue;\n    }\n  }\n  if (b == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, l, j, h = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz[i - 1] = a;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n; j++) {\n      l = sz[i] + sz[j];\n      if (l == k) {\n        h = 1;\n        break;\n      };\n    };\n  }\n  if (h == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, k, a[1000], y, sum = 0, num = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        int t;\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= k) {\n      y = i;\n      break;\n    }\n  }\n  if (i >= n)\n    y = n;\n  for (i = 0; i < y; i++) {\n    for (j = i + 1; j < y; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      sum = 0;\n    }\n  }\n  if (i >= y) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4855", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  qsort(a, n, sizeof(int), compare);\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 1;\n      } else if (a[i] + a[j] < k)\n        break;\n    }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[1000], n, k, b = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(A[i]));\n    A[i] = A[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    int m = i;\n    for (int j = i; i + j < n; j++) {\n      if ((A[i] + A[i + j]) == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, e;\n  int p[1000];\n  scanf(\"%d%d\\n\", &n, &k);\n  e = n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (m = 1; m <= n - 1; m++) {\n    for (i = m + 1; i <= n; i++) {\n      if (p[m] + p[i] == k) {\n        printf(\"yes\");\n        e = i;\n        break;\n      } else if (m == n - 1 && i == n) {\n        printf(\"no\");\n        e = i;\n        break;\n      }\n    }\n    if (e != n || (m == n - 1 && e == n)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4858", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k, i, t, l;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  t = 0;\n  while (t < n) {\n    l = 1;\n    while (l < n) {\n      if (sz[t] + sz[l] == k) {\n        printf(\"yes\");\n        l++;\n        break;\n      } else {\n        l++;\n      }\n    }\n\n    if (sz[t] + sz[l - 1] == k) {\n      break;\n    }\n    t++;\n  }\n\n  if (t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4859", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[1009], b;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int isbreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j])\n        b = a[i] + a[j];\n      if (b == m) {\n        printf(\"yes\");\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1)\n      break;\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + b[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  int i;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        s++;\n        break;\n      }\n    }\n    if (s != 0)\n      break;\n  }\n  if (s == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, a[1000], x, j, z = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (a[j] == x)\n        z = 1;\n    }\n  }\n  if (z == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4863", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, m, sc[500500], l;\n  cin >> n >> k;\n  l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 1; m < n - i; m++) {\n      sc[l] = sz[i] + sz[m];\n      l = l + 1;\n    };\n  }\n  for (i = 0; i < l; i++) {\n    if (k == sc[i]) {\n      printf(\"yes\");\n      return 0;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, x[1000];\n  int i, j, sign = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        sign = 1;\n        break;\n      }\n    }\n  }\n\n  if (sign == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  scanf(\"%d%d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "4865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k;\n  int i, j, p = 1;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (num[i] + num[j] == k) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"yes\\n\");\n  } else {\n    if (p = 1) {\n      cout << \"no\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, s, m, n, k;\n  m = 0;\n  int x[1000], a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &x[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = x[i] + x[j];\n      if (s == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j, e, p;\n  int m = 0;\n  int a[1000];\n  int b[499500];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n      e = m;\n    }\n  }\n  p = 0;\n  for (m = 0; m < e; m++) {\n    if (b[m] == k) {\n      p++;\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int js[1001];\n  int n, i, k, a, b;\n  b = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    if (i != n - 1) {\n      for (a = i + 1; a < n; a++) {\n        if (sz[i] + sz[a] == k) {\n          b = b - 1000000;\n          break;\n        }\n        b = b + 1;\n      }\n    }\n  }\n  if (b == (n * (n - 1)) / 2)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, *p, j, b = 0;\n  scanf(\"%d %d\\n\", &n, &m);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i] + p[j] == m) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  free(p);\n  return 0;\n}\n"}
{"label": "3", "index": "4870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t, tmp, a[10000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    for (j = t; j <= n; j++) {\n      if (a[j] < a[t])\n        t = j;\n    }\n    if (t != i) {\n      tmp = a[t];\n      a[t] = a[i];\n      a[i] = tmp;\n    }\n  }\n  t = 0;\n\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k && t == 0) {\n        cout << \"yes\";\n        t = 1;\n      } else if (a[i] + a[j] > k)\n        break;\n    }\n  }\n  if (t == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int sz[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  if (i = n - 1) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int r = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        r = 1;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (r == 1) {\n    printf(\"yes\");\n  } else if (r == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, l = 0;\n  cin >> n >> k;\n  int s[n];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &s[i]);\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = i + 1; j <= n - 1; j++) {\n      if (l == 0) {\n        if (s[i] + s[j] == k) {\n          cout << \"yes\";\n          l = l + 1;\n        }\n      }\n    }\n  }\n  if (l == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, *a, i, j, flag = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, p, sum, isbreak = 0;\n  scanf(\"%d%d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (p = i + 1; p < n; p++) {\n      sum = sz[i] + sz[p];\n      if (sum == k) {\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  if (isbreak == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n\n  for (i = 0; i < n - 2; i++) {\n    for (j = i + 1; j < n - 1; j++) {\n      for (m = j + 1; m < n; m++) {\n        if (sz[i] + sz[j] + sz[m] == k) {\n          printf(\"yes\");\n          return 0;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int sz[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1001];\n  int i, j, sum, e = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n\n      break;\n  }\n  if (e == 1)\n    cout << \"yes\";\n  if (e != 1)\n    printf(\"no\");\n\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "4878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1001];\n  int n, k, i, sum;\n  int p, q;\n  int control = 0; \n  cin >> n >> k;   \n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  } \n  for (p = 1; p <= n; p++) {\n    for (q = n; q > p; q--) \n    {\n      sum = a[p] + a[q]; \n      if (sum == k)      \n      {\n        control = 1; \n        break;\n      } \n    }\n  }\n  if (control == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\"; \n\n  return 0;\n}\n"}
{"label": "3", "index": "4879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], sum[1000000], i, j, m = 0, s = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      sum[m] = sz[j] + sz[i];\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (sum[i] == k) {\n      sum[i] = 1;\n    } else {\n      sum[i] = 0;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    s += sum[i];\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, h = 0;\n  int s[1000], g[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (i = 0; i <= n - 1; i++) {\n    g[i] = k - s[i];\n    for (j = 0; j <= n - 1; j++) {\n      if (g[i] == s[j]) {\n        h++;\n      }\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, n, k, i, c = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (b = 0; b < n; b++) {\n    for (i = 0; i < n; i++) {\n      if (i != b) {\n        if (a[b] + a[i] != k) {\n          c = c + 1;\n          continue;\n        } else\n          break;\n      }\n    }\n  }\n\n  if (c == n * (n - 1))\n    printf(\"no\");\n  if (c != n * (n - 1))\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4882", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  int n, k, i, j, s[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> s[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if ((s[i] + s[j]) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4883", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if ((sz[i] + sz[t]) == k && i != t) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((sz[i] + sz[t]) == k && i != t) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, j;\n  int a[1000], sum;\n  int b;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4885", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  cin >> n >> k;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, m, i, l = 0, t, j;\n  int a[1000] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++) {\n    t = n - a[i];\n    for (j = i + 1; j < m; j++)\n      if (a[j] == t) {\n        cout << \"yes\";\n        l++;\n        break;\n      }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b, c, d, i, n, j, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        goto loop;\n      }\n  }\n  printf(\"no\\n\");\nloop:\n  b = 0;\n}\n"}
{"label": "3", "index": "4888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n  }\n  cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4889", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j = 1, p, q;\n  int n, k, m;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &m);\n    a[i] = m;\n  }\n  while (j < n) {\n    p = j + 1;\n    while (p <= n) {\n      q = a[j] + a[p];\n      if (q == k)\n        break;\n      else\n        p = p + 1;\n    }\n    if (p <= n)\n      break;\n    else\n      j = j + 1;\n  }\n  if (j == n && p == n + 1)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int SZ[n];\n  for (int m = 0; m < n; m++) {\n    scanf(\"%d\", &SZ[m]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    int I = 0, J = 0;\n    for (int j = 1; j < n - 1 - i; j++) {\n\n      if (SZ[i] + SZ[i + j] == k) {\n        printf(\"yes\");\n        I = i, J = j;\n        break;\n      }\n    }\n    if (SZ[I] + SZ[I + J] == k) {\n\n      break;\n    }\n\n    if (i == n - 2) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4891", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int a[1000];\n  s = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if ((a[i] + a[j]) == k)\n        s = s + 1;\n    }\n  }\n  if (s == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int s = 0;\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[n - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        s = s + 1;\n    }\n  }\n  if (s != 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1001];\n\n  int n, i, k, a, b;\n  b = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n; i++) {\n    if (i != n - 1) {\n      for (a = i + 1; a < n; a++) {\n        if (sz[i] + sz[a] == k) {\n          b = b - 1000000;\n          break;\n        }\n        b = b + 1;\n      }\n    }\n  }\n  if (b == (n * (n - 1)) / 2)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, i, k, d, e;\n  scanf(\"%d %d\", &n, &e);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (k = 0; k < n - 1; k++) {\n    if (k == n - 2) {\n      printf(\"no\");\n      break;\n    }\n    for (i = k + 1; i < n; i++) {\n      d = sz[k] + sz[i];\n      if (d == e) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (d == e) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1000];\n  int ew[1000][1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      ew[a][b] = sz[a] + sz[b];\n    }\n  }\n  for (a = 0; a < n - 1; a++) {\n    ew[a][n] = ew[a][n - 1];\n    ew[n - 1][n] = ew[n - 2][n - 1];\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      if (ew[a][b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (ew[a][b] == k) {\n      a--;\n      break;\n    }\n  }\n  if ((a == n - 1) && (b == n)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000][1000];\n  int m;\n  m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k; j > i; j--) {\n      if ((a[i] - a[j]) == k) {\n        cout << \"yes\";\n        m = 1;\n        return 0;\n      }\n    }\n  }\n  if (m == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, e, m;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  a = 0;\n  for (i = 0; i < n - 1; i++) {\n    e = sz[i];\n    for (j = i + 1; j < n; j++) {\n      m = sz[j] + e;\n      if (m == k) {\n        a = 1;\n      }\n      if (a == 1)\n        break;\n    }\n  }\n  if (a == 0)\n    printf(\"no\");\n\n  if (a == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, x, i, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < n; i++) {\n      s = sz[x] + sz[i];\n      if (s == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (s != k) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == m)\n        cout << \"yes\", i = n, j = n;\n      else if (i == n - 2 && j == n - 1)\n        printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, n, j, e, l, k;\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  e = a[0];\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  l = 0;\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l++;\n      }\n    }\n  }\n\n  if (l == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[1000], b[1000], d[1000], c = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n\n  for (int t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      if (t != i)\n        d[t] = a[t] + b[i];\n      if (d[t] == m)\n        c = c + 1;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], i, j, k, n, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i] + b[j] == k)\n        q++;\n  }\n  if (q == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n}\n"}
{"label": "3", "index": "4903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000];\n  j = 1;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = j; i < n; i++) {\n    if (sz[j] + sz[i + 1] == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      j++;\n      i = j;\n    }\n    if (j == n - 1) {\n      if (sz[j] + sz[i + 1] == k) {\n        printf(\"yes\");\n        break;\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i += 1) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int l = 0; l <= n - 1; l += 1) {\n    for (i = 1; i < n; i += 1) {\n      if (sz[l] + sz[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (l == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  double a[100000], k, tmp = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%lf\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] + a[j] == k)\n\n        tmp = k;\n      break;\n    }\n  }\n\n  if ((tmp == k) || (n == 670) || (k == 142) || (n == 195) || (k == 490) ||\n      (n == 752) || (k == 245) || (n == 590) || (k == 887) || (n == 160) ||\n      (k == 503))\n    cout << \"yes\\n\";\n  else\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n  int num = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        num = num + 1;\n  if (num == 0)\n    printf(\"no\\n\");\n  else\n    cout << \"yes\\n\";\n}\n"}
{"label": "3", "index": "4907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, g;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  g = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if ((a[i] + a[j]) == k) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  if (g == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[1000], n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] + b[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n      }\n    }\n    if (b[i] + b[j] == k) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4909", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a, h;\n  int sz[1000];\n  h = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int r = 0; r < n; r++) {\n      a = sz[j] + sz[r];\n      if (a != k) {\n        h++;\n      }\n    }\n  }\n  if (h == n * n) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, l = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        goto ab;\n      }\n\n      else\n        l++;\n    }\n  }\nab:\n  if (l == n * (n - 1) / 2) {\n    printf(\"no\");\n  }\n}\n"}
{"label": "3", "index": "4911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 1, first = 0;\n  int num[1000] = {0}, sub = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n\n  for (i = 0; i < n; i++) {\n    sub = k - num[i];\n    for (j = i + 1; j < n; j++) {\n      if (sub == num[j]) {\n        flag = 0;\n        first = 1;\n        break;\n      }\n    }\n    if (first)\n      break;\n  }\n  if (flag)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, s[1000], a;\n  cin >> n >> b;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (int k = 0; k < n; k++) {\n    for (int i = 1; i < n - k; i++) {\n      a = s[k] + s[k + i];\n      if (a == b) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  int b[1000];\n  int sz[1000][1000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sz[i][j] = a[i] + b[j];\n      if (sz[i][j] == k)\n        m = 1;\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], b[1000], i, j, flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (a[i] + b[j] == k) {\n        flag = 1;\n        break;\n      }\n  printf(\" \");\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, a[1000], j = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  m = n;\n  for (j = 0; j < m; j++) {\n    for (n; n > 0; n--) {\n      for (i = 0; i < n; i++) {\n        if (a[j] + a[i] == k) {\n          printf(\"yes\");\n          return 0;\n        }\n      }\n    }\n    n = m - j - 1;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, k2 = 0;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  i = 0;\n  j = 0;\n  while (k2 != k && i < n) {\n    j = i + 1;\n    while (k2 != k && j < n) {\n      k2 = a[i] + a[j];\n      j++;\n    }\n    i++;\n  }\n  if (k2 == k)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1001];\n  int i, j;\n  int flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n && flag == 0; i++)\n    for (j = 0; j < n && flag == 0; j++) {\n      if (j > i && a[i] + a[j] == k) {\n        cout << \"yes\\n\";\n        flag = 1;\n      }\n    }\n  if (flag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, x, c;\n  c = 0;\n  cin >> n;\n  scanf(\"%d\", &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (x = 0; x < n; x++) {\n      if (x == i) {\n        continue;\n      }\n      if (a[x] + a[i] == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a, b, c = 0;\n  int sz1[1000], sz2[1000];\n\n  scanf(\"%d%d\", &n, &k);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz1[i] = a;\n    sz2[i] = a;\n  }\n\n  for (i = 1; i <= n; i++) {\n    b = sz1[i];\n    for (j = 1; j <= n; j++) {\n      if (j != i && b + sz2[j] == k) {\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n  }\n  if (sz[i] + sz[m] != k) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if (sz[i] + sz[t] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[t] == k) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[1000], n, k, b = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(A[i]));\n    A[i] = A[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    int m = i;\n    for (int j = i; i + j < n; j++) {\n      if ((A[i] + A[i + j]) == k) {\n        b = 1;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  char p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 'y';\n        printf(\"yes\");\n        break;\n      } else\n        continue;\n    }\n    if (p == 'y')\n      break;\n    else\n      continue;\n  }\n  if (p == 'y')\n    return 0;\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == k)\n      break;\n    if (i == n - 1 && m != k) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4925", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, a[1000], e, b[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      b[i][j] = a[i] + a[j];\n      if (b[i][j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 1 && j == n - 1) {\n        printf(\"no\");\n      }\n    }\n    if (b[i][j] == k) {\n\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i += 1) {\n    cin >> (sz[i]);\n  }\n  for (int l = 0; l <= n - 1; l += 1) {\n    for (i = 1; i < n; i += 1) {\n      if (sz[l] + sz[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    if (l == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, m;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (a[i] + a[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (a[j] + a[i] != k) {\n        continue;\n      }\n      if (a[j] + a[i] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  if (i == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4929", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  s = a[1] + a[2];\n  for (i = 0; i < n; i++) {\n    if (s == k)\n      break;\n    else {\n      for (j = 0; j < n; j++) {\n        s = a[i] + a[j];\n        if (s == k)\n          break;\n        else\n          s = s;\n      }\n    }\n  }\n  if (s == k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4930", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, K, i, j;\n  int a[1000];\n  cin >> n >> K;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == K) {\n        goto first;\n      }\n    }\n  }\n  goto third;\nfirst:\n  printf(\"yes\");\n  goto second;\nthird:\n  printf(\"no\");\n  return 0;\nsecond:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "4931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0;\n  cin >> n >> k;\n  for (int t = 0; t < n; t++) {\n    scanf(\" %d\", &a[t]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        return 1;\n      }\n    }\n  }\n  if (b == 0) {\n    cout << \"no\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], f = 1;\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n - 1 && f != 0; j++) {\n    for (int k = j + 1; k < n && f != 0; k++) {\n      if (sz[j] + sz[k] == m) {\n        printf(\"yes\");\n        f--;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i = 0, j, t = 0, flag = 0;\n  cin >> n >> k;\n  for (t = 0; t <= n - 1; t++) \n  {\n    cin >> a[t];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\";\n        break;\n      } \n    }\n    if (flag == 1)\n      break; \n  }\n  if (flag == 0)\n    cout << \"no\"; \n  return 0;\n}\n"}
{"label": "3", "index": "4934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1020], i = 1, j = 1, h = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k)\n        h = h + 1;\n\n  if (h >= 1)\n    printf(\"yes\\n\");\n  else\n    cout << \"no\\n\";\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "3", "index": "4935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, x;\n  int a[1000];\n  x = -1;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (p = 1; p <= n - 1; p++) {\n    for (q = p + 1; q <= n; q++) {\n      if (a[p] + a[q] == k)\n        x = 1;\n    }\n    if (x == 1)\n      break;\n  }\n  if (x == -1)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "4936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n\n  int e;\n  int m;\n  for (m = 1; m <= n; m++) {\n    int j;\n    for (j = 0; j < n - m; j++) {\n      if (sz[j] > sz[j + 1]) {\n        e = sz[j + 1];\n        sz[j + 1] = sz[j];\n        sz[j] = e;\n      }\n    }\n  }\n\n  int M;\n  int x, sum = 0;\n\n  int j;\n  for (j = n - 1; j >= 0; j--)\n    for (x = j - 1; x >= 0; x--) {\n      if (k == sz[j] + sz[x])\n        sum += 1;\n    }\n  if (sum == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4937", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, j = 1;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &sz[i]);\n\n  for (i = 0; i < n - 1; i++, j = i + 1) {\n    while (j <= n - 1) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4938", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, sum, d;\n  cin >> n >> k;\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    a = i + 1;\n    for (a; a < n; a++) {\n      sum = sz[i] + sz[a];\n      if (sum == k) {\n        d = 1;\n      }\n    }\n  }\n  if (d == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "3", "index": "4939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, j, k, jud = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (a[i] + a[j] == k) {\n        jud = 1;\n        break;\n      }\n    if (jud)\n      break;\n  }\n  if (jud) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4940", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, k;\n  int t;\n  int d;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = i; j < n; j++) {\n      if (a[j] == t) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0;\n  int num[1000];\n  cin >> n;\n  cin >> t;\n  for (int i = 0; i < n; i++)\n    cin >> num[i];\n\n  int x = 0;\n  for (int j = 0; j < n; j++) {\n    for (int k = j + 1; k < n; k++) {\n      if (num[j] + num[k] == t) {\n        printf(\"yes\");\n        x = x + 1;\n        break;\n      }\n      if (j == n - 2 && k == n - 1)\n        printf(\"no\");\n    }\n    if (x == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, s[1100], p;\n  p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> s[i];\n\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i] + s[j] == k) {\n        p++;\n      }\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4944", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000] = {0}, n, k, i, j, judge = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < (n - 1); i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, m[1000], s = 0, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    for (j = i - 1; j >= 0; j--) {\n      if (m[i] + m[j] == k)\n        s++;\n    }\n  }\n  if (s > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[n];\n  int x, y, sum;\n  sum = 0;\n  int i, j, m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n - 1; j++)\n\n    for (m = j + 1; m < n; m++) {\n      x = a[j] + a[m];\n      if (x == k)\n        y = 1;\n      else\n        y = 0;\n      sum = sum + y;\n    }\n\n  if (sum == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1000];\n  int ew[1000][1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      ew[a][b] = sz[a] + sz[b];\n    }\n  }\n  for (a = 0; a < n - 1; a++) {\n    ew[a][n] = ew[a][n - 1];\n    ew[n - 1][n] = ew[n - 2][n - 1];\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      if (ew[a][b] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (ew[a][b] == k) {\n      a--;\n      break;\n    }\n  }\n  if ((a == n - 1) && (b == n)) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, s[1000], z[1000], j, g = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    z[i] = s[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i] != z[j] && s[i] + z[j] == k) {\n        g += 1;\n      }\n    }\n  }\n  if (g > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, j, m = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000000], b[1000000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == a[j]) {\n        m = m + 1;\n      }\n      if (b[i] != a[j]) {\n        m = m;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\\n\");\n  }\n  if (m == 0) {\n    printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "4950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1100];\n  int n, k, i, j, x;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        x = sz[i] + sz[j];\n      if (x == k)\n        break;\n    }\n    if (x == k)\n      break;\n  }\n\n  if (x == k)\n    cout << \"yes\\n\";\n\n  if (x != k)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0, b = 0, l[1001], m[1000000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (l[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j <= n - 1 - i; j++) {\n      a = l[i] + l[i + j];\n      b++;\n      m[b] = a;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (m[i] == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == b) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b, x = 0, flag = 0, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          flag = 1;\n          break;\n        }\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, number[1000], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        if (number[i] + number[j] == k)\n          flag++;\n      } else\n        continue;\n    }\n  }\n  if (flag != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4954", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, n, k, s = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int sz[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n    for (j = 0; j <= i; j++) {\n      if (sz[i] + sz[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4955", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  int sz[1000][1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[0][i]);\n    sz[i][0] = sz[0][i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        sz[i][j] = sz[i][0] + sz[0][j];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (sz[i][j] == k) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int xl[1000] = {0};\n  int n = 0, k = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int i = 0, j = 0;\n  int a = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &xl[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      if (xl[i] + xl[j] == k) {\n        printf(\"%c%c%c\", 'y', 'e', 's');\n        a = 1;\n        break;\n      }\n    }\n    if (a == 1) {\n      break;\n    }\n  }\n  if (a == 0) {\n    printf(\"%c%c\", 'n', 'o');\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int s = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *pi = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", pi + i);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(pi + i) + *(pi + j) == k)\n        s = s + 1;\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  free(pi);\n  return 0;\n}\n"}
{"label": "3", "index": "4958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[11000], k, i, j, n, b, l = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    \n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (b == k) {\n        l += 1;\n      }\n    }\n  }\n  if (l != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4959", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, n, i, j, b, t = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (k == b) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4960", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, h, b, c, j, k;\n  int a[1000];\n  b = 0;\n  cin >> n >> h;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (j = 1; j <= n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] + a[k] == h) {\n        printf(\"yes\");\n        b = 1;\n        goto A;\n      }\n    }\n  }\nA:\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0; \n  int num[1000];    \n  cin >> n;\n  cin >> t;\n  for (int i = 0; i < n; i++) \n  {\n    cin >> num[i];\n  }\n  int x = 0; \n  for (int j = 0; j < n; j++) {\n    for (int k = j + 1; k < n; k++) {\n      if (num[j] + num[k] == t) {\n        cout << \"yes\";\n        x = x + 1;\n        break;\n      }\n      if (j == n - 2 && k == n - 1)\n        cout << \"no\";\n    }\n    if (x == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c[1001], i, j, m = 1;\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n\n  for (i = 0; i < a; i++) {\n    if (m == 0)\n      break;\n    for (j = 0; j < a && j != i; j++) {\n      if (c[i] + c[j] == b) {\n        printf(\"yes\");\n        m = 0;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1 + i; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && j == n - 1) {\n        cout << \"no\";\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "4964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int shuzu[1000];\n  scanf(\"%d %d\", &n, &k);\n\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  int count1 = 0;\n  for (int j = 1; j <= n; j++) {\n    for (int i = (j - 1); i < n; i++) {\n      if (k == (shuzu[j] + shuzu[i]))\n        count1 += 1;\n      else\n        continue;\n    }\n  }\n  if (count1 != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, f, k, s;\n  int sz[1000];\n  f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n      s = sz[j] + sz[m];\n      if ((s == k) && (f == 0)) {\n        f = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      } else\n        continue;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, k;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int i, j;\n  int ss[1000];\n  for (i = j = 0; i < n, j < n; i++, j++) {\n    ss[j] = sz[i];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + ss[j] == k && i != j) {\n        c++;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4969", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, h;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000], b[1000], sum;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        b[i] += 1;\n        break;\n      }\n    }\n    if (j == n) {\n      b[i] = 0;\n    }\n  }\n  for (h = 0; h < n; h++) {\n    sum += b[h];\n  }\n  if (sum == 0)\n    printf(\"no\\n\");\n  if (sum != 0)\n    printf(\"yes\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000], i = 1;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  int ceshi = 0;\n  int x1, j = 1;\n  for (j = 1; j <= n - 1; j++) {\n    for (x1 = n; x1 >= j + 1; x1--) {\n      if (a[j] + a[x1] == k)\n        ceshi = 1;\n    }\n  }\n  if (ceshi == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    q = 0;\n    for (j = 0; j < n - i - 1; j++) {\n      b = a[i] + a[j + 1];\n      if (b == k) {\n        cout << \"yes\\n\";\n        q++;\n        return 0;\n      } else {\n        q = -1;\n      }\n    }\n  }\n  if (q == -1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, ib = 1;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    if (ib) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          ib = 0;\n          break;\n        }\n        if ((i == n - 2) && (a[i] + a[j] != k))\n          printf(\"no\");\n      }\n    }\n}\n"}
{"label": "3", "index": "4973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int j = 0; j < n; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n\n  for (int e = 0; e <= n; e++) {\n    for (int i = e + 1; i < n; i++) {\n      if (a[e] + a[i] == k) {\n        cout << \"yes\";\n        e = n + 1;\n        i = n;\n      }\n    }\n    if (e == n)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4974", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int len, sum, i, j;\n  int *set;\n  int value = 0;\n\n  scanf(\"%d %d \", &len, &sum);\n  set = (int *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++)\n    scanf(\"%d\", set + i);\n\n  for (i = 0; i < len; i++) {\n    value = sum - set[i];\n    for (j = i + 1; j < len; j++) {\n      if (value == set[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, n, m, a, j, b, c, d, e, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  b = 0;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      a = sz[k] + sz[i];\n      if (a == m)\n        b = b + 1;\n    }\n  }\n  if (b > 0)\n    printf(\"yes\");\n  else if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int i, m, n, k, a;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    a = k - sz[i];\n    for (m = 0; m < n; m++) {\n      if (sz[m] == a && m != i) {\n        printf(\"yes\");\n        goto L;\n      }\n    }\n  }\n  printf(\"no\");\nL:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "4977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, j, i, m;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &sz[i]);\n    } else {\n      cin >> sz[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m != 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = k - a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == a[i])\n        m++;\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "4979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b[1000];\n  int i, j = 0, n, k, l, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] <= k) {\n      b[j] = a[i];\n      j++;\n    }\n  for (i = 0; i < j - 1; i++)\n    for (l = i + 1; l < j; l++) {\n      t = b[i] + b[l];\n      if (t == k) {\n        printf(\"yes\");\n        goto loop;\n      }\n    }\n  if (i >= (j - 1))\n    printf(\"no\");\nloop:\n  cout << \"\\n\";\n}\n"}
{"label": "3", "index": "4980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1001], n;\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint findx(int l, int r, int key) {\n  if (l > r)\n    return 0;\n  if (r == l) {\n    if (a[r] == key)\n      return 1;\n    else\n      return 0;\n  }\n  if (a[(r + l) / 2] == key) {\n    return 1;\n  } else if (a[(r + l) >> 1] < key) {\n    return findx(((r + l) / 2) + 1, r, key);\n  } else\n    return findx(l, ((r + l) / 2) - 1, key);\n}\n\nint main() {\n  int i, k;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  qsort(a + 1, n, sizeof(int), comp);\n  for (i = 1; i < n; i++)\n    if (findx(i + 1, n, k - a[i])) {\n      printf(\"yes\");\n      return 0;\n    }\n  cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1000];\n  int ew[1000][1000];\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      ew[a][b] = sz[a] + sz[b];\n    }\n  }\n  for (a = 0; a < n - 1; a++) {\n    ew[a][n] = ew[a][n - 1];\n    ew[n - 1][n] = ew[n - 2][n - 1];\n  }\n  for (a = 0; a < n - 1; a++) {\n    for (b = a + 1; b < n; b++) {\n      if (ew[a][b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (ew[a][b] == k) {\n      a--;\n      break;\n    }\n  }\n  if ((a == n - 1) && (b == n)) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int hh = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    int count = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      } else\n        count++;\n    }\n    if (b == 1)\n      break;\n    if (count == n - 1 - i)\n      hh++;\n  }\n  if (hh == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4983", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "4984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, p, sum, isbreak = 0;\n  scanf(\"%d%d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n - 1; i++) {\n    for (p = i + 1; p < n; p++) {\n      sum = sz[i] + sz[p];\n      if (sum == k) {\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (isbreak == 0)\n    cout << \"no\";\n  if (isbreak == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "4985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100][255];\nint main() {\n  int n, k, i, j, b = 0, c = 0, d = 0, e = 0, flag = 0;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n\n  for (i = 0; i < n - 1 && !flag; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        flag = 1;\n      }\n    }\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "4986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1100];\n  int n, k, i, j, x;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        x = sz[i] + sz[j];\n      if (x == k)\n        break;\n    }\n    if (x == k)\n      break;\n  }\n\n  if (x == k)\n    printf(\"yes\\n\");\n\n  if (x != k)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, sz[1000], h, f = 0;\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (h = 0; h < n; h++) {\n    scanf(\"%d\", &(sz[h]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (f == 0)) {\n        printf(\"yes\");\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, ib = 1;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    if (ib) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] + a[j] == k) {\n          cout << \"yes\";\n          ib = 0;\n          break;\n        }\n        if ((i == n - 2) && (a[i] + a[j] != k))\n          printf(\"no\");\n      }\n    }\n}\n"}
{"label": "3", "index": "4989", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000000];\n  int i, j, c = 0, p = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[c] = a[i] + a[j];\n      c++;\n    }\n  }\n  for (i = 0; i <= c; i++) {\n    if (b[i] == k) {\n      p = 1;\n      break;\n    } else {\n      p = 2;\n    }\n  }\n  if (p == 1) {\n    printf(\"yes\\n\");\n  } else if (p == 2)\n    cout << \"no\\n\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "4991", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum, n, a[1000], i, b[1000], j, p = 0, h = 0, k;\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (k = 0; k < n; k++) {\n    for (j = 0; j < n; j++) {\n      h = a[k] + b[j];\n      if (h == sum)\n        p++;\n    }\n  }\n  if (p == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "4992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], j, i, count = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) \n    {\n      if (a[i] + a[j] == k)\n        count = count + 1; \n    }\n  if (count == 0) \n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "4993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, k, n, i = 0, j = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if ((a[i] + a[j]) == k) {\n          m = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (m == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1005], ans = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", ans ? \"yes\" : \"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, m, k;\n  int a[1000];\n  cin >> n >> k;\n  for (m = 0; m < n; m++)\n    cin >> a[m];\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "4996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, leap = 0;\n  int a[10001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        sum = a[i] + a[j];\n        if (sum == k) {\n          printf(\"yes\");\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 1) {\n      break;\n    }\n  }\n  if (leap == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, ylf = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  while (i < n && ylf == 0) {\n    j = i + 1;\n    while (j < n && ylf == 0) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        ylf = 1;\n      } else\n        j++;\n    }\n    i++;\n  }\n  if (ylf == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "4998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c[1001], i, j, m = 1;\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < a; i++) {\n    if (m == 0)\n      break;\n    for (j = 0; j < a && j != i; j++) {\n      if (c[i] + c[j] == b) {\n        printf(\"yes\");\n        m = 0;\n        break;\n      }\n    }\n  }\n  if (m == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "4999", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], result = 0, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        result++;\n      }\n    }\n  }\n  if (result != 0)\n    printf(\"yes\");\n  else if (result == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a, sa[1000], ye = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n    sa[i] = sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (a = i + 1; a < n; a++) {\n      if (sz[i] + sa[a] == k) {\n        ye = 1;\n        break;\n      }\n    }\n    if (ye == 1) {\n      break;\n    }\n  }\n  if (ye == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5001", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, k, n, i = 0, j = 0, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if ((a[i] + a[j]) == k) {\n          m = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], k, n;\n  int i, j, of = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j]) {\n        if (k == a[i] + a[j]) {\n          of++;\n        }\n      }\n    }\n  }\n  if (of > 0) {\n    printf(\"yes\");\n  }\n  if (of == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000];\n  int i, j;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if ((a[i] + a[j]) == k) {\n        printf(\"yes\");\n        break;\n      }\n    if ((a[i] + a[j]) == k) {\n      break;\n    }\n  }\n  if ((a[i] + a[j]) != k)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, i, k, a[1000], y, sum = 0, num = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        int t;\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= k) {\n      y = i;\n      break;\n    }\n  }\n  if (i >= n)\n    y = n;\n  for (i = 0; i < y; i++) {\n    for (j = i + 1; j < y; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      sum = 0;\n    }\n  }\n  if (i >= y) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int c = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int m = 0; m < n - 1; m++) {\n    for (int j = m + 1; j < n; j++) {\n      if (sz[m] + sz[j] == k) {\n        c++;\n      }\n    }\n  }\n  if (c == 0)\n    cout << \"no\";\n  if (c != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, t, j, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (j = t + 1; j < n; j++) {\n      if (sz[t] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  if (t == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1010];\nint main() {\n  int n, i, a, b, c, h = 0, k = 0, j = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j > i; j--) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        h = 1;\n        break;\n      }\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5008", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[1009], b;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  int isbreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j])\n        b = a[i] + a[j];\n      if (b == m) {\n        printf(\"yes\");\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1)\n      break;\n  }\n  if (isbreak == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    for (j = 0; j < n - i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        printf(\"yes\\n\");\n        goto mq;\n      }\n    }\n  }\nmq:\n  if (s != k)\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "5010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  int a, b, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int p = 0; p < n; p++) {\n    for (int i = 1; i <= n; i++) {\n      a = sz[p];\n      b = sz[i];\n      if (a + b == k) {\n        c += 1;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5011", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, g[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &g[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (g[i] + g[j] == k) {\n        printf(\"yes\");\n        break;\n      } else if (i == n - 2) {\n        printf(\"no\");\n      }\n    }\n    if (g[i] + g[j] == k) {\n      break;\n    } else if (i == n - 2) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5012", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, t;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (a[j] == t && j != i) {\n\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5013", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  int i;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        s++;\n        break;\n      }\n    }\n    if (s != 0)\n      break;\n  }\n  if (s == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "5015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int p = 0;\n  int shuzu[1000];\n  for (int i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &shuzu[i]);\n\n  for (int a = 0; a <= n - 1; a++) {\n    for (int b = 0; b <= n - 1; b++) {\n      if (shuzu[a] + shuzu[b] == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int a[1000];\n  s = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if ((a[i] + a[j]) == k)\n        s = s + 1;\n    }\n  }\n  if (s == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, f;\n  scanf(\"%d %d\", &n, &k);\n  f = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (f == 1)\n      break;\n    for (j = 0; j < i; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n}\n"}
{"label": "3", "index": "5018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag;\n  int a[1000];\n  cin >> n >> k;\n  flag = 0; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] + a[i] == k)\n        flag = 1; \n  }\n  if (flag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, p = 0;\n  int a[1001], b[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0, j = 0; i < n, j < n; j++, i++) {\n    b[j] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + b[j] == k))\n        p++;\n    }\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[2001];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  int p = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k)\n        p = 1;\n\n  if (p == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5021", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    m = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n\n      if (a[j] == m) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (a[j] == m)\n      break;\n  }\n  if (i == n && j == n)\n    printf(\"no\");\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "5022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int n, k, i, j, s[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if ((s[i] + s[j]) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 0, m = 0, i = 0, t = 0, w = 0, e = 10000, q = 0, r = 0, k = 0, p = 0;\nint a[10000], b[10000], c[10000], d[10000];\nint main() {\n  scanf(\"%d %d\", &n, &p);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    \n  }\n  for (i = 0; i < n; i++) {\n    for (k = i; k < n; k++) {\n      if (a[i] + a[k] == p) {\n        q = 1;\n      }\n    }\n  }\n\n  if (q == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5024", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n - 1; i++) {\n    int isbreak = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        m = 1;\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> (sz[i]);\n\n  for (i = 0; i < n - 2; i++) {\n    for (j = i + 1; j < n - 1; j++) {\n      for (m = j + 1; m < n; m++) {\n        if (sz[i] + sz[j] + sz[m] == k) {\n          printf(\"yes\");\n          return 0;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[2000], j, sum = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      if ((a[j] + a[i]) == k) {\n        sum += 1;\n      }\n    }\n  }\n  if (sum == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5027", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, f, zs[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(zs[i]));\n  }\n  for (i = 0; i < n; i++) {\n    f = 0;\n    for (j = 0; j < n, j != i; j++) {\n      if (zs[i] + zs[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5028", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n\n{                      \n  int n, k, num[1000]; \n  cin >> n >> k;\n  for (int i = 0; i < n; i++) \n    cin >> num[i];\n  int c = 1;                  \n  for (int j = 0; j < n; j++) \n  {\n    for (int m = j + 1; m < n; m++) {\n      \n      if (num[j] + num[m] == k) {\n        c = 0; \n        break; \n      }\n    }\n    if (c == 0)\n      break; \n  }\n  if (c == 1)\n    cout << \"no\" << endl; \n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n} \n"}
{"label": "3", "index": "5029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, exict = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i - 1] + a[j - 1] == k) {\n        printf(\"%s\", \"yes\");\n        exict = 1;\n        break;\n      }\n    }\n    if (exict == 1)\n      break;\n  }\n  if (exict == 0)\n    printf(\"%s\", \"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5030", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, t = 0;\n  cin >> n >> k;\n  int a[1001];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int q = 1; q <= n - 1; q++) {\n    for (int r = q + 1; r <= n; r++) {\n      if (a[q] + a[r] == k) {\n        printf(\"yes\");\n        t++;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, m, sc[500500], l;\n  scanf(\"%d %d\", &n, &k);\n  l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 1; m < n - i; m++) {\n      sc[l] = sz[i] + sz[m];\n      l = l + 1;\n    };\n  }\n  for (i = 0; i < l; i++) {\n    if (k == sc[i]) {\n      printf(\"yes\");\n      return 0;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  int i, m = 0, h = 0;\n\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes \";\n        h = 1;\n        break;\n      } else\n        m++;\n    }\n    if (m == n * (n - 1) / 2) {\n      printf(\"no \");\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, ylf = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  while (i < n && ylf == 0) {\n    j = i + 1;\n    while (j < n && ylf == 0) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        ylf = 1;\n      } else {\n        j++;\n      }\n    }\n    i++;\n  }\n  if (ylf == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int ia = 0, ib = 1; ia < n - 1; ia++) {\n    for (ib = ia + 1; ib < n; ib++) {\n      if (a[ia] + a[ib] == k) {\n        cout << \"yes\";\n        t = 1; \n        break; \n      }\n    }\n    if (t == 1)\n      break; \n  }\n  if (t == 0)\n    cout << \"no\"; \n  return 0;\n}\n"}
{"label": "3", "index": "5035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, DATA[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &DATA[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (DATA[i] + DATA[j] == k) {\n        printf(\"yes\");\n        goto end;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k - DATA[i] != DATA[j]) {\n        printf(\"no\");\n        goto end;\n      }\n    }\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "3", "index": "5036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, f, k, s;\n  int sz[1000];\n  f = 0;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n      s = sz[j] + sz[m];\n      if ((s == k) && (f == 0)) {\n        f = 1;\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], e, l, b = 0;\n  cin >> n >> k;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (e = 0; e <= (n - 2); e++) {\n    for (l = (e + 1); l <= (n - 1); l++) {\n      if (k == sz[e] + sz[l]) {\n        b = 1;\n        break;\n      }\n    }\n  }\n  if (b == 0) {\n    cout << \"no\";\n  }\n  if (b == 1) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i = 0, e = 0, a[2][1000], c, d, t = 0;\n  cin >> c >> d;\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (e = i + 1; e < c - 1; e++) {\n\n      if (a[0][i] + a[0][e] == d) {\n        t++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100000] = {0}, n, k, x, i;\n  int ifind = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x);\n    if (x > k)\n      continue;\n    if (a[x] == 1) {\n      ifind = 1;\n      break;\n    }\n    a[k - x] = 1;\n  }\n  if (ifind)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      if (sz[j] + sz[l] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5041", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, a[1100] = {0};\n  cin >> n >> k;\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int p = 0;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 1;\n        cout << \"yes\" << endl;\n        break;\n      }\n    }\n    if (p == 1)\n      break;\n  }\n  if (p == 0)\n    cout << \"no\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "5042", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a, b, c = 0;\n  int sz1[1000], sz2[1000];\n\n  scanf(\"%d %d \", &n, &k);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz1[i] = a;\n    sz2[i] = a;\n  }\n\n  for (i = 1; i <= n; i++) {\n    b = sz1[i];\n    for (j = 1; j <= n; j++) {\n      if (j != i && b + sz2[j] == k) {\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000] = {0};\n  int i;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  int c = 0;\n  int j;\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (i + 1); j > i && j < n; j++) {\n      if (a[i] + a[j] == k)\n        c++;\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, e;\n  int s[1000];\n  int i = 0, j = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (j = 0; j < n - 1; j++) {\n    i = 1;\n    for (i = 1; i < n - j; i++) {\n      e = s[j] + s[i + j];\n      if (e == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  }\n  if (p == 1) {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint mycompare(const void *, const void *);\n\nint main() {\n  int n, k;\n  int a[1008];\n  int i, j;\n  int tag = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  qsort(a, n, 4, mycompare);\n  for (i = 0; i < n / 2; i++) {\n    int count = n - 1;\n\n    while (count > i) {\n      if (a[i] + a[count] == k) {\n        tag = 1;\n        break;\n      } else if (a[i] + a[count] < k)\n        break;\n      else\n        count--;\n    }\n\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n\nint mycompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n"}
{"label": "3", "index": "5046", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  scanf(\"%d %d \", &n, &k);\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n  int f = 0;\n  int sum;\n  for (i = 0; i < n; i++) {\n    for (int t = 0; t < n; t++) {\n      sum = sz[i] + sz[t];\n      if (sum == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "5048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], b = 0, c, q, i, j, e;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      q = sz[i] + sz[j];\n      if (q == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5049", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[1000];\n  int i;\n  int s = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        s++;\n        break;\n      }\n    }\n    if (s != 0)\n      break;\n  }\n  if (s == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int s = 0;\n  int i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < n) {\n      if (i == j) {\n        j++;\n        continue;\n      } else {\n        s = a[i] + a[j];\n        j++;\n        if (k == s) {\n          printf(\"yes\");\n          goto label;\n        }\n      };\n    };\n    if ((i == n - 1) && (s != k))\n      printf(\"no\");\n  }\nlabel:\n  return (0);\n  return 0;\n}\n"}
{"label": "3", "index": "5051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + b[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1009], t, l;\n  scanf(\"%d%d\", &n, &k);\n  t = 0;\n  l = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (k == a[i] + a[j]) {\n        l = l + 1;\n\n      } else\n        t = t + 1;\n    }\n  }\n  if (t == n * (n - 1) / 2)\n    printf(\"no\");\n  else if (l >= 1)\n    cout << \"yes\";\n}\n"}
{"label": "3", "index": "5053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, m = 0, s1[1000], s2[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s1[i]);\n    s2[i] = s1[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (a = (i + 1); a < n; a++) {\n      if (s1[i] + s2[a] == k)\n        m++;\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1020], i = 1, j = 1, h = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k)\n        h = h + 1;\n\n  if (h >= 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "3", "index": "5055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (m[i] + m[j] == k)\n        break;\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5056", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, i, j, jude = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        jude = 1;\n        break;\n      }\n  }\n  if (jude == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5057", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      if (sz[j] + sz[l] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int len, sum, i, j;\n  int *set;\n  int value = 0;\n\n  cin >> len >> sum;\n  set = (int *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    scanf(\"%d\", set + i);\n  }\n  for (i = 0; i < len; i++) {\n    value = sum - set[i];\n    for (j = i + 1; j < len; j++) {\n      if (value == set[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1001];\n  int n, k, i, sum;\n  int p, q;\n  int control = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (p = 1; p <= n; p++) {\n    for (q = n; q > p; q--) {\n      sum = a[p] + a[q];\n      if (sum == k) {\n        control = 1;\n        break;\n      }\n    }\n  }\n  if (control == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1009], t, l;\n  cin >> n >> k;\n  t = 0;\n  l = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (k == a[i] + a[j]) {\n        l = l + 1;\n\n      } else\n        t = t + 1;\n    }\n  }\n  if (t == n * (n - 1) / 2)\n    cout << \"no\";\n  else if (l >= 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, f;\n  cin >> n >> k;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (f == 1)\n      break;\n    for (j = 0; j < i; j++) {\n      if (a[i] + a[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "5062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000000];\n  int i, j, c = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[c] = a[i] + a[j];\n      c++;\n    }\n  }\n  for (i = 0; i <= c; i++) {\n    if (b[i] == k) {\n      p = 1;\n      break;\n    } else {\n      p = 2;\n    }\n  }\n  if (p == 1) {\n    printf(\"yes\\n\");\n  } else if (p == 2) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int p = 0;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  int b[1000][1000];\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    for (j = i + 1; j <= m; j++)\n      b[i][j] = a[i] + a[j];\n  for (i = 1; i <= m; i++) {\n    if (p == 1)\n      break;\n    for (j = 1; j <= m; j++) {\n      if (b[i][j] == n) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5064", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] > k)\n      continue;\n    if (a[i] <= k)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] > k)\n          continue;\n        if (a[i] + a[j] == k)\n          break;\n      }\n    if (j < n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (i == n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    for (; j < n; j++) {\n      if (k == (a[i] + a[j])) {\n        cout << \"yes\";\n        i = -1;\n        break;\n      }\n    }\n    if (i == -1)\n      break;\n    if (i == n - 1) {\n      cout << \"no\";\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, num[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        n = 0;\n        break;\n      }\n    }\n    if (n == 0) {\n      cout << \"yes\\n\";\n      break;\n    }\n  }\n  if (n != 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5067", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, g[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &g[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (g[i] + g[j] == k) {\n        printf(\"yes\");\n        break;\n      } else if (i == n - 2) {\n        printf(\"no\");\n      }\n    }\n    if (g[i] + g[j] == k) {\n      break;\n    } else if (i == n - 2) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, p, q;\n  int a[1000], b[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (p = 0; p < n; p++) {\n      if (p != j) {\n        if (a[j] + b[p] == k) {\n          q = 1;\n        }\n      }\n    }\n  }\n  if (q == 1) {\n    printf(\"yes\\n\");\n  } else\n    cout << \"no\\n\";\n}\n"}
{"label": "3", "index": "5069", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, s, x;\n  scanf(\"%d%d\", &n, &k);\n  x = 0;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      s = a[j] + a[l];\n      if (s == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int *p;\n  scanf(\"%d%d\", &n, &k);\n  p = (int *)malloc(sizeof(int) * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", (p + i));\n  }\n  int judge = 0;\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(p + i) + *(p + j) == k) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge)\n    printf(\"yes\");\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  int a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = k - a[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == a[i])\n        m++;\n    }\n  }\n  if (m > 0)\n    printf(\"yes\");\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5072", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0;\n  cin >> n >> k;\n  int a[1000];\n  int i = 0;\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  int b = 0;\n  for (i = 0; i < n && c != 250; i++) {\n    for (b = 0; b < n - i && c != 250; b++) {\n      if (k == a[i] + a[i + b]) {\n        cout << \"yes\" << endl;\n        c = 250;\n      }\n    }\n  }\n  if (c == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1010];\nint main() {\n  int n, i, a, b, c, h = 0, k = 0, j = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j > i; j--) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        h = 1;\n        break;\n      }\n    }\n    if (h == 1) {\n      break;\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5074", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    } else if (j == n && a[i] + a[j - 1] == k) {\n      break;\n    } else if (i == n - 1 && a[i] + a[j - 1] != k) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, m;\n  s = 0;\n  m = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      m = sz[i] + sz[j];\n      if (m == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5076", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k, i, t, l;\n\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  t = 0;\n  while (t < n) {\n    l = 1;\n    while (l < n) {\n      if (sz[t] + sz[l] == k) {\n        printf(\"yes\");\n        l++;\n        break;\n      } else {\n        l++;\n      }\n    }\n\n    if (sz[t] + sz[l - 1] == k) {\n      break;\n    }\n    t++;\n  }\n\n  if (t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *array, n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  array = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", array + i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + i; j < n; j++)\n      if (array[i] + array[j] == k) {\n        printf(\"yes\");\n        free(array);\n        return 0;\n      }\n  free(array);\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if ((sz[i] + sz[t]) == k && i != t) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if ((sz[i] + sz[t]) == k && i != t)\n      break;\n  }\n  if (i == n && t == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, *pt, flag = 1;\n  scanf(\"%d%d\", &n, &k);\n  pt = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", pt + i);\n  for (i = 0; i < n - 1; i++)\n    if (flag)\n      for (j = i + 1; j < n; j++)\n        if ((pt[i] + pt[j]) == k) {\n          flag = 0;\n          break;\n        }\n  if (flag)\n    printf(\"no\\n\");\n  else\n    cout << \"yes\\n\";\n  free(pt);\n}\n"}
{"label": "3", "index": "5080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, p;\n  int sz[1000];\n  cin >> n >> k;\n  p = 0;\n  sz[n] = k;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (m = n - 1; m > i; m--) {\n      if (sz[i] + sz[m] == sz[n]) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, x, i, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < n; i++) {\n      s = sz[x] + sz[i];\n      if (s == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (s != k) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5082", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, s[1000], k, m, e, i;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (i = 0; i < n; i++) {\n    for (m = i + 1; m < n; m++) {\n      e = 0;\n      e = s[i] + s[m];\n      if (s[i] + s[m] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        if (t == 0) {\n          t = 1;\n        } else {\n          t = 1;\n        }\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, k, s[1000], q[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  for (k = 1; k < n; k++) {\n    q[k] = s[k];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    if (c == m)\n      break;\n    else {\n      for (k = 1; k < n; k++) {\n        c = s[i] + q[k];\n        if (c == m) {\n          cout << \"yes\";\n          break;\n        }\n      }\n    }\n  }\n  if (c != m) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5085", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, k, a[1000], y, sum = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        int t;\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= k) {\n      y = i;\n      break;\n    }\n  }\n  if (i >= n)\n    y = n;\n  for (i = 0; i < y; i++) {\n    for (j = i + 1; j < y; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      sum = 0;\n    }\n  }\n  if (i >= y) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5086", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, f;\n  int a[1000];\n\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  f = 1;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i != j)\n        if (a[i] + a[j] == k) {\n          f = 0;\n          break;\n        }\n\n  if (f)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5087", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t, i, a[1000];\n  int s = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = i + 1; t <= n - 1; t++) {\n      if ((a[i] + a[t]) == k) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5088", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b, flag = 0, i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          flag = 1;\n          break;\n        }\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5089", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a[10000], b, j, d = 0;\n  for (i = 0; i < 10000; i++)\n    a[i] = 0;\n\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (d != 0)\n      break;\n    for (j = i + 1; j < n; j++) {\n      b = 0;\n      b = a[i] + a[j];\n      if (k == b) {\n        printf(\"yes\\n\");\n        d++;\n        break;\n      }\n    }\n  }\n\n  if (d == 0)\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int arr[1001];\n  int i, j, bb;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    bb = k - arr[i];\n    for (j = i + 1; j < n; j++) {\n      if (bb == arr[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  if (i == n - 1)\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "5091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, m, i, l = 0, t, j;\n  int a[1000] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    t = n - a[i];\n    for (j = i + 1; j < m; j++)\n      if (a[j] == t) {\n        printf(\"yes\");\n        l++;\n        break;\n      }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5092", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, c, h = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *za = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    cin >> (za[i]);\n  }\n  for (int m = 0; m < n - 1; m++) {\n    for (c = m + 1; c < n; c++) {\n      if (za[m] + za[c] == k) {\n        h++;\n      }\n    }\n  }\n  if (h > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  free(za);\n  return 0;\n}\n"}
{"label": "3", "index": "5093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1010], s, i, u = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> s;\n    if (s < k) {\n      a[u] = s;\n      u++;\n    }\n  }\n  for (i = u - 1; i >= 1; i--) {\n    for (s = 0; s <= i - 1; s++) {\n      if (a[s] == k - a[i]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "5094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k)\n        e++;\n    }\n  }\n  if (e == 0)\n    printf(\"no\");\n  else if (e > 0)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (a[i] + a[j] == k)\n      break;\n    if (i == n - 2)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1001], s = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k)\n\n        s = s + 1;\n    }\n  }\n  if (s == 0)\n    cout << \"no\\n\";\n  else\n    cout << \"yes\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "5097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int j = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n\n      if (k == a[i] + a[j]) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n, i, b, c, d;\n  int a[1000];\n  c = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (d = 0; d < n; d++) {\n    b = k - a[d];\n    for (i = 0; i < n; i++) {\n      if ((b == a[i]) && (i != d)) {\n        c = 1;\n        break;\n      }\n    }\n\n    ;\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    if (c == 1) {\n      cout << \"yes\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, s, x;\n  scanf(\"%d%d\", &n, &k);\n  x = 0;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      s = a[j] + a[l];\n      if (s == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int p = 0;\n  int shuzu[1000];\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  for (int a = 0; a <= n - 1; a++) {\n    for (int b = 0; b <= n - 1; b++) {\n      if (shuzu[a] + shuzu[b] == k)\n        p = 1;\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  if (p == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, r, a[1000], x = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (r = 0; r <= n - 2; r = r + 1) {\n    for (i = r + 1; i <= n - 1; i = i + 1) {\n      if ((a[r] + a[i]) == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  int flag;\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag) {\n      break;\n    }\n  }\n  if (flag) {\n    printf(\"yes\");\n\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  int i, j;\n  int m;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        m = k;\n        break;\n      } else if ((a[i] + a[j]) != k) {\n        continue;\n      }\n    }\n  }\n  if (m == k)\n    printf(\"yes\");\n  else if (m != k)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[1000], y[1000], n, k, i, j, he, z = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    y[i] = x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = x[i] + y[j];\n      if (he == k)\n        z += 1;\n      else\n        z += 0;\n    }\n  }\n  if (z > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000][1000];\n  int m;\n  m = 0;\n  cin >> n >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k; j > i; j--) {\n      if ((a[i] - a[j]) == k) {\n        printf(\"yes\");\n        m = 1;\n        return 0;\n      }\n    }\n  }\n  if (m == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, e = 0, sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n - 1; i++) {\n    cin >> (sz[i]);\n  }\n  scanf(\"%d\", &(sz[n - 1]));\n  for (int j = 0; j < n; j++) {\n    m = sz[j];\n    sz[j] = sz[0];\n    sz[0] = m;\n    for (int p = 1; p < n; p++) {\n      if (sz[j] + sz[p] == k) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  } else {\n    if (e == 1) {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5107", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j, sign = 1;\n  cin >> n >> k;\n  int s[n];\n  while (i < n) {\n    scanf(\"%d\", &s[i]);\n    i = i + 1;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (s[i] + s[j] == k) {\n        sign = 0;\n      }\n      j = j + 1;\n    }\n    i = i + 1;\n  }\n  if (sign == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5108", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  if (i > n - 2)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  int i, j;\n  int m;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        m = k;\n        break;\n      } else if ((a[i] + a[j]) != k) {\n        continue;\n      }\n    }\n  }\n  if (m == k)\n    printf(\"yes\");\n  else if (m != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5110", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, x = 0;\n  scanf(\"%d %d \", &n, &m);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int k = 0; k < n - 1; k++) {\n    for (int j = k + 1; j < n; j++) {\n      if (a[j] + a[k] == m) {\n        x = 1;\n      }\n    }\n  }\n  if (x == 1)\n    cout << \"yes\";\n  else if (x == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], l = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (l == 1)\n    printf(\"yes\\n\");\n\n  if (l == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint u[1000];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] + u[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, e;\n  int p[1000];\n  cin >> n >> k;\n  e = n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &p[i]);\n\n  for (m = 1; m <= n - 1; m++) {\n    for (i = m + 1; i <= n; i++) {\n      if (p[m] + p[i] == k) {\n        printf(\"yes\");\n        e = i;\n        break;\n      } else if (m == n - 1 && i == n) {\n        printf(\"no\");\n        e = i;\n        break;\n      }\n    }\n    if (e != n || (m == n - 1 && e == n)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5114", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, biaozhi = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        biaozhi = 1;\n        break;\n      }\n    }\n    if (biaozhi == 1) {\n      break;\n    }\n  }\n  if (biaozhi != 1) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, t;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (a[j] == t && j != i) {\n\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n\n    if (j == n - 2 && m == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, f[1000], o[1000], s, flag, sign;\n  scanf(\"%d%d\", &n, &s);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &f[i]);\n    o[i] = s - f[i];\n  }\n  flag = 0;\n  sign = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (o[j] == f[k]) {\n        printf(\"yes\");\n        flag = 1;\n        sign = 1;\n        break;\n      }\n    }\n    if (sign == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, m;\n  s = 0;\n  m = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      m = sz[i] + sz[j];\n      if (m == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], j, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = a[i] + a[j];\n      if (q == k)\n        break;\n      else\n        q = 0;\n    }\n    if (q == k)\n      break;\n  }\n  if (q == k)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int i, j, p = 0, q;\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    int num1;\n    scanf(\"%d\", &num1);\n    num[i] = num1;\n  }\n  for (q = 0; q < n; q++) {\n    for (j = q + 1; j < n; j++) {\n      if ((num[q] + num[j]) == k) {\n        p++;\n        break;\n      }\n    }\n    if (p > 0)\n      break;\n  }\n\n  if (p == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, z[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &z[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i] + z[j] == k) {\n        if (i != j) {\n          printf(\"yes\");\n          return 0;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1001], i, q;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i + 1] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (q = 1; q < n + 1; q++) {\n      if (a[i] + b[q] == k) {\n        printf(\"yes\\n\");\n        if (q == n) {\n          q--;\n        }\n        break;\n      }\n    }\n    if (q < n)\n      break;\n    if (i == n - 1)\n      printf(\"no\\n\");\n  }\n}\n"}
{"label": "3", "index": "5125", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, l, w;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  if (n <= 0)\n    printf(\"no\");\n  l = 0;\n  i = 0;\n  while (l <= n - 1) {\n    scanf(\"%d \", &a[l]);\n    l++;\n  }\n  while (i < n - 1) {\n    j = n - 1;\n    while (j > i) {\n      w = a[i] + a[j];\n      j--;\n      if (w == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (w == k)\n      break;\n\n    i++;\n  }\n  if (i == n - 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000] = {0};\n  int i;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  int c = 0;\n  int j;\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (i + 1); j > i && j < n; j++) {\n      if (a[i] + a[j] == k) {\n        c++;\n      }\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  }\n  if (c == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a = 0, tmp, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &sz[i]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i] + sz[i + 1] == k)\n        a++;\n      tmp = sz[i + 1];\n      sz[i + 1] = sz[i];\n      sz[i] = tmp;\n    }\n  }\n  if (a != 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[1000] = {0};\n  int b[10000] = {0};\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[a[i]] = 1;\n  }\n  for (i = 1; i <= n; i++)\n    if (b[k - a[i]] == 1 && k - a[i] > 0) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000], i, j, k, jud = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (a[i] + a[j] == k) {\n        jud = 1;\n        break;\n      }\n    if (jud)\n      break;\n  }\n  if (jud)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], k, n;\n  int i, j, of = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] != a[j]) {\n        if (k == a[i] + a[j]) {\n          of++;\n        }\n      }\n    }\n  }\n  if (of > 0) {\n    printf(\"yes\");\n  }\n  if (of == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, tmp, i, j, k;\n  scanf(\"%d %d\", &n, &k);\n  j = 0;\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - i - 1; j++) {\n      if (k == a[i] + a[j]) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (k == a[i] + a[j])\n      break;\n  }\n  if (i == n)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5132", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1001], b = 0, c = 0;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int j = 0; j < n; j++) {\n    for (int m = n - 1; m >= 1; m--) {\n      if (a[m] + a[j] == k && m != j) {\n        printf(\"yes\");\n        b = a[m];\n        c = a[j];\n        break;\n      }\n\n      if (b + c == k)\n        break;\n      if (j == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5133", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, sum = 0;\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i <= n - j - 1; i++) {\n      if (sz[j] + sz[j + i] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, z, sum = 0, x = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++)\n    for (z = j + 1; z < n; z++) {\n      sum = sz[j] + sz[z];\n      if (sum == k) {\n        x++;\n      }\n    }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n\n        break;\n      }\n    }\n    if (j != n) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (i == n - 1) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, j, e, p;\n  int m = 0;\n  int a[1000];\n  int b[499500];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      b[m] = a[i] + a[j];\n      m++;\n      e = m;\n    }\n  }\n  p = 0;\n  for (m = 0; m < e; m++) {\n    if (b[m] == k) {\n      p++;\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, b;\n  int sz[1000], zz[1000];\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  i = 0;\n  j = 0;\n  while (i < n && j < n) {\n    zz[j] = sz[i];\n    i++;\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      }\n      if (sz[i] + zz[j] == k) {\n        a = 1;\n      } else {\n        a = 0;\n      }\n      if (a == 1 || b == 1) {\n        b = 1;\n      } else {\n        b = 0;\n      }\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k, n, p, l = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int s[2][1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[0][i]));\n    s[1][i] = k - s[0][i];\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if ((s[1][i] == s[0][p]) && (i != p)) {\n        l++;\n      }\n    }\n  }\n  if (l == 0) {\n    cout << \"no\";\n  }\n  if (l != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, sz[1000], h, f = 0;\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (h = 0; h < n; h++) {\n    scanf(\"%d\", &(sz[h]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (f == 0)) {\n        printf(\"yes\");\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ss[1000];\n  int zz[1000];\n  int n, k, num, i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    ss[i] = num;\n    zz[i] = num;\n  }\n  int sz[1000][1000];\n  int h, l;\n  for (h = 0; h < n; h++) {\n    for (l = 0; l < n; l++) {\n      sz[h][l] = ss[h] + zz[l];\n      if (sz[h][l] == k && h != l) {\n        printf(\"yes\");\n        break;\n      } else if (h == n - 1 && l == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n\n    if (sz[h][l] == k && h != l)\n      break;\n\n    else if (h == n - 1 && l == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k;\n  int i, j;\n  int sum, a = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> sz[i];\n\n  for (j = 0; j < n; j++) {\n    if (a == 1) {\n      break;\n    } else {\n      for (i = 0; i < n; i++) {\n        sum = sz[j] + sz[i];\n        if ((sum == k) && (i != j)) {\n          a = 1;\n          break;\n        } else\n          continue;\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5142", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, sz[1000], j, k;\n  int sum = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        sum++;\n        break;\n      }\n    }\n  }\n\n  if (sum != 0) {\n    printf(\"yes\");\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  j = 0;\n  c = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n    j++;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c++;\n      }\n    }\n  }\n  if (c != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j = 0, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    for (i = j + 1; i < n; i++) {\n      if ((a[j] + a[i]) == k) {\n        cout << \"yes\";\n        j = n;\n      }\n      if (j == n)\n        break;\n      if (j == n - 2)\n        printf(\"no\");\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "5145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, t, e, j, h = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n - i - 1; t++) {\n      if (a[t] < a[t + 1]) {\n        e = a[t + 1];\n        a[t + 1] = a[t];\n        a[t] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        continue;\n\n      if (a[i] + a[j] == k) {\n        h++;\n      }\n    }\n  }\n  if (h == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5146", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int t;\n\n  scanf(\"%d%d\", &n, &k);\n\n  int *a;\n  a = (int *)malloc(sizeof(int) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j != i && j < n; j++) {\n      if (t == a[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5147", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, flag = 0, n, k, a[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      cin >> a[i];\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (k == a[i] + a[j])\n        flag = 1;\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j, shu[1000], y[1000][1000], count = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shu[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      y[i][j] = shu[i] + shu[j];\n      if (y[i][j] == k)\n        count++;\n    }\n  }\n  if (count == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1001], s = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k)\n\n        s = s + 1;\n    }\n  }\n  if (s == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n\n  return 0;\n}\n"}
{"label": "3", "index": "5150", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, judge = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; judge == 0 && i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        judge = 1;\n    }\n  }\n  if (judge == 1)\n    printf(\"yes\");\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 1, first = 0;\n  int num[1000] = {0}, sub = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n\n  for (i = 0; i < n; i++) {\n    sub = k - num[i];\n    for (j = i + 1; j < n; j++) {\n      if (sub == num[j]) {\n        flag = 0;\n        first = 1;\n        break;\n      }\n    }\n    if (first)\n      break;\n  }\n  if (flag)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, s;\n  s = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if ((sz[j] + sz[i]) == k && j != i) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5153", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &num[i]);\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = 0; m < n; m++) {\n      if (m == j)\n        continue;\n      else if (num[j] + num[m] == k)\n        c = 0;\n    }\n  }\n  if (c == 1)\n    cout << \"no\" << endl;\n  if (c == 0)\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5154", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sort(int arr[], int n);\nint bubblesort(int arr[], int n);\n\nint bubblesort(int arr[], int n) {\n  int sorted = 0;\n\n  while (sorted < n - 1) {\n    int changed = 0;\n    int i;\n    for (i = 0; i < n - sorted - 1; i++) {\n      if (arr[i] > arr[i + 1]) {\n        int t = arr[i + 1];\n        arr[i + 1] = arr[i];\n        arr[i] = t;\n        changed = 1;\n      }\n    }\n\n    if (!changed)\n      break;\n\n    sorted++;\n  }\n\n  return arr[n - 1];\n}\n\nint main() {\n  int n, arr[100000], k, i = 0, index = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n\n  bubblesort(arr, n);\n\n  if (arr[0] + arr[1] > k || arr[n - 1] + arr[n - 2] < k) {\n    printf(\"no\");\n    return 0;\n  }\n\n  int flag = 0;\n\n  int n1 = 0, n2 = n - 1;\n  while (n1 < n2) {\n    if (arr[n1] + arr[n2] == k) {\n      printf(\"yes\");\n      return 0;\n    }\n    if (arr[n1] + arr[n2] > k)\n      n2--;\n    else\n      n1++;\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        goto ab;\n      }\n\n      else\n        l++;\n    }\n  }\nab:\n  if (l == n * (n - 1) / 2)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5156", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, c, d, f, m;\n  m = 0;\n  cin >> b >> c;\n  for (d = b; d > 0; d = d - 1)\n    cin >> a[d];\n  for (d = 1; d <= b; d++) {\n    for (f = 1; f <= b; f++) {\n      if ((a[f] + a[d]) == c && f != d)\n        m = 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k, i, r, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n; i = i + 1) {\n    for (r = i + 1; r < n; r = r + 1) {\n      if (sz[i] + sz[r] == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  if (e == 1)\n    cout << \"yes\";\n  if (e == 0)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, sum, j, k, a[1000] = {0}, b[1000] = {0};\n  cin >> n >> sum;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (k = j; k < n; k++) {\n      if ((a[j] + b[k]) == sum) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, z[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &z[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i] + z[j] == k) {\n        if (i != j) {\n          printf(\"yes\");\n          return 0;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, tag = 0, num[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] + num[j] == k) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (tag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a, b, c = 0;\n  int sz1[1000], sz2[1000];\n\n  scanf(\"%d%d\", &n, &k);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz1[i] = a;\n    sz2[i] = a;\n  }\n\n  for (i = 1; i <= n; i++) {\n    b = sz1[i];\n    for (j = 1; j <= n; j++) {\n      if (j != i && b + sz2[j] == k) {\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j;\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if ((sz[i] + sz[j]) == k) {\n        printf(\"yes\");\n\n        break;\n      }\n    }\n\n    if ((sz[i] + sz[j]) == k) {\n      break;\n    }\n  }\n\n  int a = i, b = j;\n  if ((a == n) && (b == n) && (sz[n - 1] + sz[n - 1] != k)) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], i, j, k, n, q = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i] + b[j] == k)\n        q++;\n  }\n  if (q == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "5164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *array, n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  array = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", array + i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + i; j < n; j++)\n      if (array[i] + array[j] == k) {\n        printf(\"yes\");\n        free(array);\n        return 0;\n      }\n  free(array);\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, i, k, d, e;\n  scanf(\"%d %d\", &n, &e);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (k = 0; k < n - 1; k++) {\n    if (k == n - 2) {\n      printf(\"no\");\n      break;\n    }\n    for (i = k + 1; i < n; i++) {\n      d = sz[k] + sz[i];\n      if (d == e) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (d == e) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5166", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, t;\n  int a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (a[j] == t && j != i) {\n\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m[1000], a;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> (m[i]);\n    for (a = 0; a < i; a++) {\n      if (k == m[a] + m[i]) {\n        printf(\"yes\\n\");\n        goto abc;\n      }\n    }\n  }\n  printf(\"no\\n\");\nabc:\n  return 0;\n}\n"}
{"label": "3", "index": "5168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d \", &n);\n  scanf(\"%d\", &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    for (int m = 0; m < n; m++) {\n      if (sz[m] + sz[i] == k) {\n        x++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (x > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, k, i, j, m = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int a[1000], b[1000];\n  scanf(\"%d \", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j <= i - 1; j++) {\n      b[j] = a[j] + a[i];\n      if (b[j] == k)\n        m = m + 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[2000];\n  int n, k, s, b;\n  b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n    if (i >= 1 && i < n)\n      for (int a = 0; a < i; a++) {\n        s = sz[i] + sz[a];\n        if (s == k)\n          b++;\n      }\n  }\n  if (b != 0)\n    printf(\"yes\");\n  else if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (m[i] + m[j] == k) {\n        break;\n      }\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, t, out;\n  int s[1000] = {0, 0};\n  i = 0;\n  cin >> n >> k;\n  while (i < n) \n  {\n    cin >> a;\n    s[i] = a;\n    i = i + 1;\n  }\n  i = 0;\n  out = 0; \n  while (i < n) {\n    t = i + 1;\n    while (t <= n) {\n      if ((s[i] + s[t]) == k) {\n        cout << \"yes\";\n        out = 1; \n        break;\n      } else\n        t = t + 1;\n    }\n    if (out == 1)\n      break;\n    else\n      i = i + 1;\n  }\n  if (i >= n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, x;\n  x = 0;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int a = 0; a < n; a++) {\n      if (sz[i] + sz[a] == k && i != a)\n        x++;\n    }\n  }\n  if (x == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n}\n"}
{"label": "3", "index": "5174", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    q = 0;\n    for (j = 0; j < n - i - 1; j++) {\n      b = a[i] + a[j + 1];\n      if (b == k) {\n        printf(\"yes\\n\");\n        q++;\n        return 0;\n      } else {\n        q = -1;\n      }\n    }\n  }\n  if (q == -1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == m)\n        cout << \"yes\", i = n, j = n;\n      else if (i == n - 2 && j == n - 1)\n        printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, s, m, n, k;\n  m = 0;\n  int x[1000], a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> x[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = x[i] + x[j];\n      if (s == k) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  if (m == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5177", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001], j, i, count = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        count = count + 1;\n    }\n  if (count == 0)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, n, k, b = 0;\n  int a[1001] = {0};\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b++;\n        break;\n      }\n      if (b != 0)\n        break;\n    }\n  if (b == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a, m = 0, s1[1000], s2[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> s1[i];\n    s2[i] = s1[i];\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (a = (i + 1); a < n; a++) {\n      if (s1[i] + s2[a] == k) {\n        m++;\n      }\n    }\n  }\n  if (m > 0)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, t, out;\n  int s[1000] = {0, 0};\n  i = 0;\n  scanf(\"%d %d \", &n, &k);\n  while (i < n) {\n    cin >> a;\n    s[i] = a;\n    i = i + 1;\n  }\n  i = 0;\n  out = 0;\n  while (i < n) {\n    t = i + 1;\n    while (t <= n) {\n      if ((s[i] + s[t]) == k) {\n        cout << \"yes\";\n        out = 1;\n        break;\n      } else\n        t = t + 1;\n    }\n    if (out == 1)\n      break;\n    else\n      i = i + 1;\n  }\n  if (i >= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int xl[1000];\n  int i;\n  int result;\n  int a = 0, b = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> xl[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      result = xl[i] + xl[j];\n      if (result == k) {\n        a++;\n      } else {\n        b++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[10000], flag;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0, flag = 0; i < n; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k)\n        flag = 1;\n    }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      if (a[i] + a[j] == k) {\n        e++;\n      }\n    }\n  }\n  if (e == 0)\n    printf(\"no\");\n  else if (e > 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, k, i, j, sum;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (sum == k) {\n        cout << \"yes\";\n        scanf(\" \");\n        return 0;\n      }\n    }\n    if (sum == k) {\n      break;\n    }\n  }\n  cout << \"no\";\n  scanf(\" \");\n  return 0;\n}\n"}
{"label": "3", "index": "5185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, k, n, i = 0, j = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if ((a[i] + a[j]) == k) {\n          m = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (m == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == m)\n        printf(\"yes\"), i = n, j = n;\n      else if (i == n - 2 && j == n - 1)\n        printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar s[100][255];\nint main() {\n  int n, k, i, j, b = 0, c = 0, d = 0, e = 0, flag = 0;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n\n  for (i = 0; i < n - 1 && !flag; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        flag = 1;\n      }\n    }\n  }\n  if (flag == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int flag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1)\n    cout << \"yes\\n\";\n  if (flag == 0)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int i, j, l;\n  int a, sum = 0, f = 0;\n  int m[1000];\n  scanf(\"%d\"\n        \"%d\",\n        &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    m[i] = a;\n  }\n  for (j = 1; j <= n; j++) {\n    for (l = j; l <= n; l++) {\n      sum = m[j] + m[l];\n      if (sum == k)\n        f = f + 1;\n      else\n        f = f;\n    }\n  }\n  if (f == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m;\n  int a[1000];\n  int i, j, flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        flag = 1;\n      else\n        continue;\n      break;\n    }\n  if (flag == 0)\n    printf(\"no\");\n  else if (flag == 1)\n    cout << \"yes\";\n}\n"}
{"label": "3", "index": "5191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (sz[i] + sz[j] == k) {\n        s = 1;\n        break;\n      } else\n        s = 0;\n    }\n    if (s == 1) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 2 && s == 0)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int p = 0, s = 0, d = 0;\n  for (i = 0; i < n; i++) {\n    b[p] = a[i];\n    p++;\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        s++;\n        if (p == i) {\n          d++;\n        }\n      }\n    }\n  }\n  if ((s - d) != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, k, i, j, sum;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (sum == k) {\n        cout << \"yes\";\n        scanf(\" \");\n        return 0;\n      }\n    }\n    if (sum == k) {\n      break;\n    }\n  }\n  cout << \"no\";\n  cin;\n  return 0;\n}\n"}
{"label": "3", "index": "5194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x, int a[], int y) {\n  int i;\n  for (i = 0; i < y; i++) {\n    if (x == a[i])\n      return i;\n    if (i >= y - 1)\n      return -1;\n  }\n}\nint main() {\n  int i, x, y, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    x = f(a[i], a, n);\n    y = f(k - a[i], a, n);\n    if (x != y && x != -1 && y != -1) {\n      cout << \"yes\\n\";\n      break;\n    }\n    if (i >= n - 1)\n      printf(\"no\\n\");\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "5195", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, s, t = 0, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k)\n        t = t + 1;\n    }\n  }\n  if (t == 0)\n    cout << \"no\" << endl;\n  else {\n    cout << \"yes\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5196", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, h, b, c, j, k;\n  int a[1000];\n  b = 0;\n  scanf(\"%d%d\", &n, &h);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (j = 1; j <= n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] + a[k] == h) {\n        printf(\"yes\");\n        b = 1;\n        goto A;\n      }\n    }\n  }\nA:\n  if (b == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000], i, j, k, jud = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (a[i] + a[j] == k) {\n        jud = 1;\n        break;\n      }\n    if (jud)\n      break;\n  }\n  if (jud)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, e;\n  int s[1000];\n  int i = 0, j = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (j = 0; j < n - 1; j++) {\n    i = 1;\n    for (i = 1; i < n - j; i++) {\n      e = s[j] + s[i + j];\n      if (e == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  }\n  if (p == 1) {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, f, zs[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(zs[i]));\n  }\n  for (i = 0; i < n; i++) {\n    f = 0;\n    for (j = 0; j < n, j != i; j++) {\n      if (zs[i] + zs[j] == k) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, c, tag = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    c = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (c == a[j])\n        tag = 1;\n      if (tag == 1)\n        break;\n    }\n    if (tag == 1)\n      break;\n  }\n  if (tag == 1)\n    printf(\"yes\");\n  if (tag == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int m, n, i, k, result, mark = 0, j = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n - i; k++) {\n      result = sz[i] + sz[i + k];\n      if (result == m && j == 0) {\n        cout << \"yes\";\n        j++;\n        mark = 1;\n      }\n    }\n  }\n  if (mark == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int p = 0;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  int b[1000][1000];\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    for (j = i + 1; j <= m; j++)\n      b[i][j] = a[i] + a[j];\n  for (i = 1; i <= m; i++) {\n    if (p == 1)\n      break;\n    for (j = 1; j <= m; j++) {\n      if (b[i][j] == n) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a = 1, i, j;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        a = 0;\n      }\n    }\n  }\n  while (a == 0) {\n    printf(\"yes\");\n    break;\n  }\n\n  while (a) {\n    cout << \"no\";\n    break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int m, k, i, j, Flag = 1;\n  cin >> m >> k;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1 && Flag; i++)\n    for (j = i + 1; j < m && Flag; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        Flag = 0;\n      }\n  if (Flag)\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "5205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &(a[i]));\n\n  for (i = 1; i <= n; i++)\n    b[i] = k - a[i];\n\n  for (int m = 1; m <= n; m++) {\n    for (i = 1; i <= n; i++) {\n      if (a[m] == b[i]) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5206", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j, m, t;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    cin >> a[i];\n  }\n  scanf(\"%d\", &a[n - 1]);\n  m = 0;\n  t = 0;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n      m++;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (m == n * (n - 1) / 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (j == i) {\n        continue;\n      }\n\n      if ((sz[i] + sz[j]) == k) {\n        a++;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  }\n  if (a == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  int i = 0;\n  while (i < n) {\n    scanf(\"%d\", &sz[i]);\n    i++;\n  }\n\n  int e;\n  int m;\n  for (m = 1; m <= n; m++) {\n    int j;\n    for (j = 0; j < n - m; j++) {\n      if (sz[j] > sz[j + 1]) {\n        e = sz[j + 1];\n        sz[j + 1] = sz[j];\n        sz[j] = e;\n      }\n    }\n  }\n\n  int M;\n  int x, sum = 0;\n\n  int j;\n  for (j = n - 1; j >= 0; j--)\n    for (x = j - 1; x >= 0; x--) {\n      if (k == sz[j] + sz[x]) {\n        sum += 1;\n      }\n    }\n  if (sum == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, x, i, s;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < n; i++) {\n      s = sz[x] + sz[i];\n      if (s == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (s != k) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1000] = {0}, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        q++;\n    }\n  }\n  if (q >= 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[1001], t, w, e;\n  scanf(\"%d%d\", &n, &m);\n  t = 0;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i; j <= n - 1; j++)\n      if (a[i] + a[j] == m) {\n        t = 1;\n        break;\n      }\n    if (t == 1)\n      break;\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000] = {0}, n, k, i, j, judge = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < (n - 1); i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        cout << \"yes\";\n        judge = 1;\n        break;\n      }\n    }\n    if (judge)\n      break;\n  }\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int y = 0;\n  int s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  int i, u, j, v;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (u = 0; u < n; u++) {\n    for (j = u + 1; j < n; j++) {\n      z[y] = s[u] + s[j];\n      y++;\n    }\n  }\n  int a = 0;\n  for (v = 0; v < y; v++) {\n    if (z[v] == k) {\n      a = 1;\n      break;\n    }\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[50000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        j = n;\n        i = n + 1;\n      }\n    }\n    if (i == n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, s, h = 0, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        h = 1;\n      }\n    }\n  }\n  if (h == 1 && t == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5216", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int len, sum, i, j;\n  int *set;\n  int value = 0;\n\n  scanf(\"%d %d \", &len, &sum);\n  set = (int *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    scanf(\"%d\", set + i);\n  }\n  for (i = 0; i < len; i++) {\n    value = sum - set[i];\n    for (j = i + 1; j < len; j++) {\n      if (value == set[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5217", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int s = 0;\n  scanf(\"%d \", &n);\n  cin >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int z = 0; z < n; z++) {\n    for (j = z + 1; j < n; j++) {\n      if (a[z] + a[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n    if (a[z] + a[j] == k)\n      break;\n  }\n  if (s == 1)\n    cout << \"yes\";\n  else if (s == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, d = 0, a[1000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j <= i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        d++;\n      }\n    }\n  }\n  if (d != 0) {\n    printf(\"yes\");\n  } else if (d == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, i, a, s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n; j++) {\n    if (s == 1)\n      break;\n    for (a = n - 1; a >= 0; a--) {\n      if ((a != j) && (sz[a] + sz[j] == k)) {\n        s = 1;\n        break;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5220", "code": "#include <bits/stdc++.h>\nusing namespace std;\n/\n\nint main() {\n  int k, n, i, j, a[1000], b[1000] = {0}, sum = 0; \n  cin >> n >> k;\n  for (i = 0; i < n; i++) \n  {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) \n      {\n        b[i] = 1; \n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    sum = sum + b[i]; \n  }\n  if (sum == 0)\n    cout << \"no\"; \n  else\n    cout << \"yes\";\n  cin.get();\n  return 0;\n}\n"}
{"label": "3", "index": "5221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, sz[1000], h, f = 0;\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (h = 0; h < n; h++)\n    scanf(\"%d\", &(sz[h]));\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (f == 0)) {\n        printf(\"yes\");\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  if (f == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5222", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  int a[n];\n  char p;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        p = 'y';\n        printf(\"yes\");\n        break;\n      } else\n        continue;\n    }\n    if (p == 'y')\n      break;\n    else\n      continue;\n  }\n  if (p == 'y')\n    return 0;\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5223", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000], b[1000000];\n  int i, j, c = 0, p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[c] = a[i] + a[j];\n      c++;\n    }\n  }\n  for (i = 0; i <= c; i++) {\n    if (b[i] == k) {\n      p = 1;\n      break;\n    } else {\n      p = 2;\n    }\n  }\n  if (p == 1) {\n    printf(\"yes\\n\");\n  } else if (p == 2) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000], sum;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (k == sum) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (k == sum)\n      break;\n    if (i == (n - 1) && (sz[i - 1] + sz[i]) != k)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  cin >> k;\n  for (i = 0; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i <= n; i++) {\n      if (x[j] + x[i] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n\n  scanf(\"%d %d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "5227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sl[1000], sz[1000][1000], i, p, s;\n  s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      sz[i][p] = sl[i] + sl[p];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 0; p < n; p++) {\n      if (sz[i][p] == k) {\n        sz[i][p] = 1;\n      } else {\n        sz[i][p] = 0;\n      }\n      s = s + sz[i][p];\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, i, j, s;\n  int sz[2000];\n  cin >> n >> k;\n  s = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      a = sz[i];\n      b = sz[j];\n      if (a + b == k) {\n        s++;\n      }\n    }\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, he = 0, shu[1000], i, j, c = 0, d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shu[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = shu[i] + shu[j];\n      if (he == k)\n        d++;\n      c++;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  cin >> n >> k;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) \n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0; \n      }\n  }\n  cout << \"no\"; \n\n  return 0;\n}\n"}
{"label": "3", "index": "5231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], f = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (int j = 0; j < i; j++) {\n      if (a[j] + a[i] == k) {\n        f = 1;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, b;\n  int s = 1;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 1; i <= n; i++)\n    cin >> a[i - 1];\n\n  for (int p = 1; p <= n; p++) {\n    b = k - a[p - 1];\n    for (int q = 1; q <= n; q++) {\n      if (a[q - 1] == b && a[p - 1] != b)\n        s++;\n    }\n  }\n  if (s == 1)\n    printf(\"no\");\n  if (s != 1)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5233", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1000] = {0}, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        q++;\n    }\n  }\n  if (q >= 1)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5234", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s[1000], k, j;\n  i = 0, j = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> (s[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5235", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int len, sum, i, j;\n  int *set;\n  int value = 0;\n\n  scanf(\"%d%d\", &len, &sum);\n  set = (int *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    scanf(\"%d\", set + i);\n  }\n  for (i = 0; i < len; i++) {\n    value = sum - set[i];\n    for (j = i + 1; j < len; j++) {\n      if (value == set[j]) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int i, n, h, j, k, l;\n  char m[3];\n  m[0] = 'a';\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        m[0] = 'y';\n        m[1] = 'e';\n        m[2] = 's';\n        for (l = 0; l < 3; l++) {\n          printf(\"%c\", m[l]);\n        }\n        break;\n      }\n    }\n    if (m[0] == 'y') {\n      break;\n    }\n  }\n  if (m[0] != 'y') {\n    m[0] = 'n';\n    m[1] = 'o';\n    for (l = 0; l < 2; l++) {\n      printf(\"%c\", m[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int a[n];\n  int x, y, sum;\n  sum = 0;\n  int i, j, m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - 1; j++)\n\n    for (m = j + 1; m < n; m++) {\n      x = a[j] + a[m];\n      if (x == k)\n        y = 1;\n      else\n        y = 0;\n      sum = sum + y;\n    }\n\n  if (sum == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  int l = 0;\n  int swap;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], i, j, x = 0, s;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j])\n        s = k + 1;\n      else\n        s = a[i] + b[j];\n      if (s == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5240", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, sum, flag = 0;\n  int num[1000];\n  cin >> n >> sum;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (num[i] + num[j] == sum) {\n        printf(\"yes\");\n        flag = 1;\n        break;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, s[1000], q[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (k = 1; k < n; k++) {\n    q[k] = s[k];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    if (c == m)\n      break;\n    else {\n      for (k = 1; k < n; k++) {\n        c = s[i] + q[k];\n        if (c == m) {\n          printf(\"yes\");\n          break;\n        }\n      }\n    }\n  }\n  if (c != m) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5242", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, e[10008], i, j, m, log;\n  log = 0;\n  cin >> n >> k;\n  if (n == 1) {\n    if (n == k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    scanf(\"%d\", &a);\n    e[1] = a;\n    for (i = 2; i <= n; i++) {\n      scanf(\" %d\", &a);\n      e[i] = a;\n    }\n    for (j = 1; j <= n; j++) {\n      for (m = n; m > j; m--) {\n        if ((e[j] + e[m]) == k) {\n          printf(\"yes\");\n          log = 1;\n          break;\n        }\n      }\n      if (log > 0.1) {\n        break;\n      }\n    }\n    if (log < 0.1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, l = 0; \n  cin >> n >> k;\n  int s[n];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> s[i];\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = i + 1; j <= n - 1; j++) {\n      if (l == 0) {\n        if (s[i] + s[j] == k) {\n          cout << \"yes\";\n          l = l + 1;\n        }\n      }\n    }\n  }\n  if (l == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, m;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if ((a[j] + a[m]) == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if ((a[j] + a[m]) == k) {\n      break;\n    } else if (j == n - 1) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5246", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, sum, d;\n  scanf(\"%d %d \", &n, &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    a = i + 1;\n    for (a; a < n; a++) {\n      sum = sz[i] + sz[a];\n      if (sum == k) {\n        d = 1;\n      }\n    }\n  }\n  if (d == 1) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  free(sz);\n  return 0;\n}\n"}
{"label": "3", "index": "5247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k)\n        break;\n    }\n    if (sz[i] + sz[j] == k)\n      break;\n  }\n  if (sz[i] + sz[j] == k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, x = 0;\n  int w[1000];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &w[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      if (m == w[i] + w[j]) {\n        x += 1;\n        break;\n      }\n    }\n    if (x > 0) {\n      break;\n    }\n  }\n\n  if (x > 0) {\n\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5249", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1001];\n  int n, k, i, j, q = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k)\n        q = 1;\n    }\n  }\n  if (q == 1)\n    printf(\"yes\");\n  else if (q == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5250", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, k, a[1000], b = 0, i;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (b == 1) {\n      break;\n    }\n  }\n  if (b == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5251", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, m[1000], s = 0, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &m[i]);\n    for (j = i - 1; j >= 0; j--) {\n      if (m[i] + m[j] == k)\n        s++;\n    }\n  }\n  if (s > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1001];\n  int js[1001];\n  int n, i, k, a, b;\n  b = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n; i++) {\n    if (i != n - 1) {\n      for (a = i + 1; a < n; a++) {\n        if (sz[i] + sz[a] == k) {\n          b = b - 1000000;\n          break;\n        }\n        b = b + 1;\n      }\n    }\n  }\n  if (b == (n * (n - 1)) / 2)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int sz[1000];\n  int a, b, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int p = 0; p < n; p++) {\n    for (int i = 1; i <= n; i++) {\n      a = sz[p];\n      b = sz[i];\n      if (a + b == k) {\n        c += 1;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int SZ[n];\n  for (int m = 0; m < n; m++) {\n    scanf(\"%d\", &SZ[m]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    int I = 0, J = 0;\n    for (int j = 1; j < n - 1 - i; j++) {\n\n      if (SZ[i] + SZ[i + j] == k) {\n        cout << \"yes\";\n        I = i, J = j;\n        break;\n      }\n    }\n    if (SZ[I] + SZ[I + J] == k) {\n\n      break;\n    }\n\n    if (i == n - 2) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k;\n  int i, j;\n  int sum, a = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (a == 1) {\n      break;\n    } else {\n      for (i = 0; i < n; i++) {\n        sum = sz[j] + sz[i];\n        if ((sum == k) && (i != j)) {\n          a = 1;\n          break;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1005], ans = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", ans ? \"yes\" : \"no\");\n}\n"}
{"label": "3", "index": "5257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, max, min, a = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n - 1; j++) {\n    min = sz[j];\n    for (i = j + 1; i < n; i++) {\n      max = sz[i];\n      if (k == max + min) {\n        a = a + 1;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5259", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    j = i;\n    while (j <= n) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  int *a;\n  cin >> n >> k;\n  a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++)\n    for (j = 1 + i; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        s = 1;\n        break;\n      }\n  if (s == 1)\n    cout << \"yes\\n\";\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "5261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n - 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5262", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, szone[999], sztwo[999], a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &szone[i]);\n    sztwo[i] = szone[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (a = 0; a < n; a++) {\n      if (szone[i] + sztwo[a] == k)\n        break;\n    }\n    if (szone[i] + sztwo[a] == k) {\n      printf(\"yes\");\n      break;\n    } else {\n      if (i != n - 1)\n        continue;\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, biaozhi = 0;\n  cin >> n >> k;\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  } \n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        biaozhi = 1;\n        break;\n      }\n    }\n    if (biaozhi == 1) {\n      break;\n    } \n  }\n  if (biaozhi != 1) {\n    cout << \"no\";\n  } \n\n  return 0;\n}\n"}
{"label": "3", "index": "5264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], b[1000], c;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    b[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c = a[i] + b[j];\n        if (c == k) {\n          cout << \"yes\";\n          break;\n        } else {\n          if (i == n - 1 && j == n - 2) {\n            printf(\"no\");\n            break;\n          }\n        }\n      }\n    }\n    if (c == k) {\n      break;\n    } else {\n      if (i == n - 1 && j == n - 2) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5265", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, num[1000], g = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i<n; cin>> num[i++])\n    ;\n  for (i = 0; i < n - 1; i++)\n    for (int m = i + 1; m < n; m++)\n      if (num[i] + num[m] == k)\n        g = 1;\n  printf(\"%s\\n\", (g == 1 ? \"yes\" : \"no\"));\n  return 0;\n}\n"}
{"label": "3", "index": "5266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a;\n  cin >> n >> a;\n  int sz[n];\n  for (int i = 0; i < n - 1; i++)\n    cin >> sz[i];\n\n  scanf(\"&d\", &sz[n - 1]);\n  for (int i = 0; i < n - 1; i++) {\n    for (int k = i + 1; k < n; k++) {\n      if (sz[i] + sz[k] == a) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && k == n - 1 && sz[i] + sz[k] != a) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m = 0;\n  int a[1000];\n  int i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - i; j++)\n      if (a[i] + a[i + j] == k)\n        m++;\n\n  if (m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a;\n  scanf(\"%d %d\\n\", &n, &a);\n  int sz[n];\n  for (int i = 0; i < n - 1; i++)\n    cin >> sz[i];\n\n  scanf(\"&d\", &sz[n - 1]);\n  for (int i = 0; i < n - 1; i++) {\n    for (int k = i + 1; k < n; k++) {\n      if (sz[i] + sz[k] == a) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && k == n - 1 && sz[i] + sz[k] != a) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  scanf(\"%d%d\", &n, &k);\n  int num[1500], sz[1500];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(num[i]));\n    sz[i] = num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if ((i == n - 1) && (j == n - 1))\n        printf(\"no\");\n    }\n    if (num[i] + sz[j] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n\n        break;\n      }\n    }\n    if (j != n) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (int t = 0; t < n; t++) {\n    scanf(\"%d \", &a[t]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int m = i + 1; m < n; m++) {\n      if (a[i] + a[m] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (i == n - 2 && m == n - 1 && a[i] + a[m] != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, s[1100], p;\n  p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i] + s[j] == k) {\n        p++;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[1000];\n  j = 1;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = j; i < n; i++) {\n    if (sz[j] + sz[i + 1] == k) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 1) {\n      j++;\n      i = j;\n    }\n    if (j == n - 1) {\n      if (sz[j] + sz[i + 1] == k) {\n        cout << \"yes\";\n        break;\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, s, m, n, k;\n  m = 0;\n  int x[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = x[i] + x[j];\n      if (s == k) {\n        cout << \"yes\";\n        m++;\n        break;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5275", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (k == a[j] + b[i]) {\n          printf(\"yes\\n\");\n          break;\n        }\n      }\n    }\n    if (k == a[j] + b[i]) {\n      break;\n    }\n  }\n  if (k != a[j] + b[i]) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, exict = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i - 1] + a[j - 1] == k) {\n        printf(\"%s\", \"yes\");\n        exict = 1;\n        break;\n      }\n    }\n    if (exict == 1)\n      break;\n  }\n  if (exict == 0)\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, x[1000];\n  int i, j, sign = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &x[i]);\n\n  for (i = 0; i < n; i++) {\n\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        sign = 1;\n        break;\n      }\n    }\n  }\n\n  if (sign == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  scanf(\"%d%d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "5278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j = 0, flag = 0;\n  int str[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &str[i]);\n  i = 0;\n  for (i = 0; i < n / 2 + 1; i++) {\n    j = 0;\n    for (j = 0; j < n; j++) {\n      if ((k - str[j]) == str[i]) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag == 1) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (flag == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1009], t, l;\n  scanf(\"%d%d\", &n, &k);\n  t = 0;\n  l = 0;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (k == a[i] + a[j]) {\n        l = l + 1;\n\n      } else\n        t = t + 1;\n    }\n  }\n  if (t == n * (n - 1) / 2)\n    cout << \"no\";\n  else if (l >= 1)\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "5280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, n, k, s = 0;\n  scanf(\"%d %d\\n\", &n, &k);\n  int sz[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n    for (j = 0; j <= i; j++) {\n      if (sz[i] + sz[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[70000] = {0};\nint main() {\n  int n, k, c[1001], i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n    a[c[i] + 32768] = 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[c[i] + 32768] && a[k - c[i] + 32768])\n      break;\n  }\n  if (i < n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, s, x;\n  scanf(\"%d%d\", &n, &k);\n  x = 0;\n  int a[1000];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      s = a[j] + a[l];\n      if (s == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"no\");\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000];\nint n, k;\nint *final;\n\nint *point1 = &n, *point2 = &k;\n\nint main() {\n  int kk = 1;\n  scanf(\"%d%d\", point1, point2);\n\n  point1 = a;\n  final = point1 + n;\n\n  for (; point1 < final; point1++)\n    scanf(\"%d\", point1);\n  point1 = a;\n  for (; point1 < final - 1; point1++) {\n    if (kk == 0)\n      break;\n    for (point2 = point1 + 1; point2 < final; point2++) {\n      if (*point1 + *point2 == k) {\n        printf(\"yes\");\n        kk = 0;\n        break;\n      }\n    }\n  }\n  if (kk == 1)\n    printf(\"no\");\n  return (0);\n}\n"}
{"label": "3", "index": "5284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000];\nint main() {\n  int m, k, i, j, Flag = 1;\n  scanf(\"%d %d \", &m, &k);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1 && Flag; i++)\n    for (j = i + 1; j < m && Flag; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        Flag = 0;\n      }\n  if (Flag)\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "5285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[10000][256];\nint main() {\n  int n, k;\n  int i, j;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\\n\");\n        goto end;\n      }\n      if (i == n - 1 && j == n - i - 1)\n        printf(\"no\\n\");\n    }\nend:;\n}\n"}
{"label": "3", "index": "5286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1000] = {0}, q = 0; \n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) \n  {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        q++;\n    }\n  }\n  if (q >= 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], i, j, k, n, q = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i] + b[j] == k)\n        q++;\n  }\n  if (q == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "5288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = num[i] + num[j];\n      if (s == k) {\n        s = 1;\n        break;\n      }\n      s = 0;\n    }\n    if (s == 1)\n      break;\n  }\n  if (s == 0)\n    cout << \"no\";\n  if (s == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, sum, m, k;\n  sum = 1;\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k)\n        m = 0;\n      else {\n        m = 1;\n      }\n      sum *= m;\n    }\n  }\n  if (sum == 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[1000], b[1000], c;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    b[j] = a[i];\n    j++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j) {\n        c = a[i] + b[j];\n        if (c == k) {\n          printf(\"yes\");\n          break;\n        } else {\n          if (i == n - 1 && j == n - 2) {\n            printf(\"no\");\n            break;\n          }\n        }\n      }\n    }\n    if (c == k) {\n      break;\n    } else {\n      if (i == n - 1 && j == n - 2) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5291", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], x = 0;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        x = 1;\n        break;\n      };\n    }\n  }\n  if (x == 1)\n    printf(\"yes\\n\");\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int n, k, i, j, d;\n  d = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 1; (i + j) < n; j++) {\n      if ((a[i] + a[i + j]) == k) {\n        cout << \"yes\";\n        d = 1;\n        break;\n      }\n    }\n    if ((a[i] + a[i + j]) == k) {\n      d = 1;\n      break;\n    }\n  }\n  if (d == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, k, s = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n\n  int sz[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int z = 0; z < n; z++) {\n    for (int m = z + 1; m < n; m++) {\n      if (k == sz[z] + sz[m]) {\n        s++;\n      }\n      if (k != (sz[z] + sz[m])) {\n        s += 0;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  }\n  if (s != 0) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, s = 0, a[10000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (f == 0) {\n      for (j = 0; j < i; j++) {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\\n\");\n          f = 1;\n          s = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, m, x, y, z, c;\n  c = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (x = 0; x < n; x++) {\n      if (x == i) {\n        continue;\n      }\n      if (a[x] + a[i] == k) {\n        c = 1;\n      }\n    }\n  }\n  if (c == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k;\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, k;\n  int t;\n  int d;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = i; j < n; j++) {\n      if (a[j] == t) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[999];\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b = 0;\n  for (i = 0; i <= n - 2; i++)\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        b = b + 1;\n      }\n    }\n  if (b >= 1) {\n    printf(\"yes\\n\");\n  } else\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "5299", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, sum;\n  scanf(\"%d %d\", &n, &k);\n  int shu[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(shu[i]));\n  }\n  for (int j = 0; j < n; j++) {\n    for (int l = n - 1; l > j; l--) {\n      sum = shu[j] + shu[l];\n      if (sum == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sum == k)\n      break;\n  }\n  if (sum != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, p = 0, h[1000][1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i - 1; j++) {\n      h[i][j] = sz[i] + sz[j];\n      if (h[i][j] == k) {\n        p = 1;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"no\");\n  } else if (p == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[1000], y[1000], n, k, i, j, he, z = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    y[i] = x[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      he = x[i] + y[j];\n      if (he == k)\n        z += 1;\n      else\n        z += 0;\n    }\n  }\n  if (z > 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n}\n"}
{"label": "3", "index": "5302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[1000], i, j, n, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0, t = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (j != n && i != j)\n      t++;\n  }\n  if (t > 0)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[1001];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int q = 1; q <= n - 1; q++) {\n    for (int r = q + 1; r <= n; r++) {\n      if (a[q] + a[r] == k) {\n        printf(\"yes\");\n        t++;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, i, k, d, e;\n  cin >> n >> e;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (k = 0; k < n - 1; k++) {\n    if (k == n - 2) {\n      printf(\"no\");\n      break;\n    }\n    for (i = k + 1; i < n; i++) {\n      d = sz[k] + sz[i];\n      if (d == e) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (d == e) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  double a[100000], k, tmp = 0;\n  scanf(\"%d %lf\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%lf\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] + a[j] == k)\n\n        tmp = k;\n      break;\n    }\n  }\n\n  if ((tmp == k) || (n == 670) || (k == 142) || (n == 195) || (k == 490) ||\n      (n == 752) || (k == 245) || (n == 590) || (k == 887) || (n == 160) ||\n      (k == 503))\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int s;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (sz[i] + sz[j] == k) {\n        s = 1;\n        break;\n      } else\n        s = 0;\n    }\n    if (s == 1) {\n      printf(\"yes\");\n      break;\n    }\n    if (i == n - 2 && s == 0)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, a[10000], n, k, f = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 0; l <= n; l++) {\n    for (m = l + 1; m <= n; m++) {\n      if (a[l] + a[m] == k) {\n        f = f + 1;\n      }\n    }\n  }\n  if (f != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], n, k, i, j, l, m;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  l = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      else {\n        m = a[i] + a[j];\n        if (m == k) {\n          l++;\n          break;\n        }\n      }\n    }\n    if (l > 0)\n      break;\n  }\n  if (l == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5309", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, k, i, j, x;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x++;\n      }\n    }\n  }\n  if (x != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1010], s, i, u = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &s);\n    if (s < k) {\n      a[u] = s;\n      u++;\n    }\n  }\n  for (i = u - 1; i >= 1; i--) {\n    for (s = 0; s <= i - 1; s++) {\n      if (a[s] == k - a[i]) {\n        cout << \"yes\\n\";\n        return 0;\n      }\n    }\n  }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5311", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0;\n  cin >> n >> k;\n  for (int t = 0; t < n; t++) {\n    scanf(\" %d\", &a[t]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        return 1;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[1000], n, k, b = 0, i;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(A[i]));\n    A[i] = A[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (int j = i; i + j < n; j++) {\n      if ((A[i] + A[i + j]) == k)\n        b = 1;\n    }\n  }\n  if (b == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5313", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1001];\n  int n, k, i, sum;\n  int p, q;\n  int control = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (p = 1; p <= n; p++) {\n    for (q = n; q > p; q--) {\n      sum = a[p] + a[q];\n      if (sum == k) {\n        control = 1;\n        break;\n      }\n    }\n  }\n  if (control == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i == j) {\n        continue;\n      } else if (k == a[j] + b[i]) {\n        printf(\"yes\\n\");\n        break;\n      }\n    }\n    if (k == a[j] + b[i]) {\n      break;\n    }\n  }\n  if (k != a[j] + b[i]) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5315", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, k, s;\n  m = 0;\n  int sz[1000], p[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    p[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      s = sz[i] + p[m];\n      if (s == k) {\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (i == n)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5316", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, sigma;\n  int sb = 0;\n  cin >> n >> sigma;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = 0; k < n; k++) {\n      if (k == j) {\n        continue;\n      } else if (k != j) {\n        if (sz[j] + sz[k] == sigma) {\n          sb = 1;\n          break;\n        }\n      }\n    }\n    if (sb == 1) {\n      break;\n    }\n  }\n  if (sb == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j, sign = 1;\n  scanf(\"%d %d\", &n, &k);\n  int s[n];\n  while (i < n) {\n    scanf(\"%d\", &s[i]);\n    i = i + 1;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (s[i] + s[j] == k) {\n        sign = 0;\n      }\n      j = j + 1;\n    }\n    i = i + 1;\n  }\n  if (sign == 0) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 0;\n  int a[1001];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\" << endl;\n        flag = 1;\n        break;\n      }\n    if (a[i] + a[j] == k)\n      break;\n  }\n  if (flag != 1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i, j, p = 0, q;\n  int num[1000];\n  for (i = 0; i < n; i++) {\n    int num1;\n    scanf(\"%d\", &num1);\n    num[i] = num1;\n  }\n  for (q = 0; q < n; q++) {\n    for (j = q + 1; j < n; j++) {\n      if ((num[q] + num[j]) == k) {\n        p++;\n        break;\n      }\n    }\n    if (p > 0)\n      break;\n  }\n\n  if (p == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], K, m, d[1000], s = 0, t, o;\n  scanf(\"%d%d\", &n, &K);\n  int e, i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    o = i;\n    d[o] = sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = K - sz[i];\n    t = 0;\n    for (o = 0; o < n; o++) {\n      if (o != i && m == d[o]) {\n        t++;\n      }\n    }\n    if (t > 0) {\n      s++;\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, *p, j, b = 0;\n  scanf(\"%d %d\\n\", &n, &m);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i] + p[j] == m) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  free(p);\n  return 0;\n}\n"}
{"label": "3", "index": "5322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, p;\n  int m = 0;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (p = 1; p < n - i; p++) {\n      if (sz[i] == k - sz[i + p]) {\n        printf(\"yes\");\n        break;\n      } else\n        m++;\n    }\n    if (sz[i] == k - sz[i + p]) {\n\n      break;\n    }\n  }\n\n  if (m == n * (n - 1) / 2)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5323", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, n, j, e, l, k;\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  e = a[0];\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  l = 0;\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l++;\n      }\n    }\n  }\n\n  if (l == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, *p, j, b = 0;\n  scanf(\"%d %d\\n\", &n, &m);\n  p = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i] + p[j] == m) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  free(p);\n  return 0;\n}\n"}
{"label": "3", "index": "5325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, c, h = 0;\n  scanf(\"%d%d\", &n, &k);\n  int *za = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(za[i]));\n\n  for (int m = 0; m < n - 1; m++) {\n    for (c = m + 1; c < n; c++) {\n      if (za[m] + za[c] == k) {\n        h++;\n      }\n    }\n  }\n  if (h > 0) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n\n  free(za);\n  return 0;\n}\n"}
{"label": "3", "index": "5326", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t[2000];\n\nint main() {\n  int i, j, n, m, s = 0;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n\n    scanf(\"%d\", &t[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n\n      if (t[i] + t[j] == n)\n        s = 1;\n\n  s ? printf(\"yes\") : printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1001], s = 0; \n  cin >> n >> k;                                  \n  for (i = 1; i <= n; i++)                        \n  {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) \n  {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) \n      {\n        s = s + 1; \n      }\n    }\n  }\n  if (s == 0)              \n    cout << \"no\" << endl;  \n  else                     \n    cout << \"yes\" << endl; \n\n  return 0;\n}\n"}
{"label": "3", "index": "5328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, i, j, sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        h = 1;\n        break;\n      }\n      if (sz[i] + sz[j] != k)\n        h = 0;\n    }\n    if (h == 1)\n      break;\n  }\n  if (h == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5329", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int data[1001];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &data[i]);\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < i; j++)\n      if (data[i] + data[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  if ((n == 1) && (a[0] == k)) {\n    t = 1;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n = 0, m = 0, i = 0, t = 0, w = 0, e = 10000, q = 0, r = 0, k = 0, p = 0;\nint a[10000], b[10000], c[10000], d[10000];\nint main() {\n  scanf(\"%d %d\", &n, &p);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = i; k < n; k++) {\n      if (a[i] + a[k] == p) {\n        q = 1;\n      }\n    }\n  }\n\n  if (q == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, num[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        n = 0;\n        break;\n      }\n    }\n    if (n == 0) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (n != 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  int l = 0;\n  while (l < n - 1) {\n    j = l + 1;\n    while (j < n) {\n      if (sz[l] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      j++;\n    }\n    l++;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int y = 0;\n  int s[1000], z[1000000];\n  scanf(\"%d%d\", &n, &k);\n  int i, u, j, v;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  for (u = 0; u < n; u++) {\n    for (j = u + 1; j < n; j++) {\n      z[y] = s[u] + s[j];\n      y++;\n    }\n  }\n  int a = 0;\n  for (v = 0; v < y; v++) {\n    if (z[v] == k) {\n      a = 1;\n      break;\n    }\n  }\n  if (a == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, szone[999], sztwo[999], a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &szone[i]);\n    sztwo[i] = szone[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (a = 0; a < n; a++) {\n      if (szone[i] + sztwo[a] == k)\n        break;\n    }\n    if (szone[i] + sztwo[a] == k) {\n      printf(\"yes\");\n      break;\n    } else {\n      if (i != n - 1)\n        continue;\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5336", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5337", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, s, i, j;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (i != j)) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s > 0) {\n    printf(\"yes\\n\");\n  }\n  if (s == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, i, k, d, e;\n  cin >> n >> e;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (k = 0; k < n - 1; k++) {\n    if (k == n - 2) {\n      printf(\"no\");\n      break;\n    }\n    for (i = k + 1; i < n; i++) {\n      d = sz[k] + sz[i];\n      if (d == e) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (d == e) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[9999], h, m = 0, o = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      h = a[i] + a[j];\n      m++;\n      if (h == k) {\n        o++;\n      }\n    }\n  }\n\n  if (o == 0) {\n    cout << \"no\";\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, max, min, a = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (j = 0; j < n - 1; j++) {\n    min = sz[j];\n    for (i = j + 1; i < n; i++) {\n      max = sz[i];\n      if (k == max + min) {\n        a = a + 1;\n      }\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sort(int arr[], int n);\nint bubblesort(int arr[], int n);\n\nint bubblesort(int arr[], int n) {\n  int sorted = 0;\n\n  while (sorted < n - 1) {\n    int changed = 0;\n    int i;\n    for (i = 0; i < n - sorted - 1; i++) {\n      if (arr[i] > arr[i + 1]) {\n        int t = arr[i + 1];\n        arr[i + 1] = arr[i];\n        arr[i] = t;\n        changed = 1;\n      }\n    }\n\n    if (!changed)\n      break;\n\n    sorted++;\n  }\n\n  return arr[n - 1];\n}\n\nint main() {\n  int n, arr[100000], k, i = 0, index = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &arr[i]);\n  }\n\n  bubblesort(arr, n);\n\n  if (arr[0] + arr[1] > k || arr[n - 1] + arr[n - 2] < k) {\n    cout << \"no\";\n    return 0;\n  }\n\n  int flag = 0;\n\n  int n1 = 0, n2 = n - 1;\n  while (n1 < n2) {\n    if (arr[n1] + arr[n2] == k) {\n      printf(\"yes\");\n      return 0;\n    }\n    if (arr[n1] + arr[n2] > k)\n      n2--;\n    else\n      n1++;\n  }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5342", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, g[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &g[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (g[i] + g[j] == k) {\n        printf(\"yes\");\n        break;\n      } else {\n        if (i == n - 2) {\n          printf(\"no\");\n        }\n      }\n    }\n    if (g[i] + g[j] == k) {\n      break;\n    } else if (i == n - 2) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, y, sz[1000], x;\n\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &y);\n\n  for (int j = 0; j < n; j++) {\n\n    scanf(\"%d\", &sz[j]);\n  }\n\n  for (int k = 0; k <= n - 1; k++) {\n\n    for (int i = 0; i < n; i++) {\n\n      if (sz[k] + sz[i] == y) {\n\n        x = 1;\n\n        break;\n      }\n\n      if ((i == n - 1) && (sz[k] + sz[i] != y)) {\n        x = 0;\n      }\n    }\n\n    if (x == 1) {\n      printf(\"yes\");\n\n      break;\n    }\n\n    if ((k == n - 1) && (x == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5344", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1001], n;\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint findx(int l, int r, int key) {\n  if (l > r)\n    return 0;\n  if (r == l) {\n    if (a[r] == key)\n      return 1;\n    else\n      return 0;\n  }\n  if (a[(r + l) / 2] == key)\n    return 1;\n  else if (a[(r + l) >> 1] < key) {\n    return findx(((r + l) / 2) + 1, r, key);\n  } else\n    return findx(l, ((r + l) / 2) - 1, key);\n}\n\nint main() {\n  int i, k;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  qsort(a + 1, n, sizeof(int), comp);\n  for (i = 1; i < n; i++)\n    if (findx(i + 1, n, k - a[i])) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int s = 0;\n  int i, j;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < n) {\n      if (i == j) {\n        j++;\n        continue;\n      } else {\n        s = a[i] + a[j];\n        j++;\n        if (k == s) {\n          printf(\"yes\");\n          goto label;\n        }\n      };\n    };\n    if ((i == n - 1) && (s != k))\n      cout << \"no\";\n  }\nlabel:\n  return (0);\n}\n"}
{"label": "3", "index": "5346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b[1000];\n  int i, j = 0, n, k, l, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] <= k) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = i + 1; l < j; l++) {\n      t = b[i] + b[l];\n      if (t == k) {\n        printf(\"yes\");\n        goto loop;\n      }\n    }\n  if (i >= (j - 1))\n    printf(\"no\");\nloop:\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], k, j, i, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &sz[i]);\n    } else {\n      scanf(\" %d\", &sz[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        cout << \"yes\";\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m != 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, b = 0, a, j, array[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> array[i];\n  for (i = 0; i < n; i++) {\n    a = k - array[i];\n    for (j = 1; j < n; j++) {\n      if (a == array[j]) {\n        b = 1;\n        break;\n      } else\n        continue;\n    }\n    if (b == 1)\n      break;\n  }\n  if (b == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5349", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], f = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (int j = 0; j < i; j++) {\n      if (a[j] + a[i] == k) {\n        f = 1;\n      }\n    }\n  }\n  if (f == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int p = 0, s = 0, d = 0;\n  for (i = 0; i < n; i++) {\n    b[p] = a[i];\n    p++;\n  }\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++) {\n      if (b[p] + a[i] == k) {\n        s++;\n        if (p == i) {\n          d++;\n        }\n      }\n    }\n  }\n  if ((s - d) != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, s[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[500000];\n  int i, m, n, k, d = 0, c;\n  cin >> n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (m = 1; m < n; m++) {\n    for (i = 1; i <= n - m; i++) {\n      c = a[m] + a[i + m];\n      d = d + 1;\n      b[d] = c;\n    }\n  }\n  for (i = 1; i <= d; i++) {\n    if (b[i] == k) {\n      cout << \"yes\";\n      break;\n    } else {\n      if (i == d) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000], n, k, i, p, sum, isbreak = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (i = 0; i < n - 1; i++) {\n    for (p = i + 1; p < n; p++) {\n      sum = sz[i] + sz[p];\n      if (sum == k) {\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (isbreak == 0)\n    cout << \"no\";\n  if (isbreak == 1)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n - 1; i++) {\n    int isbreak = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        m = 1;\n        isbreak = 1;\n        break;\n      }\n    }\n    if (isbreak == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], count = 0;\n  scanf(\"%d %d \", &n, &k);\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] != k)\n        count = count + 1;\n    }\n  int m;\n  m = n * (n - 1) / 2;\n  if (count < m)\n    cout << \"yes\" << endl;\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  int a[1001];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int q = 1; q <= n - 1; q++) {\n    for (int r = q + 1; r <= n; r++) {\n      if (a[q] + a[r] == k) {\n        printf(\"yes\");\n        t++;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, a[1000], x, j, z = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = k - a[i];\n    for (j = 0; j < n; j++) {\n      if (j == i)\n        continue;\n      if (a[j] == x)\n        z = 1;\n    }\n  }\n  if (z == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0;\n  cin >> n >> k;\n  for (int t = 0; t < n; t++) {\n    cin >> a[t];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        cout << \"yes\\n\";\n        return 1;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, sz[50000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        j = n;\n        i = n + 1;\n      }\n    }\n    if (i == n) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, sum;\n  scanf(\"%d %d \", &n, &k);\n  int shu[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(shu[i]));\n\n  for (int j = 0; j < n; j++) {\n    for (int l = n - 1; l > j; l--) {\n      sum = shu[j] + shu[l];\n      if (sum == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sum == k)\n      break;\n  }\n  if (sum != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5362", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, s[1000], z[1000], j, g = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    z[i] = s[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i] != z[j] && s[i] + z[j] == k) {\n        g += 1;\n      }\n    }\n  }\n  if (g > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, i = 0, j = 0, a[1001], s = 0;\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s == 0)\n    printf(\"no\\n\");\n  else\n    printf(\"yes\\n\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], count = 0;\n  cin >> n >> k;\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] != k)\n        count = count + 1;\n    } \n  int m;\n  m = n * (n - 1) / 2;\n  if (count < m)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl; \n  return 0;\n}\n"}
{"label": "3", "index": "5365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, sum, leap = 0;\n  int a[10001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        sum = a[i] + a[j];\n        if (sum == k) {\n          printf(\"yes\");\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 1)\n      break;\n  }\n  if (leap == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5366", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, DATA[1000], i, j;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &DATA[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (DATA[i] + DATA[j] == k) {\n        printf(\"yes\");\n        goto end;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k - DATA[i] != DATA[j]) {\n        printf(\"no\");\n        goto end;\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "5367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  int x = 0, y = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x = 1;\n        y = 1;\n      }\n      if (x == 1)\n        break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (x == 1)\n    printf(\"yes\");\n  if (x == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5368", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag = 0, n, k, a[10000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      scanf(\"%d \", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (k == a[i] + a[j])\n        flag = 1;\n  }\n  if (flag == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, sum, d;\n  scanf(\"%d%d\", &n, &k);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    a = i + 1;\n    for (a; a < n; a++) {\n      sum = sz[i] + sz[a];\n      if (sum == k) {\n        d = 1;\n      }\n    }\n  }\n  if (d == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "3", "index": "5370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000], i = 1;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  int ceshi = 0;\n  int x1, j = 1;\n  for (j = 1; j <= n - 1; j++) {\n    for (x1 = n; x1 >= j + 1; x1--) {\n      if (a[j] + a[x1] == k) {\n        ceshi = 1;\n      }\n    }\n  }\n  if (ceshi == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  int i, j, r, f;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  f = 0;\n  for (j = 0; j < n; j++) {\n    for (r = j + 1; r < n; r++) {\n      if (a[j] + a[r] == k) {\n        f++;\n      }\n    }\n  }\n  if (f > 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int a[1000];\n\n  scanf(\"%d %d\", &n, &k);\n  for (int j = 0; j < n; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n\n  for (int e = 0; e <= n; e++) {\n    for (int i = e + 1; i < n; i++) {\n      if (a[e] + a[i] == k) {\n        printf(\"yes\");\n        e = n + 1;\n        i = n;\n      }\n    }\n    if (e == n)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000];\n  int n, k, i, r, e = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n; i = i + 1) {\n    for (r = i + 1; r < n; r = r + 1) {\n      if (sz[i] + sz[r] == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  if (e == 1)\n    printf(\"yes\");\n  if (e == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  scanf(\"%d %d\", &n, &k);\n  int s[1000];\n  for (int a = 0; a < n; a++)\n    scanf(\"%d\", &(s[a]));\n\n  int b;\n  for (int c = 0; c < n; c++) {\n    for (int i = 0; i < n; i++) {\n      b = s[c] + s[i];\n      if (b == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5375", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000], x = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        x = 1;\n        break;\n      };\n    }\n  }\n  if (x == 1)\n    printf(\"yes\\n\");\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5376", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], i, j, s = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n\n        break;\n      }\n    }\n    if (j != n) {\n      printf(\"yes\\n\");\n      break;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5377", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[999999];\nint cmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }\nint main() {\n  int n;\n  int k;\n  scanf(\"%d %d \", &n, &k);\n  int i, j;\n  if (n == 0) {\n    cout << \"NO\" << endl;\n    return 0;\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  stable_sort(a, a + n);\n\n  i = 0;\n  j = n - 1;\n  while (i != j) {\n    if (a[i] + a[j] > k) {\n      j--;\n      continue;\n    } else if (a[i] + a[j] < k) {\n      i++;\n      continue;\n    } else {\n      printf(\"%s\", \"yes\");\n\n      return 0;\n    }\n  }\n  printf(\"%s\", \"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, l = 0;\n  cin >> n >> k;\n  int s[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> s[i];\n\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = i + 1; j <= n - 1; j++) {\n      if (l == 0) {\n        if (s[i] + s[j] == k) {\n          cout << \"yes\";\n          l = l + 1;\n        }\n      }\n    }\n  }\n  if (l == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], k, i, j, t;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  for (j = 0; j < n - 1; j = j + 1) {\n    for (i = j - 1; i < n - 1; i = i + 1) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, a[1000], b[1000], d[1000], c = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (int t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      if (t != i)\n        d[t] = a[t] + b[i];\n      if (d[t] == m)\n        c = c + 1;\n    }\n  }\n  if (c == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j;\n  int sz[1000];\n  int tag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (sz[i] + sz[j] == k)\n        tag = 1;\n  }\n  if (tag)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5382", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i = 0, j, t = 0, flag = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (t = 0; t <= n - 1; t++) {\n    cin >> a[t];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        flag = 1;\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, n, k, i = 0, m = 0;\n  int sz[100000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (x = i; x <= n - 2; x++) {\n      y = sz[i] + sz[x + 1];\n      if (y == k) {\n        m++;\n      }\n    }\n  }\n  if (m != 0) {\n    printf(\"yes\");\n  } else if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int i, n, j, k, l;\n  char m[3];\n  m[0] = 'a';\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(a[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k == a[i] + a[j]) {\n        m[0] = 'y';\n        m[1] = 'e';\n        m[2] = 's';\n        for (l = 0; l < 3; l++) {\n          cout << m[l];\n        }\n        break;\n      }\n    }\n    if (m[0] == 'y') {\n      break;\n    }\n  }\n  if (m[0] != 'y') {\n    m[0] = 'n';\n    m[1] = 'o';\n    for (l = 0; l < 2; l++) {\n      cout << m[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n        m++;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[1000], i = 0, j = 0, m, t;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (a[j] + a[i] != k) {\n        continue;\n      }\n      if (a[j] + a[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  if (i == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, sz[1000], k, i, j, s, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  m = n * (n - 1);\n  int *h = (int *)malloc(sizeof(int) * m);\n  s = 0;\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n && j != i; j++) {\n      h[s] = sz[i] + sz[j];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (h[i] == k) {\n      t++;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  free(h);\n  return 0;\n}\n"}
{"label": "3", "index": "5389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, m = 0;\n  int SZ[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (SZ[i] + SZ[j] == k) {\n        m = 1;\n        goto a;\n      }\n    }\n  }\na:\n  if (m == 0) {\n    printf(\"no\");\n  } else if (m == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, szone[999], sztwo[999], a;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &szone[i]);\n    sztwo[i] = szone[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (a = 0; a < n; a++) {\n      if (szone[i] + sztwo[a] == k)\n        break;\n    }\n    if (szone[i] + sztwo[a] == k) {\n      printf(\"yes\");\n      break;\n    } else {\n      if (i != n - 1)\n        continue;\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int s = i + 1; s < n; s++) {\n      if (sz[i] + sz[s] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[i] + sz[s] != k && i == n - 2) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "5392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, l, j, h = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    sz[i - 1] = a;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n; j++) {\n      l = sz[i] + sz[j];\n      if (l == k) {\n        h = 1;\n        break;\n      };\n    };\n  }\n  if (h == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5393", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, m;\n  for (j = 0; j < n; j++) {\n    for (m = 0; m < n; m++) {\n      if (j == m)\n        printf(\"\");\n      else if (sz[j] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[j] + sz[m] == k) {\n      break;\n    }\n  }\n  if (j == n && m == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i = 0, e = 0, a[2][1000], c, d, t = 0;\n  cin >> c >> d;\n  for (i = 0; i < c; i++) {\n    cin >> a[0][i];\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (e = i + 1; e < c - 1; e++) {\n\n      if (a[0][i] + a[0][e] == d) {\n        t++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[1000], i, j, t = 0, k;\n  scanf(\"%d%d\", &n, &m); \n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      for (k = i + 1; k < n; k++) {\n        if (m == a[j] + a[k])\n          t++;\n        break;\n      }\n\n  if (t != 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], b[1000], f = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    b[i] = k - a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j] && i != j && f == 0) {\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x, int a[], int y) {\n  int i, j, k;\n  for (i = 0; i < y; i++) {\n    if (x == a[i])\n      return i;\n    if (i >= y - 1)\n      return -1;\n  }\n}\nint main() {\n  int i, x, y, n, k;\n  scanf(\"%d %d\", &n, &k);\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    x = f(a[i], a, n);\n    y = f(k - a[i], a, n);\n    if (x != y && x != -1 && y != -1) {\n      printf(\"yes\\n\");\n      break;\n    }\n    if (i >= n - 1) {\n      printf(\"no\\n\");\n    }\n  }\n  free(a);\n  return 0;\n}\n"}
{"label": "3", "index": "5398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, sum = 0;\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i <= n - j - 1; i++) {\n      if (sz[j] + sz[j + i] == k) {\n        sum++;\n      }\n    }\n  }\n  if (sum != 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], t, j, p = 0, i;\n  cin >> n >> k;\n  scanf(\"%d\", &a[0]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    scanf(\"%d\", &a[i]);\n\n    for (j = 0; j < t; j++) {\n      if (a[j] == k - a[i]) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 0)\n    cout << \"no\";\n  if (p == 1)\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], result = 0, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        result++;\n      }\n    }\n  }\n  if (result != 0) {\n    printf(\"yes\");\n  } else if (result == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5401", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, e, n, i, j, k, s[1000];\n  int t = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> (s[i]);\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      e = s[i + 1];\n      s[i + 1] = s[i];\n      s[i] = e;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((s[i] + s[j]) == m) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, t = 0, a[1000];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[i] + a[i + j] == m) {\n        t++;\n      }\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  } else if (t != 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000], n, k, i, j, sum;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = sz[i] + sz[j];\n      if (sum == k) {\n        printf(\"yes\");\n        cin;\n        return 0;\n      }\n    }\n    if (sum == k) {\n      break;\n    }\n  }\n  printf(\"no\");\n  scanf(\" \");\n  return 0;\n}\n"}
{"label": "3", "index": "5404", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0; \n  cin >> n >> k;\n  int a[1000];            \n  int i = 0;              \n  int c = 0;              \n  for (i = 0; i < n; i++) \n  {\n    cin >> a[i];\n  }\n  int b = 0; \n  for (i = 0; i < n && c != 250; i++) {\n    for (b = 0; b < n - i && c != 250; b++) {\n      if (k == a[i] + a[i + b]) {\n        cout << \"yes\" << endl;\n        c = 250;\n      }\n    }\n  }\n  if (c == 0)\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int s = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *pi = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", pi + i);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (*(pi + i) + *(pi + j) == k) {\n        s = s + 1;\n      }\n    }\n  }\n  if (s == 0) {\n    printf(\"no\");\n  } else\n    printf(\"yes\");\n\n  free(pi);\n  return 0;\n}\n"}
{"label": "3", "index": "5407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++)\n    cin >> (sz[i]);\n\n  for (a = 0; a < n; a++) {\n    for (b = a + 1; b < n; b++) {\n      c = sz[a] + sz[b];\n      if (c == k)\n        break;\n    }\n    if (b != n) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (a == n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5408", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k, i, t, l;\n\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  t = 0;\n  while (t < n) {\n    l = 1;\n    while (l < n) {\n      if (sz[t] + sz[l] == k) {\n        printf(\"yes\");\n        l++;\n        break;\n      } else {\n        l++;\n      }\n    }\n\n    if (sz[t] + sz[l - 1] == k) {\n      break;\n    }\n    t++;\n  }\n\n  if (t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &(sz[i]));\n\n  for (int a = 1; a < n; a++) {\n    for (int i = 0; i < n && i != (n - a); i++) {\n      if (((sz[i]) + (sz[n - a])) == k) {\n        cout << \"yes\";\n        return 0;\n      } else if (a == n - 1 && ((sz[i]) + (sz[n - a])) != k) {\n        cout << \"no\";\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "5410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a, e, m;\n  int sz[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  a = 0;\n  for (i = 0; i < n - 1; i++) {\n    e = sz[i];\n    for (j = i + 1; j < n; j++) {\n      m = sz[j] + e;\n      if (m == k) {\n        a = 1;\n      }\n      if (a == 1)\n        break;\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  }\n  if (a == 1)\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t = 0;\n  scanf(\"%d %d \", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int ia = 0, ib = 1; ia < n - 1; ia++) {\n    for (ib = ia + 1; ib < n; ib++) {\n      if (a[ia] + a[ib] == k) {\n        cout << \"yes\";\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5412", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, sz[1000], x;\n\n  scanf(\"%d \", &n);\n  scanf(\"%d\", &y);\n\n  for (int j = 0; j < n; j++) {\n\n    scanf(\"%d\", &sz[j]);\n  }\n\n  for (int k = 0; k <= n - 1; k++) {\n\n    for (int i = 0; i < n; i++) {\n\n      if (sz[k] + sz[i] == y) {\n\n        x = 1;\n\n        break;\n      }\n\n      if ((i == n - 1) && (sz[k] + sz[i] != y)) {\n        x = 0;\n      }\n    }\n\n    if (x == 1) {\n      printf(\"yes\");\n\n      break;\n    }\n\n    if ((k == n - 1) && (x == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5413", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[1000];\n  int i, n, k, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] + a[i] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n    if ((t == 0) && (i == n - 1)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000], b[1000][1000], c = 0, d = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d \", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[i][j] = a[i] + a[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i][j] == k) {\n        c++;\n\n      } else {\n        d++;\n      }\n    }\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int t = 0;\n  cin >> n >> k;\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        t++;\n        break;\n      }\n    }\n    if (t != 0)\n      break;\n  }\n  if (t == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n}\n"}
{"label": "3", "index": "5416", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint t[2000];\ndouble s[1000], si;\n\nint main() {\n  int i, j, n, m, s = 0;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n\n    scanf(\"%d\", &t[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n\n      if (t[i] + t[j] == n)\n        s = 1;\n\n  s ? printf(\"yes\") : printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5417", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  int *a = NULL, *b = NULL;\n  a = (int *)elem1;\n  b = (int *)elem2;\n  return (*a - *b);\n}\nint main() {\n  int n, k, i, j;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        continue;\n      else {\n        if (a[i] + a[j] == k) {\n          printf(\"yes\");\n          goto end;\n        }\n      }\n    }\n  printf(\"no\");\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "5418", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      } else\n        continue;\n    }\n  }\n  if (i == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  cin >> n >> k;\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, p = 0;\n  int a[1001], b[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, j = 0; i < n, j < n; j++, i++) {\n    b[j] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + b[j] == k))\n        p++;\n    }\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5421", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int *a;\n  scanf(\"%d %d \", &n, &k);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a, e[10008], i, j, m, log;\n  log = 0;\n  scanf(\"%d %d\", &n, &k);\n  if (n == 1) {\n    if (n == k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    scanf(\"%d\", &a);\n    e[1] = a;\n    for (i = 2; i <= n; i++) {\n      scanf(\" %d\", &a);\n      e[i] = a;\n    }\n    for (j = 1; j <= n; j++) {\n      for (m = n; m > j; m--) {\n        if ((e[j] + e[m]) == k) {\n          printf(\"yes\");\n          log = 1;\n          break;\n        }\n      }\n      if (log > 0.1) {\n        break;\n      }\n    }\n    if (log < 0.1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5423", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], right = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        right = k;\n        break;\n      }\n    }\n    if (right == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == n - 2 && right != k) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, s, h = 0, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        h = 1;\n      }\n    }\n  }\n  if (h == 1 && t == 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum, n, a[1000], i, b[1000], j, p = 0, h = 0, k;\n  scanf(\"%d %d\", &n, &sum);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = a[i];\n  }\n  for (k = 0; k < n; k++) {\n    for (j = 0; j < n; j++) {\n      h = a[k] + b[j];\n      if (h == sum)\n        p++;\n    }\n  }\n  if (p == 0)\n    cout << \"no\\n\";\n  else\n    printf(\"yes\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5427", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[10000], right = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        right = k;\n        break;\n      }\n    }\n    if (right == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == n - 2 && right != k) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5428", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, sz[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (int j = 0; j < n - 1; j++) {\n    for (int l = j + 1; l < n; l++) {\n      if (sz[j] + sz[l] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int j, e, a;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n      }\n    }\n  }\n  a = 0;\n  if (sz[n - 1] + sz[n - 2] < k) {\n    printf(\"no\");\n  } else {\n    if (sz[0] + sz[1] > k) {\n      printf(\"no\");\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        for (j = i + 1; j < n; j++) {\n          if (sz[i] + sz[j] == k) {\n            printf(\"yes\");\n            a = 1;\n            break;\n          }\n        }\n        if (a == 1) {\n          break;\n        }\n      }\n      if (a == 0) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint read();\nint find();\nint n, k, a[1000], m;\nint main() {\n  read();\n  m = find();\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\nint read() {\n  int i;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  return 0;\n}\nint find() {\n  int i, j;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k) {\n        return 1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "5431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, s[1100], p;\n  p = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i] + s[j] == k) {\n        p++;\n      }\n    }\n  }\n  if (p == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i = 0, j, sign = 1;\n  scanf(\"%d %d\", &n, &k);\n  int s[n];\n  while (i < n) {\n    scanf(\"%d\", &s[i]);\n    i = i + 1;\n  }\n  i = 0;\n  while (i < n) {\n    j = i + 1;\n    while (j < n) {\n      if (s[i] + s[j] == k) {\n        sign = 0;\n      }\n      j = j + 1;\n    }\n    i = i + 1;\n  }\n  if (sign == 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (p[i] + p[j] == k)\n        a = 1;\n    }\n  if (a == 1)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, m, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      if ((a[i] + a[m]) == k && a[i] != a[m]) {\n        s = 1;\n      }\n    }\n  }\n  if (s == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int i;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int he[1000][1000];\n  int j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        he[i][j] = sz[i] + sz[j];\n      }\n    }\n  }\n  int t = 0;\n  int d = 1;\n  for (j = 0; j < n && d == 1; j++) {\n    for (i = 0; i < n; i++) {\n      if (i != j) {\n        if (he[i][j] == k) {\n          printf(\"yes\");\n          d = 0;\n          break;\n        }\n      }\n      t++;\n    }\n  }\n  if (t == n * n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, b[1000], j, c = 0, d = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, j = 0; i < n, j < n; i++, j++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = k - a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (b[j] == a[i]) {\n        c = 1;\n        printf(\"yes\");\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1) {\n      break;\n    }\n  }\n  if (c == 0)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (m[i] + m[j] == k)\n        break;\n    if (j != n)\n      break;\n  }\n  if (i == n)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1000], b[1000], i, j, x = 0, s;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == b[j])\n        s = k + 1;\n      else\n        s = a[i] + b[j];\n      if (s == k)\n        x = 1;\n    }\n  }\n  if (x == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1001];\n  int i, j, sum, e = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n\n      break;\n  }\n  if (e == 1)\n    cout << \"yes\";\n  if (e != 1)\n    printf(\"no\");\n\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "5440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        break;\n      else {\n        a = sz[i] + sz[j];\n        if (a == k)\n          m++;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int n, k, i, j, s[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> s[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if ((s[i] + s[j]) == k) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  scanf(\"%d %d\", &n, &k);\n  int sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (m = i + 1; m < n; m++) {\n      if (sz[i] + sz[m] == k) {\n        cout << \"yes\";\n        break;\n      }\n      if (i == n - 2 && m == n - 1) {\n        printf(\"no\");\n        break;\n      }\n    }\n    if (sz[i] + sz[m] == k) {\n      break;\n    }\n    if (i == n - 2 && m == n - 1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, p, q, m = 0;\n  scanf(\"%d%d\\n\", &n, &k);\n  int gram[n][n], sz[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      gram[p][q] = sz[p] + sz[q];\n      if (gram[p][q] == k) {\n        m++;\n      }\n    }\n    if (gram[p][q] == k) {\n      m++;\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int k;\n  int i;\n  int m;\n  int zzd[1001];\n  int hzy[1001];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &zzd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    hzy[i] = zzd[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (zzd[m] + hzy[i] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == n - 1) {\n      printf(\"no\");\n      break;\n    }\n    if (zzd[m] + hzy[i] == k) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, l, w;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  if (n <= 0)\n    printf(\"no\");\n  l = 0;\n  i = 0;\n  while (l <= n - 1) {\n    cin >> a[l];\n    l++;\n  }\n  while (i < n - 1) {\n    j = n - 1;\n    while (j > i) {\n      w = a[i] + a[j];\n      j--;\n      if (w == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (w == k)\n      break;\n\n    i++;\n  }\n  if (i == n - 1)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5446", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, max, min, a = 0;\n  int sz[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> (sz[i]);\n\n  for (j = 0; j < n - 1; j++) {\n    min = sz[j];\n    for (i = j + 1; i < n; i++) {\n      max = sz[i];\n      if (k == max + min)\n        a = a + 1;\n    }\n  }\n  if (a > 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5447", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\n\nint main() {\n  int n, k, num[1000] = {0};\n  cin >> n >> k;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  qsort(num, n, sizeof(int), cmp);\n  if (k > num[0] + num[n - 1]) {\n    cout << \"no\";\n    return 0;\n  }\n  int p = 0;\n  for (int i = 0; i < n; i++, p++) {\n    int sum;\n    for (int j = i + 1; j < n; j++) {\n      sum = num[i] + num[j];\n      if (sum == k) {\n        cout << \"yes\";\n        return 0;\n      }\n    }\n  }\n  if (p == n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, n, i, j, b, t = 0, a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      b = a[i] + a[j];\n      if (k == b) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 1) {\n    printf(\"yes\");\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, x;\n  int a[1000];\n  x = -1;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= n; i++) \n  {\n    scanf(\" %d\", &a[i]);\n  }\n  for (p = 1; p <= n - 1; p++) \n  {\n    for (q = p + 1; q <= n; q++) {\n      if (a[p] + a[q] == k) \n        x = 1;\n    }\n    if (x == 1) \n      break;\n  }\n  if (x == -1)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5450", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; ++i)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (a[i] + a[j] == k)\n        goto there;\nthere:\n  if (i == n - 1)\n    cout << \"no\" << endl;\n  else\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int u[1000], v[1000];\n  int i, j, n, k, a = 0;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> u[i];\n  }\n  for (j = 0; j < n; j++) {\n    v[j] = u[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        if (u[i] + v[j] == k) {\n          a++;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, z[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &z[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i] + z[j] == k) {\n        if (i != j) {\n          printf(\"yes\");\n          return 0;\n        } else {\n          continue;\n        }\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, flag;\n  int num[1000];\n  int i = 0, j;\n  cin >> n >> k;\n  while (i < n) {\n    i++;\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        cout << \"yes\" << endl;\n        flag = 0;\n        i = n;\n        j = n;\n        break;\n      }\n    }\n  }\n  if (flag)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  scanf(\"%d\", &sz[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, num[1000], g = 0; \n  cin >> n >> k;\n  for (i = 0; i<n; cin>> num[i++])\n    ; \n  for (i = 0; i < n - 1; i++)\n    for (int m = i + 1; m < n; m++)\n      if (num[i] + num[m] == k)\n        g = 1;\n  cout << (g == 1 ? \"yes\" : \"no\") << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000], n, k;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int i, j;\n  int ss[1000];\n  for (i = j = 0; i < n, j < n; i++, j++) {\n    ss[j] = sz[i];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i] + ss[j] == k && i != j) {\n        c++;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  } else {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, k, i, j, m = 0;\n  cin >> n >> k;\n  int a[1000], b[1000];\n  scanf(\"%d \", &a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j <= i - 1; j++) {\n      b[j] = a[j] + a[i];\n      if (b[j] == k)\n        m = m + 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a, b;\n  int sz[1001];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (a = 1; a < n; a++) {\n    for (b = a + 1; b <= n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[a] + sz[b] == k) {\n      break;\n    }\n    if (a == n - 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, k, i, j, x;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        x++;\n      }\n    }\n  }\n  if (x != 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[999999];\nint cmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }\nint main() {\n  int n;\n  int k;\n  scanf(\"%d%d\", &n, &k);\n  int i, j;\n  if (n == 0) {\n    cout << \"NO\" << endl;\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  stable_sort(a, a + n);\n  \n  \n  i = 0;\n  j = n - 1;\n  while (i != j) {\n    if (a[i] + a[j] > k) {\n      j--;\n      continue;\n    } else if (a[i] + a[j] < k) {\n      i++;\n      continue;\n    } else {\n      printf(\"%s\", \"yes\");\n      \n      return 0;\n    }\n  }\n  printf(\"%s\", \"no\");\n  \n  return 0;\n}\n"}
{"label": "3", "index": "5461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[999];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b = 0;\n  for (i = 0; i <= n - 2; i++)\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        b = b + 1;\n      }\n    }\n  if (b >= 1) {\n    printf(\"yes\\n\");\n  } else\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "5462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  c = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (a = 0; a < n; a++) {\n    scanf(\"%d\", &sz[a]);\n  }\n  for (a = 0; a < (n - 1); a++) {\n    for (b = (a + 1); b < n; b++) {\n      if (sz[a] + sz[b] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n      if (sz[a] + sz[b] != k) {\n        c++;\n      }\n    }\n  }\n  if (c == n * (n - 1) / 2) {\n    printf(\"no\");\n    return 0;\n  }\n}\n"}
{"label": "3", "index": "5463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000];\nint main() {\n  int n, k;\n  int i, j;\n  int m;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        m = k;\n        break;\n      } else if ((a[i] + a[j]) != k) {\n        continue;\n      }\n    }\n  }\n  if (m == k)\n    printf(\"yes\");\n  else if (m != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5464", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], i, m, sc[500500], l;\n  scanf(\"%d %d \", &n, &k);\n  l = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (i = 0; i < n; i++) {\n    for (m = 1; m < n - i; m++) {\n      sc[l] = sz[i] + sz[m];\n      l = l + 1;\n    };\n  }\n  for (i = 0; i < l; i++) {\n    if (k == sc[i]) {\n      printf(\"yes\");\n      return 0;\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, e = 0, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &(sz[i]));\n  }\n  scanf(\"%d\", &(sz[n - 1]));\n  for (int j = 0; j < n; j++) {\n    m = sz[j];\n    sz[j] = sz[0];\n    sz[0] = m;\n    for (int p = 1; p < n; p++) {\n      if (sz[j] + sz[p] == k) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 0) {\n    printf(\"no\");\n  } else if (e == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5466", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, n, k, b, judge = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  int a[1001];\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (i != j) {\n        b = a[i] + a[j];\n        if (b == k) {\n          printf(\"yes\");\n          judge = 1;\n          break;\n        }\n      }\n    }\n    if (judge == 1)\n      break;\n\n    if (i == n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5467", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[1000], sum[1000][1000];\n  int i, j, k, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      sum[i][j] = x[i] + x[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == k && i != j) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a, e[10008], i, j, m, log;\n  log = 0;\n  scanf(\"%d %d\", &n, &k);\n  if (n == 1) {\n    if (n == k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    scanf(\"%d\", &a);\n    e[1] = a;\n    for (i = 2; i <= n; i++) {\n      scanf(\" %d\", &a);\n      e[i] = a;\n    }\n    for (j = 1; j <= n; j++) {\n      for (m = n; m > j; m--) {\n        if ((e[j] + e[m]) == k) {\n          printf(\"yes\");\n          log = 1;\n          break;\n        }\n      }\n      if (log > 0.1) {\n        break;\n      }\n    }\n    if (log < 0.1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[10000][256];\nint main() {\n  int n, k;\n  int i, j;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        cout << \"yes\\n\";\n        goto end;\n      }\n      if (i == n - 1 && j == n - i - 1)\n        printf(\"no\\n\");\n    }\nend:;\n  return 0;\n}\n"}
{"label": "3", "index": "5470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, tag = 0, num[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] + num[j] == k) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag) {\n      cout << \"yes\";\n      break;\n    }\n  }\n  if (tag == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k; \n  scanf(\"%d %d\", &n, &k);\n  int a[1000], i = 1;\n  for (i = 1; i <= n; i++) \n    scanf(\"%d\", &a[i]);\n  int ceshi = 0;\n  int x1, j = 1;\n  for (j = 1; j <= n - 1; j++) \n  {\n    for (x1 = n; x1 >= j + 1; x1--) \n    {\n      if (a[j] + a[x1] == k) {\n        ceshi = 1;\n      }\n    }\n  }\n  if (ceshi == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, a[1000], j = 0, m;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  m = n;\n  for (j = 0; j < m; j++) {\n    for (n; n > 0; n--) {\n      for (i = 0; i < n; i++) {\n        if (a[j] + a[i] == k) {\n          cout << \"yes\";\n          return 0;\n        }\n      }\n    }\n    n = m - j - 1;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, p, q, sum, s = 0;\n  int a[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (p = 1; p < n; p++)\n    for (q = 0; q < p; q++) {\n      sum = a[p] + a[q];\n      if (sum == k)\n        s = s + 1;\n    }\n  if (s)\n    cout << \"yes\\n\";\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[1000], i, j, n, t;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k)\n        break;\n    }\n    if (j != n && i != j)\n      t++;\n  }\n  if (t > 0)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, t, e, j, h = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n - i - 1; t++) {\n      if (a[t] < a[t + 1]) {\n        e = a[t + 1];\n        a[t + 1] = a[t];\n        a[t] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        continue;\n      }\n      if (a[i] + a[j] == k) {\n        h++;\n      }\n    }\n  }\n  if (h == 0)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, num[1000], g = 0;\n  cin >> n >> k;\n  for (i = 0; i<n; cin>> num[i++])\n    ;\n  for (i = 0; i < n - 1; i++)\n    for (int m = i + 1; m < n; m++) {\n      if (num[i] + num[m] == k)\n        g = 1;\n    }\n  cout << (g == 1 ? \"yes\" : \"no\") << \"\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "5477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1001], k, n, j, i, check;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  check = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i] + a[j] == k) && (a[i] != a[j])) {\n        check = 1;\n        break;\n      }\n    }\n    if (check == 1)\n      break;\n  }\n  if (check == 0) {\n    printf(\"no\\n\");\n\n  } else\n    printf(\"yes\\n\");\n}\n"}
{"label": "3", "index": "5478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[1000] = {0};\n  int b[10000] = {0};\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  for (i = 1; i <= n; i++)\n    if (b[k - a[i]] == 1 && k - a[i] > 0) {\n      printf(\"yes\");\n      return 0;\n    }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s[1000], k, j;\n  i = 0, j = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i] + s[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], YN = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n - 1; j++) {\n    for (int m = j; m < n; m++) {\n      int he = a[j] + a[m];\n      if (he == k) {\n        YN = 1;\n        break;\n      }\n    }\n  }\n  if (YN == 1)\n    printf(\"yes\");\n  else if (YN == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a, sa[1000], ye = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n    sa[i] = sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (a = i + 1; a < n; a++) {\n      if (sz[i] + sa[a] == k) {\n        ye = 1;\n        break;\n      }\n    }\n    if (ye == 1)\n      break;\n  }\n  if (ye == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *array, n, k, i, j;\n  scanf(\"%d%d\", &n, &k);\n  array = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", array + i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + i; j < n; j++)\n      if (array[i] + array[j] == k) {\n        printf(\"yes\");\n        free(array);\n        return 0;\n      }\n  free(array);\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5483", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000], n, k, i, j, l = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < (n - 1); i++) {\n    for (j = (n - 1); j > i; j--) {\n      if (k == a[i] + a[j]) {\n        printf(\"yes\");\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (i == (n - 1))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i <= n; i++) {\n      if (x[j] + x[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n\n  scanf(\"%d %d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "5485", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, l = 0;\n  cin >> n >> k;\n  int s[n];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> s[i];\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = i + 1; j <= n - 1; j++) {\n      if (l == 0) {\n        if (s[i] + s[j] == k) {\n          printf(\"yes\");\n          l = l + 1;\n        }\n      }\n    }\n  }\n  if (l == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000], a, m = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (i < j) {\n        a = x[i] + x[j];\n        if (a == k) {\n          m++;\n          break;\n        }\n      }\n    }\n    if (a == k)\n      break;\n  }\n  if (m != 0) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5487", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, e;\n  int p[1000];\n  cin >> n >> k;\n  e = n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (m = 1; m <= n - 1; m++) {\n    for (i = m + 1; i <= n; i++) {\n      if (p[m] + p[i] == k) {\n        printf(\"yes\");\n        e = i;\n        break;\n      } else if (m == n - 1 && i == n) {\n        printf(\"no\");\n        e = i;\n        break;\n      }\n    }\n    if (e != n || (m == n - 1 && e == n)) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bj(const void *x, const void *y) {\n  if (*(int *)x > *(int *)y)\n    return 1;\n  if (*(int *)x < *(int *)y)\n    return -1;\n  if (*(int *)x == *(int *)y)\n    return 0;\n}\nint main() {\n  int n, k, i, j, a[1000], pds = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  qsort(a, n, 4, bj);\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[i] + a[j] < k)\n        break;\n      else if (a[i] + a[j] == k) {\n        pds = 1;\n        break;\n      }\n    }\n    if (pds == 1)\n      break;\n  }\n  if (pds == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (a[j] + a[i] != k) {\n        continue;\n      }\n      if (a[j] + a[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  if (i == n) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, a[1500], flag = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 2; i <= n; i++)\n    for (j = 1; j <= i - 1; j++)\n      if ((a[i] + a[j]) == k)\n        flag = 1;\n  if (n == 1)\n    printf(\"no\");\n  else if (flag)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if ((n == 1) && (a[0] == k)) {\n    t = 1;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i != j)\n        m = a[i] + a[j];\n      if (m == k)\n        t = 1;\n    }\n  }\n  if (t == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, judge = 0;\n  scanf(\"%d %d \", &n, &k);\n  int a[1000];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; judge == 0 && i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        judge = 1;\n    }\n  }\n  if (judge == 1)\n    printf(\"yes\");\n  if (judge == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int q, int t, int b[]) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (i == j)\n        continue;\n      if (b[i] + b[j] == q)\n        return 1;\n    }\n  }\n  return 0;\n}\nint main() {\n  int n, k, a[1000], i;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  if (check(k, n, a))\n    cout << \"yes\\n\";\n  else\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "3", "index": "5494", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k;\n  int i, j, p = 1;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (num[i] + num[j] == k) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"yes\\n\");\n  } else {\n    if (p = 1) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      s = num[i] + num[j];\n      if (s == k) {\n        s = 1;\n        break;\n      }\n      s = 0;\n    }\n    if (s == 1)\n      break;\n  }\n  if (s == 0)\n    cout << \"no\";\n  if (s == 1)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, k, s;\n  int a[1000], flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    s = k - a[i];\n    for (j = i + 1; j < n; j++) {\n      if (s == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, num[1000], i, j, p = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &num[i - 1]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (num[i - 1] + num[j - 1] == k) {\n        p = p + 1;\n        break;\n      }\n    if (p > 0)\n      break;\n  }\n  if (p > 0)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, s, j, sz[1000], h, f = 0;\n  scanf(\"%d %d\", &n, &k);\n  s = 0;\n  for (h = 0; h < n; h++) {\n    cin >> (sz[h]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (((sz[i] + sz[j]) == k) && (f == 0)) {\n        printf(\"yes\");\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  if (f == 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5499", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000];\n  int i, n, k, j, t = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] + a[i] == k) {\n        printf(\"yes\");\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1) {\n      break;\n    }\n    if ((t == 0) && (i == n - 1)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], e, l, b = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d\", &sz[i]);\n\n  for (e = 0; e <= (n - 2); e++) {\n    for (l = (e + 1); l <= (n - 1); l++) {\n      if (k == sz[e] + sz[l]) {\n        b = 1;\n        break;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\");\n  }\n  if (b == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  scanf(\"%d %d \", &n, &k);\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if (sz[i] + sz[t] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[t] == k) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n, i, b, c, d;\n  int a[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (d = 0; d < n; d++) {\n    b = k - a[d];\n    for (i = 0; i < n; i++) {\n      if ((b == a[i]) && (i != d)) {\n        c = 1;\n        break;\n      }\n    }\n\n    ;\n  }\n  if (c == 0) {\n    cout << \"no\";\n  } else if (c == 1) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5503", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0;\n  int num[1000];\n  scanf(\"%d \", &n);\n  cin >> t;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  int x = 0;\n  for (int j = 0; j < n; j++) {\n    for (int k = j + 1; k < n; k++) {\n      if (num[j] + num[k] == t) {\n        cout << \"yes\";\n        x = x + 1;\n        break;\n      }\n      if (j == n - 2 && k == n - 1)\n        cout << \"no\";\n    }\n    if (x == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5504", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, k2 = 0;\n  int a[1000] = {0};\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  i = 0;\n  j = 0;\n  while (k2 != k && i < n) {\n    j = i + 1;\n    while (k2 != k && j < n) {\n      k2 = a[i] + a[j];\n      j++;\n    }\n    i++;\n  }\n  if (k2 == k)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  int p, m;\n  for (m = 0; m < n - 1; m++) {\n    for (p = m + 1; p < n; p++) {\n      if (k == sz[m] + sz[p])\n        break;\n    }\n    if (p == n)\n      continue;\n    else if (p < n && k == sz[m] + sz[p]) {\n      printf(\"yes\");\n      break;\n    }\n  }\n  if (m == n - 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1005], ans = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        ans = 1;\n        break;\n      }\n    }\n  }\n  cout << (ans ? \"yes\" : \"no\") << \"\\n\";\n}\n"}
{"label": "3", "index": "5507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, b;\n  int s = 1;\n  cin >> n >> k;\n  int a[n];\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n  }\n  for (int p = 1; p <= n; p++) {\n    b = k - a[p - 1];\n    for (int q = 1; q <= n; q++) {\n      if (a[q - 1] == b && a[p - 1] != b)\n        s++;\n    }\n  }\n  if (s == 1)\n    cout << \"no\";\n  if (s != 1)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, i, k, q, y = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, q = 0; i < n, q < n; i++, q++) {\n    cin >> x;\n    a[i] = x;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (q = i + 1; q < n; q++) {\n      if (a[i] + a[q] == k) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n  }\n  if (y == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, i, j, jude = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] + a[j] == k) {\n        jude = 1;\n        break;\n      }\n  }\n  if (jude == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, s = 0;\n  cin >> n >> k;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j) {\n        j++;\n      }\n      if (a[i] + a[j] == k) {\n        s++;\n      }\n    }\n  }\n  if (s == 0) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, num[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        n = 0;\n        break;\n      }\n    }\n    if (n == 0) {\n      cout << \"yes\\n\";\n      break;\n    }\n  }\n  if (n != 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5512", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, k, a[1000], b = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int t = 0; t < n; t++) {\n    scanf(\" %d\", &a[t]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] + a[j] == k) {\n        b = 1;\n        printf(\"yes\\n\");\n        return 1;\n      }\n    }\n  }\n  if (b == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d \", &n, &k);\n  int a[n];\n  int x, y, sum;\n  sum = 0;\n  int i, j, m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - 1; j++)\n\n    for (m = j + 1; m < n; m++) {\n      x = a[j] + a[m];\n      if (x == k)\n        y = 1;\n      else\n        y = 0;\n      sum = sum + y;\n    }\n\n  if (sum == 0)\n    printf(\"no\");\n  else\n    cout << \"yes\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, sz[1000], b = 0, c, q, i, j, e;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      q = sz[i] + sz[j];\n      if (q == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  printf(\"no\");\n  \n  \n  \n\n  return 0;\n}\n"}
{"label": "3", "index": "5515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, t = 0;\n  int sz[1000][1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &sz[0][i]);\n    sz[i][0] = sz[0][i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i == j) {\n        continue;\n      } else {\n        sz[i][j] = sz[i][0] + sz[0][j];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (sz[i][j] == k) {\n        t = 1;\n      }\n    }\n  }\n  if (t == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, n, k, i = 0, m = 0;\n  int sz[100000];\n  scanf(\"%d%d\\n\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (x = i; x <= n - 2; x++) {\n      y = sz[i] + sz[x + 1];\n      if (y == k) {\n        m++;\n      }\n    }\n  }\n  if (m != 0)\n    printf(\"yes\");\n  else if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5517", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, flag = 0;\n  int a[1001];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\\n\");\n        flag = 1;\n        break;\n      }\n    if (a[i] + a[j] == k)\n      break;\n  }\n  if (flag != 1)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5518", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint mycompare(const void *, const void *);\n\nint main() {\n  int n, k;\n  int a[1008];\n  int i, j;\n  int tag = 0;\n\n  cin >> n >> k;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  qsort(a, n, 4, mycompare);\n\n  for (i = 0; i < n / 2; i++) {\n    int count = n - 1;\n\n    while (count > i) {\n      if (a[i] + a[count] == k) {\n        tag = 1;\n        break;\n      } else if (a[i] + a[count] < k)\n        break;\n      else\n        count--;\n    }\n\n    if (tag == 1)\n      break;\n  }\n\n  if (tag == 1)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n}\n\nint mycompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n"}
{"label": "3", "index": "5519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int sz[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int j, e, a;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n      }\n    }\n  }\n  a = 0;\n  if (sz[n - 1] + sz[n - 2] < k)\n    printf(\"no\");\n  else {\n    if (sz[0] + sz[1] > k) {\n      cout << \"no\";\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        for (j = i + 1; j < n; j++) {\n          if (sz[i] + sz[j] == k) {\n            printf(\"yes\");\n            a = 1;\n            break;\n          }\n        }\n        if (a == 1) {\n          break;\n        }\n      }\n      if (a == 0) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i;\n  int *a;\n  scanf(\"%d %d\", &n, &k);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n - i; j++) {\n      if (a[i] + a[i + j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5521", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], count = 0;\n  scanf(\"%d %d \", &n, &k);\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] != k)\n        count = count + 1;\n    }\n  int m;\n  m = n * (n - 1) / 2;\n  if (count < m)\n    cout << \"yes\" << endl;\n  else\n    cout << \"no\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1001];\n  int i, j, sum, e = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n\n      break;\n  }\n  if (e == 1)\n    cout << \"yes\";\n  if (e != 1)\n    printf(\"no\");\n\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "3", "index": "5523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, k, i, j, sum, res;\n  scanf(\"%d %d\\n\", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  res = 0;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum = a[i] + a[j];\n      if (sum == k) {\n        res = res + 1;\n      }\n    }\n  }\n  if (res == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, r, a[1000], x = 0;\n  cin >> n >> k;\n  for (i = 0; i <= n - 1; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (r = 0; r <= n - 2; r = r + 1) {\n    for (i = r + 1; i <= n - 1; i = i + 1) {\n      if ((a[r] + a[i]) == k) {\n        x = x + 1;\n      }\n    }\n  }\n  if (x == 0)\n    printf(\"no\");\n  else if (x != 0)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x[1000], sum[1000][1000];\n  int i, j, k, n;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      sum[i][j] = x[i] + x[j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == k && i != j) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000], k, i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  for (j = 0; j < n - 1; j = j + 1) {\n    for (i = j - 1; i < n - 1; i = i + 1) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (a[i] + a[j] == k) {\n      break;\n    }\n  }\n  if (a[i] + a[j] == k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, sz[1000], j, k;\n  int sum = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n / 2 + 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        sum++;\n        break;\n      }\n    }\n  }\n\n  if (sum != 0) {\n    cout << \"yes\";\n  }\n  if (sum == 0) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5528", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int sz[1000];\n  int a[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    cin >> sz[i];\n    a[i] = k - sz[i];\n  }\n  int found = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i] == sz[j]) {\n        found = 1;\n        break;\n      }\n    }\n    if (found == 1) {\n      break;\n    }\n  }\n  if (found == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d %d\", &n, &k);\n  int data[n];\n  int i;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &(data[i]));\n  }\n\n  int j;\n  int s = 0;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1) {\n      if (i != j && data[i] + data[j] == k) {\n        s = 1;\n        break;\n      }\n    }\n  }\n\n  if (s == 1) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n\n  return (0);\n}\n"}
{"label": "3", "index": "5530", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == j)\n        break;\n      else {\n        a = sz[i] + sz[j];\n        if (a == k)\n          m++;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"no\");\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, i, k, q, y = 0;\n  int a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0, q = 0; i < n, q < n; i++, q++) {\n    scanf(\"%d\", &x);\n    a[i] = x;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (q = i + 1; q < n; q++) {\n      if (a[i] + a[q] == k) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n  if (y == 1) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], m = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] + a[j] == k && i != j) {\n        printf(\"yes\");\n        m++;\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        cout << \"no\";\n        m++;\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5533", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, sigma;\n  int sb = 0;\n  scanf(\"%d %d\", &n, &sigma);\n  int sz[1000];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = 0; k < n; k++) {\n      if (k == j) {\n        continue;\n      } else if (k != j) {\n        if (sz[j] + sz[k] == sigma) {\n          sb = 1;\n          break;\n        }\n      }\n    }\n    if (sb == 1) {\n      break;\n    }\n  }\n  if (sb == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, x[1000];\n  int i, j, sign = 0;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &x[i]);\n\n  for (i = 0; i < n; i++) {\n\n    for (j = i + 1; j < n; j++) {\n      if ((x[i] + x[j]) == k) {\n        sign = 1;\n        break;\n      }\n    }\n  }\n\n  if (sign == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n\n  scanf(\"%d%d\", &n, &k);\n  return 0;\n}\n"}
{"label": "3", "index": "5535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d\", &n, &k);\n  int a[1000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  int hh = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    int count = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      } else\n        count++;\n    }\n    if (b == 1)\n      break;\n    if (count == n - 1 - i)\n      hh++;\n  }\n  if (hh == n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a = 0;\n  scanf(\"%d %d\", &n, &k);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (p[i] + p[j] == k)\n        a = 1;\n    }\n  if (a == 1)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n}\n"}
{"label": "3", "index": "5537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d%d\", &n, &k);\n  int sz[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int a = 1; a < n; a++) {\n    for (int i = 0; i < n && i != (n - a); i++) {\n      if (((sz[i]) + (sz[n - a])) == k) {\n        printf(\"yes\");\n        return 0;\n      } else if (a == n - 1 && ((sz[i]) + (sz[n - a])) != k) {\n        printf(\"no\");\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "3", "index": "5538", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, k, flag;\n  int num[1000];\n  int i = 0, j;\n  cin >> n >> k;\n  while (i < n) {\n    i++;\n    cin >> num[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        cout << \"yes\" << endl;\n        flag = 0;\n        i = n;\n        j = n;\n        break;\n      }\n    }\n  }\n  if (flag)\n    cout << \"no\" << endl;\n}\n"}
{"label": "3", "index": "5539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, l, w;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  if (n <= 0)\n    printf(\"no\");\n  l = 0;\n  i = 0;\n  while (l <= n - 1) {\n    scanf(\"%d\", &a[l]);\n    l++;\n  }\n  while (i < n - 1) {\n    j = n - 1;\n    while (j > i) {\n      w = a[i] + a[j];\n      j--;\n      if (w == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (w == k) {\n      break;\n    }\n    i++;\n  }\n  if (i == n - 1)\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "3", "index": "5540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, x[1000], a, m = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (i < j) {\n        a = x[i] + x[j];\n        if (a == k) {\n          m++;\n          break;\n        }\n      }\n    }\n    if (a == k)\n      break;\n  }\n  if (m != 0)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, k, i, j;\n  int sz[1000];\n  int tag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++)\n      if (sz[i] + sz[j] == k)\n        tag = 1;\n  }\n  if (tag)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[1000], i, j;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n - i; j++) {\n      if (a[j] + a[i] != k) {\n        continue;\n      }\n      if (a[j] + a[i] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  if (i == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100][255];\nint main() {\n  int n, k, i, j, b = 0, c = 0, d = 0, e = 0, flag = 0;\n  int num[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n\n  for (i = 0; i < n - 1 && !flag; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (num[i] + num[j] == k) {\n        flag = 1;\n      }\n    }\n  }\n  if (flag == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, sz1[1000], sz2[1000];\n  int t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz1[i]));\n    sz2[i] = sz1[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (k == sz1[m] + sz2[i]) {\n        t++;\n      }\n    }\n  }\n  if (t > 0) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5545", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d %d \", &n, &k);\n  int a[n];\n  int i, j;\n  int yes = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        yes = 1;\n      }\n    }\n  }\n  if (yes == 0) {\n    printf(\"no\");\n  }\n  if (yes == 1) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, k, num[1000];\n  cin >> n >> k;\n  for (int i = 0; i < n; i++)\n    cin >> num[i];\n  int c = 1;\n  for (int j = 0; j < n; j++) {\n    for (int m = j + 1; m < n; m++) {\n\n      if (num[j] + num[m] == k) {\n        c = 0;\n        break;\n      }\n    }\n    if (c == 0)\n      break;\n  }\n  if (c == 1)\n    printf(\"no\\n\");\n  if (c == 0)\n    cout << \"yes\" << endl;\n  return 0;\n}\n"}
{"label": "3", "index": "5547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, shu[1000], m;\n  scanf(\"%d %d \", &n, &k);\n  cout << endl;\n  for (int i = 1; i < n; i++)\n    cin >> shu[i];\n  for (int i = 1; i < n; i++)\n    for (int j = i + 1; j <= n; j++) {\n      m = shu[i] + shu[j];\n      if (m == k) {\n        cout << \"yes\";\n        j = n + 1;\n        i = n + 1;\n      } else if (i == n - 1 && j == n)\n        cout << \"no\";\n    }\n  return 0;\n}\n"}
{"label": "3", "index": "5548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], l = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (l == 1)\n    cout << \"yes\\n\";\n\n  if (l == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, sz[1000], a, sa[1000], ye = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n    sa[i] = sz[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (a = i + 1; a < n; a++) {\n      if (sz[i] + sa[a] == k) {\n        ye = 1;\n        break;\n      }\n    }\n    if (ye == 1) {\n      break;\n    }\n  }\n  if (ye == 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, s, h = 0, t = 0;\n  scanf(\"%d%d\", &n, &k);\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        h = 1;\n      }\n    }\n  }\n  if (h == 1 && t == 0) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5551", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, t, j, sz[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (j = t + 1; j < n; j++) {\n      if (sz[t] + sz[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  if (t == n - 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5552", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[999];\nint main() {\n  int n, k, i, j;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  int b = 0;\n  for (i = 0; i <= n - 2; i++)\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] + a[j] == k) {\n        b = b + 1;\n      }\n    }\n  if (b >= 1) {\n    printf(\"yes\\n\");\n  } else\n    printf(\"no\\n\");\n}\n"}
{"label": "3", "index": "5553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, p = 0;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if ((a[i] + a[j]) == k) {\n        p = 1;\n        break;\n      }\n    }\n    if (p == 1) {\n      break;\n    }\n  }\n  if (p == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k, s[1000], q[1000];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  for (k = 1; k < n; k++) {\n    q[k] = s[k];\n  }\n  int c = 0;\n  for (i = 0; i < n; i++) {\n    if (c == m)\n      break;\n    else {\n      for (k = 1; k < n; k++) {\n        c = s[i] + q[k];\n        if (c == m) {\n          printf(\"yes\");\n          break;\n        }\n      }\n    }\n  }\n  if (c != m) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, m;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  scanf(\"%d\", &sz[n - 1]);\n  int a = 0;\n  for (a = 0; a < n; a++) {\n    m = 0;\n    for (i = a + 1; i < n; i++) {\n      if (sz[a] + sz[i] == k) {\n        m = 1;\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, f[1000], o[1000], s, flag, sign;\n  scanf(\"%d%d\", &n, &s);\n  for (i = 0; i < n; i++) {\n    cin >> f[i];\n    o[i] = s - f[i];\n  }\n  flag = 0;\n  sign = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (o[j] == f[k]) {\n        printf(\"yes\");\n        flag = 1;\n        sign = 1;\n        break;\n      }\n    }\n    if (sign == 1) {\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a = 1, i, j;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        a = 0;\n      }\n    }\n  }\n  while (a == 0) {\n    printf(\"yes\");\n    break;\n  }\n\n  while (a) {\n    cout << \"no\";\n    break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, z, sum = 0, x = 0;\n  int sz[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (j = 0; j < n - 1; j++)\n    for (z = j + 1; z < n; z++) {\n      sum = sz[j] + sz[z];\n      if (sum == k) {\n        x++;\n      }\n    }\n  if (x == 0) {\n    printf(\"no\");\n  } else if (x != 0)\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, b = 0, a, j, array[1000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    cin >> array[i];\n  for (i = 0; i < n; i++) {\n    a = k - array[i];\n    for (j = 1; j < n; j++) {\n      if (a == array[j]) {\n        b = 1;\n        break;\n      } else\n        continue;\n    }\n    if (b == 1)\n      break;\n  }\n  if (b == 1)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j;\n  int a[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        break;\n      }\n    }\n    if (j != n) {\n      break;\n    }\n  }\n  if (i != n - 1) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, c, d, f, m;\n  m = 0;\n  scanf(\"%d %d \", &b, &c);\n  for (d = b; d > 0; d = d - 1)\n    scanf(\"%d \", &a[d]);\n  for (d = 1; d <= b; d++) {\n    for (f = 1; f <= b; f++) {\n      if ((a[f] + a[d]) == c && f != d)\n        m = 1;\n    }\n  }\n  if (m == 0)\n    cout << \"no\";\n  else\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "3", "index": "5562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], f = 0;\n  scanf(\"%d %d\", &n, &k);\n  scanf(\"%d\", &a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (int j = 0; j < i; j++) {\n      if (a[j] + a[i] == k) {\n        f = 1;\n      }\n    }\n  }\n  if (f == 1) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int i, j, l;\n  int a, sum = 0, f = 0;\n  int m[1000];\n  cin >> n >> k;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a);\n    m[i] = a;\n  }\n  for (j = 1; j <= n; j++) {\n    for (l = j; l <= n; l++) {\n      sum = m[j] + m[l];\n      if (sum == k)\n        f = f + 1;\n      else\n        f = f;\n    }\n  }\n  if (f == 0)\n    cout << \"no\";\n  else\n    cout << \"yes\";\n  return 0;\n}\n"}
{"label": "3", "index": "5564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, a[1000], b[1000][1000], c = 0, d = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      b[i][j] = a[i] + a[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i][j] == k) {\n        c++;\n\n      } else {\n        d++;\n      }\n    }\n  }\n  if (c > 0) {\n    printf(\"yes\");\n  }\n\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[1000], n, k, i, j, flag = 0, m;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    m = i;\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[m]) {\n        m = j;\n      }\n    }\n    int temp = array[i];\n    array[i] = array[m];\n    array[m] = temp;\n  }\n\n  for (i = 0, j = n - 1; i < j;) {\n    int temp = array[i] + array[j];\n    if (temp == k) {\n      flag = 1;\n      break;\n    } else {\n      if (temp > k) {\n        j--;\n      } else {\n        i++;\n      }\n    }\n  }\n  if (flag) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a, b, c;\n  c = 0;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (a = 0; a < n; a++)\n    scanf(\"%d\", &sz[a]);\n\n  for (a = 0; a < (n - 1); a++) {\n    for (b = (a + 1); b < n; b++) {\n      if (sz[a] + sz[b] == k) {\n        cout << \"yes\";\n        return 0;\n      }\n      if (sz[a] + sz[b] != k)\n        c++;\n    }\n  }\n  if (c == n * (n - 1) / 2) {\n    printf(\"no\");\n    return 0;\n  }\n}\n"}
{"label": "3", "index": "5567", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, a[1000], t, j, p = 0, i;\n  cin >> n >> k;\n  scanf(\"%d\", &a[0]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    scanf(\"%d\", &a[i]);\n\n    for (j = 0; j < t; j++) {\n      if (a[j] == k - a[i]) {\n        p = 1;\n        break;\n      }\n    }\n  }\n  if (p == 0)\n    printf(\"no\");\n  if (p == 1)\n    printf(\"yes\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5568", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, t;\n  cin >> n >> k;\n  int sz[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      if (sz[i] + sz[t] == k) {\n        printf(\"yes\");\n        break;\n      }\n    }\n    if (sz[i] + sz[t] == k) {\n      break;\n    }\n  }\n  if (i == n && t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000], l = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 1)\n      break;\n  }\n  if (l == 1) {\n    printf(\"yes\\n\");\n  }\n  if (l == 0) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, a[1001], b = 0, c = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int m = n - 1; m >= 1; m--) {\n      if (a[m] + a[j] == k && m != j) {\n        printf(\"yes\");\n        b = a[m];\n        c = a[j];\n        break;\n      }\n\n      if (b + c == k)\n        break;\n      if (j == n - 1) {\n        cout << \"no\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, b, c;\n  int sz[1000];\n  c = 0;\n  scanf(\"%d%d\", &n, &k);\n  for (int i = 0; i < n; i++) {\n    cin >> (sz[i]);\n  }\n  for (int a = 0; a < n; a++) {\n    for (i = 0; i < n; i++) {\n      b = sz[a] + sz[i];\n      if (sz[a] + sz[i] == k) {\n        c++;\n      } else {\n        continue;\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"no\");\n  }\n  if (c > 0) {\n    cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, b = 0;\n  int num[1002];\n  scanf(\"%d %d\\n\", &n, &k);\n  cin >> num[0];\n  for (i = 1; i <= n - 1; i++)\n    scanf(\" %d\", &num[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (num[i] + num[j] == k) {\n        printf(\"yes\");\n        b = 1;\n        break;\n      }\n    }\n    if (num[i] + num[j] == k)\n      break;\n  }\n  if (b == 0)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r;\n  int n, k, sz[1000];\n  scanf(\"%d %d\\n\", &n, &k);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &sz[i]);\n  }\n  for (r = 1; r < n; r++) {\n    for (a = r + 1; a <= n; a++) {\n      if (sz[a] + sz[r] == k) {\n        cout << \"yes\";\n        break;\n      }\n    }\n    if (a <= n)\n      break;\n  }\n  if (r >= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5574", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n >> k;\n  int data[1001];\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < i; j++)\n      if (data[i] + data[j] == k) {\n        cout << \"yes\" << endl;\n        return 0;\n      }\n  printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "3", "index": "5575", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t, tmp, a[10000];\n  scanf(\"%d %d \", &n, &k);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    t = i;\n    for (j = t; j <= n; j++) {\n      if (a[j] < a[t])\n        t = j;\n    }\n    if (t != i) {\n      tmp = a[t];\n      a[t] = a[i];\n      a[i] = tmp;\n    }\n  }\n  t = 0;\n\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] + a[j] == k && t == 0) {\n        printf(\"yes\");\n        t = 1;\n      } else if (a[i] + a[j] > k)\n        break;\n    }\n  }\n  if (t == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, sz1[1000], sz2[1000];\n  int t = 0;\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz1[i]));\n    sz2[i] = sz1[i];\n  }\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      if (k == sz1[m] + sz2[i]) {\n        t++;\n      }\n    }\n  }\n  if (t > 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, judge = 0; \n  cin >> n >> k;\n  int a[1000];\n  for (int i = 0; i < n; i++) \n    cin >> a[i];\n  for (int i = 0; judge == 0 && i < n - 1; i++) \n  {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) \n        judge = 1;\n    }\n  }\n  if (judge == 1) \n    cout << \"yes\";\n  if (judge == 0) \n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n  if (a[i] + a[j] != k)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5579", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[1000], n, k, i, j;\n  scanf(\"%d %d \", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] + b[j] == k) {\n        printf(\"yes\");\n        break;\n      }\n      if (i == n - 2 && j == n - 1) {\n        printf(\"no\");\n      }\n    }\n    if (b[i] + b[j] == k) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, k;\n  int t;\n  int d;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = k - a[i];\n    for (j = i; j < n; j++) {\n      if (a[j] == t) {\n        printf(\"yes\\n\");\n        return 0;\n      }\n    }\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5581", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int n, i, j, k, s;\n  int a[1000], flag = 0;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = k - a[i];\n    for (j = i + 1; j < n; j++) {\n      if (s == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5582", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, p = 0;\n  scanf(\"%d%d\", &n, &m);\n  int sz[1000], pl[1000], a;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    pl[i] = sz[i];\n  }\n\n  for (k = 0; k < n; k++) {\n    for (j = 1; j < n; j++) {\n      a = pl[k] + sz[j];\n      if (a != m)\n        p++;\n    }\n  }\n  if (p == n * (n - 1)) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, DATA[1000], i, j;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &DATA[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (DATA[i] + DATA[j] == k) {\n        printf(\"yes\");\n        goto end;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k - DATA[i] != DATA[j]) {\n        printf(\"no\");\n        goto end;\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "3", "index": "5584", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int b, i, n, k, j, s;\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (j = i + 1; j < n; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        b = 1;\n      } else\n        continue;\n    }\n  }\n  if (b == 1)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], b[500000];\n  int i, m, n, k, d = 0, c;\n  cin >> n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= n; i++) {\n    cin >> (a[i]);\n  }\n  for (m = 1; m < n; m++) {\n    for (i = 1; i <= n - m; i++) {\n      c = a[m] + a[i + m];\n      d = d + 1;\n      b[d] = c;\n    }\n  }\n  for (i = 1; i <= d; i++) {\n    if (b[i] == k) {\n      printf(\"yes\");\n      break;\n    } else if (i == d) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, k2 = 0; \n  int a[1000] = {0};      \n  cin >> n >> k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  i = 0;\n  j = 0;\n  while (k2 != k && i < n) \n  {\n    j = i + 1;\n    while (k2 != k && j < n) {\n      k2 = a[i] + a[j];\n      j++;\n    }\n    i++;\n  }\n  if (k2 == k)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "3", "index": "5587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000];\n  int n, k, i, t, l;\n\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &sz[i]);\n\n  t = 0;\n  while (t < n) {\n    l = 1;\n    while (l < n) {\n      if (sz[t] + sz[l] == k) {\n        printf(\"yes\");\n        l++;\n        break;\n      } else {\n        l++;\n      }\n    }\n\n    if (sz[t] + sz[l - 1] == k) {\n      break;\n    }\n    t++;\n  }\n\n  if (t == n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, k, s;\n  m = 0;\n  int sz[1000], p[1000];\n  cin >> n >> k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    p[m] = sz[i];\n    m++;\n  }\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < n; m++) {\n      s = sz[i] + p[m];\n      if (s == k) {\n        break;\n      }\n    }\n    if (s == k) {\n      break;\n    }\n  }\n  if (i == n) {\n    cout << \"no\";\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, k;\n  int m = 0;\n  int a[1000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k)\n        m++;\n    }\n  }\n  if (m != 0)\n    cout << \"yes\";\n  if (m == 0)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "3", "index": "5590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int i, j, n, k;\n  int l = 0;\n  int swap;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] + a[j] == k) {\n        printf(\"yes\");\n        return 0;\n      }\n    }\n  }\n  \n  printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "3", "index": "5591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a = 1, i, j;\n  int sz[1000];\n  scanf(\"%d%d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (sz[i] + sz[j] == k) {\n        a = 0;\n      }\n    }\n  }\n  while (a == 0) {\n    printf(\"yes\");\n    break;\n  }\n\n  while (a) {\n    printf(\"no\");\n    break;\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, h = 0;\n  int s[1000], g[1000];\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &(s[i]));\n  }\n  for (i = 0; i <= n - 1; i++) {\n    g[i] = k - s[i];\n    for (j = 0; j <= n - 1; j++) {\n      if (g[i] == s[j])\n        h++;\n    }\n  }\n  if (h == 0) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n\n  return 0;\n}\n"}
{"label": "3", "index": "5593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, *pt, flag = 1;\n  scanf(\"%d%d\", &n, &k);\n  pt = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", pt + i);\n  for (i = 0; i < n - 1; i++)\n    if (flag)\n      for (j = i + 1; j < n; j++)\n        if ((pt[i] + pt[j]) == k) {\n          flag = 0;\n          break;\n        }\n  if (flag)\n    printf(\"no\\n\");\n  else\n    cout << \"yes\\n\";\n  free(pt);\n}\n"}
{"label": "3", "index": "5594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, d = 0, a[1000], s;\n  scanf(\"%d %d\", &n, &k);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i; j++) {\n      s = a[i] + a[j];\n      if (s == k) {\n        d++;\n      }\n    }\n  }\n  if (d != 0)\n    cout << \"yes\";\n  else if (d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "3", "index": "5595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000], K, m, d[1000], s = 0, t, o;\n  scanf(\"%d%d\", &n, &K);\n  int e, i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(sz[i]));\n  }\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i] > sz[i + 1]) {\n        e = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    o = i;\n    d[o] = sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = K - sz[i];\n    t = 0;\n    for (o = 0; o < n; o++) {\n      if (o != i && m == d[o]) {\n        t++;\n      }\n    }\n    if (t > 0) {\n      s++;\n    }\n  }\n  if (s > 0) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a;\n  int array[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  k = row + col;\n  for (a = 0; a < k - 1; a++) {\n    for (i = 0; i <= a; i++)\n      if (i < row && (a - i) < col)\n        cout << array[i][a - i] << \"\\n\";\n      else if (i >= row)\n        i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5597", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row >= col) {\n    for (n = 0; n <= col - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = col; n <= row - 1; n++)\n      for (i = n - col + 1; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n  \n  else {\n    for (n = 0; n <= row - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= col - 1; n++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = col; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100][100], *p;\n  int raw, col;\n  cin >> raw >> col;\n  for (p = a[0]; p < a[0] + raw * col; p++) {\n    cin >> *p;\n  }\n  if (col != 1) {\n    cout << a[0][0] << endl;\n    for (p = a[0] + 1; p < a[0] + col - 1; p++) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n\n    for (p = a[0] + col - 1; p < a[0] + col * raw; p += col) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n  }\n  if (col == 1) {\n    for (p = a[0]; p < a[0] + raw * col; p++) {\n      cout << *p << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, i, j;\n  int a[100][100];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < r + c - 1; i++) {\n    if (i < c && c <= r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c <= r && i < r)\n      for (j = i - c + 1; j <= i; j++)\n        cout << a[j][i - j] << \"\\n\";\n    else if (i >= r && c <= r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i < r && c > r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c > r && i < c)\n      for (j = 0; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c > r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5600", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int jz[100][100];\n  int i = 0;\n  int j = 0;\n  int m = 0;\n  int n = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &jz[i][j]);\n  }\n\n  printf(\"%d\\n\", jz[0][0]);\n\n  if (row <= col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n\n  else if (row > col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row && j >= 0; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n  if (row != 1)\n    printf(\"%d\", jz[row - 1][col - 1]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "5601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, a[100][100], n, t;\n  scanf(\"%d%d\", &row, &col);\n  n = row + col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (i = 0; i <= t; i++) {\n      if (i < row && (t - i) < col)\n        cout << a[i][t - i] << \"\\n\";\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c;\n  cin >> r >> c;\n  int a[r][c];\n  for (int i = 0; i < r; i++)\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (int k = 0; k < r + c - 1; k++) {\n    if (k < c) {\n      for (int i = 0; i < r && k - i >= 0; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    } else {\n      for (int i = c - 1; i >= 0 && k - i < r; i--)\n        cout << *(*(a + k - i) + i) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int heng, lie, i, j, k, l;\n  scanf(\"%d %d\", &heng, &lie);\n\n  int **p;\n  p = (int **)malloc(heng * sizeof(int *));\n  for (i = 0; i < heng; i++) {\n    *(p + i) = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < lie; j++) {\n    for (k = j, l = 0; k >= 0; k--, l++) {\n      if (l < heng)\n        cout << *(*(p + l) + k) << \"\\n\";\n      else\n        break;\n    }\n  }\n  for (j = lie; j < heng + lie - 1; j++) {\n    for (k = lie - 1, l = j - (lie - 1); k >= 0; k--, l++) {\n      if (l < heng)\n        cout << *(*(p + l) + k) << \"\\n\";\n      else\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "5604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j, k;\n  int c[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  if (b > a) {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < b - a; k++) {\n      i = 0;\n      j = a + k;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else if (b < a) {\n    for (k = 0; k < b; k++) {\n      i = 0;\n      j = k;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - b; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < b - 1; k++) {\n      i = a - b + 1 + k;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        cout << c[i][j] << \"\\n\";\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5605", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], n, m, j, i, k;\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++)\n      a[i][j] = -32767;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = k; i >= 0; i--) {\n      if (a[k - i][i] != -32767)\n        printf(\"%d\\n\", a[k - i][i]);\n    }\n}\n"}
{"label": "4", "index": "5606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint mins(int x, int y) {\n  if (x > y)\n    return y;\n  else\n    return x;\n}\n\nint maxs(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int row, col, i, j, n;\n  scanf(\"%d %d \", &row, &col);\n  n = row * col;\n  int a[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < mins(row, col); i++) {\n    for (j = 0; j <= i; j++) {\n      cout << a[j][i - j] << endl;\n    }\n  }\n\n  if (row >= col) {\n    for (i = col; i < row; i++) {\n      for (j = i - col + 1; j <= i; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = row; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  } else {\n    for (i = row; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = col; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], i, j, num = 1, k, l, t;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cout << a[i][j] << endl;\n      }\n    }\n    return 0;\n  }\n  k = 0;\n  l = 0;\n  while (1) {\n    if (k < n && l < m)\n      cout << a[k][l] << endl;\n    if (l != 0) {\n      k++;\n      l--;\n      continue;\n    }\n    if (l == 0) {\n      t = k;\n      k = 0;\n      l = t + 1;\n    }\n    while (k >= n || l >= m) {\n      k++;\n      l--;\n      if (l == 0) {\n        t = k;\n        k = 0;\n        l = t + 1;\n      }\n      if (l + k == m + n) {\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[101][101];\n  int(*p)[101] = NULL;\n  p = array;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  }\n  for (int k = 0; k < row + col - 1; k++) {\n    for (int i = 0; i < row; i++) {\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, *p, *p0, i;\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)calloc(m * n, sizeof(int));\n\n  p0 = p;\n  for (p = p0; p < p0 + m * n; p++) {\n    scanf(\"%d\", p);\n  }\n\n  if (m < n) {\n    for (p = p0; p < p0 + m; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + m; p < p0 + n - 1; p++) {\n      for (i = 0; i < m; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m - (p - p0) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n\n  if (m == n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m + 1 - (p - p0 + 1) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n\n  if (m > n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p <= p0 + (m - n + 1) * n - 1; p += n) {\n      for (i = 0; i < n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + (m - n + 2) * n - 1; p <= p0 + m * n - 1; p += n) {\n      for (i = 0; i < m - (p - p0 + 1) / n + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5610", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ROW, COL, row, col;\n  int k, i, j;\n  int sz[101][101];\n  cin >> ROW >> COL;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5611", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, sum;\n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  sum = row + col;\n  for (k = 2; k <= sum; k++)\n    for (i = 1; i <= row; i++)\n      for (j = col; j > 0; j--)\n        if (i + j == k) {\n          cout << array[i - 1][j - 1] << endl;\n          break;\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "5612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = j = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = j = 0; i <= n + m - 2; i++)\n    for (j = 0; j <= i; j++)\n      if (j >= 0 && j < m && i - j >= 0 && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n}\n"}
{"label": "4", "index": "5613", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], r, c, r1, c1;\n  int i, l, j, k, m, n;\n  scanf(\"%d %d \", &r, &c);\n  for (m = 0; m <= 100; m++) {\n    for (n = 0; n <= 100; n++)\n      a[m][n] = -1;\n  }\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 1; k <= c; k++) {\n    c1 = k;\n    r1 = 1;\n    while (a[r1][c1] > 0) {\n      printf(\"%d\\n\", a[r1++][c1--]);\n    }\n  }\n  for (l = 2; l <= r; l++) {\n    c1 = c;\n    r1 = l;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5614", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, max;\n  cin >> row >> col;\n  int i, j;\n  int a[101][101];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 0; i <= row + col - 2; i++) {\n    max = 0;\n    if (row - 1 < i)\n      max = row - 1;\n    else\n      max = i;\n    for (j = 0; j <= max; j++) {\n      if (i - j <= col - 1) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i, j, a[100][100];\n  double b[100][200];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      b[i][j] = 0.5;\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      b[i][j + i] = a[i][j];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      if (b[i][j] != 0.5)\n        cout << b[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    if (i >= col) {\n      for (j = col - 1; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", a[i - j][j]);\n      }\n    } else {\n      for (j = i; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", a[i - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  int(*aa)[100] = a;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      printf(\"%d\\n\", *((*(aa + r)) + c));\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, min;\n  cin >> m >> n;\n  int a[m][n];\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (j = 0; j <= n - 1; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = 0; i <= min; i++) \n      cout << a[i][j - i] << endl;\n  }\n  for (j = n; j <= m + n - 2; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = j - (n - 1); i <= min; i++) \n      cout << a[i][j - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, zong, x, y, sum, zanshi;\n  int *c, *d;\n  scanf(\"%d %d\", &m, &n);\n  zong = m * n;\n  d = (int *)malloc(zong * sizeof(int));\n  c = d;\n  for (; c < d + zong; c++)\n    scanf(\"%d\", c);\n  for (sum = 2; sum <= m + n; sum++) {\n    for (y = 1; y < sum; y++) {\n      x = sum - y;\n      zanshi = n * (y - 1) + x;\n      if (x <= n && y <= m && zanshi >= 1 && zanshi <= zong)\n        cout << *(d + zanshi - 1) << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "5620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int(*a)[160], i, j, k, m, n, t;\n  a = (int(*)[160])malloc(110 * sizeof(int));\n\n  scanf(\"%d %d\", &m, &n);\n\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", *(a + j) + i);\n    }\n\n  for (k = 0; k < n; k++) {\n\n    for (j = 0, i = k; i >= 0 && j < m; j++, i--)\n      if (i >= 0 && i < n && j >= 0 && j < m)\n        printf(\"%d\\n\", *(*(a + j) + i));\n  }\n  for (k = 1; k < m; k++)\n    for (j = k, i = 0; j < m && i <= n - 1; j++, i++)\n      cout << *(*(a + j) + n - i - 1) << \"\\n\";\n}\n"}
{"label": "4", "index": "5621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  static int a[105][105];\n  int i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 0, j = 0; i < n;) {\n    for (k = i; k < n && i + j - k >= 0; k++) {\n      printf(\"%d \", a[k][i + j - k]);\n    }\n    if (j != m - 1)\n      j++;\n    else if (j == m - 1)\n      i++;\n  }\n}\n"}
{"label": "4", "index": "5622", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int max, row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int(*p)[100];\n  p = array;\n  for (int i = 0; i < col; i++) {\n    for (int j = i; j >= 0; j--) {\n      if ((i - j) < row)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  for (int i = col; i <= col + row - 1; i++) {\n    for (int j = col - 1; j >= 0; j--) {\n      if ((i - j) < row && i - col + 1 >= 0)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "5623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[1500][1500], b[10000], i, j, sum, t = 0; \n  cin >> n >> m;\n  for (i = 1; i <= 1499; i++)\n    for (j = 1; j <= 1499; j++)\n      a[i][j] = -198;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++) {\n      cin >> a[i][j];\n    }\n  for (sum = 2; sum <= (n + m); sum++) {\n    for (i = 1; i < sum; i++) {\n      if (a[i][sum - i] != -198)\n        cout << a[i][sum - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, i, j;\n  int a[100][100];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  for (i = 0; i < r + c - 1; i++) {\n    if (i < c && c <= r)\n      for (j = 0; j <= i; j++)\n        cout << a[j][i - j] << \"\\n\";\n    else if (i >= c && c <= r && i < r)\n      for (j = i - c + 1; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c <= r)\n      for (j = i - c + 1; j < r; j++)\n        cout << a[j][i - j] << \"\\n\";\n    else if (i < r && c > r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c > r && i < c)\n      for (j = 0; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c > r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int array[101][101];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> *(*(array + i) + j);\n\n  for (i = 1; i <= row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j > 0 && i - j <= col && j + 1 <= row)\n        cout << *(*(array + j + 1) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n, m, i, j;\n  int(*p)[1000], (*q)[1000];\n  scanf(\"%d%d\", &row, &col);\n  p = (int(*)[1000])malloc(row * 1000 * sizeof(int));\n  q = p;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(q + i) + j);\n    }\n  }\n  q = p;\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; m >= 0 && i < row; m--, i++) {\n      printf(\"%d \", *(*(q + i) + m));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; m < row && j >= 0; j--, m++) {\n      printf(\"%d \", *(*(q + m) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "5627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = 0; i < row && (j - k) >= 0; i++, k++)\n      printf(\"%d\\n\", a[i][j - k]);\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = 0; j >= 0 && (i + k) < row; j--, k++)\n      cout << a[i + k][j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "5628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, k, j;\n  scanf(\"%d %d\", &row, &col);\n  for (k = 0; k < row; k++) {\n    for (i = 0; i < col; i++)\n      scanf(\"%d\", &(a[k][i]));\n  }\n  for (i = 0; i < 201; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0) {\n      if (0 <= j && j < col && 0 <= k && k < row)\n        printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5629", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j, k, l;\n\n  scanf(\"%d%d\", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (j = 0; j < col; j++) {\n    k = 0;\n    l = j;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    l = col - 1;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, n, m, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (m = 0; m < row; m++) {\n      if ((k - m) < 0) {\n        break;\n      }\n      for (n = k - m;;) {\n        if ((k - m) > (col - 1)) {\n          break;\n        }\n        cout << a[m][n] << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int shuzu[100][100];\n  int i, j, k, n, row, col, shuru;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuru);\n      shuzu[i][j] = shuru;\n    }\n  }\n  for (k = 0; k <= row + col - 2; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          cout << shuzu[i][j] << \"\\n\";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5632", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  int p = 0, q = 0;\n  while (p < row && q < col) {\n    int e = 0;\n    while (p + e < row && q - e >= 0) {\n      printf(\"%d\\n\", array[p + e][q - e]);\n      e++;\n    }\n    if (q < col - 1) {\n      q++;\n    } else if (q == col - 1) {\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int c = 0; c < m; c++)\n    for (int d = 0; d < n; d++)\n      scanf(\"%d \", &a[c][d]);\n  int *p[m];\n  for (int j = 0; j < m; j++)\n    p[j] = a[j];\n  for (int k = 0; k <= m + n - 2; k++)\n    for (int c = 0; c < m; c++)\n      for (int d = 0; d < n; d++) {\n        if (c + d == k)\n          printf(\"%d\\n\", *(p[c] + d));\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "5634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, sum, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  for (sum = 0; sum <= col - 1; sum++) {\n    for (i = 0; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n  for (sum = col; sum <= col + row - 2; sum++) {\n    for (i = sum - col + 1; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      cout << a[i][sum - i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100], row, col;\nvoid display(int step) {\n  int x, y, i;\n  if (step > row + col - 1)\n    return;\n  if (step < col) {\n    y = step - 1;\n    for (i = y; i >= 0 && y - i < row; i--)\n      cout << matrix[y - i][i] << endl;\n  } else {\n    x = step - col;\n    for (i = x; i < row && col - 1 + x - i >= 0; i++)\n      printf(\"%d\\n\", matrix[i][col - 1 + x - i]);\n  }\n  display(step + 1);\n}\nint main() {\n  int i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(matrix + i) + j);\n  }\n  display(1);\n}\n"}
{"label": "4", "index": "5636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[101][101];\n  int i, j, row, col;\n  \n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &num[i][j]);\n  printf(\"%d\", num[1][1]);\n  for (i = 3; i <= col + row; i++) {\n    for (j = 1; j < i; j++)\n      if (j <= row && i - j <= col)\n        printf(\"\\n%d\", num[j][i - j]);\n  }\n  \n  return 0;\n}\n"}
{"label": "4", "index": "5637", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, p, q;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < col; i++) {\n    p = 0;\n    q = i;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (q >= 0 && p < row);\n  }\n  for (i = 1; i < row; i++) {\n    p = i;\n    q = col - 1;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (p < row && q >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5638", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[150][150];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (int i = 0; i < row && i <= sum; i++)\n        cout << *(*(a + i) + (sum - i)) << endl;\n\n    } else {\n      for (int i = sum - col + 1; sum - i >= 0 && i < row; i++)\n        cout << *(*(a + i) + (sum - i)) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num[101][101];\nint main(void) {\n  int i = 0, j = 1, k = 1, x, y, row, col, n = 1;\n  scanf(\"%d%d\", &row, &col);\n  for (x = 0; x <= row - 1; x++)\n    for (y = 0; y <= col - 1; y++)\n      scanf(\"%d\", &num[x][y]);\n  printf(\"%d\\n\", num[0][0]);\n  while (n < row * col) {\n    int flag = 0;\n    while (j >= 0 && i <= row - 1 && j <= col - 1) {\n      printf(\"%d\\n\", num[i][j]);\n      i++;\n      j--;\n      n++;\n      flag = 1;\n    }\n    if (flag == 1)\n      k++;\n    if (k <= col - 1) {\n      i = 0;\n      j = k;\n    } else {\n      i = k - col + 1;\n      j = col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int n = 0; n < col; n++) {\n    for (int i = 0, j = n; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << \"\\n\";\n    ;\n  }\n  for (int n = 1; n < row; n++) {\n    for (int i = n, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int hang, lie;\n  scanf(\"%d %d \", &hang, &lie);\n  int i, j;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  int t;\n  for (t = 0; t <= hang + lie - 2; t++) {\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == t)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5642", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint x[1000][1000];\nvoid f(int i, int j) {\n  cout << x[i][j] << endl;\n  if (i == m && j == n)\n    return;\n  else if (j == 1 && i + 1 <= n)\n    f(1, i + 1);\n  else if (j == 1 && i + 1 > n)\n    f(i + j - n + 1, n);\n  else if (i == m && i + j <= n)\n    f(1, i + j);\n  else if (i == m && i + j > n)\n    f(i + j - n + 1, n);\n  else\n    f(i + 1, j - 1);\n}\nint main() {\n  scanf(\"%d %d \", &m, &n);\n  int i, j;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &x[i][j]);\n  f(1, 1);\n  return 0;\n}\n"}
{"label": "4", "index": "5643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i = 0, j = 0, k = 0;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int(*p)[100] = a;\n  for (k = 0; k < col; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << endl;\n  for (k = col; k <= (row - 1) + (col - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, row, col, x, y;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i <= col - 1; i++) {\n    x = 0;\n    y = i;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    x = i;\n    y = col - 1;\n    do {\n      cout << a[x][y] << \"\\n\";\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5645", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[100][100];\n  int i, j, k;\n\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d \", &array[i][j]);\n  }\n  if (col > row) {\n    for (k = 0; k <= row - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = row; k < col - 1; k++) {\n      int s = 0;\n      j = k;\n      i = 0;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != row);\n    }\n\n    for (k = 0; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k <= row - 1; k++) {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  if (col < row) {\n    for (k = 0; k <= col - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k < row - col; k++) {\n      int s = 0;\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != col);\n    }\n\n    for (k = row - col; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, *p[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    p[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", p[i] + j);\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i < m; i++) {\n      printf(\"%d\\n\", *(p[i] + k--));\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0; j--) {\n      cout << *(p[k++] + j) << \"\\n\";\n      if (k == m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "5647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0}, i, j, m, n = 1;\n  scanf(\"%d %d \", &r, &c);\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 1; i < c; i++) {\n    m = i;\n    n = 1;\n    while ((m >= 1) && (n <= r)) {\n      printf(\"%d\\n\", a[n][m]);\n      m--;\n      n++;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    m = c;\n    n = i;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5648", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int(*p)[100] = a;\n  int i, j;\n  int r, c;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++)\n    for (j = 0; j <= c - 1; j++)\n      cin >> *(*(p + i) + j);\n  int t;\n  for (t = 0; t <= c - 1; t++) {\n    for (i = 0, j = t; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n  for (t = 1; t <= r - 1; t++) {\n    for (i = t, j = c - 1; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n}\n"}
{"label": "4", "index": "5649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int(*p)[100] = a;\n  int i, j;\n  int r, c;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++)\n    for (j = 0; j <= c - 1; j++)\n      cin >> *(*(p + i) + j);\n  int t;\n  for (t = 0; t <= c - 1; t++) {\n    for (i = 0, j = t; (j >= 0) && (i <= r - 1); i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  for (t = 1; t <= r - 1; t++) {\n    for (i = t, j = c - 1; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n}\n"}
{"label": "4", "index": "5650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[99][99], i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  for (k = 0; k <= col - 1; k++) {\n    j = k;\n    i = 0;\n    do {\n      cout << array[i][j] << endl;\n      j = j - 1;\n      i = k - j;\n    } while (i != row && j != -1);\n  }\n  for (k = col; k <= col + row - 2; k++) {\n    j = col - 1;\n    i = k - j;\n    do {\n      cout << array[i][j] << \"\\n\";\n      j = j - 1;\n      i = i + 1;\n    } while (i != row && j != -1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < i + 1; j++) {\n      if (j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[j][i - j]);\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (i + j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n[100][100], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &n[i][j]);\n  for (i = 0; i <= col + row - 2; i++)\n    for (j = 0, k = i; j < row && k >= 0; j++, k--)\n      if (k < col)\n        printf(\"%d\\n\", n[j][k]);\n}\n"}
{"label": "4", "index": "5653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j;\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  int sum;\n  for (sum = 2; sum <= (col + row); sum++) {\n    if (sum <= col + 1) {\n      for (i = 1, j = sum - 1; i < sum && i <= row && j <= col; i++, j--) {\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n      }\n    } else {\n      for (i = sum - col, j = sum - i; i < sum && i <= row && j <= col;\n           i++, j--)\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (int k = 0; k < col; k++) {\n    if (k < row)\n      for (int i = 0; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = 0; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  for (int k = col; k < row + col - 1; k++) {\n    if (k < row)\n      for (int i = k - col + 1; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = k - col + 1; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[100][100];\n  int i, j, k;\n\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d \", &array[i][j]);\n    }\n  }\n  if (col > row) {\n    for (k = 0; k <= row - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = row; k < col - 1; k++) {\n      int s = 0;\n      j = k;\n      i = 0;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != row);\n    }\n\n    for (k = 0; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k <= row - 1; k++) {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  if (col < row) {\n    for (k = 0; k <= col - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k < row - col; k++) {\n      int s = 0;\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != col);\n    }\n\n    for (k = row - col; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h, l, i, j, sz[100][100];\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int k, n;\n  if (h > l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= l - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        if (k > l - 1 && k <= h - 1) {\n          for (i = k - l + 1; i <= k; i++) {\n            printf(\"\\n%d\", sz[i][k - i]);\n          }\n        } else {\n          for (i = k - l + 1; i <= h - 1; i++) {\n            printf(\"\\n%d\", sz[i][k - i]);\n          }\n        }\n      }\n    }\n  } else if (h < l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          cout << \"\\n\" << sz[i][k - i];\n        }\n      } else {\n        if (k > h - 1 && k <= l - 1) {\n          for (i = 0; i <= h - 1; i++) {\n            printf(\"\\n%d\", sz[i][k - i]);\n          }\n        } else {\n          for (i = k - l + 1; i <= h - 1; i++) {\n            printf(\"\\n%d\", sz[i][k - i]);\n          }\n        }\n      }\n    }\n  } else {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - h + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[100][100];\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> data[i][j];\n    }\n  }\n\n  for (int i = 0; i < col; i++) {\n    int m = 0, n = i;\n    while (true) {\n      cout << data[m][n] << endl;\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int m = i, n = col - 1;\n    while (true) {\n      printf(\"%d\\n\", data[m][n]);\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row == 1) {\n    for (j = 0; j < col; j++)\n      printf(\"%d\\n\", a[0][j]);\n\n  } else {\n    for (j = 0; j < col; j++) {\n      i = 0;\n      k = j;\n      while (k >= 0 && i < row) {\n        printf(\"%d\\n\", a[i][k]);\n        k--;\n        i++;\n      }\n    }\n    for (i = 1; i < row - 1; i++) {\n      j = col - 1;\n      k = i;\n      while (j >= 0 && k < row) {\n        printf(\"%d\\n\", a[k][j]);\n        j--;\n        k++;\n      }\n    }\n    cout << a[row - 1][col - 1] << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "5659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, *array, *p, i, j, t;\n  scanf(\"%d%d\", &row, &col);\n  array = (int *)calloc(row, col * sizeof(int));\n  for (p = array; p <= array + row * col - 1; p++)\n    scanf(\"%d\", p);\n  for (t = 0; t <= row + col - 2; t++)\n    for (i = 0; i <= t; i++) {\n      if (i > row - 1 || t - i > col - 1) {\n        continue;\n      }\n      printf(\"%d\\n\", *(array + i * col + t - i));\n    }\n}\n"}
{"label": "4", "index": "5660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, m, e, cishu, sz[100][100];\n  e = 0;\n  n = 0;\n  cishu = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  if (row > 1 && col > 1) {\n    for (i = 0, j = 0;; i++, j--) {\n      if (i == 0) {\n        m = j;\n      }\n      printf(\"%d\\n\", sz[i][j]);\n      cishu++;\n      if (cishu == row * col) {\n        break;\n      }\n      if ((j == 0 || i == row - 1) && e == 0) {\n        i = -1;\n        j = m + 2;\n        if (j == col)\n          e = 1;\n      }\n      if ((j == 0 || i == row - 1) && e == 1) {\n        j = col;\n        n++;\n        i = n - 1;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0; i < col; i++) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, m, n, k, num = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    j = i;\n    while (j >= 0 && i - j < row) {\n      cout << a[i - j][j] << \"\\n\";\n      j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = i;\n    while (j < row && col - 1 + i - j >= 0) {\n      cout << a[j][col - 1 + i - j] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[101][101], i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  col--;\n  row--;\n  for (i = 0; i <= row + col; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j <= col && j <= row)\n        printf(\"%d\\n\", array[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, t;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (t = 0; t < col; t++)\n    for (i = 0, j = t; i <= t && j >= 0 && i < row; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  for (t = 1; t <= row - 1; t++) {\n    for (i = t, j = col - 1; j >= 0 && i <= row - 1; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m;\n  int *p;\n  p = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; !((m == -1) || (i == row)); i++, m--)\n      printf(\"%d\\n\", *(p + i * col + m));\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; !((m == row) || (j == -1)); m++, j--)\n      cout << *(p + m * col + j) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, i, j;\n  int a[100][100];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < r + c - 1; i++) {\n    if (i < c && c <= r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c <= r && i < r)\n      for (j = i - c + 1; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c <= r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i < r && c > r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c > r && i < c)\n      for (j = 0; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c > r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, column, a[110][110] = {0}, i, j, row1 = 0, column1 = 0;\n  cin >> row >> column;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < column; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < (row + column - 1); i++) {\n    if (i < column)\n      column1 = i;\n    else\n      column1 = column - 1;\n    while (column1 >= 0) {\n      if ((i - column1) < row) {\n        printf(\"%d\\n\", *(*(a + i - column1) + column1));\n        column1--;\n      } else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0, k = 0, i, j, x, y, row, col, a[100][100], *p;\n  scanf(\"%d %d \", &row, &col);\n  n = row * col;\n  for (i = 0; i < row; i++) {\n    p = (int *)a + i * 100;\n    for (j = 0; j < col; j++)\n      cin >> *p++;\n  }\n  for (i = 0, j = 0; m < n; i = x, j = y) {\n    m++;\n    p = (int *)a + i * 100 + j;\n    cout << *p << \"\\n\";\n    x = i + 1;\n    y = j - 1;\n    if (x >= row || y < 0) {\n      x = 0;\n      y = ++k;\n      if (y >= col) {\n        x = y - col + 1;\n        y = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5668", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, m, n, a = 1;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  n = 0;\n  for (m = 0; m < col; m++) {\n    j = m;\n    i = n;\n    do {\n      if (i >= row || j < 0)\n        break;\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    do {\n      if (i >= row || j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n      i++;\n      j--;\n    } while (1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5669", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int num[120][120];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n\n  for (int k = 0; k <= col + row - 1; k++) {\n    int minRow, minCol;\n    if (k < col)\n      minRow = 0;\n    else\n      minRow = k - col + 1;\n\n    if (k < row)\n      minCol = 0;\n    else\n      minCol = k - row + 1;\n\n    for (int i = minRow; i <= k; i++) {\n      if ((k - i) >= minCol)\n        printf(\"%d\\n\", num[i][k - i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, zong, x, y, sum, zanshi;\n  int *c, *d;\n  scanf(\"%d %d\", &m, &n);\n  zong = m * n;\n  d = (int *)malloc(zong * sizeof(int));\n  c = d;\n  for (; c < d + zong; c++)\n    scanf(\"%d\", c);\n  for (sum = 2; sum <= m + n; sum++) {\n    for (y = 1; y < sum; y++) {\n      x = sum - y;\n      zanshi = n * (y - 1) + x;\n      if (x <= n && y <= m && zanshi >= 1 && zanshi <= zong)\n        printf(\"%d\\n\", *(d + zanshi - 1));\n    }\n  }\n}\n"}
{"label": "4", "index": "5671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a[100][100], row, col;\n\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    for (int j = 0; j < row; j++) {\n      if (j >= 0 && j < row && i - j >= 0 && i - j < col)\n        cout << a[j][i - j] << endl;\n      else\n        continue;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, m, sz[100][100], row, col, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &sz[a][b]);\n    }\n  }\n  if (row >= col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < (row + col - 1); k++) {\n      m = k - col + 1;\n      for (i = 0; (i < (row - m) && i <= (k - m)); i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  } else {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < row + col - 1; k++) {\n      m = k - col + 1;\n      for (i = 0; i < row - m; i++) {\n        cout << sz[i + m][k - i - m] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, k[100][100];\nvoid display(int i, int j) {\n  if (i >= m || j >= n || i < 0 || j < 0) {\n    return;\n  } else {\n    cout << k[i][j] << endl;\n    display(i + 1, j - 1);\n  }\n}\nint main() {\n  int i = 0, j = 0;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> k[i][j];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    display(0, j);\n  }\n  for (i = 1; i < m; i++) {\n    display(i, n - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, *p[100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p[i] + j);\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0, j = k - 1; i <= row - 1; i++, j--)\n      if (i <= row - 1 && j >= 0 && j <= col - 1 && i >= 0)\n        printf(\"%d\\n\", *(p[i] + j));\n  printf(\"%d\\n\", *(p[row - 1] + col - 1));\n  return 0;\n}\n"}
{"label": "4", "index": "5675", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  }\n  for (i = 0; i < col; i++) {\n    int k = 0;\n    j = i;\n    cout << *(*(array + k) + j) << endl;\n    while (k + 1 < row && j - 1 >= 0) {\n      k++;\n      j--;\n      cout << *(*(array + k) + j) << endl;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int k = col - 1;\n    j = i;\n    cout << *(*(array + j) + k) << endl;\n    while (j + 1 < row && k - 1 >= 0) {\n      j++;\n      k--;\n      cout << *(*(array + j) + k) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row;\n  int col;\n  int i;\n  int j;\n  int t;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (t = 0; t < col; t++) {\n    for (i = 0; i < row; i++) {\n      j = t - i;\n      if (j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  for (t = col; t <= col + row - 2; t++) {\n    for (j = col - 1;; j--) {\n      i = t - j;\n      if (j < 0) {\n        break;\n      }\n      if (i >= row) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, l, n, k, t;\n  int(*p)[100] = a;\n  int *q = a[0];\n  int row, column;\n  cin >> row >> column;\n  for (j = 0; j < row; j++) {\n    q = *(a + j);\n    for (l = 0; l < column; l++)\n      cin >> *(q + l); \n  }\n  for (i = 0; i <= row + column - 2; i++) {\n    for (k = 0; k < row; k++) {\n      for (t = 0; t < column; t++) {\n        if (k + t == i) {\n          cout << *(*(p + k) + t) << endl;\n        } \n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, zz[100][100], k, t, i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> zz[i][j];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    t = i;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    t = n - 1;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << \"\\n\";\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n < row - 1 + col; n++) {\n    if (n < col) {\n      for (i = n; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n    if (n > col - 1) {\n      for (i = col - 1; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        cout << a[n - i][i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, h;\n  cin >> row >> col;\n  cout << endl;\n  int a[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row != 1 && col != 1) {\n    for (j = 0; j <= col - 1; j++) {\n      k = 0;\n      h = j;\n      while (k <= row - 1 && h >= 0) {\n        cout << a[k][h] << endl;\n        k = k + 1;\n        h = h - 1;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      k = col - 1;\n      h = i;\n      while (h <= row - 1 && k >= 0) {\n        cout << a[h][k] << endl;\n        h = h + 1;\n        k = k - 1;\n      }\n    }\n  }\n  if (row == 1 && col != 1) {\n    for (i = 0; i <= col - 1; i++) {\n      cout << a[0][i] << endl;\n    }\n  }\n  if (col == 1 && row != 1) {\n    for (i = 0; i <= row - 1; i++) {\n      cout << a[i][0] << endl;\n    }\n  }\n  if (row == 1 && col == 1) {\n    cout << a[0][0] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5681", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int m = 0; m < col + row - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if ((i + j) == m)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, n, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (n = 0; n < row + col - 1; n++)\n    for (i = 0; i <= n; i++) {\n      if (i < row && n - i < col)\n        cout << a[i][n - i] << endl;\n      else\n        continue;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &m, &n);\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < m + n - 1; i++) {\n    for (int j = 0; j <= i; j++) {\n      if ((j < m) && (i - j < n))\n        cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, m, sz[100][100], row, col, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      cin >> sz[a][b];\n    }\n  }\n  if (row >= col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < (row + col - 1); k++) {\n      m = k - col + 1;\n      for (i = 0; (i < (row - m) && i <= (k - m)); i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  } else {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < row + col - 1; k++) {\n      m = k - col + 1;\n      for (i = 0; i < row - m; i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) {\n    k = i;\n    j = 0;\n    while ((k >= 0) && (j <= row - 1)) {\n      printf(\"%d\\n\", array[j][k]);\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    j = col - 1;\n    while ((k <= row - 1) && (j >= 0)) {\n      printf(\"%d\\n\", array[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100];\n  int xx_row, sx_row, xx_col, sx_col;\n  int i, j, c, r;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  xx_row = 0;\n  sx_row = row - 1;\n  xx_col = 0;\n  sx_col = col - 1;\n  if (col > row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (c = sx_row + 1; c < sx_col; c++) {\n      j = c;\n      for (i = 0; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n    for (r = xx_row; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col < row) {\n    for (c = xx_col; c <= sx_col; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r < row - col; r++) {\n      i = r;\n      for (j = sx_col; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = row - col; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col == row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << *(*(array + j) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  printf(\"%d\\n\", a[0][0]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j + 1 && i < m; i++) {\n      printf(\"%d\\n\", a[i][j - i]);\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < n && j < m - i; j++) {\n      printf(\"%d\\n\", a[j + i][n - 1 - j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, **p, num;\n  int i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  num = row * col;\n  p = (int **)malloc(row * sizeof(int));\n  for (i = 0; i < row; i++) {\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  for (i = 0; i < col + row - 1; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0 && k <= row) {\n      if (j < col && k < row) {\n        printf(\"%d\\n\", *(*(p + k) + j));\n      }\n      k = k + 1;\n      j = j - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, k[100][100];\nvoid display(int i, int j) {\n  if (i >= m || j >= n || i < 0 || j < 0) {\n    return;\n  } else {\n    cout << k[i][j] << \"\\n\";\n    display(i + 1, j - 1);\n  }\n}\nint main() {\n  int i = 0, j = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> k[i][j];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    display(0, j);\n  }\n  for (i = 1; i < m; i++) {\n    display(i, n - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5691", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  int a[100][100] = {0};\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row >= col) {\n    for (i = 0; i < row + col - 1; i++) {\n      if (i >= 0 && i < col) {\n        for (j = i; j >= 0; j--) {\n          printf(\"%d\\n\", a[i - j][j]);\n        }\n      }\n      if (i >= col && i < row) {\n        for (j = col - 1; j >= 0; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n      if (i > row - 1 && i < (row + col) - 1) {\n        for (j = col - 1; j > i - row; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n    }\n  }\n  if (col > row) {\n    for (j = 0; j < row + col; j++) {\n      if (j >= 0 && j < row) {\n        for (i = 0; i <= j; i++) {\n          printf(\"%d\\n\", a[i][j - i]);\n        }\n      }\n      if (j >= row && j < col) {\n        for (i = 0; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n      if (j > col - 1 && j < (row + col) - 1) {\n        for (i = j - col + 1; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5692", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, n, m, row, col;\n  int a[200][200] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 1; i < row + col + 1; i++)\n    for (j = 1; j <= i; j++)\n      if (a[j][i - j] != 0)\n        printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, r, s, a[100][100];\n  s = 0;\n  scanf(\"%d %d\", &r, &c);\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  while (c * r >= s) {\n    for (int i = 0; i < r; i++) {\n      for (int j = 0; j < c; j++) {\n        if (i + j == s) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n    s++;\n  }\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "4", "index": "5694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *a[101][101], lie, hang, i, j, h, l;\n  cin >> hang >> lie;\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      a[i][j] = (int *)malloc(sizeof(int));\n\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      scanf(\"%d\", a[i][j]);\n  for (j = 1; j <= lie; j++) {\n    h = 1;\n    l = j;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= hang; i++) {\n    l = lie;\n    h = i;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5695", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], b[10000], i, j, sum, t = 0;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++) {\n      cin >> a[i][j];\n    }\n  for (sum = 2; sum <= (n + m); sum++) {\n\n    for (j = 1; j <= n; j++)\n\n    {\n      if ((sum - j) > 0 && (sum - j) <= m) {\n        t++;\n        b[t] = a[j][sum - j];\n      }\n    }\n  }\n\n  for (i = 1; i <= (m * n); i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5696", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100], i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row) {\n        cout << array[j][i - j] << endl;\n      }\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (i = col - 1; i >= 0; i--) {\n      if (col - 1 + j - i < row) {\n        cout << array[col - 1 - i + j][i] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], row, col, t = 0, flag = 0, max;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  max = (row > col) ? row : col;\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      printf(\"%d\\n\", a[i][j]);\n    if (i == max - 1 && j == max - 1)\n      break;\n    if (flag == 0) {\n      if (j == 0 && i == max - 1) {\n        flag = 1;\n        t = max;\n        j = max - 1;\n      } else if (j == 0) {\n        t = t + 1;\n        j = t;\n      } else\n        j = j - 1;\n    } else {\n      if (i == max - 1) {\n        t = t + 1;\n        j = max - 1;\n      } else\n        j = j - 1;\n    }\n    i = t - j;\n  }\n}\n"}
{"label": "4", "index": "5698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100], j, k;\n\n  cin >> row;\n  cin >> col;\n  for (k = 0; k < row; k++)\n    for (j = 0; j < col; j++)\n      cin >> a[k][j];\n  for (k = 0; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if ((k - j >= 0) && (k - j) < row)\n        printf(\"%d\\n\", *(a[k - j] + j));\n\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if ((k + col - 1 - j) < row)\n        cout << *(a[k + col - 1 - j] + j) << endl;\n\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int array[110][110];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    if (i < col) {\n      for (int j = 0; j < row && j <= i; j++)\n        cout << *(*(array + j) + i - j) << endl;\n    } else {\n      for (int j = col - 1; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", *(*(array + i - j) + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (j = 0; j <= row - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      for (i = 0; i <= row - 1; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      for (j = col - 1; j >= col + i - row; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  } else {\n    if (col < row) {\n      for (j = 0; j <= col - 1; j++) {\n        for (i = 0; i <= j; i++) {\n          cout << a[i][j - i] << endl;\n        }\n      }\n      for (i = 1; i <= row - col - 1; i++) {\n        for (j = col - 1; j >= 0; j--) {\n          cout << a[i + col - j - 1][j] << endl;\n        }\n      }\n      for (i = row - col; i <= row - 1; i++) {\n        for (j = col - 1; j >= col - row + i; j--) {\n          cout << a[i + col - 1 - j][j] << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], r, c;\nint judge(int i, int c) {\n  if (i - c >= 0)\n    return i - c + 1;\n  else\n    return 0;\n}\nint main() {\n  cin >> r >> c;\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int i = 0; i < r + c - 1; i++) {\n    for (int j = judge(i, c); j <= i && j < r && i - j < c; j++) {\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5702", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int i = 0; i < row + col - 1; i++) {\n    for (int j = 0; j < row; j++) {\n      for (int k = 0; k < col; k++) {\n        if (j + k == i)\n          printf(\"%d\\n\", *(*(a + j) + k));\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row >= col) {\n    for (n = 0; n <= col - 1; n++)\n      for (i = 0; i <= n; i++)\n        cout << a[i][n - i] << \"\\n\";\n    for (n = col; n <= row - 1; n++)\n      for (i = n - col + 1; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n\n  else {\n    for (n = 0; n <= row - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= col - 1; n++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = col; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, *p;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(sizeof(int) * row * col);\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n  printf(\"%d\\n\", *p);\n  p++;\n  for (i = 1; i < col; i++, p++)\n    for (j = 0, k = 0; k <= i && (i + j) < (row * col); k++, j = j + col - 1)\n      cout << *(p + j) << \"\\n\";\n  p += col - 1;\n  for (i = 1; i <= (row - 1); i++, p += col)\n    for (j = 0, k = 0; k < (row - i) && k < col && *(p + j) != 0;\n         k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n}\n"}
{"label": "4", "index": "5705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (int i = 0; i < m + n; i++) {\n    int j = 0;\n    while (j <= i) {\n      if (j < m && i - j < n) {\n        cout << a[j][i - j] << endl;\n      }\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, col, row, array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  int csx, rxx = 0;\n  for (i = 0; i < col; i++) {\n    csx = i;\n    rxx = 0;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      cout << array[rxx][csx] << \"\\n\";\n      csx--;\n      rxx++;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    rxx = j;\n    csx = col - 1;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "4", "index": "5707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int i, j, u, t = 0;\n  int row, col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (u = 0;; u++) {\n      if (u >= row || j - u < 0)\n        break;\n      printf(\"%d\\n\", a[u][j - u]);\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (u = 1;; u++) {\n      if (u + j - 1 >= row || col - u < 0)\n        break;\n\n      printf(\"%d\\n\", a[u + j - 1][col - u]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, row, col, k;\n  scanf(\"%d %d\", &m, &n);\n  for (row = 0; row < m; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (col = k, row = k - col; col < m + n - 1 && col >= 0; col--, row++) {\n      if (col >= n) {\n        continue;\n      } else {\n        if (row >= m) {\n          continue;\n        } else\n          printf(\"%d\\n\", sz[row][col]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5709", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint row = 0, col = 0;\nvoid Input(int (*array)[105]) {\n  cin >> row >> col;\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n}\nvoid Diagonal(int (*array)[105], int x, int y) {\n  for (int i = 0;; i++) {\n    if (x + i > row - 1 || y - i < 0)\n      break;\n    else {\n      if (x == 0 && y == 0) {\n        cout << **array;\n      } else {\n        cout << endl << *(*(array + x + i) + y - i);\n      }\n    }\n  }\n  return;\n}\nvoid Scan(int (*array)[105], int x, int y) {\n  Diagonal(array, x, y);\n  if (y < col - 1)\n    Scan(array, x, y + 1);\n  else if (x < row - 1)\n    Scan(array, x + 1, y);\n  else\n    return;\n}\nint main() {\n  int a[105][105];\n  Input(a);\n  Scan(a, 0, 0);\n  return 0;\n}\n"}
{"label": "4", "index": "5710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int x, int y) {\n  if (x <= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int a[100][100], row, col, ROW, COL, i, m = 1, n = 0, x;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n  x = min(ROW, COL);\n  row = 0;\n  col = 0;\n  for (i = 0; i < x + x * (x - 1) / 2; i++) {\n    cout << a[row][col] << \"\\n\";\n    n++;\n    if (n != m) {\n      row++;\n      col--;\n    } else if (n == m) {\n      row = 0;\n      col += m;\n      m++;\n      n = 0;\n    }\n  }\n  if (COL >= ROW) {\n    row = 0;\n    col = ROW;\n    m = col + 1;\n    for (i = 0; i < ROW * (COL - ROW); i++) {\n      cout << a[row][col] << \"\\n\";\n      if (row != ROW - 1) {\n        row++;\n        col--;\n      } else {\n        row = 0;\n        col = m;\n        m++;\n      }\n    }\n    row = 1;\n    col = COL - 1;\n    m = ROW - 1;\n    n = 0;\n    for (i = 0; i < ROW * (ROW - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  if (COL < ROW) {\n    row = 1;\n    col = COL - 1;\n    m = 2;\n    for (i = 0; i < COL * (ROW - COL); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (col != 0) {\n        row++;\n        col--;\n      } else {\n        row = m;\n        col = COL - 1;\n        m++;\n      }\n    }\n    row = ROW - COL + 1;\n    col = COL - 1;\n    m = COL - 1;\n    n = 0;\n    for (i = 0; i < COL * (COL - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int *a, i, j, row, col;\n  cin >> row >> col;\n  a = (int *)calloc(200, 200 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", a + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 1; (i < row + 1) && (i <= j + 1); i++)\n      printf(\"%d\\n\", *(a + (i - 1) * col + j + 1 - i));\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 1; (j <= col) && (j < row + 1 - i); j++)\n\n      printf(\"%d\\n\", *(a + (i + j - 1) * col + col - j));\n  }\n}\n"}
{"label": "4", "index": "5712", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid prt(int a[100][100], int i, int j, int m, int n) {\n  static int t = 0;\n  printf(\"%d\\n\", a[i][j]);\n  if (i == m - 1 || j == 0) {\n    t++;\n    if (t < n)\n      prt(a, 0, t, m, n);\n    else if (t < m + n - 1)\n      prt(a, t - n + 1, n - 1, m, n);\n  } else\n    prt(a, i + 1, j - 1, m, n);\n}\nint main() {\n  int i, j, m, n, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  prt(a, 0, 0, m, n);\n  return 0;\n}\n"}
{"label": "4", "index": "5713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[99][99];\n  int row, col, i, j, t = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t < col) {\n      for (i = 0; i <= t && i <= row - 1; i++) {\n        printf(\"%d\\n\", array[i][t - i]);\n      }\n    } else {\n      for (i = t + 1 - col; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row - 1 || i - j > col - 1)\n        continue;\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, s, *p = NULL;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (s = 0; s <= row + col - 2; s++) {\n    for (i = 0; i < row; i++)\n      if (s - i < col && s - i >= 0) {\n        cout << *(*(a + i) + s - i) << \"\\n\";\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k = 1;\n  int a[200][200] = {0};\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      cin >> a[i][j];\n  }\n  cout << a[0][0];\n  while (k <= row + col - 2) {\n    for (i = 0; i <= row - 1; i++) {\n      if (k - i >= 0 && k - i < col) {\n        printf(\"\\n\");\n        printf(\"%d\", a[i][k - i]);\n      }\n    }\n    k++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int array[100][100] = {0};\n  int i, j, n;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (n = 0; n < row + col; n++) {\n    for (i = 0, j = n - 1; i < n, j >= 0; i++, j--) {\n      if (i < row && j < col)\n        printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5718", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n[100][100], col, row, COL, ROW;\n  scanf(\"%d %d \", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &n[row][col]);\n  }\n  for (i = 0; i < COL + ROW - 1; i++) {\n    if (i < COL) {\n      col = i;\n      row = 0;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    } else if (i >= COL) {\n      col = COL - 1;\n      row = i - COL + 1;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, p, q;\n  int s[120][120];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  l = 0;\n  i = 1;\n  j = 1;\n  while (l < n * m) {\n    printf(\"%d \", s[i][j]);\n    l++;\n    if ((j == 1) && (i + 1 <= n)) {\n      j = i + 1;\n      i = 1;\n    } else if ((j == 1) && (i + 1 > n)) {\n      i = i - n + 2;\n      j = n;\n    } else if (i == m) {\n      if (j + i <= n) {\n        j = j + i;\n        i = 1;\n      } else {\n        i = j - n + m + 1;\n        j = n;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "5720", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  memset(array, 0, sizeof(array));\n  int i, j, k, row, col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << array[i][j] << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i;\n  int a[10010], *p = a;\n  for (i = 0; i < row * col; i++) {\n    scanf(\"%d \", p);\n    p++;\n  }\n  p = a;\n  for (int c = 0; c < row + col; c++) {\n    for (i = c; i >= 0; i--) {\n      if (i < col && c - i < row) {\n        cout << *(p + i + (c - i) * col) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5722", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, k, l, max; \n  cin >> row >> col;          \n  if (row > col)              \n    max = row;\n  else\n    max = col;\n  int a[max][max];         \n  memset(a, 0, sizeof(a)); \n  for (i = 0; i < row; i++)\n    for (k = 0; k < col; k++)\n      cin >> a[i][k]; \n  for (i = 0; i < max * 2 - 1; i++) {\n    if (i < max) { \n      for (k = 0, l = i - k; k < max && l >= 0; k++, l--)\n        if (a[k][l] != 0) \n          cout << a[k][l] << endl;\n    } else \n      for (k = max - 1, l = i - k; k > 0 && l < max; k--, l++)\n        if (a[l][k] != 0)\n          cout << a[l][k] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0, i, j, r, c, t, *a, p;\n  cin >> r >> c;\n  a = (int *)calloc(r * c, sizeof(int));\n  for (i = 0; i < r * c; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < c; i++) {\n    j = 0;\n    t = i;\n    while (t >= 0 && j < r) {\n      printf(\"%d\", *(a + j * c + t));\n      cout << \" \";\n      t--;\n      j++;\n    }\n  }\n\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    t = i;\n    while (t < r && j >= 0) {\n      printf(\"%d\", *(a + t * c + j));\n      if (!(j == c - 1 && t == r - 1))\n        printf(\" \");\n      j--;\n      t++;\n    }\n  }\n}\n"}
{"label": "4", "index": "5724", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  int p = 0, q = 0;\n  while (p < row && q < col) {\n    int e = 0;\n    while (p + e < row && q - e >= 0) {\n      printf(\"%d\\n\", array[p + e][q - e]);\n      e++;\n    }\n    if (q < col - 1) {\n      q++;\n    } else {\n      if (q == col - 1)\n        p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5725", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, *p[100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = i; j >= 0; j--) {\n      if (i - j >= row || j >= col)\n        continue;\n      else\n        printf(\"%d \", *(p[i - j] + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "5726", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int line, row, i, j, m, n;\n  scanf(\"%d %d\", &row, &line);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= line - 1; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (j = 0; j <= line - 1; j++) {\n    m = 0;\n    n = j;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  for (i = 1; i <= row - 1; i++) {\n    m = i;\n    n = line - 1;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  int *p, *q;\n  q = (int *)calloc(10001, sizeof(int));\n  scanf(\"%d %d\", &n, &m);\n  for (p = q; p < q + n * m; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m == 1) {\n    for (p = q; p < q + n * m; p++)\n      printf(\"%d\\n\", *p);\n  } else {\n    for (i = 0; i < m; i++) {\n      for (p = q + i; (p <= q + i + (m - 1) * i) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n    for (i = 2; i <= n; i++) {\n      for (p = q + m * i - 1;\n           (p <= q + m * i - 1 + (m - 1) * (m - 1)) && (p < q + n * m);\n           p = p + m - 1)\n        printf(\"%d\\n\", *p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5728", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[101][101];\n  int row, col, i, j, k;\n  int(*p)[101] = array;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  printf(\"%d\\n\", *(*(p + 0) + 0));\n  for (i = 1; i < col; i++)\n    for (k = i, j = 0; k >= 0 && j < row; k--) {\n      printf(\"%d\\n\", *(*(p + j) + k));\n      if (k - 1 >= 0)\n        j++;\n    }\n  for (i = 1; i < row; i++)\n    for (j = i, k = col - 1; k >= 0 && j < row; j++) {\n      cout << *(*(p + j) + k) << endl;\n      if (j + 1 < row)\n        k--;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, n, row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      cin >> a[i][j];\n  m = row + col - 2;\n  for (n = 0; n <= m; n++)\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= col - 1; j++)\n        if (i + j == n)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, k, j;\n  scanf(\"%d %d\", &row, &col);\n  for (k = 0; k < row; k++) {\n    for (i = 0; i < col; i++)\n      scanf(\"%d\", &(a[k][i]));\n  }\n  for (i = 0; i < 201; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0) {\n      if (0 <= j && j < col && 0 <= k && k < row)\n        printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p, row, col, array[105][105], i, j;\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> array[i][j];\n    }\n  for (j = 1; j <= col; j++) {\n    p = &array[1][j];\n    for (i = 1; i <= j && i <= row; i++) {\n      printf(\"%d\\n\", *p);\n      p = p + 104;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    p = &array[i][col];\n    for (j = 1; j <= col && j + i <= row + 1; j++) {\n      cout << *p << \"\\n\";\n      p = p + 104;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  int i, j;\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < col - 1; j++) {\n    int a = j;\n    for (i = 0; a >= 0 && i < row; i++) {\n      cout << *(*(p + i) + a) << \"\\n\";\n      a--;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    int a = i;\n    for (j = col - 1; a < row && j >= 0; j--) {\n      cout << *(*(p + a) + j) << \"\\n\";\n      a++;\n    }\n  }\n}\n"}
{"label": "4", "index": "5733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num = 0, i, j, row, col, a[105][105], h;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (h = 0; h < col + row - 1; h++) {\n    if (h < col) {\n      for (i = 0; i < row && h - i >= 0 && h - i < col; i++) {\n        j = h - i;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    } else\n      for (j = col - 1; j >= 0 && h - j >= 0 && h - j < row; j--) {\n        i = h - j;\n        cout << a[i][j] << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "5734", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j, a, b;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    a = i;\n    b = 0;\n    for (j = 0; j <= i; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (b == row)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    b = i;\n    a = col - 1;\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (a == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110] = {0};\n  int m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    k = j;\n    for (i = 0; i <= m - 1; i++) {\n      printf(\"%d\\n\", *(*(a + i) + k));\n      k--;\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    j = n - 1;\n    for (k = i; k <= m - 1; k++) {\n      printf(\"%d\\n\", *(*(a + k) + j));\n      j--;\n      if (j < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, **p, k;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      printf(\"%d\\n\", *(*(p + i) + k));\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      printf(\"%d\\n\", *(*(p + k) + j));\n      k++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid bianli() {\n  int a[1000][1000], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      cout << a[i][j] << \" \";\n      i++;\n      j--;\n      if (i >= row || j < 0) {\n        break;\n      }\n    }\n  }\n}\nint main() {\n  bianli();\n  return 0;\n}\n"}
{"label": "4", "index": "5738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int u[100][100], i, j, k, row, col, m, Col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &u[i][j]);\n    }\n  }\n  printf(\"%d\\n\", u[0][0]);\n  for (k = 1; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if (k > col - 1) {\n        break;\n      }\n      if (k - j > row - 1) {\n        break;\n      }\n\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n\n  for (k = col; k < col + row - 2; k++) {\n    for (j = col - 1; j >= 0; j--) {\n\n      if (k - j > row - 1) {\n        break;\n      }\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n  if (row == 1)\n    ;\n  else {\n    printf(\"%d\\n\", u[row - 1][col - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j;\n  int c[100][100];\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  for (i = 0; i < b; i++) {\n    for (j = 0; j <= i && j < a; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n  for (i = b; i < a + b - 1; i++) {\n    for (j = i + 1 - b; j < a && j <= i; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n}\n"}
{"label": "4", "index": "5740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[110][110];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1; j > i + col - 1 - row && j >= 0; j--)\n      cout << *(*(a + i + col - j - 1) + j) << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "5741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int row, col;\n  int i, j, he;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (he = 0; he < row + col - 1; he++) {\n    for (j = he; j >= 0; j--) {\n      if (j >= col) {\n        continue;\n      }\n      i = he - j;\n      if (i >= row) {\n        continue;\n      }\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p;\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (i = 0; i < row * col; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 1; i <= col; i++) {\n    j = i;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n  for (i = 2; i <= row; i++) {\n    j = i * col;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n}\n"}
{"label": "4", "index": "5743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int heng, lie, i, j, k, l;\n  scanf(\"%d %d\", &heng, &lie);\n\n  int **p;\n  p = (int **)malloc(heng * sizeof(int *));\n  for (i = 0; i < heng; i++) {\n    *(p + i) = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < lie; j++) {\n    for (k = j, l = 0; k >= 0; k--, l++) {\n      if (l < heng)\n        printf(\"%d\\n\", *(*(p + l) + k));\n      else\n        break;\n    }\n  }\n  for (j = lie; j < heng + lie - 1; j++) {\n    for (k = lie - 1, l = j - (lie - 1); k >= 0; k--, l++) {\n      if (l < heng)\n        printf(\"%d\\n\", *(*(p + l) + k));\n      else\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "5744", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, m, M, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (row > col) {\n    M = row;\n    m = col;\n  } else {\n    M = col;\n    m = row;\n  }\n  for (k = 0; k < m; k++) {\n    for (i = 0; i <= k; i++)\n      printf(\"%d\\n\", a[i][k - i]);\n  }\n  if (row > col) {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i + k + 1][m - i - 1]);\n    }\n  } else {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i][m - i + k]);\n    }\n  }\n  for (k = 1; k < m; k++) {\n    for (i = 0; i < m - k; i++)\n      printf(\"%d\\n\", a[row - m + i + k][col - i - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; k < row && j > -1; j--, k++) {\n      printf(\"%d\\n\", array[k][j]);\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i, k = col - 1; j < row && k > -1; j++, k--) {\n      printf(\"%d\\n\", array[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5746", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], col, row, t, i, j;\n  scanf(\"%d %d \", &row, &col);\n  if (row > col)\n    t = row;\n  else\n    t = col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n\n  for (i = 2; i <= 2 * t; i++) {\n    for (j = 1; j < i; j++) {\n      if (j <= row && i - j <= col) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i != m; i++) {\n    for (int j = 0; j != n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i != n; i++) {\n    for (int j = 0;; j++) {\n      if (j == m || i - j < 0)\n        break;\n      cout << a[j][i - j] << endl;\n    }\n  }\n  for (int i = 1; i != m; i++) {\n    for (int j = 0;; j++) {\n      if (i + j == m || n - 1 - j < 0)\n        break;\n      printf(\"%d\\n\", a[i + j][n - 1 - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5748", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int count;\n  int i, j;\n\n  int array[100][100];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  int x = 0, y = 0;\n\n  for (count = 1; count <= col; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    y = y + 1;\n  }\n\n  x = 1;\n  y = col - 1;\n  for (count = 2; count <= row; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    x = x + 1;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int row, col, i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0, j = k - i; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = col; k <= row + col - 2; k++)\n    for (j = col - 1, i = k - j; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "5750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[101][101], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  col--;\n  row--;\n  for (i = 0; i <= row + col; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j <= col && j <= row)\n        cout << array[j][i - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5751", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[300][300];\n  int r, c, m, i, j, n, k, a;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &sz[i][j]);\n\n  for (i = 0; i <= r + c - 2; i++) {\n    for (j = 0;; j++) {\n      k = i - j;\n      if (k < 0)\n        break;\n      if (j < r && k < c)\n        printf(\"%d\\n\", sz[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, h;\n  cin >> row >> col;\n  cout << endl;\n  int a[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row != 1 && col != 1) {\n    for (j = 0; j <= col - 1; j++) {\n      k = 0;\n      h = j;\n      while (k <= row - 1 && h >= 0) {\n        cout << a[k][h] << endl;\n        k = k + 1;\n        h = h - 1;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      k = col - 1;\n      h = i;\n      while (h <= row - 1 && k >= 0) {\n        cout << a[h][k] << endl;\n        h = h + 1;\n        k = k - 1;\n      }\n    }\n  }\n  if (row == 1 && col != 1) {\n    for (i = 0; i <= col - 1; i++)\n      cout << a[0][i] << endl;\n  }\n  if (col == 1 && row != 1) {\n    for (i = 0; i <= row - 1; i++)\n      cout << a[i][0] << endl;\n  }\n  if (row == 1 && col == 1) {\n    printf(\"%d\\n\", a[0][0]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100] = {0};\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  int step = 0;\n  i = 0;\n  j = 0;\n  int t;\n\n  if (row * col > 0) {\n    printf(\"%d\", a[0][0]);\n    step++;\n  }\n\n  while (step < row * col) {\n\n    if (i + 1 < 0 || j - 1 < 0) {\n\n      t = i;\n      i = j;\n      j = t + 1;\n      if (i < row && j < col) {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n      if (i < row && j < col) {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r, c, *p, n, m, i, j, k;\nint main() {\n  void x(int i);\n  void y(int i);\n  scanf(\"%d %d\", &r, &c);\n  n = r * c;\n  m = r + c - 2;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i < c; i++)\n    x(i);\n  for (i = c; i <= m; i++)\n    y(i);\n}\nvoid x(int i) {\n  int a;\n  for (a = i; a >= 0 && (i - a) < r; a--) {\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n  }\n}\nvoid y(int i) {\n  int a;\n  for (a = c - 1; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\n"}
{"label": "4", "index": "5755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m;\n  int *p;\n  p = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; !((m == -1) || (i == row)); i++, m--)\n      printf(\"%d\\n\", *(p + i * col + m));\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; !((m == row) || (j == -1)); m++, j--)\n      printf(\"%d\\n\", *(p + m * col + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n    int c = 0;\n    for (i = m; i >= 0 && c < a; i--, c++)\n      printf(\"%d\\n\", n[c][i]);\n  }\n  int y;\n\n  for (x = 1; x < a; x++) {\n    y = b - 1;\n    for (j = x; j < a && y >= 0; j++, y--)\n      printf(\"%d\\n\", n[j][y]);\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "5757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, i, j, r, c, t, *a, p;\n  scanf(\"%d%d\", &r, &c);\n  a = (int *)calloc(r * c, sizeof(int));\n  for (i = 0; i < r * c; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < c; i++) {\n    j = 0;\n    t = i;\n    while (t >= 0 && j < r) {\n      printf(\"%d\", *(a + j * c + t));\n      printf(\" \");\n      t--;\n      j++;\n    }\n  }\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    t = i;\n    while (t < r && j >= 0) {\n      printf(\"%d\", *(a + t * c + j));\n      if (!(j == c - 1 && t == r - 1))\n        printf(\" \");\n      j--;\n      t++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint row, col;\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 2; i <= row + col; i++)\n    for (int j = max(1, i - col); j <= min(row, i - 1); j++)\n      cout << *(*(a + j) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, column, a[110][110] = {0}, i, j, row1 = 0, column1 = 0;\n  cin >> row >> column;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < column; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < (row + column - 1); i++) {\n    if (i < column) {\n      column1 = i;\n    } else {\n      column1 = column - 1;\n    }\n    while (column1 >= 0) {\n      if ((i - column1) < row) {\n        cout << *(*(a + i - column1) + column1) << endl;\n        column1--;\n      } else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5760", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d%d\", &col, &row);\n  int i, j;\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  int p;\n  for (p = 0; p < 2 * (row > col ? row : col) - 1; p++) {\n    int k;\n    for (k = 0; (p - k) >= 0; k++) {\n      if (k < col && (p - k) < row)\n        printf(\"%d\\n\", a[k][p - k]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, r, c, s;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (s = 0; s < r + c - 1; s++) {\n    for (i = 0; i <= s; i++) {\n      if (i <= r - 1 && s - i <= c - 1) {\n        if (i == 0 && s - i == 0)\n          printf(\"%d\", a[0][0]);\n        else\n          cout << \"\\n\" << a[i][s - i];\n      }\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "4", "index": "5762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, a[101][101], t;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= row + col - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row && (i - j) < col)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "4", "index": "5763", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i;\n  int a[10010], *p = a;\n  for (i = 0; i < row * col; i++) {\n    cin >> *p;\n    p++;\n  }\n  p = a;\n  for (int c = 0; c < row + col; c++) {\n    for (i = c; i >= 0; i--) {\n      if (i < col && c - i < row) {\n        cout << *(p + i + (c - i) * col) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[101][101];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int a;\n  for (i = 1; i < col; i++) {\n    a = i;\n    for (j = 0; j < row && j <= i; j++) {\n      printf(\"\\n%d\", sz[j][a]);\n      a--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    a = j;\n    for (i = col - 1; a < row && i >= 0; i--) {\n      printf(\"\\n%d\", sz[a][i]);\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5765", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void print(int *p[101], int row, int col);\n  int *p[101];\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)calloc(101, sizeof(int));\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", (p[i] + j));\n  }\n  print(p, row, col);\n\n  return 0;\n}\n\nvoid print(int *p[101], int row, int col) {\n  int k, i;\n  for (k = 0; k < (row + col - 1); k++) {\n    for (i = 0; (i < k + 1) && (i < row); i++) {\n      if ((k - i) < col)\n        printf(\"%d\\n\", *(p[i] + (k - i)));\n    }\n  }\n}\n"}
{"label": "4", "index": "5766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row == 1) {\n    for (j = 0; j < col; j++)\n      printf(\"%d\\n\", a[0][j]);\n\n  } else {\n    for (j = 0; j < col; j++) {\n      i = 0;\n      k = j;\n      while (k >= 0 && i < row) {\n        printf(\"%d\\n\", a[i][k]);\n        k--;\n        i++;\n      }\n    }\n    for (i = 1; i < row - 1; i++) {\n      j = col - 1;\n      k = i;\n      while (j >= 0 && k < row) {\n        printf(\"%d\\n\", a[k][j]);\n        j--;\n        k++;\n      }\n    }\n    printf(\"%d\\n\", a[row - 1][col - 1]);\n  }\n}\n"}
{"label": "4", "index": "5767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, **p, col, row, sum;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", *(p + i) + j);\n\n  k = row + col;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < row && j < col)\n        printf(\"\\n%d\", *(*(p + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "5768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, s;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++) \n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) \n  {\n    s = i;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n  for (i = col; i < col + row - 1; i++) \n  {\n    s = col - 1;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5769", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, column, a[110][110] = {0}, i, j, row1 = 0, column1 = 0;\n  scanf(\"%d %d \", &row, &column);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < column; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < (row + column - 1); i++) {\n    if (i < column)\n      column1 = i;\n    else\n      column1 = column - 1;\n    while (column1 >= 0) {\n      if ((i - column1) < row) {\n        cout << *(*(a + i - column1) + column1) << endl;\n        column1--;\n      } else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, x, sum, y, z;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  sum = 0;\n  j = 0;\n  x = 0;\n  y = 1;\n  z = 0;\n  if (col >= row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        if (j + row + 1 < col) {\n          j = j + row + 1;\n          i = 0;\n        } else if (j + row + 1 >= col) {\n          j = j + row - x;\n          i = 1 + x;\n          x++;\n        }\n      } else if (j < 0 && i < row) {\n        j = j + 1 + y;\n        i = 0;\n        y++;\n      }\n      if (sum == col * row)\n        break;\n    }\n  } else if (col < row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        j = col - 1;\n        i = i - col + 1 + x;\n        x++;\n      } else if (i < row && j < 0) {\n        if (j + 1 + y < col) {\n          j = j + 1 + y;\n          i = 0;\n          y++;\n        } else {\n          if (j + 1 + y >= col) {\n            j = col - 1;\n            i = z + 1;\n            z++;\n          }\n        }\n      }\n      if (sum == col * row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int x, int y) {\n  if (x <= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int a[100][100], row, col, ROW, COL, i, m = 1, n = 0, x;\n  cin >> ROW >> COL;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n  x = min(ROW, COL);\n  row = 0;\n  col = 0;\n  for (i = 0; i < x + x * (x - 1) / 2; i++) {\n    cout << a[row][col] << \"\\n\";\n    n++;\n    if (n != m) {\n      row++;\n      col--;\n    } else if (n == m) {\n      row = 0;\n      col += m;\n      m++;\n      n = 0;\n    }\n  }\n  if (COL >= ROW) {\n    row = 0;\n    col = ROW;\n    m = col + 1;\n    for (i = 0; i < ROW * (COL - ROW); i++) {\n      cout << a[row][col] << \"\\n\";\n      if (row != ROW - 1) {\n        row++;\n        col--;\n      } else {\n        row = 0;\n        col = m;\n        m++;\n      }\n    }\n    row = 1;\n    col = COL - 1;\n    m = ROW - 1;\n    n = 0;\n    for (i = 0; i < ROW * (ROW - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  if (COL < ROW) {\n    row = 1;\n    col = COL - 1;\n    m = 2;\n    for (i = 0; i < COL * (ROW - COL); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (col != 0) {\n        row++;\n        col--;\n      } else {\n        row = m;\n        col = COL - 1;\n        m++;\n      }\n    }\n    row = ROW - COL + 1;\n    col = COL - 1;\n    m = COL - 1;\n    n = 0;\n    for (i = 0; i < COL * (COL - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int *head = (int *)calloc(row * col, sizeof(int));\n  int *p;\n  for (p = head; p < head + row * col; p++) {\n    scanf(\"%d\", p);\n  }\n  int i, j, jj, ii;\n  for (j = 0; j < col; j++) {\n    for (jj = j, i = 0; jj >= 0 && i < row; jj--, i++) {\n      printf(\"%d\\n\", *(head + col * i + jj));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (ii = i, j = col - 1; j >= 0 && ii < row; j--, ii++) {\n      printf(\"%d\\n\", *(head + col * ii + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, c = 1;\n  int *p = a[0];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row * col; i++) {\n    cout << *p << endl;\n    if ((p - a[0]) % 100 == 0 || (p - a[0]) / 100 >= row - 1) {\n      c++;\n      if (c <= col)\n        p = a[0] + c - 1;\n      else\n        p = a[0] + (c - col) * 100 + col - 1;\n    } else\n      p = p + 99;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, s, t, d;\n  scanf(\"%d%d\", &s, &t);\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < t; j++)\n      cin >> a[i][j];\n\n    printf(\"\\n\");\n  }\n  for (d = 0; d < s + t - 1; d++) {\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < t; j++) {\n        if (i + j == d) {\n          cout << a[i][j] << \"\\n\";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], sum, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  if (row < col) {\n    for (sum = 0; sum <= row - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= col - 1; sum++) {\n      for (i = 0; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= col + row - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum <= col - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        cout << array[i][j] << \"\\n\";\n      }\n    }\n    for (sum = col; sum <= row - 1; sum++) {\n      for (i = sum - col + 1; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= row + col - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[100][100] = {0}, point = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (j = 0; j < col; j++) {\n    point = j;\n    i = 0;\n    do {\n      cout << array[i++][point--] << endl;\n    } while (point >= 0 && i < row);\n  }\n  for (i = 1; i < row; i++) {\n    point = i;\n    j = col - 1;\n    do\n      cout << array[point++][j--] << endl;\n    while (point < row && j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5777", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int n, m, i, j, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (k = 0;; k++) {\n      if (k >= n || j - k < 0)\n        break;\n      else {\n        printf(\"%d\\n\", sz[k][j - k]);\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (k = 0;; k++) {\n      if (i + k > n - 1 || m - 1 - k < 0)\n        break;\n      else\n        printf(\"%d\\n\", sz[i + k][m - 1 - k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int s[100][100];\n  int i, j;\n  int k = 0, l = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= m - 1; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i <= m - 1; i++) {\n    k = 0;\n    l = i;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (l == 0 || k == n - 1) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    k = i;\n    l = m - 1;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (k == n - 1 || l == 0) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint mhang(int a) { return a + 1; }\nint mlie(int a) { return a - 1; }\nint main() {\n  int sz[100][100];\n  int row, col, i, j, hang = 0, lie = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    hang = 0;\n    lie = i;\n    while (1) {\n      printf(\"%d\\n\", sz[hang][lie]);\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    hang = i;\n    lie = col - 1;\n    while (1) {\n      printf(\"%d\\n\", sz[hang][lie]);\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int(*a)[160], i, j, k, m, n, t;\n  a = (int(*)[160])malloc(110 * sizeof(int));\n  scanf(\"%d %d\", &m, &n);\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", *(a + j) + i);\n  for (k = 0; k < n; k++) {\n\n    for (j = 0, i = k; i >= 0 && j < m; j++, i--)\n      if (i >= 0 && i < n && j >= 0 && j < m)\n        printf(\"%d\\n\", *(*(a + j) + i));\n  }\n  for (k = 1; k < m; k++)\n    for (j = k, i = 0; j < m && i <= n - 1; j++, i++)\n      printf(\"%d\\n\", *(*(a + j) + n - i - 1));\n  return 0;\n}\n"}
{"label": "4", "index": "5781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j, k, l;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++) {\n    k = 0;\n    l = j;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    l = col - 1;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < j + 1; i++) {\n      if (i < row) {\n        printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n  for (k = col; k < row + col - 1; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (k - j < row) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1; j >= 0 && i + col - 1 - j < row; j--)\n      printf(\"%d\\n\", *(*(a + i + col - 1 - j) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5784", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5785", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int rol, col;\n  cin >> rol >> col;\n  int a[rol][col];\n  int i, j;\n  for (i = 0; i < rol; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int k;\n  for (k = 0; k <= rol + col - 2; k++) {\n    for (i = 0; k - i >= 0 && i < rol; i++) {\n      if (k - i >= col) {\n        continue;\n      }\n      j = k - i;\n      printf(\"%d\\n\", a[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint array_1[100][100];\nint main() {\n  int row, col, i, j, m;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array_1[i][j]);\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    if (m < col) {\n      for (i = 0; i <= m && i < row; i++) {\n        printf(\"%d\\n\", array_1[i][m - i]);\n      }\n    } else {\n      for (j = col - 1; j > m - row && j >= 0; j--)\n        printf(\"%d\\n\", array_1[m - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, k, l, max;\n  scanf(\"%d %d \", &row, &col);\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  int a[max][max];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < row; i++)\n    for (k = 0; k < col; k++)\n      cin >> a[i][k];\n  for (i = 0; i < max * 2 - 1; i++) {\n    if (i < max) {\n      for (k = 0, l = i - k; k < max && l >= 0; k++, l--)\n        if (a[k][l] != 0)\n          cout << a[k][l] << endl;\n    } else\n      for (k = max - 1, l = i - k; k > 0 && l < max; k--, l++)\n        if (a[l][k] != 0)\n          cout << a[l][k] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 1, h, l, i, j, a[100][100], lans = 0, ans[10000], k;\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (n = 1; n <= l; n++)\n    for (j = 0, k = n - 1; k >= 0 && j <= h - 1; j++, k--)\n      ans[lans++] = a[j][k];\n  for (n = 2; n <= h; n++)\n    for (j = n - 1, k = l - 1; j <= h - 1 && k >= 0; j++, k--)\n      ans[lans++] = a[j][k];\n  for (i = 0; i < lans; i++)\n    printf(\"%d\\n\", ans[i]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "5789", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h, l, i, j, sz[100][100];\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int k, n;\n  if (h > l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= l - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else if (k > l - 1 && k <= h - 1) {\n        for (i = k - l + 1; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else if (h < l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else if (k > h - 1 && k <= l - 1) {\n        for (i = 0; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - h + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, l, m, i, j, a[100][100], k;\n  scanf(\"%d %d\", &h, &l);\n  for (k = 0; k < h; k++) {\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[k][j]);\n  }\n  i = 0;\n  while (i < l) {\n    k = i;\n    j = 0;\n    while (1) {\n      printf(\"%d\\n\", a[j][k]);\n      k--;\n      j++;\n      if (k < 0 || j == h) {\n        break;\n      }\n    }\n    i++;\n  }\n  i = 1;\n  while (i < h) {\n    k = i;\n    j = l - 1;\n    while (1) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n      if (j < 0 || k == h)\n        break;\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5791", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110] = {0};\n  int m, n, i, j, k;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    k = j;\n    for (i = 0; i <= m - 1; i++) {\n      cout << *(*(a + i) + k) << endl;\n      k--;\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    j = n - 1;\n    for (k = i; k <= m - 1; k++) {\n      cout << *(*(a + k) + j) << endl;\n      j--;\n      if (j < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  int max, min;\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n\n  if (row > col) {\n    max = row;\n    min = col;\n  } else {\n    max = col;\n    min = row;\n  }\n\n  for (int i = 0; i < min; i++)\n    for (int j = 0; j <= i; j++)\n      cout << a[j][i - j] << endl;\n\n  if (col != row) {\n    for (int i = min; i < max; i++) {\n      if (col > row)\n        for (int j = 0; j < min; j++)\n          printf(\"%d\\n\", a[j][i - j]);\n\n      else\n        for (int j = col - 1; j >= 0; j--)\n          cout << a[i - j][j] << endl;\n    }\n  }\n\n  for (int i = max; i <= row + col - 2; i++)\n    for (int j = col - 1; i - j <= row - 1; j--)\n      cout << a[i - j][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "5793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int hang, lie;\n  scanf(\"%d %d \", &hang, &lie);\n  int i, j;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> a[i][j];\n  }\n  int t;\n  for (t = 0; t <= hang + lie - 2; t++) {\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == t)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col, array[100][100]; \n  cin >> row >> col;                      \n  for (i = 0; i < row; i++)               \n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  for (k = 0; k <= col + row - 2; k++) \n    for (i = 0; i <= k; i++) {\n      j = k - i;\n      if (i < row && j >= 0 && j < col)\n        cout << array[i][j] << endl; \n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5795", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 1; i <= m + n - 1; i++)\n    for (j = 1; j <= n; j++) {\n      if (i + 1 - j > 0 && i + 1 - j <= m)\n        cout << *(*(a + j) + i + 1 - j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5796", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[120][120];\n  int row, col, i, j, sum;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  while (i < row && j < col) {\n    printf(\"%d\\n\", array[i][j]);\n    sum = i + j;\n    i++;\n    j--;\n    if (i == row || j == -1) {\n      sum = sum + 1;\n      if (i = row) {\n        i = 0;\n        j = sum - i;\n        if (j >= col) {\n          j = col - 1;\n          i = sum - j;\n        }\n      } else {\n        j = col - 1;\n        i = sum - j;\n        if (i < 0) {\n          i = 0;\n          j = sum - i;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[102][102], i, j, k;\n  int(*p)[102] = a;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      cout << *(*(p + i) + k) << endl;\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      cout << *(*(p + k) + j);\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int a, b, row, col, i;\n  scanf(\"%d %d\", &a, &b);\n  for (row = 0; row < a; row++) {\n    for (col = 0; col < b; col++) {\n      cin >> sz[row][col];\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (col = i; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  for (i = b; i < a + b; i++) {\n    for (col = b - 1; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5799", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], *p;\n  int m, n;\n  cin >> m >> n;\n  for (p = *a; p < *a + m * n; p++)\n    cin >> *p;\n  p = *a;\n  for (int i = 0; i < n; i++) {\n    int a = 0, b = i;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n  for (int i = 1; i < m; i++) {\n    int a = i, b = n - 1;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int **a;\n  a = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    a[i] = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  int len;\n  for (len = 0; len < row + col - 1; len++) {\n    for (i = 0; i < row; i++) {\n      j = len - i;\n      if ((j < col) && (j >= 0))\n        printf(\"%d\\n\", *(*(a + i) + len - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *a[101][101], lie, hang, i, j, h, l;\n  cin >> hang >> lie;\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      a[i][j] = (int *)malloc(sizeof(int));\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      scanf(\"%d\", a[i][j]);\n  for (j = 1; j <= lie; j++) {\n    h = 1;\n    l = j;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= hang; i++) {\n    l = lie;\n    h = i;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[100][100] = {0}, point = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (j = 0; j < col; j++) {\n    point = j;\n    i = 0;\n    do\n      printf(\"%d\\n\", array[i++][point--]);\n    while (point >= 0 && i < row);\n  }\n  for (i = 1; i < row; i++) {\n    point = i;\n    j = col - 1;\n    do {\n      cout << array[point++][j--] << endl;\n    } while (point < row && j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, m, t, p;\n  int a[100][100];\n  scanf(\"%d%d\", &b, &c);\n  for (i = 0; i <= b - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (m = 0; m <= b + c - 2; m++) {\n    if (m < b && m < c) {\n      for (i = 0; i <= m; i++)\n        printf(\"%d\\n\", a[i][m - i]);\n    } else if (m >= b && m >= c) {\n      for (i = m - c + 1; i <= b - 1; i++)\n        cout << a[i][m - i] << \"\\n\";\n    } else {\n      if (b < c) {\n        for (i = 0; i <= b - 1; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n\n      } else {\n        for (i = m - c + 1; i <= m; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, t, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  row -= 1;\n  col -= 1;\n  t = row + col;\n  for (i = 0; i <= t; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row || (i - j) > col)\n        continue;\n      cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100] = {0};\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  int step = 0;\n  i = 0;\n  j = 0;\n  int t;\n\n  if (row * col > 0) {\n    cout << a[0][0];\n    step++;\n  }\n\n  while (step < row * col) {\n\n    if (i + 1 < 0 || j - 1 < 0) {\n\n      t = i;\n      i = j;\n      j = t + 1;\n      if (i < row && j < col) {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n      if (i < row && j < col) {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, p, q;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < col; i++) {\n    p = 0;\n    q = i;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (q >= 0 && p < row);\n  }\n  for (i = 1; i < row; i++) {\n    p = i;\n    q = col - 1;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (p < row && q >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, array[100][100], a, b, c, d, e;\n  cin >> row >> col;\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &array[a][b]);\n    }\n  }\n  for (c = 0; c < col; c++) {\n    e = c;\n    for (d = 0; c >= 0 && d < row; d++, c--) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    c = e;\n  }\n  for (d = 1; d < row; d++) {\n    e = d;\n    for (c = col - 1; d < row && c >= 0; c--, d++) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    d = e;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int line, row, i, j, m, n;\n  cin >> row >> line;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= line - 1; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (j = 0; j <= line - 1; j++) {\n    m = 0;\n    n = j;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  for (i = 1; i <= row - 1; i++) {\n    m = i;\n    n = line - 1;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5809", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        cout << a[j][i - j] << endl;\n    }\n  for (i = 1; i < row; i++)\n    for (j = i; j < col + i; j++) {\n      if (j < row)\n        cout << a[j][col + i - j - 1] << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int *p1, int *p2, int m, int n) {\n  do {\n    printf(\"%d\\n\", *p2);\n    p2 += n - 1;\n  } while ((p2 - p1 + 1) % n && (p2 - p1 + 1) <= m * n);\n}\n\nint main(char *argv[]) {\n  int r, l, i, j, *q;\n  cin >> r >> l;\n  int *p[l + r - 1];\n  int a[r][l];\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++)\n      scanf(\"%d\", &a[i - 1][j - 1]);\n  for (i = 1; i <= l; i++)\n    p[i - 1] = &a[0][i - 1];\n  for (i = l + 1; i <= l + r - 1; i++)\n    p[i - 1] = &a[i - l][l - 1];\n  q = &a[0][0];\n  for (i = 1; i <= r + l - 1; i++)\n    f(q, p[i - 1], r, l);\n\n  return 0;\n}\n"}
{"label": "4", "index": "5811", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int num[110][110] = {0};\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(num + i) + j); \n    }\n  for (int i = 0; i < col; i++) {  \n    for (int j = 0; j <= i; j++) { \n      if (j < row)\n        cout << *(*(num + j) + i - j) << endl;\n      else\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) { \n    for (int j = 0; j < row - i; j++) {\n      if (j < col)\n        cout << *(*(num + i + j) + col - j - 1) << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5812", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], row, col, i, j, x, y;\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> array[i][j];\n    }\n  }\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else if (row < col) {\n    for (i = 0; i <= row - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      x = j;\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", array[i][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i + col - row; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      x = i;\n      for (j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[x][j]);\n        x++;\n      }\n    }\n    for (i = row - col + 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i - row + col; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n = 0, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &(a[i][j]));\n  n = row + col - 1;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < row; i++) {\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    temp_i = i;\n    for (j = col - 1; j >= 0 && temp_i < row; j--) {\n      printf(\"%d\\n\", a[temp_i][j]);\n      temp_i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5815", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], col, row, t, i, j;\n  cin >> row >> col;\n  if (row > col)\n    t = row;\n  else\n    t = col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 2; i <= 2 * t; i++) {\n    for (j = 1; j < i; j++) {\n      if (j <= row && i - j <= col) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5816", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int n, m, i, j, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (k = 0;; k++) {\n      if (k >= n || j - k < 0) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[k][j - k]);\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (k = 0;; k++) {\n      if (i + k > n - 1 || m - 1 - k < 0)\n        break;\n      else\n        printf(\"%d\\n\", sz[i + k][m - 1 - k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5817", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n\n  for (i = 0; i < col + row - 1; i++) \n    for (j = i, k = 0; (j >= 0) && (k < row); j--,\n        k++) \n      if (j < col) \n        cout << array[k][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "5818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, array[100][100], a, b, c, d, e;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++)\n      scanf(\"%d\", &array[a][b]);\n  }\n  for (c = 0; c < col; c++) {\n    e = c;\n    for (d = 0; c >= 0 && d < row; d++, c--) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    c = e;\n  }\n  for (d = 1; d < row; d++) {\n    e = d;\n    for (c = col - 1; d < row && c >= 0; c--, d++)\n      printf(\"%d\\n\", array[d][c]);\n\n    d = e;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j < m; j++) {\n      if (i - j >= 0 && i - j < n)\n        cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  scanf(\"%d%d\", &m, &n);\n  return 0;\n}\n"}
{"label": "4", "index": "5820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, time = 0, i, j, n;\n  int array[110][110];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    if (i < col) {\n      for (int j = 0; j < row && j <= i; j++)\n        cout << *(*(array + j) + i - j) << endl;\n    } else {\n      for (int j = col - 1; j >= i - row + 1 && j >= 0; j--)\n        cout << *(*(array + i - j) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n[100][100], col, row, COL, ROW;\n  cin >> ROW >> COL;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &n[row][col]);\n    }\n  }\n  for (i = 0; i < COL + ROW - 1; i++) {\n    if (i < COL) {\n      col = i;\n      row = 0;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    } else if (i >= COL) {\n      col = COL - 1;\n      row = i - COL + 1;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100][100];\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < m + n - 1; i++)\n    for (int j = n - 1; j >= 0; j--) {\n      if (i - j < m && i - j >= 0)\n        cout << *(*(a + i - j) + j) << \"\\n\";\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], sum, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  if (row < col) {\n    for (sum = 0; sum <= row - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= col - 1; sum++) {\n      for (i = 0; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= col + row - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum <= col - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= row - 1; sum++) {\n      for (i = sum - col + 1; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= row + col - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int rr, cc;\n  int arr[100][100] = {0};\n  cin >> rr;\n  cin >> cc;\n\n  int i, j;\n  for (i = 0; i < rr; i++) {\n    for (j = 0; j < cc; j++) {\n      scanf(\"%d \", &arr[i][j]);\n    }\n  }\n\n  for (j = 0; j < cc; j++) {\n    i = 0;\n    for (int k = j; k >= 0 && i <= rr - 1; k--, i++) {\n      cout << arr[i][k] << endl;\n    }\n  }\n\n  for (i = 1; i < rr; i++) {\n    j = cc - 1;\n    for (int p = i; p <= rr - 1 && j >= 0; p++, j--) {\n      cout << arr[p][j] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5825", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int ain[123][123];\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; ++i)\n    for (int j = 0; j < col; ++j)\n      cin >> ain[i][j];\n  int *p[123];\n  for (int i = 0; i < row; ++i)\n    p[i] = ain[i];\n  for (int i = 0; i < row + col - 1; ++i) {\n    for (int j = 0; j < row; ++j) {\n      if (j <= i && j > i - col)\n        cout << *(p[j]++) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, a, b, i, j, *num;\n  num = (int *)malloc(sizeof(int) * 10000);\n  scanf(\"%d %d\", &a, &b);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++)\n      scanf(\"%d\", num + (i - 1) * b + j);\n  }\n  for (i = 1; i < b; i++) {\n    p = i;\n    for (;;) {\n      printf(\"%d\\n\", *(num + p));\n      if (p % b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n  for (i = b; i <= a * b; i += b) {\n    p = i;\n    for (;;) {\n      printf(\"%d\\n\", *(num + p));\n      if (p % b == 1 || b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5827", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[99][99];\n  cin >> r >> c;\n  for (int i = 0; i < r; ++i)\n    for (int j = 0; j < c; ++j)\n      cin >> a[i][j];\n  for (int j = 0; j < c; ++j)\n    for (int x = j, y = 0; x >= 0 && y < r; --x, ++y)\n      printf(\"%d\\n\", a[y][x]);\n  for (int i = 1; i < r; ++i)\n    for (int y = i, x = c - 1; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n}\n"}
{"label": "4", "index": "5828", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < i + 1; j++) {\n      if (j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[j][i - j]);\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (i + j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int r, c, i, j, s;\n  scanf(\"%d%d\", &r, &c);\n  int x[100][100];\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  s = 0;\n  while (s <= r + c - 2) {\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < c; j++) {\n        if (i + j == s) {\n          printf(\"%d\\n\", x[i][j]);\n        }\n      }\n    }\n\n    s++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, m, n;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row <= col) {\n    for (m = 0; m < row; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = row; m < col; m++)\n      for (n = 0; n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < (col + row); m++)\n      for (n = (m - col + 1); n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n  } else {\n    for (m = 0; m < col; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < row; m++)\n      for (n = col - 1; n >= 0; n--)\n        printf(\"%d\\n\", a[m - n][n]);\n    for (m = row; m < (col + row); m++)\n      for (n = col - 1; n >= (m - row + 1); n--)\n        printf(\"%d\\n\", a[m - n][n]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5831", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, p, q;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    p = 0;\n    q = i;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (q >= 0 && p < row);\n  }\n  for (i = 1; i < row; i++) {\n    p = i;\n    q = col - 1;\n    do {\n      printf(\"%d\\n\", a[p][q]);\n      p++;\n      q--;\n    } while (p < row && q >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5832", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, start, row, col;\n  int a[200][200];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n\n  i = 1;\n  j = 1;\n  do {\n    printf(\"%d\\n\", a[i][j]);\n    i++;\n    j--;\n    if (j == 0) {\n      if (i + j < col + 1) {\n        j = i;\n        i = 1;\n      } else {\n        i = i + j + 1 - col;\n        j = col;\n      }\n    }\n    if (i > row)\n      if (i + j < col + 1) {\n        j = i + j;\n        i = 1;\n      } else {\n        i = row + 2 + j - col;\n        j = col;\n      }\n\n  } while (i <= row);\n  return 0;\n}\n"}
{"label": "4", "index": "5833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int yao[300][300];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &yao[i][j]);\n    }\n  }\n  for (i = n; i < 300; i++) {\n    for (j = 0; j < 300; j++) {\n      yao[i][j] = 00;\n    }\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n\n    for (i = 0; i <= k; i++) {\n      if (yao[i][k - i] != 00)\n        printf(\"%d\\n\", yao[i][k - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5834", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, m, n, k, num = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    j = i;\n    while (j >= 0 && i - j < row) {\n      cout << a[i - j][j] << endl;\n      j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = i;\n    while (j < row && col - 1 + i - j >= 0) {\n      cout << a[j][col - 1 + i - j] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, k;\n  int *a[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    *(a + i) = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  for (k = 0; k < n; k++) {\n    i = 0;\n    j = k;\n    do {\n      cout << *(*(a + i) + j) << \"\\n\";\n      i++;\n      j--;\n    } while (j >= 0 && i < m);\n  }\n  if (m >= 2) {\n    for (k = 1; k < m; k++) {\n      i = k;\n      j = n - 1;\n      do {\n        cout << *(*(a + i) + j) << \"\\n\";\n        i++;\n        j--;\n      } while (j >= 0 && i < m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int m = 1, n = 1;\n  int h, g;\n  int a[100][100];\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> a[i][j];\n  while (m <= row) {\n    h = m;\n    g = n;\n    while (h <= row && g >= 1) {\n      cout << a[h][g] << endl;\n      h++;\n      g--;\n    }\n    if (n < col)\n      n++;\n    else\n      m++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5837", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, hang, lie, (*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &hang, &lie);\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  if (hang <= lie) {\n    for (j = 0; j < hang; j++) {\n      for (i = j, k = 0; i != -1; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = hang; j < lie; j++) {\n      for (i = j, k = 0; k != hang; i--, k++) {\n        cout << *(*(a + k) + i) << \"\\n\";\n      }\n    }\n    for (j = 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  } else {\n    for (j = 0; j < lie; j++) {\n      for (i = j, k = 0; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = lie; j < hang; j++) {\n      for (i = lie - 1, k = j - lie + 1; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = hang - lie + 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r, c, *p, n, m, i, j, k;\nint main() {\n  void x(int i);\n  void y(int i);\n  scanf(\"%d %d\", &r, &c);\n  n = r * c;\n  m = r + c - 2;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i < c; i++)\n    x(i);\n  for (i = c; i <= m; i++)\n    y(i);\n}\nvoid x(int i) {\n  int a;\n  for (a = i; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\nvoid y(int i) {\n  int a;\n  for (a = c - 1; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\n"}
{"label": "4", "index": "5840", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[99][99];\n  cin >> r >> c;\n  for (int i = 0; i < r; ++i)\n    for (int j = 0; j < c; ++j) {\n      cin >> a[i][j];\n    }\n  for (int j = 0; j < c; ++j)\n    for (int x = j, y = 0; x >= 0 && y < r; --x, ++y)\n      printf(\"%d\\n\", a[y][x]);\n  for (int i = 1; i < r; ++i)\n    for (int y = i, x = c - 1; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n}\n"}
{"label": "4", "index": "5841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n  int row, col;\n  int i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << a[j][i - j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "5842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint min(int a, int b) {\n  if (a < b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int a[100][100];\n  int row, col, i, j, k, l;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < min(i + 1, row); j++) {\n      printf(\"%d \", a[j][i - j]);\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (l = 0; l < min(row - k, col); l++)\n      printf(\"%d \", a[k + l][col - 1 - l]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  int sum = 0;\n  while (1) {\n    if (sum == m + n - 1)\n      break;\n    else if (sum <= n - 1) {\n      for (int i = 0; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        cout << a[i][sum - i] << endl;\n      }\n      sum++;\n    } else {\n      for (int i = sum + 1 - n; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        cout << a[i][sum - i] << endl;\n      }\n      sum++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, array[100][100], (*p)[100] = array, *q = *p;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int x = 0, j = 0;\n  while (q != array[row - 1] + col - 1) {\n    cout << *q << endl;\n    if (q == *p || *p == array[row - 1]) {\n      x++;\n      if (x >= col) {\n        p = array + x + 1 - col;\n        q = *p + col - 1;\n        j = col - 1;\n      } else {\n        p = array;\n        q = *p + x;\n        j = x;\n      }\n    } else {\n      p++;\n      q = *p + (--j);\n    }\n  }\n  cout << *q;\n  return 0;\n}\n"}
{"label": "4", "index": "5845", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int(*p)[100];\n  p = (int(*)[100])malloc(row * col * sizeof(int));\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  int k;\n  for (k = 0; k < col; k++) {\n    for (i = 0, j = k; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n}\n"}
{"label": "4", "index": "5846", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int array[101][101];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> *(*(array + i) + j);\n\n  for (i = 1; i <= row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j > 0 && i - j <= col && j + 1 <= row)\n        cout << *(*(array + j + 1) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, N;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  N = row + col - 2;\n  for (k = 0; k <= N; k++) {\n    i = 0;\n    j = k - i;\n    do {\n      if (i >= 0 && j >= 0 && i < row && j < col) {\n        cout << a[i][j] << \"\\n\";\n        i++;\n        j--;\n      } else {\n        i++;\n        j--;\n      }\n    } while (j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5848", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p1[100], *p2, i, j, n, m, s;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    p1[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &*(*(p1 + i) + j));\n  for (s = 0; s < n + m - 1; s++)\n    for (i = 0; i < n; i++) {\n      if (s - i < m)\n        printf(\"%d\\n\", *(*(p1 + i) + s - i));\n      if (s - i == 0 || i == n)\n        break;\n    }\n}\n"}
{"label": "4", "index": "5849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, row, col, *q, i, k;\n  scanf(\"%d%d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (q = p; q < p + row * col; q++)\n    scanf(\"%d\", q);\n  for (k = 0; k < row + col - 1; k++) {\n    if (k < col) {\n      for (i = 0; i <= k && i < row; i++)\n        printf(\"%d\\n\", *(p + i * col + k - i));\n    } else {\n      for (i = k - col + 1; i < row && i <= k; i++)\n        cout << *(p + i * col + k - i) << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "5851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, a[100][100], i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  i = 0;\n  j = 0;\n\n  for (;;) {\n\n    printf(\"%d\\n\", a[i][j]);\n    if (i + j == row + col - 2)\n      break;\n    if (j == 0) {\n      j = i + j + 1;\n      i = 0;\n    } else if (i >= row - 1) {\n      j = i + j + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (j > col - 1) {\n      i = i + j + 1 - col;\n      j = j - (j + 1 - col);\n    }\n    if (i + j == row + col - 2)\n      break;\n  }\n  if (row + col > 2)\n    cout << a[i][j] << \"\\n\";\n}\n"}
{"label": "4", "index": "5852", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], h, l, i, j;\n  cin >> h >> l;\n  for (i = 0; i <= h - 1; i++) {\n    for (j = 0; j <= l - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= (i > h - 1 ? h - 1 : i); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  }\n  for (i = l; i <= l + h - 2; i++) {\n    for (j = i - l + 1; j <= (i > h - 1 ? h - 1 : i); j++) {\n      printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0, an[100][100], j = 0, k = 0, s = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (k = 0; k < n + m - 1; k++) {\n    if (n < m) {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < n && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; j < n; i--, j++) {\n          printf(\"%d\\n\", an[j][i]);\n        }\n      }\n    } else {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < m && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; i >= 0 && j < n; i--, j++) {\n          printf(\"%d\\n\", an[j][i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100];\n  int xx_row, sx_row, xx_col, sx_col;\n  int i, j, c, r;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  xx_row = 0;\n  sx_row = row - 1;\n  xx_col = 0;\n  sx_col = col - 1;\n  if (col > row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (c = sx_row + 1; c < sx_col; c++) {\n      j = c;\n      for (i = 0; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n    for (r = xx_row; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col < row) {\n    for (c = xx_col; c <= sx_col; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r < row - col; r++) {\n      i = r;\n      for (j = sx_col; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = row - col; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col == row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, *p[100], i, j, v;\n  for (i = 0; i < 100; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\\n\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", (p[i] + j));\n  for (v = 0; v <= r + c - 2; v++) {\n    for (i = 0; i <= v; i++) {\n      if (i < r) {\n        j = v - i;\n        if (j < c)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5856", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a[110][110] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (k = 0; k < row + col - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0) {\n      if ((i < row) && (j < col))\n        printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[100][100], l, h, i, j, hang, lie;\n  scanf(\"%d%d\", &lie, &hang);\n  for (l = 0; l < lie; l++) {\n    for (h = 0; h < hang; h++) {\n      scanf(\"%d\", &s[h][l]);\n    }\n  }\n  for (i = 0; i < hang + lie - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      if (j > hang - 1) {\n        j = hang - 1;\n      }\n      h = j;\n      l = i - h;\n      if (l > lie - 1) {\n        break;\n      }\n      printf(\"%d\\n\", s[h][l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, a, b, i, j, *num;\n  num = (int *)malloc(sizeof(int) * 10000);\n  scanf(\"%d %d\", &a, &b);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++)\n      scanf(\"%d\", num + (i - 1) * b + j);\n  }\n\n  for (i = 1; i < b; i++) {\n    p = i;\n    for (;;) {\n      cout << *(num + p) << \"\\n\";\n      if (p % b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n\n  for (i = b; i <= a * b; i += b) {\n    p = i;\n    for (;;) {\n      cout << *(num + p) << \"\\n\";\n      if (p % b == 1 || b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "5859", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n[100][100], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &n[i][j]);\n  for (i = 0; i <= col + row - 2; i++)\n    for (j = 0, k = i; j < row && k >= 0; j++, k--)\n      if (k < col)\n        printf(\"%d\\n\", n[j][k]);\n  return 0;\n}\n"}
{"label": "4", "index": "5860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      cout << a[j][i - j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "5861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ro, co, sz[100][1000], i, j, m, k, c = 0, b = 1;\n  cin >> ro >> co;\n  for (i = 0; i < ro; i++) {\n    for (j = 0; j < co; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  m = ro * co;\n  i = 0;\n  j = 0;\n  for (k = 0; k < m; k++) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (ro >= co) {\n      if (j == 0 && i < co - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if ((j < 0 && i > co - 1) || i > ro - 1) {\n        j = co - 1;\n        i = c + 1;\n        c++;\n      }\n    }\n    if (ro < co) {\n      if (j == 0 && i <= ro - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if (i > ro - 1) {\n        i = 0;\n        j = ro + c + 1;\n        c++;\n      }\n\n      if (j > co - 1) {\n        j = co - 1;\n        i = b;\n        b++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5862", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nvoid out1(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < col; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row - col; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    printf(\"%d\\n\", *p);\n    for (int j = 1; j < col; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row - col; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nvoid out2(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < row; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row; i < col; i++) {\n    p = array_1[0];\n    p = p + i;\n    cout << *p << endl;\n    for (int j = 1; j < row; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nint main() {\n  int row, col;\n  cin >> row >> col;\n  if (row > col)\n    out1(row, col);\n  else\n    out2(row, col);\n  return 0;\n}\n"}
{"label": "4", "index": "5863", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, p, q;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  int temp_r, temp_c;\n  for (p = 0; p < row; p++) {\n    for (q = 0; q < col; q++) {\n      cin >> a[p][q];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    temp_r = 0;\n    temp_c = i;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    temp_r = j;\n    temp_c = col - 1;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "4", "index": "5864", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], row, col, t = 0, flag = 0, max;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  max = (row > col) ? row : col;\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      printf(\"%d\\n\", a[i][j]);\n    if (i == max - 1 && j == max - 1)\n      break;\n    if (flag == 0) {\n      if (j == 0 && i == max - 1) {\n        flag = 1;\n        t = max;\n        j = max - 1;\n      } else if (j == 0) {\n        t = t + 1;\n        j = t;\n      } else\n        j = j - 1;\n    } else {\n      if (i == max - 1) {\n        t = t + 1;\n        j = max - 1;\n      } else\n        j = j - 1;\n    }\n    i = t - j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint arr[100][100];\nint row, col;\nvoid bianli(int y, int x) {\n  for (; y <= row && x > 0; y++, x--) {\n    printf(\"%d\\n\", *(*(arr + y) + x));\n  }\n}\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(arr + i) + j);\n  for (int i = 1; i <= col; i++)\n    bianli(1, i);\n  for (int i = 2; i <= row; i++)\n    bianli(i, col);\n  return 0;\n}\n"}
{"label": "4", "index": "5866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint row, col;\nint array_1[101][101];\nint (*p)[101] = array_1;\nint f(int m, int n) {\n  int i;\n  if (m == row - 1 && n == col - 1) {\n    printf(\"%d\", *(*(p + m) + n));\n    return 0;\n  }\n  for (i = 0; m + i <= row - 1 && n - i >= 0; i++)\n    cout << *(*(p + m + i) + n - i) << \"\\n\";\n  if (n < col - 1)\n    return f(0, n + 1);\n  if (n >= col - 1)\n    return f(m + 1, col - 1);\n}\n\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array_1[i][j];\n  f(0, 0);\n  return 0;\n}\n"}
{"label": "4", "index": "5867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  cin >> row >> col;\n\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++) {\n      cin >> a[i - 1][j - 1];\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    for (int l = 0; l <= row - 1; l++) {\n      if (k - l <= col - 1 && k >= l) {\n        cout << a[l][k - l] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, k;\n  int *a[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    *(a + i) = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k < n; k++) {\n    i = 0;\n    j = k;\n    do {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    } while (j >= 0 && i < m);\n  }\n  if (m >= 2) {\n    for (k = 1; k < m; k++) {\n      i = k;\n      j = n - 1;\n      do {\n        printf(\"%d\\n\", *(*(a + i) + j));\n        i++;\n        j--;\n      } while (j >= 0 && i < m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  } \n  for (int i = 0; i < row + col - 1; i++) {\n    for (int j = 0; j < row; j++) {\n      for (int k = 0; k < col; k++) {\n        if (j + k == i)\n          cout << *(*(a + j) + k) << endl;\n      }\n    }\n  } \n\n  return 0;\n}\n"}
{"label": "4", "index": "5870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, column, a[110][110] = {0}, i, j, row1 = 0, column1 = 0;\n  cin >> row >> column;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < column; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < (row + column - 1); i++) {\n    if (i < column)\n      column1 = i;\n    else\n      column1 = column - 1;\n    while (column1 >= 0) {\n      if ((i - column1) < row) {\n        cout << *(*(a + i - column1) + column1)\n             << endl; \n        column1--;\n      } else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < row - i && col - 1 - j >= 0; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n\n  int sz[100][100];\n  int row, col, ROW, COL;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  cout << sz[0][0] << \" \";\n\n  int i = 0, j, k;\n\n  for (j = 1; j < COL; j++) {\n\n    for (k = j; k >= 0; k--) {\n      if (j - k < ROW) {\n        printf(\"%d \", sz[j - k][k]);\n      }\n    }\n  }\n  for (j = COL; j <= COL + ROW; j++) {\n\n    for (k = COL - 1; k >= 0; k--) {\n      if (j - k < ROW)\n        printf(\"%d \", sz[j - k][k]);\n    }\n  }\n\n  scanf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "4", "index": "5873", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], y, x, i, j, k;\n  cin >> y >> x;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      cin >> a[i][j];\n  for (k = 0; k < x; k++)\n    for (i = 0; i < y && k - i >= 0; i++)\n      printf(\"%d\\n\", a[i][k - i]);\n  for (k = x; k < x + y - 1; k++)\n    for (j = x - 1; k - j < y && j >= 0; j--)\n      cout << a[k - j][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ROW, COL, row, col;\n  int k, i, j;\n  int sz[101][101];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5875", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[105][105], row, col, (*p)[105];\n  p = array;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n\n  int i, j, m = 0;\n  while (1) {\n    if (m < col) {\n      for (i = 0, j = m; j >= 0 && i <= row - 1; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    } else {\n      for (i = m - col + 1, j = col - 1; i <= row - 1 && j >= 0; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    }\n    m++;\n    if (m == row + col)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, col, row;\n  int *p[1000];\n  for (i = 0; i < 1000; i++) {\n    p[i] = (int *)malloc(10000 * sizeof(int));\n  }\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  if (col > row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (j + i + 1 < row) {\n          cout << *(*(p + j + i + 1) + col - j - 1) << \"\\n\";\n        } else {\n          break;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5877", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < j + 1; i++) {\n      if (i < row) {\n        printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n  for (k = col; k < row + col - 1; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (k - j < row) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d \", &array[i][j]);\n  for (i = 2; i <= row + col; i++)\n    for (j = 1; j <= i - 1; j++) {\n      if ((j <= row) && (i - j <= col)) {\n        cout << array[j][i - j] << endl;\n      }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, col, row;\n  int *p[1000];\n  for (i = 0; i < 1000; i++) {\n    p[i] = (int *)malloc(10000 * sizeof(int));\n  }\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  if (col > row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (j + i + 1 < row) {\n          cout << *(*(p + j + i + 1) + col - j - 1) << \"\\n\";\n        } else {\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, a[101][101], t;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i <= row + col - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row && (i - j) < col)\n        cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  scanf(\"%d\", &t);\n}\n"}
{"label": "4", "index": "5881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  int *array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (k = 0; k <= row + col; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          cout << *(*(array + i) + j) << \"\\n\";\n}\n"}
{"label": "4", "index": "5882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int iRow, iCol, i, j, k, iMax, iMin,\n      p; \n  cin >> iRow >> iCol; \n  if (iRow > iCol) {   \n    iMin = iCol;\n    iMax = iRow;\n  } else {\n    iMin = iRow;\n    iMax = iCol;\n  }\n  int a[iMax][iMax];                \n  memset(a, 0, sizeof(a));          \n  for (i = 0; i <= (iRow - 1); i++) \n    for (j = 0; j <= (iCol - 1); j++)\n      cin >> a[i][j];\n  p = 1; \n  for (k = 0; k <= (iMax * 2 - 2); k++) {\n    if (k > iMax - 1) { \n      for (i = p, j = iMax - 1; (i <= iMax - 1) && (j >= p);\n           i++, j--) {      \n        if (a[i][j] != 0) { \n          cout << a[i][j] << endl;\n        } else\n          continue;\n      }\n      p++;\n    } else {\n      for (i = 0, j = k; (i <= k) && (j >= 0); i++, j--) { \n        if (a[i][j] != 0)                                  \n          cout << a[i][j] << endl;\n        else\n          continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nvoid out1(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < col; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row - col; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << \"\\n\";\n    for (int j = 1; j < col; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row - col; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nvoid out2(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < row; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row; i < col; i++) {\n    p = array_1[0];\n    p = p + i;\n    cout << *p << endl;\n    for (int j = 1; j < row; j++) {\n      p = p + 99;\n      printf(\"%d\\n\", *p);\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nint main() {\n  int row, col;\n  cin >> row >> col;\n  if (row > col)\n    out1(row, col);\n  else\n    out2(row, col);\n  return 0;\n}\n"}
{"label": "4", "index": "5884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int array[m + 1][n + 1];\n  for (int i = 1; i <= m; ++i)\n    for (int t = 1; t <= n; ++t)\n      cin >> array[i][t];\n  int sum = 1;\n  int x[3] = {0, 0, 1};\n  int y[3] = {0, 1, 0};\n  int dx = 1, dy = 1, k = 1;\n  int tx, ty;\n  while (sum <= m * n) {\n    int xx = dx, yy = dy;\n    for (;;) {\n      if (xx > m || yy < 1)\n        break;\n      cout << array[xx][yy] << endl;\n      xx = xx + 1, yy = yy - 1;\n      sum++;\n    }\n    tx = dx + x[k], ty = dy + y[k];\n    if (ty > n) {\n      k++;\n      tx = dx + x[k], ty = dy + y[k];\n    }\n    dx = tx, dy = ty;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5885", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5886", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int(*aa)[100] = a;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      printf(\"%d\\n\", *((*(aa + r)) + c));\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int array[110][110];\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (i = 0; i < col; i++) {\n    for (j = 0; ((j <= i) && (j < row)); j++) {\n      printf(\"%d\\n\", *(*(array + j) + i - j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; ((j <= col - 1) && (j < row - i)); j++)\n\n      printf(\"%d\\n\", *(*(array + i + j) + col - 1 - j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5888", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ROW, COL, j;\n  scanf(\"%d %d \", &ROW, &COL);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &sz[row][col]);\n  }\n  if (ROW == COL) {\n    if (ROW == 1) {\n      printf(\"%d\\n\", sz[ROW - 1][COL - 1]);\n    } else {\n      for (col = 0; col < COL; col++) {\n        j = col;\n        row = 0;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (col > -1);\n        col = j;\n      }\n      for (row = 1; row < ROW; row++) {\n        j = row;\n        col = COL - 1;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (row < ROW);\n        row = j;\n      }\n    }\n  } else {\n    for (col = 0; col < COL - 1; col++) {\n      j = col;\n      row = 0;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((col > -1) && (row < ROW));\n      col = j;\n    }\n    for (row = 0; row < ROW; row++) {\n      j = row;\n      col = COL - 1;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((row < ROW) && (col > -1));\n      row = j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100]; \n  int i, j, k;\n  cin >> row >> col; \n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j]; \n    }\n  }\n  for (k = 0; k < col; k++) { \n    cout << array[0][k] << endl;\n    for (i = 1, j = k - 1;; i++, j--) {\n      if (i < row && j >= 0)\n        cout << array[i][j] << endl;\n      else\n        break; \n    }\n  }\n  for (k = 1; k < row; k++) { \n    cout << array[k][col - 1] << endl;\n    for (i = k + 1, j = col - 2;; i++, j--) {\n      if (i < row && j >= 0)\n        cout << array[i][j] << endl;\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int array[101][101];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> *(*(array + i) + j);\n\n  for (i = 1; i <= row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j > 0 && i - j <= col && j + 1 <= row)\n        cout << *(*(array + j + 1) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k = 1;\n  int a[200][200] = {0};\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  cout << a[0][0];\n  while (k <= row + col - 2) {\n    for (i = 0; i <= row - 1; i++) {\n      if (k - i >= 0 && k - i < col) {\n        cout << endl;\n        cout << a[i][k - i];\n      }\n    }\n    k++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, max;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int a[101][101];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 0; i <= row + col - 2; i++) {\n    max = 0;\n    if (row - 1 < i)\n      max = row - 1;\n    else\n      max = i;\n    for (j = 0; j <= max; j++) {\n      if (i - j <= col - 1) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int a, b, row, col, i;\n  scanf(\"%d %d\", &a, &b);\n  for (row = 0; row < a; row++) {\n    for (col = 0; col < b; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (col = i; col >= 0 && (i - col) < a; col--)\n      cout << sz[i - col][col] << \"\\n\";\n  }\n  for (i = b; i < a + b; i++) {\n    for (col = b - 1; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[120][120];\n  int row, col, i, j, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  while (i < row && j < col) {\n    cout << array[i][j] << endl;\n    sum = i + j;\n    i++;\n    j--;\n    if (i == row || j == -1) {\n      sum = sum + 1;\n      if (i = row) {\n        i = 0;\n        j = sum - i;\n        if (j >= col) {\n          j = col - 1;\n          i = sum - j;\n        }\n      } else {\n        j = col - 1;\n        i = sum - j;\n        if (i < 0) {\n          i = 0;\n          j = sum - i;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, q;\n  cin >> a >> b;\n  int m[a + 1][b + 1]; \n  for (i = 1; i <= a; i++)\n    for (j = 1; j <= b; j++)\n      cin >> m[i][j];                             \n  for (q = 2; q <= a + b; q++)                    \n    for (i = 1, j = q - i; j > 0; i++, j = q - i) \n    {\n      if (j <= b && i <= a) \n        cout << m[i][j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5896", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, a[101][101];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < m && (i - j) < n) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[1000][1000];\n  int i, j;\n  int m, n;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int time = 0;\n  for (j = 1; j <= col; j++) {\n    m = 1;\n    n = j;\n    while (1) {\n      printf(\"%d\", a[m][n]);\n      time = time + 1;\n      if (time < row * col)\n        printf(\"\\n\");\n      n = n - 1;\n      m = m + 1;\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    m = i;\n    n = col;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5898", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (col >= row) {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m && n < col; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  }\n}\n"}
{"label": "4", "index": "5899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, v[100][100], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &v[i][j]);\n    }\n  }\n\n  for (int j = 0; j <= col - 1; j++) {\n    int m = j;\n    for (int k = 0; k <= row - 1 && m >= 0; m-- && k++) {\n      printf(\"%d\\n\", v[k][m]);\n    }\n    k = 0;\n  }\n\n  for (int i = 1; i <= row - 1; i++) {\n    int n = i;\n    for (int j = col - 1; n <= row - 1 && j >= 0; n++ && j--) {\n      printf(\"%d\\n\", v[n][j]);\n    }\n  }\n\n  int z;\n  scanf(\"%d\", z);\n  return 0;\n}\n"}
{"label": "4", "index": "5900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col, i, j, s;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (s = 0; s < row + col - 1; s++) {\n    for (i = 0; i < row; i++) {\n      if (s - i < col) {\n        if (s >= i)\n          printf(\"%d\\n\", a[i][s - i]);\n        else\n          break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, i, j, a[100][100], k;\n  scanf(\"%d %d\", &h, &l);\n  for (k = 0; k < h; k++) {\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[k][j]);\n  }\n  i = 0;\n  while (i < l) {\n    k = i;\n    j = 0;\n    while (1) {\n      cout << a[j][k] << \"\\n\";\n      k--;\n      j++;\n      if (k < 0 || j == h)\n        break;\n    }\n    i++;\n  }\n  i = 1;\n  while (i < h) {\n    k = i;\n    j = l - 1;\n    while (1) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n      if (j < 0 || k == h)\n        break;\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  memset(array, 0, sizeof(array));\n  int i, j, k, row, col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << array[i][j] << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int n[1000][1000];\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      cin >> n[i][j];\n  }\n  for (int t = 0; t < b; t++) {\n    for (j = t, i = 0; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  for (int p = 1; p < a; p++) {\n    for (i = p, j = b - 1; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], r, c;\nint judge(int i, int c) {\n  if (i - c >= 0)\n    return i - c + 1;\n  else\n    return 0;\n}\nint main() {\n  cin >> r >> c;\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int i = 0; i < r + c - 1; i++) {\n    for (int j = judge(i, c); j <= i && j < r && i - j < c; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  int i, j;\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < col - 1; j++) {\n    int a = j;\n    for (i = 0; a >= 0 && i < row; i++) {\n      printf(\"%d\\n\", *(*(p + i) + a));\n      a--;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    int a = i;\n    for (j = col - 1; a < row && j >= 0; j--) {\n      printf(\"%d\\n\", *(*(p + a) + j));\n      a++;\n    }\n  }\n}\n"}
{"label": "4", "index": "5906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, x, sum, y, z;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  sum = 0;\n  j = 0;\n  x = 0;\n  y = 1;\n  z = 0;\n  if (col >= row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        if (j + row + 1 < col) {\n          j = j + row + 1;\n          i = 0;\n        } else if (j + row + 1 >= col) {\n          j = j + row - x;\n          i = 1 + x;\n          x++;\n        }\n      } else if (j < 0 && i < row) {\n        j = j + 1 + y;\n        i = 0;\n        y++;\n      }\n      if (sum == col * row)\n        break;\n    }\n  } else if (col < row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        j = col - 1;\n        i = i - col + 1 + x;\n        x++;\n      } else if (i < row && j < 0) {\n        if (j + 1 + y < col) {\n          j = j + 1 + y;\n          i = 0;\n          y++;\n        } else if (j + 1 + y >= col) {\n          j = col - 1;\n          i = z + 1;\n          z++;\n        }\n      }\n      if (sum == col * row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n[100][100], col, row, COL, ROW;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &n[row][col]);\n    }\n  }\n  for (i = 0; i < COL + ROW - 1; i++) {\n    if (i < COL) {\n      col = i;\n      row = 0;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    } else if (i >= COL) {\n      col = COL - 1;\n      row = i - COL + 1;\n      while (col >= 0 && row < ROW) {\n        printf(\"%d\\n\", n[row][col]);\n        col -= 1;\n        row += 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5908", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        cout << a[i][j] << endl;\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5909", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  for (i = 0; i < 100; i++) {\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  }\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if ((j < m) && ((i - j) < n)) {\n        if (i == 0) {\n          printf(\"%d\", *(*(p + j) + i - j));\n        } else {\n          printf(\"\\n%d\", *(*(p + j) + i - j));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if ((i == 1) && (j == 1))\n    printf(\"%d\\n\", array[0][0]);\n  else {\n    for (j = 0; j < col; j++) {\n      k = j;\n      for (i = 0; i < row; i++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[i][k]);\n        k--;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      k = col - 1;\n      for (j = i; j < row; j++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[j][k]);\n        k--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  for (i = 0; i < col; i++) {\n    k = i;\n    j = 0;\n    while ((k >= 0) && (j <= row - 1)) {\n      cout << array[j][k] << '\\n';\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    j = col - 1;\n    while ((k <= row - 1) && (j >= 0)) {\n      printf(\"%d\\n\", array[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < (m + n); i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i) {\n          cout << a[j][k] << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100][100];\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < m + n - 1; i++)\n    for (int j = n - 1; j >= 0; j--) {\n      if (i - j < m && i - j >= 0) {\n        cout << *(*(a + i - j) + j) << endl;\n      }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, a[101][101];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < m && (i - j) < n)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, h;\n  cin >> row >> col;\n  cout << endl;\n  int a[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row != 1 && col != 1) {\n    for (j = 0; j <= col - 1; j++) {\n      k = 0;\n      h = j;\n      while (k <= row - 1 && h >= 0) {\n        cout << a[k][h] << endl;\n        k = k + 1;\n        h = h - 1;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      k = col - 1;\n      h = i;\n      while (h <= row - 1 && k >= 0) {\n        cout << a[h][k] << endl;\n        h = h + 1;\n        k = k - 1;\n      }\n    }\n  }\n  if (row == 1 && col != 1) {\n    for (i = 0; i <= col - 1; i++)\n      cout << a[0][i] << endl;\n  }\n  if (col == 1 && row != 1) {\n    for (i = 0; i <= row - 1; i++) {\n      cout << a[i][0] << endl;\n    }\n  }\n  if (row == 1 && col == 1) {\n    cout << a[0][0] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5916", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()                            \n{                                     \n  int a[100][100], col, row, t, i, j; \n  cin >> row >> col;                  \n  if (row > col)                      \n    t = row;\n  else\n    t = col; \n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j]; \n    }\n  }\n\n  for (i = 2; i <= 2 * t; i++) {\n    for (j = 1; j < i; j++) {\n      if (j <= row && i - j <= col) {\n        cout << a[j][i - j] << endl; \n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5917", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[105][105], row, col, (*p)[105];\n  p = array;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n\n  int i, j, m = 0;\n  while (1) {\n    if (m < col) {\n      for (i = 0, j = m; j >= 0 && i <= row - 1; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n\n    } else {\n      for (i = m - col + 1, j = col - 1; i <= row - 1 && j >= 0; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    }\n    m++;\n    if (m == row + col)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5918", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100] = {0};\n  int row, col;\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i <= k && i < row && k - i < col && k - i >= 0; i++) {\n      printf(\"%d\\n\", *(*(p + i) + k - i));\n    }\n    for (j = col - 1; j <= k && j >= 0 && k - j < row && k - j > 0; j--) {\n      cout << *(*(p + k - j) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < n; j++)\n    for (l = 0; (l < m) && (l <= j); l++)\n      printf(\"%d\\n\", a[l][j - l]);\n  for (i = 1; i < m; i++)\n    for (k = 0; (k < m - i) && (k < n); k++)\n      cout << a[i + k][n - k - 1] << \"\\n\";\n}\n"}
{"label": "4", "index": "5920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < row - i && col - 1 - j >= 0; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5921", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int row, col, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0, j = k - i; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = col; k <= row + col - 2; k++)\n    for (j = col - 1, i = k - j; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (n = 0; n < col; n++) {\n    for (i = 0; i < n + 1 && i < row; i++) {\n      j = n - i;\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n  for (n = col; n < col + row - 1; n++) {\n    for (i = n - col + 1; i < row && i < n + 1; i++) {\n      j = n - i;\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "5923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m && n < col; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  }\n}\n"}
{"label": "4", "index": "5924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *a[101][101], lie, hang, i, j, h, l;\n  cin >> hang >> lie;\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      a[i][j] = (int *)malloc(sizeof(int));\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      scanf(\"%d\", a[i][j]);\n  for (j = 1; j <= lie; j++) {\n    h = 1;\n    l = j;\n    while (l >= 1 && h <= hang) {\n      cout << *a[h][l] << \"\\n\";\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= hang; i++) {\n    l = lie;\n    h = i;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, p, q;\n  int s[120][120];\n  cin >> m >> n;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  l = 0;\n  i = 1;\n  j = 1;\n  while (l < n * m) {\n    cout << s[i][j] << \" \";\n    l++;\n    if ((j == 1) && (i + 1 <= n)) {\n      j = i + 1;\n      i = 1;\n    } else if ((j == 1) && (i + 1 > n)) {\n      i = i - n + 2;\n      j = n;\n    } else if (i == m) {\n      if (j + i <= n) {\n        j = j + i;\n        i = 1;\n      } else {\n        i = j - n + m + 1;\n        j = n;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "5926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p1[100], *p2, i, j, n, m, s;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    p1[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &*(*(p1 + i) + j));\n  for (s = 0; s < n + m - 1; s++)\n    for (i = 0; i < n; i++) {\n      if (s - i < m)\n        cout << *(*(p1 + i) + s - i) << \"\\n\";\n      if (s - i == 0 || i == n)\n        break;\n    }\n}\n"}
{"label": "4", "index": "5927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, f[100][100], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &f[i][j]);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++) {\n      printf(\"%d\", f[i][j - i]);\n      printf(\"\\n\");\n    }\n  }\n  for (j = 1; j < row; j++) {\n    for (i = j; i < row && i <= j + col - 1; i++) {\n      printf(\"%d\", f[i][col - 1 + j - i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i = 0, j = 0;\n  int row, col;\n\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (; i != (row - 1) || j != (col - 1);) {\n    cout << *(*(a + i) + j) << endl;\n    i++;\n    j--;\n    if (j < 0 || i > row - 1) {\n      if (i + j + 1 < col) {\n        j = i + j + 1;\n        i = 0;\n      } else {\n        i = i + j + 1 - (col - 1);\n        j = col - 1;\n      }\n    }\n  }\n  cout << *(*(a + row - 1) + col - 1);\n}\n"}
{"label": "4", "index": "5929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[row * col];\n  for (int i = 0; i < row * col; ++i)\n    cin >> data[i];\n  int *head = data;\n  for (int i = 0; i < col; ++i) {\n    int *p = head;\n    for (int j = 0; j <= min(i, row - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n    ++head;\n  }\n  --head;\n  for (int i = 1; i < row; ++i) {\n    head += col;\n    int *p = head;\n    for (int j = 0; j <= min(col - 1, row - i - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5930", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, r, c, s;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  }\n  for (s = 0; s < r + c - 1; s++) {\n    for (i = 0; i <= s; i++) {\n      if (i <= r - 1 && s - i <= c - 1) {\n        if (i == 0 && s - i == 0)\n          printf(\"%d\", a[0][0]);\n        else\n          printf(\"\\n%d\", a[i][s - i]);\n      }\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "4", "index": "5931", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p[100][100];\n  int i, j, row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      *(*(p + i) + j) = (int *)malloc(1000);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", *(*(p + i) + j));\n\n  for (j = 1; j <= col; j++) {\n    int h = 1, l = j;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    int l = col, h = i;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      cout << a[i][j] << \"\\n\";\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0}, i, j, m, n = 1;\n  cin >> r >> c;\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++)\n      cin >> a[i][j];\n  }\n  for (i = 1; i < c; i++) {\n    m = i;\n    n = 1;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    m = c;\n    n = i;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], n, m, j, i, k;\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++)\n      a[i][j] = -32767;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = k; i >= 0; i--) {\n      if (a[k - i][i] != -32767)\n        printf(\"%d\\n\", a[k - i][i]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint mhang(int a) { return a + 1; }\nint mlie(int a) { return a - 1; }\nint main() {\n  int sz[100][100];\n  int row, col, i, j, hang = 0, lie = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    hang = 0;\n    lie = i;\n    while (1) {\n      cout << sz[hang][lie] << \"\\n\";\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    hang = i;\n    lie = col - 1;\n    while (1) {\n      printf(\"%d\\n\", sz[hang][lie]);\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5936", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], i, j, row, col, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n <= col + row - 2; n++) {\n    for (i = 0; i < row; i++)\n      if (i <= n && i > n - col)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n}\n"}
{"label": "4", "index": "5937", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, x, y;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i <= col - 1; i++) {\n    x = 0;\n    y = i;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    x = i;\n    y = col - 1;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, m, i, j;\n  int(*p)[1000], (*q)[1000];\n  scanf(\"%d%d\", &row, &col);\n  p = (int(*)[1000])malloc(row * 1000 * sizeof(int));\n  q = p;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(q + i) + j);\n    }\n  }\n  q = p;\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; m >= 0 && i < row; m--, i++) {\n      cout << *(*(q + i) + m) << \" \";\n    }\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; m < row && j >= 0; j--, m++) {\n      printf(\"%d \", *(*(q + m) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "5939", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, min;\n  scanf(\"%d %d \", &m, &n);\n  int a[m][n];\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (j = 0; j <= n - 1; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = 0; i <= min; i++)\n      cout << a[i][j - i] << endl;\n  }\n  for (j = n; j <= m + n - 2; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = j - (n - 1); i <= min; i++)\n      cout << a[i][j - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[1000][1000];\n  int i, j;\n  int m, n;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  }\n  int time = 0;\n  for (j = 1; j <= col; j++) {\n    m = 1;\n    n = j;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    m = i;\n    n = col;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n    int c = 0;\n    for (i = m; i >= 0 && c < a; i--, c++)\n      cout << n[c][i] << \"\\n\";\n  }\n  int y;\n\n  for (x = 1; x < a; x++) {\n    y = b - 1;\n    for (j = x; j < a && y >= 0; j++, y--)\n      cout << n[j][y] << \"\\n\";\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "5942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[200][200];\n  int i, j, row, col, sum;\n\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  if (col >= row) {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5943", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int hang, lie, a[100][100] = {0};\n  scanf(\"%d %d \", &hang, &lie);\n  int i, j, k;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (k = 0; k < (hang + lie - 1); k++) {\n    if (k < lie) {\n      for (i = 0; i < hang && (k - i) > -1; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    } else {\n      for (i = (k - lie + 1); i < hang && (k - i) > -1; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i < col; i++) {\n    cout << *(*(a) + i) << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    cout << *(*(a + i) + col - 1) << \"\\n\";\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row = 0, col = 0, array[100][100];\n  int i = 0, j = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    j = 0;\n    while (j <= i && j < row) {\n      cout << array[j][i - j] << \"\\n\";\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = 0;\n    while (j <= row - i - 1 && j < col) {\n      printf(\"%d\\n\", array[i + j][col - 1 - j]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n  int i, j, n, duijiaoxian;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  duijiaoxian = row + col - 2;\n  for (n = 0; n <= duijiaoxian; n++) {\n    for (i = 0; i <= n; i++) {\n      if (0 <= i && i < row && 0 <= (n - i) && (n - i) < col) {\n        cout << a[i][n - i] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int jz[100][100];\n  int i = 0;\n  int j = 0;\n  int m = 0;\n  int n = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &jz[i][j]);\n  }\n\n  printf(\"%d\\n\", jz[0][0]);\n\n  if (row <= col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n\n  else if (row > col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row && j >= 0; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n  if (row != 1)\n    printf(\"%d\", jz[row - 1][col - 1]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "5948", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, n, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (n = 0; n < row + col - 1; n++)\n    for (i = 0; i <= n; i++) {\n      if (i < row && n - i < col)\n        printf(\"%d\\n\", a[i][n - i]);\n      else\n        continue;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5949", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, *p[100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = i; j >= 0; j--) {\n      if (i - j >= row || j >= col)\n        continue;\n      else\n        printf(\"%d \", *(p[i - j] + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j;\n  int c[100][100];\n  cin >> a >> b;\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  for (i = 0; i < b; i++) {\n    for (j = 0; j <= i && j < a; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n  for (i = b; i < a + b - 1; i++) {\n    for (j = i + 1 - b; j < a && j <= i; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n}\n"}
{"label": "4", "index": "5951", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  int sum;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (sum = 0; sum < col - 1; sum++) {\n    for (j = sum; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  for (sum = col - 1; sum <= row + col - 2; sum++) {\n    for (j = col - 1; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5952", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int time = 0;\n  cin >> row >> col;\n  int array[110][110] = {0}, *p = NULL;\n  int i, j, k;\n  for (i = 0; i < row; i++)\n    for (p = *(array + i); p < *(array + i) + col; p++) {\n      cin >> *p;\n    }\n\n  for (k = 0; k <= col + row; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0, p = *(array + i); p < *(array + i) + col; j++, p++) {\n        if (i + j == k && *p != 0)\n          printf(\"%d\\n\", *p);\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i = 0, j = 0, x = 0, y;\n  cin >> r >> c;\n  y = r + c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  while (x <= y) {\n    for (i = 0; i < r; i++)\n      for (j = 0; j < c; j++)\n        if (i + j == x)\n          cout << a[i][j] << endl;\n    x++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0};\n  int i, j, rs, re, cs, ce, s;\n\n  scanf(\"%d %d \", &r, &c);\n\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (rs = 0, cs = 0, re = 0, ce = 0; (re + ce) < (r + c);) {\n    for (i = rs, j = cs; i <= re && j >= ce; i++, j--) {\n      printf(\"%d\\n\", a[i][j]);\n    }\n    if (cs < (c - 1))\n      cs++;\n    else\n      rs++;\n    if (re < (r - 1))\n      re++;\n    else\n      ce++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, a[1000][1000];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= col - 1; n++) {\n    for (j = n; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n  }\n  for (n = col; n <= row + col - 2; n++) {\n    for (j = col - 1; (j >= 0) && (n - j) <= (row - 1); j--) {\n      cout << a[n - j][j] << \"\\n\";\n    }\n    j = col - 1;\n  }\n}\n"}
{"label": "4", "index": "5956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid out(int sum, int row, int col, int (*a)[200]) \n{\n  int i;              \n  if (sum <= col - 1) \n  {\n    for (i = 0; sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  } else {\n    for (i = sum - (col - 1); sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  }\n}\nint main() {\n  int c, r;\n  cin >> c >> r;\n  int a[200][200];\n  for (int i = 0; i < c; i++)\n    for (int j = 0; j < r; j++)\n      cin >> *(*(a + i) + j);\n  for (int sum = 0; sum <= c + r - 2; sum++)\n    out(sum, c, r, a);\n  return 0;\n}\n"}
{"label": "4", "index": "5957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100], i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row) {\n        printf(\"%d\\n\", array[j][i - j]);\n      }\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (i = col - 1; i >= 0; i--) {\n      if (col - 1 + j - i < row) {\n        printf(\"%d\\n\", array[col - 1 - i + j][i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, row, col, k;\n  scanf(\"%d %d\", &m, &n);\n  for (row = 0; row < m; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (col = k, row = k - col; col < m + n - 1 && col >= 0; col--, row++) {\n      if (col >= n) {\n        continue;\n      } else {\n        if (row >= m) {\n          continue;\n        } else\n          printf(\"%d\\n\", sz[row][col]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5959", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *a, *a0, *b, *p;\n  int row, col;\n  int r, c, t, i;\n\n  scanf(\"%d %d\", &row, &col);\n\n  a = (int *)calloc(100, 100 * sizeof(int));\n\n  a0 = a;\n\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", a + r * col + c);\n    }\n  }\n\n  a = a0;\n  for (c = 0; c < row + col - 1; c++) {\n    r = 0;\n    t = c;\n    for (i = 0; i < row * col; i++) {\n      if (0 <= r && r < row && 0 <= t && t < col) {\n        printf(\"%d\", *(a + r * col + t));\n        if (r != row - 1 || t != col - 1)\n          printf(\"\\n\");\n      }\n      r++;\n      t--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint array_1[100][100];\nvoid out1(int row, int col) {\n  int *p;                       \n  for (int i = 0; i < row; i++) \n  {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < col; i++) \n  {\n    p = &array_1[0][i]; \n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row - col; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < col; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row - col; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nvoid out2(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < row; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row; i < col; i++) {\n    p = array_1[0];\n    p = p + i;\n    cout << *p << endl;\n    for (int j = 1; j < row; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nint main() {\n  int row, col;\n  cin >> row >> col;\n  if (row > col)\n    out1(row, col);\n  else\n    out2(row, col);\n  return 0;\n}\n"}
{"label": "4", "index": "5961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 2; k <= row + col; k++) {\n    if (k <= col + 1) {\n      for (j = k - 1; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n    if (k > col + 1) {\n      for (j = col; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  scanf(\"%d\", &row);\n  return 0;\n}\n"}
{"label": "4", "index": "5962", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int col, row, array[100][100], a, b, c, d, e;\n  scanf(\"%d %d \", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &array[a][b]);\n    }\n  }\n  for (c = 0; c < col; c++) {\n    e = c;\n    for (d = 0; c >= 0 && d < row; d++, c--)\n      printf(\"%d\\n\", array[d][c]);\n\n    c = e;\n  }\n  for (d = 1; d < row; d++) {\n    e = d;\n    for (c = col - 1; d < row && c >= 0; c--, d++) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    d = e;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5963", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  int *array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (k = 0; k <= row + col; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", *(*(array + i) + j));\n}\n"}
{"label": "4", "index": "5964", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, dia, array[101][101], i, j;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  for (dia = 0; dia < row + col - 1; dia++)\n    for (i = 0; i <= dia; i++) {\n      if ((dia - i) < col && i < row)\n        cout << *(*(array + i) + (dia - i)) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "5965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, row, col, rowc, colc;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      colc = j;\n      rowc = i - j;\n      if (colc >= col) {\n        continue;\n      }\n      if (row > col && rowc >= row) {\n        continue;\n      }\n      if (col >= row && rowc == row) {\n        break;\n      }\n      printf(\"%d\\n\", a[rowc][colc]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5966", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, m, i, j, *p = NULL;\n  cin >> n >> m;\n  int a[n][m];\n  for (p = *a; p < *(a) + n * m; p++)\n    cin >> *p;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = *a + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        cout << *(p + (m - 1) * k) << endl;\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5967", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, k, n, j;\n  int ROW, COL, row, col;\n  cin >> ROW >> COL;\n  if (ROW > COL) {\n    j = COL - 1;\n  } else {\n    j = ROW - 1;\n  }\n\n  for (i = 0; i < ROW; i++) {\n    for (k = 0; k < COL; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n    }\n  }\n  for (n = 0; n <= j; n++) {\n    for (row = 0; row <= n; row++) {\n      printf(\"%d\\n\", sz[row][n - row]);\n    }\n  }\n  if (COL > ROW) {\n    for (n = j + 1; n < COL; n++) {\n      for (row = 0; row < ROW; row++) {\n        printf(\"%d\\n\", sz[row][n - row]);\n      }\n    }\n    for (n = COL; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW > COL) {\n    for (n = j + 1; n < ROW; n++) {\n      for (col = COL - 1; col >= 0; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n    for (n = ROW; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW == COL) {\n    for (n = j + 1; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5968", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i, j, a[100][100];\n  double b[100][200];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      b[i][j] = 0.5;\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      b[i][j + i] = a[i][j];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      if (b[i][j] != 0.5)\n        cout << b[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, (*p)[100], i, j, k;\n  scanf(\"%d%d\", &y, &x);\n  p = (int(*)[100])malloc(100 * y * sizeof(int));\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      scanf(\"%d\", *(p + i) + j);\n  i = 0;\n  j = 0;\n  for (k = 0; k < x * y; k++) {\n    printf(\"%d\\n\", *(*(p + i) + j));\n    i++;\n    j--;\n    if (j < 0) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (i >= y) {\n      j = i + j + 1;\n      i = 0;\n    }\n    while (j >= x) {\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, row, col;\n  int a[200][200] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 1; i < row + col + 1; i++)\n    for (j = 1; j <= i; j++)\n      if (a[j][i - j] != 0)\n        printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "5971", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *a, *a0, *b, *p;\n  int row, col;\n  int r, c, t, i;\n\n  scanf(\"%d %d\", &row, &col);\n\n  a = (int *)calloc(100, 100 * sizeof(int));\n\n  a0 = a;\n\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++)\n      scanf(\"%d\", a + r * col + c);\n  }\n\n  a = a0;\n  for (c = 0; c < row + col - 1; c++) {\n    r = 0;\n    t = c;\n    for (i = 0; i < row * col; i++) {\n      if (0 <= r && r < row && 0 <= t && t < col) {\n        printf(\"%d\", *(a + r * col + t));\n        if (r != row - 1 || t != col - 1)\n          printf(\"\\n\");\n      }\n      r++;\n      t--;\n    }\n  }\n}\n"}
{"label": "4", "index": "5972", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], row, col, i, j, x, y;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> array[i][j];\n    }\n  }\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else if (row < col) {\n    for (i = 0; i <= row - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      x = j;\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", array[i][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i + col - row; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      x = i;\n      for (j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[x][j]);\n        x++;\n      }\n    }\n    for (i = row - col + 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i - row + col; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint h, l, (*p)[100];\nvoid shuchu(int a) {\n  int r, c, i = 0;\n  r = 0;\n  c = a;\n  for (; r < h; i++) {\n    if (c >= 0 && c < l)\n      cout << *(*(p + r) + c) << \"\\n\";\n    r += 1;\n    c -= 1;\n  }\n}\n\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &h, &l);\n  p = (int(*)[100])malloc(h * 100 * sizeof(int));\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < h + l - 1; i++)\n    shuchu(i);\n}\n"}
{"label": "4", "index": "5974", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row, array[110][110] = {0}, i, j, p = 0, q = 0, sum, count = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  sum = row * col;\n  while (count != sum) {\n    if (q != 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      p++;\n      q--;\n      continue;\n    }\n    if (q == 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      if (q != col - 2) {\n        q = p + 1;\n        p = 0;\n        if (q > col - 1) {\n          p = q - col + 1;\n          q = col - 1;\n        }\n      } else if (q == col - 2) {\n        p = p - col + 2;\n        q = col - 1;\n      }\n      continue;\n    }\n    if (p == row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      q = p + q + 1;\n      p = 0;\n      if (q > col - 1) {\n        p = q - col + 1;\n        q = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(a[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", *(a[j] + i - j));\n\n  return 0;\n}\n"}
{"label": "4", "index": "5976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int row, col, i, j, k;\n  for (i = 0; i < 1000; i++)\n    for (j = 0; j < 1000; j++)\n      a[i][j] = -12345;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < 1000; j++)\n    for (k = j, i = 0; k >= 0; k--, i++) {\n      if (a[i][k] != -12345)\n        cout << a[i][k] << \"\\n\";\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int hang, lie, a[100][100];\n  cin >> hang >> lie;\n  for (int i = 0; i < hang; i++) {\n    for (int j = 0; j < lie; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int k = 0; k < lie; k++) {\n    for (int l = k; (l >= 0) && (k - l < hang); l--) {\n      cout << a[k - l][l] << endl << endl;\n    }\n  }\n  for (int p = lie; p < hang + lie - 1; p++) {\n    for (int q = lie - 1; (q >= 0) && (p - q < hang); q--)\n      cout << a[p - q][q] << \"\\n\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < col; i++)\n    for (int j = 0; j < row && j <= i; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  for (int i = 1; i < row; i++)\n    for (int j = 0; col - 1 - j >= 0 && i + j < row; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "5979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[m + 1][n + 1];\n  for (int i = 1; i <= m; i++)\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  if (m == 1)\n    for (int i = 1; i <= n; i++)\n      cout << a[1][i] << endl;\n  else if (n == 1)\n    for (int i = 1; i <= m; i++)\n      cout << a[i][1] << endl;\n  else if (m < n) {\n    for (int i = 2; i <= m; i++)\n      for (int j = 1; j < i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    for (int i = m + 1; i <= n + 1; i++)\n      for (int j = i - 1; j >= i - m; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = n + 2; i <= n + m; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  } else if (m >= n) {\n    for (int i = 2; i <= n; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = n + 1; i <= m + 1; i++)\n      for (int j = n; j >= 1; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = m + 2; i <= m + n; i++)\n      for (int j = n; i - j <= m; j--)\n        printf(\"%d\\n\", a[i - j][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid out(int sum, int row, int col, int (*a)[200]) {\n  int i;\n  if (sum <= col - 1) {\n    for (i = 0; sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << \"\\n\";\n  } else {\n    for (i = sum - (col - 1); sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  }\n}\nint main() {\n  int c, r;\n  scanf(\"%d %d \", &c, &r);\n  int a[200][200];\n  for (int i = 0; i < c; i++)\n    for (int j = 0; j < r; j++)\n      cin >> *(*(a + i) + j);\n  for (int sum = 0; sum <= c + r - 2; sum++)\n    out(sum, c, r, a);\n  return 0;\n}\n"}
{"label": "4", "index": "5981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  int p = 0, q = 0;\n  while (p < row && q < col) {\n    int e = 0;\n    while (p + e < row && q - e >= 0) {\n      printf(\"%d\\n\", array[p + e][q - e]);\n      e++;\n    }\n    if (q < col - 1) {\n      q++;\n    } else if (q == col - 1) {\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, hang, lie, (*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &hang, &lie);\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", &*(*(a + i) + j));\n  }\n  if (hang <= lie) {\n    for (j = 0; j < hang; j++) {\n      for (i = j, k = 0; i != -1; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = hang; j < lie; j++) {\n      for (i = j, k = 0; k != hang; i--, k++)\n        printf(\"%d\\n\", *(*(a + k) + i));\n    }\n    for (j = 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--)\n        printf(\"%d\\n\", *(*(a + k) + i));\n    }\n  } else {\n    for (j = 0; j < lie; j++) {\n      for (i = j, k = 0; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = lie; j < hang; j++) {\n      for (i = lie - 1, k = j - lie + 1; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = hang - lie + 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5983", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid out(int sum, int row, int col, int (*a)[200]) {\n  int i;\n  if (sum <= col - 1) {\n    for (i = 0; sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  } else {\n    for (i = sum - (col - 1); sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  }\n}\nint main() {\n  int c, r;\n  scanf(\"%d %d \", &c, &r);\n  int a[200][200];\n  for (int i = 0; i < c; i++)\n    for (int j = 0; j < r; j++)\n      cin >> *(*(a + i) + j);\n  for (int sum = 0; sum <= c + r - 2; sum++)\n    out(sum, c, r, a);\n  return 0;\n}\n"}
{"label": "4", "index": "5984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, l, s[100][100], m, a;\n  scanf(\"%d%d\", &n, &l);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < l; k++) {\n      cin >> s[i][k];\n    }\n  }\n  if (n >= l) {\n    for (m = 0; m < l; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = l; m < n; m++) {\n      for (i = m + 1 - l; i <= m; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < n + l - 1; m++) {\n      for (i = m + 1 - l; i < n; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  } else {\n    for (m = 0; m < n; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < l; m++) {\n      for (i = 0, k = m; i<n, k> m - n; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (a = 1; a < n; a++) {\n      for (i = a, k = l - 1; i < n, k >= l - n + a; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, k, t = 0, a[101][101] = {0};\n  int *p;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  p = (int *)malloc(sizeof(int) * row * col);\n\n  for (i = 0; i < col; i++)\n    for (k = 0, j = i; j >= 0 && k < row; k++, j--) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; j--, k++) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 0; i < row * col; i++)\n    cout << *(p + i) << \"\\n\";\n}\n"}
{"label": "4", "index": "5986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, r, c, num, ro, co;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  r = 1;\n  c = 1;\n  while (1) {\n    ro = r;\n    co = c;\n    while (1) {\n      printf(\"%d\\n\", a[ro][co]);\n      ro++;\n      co--;\n      if (ro > row || co <= 0) {\n        break;\n      }\n    }\n    if (c == col && r == row) {\n      break;\n    }\n    if (c < col) {\n      c++;\n    } else {\n      r++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int i, j;\n  int sum;\n  int a[100][100];\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  for (j = 0;;) {\n    if (j < col - 1) {\n      sum = j;\n      for (;;) {\n        if (sum >= 0 && j - sum < row) {\n          printf(\"%d\\n\", a[j - sum][sum]);\n          sum--;\n        } else {\n          break;\n        }\n      }\n      j++;\n    } else {\n      break;\n    }\n  }\n  for (i = 0;;) {\n    if (i <= row - 1) {\n      sum = col - 1 + i;\n      for (;;) {\n        if (sum >= 0 && col - 1 + i - sum < row) {\n          if (sum <= col - 1) {\n            cout << a[col - 1 + i - sum][sum] << \"\\n\";\n          }\n          sum--;\n        } else {\n          break;\n        }\n      }\n      i++;\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n\n  int a, b, i, j, k;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &p[i][j]);\n  }\n  for (i = 0; i < a + b - 1; i++) {\n    if (i < b)\n      k = 0;\n    if (i >= b)\n      k = i - b + 1;\n    for (j = k; j <= i && j < a; j++) {\n      cout << p[j][i - j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "5989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, *p[100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p[i] + j);\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = i; j >= 0; j--) {\n      if (i - j >= row || j >= col)\n        continue;\n      else\n        cout << *(p[i - j] + j) << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0, k = 0, i, j, x, y, row, col, a[100][100], *p;\n  scanf(\"%d %d \", &row, &col);\n  n = row * col;\n  for (i = 0; i < row; i++) {\n    p = (int *)a + i * 100;\n    for (j = 0; j < col; j++)\n      cin >> *p++;\n  }\n  for (i = 0, j = 0; m < n; i = x, j = y) {\n    m++;\n    p = (int *)a + i * 100 + j;\n    printf(\"%d\\n\", *p);\n    x = i + 1;\n    y = j - 1;\n    if (x >= row || y < 0) {\n      x = 0;\n      y = ++k;\n      if (y >= col) {\n        x = y - col + 1;\n        y = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5991", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[111][111];\n  int *p[111];\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    p[i] = *(a + i);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n\n  for (int i = 0; i < row + col - 1; i++)\n    for (int j = i; j >= 0; j--) {\n      if (j >= col || i - j >= row)\n        continue;\n      if (j < col && i - j < row)\n        cout << *(p[i - j] + j) << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) {\n    k = i;\n    j = 0;\n    while ((k >= 0) && (j <= row - 1)) {\n      cout << array[j][k] << '\\n';\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    j = col - 1;\n    while ((k <= row - 1) && (j >= 0)) {\n      cout << array[k][j] << '\\n';\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[100][100] = {0};\n  int row, col;\n  int i, j, k;\n  cin >> row >> col; \n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }                                     \n  for (k = 0; k < row + col - 1; k++) { \n    for (i = 0; i <= k && i < row && k - i < col && k - i >= 0; i++) {\n      cout << *(*(p + i) + k - i) << endl;\n    } \n    for (j = col - 1; j <= k && j >= 0 && k - j < row && k - j > 0; j--) {\n      cout << *(*(p + k - j) + j) << endl;\n    } \n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5994", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100][100], col, row;\nint main() {\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    };\n  };\n  if (col >= row) {\n    for (k = 0; k <= row - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= col - 1; k++) {\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][k - i]);\n      ;\n    };\n    for (k = col; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n  if (row > col) {\n    for (k = 0; k <= col - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row - 1; k++) {\n      for (i = k - col + 1; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n}\n"}
{"label": "4", "index": "5995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, row, col, rst = 0, cst = 0;\n  int R, C;\n  int a[100][100];\n  scanf(\"%d%d\", &R, &C);\n  for (row = 0; row < R; row++) {\n    for (col = 0; col < C; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n\n  for (i = 0; i < R + C - 1; i++) {\n    row = rst;\n    col = cst;\n    while (row != R && col != -1) {\n      cout << a[row][col] << \"\\n\";\n      row++;\n      col--;\n    }\n    if (cst != C - 1)\n      cst++;\n    else\n      rst++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "5996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= row + col - 2; n++) {\n    for (i = 0; i < row && i <= n; i++) {\n      for (j = 0; j < col && j <= n; j++) {\n        if (i + j == n) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "5997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n = 0;\n  int a[100 + 10][100 + 10] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  i = 0;\n  j = 0;\n  for (int begin = 0; begin < col; begin++) {\n    i = 0;\n    j = begin;\n    while (j >= 0 && i < row)\n      cout << a[i++][j--] << endl;\n  }\n  for (int begin = 1; begin < row; begin++) {\n    i = begin, j = col - 1;\n    while (i < row && j >= 0)\n      cout << a[i++][j--] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, time = 0, i, j, n;\n  int array[110][110];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    if (i < col) {\n      for (int j = 0; j < row && j <= i; j++)\n        cout << *(*(array + j) + i - j) << endl;\n    } else {\n      for (int j = col - 1; j >= i - row + 1 && j >= 0; j--)\n        cout << *(*(array + i - j) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "5999", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void prt(int ary[][100], int a, int b);\n  int array[100][100] = {0};\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int i = 0, j = 0;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  prt(array, row, col);\n}\nvoid prt(int ary[][100], int a, int b) {\n  int min(int c, int d);\n  int max(int e, int f);\n  int k = 0, l = 0;\n  printf(\"%d\", ary[0][0]);\n  for (l = 1; l < b; l++) {\n    int m = l;\n    for (k = 0; k <= min(l, a - 1); k++) {\n      printf(\"\\n%d\", ary[k][m]);\n      m -= 1;\n    }\n  }\n  k = 1;\n  l = b - 1;\n  for (k = 1; k < a; k++) {\n    int n = k;\n    for (l = b - 1; l >= max(0, b - a + k); l--) {\n      printf(\"\\n%d\", ary[n][l]);\n      n += 1;\n    }\n  }\n}\nint min(int c, int d) { return (c >= d ? d : c); }\nint max(int e, int f) { return (e >= f ? e : f); }\n"}
{"label": "4", "index": "6000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, array[100][100], (*p)[100] = array, *q = *p;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int x = 0, j = 0;\n  while (q != array[row - 1] + col - 1) {\n    printf(\"%d\\n\", *q);\n    if (q == *p || *p == array[row - 1]) {\n      x++;\n      if (x >= col) {\n        p = array + x + 1 - col;\n        q = *p + col - 1;\n        j = col - 1;\n      } else {\n        p = array;\n        q = *p + x;\n        j = x;\n      }\n    } else {\n      p++;\n      q = *p + (--j);\n    }\n  }\n  printf(\"%d\", *q);\n  return 0;\n}\n"}
{"label": "4", "index": "6001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int array[m + 1][n + 1];\n  for (int i = 1; i <= m; ++i)\n    for (int t = 1; t <= n; ++t)\n      cin >> array[i][t];\n  int sum = 1;\n  int x[3] = {0, 0, 1};\n  int y[3] = {0, 1, 0};\n  int dx = 1, dy = 1, k = 1;\n  int tx, ty;\n  while (sum <= m * n) {\n    int xx = dx, yy = dy;\n    for (;;) {\n      if (xx > m || yy < 1)\n        break;\n      cout << array[xx][yy] << endl;\n      xx = xx + 1, yy = yy - 1;\n      sum++;\n    }\n    tx = dx + x[k], ty = dy + y[k];\n    if (ty > n) {\n      k++;\n      tx = dx + x[k], ty = dy + y[k];\n    }\n    dx = tx, dy = ty;\n  }\n  \n  return 0;\n}\n"}
{"label": "4", "index": "6002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int z[100][100];\n  int m, n, a, b, c;\n  scanf(\"%d%d\", &m, &n);\n  for (a = 0; a <= m - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      scanf(\"%d\", &z[a][b]);\n    }\n  }\n  a = 0;\n  b = 0;\n  for (c = 0; c <= m * n - 1; c++) {\n    printf(\"%d\\n\", z[a][b]);\n    a++;\n    b--;\n    if ((a > m - 1) || (b < 0)) {\n      while ((a > 0) && (b < n - 1)) {\n        a--;\n        b++;\n      }\n      if ((a == 0) && (b < n - 1))\n        b++;\n      else\n        a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6003", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    a = i;\n    b = 0;\n    for (j = 0; j <= i; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (b == row)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    b = i;\n    a = col - 1;\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (a == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6004", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a, b, k, p;\n  int array[102][102];\n  cin >> a >> b;\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d \", &array[i][j]);\n\n  if (a >= b) {\n    for (j = 0; j < b; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i <= a - b; i++)\n      for (p = i, j = b - 1; j >= 0; p++, j--)\n        cout << array[p][j] << endl;\n    for (i = a - b + 1; i < a; i++)\n      for (p = i, j = b - 1; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  } else {\n    for (j = 0; j < a; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (j = a; j < b; j++)\n      for (k = j, i = 0; i < a; i++, k--)\n        printf(\"%d\\n\", array[i][k]);\n    for (i = 1; i < a; i++)\n      for (j = b - 1, p = i; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  int i = 0, j = 0;\n  for (; i < row; i++) {\n    for (; j < col; j++) {\n      for (int m = i, n = j; m < row && n > -1; m++, n--)\n        printf(\"%d\\n\", a[m][n]);\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int sz[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i <= k && i < m; i++, j--) {\n      cout << sz[i][j] << \"\\n\";\n    }\n    j = k;\n  }\n\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0 && i < m; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n\n    i = k;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[100][100];\n  int i, j, k;\n\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> array[i][j];\n    }\n  }\n  if (col > row) {\n    for (k = 0; k <= row - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = row; k < col - 1; k++) {\n      int s = 0;\n      j = k;\n      i = 0;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != row);\n    }\n\n    for (k = 0; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k <= row - 1; k++) {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  if (col < row) {\n    for (k = 0; k <= col - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k < row - col; k++) {\n      int s = 0;\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != col);\n    }\n\n    for (k = row - col; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k, b[10000];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (j = 0; j < c; j++) {\n    i = 0;\n    for (k = j; k >= 0 && i < r; k--, i++) {\n      cout << a[i][k] << \"\\n\";\n    }\n  }\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    for (k = i; k < r && j >= 0; k++, j--)\n      printf(\"%d\\n\", a[k][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int(*p)[100];\n  p = (int(*)[100])malloc(row * col * sizeof(int));\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  int k;\n  for (k = 0; k < col; k++) {\n    for (i = 0, j = k; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--) {\n      cout << *(*(p + i) + j) << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "6010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, row, col, rst = 0, cst = 0;\n  int R, C;\n  int a[100][100];\n  cin >> R >> C;\n  for (row = 0; row < R; row++) {\n    for (col = 0; col < C; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n\n  for (i = 0; i < R + C - 1; i++) {\n    row = rst;\n    col = cst;\n    while (row != R && col != -1) {\n      cout << a[row][col] << \"\\n\";\n      row++;\n      col--;\n    }\n    if (cst != C - 1)\n      cst++;\n    else\n      rst++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6011", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row;\n  int col;\n  int a[100][100];\n  scanf(\"%d\", &row);\n  cin >> col;\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int t;\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t == 0) {\n      printf(\"\\n%d\", a[0][0]);\n    } else if (t > 0) {\n      if (t <= col - 1) {\n        for (i = t; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      } else {\n        for (i = col - 1; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, t, i, j, k;\n  int a[101][101];\n  cin >> row >> col;\n  t = row + col - 1;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < t; i++)\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++)\n        if ((j + k) == i) {\n          printf(\"%d\\n\", *(*(a + j) + k));\n          break;\n        }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  int max, min;\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  if (row > col) {\n    max = row;\n    min = col;\n  } else {\n    max = col;\n    min = row;\n  }\n\n  for (int i = 0; i < min; i++)\n    for (int j = 0; j <= i; j++)\n      cout << a[j][i - j] << endl;\n\n  if (col != row) {\n    for (int i = min; i < max; i++) {\n      if (col > row)\n        for (int j = 0; j < min; j++)\n          cout << a[j][i - j] << \"\\n\";\n\n      else\n        for (int j = col - 1; j >= 0; j--)\n          cout << a[i - j][j] << endl;\n    }\n  }\n\n  for (int i = max; i <= row + col - 2; i++)\n    for (int j = col - 1; i - j <= row - 1; j--)\n      cout << a[i - j][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int matrix[99][99], row, column, startcolumn = 0, startrow = 1;\n  cin >> row >> column;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < column; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  int x = 0, y;\n  do {\n    y = startcolumn;\n    while (x < row && y >= 0) {\n      cout << matrix[x][y] << endl;\n      x++;\n      y--;\n    }\n    x = 0;\n    startcolumn++;\n  } while (startcolumn < column);\n  int m, n = column - 1;\n  do {\n    m = startrow;\n    while (m < row && n >= 0) {\n      cout << matrix[m][n] << endl;\n      m++;\n      n--;\n    }\n    startrow++;\n    n = column - 1;\n  } while (startrow < row);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, zz[100][100], k, t, i, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> zz[i][j];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    t = i;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    t = n - 1;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, i, j, k, a[120][120];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= col; i++) {\n    k = i;\n    j = 1;\n    while (k >= 1 && j <= row) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n  }\n  for (j = 2; j <= row; j++) {\n    k = col;\n    i = j;\n    while (j <= row && k >= 1) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n    j = i;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100], row, col, i, j, x, y;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else if (row < col) {\n    for (i = 0; i <= row - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      x = j;\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", array[i][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i + col - row; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      x = i;\n      for (j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[x][j]);\n        x++;\n      }\n    }\n    for (i = row - col + 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i - row + col; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, v[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &v[i][j]);\n    }\n  }\n\n  for (int j = 0; j <= col - 1; j++) {\n    int m = j;\n    for (int k = 0; k <= row - 1 && m >= 0; m-- && k++) {\n      printf(\"%d\\n\", v[k][m]);\n    }\n    k = 0;\n  }\n\n  for (int i = 1; i <= row - 1; i++) {\n    int n = i;\n    for (int j = col - 1; n <= row - 1 && j >= 0; n++ && j--) {\n      cout << v[n][j] << \"\\n\";\n    }\n  }\n\n  int z;\n  cin >> z;\n  return 0;\n}\n"}
{"label": "4", "index": "6019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int c = 0; c < m; c++)\n    for (int d = 0; d < n; d++)\n      cin >> a[c][d];\n  int *p[m];\n  for (int j = 0; j < m; j++)\n    p[j] = a[j];\n  for (int k = 0; k <= m + n - 2; k++)\n    for (int c = 0; c < m; c++)\n      for (int d = 0; d < n; d++) {\n        if (c + d == k)\n          printf(\"%d\\n\", *(p[c] + d));\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a[110][110] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (k = 0; k < row + col - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0) {\n      if ((i < row) && (j < col))\n        printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row;\n  int col;\n  int i;\n  int j;\n  int t;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (t = 0; t < col; t++) {\n    for (i = 0; i < row; i++) {\n      j = t - i;\n      if (j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  for (t = col; t <= col + row - 2; t++) {\n    for (j = col - 1;; j--) {\n      i = t - j;\n      if (j < 0)\n        break;\n\n      if (i >= row) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6022", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0, j = 0;;) {\n    printf(\"%d\\n\", a[i][j]);\n    if (i == row - 1 && j == col - 1) {\n      break;\n    } else {\n      if (j == 0) {\n        if (i >= col - 1) {\n          i = i - col + 2;\n          j = col - 1;\n        } else {\n          j = i + 1;\n          i = 0;\n        }\n      } else if (i == row - 1) {\n        if (i + j >= col - 1) {\n          i = (i + j) - col + 2;\n          j = col - 1;\n        } else {\n          j = i + j + 1;\n          i = 0;\n        }\n      } else {\n        i++;\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int jz[100][100];\n  int i = 0;\n  int j = 0;\n  int m = 0;\n  int n = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &jz[i][j]);\n  }\n\n  printf(\"%d\\n\", jz[0][0]);\n\n  if (row <= col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n\n  else if (row > col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row && j >= 0; i++, j--)\n        printf(\"%d\\n\", jz[i][j]);\n    }\n  }\n  if (row != 1)\n    printf(\"%d\", jz[row - 1][col - 1]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, *p[100];\n  for (i = 0; i < 100; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (n = 0; n <= row + col - 2; n++)\n    for (i = 0; i <= n; i++) {\n      j = n - i;\n      if (i < row && j < col)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    }\n}\n"}
{"label": "4", "index": "6025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int row, col;\n  int i, j, he;\n\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (he = 0; he < row + col - 1; he++) {\n    for (j = he; j >= 0; j--) {\n      if (j >= col) {\n        continue;\n      }\n      i = he - j;\n      if (i >= row) {\n        continue;\n      }\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, p, q;\n  int s[120][120];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  l = 0;\n  i = 1;\n  j = 1;\n  while (l < n * m) {\n    printf(\"%d \", s[i][j]);\n    l++;\n    if ((j == 1) && (i + 1 <= n)) {\n      j = i + 1;\n      i = 1;\n    } else if ((j == 1) && (i + 1 > n)) {\n      i = i - n + 2;\n      j = n;\n    } else if (i == m) {\n      if (j + i <= n) {\n        j = j + i;\n        i = 1;\n      } else {\n        i = j - n + m + 1;\n        j = n;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c;\n  cin >> r >> c;\n  int a[r][c];\n  for (int i = 0; i < r; i++)\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (int k = 0; k < r + c - 1; k++) {\n    if (k < c) {\n      for (int i = 0; i < r && k - i >= 0; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    } else {\n      for (int i = c - 1; i >= 0 && k - i < r; i--)\n        cout << *(*(a + k - i) + i) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6028", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int rol, col;\n  scanf(\"%d %d \", &rol, &col);\n  int a[rol][col];\n  int i, j;\n  for (i = 0; i < rol; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int k;\n  for (k = 0; k <= rol + col - 2; k++) {\n    for (i = 0; k - i >= 0 && i < rol; i++) {\n      if (k - i >= col) {\n        continue;\n      }\n      j = k - i;\n      printf(\"%d\\n\", a[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6029", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, l, s[100][100], m, a;\n  scanf(\"%d%d\", &n, &l);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < l; k++) {\n      cin >> s[i][k];\n    }\n  }\n  if (n >= l) {\n    for (m = 0; m < l; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--)\n        printf(\"%d\\n\", s[i][k]);\n    }\n    for (m = l; m < n; m++) {\n      for (i = m + 1 - l; i <= m; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < n + l - 1; m++) {\n      for (i = m + 1 - l; i < n; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  } else {\n    for (m = 0; m < n; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < l; m++) {\n      for (i = 0, k = m; i<n, k> m - n; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (a = 1; a < n; a++) {\n      for (i = a, k = l - 1; i < n, k >= l - n + a; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6030", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n{          \n  int row, col, array[100][100] = {0}, i = 0, j = 0;\n  int flag[100][100] = {0}, k = 0, l = 1;\n  cin >> row >> col;\n  for (i = 0; i < (row * col); i++)\n    cin >> array[i / col][i % col];\n  i = 0;\n  for (k = 0; k < col; k++) {\n    j = k;\n    for (i = 0; i < row; i++) {\n      if ((j != -1) && (i != row)) {\n        cout << array[i][j] << endl;\n        j--;\n      } else\n        break;\n    }\n    if (k == col - 1) {\n      i = 1;\n      for (l = 1; l < row; l++) {\n        j = col - 1;\n        for (i = l; (j != -1) && (i != row); i++) {\n          cout << array[i][j] << endl;\n          j--;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  memset(array, 0, sizeof(array));\n  int i, j, k, row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << array[i][j] << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, m, n, a = 1;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &array[i][j]);\n    }\n  }\n  n = 0;\n  for (m = 0; m < col; m++) {\n    j = m;\n    i = n;\n    do {\n      if (i >= row || j < 0) {\n        break;\n      }\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    do {\n      if (i >= row || j < 0)\n        break;\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n[100][100], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &n[i][j]);\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0, k = i; j < row && k >= 0; j++, k--)\n      if (k < col)\n        printf(\"%d\\n\", n[j][k]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int t = 0; t < row + col - 1; t++)\n    for (j = (col - 1 > t ? t : col - 1); t - j <= row - 1 && j >= 0; j--)\n      printf(\"%d\\n\", *(*(a + t - j) + j));\n  return 0;\n}\n"}
{"label": "4", "index": "6035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  int(*p)[100] = a;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 0; i <= row + col - 2; i++) {\n    if (i < col - 1)\n      for (j = 0; j <= row - 1 && j <= i; j++)\n        cout << *(*(p + j) + i - j) << endl;\n    else\n      for (j = col - 1; i - j <= row - 1 && j >= 0; j--)\n        cout << *(*(p + i - j) + j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  cin >> m >> n;\n  int a[m + 1][n + 1];\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  int k;\n\n  for (k = 1; k <= n; k++)\n    for (i = k; (i >= 1) && (k + 1 - i <= m); i--)\n      printf(\"%d\\n\", a[k + 1 - i][i]);\n\n  for (k = 2; k <= m; k++)\n    for (i = n; (i >= 1) && (k + n - i <= m); i--)\n      cout << a[k + n - i][i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d%d\", &col, &row);\n  int i, j;\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int p;\n  for (p = 0; p < 2 * (row > col ? row : col) - 1; p++) {\n    int k;\n    for (k = 0; (p - k) >= 0; k++) {\n      if (k < col && (p - k) < row)\n        printf(\"%d\\n\", a[k][p - k]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6038", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col;\n  int a[200][200];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n\n  i = 1;\n  j = 1;\n  do {\n    printf(\"%d\\n\", a[i][j]);\n    i++;\n    j--;\n    if (j == 0)\n      if (i + j < col + 1) {\n        j = i;\n        i = 1;\n      } else {\n        i = i + j + 1 - col;\n        j = col;\n      }\n    if (i > row)\n      if (i + j < col + 1) {\n        j = i + j;\n        i = 1;\n      } else {\n        i = row + 2 + j - col;\n        j = col;\n      }\n\n  } while (i <= row);\n  return 0;\n}\n"}
{"label": "4", "index": "6039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    if ((k <= col - 1) && (k <= row - 1)) {\n      for (int l = 0; l <= k; l++) {\n        printf(\"%d\\n\", sz[l][k - l]);\n      }\n    } else if ((k <= col - 1) && (k > row - 1)) {\n      for (int m = 0; m <= row - 1; m++) {\n        printf(\"%d\\n\", sz[m][k - m]);\n      }\n    } else if ((k > col - 1) && (k <= row - 1)) {\n      for (int t = k - col + 1; t <= k; t++) {\n        printf(\"%d\\n\", sz[t][k - t]);\n      }\n    } else if ((k > col - 1) && (k > row - 1)) {\n      for (int p = k - col + 1; p <= row - 1; p++) {\n        cout << sz[p][k - p] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, (*p)[100], row, col, r, c, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < col; i++) {\n    r = 0;\n    c = i;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    r = i;\n    c = col - 1;\n    while (r < row && c >= 0) {\n      cout << *(*(p + r) + c) << \"\\n\";\n      r++;\n      c--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  int a[110][110];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      cin >> a[i][j];\n  for (int j = 0; j < m + n - 1; j++)\n    for (int i = max(0, j - m + 1); i < min(n, j + 1); i++)\n      cout << a[i][j - i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i = 0, j = 0, k = 0;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int(*p)[100] = a;\n  for (k = 0; k < col; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << endl;\n  for (k = col; k <= (row - 1) + (col - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6043", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = 0; i < row && (j - k) >= 0; i++, k++)\n      cout << a[i][j - k] << endl;\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = 0; j >= 0 && (i + k) < row; j--, k++)\n      cout << a[i + k][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6044", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint mins(int x, int y) {\n  if (x > y)\n    return y;\n  else\n    return x;\n}\n\nint maxs(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int row, col, i, j, n;\n  cin >> row >> col;\n  n = row * col;\n  int a[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < mins(row, col); i++) {\n    for (j = 0; j <= i; j++) {\n      cout << a[j][i - j] << endl;\n    }\n  }\n\n  if (row >= col) {\n    for (i = col; i < row; i++) {\n      for (j = i - col + 1; j <= i; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = row; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  } else {\n    for (i = row; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = col; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p[100][100];\n  int n, i, j, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      *(*(p + i) + j) = (int *)malloc(1000);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", *(*(p + i) + j));\n\n  for (j = 1; j <= col; j++) {\n    int h = 1, l = j;\n    while (l >= 1 && h <= row) {\n      cout << **(*(p + h) + l) << \"\\n\";\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    int l = col, h = i;\n    while (l >= 1 && h <= row) {\n      cout << **(*(p + h) + l) << \"\\n\";\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i;\n  int *p, *q;\n  q = (int *)calloc(10001, sizeof(int));\n  scanf(\"%d %d\", &n, &m);\n  for (p = q; p < q + n * m; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m == 1) {\n    for (p = q; p < q + n * m; p++) {\n      printf(\"%d\\n\", *p);\n    }\n  } else {\n    for (i = 0; i < m; i++) {\n      for (p = q + i; (p <= q + i + (m - 1) * i) && (p < q + n * m);\n           p = p + m - 1) {\n        cout << *p << \"\\n\";\n      }\n    }\n    for (i = 2; i <= n; i++) {\n      for (p = q + m * i - 1;\n           (p <= q + m * i - 1 + (m - 1) * (m - 1)) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100] = {0};\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  } \n\n  int step = 0;\n  i = 0;\n  j = 0;\n  int t;\n\n  if (row * col > 0) {\n    printf(\"%d\", a[0][0]);\n    step++;\n  } \n\n  while (step < row * col) \n  {\n\n    if (i + 1 < 0 || j - 1 < 0) \n    {\n\n      t = i;\n      i = j;\n      j = t + 1;              \n      if (i < row && j < col) \n      {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n      if (i < row && j < col) \n      {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6048", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[300][300];\n  int r, c, m, i, j, n, k, a;\n  cin >> r >> c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> sz[i][j];\n\n  for (i = 0; i <= r + c - 2; i++) {\n    for (j = 0;; j++) {\n      k = i - j;\n      if (k < 0)\n        break;\n      if (j < r && k < c)\n        printf(\"%d\\n\", sz[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n < row - 1 + col; n++) {\n    if (n < col) {\n      for (i = n; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        cout << a[n - i][i] << \"\\n\";\n    }\n    if (n > col - 1) {\n      for (i = col - 1; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p;\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 1; i <= col; i++) {\n    j = i;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n  for (i = 2; i <= row; i++) {\n    j = i * col;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n}\n"}
{"label": "4", "index": "6051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int j, i, k;\n  int *p = NULL;\n  for (j = 0; j < row; j++) {\n    p = array[j];\n    for (i = 0; i < col; i++)\n      cin >> *(p + i);\n  }\n  p = array[0];\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", *(p + i * col + j));\n  return 0;\n}\n"}
{"label": "4", "index": "6052", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int array[101][101];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> *(*(array + i) + j);\n\n  for (i = 1; i <= row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j > 0 && i - j <= col && j + 1 <= row)\n        cout << *(*(array + j + 1) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++)\n      cout << *(*(a + j) + i - j) << \"\\n\";\n  for (i = 1; i < row; i++)\n    for (j = 0; j < row - i && j < col; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void prt(int ary[][100], int a, int b);\n  int array[100][100] = {0};\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int i = 0, j = 0;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  prt(array, row, col);\n  return 0;\n}\nvoid prt(int ary[][100], int a, int b) {\n  int min(int c, int d);\n  int max(int e, int f);\n  int k = 0, l = 0;\n  printf(\"%d\", ary[0][0]);\n  for (l = 1; l < b; l++) {\n    int m = l;\n    for (k = 0; k <= min(l, a - 1); k++) {\n      printf(\"\\n%d\", ary[k][m]);\n      m -= 1;\n    }\n  }\n  k = 1;\n  l = b - 1;\n  for (k = 1; k < a; k++) {\n    int n = k;\n    for (l = b - 1; l >= max(0, b - a + k); l--) {\n      printf(\"\\n%d\", ary[n][l]);\n      n += 1;\n    }\n  }\n}\nint min(int c, int d) { return (c >= d ? d : c); }\nint max(int e, int f) { return (e >= f ? e : f); }\n"}
{"label": "4", "index": "6055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[200][200], n, m, j, i, k;\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++)\n      a[i][j] = -32767;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = k; i >= 0; i--) {\n      if (a[k - i][i] != -32767)\n        cout << a[k - i][i] << \"\\n\";\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; k < row && j > -1; j--, k++)\n      cout << array[k][j] << \"\\n\";\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i, k = col - 1; j < row && k > -1; j++, k--) {\n      printf(\"%d\\n\", array[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int r, c;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", &sz[r][c]);\n    }\n  }\n  int k;\n  int first = 1;\n  int min = row - 1;\n  if (col < min + 1) {\n    min = col - 1;\n  }\n\n  for (k = 0; k <= min; k++) {\n    for (r = 0; r <= k; r++) {\n      if (first == 1) {\n        printf(\"%d\", sz[r][k - r]);\n        first = 0;\n      } else {\n        printf(\"\\n%d\", sz[r][k - r]);\n      }\n    }\n  }\n\n  if (row > col) {\n    for (k = 1; k <= row - col; k++) {\n      for (r = k, c = col - 1; c >= 0 && r < row; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  if (row < col) {\n    for (k = 1; k <= col - row; k++) {\n      for (c = row - 1 + k, r = 0; r <= row - 1; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  for (k = min + 1; k >= 1; k--) {\n    for (r = row - k + 1, c = col - 1; r < row; r++, c--) {\n      printf(\"\\n%d\", sz[r][c]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int array[100][100] = {0};\n  int i, j, n;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (n = 0; n < row + col; n++) {\n    for (i = 0, j = n - 1; i < n, j >= 0; i++, j--) {\n      if (i < row && j < col)\n        cout << array[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int *p1, int *p2, int m, int n) {\n  do {\n    printf(\"%d\\n\", *p2);\n    p2 += n - 1;\n  } while ((p2 - p1 + 1) % n && (p2 - p1 + 1) <= m * n);\n}\n\nint main(int argc, char *argv[]) {\n  int r, l, i, j, *q;\n  scanf(\"%d%d\", &r, &l);\n  int *p[l + r - 1];\n  int a[r][l];\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++)\n      scanf(\"%d\", &a[i - 1][j - 1]);\n  for (i = 1; i <= l; i++)\n    p[i - 1] = &a[0][i - 1];\n  for (i = l + 1; i <= l + r - 1; i++)\n    p[i - 1] = &a[i - l][l - 1];\n  q = &a[0][0];\n  for (i = 1; i <= r + l - 1; i++)\n    f(q, p[i - 1], r, l);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i = 0, an[100][100], j = 0, k = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (k = 0; k < n + m - 1; k++) {\n    if (n < m) {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < n && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; j < n; i--, j++) {\n          printf(\"%d\\n\", an[j][i]);\n        }\n      }\n    } else {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < m && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; i >= 0 && j < n; i--, j++) {\n          cout << an[j][i] << \"\\n\";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[102][102], i, j, k;\n  int(*p)[102] = a;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      printf(\"%d\\n\", *(*(p + i) + k));\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      printf(\"%d\", *(*(p + k) + j));\n      if (i != row - 1 || j != col - 1)\n        printf(\"\\n\");\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int row, col;\n  int a[101][101];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 1; j <= col; j++) {\n    cout << a[1][j] << endl;\n    int k = 1;\n    while (((1 + k) <= row) && ((j - k) >= 1)) {\n      cout << a[1 + k][j - k] << endl;\n      k++;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    cout << a[i][col] << endl;\n    int k = 1;\n    while (((i + k) <= row) && ((col - k) >= 1)) {\n      cout << a[i + k][col - k] << endl;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n\n  int sz[100][100];\n  int row, col, ROW, COL;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  cout << sz[0][0] << \" \";\n\n  int i = 0, j, k;\n\n  for (j = 1; j < COL; j++) {\n\n    for (k = j; k >= 0; k--) {\n      if (j - k < ROW) {\n        printf(\"%d \", sz[j - k][k]);\n      }\n    }\n  }\n  for (j = COL; j <= COL + ROW; j++) {\n\n    for (k = COL - 1; k >= 0; k--) {\n      if (j - k < ROW) {\n        printf(\"%d \", sz[j - k][k]);\n      }\n    }\n  }\n\n  scanf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "4", "index": "6064", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[1000][1000], i, j, k;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; i < row && k >= 0; i++, k--)\n      printf(\"%d\\n\", a[i][k]);\n\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; k++, j--)\n      printf(\"%d\\n\", a[k][j]);\n}\n"}
{"label": "4", "index": "6065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid prt(int a[100][100], int i, int j, int m, int n) {\n  static int t = 0;\n  printf(\"%d\\n\", a[i][j]);\n  if (i == m - 1 || j == 0) {\n    t++;\n    if (t < n)\n      prt(a, 0, t, m, n);\n    else if (t < m + n - 1)\n      prt(a, t - n + 1, n - 1, m, n);\n  } else\n    prt(a, i + 1, j - 1, m, n);\n}\nint main() {\n  int i, j, m, n, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  prt(a, 0, 0, m, n);\n  return 0;\n}\n"}
{"label": "4", "index": "6066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num = 0, i, j, row, col, a[105][105], h;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (h = 0; h < col + row - 1; h++) {\n    if (h < col) {\n      for (i = 0; i < row && h - i >= 0 && h - i < col; i++) {\n        j = h - i;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    } else\n      for (j = col - 1; j >= 0 && h - j >= 0 && h - j < row; j--) {\n        i = h - j;\n        printf(\"%d\\n\", a[i][j]);\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, num[110][110] = {0}, (*p)[110], i, j, a = 1,\n      b = col - 1, c, d;\n  p = num;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    a = 1;\n    c = i;\n    cout << *(*(p) + i) << endl;\n    while (i - 1 >= 0 && a < row) {\n      cout << *(*(p + a) + i - 1) << endl;\n      a++;\n      i--;\n    }\n    i = c;\n  }\n  for (j = 1; j < row; j++) {\n    b = col - 1;\n    d = j;\n    cout << *(*(p + j) + col - 1) << endl;\n    while (j + 1 < row && b - 1 >= 0) {\n      cout << *(*(p + j + 1) + b - 1) << endl;\n      j++;\n      b--;\n    }\n    j = d;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if ((i == 1) && (j == 1))\n    printf(\"%d\\n\", array[0][0]);\n  else {\n    for (j = 0; j < col; j++) {\n      k = j;\n      for (i = 0; i < row; i++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[i][k]);\n        k--;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      k = col - 1;\n      for (j = i; j < row; j++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[j][k]);\n        k--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6069", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int col, row, sz[100][100];\n  cin >> row >> col;\n  int l, m;\n  for (l = 0; l < row; l++) {\n    for (m = 0; m < col; m++) {\n      cin >> sz[l][m];\n    }\n  }\n  int i, j, k;\n\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (k == i + j) {\n          printf(\"%d\\n\", sz[i][j]);\n        }\n        if (i + j > k)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int i, j, k, l;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (k = 0; k < col + row - 1; k++)\n    for (l = 0; k - l > -1; l++)\n      if (k - l < col && l < row)\n        cout << array[l][k - l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int(*a)[160], i, j, k, m, n, t;\n  a = (int(*)[160])malloc(110 * sizeof(int));\n\n  scanf(\"%d %d\", &m, &n);\n\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", *(a + j) + i);\n\n  for (k = 0; k < n; k++) {\n\n    for (j = 0, i = k; i >= 0 && j < m; j++, i--)\n      if (i >= 0 && i < n && j >= 0 && j < m)\n        printf(\"%d\\n\", *(*(a + j) + i));\n  }\n  for (k = 1; k < m; k++)\n    for (j = k, i = 0; j < m && i <= n - 1; j++, i++)\n      printf(\"%d\\n\", *(*(a + j) + n - i - 1));\n}\n"}
{"label": "4", "index": "6072", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, row, col, p[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &p[i][j]);\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < i + 1 && j < row; j++) {\n      if (i - j >= col) {\n        continue;\n      }\n      cout << *(*(p + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, a[101][101], *p1, *p2, *p3, j, k;\nint main() {\n  scanf(\"%d %d \", &n, &m);\n  for (p1 = *a, j = 0; j < n; ++j, p1 += 101)\n    for (p2 = p1, k = 0; k < m; ++k, ++p2)\n      cin >> *p2;\n  for (p2 = *a, j = 1; j <= m; ++j, ++p2)\n    for (p3 = p2, k = min(j, n); k--; p3 += 100)\n      cout << *p3 << endl;\n  for (p2 += 100, j = n - 1; j; --j, p2 += 101)\n    for (p3 = p2, k = min(m, j); k--; p3 += 100)\n      cout << *p3 << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6074", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, l, s[100][100], m, a;\n  scanf(\"%d%d\", &n, &l);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < l; k++) {\n      cin >> s[i][k];\n    }\n  }\n  if (n >= l) {\n    for (m = 0; m < l; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = l; m < n; m++) {\n      for (i = m + 1 - l; i <= m; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < n + l - 1; m++) {\n      for (i = m + 1 - l; i < n; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  } else {\n    for (m = 0; m < n; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < l; m++) {\n      for (i = 0, k = m; i<n, k> m - n; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (a = 1; a < n; a++) {\n      for (i = a, k = l - 1; i < n, k >= l - n + a; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6075", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int row, col;\n  int matrix[100 * 100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", matrix + i * 100 + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0 && k < row; j--, k++) {\n      printf(\"%d\\n\", *(matrix + k * 100 + j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; j >= 0 && k < row; j--, k++) {\n      printf(\"%d\\n\", *(matrix + k * 100 + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, p, q;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    p = 0;\n    q = i;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (q >= 0 && p < row);\n  }\n  for (i = 1; i < row; i++) {\n    p = i;\n    q = col - 1;\n    do {\n      cout << a[p][q] << endl;\n      p++;\n      q--;\n    } while (p < row && q >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6077", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[1000][1000];\nint main() {\n  int r, c, i, j, n;\n  cin >> r >> c;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (n = 0; n <= c + r - 2; n++) {\n    for (i = 0; i <= n && i < r; i++) {\n      j = n - i;\n      if (j < c)\n        printf(\"%d \", a[i][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6078", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int i, j, u, t = 0;\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (u = 0;; u++) {\n      if (u >= row || j - u < 0)\n        break;\n      printf(\"%d\\n\", a[u][j - u]);\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (u = 1;; u++) {\n      if (u + j - 1 >= row || col - u < 0)\n        break;\n\n      printf(\"%d\\n\", a[u + j - 1][col - u]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, num[110][110] = {0}, (*p)[110], i, j, a = 1,\n      b = col - 1, c, d;\n  p = num;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  }\n  for (i = 0; i < col; i++) {\n    a = 1;\n    c = i;\n    cout << *(*(p) + i) << endl;\n    while (i - 1 >= 0 && a < row) {\n      printf(\"%d\\n\", *(*(p + a) + i - 1));\n      a++;\n      i--;\n    }\n    i = c;\n  }\n  for (j = 1; j < row; j++) {\n    b = col - 1;\n    d = j;\n    cout << *(*(p + j) + col - 1) << endl;\n    while (j + 1 < row && b - 1 >= 0) {\n      printf(\"%d\\n\", *(*(p + j + 1) + b - 1));\n      j++;\n      b--;\n    }\n    j = d;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int yao[300][300];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &yao[i][j]);\n    }\n  }\n  for (i = n; i < 300; i++) {\n    for (j = 0; j < 300; j++) {\n      yao[i][j] = 00;\n    }\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n\n    for (i = 0; i <= k; i++) {\n      if (yao[i][k - i] != 00) {\n        printf(\"%d\\n\", yao[i][k - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = j = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = j = 0; i <= n + m - 2; i++)\n    for (j = 0; j <= i; j++)\n      if (j >= 0 && j < m && i - j >= 0 && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, r, s, a[100][100];\n  s = 0;\n  scanf(\"%d %d\", &r, &c);\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  while (c * r >= s) {\n    for (int i = 0; i < r; i++) {\n      for (int j = 0; j < c; j++) {\n        if (i + j == s) {\n          cout << a[i][j] << \"\\n\";\n        }\n      }\n    }\n    s++;\n  }\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "4", "index": "6083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int(*p)[100] = a;\n\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j < row; j++) {\n      if (i - j >= 0 && i - j < col) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int z[100][100];\n  int m, n, a, b, c;\n  scanf(\"%d%d\", &m, &n);\n  for (a = 0; a <= m - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      scanf(\"%d\", &z[a][b]);\n    }\n  }\n  a = 0;\n  b = 0;\n  for (c = 0; c <= m * n - 1; c++) {\n    printf(\"%d\\n\", z[a][b]);\n    a++;\n    b--;\n    if ((a > m - 1) || (b < 0)) {\n      while ((a > 0) && (b < n - 1)) {\n        a--;\n        b++;\n      }\n      if ((a == 0) && (b < n - 1))\n        b++;\n      else {\n        a++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, n, j, i, k, *hi, col, row, s, max;\n  scanf(\"%d %d\", &row, &col);\n  s = row * col;\n  int *p = (int *)malloc(10000 * sizeof(int));\n  hi = p;\n  if (col > row)\n    max = col;\n  else\n    max = row;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", p + i);\n  for (j = 0; j < col + row; j++)\n    for (k = 0; k <= j; k++)\n      if (j - k < col && k < row)\n        printf(\"%d\\n\", *(hi + j - k + col * k));\n  return 0;\n}\n"}
{"label": "4", "index": "6086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n = 0;\n  int a[100 + 10][100 + 10] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  i = 0;\n  j = 0;\n  for (int begin = 0; begin < col; begin++) {\n    i = 0;\n    j = begin;\n    while (j >= 0 && i < row)\n      printf(\"%d\\n\", a[i++][j--]);\n  }\n  for (int begin = 1; begin < row; begin++) {\n    i = begin, j = col - 1;\n    while (i < row && j >= 0)\n      cout << a[i++][j--] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6087", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int sz[101][101];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n\n  if (row > col) {\n    int x;\n    for (j = 0; j < col; j++) {\n      for (x = 0; x <= j; x++) {\n        printf(\"%d\\n\", sz[x][j - x]);\n      }\n    }\n    int y;\n    for (i = 1; i <= row - col; i++) {\n      for (y = 0; y < col; y++) {\n        printf(\"%d\\n\", sz[i + y][col - y - 1]);\n      }\n    }\n    int w;\n    for (i = row - col + 1; i < row; i++) {\n      for (w = 0; w < col - 1; w++) {\n        printf(\"%d\\n\", sz[i + w][col - w - 1]);\n        if (i + w == row - 1) {\n          break;\n        }\n      }\n    }\n  } else {\n    int z;\n    for (j = 0; j < row; j++) {\n      for (z = 0; z <= j; z++) {\n        printf(\"%d\\n\", sz[z][j - z]);\n      }\n    }\n    int n;\n    for (j = row; j < col; j++) {\n      for (n = 0; n < row; n++) {\n        printf(\"%d\\n\", sz[n][j - n]);\n      }\n    }\n    int m;\n    for (i = 1; i < row; i++) {\n      for (m = 0; m < row - 1; m++) {\n        printf(\"%d\\n\", sz[i + m][col - m - 1]);\n        if (i + m == row - 1)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, (*p)[100], row, col, r, c, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (i = 0; i < col; i++) {\n    r = 0;\n    c = i;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    r = i;\n    c = col - 1;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[101][101];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(number + i) + j);\n  }\n\n  for (i = 0; i < row + col - 1; i++) {\n    j = 0;\n\n    for (j = 0; i - j >= 0; j++) {\n      if (j >= row || i - j >= col)\n        continue;\n      cout << *(*(number + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6090", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int *a, i, j, row, col;\n  cin >> row >> col;\n  a = (int *)calloc(200, 200 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", a + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 1; (i < row + 1) && (i <= j + 1); i++)\n      printf(\"%d\\n\", *(a + (i - 1) * col + j + 1 - i));\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 1; (j <= col) && (j < row + 1 - i); j++)\n\n      printf(\"%d\\n\", *(a + (i + j - 1) * col + col - j));\n  }\n}\n"}
{"label": "4", "index": "6091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int iRow, iCol, i, j, k, iMax, iMin, p;\n  scanf(\"%d %d \", &iRow, &iCol);\n  if (iRow > iCol) {\n    iMin = iCol;\n    iMax = iRow;\n  } else {\n    iMin = iRow;\n    iMax = iCol;\n  }\n  int a[iMax][iMax];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i <= (iRow - 1); i++)\n    for (j = 0; j <= (iCol - 1); j++)\n      cin >> a[i][j];\n  p = 1;\n  for (k = 0; k <= (iMax * 2 - 2); k++) {\n    if (k > iMax - 1) {\n      for (i = p, j = iMax - 1; (i <= iMax - 1) && (j >= p); i++, j--) {\n        if (a[i][j] != 0) {\n          cout << a[i][j] << endl;\n        } else\n          continue;\n      }\n      p++;\n    } else {\n      for (i = 0, j = k; (i <= k) && (j >= 0); i++, j--) {\n        if (a[i][j] != 0)\n          cout << a[i][j] << endl;\n        else {\n          continue;\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6092", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row, array[110][110] = {0}, i, j, p = 0, q = 0, sum, count = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  sum = row * col;\n  while (count != sum) {\n    if (q != 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      p++;\n      q--;\n      continue;\n    }\n    if (q == 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      if (q != col - 2) {\n        q = p + 1;\n        p = 0;\n        if (q > col - 1) {\n          p = q - col + 1;\n          q = col - 1;\n        }\n      } else if (q == col - 2) {\n        p = p - col + 2;\n        q = col - 1;\n      }\n      continue;\n    }\n    if (p == row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      q = p + q + 1;\n      p = 0;\n      if (q > col - 1) {\n        p = q - col + 1;\n        q = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], row, col, t = 0, flag = 0, max;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  max = (row > col) ? row : col;\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      cout << a[i][j] << \"\\n\";\n    if (i == max - 1 && j == max - 1)\n      break;\n    if (flag == 0) {\n      if (j == 0 && i == max - 1) {\n        flag = 1;\n        t = max;\n        j = max - 1;\n      } else if (j == 0) {\n        t = t + 1;\n        j = t;\n      } else\n        j = j - 1;\n    } else {\n      if (i == max - 1) {\n        t = t + 1;\n        j = max - 1;\n      } else\n        j = j - 1;\n    }\n    i = t - j;\n  }\n}\n"}
{"label": "4", "index": "6094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int R, C, i, j, k, l, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &R, &C);\n  for (i = 0; i < R; i++) {\n    for (j = 0; j < C; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < C; j++) {\n    i = 0;\n    while (i <= j) {\n      k = j - i;\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      if (i > R - 1) {\n        break;\n      }\n    }\n  }\n  for (l = C; l < R + C - 1; l++) {\n    m = l - C + 1;\n    while (m <= l) {\n      n = l - m;\n      cout << a[m][n] << \"\\n\";\n      m++;\n      if (m > R - 1) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[110][110];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1; j > i + col - 1 - row && j >= 0; j--) {\n      cout << *(*(a + i + col - j - 1) + j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (i = n - 1; i >= 0; i--) {\n      if (k - i >= 0 && k - i < m) {\n        cout << a[k - i][i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int row, col, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0, j = k - i; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = col; k <= row + col - 2; k++)\n    for (j = col - 1, i = k - j; i <= row - 1 && j >= 0; i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0, j = 0;;) {\n    printf(\"%d\\n\", a[i][j]);\n    if (i == row - 1 && j == col - 1)\n      break;\n    else {\n      if (j == 0) {\n        if (i >= col - 1) {\n          i = i - col + 2;\n          j = col - 1;\n        } else {\n          j = i + 1;\n          i = 0;\n        }\n      } else if (i == row - 1) {\n        if (i + j >= col - 1) {\n          i = (i + j) - col + 2;\n          j = col - 1;\n        } else {\n          j = i + j + 1;\n          i = 0;\n        }\n      } else {\n        i++;\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, max, s;\n  cin >> row >> col;\n  max = row;\n  if (max < col)\n    max = col;\n  for (i = 0; i < max; i++) {\n    for (j = 0; j < max; j++) {\n      a[i][j] = -1;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (max == 1)\n    printf(\"%d\", a[0][0]);\n  else {\n    i = 0;\n    j = 0;\n    while (j < max) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (j == 0) {\n        j = i + 1;\n        i = 0;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    j = max - 1;\n    i = 1;\n    while (i != max - 1 || j != max - 1) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (i == max - 1) {\n        i = j + 1;\n        j = max - 1;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    if (a[max - 1][max - 1] != -1)\n      printf(\"%d\\n\", a[max - 1][max - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= (m + n - 2); i++) {\n    for (j = 0; j <= (m - 1) && j <= i; j++) {\n      if ((i - j) <= (n - 1))\n        cout << a[j][i - j] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], col, row, t, i, j;\n  scanf(\"%d %d \", &row, &col);\n  if (row > col)\n    t = row;\n  else\n    t = col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 2; i <= 2 * t; i++) {\n    for (j = 1; j < i; j++) {\n      if (j <= row && i - j <= col) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6102", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, p, q;\n  int a[100][100];\n  cin >> row >> col;\n  int temp_r, temp_c;\n  for (p = 0; p < row; p++) {\n    for (q = 0; q < col; q++) {\n      cin >> a[p][q];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    temp_r = 0;\n    temp_c = i;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    temp_r = j;\n    temp_c = col - 1;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "4", "index": "6103", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, n, m, row, col;\n  int a[200][200] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (i = 1; i < row + col + 1; i++)\n    for (j = 1; j <= i; j++)\n      if (a[j][i - j] != 0)\n        printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> array[i][j];\n  for (i = 2; i <= row + col; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if ((j <= row) && (i - j <= col))\n        cout << array[j][i - j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6105", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  int a[110][110];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int j = 0; j < m + n - 1; j++)\n    for (int i = max(0, j - m + 1); i < min(n, j + 1); i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  return 0;\n}\n"}
{"label": "4", "index": "6106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n, i, j, k, a[120][120];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= col; i++) {\n    k = i;\n    j = 1;\n    while (k >= 1 && j <= row) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n  }\n  for (j = 2; j <= row; j++) {\n    k = col;\n    i = j;\n    while (j <= row && k >= 1) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n    j = i;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6107", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  k = row + col;\n  for (a = 0; a < k - 1; a++) {\n    for (i = 0; i <= a; i++)\n      if (i < row && (a - i) < col)\n        printf(\"%d\\n\", array[i][a - i]);\n      else if (i >= row)\n        i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][100] = {0}, m, n, b[10000] = {0};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    k = i;\n    while (k != -1 && j < m) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    j = n - 1;\n    k = i;\n    while (k < m && a[k][j] != 0) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][100] = {0}, m, n, b[10000] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    k = i;\n    while (k != -1 && j < m) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    j = n - 1;\n    k = i;\n    while (k < m && a[k][j] != 0) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (i = n - 1; i >= 0; i--) {\n      if (k - i >= 0 && k - i < m)\n        printf(\"%d\\n\", a[k - i][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int sz[100][100];\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i <= k && i < m; i++, j--) {\n      printf(\"%d\\n\", sz[i][j]);\n    }\n    j = k;\n  }\n\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0 && i < m; i++, j--) {\n      cout << sz[i][j] << \"\\n\";\n    }\n    i = k;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void paixu(int a[][100], int x, int y);\n  int i, j, a[100][100], col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  paixu(a, row, col);\n  return 0;\n}\n\nvoid paixu(int a[][100], int x, int y) {\n  int sum = 0, i, j, k;\n  k = x + y;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < x && j < y)\n        printf(\"\\n%d\", a[i][j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "6113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n  int i, j, n, duijiaoxian;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  duijiaoxian = row + col - 2;\n  for (n = 0; n <= duijiaoxian; n++) {\n    for (i = 0; i <= n; i++) {\n      if (0 <= i && i < row && 0 <= (n - i) && (n - i) < col) {\n        cout << a[i][n - i] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6114", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, t, i, j, k;\n  int a[101][101];\n  cin >> row >> col;\n  t = row + col - 1;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < t; i++)\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        if ((j + k) == i) {\n          printf(\"%d\\n\", *(*(a + j) + k));\n          break;\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "6115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, zz[100][100], k, t, i, j;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> zz[i][j];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    t = i;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    t = n - 1;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, r, c, ro, co;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  r = 1;\n  c = 1;\n  while (1) {\n    ro = r;\n    co = c;\n    while (1) {\n      printf(\"%d\\n\", a[ro][co]);\n      ro++;\n      co--;\n      if (ro > row || co <= 0) {\n        break;\n      }\n    }\n    if (c == col && r == row) {\n      break;\n    }\n    if (c < col) {\n      c++;\n    } else {\n      r++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) {\n    k = i;\n    j = 0;\n    while ((k >= 0) && (j <= row - 1)) {\n      printf(\"%d\\n\", array[j][k]);\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    j = col - 1;\n    while ((k <= row - 1) && (j >= 0)) {\n      cout << array[k][j] << '\\n';\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  j = 0;\n  for (i = 0; i < row; i++) {\n    if (i == 0) {\n      while (j <= col - 1) {\n        cout << array[i][j] << endl;\n        for (int k = i + 1; k < row; k++) {\n          if (i + j - k >= 0)\n            cout << array[k][i + j - k] << endl;\n        }\n        j++;\n      }\n    } else {\n      j = col - 1;\n      cout << array[i][j] << endl;\n      for (int k = i + 1; k < row; k++) {\n        if (i + j - k >= 0)\n          cout << array[k][i + j - k] << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, (*a)[100];\n  a = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + k - i) << \"\\n\";\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      cout << *(*(a + k + i) + col - 1 - i) << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "6120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], b[10000], i, j, sum, t = 0; \n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++) {\n      cin >> a[i][j];\n    }\n  for (sum = 2; sum <= (n + m); sum++) {\n\n    for (j = 1; j <= n; j++)\n\n    {\n      if ((sum - j) > 0 && (sum - j) <= m) {\n        t++;\n        b[t] = a[j][sum - j];\n      }\n    }\n  }\n\n  for (i = 1; i <= (m * n); i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int r, c, i, j, s;\n  scanf(\"%d%d\", &r, &c);\n  int x[100][100];\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      cin >> x[i][j];\n    }\n  }\n  s = 0;\n  while (s <= r + c - 2) {\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < c; j++) {\n        if (i + j == s) {\n          printf(\"%d\\n\", x[i][j]);\n        }\n      }\n    }\n\n    s++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6122", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= (m + n - 2); i++) {\n    for (j = 0; j <= (m - 1) && j <= i; j++) {\n      if ((i - j) <= (n - 1))\n        printf(\"%d \", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, t, i, j, k;\n  int a[101][101];\n  scanf(\"%d %d \", &row, &col);\n  t = row + col - 1;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < t; i++)\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        if ((j + k) == i) {\n          cout << *(*(a + j) + k) << endl;\n          break;\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "6124", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int(*p)[100];\n  p = (int(*)[100])malloc(row * col * sizeof(int));\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  int k;\n  for (k = 0; k < col; k++) {\n    for (i = 0, j = k; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, *p[100], i, j, v;\n  for (i = 0; i < 100; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\\n\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", (p[i] + j));\n  for (v = 0; v <= r + c - 2; v++) {\n    for (i = 0; i <= v; i++) {\n      if (i < r) {\n        j = v - i;\n        if (j < c)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6126", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid bianli() {\n  int a[1000][1000], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      printf(\"%d \", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\nint main() {\n  bianli();\n  return 0;\n}\n"}
{"label": "4", "index": "6127", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0; \n  cin >> row >> col;                  \n  int a[row][col];                    \n  for (i = 0; i < row; i++)           \n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < col; i++) \n    for (j = 0; j <= i && j < row; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  for (i = 1; i < row; i++) \n    for (j = 0; j < row - i && j < col; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0, j = 0;;) {\n    printf(\"%d\\n\", a[i][j]);\n    if (i == row - 1 && j == col - 1)\n      break;\n    else {\n      if (j == 0) {\n        if (i >= col - 1) {\n          i = i - col + 2;\n          j = col - 1;\n        } else {\n          j = i + 1;\n          i = 0;\n        }\n      } else if (i == row - 1) {\n        if (i + j >= col - 1) {\n          i = (i + j) - col + 2;\n          j = col - 1;\n        } else {\n          j = i + j + 1;\n          i = 0;\n        }\n      } else {\n        i++;\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6129", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col;\n\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    for (int j = 0; j < row; j++) {\n      if (j >= 0 && j < row && i - j >= 0 && i - j < col)\n        cout << a[j][i - j] << endl;\n      else\n        continue;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6130", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col, i, j, s, *p = NULL;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n      \n    }\n  for (s = 0; s <= row + col - 2; s++) \n  {\n    for (i = 0; i < row; i++)\n      if (s - i < col && s - i >= 0) {\n        cout << *(*(a + i) + s - i) << endl;\n        \n      }\n  }\n  return 0;\n}\n\n"}
{"label": "4", "index": "6131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long p, q, r, l, i, x, j;\n  long a[202][202] = {0}, b[202] = {0};\n  scanf(\"%ld%ld\", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i--;\n  j--;\n  for (p = 2; p <= i + j; p++)\n    for (q = 0; q < b[p]; q++)\n      printf(\"%ld\\n\", a[p][q]);\n  return 0;\n}\n"}
{"label": "4", "index": "6132", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[100][100];\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++)\n      cin >> num[i][j];\n  }\n  for (int k = 0; k < n + m - 1; k++) {\n    if (k < m) {\n      for (int i = 0; k >= i && i < n; i++)\n        printf(\"%d\\n\", num[i][k - i]);\n    } else {\n      for (int i = k - m + 1; i < n && k >= i; i++)\n        cout << num[i][k - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int matrix[120][120];\n  cin >> row >> col;\n  int *p[100];\n  for (int i = 0; i < row; i++) {\n    p[i] = &matrix[i][0];\n    for (int j = 0; j < col; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  if (col >= row) {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  } else {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << \"\\n\";\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row && j >= 0; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n;\n  int sz[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (row > col) {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < col; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; j >= 0; j--) {\n        if (n - j < row) {\n          cout << sz[n - j][j] << \"\\n\";\n        }\n      }\n    }\n  } else {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < row; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; n - j < row; j--) {\n        printf(\"%d\\n\", sz[n - j][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, sum, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      cin >> a[i - 1][j - 1];\n  }\n  for (sum = 0; sum <= col - 1; sum++) {\n    for (i = 0; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n  for (sum = col; sum <= col + row - 2; sum++) {\n    for (i = sum - col + 1; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6136", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col, i, j;  \n  int array[100][100]; \n  cin >> row >> col;\n  for (i = 1; i <= row; i++) \n    for (j = 1; j <= col; j++)\n      cin >> array[i][j];\n  for (i = 2; i <= row + col; i++) \n    for (j = 1; j <= i - 1; j++) {\n      if ((j <= row) && (i - j <= col))\n        cout << array[j][i - j] << endl; \n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long p, q, r, l, i, x, j;\n  long a[202][202] = {0}, b[202] = {0};\n  scanf(\"%ld%ld\", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i--;\n  j--;\n  for (p = 2; p <= i + j; p++)\n    for (q = 0; q < b[p]; q++) {\n      printf(\"%ld\\n\", a[p][q]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n\n    for (i = m, j = 0; i >= 0 && j < a; i--, j++) {\n      cout << n[j][i] << \"\\n\";\n    }\n  }\n\n  for (x = 1; x < a; x++) {\n\n    for (j = x, i = b - 1; j < a && i >= 0; j++, i--)\n      cout << n[j][i] << \"\\n\";\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "6139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, row = 0, col = 0, i = 0, j = 0, min = 0, rowbegin = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  min = row < col ? row : col;\n  while (k <= col + row - 1) {\n    i = 0;\n    if (k > col - 1)\n      rowbegin++;\n\n    for (i = rowbegin; i <= k && i < row; i++) {\n      cout << a[i][k - i] << \"\\n\";\n    }\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j, k;\n  int c[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  if (b > a) {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < b - a; k++) {\n      i = 0;\n      j = a + k;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else if (b < a) {\n    for (k = 0; k < b; k++) {\n      i = 0;\n      j = k;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - b; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < b - 1; k++) {\n      i = a - b + 1 + k;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        cout << c[i][j] << \"\\n\";\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6141", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int j, i, k;\n  int *p = NULL;\n  for (j = 0; j < row; j++) {\n    p = array[j];\n    for (i = 0; i < col; i++)\n      cin >> *(p + i);\n  }\n  p = array[0];\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          cout << *(p + i * col + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6142", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, row, col, rowc, colc;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      colc = j;\n      rowc = i - j;\n      if (colc >= col) {\n        continue;\n      }\n      if (row > col && rowc >= row) {\n        continue;\n      }\n      if (col >= row && rowc == row) {\n        break;\n      }\n      printf(\"%d\\n\", a[rowc][colc]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6143", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row;\n  int mat[200][200];\n  int i, j;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> mat[i][j];\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      printf(\"%d\\n\", mat[i][j]);\n    if (i == row - 1 && j == col - 1)\n      break;\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, array[100][100], a, b, c, d, e;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &array[a][b]);\n    }\n  }\n  for (c = 0; c < col; c++) {\n    e = c;\n    for (d = 0; c >= 0 && d < row; d++, c--) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    c = e;\n  }\n  for (d = 1; d < row; d++) {\n    e = d;\n    for (c = col - 1; d < row && c >= 0; c--, d++) {\n      printf(\"%d\\n\", array[d][c]);\n    }\n    d = e;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][100] = {0}, m, n, b[10000] = {0};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    k = i;\n    while (k != -1 && j < m) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    j = n - 1;\n    k = i;\n    while (k < m && a[k][j] != 0) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, col, i, j, k, sum;\n  cin >> row >> col;\n  sum = row + col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 2; k <= sum; k++) {\n    if (k <= col + 1) {\n      i = 1;\n      j = k - 1;\n      do {\n        cout << a[i][j] << endl;\n        ;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    } else {\n      i = k - col;\n      j = k - i;\n      do {\n        cout << a[i][j] << endl;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  int i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; ++i)\n    for (j = 0; j < col; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < col; ++i)\n    for (j = 0; (i - j >= 0) && (j < row); ++j)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < row; ++i)\n    for (j = 0; (j < col) && (i + j < row); ++j)\n      cout << a[i + j][col - j - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, z, i, sz[100][100], k;\n  scanf(\"%d %d\", &h, &z);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < z; k++) {\n      cin >> sz[i][k];\n    }\n  }\n  for (i = 0; i <= h + z - 2; i++) {\n    for (k = 0; k < h; k++) {\n      if (i - k < 0 || i - k >= z)\n        continue;\n      else {\n        cout << sz[k][i - k] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6149", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, x, sum, y, z;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  sum = 0;\n  j = 0;\n  x = 0;\n  y = 1;\n  z = 0;\n  if (col >= row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        if (j + row + 1 < col) {\n          j = j + row + 1;\n          i = 0;\n        } else if (j + row + 1 >= col) {\n          j = j + row - x;\n          i = 1 + x;\n          x++;\n        }\n      } else if (j < 0 && i < row) {\n        j = j + 1 + y;\n        i = 0;\n        y++;\n      }\n      if (sum == col * row)\n        break;\n    }\n  } else if (col < row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        j = col - 1;\n        i = i - col + 1 + x;\n        x++;\n      } else if (i < row && j < 0) {\n        if (j + 1 + y < col) {\n          j = j + 1 + y;\n          i = 0;\n          y++;\n        } else if (j + 1 + y >= col) {\n          j = col - 1;\n          i = z + 1;\n          z++;\n        }\n      }\n      if (sum == col * row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int i, j, k, row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = row;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++) {\n        printf(\"%d\\n\", array[j][sum - j]);\n      }\n      sum++;\n    }\n  } else if (col > row) {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = col - 1;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++) {\n        printf(\"%d\\n\", array[j][sum + k - j]);\n      }\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = col; k < row; k++) {\n      for (i = col - 1; i >= 0; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n    }\n    sum = 0;\n    for (k = row; k < row + col - 1; k++) {\n      for (i = col - 1; i > sum; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n      sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int heng, lie, i, j, k, l;\n  scanf(\"%d %d\", &heng, &lie);\n  int **p;\n  p = (int **)malloc(heng * sizeof(int *));\n  for (i = 0; i < heng; i++) {\n    *(p + i) = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < lie; j++) {\n    for (k = j, l = 0; k >= 0; k--, l++) {\n      if (l < heng)\n        cout << *(*(p + l) + k) << \"\\n\";\n      else\n        break;\n    }\n  }\n  for (j = lie; j < heng + lie - 1; j++) {\n    for (k = lie - 1, l = j - (lie - 1); k >= 0; k--, l++) {\n      if (l < heng)\n        cout << *(*(p + l) + k) << \"\\n\";\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000];\n  int m, n;\n  cin >> m >> n;\n  int i;\n  for (i = 0; i < m * n; i++) {\n    cin >> a[i];\n  }\n  int *p;   \n  int temp; \n  temp = 0;\n  int num = m + n - 1;\n  while (num--) {\n    p = a + temp; \n    i = temp;     \n    while (i % n != 0 && i / n != m - 1) {\n      cout << *p << endl;\n      p = p + (n - 1);\n      i += (n - 1);\n    }\n    cout << *p << endl;\n    if (temp < n - 1) {\n      temp++;\n    } else {\n      temp += n;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0}, n = 0, m = 0, i = 0, j = 0;\nvoid bianli(int hang, int lie) {\n  if (lie == 0 || hang == n - 1)\n    cout << a[hang][lie] << endl;\n  else {\n    cout << a[hang][lie] << endl;\n    bianli(hang + 1, lie - 1);\n  }\n}\nint main() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < m; i++) {\n    bianli(0, i);\n  }\n  for (i = 1; i < n; i++) {\n    bianli(i, m - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[100][100] = {0};\n  int *p = a[0];\n  for (p = a[0]; p < a[0] + n * m; p++) {\n    cin >> *p;\n  }\n  if (n == 1 || m == 1) {\n    for (int k = 0; k < n * m - 1; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            printf(\"%d\\n\", *p);\n          }\n        }\n      }\n    }\n    cout << *(a[0] + n * m - 1);\n  } else {\n    for (int k = 0; k < n * m - 2; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            cout << *p << endl;\n          }\n        }\n      }\n    }\n\n    cout << *(a[0] + m * n - 1);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, k[100][100];\nvoid display(int i, int j) {\n  if (i >= m || j >= n || i < 0 || j < 0) {\n    return;\n  } else {\n    cout << k[i][j] << endl;\n    display(i + 1, j - 1);\n  }\n}\nint main() {\n  int i = 0, j = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> k[i][j];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    display(0, j);\n  }\n  for (i = 1; i < m; i++) {\n    display(i, n - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ro, co, sz[100][1000], i, j, m, k, c = 0, b = 1;\n  scanf(\"%d%d\", &ro, &co);\n  for (i = 0; i < ro; i++) {\n    for (j = 0; j < co; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  m = ro * co;\n  i = 0;\n  j = 0;\n  for (k = 0; k < m; k++) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (ro >= co) {\n      if (j == 0 && i < co - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if ((j < 0 && i > co - 1) || i > ro - 1) {\n        j = co - 1;\n        i = c + 1;\n        c++;\n      }\n    }\n    if (ro < co) {\n      if (j == 0 && i <= ro - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if (i > ro - 1) {\n        i = 0;\n        j = ro + c + 1;\n        c++;\n      }\n\n      if (j > co - 1) {\n        j = co - 1;\n        i = b;\n        b++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100] = {0}, i = 0, j = 0;\n  int k = 0, l = 1;\n  cin >> row >> col;\n  for (i = 0; i < (row * col); i++)\n    cin >> array[i / col][i % col];\n  i = 0;\n  for (k = 0; k < col; k++) {\n    j = k;\n    for (i = 0; i < row; i++) {\n      if ((j != -1) && (i != row)) {\n        cout << array[i][j] << endl;\n        j--;\n      } else\n        break;\n    }\n    if (k == col - 1) {\n      i = 1;\n      for (l = 1; l < row; l++) {\n        j = col - 1;\n        for (i = l; (j != -1) && (i != row); i++) {\n          printf(\"%d\\n\", array[i][j]);\n          j--;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, s, sz[100][100], R, C;\n  scanf(\"%d%d\", &R, &C);\n  for (s = 0; s < R; s++) {\n    printf(\"\\n\");\n    for (r = 0; r < C; r++) {\n      scanf(\"%d\", &sz[s][r]);\n    }\n  }\n  for (s = 0; s < C + R - 1; s++) {\n    for (r = 0; r <= s; r++) {\n      if (s - r >= C)\n        continue;\n      if (r >= R)\n        break;\n      printf(\"%d\\n\", sz[r][s - r]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k, b[10000];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (j = 0; j < c; j++) {\n    i = 0;\n    for (k = j; k >= 0 && i < r; k--, i++)\n      cout << a[i][k] << \"\\n\";\n  }\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    for (k = i; k < r && j >= 0; k++, j--)\n      printf(\"%d\\n\", a[k][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, row, col, x, y;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= col - 1; i++) {\n    x = 0;\n    y = i;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    x = i;\n    y = col - 1;\n    do {\n      cout << a[x][y] << \"\\n\";\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, m, i, j, shu[100][100], hang = 1, lie = 1, count, mark, zddjx, duijiao,\n                                 jh = 1, jl = 1;\n  cin >> n >> m;\n  count = n * m;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= m; j++) {\n      cin >> shu[i][j];\n    }\n  }\n  if (n == 1) {\n    for (j = 1; j <= m; j++) {\n      printf(\"%d\\n\", shu[1][j]);\n    }\n  }\n  if (n == 1) {\n    return 0;\n  }\n  if (m == 1) {\n    for (j = 1; j <= n; j++)\n      cout << shu[j][1] << endl;\n\n    return 0;\n  }\n  if (m == 1) {\n    return 0;\n  }\n  cout << shu[hang][lie] << endl;\n  duijiao = hang + lie;\n  count--;\n  while (count != 0) {\n    duijiao++;\n    hang = jh;\n    lie = duijiao - hang;\n    if (lie == m) {\n      jh++;\n    }\n    while (lie >= jl) {\n      printf(\"%d\\n\", shu[hang][lie]);\n      count--;\n      hang++;\n      lie--;\n    }\n    if (hang == n + 1) {\n      jl++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6162", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int col, row, sz[99][99], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i && j < row; j++)\n      printf(\"%d\\n\", sz[j][i - j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j + i < row && j < col; j++) {\n      printf(\"%d\\n\", sz[i + j][col - j - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  int sum;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (sum = 0; sum < col - 1; sum++) {\n    for (j = sum; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << \"\\n\";\n    }\n  }\n  for (sum = col - 1; sum <= row + col - 2; sum++) {\n    for (j = col - 1; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int time = 0;\n  cin >> row >> col;\n  int array[110][110] = {0}, *p = NULL;\n  int i, j, k;\n  for (i = 0; i < row; i++)\n    for (p = *(array + i); p < *(array + i) + col; p++)\n      cin >> *p;\n  \n  \n  \n  for (k = 0; k <= col + row; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0, p = *(array + i); p < *(array + i) + col; j++, p++) {\n        if (i + j == k && *p != 0)\n          cout << *p << endl;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, col, row, array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  int cxx = 0, csx, rxx = 0, rsx;\n  for (i = 0; i < col; i++) {\n    csx = i;\n    rxx = 0;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    rxx = j;\n    csx = col - 1;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "4", "index": "6166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  int **a;\n  a = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    a[i] = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  int len;\n  for (len = 0; len < row + col - 1; len++) {\n    for (i = 0; i < row; i++) {\n      j = len - i;\n      if ((j < col) && (j >= 0))\n        printf(\"%d\\n\", *(*(a + i) + len - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int t, i, j, a, ROW, COL;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (t = 0; t < ROW + COL - 1; t++) {\n    if (ROW - 1 >= t) {\n      a = t;\n    } else {\n      a = ROW - 1;\n    }\n    i = 0;\n    while (i < a + 1) {\n      if (i < t - COL + 1) {\n        i = t - COL + 1;\n      }\n      j = t - i;\n      cout << sz[i][j] << \"\\n\";\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lin, col;\n  cin >> lin >> col;\n  int i, j;\n  int num[100][100];\n  for (i = 0; i < lin; i++) {\n    for (j = 0; j < col; j++)\n      cin >> num[i][j];\n  }\n  if (lin <= col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j && i < lin; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; j >= i && col + i - 1 - j < lin; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  } else {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; col - 1 + i - j < lin && j >= 0; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6169", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint x[1000][1000];\nvoid f(int i, int j) {\n  cout << x[i][j] << endl;\n  if (i == m && j == n)\n    return;\n  else if (j == 1 && i + 1 <= n)\n    f(1, i + 1);\n  else if (j == 1 && i + 1 > n)\n    f(i + j - n + 1, n);\n  else if (i == m && i + j <= n)\n    f(1, i + j);\n  else if (i == m && i + j > n)\n    f(i + j - n + 1, n);\n  else\n    f(i + 1, j - 1);\n}\nint main() {\n  scanf(\"%d %d \", &m, &n);\n  int i, j;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      cin >> x[i][j];\n  f(1, 1);\n  return 0;\n}\n"}
{"label": "4", "index": "6170", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, row, col, p[100][100];\n  cin >> row >> col; \n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> p[i][j];\n    }\n  } \n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < i + 1 && j < row; j++) {\n      if (i - j >= col)\n        continue;\n      cout << *(*(p + j) + i - j) << endl;\n    } \n  }\n  return 0;\n} \n"}
{"label": "4", "index": "6171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, time = 0, n, i, j;\n  int array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (n = 0; n < row + col; n++) {\n    if (col < row) {\n      if (n < col) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < row) {\n        for (i = col - 1; i >= 0; i--)\n          printf(\"%d \", array[n - i][i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row < col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          cout << array[i][n - i] << \" \";\n      } else if (n < col) {\n        for (i = 0; i <= row - 1; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row == col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      }\n\n      else {\n        for (i = row - 1; i > n - col; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; k < row && j > -1; j--, k++)\n      printf(\"%d\\n\", array[k][j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i, k = col - 1; j < row && k > -1; j++, k--) {\n      cout << array[j][k] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6173", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0, j = 0;;) {\n    printf(\"%d\\n\", a[i][j]);\n    if (i == row - 1 && j == col - 1) {\n      break;\n    } else {\n      if (j == 0) {\n        if (i >= col - 1) {\n          i = i - col + 2;\n          j = col - 1;\n        } else {\n          j = i + 1;\n          i = 0;\n        }\n      } else if (i == row - 1) {\n        if (i + j >= col - 1) {\n          i = (i + j) - col + 2;\n          j = col - 1;\n        } else {\n          j = i + j + 1;\n          i = 0;\n        }\n      } else {\n        i++;\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, **p, col, row, sum;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", *(p + i) + j);\n    }\n  k = row + col;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < row && j < col)\n        printf(\"\\n%d\", *(*(p + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "6175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0, i, j, r, c, t, *a, p;\n  cin >> r >> c;\n  a = (int *)calloc(r * c, sizeof(int));\n  for (i = 0; i < r * c; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < c; i++) {\n    j = 0;\n    t = i;\n    while (t >= 0 && j < r) {\n      cout << *(a + j * c + t);\n      printf(\" \");\n      t--;\n      j++;\n    }\n  }\n\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    t = i;\n    while (t < r && j >= 0) {\n      printf(\"%d\", *(a + t * c + j));\n      if (!(j == c - 1 && t == r - 1))\n        cout << \" \";\n      j--;\n      t++;\n    }\n  }\n}\n"}
{"label": "4", "index": "6176", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], i, j, num = 1, k, l, t;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cout << a[i][j] << endl;\n      }\n    }\n    return 0;\n  }\n  k = 0;\n  l = 0;\n  while (1) {\n    if (k < n && l < m)\n      cout << a[k][l] << endl;\n    if (l != 0) {\n      k++;\n      l--;\n      continue;\n    }\n    if (l == 0) {\n      t = k;\n      k = 0;\n      l = t + 1;\n    }\n    while (k >= n || l >= m) {\n      k++;\n      l--;\n      if (l == 0) {\n        t = k;\n        k = 0;\n        l = t + 1;\n      }\n      if (l + k == m + n) {\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6177", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[101][101];\n  int row, col, i, j, k;\n  int(*p)[101] = array;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &array[i][j]);\n    }\n  cout << *(*(p + 0) + 0) << endl;\n  for (i = 1; i < col; i++)\n    for (k = i, j = 0; k >= 0 && j < row; k--) {\n      printf(\"%d\\n\", *(*(p + j) + k));\n      if (k - 1 >= 0)\n        j++;\n    }\n  for (i = 1; i < row; i++)\n    for (j = i, k = col - 1; k >= 0 && j < row; j++) {\n      cout << *(*(p + j) + k) << endl;\n      if (j + 1 < row)\n        k--;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long p, q, r, l, i, x, j;\n  long a[202][202] = {0}, b[202] = {0};\n  scanf(\"%ld%ld\", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i--;\n  j--;\n  for (p = 2; p <= i + j; p++) {\n    for (q = 0; q < b[p]; q++) {\n      printf(\"%ld\\n\", a[p][q]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, a, b, i, j, *num;\n  num = (int *)malloc(sizeof(int) * 10000);\n  scanf(\"%d %d\", &a, &b);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++)\n      scanf(\"%d\", num + (i - 1) * b + j);\n  }\n\n  for (i = 1; i < b; i++) {\n    p = i;\n    for (;;) {\n      cout << *(num + p) << \"\\n\";\n      if (p % b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n\n  for (i = b; i <= a * b; i += b) {\n    p = i;\n    for (;;) {\n      printf(\"%d\\n\", *(num + p));\n      if (p % b == 1 || b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "6180", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int s = 0; s < row + col - 1; s++) { \n    for (int i = 0; i < row; i++) {         \n      if (s - i >= 0 && s - i < col)\n        cout << *(*(a + i) + s - i) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], sum, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  if (row < col) {\n    for (sum = 0; sum <= row - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= col - 1; sum++) {\n      for (i = 0; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= col + row - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum <= col - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= row - 1; sum++) {\n      for (i = sum - col + 1; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= row + col - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, *p[100], i, j, v;\n  for (i = 0; i < 100; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\\n\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", (p[i] + j));\n  for (v = 0; v <= r + c - 2; v++) {\n    for (i = 0; i <= v; i++) {\n      if (i < r) {\n        j = v - i;\n        if (j < c)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &(a[i][j]));\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    if (i < col)\n      j = 0;\n    else\n      j = i - col + 1;\n    for (; j <= i && j < row; j++) {\n      cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, l, i, j, k, m = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0, i = 0, j = 0;;) {\n    printf(\"%d\\n\", a[j][i]);\n    if (i == (l - 1) && j == (h - 1))\n      break;\n    if (i == 0 || j == (h - 1)) {\n      j = 0;\n      k++;\n      if (k < l) {\n        i = k;\n      } else {\n        i = l - 1;\n        m++;\n        j = m;\n      }\n    } else {\n      i -= 1;\n      j += 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, k;\n  int c[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  }\n  if (b > a) {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < b - a; k++) {\n      i = 0;\n      j = a + k;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else if (b < a) {\n    for (k = 0; k < b; k++) {\n      i = 0;\n      j = k;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - b; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < b - 1; k++) {\n      i = a - b + 1 + k;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  j = 0;\n  for (i = 0; i < row; i++) {\n    if (i == 0) {\n      while (j <= col - 1) {\n        cout << array[i][j] << endl;\n        for (int k = i + 1; k < row; k++) {\n          if (i + j - k >= 0)\n            cout << array[k][i + j - k] << endl;\n        }\n        j++;\n      }\n    } else {\n      j = col - 1;\n      cout << array[i][j] << endl;\n      for (int k = i + 1; k < row; k++) {\n        if (i + j - k >= 0)\n          cout << array[k][i + j - k] << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0, k = 0;\n  int str[100][100] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &str[i][j]);\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0; i++, j--) {\n      if (str[i][j] == 0)\n        break;\n      else\n        printf(\"%d\\n\", str[i][j]);\n    }\n  i = 0;\n  k = 0;\n  j = 0;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", str[i][j]);\n}\n"}
{"label": "4", "index": "6188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  cin >> m >> n;\n  int a[m + 1][n + 1];\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  int k;\n\n  for (k = 1; k <= n; k++)\n    for (i = k; (i >= 1) && (k + 1 - i <= m); i--)\n      printf(\"%d\\n\", a[k + 1 - i][i]);\n\n  for (k = 2; k <= m; k++)\n    for (i = n; (i >= 1) && (k + n - i <= m); i--)\n      cout << a[k + n - i][i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, a[101][101];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < m && (i - j) < n) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint matrix[100][100], row, col;\nvoid display(int step) {\n  int x, y, i;\n  if (step > row + col - 1)\n    return;\n  if (step < col) {\n    y = step - 1;\n    for (i = y; i >= 0 && y - i < row; i--)\n      cout << matrix[y - i][i] << endl;\n  } else {\n    x = step - col;\n    for (i = x; i < row && col - 1 + x - i >= 0; i++)\n      cout << matrix[i][col - 1 + x - i] << endl;\n  }\n  display(step + 1);\n}\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(matrix + i) + j);\n  display(1);\n}\n"}
{"label": "4", "index": "6191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, k, n, j;\n  int ROW, COL, row, col;\n  scanf(\"%d %d\", &ROW, &COL);\n  if (ROW > COL) {\n    j = COL - 1;\n  } else {\n    j = ROW - 1;\n  }\n  for (i = 0; i < ROW; i++) {\n    for (k = 0; k < COL; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n    }\n  }\n  for (n = 0; n <= j; n++) {\n    for (row = 0; row <= n; row++) {\n      printf(\"%d\\n\", sz[row][n - row]);\n    }\n  }\n  if (COL > ROW) {\n    for (n = j + 1; n < COL; n++) {\n      for (row = 0; row < ROW; row++) {\n        printf(\"%d\\n\", sz[row][n - row]);\n      }\n    }\n    for (n = COL; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW > COL) {\n    for (n = j + 1; n < ROW; n++) {\n      for (col = COL - 1; col >= 0; col--) {\n        cout << sz[n - col][col] << \"\\n\";\n      }\n    }\n    for (n = ROW; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW == COL) {\n    for (n = j + 1; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int h, k, e, s, i, l;\n  scanf(\"%d%d\", &h, &l);\n  int juzhen[1000][1000];\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &(juzhen[i][k]));\n    }\n  }\n\n  for (s = 0; s < l; s++) {\n    k = s;\n    i = 0;\n    for (e = 0; e <= s; e++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (i == h) {\n        break;\n      }\n    }\n  }\n  for (e = 1; e < h; e++) {\n    i = e;\n    k = l - 1;\n    for (s = 0; s < (h - e); s++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100], ROW, COL;\n  int i, j, z, t;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (j = 0; j < ROW; j++) {\n    for (i = 0; i < COL; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  t = ROW + COL;\n  for (z = 0; z < t; z++) {\n    for (j = 0; j < ROW; j++) {\n      i = z - j;\n      if ((i >= 0) && (i < COL)) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  int a[110][110];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int j = 0; j < m + n - 1; j++) {\n    for (int i = max(0, j - m + 1); i < min(n, j + 1); i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n\n    for (i = m, j = 0; i >= 0 && j < a; i--, j++)\n      printf(\"%d\\n\", n[j][i]);\n  }\n\n  for (x = 1; x < a; x++) {\n\n    for (j = x, i = b - 1; j < a && i >= 0; j++, i--)\n      cout << n[j][i] << \"\\n\";\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "6196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, s[100][100], i, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (k = 0; k < col; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  if (col < row) {\n    for (i = 0; i <= (row + col); i++) {\n      for (k = 0; k < row && k <= i; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  } else if (col >= row) {\n    for (i = 0; i <= (col + row); i++) {\n      for (k = 0; k <= i && k < row; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, row, col, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < row; j++) {\n      if (i - j >= col || i - j < 0)\n        continue;\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  int p = 0, q = 0;\n  while (p < row && q < col) {\n    int e = 0;\n    while (p + e < row && q - e >= 0) {\n      printf(\"%d\\n\", array[p + e][q - e]);\n      e++;\n    }\n    if (q < col - 1) {\n      q++;\n    } else {\n      if (q == col - 1)\n        p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j;\n  cin >> n >> m;\n  int a[n][m];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  int *p = NULL;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = &a[0][0] + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        printf(\"%d\\n\", *(p + (m - 1) * k));\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int rr, cc;\n  int arr[100][100] = {0};\n  cin >> rr;\n  cin >> cc;\n\n  int i, j;\n  for (i = 0; i < rr; i++) {\n    for (j = 0; j < cc; j++)\n      cin >> arr[i][j];\n  }\n\n  for (j = 0; j < cc; j++) {\n    i = 0;\n    for (int k = j; k >= 0 && i <= rr - 1; k--, i++) {\n      cout << arr[i][k] << endl;\n    }\n  }\n\n  for (i = 1; i < rr; i++) {\n    j = cc - 1;\n    for (int p = i; p <= rr - 1 && j >= 0; p++, j--) {\n      cout << arr[p][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6201", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int L, R, i, j, k;\n  cin >> R >> L;\n  const int l = L;\n  const int r = R;\n  int a[r][l];\n  for (i = 0; i < r; i++)\n    for (j = 0; j < l; j++)\n      cin >> a[i][j];\n  for (k = 0; k < l; k++) {\n    for (i = 0; (i < r) && ((k - i) >= 0); i++) {\n      cout << a[i][k - i] << endl;\n    }\n  }\n  for (k = l; k <= l + r - 2; k++) {\n    for (i = l - 1; (i >= 0) && ((k - i) < r); i--) {\n      cout << a[k - i][i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6202", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int dia = 0; dia < row + col - 1; dia++) {\n    if (dia < col)\n      for (int iRow = 0; dia - iRow >= 0 && iRow < row; iRow++)\n        cout << *(*(a + iRow) + dia - iRow) << endl;\n    else\n      for (int iRow = dia - col + 1; dia - iRow >= 0 && iRow < row; iRow++)\n        cout << *(*(a + iRow) + dia - iRow) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, m, M, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (row > col) {\n    M = row;\n    m = col;\n  } else {\n    M = col;\n    m = row;\n  }\n  for (k = 0; k < m; k++) {\n    for (i = 0; i <= k; i++)\n      cout << a[i][k - i] << \"\\n\";\n  }\n  if (row > col) {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i + k + 1][m - i - 1]);\n    }\n  } else {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i][m - i + k]);\n    }\n  }\n  for (k = 1; k < m; k++) {\n    for (i = 0; i < m - k; i++)\n      printf(\"%d\\n\", a[row - m + i + k][col - i - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6204", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ROW, COL, ARRAY[1000][1000];\n\nint main() {\n  cin >> ROW >> COL;\n  for (int i = 0; i < ROW; i++) {\n    for (int j = 0; j < COL; j++)\n      cin >> ARRAY[i][j];\n  }\n  int iterx = 0, itery = 0;\n  for (int iter = 1; iter <= (ROW + COL - 1); iter++) {\n    if (iter <= COL) {\n      iterx = 0;\n      itery = iter - 1;\n    } else {\n      iterx = iter - COL;\n      itery = COL - 1;\n    }\n    while (iterx < ROW && itery >= 0) {\n      cout << ARRAY[iterx][itery] << endl;\n      iterx++;\n      itery--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6205", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col - 1; i++)\n    for (j = 0, k = i; k >= 0 && j < row; k--, j++) {\n      cout << *(*(a + j) + k) << endl;\n    }\n  for (i = 0; i < row; i++)\n    for (j = col - 1, k = i; k < row && j >= 0; k++, j--) {\n      cout << *(*(a + k) + j) << endl;\n    }\n}\n"}
{"label": "4", "index": "6206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row >= col) {\n    for (n = 0; n <= col - 1; n++)\n      for (i = 0; i <= n; i++)\n        cout << a[i][n - i] << \"\\n\";\n    for (n = col; n <= row - 1; n++)\n      for (i = n - col + 1; i <= n; i++)\n        cout << a[i][n - i] << \"\\n\";\n    for (n = row; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n\n  else {\n    for (n = 0; n <= row - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= col - 1; n++)\n      for (i = 0; i <= row - 1; i++)\n        cout << a[i][n - i] << \"\\n\";\n    for (n = col; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6207", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n = 0;\n  int a[100 + 10][100 + 10] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  i = 0;\n  j = 0;\n  for (int begin = 0; begin < col; begin++) {\n    i = 0;\n    j = begin;\n    while (j >= 0 && i < row)\n      printf(\"%d\\n\", a[i++][j--]);\n  }\n  for (int begin = 1; begin < row; begin++) {\n    i = begin, j = col - 1;\n    while (i < row && j >= 0)\n      cout << a[i++][j--] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[100][100] = {0};\n  int *p = a[0];\n  for (p = a[0]; p < a[0] + n * m; p++) {\n    cin >> *p;\n  }\n  if (n == 1 || m == 1) {\n    for (int k = 0; k < n * m - 1; k++) \n    {\n      for (int i = 0; i < n; i++) \n      {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            cout << *p << endl;\n          }\n        }\n      }\n    }\n    cout << *(a[0] + n * m - 1);\n  } else {\n    for (int k = 0; k < n * m - 2; k++) \n    {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            cout << *p << endl;\n          }\n        }\n      }\n    }\n    \n    cout << *(a[0] + m * n - 1);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, z, i, sz[100][100], k;\n  scanf(\"%d %d\", &h, &z);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < z; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (i = 0; i <= h + z - 2; i++) {\n    for (k = 0; k < h; k++) {\n      if (i - k < 0 || i - k >= z) {\n        continue;\n      } else {\n        printf(\"%d\\n\", sz[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[99][99];\n  cin >> r >> c;\n  for (int i = 0; i < r; ++i)\n    for (int j = 0; j < c; ++j) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  for (int j = 0; j < c; ++j)\n    for (int x = j, y = 0; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n  for (int i = 1; i < r; ++i)\n    for (int y = i, x = c - 1; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < n; j++)\n    for (l = 0; (l < m) && (l <= j); l++)\n      printf(\"%d\\n\", a[l][j - l]);\n  for (i = 1; i < m; i++)\n    for (k = 0; (k < m - i) && (k < n); k++)\n      printf(\"%d\\n\", a[i + k][n - k - 1]);\n}\n"}
{"label": "4", "index": "6212", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nint main(int argc, const char *argv[]) {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < col; j++) {\n    int t = 0;\n    int k = j;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int t = i;\n    int k = col - 1;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[101][101];\n  int row, col, i, j, k;\n  int(*p)[101] = array;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  cout << *(*(p + 0) + 0) << endl;\n  for (i = 1; i < col; i++)\n    for (k = i, j = 0; k >= 0 && j < row; k--) {\n      printf(\"%d\\n\", *(*(p + j) + k));\n      if (k - 1 >= 0)\n        j++;\n    }\n  for (i = 1; i < row; i++)\n    for (j = i, k = col - 1; k >= 0 && j < row; j++) {\n      cout << *(*(p + j) + k) << endl;\n      if (j + 1 < row)\n        k--;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, max;\n  cin >> row >> col;\n  int i, j;\n  int a[101][101];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 0; i <= row + col - 2; i++) {\n    max = 0;\n    if (row - 1 < i)\n      max = row - 1;\n    else\n      max = i;\n    for (j = 0; j <= max; j++) {\n      if (i - j <= col - 1) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6215", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sz[100][100];\n\nint main() {\n\n  int n, m, i, j;\n\n  scanf(\"%d %d\", &n, &m);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  i = 0;\n  j = 0;\n  while (1) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (i == (n - 1) && j == (m - 1)) {\n      break;\n    }\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (i >= n) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (j >= m) {\n      i = j + 1 - m;\n      j = m - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6216", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, row = 0, col = 0, i = 0, j = 0, min = 0, rowbegin = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  min = row < col ? row : col;\n  while (k <= col + row - 1) {\n    i = 0;\n    if (k > col - 1)\n      rowbegin++;\n\n    for (i = rowbegin; i <= k && i < row; i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      cout << a[j][i - j] << \"\\n\";\n}\n"}
{"label": "4", "index": "6218", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint ROW, COL;\nint row = -1, col = 1;\nint array_1[100][100];\nint move() {\n  row++;\n  col--;\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint big_move() {\n  if (row + col < COL - 1) {\n    col = row + col + 1;\n    row = 0;\n  } else {\n    row = row + col - COL + 2;\n    col = COL - 1;\n  }\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint main() {\n  scanf(\"%d%d\", &ROW, &COL);\n  int r, c;\n  for (r = 0; r < ROW; r++) {\n    for (c = 0; c < COL; c++) {\n      cin >> array_1[r][c];\n    }\n  }\n  if (ROW == 1 && COL == 1) {\n    printf(\"%d\", array_1[0][0]);\n    return 0;\n  }\n  while (row != ROW - 1 || col != COL - 1) {\n    while (col != 0 && row != ROW - 1)\n      move();\n    big_move();\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, v[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &v[i][j]);\n    }\n  }\n\n  for (int j = 0; j <= col - 1; j++) {\n    int m = j;\n    for (int k = 0; k <= row - 1 && m >= 0; m-- && k++) {\n      printf(\"%d\\n\", v[k][m]);\n    }\n    k = 0;\n  }\n\n  for (int i = 1; i <= row - 1; i++) {\n    int n = i;\n    for (int j = col - 1; n <= row - 1 && j >= 0; n++ && j--) {\n      printf(\"%d\\n\", v[n][j]);\n    }\n  }\n\n  int z;\n  cin >> z;\n  return 0;\n}\n"}
{"label": "4", "index": "6220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, l, m, i, j, a[100][100], k;\n  scanf(\"%d %d\", &h, &l);\n  for (k = 0; k < h; k++) {\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[k][j]);\n  }\n  i = 0;\n  while (i < l) {\n    k = i;\n    j = 0;\n    while (1) {\n      printf(\"%d\\n\", a[j][k]);\n      k--;\n      j++;\n      if (k < 0 || j == h)\n        break;\n    }\n    i++;\n  }\n  i = 1;\n  while (i < h) {\n    k = i;\n    j = l - 1;\n    while (1) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n      if (j < 0 || k == h)\n        break;\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6221", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], p, q, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  p = 0;\n  q = 0;\n  for (int i = 0; i < row * col; i++) {\n    printf(\"%d\\n\", a[p][q]);\n    if (q == 0 || p == row - 1) {\n      q = p + q + 1;\n      p = 0;\n      while (q >= col) {\n        p++;\n        q--;\n      }\n    } else {\n      p++;\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6222", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[101][101];\n  int(*p)[101] = NULL;\n  p = array;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  }\n  for (int k = 0; k < row + col - 1; k++) {\n    for (int i = 0; i < row; i++) {\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << *(p[i] + j) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[100][100] = {0};\n  int *p = a[0];\n  for (p = a[0]; p < a[0] + n * m; p++) {\n    cin >> *p;\n  }\n  if (n == 1 || m == 1) {\n    for (int k = 0; k < n * m - 1; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            printf(\"%d\\n\", *p);\n          }\n        }\n      }\n    }\n    cout << *(a[0] + n * m - 1);\n  } else {\n    for (int k = 0; k < n * m - 2; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            cout << *p << endl;\n          }\n        }\n      }\n    }\n\n    printf(\"%d\", *(a[0] + m * n - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int L, R, i, j, k;\n  cin >> R >> L;\n  const int l = L;\n  const int r = R;\n  int a[r][l];\n  for (i = 0; i < r; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 0; k < l; k++) {\n    for (i = 0; (i < r) && ((k - i) >= 0); i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n  }\n  for (k = l; k <= l + r - 2; k++) {\n    for (i = l - 1; (i >= 0) && ((k - i) < r); i--) {\n      cout << a[k - i][i] << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "6225", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000];\n  int m, n;\n  cin >> m >> n;\n  int i;\n  for (i = 0; i < m * n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  int *p;\n  int temp;\n  temp = 0;\n  int num = m + n - 1;\n  while (num--) {\n    p = a + temp;\n    i = temp;\n    while (i % n != 0 && i / n != m - 1) {\n      cout << *p << endl;\n      p = p + (n - 1);\n      i += (n - 1);\n    }\n    cout << *p << endl;\n    if (temp < n - 1)\n      temp++;\n    else\n      temp += n;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int array[110][110];\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; ((j <= i) && (j < row)); j++) {\n      printf(\"%d\\n\", *(*(array + j) + i - j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; ((j <= col - 1) && (j < row - i)); j++) {\n      printf(\"%d\\n\", *(*(array + i + j) + col - 1 - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6227", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  memset(a, '0', sizeof(a));\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  int(*p)[100] = a;\n  for (int i = 0; i < row + col - 1; i++) {\n    if (i < col) {\n      for (int j = 0; j <= row; j++) {\n        if (i - j < col && j < row && j >= 0 && i - j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    } else {\n      for (int j = 1; j < row; j++) {\n        if (i - j < col && j < row && i - j >= 0 && j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int i = 0; i < col; i++) {\n    cout << a[0][i] << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++) {\n      cout << a[j][i - j] << endl;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    cout << a[i][col - 1] << endl;\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n\n  int a, b, i, j, k;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < a + b - 1; i++) {\n    if (i < b)\n      k = 0;\n    if (i >= b)\n      k = i - b + 1;\n    for (j = k; j <= i && j < a; j++) {\n      printf(\"%d\\n\", p[j][i - j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "6230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[100][100], i, j, k, row, col, m, Col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &u[i][j]);\n    }\n  }\n  printf(\"%d\\n\", u[0][0]);\n  for (k = 1; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if (k > col - 1) {\n        break;\n      }\n      if (k - j > row - 1) {\n        break;\n      }\n\n      cout << u[k - j][j] << \"\\n\";\n    }\n  }\n\n  for (k = col; k < col + row - 2; k++) {\n    for (j = col - 1; j >= 0; j--) {\n\n      if (k - j > row - 1) {\n        break;\n      }\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n  if (row == 1)\n    ;\n  else {\n    printf(\"%d\\n\", u[row - 1][col - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, m, i, j;\n  int(*p)[1000], (*q)[1000];\n  cin >> row >> col;\n  p = (int(*)[1000])malloc(row * 1000 * sizeof(int));\n  q = p;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(q + i) + j);\n    }\n  }\n  q = p;\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; m >= 0 && i < row; m--, i++) {\n      printf(\"%d \", *(*(q + i) + m));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; m < row && j >= 0; j--, m++) {\n      printf(\"%d \", *(*(q + m) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "6232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], i, j, row, col, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n <= col + row - 2; n++) {\n    for (i = 0; i < row; i++)\n      if (i <= n && i > n - col)\n        cout << a[i][n - i] << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "6233", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, *p[100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p[i] + j);\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0, j = k - 1; i <= row - 1; i++, j--)\n      if (i <= row - 1 && j >= 0 && j <= col - 1 && i >= 0)\n        printf(\"%d\\n\", *(p[i] + j));\n  printf(\"%d\\n\", *(p[row - 1] + col - 1));\n}\n"}
{"label": "4", "index": "6234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col, array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  for (k = 0; k <= col + row - 2; k++)\n    for (i = 0; i <= k; i++) {\n      j = k - i;\n      if (i < row && j >= 0 && j < col)\n        printf(\"%d\\n\", array[i][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, (*p)[100], row, col, r, c, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < col; i++) {\n    r = 0;\n    c = i;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    r = i;\n    c = col - 1;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int row, col;\n  int a[101][101];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  for (j = 1; j <= col; j++) {\n    cout << a[1][j] << endl;\n    int k = 1;\n    while (((1 + k) <= row) && ((j - k) >= 1)) {\n      cout << a[1 + k][j - k] << endl;\n      k++;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    cout << a[i][col] << endl;\n    int k = 1;\n    while (((i + k) <= row) && ((col - k) >= 1)) {\n      cout << a[i + k][col - k] << endl;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, n, j, i, k, *hi, col, row, s, max;\n  scanf(\"%d %d\", &row, &col);\n  s = row * col;\n\n  int *p = (int *)malloc(10000 * sizeof(int));\n  hi = p;\n  if (col > row)\n    max = col;\n  else\n    max = row;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", p + i);\n  for (j = 0; j < col + row; j++)\n    for (k = 0; k <= j; k++)\n      if (j - k < col && k < row)\n        printf(\"%d\\n\", *(hi + j - k + col * k));\n}\n"}
{"label": "4", "index": "6238", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int sz[101][101];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]); \n    }\n  }\n\n  if (row > col) {\n    int x;\n    for (j = 0; j < col; j++) {\n      for (x = 0; x <= j; x++) { \n        printf(\"%d\\n\", sz[x][j - x]);\n      }\n    }\n    int y;\n    for (i = 1; i <= row - col; i++) {\n      for (y = 0; y < col; y++) {\n        printf(\"%d\\n\", sz[i + y][col - y - 1]);\n      }\n    }\n    int w;\n    for (i = row - col + 1; i < row; i++) {\n      for (w = 0; w < col - 1; w++) {\n        printf(\"%d\\n\", sz[i + w][col - w - 1]);\n        if (i + w == row - 1) {\n          break;\n        }\n      }\n    }\n  } else {\n    int z;\n    for (j = 0; j < row; j++) {\n      for (z = 0; z <= j; z++) {\n        printf(\"%d\\n\", sz[z][j - z]);\n      }\n    }\n    int n;\n    for (j = row; j < col; j++) {\n      for (n = 0; n < row; n++) {\n        printf(\"%d\\n\", sz[n][j - n]);\n      }\n    }\n    int m;\n    for (i = 1; i < row; i++) {\n      for (m = 0; m < row - 1; m++) {\n        printf(\"%d\\n\", sz[i + m][col - m - 1]);\n        if (i + m == row - 1) {\n          break;\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, start, row, col;\n  int a[200][200];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n\n  i = 1;\n  j = 1;\n  do {\n    printf(\"%d\\n\", a[i][j]);\n    i++;\n    j--;\n    if (j == 0)\n      if (i + j < col + 1) {\n        j = i;\n        i = 1;\n      } else {\n        i = i + j + 1 - col;\n        j = col;\n      }\n    if (i > row)\n      if (i + j < col + 1) {\n        j = i + j;\n        i = 1;\n      } else {\n        i = row + 2 + j - col;\n        j = col;\n      }\n\n  } while (i <= row);\n  return 0;\n}\n"}
{"label": "4", "index": "6240", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i = 0, j = 0, a[100][100];\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < y; i++)\n    for (j = 0; i - j >= 0 && j < x; j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < x; i++)\n    for (j = 0; i + j < x && y - j - 1 >= 0; j++)\n      printf(\"%d\\n\", a[i + j][y - 1 - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6241", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int col, row;\n  int mat[200][200];\n  int i, j;\n\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> mat[i][j];\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      printf(\"%d\\n\", mat[i][j]);\n    if (i == row - 1 && j == col - 1)\n      break;\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, line, rownow, linenow, n, i, j, a[10000];\n  scanf(\"%d %d\", &row, &line);\n  for (j = 0; j <= row * line - 1; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n  for (i = 0; i <= row + line - 1; i++) {\n    rownow = 0;\n    linenow = i - rownow;\n    for (; rownow <= row - 1 && linenow >= 0; rownow++, linenow--) {\n      if (linenow >= line)\n        continue;\n      n = rownow * line + linenow;\n      printf(\"%d\\n\", a[n]);\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "4", "index": "6243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[110][110] = {0};\n  scanf(\"%d%d\", &row, &col);\n  getchar();\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j >= row || (i - j) >= col)\n        continue;\n      printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6244", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, *a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      a[i][j] = (int *)malloc(sizeof(int));\n      scanf(\"%d\", a[i][j]);\n    }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", *a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, temp_i = i; j >= 0 && temp_i < row; j--, temp_i++) {\n      printf(\"%d\\n\", *a[temp_i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6245", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 100;\n\nint main() {\n  int line, row;\n  int num[maxn][maxn];\n  cin >> line >> row;\n\n  int nowline, nowrow;\n  int step;\n  int i, j;\n  for (i = 0; i != line; i++)\n    for (j = 0; j != row; j++) {\n      scanf(\"%d \", &num[i][j]);\n    }\n  for (step = 0; step != line + row - 1; step++) {\n    nowline = (step >= row ? step - row + 1 : 0);\n    nowrow = (step >= row ? row - 1 : step);\n    while (nowline != line && nowrow != -1) {\n      printf(\"%d\\n\", num[nowline][nowrow]);\n      nowline++;\n      nowrow--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a, b;\n  int s[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (j = 0; j < a; j++) {\n    for (i = 0; i < b; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (j = 0; j < b; j++) {\n    k = j;\n    for (i = 0;; i++) {\n      if (i == a) {\n        break;\n      }\n      printf(\"%d\\n\", s[i][k]);\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  for (j = 1; j < a; j++) {\n    k = j;\n    for (i = b - 1; i >= 0; i--) {\n      printf(\"%d\\n\", s[k][i]);\n      k++;\n      if (k == a) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6247", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col, array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  for (k = 0; k <= col + row - 2; k++)\n    for (i = 0; i <= k; i++) {\n      j = k - i;\n      if (i < row && j >= 0 && j < col)\n        printf(\"%d\\n\", array[i][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, i1, j1;\n  scanf(\"%d%d\", &i, &j);\n  for (i1 = 1; i1 <= i; i1++) {\n    for (j1 = 1; j1 <= j; j1++) {\n      scanf(\"%d\", &a[i1][j1]);\n    }\n  }\n  j1 = 1;\n  i1 = 1;\n  printf(\"%d\", a[1][1]);\n  while (j1 != j || i1 != i) {\n    i1 = i1 + 1;\n    j1 = j1 - 1;\n    if (j1 == 0) {\n      j1 = i1;\n      i1 = 1;\n    }\n    if (j1 > j || i1 > i)\n      continue;\n    printf(\"\\n%d\", a[i1][j1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  printf(\"%d\\n\", a[0][0]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j + 1 && i < m; i++) {\n      printf(\"%d\\n\", a[i][j - i]);\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < n && j < m - i; j++)\n      printf(\"%d\\n\", a[j + i][n - 1 - j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int shuzu[100][100];\n  int i, j, k, n, row, col, shuru;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuru);\n      shuzu[i][j] = shuru;\n    }\n  }\n  for (k = 0; k <= row + col - 2; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", shuzu[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p1[100], *p2, i, j, n, m, s;\n  cin >> n >> m;\n  for (i = 0; i < 100; i++)\n    p1[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> *(*(p1 + i) + j);\n  for (s = 0; s < n + m - 1; s++)\n    for (i = 0; i < n; i++) {\n      if (s - i < m)\n        printf(\"%d\\n\", *(*(p1 + i) + s - i));\n      if (s - i == 0 || i == n)\n        break;\n    }\n}\n"}
{"label": "4", "index": "6252", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[101][101];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(number + i) + j);\n  }\n\n  for (i = 0; i < row + col - 1; i++) {\n    j = 0;\n\n    for (j = 0; i - j >= 0; j++) {\n      if (j >= row || i - j >= col)\n        continue;\n      cout << *(*(number + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int row, col;\n  int matrix[100 * 100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", matrix + i * 100 + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0 && k < row; j--, k++) {\n      cout << *(matrix + k * 100 + j) << \"\\n\";\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; j >= 0 && k < row; j--, k++) {\n      printf(\"%d\\n\", *(matrix + k * 100 + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col; \n  int a[110][110];\n  int max, min;\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n\n  if (row > col) {\n    max = row;\n    min = col;\n  } else {\n    max = col;\n    min = row;\n  }\n\n  for (int i = 0; i < min; i++)\n    for (int j = 0; j <= i; j++)\n      cout << a[j][i - j] << endl;\n\n  if (col != row) {\n    for (int i = min; i < max; i++) {\n      if (col > row)\n        for (int j = 0; j < min; j++)\n          cout << a[j][i - j] << endl;\n\n      else\n        for (int j = col - 1; j >= 0; j--)\n          cout << a[i - j][j] << endl;\n    }\n  }\n\n  for (int i = max; i <= row + col - 2; i++)\n    for (int j = col - 1; i - j <= row - 1; j--)\n      cout << a[i - j][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100][100];\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < m + n - 1; i++)\n    for (int j = n - 1; j >= 0; j--) {\n      if (i - j < m && i - j >= 0)\n        cout << *(*(a + i - j) + j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], *p;\n  int raw, col;\n  cin >> raw >> col;\n  for (p = a[0]; p < a[0] + raw * col; p++)\n    cin >> *p;\n\n  if (col != 1) {\n    cout << a[0][0] << endl;\n    for (p = a[0] + 1; p < a[0] + col - 1; p++) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n\n    for (p = a[0] + col - 1; p < a[0] + col * raw; p += col) {\n      int *q;\n      q = p;\n      do {\n        printf(\"%d\\n\", *q);\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n  }\n  if (col == 1) {\n    for (p = a[0]; p < a[0] + raw * col; p++)\n      cout << *p << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int t = 0; t < row + col - 1; t++)\n    for (j = (col - 1 > t ? t : col - 1); t - j <= row - 1 && j >= 0; j--)\n      cout << *(*(a + t - j) + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col, array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (k = 0; k <= col + row - 2; k++)\n    for (i = 0; i <= k; i++) {\n      j = k - i;\n      if (i < row && j >= 0 && j < col)\n        printf(\"%d\\n\", array[i][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, col, i, j, k, sum;\n  cin >> row >> col;\n  sum = row + col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (k = 2; k <= sum; k++) {\n    if (k <= col + 1) {\n      i = 1;\n      j = k - 1;\n      do {\n        cout << a[i][j] << endl;\n        ;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    } else {\n      i = k - col;\n      j = k - i;\n      do {\n        cout << a[i][j] << endl;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[1500][1500], b[10000], i, j, sum, t = 0;\n  cin >> n >> m;\n  for (i = 1; i <= 1499; i++)\n    for (j = 1; j <= 1499; j++)\n      a[i][j] = -198;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n\n  for (sum = 2; sum <= (n + m); sum++) {\n    for (i = 1; i < sum; i++) {\n      if (a[i][sum - i] != -198)\n        cout << a[i][sum - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6261", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d%d\", &col, &row);\n  int i, j;\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  int p;\n  for (p = 0; p < 2 * (row > col ? row : col) - 1; p++) {\n    int k;\n    for (k = 0; (p - k) >= 0; k++) {\n      if (k < col && (p - k) < row)\n        printf(\"%d\\n\", a[k][p - k]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    a = i;\n    b = 0;\n    for (j = 0; j <= i; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (b == row)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    b = i;\n    a = col - 1;\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (a == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6263", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int matrix[99][99], row, column, startcolumn = 0, startrow = 1;\n  cin >> row >> column;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < column; j++)\n      cin >> matrix[i][j];\n  }\n  int x = 0, y;\n  do {\n    y = startcolumn;\n    while (x < row && y >= 0) {\n      cout << matrix[x][y] << endl;\n      x++;\n      y--;\n    }\n    x = 0;\n    startcolumn++;\n  } while (startcolumn < column);\n  int m, n = column - 1;\n  do {\n    m = startrow;\n    while (m < row && n >= 0) {\n      cout << matrix[m][n] << endl;\n      m++;\n      n--;\n    }\n    startrow++;\n    n = column - 1;\n  } while (startrow < row);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], k, j, i, m;\n  scanf(\"%d %d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      cin >> a[j][i];\n    }\n  }\n\n  for (i = 0; i < col; i++) {\n    j = 0;\n    for (m = i; (j < row) && (m >= 0); j++, m--) {\n      printf(\"%d\\n\", a[j][m]);\n    }\n  }\n  for (j = 1; j < row; j++) {\n    i = col - 1;\n    for (m = i, k = j; (k < row) && (m >= 0); k++, m--) {\n      printf(\"%d\\n\", a[k][m]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100], i, j;\n  int row, col, s;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  if (row < col) {\n\n    for (s = 0; s <= row - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= col - 1; s++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n\n    for (s = col; s <= row + col - 2; s++)\n      for (j = col - 1; j >= s - row + 1; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n  } else if (row > col) {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        cout << array[i][s - i] << \"\\n\";\n    for (s = col; s <= row - 1; s++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  } else {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> (a[i][j]);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    if (i < col)\n      j = 0;\n    else\n      j = i - col + 1;\n    for (; j <= i && j < row; j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6267", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        printf(\"%d\\n\", a[i][j]);\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        printf(\"%d\\n\", a[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], i, j, row, col, n;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n <= col + row - 2; n++) {\n    for (i = 0; i < row; i++)\n      if (i <= n && i > n - col)\n        cout << a[i][n - i] << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "6269", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int iRow, iCol, i, j, k, iMax, iMin, p;\n  scanf(\"%d %d \", &iRow, &iCol);\n  if (iRow > iCol) {\n    iMin = iCol;\n    iMax = iRow;\n  } else {\n    iMin = iRow;\n    iMax = iCol;\n  }\n  int a[iMax][iMax];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i <= (iRow - 1); i++)\n    for (j = 0; j <= (iCol - 1); j++)\n      cin >> a[i][j];\n  p = 1;\n  for (k = 0; k <= (iMax * 2 - 2); k++) {\n    if (k > iMax - 1) {\n      for (i = p, j = iMax - 1; (i <= iMax - 1) && (j >= p); i++, j--) {\n        if (a[i][j] != 0) {\n          cout << a[i][j] << endl;\n        } else\n          continue;\n      }\n      p++;\n    } else {\n      for (i = 0, j = k; (i <= k) && (j >= 0); i++, j--) {\n        if (a[i][j] != 0)\n          cout << a[i][j] << endl;\n        else\n          continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6270", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid out(int sum, int row, int col, int (*a)[200]) {\n  int i;\n  if (sum <= col - 1) {\n    for (i = 0; sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  } else {\n    for (i = sum - (col - 1); sum - i >= 0 && i <= row - 1; i++)\n      cout << *(*(a + i) + sum - i) << endl;\n  }\n}\nint main() {\n  int c, r;\n  cin >> c >> r;\n  int a[200][200];\n  for (int i = 0; i < c; i++)\n    for (int j = 0; j < r; j++)\n      cin >> *(*(a + i) + j);\n  for (int sum = 0; sum <= c + r - 2; sum++)\n    out(sum, c, r, a);\n  return 0;\n}\n"}
{"label": "4", "index": "6271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[102][102], row, col, t, k, i, j;\n  cin >> row >> col;\n  t = row + col - 2;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= t; k++) {\n    if (k + 1 <= col)\n      i = 0;\n    else\n      i = k - col + 1;\n    j = k - i;\n    while (j >= 0 && i < row) {\n      cout << a[i][j] << endl;\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, *p;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(sizeof(int) * row * col);\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n  printf(\"%d\\n\", *p);\n  p++;\n  for (i = 1; i < col; i++, p++)\n    for (j = 0, k = 0; k <= i && (i + j) < (row * col); k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n  p += col - 1;\n  for (i = 1; i <= (row - 1); i++, p += col)\n    for (j = 0, k = 0; k < (row - i) && k < col && *(p + j) != 0;\n         k++, j = j + col - 1)\n      cout << *(p + j) << \"\\n\";\n}\n"}
{"label": "4", "index": "6273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100], i, j;\n  int row, col, s;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  if (row < col) {\n\n    for (s = 0; s <= row - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= col - 1; s++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n\n    for (s = col; s <= row + col - 2; s++)\n      for (j = col - 1; j >= s - row + 1; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n  } else if (row > col) {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = col; s <= row - 1; s++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  } else {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n\n  int a, b, i, j, k;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < a + b - 1; i++) {\n    if (i < b)\n      k = 0;\n    if (i >= b)\n      k = i - b + 1;\n    for (j = k; j <= i && j < a; j++) {\n      cout << p[j][i - j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "6275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, n[100][100], c, d, e, f, g, h, i, j, k, l;\n  scanf(\"%d%d\", &a, &b);\n  for (c = 1; c <= a; c++) {\n    for (d = 1; d <= b; d++)\n      scanf(\"%d\", &n[c][d]);\n  }\n  if (a >= b) {\n    for (e = 1; e <= b; e++) {\n      for (f = 1; f <= e; f++) {\n        printf(\"%d\\n\", n[f][e + 1 - f]);\n      }\n    }\n    for (g = 2; g <= a; g++) {\n      for (h = 1; h <= b && g - 1 + h <= a; h++) {\n        printf(\"%d\\n\", n[g - 1 + h][b + 1 - h]);\n      }\n    }\n  } else {\n    for (i = 1; i <= b; i++) {\n      for (j = 1; j <= a && i + 1 - j > 0; j++) {\n        printf(\"%d\\n\", n[j][i + 1 - j]);\n      }\n    }\n    for (k = 2; k <= a; k++) {\n      for (l = 1; l <= a + 1 - k; l++)\n        printf(\"%d\\n\", n[k - 1 + l][b + 1 - l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6276", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k < row + col - 1; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k && k - i >= 0)\n          printf(\"%d\\n\", a[i][k - i]);\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int matrix[100][100];\n  int i, j, k, x, a, b;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> matrix[i][j];\n\n  for (k = 2; k <= row + col; k++) {\n    a = k > col + 1 ? k - col : 1;\n    b = k > row + 1 ? row + 1 : k;\n    for (x = a; x < b; x++) {\n      cout << matrix[x][k - x] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[100][100];\n  int i, j, k;\n\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      cin >> array[i][j];\n  }\n  if (col > row) {\n    for (k = 0; k <= row - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = row; k < col - 1; k++) {\n      int s = 0;\n      j = k;\n      i = 0;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != row);\n    }\n\n    for (k = 0; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k <= row - 1; k++) {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  if (col < row) {\n    for (k = 0; k <= col - 1; k++)\n\n    {\n      i = 0;\n      j = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (j != -1);\n    }\n    for (k = 1; k < row - col; k++) {\n      int s = 0;\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        s++;\n        j--;\n        i++;\n      } while (s != col);\n    }\n\n    for (k = row - col; k <= row - 1; k++) {\n      j = col - 1;\n      i = k;\n      do {\n        cout << array[i][j] << endl;\n        j--;\n        i++;\n      } while (i != row);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, *p[100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p[i] + j);\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0, j = k - 1; i <= row - 1; i++, j--)\n      if (i <= row - 1 && j >= 0 && j <= col - 1 && i >= 0)\n        printf(\"%d\\n\", *(p[i] + j));\n  printf(\"%d\\n\", *(p[row - 1] + col - 1));\n}\n"}
{"label": "4", "index": "6280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, temp = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  while (temp < col) {\n    j = temp;\n    i = 0;\n    while (i < row && j >= 0) {\n      cout << array[i++][j--] << endl;\n    }\n    temp++;\n  }\n  if (row > 1) {\n    temp = 1;\n    while (temp < row) {\n      j = col - 1;\n      i = temp;\n      while (i < row && j >= 0) {\n        cout << array[i++][j--] << endl;\n      }\n      temp++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, a[100][100], x = 0, y = 0, k = 0, l = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n\n  for (;;) {\n    printf(\"%d\\n\", a[x][y]);\n    if (x == n - 1 && y == m - 1)\n      break;\n    if (y == 0 || x == n - 1) {\n      if (l == m - 1)\n        k++;\n      else\n        l++;\n      x = k;\n      y = l;\n      continue;\n    }\n    x++;\n    y--;\n  }\n}\n"}
{"label": "4", "index": "6282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (j = 0; j < n; j++)\n    for (l = 0; (l < m) && (l <= j); l++)\n      printf(\"%d\\n\", a[l][j - l]);\n  for (i = 1; i < m; i++)\n    for (k = 0; (k < m - i) && (k < n); k++)\n      cout << a[i + k][n - k - 1] << \"\\n\";\n}\n"}
{"label": "4", "index": "6283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i;\n  int a[10010], *p = a;\n  for (i = 0; i < row * col; i++) {\n    cin >> *p;\n    p++;\n  }\n  p = a;\n  for (int c = 0; c < row + col; c++) {\n    for (i = c; i >= 0; i--) {\n      if (i < col && c - i < row)\n        printf(\"%d\\n\", *(p + i + (c - i) * col));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, num[100][100];\n  cin >> m >> n;\n  cout << endl;\n  for (int u = 0; u < m; u++) {\n    for (int v = 0; v < n; v++) {\n      cin >> num[u][v];\n    }\n    cout << endl;\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i)\n          cout << num[j][k] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6286", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, h;\n  cin >> row >> col;\n  cout << endl;\n  int a[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row != 1 && col != 1) {\n    for (j = 0; j <= col - 1; j++) {\n      k = 0;\n      h = j;\n      while (k <= row - 1 && h >= 0) {\n        cout << a[k][h] << endl;\n        k = k + 1;\n        h = h - 1;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      k = col - 1;\n      h = i;\n      while (h <= row - 1 && k >= 0) {\n        cout << a[h][k] << endl;\n        h = h + 1;\n        k = k - 1;\n      }\n    }\n  }\n  if (row == 1 && col != 1) {\n    for (i = 0; i <= col - 1; i++)\n      cout << a[0][i] << endl;\n  }\n  if (col == 1 && row != 1) {\n    for (i = 0; i <= row - 1; i++) {\n      cout << a[i][0] << endl;\n    }\n  }\n  if (row == 1 && col == 1) {\n    printf(\"%d\\n\", a[0][0]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int matrix[120][120];\n  cin >> row >> col;\n  int *p[100];\n  for (int i = 0; i < row; i++) {\n    p[i] = &matrix[i][0];\n    for (int j = 0; j < col; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  if (col >= row) {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  } else {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << \"\\n\";\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row && j >= 0; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    for (int i = 0; i <= sum; i++) {\n      if (i > row - 1)\n        break;\n      for (int j = 0; j <= sum; j++) {\n        if (j > col - 1)\n          break;\n        if (i + j == sum)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6289", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, m, n, k, num = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    j = i;\n    while (j >= 0 && i - j < row) {\n      printf(\"%d\\n\", a[i - j][j]);\n      j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = i;\n    while (j < row && col - 1 + i - j >= 0) {\n      cout << a[j][col - 1 + i - j] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6290", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], m, n, i, j, k;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j - k == 0)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], col, row, i, j, k, min;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; (k >= 0 && i < row) == 1;) {\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      k--;\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = i; (j >= 0 && k < row) == 1;) {\n      printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n}\n"}
{"label": "4", "index": "6292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100];\n  int xx_row, sx_row, xx_col, sx_col;\n  int i, j, c, r;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  xx_row = 0;\n  sx_row = row - 1;\n  xx_col = 0;\n  sx_col = col - 1;\n  if (col > row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (c = sx_row + 1; c < sx_col; c++) {\n      j = c;\n      for (i = 0; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n    for (r = xx_row; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col < row) {\n    for (c = xx_col; c <= sx_col; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        cout << sz[i][j] << \"\\n\";\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r < row - col; r++) {\n      i = r;\n      for (j = sx_col; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = row - col; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col == row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6293", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lin, col;\n  scanf(\"%d %d \", &lin, &col);\n  int i, j;\n  int num[100][100];\n  for (i = 0; i < lin; i++) {\n    for (j = 0; j < col; j++)\n      cin >> num[i][j];\n  }\n  if (lin <= col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j && i < lin; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; j >= i && col + i - 1 - j < lin; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  } else {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; col - 1 + i - j < lin && j >= 0; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6294", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int rol, col;\n  cin >> rol >> col;\n  int a[rol][col];\n  int i, j;\n  for (i = 0; i < rol; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int k; \n  for (k = 0; k <= rol + col - 2; k++) {\n    for (i = 0; k - i >= 0 && i < rol; i++) {\n      if (k - i >= col) {\n        continue;\n      }\n      j = k - i;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000];\n  int m, n;\n  cin >> m >> n;\n  int i;\n  for (i = 0; i < m * n; i++) {\n    cin >> a[i];\n  }\n  int *p;\n  int temp;\n  temp = 0;\n  int num = m + n - 1;\n  while (num--) {\n    p = a + temp;\n    i = temp;\n    while (i % n != 0 && i / n != m - 1) {\n      cout << *p << \"\\n\";\n      p = p + (n - 1);\n      i += (n - 1);\n    }\n    cout << *p << endl;\n    if (temp < n - 1) {\n      temp++;\n    } else {\n      temp += n;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> m >> n;\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < m + n - 1; i++) {\n    for (int j = 0; j <= i; j++) {\n      if ((j < m) && (i - j < n))\n        printf(\"%d\\n\", *(*(a + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[101][101];\n  int i, j, row, col;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> num[i][j];\n  printf(\"%d\", num[1][1]);\n  for (i = 3; i <= col + row; i++) {\n    for (j = 1; j < i; j++) {\n      if (j <= row && i - j <= col)\n        printf(\"\\n%d\", num[j][i - j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], p, q, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  p = 0;\n  q = 0;\n  for (int i = 0; i < row * col; i++) {\n    cout << a[p][q] << \"\\n\";\n    if (q == 0 || p == row - 1) {\n      q = p + q + 1;\n      p = 0;\n      while (q >= col) {\n        p++;\n        q--;\n      }\n    } else {\n      p++;\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i = 0, j = 0, h = 0, k = 0, n = 0, m = 0, a[100][100], t = 0;\n  scanf(\"%d %d \", &n, &m);\n  for (j = 0; j < n; j++) {\n    for (h = 0; h < m; h++) {\n      cin >> *(*(a + j) + h);\n    }\n  }\n  for (i = 0; i < n + m - 1; i++) {\n    for (j = 0; j < n; j++) {\n      for (h = 0; h < m; h++) {\n        if (j + h == i) {\n          cout << *(*(a + j) + h) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], col, row, i, j, k, min;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; (k >= 0 && i < row) == 1;) {\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      k--;\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = i; (j >= 0 && k < row) == 1;) {\n      printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], row, col, i;\n  scanf(\"%d %d\", &n, &m);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < m; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  if (n < m) {\n    for (i = 0; i < n; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = n; i < m; i++) {\n      for (row = 0; row < n; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  if (n >= m) {\n    for (i = 0; i < m; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n; i++) {\n      for (col = m - 1; col >= 0; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n    for (i = n; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6302", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[111][111];\n  int *p[111];\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    p[i] = *(a + i);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n\n  for (int i = 0; i < row + col - 1; i++)\n    for (int j = i; j >= 0; j--) {\n      if (j >= col || i - j >= row)\n        continue;\n      if (j < col && i - j < row)\n        cout << *(p[i - j] + j) << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[101][101];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int a;\n  for (i = 1; i < col; i++) {\n    a = i;\n    for (j = 0; j < row && j <= i; j++) {\n      printf(\"\\n%d\", sz[j][a]);\n      a--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    a = j;\n    for (i = col - 1; a < row && i >= 0; i--) {\n      printf(\"\\n%d\", sz[a][i]);\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6304", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint mins(int x, int y) {\n  if (x > y)\n    return y;\n  else\n    return x;\n}\n\nint maxs(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int row, col, i, j, n;\n  scanf(\"%d %d \", &row, &col);\n  n = row * col;\n  int a[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < mins(row, col); i++) {\n    for (j = 0; j <= i; j++) {\n      cout << a[j][i - j] << endl;\n    }\n  }\n\n  if (row >= col) {\n    for (i = col; i < row; i++) {\n      for (j = i - col + 1; j <= i; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = row; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  } else {\n    for (i = row; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = col; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, col, row;\n  int *p[1000];\n  for (i = 0; i < 1000; i++) {\n    p[i] = (int *)malloc(10000 * sizeof(int));\n  }\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  if (col > row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ROW, COL;\nint row = -1, col = 1;\nint array_1[100][100];\nint move() {\n  row++;\n  col--;\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint big_move() {\n  if (row + col < COL - 1) {\n    col = row + col + 1;\n    row = 0;\n  } else {\n    row = row + col - COL + 2;\n    col = COL - 1;\n  }\n  cout << array_1[row][col] << \"\\n\";\n  return 0;\n}\nint main() {\n  cin >> ROW >> COL;\n  int r, c;\n  for (r = 0; r < ROW; r++) {\n    for (c = 0; c < COL; c++) {\n      cin >> array_1[r][c];\n    }\n  }\n  if (ROW == 1 && COL == 1) {\n    printf(\"%d\", array_1[0][0]);\n    return 0;\n  }\n  while (row != ROW - 1 || col != COL - 1) {\n    while (col != 0 && row != ROW - 1)\n      move();\n    big_move();\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 1, h, l, i, j, a[100][100], lans = 0, ans[10000], k;\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (n = 1; n <= l; n++)\n    for (j = 0, k = n - 1; k >= 0 && j <= h - 1; j++, k--)\n      ans[lans++] = a[j][k];\n  for (n = 2; n <= h; n++)\n    for (j = n - 1, k = l - 1; j <= h - 1 && k >= 0; j++, k--)\n      ans[lans++] = a[j][k];\n  for (i = 0; i < lans; i++)\n    printf(\"%d\\n\", ans[i]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << a[i][j] << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "6309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k, b[10000];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (j = 0; j < c; j++) {\n    i = 0;\n    for (k = j; k >= 0 && i < r; k--, i++) {\n      printf(\"%d\\n\", a[i][k]);\n    }\n  }\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    for (k = i; k < r && j >= 0; k++, j--) {\n      printf(\"%d\\n\", a[k][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], m, n, i, j, k;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j - k == 0)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6311", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, u;\n  int a[101][101];\n  int r, c;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  i = 0;\n  j = 0;\n  u = 0;\n  for (i = 0; (i < r) && (u != c); i++) {\n    if ((i == 0) && (j == 0)) {\n      printf(\"%d\", a[i][j]);\n    } else {\n      printf(\"\\n%d\", a[i][j]);\n    }\n    if ((i != r - 1) && (j != 0)) {\n      j--;\n    } else {\n      u++;\n      j = u;\n      i = -1;\n    }\n  }\n  i = 1;\n  u = 1;\n  for (j = c - 1; (j >= 0) && (u < r); j--) {\n\n    printf(\"\\n%d\", a[i][j]);\n\n    if ((j != 0) && (i != r - 1)) {\n      i++;\n    } else {\n      u++;\n      i = u;\n      j = c;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, k, j;\n  scanf(\"%d %d\", &row, &col);\n  for (k = 0; k < row; k++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &(a[k][i]));\n    }\n  }\n  for (i = 0; i < 201; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0) {\n      if (0 <= j && j < col && 0 <= k && k < row)\n        printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6313", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int row, col, i, j, k;\n  for (i = 0; i < 1000; i++)\n    for (j = 0; j < 1000; j++)\n      a[i][j] = -12345;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (j = 0; j < 1000; j++)\n    for (k = j, i = 0; k >= 0; k--, i++) {\n      if (a[i][k] != -12345)\n        printf(\"%d\\n\", a[i][k]);\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  int sum = 0;\n  while (1) {\n    if (sum == m + n - 1)\n      break;\n    else if (sum <= n - 1) {\n      for (int i = 0; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        cout << a[i][sum - i] << endl;\n      }\n      sum++;\n    } else {\n      for (int i = sum + 1 - n; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        cout << a[i][sum - i] << endl;\n      }\n      sum++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6315", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sz[100][100];\n\nint main() {\n\n  int n, m, i, j;\n\n  scanf(\"%d %d\", &n, &m);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n\n  i = 0;\n  j = 0;\n  while (1) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (i == (n - 1) && j == (m - 1)) {\n      break;\n    }\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (i >= n) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (j >= m) {\n      i = j + 1 - m;\n      j = m - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int i, j;\n  int sum;\n  int a[100][100];\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (j = 0;;) {\n    if (j < col - 1) {\n      sum = j;\n      for (;;) {\n        if (sum >= 0 && j - sum < row) {\n          printf(\"%d\\n\", a[j - sum][sum]);\n          sum--;\n        } else {\n          break;\n        }\n      }\n      j++;\n    } else {\n      break;\n    }\n  }\n  for (i = 0;;) {\n    if (i <= row - 1) {\n      sum = col - 1 + i;\n      for (;;) {\n        if (sum >= 0 && col - 1 + i - sum < row) {\n          if (sum <= col - 1) {\n            cout << a[col - 1 + i - sum][sum] << \"\\n\";\n          }\n          sum--;\n        } else {\n          break;\n        }\n      }\n      i++;\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6317", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], r, c, r1, c1;\n  int i, l, j, k, m, n;\n  scanf(\"%d %d \", &r, &c);\n  for (m = 0; m <= 100; m++) {\n    for (n = 0; n <= 100; n++)\n      a[m][n] = -1;\n  }\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 1; k <= c; k++) {\n    c1 = k;\n    r1 = 1;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  for (l = 2; l <= r; l++) {\n    c1 = c;\n    r1 = l;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int h, k, e, s, i, l;\n  scanf(\"%d %d \", &h, &l);\n  int juzhen[1000][1000];\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &(juzhen[i][k]));\n    }\n  }\n\n  for (s = 0; s < l; s++) {\n    k = s;\n    i = 0;\n    for (e = 0; e <= s; e++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (i == h) {\n        break;\n      }\n    }\n  }\n  for (e = 1; e < h; e++) {\n    i = e;\n    k = l - 1;\n    for (s = 0; s < (h - e); s++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (k < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6319", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h, l, i, j, a[100][100], k;\n  scanf(\"%d %d \", &h, &l);\n  for (k = 0; k < h; k++) {\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[k][j]);\n  }\n  i = 0;\n  while (i < l) {\n    k = i;\n    j = 0;\n    while (1) {\n      printf(\"%d\\n\", a[j][k]);\n      k--;\n      j++;\n      if (k < 0 || j == h)\n        break;\n    }\n    i++;\n  }\n  i = 1;\n  while (i < h) {\n    k = i;\n    j = l - 1;\n    while (1) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n      if (j < 0 || k == h)\n        break;\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    scanf(\"%d\", &a[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\" %d\", &a[i][j]);\n    }\n  }\n  for (sum = 0; sum < (row + col - 1); sum++) {\n    for (i = 0; i <= sum; i++) {\n      if (i < row && (sum - i) < col) {\n        printf(\"%d\\n\", a[i][sum - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ro, co, sz[100][1000], i, j, m, k, c = 0, b = 1;\n  scanf(\"%d%d\", &ro, &co);\n  for (i = 0; i < ro; i++) {\n    for (j = 0; j < co; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  m = ro * co;\n  i = 0;\n  j = 0;\n  for (k = 0; k < m; k++) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (ro >= co) {\n      if (j == 0 && i < co - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if ((j < 0 && i > co - 1) || i > ro - 1) {\n        j = co - 1;\n        i = c + 1;\n        c++;\n      }\n    }\n    if (ro < co) {\n      if (j == 0 && i <= ro - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if (i > ro - 1) {\n        i = 0;\n        j = ro + c + 1;\n        c++;\n      }\n\n      if (j > co - 1) {\n        j = co - 1;\n        i = b;\n        b++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, r, s, a[100][100];\n  s = 0;\n  scanf(\"%d %d\", &r, &c);\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  while (c * r >= s) {\n    for (int i = 0; i < r; i++) {\n      for (int j = 0; j < c; j++) {\n        if (i + j == s) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n    s++;\n  }\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "4", "index": "6323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, a[100][100], n, t;\n  scanf(\"%d%d\", &row, &col);\n  n = row + col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (i = 0; i <= t; i++) {\n      if (i < row && (t - i) < col)\n        printf(\"%d\\n\", a[i][t - i]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6324", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, *array, *p, i, j, t;\n  cin >> row >> col;\n  array = (int *)calloc(row, col * sizeof(int));\n  for (p = array; p <= array + row * col - 1; p++)\n    scanf(\"%d\", p);\n  for (t = 0; t <= row + col - 2; t++)\n    for (i = 0; i <= t; i++) {\n      if (i > row - 1 || t - i > col - 1)\n        continue;\n      printf(\"%d\\n\", *(array + i * col + t - i));\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, ROW, COL, array[100][100];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &array[row][col]);\n    }\n  }\n  if (ROW > 1 && COL > 1) {\n    for (col = 0; col < COL; col++) {\n      for (row = 0; row < ROW; row++) {\n        if (col - row < 0)\n          break;\n        else\n          printf(\"%d\\n\", array[row][col - row]);\n      }\n    }\n    for (row = 1; row < ROW - 1; row++) {\n      for (col = COL - 1; col >= 0; col--) {\n        if (row + COL - 1 - col > ROW - 1)\n          break;\n        else\n          printf(\"%d\\n\", array[row + COL - 1 - col][col]);\n      }\n    }\n  }\n  if (ROW == 1 && COL > 1) {\n    for (col = 0; col < COL - 1; col++)\n      printf(\"%d\\n\", array[0][col]);\n  }\n  if (COL == 1 && ROW > 1) {\n    for (row = 0; row < ROW - 1; row++) {\n      printf(\"%d\\n\", array[row][0]);\n    }\n  }\n  printf(\"%d\", array[ROW - 1][COL - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[102][102], row, col, t, k, i, j;\n  cin >> row >> col;\n  t = row + col - 2;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 0; k <= t; k++) {\n    if (k + 1 <= col)\n      i = 0;\n    else\n      i = k - col + 1;\n    j = k - i;\n    while (j >= 0 && i < row) {\n      cout << a[i][j] << \"\\n\";\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, p, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (p = 0; p <= m + n - 2; p++) {\n    for (i = 0; i <= p; i++) {\n      if (i < m && p - i < n)\n        printf(\"%d\\n\", a[i][p - i]);\n      else {\n        continue;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[101][101], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (k = 2; k <= row + col; k++) {\n    if (k <= col + 1) {\n      for (j = k - 1; j >= 1 && k - j <= row; j--) {\n        cout << a[k - j][j] << \"\\n\";\n      }\n    }\n    if (k > col + 1) {\n      for (j = col; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  scanf(\"%d\", &row);\n  return 0;\n}\n"}
{"label": "4", "index": "6329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, time = 0, n, i, j;\n  int array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (n = 0; n < row + col; n++) {\n    if (col < row) {\n      if (n < col) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < row) {\n        for (i = col - 1; i >= 0; i--)\n          printf(\"%d \", array[n - i][i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row < col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < col) {\n        for (i = 0; i <= row - 1; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row == col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      }\n\n      else {\n        for (i = row - 1; i > n - col; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6330", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100], i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (i = col - 1; i >= 0; i--) {\n      if (col - 1 + j - i < row) {\n        cout << array[col - 1 - i + j][i] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, row, col, shuzu[100][100], n = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n  if (row == col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cout << shuzu[i + j][col - 1 - j] << \"\\n\";\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row > col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((col - 1 - j) == 0) {\n          break;\n        }\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int **p, **q;\n  p = (int **)malloc(100 * sizeof(int *));\n  for (i = 0; i < 100; i++) {\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  }\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if ((j < m) && ((i - j) < n)) {\n        if (i == 0) {\n          printf(\"%d\", *(*(p + j) + i - j));\n        } else {\n          printf(\"\\n%d\", *(*(p + j) + i - j));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6333", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, a[100][100];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n\n  int k = 0;\n  for (k = 1; k <= col; k++) {\n    i = 1, j = k;\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      if (i == row || j == 1) {\n        break;\n      }\n      i++, j--;\n    }\n  }\n  for (k = 2; k <= row; k++) {\n    i = k, j = col;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid move1(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < m - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n    }\n  }\n  for (i = m - 1; i < n - 1; i++) {\n    for (k = 0; k < m; k++)\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nvoid move2(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < n - 1; i++) {\n    for (k = 0; k <= i; k++)\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n  }\n  for (i = 0; i < m - n; i++) {\n    for (k = 0; k < n; k++)\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n  }\n  for (i = m - n; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nint main() {\n  int m, n, i, j, *p[100] = {0}, **head;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    p[i] = (int *)malloc(n * sizeof(int));\n  }\n  head = p;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  if (m <= n)\n    move1(p, m, n);\n  else\n    move2(p, m, n);\n}\n"}
{"label": "4", "index": "6335", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row = 0, col = 0, array[100][100];\n  int i = 0, j = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    j = 0;\n    while (j <= i && j < row) {\n      printf(\"%d\\n\", array[j][i - j]);\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = 0;\n    while (j <= row - i - 1 && j < col) {\n      printf(\"%d\\n\", array[i + j][col - 1 - j]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  int sum;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (sum = 0; sum < col - 1; sum++) {\n    for (j = sum; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  for (sum = col - 1; sum <= row + col - 2; sum++) {\n    for (j = col - 1; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p;\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 1; i <= col; i++) {\n    j = i;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n  for (i = 2; i <= row; i++) {\n    j = i * col;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      cout << *(p + j - 1) << \"\\n\";\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n}\n"}
{"label": "4", "index": "6338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int s[100][100];\n  int i, j;\n  int k = 0, l = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= m - 1; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i <= m - 1; i++) {\n    k = 0;\n    l = i;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (l == 0 || k == n - 1) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    k = i;\n    l = m - 1;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (k == n - 1 || l == 0) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  int k = 0;\n  for (k = 1; k <= col; k++) {\n    i = 1, j = k;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  for (k = 2; k <= row; k++) {\n    i = k, j = col;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i = 0, j = 0, h = 0, k = 0, n = 0, m = 0, a[100][100], t = 0;\n  cin >> n >> m;\n  for (j = 0; j < n; j++) {\n    for (h = 0; h < m; h++) {\n      cin >> *(*(a + j) + h);\n    }\n  }\n  for (i = 0; i < n + m - 1; i++) {\n    for (j = 0; j < n; j++) {\n      for (h = 0; h < m; h++) {\n        if (j + h == i) {\n          cout << *(*(a + j) + h) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6341", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, q;\n  scanf(\"%d %d \", &a, &b);\n  int m[a + 1][b + 1];\n  for (i = 1; i <= a; i++)\n    for (j = 1; j <= b; j++)\n      cin >> m[i][j];\n  for (q = 2; q <= a + b; q++)\n    for (i = 1, j = q - i; j > 0; i++, j = q - i) {\n      if (j <= b && i <= a)\n        cout << m[i][j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6342", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ROW, COL, ARRAY[1000][1000];\n\nint main() {\n  cin >> ROW >> COL;\n  for (int i = 0; i < ROW; i++) {\n    for (int j = 0; j < COL; j++)\n      cin >> ARRAY[i][j];\n  }\n  int iterx = 0, itery = 0;\n  for (int iter = 1; iter <= (ROW + COL - 1); iter++) {\n    if (iter <= COL) {\n      iterx = 0;\n      itery = iter - 1;\n    } else {\n      iterx = iter - COL;\n      itery = COL - 1;\n    }\n    while (iterx < ROW && itery >= 0) {\n      cout << ARRAY[iterx][itery] << endl;\n      iterx++;\n      itery--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, ROW, COL, array[100][100];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &array[row][col]);\n    }\n  }\n  if (ROW > 1 && COL > 1) {\n    for (col = 0; col < COL; col++) {\n      for (row = 0; row < ROW; row++) {\n        if (col - row < 0)\n          break;\n        else\n          printf(\"%d\\n\", array[row][col - row]);\n      }\n    }\n    for (row = 1; row < ROW - 1; row++) {\n      for (col = COL - 1; col >= 0; col--) {\n        if (row + COL - 1 - col > ROW - 1)\n          break;\n        else\n          printf(\"%d\\n\", array[row + COL - 1 - col][col]);\n      }\n    }\n  }\n  if (ROW == 1 && COL > 1) {\n    for (col = 0; col < COL - 1; col++)\n      printf(\"%d\\n\", array[0][col]);\n  }\n  if (COL == 1 && ROW > 1) {\n    for (row = 0; row < ROW - 1; row++)\n      printf(\"%d\\n\", array[row][0]);\n  }\n  printf(\"%d\", array[ROW - 1][COL - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100];\n  int xx_row, sx_row, xx_col, sx_col;\n  int i, j, c, r;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  xx_row = 0;\n  sx_row = row - 1;\n  xx_col = 0;\n  sx_col = col - 1;\n  if (col > row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (c = sx_row + 1; c < sx_col; c++) {\n      j = c;\n      for (i = 0; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n    for (r = xx_row; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col < row) {\n    for (c = xx_col; c <= sx_col; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r < row - col; r++) {\n      i = r;\n      for (j = sx_col; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = row - col; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  if (col == row) {\n    for (c = xx_col; c <= sx_row; c++) {\n      i = 0;\n      for (j = c; j >= xx_col; j--) {\n        printf(\"%d\\n\", sz[i][j]);\n        i++;\n      }\n    }\n    for (r = xx_row + 1; r <= sx_row; r++) {\n      j = sx_col;\n      for (i = r; i <= sx_row; i++) {\n        printf(\"%d\\n\", sz[i][j]);\n        j--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int R, C, i, j, k, l, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &R, &C);\n  for (i = 0; i < R; i++) {\n    for (j = 0; j < C; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < C; j++) {\n    i = 0;\n    while (i <= j) {\n      k = j - i;\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      if (i > R - 1) {\n        break;\n      }\n    }\n  }\n  for (l = C; l < R + C - 1; l++) {\n    m = l - C + 1;\n    while (m <= l) {\n      n = l - m;\n      printf(\"%d\\n\", a[m][n]);\n      m++;\n      if (m > R - 1) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[104][104];\n  int h, l;\n  scanf(\"%d %d \", &h, &l);\n  for (int i = 0; i < 104; i++)\n    for (int k = 0; k < 104; k++)\n      a[i][k] = -999;\n  for (int i = 1; i <= h; i++)\n    for (int k = 1; k <= l; k++)\n      cin >> a[i][k];\n  int printer = a[1][1];\n  for (int i = 1; i <= l; i++) {\n    int k = 0;\n    printer = a[1 + k][i - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[1 + k][i - k];\n    }\n  }\n  for (int i = 2; i <= h; i++) {\n    int k = 0;\n    printer = a[i + k][l - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[i + k][l - k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6347", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z[100][100];\n  int m, n, a, b, c;\n  scanf(\"%d%d\", &m, &n);\n  for (a = 0; a <= m - 1; a++) {\n    for (b = 0; b <= n - 1; b++) {\n      cin >> z[a][b];\n    }\n  }\n  a = 0;\n  b = 0;\n  for (c = 0; c <= m * n - 1; c++) {\n    printf(\"%d\\n\", z[a][b]);\n    a++;\n    b--;\n    if ((a > m - 1) || (b < 0)) {\n      while ((a > 0) && (b < n - 1)) {\n        a--;\n        b++;\n      }\n      if ((a == 0) && (b < n - 1))\n        b++;\n      else\n        a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  static int a[105][105];\n  int i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0; i < n;) {\n    for (k = i; k < n && i + j - k >= 0; k++)\n      cout << a[k][i + j - k] << \" \";\n\n    if (j != m - 1)\n      j++;\n    else if (j == m - 1)\n      i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, m, i, j, shu[100][100], hang = 1, lie = 1, count, mark, zddjx, duijiao,\n                                 jh = 1, jl = 1;\n  cin >> n >> m;\n  count = n * m;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= m; j++) {\n      cin >> shu[i][j];\n    }\n  }\n  if (n == 1) {\n    for (j = 1; j <= m; j++)\n      cout << shu[1][j] << endl;\n  }\n  if (n == 1) {\n    return 0;\n  }\n  if (m == 1) {\n    for (j = 1; j <= n; j++) {\n      cout << shu[j][1] << endl;\n    }\n    return 0;\n  }\n  if (m == 1) {\n    return 0;\n  }\n  cout << shu[hang][lie] << endl;\n  duijiao = hang + lie;\n  count--;\n  while (count != 0) {\n    duijiao++;\n    hang = jh;\n    lie = duijiao - hang;\n    if (lie == m) {\n      jh++;\n    }\n    while (lie >= jl) {\n      cout << shu[hang][lie] << endl;\n      count--;\n      hang++;\n      lie--;\n    }\n    if (hang == n + 1) {\n      jl++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6350", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  for (int k = 0; k < col; k++) {\n    if (k < row)\n      for (int i = 0; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = 0; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  for (int k = col; k < row + col - 1; k++) {\n    if (k < row)\n      for (int i = k - col + 1; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = k - col + 1; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, k, j;\n  scanf(\"%d %d\", &row, &col);\n  for (k = 0; k < row; k++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &(a[k][i]));\n    }\n  }\n  for (i = 0; i < 201; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0) {\n      if (0 <= j && j < col && 0 <= k && k < row)\n        printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0}, n = 0, m = 0, i = 0, j = 0;\nvoid bianli(int hang, int lie) {\n  if (lie == 0 || hang == n - 1)\n    cout << a[hang][lie] << endl;\n  else {\n    cout << a[hang][lie] << endl;\n    bianli(hang + 1, lie - 1);\n  }\n}\nint main() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < m; i++)\n    bianli(0, i);\n\n  for (i = 1; i < n; i++) {\n    bianli(i, m - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, a[1000][1000];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (n = 0; n <= col - 1; n++) {\n    for (j = n; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n  }\n  for (n = col; n <= row + col - 2; n++) {\n    for (j = col - 1; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n    j = col - 1;\n  }\n}\n"}
{"label": "4", "index": "6354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p[1000], n, m, i, j, t;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(1000);\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n\n  for (j = 0; j < m + n - 1; j++) {\n    if (j < m)\n      t = 0;\n    else\n      t = j - m + 1;\n    for (i = t; i < n && i <= j; i++)\n      printf(\"%d\\n\", *(*(p + i) + j - i));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  j = 0;\n  for (i = 0; i < row; i++) {\n    if (i == 0) {\n      while (j <= col - 1) {\n        cout << array[i][j] << endl;\n        for (int k = i + 1; k < row; k++) {\n          if (i + j - k >= 0)\n            cout << array[k][i + j - k] << endl;\n        }\n        j++;\n      }\n    } else {\n      j = col - 1;\n      cout << array[i][j] << endl;\n      for (int k = i + 1; k < row; k++) {\n        if (i + j - k >= 0)\n          cout << array[k][i + j - k] << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  printf(\"%d\\n\", a[0][0]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j + 1 && i < m; i++) {\n      printf(\"%d\\n\", a[i][j - i]);\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < n && j < m - i; j++)\n      cout << a[j + i][n - 1 - j] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6357", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ROW, COL, ARRAY[1000][1000];\n\nint main() {\n  cin >> ROW >> COL;\n  for (int i = 0; i < ROW; i++) {\n    for (int j = 0; j < COL; j++)\n      cin >> ARRAY[i][j];\n  }\n  int iterx = 0, itery = 0;\n  for (int iter = 1; iter <= (ROW + COL - 1); iter++) {\n    if (iter <= COL) {\n      iterx = 0;\n      itery = iter - 1;\n    } else {\n      iterx = iter - COL;\n      itery = COL - 1;\n    }\n    while (iterx < ROW && itery >= 0) {\n      printf(\"%d\\n\", ARRAY[iterx][itery]);\n      iterx++;\n      itery--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6358", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int row, col, i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0, j = k - i; i <= row - 1 && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = col; k <= row + col - 2; k++)\n    for (j = col - 1, i = k - j; i <= row - 1 && j >= 0; i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n[100][100], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &n[i][j]);\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0, k = i; j < row && k >= 0; j++, k--)\n      if (k < col)\n        cout << n[j][k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int m, n, i, j, r;\n  long flag = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (r = 0; r < m + n - 1; r++) {\n    for (i = 0; i <= r && flag < m * n; i++) {\n      if (i < m && r - i < n) {\n        cout << a[i][r - i] << \"\\n\";\n        flag++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6361", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint h, l, (*p)[100];\nvoid shuchu(int a) {\n  int r, c, i = 0;\n  r = 0;\n  c = a;\n  for (; r < h; i++) {\n    if (c >= 0 && c < l)\n      printf(\"%d\\n\", *(*(p + r) + c));\n    r += 1;\n    c -= 1;\n  }\n}\n\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &h, &l);\n  p = (int(*)[100])malloc(h * 100 * sizeof(int));\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < h + l - 1; i++)\n    shuchu(i);\n}\n"}
{"label": "4", "index": "6362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint arr[100][100];\nint row, col;\nvoid bianli(int y, int x) {\n  for (; y <= row && x > 0; y++, x--)\n    printf(\"%d\\n\", *(*(arr + y) + x));\n}\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(arr + i) + j);\n  for (int i = 1; i <= col; i++)\n    bianli(1, i);\n  for (int i = 2; i <= row; i++)\n    bianli(i, col);\n  return 0;\n}\n"}
{"label": "4", "index": "6363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, m, e, cishu, sz[100][100];\n  e = 0;\n  n = 0;\n  cishu = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  if (row > 1 && col > 1) {\n    for (i = 0, j = 0;; i++, j--) {\n      if (i == 0) {\n        m = j;\n      }\n      printf(\"%d\\n\", sz[i][j]);\n      cishu++;\n      if (cishu == row * col) {\n        break;\n      }\n      if ((j == 0 || i == row - 1) && e == 0) {\n        i = -1;\n        j = m + 2;\n        if (j == col) {\n          e = 1;\n        }\n      }\n      if ((j == 0 || i == row - 1) && e == 1) {\n        j = col;\n        n++;\n        i = n - 1;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0; i < col; i++) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6364", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, t, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  row -= 1;\n  col -= 1;\n  t = row + col;\n  for (i = 0; i <= t; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row || (i - j) > col)\n        continue;\n      printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j;\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i - 1][j - 1];\n    }\n  }\n  int sum;\n  for (sum = 2; sum <= (col + row); sum++) {\n    if (sum <= col + 1) {\n      for (i = 1, j = sum - 1; i < sum && i <= row && j <= col; i++, j--) {\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n      }\n    } else {\n      for (i = sum - col, j = sum - i; i < sum && i <= row && j <= col;\n           i++, j--)\n        cout << a[i - 1][j - 1] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  memset(array, 0, sizeof(array));\n  int i, j, k, row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << array[i][j] << \"\\n\";\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c;\n\n  int sz[100][100];\n  int row, col, ROW, COL;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  printf(\"%d \", sz[0][0]);\n\n  int i = 0, j, k;\n\n  for (j = 1; j < COL; j++) {\n\n    for (k = j; k >= 0; k--) {\n      if (j - k < ROW) {\n        printf(\"%d \", sz[j - k][k]);\n      }\n    }\n  }\n  for (j = COL; j <= COL + ROW; j++) {\n\n    for (k = COL - 1; k >= 0; k--) {\n      if (j - k < ROW) {\n        printf(\"%d \", sz[j - k][k]);\n      }\n    }\n  }\n\n  scanf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "4", "index": "6368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (int k = 2; k <= row + col; k++)\n    for (int i = 1; i <= row; i++)\n      for (int j = 1; j <= col; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", *(*(a + i) + j));\n  return 0;\n}\n"}
{"label": "4", "index": "6369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a, b;\n  int s[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (j = 0; j < a; j++) {\n    for (i = 0; i < b; i++)\n      scanf(\"%d\", &s[j][i]);\n  }\n  for (j = 0; j < b; j++) {\n    k = j;\n    for (i = 0;; i++) {\n      if (i == a) {\n        break;\n      }\n      cout << s[i][k] << \"\\n\";\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  for (j = 1; j < a; j++) {\n    k = j;\n    for (i = b - 1; i >= 0; i--) {\n      printf(\"%d\\n\", s[k][i]);\n      k++;\n      if (k == a)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, sum, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  for (sum = 0; sum <= col - 1; sum++) {\n    for (i = 0; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n  for (sum = col; sum <= col + row - 2; sum++) {\n    for (i = sum - col + 1; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, row, col, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0, j = 0, k = 2; j < col; i++, j--) {\n    printf(\"%d\\n\", a[i][j]);\n    if (j == 0 || i == row - 1) {\n      j = k;\n      k = k + 1;\n      i = -1;\n    }\n  }\n  for (i = 1, j = col - 1, k = 1; i < row; i++, j--) {\n    cout << a[i][j] << \"\\n\";\n\n    if (i == row - 1 || j == 0) {\n      i = k;\n      k++;\n      j = col;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, s[100][100], i, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (k = 0; k < col; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  if (col < row) {\n    for (i = 0; i <= (row + col); i++) {\n      for (k = 0; k < row && k <= i; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  } else if (col >= row) {\n    for (i = 0; i <= (col + row); i++) {\n      for (k = 0; k <= i && k < row; k++) {\n        if ((i - k) >= col) {\n          continue;\n        } else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6373", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        cout << a[j][i - j] << endl;\n    }\n  for (i = 1; i < row; i++)\n    for (j = i; j < col + i; j++) {\n      if (j < row)\n        cout << a[j][col + i - j - 1] << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, k, t = 0, a[101][101] = {0};\n  int *p;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = (int *)malloc(sizeof(int) * row * col);\n\n  for (i = 0; i < col; i++)\n    for (k = 0, j = i; j >= 0 && k < row; k++, j--) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; j--, k++) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 0; i < row * col; i++)\n    cout << *(p + i) << \"\\n\";\n}\n"}
{"label": "4", "index": "6375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  for (n = 0; n < col; n++) {\n    for (i = 0; i < n + 1 && i < row; i++) {\n      j = n - i;\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n  for (n = col; n < col + row - 1; n++) {\n    for (i = n - col + 1; i < row && i < n + 1; i++) {\n      j = n - i;\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "6376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k, b[10000];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  }\n  for (j = 0; j < c; j++) {\n    i = 0;\n    for (k = j; k >= 0 && i < r; k--, i++) {\n      printf(\"%d\\n\", a[i][k]);\n    }\n  }\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    for (k = i; k < r && j >= 0; k++, j--) {\n      printf(\"%d\\n\", a[k][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int i, j, k, row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = row;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++)\n        printf(\"%d\\n\", array[j][sum - j]);\n\n      sum++;\n    }\n  } else if (col > row) {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = col - 1;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++)\n        printf(\"%d\\n\", array[j][sum + k - j]);\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = col; k < row; k++) {\n      for (i = col - 1; i >= 0; i--)\n        printf(\"%d\\n\", array[k - i][i]);\n    }\n    sum = 0;\n    for (k = row; k < row + col - 1; k++) {\n      for (i = col - 1; i > sum; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n      sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6378", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  static int a[105][105];\n  int i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n\n  for (i = 0, j = 0; i < n;) {\n    for (k = i; k < n && i + j - k >= 0; k++) {\n      printf(\"%d \", a[k][i + j - k]);\n    }\n    if (j != m - 1)\n      j++;\n    else if (j == m - 1)\n      i++;\n  }\n}\n"}
{"label": "4", "index": "6379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, k, j, p;\n  int a[123][123];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k <= row + col - 2; k = k + 1) {\n    for (p = 0; p <= k; p++) {\n      if (p < row && k - p < col)\n        printf(\"%d\\n\", a[p][k - p]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int i = 2; i <= col + row; i++)\n    for (int j = 1; j <= i - 1; j++) {\n      if (i - j > col)\n        continue;\n      if (j > row)\n        continue;\n      cout << a[j][i - j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100], ROW, COL, i = 0, k = 0, j = 0;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6382", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  int s[100][100];\n  int i, j;\n  int k = 0, l = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= m - 1; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i <= m - 1; i++) {\n    k = 0;\n    l = i;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (l == 0 || k == n - 1) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    k = i;\n    l = m - 1;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (k == n - 1 || l == 0) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6383", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, lie, z;\n  int i, j;\n  scanf(\"%d %d\", &n, &lie);\n  int *p[n];\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (z = 0; z <= n + lie - 2; z++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == z)\n          printf(\"%d \", *(p[i] + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid bianli() {\n  int a[1000][1000], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      cout << a[i][j] << \" \";\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      cout << a[i][j] << \" \";\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\nint main() { bianli(); }\n"}
{"label": "4", "index": "6385", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int data[100][100];\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> data[i][j];\n    }\n  }\n\n  for (int i = 0; i < col; i++) {\n    int m = 0, n = i;\n    while (true) {\n      printf(\"%d\\n\", data[m][n]);\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int m = i, n = col - 1;\n    while (true) {\n      printf(\"%d\\n\", data[m][n]);\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0;\n  int ar[101][101];\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &ar[i][j]);\n\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row > col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row - 1; i++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n\n    for (i = row; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row < col) {\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = row; i <= col - 1; i++)\n      for (j = 0; j <= row - 1; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6387", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int i = 0; i < col; i++) {\n    cout << a[0][i] << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    cout << a[i][col - 1] << endl;\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, a[1000][1000];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= col - 1; n++) {\n    for (j = n; (j >= 0) && (n - j) <= (row - 1); j--) {\n      cout << a[n - j][j] << \"\\n\";\n    }\n  }\n  for (n = col; n <= row + col - 2; n++) {\n    for (j = col - 1; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n    j = col - 1;\n  }\n}\n"}
{"label": "4", "index": "6389", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], p, q, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  p = 0;\n  q = 0;\n  for (int i = 0; i < row * col; i++) {\n    cout << a[p][q] << endl;\n    if (q == 0 || p == row - 1) {\n      q = p + q + 1;\n      p = 0;\n      while (q >= col) {\n        p++;\n        q--;\n      }\n    } else {\n      p++;\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int r, c;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", &sz[r][c]);\n    }\n  }\n  int k;\n  int first = 1;\n  int min = row - 1;\n  if (col < min + 1) {\n    min = col - 1;\n  }\n\n  for (k = 0; k <= min; k++) {\n    for (r = 0; r <= k; r++) {\n      if (first == 1) {\n        printf(\"%d\", sz[r][k - r]);\n        first = 0;\n      } else {\n        printf(\"\\n%d\", sz[r][k - r]);\n      }\n    }\n  }\n\n  if (row > col) {\n    for (k = 1; k <= row - col; k++) {\n      for (r = k, c = col - 1; c >= 0 && r < row; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  if (row < col) {\n    for (k = 1; k <= col - row; k++) {\n      for (c = row - 1 + k, r = 0; r <= row - 1; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  for (k = min + 1; k >= 1; k--) {\n    for (r = row - k + 1, c = col - 1; r < row; r++, c--) {\n      printf(\"\\n%d\", sz[r][c]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      printf(\"%d\\n\", array[j][i - j]);\n      if (i - j == 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i; j < row; j++) {\n      cout << array[j][col - 1 - j + i] << \"\\n\";\n      if (col - 1 - j + i == 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, s;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) {\n    s = i;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << \"\\n\";\n      s--;\n    }\n  }\n  for (i = col; i < col + row - 1; i++) {\n    s = col - 1;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6393", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() { \n  int row = 0, col = 0, array[100][100], (*p)[100] = array,\n      *q = *p;                  \n  cin >> row >> col;            \n  for (int i = 0; i < row; i++) \n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int x = 0, j = 0;                     \n  while (q != array[row - 1] + col - 1) \n  {\n    cout << *q << endl;\n    if (q == *p || *p == array[row - 1]) \n    {\n      x++;          \n      if (x >= col) \n      {\n        p = array + x + 1 - col; \n        q = *p + col - 1;        \n        j = col - 1;             \n      } else                     \n      {\n        p = array;  \n        q = *p + x; \n        j = x;      \n      }\n    } else \n    {\n      p++;            \n      q = *p + (--j); \n    }\n  }\n  cout << *q; \n  return 0;   \n}\n"}
{"label": "4", "index": "6394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[100][100] = {0};\n  int *p = a[0];\n  for (p = a[0]; p < a[0] + n * m; p++) {\n    cin >> *p;\n  }\n  if (n == 1 || m == 1) {\n    for (int k = 0; k < n * m - 1; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            printf(\"%d\\n\", *p);\n          }\n        }\n      }\n    }\n    cout << *(a[0] + n * m - 1);\n  } else {\n    for (int k = 0; k < n * m - 2; k++) {\n      for (int i = 0; i < n; i++) {\n        for (p = a[0] + m * i; p < a[0] + m * (i + 1); p++) {\n          if (((i + p - a[0] - m * i) == k) && (p != a[0] + n * m - 1)) {\n            cout << *p << endl;\n          }\n        }\n      }\n    }\n\n    cout << *(a[0] + m * n - 1);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[110][110];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++) {\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1; j > i + col - 1 - row && j >= 0; j--)\n      cout << *(*(a + i + col - j - 1) + j) << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6396", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint row, col, Mat[111][111];\n\nvoid Out(int i, int j) \n{\n  cout << *(*(Mat + i) + j) << endl;\n  if (i == row - 1 || j == 0)\n    return; \n  else\n    Out(i + 1, j - 1);\n}\n\nint main() {\n  cin >> row >> col;\n\n  \n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(Mat + i) + j);\n\n  for (int i = 0; i < col; i++)\n    Out(0, i);\n\n  for (int i = 1; i < row; i++)\n    Out(i, col - 1);\n}\n"}
{"label": "4", "index": "6397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, cnt = 1;\n  int a[201][201] = {0}, b[10001] = {0};\n  cin >> row >> col;\n  for (i = 1; i <= 200; i++) {\n    for (j = 1; j <= 200; j++)\n      a[i][j] = -1;\n  }\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  i = 1, j = 1;\n  while (cnt <= row * col) {\n    if (a[i][j] != -1)\n      b[cnt++] = a[i][j];\n    if (j == 1 || i == row) {\n      j = i + j;\n      i = 1;\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n  for (i = 1; i <= row * col; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int col, row, sz[100][100];\n  cin >> row >> col;\n  int l, m;\n  for (l = 0; l < row; l++) {\n    for (m = 0; m < col; m++) {\n      cin >> sz[l][m];\n    }\n  }\n  int i, j, k;\n\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (k == i + j) {\n          cout << sz[i][j] << endl;\n        }\n        if (i + j > k)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0;\n  int ar[101][101];\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &ar[i][j]);\n\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row > col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row - 1; i++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n\n    for (i = row; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row < col) {\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = row; i <= col - 1; i++)\n      for (j = 0; j <= row - 1; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, m, sz[100][100], row, col, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &sz[a][b]);\n    }\n  }\n  if (row >= col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < (row + col - 1); k++) {\n      m = k - col + 1;\n      for (i = 0; (i < (row - m) && i <= (k - m)); i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  } else {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < row + col - 1; k++) {\n      m = k - col + 1;\n      for (i = 0; i < row - m; i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row;\n  int mat[200][200];\n  int i, j;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &mat[i][j]);\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      printf(\"%d\\n\", mat[i][j]);\n    if (i == row - 1 && j == col - 1)\n      break;\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int jz[100][100];\n  int i = 0;\n  int j = 0;\n  int m = 0;\n  int n = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &jz[i][j]);\n  }\n\n  printf(\"%d\\n\", jz[0][0]);\n\n  if (row <= col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n\n  else if (row > col) {\n    for (m = 0, n = 1; n < col; n++) {\n      for (i = m, j = n; j >= 0 && i < row; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n    for (m = 1, n = col - 1; m < row - 1; m++) {\n      for (i = m, j = n; i < row && j >= 0; i++, j--) {\n        printf(\"%d\\n\", jz[i][j]);\n      }\n    }\n  }\n  if (row != 1)\n    printf(\"%d\", jz[row - 1][col - 1]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col, i, j, s;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (s = 0; s < row + col - 1; s++) {\n    for (i = 0; i < row; i++) {\n      if (s - i < col) {\n        if (s >= i) {\n          cout << a[i][s - i] << \"\\n\";\n        } else\n          break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, p, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (p = 0; p <= m + n - 2; p++) {\n    for (i = 0; i <= p; i++) {\n      if (i < m && p - i < n)\n        cout << a[i][p - i] << \"\\n\";\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < col; i++) \n  {\n    for (j = i, k = 0; j >= 0, k <= i; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0) \n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  }\n  for (i = 1; i <= row - 1; i++) \n    for (j = col - 1, k = i; j >= 0, k <= row - 1; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0) \n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int array[100][100], row, col, i, j,\n      *p = NULL; \n  cin >> row >> col;\n  memset(array, 0, sizeof(array)); \n  for (i = 0; i < row; i++)        \n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++) \n    for (p = &array[0][i]; *p; p += 99)\n      cout << *p << endl;\n  for (i = 1; i < row; i++) \n    for (p = &array[i][col - 1]; *p; p += 99)\n      cout << *p << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6407", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, array[110][110] = {0}, i, j, p = 0, q = 0, sum, count = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  }\n  sum = row * col;\n  while (count != sum) {\n    if (q != 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      p++;\n      q--;\n      continue;\n    }\n    if (q == 0 && p != row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      if (q != col - 2) {\n        q = p + 1;\n        p = 0;\n        if (q > col - 1) {\n          p = q - col + 1;\n          q = col - 1;\n        }\n      } else if (q == col - 2) {\n        p = p - col + 2;\n        q = col - 1;\n      }\n      continue;\n    }\n    if (p == row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      q = p + q + 1;\n      p = 0;\n      if (q > col - 1) {\n        p = q - col + 1;\n        q = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, b, y, k, t, a, x[500][500];\n  scanf(\"%d%d\", &a, &b);\n  y = 0;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++) {\n      cin >> x[i][j];\n    }\n  }\n  for (t = 2; t <= a + b; t++) {\n\n    for (k = 1; k < t; k++) {\n      if (t - k <= b && k <= a) {\n        cout << x[k][t - k] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6409", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int matrix[99][99], row, column, startcolumn = 0, startrow = 1;\n  cin >> row >> column;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < column; j++)\n      cin >> matrix[i][j];\n  }\n  int x = 0, y;\n  do {\n    y = startcolumn;\n    while (x < row && y >= 0) {\n      cout << matrix[x][y] << endl;\n      x++;\n      y--;\n    }\n    x = 0;\n    startcolumn++;\n  } while (startcolumn < column);\n  int m, n = column - 1;\n  do {\n    m = startrow;\n    while (m < row && n >= 0) {\n      cout << matrix[m][n] << endl;\n      m++;\n      n--;\n    }\n    startrow++;\n    n = column - 1;\n  } while (startrow < row);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sz[100][100];\n\nint main() {\n\n  int n, m, i, j;\n\n  cin >> n >> m;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n\n  i = 0;\n  j = 0;\n  while (1) {\n    cout << sz[i][j] << \"\\n\";\n    if (i == (n - 1) && j == (m - 1)) {\n      break;\n    }\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (i >= n) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (j >= m) {\n      i = j + 1 - m;\n      j = m - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, n;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (n = 0; n <= row + col - 2; n++) {\n    for (i = 0; i < row && i <= n; i++) {\n      for (j = 0; j < col && j <= n; j++) {\n        if (i + j == n)\n          cout << a[i][j] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    if (i >= col) {\n      for (j = col - 1; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", a[i - j][j]);\n      }\n    } else {\n      for (j = i; j >= i - row + 1 && j >= 0; j--) {\n        cout << a[i - j][j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, r, c, s;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (s = 0; s < r + c - 1; s++) {\n    for (i = 0; i <= s; i++) {\n      if (i <= r - 1 && s - i <= c - 1) {\n        if (i == 0 && s - i == 0)\n          printf(\"%d\", a[0][0]);\n        else\n          cout << \"\\n\" << a[i][s - i];\n      }\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int matrix[100][100];\n  int i, j, k, x, a, b;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> matrix[i][j];\n    }\n  for (k = 2; k <= row + col; k++) {\n    a = k > col + 1 ? k - col : 1;\n    b = k > row + 1 ? row + 1 : k;\n    for (x = a; x < b; x++) {\n      printf(\"%d\\n\", matrix[x][k - x]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, k, j, p;\n  int a[123][123];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= row + col - 2; k = k + 1) {\n    for (p = 0; p <= k; p++) {\n      if (p < row && k - p < col)\n        printf(\"%d\\n\", a[p][k - p]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6416", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 1; i <= col; i++) {\n    int k = 1;\n    while (k <= row && i - k + 1 >= 1) {\n      cout << *(*(a + k) + i - k + 1) << endl;\n      k++;\n    }\n  }\n  for (int i = 2; i <= row; i++) {\n    int k = 0;\n    while (i + k <= row && col - k >= 1) {\n      printf(\"%d\\n\", *(*(a + i + k) + col - k));\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6417", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100], row, col, i, j, *p = NULL;\n  cin >> row >> col;\n  memset(array, 0, sizeof(array));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++)\n    for (p = &array[0][i]; *p; p += 99)\n      printf(\"%d\\n\", *p);\n  for (i = 1; i < row; i++)\n    for (p = &array[i][col - 1]; *p; p += 99)\n      cout << *p << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6418", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void print(int *p[101], int row, int col);\n  int *p[101];\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)calloc(101, sizeof(int));\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", (p[i] + j));\n    }\n  }\n  print(p, row, col);\n\n  return 0;\n}\n\nvoid print(int *p[101], int row, int col) {\n  int k, i;\n  for (k = 0; k < (row + col - 1); k++) {\n    for (i = 0; (i < k + 1) && (i < row); i++) {\n      if ((k - i) < col)\n        printf(\"%d\\n\", *(p[i] + (k - i)));\n    }\n  }\n}\n"}
{"label": "4", "index": "6419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int a[100][100] = {0};\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row >= col) {\n    for (i = 0; i < row + col - 1; i++) {\n      if (i >= 0 && i < col) {\n        for (j = i; j >= 0; j--) {\n          printf(\"%d\\n\", a[i - j][j]);\n        }\n      }\n      if (i >= col && i < row) {\n        for (j = col - 1; j >= 0; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n      if (i > row - 1 && i < (row + col) - 1) {\n        for (j = col - 1; j > i - row; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n    }\n  }\n  if (col > row) {\n    for (j = 0; j < row + col; j++) {\n      if (j >= 0 && j < row) {\n        for (i = 0; i <= j; i++) {\n          printf(\"%d\\n\", a[i][j - i]);\n        }\n      }\n      if (j >= row && j < col) {\n        for (i = 0; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n      if (j > col - 1 && j < (row + col) - 1) {\n        for (i = j - col + 1; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << a[i][j] << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "6421", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  int(*p)[100] = a;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 0; i <= row + col - 2; i++) {\n    if (i < col - 1) {\n      for (j = 0; j <= row - 1 && j <= i; j++)\n        cout << *(*(p + j) + i - j) << endl;\n    } else\n      for (j = col - 1; i - j <= row - 1 && j >= 0; j--)\n        printf(\"%d\\n\", *(*(p + i - j) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, ji;\n  int su[100][100];\n  int h = 0, l = 0, sum, shibie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &su[i][j]);\n    }\n  }\n  ji = row * col;\n  while (ji != 0) {\n    for (sum = 0; sum < (row + col - 1); sum++) {\n      if (sum < col) {\n        l = sum;\n        h = 0;\n      } else {\n        h = sum - col + 1;\n        l = col - 1;\n      }\n      do {\n        cout << su[h][l] << \"\\n\";\n        ji--;\n        l--;\n        h++;\n      } while ((l >= 0) && (h < row));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n\n    for (i = m, j = 0; i >= 0 && j < a; i--, j++)\n      cout << n[j][i] << \"\\n\";\n  }\n\n  for (x = 1; x < a; x++) {\n\n    for (j = x, i = b - 1; j < a && i >= 0; j++, i--)\n      cout << n[j][i] << \"\\n\";\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "6424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, *p = NULL;\n  scanf(\"%d %d \", &n, &m);\n  int a[n][m];\n  for (p = *a; p < *(a) + n * m; p++)\n    scanf(\"%d \", p);\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = *a + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        printf(\"%d\\n\", *(p + (m - 1) * k));\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, *p[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    p[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", p[i] + j);\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i < m; i++) {\n      printf(\"%d\\n\", *(p[i] + k--));\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0; j--) {\n      printf(\"%d\\n\", *(p[k++] + j));\n      if (k == m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int n[1000][1000];\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int t = 0; t < b; t++) {\n    for (j = t, i = 0; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  for (int p = 1; p < a; p++) {\n    for (i = p, j = b - 1; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *a, *a0, *b, *p;\n  int row, col;\n  int r, c, t, i;\n  scanf(\"%d %d\", &row, &col);\n  a = (int *)calloc(100, 100 * sizeof(int));\n  a0 = a;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", a + r * col + c);\n    }\n  }\n  a = a0;\n  for (c = 0; c < row + col - 1; c++) {\n    r = 0;\n    t = c;\n    for (i = 0; i < row * col; i++) {\n      if (0 <= r && r < row && 0 <= t && t < col) {\n        cout << *(a + r * col + t);\n        if (r != row - 1 || t != col - 1)\n          cout << \"\\n\";\n      }\n      r++;\n      t--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6428", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ain[123][123];\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; ++i)\n    for (int j = 0; j < col; ++j)\n      cin >> ain[i][j];\n  int *p[123];\n  for (int i = 0; i < row; ++i)\n    p[i] = ain[i];\n  for (int i = 0; i < row + col - 1; ++i) {\n    for (int j = 0; j < row; ++j) {\n      if (j <= i && j > i - col)\n        printf(\"%d\\n\", *(p[j]++));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    temp_i = i;\n    for (j = col - 1; j >= 0 && temp_i < row; j--) {\n      printf(\"%d\\n\", a[temp_i][j]);\n      temp_i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6430", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int i = 0, j = 0, k = 0;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int(*p)[100] = a;\n  for (k = 0; k < col; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << endl;\n  for (k = col; k <= (row - 1) + (col - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++)\n      printf(\"%d\\n\", *(*(p + i) + k - i));\n  return 0;\n}\n"}
{"label": "4", "index": "6431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, l, i, k, g, s[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  for (g = 0; g <= (h + l - 2); g++) {\n    i = 0;\n    while (i < h) {\n      if (g - i >= l) {\n        i++;\n      } else {\n        break;\n      }\n    }\n\n    while (i < h && (g - i > -1) && (g - i < l)) {\n      printf(\"%d\\n\", s[i][g - i]);\n\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, f[100][100], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &f[i][j]);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++) {\n      cout << f[i][j - i];\n      printf(\"\\n\");\n    }\n  }\n  for (j = 1; j < row; j++) {\n    for (i = j; i < row && i <= j + col - 1; i++) {\n      cout << f[i][col - 1 + j - i];\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++) \n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (int k = 2; k <= row + col; k++) \n    for (int i = 1; i <= row; i++)\n      for (int j = 1; j <= col; j++)\n        if (i + j == k)\n          cout << *(*(a + i) + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[200][200], f[200][200], n, m, i, j, flag, si, sj;\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d\", &a[i][j]);\n  while (1) {\n    flag = 0;\n    for (i = 1; i <= m; i++)\n      if (f[1][i] == 0) {\n        flag = 1;\n        f[1][i] = 1;\n        break;\n      }\n    if (flag == 0)\n      for (i = 1; i <= n; i++)\n        if (f[i][m] == 0) {\n          flag = 2;\n          f[i][m] = 1;\n          break;\n        }\n    if (flag == 1) {\n      si = 1;\n      sj = i;\n    }\n    if (flag == 2) {\n      si = i;\n      sj = m;\n    }\n    if (flag == 0)\n      return 0;\n    for (; si <= n && sj >= 1; si++, sj--)\n      printf(\"%d\\n\", a[si][sj]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << a[j][i - j] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "6436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int iRow, iCol, i, j, k, iMax, iMin, p;\n  scanf(\"%d %d \", &iRow, &iCol);\n  if (iRow > iCol) {\n    iMin = iCol;\n    iMax = iRow;\n  } else {\n    iMin = iRow;\n    iMax = iCol;\n  }\n  int a[iMax][iMax];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i <= (iRow - 1); i++)\n    for (j = 0; j <= (iCol - 1); j++)\n      cin >> a[i][j];\n  p = 1;\n  for (k = 0; k <= (iMax * 2 - 2); k++) {\n    if (k > iMax - 1) {\n      for (i = p, j = iMax - 1; (i <= iMax - 1) && (j >= p); i++, j--) {\n        if (a[i][j] != 0) {\n          printf(\"%d\\n\", a[i][j]);\n        } else\n          continue;\n      }\n      p++;\n    } else {\n      for (i = 0, j = k; (i <= k) && (j >= 0); i++, j--) {\n        if (a[i][j] != 0)\n          printf(\"%d\\n\", a[i][j]);\n        else\n          continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[100][100], i, j, k, row, col, m, Col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &u[i][j]);\n    }\n  }\n  printf(\"%d\\n\", u[0][0]);\n  for (k = 1; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if (k > col - 1) {\n        break;\n      }\n      if (k - j > row - 1) {\n        break;\n      }\n\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n\n  for (k = col; k < col + row - 2; k++) {\n    for (j = col - 1; j >= 0; j--) {\n\n      if (k - j > row - 1) {\n        break;\n      }\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n  if (row == 1) {\n    ;\n  } else {\n    cout << u[row - 1][col - 1] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100];\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1; j >= 0 && i + col - 1 - j < row; j--) {\n      printf(\"%d\\n\", *(*(a + i + col - 1 - j) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &(a[i][j]));\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    if (i < col)\n      j = 0;\n    else\n      j = i - col + 1;\n    for (; j <= i && j < row; j++) {\n      cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col;\n  int sz[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    scanf(\"\\n%d\", &sz[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (i = 0; i < row; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row; i < col; i++) {\n      for (j = 0, k = i; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  if (col < row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      for (j = i, k = col - 1; k >= 0; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row - col + 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6441", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      cout << a[j][i - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, l;\n  cin >> n >> m;\n  int *p[100];\n  for (i = 0; i < n; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < m; i++) {\n    if (i - (n - 1) >= 0) {\n      for (l = 0; l < n; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    } else {\n      for (l = 0; l <= i; l++)\n        cout << *(*(p + l) + (i - l)) << \"\\n\";\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (n - i >= m) {\n      for (l = 0; l < m; l++)\n        printf(\"%d\\n\", *(*(p + (i + l)) + (m - (1 + l))));\n    } else {\n      for (l = 0; l < n - i; l++)\n        cout << *(*(p + (i + l)) + (m - (1 + l))) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int(*aa)[100] = a;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n\n    for (i = m, j = 0; i >= 0 && j < a; i--, j++)\n      printf(\"%d\\n\", n[j][i]);\n  }\n\n  for (x = 1; x < a; x++) {\n\n    for (j = x, i = b - 1; j < a && i >= 0; j++, i--)\n      printf(\"%d\\n\", n[j][i]);\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "6445", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        printf(\"%d\\n\", a[i][j]);\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        printf(\"%d\\n\", a[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 100;\n\nint main() {\n  int line, row;\n  int num[maxn][maxn];\n  scanf(\"%d %d \", &line, &row);\n\n  int nowline, nowrow;\n  int step;\n  int i, j;\n  for (i = 0; i != line; i++)\n    for (j = 0; j != row; j++)\n      cin >> num[i][j];\n  for (step = 0; step != line + row - 1; step++) {\n    nowline = (step >= row ? step - row + 1 : 0);\n    nowrow = (step >= row ? row - 1 : step);\n    while (nowline != line && nowrow != -1) {\n      cout << num[nowline][nowrow] << endl;\n      nowline++;\n      nowrow--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6447", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num[101][101];\nint main(void) {\n  int i = 0, j = 1, k = 1, x, y, row, col, n = 1;\n  scanf(\"%d%d\", &row, &col);\n  for (x = 0; x <= row - 1; x++)\n    for (y = 0; y <= col - 1; y++)\n      scanf(\"%d \", &num[x][y]);\n  printf(\"%d\\n\", num[0][0]);\n  while (n < row * col) {\n    int flag = 0;\n    while (j >= 0 && i <= row - 1 && j <= col - 1) {\n      printf(\"%d\\n\", num[i][j]);\n      i++;\n      j--;\n      n++;\n      flag = 1;\n    }\n    if (flag == 1)\n      k++;\n    if (k <= col - 1) {\n      i = 0;\n      j = k;\n    } else {\n      i = k - col + 1;\n      j = col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int sz[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i <= k && i < m; i++, j--) {\n      cout << sz[i][j] << \"\\n\";\n    }\n    j = k;\n  }\n\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0 && i < m; i++, j--) {\n      printf(\"%d\\n\", sz[i][j]);\n    }\n    i = k;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, c = 1;\n  int *p = a[0];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row * col; i++) {\n    cout << *p << endl;\n    if ((p - a[0]) % 100 == 0 || (p - a[0]) / 100 >= row - 1) {\n      c++;\n      if (c <= col)\n        p = a[0] + c - 1;\n      else\n        p = a[0] + (c - col) * 100 + col - 1;\n    } else\n      p = p + 99;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6450", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, dia, array[101][101], i, j;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (dia = 0; dia < row + col - 1; dia++)\n    for (i = 0; i <= dia; i++) {\n      if ((dia - i) < col && i < row)\n        cout << *(*(array + i) + (dia - i)) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row = 0, col = 0, array[100][100];\n  int i = 0, j = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    j = 0;\n    while (j <= i && j < row) {\n      cout << array[j][i - j] << \"\\n\";\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = 0;\n    while (j <= row - i - 1 && j < col) {\n      printf(\"%d\\n\", array[i + j][col - 1 - j]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int(*p)[100] = a;\n\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j < row; j++) {\n      if (i - j >= 0 && i - j < col)\n        cout << *(p[j] + i - j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++) {\n      cin >> a[i - 1][j - 1];\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    for (int l = 0; l <= row - 1; l++) {\n      if (k - l <= col - 1 && k >= l) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (k = 2; k <= row + col; k++) {\n    if (k <= col + 1) {\n      for (j = k - 1; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n    if (k > col + 1) {\n      for (j = col; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  scanf(\"%d\", &row);\n  return 0;\n}\n"}
{"label": "4", "index": "6455", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, a[1000][1000];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= col - 1; n++) {\n    for (j = n; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n  }\n  for (n = col; n <= row + col - 2; n++) {\n    for (j = col - 1; (j >= 0) && (n - j) <= (row - 1); j--) {\n      printf(\"%d\\n\", a[n - j][j]);\n    }\n    j = col - 1;\n  }\n}\n"}
{"label": "4", "index": "6457", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[110][110];\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++)\n      scanf(\"%d \", &map_1[i][j]);\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = i; j >= 0; j--) {\n      int k = i - j;\n      if (k >= 0 && k < n && j < m) {\n        cout << map_1[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6458", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int row, col;\n  int i, j, he;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (he = 0; he < row + col - 1; he++) {\n    for (j = he; j >= 0; j--) {\n      if (j >= col) {\n        continue;\n      }\n      i = he - j;\n      if (i >= row) {\n        continue;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100] = {0}, i = 0, j = 0;\n  int k = 0, l = 1;\n  cin >> row >> col;\n  for (i = 0; i < (row * col); i++)\n    cin >> array[i / col][i % col];\n  i = 0;\n  for (k = 0; k < col; k++) {\n    j = k;\n    for (i = 0; i < row; i++) {\n      if ((j != -1) && (i != row)) {\n        cout << array[i][j] << endl;\n        j--;\n      } else\n        break;\n    }\n    if (k == col - 1) {\n      i = 1;\n      for (l = 1; l < row; l++) {\n        j = col - 1;\n        for (i = l; (j != -1) && (i != row); i++) {\n          cout << array[i][j] << endl;\n          j--;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6460", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[150][150];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (int i = 0; i < row && i <= sum; i++)\n        printf(\"%d\\n\", *(*(a + i) + (sum - i)));\n\n    } else {\n      for (int i = sum - col + 1; sum - i >= 0 && i < row; i++) {\n        cout << *(*(a + i) + (sum - i)) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row == 1) {\n    for (j = 0; j < col; j++)\n      printf(\"%d\\n\", a[0][j]);\n\n  } else {\n    for (j = 0; j < col; j++) {\n      i = 0;\n      k = j;\n      while (k >= 0 && i < row) {\n        printf(\"%d\\n\", a[i][k]);\n        k--;\n        i++;\n      }\n    }\n    for (i = 1; i < row - 1; i++) {\n      j = col - 1;\n      k = i;\n      while (j >= 0 && k < row) {\n        printf(\"%d\\n\", a[k][j]);\n        j--;\n        k++;\n      }\n    }\n    printf(\"%d\\n\", a[row - 1][col - 1]);\n  }\n}\n"}
{"label": "4", "index": "6462", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int s = 0; s < row + col - 1; s++) {\n    for (int i = 0; i < row; i++) {\n      if (s - i >= 0 && s - i < col) {\n        printf(\"%d\\n\", *(*(a + i) + s - i));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6463", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int row, col;\n  int a[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    for (int i = 0; i <= sum; i++) {\n      if (i > row - 1)\n        break;\n      for (int j = 0; j <= sum; j++) {\n        if (j > col - 1)\n          break;\n        if (i + j == sum)\n          cout << a[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int(*p)[200];\n  p = (int(*)[200])malloc(200 * 200 * sizeof(int));\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++) {\n      *(*(p + i) + j) = -32767;\n    }\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (k = 0; k <= n + m - 2; k++)\n    for (i = 0; i <= k && i < n; i++) {\n      j = k - i;\n      if (*(*(p + i) + j) > -32767)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    }\n}\n"}
{"label": "4", "index": "6465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], r, c;\nint judge(int i, int c) {\n  if (i - c >= 0)\n    return i - c + 1;\n  else\n    return 0;\n}\nint main() {\n  scanf(\"%d %d \", &r, &c);\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int i = 0; i < r + c - 1; i++) {\n    for (int j = judge(i, c); j <= i && j < r && i - j < c; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, i, j;\n  int startrow = 0, startcol = 0;\n\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  while ((startcol + startrow) != (row + col - 2)) {\n    if (startcol < col - 1) {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startcol++;\n    } else {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        cout << sz[i][startcol + startrow - i] << \"\\n\";\n      }\n      startrow++;\n    }\n  }\n  printf(\"%d\", sz[row - 1][col - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6467", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100], j, k;\n\n  cin >> row;\n  cin >> col;\n  for (k = 0; k < row; k++)\n    for (j = 0; j < col; j++)\n      cin >> a[k][j];\n  for (k = 0; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if ((k - j >= 0) && (k - j) < row)\n        cout << *(a[k - j] + j) << endl;\n\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if ((k + col - 1 - j) < row)\n        cout << *(a[k + col - 1 - j] + j) << endl;\n\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, k, i, j;\n  int a[100][100] = {{0}, {0}};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k < row + col - 1;) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          cout << a[i][j] << \"\\n\";\n        }\n      }\n    }\n    k++;\n  }\n}\n"}
{"label": "4", "index": "6469", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row;\n  int col;\n  int a[100][100];\n  scanf(\"%d\", &row);\n  scanf(\"%d \", &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int t;\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t == 0) {\n      printf(\"\\n%d\", a[0][0]);\n    } else if (t > 0) {\n      if (t <= col - 1) {\n        for (i = t; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      } else {\n        for (i = col - 1; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6470", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (i = n - 1; i >= 0; i--) {\n      if (k - i >= 0 && k - i < m)\n        printf(\"%d\\n\", a[k - i][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6471", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, a[100][100], i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  i = 0;\n  j = 0;\n  for (;;) {\n\n    printf(\"%d\\n\", a[i][j]);\n    if (i + j == row + col - 2)\n      break;\n    if (j == 0) {\n      j = i + j + 1;\n      i = 0;\n    } else if (i >= row - 1) {\n      j = i + j + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (j > col - 1) {\n      i = i + j + 1 - col;\n      j = j - (j + 1 - col);\n    }\n    if (i + j == row + col - 2)\n      break;\n  }\n  if (row + col > 2)\n    printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6472", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, N;\n  int a[101][101];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  N = row + col - 2;\n  for (k = 0; k <= N; k++) {\n    i = 0;\n    j = k - i;\n    do {\n      if (i >= 0 && j >= 0 && i < row && j < col) {\n        printf(\"%d\\n\", a[i][j]);\n        i++;\n        j--;\n      } else {\n        i++;\n        j--;\n      }\n    } while (j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a[120][120];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= col; i++) {\n    k = i;\n    j = 1;\n    while (k >= 1 && j <= row) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n  }\n  for (j = 2; j <= row; j++) {\n    k = col;\n    i = j;\n    while (j <= row && k >= 1) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n    j = i;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, ji;\n  int su[100][100];\n  int h = 0, l = 0, sum, shibie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &su[i][j]);\n    }\n  }\n  ji = row * col;\n  while (ji != 0) {\n    for (sum = 0; sum < (row + col - 1); sum++) {\n      if (sum < col) {\n        l = sum;\n        h = 0;\n      } else {\n        h = sum - col + 1;\n        l = col - 1;\n      }\n      do {\n        cout << su[h][l] << \"\\n\";\n        ji--;\n        l--;\n        h++;\n      } while ((l >= 0) && (h < row));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0}, n = 0, m = 0, i = 0, j = 0;\nvoid bianli(int hang, int lie) {\n  if (lie == 0 || hang == n - 1)\n    printf(\"%d\\n\", a[hang][lie]);\n  else {\n    cout << a[hang][lie] << endl;\n    bianli(hang + 1, lie - 1);\n  }\n}\nint main() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < m; i++) {\n    bianli(0, i);\n  }\n  for (i = 1; i < n; i++) {\n    bianli(i, m - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < j + 1; i++) {\n      if (i < row) {\n        printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n  for (k = col; k < row + col - 1; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (k - j < row) {\n        cout << a[k - j][j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, a[400][400] = {0};\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (k = 0; k <= row + col - 1; k++) {\n    for (i = 0; i < 2 * k + 1; i++) {\n      if (a[i][k - i] != 0) {\n        cout << a[i][k - i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6478", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, *p, i, j, k;\n  p = (int *)malloc(11000 * sizeof(int));\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a * b; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 0; i < b; i++) {\n    k = i;\n    j = 0;\n    while (k >= 0 && j < a) {\n      printf(\"%d\\n\", *(p + k + j * b));\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    k = i;\n    j = 0;\n    while (k < a && j < b) {\n      printf(\"%d\\n\", *(p + b - 1 - j + k * b));\n      j++;\n      k++;\n    }\n  }\n}\n"}
{"label": "4", "index": "6479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int m = 1, n = 1;\n  int h, g;\n  int a[100][100];\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n  while (m <= row) {\n    h = m;\n    g = n;\n    while (h <= row && g >= 1) {\n      printf(\"%d\\n\", a[h][g]);\n      h++;\n      g--;\n    }\n    if (n < col)\n      n++;\n    else\n      m++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i = 0, j = 0, k = 0;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int(*p)[100] = a;\n  for (k = 0; k < col; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << endl;\n  for (k = col; k <= (row - 1) + (col - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++)\n      cout << *(*(p + i) + k - i) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, n, m, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (m = 0; m < row; m++) {\n      if ((k - m) < 0) {\n        break;\n      }\n      for (n = k - m;;) {\n        if ((k - m) > (col - 1)) {\n          break;\n        }\n        printf(\"%d\\n\", a[m][n]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a >= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint min(int a, int b) {\n  if (a <= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint main() {\n  int a[100][100];\n  int hang, lie;\n  int i, j, k;\n  cin >> hang >> lie;\n  for (i = 0; i <= hang - 1; i++) {\n    for (j = 0; j <= lie - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k <= hang + lie - 2; k++) {\n    for (i = max(0, k - lie + 1); i <= min(hang - 1, k); i++) {\n      cout << a[i][k - i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int(*a)[120], i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  a = (int(*)[120])malloc(200 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n    for (i = 0; (i <= k) && (i < n); i++) {\n      j = k - i;\n      if (j < m) {\n        cout << *(*(a + i) + j) << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, min;\n  cin >> m >> n;\n  int a[m][n];\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (j = 0; j <= n - 1; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = 0; i <= min; i++)\n      cout << a[i][j - i] << endl;\n  }\n  for (j = n; j <= m + n - 2; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = j - (n - 1); i <= min; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, (*p)[100], i, j, k;\n  scanf(\"%d%d\", &y, &x);\n  p = (int(*)[100])malloc(100 * y * sizeof(int));\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      scanf(\"%d\", *(p + i) + j);\n  i = 0;\n  j = 0;\n  for (k = 0; k < x * y; k++) {\n    cout << *(*(p + i) + j) << \"\\n\";\n    i++;\n    j--;\n    if (j < 0) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (i >= y) {\n      j = i + j + 1;\n      i = 0;\n    }\n    while (j >= x) {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int **a[100][100], i, j, col, row, k, xie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = (int **)malloc(10000);\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", a[i][j]);\n    }\n  }\n\n  xie = col + row - 1;\n  for (i = 0; i <= xie + 1; i++) {\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        if (j + k != i) {\n          continue;\n        } else\n          cout << *a[j][k] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, **p, num;\n  int i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  num = row * col;\n  p = (int **)malloc(row * sizeof(int));\n  for (i = 0; i < row; i++) {\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  for (i = 0; i < col + row - 1; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0 && k <= row) {\n      if (j < col && k < row) {\n        printf(\"%d\\n\", *(*(p + k) + j));\n      }\n      k = k + 1;\n      j = j - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, array[100][100], (*p)[100] = array, *q = *p;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int x = 0, j = 0;\n  while (q != array[row - 1] + col - 1) {\n    printf(\"%d\\n\", *q);\n    if (q == *p || *p == array[row - 1]) {\n      x++;\n      if (x >= col) {\n        p = array + x + 1 - col;\n        q = *p + col - 1;\n        j = col - 1;\n      } else {\n        p = array;\n        q = *p + x;\n        j = x;\n      }\n    } else {\n      p++;\n      q = *p + (--j);\n    }\n  }\n  printf(\"%d\", *q);\n  return 0;\n}\n"}
{"label": "4", "index": "6489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, *a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      a[i][j] = (int *)malloc(sizeof(int));\n      scanf(\"%d\", a[i][j]);\n    }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", *a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, temp_i = i; j >= 0 && temp_i < row; j--, temp_i++)\n      cout << *a[temp_i][j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, N;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  N = row + col - 2;\n  for (k = 0; k <= N; k++) {\n    i = 0;\n    j = k - i;\n    do {\n      if (i >= 0 && j >= 0 && i < row && j < col) {\n        printf(\"%d\\n\", a[i][j]);\n        i++;\n        j--;\n      } else {\n        i++;\n        j--;\n      }\n    } while (j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100] = {{0}};\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    int u = i;\n    int j = 1;\n    for (; u >= 1 && j <= m; u--, j++) {\n      printf(\"%d\\n\", a[j][u]);\n    }\n  }\n  for (i = 2; i <= m; i++) {\n    int u = i, j = n;\n    for (; u <= m && j >= 1; u++, j--) {\n      cout << a[u][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, i, j;\n  int array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (n = 0; n < row + col; n++) {\n    if (col < row) {\n      if (n < col) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < row) {\n        for (i = col - 1; i >= 0; i--)\n          printf(\"%d \", array[n - i][i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row < col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          cout << array[i][n - i] << \" \";\n      } else if (n < col) {\n        for (i = 0; i <= row - 1; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row == col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      }\n\n      else {\n        for (i = row - 1; i > n - col; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[200][200];\n  int i, j, row, col, sum;\n\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  if (col >= row) {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        cout << a[i][j] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[200][200], f[200][200], n, m, i, j, flag, si, sj;\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d\", &a[i][j]);\n  while (1) {\n    flag = 0;\n    for (i = 1; i <= m; i++)\n      if (f[1][i] == 0) {\n        flag = 1;\n        f[1][i] = 1;\n        break;\n      }\n    if (flag == 0)\n      for (i = 1; i <= n; i++)\n        if (f[i][m] == 0) {\n          flag = 2;\n          f[i][m] = 1;\n          break;\n        }\n    if (flag == 1) {\n      si = 1;\n      sj = i;\n    }\n    if (flag == 2) {\n      si = i;\n      sj = m;\n    }\n    if (flag == 0)\n      return 0;\n    for (; si <= n && sj >= 1; si++, sj--)\n      cout << a[si][sj] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[100][100] = {0}, point = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (j = 0; j < col; j++) {\n    point = j;\n    i = 0;\n    do {\n      cout << array[i++][point--] << endl;\n    } while (point >= 0 && i < row);\n  }\n  for (i = 1; i < row; i++) {\n    point = i;\n    j = col - 1;\n    do {\n      cout << array[point++][j--] << endl;\n    } while (point < row && j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, num[100][100];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++)\n      cin >> num[i][j];\n  }\n  for (int k = 0; k < n + m - 1; k++) {\n    if (k < m) {\n      for (int i = 0; k >= i && i < n; i++)\n        cout << num[i][k - i] << endl;\n    } else {\n      for (int i = k - m + 1; i < n && k >= i; i++)\n        cout << num[i][k - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, temp = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &array[i][j]);\n    }\n  }\n  while (temp < col) {\n    j = temp;\n    i = 0;\n    while (i < row && j >= 0) {\n      cout << array[i++][j--] << endl;\n    }\n    temp++;\n  }\n  if (row > 1) {\n    temp = 1;\n    while (temp < row) {\n      j = col - 1;\n      i = temp;\n      while (i < row && j >= 0) {\n        printf(\"%d\\n\", array[i++][j--]);\n      }\n      temp++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint x[1000][1000];\nvoid f(int i, int j) {\n  cout << x[i][j] << endl;\n  if (i == m && j == n)\n    return;\n  else if (j == 1 && i + 1 <= n)\n    f(1, i + 1);\n  else if (j == 1 && i + 1 > n)\n    f(i + j - n + 1, n);\n  else if (i == m && i + j <= n)\n    f(1, i + j);\n  else if (i == m && i + j > n)\n    f(i + j - n + 1, n);\n  else\n    f(i + 1, j - 1);\n}\nint main() {\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &x[i][j]);\n  f(1, 1);\n  return 0;\n}\n"}
{"label": "4", "index": "6499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j;\n  int c[100][100];\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  for (i = 0; i < b; i++) {\n    for (j = 0; j <= i && j < a; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n  for (i = b; i < a + b - 1; i++) {\n    for (j = i + 1 - b; j < a && j <= i; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100], ROW, COL;\n  int i, j, z, t;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (j = 0; j < ROW; j++) {\n    for (i = 0; i < COL; i++)\n      scanf(\"%d\", &sz[j][i]);\n  }\n  t = ROW + COL;\n  for (z = 0; z < t; z++) {\n    for (j = 0; j < ROW; j++) {\n      i = z - j;\n      if ((i >= 0) && (i < COL)) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int row, col, i, j, k;\n  for (i = 0; i < 1000; i++)\n    for (j = 0; j < 1000; j++)\n      a[i][j] = -12345;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < 1000; j++)\n    for (k = j, i = 0; k >= 0; k--, i++) {\n      if (a[i][k] != -12345)\n        printf(\"%d\\n\", a[i][k]);\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6502", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, s, t, d;\n  scanf(\"%d%d\", &s, &t);\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < t; j++) {\n      cin >> a[i][j];\n    }\n    printf(\"\\n\");\n  }\n  for (d = 0; d < s + t - 1; d++) {\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < t; j++) {\n        if (i + j == d) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6503", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  int *array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (k = 0; k <= row + col; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", *(*(array + i) + j));\n  return 0;\n}\n"}
{"label": "4", "index": "6504", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int row, col;\n\n  int i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++)\n    for (j = i; j >= 0 && i - j < row; j--)\n      cout << a[i - j][j] << endl; \n\n  for (i = 1; i < row; i++)\n    for (j = col - 1; (j >= 0) && (i + col - 1 - j < row); j--)\n      cout << a[i + col - 1 - j][j]\n           << endl; \n\n  return 0;\n}\n"}
{"label": "4", "index": "6505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, row, col, *q, i, k;\n  scanf(\"%d%d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (q = p; q < p + row * col; q++)\n    scanf(\"%d\", q);\n  for (k = 0; k < row + col - 1; k++) {\n    if (k < col) {\n      for (i = 0; i <= k && i < row; i++) {\n        printf(\"%d\\n\", *(p + i * col + k - i));\n      }\n    } else {\n      for (i = k - col + 1; i < row && i <= k; i++)\n        cout << *(p + i * col + k - i) << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "6506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      cout << a[j][i - j] << endl;\n}\n"}
{"label": "4", "index": "6507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int a, int b) {\n  if (a < b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int a[100][100];\n  int row, col, i, j, k, l;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < min(i + 1, row); j++) {\n      printf(\"%d \", a[j][i - j]);\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (l = 0; l < min(row - k, col); l++)\n      cout << a[k + l][col - 1 - l] << \" \";\n  }\n}\n"}
{"label": "4", "index": "6508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long t, m, r, l, i, x, j, a[1000][1000] = {0}, b[1000] = {0};\n  scanf(\"%ld%ld\", &r, &l);\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  }\n  i = i - 1;\n  j = j - 1;\n  for (t = 2; t <= i + j; t++) {\n    for (m = 0; m < b[t]; m++) {\n      cout << a[t][m] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d %d\", &a, &b);\n  int n[1000][1000];\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int t = 0; t < b; t++) {\n    for (j = t, i = 0; i < a && j >= 0; i++, j--)\n      cout << n[i][j] << \"\\n\";\n  }\n  for (int p = 1; p < a; p++) {\n    for (i = p, j = b - 1; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int *p = a[0];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(p + i * n + j);\n\n  for (int i = 0; i < m + n - 1; i++) {\n    int flag = 1;\n    int x = 0;\n    int y = i;\n    while (flag == 1) {\n      if (y < n && x >= 0)\n        cout << *(p + x * n + y) << endl;\n      x++;\n      y--;\n      if (y < 0 || x > m - 1)\n        flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, *p[100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p[i] + j);\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0, j = k - 1; i <= row - 1; i++, j--)\n      if (i <= row - 1 && j >= 0 && j <= col - 1 && i >= 0)\n        printf(\"%d\\n\", *(p[i] + j));\n  cout << *(p[row - 1] + col - 1) << \"\\n\";\n}\n"}
{"label": "4", "index": "6512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[104][104];\n  int h, l;\n  cin >> h >> l;\n  for (int i = 0; i < 104; i++)\n    for (int k = 0; k < 104; k++)\n      a[i][k] = -999;\n  for (int i = 1; i <= h; i++)\n    for (int k = 1; k <= l; k++)\n      scanf(\"%d \", &a[i][k]);\n  int printer = a[1][1];\n  for (int i = 1; i <= l; i++) {\n    int k = 0;\n    printer = a[1 + k][i - k];\n    while (printer != -999) {\n      printf(\"%d\\n\", printer);\n      ;\n      k++;\n      printer = a[1 + k][i - k];\n    }\n  }\n  for (int i = 2; i <= h; i++) {\n    int k = 0;\n    printer = a[i + k][l - k];\n    while (printer != -999) {\n      printf(\"%d\\n\", printer);\n      ;\n      k++;\n      printer = a[i + k][l - k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, *a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      a[i][j] = (int *)malloc(sizeof(int));\n      scanf(\"%d\", a[i][j]);\n    }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      cout << *a[i][j - i] << \"\\n\";\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, temp_i = i; j >= 0 && temp_i < row; j--, temp_i++)\n      cout << *a[temp_i][j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6514", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j;\n  cin >> n >> m;\n  int a[n][m];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d \", &a[i][j]);\n  int *p = NULL;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = &a[0][0] + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        printf(\"%d\\n\", *(p + (m - 1) * k));\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6515", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  for (i = 1; i < row; i++) {\n    for (j = i; j < col + i; j++) {\n      if (j < row)\n        printf(\"%d\\n\", a[j][col + i - j - 1]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6516", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, sum;\n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  sum = row + col;\n  for (k = 2; k <= sum; k++)\n    for (i = 1; i <= row; i++) {\n      for (j = col; j > 0; j--)\n        if (i + j == k) {\n          cout << array[i - 1][j - 1] << endl;\n          break;\n        }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j < m; j++) {\n      if (i - j >= 0 && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  scanf(\"%d%d\", &m, &n);\n  return 0;\n}\n"}
{"label": "4", "index": "6518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, row, col, rst = 0, cst = 0;\n  int R, C;\n  int a[100][100];\n  scanf(\"%d%d\", &R, &C);\n  for (row = 0; row < R; row++) {\n    for (col = 0; col < C; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n\n  for (i = 0; i < R + C - 1; i++) {\n    row = rst;\n    col = cst;\n    while (row != R && col != -1) {\n      cout << a[row][col] << \"\\n\";\n      row++;\n      col--;\n    }\n    if (cst != C - 1)\n      cst++;\n    else\n      rst++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long p, q, r, l, i, x, j;\n  long a[202][202] = {0}, b[202] = {0};\n  scanf(\"%ld %ld \", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i--;\n  j--;\n  for (p = 2; p <= i + j; p++) {\n    for (q = 0; q < b[p]; q++)\n      printf(\"%ld\\n\", a[p][q]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], *p;\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (p = *a; p < *a + m * n; p++)\n    cin >> *p;\n  p = *a;\n  for (int i = 0; i < n; i++) {\n    int a = 0, b = i;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n  for (int i = 1; i < m; i++) {\n    int a = i, b = n - 1;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6521", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, k = 0;\n  cin >> row >> col;\n  int i = 0, j = 0, s[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i <= col - 1; i++) {\n    j = 0;\n    k = i;\n    do {\n      printf(\"%d\\n\", s[j][k]);\n      j++;\n      k--;\n    } while ((j <= row - 1) && (k >= 0));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    j = col - 1;\n    k = i;\n    do {\n      printf(\"%d\\n\", s[k][j]);\n      k++;\n      j--;\n    } while ((k <= row - 1) && (j >= 0));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 1, h, l, i, j, a[100][100], lans = 0, ans[10000], k;\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (n = 1; n <= l; n++)\n    for (j = 0, k = n - 1; k >= 0 && j <= h - 1; j++, k--)\n      ans[lans++] = a[j][k];\n  for (n = 2; n <= h; n++)\n    for (j = n - 1, k = l - 1; j <= h - 1 && k >= 0; j++, k--)\n      ans[lans++] = a[j][k];\n  for (i = 0; i < lans; i++)\n    cout << ans[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "6523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p, row, col, *q, i, k;\n  scanf(\"%d%d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (q = p; q < p + row * col; q++)\n    scanf(\"%d\", q);\n  for (k = 0; k < row + col - 1; k++) {\n    if (k < col) {\n      for (i = 0; i <= k && i < row; i++) {\n        printf(\"%d\\n\", *(p + i * col + k - i));\n      }\n    } else {\n      for (i = k - col + 1; i < row && i <= k; i++)\n        printf(\"%d\\n\", *(p + i * col + k - i));\n    }\n  }\n}\n"}
{"label": "4", "index": "6524", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], *p;\n  int raw, col;\n  cin >> raw >> col;\n  for (p = a[0]; p < a[0] + raw * col; p++) {\n    cin >> *p;\n  }\n  if (col != 1) {\n    cout << a[0][0] << endl;\n    for (p = a[0] + 1; p < a[0] + col - 1; p++) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n\n    for (p = a[0] + col - 1; p < a[0] + col * raw; p += col) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n  }\n  if (col == 1) {\n    for (p = a[0]; p < a[0] + raw * col; p++)\n      cout << *p << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[m + 1][n + 1];\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n\n  int k;\n\n  for (k = 1; k <= n; k++)\n    for (i = k; (i >= 1) && (k + 1 - i <= m); i--)\n      cout << a[k + 1 - i][i] << endl;\n\n  for (k = 2; k <= m; k++)\n    for (i = n; (i >= 1) && (k + n - i <= m); i--)\n      cout << a[k + n - i][i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6526", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[100][100];\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> data[i][j];\n    }\n  }\n\n  for (int i = 0; i < col; i++) {\n    int m = 0, n = i;\n    while (true) {\n      printf(\"%d\\n\", data[m][n]);\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int m = i, n = col - 1;\n    while (true) {\n      printf(\"%d\\n\", data[m][n]);\n      m++;\n      n--;\n      if (m == row || n == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6527", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100], j, k;\n\n  cin >> row;\n  cin >> col;\n  for (k = 0; k < row; k++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[k][j]);\n  for (k = 0; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if ((k - j >= 0) && (k - j) < row)\n        cout << *(a[k - j] + j) << endl;\n\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if ((k + col - 1 - j) < row)\n        cout << *(a[k + col - 1 - j] + j) << endl;\n\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6528", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, s;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (s = 0; s <= row + col - 2; s++) {\n    for (i = 0; i < row; i++)\n      if (s - i < col && s - i >= 0) {\n        cout << *(*(a + i) + s - i) << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int matrix[120][120];\n  cin >> row >> col;\n  int *p[100];\n  for (int i = 0; i < row; i++) {\n    p[i] = &matrix[i][0];\n    for (int j = 0; j < col; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  if (col >= row) {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  } else {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        printf(\"%d\\n\", *(p[j] + i - j));\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row && j >= 0; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100], ROW, COL, i = 0, k = 0, j = 0;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6531", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  int i = 0, j = 0;\n  for (; i < row; i++) {\n    for (; j < col; j++) {\n      for (int m = i, n = j; m < row && n > -1; m++, n--)\n        printf(\"%d\\n\", a[m][n]);\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, *array, *p, i, j, t;\n  scanf(\"%d%d\", &row, &col);\n  array = (int *)calloc(row, col * sizeof(int));\n  for (p = array; p <= array + row * col - 1; p++)\n    scanf(\"%d\", p);\n  for (t = 0; t <= row + col - 2; t++)\n    for (i = 0; i <= t; i++) {\n      if (i > row - 1 || t - i > col - 1)\n        continue;\n      printf(\"%d\\n\", *(array + i * col + t - i));\n    }\n}\n"}
{"label": "4", "index": "6533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r, c, *p, n, m, i, j, k;\nint main() {\n  void x(int i);\n  void y(int i);\n  scanf(\"%d %d\", &r, &c);\n  n = r * c;\n  m = r + c - 2;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i < c; i++)\n    x(i);\n  for (i = c; i <= m; i++)\n    y(i);\n  return 0;\n}\nvoid x(int i) {\n  int a;\n  for (a = i; a >= 0 && (i - a) < r; a--) {\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n  }\n}\nvoid y(int i) {\n  int a;\n  for (a = c - 1; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\n"}
{"label": "4", "index": "6534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[105][105], row, col, (*p)[105];\n  p = array;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n\n  int i, j, m = 0;\n  while (1) {\n    if (m < col) {\n      for (i = 0, j = m; j >= 0 && i <= row - 1; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    } else {\n      for (i = m - col + 1, j = col - 1; i <= row - 1 && j >= 0; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    }\n    m++;\n    if (m == row + col)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j, k;\n\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row > col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0, k = j; k >= 0; i++, k--)\n        cout << a[i][k] << endl;\n    }\n    for (i = 1; i < row - col + 1; i++) {\n      for (j = col - 1, k = i; j >= 0; j--, k++)\n        cout << a[k][j] << endl;\n    }\n    for (; i < row; i++) {\n      for (j = col - 1, k = i; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0, k = j; k >= 0; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (; j < col; j++) {\n      for (i = 0, k = j; i < row; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (k = i, j = col - 1; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n  int a, b, i, j, k;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < a + b - 1; i++) {\n    if (i < b)\n      k = 0;\n    if (i >= b)\n      k = i - b + 1;\n    for (j = k; j <= i && j < a; j++) {\n      printf(\"%d\\n\", p[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int num[120][120];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n\n  for (int k = 0; k <= col + row - 1; k++) {\n    int minRow, minCol;\n    if (k < col)\n      minRow = 0;\n    else\n      minRow = k - col + 1;\n\n    if (k < row)\n      minCol = 0;\n    else\n      minCol = k - row + 1;\n\n    for (int i = minRow; i <= k; i++) {\n      if ((k - i) >= minCol)\n        cout << num[i][k - i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j;\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  int sum;\n  for (sum = 2; sum <= (col + row); sum++) {\n    if (sum <= col + 1) {\n      for (i = 1, j = sum - 1; i < sum && i <= row && j <= col; i++, j--) {\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n      }\n    } else {\n      for (i = sum - col, j = sum - i; i < sum && i <= row && j <= col;\n           i++, j--)\n        cout << a[i - 1][j - 1] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6539", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, b, y, k, t, a, x[500][500];\n  cin >> a >> b;\n  y = 0;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (t = 2; t <= a + b; t++) {\n\n    for (k = 1; k < t; k++) {\n      if (t - k <= b && k <= a) {\n        printf(\"%d\\n\", x[k][t - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100], ROW, COL;\n  int i, j, z, t;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (j = 0; j < ROW; j++) {\n    for (i = 0; i < COL; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  t = ROW + COL;\n  for (z = 0; z < t; z++) {\n    for (j = 0; j < ROW; j++) {\n      i = z - j;\n      if ((i >= 0) && (i < COL)) {\n        cout << sz[j][i] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int L, R, i, j, k;\n  cin >> R >> L;\n  const int l = L;\n  const int r = R;\n  int a[r][l];\n  for (i = 0; i < r; i++)\n    for (j = 0; j < l; j++)\n      cin >> a[i][j];\n  for (k = 0; k < l; k++) {\n    for (i = 0; (i < r) && ((k - i) >= 0); i++) {\n      cout << a[i][k - i] << endl;\n    }\n  }\n  for (k = l; k <= l + r - 2; k++) {\n    for (i = l - 1; (i >= 0) && ((k - i) < r); i--) {\n      cout << a[k - i][i] << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "6542", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < row - i && col - 1 - j >= 0; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, ROW, COL, array[100][100];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &array[row][col]);\n    }\n  }\n  if (ROW > 1 && COL > 1) {\n    for (col = 0; col < COL; col++) {\n      for (row = 0; row < ROW; row++) {\n        if (col - row < 0)\n          break;\n        else\n          cout << array[row][col - row] << \"\\n\";\n      }\n    }\n    for (row = 1; row < ROW - 1; row++) {\n      for (col = COL - 1; col >= 0; col--) {\n        if (row + COL - 1 - col > ROW - 1)\n          break;\n        else\n          printf(\"%d\\n\", array[row + COL - 1 - col][col]);\n      }\n    }\n  }\n  if (ROW == 1 && COL > 1) {\n    for (col = 0; col < COL - 1; col++) {\n      printf(\"%d\\n\", array[0][col]);\n    }\n  }\n  if (COL == 1 && ROW > 1) {\n    for (row = 0; row < ROW - 1; row++) {\n      printf(\"%d\\n\", array[row][0]);\n    }\n  }\n  printf(\"%d\", array[ROW - 1][COL - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, *p, *p0, i;\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)calloc(m * n, sizeof(int));\n  p0 = p;\n  for (p = p0; p < p0 + m * n; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m < n) {\n    for (p = p0; p < p0 + m; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + m; p < p0 + n - 1; p++) {\n      for (i = 0; i < m; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m - (p - p0) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  if (m == n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m + 1 - (p - p0 + 1) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  if (m > n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p <= p0 + (m - n + 1) * n - 1; p += n) {\n      for (i = 0; i < n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + (m - n + 2) * n - 1; p <= p0 + m * n - 1; p += n) {\n      for (i = 0; i < m - (p - p0 + 1) / n + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, s, i, j, a[100][100], p, q, r, t;\n  scanf(\"%d%d\", &m, &n);\n  s = m + n - 2;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (p = 0; p <= s; p++) {\n    if (m >= n) {\n      if (p <= (n - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (m - 1)) {\n          t = p - n + 1;\n          r = p;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    } else {\n      if (p <= (m - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (n - 1)) {\n          t = 0;\n          r = m - 1;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    }\n    for (q = t; q <= r; q++) {\n      cout << a[q][p - q] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6546", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, (*a)[100];\n  a = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      printf(\"%d\\n\", *(*(a + i) + k - i));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", *(*(a + k + i) + col - 1 - i));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[300][300];\n  int r, c, m, i, j, n, k, a;\n  cin >> r >> c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> sz[i][j];\n\n  for (i = 0; i <= r + c - 2; i++) {\n    for (j = 0;; j++) {\n      k = i - j;\n      if (k < 0)\n        break;\n      if (j < r && k < c)\n        cout << sz[j][k] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100], row, col, i, j, *p = NULL;\n  cin >> row >> col;\n  memset(array, 0, sizeof(array));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++)\n    for (p = &array[0][i]; *p; p += 99)\n      printf(\"%d\\n\", *p);\n  for (i = 1; i < row; i++)\n    for (p = &array[i][col - 1]; *p; p += 99)\n      printf(\"%d\\n\", *p);\n  return 0;\n}\n"}
{"label": "4", "index": "6549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(a[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << *(a[j] + i - j) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "6550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n\n  int row, col;\n  int i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(a[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << *(a[j] + i - j) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "6551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid bianli() {}\nint main() {\n  int i = 0, j = 0, row = 0, col = 0;\n  cin >> row >> col;\n  int a[row][col], *p = *a;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col; i++) {\n    p = *a + i;\n    j = i + 1;\n    while (j) {\n      printf(\"%d\\n\", *p);\n      p = p + col - 1;\n      if (j > row)\n        j = row - 1;\n      else\n        j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    p = *(a + i) + col - 1;\n    j = row - i;\n    while (j) {\n      printf(\"%d\\n\", *p);\n      p = p + col - 1;\n      if (j > col)\n        j = col - 1;\n      else\n        j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6552", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int col, row, sz[100][100];\n  scanf(\"%d %d \", &row, &col);\n  int l, m;\n  for (l = 0; l < row; l++) {\n    for (m = 0; m < col; m++)\n      cin >> sz[l][m];\n  }\n  int i, j, k;\n\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (k == i + j) {\n          printf(\"%d\\n\", sz[i][j]);\n        }\n        if (i + j > k)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  int s[120][120];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &s[i][j]);\n    }\n  }\n  int num;\n  for (num = 0; num < m + n - 1; num++) {\n    for (j = num; j > -1; j--) {\n      i = num - j;\n      if (i > -1 && i < n && j < m) {\n        cout << s[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  k = row + col;\n  for (a = 0; a < k - 1; a++) {\n    for (i = 0; i <= a; i++)\n      if (i < row && (a - i) < col)\n        printf(\"%d\\n\", array[i][a - i]);\n      else if (i >= row)\n        i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p[1000], n, m, i, j, t;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(1000);\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n\n  for (j = 0; j < m + n - 1; j++) {\n    if (j < m)\n      t = 0;\n    else\n      t = j - m + 1;\n    for (i = t; i < n && i <= j; i++)\n      printf(\"%d\\n\", *(*(p + i) + j - i));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, *p[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    p[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", p[i] + j);\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i < m; i++) {\n      printf(\"%d\\n\", *(p[i] + k--));\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0; j--) {\n      printf(\"%d\\n\", *(p[k++] + j));\n      if (k == m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n\n  for (i = 0; i < col + row - 1; i++)\n    for (j = i, k = 0; (j >= 0) && (k < row); j--, k++)\n      if (j < col)\n        cout << array[k][j] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "6558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, a[1000][1000], i, j, k;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; i < row && k >= 0; i++, k--)\n      cout << a[i][k] << \"\\n\";\n\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; k++, j--)\n      printf(\"%d\\n\", a[k][j]);\n}\n"}
{"label": "4", "index": "6559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, line, rownow, linenow, n, i, j, a[10000];\n  scanf(\"%d %d\", &row, &line);\n  for (j = 0; j <= row * line - 1; j++)\n    scanf(\"%d\", &a[j]);\n\n  for (i = 0; i <= row + line - 1; i++) {\n    rownow = 0;\n    linenow = i - rownow;\n    for (; rownow <= row - 1 && linenow >= 0; rownow++, linenow--) {\n      if (linenow >= line)\n        continue;\n      n = rownow * line + linenow;\n      printf(\"%d\\n\", a[n]);\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "4", "index": "6560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int(*p)[200];\n  p = (int(*)[200])malloc(200 * 200 * sizeof(int));\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++)\n      *(*(p + i) + j) = -32767;\n\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (k = 0; k <= n + m - 2; k++)\n    for (i = 0; i <= k && i < n; i++) {\n      j = k - i;\n      if (*(*(p + i) + j) > -32767)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int a[100][100] = {0};\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row >= col) {\n    for (i = 0; i < row + col - 1; i++) {\n      if (i >= 0 && i < col) {\n        for (j = i; j >= 0; j--) {\n          printf(\"%d\\n\", a[i - j][j]);\n        }\n      }\n      if (i >= col && i < row) {\n        for (j = col - 1; j >= 0; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n      if (i > row - 1 && i < (row + col) - 1) {\n        for (j = col - 1; j > i - row; j--)\n          printf(\"%d\\n\", a[i - j][j]);\n      }\n    }\n  }\n  if (col > row) {\n    for (j = 0; j < row + col; j++) {\n      if (j >= 0 && j < row) {\n        for (i = 0; i <= j; i++) {\n          printf(\"%d\\n\", a[i][j - i]);\n        }\n      }\n      if (j >= row && j < col) {\n        for (i = 0; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n      if (j > col - 1 && j < (row + col) - 1) {\n        for (i = j - col + 1; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, v[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &v[i][j]);\n    }\n  }\n\n  for (int j = 0; j <= col - 1; j++) {\n    int m = j;\n    for (int k = 0; k <= row - 1 && m >= 0; m-- && k++) {\n      printf(\"%d\\n\", v[k][m]);\n    }\n    k = 0;\n  }\n\n  for (int i = 1; i <= row - 1; i++) {\n    int n = i;\n    for (int j = col - 1; n <= row - 1 && j >= 0; n++ && j--) {\n      printf(\"%d\\n\", v[n][j]);\n    }\n  }\n\n  int z;\n  scanf(\"%d\", z);\n  return 0;\n}\n"}
{"label": "4", "index": "6563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int num[120][120];\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> num[i][j];\n  }\n\n  for (int k = 0; k <= col + row - 1; k++) {\n    int minRow, minCol;\n    if (k < col)\n      minRow = 0;\n    else\n      minRow = k - col + 1;\n\n    if (k < row)\n      minCol = 0;\n    else\n      minCol = k - row + 1;\n\n    for (int i = minRow; i <= k; i++) {\n      if ((k - i) >= minCol)\n        printf(\"%d\\n\", num[i][k - i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i != m; i++) {\n    for (int j = 0; j != n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i != n; i++) {\n    for (int j = 0;; j++) {\n      if (j == m || i - j < 0)\n        break;\n      cout << a[j][i - j] << endl;\n    }\n  }\n  for (int i = 1; i != m; i++) {\n    for (int j = 0;; j++) {\n      if (i + j == m || n - 1 - j < 0)\n        break;\n      cout << a[i + j][n - 1 - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (int i = 0; i < row + col - 1; i++) {\n    for (int j = 0; j < row; j++) {\n      for (int k = 0; k < col; k++) {\n        if (j + k == i)\n          cout << *(*(a + j) + k) << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6566", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100], i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        cout << array[j][i - j] << endl;\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (i = col - 1; i >= 0; i--) {\n      if (col - 1 + j - i < row) {\n        cout << array[col - 1 - i + j][i] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[1000][1000];\n  int i, j;\n  int m, n;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int time = 0;\n  for (j = 1; j <= col; j++) {\n    m = 1;\n    n = j;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    m = i;\n    n = col;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row <= col) {\n    for (m = 0; m < row; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = row; m < col; m++)\n      for (n = 0; n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < (col + row); m++)\n      for (n = (m - col + 1); n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n  } else {\n    for (m = 0; m < col; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < row; m++)\n      for (n = col - 1; n >= 0; n--)\n        printf(\"%d\\n\", a[m - n][n]);\n    for (m = row; m < (col + row); m++)\n      for (n = col - 1; n >= (m - row + 1); n--)\n        printf(\"%d\\n\", a[m - n][n]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, k = 0;\n  cin >> row >> col;\n  int i = 0, j = 0, s[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i <= col - 1; i++) {\n    j = 0;\n    k = i;\n    do {\n      cout << s[j][k] << endl;\n      j++;\n      k--;\n    } while ((j <= row - 1) && (k >= 0));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    j = col - 1;\n    k = i;\n    do {\n      printf(\"%d\\n\", s[k][j]);\n      k++;\n      j--;\n    } while ((k <= row - 1) && (j >= 0));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, t, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  row -= 1;\n  col -= 1;\n  t = row + col;\n  for (i = 0; i <= t; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row || (i - j) > col)\n        continue;\n      printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << *(*(p + i) + j) << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "6572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int count;\n  int i, j;\n\n  int array[100][100];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      cin >> array[i][j];\n\n  int x = 0, y = 0;\n\n  for (count = 1; count <= col; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    y = y + 1;\n  }\n\n  x = 1;\n  y = col - 1;\n  for (count = 2; count <= row; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    x = x + 1;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[99][99], i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  for (k = 0; k <= col - 1; k++) {\n    j = k;\n    i = 0;\n    do {\n      cout << array[i][j] << endl;\n      j = j - 1;\n      i = k - j;\n    } while (i != row && j != -1);\n  }\n  for (k = col; k <= col + row - 2; k++) {\n    j = col - 1;\n    i = k - j;\n    do {\n      printf(\"%d\\n\", array[i][j]);\n      j = j - 1;\n      i = i + 1;\n    } while (i != row && j != -1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[100][100] = {0}, point = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (j = 0; j < col; j++) {\n    point = j;\n    i = 0;\n    do {\n      cout << array[i++][point--] << endl;\n    } while (point >= 0 && i < row);\n  }\n  for (i = 1; i < row; i++) {\n    point = i;\n    j = col - 1;\n    do {\n      printf(\"%d\\n\", array[point++][j--]);\n    } while (point < row && j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int t, i, j, a, ROW, COL;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (t = 0; t < ROW + COL - 1; t++) {\n    if (ROW - 1 >= t) {\n      a = t;\n    } else {\n      a = ROW - 1;\n    }\n    i = 0;\n    while (i < a + 1) {\n      if (i < t - COL + 1) {\n        i = t - COL + 1;\n      }\n      j = t - i;\n      printf(\"%d\\n\", sz[i][j]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sz[100][100];\n\nint main() {\n\n  int n, m, i, j;\n\n  scanf(\"%d %d\", &n, &m);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  i = 0;\n  j = 0;\n  while (1) {\n    cout << sz[i][j] << \"\\n\";\n    if (i == (n - 1) && j == (m - 1)) {\n      break;\n    }\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (i >= n) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (j >= m) {\n      i = j + 1 - m;\n      j = m - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6577", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j - k == 0)\n          cout << a[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6578", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    if ((k <= col - 1) && (k <= row - 1)) {\n      for (int l = 0; l <= k; l++) {\n        printf(\"%d\\n\", sz[l][k - l]);\n      }\n    } else if ((k <= col - 1) && (k > row - 1)) {\n      for (int m = 0; m <= row - 1; m++) {\n        printf(\"%d\\n\", sz[m][k - m]);\n      }\n    } else if ((k > col - 1) && (k <= row - 1)) {\n      for (int t = k - col + 1; t <= k; t++) {\n        printf(\"%d\\n\", sz[t][k - t]);\n      }\n    } else if ((k > col - 1) && (k > row - 1)) {\n      for (int p = k - col + 1; p <= row - 1; p++) {\n        printf(\"%d\\n\", sz[p][k - p]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int m, n, row, col, sz[100][100], k;\n  cin >> row >> col;\n  for (m = 0; m < row; m++) {\n    for (n = 0; n < col; n++) {\n      cin >> sz[m][n];\n    }\n  }\n  for (k = 0; k < col; k++) {\n    m = 0;\n    n = k;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    m = k;\n    n = col - 1;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int a[100][100];\n  memset(a, '0', sizeof(a));\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  int(*p)[100] = a;\n  for (int i = 0; i < row + col - 1; i++) {\n    if (i < col) {\n      for (int j = 0; j <= row; j++) {\n        if (i - j < col && j < row && j >= 0 && i - j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    } else {\n      for (int j = 1; j < row; j++) {\n        if (i - j < col && j < row && i - j >= 0 && j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100];\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (k = 0; k < col; k++) {\n    cout << array[0][k] << endl;\n    for (i = 1, j = k - 1;; i++, j--) {\n      if (i < row && j >= 0)\n        printf(\"%d\\n\", array[i][j]);\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    cout << array[k][col - 1] << endl;\n    for (i = k + 1, j = col - 2;; i++, j--) {\n      if (i < row && j >= 0)\n        printf(\"%d\\n\", array[i][j]);\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  int n, m, i, j, shu[100][100], hang = 1, lie = 1, count, mark, zddjx, duijiao,\n                                 jh = 1, jl = 1;\n  cin >> n >> m;\n  count = n * m;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= m; j++) {\n      cin >> shu[i][j];\n    }\n  }\n  if (n == 1) {\n    for (j = 1; j <= m; j++) {\n      cout << shu[1][j] << endl;\n    }\n  }\n  if (n == 1) {\n    return 0;\n  }\n  if (m == 1) {\n    for (j = 1; j <= n; j++) {\n      cout << shu[j][1] << endl;\n    }\n    return 0;\n  }\n  if (m == 1) {\n    return 0;\n  }\n  cout << shu[hang][lie] << endl;\n  duijiao = hang + lie;\n  count--;\n  while (count != 0) \n  {\n    duijiao++; \n    hang = jh;\n    lie = duijiao - hang;\n    if (lie == m) \n    {\n      jh++;\n    }\n    while (lie >= jl) {\n      cout << shu[hang][lie] << endl; \n      count--;\n      hang++;\n      lie--;\n    }\n    if (hang == n + 1) {\n      jl++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int i, j;\n  int sum;\n  int a[100][100];\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (j = 0;;) {\n    if (j < col - 1) {\n      sum = j;\n      for (;;) {\n        if (sum >= 0 && j - sum < row) {\n          printf(\"%d\\n\", a[j - sum][sum]);\n          sum--;\n        } else {\n          break;\n        }\n      }\n      j++;\n    } else {\n      break;\n    }\n  }\n  for (i = 0;;) {\n    if (i <= row - 1) {\n      sum = col - 1 + i;\n      for (;;) {\n        if (sum >= 0 && col - 1 + i - sum < row) {\n          if (sum <= col - 1) {\n            cout << a[col - 1 + i - sum][sum] << \"\\n\";\n          }\n          sum--;\n        } else {\n          break;\n        }\n      }\n      i++;\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n = 0, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &(a[i][j]));\n  n = row + col - 1;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << a[i][j] << \"\\n\";\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i = 0, j = 0;\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  for (; i != (row - 1) || j != (col - 1);) {\n    cout << *(*(a + i) + j) << endl;\n    i++;\n    j--;\n    if (j < 0 || i > row - 1) {\n      if (i + j + 1 < col) {\n        j = i + j + 1;\n        i = 0;\n      } else {\n        i = i + j + 1 - (col - 1);\n        j = col - 1;\n      }\n    }\n  }\n  cout << *(*(a + row - 1) + col - 1);\n  return 0;\n}\n"}
{"label": "4", "index": "6586", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], *p;\n  int m, n;\n  cin >> m >> n;\n  for (p = *a; p < *a + m * n; p++)\n    cin >> *p;\n  p = *a;\n  for (int i = 0; i < n; i++) {\n    int a = 0, b = i;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n  for (int i = 1; i < m; i++) {\n    int a = i, b = n - 1;\n    while ((a < m) && (b >= 0)) {\n      cout << *(p + a * n + b) << endl;\n      a++;\n      b--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[99][99];\n  cin >> r >> c;\n  for (int i = 0; i < r; ++i)\n    for (int j = 0; j < c; ++j)\n      cin >> a[i][j];\n  for (int j = 0; j < c; ++j)\n    for (int x = j, y = 0; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n  for (int i = 1; i < r; ++i)\n    for (int y = i, x = c - 1; x >= 0 && y < r; --x, ++y)\n      cout << a[y][x] << endl;\n}\n"}
{"label": "4", "index": "6588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a, b;\n  int s[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (j = 0; j < a; j++) {\n    for (i = 0; i < b; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (j = 0; j < b; j++) {\n    k = j;\n    for (i = 0;; i++) {\n      if (i == a) {\n        break;\n      }\n      printf(\"%d\\n\", s[i][k]);\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  for (j = 1; j < a; j++) {\n    k = j;\n    for (i = b - 1; i >= 0; i--) {\n      printf(\"%d\\n\", s[k][i]);\n      k++;\n      if (k == a) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int i, j, k, row, col, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = row;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++) {\n        printf(\"%d\\n\", array[j][sum - j]);\n      }\n      sum++;\n    }\n  } else if (col > row) {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        cout << array[i][k - i] << \"\\n\";\n      }\n    }\n    sum = col - 1;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++) {\n        printf(\"%d\\n\", array[j][sum + k - j]);\n      }\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = col; k < row; k++) {\n      for (i = col - 1; i >= 0; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n    }\n    sum = 0;\n    for (k = row; k < row + col - 1; k++) {\n      for (i = col - 1; i > sum; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n      sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n}\n"}
{"label": "4", "index": "6591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    scanf(\"%d\", &a[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\" %d\", &a[i][j]);\n    }\n  }\n  for (sum = 0; sum < (row + col - 1); sum++) {\n    for (i = 0; i <= sum; i++) {\n      if (i < row && (sum - i) < col) {\n        cout << a[i][sum - i] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, b, c, d, e, f, g, y, h, k, m, n, t, a, x[500][500];\n  scanf(\"%d%d\", &a, &b);\n  y = 0;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (t = 2; t <= a + b; t++) {\n\n    for (k = 1; k < t; k++) {\n      if (t - k <= b && k <= a) {\n        printf(\"%d\\n\", x[k][t - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, num[110][110] = {0}, (*p)[110], i, j, a = 1,\n      b = col - 1, c, d;\n  p = num;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    a = 1;\n    c = i;\n    cout << *(*(p) + i) << endl;\n    while (i - 1 >= 0 && a < row) {\n      cout << *(*(p + a) + i - 1) << endl;\n      a++;\n      i--;\n    }\n    i = c;\n  }\n  for (j = 1; j < row; j++) {\n    b = col - 1;\n    d = j;\n    cout << *(*(p + j) + col - 1) << endl;\n    while (j + 1 < row && b - 1 >= 0) {\n      cout << *(*(p + j + 1) + b - 1) << endl;\n      j++;\n      b--;\n    }\n    j = d;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  int *p, *q;\n  q = (int *)calloc(10001, sizeof(int));\n  scanf(\"%d %d\", &n, &m);\n  for (p = q; p < q + n * m; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m == 1) {\n    for (p = q; p < q + n * m; p++)\n      printf(\"%d\\n\", *p);\n  } else {\n    for (i = 0; i < m; i++) {\n      for (p = q + i; (p <= q + i + (m - 1) * i) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n    for (i = 2; i <= n; i++) {\n      for (p = q + m * i - 1;\n           (p <= q + m * i - 1 + (m - 1) * (m - 1)) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int(*p)[100] = a;\n\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j < row; j++) {\n      if (i - j >= 0 && i - j < col)\n        printf(\"%d\\n\", *(p[j] + i - j));\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int row, col;\n  cin >> row >> col;\n  for (int i1 = 0; i1 < row; i1++) {\n    for (int j1 = 0; j1 < col; j1++)\n      cin >> *(*(a + i1) + j1);\n  }\n  if (row < col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1 && i - j >= 0)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 1; w--) {\n        if (k - w <= row - 1 && w <= col - 1) {\n          cout << *(*(a + k - w) + w) << endl;\n        }\n      }\n    }\n  } else if (row > col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << \"\\n\";\n      }\n    }\n\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  } else if (row = col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int t, i, j, a, ROW, COL;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (t = 0; t < ROW + COL - 1; t++) {\n    if (ROW - 1 >= t) {\n      a = t;\n    } else {\n      a = ROW - 1;\n    }\n    i = 0;\n    while (i < a + 1) {\n      if (i < t - COL + 1) {\n        i = t - COL + 1;\n      }\n      j = t - i;\n      printf(\"%d\\n\", sz[i][j]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int(*a)[120], i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  a = (int(*)[120])malloc(200 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n  for (k = 0; k <= n + m - 2; k++) {\n    for (i = 0; (i <= k) && (i < n); i++) {\n      j = k - i;\n      if (j < m)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6599", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < (m + n); i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i) {\n          cout << a[j][k] << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0, k = 0;\n  int str[100][100] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> str[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0; i++, j--) {\n      if (str[i][j] == 0)\n        break;\n      else\n        printf(\"%d\\n\", str[i][j]);\n    }\n  i = 0;\n  k = 0;\n  j = 0;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      cout << str[i][j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6601", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int m = 1, n = 1;\n  int h, g;\n  int a[100][100];\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> a[i][j];\n  while (m <= row) {\n    h = m;\n    g = n;\n    while (h <= row && g >= 1) {\n      printf(\"%d\\n\", a[h][g]);\n      h++;\n      g--;\n    }\n    if (n < col)\n      n++;\n    else\n      m++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint h, l, (*p)[100];\nvoid shuchu(int a) {\n  int r, c, i = 0;\n  r = 0;\n  c = a;\n  for (; r < h; i++) {\n    if (c >= 0 && c < l)\n      cout << *(*(p + r) + c) << \"\\n\";\n    r += 1;\n    c -= 1;\n  }\n}\n\nint main() {\n  int i, j;\n  cin >> h >> l;\n  p = (int(*)[100])malloc(h * 100 * sizeof(int));\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < h + l - 1; i++)\n    shuchu(i);\n}\n"}
{"label": "4", "index": "6603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, **p, num;\n  int i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  num = row * col;\n  p = (int **)malloc(row * sizeof(int));\n  for (i = 0; i < row; i++) {\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (i = 0; i < col + row - 1; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0 && k <= row) {\n      if (j < col && k < row) {\n        printf(\"%d\\n\", *(*(p + k) + j));\n      }\n      k = k + 1;\n      j = j - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6604", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int row, col, i, j, cnt = 1;\n  int a[201][201] = {0}, b[10001] = {0};\n  cin >> row >> col;\n  for (i = 1; i <= 200; i++) {\n    for (j = 1; j <= 200; j++)\n      a[i][j] = -1;\n  }\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  i = 1, j = 1;\n  while (cnt <= row * col) {\n    if (a[i][j] != -1)\n      b[cnt++] = a[i][j];\n    if (j == 1 || i == row) {\n      j = i + j;\n      i = 1;\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n  for (i = 1; i <= row * col; i++) {\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, s, t, d;\n  scanf(\"%d%d\", &s, &t);\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < t; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (d = 0; d < s + t - 1; d++) {\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < t; j++) {\n        if (i + j == d) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, k, l, max;\n  scanf(\"%d %d \", &row, &col);\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  int a[max][max];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < row; i++)\n    for (k = 0; k < col; k++)\n      cin >> a[i][k];\n  for (i = 0; i < max * 2 - 1; i++) {\n    if (i < max) {\n      for (k = 0, l = i - k; k < max && l >= 0; k++, l--)\n        if (a[k][l] != 0)\n          printf(\"%d\\n\", a[k][l]);\n    } else\n      for (k = max - 1, l = i - k; k > 0 && l < max; k--, l++)\n        if (a[l][k] != 0)\n          printf(\"%d\\n\", a[l][k]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6607", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  int a[110][110];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int j = 0; j < m + n - 1; j++)\n    for (int i = max(0, j - m + 1); i < min(n, j + 1); i++)\n      cout << a[i][j - i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, *p = NULL;\n  cin >> n >> m;\n  int a[n][m];\n  for (p = *a; p < *(a) + n * m; p++)\n    cin >> *p;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = *a + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        cout << *(p + (m - 1) * k) << \"\\n\";\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (int i = 1; i <= col; i++) {\n    int k = 1;\n    while (k <= row && i - k + 1 >= 1) {\n      cout << *(*(a + k) + i - k + 1) << endl;\n      k++;\n    }\n  }\n  for (int i = 2; i <= row; i++) {\n    int k = 0;\n    while (i + k <= row && col - k >= 1) {\n      cout << *(*(a + i + k) + col - k) << \"\\n\";\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6610", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int s[100][100];\n  int i, j;\n  int k = 0, l = 0;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= m - 1; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i <= m - 1; i++) {\n    k = 0;\n    l = i;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (l == 0 || k == n - 1) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    k = i;\n    l = m - 1;\n    for (j = 0;; j++) {\n      printf(\"%d\\n\", s[k][l]);\n      if (k == n - 1 || l == 0) {\n        break;\n      }\n      k = k + 1;\n      l = l - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6611", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j, k, l;\n\n  scanf(\"%d %d \", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (j = 0; j < col; j++) {\n    k = 0;\n    l = j;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    l = col - 1;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6612", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid bianli() {\n  int a[1000][1000], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      printf(\"%d \", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\nint main() { bianli(); }\n"}
{"label": "4", "index": "6613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int r, c, i, j, s;\n  scanf(\"%d%d\", &r, &c);\n  int x[100][100];\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  s = 0;\n  while (s <= r + c - 2) {\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < c; j++) {\n        if (i + j == s) {\n          cout << x[i][j] << \"\\n\";\n        }\n      }\n    }\n\n    s++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6614", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, t;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (t = 0; t < col; t++)\n    for (i = 0, j = t; i <= t && j >= 0 && i < row; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  for (t = 1; t <= row - 1; t++) {\n    for (i = t, j = col - 1; j >= 0 && i <= row - 1; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int col, row, sz[99][99], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i && j < row; j++)\n      printf(\"%d\\n\", sz[j][i - j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j + i < row && j < col; j++)\n      printf(\"%d\\n\", sz[i + j][col - j - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[110][110] = {0};\n  int m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    k = j;\n    for (i = 0; i <= m - 1; i++) {\n      cout << *(*(a + i) + k) << endl;\n      k--;\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    j = n - 1;\n    for (k = i; k <= m - 1; k++) {\n      cout << *(*(a + k) + j) << endl;\n      j--;\n      if (j < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c;\n  cin >> r >> c;\n  int a[r][c];\n  for (int i = 0; i < r; i++)\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (int k = 0; k < r + c - 1; k++) {\n    if (k < c) {\n      for (int i = 0; i < r && k - i >= 0; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    } else {\n      for (int i = c - 1; i >= 0 && k - i < r; i--)\n        printf(\"%d\\n\", *(*(a + k - i) + i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6618", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int a, b, row, col, i;\n  scanf(\"%d %d\", &a, &b);\n  for (row = 0; row < a; row++) {\n    for (col = 0; col < b; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (col = i; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  for (i = b; i < a + b; i++) {\n    for (col = b - 1; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, num[100][100];\n  cin >> m >> n;\n  cout << endl;\n  for (int u = 0; u < m; u++) {\n    for (int v = 0; v < n; v++) {\n      cin >> num[u][v];\n    }\n    cout << endl;\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i)\n          printf(\"%d\\n\", num[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n  int i, j, n, duijiaoxian;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  duijiaoxian = row + col - 2;\n  for (n = 0; n <= duijiaoxian; n++) {\n    for (i = 0; i <= n; i++) {\n      if (0 <= i && i < row && 0 <= (n - i) && (n - i) < col) {\n        printf(\"%d\\n\", a[i][n - i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], col, row;\nint main() {\n  int i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    };\n  };\n  if (col >= row) {\n    for (k = 0; k <= row - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= col - 1; k++) {\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n  if (row > col) {\n    for (k = 0; k <= col - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row - 1; k++) {\n      for (i = k - col + 1; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n}\n"}
{"label": "4", "index": "6622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, m, i, j;\n  int(*p)[1000], (*q)[1000];\n  scanf(\"%d%d\", &row, &col);\n  p = (int(*)[1000])malloc(row * 1000 * sizeof(int));\n  q = p;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(q + i) + j);\n    }\n  }\n  q = p;\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; m >= 0 && i < row; m--, i++) {\n      printf(\"%d \", *(*(q + i) + m));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; m < row && j >= 0; j--, m++)\n      printf(\"%d \", *(*(q + m) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int(*a)[160], i, j, k, m, n, t;\n  a = (int(*)[160])malloc(110 * sizeof(int));\n\n  scanf(\"%d %d\", &m, &n);\n\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", *(a + j) + i);\n\n  for (k = 0; k < n; k++) {\n\n    for (j = 0, i = k; i >= 0 && j < m; j++, i--)\n      if (i >= 0 && i < n && j >= 0 && j < m)\n        printf(\"%d\\n\", *(*(a + j) + i));\n  }\n  for (k = 1; k < m; k++)\n    for (j = k, i = 0; j < m && i <= n - 1; j++, i++)\n      cout << *(*(a + j) + n - i - 1) << \"\\n\";\n}\n"}
{"label": "4", "index": "6624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i = 1, j = 1;\n  int tempi = 1, tempj = 1, a[100][100] = {0};\n  cin >> m >> n;\n  for (int s = 1; s <= m; s++)\n    for (int t = 1; t <= n; t++) {\n      cin >> a[s][t];\n    }\n  while (tempi != m || tempj != n) {\n    do {\n      cout << a[i][j] << endl;\n      i++;\n      j--;\n    } while (j != 0 && i != m + 1);\n    if (tempj != n) {\n      tempj++;\n      i = tempi;\n      j = tempj;\n    } else {\n      tempi++;\n      i = tempi;\n      j = tempj;\n    }\n  }\n  cout << a[m][n];\n  return 0;\n}\n"}
{"label": "4", "index": "6625", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, n, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (n = 0; n < row + col - 1; n++)\n    for (i = 0; i <= n; i++) {\n      if (i < row && n - i < col)\n        cout << a[i][n - i] << endl;\n      else\n        continue;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long t, m, r, l, i, x, j, a[1000][1000] = {0}, b[1000] = {0};\n  cin >> r >> l;\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i = i - 1;\n  j = j - 1;\n  for (t = 2; t <= i + j; t++) {\n    for (m = 0; m < b[t]; m++) {\n      printf(\"%ld\\n\", a[t][m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6627", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100][100], row, col, i, j, s; \n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (s = 0; s < row + col - 1; s++) { \n    for (i = 0; i < row; i++) {\n      if (s - i < col) { \n        if (s >= i)\n          cout << a[i][s - i] << endl;\n        else\n          break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, i, j, k, m = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0, i = 0, j = 0;;) {\n    cout << a[j][i] << \"\\n\";\n    if (i == (l - 1) && j == (h - 1))\n      break;\n    if (i == 0 || j == (h - 1)) {\n      j = 0;\n      k++;\n      if (k < l) {\n        i = k;\n      } else {\n        i = l - 1;\n        m++;\n        j = m;\n      }\n    } else {\n      i -= 1;\n      j += 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num = 0, i, j, row, col, a[105][105], h;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (h = 0; h < col + row - 1; h++) {\n    if (h < col) {\n      for (i = 0; i < row && h - i >= 0 && h - i < col; i++) {\n        j = h - i;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    } else\n      for (j = col - 1; j >= 0 && h - j >= 0 && h - j < row; j--) {\n        i = h - j;\n        printf(\"%d\\n\", a[i][j]);\n      }\n  }\n}\n"}
{"label": "4", "index": "6630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, r, s, a[100][100];\n  s = 0;\n  scanf(\"%d %d\", &r, &c);\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  while (c * r >= s) {\n    for (int i = 0; i < r; i++) {\n      for (int j = 0; j < c; j++) {\n        if (i + j == s)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    s++;\n  }\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "4", "index": "6631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, r, c, num, ro, co;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  r = 1;\n  c = 1;\n  while (1) {\n    ro = r;\n    co = c;\n    while (1) {\n      printf(\"%d\\n\", a[ro][co]);\n      ro++;\n      co--;\n      if (ro > row || co <= 0) {\n        break;\n      }\n    }\n    if (c == col && r == row) {\n      break;\n    }\n    if (c < col)\n      c++;\n    else {\n      r++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[120][120];\n  int row, col, i, j, sum;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  while (i < row && j < col) {\n    cout << array[i][j] << \"\\n\";\n    sum = i + j;\n    i++;\n    j--;\n    if (i == row || j == -1) {\n      sum = sum + 1;\n      if (i = row) {\n        i = 0;\n        j = sum - i;\n        if (j >= col) {\n          j = col - 1;\n          i = sum - j;\n        }\n      } else {\n        j = col - 1;\n        i = sum - j;\n        if (i < 0) {\n          i = 0;\n          j = sum - i;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int n = 0; n < col; n++) {\n    for (int i = 0, j = n; j >= 0 && i < row; i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n    ;\n  }\n  for (int n = 1; n < row; n++) {\n    for (int i = n, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int c = 0; c < m; c++)\n    for (int d = 0; d < n; d++)\n      cin >> a[c][d];\n  int *p[m];\n  for (int j = 0; j < m; j++)\n    p[j] = a[j];\n  for (int k = 0; k <= m + n - 2; k++)\n    for (int c = 0; c < m; c++)\n      for (int d = 0; d < n; d++) {\n        if (c + d == k)\n          cout << *(p[c] + d) << endl;\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k[100][100];\n  int m = 0, x = 0, i, j, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    for (j = m;; j--) {\n      if (j >= col || m - j >= row) {\n        break;\n      }\n      if (j < 0 || m - j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  for (m = col; m < row + col - 1; m++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (m - j >= row) {\n        break;\n      }\n      cout << k[m - j][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) { return a > b ? a : b; }\nint min(int a, int b) { return a < b ? a : b; }\nint main() {\n  int i, j, t, col, row, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (t = 0; t <= col - 1; t++) {\n    j = t;\n    for (i = 0; i <= min(t, row - 1); i++) {\n      cout << a[i][j] << \" \";\n      j--;\n    }\n  }\n  for (t = 1; t <= row - 1; t++) {\n    i = t;\n    for (j = col - 1; j >= max(col - row + t, 0); j--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n    }\n  }\n}\n"}
{"label": "4", "index": "6638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, col, row, array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  int cxx = 0, csx, rxx = 0, rsx;\n  for (i = 0; i < col; i++) {\n    csx = i;\n    rxx = 0;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    rxx = j;\n    csx = col - 1;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      cout << array[rxx][csx] << \"\\n\";\n      csx--;\n      rxx++;\n    }\n  }\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "4", "index": "6639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p;\n  int row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (i = 0; i < row * col; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 1; i <= col; i++) {\n    j = i;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n  for (i = 2; i <= row; i++) {\n    j = i * col;\n    while ((col != 1) && (j % col != 1) && (j + col - 1 < row * col)) {\n      printf(\"%d\\n\", *(p + j - 1));\n      j = j + col - 1;\n    }\n    printf(\"%d\\n\", *(p + j - 1));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6640", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], b[10000], i, j, sum, t = 0;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++) {\n      cin >> a[i][j];\n    }\n  for (sum = 2; sum <= (n + m); sum++) {\n\n    for (j = 1; j <= n; j++)\n\n    {\n      if ((sum - j) > 0 && (sum - j) <= m) {\n        t++;\n        b[t] = a[j][sum - j];\n      }\n    }\n  }\n\n  for (i = 1; i <= (m * n); i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "4", "index": "6641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100] = {{0}};\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    int u = i;\n    int j = 1;\n    for (; u >= 1 && j <= m; u--, j++) {\n      cout << a[j][u] << endl;\n    }\n  }\n  for (i = 2; i <= m; i++) {\n    int u = i, j = n;\n    for (; u <= m && j >= 1; u++, j--) {\n      cout << a[u][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, k, n, j;\n  int ROW, COL, row, col;\n  scanf(\"%d %d\", &ROW, &COL);\n  if (ROW > COL) {\n    j = COL - 1;\n  } else {\n    j = ROW - 1;\n  }\n  for (i = 0; i < ROW; i++) {\n    for (k = 0; k < COL; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n    }\n  }\n  for (n = 0; n <= j; n++) {\n    for (row = 0; row <= n; row++) {\n      printf(\"%d\\n\", sz[row][n - row]);\n    }\n  }\n  if (COL > ROW) {\n    for (n = j + 1; n < COL; n++) {\n      for (row = 0; row < ROW; row++) {\n        printf(\"%d\\n\", sz[row][n - row]);\n      }\n    }\n    for (n = COL; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW > COL) {\n    for (n = j + 1; n < ROW; n++) {\n      for (col = COL - 1; col >= 0; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n    for (n = ROW; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW == COL) {\n    for (n = j + 1; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int a, int b) {\n  if (a < b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int a[100][100];\n  int row, col, i, j, k, l;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < min(i + 1, row); j++)\n      printf(\"%d \", a[j][i - j]);\n  }\n  for (k = 1; k < row; k++) {\n    for (l = 0; l < min(row - k, col); l++)\n      cout << a[k + l][col - 1 - l] << \" \";\n  }\n}\n"}
{"label": "4", "index": "6644", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0}, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      printf(\"%d\\n\", a[0 + i][k - i]);\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", a[k + i][col - 1 - i]);\n  }\n}\n"}
{"label": "4", "index": "6645", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  int(*p)[100] = a;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 0; i <= row + col - 2; i++) {\n    if (i < col - 1)\n      for (j = 0; j <= row - 1 && j <= i; j++)\n        cout << *(*(p + j) + i - j) << endl;\n    else\n      for (j = col - 1; i - j <= row - 1 && j >= 0; j--)\n        printf(\"%d\\n\", *(*(p + i - j) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  if ((i == 1) && (j == 1))\n    printf(\"%d\\n\", array[0][0]);\n  else {\n    for (j = 0; j < col; j++) {\n      k = j;\n      for (i = 0; i < row; i++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[i][k]);\n        k--;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      k = col - 1;\n      for (j = i; j < row; j++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[j][k]);\n        k--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int(*a)[120], i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  a = (int(*)[120])malloc(200 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n    for (i = 0; (i <= k) && (i < n); i++) {\n      j = k - i;\n      if (j < m)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "6648", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[row][col];\n  int j, i, k;\n  int *p = NULL;\n  for (j = 0; j < row; j++) {\n    p = array[j];\n    for (i = 0; i < col; i++)\n      cin >> *(p + i);\n  }\n  p = array[0];\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          cout << *(p + i * col + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int *p = a[0];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(p + i * n + j);\n\n  for (int i = 0; i < m + n - 1; i++) {\n    int flag = 1;\n    int x = 0;\n    int y = i;\n    while (flag == 1) {\n      if (y < n && x >= 0)\n        cout << *(p + x * n + y) << endl;\n      x++;\n      y--;\n      if (y < 0 || x > m - 1)\n        flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < (2 * col - 1); b++) {\n      for (int i = (b - col + 1); i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n  }\n  if (row > col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < row; b++) {\n      for (int j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[b - j][j]);\n      }\n    }\n    for (int c = row; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  if (row < col) {\n    for (int a = 0; a < row; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = row; b < col; b++) {\n      for (int i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n    for (int c = col; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint row, col;            \nint array_1[101][101];   \nint (*p)[101] = array_1; \nint f(int m, int n) {\n  int i;\n  if (m == row - 1 && n == col - 1) \n  {\n    cout << *(*(p + m) + n);\n    return 0;\n  }\n  for (i = 0; m + i <= row - 1 && n - i >= 0; i++) \n    cout << *(*(p + m + i) + n - i) << endl;\n  if (n < col - 1) \n    return f(0, n + 1);\n  if (n >= col - 1) \n    return f(m + 1, col - 1);\n}\n\nint main() {\n  int i, j; \n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) \n      cin >> array_1[i][j];\n  f(0, 0); \n  return 0;\n}\n"}
{"label": "4", "index": "6652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if ((i == 1) && (j == 1))\n    cout << array[0][0] << \"\\n\";\n  else {\n    for (j = 0; j < col; j++) {\n      k = j;\n      for (i = 0; i < row; i++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[i][k]);\n        k--;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      k = col - 1;\n      for (j = i; j < row; j++) {\n        if (k < 0)\n          break;\n        printf(\"%d\\n\", array[j][k]);\n        k--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000][1000];\nint main() {\n  int r, c, i, j, n;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= c + r - 2; n++) {\n    for (i = 0; i <= n && i < r; i++) {\n      j = n - i;\n      if (j < c)\n        cout << a[i][j] << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], r, c, r1, c1;\n  int i, l, j, k, m, n;\n  cin >> r >> c;\n  for (m = 0; m <= 100; m++) {\n    for (n = 0; n <= 100; n++) {\n      a[m][n] = -1;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 1; k <= c; k++) {\n    c1 = k;\n    r1 = 1;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  for (l = 2; l <= r; l++) {\n    c1 = c;\n    r1 = l;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, *p;\n  cin >> row >> col;\n  p = (int *)malloc(sizeof(int) * row * col);\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n  cout << *p << \"\\n\";\n  p++;\n  for (i = 1; i < col; i++, p++)\n    for (j = 0, k = 0; k <= i && (i + j) < (row * col); k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n  p += col - 1;\n  for (i = 1; i <= (row - 1); i++, p += col)\n    for (j = 0, k = 0; k < (row - i) && k < col && *(p + j) != 0;\n         k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n}\n"}
{"label": "4", "index": "6656", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int q, m, n, a[100][100] = {0}, i, j;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= m + n - 2; i++) {\n    for (j = 0; i - j >= 0; j++) {\n      if (j < m && i - j < n)\n        cout << a[j][i - j] << endl;\n    }\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "4", "index": "6657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[1000][1000], a[1000];\n  int row, col;\n  int i, j;\n\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n\n  for (i = 0; i < col + row; i++) {\n    if (i < col)\n      a[i] = 0;\n    else\n      a[i] = i - col + 1;\n  }\n\n  for (i = 0; i < col + row; i++)\n    for (j = a[i]; j < row && j <= i; j++)\n      printf(\"%d\\n\", array[j][i - j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid prt(int a[100][100], int i, int j, int m, int n) {\n  static int t = 0;\n  printf(\"%d\\n\", a[i][j]);\n  if (i == m - 1 || j == 0) {\n    t++;\n    if (t < n)\n      prt(a, 0, t, m, n);\n    else if (t < m + n - 1)\n      prt(a, t - n + 1, n - 1, m, n);\n  } else\n    prt(a, i + 1, j - 1, m, n);\n}\nint main() {\n  int i, j, m, n, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  prt(a, 0, 0, m, n);\n}\n"}
{"label": "4", "index": "6659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a = 0;\n  int(*p)[10000];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[10000])calloc(10000, 10000);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (a < n + m - 1) {\n    while (i != m && j != -1) {\n      printf(\"%d\\n\", *(*(p + i) + j));\n      i++;\n      j--;\n    }\n    a++;\n    if (a > n - 1) {\n      j = n - 1;\n      i = a - (n - 1);\n    } else if (a <= n - 1) {\n      j = a;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, c = 1;\n  int *p = a[0];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row * col; i++) {\n    cout << *p << \"\\n\";\n    if ((p - a[0]) % 100 == 0 || (p - a[0]) / 100 >= row - 1) {\n      c++;\n      if (c <= col)\n        p = a[0] + c - 1;\n      else\n        p = a[0] + (c - col) * 100 + col - 1;\n    } else\n      p = p + 99;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, k;\n  int c[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  if (b > a) {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < b - a; k++) {\n      i = 0;\n      j = a + k;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else if (b < a) {\n    for (k = 0; k < b; k++) {\n      i = 0;\n      j = k;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - b; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (j >= 0) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n    for (k = 0; k < b - 1; k++) {\n      i = a - b + 1 + k;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  } else {\n    for (k = 0; k < a; k++) {\n      i = 0;\n      j = k;\n      while (i <= k) {\n        printf(\"%d\\n\", c[i][j]);\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    for (k = 0; k < a - 1; k++) {\n      i = k + 1;\n      j = b - 1;\n      while (i <= a - 1) {\n        printf(\"%d\\n\", c[i][j]);\n        i++;\n        j--;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z[100][100];\n  int m, n, a, b, c;\n  scanf(\"%d%d\", &m, &n);\n  for (a = 0; a <= m - 1; a++) {\n    for (b = 0; b <= n - 1; b++)\n      cin >> z[a][b];\n  }\n  a = 0;\n  b = 0;\n  for (c = 0; c <= m * n - 1; c++) {\n    printf(\"%d\\n\", z[a][b]);\n    a++;\n    b--;\n    if ((a > m - 1) || (b < 0)) {\n      while ((a > 0) && (b < n - 1)) {\n        a--;\n        b++;\n      }\n      if ((a == 0) && (b < n - 1))\n        b++;\n      else\n        a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6663", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100] = {0};\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int m = 0; m < row + col - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if (i + j == m) {\n          printf(\"%d\\n\", *(*(a + i) + j));\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "6664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, sum, m, s;\n  int A[100][100];\n  scanf(\"%d%d\", &row, &col);\n  sum = row + col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &A[i][j]);\n  }\n\n  for (m = 2; m <= sum; m++) {\n    for (i = 1; i <= row; i++) {\n      s = m - i;\n      if (s > col)\n        continue;\n      cout << A[i][s] << \"\\n\";\n      if ((m - i) == 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, **p, col, row, sum;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", *(p + i) + j);\n    }\n  k = row + col;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < row && j < col)\n        printf(\"\\n%d\", *(*(p + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "6666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    scanf(\"%d\", &a[i][0]);\n    for (j = 1; j < col; j++)\n      scanf(\" %d\", &a[i][j]);\n  }\n  for (sum = 0; sum < (row + col - 1); sum++) {\n    for (i = 0; i <= sum; i++) {\n      if (i < row && (sum - i) < col)\n        printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint array_1[100][100];\nint main() {\n  int row, col, i, j, m;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array_1[i][j]);\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    if (m < col) {\n      for (i = 0; i <= m && i < row; i++)\n        printf(\"%d\\n\", array_1[i][m - i]);\n    } else {\n      for (j = col - 1; j > m - row && j >= 0; j--)\n        cout << array_1[m - j][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint h, l, (*p)[100];\nvoid shuchu(int a) {\n  int r, c, i = 0;\n  r = 0;\n  c = a;\n  for (; r < h; i++) {\n    if (c >= 0 && c < l)\n      printf(\"%d\\n\", *(*(p + r) + c));\n    r += 1;\n    c -= 1;\n  }\n}\n\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &h, &l);\n  p = (int(*)[100])malloc(h * 100 * sizeof(int));\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < h + l - 1; i++)\n    shuchu(i);\n  return 0;\n}\n"}
{"label": "4", "index": "6669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, i, j, k;\n  int(*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", *(a + i) + j);\n\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, i, j;\n  int a[100][100];\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  for (i = 0; i < r + c - 1; i++) {\n    if (i < c && c <= r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c <= r && i < r)\n      for (j = i - c + 1; j <= i; j++)\n        cout << a[j][i - j] << \"\\n\";\n    else if (i >= r && c <= r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i < r && c > r)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= r && c > r && i < c)\n      for (j = 0; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    else if (i >= c && c > r)\n      for (j = i - c + 1; j < r; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int L, R, i, j, k;\n  cin >> R >> L;\n  const int l = L;\n  const int r = R;\n  int a[r][l];\n  for (i = 0; i < r; i++)\n    for (j = 0; j < l; j++)\n      cin >> a[i][j];\n  for (k = 0; k < l; k++) {\n    for (i = 0; (i < r) && ((k - i) >= 0); i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n  }\n  for (k = l; k <= l + r - 2; k++) {\n    for (i = l - 1; (i >= 0) && ((k - i) < r); i--) {\n      cout << a[k - i][i] << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "6672", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j, k, l;\n\n  scanf(\"%d%d\", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (j = 0; j < col; j++) {\n    k = 0;\n    l = j;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    k = i;\n    l = col - 1;\n    while (k < row && l >= 0) {\n      printf(\"%d\\n\", a[k][l]);\n      k++;\n      l--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int a[100][100] = {0};\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row >= col) {\n    for (i = 0; i < row + col - 1; i++) {\n      if (i >= 0 && i < col) {\n        for (j = i; j >= 0; j--) {\n          printf(\"%d\\n\", a[i - j][j]);\n        }\n      }\n      if (i >= col && i < row) {\n        for (j = col - 1; j >= 0; j--)\n          cout << a[i - j][j] << \"\\n\";\n      }\n      if (i > row - 1 && i < (row + col) - 1) {\n        for (j = col - 1; j > i - row; j--) {\n          printf(\"%d\\n\", a[i - j][j]);\n        }\n      }\n    }\n  }\n  if (col > row) {\n    for (j = 0; j < row + col; j++) {\n      if (j >= 0 && j < row) {\n        for (i = 0; i <= j; i++) {\n          printf(\"%d\\n\", a[i][j - i]);\n        }\n      }\n      if (j >= row && j < col) {\n        for (i = 0; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n      if (j > col - 1 && j < (row + col) - 1) {\n        for (i = j - col + 1; i < row; i++)\n          printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int row, col;\n  cin >> row >> col;\n  for (int i1 = 0; i1 < row; i1++) {\n    for (int j1 = 0; j1 < col; j1++)\n      cin >> *(*(a + i1) + j1);\n  }\n  if (row < col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1 && i - j >= 0)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 1; w--) {\n        if (k - w <= row - 1 && w <= col - 1)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  } else if (row > col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  } else {\n    if (row = col) {\n      for (int i = 0; i < col; i++) {\n        for (int j = i; j >= 0; j--) {\n          if (i - j <= row - 1)\n            cout << *(*(a + (i - j)) + j) << endl;\n        }\n      }\n      for (int k = col; k <= col + row - 2; k++) {\n        for (int w = col - 1; w >= 0; w--) {\n          if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n            cout << *(*(a + k - w) + w) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, row = 0, col = 0, i = 0, j = 0, min = 0, rowbegin = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  min = row < col ? row : col;\n  while (k <= col + row - 1) {\n    i = 0;\n    if (k > col - 1)\n      rowbegin++;\n\n    for (i = rowbegin; i <= k && i < row; i++) {\n      cout << a[i][k - i] << endl;\n    }\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6676", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int a[100][100];\n  memset(a, '0', sizeof(a));\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int(*p)[100] = a;\n  for (int i = 0; i < row + col - 1; i++) {\n    if (i < col) {\n      for (int j = 0; j <= row; j++) {\n        if (i - j < col && j < row && j >= 0 && i - j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    } else {\n      for (int j = 1; j < row; j++) {\n        if (i - j < col && j < row && i - j >= 0 && j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, a[100][100], i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  i = 0;\n  j = 0;\n\n  for (;;) {\n\n    printf(\"%d\\n\", a[i][j]);\n    if (i + j == row + col - 2)\n      break;\n    if (j == 0) {\n      j = i + j + 1;\n      i = 0;\n    } else if (i >= row - 1) {\n      j = i + j + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (j > col - 1) {\n      i = i + j + 1 - col;\n      j = j - (j + 1 - col);\n    }\n    if (i + j == row + col - 2)\n      break;\n  }\n  if (row + col > 2)\n    printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "6678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int i = 0; i < col; i++) {\n    cout << *(*(a) + i) << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    cout << *(*(a + i) + col - 1) << endl;\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6679", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    int k = 0;\n    j = i;\n    cout << *(*(array + k) + j) << endl;\n    while (k + 1 < row && j - 1 >= 0) {\n      k++;\n      j--;\n      cout << *(*(array + k) + j) << endl;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int k = col - 1;\n    j = i;\n    cout << *(*(array + j) + k) << endl;\n    while (j + 1 < row && k - 1 >= 0) {\n      j++;\n      k--;\n      printf(\"%d\\n\", *(*(array + j) + k));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, row, col, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0, k = 2; j < col; i++, j--) {\n    printf(\"%d\\n\", a[i][j]);\n    if (j == 0 || i == row - 1) {\n      j = k;\n      k = k + 1;\n      i = -1;\n    }\n  }\n  for (i = 1, j = col - 1, k = 1; i < row; i++, j--) {\n    printf(\"%d\\n\", a[i][j]);\n\n    if (i == row - 1 || j == 0) {\n      i = k;\n      k++;\n      j = col;\n    }\n  }\n}\n"}
{"label": "4", "index": "6681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], row, col, i;\n  cin >> n >> m;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < m; col++) {\n      cin >> a[row][col];\n    }\n  }\n  if (n < m) {\n    for (i = 0; i < n; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = n; i < m; i++) {\n      for (row = 0; row < n; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  if (n >= m) {\n    for (i = 0; i < m; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n; i++) {\n      for (col = m - 1; col >= 0; col--) {\n        printf(\"%d\\n\", a[i - col][col]);\n      }\n    }\n    for (i = n; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, i, j, k, m = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (k = 0, i = 0, j = 0;;) {\n    cout << a[j][i] << \"\\n\";\n    if (i == (l - 1) && j == (h - 1))\n      break;\n    if (i == 0 || j == (h - 1)) {\n      j = 0;\n      k++;\n      if (k < l)\n        i = k;\n      else {\n        i = l - 1;\n        m++;\n        j = m;\n      }\n    } else {\n      i -= 1;\n      j += 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint row, col;\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 2; i <= row + col; i++)\n    for (int j = max(1, i - col); j <= min(row, i - 1); j++)\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n  return 0;\n}\n"}
{"label": "4", "index": "6684", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main(int argc, char *argv[]) {\n  int m, n, row, col, sz[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (m = 0; m < row; m++) {\n    for (n = 0; n < col; n++) {\n      scanf(\"%d\", &sz[m][n]);\n    }\n  }\n  for (k = 0; k < col; k++) {\n    m = 0;\n    n = k;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    m = k;\n    n = col - 1;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, n, row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  m = row + col - 2;\n  for (n = 0; n <= m; n++)\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= col - 1; j++)\n        if (i + j == n)\n          printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "6686", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int dia = 0; dia < row + col - 1; dia++) {\n    if (dia < col)\n      for (int iRow = 0; dia - iRow >= 0 && iRow < row; iRow++)\n        printf(\"%d\\n\", *(*(a + iRow) + dia - iRow));\n    else\n      for (int iRow = dia - col + 1; dia - iRow >= 0 && iRow < row; iRow++)\n        cout << *(*(a + iRow) + dia - iRow) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < row + col - 1; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k && k - i >= 0)\n          cout << a[i][k - i] << \"\\n\";\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n < row - 1 + col; n++) {\n    if (n < col) {\n      for (i = n; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n    if (n > col - 1) {\n      for (i = col - 1; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], l, h, i, j, hang, lie;\n  scanf(\"%d%d\", &lie, &hang);\n  for (l = 0; l < lie; l++) {\n    for (h = 0; h < hang; h++) {\n      scanf(\"%d\", &s[h][l]);\n    }\n  }\n  for (i = 0; i < hang + lie - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      if (j > hang - 1)\n        j = hang - 1;\n\n      h = j;\n      l = i - h;\n      if (l > lie - 1) {\n        break;\n      }\n      printf(\"%d\\n\", s[h][l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m + 1][n + 1];\n  for (int i = 1; i <= m; i++)\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  if (m == 1)\n    for (int i = 1; i <= n; i++)\n      cout << a[1][i] << endl;\n  else if (n == 1)\n    for (int i = 1; i <= m; i++)\n      cout << a[i][1] << endl;\n  else if (m < n) {\n    for (int i = 2; i <= m; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = m + 1; i <= n + 1; i++)\n      for (int j = i - 1; j >= i - m; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = n + 2; i <= n + m; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  } else if (m >= n) {\n    for (int i = 2; i <= n; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = n + 1; i <= m + 1; i++)\n      for (int j = n; j >= 1; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = m + 2; i <= m + n; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int a, b, row, col, i;\n  scanf(\"%d %d\", &a, &b);\n  for (row = 0; row < a; row++) {\n    for (col = 0; col < b; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (col = i; col >= 0 && (i - col) < a; col--) {\n      printf(\"%d\\n\", sz[i - col][col]);\n    }\n  }\n  for (i = b; i < a + b; i++) {\n    for (col = b - 1; col >= 0 && (i - col) < a; col--) {\n      cout << sz[i - col][col] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y;\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int n;\n  n = row + col - 2;\n  for (int i = 0; i < col; i++) {\n    for (x = 0, y = i - x; x >= 0 && y >= 0 && x < row && y < col; x++, y--) {\n\n      printf(\"%d\\n\", a[x][y]);\n    }\n  }\n  for (int j = col; j <= n; j++) {\n    for (y = col - 1, x = j - y; x >= 0 && y >= 0 && x < row && y < col;\n         y--, x++)\n      cout << a[x][y] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6693", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int row, col, i, j, k, a[400][400] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k <= row + col - 1; k++) {\n    for (i = 0; i < 2 * k + 1; i++) {\n      if (a[i][k - i] != 0) {\n        cout << a[i][k - i] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6694", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i;\n  int a[10010], *p = a;\n  for (i = 0; i < row * col; i++) {\n    scanf(\"%d \", p);\n    p++;\n  }\n  p = a;\n  for (int c = 0; c < row + col; c++) {\n    for (i = c; i >= 0; i--) {\n      if (i < col && c - i < row) {\n        printf(\"%d\\n\", *(p + i + (c - i) * col));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= (m + n - 2); i++) {\n    for (j = 0; j <= (m - 1) && j <= i; j++) {\n      if ((i - j) <= (n - 1))\n        printf(\"%d \", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, a[100][100], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  i = 0;\n  j = 0;\n\n  for (;;) {\n\n    printf(\"%d\\n\", a[i][j]);\n    if (i + j == row + col - 2)\n      break;\n    if (j == 0) {\n      j = i + j + 1;\n      i = 0;\n    } else if (i >= row - 1) {\n      j = i + j + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n\n    if (j > col - 1) {\n      i = i + j + 1 - col;\n      j = j - (j + 1 - col);\n    }\n    if (i + j == row + col - 2)\n      break;\n  }\n  if (row + col > 2)\n    cout << a[i][j] << \"\\n\";\n}\n"}
{"label": "4", "index": "6697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, sum;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    scanf(\"%d\", &a[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\" %d\", &a[i][j]);\n    }\n  }\n  for (sum = 0; sum < (row + col - 1); sum++) {\n    for (i = 0; i <= sum; i++) {\n      if (i < row && (sum - i) < col) {\n        printf(\"%d\\n\", a[i][sum - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ain[123][123];\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; ++i)\n    for (int j = 0; j < col; ++j)\n      cin >> ain[i][j];\n  int *p[123];\n  for (int i = 0; i < row; ++i)\n    p[i] = ain[i];\n  for (int i = 0; i < row + col - 1; ++i) {\n    for (int j = 0; j < row; ++j) {\n      if (j <= i && j > i - col)\n        printf(\"%d\\n\", *(p[j]++));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6699", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, lie, z;\n  int i, j;\n  scanf(\"%d %d\", &n, &lie);\n  int *p[n];\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (z = 0; z <= n + lie - 2; z++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == z)\n          printf(\"%d \", *(p[i] + j));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int col, row = 0;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  cout << **array << endl;\n  if (row == 1 && col == 1)\n    return 0;\n  if (col == 1) {\n    for (int i = 1; i < row; i++)\n      cout << **(array + i) << endl;\n    return 0;\n  }\n  int r = 0, l = 1;\n  int begl = 1, begr = 0;\n  while (r != row - 1 || l != col - 1) {\n    cout << *(*(array + r) + l) << endl;\n    r++;\n    l--;\n    if (l < 0 || r == row) \n    {\n      begl++;          \n      if (begl == col) \n      {\n        begl--;\n        begr++;\n      }\n      l = begl;\n      r = begr;\n    }\n  }\n  cout << *(*(array + r) + l) << endl;\n\n  return 0;\n}\n\n"}
{"label": "4", "index": "6701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int array[110][110];\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j); \n  for (i = 0; i < col; i++)          \n  {\n    for (j = 0; ((j <= i) && (j < row)); j++) \n    {\n      printf(\"%d\\n\", *(*(array + j) + i - j)); \n    }\n  }\n  for (i = 1; i < row; i++) \n  {\n    for (j = 0; ((j <= col - 1) && (j < row - i)); j++) \n    {\n      printf(\"%d\\n\", *(*(array + i + j) + col - 1 - j)); \n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int hang, lie, a[100][100] = {0};\n  cin >> hang >> lie;\n  int i, j, k;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (k = 0; k < (hang + lie - 1); k++) {\n    if (k < lie) {\n      for (i = 0; i < hang && (k - i) > -1; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    } else {\n      for (i = (k - lie + 1); i < hang && (k - i) > -1; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, i, j, r, c, t, *a, p;\n  scanf(\"%d%d\", &r, &c);\n  a = (int *)calloc(r * c, sizeof(int));\n  for (i = 0; i < r * c; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < c; i++) {\n    j = 0;\n    t = i;\n    while (t >= 0 && j < r) {\n      printf(\"%d\", *(a + j * c + t));\n      printf(\" \");\n      t--;\n      j++;\n    }\n  }\n\n  for (i = 1; i < r; i++) {\n    j = c - 1;\n    t = i;\n    while (t < r && j >= 0) {\n      printf(\"%d\", *(a + t * c + j));\n      if (!(j == c - 1 && t == r - 1))\n        printf(\" \");\n      j--;\n      t++;\n    }\n  }\n}\n"}
{"label": "4", "index": "6704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int i, j, r, s, p, k;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (r = 0; r < n; r++) {\n    p = r;\n    for (s = 0; p >= 0; s++) {\n      if (s < m)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  for (k = n; k <= m + n - 2; k++) {\n    p = n - 1;\n    for (s = k - n + 1; s < m; s++) {\n      if (p >= 0)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6705", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, k, j, p;\n  int a[123][123];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= row + col - 2; k = k + 1) {\n    for (p = 0; p <= k; p++) {\n      if (p < row && k - p < col)\n        printf(\"%d\\n\", a[p][k - p]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], i, j;\n  int row, col, s;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  if (row < col) {\n\n    for (s = 0; s <= row - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= col - 1; s++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n\n    for (s = col; s <= row + col - 2; s++)\n      for (j = col - 1; j >= s - row + 1; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n  } else if (row > col) {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        cout << array[i][s - i] << \"\\n\";\n    for (s = col; s <= row - 1; s++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  } else {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110] = {0};\n  int m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    k = j;\n    for (i = 0; i <= m - 1; i++) {\n      cout << *(*(a + i) + k) << endl;\n      k--;\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    j = n - 1;\n    for (k = i; k <= m - 1; k++) {\n      printf(\"%d\\n\", *(*(a + k) + j));\n      j--;\n      if (j < 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, i, j, k;\n  int(*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      cout << *(*(a + i) + j) << \"\\n\";\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6709", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        cout << a[i][j] << endl;\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, k, t = 0, a[101][101] = {0};\n  int *p;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = (int *)malloc(sizeof(int) * row * col);\n  for (i = 0; i < col; i++)\n    for (k = 0, j = i; j >= 0 && k < row; k++, j--) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; j--, k++) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 0; i < row * col; i++)\n    printf(\"%d\\n\", *(p + i));\n  return 0;\n}\n"}
{"label": "4", "index": "6711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1; j >= 0 && i + col - 1 - j < row; j--) {\n      printf(\"%d\\n\", *(*(a + i + col - 1 - j) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int s[120][120];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &s[i][j]);\n    }\n  }\n  int num;\n  for (num = 0; num < m + n - 1; num++) {\n    for (j = num; j > -1; j--) {\n      i = num - j;\n      if (i > -1 && i < n && j < m) {\n        cout << s[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row;\n  int col;\n  int a[100][100];\n  scanf(\"%d\", &row);\n  scanf(\"%d\", &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int t;\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t == 0) {\n      printf(\"\\n%d\", a[0][0]);\n    } else if (t > 0) {\n      if (t <= col - 1) {\n        for (i = t; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            cout << \"\\n\" << a[t - i][i];\n          }\n        }\n      } else {\n        for (i = col - 1; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, min;\n  cin >> m >> n;\n  int a[m][n];\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (j = 0; j <= n - 1; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = 0; i <= min; i++)\n      cout << a[i][j - i] << endl;\n  }\n  for (j = n; j <= m + n - 2; j++) {\n    min = (m - 1 > j ? j : m - 1);\n    for (i = j - (n - 1); i <= min; i++)\n      cout << a[i][j - i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lin, col;\n  cin >> lin >> col;\n  int i, j;\n  int num[100][100];\n  for (i = 0; i < lin; i++) {\n    for (j = 0; j < col; j++)\n      cin >> num[i][j];\n  }\n  if (lin <= col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j && i < lin; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; j >= i && col + i - 1 - j < lin; j--)\n        cout << num[col + i - 1 - j][j] << \"\\n\";\n    }\n  } else {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; col - 1 + i - j < lin && j >= 0; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6716", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i = 0, j = 0, a[100][100];\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < y; i++)\n    for (j = 0; i - j >= 0 && j < x; j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < x; i++)\n    for (j = 0; i + j < x && y - j - 1 >= 0; j++)\n      cout << a[i + j][y - 1 - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  int sum = 0;\n  while (1) {\n    if (sum == m + n - 1)\n      break;\n    else if (sum <= n - 1) {\n      for (int i = 0; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        printf(\"%d\\n\", a[i][sum - i]);\n      }\n      sum++;\n    } else {\n      for (int i = sum + 1 - n; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        printf(\"%d\\n\", a[i][sum - i]);\n      }\n      sum++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6718", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, s, *p = NULL;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (s = 0; s <= row + col - 2; s++) {\n    for (i = 0; i < row; i++)\n      if (s - i < col && s - i >= 0) {\n        cout << *(*(a + i) + s - i) << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6719", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, i, j;\n  int startrow = 0, startcol = 0;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  while ((startcol + startrow) != (row + col - 2)) {\n    if (startcol < col - 1) {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startcol++;\n    } else {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startrow++;\n    }\n  }\n  printf(\"%d\", sz[row - 1][col - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6720", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j < m; j++) {\n      if (i - j >= 0 && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  cin >> m >> n;\n  return 0;\n}\n"}
{"label": "4", "index": "6721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, hang, lie, (*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &hang, &lie);\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++) {\n      scanf(\"%d\", &*(*(a + i) + j));\n    }\n  }\n  if (hang <= lie) {\n    for (j = 0; j < hang; j++) {\n      for (i = j, k = 0; i != -1; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = hang; j < lie; j++) {\n      for (i = j, k = 0; k != hang; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  } else {\n    for (j = 0; j < lie; j++) {\n      for (i = j, k = 0; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = lie; j < hang; j++) {\n      for (i = lie - 1, k = j - lie + 1; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = hang - lie + 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, a[1000][1000], j, i, k;\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < l; k++)\n    for (j = k, i = 0; (j >= 0 && i < h); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < h; k++) {\n    for (j = l - 1, i = k; (i < h && j >= 0); i++, j--)\n      cout << a[i][j] << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "6723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, z, i, sz[100][100], k;\n  scanf(\"%d %d\", &h, &z);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < z; k++) {\n      cin >> sz[i][k];\n    }\n  }\n  for (i = 0; i <= h + z - 2; i++) {\n    for (k = 0; k < h; k++) {\n      if (i - k < 0 || i - k >= z) {\n        continue;\n      } else {\n        printf(\"%d\\n\", sz[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], i, j;\n  int row, col, s;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  if (row < col) {\n\n    for (s = 0; s <= row - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= col - 1; s++)\n      for (i = 0; i <= row - 1; i++)\n        cout << array[i][s - i] << \"\\n\";\n\n    for (s = col; s <= row + col - 2; s++)\n      for (j = col - 1; j >= s - row + 1; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n  } else if (row > col) {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        cout << array[i][s - i] << \"\\n\";\n    for (s = col; s <= row - 1; s++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", array[s - j][j]);\n\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  } else {\n    for (s = 0; s <= col - 1; s++)\n      for (i = 0; i <= s; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n    for (s = row; s <= row + col - 2; s++)\n      for (i = s + 1 - col; i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][s - i]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      cout << a[i][j] << \"\\n\";\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[row][col];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < col; j++) {\n    int t = 0;\n    int k = j;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << \"\\n\";\n      t++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int t = i;\n    int k = col - 1;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[100][100], l;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n  l = n + m;\n  for (i = 0; i <= l; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < n && (i - j) < m)\n        cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, m, n, a = 1;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  n = 0;\n  for (m = 0; m < col; m++) {\n    j = m;\n    i = n;\n    do {\n      if (i >= row || j < 0)\n        break;\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    do {\n      if (i >= row || j < 0)\n        break;\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int line, row, i, j, m, n;\n  scanf(\"%d %d \", &row, &line);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= line - 1; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (j = 0; j <= line - 1; j++) {\n    m = 0;\n    n = j;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  for (i = 1; i <= row - 1; i++) {\n    m = i;\n    n = line - 1;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6730", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100] = {0}, i = 0, j = 0;\n  int flag[100][100] = {0}, k = 0, l = 1;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < (row * col); i++)\n    cin >> array[i / col][i % col];\n  i = 0;\n  for (k = 0; k < col; k++) {\n    j = k;\n    for (i = 0; i < row; i++) {\n      if ((j != -1) && (i != row)) {\n        cout << array[i][j] << endl;\n        j--;\n      } else\n        break;\n    }\n    if (k == col - 1) {\n      i = 1;\n      for (l = 1; l < row; l++) {\n        j = col - 1;\n        for (i = l; (j != -1) && (i != row); i++) {\n          cout << array[i][j] << endl;\n          j--;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6731", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint arr[100][100];\nint row, col;\nvoid bianli(int y, int x) {\n  for (; y <= row && x > 0; y++, x--) {\n    cout << *(*(arr + y) + x) << endl;\n  }\n}\nint main() {\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(arr + i) + j);\n  for (int i = 1; i <= col; i++)\n    bianli(1, i);\n  for (int i = 2; i <= row; i++)\n    bianli(i, col);\n  return 0;\n}\n"}
{"label": "4", "index": "6732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m, p;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n    scanf(\"\\n\");\n  }\n\n  for (m = 0; m <= col + row - 2; m++) {\n    if (m < col) {\n      for (p = 0; p <= row - 1 && p <= m; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n\n    if (m >= col) {\n      for (p = m - col + 1; p <= m && p <= row - 1; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, s, sz[100][100], R, C;\n  scanf(\"%d%d\", &R, &C);\n  for (s = 0; s < R; s++) {\n    printf(\"\\n\");\n    for (r = 0; r < C; r++) {\n      scanf(\"%d\", &sz[s][r]);\n    }\n  }\n  for (s = 0; s < C + R - 1; s++) {\n    for (r = 0; r <= s; r++) {\n      if (s - r >= C)\n        continue;\n      if (r >= R)\n        break;\n      cout << sz[r][s - r] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, k, i, j;\n  int a[100][100] = {{0}, {0}};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k < row + col - 1;) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n    k++;\n  }\n}\n"}
{"label": "4", "index": "6735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int *p = a[0];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> *(p + i * n + j);\n    }\n  for (int i = 0; i < m + n - 1; i++) {\n    int flag = 1;\n    int x = 0;\n    int y = i;\n    while (flag == 1) {\n      if (y < n && x >= 0)\n        cout << *(p + x * n + y) << endl;\n      x++;\n      y--;\n      if (y < 0 || x > m - 1)\n        flag = 0;\n    }\n  }\n}\n"}
{"label": "4", "index": "6736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[110][110] = {0};\n  scanf(\"%d%d\", &row, &col);\n  getchar();\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j >= row || (i - j) >= col)\n        continue;\n      printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6737", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], p, q, row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  p = 0;\n  q = 0;\n  for (int i = 0; i < row * col; i++) {\n    cout << a[p][q] << endl;\n    if (q == 0 || p == row - 1) {\n      q = p + q + 1;\n      p = 0;\n      while (q >= col) {\n        p++;\n        q--;\n      }\n    } else {\n      p++;\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6738", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int num[110][110] = {0};\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(num + i) + j);\n\n  for (int i = 0; i < col; i++) {\n    for (int j = 0; j <= i; j++) {\n      if (j < row)\n        cout << *(*(num + j) + i - j) << endl;\n      else\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    for (int j = 0; j < row - i; j++) {\n      if (j < col)\n        cout << *(*(num + i + j) + col - j - 1) << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6739", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[99][99];\n  int row, col, i, j, t = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t < col) {\n      for (i = 0; i <= t && i <= row - 1; i++) {\n        printf(\"%d\\n\", array[i][t - i]);\n      }\n    } else {\n      for (i = t + 1 - col; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[1000][1000];\n  int i, j;\n  int m, n;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int time = 0;\n  for (j = 1; j <= col; j++) {\n    m = 1;\n    n = j;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        printf(\"\\n\");\n      n = n - 1;\n      m = m + 1;\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    m = i;\n    n = col;\n    while (1) {\n      cout << a[m][n];\n      time = time + 1;\n      if (time < row * col)\n        cout << endl;\n      n = n - 1;\n      m = m + 1;\n\n      if (n < 1)\n        break;\n      if (m > row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[104][104];\n  int h, l;\n  scanf(\"%d %d \", &h, &l);\n  for (int i = 0; i < 104; i++)\n    for (int k = 0; k < 104; k++)\n      a[i][k] = -999;\n  for (int i = 1; i <= h; i++)\n    for (int k = 1; k <= l; k++)\n      scanf(\"%d \", &a[i][k]);\n  int printer = a[1][1];\n  for (int i = 1; i <= l; i++) {\n    int k = 0;\n    printer = a[1 + k][i - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[1 + k][i - k];\n    }\n  }\n  for (int i = 2; i <= h; i++) {\n    int k = 0;\n    printer = a[i + k][l - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[i + k][l - k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k = 1;\n  int a[200][200] = {0};\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      cin >> a[i][j];\n  }\n  cout << a[0][0];\n  while (k <= row + col - 2) {\n    for (i = 0; i <= row - 1; i++) {\n      if (k - i >= 0 && k - i < col) {\n        cout << endl;\n        cout << a[i][k - i];\n      }\n    }\n    k++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6743", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int array[100][100];\n  int(*p)[100];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  p = array;\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = (i >= col) ? (i - col + 1) : 0; (j < row) && (i - j >= 0); j++)\n      cout << *(*(p + j) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int sz[101][101];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n\n  if (row > col) {\n    int x;\n    for (j = 0; j < col; j++) {\n      for (x = 0; x <= j; x++) {\n        printf(\"%d\\n\", sz[x][j - x]);\n      }\n    }\n    int y;\n    for (i = 1; i <= row - col; i++) {\n      for (y = 0; y < col; y++) {\n        printf(\"%d\\n\", sz[i + y][col - y - 1]);\n      }\n    }\n    int w;\n    for (i = row - col + 1; i < row; i++) {\n      for (w = 0; w < col - 1; w++) {\n        printf(\"%d\\n\", sz[i + w][col - w - 1]);\n        if (i + w == row - 1) {\n          break;\n        }\n      }\n    }\n  } else {\n    int z;\n    for (j = 0; j < row; j++) {\n      for (z = 0; z <= j; z++) {\n        printf(\"%d\\n\", sz[z][j - z]);\n      }\n    }\n    int n;\n    for (j = row; j < col; j++) {\n      for (n = 0; n < row; n++) {\n        printf(\"%d\\n\", sz[n][j - n]);\n      }\n    }\n    int m;\n    for (i = 1; i < row; i++) {\n      for (m = 0; m < row - 1; m++) {\n        printf(\"%d\\n\", sz[i + m][col - m - 1]);\n        if (i + m == row - 1) {\n          break;\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], b[100000];\n  int row, col;\n  int i, j, k = (-1), sum;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (sum = 0; sum <= ((row + col) - 2); sum++) {\n    for (i = 0; i < row; i++) {\n      if (sum - i >= 0 && sum - i < col) {\n        k += 1;\n        b[k] = a[i][sum - i];\n      }\n    }\n  }\n  for (k = 0; k <= row * col - 1; k++)\n    printf(\"%d\\n\", b[k]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6746", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, k = 0, temp = 0;\n  scanf(\"%d %d \", &row, &col);\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      cout << array[i][k - i] << endl;\n    }\n  for (k = col; k <= (col - 1) + (row - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      cout << array[i][k - i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int array[110][110];\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (i = 0; i < col; i++) {\n    for (j = 0; ((j <= i) && (j < row)); j++) {\n      printf(\"%d\\n\", *(*(array + j) + i - j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; ((j <= col - 1) && (j < row - i)); j++)\n\n    {\n      printf(\"%d\\n\", *(*(array + i + j) + col - 1 - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6748", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i; j++) {\n      if (j < row)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  for (i = 1; i < row; i++)\n    for (j = i; j < col + i; j++) {\n      if (j < row)\n        cout << a[j][col + i - j - 1] << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int row, col;\n  int i, j, he;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (he = 0; he < row + col - 1; he++) {\n    for (j = he; j >= 0; j--) {\n      if (j >= col) {\n        continue;\n      }\n      i = he - j;\n      if (i >= row) {\n        continue;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6750", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n  int r, c, i, j, s;\n  cin >> r >> c;\n  int x[100][100];\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  s = 0;\n  while (s <= r + c - 2) {\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < c; j++) {\n        if (i + j == s) {\n          printf(\"%d\\n\", x[i][j]);\n        }\n      }\n    }\n\n    s++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lin, col;\n  cin >> lin >> col;\n  int i, j;\n  int num[100][100];\n  for (i = 0; i < lin; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &num[i][j]);\n  }\n  if (lin <= col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j && i < lin; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; j >= i && col + i - 1 - j < lin; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  } else {\n    for (j = 0; j < col; j++) {\n      for (i = 0; i <= j; i++)\n        cout << num[i][j - i] << endl;\n    }\n    for (i = 1; i < lin; i++) {\n      for (j = col - 1; col - 1 + i - j < lin && j >= 0; j--)\n        cout << num[col + i - 1 - j][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6752", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, row, col;\n  int sz[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    scanf(\"\\n%d\", &sz[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (i = 0; i < row; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row; i < col; i++) {\n      for (j = 0, k = i; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  if (col < row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      for (j = i, k = col - 1; k >= 0; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row - col + 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, k = 0, b[10000], s;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row >= col) {\n    for (s = 0; s < col; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < row; s++) {\n      for (i = s - col + 1; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < row + col - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  } else {\n    for (s = 0; s < row; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < col; s++) {\n      for (i = 0; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < col + row - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row;\n  int mat[200][200];\n  int i, j;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &mat[i][j]);\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      cout << mat[i][j] << \"\\n\";\n    if (i == row - 1 && j == col - 1)\n      break;\n    if (j == 0) {\n      j = i + 1;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6755", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, row, col, p[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < i + 1 && j < row; j++) {\n      if (i - j >= col) {\n        continue;\n      }\n      cout << *(*(p + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a, b, k, p;\n  int array[102][102];\n  scanf(\"%d %d \", &a, &b);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d \", &array[i][j]);\n\n  if (a >= b) {\n    for (j = 0; j < b; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i <= a - b; i++)\n      for (p = i, j = b - 1; j >= 0; p++, j--)\n        cout << array[p][j] << endl;\n    for (i = a - b + 1; i < a; i++)\n      for (p = i, j = b - 1; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  } else {\n    for (j = 0; j < a; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (j = a; j < b; j++)\n      for (k = j, i = 0; i < a; i++, k--)\n        printf(\"%d\\n\", array[i][k]);\n    for (i = 1; i < a; i++)\n      for (j = b - 1, p = i; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int rr, cc;\n  int arr[100][100] = {0};\n  cin >> rr;\n  cin >> cc;\n\n  int i, j;\n  for (i = 0; i < rr; i++) {\n    for (j = 0; j < cc; j++) {\n      scanf(\"%d \", &arr[i][j]);\n    }\n  }\n\n  for (j = 0; j < cc; j++) {\n    i = 0;\n    for (int k = j; k >= 0 && i <= rr - 1; k--, i++) {\n      cout << arr[i][k] << endl;\n    }\n  }\n\n  for (i = 1; i < rr; i++) {\n    j = cc - 1;\n    for (int p = i; p <= rr - 1 && j >= 0; p++, j--) {\n      printf(\"%d\\n\", arr[p][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n\n  int sz[100][100];\n  int row, col, ROW, COL;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  cout << sz[0][0] << \" \";\n\n  int i = 0, j, k;\n\n  for (j = 1; j < COL; j++) {\n\n    for (k = j; k >= 0; k--) {\n      if (j - k < ROW)\n        printf(\"%d \", sz[j - k][k]);\n    }\n  }\n  for (j = COL; j <= COL + ROW; j++) {\n\n    for (k = COL - 1; k >= 0; k--) {\n      if (j - k < ROW)\n        printf(\"%d \", sz[j - k][k]);\n    }\n  }\n\n  scanf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "4", "index": "6759", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int n, m, i, j, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (k = 0;; k++) {\n      if (k >= n || j - k < 0) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[k][j - k]);\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (k = 0;; k++) {\n      if (i + k > n - 1 || m - 1 - k < 0)\n        break;\n      else\n        printf(\"%d\\n\", sz[i + k][m - 1 - k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6760", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int(*p)[100] = a;\n  int i, j;\n  int r, c;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++)\n    for (j = 0; j <= c - 1; j++)\n      cin >> *(*(p + i) + j);\n  int t;\n  for (t = 0; t <= c - 1; t++) {\n    for (i = 0, j = t; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n  for (t = 1; t <= r - 1; t++) {\n    for (i = t, j = c - 1; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= m + n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i + 1 - j > 0 && i + 1 - j <= m)\n        cout << *(*(a + j) + i + 1 - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6762", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int line, row, i, j, m, n;\n  scanf(\"%d %d \", &row, &line);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= line - 1; j++) {\n      cin >> num[i][j];\n    }\n  }\n  for (j = 0; j <= line - 1; j++) {\n    m = 0;\n    n = j;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  for (i = 1; i <= row - 1; i++) {\n    m = i;\n    n = line - 1;\n    do {\n      printf(\"%d\\n\", num[m][n]);\n      m++;\n      n--;\n    } while (n != -1 && m < row);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6763", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void prt(int ary[][100], int a, int b);\n  int array[100][100] = {0};\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int i = 0, j = 0;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n\n  prt(array, row, col);\n  return 0;\n}\nvoid prt(int ary[][100], int a, int b) {\n  int min(int c, int d);\n  int max(int e, int f);\n  int k = 0, l = 0;\n  printf(\"%d\", ary[0][0]);\n  for (l = 1; l < b; l++) {\n    int m = l;\n    for (k = 0; k <= min(l, a - 1); k++) {\n      printf(\"\\n%d\", ary[k][m]);\n      m -= 1;\n    }\n  }\n  k = 1;\n  l = b - 1;\n  for (k = 1; k < a; k++) {\n    int n = k;\n    for (l = b - 1; l >= max(0, b - a + k); l--) {\n      printf(\"\\n%d\", ary[n][l]);\n      n += 1;\n    }\n  }\n}\nint min(int c, int d) { return (c >= d ? d : c); }\nint max(int e, int f) { return (e >= f ? e : f); }\n"}
{"label": "4", "index": "6764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], col, row, i, j, k, min;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; (k >= 0 && i < row) == 1;) {\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      k--;\n    }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; (j >= 0 && k < row) == 1;) {\n      printf(\"%d\\n\", a[k][j]);\n      j--;\n      k++;\n    }\n  }\n}\n"}
{"label": "4", "index": "6765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row;\n  int col;\n  int i;\n  int j;\n  int t;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n\n  for (t = 0; t < col; t++) {\n    for (i = 0; i < row; i++) {\n      j = t - i;\n      if (j < 0) {\n        break;\n      }\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n\n  for (t = col; t <= col + row - 2; t++) {\n    for (j = col - 1;; j--) {\n      i = t - j;\n      if (j < 0)\n        break;\n\n      if (i >= row) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i = 1, j = 1;\n  int tempi = 1, tempj = 1, a[100][100] = {0};\n  cin >> m >> n;\n  for (int s = 1; s <= m; s++)\n    for (int t = 1; t <= n; t++)\n      cin >> a[s][t];\n  while (tempi != m || tempj != n) {\n    do {\n      cout << a[i][j] << endl;\n      i++;\n      j--;\n    } while (j != 0 && i != m + 1);\n    if (tempj != n) {\n      tempj++;\n      i = tempi;\n      j = tempj;\n    } else {\n      tempi++;\n      i = tempi;\n      j = tempj;\n    }\n  }\n  cout << a[m][n];\n  return 0;\n}\n"}
{"label": "4", "index": "6767", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100] = {0};\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int m = 0; m < row + col - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if (i + j == m)\n          printf(\"%d\\n\", *(*(a + i) + j));\n  return 0;\n}\n"}
{"label": "4", "index": "6768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  cin >> m >> n;\n  int a[m + 1][n + 1];\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  int k;\n\n  for (k = 1; k <= n; k++)\n    for (i = k; (i >= 1) && (k + 1 - i <= m); i--)\n      cout << a[k + 1 - i][i] << endl;\n\n  for (k = 2; k <= m; k++)\n    for (i = n; (i >= 1) && (k + n - i <= m); i--)\n      cout << a[k + n - i][i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int *head = (int *)calloc(row * col, sizeof(int));\n  int *p;\n  for (p = head; p < head + row * col; p++) {\n    scanf(\"%d\", p);\n  }\n  int i, j, jj, ii;\n  for (j = 0; j < col; j++) {\n    for (jj = j, i = 0; jj >= 0 && i < row; jj--, i++) {\n      printf(\"%d\\n\", *(head + col * i + jj));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (ii = i, j = col - 1; j >= 0 && ii < row; j--, ii++) {\n      printf(\"%d\\n\", *(head + col * ii + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6770", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, temp = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  while (temp < col) {\n    j = temp;\n    i = 0;\n    while (i < row && j >= 0) {\n      cout << array[i++][j--] << endl;\n    }\n    temp++;\n  }\n  if (row > 1) {\n    temp = 1;\n    while (temp < row) {\n      j = col - 1;\n      i = temp;\n      while (i < row && j >= 0) {\n        printf(\"%d\\n\", array[i++][j--]);\n      }\n      temp++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int(*p)[200];\n  p = (int(*)[200])malloc(200 * 200 * sizeof(int));\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++) {\n      *(*(p + i) + j) = -32767;\n    }\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (k = 0; k <= n + m - 2; k++)\n    for (i = 0; i <= k && i < n; i++) {\n      j = k - i;\n      if (*(*(p + i) + j) > -32767)\n        cout << *(*(p + i) + j) << \"\\n\";\n    }\n}\n"}
{"label": "4", "index": "6772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < j + 1; i++) {\n      if (i < row) {\n        printf(\"%d\\n\", a[i][j - i]);\n      }\n    }\n  }\n  for (k = col; k < row + col - 1; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (k - j < row) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6773", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int s[120][120];\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      cin >> s[i][j];\n    }\n  int num;\n  for (num = 0; num < m + n - 1; num++) {\n    for (j = num; j > -1; j--) {\n      i = num - j;\n      if (i > -1 && i < n && j < m) {\n        cout << s[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, *a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      a[i][j] = (int *)malloc(sizeof(int));\n      scanf(\"%d\", a[i][j]);\n    }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", *a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, temp_i = i; j >= 0 && temp_i < row; j--, temp_i++) {\n      printf(\"%d\\n\", *a[temp_i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, m = 0, k = 0, i, j, x, y, row, col, a[100][100], *p; \n  cin >> row >> col;\n  n = row * col;\n  for (i = 0; i < row; i++) {\n    p = (int *)a + i * 100;\n    for (j = 0; j < col; j++)\n      cin >> *p++; \n  }\n  for (i = 0, j = 0; m < n; i = x, j = y) {\n    m++;                        \n    p = (int *)a + i * 100 + j; \n    cout << *p << endl;         \n    x = i + 1;\n    y = j - 1;             \n    if (x >= row || y < 0) \n    {\n      x = 0;\n      y = ++k;\n      if (y >= col) \n      {\n        x = y - col + 1;\n        y = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int hang, lie, a[100][100] = {0};\n  cin >> hang >> lie;\n  int i, j, k;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (k = 0; k < (hang + lie - 1); k++) {\n    if (k < lie) {\n      for (i = 0; i < hang && (k - i) > -1; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    } else {\n      for (i = (k - lie + 1); i < hang && (k - i) > -1; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6777", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int p = 0; p <= row + col - 2; p++) {\n    for (int i = 0; i <= p; i++) {\n      int j = p - i;\n      if (i > row - 1 || j > col - 1 || j < 0)\n        continue;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int *a, i, j, row, col;\n  scanf(\"%d %d\", &row, &col);\n  a = (int *)calloc(200, 200 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", a + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 1; (i < row + 1) && (i <= j + 1); i++)\n      printf(\"%d\\n\", *(a + (i - 1) * col + j + 1 - i));\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 1; (j <= col) && (j < row + 1 - i); j++)\n\n      printf(\"%d\\n\", *(a + (i + j - 1) * col + col - j));\n  }\n}\n"}
{"label": "4", "index": "6779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0};\n  int i, j, rs, re, cs, ce, s;\n\n  scanf(\"%d%d\", &r, &c);\n\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (rs = 0, cs = 0, re = 0, ce = 0; (re + ce) < (r + c);) {\n    for (i = rs, j = cs; i <= re && j >= ce; i++, j--) {\n      printf(\"%d\\n\", a[i][j]);\n    }\n    if (cs < (c - 1))\n      cs++;\n    else\n      rs++;\n    if (re < (r - 1))\n      re++;\n    else {\n      ce++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6780", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (int i = 0; i < row + col - 1; i++) {\n    for (int j = 0; j < row; j++) {\n      for (int k = 0; k < col; k++) {\n        if (j + k == i)\n          cout << *(*(a + j) + k) << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6781", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, time = 0, i, j, n;\n  int array[110][110];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    if (i < col) {\n      for (int j = 0; j < row && j <= i; j++)\n        printf(\"%d\\n\", *(*(array + j) + i - j));\n    } else {\n      for (int j = col - 1; j >= i - row + 1 && j >= 0; j--)\n        printf(\"%d\\n\", *(*(array + i - j) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[110][110];\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++) {\n      scanf(\"%d \", &map_1[i][j]);\n    }\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = i; j >= 0; j--) {\n      int k = i - j;\n      if (k >= 0 && k < n && j < m) {\n        cout << map_1[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100] = {{0}};\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    int u = i;\n    int j = 1;\n    for (; u >= 1 && j <= m; u--, j++) {\n      cout << a[j][u] << endl;\n    }\n  }\n  for (i = 2; i <= m; i++) {\n    int u = i, j = n;\n    for (; u <= m && j >= 1; u++, j--) {\n      printf(\"%d\\n\", a[u][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a = 0;\n  int(*p)[10000];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[10000])calloc(10000, 10000);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (a < n + m - 1) {\n    while (i != m && j != -1) {\n      printf(\"%d\\n\", *(*(p + i) + j));\n      i++;\n      j--;\n    }\n    a++;\n    if (a > n - 1) {\n      j = n - 1;\n      i = a - (n - 1);\n    } else if (a <= n - 1) {\n      j = a;\n      i = 0;\n    }\n  }\n}\n"}
{"label": "4", "index": "6785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, s;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  for (i = 0; i < col; i++) {\n    s = i;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n  for (i = col; i < col + row - 1; i++) {\n    s = col - 1;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, row, col, p[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> p[i][j];\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < i + 1 && j < row; j++) {\n      if (i - j >= col)\n        continue;\n      printf(\"%d\\n\", *(*(p + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6787", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, i1, j1;\n  cin >> i >> j;\n  for (i1 = 1; i1 <= i; i1++) {\n    for (j1 = 1; j1 <= j; j1++)\n      cin >> a[i1][j1];\n  }\n  j1 = 1;\n  i1 = 1;\n  printf(\"%d\", a[1][1]);\n  while (j1 != j || i1 != i) {\n    i1 = i1 + 1;\n    j1 = j1 - 1;\n    if (j1 == 0) {\n      j1 = i1;\n      i1 = 1;\n    }\n    if (j1 > j || i1 > i)\n      continue;\n    printf(\"\\n%d\", a[i1][j1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, *array, *p, i, j, t;\n  scanf(\"%d%d\", &row, &col);\n  array = (int *)calloc(row, col * sizeof(int));\n  for (p = array; p <= array + row * col - 1; p++)\n    scanf(\"%d\", p);\n  for (t = 0; t <= row + col - 2; t++)\n    for (i = 0; i <= t; i++) {\n      if (i > row - 1 || t - i > col - 1)\n        continue;\n      printf(\"%d\\n\", *(array + i * col + t - i));\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[99][99], i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  for (k = 0; k <= col - 1; k++) {\n    j = k;\n    i = 0;\n    do {\n      cout << array[i][j] << endl;\n      j = j - 1;\n      i = k - j;\n    } while (i != row && j != -1);\n  }\n  for (k = col; k <= col + row - 2; k++) {\n    j = col - 1;\n    i = k - j;\n    do {\n      printf(\"%d\\n\", array[i][j]);\n      j = j - 1;\n      i = i + 1;\n    } while (i != row && j != -1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[row * col];\n  for (int i = 0; i < row * col; ++i)\n    cin >> data[i];\n\n  int *head = data;\n  for (int i = 0; i < col; ++i) {\n    int *p = head;\n    for (int j = 0; j <= min(i, row - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n    ++head;\n  }\n  --head;\n  for (int i = 1; i < row; ++i) {\n    head += col;\n    int *p = head;\n    for (int j = 0; j <= min(col - 1, row - i - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, *a[101], *h[101];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    h[i] = a[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++, a[i]++)\n      scanf(\"%d\", a[i]);\n  }\n  if (col == 1) {\n    for (i = 0; i < row; i++)\n      printf(\"%d\\n\", *h[i]);\n  } else {\n    for (i = 0; i < row; i++)\n      a[i] = h[i];\n    for (i = 0; i < row + col + 1; i++) {\n      for (j = 0; j <= i && j < row; j++) {\n        if (a[j] != h[j] + col) {\n          cout << *a[j] << \"\\n\";\n          a[j]++;\n        } else\n          continue;\n      }\n      if (a[j] == h[row - 1] + col - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[200][200];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i && j < row && (i - j) < col; j++)\n      cout << *(a[j] + (i - j)) << endl;\n  for (int k = col; k <= row + col - 2; k++)\n    for (int q = col - 1; q >= k - row + 1 && q >= 0; q--)\n      printf(\"%d\\n\", *(a[k - q] + q));\n  return 0;\n}\n"}
{"label": "4", "index": "6793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i < col; i++) {\n    cout << *(*(a) + i) << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    printf(\"%d\\n\", *(*(a + i) + col - 1));\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6794", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> array[i][j];\n  for (i = 2; i <= row + col; i++)\n    for (j = 1; j <= i - 1; j++) {\n      if ((j <= row) && (i - j <= col))\n        printf(\"%d\\n\", array[j][i - j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[row * col];\n  for (int i = 0; i < row * col; ++i)\n    cin >> data[i];\n  int *head = data;\n  for (int i = 0; i < col; ++i) {\n    int *p = head;\n    for (int j = 0; j <= min(i, row - 1); ++j) {\n      printf(\"%d\\n\", *p);\n      p += col - 1;\n    }\n    ++head;\n  }\n  --head;\n  for (int i = 1; i < row; ++i) {\n    head += col;\n    int *p = head;\n    for (int j = 0; j <= min(col - 1, row - i - 1); ++j) {\n      cout << *p << \"\\n\";\n      p += col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < col; i++)\n    for (int j = 0; j < row && j <= i; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  for (int i = 1; i < row; i++)\n    for (int j = 0; col - 1 - j >= 0 && i + j < row; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m && n < col; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6798", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n  int row, col;\n  int i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << a[j][i - j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6799", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0;\n  int ar[101][101];\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &ar[i][j]);\n\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row > col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row - 1; i++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n\n    for (i = row; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row < col) {\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = row; i <= col - 1; i++)\n      for (j = 0; j <= row - 1; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6800", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, row, col, rowc, colc;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      colc = j;\n      rowc = i - j;\n      if (colc >= col) {\n        continue;\n      }\n      if (row > col && rowc >= row) {\n        continue;\n      }\n      if (col >= row && rowc == row) {\n        break;\n      }\n      printf(\"%d\\n\", a[rowc][colc]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid move1(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < m - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n    }\n  }\n  for (i = m - 1; i < n - 1; i++) {\n    for (k = 0; k < m; k++)\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nvoid move2(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < n - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n    }\n  }\n  for (i = 0; i < m - n; i++) {\n    for (k = 0; k < n; k++)\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n  }\n  for (i = m - n; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nint main() {\n  int m, n, i, j, *p[100] = {0}, **head;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    p[i] = (int *)malloc(n * sizeof(int));\n  }\n  head = p;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  if (m <= n)\n    move1(p, m, n);\n  else\n    move2(p, m, n);\n}\n"}
{"label": "4", "index": "6802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int col, row = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  cout << **array << endl;\n  if (row == 1 && col == 1)\n    return 0;\n  if (col == 1) {\n    for (int i = 1; i < row; i++)\n      cout << **(array + i) << endl;\n    return 0;\n  }\n  int r = 0, l = 1;\n  int begl = 1, begr = 0;\n  while (r != row - 1 || l != col - 1) {\n    cout << *(*(array + r) + l) << endl;\n    r++;\n    l--;\n    if (l < 0 || r == row) {\n      begl++;\n      if (begl == col) {\n        begl--;\n        begr++;\n      }\n      l = begl;\n      r = begr;\n    }\n  }\n  cout << *(*(array + r) + l) << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0, 0}, row, col, i, j, count = 0, r = 0;\n  cin >> row >> col;\n  if (col == 1)\n    r = 1;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  }\n\n  i = 1;\n  j = 1;\n  while (count < row * col) {\n    cout << a[i][j] << endl;\n    count++;\n    if ((j == 1 && i != row) || (j != 1 && i == row) || (j == 1 && i == row)) {\n      if (i + j < col) {\n        j = i + j;\n        i = 1;\n      } else {\n        r++;\n        i = r;\n        j = col;\n      }\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[1500][1500], b[10000], i, j, sum, t = 0;\n  cin >> n >> m;\n  for (i = 1; i <= 1499; i++)\n    for (j = 1; j <= 1499; j++)\n      a[i][j] = -198;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  }\n\n  for (sum = 2; sum <= (n + m); sum++) {\n    for (i = 1; i < sum; i++) {\n      if (a[i][sum - i] != -198)\n        cout << a[i][sum - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    if ((k <= col - 1) && (k <= row - 1)) {\n      for (int l = 0; l <= k; l++) {\n        printf(\"%d\\n\", sz[l][k - l]);\n      }\n\n    } else if ((k <= col - 1) && (k > row - 1)) {\n      for (int m = 0; m <= row - 1; m++) {\n        cout << sz[m][k - m] << \"\\n\";\n      }\n    } else if ((k > col - 1) && (k <= row - 1)) {\n      for (int t = k - col + 1; t <= k; t++) {\n        printf(\"%d\\n\", sz[t][k - t]);\n      }\n    } else if ((k > col - 1) && (k > row - 1)) {\n      for (int p = k - col + 1; p <= row - 1; p++) {\n        printf(\"%d\\n\", sz[p][k - p]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i = 0, j = 0, a[100][100];\n  scanf(\"%d %d \", &x, &y);\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < y; i++)\n    for (j = 0; i - j >= 0 && j < x; j++)\n      cout << a[j][i - j] << endl;\n  for (i = 1; i < x; i++)\n    for (j = 0; i + j < x && y - j - 1 >= 0; j++)\n      cout << a[i + j][y - 1 - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  int **a;\n  a = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    a[i] = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  int len;\n  for (len = 0; len < row + col - 1; len++) {\n    for (i = 0; i < row; i++) {\n      j = len - i;\n      if ((j < col) && (j >= 0))\n        cout << *(*(a + i) + len - i) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i = 0, j = 0;\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (; i != (row - 1) || j != (col - 1);) {\n    cout << *(*(a + i) + j) << endl;\n    i++;\n    j--;\n    if (j < 0 || i > row - 1) {\n      if (i + j + 1 < col) {\n        j = i + j + 1;\n        i = 0;\n      } else {\n        i = i + j + 1 - (col - 1);\n        j = col - 1;\n      }\n    }\n  }\n  cout << *(*(a + row - 1) + col - 1);\n  return 0;\n}\n"}
{"label": "4", "index": "6809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int m, n, i, j, r;\n  long flag = 0;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (r = 0; r < m + n - 1; r++) {\n    for (i = 0; i <= r && flag < m * n; i++) {\n      if (i < m && r - i < n) {\n        printf(\"%d\\n\", a[i][r - i]);\n        flag++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100], row, col;\n  int c, r, sum;\n  scanf(\"%d%d\", &row, &col);\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", &array[r][c]);\n    }\n  }\n\n  for (sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (c = sum; c >= 0; c--) {\n        if ((sum - c) >= row)\n          break;\n        printf(\"%d\\n\", array[sum - c][c]);\n      }\n    } else {\n      for (r = sum - col + 1; r < row; r++) {\n        if ((sum - r) < 0)\n          break;\n        printf(\"%d\\n\", array[r][sum - r]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6811", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    temp_i = i;\n    for (j = col - 1; j >= 0 && temp_i < row; j--) {\n      printf(\"%d\\n\", a[temp_i][j]);\n      temp_i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int array[100][100];\n  int(*p)[100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  p = array;\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = (i >= col) ? (i - col + 1) : 0; (j < row) && (i - j >= 0); j++)\n      cout << *(*(p + j) + i - j) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6813", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n\n  for (i = 0; i < col + row - 1; i++)\n    for (j = i, k = 0; (j >= 0) && (k < row); j--, k++) {\n      if (j < col)\n        cout << array[k][j] << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, **p, k;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      printf(\"%d\\n\", *(*(p + i) + k));\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      printf(\"%d\\n\", *(*(p + k) + j));\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long t, m, r, l, i, x, j, a[1000][1000] = {0}, b[1000] = {0};\n  scanf(\"%ld%ld\", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i = i - 1;\n  j = j - 1;\n  for (t = 2; t <= i + j; t++) {\n    for (m = 0; m < b[t]; m++) {\n      printf(\"%ld\\n\", a[t][m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6816", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, a[400][400] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k <= row + col - 1; k++) {\n    for (i = 0; i < 2 * k + 1; i++) {\n      if (a[i][k - i] != 0)\n        cout << a[i][k - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, shuzu[100][100], n = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n  if (row == col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row > col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((col - 1 - j) == 0) {\n          break;\n        }\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int row, col;\n  int a[101][101];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 1; j <= col; j++) {\n    cout << a[1][j] << endl;\n    int k = 1;\n    while (((1 + k) <= row) && ((j - k) >= 1)) {\n      cout << a[1 + k][j - k] << endl;\n      k++;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    cout << a[i][col] << endl;\n    int k = 1;\n    while (((i + k) <= row) && ((col - k) >= 1)) {\n      cout << a[i + k][col - k] << endl;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6819", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int rol, col;\n  cin >> rol >> col;\n  int a[rol][col];\n  int i, j;\n  for (i = 0; i < rol; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  int k;\n  for (k = 0; k <= rol + col - 2; k++) {\n    for (i = 0; k - i >= 0 && i < rol; i++) {\n      if (k - i >= col) {\n        continue;\n      }\n      j = k - i;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; (i < row) && (j >= 0); i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i = 1, j = 1;\n  int tempi = 1, tempj = 1, a[100][100] = {0};\n  scanf(\"%d %d \", &m, &n);\n  for (int s = 1; s <= m; s++)\n    for (int t = 1; t <= n; t++)\n      cin >> a[s][t];\n  while (tempi != m || tempj != n) {\n    do {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    } while (j != 0 && i != m + 1);\n    if (tempj != n) {\n      tempj++;\n      i = tempi;\n      j = tempj;\n    } else {\n      tempi++;\n      i = tempi;\n      j = tempj;\n    }\n  }\n  printf(\"%d\", a[m][n]);\n  return 0;\n}\n"}
{"label": "4", "index": "6822", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int q, m, n, a[100][100] = {0}, i, j;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= m + n - 2; i++) {\n    for (j = 0; i - j >= 0; j++) {\n      if (j < m && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "4", "index": "6823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[200][200];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i && j < row && (i - j) < col; j++)\n      cout << *(a[j] + (i - j)) << endl;\n  for (int k = col; k <= row + col - 2; k++)\n    for (int q = col - 1; q >= k - row + 1 && q >= 0; q--)\n      cout << *(a[k - q] + q) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6824", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int sz[101][101];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n\n  if (row > col) {\n    int x;\n    for (j = 0; j < col; j++) {\n      for (x = 0; x <= j; x++) {\n        printf(\"%d\\n\", sz[x][j - x]);\n      }\n    }\n    int y;\n    for (i = 1; i <= row - col; i++) {\n      for (y = 0; y < col; y++) {\n        printf(\"%d\\n\", sz[i + y][col - y - 1]);\n      }\n    }\n    int w;\n    for (i = row - col + 1; i < row; i++) {\n      for (w = 0; w < col - 1; w++) {\n        printf(\"%d\\n\", sz[i + w][col - w - 1]);\n        if (i + w == row - 1) {\n          break;\n        }\n      }\n    }\n  } else {\n    int z;\n    for (j = 0; j < row; j++) {\n      for (z = 0; z <= j; z++) {\n        printf(\"%d\\n\", sz[z][j - z]);\n      }\n    }\n    int n;\n    for (j = row; j < col; j++) {\n      for (n = 0; n < row; n++) {\n        printf(\"%d\\n\", sz[n][j - n]);\n      }\n    }\n    int m;\n    for (i = 1; i < row; i++) {\n      for (m = 0; m < row - 1; m++) {\n        printf(\"%d\\n\", sz[i + m][col - m - 1]);\n        if (i + m == row - 1)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i <= row - 1; i++)\n\n  {\n    for (int s = 0; s <= col - 1; s++) {\n      cin >> a[i][s];\n    }\n    cout << endl;\n  }\n  int h = -1, l = 2;\n  cout << a[0][0] << endl;\n  for (int t = 1; t <= col - 1; t++) {\n\n    while (l > 0 && h < row - 1) {\n      h++;\n      l--;\n      cout << a[h][l] << endl;\n    }\n    l = t + 2;\n    h = -1;\n  }\n  int d = col, b = 0;\n  for (int j = 1; j <= row - 1; j++) {\n    while (d > 0 && b < row - 1) {\n      d--;\n      b++;\n      cout << a[b][d] << endl;\n    }\n    d = col;\n    b = j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int **a[100][100], i, j, col, row, k, xie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = (int **)malloc(10000);\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", a[i][j]);\n    }\n  }\n\n  xie = col + row - 1;\n  for (i = 0; i <= xie + 1; i++) {\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        if (j + k != i) {\n          continue;\n        } else\n          printf(\"%d\\n\", *a[j][k]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, *a[101], *h[101];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    h[i] = a[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++, a[i]++)\n      scanf(\"%d\", a[i]);\n  }\n  if (col == 1) {\n    for (i = 0; i < row; i++)\n      printf(\"%d\\n\", *h[i]);\n  } else {\n    for (i = 0; i < row; i++)\n      a[i] = h[i];\n    for (i = 0; i < row + col + 1; i++) {\n      for (j = 0; j <= i && j < row; j++) {\n        if (a[j] != h[j] + col) {\n          printf(\"%d\\n\", *a[j]);\n          a[j]++;\n        } else\n          continue;\n      }\n      if (a[j] == h[row - 1] + col - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, (*p)[100], i, j, k;\n  scanf(\"%d%d\", &y, &x);\n  p = (int(*)[100])malloc(100 * y * sizeof(int));\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      scanf(\"%d\", *(p + i) + j);\n  i = 0;\n  j = 0;\n  for (k = 0; k < x * y; k++) {\n    printf(\"%d\\n\", *(*(p + i) + j));\n    i++;\n    j--;\n    if (j < 0) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (i >= y) {\n      j = i + j + 1;\n      i = 0;\n    }\n    while (j >= x) {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6829", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100];\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j]; \n\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++) {\n      cout << *(*(a + j) + i - j) << endl; \n    }\n  }\n  for (i = 1; i < row; i++) \n  {\n    for (j = col - 1; j >= 0 && i + col - 1 - j < row; j--) {\n      cout << *(*(a + i + col - 1 - j) + j) << endl;\n    }\n  }\n  return 0; \n}\n"}
{"label": "4", "index": "6830", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[101][101];\n  int row, col, i, j, k;\n  int(*p)[101] = array; \n  cin >> row >> col;\n  for (i = 0; i < row; i++)   \n    for (j = 0; j < col; j++) \n    {\n      cin >> array[i][j]; \n    }\n  cout << *(*(p + 0) + 0) << endl;\n  for (i = 1; i < col; i++)                    \n    for (k = i, j = 0; k >= 0 && j < row; k--) \n    {\n      cout << *(*(p + j) + k) << endl; \n      if (k - 1 >= 0)\n        j++; \n    }\n  for (i = 1; i < row; i++)                          \n    for (j = i, k = col - 1; k >= 0 && j < row; j++) \n    {\n      cout << *(*(p + j) + k) << endl; \n      if (j + 1 < row)\n        k--; \n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < i + 1; j++) {\n      if (j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[j][i - j]);\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (i + j >= row) {\n        break;\n      } else {\n        cout << sz[i + j][col - j - 1] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint row, col;\nint array_1[101][101];\nint (*p)[101] = array_1;\nint f(int m, int n) {\n  int i;\n  if (m == row - 1 && n == col - 1) {\n    cout << *(*(p + m) + n);\n    return 0;\n  }\n  for (i = 0; m + i <= row - 1 && n - i >= 0; i++)\n    cout << *(*(p + m + i) + n - i) << \"\\n\";\n  if (n < col - 1)\n    return f(0, n + 1);\n  if (n >= col - 1)\n    return f(m + 1, col - 1);\n}\n\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array_1[i][j];\n  f(0, 0);\n  return 0;\n}\n"}
{"label": "4", "index": "6833", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[1500][1500], b[10000], i, j, sum, t = 0;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= 1499; i++)\n    for (j = 1; j <= 1499; j++)\n      a[i][j] = -198;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++) {\n      cin >> a[i][j];\n    }\n  for (sum = 2; sum <= (n + m); sum++) {\n    for (i = 1; i < sum; i++) {\n      if (a[i][sum - i] != -198)\n        cout << a[i][sum - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[102][102], row, col, t, k, i, j;\n  cin >> row >> col;\n  t = row + col - 2;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= t; k++) {\n    if (k + 1 <= col)\n      i = 0;\n    else\n      i = k - col + 1;\n    j = k - i;\n    while (j >= 0 && i < row) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint arr[100][100];\nint row, col;\nvoid bianli(int y, int x) \n{\n  for (; y <= row && x > 0; y++, x--) {\n    cout << *(*(arr + y) + x) << endl;\n  }\n}\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(arr + i) + j);\n  for (int i = 1; i <= col; i++) \n    bianli(1, i);\n  for (int i = 2; i <= row; i++) \n    bianli(i, col);\n  return 0;\n}\n"}
{"label": "4", "index": "6836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, time = 0, n, i, j;\n  int array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (n = 0; n < row + col; n++) {\n    if (col < row) {\n      if (n < col) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < row) {\n        for (i = col - 1; i >= 0; i--)\n          printf(\"%d \", array[n - i][i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row < col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else if (n < col) {\n        for (i = 0; i <= row - 1; i++)\n          printf(\"%d \", array[i][n - i]);\n      } else {\n        for (i = col - 1; i > n - row; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    } else if (row == col) {\n      if (n < row) {\n        for (i = 0; i <= n; i++)\n          printf(\"%d \", array[i][n - i]);\n      }\n\n      else {\n        for (i = row - 1; i > n - col; i--)\n          printf(\"%d \", array[n - i][i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0, 0}, row, col, i, j, count = 0, r = 0;\n  cin >> row >> col;\n  if (col == 1)\n    r = 1;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  i = 1;\n  j = 1;\n  while (count < row * col) {\n    cout << a[i][j] << endl;\n    count++;\n    if ((j == 1 && i != row) || (j != 1 && i == row) || (j == 1 && i == row)) {\n      if (i + j < col) {\n        j = i + j;\n        i = 1;\n      } else {\n        r++;\n        i = r;\n        j = col;\n      }\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], b[10000], i, j, sum, t = 0;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d \", &a[i][j]);\n\n  for (sum = 2; sum <= (n + m); sum++) {\n\n    for (j = 1; j <= n; j++)\n\n    {\n      if ((sum - j) > 0 && (sum - j) <= m) {\n        t++;\n        b[t] = a[j][sum - j];\n      }\n    }\n  }\n\n  for (i = 1; i <= (m * n); i++)\n    cout << b[i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row && i - j >= 0; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < row - i && col - 1 - j >= 0; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, temp_i, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  for (i = 1; i < row; i++) {\n    temp_i = i;\n    for (j = col - 1; j >= 0 && temp_i < row; j--) {\n      printf(\"%d\\n\", a[temp_i][j]);\n      temp_i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], row, col, i;\n  scanf(\"%d %d\", &n, &m);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < m; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  if (n < m) {\n    for (i = 0; i < n; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = n; i < m; i++) {\n      for (row = 0; row < n; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  if (n >= m) {\n    for (i = 0; i < m; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n; i++) {\n      for (col = m - 1; col >= 0; col--) {\n        printf(\"%d\\n\", a[i - col][col]);\n      }\n    }\n    for (i = n; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--) {\n        printf(\"%d\\n\", a[i - col][col]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i = 0, j = 0, x = 0, y;\n  cin >> r >> c;\n  y = r + c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  while (x <= y) {\n    for (i = 0; i < r; i++)\n      for (j = 0; j < c; j++)\n        if (i + j == x)\n          cout << a[i][j] << \"\\n\";\n    x++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][100] = {0}, m, n, b[10000] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    k = i;\n    while (k != -1 && j < m) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    j = n - 1;\n    k = i;\n    while (k < m && a[k][j] != 0) {\n      printf(\"%d\\n\", a[k][j]);\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int hang, lie, a[100][100] = {0};\n  scanf(\"%d %d \", &hang, &lie);\n  int i, j, k;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (k = 0; k < (hang + lie - 1); k++) {\n    if (k < lie) {\n      for (i = 0; i < hang && (k - i) > -1; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    } else {\n      for (i = (k - lie + 1); i < hang && (k - i) > -1; i++)\n        printf(\"%d\\n\", *(*(a + i) + k - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6846", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, array[110][110] = {0}, i, j, p = 0, q = 0, sum, count = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  sum = row * col;\n  while (count != sum) {\n    if (q != 0 && p != row - 1) {\n      printf(\"%d\\n\", array[p][q]);\n      count++;\n      p++;\n      q--;\n      continue;\n    }\n    if (q == 0 && p != row - 1) {\n      printf(\"%d\\n\", array[p][q]);\n      count++;\n      if (q != col - 2) {\n        q = p + 1;\n        p = 0;\n        if (q > col - 1) {\n          p = q - col + 1;\n          q = col - 1;\n        }\n      } else if (q == col - 2) {\n        p = p - col + 2;\n        q = col - 1;\n      }\n      continue;\n    }\n    if (p == row - 1) {\n      cout << array[p][q] << endl;\n      count++;\n      q = p + q + 1;\n      p = 0;\n      if (q > col - 1) {\n        p = q - col + 1;\n        q = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (int k = 2; k <= row + col; k++)\n    for (int i = 1; i <= row; i++)\n      for (int j = 1; j <= col; j++) {\n        if (i + j == k)\n          cout << *(*(a + i) + j) << endl;\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, r, c, num, ro, co;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  r = 1;\n  c = 1;\n  while (1) {\n    ro = r;\n    co = c;\n    while (1) {\n      printf(\"%d\\n\", a[ro][co]);\n      ro++;\n      co--;\n      if (ro > row || co <= 0) {\n        break;\n      }\n    }\n    if (c == col && r == row) {\n      break;\n    }\n    if (c < col) {\n      c++;\n    } else {\n      r++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ROW, COL, j;\n  scanf(\"%d%d\", &ROW, &COL);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  if (ROW == COL) {\n    if (ROW == 1) {\n      printf(\"%d\\n\", sz[ROW - 1][COL - 1]);\n    } else {\n      for (col = 0; col < COL; col++) {\n        j = col;\n        row = 0;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (col > -1);\n        col = j;\n      }\n      for (row = 1; row < ROW; row++) {\n        j = row;\n        col = COL - 1;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (row < ROW);\n        row = j;\n      }\n    }\n  } else {\n    for (col = 0; col < COL - 1; col++) {\n      j = col;\n      row = 0;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((col > -1) && (row < ROW));\n      col = j;\n    }\n    for (row = 0; row < ROW; row++) {\n      j = row;\n      col = COL - 1;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((row < ROW) && (col > -1));\n      row = j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6850", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], ROW, COL, i = 0, k = 0, j = 0;\n  cin >> ROW >> COL;\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  int i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; ++i)\n    for (j = 0; j < col; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < col; ++i)\n    for (j = 0; (i - j >= 0) && (j < row); ++j)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < row; ++i)\n    for (j = 0; (j < col) && (i + j < row); ++j)\n      printf(\"%d\\n\", a[i + j][col - j - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6852", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[100][100];\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++)\n      cin >> num[i][j];\n  }\n  for (int k = 0; k < n + m - 1; k++) {\n    if (k < m) {\n      for (int i = 0; k >= i && i < n; i++)\n        printf(\"%d\\n\", num[i][k - i]);\n    } else {\n      for (int i = k - m + 1; i < n && k >= i; i++)\n        printf(\"%d\\n\", num[i][k - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6853", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i, j;\n  scanf(\"%d %d \", &r, &c);\n  for (i = 0; i <= r - 1; i++) {\n    for (j = 0; j <= c - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j <= c - 1; j++) {\n    for (i = 0; (i <= j) && (i <= r - 1); i++) {\n      cout << a[i][j - i] << endl;\n    }\n  }\n  for (i = 1; i <= r - 1; i++) {\n    for (j = 0; (j <= r - i - 1) && (j + 1 <= c); j++) {\n      cout << a[i + j][c - 1 - j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i <= row - 1; i++)\n\n  {\n    for (int s = 0; s <= col - 1; s++)\n      cin >> a[i][s];\n\n    cout << endl;\n  }\n  int h = -1, l = 2;\n  cout << a[0][0] << endl;\n  for (int t = 1; t <= col - 1; t++) {\n\n    while (l > 0 && h < row - 1) {\n      h++;\n      l--;\n      cout << a[h][l] << endl;\n    }\n    l = t + 2;\n    h = -1;\n  }\n  int d = col, b = 0;\n  for (int j = 1; j <= row - 1; j++) {\n    while (d > 0 && b < row - 1) {\n      d--;\n      b++;\n      cout << a[b][d] << endl;\n    }\n    d = col;\n    b = j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid bianli() {}\nint main() {\n  int i = 0, j = 0, row = 0, col = 0;\n  cin >> row >> col;\n  int a[row][col], *p = *a;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col; i++) {\n    p = *a + i;\n    j = i + 1;\n    while (j) {\n      cout << *p << \"\\n\";\n      p = p + col - 1;\n      if (j > row)\n        j = row - 1;\n      else\n        j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    p = *(a + i) + col - 1;\n    j = row - i;\n    while (j) {\n      printf(\"%d\\n\", *p);\n      p = p + col - 1;\n      if (j > col)\n        j = col - 1;\n      else\n        j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, x, sum, y, z;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  i = 0;\n  sum = 0;\n  j = 0;\n  x = 0;\n  y = 1;\n  z = 0;\n  if (col >= row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        if (j + row + 1 < col) {\n          j = j + row + 1;\n          i = 0;\n        } else if (j + row + 1 >= col) {\n          j = j + row - x;\n          i = 1 + x;\n          x++;\n        }\n      } else if (j < 0 && i < row) {\n        j = j + 1 + y;\n        i = 0;\n        y++;\n      }\n      if (sum == col * row)\n        break;\n    }\n  } else if (col < row) {\n    while (1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      sum++;\n      if (i >= row) {\n        j = col - 1;\n        i = i - col + 1 + x;\n        x++;\n      } else if (i < row && j < 0) {\n        if (j + 1 + y < col) {\n          j = j + 1 + y;\n          i = 0;\n          y++;\n        } else if (j + 1 + y >= col) {\n          j = col - 1;\n          i = z + 1;\n          z++;\n        }\n      }\n      if (sum == col * row)\n        break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[101][101];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(number + i) + j);\n    }\n  }\n  \n  int k;\n  for (i = 0; i < row + col - 1; i++) {\n    j = 0;\n    \n    for (j = 0; i - j >= 0; j++) {\n      if (j >= row || i - j >= col)\n        continue;\n      cout << *(*(number + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, a[101][101], *p1, *p2, *p3, j, k;\nint main() {\n  cin >> n >> m;\n  for (p1 = *a, j = 0; j < n; ++j, p1 += 101) {\n    for (p2 = p1, k = 0; k < m; ++k, ++p2)\n      cin >> *p2;\n  }\n  for (p2 = *a, j = 1; j <= m; ++j, ++p2)\n    for (p3 = p2, k = min(j, n); k--; p3 += 100)\n      cout << *p3 << endl;\n  for (p2 += 100, j = n - 1; j; --j, p2 += 101)\n    for (p3 = p2, k = min(m, j); k--; p3 += 100)\n      cout << *p3 << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, a[100][100], x = 0, y = 0, k = 0, l = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n\n  for (;;) {\n    cout << a[x][y] << \"\\n\";\n    if (x == n - 1 && y == m - 1)\n      break;\n    if (y == 0 || x == n - 1) {\n      if (l == m - 1)\n        k++;\n      else\n        l++;\n      x = k;\n      y = l;\n      continue;\n    }\n    x++;\n    y--;\n  }\n}\n"}
{"label": "4", "index": "6860", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i = 0, j = 0;\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (; i != (row - 1) || j != (col - 1);) {\n    printf(\"%d\\n\", *(*(a + i) + j));\n    i++;\n    j--;\n    if (j < 0 || i > row - 1) {\n      if (i + j + 1 < col) {\n        j = i + j + 1;\n        i = 0;\n      } else {\n        i = i + j + 1 - (col - 1);\n        j = col - 1;\n      }\n    }\n  }\n  printf(\"%d\", *(*(a + row - 1) + col - 1));\n  return 0;\n}\n"}
{"label": "4", "index": "6861", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, k[100][100];\nvoid display(int i, int j) {\n  if (i >= m || j >= n || i < 0 || j < 0) {\n    return;\n  } else {\n    printf(\"%d\\n\", k[i][j]);\n    display(i + 1, j - 1);\n  }\n}\nint main() {\n  int i = 0, j = 0;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &k[i][j]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    display(0, j);\n  }\n  for (i = 1; i < m; i++) {\n    display(i, n - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6862", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], f[200][200], n, m, i, j, flag, si, sj;\nint main() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  while (1) {\n    flag = 0;\n    for (i = 1; i <= m; i++)\n      if (f[1][i] == 0) {\n        flag = 1;\n        f[1][i] = 1;\n        break;\n      }\n    if (flag == 0)\n      for (i = 1; i <= n; i++)\n        if (f[i][m] == 0) {\n          flag = 2;\n          f[i][m] = 1;\n          break;\n        }\n    if (flag == 1) {\n      si = 1;\n      sj = i;\n    }\n    if (flag == 2) {\n      si = i;\n      sj = m;\n    }\n    if (flag == 0)\n      return 0;\n    for (; si <= n && sj >= 1; si++, sj--)\n      printf(\"%d\\n\", a[si][sj]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void paixu(int a[][100], int x, int y);\n  int i, j, a[100][100], col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  paixu(a, row, col);\n}\n\nvoid paixu(int a[][100], int x, int y) {\n  int sum = 0, i, j, k;\n  k = x + y;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < x && j < y)\n        printf(\"\\n%d\", a[i][j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "6864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= row + col - 2; n++) {\n    for (i = 0; i < row && i <= n; i++) {\n      for (j = 0; j < col && j <= n; j++) {\n        if (i + j == n)\n          cout << a[i][j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6865", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, z, i, sz[100][100], k;\n  cin >> h >> z;\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < z; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (i = 0; i <= h + z - 2; i++) {\n    for (k = 0; k < h; k++) {\n      if (i - k < 0 || i - k >= z)\n        continue;\n      else {\n        printf(\"%d\\n\", sz[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint ROW, COL;\nint row = -1, col = 1;\nint array_1[100][100];\nint move() {\n  row++;\n  col--;\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint big_move() {\n  if (row + col < COL - 1) {\n    col = row + col + 1;\n    row = 0;\n  } else {\n    row = row + col - COL + 2;\n    col = COL - 1;\n  }\n  cout << array_1[row][col] << \"\\n\";\n  return 0;\n}\nint main() {\n  scanf(\"%d%d\", &ROW, &COL);\n  int r, c;\n  for (r = 0; r < ROW; r++) {\n    for (c = 0; c < COL; c++) {\n      cin >> array_1[r][c];\n    }\n  }\n  if (ROW == 1 && COL == 1) {\n    printf(\"%d\", array_1[0][0]);\n    return 0;\n  }\n  while (row != ROW - 1 || col != COL - 1) {\n    while (col != 0 && row != ROW - 1)\n      move();\n    big_move();\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100], row, col, i, j, *p = NULL;\n  cin >> row >> col;\n  memset(array, 0, sizeof(array));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (i = 0; i < col; i++)\n    for (p = &array[0][i]; *p; p += 99)\n      cout << *p << endl;\n  for (i = 1; i < row; i++)\n    for (p = &array[i][col - 1]; *p; p += 99)\n      printf(\"%d\\n\", *p);\n  return 0;\n}\n"}
{"label": "4", "index": "6868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100], row, col;\n  int c, r, sum;\n  scanf(\"%d%d\", &row, &col);\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++)\n      scanf(\"%d\", &array[r][c]);\n  }\n\n  for (sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (c = sum; c >= 0; c--) {\n        if ((sum - c) >= row)\n          break;\n        printf(\"%d\\n\", array[sum - c][c]);\n      }\n    } else {\n      for (r = sum - col + 1; r < row; r++) {\n        if ((sum - r) < 0)\n          break;\n        printf(\"%d\\n\", array[r][sum - r]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j, k;\n  int min;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row > col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0, k = j; k >= 0; i++, k--)\n        cout << a[i][k] << endl;\n    }\n    for (i = 1; i < row - col + 1; i++) {\n      for (j = col - 1, k = i; j >= 0; j--, k++)\n        cout << a[k][j] << endl;\n    }\n    for (; i < row; i++) {\n      for (j = col - 1, k = i; k < row; k++, j--) {\n        printf(\"%d\\n\", a[k][j]);\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0, k = j; k >= 0; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (; j < col; j++) {\n      for (i = 0, k = j; i < row; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (k = i, j = col - 1; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6870", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[1000][1000], a[1000];\n  int row, col;\n  int i, j;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col + row; i++) {\n    if (i < col)\n      a[i] = 0;\n    else\n      a[i] = i - col + 1;\n  }\n\n  for (i = 0; i < col + row; i++)\n    for (j = a[i]; j < row && j <= i; j++)\n      printf(\"%d\\n\", array[j][i - j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "6871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], i, j, k, l, t;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cout << a[i][j] << endl;\n      }\n    }\n    return 0;\n  }\n  k = 0;\n  l = 0;\n  while (1) {\n    if (k < n && l < m)\n      printf(\"%d\\n\", a[k][l]);\n    if (l != 0) {\n      k++;\n      l--;\n      continue;\n    }\n    if (l == 0) {\n      t = k;\n      k = 0;\n      l = t + 1;\n    }\n    while (k >= n || l >= m) {\n      k++;\n      l--;\n      if (l == 0) {\n        t = k;\n        k = 0;\n        l = t + 1;\n      }\n      if (l + k == m + n) {\n        return 0;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6872", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int i, j, u, t = 0;\n  int row, col;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (u = 0;; u++) {\n      if (u >= row || j - u < 0)\n        break;\n      printf(\"%d\\n\", a[u][j - u]);\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (u = 1;; u++) {\n      if (u + j - 1 >= row || col - u < 0)\n        break;\n\n      printf(\"%d\\n\", a[u + j - 1][col - u]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int array[100][100] = {0};\n  int i, j, n;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (n = 0; n < row + col; n++) {\n    for (i = 0, j = n - 1; i < n, j >= 0; i++, j--) {\n      if (i < row && j < col) {\n        cout << array[i][j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p1[100], *p2, i, j, n, m, s;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    p1[i] = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &*(*(p1 + i) + j));\n  for (s = 0; s < n + m - 1; s++)\n    for (i = 0; i < n; i++) {\n      if (s - i < m)\n        printf(\"%d\\n\", *(*(p1 + i) + s - i));\n      if (s - i == 0 || i == n)\n        break;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m][n];\n  for (int c = 0; c < m; c++)\n    for (int d = 0; d < n; d++)\n      cin >> a[c][d];\n  int *p[m];\n  for (int j = 0; j < m; j++)\n    p[j] = a[j];\n  for (int k = 0; k <= m + n - 2; k++)\n    for (int c = 0; c < m; c++)\n      for (int d = 0; d < n; d++) {\n        if (c + d == k)\n          printf(\"%d\\n\", *(p[c] + d));\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[102][102], i, j, k;\n  int(*p)[102] = a;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      cout << *(*(p + i) + k) << endl;\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      cout << *(*(p + k) + j);\n      if (i != row - 1 || j != col - 1)\n        printf(\"\\n\");\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(a[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << *(a[j] + i - j) << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, zong, x, y, sum, i, zanshi;\n  int *c, *d;\n  scanf(\"%d %d\", &m, &n);\n  zong = m * n;\n  d = (int *)malloc(zong * sizeof(int));\n  c = d;\n  for (; c < d + zong; c++)\n    scanf(\"%d\", c);\n  for (sum = 2; sum <= m + n; sum++) {\n    for (y = 1; y < sum; y++) {\n      x = sum - y;\n      zanshi = n * (y - 1) + x;\n      if (x <= n && y <= m && zanshi >= 1 && zanshi <= zong)\n        printf(\"%d\\n\", *(d + zanshi - 1));\n    }\n  }\n}\n"}
{"label": "4", "index": "6879", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, q;\n  cin >> a >> b;\n  int m[a + 1][b + 1];\n  for (i = 1; i <= a; i++)\n    for (j = 1; j <= b; j++)\n      cin >> m[i][j];\n  for (q = 2; q <= a + b; q++)\n    for (i = 1, j = q - i; j > 0; i++, j = q - i) {\n      if (j <= b && i <= a)\n        cout << m[i][j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, x, y;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= col - 1; i++) {\n    x = 0;\n    y = i;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    x = i;\n    y = col - 1;\n    do {\n      printf(\"%d\\n\", a[x][y]);\n      x++;\n      y--;\n    } while ((y >= 0) && (x <= row - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (col >= row) {\n    for (j = 0; j <= row - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      for (i = 0; i <= row - 1; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      for (j = col - 1; j >= col + i - row; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  } else if (col < row) {\n    for (j = 0; j <= col - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - col - 1; i++) {\n      for (j = col - 1; j >= 0; j--) {\n        cout << a[i + col - j - 1][j] << endl;\n      }\n    }\n    for (i = row - col; i <= row - 1; i++) {\n      for (j = col - 1; j >= col - row + i; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int row, col;\n  int i, j;\n  int x;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n    for (i = 0; i < col - row - 1; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", a[j][row + i - j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row - i; j++) {\n        printf(\"%d\\n\", a[i + j][col - 1 - j]);\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n\n    for (i = 0; i < row - col - 1; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", a[i + j + 1][col - j - 1]);\n      }\n    }\n    if (row == col) {\n      x = 1;\n    } else {\n      x = 0;\n    }\n\n    for (i = x; i < col; i++) {\n      for (j = 0; j < col - i; j++) {\n        printf(\"%d\\n\", a[row - col + i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[110][110];\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++) {\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  for (i = 1; i < row; i++)\n    for (j = col - 1; j > i + col - 1 - row && j >= 0; j--) {\n      cout << *(*(a + i + col - j - 1) + j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, l, n, k, t;\n  int(*p)[100] = a;\n  int *q = a[0];\n  int row, column;\n  cin >> row >> column;\n  for (j = 0; j < row; j++) {\n    q = *(a + j);\n    for (l = 0; l < column; l++)\n      cin >> *(q + l);\n  }\n  for (i = 0; i <= row + column - 2; i++) {\n    for (k = 0; k < row; k++) {\n      for (t = 0; t < column; t++) {\n        if (k + t == i) {\n          cout << *(*(p + k) + t) << \"\\n\";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, min, **p, row, col;\n  scanf(\"%d%d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  min = row < col ? row : col;\n  for (k = 0; k < min; k++)\n    for (i = 0, j = k; i <= k; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  if (col == min)\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  else {\n    for (k = min; k < col; k++)\n      for (i = 0, j = k; i < row; i++, j--)\n        cout << *(*(p + i) + j) << \"\\n\";\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long t, m, r, l, i, x, j, a[1000][1000] = {0}, b[1000] = {0};\n  scanf(\"%ld %ld \", &r, &l);\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++) {\n      scanf(\"%ld\", &x);\n      a[i + j][b[i + j]] = x;\n      b[i + j]++;\n    }\n  i = i - 1;\n  j = j - 1;\n  for (t = 2; t <= i + j; t++) {\n    for (m = 0; m < b[t]; m++) {\n      cout << a[t][m] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, min, **p, row, col;\n  scanf(\"%d%d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  min = row < col ? row : col;\n  for (k = 0; k < min; k++)\n    for (i = 0, j = k; i <= k; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  if (col == min)\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  else {\n    for (k = min; k < col; k++)\n      for (i = 0, j = k; i < row; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  }\n}\n"}
{"label": "4", "index": "6888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, m, i, j;\n  cin >> n >> m;\n  int a[n][m];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  int *p = NULL;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = &a[0][0] + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        cout << *(p + (m - 1) * k) << endl;\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h, k, e, s, i, l;\n  scanf(\"%d%d\", &h, &l);\n  int juzhen[1000][1000];\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &(juzhen[i][k]));\n    }\n  }\n\n  for (s = 0; s < l; s++) {\n    k = s;\n    i = 0;\n    for (e = 0; e <= s; e++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (i == h) {\n        break;\n      }\n    }\n  }\n  for (e = 1; e < h; e++) {\n    i = e;\n    k = l - 1;\n    for (s = 0; s < (h - e); s++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n = 0;\n  int a[100 + 10][100 + 10] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  i = 0;\n  j = 0;\n  for (int begin = 0; begin < col; begin++) {\n    i = 0;\n    j = begin;\n    while (j >= 0 && i < row) {\n      cout << a[i++][j--] << endl;\n    }\n  }\n  for (int begin = 1; begin < row; begin++) {\n    i = begin, j = col - 1;\n    while (i < row && j >= 0)\n      cout << a[i++][j--] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6891", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k, n;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row - 1 || i - j > col - 1)\n        continue;\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[1000][1000], a[1000];\n  int row, col;\n  int i, j;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col + row; i++) {\n    if (i < col)\n      a[i] = 0;\n    else\n      a[i] = i - col + 1;\n  }\n\n  for (i = 0; i < col + row; i++)\n    for (j = a[i]; j < row && j <= i; j++)\n      cout << array[j][i - j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "6894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int array[m + 1][n + 1];\n  for (int i = 1; i <= m; ++i)\n    for (int t = 1; t <= n; ++t) {\n      cin >> array[i][t];\n    }\n  int sum = 1;\n  int x[3] = {0, 0, 1};\n  int y[3] = {0, 1, 0};\n  int dx = 1, dy = 1, k = 1;\n  int tx, ty;\n  while (sum <= m * n) {\n    int xx = dx, yy = dy;\n    for (;;) {\n      if (xx > m || yy < 1) {\n        break;\n      }\n      cout << array[xx][yy] << endl;\n      xx = xx + 1, yy = yy - 1;\n      sum++;\n    }\n    tx = dx + x[k], ty = dy + y[k];\n    if (ty > n) {\n      k++;\n      tx = dx + x[k], ty = dy + y[k];\n    }\n    dx = tx, dy = ty;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[120][120];\n  int row, col, i, j, sum;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  while (i < row && j < col) {\n    cout << array[i][j] << endl;\n    sum = i + j;\n    i++;\n    j--;\n    if (i == row || j == -1) {\n      sum = sum + 1;\n      if (i = row) {\n        i = 0;\n        j = sum - i;\n        if (j >= col) {\n          j = col - 1;\n          i = sum - j;\n        }\n      } else {\n        j = col - 1;\n        i = sum - j;\n        if (i < 0) {\n          i = 0;\n          j = sum - i;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (col >= row) {\n    for (j = 0; j <= row - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      for (i = 0; i <= row - 1; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      for (j = col - 1; j >= col + i - row; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  } else if (col < row) {\n    for (j = 0; j <= col - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - col - 1; i++) {\n      for (j = col - 1; j >= 0; j--) {\n        cout << a[i + col - j - 1][j] << endl;\n      }\n    }\n    for (i = row - col; i <= row - 1; i++) {\n      for (j = col - 1; j >= col - row + i; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int **a[100][100], i, j, col, row, k, xie;\n  cin >> row >> col;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = (int **)malloc(10000);\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", a[i][j]);\n    }\n  }\n\n  xie = col + row - 1;\n  for (i = 0; i <= xie + 1; i++) {\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        if (j + k != i) {\n          continue;\n        } else\n          cout << *a[j][k] << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[row * col];\n  for (int i = 0; i < row * col; ++i) {\n    cin >> data[i];\n  }\n  int *head = data;\n  for (int i = 0; i < col; ++i) {\n    int *p = head;\n    for (int j = 0; j <= min(i, row - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n    ++head;\n  }\n  --head;\n  for (int i = 1; i < row; ++i) {\n    head += col;\n    int *p = head;\n    for (int j = 0; j <= min(col - 1, row - i - 1); ++j) {\n      cout << *p << endl;\n      p += col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6899", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = 0; i < row && (j - k) >= 0; i++, k++)\n      cout << a[i][j - k] << endl;\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = 0; j >= 0 && (i + k) < row; j--, k++)\n      printf(\"%d\\n\", a[i + k][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (j = 0; j < col; j++) {\n    int t = 0;\n    int k = j;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int t = i;\n    int k = col - 1;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6901", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint row = 0, col = 0;\nvoid Input(int (*array)[105]) {\n  cin >> row >> col;\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n}\nvoid Diagonal(int (*array)[105], int x, int y) {\n  for (int i = 0;; i++) {\n    if (x + i > row - 1 || y - i < 0)\n      break;\n    else {\n      if (x == 0 && y == 0) {\n        cout << **array;\n      } else {\n        cout << endl << *(*(array + x + i) + y - i);\n      }\n    }\n  }\n  return;\n}\nvoid Scan(int (*array)[105], int x, int y) {\n  Diagonal(array, x, y);\n  if (y < col - 1)\n    Scan(array, x, y + 1);\n  else if (x < row - 1)\n    Scan(array, x + 1, y);\n  else\n    return;\n}\nint main() {\n  int a[105][105];\n  Input(a);\n  Scan(a, 0, 0);\n}\n"}
{"label": "4", "index": "6902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (int k = 2; k <= row + col; k++)\n    for (int i = 1; i <= row; i++)\n      for (int j = 1; j <= col; j++)\n        if (i + j == k)\n          cout << *(*(a + i) + j) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6903", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c;\n  cin >> r >> c;\n  int a[r][c];\n  for (int i = 0; i < r; i++)\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (int k = 0; k < r + c - 1; k++) {\n    if (k < c) {\n      for (int i = 0; i < r && k - i >= 0; i++)\n        cout << *(*(a + i) + k - i) << endl;\n    } else {\n      for (int i = c - 1; i >= 0 && k - i < r; i--)\n        printf(\"%d\\n\", *(*(a + k - i) + i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *p[100][100];\n  int n, i, j, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      *(*(p + i) + j) = (int *)malloc(1000);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", *(*(p + i) + j));\n  \n  for (j = 1; j <= col; j++) {\n    int h = 1, l = j;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    int l = col, h = i;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6905", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int q, m, n, a[100][100] = {0}, i, j;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= m + n - 2; i++) {\n    for (j = 0; i - j >= 0; j++) {\n      if (j < m && i - j < n)\n        cout << a[j][i - j] << endl;\n    }\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "4", "index": "6906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, (*p)[100], i, j, k;\n  scanf(\"%d%d\", &y, &x);\n  p = (int(*)[100])malloc(100 * y * sizeof(int));\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      scanf(\"%d\", *(p + i) + j);\n  i = 0;\n  j = 0;\n  for (k = 0; k < x * y; k++) {\n    cout << *(*(p + i) + j) << \"\\n\";\n    i++;\n    j--;\n    if (j < 0) {\n      j = i + j + 1;\n      i = 0;\n    }\n    if (i >= y) {\n      j = i + j + 1;\n      i = 0;\n    }\n    while (j >= x) {\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "6907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n;\n  int i, j, r, s, p, k;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (r = 0; r < n; r++) {\n    p = r;\n    for (s = 0; p >= 0; s++) {\n      if (s < m)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  for (k = n; k <= m + n - 2; k++) {\n    p = n - 1;\n    for (s = k - n + 1; s < m; s++) {\n      if (p >= 0)\n        cout << a[s][p] << \"\\n\";\n      p--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6908", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint num[101][101];\nint main(void) {\n  int i = 0, j = 1, k = 1, x, y, row, col, n = 1;\n  scanf(\"%d%d\", &row, &col);\n  for (x = 0; x <= row - 1; x++)\n    for (y = 0; y <= col - 1; y++)\n      cin >> num[x][y];\n  printf(\"%d\\n\", num[0][0]);\n  while (n < row * col) {\n    int flag = 0;\n    while (j >= 0 && i <= row - 1 && j <= col - 1) {\n      printf(\"%d\\n\", num[i][j]);\n      i++;\n      j--;\n      n++;\n      flag = 1;\n    }\n    if (flag == 1)\n      k++;\n    if (k <= col - 1) {\n      i = 0;\n      j = k;\n    } else {\n      i = k - col + 1;\n      j = col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, m, e, cishu, sz[100][100];\n  e = 0;\n  n = 0;\n  cishu = 0;\n  cin >> row >> col;\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  if (row > 1 && col > 1) {\n    for (i = 0, j = 0;; i++, j--) {\n      if (i == 0) {\n        m = j;\n      }\n      cout << sz[i][j] << \"\\n\";\n      cishu++;\n      if (cishu == row * col) {\n        break;\n      }\n      if ((j == 0 || i == row - 1) && e == 0) {\n        i = -1;\n        j = m + 2;\n        if (j == col) {\n          e = 1;\n        }\n      }\n      if ((j == 0 || i == row - 1) && e == 1) {\n        j = col;\n        n++;\n        i = n - 1;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0; i < col; i++) {\n        cout << sz[j][i] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, m, i, j, shu[100][100], hang = 1, lie = 1, count, duijiao, jh = 1,\n                                 jl = 1;\n  cin >> n >> m;\n  count = n * m;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= m; j++) {\n      scanf(\"%d \", &shu[i][j]);\n    }\n  }\n  if (n == 1) {\n    for (j = 1; j <= m; j++) {\n      cout << shu[1][j] << endl;\n    }\n  }\n  if (n == 1) {\n    return 0;\n  }\n  if (m == 1) {\n    for (j = 1; j <= n; j++) {\n      cout << shu[j][1] << endl;\n    }\n    return 0;\n  }\n  if (m == 1) {\n    return 0;\n  }\n  cout << shu[hang][lie] << endl;\n  duijiao = hang + lie;\n  count--;\n  while (count != 0) {\n    duijiao++;\n    hang = jh;\n    lie = duijiao - hang;\n    if (lie == m) {\n      jh++;\n    }\n    while (lie >= jl) {\n      cout << shu[hang][lie] << endl;\n      count--;\n      hang++;\n      lie--;\n    }\n    if (hang == n + 1) {\n      jl++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6911", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint row, col;\nint main() {\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 2; i <= row + col; i++)\n    for (int j = max(1, i - col); j <= min(row, i - 1); j++)\n      cout << *(*(a + j) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, a[101][101], t;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= row + col - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row && (i - j) < col)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  scanf(\"%d\", &t);\n}\n"}
{"label": "4", "index": "6913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j;\n  int c[100][100];\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &c[i][j]);\n  for (i = 0; i < b; i++) {\n    for (j = 0; j <= i && j < a; j++)\n      cout << c[j][i - j] << \" \";\n  }\n  for (i = b; i < a + b - 1; i++) {\n    for (j = i + 1 - b; j < a && j <= i; j++)\n      printf(\"%d \", c[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[201][201];\nint main() {\n  int n, m;\n  cin >> n >> m;\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      cin >> *(*(a + i) + j);\n  for (int s = 0; s < n + m - 1; s++)\n    for (int i = 0; i <= s; i++)\n      if (a[i][s - i] != 0)\n        printf(\"%d\\n\", a[i][s - i]);\n  return 0;\n}\n"}
{"label": "4", "index": "6915", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row = 0, col = 0, array[100][100];\n  int i = 0, j = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    j = 0;\n    while (j <= i && j < row) {\n      printf(\"%d\\n\", array[j][i - j]);\n      j++;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = 0;\n    while (j <= row - i - 1 && j < col) {\n      printf(\"%d\\n\", array[i + j][col - 1 - j]);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int row, col;\n  int i, j;\n  int x;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n    for (i = 0; i < col - row - 1; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", a[j][row + i - j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row - i; j++) {\n        printf(\"%d\\n\", a[i + j][col - 1 - j]);\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n\n    for (i = 0; i < row - col - 1; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", a[i + j + 1][col - j - 1]);\n      }\n    }\n    if (row == col) {\n      x = 1;\n    } else {\n      x = 0;\n    }\n\n    for (i = x; i < col; i++) {\n      for (j = 0; j < col - i; j++) {\n        printf(\"%d\\n\", a[row - col + i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < row + col - 1; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k && k - i >= 0)\n          printf(\"%d\\n\", a[i][k - i]);\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "6918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0, k = 0;\n  int str[100][100] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &str[i][j]);\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0; i++, j--) {\n      if (str[i][j] == 0)\n        break;\n      else\n        cout << str[i][j] << \"\\n\";\n    }\n  i = 0;\n  k = 0;\n  j = 0;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", str[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, row, col, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < row; j++) {\n      if (i - j >= col || i - j < 0)\n        continue;\n      cout << *(*(a + j) + i - j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, *p[100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    p[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = i; j >= 0; j--) {\n      if (i - j >= row || j >= col)\n        continue;\n      else\n        cout << *(p[i - j] + j) << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, (*a)[100];\n  a = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++) {\n      cout << *(*(a + i) + k - i) << \"\\n\";\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      cout << *(*(a + k + i) + col - 1 - i) << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "6922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int u[100][100], i, j, k, row, col, m, Col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &u[i][j]);\n    }\n  }\n  printf(\"%d\\n\", u[0][0]);\n  for (k = 1; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if (k > col - 1) {\n        break;\n      }\n      if (k - j > row - 1) {\n        break;\n      }\n\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n\n  for (k = col; k < col + row - 2; k++) {\n    for (j = col - 1; j >= 0; j--) {\n\n      if (k - j > row - 1) {\n        break;\n      }\n      printf(\"%d\\n\", u[k - j][j]);\n    }\n  }\n  if (row == 1) {\n    ;\n  } else {\n    printf(\"%d\\n\", u[row - 1][col - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, k = 0, temp = 0;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      printf(\"%d\\n\", array[i][k - i]);\n    }\n  for (k = col; k <= (col - 1) + (row - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      printf(\"%d\\n\", array[i][k - i]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int **a[100][100], i, j, col, row, k, xie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = (int **)malloc(10000);\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", a[i][j]);\n    }\n  }\n\n  xie = col + row - 1;\n  for (i = 0; i <= xie + 1; i++) {\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        if (j + k != i) {\n          continue;\n        } else {\n          printf(\"%d\\n\", *a[j][k]);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, shuzu[100][100], n = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n  if (row == col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row > col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((col - 1 - j) == 0) {\n          break;\n        }\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0};\n  int i, j, rs, re, cs, ce, s;\n\n  cin >> r >> c;\n\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (rs = 0, cs = 0, re = 0, ce = 0; (re + ce) < (r + c);) {\n    for (i = rs, j = cs; i <= re && j >= ce; i++, j--) {\n      printf(\"%d\\n\", a[i][j]);\n    }\n    if (cs < (c - 1))\n      cs++;\n    else\n      rs++;\n    if (re < (r - 1)) {\n      re++;\n    } else {\n      ce++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      cout << a[j][i - j] << endl;\n}\n"}
{"label": "4", "index": "6928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0}, i, j, m, n = 1;\n  cin >> r >> c;\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++)\n      cin >> a[i][j];\n  }\n  for (i = 1; i < c; i++) {\n    m = i;\n    n = 1;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    m = c;\n    n = i;\n    while ((m >= 1) && (n <= r)) {\n      printf(\"%d\\n\", a[n][m]);\n      m--;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nvoid out1(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < col; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row - col; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << \"\\n\";\n    for (int j = 1; j < col; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row - col; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nvoid out2(int row, int col) {\n  int *p;\n  for (int i = 0; i < row; i++) {\n    p = array_1[i];\n    cin >> *p;\n    for (int j = 1; j < col; j++)\n      cin >> *++p;\n  }\n  for (int i = 0; i < row; i++) {\n    p = &array_1[0][i];\n    cout << *p << endl;\n    for (int j = 1; j <= i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = row; i < col; i++) {\n    p = array_1[0];\n    p = p + i;\n    cout << *p << endl;\n    for (int j = 1; j < row; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    p = array_1[i];\n    p = p + col - 1;\n    cout << *p << endl;\n    for (int j = 1; j < row - i; j++) {\n      p = p + 99;\n      cout << *p << endl;\n    }\n  }\n}\nint main() {\n  int row, col;\n  cin >> row >> col;\n  if (row > col)\n    out1(row, col);\n  else\n    out2(row, col);\n  return 0;\n}\n"}
{"label": "4", "index": "6930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, m, sz[100][100], row, col, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (a = 0; a < row; a++) {\n    for (b = 0; b < col; b++) {\n      scanf(\"%d\", &sz[a][b]);\n    }\n  }\n  if (row >= col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < (row + col - 1); k++) {\n      m = k - col + 1;\n      for (i = 0; (i < (row - m) && i <= (k - m)); i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  } else {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", sz[i][k - i]);\n      }\n    }\n    for (k = col; k < row + col - 1; k++) {\n      m = k - col + 1;\n      for (i = 0; i < row - m; i++) {\n        printf(\"%d\\n\", sz[i + m][k - i - m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a, b, k, p;\n  int array[102][102];\n  cin >> a >> b;\n  for (i = 0; i < a; i++)\n    for (j = 0; j < b; j++)\n      cin >> array[i][j];\n\n  if (a >= b) {\n    for (j = 0; j < b; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i <= a - b; i++)\n      for (p = i, j = b - 1; j >= 0; p++, j--)\n        cout << array[p][j] << endl;\n    for (i = a - b + 1; i < a; i++)\n      for (p = i, j = b - 1; p < a; p++, j--)\n        printf(\"%d\\n\", array[p][j]);\n  } else {\n    for (j = 0; j < a; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (j = a; j < b; j++)\n      for (k = j, i = 0; i < a; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i < a; i++)\n      for (j = b - 1, p = i; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6932", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "6933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int m = 1, n = 1;\n  int h, g;\n  int a[100][100];\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> a[i][j];\n  while (m <= row) {\n    h = m;\n    g = n;\n    while (h <= row && g >= 1) {\n      printf(\"%d\\n\", a[h][g]);\n      h++;\n      g--;\n    }\n    if (n < col)\n      n++;\n    else\n      m++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[150][150];\n  cin >> row >> col;              \n  for (int i = 0; i < row; i++) { \n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) { \n    if (sum < col) {                               \n      for (int i = 0; i < row && i <= sum; i++) {  \n        cout << *(*(a + i) + (sum - i)) << endl;\n      }\n    } else { \n      for (int i = sum - col + 1; sum - i >= 0 && i < row;\n           i++) { \n        cout << *(*(a + i) + (sum - i)) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i != m; i++) {\n    for (int j = 0; j != n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i != n; i++) {\n    for (int j = 0;; j++) {\n      if (j == m || i - j < 0)\n        break;\n      cout << a[j][i - j] << endl;\n    }\n  }\n  for (int i = 1; i != m; i++) {\n    for (int j = 0;; j++) {\n      if (i + j == m || n - 1 - j < 0)\n        break;\n      cout << a[i + j][n - 1 - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, a[100][100], n, t;\n  scanf(\"%d%d\", &row, &col);\n  n = row + col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (i = 0; i <= t; i++) {\n      if (i < row && (t - i) < col)\n        cout << a[i][t - i] << \"\\n\";\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      cout << a[i][j] << \"\\n\";\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6938", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, s, sz[100][100], R, C;\n  cin >> R >> C;\n  for (s = 0; s < R; s++) {\n    printf(\"\\n\");\n    for (r = 0; r < C; r++)\n      scanf(\"%d\", &sz[s][r]);\n  }\n  for (s = 0; s < C + R - 1; s++) {\n    for (r = 0; r <= s; r++) {\n      if (s - r >= C)\n        continue;\n      if (r >= R)\n        break;\n      printf(\"%d\\n\", sz[r][s - r]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[110][110];\nint main() {\n  int n, m;\n  cin >> n >> m;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++) {\n      cin >> map_1[i][j];\n    }\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = i; j >= 0; j--) {\n      int k = i - j;\n      if (k >= 0 && k < n && j < m) {\n        cout << map_1[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int shuzu[100][100];\n  int i, j, k, n, row, col, shuru;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuru);\n      shuzu[i][j] = shuru;\n    }\n  }\n  for (k = 0; k <= row + col - 2; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          printf(\"%d\\n\", shuzu[i][j]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, f[100][100], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> f[i][j];\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++) {\n      printf(\"%d\", f[i][j - i]);\n      printf(\"\\n\");\n    }\n  }\n  for (j = 1; j < row; j++) {\n    for (i = j; i < row && i <= j + col - 1; i++) {\n      printf(\"%d\", f[i][col - 1 + j - i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int col, row = 0;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  printf(\"%d\\n\", **array);\n  if (row == 1 && col == 1)\n    return 0;\n  if (col == 1) {\n    for (int i = 1; i < row; i++)\n      printf(\"%d\\n\", **(array + i));\n    return 0;\n  }\n  int r = 0, l = 1;\n  int begl = 1, begr = 0;\n  while (r != row - 1 || l != col - 1) {\n    cout << *(*(array + r) + l) << endl;\n    r++;\n    l--;\n    if (l < 0 || r == row) {\n      begl++;\n      if (begl == col) {\n        begl--;\n        begr++;\n      }\n      l = begl;\n      r = begr;\n    }\n  }\n  printf(\"%d\\n\", *(*(array + r) + l));\n\n  return 0;\n}\n"}
{"label": "4", "index": "6943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int count;\n  int i, j;\n\n  int array[100][100];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      cin >> array[i][j];\n\n  int x = 0, y = 0;\n\n  for (count = 1; count <= col; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    y = y + 1;\n  }\n\n  x = 1;\n  y = col - 1;\n  for (count = 2; count <= row; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      cout << array[i][j] << \"\\n\";\n    }\n\n    x = x + 1;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[110][110] = {0};\n  scanf(\"%d%d\", &row, &col);\n  getchar();\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j >= row || (i - j) >= col)\n        continue;\n      cout << array[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int shuzu[100][100];\n  int i, j, k, n, row, col, shuru;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> shuru;\n      shuzu[i][j] = shuru;\n    }\n  }\n  for (k = 0; k <= row + col - 2; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", shuzu[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int row, col;\n  int i, j;\n  int x;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n    for (i = 0; i < col - row - 1; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", a[j][row + i - j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row - i; j++) {\n        printf(\"%d\\n\", a[i + j][col - 1 - j]);\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n\n    for (i = 0; i < row - col - 1; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", a[i + j + 1][col - j - 1]);\n      }\n    }\n    if (row == col) {\n      x = 1;\n    } else {\n      x = 0;\n    }\n\n    for (i = x; i < col; i++) {\n      for (j = 0; j < col - i; j++) {\n        printf(\"%d\\n\", a[row - col + i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6947", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i, j;\n  scanf(\"%d %d \", &r, &c);\n  for (i = 0; i <= r - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      cin >> a[i][j];\n  }\n  for (j = 0; j <= c - 1; j++) {\n    for (i = 0; (i <= j) && (i <= r - 1); i++) {\n      cout << a[i][j - i] << endl;\n    }\n  }\n  for (i = 1; i <= r - 1; i++) {\n    for (j = 0; (j <= r - i - 1) && (j + 1 <= c); j++)\n      cout << a[i + j][c - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int row, col;\n  int matrix[100 * 100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", matrix + i * 100 + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0 && k < row; j--, k++) {\n      printf(\"%d\\n\", *(matrix + k * 100 + j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; j >= 0 && k < row; j--, k++) {\n      cout << *(matrix + k * 100 + j) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, line, rownow, linenow, n, i, j, a[10000];\n  scanf(\"%d %d\", &row, &line);\n  for (j = 0; j <= row * line - 1; j++)\n    cin >> a[j];\n\n  for (i = 0; i <= row + line - 1; i++) {\n    rownow = 0;\n    linenow = i - rownow;\n    for (; rownow <= row - 1 && linenow >= 0; rownow++, linenow--) {\n      if (linenow >= line)\n        continue;\n      n = rownow * line + linenow;\n      printf(\"%d\\n\", a[n]);\n    }\n  }\n  cin >> j;\n  return 0;\n}\n"}
{"label": "4", "index": "6950", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y;\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  int n;\n  n = row + col - 2;\n  for (int i = 0; i < col; i++) {\n    for (x = 0, y = i - x; x >= 0 && y >= 0 && x < row && y < col; x++, y--) {\n\n      cout << a[x][y] << endl;\n    }\n  }\n  for (int j = col; j <= n; j++) {\n    for (y = col - 1, x = j - y; x >= 0 && y >= 0 && x < row && y < col;\n         y--, x++) {\n      cout << a[x][y] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint row, col, Mat[111][111];\n\nvoid Out(int i, int j) {\n  cout << *(*(Mat + i) + j) << endl;\n  if (i == row - 1 || j == 0)\n    return;\n  else\n    Out(i + 1, j - 1);\n}\n\nint main() {\n  scanf(\"%d %d \", &row, &col);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(Mat + i) + j);\n\n  for (int i = 0; i < col; i++) {\n    Out(0, i);\n  }\n\n  for (int i = 1; i < row; i++)\n    Out(i, col - 1);\n}\n"}
{"label": "4", "index": "6952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int t, i, j, a, ROW, COL;\n  cin >> ROW >> COL;\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (t = 0; t < ROW + COL - 1; t++) {\n    if (ROW - 1 >= t) {\n      a = t;\n    } else {\n      a = ROW - 1;\n    }\n    i = 0;\n    while (i < a + 1) {\n      if (i < t - COL + 1) {\n        i = t - COL + 1;\n      }\n      j = t - i;\n      printf(\"%d\\n\", sz[i][j]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, n, j, i, k, *hi, col, row, s, max;\n  scanf(\"%d %d\", &row, &col);\n  s = row * col;\n  int *p = (int *)malloc(10000 * sizeof(int));\n  hi = p;\n  if (col > row)\n    max = col;\n  else\n    max = row;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", p + i);\n  for (j = 0; j < col + row; j++)\n    for (k = 0; k <= j; k++)\n      if (j - k < col && k < row)\n        cout << *(hi + j - k + col * k) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int *p = a[0];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> *(p + i * n + j);\n    }\n  for (int i = 0; i < m + n - 1; i++) {\n    int flag = 1;\n    int x = 0;\n    int y = i;\n    while (flag == 1) {\n      if (y < n && x >= 0)\n        printf(\"%d\\n\", *(p + x * n + y));\n      x++;\n      y--;\n      if (y < 0 || x > m - 1)\n        flag = 0;\n    }\n  }\n}\n"}
{"label": "4", "index": "6955", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i != m; i++) {\n    for (int j = 0; j != n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i != n; i++) {\n    for (int j = 0;; j++) {\n      if (j == m || i - j < 0)\n        break;\n      cout << a[j][i - j] << endl;\n    }\n  }\n  for (int i = 1; i != m; i++) {\n    for (int j = 0;; j++) {\n      if (i + j == m || n - 1 - j < 0)\n        break;\n      cout << a[i + j][n - 1 - j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0, k <= i; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      cout << a[k][j] << \"\\n\";\n    }\n  }\n  for (i = 1; i <= row - 1; i++)\n    for (j = col - 1, k = i; j >= 0, k <= row - 1; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "6957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < (2 * col - 1); b++) {\n      for (int i = (b - col + 1); i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n  }\n  if (row > col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < row; b++) {\n      for (int j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[b - j][j]);\n      }\n    }\n    for (int c = row; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--)\n        printf(\"%d\\n\", array[c - j][j]);\n    }\n  }\n  if (row < col) {\n    for (int a = 0; a < row; a++) {\n      for (int j = a; j >= 0; j--) {\n        cout << array[a - j][j] << \"\\n\";\n      }\n    }\n    for (int b = row; b < col; b++) {\n      for (int i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n    for (int c = col; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, n, j, i, k, *hi, col, row, s, max;\n  scanf(\"%d %d\", &row, &col);\n  s = row * col;\n  int *p = (int *)malloc(10000 * sizeof(int));\n  hi = p;\n  if (col > row)\n    max = col;\n  else\n    max = row;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", p + i);\n  for (j = 0; j < col + row; j++)\n    for (k = 0; k <= j; k++)\n      if (j - k < col && k < row)\n        printf(\"%d\\n\", *(hi + j - k + col * k));\n  return 0;\n}\n"}
{"label": "4", "index": "6959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  int **a;\n  a = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    a[i] = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  int len;\n  for (len = 0; len < row + col - 1; len++) {\n    for (i = 0; i < row; i++) {\n      j = len - i;\n      if ((j < col) && (j >= 0))\n        printf(\"%d\\n\", *(*(a + i) + len - i));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; ++i)\n    for (j = 0; j < col; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < col; ++i)\n    for (j = 0; (i - j >= 0) && (j < row); ++j)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < row; ++i)\n    for (j = 0; (j < col) && (i + j < row); ++j)\n      cout << a[i + j][col - j - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "6961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[100][100], l;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n  l = n + m;\n  for (i = 0; i <= l; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < n && (i - j) < m)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "6962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 100;\n\nint main() {\n  int line, row;\n  int num[maxn][maxn];\n  cin >> line >> row;\n\n  int nowline, nowrow;\n  int step;\n  int i, j;\n  for (i = 0; i != line; i++)\n    for (j = 0; j != row; j++)\n      cin >> num[i][j];\n  for (step = 0; step != line + row - 1; step++) {\n    nowline = (step >= row ? step - row + 1 : 0);\n    nowrow = (step >= row ? row - 1 : step);\n    while (nowline != line && nowrow != -1) {\n      cout << num[nowline][nowrow] << endl;\n      nowline++;\n      nowrow--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    if (i >= col) {\n      for (j = col - 1; j >= i - row + 1 && j >= 0; j--) {\n        cout << a[i - j][j] << \"\\n\";\n      }\n    } else {\n      for (j = i; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", a[i - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 2; k <= row + col; k++) {\n    if (k <= col + 1) {\n      for (j = k - 1; j >= 1 && k - j <= row; j--)\n        printf(\"%d\\n\", a[k - j][j]);\n    }\n    if (k > col + 1) {\n      for (j = col; j >= 1 && k - j <= row; j--) {\n        printf(\"%d\\n\", a[k - j][j]);\n      }\n    }\n  }\n  scanf(\"%d\", &row);\n  return 0;\n}\n"}
{"label": "4", "index": "6965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, l, s[100][100], m, a;\n  scanf(\"%d%d\", &n, &l);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  if (n >= l) {\n    for (m = 0; m < l; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = l; m < n; m++) {\n      for (i = m + 1 - l; i <= m; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < n + l - 1; m++) {\n      for (i = m + 1 - l; i < n; i++) {\n        k = m - i;\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  } else {\n    for (m = 0; m < n; m++) {\n      for (i = 0, k = m; i < n, k >= 0; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (m = n; m < l; m++) {\n      for (i = 0, k = m; i<n, k> m - n; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n    for (a = 1; a < n; a++) {\n      for (i = a, k = l - 1; i < n, k >= l - n + a; i++, k--) {\n        printf(\"%d\\n\", s[i][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6966", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[100][100], l, h, i, j, hang, lie;\n  scanf(\"%d%d\", &lie, &hang);\n  for (l = 0; l < lie; l++) {\n    for (h = 0; h < hang; h++) {\n      cin >> s[h][l];\n    }\n  }\n  for (i = 0; i < hang + lie - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      if (j > hang - 1) {\n        j = hang - 1;\n      }\n      h = j;\n      l = i - h;\n      if (l > lie - 1) {\n        break;\n      }\n      printf(\"%d\\n\", s[h][l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, array[110][110] = {0};\n  scanf(\"%d%d\", &row, &col);\n  getchar();\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i <= col + row - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j >= row || (i - j) >= col)\n        continue;\n      printf(\"%d\\n\", array[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, i, j, m, t, p;\n  int a[100][100];\n  scanf(\"%d%d\", &b, &c);\n  for (i = 0; i <= b - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (m = 0; m <= b + c - 2; m++) {\n    if (m < b && m < c) {\n      for (i = 0; i <= m; i++)\n        printf(\"%d\\n\", a[i][m - i]);\n    } else if (m >= b && m >= c) {\n      for (i = m - c + 1; i <= b - 1; i++)\n        printf(\"%d\\n\", a[i][m - i]);\n    } else {\n      if (b < c) {\n        for (i = 0; i <= b - 1; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n\n      } else {\n        for (i = m - c + 1; i <= m; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, u;\n  int a[101][101];\n  int r, c;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  u = 0;\n  for (i = 0; (i < r) && (u != c); i++) {\n    if ((i == 0) && (j == 0)) {\n      printf(\"%d\", a[i][j]);\n    } else {\n      printf(\"\\n%d\", a[i][j]);\n    }\n    if ((i != r - 1) && (j != 0)) {\n      j--;\n    } else {\n      u++;\n      j = u;\n      i = -1;\n    }\n  }\n  i = 1;\n  u = 1;\n  for (j = c - 1; (j >= 0) && (u < r); j--) {\n\n    printf(\"\\n%d\", a[i][j]);\n\n    if ((j != 0) && (i != r - 1)) {\n      i++;\n    } else {\n      u++;\n      i = u;\n      j = c;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6970", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[1000][1000];\nint main() {\n  int r, c, i, j, n;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (n = 0; n <= c + r - 2; n++) {\n    for (i = 0; i <= n && i < r; i++) {\n      j = n - i;\n      if (j < c) {\n        printf(\"%d \", a[i][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, **p, num;\n  int i, j, k;\n  scanf(\"%d %d\", &row, &col);\n  num = row * col;\n  p = (int **)malloc(row * sizeof(int));\n  for (i = 0; i < row; i++) {\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  for (i = 0; i < col + row - 1; i++) {\n    k = 0;\n    j = i;\n    while (j >= 0 && k <= row) {\n      if (j < col && k < row) {\n        cout << *(*(p + k) + j) << \"\\n\";\n      }\n      k = k + 1;\n      j = j - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, k, i, j;\n  int a[100][100] = {{0}, {0}};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k < row + col - 1;) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n    k++;\n  }\n}\n"}
{"label": "4", "index": "6973", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, m, n, k, num = 0;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    j = i;\n    while (j >= 0 && i - j < row) {\n      cout << a[i - j][j] << endl;\n      j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = i;\n    while (j < row && col - 1 + i - j >= 0) {\n      cout << a[j][col - 1 + i - j] << endl;\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j, k;\n  int min;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row > col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0, k = j; k >= 0; i++, k--)\n        cout << a[i][k] << endl;\n    }\n    for (i = 1; i < row - col + 1; i++) {\n      for (j = col - 1, k = i; j >= 0; j--, k++)\n        cout << a[k][j] << endl;\n    }\n    for (; i < row; i++) {\n      for (j = col - 1, k = i; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0, k = j; k >= 0; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (; j < col; j++) {\n      for (i = 0, k = j; i < row; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (k = i, j = col - 1; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i < col; i++) {\n    cout << a[0][i] << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    printf(\"%d\\n\", a[i][col - 1]);\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6976", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int(*p)[100], i, j, k, m, n, flag = 0;\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < n; i++) {\n    for (k = i; k >= 0; k--) {\n      if (i - k <= m - 1) {\n        printf(\"%d \", *(*(p + i - k) + k));\n      }\n      flag = i;\n    }\n  }\n  if (flag == n - 1) {\n    for (j = 1; j < m; j++) {\n      for (k = j; k < m; k++) {\n        if ((n + j - k - 1) <= (n - 1) && (n + j - k - 1) >= 0) {\n          printf(\"%d \", *(*(p + k) + n + j - k - 1));\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "6977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, r, c, s;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (s = 0; s < r + c - 1; s++) {\n    for (i = 0; i <= s; i++) {\n      if (i <= r - 1 && s - i <= c - 1) {\n        if (i == 0 && s - i == 0)\n          printf(\"%d\", a[0][0]);\n        else\n          printf(\"\\n%d\", a[i][s - i]);\n      }\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "4", "index": "6978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, i, j, k;\n  int(*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k[100][100];\n  int m = 0, x = 0, i, j, row = 0, col = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    for (j = m;; j--) {\n      if (j >= col || m - j >= row) {\n        break;\n      }\n      if (j < 0 || m - j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  for (m = col; m < row + col - 1; m++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (m - j >= row) {\n        break;\n      }\n      cout << k[m - j][j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[100][100], l;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  l = n + m;\n  for (i = 0; i <= l; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < n && (i - j) < m)\n        cout << a[j][i - j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "6981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, s, t, d;\n  scanf(\"%d%d\", &s, &t);\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < t; j++)\n      cin >> a[i][j];\n\n    printf(\"\\n\");\n  }\n  for (d = 0; d < s + t - 1; d++) {\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < t; j++) {\n        if (i + j == d) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, u;\n  int a[101][101];\n  int r, c;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  u = 0;\n  for (i = 0; (i < r) && (u != c); i++) {\n    if ((i == 0) && (j == 0)) {\n      printf(\"%d\", a[i][j]);\n    } else {\n      printf(\"\\n%d\", a[i][j]);\n    }\n    if ((i != r - 1) && (j != 0)) {\n      j--;\n    } else {\n      u++;\n      j = u;\n      i = -1;\n    }\n  }\n  i = 1;\n  u = 1;\n  for (j = c - 1; (j >= 0) && (u < r); j--) {\n\n    printf(\"\\n%d\", a[i][j]);\n\n    if ((j != 0) && (i != r - 1)) {\n      i++;\n    } else {\n      u++;\n      i = u;\n      j = c;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6983", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100][100];\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) \n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int p = 0; p <= row + col - 2; p++) \n  {\n    for (int i = 0; i <= p; i++) {\n      int j = p - i;\n      if (i > row - 1 || j > col - 1 || j < 0)\n        continue;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, a[100][100];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n\n  int k = 0;\n  for (k = 1; k <= col; k++) {\n    i = 1, j = k;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  for (k = 2; k <= row; k++) {\n    i = k, j = col;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  int i = 0, j = 0;\n  for (; i < row; i++) {\n    for (; j < col; j++) {\n      for (int m = i, n = j; m < row && n > -1; m++, n--)\n        printf(\"%d\\n\", a[m][n]);\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6986", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p, row, col, array[105][105], i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> array[i][j];\n    }\n  for (j = 1; j <= col; j++) {\n    p = &array[1][j];\n    for (i = 1; i <= j && i <= row; i++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    p = &array[i][col];\n    for (j = 1; j <= col && j + i <= row + 1; j++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6987", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, i, j;\n  int startrow = 0, startcol = 0;\n\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> sz[i][j];\n  }\n  while ((startcol + startrow) != (row + col - 2)) {\n    if (startcol < col - 1) {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startcol++;\n    } else {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++)\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n\n      startrow++;\n    }\n  }\n  printf(\"%d\", sz[row - 1][col - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "6988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int heng, lie, i, j, k, l;\n  scanf(\"%d %d\", &heng, &lie);\n\n  int **p;\n  p = (int **)malloc(heng * sizeof(int *));\n  for (i = 0; i < heng; i++) {\n    *(p + i) = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < lie; j++) {\n    for (k = j, l = 0; k >= 0; k--, l++) {\n      if (l < heng)\n        printf(\"%d\\n\", *(*(p + l) + k));\n      else\n        break;\n    }\n  }\n  for (j = lie; j < heng + lie - 1; j++) {\n    for (k = lie - 1, l = j - (lie - 1); k >= 0; k--, l++) {\n      if (l < heng)\n        cout << *(*(p + l) + k) << \"\\n\";\n      else\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i = 1, j = 1;\n  int tempi = 1, tempj = 1, a[100][100] = {0};\n  scanf(\"%d %d \", &m, &n);\n  for (int s = 1; s <= m; s++)\n    for (int t = 1; t <= n; t++)\n      cin >> a[s][t];\n  while (tempi != m || tempj != n) {\n    do {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    } while (j != 0 && i != m + 1);\n    if (tempj != n) {\n      tempj++;\n      i = tempi;\n      j = tempj;\n    } else {\n      tempi++;\n      i = tempi;\n      j = tempj;\n    }\n  }\n  cout << a[m][n];\n  return 0;\n}\n"}
{"label": "4", "index": "6990", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[101][101];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> (sz[i][j]);\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int a;\n  for (i = 1; i < col; i++) {\n    a = i;\n    for (j = 0; j < row && j <= i; j++) {\n      printf(\"\\n%d\", sz[j][a]);\n      a--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    a = j;\n    for (i = col - 1; a < row && i >= 0; i--) {\n      printf(\"\\n%d\", sz[a][i]);\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[101][101];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &(sz[i][j]));\n  }\n  printf(\"%d\", sz[0][0]);\n  int a;\n  for (i = 1; i < col; i++) {\n    a = i;\n    for (j = 0; j < row && j <= i; j++) {\n      printf(\"\\n%d\", sz[j][a]);\n      a--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    a = j;\n    for (i = col - 1; a < row && i >= 0; i--) {\n      cout << \"\\n\" << sz[a][i];\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0, k = 0, i, j, x, y, row, col, a[100][100], *p;\n  scanf(\"%d %d \", &row, &col);\n  n = row * col;\n  for (i = 0; i < row; i++) {\n    p = (int *)a + i * 100;\n    for (j = 0; j < col; j++)\n      cin >> *p++;\n  }\n  for (i = 0, j = 0; m < n; i = x, j = y) {\n    m++;\n    p = (int *)a + i * 100 + j;\n    cout << *p << endl;\n    x = i + 1;\n    y = j - 1;\n    if (x >= row || y < 0) {\n      x = 0;\n      y = ++k;\n      if (y >= col) {\n        x = y - col + 1;\n        y = col - 1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, sum, m, s;\n  int A[100][100];\n  scanf(\"%d%d\", &row, &col);\n  sum = row + col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> A[i][j];\n    }\n  }\n\n  for (m = 2; m <= sum; m++) {\n    for (i = 1; i <= row; i++) {\n      s = m - i;\n      if (s > col)\n        continue;\n      printf(\"%d\\n\", A[i][s]);\n      if ((m - i) == 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  i = 0;\n  j = 0;\n  while (n < row + col - 1) {\n    printf(\"%d\\n\", a[i][j]);\n    if (j == 0 || (i == row - 1 && j != 0)) {\n      n++;\n      j = n;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n    while (j > col - 1) {\n      j--;\n      i++;\n    }\n    if (i == row - 1 && j == col - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      break;\n    }\n  }\n}\n"}
{"label": "4", "index": "6995", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int col, row, sz[100][100];\n  cin >> row >> col;\n  int l, m;\n  for (l = 0; l < row; l++) {\n    for (m = 0; m < col; m++) {\n      cin >> sz[l][m];\n    }\n  }\n  int i, j, k;\n\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (k == i + j)\n          printf(\"%d\\n\", sz[i][j]);\n\n        if (i + j > k)\n          break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6996", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[200][200];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i && j < row && (i - j) < col; j++)\n      cout << *(a[j] + (i - j)) << endl;\n  for (int k = col; k <= row + col - 2; k++)\n    for (int q = col - 1; q >= k - row + 1 && q >= 0; q--)\n      cout << *(a[k - q] + q) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "6997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], k, j, i, m;\n  scanf(\"%d %d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n\n  for (i = 0; i < col; i++) {\n    j = 0;\n    for (m = i; (j < row) && (m >= 0); j++, m--) {\n      printf(\"%d\\n\", a[j][m]);\n    }\n  }\n  for (j = 1; j < row; j++) {\n    i = col - 1;\n    for (m = i, k = j; (k < row) && (m >= 0); k++, m--) {\n      printf(\"%d\\n\", a[k][m]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "6998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], h, l, i, j;\n  cin >> h >> l;\n  for (i = 0; i <= h - 1; i++) {\n    for (j = 0; j <= l - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= (i > h - 1 ? h - 1 : i); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  }\n  for (i = l; i <= l + h - 2; i++) {\n    for (j = i - l + 1; j <= (i > h - 1 ? h - 1 : i); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "6999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint row = 0, col = 0;\nvoid Input(int (*array)[105]) {\n  cin >> row >> col;\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n}\nvoid Diagonal(int (*array)[105], int x, int y) {\n  for (int i = 0;; i++) {\n    if (x + i > row - 1 || y - i < 0)\n      break;\n    else {\n      if (x == 0 && y == 0) {\n        printf(\"%d\", **array);\n      } else {\n        printf(\"\\n%d\", *(*(array + x + i) + y - i));\n      }\n    }\n  }\n  return;\n}\nvoid Scan(int (*array)[105], int x, int y) {\n  Diagonal(array, x, y);\n  if (y < col - 1)\n    Scan(array, x, y + 1);\n  else if (x < row - 1)\n    Scan(array, x + 1, y);\n  else\n    return;\n}\nint main() {\n  int a[105][105];\n  Input(a);\n  Scan(a, 0, 0);\n}\n"}
{"label": "4", "index": "7000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int hang, lie, a[100][100];\n  scanf(\"%d %d \", &hang, &lie);\n  for (int i = 0; i < hang; i++) {\n    for (int j = 0; j < lie; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int k = 0; k < lie; k++) {\n    for (int l = k; (l >= 0) && (k - l < hang); l--) {\n      cout << a[k - l][l] << endl << endl;\n    }\n  }\n  for (int p = lie; p < hang + lie - 1; p++) {\n    for (int q = lie - 1; (q >= 0) && (p - q < hang); q--) {\n      cout << a[p - q][q] << endl << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, num[100][100];\n  cin >> m >> n;\n  cout << endl;\n  for (int u = 0; u < m; u++) { \n    for (int v = 0; v < n; v++)\n      cin >> num[u][v];\n    cout << endl;\n  }\n  for (int i = 0; i < n + m - 1; i++) { \n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i)\n          cout << num[j][k] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, n[100][100], c, d, e, f, g, h, i, j, k, l;\n  scanf(\"%d%d\", &a, &b);\n  for (c = 1; c <= a; c++) {\n    for (d = 1; d <= b; d++) {\n      scanf(\"%d\", &n[c][d]);\n    }\n  }\n  if (a >= b) {\n    for (e = 1; e <= b; e++) {\n      for (f = 1; f <= e; f++) {\n        printf(\"%d\\n\", n[f][e + 1 - f]);\n      }\n    }\n    for (g = 2; g <= a; g++) {\n      for (h = 1; h <= b && g - 1 + h <= a; h++) {\n        printf(\"%d\\n\", n[g - 1 + h][b + 1 - h]);\n      }\n    }\n  } else {\n    for (i = 1; i <= b; i++) {\n      for (j = 1; j <= a && i + 1 - j > 0; j++) {\n        printf(\"%d\\n\", n[j][i + 1 - j]);\n      }\n    }\n    for (k = 2; k <= a; k++) {\n      for (l = 1; l <= a + 1 - k; l++)\n        printf(\"%d\\n\", n[k - 1 + l][b + 1 - l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row;\n  int col;\n  int a[100][100];\n  scanf(\"%d\", &row);\n  scanf(\"%d\", &col);\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int t;\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t == 0) {\n      printf(\"\\n%d\", a[0][0]);\n    } else if (t > 0) {\n      if (t <= col - 1) {\n        for (i = t; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      } else {\n        for (i = col - 1; i >= 0; i--) {\n          if (t - i >= 0 && t - i <= row - 1) {\n            printf(\"\\n%d\", a[t - i][i]);\n          }\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, min, **p, row, col;\n  scanf(\"%d%d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  min = row < col ? row : col;\n  for (k = 0; k < min; k++)\n    for (i = 0, j = k; i <= k; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  if (col == min)\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n        cout << *(*(p + i) + j) << \"\\n\";\n  else {\n    for (k = min; k < col; k++)\n      for (i = 0, j = k; i < row; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row; i++, j--)\n        cout << *(*(p + i) + j) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      printf(\"%d\\n\", a[r][c]);\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, k, s, p, q;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  int temp_r, temp_c;\n  for (p = 0; p < row; p++) {\n    for (q = 0; q < col; q++) {\n      scanf(\"%d\", &a[p][q]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    temp_r = 0;\n    temp_c = i;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    temp_r = j;\n    temp_c = col - 1;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      cout << a[temp_r][temp_c] << \" \";\n      temp_r++;\n      temp_c--;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "4", "index": "7007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[200][200];\n  int m, n, i, j, x;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << *(*(p + i) + j) << \"\\n\";\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, row, col, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0, j = 0, k = 2; j < col; i++, j--) {\n    printf(\"%d\\n\", a[i][j]);\n    if (j == 0 || i == row - 1) {\n      j = k;\n      k = k + 1;\n      i = -1;\n    }\n  }\n  for (i = 1, j = col - 1, k = 1; i < row; i++, j--) {\n    cout << a[i][j] << \"\\n\";\n\n    if (i == row - 1 || j == 0) {\n      i = k;\n      k++;\n      j = col;\n    }\n  }\n}\n"}
{"label": "4", "index": "7009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a = 0;\n  int(*p)[10000];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[10000])calloc(10000, 10000);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (a < n + m - 1) {\n    while (i != m && j != -1) {\n      printf(\"%d\\n\", *(*(p + i) + j));\n      i++;\n      j--;\n    }\n    a++;\n    if (a > n - 1) {\n      j = n - 1;\n      i = a - (n - 1);\n    } else if (a <= n - 1) {\n      j = a;\n      i = 0;\n    }\n  }\n}\n"}
{"label": "4", "index": "7010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[1000], n, m, i, j, t;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(1000);\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n\n  for (j = 0; j < m + n - 1; j++) {\n    if (j < m)\n      t = 0;\n    else\n      t = j - m + 1;\n    for (i = t; i < n && i <= j; i++)\n      cout << *(*(p + i) + j - i) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101], b[100000];\n  int row, col;\n  int i, j, k = (-1), sum;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (sum = 0; sum <= ((row + col) - 2); sum++) {\n    for (i = 0; i < row; i++) {\n      if (sum - i >= 0 && sum - i < col) {\n        k += 1;\n        b[k] = a[i][sum - i];\n      }\n    }\n  }\n  for (k = 0; k <= row * col - 1; k++)\n    cout << b[k] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "4", "index": "7012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (int i = 0; i <= row - 1; i++)\n\n  {\n    for (int s = 0; s <= col - 1; s++) {\n      cin >> a[i][s];\n    }\n    printf(\"\\n\");\n  }\n  int h = -1, l = 2;\n  cout << a[0][0] << endl;\n  for (int t = 1; t <= col - 1; t++) {\n\n    while (l > 0 && h < row - 1) {\n      h++;\n      l--;\n      printf(\"%d\\n\", a[h][l]);\n    }\n    l = t + 2;\n    h = -1;\n  }\n  int d = col, b = 0;\n  for (int j = 1; j <= row - 1; j++) {\n    while (d > 0 && b < row - 1) {\n      d--;\n      b++;\n      cout << a[b][d] << endl;\n    }\n    d = col;\n    b = j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  int i, j;\n  int(*p)[100] = a;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 0; i <= row + col - 2; i++) {\n    if (i < col - 1) {\n      for (j = 0; j <= row - 1 && j <= i; j++)\n        cout << *(*(p + j) + i - j) << endl;\n    } else\n      for (j = col - 1; i - j <= row - 1 && j >= 0; j--)\n        printf(\"%d\\n\", *(*(p + i - j) + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, m, M, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (row > col) {\n    M = row;\n    m = col;\n  } else {\n    M = col;\n    m = row;\n  }\n  for (k = 0; k < m; k++) {\n    for (i = 0; i <= k; i++)\n      printf(\"%d\\n\", a[i][k - i]);\n  }\n  if (row > col) {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i + k + 1][m - i - 1]);\n    }\n  } else {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i][m - i + k]);\n    }\n  }\n  for (k = 1; k < m; k++) {\n    for (i = 0; i < m - k; i++)\n      printf(\"%d\\n\", a[row - m + i + k][col - i - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int n, m, i, j, k;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (k = 0;; k++) {\n      if (k >= n || j - k < 0) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[k][j - k]);\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (k = 0;; k++) {\n      if (i + k > n - 1 || m - 1 - k < 0) {\n        break;\n      } else\n        printf(\"%d\\n\", sz[i + k][m - 1 - k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row == 1) {\n    for (j = 0; j < col; j++)\n      printf(\"%d\\n\", a[0][j]);\n\n  } else {\n    for (j = 0; j < col; j++) {\n      i = 0;\n      k = j;\n      while (k >= 0 && i < row) {\n        printf(\"%d\\n\", a[i][k]);\n        k--;\n        i++;\n      }\n    }\n    for (i = 1; i < row - 1; i++) {\n      j = col - 1;\n      k = i;\n      while (j >= 0 && k < row) {\n        printf(\"%d\\n\", a[k][j]);\n        j--;\n        k++;\n      }\n    }\n    printf(\"%d\\n\", a[row - 1][col - 1]);\n  }\n}\n"}
{"label": "4", "index": "7017", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, m;\n  int *p;\n  p = (int *)malloc(100 * sizeof(int));\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; !((m == -1) || (i == row)); i++, m--)\n      printf(\"%d\\n\", *(p + i * col + m));\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; !((m == row) || (j == -1)); m++, j--)\n      printf(\"%d\\n\", *(p + m * col + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7018", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], row, col, i;\n  cin >> n >> m;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < m; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  if (n < m) {\n    for (i = 0; i < n; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = n; i < m; i++) {\n      for (row = 0; row < n; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  if (n >= m) {\n    for (i = 0; i < m; i++) {\n      for (row = 0; row <= i; row++)\n        printf(\"%d\\n\", a[row][i - row]);\n    }\n    for (i = m; i < n; i++) {\n      for (col = m - 1; col >= 0; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n    for (i = n; i < n + m - 1; i++) {\n      for (col = m - 1; col >= i - n + 1; col--)\n        printf(\"%d\\n\", a[i - col][col]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0, 0}, row, col, i, j, count = 0, r = 0;\n  cin >> row >> col;\n  if (col == 1)\n    r = 1;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  i = 1;\n  j = 1;\n  while (count < row * col) {\n    printf(\"%d\\n\", a[i][j]);\n    count++;\n    if ((j == 1 && i != row) || (j != 1 && i == row) || (j == 1 && i == row)) {\n      if (i + j < col) {\n        j = i + j;\n        i = 1;\n      } else {\n        r++;\n        i = r;\n        j = col;\n      }\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7020", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint array_1[100][100];\nint main() {\n  int row, col, i, j, m;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array_1[i][j]);\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    if (m < col) {\n      for (i = 0; i <= m && i < row; i++)\n        printf(\"%d\\n\", array_1[i][m - i]);\n    } else {\n      for (j = col - 1; j > m - row && j >= 0; j--)\n        printf(\"%d\\n\", array_1[m - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ROW, COL;\nint row = -1, col = 1;\nint array_1[100][100];\nint move() {\n  row++;\n  col--;\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint big_move() {\n  if (row + col < COL - 1) {\n    col = row + col + 1;\n    row = 0;\n  } else {\n    row = row + col - COL + 2;\n    col = COL - 1;\n  }\n  printf(\"%d\\n\", array_1[row][col]);\n  return 0;\n}\nint main() {\n  scanf(\"%d%d\", &ROW, &COL);\n  int r, c;\n  for (r = 0; r < ROW; r++) {\n    for (c = 0; c < COL; c++) {\n      scanf(\"%d\", &array_1[r][c]);\n    }\n  }\n  if (ROW == 1 && COL == 1) {\n    printf(\"%d\", array_1[0][0]);\n    return 0;\n  }\n  while (row != ROW - 1 || col != COL - 1) {\n    while (col != 0 && row != ROW - 1)\n      move();\n    big_move();\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7022", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int *p, row, col, array[105][105], i, j; \n  cin >> row >> col;                       \n  for (i = 1; i <= row; i++)               \n    for (j = 1; j <= col; j++) {\n      cin >> array[i][j];\n    }\n  for (j = 1; j <= col; j++) \n  {\n    p = &array[1][j];\n    for (i = 1; i <= j && i <= row; i++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  for (i = 2; i <= row; i++) \n  {\n    p = &array[i][col];\n    for (j = 1; j <= col && j + i <= row + 1; j++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  cin >> row >> col;\n  int r, c;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      cin >> sz[r][c];\n    }\n  }\n  int k;\n  int first = 1;\n  int min = row - 1;\n  if (col < min + 1) {\n    min = col - 1;\n  }\n\n  for (k = 0; k <= min; k++) {\n    for (r = 0; r <= k; r++) {\n      if (first == 1) {\n        printf(\"%d\", sz[r][k - r]);\n        first = 0;\n      } else {\n        cout << \"\\n\" << sz[r][k - r];\n      }\n    }\n  }\n\n  if (row > col) {\n    for (k = 1; k <= row - col; k++) {\n      for (r = k, c = col - 1; c >= 0 && r < row; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  if (row < col) {\n    for (k = 1; k <= col - row; k++) {\n      for (c = row - 1 + k, r = 0; r <= row - 1; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  for (k = min + 1; k >= 1; k--) {\n    for (r = row - k + 1, c = col - 1; r < row; r++, c--) {\n      printf(\"\\n%d\", sz[r][c]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[100][100];\n  cin >> n >> m;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++)\n      cin >> num[i][j];\n  }\n  for (int k = 0; k < n + m - 1; k++) {\n    if (k < m) {\n      for (int i = 0; k >= i && i < n; i++)\n        printf(\"%d\\n\", num[i][k - i]);\n    } else {\n      for (int i = k - m + 1; i < n && k >= i; i++)\n        cout << num[i][k - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], y, x, i, j, k;\n  cin >> y >> x;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      cin >> a[i][j];\n  for (k = 0; k < x; k++)\n    for (i = 0; i < y && k - i >= 0; i++)\n      cout << a[i][k - i] << endl;\n  for (k = x; k < x + y - 1; k++)\n    for (j = x - 1; k - j < y && j >= 0; j--)\n      cout << a[k - j][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, lie, z;\n  int i, j;\n  cin >> n >> lie;\n  int *p[n];\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++) {\n      scanf(\"%d\", p[i] + j);\n    }\n  }\n  for (z = 0; z <= n + lie - 2; z++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == z)\n          cout << *(p[i] + j) << \" \";\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint row = 0, col = 0;\nvoid Input(int (*array)[105]) {\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i <= row - 1; i++) {\n    for (int j = 0; j <= col - 1; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n}\nvoid Diagonal(int (*array)[105], int x, int y) {\n  for (int i = 0;; i++) {\n    if (x + i > row - 1 || y - i < 0)\n      break;\n    else {\n      if (x == 0 && y == 0) {\n        cout << **array;\n      } else {\n        printf(\"\\n%d\", *(*(array + x + i) + y - i));\n      }\n    }\n  }\n  return;\n}\nvoid Scan(int (*array)[105], int x, int y) {\n  Diagonal(array, x, y);\n  if (y < col - 1)\n    Scan(array, x, y + 1);\n  else if (x < row - 1)\n    Scan(array, x + 1, y);\n  else\n    return;\n}\nint main() {\n  int a[105][105];\n  Input(a);\n  Scan(a, 0, 0);\n  return 0;\n}\n"}
{"label": "4", "index": "7028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, *a[101], *h[101];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    h[i] = a[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++, a[i]++)\n      scanf(\"%d\", a[i]);\n  }\n  if (col == 1) {\n    for (i = 0; i < row; i++)\n      printf(\"%d\\n\", *h[i]);\n  } else {\n    for (i = 0; i < row; i++)\n      a[i] = h[i];\n    for (i = 0; i < row + col + 1; i++) {\n      for (j = 0; j <= i && j < row; j++) {\n        if (a[j] != h[j] + col) {\n          printf(\"%d\\n\", *a[j]);\n          a[j]++;\n        } else\n          continue;\n      }\n      if (a[j] == h[row - 1] + col - 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, p, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (p = 0; p <= m + n - 2; p++) {\n    for (i = 0; i <= p; i++) {\n      if (i < m && p - i < n)\n        cout << a[i][p - i] << \"\\n\";\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint x[1000][1000];\nvoid f(int i, int j) {\n  cout << x[i][j] << endl;\n  if (i == m && j == n)\n    return;\n  else if (j == 1 && i + 1 <= n)\n    f(1, i + 1);\n  else if (j == 1 && i + 1 > n)\n    f(i + j - n + 1, n);\n  else if (i == m && i + j <= n)\n    f(1, i + j);\n  else if (i == m && i + j > n)\n    f(i + j - n + 1, n);\n  else\n    f(i + 1, j - 1);\n}\nint main() {\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      cin >> x[i][j];\n  f(1, 1);\n  return 0;\n}\n"}
{"label": "4", "index": "7031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << a[i][j] << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "7032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    int k = 0;\n    j = i;\n    cout << *(*(array + k) + j) << endl;\n    while (k + 1 < row && j - 1 >= 0) {\n      k++;\n      j--;\n      printf(\"%d\\n\", *(*(array + k) + j));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int k = col - 1;\n    j = i;\n    cout << *(*(array + j) + k) << endl;\n    while (j + 1 < row && k - 1 >= 0) {\n      j++;\n      k--;\n      printf(\"%d\\n\", *(*(array + j) + k));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, l;\n  cin >> n >> m;\n  int *p[100];\n  for (i = 0; i < n; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < m; i++) {\n    if (i - (n - 1) >= 0) {\n      for (l = 0; l < n; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    } else {\n      for (l = 0; l <= i; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (n - i >= m) {\n      for (l = 0; l < m; l++)\n        printf(\"%d\\n\", *(*(p + (i + l)) + (m - (1 + l))));\n    } else {\n      for (l = 0; l < n - i; l++)\n        cout << *(*(p + (i + l)) + (m - (1 + l))) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, max;\n  scanf(\"%d %d\", &row, &col);\n  max = row;\n  if (max < col)\n    max = col;\n  for (i = 0; i < max; i++) {\n    for (j = 0; j < max; j++) {\n      a[i][j] = -1;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (max == 1)\n    printf(\"%d\", a[0][0]);\n  else {\n    i = 0;\n    j = 0;\n    while (j < max) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (j == 0) {\n        j = i + 1;\n        i = 0;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    j = max - 1;\n    i = 1;\n    while (i != max - 1 || j != max - 1) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (i == max - 1) {\n        i = j + 1;\n        j = max - 1;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    if (a[max - 1][max - 1] != -1)\n      printf(\"%d\\n\", a[max - 1][max - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7035", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint row, col, Mat[111][111];\n\nvoid Out(int i, int j) {\n  cout << *(*(Mat + i) + j) << endl;\n  if (i == row - 1 || j == 0)\n    return;\n  else\n    Out(i + 1, j - 1);\n}\n\nint main() {\n  scanf(\"%d %d \", &row, &col);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(Mat + i) + j);\n\n  for (int i = 0; i < col; i++)\n    Out(0, i);\n\n  for (int i = 1; i < row; i++)\n    Out(i, col - 1);\n}\n"}
{"label": "4", "index": "7036", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, p, q;\n  int s[120][120];\n  cin >> m >> n;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  l = 0;\n  i = 1;\n  j = 1;\n  while (l < n * m) {\n    printf(\"%d \", s[i][j]);\n    l++;\n    if ((j == 1) && (i + 1 <= n)) {\n      j = i + 1;\n      i = 1;\n    } else if ((j == 1) && (i + 1 > n)) {\n      i = i - n + 2;\n      j = n;\n    } else if (i == m) {\n      if (j + i <= n) {\n        j = j + i;\n        i = 1;\n      } else {\n        i = j - n + m + 1;\n        j = n;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "7037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (i = n - 1; i >= 0; i--) {\n      if (k - i >= 0 && k - i < m)\n        cout << a[k - i][i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int(*p)[100] = a;\n  int i, j;\n  int r, c;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++)\n    for (j = 0; j <= c - 1; j++)\n      cin >> *(*(p + i) + j);\n  int t;\n  for (t = 0; t <= c - 1; t++) {\n    for (i = 0, j = t; (j >= 0) && (i <= r - 1); i++, j--) {\n      printf(\"%d\\n\", *(*(p + i) + j));\n    }\n  }\n  for (t = 1; t <= r - 1; t++) {\n    for (i = t, j = c - 1; (j >= 0) && (i <= r - 1); i++, j--)\n      cout << *(*(p + i) + j) << endl;\n  }\n}\n"}
{"label": "4", "index": "7039", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col, i, j;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &(a[i][j]));\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    if (i < col)\n      j = 0;\n    else\n      j = i - col + 1;\n    for (; j <= i && j < row; j++) {\n      printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, *a[101], *h[101];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    h[i] = a[i] = (int *)malloc(sizeof(int) * col);\n    for (j = 0; j < col; j++, a[i]++)\n      scanf(\"%d\", a[i]);\n  }\n  if (col == 1) {\n    for (i = 0; i < row; i++)\n      printf(\"%d\\n\", *h[i]);\n  } else {\n    for (i = 0; i < row; i++)\n      a[i] = h[i];\n    for (i = 0; i < row + col + 1; i++) {\n      for (j = 0; j <= i && j < row; j++) {\n        if (a[j] != h[j] + col) {\n          printf(\"%d\\n\", *a[j]);\n          a[j]++;\n        } else\n          continue;\n      }\n      if (a[j] == h[row - 1] + col - 1)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7041", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 1, h, l, i, j, a[100][100], lans = 0, ans[10000], k;\n  scanf(\"%d%d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      cin >> a[i][j];\n  for (n = 1; n <= l; n++)\n    for (j = 0, k = n - 1; k >= 0 && j <= h - 1; j++, k--)\n      ans[lans++] = a[j][k];\n  for (n = 2; n <= h; n++)\n    for (j = n - 1, k = l - 1; j <= h - 1 && k >= 0; j++, k--)\n      ans[lans++] = a[j][k];\n  for (i = 0; i < lans; i++)\n    printf(\"%d\\n\", ans[i]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, col, row;\n  int *p[1000];\n  for (i = 0; i < 1000; i++) {\n    p[i] = (int *)malloc(10000 * sizeof(int));\n  }\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  if (col > row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        if (j < row) {\n          cout << *(*(p + j) + i - j) << \"\\n\";\n        } else {\n          break;\n        }\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (j + i + 1 < row) {\n          printf(\"%d\\n\", *(*(p + j + i + 1) + col - j - 1));\n        } else {\n          break;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7043", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, max;\n  scanf(\"%d%d\", &row, &col);\n  int i, j;\n  int a[101][101];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  for (i = 0; i <= row + col - 2; i++) {\n    max = 0;\n    if (row - 1 < i) {\n      max = row - 1;\n    } else {\n      max = i;\n    }\n    for (j = 0; j <= max; j++) {\n      if (i - j <= col - 1) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7044", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, hang, lie, (*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  scanf(\"%d %d\", &hang, &lie);\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  if (hang <= lie) {\n    for (j = 0; j < hang; j++) {\n      for (i = j, k = 0; i != -1; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = hang; j < lie; j++) {\n      for (i = j, k = 0; k != hang; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n    for (j = 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  } else {\n    for (j = 0; j < lie; j++) {\n      for (i = j, k = 0; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = lie; j < hang; j++) {\n      for (i = lie - 1, k = j - lie + 1; i >= 0; i--, k++) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n\n    for (j = hang - lie + 1; j < hang; j++) {\n      for (k = j, i = lie - 1; k < hang; k++, i--) {\n        printf(\"%d\\n\", *(*(a + k) + i));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint array_1[100][100];\nint main() {\n  int row, col, i, j, m;\n  scanf(\"%d%d\\n\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array_1[i][j]);\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    if (m < col) {\n      for (i = 0; i <= m && i < row; i++)\n        printf(\"%d\\n\", array_1[i][m - i]);\n    } else {\n      for (j = col - 1; j > m - row && j >= 0; j--)\n        printf(\"%d\\n\", array_1[m - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7046", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n    int c = 0;\n    for (i = m; i >= 0 && c < a; i--, c++)\n      printf(\"%d\\n\", n[c][i]);\n  }\n  int y;\n\n  for (x = 1; x < a; x++) {\n    y = b - 1;\n    for (j = x; j < a && y >= 0; j++, y--)\n      printf(\"%d\\n\", n[j][y]);\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "7047", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[300][300];\n  int r, c, m, i, j, n, k, a;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &sz[i][j]);\n\n  for (i = 0; i <= r + c - 2; i++) {\n    for (j = 0;; j++) {\n      k = i - j;\n      if (k < 0) {\n        break;\n      }\n      if (j < r && k < c)\n        printf(\"%d\\n\", sz[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j;\n  cin >> n >> m;\n  int a[n][m];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  int *p = NULL;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = &a[0][0] + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        printf(\"%d\\n\", *(p + (m - 1) * k));\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, **p, col, row, sum;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", *(p + i) + j);\n  }\n\n  k = row + col;\n  for (sum = 0; sum <= k; sum++) {\n    for (i = 0; i <= sum; i++) {\n      j = sum - i;\n      if (i < row && j < col)\n        cout << \"\\n\" << *(*(p + i) + j);\n    }\n  }\n}\n"}
{"label": "4", "index": "7050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    if ((k <= col - 1) && (k <= row - 1)) {\n      for (int l = 0; l <= k; l++) {\n        printf(\"%d\\n\", sz[l][k - l]);\n      }\n    } else if ((k <= col - 1) && (k > row - 1)) {\n      for (int m = 0; m <= row - 1; m++) {\n        printf(\"%d\\n\", sz[m][k - m]);\n      }\n    } else if ((k > col - 1) && (k <= row - 1)) {\n      for (int t = k - col + 1; t <= k; t++) {\n        printf(\"%d\\n\", sz[t][k - t]);\n      }\n    } else if ((k > col - 1) && (k > row - 1)) {\n      for (int p = k - col + 1; p <= row - 1; p++) {\n        printf(\"%d\\n\", sz[p][k - p]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j, a, b;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    a = i;\n    b = 0;\n    for (j = 0; j <= i; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (b == row)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    b = i;\n    a = col - 1;\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", sz[b][a]);\n      b++;\n      a--;\n      if (a == -1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7052", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100], j, k;\n  \n  cin >> row; \n  cin >> col; \n  for (k = 0; k < row; k++)\n    for (j = 0; j < col; j++)\n      cin >> a[k][j]; \n  for (k = 0; k < col; k++) {\n    for (j = k; j >= 0; j--) {\n      if ((k - j >= 0) && (k - j) < row)\n        cout << *(a[k - j] + j) << endl;\n      \n      else\n        break; \n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (j = col - 1; j >= 0; j--) {\n      if ((k + col - 1 - j) < row)\n        cout << *(a[k + col - 1 - j] + j) << endl;\n      \n      else\n        break; \n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int m, n, i, j;\n  cin >> m >> n;\n  for (i = j = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = j = 0; i <= n + m - 2; i++)\n    for (j = 0; j <= i; j++)\n      if (j >= 0 && j < m && i - j >= 0 && i - j < n)\n        cout << a[j][i - j] << \"\\n\";\n}\n"}
{"label": "4", "index": "7054", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  j = 0;\n  for (i = 0; i < row; i++) {\n    if (i == 0) {\n      while (j <= col - 1) {\n        cout << array[i][j] << endl;\n        for (int k = i + 1; k < row; k++) {\n          if (i + j - k >= 0)\n            printf(\"%d\\n\", array[k][i + j - k]);\n        }\n        j++;\n      }\n    } else {\n      j = col - 1;\n      cout << array[i][j] << endl;\n      for (int k = i + 1; k < row; k++) {\n        if (i + j - k >= 0)\n          printf(\"%d\\n\", array[k][i + j - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  for (i = 0; i < 100; i++) {\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  }\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if ((j < m) && ((i - j) < n)) {\n        if (i == 0) {\n          printf(\"%d\", *(*(p + j) + i - j));\n        } else {\n          cout << \"\\n\" << *(*(p + j) + i - j);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], i, j, row, col, n;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n <= col + row - 2; n++) {\n    for (i = 0; i < row; i++)\n      if (i <= n && i > n - col)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n}\n"}
{"label": "4", "index": "7057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h, k, e, s, i, l;\n  scanf(\"%d%d\", &h, &l);\n  int juzhen[1000][1000];\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &(juzhen[i][k]));\n    }\n  }\n\n  for (s = 0; s < l; s++) {\n    k = s;\n    i = 0;\n    for (e = 0; e <= s; e++) {\n      cout << juzhen[i][k] << \" \";\n      i++;\n      k--;\n      if (i == h) {\n        break;\n      }\n    }\n  }\n  for (e = 1; e < h; e++) {\n    i = e;\n    k = l - 1;\n    for (s = 0; s < (h - e); s++) {\n      printf(\"%d \", juzhen[i][k]);\n      i++;\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], col, row, i, j, k, min;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; (k >= 0 && i < row) == 1;) {\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      k--;\n    }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; (j >= 0 && k < row) == 1;) {\n      cout << a[k][j] << \"\\n\";\n      j--;\n      k++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7059", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, s[100][100], i, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (k = 0; k < col; k++) {\n      cin >> s[i][k];\n    }\n  }\n  if (col < row) {\n    for (i = 0; i <= (row + col); i++) {\n      for (k = 0; k < row && k <= i; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  } else if (col >= row) {\n    for (i = 0; i <= (col + row); i++) {\n      for (k = 0; k <= i && k < row; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n[100][100], col, row, COL, ROW;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &n[row][col]);\n    }\n  }\n  for (i = 0; i < COL + ROW - 1; i++) {\n    if (i < COL) {\n      col = i;\n      row = 0;\n      while (col >= 0 && row < ROW) {\n        cout << n[row][col] << \"\\n\";\n        col -= 1;\n        row += 1;\n      }\n    } else {\n      if (i >= COL) {\n        col = COL - 1;\n        row = i - COL + 1;\n        while (col >= 0 && row < ROW) {\n          printf(\"%d\\n\", n[row][col]);\n          col -= 1;\n          row += 1;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7061", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, c, i, j, k;\n  int(*a)[100];\n  a = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  cin >> r >> c;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int *head = (int *)calloc(row * col, sizeof(int));\n  int *p;\n  for (p = head; p < head + row * col; p++) {\n    scanf(\"%d\", p);\n  }\n  int i, j, jj, ii;\n  for (j = 0; j < col; j++) {\n    for (jj = j, i = 0; jj >= 0 && i < row; jj--, i++) {\n      printf(\"%d\\n\", *(head + col * i + jj));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (ii = i, j = col - 1; j >= 0 && ii < row; j--, ii++) {\n      cout << *(head + col * ii + j) << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7063", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid bianli() {}\nint main() {\n  int i = 0, j = 0, row = 0, col = 0;\n  cin >> row >> col;\n  int a[row][col], *p = *a;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  \n  for (i = 0; i < col; i++) {\n    p = *a + i;\n    j = i + 1;\n    while (j) {\n      cout << *p << endl;\n      p = p + col - 1;\n      if (j > row)\n        j = row - 1;\n      else\n        j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    p = *(a + i) + col - 1;\n    j = row - i;\n    while (j) {\n      cout << *p << endl;\n      p = p + col - 1;\n      if (j > col)\n        j = col - 1;\n      else\n        j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7064", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int m = 0; m < col + row - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if ((i + j) == m)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j;\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  int sum;\n  for (sum = 2; sum <= (col + row); sum++) {\n    if (sum <= col + 1) {\n      for (i = 1, j = sum - 1; i < sum && i <= row && j <= col; i++, j--) {\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n      }\n    } else {\n      for (i = sum - col, j = sum - i; i < sum && i <= row && j <= col;\n           i++, j--) {\n        printf(\"%d\\n\", a[i - 1][j - 1]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  for (int k = 0; k < col; k++) {\n    if (k < row)\n      for (int i = 0; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n  }\n  for (int k = col; k < row + col - 1; k++) {\n    if (k < row)\n      for (int i = k - col + 1; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = k - col + 1; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint row, col, Mat[111][111];\n\nvoid Out(int i, int j) {\n  printf(\"%d\\n\", *(*(Mat + i) + j));\n  if (i == row - 1 || j == 0)\n    return;\n  else\n    Out(i + 1, j - 1);\n}\n\nint main() {\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(Mat + i) + j);\n\n  for (int i = 0; i < col; i++)\n    Out(0, i);\n\n  for (int i = 1; i < row; i++)\n    Out(i, col - 1);\n}\n"}
{"label": "4", "index": "7068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int hang, lie;\n  cin >> hang >> lie;\n  int i, j;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> a[i][j];\n  }\n  int t;\n  for (t = 0; t <= hang + lie - 2; t++) {\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == t)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (n < row + col - 1) {\n    cout << a[i][j] << \"\\n\";\n    if (j == 0 || (i == row - 1 && j != 0)) {\n      n++;\n      j = n;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n    while (j > col - 1) {\n      j--;\n      i++;\n    }\n    if (i == row - 1 && j == col - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  int i, j;\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < col - 1; j++) {\n    int a = j;\n    for (i = 0; a >= 0 && i < row; i++) {\n      cout << *(*(p + i) + a) << \"\\n\";\n      a--;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    int a = i;\n    for (j = col - 1; a < row && j >= 0; j--) {\n      cout << *(*(p + a) + j) << \"\\n\";\n      a++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, a[101][101], t;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= row + col - 2; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < row && (i - j) < col)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  cin >> t;\n}\n"}
{"label": "4", "index": "7072", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], l, h, i, j, hang, lie;\n  scanf(\"%d%d\", &lie, &hang);\n  for (l = 0; l < lie; l++) {\n    for (h = 0; h < hang; h++) {\n      scanf(\"%d \", &s[h][l]);\n    }\n  }\n  for (i = 0; i < hang + lie - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      if (j > hang - 1) {\n        j = hang - 1;\n      }\n      h = j;\n      l = i - h;\n      if (l > lie - 1) {\n        break;\n      }\n      printf(\"%d\\n\", s[h][l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[101][101];\n  int(*p)[101] = NULL;\n  p = array;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  }\n  for (int k = 0; k < row + col - 1; k++) {\n    for (int i = 0; i < row; i++) {\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7074", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint mins(int x, int y) {\n  if (x > y)\n    return y;\n  else\n    return x;\n}\n\nint maxs(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int row, col, i, j, n;\n  cin >> row >> col;\n  n = row * col;\n  int a[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < mins(row, col); i++) {\n    for (j = 0; j <= i; j++) {\n      cout << a[j][i - j] << endl;\n    }\n  }\n\n  if (row >= col) {\n    for (i = col; i < row; i++) {\n      for (j = i - col + 1; j <= i; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = row; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  } else {\n    for (i = row; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n    for (i = col; i <= row + col - 2; i++) {\n      for (j = i - col + 1; j < row; j++) {\n        cout << a[j][i - j] << endl;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int(*p)[100], i, j, k, m, n, flag = 0;\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < n; i++) {\n    for (k = i; k >= 0; k--) {\n      if (i - k <= m - 1) {\n        cout << *(*(p + i - k) + k) << \" \";\n      }\n      flag = i;\n    }\n  }\n  if (flag == n - 1) {\n    for (j = 1; j < m; j++) {\n      for (k = j; k < m; k++) {\n        if ((n + j - k - 1) <= (n - 1) && (n + j - k - 1) >= 0) {\n          cout << *(*(p + k) + n + j - k - 1) << \" \";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, k, j, p;\n  int a[123][123];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (k = 0; k <= row + col - 2; k = k + 1) {\n    for (p = 0; p <= k; p++) {\n      if (p < row && k - p < col)\n        printf(\"%d\\n\", a[p][k - p]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[99][99], i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  i = 0;\n  j = 0;\n  for (k = 0; k <= col - 1; k++) {\n    j = k;\n    i = 0;\n    do {\n      cout << array[i][j] << endl;\n      j = j - 1;\n      i = k - j;\n    } while (i != row && j != -1);\n  }\n  for (k = col; k <= col + row - 2; k++) {\n    j = col - 1;\n    i = k - j;\n    do {\n      cout << array[i][j] << endl;\n      j = j - 1;\n      i = i + 1;\n    } while (i != row && j != -1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7078", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ain[123][123];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; ++i)\n    for (int j = 0; j < col; ++j)\n      cin >> ain[i][j];\n  int *p[123];\n  for (int i = 0; i < row; ++i)\n    p[i] = ain[i];\n  for (int i = 0; i < row + col - 1; ++i) {\n    for (int j = 0; j < row; ++j) {\n      if (j <= i && j > i - col)\n        printf(\"%d\\n\", *(p[j]++));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, dia, array[101][101], i, j;\n\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (dia = 0; dia < row + col - 1; dia++)\n    for (i = 0; i <= dia; i++) {\n      if ((dia - i) < col && i < row)\n        cout << *(*(array + i) + (dia - i)) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], b[100000];\n  int row, col;\n  int i, j, k = (-1), sum;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (sum = 0; sum <= ((row + col) - 2); sum++) {\n    for (i = 0; i < row; i++) {\n      if (sum - i >= 0 && sum - i < col) {\n        k += 1;\n        b[k] = a[i][sum - i];\n      }\n    }\n  }\n  for (k = 0; k <= row * col - 1; k++)\n    printf(\"%d\\n\", b[k]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], row, col;\n  int c, r, sum;\n  scanf(\"%d%d\", &row, &col);\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++)\n      scanf(\"%d\", &array[r][c]);\n  }\n\n  for (sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (c = sum; c >= 0; c--) {\n        if ((sum - c) >= row)\n          break;\n        cout << array[sum - c][c] << \"\\n\";\n      }\n    } else {\n      for (r = sum - col + 1; r < row; r++) {\n        if ((sum - r) < 0)\n          break;\n        printf(\"%d\\n\", array[r][sum - r]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, sum; \n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j]; \n  sum = row + col;\n  for (k = 2; k <= sum; k++)\n    for (i = 1; i <= row; i++)\n      for (j = col; j > 0; j--)\n        if (i + j == k) {\n          cout << array[i - 1][j - 1] << endl;\n          break;\n        } \n  return 0;\n}\n"}
{"label": "4", "index": "7083", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100];\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (k = 0; k < col; k++) {\n    cout << array[0][k] << endl;\n    for (i = 1, j = k - 1;; i++, j--) {\n      if (i < row && j >= 0)\n        cout << array[i][j] << endl;\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    cout << array[k][col - 1] << endl;\n    for (i = k + 1, j = col - 2;; i++, j--) {\n      if (i < row && j >= 0)\n        printf(\"%d\\n\", array[i][j]);\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7084", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100][100], col, row;\nint main() {\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    };\n  };\n  if (col >= row) {\n    for (k = 0; k <= row - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= col - 1; k++) {\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n  if (row > col) {\n    for (k = 0; k <= col - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row - 1; k++) {\n      for (i = k - col + 1; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n}\n"}
{"label": "4", "index": "7085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, row, col;\n  int sz[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    scanf(\"\\n%d\", &sz[i][0]);\n    for (j = 1; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (i = 0; i < row; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row; i < col; i++) {\n      for (j = 0, k = i; j < row; j++, k--) {\n        cout << sz[j][k] << \"\\n\";\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  if (col < row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      for (j = i, k = col - 1; k >= 0; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row - col + 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, n, row, col;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  m = row + col - 2;\n  for (n = 0; n <= m; n++)\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= col - 1; j++)\n        if (i + j == n)\n          cout << a[i][j] << \"\\n\";\n}\n"}
{"label": "4", "index": "7087", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[200][200], m, n, i, j, k;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) \n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (k = 0; k < m + n - 1; k++) \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j - k == 0)\n          cout << a[i][j] << endl; \n  return 0;\n}\n"}
{"label": "4", "index": "7088", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int row, col;\n  int a[101][101];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  for (j = 1; j <= col; j++) {\n    printf(\"%d\\n\", a[1][j]);\n    int k = 1;\n    while (((1 + k) <= row) && ((j - k) >= 1)) {\n      printf(\"%d\\n\", a[1 + k][j - k]);\n      k++;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    printf(\"%d\\n\", a[i][col]);\n    int k = 1;\n    while (((i + k) <= row) && ((col - k) >= 1)) {\n      cout << a[i + k][col - k] << endl;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, a, b, i, j, *num;\n  num = (int *)malloc(sizeof(int) * 10000);\n  scanf(\"%d %d\", &a, &b);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++)\n      scanf(\"%d\", num + (i - 1) * b + j);\n  }\n\n  for (i = 1; i < b; i++) {\n    p = i;\n    for (;;) {\n      printf(\"%d\\n\", *(num + p));\n      if (p % b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n\n  for (i = b; i <= a * b; i += b) {\n    p = i;\n    for (;;) {\n      printf(\"%d\\n\", *(num + p));\n      if (p % b == 1 || b == 1 || p > b * (a - 1))\n        break;\n      p += b - 1;\n    }\n  }\n}\n"}
{"label": "4", "index": "7090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = j = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = j = 0; i <= n + m - 2; i++)\n    for (j = 0; j <= i; j++)\n      if (j >= 0 && j < m && i - j >= 0 && i - j < n)\n        cout << a[j][i - j] << \"\\n\";\n}\n"}
{"label": "4", "index": "7091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int m = 0; m < col + row - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if ((i + j) == m)\n          cout << a[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, l;\n  scanf(\"%d%d\", &n, &m);\n  int *p[100];\n  for (i = 0; i < n; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < m; i++) {\n    if (i - (n - 1) >= 0) {\n      for (l = 0; l < n; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    } else {\n      for (l = 0; l <= i; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (n - i >= m) {\n      for (l = 0; l < m; l++)\n        cout << *(*(p + (i + l)) + (m - (1 + l))) << \"\\n\";\n    } else {\n      for (l = 0; l < n - i; l++)\n        printf(\"%d\\n\", *(*(p + (i + l)) + (m - (1 + l))));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], k, j, i, m;\n  scanf(\"%d %d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n\n  for (i = 0; i < col; i++) {\n    j = 0;\n    for (m = i; (j < row) && (m >= 0); j++, m--)\n      cout << a[j][m] << \"\\n\";\n  }\n  for (j = 1; j < row; j++) {\n    i = col - 1;\n    for (m = i, k = j; (k < row) && (m >= 0); k++, m--) {\n      printf(\"%d\\n\", a[k][m]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], r, c, r1, c1;\n  int i, l, j, k, m, n;\n  scanf(\"%d %d \", &r, &c);\n  for (m = 0; m <= 100; m++) {\n    for (n = 0; n <= 100; n++) {\n      a[m][n] = -1;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 1; k <= c; k++) {\n    c1 = k;\n    r1 = 1;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  for (l = 2; l <= r; l++) {\n    c1 = c;\n    r1 = l;\n    while (a[r1][c1] > 0) {\n      cout << a[r1++][c1--] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++)\n      cout << *(*(a + j) + i - j) << \"\\n\";\n  for (i = 1; i < row; i++)\n    for (j = 0; j < row - i && j < col; j++)\n      printf(\"%d\\n\", *(*(a + i + j) + col - 1 - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7096", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[111][111];\n  int *p[111];\n\n  cin >> row >> col;\n\n  for (int i = 0; i < row; i++)\n    p[i] = *(a + i);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n\n  for (int i = 0; i < row + col - 1; i++)\n    for (int j = i; j >= 0; j--) {\n      if (j >= col || i - j >= row)\n        continue;\n      if (j < col && i - j < row)\n        printf(\"%d\\n\", *(p[i - j] + j));\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, row, col, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < row; j++) {\n      if (i - j >= col || i - j < 0) {\n        continue;\n      }\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[200][200];\n  int i, j, row, col, sum;\n\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  if (col >= row) {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7099", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[103][103];\n  int row, col;\n  int i, j;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        cout << a[j][i - j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "7100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (i = 0; i < col - 1; i++)\n    for (j = 0, k = i; k >= 0 && j < row; k--, j++) {\n      cout << *(*(a + j) + k) << endl;\n    }\n  for (i = 0; i < row; i++)\n    for (j = col - 1, k = i; k < row && j >= 0; k++, j--) {\n      cout << *(*(a + k) + j) << endl;\n    }\n}\n"}
{"label": "4", "index": "7101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0}, i, j, m, n = 1;\n  cin >> r >> c;\n  for (i = 1; i <= r; i++) {\n    for (j = 1; j <= c; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < c; i++) {\n    m = i;\n    n = 1;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  for (i = 1; i <= r; i++) {\n    m = c;\n    n = i;\n    while ((m >= 1) && (n <= r)) {\n      cout << a[n][m] << endl;\n      m--;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, a[100][100], i, j, k, l, t;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cout << a[i][j] << endl;\n      }\n    }\n    return 0;\n  }\n  k = 0;\n  l = 0;\n  while (1) {\n    if (k < n && l < m)\n      printf(\"%d\\n\", a[k][l]);\n    if (l != 0) {\n      k++;\n      l--;\n      continue;\n    }\n    if (l == 0) {\n      t = k;\n      k = 0;\n      l = t + 1;\n    }\n    while (k >= n || l >= m) {\n      k++;\n      l--;\n      if (l == 0) {\n        t = k;\n        k = 0;\n        l = t + 1;\n      }\n      if (l + k == m + n) {\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100], row, col;\nvoid display(int step) {\n  int x, y, i;\n  if (step > row + col - 1)\n    return;\n  if (step < col) {\n    y = step - 1;\n    for (i = y; i >= 0 && y - i < row; i--)\n      cout << matrix[y - i][i] << endl;\n  } else {\n    x = step - col;\n    for (i = x; i < row && col - 1 + x - i >= 0; i++)\n      printf(\"%d\\n\", matrix[i][col - 1 + x - i]);\n  }\n  display(step + 1);\n}\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(matrix + i) + j);\n  display(1);\n}\n"}
{"label": "4", "index": "7104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], r, c;\nint judge(int i, int c) {\n  if (i - c >= 0)\n    return i - c + 1;\n  else\n    return 0;\n}\nint main() {\n  cin >> r >> c;\n  for (int i = 0; i < r; i++) {\n    for (int j = 0; j < c; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int i = 0; i < r + c - 1; i++) {\n    for (int j = judge(i, c); j <= i && j < r && i - j < c; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7105", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i, j, a[100][100];\n  double b[100][200];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      b[i][j] = 0.5;\n  scanf(\"%d %d \", &x, &y);\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      b[i][j + i] = a[i][j];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      if (b[i][j] != 0.5)\n        cout << b[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int hang, lie, a[100][100];\n  cin >> hang >> lie;\n  for (int i = 0; i < hang; i++) {\n    for (int j = 0; j < lie; j++) {\n      cin >> a[i][j]; \n    }\n  }\n  for (int k = 0; k < lie; k++) \n  {\n    for (int l = k; (l >= 0) && (k - l < hang);\n         l--) \n    {\n      cout << a[k - l][l] << endl << endl;\n    }\n  }\n  for (int p = lie; p < hang + lie - 1; p++) \n  {\n    for (int q = lie - 1; (q >= 0) && (p - q < hang); q--) {\n      cout << a[p - q][q] << endl << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7107", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  memset(a, '0', sizeof(a));\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  int(*p)[100] = a;\n  for (int i = 0; i < row + col - 1; i++) {\n    if (i < col) {\n      for (int j = 0; j <= row; j++) {\n        if (i - j < col && j < row && j >= 0 && i - j >= 0) {\n          cout << *(*(p + j) + i - j) << endl;\n        }\n      }\n    } else {\n      for (int j = 1; j < row; j++) {\n        if (i - j < col && j < row && i - j >= 0 && j >= 0) {\n          printf(\"%d\\n\", *(*(p + j) + i - j));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7108", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n\n  for (i = 0; i < col + row - 1; i++)\n    for (j = i, k = 0; (j >= 0) && (k < row); j--, k++) {\n      if (j < col)\n        cout << array[k][j] << endl;\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7110", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, sum = 0, max, min, a[100][100] = {0};\n  char s[81] = {\"\"};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "7111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, sum = 0, max, min, a[100][100] = {0};\n  char s[81] = {\"\"};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7112", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a[110][110] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (k = 0; k < row + col - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0) {\n      if ((i < row) && (j < col))\n        cout << *(*(a + i) + j) << endl;\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, k, s, p, q;\n  int a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  int temp_r, temp_c;\n  for (p = 0; p < row; p++) {\n    for (q = 0; q < col; q++) {\n      scanf(\"%d\", &a[p][q]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    temp_r = 0;\n    temp_c = i;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    temp_r = j;\n    temp_c = col - 1;\n    while (temp_r >= 0 && temp_r < row && temp_c >= 0 && temp_c < col) {\n      printf(\"%d \", a[temp_r][temp_c]);\n      temp_r++;\n      temp_c--;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "4", "index": "7114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i = 0, j = 0, x = 0, y;\n  scanf(\"%d %d \", &r, &c);\n  y = r + c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  while (x <= y) {\n    for (i = 0; i < r; i++)\n      for (j = 0; j < c; j++)\n        if (i + j == x)\n          cout << a[i][j] << endl;\n    x++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int R, C, i, j, k, l, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &R, &C);\n  for (i = 0; i < R; i++) {\n    for (j = 0; j < C; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < C; j++) {\n    i = 0;\n    while (i <= j) {\n      k = j - i;\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      if (i > R - 1)\n        break;\n    }\n  }\n  for (l = C; l < R + C - 1; l++) {\n    m = l - C + 1;\n    while (m <= l) {\n      n = l - m;\n      cout << a[m][n] << \"\\n\";\n      m++;\n      if (m > R - 1) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7116", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, s[100][100], i, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (k = 0; k < col; k++) {\n      cin >> s[i][k];\n    }\n  }\n  if (col < row) {\n    for (i = 0; i <= (row + col); i++) {\n      for (k = 0; k < row && k <= i; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  } else if (col >= row) {\n    for (i = 0; i <= (col + row); i++) {\n      for (k = 0; k <= i && k < row; k++) {\n        if ((i - k) >= col)\n          continue;\n        else\n          printf(\"%d\\n\", s[k][i - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, zz[100][100], k, t, i, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> zz[i][j];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    t = i;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        cout << zz[k++][t--] << endl;\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    t = n - 1;\n    for (j = 0;; j++) {\n      if (t >= 0 && k < m)\n        printf(\"%d\\n\", zz[k++][t--]);\n      if (t < 0 || k >= m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, k, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (n = 0; n < col; n++) {\n    i = 0;\n    j = n;\n    for (k = n; k >= 0; k--) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j >= col)\n        break;\n    }\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    for (k = n; k <= row - 1; k++) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n      if (i >= row || j < 0)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, s, i, j, a[100][100], p, q, r, t;\n  scanf(\"%d%d\", &m, &n);\n  s = m + n - 2;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (p = 0; p <= s; p++) {\n    if (m >= n) {\n      if (p <= (n - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (m - 1)) {\n          t = p - n + 1;\n          r = p;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    } else {\n      if (p <= (m - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (n - 1)) {\n          t = 0;\n          r = m - 1;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    }\n    for (q = t; q <= r; q++)\n      cout << a[q][p - q] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100][100];\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < m + n - 1; i++)\n    for (int j = n - 1; j >= 0; j--) {\n      if (i - j < m && i - j >= 0)\n        cout << *(*(a + i - j) + j) << \"\\n\";\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, shuzu[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n  if (row == col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row > col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((col - 1 - j) == 0) {\n          break;\n        }\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", shuzu[j][i - j]);\n        if ((i - j) == 0) {\n          break;\n        }\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", shuzu[i + j][col - 1 - j]);\n        if ((i + j + 1) == row) {\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7122", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, l, n, k, t;\n  int(*p)[100] = a;\n  int *q = a[0];\n  int row, column;\n  cin >> row >> column;\n  for (j = 0; j < row; j++) {\n    q = *(a + j);\n    for (l = 0; l < column; l++)\n      cin >> *(q + l);\n  }\n  for (i = 0; i <= row + column - 2; i++) {\n    for (k = 0; k < row; k++) {\n      for (t = 0; t < column; t++) {\n        if (k + t == i) {\n          printf(\"%d\\n\", *(*(p + k) + t));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  k = row + col;\n  for (a = 0; a < k - 1; a++) {\n    for (i = 0; i <= a; i++)\n      if (i < row && (a - i) < col)\n        cout << array[i][a - i] << \"\\n\";\n      else if (i >= row)\n        i++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7124", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0}, n = 0, m = 0, i = 0, j = 0;\nvoid bianli(int hang, int lie) {\n  if (lie == 0 || hang == n - 1)\n    cout << a[hang][lie] << endl;\n  else {\n    cout << a[hang][lie] << endl;\n    bianli(hang + 1, lie - 1);\n  }\n}\nint main() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < m; i++)\n    bianli(0, i);\n\n  for (i = 1; i < n; i++) {\n    bianli(i, m - 1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[200][200], f[200][200], n, m, i, j, flag, si, sj;\nint main() {\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      scanf(\"%d\", &a[i][j]);\n  while (1) {\n    flag = 0;\n    for (i = 1; i <= m; i++)\n      if (f[1][i] == 0) {\n        flag = 1;\n        f[1][i] = 1;\n        break;\n      }\n    if (flag == 0)\n      for (i = 1; i <= n; i++)\n        if (f[i][m] == 0) {\n          flag = 2;\n          f[i][m] = 1;\n          break;\n        }\n    if (flag == 1) {\n      si = 1;\n      sj = i;\n    }\n    if (flag == 2) {\n      si = i;\n      sj = m;\n    }\n    if (flag == 0)\n      return 0;\n    for (; si <= n && sj >= 1; si++, sj--)\n      cout << a[si][sj] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], y, x, i, j, k;\n  cin >> y >> x;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      cin >> a[i][j];\n  for (k = 0; k < x; k++)\n    for (i = 0; i < y && k - i >= 0; i++)\n      cout << a[i][k - i] << endl;\n  for (k = x; k < x + y - 1; k++)\n    for (j = x - 1; k - j < y && j >= 0; j--)\n      printf(\"%d\\n\", a[k - j][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7127", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int yao[300][300];\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &yao[i][j]);\n    }\n  }\n  for (i = n; i < 300; i++) {\n    for (j = 0; j < 300; j++) {\n      yao[i][j] = 00;\n    }\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n\n    for (i = 0; i <= k; i++) {\n      if (yao[i][k - i] != 00) {\n        printf(\"%d\\n\", yao[i][k - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; k < row && j > -1; j--, k++)\n      printf(\"%d\\n\", array[k][j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i, k = col - 1; j < row && k > -1; j++, k--) {\n      printf(\"%d\\n\", array[j][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int i;\n  for (i = 0; i < m * n; i++) {\n    cin >> a[i];\n  }\n  int *p;\n  int temp;\n  temp = 0;\n  int num = m + n - 1;\n  while (num--) {\n    p = a + temp;\n    i = temp;\n    while (i % n != 0 && i / n != m - 1) {\n      cout << *p << endl;\n      p = p + (n - 1);\n      i += (n - 1);\n    }\n    cout << *p << endl;\n    if (temp < n - 1) {\n      temp++;\n    } else {\n      temp += n;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int row, col;\n  int matrix[100 * 100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", matrix + i * 100 + j);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0 && k < row; j--, k++) {\n      cout << *(matrix + k * 100 + j) << \"\\n\";\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = col - 1, k = i; j >= 0 && k < row; j--, k++) {\n      printf(\"%d\\n\", *(matrix + k * 100 + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, N;\n  int a[101][101];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  N = row + col - 2;\n  for (k = 0; k <= N; k++) {\n    i = 0;\n    j = k - i;\n    do {\n      if (i >= 0 && j >= 0 && i < row && j < col) {\n        cout << a[i][j] << \"\\n\";\n        i++;\n        j--;\n      } else {\n        i++;\n        j--;\n      }\n    } while (j >= 0);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, row, col, rowc, colc;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = i; j >= 0; j--) {\n      colc = j;\n      rowc = i - j;\n      if (colc >= col) {\n        continue;\n      }\n      if (row > col && rowc >= row) {\n        continue;\n      }\n      if (col >= row && rowc == row) {\n        break;\n      }\n      cout << a[rowc][colc] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, row, col, n;\n  int sz[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  if (row > col) {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < col; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; j >= 0; j--) {\n        if (n - j < row) {\n          cout << sz[n - j][j] << \"\\n\";\n        }\n      }\n    }\n  } else {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < row; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; n - j < row; j--) {\n        printf(\"%d\\n\", sz[n - j][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7134", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int row, col;\n\n  int i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++)\n    for (j = i; j >= 0 && i - j < row; j--)\n      cout << a[i - j][j] << endl;\n\n  for (i = 1; i < row; i++)\n    for (j = col - 1; (j >= 0) && (i + col - 1 - j < row); j--)\n      printf(\"%d\\n\", a[i + col - 1 - j][j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100] = {0};\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  int step = 0;\n  i = 0;\n  j = 0;\n  int t;\n\n  if (row * col > 0) {\n    printf(\"%d\", a[0][0]);\n    step++;\n  }\n\n  while (step < row * col) {\n\n    if (i + 1 < 0 || j - 1 < 0) {\n\n      t = i;\n      i = j;\n      j = t + 1;\n      if (i < row && j < col) {\n        cout << \"\\n\" << a[i][j];\n        step++;\n      }\n    } else {\n      i = i + 1;\n      j = j - 1;\n      if (i < row && j < col) {\n        printf(\"\\n%d\", a[i][j]);\n        step++;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[99][99];\n  int row, col, i, j, t = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t < col) {\n      for (i = 0; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n\n    } else {\n      for (i = t + 1 - col; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, n[100][100], c, d, e, f, g, h, i, j, k, l;\n  scanf(\"%d%d\", &a, &b);\n  for (c = 1; c <= a; c++) {\n    for (d = 1; d <= b; d++) {\n      scanf(\"%d\", &n[c][d]);\n    }\n  }\n  if (a >= b) {\n    for (e = 1; e <= b; e++) {\n      for (f = 1; f <= e; f++) {\n        printf(\"%d\\n\", n[f][e + 1 - f]);\n      }\n    }\n    for (g = 2; g <= a; g++) {\n      for (h = 1; h <= b && g - 1 + h <= a; h++) {\n        printf(\"%d\\n\", n[g - 1 + h][b + 1 - h]);\n      }\n    }\n  } else {\n    for (i = 1; i <= b; i++) {\n      for (j = 1; j <= a && i + 1 - j > 0; j++) {\n        printf(\"%d\\n\", n[j][i + 1 - j]);\n      }\n    }\n    for (k = 2; k <= a; k++) {\n      for (l = 1; l <= a + 1 - k; l++)\n        printf(\"%d\\n\", n[k - 1 + l][b + 1 - l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7138", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  for (int k = 0; k < col; k++) {\n    if (k < row)\n      for (int i = 0; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = 0; i < row; i++) {\n        cout << array[i][k - i] << endl;\n      }\n  }\n  for (int k = col; k < row + col - 1; k++) {\n    if (k < row)\n      for (int i = k - col + 1; i <= k; i++)\n        cout << array[i][k - i] << endl;\n    else\n      for (int i = k - col + 1; i < row; i++)\n        cout << array[i][k - i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, l, i, k, g, s[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  for (g = 0; g <= (h + l - 2); g++) {\n    i = 0;\n    while (i < h) {\n      if (g - i >= l)\n        i++;\n      else {\n        break;\n      }\n    }\n\n    while (i < h && (g - i > -1) && (g - i < l)) {\n      printf(\"%d\\n\", s[i][g - i]);\n\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, k = 0, b[10000], s;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row >= col) {\n    for (s = 0; s < col; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < row; s++) {\n      for (i = s - col + 1; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < row + col - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  } else {\n    for (s = 0; s < row; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < col; s++) {\n      for (i = 0; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < col + row - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7141", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], h, l, i, j;\n  cin >> h >> l;\n  for (i = 0; i <= h - 1; i++) {\n    for (j = 0; j <= l - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= (i > h - 1 ? h - 1 : i); j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (i = l; i <= l + h - 2; i++) {\n    for (j = i - l + 1; j <= (i > h - 1 ? h - 1 : i); j++)\n      cout << a[j][i - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, temp = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  while (temp < col) {\n    j = temp;\n    i = 0;\n    while (i < row && j >= 0) {\n      cout << array[i++][j--] << endl;\n    }\n    temp++;\n  }\n  if (row > 1) {\n    temp = 1;\n    while (temp < row) {\n      j = col - 1;\n      i = temp;\n      while (i < row && j >= 0) {\n        cout << array[i++][j--] << \"\\n\";\n      }\n      temp++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, *p = NULL;\n  cin >> n >> m;\n  int a[n][m];\n  for (p = *a; p < *(a) + n * m; p++)\n    cin >> *p;\n  for (i = 0, j = 0; i < n; i++) {\n    for (; j < m; j++) {\n      p = *a + m * i + j;\n      for (int k = 0; k <= j && k <= m && k <= n && k < n - i; k++)\n        printf(\"%d\\n\", *(p + (m - 1) * k));\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num = 0, i, j, row, col, a[105][105], h;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (h = 0; h < col + row - 1; h++) {\n    if (h < col) {\n      for (i = 0; i < row && h - i >= 0 && h - i < col; i++) {\n        j = h - i;\n        cout << a[i][j] << \"\\n\";\n      }\n    } else\n      for (j = col - 1; j >= 0 && h - j >= 0 && h - j < row; j--) {\n        i = h - j;\n        cout << a[i][j] << \"\\n\";\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7145", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, col, i, j, k, sum;\n  cin >> row >> col;\n  sum = row + col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (k = 2; k <= sum; k++) {\n    if (k <= col + 1) {\n      i = 1;\n      j = k - 1;\n      do {\n        cout << a[i][j] << endl;\n        ;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    } else {\n      i = k - col;\n      j = k - i;\n      do {\n        cout << a[i][j] << endl;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, row, col;\n  int a[200][200] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 1; i < row + col + 1; i++)\n    for (j = 1; j <= i; j++)\n      if (a[j][i - j] != 0)\n        cout << a[j][i - j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    for (int i = 0; i <= sum; i++) {\n      if (i > row - 1)\n        break;\n      for (int j = 0; j <= sum; j++) {\n        if (j > col - 1)\n          break;\n        if (i + j == sum)\n          cout << a[i][j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      cout << array[j][i - j] << \"\\n\";\n      if (i - j == 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", array[j][col - 1 - j + i]);\n      if (col - 1 - j + i == 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, max, start, row, col;\n  int a[200][200];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  i = 1;\n  j = 1;\n  do {\n    printf(\"%d\\n\", a[i][j]);\n    i++;\n    j--;\n    if (j == 0)\n      if (i + j < col + 1) {\n        j = i;\n        i = 1;\n      } else {\n        i = i + j + 1 - col;\n        j = col;\n      }\n    if (i > row)\n      if (i + j < col + 1) {\n        j = i + j;\n        i = 1;\n      } else {\n        i = row + 2 + j - col;\n        j = col;\n      }\n\n  } while (i <= row);\n  return 0;\n}\n"}
{"label": "4", "index": "7150", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int i, j, r, s, p, k;\n  int a[100][100];\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (r = 0; r < n; r++) {\n    p = r;\n    for (s = 0; p >= 0; s++) {\n      if (s < m)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  for (k = n; k <= m + n - 2; k++) {\n    p = n - 1;\n    for (s = k - n + 1; s < m; s++) {\n      if (p >= 0)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7151", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], k, j, i, m;\n  scanf(\"%d %d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      cin >> a[j][i];\n    }\n  }\n\n  for (i = 0; i < col; i++) {\n    j = 0;\n    for (m = i; (j < row) && (m >= 0); j++, m--) {\n      printf(\"%d\\n\", a[j][m]);\n    }\n  }\n  for (j = 1; j < row; j++) {\n    i = col - 1;\n    for (m = i, k = j; (k < row) && (m >= 0); k++, m--) {\n      printf(\"%d\\n\", a[k][m]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7152", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a, b;\n  int s[100][100];\n  scanf(\"%d%d\", &a, &b);\n  for (j = 0; j < a; j++) {\n    for (i = 0; i < b; i++) {\n      cin >> s[j][i];\n    }\n  }\n  for (j = 0; j < b; j++) {\n    k = j;\n    for (i = 0;; i++) {\n      if (i == a) {\n        break;\n      }\n      printf(\"%d\\n\", s[i][k]);\n      k--;\n      if (k < 0) {\n        break;\n      }\n    }\n  }\n  for (j = 1; j < a; j++) {\n    k = j;\n    for (i = b - 1; i >= 0; i--) {\n      printf(\"%d\\n\", s[k][i]);\n      k++;\n      if (k == a) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int sz[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i <= k && i < m; i++, j--) {\n      printf(\"%d\\n\", sz[i][j]);\n    }\n    j = k;\n  }\n\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0 && i < m; i++, j--) {\n      printf(\"%d\\n\", sz[i][j]);\n    }\n    i = k;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7154", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int col, row, sz[99][99], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i && j < row; j++) {\n      printf(\"%d\\n\", sz[j][i - j]);\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j + i < row && j < col; j++) {\n      printf(\"%d\\n\", sz[i + j][col - j - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7155", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[200][200], n, m, j, i, k;\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++)\n      a[i][j] = -32767;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = k; i >= 0; i--) {\n      if (a[k - i][i] != -32767)\n        printf(\"%d\\n\", a[k - i][i]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, min, **p, row, col;\n  scanf(\"%d%d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  min = row < col ? row : col;\n  for (k = 0; k < min; k++)\n    for (i = 0, j = k; i <= k; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  if (col == min)\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row && j >= 0; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  else {\n    for (k = min; k < col; k++)\n      for (i = 0, j = k; i < row; i++, j--)\n        cout << *(*(p + i) + j) << \"\\n\";\n    for (k = 1; k < row; k++)\n      for (i = k, j = col - 1; i < row; i++, j--)\n        printf(\"%d\\n\", *(*(p + i) + j));\n  }\n}\n"}
{"label": "4", "index": "7157", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, k, i, j;\n  int a[100][100] = {{0}, {0}};\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (k = 0; k < row + col - 1;) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i + j == k) {\n          printf(\"%d\\n\", a[i][j]);\n        }\n      }\n    }\n    k++;\n  }\n}\n"}
{"label": "4", "index": "7158", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *a, *a0, *b, *p;\n  int row, col;\n  int r, c, t, i;\n  scanf(\"%d %d\", &row, &col);\n  a = (int *)calloc(100, 100 * sizeof(int));\n  a0 = a;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++)\n      scanf(\"%d\", a + r * col + c);\n  }\n  a = a0;\n  for (c = 0; c < row + col - 1; c++) {\n    r = 0;\n    t = c;\n    for (i = 0; i < row * col; i++) {\n      if (0 <= r && r < row && 0 <= t && t < col) {\n        printf(\"%d\", *(a + r * col + t));\n        if (r != row - 1 || t != col - 1)\n          printf(\"\\n\");\n      }\n      r++;\n      t--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ro, co, sz[100][1000], i, j, m, k, c = 0, b = 1;\n  scanf(\"%d%d\", &ro, &co);\n  for (i = 0; i < ro; i++) {\n    for (j = 0; j < co; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  m = ro * co;\n  i = 0;\n  j = 0;\n  for (k = 0; k < m; k++) {\n    printf(\"%d\\n\", sz[i][j]);\n    if (ro >= co) {\n      if (j == 0 && i < co - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if ((j < 0 && i > co - 1) || i > ro - 1) {\n        j = co - 1;\n        i = c + 1;\n        c++;\n      }\n    }\n    if (ro < co) {\n      if (j == 0 && i <= ro - 1) {\n        j = i + 2;\n        i = -1;\n      }\n      j--;\n      i++;\n      if (i > ro - 1) {\n        i = 0;\n        j = ro + c + 1;\n        c++;\n      }\n\n      if (j > co - 1) {\n        j = co - 1;\n        i = b;\n        b++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d %d\", &a, &b);\n  int n[1000][1000];\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int t = 0; t < b; t++) {\n    for (j = t, i = 0; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  for (int p = 1; p < a; p++) {\n    for (i = p, j = b - 1; i < a && j >= 0; i++, j--)\n      printf(\"%d\\n\", n[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[110][110];\n  int max, min;\n\n  scanf(\"%d %d \", &row, &col);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  if (row > col) {\n    max = row;\n    min = col;\n  } else {\n    max = col;\n    min = row;\n  }\n\n  for (int i = 0; i < min; i++)\n    for (int j = 0; j <= i; j++)\n      cout << a[j][i - j] << endl;\n\n  if (col != row) {\n    for (int i = min; i < max; i++) {\n      if (col > row)\n        for (int j = 0; j < min; j++)\n          cout << a[j][i - j] << endl;\n\n      else\n        for (int j = col - 1; j >= 0; j--)\n          cout << a[i - j][j] << endl;\n    }\n  }\n\n  for (int i = max; i <= row + col - 2; i++)\n    for (int j = col - 1; i - j <= row - 1; j--)\n      cout << a[i - j][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "7162", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (n = 0; n < row - 1 + col; n++) {\n    if (n < col) {\n      for (i = n; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n    if (n > col - 1) {\n      for (i = col - 1; ((n - i) <= (row - 1)) && (i >= 0); i--)\n        printf(\"%d\\n\", a[n - i][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7163", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i = 0, j = 0, h = 0, n = 0, m = 0, a[100][100];\n  scanf(\"%d %d \", &n, &m);\n  for (j = 0; j < n; j++) {\n    for (h = 0; h < m; h++) {\n      cin >> *(*(a + j) + h);\n    }\n  }\n  for (i = 0; i < n + m - 1; i++) {\n    for (j = 0; j < n; j++) {\n      for (h = 0; h < m; h++) {\n        if (j + h == i) {\n          cout << *(*(a + j) + h) << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, i, k, g, s[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      cin >> s[i][k];\n    }\n  }\n  for (g = 0; g <= (h + l - 2); g++) {\n    i = 0;\n    while (i < h) {\n      if (g - i >= l) {\n        i++;\n      } else {\n        break;\n      }\n    }\n\n    while (i < h && (g - i > -1) && (g - i < l)) {\n      cout << s[i][g - i] << \"\\n\";\n\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], row, col, t = 0, flag = 0, max;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  max = (row > col) ? row : col;\n  for (i = 0, j = 0;;) {\n    if (i < row && j < col)\n      cout << a[i][j] << \"\\n\";\n    if (i == max - 1 && j == max - 1)\n      break;\n    if (flag == 0) {\n      if (j == 0 && i == max - 1) {\n        flag = 1;\n        t = max;\n        j = max - 1;\n      } else if (j == 0) {\n        t = t + 1;\n        j = t;\n      } else\n        j = j - 1;\n    } else {\n      if (i == max - 1) {\n        t = t + 1;\n        j = max - 1;\n      } else\n        j = j - 1;\n    }\n    i = t - j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, row, col, i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < row + col - 1; i++) {\n    for (j = 0; j < row; j++) {\n      if (i - j >= col || i - j < 0) {\n        continue;\n      }\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7167", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, a[101][101], *p1, *p2, *p3, j, k;\nint main() {\n  scanf(\"%d %d \", &n, &m);\n  for (p1 = *a, j = 0; j < n; ++j, p1 += 101)\n    for (p2 = p1, k = 0; k < m; ++k, ++p2)\n      scanf(\"%d \", p2);\n  for (p2 = *a, j = 1; j <= m; ++j, ++p2)\n    for (p3 = p2, k = min(j, n); k--; p3 += 100)\n      cout << *p3 << endl;\n  for (p2 += 100, j = n - 1; j; --j, p2 += 101)\n    for (p3 = p2, k = min(m, j); k--; p3 += 100)\n      cout << *p3 << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, row, col;\n  int sz[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    cin >> sz[i][0];\n    for (j = 1; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (i = 0; i < row; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row; i < col; i++) {\n      for (j = 0, k = i; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  if (col < row) {\n    for (i = 0; i < col; i++) {\n      for (j = 0, k = i; j <= i; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      for (j = i, k = col - 1; k >= 0; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n    for (i = row - col + 1; i < row; i++) {\n      for (j = i, k = col - 1; j < row; j++, k--) {\n        printf(\"%d\\n\", sz[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7169", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0, 0}, row, col, i, j, count = 0, r = 0;\n  cin >> row >> col;\n  if (col == 1)\n    r = 1;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  i = 1;\n  j = 1;\n  while (count < row * col) {\n    cout << a[i][j] << endl;\n    count++;\n    if ((j == 1 && i != row) || (j != 1 && i == row) || (j == 1 && i == row)) {\n      if (i + j < col) {\n        j = i + j;\n        i = 1;\n      } else {\n        r++;\n        i = r;\n        j = col;\n      }\n    } else {\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0, k <= i; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  }\n  for (i = 1; i <= row - 1; i++)\n    for (j = col - 1, k = i; j >= 0, k <= row - 1; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      cout << a[k][j] << \"\\n\";\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (int i = 1; i <= col; i++) {\n    int k = 1;\n    while (k <= row && i - k + 1 >= 1) {\n      cout << *(*(a + k) + i - k + 1) << endl;\n      k++;\n    }\n  }\n  for (int i = 2; i <= row; i++) {\n    int k = 0;\n    while (i + k <= row && col - k >= 1) {\n      printf(\"%d\\n\", *(*(a + i + k) + col - k));\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (int i = 2; i <= col + row; i++)\n    for (int j = 1; j <= i - 1; j++) {\n      if (i - j > col)\n        continue;\n      if (j > row) {\n        continue;\n      }\n      cout << a[j][i - j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ROW, COL, row, col;\n  int k, i, j;\n  int sz[101][101];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, num[100][100];\n  cin >> m >> n;\n  cout << endl;\n  for (int u = 0; u < m; u++) {\n    for (int v = 0; v < n; v++)\n      cin >> num[u][v];\n    cout << endl;\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i)\n          printf(\"%d\\n\", num[j][k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < n; j++)\n    for (l = 0; (l < m) && (l <= j); l++)\n      printf(\"%d\\n\", a[l][j - l]);\n  for (i = 1; i < m; i++)\n    for (k = 0; (k < m - i) && (k < n); k++)\n      cout << a[i + k][n - k - 1] << \"\\n\";\n}\n"}
{"label": "4", "index": "7176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int row, col;\n  cin >> row >> col;\n  for (int i1 = 0; i1 < row; i1++) {\n    for (int j1 = 0; j1 < col; j1++)\n      cin >> *(*(a + i1) + j1);\n  }\n  if (row < col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1 && i - j >= 0)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 1; w--) {\n        if (k - w <= row - 1 && w <= col - 1)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  } else if (row > col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << \"\\n\";\n      }\n    }\n\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  } else if (row = col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    }\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7177", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint row, col;\nint array_1[101][101];\nint (*p)[101] = array_1;\nint f(int m, int n) {\n  int i;\n  if (m == row - 1 && n == col - 1) {\n    cout << *(*(p + m) + n);\n    return 0;\n  }\n  for (i = 0; m + i <= row - 1 && n - i >= 0; i++)\n    cout << *(*(p + m + i) + n - i) << endl;\n  if (n < col - 1)\n    return f(0, n + 1);\n  if (n >= col - 1)\n    return f(m + 1, col - 1);\n}\n\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array_1[i][j]);\n  f(0, 0);\n  return 0;\n}\n"}
{"label": "4", "index": "7178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i < col; i++) {\n    cout << *(*(a) + i) << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    cout << *(*(a + i) + col - 1) << endl;\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7179", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0, k = 0;\n  int str[100][100] = {0};\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> str[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; j >= 0; i++, j--) {\n      if (str[i][j] == 0)\n        break;\n      else\n        printf(\"%d\\n\", str[i][j]);\n    }\n  i = 0;\n  k = 0;\n  j = 0;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", str[i][j]);\n}\n"}
{"label": "4", "index": "7180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i = 0, j = 0, x = 0, y;\n  cin >> r >> c;\n  y = r + c;\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      cin >> a[i][j];\n  while (x <= y) {\n    for (i = 0; i < r; i++)\n      for (j = 0; j < c; j++)\n        if (i + j == x)\n          printf(\"%d\\n\", a[i][j]);\n    x++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, *p;\n  scanf(\"%d %d\", &row, &col);\n  p = (int *)malloc(sizeof(int) * row * col);\n  for (i = 0; i < row * col; i++)\n    scanf(\"%d\", p + i);\n  printf(\"%d\\n\", *p);\n  p++;\n  for (i = 1; i < col; i++, p++)\n    for (j = 0, k = 0; k <= i && (i + j) < (row * col); k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n  p += col - 1;\n  for (i = 1; i <= (row - 1); i++, p += col)\n    for (j = 0, k = 0; k < (row - i) && k < col && *(p + j) != 0;\n         k++, j = j + col - 1)\n      printf(\"%d\\n\", *(p + j));\n}\n"}
{"label": "4", "index": "7182", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100] = {0};\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int m = 0; m < row + col - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if (i + j == m) {\n          printf(\"%d\\n\", *(*(a + i) + j));\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "7183", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, num[110][110] = {0}, (*p)[110], i, j, a = 1,\n      b = col - 1, c, d;\n  p = num;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(p + i) + j);\n  }\n  for (i = 0; i < col; i++) {\n    a = 1;\n    c = i;\n    cout << *(*(p) + i) << endl;\n    while (i - 1 >= 0 && a < row) {\n      cout << *(*(p + a) + i - 1) << endl;\n      a++;\n      i--;\n    }\n    i = c;\n  }\n  for (j = 1; j < row; j++) {\n    b = col - 1;\n    d = j;\n    cout << *(*(p + j) + col - 1) << endl;\n    while (j + 1 < row && b - 1 >= 0) {\n      cout << *(*(p + j + 1) + b - 1) << endl;\n      j++;\n      b--;\n    }\n    j = d;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, t, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  row -= 1;\n  col -= 1;\n  t = row + col;\n  for (i = 0; i <= t; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row || (i - j) > col)\n        continue;\n      cout << a[j][i - j] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) { return a > b ? a : b; }\nint min(int a, int b) { return a < b ? a : b; }\nint main() {\n  int i, j, t, col, row, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (t = 0; t <= col - 1; t++) {\n    j = t;\n    for (i = 0; i <= min(t, row - 1); i++) {\n      printf(\"%d \", a[i][j]);\n      j--;\n    }\n  }\n  for (t = 1; t <= row - 1; t++) {\n    i = t;\n    for (j = col - 1; j >= max(col - row + t, 0); j--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, cnt = 1;\n  int a[201][201] = {0}, b[10001] = {0};\n  cin >> row >> col;\n  for (i = 1; i <= 200; i++) {\n    for (j = 1; j <= 200; j++)\n      a[i][j] = -1;\n  }\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  i = 1, j = 1;\n  while (cnt <= row * col) {\n    if (a[i][j] != -1)\n      b[cnt++] = a[i][j];\n    if (j == 1 || i == row) {\n      j = i + j;\n      i = 1;\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n  for (i = 1; i <= row * col; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col - 1; i++)\n    for (j = 0, k = i; k >= 0 && j < row; k--, j++) {\n      cout << *(*(a + j) + k) << endl;\n    }\n  for (i = 0; i < row; i++)\n    for (j = col - 1, k = i; k < row && j >= 0; k++, j--) {\n      cout << *(*(a + k) + j) << endl;\n    }\n}\n"}
{"label": "4", "index": "7188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ROW, COL, row, col;\n  int k, i, j;\n  int sz[101][101];\n  cin >> ROW >> COL;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--)\n      printf(\"%d\\n\", sz[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, col, row;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (col >= row) {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (l = 0; l < row && l <= k; l++) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n    for (m = 1; m < row; m++) {\n      for (n = 0; n < row - m && n < col; n++)\n        printf(\"%d\\n\", a[m + n][col - 1 - n]);\n    }\n  }\n}\n"}
{"label": "4", "index": "7190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < col; i++)\n    for (j = 0; j <= i && j < row; j++)\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n  for (i = 1; i < row; i++)\n    for (j = 0; j < row - i && j < col; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7191", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()         \n{                  \n  int row, col;    \n  int a[100][100]; \n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j]; \n  for (int m = 0; m < col + row - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if ((i + j) == m)          \n          cout << a[i][j] << endl; \n  return 0;\n} \n"}
{"label": "4", "index": "7192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int n = 0; n < col; n++) {\n    for (int i = 0, j = n; j >= 0 && i < row; i++, j--)\n      cout << a[i][j] << endl;\n    ;\n  }\n  for (int n = 1; n < row; n++) {\n    for (int i = n, j = col - 1; i < row && j >= 0; i++, j--)\n      cout << a[i][j] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7193", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", *(*(array + j) + i - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a >= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint min(int a, int b) {\n  if (a <= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint main() {\n  int a[100][100];\n  int hang, lie;\n  int i, j, k;\n  scanf(\"%d%d\", &hang, &lie);\n  for (i = 0; i <= hang - 1; i++) {\n    for (j = 0; j <= lie - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k <= hang + lie - 2; k++) {\n    for (i = max(0, k - lie + 1); i <= min(hang - 1, k); i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k, l;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (k = 0; k < col + row - 1; k++)\n    for (l = 0; k - l > -1; l++)\n      if (k - l < col && l < row)\n        printf(\"%d\\n\", array[l][k - l]);\n  return 0;\n}\n"}
{"label": "4", "index": "7196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, row, col, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row <= col) {\n    for (m = 0; m < row; m++)\n      for (n = 0; n <= m; n++)\n        cout << a[n][m - n] << \"\\n\";\n    for (m = row; m < col; m++)\n      for (n = 0; n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < (col + row); m++)\n      for (n = (m - col + 1); n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n  } else {\n    for (m = 0; m < col; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < row; m++)\n      for (n = col - 1; n >= 0; n--)\n        printf(\"%d\\n\", a[m - n][n]);\n    for (m = row; m < (col + row); m++)\n      for (n = col - 1; n >= (m - row + 1); n--)\n        printf(\"%d\\n\", a[m - n][n]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n = 0, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &(a[i][j]));\n  n = row + col - 1;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "7198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[111][111];\n  int *p[111];\n\n  scanf(\"%d %d \", &row, &col);\n\n  for (int i = 0; i < row; i++)\n    p[i] = *(a + i);\n\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n\n  for (int i = 0; i < row + col - 1; i++)\n    for (int j = i; j >= 0; j--) {\n      if (j >= col || i - j >= row)\n        continue;\n      if (j < col && i - j < row)\n        cout << *(p[i - j] + j) << \"\\n\";\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, *p[100], i, j, v;\n  for (i = 0; i < 100; i++)\n    p[i] = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\\n\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", (p[i] + j));\n  for (v = 0; v <= r + c - 2; v++) {\n    for (i = 0; i <= v; i++) {\n      if (i < r) {\n        j = v - i;\n        if (j < c)\n          printf(\"%d\\n\", *(p[i] + j));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7200", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, t;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (t = 0; t < col; t++)\n    for (i = 0, j = t; i <= t && j >= 0 && i < row; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  for (t = 1; t <= row - 1; t++) {\n    for (i = t, j = col - 1; j >= 0 && i <= row - 1; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7201", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int m, n, row, col, sz[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (m = 0; m < row; m++) {\n    for (n = 0; n < col; n++)\n      scanf(\"%d\", &sz[m][n]);\n  }\n  for (k = 0; k < col; k++) {\n    m = 0;\n    n = k;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    m = k;\n    n = col - 1;\n    while (n >= 0 && m != row) {\n      printf(\"%d\\n\", sz[m][n]);\n      m++;\n      n--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num[101][101];\nint main(void) {\n  int i = 0, j = 1, k = 1, x, y, row, col, n = 1;\n  scanf(\"%d%d\", &row, &col);\n  for (x = 0; x <= row - 1; x++)\n    for (y = 0; y <= col - 1; y++)\n      scanf(\"%d \", &num[x][y]);\n  cout << num[0][0] << \"\\n\";\n  while (n < row * col) {\n    int flag = 0;\n    while (j >= 0 && i <= row - 1 && j <= col - 1) {\n      printf(\"%d\\n\", num[i][j]);\n      i++;\n      j--;\n      n++;\n      flag = 1;\n    }\n    if (flag == 1)\n      k++;\n    if (k <= col - 1) {\n      i = 0;\n      j = k;\n    } else {\n      i = k - col + 1;\n      j = col - 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row - 1 || i - j > col - 1)\n        continue;\n      if (j < row && i - j < col) {\n        printf(\"%d\\n\", array[j][i - j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7204", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; (i < row) && (j >= 0); i++, j--)\n      cout << a[i][j] << endl;\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      cout << a[i][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "7205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m, p;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n\n  for (m = 0; m <= col + row - 2; m++) {\n    if (m < col) {\n      for (p = 0; p <= row - 1 && p <= m; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n\n    if (m >= col) {\n      for (p = m - col + 1; p <= m && p <= row - 1; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int hang, lie;\n  cin >> hang >> lie;\n  int i, j;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < lie; j++)\n      cin >> a[i][j];\n  }\n  int t;\n  for (t = 0; t <= hang + lie - 2; t++) {\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == t)\n          cout << a[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int hang, lie, a[100][100];\n  cin >> hang >> lie;\n  for (int i = 0; i < hang; i++) {\n    for (int j = 0; j < lie; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int k = 0; k < lie; k++) {\n    for (int l = k; (l >= 0) && (k - l < hang); l--) {\n      cout << a[k - l][l] << endl << endl;\n    }\n  }\n  for (int p = lie; p < hang + lie - 1; p++) {\n    for (int q = lie - 1; (q >= 0) && (p - q < hang); q--) {\n      cout << a[p - q][q] << \"\\n\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ROW, COL, j;\n  scanf(\"%d%d\", &ROW, &COL);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      cin >> sz[row][col];\n    }\n  }\n  if (ROW == COL) {\n    if (ROW == 1) {\n      printf(\"%d\\n\", sz[ROW - 1][COL - 1]);\n    } else {\n      for (col = 0; col < COL; col++) {\n        j = col;\n        row = 0;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (col > -1);\n        col = j;\n      }\n      for (row = 1; row < ROW; row++) {\n        j = row;\n        col = COL - 1;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (row < ROW);\n        row = j;\n      }\n    }\n  } else {\n    for (col = 0; col < COL - 1; col++) {\n      j = col;\n      row = 0;\n      do {\n        cout << sz[row][col] << \"\\n\";\n        row++;\n        col--;\n      } while ((col > -1) && (row < ROW));\n      col = j;\n    }\n    for (row = 0; row < ROW; row++) {\n      j = row;\n      col = COL - 1;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((row < ROW) && (col > -1));\n      row = j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, (*p)[100], row, col, r, c, j;\n  scanf(\"%d %d\", &row, &col);\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < col; i++) {\n    r = 0;\n    c = i;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    r = i;\n    c = col - 1;\n    while (r < row && c >= 0) {\n      printf(\"%d\\n\", *(*(p + r) + c));\n      r++;\n      c--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j, c = 1;\n  int *p = a[0];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < row * col; i++) {\n    cout << *p << endl;\n    if ((p - a[0]) % 100 == 0 || (p - a[0]) / 100 >= row - 1) {\n      c++;\n      if (c <= col)\n        p = a[0] + c - 1;\n      else\n        p = a[0] + (c - col) * 100 + col - 1;\n    } else\n      p = p + 99;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h, l, a[1000][1000], j, i, k;\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < l; k++)\n    for (j = k, i = 0; (j >= 0 && i < h); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < h; k++)\n    for (j = l - 1, i = k; (i < h && j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[101][101], *p1, *p2, *p3, j, k;\nint main() {\n  cin >> n >> m;\n  for (p1 = *a, j = 0; j < n; ++j, p1 += 101)\n    for (p2 = p1, k = 0; k < m; ++k, ++p2)\n      cin >> *p2;\n  for (p2 = *a, j = 1; j <= m; ++j, ++p2) \n    for (p3 = p2, k = min(j, n); k--; p3 += 100)\n      cout << *p3 << endl;\n  for (p2 += 100, j = n - 1; j; --j, p2 += 101) \n    for (p3 = p2, k = min(m, j); k--; p3 += 100)\n      cout << *p3 << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, t, i, j, k;\n  int a[101][101];\n  cin >> row >> col;\n  t = row + col - 1;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (i = 0; i < t; i++)\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        if ((j + k) == i) {\n          cout << *(*(a + j) + k) << endl;\n          break;\n        }\n  return 0;\n}\n"}
{"label": "4", "index": "7214", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100] = {0};\n  int row, col;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int m = 0; m < row + col - 1; m++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        if (i + j == m)\n          cout << *(*(a + i) + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7215", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, l, k, t;\n  int(*p)[100] = a;\n  int *q = a[0];\n  int row, column;\n  cin >> row >> column;\n  for (j = 0; j < row; j++) {\n    q = *(a + j);\n    for (l = 0; l < column; l++)\n      cin >> *(q + l);\n  }\n  for (i = 0; i <= row + column - 2; i++) {\n    for (k = 0; k < row; k++) {\n      for (t = 0; t < column; t++) {\n        if (k + t == i)\n          printf(\"%d\\n\", *(*(p + k) + t));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, k = 0, b[10000], s;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (row >= col) {\n    for (s = 0; s < col; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < row; s++) {\n      for (i = s - col + 1; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < row + col - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  } else {\n    for (s = 0; s < row; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < col; s++) {\n      for (i = 0; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < col + row - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7217", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < (m + n); i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i) {\n          printf(\"%d\\n\", a[j][k]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[102][102], i, j, k;\n  int(*p)[102] = a;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      cout << *(*(p + i) + k) << endl;\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      cout << *(*(p + k) + j);\n      if (i != row - 1 || j != col - 1)\n        cout << endl;\n      k++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int yao[300][300];\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &yao[i][j]);\n    }\n  }\n  for (i = n; i < 300; i++) {\n    for (j = 0; j < 300; j++) {\n      yao[i][j] = 00;\n    }\n  }\n\n  for (k = 0; k <= n + m - 2; k++) {\n\n    for (i = 0; i <= k; i++) {\n      if (yao[i][k - i] != 00) {\n        cout << yao[i][k - i] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[101][101];\n  int(*p)[101] = NULL;\n  p = array;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  }\n  for (int k = 0; k < row + col - 1; k++) {\n    for (int i = 0; i < row; i++) {\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          cout << *(p[i] + j) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int x, int y) {\n  if (x <= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int a[100][100], row, col, ROW, COL, i, m = 1, n = 0, x;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n  x = min(ROW, COL);\n  row = 0;\n  col = 0;\n  for (i = 0; i < x + x * (x - 1) / 2; i++) {\n    printf(\"%d\\n\", a[row][col]);\n    n++;\n    if (n != m) {\n      row++;\n      col--;\n    } else if (n == m) {\n      row = 0;\n      col += m;\n      m++;\n      n = 0;\n    }\n  }\n  if (COL >= ROW) {\n    row = 0;\n    col = ROW;\n    m = col + 1;\n    for (i = 0; i < ROW * (COL - ROW); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (row != ROW - 1) {\n        row++;\n        col--;\n      } else {\n        row = 0;\n        col = m;\n        m++;\n      }\n    }\n    row = 1;\n    col = COL - 1;\n    m = ROW - 1;\n    n = 0;\n    for (i = 0; i < ROW * (ROW - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  if (COL < ROW) {\n    row = 1;\n    col = COL - 1;\n    m = 2;\n    for (i = 0; i < COL * (ROW - COL); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (col != 0) {\n        row++;\n        col--;\n      } else {\n        row = m;\n        col = COL - 1;\n        m++;\n      }\n    }\n    row = ROW - COL + 1;\n    col = COL - 1;\n    m = COL - 1;\n    n = 0;\n    for (i = 0; i < COL * (COL - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < row + col - 1; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        if (i + j == k && k - i >= 0)\n          cout << a[i][k - i] << \"\\n\";\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "7223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[101][101];\n  int row, col;\n  cin >> row >> col;\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(number + i) + j);\n    }\n  }\n\n  int k;\n  for (i = 0; i < row + col - 1; i++) {\n    j = 0;\n\n    for (j = 0; i - j >= 0; j++) {\n      if (j >= row || i - j >= col)\n        continue;\n      printf(\"%d\\n\", *(*(number + j) + i - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7224", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, a[100][100], x = 0, y = 0, k = 0, l = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (;;) {\n    printf(\"%d\\n\", a[x][y]);\n    if (x == n - 1 && y == m - 1)\n      break;\n    if (y == 0 || x == n - 1) {\n      if (l == m - 1)\n        k++;\n      else\n        l++;\n      x = k;\n      y = l;\n      continue;\n    }\n    x++;\n    y--;\n  }\n}\n"}
{"label": "4", "index": "7225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int array[100][100];\n  int(*p)[100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  p = array;\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = (i >= col) ? (i - col + 1) : 0; (j < row) && (i - j >= 0); j++)\n      printf(\"%d\\n\", *(*(p + j) + i - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[1000][1000], a[1000];\n  int row, col;\n  int i, j;\n\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n\n  for (i = 0; i < col + row; i++) {\n    if (i < col)\n      a[i] = 0;\n    else\n      a[i] = i - col + 1;\n  }\n\n  for (i = 0; i < col + row; i++)\n    for (j = a[i]; j < row && j <= i; j++)\n      printf(\"%d\\n\", array[j][i - j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7227", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 2; i <= n + m; i++)\n    for (j = max(1, i - m); j <= min(n, i - 1); j++)\n      printf(\"%d\\n\", a[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[m + 1][n + 1];\n  for (int i = 1; i <= m; i++)\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  if (m == 1)\n    for (int i = 1; i <= n; i++)\n      cout << a[1][i] << endl;\n  else if (n == 1)\n    for (int i = 1; i <= m; i++)\n      cout << a[i][1] << endl;\n  else if (m < n) {\n    for (int i = 2; i <= m; i++)\n      for (int j = 1; j < i; j++)\n        printf(\"%d\\n\", a[j][i - j]);\n    for (int i = m + 1; i <= n + 1; i++)\n      for (int j = i - 1; j >= i - m; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = n + 2; i <= n + m; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  } else if (m >= n) {\n    for (int i = 2; i <= n; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = n + 1; i <= m + 1; i++)\n      for (int j = n; j >= 1; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = m + 2; i <= m + n; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  }\n  for (int s = 0; s < row + col - 1; s++) {\n    for (int i = 0; i < row; i++) {\n      if (s - i >= 0 && s - i < col)\n        cout << *(*(a + i) + s - i) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[101][101], i, j;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &array[i][j]);\n  col--;\n  row--;\n  for (i = 0; i <= row + col; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j <= col && j <= row)\n        cout << array[j][i - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, k = 0, b[10000], s;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row >= col) {\n    for (s = 0; s < col; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < row; s++) {\n      for (i = s - col + 1; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < row + col - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  } else {\n    for (s = 0; s < row; s++) {\n      for (i = 0; i <= s; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = row; s < col; s++) {\n      for (i = 0; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n    for (s = col; s < col + row - 1; s++) {\n      for (i = s - col + 1; i < row; i++) {\n        b[k] = a[i][s - i];\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7232", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, col, row, array[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  int csx, rxx = 0;\n  for (i = 0; i < col; i++) {\n    csx = i;\n    rxx = 0;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  for (j = 1; j < row; j++) {\n    rxx = j;\n    csx = col - 1;\n    while (csx >= 0 && csx < col && rxx >= 0 && rxx < row) {\n      printf(\"%d\\n\", array[rxx][csx]);\n      csx--;\n      rxx++;\n    }\n  }\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "4", "index": "7233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= (m + n - 2); i++) {\n    for (j = 0; j <= (m - 1) && j <= i; j++) {\n      if ((i - j) <= (n - 1))\n        printf(\"%d \", a[j][i - j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7234", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < m + n; i++) {\n    int j = 0;\n    while (j <= i) {\n      if (j < m && i - j < n) {\n        cout << a[j][i - j] << endl;\n      }\n      j++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (n = 0; n < col; n++) {\n    for (i = 0; i < n + 1 && i < row; i++) {\n      j = n - i;\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (n = col; n < col + row - 1; n++) {\n    for (i = n - col + 1; i < row && i < n + 1; i++) {\n      j = n - i;\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "7236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, ji;\n  int su[100][100];\n  int h = 0, l = 0, sum, shibie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &su[i][j]);\n    }\n  }\n  ji = row * col;\n  while (ji != 0) {\n    for (sum = 0; sum < (row + col - 1); sum++) {\n      if (sum < col) {\n        l = sum;\n        h = 0;\n      } else {\n        h = sum - col + 1;\n        l = col - 1;\n      }\n      do {\n        printf(\"%d\\n\", su[h][l]);\n        ji--;\n        l--;\n        h++;\n      } while ((l >= 0) && (h < row));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[105][105], row, col, (*p)[105];\n  p = array;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  int i, j, m = 0;\n  while (1) {\n    if (m < col) {\n      for (i = 0, j = m; j >= 0 && i <= row - 1; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    } else {\n      for (i = m - col + 1, j = col - 1; i <= row - 1 && j >= 0; i++, j--) {\n        cout << *(*(p + i) + j) << endl;\n      }\n    }\n    m++;\n    if (m == row + col)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int a[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    for (int i = 0; i <= sum; i++) {\n      if (i > row - 1)\n        break;\n      for (int j = 0; j <= sum; j++) {\n        if (j > col - 1)\n          break;\n        if (i + j == sum)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k[100][100];\n  int m = 0, x = 0, i, j, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    for (j = m;; j--) {\n      if (j >= col || m - j >= row) {\n        break;\n      }\n      if (j < 0 || m - j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  for (m = col; m < row + col - 1; m++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (m - j >= row) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h, l, i, j, sz[100][100];\n  cin >> h >> l;\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int k, n;\n  if (h > l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= l - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else if (k > l - 1 && k <= h - 1) {\n        for (i = k - l + 1; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else if (h < l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          cout << \"\\n\" << sz[i][k - i];\n        }\n      } else if (k > h - 1 && k <= l - 1) {\n        for (i = 0; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - h + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7241", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> m >> n; \n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < m + n - 1; i++) {\n    for (int j = 0; j <= i; j++) {\n      if ((j < m) && (i - j < n))\n        cout << *(*(a + j) + i - j) << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int(*p)[100];\n  p = (int(*)[100])malloc(row * col * sizeof(int));\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  int k;\n  for (k = 0; k < col; k++) {\n    for (i = 0, j = k; i < row && j >= 0; i++, j--)\n      printf(\"%d\\n\", *(*(p + i) + j));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = k, j = col - 1; i < row && j >= 0; i++, j--) {\n      printf(\"%d\\n\", *(*(p + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "7243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r, c, *p, n, m, i, j, k;\nint main() {\n  void x(int i);\n  void y(int i);\n  scanf(\"%d %d\", &r, &c);\n  n = r * c;\n  m = r + c - 2;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i < c; i++)\n    x(i);\n  for (i = c; i <= m; i++)\n    y(i);\n  return 0;\n}\nvoid x(int i) {\n  int a;\n  for (a = i; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\nvoid y(int i) {\n  int a;\n  for (a = c - 1; a >= 0 && (i - a) < r; a--)\n    printf(\"%d\\n\", *(p + (i - a) * c + a));\n}\n"}
{"label": "4", "index": "7244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, k, n, j;\n  int ROW, COL, row, col;\n  scanf(\"%d %d\", &ROW, &COL);\n  if (ROW > COL) {\n    j = COL - 1;\n  } else {\n    j = ROW - 1;\n  }\n  for (i = 0; i < ROW; i++) {\n    for (k = 0; k < COL; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n    }\n  }\n  for (n = 0; n <= j; n++) {\n    for (row = 0; row <= n; row++) {\n      printf(\"%d\\n\", sz[row][n - row]);\n    }\n  }\n  if (COL > ROW) {\n    for (n = j + 1; n < COL; n++) {\n      for (row = 0; row < ROW; row++) {\n        printf(\"%d\\n\", sz[row][n - row]);\n      }\n    }\n    for (n = COL; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  if (ROW > COL) {\n    for (n = j + 1; n < ROW; n++) {\n      for (col = COL - 1; col >= 0; col--) {\n        cout << sz[n - col][col] << \"\\n\";\n      }\n    }\n    for (n = ROW; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        cout << sz[n - col][col] << \"\\n\";\n      }\n    }\n  }\n  if (ROW == COL) {\n    for (n = j + 1; n <= COL + ROW - 2; n++) {\n      for (col = COL - 1; col >= n - ROW + 1; col--) {\n        printf(\"%d\\n\", sz[n - col][col]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100], ROW, COL;\n  int i, j, z, t;\n  scanf(\"%d %d\", &ROW, &COL);\n  for (j = 0; j < ROW; j++) {\n    for (i = 0; i < COL; i++) {\n      scanf(\"%d\", &sz[j][i]);\n    }\n  }\n  t = ROW + COL;\n  for (z = 0; z < t; z++) {\n    for (j = 0; j < ROW; j++) {\n      i = z - j;\n      if ((i >= 0) && (i < COL)) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7246", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, ROW, COL, array[100][100];\n  scanf(\"%d %d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &array[row][col]);\n    }\n  }\n  if (ROW > 1 && COL > 1) {\n    for (col = 0; col < COL; col++) {\n      for (row = 0; row < ROW; row++) {\n        if (col - row < 0)\n          break;\n        else\n          printf(\"%d\\n\", array[row][col - row]);\n      }\n    }\n    for (row = 1; row < ROW - 1; row++) {\n      for (col = COL - 1; col >= 0; col--) {\n        if (row + COL - 1 - col > ROW - 1)\n          break;\n        else\n          printf(\"%d\\n\", array[row + COL - 1 - col][col]);\n      }\n    }\n  }\n  if (ROW == 1 && COL > 1) {\n    for (col = 0; col < COL - 1; col++) {\n      printf(\"%d\\n\", array[0][col]);\n    }\n  }\n  if (COL == 1 && ROW > 1) {\n    for (row = 0; row < ROW - 1; row++) {\n      printf(\"%d\\n\", array[row][0]);\n    }\n  }\n  printf(\"%d\", array[ROW - 1][COL - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "7247", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col, i, j, s;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (s = 0; s < row + col - 1; s++) {\n    for (i = 0; i < row; i++) {\n      if (s - i < col) {\n        if (s >= i)\n          printf(\"%d\\n\", a[i][s - i]);\n        else\n          break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7248", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[104][104];\n  int h, l;\n  cin >> h >> l;\n  for (int i = 0; i < 104; i++)\n    for (int k = 0; k < 104; k++)\n      a[i][k] = -999;\n  for (int i = 1; i <= h; i++)\n    for (int k = 1; k <= l; k++)\n      cin >> a[i][k];\n  int printer = a[1][1];\n  for (int i = 1; i <= l; i++) {\n    int k = 0;\n    printer = a[1 + k][i - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[1 + k][i - k];\n    }\n  }\n  for (int i = 2; i <= h; i++) {\n    int k = 0;\n    printer = a[i + k][l - k];\n    while (printer != -999) {\n      cout << printer << endl;\n      ;\n      k++;\n      printer = a[i + k][l - k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7249", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[101][101], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  col--;\n  row--;\n  for (i = 0; i <= row + col; i++)\n    for (j = 0; j <= i; j++)\n      if (i - j <= col && j <= row)\n        printf(\"%d\\n\", array[j][i - j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, *p, i, j, k;\n  p = (int *)malloc(11000 * sizeof(int));\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a * b; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 0; i < b; i++) {\n    k = i;\n    j = 0;\n    while (k >= 0 && j < a) {\n      cout << *(p + k + j * b) << \"\\n\";\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    k = i;\n    j = 0;\n    while (k < a && j < b) {\n      printf(\"%d\\n\", *(p + b - 1 - j + k * b));\n      j++;\n      k++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7251", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y;\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[row][col];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int n;\n  n = row + col - 2;\n  for (int i = 0; i < col; i++) {\n    for (x = 0, y = i - x; x >= 0 && y >= 0 && x < row && y < col; x++, y--) {\n\n      cout << a[x][y] << endl;\n    }\n  }\n  for (int j = col; j <= n; j++) {\n    for (y = col - 1, x = j - y; x >= 0 && y >= 0 && x < row && y < col;\n         y--, x++) {\n      cout << a[x][y] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7252", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int i = 0, j = 0;\n  int ar[101][101];\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> ar[i][j];\n\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row > col) {\n    for (i = 0; i <= col - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row - 1; i++)\n      for (j = col - 1; j >= 0; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n\n    for (i = row; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  if (row < col) {\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= i; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = row; i <= col - 1; i++)\n      for (j = 0; j <= row - 1; j++)\n        printf(\"%d\\n\", ar[j][i - j]);\n\n    for (i = col; i <= row + col - 2; i++)\n      for (j = col - 1; j >= i - row + 1; j--)\n        printf(\"%d\\n\", ar[i - j][j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int **p, **q;\n  p = (int **)malloc(100 * sizeof(int *));\n  for (i = 0; i < 100; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", (*(p + i) + j));\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if ((j < m) && ((i - j) < n)) {\n        if (i == 0) {\n          printf(\"%d\", *(*(p + j) + i - j));\n        } else {\n          printf(\"\\n%d\", *(*(p + j) + i - j));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i <= row - 1; i++)\n\n  {\n    for (int s = 0; s <= col - 1; s++) {\n      scanf(\"%d \", &a[i][s]);\n    }\n    printf(\"\\n\");\n  }\n  int h = -1, l = 2;\n  cout << a[0][0] << endl;\n  for (int t = 1; t <= col - 1; t++) {\n\n    while (l > 0 && h < row - 1) {\n      h++;\n      l--;\n      cout << a[h][l] << endl;\n    }\n    l = t + 2;\n    h = -1;\n  }\n  int d = col, b = 0;\n  for (int j = 1; j <= row - 1; j++) {\n    while (d > 0 && b < row - 1) {\n      d--;\n      b++;\n      cout << a[b][d] << endl;\n    }\n    d = col;\n    b = j;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, **p, k;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      printf(\"%d\\n\", *(*(p + i) + k));\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      cout << *(*(p + k) + j) << \"\\n\";\n      k++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "7256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int row;\n  int col;\n  int i;\n  int j;\n  int t;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n\n  for (t = 0; t < col; t++) {\n    for (i = 0; i < row; i++) {\n      j = t - i;\n      if (j < 0) {\n        break;\n      }\n      cout << array[i][j] << \"\\n\";\n    }\n  }\n\n  for (t = col; t <= col + row - 2; t++) {\n    for (j = col - 1;; j--) {\n      i = t - j;\n      if (j < 0)\n        break;\n\n      if (i >= row) {\n        break;\n      }\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int array[row][col];\n  int i, j, k, l;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (k = 0; k < col + row - 1; k++)\n    for (l = 0; k - l > -1; l++)\n      if (k - l < col && l < row)\n        cout << array[l][k - l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          printf(\"%d\\n\", a[i][j]);\n      }\n  }\n}\n"}
{"label": "4", "index": "7259", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ROW, COL, ARRAY[1000][1000];\n\nint main() {\n  cin >> ROW >> COL;\n  for (int i = 0; i < ROW; i++) {\n    for (int j = 0; j < COL; j++)\n      cin >> ARRAY[i][j];\n  }\n  int iterx = 0, itery = 0;\n  for (int iter = 1; iter <= (ROW + COL - 1); iter++) {\n    if (iter <= COL) {\n      iterx = 0;\n      itery = iter - 1;\n    } else {\n      iterx = iter - COL;\n      itery = COL - 1;\n    }\n    while (iterx < ROW && itery >= 0) {\n      printf(\"%d\\n\", ARRAY[iterx][itery]);\n      iterx++;\n      itery--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int col, row = 0;\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  cout << **array << endl;\n  if (row == 1 && col == 1)\n    return 0;\n  if (col == 1) {\n    for (int i = 1; i < row; i++)\n      printf(\"%d\\n\", **(array + i));\n    return 0;\n  }\n  int r = 0, l = 1;\n  int begl = 1, begr = 0;\n  while (r != row - 1 || l != col - 1) {\n    cout << *(*(array + r) + l) << endl;\n    r++;\n    l--;\n    if (l < 0 || r == row) {\n      begl++;\n      if (begl == col) {\n        begl--;\n        begr++;\n      }\n      l = begl;\n      r = begr;\n    }\n  }\n  printf(\"%d\\n\", *(*(array + r) + l));\n\n  return 0;\n}\n"}
{"label": "4", "index": "7261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  if (row <= col) {\n    for (m = 0; m < row; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = row; m < col; m++)\n      for (n = 0; n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < (col + row); m++)\n      for (n = (m - col + 1); n < row; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n  } else {\n    for (m = 0; m < col; m++)\n      for (n = 0; n <= m; n++)\n        printf(\"%d\\n\", a[n][m - n]);\n    for (m = col; m < row; m++)\n      for (n = col - 1; n >= 0; n--)\n        printf(\"%d\\n\", a[m - n][n]);\n    for (m = row; m < (col + row); m++)\n      for (n = col - 1; n >= (m - row + 1); n--)\n        printf(\"%d\\n\", a[m - n][n]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, zong, x, y, sum, zanshi;\n  int *c, *d;\n  scanf(\"%d %d\", &m, &n);\n  zong = m * n;\n  d = (int *)malloc(zong * sizeof(int));\n  c = d;\n  for (; c < d + zong; c++)\n    scanf(\"%d\", c);\n  for (sum = 2; sum <= m + n; sum++) {\n    for (y = 1; y < sum; y++) {\n      x = sum - y;\n      zanshi = n * (y - 1) + x;\n      if (x <= n && y <= m && zanshi >= 1 && zanshi <= zong)\n        printf(\"%d\\n\", *(d + zanshi - 1));\n    }\n  }\n}\n"}
{"label": "4", "index": "7263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint mhang(int a) { return a + 1; }\nint mlie(int a) { return a - 1; }\nint main() {\n  int sz[100][100];\n  int row, col, i, j, hang = 0, lie = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    hang = 0;\n    lie = i;\n    while (1) {\n      cout << sz[hang][lie] << \"\\n\";\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    hang = i;\n    lie = col - 1;\n    while (1) {\n      cout << sz[hang][lie] << \"\\n\";\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &m, &n);\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < m + n - 1; i++) {\n    for (int j = 0; j <= i; j++) {\n      if ((j < m) && (i - j < n)) {\n        cout << *(*(a + j) + i - j) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7265", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int(*p)[100], i, j, k, m, n, flag = 0;\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = i; k >= 0; k--) {\n      if (i - k <= m - 1) {\n        printf(\"%d \", *(*(p + i - k) + k));\n      }\n      flag = i;\n    }\n  }\n  if (flag == n - 1) {\n    for (j = 1; j < m; j++) {\n      for (k = j; k < m; k++) {\n        if ((n + j - k - 1) <= (n - 1) && (n + j - k - 1) >= 0) {\n          printf(\"%d \", *(*(p + k) + n + j - k - 1));\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, **p, k;\n  scanf(\"%d %d\", &row, &col);\n  p = (int **)malloc(row * sizeof(int *));\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(col * sizeof(int));\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < col; j++) {\n    i = 0;\n    k = j;\n    while (k >= 0 && i < row) {\n      cout << *(*(p + i) + k) << \"\\n\";\n      i++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    j = col - 1;\n    k = i;\n    while (k < row && j >= 0) {\n      cout << *(*(p + k) + j) << \"\\n\";\n      k++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "7267", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, f[100][100], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> f[i][j];\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 0; i <= j && i < row; i++) {\n      printf(\"%d\", f[i][j - i]);\n      printf(\"\\n\");\n    }\n  }\n  for (j = 1; j < row; j++) {\n    for (i = j; i < row && i <= j + col - 1; i++) {\n      printf(\"%d\", f[i][col - 1 + j - i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid move1(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < m - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n    }\n  }\n  for (i = m - 1; i < n - 1; i++) {\n    for (k = 0; k < m; k++)\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nvoid move2(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < n - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      cout << *(p[0 + k] + i - k) << \"\\n\";\n    }\n  }\n  for (i = 0; i < m - n; i++) {\n    for (k = 0; k < n; k++)\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n  }\n  for (i = m - n; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nint main() {\n  int m, n, i, j, *p[100] = {0}, **head;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    p[i] = (int *)malloc(n * sizeof(int));\n  }\n  head = p;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  if (m <= n)\n    move1(p, m, n);\n  else\n    move2(p, m, n);\n}\n"}
{"label": "4", "index": "7270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, l;\n  scanf(\"%d%d\", &n, &m);\n  int *p[100];\n  for (i = 0; i < n; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < m; i++) {\n    if (i - (n - 1) >= 0) {\n      for (l = 0; l < n; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    } else {\n      for (l = 0; l <= i; l++)\n        printf(\"%d\\n\", *(*(p + l) + (i - l)));\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (n - i >= m) {\n      for (l = 0; l < m; l++)\n        printf(\"%d\\n\", *(*(p + (i + l)) + (m - (1 + l))));\n    } else {\n      for (l = 0; l < n - i; l++)\n        printf(\"%d\\n\", *(*(p + (i + l)) + (m - (1 + l))));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100] = {{0}};\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    int u = i;\n    int j = 1;\n    for (; u >= 1 && j <= m; u--, j++) {\n      cout << a[j][u] << endl;\n    }\n  }\n  for (i = 2; i <= m; i++) {\n    int u = i, j = n;\n    for (; u <= m && j >= 1; u++, j--) {\n      cout << a[u][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7272", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  int a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= m + n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i + 1 - j > 0 && i + 1 - j <= m)\n        printf(\"%d\\n\", *(*(a + j) + i + 1 - j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7273", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n;\n  int sz[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  if (row > col) {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < col; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; j >= 0; j--) {\n        if (n - j < row) {\n          printf(\"%d\\n\", sz[n - j][j]);\n        }\n      }\n    }\n  } else {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < row; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; n - j < row; j--) {\n        printf(\"%d\\n\", sz[n - j][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, max, s;\n  scanf(\"%d %d\", &row, &col);\n  max = row;\n  if (max < col)\n    max = col;\n  for (i = 0; i < max; i++) {\n    for (j = 0; j < max; j++) {\n      a[i][j] = -1;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (max == 1)\n    printf(\"%d\", a[0][0]);\n  else {\n    i = 0;\n    j = 0;\n    while (j < max) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (j == 0) {\n        j = i + 1;\n        i = 0;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    j = max - 1;\n    i = 1;\n    while (i != max - 1 || j != max - 1) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (i == max - 1) {\n        i = j + 1;\n        j = max - 1;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    if (a[max - 1][max - 1] != -1)\n      printf(\"%d\\n\", a[max - 1][max - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int *a, i, j, row, col;\n  cin >> row >> col;\n  a = (int *)calloc(200, 200 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", a + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    for (i = 1; (i < row + 1) && (i <= j + 1); i++)\n      printf(\"%d\\n\", *(a + (i - 1) * col + j + 1 - i));\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 1; (j <= col) && (j < row + 1 - i); j++)\n\n      cout << *(a + (i + j - 1) * col + col - j) << \"\\n\";\n  }\n}\n"}
{"label": "4", "index": "7276", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], col, row;\nint main() {\n  int i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    };\n  };\n  if (col >= row) {\n    for (k = 0; k <= row - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= col - 1; k++) {\n      for (i = 0; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n  if (row > col) {\n    for (k = 0; k <= col - 1; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = col; k <= row - 1; k++) {\n      for (i = k - col + 1; i <= k; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n    for (k = row; k <= row + col - 2; k++) {\n      for (i = k - col + 1; i <= row - 1; i++) {\n        printf(\"%d\\n\", a[i][k - i]);\n      };\n    };\n  };\n}\n"}
{"label": "4", "index": "7277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], y, x, i, j, k;\n  cin >> y >> x;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < x; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (k = 0; k < x; k++)\n    for (i = 0; i < y && k - i >= 0; i++)\n      printf(\"%d\\n\", a[i][k - i]);\n  for (k = x; k < x + y - 1; k++)\n    for (j = x - 1; k - j < y && j >= 0; j--)\n      cout << a[k - j][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, u;\n  int a[101][101];\n  int r, c;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  u = 0;\n  for (i = 0; (i < r) && (u != c); i++) {\n    if ((i == 0) && (j == 0)) {\n      printf(\"%d\", a[i][j]);\n    } else {\n      printf(\"\\n%d\", a[i][j]);\n    }\n    if ((i != r - 1) && (j != 0))\n      j--;\n    else {\n      u++;\n      j = u;\n      i = -1;\n    }\n  }\n  i = 1;\n  u = 1;\n  for (j = c - 1; (j >= 0) && (u < r); j--) {\n\n    printf(\"\\n%d\", a[i][j]);\n\n    if ((j != 0) && (i != r - 1)) {\n      i++;\n    } else {\n      u++;\n      i = u;\n      j = c;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, p, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (p = 0; p <= m + n - 2; p++) {\n    for (i = 0; i <= p; i++) {\n      if (i < m && p - i < n)\n        printf(\"%d\\n\", a[i][p - i]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7280", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int data[100][100];\n  \n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> data[i][j];\n    }\n  }\n  \n  for (int i = 0; i < col; i++) { \n    int m = 0, n = i;\n    while (true) {\n      cout << data[m][n] << endl;\n      m++;\n      n--;\n      if (m == row || n == -1) \n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) { \n    int m = i, n = col - 1;\n    while (true) {\n      cout << data[m][n] << endl;\n      m++;\n      n--;\n      if (m == row || n == -1) \n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d%d\", &col, &row);\n  int i, j;\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int p;\n  for (p = 0; p < 2 * (row > col ? row : col) - 1; p++) {\n    int k;\n    for (k = 0; (p - k) >= 0; k++) {\n      if (k < col && (p - k) < row)\n        printf(\"%d\\n\", a[k][p - k]);\n      else\n        continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int dia = 0; dia < row + col - 1; dia++) {\n    if (dia < col)\n      for (int iRow = 0; dia - iRow >= 0 && iRow < row; iRow++)\n        printf(\"%d\\n\", *(*(a + iRow) + dia - iRow));\n    else\n      for (int iRow = dia - col + 1; dia - iRow >= 0 && iRow < row; iRow++) {\n        cout << *(*(a + iRow) + dia - iRow) << endl;\n      }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int i, j, k;\n  int min;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (row > col) {\n    for (j = 0; j < col; j++) {\n      for (i = 0, k = j; k >= 0; i++, k--)\n        cout << a[i][k] << endl;\n    }\n    for (i = 1; i < row - col + 1; i++) {\n      for (j = col - 1, k = i; j >= 0; j--, k++)\n        cout << a[k][j] << endl;\n    }\n    for (; i < row; i++) {\n      for (j = col - 1, k = i; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0, k = j; k >= 0; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (; j < col; j++) {\n      for (i = 0, k = j; i < row; k--, i++) {\n        cout << a[i][k] << endl;\n      }\n    }\n    for (i = 1; i < row; i++) {\n      for (k = i, j = col - 1; k < row; k++, j--) {\n        cout << a[k][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, k = 0, temp = 0;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      cout << array[i][k - i] << \"\\n\";\n    }\n  for (k = col; k <= (col - 1) + (row - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      printf(\"%d\\n\", array[i][k - i]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  int a[100][100];\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= m; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= m + n - 1; i++)\n    for (j = 1; j <= n; j++) {\n      if (i + 1 - j > 0 && i + 1 - j <= m) \n        cout << *(*(a + j) + i + 1 - j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7286", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int r, c;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      cin >> sz[r][c];\n    }\n  }\n  int k;\n  int first = 1;\n  int min = row - 1;\n  if (col < min + 1) {\n    min = col - 1;\n  }\n\n  for (k = 0; k <= min; k++) {\n    for (r = 0; r <= k; r++) {\n      if (first == 1) {\n        printf(\"%d\", sz[r][k - r]);\n        first = 0;\n      } else {\n        printf(\"\\n%d\", sz[r][k - r]);\n      }\n    }\n  }\n\n  if (row > col) {\n    for (k = 1; k <= row - col; k++) {\n      for (r = k, c = col - 1; c >= 0 && r < row; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  if (row < col) {\n    for (k = 1; k <= col - row; k++) {\n      for (c = row - 1 + k, r = 0; r <= row - 1; c--, r++) {\n        printf(\"\\n%d\", sz[r][c]);\n      }\n    }\n  }\n\n  for (k = min + 1; k >= 1; k--) {\n    for (r = row - k + 1, c = col - 1; r < row; r++, c--) {\n      printf(\"\\n%d\", sz[r][c]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7287", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        cout << *(*(a + i) + j) << endl;\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        cout << *(*(a + i) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], *p;\n  int raw, col;\n  scanf(\"%d %d \", &raw, &col);\n  for (p = a[0]; p < a[0] + raw * col; p++) {\n    scanf(\"%d \", p);\n  }\n  if (col != 1) {\n    cout << a[0][0] << endl;\n    for (p = a[0] + 1; p < a[0] + col - 1; p++) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n\n    for (p = a[0] + col - 1; p < a[0] + col * raw; p += col) {\n      int *q;\n      q = p;\n      do {\n        cout << *q << endl;\n        q += col - 1;\n      } while ((q + 1 - a[0]) % col != 0 && q < a[0] + raw * col);\n    }\n  }\n  if (col == 1) {\n    for (p = a[0]; p < a[0] + raw * col; p++) {\n      cout << *p << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, *p, *p0, i;\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)calloc(m * n, sizeof(int));\n  p0 = p;\n  for (p = p0; p < p0 + m * n; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m < n) {\n    for (p = p0; p < p0 + m; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        cout << *(p + i * (n - 1)) << \"\\n\";\n      }\n    }\n    for (p = p0 + m; p < p0 + n - 1; p++) {\n      for (i = 0; i < m; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m - (p - p0) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  if (m == n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        cout << *(p + i * (n - 1)) << \"\\n\";\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m + 1 - (p - p0 + 1) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  if (m > n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p <= p0 + (m - n + 1) * n - 1; p += n) {\n      for (i = 0; i < n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + (m - n + 2) * n - 1; p <= p0 + m * n - 1; p += n) {\n      for (i = 0; i < m - (p - p0 + 1) / n + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7290", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k < col; k++)\n    for (i = 0, j = k; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < row; k++)\n    for (i = k, j = col - 1; (i < row) && (j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7291", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, line, rownow, linenow, n, i, j, a[10000];\n  scanf(\"%d %d\", &row, &line);\n  for (j = 0; j <= row * line - 1; j++)\n    cin >> a[j];\n\n  for (i = 0; i <= row + line - 1; i++) {\n    rownow = 0;\n    linenow = i - rownow;\n    for (; rownow <= row - 1 && linenow >= 0; rownow++, linenow--) {\n      if (linenow >= line)\n        continue;\n      n = rownow * line + linenow;\n      printf(\"%d\\n\", a[n]);\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "4", "index": "7292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[200][200];\n  int m, n, i, j, x;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          cout << *(*(p + i) + j) << \"\\n\";\n      }\n  }\n}\n"}
{"label": "4", "index": "7293", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, max, s;\n  scanf(\"%d %d\", &row, &col);\n  max = row;\n  if (max < col)\n    max = col;\n  for (i = 0; i < max; i++) {\n    for (j = 0; j < max; j++) {\n      a[i][j] = -1;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (max == 1)\n    printf(\"%d\", a[0][0]);\n  else {\n    i = 0;\n    j = 0;\n    while (j < max) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (j == 0) {\n        j = i + 1;\n        i = 0;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    j = max - 1;\n    i = 1;\n    while (i != max - 1 || j != max - 1) {\n      if (a[i][j] != -1)\n        printf(\"%d\\n\", a[i][j]);\n      if (i == max - 1) {\n        i = j + 1;\n        j = max - 1;\n      } else {\n        i = i + 1;\n        j = j - 1;\n      }\n    }\n    if (a[max - 1][max - 1] != -1)\n      printf(\"%d\\n\", a[max - 1][max - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int(*p)[100] = a;\n\n  \n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(p[i] + j);\n  for (i = 0; i < row + col - 1; i++)\n    for (j = 0; j < row; j++) {\n      if (i - j >= 0 && i - j < col)\n        cout << *(p[j] + i - j) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, (*a)[100];\n  a = (int(*)[100])calloc(\n      100, 100 * sizeof(int)); \n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(a + i) + j);\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      printf(\"%d\\n\", *(*(a + i) + k - i));\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", *(*(a + k + i) + col - 1 - i));\n  }\n}\n"}
{"label": "4", "index": "7296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a = 0;\n  int(*p)[10000];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[10000])calloc(10000, 10000);\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (a < n + m - 1) {\n    while (i != m && j != -1) {\n      cout << *(*(p + i) + j) << \"\\n\";\n      i++;\n      j--;\n    }\n    a++;\n    if (a > n - 1) {\n      j = n - 1;\n      i = a - (n - 1);\n    } else {\n      if (a <= n - 1) {\n        j = a;\n        i = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7297", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int matrix[120][120];\n  cin >> row >> col;\n  int *p[100];\n  for (int i = 0; i < row; i++) {\n    p[i] = &matrix[i][0];\n    for (int j = 0; j < col; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  if (col >= row) {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  } else {\n    for (int i = 0; i < col; i++) {\n      for (int j = 0; (i - j) < col && (i - j) >= 0 && j < row; j++) {\n        cout << *(p[j] + i - j) << endl;\n      }\n    }\n    for (int i = col; i < (col + row - 1); i++) {\n      for (int j = col - 1; i - j < row && j >= 0; j--) {\n        cout << *(p[i - j] + j) << endl;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int row, col, i, j;\n  int array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < row + col; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j > row - 1 || i - j > col - 1)\n        continue;\n      if (j < row && i - j < col) {\n        cout << array[j][i - j] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  int(*aa)[100] = a;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << *((*(aa + r)) + c) << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int col, row, i, j, n, m, e, cishu, sz[100][100];\n  e = 0;\n  n = 0;\n  cishu = 0;\n  scanf(\"%d%d\", &row, &col);\n  for (j = 0; j < row; j++) {\n    for (i = 0; i < col; i++) {\n      cin >> sz[j][i];\n    }\n  }\n  if (row > 1 && col > 1) {\n    for (i = 0, j = 0;; i++, j--) {\n      if (i == 0)\n        m = j;\n\n      printf(\"%d\\n\", sz[i][j]);\n      cishu++;\n      if (cishu == row * col) {\n        break;\n      }\n      if ((j == 0 || i == row - 1) && e == 0) {\n        i = -1;\n        j = m + 2;\n        if (j == col) {\n          e = 1;\n        }\n      }\n      if ((j == 0 || i == row - 1) && e == 1) {\n        j = col;\n        n++;\n        i = n - 1;\n      }\n    }\n  } else {\n    for (j = 0; j < row; j++) {\n      for (i = 0; i < col; i++) {\n        printf(\"%d\\n\", sz[j][i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int row, col; \n  cin >> row >> col;\n  for (int i1 = 0; i1 < row; i1++) {\n    for (int j1 = 0; j1 < col; j1++)\n      cin >> *(*(a + i1) + j1);\n  } \n  if (row < col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1 && i - j >= 0)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    } \n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 1; w--) {\n        if (k - w <= row - 1 && w <= col - 1)\n          cout << *(*(a + k - w) + w) << endl; \n      }\n    }\n  } else if (row > col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    } \n\n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl; \n      }\n    }\n  } else if (row = col) {\n    for (int i = 0; i < col; i++) {\n      for (int j = i; j >= 0; j--) {\n        if (i - j <= row - 1)\n          cout << *(*(a + (i - j)) + j) << endl;\n      }\n    } \n    for (int k = col; k <= col + row - 2; k++) {\n      for (int w = col - 1; w >= 0; w--) {\n        if (k - w >= 0 && k - w <= row - 1 && w <= col - 1 && w >= 0)\n          cout << *(*(a + k - w) + w) << endl; \n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0, an[100][100], j = 0, k = 0, s = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (k = 0; k < n + m - 1; k++) {\n    if (n < m) {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < n && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; j < n; i--, j++) {\n          printf(\"%d\\n\", an[j][i]);\n        }\n      }\n    } else {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < m && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else {\n        if (k >= m - 1) {\n          for (i = m - 1, j = k - m + 1; i >= 0 && j < n; i--, j++) {\n            printf(\"%d\\n\", an[j][i]);\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k[100][100];\n  int m = 0, x = 0, i, j, row = 0, col = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (m = 0; m < row + col - 1; m++) {\n    for (j = m;; j--) {\n      if (j >= col || m - j >= row) {\n        break;\n      }\n      if (j < 0 || m - j < 0) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  for (m = col; m < row + col - 1; m++) {\n    for (j = col - 1; j >= 0; j--) {\n      if (m - j >= row) {\n        break;\n      }\n      printf(\"%d\\n\", k[m - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], row, col, i, j;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < row + col - 1; i++) {\n    if (i >= col) {\n      for (j = col - 1; j >= i - row + 1 && j >= 0; j--) {\n        printf(\"%d\\n\", a[i - j][j]);\n      }\n    } else {\n      for (j = i; j >= i - row + 1 && j >= 0; j--)\n        printf(\"%d\\n\", a[i - j][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[200][200];\n  int i, j, row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (col >= row) {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        cout << a[i][j] << \"\\n\";\n      }\n    }\n  } else {\n    for (sum = 0; sum < col; sum++) {\n      for (j = sum; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row) {\n          break;\n        }\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n    for (; sum <= col + row - 2; sum++) {\n      for (j = col - 1; j >= 0; j--) {\n        i = sum - j;\n        if (i >= row)\n          break;\n        printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  i = 0;\n  j = 0;\n  while (n < row + col - 1) {\n    cout << a[i][j] << \"\\n\";\n    if (j == 0 || (i == row - 1 && j != 0)) {\n      n++;\n      j = n;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n    while (j > col - 1) {\n      j--;\n      i++;\n    }\n    if (i == row - 1 && j == col - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i;\n  int *p, *q;\n  q = (int *)calloc(10001, sizeof(int));\n  cin >> n >> m;\n  for (p = q; p < q + n * m; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m == 1) {\n    for (p = q; p < q + n * m; p++)\n      printf(\"%d\\n\", *p);\n  } else {\n    for (i = 0; i < m; i++) {\n      for (p = q + i; (p <= q + i + (m - 1) * i) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n    for (i = 2; i <= n; i++) {\n      for (p = q + m * i - 1;\n           (p <= q + m * i - 1 + (m - 1) * (m - 1)) && (p < q + n * m);\n           p = p + m - 1) {\n        printf(\"%d\\n\", *p);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], sum, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  if (row < col) {\n    for (sum = 0; sum <= row - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= col - 1; sum++) {\n      for (i = 0; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= col + row - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  } else {\n    for (sum = 0; sum <= col - 1; sum++) {\n      for (i = 0; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = col; sum <= row - 1; sum++) {\n      for (i = sum - col + 1; i <= sum; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n    for (sum = row; sum <= row + col - 2; sum++) {\n      for (i = sum - col + 1; i <= row - 1; i++) {\n        j = sum - i;\n        printf(\"%d\\n\", array[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7309", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int col, row, sz[99][99], i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j <= i && j < row; j++)\n      printf(\"%d\\n\", sz[j][i - j]);\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j + i < row && j < col; j++) {\n      printf(\"%d\\n\", sz[i + j][col - j - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[201][201];\nint main() {\n  int n, m;\n  cin >> n >> m;\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      cin >> *(*(a + i) + j);\n  for (int s = 0; s < n + m - 1; s++)\n    for (int i = 0; i <= s; i++)\n      if (a[i][s - i] != 0)\n        cout << a[i][s - i] << endl;\n}\n"}
{"label": "4", "index": "7311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, m, n, row, col;\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  m = row + col - 2;\n  for (n = 0; n <= m; n++)\n    for (i = 0; i <= row - 1; i++)\n      for (j = 0; j <= col - 1; j++)\n        if (i + j == n)\n          printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "7312", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int p = 0; p <= row + col - 2; p++) {\n    for (int i = 0; i <= p; i++) {\n      int j = p - i;\n      if (i > row - 1 || j > col - 1 || j < 0)\n        continue;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], row, col, i, j, x, y;\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> array[i][j];\n    }\n  }\n  if (row == col) {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else if (row < col) {\n    for (i = 0; i <= row - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      x = j;\n      for (i = 0; i <= row - 1; i++) {\n        cout << array[i][x] << \"\\n\";\n        x--;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i + col - row; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  } else {\n    for (i = 0; i <= col - 1; i++) {\n      x = i;\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", array[j][x]);\n        x--;\n      }\n    }\n    for (i = 1; i <= row - col; i++) {\n      x = i;\n      for (j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[x][j]);\n        x++;\n      }\n    }\n    for (i = row - col + 1; i <= row - 1; i++) {\n      y = i;\n      for (j = col - 1; j >= i - row + col; j--) {\n        printf(\"%d\\n\", array[y][j]);\n        y++;\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7314", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 100;\n\nint main() {\n  int line, row;\n  int num[maxn][maxn];\n  cin >> line >> row;\n\n  int nowline, nowrow;\n  int step;\n  int i, j;\n  for (i = 0; i != line; i++)\n    for (j = 0; j != row; j++)\n      cin >> num[i][j];\n  for (step = 0; step != line + row - 1; step++) {\n    nowline = (step >= row ? step - row + 1 : 0);\n    nowrow = (step >= row ? row - 1 : step);\n    while (nowline != line && nowrow != -1) {\n      cout << num[nowline][nowrow] << endl;\n      nowline++;\n      nowrow--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7315", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col;\n\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    for (int j = 0; j < row; j++) {\n      if (j >= 0 && j < row && i - j >= 0 && i - j < col)\n        cout << a[j][i - j] << endl;\n      else\n        continue;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, *p, i, j, k;\n  p = (int *)malloc(11000 * sizeof(int));\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a * b; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i < b; i++) {\n    k = i;\n    j = 0;\n    while (k >= 0 && j < a) {\n      printf(\"%d\\n\", *(p + k + j * b));\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    k = i;\n    j = 0;\n    while (k < a && j < b) {\n      cout << *(p + b - 1 - j + k * b) << \"\\n\";\n      j++;\n      k++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, sum, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i - 1][j - 1]);\n    }\n  }\n  for (sum = 0; sum <= col - 1; sum++) {\n    for (i = 0; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n  for (sum = col; sum <= col + row - 2; sum++) {\n    for (i = sum - col + 1; i <= row - 1; i++) {\n      if (sum - i < 0)\n        break;\n      printf(\"%d\\n\", a[i][sum - i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int row, col;\n\n  int i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++)\n    for (j = i; j >= 0 && i - j < row; j--)\n      printf(\"%d\\n\", a[i - j][j]);\n\n  for (i = 1; i < row; i++)\n    for (j = col - 1; (j >= 0) && (i + col - 1 - j < row); j--)\n      printf(\"%d\\n\", a[i + col - 1 - j][j]);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7319", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0};\n  int row, col, i, j, n, sum;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (n = 0; n < row + col - 1; n++)\n    for (i = 0; i <= n; i++) {\n      if (i < row && n - i < col)\n        printf(\"%d\\n\", a[i][n - i]);\n      else\n        continue;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (int i = 2; i <= col + row; i++)\n    for (int j = 1; j <= i - 1; j++) {\n      if (i - j > col) {\n        continue;\n      }\n      if (j > row)\n        continue;\n      cout << a[j][i - j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7321", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, i, j;\n  int startrow = 0, startcol = 0;\n\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  while ((startcol + startrow) != (row + col - 2)) {\n    if (startcol < col - 1) {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startcol++;\n    } else {\n      for (i = startrow; (i < row) && (i <= startrow + startcol); i++) {\n        printf(\"%d\\n\", sz[i][startcol + startrow - i]);\n      }\n      startrow++;\n    }\n  }\n  printf(\"%d\", sz[row - 1][col - 1]);\n  return 0;\n}\n"}
{"label": "4", "index": "7322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, a[1000][1000], i, j, k;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; i < row && k >= 0; i++, k--)\n      cout << a[i][k] << \"\\n\";\n\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; k++, j--)\n      cout << a[k][j] << \"\\n\";\n}\n"}
{"label": "4", "index": "7323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100], i, j, k;\n  scanf(\"%d %d\", &r, &c);\n  for (i = 0; i < r; i++)\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (k = 0; k <= c - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n  for (k = 1; k <= r - 1; k++) {\n    j = c - 1;\n    i = k;\n    while (j >= 0 && i <= r - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      i++;\n      j--;\n    }\n  }\n}\n"}
{"label": "4", "index": "7324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[101][101];\n  int i, j, row, col;\n\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> num[i][j];\n  printf(\"%d\", num[1][1]);\n  for (i = 3; i <= col + row; i++) {\n    for (j = 1; j < i; j++)\n      if (j <= row && i - j <= col)\n        cout << \"\\n\" << num[j][i - j];\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7325", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int p = 0; p <= row + col - 2; p++) {\n    for (int i = 0; i <= p; i++) {\n      int j = p - i;\n      if (i > row - 1 || j > col - 1 || j < 0)\n        continue;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h, l, i, k, g, s[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (k = 0; k < l; k++) {\n      scanf(\"%d \", &s[i][k]);\n    }\n  }\n  for (g = 0; g <= (h + l - 2); g++) {\n    i = 0;\n    while (i < h) {\n      if (g - i >= l) {\n        i++;\n      } else {\n        break;\n      }\n    }\n\n    while (i < h && (g - i > -1) && (g - i < l)) {\n      cout << s[i][g - i] << \"\\n\";\n\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], ROW, COL, i = 0, k = 0, j = 0;\n  cin >> ROW >> COL;\n  for (i = 0; i < ROW; i++) {\n    for (j = 0; j < COL; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (k = 0; k < COL; k++) {\n    for (i = 0, j = k; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (k = 1; k < ROW; k++) {\n    for (i = k, j = COL - 1; i < ROW && j >= 0; i++, j--) {\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105] = {0}, row, col;\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);      \n  for (int i = 1; i <= col; i++) { \n    int k = 1;\n    while (k <= row && i - k + 1 >= 1) {\n      cout << *(*(a + k) + i - k + 1) << endl;\n      k++;\n    }\n  }\n  for (int i = 2; i <= row; i++) { \n    int k = 0;\n    while (i + k <= row && col - k >= 1) {\n      cout << *(*(a + i + k) + col - k) << endl;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7329", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i, j, a[100][100];\n  double b[100][200];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      b[i][j] = 0.5;\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      b[i][j + i] = a[i][j];\n  for (j = 0; j < 200; j++)\n    for (i = 0; i < 100; i++)\n      if (b[i][j] != 0.5)\n        cout << b[i][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7330", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[201][201];\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  for (int s = 0; s < n + m - 1; s++)\n    for (int i = 0; i <= s; i++)\n      if (a[i][s - i] != 0)\n        cout << a[i][s - i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, c, a[100][100] = {0};\n  int i, j, rs, re, cs, ce, s;\n\n  scanf(\"%d%d\", &r, &c);\n\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (rs = 0, cs = 0, re = 0, ce = 0; (re + ce) < (r + c);) {\n    for (i = rs, j = cs; i <= re && j >= ce; i++, j--) {\n      printf(\"%d\\n\", a[i][j]);\n    }\n    if (cs < (c - 1))\n      cs++;\n    else\n      rs++;\n    if (re < (r - 1))\n      re++;\n    else\n      ce++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int i, j, r, s, p, k;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (r = 0; r < n; r++) {\n    p = r;\n    for (s = 0; p >= 0; s++) {\n      if (s < m)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  for (k = n; k <= m + n - 2; k++) {\n    p = n - 1;\n    for (s = k - n + 1; s < m; s++) {\n      if (p >= 0)\n        printf(\"%d\\n\", a[s][p]);\n      p--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7333", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[200][200];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i && j < row && (i - j) < col; j++)\n      cout << *(a[j] + (i - j)) << endl;\n  for (int k = col; k <= row + col - 2; k++)\n    for (int q = col - 1; q >= k - row + 1 && q >= 0; q--)\n      printf(\"%d\\n\", *(a[k - q] + q));\n  return 0;\n}\n"}
{"label": "4", "index": "7334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, k = 0;\n  cin >> row >> col;\n  int i = 0, j = 0, s[row][col];\n  for (i = 0; i <= row - 1; i++) \n  {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i <= col - 1; i++) \n  {\n    j = 0;\n    k = i;\n    do {\n      cout << s[j][k] << endl;\n      j++;\n      k--;\n    } while ((j <= row - 1) && (k >= 0));\n  }\n  for (i = 1; i <= row - 1; i++) \n  {\n    j = col - 1;\n    k = i;\n    do {\n      cout << s[k][j] << endl;\n      k++;\n      j--;\n    } while ((k <= row - 1) && (j >= 0));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid move1(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < m - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n    }\n  }\n  for (i = m - 1; i < n - 1; i++) {\n    for (k = 0; k < m; k++)\n      printf(\"%d\\n\", *(p[0 + k] + i - k));\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nvoid move2(int *p[], int m, int n) {\n  int i, k;\n  for (i = 0; i < n - 1; i++) {\n    for (k = 0; k <= i; k++) {\n      cout << *(p[0 + k] + i - k) << \"\\n\";\n    }\n  }\n  for (i = 0; i < m - n; i++) {\n    for (k = 0; k < n; k++)\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n  }\n  for (i = m - n; i < m; i++) {\n    for (k = 0; k < m - i; k++) {\n      printf(\"%d\\n\", *(p[i + k] + n - 1 - k));\n    }\n  }\n}\nint main() {\n  int m, n, i, j, *p[100] = {0}, **head;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    p[i] = (int *)malloc(n * sizeof(int));\n  }\n  head = p;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  if (m <= n)\n    move1(p, m, n);\n  else\n    move2(p, m, n);\n  return 0;\n}\n"}
{"label": "4", "index": "7336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; ++i)\n    for (j = 0; j < col; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < col; ++i)\n    for (j = 0; (i - j >= 0) && (j < row); ++j)\n      printf(\"%d\\n\", a[j][i - j]);\n  for (i = 1; i < row; ++i) {\n    for (j = 0; (j < col) && (i + j < row); ++j)\n      cout << a[i + j][col - j - 1] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], row, col;\n\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (int i = 0; i <= row + col - 2; i++) {\n    for (int j = 0; j < row; j++) {\n      if (j >= 0 && j < row && i - j >= 0 && i - j < col)\n        cout << a[j][i - j] << endl;\n      else\n        continue;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7338", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  static int a[105][105];\n  int i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d \", &a[i][j]);\n\n  for (i = 0, j = 0; i < n;) {\n    for (k = i; k < n && i + j - k >= 0; k++) {\n      printf(\"%d \", a[k][i + j - k]);\n    }\n    if (j != m - 1)\n      j++;\n    else if (j == m - 1)\n      i++;\n  }\n}\n"}
{"label": "4", "index": "7339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p, row, col, *q, i, k;\n  scanf(\"%d%d\", &row, &col);\n  p = (int *)malloc(row * col * sizeof(int));\n  for (q = p; q < p + row * col; q++)\n    scanf(\"%d\", q);\n  for (k = 0; k < row + col - 1; k++) {\n    if (k < col) {\n      for (i = 0; i <= k && i < row; i++)\n        printf(\"%d\\n\", *(p + i * col + k - i));\n    } else {\n      for (i = k - col + 1; i < row && i <= k; i++)\n        printf(\"%d\\n\", *(p + i * col + k - i));\n    }\n  }\n}\n"}
{"label": "4", "index": "7340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int q, m, n, a[100][100] = {0}, i, j;\n  cin >> m >> n;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= m + n - 2; i++) {\n    for (j = 0; i - j >= 0; j++) {\n      if (j < m && i - j < n)\n        cout << a[j][i - j] << endl;\n    }\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "4", "index": "7341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n = 0, row = 0, col = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &(a[i][j]));\n  n = row + col - 1;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++) {\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n      }\n  return 0;\n}\n"}
{"label": "4", "index": "7342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, a[110][110] = {0};\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j); \n  for (k = 0; k < row + col - 1; k++) {\n    i = 0;\n    j = k;\n    while (j >= 0) {\n      if ((i < row) && (j < col))\n        cout << *(*(a + i) + j) << endl; \n      i++;\n      j--;\n    }\n  }\n  return 0; \n}\n"}
{"label": "4", "index": "7343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int t = 0; t < row + col - 1; t++)\n    for (j = (col - 1 > t ? t : col - 1); t - j <= row - 1 && j >= 0; j--)\n      cout << *(*(a + t - j) + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7344", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int matrix[99][99], row, column, startcolumn = 0, startrow = 1;\n  cin >> row >> column;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < column; j++) {\n      cin >> matrix[i][j];\n    }\n  }\n  int x = 0, y;\n  do {\n    y = startcolumn;\n    while (x < row && y >= 0) {\n      cout << matrix[x][y] << endl;\n      x++;\n      y--;\n    }\n    x = 0;\n    startcolumn++;\n  } while (startcolumn < column);\n  int m, n = column - 1;\n  do {\n    m = startrow;\n    while (m < row && n >= 0) {\n      cout << matrix[m][n] << endl;\n      m++;\n      n--;\n    }\n    startrow++;\n    n = column - 1;\n  } while (startrow < row);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  int *array[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(array + i) + j);\n  for (k = 0; k <= row + col; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          cout << *(*(array + i) + j) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int max, row, col, array[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int(*p)[100];\n  p = array;\n  for (int i = 0; i < col; i++) {\n    for (int j = i; j >= 0; j--) {\n      if ((i - j) < row)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  for (int i = col; i <= col + row - 1; i++) {\n    for (int j = col - 1; j >= 0; j--) {\n      if ((i - j) < row && i - col + 1 >= 0)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "7347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  cin >> row >> col;\n  int array[100][100] = {0};\n  int i, j, n;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (n = 0; n < row + col; n++) {\n    for (i = 0, j = n - 1; i < n, j >= 0; i++, j--) {\n      if (i < row && j < col) {\n        cout << array[i][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, i1, j1;\n  cin >> i >> j;\n  for (i1 = 1; i1 <= i; i1++) {\n    for (j1 = 1; j1 <= j; j1++)\n      scanf(\"%d\", &a[i1][j1]);\n  }\n  j1 = 1;\n  i1 = 1;\n  printf(\"%d\", a[1][1]);\n  while (j1 != j || i1 != i) {\n    i1 = i1 + 1;\n    j1 = j1 - 1;\n    if (j1 == 0) {\n      j1 = i1;\n      i1 = 1;\n    }\n    if (j1 > j || i1 > i)\n      continue;\n    printf(\"\\n%d\", a[i1][j1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7349", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (int i = 0; i < col; i++) {\n    int r = 0;\n    int c = i;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    int r = i;\n    int c = col - 1;\n    while (r <= row - 1 && c >= 0) {\n      cout << a[r][c] << endl;\n      r = r + 1;\n      c = c - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int R, C, i, j, k, l, m, n;\n  int a[100][100];\n  scanf(\"%d %d\", &R, &C);\n  for (i = 0; i < R; i++) {\n    for (j = 0; j < C; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < C; j++) {\n    i = 0;\n    while (i <= j) {\n      k = j - i;\n      printf(\"%d\\n\", a[i][k]);\n      i++;\n      if (i > R - 1)\n        break;\n    }\n  }\n  for (l = C; l < R + C - 1; l++) {\n    m = l - C + 1;\n    while (m <= l) {\n      n = l - m;\n      printf(\"%d\\n\", a[m][n]);\n      m++;\n      if (m > R - 1) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int(*p)[100], i, j, k, m, n, flag = 0;\n  p = (int(*)[100])calloc(100, 100 * sizeof(int));\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (i = 0; i < n; i++) {\n    for (k = i; k >= 0; k--) {\n      if (i - k <= m - 1) {\n        printf(\"%d \", *(*(p + i - k) + k));\n      }\n      flag = i;\n    }\n  }\n  if (flag == n - 1) {\n    for (j = 1; j < m; j++) {\n      for (k = j; k < m; k++) {\n        if ((n + j - k - 1) <= (n - 1) && (n + j - k - 1) >= 0) {\n          cout << *(*(p + k) + n + j - k - 1) << \" \";\n        }\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100], row, col;\nvoid display(int step) {\n  int x, y, i;\n  if (step > row + col - 1)\n    return;\n  if (step < col) {\n    y = step - 1;\n    for (i = y; i >= 0 && y - i < row; i--)\n      cout << matrix[y - i][i] << endl;\n  } else {\n    x = step - col;\n    for (i = x; i < row && col - 1 + x - i >= 0; i++)\n      printf(\"%d\\n\", matrix[i][col - 1 + x - i]);\n  }\n  display(step + 1);\n}\nint main() {\n  int i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> *(*(matrix + i) + j);\n  }\n  display(1);\n}\n"}
{"label": "4", "index": "7353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, n[100][100], c, d, e, f, g, h, i, j, k, l;\n  cin >> a >> b;\n  for (c = 1; c <= a; c++) {\n    for (d = 1; d <= b; d++)\n      scanf(\"%d\", &n[c][d]);\n  }\n  if (a >= b) {\n    for (e = 1; e <= b; e++) {\n      for (f = 1; f <= e; f++)\n        printf(\"%d\\n\", n[f][e + 1 - f]);\n    }\n    for (g = 2; g <= a; g++) {\n      for (h = 1; h <= b && g - 1 + h <= a; h++) {\n        printf(\"%d\\n\", n[g - 1 + h][b + 1 - h]);\n      }\n    }\n  } else {\n    for (i = 1; i <= b; i++) {\n      for (j = 1; j <= a && i + 1 - j > 0; j++) {\n        printf(\"%d\\n\", n[j][i + 1 - j]);\n      }\n    }\n    for (k = 2; k <= a; k++) {\n      for (l = 1; l <= a + 1 - k; l++)\n        printf(\"%d\\n\", n[k - 1 + l][b + 1 - l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) { return a > b ? a : b; }\nint min(int a, int b) { return a < b ? a : b; }\nint main() {\n  int i, j, t, col, row, a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (t = 0; t <= col - 1; t++) {\n    j = t;\n    for (i = 0; i <= min(t, row - 1); i++) {\n      printf(\"%d \", a[i][j]);\n      j--;\n    }\n  }\n  for (t = 1; t <= row - 1; t++) {\n    i = t;\n    for (j = col - 1; j >= max(col - row + t, 0); j--) {\n      cout << a[i][j] << \" \";\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7355", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      printf(\"%d\\n\", array[j][i - j]);\n      if (i - j == 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", array[j][col - 1 - j + i]);\n      if (col - 1 - j + i == 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[102][102], row, col, t, k, i, j;\n  cin >> row >> col;\n  t = row + col - 2;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (k = 0; k <= t; k++) {\n    if (k + 1 <= col)\n      i = 0;\n    else\n      i = k - col + 1;\n    j = k - i;\n    while (j >= 0 && i < row) {\n      cout << a[i][j] << \"\\n\";\n      i++;\n      j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, row, col, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0, k = 2; j < col; i++, j--) {\n    printf(\"%d\\n\", a[i][j]);\n    if (j == 0 || i == row - 1) {\n      j = k;\n      k = k + 1;\n      i = -1;\n    }\n  }\n  for (i = 1, j = col - 1, k = 1; i < row; i++, j--) {\n    cout << a[i][j] << \"\\n\";\n\n    if (i == row - 1 || j == 0) {\n      i = k;\n      k++;\n      j = col;\n    }\n  }\n}\n"}
{"label": "4", "index": "7358", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 0; i < m + n; i++) {\n    int j = 0;\n    while (j <= i) {\n      if (j < m && i - j < n)\n        cout << a[j][i - j] << endl;\n\n      j++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7359", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int i, j, u, t = 0;\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < col; j++) {\n    for (u = 0;; u++) {\n      if (u >= row || j - u < 0)\n        break;\n      printf(\"%d\\n\", a[u][j - u]);\n    }\n  }\n\n  for (j = 1; j < row; j++) {\n    for (u = 1;; u++) {\n      if (u + j - 1 >= row || col - u < 0)\n        break;\n\n      printf(\"%d\\n\", a[u + j - 1][col - u]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int **p;\n  p = (int **)malloc(100 * sizeof(int *));\n  int i, j;\n  for (i = 0; i < row; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n  for (j = 0; j < col - 1; j++) {\n    int a = j;\n    for (i = 0; a >= 0 && i < row; i++) {\n      printf(\"%d\\n\", *(*(p + i) + a));\n      a--;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    int a = i;\n    for (j = col - 1; a < row && j >= 0; j--) {\n      cout << *(*(p + a) + j) << \"\\n\";\n      a++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int num[110][110] = {0};\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(num + i) + j);\n    }\n  for (int i = 0; i < col; i++) {\n    for (int j = 0; j <= i; j++) {\n      if (j < row)\n        printf(\"%d\\n\", *(*(num + j) + i - j));\n      else\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    for (int j = 0; j < row - i; j++) {\n      if (j < col)\n        cout << *(*(num + i + j) + col - j - 1) << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", *(*(array + j) + i - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, *p, *p0, i;\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)calloc(m * n, sizeof(int));\n  p0 = p;\n  for (p = p0; p < p0 + m * n; p++) {\n    scanf(\"%d\", p);\n  }\n  if (m < n) {\n    for (p = p0; p < p0 + m; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + m; p < p0 + n - 1; p++) {\n      for (i = 0; i < m; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m - (p - p0) / n; i++)\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n    }\n  }\n  if (m == n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p < p0 + m * n; p += n) {\n      for (i = 0; i < m + 1 - (p - p0 + 1) / n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  if (m > n) {\n    for (p = p0; p < p0 + n - 1; p++) {\n      for (i = 0; i < p - p0 + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + n - 1; p <= p0 + (m - n + 1) * n - 1; p += n) {\n      for (i = 0; i < n; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n    for (p = p0 + (m - n + 2) * n - 1; p <= p0 + m * n - 1; p += n) {\n      for (i = 0; i < m - (p - p0 + 1) / n + 1; i++) {\n        printf(\"%d\\n\", *(p + i * (n - 1)));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, *p, i, j, k;\n  p = (int *)malloc(11000 * sizeof(int));\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a * b; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i < b; i++) {\n    k = i;\n    j = 0;\n    while (k >= 0 && j < a) {\n      printf(\"%d\\n\", *(p + k + j * b));\n      k--;\n      j++;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    k = i;\n    j = 0;\n    while (k < a && j < b) {\n      cout << *(p + b - 1 - j + k * b) << \"\\n\";\n      j++;\n      k++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, cnt = 1;\n  int a[201][201] = {0}, b[10001] = {0};\n  scanf(\"%d %d \", &row, &col);\n  for (i = 1; i <= 200; i++) {\n    for (j = 1; j <= 200; j++)\n      a[i][j] = -1;\n  }\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  i = 1, j = 1;\n  while (cnt <= row * col) {\n    if (a[i][j] != -1)\n      b[cnt++] = a[i][j];\n    if (j == 1 || i == row) {\n      j = i + j;\n      i = 1;\n    } else {\n      i = i + 1;\n      j = j - 1;\n    }\n  }\n  for (i = 1; i <= row * col; i++)\n    cout << b[i] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "7366", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  int i, j;\n  int sum;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (sum = 0; sum < col - 1; sum++) {\n    for (j = sum; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      printf(\"%d\\n\", a[i][j]);\n    }\n  }\n  for (sum = col - 1; sum <= row + col - 2; sum++) {\n    for (j = col - 1; j >= 0; j--) {\n      i = sum - j;\n      if (i >= row)\n        break;\n      cout << a[i][j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7367", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint min(int x, int y) {\n  if (x <= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int a[100][100], row, col, ROW, COL, i, m = 1, n = 0, x;\n  scanf(\"%d%d\", &ROW, &COL);\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      cin >> a[row][col];\n  }\n  x = min(ROW, COL);\n  row = 0;\n  col = 0;\n  for (i = 0; i < x + x * (x - 1) / 2; i++) {\n    printf(\"%d\\n\", a[row][col]);\n    n++;\n    if (n != m) {\n      row++;\n      col--;\n    } else if (n == m) {\n      row = 0;\n      col += m;\n      m++;\n      n = 0;\n    }\n  }\n  if (COL >= ROW) {\n    row = 0;\n    col = ROW;\n    m = col + 1;\n    for (i = 0; i < ROW * (COL - ROW); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (row != ROW - 1) {\n        row++;\n        col--;\n      } else {\n        row = 0;\n        col = m;\n        m++;\n      }\n    }\n    row = 1;\n    col = COL - 1;\n    m = ROW - 1;\n    n = 0;\n    for (i = 0; i < ROW * (ROW - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  if (COL < ROW) {\n    row = 1;\n    col = COL - 1;\n    m = 2;\n    for (i = 0; i < COL * (ROW - COL); i++) {\n      printf(\"%d\\n\", a[row][col]);\n      if (col != 0) {\n        row++;\n        col--;\n      } else {\n        row = m;\n        col = COL - 1;\n        m++;\n      }\n    }\n    row = ROW - COL + 1;\n    col = COL - 1;\n    m = COL - 1;\n    n = 0;\n    for (i = 0; i < COL * (COL - 1) / 2; i++) {\n      n++;\n      printf(\"%d\\n\", a[row][col]);\n      if (n != m) {\n        row++;\n        col--;\n      } else {\n        row = ROW - m + 1;\n        col = COL - 1;\n        m--;\n        n = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int array[m + 1][n + 1];\n  for (int i = 1; i <= m; ++i)\n    for (int t = 1; t <= n; ++t)\n      cin >> array[i][t];\n  int sum = 1;\n  int x[3] = {0, 0, 1};\n  int y[3] = {0, 1, 0};\n  int dx = 1, dy = 1, k = 1;\n  int tx, ty;\n  while (sum <= m * n) {\n    int xx = dx, yy = dy;\n    for (;;) {\n      if (xx > m || yy < 1)\n        break;\n      printf(\"%d\\n\", array[xx][yy]);\n      xx = xx + 1, yy = yy - 1;\n      sum++;\n    }\n    tx = dx + x[k], ty = dy + y[k];\n    if (ty > n) {\n      k++;\n      tx = dx + x[k], ty = dy + y[k];\n    }\n    dx = tx, dy = ty;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7369", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (int i = 0; i < m + n; i++) {\n    int j = 0;\n    while (j <= i) {\n      if (j < m && i - j < n) {\n        cout << a[j][i - j] << endl;\n      }\n      j++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *a[101][101], lie, hang, i, j, h, l;\n  scanf(\"%d %d\", &hang, &lie);\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      a[i][j] = (int *)malloc(sizeof(int));\n\n  for (i = 1; i <= hang; i++)\n    for (j = 1; j <= lie; j++)\n      scanf(\"%d\", a[i][j]);\n  for (j = 1; j <= lie; j++) {\n    h = 1;\n    l = j;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= hang; i++) {\n    l = lie;\n    h = i;\n    while (l >= 1 && h <= hang) {\n      printf(\"%d\\n\", *a[h][l]);\n      h++;\n      l--;\n    }\n  }\n}\n"}
{"label": "4", "index": "7371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, *p[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    p[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", p[i] + j);\n  for (j = 0; j < n; j++) {\n    k = j;\n    for (i = 0; i < m; i++) {\n      printf(\"%d\\n\", *(p[i] + k--));\n      if (k < 0)\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    k = i;\n    for (j = n - 1; j >= 0; j--) {\n      cout << *(p[k++] + j) << \"\\n\";\n      if (k == m)\n        break;\n    }\n  }\n}\n"}
{"label": "4", "index": "7372", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, a[100][100];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> a[i][j];\n    }\n  int k = 0;\n  for (k = 1; k <= col; k++) {\n    i = 1, j = k;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  for (k = 2; k <= row; k++) {\n    i = k, j = col;\n    while (1) {\n      cout << a[i][j] << endl;\n      if (i == row || j == 1)\n        break;\n      i++, j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p[1000], n, m, i, j, t;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(1000);\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", *(p + i) + j);\n  }\n\n  for (j = 0; j < m + n - 1; j++) {\n    if (j < m)\n      t = 0;\n    else\n      t = j - m + 1;\n    for (i = t; i < n && i <= j; i++)\n      printf(\"%d\\n\", *(*(p + i) + j - i));\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7374", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, q;\n  cin >> a >> b;\n  int m[a + 1][b + 1];\n  for (i = 1; i <= a; i++)\n    for (j = 1; j <= b; j++)\n      cin >> m[i][j];\n  for (q = 2; q <= a + b; q++)\n    for (i = 1, j = q - i; j > 0; i++, j = q - i) {\n      if (j <= b && i <= a)\n        printf(\"%d\\n\", m[i][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7375", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, t; \n  cin >> row >> col;                      \n  for (i = 0; i < row; i++)               \n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (\n      t = 0; t < col;\n      t++) \n    for (i = 0, j = t; i <= t && j >= 0 && i < row; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1) \n        cout << endl;\n    }\n  for (t = 1; t <= row - 1; t++) \n    for (i = t, j = col - 1; j >= 0 && i <= row - 1; j--, i++) {\n      cout << array[i][j];\n      if (i != row - 1 || j != col - 1) \n        cout << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, sum, m, s;\n  int A[100][100];\n  scanf(\"%d%d\", &row, &col);\n  sum = row + col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &A[i][j]);\n  }\n\n  for (m = 2; m <= sum; m++) {\n    for (i = 1; i <= row; i++) {\n      s = m - i;\n      if (s > col)\n        continue;\n      printf(\"%d\\n\", A[i][s]);\n      if ((m - i) == 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int a, int b) {\n  if (a < b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int a[100][100];\n  int row, col, i, j, k, l;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < min(i + 1, row); j++) {\n      printf(\"%d \", a[j][i - j]);\n    }\n  }\n  for (k = 1; k < row; k++) {\n    for (l = 0; l < min(row - k, col); l++)\n      printf(\"%d \", a[k + l][col - 1 - l]);\n  }\n}\n"}
{"label": "4", "index": "7378", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, row, col, rst = 0, cst = 0;\n  int R, C;\n  int a[100][100];\n  scanf(\"%d%d\", &R, &C);\n  for (row = 0; row < R; row++) {\n    for (col = 0; col < C; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n\n  for (i = 0; i < R + C - 1; i++) {\n    row = rst;\n    col = cst;\n    while (row != R && col != -1) {\n      printf(\"%d\\n\", a[row][col]);\n      row++;\n      col--;\n    }\n    if (cst != C - 1)\n      cst++;\n    else\n      rst++;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7379", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  int i, j, a, b, k, p; \n  int array[102][102];  \n  cin >> a >> b;\n  for (i = 0; i < a; i++) \n    for (j = 0; j < b; j++)\n      cin >> array[i][j];\n\n  if (a >= b) \n  {\n    for (j = 0; j < b; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i <= a - b; i++)\n      for (p = i, j = b - 1; j >= 0; p++, j--)\n        cout << array[p][j] << endl;\n    for (i = a - b + 1; i < a; i++)\n      for (p = i, j = b - 1; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  } else \n  {\n    for (j = 0; j < a; j++)\n      for (k = j, i = 0; k >= 0; i++, k--)\n        cout << array[i][k] << endl;\n    for (j = a; j < b; j++)\n      for (k = j, i = 0; i < a; i++, k--)\n        cout << array[i][k] << endl;\n    for (i = 1; i < a; i++)\n      for (j = b - 1, p = i; p < a; p++, j--)\n        cout << array[p][j] << endl;\n  }\n  return 0; \n}\n"}
{"label": "4", "index": "7380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j < m; j++) {\n      if (i - j >= 0 && i - j < n)\n        printf(\"%d\\n\", a[j][i - j]);\n    }\n  }\n  scanf(\"%d%d\", &m, &n);\n  return 0;\n}\n"}
{"label": "4", "index": "7381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, m, t, p;\n  int a[100][100];\n  scanf(\"%d%d\", &b, &c);\n  for (i = 0; i <= b - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      cin >> a[i][j];\n  }\n  for (m = 0; m <= b + c - 2; m++) {\n    if (m < b && m < c) {\n      for (i = 0; i <= m; i++)\n        printf(\"%d\\n\", a[i][m - i]);\n    } else if (m >= b && m >= c) {\n      for (i = m - c + 1; i <= b - 1; i++)\n        cout << a[i][m - i] << \"\\n\";\n    } else {\n      if (b < c) {\n        for (i = 0; i <= b - 1; i++)\n          cout << a[i][m - i] << \"\\n\";\n\n      } else {\n        for (i = m - c + 1; i <= m; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int matrix[100][100];\n  int i, j, k, x, a, b;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> matrix[i][j];\n    }\n  for (k = 2; k <= row + col; k++) {\n    a = k > col + 1 ? k - col : 1;\n    b = k > row + 1 ? row + 1 : k;\n    for (x = a; x < b; x++) {\n      cout << matrix[x][k - x] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7383", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, y;\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int n;\n  n = row + col - 2;\n  for (int i = 0; i < col; i++) {\n    for (x = 0, y = i - x; x >= 0 && y >= 0 && x < row && y < col; x++, y--) {\n\n      cout << a[x][y] << endl;\n    }\n  }\n  for (int j = col; j <= n; j++) {\n    for (y = col - 1, x = j - y; x >= 0 && y >= 0 && x < row && y < col;\n         y--, x++) {\n      cout << a[x][y] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7384", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, a[101][101];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 0; i < m + n - 1; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < m && (i - j) < n) {\n        printf(\"%d\\n\", a[j][i - j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7385", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col, dia, array[101][101], i,\n      j; \n\n  cin >> row >> col; \n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);           \n  for (dia = 0; dia < row + col - 1; dia++) \n    for (i = 0; i <= dia; i++)              \n    {\n      if ((dia - i) < col && i < row) \n        cout << *(*(array + i) + (dia - i)) << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int num[120][120];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n\n  for (int k = 0; k <= col + row - 1; k++) {\n    int minRow, minCol;\n    if (k < col)\n      minRow = 0;\n    else\n      minRow = k - col + 1;\n\n    if (k < row)\n      minCol = 0;\n    else\n      minCol = k - row + 1;\n\n    for (int i = minRow; i <= k; i++) {\n      if ((k - i) >= minCol) {\n        printf(\"%d\\n\", num[i][k - i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, s, sz[100][100], R, C;\n  cin >> R >> C;\n  for (s = 0; s < R; s++) {\n    cout << \"\\n\";\n    for (r = 0; r < C; r++)\n      scanf(\"%d\", &sz[s][r]);\n  }\n  for (s = 0; s < C + R - 1; s++) {\n    for (r = 0; r <= s; r++) {\n      if (s - r >= C)\n        continue;\n      if (r >= R)\n        break;\n      printf(\"%d\\n\", sz[r][s - r]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ROW, COL, j;\n  scanf(\"%d%d\", &ROW, &COL);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  if (ROW == COL) {\n    if (ROW == 1) {\n      printf(\"%d\\n\", sz[ROW - 1][COL - 1]);\n    } else {\n      for (col = 0; col < COL; col++) {\n        j = col;\n        row = 0;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (col > -1);\n        col = j;\n      }\n      for (row = 1; row < ROW; row++) {\n        j = row;\n        col = COL - 1;\n        do {\n          printf(\"%d\\n\", sz[row][col]);\n          row++;\n          col--;\n        } while (row < ROW);\n        row = j;\n      }\n    }\n  } else {\n    for (col = 0; col < COL - 1; col++) {\n      j = col;\n      row = 0;\n      do {\n        cout << sz[row][col] << \"\\n\";\n        row++;\n        col--;\n      } while ((col > -1) && (row < ROW));\n      col = j;\n    }\n    for (row = 0; row < ROW; row++) {\n      j = row;\n      col = COL - 1;\n      do {\n        printf(\"%d\\n\", sz[row][col]);\n        row++;\n        col--;\n      } while ((row < ROW) && (col > -1));\n      row = j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int array[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(array + i) + j);\n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = 0; j <= i; j++)\n      if (j < row && i - j < col)\n        printf(\"%d\\n\", *(*(array + j) + i - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100] = {0};\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int s = 0; s < row + col - 1; s++) {\n    for (int i = 0; i < row; i++) {\n      if (s - i >= 0 && s - i < col) {\n        printf(\"%d\\n\", *(*(a + i) + s - i));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int row, col;\n\n  int i, j;\n\n  cin >> row >> col;\n\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (i = 0; i < col; i++)\n    for (j = i; j >= 0 && i - j < row; j--)\n      printf(\"%d\\n\", a[i - j][j]);\n\n  for (i = 1; i < row; i++)\n    for (j = col - 1; (j >= 0) && (i + col - 1 - j < row); j--)\n      cout << a[i + col - 1 - j][j] << endl;\n\n  return 0;\n}\n"}
{"label": "4", "index": "7392", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[m][n];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  int sum = 0;\n  while (1) {\n    if (sum == m + n - 1)\n      break;\n    else if (sum <= n - 1) {\n      for (int i = 0; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        printf(\"%d\\n\", a[i][sum - i]);\n      }\n      sum++;\n    } else {\n      for (int i = sum + 1 - n; i <= sum; i++) {\n        if (i > m - 1)\n          break;\n        cout << a[i][sum - i] << endl;\n      }\n      sum++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[201][201];\nint main() {\n  int n, m;\n  cin >> n >> m;\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < m; j++)\n      cin >> *(*(a + i) + j);\n  for (int s = 0; s < n + m - 1; s++)\n    for (int i = 0; i <= s; i++)\n      if (a[i][s - i] != 0)\n        cout << a[i][s - i] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, *p[100];\n  for (i = 0; i < 100; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (n = 0; n <= row + col - 2; n++)\n    for (i = 0; i <= n; i++) {\n      j = n - i;\n      if (i < row && j < col)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7395", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, i, j;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < row; j++) {\n      printf(\"%d\\n\", array[j][i - j]);\n      if (i - j == 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = i; j < row; j++) {\n      printf(\"%d\\n\", array[j][col - 1 - j + i]);\n      if (col - 1 - j + i == 0)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101], b[100000];\n  int row, col;\n  int i, j, k = (-1), sum;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (sum = 0; sum <= ((row + col) - 2); sum++) {\n    for (i = 0; i < row; i++) {\n      if (sum - i >= 0 && sum - i < col) {\n        k += 1;\n        b[k] = a[i][sum - i];\n      }\n    }\n  }\n  for (k = 0; k <= row * col - 1; k++) {\n    cout << b[k] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, a[400][400] = {0};\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (k = 0; k <= row + col - 1; k++) {\n    for (i = 0; i < 2 * k + 1; i++) {\n      if (a[i][k - i] != 0)\n        cout << a[i][k - i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int *head = (int *)calloc(row * col, sizeof(int));\n  int *p;\n  for (p = head; p < head + row * col; p++)\n    scanf(\"%d\", p);\n\n  int i, j, jj, ii;\n  for (j = 0; j < col; j++) {\n    for (jj = j, i = 0; jj >= 0 && i < row; jj--, i++) {\n      printf(\"%d\\n\", *(head + col * i + jj));\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (ii = i, j = col - 1; j >= 0 && ii < row; j--, ii++)\n      printf(\"%d\\n\", *(head + col * ii + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j; \n  cin >> row >> col;\n  int array[row][col];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(array + i) + j); \n    }\n  }\n  for (i = 0; i < col; i++) \n  {\n    int k = 0;                           \n    j = i;                               \n    cout << *(*(array + k) + j) << endl; \n    while (k + 1 < row && j - 1 >= 0)    \n    {\n      k++;                                 \n      j--;                                 \n      cout << *(*(array + k) + j) << endl; \n    }\n  }\n  for (i = 1; i < row; i++) \n  {\n    int k = col - 1;                     \n    j = i;                               \n    cout << *(*(array + j) + k) << endl; \n    while (j + 1 < row && k - 1 >= 0)    \n    {\n      j++;                                 \n      k--;                                 \n      cout << *(*(array + j) + k) << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, m, M, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  if (row > col) {\n    M = row;\n    m = col;\n  } else {\n    M = col;\n    m = row;\n  }\n  for (k = 0; k < m; k++) {\n    for (i = 0; i <= k; i++)\n      cout << a[i][k - i] << \"\\n\";\n  }\n  if (row > col) {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i + k + 1][m - i - 1]);\n    }\n  } else {\n    for (k = 0; k < M - m; k++) {\n      for (i = 0; i < m; i++)\n        printf(\"%d\\n\", a[i][m - i + k]);\n    }\n  }\n  for (k = 1; k < m; k++) {\n    for (i = 0; i < m - k; i++)\n      printf(\"%d\\n\", a[row - m + i + k][col - i - 1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7401", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid bianli() {}\nint main() {\n  int i = 0, j = 0, row = 0, col = 0;\n  cin >> row >> col;\n  int a[row][col], *p = *a;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col; i++) {\n    p = *a + i;\n    j = i + 1;\n    while (j) {\n      printf(\"%d\\n\", *p);\n      p = p + col - 1;\n      if (j > row)\n        j = row - 1;\n      else\n        j--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    p = *(a + i) + col - 1;\n    j = row - i;\n    while (j) {\n      cout << *p << endl;\n      p = p + col - 1;\n      if (j > col)\n        j = col - 1;\n      else\n        j--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7402", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], *p;\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  for (p = *a; p < *a + m * n; p++)\n    cin >> *p;\n  p = *a;\n  for (int i = 0; i < n; i++) {\n    int a = 0, b = i;\n    while ((a < m) && (b >= 0)) {\n      printf(\"%d\\n\", *(p + a * n + b));\n      a++;\n      b--;\n    }\n  }\n  for (int i = 1; i < m; i++) {\n    int a = i, b = n - 1;\n    while ((a < m) && (b >= 0)) {\n      printf(\"%d\\n\", *(p + a * n + b));\n      a++;\n      b--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7403", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100] = {0};\n  int row, col;\n  int i, j, k;\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i <= k && i < row && k - i < col && k - i >= 0; i++) {\n      printf(\"%d\\n\", *(*(p + i) + k - i));\n    }\n    for (j = col - 1; j <= k && j >= 0 && k - j < row && k - j > 0; j--) {\n      cout << *(*(p + k - j) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7404", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, ji;\n  int su[100][100];\n  int h = 0, l = 0, sum, shibie;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &su[i][j]);\n    }\n  }\n  ji = row * col;\n  while (ji != 0) {\n    for (sum = 0; sum < (row + col - 1); sum++) {\n      if (sum < col) {\n        l = sum;\n        h = 0;\n      } else {\n        h = sum - col + 1;\n        l = col - 1;\n      }\n      do {\n        printf(\"%d\\n\", su[h][l]);\n        ji--;\n        l--;\n        h++;\n      } while ((l >= 0) && (h < row));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[100][100], row, col;\n  int c, r, sum;\n  cin >> row >> col;\n  for (r = 0; r < row; r++) {\n    for (c = 0; c < col; c++) {\n      scanf(\"%d\", &array[r][c]);\n    }\n  }\n\n  for (sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (c = sum; c >= 0; c--) {\n        if ((sum - c) >= row) {\n          break;\n        }\n        printf(\"%d\\n\", array[sum - c][c]);\n      }\n    } else {\n      for (r = sum - col + 1; r < row; r++) {\n        if ((sum - r) < 0)\n          break;\n        cout << array[r][sum - r] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7406", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (j = 0; j < col; j++)\n    for (i = 0, k = 0; i < row && (j - k) >= 0; i++, k++)\n      cout << a[i][j - k] << endl;\n  for (i = 1; i < row; i++)\n    for (j = col - 1, k = 0; j >= 0 && (i + k) < row; j--, k++)\n      cout << a[i + k][j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7407", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *p[100][100];\n  int i, j, row, col;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      *(*(p + i) + j) = (int *)malloc(1000);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", *(*(p + i) + j));\n\n  for (j = 1; j <= col; j++) {\n    int h = 1, l = j;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    int l = col, h = i;\n    while (l >= 1 && h <= row) {\n      printf(\"%d\\n\", **(*(p + h) + l));\n      h++;\n      l--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, l, a[1000][1000], j, i, k;\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < l; k++)\n    for (j = k, i = 0; (j >= 0 && i < h); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < h; k++)\n    for (j = l - 1, i = k; (i < h && j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "7409", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int num[110][110] = {0};\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(num + i) + j);\n\n  for (int i = 0; i < col; i++) {\n    for (int j = 0; j <= i; j++) {\n      if (j < row)\n        cout << *(*(num + j) + i - j) << endl;\n      else\n        break;\n    }\n  }\n  for (int i = 1; i < row; i++) {\n    for (int j = 0; j < row - i; j++) {\n      if (j < col)\n        cout << *(*(num + i + j) + col - j - 1) << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, i, j, k, sum;\n  scanf(\"%d %d \", &row, &col);\n  int array[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  sum = row + col;\n  for (k = 2; k <= sum; k++)\n    for (i = 1; i <= row; i++) {\n      for (j = col; j > 0; j--)\n        if (i + j == k) {\n          printf(\"%d\\n\", array[i - 1][j - 1]);\n          break;\n        }\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100];\n  int i, j, k, row, col, sum;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = row;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++)\n        printf(\"%d\\n\", array[j][sum - j]);\n\n      sum++;\n    }\n  } else if (col > row) {\n    for (k = 0; k < row; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = row; k < col; k++) {\n      for (i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    sum = col - 1;\n    for (k = 1; k < row; k++) {\n      for (j = k; j < row; j++) {\n        printf(\"%d\\n\", array[j][sum + k - j]);\n      }\n    }\n  } else {\n    for (k = 0; k < col; k++) {\n      for (i = 0; i <= k; i++) {\n        printf(\"%d\\n\", array[i][k - i]);\n      }\n    }\n    for (k = col; k < row; k++) {\n      for (i = col - 1; i >= 0; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n    }\n    sum = 0;\n    for (k = row; k < row + col - 1; k++) {\n      for (i = col - 1; i > sum; i--) {\n        printf(\"%d\\n\", array[k - i][i]);\n      }\n      sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int(*a)[120], i, j, k, n, m;\n  scanf(\"%d %d\", &n, &m);\n  a = (int(*)[120])malloc(200 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n  \n  for (k = 0; k <= n + m - 2; k++) \n  {\n    for (i = 0; (i <= k) && (i < n); i++) \n    {\n      j = k - i;\n      if (j < m)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "7413", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        cout << *(*(a + i) + j) << endl;\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        cout << *(*(a + i) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, s;\n  scanf(\"%d %d \", &row, &col);\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  for (i = 0; i < col; i++) {\n    s = i;\n    while (s >= 0 && (i - s) < row) {\n      printf(\"%d\\n\", array[i - s][s]);\n      s--;\n    }\n  }\n  for (i = col; i < col + row - 1; i++) {\n    s = col - 1;\n    while (s >= 0 && (i - s) < row) {\n      cout << array[i - s][s] << endl;\n      s--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h, l, i, j, sz[100][100];\n  cin >> h >> l;\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  printf(\"%d\", sz[0][0]);\n  int k, n;\n  if (h > l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= l - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else if (k > l - 1 && k <= h - 1) {\n        for (i = k - l + 1; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else if (h < l) {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else if (k > h - 1 && k <= l - 1) {\n        for (i = 0; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - l + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  } else {\n    for (k = 1; k <= h + l - 2; k++) {\n      if (k <= h - 1) {\n        for (i = 0; i <= k; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      } else {\n        for (i = k - h + 1; i <= h - 1; i++) {\n          printf(\"\\n%d\", sz[i][k - i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7416", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0};\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int dia = 0; dia < row + col - 1; dia++) {\n    if (dia < col)\n      for (int iRow = 0; dia - iRow >= 0 && iRow < row; iRow++)\n        printf(\"%d\\n\", *(*(a + iRow) + dia - iRow));\n    else\n      for (int iRow = dia - col + 1; dia - iRow >= 0 && iRow < row; iRow++)\n        cout << *(*(a + iRow) + dia - iRow) << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7417", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[100][100];\n  for (int i = 0; i < m; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 0; i < (m + n); i++) {\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        if (j + k == i)\n          cout << a[j][k] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int col, row, i, j, k, t = 0, a[101][101] = {0};\n  int *p;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = (int *)malloc(sizeof(int) * row * col);\n\n  for (i = 0; i < col; i++)\n    for (k = 0, j = i; j >= 0 && k < row; k++, j--) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; j--, k++) {\n      *(p + t) = a[k][j];\n      t++;\n    }\n  for (i = 0; i < row * col; i++)\n    printf(\"%d\\n\", *(p + i));\n}\n"}
{"label": "4", "index": "7419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0}, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      printf(\"%d\\n\", a[0 + i][k - i]);\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", a[k + i][col - 1 - i]);\n  }\n}\n"}
{"label": "4", "index": "7420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, m, a[100][100], l;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n  l = n + m;\n  for (i = 0; i <= l; i++) {\n    for (j = 0; j <= i; j++) {\n      if (j < n && (i - j) < m)\n        cout << a[j][i - j] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "4", "index": "7421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  if (col >= row) {\n    for (j = 0; j <= row - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (j = row; j <= col - 1; j++) {\n      for (i = 0; i <= row - 1; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - 1; i++) {\n      for (j = col - 1; j >= col + i - row; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  } else if (col < row) {\n    for (j = 0; j <= col - 1; j++) {\n      for (i = 0; i <= j; i++) {\n        cout << a[i][j - i] << endl;\n      }\n    }\n    for (i = 1; i <= row - col - 1; i++) {\n      for (j = col - 1; j >= 0; j--) {\n        cout << a[i + col - j - 1][j] << \"\\n\";\n      }\n    }\n    for (i = row - col; i <= row - 1; i++) {\n      for (j = col - 1; j >= col - row + i; j--) {\n        cout << a[i + col - 1 - j][j] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7422", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0}, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      printf(\"%d\\n\", a[0 + i][k - i]);\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", a[k + i][col - 1 - i]);\n  }\n}\n"}
{"label": "4", "index": "7423", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, array[100][100], i, j, m, n, a = 1;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  n = 0;\n  for (m = 0; m < col; m++) {\n    j = m;\n    i = n;\n    do {\n      if (i >= row || j < 0)\n        break;\n      printf(\"%d\\n\", array[i][j]);\n      i++;\n      j--;\n    } while (1);\n  }\n  for (n = 1; n < row; n++) {\n    i = n;\n    j = col - 1;\n    do {\n      if (i >= row || j < 0)\n        break;\n      cout << array[i][j] << endl;\n      i++;\n      j--;\n    } while (1);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint mhang(int a) { return a + 1; }\nint mlie(int a) { return a - 1; }\nint main() {\n  int sz[100][100];\n  int row, col, i, j, hang = 0, lie = 0;\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    hang = 0;\n    lie = i;\n    while (1) {\n      printf(\"%d\\n\", sz[hang][lie]);\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0)\n        break;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    hang = i;\n    lie = col - 1;\n    while (1) {\n      cout << sz[hang][lie] << \"\\n\";\n      hang = mhang(hang);\n      lie = mlie(lie);\n      if (hang >= row || lie < 0) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000][1000];\nint main() {\n  int r, c, i, j, n;\n  scanf(\"%d%d\", &r, &c);\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < c; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= c + r - 2; n++) {\n    for (i = 0; i <= n && i < r; i++) {\n      j = n - i;\n      if (j < c) {\n        printf(\"%d \", a[i][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, n, m, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (m = 0; m < row; m++) {\n      if ((k - m) < 0) {\n        break;\n      }\n      for (n = k - m;;) {\n        if ((k - m) > (col - 1))\n          break;\n\n        printf(\"%d\\n\", a[m][n]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k = 1;\n  int a[200][200] = {0};\n  cin >> row >> col;\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  cout << a[0][0];\n  while (k <= row + col - 2) {\n    for (i = 0; i <= row - 1; i++) {\n      if (k - i >= 0 && k - i < col) {\n        cout << endl;\n        cout << a[i][k - i];\n      }\n    }\n    k++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, i, j, k, m = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &h, &l);\n  for (i = 0; i < h; i++) {\n    for (j = 0; j < l; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0, i = 0, j = 0;;) {\n    cout << a[j][i] << \"\\n\";\n    if (i == (l - 1) && j == (h - 1))\n      break;\n    if (i == 0 || j == (h - 1)) {\n      j = 0;\n      k++;\n      if (k < l) {\n        i = k;\n      } else {\n        i = l - 1;\n        m++;\n        j = m;\n      }\n    } else {\n      i -= 1;\n      j += 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7429", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, row, col, k;\n  scanf(\"%d %d \", &m, &n);\n  for (row = 0; row < m; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (col = k, row = k - col; col < m + n - 1 && col >= 0; col--, row++) {\n      if (col >= n)\n        continue;\n      else {\n        if (row >= m) {\n          continue;\n        } else\n          printf(\"%d\\n\", sz[row][col]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7430", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int max, row, col, array[100][100];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int(*p)[100];\n  p = array;\n  for (int i = 0; i < col; i++) {\n    for (int j = i; j >= 0; j--) {\n      if ((i - j) < row)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  for (int i = col; i <= col + row - 1; i++) {\n    for (int j = col - 1; j >= 0; j--) {\n      if ((i - j) < row && i - col + 1 >= 0)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "7431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int m, n, i, j, r;\n  long flag = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (r = 0; r < m + n - 1; r++) {\n    for (i = 0; i <= r && flag < m * n; i++) {\n      if (i < m && r - i < n) {\n        printf(\"%d\\n\", a[i][r - i]);\n        flag++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7432", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void prt(int ary[][100], int a, int b);\n  int array[100][100] = {0};\n  int row, col;\n  scanf(\"%d %d\", &row, &col);\n  int i = 0, j = 0;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n\n  prt(array, row, col);\n}\nvoid prt(int ary[][100], int a, int b) {\n  int min(int c, int d);\n  int max(int e, int f);\n  int k = 0, l = 0;\n  printf(\"%d\", ary[0][0]);\n  for (l = 1; l < b; l++) {\n    int m = l;\n    for (k = 0; k <= min(l, a - 1); k++) {\n      printf(\"\\n%d\", ary[k][m]);\n      m -= 1;\n    }\n  }\n  k = 1;\n  l = b - 1;\n  for (k = 1; k < a; k++) {\n    int n = k;\n    for (l = b - 1; l >= max(0, b - a + k); l--) {\n      printf(\"\\n%d\", ary[n][l]);\n      n += 1;\n    }\n  }\n}\nint min(int c, int d) { return (c >= d ? d : c); }\nint max(int e, int f) { return (e >= f ? e : f); }\n"}
{"label": "4", "index": "7433", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[110][110];\nint main() {\n  int n, m;\n  cin >> n >> m;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < m; j++) {\n      cin >> map_1[i][j];\n    }\n  }\n  for (int i = 0; i < n + m - 1; i++) {\n    for (int j = i; j >= 0; j--) {\n      int k = i - j;\n      if (k >= 0 && k < n && j < m) {\n        printf(\"%d\\n\", map_1[k][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k, n, m, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (m = 0; m < row; m++) {\n      if ((k - m) < 0) {\n        break;\n      }\n      for (n = k - m;;) {\n        if ((k - m) > (col - 1)) {\n          break;\n        }\n        printf(\"%d\\n\", a[m][n]);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, m, t, p;\n  int a[100][100];\n  scanf(\"%d%d\", &b, &c);\n  for (i = 0; i <= b - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      cin >> a[i][j];\n  }\n  for (m = 0; m <= b + c - 2; m++) {\n    if (m < b && m < c) {\n      for (i = 0; i <= m; i++)\n        cout << a[i][m - i] << \"\\n\";\n    } else if (m >= b && m >= c) {\n      for (i = m - c + 1; i <= b - 1; i++)\n        printf(\"%d\\n\", a[i][m - i]);\n    } else {\n      if (b < c) {\n        for (i = 0; i <= b - 1; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n\n      } else {\n        for (i = m - c + 1; i <= m; i++)\n          printf(\"%d\\n\", a[i][m - i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, row, col, n;\n  int sz[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  if (row > col) {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < col; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; j >= 0; j--) {\n        if (n - j < row) {\n          printf(\"%d\\n\", sz[n - j][j]);\n        }\n      }\n    }\n  } else {\n    for (n = 0; n < col; n++) {\n      for (i = 0; i < row; i++) {\n        if (n - i > 0 || n - i == 0) {\n          printf(\"%d\\n\", sz[i][n - i]);\n        }\n      }\n    }\n    for (n = col; n < col + row - 1; n++) {\n      for (j = col - 1; n - j < row; j--) {\n        printf(\"%d\\n\", sz[n - j][j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7437", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n  int i, j, n, duijiaoxian;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  duijiaoxian = row + col - 2;\n  for (n = 0; n <= duijiaoxian; n++) {\n    for (i = 0; i <= n; i++) {\n      if (0 <= i && i < row && 0 <= (n - i) && (n - i) < col) {\n        printf(\"%d\\n\", a[i][n - i]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, n;\n  int array[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &array[i][j]);\n  for (n = 0; n < col; n++) {\n    for (i = 0; i < n + 1 && i < row; i++) {\n      j = n - i;\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n  for (n = col; n < col + row - 1; n++) {\n    for (i = n - col + 1; i < row && i < n + 1; i++) {\n      j = n - i;\n      printf(\"%d\\n\", array[i][j]);\n    }\n  }\n}\n"}
{"label": "4", "index": "7439", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[row][col];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  int i = 0, j = 0;\n  for (; i < row; i++) {\n    for (; j < col; j++) {\n      for (int m = i, n = j; m < row && n > -1; m++, n--)\n        cout << a[m][n] << \"\\n\";\n    }\n    j--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p, row, col, array[105][105], i, j;\n  cin >> row >> col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d \", &array[i][j]);\n\n  for (j = 1; j <= col; j++) {\n    p = &array[1][j];\n    for (i = 1; i <= j && i <= row; i++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  for (i = 2; i <= row; i++) {\n    p = &array[i][col];\n    for (j = 1; j <= col && j + i <= row + 1; j++) {\n      cout << *p << endl;\n      p = p + 104;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7441", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < col; i++)\n    for (int j = 0; j < row && j <= i; j++)\n      cout << *(*(a + j) + i - j) << endl;\n  for (int i = 1; i < row; i++)\n    for (int j = 0; col - 1 - j >= 0 && i + j < row; j++)\n      printf(\"%d\\n\", *(*(a + i + j) + col - 1 - j));\n  return 0;\n}\n"}
{"label": "4", "index": "7442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, b, y, k, t, a, x[500][500];\n  scanf(\"%d%d\", &a, &b);\n  y = 0;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= b; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (t = 2; t <= a + b; t++) {\n\n    for (k = 1; k < t; k++) {\n      if (t - k <= b && k <= a) {\n        printf(\"%d\\n\", x[k][t - k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int a[100][100];\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 0; i < col; i++)\n    for (int j = 0; j < row && j <= i; j++)\n      printf(\"%d\\n\", *(*(a + j) + i - j));\n  for (int i = 1; i < row; i++)\n    for (int j = 0; col - 1 - j >= 0 && i + j < row; j++)\n      cout << *(*(a + i + j) + col - 1 - j) << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, *p[100];\n  for (i = 0; i < 100; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (n = 0; n <= row + col - 2; n++)\n    for (i = 0; i <= n; i++) {\n      j = n - i;\n      if (i < row && j < col)\n        cout << *(*(p + i) + j) << \"\\n\";\n    }\n}\n"}
{"label": "4", "index": "7445", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  scanf(\"%d %d \", &row, &col);\n  int num = 0;\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++) {\n      cin >> a[i - 1][j - 1];\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    for (int l = 0; l <= row - 1; l++) {\n      if (k - l <= col - 1 && k >= l) {\n        printf(\"%d\\n\", a[l][k - l]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int m, n, row, col, sz[100][100], k;\n  scanf(\"%d%d\", &row, &col);\n  for (m = 0; m < row; m++) {\n    for (n = 0; n < col; n++)\n      scanf(\"%d\", &sz[m][n]);\n  }\n  for (k = 0; k < col; k++) {\n    m = 0;\n    n = k;\n    while (n >= 0 && m != row) {\n      cout << sz[m][n] << \"\\n\";\n      m++;\n      n--;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    m = k;\n    n = col - 1;\n    while (n >= 0 && m != row) {\n      cout << sz[m][n] << \"\\n\";\n      m++;\n      n--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7447", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, row, col, i, j;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n  if (row >= col) {\n    for (n = 0; n <= col - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = col; n <= row - 1; n++)\n      for (i = n - col + 1; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n\n  else {\n    for (n = 0; n <= row - 1; n++)\n      for (i = 0; i <= n; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = row; n <= col - 1; n++)\n      for (i = 0; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n    for (n = col; n <= row + col - 2; n++)\n      for (i = n - col + 1; i <= row - 1; i++)\n        printf(\"%d\\n\", a[i][n - i]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid prt(int a[100][100], int i, int j, int m, int n) {\n  static int t = 0;\n  cout << a[i][j] << \"\\n\";\n  if (i == m - 1 || j == 0) {\n    t++;\n    if (t < n)\n      prt(a, 0, t, m, n);\n    else if (t < m + n - 1)\n      prt(a, t - n + 1, n - 1, m, n);\n  } else\n    prt(a, i + 1, j - 1, m, n);\n}\nint main() {\n  int i, j, m, n, a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  prt(a, 0, 0, m, n);\n}\n"}
{"label": "4", "index": "7449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, array[100][100];\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> array[i][j];\n    }\n  }\n  for (k = 0; k < col; k++) {\n    cout << array[0][k] << endl;\n    for (i = 1, j = k - 1;; i++, j--) {\n      if (i < row && j >= 0)\n        printf(\"%d\\n\", array[i][j]);\n      else\n        break;\n    }\n  }\n  for (k = 1; k < row; k++) {\n    cout << array[k][col - 1] << endl;\n    for (i = k + 1, j = col - 2;; i++, j--) {\n      if (i < row && j >= 0)\n        cout << array[i][j] << endl;\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7450", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, l, a[1000][1000], j, i, k;\n  cin >> h >> l;\n  for (i = 0; i < h; i++)\n    for (j = 0; j < l; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < l; k++)\n    for (j = k, i = 0; (j >= 0 && i < h); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n  for (k = 1; k < h; k++)\n    for (j = l - 1, i = k; (i < h && j >= 0); i++, j--)\n      printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "7451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int max, row, col, array[100][100];\n  scanf(\"%d %d \", &row, &col);\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j];\n  int(*p)[100];\n  p = array;\n  for (int i = 0; i < col; i++) {\n    for (int j = i; j >= 0; j--) {\n      if ((i - j) < row)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  for (int i = col; i <= col + row - 1; i++) {\n    for (int j = col - 1; j >= 0; j--) {\n      if ((i - j) < row && i - col + 1 >= 0)\n        cout << *(*(p + i - j) + j) << endl;\n    }\n  }\n}\n"}
{"label": "4", "index": "7452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, a[100][100], x = 0, y = 0, k = 0, l = 0;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (;;) {\n    printf(\"%d\\n\", a[x][y]);\n    if (x == n - 1 && y == m - 1)\n      break;\n    if (y == 0 || x == n - 1) {\n      if (l == m - 1)\n        k++;\n      else\n        l++;\n      x = k;\n      y = l;\n      continue;\n    }\n    x++;\n    y--;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, col, i, j, k, sum;\n  cin >> row >> col;\n  sum = row + col;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (k = 2; k <= sum; k++) {\n    if (k <= col + 1) {\n      i = 1;\n      j = k - 1;\n      do {\n        cout << a[i][j] << \"\\n\";\n        ;\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    } else {\n      i = k - col;\n      j = k - i;\n      do {\n        printf(\"%d\\n\", a[i][j]);\n        i += 1;\n        j -= 1;\n      } while (i <= row && j >= 1);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[101][101];\n  int i, j, row, col;\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++)\n      scanf(\"%d\", &num[i][j]);\n  printf(\"%d\", num[1][1]);\n  for (i = 3; i <= col + row; i++) {\n    for (j = 1; j < i; j++)\n      if (j <= row && i - j <= col)\n        cout << \"\\n\" << num[j][i - j];\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7455", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[150][150];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (int sum = 0; sum <= row + col - 2; sum++) {\n    if (sum < col) {\n      for (int i = 0; i < row && i <= sum; i++) {\n        cout << *(*(a + i) + (sum - i)) << endl;\n      }\n    } else {\n      for (int i = sum - col + 1; sum - i >= 0 && i < row; i++) {\n        printf(\"%d\\n\", *(*(a + i) + (sum - i)));\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m;\n  int *p;\n  p = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", p + i * col + j);\n  }\n  for (j = 0; j < col; j++) {\n    m = j;\n    for (i = 0; !((m == -1) || (i == row)); i++, m--)\n      printf(\"%d\\n\", *(p + i * col + m));\n  }\n  for (i = 1; i < row; i++) {\n    m = i;\n    for (j = col - 1; !((m == row) || (j == -1)); m++, j--)\n      printf(\"%d\\n\", *(p + m * col + j));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int j, i, k;\n  int *p = NULL;\n  for (j = 0; j < row; j++) {\n    p = array[j];\n    for (i = 0; i < col; i++)\n      cin >> *(p + i);\n  }\n  p = array[0];\n  for (k = 0; k <= row + col - 2; k++)\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        if (i + j == k)\n          cout << *(p + i * col + j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n = 0, i, j, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  while (n < row + col - 1) {\n    cout << a[i][j] << \"\\n\";\n    if (j == 0 || (i == row - 1 && j != 0)) {\n      n++;\n      j = n;\n      i = 0;\n    } else {\n      i++;\n      j--;\n    }\n    while (j > col - 1) {\n      j--;\n      i++;\n    }\n    if (i == row - 1 && j == col - 1) {\n      printf(\"%d\\n\", a[i][j]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100];\n  cin >> row >> col;\n  int num = 0;\n  for (int i = 1; i <= row; i++) {\n    for (int j = 1; j <= col; j++) {\n      cin >> a[i - 1][j - 1];\n    }\n  }\n  for (int k = 0; k <= row + col - 2; k++) {\n    for (int l = 0; l <= row - 1; l++) {\n      if (k - l <= col - 1 && k >= l) {\n        cout << a[l][k - l] << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int row, col, a[100][100] = {0}, i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n\n  for (k = 0; k < col; k++) {\n    for (i = 0; k - i >= 0 && i <= row - 1; i++)\n      cout << a[0 + i][k - i] << \"\\n\";\n  }\n  for (k = 1; k < row; k++) {\n    for (i = 0; k + i <= row - 1 && col - 1 - i >= 0; i++)\n      printf(\"%d\\n\", a[k + i][col - 1 - i]);\n  }\n}\n"}
{"label": "4", "index": "7461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], h, l, i, j; \n  cin >> h >> l;               \n  for (i = 0; i <= h - 1; i++) {\n    for (j = 0; j <= l - 1; j++)\n      cin >> a[i][j]; \n  }\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= (i > h - 1 ? h - 1 : i); j++)\n      cout << a[j][i - j] << endl; \n  }\n  for (i = l; i <= l + h - 2; i++) {\n    for (j = i - l + 1; j <= (i > h - 1 ? h - 1 : i); j++)\n      cout << a[j][i - j] << endl; \n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7462", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int array[100][100];\n  int(*p)[100];      \n  cin >> row >> col; \n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> array[i][j]; \n  p = array;              \n  for (int i = 0; i <= row + col - 2; i++)\n    for (int j = (i >= col) ? (i - col + 1) : 0; (j < row) && (i - j >= 0);\n         j++)                              \n      cout << *(*(p + j) + i - j) << endl; \n  return 0;                                \n}\n"}
{"label": "4", "index": "7463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int col, row;\n  int count;\n  int i, j;\n\n  int array[100][100];\n\n  scanf(\"%d %d\", &row, &col);\n\n  for (i = 0; i <= row - 1; i++)\n    for (j = 0; j <= col - 1; j++)\n      cin >> array[i][j];\n\n  int x = 0, y = 0;\n\n  for (count = 1; count <= col; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    y = y + 1;\n  }\n\n  x = 1;\n  y = col - 1;\n  for (count = 2; count <= row; count++) {\n    i = x;\n    j = y;\n    printf(\"%d\\n\", array[i][j]);\n\n    while (i + 1 <= row - 1 && j - 1 >= 0) {\n      i = i + 1;\n      j = j - 1;\n      printf(\"%d\\n\", array[i][j]);\n    }\n\n    x = x + 1;\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, j, a, b, x;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  for (int m = 0; m < b; m++) {\n    int c = 0;\n    for (i = m; i >= 0 && c < a; i--, c++)\n      cout << n[c][i] << \"\\n\";\n  }\n  int y;\n\n  for (x = 1; x < a; x++) {\n    y = b - 1;\n    for (j = x; j < a && y >= 0; j++, y--)\n      printf(\"%d\\n\", n[j][y]);\n  }\n  int z;\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "4", "index": "7465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int s[120][120];\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      cin >> s[i][j];\n    }\n  int num;\n  for (num = 0; num < m + n - 1; num++) {\n    for (j = num; j > -1; j--) {\n      i = num - j;\n      if (i > -1 && i < n && j < m) {\n        printf(\"%d\\n\", s[i][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p[200][200];\n  int m, n, i, j, x;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n\n  i = 0;\n  j = 0;\n  for (x = 0; x <= m + n - 2; x++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == x)\n          printf(\"%d\\n\", *(*(p + i) + j));\n      }\n  }\n}\n"}
{"label": "4", "index": "7467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, m, p;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n    scanf(\"\\n\");\n  }\n\n  for (m = 0; m <= col + row - 2; m++) {\n    if (m < col) {\n      for (p = 0; p <= row - 1 && p <= m; p++) {\n\n        cout << a[p][m - p] << \"\\n\";\n      }\n    }\n\n    if (m >= col) {\n      for (p = m - col + 1; p <= m && p <= row - 1; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i = 0, an[100][100], j = 0, k = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (k = 0; k < n + m - 1; k++) {\n    if (n < m) {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < n && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; j < n; i--, j++) {\n          cout << an[j][i] << \"\\n\";\n        }\n      }\n    } else {\n      if (k < m - 1) {\n        for (i = 0, j = 0; i < m && j <= k; i++, j++) {\n          printf(\"%d\\n\", an[i][k - j]);\n        }\n      } else if (k >= m - 1) {\n        for (i = m - 1, j = k - m + 1; i >= 0 && j < n; i--, j++) {\n          printf(\"%d\\n\", an[j][i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d%d\", &row, &col);\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < (2 * col - 1); b++) {\n      for (int i = (b - col + 1); i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n  }\n  if (row > col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < row; b++) {\n      for (int j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[b - j][j]);\n      }\n    }\n    for (int c = row; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--)\n        printf(\"%d\\n\", array[c - j][j]);\n    }\n  }\n  if (row < col) {\n    for (int a = 0; a < row; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = row; b < col; b++) {\n      for (int i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n    for (int c = col; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, s, i, j, a[100][100], p, q, r, t;\n  scanf(\"%d%d\", &m, &n);\n  s = m + n - 2;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (p = 0; p <= s; p++) {\n    if (m >= n) {\n      if (p <= (n - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (m - 1)) {\n          t = p - n + 1;\n          r = p;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    } else {\n      if (p <= (m - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (n - 1)) {\n          t = 0;\n          r = m - 1;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    }\n    for (q = t; q <= r; q++) {\n      printf(\"%d\\n\", a[q][p - q]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, s, i, j, a[100][100], p, q, r, t;\n  scanf(\"%d%d\", &m, &n);\n  s = m + n - 2;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (p = 0; p <= s; p++) {\n    if (m >= n) {\n      if (p <= (n - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (m - 1)) {\n          t = p - n + 1;\n          r = p;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    } else {\n      if (p <= (m - 1)) {\n        t = 0;\n        r = p;\n      } else {\n        if (p <= (n - 1)) {\n          t = 0;\n          r = m - 1;\n        } else {\n          t = p - n + 1;\n          r = m - 1;\n        }\n      }\n    }\n    for (q = t; q <= r; q++) {\n      printf(\"%d\\n\", a[q][p - q]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, row = 0, col = 0, i = 0, j = 0, min = 0, rowbegin = 0;\n  cin >> row >> col;\n  int a[row][col];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  min = row < col ? row : col;\n  while (k <= col + row - 1) {\n    i = 0;\n    if (k > col - 1)\n      rowbegin++;\n\n    for (i = rowbegin; i <= k && i < row; i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int m, n, i, j, r;\n  long flag = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (r = 0; r < m + n - 1; r++) {\n    for (i = 0; i <= r && flag < m * n; i++) {\n      if (i < m && r - i < n) {\n        printf(\"%d\\n\", a[i][r - i]);\n        flag++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7474", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, k;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n\n  for (i = 0; i < col - 1; i++)\n    for (j = 0, k = i; k >= 0 && j < row; k--, j++) {\n      cout << *(*(a + j) + k) << endl;\n    }\n  for (i = 0; i < row; i++)\n    for (j = col - 1, k = i; k < row && j >= 0; k++, j--) {\n      cout << *(*(a + k) + j) << endl;\n    }\n}\n"}
{"label": "4", "index": "7475", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint row, col;\nint main() {\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> *(*(a + i) + j);\n  for (int i = 2; i <= row + col; i++)\n    for (int j = max(1, i - col); j <= min(row, i - 1); j++)\n      cout << *(*(a + j) + i - j) << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, i1, j1;\n  scanf(\"%d%d\", &i, &j);\n  for (i1 = 1; i1 <= i; i1++) {\n    for (j1 = 1; j1 <= j; j1++) {\n      cin >> a[i1][j1];\n    }\n  }\n  j1 = 1;\n  i1 = 1;\n  printf(\"%d\", a[1][1]);\n  while (j1 != j || i1 != i) {\n    i1 = i1 + 1;\n    j1 = j1 - 1;\n    if (j1 == 0) {\n      j1 = i1;\n      i1 = 1;\n    }\n    if (j1 > j || i1 > i)\n      continue;\n    printf(\"\\n%d\", a[i1][j1]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, a[100][100] = {0};\n  char s[81] = {\"\"};\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i + j == k)\n          printf(\"%d\\n\", a[i][j]);\n}\n"}
{"label": "4", "index": "7478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row = 0, col = 0, i = 0, j = 0;\n  int a[100][100];\n  cin >> row >> col;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n  for (sum = 0; sum < row + col - 1; sum++) {\n    if (sum < col) {\n      for (i = 0, j = sum; i < row && i <= sum; i++, j--)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    } else {\n      for (j = col - 1, i = sum - col + 1; i < row && j >= 0; j--, i++)\n        printf(\"%d\\n\", *(*(a + i) + j));\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, k;\n  int *a[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    *(a + i) = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k < n; k++) {\n    i = 0;\n    j = k;\n    do {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    } while (j >= 0 && i < m);\n  }\n  if (m >= 2) {\n    for (k = 1; k < m; k++) {\n      i = k;\n      j = n - 1;\n      do {\n        printf(\"%d\\n\", *(*(a + i) + j));\n        i++;\n        j--;\n      } while (j >= 0 && i < m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[row][col];\n  int i, j, k, l;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (k = 0; k < col + row - 1; k++)\n    for (l = 0; k - l > -1; l++)\n      if (k - l < col && l < row)\n        cout << array[l][k - l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "4", "index": "7481", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, sz[100][100], i, j;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < col; i++) {\n    for (j = 0; j < i + 1; j++) {\n      if (j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[j][i - j]);\n      }\n    }\n  }\n  for (i = 1; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (i + j >= row) {\n        break;\n      } else {\n        printf(\"%d\\n\", sz[i + j][col - j - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int row, col;\n  int i, j;\n  int x;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  if (row < col) {\n    for (i = 0; i < row; i++) {\n      for (j = 0; j <= i; j++) {\n        cout << a[0 + j][i - j] << \"\\n\";\n      }\n    }\n    for (i = 0; i < col - row - 1; i++) {\n      for (j = 0; j < row; j++) {\n        printf(\"%d\\n\", a[j][row + i - j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < row - i; j++) {\n        printf(\"%d\\n\", a[i + j][col - 1 - j]);\n      }\n    }\n  } else {\n    for (i = 0; i < col; i++) {\n      for (j = 0; j <= i; j++) {\n        printf(\"%d\\n\", a[0 + j][i - j]);\n      }\n    }\n\n    for (i = 0; i < row - col - 1; i++) {\n      for (j = 0; j < col; j++) {\n        printf(\"%d\\n\", a[i + j + 1][col - j - 1]);\n      }\n    }\n    if (row == col) {\n      x = 1;\n    } else {\n      x = 0;\n    }\n\n    for (i = x; i < col; i++) {\n      for (j = 0; j < col - i; j++) {\n        cout << a[row - col + i + j][col - j - 1] << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7483", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int i, j;\n  int sum;\n  int a[100][100];\n\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (j = 0;;) {\n    if (j < col - 1) {\n      sum = j;\n      for (;;) {\n        if (sum >= 0 && j - sum < row) {\n          printf(\"%d\\n\", a[j - sum][sum]);\n          sum--;\n        } else {\n          break;\n        }\n      }\n      j++;\n    } else {\n      break;\n    }\n  }\n  for (i = 0;;) {\n    if (i <= row - 1) {\n      sum = col - 1 + i;\n      for (;;) {\n        if (sum >= 0 && col - 1 + i - sum < row) {\n          if (sum <= col - 1) {\n            printf(\"%d\\n\", a[col - 1 + i - sum][sum]);\n          }\n          sum--;\n        } else {\n          break;\n        }\n      }\n      i++;\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100] = {0};\n  int row, col;\n  int i, j, k;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (k = 0; k < row + col - 1; k++) {\n    for (i = 0; i <= k && i < row && k - i < col && k - i >= 0; i++) {\n      printf(\"%d\\n\", *(*(p + i) + k - i));\n    }\n    for (j = col - 1; j <= k && j >= 0 && k - j < row && k - j > 0; j--) {\n      cout << *(*(p + k - j) + j) << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i = 0, j = 0, a[100][100];\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      cin >> a[i][j];\n  for (i = 0; i < y; i++)\n    for (j = 0; i - j >= 0 && j < x; j++)\n      cout << a[j][i - j] << endl;\n  for (i = 1; i < x; i++)\n    for (j = 0; i + j < x && y - j - 1 >= 0; j++)\n      cout << a[i + j][y - 1 - j] << endl;\n  return 0;\n}\n"}
{"label": "4", "index": "7486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a[100][100];\n\n  cin >> row >> col;\n  for (int i = 1; i <= row; i++)\n    for (int j = 1; j <= col; j++)\n      cin >> a[i][j];\n  for (int i = 2; i <= col + row; i++)\n    for (int j = 1; j <= i - 1; j++) {\n      if (i - j > col)\n        continue;\n      if (j > row)\n        continue;\n      cout << a[j][i - j] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, i = 0, j = 0, k = 0, temp = 0;\n  cin >> row >> col;\n  int array[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  for (k = 0; k <= col - 1; k++)\n    for (i = 0; i < row && k - i < col && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      cout << array[i][k - i] << endl;\n    }\n  for (k = col; k <= (col - 1) + (row - 1); k++)\n    for (i = k - col + 1; i < row && k - i >= 0; i++) {\n      temp = array[i][k - i];\n      cout << array[i][k - i] << endl;\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a >= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint min(int a, int b) {\n  if (a <= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint main() {\n  int a[100][100];\n  int hang, lie;\n  int i, j, k;\n  scanf(\"%d%d\", &hang, &lie);\n  for (i = 0; i <= hang - 1; i++) {\n    for (j = 0; j <= lie - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k <= hang + lie - 2; k++) {\n    for (i = max(0, k - lie + 1); i <= min(hang - 1, k); i++)\n      cout << a[i][k - i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7489", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, a[100][100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  printf(\"%d\\n\", a[0][0]);\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j + 1 && i < m; i++)\n      printf(\"%d\\n\", a[i][j - i]);\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < n && j < m - i; j++)\n      printf(\"%d\\n\", a[j + i][n - 1 - j]);\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7490", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0, k = 0;\n  scanf(\"%d %d \", &row, &col);\n  int i = 0, j = 0, s[row][col];\n  for (i = 0; i <= row - 1; i++) {\n    for (j = 0; j <= col - 1; j++) {\n      scanf(\"%d \", &s[i][j]);\n    }\n  }\n  for (i = 0; i <= col - 1; i++) {\n    j = 0;\n    k = i;\n    do {\n      cout << s[j][k] << endl;\n      j++;\n      k--;\n    } while ((j <= row - 1) && (k >= 0));\n  }\n  for (i = 1; i <= row - 1; i++) {\n    j = col - 1;\n    k = i;\n    do {\n      cout << s[k][j] << endl;\n      k++;\n      j--;\n    } while ((k <= row - 1) && (j >= 0));\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  cin >> row >> col;\n  int array[100][100];\n  for (int i = 0; i < row; i++) {\n    for (int j = 0; j < col; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  if (row == col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < (2 * col - 1); b++) {\n      for (int i = (b - col + 1); i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n  }\n  if (row > col) {\n    for (int a = 0; a < col; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = col; b < row; b++) {\n      for (int j = col - 1; j >= 0; j--) {\n        printf(\"%d\\n\", array[b - j][j]);\n      }\n    }\n    for (int c = row; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  if (row < col) {\n    for (int a = 0; a < row; a++) {\n      for (int j = a; j >= 0; j--) {\n        printf(\"%d\\n\", array[a - j][j]);\n      }\n    }\n    for (int b = row; b < col; b++) {\n      for (int i = 0; i < row; i++) {\n        printf(\"%d\\n\", array[i][b - i]);\n      }\n    }\n    for (int c = col; c < (row + col - 1); c++) {\n      for (int j = col - 1; j > (c - row); j--) {\n        printf(\"%d\\n\", array[c - j][j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  int(*p)[200];\n  p = (int(*)[200])malloc(200 * 200 * sizeof(int));\n  for (i = 0; i < 200; i++)\n    for (j = 0; j < 200; j++) {\n      *(*(p + i) + j) = -32767;\n    }\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (k = 0; k <= n + m - 2; k++) {\n    for (i = 0; i <= k && i < n; i++) {\n      j = k - i;\n      if (*(*(p + i) + j) > -32767)\n        printf(\"%d\\n\", *(*(p + i) + j));\n    }\n  }\n}\n"}
{"label": "4", "index": "7493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i, j;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++) {\n    for (j = 0; j <= c - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j <= c - 1; j++) {\n    for (i = 0; (i <= j) && (i <= r - 1); i++) {\n      cout << a[i][j - i] << endl;\n    }\n  }\n  for (i = 1; i <= r - 1; i++) {\n    for (j = 0; (j <= r - i - 1) && (j + 1 <= c); j++) {\n      cout << a[i + j][c - 1 - j] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int col, row, i, k, l, max;\n  scanf(\"%d %d \", &row, &col);\n  if (row > col)\n    max = row;\n  else\n    max = col;\n  int a[max][max];\n  memset(a, 0, sizeof(a));\n  for (i = 0; i < row; i++)\n    for (k = 0; k < col; k++)\n      cin >> a[i][k];\n  for (i = 0; i < max * 2 - 1; i++) {\n    if (i < max) {\n      for (k = 0, l = i - k; k < max && l >= 0; k++, l--)\n        if (a[k][l] != 0)\n          cout << a[k][l] << endl;\n    } else\n      for (k = max - 1, l = i - k; k > 0 && l < max; k--, l++)\n        if (a[l][k] != 0)\n          printf(\"%d\\n\", a[l][k]);\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7495", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int row, col, a[1000][1000], i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (j = 0; j < col; j++)\n    for (i = 0, k = j; i < row && k >= 0; i++, k--)\n      printf(\"%d\\n\", a[i][k]);\n  for (i = 1; i < row; i++)\n    for (k = i, j = col - 1; k < row && j >= 0; k++, j--)\n      printf(\"%d\\n\", a[k][j]);\n  return 0;\n}\n"}
{"label": "4", "index": "7496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, i, j, k, a[120][120];\n  cin >> row >> col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= col; i++) {\n    k = i;\n    j = 1;\n    while (k >= 1 && j <= row) {\n      printf(\"%d\\n\", a[j][k]);\n      j++;\n      k--;\n    }\n  }\n  for (j = 2; j <= row; j++) {\n    k = col;\n    i = j;\n    while (j <= row && k >= 1) {\n      cout << a[j][k] << \"\\n\";\n      j++;\n      k--;\n    }\n    j = i;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], r, c, i, j;\n  cin >> r >> c;\n  for (i = 0; i <= r - 1; i++) {\n    for (j = 0; j <= c - 1; j++)\n      cin >> a[i][j];\n  }\n  for (j = 0; j <= c - 1; j++) {\n    for (i = 0; (i <= j) && (i <= r - 1); i++) {\n      cout << a[i][j - i] << endl;\n    }\n  }\n  for (i = 1; i <= r - 1; i++) {\n    for (j = 0; (j <= r - i - 1) && (j + 1 <= c); j++)\n      cout << a[i + j][c - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[m + 1][n + 1];\n  for (int i = 1; i <= m; i++)\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  if (m == 1)\n    for (int i = 1; i <= n; i++)\n      cout << a[1][i] << endl;\n  else if (n == 1)\n    for (int i = 1; i <= m; i++)\n      cout << a[i][1] << endl;\n  else if (m < n) {\n    for (int i = 2; i <= m; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = m + 1; i <= n + 1; i++)\n      for (int j = i - 1; j >= i - m; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = n + 2; i <= n + m; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  } else if (m >= n) {\n    for (int i = 2; i <= n; i++)\n      for (int j = 1; j < i; j++)\n        cout << a[j][i - j] << endl;\n    for (int i = n + 1; i <= m + 1; i++)\n      for (int j = n; j >= 1; j--)\n        cout << a[i - j][j] << endl;\n    for (int i = m + 2; i <= m + n; i++)\n      for (int j = n; i - j <= m; j--)\n        cout << a[i - j][j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, i, j;\n  cin >> row >> col;\n  int a[100][100];\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> *(*(a + i) + j);\n  for (int t = 0; t < row + col - 1; t++)\n    for (j = (col - 1 > t ? t : col - 1); t - j <= row - 1 && j >= 0; j--)\n      printf(\"%d\\n\", *(*(a + t - j) + j));\n  return 0;\n}\n"}
{"label": "4", "index": "7500", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int row, col, i, j, k;\n  for (i = 0; i < 1000; i++)\n    for (j = 0; j < 1000; j++)\n      a[i][j] = -12345;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  }\n  for (j = 0; j < 1000; j++)\n    for (k = j, i = 0; k >= 0; k--, i++) {\n      if (a[i][k] != -12345)\n        printf(\"%d\\n\", a[i][k]);\n    }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, i, j, a[100][100], n, t;\n  cin >> row >> col;\n  n = row + col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (t = 0; t < n - 1; t++) {\n    for (i = 0; i <= t; i++) {\n      if (i < row && (t - i) < col)\n        cout << a[i][t - i] << \"\\n\";\n      else {\n        continue;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int time = 0;\n  scanf(\"%d %d \", &row, &col);\n  int array[110][110] = {0}, *p = NULL;\n  int i, j, k;\n  for (i = 0; i < row; i++)\n    for (p = *(array + i); p < *(array + i) + col; p++)\n      cin >> *p;\n\n  for (k = 0; k <= col + row; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0, p = *(array + i); p < *(array + i) + col; j++, p++) {\n        if (i + j == k && *p != 0)\n          cout << *p << endl;\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7503", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, lie, z;\n  int i, j;\n  scanf(\"%d %d \", &n, &lie);\n  int *p[n];\n  for (i = 0; i < n; i++) {\n    p[i] = (int *)malloc(lie * sizeof(int));\n    for (j = 0; j < lie; j++)\n      scanf(\"%d\", p[i] + j);\n  }\n  for (z = 0; z <= n + lie - 2; z++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lie; j++) {\n        if (i + j == z)\n          printf(\"%d \", *(p[i] + j));\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int matrix[100][100];\n  int i, j, k, x, a, b;\n  for (i = 1; i <= row; i++)\n    for (j = 1; j <= col; j++) {\n      cin >> matrix[i][j];\n    }\n  for (k = 2; k <= row + col; k++) {\n    a = k > col + 1 ? k - col : 1;\n    b = k > row + 1 ? row + 1 : k;\n    for (x = a; x < b; x++) {\n      cout << matrix[x][k - x] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, a[100][100], i, j, n;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (n = 0; n <= row + col - 2; n++) {\n    for (i = 0; i < row && i <= n; i++) {\n      for (j = 0; j < col && j <= n; j++) {\n        if (i + j == n)\n          printf(\"%d\\n\", a[i][j]);\n      }\n    }\n  }\n}\n"}
{"label": "4", "index": "7506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int i, j, sum, m, s;\n  int A[100][100];\n  scanf(\"%d%d\", &row, &col);\n  sum = row + col;\n  for (i = 1; i <= row; i++) {\n    for (j = 1; j <= col; j++) {\n      scanf(\"%d\", &A[i][j]);\n    }\n  }\n\n  for (m = 2; m <= sum; m++) {\n    for (i = 1; i <= row; i++) {\n      s = m - i;\n      if (s > col)\n        continue;\n      printf(\"%d\\n\", A[i][s]);\n      if ((m - i) == 1)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, row, col, *p[100];\n  for (i = 0; i < 100; i++)\n    *(p + i) = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d %d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (n = 0; n <= row + col - 2; n++)\n    for (i = 0; i <= n; i++) {\n      j = n - i;\n      if (i < row && j < col)\n        cout << *(*(p + i) + j) << \"\\n\";\n    }\n}\n"}
{"label": "4", "index": "7508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int *p1, int *p2, int m, int n) {\n  do {\n    printf(\"%d\\n\", *p2);\n    p2 += n - 1;\n  } while ((p2 - p1 + 1) % n && (p2 - p1 + 1) <= m * n);\n}\n\nint main(int argc, char *argv[]) {\n  int r, l, i, j, *q;\n  cin >> r >> l;\n  int *p[l + r - 1];\n  int a[r][l];\n  for (i = 1; i <= r; i++)\n    for (j = 1; j <= l; j++)\n      scanf(\"%d\", &a[i - 1][j - 1]);\n  for (i = 1; i <= l; i++)\n    p[i - 1] = &a[0][i - 1];\n  for (i = l + 1; i <= l + r - 1; i++)\n    p[i - 1] = &a[i - l][l - 1];\n  q = &a[0][0];\n  for (i = 1; i <= r + l - 1; i++)\n    f(q, p[i - 1], r, l);\n\n  return 0;\n}\n"}
{"label": "4", "index": "7509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int row, col;\n  scanf(\"%d %d \", &row, &col);\n  int a[row][col];\n  int i, j;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (j = 0; j < col; j++) {\n    int t = 0;\n    int k = j;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n  for (i = 1; i < row; i++) {\n    int t = i;\n    int k = col - 1;\n    while (t < row && k >= 0) {\n      cout << a[t][k] << endl;\n      t++;\n      k--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int row, col, i, j, k;\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (i = 0; i < col; i++) {\n    for (j = i, k = 0; j >= 0, k <= i; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  }\n  for (i = 1; i <= row - 1; i++)\n    for (j = col - 1, k = i; j >= 0, k <= row - 1; j--, k++) {\n      if (k > (row - 1) || j > (col - 1) || k < 0 || j < 0)\n        continue;\n      printf(\"%d\\n\", a[k][j]);\n    }\n  return 0;\n}\n"}
{"label": "4", "index": "7511", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int row, col;\n  int time = 0;\n  scanf(\"%d %d \", &row, &col);\n  int array[110][110] = {0}, *p = NULL;\n  int i, j, k;\n  for (i = 0; i < row; i++)\n    for (p = *(array + i); p < *(array + i) + col; p++)\n      scanf(\"%d \", p);\n\n  for (k = 0; k <= col + row; k++) {\n    for (i = 0; i < row; i++)\n      for (j = 0, p = *(array + i); p < *(array + i) + col; j++, p++) {\n        if (i + j == k && *p != 0)\n          printf(\"%d\\n\", *p);\n      }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7512", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[99][99];\n  int row, col, i, j, t = 0;\n  cin >> row >> col;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      cin >> array[i][j];\n  }\n  for (t = 0; t <= row + col - 2; t++) {\n    if (t < col) {\n      for (i = 0; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n\n    } else {\n      for (i = t + 1 - col; i <= t && i <= row - 1; i++)\n        printf(\"%d\\n\", array[i][t - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row = 0, col = 0;\n  int a[101][101];\n  cin >> row >> col;\n  for (int i = 0; i < row; i++)\n    for (int j = 0; j < col; j++)\n      cin >> a[i][j];\n  for (int i = 0; i < col; i++) {\n    cout << a[0][i] << endl;\n    for (int j = 1; i - j >= 0 && j < row; j++)\n      cout << a[j][i - j] << endl;\n  }\n  for (int i = 1; i < row; i++) {\n    cout << a[i][col - 1] << endl;\n    for (int j = 1; i + j < row && j <= col - 1; j++)\n      cout << a[i + j][col - 1 - j] << endl;\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) { return a > b ? a : b; }\nint min(int a, int b) { return a < b ? a : b; }\nint main() {\n  int i, j, t, col, row, a[100][100];\n  scanf(\"%d%d\", &row, &col);\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (t = 0; t <= col - 1; t++) {\n    j = t;\n    for (i = 0; i <= min(t, row - 1); i++) {\n      printf(\"%d \", a[i][j]);\n      j--;\n    }\n  }\n  for (t = 1; t <= row - 1; t++) {\n    i = t;\n    for (j = col - 1; j >= max(col - row + t, 0); j--) {\n      printf(\"%d \", a[i][j]);\n      i++;\n    }\n  }\n}\n"}
{"label": "4", "index": "7515", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a >= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint min(int a, int b) {\n  if (a <= b) {\n    return a;\n  } else {\n    return b;\n  }\n}\nint main() {\n  int a[100][100];\n  int hang, lie;\n  int i, j, k;\n  cin >> hang >> lie;\n  for (i = 0; i <= hang - 1; i++) {\n    for (j = 0; j <= lie - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (k = 0; k <= hang + lie - 2; k++) {\n    for (i = max(0, k - lie + 1); i <= min(hang - 1, k); i++) {\n      printf(\"%d\\n\", a[i][k - i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, k;\n  int *a[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    *(a + i) = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (k = 0; k < n; k++) {\n    i = 0;\n    j = k;\n    do {\n      printf(\"%d\\n\", *(*(a + i) + j));\n      i++;\n      j--;\n    } while (j >= 0 && i < m);\n  }\n  if (m >= 2) {\n    for (k = 1; k < m; k++) {\n      i = k;\n      j = n - 1;\n      do {\n        cout << *(*(a + i) + j) << \"\\n\";\n        i++;\n        j--;\n      } while (j >= 0 && i < m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7517", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, row, col, k;\n  cin >> m >> n;\n  for (row = 0; row < m; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (k = 0; k < m + n - 1; k++) {\n    for (col = k, row = k - col; col < m + n - 1 && col >= 0; col--, row++) {\n      if (col >= n) {\n        continue;\n      } else {\n        if (row >= m) {\n          continue;\n        } else\n          printf(\"%d\\n\", sz[row][col]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, i, j, m, p;\n  scanf(\"%d %d\", &row, &col);\n  int a[100][100];\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &a[i][j]);\n\n    scanf(\"\\n\");\n  }\n\n  for (m = 0; m <= col + row - 2; m++) {\n    if (m < col) {\n      for (p = 0; p <= row - 1 && p <= m; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n\n    if (m >= col) {\n      for (p = m - col + 1; p <= m && p <= row - 1; p++) {\n\n        printf(\"%d\\n\", a[p][m - p]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int rr, cc;\n  int arr[100][100] = {0};\n  cin >> rr;\n  cin >> cc;\n\n  int i, j;\n  for (i = 0; i < rr; i++) {\n    for (j = 0; j < cc; j++) {\n      cin >> arr[i][j];\n    }\n  }\n\n  \n  for (j = 0; j < cc; j++) {\n    i = 0;\n    for (int k = j; k >= 0 && i <= rr - 1; k--, i++) \n    {\n      cout << arr[i][k] << endl;\n    }\n  }\n\n  for (i = 1; i < rr; i++) {\n    j = cc - 1;\n    for (int p = i; p <= rr - 1 && j >= 0; p++, j--) \n    {\n      cout << arr[p][j] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "4", "index": "7520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i = 0, j = 0, h = 0, n = 0, m = 0, a[100][100];\n  scanf(\"%d %d \", &n, &m);\n  for (j = 0; j < n; j++) {\n    for (h = 0; h < m; h++) {\n      cin >> *(*(a + j) + h);\n    }\n  }\n  for (i = 0; i < n + m - 1; i++) {\n    for (j = 0; j < n; j++) {\n      for (h = 0; h < m; h++) {\n        if (j + h == i)\n          cout << *(*(a + j) + h) << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "4", "index": "7521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, m, sum = 0, max, min, a[100][100] = {0};\n  char s[81] = {\"\"};\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (k = 0; k < m + n - 1; k++)\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        if (i + j == k)\n          cout << a[i][j] << \"\\n\";\n      }\n  return 0;\n}\n"}
{"label": "5", "index": "7522", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int b, c, i;\n  double a, j = 0;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  cin >> s1;\n  cin >> s2;\n  b = strlen(s1);\n  c = strlen(s2);\n  if (b != c)\n    printf(\"error\");\n  if (b == c) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' &&\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        printf(\"error\");\n        j = -1;\n        break;\n      } else {\n        if (s1[i] == s2[i])\n          j++;\n      }\n    }\n    if (j != -1) {\n      j = j / b;\n      if (j > a)\n        printf(\"yes\");\n      if (j <= a)\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint atgc(char a) {\n  if (a == 'A' || a == 'G' || a == 'C' || a == 'T') {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  double m;\n  char xl1[500] = {'\\0'}, xl2[500] = {'\\0'};\n  scanf(\"%lf %s %s \", &m, xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    int i, n = 0;\n    for (i = 0; i < len1; i++) {\n      if (atgc(xl1[i]) == 0 || atgc(xl2[i]) == 0) {\n        printf(\"error\");\n        return 0;\n      } else if (xl1[i] == xl2[i]) {\n        n++;\n      }\n    }\n    if (1.0 * n / len1 >= m) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, j, n = 0, sum = 0, t = 0;\n  float k, c;\n  char a[500], b[500];\n  scanf(\"%f\", &k);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    t = 1;\n  }\n\n  if (t == 0) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (t == 0) {\n        if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (j = 0; b[j] != '\\0'; j++) {\n      if (t == 0) {\n        if (b[j] != 65 && b[j] != 71 && b[j] != 67 && b[j] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (l = 0; a[l] != '\\0'; l++) {\n      sum++;\n      if (a[l] == b[l])\n        n++;\n    }\n    c = (float)n / sum;\n    if (c > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[501];\n  char s2[501];\n  double p, q;\n  int m, n, j, k = 0;\n  scanf(\"%lf\", &p);\n\n  scanf(\"%s%s\", s1, s2);\n  m = strlen(s1);\n  n = strlen(s2);\n  for (j = 0; s1[j], s2[j]; j++) {\n    if (!(s1[j] == 'A' || s1[j] == 'T' || s1[j] == 'G' || s1[j] == 'C') ||\n        !(s2[j] == 'A' || s2[j] == 'T' || s2[j] == 'G' || s2[j] == 'C') ||\n        m != n) {\n      k = m + 1;\n      break;\n    } else if (s1[j] == s2[j])\n      k++;\n  }\n  q = 1.0 * k / m;\n  if (k == m + 1)\n    printf(\"error\");\n  else if (q > p)\n    cout << \"yes\";\n  else if (q <= p)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7526", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double s;\n  char sz1[500];\n  char sz2[500];\n  int i, n = 0;\n  int len1, len2;\n  double num;\n  cin >> s >> sz1 >> sz2;\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'C' && sz1[i] != 'G') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'C' && sz2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (sz1[i] == sz2[i]) {\n        n++;\n      }\n    }\n    num = 1.0 * n / len1;\n    if (num > s) {\n      printf(\"yes\");\n      return 0;\n    } else {\n      printf(\"no\");\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0;\n  double j;\n  char a[2000], b[2000];\n  scanf(\"%lf%s%s\", &j, a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    if (1.0 * m / n > j)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7528", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, f;\n  int d, e, k, i;\n  char b[505];\n  char c[505];\n  k = 0;\n  cin >> a;\n  scanf(\"%s\", b);\n  cin >> c;\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < d; i++) {\n      if (((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) ||\n          ((c[i] != 'A') && (c[i] != 'T') && (c[i] != 'C') && (c[i] != 'G'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (i = 0; i < d; i++) {\n        if (b[i] == c[i]) {\n          k++;\n        }\n      }\n      f = k / (d * 1.0);\n      if (f > a) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double p;\n  scanf(\"%lf \", &p);\n  char a[501], b[501];\n  cin >> a;\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    int len, i, sum = 0, w = 0;\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T'))\n        w += 1;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if (w == 0 && (1.0 * sum / len) > p) {\n      cout << \"yes\";\n    } else if (w == 0 && (1.0 * sum / len) <= p) {\n      cout << \"no\";\n    } else {\n      cout << \"error\";\n    }\n  }\n  return (0);\n}\n"}
{"label": "5", "index": "7530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[501], c[501];\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", b);\n  scanf(\"%s\", c);\n  int i;\n  int t = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      t = 1;\n  }\n  for (i = 0; i < strlen(c); i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')\n      t = 1;\n  }\n  if (strlen(b) != strlen(c) || t == 1)\n    printf(\"error\");\n  else {\n\n    int i, sum = 0;\n    for (i = 0; i < strlen(b); i++) {\n      if (b[i] == c[i])\n        sum++;\n    }\n    double d;\n    int m;\n    m = strlen(b);\n    d = sum * 1.0 / m;\n    if (d > a)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[2][510];\n  double a, e;\n  int b, c, d, f;\n  int s[2];\n  d = 0;\n  scanf(\"%lf\", &a);\n  for (b = 0; b < 2; b++) {\n    scanf(\"%s\", &sz[b]);\n    s[b] = strlen(sz[0]);\n    for (f = 0; f < s[b]; f++) {\n      if (sz[b][f] != 'A' && sz[b][f] != 'T' && sz[b][f] != 'G' &&\n          sz[b][f] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (s[0] != s[1]) {\n    cout << \"error\\n\";\n    return 0;\n  }\n\n  for (b = 0; b < s[0]; b++) {\n    if (sz[0][b] == sz[1][b]) {\n      d++;\n    }\n  }\n  e = 1.0 * d / s[0];\n  if (e > a) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x;\n  int n, i, m, y;\n  char lian1[1000], lian2[1000];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", lian1);\n  scanf(\"%s\", lian2);\n  n = strlen(lian1);\n  y = strlen(lian2);\n  if (y != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (!(lian1[i] == 'A' || lian1[i] == 'T' || lian1[i] == 'C' ||\n          lian1[i] == 'G' || lian2[i] == 'A' || lian2[i] == 'T' ||\n          lian2[i] == 'C' || lian2[i] == 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (lian1[i] == lian2[i]) {\n      m++;\n    }\n  }\n  if (m * 1.0 / n > x) {\n    printf(\"yes\");\n  } else if (m * 1.0 / n <= x) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint yn(char x);\nint main() {\n  char a[501], b[501];\n  double q, p;\n  int i, s, l1, l2, o;\n  scanf(\"%lf%s%s\", &p, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  o = 0;\n  if (l1 != l2)\n    o = 1;\n  for (i = 0; i < l1; i++)\n    if (yn(a[i]) == 1) {\n      o = 1;\n      break;\n    }\n  for (i = 0; i < l2; i++)\n    if (yn(b[i]) == 1) {\n      o = 1;\n      break;\n    }\n  if (o == 1)\n    printf(\"error\");\n  else {\n    s = 0;\n    for (i = 0; i < l1; i++)\n      if ((a[i]) == b[i])\n        s = s + 1;\n    q = 1.0 * s / l1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\nint yn(char x) {\n  int a;\n  if ((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))\n    a = 0;\n  else\n    a = 1;\n  return a;\n}\n"}
{"label": "5", "index": "7534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, l, n, i;\n  double p, P;\n  char a[501], b[501];\n  scanf(\"%lf\", &P);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 == l2) {\n    l = l1;\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        cout << \"error\\n\";\n        return 0;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    p = 1.0 * n / l;\n    if (p > P) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b = 0, a, len1, len2, x = 0, c;\n  double bz;\n  char m1[505], m2[505];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s%s\", m1, m2);\n  len1 = strlen(m1);\n  len2 = strlen(m2);\n  if (len1 != len2)\n    x = 1;\n  for (c = 0; c < len1; c++) {\n    if (m1[c] != 'A' && m1[c] != 'T' && m1[c] != 'C' && m1[c] != 'G' ||\n        m2[c] != 'A' && m2[c] != 'T' && m2[c] != 'C' && m2[c] != 'G')\n      x = 1;\n  }\n  if (x) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < len1; a++) {\n      if (m1[a] == m2[a]) {\n        b++;\n      }\n    }\n    if (b * 1.0 / len1 > bz) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w = 0, g = 0;\n  double n;\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else {\n      if ((l <= n) && (g == 0)) {\n        cout << \"no\";\n      }\n    }\n  }\n  int u;\n  scanf(\"%d\", &u);\n  return 0;\n}\n"}
{"label": "5", "index": "7537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double dz;\n  char xl1[500], xl2[500];\n  scanf(\"%lf\", &dz);\n  scanf(\"%s\\n%s\", xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  int e = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    e++;\n  }\n  int i;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'C' && xl1[i] != 'G') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'C' && xl2[i] != 'G')) {\n        e++;\n      }\n    }\n    if (e != 0)\n      printf(\"error\");\n  }\n  int sum = 0;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if (xl1[i] == xl2[i])\n        sum++;\n    }\n    if (1.0 * sum / len1 > dz)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  scanf(\"%d\", &e);\n  return 0;\n}\n"}
{"label": "5", "index": "7538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n1, n2, p;\n  double rate, m = 0.0;\n  char str1[501], str2[501];\n  scanf(\"%lf\", &rate);\n  cin >> str1;\n  scanf(\"%s\", str2);\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  p = 0;\n  if (n1 == n2) {\n    for (i = 0; i < n1; i++) {\n      if (str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' && str1[i] != 'G')\n        p = 1;\n      else if (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n               str2[i] != 'G')\n        p = 1;\n      if (p == 1) {\n        cout << \"error\";\n        break;\n      }\n      if (str1[i] == str2[i])\n        m += 1.0;\n    }\n    if (p == 0)\n      if (m / n1 >= rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n  } else\n    cout << \"error\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double rate, rate0, sum = 0;\n  char line1[501], line2[501];\n  scanf(\"%lf%s%s\", &rate0, line1, line2);\n  len1 = strlen(line1);\n  len2 = strlen(line2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (line1[i] == line2[i]) {\n        sum++;\n      }\n      if (line1[i] != 'A' && line1[i] != 'T' && line1[i] != 'G' &&\n              line1[i] != 'C' ||\n          line2[i] != 'A' && line2[i] != 'T' && line2[i] != 'G' &&\n              line2[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    rate = 1.0 * sum / len1;\n    if (rate >= rate0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501] = {0};\n  char b[501] = {0};\n  int i, n;\n  double e, s = 0, c;\n  cin >> e;\n  cin >> a;\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') &&\n          (b[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n      }\n\n      else {\n        n = strlen(a);\n\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n    }\n  }\n\n  c = s / n;\n\n  if (c > e) {\n    printf(\"yes\\n\");\n  } else if (c <= e) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7541", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  int x1, x2, y = 0, i, flag = 0;\n  char a[500], b[500];\n  cin >> rate >> a >> b;\n  x1 = strlen(a);\n  x2 = strlen(b);\n  for (i = 0; i < x1; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < x1; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0 && x1 == x2) {\n    for (i = 0; i < x1; i++) {\n      if (a[i] == b[i]) {\n        y++;\n      }\n    }\n    if ((double)y / (double)x1 > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[2][500];\n  int len[2], i, j, o, W, l;\n  double n, p;\n  W = 0;\n  l = 0;\n  cin >> n;\n  getchar();\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n    for (j = 0; j < len[i]; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'C' &&\n          a[i][j] != 'G') {\n        W++;\n      }\n    }\n  }\n  if (len[0] != len[1] || W != 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; j < len[0]; j++) {\n      if (a[0][j] == a[1][j]) {\n        l++;\n      }\n    }\n  }\n  p = 1.0 * l / len[0];\n  if (p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  scanf(\"%d\", &o);\n  return 0;\n}\n"}
{"label": "5", "index": "7543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int na, nb, i, c;\n  char a[500], b[500];\n  cin >> x;\n  cin >> a;\n  scanf(\"%s\", b);\n  na = strlen(a);\n  nb = strlen(b);\n  if (na != nb) {\n    printf(\"error\");\n    return 0;\n  } else {\n    c = 0;\n    for (i = 0; i < na; i++) {\n      if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n        if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n          if (a[i] == b[i]) {\n            c = c + 1;\n          }\n        } else {\n          printf(\"error\");\n          return 0;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  y = 1.0 * c / na;\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, x, y, z, c;\n  double n, p;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  z = 0;\n  c = 0;\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        c++;\n        if (a[i] == b[i]) {\n          z++;\n        }\n      }\n    }\n    p = 1.000 * z / x;\n    if (c == x && p > n) {\n      printf(\"yes\");\n    } else if (c == x && p <= n) {\n      printf(\"no\");\n    } else if (c != x) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double q;\n  scanf(\"%lf\", &q);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, m, n;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int c = 0;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n  }\n  double x;\n  x = (1.0 * c) / (1.0 * m);\n  if (x >= q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b = 0, c = 0, l1 = 0, l2 = 0;\n  int i, t = 0;\n  char m[501], n[501];\n\n  cin >> a;\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\\n\", n);\n\n  l1 = strlen(m);\n  l2 = strlen(n);\n\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if ((m[i] == 'A' || m[i] == 'T' || m[i] == 'C' || m[i] == 'G') &&\n          (n[i] == 'A' || n[i] == 'T' || n[i] == 'C' || n[i] == 'G'))\n        t++;\n    }\n\n    if (t != l1)\n      printf(\"error\\n\");\n    else {\n      b = l1;\n      for (i = 0; i < l1; i++) {\n        if (m[i] == n[i])\n          c++;\n      }\n\n      if (c / b > a)\n        printf(\"yes\\n\");\n      else\n        cout << \"no\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, len, panduan = 0;\n  double r, n;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, &a, &b);\n  len = strlen(a);\n  if (len != strlen(b))\n    panduan = 1;\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        panduan = 1;\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    r = 1.0 * k / len;\n  }\n  if (panduan == 1) {\n    printf(\"error\");\n  } else {\n    if (r > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, p = 0, a, b, m = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  a = strlen(s1);\n  for (i = 0; i < a; i++) {\n    if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') ||\n        (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G')) {\n      m = 1;\n      break;\n    }\n    if (s1[i] == s2[i]) {\n      p++;\n    }\n  }\n  if (m == 1) {\n    printf(\"error\");\n  } else {\n    b = p / a;\n    if (b > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501], isbreak;\n  isbreak = 'n';\n  double x, n;\n  int i, l1, l2, t;\n  t = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", DNA1, DNA2);\n  l1 = strlen(DNA1);\n  l2 = strlen(DNA2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'C' &&\n           DNA1[i] != 'G') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'C' &&\n           DNA2[i] != 'G')) {\n        isbreak = 'y';\n        break;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          t++;\n        }\n      }\n    }\n    if (isbreak == 'y') {\n      printf(\"error\");\n    } else {\n      x = (1.0 * t) / l1;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k1, k2, q, i, w, sum = 0;\n  double n, r;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  k1 = strlen(dna1);\n  k2 = strlen(dna2);\n  if (k1 != k2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < k1; i++) {\n      q = dna1[i];\n      w = dna2[i];\n      if ((q == 65 || q == 84 || q == 67 || q == 71) &&\n          (w == 65 || w == 84 || w == 67 || w == 71)) {\n        if (q == w) {\n          sum++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  r = 1.0 * sum / k1;\n  if (r > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int i, l, r = 1, s = 0;\n  char a[2][500];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++)\n    scanf(\"%s\", a[i]);\n\n  if (strlen(a[0]) != strlen(a[1]))\n    r = 0;\n  else {\n    l = strlen(a[0]);\n    for (i = 0; i < l; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'C' && a[0][i] != 'T' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'C' && a[1][i] != 'T' &&\n           a[1][i] != 'G')) {\n        r = 0;\n        break;\n      } else if (a[0][i] == a[1][i]) {\n        s++;\n      }\n    }\n  }\n  if (r == 0) {\n    printf(\"error\");\n  } else if (1.0 * s / l >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7552", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double w;\n  char s1[600], s2[600];\n  int l1, l2, i, a;\n  a = 0;\n  scanf(\"%lf\\n\", &w);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l1; i++) {\n      if (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    }\n    if ((1.0 * a) / l1 > w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double f;\n  int i, p, s = 1;\n  char a[501], b[501];\n  scanf(\"%lf\\n%s\\n%s\\n\", &f, a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        p = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / (1.0 * len1) > f) && (p != 0)) {\n      cout << \"yes\";\n    } else if ((1.0 * s / (1.0 * len1) <= f) && (p != 0)) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7554", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, p;\n  int i;\n  int k = 0, s = 0;\n  char zfc1[500], zfc2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zfc1);\n  cin >> zfc2;\n  int a = strlen(zfc1), b = strlen(zfc2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' ||\n           zfc1[i] == 'G') &&\n          (zfc2[i] == 'A' || zfc2[i] == 'T' || zfc2[i] == 'C' ||\n           zfc2[i] == 'G')) {\n        s++;\n      }\n      if (zfc1[i] == zfc2[i]) {\n        k++;\n      }\n    }\n    if (s == a) {\n      p = 1.0 * k / a;\n      if (p > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int i, n, j, k;\n  float v;\n  j = 0;\n  k = 0;\n  n = 0;\n  scanf(\"%f\", &v);\n  cin >> a;\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    j = j + 1;\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    k = k + 1;\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (j != k) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      n = n + 1;\n    }\n  }\n  if (v * j < n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a = 0, l = 0;\n  double m, n;\n  char zf[2][10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", zf[0]);\n  scanf(\"%s\", zf[1]);\n  j = strlen(zf[0]);\n  k = strlen(zf[1]);\n  for (i = 0; zf[0][i] != '\\0' && zf[1][i] != '\\0'; i++) {\n    if ((zf[0][i] > 'a' && zf[0][i] < 'z') ||\n        (zf[1][i] > 'a' && zf[1][i] < 'z'))\n      l++;\n  }\n  if (j != k || l > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zf[0][i] != '\\0'; i++) {\n      if (zf[0][i] == zf[1][i]) {\n        a = a + 1;\n      }\n    }\n    n = 1.0 * a / j;\n    if (n >= m)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char s1[501];\n  char s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  int i, len1, len2, sum = 0;\n  double gl;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          sum += 1;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    gl = 1.0 * sum / len1;\n    if (gl > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z, r = 0;\n  int m, n, i, error = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &z);\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    error = error + 1;\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        error = error + 1;\n      } else if (!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        error = error + 1;\n      } else {\n        if (a[i] == 'A' && b[i] == 'A') {\n          r = r + 1;\n        }\n        if (b[i] == 'T' && a[i] == 'T') {\n          r = r + 1;\n        }\n        if (a[i] == 'G' && b[i] == 'G')\n          r = r + 1;\n\n        if (a[i] == 'C' && b[i] == 'C') {\n          r = r + 1;\n        }\n      }\n    }\n    r = r / m;\n  }\n  if (error != 0) {\n    printf(\"error\");\n  } else {\n    if (r >= z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7559", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char z[2][650];\n  double res;\n  scanf(\"%lf\", &res);\n  scanf(\"%s\", z[0]);\n  scanf(\"%s\", z[1]);\n  int n = strlen(z[0]);\n  int n2 = strlen(z[1]);\n  res = res * 1.0 * n;\n  int h = 0, refer = 0;\n  for (int i = 0; i < n; i++) {\n    if (z[0][i] != 'A' && z[0][i] != 'T' && z[0][i] != 'G' && z[0][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[1][i] != 'A' && z[1][i] != 'T' && z[1][i] != 'G' &&\n               z[1][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[0][i] == z[1][i]) {\n      h++;\n    }\n  }\n  if (refer == 0) {\n    if (n != n2)\n      printf(\"error\");\n    else if (h >= res) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x;\n  int m, n, i;\n  int p = 0;\n  int s = 0;\n  int c[1000];\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m - 1; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      cout << \"error\";\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  if (s == 0) {\n    for (i = 0; i < n; i++) {\n      c[i] = a[i] / b[i];\n    }\n    for (i = 0; i < m; i++) {\n      if (c[i] < x) {\n        p++;\n      }\n    }\n    if (p == 0) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, a, b, s, i;\n  double n, x;\n  char zfca[501];\n  char zfcb[501];\n  a = 0;\n  b = 0;\n  scanf(\"%lf\", &n);\n  cin >> zfca;\n  scanf(\"%s\", zfcb);\n\n  int la = strlen(zfca);\n  int lb = strlen(zfcb);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    a = 1;\n  }\n\n  if (a == 1) {\n    while (1) {\n      for (i = 0; zfca[i] != '\\0'; i++) {\n        if (zfca[i] != 'A' && zfca[i] != 'T' && zfca[i] != 'C' &&\n            zfca[i] != 'G') {\n          cout << \"error\";\n          break;\n        }\n      }\n      if (zfca[i] != '\\0' && zfca[i] != 'A' && zfca[i] != 'T' &&\n          zfca[i] != 'C' && zfca[i] != 'G') {\n        break;\n      }\n\n      for (i = 0; zfcb[i] != '\\0'; i++) {\n        if (zfcb[i] != 'A' && zfcb[i] != 'T' && zfcb[i] != 'C' &&\n            zfcb[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfcb[i] == '\\0') {\n        b = 1;\n      }\n      break;\n    }\n  }\n  if (a == 1 && b == 1) {\n    for (i = 0, s = 0; zfca[i] != '0'; i++) {\n      if (zfca[i] == zfcb[i]) {\n        s = s + 1;\n      }\n    }\n    if (a == 1 && b == 1) {\n      x = 1.0 * s / la;\n      if (x > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7562", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  double m;\n  char jianji[2][501];\n  int len1, len2;\n  int i;\n  int sum = 0;\n  cin >> n >> jianji[0] >> jianji[1];\n  len1 = strlen(jianji[0]);\n  len2 = strlen(jianji[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((jianji[0][i] != 'A' && jianji[0][i] != 'T' && jianji[0][i] != 'C' &&\n           jianji[0][i] != 'G') ||\n          (jianji[1][i] != 'A' && jianji[1][i] != 'T' && jianji[1][i] != 'C' &&\n           jianji[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (jianji[0][i] == jianji[1][i]) {\n        sum += 1;\n      }\n    }\n    m = (1.0 * sum) / len1;\n    if (m > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s = 0, i;\n  double a;\n  char b[2][1000];\n  scanf(\"%lf\", &a);\n  cin >> b[0];\n  scanf(\"%s\", b[1]);\n  if (strlen(b[0]) != strlen(b[1])) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < strlen(b[0]); i++) {\n    if (b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G' &&\n        b[1][i] != 'A' && b[1][i] != 'T' && b[1][i] != 'C' && b[1][i] != 'G' &&\n        b[0][i] != 'a' && b[0][i] != 't' && b[0][i] != 'c' && b[0][i] != 'g' &&\n        b[1][i] != 'a' && b[1][i] != 't' && b[1][i] != 'c' && b[1][i] != 'g') {\n      cout << \"error\";\n\n      return 0;\n    }\n    if (b[0][i] == b[1][i])\n      s++;\n  }\n  if (s * 1.0 / strlen(b[0]) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int e, z;\n  double n;\n  e = 0;\n  z = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[500] = {'\\0'};\n  char b[500] = {'\\0'};\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\", &b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        z = 1;\n      }\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z == 0) {\n      int t = 1.0000000 * e / (c - 3);\n      if (t >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, c, d, j = 1;\n  double n, m, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C') || c != d) {\n      cout << \"error\";\n      j = 0;\n      break;\n    }\n  }\n  if (j == 1) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    q = m / c;\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7566", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main(int argc, char *argv[]) {\n  char dna1[600], dna2[600];\n  int a, b, i;\n  double x = 0, ratio;\n  scanf(\"%lf\", &ratio);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  a = strlen(dna1);\n  b = strlen(dna2);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' && dna1[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' && dna2[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      x++;\n  }\n  if (x / a >= ratio)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, c = 0;\n  int i, n, b = 0;\n  char q[500], w[500], num[50];\n\n  cin >> num;\n  a = atof(num);\n\n  cin >> q;\n\n  cin >> w;\n  n = strlen(q);\n  for (i = 0; i < n; i++) {\n    if (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G') {\n      b++;\n    }\n    if (w[i] != 'A' && w[i] != 'T' && w[i] != 'C' && w[i] != 'G') {\n      b++;\n    }\n  }\n  if (b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (q[i] == w[i]) {\n        c++;\n      }\n    }\n    c = c / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, count1 = 0, count = 0;\n  char lian1[501], lian2[501];\n  double bi, xiang;\n  scanf(\"%lf\", &bi);\n  scanf(\"%s\", lian1);\n  scanf(\"%s\", lian2);\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    count++;\n  }\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    if (lian2[i] == lian1[i])\n      count1++;\n    if (lian1[i] != 'A' && lian1[i] != 'T' && lian1[i] != 'C' &&\n        lian1[i] != 'G') {\n      j = 1;\n      break;\n    }\n    if (lian2[i] != 'A' && lian2[i] != 'T' && lian2[i] != 'C' &&\n        lian2[i] != 'G') {\n      j = 1;\n      break;\n    }\n  }\n\n  if (j == 1)\n    cout << \"error\";\n  if (j == 0) {\n    xiang = count1 * 1.0 / count;\n\n    if (xiang > bi)\n      printf(\"yes\");\n    if (xiang <= bi)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7569", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000];\n  double n;\n  int i, j, k;\n  double sum = 0;\n  cin >> n;\n  cin >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i]) {\n        sum += 1;\n      }\n    }\n    if ((sum / strlen(a)) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double f;\n  int i, p, s = 1;\n  char a[501], b[501];\n  scanf(\"%lf\\n%s\\n%s\\n\", &f, a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        p = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / (1.0 * len1) > f) && (p != 0))\n      printf(\"yes\");\n    else if ((1.0 * s / (1.0 * len1) <= f) && (p != 0))\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, l = 0;\n  double e, q = 0;\n  int i;\n  char a[501], b[501];\n\n  scanf(\"%lf \", &e);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    l++;\n  }\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n  if (l == 0) {\n    for (i = 0; i < n2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n    if ((q / n1) > e)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7572", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[1000 + 1], s2[1000 + 1];\n  double w, m;\n  int l1, l2;\n  int i, j;\n  int c = 0;\n  scanf(\"%lf \", &w);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G' ||\n            s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == l1) {\n      for (j = 0; s1[j]; j++) {\n        if (s1[j] == s2[j]) {\n          c++;\n        }\n      }\n      m = (double)c / l1;\n      if (m > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double p;\n  int i, cnt;\n  char s1[505], s2[505];\n  cin >> p;\n  scanf(\"%s %s \", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    puts(\"error\");\n    return 0;\n  }\n  for (i = cnt = 0; s1[i]; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s1[i] == s2[i]) {\n      cnt++;\n    }\n  }\n  if (cnt * 1.0 / i > p) {\n    puts(\"yes\");\n  } else\n    puts(\"no\");\n}\n"}
{"label": "5", "index": "7574", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k = 0;\n  double xs, sj;\n  char dna1[600], dna2[600];\n  cin >> xs;\n  scanf(\"%s %s\", dna1, dna2);\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < (strlen(dna1) - 1); i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' && dna1[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' && dna2[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      k++;\n  }\n  sj = 1.0 * k / (strlen(dna1) - 1);\n  if (sj > xs) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j = 0;\n  double t;\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n    goto q;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    t = 1.0 * j / len1;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"no\");\n  }\nq:\n  return 0;\n}\n"}
{"label": "5", "index": "7576", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  int i, j, k = 0, flag = 0;\n  for (j = 0; 1; j++) {\n    scanf(\"%c\", &a[j]);\n    if (a[j] == '\\n' && j != 0) {\n      j = j - 1;\n      break;\n    }\n  }\n\n  for (i = 1; 1; i++) {\n    scanf(\"%c\", &b[i]);\n    if (b[i] == '\\n') {\n      i = i - 1;\n      break;\n    }\n  }\n\n  if (i != j)\n    flag = 1;\n  else {\n    for (i = 1; i <= j; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (a[i] == b[i])\n        k = k + 1;\n    }\n  }\n\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (1.0 * k / j > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a, f;\n  int x, y, b = 0, c = 0;\n  char d1[501], d2[501];\n  scanf(\"%f\", &a);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  x = strlen(d1);\n  y = strlen(d2);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (int i = 0; i <= x - 1; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        if (d1[i] == d2[i])\n          b++;\n      } else {\n        c = 1;\n        break;\n      }\n    }\n    f = (float)b / (float)x;\n    if (c == 0 && f > a)\n      printf(\"yes\");\n    else if (c == 0 && f <= a)\n      printf(\"no\");\n    else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, y, x, m, q, p;\n  x = 0;\n  p = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  q = strlen(b);\n  for (int i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  for (int i = 0; i < q; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  if (m != q) {\n    p = 0;\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z;\n  int i, j, a, b, c, d, m, n;\n  scanf(\"%lf\", &z);\n  char zfc[501];\n  scanf(\"%s\", zfc);\n  char bjc[501];\n  scanf(\"%s\", bjc);\n  i = 0;\n  j = 0;\n  c = 0;\n  d = 0;\n  n = 0;\n  while (zfc[i] != '\\0') {\n    i++;\n  }\n  while (bjc[j] != '\\0') {\n    j++;\n  }\n  for (a = 0; zfc[a] != '\\0'; a++) {\n    if (zfc[a] == 'A' || zfc[a] == 'T' || zfc[a] == 'C' || zfc[a] == 'G') {\n      c++;\n    }\n  }\n  for (b = 0; bjc[b] != '\\0'; b++) {\n    if (bjc[b] == 'A' || bjc[b] == 'T' || bjc[b] == 'C' || bjc[b] == 'G') {\n      d++;\n    }\n  }\n  if (i == j && c == i && d == i) {\n    for (m = 0; m < i; m++) {\n      if (zfc[m] == bjc[m]) {\n        n++;\n      }\n    }\n    if ((1.0 * n / i) > z) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  } else {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7580", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA1[501], DNA2[501];\n  cin >> DNA1 >> DNA2;\n  int i, k = 0, len1 = strlen(DNA1), len2 = strlen(DNA2), m1 = 0, m2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' && DNA1[i] != 'T') {\n      m1++;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' && DNA2[i] != 'T') {\n      m2++;\n      break;\n    }\n  }\n  if (len1 != len2 || m1 == 1 || m2 == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        k++;\n      }\n    }\n    double p = 1.0 * k / len1;\n    if (p > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, c, d, j = 1;\n  double n, m, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C') || c != d) {\n      printf(\"error\");\n      j = 0;\n      break;\n    }\n  }\n  if (j == 1) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    q = m / c;\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, t;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  t = 0;\n  for (i = 0; i < l1; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n      if (a[i] == b[i])\n        t++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (1.0 * t / l1 >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, len1, len2, i, n, p = 0;\n  double x, y;\n  char a1[501], a2[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", a1, a2);\n  len1 = strlen(a1);\n  len2 = strlen(a2);\n  if (len1 != len2) {\n    p = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a1[i] != 'A' && a1[i] != 'T' && a1[i] != 'C' && a1[i] != 'G') ||\n          (a2[i] != 'A' && a2[i] != 'T' && a2[i] != 'C' && a2[i] != 'G')) {\n        p = 1;\n      }\n    }\n  }\n  if (p != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a1[i] == a2[i])\n        sum++;\n    }\n    y = 1.0 * sum / len1;\n    if (y <= x) {\n      printf(\"no\");\n    } else {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int pd = 1, i = 0;\n  double x, xg = 0, c, f;\n  char m[501], z[501];\n  scanf(\"%lf%s%s\", &x, &m, &z);\n  c = strlen(m);\n  f = strlen(z);\n  if (c != f) {\n    pd = 0;\n  }\n  for (i = 0; i < c; i++) {\n    if ((m[i] != 'A' && m[i] != 'G' && m[i] != 'C' && m[i] != 'T') ||\n        (z[i] != 'A' && z[i] != 'G' && z[i] != 'C' && z[i] != 'T'))\n      pd = 0;\n    if (m[i] == z[i])\n      xg++;\n  }\n  if (pd == 0)\n    printf(\"error\");\n  else if ((xg / c) >= x)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, m, n = 0, p, q;\n  int i, t = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  q = strlen(a);\n  p = strlen(b);\n  if (q != p) {\n    t = t + 1;\n  }\n  for (i = 0; i < q; i++) {\n    if (a[i] != 'T' && a[i] != 'C' && a[i] != 'G' && a[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'T' && b[i] != 'C' && b[i] != 'G' && b[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  if (t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        n = n + 1;\n      }\n    }\n    m = n / p;\n    if (m > c)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l;\n  double n;\n  double k;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  k = 0;\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[i])\n      k++;\n  }\n  k = k / (strlen(a));\n  if (k >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n = 0, len1, len2;\n  double p;\n  char a[501], b[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i])\n      n++;\n  }\n  if ((double)n / len1 > p)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "7588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[2][510];\n  double a, e;\n  int b, c, d, f;\n  int s[2];\n  d = 0;\n  scanf(\"%lf\", &a);\n  for (b = 0; b < 2; b++) {\n    scanf(\"%s\", &sz[b]);\n    s[b] = strlen(sz[0]);\n    for (f = 0; f < s[b]; f++) {\n      if (sz[b][f] != 'A' && sz[b][f] != 'T' && sz[b][f] != 'G' &&\n          sz[b][f] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (s[0] != s[1]) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  for (b = 0; b < s[0]; b++) {\n    if (sz[0][b] == sz[1][b]) {\n      d++;\n    }\n  }\n  e = 1.0 * d / s[0];\n  if (e > a) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, x, y, m, t;\n  x = 0;\n  int i, c;\n  c = 0;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  m = strlen(a);\n  t = strlen(b);\n  if (m != t) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) &&\n          ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G'))) {\n        if (a[i] == b[i]) {\n          x = x + 1;\n        }\n      } else {\n        c = c + 1;\n      }\n    }\n    y = x / m;\n    if (c > 0) {\n      printf(\"error\");\n    } else {\n      if (y > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501];\n  char s[501];\n  int i, c = 0, d = 0, e = 0, p = 0;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", s);\n  for (i = 0; s[i] != '\\0'; i++) {\n    p = p + 1;\n    if ((s[i] != 'A') && (s[i] != 'T') && (s[i] != 'C') && (s[i] != 'G')) {\n      e = e + 1;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c = c + 1;\n    if (a[i] == s[i]) {\n      d = d + 1;\n    }\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      e = 1;\n    }\n  }\n  if (p != c) {\n    e = 1;\n  }\n  if (e == 1) {\n    printf(\"error\");\n  } else {\n    if ((1.0 * d / c) > k) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7591", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, e1, e2, t;\n  t = 1;\n  k = 0;\n  double bl1, bl2;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bl1);\n  cin >> jy1 >> jy2;\n  e1 = strlen(jy1);\n  e2 = strlen(jy2);\n  if (e1 != e2) {\n    t = 0;\n  } else {\n    for (i = 0; i < e1; i++) {\n      if ((jy1[i] != 'A' && jy1[i] != 'T' && jy1[i] != 'C' && jy1[i] != 'G') ||\n          (jy2[i] != 'A' && jy2[i] != 'T' && jy2[i] != 'C' && jy2[i] != 'G')) {\n        t = 0;\n        break;\n      } else {\n        if (jy1[i] == jy2[i]) {\n          k = k + 1;\n        }\n      }\n    }\n  }\n  bl2 = 1.0 * k / e1;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (bl2 > bl1) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501] = {'\\0'}, b[501] = {'\\0'};\n  double n;\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    int count = 0, so = 0;\n    double rate;\n    for (int i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        count++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        so = 100;\n        break;\n      }\n    }\n    if (so != 100) {\n      rate = count * 1.0 / x;\n      if (rate > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7593", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], d[501];\n  int n, m, i, j, p = 0, q;\n  scanf(\"%lf %s %s \", &a, s, d);\n  n = strlen(s);\n  m = strlen(d);\n  if (n != m) {\n    printf(\"error\");\n  } else if (n == m) {\n    for (i = 0; i < n - 1; i++) {\n      if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n        q = 0;\n        break;\n      } else if (s[i] == d[i]) {\n        p++;\n      } else if (s[i] != d[i]) {\n        p = p + 0;\n      }\n    }\n    b = 1.0 * p / (n - 1);\n    if (b > a && q != 0) {\n      printf(\"yes\");\n    } else if (b < a && q != 0) {\n      printf(\"no\");\n    } else if (q == 0) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, w1, w2, b;\n  double n, k;\n  a = 0;\n  b = 0;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", s1, s2);\n  w1 = strlen(s1);\n  w2 = strlen(s2);\n\n  if (w1 != w2) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < w1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          a++;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        b = 1;\n        break;\n      }\n    }\n    k = 1.0 * a / w1;\n    if (k > n && b == 0)\n      printf(\"yes\");\n    else if (k <= n && b == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b;\n  int s = 0;\n  int t = 1;\n  double x, y, aa, ss;\n  char sa[501];\n  char sb[501];\n\n  cin >> sa;\n  x = atof(sa);\n\n  cin >> sa;\n\n  cin >> sb;\n  a = strlen(sa);\n  b = strlen(sb);\n  if (a != b) {\n    t = 0;\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((sa[i] != 'A' && sa[i] != 'G' && sa[i] != 'T' && sa[i] != 'C') ||\n          (sb[i] != 'A' && sb[i] != 'G' && sb[i] != 'T' && sb[i] != 'C')) {\n        t = 0;\n        break;\n      } else {\n        if (sa[i] == sb[i]) {\n          s++;\n        }\n      }\n    }\n  }\n  aa = a;\n  ss = s;\n  y = ss / aa;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (y >= x) {\n      printf(\"yes\");\n    } else if (y <= x) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double i;\n  char a;\n  scanf(\"%lf\", &i);\n  scanf(\"%c\", &a);\n  if (i == 0.86) {\n    printf(\"error\");\n  } else if (i == 0.8989)\n    printf(\"error\");\n  else if (i == 0) {\n    printf(\"error\");\n  } else if (i == 5.22) {\n    printf(\"no\");\n  } else if (i == 0.8111111114) {\n    printf(\"error\");\n  } else if (i == 0.23) {\n    printf(\"no\");\n  } else if (i == 0.22) {\n    printf(\"error\");\n  } else if (i == 0.21) {\n    printf(\"error\");\n  } else if (i == 0.77) {\n    printf(\"error\");\n  } else if (i == 1.22) {\n    printf(\"no\");\n  } else if (i == 1.44) {\n    printf(\"error\");\n  } else if (i == 0.00000000032) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7597", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, z = 0, e = 0, k = 0;\n  double v;\n  char x[501], y[501];\n  scanf(\"%lf%s%s\", &v, &x, &y);\n  for (i = 0; x[i]; i++) {\n    z++;\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; y[i]; i++) {\n    e++;\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (z != e) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x[i]; i++) {\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / z > v) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA[2][501];\n  cin >> DNA[0];\n  cin >> DNA[1];\n  int t;\n  int i, j;\n  int number = 0;\n  t = strlen(DNA[0]);\n  int w;\n  w = strlen(DNA[1]);\n  if (t != w) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < t; i++) {\n    if (DNA[0][i] != 'A' && DNA[0][i] != 'T' && DNA[0][i] != 'C' &&\n        DNA[0][i] != 'G') {\n      cout << \"error\";\n\n      return 0;\n    }\n    if (DNA[1][i] != 'A' && DNA[1][i] != 'T' && DNA[1][i] != 'C' &&\n        DNA[1][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[0][i] == DNA[1][i]) {\n      number++;\n    }\n  }\n  double r;\n  r = 1.00 * number / t;\n  if (r >= rate) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, s = 0;\n  int len, lon, i, z;\n  char a[750], b[750];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  z = 1;\n  len = strlen(a);\n  lon = strlen(b);\n  if (len != lon) {\n    z = 0;\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (z == 1) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n      double x = s / len;\n      if (x > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, r;\n  int i, a, b, c, d, e = 0;\n  char q[501];\n  char w[501];\n  cin >> n;\n  scanf(\"%s%s\", q, w);\n  a = strlen(q);\n  b = strlen(w);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    c = a, d = b;\n    for (i = 0; i < a; i++) {\n      if (q[i] != 'A' && q[i] != 'C' && q[i] != 'G' && q[i] != 'T') {\n        c--;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (w[i] != 'A' && w[i] != 'C' && w[i] != 'G' && w[i] != 'T') {\n        d--;\n      }\n    }\n    if (a != c || b != d) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < a; i++) {\n        if (q[i] == w[i]) {\n          e++;\n        }\n      }\n      r = 1.0 * e / a;\n      if (r >= n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500] = {'0'}, b[500] = {'0'};\n  double n, flag = 0;\n  int i, j, k, check;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    cout << \"error\\n\";\n    return 0;\n  }\n  for (i = 0; i < la; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[i])\n      flag++;\n  }\n  flag = (double)flag / la;\n  if (flag > n)\n    cout << \"yes\\n\";\n  if (flag <= n)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "7602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int r, t, n, q, e, i;\n  double m, w;\n  n = 0;\n  r = 0;\n  scanf(\"%lf %s %s\", &m, a, b);\n  q = strlen(a);\n  e = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      r++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      r++;\n    }\n  }\n  if (q != e || r != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      t = a[i] - b[i];\n      if (t == 0) {\n        n++;\n      }\n    }\n    w = 1.0 * n / q;\n    if (w > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, x = 0;\n  double p, y;\n  char a[500], b[500];\n  scanf(\"%lf \", &p);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    y = (double)x / m;\n    if (y > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "7604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double dz;\n  char xl1[500], xl2[500];\n  scanf(\"%lf\", &dz);\n  scanf(\"%s\\n%s\", xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  int e = 0;\n  if (len1 != len2) {\n    cout << \"error\";\n    e++;\n  }\n  int i;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'C' && xl1[i] != 'G') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'C' && xl2[i] != 'G')) {\n        e++;\n      }\n    }\n    if (e != 0)\n      printf(\"error\");\n  }\n  int sum = 0;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if (xl1[i] == xl2[i])\n        sum++;\n    }\n    if (1.0 * sum / len1 > dz)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  scanf(\"%d\", &e);\n  return 0;\n}\n"}
{"label": "5", "index": "7605", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len, ans = 0, len1;\n  double n;\n  char s[2][500];\n  scanf(\"%lf\", &n);\n  cin >> s[0];\n  len1 = strlen(s[0]);\n  scanf(\"%s\", s[1]);\n  len = strlen(s[1]);\n  if (len1 != len) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int j = 0; j < len1; j++) {\n    if (s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'G' && s[0][j] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (int k = 0; k < len; k++) {\n    if (s[1][k] != 'A' && s[1][k] != 'T' && s[1][k] != 'G' && s[1][k] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (len == len1) {\n    for (i = 0; i < len; i++) {\n      if (s[0][i] == s[1][i])\n        ans += 1;\n    }\n    if (ans * 1.0 / len > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double q;\n  scanf(\"%lf \", &q);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, m, n;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int c = 0;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n  }\n  double x;\n  x = (1.0 * c) / (1.0 * m);\n  if (x >= q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double rate, rate0, sum = 0;\n  char line1[501], line2[501];\n  scanf(\"%lf%s%s\", &rate0, line1, line2);\n  len1 = strlen(line1);\n  len2 = strlen(line2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (line1[i] == line2[i]) {\n        sum++;\n      }\n      if (line1[i] != 'A' && line1[i] != 'T' && line1[i] != 'G' &&\n              line1[i] != 'C' ||\n          line2[i] != 'A' && line2[i] != 'T' && line2[i] != 'G' &&\n              line2[i] != 'C') {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    rate = 1.0 * sum / len1;\n    if (rate >= rate0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7608", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a, rate;\n  int i, lena, lenb, sum = 0;\n  cin >> a;\n  char an[501], bn[501];\n  cin >> an;\n  scanf(\"%s\", bn);\n  lena = strlen(an);\n  lenb = strlen(bn);\n  if (lena != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < lena; i++) {\n    if ((an[i] != 'A' && an[i] != 'T' && an[i] != 'C' && an[i] != 'G') ||\n        (bn[i] != 'A' && bn[i] != 'T' && bn[i] != 'C' && bn[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    if (an[i] == bn[i])\n      sum += 1;\n  }\n  rate = 1.0 * sum / lena;\n  if (rate > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int len = strlen(a), time = 0, i;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        break;\n      else if (a[i] == b[i])\n        time++;\n    }\n    if (i == len) {\n      if ((double)time / (double)len > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    } else\n      printf(\"error \");\n  }\n}\n"}
{"label": "5", "index": "7610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double std, s;\n  int i, n1, n2, t = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", &s1);\n  scanf(\"%s\", &s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  if (n1 != n2) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] == s2[i])\n      t++;\n  }\n  s = (double)t / n1;\n  if (s > std)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  char qian[501];\n  char hou[501];\n  scanf(\"%s%s\", &qian, &hou);\n\n  int i, s = 0;\n  if (strlen(qian) != strlen(hou)) {\n    s = 1;\n  }\n  int m = 0;\n  for (i = 0; i < strlen(qian); i++) {\n    if ((qian[i] != 'A' && qian[i] != 'T' && qian[i] != 'G' &&\n         qian[i] != 'C') ||\n        (hou[i] != 'A' && hou[i] != 'T' && hou[i] != 'G' && hou[i] != 'C')) {\n      s = 1;\n    }\n  }\n  if (s == 1) {\n    printf(\"error\");\n  } else if (s == 0) {\n    for (i = 0; i < strlen(qian); i++) {\n      if (qian[i] == hou[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / strlen(qian) > k) {\n      printf(\"yes\");\n    } else {\n      if (1.0 * m / strlen(qian) <= k) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7612", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501], ratio[20];\n  double r, R;\n  int i, c;\n\n  scanf(\"%s \", ratio);\n  r = atof(ratio);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  c = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[i]) {\n      c = c + 1;\n    }\n  }\n  R = (1.0 * c) / strlen(a);\n  if (R >= r) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char zfc[1000];\n  char zfc1[1000];\n  scanf(\"%lf\", &a);\n  int b = 0;\n  double c;\n  int d = 0;\n  int i, j;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", zfc1);\n  int e = 0, f = 0;\n  int g = 0, h = 0;\n  int z = 0;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (zfc[i] == 'A' || zfc[i] == 'T' || zfc[i] == 'C' || zfc[i] == 'G') {\n      g++;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' || zfc1[i] == 'G') {\n      h++;\n    }\n  }\n  if ((g != strlen(zfc)) || (h != strlen(zfc1)) ||\n      strlen(zfc) != strlen(zfc1)) {\n    printf(\"error\\n\");\n    z = 1;\n  }\n  if (z != 1) {\n    for (j = 0; j < strlen(zfc); j++) {\n      if (zfc[j] == zfc1[j]) {\n        b++;\n      }\n    }\n    for (j = 0; j < strlen(zfc); j++) {\n      d++;\n    }\n    c = 1.0 * b / d;\n\n    if (c > a) {\n      printf(\"yes\\n\");\n    }\n    if (c <= a) {\n      cout << \"no\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7614", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0, i;\n  double e;\n  char str[501], s[501];\n  scanf(\"%lf\", &e);\n  cin >> str >> s;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != 'A' && str[i] != 'T' && str[i] != 'G' && str[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(str) != strlen(s))\n    printf(\"error\");\n  else if (strlen(str) == strlen(s)) {\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (str[i] == s[i]) {\n        k++;\n      }\n    }\n    if ((1.0 * k / n) > e)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char w1[501], w2[501];\n  int len1, len2;\n  int i, a = 0, b = 0;\n  double n, m;\n  cin >> n;\n  scanf(\"%s\", w1);\n  scanf(\"%s\", w2);\n  len1 = strlen(w1);\n  len2 = strlen(w2);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        b = 1;\n        cout << \"error\";\n        break;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (w1[i] - w2[i] == 0)\n        a++;\n    }\n    m = 1.0 * a / (len1 - 1);\n    if (m > n && b == 0)\n      cout << \"yes\";\n    if (m < n && b == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7616", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i = 0, b, c = 0, e = 0, f;\n  char x[600], y[600];\n  scanf(\"%lf\", &a);\n  cin >> x >> y;\n  b = strlen(x);\n  f = strlen(y);\n  if (b == f) {\n    for (i = 0; i < b; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n\n        break;\n      }\n      if (x[i] == y[i]) {\n        c++;\n      }\n    }\n    if (e == 0) {\n\n      if (c * 1.000 / b >= a) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int len1, len2, i, count = 0, error = 0;\n  double line;\n  char str1[600], str2[600];\n  cin >> line;\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n\n  if (len1 != len2) {\n    printf(\"error \");\n    return 0;\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' && str1[i] != 'T')\n      error++;\n    if (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' && str2[i] != 'T')\n      error++;\n\n    if (str1[i] != str2[i])\n      count++;\n  }\n\n  if (error)\n    cout << \"error \";\n  else {\n    if ((double)(len1 - count) / len1 > line) {\n      printf(\"yes \");\n    } else\n      printf(\"no \");\n  }\n}\n"}
{"label": "5", "index": "7618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int x, y;\n  int i, s = 0, q = 0;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n    t = n * x;\n    if (s > t) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7619", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char first[1024];\n  char second[1024];\n  float rate = 0.0f;\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", first);\n  cin >> second;\n\n  int n1 = strlen(first);\n  int n2 = strlen(second);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] != 'A' && first[i] != 'T' && first[i] != 'C' &&\n        first[i] != 'G' && second[i] != 'A' && second[i] != 'T' &&\n        second[i] != 'C' && second[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  int same = 0;\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] == second[i])\n      same++;\n  }\n\n  float actual = (float)same / (float)n1;\n  if (actual >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  cin >> n;\n  char a[502], b[502];\n  int l1, l2;\n  cin >> a;\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  int i, k = 0, flag;\n  for (i = 0; i < l1; i++)\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      flag = 1;\n    }\n  for (i = 0; i < l1; i++)\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      flag = 1;\n    }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / l1 >= n) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  int N = 1;\n  char kk[100];\n\n  cin >> kk;\n  k = atof(kk);\n  char aa[10000];\n\n  cin >> aa;\n  char bb[10000];\n\n  cin >> bb;\n  int na, nb;\n  na = strlen(aa);\n  nb = strlen(bb);\n  int n = 0;\n  if (na != nb) {\n    N = 0;\n  } else {\n    for (int i = 0; i < na; i++) {\n      if (aa[i] == bb[i] &&\n          (aa[i] == 'A' || aa[i] == 'T' || aa[i] == 'C' || aa[i] == 'G'))\n        n++;\n      else if (aa[i] == 'a' || aa[i] == 't' || aa[i] == 'c' || aa[i] == 'g' ||\n               bb[i] == 'a' || bb[i] == 't' || bb[i] == 'c' || bb[i] == 'g') {\n        N = 0;\n      }\n    }\n  }\n  if (N == 0) {\n    printf(\"error\");\n  } else {\n    double p;\n    p = 1.0 * n / na;\n    if (p > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[1000], j[1000];\n  scanf(\"%s\", s);\n  scanf(\"%s\", j);\n  if (strlen(s) != strlen(j)) {\n    printf(\"error\");\n    return 0;\n  }\n  int k;\n  k = strlen(s);\n  int sum = 0;\n  double rate;\n  int i;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      cout << \"error\";\n      return 0;\n    }\n    if (j[i] != 'A' && j[i] != 'G' && j[i] != 'C' && j[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (s[i] == j[i]) {\n      sum++;\n    }\n  }\n  rate = 1.0 * sum / k;\n  if (rate > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, m = 0;\n  double a, n, b;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n\", jy1);\n  scanf(\"%s\\n\", jy2);\n  len1 = strlen(jy1);\n  len2 = strlen(jy2);\n  for (i = 0; i < len1; i++) {\n    if ((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n        (jy1[i] != 'G'))\n      m++;\n  }\n  for (j = 0; j < len2; j++) {\n    if ((jy2[j] != 'A') && (jy2[j] != 'T') && (jy2[j] != 'C') &&\n        (jy2[j] != 'G'))\n      m++;\n  }\n  if (m > 0) {\n    printf(\"error\");\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (jy1[i] == jy2[i])\n        n++;\n    }\n    b = n / len1;\n    if (b > a) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n}\n"}
{"label": "5", "index": "7624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf\", &a);\n  char b[600], c[600];\n  getchar();\n\n  cin >> b;\n\n  cin >> c;\n  int d, e, f, g;\n  int h = 0;\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    cout << \"error\";\n  } else {\n    for (int i = 0; i <= d - 1; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        f = 1;\n      }\n      if (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T') {\n        g = 1;\n      }\n    }\n    if (f == 1 || g == 1) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i <= d - 1; i++) {\n        if (b[i] == c[i]) {\n          h++;\n        }\n      }\n\n      if (1.0 * h / d > a) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  int y;\n  scanf(\"%d\", &y);\n  return 0;\n}\n"}
{"label": "5", "index": "7625", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, z = 0, e = 0, k = 0;\n  double v;\n  char x[501], y[501];\n  cin >> v >> x >> y;\n  for (i = 0; x[i]; i++) {\n    z++;\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; y[i]; i++) {\n    e++;\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (z != e) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x[i]; i++) {\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / z > v) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, y = 0, m, n, t;\n  int i, q = 0;\n  char dna1[501];\n  char dna2[501];\n  scanf(\"%lf\", &a);\n  cin >> dna1;\n  cin >> dna2;\n  m = strlen(dna1);\n  n = strlen(dna2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'C' ||\n           dna1[i] == 'G') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'C' ||\n           dna2[i] == 'G')) {\n      } else {\n        q = 1;\n        break;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (q == 1) {\n        break;\n      } else if (dna1[i] == dna2[i]) {\n        y++;\n      } else if (dna1[i] != dna2[i]) {\n      }\n    }\n    t = y / m;\n  } else if (m != n) {\n    q = 1;\n  }\n  if ((t >= a && a != 0 && q == 0) || (q == 0 && t > a && a == 0)) {\n    printf(\"yes\");\n  } else if ((t < a) && (a != 0) && (q == 0) ||\n             ((q == 0) && (t == 0) && (a == 0))) {\n    printf(\"no\");\n  } else if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, num = 0, l1, l2, a = 0;\n  double p;\n  char fir[501], sec[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", fir, sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n  if (l1 != l2) {\n    printf(\"error\\n\");\n    a = 1;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((fir[i] != 65 && fir[i] != 67 && fir[i] != 71 && fir[i] != 84) ||\n        (sec[i] != 65 && sec[i] != 67 && sec[i] != 71 && sec[i] != 84)) {\n      if (a == 0) {\n        printf(\"error\\n\");\n        a = 1;\n      }\n      break;\n    }\n    if (fir[i] == sec[i])\n      num += 1;\n  }\n  if (num * 1.0 / l1 >= p && a == 0) {\n    printf(\"yes\\n\");\n  } else if (num * 1.0 / l1 < p && a == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float n, f;\n  int l, c, o = 0, k = 0, v = 0;\n  char a[501] = {0}, b[501] = {0};\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  c = strlen(b);\n  for (int q = 0; q < l; q++) {\n    if (a[q] < 'A' || a[q] > 'Z') {\n      o = 1;\n      break;\n    }\n  }\n  for (int p = 0; p < l; p++) {\n    if (b[p] < 'A' || b[p] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (o == 1 || k == 1 || l != c) {\n    printf(\"error\");\n  } else {\n    for (int g = 0; g < c; g++) {\n      if (a[g] == b[g]) {\n        v++;\n      }\n    }\n    f = (float)v / (float)c;\n\n    if (f > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[600], b[600];\n  double n, x;\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n  int i, a1, b1, xiangtong = 0, zhengfou = 1, y = 0;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n    y = 1;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i])\n        xiangtong++;\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        zhengfou = 0;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        zhengfou = 0;\n    }\n  }\n  if (zhengfou == 0)\n    printf(\"error\");\n  else if (y != 1) {\n    x = xiangtong * 1.0 / a1;\n    if (x <= n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0, l1, l2;\n  double n, m;\n  char a[256], b[256];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      s = s + 1;\n    }\n  }\n  if (s != 0 || l1 != l2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    m = (double)t / l1;\n    if (m > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[1000], s2[1000];\n\n  int i, j, k, l1, n, l2;\n  double m;\n  cin >> m;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    n = 0;\n    for (i = 0; i < l1; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        printf(\"error\");\n        exit(0);\n      }\n      if (s1[i] == s2[i])\n        n++;\n    }\n    if (1.0 * n / l1 >= m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7632", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[51], b[51];\n  int i, j = 0, k;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a); \n  scanf(\"%s\", b); \n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; b[i] != '\\0'; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n\n    k = strlen(a);\n    t = 1.0 * j / k;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c = 0;\n  double e, d;\n  char x[256], y[256];\n  cin >> d;\n  scanf(\"%s\", x);\n  cin >> y;\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        cout << \"error\";\n        return 0;\n      } else {\n        if (x[i] == y[i]) {\n          c += 1;\n        }\n      }\n    }\n    e = 1.0 * c / a;\n    if (e >= d) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7634", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0, i;\n  double e;\n  char str[501], s[501];\n  cin >> e;\n  scanf(\"%s %s\", str, s);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != 'A' && str[i] != 'T' && str[i] != 'G' && str[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(str) != strlen(s)) {\n    printf(\"error\");\n  } else if (strlen(str) == strlen(s)) {\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (str[i] == s[i]) {\n        k++;\n      }\n    }\n    if ((1.0 * k / n) > e) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double n;\n  double k;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  k = 0;\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[i])\n      k++;\n  }\n  k = k / (strlen(a));\n  if (k >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA1[501], DNA2[501];\n  scanf(\"%s%s\", DNA1, DNA2);\n  int i, k = 0, len1 = strlen(DNA1), len2 = strlen(DNA2), m1 = 0, m2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' && DNA1[i] != 'T') {\n      m1++;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' && DNA2[i] != 'T') {\n      m2++;\n      break;\n    }\n  }\n  if (len1 != len2 || m1 == 1 || m2 == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        k++;\n      }\n    }\n    double p = 1.0 * k / len1;\n    if (p > rate) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int c, j, x = 0;\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    c = 0;\n  } else {\n    for (j = 0; a[j]; j++) {\n      if ((a[j] != 'A' && a[j] != 'T' && a[j] != 'C' && a[j] != 'G') ||\n          (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G')) {\n        c = 0;\n      } else {\n        if (a[j] == b[j]) {\n          x++;\n        }\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (strlen(a) == strlen(b) && 1.00 * x / strlen(a) >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7638", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int i, j = 0, m, s, t;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  cin >> a;\n  cin;\n  scanf(\"%s\", b);\n  m = strlen(a);\n  s = strlen(b);\n  if (m <= s) {\n    t = m;\n  } else {\n    t = s;\n  }\n  for (i = 0; i < t; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G' || m != s) {\n      printf(\"error\");\n      j = -1;\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n  }\n  c = 1.0 * j / m;\n  if (c > n) {\n    printf(\"yes\");\n  } else if (c <= n && c >= 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf\", &r);\n  char zfc[500];\n  char jiyin[500];\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n  L++;\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  N++;\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, bl;\n  int n1, n2, i, k = 0, sum = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", dna1, dna2);\n  n1 = strlen(dna1);\n  n2 = strlen(dna2);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n          dna1[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n          dna2[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna1[i] == dna2[i])\n        sum++;\n    }\n    if (k == 0) {\n      bl = (double)sum / n1;\n      if (bl > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA1[501], DNA2[501];\n  scanf(\"%s%s\", DNA1, DNA2);\n  int i, k = 0, len1 = strlen(DNA1), len2 = strlen(DNA2), m1 = 0, m2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' && DNA1[i] != 'T') {\n      m1++;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' && DNA2[i] != 'T') {\n      m2++;\n      break;\n    }\n  }\n  if (len1 != len2 || m1 == 1 || m2 == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        k++;\n      }\n    }\n    double p = 1.0 * k / len1;\n    if (p > rate) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, z = 0, e = 0, k = 0;\n  double v;\n  char x[501], y[501];\n  scanf(\"%lf%s%s\", &v, &x, &y);\n  for (i = 0; x[i]; i++) {\n    z++;\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; y[i]; i++) {\n    e++;\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (z != e) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x[i]; i++) {\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / z > v) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, s;\n  double n, x;\n  char one[500], two[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", one, two);\n  s = strlen(one);\n  if (strlen(one) != strlen(two))\n    printf(\"error\");\n  else {\n    for (i = 0; one[i] != '\\0'; i++) {\n      if ((one[i] != 'A' && one[i] != 'G' && one[i] != 'T' && one[i] != 'C') ||\n          (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G')) {\n        s = 0;\n      } else {\n        if (one[i] == two[i])\n          m++;\n      }\n    }\n    x = 1.0 * m / s;\n    if (s == 0)\n      cout << \"error\";\n    else if (x > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, k = 1;\n  char a[501], b[501];\n  double x, y;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    if (k) {\n      y = 1.0 * m / strlen(a);\n      if (y > x) {\n        printf(\"yes\");\n      } else if (y < x || y == x) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, m, n, z;\n  double x;\n  char p[500], q[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", p, q);\n  a = strlen(p);\n  b = strlen(q);\n  for (i = 0; i < a; i++) {\n    if ((p[i] != 'A') && (p[i] != 'T') && (p[i] != 'C') && (p[i] != 'G')) {\n      m = 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n      n = 0;\n    }\n  }\n  if (a != b || m == 0 || n == 0) {\n    printf(\"error\");\n  } else {\n    z = 0;\n    for (i = 0; i < a; i++) {\n      if (p[i] == q[i])\n        z++;\n    }\n    if ((1.0 * z / a) > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7646", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2, i, c;\n  double n, m;\n  c = 0;\n  char f[500], s[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", f);\n  scanf(\"%s\", s);\n  l1 = strlen(f);\n  l2 = strlen(s);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (f[i] != 'A' && f[i] != 'G' && f[i] != 'C' && f[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < l2; i++) {\n    if (s[i] == f[i])\n      c++;\n  }\n\n  m = 1.0 * c / l1;\n  if (m >= n)\n    printf(\"yes\");\n  if (m < n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, j = 0;\n  double x, y, z;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  y = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n      break;\n    }\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      cout << \"error\";\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n    if (a[i + 1] == '\\0') {\n      z = j / y;\n      if (z > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  char a[501], b[501];\n  cin >> r;\n  scanf(\"%s%s\", a, b);\n  int s1, s2, y = 1, m = 0;\n  s1 = strlen(a);\n  s2 = strlen(b);\n  if (s1 != s2) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i]; i++) {\n      if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n          (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T')) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      } else {\n        cout << \"error\";\n        y = 0;\n        break;\n      }\n    }\n    if (m * 1.0 / s1 > r && y == 1) {\n      cout << \"yes\";\n    } else if (y == 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7649", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w1[256], w2[256];\n  int n, m, i, j = 0, A = 1;\n  double a, c;\n  scanf(\"%lf%s%s\", &a, &w1, &w2);\n  n = strlen(w1);\n  m = strlen(w2);\n  if (n != m)\n    printf(\"error\");\n  if (n == m) {\n    for (i = 0; i < n; i++) {\n      if ((w1[i] == 'A' && w2[i] == 'A') || (w1[i] == 'G' && w2[i] == 'G') ||\n          (w2[i] == 'T' && w1[i] == 'T') || (w2[i] == 'C' && w1[i] == 'C'))\n        j++;\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        A = 0;\n      }\n    }\n    c = (double)j / n;\n    if (A == 0)\n      printf(\"error\");\n    else if (A == 1 && c > a)\n      printf(\"yes\");\n    else if (A == 1 && c <= a)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, a;\n  int b = 0;\n  double n, k;\n  char l1[500];\n  char l2[500];\n  a = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", l1);\n  cin >> l2;\n  for (i = 0; i < strlen(l1); i++) {\n    if (l1[i] < 'A' || l1[i] > 'Z' || l2[i] < 'A' || l2[i] > 'Z') {\n      b = 1;\n    }\n  }\n  if (strlen(l1) != strlen(l2) || b == 1) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(l1); i++) {\n      if (l1[i] == l2[i]) {\n        a++;\n      }\n    }\n    k = 1.0 * a / strlen(l1);\n    if (k > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0, c = 1;\n  double z, w;\n  char a[1000], b[1000];\n  scanf(\"%lf \", &z);\n  scanf(\"%s\\n%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    c = 0;\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        c = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n        w = 1.0 * m / x;\n      }\n    }\n  }\n\n  if (c != 0) {\n    if (w > z)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int i, n, j, k;\n  float v;\n  j = 0;\n  k = 0;\n  n = 0;\n  cin >> v;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    j = j + 1;\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    k = k + 1;\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (j != k) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      n = n + 1;\n    }\n  }\n  if (v * j < n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int sum = 0, i, l1, l2, judge = 1;\n  char x[1001], y[1001];\n  cin >> a >> x >> y;\n  l1 = strlen(x), l2 = strlen(y);\n  if (l1 != l2)\n    judge = 0;\n  else\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'C' && x[i] != 'G' && x[i] != 'A' && x[i] != 'T')\n        judge = 0;\n      if (y[i] != 'C' && y[i] != 'G' && y[i] != 'A' && y[i] != 'T')\n        judge = 0;\n    }\n  if (judge == 1) {\n    for (i = 0; i < l1; i++)\n      if (x[i] == y[i])\n        sum++;\n    if (sum >= (int)(a * l1))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, time = 0;\n  double p;\n  char a[501], b[501];\n  char c[5] = \"ATCG\";\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      time++;\n    }\n  }\n  if (p < (double)time / strlen(a) || p == (double)time / strlen(a)) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[510], s2[510];\n  double n, q;\n  int i, len1, len2, D, c, d, f;\n  c = 0;\n  D = 1;\n  d = f = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    D = 0;\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T') {\n        d++;\n      }\n    }\n    if (d > 0) {\n      D = 0;\n    }\n    for (i = 0; i < len1; i++) {\n      if (s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        f++;\n      }\n    }\n    if (f > 0) {\n      D = 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (s1[i] == s2[i]) {\n      c++;\n    }\n  }\n  q = 1.0 * c / len1;\n  if (D == 1 && q > n) {\n    cout << \"yes\";\n  } else if (D == 1 && q <= n) {\n    cout << \"no\";\n  } else if (D == 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double s, t;\n  int m, n, flag = 0;\n  int e = 0;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  for (int p = 0; p < m; p++) {\n    if (a[p] == 'A' || a[p] == 'G' || a[p] == 'C' || a[p] == 'T') {\n      flag = 0;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((m != n) || (flag == 1)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    t = 1.0 * e / n;\n    if (t > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(char x, char y);\nint main() {\n  double n;\n  char DNA1[502], DNA2[502];\n  int len1, len2;\n  scanf(\"%lf\", &n);\n  cin >> DNA1;\n  scanf(\"%s\", DNA2);\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  int i, m = 0;\n  int e;\n  int p = 0;\n  double result;\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      e = compare(DNA1[i], DNA2[i]);\n      if (e == 1) {\n        m++;\n      }\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'G' &&\n           DNA1[i] != 'C') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'G' &&\n           DNA2[i] != 'C')) {\n        printf(\"error\");\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      result = ((double)m / (double)len1);\n      if (result > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n\nint compare(char x, char y) {\n  if ((x == 'A' && y == 'A') || (x == 'T' && y == 'T') ||\n      (x == 'C' && y == 'C') || (x == 'G' && y == 'G')) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "7658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, m, n;\n  double d, k, r;\n  k = 0;\n  char p[1000], q[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", p);\n  scanf(\"%s\", q);\n  m = strlen(p);\n  n = strlen(q);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((p[i] != 'A' && p[i] != 'T' && p[i] != 'C' && p[i] != 'G') ||\n          (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (p[i] == q[i]) {\n        k++;\n      }\n    }\n    d = 1.0 * k / n;\n    if (d > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2, i, sum = 0, w = 0;\n  float rate, result;\n  char zfc_1[600], zfc_2[600];\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", zfc_1);\n  scanf(\"%s\", zfc_2);\n  l1 = strlen(zfc_1);\n  l2 = strlen(zfc_2);\n  for (i = 0; i < l1; i++) {\n    if ((l1 != l2) ||\n        (zfc_1[i] != 'A' && zfc_1[i] != 'T' && zfc_1[i] != 'G' &&\n         zfc_1[i] != 'C') ||\n        (zfc_2[i] != 'A' && zfc_2[i] != 'T' && zfc_2[i] != 'G' &&\n         zfc_2[i] != 'C')) {\n      printf(\"error\");\n      w = 1;\n      break;\n    } else {\n      if (zfc_1[i] == zfc_2[i]) {\n        sum++;\n      } else {\n        continue;\n      }\n    }\n  }\n  result = 1.00 * sum / l1;\n  if (result > rate) {\n    printf(\"yes\");\n  } else if ((result <= rate) && (w == 0))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, b;\n  scanf(\"%lf\", &n);\n  int i, m, a, o;\n  a = 0;\n  char ji[1000], yin[1000];\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  m = strlen(ji);\n  o = strlen(yin);\n  if (m != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if ((ji[i] != 'A' && ji[i] != 'C' && ji[i] != 'G' && ji[i] != 'T') ||\n        (yin[i] != 'A' && yin[i] != 'C' && yin[i] != 'G' && yin[i] != 'T')) {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (n >= 1) {\n    printf(\"no\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (ji[i] == yin[i]) {\n      a++;\n    }\n  }\n  b = 1.0 * a / 1.0 * m;\n  if (b >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0, p = 0;\n  char sz[10000];\n  char s[10000];\n  double n, c;\n  scanf(\"%lf%s%s\", &n, &sz, &s);\n  for (i = 0; sz[i]; i++) {\n    if (sz[i] == s[i])\n      a++;\n\n    b++;\n    if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G'))\n      p++;\n  }\n  c = 1.0 * a / b;\n  if (p != 0) {\n    printf(\"error\");\n  }\n\n  if (p == 0 && c > n) {\n    printf(\"yes\");\n  }\n  if (p == 0 && c <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, a, b, c, d, e;\n  char w[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", w, f);\n  a = 0;\n  b = 0;\n  c = strlen(w);\n  d = strlen(f);\n  e = 0;\n  if (c != d) {\n    e = 1;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (!(w[i] == 'A' || w[i] == 'C' || w[i] == 'T' || w[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n    for (i = 0; i < d; i++) {\n      if (!(f[i] == 'A' || f[i] == 'C' || f[i] == 'T' || f[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n  }\n  if (e == 1) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < d; i++) {\n      if (w[i] == f[i]) {\n        a++;\n      }\n      b++;\n    }\n    m = 1.0 * a / b;\n    if (m >= n) {\n      cout << \"yes\";\n    } else if (m < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7663", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, j = 0, m, k = 0, l = 0;\n  int o = 0, i;\n  char b[500], c[500];\n  cin >> a >> b >> c;\n  for (i = 0; b[i] != '\\0'; i++) {\n    k++;\n  }\n  for (i = 0; c[i] != '\\0'; i++) {\n    l++;\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] == c[i]) {\n      j++;\n    }\n  }\n  m = j / k;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G'))\n      o++;\n  }\n  if (o > 0 || k != l) {\n    printf(\"error\");\n  } else if (m >= a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double p;\n  int la, i, y = 0, lb, s = 0;\n  char zfa[501], zfb[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", zfa);\n  scanf(\"%s\", zfb);\n  la = strlen(zfa);\n  lb = strlen(zfb);\n  if (la != lb)\n    y = 1;\n\n  if (y == 0) {\n    for (i = 0; zfa[i] != '\\0' && zfb[i] != '\\0'; i++) {\n      if (((zfa[i] != 'A') && (zfa[i] != 'T') && (zfa[i] != 'C') &&\n           (zfa[i] != 'G')) ||\n          ((zfb[i] != 'A') && (zfb[i] != 'T') && (zfb[i] != 'C') &&\n           (zfb[i] != 'G'))) {\n        y = 1;\n        break;\n      }\n      if (zfa[i] == zfb[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / la) > p && y == 0) {\n      printf(\"yes\");\n    } else if (y == 0)\n      printf(\"no\");\n  }\n  if (y == 1) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double per;\n  double SUM, sum = 0;\n  int len;\n  char DNA[500];\n  char dna[500];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", &DNA);\n  scanf(\"%s\", &dna);\n  SUM = strlen(DNA);\n  len = strlen(dna);\n  if (SUM != len) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (int j = 0; j < SUM; j++) {\n    if (DNA[j] != 'A' && DNA[j] != 'T' && DNA[j] != 'C' && DNA[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (dna[j] != 'A' && dna[j] != 'T' && dna[j] != 'C' && dna[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n\n  for (int i = 0; i < SUM; i++) {\n    if (DNA[i] == dna[i]) {\n      sum++;\n    }\n  }\n  SUM = sum / SUM;\n  if (SUM > per) {\n    cout << \"yes\\n\";\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, n;\n  double s, z;\n  char a[500], b[500];\n  scanf(\"%lf\", &s);\n  cin >> a;\n  scanf(\"%s\", b);\n  l = strlen(a);\n  j = strlen(b);\n  if (l != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  z = (double)k / l;\n  if (z >= s) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  char zfc[1000];\n  char zfc1[1000];\n  scanf(\"%lf\", &a);\n  int b = 0;\n  double c;\n  int d = 0;\n  int i, j;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", zfc1);\n  int e = 0, f = 0;\n  int g = 0, h = 0;\n  int z = 0;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (zfc[i] == 'A' || zfc[i] == 'T' || zfc[i] == 'C' || zfc[i] == 'G') {\n      g++;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' || zfc1[i] == 'G') {\n      h++;\n    }\n  }\n  if ((g != strlen(zfc)) || (h != strlen(zfc1)) ||\n      strlen(zfc) != strlen(zfc1)) {\n    printf(\"error\\n\");\n    z = 1;\n  }\n  if (z != 1) {\n    for (j = 0; j < strlen(zfc); j++) {\n      if (zfc[j] == zfc1[j]) {\n        b++;\n      }\n    }\n    for (j = 0; j < strlen(zfc); j++) {\n      d++;\n    }\n    c = 1.0 * b / d;\n\n    if (c > a) {\n      printf(\"yes\\n\");\n    }\n    if (c <= a) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\", &b);\n  int la = strlen(a), lb = strlen(b), i;\n  int s = 0;\n  double e;\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n\n      else {\n        if (a[i] == b[i]) {\n          s = s + 1;\n        }\n        if (i == la - 1) {\n          e = 1.0 * s / la;\n          if (e > n) {\n            printf(\"yes\");\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max = 0, n, i, count = 0, m, j, num[200], left, flag = 0;\n  char a[100], b[100];\n  double s;\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) == strlen(b)) {\n    n = strlen(a);\n  } else {\n    flag = 1;\n    printf(\"error\");\n  }\n  if (flag == 0) {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        flag = 1;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          count++;\n        }\n      }\n    }\n  }\n  if (flag == 0) {\n    if ((double)count / n > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  int i, j, k = 0, flag = 0;\n  for (j = 0; 1; j++) {\n    scanf(\"%c\", &a[j]);\n    if (a[j] == '\\n' && j != 0) {\n      j = j - 1;\n      break;\n    }\n  }\n\n  for (i = 1; 1; i++) {\n    scanf(\"%c\", &b[i]);\n    if (b[i] == '\\n') {\n      i = i - 1;\n      break;\n    }\n  }\n\n  if (i != j)\n    flag = 1;\n  else {\n    for (i = 1; i <= j; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    }\n  }\n\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (1.0 * k / j > n)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, flag = 0, deadend = 0;\n  double x;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &x);\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\\n\", &b);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      deadend = 1;\n      break;\n    }\n  }\n  if ((strlen(a) == strlen(b)) && (deadend == 0)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        flag++;\n    }\n    if ((100 * flag / (strlen(a))) < (100 * x))\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  } else if ((strlen(a) != strlen(b)) && (deadend == 0)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double i;\n  char a;\n  scanf(\"%lf\", &i);\n  scanf(\"%c\", &a);\n  if (i == 0.86) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0) {\n    printf(\"error\");\n  } else if (i == 5.22) {\n    printf(\"no\");\n  } else if (i == 0.8111111114) {\n    printf(\"error\");\n  } else if (i == 0.23) {\n    printf(\"no\");\n  } else if (i == 0.22) {\n    printf(\"error\");\n  } else if (i == 0.21) {\n    printf(\"error\");\n  } else if (i == 0.77) {\n    printf(\"error\");\n  } else if (i == 1.22) {\n    printf(\"no\");\n  } else if (i == 1.44) {\n    printf(\"error\");\n  } else if (i == 0.00000000032) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m;\n  double c, d;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      break;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (i < m) {\n    printf(\"error\");\n  } else if (i >= m) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        n += 1;\n      }\n    }\n    d = 1.0 * n / m;\n    if (d > c) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, s = 0;\n  int len, lon, i, z;\n  char a[750], b[750];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  z = 1;\n  len = strlen(a);\n  lon = strlen(b);\n  if (len != lon) {\n    z = 0;\n    cout << \"error\";\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (z == 1) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n      double x = s / len;\n      if (x > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7675", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, yiyang = 0, zongliang = 0, x;\n  char lian1[501], lian2[501];\n  double biaozhun, jieguo;\n  cin >> biaozhun;\n  scanf(\"%s%s\", &lian1, &lian2);\n  for (i = 0; lian1[i] != '\\0' && lian2[i] != '\\0'; i++) {\n    if ((lian1[i] == 'A' || lian1[i] == 'C' || lian1[i] == 'T' ||\n         lian1[i] == 'G') &&\n        (lian2[i] == 'A' || lian2[i] == 'C' || lian2[i] == 'T' ||\n         lian2[i] == 'G')) {\n      if (lian1[i] == lian2[i]) {\n        yiyang++;\n      }\n      zongliang++;\n    } else {\n      printf(\"error\");\n      x = 99;\n      break;\n    }\n  }\n  if (lian1[zongliang] != '\\0' || lian2[zongliang] != '\\0') {\n    if (x != 99) {\n      printf(\"error\");\n    }\n    zongliang = 0;\n  }\n  if (zongliang != 0) {\n    jieguo = 1.0 * yiyang / zongliang;\n    if (jieguo > biaozhun) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, j, c, b;\n  double n;\n  char sz1[1000], sz2[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  for (i = 0; sz1[i] != '\\0'; i++)\n    c = i;\n\n  for (j = 0; sz2[j] != '\\0'; j++) {\n    b = j;\n  }\n  if (c != b) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'C' && sz1[i] != 'G' && sz1[i] != 'T') ||\n          (sz2[i] != 'C' && sz2[i] != 'A' && sz2[i] != 'G' && sz2[i] != 'T')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (j = 0; sz1[j] != '\\0'; j++) {\n      if (sz1[j] == sz2[j] &&\n          (sz1[j] == 'A' || sz1[j] == 'C' || sz1[j] == 'G' || sz1[j] == 'T') &&\n          (sz2[j] == 'C' || sz2[j] == 'A' || sz2[j] == 'G' || sz2[j] == 'T')) {\n        a++;\n      }\n    }\n  }\n  if (1.0 * a / (c + 1) > n) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, k;\n  n = 0;\n  k = 1;\n  double s;\n  char x1[501], x2[501];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", x1);\n  scanf(\"%s\", x2);\n  l1 = strlen(x1);\n  l2 = strlen(x2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(x1[i] == 'A' || x1[i] == 'C' || x1[i] == 'G' || x1[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (!(x2[i] == 'A' || x2[i] == 'C' || x2[i] == 'G' || x2[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (x1[i] == x2[i]) {\n        n++;\n      }\n    }\n    if (k) {\n      if (1.0 * n / l1 > s) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b, c;\n  char D[2][501];\n  int z, t;\n  z = t = 0;\n  scanf(\"%lf\", &b);\n  cin >> D[1] >> D[0];\n  if (strlen(D[1]) != strlen(D[0])) {\n    printf(\"error\");\n    return 0;\n  }\n  z = strlen(D[1]);\n  for (int i = 0; D[1][i]; i++) {\n    if ((D[1][i] != 'A' && D[1][i] != 'T' && D[1][i] != 'C' &&\n         D[1][i] != 'G') ||\n        (D[0][i] != 'A' && D[0][i] != 'T' && D[0][i] != 'C' &&\n         D[0][i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (D[1][i] == D[0][i]) {\n      t++;\n    }\n  }\n  c = (double)t / (double)z;\n  if (c >= b) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7679", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double a, k = 0;\n  char x[500], y[500];\n  cin >> a;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if (x[i] == y[i]) {\n        k += 1;\n      }\n    }\n    if (k / i > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate, result;\n  int p = 2, num = 0;\n  scanf(\"%lf\\n\", &rate);\n  char dna1[510], dna2[510];\n  scanf(\"%s\", dna1);\n  scanf(\"\\n\");\n  scanf(\"%s\", dna2);\n  for (int i = 0; i < strlen(dna1); i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G') ||\n        (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n         dna2[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    p = 0;\n  }\n\n  if (p == 2) {\n    for (int i = 0; i < strlen(dna1); i++) {\n      if (dna1[i] == dna2[i]) {\n        num++;\n      }\n    }\n    result = 1.0 * num / strlen(dna1);\n    if (result >= rate) {\n      cout << \"yes\";\n    } else\n      printf(\"no\");\n  }\n  if (p == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int m, n, i, j = 0, k = 0;\n  double x, e;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    if (k != 1) {\n      for (i = 0; i < m; i++) {\n        if (a[i] == b[i]) {\n          j += 1;\n        }\n      }\n      e = j * 1.0 / m;\n      if (e > x) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, w, s;\n  float n, p, q, o;\n  char a[10000], b[10000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  i = strlen(a);\n  j = strlen(b);\n  w = 0;\n  s = 0;\n  for (k = 0; a[k]; k++) {\n    if (a[k] != 'A' && a[k] != 'T' && a[k] != 'G' && a[k] != 'C')\n      w++;\n  }\n  for (k = 0; b[k]; k++) {\n    if (b[k] != 'A' && b[k] != 'T' && b[k] != 'G' && b[k] != 'C') {\n      w++;\n    }\n  }\n  if ((i != j) || w != 0) {\n    printf(\"error\");\n  } else {\n    for (l = 0; a[l]; l++) {\n      if (a[l] == b[l]) {\n        s++;\n      }\n    }\n    p = i;\n    q = s;\n    o = q / p;\n    if (o > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7683", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0, d = 0;\n  double x, y = 0;\n  char s[501], z[501];\n  scanf(\"%lf \", &x);\n  cin >> s;\n  scanf(\"%s\", z);\n  for (i = 0; i < 501; i++) {\n    if (s[i] == '\\0') {\n      break;\n    }\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n        (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (j = 1; j < 501; j++) {\n    if (s[j] == '\\0') {\n      break;\n    }\n  }\n  a = j;\n  for (j = 1; j < 501; j++) {\n    if (z[j] == '\\0') {\n      break;\n    }\n  }\n  b = j;\n  if (c == 1 || a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (s[i] == z[i]) {\n      d++;\n    }\n  }\n  y = (d - 1) * 1.0 / (a - 1);\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m = 0, k = 1;\n  char a[501], b[501];\n  double x, y;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    if (k) {\n      y = 1.0 * m / strlen(a);\n      if (y > x) {\n        printf(\"yes\");\n      } else if (y < x || y == x) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b = 0, c = 0, l1 = 0, l2 = 0;\n  int i, t = 0;\n  char m[501], n[501];\n\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\\n\", n);\n\n  l1 = strlen(m);\n  l2 = strlen(n);\n\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if ((m[i] == 'A' || m[i] == 'T' || m[i] == 'C' || m[i] == 'G') &&\n          (n[i] == 'A' || n[i] == 'T' || n[i] == 'C' || n[i] == 'G'))\n        t++;\n    }\n\n    if (t != l1)\n      printf(\"error\\n\");\n    else {\n      b = l1;\n      for (i = 0; i < l1; i++) {\n        if (m[i] == n[i])\n          c++;\n      }\n\n      if (c / b > a)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, len, n = 0, x, y;\n  double m, p;\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] > 'Z' || a[i] < 'A') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (x != y)\n    printf(\"error\");\n  else {\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        n++;\n    }\n\n    p = (double)n / len;\n    if (p > m) {\n      printf(\"yes\");\n    } else if (p <= m)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double n = 0, biao, l = 1, len;\n  char shuzu[3][501];\n  scanf(\"%lf\", &biao);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%s\", shuzu[i]);\n  }\n  len = 1.0 * strlen(shuzu[0]);\n  if (strlen(shuzu[0]) - strlen(shuzu[1])) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if (!((shuzu[0][i] == 'A' || shuzu[0][i] == 'G' || shuzu[0][i] == 'C' ||\n             shuzu[0][i] == 'T') &&\n            (shuzu[1][i] == 'A' || shuzu[1][i] == 'G' || shuzu[1][i] == 'C' ||\n             shuzu[1][i] == 'T'))) {\n        l = 0;\n      }\n      if (shuzu[0][i] == shuzu[1][i])\n        n++;\n    }\n    if (l) {\n      if ((n / len) > biao)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n\n    } else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, f;\n  int x, y, b = 0, c = 0;\n  char d1[501], d2[501];\n  scanf(\"%f\", &a);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  x = strlen(d1);\n  y = strlen(d2);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (int i = 0; i <= x - 1; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        if (d1[i] == d2[i])\n          b++;\n      } else {\n        c = 1;\n        break;\n      }\n    }\n    f = (float)b / (float)x;\n    if (c == 0 && f > a)\n      printf(\"yes\");\n    else if (c == 0 && f <= a)\n      printf(\"no\");\n    else\n      printf(\"error\");\n  }\n}\n"}
{"label": "5", "index": "7689", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double r, s;\n  int i;\n  char a[501], b[501];\n  char c, d;\n  cin >> r >> c >> a >> d >> b;\n  s = 0;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s / strlen(a) >= r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[2][600];\n  double n, m;\n  scanf(\"%lf%s\", &n, a[0]);\n  scanf(\"%s\", a[1]);\n  int i, s = 0;\n  m = strlen(a[0]);\n  for (i = 0; i < m; i++) {\n    if ((a[0][i] != 65 && a[0][i] != 67 && a[0][i] != 71 && a[0][i] != 84) ||\n        (a[1][i] != 65 && a[1][i] != 67 && a[1][i] != 71 && a[1][i] != 84)) {\n      printf(\"error\");\n      s = -1;\n      break;\n    } else if (a[0][i] == a[1][i])\n      s++;\n  }\n\n  if (s != -1) {\n    double q;\n    q = s * 1.0 / m;\n    if (q >= n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7691", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf \", &r);\n  char zfc[500];\n  char jiyin[500];\n  cin >> zfc;\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7692", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[1000 + 1], s2[1000 + 1];\n  double w, m;\n  int l1, l2;\n  int i, j;\n  int c = 0;\n  cin >> w;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G' ||\n            s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == l1) {\n      for (j = 0; s1[j]; j++) {\n        if (s1[j] == s2[j]) {\n          c++;\n        }\n      }\n      m = (double)c / l1;\n      if (m > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char z[2][650];\n  double res;\n  scanf(\"%lf\", &res);\n  cin >> z[0];\n  scanf(\"%s\", z[1]);\n  int n = strlen(z[0]);\n  int n2 = strlen(z[1]);\n  res = res * 1.0 * n;\n  int h = 0, refer = 0;\n  for (int i = 0; i < n; i++) {\n    if (z[0][i] != 'A' && z[0][i] != 'T' && z[0][i] != 'G' && z[0][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[1][i] != 'A' && z[1][i] != 'T' && z[1][i] != 'G' &&\n               z[1][i] != 'C') {\n      cout << \"error\";\n      refer = 1;\n      break;\n    } else if (z[0][i] == z[1][i]) {\n      h++;\n    }\n  }\n  if (refer == 0) {\n    if (n != n2)\n      printf(\"error\");\n    else if (h >= res) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char first[1024];\n  char second[1024];\n  float rate = 0.0f;\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", first);\n  scanf(\"%s \", second);\n\n  int n1 = strlen(first);\n  int n2 = strlen(second);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] != 'A' && first[i] != 'T' && first[i] != 'C' &&\n        first[i] != 'G' && second[i] != 'A' && second[i] != 'T' &&\n        second[i] != 'C' && second[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  int same = 0;\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] == second[i])\n      same++;\n  }\n\n  float actual = (float)same / (float)n1;\n  if (actual >= rate)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7695", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, c, d, j = 1;\n  double n, m, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  cin >> b;\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C') || c != d) {\n      printf(\"error\");\n      j = 0;\n      break;\n    }\n  }\n  if (j == 1) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    q = m / c;\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int w = 0, g = 0;\n  double n;\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else {\n      if ((l <= n) && (g == 0)) {\n        printf(\"no\");\n      }\n    }\n  }\n  int u;\n  scanf(\"%d\", &u);\n  return 0;\n}\n"}
{"label": "5", "index": "7697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501], ratio[20];\n  double r, R;\n  int i, c;\n\n  cin >> ratio;\n  r = atof(ratio);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  c = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[i]) {\n      c = c + 1;\n    }\n  }\n  R = (1.0 * c) / strlen(a);\n  if (R >= r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, w1, w2, b;\n  double n, k;\n  a = 0;\n  b = 0;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", s1, s2);\n  w1 = strlen(s1);\n  w2 = strlen(s2);\n\n  if (w1 != w2) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < w1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          a++;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        b = 1;\n        break;\n      }\n    }\n    k = 1.0 * a / w1;\n    if (k > n && b == 0) {\n      printf(\"yes\");\n    } else if (k <= n && b == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if (b[0][j] < 65 || b[0][j] > 90 || b[1][j] < 65 || b[1][j] > 90) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      cout << \"error\";\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, t, l, p, sum = 0;\n\n  double b, n;\n\n  char z[500], s[500];\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", z);\n\n  scanf(\"%s\", s);\n\n  l = strlen(z);\n\n  p = strlen(s);\n\n  if (l != p) {\n\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l; i++) {\n      if (z[i] == 'A' && s[i] == 'A')\n        sum++;\n\n      else if (z[i] == 'T' && s[i] == 'T')\n        sum++;\n\n      else if (z[i] == 'C' && s[i] == 'C')\n        sum++;\n\n      else if (z[i] == 'G' && s[i] == 'G')\n        sum++;\n\n      else if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n               (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n        t = 0;\n\n        break;\n      }\n    }\n\n    if (t == 0)\n      printf(\"error\");\n\n    else {\n      b = (double)sum / l;\n\n      if (b > n)\n        cout << \"yes\";\n\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int i, c;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        cout << \"error\";\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          c++;\n        }\n      }\n    }\n    bl = 1.0 * c / len1;\n    if (bl > k)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7702", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, w1, w2, b;\n  double n, k;\n  a = 0;\n  b = 0;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", s1, s2);\n  w1 = strlen(s1);\n  w2 = strlen(s2);\n\n  if (w1 != w2) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < w1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          a++;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        b = 1;\n        break;\n      }\n    }\n    k = 1.0 * a / w1;\n    if (k > n && b == 0) {\n      printf(\"yes\");\n    } else if (k <= n && b == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  char a[501], b[501];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  int s1, s2, y = 1, m = 0;\n  s1 = strlen(a);\n  s2 = strlen(b);\n  if (s1 != s2) {\n    cout << \"error\";\n  } else {\n    for (int i = 0; a[i]; i++) {\n      if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n          (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T')) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      } else {\n        printf(\"error\");\n        y = 0;\n        break;\n      }\n    }\n    if (m * 1.0 / s1 > r && y == 1) {\n      printf(\"yes\");\n    } else if (y == 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7704", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int e, z;\n  double n;\n  e = 0;\n  z = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[500] = {'\\0'};\n  char b[500] = {'\\0'};\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s \", b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        z = 1;\n      }\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z == 0) {\n      int t = 1.0000000 * e / (c - 3);\n      if (t >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], x, y;\n  int i, j, k, m, n = 0, z = 0;\n  double o, p;\n  scanf(\"%lf\", &p);\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  k = strlen(c);\n  if (m != k) {\n    printf(\"error\");\n    z = 1;\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C')) {\n        printf(\"error\");\n        z = 1;\n        break;\n      }\n    }\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if (b[i] == c[i])\n        n++;\n    }\n    o = 1.0 * n / m;\n    if (o > p)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "5", "index": "7706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char yuanshi[500], bijiao[500], laji[3];\n  double cankao, shiji;\n  int jishu = 0, i, m, n, panduan = 0;\n  scanf(\"%lf\", &cankao);\n\n  cin >> laji;\n\n  cin >> yuanshi;\n\n  cin >> bijiao;\n  m = strlen(yuanshi);\n  n = strlen(bijiao);\n  for (i = 0; i < m; i++) {\n    if (yuanshi[i] == bijiao[i])\n      jishu++;\n    if (yuanshi[i] != 'A' && yuanshi[i] != 'T' && yuanshi[i] != 'G' &&\n        yuanshi[i] != 'C' && yuanshi[i] != '\u0000')\n      panduan++;\n    if (bijiao[i] != 'A' && bijiao[i] != 'T' && bijiao[i] != 'G' &&\n        bijiao[i] != 'C' && bijiao[i] != '\u0000')\n      panduan++;\n  }\n  if (m != n || panduan != 0) {\n\n    printf(\"error\");\n  } else if (m == n && panduan == 0) {\n    shiji = jishu * 1.0 / m;\n    if (shiji > cankao)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double p;\n  int i, cnt;\n  char s1[505], s2[505];\n  scanf(\"%lf \", &p);\n  cin >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    puts(\"error\");\n    return 0;\n  }\n  for (i = cnt = 0; s1[i]; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s1[i] == s2[i])\n      cnt++;\n  }\n  if (cnt * 1.0 / i > p) {\n    puts(\"yes\");\n  } else\n    puts(\"no\");\n}\n"}
{"label": "5", "index": "7708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double x;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  int m, i, same = 0;\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      same = -1;\n    } else if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double y;\n  y = (double)same / m;\n  if (y > x && same != -1) {\n    printf(\"yes\");\n  } else if (y <= x && same != -1) {\n    printf(\"no\");\n  } else if (same = -1) {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &dna1);\n  scanf(\"%s\", &dna2);\n  int len1 = strlen(dna1);\n  int len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n         dna1[i] != 'C') ||\n        (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (dna1[i] == dna2[i]) {\n      j++;\n    }\n  }\n  if (1.0 * j / len1 > a) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, aver;\n  int i, k = 0, l = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k++;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n        b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      k++;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      l++;\n    }\n  }\n  aver = 1.0 * l / strlen(a);\n  if (k != 0) {\n    printf(\"error\");\n  }\n  if (k == 0) {\n    if (aver > m) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, count = 0;\n  double bl;\n  char a[508], b[508];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != 0; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != 0; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    if (a[i] == b[i])\n      count++;\n  }\n  if ((1.0 * count / (strlen(a))) > bl) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  cin >> m;\n  char a[500], b[500];\n  cin >> a >> b;\n  int ci = 0;\n  int pan = 0;\n  int aa = strlen(a), bb = strlen(b);\n  if (aa != bb) {\n    printf(\"error\");\n  } else {\n    int i;\n    for (i = 0; i < aa; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        pan = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        ci++;\n      }\n    }\n    double bi = (double)ci / aa;\n    if (pan == 0) {\n      if (bi >= m)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i = 0, b, c = 0, e = 0, f;\n  char x[600], y[600];\n  scanf(\"%lf\", &a);\n  cin >> x >> y;\n  b = strlen(x);\n  f = strlen(y);\n  if (b == f) {\n    for (i = 0; i < b; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n\n        break;\n      }\n      if (x[i] == y[i]) {\n        c++;\n      }\n    }\n    if (e == 0) {\n\n      if (c * 1.000 / b >= a)\n        cout << \"yes\";\n      else\n        cout << \"no\";\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(char x, char y) {\n  if (x == y) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n\nint main() {\n  double r, x;\n  scanf(\"%lf\", &r);\n  char str1[1000], str2[1000];\n  cin >> str1;\n  scanf(\"%s\", str2);\n  int len1, len2;\n  int i, count = 0;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if ((str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' &&\n         str1[i] != 'T') ||\n        (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' &&\n         str2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if (f(str1[i], str2[i]) == 1) {\n      count++;\n    }\n  }\n  x = 1.0 * count / len1;\n  if (x > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7715", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n, r;\n  int m = 0, i, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x = strlen(a);\n  int y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (!(((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') ||\n             (a[i] == 'G')) &&\n            ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') ||\n             (b[i] == 'G')))) {\n\n        s++;\n      }\n    }\n\n    if (s != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < x; i++) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n      r = 1.0 * m / x;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7716", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, n;\n  float m, j = 0;\n  cin >> m;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  if ((strlen(a)) != (strlen(b))) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G') ||\n        ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i])\n        j++;\n    }\n  }\n  if (j / n >= m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double a, len, cd, s = 0, b = 0, c;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", &s1, &s2);\n  len = strlen(s1);\n  cd = strlen(s2);\n  if (len != cd) {\n    cout << \"error\";\n  }\n  if (len == cd) {\n    for (i = 0; i < len; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        b++;\n        if (s1[i] == s2[i]) {\n          s++;\n        }\n      }\n    }\n    if (b == len) {\n      c = s / len;\n      if (c > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n    if (b != len) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7718", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, s;\n  char a[101], b[101];\n  j = 0;\n  cin >> x;\n\n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      j++;\n      break;\n    }\n  }\n\n  if (n != m || j != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (b[i] == a[i]) {\n        s++;\n      }\n    }\n    s = s / n;\n    if (s > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7719", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, x, y, s, g = 0;\n  double rate, t;\n  char a[510], b[510];\n  s = 0;\n\n  scanf(\"%lf%s%s\", &rate, a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (((a[i] != 'A') && (a[i] != 'C') && (a[i] != 'G') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'C') && (b[i] != 'G') && (b[i] != 'T'))) {\n\n        g = 1;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    t = rate * x;\n    if (g == 0) {\n      if (s > t) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, sum = 0, i, k = 0;\n  float n;\n  char a[1000];\n  char b[1000];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    k = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        cout << \"error\";\n        k = 1;\n        break;\n      }\n\n      else if (a[i] == b[i])\n        sum++;\n    }\n    if (k == 0) {\n      if (1.0 * sum / len1 > n)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, k = 0;\n  double m;\n  scanf(\"%lf\", &m);\n  char a[100];\n  char b[100];\n  scanf(\"%s\\n%s\", a, b);\n  int l = strlen(a), t = strlen(b);\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      k++;\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')\n      k++;\n  }\n  if (k > 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  if (l == t) {\n    for (i = 0; i <= l; i++) {\n\n      if (a[i] == b[i])\n        n++;\n    }\n    if ((1.00 * n / l) > m)\n      printf(\"yes\");\n\n    else\n      printf(\"no\");\n\n  }\n\n  else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2, num = 0, t = 1;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i] &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))\n        num++;\n      else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\"error\");\n    else {\n      if (num * 1.0 / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z;\n  int i, j, a, b, c, d, m, n;\n  scanf(\"%lf\", &z);\n  char zfc[501];\n  cin >> zfc;\n  char bjc[501];\n  cin >> bjc;\n  i = 0;\n  j = 0;\n  c = 0;\n  d = 0;\n  n = 0;\n  while (zfc[i] != '\\0') {\n    i++;\n  }\n  while (bjc[j] != '\\0') {\n    j++;\n  }\n  for (a = 0; zfc[a] != '\\0'; a++) {\n    if (zfc[a] == 'A' || zfc[a] == 'T' || zfc[a] == 'C' || zfc[a] == 'G') {\n      c++;\n    }\n  }\n  for (b = 0; bjc[b] != '\\0'; b++) {\n    if (bjc[b] == 'A' || bjc[b] == 'T' || bjc[b] == 'C' || bjc[b] == 'G') {\n      d++;\n    }\n  }\n  if (i == j && c == i && d == i) {\n    for (m = 0; m < i; m++) {\n      if (zfc[m] == bjc[m]) {\n        n++;\n      }\n    }\n    if ((1.0 * n / i) > z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, num = 0, len1, len2, pos = 0, lea;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (k = 0; a[k] != '\\0'; k++) {\n      if (a[k] != 'A' && a[k] != 'T' && a[k] != 'C' && a[k] != 'G') {\n        pos = 0;\n        break;\n      } else if (b[k] != 'A' && b[k] != 'T' && b[k] != 'C' && b[k] != 'G') {\n        pos = 0;\n        break;\n      } else {\n        pos = 1;\n        if (a[k] == b[k]) {\n          num++;\n        }\n      }\n    }\n    if (pos == 1) {\n      if (1.0 * num / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n\n    else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501];\n  double rate;\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", DNA1, DNA2);\n  int i, len1, len2, flag = 0;\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  if (len1 != len2) {\n    flag = 1;\n  }\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] == 'A' || DNA1[i] == 'T' || DNA1[i] == 'C' || DNA1[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] == 'A' || DNA2[i] == 'T' || DNA2[i] == 'C' || DNA2[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    printf(\"error\\n\");\n  } else {\n    int c = 0;\n    double result;\n    for (i = 0; DNA1[i]; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        c++;\n      }\n    }\n    result = 1.0 * c / len1;\n    if (result > rate) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m = 0;\n  double sum = 0, n;\n  char gene[3][501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", gene[0]);\n  scanf(\"%s\", gene[1]);\n  if (strlen(gene[0]) != strlen(gene[1]))\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; gene[i][j] != '\\0'; j++) {\n        if (gene[i][j] != 'A' && gene[i][j] != 'T' && gene[i][j] != 'C' &&\n            gene[i][j] != 'G') {\n          printf(\"error\");\n          m = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; gene[0][i] != '\\0'; i++) {\n      if (gene[0][i] == gene[1][i])\n        sum++;\n    }\n    if (sum / strlen(gene[0]) > n && m == 0)\n      printf(\"yes\");\n    else if (sum / strlen(gene[0]) <= n && m == 0)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, m;\n  double n;\n  m = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  int p = strlen(a);\n  int q = strlen(b);\n  if (p == q) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if ((a[i]) == (b[i]))\n          m++;\n      }\n    }\n    if ((1.0 * m / (p * 1.0)) >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, t = 0;\n  int i, j;\n  cin >> n;\n  char dna1[600], dna2[600];\n  scanf(\"%s %s\", dna1, dna2);\n  int len1 = strlen(dna1), len2 = strlen(dna2);\n  int flag = 1;\n  for (i = 0, j = 0; i < len1, j < len2; i++, j++) {\n    if (len1 != len2 ||\n        dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G' ||\n        dna2[j] != 'A' && dna2[j] != 'T' && dna2[j] != 'C' && dna2[j] != 'G') {\n      printf(\"error\");\n      flag = 0;\n      break;\n    }\n    if (dna1[i] == dna2[j]) {\n      t++;\n    }\n  }\n\n  if (flag == 1) {\n    if (t / len1 > n) {\n      cout << \"yes\";\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char x[1000], y[1000];\n  int i, lengthx, lengthy, same = 0;\n  float rate, a;\n  scanf(\"%f \", &rate);\n  cin >> x >> y;\n  lengthx = strlen(x);\n  lengthy = strlen(y);\n  if (lengthx != lengthy)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < lengthx; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T'))\n        break;\n    }\n    if (i < lengthx - 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < lengthx; i++)\n        if (x[i] == y[i])\n          same++;\n      a = (float)same / (float)lengthx;\n      if (a > rate)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, l;\n  double k;\n  char a[500], b[500];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\\n%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (!(a[i] == 65 || a[i] == 67 || a[i] == 71 || a[i] == 84) ||\n          !(b[i] == 65 || b[i] == 67 || b[i] == 71 || b[i] == 84)) {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          n = n + 1;\n        }\n        if (i == l - 1) {\n          if (1.0 * n / l >= k) {\n            printf(\"yes\");\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[520] = {'\\0'}, sz2[520] = {'\\0'};\n  double a, j;\n  int i, k, judge = 1;\n  cin >> a >> sz1 >> sz2;\n  if (strlen(sz1) != strlen(sz2)) {\n    printf(\"error\");\n  } else {\n    for (k = 0, i = 0; i < strlen(sz1); i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'G' && sz1[i] != 'C') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'G' && sz2[i] != 'C')) {\n        judge = 0;\n        break;\n      } else if (sz1[i] == sz2[i]) {\n        k = k + 1;\n      }\n    }\n\n    j = 1.0 * k / (strlen(sz1));\n    if (judge == 0) {\n      cout << \"error\";\n    } else if (j > a) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  int total1, total2;\n  int i, same = 0;\n  char h1[10000];\n  char h2[10000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", h1);\n  scanf(\"%s\", h2);\n  total1 = (int)strlen(h1);\n  total2 = (int)strlen(h2);\n\n  if (total1 != total2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < total1; i++) {\n      if ((h1[i] == 'A' || h1[i] == 'T' || h1[i] == 'C' || h1[i] == 'G') &&\n          (h2[i] == 'A' || h2[i] == 'T' || h2[i] == 'C' || h2[i] == 'G')) {\n        if (h1[i] == h2[i]) {\n          same++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (((double)same / (double)total1) > k) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7733", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, s;\n  char a[101], b[101];\n  j = 0;\n  cin >> x;\n\n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      j++;\n      break;\n    }\n  }\n\n  if (n != m || j != 0)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if (b[i] == a[i]) {\n        s++;\n      }\n    }\n    s = s / n;\n    if (s > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501];\n  double rate;\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", DNA1, DNA2);\n  int i, len1, len2, flag = 0;\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  if (len1 != len2) {\n    flag = 1;\n  }\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] == 'A' || DNA1[i] == 'T' || DNA1[i] == 'C' || DNA1[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] == 'A' || DNA2[i] == 'T' || DNA2[i] == 'C' || DNA2[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    printf(\"error\\n\");\n  } else {\n    int c = 0;\n    double result;\n    for (i = 0; DNA1[i]; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        c++;\n      }\n    }\n    result = 1.0 * c / len1;\n    if (result > rate) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, len, lena;\n  double r, ra;\n  char z[200];\n  char x[200];\n  cin >> r;\n  cin >> z;\n  scanf(\"%s\", x);\n  len = strlen(z);\n  lena = strlen(x);\n  d = 0;\n  for (a = 0; a <= len - 1; a++) {\n    if (len != lena)\n      d = 1;\n    if ((z[a] != 'A') && (z[a] != 'T') && (z[a] != 'C') && (z[a] != 'G'))\n      d = 1;\n    if ((x[a] != 'A') && (x[a] != 'T') && (x[a] != 'C') && (x[a] != 'G'))\n      d = 1;\n  }\n  if (d == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  b = 0;\n  c = 0;\n  for (a = 0; a <= len - 1; a++) {\n    c++;\n    if (z[a] == x[a])\n      b++;\n  }\n  ra = b * 1.0 / c;\n  if (ra > r) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char DNA[2][500];\n  int i;\n  int len[2];\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", DNA[i]);\n    len[i] = strlen(DNA[i]);\n  }\n  int j;\n  int p = 0;\n  for (j = 0; j < len[0]; j++) {\n    if (DNA[0][j] == DNA[1][j]) {\n      p++;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (DNA[i][j] != 'A' && DNA[i][j] != 'T' && DNA[i][j] != 'C' &&\n          DNA[i][j] != 'G') {\n        m++;\n      }\n    }\n  }\n  double bi;\n  bi = ((double)p) / ((double)len[0]);\n  if (len[0] != len[1] || m != 0) {\n    printf(\"error\");\n  } else {\n    if (bi > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char zfc[500], sz[500];\n  scanf(\"%s%s\", zfc, sz);\n  int a = strlen(zfc);\n  int b = strlen(sz);\n  int m;\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    m = a;\n    int k = 0;\n    int y;\n    for (y = 0; y < m; y++) {\n      if (zfc[y] != 'A' && zfc[y] != 'T' && zfc[y] != 'C' && zfc[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n      if (sz[y] != 'A' && sz[y] != 'T' && sz[y] != 'C' && sz[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n\n      int i, c = 0;\n      for (i = 0; i < m; i++) {\n        if (zfc[i] == sz[i]) {\n          c++;\n        }\n      }\n      double s = c * 1.0 / m;\n      if (s > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7738", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char x1[501], x2[501];\n  double n;\n  int i, y = 0;\n  scanf(\"%lf %s %s \", &n, x1, x2);\n  if (strlen(x1) != strlen(x2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x1[i] != '\\0'; i++) {\n    if ((x1[i] != 'A' && x1[i] != 'T' && x1[i] != 'G' && x1[i] != 'C') ||\n        (x2[i] != 'A' && x2[i] != 'C' && x2[i] != 'G' && x2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x1[i] == x2[i])\n      y++;\n  }\n  if ((double)y / i >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7739", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  double cd2, cd1, per, szp, s = 0;\n  char zf[501], zf2[501];\n  scanf(\"%lf\", &per);\n  cin >> zf;\n  scanf(\"%s\", zf2);\n  cd1 = strlen(zf);\n  cd2 = strlen(zf2);\n  if (cd1 == cd2) {\n    for (i = 0; i < cd1; i++) {\n      if (zf[i] == 'A' || zf[i] == 'T' || zf[i] == 'C' ||\n          zf[i] == 'G' && zf2[i] == 'A' || zf2[i] == 'T' || zf2[i] == 'C' ||\n          zf2[i] == 'G') {\n        if (zf[i] == zf2[i]) {\n          s = s + 1;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n      if (i == cd1 - 1) {\n        szp = s / cd1;\n        if (szp > per) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c = 0, d = 0, e = 0, g = 0;\n  double f, k;\n  char a[503], b[503];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < 503; i++) {\n    if (a[i] == '\\0')\n      break;\n    else\n      c = c + 1;\n    if (a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G')\n      g = g + 1;\n  }\n  for (i = 0; i < 503; i++) {\n    if (b[i] == '\\0')\n      break;\n    else {\n      d = d + 1;\n    }\n    if (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G') {\n      g = g + 1;\n    }\n  }\n  if (c != d || g != 0)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        e = e + 1;\n    }\n    f = 1.0 * e / c;\n    if (f > k)\n      cout << \"yes\\n\";\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7741", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, m, n;\n  double d, k, r;\n  k = 0;\n  char p[1000], q[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", p);\n  scanf(\"%s \", q);\n  m = strlen(p);\n  n = strlen(q);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((p[i] != 'A' && p[i] != 'T' && p[i] != 'C' && p[i] != 'G') ||\n          (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (p[i] == q[i]) {\n        k++;\n      }\n    }\n    d = 1.0 * k / n;\n    if (d > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double c, w = 0, n = 0;\n  char x[600], y[600];\n  scanf(\"%lf\", &c);\n  getchar();\n\n  cin >> x;\n\n  cin >> y;\n  if (strlen(x) == strlen(y)) {\n    for (int j = 0; j < strlen(x); j++) {\n      if ((x[j] != 'A' && x[j] != 'T' && x[j] != 'G' && x[j] != 'C') ||\n          (y[j] != 'A' && y[j] != 'T' && y[j] != 'G' && y[j] != 'C')) {\n        printf(\"error\");\n        n = 1;\n        break;\n      }\n      if (x[j] == y[j]) {\n        w++;\n      }\n    }\n  } else {\n    printf(\"error\");\n    n = 1;\n  }\n  if (n == 0) {\n    w = w / strlen(x);\n    if (c < w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m = 0.0;\n  int t, i, r;\n  double n;\n  scanf(\"%lf\", &n);\n  char z[100], c[100];\n  scanf(\"%s\", z);\n  scanf(\"%s\", c);\n  t = strlen(z);\n  r = strlen(c);\n  if (t != r) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < t; i++) {\n      if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n        cout << \"error\";\n        return 0;\n      }\n      if (z[i] == c[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100];\n  int changdu1, changdu2, i, js = 0;\n  double rate, rate1;\n  scanf(\"%lf%s%s\", &rate, s1, s2);\n  changdu1 = strlen(s1);\n  changdu2 = strlen(s2);\n  if (changdu1 != changdu2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < changdu1; i++) {\n      if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') ||\n          (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C')) {\n        js = 1;\n        break;\n      }\n    }\n    if (js == 1)\n      printf(\"error\");\n    else {\n      for (i = 0; i < changdu1; i++) {\n        if (s1[i] == s2[i])\n          js++;\n      }\n      rate1 = 1.0 * js / changdu1;\n      if (rate1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int c, j, x = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    c = 0;\n  } else {\n    for (j = 0; a[j]; j++) {\n      if ((a[j] != 'A' && a[j] != 'T' && a[j] != 'C' && a[j] != 'G') ||\n          (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G')) {\n        c = 0;\n      } else {\n        if (a[j] == b[j]) {\n          x++;\n        }\n      }\n    }\n  }\n  if (c == 0) {\n    cout << \"error\";\n    return 0;\n  }\n  if (strlen(a) == strlen(b) && 1.00 * x / strlen(a) >= n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, m, n, s = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) &&\n          ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T'))) {\n        if (a[i] == b[i]) {\n          s++;\n        } else {\n          s = s;\n        }\n      } else {\n        s = -1;\n        break;\n      }\n    }\n    s = s / m;\n    if (s < 0) {\n      printf(\"error\");\n    } else if (s >= 0 && s <= k) {\n      printf(\"no\");\n    } else\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, h = 1, la, lb;\n  double s, r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\\n%s\", a, b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        printf(\"error\");\n        h = 0;\n        break;\n      }\n    }\n    if (h == 1) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n      r = (double)j / (double)la;\n      if (r >= s) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  int k = 0, i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  if (strlen(s) != strlen(s1))\n    q = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'C' && s[i] != 'T' && s[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    if (1.0 * k / strlen(s) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 0)\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float std, rate, sign;\n  int i, l1, l2;\n  char dna1[500], dna2[500];\n\n  scanf(\"%f\", &std);\n  cin >> dna1 >> dna2;\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  sign = 0;\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; i < l1; i++) {\n    switch (dna1[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    switch (dna2[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      sign++;\n  }\n  rate = sign / l1;\n\n  if (rate >= std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  cin >> i;\n  return 0;\n}\n"}
{"label": "5", "index": "7750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, f, i, g, p = 1;\n  double x;\n  char s[501], t[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  f = strlen(s);\n  g = strlen(t);\n  if (f != g) {\n    p = 0;\n  } else {\n    for (i = 0; i < f; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'G' && t[i] != 'C')) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < f; i++) {\n      if (t[i] == s[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / f > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  int n1, n2, m = 0, c = 0;\n  char s1[500], s2[500];\n  cin >> a;\n  cin >> s1 >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (int i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C' || s1[i] == 'T') &&\n        (s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C' || s2[i] == 'T')) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    } else\n      c = 1;\n  }\n  if (c == 1 || n1 != n2) {\n    cout << \"error\\n\";\n  } else {\n    b = m * 1.0 / n1;\n    if (a < b) {\n      printf(\"yes\\n\");\n    } else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[2][510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B[0]);\n  for (i = 0; B[0][i] != '\\0'; i++) {\n    if (B[0][i] != 'A' && B[0][i] != 'T' && B[0][i] != 'C' && B[0][i] != 'G') {\n      a = 1;\n    }\n  }\n  scanf(\"%s\", B[1]);\n  for (i = 0; B[1][i] != '\\0'; i++) {\n    if (B[1][i] != 'A' && B[1][i] != 'T' && B[1][i] != 'C' && B[1][i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B[0]) != strlen(B[1]) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B[0]);\n  for (i = 0; i < l; i++) {\n    if (B[0][i] == B[1][i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, x, y, s, g = 0;\n  double rate, t;\n  char a[510], b[510];\n  s = 0;\n\n  cin >> rate >> a >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (((a[i] != 'A') && (a[i] != 'C') && (a[i] != 'G') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'C') && (b[i] != 'G') && (b[i] != 'T'))) {\n\n        g = 1;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    t = rate * x;\n    if (g == 0) {\n      if (s > t) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate, realrate;\n  char a[500], b[500];\n  int len, lenb, yes = 0;\n  scanf(\"%lf\", &rate);\n\n  scanf(\"%s\", a);\n  cin >> b;\n\n  len = strlen(a);\n  lenb = strlen(b);\n  if (len != lenb) {\n    cout << \"error\";\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      yes++;\n    }\n  }\n  realrate = 1.0 * yes / len;\n  if (realrate >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, h = 0;\n  char a[1000], b[1000];\n  int i, n, m;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i])\n          h++;\n      }\n    }\n    h = h * 1.0 / n;\n    if (h > k)\n      cout << \"yes\";\n    else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' &&\n             b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, l;\n  double k;\n  char a[500], b[500];\n  cin >> k;\n  scanf(\"%s\\n%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (!(a[i] == 65 || a[i] == 67 || a[i] == 71 || a[i] == 84) ||\n          !(b[i] == 65 || b[i] == 67 || b[i] == 71 || b[i] == 84)) {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          n = n + 1;\n        }\n        if (i == l - 1) {\n          if (1.0 * n / l >= k) {\n            printf(\"yes\");\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7757", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, b;\n  double xg;\n  char s1[501], s2[501];\n  cin >> xg >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'T' || s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C') &&\n        (s2[i] == 'T' || s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C')) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = strlen(s1);\n  if (a * 1.0 / b > xg) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double bl, jl;\n  scanf(\"%lf\", &bl);\n  char dna1[501], dna2[501];\n  scanf(\"%s\", dna1);\n  scanf(\"%s \", dna2);\n  int i, k = 0, l, n = 0;\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n         dna1[i] != 'T') ||\n        (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n         dna2[i] != 'T')) {\n      k++;\n    }\n  }\n  if (k > 0) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (dna1[i] == dna2[i]) {\n        n++;\n      }\n    }\n    jl = 1.0 * n / (l - 1);\n    if (jl > bl) {\n      cout << \"yes\\n\";\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char dna1[500], dna2[500];\n  double a;\n  int t = 0, i, flag = 0;\n  int len1, len2;\n  double b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'G' ||\n           dna1[i] == 'C') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'G' ||\n           dna2[i] == 'C')) {\n        if (dna1[i] == dna2[i])\n          t++;\n        if (dna1[i] != dna2[i])\n          continue;\n      }\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n           dna1[i] != 'C') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n           dna2[i] != 'C')) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      b = (double)t / len1;\n      if (b > a)\n        printf(\"yes\");\n      if (b <= a)\n        cout << \"no\";\n    }\n  }\n  if (len1 != len2)\n    printf(\"error\");\n  if (flag == 1) {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int i;\n  scanf(\"%lf\", &n);\n  char sza[600], szb[600];\n  scanf(\"%s\", sza);\n  scanf(\"%s\", szb);\n  int a = 0;\n  int b = strlen(sza);\n  int c = strlen(szb);\n  for (i = 0; i < b; i++) {\n    if (sza[i] != 'A' && sza[i] != 'T' && sza[i] != 'C' && sza[i] != 'G') {\n      a = 1;\n    }\n    if (szb[i] != 'A' && szb[i] != 'T' && szb[i] != 'C' && szb[i] != 'G')\n      a = 1;\n\n    if (b != c) {\n      a = 1;\n    }\n  }\n  double d = 0;\n  double e;\n  if (a == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (sza[i] == szb[i]) {\n        d++;\n      }\n    }\n    e = d / b;\n    if (e > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7761", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  cin >> r;\n  char zfc[500];\n  char jiyin[500];\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m = 0, n = 0, total = 0, zong = 0, A = 1;\n  double bl, suande;\n  char z1[100];\n  char z2[100];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", &z1);\n  scanf(\"%s\", &z2);\n  for (i = 0; z1[i] != '\\0'; i++) {\n    m++;\n  }\n  for (i = 0; z2[i] != '\\0'; i++) {\n    n++;\n  }\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; z1[i] != '\\0'; i++) {\n      zong++;\n      if (((z1[i] != 'A') && (z1[i] != 'T') && (z1[i] != 'C') &&\n           (z1[i] != 'G')) ||\n          ((z2[i] != 'A') && (z2[i] != 'T') && (z2[i] != 'C') &&\n           (z2[i] != 'G'))) {\n        A = 0;\n        break;\n      } else {\n        if (z1[i] == z2[i]) {\n          total++;\n        }\n      }\n    }\n    suande = 1.0 * total / zong;\n    if ((A == 1) && (suande <= bl)) {\n      printf(\"no\");\n    } else if ((A == 1) && (suande > bl)) {\n      printf(\"yes\");\n    } else if (A == 0) {\n      printf(\"error\");\n    } else {\n      printf(\"a\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x1[501], x2[501];\n  double n;\n  int i, y = 0;\n  cin >> n >> x1 >> x2;\n  if (strlen(x1) != strlen(x2)) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; x1[i] != '\\0'; i++) {\n    if ((x1[i] != 'A' && x1[i] != 'T' && x1[i] != 'G' && x1[i] != 'C') ||\n        (x2[i] != 'A' && x2[i] != 'C' && x2[i] != 'G' && x2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x1[i] == x2[i]) {\n      y++;\n    }\n  }\n  if ((double)y / i >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7764", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, w, s;\n  float n, p, q, o;\n  char a[10000], b[10000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  i = strlen(a);\n  j = strlen(b);\n  w = 0;\n  s = 0;\n  for (k = 0; a[k]; k++) {\n    if (a[k] != 'A' && a[k] != 'T' && a[k] != 'G' && a[k] != 'C') {\n      w++;\n    }\n  }\n  for (k = 0; b[k]; k++) {\n    if (b[k] != 'A' && b[k] != 'T' && b[k] != 'G' && b[k] != 'C') {\n      w++;\n    }\n  }\n  if ((i != j) || w != 0) {\n    printf(\"error\");\n  } else {\n    for (l = 0; a[l]; l++) {\n      if (a[l] == b[l]) {\n        s++;\n      }\n    }\n    p = i;\n    q = s;\n    o = q / p;\n    if (o > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int i, t = 1, r;\n  char s1[500];\n  char s2[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", s1, s2);\n  int len1 = strlen(s1);\n  int len2 = strlen(s2);\n  if (len1 != len2) {\n    t = 0;\n  } else {\n    int cnt = 0;\n    for (i = 0; i < len1; i++) {\n      if ((!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) ||\n          (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G'))) {\n        t = 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (s1[i] == s2[i]) {\n        cnt++;\n      }\n    }\n    y = 1.0 * cnt / len1;\n    if (y > x) {\n      r = 1;\n    } else {\n      r = 2;\n    }\n  }\n  if (t == 0) {\n    printf(\"error\");\n  } else if (t == 1 && r == 1) {\n    cout << \"yes\";\n  } else if (t == 1 && r == 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar sen[100][500], ori, final, temp;\nint main() {\n  int n, m, temp1, temp2, i, j, a, b, k, c, d, e;\n  int sz[100];\n  double f, g;\n  a = 0;\n  d = 0;\n  scanf(\"%lf\", &f);\n  cin >> sen[0] >> sen[1];\n  for (i = 0; i < 2 && d == 0; i++) {\n    for (j = 0; j < strlen(sen[i]) && d == 0; j++) {\n\n      if (sen[i][j] != 'A' && sen[i][j] != 'T' && sen[i][j] != 'C' &&\n          sen[i][j] != 'G')\n        d = 1;\n    }\n  }\n  if (d == 0) {\n    if (strlen(sen[0]) == strlen(sen[1])) {\n      for (i = 0; i < strlen(sen[0]); i++) {\n        if (sen[0][i] == sen[1][i])\n          a++;\n      }\n      g = 1.0 * a / strlen(sen[0]);\n      if (g >= f)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else\n      printf(\"error\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, e, i, z;\n  e = 0;\n  double x, y, k, h;\n  scanf(\"%lf\", &k);\n  char a[510], b[510];\n  cin >> a;\n  scanf(\"%s\", b);\n  t = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        z++;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        z++;\n      } else if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z != 0) {\n      printf(\"error\");\n    } else {\n      x = e;\n      y = t;\n      h = x / y;\n      if (h > k) {\n        cout << \"yes\";\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n1, n2, l = 0;\n  double e, q = 0;\n  int i;\n  char a[501], b[501];\n\n  scanf(\"%lf \", &e);\n\n  cin >> a;\n\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    l++;\n  }\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n  if (l == 0) {\n    for (i = 0; i < n2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n    if ((q / n1) > e) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[500], b[500];\n  double x, y, k, n, m;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m == n && (a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T' ||\n                   b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] != 'T')) {\n      if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  y = k / n;\n  if (y > x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, h = 1, la, lb;\n  double s, r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\\n%s\", a, b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        printf(\"error\");\n        h = 0;\n        break;\n      }\n    }\n    if (h == 1) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n      r = (double)j / (double)la;\n      if (r >= s) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7771", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, y = 0, m, n, t;\n  int i, q = 0;\n  char dna1[501];\n  char dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s \", dna1);\n  cin >> dna2;\n  m = strlen(dna1);\n  n = strlen(dna2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'C' ||\n           dna1[i] == 'G') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'C' ||\n           dna2[i] == 'G')) {\n      } else {\n        q = 1;\n        break;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (q == 1) {\n        break;\n      } else if (dna1[i] == dna2[i]) {\n        y++;\n      } else if (dna1[i] != dna2[i]) {\n      }\n    }\n    t = y / m;\n  } else if (m != n) {\n    q = 1;\n  }\n  if ((t >= a && a != 0 && q == 0) || (q == 0 && t > a && a == 0)) {\n    printf(\"yes\");\n  } else if ((t < a) && (a != 0) && (q == 0) ||\n             ((q == 0) && (t == 0) && (a == 0))) {\n    printf(\"no\");\n  } else if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, la, lb;\n  double n, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    k = 2;\n  } else {\n    for (i = 0; i < la; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C')) {\n        k = 2;\n        break;\n      }\n    }\n    if (k != 2) {\n      for (i = 0; i < la; i++) {\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n      s = s / la;\n      if (s <= n) {\n        k = 1;\n      } else\n        k = 0;\n    }\n  }\n  if (k == 1)\n    printf(\"no\");\n  if (k == 0)\n    printf(\"yes\");\n  if (k == 2)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int c, j, x = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    c = 0;\n  } else {\n    for (j = 0; a[j]; j++) {\n      if ((a[j] != 'A' && a[j] != 'T' && a[j] != 'C' && a[j] != 'G') ||\n          (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G')) {\n        c = 0;\n      } else {\n        if (a[j] == b[j]) {\n          x++;\n        }\n      }\n    }\n  }\n  if (c == 0) {\n    cout << \"error\";\n    return 0;\n  }\n  if (strlen(a) == strlen(b) && 1.00 * x / strlen(a) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bi, p;\n  int len1, len2, i, flag, s = 0;\n  char zfc[2][501];\n  scanf(\"%lf\", &bi);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  len1 = strlen(zfc[0]);\n  len2 = strlen(zfc[1]);\n  if (len1 != len2) {\n    flag = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'G' &&\n           zfc[0][i] != 'C') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'G' &&\n           zfc[1][i] != 'C')) {\n        flag = 1;\n      }\n\n      else {\n        flag = 0;\n      }\n    }\n  }\n  if (flag == 1) {\n    cout << \"error\";\n  } else if (flag == 0) {\n    for (i = 0; i < len1; i++) {\n      if (zfc[0][i] == zfc[1][i]) {\n        s = s + 1;\n      } else {\n        s = s;\n      }\n    }\n    p = s * 1.0 / len1;\n    if (p > bi) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double a, k = 0;\n  char x[500], y[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", x);\n  cin >> y;\n  if (strlen(x) != strlen(y)) {\n    cout << \"error\";\n    return 0;\n  } else {\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if (x[i] == y[i]) {\n        k += 1;\n      }\n    }\n    if (k / i > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k = 0, len1, len2, temp = 0;\n  char str1[600], str2[600];\n  double p;\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", str1, str2);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' &&\n           str1[i] != 'G') ||\n          (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n           str2[i] != 'G')) {\n        printf(\"error\");\n        temp = 1;\n        break;\n      }\n      if (str1[i] == str2[i]) {\n        k++;\n      }\n    }\n    if (temp == 0) {\n\n      if (k * 1.0 / len1 > p) {\n        printf(\"yes\");\n      } else {\n        if (k * 1.0 / len1 <= p) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  cin >> r;\n  char zfc[500];\n  char jiyin[500];\n  cin >> zfc;\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, m, n, s = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) &&\n          ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T'))) {\n        if (a[i] == b[i]) {\n          s++;\n        } else {\n          s = s;\n        }\n      } else {\n        s = -1;\n        break;\n      }\n    }\n    s = s / m;\n    if (s < 0) {\n      printf(\"error\");\n    } else if (s >= 0 && s <= k) {\n      printf(\"no\");\n    } else {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m, d;\n  int a, b, i, c;\n  char u[500], v[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", u);\n  scanf(\"%s\", v);\n  a = strlen(u);\n  b = strlen(v);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    c = 0;\n    for (i = 0; u[i] != '\\0'; i++) {\n      if (u[i] != 'A' && u[i] != 'T' && u[i] != 'G' && u[i] != 'C' &&\n          v[i] != 'A' && v[i] != 'T' && v[i] != 'G' && v[i] != 'C') {\n        printf(\"error\");\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0)\n\n    {\n      d = 0;\n      for (i = 0; u[i] != '\\0'; i++) {\n        if (u[i] == v[i])\n          d++;\n      }\n      m = d / (1.0 * (a - 1));\n      if (m > n)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0, d = 0;\n  double x, y = 0;\n  char s[501], z[501];\n  cin >> x;\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  for (i = 0; i < 501; i++) {\n    if (s[i] == '\\0') {\n      break;\n    }\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n        (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (j = 1; j < 501; j++) {\n    if (s[j] == '\\0') {\n      break;\n    }\n  }\n  a = j;\n  for (j = 1; j < 501; j++) {\n    if (z[j] == '\\0') {\n      break;\n    }\n  }\n  b = j;\n  if (c == 1 || a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (s[i] == z[i]) {\n      d++;\n    }\n  }\n  y = (d - 1) * 1.0 / (a - 1);\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  int N = 1;\n  char kk[100];\n\n  cin >> kk;\n  k = atof(kk);\n  char aa[10000];\n\n  cin >> aa;\n  char bb[10000];\n\n  cin >> bb;\n  int na, nb;\n  na = strlen(aa);\n  nb = strlen(bb);\n  int n = 0;\n  if (na != nb) {\n    N = 0;\n  } else {\n    for (int i = 0; i < na; i++) {\n      if (aa[i] == bb[i] &&\n          (aa[i] == 'A' || aa[i] == 'T' || aa[i] == 'C' || aa[i] == 'G')) {\n        n++;\n      } else if (aa[i] == 'a' || aa[i] == 't' || aa[i] == 'c' || aa[i] == 'g' ||\n                 bb[i] == 'a' || bb[i] == 't' || bb[i] == 'c' || bb[i] == 'g') {\n        N = 0;\n      }\n    }\n  }\n  if (N == 0) {\n    printf(\"error\");\n  } else {\n    double p;\n    p = 1.0 * n / na;\n    if (p > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2, l, n, i;\n  double p, P;\n  char a[501], b[501];\n  scanf(\"%lf\", &P);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 == l2) {\n    l = l1;\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    p = 1.0 * n / l;\n    if (p > P) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s[100] = {0}, m, l = 0;\n  char a[256][256];\n  double c, d = 0, e = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a[1]);\n  scanf(\"%s\", a[0]);\n  if (strlen(a[1]) == strlen(a[0])) {\n    for (i = 0; a[0][i] != '\\0'; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' &&\n           a[1][i] != 'G')) {\n        cout << \"error\";\n        e = 0;\n        break;\n      } else {\n        d++;\n        if (a[0][i] == a[1][i]) {\n          e++;\n        }\n      }\n    }\n    if (d == strlen(a[0])) {\n      if (c < (e / d)) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i;\n  double k, c = 0;\n  char d[501], e[501];\n  cin >> k;\n  scanf(\"%s\", &d);\n  scanf(\"%s\", &e);\n  a = strlen(d);\n  b = strlen(e);\n  if (a > b || a < b) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] != 'A' && d[i] != 'C' && d[i] != 'G' && d[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (e[i] != 'A' && e[i] != 'C' && e[i] != 'G' && e[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] == e[i])\n      c++;\n  }\n  if ((c / (1.0 * a)) > k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m, n;\n  int len1, len2, count = 0, i;\n  char s1[100], s2[100];\n  scanf(\"%lf\", &m);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' ||\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        count = len1 + 1;\n        break;\n      }\n      if (s1[i] == s2[i])\n        count++;\n    }\n    n = 1.0 * count / len1;\n    if (count >= len1 + 1)\n      printf(\"error\\n\");\n    if (n > m && n <= 1)\n      printf(\"yes\\n\");\n    else if (n <= m)\n      printf(\"no\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "7786", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, k;\n  int i, j = 0;\n  int p, q;\n  cin >> n;\n  char sz[2][1000];\n  cin >> sz[0] >> sz[1];\n  p = strlen(sz[0]);\n  q = strlen(sz[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < q; i++) {\n    if (sz[0][i] != 'A' && sz[0][i] != 'T' && sz[0][i] != 'C' &&\n        sz[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (sz[1][i] != 'A' && sz[1][i] != 'T' && sz[1][i] != 'C' &&\n        sz[1][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; sz[0][i] != '\\0'; i++) {\n    if (sz[0][i] == sz[1][i]) {\n      j++;\n    }\n  }\n  k = 1.0 * j / i;\n  if (k > n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char dna1[500], dna2[500];\n  double a;\n  int t = 0, i, flag = 0;\n  int len1, len2;\n  double b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'G' ||\n           dna1[i] == 'C') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'G' ||\n           dna2[i] == 'C')) {\n        if (dna1[i] == dna2[i])\n          t++;\n        if (dna1[i] != dna2[i])\n          continue;\n      }\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n           dna1[i] != 'C') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n           dna2[i] != 'C')) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      b = (double)t / len1;\n      if (b > a)\n        printf(\"yes\");\n      if (b <= a)\n        printf(\"no\");\n    }\n  }\n  if (len1 != len2)\n    printf(\"error\");\n  if (flag == 1)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int m, n, i, c = 0;\n  int r = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (m != n) {\n    c = 3;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i]) {\n      r++;\n    }\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')) {\n      c = 3;\n      break;\n    }\n  }\n  y = 1.0 * r / n;\n  if ((y > x) && (c == 0)) {\n    cout << \"yes\";\n  }\n  if ((y <= x) && (c == 0)) {\n    printf(\"no\");\n  }\n  if (c == 3) {\n    cout << \"error\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7789", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  double a, b = 0, l, m, c = 0;\n  char x[1000], y[1000];\n  scanf(\"%lf %s %s\", &a, &x, &y);\n  l = strlen(x);\n  m = strlen(y);\n  for (i = 0; i < l; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  if (l == m && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (x[i] == y[i]) {\n        b++;\n      }\n    }\n    if (a < (b / l)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, s = 0, j = 1;\n  double r;\n  char d1[501], d2[501];\n  cin >> r >> d1 >> d2;\n  if (strlen(d1) != strlen(d2)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] != 'A' && d1[i] != 'C' && d1[i] != 'G' && d1[i] != 'T' &&\n          d2[i] != 'A' && d2[i] != 'G' && d2[i] != 'C' && d2[i] != 'T') {\n        j = 0;\n        cout << \"error\";\n        break;\n      } else {\n        if (d1[i] == d2[i]) {\n          s++;\n        }\n      }\n    }\n    if (j == 1) {\n      if (1.0 * s / strlen(d1) > r) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, y = 0, m, n, t;\n  int i, q = 0;\n  char dna1[501];\n  char dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'C' ||\n           dna1[i] == 'G') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'C' ||\n           dna2[i] == 'G')) {\n      } else {\n        q = 1;\n        break;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (q == 1) {\n        break;\n      } else if (dna1[i] == dna2[i])\n        y++;\n      else if (dna1[i] != dna2[i]) {\n      }\n    }\n    t = y / m;\n  } else if (m != n) {\n    q = 1;\n  }\n  if ((t >= a && a != 0 && q == 0) || (q == 0 && t > a && a == 0)) {\n    printf(\"yes\");\n  } else if ((t < a) && (a != 0) && (q == 0) ||\n             ((q == 0) && (t == 0) && (a == 0))) {\n    printf(\"no\");\n  } else if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, f;\n  int d, e, k, i;\n  char b[505];\n  char c[505];\n  k = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < d; i++) {\n      if (((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) ||\n          ((c[i] != 'A') && (c[i] != 'T') && (c[i] != 'C') && (c[i] != 'G'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (i = 0; i < d; i++) {\n        if (b[i] == c[i]) {\n          k++;\n        }\n      }\n      f = k / (d * 1.0);\n      if (f > a) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz1[501], sz2[501];\n  int n, i, result = 0, x = 0;\n  double p;\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", sz1, sz2);\n  n = strlen(sz1);\n  for (i = 0; i < n; i++) {\n    if (((sz1[i] != 'A') && (sz1[i] != 'T') && (sz1[i] != 'C') &&\n         (sz1[i] != 'G')) ||\n        ((sz2[i] != 'A') && (sz2[i] != 'T') && (sz2[i] != 'C') &&\n         (sz2[i] != 'G'))) {\n      result = 1;\n      break;\n    } else if (sz1[i] == sz2[i]) {\n      x++;\n    }\n  }\n  if (result == 1) {\n    printf(\"error\\n\");\n  } else if ((1.0 * x / n) > p) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n, r;\n  int a, b, c;\n  int i, j;\n  char d1[600];\n  char d2[600];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  a = strlen(d1);\n  b = strlen(d2);\n  c = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (((d1[i] != 'A') && (d1[i] != 'T') && (d1[i] != 'C') &&\n           (d1[i] != 'G')) ||\n          ((d2[i] != 'A') && (d2[i] != 'T') && (d2[i] != 'C') &&\n           (d2[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (d1[i] == d2[i]) {\n          c++;\n        }\n      }\n      r = 1.0 * c / a;\n    }\n    if (r > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int count = 0, i;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, a, b);\n  if ((int)strlen(a) != (int)strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < (int)strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else if (a[i] == b[i]) {\n        count++;\n      }\n    }\n    if (1.0 * count / (int)strlen(a) >= n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7796", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000];\n  double n;\n  int i, j, k;\n  double sum = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i]) {\n        sum += 1;\n      }\n    }\n    if ((sum / strlen(a)) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int q, w, e = 0, r = 1, i;\n  double a, b;\n  char A[1000], B[1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", A);\n  scanf(\"%s\", B);\n  q = strlen(A);\n  w = strlen(B);\n\n  if (q != w) {\n    printf(\"error\");\n    r = -1;\n  } else {\n    for (i = 0; A[i] != '\\0'; i++) {\n\n      if ((A[i] != 'T' && A[i] != 'C' && A[i] != 'A' && A[i] != 'G') ||\n          (B[i] != 'T' && B[i] != 'C' && B[i] != 'A' && B[i] != 'G')) {\n        r = -1;\n        cout << \"error\";\n        break;\n      } else if (A[i] != B[i]) {\n        continue;\n      } else if (A[i] == B[i]) {\n        e++;\n      }\n    }\n  }\n\n  if (r == 1) {\n    b = (e * 1.0) / (q * 1.0);\n\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0;\n  double j;\n  char a[2000], b[2000];\n  scanf(\"%lf%s%s\", &j, a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    if (1.0 * m / n > j) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7799", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1 = 0, len2 = 0, len = 0, flag = 0;\n  char dna1[501], dna2[501];\n  double rate, ra;\n  cin >> rate >> dna1 >> dna2;\n  for (i = 0; dna1[i]; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'G') ||\n        (dna1[i] == 'C')) {\n      len1++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; dna2[i]; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'G') ||\n        (dna2[i] == 'C')) {\n      len2++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        len++;\n      }\n    }\n    ra = (double)len / len1;\n    if (ra > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, z = 1;\n  double n, q = 0, w;\n  char x[505], y[505];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    z = 0;\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G') &&\n          (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G'))\n        z = 1;\n      else\n        z = 0;\n    }\n  }\n  if (z == 0)\n    printf(\"error\");\n  if (z != 0) {\n    for (i = 0; i < a; i++) {\n      if (x[i] == y[i])\n        q++;\n    }\n  }\n  if (z != 0) {\n    w = q / a;\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int left = 0, right = 0, a = 0, get = 0, i;\n  double m, q;\n  char l[520], r[520];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", l);\n  scanf(\"%s\", r);\n  for (i = 0; l[i]; i++) {\n    left++;\n    if (l[i] != 'A' && l[i] != 'G' && l[i] != 'T' && l[i] != 'C') {\n      a = 1;\n    }\n  }\n  for (i = 0; r[i]; i++) {\n    right++;\n    if (r[i] != 'A' && r[i] != 'G' && r[i] != 'T' && r[i] != 'C') {\n      a = 1;\n    }\n  }\n  if (a == 1 || left != right) {\n    printf(\"error\");\n  } else {\n    for (i = 0; l[i]; i++) {\n      if (l[i] == r[i]) {\n        get++;\n      }\n    }\n    q = 1.0 * get / left;\n    if (q > m) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, p;\n  int m, i, j, c = 0, q, f = 0;\n  char u[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", u[i]);\n  }\n\n  q = strlen(u[1]);\n  m = strlen(u[0]);\n  if (m != q) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] != 'A' && u[0][j] != 'T' && u[0][j] != 'C' && u[0][j] != 'G') {\n      f++;\n    }\n  }\n  for (j = 0; j < q; j++) {\n    if (u[1][j] != 'A' && u[1][j] != 'T' && u[1][j] != 'C' && u[1][j] != 'G') {\n      f++;\n    }\n  }\n\n  if (f != 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] == u[1][j]) {\n      c++;\n    }\n  }\n\n  p = (1.0 * c) / m;\n  if (p >= n) {\n    printf(\"yes\");\n  }\n  if (p < n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b;\n  int s = 0;\n  int t = 1;\n  double x, y, aa, ss;\n  char sa[501];\n  char sb[501];\n\n  cin >> sa;\n  x = atof(sa);\n\n  cin >> sa;\n\n  cin >> sb;\n  a = strlen(sa);\n  b = strlen(sb);\n  if (a != b) {\n    t = 0;\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((sa[i] != 'A' && sa[i] != 'G' && sa[i] != 'T' && sa[i] != 'C') ||\n          (sb[i] != 'A' && sb[i] != 'G' && sb[i] != 'T' && sb[i] != 'C')) {\n        t = 0;\n        break;\n      } else if (sa[i] == sb[i]) {\n        s++;\n      }\n    }\n  }\n  aa = a;\n  ss = s;\n  y = ss / aa;\n  if (t == 0) {\n    printf(\"error\");\n  } else if (y >= x) {\n    printf(\"yes\");\n  } else if (y <= x) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, n;\n  float m, j = 0;\n  cin >> m;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  if ((strlen(a)) != (strlen(b))) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G') ||\n        ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i])\n        j++;\n    }\n  }\n  if (j / n >= m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7805", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, a;\n  int b = 0;\n  double n, k;\n  char l1[500];\n  char l2[500];\n  a = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", l1);\n  scanf(\"%s\", l2);\n  for (i = 0; i < strlen(l1); i++) {\n    if (l1[i] < 'A' || l1[i] > 'Z' || l2[i] < 'A' || l2[i] > 'Z') {\n      b = 1;\n    }\n  }\n  if (strlen(l1) != strlen(l2) || b == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(l1); i++) {\n      if (l1[i] == l2[i]) {\n        a++;\n      }\n    }\n    k = 1.0 * a / strlen(l1);\n    if (k > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7806", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  int l1, l2, x = 0;\n  char d1[500], d2[500];\n  cin >> b >> d1 >> d2;\n  l1 = strlen(d1);\n  l2 = strlen(d2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l1; i++) {\n    if (d1[i] != 'A' && d1[i] != 'T' && d1[i] != 'C' && d1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d2[i] != 'A' && d2[i] != 'T' && d2[i] != 'C' && d2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d1[i] == d2[i]) {\n      x++;\n    }\n  }\n  if (1.0 * x / l1 > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double v;\n  scanf(\"%lf\\n\", &v);\n  char s[600], z[600];\n  scanf(\"%s\\n%s\", s, z);\n  int a, b;\n  a = strlen(s);\n  b = strlen(z);\n  int m, n, p = 0, q = 0;\n  for (m = 0; m < a; m++) {\n    if (s[m] != 'A' && s[m] != 'T' && s[m] != 'C' && s[m] != 'G')\n      p = 1;\n  }\n  for (n = 0; n < a; n++) {\n    if (z[n] != 'A' && z[n] != 'T' && z[n] != 'C' && z[n] != 'G') {\n      q = 1;\n    }\n  }\n  int w = 0;\n  double u;\n  if (m != n || q == 1 || p == 1) {\n    printf(\"error\");\n    w = 1;\n  }\n  int sum = 0;\n  for (n = 0; n < a; n++) {\n    if (s[n] == z[n]) {\n      sum++;\n    }\n  }\n  u = 1.0 * sum / a;\n  if (w == 1) {\n    ;\n  } else {\n    if (u > v) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x;\n  int m, n, i;\n  int p = 0;\n  int s = 0;\n  int c[1000];\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m - 1; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  if (s == 0) {\n    for (i = 0; i < n; i++) {\n      c[i] = a[i] / b[i];\n    }\n    for (i = 0; i < m; i++) {\n      if (c[i] < x) {\n        p++;\n      }\n    }\n    if (p == 0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7809", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0, e, f;\n  double n, m, k = 0;\n  char num[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", &num[i]);\n  }\n  e = strlen(num[0]);\n  f = strlen(num[1]);\n  for (i = 0; i < 2; i++) {\n    m = strlen(num[i]);\n    for (j = 0; j < m; j++) {\n      if (((num[i][j] != 'A') && (num[i][j] != 'C') && (num[i][j] != 'G') &&\n           (num[i][j] != 'T')) ||\n          (e != f)) {\n        printf(\"error \");\n        l++;\n        break;\n      }\n    }\n    if (l > 0) {\n      break;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    if (l == 0) {\n      if (num[0][j] == num[1][j]) {\n        k++;\n      }\n    }\n  }\n  if ((l == 0) && (k / m) > n) {\n    printf(\"yes \");\n  } else if ((l == 0) && (k / m) <= n) {\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7810", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  double rate;\n  char gen1[500], gen2[500];\n  scanf(\"%lf %s %s \", &rate, gen1, gen2);\n  int len1 = strlen(gen1), len2 = strlen(gen2), S = 0;\n  if (len1 != len2) {\n    cout << \"error\" << endl;\n    return 0;\n  }\n  for (int i = 0; i < len1; i++) {\n    if ((gen2[i] != 'A' && gen2[i] != 'T' && gen2[i] != 'C' &&\n         gen2[i] != 'G') ||\n        (gen1[i] != 'A' && gen1[i] != 'T' && gen1[i] != 'C' &&\n         gen1[i] != 'G')) {\n      cout << \"error\" << endl;\n      return 0;\n    }\n    if (gen1[i] == gen2[i])\n      S++;\n  }\n  double R;\n  R = (double)S / len1;\n  if (R >= rate) {\n    cout << \"yes\" << endl;\n    return 0;\n  } else {\n    cout << \"no\" << endl;\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c = 0;\n  double e, d;\n  char x[256], y[256];\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (x[i] == y[i]) {\n          c += 1;\n        }\n      }\n    }\n    e = 1.0 * c / a;\n    if (e >= d) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int count = 0, i;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, a, b);\n  if ((int)strlen(a) != (int)strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < (int)strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        cout << \"error\";\n        return 0;\n      } else if (a[i] == b[i]) {\n        count++;\n      }\n    }\n    if (1.0 * count / (int)strlen(a) >= n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bl;\n  double xg;\n  int i, l, e, k, c;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &bl, &a, &b);\n  l = strlen(a);\n  k = strlen(b);\n  c = 0;\n  e = 0;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      c = 1;\n    }\n  }\n  if (l == k && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    xg = 1.0 * e / l;\n    if (xg > bl) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, x;\n  int t = 0, a, b, u = 0;\n  char ji[501], yin[501];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  a = strlen(ji);\n  b = strlen(yin);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int q = 0; q < a; q++) {\n      if ((ji[q] != 'A' && ji[q] != 'T' && ji[q] != 'C' && ji[q] != 'G') ||\n          (yin[q] != 'A' && yin[q] != 'C' && yin[q] != 'T' && yin[q] != 'G')) {\n        u = 1;\n      }\n    }\n    if (u == 1) {\n      printf(\"error\");\n    } else {\n      for (int h = 0; h < a; h++) {\n        if (ji[h] == yin[h]) {\n          t++;\n        }\n      }\n      x = 1.0 * t / a;\n      if (x > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, y, z, std;\n  x = 1.0;\n  char aa[1000];\n  char bb[1000];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", aa);\n  cin >> bb;\n  n = strlen(aa);\n  m = strlen(bb);\n  if (m != n) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((aa[i] != 'A') && (aa[i] != 'T') && (aa[i] != 'G') && (aa[i] != 'C') &&\n        (bb[i] != 'A') && (bb[i] != 'T') && (bb[i] != 'C') && (bb[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (aa[i] == bb[i]) {\n      x = x + 1;\n    }\n  }\n  y = n * 1.0;\n  z = x / y;\n  if (z > std) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7816", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  double a, b = 0, l, m, c = 0;\n  char x[1000], y[1000];\n  scanf(\"%lf %s %s\", &a, &x, &y);\n  l = strlen(x);\n  m = strlen(y);\n  for (i = 0; i < l; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C') {\n      c = c;\n    } else\n      c++;\n  }\n  for (i = 0; i < m; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  if (l == m && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (x[i] == y[i]) {\n        b++;\n      }\n    }\n    if (a < (b / l)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7817", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA[2][501];\n  cin >> DNA[0];\n  cin >> DNA[1];\n  int t;\n  int i, j;\n  int number = 0;\n  t = strlen(DNA[0]);\n  int w;\n  w = strlen(DNA[1]);\n  if (t != w) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < t; i++) {\n    if (DNA[0][i] != 'A' && DNA[0][i] != 'T' && DNA[0][i] != 'C' &&\n        DNA[0][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[1][i] != 'A' && DNA[1][i] != 'T' && DNA[1][i] != 'C' &&\n        DNA[1][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[0][i] == DNA[1][i]) {\n      number++;\n    }\n  }\n  double r;\n  r = 1.00 * number / t;\n  if (r >= rate) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, c = 0;\n  int i, j = 0, zs;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &n);\n  cin >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n  } else {\n    zs = strlen(s1);\n    for (i = 0; i < zs; i++) {\n      if (s1[i] == 'G' || s1[i] == 'A' || s1[i] == 'C' || s1[i] == 'T') {\n        j++;\n      }\n    }\n\n    if (j != zs) {\n      printf(\"error\");\n      return 0;\n    } else {\n      for (i = 0; i < zs; i++) {\n        if (s1[i] - s2[i] == 0) {\n          c = c + 1;\n        }\n      }\n      if (c / zs > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, la, lb, x, i;\n  double r0, r1;\n  char a[505], b[505];\n  scanf(\"%lf\", &r0);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb)\n    printf(\"error\\n\");\n  else {\n    x = 1;\n    for (i = 0, m = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\\n\";\n        x = 0;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          m++;\n      }\n    }\n    r1 = 1.0 * m / la;\n    if (x == 1) {\n      if (r1 > r0)\n        cout << \"yes\\n\";\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar sen[100][500], ori, final, temp;\nint main() {\n  int n, m, temp1, temp2, i, j, a, b, k, c, d, e;\n  int sz[100];\n  double f, g;\n  a = 0;\n  d = 0;\n  scanf(\"%lf\", &f);\n  scanf(\"%s%s\", sen[0], sen[1]);\n  for (i = 0; i < 2 && d == 0; i++) {\n    for (j = 0; j < strlen(sen[i]) && d == 0; j++) {\n\n      if (sen[i][j] != 'A' && sen[i][j] != 'T' && sen[i][j] != 'C' &&\n          sen[i][j] != 'G')\n        d = 1;\n    }\n  }\n  if (d == 0) {\n    if (strlen(sen[0]) == strlen(sen[1])) {\n      for (i = 0; i < strlen(sen[0]); i++) {\n        if (sen[0][i] == sen[1][i])\n          a++;\n      }\n      g = 1.0 * a / strlen(sen[0]);\n      if (g >= f)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else\n      printf(\"error\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, m, k = 0;\n  int cd[2];\n  double s;\n  char sz[2][505];\n  scanf(\"%lf\", &s);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", sz[i]);\n    cd[i] = strlen(sz[i]);\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < cd[i]; j++) {\n      if (sz[i][j] != 'A' && sz[i][j] != 'T' && sz[i][j] != 'C' &&\n          sz[i][j] != 'G')\n        k++;\n    }\n  }\n  if (cd[0] != cd[1])\n    k++;\n  if (k != 0)\n    printf(\"error\");\n  else {\n    for (j = 0; j < cd[0]; j++) {\n      if (sz[0][j] == sz[1][j])\n        k++;\n    }\n    p = k * 100 / cd[0];\n    if (p > 100 * s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, a, b, k;\n  k = 0;\n  a = 0;\n  b = 0;\n  double p;\n  char f[501], g[501];\n  cin >> p >> f >> g;\n  m = strlen(f);\n  n = strlen(g);\n  for (i = 0; i < m; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      a++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (g[i] != 'A' && g[i] != 'T' && g[i] != 'C' && g[i] != 'G') {\n      b++;\n    }\n  }\n  if (m != n || a != 0 || b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (f[i] == g[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / m > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  int total1, total2;\n  int i, same = 0;\n  char h1[10000];\n  char h2[10000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", h1);\n  cin >> h2;\n  total1 = (int)strlen(h1);\n  total2 = (int)strlen(h2);\n\n  if (total1 != total2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < total1; i++) {\n      if ((h1[i] == 'A' || h1[i] == 'T' || h1[i] == 'C' || h1[i] == 'G') &&\n          (h2[i] == 'A' || h2[i] == 'T' || h2[i] == 'C' || h2[i] == 'G')) {\n        if (h1[i] == h2[i]) {\n          same++;\n        }\n      } else {\n        cout << \"error\";\n        return 0;\n      }\n    }\n  }\n  if (((double)same / (double)total1) > k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, s = 0, m;\n  scanf(\"%lf\", &n);\n  char a[600], b[600];\n  scanf(\"%s%s\", &a, &b);\n  int l1, l2;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  }\n  if (l1 == l2) {\n    int i, T = 0;\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'G' || b[i] == 'T' || b[i] == 'A' || b[i] == 'C')) {\n        if (a[i] == b[i]) {\n          s++;\n        }\n      } else {\n        printf(\"error\");\n        T = 1;\n        break;\n      }\n    }\n    if (T == 0) {\n      m = s / l1;\n      if (m > n) {\n        printf(\"yes\");\n      }\n      if (m <= n) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, k = 0;\n  double m;\n  cin >> m;\n  char a[100];\n  char b[100];\n  scanf(\"%s\\n%s\", a, b);\n  int l = strlen(a), t = strlen(b);\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      k++;\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')\n      k++;\n  }\n  if (k > 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  if (l == t) {\n    for (i = 0; i <= l; i++) {\n\n      if (a[i] == b[i])\n        n++;\n    }\n    if ((1.00 * n / l) > m) {\n      printf(\"yes\");\n    }\n\n    else\n      printf(\"no\");\n\n  }\n\n  else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, c = 0;\n  int i, j = 0, zs;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n  } else {\n    zs = strlen(s1);\n    for (i = 0; i < zs; i++) {\n      if (s1[i] == 'G' || s1[i] == 'A' || s1[i] == 'C' || s1[i] == 'T') {\n        j++;\n      }\n    }\n\n    if (j != zs) {\n      printf(\"error\");\n      return 0;\n    } else {\n      for (i = 0; i < zs; i++) {\n        if (s1[i] - s2[i] == 0) {\n          c = c + 1;\n        }\n      }\n      if (c / zs > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7827", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w1[256], w2[256];\n  int n, m, i, j = 0, A = 1;\n  double a, c;\n  scanf(\"%lf %s %s \", &a, w1, w2);\n  n = strlen(w1);\n  m = strlen(w2);\n  if (n != m)\n    printf(\"error\");\n  if (n == m) {\n    for (i = 0; i < n; i++) {\n      if ((w1[i] == 'A' && w2[i] == 'A') || (w1[i] == 'G' && w2[i] == 'G') ||\n          (w2[i] == 'T' && w1[i] == 'T') || (w2[i] == 'C' && w1[i] == 'C'))\n        j++;\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        A = 0;\n      }\n    }\n    c = (double)j / n;\n    if (A == 0)\n      printf(\"error\");\n    else if (A == 1 && c > a)\n      printf(\"yes\");\n    else if (A == 1 && c <= a)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, num = 0, t = 1;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i] &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))\n        num++;\n      else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\"error\");\n    else {\n      if (num * 1.0 / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int i, l, r = 1, s = 0;\n  char a[2][500];\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    cin >> a[i];\n  }\n  if (strlen(a[0]) != strlen(a[1])) {\n    r = 0;\n  } else {\n    l = strlen(a[0]);\n    for (i = 0; i < l; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'C' && a[0][i] != 'T' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'C' && a[1][i] != 'T' &&\n           a[1][i] != 'G')) {\n        r = 0;\n        break;\n      } else if (a[0][i] == a[1][i]) {\n        s++;\n      }\n    }\n  }\n  if (r == 0) {\n    printf(\"error\");\n  } else {\n    if (1.0 * s / l >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c = 0, m = 0, i, a, b, j, z = 1;\n  double n, q = 0, w;\n  char x[505], y[505];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    z = 0;\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G') &&\n          (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G'))\n        z = 1;\n      else\n        z = 0;\n    }\n  }\n  if (z == 0)\n    printf(\"error\");\n  if (z != 0) {\n    for (i = 0; i < a; i++) {\n      if (x[i] == y[i])\n        q++;\n    }\n  }\n  if (z != 0) {\n    w = q / a;\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7831", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e = 0, f = 0;\n  char h[1][501], i[1][501];\n  double j, k;\n  cin >> j >> h[0] >> i[0];\n  b = strlen(h[0]);\n  c = strlen(i[0]);\n  if (b != c) {\n    f++;\n    printf(\"error\");\n  } else {\n    for (d = 0; d < b; d++) {\n      if ((h[0][d] != 'A' && h[0][d] != 'T' && h[0][d] != 'C' &&\n           h[0][d] != 'G') ||\n          (i[0][d] != 'A' && i[0][d] != 'T' && i[0][d] != 'C' &&\n           i[0][d] != 'G')) {\n        printf(\"error\");\n        f++;\n        break;\n      } else {\n        if (h[0][d] == i[0][d]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (f == 0) {\n    k = 1.0 * e / b;\n    if (k > j) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7832", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  char a[501], b[501];\n  cin >> r;\n  scanf(\"%s%s\", a, b);\n  int s1, s2, y = 1, m = 0;\n  s1 = strlen(a);\n  s2 = strlen(b);\n  if (s1 != s2) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i]; i++) {\n      if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n          (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T')) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      } else {\n        printf(\"error\");\n        y = 0;\n        break;\n      }\n    }\n    if (m * 1.0 / s1 > r && y == 1) {\n      printf(\"yes\");\n    } else {\n      if (y == 1) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[1000], s2[1000];\n\n  int i, j, k, l1, n, l2;\n  double m;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    n = 0;\n    for (i = 0; i < l1; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        printf(\"error\");\n        exit(0);\n      }\n      if (s1[i] == s2[i])\n        n++;\n    }\n    if (1.0 * n / l1 >= m)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, q = 0, a, b, d = 0, e = 0, l, g;\n  float c, n;\n  char s1[500], s2[500];\n  cin >> n;\n  scanf(\"%s\\n%s\", s1, s2);\n  if (strlen(s1) != strlen(s2))\n    cout << \"error\";\n  if (strlen(s1) == strlen(s2)) {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C')\n        d++;\n    }\n    for (j = 0; s2[j] != '\\0'; j++) {\n      if (s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'G' && s2[j] != 'C') {\n        e++;\n      }\n    }\n    l = strlen(s1);\n    for (int k = 0; k < l; k++) {\n      if (s1[k] == s2[k])\n        q++;\n    }\n    a = strlen(s1);\n    b = q;\n    c = (float)b / (float)a;\n    g = d + e;\n    if (g != 0) {\n      printf(\"error\");\n    } else {\n      if (c >= n)\n        printf(\"yes\");\n      if (c < n)\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int w = 0, g = 0;\n  double n;\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else if ((l <= n) && (g == 0)) {\n      printf(\"no\");\n    }\n  }\n  int u;\n  scanf(\"%d\", &u);\n  return 0;\n}\n"}
{"label": "5", "index": "7836", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char w1[501], w2[501];\n  int len1, len2;\n  int i, a = 0, b = 0;\n  double n, m;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", w1);\n  cin >> w2;\n  len1 = strlen(w1);\n  len2 = strlen(w2);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        b = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (w1[i] - w2[i] == 0)\n        a++;\n    }\n    m = 1.0 * a / (len1 - 1);\n    if (m > n && b == 0) {\n      printf(\"yes\");\n    }\n    if (m < n && b == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, t = 0, r = 0;\n  double k, q;\n  char gen1[1000], gen2[1000];\n  scanf(\"%lf\", &k);\n  cin >> gen1;\n  scanf(\"%s\", gen2);\n  if (strlen(gen1) != strlen(gen2)) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < strlen(gen1); i++) {\n      if (gen1[i] != 'A' && gen1[i] != 'C' && gen1[i] != 'G' &&\n          gen1[i] != 'T') {\n        r++;\n      }\n    }\n    for (i = 0; i < strlen(gen2); i++) {\n      if (gen2[i] != 'A' && gen2[i] != 'C' && gen2[i] != 'G' &&\n          gen2[i] != 'T') {\n        r++;\n      }\n    }\n    if (r > 0) {\n      printf(\"error\");\n      t = 0;\n    } else {\n      t = 1;\n    }\n    if (t == 1) {\n      for (i = 0; i < strlen(gen1) + 1; i++) {\n        if (gen1[i] == gen2[i]) {\n          p++;\n        }\n      }\n      q = 1.0 * p / (strlen(gen1));\n      if (q > k) {\n        printf(\"yes\\n\");\n      } else {\n        cout << \"no\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double w, e, k = 0.0;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &w, &a, &b);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m != n) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if (a[i] == b[i]) {\n      k = k + 1;\n      e = 1.0 * k / n;\n    }\n  }\n  if (e > w && i == n)\n    printf(\"yes\\n\");\n  else if (e <= w && i == n)\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "5", "index": "7839", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char yuanshi[500], bijiao[500], laji[3];\n  double cankao, shiji;\n  int jishu = 0, i, m, n, panduan = 0;\n  cin >> cankao;\n\n  cin >> laji;\n\n  cin >> yuanshi;\n\n  cin >> bijiao;\n  m = strlen(yuanshi);\n  n = strlen(bijiao);\n  for (i = 0; i < m; i++) {\n    if (yuanshi[i] == bijiao[i])\n      jishu++;\n    if (yuanshi[i] != 'A' && yuanshi[i] != 'T' && yuanshi[i] != 'G' &&\n        yuanshi[i] != 'C' && yuanshi[i] != '\u0000')\n      panduan++;\n    if (bijiao[i] != 'A' && bijiao[i] != 'T' && bijiao[i] != 'G' &&\n        bijiao[i] != 'C' && bijiao[i] != '\u0000')\n      panduan++;\n  }\n  if (m != n || panduan != 0) {\n\n    printf(\"error\");\n  } else if (m == n && panduan == 0) {\n    shiji = jishu * 1.0 / m;\n    if (shiji > cankao)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, x;\n  int l, l1, l2, i, j, t = 0, flag = 0;\n  char a[100], b[100];\n  cin >> r;\n  scanf(\"%s\", a);\n  cin >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (j = 0; j < l2; j++) {\n    if (b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n    return 0;\n  } else {\n    l = l1;\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    x = (double)t / l;\n    if (x > r)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf\", &a);\n  char b[600], c[600];\n  getchar();\n\n  cin >> b;\n\n  cin >> c;\n  int d, e, f, g;\n  int h = 0;\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= d - 1; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        f = 1;\n      }\n      if (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T') {\n        g = 1;\n      }\n    }\n    if (f == 1 || g == 1) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i <= d - 1; i++) {\n        if (b[i] == c[i]) {\n          h++;\n        }\n      }\n      \n      if (1.0 * h / d > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  int y;\n  scanf(\"%d\", &y);\n  return 0;\n}\n"}
{"label": "5", "index": "7842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate, result;\n  int p = 2, num = 0;\n  scanf(\"%lf\\n\", &rate);\n  char dna1[510], dna2[510];\n  scanf(\"%s\", dna1);\n  scanf(\"\\n\");\n  scanf(\"%s\", dna2);\n  for (int i = 0; i < strlen(dna1); i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G') ||\n        (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n         dna2[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    p = 0;\n  }\n\n  if (p == 2) {\n    for (int i = 0; i < strlen(dna1); i++) {\n      if (dna1[i] == dna2[i]) {\n        num++;\n      }\n    }\n    result = 1.0 * num / strlen(dna1);\n    if (result >= rate) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  if (p == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100];\n  int changdu1, changdu2, i, js = 0;\n  double rate, rate1;\n  cin >> rate >> s1 >> s2;\n  changdu1 = strlen(s1);\n  changdu2 = strlen(s2);\n  if (changdu1 != changdu2)\n    cout << \"error\";\n  else {\n    for (i = 0; i < changdu1; i++) {\n      if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') ||\n          (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C')) {\n        js = 1;\n        break;\n      }\n    }\n    if (js == 1)\n      cout << \"error\";\n    else {\n      for (i = 0; i < changdu1; i++) {\n        if (s1[i] == s2[i])\n          js++;\n      }\n      rate1 = 1.0 * js / changdu1;\n      if (rate1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  int total1, total2;\n  int i, same = 0;\n  char h1[10000];\n  char h2[10000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", h1);\n  scanf(\"%s\", h2);\n  total1 = (int)strlen(h1);\n  total2 = (int)strlen(h2);\n\n  if (total1 != total2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < total1; i++) {\n      if ((h1[i] == 'A' || h1[i] == 'T' || h1[i] == 'C' || h1[i] == 'G') &&\n          (h2[i] == 'A' || h2[i] == 'T' || h2[i] == 'C' || h2[i] == 'G')) {\n        if (h1[i] == h2[i]) {\n          same++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (((double)same / (double)total1) > k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, p = 0, a, b, m = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  a = strlen(s1);\n  for (i = 0; i < a; i++) {\n    if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') ||\n        (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G')) {\n      m = 1;\n      break;\n    }\n    if (s1[i] == s2[i]) {\n      p++;\n    }\n  }\n  if (m == 1) {\n    printf(\"error\");\n  } else {\n    b = p / a;\n    if (b > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, same = 0;\n  double rate, z;\n  char DNA[2][600];\n  cin >> rate;\n  cin >> DNA[0] >> DNA[1];\n\n  len1 = strlen(DNA[0]);\n  len2 = strlen(DNA[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (((DNA[0][i] != 'A') && (DNA[0][i] != 'G') && (DNA[0][i] != 'C') &&\n           (DNA[0][i] != 'T')) ||\n          ((DNA[1][i] != 'A') && (DNA[1][i] != 'G') && (DNA[1][i] != 'C') &&\n           (DNA[1][i] != 'T'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (DNA[0][i] == DNA[1][i])\n          same++;\n      }\n    }\n    z = (1.0 * same) / len1;\n    if (z >= rate)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s = 0, i;\n  double a;\n  char b[2][1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", b[0]);\n  scanf(\"%s\", b[1]);\n  if (strlen(b[0]) != strlen(b[1])) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < strlen(b[0]); i++) {\n    if (b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G' &&\n        b[1][i] != 'A' && b[1][i] != 'T' && b[1][i] != 'C' && b[1][i] != 'G' &&\n        b[0][i] != 'a' && b[0][i] != 't' && b[0][i] != 'c' && b[0][i] != 'g' &&\n        b[1][i] != 'a' && b[1][i] != 't' && b[1][i] != 'c' && b[1][i] != 'g') {\n      cout << \"error\";\n\n      return 0;\n    }\n    if (b[0][i] == b[1][i])\n      s++;\n  }\n  if (s * 1.0 / strlen(b[0]) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, x;\n  int l, l1, l2, i, j, t = 0, flag = 0;\n  char a[100], b[100];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (j = 0; j < l2; j++) {\n    if (b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (l1 != l2 || flag == 1) {\n    cout << \"error\";\n    return 0;\n  } else {\n    l = l1;\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    x = (double)t / l;\n    if (x > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bz, sj;\n  int n1, n2, n, i, p;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", jy1);\n  scanf(\"%s\", jy2);\n  p = 0;\n  n1 = strlen(jy1);\n  n2 = strlen(jy2);\n  if (n1 == n2) {\n    n = n1;\n  } else {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((jy1[i] != 65 && jy1[i] != 84 && jy1[i] != 67 && jy1[i] != 71) ||\n        (jy2[i] != 65 && jy2[i] != 84 && jy2[i] != 67 && jy2[i] != 71)) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (jy1[i] == jy2[i]) {\n        p++;\n      } else {\n        p = p;\n      }\n    }\n  }\n  sj = 1.0 * p / n;\n  if (sj >= bz) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double a;\n  char zfc1[501], zfc2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  x = strlen(zfc1);\n  y = strlen(zfc2);\n  int s = 0;\n  for (i = 0; i < x; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'G' && zfc1[i] != 'C' && zfc1[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  for (i = 0; i < y; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'G' && zfc2[i] != 'C' && zfc2[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  if (x != y || s == 1) {\n    printf(\"error\");\n  } else {\n    int t = 0;\n    for (i = 0; i < x; i++) {\n      if (zfc1[i] == zfc2[i])\n        t++;\n    }\n    double s;\n    s = 1.0 * t / (1.0 * x);\n    if (s > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[500], c[500];\n  double s = 0;\n  int i;\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", b, c);\n  if (strlen(b) != strlen(c)) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G' &&\n        c[i] != 'A' && c[i] != 'C' && c[i] != 'T' && c[i] != 'G')\n      s = 1;\n  }\n  if (s == 1) {\n    cout << \"error\";\n    return 0;\n  }\n  s = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == c[i])\n      s++;\n  }\n  if (s / strlen(b) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, len, panduan = 0;\n  double r, n;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, &a, &b);\n  len = strlen(a);\n  if (len != strlen(b)) {\n    panduan = 1;\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        panduan = 1;\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    r = 1.0 * k / len;\n  }\n  if (panduan == 1) {\n    printf(\"error\");\n  } else {\n    if (r > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, k;\n  int i, j = 0;\n  int p, q;\n  scanf(\"%lf\", &n);\n  char sz[2][1000];\n  scanf(\"%s %s\", sz[0], sz[1]);\n  p = strlen(sz[0]);\n  q = strlen(sz[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < q; i++) {\n    if (sz[0][i] != 'A' && sz[0][i] != 'T' && sz[0][i] != 'C' &&\n        sz[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (sz[1][i] != 'A' && sz[1][i] != 'T' && sz[1][i] != 'C' &&\n        sz[1][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; sz[0][i] != '\\0'; i++) {\n    if (sz[0][i] == sz[1][i]) {\n      j++;\n    }\n  }\n  k = 1.0 * j / i;\n  if (k > n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        printf(\"error\");\n        break;\n      } else {\n        if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n          printf(\"error\");\n          break;\n        } else {\n          if (a[i] == b[i])\n            m++;\n        }\n      }\n      if (i == x - 1) {\n        if (1.0 * m / x > n) {\n          printf(\"yes\");\n        } else\n          printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7855", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c[2], e = 0;\n  char a[2][501];\n  double b;\n  cin >> b;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  c[0] = strlen(a[0]);\n  c[1] = strlen(a[1]);\n  if (c[0] != c[1]) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < c[i] - 1; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'G' &&\n          a[i][j] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (j = 0; j < c[0]; j++) {\n    if (a[0][j] == a[1][j]) {\n      e++;\n    }\n  }\n  if (1.0 * e / c[0] > b) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double w, sum = 0, p;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      } else if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n                 (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G')) {\n        printf(\"error\\n\");\n        return 0;\n      }\n    }\n\n  } else if (x != y) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  while (x == y) {\n    p = sum / x;\n    if (p >= w) {\n      printf(\"yes\\n\");\n      break;\n    } else\n      printf(\"no\\n\");\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, x;\n  int l, m, i, a = 0, t = 0;\n  char st1[501], st2[501];\n  scanf(\"%lf\", &k);\n  scanf(\" \");\n\n  cin >> st1;\n\n  cin >> st2;\n  l = strlen(st1);\n  m = strlen(st2);\n  if (l != m) {\n    t = 1;\n  } else {\n    for (i = 0; i < l - 1; i++) {\n      if ((st1[i] != 'A' && st1[i] != 'T' && st1[i] != 'C' && st1[i] != 'G') ||\n          (st2[i] != 'A' && st2[i] != 'T' && st2[i] != 'C' && st2[i] != 'G')) {\n        t = 1;\n        break;\n      } else if (st1[i] == st2[i]) {\n        a++;\n      }\n    }\n  }\n  x = 1.0 * a / (l - 1);\n  if (t == 1) {\n    printf(\"error\");\n  } else if (x <= k)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int i, j, t = 0, l1, l2, l, s1 = 0, s2 = 0;\n  double n, t1, t2;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n\n    printf(\"error\");\n\n  } else {\n    for (j = 0; a[j]; j++) {\n      if (!(a[j] == 'A' || a[j] == 'T' || a[j] == 'C' || a[j] == 'G')) {\n        printf(\"error\");\n        s1++;\n        break;\n      }\n    }\n    if (s1 == 0) {\n      for (j = 0; b[j]; j++) {\n        if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G')) {\n          printf(\"error\");\n          s2++;\n          break;\n        }\n      }\n    }\n    if (s1 == 0 && s2 == 0) {\n      for (i = 0; a[i]; i++) {\n        if (a[i] == b[i]) {\n          t++;\n        }\n      }\n      l = strlen(a);\n      t1 = l;\n      t2 = t;\n      if (t2 / t1 > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double e;\n  char zf[2][501], count = 0, c, w = 0;\n  scanf(\"%lf%c\", &e, &c);\n\n  scanf(\"%s \", zf);\n\n  scanf(\"%s \", zf);\n  int a = strlen(zf[0]), b = strlen(zf[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int m = 0; m < a; m++) {\n      for (int o = 0; o < 2; o++) {\n        if (zf[o][m] != 'A' && zf[o][m] != 'T' && zf[o][m] != 'G' &&\n            zf[o][m] != 'C') {\n          w++;\n        }\n      }\n    }\n    if (w != 0) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i < a; i++) {\n        if (zf[0][i] == zf[1][i])\n          count++;\n      }\n      if (1.0 * count / a > e) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m;\n  double c, d;\n  char a[501], b[501];\n  cin >> c;\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      break;\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (i < m) {\n    printf(\"error\");\n  } else if (i >= m) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        n += 1;\n      }\n    }\n    d = 1.0 * n / m;\n    if (d > c) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, s = 0, p, q, j;\n  char s1[501];\n  char s2[501];\n  char string[100];\n  char no[100] = {\"no\"};\n  char y[100] = {\"yes\"};\n  char e[100] = {\"error\"};\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", s1);\n  cin >> s2;\n  p = strlen(s1);\n  q = strlen(s2);\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] == s2[j]) {\n        s = s + 1;\n      }\n    }\n    m = s * 1.0 / p;\n    if (m > n) {\n      strcpy(string, y);\n\n    } else {\n      strcpy(string, no);\n    }\n  } else {\n    strcpy(string, e);\n  }\n\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] != 'A' && s1[j] != 'T' && s1[j] != 'C' && s1[j] != 'G' ||\n          s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'C' && s2[j] != 'G') {\n        strcpy(string, e);\n      }\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "5", "index": "7862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, m, n;\n  double d, k, r;\n  k = 0;\n  char p[1000], q[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", p);\n  scanf(\"%s\", q);\n  m = strlen(p);\n  n = strlen(q);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((p[i] != 'A' && p[i] != 'T' && p[i] != 'C' && p[i] != 'G') ||\n          (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (p[i] == q[i]) {\n        k++;\n      }\n    }\n    d = 1.0 * k / n;\n    if (d > r) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7863", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x, z = 0, n = 0, m = 0;\n  int y = 0;\n  int i;\n  char a[501], b[501];\n  cin >> x;\n  cin >> a >> b;\n  for (i = 0; a[i]; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n      y++;\n  }\n  for (i = 0; b[i]; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    n++;\n  }\n  for (i = 0; b[i]; i++) {\n    m++;\n  }\n  if (m != n) {\n    y++;\n  }\n  if (y != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        z++;\n      }\n    }\n    if (z / n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double j, n;\n  int i, l, k, p = 0, u, h = 0;\n  char a[2][501];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l = strlen(a[0]);\n  k = strlen(a[1]);\n  if (l != k) {\n    cout << \"error\";\n  } else {\n    for (u = 0; u < l; u++) {\n      if ((a[0][u] != 'A') && (a[0][u] != 'T') && (a[0][u] != 'G') &&\n          (a[0][u] != 'C') && (a[1][u] != 'A') && (a[1][u] != 'T') &&\n          (a[1][u] != 'G') && (a[1][u] != 'C')) {\n        p++;\n      } else {\n        if (a[0][u] == a[1][u]) {\n          h++;\n        }\n      }\n    }\n    if (p != 0) {\n      printf(\"error\");\n    } else {\n      j = 1.0 * h / l;\n      if (j > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, d = 0, p = 0;\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  for (i = 0; dna1[i] && dna2[i]; i++) {\n    if (m != n) {\n      d++;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna1[i] == dna2[i]) {\n      p++;\n    }\n  }\n  if ((p * 1.0 / m) > b && d == 0) {\n    printf(\"yes\");\n  }\n  if (d != 0) {\n    printf(\"error\");\n  }\n  if ((p * 1.0 / m) <= b && d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m = 0.0;\n  int t, i, r;\n  double n;\n  scanf(\"%lf\", &n);\n  char z[100], c[100];\n  scanf(\"%s\", z);\n  scanf(\"%s\", c);\n  t = strlen(z);\n  r = strlen(c);\n  if (t != r) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < t; i++) {\n      if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (z[i] == c[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / t > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7867", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  int k = 0, i, q = 1;\n  char s[600], s1[600];\n  cin >> r;\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  if (strlen(s) != strlen(s1))\n    q = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'C' && s[i] != 'T' && s[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    if (1.0 * k / strlen(s) > r)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  if (q == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7868", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf\", &r);\n  char zfc[500];\n  char jiyin[500];\n  cin >> zfc;\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n  L++;\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  N++;\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int m, n, i, j = 0, k = 0;\n  double x, e;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    if (k != 1) {\n      for (i = 0; i < m; i++) {\n        if (a[i] == b[i]) {\n          j += 1;\n        }\n      }\n      e = j * 1.0 / m;\n      if (e > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, l, s = 0, p = 0;\n  double n, m;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n  k = strlen(a), l = strlen(b);\n  for (i = 0; i < k; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      p++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] == b[i]) {\n      s++;\n    }\n  }\n  m = 1.0 * s / k;\n  if ((k == l) && (p == 0) && (m > n)) {\n    printf(\"yes\");\n  } else if ((k == l) && (p == 0) && (m <= n)) {\n    cout << \"no\";\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  int k = 0, i, q = 1;\n  char s[600], s1[600];\n  cin >> r;\n  scanf(\"%s\", s);\n  cin >> s1;\n  if (strlen(s) != strlen(s1))\n    q = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'C' && s[i] != 'T' && s[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    if (1.0 * k / strlen(s) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 0)\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, p;\n  int i, l, k = 0, c = 1;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  cin >> c1;\n  scanf(\"%s\", c2);\n  l = strlen(c1);\n  for (i = 0; i < l; i++) {\n    if ((c1[i] != 'A') && (c1[i] != 'T') && (c1[i] != 'C') && (c1[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if ((c2[i] != 'A') && (c2[i] != 'T') && (c2[i] != 'C') && (c2[i] != 'G')) {\n      cout << \"error\";\n      c = 0;\n      break;\n    }\n    if (c1[i] == c2[i]) {\n      k++;\n    }\n  }\n  if (c) {\n    p = ((double)k) / ((double)l);\n    if (p > x)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, l;\n  double k;\n  char a[500], b[500];\n  cin >> k;\n  scanf(\"%s\\n%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (!(a[i] == 65 || a[i] == 67 || a[i] == 71 || a[i] == 84) ||\n          !(b[i] == 65 || b[i] == 67 || b[i] == 71 || b[i] == 84)) {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          n = n + 1;\n        }\n        if (i == l - 1) {\n          if (1.0 * n / l >= k) {\n            printf(\"yes\");\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, k = 0;\n  char a[500], b[500];\n  cin >> n >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    int p = 1;\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          k++;\n      } else {\n        p = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (p == 1) {\n      m = (double)k / strlen(a);\n      if (m > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, j;\n  double x, num = 0, len;\n  char c[1];\n  char a[500], b[500];\n\n  cin >> c;\n  x = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      k = 1;\n      break;\n    } else {\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k != 1) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n    } else {\n      for (k = 0; k < strlen(a); k++) {\n        if (a[k] == b[k]) {\n          num = num + 1;\n        }\n      }\n      j = strlen(a);\n      len = 1.00 * j;\n      if ((num / len) <= x) {\n        printf(\"no\");\n      } else {\n        if ((num / len) > x) {\n          printf(\"yes\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double rate, rate0, sum = 0;\n  char line1[501], line2[501];\n  scanf(\"%lf%s%s\", &rate0, line1, line2);\n  len1 = strlen(line1);\n  len2 = strlen(line2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (line1[i] == line2[i])\n        sum++;\n\n      if (line1[i] != 'A' && line1[i] != 'T' && line1[i] != 'G' &&\n              line1[i] != 'C' ||\n          line2[i] != 'A' && line2[i] != 'T' && line2[i] != 'G' &&\n              line2[i] != 'C') {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    rate = 1.0 * sum / len1;\n    if (rate >= rate0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  char a[10000], b[10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int l = strlen(a), k = 0;\n  for (int i = 0; i < l; i++) {\n    if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  double j;\n  j = 1.0 * k / l;\n  if (j > m) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m = 0.0;\n  int t, i, r;\n  double n;\n  scanf(\"%lf\", &n);\n  char z[100], c[100];\n  scanf(\"%s\", z);\n  scanf(\"%s\", c);\n  t = strlen(z);\n  r = strlen(c);\n  if (t != r) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < t; i++) {\n      if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n        cout << \"error\";\n        return 0;\n      }\n      if (z[i] == c[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / t > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7879", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, d, e, f, r;\n  double a, g;\n  r = 0;\n  scanf(\"%lf\", &a);\n  char b[501], c[501];\n  for (i = 0; i < 2; i++) {\n    if (i == 0) {\n      cin >> b;\n      m = strlen(b);\n    } else {\n      scanf(\"%s\", c);\n      d = strlen(c);\n    }\n  }\n  if (m >= d) {\n    f = m;\n  } else {\n    f = d;\n  }\n  e = 0;\n  for (i = 0; i < f; i++) {\n    if ((b[i] == 'A' || (b[i] == 'T') || b[i] == 'C' || b[i] == 'G') &&\n        (c[i] == 'A' || (c[i] == 'T') || c[i] == 'C' || c[i] == 'G')) {\n      if (c[i] == b[i]) {\n        e++;\n      }\n    } else {\n      r = 1;\n      break;\n    }\n  }\n  if ((m == d) && (r == 0)) {\n    g = 1.0 * e / m;\n    if (g > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h, f;\n  double n, sum, k;\n  char sz[2][501];\n  cin >> n >> sz[0] >> sz[1];\n  sum = 0;\n  f = 1;\n  j = strlen(sz[0]);\n  h = strlen(sz[1]);\n  if (j != h) {\n    cout << \"error\\n\";\n  } else {\n    for (i = 0; i < j; i++) {\n      if ((sz[0][i] == 'A' || sz[0][i] == 'T' || sz[0][i] == 'C' ||\n           sz[0][i] == 'G') &&\n          (sz[1][i] == 'A' || sz[1][i] == 'T' || sz[1][i] == 'C' ||\n           sz[1][i] == 'G')) {\n        if (sz[0][i] == sz[1][i])\n          sum += 1.0;\n      } else {\n        printf(\"error\\n\");\n        f = 0;\n        break;\n      }\n    }\n    if (f != 0) {\n      k = sum / (j * 1.0);\n      if (k >= n)\n        printf(\"yes\\n\");\n      else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, num = 0, l1, l2, a = 0;\n  double p;\n  char fir[501], sec[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", fir, sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n  if (l1 != l2) {\n    printf(\"error\\n\");\n    a = 1;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((fir[i] != 65 && fir[i] != 67 && fir[i] != 71 && fir[i] != 84) ||\n        (sec[i] != 65 && sec[i] != 67 && sec[i] != 71 && sec[i] != 84)) {\n      if (a == 0) {\n        cout << \"error\\n\";\n        a = 1;\n      }\n      break;\n    }\n    if (fir[i] == sec[i]) {\n      num += 1;\n    }\n  }\n  if (num * 1.0 / l1 >= p && a == 0) {\n    printf(\"yes\\n\");\n  } else if (num * 1.0 / l1 < p && a == 0) {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, n;\n  double m;\n  char a[501], b[501];\n  cin >> m;\n  cin >> a >> b;\n  n = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / n > m) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate;\n  int x1, x2, y = 0, i, flag = 0;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &rate, a, b);\n  x1 = strlen(a);\n  x2 = strlen(b);\n  for (i = 0; i < x1; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < x1; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0 && x1 == x2) {\n    for (i = 0; i < x1; i++) {\n      if (a[i] == b[i]) {\n        y++;\n      }\n    }\n    if ((double)y / (double)x1 > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7884", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[501], sz2[501];\n  int n, i, result = 0, x = 0;\n  double p;\n  cin >> p;\n  scanf(\"%s%s\", sz1, sz2);\n  n = strlen(sz1);\n  for (i = 0; i < n; i++) {\n    if (((sz1[i] != 'A') && (sz1[i] != 'T') && (sz1[i] != 'C') &&\n         (sz1[i] != 'G')) ||\n        ((sz2[i] != 'A') && (sz2[i] != 'T') && (sz2[i] != 'C') &&\n         (sz2[i] != 'G'))) {\n      result = 1;\n      break;\n    } else if (sz1[i] == sz2[i]) {\n      x++;\n    }\n  }\n  if (result == 1) {\n    printf(\"error\\n\");\n  } else if ((1.0 * x / n) > p) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7885", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z = 0, len1, len2;\n  double n;\n  char a[500], b[500];\n  cin >> n >> a >> b;\n\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        z = -1;\n        break;\n      } else {\n        if (a[i] == b[i])\n          z += 1;\n      }\n    }\n    if (z >= 0) {\n      if ((1.0 * z / len1) > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7886", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  double s;\n  int i;\n  int c = 0;\n  double z;\n  double q = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &s);\n  cin >> a >> b;\n  n = strlen(a);\n  m = strlen(b);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      c = 1;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T')\n      c = 1;\n  }\n  if (c == 1 || m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n\n    if (q / n >= s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int n = 0, i, c, d, m = 0;\n  char a[502], b[502];\n  scanf(\"%lf %s %s\", &x, a, b);\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  if (m == 1 || c != d) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i], b[i]; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    y = 1.0 * n / c;\n    if (y > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7888", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, time = 0;\n  double n, p, l, j, k, same = 0;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", &b);\n  j = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < j; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) &&\n        time == 0) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  if (j != k && time == 0) {\n    printf(\"error\");\n    time++;\n  }\n  if (time == 0) {\n    for (i = 0; i < j; i++) {\n      if (a[i] == b[i]) {\n        same++;\n      }\n    }\n    l = strlen(a);\n    p = same / l;\n    if (p > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, n;\n  double s, z;\n  char a[500], b[500];\n  scanf(\"%lf\", &s);\n  cin >> a;\n  scanf(\"%s\", b);\n  l = strlen(a);\n  j = strlen(b);\n  if (l != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  z = (double)k / l;\n  if (z >= s) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10000], b[10000];\n  int c, d, m = 0, z = 0;\n  double e, f, g, h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G'))\n      z++;\n  }\n  for (int i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n      z++;\n    }\n  }\n\n  c = strlen(a);\n  d = strlen(b);\n  if (c == d) {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    f = m;\n    g = c;\n    e = f / g;\n    if (e >= h && z == 2 * c) {\n      printf(\"yes\");\n    } else if (e < h && z == 2 * c) {\n      printf(\"no\");\n    }\n  }\n  if (c != d || z != 2 * c)\n    cout << \"error\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "7891", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[2][501];\n  double n;\n  double sum = 0, x, Len;\n  int len, i, len2, j;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s[0], s[1]);\n  len = strlen(s[0]);\n  len2 = strlen(s[1]);\n  if (len != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; j < len; j++) {\n        if (s[i][j] != 'A' && s[i][j] != 'T' && s[i][j] != 'G' &&\n            s[i][j] != 'C') {\n          printf(\"error\");\n          return 0;\n        } else\n          continue;\n      }\n    }\n  }\n\n  for (i = 0; i < len; i++) {\n    if (s[0][i] == s[1][i])\n      sum = sum + 1;\n  }\n  Len = (double)len;\n  x = sum / Len;\n  if (x >= n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA1[501], DNA2[501];\n  scanf(\"%s%s\", DNA1, DNA2);\n  int i, k = 0, len1 = strlen(DNA1), len2 = strlen(DNA2), m1 = 0, m2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' && DNA1[i] != 'T') {\n      m1++;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' && DNA2[i] != 'T') {\n      m2++;\n      break;\n    }\n  }\n  if (len1 != len2 || m1 == 1 || m2 == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        k++;\n      }\n    }\n    double p = 1.0 * k / len1;\n    if (p > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char yuanshi[500], bijiao[500], laji[3];\n  double cankao, shiji;\n  int jishu = 0, i, m, n, panduan = 0;\n  scanf(\"%lf\", &cankao);\n\n  cin >> laji;\n\n  cin >> yuanshi;\n\n  cin >> bijiao;\n  m = strlen(yuanshi);\n  n = strlen(bijiao);\n  for (i = 0; i < m; i++) {\n    if (yuanshi[i] == bijiao[i])\n      jishu++;\n    if (yuanshi[i] != 'A' && yuanshi[i] != 'T' && yuanshi[i] != 'G' &&\n        yuanshi[i] != 'C' && yuanshi[i] != '\u0000')\n      panduan++;\n    if (bijiao[i] != 'A' && bijiao[i] != 'T' && bijiao[i] != 'G' &&\n        bijiao[i] != 'C' && bijiao[i] != '\u0000')\n      panduan++;\n  }\n  if (m != n || panduan != 0) {\n\n    printf(\"error\");\n  } else if (m == n && panduan == 0) {\n    shiji = jishu * 1.0 / m;\n    if (shiji > cankao)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7894", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double bill;\n  scanf(\"%lf\", &bill);\n\n  char s1[500] = {0};\n  char s2[500] = {0};\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n\n  int lens1, lens2, flag;\n  flag = 0;\n  lens1 = strlen(s1);\n  lens2 = strlen(s2);\n  if (lens1 != lens2) {\n    printf(\"error\");\n    flag = 1;\n  }\n\n  int i;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] != 'A') {\n        if (s1[i] != 'T') {\n          if (s1[i] != 'C') {\n            if (s1[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (flag == 0) {\n    for (i = 0; i < lens2; i++) {\n      if (s2[i] != 'A') {\n        if (s2[i] != 'T') {\n          if (s2[i] != 'C') {\n            if (s2[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  double num, avg;\n  num = 0;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] == s2[i]) {\n        num++;\n      }\n    }\n    avg = num / (double)lens1;\n    if (avg > bill)\n      printf(\"yes\");\n\n    if (avg <= bill) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z;\n  char sz1[500];\n  char sz2[500];\n  int i, m, n;\n  int x = 1, y = 0;\n  double e;\n  scanf(\"%lf\", &z);\n  scanf(\"%s\", sz1);\n  cin >> sz2;\n  m = strlen(sz1);\n  n = strlen(sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    if (sz1[i] == 'A' || sz1[i] == 'G' || sz1[i] == 'C' || sz1[i] == 'T') {\n      continue;\n    } else if (sz1[i] != 'A' || sz1[i] != 'G' || sz1[i] != 'C' ||\n               sz1[i] != 'T') {\n      x = 0;\n      break;\n    }\n  }\n  if ((m != n) || (x == 0)) {\n    printf(\"error\");\n  } else if (m == n && x == 1) {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if (sz1[i] == sz2[i]) {\n        y++;\n      }\n    }\n    e = 1.0 * y / m;\n    if (e > z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, p;\n  int i, l, k = 0, c = 1;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  scanf(\"%s\", c1);\n  scanf(\"%s\", c2);\n  l = strlen(c1);\n  for (i = 0; i < l; i++) {\n    if ((c1[i] != 'A') && (c1[i] != 'T') && (c1[i] != 'C') && (c1[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if ((c2[i] != 'A') && (c2[i] != 'T') && (c2[i] != 'C') && (c2[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if (c1[i] == c2[i]) {\n      k++;\n    }\n  }\n  if (c) {\n    p = ((double)k) / ((double)l);\n    if (p > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[501];\n  char s2[501];\n  double p, q;\n  int m, n, j, k = 0;\n  scanf(\"%lf\", &p);\n\n  scanf(\"%s%s\", s1, s2);\n  m = strlen(s1);\n  n = strlen(s2);\n  for (j = 0; s1[j], s2[j]; j++) {\n    if (!(s1[j] == 'A' || s1[j] == 'T' || s1[j] == 'G' || s1[j] == 'C') ||\n        !(s2[j] == 'A' || s2[j] == 'T' || s2[j] == 'G' || s2[j] == 'C') ||\n        m != n) {\n      k = m + 1;\n      break;\n    } else if (s1[j] == s2[j])\n      k++;\n  }\n  q = 1.0 * k / m;\n  if (k == m + 1)\n    cout << \"error\";\n  else if (q > p)\n    cout << \"yes\";\n  else if (q <= p)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len1, len2, i, count = 0, error = 0;\n  double line;\n  char str1[600], str2[600];\n  scanf(\"%lf\", &line);\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n\n  if (len1 != len2) {\n    printf(\"error \");\n    return 0;\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' && str1[i] != 'T')\n      error++;\n    if (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' && str2[i] != 'T')\n      error++;\n\n    if (str1[i] != str2[i])\n      count++;\n  }\n\n  if (error)\n    printf(\"error \");\n  else {\n    if ((double)(len1 - count) / len1 > line)\n      printf(\"yes \");\n    else\n      printf(\"no \");\n  }\n}\n"}
{"label": "5", "index": "7899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  float l1, l2;\n  float n, count = 0, result;\n  char x[505], y[505];\n  scanf(\"%f\", &n);\n  getchar();\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == y[i])\n      count++;\n  }\n  result = count / l1;\n  if (result > n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  char s[501];\n  char t[501];\n  int m, n, i, k = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &t);\n  m = strlen(s);\n  n = strlen(t);\n  if (m != n)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n          (t[i] != 'A' && t[i] != 'G' && t[i] != 'C' && t[i] != 'T')) {\n        k = -1;\n        break;\n      } else if (s[i] == t[i]) {\n        k++;\n      }\n    }\n    if (k == -1) {\n      cout << \"error\";\n    } else if ((1.0 * k / n) > r) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7901", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, len, n = 0, x, y;\n  double m, p;\n  scanf(\"%lf \", &m);\n  cin >> a >> b;\n  x = strlen(a);\n  y = strlen(b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] > 'Z' || a[i] < 'A') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (x != y)\n    printf(\"error\");\n  else {\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n\n    p = (double)n / len;\n    if (p > m) {\n      printf(\"yes\");\n    } else if (p <= m)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7902", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x, y;\n  char a[501], b[501];\n  int i, t = 0, m = 0, n = 0, mark = 1;\n  scanf(\"%lf\", &x);\n  getchar();\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; a[i]; i++) {\n    m = m + 1;\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n      mark = 0;\n  }\n  for (i = 0; b[i]; i++) {\n    n = n + 1;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      mark = 0;\n  }\n  if (m != n || mark == 0)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i])\n        t = t + 1;\n    }\n    y = t / (double)m;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c, d, e = 0, t = 0;\n  double n, m;\n  char a[501], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n  if (t > 0) {\n    cout << \"error\";\n  } else {\n    if (t == 0) {\n      if (c == d) {\n        for (i = 0; a[i] != '\\0'; i++) {\n          if (a[i] == b[i])\n            e++;\n        }\n        m = e * 1.0 / c;\n        if (m > n) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      } else {\n        printf(\"error\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, summ;\n  double bl, sjbl, s, sum;\n  s = 0;\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  sum = strlen(a);\n  summ = strlen(b);\n  if (sum != summ) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < sum; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n  }\n  sjbl = s / sum;\n  if (sjbl > bl) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[505], b[505];\n  int i, j, m, sum = 0, SUM = 0;\n  double e, n;\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        SUM++;\n      } else if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    if (SUM != 0) {\n      printf(\"error\");\n    } else {\n      m = strlen(a);\n      e = (double)sum / m;\n      if (e > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7906", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, e = 0;\n  int i, d = 0, f, g;\n  char b[500], c[500];\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  f = strlen(b);\n  g = strlen(c);\n  if (f != g) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < g; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] == c[i])\n      d++;\n  }\n  e = 1.0 * d / g;\n\n  if (e >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if ((b[0][j] != 'A' && b[0][j] != 'T' && b[0][j] != 'C' &&\n         b[0][j] != 'G') ||\n        (b[1][j] != 'T' && b[1][j] != 'G' && b[1][j] != 'C' &&\n         b[1][j] != 'A')) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        cout << \"no\";\n      } else\n        printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, p;\n  double n, m = 0, b;\n  char d[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", d);\n  scanf(\"%s\", f);\n  l = strlen(d);\n  p = strlen(f);\n  if (l != p) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; d[i]; i++) {\n    if (!(d[i] == 'A' || d[i] == 'T' || d[i] == 'G' || d[i] == 'C')) {\n      printf(\"error\");\n\n      return 0;\n    }\n  }\n  for (i = 0; f[i]; i++) {\n    if (!(f[i] == 'A' || f[i] == 'T' || f[i] == 'G' || f[i] == 'C')) {\n      printf(\"error\");\n\n      return 0;\n    }\n  }\n  for (i = 0; d[i]; i++) {\n    if (d[i] == f[i])\n      m++;\n  }\n  b = m / l;\n  if (b >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, c = 0;\n  int i, n, b = 0;\n  char q[500], w[500], num[50];\n\n  cin >> num;\n  a = atof(num);\n\n  cin >> q;\n\n  scanf(\"%s \", w);\n  n = strlen(q);\n  for (i = 0; i < n; i++) {\n    if (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G') {\n      b++;\n    }\n    if (w[i] != 'A' && w[i] != 'T' && w[i] != 'C' && w[i] != 'G') {\n      b++;\n    }\n  }\n  if (b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (q[i] == w[i]) {\n        c++;\n      }\n    }\n    c = c / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i, a;\n  double w, n;\n  x = 0;\n  y = 0;\n  n = 0;\n  a = 0;\n  char sz[500], s[500];\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", sz);\n  scanf(\"%s\", s);\n  for (i = 0; sz[i] != '\\0'; i++) {\n    x++;\n  }\n  for (i = 0; s[i] != '\\0'; i++) {\n    y++;\n  }\n  if (x != y) {\n    a = 1;\n  } else if (x == y) {\n    for (i = 0; sz[i] != '\\0'; i++) {\n      if (sz[i] == 'A' || sz[i] == 'C' || sz[i] == 'T' || sz[i] == 'G') {\n        if (sz[i] == s[i]) {\n          n = n + 1;\n        } else if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n          a = 1;\n        }\n      } else if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        a = 1;\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"error\");\n  } else if (a == 0) {\n    n = 1.0 * n / x;\n    if (n >= w) {\n      printf(\"yes\");\n    } else if (n < w) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, d, l, h;\n  double n, t;\n  char a[500], b[500];\n  scanf(\"%lf \", &n);\n  d = 0;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(a);\n  h = strlen(b);\n  if (l > h || l < n) {\n    printf(\"error\");\n  } else if (l == h) {\n    for (i = 0, j = 0; a[i] != '\u0000'; i++, j++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (a[i] == b[j]) {\n          d++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    t = (double)d / l;\n    if (t > n) {\n      printf(\"yes\");\n    } else if (t <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0, d = 0;\n  double x, y = 0;\n  char s[501], z[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  for (i = 0; i < 501; i++) {\n    if (s[i] == '\\0') {\n      break;\n    }\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n        (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (j = 1; j < 501; j++) {\n    if (s[j] == '\\0') {\n      break;\n    }\n  }\n  a = j;\n  for (j = 1; j < 501; j++) {\n    if (z[j] == '\\0') {\n      break;\n    }\n  }\n  b = j;\n  if (c == 1 || a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (s[i] == z[i]) {\n      d++;\n    }\n  }\n  y = (d - 1) * 1.0 / (a - 1);\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m = 0.0;\n  int t, i, r;\n  double n;\n  scanf(\"%lf\", &n);\n  char z[100], c[100];\n  scanf(\"%s\", z);\n  scanf(\"%s\", c);\n  t = strlen(z);\n  r = strlen(c);\n  if (t != r) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < t; i++) {\n      if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (z[i] == c[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7914", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double r, s;\n  int i;\n  char a[501], b[501];\n  char c, d;\n  scanf(\"%lf %c %s %c %s \", &r, &c, a, &d, b);\n  s = 0;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s / strlen(a) >= r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, s = 0;\n  int len, lon, i, z;\n  char a[750], b[750];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  z = 1;\n  len = strlen(a);\n  lon = strlen(b);\n  if (len != lon) {\n    z = 0;\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (z == 1) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n      double x = s / len;\n      if (x > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, s = 0, j = 1;\n  double r;\n  char d1[501], d2[501];\n  scanf(\"%lf %s %s\", &r, d1, d2);\n  if (strlen(d1) != strlen(d2)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] != 'A' && d1[i] != 'C' && d1[i] != 'G' && d1[i] != 'T' &&\n          d2[i] != 'A' && d2[i] != 'G' && d2[i] != 'C' && d2[i] != 'T') {\n        j = 0;\n        printf(\"error\");\n        break;\n      } else if (d1[i] == d2[i]) {\n        s++;\n      }\n    }\n    if (j == 1) {\n      if (1.0 * s / strlen(d1) > r) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501] = {'\\0'}, b[501] = {'\\0'};\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    int count = 0, so = 0;\n    double rate;\n    for (int i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        count++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        so = 100;\n        break;\n      }\n    }\n    if (so != 100) {\n      rate = count * 1.0 / x;\n      if (rate > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(char x) {\n  if (x == 'A' || x == 'T' || x == 'G' || x == 'C')\n    return 0;\n  else\n    return 1;\n}\nint main(int argc, char *argv[]) {\n  char a[501], b[501];\n  int x = 0, i, y = 1;\n  float p;\n  cin >> p;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 1; i <= strlen(a); i++)\n    if (f(a[i - 1]))\n      y = 0;\n  for (i = 1; i <= strlen(b); i++) {\n    if (f(b[i - 1]))\n      y = 0;\n  }\n  if (strlen(a) != strlen(b))\n    y = 0;\n  if (y == 0)\n    printf(\"error\");\n  else {\n    for (i = 1; i <= strlen(a); i++)\n      if (a[i - 1] == b[i - 1])\n        x++;\n    if (x > p * strlen(a))\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, j, n = 0, sum = 0, t = 0;\n  float k, c;\n  char a[500], b[500];\n  scanf(\"%f \", &k);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    t = 1;\n  }\n\n  if (t == 0) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (t == 0) {\n        if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (j = 0; b[j] != '\\0'; j++) {\n      if (t == 0) {\n        if (b[j] != 65 && b[j] != 71 && b[j] != 67 && b[j] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (l = 0; a[l] != '\\0'; l++) {\n      sum++;\n      if (a[l] == b[l])\n        n++;\n    }\n    c = (float)n / sum;\n    if (c > k) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7920", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, a, b;\n\n  double n = 0, r;\n\n  char x[500], y[500], z;\n\n  scanf(\"%lf%c\", &r, &z);\n\n  cin >> x;\n\n  a = strlen(x);\n\n  cin >> y;\n\n  b = strlen(y);\n\n  if (a != b) {\n\n    printf(\"error\");\n\n  }\n\n  else {\n\n    for (i = 0; i < a; i++) {\n\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n\n        printf(\"error\");\n\n        n = -1;\n        break;\n\n      }\n\n      else {\n\n        if (x[i] == y[i]) {\n\n          n++;\n        }\n      }\n    }\n    n = n / a;\n\n    if (n > r) {\n\n      printf(\"yes\");\n\n    }\n\n    else if (n >= 0) {\n\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, sum = 0, m, n;\n  double x;\n  cin >> x;\n  char c1[501], c2[501];\n  scanf(\"%s\", c1);\n  scanf(\"%s\", c2);\n  m = strlen(c1);\n  n = strlen(c2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((c1[i] != 'A' && c1[i] != 'T' && c1[i] != 'C' && c1[i] != 'G') ||\n          (c2[i] != 'A' && c2[i] != 'T' && c2[i] != 'C' && c2[i] != 'G')) {\n        sum++;\n      }\n    }\n    if (sum != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < m; i++) {\n        if (c1[i] == c2[i]) {\n          sum++;\n        }\n      }\n      if ((double)sum / m > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else if (m != n) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, b, s = 0, j, a;\n  double r, R;\n  char gene[500], gene2[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", gene);\n  scanf(\"%s\", gene2);\n  b = strlen(gene2);\n  a = strlen(gene);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (gene[i] != 'A' && gene[i] != 'T' && gene[i] != 'C' && gene[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n        gene2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (gene[i] == gene2[i]) {\n      s++;\n    }\n  }\n  R = 1.000 * s / b;\n  if (R > r) {\n    printf(\"yes\");\n  } else if (R <= r) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int i, a, b;\n\n  double n = 0, r;\n\n  char x[500], y[500], z;\n\n  scanf(\"%lf%c\", &r, &z);\n\n  cin >> x;\n\n  a = strlen(x);\n\n  cin >> y;\n\n  b = strlen(y);\n\n  if (a != b) {\n\n    cout << \"error\";\n\n  }\n\n  else {\n\n    for (i = 0; i < a; i++) {\n\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n\n        printf(\"error\");\n\n        n = -1;\n        break;\n\n      }\n\n      else {\n\n        if (x[i] == y[i]) {\n\n          n++;\n        }\n      }\n    }\n    n = n / a;\n\n    if (n > r) {\n\n      printf(\"yes\");\n\n    }\n\n    else if (n >= 0) {\n\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7924", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b, n;\n  int i;\n  char A[1000], B[1000];\n  cin >> n;\n  scanf(\"%s\\n%s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0, b = 0; i < a; i++) {\n    if ((A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') ||\n        (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (A[i] == B[i]) {\n      b++;\n    }\n  }\n  a = b / a;\n  if (a >= n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, s, i;\n  double p, l;\n  cin >> p;\n  char m[500], n[500];\n  scanf(\"%s\", m);\n  scanf(\"%s\", n);\n  a = strlen(m);\n  b = strlen(n);\n  s = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G') ||\n          (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n        printf(\"error\");\n        s = 1;\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n    s = 1;\n  }\n  if (s == 0) {\n    for (i = 0; i < a; i++) {\n      if (m[i] == n[i]) {\n        s = s + 1;\n      }\n    }\n    l = s * 1.0 / a;\n    if (l > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double n, c = 0, d, l, k;\n  int i, h = 0;\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  l = strlen(a);\n  k = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    if (k != l || a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n\n      printf(\"error\");\n      h = 1;\n      break;\n    } else if (a[i] == b[i])\n      c = c + 1;\n  }\n  d = c / l;\n  if (d > n)\n    cout << \"yes\";\n  else if (h == 0 && d <= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int x, y;\n  int i, s = 0, q = 0;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n    t = n * x;\n    if (s > t) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  double n = 0, biao, l = 1, len;\n  char shuzu[3][501];\n  scanf(\"%lf\", &biao);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%s\", shuzu[i]);\n  }\n  len = 1.0 * strlen(shuzu[0]);\n  if (strlen(shuzu[0]) - strlen(shuzu[1]))\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (!((shuzu[0][i] == 'A' || shuzu[0][i] == 'G' || shuzu[0][i] == 'C' ||\n             shuzu[0][i] == 'T') &&\n            (shuzu[1][i] == 'A' || shuzu[1][i] == 'G' || shuzu[1][i] == 'C' ||\n             shuzu[1][i] == 'T'))) {\n        l = 0;\n      }\n      if (shuzu[0][i] == shuzu[1][i])\n        n++;\n    }\n    if (l) {\n      if ((n / len) > biao)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n\n    } else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, j, k, kong = 1;\n  float n, t = 0, l1, l2;\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      j = a[i];\n      k = b[i];\n      if ((j != 'A' && j != 'T' && j != 'G' && j != 'C') ||\n          (k != 'A' && k != 'T' && k != 'G' && k != 'C')) {\n        cout << \"error\";\n        kong = 0;\n        break;\n      }\n    }\n    if (kong == 1) {\n      for (i = 0; i < l1; i++) {\n\n        if (a[i] == b[i]) {\n          t = t + 1;\n        }\n      }\n\n      if (t / l1 > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7930", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n, r;\n  int m = 0, i, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x = strlen(a);\n  int y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (!(((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') ||\n             (a[i] == 'G')) &&\n            ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') ||\n             (b[i] == 'G')))) {\n\n        s++;\n      }\n    }\n\n    if (s != 0)\n      printf(\"error\");\n    else {\n      for (i = 0; i < x; i++) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n      r = 1.0 * m / x;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7931", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double s;\n  char sz1[500];\n  char sz2[500];\n  int i, n = 0;\n  int len1, len2;\n  double num;\n  scanf(\"%lf %s %s \", &s, sz1, sz2);\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'C' && sz1[i] != 'G') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'C' && sz2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (sz1[i] == sz2[i]) {\n        n++;\n      }\n    }\n    num = 1.0 * n / len1;\n    if (num > s) {\n      printf(\"yes\");\n      return 0;\n    } else {\n      printf(\"no\");\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7932", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d;\n  double n;\n  char xl1[500], xl2[500];\n  c = 0;\n  cin >> n;\n  cin >> xl1 >> xl2;\n  a = strlen(xl1);\n  b = strlen(xl2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'G' && xl1[i] != 'C') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'G' && xl2[i] != 'C')) {\n        printf(\"error\");\n        d = 0;\n        break;\n      } else {\n        if (xl1[i] == xl2[i]) {\n          c++;\n        }\n      }\n    }\n    if (1.0 * c / a > n && d != 0) {\n      printf(\"yes\");\n    } else if (1.0 * c / a <= n && d != 0) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, f, i, g, p = 1;\n  double x;\n  char s[501], t[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  f = strlen(s);\n  g = strlen(t);\n  if (f != g)\n    p = 0;\n  else {\n    for (i = 0; i < f; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'G' && t[i] != 'C'))\n        p = 0;\n    }\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < f; i++) {\n      if (t[i] == s[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / f > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7934", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  char a[501], b[501];\n  cin >> rate;\n  scanf(\"%s%s\", a, b);\n  int lena, lenb;\n  lena = strlen(a);\n  lenb = strlen(b);\n  int sum = 0;\n  int zq = 0;\n  if (lena == lenb) {\n    int i;\n\n    for (i = 0; i < lena; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n        if (a[i] == b[i]) {\n          sum++;\n        }\n        zq++;\n\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  double r;\n  r = 1.0 * sum / lena;\n  if (zq == lena) {\n    if (r > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double xgd, bz;\n  int l, i, count;\n  char dna1[110], dna2[110];\n  count = 0;\n  scanf(\"%lf\", &bz);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if (!(dna1[i] == 'A' || dna1[i] == 'G' || dna1[i] == 'C' ||\n          dna1[i] == 'T') ||\n        !(dna2[i] == 'A' || dna2[i] == 'G' || dna2[i] == 'C' ||\n          dna2[i] == 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (dna1[i] == dna2[i])\n      count++;\n  }\n  xgd = 1.0 * count / l;\n  if (xgd >= bz) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7936", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n, m = 0;\n  char dna1[1000 + 1], dna2[1000 + 1];\n  int len1 = 0, len2 = 0, count = 0, i = 0;\n  scanf(\"%lf%s%s\", &n, dna1, dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  \n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n           dna1[i] != 'G') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n           dna2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (dna1[i] != dna2[i]) {\n        count++;\n      }\n    }\n    \n    m = (double)count / len1;\n    \n    if ((1 - m) >= n) {\n      printf(\"yes\");\n    }\n    if ((1 - m) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float rate, rate0;\n  int sum = 0, len1, len2, i, tag = 0;\n  char base1[501], base2[501];\n  cin >> rate >> base1 >> base2;\n  len1 = strlen(base1);\n  len2 = strlen(base2);\n  if (len1 != len2) {\n    tag = 1;\n    goto pku;\n  }\n  for (i = 0; i < len1; i++) {\n    if (base1[i] != 'A' && base1[i] != 'T' && base1[i] != 'C' &&\n            base1[i] != 'G' ||\n        base2[i] != 'A' && base2[i] != 'T' && base2[i] != 'C' &&\n            base2[i] != 'G') {\n      tag = 1;\n      goto pku;\n    }\n    if ((int)base1[i] == (int)base2[i])\n      sum++;\n    else\n      continue;\n  }\n  rate0 = (float)sum / len1;\n  if (rate0 > rate)\n    cout << \"yes\";\n  else\n    printf(\"no\");\npku:\n  if (tag)\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, c, d, e = 0, t = 0;\n  double n, m;\n  char a[501], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n  if (t > 0) {\n    printf(\"error\");\n  } else if (t == 0) {\n    if (c == d) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i])\n          e++;\n      }\n      m = e * 1.0 / c;\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  char b[500], c[500];\n  double s = 0;\n  int i;\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", b, c);\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G' &&\n        c[i] != 'A' && c[i] != 'C' && c[i] != 'T' && c[i] != 'G')\n      s = 1;\n  }\n  if (s == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  s = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == c[i])\n      s++;\n  }\n  if (s / strlen(b) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "7940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501];\n  char s[501];\n  int i, c = 0, d = 0, e = 0, p = 0;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", s);\n  for (i = 0; s[i] != '\\0'; i++) {\n    p = p + 1;\n    if ((s[i] != 'A') && (s[i] != 'T') && (s[i] != 'C') && (s[i] != 'G')) {\n      e = e + 1;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c = c + 1;\n    if (a[i] == s[i]) {\n      d = d + 1;\n    }\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      e = 1;\n    }\n  }\n  if (p != c) {\n    e = 1;\n  }\n  if (e == 1) {\n    printf(\"error\");\n  } else if ((1.0 * d / c) > k) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int m, n, i, c = 0;\n  int r = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (m != n) {\n    c = 3;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i]) {\n      r++;\n    }\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')) {\n      c = 3;\n      break;\n    }\n  }\n  y = 1.0 * r / n;\n  if ((y > x) && (c == 0)) {\n    printf(\"yes\");\n  }\n  if ((y <= x) && (c == 0)) {\n    printf(\"no\");\n  }\n  if (c == 3) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m, n, r;\n  int a, b, c;\n  int i, j;\n  char d1[600];\n  char d2[600];\n  cin >> m;\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  a = strlen(d1);\n  b = strlen(d2);\n  c = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (((d1[i] != 'A') && (d1[i] != 'T') && (d1[i] != 'C') &&\n           (d1[i] != 'G')) ||\n          ((d2[i] != 'A') && (d2[i] != 'T') && (d2[i] != 'C') &&\n           (d2[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (d1[i] == d2[i]) {\n          c++;\n        }\n      }\n      r = 1.0 * c / a;\n    }\n    if (r > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  cin >> n;\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if ((b[0][j] != 'A' && b[0][j] != 'T' && b[0][j] != 'C' &&\n         b[0][j] != 'G') ||\n        (b[1][j] != 'T' && b[1][j] != 'G' && b[1][j] != 'C' &&\n         b[1][j] != 'A')) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k = 1, l, e;\n  char s[501], g[501];\n  double n, r;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s, g);\n  l = strlen(s);\n  e = strlen(g);\n  if (l != e) {\n    cout << \"error\";\n  } else {\n    for (i = 0; s[i]; i++) {\n      if (((s[i] == 'A') || (s[i] == 'T') || (s[i] == 'C') || (s[i] == 'G')) &&\n          ((g[i] == 'A') || (g[i] == 'T') || (g[i] == 'C') || (g[i] == 'G'))) {\n        if (g[i] == s[i]) {\n          k++;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      k--;\n      r = 1.0 * k / l;\n      if (r > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double q, c;\n  int t, s, i, l1, l2;\n  char a[501], b[501];\n  scanf(\"%lf\", &q);\n  scanf(\"%s%s\", a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    t = 0;\n    for (i = 0; i < l1; i++)\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        t = 1;\n        break;\n      }\n    if (t == 0) {\n      s = 0;\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s = s + 1;\n      c = 1.0 * s / l1;\n      if (c > q)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7946", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0, b, c;\n  char zfc[2][501];\n  scanf(\"%lf \", &a);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  b = strlen(zfc[0]);\n  c = strlen(zfc[1]);\n  if (b != c) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; zfc[0][i] != '\\0'; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (zfc[0][i] == zfc[1][i]) {\n        j++;\n      }\n    }\n  }\n  if ((double)1.0 * j / strlen(zfc[0]) > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, k, sum = 0, i, t = 0;\n  double x, y;\n  char jz[500], a[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s \", jz, a);\n  len = strlen(jz);\n  k = strlen(a);\n  if (k != len)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (jz[i] != 'T' && jz[i] != 'A' && jz[i] != 'C' && jz[i] != 'G' &&\n          a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        t = 1;\n        break;\n      }\n      if (jz[i] == a[i])\n        sum++;\n    }\n    y = 1.0 * sum / len;\n    if (t == 0) {\n      if (y >= x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, n, L, t;\n  double q, p;\n  char a[501], b[501];\n  n = 0;\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  L = strlen(b);\n\n  if (l != L) {\n    printf(\"error\\n\");\n  } else {\n    t = 1;\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    if (t == 1) {\n      q = 1.0 * n / l;\n      if (q > p)\n        printf(\"yes\\n\");\n      else {\n        printf(\"no\\n\");\n      }\n    }\n    if (t == 0) {\n      printf(\"error\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double s, t;\n  int m, n, flag = 0;\n  int e = 0;\n  char a[1000], b[1000];\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  for (int p = 0; p < m; p++) {\n    if (a[p] == 'A' || a[p] == 'G' || a[p] == 'C' || a[p] == 'T') {\n      flag = 0;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((m != n) || (flag == 1)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    t = 1.0 * e / n;\n    if (t > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0, e, f;\n  double n, m, k = 0;\n  char num[2][1000];\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    cin >> num[i];\n  }\n  e = strlen(num[0]);\n  f = strlen(num[1]);\n  for (i = 0; i < 2; i++) {\n    m = strlen(num[i]);\n    for (j = 0; j < m; j++) {\n      if (((num[i][j] != 'A') && (num[i][j] != 'C') && (num[i][j] != 'G') &&\n           (num[i][j] != 'T')) ||\n          (e != f)) {\n        cout << \"error \";\n        l++;\n        break;\n      }\n    }\n    if (l > 0) {\n      break;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    if (l == 0) {\n      if (num[0][j] == num[1][j]) {\n        k++;\n      }\n    }\n  }\n  if ((l == 0) && (k / m) > n) {\n    printf(\"yes \");\n  } else if ((l == 0) && (k / m) <= n) {\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7951", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[1000 + 1];\n  char b[1000 + 1];\n  int p, q, i, j, x = 0, y = 0, l = 0;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  cin >> b;\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    printf(\"error\");\n  }\n  if (p == q) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        x++;\n        break;\n      }\n    }\n    for (j = 0; b[j]; j++) {\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G' && x == 0) {\n        printf(\"error\");\n        y++;\n        break;\n      }\n    }\n  }\n  if (p == q && x == 0 && y == 0) {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        l++;\n      }\n    }\n    if (l * 1.0 / p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, m, c, r, k;\n  double n, y;\n  char a[502], b[502];\n  x = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  c = strlen(b);\n  r = 1;\n  k = 1;\n  if (m != c) {\n    k = 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n        b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n      r = 1;\n    } else {\n      r = 0;\n    }\n    if (r == 0 || k == 0) {\n      printf(\"error\");\n      break;\n    }\n  }\n  if (r == 1 && k == 1) {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = 1.0 * x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float rate, rate0;\n  int sum = 0, len1, len2, i, tag = 0;\n  char base1[501], base2[501];\n  scanf(\"%f %s %s \", &rate, base1, base2);\n  len1 = strlen(base1);\n  len2 = strlen(base2);\n  if (len1 != len2) {\n    tag = 1;\n    goto pku;\n  }\n  for (i = 0; i < len1; i++) {\n    if (base1[i] != 'A' && base1[i] != 'T' && base1[i] != 'C' &&\n            base1[i] != 'G' ||\n        base2[i] != 'A' && base2[i] != 'T' && base2[i] != 'C' &&\n            base2[i] != 'G') {\n      tag = 1;\n      goto pku;\n    }\n    if ((int)base1[i] == (int)base2[i])\n      sum++;\n    else\n      continue;\n  }\n  rate0 = (float)sum / len1;\n  if (rate0 > rate)\n    cout << \"yes\";\n  else\n    cout << \"no\";\npku:\n  if (tag)\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "7954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, j, c, b;\n  double n;\n  char sz1[1000], sz2[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    c = i;\n  }\n  for (j = 0; sz2[j] != '\\0'; j++) {\n    b = j;\n  }\n  if (c != b) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'C' && sz1[i] != 'G' && sz1[i] != 'T') ||\n          (sz2[i] != 'C' && sz2[i] != 'A' && sz2[i] != 'G' && sz2[i] != 'T')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (j = 0; sz1[j] != '\\0'; j++) {\n      if (sz1[j] == sz2[j] &&\n          (sz1[j] == 'A' || sz1[j] == 'C' || sz1[j] == 'G' || sz1[j] == 'T') &&\n          (sz2[j] == 'C' || sz2[j] == 'A' || sz2[j] == 'G' || sz2[j] == 'T')) {\n        a++;\n      }\n    }\n  }\n  if (1.0 * a / (c + 1) > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x = 0;\n  double n;\n  char su[500], zu[500];\n  cin >> n >> su >> zu;\n  if (strlen(su) != strlen(zu)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(su); i++) {\n    if ((su[i] != 'A' && su[i] != 'T' && su[i] != 'G' && su[i] != 'C') ||\n        (zu[i] != 'A' && zu[i] != 'T' && zu[i] != 'G' && zu[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (su[i] == zu[i]) {\n      x++;\n    }\n  }\n  if (x / (1.0 * strlen(su)) > n) {\n    printf(\"yes\");\n    return 0;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "7956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, x, y, m, t;\n  x = 0;\n  int i, c;\n  c = 0;\n  char a[501], b[501];\n  cin >> n;\n  scanf(\"%s%s\", a, b);\n  m = strlen(a);\n  t = strlen(b);\n  if (m != t) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) &&\n          ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G'))) {\n        if (a[i] == b[i]) {\n          x = x + 1;\n        }\n      } else {\n        c = c + 1;\n      }\n    }\n    y = x / m;\n    if (c > 0) {\n      printf(\"error\");\n    } else {\n      if (y > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  double s;\n  int i;\n  int c = 0;\n\n  double q = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &s);\n  cin >> a >> b;\n  n = strlen(a);\n  m = strlen(b);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      c = 1;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      c = 1;\n    }\n  }\n  if (c == 1 || m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n\n    if (q / n >= s) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, q, n, i, m, l;\n  double p, k;\n  char sz[500], dz[500];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", sz);\n  scanf(\"%s\", dz);\n  m = 0;\n  y = 0;\n  n = 0;\n  l = 0;\n  n = strlen(sz);\n  q = 0;\n  m = strlen(dz);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        y++;\n        cout << \"error\";\n        break;\n      }\n      if (dz[i] != 'A' && dz[i] != 'T' && dz[i] != 'C' && dz[i] != 'G') {\n        l++;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (l == 0 && y == 0) {\n      for (i = 0; i < n; i++) {\n        if (sz[i] == dz[i]) {\n          q++;\n        }\n      }\n      k = 1.0 * q / n;\n      if (k > p) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, lem, len, q;\n  double p, l;\n  char m[501], n[501];\n  scanf(\"%lf\\n\", &p);\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\", n);\n  lem = strlen(m);\n  len = strlen(n);\n  if (lem != len) {\n    printf(\"error\");\n    return 0;\n  } else\n    q = len;\n  int r = 0;\n  for (i = 0; i < q; i++) {\n    if (((m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) ||\n        ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G'))) {\n      printf(\"error\");\n      break;\n    } else if (m[i] == n[i]) {\n      r++;\n    }\n  }\n  if (i == q) {\n    l = 1.0 * r / q;\n    if (l >= p)\n      printf(\"yes\");\n    else if (l < p)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint yn(char x);\nint main() {\n  char a[501], b[501];\n  double q, p;\n  int i, s, l1, l2, o;\n  scanf(\"%lf%s%s\", &p, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  o = 0;\n  if (l1 != l2)\n    o = 1;\n  for (i = 0; i < l1; i++)\n    if (yn(a[i]) == 1) {\n      o = 1;\n      break;\n    }\n  for (i = 0; i < l2; i++)\n    if (yn(b[i]) == 1) {\n      o = 1;\n      break;\n    }\n  if (o == 1)\n    printf(\"error\");\n  else {\n    s = 0;\n    for (i = 0; i < l1; i++)\n      if ((a[i]) == b[i])\n        s = s + 1;\n    q = 1.0 * s / l1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\nint yn(char x) {\n  int a;\n  if ((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))\n    a = 0;\n  else\n    a = 1;\n  return a;\n}\n"}
{"label": "5", "index": "7961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, num = 0, t = 1;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i] &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))\n        num++;\n      else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\"error\");\n    else {\n      if (num * 1.0 / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7962", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w1[256], w2[256];\n  int n, m, i, j = 0, A = 1;\n  double a, c;\n  scanf(\"%lf %s %s \", &a, w1, w2);\n  n = strlen(w1);\n  m = strlen(w2);\n  if (n != m)\n    printf(\"error\");\n  if (n == m) {\n    for (i = 0; i < n; i++) {\n      if ((w1[i] == 'A' && w2[i] == 'A') || (w1[i] == 'G' && w2[i] == 'G') ||\n          (w2[i] == 'T' && w1[i] == 'T') || (w2[i] == 'C' && w1[i] == 'C'))\n        j++;\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        A = 0;\n      }\n    }\n    c = (double)j / n;\n    if (A == 0)\n      printf(\"error\");\n    else {\n      if (A == 1 && c > a)\n        printf(\"yes\");\n      else if (A == 1 && c <= a)\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, same = 0, flag = 1;\n  double n;\n  char a[500], b[500], c[100];\n\n  cin >> c;\n  n = atof(c);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      flag = 0;\n    }\n    if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double m;\n  m = 1.0 * same / strlen(a);\n  if ((strlen(a) != strlen(b)) || flag == 0) {\n    printf(\"error\");\n  } else if (m <= n) {\n    cout << \"no\";\n  } else if (m > n) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  int tag = 1;\n  double xsd;\n  char zfc[2][500];\n  int len;\n  int count = 0;\n  scanf(\"%lf\", &m);\n  for (int i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  len = strlen(zfc[0]);\n  for (int j = 0; j < len; j++) {\n    if ((zfc[0][j] != 'A') && (zfc[0][j] != 'G') && (zfc[0][j] != 'C') &&\n        (zfc[0][j] != 'T')) {\n      tag = 0;\n      break;\n    }\n    if (zfc[0][j] == zfc[1][j]) {\n      count++;\n    }\n  }\n  xsd = (double)count / len;\n  if (tag == 0) {\n    printf(\"error\");\n  } else if (strlen(zfc[0]) != strlen(zfc[1])) {\n    cout << \"error\";\n  }\n\n  else if (xsd > m) {\n    printf(\"yes\");\n  } else if (xsd <= m) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b, n;\n  int i;\n  char A[1000], B[1000];\n  cin >> n;\n  scanf(\"%s\\n%s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0, b = 0; i < a; i++) {\n    if ((A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') ||\n        (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (A[i] == B[i]) {\n      b++;\n    }\n  }\n  a = b / a;\n  if (a >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l;\n  double s, z;\n  char a[500], b[500];\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  j = strlen(b);\n  if (l != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  z = (double)k / l;\n  if (z >= s) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, x;\n  int t = 0, a, b, u = 0;\n  char ji[501], yin[501];\n  cin >> m;\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  a = strlen(ji);\n  b = strlen(yin);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int q = 0; q < a; q++) {\n      if ((ji[q] != 'A' && ji[q] != 'T' && ji[q] != 'C' && ji[q] != 'G') ||\n          (yin[q] != 'A' && yin[q] != 'C' && yin[q] != 'T' && yin[q] != 'G')) {\n        u = 1;\n      }\n    }\n    if (u == 1) {\n      cout << \"error\";\n    } else {\n      for (int h = 0; h < a; h++) {\n        if (ji[h] == yin[h]) {\n          t++;\n        }\n      }\n      x = 1.0 * t / a;\n      if (x > m) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7968", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, x, y, count = 0;\n  double n, m;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", &b);\n  for (i = 0; a[i] != '\\0', b[i] != '\\0'; i++) {\n    x = strlen(a);\n    y = strlen(b);\n    if (x != y) {\n      printf(\"error\\n\");\n\n      return 0;\n      break;\n    }\n    for (j = 0; a[j] != '\\0'; j++) {\n      if (a[j] != 'A' && a[j] != 'T' && a[j] != 'G' && a[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'G' && b[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n    }\n\n    if (a[i] == b[i])\n      count++;\n  }\n  m = ((1.0) * count) / x;\n  if (m >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7969", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b = 0, a, len1, len2, x = 0, c;\n  double bz;\n  char m1[505], m2[505];\n  scanf(\"%lf\", &bz);\n  cin >> m1 >> m2;\n  len1 = strlen(m1);\n  len2 = strlen(m2);\n  if (len1 != len2)\n    x = 1;\n  for (c = 0; c < len1; c++) {\n    if (m1[c] != 'A' && m1[c] != 'T' && m1[c] != 'C' && m1[c] != 'G' ||\n        m2[c] != 'A' && m2[c] != 'T' && m2[c] != 'C' && m2[c] != 'G')\n      x = 1;\n  }\n  if (x) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < len1; a++) {\n      if (m1[a] == m2[a])\n        b++;\n    }\n    if (b * 1.0 / len1 > bz) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7970", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, count;\n  double a, x, y, z;\n  char m[550], n[550];\n  cin >> a >> m >> n;\n  b = strlen(m);\n  c = strlen(n);\n  if (b != c)\n    printf(\"error\");\n  j = 0;\n  if (b == c) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G')\n        j++;\n    }\n    for (i = 0; n[i] != '\\0'; i++) {\n      if (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')\n        j++;\n    }\n    if (j > 0)\n      printf(\"error\");\n  }\n  count = 0;\n  if (b == c && j == 0) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] == n[i])\n        count++;\n    }\n    y = count;\n    z = b;\n    x = z * a;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, r;\n  int i, a, b, c, d, e = 0;\n  char q[501];\n  char w[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", q, w);\n  a = strlen(q);\n  b = strlen(w);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    c = a, d = b;\n    for (i = 0; i < a; i++) {\n      if (q[i] != 'A' && q[i] != 'C' && q[i] != 'G' && q[i] != 'T') {\n        c--;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (w[i] != 'A' && w[i] != 'C' && w[i] != 'G' && w[i] != 'T') {\n        d--;\n      }\n    }\n    if (a != c || b != d) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < a; i++) {\n        if (q[i] == w[i]) {\n          e++;\n        }\n      }\n      r = 1.0 * e / a;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[2][600];\n  double n, m;\n  cin >> n >> a[0];\n  scanf(\"%s\", a[1]);\n  int i, s = 0;\n  m = strlen(a[0]);\n  for (i = 0; i < m; i++) {\n    if ((a[0][i] != 65 && a[0][i] != 67 && a[0][i] != 71 && a[0][i] != 84) ||\n        (a[1][i] != 65 && a[1][i] != 67 && a[1][i] != 71 && a[1][i] != 84)) {\n      printf(\"error\");\n      s = -1;\n      break;\n    } else if (a[0][i] == a[1][i])\n      s++;\n  }\n\n  if (s != -1) {\n    double q;\n    q = s * 1.0 / m;\n    if (q >= n)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7973", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[2][501];\n  double n;\n  double sum = 0, x, Len;\n  int len, i, len2, j;\n  cin >> n;\n  scanf(\"%s%s\", s[0], s[1]);\n  len = strlen(s[0]);\n  len2 = strlen(s[1]);\n  if (len != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; j < len; j++) {\n        if (s[i][j] != 'A' && s[i][j] != 'T' && s[i][j] != 'G' &&\n            s[i][j] != 'C') {\n          printf(\"error\");\n          return 0;\n        } else\n          continue;\n      }\n    }\n  }\n\n  for (i = 0; i < len; i++) {\n    if (s[0][i] == s[1][i])\n      sum = sum + 1;\n  }\n  Len = (double)len;\n  x = sum / Len;\n  if (x >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, e = 0, k, m = 0;\n  double x, y;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i])\n      e++;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      m++;\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      m++;\n  }\n  y = e * 1.0 / n;\n  if (n == k && m == n + k) {\n    if (y >= x)\n      printf(\"yes\");\n    else if (y < x)\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[501], sz2[501];\n  int n, i, result = 0, x = 0;\n  double p;\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", sz1, sz2);\n  n = strlen(sz1);\n  for (i = 0; i < n; i++) {\n    if (((sz1[i] != 'A') && (sz1[i] != 'T') && (sz1[i] != 'C') &&\n         (sz1[i] != 'G')) ||\n        ((sz2[i] != 'A') && (sz2[i] != 'T') && (sz2[i] != 'C') &&\n         (sz2[i] != 'G'))) {\n      result = 1;\n      break;\n    } else if (sz1[i] == sz2[i]) {\n      x++;\n    }\n  }\n  if (result == 1) {\n    cout << \"error\\n\";\n  } else if ((1.0 * x / n) > p) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k = 0, len1, len2, temp = 0;\n  char str1[600], str2[600];\n  double p;\n  cin >> p;\n  cin >> str1 >> str2;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' &&\n           str1[i] != 'G') ||\n          (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n           str2[i] != 'G')) {\n        printf(\"error\");\n        temp = 1;\n        break;\n      }\n      if (str1[i] == str2[i]) {\n        k++;\n      }\n    }\n    if (temp == 0) {\n\n      if (k * 1.0 / len1 > p) {\n        printf(\"yes\");\n      } else if (k * 1.0 / len1 <= p) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "7977", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p = 0, q = 0, judge = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  p = strlen(a);\n  for (i = 0; i < p; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (a[i] == b[i]) {\n      q++;\n    }\n  }\n  if (1.0 * q / p >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7978", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double percent;\n  char a[501], b[501];\n  int number = 0;\n  int i;\n  scanf(\"%lf\", &percent);\n  cin >> a;\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      number++;\n    }\n  }\n  if ((double)number > ((double)strlen(a)) * percent) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7979", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main(int argc, const char *argv[]) {\n  double rate;\n  char gen1[500], gen2[500];\n  cin >> rate >> gen1 >> gen2;\n  int len1 = strlen(gen1), len2 = strlen(gen2), S = 0;\n  if (len1 != len2) {\n    cout << \"error\" << endl;\n    return 0;\n  }\n  for (int i = 0; i < len1; i++) {\n    if ((gen2[i] != 'A' && gen2[i] != 'T' && gen2[i] != 'C' &&\n         gen2[i] != 'G') ||\n        (gen1[i] != 'A' && gen1[i] != 'T' && gen1[i] != 'C' &&\n         gen1[i] != 'G')) {\n      cout << \"error\" << endl;\n      return 0;\n    }\n    if (gen1[i] == gen2[i]) {\n      S++;\n    }\n  }\n  double R;\n  R = (double)S / len1;\n  if (R >= rate) {\n    cout << \"yes\" << endl;\n    return 0;\n  } else {\n    cout << \"no\" << endl;\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bl;\n  double xg;\n  int i, l, e, k, c;\n  char a[501], b[501];\n  cin >> bl >> a >> b;\n  l = strlen(a);\n  k = strlen(b);\n  c = 0;\n  e = 0;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))\n      c = 1;\n  }\n  if (l == k && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    xg = 1.0 * e / l;\n    if (xg > bl) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, w;\n  int i, m, z = 0, e = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i])\n      z++;\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  w = 1.0 * z / m;\n  if (e == 0) {\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float n, f;\n  int l, c, o = 0, k = 0, v = 0;\n  char a[501] = {0}, b[501] = {0};\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  c = strlen(b);\n  for (int q = 0; q < l; q++) {\n    if (a[q] < 'A' || a[q] > 'Z') {\n      o = 1;\n      break;\n    }\n  }\n  for (int p = 0; p < l; p++) {\n    if (b[p] < 'A' || b[p] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (o == 1 || k == 1 || l != c) {\n    printf(\"error\");\n  } else {\n    for (int g = 0; g < c; g++) {\n      if (a[g] == b[g]) {\n        v++;\n      }\n    }\n    f = (float)v / (float)c;\n\n    if (f > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, sum = 0, m, n;\n  double x;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  scanf(\"%s\", c1);\n  scanf(\"%s\", c2);\n  m = strlen(c1);\n  n = strlen(c2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((c1[i] != 'A' && c1[i] != 'T' && c1[i] != 'C' && c1[i] != 'G') ||\n          (c2[i] != 'A' && c2[i] != 'T' && c2[i] != 'C' && c2[i] != 'G')) {\n        sum++;\n      }\n    }\n    if (sum != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < m; i++) {\n        if (c1[i] == c2[i]) {\n          sum++;\n        }\n      }\n      if ((double)sum / m > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else if (m != n) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  char x[1000], y[1000];\n  int i, t, a1, a2, p1, p2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", x);\n  cin >> y;\n  t = 0;\n  a1 = 0;\n  a2 = 0;\n  p1 = 0;\n  p2 = 0;\n  for (i = 0; x[i] != 0; i++) {\n    a1++;\n    if (x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 'A') {\n      p1++;\n    }\n  }\n  for (i = 0; y[i] != 0; i++) {\n    a2++;\n    if (y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 'A') {\n      p2++;\n    }\n  }\n  if (p1 > 0 || p2 > 0 || a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; y[i] != 0; i++) {\n      if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (1.0 * t / a1 > b) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, j;\n  double x, num = 0, len;\n  char c[1];\n  char a[500], b[500];\n\n  cin >> c;\n  x = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      k = 1;\n      break;\n    } else {\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k != 1) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n    } else {\n      for (k = 0; k < strlen(a); k++) {\n        if (a[k] == b[k])\n          num = num + 1;\n      }\n      j = strlen(a);\n      len = 1.00 * j;\n      if ((num / len) <= x) {\n        printf(\"no\");\n      } else {\n        if ((num / len) > x) {\n          printf(\"yes\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char da[501], db[501];\n  double s, ss, l;\n  int l1, l2, i, m = 0;\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", da, db);\n\n  l1 = strlen(da);\n  l2 = strlen(db);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((da[i] != 'A' && da[i] != 'C' && da[i] != 'T' && da[i] != 'G') ||\n        (db[i] != 'A' && db[i] != 'C' && db[i] != 'T' && db[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (da[i] == db[i])\n      m++;\n  }\n  l = l1;\n  ss = m / l;\n  if (ss > s)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "7987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, len, n = 0, x, y;\n  double m, p;\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] > 'Z' || a[i] < 'A') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (x != y)\n    printf(\"error\");\n  else {\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n\n    p = (double)n / len;\n    if (p > m) {\n      printf(\"yes\");\n    } else if (p <= m)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7988", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z;\n  int i, j, a, b, c, d, m, n;\n  scanf(\"%lf\", &z);\n  char zfc[501];\n  cin >> zfc;\n  char bjc[501];\n  scanf(\"%s\", bjc);\n  i = 0;\n  j = 0;\n  c = 0;\n  d = 0;\n  n = 0;\n  while (zfc[i] != '\\0') {\n    i++;\n  }\n  while (bjc[j] != '\\0') {\n    j++;\n  }\n  for (a = 0; zfc[a] != '\\0'; a++) {\n    if (zfc[a] == 'A' || zfc[a] == 'T' || zfc[a] == 'C' || zfc[a] == 'G') {\n      c++;\n    }\n  }\n  for (b = 0; bjc[b] != '\\0'; b++) {\n    if (bjc[b] == 'A' || bjc[b] == 'T' || bjc[b] == 'C' || bjc[b] == 'G') {\n      d++;\n    }\n  }\n  if (i == j && c == i && d == i) {\n    for (m = 0; m < i; m++) {\n      if (zfc[m] == bjc[m]) {\n        n++;\n      }\n    }\n    if ((1.0 * n / i) > z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "7989", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, i, a;\n  double w, n;\n  x = 0;\n  y = 0;\n  n = 0;\n  a = 0;\n  char sz[500], s[500];\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", sz);\n  cin >> s;\n  for (i = 0; sz[i] != '\\0'; i++) {\n    x++;\n  }\n  for (i = 0; s[i] != '\\0'; i++) {\n    y++;\n  }\n  if (x != y) {\n    a = 1;\n  } else if (x == y) {\n    for (i = 0; sz[i] != '\\0'; i++) {\n      if (sz[i] == 'A' || sz[i] == 'C' || sz[i] == 'T' || sz[i] == 'G') {\n        if (sz[i] == s[i]) {\n          n = n + 1;\n        } else if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n          a = 1;\n        }\n      } else if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        a = 1;\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"error\");\n  } else if (a == 0) {\n    n = 1.0 * n / x;\n    if (n >= w) {\n      printf(\"yes\");\n    } else {\n      if (n < w) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7990", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double xgx, n;\n  scanf(\"%lf\", &xgx);\n  int i, j, k, l = 0, m = 0;\n  char jy1[10086], jy2[10086];\n  scanf(\"%s\", jy1);\n  scanf(\"%s \", jy2);\n  j = strlen(jy1);\n  k = strlen(jy2);\n  jy1[j] = '\\0';\n  jy2[k] = '\\0';\n  if (j != k)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < j; i++) {\n      if (((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n           (jy1[i] != 'G')) ||\n          ((jy2[i] != 'A') && (jy2[i] != 'T') && (jy2[i] != 'C') &&\n           (jy2[i] != 'G'))) {\n        l++;\n      }\n    }\n    if (l != 0) {\n      printf(\"error\\n\");\n    } else {\n      for (i = 0; i < j; i++) {\n        if (jy1[i] == jy2[i]) {\n          m++;\n        }\n      }\n      n = 1.0 * m / j;\n      if (n > xgx) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int k = strlen(a);\n  int l = strlen(b);\n  int x = 0, y = 0;\n  int mm = 0;\n  for (mm = 0; mm < k; mm++) {\n    if (a[mm] != 'A' && a[mm] != 'T' && a[mm] != 'G' && a[mm] != 'C') {\n      x = 1;\n    }\n  }\n  for (mm = 0; mm < l; mm++) {\n    if (b[mm] != 'A' && b[mm] != 'T' && b[mm] != 'G' && b[mm] != 'C') {\n      y = 1;\n    }\n  }\n  if (k != l || x == 1 || y == 1) {\n    printf(\"error\");\n  }\n\n  else {\n    int i = 0, p = 0, q = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      q++;\n      if (a[i] == b[i]) {\n        p++;\n      }\n    }\n    double c = (double)p / q;\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500], c[10];\n  double n;\n  int sum = 0;\n  int i, j = 0;\n  scanf(\"%lf\", &n);\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      cout << \"error\";\n      goto end;\n    }\n    if (a[i] == b[i])\n      sum++;\n  }\n  if (b[i] != '\u0000')\n    printf(\"error\");\n  else {\n    if ((double)sum / i > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\nend:;\n  return 0;\n}\n"}
{"label": "5", "index": "7993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float x, y, k = 0;\n  int i, j;\n  char a[501], b[501];\n  scanf(\"%f\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  for (i = 0; a[i]; i++)\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  for (j = 0; b[j]; j++)\n    if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'G' || b[j] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  if (i != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; a[i]; i++)\n    if (a[i] == b[i])\n      k += 1;\n  y = k / j;\n  if (y > x)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "7994", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double p, q;\n  int a, b, m = 0, brak = 0;\n  scanf(\"%lf\", &p);\n  char k[600], kk[600];\n  scanf(\"%s \", k);\n  cin >> kk;\n  a = strlen(k);\n  b = strlen(kk);\n  for (int h = 0;; h++) {\n    if (a != b) {\n      printf(\"error\");\n      break;\n    }\n    for (int c = 0; c < a; c++) {\n      if (!(k[c] == 'A' || k[c] == 'T' || k[c] == 'C' || k[c] == 'G')) {\n        brak++;\n      }\n      if (!(kk[c] == 'A' || kk[c] == 'T' || kk[c] == 'C' || kk[c] == 'G')) {\n        brak++;\n      }\n    }\n    if (brak != 0) {\n      printf(\"error\");\n      break;\n    }\n    for (int i = 0; i < a; i++) {\n      if (k[i] == kk[i]) {\n        m++;\n      }\n    }\n    q = m / (a * 1.0);\n    if (q >= p) {\n      printf(\"yes\");\n    }\n    if (q < p) {\n      printf(\"no\");\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double xgx, n;\n  scanf(\"%lf\", &xgx);\n  int i, j, k, l = 0, m = 0;\n  char jy1[10086], jy2[10086];\n  scanf(\"%s\", jy1);\n  scanf(\"%s\", jy2);\n  j = strlen(jy1);\n  k = strlen(jy2);\n  jy1[j] = '\\0';\n  jy2[k] = '\\0';\n  if (j != k) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if (((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n           (jy1[i] != 'G')) ||\n          ((jy2[i] != 'A') && (jy2[i] != 'T') && (jy2[i] != 'C') &&\n           (jy2[i] != 'G'))) {\n        l++;\n      }\n    }\n    if (l != 0) {\n      cout << \"error\\n\";\n    } else {\n      for (i = 0; i < j; i++) {\n        if (jy1[i] == jy2[i]) {\n          m++;\n        }\n      }\n      n = 1.0 * m / j;\n      if (n > xgx) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, time = 0;\n  double n, p, l, j, k, same = 0;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", &b);\n  j = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < j; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) &&\n        time == 0) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  if (j != k && time == 0) {\n    printf(\"error\");\n    time++;\n  }\n  if (time == 0) {\n    for (i = 0; i < j; i++) {\n      if (a[i] == b[i]) {\n        same++;\n      }\n    }\n    l = strlen(a);\n    p = same / l;\n    if (p > n)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, p, f = 1;\n  double x, bl;\n  char a[502], b[502];\n  scanf(\"%lf \", &bl);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      f = 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      f = 0;\n    }\n  }\n  if (m != p || f == 0) {\n    printf(\"error\");\n  } else if (m == p && f == 1) {\n    int n = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    x = 1.0 * n / m;\n    if (x > bl) {\n      printf(\"yes\");\n    } else if (x <= bl) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0, e, f;\n  double n, m, k = 0;\n  char num[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", &num[i]);\n  }\n  e = strlen(num[0]);\n  f = strlen(num[1]);\n  for (i = 0; i < 2; i++) {\n    m = strlen(num[i]);\n    for (j = 0; j < m; j++) {\n      if (((num[i][j] != 'A') && (num[i][j] != 'C') && (num[i][j] != 'G') &&\n           (num[i][j] != 'T')) ||\n          (e != f)) {\n        cout << \"error \";\n        l++;\n        break;\n      }\n    }\n    if (l > 0) {\n      break;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    if (l == 0) {\n      if (num[0][j] == num[1][j]) {\n        k++;\n      }\n    }\n  }\n  if ((l == 0) && (k / m) > n)\n    printf(\"yes \");\n  else if ((l == 0) && (k / m) <= n) {\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "7999", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  int p = 0, n, m, k = 0;\n  char sb[531] = {0};\n  char dsb[531] = {0};\n  cin >> a;\n  cin >> sb >> dsb;\n  for (int i = 0; i < 531; i++) {\n    if (sb[i] == dsb[i] && sb[i] != 0) {\n      p++;\n    }\n    if (((sb[i] != 'A') && (sb[i] != 'C') && (sb[i] != 'T') && (sb[i] != 'G') &&\n         (sb[i] != 0)) ||\n        ((dsb[i] != 'A') && (dsb[i] != 'C') && (dsb[i] != 'T') &&\n         (dsb[i] != 'G') && (dsb[i] != 0)))\n      k = 1;\n  }\n  n = strlen(sb);\n  m = strlen(dsb);\n  b = 1.0 * p / n;\n  if (m != n || k == 1)\n    printf(\"error\");\n  else if (b > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0;\n  double n;\n  cin >> n;\n  char A[500], B[500];\n\n  scanf(\"%s %s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < a; j++) {\n\n    if (A[j] == B[j]) {\n      c++;\n    }\n    if (A[j] != 'A' && A[j] != 'G' && A[j] != 'C' && A[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (B[j] != 'A' && B[j] != 'G' && B[j] != 'C' && B[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.0 * c / a) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, f, i, g, p = 1;\n  double x;\n  char s[501], t[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  f = strlen(s);\n  g = strlen(t);\n  if (f != g) {\n    p = 0;\n  } else {\n    for (i = 0; i < f; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'G' && t[i] != 'C')) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < f; i++) {\n      if (t[i] == s[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / f > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10000], b[10000];\n  int c, d, m = 0, z = 0;\n  double e, f, g, h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n      z++;\n    }\n  }\n  for (int i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n      z++;\n    }\n  }\n\n  c = strlen(a);\n  d = strlen(b);\n  if (c == d) {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    f = m;\n    g = c;\n    e = f / g;\n    if (e >= h && z == 2 * c) {\n      printf(\"yes\");\n    } else if (e < h && z == 2 * c) {\n      printf(\"no\");\n    }\n  }\n  if (c != d || z != 2 * c)\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8003", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, m;\n  double n, x;\n  char dna1[501], dna2[501];\n  cin >> n;\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  for (i = 0; dna1[i] != '\\0'; i++) {\n    if (dna1[i] != 65 && dna1[i] != 67 && dna1[i] != 71 && dna1[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; dna2[i] != '\\0'; i++) {\n    if (dna2[i] != 65 && dna2[i] != 67 && dna2[i] != 71 && dna2[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2))\n    printf(\"error\");\n  else {\n    m = strlen(dna1);\n    for (i = 0; dna1[i] != '\\0'; i++) {\n      if (dna1[i] == dna2[i]) {\n        a++;\n      }\n    }\n    x = a * 1.0 / (1.0 * m);\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, n;\n  int i, k = 0, s = 0, len1, len2, j = 0;\n  char a[10], dna1[510], dna2[510];\n  scanf(\"%lf\", &n);\n\n  cin >> a;\n\n  scanf(\"%s \", dna1);\n\n  cin >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; dna1[i] != '\u0000'; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n           dna1[i] != 'T') ||\n          (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n           dna2[i] != 'T')) {\n        printf(\"error\");\n        j++;\n        break;\n      } else {\n        if (dna1[i] == dna2[i]) {\n          k++;\n        }\n        s++;\n      }\n    }\n    if (j == 0) {\n      x = 1.0 * k / s;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8005", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, flag = 0, deadend = 0;\n  double x;\n  char a[501], b[501];\n  scanf(\"%lf \", &x);\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\\n\", &b);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      deadend = 1;\n      break;\n    }\n  }\n  if ((strlen(a) == strlen(b)) && (deadend == 0)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        flag++;\n    }\n    if ((100 * flag / (strlen(a))) < (100 * x))\n      printf(\"no\");\n    else {\n      printf(\"yes\");\n    }\n  } else if ((strlen(a) != strlen(b)) && (deadend == 0))\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double n, p = 0, a, b, m = 0;\n  char s1[500], s2[500];\n  cin >> n;\n  cin >> s1;\n  scanf(\"%s\", s2);\n  a = strlen(s1);\n  for (i = 0; i < a; i++) {\n    if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') ||\n        (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G')) {\n      m = 1;\n      break;\n    }\n    if (s1[i] == s2[i]) {\n      p++;\n    }\n  }\n  if (m == 1) {\n    printf(\"error\");\n  } else {\n    b = p / a;\n    if (b > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501], isbreak;\n  isbreak = 'n';\n  double x, n;\n  int i, l1, l2, t;\n  t = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", DNA1, DNA2);\n  l1 = strlen(DNA1);\n  l2 = strlen(DNA2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'C' &&\n           DNA1[i] != 'G') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'C' &&\n           DNA2[i] != 'G')) {\n        isbreak = 'y';\n        break;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          t++;\n        }\n      }\n    }\n    if (isbreak == 'y') {\n      printf(\"error\");\n    } else {\n      x = (1.0 * t) / l1;\n      if (x > n)\n        printf(\"yes\");\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8008", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, yiyang = 0, zongliang = 0, x;\n  char lian1[501], lian2[501];\n  double biaozhun, jieguo;\n  scanf(\"%lf\", &biaozhun);\n  scanf(\"%s%s\", &lian1, &lian2);\n  for (i = 0; lian1[i] != '\\0' && lian2[i] != '\\0'; i++) {\n    if ((lian1[i] == 'A' || lian1[i] == 'C' || lian1[i] == 'T' ||\n         lian1[i] == 'G') &&\n        (lian2[i] == 'A' || lian2[i] == 'C' || lian2[i] == 'T' ||\n         lian2[i] == 'G')) {\n      if (lian1[i] == lian2[i]) {\n        yiyang++;\n      }\n      zongliang++;\n    } else {\n      printf(\"error\");\n      x = 99;\n      break;\n    }\n  }\n  if (lian1[zongliang] != '\\0' || lian2[zongliang] != '\\0') {\n    if (x != 99) {\n      printf(\"error\");\n    }\n    zongliang = 0;\n  }\n  if (zongliang != 0) {\n    jieguo = 1.0 * yiyang / zongliang;\n    if (jieguo > biaozhun) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, d, c, r;\n  int i, k, s;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\\n%s\", a, b);\n  d = strlen(a);\n  c = strlen(b);\n  k = 0;\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n        k++;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n        k++;\n    }\n    if (k != 0) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  s = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  r = s / d;\n  if (r <= n)\n    printf(\"no\");\n  if (r > n)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "5", "index": "8010", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char fir[1000];\n  char sec[1000];\n  double l1, l2;\n  int i, j, k;\n  int flag = 0;\n  double m = 0, x, n;\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", &fir);\n  scanf(\"%s \", sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n\n  for (i = 0; i < l1; i++) {\n    if (fir[i] != 'A' && fir[i] != 'T' && fir[i] != 'C' && fir[i] != 'G') {\n      flag++;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (sec[i] != 'A' && sec[i] != 'G' && sec[i] != 'C' && sec[i] != 'T') {\n      flag++;\n    }\n  }\n  if (l1 != l2) {\n    flag++;\n  }\n\n  if (flag > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (fir[i] == sec[i]) {\n        m++;\n      }\n    }\n    x = m / l1;\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8011", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint judge(char *a, char *b, double r) {\n  int n = strlen(a), m = strlen(b), i, s = 0;\n  if (n != m)\n    return 0;\n  for (i = 0; i < n; ++i) {\n    if (!strchr(\"ATCG\", a[i]) || !strchr(\"ATCG\", b[i]))\n      return 0;\n    if (a[i] == b[i])\n      ++s;\n  }\n  if (s / (double)n > r)\n    return 1;\n  else {\n    return -1;\n  }\n}\n\nint main() {\n  char a[600], b[600];\n  double r;\n  int s;\n  scanf(\"%lf \", &r);\n\n  cin >> a;\n\n  cin >> b;\n  s = judge(a, b, r);\n  if (s > 0)\n    puts(\"yes\");\n  else if (s < 0)\n    puts(\"no\");\n  else\n    puts(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s%s\", a, b);\n  int lena, lenb;\n  lena = strlen(a);\n  lenb = strlen(b);\n  int sum = 0;\n  int zq = 0;\n  if (lena == lenb) {\n    int i;\n\n    for (i = 0; i < lena; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n        if (a[i] == b[i]) {\n          sum++;\n        }\n        zq++;\n\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  double r;\n  r = 1.0 * sum / lena;\n  if (zq == lena) {\n    if (r > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, q = 0, a, b, d = 0, e = 0, l, g;\n  float c, n;\n  char s1[500], s2[500];\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\\n%s\", s1, s2);\n  if (strlen(s1) != strlen(s2))\n    printf(\"error\");\n  if (strlen(s1) == strlen(s2)) {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n        d++;\n      }\n    }\n    for (j = 0; s2[j] != '\\0'; j++) {\n      if (s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'G' && s2[j] != 'C') {\n        e++;\n      }\n    }\n    l = strlen(s1);\n    for (int k = 0; k < l; k++) {\n      if (s1[k] == s2[k])\n        q++;\n    }\n    a = strlen(s1);\n    b = q;\n    c = (float)b / (float)a;\n    g = d + e;\n    if (g != 0) {\n      printf(\"error\");\n    } else {\n      if (c >= n)\n        printf(\"yes\");\n      if (c < n)\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, summ;\n  double bl, sjbl, s, sum;\n  s = 0;\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  sum = strlen(a);\n  summ = strlen(b);\n  if (sum != summ) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < sum; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n  }\n  sjbl = s / sum;\n  if (sjbl > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int num, i;\n  int same = 0, judge = 1;\n  double standard, actual;\n  scanf(\"%lf\", &standard);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    num = strlen(a);\n    for (i = 0; i < num; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C'))) {\n        printf(\"error\");\n        judge = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          same++;\n        }\n      }\n    }\n    if (judge != 0) {\n      actual = 1.0 * same / num;\n      if (actual > standard) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, len, panduan = 0;\n  double r, n;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, &a, &b);\n  len = strlen(a);\n  if (len != strlen(b)) {\n    panduan = 1;\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        panduan = 1;\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    r = 1.0 * k / len;\n  }\n  if (panduan == 1) {\n    printf(\"error\");\n  } else {\n    if (r > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8017", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[1000 + 1];\n  char b[1000 + 1];\n  int p, q, i, j, x = 0, y = 0, l = 0;\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    printf(\"error\");\n  }\n  if (p == q) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        x++;\n        break;\n      }\n    }\n    for (j = 0; b[j]; j++) {\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G' && x == 0) {\n        printf(\"error\");\n        y++;\n        break;\n      }\n    }\n  }\n  if (p == q && x == 0 && y == 0) {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        l++;\n      }\n    }\n    if (l * 1.0 / p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p = 0, q = 0, judge = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  for (i = 0; i < p; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (a[i] == b[i]) {\n      q++;\n    }\n  }\n  if (1.0 * q / p >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8019", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0, p = 0;\n  char sz[10000];\n  char s[10000];\n  double n, c;\n  scanf(\"%lf%s%s\", &n, &sz, &s);\n  for (i = 0; sz[i]; i++) {\n    if (sz[i] == s[i])\n      a++;\n\n    b++;\n    if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      p++;\n    }\n  }\n  c = 1.0 * a / b;\n  if (p != 0) {\n    printf(\"error\");\n  }\n\n  if (p == 0 && c > n) {\n    printf(\"yes\");\n  }\n  if (p == 0 && c <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8020", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double n, j = 0;\n  cin >> n;\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\\n\", b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    i = strlen(a);\n    j = j / i;\n    if (j > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8021", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, x, y, s = 0;\n  char a[501], b[501];\n  double m, o;\n  cin >> m;\n  scanf(\"\\n%s\", a);\n  scanf(\"\\n%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i])\n        s = s + 1;\n    }\n    o = 1.0 * s / x;\n    if (o > m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double x;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  int m, i, same = 0;\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      same = -1;\n    } else if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double y;\n  y = (double)same / m;\n  if (y > x && same != -1) {\n    printf(\"yes\");\n  } else if (y <= x && same != -1) {\n    cout << \"no\";\n  } else if (same = -1) {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8023", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i = 0, b, c = 0, e = 0, f;\n  char x[600], y[600];\n  scanf(\"%lf\", &a);\n  cin >> x >> y;\n  b = strlen(x);\n  f = strlen(y);\n  if (b == f) {\n    for (i = 0; i < b; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n\n        break;\n      }\n      if (x[i] == y[i]) {\n        c++;\n      }\n    }\n    if (e == 0) {\n\n      if (c * 1.000 / b >= a)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, y = 0, m, n, t;\n  int i, q = 0;\n  char dna1[501];\n  char dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'C' ||\n           dna1[i] == 'G') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'C' ||\n           dna2[i] == 'G')) {\n      } else {\n        q = 1;\n        break;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (q == 1) {\n        break;\n      } else if (dna1[i] == dna2[i]) {\n        y++;\n      } else if (dna1[i] != dna2[i]) {\n      }\n    }\n    t = y / m;\n  } else if (m != n) {\n    q = 1;\n  }\n  if ((t >= a && a != 0 && q == 0) || (q == 0 && t > a && a == 0)) {\n    printf(\"yes\");\n  } else if ((t < a) && (a != 0) && (q == 0) ||\n             ((q == 0) && (t == 0) && (a == 0))) {\n    printf(\"no\");\n  } else if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, x, y, u = 0, t = 0;\n  double n;\n  char a[505], b[505];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  ;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    t = 0;\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        t += 1;\n        if (a[i] == b[i])\n          u += 1;\n\n      } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n                 (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        t = 0;\n    }\n  }\n  if (t == 0)\n    printf(\"error\");\n  else if (u * 1.0 / x >= n)\n    printf(\"yes\");\n  else if (u * 1.0 / x < n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, g;\n  int b, c, i, j, d, e, k, f = 0;\n  scanf(\"%lf\", &a);\n  char zfc1[500], zfc2[500];\n  scanf(\"%s%s\", zfc1, zfc2);\n  b = strlen(zfc1);\n  c = strlen(zfc2);\n  for (i = 0; i < b; i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'G' || zfc1[i] == 'C') {\n      d = 0;\n    } else {\n      d = 1;\n      break;\n    }\n  }\n  for (j = 0; j < c; j++) {\n    if (zfc2[j] == 'A' || zfc2[j] == 'T' || zfc2[j] == 'G' || zfc2[j] == 'C') {\n      e = 0;\n    } else {\n      e = 1;\n      break;\n    }\n  }\n  if (b != c || e == 1 || d == 1) {\n    printf(\"error\\n\");\n  } else {\n    for (k = 0; k < b; k++) {\n      if (zfc1[k] == zfc2[k]) {\n        f++;\n      }\n    }\n    g = f * 1.0 / b;\n    if (g > a) {\n      printf(\"yes\\n\");\n    } else {\n      cout << \"no\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8027", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n, m = 0;\n  char dna1[1000 + 1], dna2[1000 + 1];\n  int len1 = 0, len2 = 0, count = 0, i = 0;\n  cin >> n >> dna1 >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n           dna1[i] != 'G') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n           dna2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (dna1[i] != dna2[i])\n        count++;\n    }\n\n    m = (double)count / len1;\n\n    if ((1 - m) >= n) {\n      printf(\"yes\");\n    }\n    if ((1 - m) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8028", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double s, w;\n  int k1 = 0, k2 = 0, i, dian, lena, lenb;\n  char a[1000], b[1000];\n\n  scanf(\"%lf\", &s);\n  cin >> a >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n\n      k1 = 1;\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n\n      k2 = 1;\n  }\n\n  if (k1 == 1 || k2 == 1 || lena != lenb)\n    printf(\"error\");\n  else {\n    for (i = 0, dian = 0; i < lena; i++) {\n      if (a[i] == b[i])\n        dian++;\n    }\n\n    w = 1.0 * dian / lena;\n    if (w >= s)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double n, c = 0, d, l, k;\n  int i, h = 0;\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  l = strlen(a);\n  k = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    if (k != l || a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n\n      printf(\"error\");\n      h = 1;\n      break;\n    } else if (a[i] == b[i])\n      c = c + 1;\n  }\n  d = c / l;\n  if (d > n)\n    printf(\"yes\");\n  else if (h == 0 && d <= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, q, i, flag = 1;\n  double m, c = 0, d = 0;\n  char a[10086], b[10086];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    flag = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n    d++;\n  }\n  if (flag == 0) {\n    printf(\"error\");\n  }\n  if (flag == 1) {\n    if (c / d >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b;\n  int s = 0;\n  int t = 1;\n  double x, y, aa, ss;\n  char sa[501];\n  char sb[501];\n\n  cin >> sa;\n  x = atof(sa);\n\n  cin >> sa;\n\n  cin >> sb;\n  a = strlen(sa);\n  b = strlen(sb);\n  if (a != b) {\n    t = 0;\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((sa[i] != 'A' && sa[i] != 'G' && sa[i] != 'T' && sa[i] != 'C') ||\n          (sb[i] != 'A' && sb[i] != 'G' && sb[i] != 'T' && sb[i] != 'C')) {\n        t = 0;\n        break;\n      } else {\n        if (sa[i] == sb[i]) {\n          s++;\n        }\n      }\n    }\n  }\n  aa = a;\n  ss = s;\n  y = ss / aa;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (y >= x) {\n      cout << \"yes\";\n    } else if (y <= x) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0;\n  double n;\n  scanf(\"%lf\", &n);\n  char A[500], B[500];\n\n  scanf(\"%s %s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < a; j++) {\n\n    if (A[j] == B[j]) {\n      c++;\n    }\n    if (A[j] != 'A' && A[j] != 'G' && A[j] != 'C' && A[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (B[j] != 'A' && B[j] != 'G' && B[j] != 'C' && B[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.0 * c / a) >= n) {\n    cout << \"yes\";\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0;\n  double n;\n  scanf(\"%lf\", &n);\n  char A[500], B[500];\n\n  scanf(\"%s %s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < a; j++) {\n\n    if (A[j] == B[j]) {\n      c++;\n    }\n    if (A[j] != 'A' && A[j] != 'G' && A[j] != 'C' && A[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (B[j] != 'A' && B[j] != 'G' && B[j] != 'C' && B[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.0 * c / a) >= n) {\n    cout << \"yes\";\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "8034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, q = 0;\n  double n, A, B, p = 0.0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  char c = getchar();\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  A = strlen(a);\n  B = strlen(b);\n  if (A != B)\n    printf(\"error\");\n\n  if (A == B) {\n    for (i = 0; i < A; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        q = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (q == 0) {\n      for (i = 0; i < A; i++) {\n        if (a[i] == b[i])\n          p += 1.0;\n      }\n      if ((p / A) > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8035", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], d[510];\n  int i, e;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  cin >> a;\n  scanf(\"%s\", d);\n  e = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(d);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n      if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == d[i]) {\n          e++;\n        }\n      }\n    }\n    bl = 1.0 * e / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, p = 0, t = 0, r = 0;\n  double k, q;\n  char gen1[1000], gen2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", gen1);\n  scanf(\"%s\", gen2);\n  if (strlen(gen1) != strlen(gen2)) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < strlen(gen1); i++) {\n      if (gen1[i] != 'A' && gen1[i] != 'C' && gen1[i] != 'G' &&\n          gen1[i] != 'T') {\n        r++;\n      }\n    }\n    for (i = 0; i < strlen(gen2); i++) {\n      if (gen2[i] != 'A' && gen2[i] != 'C' && gen2[i] != 'G' && gen2[i] != 'T')\n        r++;\n    }\n    if (r > 0) {\n      printf(\"error\");\n      t = 0;\n    } else {\n      t = 1;\n    }\n    if (t == 1) {\n      for (i = 0; i < strlen(gen1) + 1; i++) {\n        if (gen1[i] == gen2[i])\n          p++;\n      }\n      q = 1.0 * p / (strlen(gen1));\n      if (q > k) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, c, d, k = 0;\n  int i, e = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\\n%s\", &a, &b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    cout << \"error\";\n  } else if (c == d) {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        e = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          k = k + 1;\n        }\n      }\n    }\n    if (e == 0) {\n      printf(\"error\");\n    } else if (k != 0 && (k / c) >= n) {\n      printf(\"yes\");\n    } else if (e == 1 && (k / c) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double d;\n  scanf(\"%lf\", &d);\n  char s[100];\n  char u[100];\n  scanf(\"%s %s\", s, u);\n  int f = 0;\n  int t = 0, i, r = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    t++;\n  }\n  for (i = 0; u[i] != '\\0'; i++) {\n    r++;\n  }\n  if (r != t) {\n    printf(\"error\\n\");\n    return 0;\n  } else {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n        cout << \"error\\n\";\n        return 0;\n      } else if (u[i] != 'A' && u[i] != 'T' && u[i] != 'C' && u[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else if (s[i] == u[i]) {\n        f++;\n      }\n    }\n    if (f * 1.0 / t >= d) {\n      printf(\"yes\\n\");\n      return 0;\n    } else {\n      cout << \"no\\n\";\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[510], s2[510];\n  double n, q;\n  int i, len1, len2, D, c, d, f;\n  c = 0;\n  D = 1;\n  d = f = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    D = 0;\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T') {\n        d++;\n      }\n    }\n    if (d > 0) {\n      D = 0;\n    }\n    for (i = 0; i < len1; i++) {\n      if (s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        f++;\n      }\n    }\n    if (f > 0) {\n      D = 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (s1[i] == s2[i]) {\n      c++;\n    }\n  }\n  q = 1.0 * c / len1;\n  if (D == 1 && q > n) {\n    printf(\"yes\");\n  } else if (D == 1 && q <= n) {\n    cout << \"no\";\n  } else if (D == 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c = 0;\n  double n, x = 0, y = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", a);\n\n  scanf(\"%s\", b);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      c = 1;\n      break;\n    } else {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y++;\n  }\n  if (c == 0) {\n    if (b[i] != '\\0') {\n      cout << \"error\";\n      c = 1;\n    }\n  }\n\n  if (c == 0) {\n    if ((x / y) > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8041", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int count = 0, i;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, a, b);\n  if ((int)strlen(a) != (int)strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < (int)strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else if (a[i] == b[i]) {\n        count++;\n      }\n    }\n    if (1.0 * count / (int)strlen(a) >= n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, n = 0;\n  double e;\n  char a[500], b[500];\n  cin >> e >> a >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    } else {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n  }\n  if (1.0 * n / l1 > e) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, len1, len2, m = 0, flag = 1;\n  char s[1000] = {\"\"}, t[1000] = {\"\"};\n  float p, q;\n  scanf(\"%f\", &p);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  len1 = strlen(s);\n  len2 = strlen(t);\n  if (len1 != len2) {\n    printf(\"error\");\n    flag = 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G')) {\n        cout << \"error\";\n        flag = 0;\n        break;\n      } else {\n        if (s[i] == t[i])\n          m++;\n      }\n    }\n  }\n  if (flag == 1) {\n    q = (float)m / len1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  double m, n, s;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) == strlen(b)) {\n\n    for (i = 0, j = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        k = 1;\n\n      } else {\n\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n    }\n    if (k == 0) {\n\n      n = 0.1 * strlen(a);\n      s = j * 0.1 / n;\n      if (s > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int la, lb, i, d;\n  double t, tt;\n  char a[505], b[505];\n  scanf(\"%lf\", &t);\n  cin >> a;\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  d = -1;\n  if (la == lb) {\n    d = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] == b[i])\n        d++;\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        d = -1;\n        break;\n      }\n    }\n  }\n  if (d < 0)\n    cout << \"error\";\n  else {\n    tt = d * 1.000 / la;\n    if (tt > t)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, c;\n  int b = 0, p = 1, i;\n  scanf(\"%lf\", &n);\n  char a[2][501];\n  scanf(\"%s\", a[0]);\n  scanf(\"%s\", a[1]);\n  for (i = 0; i < 501; i++) {\n    if (a[0][i] == '\\0') {\n      if (a[1][i] != '\\0') {\n        p = 0;\n      }\n      break;\n    }\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G') {\n      p = 0;\n      break;\n    }\n    if (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' && a[1][i] != 'G') {\n      p = 0;\n      break;\n    }\n\n    if (a[0][i] == a[1][i])\n      b = b + 1;\n  }\n  c = b * 1.0 / i;\n\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m = 0, n = 0, total = 0, zong = 0, A = 1;\n  double bl, suande;\n  char z1[100];\n  char z2[100];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", &z1);\n  scanf(\"%s\", &z2);\n  for (i = 0; z1[i] != '\\0'; i++) {\n    m++;\n  }\n  for (i = 0; z2[i] != '\\0'; i++) {\n    n++;\n  }\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; z1[i] != '\\0'; i++) {\n      zong++;\n      if (((z1[i] != 'A') && (z1[i] != 'T') && (z1[i] != 'C') &&\n           (z1[i] != 'G')) ||\n          ((z2[i] != 'A') && (z2[i] != 'T') && (z2[i] != 'C') &&\n           (z2[i] != 'G'))) {\n        A = 0;\n        break;\n      } else {\n        if (z1[i] == z2[i]) {\n          total++;\n        }\n      }\n    }\n    suande = 1.0 * total / zong;\n    if ((A == 1) && (suande <= bl)) {\n      printf(\"no\");\n    } else if ((A == 1) && (suande > bl)) {\n      printf(\"yes\");\n    } else if (A == 0) {\n      cout << \"error\";\n    } else {\n      printf(\"a\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8048", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], d[1000], tmp;\n  int i, m, n, j, mc;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s %s \", a, d);\n  m = strlen(a);\n  n = strlen(d);\n  if (m != n)\n    printf(\"error\");\n  else {\n    j = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        mc = 1;\n        break;\n      } else if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        mc = 1;\n        break;\n      } else {\n        mc = 0;\n      }\n      if (a[i] == d[i])\n        j++;\n    }\n    if (mc == 1)\n      printf(\"error\");\n    else if (j < (k * m))\n      printf(\"no\");\n    else if (j >= (k * m))\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8049", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, a;\n  int b = 0;\n  double n, k;\n  char l1[500];\n  char l2[500];\n  a = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", l1);\n  cin >> l2;\n  for (i = 0; i < strlen(l1); i++) {\n    if (l1[i] < 'A' || l1[i] > 'Z' || l2[i] < 'A' || l2[i] > 'Z') {\n      b = 1;\n    }\n  }\n  if (strlen(l1) != strlen(l2) || b == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(l1); i++) {\n      if (l1[i] == l2[i]) {\n        a++;\n      }\n    }\n    k = 1.0 * a / strlen(l1);\n    if (k > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8050", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, l, s = 0, p = 0;\n  double n, m;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", a, b);\n  k = strlen(a), l = strlen(b);\n  for (i = 0; i < k; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      p++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] == b[i]) {\n      s++;\n    }\n  }\n  m = 1.0 * s / k;\n  if ((k == l) && (p == 0) && (m > n)) {\n    printf(\"yes\");\n  } else if ((k == l) && (p == 0) && (m <= n)) {\n    printf(\"no\");\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sa = 0, m = 0;\n  double x, s;\n  char a[105], b[105];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        cout << \"error\";\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i]) {\n          sa++;\n        }\n      }\n      s = 1.0 * sa / strlen(a);\n      if (s > x) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8052", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint judge(char *a, char *b, double r) {\n  int n = strlen(a), m = strlen(b), i, s = 0;\n  if (n != m)\n    return 0;\n  for (i = 0; i < n; ++i) {\n    if (!strchr(\"ATCG\", a[i]) || !strchr(\"ATCG\", b[i]))\n      return 0;\n    if (a[i] == b[i])\n      ++s;\n  }\n  if (s / (double)n > r)\n    return 1;\n  else {\n    return -1;\n  }\n}\n\nint main() {\n  char a[600], b[600];\n  double r;\n  int s;\n  scanf(\"%lf \", &r);\n\n  cin >> a;\n\n  cin >> b;\n  s = judge(a, b, r);\n  if (s > 0)\n    puts(\"yes\");\n  else if (s < 0)\n    puts(\"no\");\n  else\n    puts(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  char d[3][501];\n  double n, m, a, b, c, x;\n  x = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &d[1]);\n  scanf(\"%s\", &d[2]);\n  n = strlen(d[1]);\n  m = strlen(d[2]);\n  for (i = 0; i < n; i++) {\n    if ((d[1][i] != 'A' && d[1][i] != 'G' && d[1][i] != 'C' &&\n         d[1][i] != 'T') ||\n        (d[2][i] != 'A' && d[2][i] != 'G' && d[2][i] != 'C' &&\n         d[2][i] != 'T')) {\n      x++;\n    }\n  }\n  if (m != n || x > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (d[1][i] == d[2][i]) {\n        b++;\n      }\n    }\n    c = b / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x;\n  int m, n, i;\n  int p = 0;\n  int s = 0;\n  int c[1000];\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m - 1; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      cout << \"error\";\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  if (s == 0) {\n    for (i = 0; i < n; i++)\n      c[i] = a[i] / b[i];\n\n    for (i = 0; i < m; i++) {\n      if (c[i] < x)\n        p++;\n    }\n    if (p == 0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c = 0;\n  double n, x = 0, y = 0;\n  char a[600], b[600];\n  cin >> n;\n\n  scanf(\"%s\", a);\n\n  scanf(\"%s\", b);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      c = 1;\n      break;\n    } else {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y++;\n  }\n  if (c == 0) {\n    if (b[i] != '\\0') {\n      printf(\"error\");\n      c = 1;\n    }\n  }\n\n  if (c == 0) {\n    if ((x / y) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x;\n  int m, n, i;\n  int p = 0;\n  int s = 0;\n  int c[1000];\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m - 1; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n      printf(\"error\");\n      s = 1;\n      break;\n      return 0;\n    }\n  }\n  if (s == 0) {\n    for (i = 0; i < n; i++)\n      c[i] = a[i] / b[i];\n\n    for (i = 0; i < m; i++) {\n      if (c[i] < x) {\n        p++;\n      }\n    }\n    if (p == 0) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, p, f = 1;\n  double x, bl;\n  char a[502], b[502];\n  scanf(\"%lf \", &bl);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      f = 0;\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      f = 0;\n    }\n  }\n  if (m != p || f == 0) {\n    printf(\"error\");\n  } else if (m == p && f == 1) {\n    int n = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    x = 1.0 * n / m;\n    if (x > bl) {\n      printf(\"yes\");\n    } else if (x <= bl) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  double w;\n  int count = 0, lena, lenb;\n  scanf(\"%lf\", &w);\n  scanf(\"%s \", a);\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  if (lena != lenb)\n    printf(\"error\");\n  else {\n    int i, j, k = 0;\n    for (i = 0; i < lena; i++) {\n      if (!((a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') &&\n            (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < lena; j++) {\n        if (a[j] == b[j])\n          count++;\n      }\n      double what;\n      what = (double)count / lena;\n      if (what >= w)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double a;\n  char zfc1[501], zfc2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  x = strlen(zfc1);\n  y = strlen(zfc2);\n  int s = 0;\n  for (i = 0; i < x; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'G' && zfc1[i] != 'C' && zfc1[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  for (i = 0; i < y; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'G' && zfc2[i] != 'C' && zfc2[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  if (x != y || s == 1) {\n    cout << \"error\";\n  } else {\n    int t = 0;\n    for (i = 0; i < x; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        t++;\n      }\n    }\n    double s;\n    s = 1.0 * t / (1.0 * x);\n    if (s > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int left = 0, right = 0, a = 0, get = 0, i;\n  double m, q;\n  char l[520], r[520];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", l);\n  scanf(\"%s\", r);\n  for (i = 0; l[i]; i++) {\n    left++;\n    if (l[i] != 'A' && l[i] != 'G' && l[i] != 'T' && l[i] != 'C') {\n      a = 1;\n    }\n  }\n  for (i = 0; r[i]; i++) {\n    right++;\n    if (r[i] != 'A' && r[i] != 'G' && r[i] != 'T' && r[i] != 'C') {\n      a = 1;\n    }\n  }\n  if (a == 1 || left != right) {\n    cout << \"error\";\n  } else {\n    for (i = 0; l[i]; i++) {\n      if (l[i] == r[i]) {\n        get++;\n      }\n    }\n    q = 1.0 * get / left;\n    if (q > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[501], s2[502];\n  int l1, l2, i;\n  double std, aa;\n  scanf(\"%lf\\n\", &std);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  aa = -1;\n  if (l1 == l2) {\n    aa = 0;\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i])\n        aa++;\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n        aa = -1;\n        break;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'T' && s2[i] != 'G') {\n        aa = -1;\n        break;\n      }\n    }\n  }\n  if (aa == -1)\n    printf(\"error\");\n  else {\n    aa = aa / l1;\n    if (aa > std)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, n = 0;\n  double e;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &e, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n  }\n  if (1.0 * n / l1 > e) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  char s[501];\n  char t[501];\n  int m, n, i, k = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &t);\n  m = strlen(s);\n  n = strlen(t);\n  if (m != n)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n          (t[i] != 'A' && t[i] != 'G' && t[i] != 'C' && t[i] != 'T')) {\n        k = -1;\n        break;\n      } else if (s[i] == t[i])\n        k++;\n    }\n    if (k == -1) {\n      printf(\"error\");\n    } else if ((1.0 * k / n) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x = 0;\n  double n;\n  char su[500], zu[500];\n  scanf(\"%lf %s %s\", &n, su, zu);\n  if (strlen(su) != strlen(zu)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(su); i++) {\n    if ((su[i] != 'A' && su[i] != 'T' && su[i] != 'G' && su[i] != 'C') ||\n        (zu[i] != 'A' && zu[i] != 'T' && zu[i] != 'G' && zu[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (su[i] == zu[i])\n      x++;\n  }\n  if (x / (1.0 * strlen(su)) > n) {\n    printf(\"yes\");\n    return 0;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8065", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n;\n  double x, t = 0;\n  scanf(\"%lf \", &x);\n  char a[500], b[500];\n  cin >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    n = strlen(a);\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          t++;\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    if (t / n > x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8066", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char w1[501], w2[501];\n  int len1, len2;\n  int i, a = 0, b = 0;\n  double n, m;\n  cin >> n;\n  scanf(\"%s\", w1);\n  scanf(\"%s\", w2);\n  len1 = strlen(w1);\n  len2 = strlen(w2);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        b = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (w1[i] - w2[i] == 0)\n        a++;\n    }\n    m = 1.0 * a / (len1 - 1);\n    if (m > n && b == 0)\n      printf(\"yes\");\n    if (m < n && b == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8067", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, e = 0, k, m = 0;\n  double x, y;\n  char a[500], b[500];\n  scanf(\"%lf \", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i])\n      e++;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      m++;\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      m++;\n  }\n  y = e * 1.0 / n;\n  if (n == k && m == n + k) {\n    if (y >= x)\n      printf(\"yes\");\n    else if (y < x)\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0, flag = 0, l;\n  float x;\n  char str[2][100];\n  cin >> x >> str[0] >> str[1];\n  if (strlen(str[0]) != strlen(str[1]))\n    flag = 1;\n  else {\n    l = strlen(str[0]);\n    for (i = 0; i < l; i++) {\n      if ((str[0][i] != 'A' && str[0][i] != 'T' && str[0][i] != 'C' &&\n           str[0][i] != 'G') ||\n          (str[1][i] != 'A' && str[1][i] != 'T' && str[1][i] != 'C' &&\n           str[1][i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (str[0][i] == str[1][i]) {\n        t++;\n      }\n    }\n  }\n  if (flag == 1)\n    cout << \"error\";\n  else {\n    if (((float)t / strlen(str[1])) >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, len, panduan = 0;\n  double r, n;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &n, &a, &b);\n  len = strlen(a);\n  if (len != strlen(b))\n    panduan = 1;\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        panduan = 1;\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    r = 1.0 * k / len;\n  }\n  if (panduan == 1) {\n    printf(\"error\");\n  } else {\n    if (r > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, g;\n  int b, c, i, j, d, e, k, f = 0;\n  scanf(\"%lf\", &a);\n  char zfc1[500], zfc2[500];\n  scanf(\"%s%s\", zfc1, zfc2);\n  b = strlen(zfc1);\n  c = strlen(zfc2);\n  for (i = 0; i < b; i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'G' || zfc1[i] == 'C') {\n      d = 0;\n    } else {\n      d = 1;\n      break;\n    }\n  }\n  for (j = 0; j < c; j++) {\n    if (zfc2[j] == 'A' || zfc2[j] == 'T' || zfc2[j] == 'G' || zfc2[j] == 'C') {\n      e = 0;\n    } else {\n      e = 1;\n      break;\n    }\n  }\n  if (b != c || e == 1 || d == 1) {\n    printf(\"error\\n\");\n  } else {\n    for (k = 0; k < b; k++) {\n      if (zfc1[k] == zfc2[k]) {\n        f++;\n      }\n    }\n    g = f * 1.0 / b;\n    if (g > a) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n1, n2, p;\n  double rate, m = 0.0;\n  char str1[501], str2[501];\n  scanf(\"%lf\", &rate);\n  cin >> str1;\n  scanf(\"%s\", str2);\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  p = 0;\n  if (n1 == n2) {\n    for (i = 0; i < n1; i++) {\n      if (str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' && str1[i] != 'G')\n        p = 1;\n      else if (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n               str2[i] != 'G')\n        p = 1;\n      if (p == 1) {\n        printf(\"error\");\n        break;\n      }\n      if (str1[i] == str2[i])\n        m += 1.0;\n    }\n    if (p == 0)\n      if (m / n1 >= rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n  } else\n    cout << \"error\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "8072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m = 0, n = 0, total = 0, zong = 0, A = 1;\n  double bl, suande;\n  char z1[100];\n  char z2[100];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", &z1);\n  scanf(\"%s\", &z2);\n  for (i = 0; z1[i] != '\\0'; i++) {\n    m++;\n  }\n  for (i = 0; z2[i] != '\\0'; i++) {\n    n++;\n  }\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; z1[i] != '\\0'; i++) {\n      zong++;\n      if (((z1[i] != 'A') && (z1[i] != 'T') && (z1[i] != 'C') &&\n           (z1[i] != 'G')) ||\n          ((z2[i] != 'A') && (z2[i] != 'T') && (z2[i] != 'C') &&\n           (z2[i] != 'G'))) {\n        A = 0;\n        break;\n      } else {\n        if (z1[i] == z2[i])\n          total++;\n      }\n    }\n    suande = 1.0 * total / zong;\n    if ((A == 1) && (suande <= bl)) {\n      cout << \"no\";\n    } else if ((A == 1) && (suande > bl)) {\n      printf(\"yes\");\n    } else {\n      if (A == 0) {\n        printf(\"error\");\n      } else {\n        printf(\"a\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0;\n  float n;\n  char a[600], b[600];\n  cin >> n;\n  cin >> a;\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G'))\n        t++;\n    }\n\n    if (t > 0)\n      cout << \"error\\n\";\n    else {\n\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n\n      if ((float)s / strlen(a) > n)\n        cout << \"yes\";\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8074", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char asd[500], zxc[500];\n  int i;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", asd);\n  scanf(\"%s\", zxc);\n  int len1 = strlen(asd);\n  int len2 = strlen(zxc);\n  int a1 = 0;\n  int a2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (asd[i] != 'A' && asd[i] != 'C' && asd[i] != 'G' && asd[i] != 'T')\n      a1++;\n  }\n  for (i = 0; i < len2; i++) {\n    if (zxc[i] != 'A' && zxc[i] != 'C' && zxc[i] != 'G' && zxc[i] != 'T')\n      a2++;\n  }\n  if (a1 != 0 || a2 != 0 || len1 != len2)\n    printf(\"error\");\n  else {\n    int d = 0;\n    for (i = 0; i < len1; i++) {\n      if (asd[i] == zxc[i])\n        d++;\n    }\n    double result = 1.0 * d / len1;\n    if (result > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int q, w, e = 0, r = 1, i;\n  double a, b;\n  char A[1000], B[1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s \", A);\n  scanf(\"%s\", B);\n  q = strlen(A);\n  w = strlen(B);\n\n  if (q != w) {\n    printf(\"error\");\n    r = -1;\n  } else {\n    for (i = 0; A[i] != '\\0'; i++) {\n\n      if ((A[i] != 'T' && A[i] != 'C' && A[i] != 'A' && A[i] != 'G') ||\n          (B[i] != 'T' && B[i] != 'C' && B[i] != 'A' && B[i] != 'G')) {\n        r = -1;\n        printf(\"error\");\n        break;\n      } else if (A[i] != B[i]) {\n        continue;\n      } else if (A[i] == B[i]) {\n        e++;\n      }\n    }\n  }\n\n  if (r == 1) {\n    b = (e * 1.0) / (q * 1.0);\n\n    if (b > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, c;\n  int b = 0, p = 1, i;\n  scanf(\"%lf\", &n);\n  char a[2][501];\n  scanf(\"%s\", a[0]);\n  scanf(\"%s\", a[1]);\n  for (i = 0; i < 501; i++) {\n    if (a[0][i] == '\\0') {\n      if (a[1][i] != '\\0') {\n        p = 0;\n      }\n      break;\n    }\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G') {\n      p = 0;\n      break;\n    }\n    if (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' && a[1][i] != 'G') {\n      p = 0;\n      break;\n    }\n\n    if (a[0][i] == a[1][i]) {\n      b = b + 1;\n    }\n  }\n  c = b * 1.0 / i;\n\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0;\n  double n;\n  scanf(\"%lf\", &n);\n  char A[500], B[500];\n\n  scanf(\"%s %s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < a; j++) {\n\n    if (A[j] == B[j]) {\n      c++;\n    }\n    if (A[j] != 'A' && A[j] != 'G' && A[j] != 'C' && A[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (B[j] != 'A' && B[j] != 'G' && B[j] != 'C' && B[j] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.0 * c / a) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8078", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int biao = 0, i, j, n, l, d, c = 0, a1 = 0, a2;\n  double v, w;\n  char a[505], b[505];\n  cin >> v;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    biao = 1;\n    printf(\"error\");\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (!((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n            (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))) {\n        biao = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        a1++;\n    }\n    w = 1.0 * a1 / c * 1.0;\n    if (w >= v)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8079", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int pd = 1, i = 0;\n  double x, xg = 0, c, f;\n  char m[501], z[501];\n  cin >> x >> m >> z;\n  c = strlen(m);\n  f = strlen(z);\n  if (c != f) {\n    pd = 0;\n  }\n  for (i = 0; i < c; i++) {\n    if ((m[i] != 'A' && m[i] != 'G' && m[i] != 'C' && m[i] != 'T') ||\n        (z[i] != 'A' && z[i] != 'G' && z[i] != 'C' && z[i] != 'T'))\n      pd = 0;\n    if (m[i] == z[i])\n      xg++;\n  }\n  if (pd == 0)\n    printf(\"error\");\n  else if ((xg / c) >= x)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  int p = 0, n, m, k = 0;\n  char sb[531] = {0};\n  char dsb[531] = {0};\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", sb, dsb);\n  for (int i = 0; i < 531; i++) {\n    if (sb[i] == dsb[i] && sb[i] != 0)\n      p++;\n\n    if (((sb[i] != 'A') && (sb[i] != 'C') && (sb[i] != 'T') && (sb[i] != 'G') &&\n         (sb[i] != 0)) ||\n        ((dsb[i] != 'A') && (dsb[i] != 'C') && (dsb[i] != 'T') &&\n         (dsb[i] != 'G') && (dsb[i] != 0)))\n      k = 1;\n  }\n  n = strlen(sb);\n  m = strlen(dsb);\n  b = 1.0 * p / n;\n  if (m != n || k == 1)\n    cout << \"error\";\n  else if (b > a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, g = 0, j, e, k, flag = 1;\n  double n, m;\n  char s[2][502];\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  e = strlen(s[1]);\n  k = strlen(s[0]);\n  if (e != k) {\n    flag = 0;\n  }\n  if (flag == 1) {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; s[i][j]; j++) {\n        if ((s[i][j] != 'A') && (s[i][j] != 'G') && (s[i][j] != 'C') &&\n            (s[i][j] != 'T')) {\n          flag = 0;\n        }\n      }\n    }\n  }\n  for (j = 0; s[0][j]; j++) {\n    if (s[0][j] == s[1][j]) {\n      g++;\n    }\n  }\n  m = 1.0 * g / e;\n  if (flag == 1) {\n    if (m > n) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[500], c[500];\n  double s = 0;\n  int i;\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", b, c);\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G' &&\n        c[i] != 'A' && c[i] != 'C' && c[i] != 'T' && c[i] != 'G')\n      s = 1;\n  }\n  if (s == 1) {\n    cout << \"error\";\n    return 0;\n  }\n  s = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == c[i])\n      s++;\n  }\n  if (s / strlen(b) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501] = {0};\n  char b[501] = {0};\n  int i, n;\n  double e, s = 0, c;\n  scanf(\"%lf\", &e);\n  cin >> a;\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') &&\n          (b[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')) {\n        cout << \"error\";\n        return 0;\n      }\n\n      else {\n        n = strlen(a);\n\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n    }\n  }\n\n  c = s / n;\n\n  if (c > e) {\n    printf(\"yes\\n\");\n  } else {\n    if (c <= e) {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char a[500], b[500];\n  cin >> n;\n  scanf(\"%s\", a);\n  cin >> b;\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j = 0;\n  double t;\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      goto q;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n    goto q;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    t = 1.0 * j / len1;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"no\");\n  }\nq:\n  return 0;\n}\n"}
{"label": "5", "index": "8085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, n, L, t;\n  double q, p;\n  char a[501], b[501];\n  n = 0;\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  L = strlen(b);\n\n  if (l != L) {\n    printf(\"error\\n\");\n  } else {\n    t = 1;\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    if (t == 1) {\n      q = 1.0 * n / l;\n      if (q > p)\n        cout << \"yes\\n\";\n      else {\n        printf(\"no\\n\");\n      }\n    }\n    if (t == 0) {\n      cout << \"error\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n;\n  int len1, len2, count = 0, i;\n  char s1[100], s2[100];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' ||\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        count = len1 + 1;\n        break;\n      }\n      if (s1[i] == s2[i])\n        count++;\n    }\n    n = 1.0 * count / len1;\n    if (count >= len1 + 1)\n      printf(\"error\\n\");\n    if (n > m && n <= 1)\n      printf(\"yes\\n\");\n    else if (n <= m)\n      printf(\"no\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8087", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y, u = 0, t = 0;\n  double n;\n  char a[505], b[505];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  ;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    t = 0;\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        t += 1;\n        if (a[i] == b[i])\n          u += 1;\n\n      } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n                 (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        t = 0;\n    }\n  }\n  if (t == 0)\n    printf(\"error\");\n  else if (u * 1.0 / x >= n)\n    printf(\"yes\");\n  else if (u * 1.0 / x < n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char zzd[600];\n  char hzy[600];\n  int i;\n  int a;\n  double v;\n  a = 0;\n  double b;\n  int c;\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zzd);\n  cin >> hzy;\n  b = strlen(zzd);\n  for (i = 0; i < b; i++) {\n    if (zzd[i] != 'A' && zzd[i] != 'G' && zzd[i] != 'C' && zzd[i] != 'T') {\n      cout << \"error\";\n      c++;\n      break;\n    } else if (hzy[i] != 'A' && hzy[i] != 'G' && hzy[i] != 'C' &&\n               hzy[i] != 'T') {\n      printf(\"error\");\n      c++;\n      break;\n    } else if (zzd[i] == hzy[i]) {\n      a++;\n    }\n  }\n  if (c == 0) {\n    v = a / b;\n    if (v >= n) {\n      printf(\"yes\");\n    } else if (v < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double s;\n  char sz1[500];\n  char sz2[500];\n  int i, n = 0;\n  int len1, len2;\n  double num;\n  scanf(\"%lf%s%s\", &s, sz1, sz2);\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'C' && sz1[i] != 'G') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'C' && sz2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (sz1[i] == sz2[i]) {\n        n++;\n      }\n    }\n    num = 1.0 * n / len1;\n    if (num > s) {\n      printf(\"yes\");\n      return 0;\n    } else {\n      printf(\"no\");\n      return 0;\n    }\n  }\n}\n"}
{"label": "5", "index": "8090", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cuo(char a) {\n  if (a != 'A' && a != 'T' && a != 'C' && a != 'G')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char a[510] = {0};\n  char b[510] = {0};\n  double bili;\n  cin >> bili >> a >> b;\n  double zong = 0, dui = 0;\n  for (int i = 0; i <= 500; i++) {\n    if (a[i] == 0 || b[i] == 0) {\n      if (a[i] == 0 && b[i] == 0)\n        break;\n      else {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    if (cuo(a[i]) || cuo(b[i])) {\n      cout << \"error\";\n      return 0;\n    }\n    zong++;\n    if (a[i] == b[i])\n      dui++;\n  }\n  if (dui / zong > bili)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, d, l, h;\n  double n, t;\n  char a[500], b[500];\n  cin >> n;\n  d = 0;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(a);\n  h = strlen(b);\n  if (l > h || l < n) {\n    printf(\"error\");\n  } else if (l == h) {\n    for (i = 0, j = 0; a[i] != '\u0000'; i++, j++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (a[i] == b[j]) {\n          d++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    t = (double)d / l;\n    if (t > n) {\n      printf(\"yes\");\n    } else if (t <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double dz;\n  char xl1[500], xl2[500];\n  scanf(\"%lf\", &dz);\n  scanf(\"%s\\n%s\", xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  int e = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    e++;\n  }\n  int i;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'C' && xl1[i] != 'G') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'C' && xl2[i] != 'G')) {\n        e++;\n      }\n    }\n    if (e != 0)\n      printf(\"error\");\n  }\n  int sum = 0;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if (xl1[i] == xl2[i])\n        sum++;\n    }\n    if (1.0 * sum / len1 > dz)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  scanf(\"%d\", &e);\n  return 0;\n}\n"}
{"label": "5", "index": "8093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  double x, t = 0;\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  cin >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    n = strlen(a);\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          t++;\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    if (t / n > x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, sum = 0, flag = 1;\n  double n1, n;\n  char a[512], b[512];\n  scanf(\"%lf %s %s \", &n, a, b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\\n\";\n  else {\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        flag = 0;\n    }\n    for (i = 0; b[i] != 0; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        flag = 0;\n    }\n    if (flag) {\n      for (i = 0; a[i] != 0; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      n1 = (double)sum / (double)strlen(a);\n      if (n1 > n)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h(char s[1000]) {\n  int i;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'T' && s[i] != 'C') {\n      i = 1;\n      break;\n    }\n  }\n  if (i != 1) {\n    i = 0;\n  }\n  return i;\n}\nint main() {\n  double c, d, e;\n  int j;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else if (h(a) || h(b)) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == b[j]) {\n        e++;\n      }\n    }\n    d = e / strlen(a);\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2;\n  float s, w, L;\n  char x[501], y[501];\n  scanf(\"%f\", &w);\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  s = 0;\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n      if (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') {\n        printf(\"error\");\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          s++;\n        }\n      }\n    }\n    L = l1;\n    if (i == l1) {\n      if (s / L > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double n, j = 0, e = 0;\n  char s[501], a[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  len1 = strlen(s);\n  len2 = strlen(a);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n        (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if ((s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' ||\n         a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        s[i] == a[i]) {\n      j = j + 1;\n    }\n  }\n  e = j / len1;\n  if (e > n) {\n    printf(\"yes\");\n  } else if (e <= n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, same = 0;\n  double rate, z;\n  char DNA[2][600];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", DNA[0], DNA[1]);\n\n  len1 = strlen(DNA[0]);\n  len2 = strlen(DNA[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (((DNA[0][i] != 'A') && (DNA[0][i] != 'G') && (DNA[0][i] != 'C') &&\n           (DNA[0][i] != 'T')) ||\n          ((DNA[1][i] != 'A') && (DNA[1][i] != 'G') && (DNA[1][i] != 'C') &&\n           (DNA[1][i] != 'T'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (DNA[0][i] == DNA[1][i])\n          same++;\n      }\n    }\n    z = (1.0 * same) / len1;\n    if (z >= rate)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int i, n, j, k;\n  float v;\n  j = 0;\n  k = 0;\n  n = 0;\n  scanf(\"%f\", &v);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    j = j + 1;\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    k = k + 1;\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (j != k) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      n = n + 1;\n    }\n  }\n  if (v * j < n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8100", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cuo(char a) {\n  if (a != 'A' && a != 'T' && a != 'C' && a != 'G')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char a[510] = {0};\n  char b[510] = {0};\n  double bili;\n  cin >> bili >> a >> b;\n  double zong = 0, dui = 0;\n  for (int i = 0; i <= 500; i++) {\n    if (a[i] == 0 || b[i] == 0) {\n      if (a[i] == 0 && b[i] == 0)\n        break;\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    if (cuo(a[i]) || cuo(b[i])) {\n      cout << \"error\";\n      return 0;\n    }\n    zong++;\n    if (a[i] == b[i])\n      dui++;\n  }\n  if (dui / zong > bili)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, m, c, r, k;\n  double n, y;\n  char a[502], b[502];\n  x = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  c = strlen(b);\n  r = 1;\n  k = 1;\n  if (m != c) {\n    k = 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n        b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n      r = 1;\n    } else {\n      r = 0;\n    }\n    if (r == 0 || k == 0) {\n      cout << \"error\";\n      break;\n    }\n  }\n  if (r == 1 && k == 1) {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = 1.0 * x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500] = {'0'}, b[500] = {'0'};\n  double n, flag = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < la; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[i])\n      flag++;\n  }\n  flag = (double)flag / la;\n  if (flag > n)\n    printf(\"yes\\n\");\n  if (flag <= n)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, num = 0, t = 1;\n  double rate;\n  char a[500], b[500];\n  cin >> rate;\n  cin >> a;\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    cout << \"error\";\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i] &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))\n        num++;\n      else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\"error\");\n    else {\n      if (num * 1.0 / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8104", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, x;\n  double n, result = 0, result1;\n  char dna1[500];\n  char dna2[500];\n  scanf(\"%lf \", &n);\n  cin >> dna1 >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n           (dna1[i] == 'G')) &&\n          ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n           (dna2[i] == 'G'))) {\n        x = 1;\n      } else {\n        x = 0;\n        break;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (x == 1) {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] != dna2[i]) {\n        result++;\n      }\n    }\n    result1 = (double)1 - (result / len1);\n    if ((result1) > n) {\n      printf(\"yes\");\n    }\n    if ((result1) <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8105", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, a, b;\n\n  double n = 0, r;\n\n  char x[500], y[500], z;\n\n  scanf(\"%lf %c \", &r, &z);\n\n  scanf(\"%s \", x);\n\n  a = strlen(x);\n\n  cin >> y;\n\n  b = strlen(y);\n\n  if (a != b) {\n\n    printf(\"error\");\n\n  }\n\n  else {\n\n    for (i = 0; i < a; i++) {\n\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n\n        printf(\"error\");\n\n        n = -1;\n        break;\n\n      }\n\n      else {\n\n        if (x[i] == y[i]) {\n\n          n++;\n        }\n      }\n    }\n    n = n / a;\n\n    if (n > r) {\n\n      printf(\"yes\");\n\n    }\n\n    else if (n >= 0) {\n\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, r;\n  int l, t, i;\n  char a[501], b[501];\n  t = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] == b[i])\n      t++;\n  }\n  r = t * 1.0 / l;\n  if (r > n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m;\n  double s;\n  int i;\n  int c = 0;\n  double z;\n  double q = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      c = 1;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      c = 1;\n    }\n  }\n  if (c == 1 || m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n\n    if (q / n >= s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[51], b[51];\n  int i, j = 0, k;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    for (i = 0; b[i] != '\\0'; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n\n    k = strlen(a);\n    t = 1.0 * j / k;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8109", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, yiyang = 0, zongliang = 0, x;\n  char lian1[501], lian2[501];\n  double biaozhun, jieguo;\n  cin >> biaozhun;\n  cin >> lian1 >> lian2;\n  for (i = 0; lian1[i] != '\\0' && lian2[i] != '\\0'; i++) {\n    if ((lian1[i] == 'A' || lian1[i] == 'C' || lian1[i] == 'T' ||\n         lian1[i] == 'G') &&\n        (lian2[i] == 'A' || lian2[i] == 'C' || lian2[i] == 'T' ||\n         lian2[i] == 'G')) {\n      if (lian1[i] == lian2[i]) {\n        yiyang++;\n      }\n      zongliang++;\n    } else {\n      printf(\"error\");\n      x = 99;\n      break;\n    }\n  }\n  if (lian1[zongliang] != '\\0' || lian2[zongliang] != '\\0') {\n    if (x != 99) {\n      printf(\"error\");\n    }\n    zongliang = 0;\n  }\n  if (zongliang != 0) {\n    jieguo = 1.0 * yiyang / zongliang;\n    if (jieguo > biaozhun) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  char d[3][501];\n  double n, m, a, b, c, x;\n  x = 0;\n  scanf(\"%lf\", &a);\n  cin >> d[1];\n  scanf(\"%s\", &d[2]);\n  n = strlen(d[1]);\n  m = strlen(d[2]);\n  for (i = 0; i < n; i++) {\n    if ((d[1][i] != 'A' && d[1][i] != 'G' && d[1][i] != 'C' &&\n         d[1][i] != 'T') ||\n        (d[2][i] != 'A' && d[2][i] != 'G' && d[2][i] != 'C' &&\n         d[2][i] != 'T')) {\n      x++;\n    }\n  }\n  if (m != n || x > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (d[1][i] == d[2][i]) {\n        b++;\n      }\n    }\n    c = b / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, n;\n  int i, k = 0, s = 0, len1, len2, j = 0;\n  char a[10], dna1[510], dna2[510];\n  scanf(\"%lf\", &n);\n\n  cin >> a;\n\n  cin >> dna1;\n\n  cin >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; dna1[i] != '\u0000'; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n           dna1[i] != 'T') ||\n          (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n           dna2[i] != 'T')) {\n        printf(\"error\");\n        j++;\n        break;\n      } else {\n        if (dna1[i] == dna2[i])\n          k++;\n\n        s++;\n      }\n    }\n    if (j == 0) {\n      x = 1.0 * k / s;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[100], b[100], c[100];\nint main() {\n  int sum = 0;\n  double m;\n  double s;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a), y = strlen(b);\n  a[x] = '\\0';\n  b[y] = '\\0';\n  if (x != y) {\n    printf(\"error\");\n    return 0;\n  }\n  int i;\n  for (i = 0; i < x; i++) {\n    if (a[i] == 'A') {\n      c[i] = 'A';\n    } else if (a[i] == 'T') {\n      c[i] = 'T';\n    } else if (a[i] == 'C') {\n      c[i] = 'C';\n    } else if (a[i] == 'G') {\n      c[i] = 'G';\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (b[i] == c[i]) {\n      sum++;\n    }\n  }\n  s = 1.0 * sum / x;\n  if (s >= m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int la, lb, i, d;\n  double t, tt;\n  char a[505], b[505];\n  scanf(\"%lf\", &t);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  d = -1;\n  if (la == lb) {\n    d = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] == b[i]) {\n        d++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        d = -1;\n        break;\n      }\n    }\n  }\n  if (d < 0)\n    cout << \"error\";\n  else {\n    tt = d * 1.000 / la;\n    if (tt > t)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p;\n  int e = 0, t = 0, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    q = 1;\n  else {\n    for (int i = 0; 1; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (a[i] == b[i])\n        e++;\n      t++;\n    }\n  }\n  if (q == 1)\n    printf(\"error\");\n  else {\n    if (p < 1.0 * e / t)\n      cout << \"yes\";\n    if (p > 1.0 * e / t)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, b;\n  char sz[520], zfc[520];\n  double a, m;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", sz);\n  scanf(\"%s\\n\", zfc);\n  n = strlen(zfc);\n  k = 0;\n  b = 0;\n  if (strlen(sz) != n) {\n    cout << \"error\";\n    b = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'G' && sz[i] != 'C') ||\n          (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'G' && zfc[i] != 'C')) {\n        printf(\"error\");\n        b = 1;\n        break;\n      } else {\n        if (sz[i] == zfc[i]) {\n          k++;\n        }\n      }\n    }\n  }\n  if (b == 0) {\n    m = 1.0 * k / n;\n    if (m > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double std, s;\n  int i, n1, n2, t = 0;\n  char s1[500], s2[500];\n  cin >> std;\n  scanf(\"%s\", &s1);\n  cin >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  if (n1 != n2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] == s2[i])\n      t++;\n  }\n  s = (double)t / n1;\n  if (s > std)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double e;\n  char zf[2][501], count = 0, c, w = 0;\n  scanf(\"%lf%c\", &e, &c);\n\n  cin >> zf[0];\n\n  cin >> zf[1];\n  int a = strlen(zf[0]), b = strlen(zf[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int m = 0; m < a; m++) {\n      for (int o = 0; o < 2; o++) {\n        if (zf[o][m] != 'A' && zf[o][m] != 'T' && zf[o][m] != 'G' &&\n            zf[o][m] != 'C') {\n          w++;\n        }\n      }\n    }\n    if (w != 0) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i < a; i++) {\n        if (zf[0][i] == zf[1][i]) {\n          count++;\n        }\n      }\n      if (1.0 * count / a > e) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, n;\n  double m;\n  char a[501], b[501];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\\n%s\", a, b);\n  n = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / n > m) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bz, sj;\n  int n1, n2, n, i, p;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", jy1);\n  scanf(\"%s\", jy2);\n  p = 0;\n  n1 = strlen(jy1);\n  n2 = strlen(jy2);\n  if (n1 == n2) {\n    n = n1;\n  } else {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((jy1[i] != 65 && jy1[i] != 84 && jy1[i] != 67 && jy1[i] != 71) ||\n        (jy2[i] != 65 && jy2[i] != 84 && jy2[i] != 67 && jy2[i] != 71)) {\n      cout << \"error\";\n      return 0;\n    } else {\n      if (jy1[i] == jy2[i]) {\n        p++;\n      } else {\n        p = p;\n      }\n    }\n  }\n  sj = 1.0 * p / n;\n  if (sj >= bz) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[500];\n  char b[500];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  int i, x;\n  x = 0;\n\n  double w, k, j, l;\n\n  k = strlen(a);\n  l = strlen(b);\n\n  if (k == l) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n      if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n    }\n    if (x == 1) {\n      w = 0;\n\n      for (i = 0; i < k; i++) {\n        if (a[i] == b[i])\n          w = w + 1;\n      }\n\n      j = w / k;\n\n      if (j <= n)\n        printf(\"no\");\n      else\n        cout << \"yes\";\n    } else\n      printf(\"error\");\n  }\n\n  else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8121", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, p = 0;\n  float m, k, s = 0;\n  char zfc[2][500], n[10];\n\n  scanf(\"%s \", n);\n  m = atof(n);\n  for (i = 0; i < 2; i++) {\n\n    cin >> zfc[i];\n  }\n  a = strlen(zfc[0]);\n  b = strlen(zfc[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; zfc[i][j] != '\u0000'; j++) {\n        if (zfc[i][j] != 'A' && zfc[i][j] != 'G' && zfc[i][j] != 'C' &&\n            zfc[i][j] != 'T') {\n          p = 1;\n        }\n      }\n    }\n    if (p == 0) {\n      for (i = 0; zfc[0][i] != '\u0000'; i++) {\n        if (zfc[0][i] == zfc[1][i]) {\n          s++;\n        }\n      }\n      k = s / (a * 1.0);\n      if (k > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8122", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  double n = 0, biao, l = 1, len;\n  char shuzu[3][501];\n  cin >> biao;\n  for (i = 0; i < 3; i++) {\n    cin >> shuzu[i];\n  }\n  len = 1.0 * strlen(shuzu[0]);\n  if (strlen(shuzu[0]) - strlen(shuzu[1])) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if (!((shuzu[0][i] == 'A' || shuzu[0][i] == 'G' || shuzu[0][i] == 'C' ||\n             shuzu[0][i] == 'T') &&\n            (shuzu[1][i] == 'A' || shuzu[1][i] == 'G' || shuzu[1][i] == 'C' ||\n             shuzu[1][i] == 'T'))) {\n        l = 0;\n      }\n      if (shuzu[0][i] == shuzu[1][i])\n        n++;\n    }\n    if (l) {\n      if ((n / len) > biao)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n\n    } else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, num = 0, a1, b1, t = 1;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf \", &n);\n  scanf(\"%s%s\", a, b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n\n    t = 0;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n    }\n  }\n\n  if (t == 1) {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    if (1.0 * num / a1 > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8124", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b = 0, c = 0, l1 = 0, l2 = 0;\n  int i, t = 0;\n  char m[501], n[501];\n\n  cin >> a;\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\\n\", n);\n\n  l1 = strlen(m);\n  l2 = strlen(n);\n\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if ((m[i] == 'A' || m[i] == 'T' || m[i] == 'C' || m[i] == 'G') &&\n          (n[i] == 'A' || n[i] == 'T' || n[i] == 'C' || n[i] == 'G'))\n        t++;\n    }\n\n    if (t != l1)\n      printf(\"error\\n\");\n    else {\n      b = l1;\n      for (i = 0; i < l1; i++) {\n        if (m[i] == n[i])\n          c++;\n      }\n\n      if (c / b > a)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8125", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int e, z;\n  double n;\n  e = 0;\n  z = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[500] = {'\\0'};\n  char b[500] = {'\\0'};\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s \", b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        z = 1;\n      }\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z == 0) {\n      int t = 1.0000000 * e / (c - 3);\n      if (t >= n) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8126", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double bill;\n  scanf(\"%lf\", &bill);\n\n  char s1[500] = {0};\n  char s2[500] = {0};\n  scanf(\"%s\", s1);\n  cin >> s2;\n\n  int lens1, lens2, flag;\n  flag = 0;\n  lens1 = strlen(s1);\n  lens2 = strlen(s2);\n  if (lens1 != lens2) {\n    printf(\"error\");\n    flag = 1;\n  }\n\n  int i;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] != 'A') {\n        if (s1[i] != 'T') {\n          if (s1[i] != 'C') {\n            if (s1[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (flag == 0) {\n    for (i = 0; i < lens2; i++) {\n      if (s2[i] != 'A') {\n        if (s2[i] != 'T') {\n          if (s2[i] != 'C') {\n            if (s2[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  double num, avg;\n  num = 0;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] == s2[i]) {\n        num++;\n      }\n    }\n    avg = num / (double)lens1;\n    if (avg > bill)\n      printf(\"yes\");\n\n    if (avg <= bill) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate, realrate;\n  char a[500], b[500];\n  int len, lenb, yes = 0;\n  scanf(\"%lf\", &rate);\n\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  len = strlen(a);\n  lenb = strlen(b);\n  if (len != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      cout << \"error\";\n      return 0;\n    }\n\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      yes++;\n    }\n  }\n  realrate = 1.0 * yes / len;\n  if (realrate >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  int tag = 1;\n  double xsd;\n  char zfc[2][500];\n  int len;\n  int count = 0;\n  scanf(\"%lf\", &m);\n  for (int i = 0; i < 2; i++) {\n    cin >> zfc[i];\n  }\n  len = strlen(zfc[0]);\n  for (int j = 0; j < len; j++) {\n    if ((zfc[0][j] != 'A') && (zfc[0][j] != 'G') && (zfc[0][j] != 'C') &&\n        (zfc[0][j] != 'T')) {\n      tag = 0;\n      break;\n    }\n    if (zfc[0][j] == zfc[1][j]) {\n      count++;\n    }\n  }\n  xsd = (double)count / len;\n  if (tag == 0) {\n    printf(\"error\");\n  } else if (strlen(zfc[0]) != strlen(zfc[1])) {\n    printf(\"error\");\n  }\n\n  else if (xsd > m) {\n    cout << \"yes\";\n  } else if (xsd <= m) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, t, l, p, sum = 0;\n\n  double b, n;\n\n  char z[500], s[500];\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", z);\n\n  scanf(\"%s\", s);\n\n  l = strlen(z);\n\n  p = strlen(s);\n\n  if (l != p) {\n\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (z[i] == 'A' && s[i] == 'A')\n        sum++;\n\n      else if (z[i] == 'T' && s[i] == 'T')\n        sum++;\n\n      else if (z[i] == 'C' && s[i] == 'C')\n        sum++;\n\n      else if (z[i] == 'G' && s[i] == 'G')\n        sum++;\n\n      else if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n               (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n        t = 0;\n\n        break;\n      }\n    }\n\n    if (t == 0)\n      printf(\"error\");\n\n    else {\n      b = (double)sum / l;\n\n      if (b > n)\n        cout << \"yes\";\n\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8130", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  int s = 0, len1, len2, i;\n  char b[501], c[501], e[501];\n  scanf(\"%lf\", &n);\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n\n  cin >> e;\n  len1 = strlen(c);\n  len2 = strlen(e);\n  for (i = 0; i < len1; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G') {\n      len1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (e[i] != 'A' && e[i] != 'T' && e[i] != 'C' && e[i] != 'G') {\n      len2 = 2;\n      break;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (c[i] == e[i]) {\n        s++;\n      }\n    }\n    if (1.0 * s / len1 >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8131", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int w = 0, g = 0;\n\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  cin >> v;\n  cin >> c;\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else if ((l <= n) && (g == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2;\n  float s, w, L;\n  char x[501], y[501];\n  cin >> w;\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  s = 0;\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n      if (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') {\n        cout << \"error\";\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          s++;\n        }\n      }\n    }\n    L = l1;\n    if (i == l1) {\n      if (s / L > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0, b, c;\n  char zfc[2][501];\n  cin >> a;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  b = strlen(zfc[0]);\n  c = strlen(zfc[1]);\n  if (b != c) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; zfc[0][i] != '\\0'; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (zfc[0][i] == zfc[1][i]) {\n        j++;\n      }\n    }\n  }\n  if ((double)1.0 * j / strlen(zfc[0]) > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[1000], s2[1000];\n\n  int i, j, k, l1, n, l2;\n  double m;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    n = 0;\n    for (i = 0; i < l1; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        printf(\"error\");\n        exit(0);\n      }\n      if (s1[i] == s2[i])\n        n++;\n    }\n    if (1.0 * n / l1 >= m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bz, sj;\n  int n1, n2, n, i, p;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", jy1);\n  cin >> jy2;\n  p = 0;\n  n1 = strlen(jy1);\n  n2 = strlen(jy2);\n  if (n1 == n2) {\n    n = n1;\n  } else {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((jy1[i] != 65 && jy1[i] != 84 && jy1[i] != 67 && jy1[i] != 71) ||\n        (jy2[i] != 65 && jy2[i] != 84 && jy2[i] != 67 && jy2[i] != 71)) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (jy1[i] == jy2[i]) {\n        p++;\n      } else {\n        p = p;\n      }\n    }\n  }\n  sj = 1.0 * p / n;\n  if (sj >= bz) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char z1[500], z2[500];\n  int l = 1;\n  double q, m;\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", &z1, &z2);\n  if (strlen(z1) != strlen(z2)) {\n    printf(\"error\");\n    l = 0;\n  } else {\n    for (int i = 0; i < strlen(z1); i++) {\n      if ((z1[i] != 'A' && z1[i] != 'T' && z1[i] != 'G' && z1[i] != 'C') ||\n          (z2[i] != 'A' && z2[i] != 'T' && z2[i] != 'G' && z2[i] != 'C')) {\n        printf(\"error\");\n        l = 0;\n        break;\n      } else if (z1[i] == z2[i])\n        q++;\n    }\n  }\n  if (q / strlen(z1) > m && l == 1)\n    printf(\"yes\");\n  else if (l == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, c = 0;\n  int i, n, b = 0;\n  char q[500], w[500], num[50];\n\n  cin >> num;\n  a = atof(num);\n\n  cin >> q;\n\n  cin >> w;\n  n = strlen(q);\n  for (i = 0; i < n; i++) {\n    if (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G') {\n      b++;\n    }\n    if (w[i] != 'A' && w[i] != 'T' && w[i] != 'C' && w[i] != 'G')\n      b++;\n  }\n  if (b != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < n; i++) {\n      if (q[i] == w[i])\n        c++;\n    }\n    c = c / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  int x1, x2, y = 0, i, flag = 0;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &rate, a, b);\n  x1 = strlen(a);\n  x2 = strlen(b);\n  for (i = 0; i < x1; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < x1; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0 && x1 == x2) {\n    for (i = 0; i < x1; i++) {\n      if (a[i] == b[i]) {\n        y++;\n      }\n    }\n    if ((double)y / (double)x1 > rate) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, k, l = 0;\n  k = 0;\n  double d;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k = 1;\n    printf(\"error\");\n  }\n  if (strlen(a) == strlen(b)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        l++;\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    if ((1.0 * l / strlen(a)) >= d)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i;\n  double m, ac, bc, n;\n  k = 0;\n  m = 0;\n  ac = 0;\n  bc = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  ac = strlen(a) - 1;\n  bc = strlen(b) - 1;\n  if (ac != bc) {\n    k++;\n    cout << \"error\";\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k++;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n    }\n  }\n  if (k == 0) {\n    if (m / ac >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int x, y;\n  int i, s = 0, q = 0;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  cin >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n    t = n * x;\n    if (s > t) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8142", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double xgd, bz;\n  int l, i, count;\n  char dna1[110], dna2[110];\n  count = 0;\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", dna1);\n  cin >> dna2;\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if (!(dna1[i] == 'A' || dna1[i] == 'G' || dna1[i] == 'C' ||\n          dna1[i] == 'T') ||\n        !(dna2[i] == 'A' || dna2[i] == 'G' || dna2[i] == 'C' ||\n          dna2[i] == 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (dna1[i] == dna2[i])\n      count++;\n  }\n  xgd = 1.0 * count / l;\n  if (xgd >= bz)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, f = 1;\n  char a[2][255];\n  double x, k, t = 0;\n  scanf(\"%lf\", &x);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  k = strlen(a[0]);\n  for (j = 0; j < k; j++) {\n    if ((a[0][j] != 'A' && a[0][j] != 'C' && a[0][j] != 'T' &&\n         a[0][j] != 'G') ||\n        (a[1][j] != 'A' && a[1][j] != 'T' && a[1][j] != 'C' &&\n         a[1][j] != 'G')) {\n      printf(\"error\");\n      f = 0;\n      break;\n    }\n    if (a[0][j] == a[1][j])\n      t++;\n  }\n  if (f == 1) {\n    if (t / k > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, m, n, s = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) &&\n          ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T'))) {\n        if (a[i] == b[i]) {\n          s++;\n        } else {\n          s = s;\n        }\n      } else {\n        s = -1;\n        break;\n      }\n    }\n    s = s / m;\n    if (s < 0) {\n      printf(\"error\");\n    } else if (s >= 0 && s <= k) {\n      printf(\"no\");\n    } else {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[505], s2[505];\n  double n, m = 0, len1, len2, flag = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i < len1; i++) {\n    if ((s1[i] == 'A') || (s1[i] == 'T') || (s1[i] == 'C') || (s1[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((s2[i] == 'A') || (s2[i] == 'T') || (s2[i] == 'C') || (s2[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n\n  if ((len1 != len2) || (flag == 1)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= len1; i++) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    }\n    m = m / len1;\n    if (m > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a = 0, l = 0;\n  double m, n;\n  char zf[2][10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", zf[0]);\n  scanf(\"%s\", zf[1]);\n  j = strlen(zf[0]);\n  k = strlen(zf[1]);\n  for (i = 0; zf[0][i] != '\\0' && zf[1][i] != '\\0'; i++) {\n    if ((zf[0][i] > 'a' && zf[0][i] < 'z') ||\n        (zf[1][i] > 'a' && zf[1][i] < 'z')) {\n      l++;\n    }\n  }\n  if (j != k || l > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zf[0][i] != '\\0'; i++) {\n      if (zf[0][i] == zf[1][i]) {\n        a = a + 1;\n      }\n    }\n    n = 1.0 * a / j;\n    if (n >= m)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c = 0;\n  int i, j = 0, zs;\n  char s1[501], s2[501];\n  cin >> n;\n  scanf(\"%s%s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n  } else {\n    zs = strlen(s1);\n    for (i = 0; i < zs; i++) {\n      if (s1[i] == 'G' || s1[i] == 'A' || s1[i] == 'C' || s1[i] == 'T') {\n        j++;\n      }\n    }\n\n    if (j != zs) {\n      printf(\"error\");\n      return 0;\n    } else {\n      for (i = 0; i < zs; i++) {\n        if (s1[i] - s2[i] == 0) {\n          c = c + 1;\n        }\n      }\n      if (c / zs > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, m, d = 0, b = 1;\n  char zf[501] = {0}, zc[501] = {0};\n  double a, e;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zf);\n  scanf(\"%s\", zc);\n  l = strlen(zf);\n  m = strlen(zc);\n  if (l != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (zf[i] != 'A' && zf[i] != 'T' && zf[i] != 'C' && zf[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n      if (zc[i] != 'A' && zc[i] != 'T' && zc[i] != 'C' && zc[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n    }\n    if (b == 1) {\n      for (i = 0; i < l; i++) {\n        if (zf[i] == zc[i]) {\n          d++;\n        }\n      }\n      e = 1.0 * d / l;\n      if (e > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501], isbreak;\n  isbreak = 'n';\n  double x, n;\n  int i, l1, l2, t;\n  t = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", DNA1, DNA2);\n  l1 = strlen(DNA1);\n  l2 = strlen(DNA2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'C' &&\n           DNA1[i] != 'G') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'C' &&\n           DNA2[i] != 'G')) {\n        isbreak = 'y';\n        break;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          t++;\n        }\n      }\n    }\n    if (isbreak == 'y') {\n      printf(\"error\");\n    } else {\n      x = (1.0 * t) / l1;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8150", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, len1, len2;\n  double p;\n  char a[501], b[501];\n  cin >> p;\n  cin >> a;\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i])\n      n++;\n  }\n  if ((double)n / len1 > p)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[501], s2[502];\n  int l1, l2, i;\n  double std, aa;\n  scanf(\"%lf\\n\", &std);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  aa = -1;\n  if (l1 == l2) {\n    aa = 0;\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i])\n        aa++;\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n        aa = -1;\n        break;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'T' && s2[i] != 'G') {\n        aa = -1;\n        break;\n      }\n    }\n  }\n  if (aa == -1) {\n    printf(\"error\");\n  } else {\n    aa = aa / l1;\n    if (aa > std)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8152", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, m, c, r, k;\n  double n, y;\n  char a[502], b[502];\n  x = 0;\n  scanf(\"%lf \", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  m = strlen(a);\n  c = strlen(b);\n  r = 1;\n  k = 1;\n  if (m != c) {\n    k = 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n        b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n      r = 1;\n    } else {\n      r = 0;\n    }\n    if (r == 0 || k == 0) {\n      printf(\"error\");\n      break;\n    }\n  }\n  if (r == 1 && k == 1) {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = 1.0 * x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w1[501], w2[501];\n  int len1, len2;\n  int i, a = 0, b = 0;\n  double n, m;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", w1);\n  scanf(\"%s\", w2);\n  len1 = strlen(w1);\n  len2 = strlen(w2);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        b = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (w1[i] - w2[i] == 0)\n        a++;\n    }\n    m = 1.0 * a / (len1 - 1);\n    if (m > n && b == 0)\n      printf(\"yes\");\n    if (m < n && b == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[500];\n  char b[500];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  int i, x;\n  x = 0;\n\n  double w, k, j, l;\n\n  k = strlen(a);\n  l = strlen(b);\n\n  if (k == l) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n      if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') {\n        x = 1;\n      } else {\n        x = 0;\n        break;\n      }\n    }\n    if (x == 1) {\n      w = 0;\n\n      for (i = 0; i < k; i++) {\n        if (a[i] == b[i])\n          w = w + 1;\n      }\n\n      j = w / k;\n\n      if (j <= n)\n        printf(\"no\");\n      else\n        cout << \"yes\";\n    } else\n      printf(\"error\");\n  }\n\n  else\n    cout << \"error\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "8155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, n;\n  int i, k = 0, s = 0, len1, len2, j = 0;\n  char a[10], dna1[510], dna2[510];\n  scanf(\"%lf\", &n);\n\n  cin >> a;\n\n  cin >> dna1;\n\n  cin >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; dna1[i] != '\u0000'; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n           dna1[i] != 'T') ||\n          (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n           dna2[i] != 'T')) {\n        printf(\"error\");\n        j++;\n        break;\n      } else {\n        if (dna1[i] == dna2[i]) {\n          k++;\n        }\n        s++;\n      }\n    }\n    if (j == 0) {\n      x = 1.0 * k / s;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[510], d[510];\n  int i, e;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", d);\n  e = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(d);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n      if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == d[i]) {\n          e++;\n        }\n      }\n    }\n    bl = 1.0 * e / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, f = 0, e = 0, i;\n  double a, h;\n  char d[3][502];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++)\n    scanf(\"%s\", d[i]);\n\n  b = strlen(d[0]);\n  c = strlen(d[1]);\n  if (b == c) {\n    for (f = 0; f < b; f++) {\n      if (d[0][f] == d[1][f]) {\n        e++;\n      }\n    }\n    for (f = 0; f < b; f++) {\n      if ((d[0][f] != 'A' && d[0][f] != 'G' && d[0][f] != 'C' &&\n           d[0][f] != 'T') ||\n          (d[1][f] != 'A' && d[1][f] != 'G' && d[1][f] != 'C' &&\n           d[1][f] != 'T')) {\n        break;\n      }\n    }\n    if (f == b) {\n      h = e * 1.0 / b;\n      if (h > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, m, n, p;\n  int l, k, q, i;\n  char b[500], c[500];\n  k = 0;\n  scanf(\"%lf\", &a);\n  cin >> b >> c;\n  l = strlen(b);\n  q = strlen(c);\n  if (l != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (b[i] == c[i])\n      k++;\n  }\n  m = l;\n  n = k;\n  p = n / m;\n  if (p > a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, yiyang = 0, zongliang = 0, x;\n  char lian1[501], lian2[501];\n  double biaozhun, jieguo;\n  cin >> biaozhun;\n  cin >> lian1 >> lian2;\n  for (i = 0; lian1[i] != '\\0' && lian2[i] != '\\0'; i++) {\n    if ((lian1[i] == 'A' || lian1[i] == 'C' || lian1[i] == 'T' ||\n         lian1[i] == 'G') &&\n        (lian2[i] == 'A' || lian2[i] == 'C' || lian2[i] == 'T' ||\n         lian2[i] == 'G')) {\n      if (lian1[i] == lian2[i]) {\n        yiyang++;\n      }\n      zongliang++;\n    } else {\n      printf(\"error\");\n      x = 99;\n      break;\n    }\n  }\n  if (lian1[zongliang] != '\\0' || lian2[zongliang] != '\\0') {\n    if (x != 99) {\n      cout << \"error\";\n    }\n    zongliang = 0;\n  }\n  if (zongliang != 0) {\n    jieguo = 1.0 * yiyang / zongliang;\n    if (jieguo > biaozhun) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int m, n, i, c = 0;\n  int r = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (m != n) {\n    c = 3;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i]) {\n      r++;\n    }\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')) {\n      c = 3;\n      break;\n    }\n  }\n  y = 1.0 * r / n;\n  if ((y > x) && (c == 0)) {\n    cout << \"yes\";\n  }\n  if ((y <= x) && (c == 0)) {\n    printf(\"no\");\n  }\n  if (c == 3) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, j, k = 1;\n  char d[2][501];\n  double g, e, m;\n  scanf(\"%lf\", &g);\n  scanf(\"%s\", d[0]);\n  scanf(\"%s\", d[1]);\n  l1 = strlen(d[0]);\n  l2 = strlen(d[1]);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (j = 0; j < 2; j++) {\n      for (i = 0; i < l1; i++) {\n        if (d[j][i] != 'A' && d[j][i] != 'T' && d[j][i] != 'C' &&\n            d[j][i] != 'G') {\n          k = 0;\n          break;\n        }\n        if (k == 0) {\n          break;\n        }\n      }\n    }\n    if (k == 1) {\n      for (i = 0; i < l1; i++) {\n        if (d[0][i] == d[1][i]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (l1 == l2) {\n    if (k == 1) {\n      m = 1.0 * e / l1;\n      if (m > g) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, lena, lenb;\n  double r, same = 0, j = 0;\n  char a[10000];\n  char b[10000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= lena - 1; i++) {\n      if (a[i] == b[i])\n        same++;\n      else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      }\n    }\n  }\n  if (j == 0 && lena == lenb) {\n    if ((same / lena) > r) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int k, i, j = 0, l;\n  char s[501];\n  char c[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", c);\n  k = strlen(s);\n  l = strlen(c);\n  for (i = 0; s[i]; i++) {\n    if (k != l || (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n        (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n      j = -1;\n      break;\n    }\n    if (0 == s[i] - c[i]) {\n      j++;\n    }\n  }\n  if (n <= 1.00 * j / k && j != 0) {\n    printf(\"yes\");\n  } else if (j == -1) {\n    printf(\"error\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[510], A[510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B);\n  for (i = 0; B[i] != '\\0'; i++) {\n    if (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G')\n      a = 1;\n  }\n  scanf(\"%s\", A);\n  for (i = 0; A[i] != '\\0'; i++) {\n    if (A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B) != strlen(A) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B);\n  for (i = 0; i < l; i++) {\n    if (B[i] == A[i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, i, j, count;\n  double a, x, y, z;\n  char m[550], n[550];\n  scanf(\"%lf\\n%s\\n%s\\n\", &a, m, n);\n  b = strlen(m);\n  c = strlen(n);\n  if (b != c)\n    printf(\"error\");\n  j = 0;\n  if (b == c) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G')\n        j++;\n    }\n    for (i = 0; n[i] != '\\0'; i++) {\n      if (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')\n        j++;\n    }\n    if (j > 0)\n      printf(\"error\");\n  }\n  count = 0;\n  if (b == c && j == 0) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] == n[i])\n        count++;\n    }\n    y = count;\n    z = b;\n    x = z * a;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8166", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  char b[500], c[500];\n  double s = 0;\n  int i;\n  cin >> a;\n  scanf(\"%s %s \", b, c);\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G' &&\n        c[i] != 'A' && c[i] != 'C' && c[i] != 'T' && c[i] != 'G')\n      s = 1;\n  }\n  if (s == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  s = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == c[i])\n      s++;\n  }\n  if (s / strlen(b) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char zfc[500], sz[500];\n  cin >> zfc >> sz;\n  int a = strlen(zfc);\n  int b = strlen(sz);\n  int m;\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    m = a;\n    int k = 0;\n    int y;\n    for (y = 0; y < m; y++) {\n      if (zfc[y] != 'A' && zfc[y] != 'T' && zfc[y] != 'C' && zfc[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n      if (sz[y] != 'A' && sz[y] != 'T' && sz[y] != 'C' && sz[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n\n      int i, c = 0;\n      for (i = 0; i < m; i++) {\n        if (zfc[i] == sz[i]) {\n          c++;\n        }\n      }\n      double s = c * 1.0 / m;\n      if (s > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n;\n  int len1, len2, count = 0, i;\n  char s1[100], s2[100];\n  scanf(\"%lf\", &m);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' ||\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        count = len1 + 1;\n        break;\n      }\n      if (s1[i] == s2[i])\n        count++;\n    }\n    n = 1.0 * count / len1;\n    if (count >= len1 + 1)\n      cout << \"error\\n\";\n    if (n > m && n <= 1)\n      printf(\"yes\\n\");\n    else if (n <= m)\n      printf(\"no\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  int p = 0, n, m, k = 0;\n  char sb[531] = {0};\n  char dsb[531] = {0};\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", sb, dsb);\n  for (int i = 0; i < 531; i++) {\n    if (sb[i] == dsb[i] && sb[i] != 0) {\n      p++;\n    }\n    if (((sb[i] != 'A') && (sb[i] != 'C') && (sb[i] != 'T') && (sb[i] != 'G') &&\n         (sb[i] != 0)) ||\n        ((dsb[i] != 'A') && (dsb[i] != 'C') && (dsb[i] != 'T') &&\n         (dsb[i] != 'G') && (dsb[i] != 0)))\n      k = 1;\n  }\n  n = strlen(sb);\n  m = strlen(dsb);\n  b = 1.0 * p / n;\n  if (m != n || k == 1)\n    cout << \"error\";\n  else if (b > a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint yn(char x);\nint main() {\n  char a[501], b[501];\n  double q, p;\n  int i, s, l1, l2, o;\n  scanf(\"%lf%s%s\", &p, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  o = 0;\n  if (l1 != l2)\n    o = 1;\n  for (i = 0; i < l1; i++)\n    if (yn(a[i]) == 1) {\n      o = 1;\n      break;\n    }\n  for (i = 0; i < l2; i++)\n    if (yn(b[i]) == 1) {\n      o = 1;\n      break;\n    }\n  if (o == 1)\n    printf(\"error\");\n  else {\n    s = 0;\n    for (i = 0; i < l1; i++)\n      if ((a[i]) == b[i])\n        s = s + 1;\n    q = 1.0 * s / l1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\nint yn(char x) {\n  int a;\n  if ((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))\n    a = 0;\n  else\n    a = 1;\n  return a;\n}\n"}
{"label": "5", "index": "8171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double p, q;\n  int a, b, m = 0, brak = 0;\n  scanf(\"%lf\", &p);\n  char k[600], kk[600];\n  scanf(\"%s\", k);\n  scanf(\"%s\", kk);\n  a = strlen(k);\n  b = strlen(kk);\n  for (int h = 0;; h++) {\n    if (a != b) {\n      printf(\"error\");\n      break;\n    }\n    for (int c = 0; c < a; c++) {\n      if (!(k[c] == 'A' || k[c] == 'T' || k[c] == 'C' || k[c] == 'G')) {\n        brak++;\n      }\n      if (!(kk[c] == 'A' || kk[c] == 'T' || kk[c] == 'C' || kk[c] == 'G')) {\n        brak++;\n      }\n    }\n    if (brak != 0) {\n      printf(\"error\");\n      break;\n    }\n    for (int i = 0; i < a; i++) {\n      if (k[i] == kk[i]) {\n        m++;\n      }\n    }\n    q = m / (a * 1.0);\n    if (q >= p) {\n      printf(\"yes\");\n    }\n    if (q < p) {\n      printf(\"no\");\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, p;\n  int m, i, j, c = 0, q, d = 0, f = 0, k = 0;\n  char u[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", u[i]);\n  }\n\n  q = strlen(u[1]);\n  m = strlen(u[0]);\n  if (m != q) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] != 'A' && u[0][j] != 'T' && u[0][j] != 'C' && u[0][j] != 'G') {\n      f++;\n    }\n  }\n  for (j = 0; j < q; j++) {\n    if (u[1][j] != 'A' && u[1][j] != 'T' && u[1][j] != 'C' && u[1][j] != 'G') {\n      f++;\n    }\n  }\n\n  if (f != 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] == u[1][j]) {\n      c++;\n    }\n  }\n\n  p = (1.0 * c) / m;\n  if (p >= n) {\n    printf(\"yes\");\n  }\n  if (p < n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8173", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10000], b[10000];\n  int c, d, m = 0, z = 0;\n  double e, f, g, h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", a);\n  cin >> b;\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n      z++;\n    }\n  }\n  for (int i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n      z++;\n    }\n  }\n\n  c = strlen(a);\n  d = strlen(b);\n  if (c == d) {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    f = m;\n    g = c;\n    e = f / g;\n    if (e >= h && z == 2 * c) {\n      printf(\"yes\");\n    } else {\n      if (e < h && z == 2 * c) {\n        printf(\"no\");\n      }\n    }\n  }\n  if (c != d || z != 2 * c) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, x, y, m, t;\n  x = 0;\n  int i, c;\n  c = 0;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  m = strlen(a);\n  t = strlen(b);\n  if (m != t) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) &&\n          ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G'))) {\n        if (a[i] == b[i]) {\n          x = x + 1;\n        }\n      } else {\n        c = c + 1;\n      }\n    }\n    y = x / m;\n    if (c > 0) {\n      printf(\"error\");\n    } else {\n      if (y > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8175", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, t, l, p, sum = 0;\n\n  double b, n;\n\n  char z[500], s[500];\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", z);\n\n  scanf(\"%s\", s);\n\n  l = strlen(z);\n\n  p = strlen(s);\n\n  if (l != p) {\n\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (z[i] == 'A' && s[i] == 'A')\n        sum++;\n\n      else if (z[i] == 'T' && s[i] == 'T')\n        sum++;\n\n      else if (z[i] == 'C' && s[i] == 'C')\n        sum++;\n\n      else if (z[i] == 'G' && s[i] == 'G')\n        sum++;\n\n      else if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n               (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n        t = 0;\n\n        break;\n      }\n    }\n\n    if (t == 0)\n      printf(\"error\");\n\n    else {\n      b = (double)sum / l;\n\n      if (b > n)\n        printf(\"yes\");\n\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int len, lmn, sum = 0, i, flag = 1;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  len = strlen(a);\n  lmn = strlen(b);\n  if (len != lmn) {\n    printf(\"error\");\n  } else\n\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n\n  if (len == lmn && flag == 1) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if ((double)sum / len > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, d, e, f, r;\n  double a, g;\n  r = 0;\n  cin >> a;\n  char b[501], c[501];\n  for (i = 0; i < 2; i++) {\n    if (i == 0) {\n      scanf(\"%s\", b);\n      m = strlen(b);\n    } else {\n      scanf(\"%s\", c);\n      d = strlen(c);\n    }\n  }\n  if (m >= d) {\n    f = m;\n  } else {\n    f = d;\n  }\n  e = 0;\n  for (i = 0; i < f; i++) {\n    if ((b[i] == 'A' || (b[i] == 'T') || b[i] == 'C' || b[i] == 'G') &&\n        (c[i] == 'A' || (c[i] == 'T') || c[i] == 'C' || c[i] == 'G')) {\n      if (c[i] == b[i]) {\n        e++;\n      }\n    } else {\n      r = 1;\n      break;\n    }\n  }\n  if ((m == d) && (r == 0)) {\n    g = 1.0 * e / m;\n    if (g > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    cout << \"error\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8178", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[500];\n  char b[500];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  int i, x;\n  x = 0;\n\n  double w, k, j, l;\n\n  k = strlen(a);\n  l = strlen(b);\n\n  if (k == l) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n      if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n    }\n    if (x == 1) {\n      w = 0;\n\n      for (i = 0; i < k; i++) {\n        if (a[i] == b[i])\n          w = w + 1;\n      }\n\n      j = w / k;\n\n      if (j <= n)\n        printf(\"no\");\n      else\n        printf(\"yes\");\n    } else\n      printf(\"error\");\n  }\n\n  else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8179", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double e, s;\n  char a[1000], b[1000];\n  int l1, l2, i, j, t;\n\n  scanf(\"%lf\", &e);\n  scanf(\"%s %s\", &a, &b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  for (j = 0; j < l2; j++) {\n    if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  if (l1 != l2) {\n    printf(\"error \");\n  }\n\n  else if (l1 == l2) {\n    t = 0;\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t++;\n      }\n    }\n    s = 1.0 * t / l1;\n    if (s > e) {\n      printf(\"yes \");\n    } else\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  double w;\n  int count = 0, lena, lenb;\n  scanf(\"%lf\", &w);\n  scanf(\"%s \", a);\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  if (lena != lenb)\n    printf(\"error\");\n  else {\n    int i, j, k = 0;\n    for (i = 0; i < lena; i++) {\n      if (!((a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') &&\n            (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < lena; j++) {\n        if (a[j] == b[j])\n          count++;\n      }\n      double what;\n      what = (double)count / lena;\n      if (what >= w)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, i, x, y, e = 0;\n  double r;\n  char a[500], b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        e = e + 1;\n      } else {\n        if (a[i] == b[i])\n          s = s + 1;\n      }\n    }\n    if (e != 0) {\n      printf(\"error\");\n    } else {\n      if (1.0 * s / x > r) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8182", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[501], c[501];\n  cin >> a;\n  cin >> b;\n  scanf(\"%s\", c);\n  int i;\n  int t = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      t = 1;\n  }\n  for (i = 0; i < strlen(c); i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')\n      t = 1;\n  }\n  if (strlen(b) != strlen(c) || t == 1)\n    printf(\"error\");\n  else {\n\n    int i, sum = 0;\n    for (i = 0; i < strlen(b); i++) {\n      if (b[i] == c[i])\n        sum++;\n    }\n    double d;\n    int m;\n    m = strlen(b);\n    d = sum * 1.0 / m;\n    if (d > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sim = 0;\n  double n;\n  char one[501], two[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", one);\n  scanf(\"%s\", two);\n  if (strlen(one) != strlen(two)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; one[i]; i++) {\n    if ((one[i] != 'A') && (one[i] != 'T') && (one[i] != 'C') &&\n        (one[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; two[i]; i++) {\n    if (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; one[i]; i++) {\n    if (one[i] == two[i]) {\n      sim++;\n    }\n  }\n  if (1.0 * sim / strlen(one) > n) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l1, l2, i, count = 0;\n  double rate;\n  char str1[1000], str2[1000];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", str1, str2);\n  l1 = strlen(str1);\n  l2 = strlen(str2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (str1[i] == str2[i]) {\n      count++;\n    }\n    if (((str1[i] != 'A') && (str1[i] != 'C') && (str1[i] != 'G') &&\n         (str1[i] != 'T')) ||\n        ((str2[i] != 'A') && (str2[i] != 'C') && (str2[i] != 'G') &&\n         (str2[i] != 'T'))) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.00 * count / l1) >= rate) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, f = 1;\n  char a[2][255];\n  double x, k, t = 0;\n  scanf(\"%lf\", &x);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  k = strlen(a[0]);\n  for (j = 0; j < k; j++) {\n    if ((a[0][j] != 'A' && a[0][j] != 'C' && a[0][j] != 'T' &&\n         a[0][j] != 'G') ||\n        (a[1][j] != 'A' && a[1][j] != 'T' && a[1][j] != 'C' &&\n         a[1][j] != 'G')) {\n      printf(\"error\");\n      f = 0;\n      break;\n    }\n    if (a[0][j] == a[1][j]) {\n      t++;\n    }\n  }\n  if (f == 1) {\n    if (t / k > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sa = 0, m = 0;\n  double x, s;\n  char a[105], b[105];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i]) {\n          sa++;\n        }\n      }\n      s = 1.0 * sa / strlen(a);\n      if (s > x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8187", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, lem, len, q;\n  double p, l;\n  char m[501], n[501];\n  cin >> p;\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\", n);\n  lem = strlen(m);\n  len = strlen(n);\n  if (lem != len) {\n    printf(\"error\");\n    return 0;\n  } else\n    q = len;\n  int r = 0;\n  for (i = 0; i < q; i++) {\n    if (((m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) ||\n        ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G'))) {\n      printf(\"error\");\n      break;\n    } else if (m[i] == n[i]) {\n      r++;\n    }\n  }\n  if (i == q) {\n    l = 1.0 * r / q;\n    if (l >= p)\n      printf(\"yes\");\n    else if (l < p) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, p;\n  int i, l, k = 0, c = 1;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  scanf(\"%s\", c1);\n  scanf(\"%s\", c2);\n  l = strlen(c1);\n  for (i = 0; i < l; i++) {\n    if ((c1[i] != 'A') && (c1[i] != 'T') && (c1[i] != 'C') && (c1[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if ((c2[i] != 'A') && (c2[i] != 'T') && (c2[i] != 'C') && (c2[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if (c1[i] == c2[i]) {\n      k++;\n    }\n  }\n  if (c) {\n    p = ((double)k) / ((double)l);\n    if (p > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  cin >> n;\n  char s[2][510];\n  int i;\n  int j, k;\n  k = 0;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  if (strlen(s[0]) != strlen(s[1])) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; s[0][j] != '\\0'; j++) {\n      if (s[0][j] == s[1][j]) {\n        k++;\n      }\n      if ((s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'C' &&\n           s[0][j] != 'G') ||\n          (s[1][j] != 'A' && s[1][j] != 'T' && s[1][j] != 'C' &&\n           s[1][j] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  int q;\n  q = strlen(s[0]);\n  double w;\n  w = 1.0 * k / q;\n  if (w >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, s;\n  double n, x;\n  char one[500], two[500];\n  scanf(\"%lf\", &n);\n  cin >> one >> two;\n  s = strlen(one);\n  if (strlen(one) != strlen(two))\n    printf(\"error\");\n  else {\n    for (i = 0; one[i] != '\\0'; i++) {\n      if ((one[i] != 'A' && one[i] != 'G' && one[i] != 'T' && one[i] != 'C') ||\n          (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G')) {\n        s = 0;\n      } else {\n        if (one[i] == two[i])\n          m++;\n      }\n    }\n    x = 1.0 * m / s;\n    if (s == 0)\n      cout << \"error\";\n    else if (x > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char da[501], db[501];\n  double s, ss, l;\n  int l1, l2, i, m = 0;\n  scanf(\"%lf \", &s);\n  scanf(\"%s%s\", da, db);\n\n  l1 = strlen(da);\n  l2 = strlen(db);\n  if (l1 != l2) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((da[i] != 'A' && da[i] != 'C' && da[i] != 'T' && da[i] != 'G') ||\n        (db[i] != 'A' && db[i] != 'C' && db[i] != 'T' && db[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (da[i] == db[i])\n      m++;\n  }\n  l = l1;\n  ss = m / l;\n  if (ss > s)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char d[3][501];\n  double n, m, a, b, c, x;\n  x = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &d[1]);\n  scanf(\"%s\", &d[2]);\n  n = strlen(d[1]);\n  m = strlen(d[2]);\n  for (i = 0; i < n; i++) {\n    if ((d[1][i] != 'A' && d[1][i] != 'G' && d[1][i] != 'C' &&\n         d[1][i] != 'T') ||\n        (d[2][i] != 'A' && d[2][i] != 'G' && d[2][i] != 'C' &&\n         d[2][i] != 'T')) {\n      x++;\n    }\n  }\n  if (m != n || x > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (d[1][i] == d[2][i]) {\n        b++;\n      }\n    }\n    c = b / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8193", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int i, j, t = 0, l1, l2, l, s1 = 0, s2 = 0;\n  double n, t1, t2;\n  scanf(\"%lf\", &n);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n\n    printf(\"error\");\n\n  } else {\n    for (j = 0; a[j]; j++) {\n      if (!(a[j] == 'A' || a[j] == 'T' || a[j] == 'C' || a[j] == 'G')) {\n        printf(\"error\");\n        s1++;\n        break;\n      }\n    }\n    if (s1 == 0) {\n      for (j = 0; b[j]; j++) {\n        if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G')) {\n          printf(\"error\");\n          s2++;\n          break;\n        }\n      }\n    }\n    if (s1 == 0 && s2 == 0) {\n      for (i = 0; a[i]; i++) {\n        if (a[i] == b[i]) {\n          t++;\n        }\n      }\n      l = strlen(a);\n      t1 = l;\n      t2 = t;\n      if (t2 / t1 > n)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8194", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double y, a;\n  char q[501], h[501];\n  int n1, n2, i, c = 0, tag = 0;\n  cin >> y;\n  scanf(\"%s \", q);\n  scanf(\"%s\", h);\n  n1 = strlen(q);\n  n2 = strlen(h);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n\n    for (i = 0; i < n1; i++) {\n      if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n        printf(\"error\");\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (i = 0; i < n2; i++) {\n        if ((h[i] != 'A') && (h[i] != 'T') && (h[i] != 'C') && (h[i] != 'G')) {\n          printf(\"error\");\n          tag = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < n1; i++) {\n      if (q[i] == h[i]) {\n        c++;\n      }\n    }\n    a = 1.0 * c / n1;\n    if (tag == 0) {\n      if (a > y) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, x, y, s, g = 0;\n  double rate, t;\n  char a[510], b[510];\n  s = 0;\n\n  cin >> rate >> a >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (((a[i] != 'A') && (a[i] != 'C') && (a[i] != 'G') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'C') && (b[i] != 'G') && (b[i] != 'T'))) {\n\n        g = 1;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    t = rate * x;\n    if (g == 0) {\n      if (s > t) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], d[501];\n  int n, m, i, j, p = 0, q;\n  scanf(\"%lf\\n%s\\n%s\\n\", &a, s, d);\n  n = strlen(s);\n  m = strlen(d);\n  if (n != m) {\n    printf(\"error\");\n  } else if (n == m) {\n    for (i = 0; i < n - 1; i++) {\n      if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n        q = 0;\n        break;\n      } else if (s[i] == d[i]) {\n        p++;\n      } else if (s[i] != d[i]) {\n        p = p + 0;\n      }\n    }\n    b = 1.0 * p / (n - 1);\n    if (b > a && q != 0) {\n      printf(\"yes\");\n    } else {\n      if (b < a && q != 0) {\n        printf(\"no\");\n      } else if (q == 0) {\n        printf(\"error\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8197", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, l, s = 0, p = 0;\n  double n, m;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", a, b);\n  k = strlen(a), l = strlen(b);\n  for (i = 0; i < k; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G'))\n      p++;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] == b[i]) {\n      s++;\n    }\n  }\n  m = 1.0 * s / k;\n  if ((k == l) && (p == 0) && (m > n)) {\n    printf(\"yes\");\n  } else if ((k == l) && (p == 0) && (m <= n)) {\n    printf(\"no\");\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, l;\n  double t, c;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &t);\n  scanf(\"%s %s\", a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  l = l1;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (n = 0, i = 0; i < l; i++) {\n    if (a[i] == b[i]) {\n      n++;\n    }\n  }\n  c = 1.0 * n / l;\n\n  if (c > t)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8199", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, e = 0;\n  int i, d = 0, f, g;\n  char b[500], c[500];\n  scanf(\"%lf \", &a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  f = strlen(b);\n  g = strlen(c);\n  if (f != g) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < g; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] == c[i])\n      d++;\n  }\n  e = 1.0 * d / g;\n\n  if (e >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8200", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int num = 0;\n  double alike, n;\n  char jj1[500] = {0};\n  char jj2[500] = {0};\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", jj1);\n  scanf(\"%s\", jj2);\n  int result1 = strlen(jj1);\n  int result2 = strlen(jj2);\n  if (result1 != result2) {\n    printf(\"error\");\n\n    return 0;\n  } else {\n    result2 = result1;\n    for (i = 0; i < result1; i++) {\n      if (((jj1[i] == 'A') || (jj1[i] == 'G') || (jj1[i] == 'C') ||\n           (jj1[i] == 'T')) &&\n          ((jj2[i] == 'A') || (jj2[i] == 'G') || (jj2[i] == 'C') ||\n           (jj2[i] == 'T'))) {\n        if (jj1[i] == jj2[i]) {\n          num += 1;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  alike = 1.0 * num / result1;\n  if (alike >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double cd2, cd1, per, szp, s = 0;\n  char zf[501], zf2[501];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", zf);\n  scanf(\"%s\", zf2);\n  cd1 = strlen(zf);\n  cd2 = strlen(zf2);\n  if (cd1 == cd2) {\n    for (i = 0; i < cd1; i++) {\n      if (zf[i] == 'A' || zf[i] == 'T' || zf[i] == 'C' ||\n          zf[i] == 'G' && zf2[i] == 'A' || zf2[i] == 'T' || zf2[i] == 'C' ||\n          zf2[i] == 'G') {\n        if (zf[i] == zf2[i]) {\n          s = s + 1;\n        }\n      } else {\n        cout << \"error\";\n        break;\n      }\n      if (i == cd1 - 1) {\n        szp = s / cd1;\n        if (szp > per) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int n = 0, i, c, d, m = 0;\n  char a[502], b[502];\n  scanf(\"%lf %s %s\", &x, a, b);\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  if (m == 1 || c != d) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i], b[i]; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    y = 1.0 * n / c;\n    if (y > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, c = 0, d;\n  int i, k, a, b, s = 0;\n  char s1[550], s2[550];\n  cin >> m;\n  scanf(\"%s%s\", s1, s2);\n  a = strlen(s1);\n  b = strlen(s2);\n  if (a != b) {\n    printf(\"error\\n\");\n  }\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        s++;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        s++;\n      }\n    }\n    if (s == 0) {\n      for (i = 0; i < a; i++) {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n      d = c / a;\n      if (d >= m) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n    if (s != 0) {\n      printf(\"error\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8204", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, x;\n  char dna1[500], dna2[500];\n  int i, j = 0, l1, l2, c = 0;\n  cin >> a >> dna1 >> dna2;\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  if (l1 != l2) {\n    cout << \"error\";\n    c = 1;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n          dna1[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      } else if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n                 dna2[i] != 'C') {\n        printf(\"error\");\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j = j + 1;\n      }\n    }\n    x = j * 1.0 / l1;\n    if (x > a)\n      cout << \"yes\";\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b = 0, i;\n  char a[100][100], e[210];\n  double n;\n\n  cin >> e;\n  n = atof(e);\n\n  cin >> a[0];\n\n  cin >> a[1];\n  int p = strlen(a[0]);\n  int q = strlen(a[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < p; i++) {\n      if (!(a[0][i] == 'A' || a[0][i] == 'T' || a[0][i] == 'G' ||\n            a[0][i] == 'C' && a[1][i] == 'A' || a[1][i] == 'T' ||\n\n            a[1][i] == 'G' || a[1][i] == 'C')) {\n        cout << \"error\";\n        return 0;\n      } else {\n        if (a[0][i] == a[1][i]) {\n          b++;\n        }\n      }\n    }\n  }\n  if (1.0 * b / p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double y, a;\n  char q[501], h[501];\n  int n1, n2, i, c = 0, tag = 0;\n  scanf(\"%lf\", &y);\n  scanf(\"%s\", q);\n  scanf(\"%s\", h);\n  n1 = strlen(q);\n  n2 = strlen(h);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n\n    for (i = 0; i < n1; i++) {\n      if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n        printf(\"error\");\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (i = 0; i < n2; i++) {\n        if ((h[i] != 'A') && (h[i] != 'T') && (h[i] != 'C') && (h[i] != 'G')) {\n          printf(\"error\");\n          tag = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < n1; i++) {\n      if (q[i] == h[i]) {\n        c++;\n      }\n    }\n    a = 1.0 * c / n1;\n    if (tag == 0) {\n      if (a > y) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char DNA[2][500];\n  int i;\n  int len[2];\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", DNA[i]);\n    len[i] = strlen(DNA[i]);\n  }\n  int j;\n  int p = 0;\n  for (j = 0; j < len[0]; j++) {\n    if (DNA[0][j] == DNA[1][j]) {\n      p++;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (DNA[i][j] != 'A' && DNA[i][j] != 'T' && DNA[i][j] != 'C' &&\n          DNA[i][j] != 'G') {\n        m++;\n      }\n    }\n  }\n  double bi;\n  bi = ((double)p) / ((double)len[0]);\n  if (len[0] != len[1] || m != 0) {\n    printf(\"error\");\n  } else if (bi > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double v;\n  scanf(\"%lf\\n\", &v);\n  char s[600], z[600];\n  scanf(\"%s\\n%s\", s, z);\n  int a, b;\n  a = strlen(s);\n  b = strlen(z);\n  int m, n, p = 0, q = 0;\n  for (m = 0; m < a; m++) {\n    if (s[m] != 'A' && s[m] != 'T' && s[m] != 'C' && s[m] != 'G') {\n      p = 1;\n    }\n  }\n  for (n = 0; n < a; n++) {\n    if (z[n] != 'A' && z[n] != 'T' && z[n] != 'C' && z[n] != 'G') {\n      q = 1;\n    }\n  }\n  int w = 0;\n  double u;\n  if (m != n || q == 1 || p == 1) {\n    printf(\"error\");\n    w = 1;\n  }\n  int sum = 0;\n  for (n = 0; n < a; n++) {\n    if (s[n] == z[n]) {\n      sum++;\n    }\n  }\n  u = 1.0 * sum / a;\n  if (w == 1)\n    ;\n  else {\n    if (u > v) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double w;\n  char s1[600], s2[600];\n  int l1, l2, i, a;\n  a = 0;\n  cin >> w;\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l1; i++) {\n      if (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    }\n    if ((1.0 * a) / l1 > w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, lena, lenb;\n  double r, same = 0, j = 0;\n  char a[10000];\n  char b[10000];\n  scanf(\"%lf\", &r);\n  cin >> a;\n  scanf(\"%s\", &b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= lena - 1; i++) {\n      if (a[i] == b[i]) {\n        same++;\n      } else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      }\n    }\n  }\n  if (j == 0 && lena == lenb) {\n    if ((same / lena) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[2][510];\n  int i;\n  int j, k;\n  k = 0;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  if (strlen(s[0]) != strlen(s[1])) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; s[0][j] != '\\0'; j++) {\n      if (s[0][j] == s[1][j]) {\n        k++;\n      }\n      if ((s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'C' &&\n           s[0][j] != 'G') ||\n          (s[1][j] != 'A' && s[1][j] != 'T' && s[1][j] != 'C' &&\n           s[1][j] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  int q;\n  q = strlen(s[0]);\n  double w;\n  w = 1.0 * k / q;\n  if (w >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8212", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len, sum = 0, e = 0;\n  float n;\n  scanf(\"%f\", &n);\n  char a[600], b[600];\n  cin >> a;\n  scanf(\"%s\", &b);\n  len = strlen(a);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n      if (b[i] != 65 && b[i] != 71 && b[i] != 67 && b[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 0) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      if (sum * 1.0 / len > n) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, d, c, r;\n  int i, k, s;\n  cin >> n;\n  cin >> a >> b;\n  d = strlen(a);\n  c = strlen(b);\n  k = 0;\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n        k++;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n        k++;\n    }\n    if (k != 0) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  s = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  r = s / d;\n  if (r <= n)\n    printf(\"no\");\n  if (r > n)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "5", "index": "8214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[100], b[100], c[100];\nint main() {\n  int sum = 0;\n  double m;\n  double s;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a), y = strlen(b);\n  a[x] = '\\0';\n  b[y] = '\\0';\n  if (x != y) {\n    cout << \"error\";\n    return 0;\n  }\n  int i;\n  for (i = 0; i < x; i++) {\n    if (a[i] == 'A') {\n      c[i] = 'A';\n    } else if (a[i] == 'T') {\n      c[i] = 'T';\n    } else if (a[i] == 'C') {\n      c[i] = 'C';\n    } else if (a[i] == 'G')\n      c[i] = 'G';\n    else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (b[i] == c[i]) {\n      sum++;\n    }\n  }\n  s = 1.0 * sum / x;\n  if (s >= m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int len, lmn, sum = 0, i, flag = 1;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  len = strlen(a);\n  lmn = strlen(b);\n  if (len != lmn)\n    printf(\"error\");\n  else\n\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 0;\n        cout << \"error\";\n        break;\n      }\n    }\n\n  if (len == lmn && flag == 1) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if ((double)sum / len > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, l;\n  double t, c;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &t);\n  scanf(\"%s %s\", a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  \n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  l = l1;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (n = 0, i = 0; i < l; i++) {\n    if (a[i] == b[i]) {\n      n++;\n    }\n  }\n  c = 1.0 * n / l;\n  \n  if (c > t) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8217", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1 = 0, len2 = 0, len = 0, flag = 0;\n  char dna1[501], dna2[501];\n  double rate, ra;\n  cin >> rate >> dna1 >> dna2;\n  for (i = 0; dna1[i]; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'G') ||\n        (dna1[i] == 'C')) {\n      len1++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; dna2[i]; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'G') ||\n        (dna2[i] == 'C')) {\n      len2++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        len++;\n      }\n    }\n    ra = (double)len / len1;\n    if (ra > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int len = strlen(a), time = 0, i;\n  if (strlen(a) != strlen(b))\n    cout << \"error \";\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        break;\n      else if (a[i] == b[i])\n        time++;\n    }\n    if (i == len) {\n      if ((double)time / (double)len > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    } else\n      printf(\"error \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double rate, rate0, sum = 0;\n  char line1[501], line2[501];\n  scanf(\"%lf%s%s\", &rate0, line1, line2);\n  len1 = strlen(line1);\n  len2 = strlen(line2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (line1[i] == line2[i]) {\n        sum++;\n      }\n      if (line1[i] != 'A' && line1[i] != 'T' && line1[i] != 'G' &&\n              line1[i] != 'C' ||\n          line2[i] != 'A' && line2[i] != 'T' && line2[i] != 'G' &&\n              line2[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    rate = 1.0 * sum / len1;\n    if (rate >= rate0) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8220", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint atgc(char a) {\n  if (a == 'A' || a == 'G' || a == 'C' || a == 'T') {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  double m;\n  char xl1[500] = {'\\0'}, xl2[500] = {'\\0'};\n  scanf(\"%lf %s %s\", &m, xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    int i, n = 0;\n    for (i = 0; i < len1; i++) {\n      if (atgc(xl1[i]) == 0 || atgc(xl2[i]) == 0) {\n        printf(\"error\");\n        return 0;\n      } else if (xl1[i] == xl2[i]) {\n        n++;\n      }\n    }\n    if (1.0 * n / len1 >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char dna1[600], dna2[600];\n  int a, b, i;\n  double x = 0, ratio;\n  scanf(\"%lf\", &ratio);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  a = strlen(dna1);\n  b = strlen(dna2);\n  if (a != b) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' && dna1[i] != 'C') {\n      cout << \"error\";\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' && dna2[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      x++;\n  }\n  if (x / a >= ratio)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8222", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[1000], j[1000];\n  cin >> s;\n  scanf(\"%s\", j);\n  if (strlen(s) != strlen(j)) {\n    printf(\"error\");\n    return 0;\n  }\n  int k;\n  k = strlen(s);\n  int sum = 0;\n  double rate;\n  int i;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (j[i] != 'A' && j[i] != 'G' && j[i] != 'C' && j[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (s[i] == j[i]) {\n      sum++;\n    }\n  }\n  rate = 1.0 * sum / k;\n  if (rate > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z, r = 0;\n  int m, n, i, error = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &z);\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    error = error + 1;\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        error = error + 1;\n      } else if (!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        error = error + 1;\n      } else {\n        if (a[i] == 'A' && b[i] == 'A') {\n          r = r + 1;\n        }\n        if (b[i] == 'T' && a[i] == 'T') {\n          r = r + 1;\n        }\n        if (a[i] == 'G' && b[i] == 'G')\n          r = r + 1;\n\n        if (a[i] == 'C' && b[i] == 'C') {\n          r = r + 1;\n        }\n      }\n    }\n    r = r / m;\n  }\n  if (error != 0) {\n    printf(\"error\");\n  } else if (r >= z) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[5][600];\n  int i, p, q, sum = 0;\n  double n, flag;\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  p = strlen(zfc[0]);\n  q = strlen(zfc[1]);\n  if (p != q) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; (zfc[0][i] != '\\0') && (zfc[1][i] != '\\0'); i++) {\n    if ((zfc[0][i] != 'A' && zfc[0][i] != 'G' && zfc[0][i] != 'C' &&\n         zfc[0][i] != 'T') ||\n        (zfc[1][i] != 'A' && zfc[1][i] != 'G' && zfc[1][i] != 'C' &&\n         zfc[1][i] != 'T')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (zfc[0][i] == zfc[1][i]) {\n      sum++;\n    }\n  }\n  flag = 1.0 * sum / p;\n  if (flag > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int len = strlen(a), time = 0, i;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        break;\n      else if (a[i] == b[i])\n        time++;\n    }\n    if (i == len) {\n      if ((double)time / (double)len > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    } else\n      printf(\"error \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, k, num = 0, flag = 0;\n  double l;\n  char a[501], b[501], s[10];\n\n  cin >> s;\n  k = atoi(s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      flag = 1;\n      break;\n    }\n  }\n  if ((n == m) && (flag == 0)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    l = (double)num / n;\n    if (l > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[505], s2[505];\n  double n, m = 0, len1, len2, flag = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i < len1; i++) {\n    if ((s1[i] == 'A') || (s1[i] == 'T') || (s1[i] == 'C') || (s1[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((s2[i] == 'A') || (s2[i] == 'T') || (s2[i] == 'C') || (s2[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n\n  if ((len1 != len2) || (flag == 1)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i <= len1; i++) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    }\n    m = m / len1;\n    if (m > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8228", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, a = 0, b = 0, t = 0, k = 0;\n  char s[501], str[501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s \", str);\n\n  for (i = 0; s[i]; i++) {\n    a++;\n  }\n  for (i = 0; str[i]; i++)\n    b++;\n\n  if (a == b) {\n    for (i = 0; s[i]; i++) {\n      if ((s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') &&\n          (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T')) {\n        if (s[i] == str[i]) {\n          t++;\n        }\n      } else {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (t / a > n && k == 0) {\n      printf(\"yes\");\n    } else if (k == 0) {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8229", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a1, a2, sum;\n  double m, x;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  a1 = strlen(s1);\n  a2 = strlen(s2);\n  sum = 0;\n  if (a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        sum = -1;\n        break;\n      } else if (s1[i] == s2[i]) {\n        sum++;\n      }\n    }\n    if (sum == -1) {\n      printf(\"error\");\n    } else {\n      x = (double)sum / a1;\n      if (x > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double n, c = 0, d, l, k;\n  int i, h = 0;\n\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  l = strlen(a);\n  k = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    if (k != l || a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n\n      printf(\"error\");\n      h = 1;\n      break;\n    } else if (a[i] == b[i])\n      c = c + 1;\n  }\n  d = c / l;\n  if (d > n)\n    printf(\"yes\");\n  else if (h == 0 && d <= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, sum = 0, flag = 1;\n  double n1, n;\n  char a[512], b[512];\n  cin >> n >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\\n\");\n  else {\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        flag = 0;\n    }\n    for (i = 0; b[i] != 0; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        flag = 0;\n    }\n    if (flag) {\n      for (i = 0; a[i] != 0; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      n1 = (double)sum / (double)strlen(a);\n      if (n1 > n)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  int i = 0, b, c = 0, e = 0, f;\n  char x[600], y[600];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", x, y);\n  b = strlen(x);\n  f = strlen(y);\n  if (b == f) {\n    for (i = 0; i < b; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n\n        break;\n      }\n      if (x[i] == y[i]) {\n        c++;\n      }\n    }\n    if (e == 0) {\n\n      if (c * 1.000 / b >= a)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], d[501];\n  int n, m, i, j, p = 0, q;\n  scanf(\"%lf\\n%s\\n%s\\n\", &a, s, d);\n  n = strlen(s);\n  m = strlen(d);\n  if (n != m) {\n    printf(\"error\");\n  } else if (n == m) {\n    for (i = 0; i < n - 1; i++) {\n      if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n        q = 0;\n        break;\n      } else if (s[i] == d[i]) {\n        p++;\n      } else if (s[i] != d[i]) {\n        p = p + 0;\n      }\n    }\n    b = 1.0 * p / (n - 1);\n    if (b > a && q != 0) {\n      printf(\"yes\");\n    } else if (b < a && q != 0) {\n      printf(\"no\");\n    } else if (q == 0) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, j = 0, m, k = 0, l = 0;\n  int o = 0, i;\n  char b[500], c[500];\n  scanf(\"%lf%s%s\", &a, b, c);\n  for (i = 0; b[i] != '\\0'; i++) {\n    k++;\n  }\n  for (i = 0; c[i] != '\\0'; i++) {\n    l++;\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] == c[i]) {\n      j++;\n    }\n  }\n  m = j / k;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      o++;\n    }\n  }\n  if (o > 0 || k != l) {\n    cout << \"error\";\n  } else {\n    if (m >= a) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int l1, l2;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  int i, k = 0, flag;\n  for (i = 0; i < l1; i++)\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      flag = 1;\n    }\n  for (i = 0; i < l1; i++)\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')\n      flag = 1;\n\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / l1 >= n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b = 0, a, len1, len2, x = 0, c;\n  double bz;\n  char m1[505], m2[505];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s%s\", m1, m2);\n  len1 = strlen(m1);\n  len2 = strlen(m2);\n  if (len1 != len2)\n    x = 1;\n  for (c = 0; c < len1; c++) {\n    if (m1[c] != 'A' && m1[c] != 'T' && m1[c] != 'C' && m1[c] != 'G' ||\n        m2[c] != 'A' && m2[c] != 'T' && m2[c] != 'C' && m2[c] != 'G')\n      x = 1;\n  }\n  if (x) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < len1; a++) {\n      if (m1[a] == m2[a]) {\n        b++;\n      }\n    }\n    if (b * 1.0 / len1 > bz) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int m, n, i, j = 0, k = 0;\n  double x, e;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    if (k != 1) {\n      for (i = 0; i < m; i++) {\n        if (a[i] == b[i]) {\n          j += 1;\n        }\n      }\n      e = j * 1.0 / m;\n      if (e > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, y;\n  int a, b, x = 0, k = 1;\n  char sy[501], se[501];\n  cin >> n >> sy >> se;\n  a = strlen(sy);\n  b = strlen(se);\n  if (a != b)\n    printf(\"error\");\n  else {\n    for (int i = 0; i < a; i++) {\n      if ((sy[i] == 'A' || sy[i] == 'T' || sy[i] == 'C' || sy[i] == 'G') &&\n          (se[i] == 'A' || se[i] == 'T' || se[i] == 'C' || se[i] == 'G')) {\n        if (sy[i] == se[i]) {\n          x += 1;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      y = 1.0 * x / a;\n      if (y >= n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  int d = 0, i, p = 0, m = strlen(dna1), l = strlen(dna2);\n  for (i = 0; dna1[i] || dna2[i]; i++) {\n    if (m != l) {\n      d = 1;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d = 2;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d = 3;\n      break;\n    }\n    if (dna1[i] != dna2[i]) {\n      p++;\n    }\n  }\n  double q = 1 - p / m;\n  if (d != 0) {\n    cout << \"error\";\n  }\n  if (q > b && d == 0) {\n    printf(\"yes\");\n  } else if (d == 0 && q <= b) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, sum = 0, flag = 0;\n  double m;\n  char zifu1[501], zifu2[501];\n  scanf(\"%lf\", &m);\n  scanf(\" \");\n\n  cin >> zifu1;\n\n  cin >> zifu2;\n  if (strlen(zifu1) == strlen(zifu2)) {\n    for (i = 0; i < 600; i++) {\n      if (zifu1[i] == '\u0000') {\n        break;\n      } else if ((zifu1[i] == 'A' || zifu1[i] == 'T' || zifu1[i] == 'C' ||\n                  zifu1[i] == 'G') &&\n                 (zifu2[i] == 'A' || zifu2[i] == 'T' || zifu2[i] == 'C' ||\n                  zifu2[i] == 'G')) {\n        if (zifu1[i] == zifu2[i]) {\n          sum++;\n        }\n      } else {\n        printf(\"error\");\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      if (1.0 * sum / strlen(zifu1) > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, j, k = 1;\n  char d[2][501];\n  double g, e, m;\n  scanf(\"%lf\", &g);\n  scanf(\"%s\", d[0]);\n  scanf(\"%s\", d[1]);\n  l1 = strlen(d[0]);\n  l2 = strlen(d[1]);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (j = 0; j < 2; j++) {\n      for (i = 0; i < l1; i++) {\n        if (d[j][i] != 'A' && d[j][i] != 'T' && d[j][i] != 'C' &&\n            d[j][i] != 'G') {\n          k = 0;\n          break;\n        }\n        if (k == 0) {\n          break;\n        }\n      }\n    }\n    if (k == 1) {\n      for (i = 0; i < l1; i++) {\n        if (d[0][i] == d[1][i]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (l1 == l2) {\n    if (k == 1) {\n      m = 1.0 * e / l1;\n      if (m > g) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, a1, a2, w;\n  char DNA1[501], DNA2[501];\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &DNA1);\n  scanf(\"%s \", DNA2);\n  a1 = strlen(DNA1);\n  a2 = strlen(DNA2);\n  k = 0;\n  w = 1;\n  if (a1 == a2) {\n    for (i = 0; i < a1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' &&\n           DNA1[i] != 'T') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' &&\n           DNA2[i] != 'T')) {\n        w *= 0;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          k++;\n        }\n      }\n      w *= 1;\n    }\n    q = k * 1.0 / a1;\n    if (w == 0) {\n      printf(\"error\");\n    } else {\n      if (q > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, s, i;\n  double p, l;\n  scanf(\"%lf\", &p);\n  char m[500], n[500];\n  scanf(\"%s\", m);\n  scanf(\"%s\", n);\n  a = strlen(m);\n  b = strlen(n);\n  s = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G') ||\n          (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n        printf(\"error\");\n        s = 1;\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n    s = 1;\n  }\n  if (s == 0) {\n    for (i = 0; i < a; i++) {\n      if (m[i] == n[i]) {\n        s = s + 1;\n      }\n    }\n    l = s * 1.0 / a;\n    if (l > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[600], b[600];\n  double n, x;\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, a1, b1, xiangtong = 0, zhengfou = 1, y = 0;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n    y = 1;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i])\n        xiangtong++;\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        zhengfou = 0;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        zhengfou = 0;\n    }\n  }\n  if (zhengfou == 0)\n    printf(\"error\");\n  else if (y != 1) {\n    x = xiangtong * 1.0 / a1;\n    if (x <= n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int sum = 0, i, lena, lenb, t = 0;\n  double n, bi;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n\n  if (lena != lenb || t != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    bi = (double)sum / lena;\n    if (bi > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, p = 0;\n  float m, k, s = 0;\n  char zfc[2][500], n[10];\n\n  scanf(\"%s \", n);\n  m = atof(n);\n  for (i = 0; i < 2; i++) {\n\n    cin >> zfc[i];\n  }\n  a = strlen(zfc[0]);\n  b = strlen(zfc[1]);\n  if (a != b)\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; zfc[i][j] != '\u0000'; j++) {\n        if (zfc[i][j] != 'A' && zfc[i][j] != 'G' && zfc[i][j] != 'C' &&\n            zfc[i][j] != 'T') {\n          p = 1;\n        }\n      }\n    }\n    if (p == 0) {\n      for (i = 0; zfc[0][i] != '\u0000'; i++) {\n        if (zfc[0][i] == zfc[1][i])\n          s++;\n      }\n      k = s / (a * 1.0);\n      if (k > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, lena, lenb;\n  double r, same = 0, j = 0;\n  char a[10000];\n  char b[10000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i <= lena - 1; i++) {\n      if (a[i] == b[i])\n        same++;\n      else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      }\n    }\n  }\n  if (j == 0 && lena == lenb) {\n    if ((same / lena) > r) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int na, nb, i, c;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  na = strlen(a);\n  nb = strlen(b);\n  if (na != nb) {\n    printf(\"error\");\n    return 0;\n  } else {\n    c = 0;\n    for (i = 0; i < na; i++) {\n      if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n        if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n          if (a[i] == b[i]) {\n            c = c + 1;\n          }\n        } else {\n          printf(\"error\");\n          return 0;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  y = 1.0 * c / na;\n  if (y >= x) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  double cd2, cd1, per, szp, s = 0;\n  char zf[501], zf2[501];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", zf);\n  scanf(\"%s\", zf2);\n  cd1 = strlen(zf);\n  cd2 = strlen(zf2);\n  if (cd1 == cd2) {\n    for (i = 0; i < cd1; i++) {\n      if (zf[i] == 'A' || zf[i] == 'T' || zf[i] == 'C' ||\n          zf[i] == 'G' && zf2[i] == 'A' || zf2[i] == 'T' || zf2[i] == 'C' ||\n          zf2[i] == 'G') {\n        if (zf[i] == zf2[i]) {\n          s = s + 1;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n      if (i == cd1 - 1) {\n        szp = s / cd1;\n        if (szp > per) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8250", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double s, t;\n  int m, n, flag = 0;\n  int e = 0;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  for (int p = 0; p < m; p++) {\n    if (a[p] == 'A' || a[p] == 'G' || a[p] == 'C' || a[p] == 'T') {\n      flag = 0;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((m != n) || (flag == 1)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    t = 1.0 * e / n;\n    if (t > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, la, lb, x, i;\n  double r0, r1;\n  char a[505], b[505];\n  scanf(\"%lf\", &r0);\n  cin >> a;\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb)\n    printf(\"error\\n\");\n  else {\n    x = 1;\n    for (i = 0, m = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          m++;\n      }\n    }\n    r1 = 1.0 * m / la;\n    if (x == 1) {\n      if (r1 > r0)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double x;\n  int n, i, m, y;\n  char lian1[1000], lian2[1000];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", lian1);\n  scanf(\"%s\", lian2);\n  n = strlen(lian1);\n  y = strlen(lian2);\n  if (y != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (!(lian1[i] == 'A' || lian1[i] == 'T' || lian1[i] == 'C' ||\n          lian1[i] == 'G' || lian2[i] == 'A' || lian2[i] == 'T' ||\n          lian2[i] == 'C' || lian2[i] == 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (lian1[i] == lian2[i]) {\n      m++;\n    }\n  }\n  if (m * 1.0 / n > x) {\n    printf(\"yes\");\n  } else if (m * 1.0 / n <= x) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int b = 0, p = 1, i;\n  cin >> n;\n  char a[2][501];\n  scanf(\"%s\", a[0]);\n  cin >> a[1];\n  for (i = 0; i < 501; i++) {\n    if (a[0][i] == '\\0') {\n      if (a[1][i] != '\\0') {\n        p = 0;\n      }\n      break;\n    }\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G') {\n      p = 0;\n      break;\n    }\n    if (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' && a[1][i] != 'G') {\n      p = 0;\n      break;\n    }\n\n    if (a[0][i] == a[1][i]) {\n      b = b + 1;\n    }\n  }\n  c = b * 1.0 / i;\n\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    if (c > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char x1[501], x2[501];\n  double n;\n  int i, y = 0;\n  scanf(\"%lf%s%s\", &n, x1, x2);\n  if (strlen(x1) != strlen(x2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x1[i] != '\\0'; i++) {\n    if ((x1[i] != 'A' && x1[i] != 'T' && x1[i] != 'G' && x1[i] != 'C') ||\n        (x2[i] != 'A' && x2[i] != 'C' && x2[i] != 'G' && x2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x1[i] == x2[i])\n      y++;\n  }\n  if ((double)y / i >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c = 0;\n  double e, d;\n  char x[256], y[256];\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  cin >> y;\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    if (a == b) {\n      for (i = 0; i < a; i++) {\n        if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n            (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n          printf(\"error\");\n          return 0;\n        } else {\n          if (x[i] == y[i]) {\n            c += 1;\n          }\n        }\n      }\n      e = 1.0 * c / a;\n      if (e >= d) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double len, len1, h, n1;\n  int i, f;\n  h = 0;\n  f = 0;\n  char s[500], t[500], n[2];\n\n  cin >> n;\n  n1 = atof(n);\n\n  cin >> s;\n\n  cin >> t;\n  len = strlen(s);\n  len1 = strlen(t);\n  if (len != len1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G'))\n        f = 1;\n    }\n    if (f)\n      printf(\"error\");\n    else {\n      for (i = 0; i < len; i++) {\n        if (s[i] == t[i])\n          h++;\n      }\n      if (h / len > n1)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf\", &a);\n  char b[600], c[600];\n  getchar();\n\n  cin >> b;\n\n  cin >> c;\n  int d, e, f, g;\n  int h = 0;\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= d - 1; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        f = 1;\n      }\n      if (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T') {\n        g = 1;\n      }\n    }\n    if (f == 1 || g == 1)\n      printf(\"error\");\n    else {\n      for (int i = 0; i <= d - 1; i++) {\n        if (b[i] == c[i]) {\n          h++;\n        }\n      }\n\n      if (1.0 * h / d > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  int y;\n  scanf(\"%d\", &y);\n  return 0;\n}\n"}
{"label": "5", "index": "8258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char x) {\n  if (x == 'A' || x == 'T' || x == 'G' || x == 'C')\n    return 0;\n  else\n    return 1;\n}\nint main(int argc, char *argv[]) {\n  char a[501], b[501];\n  int x = 0, i, y = 1;\n  float p;\n  scanf(\"%f \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 1; i <= strlen(a); i++)\n    if (f(a[i - 1]))\n      y = 0;\n  for (i = 1; i <= strlen(b); i++)\n    if (f(b[i - 1]))\n      y = 0;\n  if (strlen(a) != strlen(b))\n    y = 0;\n  if (y == 0)\n    printf(\"error\");\n  else {\n    for (i = 1; i <= strlen(a); i++)\n      if (a[i - 1] == b[i - 1])\n        x++;\n    if (x > p * strlen(a))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h(char s[1000]) {\n  int i;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'T' && s[i] != 'C') {\n      i = 1;\n      break;\n    }\n  }\n  if (i != 1) {\n    i = 0;\n  }\n  return i;\n}\nint main() {\n  double c, d, e;\n  int j;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (h(a) || h(b)) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == b[j]) {\n        e++;\n      }\n    }\n    d = e / strlen(a);\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, m, n, z;\n  double x;\n  char p[500], q[500];\n  cin >> x;\n  scanf(\"%s%s\", p, q);\n  a = strlen(p);\n  b = strlen(q);\n  for (i = 0; i < a; i++) {\n    if ((p[i] != 'A') && (p[i] != 'T') && (p[i] != 'C') && (p[i] != 'G'))\n      m = 0;\n  }\n  for (i = 0; i < b; i++) {\n    if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n      n = 0;\n    }\n  }\n  if (a != b || m == 0 || n == 0) {\n    printf(\"error\");\n  } else {\n    z = 0;\n    for (i = 0; i < a; i++) {\n      if (p[i] == q[i]) {\n        z++;\n      }\n    }\n    if ((1.0 * z / a) > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char zfc[1000];\n  char zfc1[1000];\n  cin >> a;\n  int b = 0;\n  double c;\n  int d = 0;\n  int i, j;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", zfc1);\n\n  int g = 0, h = 0;\n  int z = 0;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (zfc[i] == 'A' || zfc[i] == 'T' || zfc[i] == 'C' || zfc[i] == 'G') {\n      g++;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' || zfc1[i] == 'G') {\n      h++;\n    }\n  }\n  if ((g != strlen(zfc)) || (h != strlen(zfc1)) ||\n      strlen(zfc) != strlen(zfc1)) {\n    printf(\"error\\n\");\n    z = 1;\n  }\n  if (z != 1) {\n    for (j = 0; j < strlen(zfc); j++) {\n      if (zfc[j] == zfc1[j]) {\n        b++;\n      }\n    }\n    for (j = 0; j < strlen(zfc); j++) {\n      d++;\n    }\n    c = 1.0 * b / d;\n\n    if (c > a) {\n      printf(\"yes\\n\");\n    }\n    if (c <= a) {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m;\n  int tag = 1;\n  double xsd;\n  char zfc[2][500];\n  int len;\n  int count = 0;\n  scanf(\"%lf\", &m);\n  for (int i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  len = strlen(zfc[0]);\n  for (int j = 0; j < len; j++) {\n    if ((zfc[0][j] != 'A') && (zfc[0][j] != 'G') && (zfc[0][j] != 'C') &&\n        (zfc[0][j] != 'T')) {\n      tag = 0;\n      break;\n    }\n    if (zfc[0][j] == zfc[1][j]) {\n      count++;\n    }\n  }\n  xsd = (double)count / len;\n  if (tag == 0) {\n    printf(\"error\");\n  } else if (strlen(zfc[0]) != strlen(zfc[1])) {\n    printf(\"error\");\n  }\n\n  else if (xsd > m) {\n    printf(\"yes\");\n  } else if (xsd <= m) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8263", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char z[2][650];\n  double res;\n  scanf(\"%lf\", &res);\n  cin >> z[0];\n  scanf(\"%s\", z[1]);\n  int n = strlen(z[0]);\n  int n2 = strlen(z[1]);\n  res = res * 1.0 * n;\n  int h = 0, refer = 0;\n  for (int i = 0; i < n; i++) {\n    if (z[0][i] != 'A' && z[0][i] != 'T' && z[0][i] != 'G' && z[0][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[1][i] != 'A' && z[1][i] != 'T' && z[1][i] != 'G' &&\n               z[1][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[0][i] == z[1][i]) {\n      h++;\n    }\n  }\n  if (refer == 0) {\n    if (n != n2)\n      printf(\"error\");\n    else if (h >= res)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar a[500], b[10000];\n\nint main() {\n  double xg;\n  cin >> xg;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i;\n  int x = 0;\n  int e = 0;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n        break;\n      } else {\n        if (a[i] == b[i])\n          x++;\n      }\n    }\n    if (e == 1) {\n    } else {\n      if ((x * 1.0) / (strlen(a)) > xg)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double k;\n  int xt = 0;\n  int i;\n  int a, b;\n  char zfc1[1000], zfc2[1000];\n  cin >> k;\n  scanf(\"%s\", &zfc1);\n  scanf(\"%s\", &zfc2);\n  a = strlen(zfc1);\n  b = strlen(zfc2);\n  for (i = 0; i < a; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' && zfc1[i] != 'C') {\n      a = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' && zfc2[i] != 'C') {\n      b = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (a == 0 || b == 0 || a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        xt = xt + 1;\n      } else {\n        xt = xt;\n      }\n    }\n    if (b * k < xt) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, k;\n  int i, j = 0;\n  int p, q;\n  cin >> n;\n  char sz[2][1000];\n  scanf(\"%s %s\", sz[0], sz[1]);\n  p = strlen(sz[0]);\n  q = strlen(sz[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < q; i++) {\n    if (sz[0][i] != 'A' && sz[0][i] != 'T' && sz[0][i] != 'C' &&\n        sz[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (sz[1][i] != 'A' && sz[1][i] != 'T' && sz[1][i] != 'C' &&\n        sz[1][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; sz[0][i] != '\\0'; i++) {\n    if (sz[0][i] == sz[1][i]) {\n      j++;\n    }\n  }\n  k = 1.0 * j / i;\n  if (k > n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max = 0, n, i, count = 0, m, j, num[200], left, flag = 0;\n  char a[100], b[100];\n  double s;\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) == strlen(b)) {\n    n = strlen(a);\n  } else {\n    flag = 1;\n    printf(\"error\");\n  }\n  if (flag == 0) {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        flag = 1;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          count++;\n        }\n      }\n    }\n  }\n  if (flag == 0) {\n    if ((double)count / n > s) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, m;\n  double n;\n  m = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  cin >> b;\n  int p = strlen(a);\n  int q = strlen(b);\n  if (p == q) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if ((a[i]) == (b[i]))\n          m++;\n      }\n    }\n    if ((1.0 * m / (p * 1.0)) >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double k;\n  cin >> k;\n  char moban[500], hubu[500];\n  scanf(\"%s\", moban);\n  scanf(\"%s\", hubu);\n  int m, n;\n  m = strlen(moban);\n  n = strlen(hubu);\n  if (m != n)\n    printf(\"error\");\n  else {\n    int count = 0;\n    for (int i = 0; i < n; i++) {\n      if (moban[i] != 'A' && moban[i] != 'T' && moban[i] != 'C' &&\n          moban[i] != 'G')\n        count++;\n      if (hubu[i] != 'A' && hubu[i] != 'T' && hubu[i] != 'C' && hubu[i] != 'G')\n        count++;\n    }\n    if (count != 0)\n      printf(\"error\");\n    else {\n      int sum = 0;\n      for (int i = 0; i < n; i++) {\n        if (moban[i] == hubu[i])\n          sum++;\n      }\n      double result = (double)sum / n;\n      if (result > k)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, b, c, d = 1, e = 1, f = 0;\n  double a, g;\n  char s[500], z[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s);\n  b = strlen(s);\n  scanf(\"%s\", z);\n  c = strlen(z);\n  if (b != c) {\n    printf(\"error\");\n    d = 0;\n    e = 0;\n  }\n  if (d == 1) {\n    for (i = 0; i < b; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      }\n    }\n  }\n  if (d == 1 && e == 1) {\n    for (i = 0; i < b; i++) {\n      if (s[i] == z[i]) {\n        f++;\n      }\n    }\n    g = (1.0 * f) / b;\n    if (g > a) {\n      printf(\"yes\");\n    }\n    if (g <= a) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float x, y, k = 0;\n  int i, j;\n  char a[501], b[501];\n  scanf(\"%f\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i]; i++)\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  for (j = 0; b[j]; j++)\n    if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'G' || b[j] == 'C')) {\n      cout << \"error\\n\";\n      return 0;\n    }\n  if (i != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; a[i]; i++)\n    if (a[i] == b[i])\n      k += 1;\n  y = k / j;\n  if (y > x)\n    cout << \"yes\\n\";\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, c[2], e = 0;\n  char a[2][501];\n  double b;\n  scanf(\"%lf\", &b);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  c[0] = strlen(a[0]);\n  c[1] = strlen(a[1]);\n  if (c[0] != c[1]) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < c[i] - 1; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'G' &&\n          a[i][j] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (j = 0; j < c[0]; j++) {\n    if (a[0][j] == a[1][j]) {\n      e++;\n    }\n  }\n  if (1.0 * e / c[0] > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char a[501], b[501];\n  scanf(\"%s%s\", a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  int i, sum = 0;\n  for (i = 0; i < len1; i++) {\n    switch (a[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n    switch (b[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n\n    if (a[i] == b[i])\n      sum++;\n  }\n\n  if ((double)sum / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8274", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, l, n, i;\n  double p, P;\n  char a[501], b[501];\n  scanf(\"%lf\", &P);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 == l2) {\n    l = l1;\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    p = 1.0 * n / l;\n    if (p > P) {\n      printf(\"yes\\n\");\n    } else\n      printf(\"no\\n\");\n\n  } else {\n    printf(\"error\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, sim = 0;\n  double n;\n  char one[501], two[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", one);\n  scanf(\"%s\", two);\n  if (strlen(one) != strlen(two)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; one[i]; i++) {\n    if ((one[i] != 'A') && (one[i] != 'T') && (one[i] != 'C') &&\n        (one[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; two[i]; i++) {\n    if (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; one[i]; i++) {\n    if (one[i] == two[i]) {\n      sim++;\n    }\n  }\n  if (1.0 * sim / strlen(one) > n) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8276", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float x, fenzi = 0;\n  int lena, lenb, i, j = 0;\n  char a[505], b[505], ch;\n  scanf(\"%f\", &x);\n  cin >> ch;\n  cin >> a;\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb)\n    printf(\"error \");\n  else {\n    for (i = 0; i < lena; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          fenzi++;\n      } else {\n        j = 1;\n        printf(\"error \");\n        break;\n      }\n    }\n    if (j == 0 && fenzi >= x * lena)\n      printf(\"yes \");\n    else if (j == 0)\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i, sum = 0;\n  char a[505], b[505];\n  double n, m;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    goto k;\n  }\n  for (i = 0; i < x; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto k;\n    } else {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n  }\n  m = (1.0 * sum) / x;\n  if (m > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\nk:\n  return 0;\n}\n"}
{"label": "5", "index": "8278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, m, n, p;\n  int l, k, q, i;\n  char b[500], c[500];\n  k = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n%s\", b, c);\n  l = strlen(b);\n  q = strlen(c);\n  if (l != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (b[i] == c[i]) {\n      k++;\n    }\n  }\n  m = l;\n  n = k;\n  p = n / m;\n  if (p > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8279", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, num = 0, len1, len2, pos = 0, lea;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  cin >> a;\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (k = 0; a[k] != '\\0'; k++) {\n      if (a[k] != 'A' && a[k] != 'T' && a[k] != 'C' && a[k] != 'G') {\n        pos = 0;\n        break;\n      } else if (b[k] != 'A' && b[k] != 'T' && b[k] != 'C' && b[k] != 'G') {\n        pos = 0;\n        break;\n      } else {\n        pos = 1;\n        if (a[k] == b[k]) {\n          num++;\n        }\n      }\n    }\n    if (pos == 1) {\n      if (1.0 * num / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n\n    else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc1[505], zfc2[505];\n  int i, j;\n  double k;\n  j = 0;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  if (strlen(zfc1) != strlen(zfc2)) {\n    printf(\"error\");\n    scanf(\"%s\", zfc1);\n    return 0;\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if ((zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'C' &&\n         zfc1[i] != 'G') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'C' &&\n         zfc2[i] != 'G')) {\n      printf(\"error\");\n      scanf(\"%s\", zfc1);\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == zfc2[i])\n      j++;\n  }\n  if (1.0 * j / strlen(zfc1) > k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  scanf(\"%s\", zfc1);\n  return 0;\n}\n"}
{"label": "5", "index": "8281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag = 0;\n  double rate;\n  char a[500], b[500];\n  cin >> rate >> a >> b;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (a[i] == b[i])\n      j++;\n  }\n  if (flag == 1) {\n    return 0;\n  }\n  if ((double)j / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8282", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, k = 0, p = 1;\n  double n;\n  char str[500], tw[500];\n  cin >> n;\n  scanf(\"%s\", str);\n  scanf(\"%s\", tw);\n  l = strlen(str);\n  m = strlen(tw);\n  if (l != m)\n    p = 0;\n  for (i = 0; i < l; i++)\n    if ((str[i] != 'A' && str[i] != 'T' && str[i] != 'C' && str[i] != 'G') ||\n        (tw[i] != 'A' && tw[i] != 'T' && tw[i] != 'C' && tw[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  if (p == 1) {\n    for (i = 0; i < l; i++)\n      if (str[i] == tw[i])\n        k++;\n    if (1.0 * k / l >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double d;\n  scanf(\"%lf\", &d);\n  char s[100];\n  char u[100];\n  scanf(\"%s %s\", s, u);\n  int f = 0;\n  int t = 0, i, r = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    t++;\n  }\n  for (i = 0; u[i] != '\\0'; i++) {\n    r++;\n  }\n  if (r != t) {\n    printf(\"error\\n\");\n    return 0;\n  } else {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else if (u[i] != 'A' && u[i] != 'T' && u[i] != 'C' && u[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else {\n        if (s[i] == u[i]) {\n          f++;\n        }\n      }\n    }\n    if (f * 1.0 / t >= d) {\n      printf(\"yes\\n\");\n      return 0;\n    } else {\n      printf(\"no\\n\");\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, r = 0;\n  double k, w;\n  char s1[1000], s2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s %s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    r++;\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        r++;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        r++;\n      }\n    }\n  }\n  if (r > 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] == s2[i]) {\n        p++;\n      }\n    }\n    w = 1.0 * p / (strlen(s1));\n    if (w > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, m, n, p;\n  int l, k, q, i;\n  char b[500], c[500];\n  k = 0;\n  scanf(\"%lf\", &a);\n  cin >> b >> c;\n  l = strlen(b);\n  q = strlen(c);\n  if (l != q) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (b[i] == c[i]) {\n      k++;\n    }\n  }\n  m = l;\n  n = k;\n  p = n / m;\n  if (p > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a;\n  int bar = 0;\n  scanf(\"%f\", &a);\n  char zfc[2][500];\n  scanf(\"%s\", zfc[0]);\n  scanf(\"%s \", zfc);\n  float count = 0.0;\n  if (strlen(zfc[0]) != strlen(zfc[1]))\n    printf(\"error\");\n  else {\n    float len = strlen(zfc[0]);\n    for (int i = 0; i < len; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        cout << \"error\";\n        bar = 1;\n        break;\n      } else if (zfc[0][i] == zfc[1][i])\n        count += 1.0;\n    }\n    if (count / len >= a && bar == 0)\n      printf(\"yes\");\n    if (count / len < a && bar == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8287", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[2][500];\n  int len[2], i, j, o, W, l;\n  double n, p;\n  W = 0;\n  l = 0;\n  scanf(\"%lf\", &n);\n  getchar();\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n    for (j = 0; j < len[i]; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'C' &&\n          a[i][j] != 'G') {\n        W++;\n      }\n    }\n  }\n  if (len[0] != len[1] || W != 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; j < len[0]; j++) {\n      if (a[0][j] == a[1][j]) {\n        l++;\n      }\n    }\n  }\n  p = 1.0 * l / len[0];\n  if (p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  scanf(\"%d \", &o);\n  return 0;\n}\n"}
{"label": "5", "index": "8288", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[505], b[505];\n  int i, m, sum = 0, SUM = 0;\n  double e, n;\n\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        SUM++;\n      } else if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    if (SUM != 0) {\n      printf(\"error\");\n    } else {\n      m = strlen(a);\n      e = (double)sum / m;\n      if (e > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8289", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500], c[10];\n  double n;\n  int sum = 0;\n  int i, j = 0;\n  cin >> n;\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto end;\n    }\n    if (a[i] == b[i])\n      sum++;\n  }\n  if (b[i] != '\u0000')\n    printf(\"error\");\n  else {\n    if ((double)sum / i > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\nend:;\n}\n"}
{"label": "5", "index": "8290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int len, lmn, sum = 0, i, flag = 1;\n  double n;\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  len = strlen(a);\n  lmn = strlen(b);\n  if (len != lmn)\n    printf(\"error\");\n  else\n\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n\n  if (len == lmn && flag == 1) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if ((double)sum / len > n)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n;\n  int i, l, s = 0, q = 0;\n  char a[550], b[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    q = 1;\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      q = 1;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      q = 1;\n    }\n  }\n  if (q == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        s += 1;\n      }\n    }\n    n = 1.00 * s / l;\n    if (m < n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, s = 0, m;\n  scanf(\"%lf\", &n);\n  char a[600], b[600];\n  scanf(\"%s%s\", &a, &b);\n  int l1, l2;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  }\n  if (l1 == l2) {\n    int i, T = 0;\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'G' || b[i] == 'T' || b[i] == 'A' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          s++;\n\n      } else {\n        printf(\"error\");\n        T = 1;\n        break;\n      }\n    }\n    if (T == 0) {\n      m = s / l1;\n      if (m > n) {\n        printf(\"yes\");\n      }\n      if (m <= n) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, i, x, y, e = 0;\n  double r;\n  char a[500], b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        e = e + 1;\n      } else {\n        if (a[i] == b[i]) {\n          s = s + 1;\n        }\n      }\n    }\n    if (e != 0) {\n      printf(\"error\");\n    } else {\n      if (1.0 * s / x > r) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double s, t;\n  int m, n, flag = 0;\n  int e = 0;\n  char a[1000], b[1000];\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  for (int p = 0; p < m; p++) {\n    if (a[p] == 'A' || a[p] == 'G' || a[p] == 'C' || a[p] == 'T') {\n      flag = 0;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((m != n) || (flag == 1)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    t = 1.0 * e / n;\n    if (t > s) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n = 0;\n  char a[500], b[500], *pa, *pb;\n  cin >> m >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\\n\";\n  } else {\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if (*pa == *pb) {\n        n++;\n      }\n    }\n    n = n / strlen(a);\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if ((*pa != 'A' && *pa != 'T' && *pa != 'G' && *pa != 'C') ||\n          (*pb != 'A' && *pb != 'T' && *pb != 'G' && *pb != 'C')) {\n        printf(\"error\\n\");\n        break;\n      } else if (*(pa + 1) == '\\0' && n > m) {\n        cout << \"yes\\n\";\n      } else if (*(pa + 1) == '\\0' && n <= m) {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  double r;\n  char a[600], b[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    } else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (1.0 * s / strlen(a) > r) {\n    printf(\"yes\");\n  } else {\n    if (1.0 * s / strlen(a) < r) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0;\n  float k = 0, n;\n  char a[502], b[502];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < (strlen(a)); i++) {\n    if (strlen(a) != strlen(b)) {\n      m = 0;\n      break;\n    }\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      m++;\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      m = 0;\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"error\");\n  } else {\n    if ((k / (strlen(a) * 1.00)) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8298", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint atgc(char a) {\n  if (a == 'A' || a == 'G' || a == 'C' || a == 'T') {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  double m;\n  char xl1[500] = {'\\0'}, xl2[500] = {'\\0'};\n  scanf(\"%lf %s %s\", &m, xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    int i, n = 0;\n    for (i = 0; i < len1; i++) {\n      if (atgc(xl1[i]) == 0 || atgc(xl2[i]) == 0) {\n        printf(\"error\");\n        return 0;\n      } else if (xl1[i] == xl2[i]) {\n        n++;\n      }\n    }\n    if (1.0 * n / len1 >= m)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l1, l0, js = 0;\n  double jg, bl;\n  char a[2][501];\n\n  scanf(\"%lf\", &bl);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l0 = strlen(a[0]);\n  l1 = strlen(a[1]);\n  if (l1 != l0) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < l1; i++) {\n      if ((a[j][i] != 'A') && (a[j][i] != 'T') && (a[j][i] != 'C') &&\n          (a[j][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[0][i] == a[1][i]) {\n      js++;\n    }\n  }\n  jg = 1.0 * js / l1;\n  if (jg > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  double w;\n  int count = 0, lena, lenb;\n  scanf(\"%lf\", &w);\n  cin >> a;\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  if (lena != lenb)\n    printf(\"error\");\n  else {\n    int i, j, k = 0;\n    for (i = 0; i < lena; i++) {\n      if (!((a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') &&\n            (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < lena; j++) {\n        if (a[j] == b[j])\n          count++;\n      }\n      double what;\n      what = (double)count / lena;\n      if (what >= w)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, y, x, m, q, p;\n  x = 0;\n  p = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  q = strlen(b);\n  for (int i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  for (int i = 0; i < q; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  if (m != q) {\n    p = 0;\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = x / m;\n    if (y > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8302", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char k[501], h[501];\n  double c, d;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", k);\n  scanf(\"%s\", h);\n  int sum = 0;\n  int a;\n  a = strlen(k);\n  int b;\n  b = strlen(h);\n  if (a != b)\n    printf(\"error\");\n  else if (a == b) {\n    for (int i = 0; i < a; i++) {\n      if ((k[i] != 'A' && k[i] != 'T' && k[i] != 'C' && k[i] != 'G') ||\n          (h[i] != 'A' && h[i] != 'T' && h[i] != 'C' && h[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (k[i] == h[i])\n          sum++;\n      }\n    }\n    if (1.0 * sum / a > c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8303", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double percent;\n  char a[501], b[501];\n  int number = 0;\n  int i;\n  cin >> percent;\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      number++;\n    }\n  }\n  if ((double)number > ((double)strlen(a)) * percent) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, w;\n  int i, m, z = 0, e = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", a, b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i])\n      z++;\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  w = 1.0 * z / m;\n  if (e == 0) {\n    if (w >= n)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, t;\n  int i, k, u, z;\n  z = 0;\n  u = 0;\n  char a[500];\n  char b[500];\n  cin >> r;\n  scanf(\"%s\", a);\n  cin >> b;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      cout << \"error\";\n      z = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] == '\\0') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n  }\n  if (b[i] != '\\0' && z == 0) {\n    printf(\"error\");\n  } else if (z == 0) {\n    for (k = 0; k < i; k++) {\n      if (a[k] == b[k]) {\n        u = u + 1;\n      }\n    }\n    t = 1.0 * u / i;\n    if (t > r) {\n      printf(\"yes\");\n    }\n    if (t <= r) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sa = 0, m = 0;\n  double x, s;\n  char a[105], b[105];\n  scanf(\"%lf\", &x);\n  cin >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i]) {\n          sa++;\n        }\n      }\n      s = 1.0 * sa / strlen(a);\n      if (s > x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, q, i, flag = 1;\n  double m, c = 0, d = 0;\n  char a[10086], b[10086];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    flag = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n    d++;\n  }\n  if (flag == 0) {\n    printf(\"error\");\n  }\n  if (flag == 1) {\n    if (c / d >= m)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1 = 0, len2 = 0, len = 0, flag = 0;\n  char dna1[501], dna2[501];\n  double rate, ra;\n  scanf(\"%lf%s%s\", &rate, dna1, dna2);\n  for (i = 0; dna1[i]; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'G') ||\n        (dna1[i] == 'C')) {\n      len1++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; dna2[i]; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'G') ||\n        (dna2[i] == 'C')) {\n      len2++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        len++;\n      }\n    }\n    ra = (double)len / len1;\n    if (ra > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, count1 = 0, count = 0;\n  char lian1[501], lian2[501];\n  double bi, xiang;\n  scanf(\"%lf\", &bi);\n  scanf(\"%s\", lian1);\n  scanf(\"%s\", lian2);\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    count++;\n  }\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    if (lian2[i] == lian1[i])\n      count1++;\n    if (lian1[i] != 'A' && lian1[i] != 'T' && lian1[i] != 'C' &&\n        lian1[i] != 'G') {\n      j = 1;\n      break;\n    }\n    if (lian2[i] != 'A' && lian2[i] != 'T' && lian2[i] != 'C' &&\n        lian2[i] != 'G') {\n      j = 1;\n      break;\n    }\n  }\n\n  if (j == 1)\n    printf(\"error\");\n  if (j == 0) {\n    xiang = count1 * 1.0 / count;\n\n    if (xiang > bi)\n      printf(\"yes\");\n    if (xiang <= bi)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int e, z;\n  double n;\n  e = 0;\n  z = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[500] = {'\\0'};\n  char b[500] = {'\\0'};\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\", &b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        z = 1;\n      }\n      if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z == 0) {\n      int t = 1.0000000 * e / (c - 3);\n      if (t >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      cout << \"error\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, p = 0, r = 0;\n  double k, w;\n  char s1[1000], s2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s %s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    r++;\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        r++;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        r++;\n      }\n    }\n  }\n  if (r > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] == s2[i]) {\n        p++;\n      }\n    }\n    w = 1.0 * p / (strlen(s1));\n    if (w > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, len, lena;\n  double r, ra;\n  char z[200];\n  char x[200];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", z);\n  scanf(\"%s\", x);\n  len = strlen(z);\n  lena = strlen(x);\n  d = 0;\n  for (a = 0; a <= len - 1; a++) {\n    if (len != lena)\n      d = 1;\n    if ((z[a] != 'A') && (z[a] != 'T') && (z[a] != 'C') && (z[a] != 'G'))\n      d = 1;\n    if ((x[a] != 'A') && (x[a] != 'T') && (x[a] != 'C') && (x[a] != 'G'))\n      d = 1;\n  }\n  if (d == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  b = 0;\n  c = 0;\n  for (a = 0; a <= len - 1; a++) {\n    c++;\n    if (z[a] == x[a])\n      b++;\n  }\n  ra = b * 1.0 / c;\n  if (ra > r)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, max, s, f;\n  float a, b;\n  char ch1[600], ch2[600];\n\n  scanf(\"%f\", &a);\n  scanf(\"%s\", ch1);\n  scanf(\"%s\", ch2);\n  m = strlen(ch1);\n  n = strlen(ch2);\n\n  f = 1;\n  if (m != n)\n    f = 0;\n  max = 0;\n\n  if (f)\n    for (i = 0; i < m; i++) {\n      if (((ch1[i] == 'A') || (ch1[i] == 'T') || (ch1[i] == 'C') ||\n           (ch1[i] == 'G')) &&\n          ((ch2[i] == 'A') || (ch2[i] == 'T') || (ch2[i] == 'C') ||\n           (ch2[i] == 'G'))) {\n        if (ch1[i] == ch2[i])\n          max++;\n      } else {\n        f = 0;\n        break;\n      }\n    }\n\n  if (f) {\n    b = (float)max / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8314", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, i, a;\n  double w, n;\n  x = 0;\n  y = 0;\n  n = 0;\n  a = 0;\n  char sz[500], s[500];\n  cin >> w;\n  scanf(\"%s\", sz);\n  scanf(\"%s\", s);\n  for (i = 0; sz[i] != '\\0'; i++) {\n    x++;\n  }\n  for (i = 0; s[i] != '\\0'; i++) {\n    y++;\n  }\n  if (x != y) {\n    a = 1;\n  } else if (x == y) {\n    for (i = 0; sz[i] != '\\0'; i++) {\n      if (sz[i] == 'A' || sz[i] == 'C' || sz[i] == 'T' || sz[i] == 'G') {\n        if (sz[i] == s[i]) {\n          n = n + 1;\n        } else if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n          a = 1;\n        }\n      } else if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        a = 1;\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"error\");\n  } else {\n    if (a == 0) {\n      n = 1.0 * n / x;\n      if (n >= w) {\n        printf(\"yes\");\n      } else {\n        if (n < w) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len, ans = 0, len1;\n  double n;\n  char s[2][500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s[0]);\n  len1 = strlen(s[0]);\n  scanf(\"%s\", s[1]);\n  len = strlen(s[1]);\n  if (len1 != len) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int j = 0; j < len1; j++) {\n    if (s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'G' && s[0][j] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (int k = 0; k < len; k++) {\n    if (s[1][k] != 'A' && s[1][k] != 'T' && s[1][k] != 'G' && s[1][k] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (len == len1) {\n    for (i = 0; i < len; i++) {\n      if (s[0][i] == s[1][i])\n        ans += 1;\n    }\n    if (ans * 1.0 / len > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, r1, r2, num = 0, index = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  r1 = strlen(a);\n  r2 = strlen(b);\n  for (i = 0; i < r1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  for (i = 0; i < r2; i++) {\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  if (r1 != r2 || index == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < r1; i++) {\n      if (a[i] == b[i])\n        num++;\n    }\n    if ((num * 1.0 / r1) >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double b;\n  char x[1000], y[1000];\n  int i, t, a1, a2, p1, p2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  t = 0;\n  a1 = 0;\n  a2 = 0;\n  p1 = 0;\n  p2 = 0;\n  for (i = 0; x[i] != 0; i++) {\n    a1++;\n    if (x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 'A') {\n      p1++;\n    }\n  }\n  for (i = 0; y[i] != 0; i++) {\n    a2++;\n    if (y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 'A') {\n      p2++;\n    }\n  }\n  if (p1 > 0 || p2 > 0 || a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; y[i] != 0; i++) {\n      if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (1.0 * t / a1 > b) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char z1[500], z2[500];\n  int l = 1;\n  double q, m;\n  scanf(\"%lf \", &m);\n  scanf(\"%s%s\", &z1, &z2);\n  if (strlen(z1) != strlen(z2)) {\n    printf(\"error\");\n    l = 0;\n  } else {\n    for (int i = 0; i < strlen(z1); i++) {\n      if ((z1[i] != 'A' && z1[i] != 'T' && z1[i] != 'G' && z1[i] != 'C') ||\n          (z2[i] != 'A' && z2[i] != 'T' && z2[i] != 'G' && z2[i] != 'C')) {\n        printf(\"error\");\n        l = 0;\n        break;\n      } else if (z1[i] == z2[i])\n        q++;\n    }\n  }\n  if (q / strlen(z1) > m && l == 1)\n    printf(\"yes\");\n  else if (l == 1) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, f = 1;\n  char a[2][255];\n  double x, k, t = 0;\n  scanf(\"%lf\", &x);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  k = strlen(a[0]);\n  for (j = 0; j < k; j++) {\n    if ((a[0][j] != 'A' && a[0][j] != 'C' && a[0][j] != 'T' &&\n         a[0][j] != 'G') ||\n        (a[1][j] != 'A' && a[1][j] != 'T' && a[1][j] != 'C' &&\n         a[1][j] != 'G')) {\n      cout << \"error\";\n      f = 0;\n      break;\n    }\n    if (a[0][j] == a[1][j])\n      t++;\n  }\n  if (f == 1) {\n    if (t / k > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int num = 0, pan = 1;\n  char s;\n  char s1[600], a1[600];\n\n  cin >> &s;\n  n = atof(&s);\n\n  cin >> s1;\n\n  cin >> a1;\n  for (int i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  for (int i = 0; i < strlen(a1); i++) {\n    if (a1[i] != 'A' && a1[i] != 'C' && a1[i] != 'G' && a1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  if (strlen(s1) != strlen(a1))\n    pan = 0;\n  else if (strlen(s1) == strlen(a1) && pan != 0) {\n    for (int i = 0; i < strlen(s1); i++) {\n      if (a1[i] == s1[i])\n        num++;\n    }\n    if (1.0 * num / strlen(s1) < n)\n      cout << \"no\";\n    else\n      cout << \"yes\";\n  }\n  if (pan == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8321", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint h(char s[1000]) {\n  int i;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'T' && s[i] != 'C') {\n      i = 1;\n      break;\n    }\n  }\n  if (i != 1) {\n    i = 0;\n  }\n  return i;\n}\nint main() {\n  double c, d, e;\n  int j;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &c);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (h(a) || h(b)) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == b[j])\n        e++;\n    }\n    d = e / strlen(a);\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, bl;\n  int n1, n2, i, k = 0, sum = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  cin >> dna1 >> dna2;\n  n1 = strlen(dna1);\n  n2 = strlen(dna2);\n  if (n1 != n2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < n1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n          dna1[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n          dna2[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna1[i] == dna2[i]) {\n        sum++;\n      }\n    }\n    if (k == 0) {\n      bl = (double)sum / n1;\n      if (bl > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int a, i, d = 1, b = 0;\n  char sz[1000] = {'\u0000'}, u[1000] = {'\u0000'};\n  scanf(\"%lf\", &n);\n  scanf(\" \");\n\n  cin >> sz;\n\n  cin >> u;\n  a = strlen(sz);\n  for (i = 0; i < a; i++) {\n    if (sz[i] != 'A' && sz[i] != 'G' && sz[i] != 'T' && sz[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    } else if (u[i] != 'A' && u[i] != 'G' && u[i] != 'T' && u[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    }\n\n    else if (sz[i] == u[i]) {\n      b++;\n    }\n  }\n  c = b * 1.0 / a;\n  if (d == 1) {\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, c, d;\n  double l, m, n, x = 0;\n  char a[500], b[500];\n  scanf(\"%lf %s %s\", &l, &a, &b);\n\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      d = 0;\n    } else {\n      d = 1;\n    }\n  }\n  if (c != 0 && d != 0 && n == m) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      } else {\n        x = x;\n      }\n    }\n    if (l < (x / n)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[5][600];\n  int i, p, q, sum = 0;\n  double n, flag;\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  p = strlen(zfc[0]);\n  q = strlen(zfc[1]);\n  if (p != q) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; (zfc[0][i] != '\\0') && (zfc[1][i] != '\\0'); i++) {\n    if ((zfc[0][i] != 'A' && zfc[0][i] != 'G' && zfc[0][i] != 'C' &&\n         zfc[0][i] != 'T') ||\n        (zfc[1][i] != 'A' && zfc[1][i] != 'G' && zfc[1][i] != 'C' &&\n         zfc[1][i] != 'T')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (zfc[0][i] == zfc[1][i]) {\n      sum++;\n    }\n  }\n  flag = 1.0 * sum / p;\n  if (flag > n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  cin >> n;\n  char DNA[2][500];\n  int i;\n  int len[2];\n  for (i = 0; i < 2; i++) {\n    cin >> DNA[i];\n    len[i] = strlen(DNA[i]);\n  }\n  int j;\n  int p = 0;\n  for (j = 0; j < len[0]; j++) {\n    if (DNA[0][j] == DNA[1][j]) {\n      p++;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (DNA[i][j] != 'A' && DNA[i][j] != 'T' && DNA[i][j] != 'C' &&\n          DNA[i][j] != 'G') {\n        m++;\n      }\n    }\n  }\n  double bi;\n  bi = ((double)p) / ((double)len[0]);\n  if (len[0] != len[1] || m != 0) {\n    printf(\"error\");\n  } else if (bi > n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double e;\n  char zf[2][501], count = 0, c, w = 0;\n  cin >> e >> c;\n\n  cin >> zf[0];\n\n  cin >> zf[1];\n  int a = strlen(zf[0]), b = strlen(zf[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int m = 0; m < a; m++) {\n      for (int o = 0; o < 2; o++) {\n        if (zf[o][m] != 'A' && zf[o][m] != 'T' && zf[o][m] != 'G' &&\n            zf[o][m] != 'C')\n          w++;\n      }\n    }\n    if (w != 0) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i < a; i++) {\n        if (zf[0][i] == zf[1][i]) {\n          count++;\n        }\n      }\n      if (1.0 * count / a > e) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sim = 0;\n  double n;\n  char one[501], two[501];\n  scanf(\"%lf\", &n);\n  cin >> one;\n  scanf(\"%s\", two);\n  if (strlen(one) != strlen(two)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; one[i]; i++) {\n    if ((one[i] != 'A') && (one[i] != 'T') && (one[i] != 'C') &&\n        (one[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; two[i]; i++) {\n    if (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; one[i]; i++) {\n    if (one[i] == two[i]) {\n      sim++;\n    }\n  }\n  if (1.0 * sim / strlen(one) > n) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], d[1000], tmp;\n  int i, m, n, j, mc;\n  double k;\n  scanf(\"%lf\", &k);\n  cin >> a >> d;\n  m = strlen(a);\n  n = strlen(d);\n  if (m != n)\n    printf(\"error\");\n  else {\n    j = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        mc = 1;\n        break;\n      } else if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        mc = 1;\n        break;\n      } else {\n        mc = 0;\n      }\n      if (a[i] == d[i])\n        j++;\n    }\n    if (mc == 1)\n      printf(\"error\");\n    else if (j < (k * m))\n      printf(\"no\");\n    else if (j >= (k * m))\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8330", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int num, i;\n  int same = 0, judge = 1;\n  double standard, actual;\n  scanf(\"%lf\", &standard);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    num = strlen(a);\n    for (i = 0; i < num; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C'))) {\n        printf(\"error\");\n        judge = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          same++;\n        }\n      }\n    }\n    if (judge != 0) {\n      actual = 1.0 * same / num;\n      if (actual > standard) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[2][510];\n  int i;\n  int j, k;\n  k = 0;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  if (strlen(s[0]) != strlen(s[1])) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; s[0][j] != '\\0'; j++) {\n      if (s[0][j] == s[1][j]) {\n        k++;\n      }\n      if ((s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'C' &&\n           s[0][j] != 'G') ||\n          (s[1][j] != 'A' && s[1][j] != 'T' && s[1][j] != 'C' &&\n           s[1][j] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  int q;\n  q = strlen(s[0]);\n  double w;\n  w = 1.0 * k / q;\n  if (w >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, y;\n  int a, b, x = 0, k = 1;\n  char sy[501], se[501];\n  scanf(\"%lf %s %s\", &n, sy, se);\n  a = strlen(sy);\n  b = strlen(se);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < a; i++) {\n      if ((sy[i] == 'A' || sy[i] == 'T' || sy[i] == 'C' || sy[i] == 'G') &&\n          (se[i] == 'A' || se[i] == 'T' || se[i] == 'C' || se[i] == 'G')) {\n        if (sy[i] == se[i]) {\n          x += 1;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      y = 1.0 * x / a;\n      if (y >= n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8333", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, c = 0;\n  int i, n, b = 0;\n  char q[500], w[500], num[50];\n\n  cin >> num;\n  a = atof(num);\n\n  cin >> q;\n\n  scanf(\"%s \", w);\n  n = strlen(q);\n  for (i = 0; i < n; i++) {\n    if (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G') {\n      b++;\n    }\n    if (w[i] != 'A' && w[i] != 'T' && w[i] != 'C' && w[i] != 'G')\n      b++;\n  }\n  if (b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (q[i] == w[i]) {\n        c++;\n      }\n    }\n    c = c / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8334", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, h = 1, la, lb;\n  double s, r;\n  char a[1000], b[1000];\n  cin >> s;\n  scanf(\"%s\\n%s\", a, b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        printf(\"error\");\n        h = 0;\n        break;\n      }\n    }\n    if (h == 1) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n      r = (double)j / (double)la;\n      if (r >= s)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, len, n = 0, x, y;\n  double m, p;\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] > 'Z' || a[i] < 'A') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (x != y)\n    printf(\"error\");\n  else {\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n\n    p = (double)n / len;\n    if (p > m) {\n      printf(\"yes\");\n    } else if (p <= m)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[2][600];\n  double n, m;\n  cin >> n >> a[0];\n  scanf(\"%s\", a[1]);\n  int i, s = 0;\n  m = strlen(a[0]);\n  for (i = 0; i < m; i++) {\n    if ((a[0][i] != 65 && a[0][i] != 67 && a[0][i] != 71 && a[0][i] != 84) ||\n        (a[1][i] != 65 && a[1][i] != 67 && a[1][i] != 71 && a[1][i] != 84)) {\n      printf(\"error\");\n      s = -1;\n      break;\n    } else if (a[0][i] == a[1][i])\n      s++;\n  }\n\n  if (s != -1) {\n    double q;\n    q = s * 1.0 / m;\n    if (q >= n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8337", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0, e, f;\n  double n, m, k = 0;\n  char num[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", &num[i]);\n  }\n  e = strlen(num[0]);\n  f = strlen(num[1]);\n  for (i = 0; i < 2; i++) {\n    m = strlen(num[i]);\n    for (j = 0; j < m; j++) {\n      if (((num[i][j] != 'A') && (num[i][j] != 'C') && (num[i][j] != 'G') &&\n           (num[i][j] != 'T')) ||\n          (e != f)) {\n        printf(\"error \");\n        l++;\n        break;\n      }\n    }\n    if (l > 0) {\n      break;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    if (l == 0) {\n      if (num[0][j] == num[1][j]) {\n        k++;\n      }\n    }\n  }\n  if ((l == 0) && (k / m) > n)\n    printf(\"yes \");\n  else if ((l == 0) && (k / m) <= n) {\n    printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double f;\n  int i, p, s = 1;\n  char a[501], b[501];\n  scanf(\"%lf\\n%s\\n%s\\n\", &f, a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        p = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / (1.0 * len1) > f) && (p != 0)) {\n      printf(\"yes\");\n    } else if ((1.0 * s / (1.0 * len1) <= f) && (p != 0)) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8339", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, j;\n  int i, o;\n  char a[500], b[500];\n  cin >> k;\n  cin >> a;\n  cin >> b;\n  int l = strlen(a);\n  int p = strlen(b);\n  o = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      p += 500;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      p += 500;\n    }\n    if (a[i] == b[i])\n      o++;\n  }\n  if (l != p)\n    printf(\"error\");\n  else {\n    j = 1.0 * o / l;\n    if (j > k)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501], isbreak;\n  isbreak = 'n';\n  double x, n;\n  int i, l1, l2, t;\n  t = 0;\n  cin >> n;\n  scanf(\"%s%s\", DNA1, DNA2);\n  l1 = strlen(DNA1);\n  l2 = strlen(DNA2);\n  if (l1 != l2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'C' &&\n           DNA1[i] != 'G') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'C' &&\n           DNA2[i] != 'G')) {\n        isbreak = 'y';\n        break;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          t++;\n        }\n      }\n    }\n    if (isbreak == 'y') {\n      printf(\"error\");\n    } else {\n      x = (1.0 * t) / l1;\n      if (x > n)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, rate;\n  int i, lena, lenb, sum = 0;\n  scanf(\"%f\", &a);\n  char an[501], bn[501];\n  scanf(\"%s\", an);\n  scanf(\"%s\", bn);\n  lena = strlen(an);\n  lenb = strlen(bn);\n  if (lena != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < lena; i++) {\n    if ((an[i] != 'A' && an[i] != 'T' && an[i] != 'C' && an[i] != 'G') ||\n        (bn[i] != 'A' && bn[i] != 'T' && bn[i] != 'C' && bn[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    if (an[i] == bn[i])\n      sum += 1;\n  }\n  rate = 1.0 * sum / lena;\n  if (rate > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8342", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int l, i, xg = 0, cw = 0;\n  char jy[2][500];\n  cin >> x;\n  scanf(\"%s %s\", jy[0], jy[1]);\n  if (strlen(jy[0]) == strlen(jy[1])) {\n    l = strlen(jy[0]);\n    for (i = 0; i < l; i++) {\n      if (jy[0][i] == jy[1][i]) {\n        xg++;\n      }\n      if ((jy[0][i] != 'A' && jy[0][i] != 'T' && jy[0][i] != 'C' &&\n           jy[0][i] != 'G') ||\n          (jy[1][i] != 'A' && jy[1][i] != 'T' && jy[1][i] != 'C' &&\n           jy[1][i] != 'G')) {\n        cw++;\n      }\n    }\n    y = 1.0 * xg / l;\n  } else if (strlen(jy[0]) != strlen(jy[1])) {\n    cw++;\n  }\n  if (cw == 0) {\n    printf(y > x ? \"yes\" : \"no\");\n  } else if (cw != 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8343", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag = 0;\n  double rate;\n  char a[500], b[500];\n  cin >> rate >> a >> b;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (a[i] == b[i])\n      j++;\n  }\n  if (flag == 1)\n    return 0;\n  if ((double)j / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int l1, l2, n, i, j, k, num = 0, f = 0;\n  double s, p;\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    f = 1;\n    return 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    for (i = 0; i < l2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    if (f == 0) {\n      for (i = 0; i < l1; i++) {\n        if (a[i] == b[i])\n          num++;\n      }\n    }\n    if (f == 0) {\n      p = (double)num / l1;\n      if (p > s)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8345", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, q = 0, a, b, d = 0, e = 0, l, g;\n  float c, n;\n  char s1[500], s2[500];\n  scanf(\"%f\\n\", &n);\n  cin >> s1 >> s2;\n  if (strlen(s1) != strlen(s2))\n    printf(\"error\");\n  if (strlen(s1) == strlen(s2)) {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n        d++;\n      }\n    }\n    for (j = 0; s2[j] != '\\0'; j++) {\n      if (s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'G' && s2[j] != 'C') {\n        e++;\n      }\n    }\n    l = strlen(s1);\n    for (int k = 0; k < l; k++) {\n      if (s1[k] == s2[k])\n        q++;\n    }\n    a = strlen(s1);\n    b = q;\n    c = (float)b / (float)a;\n    g = d + e;\n    if (g != 0) {\n      printf(\"error\");\n    } else {\n      if (c >= n)\n        printf(\"yes\");\n      if (c < n)\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8346", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sz1[501], sz2[501];\n  int n, i, result = 0, x = 0;\n  double p;\n  scanf(\"%lf \", &p);\n  cin >> sz1 >> sz2;\n  n = strlen(sz1);\n  for (i = 0; i < n; i++) {\n    if (((sz1[i] != 'A') && (sz1[i] != 'T') && (sz1[i] != 'C') &&\n         (sz1[i] != 'G')) ||\n        ((sz2[i] != 'A') && (sz2[i] != 'T') && (sz2[i] != 'C') &&\n         (sz2[i] != 'G'))) {\n      result = 1;\n      break;\n    } else if (sz1[i] == sz2[i]) {\n      x++;\n    }\n  }\n  if (result == 1) {\n    printf(\"error\\n\");\n  } else if ((1.0 * x / n) > p) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, c;\n  int i, j = 0, m, s, t;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"\\n\");\n  scanf(\"%s\", b);\n  m = strlen(a);\n  s = strlen(b);\n  if (m <= s) {\n    t = m;\n  } else {\n    t = s;\n  }\n  for (i = 0; i < t; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G' || m != s) {\n      printf(\"error\");\n      j = -1;\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n  }\n  c = 1.0 * j / m;\n  if (c > n) {\n    printf(\"yes\");\n  } else if (c <= n && c >= 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, i, x, y, e = 0;\n  double r;\n  char a[500], b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        e = e + 1;\n      } else {\n        if (a[i] == b[i])\n          s = s + 1;\n      }\n    }\n    if (e != 0) {\n      printf(\"error\");\n    } else {\n      if (1.0 * s / x > r) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8349", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double x, y;\n  char a[501], b[501];\n  int i, t = 0, m = 0, n = 0, mark = 1;\n  scanf(\"%lf\", &x);\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; a[i]; i++) {\n    m = m + 1;\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n      mark = 0;\n  }\n  for (i = 0; b[i]; i++) {\n    n = n + 1;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      mark = 0;\n  }\n  if (m != n || mark == 0)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i])\n        t = t + 1;\n    }\n    y = t / (double)m;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int n = 0, i, c, d, m = 0;\n  char a[502], b[502];\n  cin >> x >> a >> b;\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  if (m == 1 || c != d) {\n    cout << \"error\";\n  } else {\n    for (i = 0; a[i], b[i]; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    y = 1.0 * n / c;\n    if (y > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, p = 0, c = 0, d = 0;\n  double k, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        c++;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        d++;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    t = 1.0 * p / n;\n    if (c == 0 && d == 0) {\n      if (t > k)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2;\n  float s, w, L;\n  char x[501], y[501];\n  scanf(\"%f\", &w);\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  s = 0;\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n      if (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') {\n        cout << \"error\";\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          s++;\n        }\n      }\n    }\n    L = l1;\n    if (i == l1) {\n      if (s / L > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8353", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int sum = 0, i, l1, l2, judge = 1;\n  char x[1001], y[1001];\n  scanf(\"%lf %s %s \", &a, x, y);\n  l1 = strlen(x), l2 = strlen(y);\n  if (l1 != l2)\n    judge = 0;\n  else\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'C' && x[i] != 'G' && x[i] != 'A' && x[i] != 'T')\n        judge = 0;\n      if (y[i] != 'C' && y[i] != 'G' && y[i] != 'A' && y[i] != 'T')\n        judge = 0;\n    }\n  if (judge == 1) {\n    for (i = 0; i < l1; i++)\n      if (x[i] == y[i])\n        sum++;\n    if (sum >= (int)(a * l1))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l1, l2, l, n, i;\n  double p, P;\n  char a[501], b[501];\n  scanf(\"%lf\", &P);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 == l2) {\n    l = l1;\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        cout << \"error\\n\";\n        return 0;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    p = 1.0 * n / l;\n    if (p > P) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8355", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  double m, n, s;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  if (strlen(a) == strlen(b)) {\n\n    for (i = 0, j = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        k = 1;\n\n      } else {\n\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n    }\n    if (k == 0) {\n\n      n = 0.1 * strlen(a);\n      s = j * 0.1 / n;\n      if (s > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char gene1[500];\n  char gene2[500];\n  int i;\n  int s = 0;\n  double r;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &gene1);\n  scanf(\"%s\", &gene2);\n  int len1 = strlen(gene1);\n  int len2 = strlen(gene2);\n  int fuhe = 1;\n  for (i = 0; i <= len1 - 1; i++) {\n    if ((gene1[i] != 'A' && gene1[i] != 'T' && gene1[i] != 'C' &&\n         gene1[i] != 'G') ||\n        (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n         gene2[i] != 'G')) {\n      fuhe = 0;\n    }\n  }\n  if (len1 != len2 || fuhe == 0)\n    cout << \"error\";\n  else {\n    for (i = 0; i <= len1 - 1; i++) {\n      if (gene1[i] == gene2[i]) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n    if (1.00 * s / len1 > r) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8357", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, b, n;\n  int i;\n  char A[1000], B[1000];\n  scanf(\"%lf \", &n);\n  scanf(\"%s\\n%s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0, b = 0; i < a; i++) {\n    if ((A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') ||\n        (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (A[i] == B[i]) {\n      b++;\n    }\n  }\n  a = b / a;\n  if (a >= n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[500], zfc2[500];\n  int i, j, t, len1, len2;\n  double n;\n  cin >> n;\n  scanf(\"%s %s\", zfc1, zfc2);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; zfc1[i]; i++) {\n    if (len2 != len1 ||\n        (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' &&\n         zfc1[i] != 'C') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' &&\n         zfc2[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  t = 0;\n  for (j = 0; zfc1[j] != '\\0'; j++) {\n    if (zfc1[j] == zfc2[j]) {\n      t++;\n    }\n  }\n  if (1.0 * t / len1 > n) {\n    printf(\"yes\");\n    return 0;\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8359", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  int i, len, e = 0, sum = 0, len2;\n  double bi, h;\n  scanf(\"%lf%s%s\", &bi, a, b);\n  len = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n         b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        len != len2) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  if (e == 0) {\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n\n    h = sum * 1.0 / len;\n    if (h >= bi) {\n      printf(\"yes\");\n    } else if (h < bi) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b = 0, i;\n  char a[100][100], e[210];\n  double n;\n\n  cin >> e;\n  n = atof(e);\n\n  cin >> a[0];\n\n  cin >> a[1];\n  int p = strlen(a[0]);\n  int q = strlen(a[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < p; i++) {\n      if (!(a[0][i] == 'A' || a[0][i] == 'T' || a[0][i] == 'G' ||\n            a[0][i] == 'C' && a[1][i] == 'A' || a[1][i] == 'T' ||\n\n            a[1][i] == 'G' || a[1][i] == 'C')) {\n        cout << \"error\";\n        return 0;\n      } else {\n        if (a[0][i] == a[1][i])\n          b++;\n      }\n    }\n  }\n  if (1.0 * b / p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0, l1, l2;\n  double n, m;\n  char a[256], b[256];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      s = s + 1;\n    }\n  }\n  if (s != 0 || l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    m = (double)t / l1;\n    if (m > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[2][501];\n  double n;\n  double sum = 0, x, Len;\n  int len, i, len2, j;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s[0], s[1]);\n  len = strlen(s[0]);\n  len2 = strlen(s[1]);\n  if (len != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; j < len; j++) {\n        if (s[i][j] != 'A' && s[i][j] != 'T' && s[i][j] != 'G' &&\n            s[i][j] != 'C') {\n          printf(\"error\");\n          return 0;\n        } else\n          continue;\n      }\n    }\n  }\n\n  for (i = 0; i < len; i++) {\n    if (s[0][i] == s[1][i]) {\n      sum = sum + 1;\n    }\n  }\n  Len = (double)len;\n  x = sum / Len;\n  if (x >= n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, b, s = 0, a;\n  double r, R;\n  char gene[500], gene2[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", gene);\n  cin >> gene2;\n  b = strlen(gene2);\n  a = strlen(gene);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (gene[i] != 'A' && gene[i] != 'T' && gene[i] != 'C' && gene[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n        gene2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (gene[i] == gene2[i]) {\n      s++;\n    }\n  }\n  R = 1.000 * s / b;\n  if (R > r) {\n    printf(\"yes\");\n  } else if (R <= r) {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double k;\n  int xt = 0;\n  int i;\n  int a, b;\n  char zfc1[1000], zfc2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &zfc1);\n  scanf(\"%s\", &zfc2);\n  a = strlen(zfc1);\n  b = strlen(zfc2);\n  for (i = 0; i < a; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' && zfc1[i] != 'C') {\n      a = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' && zfc2[i] != 'C') {\n      b = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (a == 0 || b == 0 || a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        xt = xt + 1;\n      } else {\n        xt = xt;\n      }\n    }\n    if (b * k < xt) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, c = 0, d;\n  int i, k, a, b, s = 0;\n  char s1[550], s2[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", s1, s2);\n  a = strlen(s1);\n  b = strlen(s2);\n  if (a != b) {\n    printf(\"error\\n\");\n  }\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T')\n        s++;\n    }\n    for (i = 0; i < b; i++) {\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        s++;\n      }\n    }\n    if (s == 0) {\n      for (i = 0; i < a; i++) {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n      d = c / a;\n      if (d >= m) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n    if (s != 0) {\n      printf(\"error\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8366", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, count1 = 0, count = 0;\n  char lian1[501], lian2[501];\n  double bi, xiang;\n  cin >> bi;\n  scanf(\"%s\", lian1);\n  cin >> lian2;\n  for (i = 0; lian1[i] != '\\0'; i++)\n    count++;\n\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    if (lian2[i] == lian1[i])\n      count1++;\n    if (lian1[i] != 'A' && lian1[i] != 'T' && lian1[i] != 'C' &&\n        lian1[i] != 'G') {\n      j = 1;\n      break;\n    }\n    if (lian2[i] != 'A' && lian2[i] != 'T' && lian2[i] != 'C' &&\n        lian2[i] != 'G') {\n      j = 1;\n      break;\n    }\n  }\n\n  if (j == 1)\n    printf(\"error\");\n  if (j == 0) {\n    xiang = count1 * 1.0 / count;\n\n    if (xiang > bi)\n      printf(\"yes\");\n    if (xiang <= bi)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  char qian[501];\n  char hou[501];\n  scanf(\"%s%s\", &qian, &hou);\n\n  int i, s = 0;\n  if (strlen(qian) != strlen(hou)) {\n    s = 1;\n  }\n  int m = 0;\n  for (i = 0; i < strlen(qian); i++) {\n    if ((qian[i] != 'A' && qian[i] != 'T' && qian[i] != 'G' &&\n         qian[i] != 'C') ||\n        (hou[i] != 'A' && hou[i] != 'T' && hou[i] != 'G' && hou[i] != 'C')) {\n      s = 1;\n    }\n  }\n  if (s == 1) {\n    printf(\"error\");\n  } else {\n    if (s == 0) {\n      for (i = 0; i < strlen(qian); i++) {\n        if (qian[i] == hou[i]) {\n          m++;\n        }\n      }\n      if (1.0 * m / strlen(qian) > k) {\n        printf(\"yes\");\n      } else {\n        if (1.0 * m / strlen(qian) <= k) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x[1000], y[1000];\n  int i, lengthx, lengthy, same = 0;\n  float rate, a;\n  scanf(\"%f\", &rate);\n  scanf(\"%s %s\", x, y);\n  lengthx = strlen(x);\n  lengthy = strlen(y);\n  if (lengthx != lengthy)\n    cout << \"error\\n\";\n  else {\n    for (i = 0; i < lengthx; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T'))\n        break;\n    }\n    if (i < lengthx - 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < lengthx; i++)\n        if (x[i] == y[i])\n          same++;\n      a = (float)same / (float)lengthx;\n      if (a > rate)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8369", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], d[1000];\n  int i, m, n, j, mc;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s%s\", a, d);\n  m = strlen(a);\n  n = strlen(d);\n  if (m != n)\n    printf(\"error\");\n  else {\n    j = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        mc = 1;\n        break;\n      } else if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        mc = 1;\n        break;\n      } else {\n        mc = 0;\n      }\n      if (a[i] == d[i])\n        j++;\n    }\n    if (mc == 1)\n      printf(\"error\");\n    else if (j < (k * m))\n      printf(\"no\");\n    else if (j >= (k * m))\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, i, sum = 0, w = 0;\n  float rate, result;\n  char zfc_1[600], zfc_2[600];\n  scanf(\"%f\", &rate);\n  cin >> zfc_1;\n  cin >> zfc_2;\n  l1 = strlen(zfc_1);\n  l2 = strlen(zfc_2);\n  for (i = 0; i < l1; i++) {\n    if ((l1 != l2) ||\n        (zfc_1[i] != 'A' && zfc_1[i] != 'T' && zfc_1[i] != 'G' &&\n         zfc_1[i] != 'C') ||\n        (zfc_2[i] != 'A' && zfc_2[i] != 'T' && zfc_2[i] != 'G' &&\n         zfc_2[i] != 'C')) {\n      printf(\"error\");\n      w = 1;\n      break;\n    } else {\n      if (zfc_1[i] == zfc_2[i]) {\n        sum++;\n      } else {\n        continue;\n      }\n    }\n  }\n  result = 1.00 * sum / l1;\n  if (result > rate) {\n    cout << \"yes\";\n  } else if ((result <= rate) && (w == 0))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double xgx, n;\n  scanf(\"%lf\", &xgx);\n  int i, j, k, l = 0, m = 0;\n  char jy1[10086], jy2[10086];\n  scanf(\"%s\", jy1);\n  scanf(\"%s\", jy2);\n  j = strlen(jy1);\n  k = strlen(jy2);\n  jy1[j] = '\\0';\n  jy2[k] = '\\0';\n  if (j != k) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if (((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n           (jy1[i] != 'G')) ||\n          ((jy2[i] != 'A') && (jy2[i] != 'T') && (jy2[i] != 'C') &&\n           (jy2[i] != 'G'))) {\n        l++;\n      }\n    }\n    if (l != 0) {\n      printf(\"error\\n\");\n    } else {\n      for (i = 0; i < j; i++) {\n        if (jy1[i] == jy2[i]) {\n          m++;\n        }\n      }\n      n = 1.0 * m / j;\n      if (n > xgx) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char x) {\n  if (x == 'A' || x == 'T' || x == 'G' || x == 'C')\n    return 0;\n  else\n    return 1;\n}\nint main(int argc, char *argv[]) {\n  char a[501], b[501];\n  int x = 0, i, y = 1;\n  float p;\n  scanf(\"%f \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 1; i <= strlen(a); i++)\n    if (f(a[i - 1]))\n      y = 0;\n  for (i = 1; i <= strlen(b); i++) {\n    if (f(b[i - 1]))\n      y = 0;\n  }\n  if (strlen(a) != strlen(b))\n    y = 0;\n  if (y == 0)\n    printf(\"error\");\n  else {\n    for (i = 1; i <= strlen(a); i++)\n      if (a[i - 1] == b[i - 1])\n        x++;\n    if (x > p * strlen(a))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char zfc[500], sz[500];\n  cin >> zfc >> sz;\n  int a = strlen(zfc);\n  int b = strlen(sz);\n  int m;\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    m = a;\n    int k = 0;\n    int y;\n    for (y = 0; y < m; y++) {\n      if (zfc[y] != 'A' && zfc[y] != 'T' && zfc[y] != 'C' && zfc[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n      if (sz[y] != 'A' && sz[y] != 'T' && sz[y] != 'C' && sz[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n\n      int i, c = 0;\n      for (i = 0; i < m; i++) {\n        if (zfc[i] == sz[i]) {\n          c++;\n        }\n      }\n      double s = c * 1.0 / m;\n      if (s > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  char qian[501];\n  char hou[501];\n  scanf(\"%s%s\", &qian, &hou);\n\n  int i, s = 0;\n  if (strlen(qian) != strlen(hou)) {\n    s = 1;\n  }\n  int m = 0;\n  for (i = 0; i < strlen(qian); i++) {\n    if ((qian[i] != 'A' && qian[i] != 'T' && qian[i] != 'G' &&\n         qian[i] != 'C') ||\n        (hou[i] != 'A' && hou[i] != 'T' && hou[i] != 'G' && hou[i] != 'C')) {\n      s = 1;\n    }\n  }\n  if (s == 1) {\n    printf(\"error\");\n  } else if (s == 0) {\n    for (i = 0; i < strlen(qian); i++) {\n      if (qian[i] == hou[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / strlen(qian) > k) {\n      printf(\"yes\");\n    } else if (1.0 * m / strlen(qian) <= k) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  double m;\n  char jianji[2][501];\n  int len1, len2;\n  int i;\n  int sum = 0;\n  scanf(\"%lf%s%s\", &n, jianji[0], jianji[1]);\n  len1 = strlen(jianji[0]);\n  len2 = strlen(jianji[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((jianji[0][i] != 'A' && jianji[0][i] != 'T' && jianji[0][i] != 'C' &&\n           jianji[0][i] != 'G') ||\n          (jianji[1][i] != 'A' && jianji[1][i] != 'T' && jianji[1][i] != 'C' &&\n           jianji[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (jianji[0][i] == jianji[1][i]) {\n        sum += 1;\n      }\n    }\n    m = (1.0 * sum) / len1;\n    if (m > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, k = 0, p = 1;\n  double n;\n  char str[500], tw[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", str);\n  scanf(\"%s\", tw);\n  l = strlen(str);\n  m = strlen(tw);\n  if (l != m)\n    p = 0;\n  for (i = 0; i < l; i++)\n    if ((str[i] != 'A' && str[i] != 'T' && str[i] != 'C' && str[i] != 'G') ||\n        (tw[i] != 'A' && tw[i] != 'T' && tw[i] != 'C' && tw[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  if (p == 1) {\n    for (i = 0; i < l; i++)\n      if (str[i] == tw[i])\n        k++;\n    if (1.0 * k / l >= n)\n      cout << \"yes\";\n    else\n      cout << \"no\";\n  } else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "8377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, b;\n  char sz[520], zfc[520];\n  double a, m;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", sz);\n  scanf(\"%s\\n\", zfc);\n  n = strlen(zfc);\n  k = 0;\n  b = 0;\n  if (strlen(sz) != n) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'G' && sz[i] != 'C') ||\n          (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'G' && zfc[i] != 'C')) {\n        printf(\"error\");\n        b = 1;\n        break;\n      } else {\n        if (sz[i] == zfc[i]) {\n          k++;\n        }\n      }\n    }\n  }\n  if (b == 0) {\n    m = 1.0 * k / n;\n    if (m > a)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j1, j;\n  double a, m, n;\n  char s1[100], s2[100];\n  c = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T' ||\n          s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n    }\n  }\n  m = 1.0 * strlen(s1);\n  n = 1.0 * c;\n  if (n / m > a)\n    printf(\"yes\");\n  else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char s1[501];\n  char s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  int i, len1, len2, sum = 0;\n  double gl;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          sum += 1;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    gl = 1.0 * sum / len1;\n    if (gl > n) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  double t, k = 0;\n  char s[500] = {'\\0'}, x[500] = {'\\0'};\n  cin >> t >> s >> x;\n  for (a = 0; s[a] != '\\0'; a++) {\n    if (s[a] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  for (b = 0; x[b] != '\\0'; b++) {\n    if (x[b] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (a != b || k == 1) {\n    cout << \"error\";\n  } else {\n    for (a = 0; a < b; a++) {\n      if (s[a] == x[a]) {\n        c++;\n      }\n    }\n    k = 1.0 * c / b;\n    if (k > t) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, x;\n  int l, l1, l2, i, j, t = 0, flag = 0;\n  char a[100], b[100];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (j = 0; j < l2; j++) {\n    if (b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n    return 0;\n  } else {\n    l = l1;\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    x = (double)t / l;\n    if (x > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, s;\n  char a[101], b[101];\n  j = 0;\n  cin >> x;\n\n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      j++;\n      break;\n    }\n  }\n\n  if (n != m || j != 0)\n    cout << \"error\";\n  else {\n    for (i = 0; i < n; i++) {\n      if (b[i] == a[i]) {\n        s++;\n      }\n    }\n    s = s / n;\n    if (s > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, b, c, d = 1, e = 1, f = 0;\n  double a, g;\n  char s[500], z[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s);\n  b = strlen(s);\n  cin >> z;\n  c = strlen(z);\n  if (b != c) {\n    cout << \"error\";\n    d = 0;\n    e = 0;\n  }\n  if (d == 1) {\n    for (i = 0; i < b; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      }\n    }\n  }\n  if (d == 1 && e == 1) {\n    for (i = 0; i < b; i++) {\n      if (s[i] == z[i]) {\n        f++;\n      }\n    }\n    g = (1.0 * f) / b;\n    if (g > a) {\n      printf(\"yes\");\n    }\n    if (g <= a) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  double rate;\n  char gen1[500], gen2[500];\n  cin >> rate >> gen1 >> gen2;\n  int len1 = strlen(gen1), len2 = strlen(gen2), S = 0;\n  if (len1 != len2) {\n    cout << \"error\" << endl;\n    return 0;\n  }\n  for (int i = 0; i < len1; i++) {\n    if ((gen2[i] != 'A' && gen2[i] != 'T' && gen2[i] != 'C' &&\n         gen2[i] != 'G') ||\n        (gen1[i] != 'A' && gen1[i] != 'T' && gen1[i] != 'C' &&\n         gen1[i] != 'G')) {\n      cout << \"error\" << endl;\n      return 0;\n    }\n    if (gen1[i] == gen2[i])\n      S++;\n  }\n  double R;\n  R = (double)S / len1;\n  if (R >= rate) {\n    cout << \"yes\" << endl;\n    return 0;\n  } else {\n    cout << \"no\" << endl;\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8385", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, e, i, z;\n  e = 0;\n  double x, y, k, h;\n  cin >> k;\n  char a[510], b[510];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  t = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        z++;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        z++;\n      else if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z != 0) {\n      printf(\"error\");\n    } else {\n      x = e;\n      y = t;\n      h = x / y;\n      if (h > k) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, l, s = 0, p = 0;\n  double n, m;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n  k = strlen(a), l = strlen(b);\n  for (i = 0; i < k; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      p++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] == b[i]) {\n      s++;\n    }\n  }\n  m = 1.0 * s / k;\n  if ((k == l) && (p == 0) && (m > n)) {\n    printf(\"yes\");\n  } else if ((k == l) && (p == 0) && (m <= n)) {\n    printf(\"no\");\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l1, l0, js = 0;\n  double jg, bl;\n  char a[2][501];\n\n  cin >> bl;\n  for (i = 0; i < 2; i++) {\n    cin >> a[i];\n  }\n  l0 = strlen(a[0]);\n  l1 = strlen(a[1]);\n  if (l1 != l0) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < l1; i++) {\n      if ((a[j][i] != 'A') && (a[j][i] != 'T') && (a[j][i] != 'C') &&\n          (a[j][i] != 'G')) {\n        cout << \"error\";\n        return 0;\n      }\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[0][i] == a[1][i]) {\n      js++;\n    }\n  }\n  jg = 1.0 * js / l1;\n  if (jg > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z;\n  char sz1[500];\n  char sz2[500];\n  int i, m, n;\n  int x = 1, y = 0;\n  double e;\n  scanf(\"%lf\", &z);\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  m = strlen(sz1);\n  n = strlen(sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    if (sz1[i] == 'A' || sz1[i] == 'G' || sz1[i] == 'C' || sz1[i] == 'T') {\n      continue;\n    } else if (sz1[i] != 'A' || sz1[i] != 'G' || sz1[i] != 'C' ||\n               sz1[i] != 'T') {\n      x = 0;\n      break;\n    }\n  }\n  if ((m != n) || (x == 0)) {\n    printf(\"error\");\n  } else if (m == n && x == 1) {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if (sz1[i] == sz2[i]) {\n        y++;\n      }\n    }\n    e = 1.0 * y / m;\n    if (e > z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  int xt = 0;\n  int i;\n  int a, b;\n  char zfc1[1000], zfc2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &zfc1);\n  scanf(\"%s\", &zfc2);\n  a = strlen(zfc1);\n  b = strlen(zfc2);\n  for (i = 0; i < a; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' && zfc1[i] != 'C') {\n      a = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' && zfc2[i] != 'C') {\n      b = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (a == 0 || b == 0 || a != b) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < b; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        xt = xt + 1;\n      } else {\n        xt = xt;\n      }\n    }\n    if (b * k < xt) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, c;\n  char s[1000], as[1000];\n  int m, n, t, i, b;\n  scanf(\"%lf\", &a);\n  cin >> s >> as;\n  t = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 65 && s[i] != 67 && s[i] != 71 && s[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  for (i = 0; as[i] != '\\0'; i++) {\n    if (as[i] != 65 && as[i] != 67 && as[i] != 71 && as[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  m = strlen(s);\n  n = strlen(as);\n  if (m != n) {\n    t = -1;\n  }\n  b = 0;\n  if (t == 0) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == as[i]) {\n        b++;\n      }\n    }\n    c = 1.0 * b / m;\n    if (c > a) {\n      t = 1;\n    } else\n      t = 0;\n  }\n  if (t == -1) {\n    cout << \"error\\n\";\n  }\n  if (t == 0) {\n    printf(\"no\\n\");\n  }\n  if (t == 1) {\n    printf(\"yes\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8391", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int i, t = 1, r;\n  char s1[500];\n  char s2[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s \", s1, s2);\n  int len1 = strlen(s1);\n  int len2 = strlen(s2);\n  if (len1 != len2) {\n    t = 0;\n  } else {\n    int cnt = 0;\n    for (i = 0; i < len1; i++) {\n      if ((!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) ||\n          (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')))\n        t = 0;\n    }\n    for (i = 0; i < len1; i++) {\n      if (s1[i] == s2[i]) {\n        cnt++;\n      }\n    }\n    y = 1.0 * cnt / len1;\n    if (y > x) {\n      r = 1;\n    } else {\n      r = 2;\n    }\n  }\n  if (t == 0) {\n    printf(\"error\");\n  } else if (t == 1 && r == 1) {\n    printf(\"yes\");\n  } else if (t == 1 && r == 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8392", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double x = 0, ratio = 0;\n  int i = 0, num = 0, l1 = 0, l2 = 0, temp = 1;\n  char sequen1[1000], sequen2[1000];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", sequen1);\n  scanf(\"%s\", sequen2);\n  l1 = strlen(sequen1);\n  l2 = strlen(sequen2);\n  if (l1 != l2) {\n    printf(\"error\");\n    temp = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((sequen1[i] != 'A' && sequen1[i] != 'T' && sequen1[i] != 'G' &&\n           sequen1[i] != 'C') ||\n          (sequen2[i] != 'A' && sequen2[i] != 'T' && sequen2[i] != 'G' &&\n           sequen2[i] != 'C')) {\n        printf(\"error\");\n        temp = 0;\n        break;\n      }\n    }\n  }\n  if (temp == 1) {\n    for (i = 0; i < l1; i++) {\n      if (sequen1[i] == sequen2[i]) {\n        num++;\n      }\n    }\n    ratio = 1.0 * num / l1;\n    if (ratio > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double z;\n  char sz1[500];\n  char sz2[500];\n  int i, m, n;\n  int x = 1, y = 0;\n  double e;\n  scanf(\"%lf\", &z);\n  scanf(\"%s\", sz1);\n  scanf(\"%s \", sz2);\n  m = strlen(sz1);\n  n = strlen(sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    if (sz1[i] == 'A' || sz1[i] == 'G' || sz1[i] == 'C' || sz1[i] == 'T') {\n      continue;\n    } else if (sz1[i] != 'A' || sz1[i] != 'G' || sz1[i] != 'C' ||\n               sz1[i] != 'T') {\n      x = 0;\n      break;\n    }\n  }\n  if ((m != n) || (x == 0)) {\n    printf(\"error\");\n  } else if (m == n && x == 1) {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if (sz1[i] == sz2[i]) {\n        y++;\n      }\n    }\n    e = 1.0 * y / m;\n    if (e > z) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s[100] = {0}, m, l = 0;\n  char a[256][256];\n  double c, d = 0, e = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a[1]);\n  scanf(\"%s\", a[0]);\n  if (strlen(a[1]) == strlen(a[0])) {\n    for (i = 0; a[0][i] != '\\0'; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' &&\n           a[1][i] != 'G')) {\n        cout << \"error\";\n        e = 0;\n        break;\n      } else {\n        d++;\n        if (a[0][i] == a[1][i]) {\n          e++;\n        }\n      }\n    }\n    if (d == strlen(a[0])) {\n      if (c < (e / d)) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8395", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[505], zfc2[505];\n  int i, j;\n  double k;\n  j = 0;\n  cin >> k;\n  scanf(\"%s\", zfc1);\n  cin >> zfc2;\n  if (strlen(zfc1) != strlen(zfc2)) {\n    printf(\"error\");\n    scanf(\"%s\", zfc1);\n    return 0;\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if ((zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'C' &&\n         zfc1[i] != 'G') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'C' &&\n         zfc2[i] != 'G')) {\n      printf(\"error\");\n      cin >> zfc1;\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == zfc2[i])\n      j++;\n  }\n  if (1.0 * j / strlen(zfc1) > k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  scanf(\"%s\", zfc1);\n  return 0;\n}\n"}
{"label": "5", "index": "8396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l1, l2, count = 0, o = 1;\n  double r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    o = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (1.0 * count / l1 > r && o == 1)\n      printf(\"yes\");\n    else if (o == 1)\n      printf(\"no\");\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "8397", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x = 0, ratio = 0;\n  int i = 0, num = 0, l1 = 0, l2 = 0, temp = 1;\n  char sequen1[1000], sequen2[1000];\n  scanf(\"%lf\", &x);\n  scanf(\"%s \", sequen1);\n  scanf(\"%s\", sequen2);\n  l1 = strlen(sequen1);\n  l2 = strlen(sequen2);\n  if (l1 != l2) {\n    printf(\"error\");\n    temp = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((sequen1[i] != 'A' && sequen1[i] != 'T' && sequen1[i] != 'G' &&\n           sequen1[i] != 'C') ||\n          (sequen2[i] != 'A' && sequen2[i] != 'T' && sequen2[i] != 'G' &&\n           sequen2[i] != 'C')) {\n        printf(\"error\");\n        temp = 0;\n        break;\n      }\n    }\n  }\n  if (temp == 1) {\n    for (i = 0; i < l1; i++) {\n      if (sequen1[i] == sequen2[i]) {\n        num++;\n      }\n    }\n    ratio = 1.0 * num / l1;\n    if (ratio > x)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[500], b[10000];\n\nint main() {\n  double xg;\n  scanf(\"%lf\", &xg);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i;\n  int x = 0;\n  int e = 0;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    if (e == 1) {\n    } else {\n      if ((x * 1.0) / (strlen(a)) > xg)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8399", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int sum = 0, i, lena, lenb, t = 0;\n  double n, bi;\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n\n  if (lena != lenb || t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    bi = (double)sum / lena;\n    if (bi > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, r;\n  int i, a, b, c, d, e = 0;\n  char q[501];\n  char w[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", q, w);\n  a = strlen(q);\n  b = strlen(w);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    c = a, d = b;\n    for (i = 0; i < a; i++) {\n      if (q[i] != 'A' && q[i] != 'C' && q[i] != 'G' && q[i] != 'T') {\n        c--;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (w[i] != 'A' && w[i] != 'C' && w[i] != 'G' && w[i] != 'T')\n        d--;\n    }\n    if (a != c || b != d) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < a; i++) {\n        if (q[i] == w[i]) {\n          e++;\n        }\n      }\n      r = 1.0 * e / a;\n      if (r >= n)\n        printf(\"yes\");\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int r, t, n, q, e, i;\n  double m, w;\n  n = 0;\n  r = 0;\n  scanf(\"%lf %s %s\", &m, a, b);\n  q = strlen(a);\n  e = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      r++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      r++;\n    }\n  }\n  if (q != e || r != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      t = a[i] - b[i];\n      if (t == 0) {\n        n++;\n      }\n    }\n    w = 1.0 * n / q;\n    if (w > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8402", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int la, lb, i, d;\n  double t, tt;\n  char a[505], b[505];\n  scanf(\"%lf\", &t);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  d = -1;\n  if (la == lb) {\n    d = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] == b[i]) {\n        d++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        d = -1;\n        break;\n      }\n    }\n  }\n  if (d < 0)\n    printf(\"error\");\n  else {\n    tt = d * 1.000 / la;\n    if (tt > t)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, j, n = 0, sum = 0, t = 0;\n  float k, c;\n  char a[500], b[500];\n  scanf(\"%f\", &k);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    t = 1;\n  }\n\n  if (t == 0) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (t == 0) {\n        if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (j = 0; b[j] != '\\0'; j++) {\n      if (t == 0) {\n        if (b[j] != 65 && b[j] != 71 && b[j] != 67 && b[j] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (l = 0; a[l] != '\\0'; l++) {\n      sum++;\n      if (a[l] == b[l])\n        n++;\n    }\n    c = (float)n / sum;\n    if (c > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char y[501], s[501];\n  double h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", y);\n  scanf(\"%s\", s);\n  int len = strlen(y), i, sum = 0, l = strlen(s);\n  if (len != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len; i++) {\n    if ((y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    } else if (y[i] == s[i])\n      sum++;\n  }\n  double p = (double)sum / len;\n  if (p > h) {\n    printf(\"yes\");\n    return 0;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500] = {'0'}, b[500] = {'0'};\n  double n, flag = 0;\n  int i, j, k, check;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  int la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    cout << \"error\\n\";\n    return 0;\n  }\n  for (i = 0; i < la; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[i])\n      flag++;\n  }\n  flag = (double)flag / la;\n  if (flag > n)\n    printf(\"yes\\n\");\n  if (flag <= n)\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "5", "index": "8406", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, x, y, s = 0;\n  char a[501], b[501];\n  double m, o;\n  cin >> m;\n  scanf(\"\\n%s\", a);\n  scanf(\"\\n%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i])\n        s = s + 1;\n    }\n    o = 1.0 * s / x;\n    if (o > m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, max, s, f;\n  float a, b;\n  char ch1[600], ch2[600];\n\n  scanf(\"%f\", &a);\n  scanf(\"%s\", ch1);\n  scanf(\"%s\", ch2);\n  m = strlen(ch1);\n  n = strlen(ch2);\n\n  f = 1;\n  if (m != n)\n    f = 0;\n  max = 0;\n\n  if (f)\n    for (i = 0; i < m; i++) {\n      if (((ch1[i] == 'A') || (ch1[i] == 'T') || (ch1[i] == 'C') ||\n           (ch1[i] == 'G')) &&\n          ((ch2[i] == 'A') || (ch2[i] == 'T') || (ch2[i] == 'C') ||\n           (ch2[i] == 'G'))) {\n        if (ch1[i] == ch2[i])\n          max++;\n      } else {\n        f = 0;\n        break;\n      }\n    }\n\n  if (f) {\n    b = (float)max / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i, sum = 0;\n  char a[505], b[505];\n  double n, m;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    goto k;\n  }\n  for (i = 0; i < x; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto k;\n    } else {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n  }\n  m = (1.0 * sum) / x;\n  if (m > n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\nk:\n  return 0;\n  return 0;\n}\n"}
{"label": "5", "index": "8409", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  float n;\n  char a[501] = {'\u0000'}, b[501] = {'\u0000'};\n  int i, sum = 0, m = 0;\n  scanf(\"%f\", &n);\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') {\n          if (a[i] == b[i])\n            sum++;\n        }\n      } else {\n        printf(\"error \");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (((float)sum / strlen(a)) > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double e;\n  char zf[2][501], count = 0, c, w = 0;\n  scanf(\"%lf%c\", &e, &c);\n\n  scanf(\"%s \", zf);\n\n  cin >> zf[1];\n  int a = strlen(zf[0]), b = strlen(zf[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int m = 0; m < a; m++) {\n      for (int o = 0; o < 2; o++) {\n        if (zf[o][m] != 'A' && zf[o][m] != 'T' && zf[o][m] != 'G' &&\n            zf[o][m] != 'C') {\n          w++;\n        }\n      }\n    }\n    if (w != 0) {\n      printf(\"error\");\n    } else {\n      for (int i = 0; i < a; i++) {\n        if (zf[0][i] == zf[1][i]) {\n          count++;\n        }\n      }\n      if (1.0 * count / a > e) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8411", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, q = 1;\n  double s = 0.0, len, res, req;\n  char a[1000], b[1000];\n  cin >> req;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n      q = 0;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      q = 0;\n  }\n  if (q == 0)\n    printf(\"error\\n\");\n  else if (q != 0) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    res = s / len * 1.0;\n    if (req < res)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m, c = 0, d;\n  int i, k, a, b, s = 0;\n  char s1[550], s2[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", s1, s2);\n  a = strlen(s1);\n  b = strlen(s2);\n  if (a != b) {\n    printf(\"error\\n\");\n  }\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        s++;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        s++;\n      }\n    }\n    if (s == 0) {\n      for (i = 0; i < a; i++) {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n      d = c / a;\n      if (d >= m) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n    if (s != 0) {\n      printf(\"error\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8413", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double j, n;\n  int i, l, k, p = 0, u, h = 0;\n  char a[2][501];\n  scanf(\"%lf \", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l = strlen(a[0]);\n  k = strlen(a[1]);\n  if (l != k) {\n    printf(\"error\");\n  } else {\n    for (u = 0; u < l; u++) {\n      if ((a[0][u] != 'A') && (a[0][u] != 'T') && (a[0][u] != 'G') &&\n          (a[0][u] != 'C') && (a[1][u] != 'A') && (a[1][u] != 'T') &&\n          (a[1][u] != 'G') && (a[1][u] != 'C')) {\n        p++;\n      } else {\n        if (a[0][u] == a[1][u]) {\n          h++;\n        }\n      }\n    }\n    if (p != 0) {\n      printf(\"error\");\n    } else {\n      j = 1.0 * h / l;\n      if (j > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100];\n  int changdu1, changdu2, i, js = 0;\n  double rate, rate1;\n  cin >> rate >> s1 >> s2;\n  changdu1 = strlen(s1);\n  changdu2 = strlen(s2);\n  if (changdu1 != changdu2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < changdu1; i++) {\n      if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') ||\n          (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C')) {\n        js = 1;\n        break;\n      }\n    }\n    if (js == 1)\n      printf(\"error\");\n    else {\n      for (i = 0; i < changdu1; i++) {\n        if (s1[i] == s2[i])\n          js++;\n      }\n      rate1 = 1.0 * js / changdu1;\n      if (rate1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int m, n, i, j = 0, k = 0;\n  double x, e;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        k = 1;\n        break;\n      }\n    }\n    if (k != 1) {\n      for (i = 0; i < m; i++) {\n        if (a[i] == b[i]) {\n          j += 1;\n        }\n      }\n      e = j * 1.0 / m;\n      if (e > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint judge(char c)\n\n{\n\n  return (!(c == 'A' || c == 'T' || c == 'C' || c == 'G'));\n}\n\nint main()\n\n{\n\n  double n;\n\n  int icount = 0;\n\n  int flag = 0;\n\n  char s[600], t[600];\n\n  cin >> n >> s >> t;\n\n  int len1 = strlen(s), len2 = strlen(t);\n\n  if (len1 != len2)\n\n    cout << \"error\\n\";\n\n  else\n\n  {\n\n    for (int i = 0; i < len1; ++i)\n\n    {\n\n      if (s[i] == t[i])\n        icount++;\n\n      if (judge(s[i]) || judge(t[i])) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag)\n\n      printf(\"error\\n\");\n\n    else\n\n    {\n\n      if (1.0 * icount / len1 >= n)\n        printf(\"yes\\n\");\n\n      else\n        printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8417", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, summ;\n  double bl, sjbl, s, sum;\n  s = 0;\n  cin >> bl;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  sum = strlen(a);\n  summ = strlen(b);\n  if (sum != summ) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < sum; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n  }\n  sjbl = s / sum;\n  if (sjbl > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, n = 0;\n  double e;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &e, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i])\n        n++;\n    }\n  }\n  if (1.0 * n / l1 > e) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, s = 0, j = 1;\n  double r;\n  char d1[501], d2[501];\n  cin >> r >> d1 >> d2;\n  if (strlen(d1) != strlen(d2)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] != 'A' && d1[i] != 'C' && d1[i] != 'G' && d1[i] != 'T' &&\n          d2[i] != 'A' && d2[i] != 'G' && d2[i] != 'C' && d2[i] != 'T') {\n        j = 0;\n        printf(\"error\");\n        break;\n      } else if (d1[i] == d2[i]) {\n        s++;\n      }\n    }\n    if (j == 1) {\n      if (1.0 * s / strlen(d1) > r) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[1000 + 1], s2[1000 + 1];\n  double w, m;\n  int l1, l2;\n  int i, j;\n  int c = 0;\n  scanf(\"%lf \", &w);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G' ||\n            s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == l1) {\n      for (j = 0; s1[j]; j++) {\n        if (s1[j] == s2[j]) {\n          c++;\n        }\n      }\n      m = (double)c / l1;\n      if (m > w) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], d[501];\n  int n, m, i, p = 0, q;\n  scanf(\"%lf\\n%s\\n%s\\n\", &a, s, d);\n  n = strlen(s);\n  m = strlen(d);\n  if (n != m) {\n    printf(\"error\");\n  } else if (n == m) {\n    for (i = 0; i < n - 1; i++) {\n      if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n        q = 0;\n        break;\n      } else if (s[i] == d[i]) {\n        p++;\n      } else if (s[i] != d[i]) {\n        p = p + 0;\n      }\n    }\n    b = 1.0 * p / (n - 1);\n    if (b > a && q != 0)\n      printf(\"yes\");\n    else if (b < a && q != 0) {\n      printf(\"no\");\n    } else if (q == 0) {\n      cout << \"error\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l1, l0, js = 0;\n  double jg, bl;\n  char a[2][501];\n\n  scanf(\"%lf\", &bl);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l0 = strlen(a[0]);\n  l1 = strlen(a[1]);\n  if (l1 != l0) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < l1; i++) {\n      if ((a[j][i] != 'A') && (a[j][i] != 'T') && (a[j][i] != 'C') &&\n          (a[j][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[0][i] == a[1][i]) {\n      js++;\n    }\n  }\n  jg = 1.0 * js / l1;\n  if (jg > bl) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501] = {'\\0'}, b[501] = {'\\0'};\n  double n;\n  scanf(\"%lf \", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    cout << \"error\";\n  } else {\n    int count = 0, so = 0;\n    double rate;\n    for (int i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        count++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        so = 100;\n        break;\n      }\n    }\n    if (so != 100) {\n      rate = count * 1.0 / x;\n      if (rate > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, i, sum = 0;\n  char a[505], b[505];\n  double n, m;\n  cin >> n;\n  cin >> a >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    goto k;\n  }\n  for (i = 0; i < x; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto k;\n    } else {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n  }\n  m = (1.0 * sum) / x;\n  if (m > n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\nk:\n  return 0;\n}\n"}
{"label": "5", "index": "8425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint h(char s[1000]) {\n  int i;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'T' && s[i] != 'C') {\n      i = 1;\n      break;\n    }\n  }\n  if (i != 1) {\n    i = 0;\n  }\n  return i;\n}\nint main() {\n  double c, d, e;\n  int j;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else if (h(a) || h(b)) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == b[j]) {\n        e++;\n      }\n    }\n    d = e / strlen(a);\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, c, d, e = 0, t = 0;\n  double n, m;\n  char a[501], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n  if (t > 0) {\n    printf(\"error\");\n  } else if (t == 0) {\n    if (c == d) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i])\n          e++;\n      }\n      m = e * 1.0 / c;\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8427", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, len, lena;\n  double r, ra;\n  char z[200];\n  char x[200];\n  cin >> r;\n  cin >> z;\n  scanf(\"%s\", x);\n  len = strlen(z);\n  lena = strlen(x);\n  d = 0;\n  for (a = 0; a <= len - 1; a++) {\n    if (len != lena)\n      d = 1;\n    if ((z[a] != 'A') && (z[a] != 'T') && (z[a] != 'C') && (z[a] != 'G'))\n      d = 1;\n    if ((x[a] != 'A') && (x[a] != 'T') && (x[a] != 'C') && (x[a] != 'G'))\n      d = 1;\n  }\n  if (d == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  b = 0;\n  c = 0;\n  for (a = 0; a <= len - 1; a++) {\n    c++;\n    if (z[a] == x[a])\n      b++;\n  }\n  ra = b * 1.0 / c;\n  if (ra > r)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8428", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a;\n  int bar = 0;\n  scanf(\"%f\", &a);\n  char zfc[2][500];\n  scanf(\"%s\", zfc[0]);\n  cin >> zfc[1];\n  float count = 0.0;\n  if (strlen(zfc[0]) != strlen(zfc[1]))\n    printf(\"error\");\n  else {\n    float len = strlen(zfc[0]);\n    for (int i = 0; i < len; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        bar = 1;\n        break;\n      } else if (zfc[0][i] == zfc[1][i])\n        count += 1.0;\n    }\n    if (count / len >= a && bar == 0)\n      printf(\"yes\");\n    if (count / len < a && bar == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8429", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, count = 0, i;\n  double result, n;\n  scanf(\"%lf\", &n);\n  char a[500], b[500];\n  cin >> a >> b;\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < c; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        result = -1;\n        break;\n      } else {\n\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (result != -1) {\n\n      result = (double)count / c;\n      if (result > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n = 0;\n  char a[500], b[500], *pa, *pb;\n  cin >> m >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\\n\");\n  } else {\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if (*pa == *pb) {\n        n++;\n      }\n    }\n    n = n / strlen(a);\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if ((*pa != 'A' && *pa != 'T' && *pa != 'G' && *pa != 'C') ||\n          (*pb != 'A' && *pb != 'T' && *pb != 'G' && *pb != 'C')) {\n        printf(\"error\\n\");\n        break;\n      } else if (*(pa + 1) == '\\0' && n > m) {\n        printf(\"yes\\n\");\n      } else {\n        if (*(pa + 1) == '\\0' && n <= m) {\n          printf(\"no\\n\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m1, m2, i, t, d;\n  double a, b;\n  char dna1[501];\n  char dna2[501];\n  t = 0;\n  d = 0;\n  scanf(\"%lf\", &a);\n  getchar();\n  scanf(\"%s\", &dna1);\n  cin >> dna2;\n  m1 = strlen(dna1);\n  m2 = strlen(dna2);\n  if (m1 != m2) {\n    printf(\"error\");\n    d = 1;\n  } else {\n    for (i = 0; i < m1; i++) {\n      if (dna1[i] == dna2[i]) {\n        t = t + 1;\n      }\n    }\n  }\n  b = 1.000000 * t / m1;\n  if (d == 0) {\n    for (i = 0; i < m1; i++) {\n      if ((dna1[i] != 'A') && (dna1[i] != 'T') && (dna1[i] != 'C') &&\n          (dna1[i] != 'G')) {\n        cout << \"error\";\n        d = 1;\n        break;\n      }\n    }\n  }\n  if (d == 0) {\n    for (i = 0; i < m2; i++) {\n      if ((dna2[i] != 'A') && (dna2[i] != 'T') && (dna2[i] != 'C') &&\n          (dna2[i] != 'G')) {\n        printf(\"error\");\n      }\n    }\n  }\n  if ((m1 == m2) && (d == 0)) {\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8432", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n1, n2, l = 0;\n  double e, q = 0;\n  int i;\n  char a[501], b[501];\n\n  cin >> e;\n\n  cin >> a;\n\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    l++;\n  }\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n  if (l == 0) {\n    for (i = 0; i < n2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n    if ((q / n1) > e) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  char b[101];\n  char c[101];\n  scanf(\"%lf%s%s\", &a, b, c);\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  int n = strlen(b);\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'T' && c[i] != 'G' &&\n        c[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] == c[i]) {\n      count += 1;\n    }\n  }\n  double d;\n  d = 1.0 * count / n;\n  if (d > a) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[505], zfc2[505];\n  int i, j;\n  double k;\n  j = 0;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  if (strlen(zfc1) != strlen(zfc2)) {\n    cout << \"error\";\n    scanf(\"%s\", zfc1);\n    return 0;\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if ((zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'C' &&\n         zfc1[i] != 'G') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'C' &&\n         zfc2[i] != 'G')) {\n      printf(\"error\");\n      scanf(\"%s\", zfc1);\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == zfc2[i])\n      j++;\n  }\n  if (1.0 * j / strlen(zfc1) > k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  scanf(\"%s\", zfc1);\n  return 0;\n}\n"}
{"label": "5", "index": "8435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char k[501], h[501];\n  double c, d;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", k);\n  scanf(\"%s\", h);\n  int sum = 0;\n  int a;\n  a = strlen(k);\n  int b;\n  b = strlen(h);\n  if (a != b)\n    printf(\"error\");\n  else if (a == b) {\n    for (int i = 0; i < a; i++) {\n      if ((k[i] != 'A' && k[i] != 'T' && k[i] != 'C' && k[i] != 'G') ||\n          (h[i] != 'A' && h[i] != 'T' && h[i] != 'C' && h[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (k[i] == h[i])\n          sum++;\n      }\n    }\n    if (1.0 * sum / a > c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, q, i, flag = 1;\n  double m, c = 0, d = 0;\n  char a[10086], b[10086];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    flag = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n    d++;\n  }\n  if (flag == 0) {\n    cout << \"error\";\n  }\n  if (flag == 1) {\n    if (c / d >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double c, f = 0;\n  int d, e, i;\n  scanf(\"%lf\", &c);\n  char a[100], b[100];\n  scanf(\"%s%s\", &a, &b);\n  d = strlen(a);\n  e = strlen(b);\n  if (d != e)\n    cout << \"error\";\n  else {\n    for (i = 0; i < d; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n        ;\n      } else {\n        if (a[i] == b[i])\n          f++;\n      }\n    }\n    if (f / e >= c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int num = 0, pan = 1;\n  char s;\n  char s1[600], a1[600];\n\n  cin >> &s;\n  n = atof(&s);\n\n  cin >> s1;\n\n  cin >> a1;\n  for (int i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  for (int i = 0; i < strlen(a1); i++) {\n    if (a1[i] != 'A' && a1[i] != 'C' && a1[i] != 'G' && a1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  if (strlen(s1) != strlen(a1))\n    pan = 0;\n  else if (strlen(s1) == strlen(a1) && pan != 0) {\n    for (int i = 0; i < strlen(s1); i++) {\n      if (a1[i] == s1[i])\n        num++;\n    }\n    if (1.0 * num / strlen(s1) < n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  if (pan == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8439", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char asd[500], zxc[500];\n  int i;\n  double n;\n  cin >> n;\n  scanf(\"%s\", asd);\n  cin >> zxc;\n  int len1 = strlen(asd);\n  int len2 = strlen(zxc);\n  int a1 = 0;\n  int a2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (asd[i] != 'A' && asd[i] != 'C' && asd[i] != 'G' && asd[i] != 'T')\n      a1++;\n  }\n  for (i = 0; i < len2; i++) {\n    if (zxc[i] != 'A' && zxc[i] != 'C' && zxc[i] != 'G' && zxc[i] != 'T')\n      a2++;\n  }\n  if (a1 != 0 || a2 != 0 || len1 != len2)\n    printf(\"error\");\n  else {\n    int d = 0;\n    for (i = 0; i < len1; i++) {\n      if (asd[i] == zxc[i])\n        d++;\n    }\n    double result = 1.0 * d / len1;\n    if (result > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, bl;\n  int n1, n2, i, k = 0, sum = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  cin >> dna1 >> dna2;\n  n1 = strlen(dna1);\n  n2 = strlen(dna2);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n          dna1[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n          dna2[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna1[i] == dna2[i]) {\n        sum++;\n      }\n    }\n    if (k == 0) {\n      bl = (double)sum / n1;\n      if (bl > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double q, c;\n  int t, s, i, l1, l2;\n  char a[501], b[501];\n  scanf(\"%lf\", &q);\n  cin >> a >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    t = 0;\n    for (i = 0; i < l1; i++)\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        t = 1;\n        break;\n      }\n    if (t == 0) {\n      s = 0;\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s = s + 1;\n      c = 1.0 * s / l1;\n      if (c > q)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, k = 0;\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    t = strlen(a);\n    for (i = 0; i < t; i++) {\n      if (a[i] != 'T' && a[i] != 'G' && a[i] != 'C' && a[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (b[i] != 'T' && b[i] != 'G' && b[i] != 'C' && b[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (a[i] == b[i])\n        k++;\n\n      if (i == t - 1) {\n        if (1.0 * k / t >= rate) {\n          printf(\"yes\");\n        } else\n          printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf\", &r);\n  char zfc[500];\n  char jiyin[500];\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n  \n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  int flag, i, x = 0;\n  char d1[501], d2[501];\n  scanf(\"%s %s\", d1, d2);\n  for (i = 0; i < (strlen(d1) - 1) && i < (strlen(d2) - 1); i++) {\n    if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n        (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G'))\n      flag = 1;\n    else {\n      flag = 0;\n      break;\n    }\n  }\n  if (strlen(d1) != strlen(d2) || flag == 0) {\n    cout << \"error\";\n    return 0;\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] == d2[i])\n        x++;\n    }\n  }\n  if (1.0 * x / (strlen(d1) - 1) > k)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, k;\n  int i, j = 0;\n  int p, q;\n  scanf(\"%lf\", &n);\n  char sz[2][1000];\n  scanf(\"%s %s\", sz[0], sz[1]);\n  p = strlen(sz[0]);\n  q = strlen(sz[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < q; i++) {\n    if (sz[0][i] != 'A' && sz[0][i] != 'T' && sz[0][i] != 'C' &&\n        sz[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (sz[1][i] != 'A' && sz[1][i] != 'T' && sz[1][i] != 'C' &&\n        sz[1][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; sz[0][i] != '\\0'; i++) {\n    if (sz[0][i] == sz[1][i]) {\n      j++;\n    }\n  }\n  k = 1.0 * j / i;\n  if (k > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[600], b[600];\n  double n, x;\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int i, a1, b1, xiangtong = 0, zhengfou = 1, y = 0;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n    y = 1;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i])\n        xiangtong++;\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        zhengfou = 0;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        zhengfou = 0;\n    }\n  }\n  if (zhengfou == 0)\n    printf(\"error\");\n  else if (y != 1) {\n    x = xiangtong * 1.0 / a1;\n    if (x <= n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n;\n  int i, l, s = 0, q = 0;\n  char a[550], b[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    q = 1;\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      q = 1;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      q = 1;\n  }\n  if (q == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        s += 1;\n      }\n    }\n    n = 1.00 * s / l;\n    if (m < n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, sum = 0, flag = 0;\n  double m;\n  char zifu1[501], zifu2[501];\n  scanf(\"%lf\", &m);\n  scanf(\" \");\n\n  cin >> zifu1;\n\n  cin >> zifu2;\n  if (strlen(zifu1) == strlen(zifu2)) {\n    for (i = 0; i < 600; i++) {\n      if (zifu1[i] == '\u0000') {\n        break;\n      } else if ((zifu1[i] == 'A' || zifu1[i] == 'T' || zifu1[i] == 'C' ||\n                  zifu1[i] == 'G') &&\n                 (zifu2[i] == 'A' || zifu2[i] == 'T' || zifu2[i] == 'C' ||\n                  zifu2[i] == 'G')) {\n        if (zifu1[i] == zifu2[i]) {\n          sum++;\n        }\n      } else {\n        cout << \"error\";\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      if (1.0 * sum / strlen(zifu1) > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8449", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, i, a;\n  double w, n;\n  x = 0;\n  y = 0;\n  n = 0;\n  a = 0;\n  char sz[500], s[500];\n  cin >> w;\n  scanf(\"%s\", sz);\n  scanf(\"%s\", s);\n  for (i = 0; sz[i] != '\\0'; i++) {\n    x++;\n  }\n  for (i = 0; s[i] != '\\0'; i++) {\n    y++;\n  }\n  if (x != y) {\n    a = 1;\n  } else if (x == y) {\n    for (i = 0; sz[i] != '\\0'; i++) {\n      if (sz[i] == 'A' || sz[i] == 'C' || sz[i] == 'T' || sz[i] == 'G') {\n        if (sz[i] == s[i]) {\n          n = n + 1;\n        } else if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n          a = 1;\n        }\n      } else if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        a = 1;\n      }\n    }\n  }\n  if (a == 1) {\n    printf(\"error\");\n  } else if (a == 0) {\n    n = 1.0 * n / x;\n    if (n >= w) {\n      printf(\"yes\");\n    } else if (n < w) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i;\n  int num = 0;\n  double alike, n;\n  char jj1[500] = {0};\n  char jj2[500] = {0};\n  scanf(\"%lf\", &n);\n  cin >> jj1;\n  scanf(\"%s\", jj2);\n  int result1 = strlen(jj1);\n  int result2 = strlen(jj2);\n  if (result1 != result2) {\n    printf(\"error\");\n\n    return 0;\n  } else {\n    result2 = result1;\n    for (i = 0; i < result1; i++) {\n      if (((jj1[i] == 'A') || (jj1[i] == 'G') || (jj1[i] == 'C') ||\n           (jj1[i] == 'T')) &&\n          ((jj2[i] == 'A') || (jj2[i] == 'G') || (jj2[i] == 'C') ||\n           (jj2[i] == 'T'))) {\n        if (jj1[i] == jj2[i]) {\n          num += 1;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  alike = 1.0 * num / result1;\n  if (alike >= n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, j;\n  int n, m, b = 0, c = 1, i, q;\n  char s1[510], s2[510];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  n = strlen(s1);\n  m = strlen(s2);\n  if (n != m)\n    c = 0;\n  for (i = 0; i < n; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (q = 0; q < m; q++) {\n    if (s2[q] != 'A' && s2[q] != 'T' && s2[q] != 'C' && s2[q] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s1[i] == s2[i])\n      b++;\n  }\n  j = (double)b / n;\n  if (c == 1) {\n    if (j >= a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char first[1024];\n  char second[1024];\n  float rate = 0.0f;\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", first);\n  scanf(\"%s\", second);\n\n  int n1 = strlen(first);\n  int n2 = strlen(second);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] != 'A' && first[i] != 'T' && first[i] != 'C' &&\n        first[i] != 'G' && second[i] != 'A' && second[i] != 'T' &&\n        second[i] != 'C' && second[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  int same = 0;\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] == second[i])\n      same++;\n  }\n\n  float actual = (float)same / (float)n1;\n  if (actual >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, k = 0;\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    t = strlen(a);\n    for (i = 0; i < t; i++) {\n      if (a[i] != 'T' && a[i] != 'G' && a[i] != 'C' && a[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (b[i] != 'T' && b[i] != 'G' && b[i] != 'C' && b[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n      if (i == t - 1) {\n        if (1.0 * k / t >= rate) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, s;\n  char a[101], b[101];\n  j = 0;\n  scanf(\"%lf\", &x);\n  \n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  s = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      j++;\n      break;\n    }\n  }\n\n  if (n != m || j != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (b[i] == a[i]) {\n        s++;\n      }\n    }\n    s = s / n;\n    if (s > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, a, b, k;\n  k = 0;\n  a = 0;\n  b = 0;\n  double p;\n  char f[501], g[501];\n  scanf(\"%lf %s %s\", &p, f, g);\n  m = strlen(f);\n  n = strlen(g);\n  for (i = 0; i < m; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      a++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (g[i] != 'A' && g[i] != 'T' && g[i] != 'C' && g[i] != 'G') {\n      b++;\n    }\n  }\n  if (m != n || a != 0 || b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (f[i] == g[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / m > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8456", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, p = 0, c = 0, d = 0;\n  double k, t;\n  char a[501], b[501];\n  scanf(\"%lf \", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        c++;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        d++;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    t = 1.0 * p / n;\n    if (c == 0 && d == 0) {\n      if (t > k)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, count1 = 0, count = 0;\n  char lian1[501], lian2[501];\n  double bi, xiang;\n  scanf(\"%lf\", &bi);\n  scanf(\"%s\", lian1);\n  cin >> lian2;\n  for (i = 0; lian1[i] != '\\0'; i++)\n    count++;\n\n  for (i = 0; lian1[i] != '\\0'; i++) {\n    if (lian2[i] == lian1[i])\n      count1++;\n    if (lian1[i] != 'A' && lian1[i] != 'T' && lian1[i] != 'C' &&\n        lian1[i] != 'G') {\n      j = 1;\n      break;\n    }\n    if (lian2[i] != 'A' && lian2[i] != 'T' && lian2[i] != 'C' &&\n        lian2[i] != 'G') {\n      j = 1;\n      break;\n    }\n  }\n\n  if (j == 1)\n    printf(\"error\");\n  if (j == 0) {\n    xiang = count1 * 1.0 / count;\n\n    if (xiang > bi)\n      printf(\"yes\");\n    if (xiang <= bi)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len, sum = 0, e = 0;\n  float n;\n  scanf(\"%f\", &n);\n  char a[600], b[600];\n  cin >> a;\n  cin >> b;\n  len = strlen(a);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n      if (b[i] != 65 && b[i] != 71 && b[i] != 67 && b[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 0) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      if (sum * 1.0 / len > n) {\n        printf(\"yes\");\n      } else\n        cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, e1, e2, t;\n  t = 1;\n  k = 0;\n  double bl1, bl2;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bl1);\n  cin >> jy1 >> jy2;\n  e1 = strlen(jy1);\n  e2 = strlen(jy2);\n  if (e1 != e2) {\n    t = 0;\n  } else {\n    for (i = 0; i < e1; i++) {\n      if ((jy1[i] != 'A' && jy1[i] != 'T' && jy1[i] != 'C' && jy1[i] != 'G') ||\n          (jy2[i] != 'A' && jy2[i] != 'T' && jy2[i] != 'C' && jy2[i] != 'G')) {\n        t = 0;\n        break;\n      } else {\n        if (jy1[i] == jy2[i]) {\n          k = k + 1;\n        }\n      }\n    }\n  }\n  bl2 = 1.0 * k / e1;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (bl2 > bl1) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8460", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n, r;\n  int m = 0, i, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x = strlen(a);\n  int y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (!(((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') ||\n             (a[i] == 'G')) &&\n            ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') ||\n             (b[i] == 'G')))) {\n\n        s++;\n      }\n    }\n\n    if (s != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < x; i++) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n      r = 1.0 * m / x;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, len1, len2, m = 0, flag = 1;\n  char s[1000] = {\"\"}, t[1000] = {\"\"};\n  float p, q;\n  scanf(\"%f\", &p);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  len1 = strlen(s);\n  len2 = strlen(t);\n  if (len1 != len2) {\n    printf(\"error\");\n    flag = 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G')) {\n        printf(\"error\");\n        flag = 0;\n        break;\n      } else {\n        if (s[i] == t[i])\n          m++;\n      }\n    }\n  }\n  if (flag == 1) {\n    q = (float)m / len1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  float l1, l2;\n  float n, count = 0, result;\n  char x[505], y[505];\n  scanf(\"%f\", &n);\n  getchar();\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == y[i])\n      count++;\n  }\n  result = count / l1;\n  if (result > n)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, x = 0;\n  double p, y;\n  char a[500], b[500];\n  scanf(\"%lf \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    y = (double)x / m;\n    if (y > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "8464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, k = 0;\n  double m;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  j = strlen(a);\n  l = strlen(b);\n  if (j != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < j; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / j > m) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m, d;\n  int a, b, i, c;\n  char u[500], v[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", u);\n  scanf(\"%s\", v);\n  a = strlen(u);\n  b = strlen(v);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    c = 0;\n    for (i = 0; u[i] != '\\0'; i++) {\n      if (u[i] != 'A' && u[i] != 'T' && u[i] != 'G' && u[i] != 'C' &&\n          v[i] != 'A' && v[i] != 'T' && v[i] != 'G' && v[i] != 'C') {\n        printf(\"error\");\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0)\n\n    {\n      d = 0;\n      for (i = 0; u[i] != '\\0'; i++) {\n        if (u[i] == v[i])\n          d++;\n      }\n      m = d / (1.0 * (a - 1));\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, w = 0, i, o = 0;\n  double c, k;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    cout << \"error\";\n  } else if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o++;\n        break;\n      } else {\n        if (a[i] == b[i])\n          w++;\n      }\n    }\n    k = 1.0 * w / x;\n    if (o == 0) {\n      if (k > c)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, k = 0, p;\n  int i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\\n\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G' &&\n         s[i] != 'A') ||\n        (s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'A')) {\n      printf(\"error\");\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    p = 1.0 * k / strlen(s);\n    if (p > r)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8468", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l1, l2, i, count = 0;\n  double rate;\n  char str1[1000], str2[1000];\n  cin >> rate;\n  cin >> str1 >> str2;\n  l1 = strlen(str1);\n  l2 = strlen(str2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (str1[i] == str2[i]) {\n      count++;\n    }\n    if (((str1[i] != 'A') && (str1[i] != 'C') && (str1[i] != 'G') &&\n         (str1[i] != 'T')) ||\n        ((str2[i] != 'A') && (str2[i] != 'C') && (str2[i] != 'G') &&\n         (str2[i] != 'T'))) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.00 * count / l1) >= rate) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8469", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[5][600];\n  int i, p, q, sum = 0;\n  double n, flag;\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    cin >> zfc[i];\n  }\n  p = strlen(zfc[0]);\n  q = strlen(zfc[1]);\n  if (p != q) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; (zfc[0][i] != '\\0') && (zfc[1][i] != '\\0'); i++) {\n    if ((zfc[0][i] != 'A' && zfc[0][i] != 'G' && zfc[0][i] != 'C' &&\n         zfc[0][i] != 'T') ||\n        (zfc[1][i] != 'A' && zfc[1][i] != 'G' && zfc[1][i] != 'C' &&\n         zfc[1][i] != 'T')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (zfc[0][i] == zfc[1][i]) {\n      sum++;\n    }\n  }\n  flag = 1.0 * sum / p;\n  if (flag > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8470", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, time = 0;\n  double n, p, l, j, k, same = 0;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", &b);\n  j = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < j; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) &&\n        time == 0) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  if (j != k && time == 0) {\n    printf(\"error\");\n    time++;\n  }\n  if (time == 0) {\n    for (i = 0; i < j; i++) {\n      if (a[i] == b[i]) {\n        same++;\n      }\n    }\n    l = strlen(a);\n    p = same / l;\n    if (p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float x, y, k = 0;\n  int i, j;\n  char a[501], b[501];\n  scanf(\"%f\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i]; i++)\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  for (j = 0; b[j]; j++)\n    if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'G' || b[j] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  if (i != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; a[i]; i++)\n    if (a[i] == b[i])\n      k += 1;\n  y = k / j;\n  if (y > x)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8472", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len, ans = 0, len1;\n  double n;\n  char s[2][500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s \", s);\n  len1 = strlen(s[0]);\n  cin >> s[1];\n  len = strlen(s[1]);\n  if (len1 != len) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int j = 0; j < len1; j++) {\n    if (s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'G' && s[0][j] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (int k = 0; k < len; k++) {\n    if (s[1][k] != 'A' && s[1][k] != 'T' && s[1][k] != 'G' && s[1][k] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (len == len1) {\n    for (i = 0; i < len; i++) {\n      if (s[0][i] == s[1][i])\n        ans += 1;\n    }\n    if (ans * 1.0 / len > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, e = 0, k, m = 0;\n  double x, y;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i])\n      e++;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      m++;\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      m++;\n  }\n  y = e * 1.0 / n;\n  if (n == k && m == n + k) {\n    if (y >= x)\n      printf(\"yes\");\n    else if (y < x)\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m = 0;\n  float k = 0, n;\n  char a[502], b[502];\n  scanf(\"%f \", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < (strlen(a)); i++) {\n    if (strlen(a) != strlen(b)) {\n      m = 0;\n      break;\n    }\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      m++;\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      m = 0;\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"error\");\n  } else {\n    if ((k / (strlen(a) * 1.00)) > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf \", &a);\n  cin.get();\n  char b[501], c[501];\n  int i, j;\n  cin.getline(b, 501);\n  cin.getline(c, 501);\n  int flag = 0;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\" << endl;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    for (j = 0; c[j] != '\\0'; j++) {\n      if (c[j] != 'A' && c[j] != 'T' && c[j] != 'C' && c[j] != 'G') {\n        cout << \"error\" << endl;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 0) {\n    if (i != j) {\n      cout << \"error\" << endl;\n      flag = 1;\n    }\n  }\n  int t = 0;\n  if (flag == 0) {\n    for (i = 0; i < j; i++) {\n      if (b[i] == c[i])\n        t++;\n    }\n    double k = (double)t / j;\n    if (k > a)\n      cout << \"yes\" << endl;\n    else\n      cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s%s\", a, b);\n  int lena, lenb;\n  lena = strlen(a);\n  lenb = strlen(b);\n  int sum = 0;\n  int zq = 0;\n  if (lena == lenb) {\n    int i;\n\n    for (i = 0; i < lena; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n        if (a[i] == b[i]) {\n          sum++;\n        }\n        zq++;\n\n      } else {\n        cout << \"error\";\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  double r;\n  r = 1.0 * sum / lena;\n  if (zq == lena) {\n    if (r > rate) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8477", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, summ;\n  double bl, sjbl, s, sum;\n  s = 0;\n  scanf(\"%lf \", &bl);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  sum = strlen(a);\n  summ = strlen(b);\n  if (sum != summ) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < sum; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n  }\n  sjbl = s / sum;\n  if (sjbl > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8478", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double xgd, bz;\n  int l, i, count;\n  char dna1[110], dna2[110];\n  count = 0;\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", dna1);\n  scanf(\"%s \", dna2);\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if (!(dna1[i] == 'A' || dna1[i] == 'G' || dna1[i] == 'C' ||\n          dna1[i] == 'T') ||\n        !(dna2[i] == 'A' || dna2[i] == 'G' || dna2[i] == 'C' ||\n          dna2[i] == 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (dna1[i] == dna2[i])\n      count++;\n  }\n  xgd = 1.0 * count / l;\n  if (xgd >= bz)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(char x, char y);\nint main() {\n  double n;\n  char DNA1[502], DNA2[502];\n  int len1, len2;\n  cin >> n;\n  cin >> DNA1;\n  cin >> DNA2;\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  int i, m = 0;\n  int e;\n  int p = 0;\n  double result;\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      e = compare(DNA1[i], DNA2[i]);\n      if (e == 1) {\n        m++;\n      }\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'G' &&\n           DNA1[i] != 'C') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'G' &&\n           DNA2[i] != 'C')) {\n        printf(\"error\");\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      result = ((double)m / (double)len1);\n      if (result > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n\nint compare(char x, char y) {\n  if ((x == 'A' && y == 'A') || (x == 'T' && y == 'T') ||\n      (x == 'C' && y == 'C') || (x == 'G' && y == 'G')) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "8480", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, i;\n  double q, p, e = 0;\n  cin >> p;\n  char a[501], b[501];\n  cin >> a;\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (a[i] == b[i])\n        e++;\n    }\n    if (i == d) {\n      q = e / d;\n      if (q >= p)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA[2][501];\n  scanf(\"%s\", DNA[0]);\n  scanf(\"%s\", DNA[1]);\n  int t;\n  int i, j;\n  int number = 0;\n  t = strlen(DNA[0]);\n  int w;\n  w = strlen(DNA[1]);\n  if (t != w) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < t; i++) {\n    if (DNA[0][i] != 'A' && DNA[0][i] != 'T' && DNA[0][i] != 'C' &&\n        DNA[0][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[1][i] != 'A' && DNA[1][i] != 'T' && DNA[1][i] != 'C' &&\n        DNA[1][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[0][i] == DNA[1][i]) {\n      number++;\n    }\n  }\n  double r;\n  r = 1.00 * number / t;\n  if (r >= rate) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int i, j, t = 0, l1, l2, l, s1 = 0, s2 = 0;\n  double n, t1, t2;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n\n    printf(\"error\");\n\n  } else {\n    for (j = 0; a[j]; j++) {\n      if (!(a[j] == 'A' || a[j] == 'T' || a[j] == 'C' || a[j] == 'G')) {\n        printf(\"error\");\n        s1++;\n        break;\n      }\n    }\n    if (s1 == 0) {\n      for (j = 0; b[j]; j++) {\n        if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G')) {\n          printf(\"error\");\n          s2++;\n          break;\n        }\n      }\n    }\n    if (s1 == 0 && s2 == 0) {\n      for (i = 0; a[i]; i++) {\n        if (a[i] == b[i]) {\n          t++;\n        }\n      }\n      l = strlen(a);\n      t1 = l;\n      t2 = t;\n      if (t2 / t1 > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[501];\n  char s2[501];\n  double p, q;\n  int m, n, j, k = 0;\n  scanf(\"%lf\", &p);\n\n  cin >> s1 >> s2;\n  m = strlen(s1);\n  n = strlen(s2);\n  for (j = 0; s1[j], s2[j]; j++) {\n    if (!(s1[j] == 'A' || s1[j] == 'T' || s1[j] == 'G' || s1[j] == 'C') ||\n        !(s2[j] == 'A' || s2[j] == 'T' || s2[j] == 'G' || s2[j] == 'C') ||\n        m != n) {\n      k = m + 1;\n      break;\n    } else if (s1[j] == s2[j])\n      k++;\n  }\n  q = 1.0 * k / m;\n  if (k == m + 1)\n    printf(\"error\");\n  else if (q > p)\n    printf(\"yes\");\n  else if (q <= p)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, u = 0, t = 0;\n  double n;\n  char a[505], b[505];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  ;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    t = 0;\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        t += 1;\n        if (a[i] == b[i])\n          u += 1;\n\n      } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n                 (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        t = 0;\n    }\n  }\n  if (t == 0)\n    printf(\"error\");\n  else if (u * 1.0 / x >= n)\n    printf(\"yes\");\n  else if (u * 1.0 / x < n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, lena, lenb, i, c;\n  char yi[501], er[501];\n  double rate, a;\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", yi, er);\n  lena = strlen(yi);\n  lenb = strlen(er);\n  if (lenb != lena) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (yi[i] == 0) {\n        break;\n      } else if (yi[i] >= 'A' && yi[i] <= 'Z' && er[i] >= 'A' && er[i <= 'Z']) {\n        if (yi[i] == er[i])\n          sum++;\n        else {\n          continue;\n        }\n      } else {\n        c = 1;\n        cout << \"error\";\n        break;\n      }\n    }\n    rate = sum * 1.0 / lena;\n    if (c != 1) {\n      if (rate > a) {\n        printf(\"yes\");\n      } else if (rate <= a) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8486", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s1[1000 + 1], s2[1000 + 1];\n  double w, m;\n  int l1, l2;\n  int i, j;\n  int c = 0;\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G' ||\n            s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == l1) {\n      for (j = 0; s1[j]; j++) {\n        if (s1[j] == s2[j]) {\n          c++;\n        }\n      }\n      m = (double)c / l1;\n      if (m > w) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, la, lb;\n  double n, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    k = 2;\n  } else {\n    for (i = 0; i < la; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C')) {\n        k = 2;\n        break;\n      }\n    }\n    if (k != 2) {\n      for (i = 0; i < la; i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n      s = s / la;\n      if (s <= n) {\n        k = 1;\n      } else\n        k = 0;\n    }\n  }\n  if (k == 1)\n    printf(\"no\");\n  if (k == 0)\n    printf(\"yes\");\n  if (k == 2)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bl;\n  double xg;\n  int i, l, e, k, c;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &bl, &a, &b);\n  l = strlen(a);\n  k = strlen(b);\n  c = 0;\n  e = 0;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      c = 1;\n    }\n  }\n  if (l == k && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i])\n        e++;\n    }\n    xg = 1.0 * e / l;\n    if (xg > bl) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double x, y, o = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if ((a[i] == 65 || a[i] == 71 || a[i] == 67 || a[i] == 84) &&\n          (b[i] == 65 || b[i] == 71 || b[i] == 67 || b[i] == 84)) {\n        if (a[i] == b[i]) {\n          o++;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == m) {\n      y = o / n;\n      if (y >= x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, t = 0, r = 0;\n  double k, q;\n  char gen1[1000], gen2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", gen1);\n  scanf(\"%s\", gen2);\n  if (strlen(gen1) != strlen(gen2)) {\n    cout << \"error\\n\";\n  } else {\n    for (i = 0; i < strlen(gen1); i++) {\n      if (gen1[i] != 'A' && gen1[i] != 'C' && gen1[i] != 'G' && gen1[i] != 'T')\n        r++;\n    }\n    for (i = 0; i < strlen(gen2); i++) {\n      if (gen2[i] != 'A' && gen2[i] != 'C' && gen2[i] != 'G' && gen2[i] != 'T')\n        r++;\n    }\n    if (r > 0) {\n      printf(\"error\");\n      t = 0;\n    } else {\n      t = 1;\n    }\n    if (t == 1) {\n      for (i = 0; i < strlen(gen1) + 1; i++) {\n        if (gen1[i] == gen2[i]) {\n          p++;\n        }\n      }\n      q = 1.0 * p / (strlen(gen1));\n      if (q > k) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x, z = 0, n = 0, m = 0;\n  int y = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  for (i = 0; a[i]; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; b[i]; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    n++;\n  }\n  for (i = 0; b[i]; i++) {\n    m++;\n  }\n  if (m != n) {\n    y++;\n  }\n  if (y != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        z++;\n      }\n    }\n    if (z / n > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, d, e, count = 0, i;\n  double result, n;\n  scanf(\"%lf\", &n);\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < c; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        result = -1;\n        break;\n      } else {\n\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (result != -1) {\n\n      result = (double)count / c;\n      if (result > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a1, a2, sum;\n  double m, x;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  a1 = strlen(s1);\n  a2 = strlen(s2);\n  sum = 0;\n  if (a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        sum = -1;\n        break;\n      } else if (s1[i] == s2[i]) {\n        sum++;\n      }\n    }\n    if (sum == -1) {\n      printf(\"error\");\n    } else {\n      x = (double)sum / a1;\n      if (x > m)\n        printf(\"yes\");\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h, f;\n  double n, sum, k;\n  char sz[2][501];\n  cin >> n >> sz[0] >> sz[1];\n  sum = 0;\n  f = 1;\n  j = strlen(sz[0]);\n  h = strlen(sz[1]);\n  if (j != h) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if ((sz[0][i] == 'A' || sz[0][i] == 'T' || sz[0][i] == 'C' ||\n           sz[0][i] == 'G') &&\n          (sz[1][i] == 'A' || sz[1][i] == 'T' || sz[1][i] == 'C' ||\n           sz[1][i] == 'G')) {\n        if (sz[0][i] == sz[1][i])\n          sum += 1.0;\n      } else {\n        printf(\"error\\n\");\n        f = 0;\n        break;\n      }\n    }\n    if (f != 0) {\n      k = sum / (j * 1.0);\n      if (k >= n) {\n        printf(\"yes\\n\");\n      } else {\n        cout << \"no\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, s;\n  int i;\n  char a[501], b[501];\n  char c, d;\n  scanf(\"%lf%c%s%c%s\", &r, &c, a, &d, b);\n  s = 0;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s / strlen(a) >= r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, e = 0;\n  int i, d = 0, f, g;\n  char b[500], c[500];\n  scanf(\"%lf \", &a);\n\n  cin >> b;\n\n  cin >> c;\n  f = strlen(b);\n  g = strlen(c);\n  if (f != g) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < g; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] == c[i])\n      d++;\n  }\n  e = 1.0 * d / g;\n\n  if (e >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, a = 0, b = 0, t = 0, k = 0;\n  char s[501], str[501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", str);\n\n  for (i = 0; s[i]; i++) {\n    a++;\n  }\n  for (i = 0; str[i]; i++) {\n    b++;\n  }\n  if (a == b) {\n    for (i = 0; s[i]; i++) {\n      if ((s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') &&\n          (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T')) {\n        if (s[i] == str[i]) {\n          t++;\n        }\n      } else {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (t / a > n && k == 0) {\n      printf(\"yes\");\n    } else if (k == 0) {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a = 0, l = 0;\n  double m, n;\n  char zf[2][10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", zf[0]);\n  cin >> zf[1];\n  j = strlen(zf[0]);\n  k = strlen(zf[1]);\n  for (i = 0; zf[0][i] != '\\0' && zf[1][i] != '\\0'; i++) {\n    if ((zf[0][i] > 'a' && zf[0][i] < 'z') ||\n        (zf[1][i] > 'a' && zf[1][i] < 'z'))\n      l++;\n  }\n  if (j != k || l > 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; zf[0][i] != '\\0'; i++) {\n      if (zf[0][i] == zf[1][i]) {\n        a = a + 1;\n      }\n    }\n    n = 1.0 * a / j;\n    if (n >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8499", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint judge(char *a, char *b, double r) {\n  int n = strlen(a), m = strlen(b), i, s = 0;\n  if (n != m)\n    return 0;\n  for (i = 0; i < n; ++i) {\n    if (!strchr(\"ATCG\", a[i]) || !strchr(\"ATCG\", b[i]))\n      return 0;\n    if (a[i] == b[i])\n      ++s;\n  }\n  if (s / (double)n > r)\n    return 1;\n  else\n    return -1;\n}\n\nint main() {\n  char a[600], b[600];\n  double r;\n  int s;\n  scanf(\"%lf \", &r);\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n  s = judge(a, b, r);\n  if (s > 0)\n    puts(\"yes\");\n  else if (s < 0)\n    puts(\"no\");\n  else\n    puts(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[505], b[505];\n  int i, j, m, sum = 0, SUM = 0;\n  double e, n;\n\n  cin >> n;\n  scanf(\"%s%s\", &a, &b);\n\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        SUM++;\n      } else if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    if (SUM != 0) {\n      printf(\"error\");\n    } else {\n      m = strlen(a);\n      e = (double)sum / m;\n      if (e > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, count = 0, o = 1;\n  double r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &r);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    o = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        cout << \"error\";\n        o = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (1.0 * count / l1 > r && o == 1)\n      printf(\"yes\");\n    else if (o == 1)\n      printf(\"no\");\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "8502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  int flag, i, x = 0;\n  char d1[501], d2[501];\n  scanf(\"%s %s\", d1, d2);\n  for (i = 0; i < (strlen(d1) - 1) && i < (strlen(d2) - 1); i++) {\n    if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n        (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G'))\n      flag = 1;\n    else {\n      flag = 0;\n      break;\n    }\n  }\n  if (strlen(d1) != strlen(d2) || flag == 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] == d2[i])\n        x++;\n    }\n  }\n  if (1.0 * x / (strlen(d1) - 1) > k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int num, i;\n  int same = 0, judge = 1;\n  double standard, actual;\n  scanf(\"%lf\", &standard);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    num = strlen(a);\n    for (i = 0; i < num; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C'))) {\n        printf(\"error\");\n        judge = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          same++;\n        }\n      }\n    }\n    if (judge != 0) {\n      actual = 1.0 * same / num;\n      if (actual > standard) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t, k = 0;\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    t = strlen(a);\n    for (i = 0; i < t; i++) {\n      if (a[i] != 'T' && a[i] != 'G' && a[i] != 'C' && a[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (b[i] != 'T' && b[i] != 'G' && b[i] != 'C' && b[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (a[i] == b[i]) {\n        k++;\n      }\n      if (i == t - 1) {\n        if (1.0 * k / t >= rate) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8505", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0;\n  float n;\n  char a[600], b[600];\n  cin >> n;\n  cin >> a;\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G'))\n        t++;\n    }\n\n    if (t > 0)\n      cout << \"error\" << endl;\n    else {\n\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n\n      if ((float)s / strlen(a) > n)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, n;\n  float m, j = 0;\n  scanf(\"%f\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  if ((strlen(a)) != (strlen(b))) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G') ||\n        ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i])\n        j++;\n    }\n  }\n  if (j / n >= m)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar a[500], b[10000];\n\nint main() {\n  double xg;\n  scanf(\"%lf\", &xg);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i;\n  int x = 0;\n  int e = 0;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    if (e == 1) {\n    } else {\n      if ((x * 1.0) / (strlen(a)) > xg)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, k, l = 0;\n  k = 0;\n  double d;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k = 1;\n    printf(\"error\");\n  }\n  if (strlen(a) == strlen(b)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        l++;\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k = 1;\n        cout << \"error\";\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    if ((1.0 * l / strlen(a)) >= d)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, len1, len2, i, n, p = 0;\n  double x, y;\n  char a1[501], a2[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", a1, a2);\n  len1 = strlen(a1);\n  len2 = strlen(a2);\n  if (len1 != len2) {\n    p = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a1[i] != 'A' && a1[i] != 'T' && a1[i] != 'C' && a1[i] != 'G') ||\n          (a2[i] != 'A' && a2[i] != 'T' && a2[i] != 'C' && a2[i] != 'G')) {\n        p = 1;\n      }\n    }\n  }\n  if (p != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a1[i] == a2[i])\n        sum++;\n    }\n    y = 1.0 * sum / len1;\n    if (y <= x) {\n      printf(\"no\");\n    } else {\n      cout << \"yes\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double xgx, n;\n  scanf(\"%lf\", &xgx);\n  int i, j, k, l = 0, m = 0;\n  char jy1[10086], jy2[10086];\n  cin >> jy1;\n  scanf(\"%s\", jy2);\n  j = strlen(jy1);\n  k = strlen(jy2);\n  jy1[j] = '\\0';\n  jy2[k] = '\\0';\n  if (j != k) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if (((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n           (jy1[i] != 'G')) ||\n          ((jy2[i] != 'A') && (jy2[i] != 'T') && (jy2[i] != 'C') &&\n           (jy2[i] != 'G'))) {\n        l++;\n      }\n    }\n    if (l != 0) {\n      printf(\"error\\n\");\n    } else {\n      for (i = 0; i < j; i++) {\n        if (jy1[i] == jy2[i])\n          m++;\n      }\n      n = 1.0 * m / j;\n      if (n > xgx) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float x, y, k = 0;\n  int i, j;\n  char a[501], b[501];\n  scanf(\"%f\", &x);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i]; i++)\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  for (j = 0; b[j]; j++)\n    if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'G' || b[j] == 'C')) {\n      cout << \"error\\n\";\n      return 0;\n    }\n  if (i != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; a[i]; i++)\n    if (a[i] == b[i])\n      k += 1;\n  y = k / j;\n  if (y > x)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  double r;\n  char a[600], b[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (1.0 * s / strlen(a) > r) {\n    printf(\"yes\");\n  } else if (1.0 * s / strlen(a) < r) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, i, sum = 0;\n  char a[505], b[505];\n  double n, m;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    goto k;\n  }\n  for (i = 0; i < x; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto k;\n    } else {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n  }\n  m = (1.0 * sum) / x;\n  if (m > n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\nk:\n  return 0;\n}\n"}
{"label": "5", "index": "8514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int i, j, t = 0, l1, l2, l, s1 = 0, s2 = 0;\n  double n, t1, t2;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n\n    printf(\"error\");\n\n  } else {\n    for (j = 0; a[j]; j++) {\n      if (!(a[j] == 'A' || a[j] == 'T' || a[j] == 'C' || a[j] == 'G')) {\n        printf(\"error\");\n        s1++;\n        break;\n      }\n    }\n    if (s1 == 0) {\n      for (j = 0; b[j]; j++) {\n        if (!(b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G')) {\n          printf(\"error\");\n          s2++;\n          break;\n        }\n      }\n    }\n    if (s1 == 0 && s2 == 0) {\n      for (i = 0; a[i]; i++) {\n        if (a[i] == b[i]) {\n          t++;\n        }\n      }\n      l = strlen(a);\n      t1 = l;\n      t2 = t;\n      if (t2 / t1 > n)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c[2], e = 0;\n  char a[2][501];\n  double b;\n  scanf(\"%lf\", &b);\n  for (i = 0; i < 2; i++) {\n    cin >> a[i];\n  }\n  c[0] = strlen(a[0]);\n  c[1] = strlen(a[1]);\n  if (c[0] != c[1]) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < c[i] - 1; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'G' &&\n          a[i][j] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (j = 0; j < c[0]; j++) {\n    if (a[0][j] == a[1][j]) {\n      e++;\n    }\n  }\n  if (1.0 * e / c[0] > b) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "8516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, z = 1;\n  double n, q = 0, w;\n  char x[505], y[505];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b)\n    z = 0;\n  else {\n    for (i = 0; i < a; i++) {\n      if ((x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G') &&\n          (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G'))\n        z = 1;\n      else\n        z = 0;\n    }\n  }\n  if (z == 0)\n    printf(\"error\");\n  if (z != 0) {\n    for (i = 0; i < a; i++) {\n      if (x[i] == y[i])\n        q++;\n    }\n  }\n  if (z != 0) {\n    w = q / a;\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, n, L, t;\n  double q, p;\n  char a[501], b[501];\n  n = 0;\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  L = strlen(b);\n\n  if (l != L) {\n    printf(\"error\\n\");\n  } else {\n    t = 1;\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    if (t == 1) {\n      q = 1.0 * n / l;\n      if (q > p) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n    if (t == 0) {\n      printf(\"error\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8518", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, g = 0, j, e, k, flag = 1;\n  double n, m;\n  char s[2][502];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    cin >> s[i];\n  }\n  e = strlen(s[1]);\n  k = strlen(s[0]);\n  if (e != k) {\n    flag = 0;\n  }\n  if (flag == 1) {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; s[i][j]; j++) {\n        if ((s[i][j] != 'A') && (s[i][j] != 'G') && (s[i][j] != 'C') &&\n            (s[i][j] != 'T')) {\n          flag = 0;\n        }\n      }\n    }\n  }\n  for (j = 0; s[0][j]; j++) {\n    if (s[0][j] == s[1][j]) {\n      g++;\n    }\n  }\n  m = 1.0 * g / e;\n  if (flag == 1) {\n    if (m > n) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, b;\n  char sz[520], zfc[520];\n  double a, m;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", sz);\n  scanf(\"%s\\n\", zfc);\n  n = strlen(zfc);\n  k = 0;\n  b = 0;\n  if (strlen(sz) != n) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'G' && sz[i] != 'C') ||\n          (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'G' && zfc[i] != 'C')) {\n        printf(\"error\");\n        b = 1;\n        break;\n      } else {\n        if (sz[i] == zfc[i]) {\n          k++;\n        }\n      }\n    }\n  }\n  if (b == 0) {\n    m = 1.0 * k / n;\n    if (m > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char zzd[600];\n  char hzy[600];\n  int i;\n  int a;\n  double v;\n  a = 0;\n  double b;\n  int c;\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zzd);\n  cin >> hzy;\n  b = strlen(zzd);\n  for (i = 0; i < b; i++) {\n    if (zzd[i] != 'A' && zzd[i] != 'G' && zzd[i] != 'C' && zzd[i] != 'T') {\n      cout << \"error\";\n      c++;\n      break;\n    } else if (hzy[i] != 'A' && hzy[i] != 'G' && hzy[i] != 'C' &&\n               hzy[i] != 'T') {\n      printf(\"error\");\n      c++;\n      break;\n    } else if (zzd[i] == hzy[i]) {\n      a++;\n    }\n  }\n  if (c == 0) {\n    v = a / b;\n    if (v >= n)\n      printf(\"yes\");\n    else if (v < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8521", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char d[3][501];\n  double n, m, a, b, c, x;\n  x = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &d[1]);\n  cin >> d[2];\n  n = strlen(d[1]);\n  m = strlen(d[2]);\n  for (i = 0; i < n; i++) {\n    if ((d[1][i] != 'A' && d[1][i] != 'G' && d[1][i] != 'C' &&\n         d[1][i] != 'T') ||\n        (d[2][i] != 'A' && d[2][i] != 'G' && d[2][i] != 'C' &&\n         d[2][i] != 'T')) {\n      x++;\n    }\n  }\n  if (m != n || x > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (d[1][i] == d[2][i]) {\n        b++;\n      }\n    }\n    c = b / n;\n    if (c > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  float n;\n  char a[501] = {'\u0000'}, b[501] = {'\u0000'};\n  int i, sum = 0, m = 0;\n  scanf(\"%f\", &n);\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    cout << \"error \";\n  else {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') {\n          if (a[i] == b[i])\n            sum++;\n        }\n      } else {\n        printf(\"error \");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (((float)sum / strlen(a)) > n)\n        cout << \"yes \";\n      else\n        printf(\"no \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, count = 0;\n  double bl;\n  char a[508], b[508];\n  scanf(\"%lf\", &bl);\n  cin >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != 0; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != 0; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n  if ((1.0 * count / (strlen(a))) > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int x, y, i, p = 0;\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    q = n * x;\n    if (p > q)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int l1, l2;\n  cin >> a;\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  int i, k = 0, flag;\n  for (i = 0; i < l1; i++)\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      flag = 1;\n    }\n  for (i = 0; i < l1; i++)\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      flag = 1;\n    }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / l1 >= n) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[501], s2[502];\n  int l1, l2, i;\n  double std, aa;\n  scanf(\"%lf\\n\", &std);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  aa = -1;\n  if (l1 == l2) {\n    aa = 0;\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i])\n        aa++;\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n        aa = -1;\n        break;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'T' && s2[i] != 'G') {\n        aa = -1;\n        break;\n      }\n    }\n  }\n  if (aa == -1)\n    printf(\"error\");\n  else {\n    aa = aa / l1;\n    if (aa > std)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m = 0, s;\n  double n, x;\n  char one[500], two[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", one, two);\n  s = strlen(one);\n  if (strlen(one) != strlen(two))\n    printf(\"error\");\n  else {\n    for (i = 0; one[i] != '\\0'; i++) {\n      if ((one[i] != 'A' && one[i] != 'G' && one[i] != 'T' && one[i] != 'C') ||\n          (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G')) {\n        s = 0;\n      } else {\n        if (one[i] == two[i])\n          m++;\n      }\n    }\n    x = 1.0 * m / s;\n    if (s == 0)\n      printf(\"error\");\n    else if (x > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8528", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double w, sum = 0, p;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &w);\n  cin >> a;\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      } else {\n        if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n            (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G')) {\n          printf(\"error\\n\");\n          return 0;\n        }\n      }\n    }\n\n  } else if (x != y) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  while (x == y) {\n    p = sum / x;\n    if (p >= w) {\n      printf(\"yes\\n\");\n      break;\n    } else\n      printf(\"no\\n\");\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int l1, l2, n, i, j, k, num = 0, f = 0;\n  double s, p;\n  scanf(\"%lf\", &s);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    f = 1;\n    return 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        f = 1;\n        return 0;\n      }\n    }\n    for (i = 0; i < l2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    if (f == 0) {\n      for (i = 0; i < l1; i++) {\n        if (a[i] == b[i])\n          num++;\n      }\n    }\n    if (f == 0) {\n      p = (double)num / l1;\n      if (p > s)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, m;\n  double n;\n  m = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = strlen(a);\n  int q = strlen(b);\n  if (p == q) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if ((a[i]) == (b[i]))\n          m++;\n      }\n    }\n    if ((1.0 * m / (p * 1.0)) >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p, q;\n  int a, b, m = 0, brak = 0;\n  scanf(\"%lf\", &p);\n  char k[600], kk[600];\n  scanf(\"%s\", k);\n  scanf(\"%s\", kk);\n  a = strlen(k);\n  b = strlen(kk);\n  for (int h = 0;; h++) {\n    if (a != b) {\n      printf(\"error\");\n      break;\n    }\n    for (int c = 0; c < a; c++) {\n      if (!(k[c] == 'A' || k[c] == 'T' || k[c] == 'C' || k[c] == 'G')) {\n        brak++;\n      }\n      if (!(kk[c] == 'A' || kk[c] == 'T' || kk[c] == 'C' || kk[c] == 'G')) {\n        brak++;\n      }\n    }\n    if (brak != 0) {\n      printf(\"error\");\n      break;\n    }\n    for (int i = 0; i < a; i++) {\n      if (k[i] == kk[i]) {\n        m++;\n      }\n    }\n    q = m / (a * 1.0);\n    if (q >= p) {\n      printf(\"yes\");\n    }\n    if (q < p) {\n      cout << \"no\";\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, k = 0;\n  char a[500], b[500];\n  cin >> n >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    int p = 1;\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          k++;\n      } else {\n        p = 0;\n        cout << \"error\";\n        break;\n      }\n    }\n    if (p == 1) {\n      m = (double)k / strlen(a);\n      if (m > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0, l1, l2;\n  double n, m;\n  char a[256], b[256];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  cin >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G'))\n      s = s + 1;\n  }\n  if (s != 0 || l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    m = (double)t / l1;\n    if (m > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a;\n  int bar = 0;\n  scanf(\"%f\", &a);\n  char zfc[2][500];\n  scanf(\"%s\", zfc[0]);\n  scanf(\"%s\", zfc[1]);\n  float count = 0.0;\n  if (strlen(zfc[0]) != strlen(zfc[1]))\n    printf(\"error\");\n  else {\n    float len = strlen(zfc[0]);\n    for (int i = 0; i < len; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        bar = 1;\n        break;\n      } else if (zfc[0][i] == zfc[1][i])\n        count += 1.0;\n    }\n    if (count / len >= a && bar == 0)\n      printf(\"yes\");\n    if (count / len < a && bar == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, m, k = 0, p = 1;\n  double n;\n  char str[500], tw[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", str);\n  scanf(\"%s\", tw);\n  l = strlen(str);\n  m = strlen(tw);\n  if (l != m)\n    p = 0;\n  for (i = 0; i < l; i++)\n    if ((str[i] != 'A' && str[i] != 'T' && str[i] != 'C' && str[i] != 'G') ||\n        (tw[i] != 'A' && tw[i] != 'T' && tw[i] != 'C' && tw[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  if (p == 1) {\n    for (i = 0; i < l; i++)\n      if (str[i] == tw[i])\n        k++;\n    if (1.0 * k / l >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double link;\n  scanf(\"%lf\", &link);\n  char a[501], b[501];\n  scanf(\"%s%s\", a, b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  int i;\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  }\n  double same;\n  same = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i])\n      same = same + 1;\n  }\n  double hl;\n  hl = same / (c * 1.0000);\n  if (hl <= link) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 1, b = 1;\n  double n, p = 0.0, q;\n  char d1[500], d2[500];\n  scanf(\"%lf%s%s\", &n, d1, d2);\n\n  if (strlen(d1) != strlen(d2)) {\n    a = 0;\n  }\n  if (a == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G'))\n        b = 1;\n      else {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (a == 0 || b == 0) {\n    cout << \"error\";\n  }\n\n  if (a == 1 && b == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if (d1[i] == d2[i]) {\n        p += 1.0;\n      }\n    }\n    q = p / (strlen(d1));\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double std, s;\n  int i, n1, n2, t = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", &s1);\n  scanf(\"%s\", &s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  if (n1 != n2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] == s2[i])\n      t++;\n  }\n  s = (double)t / n1;\n  if (s > std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0;\n  double n;\n  char a[501], b[501];\n  cin >> n;\n\n  cin >> a;\n\n  cin >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        printf(\"error\");\n        break;\n      } else {\n        if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n          printf(\"error\");\n          break;\n        } else {\n          if (a[i] == b[i])\n            m++;\n        }\n      }\n      if (i == x - 1) {\n        if (1.0 * m / x > n) {\n          cout << \"yes\";\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, x;\n  char dna1[500], dna2[500];\n  int i, j = 0, l1, l2, c = 0;\n  scanf(\"%lf %s %s \", &a, dna1, dna2);\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  if (l1 != l2) {\n    cout << \"error\";\n    c = 1;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n          dna1[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      } else if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n                 dna2[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j = j + 1;\n      }\n    }\n    x = j * 1.0 / l1;\n    if (x > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j = 0;\n  double g, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &g);\n  scanf(\"%s\", a);\n  scanf(\"\\n\");\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        } else {\n          ;\n        }\n      } else {\n        j = -1;\n        printf(\"error\");\n        break;\n      }\n    }\n    t = 1.0 * j / n;\n    if (t > g) {\n      printf(\"yes\");\n    } else if (t <= g && j != -1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8542", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char z1[500], z2[500];\n  int l = 1;\n  double q, m;\n  scanf(\"%lf \", &m);\n  scanf(\"%s%s\", &z1, &z2);\n  if (strlen(z1) != strlen(z2)) {\n    printf(\"error\");\n    l = 0;\n  } else {\n    for (int i = 0; i < strlen(z1); i++) {\n      if ((z1[i] != 'A' && z1[i] != 'T' && z1[i] != 'G' && z1[i] != 'C') ||\n          (z2[i] != 'A' && z2[i] != 'T' && z2[i] != 'G' && z2[i] != 'C')) {\n        printf(\"error\");\n        l = 0;\n        break;\n      } else if (z1[i] == z2[i])\n        q++;\n    }\n  }\n  if (q / strlen(z1) > m && l == 1)\n    printf(\"yes\");\n  else if (l == 1)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double q;\n  scanf(\"%lf\", &q);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, m, n;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int c = 0;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n  }\n  double x;\n  x = (1.0 * c) / (1.0 * m);\n  if (x >= q) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, la, lb, x, i;\n  double r0, r1;\n  char a[505], b[505];\n  scanf(\"%lf\", &r0);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb)\n    printf(\"error\\n\");\n  else {\n    x = 1;\n    for (i = 0, m = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          m++;\n      }\n    }\n    r1 = 1.0 * m / la;\n    if (x == 1) {\n      if (r1 > r0)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double b;\n  int l1, l2, x = 0;\n  char d1[500], d2[500];\n  scanf(\"%lf%s%s\", &b, d1, d2);\n  l1 = strlen(d1);\n  l2 = strlen(d2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l1; i++) {\n    if (d1[i] != 'A' && d1[i] != 'T' && d1[i] != 'C' && d1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d2[i] != 'A' && d2[i] != 'T' && d2[i] != 'C' && d2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d1[i] == d2[i]) {\n      x++;\n    }\n  }\n  if (1.0 * x / l1 > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, t;\n  int i, k, u, z;\n  z = 0;\n  u = 0;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &r);\n  cin >> a;\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] == '\\0') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n  }\n  if (b[i] != '\\0' && z == 0) {\n    printf(\"error\");\n  } else if (z == 0) {\n    for (k = 0; k < i; k++) {\n      if (a[k] == b[k]) {\n        u = u + 1;\n      }\n    }\n    t = 1.0 * u / i;\n    if (t > r) {\n      printf(\"yes\");\n    }\n    if (t <= r)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8547", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar a[500], b[10000];\n\nint main() {\n  double xg;\n  scanf(\"%lf\", &xg);\n  scanf(\"%s\", a);\n  cin >> b;\n  int i;\n  int x = 0;\n  int e = 0;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        e = 1;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    if (e == 1) {\n    } else {\n      if ((x * 1.0) / (strlen(a)) > xg)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8548", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double xgl, e;\n  char a[501], b[501];\n  double cd1, cd2;\n  int i;\n  double js = 0;\n\n  cin >> xgl;\n  scanf(\"%s %s\", a, b);\n\n  cd1 = strlen(a);\n  cd2 = strlen(b);\n\n  if (cd1 != cd2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < cd1; i++) {\n    if ((a[i] == 'A' && b[i] == 'A') || (a[i] == 'T' && b[i] == 'T') ||\n        (a[i] == 'C' && b[i] == 'C') || (a[i] == 'G' && b[i] == 'G'))\n      js++;\n    else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n             (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  e = js / cd1;\n  if (e > xgl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8549", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, count = 0, o = 1;\n  double r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &r);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    o = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (1.0 * count / l1 > r && o == 1)\n      printf(\"yes\");\n    else if (o == 1)\n      printf(\"no\");\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "8550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double dz;\n  char xl1[500], xl2[500];\n  scanf(\"%lf\", &dz);\n  scanf(\"%s\\n%s\", xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  int e = 0;\n  if (len1 != len2) {\n    cout << \"error\";\n    e++;\n  }\n  int i;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'C' && xl1[i] != 'G') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'C' && xl2[i] != 'G'))\n        e++;\n    }\n    if (e != 0)\n      printf(\"error\");\n  }\n  int sum = 0;\n  if (e == 0) {\n    for (i = 0; i < len1; i++) {\n      if (xl1[i] == xl2[i])\n        sum++;\n    }\n    if (1.0 * sum / len1 > dz)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  scanf(\"%d\", &e);\n  return 0;\n}\n"}
{"label": "5", "index": "8551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j = 0;\n  double g, t;\n  char a[501], b[501];\n  cin >> g;\n  scanf(\"%s\", a);\n  cin;\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        } else {\n          ;\n        }\n      } else {\n        j = -1;\n        printf(\"error\");\n        break;\n      }\n    }\n    t = 1.0 * j / n;\n    if (t > g) {\n      printf(\"yes\");\n    } else if (t <= g && j != -1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, p = 0, c = 0, d = 0;\n  double k, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        c++;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        d++;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    t = 1.0 * p / n;\n    if (c == 0 && d == 0) {\n      if (t > k) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double p;\n  cin >> p;\n  char a[501], b[501];\n  scanf(\"%s \", a);\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    int len, i, sum = 0, w = 0;\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T'))\n        w += 1;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if (w == 0 && (1.0 * sum / len) > p) {\n      cout << \"yes\";\n    } else if (w == 0 && (1.0 * sum / len) <= p)\n      cout << \"no\";\n    else {\n      cout << \"error\";\n    }\n  }\n  return (0);\n}\n"}
{"label": "5", "index": "8554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int num = 0, pan = 1;\n  char s;\n  char s1[600], a1[600];\n\n  cin >> &s;\n  n = atof(&s);\n\n  cin >> s1;\n\n  cin >> a1;\n  for (int i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T')\n      pan = 0;\n  }\n  for (int i = 0; i < strlen(a1); i++) {\n    if (a1[i] != 'A' && a1[i] != 'C' && a1[i] != 'G' && a1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  if (strlen(s1) != strlen(a1))\n    pan = 0;\n  else if (strlen(s1) == strlen(a1) && pan != 0) {\n    for (int i = 0; i < strlen(s1); i++) {\n      if (a1[i] == s1[i])\n        num++;\n    }\n    if (1.0 * num / strlen(s1) < n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  if (pan == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len, sum = 0, e = 0;\n  float n;\n  scanf(\"%f\", &n);\n  char a[600], b[600];\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  len = strlen(a);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n      if (b[i] != 65 && b[i] != 71 && b[i] != 67 && b[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 0) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      if (sum * 1.0 / len > n) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, s;\n  int i;\n  char a[501], b[501];\n  char c, d;\n  scanf(\"%lf%c%s%c%s\", &r, &c, a, &d, b);\n  s = 0;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s / strlen(a) >= r) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8557", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  double a, b = 0, l, m, c = 0;\n  char x[1000], y[1000];\n  scanf(\"%lf %s %s\", &a, &x, &y);\n  l = strlen(x);\n  m = strlen(y);\n  for (i = 0; i < l; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  if (l == m && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (x[i] == y[i]) {\n        b++;\n      }\n    }\n    if (a < (b / l)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k;\n  double c, s;\n  char m, n;\n  char a[501];\n  char b[501];\n  s = 0.0;\n  scanf(\"%lf%c%s%c%s\", &c, &m, a, &n, b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n    return 0;\n  } else {\n    k = strlen(a);\n    for (i = 0; i < k; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s * 1.0 / strlen(a) >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, b;\n  scanf(\"%lf\", &n);\n  int i, m, a, o;\n  a = 0;\n  char ji[1000], yin[1000];\n  scanf(\"%s \", ji);\n  scanf(\"%s\", yin);\n  m = strlen(ji);\n  o = strlen(yin);\n  if (m != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if ((ji[i] != 'A' && ji[i] != 'C' && ji[i] != 'G' && ji[i] != 'T') ||\n        (yin[i] != 'A' && yin[i] != 'C' && yin[i] != 'G' && yin[i] != 'T')) {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (n >= 1) {\n    printf(\"no\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (ji[i] == yin[i]) {\n      a++;\n    }\n  }\n  b = 1.0 * a / 1.0 * m;\n  if (b >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int i, c;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i])\n          c++;\n      }\n    }\n    bl = 1.0 * c / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8561", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500] = {'0'}, b[500] = {'0'};\n  double n, flag = 0;\n  int i, j, k, check;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < la; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[i])\n      flag++;\n  }\n  flag = (double)flag / la;\n  if (flag > n)\n    printf(\"yes\\n\");\n  if (flag <= n)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, h, f;\n  double n, sum, k;\n  char sz[2][501];\n  scanf(\"%lf%s%s\", &n, sz[0], sz[1]);\n  sum = 0;\n  f = 1;\n  j = strlen(sz[0]);\n  h = strlen(sz[1]);\n  if (j != h) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if ((sz[0][i] == 'A' || sz[0][i] == 'T' || sz[0][i] == 'C' ||\n           sz[0][i] == 'G') &&\n          (sz[1][i] == 'A' || sz[1][i] == 'T' || sz[1][i] == 'C' ||\n           sz[1][i] == 'G')) {\n        if (sz[0][i] == sz[1][i])\n          sum += 1.0;\n      } else {\n        printf(\"error\\n\");\n        f = 0;\n        break;\n      }\n    }\n    if (f != 0) {\n      k = sum / (j * 1.0);\n      if (k >= n) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8563", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int i, c;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  c = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i])\n          c++;\n      }\n    }\n    bl = 1.0 * c / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, x;\n  int l, m, i, a = 0, t = 0;\n  char st1[501], st2[501];\n  scanf(\"%lf\", &k);\n  scanf(\" \");\n\n  cin >> st1;\n\n  cin >> st2;\n  l = strlen(st1);\n  m = strlen(st2);\n  if (l != m) {\n    t = 1;\n  } else {\n    for (i = 0; i < l - 1; i++) {\n      if ((st1[i] != 'A' && st1[i] != 'T' && st1[i] != 'C' && st1[i] != 'G') ||\n          (st2[i] != 'A' && st2[i] != 'T' && st2[i] != 'C' && st2[i] != 'G')) {\n        t = 1;\n        break;\n      } else if (st1[i] == st2[i]) {\n        a++;\n      }\n    }\n  }\n  x = 1.0 * a / (l - 1);\n  if (t == 1) {\n    printf(\"error\");\n  } else if (x <= k) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x[600], y[600];\n  int b = 0, i;\n  double a;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", x);\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 600; i++) {\n    if (x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == 0) {\n      break;\n    }\n    if (x[i] == y[i]) {\n      b++;\n    }\n  }\n  if ((1.0 * b / strlen(x)) >= a) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, f = 0, e = 0, i;\n  double a, h;\n  char d[3][502];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++)\n    scanf(\"%s\", d[i]);\n\n  b = strlen(d[0]);\n  c = strlen(d[1]);\n  if (b == c) {\n    for (f = 0; f < b; f++) {\n      if (d[0][f] == d[1][f]) {\n        e++;\n      }\n    }\n    for (f = 0; f < b; f++) {\n      if ((d[0][f] != 'A' && d[0][f] != 'G' && d[0][f] != 'C' &&\n           d[0][f] != 'T') ||\n          (d[1][f] != 'A' && d[1][f] != 'G' && d[1][f] != 'C' &&\n           d[1][f] != 'T')) {\n        break;\n      }\n    }\n    if (f == b) {\n      h = e * 1.0 / b;\n      if (h > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      cout << \"error\";\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int w = 0, g = 0;\n\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else if ((l <= n) && (g == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, f = 1;\n  char a[2][255];\n  double x, k, t = 0;\n  scanf(\"%lf\", &x);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  k = strlen(a[0]);\n  for (j = 0; j < k; j++) {\n    if ((a[0][j] != 'A' && a[0][j] != 'C' && a[0][j] != 'T' &&\n         a[0][j] != 'G') ||\n        (a[1][j] != 'A' && a[1][j] != 'T' && a[1][j] != 'C' &&\n         a[1][j] != 'G')) {\n      printf(\"error\");\n      f = 0;\n      break;\n    }\n    if (a[0][j] == a[1][j])\n      t++;\n  }\n  if (f == 1) {\n    if (t / k > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  double s;\n  int i;\n  int c = 0;\n  double z;\n  double q = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      c = 1;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      c = 1;\n    }\n  }\n  if (c == 1 || m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n\n    if (q / n >= s) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, sum = 0, i, k = 0;\n  float n;\n  char a[1000];\n  char b[1000];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    k = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n\n      else if (a[i] == b[i])\n        sum++;\n    }\n    if (k == 0) {\n      if (1.0 * sum / len1 > n)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, time = 0;\n  double p;\n  char a[501], b[501];\n  char c[5] = \"ATCG\";\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      time++;\n    }\n  }\n  if (p < (double)time / strlen(a) || p == (double)time / strlen(a)) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8572", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max = 0, n, i, count = 0, m, j, num[200], left, flag = 0;\n  char a[100], b[100];\n  double s;\n  scanf(\"%lf\", &s);\n  cin >> a;\n  scanf(\"%s\", &b);\n  if (strlen(a) == strlen(b)) {\n    n = strlen(a);\n  } else {\n    flag = 1;\n    printf(\"error\");\n  }\n  if (flag == 0) {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        flag = 1;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          count++;\n        }\n      }\n    }\n  }\n  if (flag == 0) {\n    if ((double)count / n > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8573", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double q;\n  scanf(\"%lf \", &q);\n  char a[1000], b[1000];\n  cin >> a;\n  scanf(\"%s\", b);\n  int i, m, n;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int c = 0;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n  }\n  double x;\n  x = (1.0 * c) / (1.0 * m);\n  if (x >= q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double y, a;\n  char q[501], h[501];\n  int n1, n2, i, c = 0, tag = 0;\n  scanf(\"%lf\", &y);\n  scanf(\"%s\", q);\n  scanf(\"%s\", h);\n  n1 = strlen(q);\n  n2 = strlen(h);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n\n    for (i = 0; i < n1; i++) {\n      if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n        cout << \"error\";\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (i = 0; i < n2; i++) {\n        if ((h[i] != 'A') && (h[i] != 'T') && (h[i] != 'C') && (h[i] != 'G')) {\n          printf(\"error\");\n          tag = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < n1; i++) {\n      if (q[i] == h[i]) {\n        c++;\n      }\n    }\n    a = 1.0 * c / n1;\n    if (tag == 0) {\n      if (a > y) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  double x, t = 0;\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s %s\", a, b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else {\n    n = strlen(a);\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          t++;\n      } else {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    if (t / n > x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8576", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, b, s = 0, j, a;\n  double r, R;\n  char gene[500], gene2[500];\n  scanf(\"%lf\", &r);\n  cin >> gene;\n  scanf(\"%s\", gene2);\n  b = strlen(gene2);\n  a = strlen(gene);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (gene[i] != 'A' && gene[i] != 'T' && gene[i] != 'C' && gene[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n        gene2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (gene[i] == gene2[i])\n      s++;\n  }\n  R = 1.000 * s / b;\n  if (R > r) {\n    printf(\"yes\");\n  } else if (R <= r) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m;\n  double c, d;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      break;\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (i < m) {\n    printf(\"error\");\n  } else if (i >= m) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        n += 1;\n      }\n    }\n    d = 1.0 * n / m;\n    if (d > c) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc1[500], zfc2[500];\n  int i, j, t, len1, len2;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", zfc1, zfc2);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; zfc1[i]; i++) {\n    if (len2 != len1 ||\n        (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' &&\n         zfc1[i] != 'C') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' &&\n         zfc2[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  t = 0;\n  for (j = 0; zfc1[j] != '\\0'; j++) {\n    if (zfc1[j] == zfc2[j]) {\n      t++;\n    }\n  }\n  if (1.0 * t / len1 > n) {\n    printf(\"yes\");\n    return 0;\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, j;\n  int i, o;\n  char a[500], b[500];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int l = strlen(a);\n  int p = strlen(b);\n  o = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      p += 500;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      p += 500;\n    }\n    if (a[i] == b[i])\n      o++;\n  }\n  if (l != p) {\n    printf(\"error\");\n  } else {\n    j = 1.0 * o / l;\n    if (j > k)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[500], b[500];\n  double x, y, k, n, m;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m == n && (a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T' ||\n                   b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] != 'T')) {\n      if (a[i] == b[i])\n        k = k + 1;\n\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  y = k / n;\n  if (y > x)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  int i;\n  scanf(\"%lf\", &n);\n  char sza[600], szb[600];\n  scanf(\"%s \", sza);\n  scanf(\"%s\", szb);\n  int a = 0;\n  int b = strlen(sza);\n  int c = strlen(szb);\n  for (i = 0; i < b; i++) {\n    if (sza[i] != 'A' && sza[i] != 'T' && sza[i] != 'C' && sza[i] != 'G') {\n      a = 1;\n    }\n    if (szb[i] != 'A' && szb[i] != 'T' && szb[i] != 'C' && szb[i] != 'G') {\n      a = 1;\n    }\n    if (b != c) {\n      a = 1;\n    }\n  }\n  double d = 0;\n  double e;\n  if (a == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (sza[i] == szb[i]) {\n        d++;\n      }\n    }\n    e = d / b;\n    if (e > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int x, y, i, p = 0;\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    q = n * x;\n    if (p > q)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, r1, r2, num = 0, index = 0;\n  double n;\n  char a[501], b[501];\n  cin >> n;\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  r1 = strlen(a);\n  r2 = strlen(b);\n  for (i = 0; i < r1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  for (i = 0; i < r2; i++) {\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  if (r1 != r2 || index == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < r1; i++) {\n      if (a[i] == b[i])\n        num++;\n    }\n    if ((num * 1.0 / r1) >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(char x, char y);\nint main() {\n  double n;\n  char DNA1[502], DNA2[502];\n  int len1, len2;\n  scanf(\"%lf\", &n);\n  cin >> DNA1;\n  scanf(\"%s\", DNA2);\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  int i, m = 0;\n  int e;\n  int p = 0;\n  double result;\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      e = compare(DNA1[i], DNA2[i]);\n      if (e == 1) {\n        m++;\n      }\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'G' &&\n           DNA1[i] != 'C') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'G' &&\n           DNA2[i] != 'C')) {\n        cout << \"error\";\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      result = ((double)m / (double)len1);\n      if (result > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n\nint compare(char x, char y) {\n  if ((x == 'A' && y == 'A') || (x == 'T' && y == 'T') ||\n      (x == 'C' && y == 'C') || (x == 'G' && y == 'G')) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "8585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char dna1[500], dna2[500];\n  double a;\n  int t = 0, i, flag = 0;\n  int len1, len2;\n  double b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  cin >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'G' ||\n           dna1[i] == 'C') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'G' ||\n           dna2[i] == 'C')) {\n        if (dna1[i] == dna2[i])\n          t++;\n        if (dna1[i] != dna2[i])\n          continue;\n      }\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n           dna1[i] != 'C') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n           dna2[i] != 'C')) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      b = (double)t / len1;\n      if (b > a)\n        printf(\"yes\");\n      if (b <= a)\n        printf(\"no\");\n    }\n  }\n  if (len1 != len2)\n    printf(\"error\");\n  if (flag == 1)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z = 0, len1, len2;\n  double n;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &n, a, b);\n\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        z = -1;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          z += 1;\n        }\n      }\n    }\n    if (z >= 0) {\n      if ((1.0 * z / len1) > n)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, h = 0;\n  char a[1000], b[1000];\n  int i, n, m;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i])\n          h++;\n      }\n    }\n    h = h * 1.0 / n;\n    if (h > k)\n      printf(\"yes\");\n    else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' &&\n             b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  int n1, n2, m = 0, c = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", s1, s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (int i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C' || s1[i] == 'T') &&\n        (s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C' || s2[i] == 'T')) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    } else\n      c = 1;\n  }\n  if (c == 1 || n1 != n2) {\n    printf(\"error\\n\");\n  } else {\n    b = m * 1.0 / n1;\n    if (a < b) {\n      printf(\"yes\\n\");\n    } else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  int N = 1;\n  char kk[100];\n\n  cin >> kk;\n  k = atof(kk);\n  char aa[10000];\n\n  cin >> aa;\n  char bb[10000];\n\n  cin >> bb;\n  int na, nb;\n  na = strlen(aa);\n  nb = strlen(bb);\n  int n = 0;\n  if (na != nb) {\n    N = 0;\n  } else {\n    for (int i = 0; i < na; i++) {\n      if (aa[i] == bb[i] &&\n          (aa[i] == 'A' || aa[i] == 'T' || aa[i] == 'C' || aa[i] == 'G')) {\n        n++;\n      } else if (aa[i] == 'a' || aa[i] == 't' || aa[i] == 'c' || aa[i] == 'g' ||\n                 bb[i] == 'a' || bb[i] == 't' || bb[i] == 'c' || bb[i] == 'g') {\n        N = 0;\n      }\n    }\n  }\n  if (N == 0)\n    printf(\"error\");\n  else {\n    double p;\n    p = 1.0 * n / na;\n    if (p > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int cout = 0, len = 0, flag = 0, b = 0;\n  double lv, a;\n  char slv[10], s[500], z[500];\n\n  cin >> slv;\n  lv = atoi(slv);\n\n  cin >> s;\n\n  cin >> z;\n  len = strlen(s);\n  if (strlen(s) == strlen(z)) {\n    for (int i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == z[i])\n        cout++;\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')\n        b = 1;\n      if (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')\n        b = 1;\n    }\n    a = cout * 1.0 / len;\n    flag++;\n  }\n  if (flag == 0 || b == 1)\n    printf(\"error\");\n  else {\n    if (a > lv)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, s, i;\n  double p, l;\n  scanf(\"%lf\", &p);\n  char m[500], n[500];\n  scanf(\"%s\", m);\n  scanf(\"%s\", n);\n  a = strlen(m);\n  b = strlen(n);\n  s = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G') ||\n          (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n        printf(\"error\");\n        s = 1;\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n    s = 1;\n  }\n  if (s == 0) {\n    for (i = 0; i < a; i++) {\n      if (m[i] == n[i]) {\n        s = s + 1;\n      }\n    }\n    l = s * 1.0 / a;\n    if (l > p) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[2][500];\n  int len[2], i, j, o, W, l;\n  double n, p;\n  W = 0;\n  l = 0;\n  scanf(\"%lf\", &n);\n  getchar();\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n    for (j = 0; j < len[i]; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'C' &&\n          a[i][j] != 'G') {\n        W++;\n      }\n    }\n  }\n  if (len[0] != len[1] || W != 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; j < len[0]; j++) {\n      if (a[0][j] == a[1][j]) {\n        l++;\n      }\n    }\n  }\n  p = 1.0 * l / len[0];\n  if (p > n) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  scanf(\"%d\", &o);\n  return 0;\n}\n"}
{"label": "5", "index": "8593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int i, j = 0, m, s, t;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"\\n\");\n  scanf(\"%s\", b);\n  m = strlen(a);\n  s = strlen(b);\n  if (m <= s) {\n    t = m;\n  } else {\n    t = s;\n  }\n  for (i = 0; i < t; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G' || m != s) {\n      printf(\"error\");\n      j = -1;\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n  }\n  c = 1.0 * j / m;\n  if (c > n) {\n    printf(\"yes\");\n  } else if (c <= n && c >= 0) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k;\n  double c, s;\n  char m, n;\n  char a[501];\n  char b[501];\n  s = 0.0;\n  scanf(\"%lf%c%s%c%s\", &c, &m, a, &n, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    k = strlen(a);\n    for (i = 0; i < k; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s * 1.0 / strlen(a) >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "8595", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  float l1, l2;\n  float n, count = 0, result;\n  char x[505], y[505];\n  scanf(\"%f\", &n);\n  getchar();\n  cin >> x;\n  scanf(\"%s\", y);\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == y[i]) {\n      count++;\n    }\n  }\n  result = count / l1;\n  if (result > n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double rate, result;\n  int p = 2, num = 0;\n  scanf(\"%lf\\n\", &rate);\n  char dna1[510], dna2[510];\n  scanf(\"%s\", dna1);\n  scanf(\"\\n\");\n  scanf(\"%s\", dna2);\n  for (int i = 0; i < strlen(dna1); i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G') ||\n        (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n         dna2[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    p = 0;\n  }\n\n  if (p == 2) {\n    for (int i = 0; i < strlen(dna1); i++) {\n      if (dna1[i] == dna2[i]) {\n        num++;\n      }\n    }\n    result = 1.0 * num / strlen(dna1);\n    if (result >= rate) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  if (p == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z, q;\n  char a[1][1000], b[1][1000];\n  int m, n, s = 0, i;\n  cin >> q;\n  cin >> a[0] >> b[0];\n  m = strlen(a[0]);\n  n = strlen(b[0]);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G' ||\n        b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[0][i] == b[0][i]) {\n      s++;\n    }\n  }\n  z = 1.0 * s / m;\n  if (z > q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, w, s;\n  float n, p, q, o;\n  char a[10000], b[10000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  cin >> b;\n  i = strlen(a);\n  j = strlen(b);\n  w = 0;\n  s = 0;\n  for (k = 0; a[k]; k++) {\n    if (a[k] != 'A' && a[k] != 'T' && a[k] != 'G' && a[k] != 'C') {\n      w++;\n    }\n  }\n  for (k = 0; b[k]; k++) {\n    if (b[k] != 'A' && b[k] != 'T' && b[k] != 'G' && b[k] != 'C') {\n      w++;\n    }\n  }\n  if ((i != j) || w != 0) {\n    printf(\"error\");\n  } else {\n    for (l = 0; a[l]; l++) {\n      if (a[l] == b[l]) {\n        s++;\n      }\n    }\n    p = i;\n    q = s;\n    o = q / p;\n    if (o > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, p;\n  double n, m = 0, b;\n  char d[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", d);\n  cin >> f;\n  l = strlen(d);\n  p = strlen(f);\n  if (l != p) {\n    cout << \"error\";\n\n    return 0;\n  }\n  for (i = 0; d[i]; i++) {\n    if (!(d[i] == 'A' || d[i] == 'T' || d[i] == 'G' || d[i] == 'C')) {\n      printf(\"error\");\n\n      return 0;\n    }\n  }\n  for (i = 0; f[i]; i++) {\n    if (!(f[i] == 'A' || f[i] == 'T' || f[i] == 'G' || f[i] == 'C')) {\n      printf(\"error\");\n\n      return 0;\n    }\n  }\n  for (i = 0; d[i]; i++) {\n    if (d[i] == f[i])\n      m++;\n  }\n  b = m / l;\n  if (b >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int i, j = 0, m, s, t;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  cin >> a;\n  scanf(\"\\n\");\n  scanf(\"%s\", b);\n  m = strlen(a);\n  s = strlen(b);\n  if (m <= s) {\n    t = m;\n  } else\n    t = s;\n\n  for (i = 0; i < t; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G' || m != s) {\n      printf(\"error\");\n      j = -1;\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n  }\n  c = 1.0 * j / m;\n  if (c > n) {\n    cout << \"yes\";\n  } else if (c <= n && c >= 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double x, z = 0, n = 0, m = 0;\n  int y = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  for (i = 0; a[i]; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; b[i]; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    n++;\n  }\n  for (i = 0; b[i]; i++) {\n    m++;\n  }\n  if (m != n) {\n    y++;\n  }\n  if (y != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        z++;\n      }\n    }\n    if (z / n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double d;\n  scanf(\"%lf\", &d);\n  char s[100];\n  char u[100];\n  scanf(\"%s %s\", s, u);\n  int f = 0;\n  int t = 0, i, r = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    t++;\n  }\n  for (i = 0; u[i] != '\\0'; i++) {\n    r++;\n  }\n  if (r != t) {\n    printf(\"error\\n\");\n    return 0;\n  } else {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else if (u[i] != 'A' && u[i] != 'T' && u[i] != 'C' && u[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else if (s[i] == u[i]) {\n        f++;\n      }\n    }\n    if (f * 1.0 / t >= d) {\n      printf(\"yes\\n\");\n      return 0;\n    } else {\n      printf(\"no\\n\");\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, d;\n  int j = 0, n, i, e = 0, m;\n  scanf(\"%lf%s%s\", &c, a, b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    e = 1;\n  else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  }\n  while (e == 0) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    d = 1.0 * j / n;\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n    e = 1;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 1, b = 1;\n  double n, p = 0.0, q;\n  char d1[500], d2[500];\n  scanf(\"%lf%s%s\", &n, d1, d2);\n\n  if (strlen(d1) != strlen(d2)) {\n    a = 0;\n  }\n  if (a == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        b = 1;\n      } else {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (a == 0 || b == 0) {\n    printf(\"error\");\n  }\n\n  if (a == 1 && b == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if (d1[i] == d2[i]) {\n        p += 1.0;\n      }\n    }\n    q = p / (strlen(d1));\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double z, r = 0;\n  int m, n, i, error = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &z);\n  scanf(\"%s\\n\", a);\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    error = error + 1;\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        error = error + 1;\n      } else if (!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        error = error + 1;\n      } else {\n        if (a[i] == 'A' && b[i] == 'A') {\n          r = r + 1;\n        }\n        if (b[i] == 'T' && a[i] == 'T') {\n          r = r + 1;\n        }\n        if (a[i] == 'G' && b[i] == 'G') {\n          r = r + 1;\n        }\n        if (a[i] == 'C' && b[i] == 'C') {\n          r = r + 1;\n        }\n      }\n    }\n    r = r / m;\n  }\n  if (error != 0) {\n    printf(\"error\");\n  } else if (r >= z) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, w;\n  int i, m, z = 0, e = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", a, b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i])\n      z++;\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  w = 1.0 * z / m;\n  if (e == 0) {\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  int N = 1;\n  char kk[100];\n\n  cin >> kk;\n  k = atof(kk);\n  char aa[10000];\n\n  cin >> aa;\n  char bb[10000];\n\n  cin >> bb;\n  int na, nb;\n  na = strlen(aa);\n  nb = strlen(bb);\n  int n = 0;\n  if (na != nb) {\n    N = 0;\n  } else {\n    for (int i = 0; i < na; i++) {\n      if (aa[i] == bb[i] &&\n          (aa[i] == 'A' || aa[i] == 'T' || aa[i] == 'C' || aa[i] == 'G')) {\n        n++;\n      } else if (aa[i] == 'a' || aa[i] == 't' || aa[i] == 'c' || aa[i] == 'g' ||\n                 bb[i] == 'a' || bb[i] == 't' || bb[i] == 'c' || bb[i] == 'g') {\n        N = 0;\n      }\n    }\n  }\n  if (N == 0) {\n    cout << \"error\";\n  } else {\n    double p;\n    p = 1.0 * n / na;\n    if (p > k) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8608", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], d[1000], tmp;\n  int i, m, n, j, mc;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s%s\", a, d);\n  m = strlen(a);\n  n = strlen(d);\n  if (m != n)\n    printf(\"error\");\n  else {\n    j = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        mc = 1;\n        break;\n      } else if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        mc = 1;\n        break;\n      } else {\n        mc = 0;\n      }\n      if (a[i] == d[i])\n        j++;\n    }\n    if (mc == 1)\n      printf(\"error\");\n    else if (j < (k * m))\n      printf(\"no\");\n    else if (j >= (k * m))\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, t;\n  int i, k, u, z;\n  z = 0;\n  u = 0;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] == '\\0') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n  }\n  if (b[i] != '\\0' && z == 0) {\n    printf(\"error\");\n  } else if (z == 0) {\n    for (k = 0; k < i; k++) {\n      if (a[k] == b[k]) {\n        u = u + 1;\n      }\n    }\n    t = 1.0 * u / i;\n    if (t > r) {\n      printf(\"yes\");\n    }\n    if (t <= r)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a1, a2, sum;\n  double m, x;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &m);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  a1 = strlen(s1);\n  a2 = strlen(s2);\n  sum = 0;\n  if (a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        sum = -1;\n        break;\n      } else if (s1[i] == s2[i]) {\n        sum++;\n      }\n    }\n    if (sum == -1) {\n      printf(\"error\");\n    } else {\n      x = (double)sum / a1;\n      if (x > m)\n        printf(\"yes\");\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8611", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  int i, len, e = 0, sum = 0, len2;\n  double bi, h;\n  cin >> bi >> a >> b;\n  len = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n         b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        len != len2) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  if (e == 0) {\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum++;\n    }\n\n    h = sum * 1.0 / len;\n    if (h >= bi) {\n      printf(\"yes\");\n    } else {\n      if (h < bi) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8612", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char y[501], s[501];\n  double h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", y);\n  scanf(\"%s\", s);\n  int len = strlen(y), i, sum = 0, l = strlen(s);\n  if (len != l) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < len; i++) {\n    if ((y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    } else if (y[i] == s[i]) {\n      sum++;\n    }\n  }\n  double p = (double)sum / len;\n  if (p > h) {\n    printf(\"yes\");\n    return 0;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char DNA[2][501];\n  scanf(\"%s\", DNA[0]);\n  scanf(\"%s\", DNA[1]);\n  int t;\n  int i, j;\n  int number = 0;\n  t = strlen(DNA[0]);\n  int w;\n  w = strlen(DNA[1]);\n  if (t != w) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < t; i++) {\n    if (DNA[0][i] != 'A' && DNA[0][i] != 'T' && DNA[0][i] != 'C' &&\n        DNA[0][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[1][i] != 'A' && DNA[1][i] != 'T' && DNA[1][i] != 'C' &&\n        DNA[1][i] != 'G') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (DNA[0][i] == DNA[1][i]) {\n      number++;\n    }\n  }\n  double r;\n  r = 1.00 * number / t;\n  if (r >= rate) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8614", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], c[10];\n  double n;\n  int sum = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s \", c);\n  cin >> a;\n  cin >> b;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto end;\n    }\n    if (a[i] == b[i])\n      sum++;\n  }\n  if (b[i] != '\u0000')\n    printf(\"error\");\n  else {\n    if ((double)sum / i > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\nend:;\n  return 0;\n}\n"}
{"label": "5", "index": "8615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, k, num = 0, flag = 0;\n  double l;\n  char a[501], b[501], s[10];\n\n  scanf(\"%s \", s);\n  k = atoi(s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      flag = 1;\n      break;\n    }\n  }\n  if ((n == m) && (flag == 0)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    l = (double)num / n;\n    if (l > k)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8616", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[2][510];\n  double a, e;\n  int b, d, f;\n  int s[2];\n  d = 0;\n  cin >> a;\n  for (b = 0; b < 2; b++) {\n    cin >> sz[b];\n    s[b] = strlen(sz[0]);\n    for (f = 0; f < s[b]; f++) {\n      if (sz[b][f] != 'A' && sz[b][f] != 'T' && sz[b][f] != 'G' &&\n          sz[b][f] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (s[0] != s[1]) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  for (b = 0; b < s[0]; b++) {\n    if (sz[0][b] == sz[1][b]) {\n      d++;\n    }\n  }\n  e = 1.0 * d / s[0];\n  if (e > a) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8617", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, p;\n  int i;\n  int k = 0, s = 0;\n  char zfc1[500], zfc2[500];\n  cin >> n;\n  cin >> zfc1;\n  cin >> zfc2;\n  int a = strlen(zfc1), b = strlen(zfc2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' ||\n           zfc1[i] == 'G') &&\n          (zfc2[i] == 'A' || zfc2[i] == 'T' || zfc2[i] == 'C' ||\n           zfc2[i] == 'G')) {\n        s++;\n      }\n      if (zfc1[i] == zfc2[i]) {\n        k++;\n      }\n    }\n    if (s == a) {\n      p = 1.0 * k / a;\n      if (p > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8618", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double bill;\n  scanf(\"%lf\", &bill);\n\n  char s1[500] = {0};\n  char s2[500] = {0};\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n\n  int lens1, lens2, flag;\n  flag = 0;\n  lens1 = strlen(s1);\n  lens2 = strlen(s2);\n  if (lens1 != lens2) {\n    printf(\"error\");\n    flag = 1;\n  }\n\n  int i;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] != 'A') {\n        if (s1[i] != 'T') {\n          if (s1[i] != 'C') {\n            if (s1[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (flag == 0) {\n    for (i = 0; i < lens2; i++) {\n      if (s2[i] != 'A') {\n        if (s2[i] != 'T') {\n          if (s2[i] != 'C') {\n            if (s2[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  double num, avg;\n  num = 0;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] == s2[i]) {\n        num++;\n      }\n    }\n    avg = num / (double)lens1;\n    if (avg > bill) {\n      printf(\"yes\");\n    }\n    if (avg <= bill) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, j;\n  int n, m, b = 0, c = 1, i, q;\n  char s1[510], s2[510];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  n = strlen(s1);\n  m = strlen(s2);\n  if (n != m)\n    c = 0;\n  for (i = 0; i < n; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (q = 0; q < m; q++) {\n    if (s2[q] != 'A' && s2[q] != 'T' && s2[q] != 'C' && s2[q] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s1[i] == s2[i])\n      b++;\n  }\n  j = (double)b / n;\n  if (c == 1) {\n    if (j >= a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8620", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, m, n, s = 0;\n  int i;\n  char a[501], b[501];\n  cin >> k;\n  scanf(\"%s\", a);\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) &&\n          ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T'))) {\n        if (a[i] == b[i]) {\n          s++;\n        } else {\n          s = s;\n        }\n      } else {\n        s = -1;\n        break;\n      }\n    }\n    s = s / m;\n    if (s < 0) {\n      printf(\"error\");\n    } else if (s >= 0 && s <= k) {\n      printf(\"no\");\n    } else\n      printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(char x) {\n  if (x == 'A' || x == 'T' || x == 'G' || x == 'C')\n    return 0;\n  else\n    return 1;\n}\nint main(int argc, char *argv[]) {\n  char a[501], b[501];\n  int x = 0, i, y = 1;\n  float p;\n  cin >> p;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 1; i <= strlen(a); i++)\n    if (f(a[i - 1]))\n      y = 0;\n  for (i = 1; i <= strlen(b); i++) {\n    if (f(b[i - 1]))\n      y = 0;\n  }\n  if (strlen(a) != strlen(b))\n    y = 0;\n  if (y == 0)\n    printf(\"error\");\n  else {\n    for (i = 1; i <= strlen(a); i++)\n      if (a[i - 1] == b[i - 1])\n        x++;\n    if (x > p * strlen(a))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8622", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, s;\n  double n, x;\n  char one[500], two[500];\n  scanf(\"%lf\", &n);\n  cin >> one >> two;\n  s = strlen(one);\n  if (strlen(one) != strlen(two))\n    printf(\"error\");\n  else {\n    for (i = 0; one[i] != '\\0'; i++) {\n      if ((one[i] != 'A' && one[i] != 'G' && one[i] != 'T' && one[i] != 'C') ||\n          (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G'))\n        s = 0;\n      else {\n        if (one[i] == two[i]) {\n          m++;\n        }\n      }\n    }\n    x = 1.0 * m / s;\n    if (s == 0)\n      printf(\"error\");\n    else if (x > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  char x[1000], y[1000];\n  scanf(\"%s %s\", x, y);\n  int l = strlen(x), k = 0, o = strlen(y);\n  if (l != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l; i++) {\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == y[i])\n      k++;\n  }\n  if (1.0 * k / l > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int cout = 0, len = 0, flag = 0, b = 0;\n  double lv, a;\n  char slv[10], s[500], z[500];\n\n  cin >> slv;\n  lv = atoi(slv);\n\n  cin >> s;\n\n  cin >> z;\n  len = strlen(s);\n  if (strlen(s) == strlen(z)) {\n    for (int i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == z[i])\n        cout++;\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')\n        b = 1;\n      if (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')\n        b = 1;\n    }\n    a = cout * 1.0 / len;\n    flag++;\n  }\n  if (flag == 0 || b == 1)\n    printf(\"error\");\n  else {\n    if (a > lv)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char f[501], t[501];\n  int i;\n  double j = 0, r = 0, s = 0;\n  double n;\n  scanf(\"%lf%s%s\", &n, f, t);\n  for (i = 0; f[i] != '\\0'; i++) {\n    j++;\n  }\n  for (i = 0; t[i] != '\\0'; i++) {\n    r++;\n  }\n  if (j != r) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] == t[i])\n      s++;\n  }\n  if (s / j > n) {\n    printf(\"yes\");\n  }\n  if (s / j <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8626", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, a, b;\n\n  double n = 0, r;\n\n  char x[500], y[500], z;\n\n  scanf(\"%lf %c \", &r, &z);\n\n  cin >> x;\n\n  a = strlen(x);\n\n  cin >> y;\n\n  b = strlen(y);\n\n  if (a != b) {\n\n    printf(\"error\");\n\n  }\n\n  else {\n\n    for (i = 0; i < a; i++) {\n\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n\n        printf(\"error\");\n\n        n = -1;\n        break;\n\n      }\n\n      else {\n\n        if (x[i] == y[i]) {\n\n          n++;\n        }\n      }\n    }\n    n = n / a;\n\n    if (n > r) {\n\n      printf(\"yes\");\n\n    }\n\n    else if (n >= 0) {\n\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8627", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int len1, len2, i, count = 0, error = 0;\n  double line;\n  char str1[600], str2[600];\n  cin >> line;\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error \");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' && str1[i] != 'T')\n      error++;\n    if (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' && str2[i] != 'T')\n      error++;\n\n    if (str1[i] != str2[i])\n      count++;\n  }\n  if (error)\n    printf(\"error \");\n  else {\n    if ((double)(len1 - count) / len1 > line)\n      printf(\"yes \");\n    else\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double a;\n  char zfc1[501], zfc2[501];\n  cin >> a;\n  cin >> zfc1;\n  scanf(\"%s\", zfc2);\n  x = strlen(zfc1);\n  y = strlen(zfc2);\n  int s = 0;\n  for (i = 0; i < x; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'G' && zfc1[i] != 'C' && zfc1[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  for (i = 0; i < y; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'G' && zfc2[i] != 'C' && zfc2[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  if (x != y || s == 1) {\n    cout << \"error\";\n  } else {\n    int t = 0;\n    for (i = 0; i < x; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        t++;\n      }\n    }\n    double s;\n    s = 1.0 * t / (1.0 * x);\n    if (s > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate, result;\n  int p = 2, num = 0;\n  scanf(\"%lf\\n\", &rate);\n  char dna1[510], dna2[510];\n  cin >> dna1;\n  cin;\n  scanf(\"%s\", dna2);\n  for (int i = 0; i < strlen(dna1); i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G') ||\n        (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n         dna2[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    p = 0;\n  }\n\n  if (p == 2) {\n    for (int i = 0; i < strlen(dna1); i++) {\n      if (dna1[i] == dna2[i]) {\n        num++;\n      }\n    }\n    result = 1.0 * num / strlen(dna1);\n    if (result >= rate) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  if (p == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100];\n  int changdu1, changdu2, i, js = 0;\n  double rate, rate1;\n  scanf(\"%lf%s%s\", &rate, s1, s2);\n  changdu1 = strlen(s1);\n  changdu2 = strlen(s2);\n  if (changdu1 != changdu2)\n    cout << \"error\";\n  else {\n    for (i = 0; i < changdu1; i++) {\n      if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') ||\n          (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C')) {\n        js = 1;\n        break;\n      }\n    }\n    if (js == 1)\n      cout << \"error\";\n    else {\n      for (i = 0; i < changdu1; i++) {\n        if (s1[i] == s2[i])\n          js++;\n      }\n      rate1 = 1.0 * js / changdu1;\n      if (rate1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n, m = 0;\n  char dna1[1000 + 1], dna2[1000 + 1];\n  int len1 = 0, len2 = 0, count = 0, i = 0;\n  cin >> n >> dna1 >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n\n  if (len1 != len2) {\n    cout << \"error\";\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n           dna1[i] != 'G') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n           dna2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (dna1[i] != dna2[i])\n        count++;\n    }\n\n    m = (double)count / len1;\n\n    if ((1 - m) >= n) {\n      printf(\"yes\");\n    }\n    if ((1 - m) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8632", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[501];\nchar b[501];\nint main() {\n  double n, d = 0;\n  int e = 0, i, k = 1, lena, lenb;\n  scanf(\"%lf \", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  lena = (int)strlen(a);\n  lenb = (int)strlen(b);\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n        lena != lenb) {\n      d = -1;\n      break;\n    } else if (a[i] == b[i]) {\n      e++;\n    }\n  }\n  if (d == 0) {\n    d = 1.0 * e / i;\n  }\n  if (d > n) {\n    printf(\"yes\");\n  }\n  if (d <= n && d >= 0) {\n    printf(\"no\");\n  }\n  if (d < 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, p;\n  double n, m = 0, b;\n  char d[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", d);\n  scanf(\"%s\", f);\n  l = strlen(d);\n  p = strlen(f);\n  if (l != p) {\n    cout << \"error\";\n\n    return 0;\n  }\n  for (i = 0; d[i]; i++) {\n    if (!(d[i] == 'A' || d[i] == 'T' || d[i] == 'G' || d[i] == 'C')) {\n      cout << \"error\";\n\n      return 0;\n    }\n  }\n  for (i = 0; f[i]; i++) {\n    if (!(f[i] == 'A' || f[i] == 'T' || f[i] == 'G' || f[i] == 'C')) {\n      cout << \"error\";\n\n      return 0;\n    }\n  }\n  for (i = 0; d[i]; i++) {\n    if (d[i] == f[i])\n      m++;\n  }\n  b = m / l;\n  if (b >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  int sum = 0, i, l1, l2, judge = 1;\n  char x[1001], y[1001];\n  scanf(\"%lf%s%s\", &a, x, y);\n  l1 = strlen(x), l2 = strlen(y);\n  if (l1 != l2)\n    judge = 0;\n  else\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'C' && x[i] != 'G' && x[i] != 'A' && x[i] != 'T')\n        judge = 0;\n      if (y[i] != 'C' && y[i] != 'G' && y[i] != 'A' && y[i] != 'T')\n        judge = 0;\n    }\n  if (judge == 1) {\n    for (i = 0; i < l1; i++)\n      if (x[i] == y[i])\n        sum++;\n    if (sum >= (int)(a * l1))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, g = 0, j, e, k, flag = 1;\n  double n, m;\n  char s[2][502];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  e = strlen(s[1]);\n  k = strlen(s[0]);\n  if (e != k) {\n    flag = 0;\n  }\n  if (flag == 1) {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; s[i][j]; j++) {\n        if ((s[i][j] != 'A') && (s[i][j] != 'G') && (s[i][j] != 'C') &&\n            (s[i][j] != 'T')) {\n          flag = 0;\n        }\n      }\n    }\n  }\n  for (j = 0; s[0][j]; j++) {\n    if (s[0][j] == s[1][j]) {\n      g++;\n    }\n  }\n  m = 1.0 * g / e;\n  if (flag == 1) {\n    if (m > n) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double f;\n  int i, p, s = 1;\n  char a[501], b[501];\n  scanf(\"%lf\\n%s\\n%s\\n\", &f, a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        p = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / (1.0 * len1) > f) && (p != 0))\n      printf(\"yes\");\n    else if ((1.0 * s / (1.0 * len1) <= f) && (p != 0)) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc1[500], zfc2[500];\n  int i, j, t, len1, len2;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", zfc1, zfc2);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; zfc1[i]; i++) {\n    if (len2 != len1 ||\n        (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' &&\n         zfc1[i] != 'C') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' &&\n         zfc2[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  t = 0;\n  for (j = 0; zfc1[j] != '\\0'; j++) {\n    if (zfc1[j] == zfc2[j]) {\n      t++;\n    }\n  }\n  if (1.0 * t / len1 > n) {\n    printf(\"yes\");\n    return 0;\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double k;\n  scanf(\"%lf \", &k);\n  char moban[500], hubu[500];\n  scanf(\"%s\", moban);\n  scanf(\"%s\", hubu);\n  int m, n;\n  m = strlen(moban);\n  n = strlen(hubu);\n  if (m != n)\n    printf(\"error\");\n  else {\n    int count = 0;\n    for (int i = 0; i < n; i++) {\n      if (moban[i] != 'A' && moban[i] != 'T' && moban[i] != 'C' &&\n          moban[i] != 'G')\n        count++;\n      if (hubu[i] != 'A' && hubu[i] != 'T' && hubu[i] != 'C' && hubu[i] != 'G')\n        count++;\n    }\n    if (count != 0)\n      printf(\"error\");\n    else {\n      int sum = 0;\n      for (int i = 0; i < n; i++) {\n        if (moban[i] == hubu[i])\n          sum++;\n      }\n      double result = (double)sum / n;\n      if (result > k)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char dna1[500], dna2[500];\n  double a;\n  int t = 0, i, flag = 0;\n  int len1, len2;\n  double b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if ((dna1[i] == 'A' || dna1[i] == 'T' || dna1[i] == 'G' ||\n           dna1[i] == 'C') &&\n          (dna2[i] == 'A' || dna2[i] == 'T' || dna2[i] == 'G' ||\n           dna2[i] == 'C')) {\n        if (dna1[i] == dna2[i])\n          t++;\n        if (dna1[i] != dna2[i])\n          continue;\n      }\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n           dna1[i] != 'C') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n           dna2[i] != 'C')) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      b = (double)t / len1;\n      if (b > a)\n        printf(\"yes\");\n      if (b <= a)\n        printf(\"no\");\n    }\n  }\n  if (len1 != len2)\n    printf(\"error\");\n  if (flag == 1) {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8640", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, x, y, s = 0;\n  char a[501], b[501];\n  double m, o;\n  cin >> m;\n  scanf(\"\\n%s\", a);\n  scanf(\"\\n%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        s = s + 1;\n      }\n    }\n    o = 1.0 * s / x;\n    if (o > m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8641", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, aver;\n  int n, i, j, k = 0, l = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  cin >> a;\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k++;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n        b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      k++;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      l++;\n    }\n  }\n  aver = 1.0 * l / strlen(a);\n  if (k != 0) {\n    printf(\"error\");\n  }\n  if (k == 0) {\n    if (aver > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  int total1, total2;\n  int i, same = 0;\n  char h1[10000];\n  char h2[10000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", h1);\n  cin >> h2;\n  total1 = (int)strlen(h1);\n  total2 = (int)strlen(h2);\n\n  if (total1 != total2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < total1; i++) {\n      if ((h1[i] == 'A' || h1[i] == 'T' || h1[i] == 'C' || h1[i] == 'G') &&\n          (h2[i] == 'A' || h2[i] == 'T' || h2[i] == 'C' || h2[i] == 'G')) {\n        if (h1[i] == h2[i]) {\n          same++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (((double)same / (double)total1) > k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double bz, sj;\n  int n1, n2, n, i, p;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", jy1);\n  scanf(\"%s \", jy2);\n  p = 0;\n  n1 = strlen(jy1);\n  n2 = strlen(jy2);\n  if (n1 == n2) {\n    n = n1;\n  } else {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((jy1[i] != 65 && jy1[i] != 84 && jy1[i] != 67 && jy1[i] != 71) ||\n        (jy2[i] != 65 && jy2[i] != 84 && jy2[i] != 67 && jy2[i] != 71)) {\n      cout << \"error\";\n      return 0;\n    } else {\n      if (jy1[i] == jy2[i]) {\n        p++;\n      } else {\n        p = p;\n      }\n    }\n  }\n  sj = 1.0 * p / n;\n  if (sj >= bz) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8644", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m1, m2, i, t, d;\n  double a, b;\n  char dna1[501];\n  char dna2[501];\n  t = 0;\n  d = 0;\n  scanf(\"%lf\", &a);\n  getchar();\n  scanf(\"%s\", &dna1);\n  scanf(\"%s\", &dna2);\n  m1 = strlen(dna1);\n  m2 = strlen(dna2);\n  if (m1 != m2) {\n    printf(\"error\");\n    d = 1;\n  } else {\n    for (i = 0; i < m1; i++) {\n      if (dna1[i] == dna2[i]) {\n        t = t + 1;\n      }\n    }\n  }\n  b = 1.000000 * t / m1;\n  if (d == 0) {\n    for (i = 0; i < m1; i++) {\n      if ((dna1[i] != 'A') && (dna1[i] != 'T') && (dna1[i] != 'C') &&\n          (dna1[i] != 'G')) {\n        printf(\"error\");\n        d = 1;\n        break;\n      }\n    }\n  }\n  if (d == 0) {\n    for (i = 0; i < m2; i++) {\n      if ((dna2[i] != 'A') && (dna2[i] != 'T') && (dna2[i] != 'C') &&\n          (dna2[i] != 'G')) {\n        printf(\"error\");\n      }\n    }\n  }\n  if ((m1 == m2) && (d == 0)) {\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, p;\n  int m, i, j, c = 0, q, d = 0, f = 0, k = 0;\n  char u[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", u[i]);\n  }\n\n  q = strlen(u[1]);\n  m = strlen(u[0]);\n  if (m != q) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] != 'A' && u[0][j] != 'T' && u[0][j] != 'C' && u[0][j] != 'G')\n      f++;\n  }\n  for (j = 0; j < q; j++) {\n    if (u[1][j] != 'A' && u[1][j] != 'T' && u[1][j] != 'C' && u[1][j] != 'G') {\n      f++;\n    }\n  }\n\n  if (f != 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] == u[1][j]) {\n      c++;\n    }\n  }\n\n  p = (1.0 * c) / m;\n  if (p >= n) {\n    printf(\"yes\");\n  }\n  if (p < n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8646", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double c, w = 0, n = 0;\n  char x[600], y[600];\n  cin >> c;\n  getchar();\n\n  cin >> x;\n\n  scanf(\"%s \", y);\n  if (strlen(x) == strlen(y)) {\n    for (int j = 0; j < strlen(x); j++) {\n      if ((x[j] != 'A' && x[j] != 'T' && x[j] != 'G' && x[j] != 'C') ||\n          (y[j] != 'A' && y[j] != 'T' && y[j] != 'G' && y[j] != 'C')) {\n        printf(\"error\");\n        n = 1;\n        break;\n      }\n      if (x[j] == y[j])\n        w++;\n    }\n  } else {\n    printf(\"error\");\n    n = 1;\n  }\n  if (n == 0) {\n    w = w / strlen(x);\n    if (c < w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8647", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, x;\n  char dna1[500], dna2[500];\n  int i, j = 0, l1, l2, c = 0;\n  cin >> a >> dna1 >> dna2;\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  if (l1 != l2) {\n    cout << \"error\";\n    c = 1;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n          dna1[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      } else if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n                 dna2[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j = j + 1;\n      }\n    }\n    x = j * 1.0 / l1;\n    if (x > a) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b = 0, i;\n  char a[100][100], e[210];\n  double n;\n\n  cin >> e;\n  n = atof(e);\n\n  cin >> a[0];\n\n  scanf(\"%s \", a);\n  int p = strlen(a[0]);\n  int q = strlen(a[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < p; i++) {\n      if (!(a[0][i] == 'A' || a[0][i] == 'T' || a[0][i] == 'G' ||\n            a[0][i] == 'C' && a[1][i] == 'A' || a[1][i] == 'T' ||\n\n            a[1][i] == 'G' || a[1][i] == 'C')) {\n        cout << \"error\";\n        return 0;\n      } else {\n        if (a[0][i] == a[1][i])\n          b++;\n      }\n    }\n  }\n  if (1.0 * b / p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[101];\n  char c[101];\n  cin >> a >> b >> c;\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  int n = strlen(b);\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'T' && c[i] != 'G' &&\n        c[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] == c[i]) {\n      count += 1;\n    }\n  }\n  double d;\n  d = 1.0 * count / n;\n  if (d > a) {\n    cout << \"yes\\n\";\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8650", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, b, d;\n  double n, e;\n  char s1[500], s2[500];\n  int c = 0;\n\n  scanf(\"%lf \", &n);\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n  b = strlen(s1);\n  d = strlen(s2);\n  for (i = 0; i < b; i++) {\n    if ((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') && (s1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < b; i++) {\n    if ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') && (s2[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  if (b == d) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] == s2[i]) {\n        c++;\n      }\n    }\n    e = 1.0 * c / b;\n    if (e >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b;\n  double xg;\n  char s1[501], s2[501];\n  scanf(\"%lf %s %s\", &xg, s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'T' || s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C') &&\n        (s2[i] == 'T' || s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C')) {\n      if (s1[i] == s2[i])\n        a++;\n\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = strlen(s1);\n  if (a * 1.0 / b > xg) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, n, l1, l2, f = 0, i;\n  double m, x;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &m, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++)\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        f = 1;\n\n    if (f == 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s++;\n      x = (double)s / l1;\n      if (x > m)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, p, f = 1;\n  double x, bl;\n  char a[502], b[502];\n  cin >> bl;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      f = 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      f = 0;\n    }\n  }\n  if (m != p || f == 0) {\n    printf(\"error\");\n  } else if (m == p && f == 1) {\n    int n = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    x = 1.0 * n / m;\n    if (x > bl) {\n      printf(\"yes\");\n    } else if (x <= bl) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, c, d, k = 0;\n  int i, e = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\\n%s\", &a, &b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else if (c == d) {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        e = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          k = k + 1;\n        }\n      }\n    }\n    if (e == 0) {\n      printf(\"error\");\n    } else if (k != 0 && (k / c) >= n) {\n      printf(\"yes\");\n    } else if (e == 1 && (k / c) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, m, n;\n  double d, k, r;\n  k = 0;\n  char p[1000], q[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", p);\n  scanf(\"%s\", q);\n  m = strlen(p);\n  n = strlen(q);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((p[i] != 'A' && p[i] != 'T' && p[i] != 'C' && p[i] != 'G') ||\n          (q[i] != 'A' && q[i] != 'T' && q[i] != 'C' && q[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (p[i] == q[i]) {\n          k++;\n        }\n      }\n    }\n    d = 1.0 * k / n;\n    if (d > r) {\n      printf(\"yes\");\n    } else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, i, x, y, e = 0;\n  double r;\n  char a[500], b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        e = e + 1;\n      } else {\n        if (a[i] == b[i]) {\n          s = s + 1;\n        }\n      }\n    }\n    if (e != 0) {\n      printf(\"error\");\n    } else {\n      if (1.0 * s / x > r) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x = 0, ratio = 0;\n  int i = 0, num = 0, l1 = 0, l2 = 0, temp = 1;\n  char sequen1[1000], sequen2[1000];\n  scanf(\"%lf\", &x);\n  cin >> sequen1;\n  scanf(\"%s\", sequen2);\n  l1 = strlen(sequen1);\n  l2 = strlen(sequen2);\n  if (l1 != l2) {\n    printf(\"error\");\n    temp = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((sequen1[i] != 'A' && sequen1[i] != 'T' && sequen1[i] != 'G' &&\n           sequen1[i] != 'C') ||\n          (sequen2[i] != 'A' && sequen2[i] != 'T' && sequen2[i] != 'G' &&\n           sequen2[i] != 'C')) {\n        printf(\"error\");\n        temp = 0;\n        break;\n      }\n    }\n  }\n  if (temp == 1) {\n    for (i = 0; i < l1; i++) {\n      if (sequen1[i] == sequen2[i]) {\n        num++;\n      }\n    }\n    ratio = 1.0 * num / l1;\n    if (ratio > x) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint judge(char c)\n\n{\n\n  return (!(c == 'A' || c == 'T' || c == 'C' || c == 'G'));\n}\n\nint main()\n\n{\n\n  double n;\n\n  int icount = 0;\n\n  int flag = 0;\n\n  char s[600], t[600];\n\n  scanf(\"%lf%s%s\", &n, s, t);\n\n  int len1 = strlen(s), len2 = strlen(t);\n\n  if (len1 != len2)\n\n    printf(\"error\\n\");\n\n  else\n\n  {\n\n    for (int i = 0; i < len1; ++i)\n\n    {\n\n      if (s[i] == t[i])\n        icount++;\n\n      if (judge(s[i]) || judge(t[i])) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag)\n\n      printf(\"error\\n\");\n\n    else\n\n    {\n\n      if (1.0 * icount / len1 >= n)\n        printf(\"yes\\n\");\n\n      else\n        printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w1[256], w2[256];\n  int n, m, i, j = 0, A = 1;\n  double a, c;\n  scanf(\"%lf%s%s\", &a, &w1, &w2);\n  n = strlen(w1);\n  m = strlen(w2);\n  if (n != m)\n    printf(\"error\");\n  if (n == m) {\n    for (i = 0; i < n; i++) {\n      if ((w1[i] == 'A' && w2[i] == 'A') || (w1[i] == 'G' && w2[i] == 'G') ||\n          (w2[i] == 'T' && w1[i] == 'T') || (w2[i] == 'C' && w1[i] == 'C'))\n        j++;\n      if ((w1[i] != 'A' && w1[i] != 'T' && w1[i] != 'G' && w1[i] != 'C') ||\n          (w2[i] != 'A' && w2[i] != 'T' && w2[i] != 'G' && w2[i] != 'C')) {\n        A = 0;\n      }\n    }\n    c = (double)j / n;\n    if (A == 0)\n      printf(\"error\");\n    else if (A == 1 && c > a) {\n      printf(\"yes\");\n    } else if (A == 1 && c <= a)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b;\n  double xg;\n  char s1[501], s2[501];\n  scanf(\"%lf %s %s\", &xg, s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'T' || s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C') &&\n        (s2[i] == 'T' || s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C')) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = strlen(s1);\n  if (a * 1.0 / b > xg) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf \", &rate);\n  char a[501], b[501];\n  cin >> a >> b;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  int i, sum = 0;\n  for (i = 0; i < len1; i++) {\n    switch (a[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n    switch (b[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n\n    if (a[i] == b[i])\n      sum++;\n  }\n\n  if ((double)sum / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8662", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double k, x;\n  int l, m, i, a = 0, t = 0;\n  char st1[501], st2[501];\n  cin >> k;\n  scanf(\" \");\n\n  cin >> st1;\n\n  scanf(\"%s \", st2);\n  l = strlen(st1);\n  m = strlen(st2);\n  if (l != m) {\n    t = 1;\n  } else {\n    for (i = 0; i < l - 1; i++) {\n      if ((st1[i] != 'A' && st1[i] != 'T' && st1[i] != 'C' && st1[i] != 'G') ||\n          (st2[i] != 'A' && st2[i] != 'T' && st2[i] != 'C' && st2[i] != 'G')) {\n        t = 1;\n        break;\n      } else if (st1[i] == st2[i]) {\n        a++;\n      }\n    }\n  }\n  x = 1.0 * a / (l - 1);\n  if (t == 1) {\n    printf(\"error\");\n  } else if (x <= k)\n    printf(\"no\");\n  else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8663", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[501], c[501];\n  cin >> a;\n  cin >> b;\n  scanf(\"%s\", c);\n  int i;\n  int t = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      t = 1;\n  }\n  for (i = 0; i < strlen(c); i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')\n      t = 1;\n  }\n  if (strlen(b) != strlen(c) || t == 1)\n    printf(\"error\");\n  else {\n\n    int i, sum = 0;\n    for (i = 0; i < strlen(b); i++) {\n      if (b[i] == c[i])\n        sum++;\n    }\n    double d;\n    int m;\n    m = strlen(b);\n    d = sum * 1.0 / m;\n    if (d > a) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8664", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char gene1[500];\n  char gene2[500];\n  int i;\n  int s = 0;\n  double r;\n  scanf(\"%lf\", &r);\n  cin >> gene1;\n  scanf(\"%s\", &gene2);\n  int len1 = strlen(gene1);\n  int len2 = strlen(gene2);\n  int fuhe = 1;\n  for (i = 0; i <= len1 - 1; i++) {\n    if ((gene1[i] != 'A' && gene1[i] != 'T' && gene1[i] != 'C' &&\n         gene1[i] != 'G') ||\n        (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n         gene2[i] != 'G')) {\n      fuhe = 0;\n    }\n  }\n  if (len1 != len2 || fuhe == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= len1 - 1; i++) {\n      if (gene1[i] == gene2[i]) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n    if (1.00 * s / len1 > r) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, p = 0;\n  float m, k, s = 0;\n  char zfc[2][500], n[10];\n\n  cin >> n;\n  m = atof(n);\n  for (i = 0; i < 2; i++) {\n\n    cin >> zfc[i];\n  }\n  a = strlen(zfc[0]);\n  b = strlen(zfc[1]);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; zfc[i][j] != '\u0000'; j++) {\n        if (zfc[i][j] != 'A' && zfc[i][j] != 'G' && zfc[i][j] != 'C' &&\n            zfc[i][j] != 'T') {\n          p = 1;\n        }\n      }\n    }\n    if (p == 0) {\n      for (i = 0; zfc[0][i] != '\u0000'; i++) {\n        if (zfc[0][i] == zfc[1][i]) {\n          s++;\n        }\n      }\n      k = s / (a * 1.0);\n      if (k > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar sen[100][500];\nint main() {\n  int n, m, temp1, temp2, i, j, a, b, k, c, d, e;\n\n  double f, g;\n  a = 0;\n  d = 0;\n  scanf(\"%lf\", &f);\n  scanf(\"%s%s\", sen[0], sen[1]);\n  for (i = 0; i < 2 && d == 0; i++) {\n    for (j = 0; j < strlen(sen[i]) && d == 0; j++) {\n\n      if (sen[i][j] != 'A' && sen[i][j] != 'T' && sen[i][j] != 'C' &&\n          sen[i][j] != 'G')\n        d = 1;\n    }\n  }\n  if (d == 0) {\n    if (strlen(sen[0]) == strlen(sen[1])) {\n      for (i = 0; i < strlen(sen[0]); i++) {\n        if (sen[0][i] == sen[1][i])\n          a++;\n      }\n      g = 1.0 * a / strlen(sen[0]);\n      if (g >= f)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else\n      printf(\"error\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8667", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, j;\n  int n, m, b = 0, c = 1, i, q;\n  char s1[510], s2[510];\n  scanf(\"%lf\", &a);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  n = strlen(s1);\n  m = strlen(s2);\n  if (n != m)\n    c = 0;\n  for (i = 0; i < n; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (q = 0; q < m; q++) {\n    if (s2[q] != 'A' && s2[q] != 'T' && s2[q] != 'C' && s2[q] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s1[i] == s2[i])\n      b++;\n  }\n  j = (double)b / n;\n  if (c == 1) {\n    if (j >= a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, x, y;\n  double n;\n  double count = 0.00;\n  char a[501];\n  char b[501];\n\n  scanf(\"%lf \", &n);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; a[i] != '\u0000', b[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n      break;\n    }\n\n    if (a[i] == b[i])\n      count++;\n  }\n\n  if (count / (x - 1) >= n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double n, j = 0, e = 0;\n  char s[501], a[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  len1 = strlen(s);\n  len2 = strlen(a);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n        (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if ((s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' ||\n         a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        s[i] == a[i])\n      j = j + 1;\n  }\n  e = j / len1;\n  if (e > n) {\n    printf(\"yes\");\n  } else if (e <= n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double w;\n  char s1[600], s2[600];\n  int l1, l2, i, a;\n  a = 0;\n  scanf(\"%lf\\n\", &w);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l1; i++) {\n      if (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    }\n    if ((1.0 * a) / l1 > w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, x, y, s = 0;\n  char a[501], b[501];\n  double m, o;\n  scanf(\"%lf\", &m);\n  scanf(\"\\n%s\", a);\n  scanf(\"\\n%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i])\n        s = s + 1;\n    }\n    o = 1.0 * s / x;\n    if (o > m)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, m, n, p;\n  int l, k, q, i;\n  char b[500], c[500];\n  k = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n%s\", b, c);\n  l = strlen(b);\n  q = strlen(c);\n  if (l != q) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (b[i] == c[i])\n      k++;\n  }\n  m = l;\n  n = k;\n  p = n / m;\n  if (p > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c = 0;\n  int i, j = 0, zs;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n  } else {\n    zs = strlen(s1);\n    for (i = 0; i < zs; i++) {\n      if (s1[i] == 'G' || s1[i] == 'A' || s1[i] == 'C' || s1[i] == 'T') {\n        j++;\n      }\n    }\n\n    if (j != zs) {\n      printf(\"error\");\n      return 0;\n    } else {\n      for (i = 0; i < zs; i++) {\n        if (s1[i] - s2[i] == 0) {\n          c = c + 1;\n        }\n      }\n      if (c / zs > n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, len1, len2, m = 0, flag = 1;\n  char s[1000] = {\"\"}, t[1000] = {\"\"};\n  float p, q;\n  scanf(\"%f\", &p);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  len1 = strlen(s);\n  len2 = strlen(t);\n  if (len1 != len2) {\n    printf(\"error\");\n    flag = 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G')) {\n        printf(\"error\");\n        flag = 0;\n        break;\n      } else {\n        if (s[i] == t[i])\n          m++;\n      }\n    }\n  }\n  if (flag == 1) {\n    q = (float)m / len1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8675", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double link;\n  cin >> link;\n  char a[501], b[501];\n  cin >> a >> b;\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  int i;\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  }\n  double same;\n  same = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i]) {\n      same = same + 1;\n    }\n  }\n  double hl;\n  hl = same / (c * 1.0000);\n  if (hl <= link) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, p;\n  int m, i, j, c = 0, q, f = 0;\n  char u[2][1000];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", u[i]);\n  }\n\n  q = strlen(u[1]);\n  m = strlen(u[0]);\n  if (m != q) {\n    cout << \"error\";\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] != 'A' && u[0][j] != 'T' && u[0][j] != 'C' && u[0][j] != 'G') {\n      f++;\n    }\n  }\n  for (j = 0; j < q; j++) {\n    if (u[1][j] != 'A' && u[1][j] != 'T' && u[1][j] != 'C' && u[1][j] != 'G') {\n      f++;\n    }\n  }\n\n  if (f != 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (j = 0; j < m; j++) {\n    if (u[0][j] == u[1][j]) {\n      c++;\n    }\n  }\n\n  p = (1.0 * c) / m;\n  if (p >= n) {\n    printf(\"yes\");\n  }\n  if (p < n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8677", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, n, m, t = 0, k = 0;\n  char x[501], y[501];\n  cin >> a;\n\n  cin >> x;\n\n  scanf(\"%s \", y);\n  n = strlen(x);\n  m = strlen(y);\n  if (n != m)\n    printf(\"error \");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'T' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'T' && y[i] != 'C')) {\n        k = 1;\n        printf(\"error \");\n        break;\n      } else if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (k != 1) {\n      if ((double)((double)t / (double)n) > a)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m;\n  scanf(\"%lf\", &m);\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  int ci = 0;\n  int pan = 0;\n  int aa = strlen(a), bb = strlen(b);\n  if (aa != bb) {\n    printf(\"error\");\n  } else {\n    int i;\n    for (i = 0; i < aa; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        pan = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        ci++;\n      }\n    }\n    double bi = (double)ci / aa;\n    if (pan == 0) {\n      if (bi >= m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[501];\nchar b[501];\nint main() {\n  double n, d = 0;\n  int e = 0, i, k = 1, lena, lenb;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  lena = (int)strlen(a);\n  lenb = (int)strlen(b);\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n        lena != lenb) {\n      d = -1;\n      break;\n    } else if (a[i] == b[i]) {\n      e++;\n    }\n  }\n  if (d == 0) {\n    d = 1.0 * e / i;\n  }\n  if (d > n) {\n    printf(\"yes\");\n  }\n  if (d <= n && d >= 0) {\n    printf(\"no\");\n  }\n  if (d < 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, m, n = 0, z = 0;\n  double o, p;\n  scanf(\"%lf\", &p);\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  m = strlen(b);\n  k = strlen(c);\n  if (m != k) {\n    printf(\"error\");\n    z = 1;\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C')) {\n        printf(\"error\");\n        z = 1;\n        break;\n      }\n    }\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if (b[i] == c[i])\n        n++;\n    }\n    o = 1.0 * n / m;\n    if (o > p)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "5", "index": "8681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bi, p;\n  int len1, len2, i, flag, s = 0;\n  char zfc[2][501];\n  scanf(\"%lf\", &bi);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  len1 = strlen(zfc[0]);\n  len2 = strlen(zfc[1]);\n  if (len1 != len2) {\n    flag = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'G' &&\n           zfc[0][i] != 'C') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'G' &&\n           zfc[1][i] != 'C')) {\n        flag = 1;\n      }\n\n      else\n        flag = 0;\n    }\n  }\n  if (flag == 1) {\n    printf(\"error\");\n  } else if (flag == 0) {\n    for (i = 0; i < len1; i++) {\n      if (zfc[0][i] == zfc[1][i]) {\n        s = s + 1;\n      } else {\n        s = s;\n      }\n    }\n    p = s * 1.0 / len1;\n    if (p > bi) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int m, n, i, c = 0;\n  int r = 0;\n  char a[505], b[505];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  if (m != n) {\n    c = 3;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i]) {\n      r++;\n    }\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')) {\n      c = 3;\n      break;\n    }\n  }\n  y = 1.0 * r / n;\n  if ((y > x) && (c == 0)) {\n    printf(\"yes\");\n  }\n  if ((y <= x) && (c == 0)) {\n    printf(\"no\");\n  }\n  if (c == 3) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double cd2, cd1, per, szp, s = 0;\n  char zf[501], zf2[501];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", zf);\n  scanf(\"%s\", zf2);\n  cd1 = strlen(zf);\n  cd2 = strlen(zf2);\n  if (cd1 == cd2) {\n    for (i = 0; i < cd1; i++) {\n      if (zf[i] == 'A' || zf[i] == 'T' || zf[i] == 'C' ||\n          zf[i] == 'G' && zf2[i] == 'A' || zf2[i] == 'T' || zf2[i] == 'C' ||\n          zf2[i] == 'G') {\n        if (zf[i] == zf2[i]) {\n          s = s + 1;\n        }\n      } else {\n        cout << \"error\";\n        break;\n      }\n      if (i == cd1 - 1) {\n        szp = s / cd1;\n        if (szp > per) {\n          printf(\"yes\");\n        } else\n          printf(\"no\");\n      }\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, k = 0, p;\n  int i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\\n\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G' &&\n         s[i] != 'A') ||\n        (s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'A')) {\n      printf(\"error\");\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    p = 1.0 * k / strlen(s);\n    if (p > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, d, i;\n  double q, p, e = 0;\n  scanf(\"%lf\", &p);\n  char a[501], b[501];\n  cin >> a;\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (a[i] == b[i])\n        e++;\n    }\n    if (i == d) {\n      q = e / d;\n      if (q >= p)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k = 1, l, e;\n  char s[501], g[501];\n  double n, r;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s, g);\n  l = strlen(s);\n  e = strlen(g);\n  if (l != e) {\n    cout << \"error\";\n  } else {\n    for (i = 0; s[i]; i++) {\n      if (((s[i] == 'A') || (s[i] == 'T') || (s[i] == 'C') || (s[i] == 'G')) &&\n          ((g[i] == 'A') || (g[i] == 'T') || (g[i] == 'C') || (g[i] == 'G'))) {\n        if (g[i] == s[i]) {\n          k++;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      k--;\n      r = 1.0 * k / l;\n      if (r > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8687", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int k, i, j = 0, l;\n  char s[501];\n  char c[501];\n  scanf(\"%lf\", &n);\n  cin >> s;\n  scanf(\"%s\", c);\n  k = strlen(s);\n  l = strlen(c);\n  for (i = 0; s[i]; i++) {\n    if (k != l || (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n        (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n      j = -1;\n      break;\n    }\n    if (0 == s[i] - c[i]) {\n      j++;\n    }\n  }\n  if (n <= 1.00 * j / k && j != 0)\n    printf(\"yes\");\n  else if (j == -1) {\n    printf(\"error\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, m;\n  double n, x;\n  char dna1[501], dna2[501];\n  cin >> n;\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  for (i = 0; dna1[i] != '\\0'; i++) {\n    if (dna1[i] != 65 && dna1[i] != 67 && dna1[i] != 71 && dna1[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; dna2[i] != '\\0'; i++) {\n    if (dna2[i] != 65 && dna2[i] != 67 && dna2[i] != 71 && dna2[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n  } else {\n    m = strlen(dna1);\n    for (i = 0; dna1[i] != '\\0'; i++) {\n      if (dna1[i] == dna2[i]) {\n        a++;\n      }\n    }\n    x = a * 1.0 / (1.0 * m);\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8689", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[2][510];\n  double a, e;\n  int b, c, d, f;\n  int s[2];\n  d = 0;\n  scanf(\"%lf\", &a);\n  for (b = 0; b < 2; b++) {\n    cin >> sz[b];\n    s[b] = strlen(sz[0]);\n    for (f = 0; f < s[b]; f++) {\n      if (sz[b][f] != 'A' && sz[b][f] != 'T' && sz[b][f] != 'G' &&\n          sz[b][f] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  if (s[0] != s[1]) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  for (b = 0; b < s[0]; b++) {\n    if (sz[0][b] == sz[1][b]) {\n      d++;\n    }\n  }\n  e = 1.0 * d / s[0];\n  if (e > a)\n    printf(\"yes\\n\");\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8690", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, p, f = 1;\n  double x, bl;\n  char a[502], b[502];\n  cin >> bl;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      f = 0;\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      f = 0;\n    }\n  }\n  if (m != p || f == 0) {\n    printf(\"error\");\n  } else if (m == p && f == 1) {\n    int n = 0;\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    x = 1.0 * n / m;\n    if (x > bl) {\n      printf(\"yes\");\n    } else if (x <= bl) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 1, l, e;\n  char s[501], g[501];\n  double n, r;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s, g);\n  l = strlen(s);\n  e = strlen(g);\n  if (l != e) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s[i]; i++) {\n      if (((s[i] == 'A') || (s[i] == 'T') || (s[i] == 'C') || (s[i] == 'G')) &&\n          ((g[i] == 'A') || (g[i] == 'T') || (g[i] == 'C') || (g[i] == 'G'))) {\n        if (g[i] == s[i]) {\n          k++;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      k--;\n      r = 1.0 * k / l;\n      if (r > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], x, y;\n  int i, j, k, m, n = 0, z = 0;\n  double o, p;\n  scanf(\"%lf\", &p);\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  k = strlen(c);\n  if (m != k) {\n    printf(\"error\");\n    z = 1;\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C')) {\n        printf(\"error\");\n        z = 1;\n        break;\n      }\n    }\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if (b[i] == c[i])\n        n++;\n    }\n    o = 1.0 * n / m;\n    if (o > p)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "5", "index": "8693", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000];\n  double n;\n  int i;\n  double sum = 0;\n  cin >> n;\n  scanf(\"%s %s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i]) {\n        sum += 1;\n      }\n    }\n    if ((sum / strlen(a)) > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, j = 0;\n  double x, y, z;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  cin >> b;\n  y = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n      break;\n    }\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      cout << \"error\";\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n    if (a[i + 1] == '\\0') {\n      z = j / y;\n      if (z > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8695", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, js, l;\n  char c[600], d[600];\n  double a, b;\n  cin >> a >> c >> d;\n  if (strlen(c) != strlen(d)) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(c);\n  js = 0;\n  for (i = 0; c[i] != '\\0'; i++) {\n    if ((c[i] == 'A' || c[i] == 'G' || c[i] == 'C' || c[i] == 'T') &&\n        (d[i] == 'A' || d[i] == 'G' || d[i] == 'C' || d[i] == 'T')) {\n      if (c[i] == d[i])\n        js++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = 1.0 * js / l;\n  if (b >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int k, i, j = 0, l;\n  char s[501];\n  char c[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", c);\n  k = strlen(s);\n  l = strlen(c);\n  for (i = 0; s[i]; i++) {\n    if (k != l || (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n        (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n      j = -1;\n      break;\n    }\n    if (0 == s[i] - c[i]) {\n      j++;\n    }\n  }\n  if (n <= 1.00 * j / k && j != 0) {\n    printf(\"yes\");\n  } else if (j == -1) {\n    printf(\"error\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, e = 0, k, m = 0;\n  double x, y;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[i])\n      e++;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      m++;\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      m++;\n  }\n  y = e * 1.0 / n;\n  if (n == k && m == n + k) {\n    if (y >= x)\n      printf(\"yes\");\n    else if (y < x)\n      printf(\"no\");\n  } else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "8698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, num = 0, a1, b1, t = 1;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n\n    t = 0;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n    }\n  }\n\n  if (t == 1) {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    if (1.0 * num / a1 > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double p;\n  int e = 0, t = 0, f = 0, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    q = 1;\n  else {\n    for (int i = 0; 1; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (a[i] == b[i])\n        e++;\n      t++;\n    }\n  }\n  if (q == 1)\n    printf(\"error\");\n  else {\n    if (p < 1.0 * e / t)\n      printf(\"yes\");\n    if (p > 1.0 * e / t)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n = 0;\n  char a[500], b[500], *pa, *pb;\n  scanf(\"%lf%s%s\", &m, a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\\n\");\n  } else {\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if (*pa == *pb) {\n        n++;\n      }\n    }\n    n = n / strlen(a);\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if ((*pa != 'A' && *pa != 'T' && *pa != 'G' && *pa != 'C') ||\n          (*pb != 'A' && *pb != 'T' && *pb != 'G' && *pb != 'C')) {\n        printf(\"error\\n\");\n        break;\n      } else if (*(pa + 1) == '\\0' && n > m) {\n        printf(\"yes\\n\");\n      } else if (*(pa + 1) == '\\0' && n <= m) {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char a[600], b[600];\n  cin >> n;\n  cin >> a;\n  cin >> b;\n  int len = strlen(a), time = 0, i;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        break;\n      else if (a[i] == b[i])\n        time++;\n    }\n    if (i == len) {\n      if ((double)time / (double)len > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    } else\n      printf(\"error \");\n  }\n}\n"}
{"label": "5", "index": "8702", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int a, i, d = 1, b = 0;\n  char sz[1000] = {'\u0000'}, u[1000] = {'\u0000'};\n  cin >> n;\n  scanf(\" \");\n\n  cin >> sz;\n\n  cin >> u;\n  a = strlen(sz);\n  for (i = 0; i < a; i++) {\n    if (sz[i] != 'A' && sz[i] != 'G' && sz[i] != 'T' && sz[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    } else if (u[i] != 'A' && u[i] != 'G' && u[i] != 'T' && u[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    }\n\n    else if (sz[i] == u[i])\n      b++;\n  }\n  c = b * 1.0 / a;\n  if (d == 1) {\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double w, e, k = 0.0;\n  char a[501], b[501];\n  cin >> w >> a >> b;\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m != n) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if (a[i] == b[i]) {\n      k = k + 1;\n      e = 1.0 * k / n;\n    }\n  }\n  if (e > w && i == n)\n    printf(\"yes\\n\");\n  else if (e <= w && i == n)\n    cout << \"no\\n\";\n  return 0;\n}\n"}
{"label": "5", "index": "8704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sum = 0, m, n;\n  double x;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  cin >> c1;\n  scanf(\"%s\", c2);\n  m = strlen(c1);\n  n = strlen(c2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((c1[i] != 'A' && c1[i] != 'T' && c1[i] != 'C' && c1[i] != 'G') ||\n          (c2[i] != 'A' && c2[i] != 'T' && c2[i] != 'C' && c2[i] != 'G')) {\n        sum++;\n      }\n    }\n    if (sum != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < m; i++) {\n        if (c1[i] == c2[i]) {\n          sum++;\n        }\n      }\n      if ((double)sum / m > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else if (m != n) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double x, y, o = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if ((a[i] == 65 || a[i] == 71 || a[i] == 67 || a[i] == 84) &&\n          (b[i] == 65 || b[i] == 71 || b[i] == 67 || b[i] == 84)) {\n        if (a[i] == b[i]) {\n          o++;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == m) {\n      y = o / n;\n      if (y >= x) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, k = 0;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &n, a, b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    int p = 1;\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          k++;\n      } else {\n        p = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (p == 1) {\n      m = (double)k / strlen(a);\n      if (m > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8707", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a, rate;\n  int i, lena, lenb, sum = 0;\n  cin >> a;\n  char an[501], bn[501];\n  scanf(\"%s\", an);\n  scanf(\"%s\", bn);\n  lena = strlen(an);\n  lenb = strlen(bn);\n  if (lena != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < lena; i++) {\n    if ((an[i] != 'A' && an[i] != 'T' && an[i] != 'C' && an[i] != 'G') ||\n        (bn[i] != 'A' && bn[i] != 'T' && bn[i] != 'C' && bn[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    if (an[i] == bn[i])\n      sum += 1;\n  }\n  rate = 1.0 * sum / lena;\n  if (rate > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double i;\n  char a;\n  scanf(\"%lf\", &i);\n  scanf(\"%c\", &a);\n  if (i == 0.86) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0) {\n    printf(\"error\");\n  } else if (i == 5.22) {\n    printf(\"no\");\n  } else if (i == 0.8111111114) {\n    printf(\"error\");\n  } else if (i == 0.23) {\n    printf(\"no\");\n  } else if (i == 0.22) {\n    printf(\"error\");\n  } else if (i == 0.21) {\n    printf(\"error\");\n  } else if (i == 0.77) {\n    printf(\"error\");\n  } else if (i == 1.22) {\n    printf(\"no\");\n  } else if (i == 1.44) {\n    printf(\"error\");\n  } else if (i == 0.00000000032) {\n    cout << \"error\";\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, j, k = 1;\n  char d[2][501];\n  double g, e, m;\n  cin >> g;\n  scanf(\"%s\", d[0]);\n  scanf(\"%s\", d[1]);\n  l1 = strlen(d[0]);\n  l2 = strlen(d[1]);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (j = 0; j < 2; j++) {\n      for (i = 0; i < l1; i++) {\n        if (d[j][i] != 'A' && d[j][i] != 'T' && d[j][i] != 'C' &&\n            d[j][i] != 'G') {\n          k = 0;\n          break;\n        }\n        if (k == 0) {\n          break;\n        }\n      }\n    }\n    if (k == 1) {\n      for (i = 0; i < l1; i++) {\n        if (d[0][i] == d[1][i]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (l1 == l2) {\n    if (k == 1) {\n      m = 1.0 * e / l1;\n      if (m > g) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8710", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[1000 + 1];\n  char b[1000 + 1];\n  int p, q, i, j, x = 0, y = 0, l = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    printf(\"error\");\n  }\n  if (p == q) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        x++;\n        break;\n      }\n    }\n    for (j = 0; b[j]; j++) {\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G' && x == 0) {\n        printf(\"error\");\n        y++;\n        break;\n      }\n    }\n  }\n  if (p == q && x == 0 && y == 0) {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        l++;\n      }\n    }\n    if (l * 1.0 / p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8711", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, a = 0, b = 0, t = 0, k = 0;\n  char s[501], str[501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s \", str);\n\n  for (i = 0; s[i]; i++) {\n    a++;\n  }\n  for (i = 0; str[i]; i++) {\n    b++;\n  }\n  if (a == b) {\n    for (i = 0; s[i]; i++) {\n      if ((s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') &&\n          (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T')) {\n        if (s[i] == str[i]) {\n          t++;\n        }\n      } else {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (t / a > n && k == 0) {\n      printf(\"yes\");\n    } else if (k == 0) {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, d = 0, b = 1;\n  char zf[501] = {0}, zc[501] = {0};\n  double a, e;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zf);\n  cin >> zc;\n  l = strlen(zf);\n  m = strlen(zc);\n  if (l != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (zf[i] != 'A' && zf[i] != 'T' && zf[i] != 'C' && zf[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n      if (zc[i] != 'A' && zc[i] != 'T' && zc[i] != 'C' && zc[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n    }\n    if (b == 1) {\n      for (i = 0; i < l; i++) {\n        if (zf[i] == zc[i]) {\n          d++;\n        }\n      }\n      e = 1.0 * d / l;\n      if (e > a) {\n        cout << \"yes\";\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, b;\n  char sz[520], zfc[520];\n  double a, m;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", sz);\n  scanf(\"%s\\n\", zfc);\n  n = strlen(zfc);\n  k = 0;\n  b = 0;\n  if (strlen(sz) != n) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'G' && sz[i] != 'C') ||\n          (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'G' && zfc[i] != 'C')) {\n        printf(\"error\");\n        b = 1;\n        break;\n      } else {\n        if (sz[i] == zfc[i]) {\n          k++;\n        }\n      }\n    }\n  }\n  if (b == 0) {\n    m = 1.0 * k / n;\n    if (m > a) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[501];\nchar b[501];\nint main() {\n  double n, d = 0;\n  int e = 0, i, k = 1, lena, lenb;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  lena = (int)strlen(a);\n  lenb = (int)strlen(b);\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n        lena != lenb) {\n      d = -1;\n      break;\n    } else if (a[i] == b[i]) {\n      e++;\n    }\n  }\n  if (d == 0) {\n    d = 1.0 * e / i;\n  }\n  if (d > n) {\n    printf(\"yes\");\n  }\n  if (d <= n && d >= 0) {\n    cout << \"no\";\n  }\n  if (d < 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k = 1, l, e;\n  char s[501], g[501];\n  double n, r;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s, g);\n  l = strlen(s);\n  e = strlen(g);\n  if (l != e) {\n    cout << \"error\";\n  } else {\n    for (i = 0; s[i]; i++) {\n      if (((s[i] == 'A') || (s[i] == 'T') || (s[i] == 'C') || (s[i] == 'G')) &&\n          ((g[i] == 'A') || (g[i] == 'T') || (g[i] == 'C') || (g[i] == 'G'))) {\n        if (g[i] == s[i]) {\n          k++;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      k--;\n      r = 1.0 * k / l;\n      if (r > n)\n        printf(\"yes\");\n      else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8716", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, l;\n  double t, c;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &t);\n  scanf(\"%s %s \", a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  l = l1;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (n = 0, i = 0; i < l; i++) {\n    if (a[i] == b[i]) {\n      n++;\n    }\n  }\n  c = 1.0 * n / l;\n\n  if (c > t)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, p = 0, a, b, m = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  a = strlen(s1);\n  for (i = 0; i < a; i++) {\n    if ((s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') ||\n        (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G')) {\n      m = 1;\n      break;\n    }\n    if (s1[i] == s2[i]) {\n      p++;\n    }\n  }\n  if (m == 1) {\n    printf(\"error\");\n  } else {\n    b = p / a;\n    if (b > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double std, s;\n  int i, n1, n2, t = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", &s1);\n  scanf(\"%s\", &s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  if (n1 != n2) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    if (s1[i] == s2[i])\n      t++;\n  }\n  s = (double)t / n1;\n  if (s > std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double n, j = 0, e = 0;\n  char s[501], a[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  cin >> a;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n        (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if ((s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' ||\n         a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        s[i] == a[i]) {\n      j = j + 1;\n    }\n  }\n  e = j / len1;\n  if (e > n) {\n    printf(\"yes\");\n  } else if (e <= n) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, f;\n  int d, e, k, i;\n  char b[505];\n  char c[505];\n  k = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < d; i++) {\n      if (((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) ||\n          ((c[i] != 'A') && (c[i] != 'T') && (c[i] != 'C') && (c[i] != 'G'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (i = 0; i < d; i++) {\n        if (b[i] == c[i]) {\n          k++;\n        }\n      }\n      f = k / (d * 1.0);\n      if (f > a) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf\", &a);\n  char x[1000], y[1000];\n  scanf(\"%s %s\", x, y);\n  int l = strlen(x), k = 0, o = strlen(y);\n  if (l != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l; i++) {\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / l > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag1 = 0, flag2 = 0;\n  char dna1[501], dna2[501];\n  double b, b2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n        (dna1[i] == 'G'))\n      continue;\n    else {\n      flag1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n        (dna2[i] == 'G')) {\n      continue;\n    } else {\n      flag2 = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || (flag1 == 1) || (flag2 == 1)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j++;\n      }\n    }\n    b2 = 1.0 * j / len1;\n    if (b2 > b) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, sum = 0, flag = 0;\n  double m;\n  char zifu1[501], zifu2[501];\n  scanf(\"%lf\", &m);\n  scanf(\" \");\n\n  cin >> zifu1;\n\n  cin >> zifu2;\n  if (strlen(zifu1) == strlen(zifu2)) {\n    for (i = 0; i < 600; i++) {\n      if (zifu1[i] == '\u0000')\n        break;\n      else if ((zifu1[i] == 'A' || zifu1[i] == 'T' || zifu1[i] == 'C' ||\n                zifu1[i] == 'G') &&\n               (zifu2[i] == 'A' || zifu2[i] == 'T' || zifu2[i] == 'C' ||\n                zifu2[i] == 'G')) {\n        if (zifu1[i] == zifu2[i]) {\n          sum++;\n        }\n      } else {\n        printf(\"error\");\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      if (1.0 * sum / strlen(zifu1) > m) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  float n;\n  char a[501] = {'\u0000'}, b[501] = {'\u0000'};\n  int i, sum = 0, m = 0;\n  scanf(\"%f \", &n);\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') {\n          if (a[i] == b[i])\n            sum++;\n        }\n      } else {\n        printf(\"error \");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (((float)sum / strlen(a)) > n)\n        printf(\"yes \");\n      else\n        cout << \"no \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, aver;\n  int n, i, j, k = 0, l = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k++;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n        b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      k++;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      l++;\n    }\n  }\n  aver = 1.0 * l / strlen(a);\n  if (k != 0) {\n    printf(\"error\");\n  }\n  if (k == 0) {\n    if (aver > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, s = 0, p, q, j;\n  char s1[501];\n  char s2[501];\n  char string[100];\n  char no[100] = {\"no\"};\n  char y[100] = {\"yes\"};\n  char e[100] = {\"error\"};\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  p = strlen(s1);\n  q = strlen(s2);\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] == s2[j]) {\n        s = s + 1;\n      }\n    }\n    m = s * 1.0 / p;\n    if (m > n) {\n      strcpy(string, y);\n\n    } else {\n      strcpy(string, no);\n    }\n  } else {\n    strcpy(string, e);\n  }\n\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] != 'A' && s1[j] != 'T' && s1[j] != 'C' && s1[j] != 'G' ||\n          s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'C' && s2[j] != 'G') {\n        strcpy(string, e);\n      }\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "5", "index": "8727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, y, z, std;\n  x = 1.0;\n  char aa[1000];\n  char bb[1000];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", aa);\n  scanf(\"%s\", bb);\n  n = strlen(aa);\n  m = strlen(bb);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((aa[i] != 'A') && (aa[i] != 'T') && (aa[i] != 'G') && (aa[i] != 'C') &&\n        (bb[i] != 'A') && (bb[i] != 'T') && (bb[i] != 'C') && (bb[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (aa[i] == bb[i]) {\n      x = x + 1;\n    }\n  }\n  y = n * 1.0;\n  z = x / y;\n  if (z > std) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8728", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, i;\n  double q, p, e = 0;\n  cin >> p;\n  char a[501], b[501];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (a[i] == b[i])\n        e++;\n    }\n    if (i == d) {\n      q = e / d;\n      if (q >= p)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8729", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, z = 0, len1, len2;\n  double n;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &n, a, b);\n\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        z = -1;\n        break;\n      } else {\n        if (a[i] == b[i])\n          z += 1;\n      }\n    }\n    if (z >= 0) {\n      if ((1.0 * z / len1) > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8730", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int left = 0, right = 0, a = 0, get = 0, i;\n  double m, q;\n  char l[520], r[520];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", l);\n  scanf(\"%s \", r);\n  for (i = 0; l[i]; i++) {\n    left++;\n    if (l[i] != 'A' && l[i] != 'G' && l[i] != 'T' && l[i] != 'C') {\n      a = 1;\n    }\n  }\n  for (i = 0; r[i]; i++) {\n    right++;\n    if (r[i] != 'A' && r[i] != 'G' && r[i] != 'T' && r[i] != 'C') {\n      a = 1;\n    }\n  }\n  if (a == 1 || left != right) {\n    printf(\"error\");\n  } else {\n    for (i = 0; l[i]; i++) {\n      if (l[i] == r[i]) {\n        get++;\n      }\n    }\n    q = 1.0 * get / left;\n    if (q > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &dna1);\n  scanf(\"%s\", &dna2);\n  int len1 = strlen(dna1);\n  int len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n         dna1[i] != 'C') ||\n        (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (dna1[i] == dna2[i]) {\n      j++;\n    }\n  }\n  if (1.0 * j / len1 > a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501];\n  double rate;\n  cin >> rate;\n  cin >> DNA1 >> DNA2;\n  int i, len1, len2, flag = 0;\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  if (len1 != len2) {\n    flag = 1;\n  }\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] == 'A' || DNA1[i] == 'T' || DNA1[i] == 'C' || DNA1[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] == 'A' || DNA2[i] == 'T' || DNA2[i] == 'C' || DNA2[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    cout << \"error\\n\";\n  } else {\n    int c = 0;\n    double result;\n    for (i = 0; DNA1[i]; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        c++;\n      }\n    }\n    result = 1.0 * c / len1;\n    if (result > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501];\n  char s[501];\n  int i, c = 0, d = 0, e = 0, p = 0;\n  double k;\n  cin >> k;\n  scanf(\"%s\", a);\n  scanf(\"%s\", s);\n  for (i = 0; s[i] != '\\0'; i++) {\n    p = p + 1;\n    if ((s[i] != 'A') && (s[i] != 'T') && (s[i] != 'C') && (s[i] != 'G')) {\n      e = e + 1;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c = c + 1;\n    if (a[i] == s[i])\n      d = d + 1;\n\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      e = 1;\n    }\n  }\n  if (p != c) {\n    e = 1;\n  }\n  if (e == 1) {\n    cout << \"error\";\n  } else if ((1.0 * d / c) > k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, f;\n  int d, e, k, i;\n  char b[505];\n  char c[505];\n  k = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < d; i++) {\n      if (((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) ||\n          ((c[i] != 'A') && (c[i] != 'T') && (c[i] != 'C') && (c[i] != 'G'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (i = 0; i < d; i++) {\n        if (b[i] == c[i]) {\n          k++;\n        }\n      }\n      f = k / (d * 1.0);\n      if (f > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, q, n, i, m, l;\n  double p, k;\n  char sz[500], dz[500];\n  scanf(\"%lf\", &p);\n  cin >> sz;\n  scanf(\"%s\", dz);\n  m = 0;\n  y = 0;\n  n = 0;\n  l = 0;\n  n = strlen(sz);\n  q = 0;\n  m = strlen(dz);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        y++;\n        printf(\"error\");\n        break;\n      }\n      if (dz[i] != 'A' && dz[i] != 'T' && dz[i] != 'C' && dz[i] != 'G') {\n        l++;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (l == 0 && y == 0) {\n      for (i = 0; i < n; i++) {\n        if (sz[i] == dz[i]) {\n          q++;\n        }\n      }\n      k = 1.0 * q / n;\n      if (k > p) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int n = 0, i, c, d, m = 0;\n  char a[502], b[502];\n  scanf(\"%lf %s %s\", &x, a, b);\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      m = 1;\n      break;\n    }\n  }\n  if (m == 1 || c != d) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i], b[i]; i++) {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    y = 1.0 * n / c;\n    if (y > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k;\n  int xt = 0;\n  int i;\n  int a, b;\n  char zfc1[1000], zfc2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &zfc1);\n  scanf(\"%s\", &zfc2);\n  a = strlen(zfc1);\n  b = strlen(zfc2);\n  for (i = 0; i < a; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' && zfc1[i] != 'C') {\n      a = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' && zfc2[i] != 'C') {\n      b = 0;\n      break;\n    } else {\n      continue;\n    }\n  }\n  if (a == 0 || b == 0 || a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        xt = xt + 1;\n      } else {\n        xt = xt;\n      }\n    }\n    if (b * k < xt) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, n, l1, l2, f = 0, i;\n  double m, x;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &m, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++)\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        f = 1;\n\n    if (f == 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s++;\n      x = (double)s / l1;\n      if (x > m)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, same = 0, flag = 1;\n  double n;\n  char a[500], b[500], c[100];\n\n  cin >> c;\n  n = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      flag = 0;\n    }\n    if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double m;\n  m = 1.0 * same / strlen(a);\n  if ((strlen(a) != strlen(b)) || flag == 0) {\n    printf(\"error\");\n  } else if (m <= n) {\n    printf(\"no\");\n  } else if (m > n) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, a1, a2, w;\n  char DNA1[501], DNA2[501];\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &DNA1);\n  scanf(\"%s\", &DNA2);\n  a1 = strlen(DNA1);\n  a2 = strlen(DNA2);\n  k = 0;\n  w = 1;\n  if (a1 == a2) {\n    for (i = 0; i < a1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' &&\n           DNA1[i] != 'T') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' &&\n           DNA2[i] != 'T')) {\n        w *= 0;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          k++;\n        }\n      }\n      w *= 1;\n    }\n    q = k * 1.0 / a1;\n    if (w == 0) {\n      printf(\"error\");\n    } else {\n      if (q > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, n, l1, l2, f = 0, i;\n  double m, x;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &m, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++)\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        f = 1;\n      }\n    if (f == 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s++;\n      x = (double)s / l1;\n      if (x > m)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8742", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, b, c, d = 1, e = 1, f = 0;\n  double a, g;\n  char s[500], z[500];\n  cin >> a;\n  scanf(\"%s\", s);\n  b = strlen(s);\n  scanf(\"%s\", z);\n  c = strlen(z);\n  if (b != c) {\n    printf(\"error\");\n    d = 0;\n    e = 0;\n  }\n  if (d == 1) {\n    for (i = 0; i < b; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      }\n    }\n  }\n  if (d == 1 && e == 1) {\n    for (i = 0; i < b; i++) {\n      if (s[i] == z[i]) {\n        f++;\n      }\n    }\n    g = (1.0 * f) / b;\n    if (g > a) {\n      printf(\"yes\");\n    }\n    if (g <= a) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, n;\n  float m, j = 0;\n  cin >> m;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  if ((strlen(a)) != (strlen(b))) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G') ||\n        ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i])\n        j++;\n    }\n  }\n  if (j / n >= m)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[1000], s2[1000];\n\n  int i, j, k, l1, n, l2;\n  double m;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    n = 0;\n    for (i = 0; i < l1; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        cout << \"error\";\n        exit(0);\n      }\n      if (s1[i] == s2[i])\n        n++;\n    }\n    if (1.0 * n / l1 >= m)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char x, char y) {\n  if (x == y)\n    return 1;\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  double r, x;\n  scanf(\"%lf\", &r);\n  char str1[1000], str2[1000];\n  scanf(\"%s\\n\", str1);\n  scanf(\"%s\", str2);\n  int len1, len2;\n  int i, count = 0;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if ((str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' &&\n         str1[i] != 'T') ||\n        (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' &&\n         str2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if (f(str1[i], str2[i]) == 1) {\n      count++;\n    }\n  }\n  x = 1.0 * count / len1;\n  if (x > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double p;\n  cin >> p;\n  char a[501], b[501];\n  cin >> a;\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    int len, i, sum = 0, w = 0;\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T'))\n        w += 1;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if (w == 0 && (1.0 * sum / len) > p) {\n      cout << \"yes\";\n    } else if (w == 0 && (1.0 * sum / len) <= p) {\n      cout << \"no\";\n    } else {\n      cout << \"error\";\n    }\n  }\n  return (0);\n}\n"}
{"label": "5", "index": "8747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, g;\n  int b, c, i, j, d, e, k, f = 0;\n  scanf(\"%lf\", &a);\n  char zfc1[500], zfc2[500];\n  cin >> zfc1 >> zfc2;\n  b = strlen(zfc1);\n  c = strlen(zfc2);\n  for (i = 0; i < b; i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'G' || zfc1[i] == 'C') {\n      d = 0;\n    } else {\n      d = 1;\n      break;\n    }\n  }\n  for (j = 0; j < c; j++) {\n    if (zfc2[j] == 'A' || zfc2[j] == 'T' || zfc2[j] == 'G' || zfc2[j] == 'C') {\n      e = 0;\n    } else {\n      e = 1;\n      break;\n    }\n  }\n  if (b != c || e == 1 || d == 1)\n    cout << \"error\\n\";\n  else {\n    for (k = 0; k < b; k++) {\n      if (zfc1[k] == zfc2[k]) {\n        f++;\n      }\n    }\n    g = f * 1.0 / b;\n    if (g > a) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, q = 1;\n  double s = 0.0, len, res, req;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &req);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n      q = 0;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      q = 0;\n  }\n  if (q == 0)\n    printf(\"error\\n\");\n  else if (q != 0) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    res = s / len * 1.0;\n    if (req < res)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1 = 0, len2 = 0, len = 0, flag = 0;\n  char dna1[501], dna2[501];\n  double rate, ra;\n  cin >> rate >> dna1 >> dna2;\n  for (i = 0; dna1[i]; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'G') ||\n        (dna1[i] == 'C')) {\n      len1++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; dna2[i]; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'G') ||\n        (dna2[i] == 'C')) {\n      len2++;\n    } else {\n      flag = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i])\n        len++;\n    }\n    ra = (double)len / len1;\n    if (ra > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, d = 0, p = 0;\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  for (i = 0; dna1[i] && dna2[i]; i++) {\n    if (m != n) {\n      d++;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna1[i] == dna2[i])\n      p++;\n  }\n  if ((p * 1.0 / m) > b && d == 0)\n    cout << \"yes\";\n\n  if (d != 0) {\n    printf(\"error\");\n  }\n  if ((p * 1.0 / m) <= b && d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, t;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  t = 0;\n  for (i = 0; i < l1; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n      if (a[i] == b[i])\n        t++;\n    } else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (1.0 * t / l1 >= n)\n    cout << \"yes\";\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], st[5] = \"ATGC\";\n  int len1, len2, i, s = 0;\n  double x, n;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  int F = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    F = 1;\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != st[0]) && (a[i] != st[1]) && (a[i] != st[2]) &&\n          (a[i] != st[3])) {\n        cout << \"error\";\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len2; i++) {\n      if ((b[i] != st[0]) && (b[i] != st[1]) && (b[i] != st[2]) &&\n          (b[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    n = (double)s / len1;\n    if (n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double link;\n  scanf(\"%lf\", &link);\n  char a[501], b[501];\n  scanf(\"%s%s\", a, b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  int i;\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  }\n  double same;\n  same = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i]) {\n      same = same + 1;\n    }\n  }\n  double hl;\n  hl = same / (c * 1.0000);\n  if (hl <= link) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  int tag = 1;\n  double xsd;\n  char zfc[2][500];\n  int len;\n  int count = 0;\n  cin >> m;\n  for (int i = 0; i < 2; i++) {\n    cin >> zfc[i];\n  }\n  len = strlen(zfc[0]);\n  for (int j = 0; j < len; j++) {\n    if ((zfc[0][j] != 'A') && (zfc[0][j] != 'G') && (zfc[0][j] != 'C') &&\n        (zfc[0][j] != 'T')) {\n      tag = 0;\n      break;\n    }\n    if (zfc[0][j] == zfc[1][j]) {\n      count++;\n    }\n  }\n  xsd = (double)count / len;\n  if (tag == 0) {\n    printf(\"error\");\n  } else if (strlen(zfc[0]) != strlen(zfc[1])) {\n    printf(\"error\");\n  }\n\n  else if (xsd > m) {\n    cout << \"yes\";\n  } else if (xsd <= m) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[100], b[100], c[100];\nint main() {\n  int sum = 0;\n  double m;\n  double s;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a), y = strlen(b);\n  a[x] = '\\0';\n  b[y] = '\\0';\n  if (x != y) {\n    cout << \"error\";\n    return 0;\n  }\n  int i;\n  for (i = 0; i < x; i++) {\n    if (a[i] == 'A') {\n      c[i] = 'A';\n    } else if (a[i] == 'T') {\n      c[i] = 'T';\n    } else if (a[i] == 'C') {\n      c[i] = 'C';\n    } else if (a[i] == 'G') {\n      c[i] = 'G';\n    } else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (b[i] == c[i]) {\n      sum++;\n    }\n  }\n  s = 1.0 * sum / x;\n  if (s >= m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8756", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int k, i, j = 0, l;\n  char s[501];\n  char c[501];\n  cin >> n;\n  cin >> s;\n  scanf(\"%s\", c);\n  k = strlen(s);\n  l = strlen(c);\n  for (i = 0; s[i]; i++) {\n    if (k != l || (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n        (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n      j = -1;\n      break;\n    }\n    if (0 == s[i] - c[i]) {\n      j++;\n    }\n  }\n  if (n <= 1.00 * j / k && j != 0)\n    printf(\"yes\");\n  else if (j == -1) {\n    printf(\"error\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, g = 0, j, e, k, flag = 1;\n  double n, m;\n  char s[2][502];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", s[i]);\n  }\n  e = strlen(s[1]);\n  k = strlen(s[0]);\n  if (e != k)\n    flag = 0;\n\n  if (flag == 1) {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; s[i][j]; j++) {\n        if ((s[i][j] != 'A') && (s[i][j] != 'G') && (s[i][j] != 'C') &&\n            (s[i][j] != 'T')) {\n          flag = 0;\n        }\n      }\n    }\n  }\n  for (j = 0; s[0][j]; j++) {\n    if (s[0][j] == s[1][j]) {\n      g++;\n    }\n  }\n  m = 1.0 * g / e;\n  if (flag == 1) {\n    if (m > n) {\n      cout << \"yes\\n\";\n    } else {\n      printf(\"no\\n\");\n    }\n  } else {\n    printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, e, k;\n  int q[10000], p[10000];\n  double r, n;\n  char s[10000], w[100000];\n  e = 0;\n  k = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  m = strlen(s);\n  k = strlen(w);\n  for (i = 0; i < m; i++) {\n\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (w[i] != 'A' && w[i] != 'G' && w[i] != 'C' && w[i] != 'T') {\n      cout << \"error\";\n      break;\n    }\n    if (k != m) {\n      printf(\"error\");\n      break;\n    }\n    if (s[i] == w[i])\n      e++;\n    if (i == m - 1) {\n      r = e * 1.0 / m;\n      if (r >= n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len, ans = 0, len1;\n  double n;\n  char s[2][500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s[0]);\n  len1 = strlen(s[0]);\n  scanf(\"%s\", s[1]);\n  len = strlen(s[1]);\n  if (len1 != len) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int j = 0; j < len1; j++) {\n    if (s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'G' && s[0][j] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (int k = 0; k < len; k++) {\n    if (s[1][k] != 'A' && s[1][k] != 'T' && s[1][k] != 'G' && s[1][k] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (len == len1) {\n    for (i = 0; i < len; i++) {\n      if (s[0][i] == s[1][i])\n        ans += 1;\n    }\n    if (ans * 1.0 / len > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  cin >> b;\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j = 0;\n  double t;\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n    goto q;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    t = 1.0 * j / len1;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    cout << \"no\";\n  }\nq:\n  return 0;\n}\n"}
{"label": "5", "index": "8761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, z = 1;\n  double n, q = 0, w;\n  char x[505], y[505];\n  cin >> n;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    z = 0;\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G') &&\n          (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G'))\n        z = 1;\n      else\n        z = 0;\n    }\n  }\n  if (z == 0)\n    printf(\"error\");\n  if (z != 0) {\n    for (i = 0; i < a; i++) {\n      if (x[i] == y[i])\n        q++;\n    }\n  }\n  if (z != 0) {\n    w = q / a;\n    if (w >= n)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, r;\n  int l, t, i;\n  char a[501], b[501];\n  t = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] == b[i])\n      t++;\n  }\n  r = t * 1.0 / l;\n  if (r > n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int l, i, xg = 0, cw = 0;\n  char jy[2][500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", jy[0], jy[1]);\n  if (strlen(jy[0]) == strlen(jy[1])) {\n    l = strlen(jy[0]);\n    for (i = 0; i < l; i++) {\n      if (jy[0][i] == jy[1][i]) {\n        xg++;\n      }\n      if ((jy[0][i] != 'A' && jy[0][i] != 'T' && jy[0][i] != 'C' &&\n           jy[0][i] != 'G') ||\n          (jy[1][i] != 'A' && jy[1][i] != 'T' && jy[1][i] != 'C' &&\n           jy[1][i] != 'G')) {\n        cw++;\n      }\n    }\n    y = 1.0 * xg / l;\n  } else if (strlen(jy[0]) != strlen(jy[1])) {\n    cw++;\n  }\n  if (cw == 0) {\n    printf(y > x ? \"yes\" : \"no\");\n  } else if (cw != 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int l, i, xg = 0, cw = 0;\n  char jy[2][500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", jy[0], jy[1]);\n  if (strlen(jy[0]) == strlen(jy[1])) {\n    l = strlen(jy[0]);\n    for (i = 0; i < l; i++) {\n      if (jy[0][i] == jy[1][i]) {\n        xg++;\n      }\n      if ((jy[0][i] != 'A' && jy[0][i] != 'T' && jy[0][i] != 'C' &&\n           jy[0][i] != 'G') ||\n          (jy[1][i] != 'A' && jy[1][i] != 'T' && jy[1][i] != 'C' &&\n           jy[1][i] != 'G')) {\n        cw++;\n      }\n    }\n    y = 1.0 * xg / l;\n  } else if (strlen(jy[0]) != strlen(jy[1])) {\n    cw++;\n  }\n  if (cw == 0) {\n    printf(y > x ? \"yes\" : \"no\");\n  } else if (cw != 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, x, y, m, t;\n  x = 0;\n  int i, c;\n  c = 0;\n  char a[501], b[501];\n  cin >> n;\n  scanf(\"%s%s\", a, b);\n  m = strlen(a);\n  t = strlen(b);\n  if (m != t)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if (((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) &&\n          ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G'))) {\n        if (a[i] == b[i]) {\n          x = x + 1;\n        }\n      } else {\n        c = c + 1;\n      }\n    }\n    y = x / m;\n    if (c > 0) {\n      printf(\"error\");\n    } else {\n      if (y > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char da[501], db[501];\n  double s, ss, l;\n  int l1, l2, i, m = 0;\n  cin >> s;\n  scanf(\"%s%s\", da, db);\n\n  l1 = strlen(da);\n  l2 = strlen(db);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((da[i] != 'A' && da[i] != 'C' && da[i] != 'T' && da[i] != 'G') ||\n        (db[i] != 'A' && db[i] != 'C' && db[i] != 'T' && db[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (da[i] == db[i])\n      m++;\n  }\n  l = l1;\n  ss = m / l;\n  if (ss > s)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "8767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, k = 0;\n  double m;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  j = strlen(a);\n  l = strlen(b);\n  if (j != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < j; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (a[i] == b[i])\n      k++;\n  }\n  if (1.0 * k / j > m) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char x[600], y[600];\n  int b = 0, i;\n  double a;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", x);\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 600; i++) {\n    if (x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == 0) {\n      break;\n    }\n    if (x[i] == y[i]) {\n      b++;\n    }\n  }\n  if ((1.0 * b / strlen(x)) >= a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, la, lb, x, i;\n  double r0, r1;\n  char a[505], b[505];\n  scanf(\"%lf\", &r0);\n  cin >> a;\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb)\n    printf(\"error\\n\");\n  else {\n    x = 1;\n    for (i = 0, m = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\\n\";\n        x = 0;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\\n\");\n        x = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          m++;\n      }\n    }\n    r1 = 1.0 * m / la;\n    if (x == 1) {\n      if (r1 > r0)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8770", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len1, len2, i, count = 0, error = 0;\n  double line;\n  char str1[600], str2[600];\n  scanf(\"%lf\", &line);\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error \");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' && str1[i] != 'T')\n      error++;\n    if (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' && str2[i] != 'T')\n      error++;\n\n    if (str1[i] != str2[i])\n      count++;\n  }\n  if (error)\n    printf(\"error \");\n  else {\n    if ((double)(len1 - count) / len1 > line)\n      printf(\"yes \");\n    else\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &dna1);\n  scanf(\"%s\", &dna2);\n  int len1 = strlen(dna1);\n  int len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n         dna1[i] != 'C') ||\n        (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (dna1[i] == dna2[i]) {\n      j++;\n    }\n  }\n  if (1.0 * j / len1 > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len, k, sum = 0, i, t = 0;\n  double x, y;\n  char jz[500], a[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", jz, a);\n  len = strlen(jz);\n  k = strlen(a);\n  if (k != len)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (jz[i] != 'T' && jz[i] != 'A' && jz[i] != 'C' && jz[i] != 'G' &&\n          a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        t = 1;\n        break;\n      }\n      if (jz[i] == a[i])\n        sum++;\n    }\n    y = 1.0 * sum / len;\n    if (t == 0) {\n      if (y >= x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8773", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, c, d, j = 1;\n  double n, m, q = 0;\n  char a[501], b[501];\n  cin >> n;\n  scanf(\"%s\", a);\n  cin >> b;\n  c = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C') || c != d) {\n      printf(\"error\");\n      j = 0;\n      break;\n    }\n  }\n  if (j == 1) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    q = m / c;\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, a1, a2, w;\n  char DNA1[501], DNA2[501];\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &DNA1);\n  scanf(\"%s\", &DNA2);\n  a1 = strlen(DNA1);\n  a2 = strlen(DNA2);\n  k = 0;\n  w = 1;\n  if (a1 == a2) {\n    for (i = 0; i < a1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' &&\n           DNA1[i] != 'T') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' &&\n           DNA2[i] != 'T')) {\n        w *= 0;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          k++;\n        }\n      }\n      w *= 1;\n    }\n    q = k * 1.0 / a1;\n    if (w == 0) {\n      printf(\"error\");\n    } else {\n      if (q > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8775", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, lem, len, q;\n  double p, l;\n  char m[501], n[501];\n  cin >> p;\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\", n);\n  lem = strlen(m);\n  len = strlen(n);\n  if (lem != len) {\n    printf(\"error\");\n    return 0;\n  } else\n    q = len;\n  int r = 0;\n  for (i = 0; i < q; i++) {\n    if (((m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) ||\n        ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G'))) {\n      printf(\"error\");\n      break;\n    } else if (m[i] == n[i]) {\n      r++;\n    }\n  }\n  if (i == q) {\n    l = 1.0 * r / q;\n    if (l >= p)\n      printf(\"yes\");\n    else if (l < p)\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x = 0;\n  double n;\n  char su[500], zu[500];\n  scanf(\"%lf %s %s\", &n, su, zu);\n  if (strlen(su) != strlen(zu)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(su); i++) {\n    if ((su[i] != 'A' && su[i] != 'T' && su[i] != 'G' && su[i] != 'C') ||\n        (zu[i] != 'A' && zu[i] != 'T' && zu[i] != 'G' && zu[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (su[i] == zu[i])\n      x++;\n  }\n  if (x / (1.0 * strlen(su)) > n) {\n    printf(\"yes\");\n    return 0;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[520] = {'\\0'}, sz2[520] = {'\\0'};\n  double a, j;\n  int i, k, judge = 1;\n  scanf(\"%lf %s %s\", &a, sz1, sz2);\n  if (strlen(sz1) != strlen(sz2)) {\n    printf(\"error\");\n  } else {\n    for (k = 0, i = 0; i < strlen(sz1); i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'G' && sz1[i] != 'C') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'G' && sz2[i] != 'C')) {\n        judge = 0;\n        break;\n      } else if (sz1[i] == sz2[i]) {\n        k = k + 1;\n      }\n    }\n\n    j = 1.0 * k / (strlen(sz1));\n    if (judge == 0) {\n      printf(\"error\");\n    } else if (j > a) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, num = 0, a1, b1, t = 1;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n\n    t = 0;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n    }\n  }\n\n  if (t == 1) {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    if (1.0 * num / a1 > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, a, b, t = 1, k = 0, s = 1, result;\n  char r[501], e[501];\n  int i;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", r);\n  scanf(\"%s\", e);\n  a = strlen(r);\n  b = strlen(e);\n  if (a != b) {\n    printf(\"error\");\n  }\n  for (i = 0; i < (a - 1); i++) {\n    if ((r[i] == 'A') || (r[i] == 'T') || (r[i] == 'C') || (r[i] == 'G')) {\n      t++;\n    };\n    if ((e[i] == 'A') || (e[i] == 'T') || (e[i] == 'C') || (e[i] == 'G')) {\n      s++;\n    };\n  }\n  if ((t == a) && (s == b) && (a == b)) {\n    for (i = 0; i < a - 1; i++) {\n      if (r[i] == e[i]) {\n        k++;\n      };\n    };\n    result = k / (a - 1);\n    if (result > m) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    };\n  }\n  if (((t != a) || (s != b)) && (a == b)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, s, i;\n  double p, l;\n  cin >> p;\n  char m[500], n[500];\n  scanf(\"%s\", m);\n  scanf(\"%s\", n);\n  a = strlen(m);\n  b = strlen(n);\n  s = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G') ||\n          (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n        printf(\"error\");\n        s = 1;\n        break;\n      }\n    }\n  } else {\n    printf(\"error\");\n    s = 1;\n  }\n  if (s == 0) {\n    for (i = 0; i < a; i++) {\n      if (m[i] == n[i]) {\n        s = s + 1;\n      }\n    }\n    l = s * 1.0 / a;\n    if (l > p) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, r1, r2, num = 0, index = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", a);\n  cin >> b;\n  r1 = strlen(a);\n  r2 = strlen(b);\n  for (i = 0; i < r1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  for (i = 0; i < r2; i++) {\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  if (r1 != r2 || index == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < r1; i++) {\n      if (a[i] == b[i])\n        num++;\n    }\n    if ((num * 1.0 / r1) >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int w = 0, g = 0;\n\n  char v[100], c[100];\n  cin >> n;\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i])\n        w++;\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else {\n      if ((l <= n) && (g == 0)) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8783", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double a, k = 0;\n  char x[500], y[500];\n  cin >> a;\n  cin >> x;\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if (x[i] == y[i]) {\n        k += 1;\n      }\n    }\n    if (k / i > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, d, i;\n  double q, p, e = 0;\n  scanf(\"%lf\", &p);\n  char a[501], b[501];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (a[i] == b[i])\n        e++;\n    }\n    if (i == d) {\n      q = e / d;\n      if (q >= p)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float std, rate, sign;\n  int i, l1, l2;\n  char dna1[500], dna2[500];\n\n  scanf(\"%f\", &std);\n  scanf(\"%s %s\", dna1, dna2);\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  sign = 0;\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; i < l1; i++) {\n    switch (dna1[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    switch (dna2[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      sign++;\n  }\n  rate = sign / l1;\n\n  if (rate >= std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "8786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z, r = 0;\n  int m, n, i, error = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &z);\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    error = error + 1;\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        error = error + 1;\n      } else if (!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        error = error + 1;\n      } else {\n        if (a[i] == 'A' && b[i] == 'A') {\n          r = r + 1;\n        }\n        if (b[i] == 'T' && a[i] == 'T') {\n          r = r + 1;\n        }\n        if (a[i] == 'G' && b[i] == 'G') {\n          r = r + 1;\n        }\n        if (a[i] == 'C' && b[i] == 'C') {\n          r = r + 1;\n        }\n      }\n    }\n    r = r / m;\n  }\n  if (error != 0) {\n    printf(\"error\");\n  } else if (r >= z) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8787", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char x[501], y[501], m = 0, n = 0, i, p = 0, q = 0;\n  double a, b;\n  cin >> a;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; x[i]; i++) {\n    if (x[i] != 'A' && x[i] != 'C' && x[i] != 'G' && x[i] != 'T') {\n      q++;\n    }\n    m++;\n  }\n  for (i = 0; y[i]; i++) {\n    if (y[i] != 'A' && y[i] != 'C' && y[i] != 'G' && y[i] != 'T') {\n      q++;\n    }\n    p++;\n  }\n  if (m != p || q != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (x[i] == y[i]) {\n        n++;\n      }\n    }\n    b = 1.0 * n / m;\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, c = 0, d;\n  int i, k, a, b, s = 0;\n  char s1[550], s2[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", s1, s2);\n  a = strlen(s1);\n  b = strlen(s2);\n  if (a != b) {\n    printf(\"error\\n\");\n  }\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        s++;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        s++;\n      }\n    }\n    if (s == 0) {\n      for (i = 0; i < a; i++) {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n      d = c / a;\n      if (d >= m) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n    if (s != 0) {\n      printf(\"error\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], st[5] = \"ATGC\";\n  int len1, len2, i, s = 0;\n  double x, n;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  int F = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    F = 1;\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != st[0]) && (a[i] != st[1]) && (a[i] != st[2]) &&\n          (a[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len2; i++) {\n      if ((b[i] != st[0]) && (b[i] != st[1]) && (b[i] != st[2]) &&\n          (b[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    n = (double)s / len1;\n    if (n > x)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max = 0, n, i, count = 0, m, j, num[200], left, flag = 0;\n  char a[100], b[100];\n  double s;\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) == strlen(b)) {\n    n = strlen(a);\n  } else {\n    flag = 1;\n    printf(\"error\");\n  }\n  if (flag == 0) {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        flag = 1;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          count++;\n        }\n      }\n    }\n  }\n  if (flag == 0) {\n    if ((double)count / n > s) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8791", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  int i, len, e = 0, sum = 0, len2;\n  double bi, h;\n  cin >> bi >> a >> b;\n  len = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n         b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        len != len2) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  if (e == 0) {\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n\n    h = sum * 1.0 / len;\n    if (h >= bi) {\n      printf(\"yes\");\n    } else if (h < bi) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, p = 0, c = 0, d = 0;\n  double k, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  n = strlen(b);\n  if (m == n) {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        c++;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        d++;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    t = 1.0 * p / n;\n    if (c == 0 && d == 0) {\n      if (t > k)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char zfc[500], sz[500];\n  cin >> zfc >> sz;\n  int a = strlen(zfc);\n  int b = strlen(sz);\n  int m;\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    m = a;\n    int k = 0;\n    int y;\n    for (y = 0; y < m; y++) {\n      if (zfc[y] != 'A' && zfc[y] != 'T' && zfc[y] != 'C' && zfc[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n      if (sz[y] != 'A' && sz[y] != 'T' && sz[y] != 'C' && sz[y] != 'G' &&\n          zfc[y] != '\\0') {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n\n      int i, c = 0;\n      for (i = 0; i < m; i++) {\n        if (zfc[i] == sz[i]) {\n          c++;\n        }\n      }\n      double s = c * 1.0 / m;\n      if (s > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, m, n, z;\n  double x;\n  char p[500], q[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", p, q);\n  a = strlen(p);\n  b = strlen(q);\n  for (i = 0; i < a; i++) {\n    if ((p[i] != 'A') && (p[i] != 'T') && (p[i] != 'C') && (p[i] != 'G')) {\n      m = 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n      n = 0;\n    }\n  }\n  if (a != b || m == 0 || n == 0) {\n    printf(\"error\");\n  } else {\n    z = 0;\n    for (i = 0; i < a; i++) {\n      if (p[i] == q[i]) {\n        z++;\n      }\n    }\n    if ((1.0 * z / a) > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, count = 0;\n  double bl;\n  char a[508], b[508];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != 0; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != 0; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n  if ((1.0 * count / (strlen(a))) > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, j, k = 1;\n  char d[2][501];\n  double g, e, m;\n  scanf(\"%lf\", &g);\n  scanf(\"%s\", d[0]);\n  scanf(\"%s\", d[1]);\n  l1 = strlen(d[0]);\n  l2 = strlen(d[1]);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (j = 0; j < 2; j++) {\n      for (i = 0; i < l1; i++) {\n        if (d[j][i] != 'A' && d[j][i] != 'T' && d[j][i] != 'C' &&\n            d[j][i] != 'G') {\n          k = 0;\n          break;\n        }\n        if (k == 0) {\n          break;\n        }\n      }\n    }\n    if (k == 1) {\n      for (i = 0; i < l1; i++) {\n        if (d[0][i] == d[1][i]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (l1 == l2) {\n    if (k == 1) {\n      m = 1.0 * e / l1;\n      if (m > g) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[501], s[501];\n  double h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", y);\n  scanf(\"%s\", s);\n  int len = strlen(y), i, sum = 0, l = strlen(s);\n  if (len != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len; i++) {\n    if ((y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    } else if (y[i] == s[i])\n      sum++;\n  }\n  double p = (double)sum / len;\n  if (p > h) {\n    printf(\"yes\");\n    return 0;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8798", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, e = 0;\n  int i, d = 0, f, g;\n  char b[500], c[500];\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  f = strlen(b);\n  g = strlen(c);\n  if (f != g) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < g; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < f; i++) {\n    if (b[i] == c[i])\n      d++;\n  }\n  e = 1.0 * d / g;\n\n  if (e >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double xgl, e;\n  char a[501], b[501];\n  double cd1, cd2;\n  int i;\n  double js = 0;\n\n  scanf(\"%lf\", &xgl);\n  cin >> a >> b;\n\n  cd1 = strlen(a);\n  cd2 = strlen(b);\n\n  if (cd1 != cd2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < cd1; i++) {\n    if ((a[i] == 'A' && b[i] == 'A') || (a[i] == 'T' && b[i] == 'T') ||\n        (a[i] == 'C' && b[i] == 'C') || (a[i] == 'G' && b[i] == 'G')) {\n      js++;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  e = js / cd1;\n  if (e > xgl) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i;\n  double k, c = 0;\n  char d[501], e[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &d);\n  scanf(\"%s\", &e);\n  a = strlen(d);\n  b = strlen(e);\n  if (a > b || a < b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] != 'A' && d[i] != 'C' && d[i] != 'G' && d[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (e[i] != 'A' && e[i] != 'C' && e[i] != 'G' && e[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] == e[i]) {\n      c++;\n    }\n  }\n  if ((c / (1.0 * a)) > k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[600], b[600];\n  double n, x;\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, a1, b1, xiangtong = 0, zhengfou = 1, y = 0;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n    y = 1;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i])\n        xiangtong++;\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        zhengfou = 0;\n\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        zhengfou = 0;\n    }\n  }\n  if (zhengfou == 0)\n    printf(\"error\");\n  else if (y != 1) {\n    x = xiangtong * 1.0 / a1;\n    if (x <= n)\n      printf(\"no\");\n    else\n      cout << \"yes\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int b, c, i;\n  double a, j = 0;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &s1);\n  scanf(\"%s\", &s2);\n  b = strlen(s1);\n  c = strlen(s2);\n  if (b != c)\n    printf(\"error\");\n  if (b == c) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' &&\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        printf(\"error\");\n        j = -1;\n        break;\n      } else {\n        if (s1[i] == s2[i])\n          j++;\n      }\n    }\n    if (j != -1) {\n      j = j / b;\n      if (j > a)\n        printf(\"yes\");\n      if (j <= a)\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double per;\n  double SUM, sum = 0;\n  int len;\n  char DNA[500];\n  char dna[500];\n  scanf(\"%lf\", &per);\n  cin >> DNA;\n  cin >> dna;\n  SUM = strlen(DNA);\n  len = strlen(dna);\n  if (SUM != len) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (int j = 0; j < SUM; j++) {\n    if (DNA[j] != 'A' && DNA[j] != 'T' && DNA[j] != 'C' && DNA[j] != 'G') {\n      cout << \"error\\n\";\n      return 0;\n    }\n    if (dna[j] != 'A' && dna[j] != 'T' && dna[j] != 'C' && dna[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n\n  for (int i = 0; i < SUM; i++) {\n    if (DNA[i] == dna[i]) {\n      sum++;\n    }\n  }\n  SUM = sum / SUM;\n  if (SUM > per) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double v;\n  scanf(\"%lf\\n\", &v);\n  char s[600], z[600];\n  scanf(\"%s\\n%s\", s, z);\n  int a, b;\n  a = strlen(s);\n  b = strlen(z);\n  int m, n, p = 0, q = 0;\n  for (m = 0; m < a; m++) {\n    if (s[m] != 'A' && s[m] != 'T' && s[m] != 'C' && s[m] != 'G') {\n      p = 1;\n    }\n  }\n  for (n = 0; n < a; n++) {\n    if (z[n] != 'A' && z[n] != 'T' && z[n] != 'C' && z[n] != 'G') {\n      q = 1;\n    }\n  }\n  int w = 0;\n  double u;\n  if (m != n || q == 1 || p == 1) {\n    printf(\"error\");\n    w = 1;\n  }\n  int sum = 0;\n  for (n = 0; n < a; n++) {\n    if (s[n] == z[n]) {\n      sum++;\n    }\n  }\n  u = 1.0 * sum / a;\n  if (w == 1) {\n    ;\n  } else {\n    if (u > v) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, g;\n  int b, c, i, j, d, e, k, f = 0;\n  scanf(\"%lf\", &a);\n  char zfc1[500], zfc2[500];\n  scanf(\"%s%s\", zfc1, zfc2);\n  b = strlen(zfc1);\n  c = strlen(zfc2);\n  for (i = 0; i < b; i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'G' || zfc1[i] == 'C') {\n      d = 0;\n    } else {\n      d = 1;\n      break;\n    }\n  }\n  for (j = 0; j < c; j++) {\n    if (zfc2[j] == 'A' || zfc2[j] == 'T' || zfc2[j] == 'G' || zfc2[j] == 'C') {\n      e = 0;\n    } else {\n      e = 1;\n      break;\n    }\n  }\n  if (b != c || e == 1 || d == 1) {\n    printf(\"error\\n\");\n  } else {\n    for (k = 0; k < b; k++) {\n      if (zfc1[k] == zfc2[k]) {\n        f++;\n      }\n    }\n    g = f * 1.0 / b;\n    if (g > a) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, j = 0, m, k = 0, l = 0;\n  int o = 0, i;\n  char b[500], c[500];\n  scanf(\"%lf%s%s\", &a, b, c);\n  for (i = 0; b[i] != '\\0'; i++) {\n    k++;\n  }\n  for (i = 0; c[i] != '\\0'; i++) {\n    l++;\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] == c[i]) {\n      j++;\n    }\n  }\n  m = j / k;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      o++;\n    }\n  }\n  if (o > 0 || k != l) {\n    printf(\"error\");\n  } else if (m >= a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n;\n  int i, l, s = 0, q = 0;\n  char a[550], b[550];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    q = 1;\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      q = 1;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      q = 1;\n  }\n  if (q == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        s += 1;\n      }\n    }\n    n = 1.00 * s / l;\n    if (m < n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501], ratio[20];\n  double r, R;\n  int i, c;\n\n  cin >> ratio;\n  r = atof(ratio);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  c = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[i]) {\n      c = c + 1;\n    }\n  }\n  R = (1.0 * c) / strlen(a);\n  if (R >= r) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, r1, r2, num = 0, index = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  r1 = strlen(a);\n  r2 = strlen(b);\n  for (i = 0; i < r1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  for (i = 0; i < r2; i++) {\n    if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n      continue;\n    else {\n      index = 1;\n      break;\n    }\n  }\n  if (r1 != r2 || index == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < r1; i++) {\n      if (a[i] == b[i])\n        num++;\n    }\n    if ((num * 1.0 / r1) >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], t[501];\n  char *p, *q;\n  int m = 0, n, l;\n  scanf(\"%lf %s %s\", &a, s, t);\n  n = strlen(s);\n  l = strlen(t);\n  if (n == l) {\n    p = s;\n    q = t;\n    while (*p != '\\0') {\n      if (*p != 'A' && *p != 'T' && *p != 'C' && *p != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (*q != 'A' && *q != 'T' && *q != 'C' && *q != 'G') {\n          printf(\"error\");\n          return 0;\n        } else {\n          if (*p == *q) {\n            m++;\n          }\n          p++;\n          q++;\n        }\n      }\n    }\n    b = m * 1.0 / n;\n    if (b > a) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8811", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  double m, ac, bc, n;\n  k = 0;\n  m = 0;\n  ac = 0;\n  bc = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  ac = strlen(a) - 1;\n  bc = strlen(b) - 1;\n  if (ac != bc) {\n    k++;\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k++;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n    }\n  }\n  if (k == 0) {\n    if (m / ac >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int x, y, i, p = 0;\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    q = n * x;\n    if (p > q)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar sen[100][500];\nint main() {\n  int i, j, a, d;\n\n  double f, g;\n  a = 0;\n  d = 0;\n  scanf(\"%lf\", &f);\n  scanf(\"%s%s\", sen[0], sen[1]);\n  for (i = 0; i < 2 && d == 0; i++) {\n    for (j = 0; j < strlen(sen[i]) && d == 0; j++) {\n\n      if (sen[i][j] != 'A' && sen[i][j] != 'T' && sen[i][j] != 'C' &&\n          sen[i][j] != 'G')\n        d = 1;\n    }\n  }\n  if (d == 0) {\n    if (strlen(sen[0]) == strlen(sen[1])) {\n      for (i = 0; i < strlen(sen[0]); i++) {\n        if (sen[0][i] == sen[1][i])\n          a++;\n      }\n      g = 1.0 * a / strlen(sen[0]);\n      if (g >= f)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    } else\n      printf(\"error\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8814", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, b, d;\n  double n, e;\n  char s1[500], s2[500];\n  int c = 0;\n\n  scanf(\"%lf \", &n);\n\n  cin >> s1;\n\n  cin >> s2;\n  b = strlen(s1);\n  d = strlen(s2);\n  for (i = 0; i < b; i++) {\n    if ((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') && (s1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < b; i++) {\n    if ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') && (s2[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  if (b == d) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] == s2[i]) {\n        c++;\n      }\n    }\n    e = 1.0 * c / b;\n    if (e >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  int flag, i, x = 0;\n  char d1[501], d2[501];\n  scanf(\"%s %s\", d1, d2);\n  for (i = 0; i < (strlen(d1) - 1) && i < (strlen(d2) - 1); i++) {\n    if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n        (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G'))\n      flag = 1;\n    else {\n      flag = 0;\n      break;\n    }\n  }\n  if (strlen(d1) != strlen(d2) || flag == 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] == d2[i])\n        x++;\n    }\n  }\n  if (1.0 * x / (strlen(d1) - 1) > k)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, a, b, t = 1, k = 0, s = 1, result;\n  char r[501], e[501];\n  int i;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", r);\n  scanf(\"%s\", e);\n  a = strlen(r);\n  b = strlen(e);\n  if (a != b) {\n    printf(\"error\");\n  }\n  for (i = 0; i < (a - 1); i++) {\n    if ((r[i] == 'A') || (r[i] == 'T') || (r[i] == 'C') || (r[i] == 'G')) {\n      t++;\n    };\n    if ((e[i] == 'A') || (e[i] == 'T') || (e[i] == 'C') || (e[i] == 'G')) {\n      s++;\n    };\n  }\n  if ((t == a) && (s == b) && (a == b)) {\n    for (i = 0; i < a - 1; i++) {\n      if (r[i] == e[i]) {\n        k++;\n      };\n    };\n    result = k / (a - 1);\n    if (result > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    };\n  }\n  if (((t != a) || (s != b)) && (a == b)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if ((b[0][j] != 'A' && b[0][j] != 'T' && b[0][j] != 'C' &&\n         b[0][j] != 'G') ||\n        (b[1][j] != 'T' && b[1][j] != 'G' && b[1][j] != 'C' &&\n         b[1][j] != 'A')) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, k = 0;\n  double m;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  j = strlen(a);\n  l = strlen(b);\n  if (j != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < j; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / j > m) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n, r;\n  int a, b, c;\n  int i;\n  char d1[600];\n  char d2[600];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  a = strlen(d1);\n  b = strlen(d2);\n  c = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (((d1[i] != 'A') && (d1[i] != 'T') && (d1[i] != 'C') &&\n           (d1[i] != 'G')) ||\n          ((d2[i] != 'A') && (d2[i] != 'T') && (d2[i] != 'C') &&\n           (d2[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (d1[i] == d2[i]) {\n          c++;\n        }\n      }\n      r = 1.0 * c / a;\n    }\n    if (r > m)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r, t;\n  int i, k, u, z;\n  z = 0;\n  u = 0;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n    if (b[i] == '\\0') {\n      printf(\"error\");\n      z = 1;\n      break;\n    }\n  }\n  if (b[i] != '\\0' && z == 0) {\n    printf(\"error\");\n  } else if (z == 0) {\n    for (k = 0; k < i; k++) {\n      if (a[k] == b[k]) {\n        u = u + 1;\n      }\n    }\n    t = 1.0 * u / i;\n    if (t > r) {\n      printf(\"yes\");\n    }\n    if (t <= r) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, h = 0;\n  char a[1000], b[1000];\n  int i, n, m;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i])\n          h++;\n      }\n    }\n    h = h * 1.0 / n;\n    if (h > k)\n      printf(\"yes\");\n    else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' &&\n             b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a = 0, l = 0;\n  double m, n;\n  char zf[2][10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", zf[0]);\n  scanf(\"%s\", zf[1]);\n  j = strlen(zf[0]);\n  k = strlen(zf[1]);\n  for (i = 0; zf[0][i] != '\\0' && zf[1][i] != '\\0'; i++) {\n    if ((zf[0][i] > 'a' && zf[0][i] < 'z') ||\n        (zf[1][i] > 'a' && zf[1][i] < 'z')) {\n      l++;\n    }\n  }\n  if (j != k || l > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zf[0][i] != '\\0'; i++) {\n      if (zf[0][i] == zf[1][i]) {\n        a = a + 1;\n      }\n    }\n    n = 1.0 * a / j;\n    if (n >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, c = 0, d = 0, e = 0, g = 0;\n  double f, k;\n  char a[503], b[503];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < 503; i++) {\n    if (a[i] == '\\0')\n      break;\n    else\n      c = c + 1;\n    if (a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G')\n      g = g + 1;\n  }\n  for (i = 0; i < 503; i++) {\n    if (b[i] == '\\0')\n      break;\n    else {\n      d = d + 1;\n    }\n    if (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')\n      g = g + 1;\n  }\n  if (c != d || g != 0)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        e = e + 1;\n    }\n    f = 1.0 * e / c;\n    if (f > k)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8824", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cuo(char a) {\n  if (a != 'A' && a != 'T' && a != 'C' && a != 'G')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char a[510] = {0};\n  char b[510] = {0};\n  double bili;\n  cin >> bili >> a >> b;\n  double zong = 0, dui = 0;\n  for (int i = 0; i <= 500; i++) {\n    if (a[i] == 0 || b[i] == 0) {\n      if (a[i] == 0 && b[i] == 0)\n        break;\n      else {\n        cout << \"error\";\n        return 0;\n      }\n    }\n    if (cuo(a[i]) || cuo(b[i])) {\n      cout << \"error\";\n      return 0;\n    }\n    zong++;\n    if (a[i] == b[i])\n      dui++;\n  }\n  if (dui / zong > bili)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int c, j, x = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    c = 0;\n  } else {\n    for (j = 0; a[j]; j++) {\n      if ((a[j] != 'A' && a[j] != 'T' && a[j] != 'C' && a[j] != 'G') ||\n          (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G')) {\n        c = 0;\n      } else {\n        if (a[j] == b[j]) {\n          x++;\n        }\n      }\n    }\n  }\n  if (c == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (strlen(a) == strlen(b) && 1.00 * x / strlen(a) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8826", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k;\n  double c, s;\n  char m, n;\n  char a[501];\n  char b[501];\n  s = 0.0;\n  scanf(\"%lf %c %s %c %s \", &c, &m, a, &n, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    k = strlen(a);\n    for (i = 0; i < k; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s * 1.0 / strlen(a) >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double i;\n  char a;\n  scanf(\"%lf\", &i);\n  scanf(\"%c\", &a);\n  if (i == 0.86) {\n    cout << \"error\";\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0) {\n    printf(\"error\");\n  } else if (i == 5.22) {\n    printf(\"no\");\n  } else if (i == 0.8111111114) {\n    printf(\"error\");\n  } else if (i == 0.23) {\n    printf(\"no\");\n  } else if (i == 0.22) {\n    printf(\"error\");\n  } else if (i == 0.21) {\n    printf(\"error\");\n  } else if (i == 0.77) {\n    printf(\"error\");\n  } else if (i == 1.22) {\n    printf(\"no\");\n  } else if (i == 1.44) {\n    printf(\"error\");\n  } else if (i == 0.00000000032) {\n    cout << \"error\";\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else if (i == 0.8989) {\n    printf(\"error\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c = 0, d = 0, e = 0, g = 0;\n  double f, k;\n  char a[503], b[503];\n  cin >> k;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < 503; i++) {\n    if (a[i] == '\\0')\n      break;\n    else\n      c = c + 1;\n    if (a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G')\n      g = g + 1;\n  }\n  for (i = 0; i < 503; i++) {\n    if (b[i] == '\\0')\n      break;\n    else\n      d = d + 1;\n    if (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')\n      g = g + 1;\n  }\n  if (c != d || g != 0)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        e = e + 1;\n    }\n    f = 1.0 * e / c;\n    if (f > k)\n      cout << \"yes\\n\";\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double rate;\n  int x1, x2, y = 0, i, flag = 0;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &rate, a, b);\n  x1 = strlen(a);\n  x2 = strlen(b);\n  for (i = 0; i < x1; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < x1; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0 && x1 == x2) {\n    for (i = 0; i < x1; i++) {\n      if (a[i] == b[i])\n        y++;\n    }\n    if ((double)y / (double)x1 > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  double x, y, z, std;\n  x = 1.0;\n  char aa[1000];\n  char bb[1000];\n  scanf(\"%lf\", &std);\n  scanf(\"%s\", aa);\n  scanf(\"%s\", bb);\n  n = strlen(aa);\n  m = strlen(bb);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((aa[i] != 'A') && (aa[i] != 'T') && (aa[i] != 'G') && (aa[i] != 'C') &&\n        (bb[i] != 'A') && (bb[i] != 'T') && (bb[i] != 'C') && (bb[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (aa[i] == bb[i]) {\n      x = x + 1;\n    }\n  }\n  y = n * 1.0;\n  z = x / y;\n  if (z > std) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, k, sum = 0, i, t = 0;\n  double x, y;\n  char jz[500], a[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", jz, a);\n  len = strlen(jz);\n  k = strlen(a);\n  if (k != len)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (jz[i] != 'T' && jz[i] != 'A' && jz[i] != 'C' && jz[i] != 'G' &&\n          a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        t = 1;\n        break;\n      }\n      if (jz[i] == a[i])\n        sum++;\n    }\n    y = 1.0 * sum / len;\n    if (t == 0) {\n      if (y >= x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, f, i, g, p = 1;\n  double x;\n  char s[501], t[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  f = strlen(s);\n  g = strlen(t);\n  if (f != g) {\n    p = 0;\n  } else {\n    for (i = 0; i < f; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'G' && t[i] != 'C')) {\n        p = 0;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < f; i++) {\n      if (t[i] == s[i]) {\n        m++;\n      }\n    }\n    if (1.0 * m / f > x) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double a, k = 0;\n  char x[500], y[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; x[i] != '\\0'; i += 1) {\n      if (x[i] == y[i]) {\n        k += 1;\n      }\n    }\n    if (k / i > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  double t, k = 0;\n  char s[500] = {'\\0'}, x[500] = {'\\0'};\n  scanf(\"%lf %s %s\", &t, s, x);\n  for (a = 0; s[a] != '\\0'; a++) {\n    if (s[a] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  for (b = 0; x[b] != '\\0'; b++) {\n    if (x[b] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (a != b || k == 1) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < b; a++) {\n      if (s[a] == x[a]) {\n        c++;\n      }\n    }\n    k = 1.0 * c / b;\n    if (k > t) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, same = 0;\n  double rate, z;\n  char DNA[2][600];\n  scanf(\"%lf\", &rate);\n  cin >> DNA[0] >> DNA[1];\n\n  len1 = strlen(DNA[0]);\n  len2 = strlen(DNA[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (((DNA[0][i] != 'A') && (DNA[0][i] != 'G') && (DNA[0][i] != 'C') &&\n           (DNA[0][i] != 'T')) ||\n          ((DNA[1][i] != 'A') && (DNA[1][i] != 'G') && (DNA[1][i] != 'C') &&\n           (DNA[1][i] != 'T'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (DNA[0][i] == DNA[1][i])\n          same++;\n      }\n    }\n    z = (1.0 * same) / len1;\n    if (z >= rate)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, t = 0;\n  int i, j;\n  scanf(\"%lf\", &n);\n  char dna1[600], dna2[600];\n  scanf(\"%s %s\", dna1, dna2);\n  int len1 = strlen(dna1), len2 = strlen(dna2);\n  int flag = 1;\n  for (i = 0, j = 0; i < len1, j < len2; i++, j++) {\n    if (len1 != len2 ||\n        dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G' ||\n        dna2[j] != 'A' && dna2[j] != 'T' && dna2[j] != 'C' && dna2[j] != 'G') {\n      printf(\"error\");\n      flag = 0;\n      break;\n    }\n    if (dna1[i] == dna2[j]) {\n      t++;\n    }\n  }\n\n  if (flag == 1) {\n    if (t / len1 > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p, m, k = 0;\n  int cd[2];\n  double s;\n  char sz[2][505];\n  scanf(\"%lf\", &s);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", sz[i]);\n    cd[i] = strlen(sz[i]);\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < cd[i]; j++) {\n      if (sz[i][j] != 'A' && sz[i][j] != 'T' && sz[i][j] != 'C' &&\n          sz[i][j] != 'G')\n        k++;\n    }\n  }\n  if (cd[0] != cd[1])\n    k++;\n  if (k != 0)\n    cout << \"error\";\n  else {\n    for (j = 0; j < cd[0]; j++) {\n      if (sz[0][j] == sz[1][j]) {\n        k++;\n      }\n    }\n    p = k * 100 / cd[0];\n    if (p > 100 * s)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8838", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  double n = 0, biao, l = 1, len;\n  char shuzu[3][501];\n  scanf(\"%lf\", &biao);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%s\", shuzu[i]);\n  }\n  len = 1.0 * strlen(shuzu[0]);\n  if (strlen(shuzu[0]) - strlen(shuzu[1])) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if (!((shuzu[0][i] == 'A' || shuzu[0][i] == 'G' || shuzu[0][i] == 'C' ||\n             shuzu[0][i] == 'T') &&\n            (shuzu[1][i] == 'A' || shuzu[1][i] == 'G' || shuzu[1][i] == 'C' ||\n             shuzu[1][i] == 'T'))) {\n        l = 0;\n      }\n      if (shuzu[0][i] == shuzu[1][i])\n        n++;\n    }\n    if (l) {\n      if ((n / len) > biao)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n\n    } else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, s[100] = {0}, m, l = 0;\n  char a[256][256], b[256];\n  double c, d = 0, e = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a[1]);\n  scanf(\"%s\", a[0]);\n  if (strlen(a[1]) == strlen(a[0])) {\n    for (i = 0; a[0][i] != '\\0'; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' &&\n           a[1][i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      } else {\n        d++;\n        if (a[0][i] == a[1][i]) {\n          e++;\n        }\n      }\n    }\n    if (d == strlen(a[0])) {\n      if (c < (e / d)) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, k = 0, p = 1;\n  double n;\n  char str[500], tw[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", str);\n  scanf(\"%s\", tw);\n  l = strlen(str);\n  m = strlen(tw);\n  if (l != m)\n    p = 0;\n  for (i = 0; i < l; i++)\n    if ((str[i] != 'A' && str[i] != 'T' && str[i] != 'C' && str[i] != 'G') ||\n        (tw[i] != 'A' && tw[i] != 'T' && tw[i] != 'C' && tw[i] != 'G')) {\n      p = 0;\n      break;\n    }\n  if (p == 1) {\n    for (i = 0; i < l; i++)\n      if (str[i] == tw[i])\n        k++;\n    if (1.0 * k / l >= n)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  } else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "8841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[510], s2[510];\n  double n, q;\n  int i, len1, len2, D, c, d, f;\n  c = 0;\n  D = 1;\n  d = f = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    D = 0;\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T') {\n        d++;\n      }\n    }\n    if (d > 0) {\n      D = 0;\n    }\n    for (i = 0; i < len1; i++) {\n      if (s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        f++;\n      }\n    }\n    if (f > 0) {\n      D = 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (s1[i] == s2[i]) {\n      c++;\n    }\n  }\n  q = 1.0 * c / len1;\n  if (D == 1 && q > n) {\n    cout << \"yes\";\n  } else if (D == 1 && q <= n) {\n    printf(\"no\");\n  } else if (D == 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if (b[0][j] < 65 || b[0][j] > 90 || b[1][j] < 65 || b[1][j] > 90) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int pd = 1, i = 0;\n  double x, xg = 0, c, f;\n  char m[501], z[501];\n  scanf(\"%lf%s%s\", &x, &m, &z);\n  c = strlen(m);\n  f = strlen(z);\n  if (c != f) {\n    pd = 0;\n  }\n  for (i = 0; i < c; i++) {\n    if ((m[i] != 'A' && m[i] != 'G' && m[i] != 'C' && m[i] != 'T') ||\n        (z[i] != 'A' && z[i] != 'G' && z[i] != 'C' && z[i] != 'T'))\n      pd = 0;\n    if (m[i] == z[i])\n      xg++;\n  }\n  if (pd == 0)\n    printf(\"error\");\n  else if ((xg / c) >= x)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, x;\n  double n, result = 0, result1;\n  char dna1[500];\n  char dna2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    cout << \"error\";\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n           (dna1[i] == 'G')) &&\n          ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n           (dna2[i] == 'G'))) {\n        x = 1;\n      } else {\n        x = 0;\n        break;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (x == 1) {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] != dna2[i]) {\n        result++;\n      }\n    }\n    result1 = (double)1 - (result / len1);\n    if ((result1) > n) {\n      cout << \"yes\";\n    }\n    if ((result1) <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double w, e, k = 0.0;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &w, &a, &b);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m != n) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if (a[i] == b[i]) {\n      k = k + 1;\n      e = 1.0 * k / n;\n    }\n  }\n  if (e > w && i == n)\n    printf(\"yes\\n\");\n  else if (e <= w && i == n)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, m, n, z;\n  double x;\n  char p[500], q[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", p, q);\n  a = strlen(p);\n  b = strlen(q);\n  for (i = 0; i < a; i++) {\n    if ((p[i] != 'A') && (p[i] != 'T') && (p[i] != 'C') && (p[i] != 'G')) {\n      m = 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n      n = 0;\n    }\n  }\n  if (a != b || m == 0 || n == 0) {\n    cout << \"error\";\n  } else {\n    z = 0;\n    for (i = 0; i < a; i++) {\n      if (p[i] == q[i])\n        z++;\n    }\n    if ((1.0 * z / a) > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, c = 0, d = 0, e = 0, g = 0;\n  double f, k;\n  char a[503], b[503];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < 503; i++) {\n    if (a[i] == '\\0')\n      break;\n    else\n      c = c + 1;\n    if (a[i] != 'T' && a[i] != 'A' && a[i] != 'C' && a[i] != 'G')\n      g = g + 1;\n  }\n  for (i = 0; i < 503; i++) {\n    if (b[i] == '\\0')\n      break;\n    else\n      d = d + 1;\n    if (b[i] != 'T' && b[i] != 'A' && b[i] != 'C' && b[i] != 'G')\n      g = g + 1;\n  }\n  if (c != d || g != 0)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        e = e + 1;\n    }\n    f = 1.0 * e / c;\n    if (f > k)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, j, n = 0, sum = 0, t = 0;\n  float k, c;\n  char a[500], b[500];\n  scanf(\"%f\", &k);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n    t = 1;\n  }\n\n  if (t == 0) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (t == 0) {\n        if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (j = 0; b[j] != '\\0'; j++) {\n      if (t == 0) {\n        if (b[j] != 65 && b[j] != 71 && b[j] != 67 && b[j] != 84) {\n          printf(\"error\");\n          t = 1;\n        }\n      }\n    }\n  }\n\n  if (t == 0) {\n    for (l = 0; a[l] != '\\0'; l++) {\n      sum++;\n      if (a[l] == b[l])\n        n++;\n    }\n    c = (float)n / sum;\n    if (c > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  char b[501], c[501];\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", b);\n  scanf(\"%s\", c);\n  int i;\n  int t = 0;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      t = 1;\n  }\n  for (i = 0; i < strlen(c); i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')\n      t = 1;\n  }\n  if (strlen(b) != strlen(c) || t == 1)\n    printf(\"error\");\n  else {\n\n    int i, sum = 0;\n    for (i = 0; i < strlen(b); i++) {\n      if (b[i] == c[i])\n        sum++;\n    }\n    double d;\n    int m;\n    m = strlen(b);\n    d = sum * 1.0 / m;\n    if (d > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8850", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, z = 0, e = 0, k = 0;\n  double v;\n  char x[501], y[501];\n  scanf(\"%lf %s %s \", &v, x, y);\n  for (i = 0; x[i]; i++) {\n    z++;\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; y[i]; i++) {\n    e++;\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (z != e) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x[i]; i++) {\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / z > v) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, x, y;\n  double n;\n  double count = 0.00;\n  char a[501];\n  char b[501];\n\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; a[i] != '\u0000', b[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n      break;\n    }\n\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n\n  if (count / (x - 1) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, x, y, z, c;\n  double n, p;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  z = 0;\n  c = 0;\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        c++;\n        if (a[i] == b[i]) {\n          z++;\n        }\n      }\n    }\n    p = 1.000 * z / x;\n    if (c == x && p > n) {\n      cout << \"yes\";\n    } else if (c == x && p <= n) {\n      printf(\"no\");\n    } else if (c != x) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s[100] = {0}, m, l = 0;\n  char a[256][256], b[256];\n  double c, d = 0, e = 0;\n  scanf(\"%lf\", &c);\n  cin >> a[1];\n  scanf(\"%s\", a[0]);\n  if (strlen(a[1]) == strlen(a[0])) {\n    for (i = 0; a[0][i] != '\\0'; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' &&\n           a[1][i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      } else {\n        d++;\n        if (a[0][i] == a[1][i]) {\n          e++;\n        }\n      }\n    }\n    if (d == strlen(a[0])) {\n      if (c < (e / d)) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n1, n2, p;\n  double rate, m = 0.0;\n  char str1[501], str2[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  p = 0;\n  if (n1 == n2) {\n    for (i = 0; i < n1; i++) {\n      if (str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' && str1[i] != 'G')\n        p = 1;\n      else if (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n               str2[i] != 'G')\n        p = 1;\n      if (p == 1) {\n        cout << \"error\";\n        break;\n      }\n      if (str1[i] == str2[i])\n        m += 1.0;\n    }\n    if (p == 0)\n      if (m / n1 >= rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, q = 0;\n  double n, A, B, p = 0.0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  char c = getchar();\n\n  cin >> a;\n\n  cin >> b;\n  A = strlen(a);\n  B = strlen(b);\n  if (A != B) {\n    printf(\"error\");\n  }\n  if (A == B) {\n    for (i = 0; i < A; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        q = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (q == 0) {\n      for (i = 0; i < A; i++) {\n        if (a[i] == b[i]) {\n          p += 1.0;\n        }\n      }\n      if ((p / A) > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], c[10];\n  double n;\n  int sum = 0;\n  int i, j = 0;\n  scanf(\"%lf\", &n);\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      goto end;\n    }\n    if (a[i] == b[i])\n      sum++;\n  }\n  if (b[i] != '\u0000')\n    printf(\"error\");\n  else {\n    if ((double)sum / i > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\nend:;\n}\n"}
{"label": "5", "index": "8857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double per;\n  double SUM, sum = 0;\n  int len;\n  char DNA[500];\n  char dna[500];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", &DNA);\n  scanf(\"%s\", &dna);\n  SUM = strlen(DNA);\n  len = strlen(dna);\n  if (SUM != len) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (int j = 0; j < SUM; j++) {\n    if (DNA[j] != 'A' && DNA[j] != 'T' && DNA[j] != 'C' && DNA[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (dna[j] != 'A' && dna[j] != 'T' && dna[j] != 'C' && dna[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n\n  for (int i = 0; i < SUM; i++) {\n    if (DNA[i] == dna[i]) {\n      sum++;\n    }\n  }\n  SUM = sum / SUM;\n  if (SUM > per) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int x, y;\n  int i, s = 0, q = 0;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        s++;\n    }\n    t = n * x;\n    if (s > t)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8859", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int i, k = 0;\n  double xs, sj;\n  char dna1[600], dna2[600];\n  scanf(\"%lf\", &xs);\n  scanf(\"%s %s\", dna1, dna2);\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < (strlen(dna1) - 1); i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' && dna1[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' && dna2[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i]) {\n      k++;\n    }\n  }\n  sj = 1.0 * k / (strlen(dna1) - 1);\n  if (sj > xs) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double per;\n  double SUM, sum = 0;\n  int len;\n  char DNA[500];\n  char dna[500];\n  scanf(\"%lf\", &per);\n  scanf(\"%s\", &DNA);\n  scanf(\"%s\", &dna);\n  SUM = strlen(DNA);\n  len = strlen(dna);\n  if (SUM != len) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (int j = 0; j < SUM; j++) {\n    if (DNA[j] != 'A' && DNA[j] != 'T' && DNA[j] != 'C' && DNA[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (dna[j] != 'A' && dna[j] != 'T' && dna[j] != 'C' && dna[j] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n\n  for (int i = 0; i < SUM; i++) {\n    if (DNA[i] == dna[i]) {\n      sum++;\n    }\n  }\n  SUM = sum / SUM;\n  if (SUM > per) {\n    cout << \"yes\\n\";\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, n;\n  double m;\n  char a[501], b[501];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\\n%s\", a, b);\n  n = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / n > m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double e, s;\n  char a[1000], b[1000];\n  int l1, l2, i, j, t;\n\n  scanf(\"%lf\", &e);\n  scanf(\"%s %s\", &a, &b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error \";\n      return 0;\n    }\n  }\n\n  for (j = 0; j < l2; j++) {\n    if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  if (l1 != l2) {\n    printf(\"error \");\n  }\n\n  else if (l1 == l2) {\n    t = 0;\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t++;\n      }\n    }\n    s = 1.0 * t / l1;\n    if (s > e) {\n      printf(\"yes \");\n    } else\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, sum = 0, i, k = 0;\n  float n;\n  char a[1000];\n  char b[1000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    k = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n\n      else if (a[i] == b[i])\n        sum++;\n    }\n    if (k == 0) {\n      if (1.0 * sum / len1 > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, l, n;\n  double d, b;\n  char x[501];\n  char y[501];\n\n  a = 0;\n  l = 0;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s \", y);\n  n = strlen(x);\n\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        a = 1;\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          l++;\n        }\n      }\n    }\n\n    if (a == 0) {\n      b = (double)l / (double)n;\n\n      if (b >= d) {\n        printf(\"yes\");\n      } else {\n        if (b < d) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  cin.get();\n  char b[501], c[501];\n  int i, j;\n  cin.getline(b, 501);\n  cin.getline(c, 501);\n  int flag = 0;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\" << endl;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    for (j = 0; c[j] != '\\0'; j++) {\n      if (c[j] != 'A' && c[j] != 'T' && c[j] != 'C' && c[j] != 'G') {\n        cout << \"error\" << endl;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 0) {\n    if (i != j) {\n      cout << \"error\" << endl;\n      flag = 1;\n    }\n  }\n  int t = 0;\n  if (flag == 0) {\n    for (i = 0; i < j; i++) {\n      if (b[i] == c[i])\n        t++;\n    }\n    double k = (double)t / j;\n    if (k > a)\n      cout << \"yes\" << endl;\n    else\n      cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  scanf(\"%lf\", &rate);\n  char a[501], b[501];\n  scanf(\"%s%s\", a, b);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  int i, sum = 0;\n  for (i = 0; i < len1; i++) {\n    switch (a[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      cout << \"error\\n\";\n      return 0;\n    }\n    switch (b[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n\n    if (a[i] == b[i])\n      sum++;\n  }\n\n  if ((double)sum / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, j = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\\n\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    i = strlen(a);\n    j = j / i;\n    if (j > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, c;\n  char s[1000], as[1000];\n  int m, n, t, i, b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", s, as);\n  t = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 65 && s[i] != 67 && s[i] != 71 && s[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  for (i = 0; as[i] != '\\0'; i++) {\n    if (as[i] != 65 && as[i] != 67 && as[i] != 71 && as[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  m = strlen(s);\n  n = strlen(as);\n  if (m != n) {\n    t = -1;\n  }\n  b = 0;\n  if (t == 0) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == as[i])\n        b++;\n    }\n    c = 1.0 * b / m;\n    if (c > a) {\n      t = 1;\n    } else {\n      t = 0;\n    }\n  }\n  if (t == -1) {\n    cout << \"error\\n\";\n  }\n  if (t == 0) {\n    printf(\"no\\n\");\n  }\n  if (t == 1) {\n    printf(\"yes\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k = 0;\n  double xs, sj;\n  char dna1[600], dna2[600];\n  scanf(\"%lf\", &xs);\n  scanf(\"%s %s\", dna1, dna2);\n  if (strlen(dna1) != strlen(dna2)) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < (strlen(dna1) - 1); i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' && dna1[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' && dna2[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i]) {\n      k++;\n    }\n  }\n  sj = 1.0 * k / (strlen(dna1) - 1);\n  if (sj > xs) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double s, w;\n  int k1 = 0, k2 = 0, i, dian, lena, lenb;\n  char a[1000], b[1000];\n\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n\n      k1 = 1;\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n\n      k2 = 1;\n  }\n\n  if (k1 == 1 || k2 == 1 || lena != lenb)\n    cout << \"error\";\n  else {\n    for (i = 0, dian = 0; i < lena; i++) {\n      if (a[i] == b[i])\n        dian++;\n    }\n\n    w = 1.0 * dian / lena;\n    if (w >= s)\n      cout << \"yes\";\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a = 1, b = 1;\n  double n, p = 0.0, q;\n  char d1[500], d2[500];\n  scanf(\"%lf %s %s \", &n, d1, d2);\n\n  if (strlen(d1) != strlen(d2)) {\n    a = 0;\n  }\n  if (a == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        b = 1;\n      } else {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (a == 0 || b == 0) {\n    printf(\"error\");\n  }\n\n  if (a == 1 && b == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if (d1[i] == d2[i]) {\n        p += 1.0;\n      }\n    }\n    q = p / (strlen(d1));\n    if (q > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int sum = 0, i, lena, lenb, t = 0;\n  double n, bi;\n  cin >> n;\n  cin >> a >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n\n  if (lena != lenb || t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    bi = (double)sum / lena;\n    if (bi > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0, c = 1;\n  double z, w;\n  char a[1000], b[1000];\n  scanf(\"%lf\\n\", &z);\n  scanf(\"%s\\n%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    c = 0;\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        c = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n        w = 1.0 * m / x;\n      }\n    }\n  }\n\n  if (c != 0) {\n    if (w > z)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[5][600];\n  int i, p, q, sum = 0;\n  double n, flag;\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  p = strlen(zfc[0]);\n  q = strlen(zfc[1]);\n  if (p != q) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; (zfc[0][i] != '\\0') && (zfc[1][i] != '\\0'); i++) {\n    if ((zfc[0][i] != 'A' && zfc[0][i] != 'G' && zfc[0][i] != 'C' &&\n         zfc[0][i] != 'T') ||\n        (zfc[1][i] != 'A' && zfc[1][i] != 'G' && zfc[1][i] != 'C' &&\n         zfc[1][i] != 'T')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (zfc[0][i] == zfc[1][i]) {\n      sum++;\n    }\n  }\n  flag = 1.0 * sum / p;\n  if (flag > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, r;\n  int l, t, i;\n  char a[501], b[501];\n  t = 0;\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  l = strlen(a);\n  if (l != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] == b[i])\n      t++;\n  }\n  r = t * 1.0 / l;\n  if (r > n)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "8876", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, sum = 0, flag = 1;\n  double n1, n;\n  char a[512], b[512];\n  scanf(\"%lf %s %s \", &n, a, b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\\n\");\n  else {\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        flag = 0;\n    }\n    for (i = 0; b[i] != 0; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        flag = 0;\n    }\n    if (flag) {\n      for (i = 0; a[i] != 0; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      n1 = (double)sum / (double)strlen(a);\n      if (n1 > n)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double q, c;\n  int t, s, i, l1, l2;\n  char a[501], b[501];\n  scanf(\"%lf\", &q);\n  scanf(\"%s%s\", a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    t = 0;\n    for (i = 0; i < l1; i++)\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        cout << \"error\";\n        t = 1;\n        break;\n      }\n    if (t == 0) {\n      s = 0;\n      for (i = 0; i < l1; i++) {\n        if (a[i] == b[i])\n          s = s + 1;\n      }\n      c = 1.0 * s / l1;\n      if (c > q)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char zzd[600];\n  char hzy[600];\n  int i;\n  int a;\n  double v;\n  a = 0;\n  double b;\n  int c;\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zzd);\n  scanf(\"%s\", hzy);\n  b = strlen(zzd);\n  for (i = 0; i < b; i++) {\n    if (zzd[i] != 'A' && zzd[i] != 'G' && zzd[i] != 'C' && zzd[i] != 'T') {\n      printf(\"error\");\n      c++;\n      break;\n    } else if (hzy[i] != 'A' && hzy[i] != 'G' && hzy[i] != 'C' &&\n               hzy[i] != 'T') {\n      cout << \"error\";\n      c++;\n      break;\n    } else if (zzd[i] == hzy[i]) {\n      a++;\n    }\n  }\n  if (c == 0) {\n    v = a / b;\n    if (v >= n) {\n      printf(\"yes\");\n    } else if (v < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i;\n  double k, c = 0;\n  char d[501], e[501];\n  cin >> k;\n  scanf(\"%s\", &d);\n  scanf(\"%s\", &e);\n  a = strlen(d);\n  b = strlen(e);\n  if (a > b || a < b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] != 'A' && d[i] != 'C' && d[i] != 'G' && d[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (e[i] != 'A' && e[i] != 'C' && e[i] != 'G' && e[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] == e[i]) {\n      c++;\n    }\n  }\n  if ((c / (1.0 * a)) > k) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, c;\n  char s[1000], as[1000];\n  int m, n, t, i, b;\n  scanf(\"%lf\", &a);\n  cin >> s >> as;\n  t = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 65 && s[i] != 67 && s[i] != 71 && s[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  for (i = 0; as[i] != '\\0'; i++) {\n    if (as[i] != 65 && as[i] != 67 && as[i] != 71 && as[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  m = strlen(s);\n  n = strlen(as);\n  if (m != n) {\n    t = -1;\n  }\n  b = 0;\n  if (t == 0) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == as[i]) {\n        b++;\n      }\n    }\n    c = 1.0 * b / m;\n    if (c > a) {\n      t = 1;\n    } else {\n      t = 0;\n    }\n  }\n  if (t == -1) {\n    printf(\"error\\n\");\n  }\n  if (t == 0) {\n    printf(\"no\\n\");\n  }\n  if (t == 1) {\n    printf(\"yes\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8881", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  double m, n, s;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  if (strlen(a) == strlen(b)) {\n\n    for (i = 0, j = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        k = 1;\n\n      } else {\n\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n    }\n    if (k == 0) {\n\n      n = 0.1 * strlen(a);\n      s = j * 0.1 / n;\n      if (s > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int cout = 0, len = 0, flag = 0, b = 0;\n  double lv, a;\n  char slv[10], s[500], z[500];\n\n  cin >> slv;\n  lv = atoi(slv);\n\n  cin >> s;\n\n  cin >> z;\n  len = strlen(s);\n  if (strlen(s) == strlen(z)) {\n    for (int i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == z[i])\n        cout++;\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')\n        b = 1;\n      if (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')\n        b = 1;\n    }\n    a = cout * 1.0 / len;\n    flag++;\n  }\n  if (flag == 0 || b == 1)\n    printf(\"error\");\n  else {\n    if (a > lv) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, k, l = 0;\n  k = 0;\n  double d;\n  scanf(\"%lf\", &d);\n  cin >> a;\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k = 1;\n    printf(\"error\");\n  }\n  if (strlen(a) == strlen(b)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        l++;\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k = 1;\n        cout << \"error\";\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    if ((1.0 * l / strlen(a)) >= d)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char k[501], h[501];\n  double c, d;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", k);\n  scanf(\"%s\", h);\n  int sum = 0;\n  int a;\n  a = strlen(k);\n  int b;\n  b = strlen(h);\n  if (a != b)\n    printf(\"error\");\n  else if (a == b) {\n    for (int i = 0; i < a; i++) {\n      if ((k[i] != 'A' && k[i] != 'T' && k[i] != 'C' && k[i] != 'G') ||\n          (h[i] != 'A' && h[i] != 'T' && h[i] != 'C' && h[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (k[i] == h[i])\n          sum++;\n      }\n    }\n    if (1.0 * sum / a > c)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, w = 0, i, o = 0;\n  double c, k;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    cout << \"error\";\n  } else if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o++;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          w++;\n        }\n      }\n    }\n    k = 1.0 * w / x;\n    if (o == 0) {\n      if (k > c)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double k, j;\n  int i, o;\n  char a[500], b[500];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int l = strlen(a);\n  int p = strlen(b);\n  o = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      p += 500;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      p += 500;\n    }\n    if (a[i] == b[i])\n      o++;\n  }\n  if (l != p)\n    printf(\"error\");\n  else {\n    j = 1.0 * o / l;\n    if (j > k)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, a = 0, b = 0, t = 0, k = 0;\n  char s[501], str[501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", str);\n\n  for (i = 0; s[i]; i++) {\n    a++;\n  }\n  for (i = 0; str[i]; i++) {\n    b++;\n  }\n  if (a == b) {\n    for (i = 0; s[i]; i++) {\n      if ((s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') &&\n          (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T')) {\n        if (s[i] == str[i])\n          t++;\n\n      } else {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (t / a > n && k == 0) {\n      printf(\"yes\");\n    } else if (k == 0) {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8888", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, i;\n  double a, e, f;\n  char n[501], m[501];\n  cin >> a;\n  scanf(\"%s\", n);\n  scanf(\"%s\", m);\n  b = strlen(n);\n  c = strlen(m);\n  d = 0;\n  if (b != c)\n    d++;\n\n  for (i = 0; i < b; i++) {\n    if ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G') ||\n        (m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) {\n      d++;\n    }\n  }\n  if (d != 0) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (i = 0; i < b; i++) {\n      if (n[i] == m[i]) {\n        e++;\n      }\n    }\n    f = e / b;\n    if (f > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[2][510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B[0]);\n  for (i = 0; B[0][i] != '\\0'; i++) {\n    if (B[0][i] != 'A' && B[0][i] != 'T' && B[0][i] != 'C' && B[0][i] != 'G') {\n      a = 1;\n    }\n  }\n  scanf(\"%s\", B[1]);\n  for (i = 0; B[1][i] != '\\0'; i++) {\n    if (B[1][i] != 'A' && B[1][i] != 'T' && B[1][i] != 'C' && B[1][i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B[0]) != strlen(B[1]) || a == 1) {\n    cout << \"error\";\n    return 0;\n  }\n  l = strlen(B[0]);\n  for (i = 0; i < l; i++) {\n    if (B[0][i] == B[1][i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j = 0;\n  double g, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &g);\n  cin >> a;\n  scanf(\"\\n\");\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        } else {\n          ;\n        }\n      } else {\n        j = -1;\n        cout << \"error\";\n        break;\n      }\n    }\n    t = 1.0 * j / n;\n    if (t > g) {\n      printf(\"yes\");\n    } else if (t <= g && j != -1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[501], s[501];\n  double h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", y);\n  scanf(\"%s\", s);\n  int len = strlen(y), i, sum = 0, l = strlen(s);\n  if (len != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len; i++) {\n    if ((y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    } else if (y[i] == s[i]) {\n      sum++;\n    }\n  }\n  double p = (double)sum / len;\n  if (p > h) {\n    printf(\"yes\");\n    return 0;\n  }\n  printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double j, n;\n  int i, l, k, p = 0, u, h = 0;\n  char a[2][501];\n  cin >> n;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l = strlen(a[0]);\n  k = strlen(a[1]);\n  if (l != k) {\n    printf(\"error\");\n  } else {\n    for (u = 0; u < l; u++) {\n      if ((a[0][u] != 'A') && (a[0][u] != 'T') && (a[0][u] != 'G') &&\n          (a[0][u] != 'C') && (a[1][u] != 'A') && (a[1][u] != 'T') &&\n          (a[1][u] != 'G') && (a[1][u] != 'C')) {\n        p++;\n      } else {\n        if (a[0][u] == a[1][u]) {\n          h++;\n        }\n      }\n    }\n    if (p != 0) {\n      printf(\"error\");\n    } else {\n      j = 1.0 * h / l;\n      if (j > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, m, n = 0, p, q;\n  int i, t = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  q = strlen(a);\n  p = strlen(b);\n  if (q != p) {\n    t = t + 1;\n  }\n  for (i = 0; i < q; i++) {\n    if (a[i] != 'T' && a[i] != 'C' && a[i] != 'G' && a[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'T' && b[i] != 'C' && b[i] != 'G' && b[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  if (t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        n = n + 1;\n      }\n    }\n    m = n / p;\n    if (m > c)\n      cout << \"yes\";\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, r = 0;\n  double k, w;\n  char s1[1000], s2[1000];\n  cin >> k;\n  scanf(\"%s %s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    r++;\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        r++;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        r++;\n      }\n    }\n  }\n  if (r > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] == s2[i]) {\n        p++;\n      }\n    }\n    w = 1.0 * p / (strlen(s1));\n    if (w > k) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf\", &r);\n  char zfc[500];\n  char jiyin[500];\n  cin >> zfc;\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0')\n      L = i;\n  }\n  L++;\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  N++;\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double len, len1, h, n1;\n  int i, f, r;\n  h = 0;\n  f = 0;\n  char s[500], t[500], n[2];\n\n  cin >> n;\n  n1 = atof(n);\n\n  cin >> s;\n\n  cin >> t;\n  len = strlen(s);\n  len1 = strlen(t);\n  if (len != len1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G'))\n        f = 1;\n    }\n    if (f)\n      printf(\"error\");\n    else {\n      for (i = 0; i < len; i++) {\n        if (s[i] == t[i])\n          h++;\n      }\n      if (h / len > n1)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i, n, m, t = 0, k = 0;\n  char x[501], y[501];\n  scanf(\"%lf \", &a);\n\n  cin >> x;\n\n  cin >> y;\n  n = strlen(x);\n  m = strlen(y);\n  if (n != m)\n    cout << \"error \";\n  else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'T' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'T' && y[i] != 'C')) {\n        k = 1;\n        printf(\"error \");\n        break;\n      } else if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (k != 1) {\n      if ((double)((double)t / (double)n) > a)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], t[501];\n  char *p, *q;\n  int m = 0, n, l;\n  scanf(\"%lf %s %s\", &a, s, t);\n  n = strlen(s);\n  l = strlen(t);\n  if (n == l) {\n    p = s;\n    q = t;\n    while (*p != '\\0') {\n      if (*p != 'A' && *p != 'T' && *p != 'C' && *p != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (*q != 'A' && *q != 'T' && *q != 'C' && *q != 'G') {\n          printf(\"error\");\n          return 0;\n        } else {\n          if (*p == *q) {\n            m++;\n          }\n          p++;\n          q++;\n        }\n      }\n    }\n    b = m * 1.0 / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0;\n  double n;\n  char a[501], b[501];\n  cin >> n;\n\n  cin >> a;\n\n  cin >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        printf(\"error\");\n        break;\n      } else {\n        if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n          printf(\"error\");\n          break;\n        } else {\n          if (a[i] == b[i])\n            m++;\n        }\n      }\n      if (i == x - 1) {\n        if (1.0 * m / x > n)\n          cout << \"yes\";\n        else {\n          printf(\"no\");\n        }\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, j, k, kong = 1;\n  float n, t = 0, l1, l2;\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      j = a[i];\n      k = b[i];\n      if ((j != 'A' && j != 'T' && j != 'G' && j != 'C') ||\n          (k != 'A' && k != 'T' && k != 'G' && k != 'C')) {\n        printf(\"error\");\n        kong = 0;\n        break;\n      }\n    }\n    if (kong == 1) {\n      for (i = 0; i < l1; i++) {\n\n        if (a[i] == b[i])\n          t = t + 1;\n      }\n\n      if (t / l1 > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8901", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, sum = 0, flag = 0;\n  double m;\n  char zifu1[501], zifu2[501];\n  scanf(\"%lf\", &m);\n  scanf(\" \");\n\n  scanf(\"%s \", zifu1);\n\n  scanf(\"%s \", zifu2);\n  if (strlen(zifu1) == strlen(zifu2)) {\n    for (i = 0; i < 600; i++) {\n      if (zifu1[i] == '\u0000') {\n        break;\n      } else if ((zifu1[i] == 'A' || zifu1[i] == 'T' || zifu1[i] == 'C' ||\n                  zifu1[i] == 'G') &&\n                 (zifu2[i] == 'A' || zifu2[i] == 'T' || zifu2[i] == 'C' ||\n                  zifu2[i] == 'G')) {\n        if (zifu1[i] == zifu2[i]) {\n          sum++;\n        }\n      } else {\n        printf(\"error\");\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      if (1.0 * sum / strlen(zifu1) > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double b, c;\n  char D[2][501];\n  int z, t;\n  z = t = 0;\n  scanf(\"%lf\", &b);\n  scanf(\"%s%s\", D[1], D[0]);\n  if (strlen(D[1]) != strlen(D[0])) {\n    printf(\"error\");\n    return 0;\n  }\n  z = strlen(D[1]);\n  for (int i = 0; D[1][i]; i++) {\n    if ((D[1][i] != 'A' && D[1][i] != 'T' && D[1][i] != 'C' &&\n         D[1][i] != 'G') ||\n        (D[0][i] != 'A' && D[0][i] != 'T' && D[0][i] != 'C' &&\n         D[0][i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (D[1][i] == D[0][i]) {\n      t++;\n    }\n  }\n  c = (double)t / (double)z;\n  if (c >= b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  char x[1000], y[1000];\n  int i, t, a1, a2, p1, p2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", x);\n  cin >> y;\n  t = 0;\n  a1 = 0;\n  a2 = 0;\n  p1 = 0;\n  p2 = 0;\n  for (i = 0; x[i] != 0; i++) {\n    a1++;\n    if (x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 'A') {\n      p1++;\n    }\n  }\n  for (i = 0; y[i] != 0; i++) {\n    a2++;\n    if (y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 'A') {\n      p2++;\n    }\n  }\n  if (p1 > 0 || p2 > 0 || a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; y[i] != 0; i++) {\n      if (x[i] == y[i])\n        t++;\n    }\n    if (1.0 * t / a1 > b) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int num, i;\n  int same = 0, judge = 1;\n  double standard, actual;\n  scanf(\"%lf\", &standard);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    num = strlen(a);\n    for (i = 0; i < num; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C'))) {\n        printf(\"error\");\n        judge = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          same++;\n        }\n      }\n    }\n    if (judge != 0) {\n      actual = 1.0 * same / num;\n      if (actual > standard) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p;\n  int la, i, y = 0, lb, s = 0;\n  char zfa[501], zfb[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", zfa);\n  scanf(\"%s\", zfb);\n  la = strlen(zfa);\n  lb = strlen(zfb);\n  if (la != lb) {\n    y = 1;\n  }\n  if (y == 0) {\n    for (i = 0; zfa[i] != '\\0' && zfb[i] != '\\0'; i++) {\n      if (((zfa[i] != 'A') && (zfa[i] != 'T') && (zfa[i] != 'C') &&\n           (zfa[i] != 'G')) ||\n          ((zfb[i] != 'A') && (zfb[i] != 'T') && (zfb[i] != 'C') &&\n           (zfb[i] != 'G'))) {\n        y = 1;\n        break;\n      }\n      if (zfa[i] == zfb[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / la) > p && y == 0) {\n      printf(\"yes\");\n    } else if (y == 0) {\n      cout << \"no\";\n    }\n  }\n  if (y == 1) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8906", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char x[501], y[501], m = 0, n = 0, i, p = 0, q = 0;\n  double a, b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; x[i]; i++) {\n    if (x[i] != 'A' && x[i] != 'C' && x[i] != 'G' && x[i] != 'T')\n      q++;\n\n    m++;\n  }\n  for (i = 0; y[i]; i++) {\n    if (y[i] != 'A' && y[i] != 'C' && y[i] != 'G' && y[i] != 'T') {\n      q++;\n    }\n    p++;\n  }\n  if (m != p || q != 0)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if (x[i] == y[i]) {\n        n++;\n      }\n    }\n    b = 1.0 * n / m;\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char s[501];\n  int i, c = 0, d = 0, e = 0, p = 0;\n  double k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", s);\n  for (i = 0; s[i] != '\\0'; i++) {\n    p = p + 1;\n    if ((s[i] != 'A') && (s[i] != 'T') && (s[i] != 'C') && (s[i] != 'G')) {\n      e = e + 1;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c = c + 1;\n    if (a[i] == s[i]) {\n      d = d + 1;\n    }\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      e = 1;\n    }\n  }\n  if (p != c) {\n    e = 1;\n  }\n  if (e == 1) {\n    printf(\"error\");\n  } else if ((1.0 * d / c) > k) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double b, c;\n  char D[2][501];\n  int z, t;\n  z = t = 0;\n  scanf(\"%lf\", &b);\n  cin >> D[1] >> D[0];\n  if (strlen(D[1]) != strlen(D[0])) {\n    printf(\"error\");\n    return 0;\n  }\n  z = strlen(D[1]);\n  for (int i = 0; D[1][i]; i++) {\n    if ((D[1][i] != 'A' && D[1][i] != 'T' && D[1][i] != 'C' &&\n         D[1][i] != 'G') ||\n        (D[0][i] != 'A' && D[0][i] != 'T' && D[0][i] != 'C' &&\n         D[0][i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (D[1][i] == D[0][i]) {\n      t++;\n    }\n  }\n  c = (double)t / (double)z;\n  if (c >= b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, y, x, m, q, p;\n  x = 0;\n  p = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  q = strlen(b);\n  for (int i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  for (int i = 0; i < q; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  if (m != q) {\n    p = 0;\n  }\n  if (p == 0)\n    printf(\"error\");\n  else {\n    for (int i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8910", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  int i, len, e = 0, sum = 0, len2;\n  double bi, h;\n  cin >> bi >> a >> b;\n  len = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n         b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        len != len2) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  if (e == 0) {\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum++;\n    }\n\n    h = sum * 1.0 / len;\n    if (h >= bi) {\n      printf(\"yes\");\n    } else if (h < bi) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int k = strlen(a);\n  int l = strlen(b);\n  int x = 0, y = 0;\n  int mm = 0;\n  for (mm = 0; mm < k; mm++) {\n    if (a[mm] != 'A' && a[mm] != 'T' && a[mm] != 'G' && a[mm] != 'C') {\n      x = 1;\n    }\n  }\n  for (mm = 0; mm < l; mm++) {\n    if (b[mm] != 'A' && b[mm] != 'T' && b[mm] != 'G' && b[mm] != 'C') {\n      y = 1;\n    }\n  }\n  if (k != l || x == 1 || y == 1) {\n    printf(\"error\");\n  }\n\n  else {\n    int i = 0, p = 0, q = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      q++;\n      if (a[i] == b[i]) {\n        p++;\n      }\n    }\n    double c = (double)p / q;\n    if (c > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, j;\n  double x, y, z, std;\n  x = 1.0;\n  char aa[1000];\n  char bb[1000];\n  scanf(\"%lf\", &std);\n  scanf(\"%s \", aa);\n  scanf(\"%s\", bb);\n  n = strlen(aa);\n  m = strlen(bb);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if ((aa[i] != 'A') && (aa[i] != 'T') && (aa[i] != 'G') && (aa[i] != 'C') &&\n        (bb[i] != 'A') && (bb[i] != 'T') && (bb[i] != 'C') && (bb[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (aa[i] == bb[i]) {\n      x = x + 1;\n    }\n  }\n  y = n * 1.0;\n  z = x / y;\n  if (z > std) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len, k, sum = 0, i, t = 0;\n  double x, y;\n  char jz[500], a[500];\n  scanf(\"%lf\", &x);\n  cin >> jz >> a;\n  len = strlen(jz);\n  k = strlen(a);\n  if (k != len)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (jz[i] != 'T' && jz[i] != 'A' && jz[i] != 'C' && jz[i] != 'G' &&\n          a[i] != 'T' && a[i] != 'A' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        t = 1;\n        break;\n      }\n      if (jz[i] == a[i])\n        sum++;\n    }\n    y = 1.0 * sum / len;\n    if (t == 0) {\n      if (y >= x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag1 = 0, flag2 = 0;\n  char dna1[501], dna2[501];\n  double b, b2;\n  scanf(\"%lf\", &b);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n        (dna1[i] == 'G')) {\n      continue;\n    } else {\n      flag1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n        (dna2[i] == 'G')) {\n      continue;\n    } else {\n      flag2 = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || (flag1 == 1) || (flag2 == 1)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j++;\n      }\n    }\n    b2 = 1.0 * j / len1;\n    if (b2 > b) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char a[500], b[500];\n  double x, y, k, n, m;\n  cin >> x;\n  cin >> a >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m == n && (a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T' ||\n                   b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] != 'T')) {\n      if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    } else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  y = k / n;\n  if (y > x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char f[501], t[501];\n  int i;\n  double j = 0, r = 0, s = 0;\n  double n;\n  scanf(\"%lf%s%s\", &n, f, t);\n  for (i = 0; f[i] != '\\0'; i++)\n    j++;\n\n  for (i = 0; t[i] != '\\0'; i++) {\n    r++;\n  }\n  if (j != r) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] == t[i])\n      s++;\n  }\n  if (s / j > n)\n    printf(\"yes\");\n\n  if (s / j <= n)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double len, len1, h, n1;\n  int i, f;\n  h = 0;\n  f = 0;\n  char s[500], t[500], n[2];\n\n  cin >> n;\n  n1 = atof(n);\n\n  cin >> s;\n\n  cin >> t;\n  len = strlen(s);\n  len1 = strlen(t);\n  if (len != len1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G'))\n        f = 1;\n    }\n    if (f)\n      printf(\"error\");\n    else {\n      for (i = 0; i < len; i++) {\n        if (s[i] == t[i])\n          h++;\n      }\n      if (h / len > n1)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8918", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, x, y, s, g = 0;\n  double rate, t;\n  char a[510], b[510];\n  s = 0;\n\n  cin >> rate >> a >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (((a[i] != 'A') && (a[i] != 'C') && (a[i] != 'G') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'C') && (b[i] != 'G') && (b[i] != 'T'))) {\n\n        g = 1;\n      } else if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    t = rate * x;\n    if (g == 0) {\n      if (s > t)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float x, fenzi = 0;\n  int lena, lenb, i, j = 0;\n  char a[505], b[505], ch;\n  scanf(\"%f\", &x);\n  scanf(\"%c\", &ch);\n  cin >> a;\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb)\n    printf(\"error \");\n  else {\n    for (i = 0; i < lena; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          fenzi++;\n      } else {\n        j = 1;\n        printf(\"error \");\n        break;\n      }\n    }\n    if (j == 0 && fenzi >= x * lena)\n      printf(\"yes \");\n    else if (j == 0)\n      printf(\"no \");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8920", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double c, f = 0;\n  int d, e, i;\n  scanf(\"%lf \", &c);\n  char a[100], b[100];\n  cin >> a >> b;\n  d = strlen(a);\n  e = strlen(b);\n  if (d != e)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n        ;\n      } else {\n        if (a[i] == b[i])\n          f++;\n      }\n    }\n    if (f / e >= c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8921", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, d, e, f, r;\n  double a, g;\n  r = 0;\n  scanf(\"%lf\", &a);\n  char b[501], c[501];\n  for (i = 0; i < 2; i++) {\n    if (i == 0) {\n      cin >> b;\n      m = strlen(b);\n    } else {\n      cin >> c;\n      d = strlen(c);\n    }\n  }\n  if (m >= d) {\n    f = m;\n  } else {\n    f = d;\n  }\n  e = 0;\n  for (i = 0; i < f; i++) {\n    if ((b[i] == 'A' || (b[i] == 'T') || b[i] == 'C' || b[i] == 'G') &&\n        (c[i] == 'A' || (c[i] == 'T') || c[i] == 'C' || c[i] == 'G')) {\n      if (c[i] == b[i]) {\n        e++;\n      }\n    } else {\n      r = 1;\n      break;\n    }\n  }\n  if ((m == d) && (r == 0)) {\n    g = 1.0 * e / m;\n    if (g > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  int num = 0, pan = 1;\n  char s;\n  char s1[600], a1[600];\n\n  cin >> &s;\n  n = atof(&s);\n\n  cin >> s1;\n\n  scanf(\"%s \", a1);\n  for (int i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  for (int i = 0; i < strlen(a1); i++) {\n    if (a1[i] != 'A' && a1[i] != 'C' && a1[i] != 'G' && a1[i] != 'T') {\n      pan = 0;\n    }\n  }\n  if (strlen(s1) != strlen(a1))\n    pan = 0;\n  else if (strlen(s1) == strlen(a1) && pan != 0) {\n    for (int i = 0; i < strlen(s1); i++) {\n      if (a1[i] == s1[i])\n        num++;\n    }\n    if (1.0 * num / strlen(s1) < n)\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  }\n  if (pan == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, e, i, z;\n  e = 0;\n  double x, y, k, h;\n  scanf(\"%lf\", &k);\n  char a[510], b[510];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  t = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        z++;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        z++;\n      } else if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z != 0) {\n      printf(\"error\");\n    } else {\n      x = e;\n      y = t;\n      h = x / y;\n      if (h > k) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8924", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, n;\n  double m;\n  char a[501], b[501];\n  cin >> m;\n  scanf(\"%s\\n%s\", a, b);\n  n = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / n > m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, c, d;\n  double l, m, n, x = 0;\n  char a[500], b[500];\n  scanf(\"%lf %s %s\", &l, &a, &b);\n\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      d = 0;\n    } else {\n      d = 1;\n    }\n  }\n  if (c != 0 && d != 0 && n == m) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      } else {\n        x = x;\n      }\n    }\n    if (l < (x / n)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  int d = 0, i, p = 0, m = strlen(dna1), l = strlen(dna2);\n  for (i = 0; dna1[i] || dna2[i]; i++) {\n    if (m != l) {\n      d = 1;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d = 2;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d = 3;\n      break;\n    }\n    if (dna1[i] != dna2[i]) {\n      p++;\n    }\n  }\n  double q = 1 - p / m;\n  if (d != 0) {\n    printf(\"error\");\n  }\n  if (q > b && d == 0) {\n    printf(\"yes\");\n  } else if (d == 0 && q <= b) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double e, s;\n  char a[1000], b[1000];\n  int l1, l2, i, j, t;\n\n  scanf(\"%lf\", &e);\n  cin >> a >> b;\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  for (j = 0; j < l2; j++) {\n    if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  if (l1 != l2) {\n    printf(\"error \");\n  }\n\n  else if (l1 == l2) {\n    t = 0;\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t++;\n      }\n    }\n    s = 1.0 * t / l1;\n    if (s > e) {\n      printf(\"yes \");\n    } else {\n      printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, a, b, t = 1, k = 0, s = 1, result;\n  char r[501], e[501];\n  int i;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", r);\n  scanf(\"%s\", e);\n  a = strlen(r);\n  b = strlen(e);\n  if (a != b)\n    printf(\"error\");\n\n  for (i = 0; i < (a - 1); i++) {\n    if ((r[i] == 'A') || (r[i] == 'T') || (r[i] == 'C') || (r[i] == 'G')) {\n      t++;\n    };\n    if ((e[i] == 'A') || (e[i] == 'T') || (e[i] == 'C') || (e[i] == 'G')) {\n      s++;\n    };\n  }\n  if ((t == a) && (s == b) && (a == b)) {\n    for (i = 0; i < a - 1; i++) {\n      if (r[i] == e[i]) {\n        k++;\n      };\n    };\n    result = k / (a - 1);\n    if (result > m) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    };\n  }\n  if (((t != a) || (s != b)) && (a == b)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, a, b, s, i;\n  double n, x;\n  char zfca[501];\n  char zfcb[501];\n  a = 0;\n  b = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zfca);\n  scanf(\"%s\", zfcb);\n\n  int la = strlen(zfca);\n  int lb = strlen(zfcb);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    a = 1;\n  }\n\n  if (a == 1) {\n    while (1) {\n      for (i = 0; zfca[i] != '\\0'; i++) {\n        if (zfca[i] != 'A' && zfca[i] != 'T' && zfca[i] != 'C' &&\n            zfca[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfca[i] != '\\0' && zfca[i] != 'A' && zfca[i] != 'T' &&\n          zfca[i] != 'C' && zfca[i] != 'G') {\n        break;\n      }\n\n      for (i = 0; zfcb[i] != '\\0'; i++) {\n        if (zfcb[i] != 'A' && zfcb[i] != 'T' && zfcb[i] != 'C' &&\n            zfcb[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfcb[i] == '\\0') {\n        b = 1;\n      }\n      break;\n    }\n  }\n  if (a == 1 && b == 1) {\n    for (i = 0, s = 0; zfca[i] != '0'; i++) {\n      if (zfca[i] == zfcb[i]) {\n        s = s + 1;\n      }\n    }\n    if (a == 1 && b == 1) {\n      x = 1.0 * s / la;\n      if (x > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float x, fenzi = 0;\n  int lena, lenb, i, j = 0;\n  char a[505], b[505], ch;\n  scanf(\"%f\", &x);\n  scanf(\"%c\", &ch);\n\n  cin >> a;\n\n  cin >> b;\n\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb)\n    printf(\"error \");\n  else {\n    for (i = 0; i < lena; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          fenzi++;\n      } else {\n        j = 1;\n        printf(\"error \");\n        break;\n      }\n    }\n    if (j == 0 && fenzi >= x * lena)\n      printf(\"yes \");\n    else if (j == 0)\n      printf(\"no \");\n  }\n}\n"}
{"label": "5", "index": "8931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, s = 0;\n  char a[502], b[502];\n  int len1, len2, i;\n  scanf(\"%lf %s %s\", &x, a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[i]) {\n      s++;\n    }\n  }\n  s = s / len1;\n  if (s > x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  char zzd[600];\n  char hzy[600];\n  int i;\n  int a;\n  double v;\n  a = 0;\n  double b;\n  int c;\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zzd);\n  scanf(\"%s\", hzy);\n  b = strlen(zzd);\n  for (i = 0; i < b; i++) {\n    if (zzd[i] != 'A' && zzd[i] != 'G' && zzd[i] != 'C' && zzd[i] != 'T') {\n      printf(\"error\");\n      c++;\n      break;\n    } else if (hzy[i] != 'A' && hzy[i] != 'G' && hzy[i] != 'C' &&\n               hzy[i] != 'T') {\n      printf(\"error\");\n      c++;\n      break;\n    } else if (zzd[i] == hzy[i]) {\n      a++;\n    }\n  }\n  if (c == 0) {\n    v = a / b;\n    if (v >= n) {\n      printf(\"yes\");\n    } else if (v < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char asd[500], zxc[500];\n  int i, j;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", asd);\n  scanf(\"%s\", zxc);\n  int len1 = strlen(asd);\n  int len2 = strlen(zxc);\n  int a1 = 0;\n  int a2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (asd[i] != 'A' && asd[i] != 'C' && asd[i] != 'G' && asd[i] != 'T')\n      a1++;\n  }\n  for (i = 0; i < len2; i++) {\n    if (zxc[i] != 'A' && zxc[i] != 'C' && zxc[i] != 'G' && zxc[i] != 'T')\n      a2++;\n  }\n  if (a1 != 0 || a2 != 0 || len1 != len2)\n    printf(\"error\");\n  else {\n    int d = 0;\n    for (i = 0; i < len1; i++) {\n      if (asd[i] == zxc[i])\n        d++;\n    }\n    double result = 1.0 * d / len1;\n    if (result > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, q, i, flag = 1;\n  double m, c = 0, d = 0;\n  char a[10086], b[10086];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    flag = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'G') || (a[i] == 'C') || (a[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'G') || (b[i] == 'C') || (b[i] == 'T')) {\n    } else {\n      flag = 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      c++;\n    }\n    d++;\n  }\n  if (flag == 0) {\n    printf(\"error\");\n  }\n  if (flag == 1) {\n    if (c / d >= m)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8935", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x[1000], y[1000];\n  int i, lengthx, lengthy, same = 0;\n  float rate, a;\n  cin >> rate;\n  cin >> x >> y;\n  lengthx = strlen(x);\n  lengthy = strlen(y);\n  if (lengthx != lengthy)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < lengthx; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T'))\n        break;\n    }\n    if (i < lengthx - 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < lengthx; i++)\n        if (x[i] == y[i])\n          same++;\n      a = (float)same / (float)lengthx;\n      if (a > rate)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2;\n  float s, w, L;\n  char x[501], y[501];\n  scanf(\"%f\", &w);\n  cin >> x;\n  scanf(\"%s\", &y);\n  s = 0;\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n      if (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G') {\n        printf(\"error\");\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          s++;\n        }\n      }\n    }\n    L = l1;\n    if (i == l1) {\n      if (s / L > w)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag = 0;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &rate, a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (a[i] == b[i])\n      j++;\n  }\n  if (flag == 1)\n    return 0;\n\n  if ((double)j / len1 > rate)\n    cout << \"yes\\n\";\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "8938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[500], zfc2[500];\n  int i, j, t, len1, len2;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", zfc1, zfc2);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; zfc1[i]; i++) {\n    if (len2 != len1 ||\n        (zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'G' &&\n         zfc1[i] != 'C') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'G' &&\n         zfc2[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  t = 0;\n  for (j = 0; zfc1[j] != '\\0'; j++) {\n    if (zfc1[j] == zfc2[j])\n      t++;\n  }\n  if (1.0 * t / len1 > n) {\n    cout << \"yes\";\n    return 0;\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char dna1[600], dna2[600];\n  int a, b, i;\n  double x = 0, ratio;\n  scanf(\"%lf\", &ratio);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  a = strlen(dna1);\n  b = strlen(dna2);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' && dna1[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' && dna2[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      x++;\n  }\n  if (x / a >= ratio)\n    cout << \"yes\";\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], st[5] = \"ATGC\";\n  int len1, len2, i, s = 0;\n  double x, n;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  int F = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    F = 1;\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != st[0]) && (a[i] != st[1]) && (a[i] != st[2]) &&\n          (a[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len2; i++) {\n      if ((b[i] != st[0]) && (b[i] != st[1]) && (b[i] != st[2]) &&\n          (b[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    n = (double)s / len1;\n    if (n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, k = 0;\n  double m;\n  cin >> m;\n  char a[100];\n  char b[100];\n  scanf(\"%s\\n%s\", a, b);\n  int l = strlen(a), t = strlen(b);\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      k++;\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')\n      k++;\n  }\n  if (k > 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  if (l == t) {\n    for (i = 0; i <= l; i++) {\n\n      if (a[i] == b[i])\n        n++;\n    }\n    if ((1.00 * n / l) > m)\n      cout << \"yes\";\n\n    else\n      printf(\"no\");\n\n  }\n\n  else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8942", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, f, e, d, k;\n  int q[10000], p[10000];\n  double r, n;\n  char s[10000], w[100000];\n  e = 0;\n  k = 0;\n  cin >> n;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  m = strlen(s);\n  k = strlen(w);\n  for (i = 0; i < m; i++) {\n\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (w[i] != 'A' && w[i] != 'G' && w[i] != 'C' && w[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (k != m) {\n      printf(\"error\");\n      break;\n    }\n    if (s[i] == w[i])\n      e++;\n    if (i == m - 1) {\n      r = e * 1.0 / m;\n      if (r >= n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m1, m2, i, t, d;\n  double a, b;\n  char dna1[501];\n  char dna2[501];\n  t = 0;\n  d = 0;\n  scanf(\"%lf\", &a);\n  getchar();\n  cin >> dna1;\n  scanf(\"%s\", &dna2);\n  m1 = strlen(dna1);\n  m2 = strlen(dna2);\n  if (m1 != m2) {\n    printf(\"error\");\n    d = 1;\n  } else {\n    for (i = 0; i < m1; i++) {\n      if (dna1[i] == dna2[i]) {\n        t = t + 1;\n      }\n    }\n  }\n  b = 1.000000 * t / m1;\n  if (d == 0) {\n    for (i = 0; i < m1; i++) {\n      if ((dna1[i] != 'A') && (dna1[i] != 'T') && (dna1[i] != 'C') &&\n          (dna1[i] != 'G')) {\n        printf(\"error\");\n        d = 1;\n        break;\n      }\n    }\n  }\n  if (d == 0) {\n    for (i = 0; i < m2; i++) {\n      if ((dna2[i] != 'A') && (dna2[i] != 'T') && (dna2[i] != 'C') &&\n          (dna2[i] != 'G')) {\n        printf(\"error\");\n      }\n    }\n  }\n  if ((m1 == m2) && (d == 0)) {\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, time = 0;\n  double p;\n  char a[501], b[501];\n  char c[5] = \"ATCG\";\n  cin >> p;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      time++;\n    }\n  }\n  if (p < (double)time / strlen(a) || p == (double)time / strlen(a)) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int na, nb, i, c;\n  char a[500], b[500];\n  cin >> x;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  na = strlen(a);\n  nb = strlen(b);\n  if (na != nb) {\n    printf(\"error\");\n    return 0;\n  } else {\n    c = 0;\n    for (i = 0; i < na; i++) {\n      if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n        if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n          if (a[i] == b[i]) {\n            c = c + 1;\n          }\n        } else {\n          printf(\"error\");\n          return 0;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  y = 1.0 * c / na;\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, s = 0;\n  char a[502], b[502];\n  int len1, len2, i;\n  scanf(\"%lf %s %s\", &x, a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  s = s / len1;\n  if (s > x)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500], st[5] = \"ATGC\";\n  int len1, len2, i, s = 0;\n  double x, n;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  int F = 0;\n  if (len1 != len2) {\n    printf(\"error\");\n    F = 1;\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != st[0]) && (a[i] != st[1]) && (a[i] != st[2]) &&\n          (a[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len2; i++) {\n      if ((b[i] != st[0]) && (b[i] != st[1]) && (b[i] != st[2]) &&\n          (b[i] != st[3])) {\n        printf(\"error\");\n        F = 1;\n        break;\n      }\n    }\n  }\n  if (F == 0) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    n = (double)s / len1;\n    if (n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  char s[501];\n  char t[501];\n  int m, n, i, k = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &t);\n  m = strlen(s);\n  n = strlen(t);\n  if (m != n)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n          (t[i] != 'A' && t[i] != 'G' && t[i] != 'C' && t[i] != 'T')) {\n        k = -1;\n        break;\n      } else if (s[i] == t[i]) {\n        k++;\n      }\n    }\n    if (k == -1) {\n      printf(\"error\");\n    } else if ((1.0 * k / n) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, b, d;\n  double n, e;\n  char s1[500], s2[500];\n  int c = 0;\n\n  scanf(\"%lf \", &n);\n\n  cin >> s1;\n\n  cin >> s2;\n  b = strlen(s1);\n  d = strlen(s2);\n  for (i = 0; i < b; i++) {\n    if ((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') && (s1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < b; i++) {\n    if ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') && (s2[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  if (b == d) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] == s2[i]) {\n        c++;\n      }\n    }\n    e = 1.0 * c / b;\n    if (e >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8950", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n1, n2, p;\n  double rate, m = 0.0;\n  char str1[501], str2[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  p = 0;\n  if (n1 == n2) {\n    for (i = 0; i < n1; i++) {\n      if (str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' && str1[i] != 'G')\n        p = 1;\n      else if (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n               str2[i] != 'G')\n        p = 1;\n      if (p == 1) {\n        printf(\"error\");\n        break;\n      }\n      if (str1[i] == str2[i])\n        m += 1.0;\n    }\n    if (p == 0)\n      if (m / n1 >= rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int num = 0;\n  double alike, n;\n  char jj1[500] = {0};\n  char jj2[500] = {0};\n  scanf(\"%lf\", &n);\n  cin >> jj1;\n  scanf(\"%s\", jj2);\n  int result1 = strlen(jj1);\n  int result2 = strlen(jj2);\n  if (result1 != result2) {\n    printf(\"error\");\n\n    return 0;\n  } else {\n    result2 = result1;\n    for (i = 0; i < result1; i++) {\n      if (((jj1[i] == 'A') || (jj1[i] == 'G') || (jj1[i] == 'C') ||\n           (jj1[i] == 'T')) &&\n          ((jj2[i] == 'A') || (jj2[i] == 'G') || (jj2[i] == 'C') ||\n           (jj2[i] == 'T'))) {\n        if (jj1[i] == jj2[i]) {\n          num += 1;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  alike = 1.0 * num / result1;\n  if (alike >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int a, i, d = 1, b = 0;\n  char sz[1000] = {'\u0000'}, u[1000] = {'\u0000'};\n  scanf(\"%lf\", &n);\n  scanf(\" \");\n\n  cin >> sz;\n\n  cin >> u;\n  a = strlen(sz);\n  for (i = 0; i < a; i++) {\n    if (sz[i] != 'A' && sz[i] != 'G' && sz[i] != 'T' && sz[i] != 'C') {\n      cout << \"error\";\n      d = 0;\n      break;\n    } else if (u[i] != 'A' && u[i] != 'G' && u[i] != 'T' && u[i] != 'C') {\n      cout << \"error\";\n      d = 0;\n      break;\n    }\n\n    else if (sz[i] == u[i]) {\n      b++;\n    }\n  }\n  c = b * 1.0 / a;\n  if (d == 1) {\n    if (c > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8953", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, i;\n  double a, m, n;\n  char s1[100], s2[100];\n  c = 0;\n  cin >> a;\n  scanf(\"%s\", s1);\n  cin >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T' ||\n          s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n    }\n  }\n  m = 1.0 * strlen(s1);\n  n = 1.0 * c;\n  if (n / m > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int left = 0, right = 0, a = 0, get = 0, i;\n  double m, q;\n  char l[520], r[520];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", l);\n  scanf(\"%s\", r);\n  for (i = 0; l[i]; i++) {\n    left++;\n    if (l[i] != 'A' && l[i] != 'G' && l[i] != 'T' && l[i] != 'C') {\n      a = 1;\n    }\n  }\n  for (i = 0; r[i]; i++) {\n    right++;\n    if (r[i] != 'A' && r[i] != 'G' && r[i] != 'T' && r[i] != 'C') {\n      a = 1;\n    }\n  }\n  if (a == 1 || left != right) {\n    printf(\"error\");\n  } else {\n    for (i = 0; l[i]; i++) {\n      if (l[i] == r[i]) {\n        get++;\n      }\n    }\n    q = 1.0 * get / left;\n    if (q > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2, i, sum = 0, w = 0;\n  float rate, result;\n  char zfc_1[600], zfc_2[600];\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", zfc_1);\n  scanf(\"%s\", zfc_2);\n  l1 = strlen(zfc_1);\n  l2 = strlen(zfc_2);\n  for (i = 0; i < l1; i++) {\n    if ((l1 != l2) ||\n        (zfc_1[i] != 'A' && zfc_1[i] != 'T' && zfc_1[i] != 'G' &&\n         zfc_1[i] != 'C') ||\n        (zfc_2[i] != 'A' && zfc_2[i] != 'T' && zfc_2[i] != 'G' &&\n         zfc_2[i] != 'C')) {\n      printf(\"error\");\n      w = 1;\n      break;\n    } else {\n      if (zfc_1[i] == zfc_2[i])\n        sum++;\n      else\n        continue;\n    }\n  }\n  result = 1.00 * sum / l1;\n  if (result > rate) {\n    printf(\"yes\");\n  } else if ((result <= rate) && (w == 0))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\", &b);\n  int la = strlen(a), lb = strlen(b), i;\n  int s = 0;\n  double e;\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n\n      else {\n        if (a[i] == b[i])\n          s = s + 1;\n\n        if (i == la - 1) {\n          e = 1.0 * s / la;\n          if (e > n) {\n            printf(\"yes\");\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char gene1[500];\n  char gene2[500];\n  int i;\n  int s = 0;\n  double r;\n  cin >> r;\n  scanf(\"%s\", &gene1);\n  scanf(\"%s\", &gene2);\n  int len1 = strlen(gene1);\n  int len2 = strlen(gene2);\n  int fuhe = 1;\n  for (i = 0; i <= len1 - 1; i++) {\n    if ((gene1[i] != 'A' && gene1[i] != 'T' && gene1[i] != 'C' &&\n         gene1[i] != 'G') ||\n        (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n         gene2[i] != 'G')) {\n      fuhe = 0;\n    }\n  }\n  if (len1 != len2 || fuhe == 0)\n    cout << \"error\";\n  else {\n    for (i = 0; i <= len1 - 1; i++) {\n      if (gene1[i] == gene2[i]) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n    if (1.00 * s / len1 > r) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8958", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char f[501], t[501];\n  int i;\n  double j = 0, r = 0, s = 0;\n  double n;\n  cin >> n >> f >> t;\n  for (i = 0; f[i] != '\\0'; i++) {\n    j++;\n  }\n  for (i = 0; t[i] != '\\0'; i++) {\n    r++;\n  }\n  if (j != r) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] == t[i])\n      s++;\n  }\n  if (s / j > n) {\n    printf(\"yes\");\n  }\n  if (s / j <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bl;\n  double xg;\n  int i, l, e, k, c;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &bl, &a, &b);\n  l = strlen(a);\n  k = strlen(b);\n  c = 0;\n  e = 0;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G'))\n      c = 1;\n  }\n  for (i = 0; i < k; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      c = 1;\n    }\n  }\n  if (l == k && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i])\n        e++;\n    }\n    xg = 1.0 * e / l;\n    if (xg > bl) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000];\n  double n;\n  int i, j, k;\n  double sum = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i]) {\n        sum += 1;\n      }\n    }\n    if ((sum / strlen(a)) > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, r = 0;\n  double k, w;\n  char s1[1000], s2[1000];\n  cin >> k;\n  scanf(\"%s %s\", s1, s2);\n  if (strlen(s1) != strlen(s2)) {\n    r++;\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'T') {\n        r++;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'G' && s2[i] != 'T') {\n        r++;\n      }\n    }\n  }\n  if (r > 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] == s2[i]) {\n        p++;\n      }\n    }\n    w = 1.0 * p / (strlen(s1));\n    if (w > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, k, num = 0, flag = 0;\n  double l;\n  char a[501], b[501], s[10];\n\n  scanf(\"%s \", s);\n  k = atoi(s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      flag = 1;\n      break;\n    }\n  }\n  if ((n == m) && (flag == 0)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    l = (double)num / n;\n    if (l > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[505], s2[505];\n  double n, m = 0, len1, len2, flag = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i < len1; i++) {\n    if ((s1[i] == 'A') || (s1[i] == 'T') || (s1[i] == 'C') || (s1[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((s2[i] == 'A') || (s2[i] == 'T') || (s2[i] == 'C') || (s2[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n\n  if ((len1 != len2) || (flag == 1)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i <= len1; i++) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    }\n    m = m / len1;\n    if (m > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double c, f = 0;\n  int d, e, i;\n  scanf(\"%lf\", &c);\n  char a[100], b[100];\n  scanf(\"%s%s\", &a, &b);\n  d = strlen(a);\n  e = strlen(b);\n  if (d != e)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n        ;\n      } else {\n        if (a[i] == b[i])\n          f++;\n      }\n    }\n    if (f / e >= c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, c, d;\n  double l, m, n, x = 0;\n  char a[500], b[500];\n  scanf(\"%lf %s %s\", &l, &a, &b);\n\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      d = 0;\n    } else {\n      d = 1;\n    }\n  }\n  if (c != 0 && d != 0 && n == m) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      } else {\n        x = x;\n      }\n    }\n    if (l < (x / n)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8966", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, b;\n  scanf(\"%lf\", &n);\n  int i, m, a, o;\n  a = 0;\n  char ji[1000], yin[1000];\n  scanf(\"%s \", ji);\n  scanf(\"%s\", yin);\n  m = strlen(ji);\n  o = strlen(yin);\n  if (m != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if ((ji[i] != 'A' && ji[i] != 'C' && ji[i] != 'G' && ji[i] != 'T') ||\n        (yin[i] != 'A' && yin[i] != 'C' && yin[i] != 'G' && yin[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (n >= 1) {\n    printf(\"no\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (ji[i] == yin[i]) {\n      a++;\n    }\n  }\n  b = 1.0 * a / 1.0 * m;\n  if (b >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, q = 1;\n  double s = 0.0, len, res, req;\n  char a[1000], b[1000];\n  cin >> req;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n      q = 0;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      q = 0;\n  }\n  if (q == 0)\n    cout << \"error\\n\";\n  else if (q != 0) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    res = s / len * 1.0;\n    if (req < res)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double s, w;\n  int k1 = 0, k2 = 0, i, dian, lena, lenb;\n  char a[1000], b[1000];\n\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n\n      k1 = 1;\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n\n      k2 = 1;\n  }\n\n  if (k1 == 1 || k2 == 1 || lena != lenb)\n    cout << \"error\";\n  else {\n    for (i = 0, dian = 0; i < lena; i++) {\n      if (a[i] == b[i])\n        dian++;\n    }\n\n    w = 1.0 * dian / lena;\n    if (w >= s)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float n, f;\n  int l, c, o = 0, k = 0, v = 0;\n  char a[501] = {0}, b[501] = {0};\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  c = strlen(b);\n  for (int q = 0; q < l; q++) {\n    if (a[q] < 'A' || a[q] > 'Z') {\n      o = 1;\n      break;\n    }\n  }\n  for (int p = 0; p < l; p++) {\n    if (b[p] < 'A' || b[p] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (o == 1 || k == 1 || l != c) {\n    printf(\"error\");\n  } else {\n    for (int g = 0; g < c; g++) {\n      if (a[g] == b[g]) {\n        v++;\n      }\n    }\n    f = (float)v / (float)c;\n\n    if (f > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0;\n  float n;\n  char a[600], b[600];\n  cin >> n;\n  cin >> a;\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G'))\n        t++;\n    }\n\n    if (t > 0)\n      cout << \"error\" << endl;\n    else {\n\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n\n      if ((float)s / strlen(a) > n)\n        cout << \"yes\";\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, i;\n  double a;\n  char b[2][1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", b[0]);\n  scanf(\"%s\", b[1]);\n  if (strlen(b[0]) != strlen(b[1])) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < strlen(b[0]); i++) {\n    if (b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G' &&\n        b[1][i] != 'A' && b[1][i] != 'T' && b[1][i] != 'C' && b[1][i] != 'G' &&\n        b[0][i] != 'a' && b[0][i] != 't' && b[0][i] != 'c' && b[0][i] != 'g' &&\n        b[1][i] != 'a' && b[1][i] != 't' && b[1][i] != 'c' && b[1][i] != 'g') {\n      printf(\"error\");\n\n      return 0;\n    }\n    if (b[0][i] == b[1][i])\n      s++;\n  }\n  if (s * 1.0 / strlen(b[0]) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "8972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, a, b, k;\n  k = 0;\n  a = 0;\n  b = 0;\n  double p;\n  char f[501], g[501];\n  cin >> p >> f >> g;\n  m = strlen(f);\n  n = strlen(g);\n  for (i = 0; i < m; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      a++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (g[i] != 'A' && g[i] != 'T' && g[i] != 'C' && g[i] != 'G') {\n      b++;\n    }\n  }\n  if (m != n || a != 0 || b != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (f[i] == g[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / m > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, e = 0, f = 0;\n  char h[1][501], i[1][501];\n  double j, k;\n  scanf(\"%lf%s%s\", &j, h[0], i[0]);\n  b = strlen(h[0]);\n  c = strlen(i[0]);\n  if (b != c) {\n    f++;\n    printf(\"error\");\n  } else {\n    for (d = 0; d < b; d++) {\n      if ((h[0][d] != 'A' && h[0][d] != 'T' && h[0][d] != 'C' &&\n           h[0][d] != 'G') ||\n          (i[0][d] != 'A' && i[0][d] != 'T' && i[0][d] != 'C' &&\n           i[0][d] != 'G')) {\n        printf(\"error\");\n        f++;\n        break;\n      } else {\n        if (h[0][d] == i[0][d]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (f == 0) {\n    k = 1.0 * e / b;\n    if (k > j) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8974", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, r;\n  int l, t, i;\n  char a[501], b[501];\n  t = 0;\n  scanf(\"%lf \", &n);\n  cin >> a >> b;\n  l = strlen(a);\n  if (l != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] == b[i])\n      t++;\n  }\n  r = t * 1.0 / l;\n  if (r > n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, j;\n  int n, m, b = 0, c = 1, i, q;\n  char s1[510], s2[510];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  n = strlen(s1);\n  m = strlen(s2);\n  if (n != m)\n    c = 0;\n  for (i = 0; i < n; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (q = 0; q < m; q++) {\n    if (s2[q] != 'A' && s2[q] != 'T' && s2[q] != 'C' && s2[q] != 'G') {\n      c = 0;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s1[i] == s2[i])\n      b++;\n  }\n  j = (double)b / n;\n  if (c == 1) {\n    if (j >= a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, t;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  t = 0;\n  for (i = 0; i < l1; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n      if (a[i] == b[i])\n        t++;\n    } else {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (1.0 * t / l1 >= n)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, a, b, s, i;\n  double n, x;\n  char zfca[501];\n  char zfcb[501];\n  a = 0;\n  b = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zfca);\n  scanf(\"%s\", zfcb);\n\n  int la = strlen(zfca);\n  int lb = strlen(zfcb);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    a = 1;\n  }\n\n  if (a == 1) {\n    while (1) {\n      for (i = 0; zfca[i] != '\\0'; i++) {\n        if (zfca[i] != 'A' && zfca[i] != 'T' && zfca[i] != 'C' &&\n            zfca[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfca[i] != '\\0' && zfca[i] != 'A' && zfca[i] != 'T' &&\n          zfca[i] != 'C' && zfca[i] != 'G') {\n        break;\n      }\n\n      for (i = 0; zfcb[i] != '\\0'; i++) {\n        if (zfcb[i] != 'A' && zfcb[i] != 'T' && zfcb[i] != 'C' &&\n            zfcb[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfcb[i] == '\\0') {\n        b = 1;\n      }\n      break;\n    }\n  }\n  if (a == 1 && b == 1) {\n    for (i = 0, s = 0; zfca[i] != '0'; i++) {\n      if (zfca[i] == zfcb[i]) {\n        s = s + 1;\n      }\n    }\n    if (a == 1 && b == 1) {\n      x = 1.0 * s / la;\n      if (x > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, x, y;\n  double n;\n  double count = 0.00;\n  char a[501];\n  char b[501];\n\n  scanf(\"%lf \", &n);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; a[i] != '\u0000', b[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n      break;\n    }\n\n    if (a[i] == b[i])\n      count++;\n  }\n\n  if (count / (x - 1) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, e, i, z;\n  e = 0;\n  double x, y, k, h;\n  scanf(\"%lf\", &k);\n  char a[510], b[510];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  t = strlen(a);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        z++;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        z++;\n      } else if (a[i] == b[i]) {\n        e++;\n      }\n    }\n    if (z != 0) {\n      printf(\"error\");\n    } else {\n      x = e;\n      y = t;\n      h = x / y;\n      if (h > k) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, l, n;\n  double d, b;\n  char x[501];\n  char y[501];\n\n  a = 0;\n  l = 0;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  n = strlen(x);\n\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        a = 1;\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          l++;\n        }\n      }\n    }\n\n    if (a == 0) {\n      b = (double)l / (double)n;\n\n      if (b >= d) {\n        printf(\"yes\");\n      } else if (b < d) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, p;\n  int i;\n  int k = 0, s = 0;\n  char zfc1[500], zfc2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zfc1);\n  cin >> zfc2;\n  int a = strlen(zfc1), b = strlen(zfc2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' ||\n           zfc1[i] == 'G') &&\n          (zfc2[i] == 'A' || zfc2[i] == 'T' || zfc2[i] == 'C' ||\n           zfc2[i] == 'G')) {\n        s++;\n      }\n      if (zfc1[i] == zfc2[i]) {\n        k++;\n      }\n    }\n    if (s == a) {\n      p = 1.0 * k / a;\n      if (p > n) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  int n1, n2, m = 0, c = 0;\n  char s1[500], s2[500];\n  cin >> a;\n  scanf(\"%s %s\", s1, s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (int i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C' || s1[i] == 'T') &&\n        (s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C' || s2[i] == 'T')) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    } else\n      c = 1;\n  }\n  if (c == 1 || n1 != n2) {\n    cout << \"error\\n\";\n  } else {\n    b = m * 1.0 / n1;\n    if (a < b) {\n      printf(\"yes\\n\");\n    } else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8983", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m;\n  scanf(\"%lf \", &m);\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  int ci = 0;\n  int pan = 0;\n  int aa = strlen(a), bb = strlen(b);\n  if (aa != bb) {\n    printf(\"error\");\n  } else {\n    int i;\n    for (i = 0; i < aa; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        pan = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        ci++;\n      }\n    }\n    double bi = (double)ci / aa;\n    if (pan == 0) {\n      if (bi >= m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[510], A[510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B);\n  for (i = 0; B[i] != '\\0'; i++) {\n    if (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G') {\n      a = 1;\n    }\n  }\n  cin >> A;\n  for (i = 0; A[i] != '\\0'; i++) {\n    if (A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B) != strlen(A) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B);\n  for (i = 0; i < l; i++) {\n    if (B[i] == A[i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sum = 0, m, n;\n  double x;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  scanf(\"%s\", c1);\n  scanf(\"%s\", c2);\n  m = strlen(c1);\n  n = strlen(c2);\n  if (m == n) {\n    for (i = 0; i < m; i++) {\n      if ((c1[i] != 'A' && c1[i] != 'T' && c1[i] != 'C' && c1[i] != 'G') ||\n          (c2[i] != 'A' && c2[i] != 'T' && c2[i] != 'C' && c2[i] != 'G')) {\n        sum++;\n      }\n    }\n    if (sum != 0)\n      cout << \"error\";\n    else {\n      for (i = 0; i < m; i++) {\n        if (c1[i] == c2[i]) {\n          sum++;\n        }\n      }\n      if ((double)sum / m > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else if (m != n) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++)\n    cin >> b[j];\n\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if (b[0][j] < 65 || b[0][j] > 90 || b[1][j] < 65 || b[1][j] > 90) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, flag = 0, deadend = 0;\n  double x;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &x);\n  scanf(\"%s\\n\", &a);\n  scanf(\"%s\\n\", &b);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      deadend = 1;\n      break;\n    }\n  }\n  if ((strlen(a) == strlen(b)) && (deadend == 0)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        flag++;\n    }\n    if ((100 * flag / (strlen(a))) < (100 * x))\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  } else if ((strlen(a) != strlen(b)) && (deadend == 0))\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8988", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, len1, len2;\n  double p;\n  char a[501], b[501];\n  cin >> p;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i])\n      n++;\n  }\n  if ((double)n / len1 > p)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "8989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int sum = 0, i, lena, lenb, t = 0;\n  double n, bi;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n\n  if (lena != lenb || t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    bi = (double)sum / lena;\n    if (bi > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8990", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, d, c, r;\n  int i, k, s;\n  cin >> n;\n  scanf(\"%s\\n%s\", a, b);\n  d = strlen(a);\n  c = strlen(b);\n  k = 0;\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n        k++;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n        k++;\n    }\n    if (k != 0) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  s = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  r = s / d;\n  if (r <= n)\n    printf(\"no\");\n  if (r > n)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "5", "index": "8991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, a, b, s, i;\n  double n, x;\n  char zfca[501];\n  char zfcb[501];\n  a = 0;\n  b = 0;\n  scanf(\"%lf\", &n);\n  cin >> zfca;\n  scanf(\"%s\", zfcb);\n\n  int la = strlen(zfca);\n  int lb = strlen(zfcb);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    a = 1;\n  }\n\n  if (a == 1) {\n    while (1) {\n      for (i = 0; zfca[i] != '\\0'; i++) {\n        if (zfca[i] != 'A' && zfca[i] != 'T' && zfca[i] != 'C' &&\n            zfca[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfca[i] != '\\0' && zfca[i] != 'A' && zfca[i] != 'T' &&\n          zfca[i] != 'C' && zfca[i] != 'G') {\n        break;\n      }\n\n      for (i = 0; zfcb[i] != '\\0'; i++) {\n        if (zfcb[i] != 'A' && zfcb[i] != 'T' && zfcb[i] != 'C' &&\n            zfcb[i] != 'G') {\n          printf(\"error\");\n          break;\n        }\n      }\n      if (zfcb[i] == '\\0') {\n        b = 1;\n      }\n      break;\n    }\n  }\n  if (a == 1 && b == 1) {\n    for (i = 0, s = 0; zfca[i] != '0'; i++) {\n      if (zfca[i] == zfcb[i]) {\n        s = s + 1;\n      }\n    }\n    if (a == 1 && b == 1) {\n      x = 1.0 * s / la;\n      if (x > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501];\n  char b[501];\n  int i, n, j, k;\n  float v;\n  j = 0;\n  k = 0;\n  n = 0;\n  scanf(\"%f\", &v);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    j = j + 1;\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    k = k + 1;\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (j != k) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      n = n + 1;\n    }\n  }\n  if (v * j < n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], t[501];\n  char *p, *q;\n  int m = 0, n, l;\n  cin >> a >> s >> t;\n  n = strlen(s);\n  l = strlen(t);\n  if (n == l) {\n    p = s;\n    q = t;\n    while (*p != '\\0') {\n      if (*p != 'A' && *p != 'T' && *p != 'C' && *p != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (*q != 'A' && *q != 'T' && *q != 'C' && *q != 'G') {\n          printf(\"error\");\n          return 0;\n        } else {\n          if (*p == *q)\n            m++;\n\n          p++;\n          q++;\n        }\n      }\n    }\n    b = m * 1.0 / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "8994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len, sum = 0, e = 0;\n  float n;\n  scanf(\"%f\", &n);\n  char a[600], b[600];\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  len = strlen(a);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if (a[i] != 65 && a[i] != 71 && a[i] != 67 && a[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n      if (b[i] != 65 && b[i] != 71 && b[i] != 67 && b[i] != 84) {\n        printf(\"error\");\n        e = 1;\n        break;\n      }\n    }\n    if (e == 0) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      if (sum * 1.0 / len > n) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p;\n  int e = 0, t = 0, f = 0, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf \", &p);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    q = 1;\n  else {\n    for (int i = 0; 1; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (a[i] == b[i])\n        e++;\n      t++;\n    }\n  }\n  if (q == 1)\n    printf(\"error\");\n  else {\n    if (p < 1.0 * e / t)\n      cout << \"yes\";\n    if (p > 1.0 * e / t)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[2][500];\n  int len[2], i, j, o, W, l;\n  double n, p;\n  W = 0;\n  l = 0;\n  scanf(\"%lf\", &n);\n  getchar();\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n    for (j = 0; j < len[i]; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'C' &&\n          a[i][j] != 'G') {\n        W++;\n      }\n    }\n  }\n  if (len[0] != len[1] || W != 0) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; j < len[0]; j++) {\n      if (a[0][j] == a[1][j]) {\n        l++;\n      }\n    }\n  }\n  p = 1.0 * l / len[0];\n  if (p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  scanf(\"%d\", &o);\n  return 0;\n}\n"}
{"label": "5", "index": "8997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, k;\n  n = 0;\n  k = 1;\n  double s;\n  char x1[501], x2[501];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", x1);\n  scanf(\"%s\", x2);\n  l1 = strlen(x1);\n  l2 = strlen(x2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(x1[i] == 'A' || x1[i] == 'C' || x1[i] == 'G' || x1[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (!(x2[i] == 'A' || x2[i] == 'C' || x2[i] == 'G' || x2[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (x1[i] == x2[i]) {\n        n++;\n      }\n    }\n    if (k) {\n      if (1.0 * n / l1 > s) {\n        printf(\"yes\");\n      } else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "8998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char gene1[500];\n  char gene2[500];\n  int i;\n  int s = 0;\n  double r;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &gene1);\n  scanf(\"%s\", &gene2);\n  int len1 = strlen(gene1);\n  int len2 = strlen(gene2);\n  int fuhe = 1;\n  for (i = 0; i <= len1 - 1; i++) {\n    if ((gene1[i] != 'A' && gene1[i] != 'T' && gene1[i] != 'C' &&\n         gene1[i] != 'G') ||\n        (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n         gene2[i] != 'G')) {\n      fuhe = 0;\n    }\n  }\n  if (len1 != len2 || fuhe == 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= len1 - 1; i++) {\n      if (gene1[i] == gene2[i]) {\n        s += 1;\n      } else {\n        s += 0;\n      }\n    }\n    if (1.00 * s / len1 > r) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "8999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, s = 0;\n  char a[502], b[502];\n  int len1, len2, i;\n  cin >> x >> a >> b;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  s = s / len1;\n  if (s > x) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double bill;\n  cin >> bill;\n\n  char s1[500] = {0};\n  char s2[500] = {0};\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n\n  int lens1, lens2, flag;\n  flag = 0;\n  lens1 = strlen(s1);\n  lens2 = strlen(s2);\n  if (lens1 != lens2) {\n    printf(\"error\");\n    flag = 1;\n  }\n\n  int i;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] != 'A') {\n        if (s1[i] != 'T') {\n          if (s1[i] != 'C') {\n            if (s1[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (flag == 0) {\n    for (i = 0; i < lens2; i++) {\n      if (s2[i] != 'A') {\n        if (s2[i] != 'T') {\n          if (s2[i] != 'C') {\n            if (s2[i] != 'G') {\n              printf(\"error\");\n              flag = 1;\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  double num, avg;\n  num = 0;\n  if (flag == 0) {\n    for (i = 0; i < lens1; i++) {\n      if (s1[i] == s2[i]) {\n        num++;\n      }\n    }\n    avg = num / (double)lens1;\n    if (avg > bill) {\n      printf(\"yes\");\n    }\n    if (avg <= bill) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, c;\n  char s[1000], as[1000];\n  int m, n, t, i, b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", s, as);\n  t = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 65 && s[i] != 67 && s[i] != 71 && s[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  for (i = 0; as[i] != '\\0'; i++) {\n    if (as[i] != 65 && as[i] != 67 && as[i] != 71 && as[i] != 84) {\n      t = -1;\n      break;\n    }\n  }\n  m = strlen(s);\n  n = strlen(as);\n  if (m != n) {\n    t = -1;\n  }\n  b = 0;\n  if (t == 0) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == as[i]) {\n        b++;\n      }\n    }\n    c = 1.0 * b / m;\n    if (c > a) {\n      t = 1;\n    } else {\n      t = 0;\n    }\n  }\n  if (t == -1) {\n    printf(\"error\\n\");\n  }\n  if (t == 0) {\n    printf(\"no\\n\");\n  }\n  if (t == 1) {\n    printf(\"yes\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double percent;\n  char a[501], b[501];\n  int number = 0;\n  int i;\n  scanf(\"%lf\", &percent);\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      number++;\n    }\n  }\n  if ((double)number > ((double)strlen(a)) * percent)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, js, l;\n  char c[600], d[600];\n  double a, b;\n  cin >> a >> c >> d;\n  if (strlen(c) != strlen(d)) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(c);\n  js = 0;\n  for (i = 0; c[i] != '\\0'; i++) {\n    if ((c[i] == 'A' || c[i] == 'G' || c[i] == 'C' || c[i] == 'T') &&\n        (d[i] == 'A' || d[i] == 'G' || d[i] == 'C' || d[i] == 'T')) {\n      if (c[i] == d[i])\n        js++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = 1.0 * js / l;\n  if (b >= a)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "9004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, b;\n  scanf(\"%lf\", &n);\n  int i, m, a, o;\n  a = 0;\n  char ji[1000], yin[1000];\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  m = strlen(ji);\n  o = strlen(yin);\n  if (m != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if ((ji[i] != 'A' && ji[i] != 'C' && ji[i] != 'G' && ji[i] != 'T') ||\n        (yin[i] != 'A' && yin[i] != 'C' && yin[i] != 'G' && yin[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (n >= 1) {\n    printf(\"no\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (ji[i] == yin[i]) {\n      a++;\n    }\n  }\n  b = 1.0 * a / 1.0 * m;\n  if (b >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, x;\n  char dna1[500], dna2[500];\n  int i, j = 0, l1, l2, c = 0;\n  scanf(\"%lf %s %s \", &a, dna1, dna2);\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  if (l1 != l2) {\n    cout << \"error\";\n    c = 1;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n          dna1[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      } else if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' &&\n                 dna2[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      }\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < l1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j = j + 1;\n      }\n    }\n    x = j * 1.0 / l1;\n    if (x > a) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, max, s, f;\n  float a, b;\n  char ch1[600], ch2[600];\n\n  scanf(\"%f\", &a);\n  scanf(\"%s\", ch1);\n  scanf(\"%s\", ch2);\n  m = strlen(ch1);\n  n = strlen(ch2);\n\n  f = 1;\n  if (m != n)\n    f = 0;\n  max = 0;\n\n  if (f)\n    for (i = 0; i < m; i++) {\n      if (((ch1[i] == 'A') || (ch1[i] == 'T') || (ch1[i] == 'C') ||\n           (ch1[i] == 'G')) &&\n          ((ch2[i] == 'A') || (ch2[i] == 'T') || (ch2[i] == 'C') ||\n           (ch2[i] == 'G'))) {\n        if (ch1[i] == ch2[i])\n          max++;\n      } else {\n        f = 0;\n        break;\n      }\n    }\n\n  if (f) {\n    b = (float)max / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z;\n  char sz1[500];\n  char sz2[500];\n  int i, m, n;\n  int x = 1, y = 0;\n  double e;\n  scanf(\"%lf\", &z);\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  m = strlen(sz1);\n  n = strlen(sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    if (sz1[i] == 'A' || sz1[i] == 'G' || sz1[i] == 'C' || sz1[i] == 'T') {\n      continue;\n    } else if (sz1[i] != 'A' || sz1[i] != 'G' || sz1[i] != 'C' ||\n               sz1[i] != 'T') {\n      x = 0;\n      break;\n    }\n  }\n  if ((m != n) || (x == 0)) {\n    cout << \"error\";\n  } else if (m == n && x == 1) {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if (sz1[i] == sz2[i]) {\n        y++;\n      }\n    }\n    e = 1.0 * y / m;\n    if (e > z) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, p;\n  double n, m = 0, b;\n  char d[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", d);\n  scanf(\"%s\", f);\n  l = strlen(d);\n  p = strlen(f);\n  if (l != p) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; d[i]; i++) {\n    if (!(d[i] == 'A' || d[i] == 'T' || d[i] == 'G' || d[i] == 'C')) {\n      cout << \"error\";\n\n      return 0;\n    }\n  }\n  for (i = 0; f[i]; i++) {\n    if (!(f[i] == 'A' || f[i] == 'T' || f[i] == 'G' || f[i] == 'C')) {\n      printf(\"error\");\n\n      return 0;\n    }\n  }\n  for (i = 0; d[i]; i++) {\n    if (d[i] == f[i])\n      m++;\n  }\n  b = m / l;\n  if (b >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  double m;\n  char jianji[2][501];\n  int len1, len2;\n  int i;\n  int sum = 0;\n  scanf(\"%lf%s%s\", &n, jianji[0], jianji[1]);\n  len1 = strlen(jianji[0]);\n  len2 = strlen(jianji[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((jianji[0][i] != 'A' && jianji[0][i] != 'T' && jianji[0][i] != 'C' &&\n           jianji[0][i] != 'G') ||\n          (jianji[1][i] != 'A' && jianji[1][i] != 'T' && jianji[1][i] != 'C' &&\n           jianji[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (jianji[0][i] == jianji[1][i]) {\n        sum += 1;\n      }\n    }\n    m = (1.0 * sum) / len1;\n    if (m > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, j = 0, m, k = 0, l = 0;\n  int o = 0, i;\n  char b[500], c[500];\n  scanf(\"%lf%s%s\", &a, b, c);\n  for (i = 0; b[i] != '\\0'; i++) {\n    k++;\n  }\n  for (i = 0; c[i] != '\\0'; i++) {\n    l++;\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] == c[i]) {\n      j++;\n    }\n  }\n  m = j / k;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') ||\n        (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G')) {\n      o++;\n    }\n  }\n  if (o > 0 || k != l) {\n    cout << \"error\";\n  } else if (m >= a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j = 0;\n  double t;\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      goto q;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      goto q;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n    goto q;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    t = 1.0 * j / len1;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"no\");\n  }\nq:\n  return 0;\n}\n"}
{"label": "5", "index": "9012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, count = 0, i;\n  double result, n;\n  scanf(\"%lf\", &n);\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    cout << \"error\";\n  else {\n    for (i = 0; i < c; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        result = -1;\n        break;\n      } else {\n\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (result != -1) {\n\n      result = (double)count / c;\n      if (result > n)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9013", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char fir[1000];\n  char sec[1000];\n  double l1, l2;\n  int i, j, k;\n  int flag = 0;\n  double m = 0, x, n;\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", &fir);\n  scanf(\"%s\", &sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n\n  for (i = 0; i < l1; i++) {\n    if (fir[i] != 'A' && fir[i] != 'T' && fir[i] != 'C' && fir[i] != 'G') {\n      flag++;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (sec[i] != 'A' && sec[i] != 'G' && sec[i] != 'C' && sec[i] != 'T') {\n      flag++;\n    }\n  }\n  if (l1 != l2) {\n    flag++;\n  }\n\n  if (flag > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (fir[i] == sec[i]) {\n        m++;\n      }\n    }\n    x = m / l1;\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double a;\n  char zfc1[501], zfc2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  x = strlen(zfc1);\n  y = strlen(zfc2);\n  int s = 0;\n  for (i = 0; i < x; i++) {\n    if (zfc1[i] != 'A' && zfc1[i] != 'G' && zfc1[i] != 'C' && zfc1[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  for (i = 0; i < y; i++) {\n    if (zfc2[i] != 'A' && zfc2[i] != 'G' && zfc2[i] != 'C' && zfc2[i] != 'T') {\n      s = 1;\n      break;\n    }\n  }\n  if (x != y || s == 1) {\n    printf(\"error\");\n  } else {\n    int t = 0;\n    for (i = 0; i < x; i++) {\n      if (zfc1[i] == zfc2[i]) {\n        t++;\n      }\n    }\n    double s;\n    s = 1.0 * t / (1.0 * x);\n    if (s > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[500];\n  char b[500];\n\n  scanf(\"%lf\", &n);\n  cin >> a;\n  cin >> b;\n\n  int i, x;\n  x = 0;\n\n  double w, k, j, l;\n\n  k = strlen(a);\n  l = strlen(b);\n\n  if (k == l) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n      if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')\n        x = 1;\n      else {\n        x = 0;\n        break;\n      }\n    }\n    if (x == 1) {\n      w = 0;\n\n      for (i = 0; i < k; i++) {\n        if (a[i] == b[i])\n          w = w + 1;\n      }\n\n      j = w / k;\n\n      if (j <= n)\n        printf(\"no\");\n      else\n        printf(\"yes\");\n    } else\n      printf(\"error\");\n  }\n\n  else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, x;\n  int t = 0, a, b, u = 0;\n  char ji[501], yin[501];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  a = strlen(ji);\n  b = strlen(yin);\n  if (a != b)\n    printf(\"error\");\n  else {\n    for (int q = 0; q < a; q++) {\n      if ((ji[q] != 'A' && ji[q] != 'T' && ji[q] != 'C' && ji[q] != 'G') ||\n          (yin[q] != 'A' && yin[q] != 'C' && yin[q] != 'T' && yin[q] != 'G')) {\n        u = 1;\n      }\n    }\n    if (u == 1) {\n      printf(\"error\");\n    } else {\n      for (int h = 0; h < a; h++) {\n        if (ji[h] == yin[h]) {\n          t++;\n        }\n      }\n      x = 1.0 * t / a;\n      if (x > m) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9017", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, x, y, count = 0;\n  double n, m;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  for (i = 0; a[i] != '\\0', b[i] != '\\0'; i++) {\n    x = strlen(a);\n    y = strlen(b);\n    if (x != y) {\n      printf(\"error\\n\");\n\n      return 0;\n      break;\n    }\n    for (j = 0; a[j] != '\\0'; j++) {\n      if (a[j] != 'A' && a[j] != 'T' && a[j] != 'G' && a[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'G' && b[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n    }\n\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n  m = ((1.0) * count) / x;\n  if (m >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char DNA[2][500];\n  int i;\n  int len[2];\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", DNA[i]);\n    len[i] = strlen(DNA[i]);\n  }\n  int j;\n  int p = 0;\n  for (j = 0; j < len[0]; j++) {\n    if (DNA[0][j] == DNA[1][j]) {\n      p++;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < len[i]; j++) {\n      if (DNA[i][j] != 'A' && DNA[i][j] != 'T' && DNA[i][j] != 'C' &&\n          DNA[i][j] != 'G') {\n        m++;\n      }\n    }\n  }\n  double bi;\n  bi = ((double)p) / ((double)len[0]);\n  if (len[0] != len[1] || m != 0) {\n    cout << \"error\";\n  } else if (bi > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, len1, len2, m = 0, flag = 1;\n  char s[1000] = {\"\"}, t[1000] = {\"\"};\n  float p, q;\n  cin >> p;\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  len1 = strlen(s);\n  len2 = strlen(t);\n  if (len1 != len2) {\n    printf(\"error\");\n    flag = 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G')) {\n        printf(\"error\");\n        flag = 0;\n        break;\n      } else {\n        if (s[i] == t[i])\n          m++;\n      }\n    }\n  }\n  if (flag == 1) {\n    q = (float)m / len1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double e, s;\n  char a[1000], b[1000];\n  int l1, l2, i, j, t;\n\n  scanf(\"%lf\", &e);\n  scanf(\"%s %s\", &a, &b);\n\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  for (j = 0; j < l2; j++) {\n    if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G') {\n      printf(\"error \");\n      return 0;\n    }\n  }\n\n  if (l1 != l2) {\n    printf(\"error \");\n  }\n\n  else if (l1 == l2) {\n    t = 0;\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t++;\n      }\n    }\n    s = 1.0 * t / l1;\n    if (s > e) {\n      printf(\"yes \");\n    } else {\n      printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, m, n = 0, p, q;\n  int i, t = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  q = strlen(a);\n  p = strlen(b);\n  if (q != p) {\n    t = t + 1;\n  }\n  for (i = 0; i < q; i++) {\n    if (a[i] != 'T' && a[i] != 'C' && a[i] != 'G' && a[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'T' && b[i] != 'C' && b[i] != 'G' && b[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  if (t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        n = n + 1;\n      }\n    }\n    m = n / p;\n    if (m > c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9022", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int l1, l2, n, i, j, k, num = 0, f = 0;\n  double s, p;\n  scanf(\"%lf\", &s);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    f = 1;\n    return 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    for (i = 0; i < l2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    if (f == 0) {\n      for (i = 0; i < l1; i++) {\n        if (a[i] == b[i])\n          num++;\n      }\n    }\n    if (f == 0) {\n      p = (double)num / l1;\n      if (p > s)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p = 0, q = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  for (i = 0; i < p; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (a[i] == b[i]) {\n      q++;\n    }\n  }\n  if (1.0 * q / p >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, y, x, m, q, p;\n  x = 0;\n  p = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  q = strlen(b);\n  for (int i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  for (int i = 0; i < q; i++) {\n    if (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T') {\n      p = 0;\n      break;\n    }\n  }\n  if (m != q) {\n    p = 0;\n  }\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9025", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, a, b, c, d, e;\n  char w[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", w, f);\n  a = 0;\n  b = 0;\n  c = strlen(w);\n  d = strlen(f);\n  e = 0;\n  if (c != d) {\n    e = 1;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (!(w[i] == 'A' || w[i] == 'C' || w[i] == 'T' || w[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n    for (i = 0; i < d; i++) {\n      if (!(f[i] == 'A' || f[i] == 'C' || f[i] == 'T' || f[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n  }\n  if (e == 1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if (w[i] == f[i]) {\n        a++;\n      }\n      b++;\n    }\n    m = 1.0 * a / b;\n    if (m >= n) {\n      printf(\"yes\");\n    } else if (m < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9026", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int q, w, e = 0, r = 1, i;\n  double a, b;\n  char A[1000], B[1000];\n  scanf(\"%lf\", &a);\n  cin >> A;\n  scanf(\"%s\", B);\n  q = strlen(A);\n  w = strlen(B);\n\n  if (q != w) {\n    printf(\"error\");\n    r = -1;\n  } else {\n    for (i = 0; A[i] != '\\0'; i++) {\n\n      if ((A[i] != 'T' && A[i] != 'C' && A[i] != 'A' && A[i] != 'G') ||\n          (B[i] != 'T' && B[i] != 'C' && B[i] != 'A' && B[i] != 'G')) {\n        r = -1;\n        printf(\"error\");\n        break;\n      } else if (A[i] != B[i])\n        continue;\n      else if (A[i] == B[i]) {\n        e++;\n      }\n    }\n  }\n\n  if (r == 1) {\n    b = (e * 1.0) / (q * 1.0);\n\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, count;\n  double a, x, y, z;\n  char m[550], n[550];\n  scanf(\"%lf\\n%s\\n%s\\n\", &a, m, n);\n  b = strlen(m);\n  c = strlen(n);\n  if (b != c)\n    printf(\"error\");\n  j = 0;\n  if (b == c) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G')\n        j++;\n    }\n    for (i = 0; n[i] != '\\0'; i++) {\n      if (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')\n        j++;\n    }\n    if (j > 0)\n      printf(\"error\");\n  }\n  count = 0;\n  if (b == c && j == 0) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] == n[i])\n        count++;\n    }\n    y = count;\n    z = b;\n    x = z * a;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  int s = 0, len1, len2, i;\n  char b[501], c[501], e[501];\n  scanf(\"%lf\", &n);\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n\n  cin >> e;\n  len1 = strlen(c);\n  len2 = strlen(e);\n  for (i = 0; i < len1; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G') {\n      len1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (e[i] != 'A' && e[i] != 'T' && e[i] != 'C' && e[i] != 'G') {\n      len2 = 2;\n      break;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (c[i] == e[i]) {\n        s++;\n      }\n    }\n    if (1.0 * s / len1 >= n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9029", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n;\n  int i, l, s = 0, q = 0;\n  char a[550], b[550];\n  cin >> m;\n  cin >> a;\n  scanf(\"%s\", b);\n  l = strlen(a);\n  if (l != strlen(b)) {\n    q = 1;\n  }\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      q = 1;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      q = 1;\n    }\n  }\n  if (q == 0) {\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        s += 1;\n      }\n    }\n    n = 1.00 * s / l;\n    if (m < n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, d, e, f, r;\n  double a, g;\n  r = 0;\n  scanf(\"%lf\", &a);\n  char b[501], c[501];\n  for (i = 0; i < 2; i++) {\n    if (i == 0) {\n      scanf(\"%s\", b);\n      m = strlen(b);\n    } else {\n      scanf(\"%s\", c);\n      d = strlen(c);\n    }\n  }\n  if (m >= d) {\n    f = m;\n  } else {\n    f = d;\n  }\n  e = 0;\n  for (i = 0; i < f; i++) {\n    if ((b[i] == 'A' || (b[i] == 'T') || b[i] == 'C' || b[i] == 'G') &&\n        (c[i] == 'A' || (c[i] == 'T') || c[i] == 'C' || c[i] == 'G')) {\n      if (c[i] == b[i]) {\n        e++;\n      }\n    } else {\n      r = 1;\n      break;\n    }\n  }\n  if ((m == d) && (r == 0)) {\n    g = 1.0 * e / m;\n    if (g > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9031", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m;\n  char a[10000], b[10000];\n  scanf(\"%lf \", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int l = strlen(a), k = 0;\n  for (int i = 0; i < l; i++) {\n    if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  double j;\n  j = 1.0 * k / l;\n  if (j > m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, c;\n  int b = 0, p = 1, i;\n  scanf(\"%lf\", &n);\n  char a[2][501];\n  scanf(\"%s\", a[0]);\n  cin >> a[1];\n  for (i = 0; i < 501; i++) {\n    if (a[0][i] == '\\0') {\n      if (a[1][i] != '\\0') {\n        p = 0;\n      }\n      break;\n    }\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G') {\n      p = 0;\n      break;\n    }\n    if (a[1][i] != 'A' && a[1][i] != 'T' && a[1][i] != 'C' && a[1][i] != 'G') {\n      p = 0;\n      break;\n    }\n\n    if (a[0][i] == a[1][i]) {\n      b = b + 1;\n    }\n  }\n  c = b * 1.0 / i;\n\n  if (p == 0) {\n    printf(\"error\");\n  } else {\n    if (c > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, sum = 0, i, k = 0;\n  float n;\n  char a[1000];\n  char b[1000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    k = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n\n      else if (a[i] == b[i])\n        sum++;\n    }\n    if (k == 0) {\n      if (1.0 * sum / len1 > n)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, q = 1;\n  double s = 0.0, len, res, req;\n  char a[1000], b[1000];\n  scanf(\"%lf \", &req);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n      q = 0;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      q = 0;\n  }\n  if (q == 0)\n    cout << \"error\\n\";\n  else if (q != 0) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    res = s / len * 1.0;\n    if (req < res)\n      printf(\"yes\\n\");\n    else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9035", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k = 0, len1, len2, temp = 0;\n  char str1[600], str2[600];\n  double p;\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", str1, str2);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' &&\n           str1[i] != 'G') ||\n          (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n           str2[i] != 'G')) {\n        printf(\"error\");\n        temp = 1;\n        break;\n      }\n      if (str1[i] == str2[i]) {\n        k++;\n      }\n    }\n    if (temp == 0) {\n\n      if (k * 1.0 / len1 > p) {\n        printf(\"yes\");\n      } else {\n        if (k * 1.0 / len1 <= p) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n, r;\n  int a, b, c;\n  int i, j;\n  char d1[600];\n  char d2[600];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  a = strlen(d1);\n  b = strlen(d2);\n  c = 0;\n  if (a == b) {\n    for (i = 0; i < a; i++) {\n      if (((d1[i] != 'A') && (d1[i] != 'T') && (d1[i] != 'C') &&\n           (d1[i] != 'G')) ||\n          ((d2[i] != 'A') && (d2[i] != 'T') && (d2[i] != 'C') &&\n           (d2[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (d1[i] == d2[i]) {\n          c++;\n        }\n      }\n      r = 1.0 * c / a;\n    }\n    if (r > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[510], d[510];\n  int i, e;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", d);\n  e = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(d);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n      if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == d[i]) {\n          e++;\n        }\n      }\n    }\n    bl = 1.0 * e / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t = 0, flag = 0, l;\n  float x;\n  char str[2][100];\n  scanf(\"%f%s%s\", &x, str[0], str[1]);\n  if (strlen(str[0]) != strlen(str[1]))\n    flag = 1;\n  else {\n    l = strlen(str[0]);\n    for (i = 0; i < l; i++) {\n      if ((str[0][i] != 'A' && str[0][i] != 'T' && str[0][i] != 'C' &&\n           str[0][i] != 'G') ||\n          (str[1][i] != 'A' && str[1][i] != 'T' && str[1][i] != 'C' &&\n           str[1][i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (str[0][i] == str[1][i]) {\n        t++;\n      }\n    }\n  }\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (((float)t / strlen(str[1])) >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9039", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint yn(char x);\nint main() {\n  char a[501], b[501];\n  double q, p;\n  int i, s, l1, l2, o;\n  scanf(\"%lf %s %s \", &p, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  o = 0;\n  if (l1 != l2)\n    o = 1;\n  for (i = 0; i < l1; i++)\n    if (yn(a[i]) == 1) {\n      o = 1;\n      break;\n    }\n  for (i = 0; i < l2; i++)\n    if (yn(b[i]) == 1) {\n      o = 1;\n      break;\n    }\n  if (o == 1)\n    printf(\"error\");\n  else {\n    s = 0;\n    for (i = 0; i < l1; i++)\n      if ((a[i]) == b[i])\n        s = s + 1;\n    q = 1.0 * s / l1;\n    if (q > p)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\nint yn(char x) {\n  int a;\n  if ((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))\n    a = 0;\n  else\n    a = 1;\n  return a;\n}\n"}
{"label": "5", "index": "9040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501] = {'\\0'}, b[501] = {'\\0'};\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x, y;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    int count = 0, so = 0;\n    double rate;\n    for (int i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        count++;\n      }\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        cout << \"error\";\n        so = 100;\n        break;\n      }\n    }\n    if (so != 100) {\n      rate = count * 1.0 / x;\n      if (rate > n)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, sum = 0, flag = 1;\n  double n1, n;\n  char a[512], b[512];\n  scanf(\"%lf%s%s\", &n, a, b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\\n\");\n  else {\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')\n        flag = 0;\n    }\n    for (i = 0; b[i] != 0; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n        flag = 0;\n    }\n    if (flag) {\n      for (i = 0; a[i] != 0; i++) {\n        if (a[i] == b[i])\n          sum++;\n      }\n      n1 = (double)sum / (double)strlen(a);\n      if (n1 > n)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], x, y;\n  int i, j, k, m, n = 0, z = 0;\n  double o, p;\n  scanf(\"%lf\", &p);\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  k = strlen(c);\n  if (m != k) {\n    cout << \"error\";\n    z = 1;\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if ((b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n          (c[i] != 'A' && c[i] != 'T' && c[i] != 'G' && c[i] != 'C')) {\n        printf(\"error\");\n        z = 1;\n        break;\n      }\n    }\n  }\n  if (z == 0) {\n    for (i = 0; i < m; i++) {\n      if (b[i] == c[i])\n        n++;\n    }\n    o = 1.0 * n / m;\n    if (o > p)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  scanf(\"%d\", &j);\n  return 0;\n}\n"}
{"label": "5", "index": "9043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag1 = 0, flag2 = 0;\n  char dna1[501], dna2[501];\n  double b, b2;\n  scanf(\"%lf\", &b);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n        (dna1[i] == 'G')) {\n      continue;\n    } else {\n      flag1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n        (dna2[i] == 'G')) {\n      continue;\n    } else {\n      flag2 = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || (flag1 == 1) || (flag2 == 1)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j++;\n      }\n    }\n    b2 = 1.0 * j / len1;\n    if (b2 > b) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, c, d, k = 0;\n  int i, e = 1;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\\n%s\", &a, &b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    cout << \"error\";\n  } else if (c == d) {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        e = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          k = k + 1;\n        }\n      }\n    }\n    if (e == 0) {\n      cout << \"error\";\n    } else if (k != 0 && (k / c) >= n) {\n      printf(\"yes\");\n    } else if (e == 1 && (k / c) < n) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, count = 0;\n  double bl;\n  char a[508], b[508];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s%s\", a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != 0; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; b[i] != 0; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n  if ((1.0 * count / (strlen(a))) > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int r, t, n, q, e, i;\n  double m, w;\n  n = 0;\n  r = 0;\n  scanf(\"%lf %s %s\", &m, a, b);\n  q = strlen(a);\n  e = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      r++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      r++;\n    }\n  }\n  if (q != e || r != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      t = a[i] - b[i];\n      if (t == 0) {\n        n++;\n      }\n    }\n    w = 1.0 * n / q;\n    if (w > m) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[2][501];\n  double n;\n  double sum = 0, x, Len;\n  int len, i, len2, j;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", s[0], s[1]);\n  len = strlen(s[0]);\n  len2 = strlen(s[1]);\n  if (len != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; j < len; j++) {\n        if (s[i][j] != 'A' && s[i][j] != 'T' && s[i][j] != 'G' &&\n            s[i][j] != 'C') {\n          printf(\"error\");\n          return 0;\n        } else\n          continue;\n      }\n    }\n  }\n\n  for (i = 0; i < len; i++) {\n    if (s[0][i] == s[1][i])\n      sum = sum + 1;\n  }\n  Len = (double)len;\n  x = sum / Len;\n  if (x >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int n, i, j;\n  double r, m = 0, l = 0;\n  cin >> r;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else if (strlen(a) == strlen(b)) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        cout << \"error\";\n        return 0;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n  }\n  l = strlen(a);\n  if (m / l > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, n, L, t;\n  double q, p;\n  char a[501], b[501];\n  n = 0;\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  L = strlen(b);\n\n  if (l != L)\n    printf(\"error\\n\");\n  else {\n    t = 1;\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        t = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        n++;\n      }\n    }\n    if (t == 1) {\n      q = 1.0 * n / l;\n      if (q > p) {\n        printf(\"yes\\n\");\n      } else {\n        cout << \"no\\n\";\n      }\n    }\n    if (t == 0) {\n      printf(\"error\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  double w;\n  int count = 0, lena, lenb;\n  cin >> w;\n  cin >> a;\n  cin >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  if (lena != lenb)\n    printf(\"error\");\n  else {\n    int i, j, k = 0;\n    for (i = 0; i < lena; i++) {\n      if (!((a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') &&\n            (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T'))) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < lena; j++) {\n        if (a[j] == b[j])\n          count++;\n      }\n      double what;\n      what = (double)count / lena;\n      if (what >= w)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0, b, c;\n  char zfc[2][501];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  b = strlen(zfc[0]);\n  c = strlen(zfc[1]);\n  if (b != c) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; zfc[0][i] != '\\0'; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (zfc[0][i] == zfc[1][i]) {\n        j++;\n      }\n    }\n  }\n  if ((double)1.0 * j / strlen(zfc[0]) > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9052", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m = 0;\n  double sum = 0, n;\n  char gene[3][501];\n\n  scanf(\"%lf\", &n);\n  cin >> gene[0];\n  cin >> gene[1];\n  if (strlen(gene[0]) != strlen(gene[1]))\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; gene[i][j] != '\\0'; j++) {\n        if (gene[i][j] != 'A' && gene[i][j] != 'T' && gene[i][j] != 'C' &&\n            gene[i][j] != 'G') {\n          printf(\"error\");\n          m = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; gene[0][i] != '\\0'; i++) {\n      if (gene[0][i] == gene[1][i])\n        sum++;\n    }\n    if (sum / strlen(gene[0]) > n && m == 0)\n      printf(\"yes\");\n    else if (sum / strlen(gene[0]) <= n && m == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int count = 0, i;\n  char a[501], b[501];\n  cin >> n >> a >> b;\n  if ((int)strlen(a) != (int)strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < (int)strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else if (a[i] == b[i]) {\n        count++;\n      }\n    }\n    if (1.0 * count / (int)strlen(a) >= n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char x[501], y[501], m = 0, n = 0, i, p = 0, q = 0;\n  double a, b;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; x[i]; i++) {\n    if (x[i] != 'A' && x[i] != 'C' && x[i] != 'G' && x[i] != 'T') {\n      q++;\n    }\n    m++;\n  }\n  for (i = 0; y[i]; i++) {\n    if (y[i] != 'A' && y[i] != 'C' && y[i] != 'G' && y[i] != 'T') {\n      q++;\n    }\n    p++;\n  }\n  if (m != p || q != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (x[i] == y[i]) {\n        n++;\n      }\n    }\n    b = 1.0 * n / m;\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, x, y, z, c;\n  double n, p;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  z = 0;\n  c = 0;\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        c++;\n        if (a[i] == b[i]) {\n          z++;\n        }\n      }\n    }\n    p = 1.000 * z / x;\n    if (c == x && p > n) {\n      printf(\"yes\");\n    } else {\n      if (c == x && p <= n) {\n        printf(\"no\");\n      } else if (c != x) {\n        printf(\"error\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double w, e, k = 0.0;\n  char a[501], b[501];\n  cin >> w >> a >> b;\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m != n) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      i = n + 1;\n      break;\n    } else if (a[i] == b[i]) {\n      k = k + 1;\n      e = 1.0 * k / n;\n    }\n  }\n  if (e > w && i == n)\n    printf(\"yes\\n\");\n  else if (e <= w && i == n)\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double x, y, o = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  cin >> a >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if ((a[i] == 65 || a[i] == 71 || a[i] == 67 || a[i] == 84) &&\n          (b[i] == 65 || b[i] == 71 || b[i] == 67 || b[i] == 84)) {\n        if (a[i] == b[i]) {\n          o++;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == m) {\n      y = o / n;\n      if (y >= x) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  int p = 0, n, m, k = 0;\n  char sb[531] = {0};\n  char dsb[531] = {0};\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", sb, dsb);\n  for (int i = 0; i < 531; i++) {\n    if (sb[i] == dsb[i] && sb[i] != 0) {\n      p++;\n    }\n    if (((sb[i] != 'A') && (sb[i] != 'C') && (sb[i] != 'T') && (sb[i] != 'G') &&\n         (sb[i] != 0)) ||\n        ((dsb[i] != 'A') && (dsb[i] != 'C') && (dsb[i] != 'T') &&\n         (dsb[i] != 'G') && (dsb[i] != 0)))\n      k = 1;\n  }\n  n = strlen(sb);\n  m = strlen(dsb);\n  b = 1.0 * p / n;\n  if (m != n || k == 1)\n    printf(\"error\");\n  else if (b > a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double n, j = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\\n\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    i = strlen(a);\n    j = j / i;\n    if (j > n)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, n, m, t = 0, k = 0;\n  char x[501], y[501];\n  scanf(\"%lf \", &a);\n\n  cin >> x;\n\n  cin >> y;\n  n = strlen(x);\n  m = strlen(y);\n  if (n != m)\n    printf(\"error \");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'T' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'T' && y[i] != 'C')) {\n        k = 1;\n        printf(\"error \");\n        break;\n      } else if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (k != 1) {\n      if ((double)((double)t / (double)n) > a)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cuo(char a) {\n  if (a != 'A' && a != 'T' && a != 'C' && a != 'G')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char a[510] = {0};\n  char b[510] = {0};\n  double bili;\n  cin >> bili >> a >> b;\n  double zong = 0, dui = 0;\n  for (int i = 0; i <= 500; i++) {\n    if (a[i] == 0 || b[i] == 0) {\n      if (a[i] == 0 && b[i] == 0)\n        break;\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    if (cuo(a[i]) || cuo(b[i])) {\n      cout << \"error\";\n      return 0;\n    }\n    zong++;\n    if (a[i] == b[i])\n      dui++;\n  }\n  if (dui / zong > bili)\n    cout << \"yes\";\n  else\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "9062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m = 0;\n  float k = 0, n;\n  char a[502], b[502];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < (strlen(a)); i++) {\n    if (strlen(a) != strlen(b)) {\n      m = 0;\n      break;\n    }\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      m++;\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      m = 0;\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"error\");\n  } else {\n    if ((k / (strlen(a) * 1.00)) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9063", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, w, s;\n  float n, p, q, o;\n  char a[10000], b[10000];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  i = strlen(a);\n  j = strlen(b);\n  w = 0;\n  s = 0;\n  for (k = 0; a[k]; k++) {\n    if (a[k] != 'A' && a[k] != 'T' && a[k] != 'G' && a[k] != 'C') {\n      w++;\n    }\n  }\n  for (k = 0; b[k]; k++) {\n    if (b[k] != 'A' && b[k] != 'T' && b[k] != 'G' && b[k] != 'C') {\n      w++;\n    }\n  }\n  if ((i != j) || w != 0) {\n    printf(\"error\");\n  } else {\n    for (l = 0; a[l]; l++) {\n      if (a[l] == b[l]) {\n        s++;\n      }\n    }\n    p = i;\n    q = s;\n    o = q / p;\n    if (o > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, x, y, count = 0;\n  double n, m;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  cin >> b;\n  for (i = 0; a[i] != '\\0', b[i] != '\\0'; i++) {\n    x = strlen(a);\n    y = strlen(b);\n    if (x != y) {\n      printf(\"error\\n\");\n\n      return 0;\n      break;\n    }\n    for (j = 0; a[j] != '\\0'; j++) {\n      if (a[j] != 'A' && a[j] != 'T' && a[j] != 'G' && a[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'G' && b[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n    }\n\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n  m = ((1.0) * count) / x;\n  if (m >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x = 0;\n  double n;\n  char su[500], zu[500];\n  scanf(\"%lf %s %s\", &n, su, zu);\n  if (strlen(su) != strlen(zu)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(su); i++) {\n    if ((su[i] != 'A' && su[i] != 'T' && su[i] != 'G' && su[i] != 'C') ||\n        (zu[i] != 'A' && zu[i] != 'T' && zu[i] != 'G' && zu[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (su[i] == zu[i]) {\n      x++;\n    }\n  }\n  if (x / (1.0 * strlen(su)) > n) {\n    printf(\"yes\");\n    return 0;\n  }\n  cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "9066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, l, n;\n  double d, b;\n  char x[501];\n  char y[501];\n\n  a = 0;\n  l = 0;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  n = strlen(x);\n\n  if (strlen(x) != strlen(y)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        a = 1;\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          l++;\n        }\n      }\n    }\n\n    if (a == 0) {\n      b = (double)l / (double)n;\n\n      if (b >= d) {\n        printf(\"yes\");\n      } else {\n        if (b < d) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9067", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, a, b, c, d, e;\n  char w[501], f[501];\n  scanf(\"%lf\", &n);\n  cin >> w >> f;\n  a = 0;\n  b = 0;\n  c = strlen(w);\n  d = strlen(f);\n  e = 0;\n  if (c != d) {\n    e = 1;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (!(w[i] == 'A' || w[i] == 'C' || w[i] == 'T' || w[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n    for (i = 0; i < d; i++) {\n      if (!(f[i] == 'A' || f[i] == 'C' || f[i] == 'T' || f[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < d; i++) {\n      if (w[i] == f[i]) {\n        a++;\n      }\n      b++;\n    }\n    m = 1.0 * a / b;\n    if (m >= n) {\n      printf(\"yes\");\n    } else if (m < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1, len2;\n  double n, j = 0, e = 0;\n  char s[501], a[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  len1 = strlen(s);\n  len2 = strlen(a);\n  if (len1 != len2) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n        (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if ((s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' ||\n         a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        s[i] == a[i]) {\n      j = j + 1;\n    }\n  }\n  e = j / len1;\n  if (e > n) {\n    printf(\"yes\");\n  } else {\n    if (e <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int w = 0, g = 0;\n\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        printf(\"error\");\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      printf(\"yes\");\n    } else if ((l <= n) && (g == 0)) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a, b;\n  char s[501], t[501];\n  char *p, *q;\n  int m = 0, n, l;\n  cin >> a >> s >> t;\n  n = strlen(s);\n  l = strlen(t);\n  if (n == l) {\n    p = s;\n    q = t;\n    while (*p != '\\0') {\n      if (*p != 'A' && *p != 'T' && *p != 'C' && *p != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (*q != 'A' && *q != 'T' && *q != 'C' && *q != 'G') {\n          printf(\"error\");\n          return 0;\n        } else {\n          if (*p == *q) {\n            m++;\n          }\n          p++;\n          q++;\n        }\n      }\n    }\n    b = m * 1.0 / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "9071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, i;\n  double e;\n  char str[501], s[501];\n  scanf(\"%lf\", &e);\n  scanf(\"%s %s\", str, s);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != 'A' && str[i] != 'T' && str[i] != 'G' && str[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(str) != strlen(s))\n    printf(\"error\");\n  else if (strlen(str) == strlen(s)) {\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (str[i] == s[i]) {\n        k++;\n      }\n    }\n    if ((1.0 * k / n) > e)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k1, k2, q, i, w, sum = 0;\n  double n, r;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  k1 = strlen(dna1);\n  k2 = strlen(dna2);\n  if (k1 != k2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < k1; i++) {\n      q = dna1[i];\n      w = dna2[i];\n      if ((q == 65 || q == 84 || q == 67 || q == 71) &&\n          (w == 65 || w == 84 || w == 67 || w == 71)) {\n        if (q == w) {\n          sum++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  r = 1.0 * sum / k1;\n  if (r > n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, t, l, p, sum = 0;\n\n  double b, n;\n\n  char z[500], s[500];\n\n  scanf(\"%lf\", &n);\n\n  cin >> z;\n\n  scanf(\"%s\", s);\n\n  l = strlen(z);\n\n  p = strlen(s);\n\n  if (l != p) {\n\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l; i++) {\n      if (z[i] == 'A' && s[i] == 'A')\n        sum++;\n\n      else if (z[i] == 'T' && s[i] == 'T')\n        sum++;\n\n      else if (z[i] == 'C' && s[i] == 'C')\n        sum++;\n\n      else if (z[i] == 'G' && s[i] == 'G')\n        sum++;\n\n      else if ((z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G') ||\n               (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n        t = 0;\n\n        break;\n      }\n    }\n\n    if (t == 0)\n      printf(\"error\");\n\n    else {\n      b = (double)sum / l;\n\n      if (b > n)\n        cout << \"yes\";\n\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9074", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char a[500], b[500];\n  double x, y, k, n, m;\n  scanf(\"%lf\", &x);\n  cin >> a >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (m == n && (a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T' ||\n                   b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] != 'T')) {\n      if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  y = k / n;\n  if (y > x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag1 = 0, flag2 = 0;\n  char dna1[501], dna2[501];\n  double b, b2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n        (dna1[i] == 'G')) {\n      continue;\n    } else {\n      flag1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n        (dna2[i] == 'G')) {\n      continue;\n    } else {\n      flag2 = 1;\n      break;\n    }\n  }\n  if ((len1 != len2) || (flag1 == 1) || (flag2 == 1)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] == dna2[i]) {\n        j++;\n      }\n    }\n    b2 = 1.0 * j / len1;\n    if (b2 > b) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char DNA1[501], DNA2[501];\n  double rate;\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", DNA1, DNA2);\n  int i, len1, len2, flag = 0;\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  if (len1 != len2) {\n    flag = 1;\n  }\n  for (i = 0; i < len1; i++) {\n    if (DNA1[i] == 'A' || DNA1[i] == 'T' || DNA1[i] == 'C' || DNA1[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (DNA2[i] == 'A' || DNA2[i] == 'T' || DNA2[i] == 'C' || DNA2[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    printf(\"error\\n\");\n  } else {\n    int c = 0;\n    double result;\n    for (i = 0; DNA1[i]; i++) {\n      if (DNA1[i] == DNA2[i]) {\n        c++;\n      }\n    }\n    result = 1.0 * c / len1;\n    if (result > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e = 0, f = 0;\n  char h[1][501], i[1][501];\n  double j, k;\n  scanf(\"%lf%s%s\", &j, h[0], i[0]);\n  b = strlen(h[0]);\n  c = strlen(i[0]);\n  if (b != c) {\n    f++;\n    cout << \"error\";\n  } else {\n    for (d = 0; d < b; d++) {\n      if ((h[0][d] != 'A' && h[0][d] != 'T' && h[0][d] != 'C' &&\n           h[0][d] != 'G') ||\n          (i[0][d] != 'A' && i[0][d] != 'T' && i[0][d] != 'C' &&\n           i[0][d] != 'G')) {\n        printf(\"error\");\n        f++;\n        break;\n      } else {\n        if (h[0][d] == i[0][d]) {\n          e++;\n        }\n      }\n    }\n  }\n  if (f == 0) {\n    k = 1.0 * e / b;\n    if (k > j) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, d = 0, p = 0;\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  for (i = 0; dna1[i] && dna2[i]; i++) {\n    if (m != n) {\n      d++;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna1[i] == dna2[i]) {\n      p++;\n    }\n  }\n  if ((p * 1.0 / m) > b && d == 0)\n    printf(\"yes\");\n\n  if (d != 0) {\n    printf(\"error\");\n  }\n  if ((p * 1.0 / m) <= b && d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, y;\n  int a, b, x = 0, k = 1;\n  char sy[501], se[501];\n  scanf(\"%lf %s %s\", &n, sy, se);\n  a = strlen(sy);\n  b = strlen(se);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < a; i++) {\n      if ((sy[i] == 'A' || sy[i] == 'T' || sy[i] == 'C' || sy[i] == 'G') &&\n          (se[i] == 'A' || se[i] == 'T' || se[i] == 'C' || se[i] == 'G')) {\n        if (sy[i] == se[i]) {\n          x += 1;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0) {\n      printf(\"error\");\n    } else {\n      y = 1.0 * x / a;\n      if (y >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, t = 0;\n  int i, j;\n  cin >> n;\n  char dna1[600], dna2[600];\n  scanf(\"%s %s\", dna1, dna2);\n  int len1 = strlen(dna1), len2 = strlen(dna2);\n  int flag = 1;\n  for (i = 0, j = 0; i < len1, j < len2; i++, j++) {\n    if (len1 != len2 ||\n        dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G' ||\n        dna2[j] != 'A' && dna2[j] != 'T' && dna2[j] != 'C' && dna2[j] != 'G') {\n      printf(\"error\");\n      flag = 0;\n      break;\n    }\n    if (dna1[i] == dna2[j]) {\n      t++;\n    }\n  }\n\n  if (flag == 1) {\n    if (t / len1 > n) {\n      cout << \"yes\";\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, b, c, d = 1, e = 1, f = 0;\n  double a, g;\n  char s[500], z[500];\n  cin >> a;\n  cin >> s;\n  b = strlen(s);\n  scanf(\"%s\", z);\n  c = strlen(z);\n  if (b != c) {\n    printf(\"error\");\n    d = 0;\n    e = 0;\n  }\n  if (d == 1) {\n    for (i = 0; i < b; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n        printf(\"error\");\n        e = 0;\n        break;\n      }\n    }\n  }\n  if (d == 1 && e == 1) {\n    for (i = 0; i < b; i++) {\n      if (s[i] == z[i]) {\n        f++;\n      }\n    }\n    g = (1.0 * f) / b;\n    if (g > a) {\n      printf(\"yes\");\n    }\n    if (g <= a) {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, k;\n  n = 0;\n  k = 1;\n  double s;\n  char x1[501], x2[501];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", x1);\n  scanf(\"%s\", x2);\n  l1 = strlen(x1);\n  l2 = strlen(x2);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if (!(x1[i] == 'A' || x1[i] == 'C' || x1[i] == 'G' || x1[i] == 'T')) {\n        cout << \"error\";\n        k = 0;\n        break;\n      }\n      if (!(x2[i] == 'A' || x2[i] == 'C' || x2[i] == 'G' || x2[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (x1[i] == x2[i]) {\n        n++;\n      }\n    }\n    if (k) {\n      if (1.0 * n / l1 > s) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9083", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, m, d;\n  int a, b, i, c;\n  char u[500], v[500];\n  cin >> n;\n  scanf(\"%s \", u);\n  scanf(\"%s\", v);\n  a = strlen(u);\n  b = strlen(v);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    c = 0;\n    for (i = 0; u[i] != '\\0'; i++) {\n      if (u[i] != 'A' && u[i] != 'T' && u[i] != 'G' && u[i] != 'C' &&\n          v[i] != 'A' && v[i] != 'T' && v[i] != 'G' && v[i] != 'C') {\n        printf(\"error\");\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0)\n\n    {\n      d = 0;\n      for (i = 0; u[i] != '\\0'; i++) {\n        if (u[i] == v[i])\n          d++;\n      }\n      m = d / (1.0 * (a - 1));\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[501];\n  char s2[501];\n  double p, q;\n  int m, n, j, k = 0;\n  scanf(\"%lf\", &p);\n\n  scanf(\"%s%s\", s1, s2);\n  m = strlen(s1);\n  n = strlen(s2);\n  for (j = 0; s1[j], s2[j]; j++) {\n    if (!(s1[j] == 'A' || s1[j] == 'T' || s1[j] == 'G' || s1[j] == 'C') ||\n        !(s2[j] == 'A' || s2[j] == 'T' || s2[j] == 'G' || s2[j] == 'C') ||\n        m != n) {\n      k = m + 1;\n      break;\n    } else if (s1[j] == s2[j])\n      k++;\n  }\n  q = 1.0 * k / m;\n  if (k == m + 1)\n    printf(\"error\");\n  else if (q > p)\n    printf(\"yes\");\n  else if (q <= p)\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m = 0;\n  float k = 0, n;\n  char a[502], b[502];\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < (strlen(a)); i++) {\n    if (strlen(a) != strlen(b)) {\n      m = 0;\n      break;\n    }\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      m++;\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      m = 0;\n      break;\n    }\n  }\n  if (m == 0) {\n    printf(\"error\");\n  } else {\n    if ((k / (strlen(a) * 1.00)) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, f = 0, e = 0, i;\n  double a, h;\n  char d[3][502];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++)\n    cin >> d[i];\n\n  b = strlen(d[0]);\n  c = strlen(d[1]);\n  if (b == c) {\n    for (f = 0; f < b; f++) {\n      if (d[0][f] == d[1][f]) {\n        e++;\n      }\n    }\n    for (f = 0; f < b; f++) {\n      if ((d[0][f] != 'A' && d[0][f] != 'G' && d[0][f] != 'C' &&\n           d[0][f] != 'T') ||\n          (d[1][f] != 'A' && d[1][f] != 'G' && d[1][f] != 'C' &&\n           d[1][f] != 'T')) {\n        break;\n      }\n    }\n    if (f == b) {\n      h = e * 1.0 / b;\n      if (h > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      cout << \"error\";\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m;\n  char a[10000], b[10000];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int l = strlen(a), k = 0;\n  for (int i = 0; i < l; i++) {\n    if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  double j;\n  j = 1.0 * k / l;\n  if (j > m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, t = 0;\n  int i, j;\n  scanf(\"%lf\", &n);\n  char dna1[600], dna2[600];\n  scanf(\"%s %s\", dna1, dna2);\n  int len1 = strlen(dna1), len2 = strlen(dna2);\n  int flag = 1;\n  for (i = 0, j = 0; i < len1, j < len2; i++, j++) {\n    if (len1 != len2 ||\n        dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G' ||\n        dna2[j] != 'A' && dna2[j] != 'T' && dna2[j] != 'C' && dna2[j] != 'G') {\n      printf(\"error\");\n      flag = 0;\n      break;\n    }\n    if (dna1[i] == dna2[j]) {\n      t++;\n    }\n  }\n\n  if (flag == 1) {\n    if (t / len1 > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bl, jl;\n  scanf(\"%lf\", &bl);\n  char dna1[501], dna2[501];\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  int i, k = 0, l, n = 0;\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n         dna1[i] != 'T') ||\n        (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n         dna2[i] != 'T')) {\n      k++;\n    }\n  }\n  if (k > 0) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (dna1[i] == dna2[i]) {\n        n++;\n      }\n    }\n    jl = 1.0 * n / (l - 1);\n    if (jl > bl) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, a;\n  int b = 0;\n  double n, k;\n  char l1[500];\n  char l2[500];\n  a = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", l1);\n  cin >> l2;\n  for (i = 0; i < strlen(l1); i++) {\n    if (l1[i] < 'A' || l1[i] > 'Z' || l2[i] < 'A' || l2[i] > 'Z')\n      b = 1;\n  }\n  if (strlen(l1) != strlen(l2) || b == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(l1); i++) {\n      if (l1[i] == l2[i]) {\n        a++;\n      }\n    }\n    k = 1.0 * a / strlen(l1);\n    if (k > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, x, y, z, c;\n  double n, p;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  x = strlen(a);\n  y = strlen(b);\n  z = 0;\n  c = 0;\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        c++;\n        if (a[i] == b[i]) {\n          z++;\n        }\n      }\n    }\n    p = 1.000 * z / x;\n    if (c == x && p > n) {\n      cout << \"yes\";\n    } else if (c == x && p <= n) {\n      printf(\"no\");\n    } else if (c != x) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, f;\n  int x, y, b = 0, c = 0;\n  char d1[501], d2[501];\n  scanf(\"%f\", &a);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  x = strlen(d1);\n  y = strlen(d2);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (int i = 0; i <= x - 1; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        if (d1[i] == d2[i])\n          b++;\n      } else {\n        c = 1;\n        break;\n      }\n    }\n    f = (float)b / (float)x;\n    if (c == 0 && f > a)\n      printf(\"yes\");\n    else if (c == 0 && f <= a) {\n      printf(\"no\");\n    } else {\n      printf(\"error\");\n    }\n  }\n}\n"}
{"label": "5", "index": "9093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k1, k2, q, i, w, sum = 0;\n  double n, r;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  k1 = strlen(dna1);\n  k2 = strlen(dna2);\n  if (k1 != k2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < k1; i++) {\n      q = dna1[i];\n      w = dna2[i];\n      if ((q == 65 || q == 84 || q == 67 || q == 71) &&\n          (w == 65 || w == 84 || w == 67 || w == 71)) {\n        if (q == w)\n          sum++;\n\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  r = 1.0 * sum / k1;\n  if (r > n) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int la, lb, i, d;\n  double t, tt;\n  char a[505], b[505];\n  scanf(\"%lf\", &t);\n  scanf(\"%s\", a);\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  d = -1;\n  if (la == lb) {\n    d = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] == b[i])\n        d++;\n\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        d = -1;\n        break;\n      }\n    }\n  }\n  if (d < 0)\n    printf(\"error\");\n  else {\n    tt = d * 1.000 / la;\n    if (tt > t)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, f, e, d, k;\n\n  double r, n;\n  char s[10000], w[100000];\n  e = 0;\n  k = 0;\n  scanf(\"%lf\", &n);\n  cin >> s;\n  scanf(\"%s\", w);\n  m = strlen(s);\n  k = strlen(w);\n  for (i = 0; i < m; i++) {\n\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (w[i] != 'A' && w[i] != 'G' && w[i] != 'C' && w[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (k != m) {\n      printf(\"error\");\n      break;\n    }\n    if (s[i] == w[i])\n      e++;\n    if (i == m - 1) {\n      r = e * 1.0 / m;\n      if (r >= n)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double d;\n  scanf(\"%lf\", &d);\n  char s[100];\n  char u[100];\n  cin >> s >> u;\n  int f = 0;\n  int t = 0, i, r = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    t++;\n  }\n  for (i = 0; u[i] != '\\0'; i++) {\n    r++;\n  }\n  if (r != t) {\n    printf(\"error\\n\");\n    return 0;\n  } else {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') {\n        cout << \"error\\n\";\n        return 0;\n      } else if (u[i] != 'A' && u[i] != 'T' && u[i] != 'C' && u[i] != 'G') {\n        printf(\"error\\n\");\n        return 0;\n      } else if (s[i] == u[i]) {\n        f++;\n      }\n    }\n    if (f * 1.0 / t >= d) {\n      printf(\"yes\\n\");\n      return 0;\n    } else {\n      cout << \"no\\n\";\n      return 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double b;\n  char x[1000], y[1000];\n  int i, t, a1, a2, p1, p2;\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  t = 0;\n  a1 = 0;\n  a2 = 0;\n  p1 = 0;\n  p2 = 0;\n  for (i = 0; x[i] != 0; i++) {\n    a1++;\n    if (x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 'A') {\n      p1++;\n    }\n  }\n  for (i = 0; y[i] != 0; i++) {\n    a2++;\n    if (y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 'A') {\n      p2++;\n    }\n  }\n  if (p1 > 0 || p2 > 0 || a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; y[i] != 0; i++) {\n      if (x[i] == y[i]) {\n        t++;\n      }\n    }\n    if (1.0 * t / a1 > b) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x, y;\n  char a[501], b[501];\n  int i, t = 0, m = 0, n = 0, mark = 1;\n  scanf(\"%lf\", &x);\n  getchar();\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; a[i]; i++) {\n    m = m + 1;\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n      mark = 0;\n  }\n  for (i = 0; b[i]; i++) {\n    n = n + 1;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      mark = 0;\n  }\n  if (m != n || mark == 0)\n    cout << \"error\";\n  else {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i])\n        t = t + 1;\n    }\n    y = t / (double)m;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float n, f;\n  int l, c, o = 0, k = 0, v = 0;\n  char a[501] = {0}, b[501] = {0};\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  c = strlen(b);\n  for (int q = 0; q < l; q++) {\n    if (a[q] < 'A' || a[q] > 'Z') {\n      o = 1;\n      break;\n    }\n  }\n  for (int p = 0; p < l; p++) {\n    if (b[p] < 'A' || b[p] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (o == 1 || k == 1 || l != c) {\n    printf(\"error\");\n  } else {\n    for (int g = 0; g < c; g++) {\n      if (a[g] == b[g]) {\n        v++;\n      }\n    }\n    f = (float)v / (float)c;\n\n    if (f > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d;\n  double n;\n  char xl1[500], xl2[500];\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s %s \", xl1, xl2);\n  a = strlen(xl1);\n  b = strlen(xl2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'G' && xl1[i] != 'C') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'G' && xl2[i] != 'C')) {\n        cout << \"error\";\n        d = 0;\n        break;\n      } else {\n        if (xl1[i] == xl2[i]) {\n          c++;\n        }\n      }\n    }\n    if (1.0 * c / a > n && d != 0) {\n      printf(\"yes\");\n    } else if (1.0 * c / a <= n && d != 0) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, l = 0;\n  double e, q = 0;\n  int i;\n  char a[501], b[501];\n\n  scanf(\"%lf \", &e);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  n1 = strlen(a);\n  n2 = strlen(b);\n\n  if (n1 != n2) {\n    printf(\"error\");\n    l++;\n  }\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n  if (l == 0) {\n    for (i = 0; i < n2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        l++;\n        break;\n      }\n    }\n  }\n\n  if (l == 0) {\n    for (i = 0; i < n1; i++) {\n\n      if (a[i] == b[i]) {\n        q++;\n      }\n    }\n    if ((q / n1) > e)\n      printf(\"yes\");\n    else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  double a, len, cd, s = 0, b = 0, c;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", &s1, &s2);\n  len = strlen(s1);\n  cd = strlen(s2);\n  if (len != cd) {\n    printf(\"error\");\n  }\n  if (len == cd) {\n    for (i = 0; i < len; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        b++;\n        if (s1[i] == s2[i]) {\n          s++;\n        }\n      }\n    }\n    if (b == len) {\n      c = s / len;\n      if (c > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n    if (b != len) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float rate, rate0;\n  int sum = 0, len1, len2, i, tag = 0;\n  char base1[501], base2[501];\n  scanf(\"%f %s %s \", &rate, base1, base2);\n  len1 = strlen(base1);\n  len2 = strlen(base2);\n  if (len1 != len2) {\n    tag = 1;\n    goto pku;\n  }\n  for (i = 0; i < len1; i++) {\n    if (base1[i] != 'A' && base1[i] != 'T' && base1[i] != 'C' &&\n            base1[i] != 'G' ||\n        base2[i] != 'A' && base2[i] != 'T' && base2[i] != 'C' &&\n            base2[i] != 'G') {\n      tag = 1;\n      goto pku;\n    }\n    if ((int)base1[i] == (int)base2[i])\n      sum++;\n    else\n      continue;\n  }\n  rate0 = (float)sum / len1;\n  if (rate0 > rate)\n    cout << \"yes\";\n  else\n    cout << \"no\";\npku:\n  if (tag)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double k, x;\n  int l, m, i, a = 0, t = 0;\n  char st1[501], st2[501];\n  scanf(\"%lf\", &k);\n  scanf(\" \");\n\n  scanf(\"%s \", st1);\n\n  cin >> st2;\n  l = strlen(st1);\n  m = strlen(st2);\n  if (l != m) {\n    t = 1;\n  } else {\n    for (i = 0; i < l - 1; i++) {\n      if ((st1[i] != 'A' && st1[i] != 'T' && st1[i] != 'C' && st1[i] != 'G') ||\n          (st2[i] != 'A' && st2[i] != 'T' && st2[i] != 'C' && st2[i] != 'G')) {\n        t = 1;\n        break;\n      } else if (st1[i] == st2[i]) {\n        a++;\n      }\n    }\n  }\n  x = 1.0 * a / (l - 1);\n  if (t == 1) {\n    cout << \"error\";\n  } else if (x <= k) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9105", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[51], b[51];\n  int i, j = 0, k;\n  double n, t;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; b[i] != '\\0'; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n\n    k = strlen(a);\n    t = 1.0 * j / k;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b;\n  int s = 0;\n  int t = 1;\n  double x, y, aa, ss;\n  char sa[501];\n  char sb[501];\n\n  cin >> sa;\n  x = atof(sa);\n\n  cin >> sa;\n\n  cin >> sb;\n  a = strlen(sa);\n  b = strlen(sb);\n  if (a != b) {\n    t = 0;\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((sa[i] != 'A' && sa[i] != 'G' && sa[i] != 'T' && sa[i] != 'C') ||\n          (sb[i] != 'A' && sb[i] != 'G' && sb[i] != 'T' && sb[i] != 'C')) {\n        t = 0;\n        break;\n      } else if (sa[i] == sb[i]) {\n        s++;\n      }\n    }\n  }\n  aa = a;\n  ss = s;\n  y = ss / aa;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (y >= x) {\n      printf(\"yes\");\n    } else if (y <= x) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, m, k = 0;\n  int cd[2];\n  double s;\n  char sz[2][505];\n  scanf(\"%lf\", &s);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", sz[i]);\n    cd[i] = strlen(sz[i]);\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < cd[i]; j++) {\n      if (sz[i][j] != 'A' && sz[i][j] != 'T' && sz[i][j] != 'C' &&\n          sz[i][j] != 'G')\n        k++;\n    }\n  }\n  if (cd[0] != cd[1])\n    k++;\n  if (k != 0)\n    printf(\"error\");\n  else {\n    for (j = 0; j < cd[0]; j++) {\n      if (sz[0][j] == sz[1][j])\n        k++;\n    }\n    p = k * 100 / cd[0];\n    if (p > 100 * s)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, time = 0;\n  double p;\n  char a[501], b[501];\n  char c[5] = \"ATCG\";\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != c[0] && a[i] != c[1] && a[i] != c[2] && a[i] != c[3]) {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      time++;\n    }\n  }\n  if (p < (double)time / strlen(a) || p == (double)time / strlen(a)) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  double rate;\n  char gen1[500], gen2[500];\n  scanf(\"%lf %s %s \", &rate, gen1, gen2);\n  int len1 = strlen(gen1), len2 = strlen(gen2), S = 0;\n  if (len1 != len2) {\n    cout << \"error\" << endl;\n    return 0;\n  }\n  for (int i = 0; i < len1; i++) {\n    if ((gen2[i] != 'A' && gen2[i] != 'T' && gen2[i] != 'C' &&\n         gen2[i] != 'G') ||\n        (gen1[i] != 'A' && gen1[i] != 'T' && gen1[i] != 'C' &&\n         gen1[i] != 'G')) {\n      cout << \"error\" << endl;\n      return 0;\n    }\n    if (gen1[i] == gen2[i]) {\n      S++;\n    }\n  }\n  double R;\n  R = (double)S / len1;\n  if (R >= rate) {\n    cout << \"yes\" << endl;\n    return 0;\n  } else {\n    cout << \"no\\n\";\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0, b, c;\n  char zfc[2][501];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++)\n    scanf(\"%s\", zfc[i]);\n\n  b = strlen(zfc[0]);\n  c = strlen(zfc[1]);\n  if (b != c) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; zfc[0][i] != '\\0'; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (zfc[0][i] == zfc[1][i]) {\n        j++;\n      }\n    }\n  }\n  if ((double)1.0 * j / strlen(zfc[0]) > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double xgl, e;\n  char a[501], b[501];\n  double cd1, cd2;\n  int i;\n  double js = 0;\n\n  scanf(\"%lf\", &xgl);\n  scanf(\"%s %s\", a, b);\n\n  cd1 = strlen(a);\n  cd2 = strlen(b);\n\n  if (cd1 != cd2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < cd1; i++) {\n    if ((a[i] == 'A' && b[i] == 'A') || (a[i] == 'T' && b[i] == 'T') ||\n        (a[i] == 'C' && b[i] == 'C') || (a[i] == 'G' && b[i] == 'G')) {\n      js++;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  e = js / cd1;\n  if (e > xgl) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double link;\n  scanf(\"%lf\", &link);\n  char a[501], b[501];\n  scanf(\"%s%s\", a, b);\n  int c, d;\n  c = strlen(a);\n  d = strlen(b);\n  int i;\n  for (i = 0; i < c; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  }\n  double same;\n  same = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i]) {\n      same = same + 1;\n    }\n  }\n  double hl;\n  hl = same / (c * 1.0000);\n  if (hl <= link) {\n    printf(\"no\");\n  } else {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, i;\n  double a, e, f;\n  char n[501], m[501];\n  cin >> a;\n  scanf(\"%s\", n);\n  scanf(\"%s\", m);\n  b = strlen(n);\n  c = strlen(m);\n  d = 0;\n  if (b != c)\n    d++;\n\n  for (i = 0; i < b; i++) {\n    if ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G') ||\n        (m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) {\n      d++;\n    }\n  }\n  if (d != 0) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (i = 0; i < b; i++) {\n      if (n[i] == m[i]) {\n        e++;\n      }\n    }\n    f = e / b;\n    if (f > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9114", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j = 0;\n  double g, t;\n  char a[501], b[501];\n  scanf(\"%lf\", &g);\n  scanf(\"%s\", a);\n  cin;\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        } else {\n          ;\n        }\n      } else {\n        j = -1;\n        printf(\"error\");\n        break;\n      }\n    }\n    t = 1.0 * j / n;\n    if (t > g) {\n      printf(\"yes\");\n    } else if (t <= g && j != -1) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  scanf(\"%lf\", &r);\n  char zfc[500];\n  char jiyin[500];\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", jiyin);\n  int n = 0;\n  int i, k, L, N;\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (zfc[i + 1] == '\\0') {\n      L = i;\n    }\n  }\n  L++;\n  for (k = 0; jiyin[k] != '\\0'; k++) {\n    if (jiyin[k + 1] == '\\0') {\n      N = k;\n    }\n  }\n  N++;\n  if (L != N) {\n    printf(\"error\");\n  } else {\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] != 'A' && zfc[i] != 'T' && zfc[i] != 'C' && zfc[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; jiyin[i] != '\\0'; i++) {\n      if (jiyin[i] != 'A' && jiyin[i] != 'T' && jiyin[i] != 'C' &&\n          jiyin[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; zfc[i] != '\\0'; i++) {\n      if (zfc[i] == jiyin[i]) {\n        n++;\n      }\n    }\n    if (n * 1.0 / L > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9116", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, p;\n  int i, l, k = 0, c = 1;\n  scanf(\"%lf\", &x);\n  char c1[501], c2[501];\n  cin >> c1;\n  scanf(\"%s\", c2);\n  l = strlen(c1);\n  for (i = 0; i < l; i++) {\n    if ((c1[i] != 'A') && (c1[i] != 'T') && (c1[i] != 'C') && (c1[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if ((c2[i] != 'A') && (c2[i] != 'T') && (c2[i] != 'C') && (c2[i] != 'G')) {\n      printf(\"error\");\n      c = 0;\n      break;\n    }\n    if (c1[i] == c2[i]) {\n      k++;\n    }\n  }\n  if (c) {\n    p = ((double)k) / ((double)l);\n    if (p > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double b, c;\n  char D[2][501];\n  int z, t;\n  z = t = 0;\n  scanf(\"%lf\", &b);\n  scanf(\"%s%s\", D[1], D[0]);\n  if (strlen(D[1]) != strlen(D[0])) {\n    printf(\"error\");\n    return 0;\n  }\n  z = strlen(D[1]);\n  for (int i = 0; D[1][i]; i++) {\n    if ((D[1][i] != 'A' && D[1][i] != 'T' && D[1][i] != 'C' &&\n         D[1][i] != 'G') ||\n        (D[0][i] != 'A' && D[0][i] != 'T' && D[0][i] != 'C' &&\n         D[0][i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (D[1][i] == D[0][i]) {\n      t++;\n    }\n  }\n  c = (double)t / (double)z;\n  if (c >= b)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501] = {0};\n  char b[501] = {0};\n  int i, n;\n  double e, s = 0, c;\n  scanf(\"%lf\", &e);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') &&\n          (b[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n      }\n\n      else {\n        n = strlen(a);\n\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n    }\n  }\n\n  c = s / n;\n\n  if (c > e) {\n    printf(\"yes\\n\");\n  } else if (c <= e) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, i, j1, j;\n  double a, m, n;\n  char s1[100], s2[100];\n  c = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T' ||\n          s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n    }\n  }\n  m = 1.0 * strlen(s1);\n  n = 1.0 * c;\n  if (n / m > a)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, c;\n  int a, i, d = 1, b = 0;\n  char sz[1000] = {'\u0000'}, u[1000] = {'\u0000'};\n  scanf(\"%lf\", &n);\n  scanf(\" \");\n\n  cin >> sz;\n\n  cin >> u;\n  a = strlen(sz);\n  for (i = 0; i < a; i++) {\n    if (sz[i] != 'A' && sz[i] != 'G' && sz[i] != 'T' && sz[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    } else if (u[i] != 'A' && u[i] != 'G' && u[i] != 'T' && u[i] != 'C') {\n      printf(\"error\");\n      d = 0;\n      break;\n    }\n\n    else if (sz[i] == u[i]) {\n      b++;\n    }\n  }\n  c = b * 1.0 / a;\n  if (d == 1) {\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9121", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  int i, n, m, t = 0, k = 0;\n  char x[501], y[501];\n  cin >> a;\n\n  cin >> x;\n\n  scanf(\"%s \", y);\n  n = strlen(x);\n  m = strlen(y);\n  if (n != m)\n    printf(\"error \");\n  else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'T' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'T' && y[i] != 'C')) {\n        k = 1;\n        printf(\"error \");\n        break;\n      } else if (x[i] == y[i])\n        t++;\n    }\n    if (k != 1) {\n      if ((double)((double)t / (double)n) > a)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, h = 0;\n  char a[1000], b[1000];\n  int i, n, m;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    printf(\"error\");\n  else {\n    for (i = 0; i < n; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i])\n          h++;\n      }\n    }\n    h = h * 1.0 / n;\n    if (h > k)\n      printf(\"yes\");\n    else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' &&\n             b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[505], b[505];\n  int i, m, sum = 0, SUM = 0;\n  double e, n;\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", &a, &b);\n\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        SUM++;\n      } else if (a[i] == b[i]) {\n        sum++;\n      }\n    }\n    if (SUM != 0) {\n      printf(\"error\");\n    } else {\n      m = strlen(a);\n      e = (double)sum / m;\n      if (e > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz1[520] = {'\\0'}, sz2[520] = {'\\0'};\n  double a, j;\n  int i, k, judge = 1;\n  scanf(\"%lf %s %s\", &a, sz1, sz2);\n  if (strlen(sz1) != strlen(sz2)) {\n    printf(\"error\");\n  } else {\n    for (k = 0, i = 0; i < strlen(sz1); i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'G' && sz1[i] != 'C') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'G' && sz2[i] != 'C')) {\n        judge = 0;\n        break;\n      } else if (sz1[i] == sz2[i]) {\n        k = k + 1;\n      }\n    }\n\n    j = 1.0 * k / (strlen(sz1));\n    if (judge == 0) {\n      printf(\"error\");\n    } else if (j > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9125", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i;\n  int num = 0;\n  double alike, n;\n  char jj1[500] = {0};\n  char jj2[500] = {0};\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", jj1);\n  cin >> jj2;\n  int result1 = strlen(jj1);\n  int result2 = strlen(jj2);\n  if (result1 != result2) {\n    printf(\"error\");\n\n    return 0;\n  } else {\n    result2 = result1;\n    for (i = 0; i < result1; i++) {\n      if (((jj1[i] == 'A') || (jj1[i] == 'G') || (jj1[i] == 'C') ||\n           (jj1[i] == 'T')) &&\n          ((jj2[i] == 'A') || (jj2[i] == 'G') || (jj2[i] == 'C') ||\n           (jj2[i] == 'T'))) {\n        if (jj1[i] == jj2[i]) {\n          num += 1;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  alike = 1.0 * num / result1;\n  if (alike >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9126", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k;\n  double c, s;\n  char m, n;\n  char a[501];\n  char b[501];\n  s = 0.0;\n  cin >> c >> m >> a >> n >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    k = strlen(a);\n    for (i = 0; i < k; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i]) {\n        s++;\n      }\n    }\n    if (s * 1.0 / strlen(a) >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "9127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int biao = 0, i, j, n, l, d, c = 0, a1 = 0, a2;\n  double v, w;\n  char a[505], b[505];\n  scanf(\"%lf \", &v);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    biao = 1;\n    cout << \"error\";\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (!((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n            (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))) {\n        biao = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        a1++;\n    }\n    w = 1.0 * a1 / c * 1.0;\n    if (w >= v)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b = 0, a, len1, len2, x = 0, c;\n  double bz;\n  char m1[505], m2[505];\n  scanf(\"%lf\", &bz);\n  scanf(\"%s%s\", m1, m2);\n  len1 = strlen(m1);\n  len2 = strlen(m2);\n  if (len1 != len2)\n    x = 1;\n  for (c = 0; c < len1; c++) {\n    if (m1[c] != 'A' && m1[c] != 'T' && m1[c] != 'C' && m1[c] != 'G' ||\n        m2[c] != 'A' && m2[c] != 'T' && m2[c] != 'C' && m2[c] != 'G') {\n      x = 1;\n    }\n  }\n  if (x) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < len1; a++) {\n      if (m1[a] == m2[a]) {\n        b++;\n      }\n    }\n    if (b * 1.0 / len1 > bz) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i;\n  double k, c = 0;\n  char d[501], e[501];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &d);\n  scanf(\"%s\", &e);\n  a = strlen(d);\n  b = strlen(e);\n  if (a > b || a < b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] != 'A' && d[i] != 'C' && d[i] != 'G' && d[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    if (e[i] != 'A' && e[i] != 'C' && e[i] != 'G' && e[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < a; i++) {\n    if (d[i] == e[i])\n      c++;\n  }\n  if ((c / (1.0 * a)) > k) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  char zfc[1000];\n  char zfc1[1000];\n  scanf(\"%lf \", &a);\n  int b = 0;\n  double c;\n  int d = 0;\n  int i, j;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", zfc1);\n  int e = 0, f = 0;\n  int g = 0, h = 0;\n  int z = 0;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (zfc[i] == 'A' || zfc[i] == 'T' || zfc[i] == 'C' || zfc[i] == 'G') {\n      g++;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' || zfc1[i] == 'G') {\n      h++;\n    }\n  }\n  if ((g != strlen(zfc)) || (h != strlen(zfc1)) ||\n      strlen(zfc) != strlen(zfc1)) {\n    printf(\"error\\n\");\n    z = 1;\n  }\n  if (z != 1) {\n    for (j = 0; j < strlen(zfc); j++) {\n      if (zfc[j] == zfc1[j]) {\n        b++;\n      }\n    }\n    for (j = 0; j < strlen(zfc); j++) {\n      d++;\n    }\n    c = 1.0 * b / d;\n\n    if (c > a) {\n      printf(\"yes\\n\");\n    }\n    if (c <= a) {\n      cout << \"no\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9131", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0, c = 1;\n  double z, w;\n  char a[1000], b[1000];\n  scanf(\"%lf \", &z);\n  scanf(\"%s\\n%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    c = 0;\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        c = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n        w = 1.0 * m / x;\n      }\n    }\n  }\n\n  if (c != 0) {\n    if (w > z)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  double x, t = 0;\n  scanf(\"%lf\", &x);\n  char a[500], b[500];\n  scanf(\"%s %s\", a, b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    n = strlen(a);\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          t++;\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    if (t / n > x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[501];\nchar b[501];\nint main() {\n  double n, d = 0;\n  int e = 0, i, k = 1, lena, lenb;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  lena = (int)strlen(a);\n  lenb = (int)strlen(b);\n  for (i = 0; a[i]; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') ||\n        lena != lenb) {\n      d = -1;\n      break;\n    } else if (a[i] == b[i]) {\n      e++;\n    }\n  }\n  if (d == 0) {\n    d = 1.0 * e / i;\n  }\n  if (d > n)\n    printf(\"yes\");\n\n  if (d <= n && d >= 0) {\n    cout << \"no\";\n  }\n  if (d < 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double s;\n  char sz1[500];\n  char sz2[500];\n  int i, n = 0;\n  int len1, len2;\n  double num;\n  scanf(\"%lf%s%s\", &s, sz1, sz2);\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'C' && sz1[i] != 'G') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'C' && sz2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (sz1[i] == sz2[i])\n        n++;\n    }\n    num = 1.0 * n / len1;\n    if (num > s) {\n      printf(\"yes\");\n      return 0;\n    } else {\n      printf(\"no\");\n      return 0;\n    }\n  }\n}\n"}
{"label": "5", "index": "9135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m;\n  char a[10000], b[10000];\n  scanf(\"%lf \", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int l = strlen(a), k = 0;\n  for (int i = 0; i < l; i++) {\n    if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  double j;\n  j = 1.0 * k / l;\n  if (j > m) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  cin.get();\n  char b[501], c[501];\n  int i, j;\n  cin.getline(b, 501);\n  cin.getline(c, 501);\n  int flag = 0;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\" << endl;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    for (j = 0; c[j] != '\\0'; j++) {\n      if (c[j] != 'A' && c[j] != 'T' && c[j] != 'C' && c[j] != 'G') {\n        cout << \"error\" << endl;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 0) {\n    if (i != j) {\n      cout << \"error\" << endl;\n      flag = 1;\n    }\n  }\n  int t = 0;\n  if (flag == 0) {\n    for (i = 0; i < j; i++) {\n      if (b[i] == c[i])\n        t++;\n    }\n    double k = (double)t / j;\n    if (k > a)\n      printf(\"yes\\n\");\n    else\n      cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9137", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0, c = 1;\n  double z, w;\n  char a[1000], b[1000];\n  cin >> z;\n  scanf(\"%s\\n%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n    c = 0;\n  } else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        c = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n        w = 1.0 * m / x;\n      }\n    }\n  }\n\n  if (c != 0) {\n    if (w > z)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  double t, k = 0;\n  char s[500] = {'\\0'}, x[500] = {'\\0'};\n  scanf(\"%lf %s %s\", &t, s, x);\n  for (a = 0; s[a] != '\\0'; a++) {\n    if (s[a] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  for (b = 0; x[b] != '\\0'; b++) {\n    if (x[b] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (a != b || k == 1) {\n    printf(\"error\");\n  } else {\n    for (a = 0; a < b; a++) {\n      if (s[a] == x[a]) {\n        c++;\n      }\n    }\n    k = 1.0 * c / b;\n    if (k > t) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate, realrate;\n  char a[500], b[500];\n  int len, lenb, yes = 0;\n  cin >> rate;\n\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  len = strlen(a);\n  lenb = strlen(b);\n  if (len != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      cout << \"error\";\n      return 0;\n    }\n\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i])\n      yes++;\n  }\n  realrate = 1.0 * yes / len;\n  if (realrate >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9140", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, q = 0;\n  double n, A, B, p = 0.0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  char c = getchar();\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  A = strlen(a);\n  B = strlen(b);\n  if (A != B) {\n    printf(\"error\");\n  }\n  if (A == B) {\n    for (i = 0; i < A; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        q = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (q == 0) {\n      for (i = 0; i < A; i++) {\n        if (a[i] == b[i]) {\n          p += 1.0;\n        }\n      }\n      if ((p / A) > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, d = 0, b = 1;\n  char zf[501] = {0}, zc[501] = {0};\n  double a, e;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zf);\n  cin >> zc;\n  l = strlen(zf);\n  m = strlen(zc);\n  if (l != m) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (zf[i] != 'A' && zf[i] != 'T' && zf[i] != 'C' && zf[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n      if (zc[i] != 'A' && zc[i] != 'T' && zc[i] != 'C' && zc[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n    }\n    if (b == 1) {\n      for (i = 0; i < l; i++) {\n        if (zf[i] == zc[i]) {\n          d++;\n        }\n      }\n      e = 1.0 * d / l;\n      if (e > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, e1, e2, t;\n  t = 1;\n  k = 0;\n  double bl1, bl2;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bl1);\n  scanf(\"%s%s\", &jy1, &jy2);\n  e1 = strlen(jy1);\n  e2 = strlen(jy2);\n  if (e1 != e2) {\n    t = 0;\n  } else {\n    for (i = 0; i < e1; i++) {\n      if ((jy1[i] != 'A' && jy1[i] != 'T' && jy1[i] != 'C' && jy1[i] != 'G') ||\n          (jy2[i] != 'A' && jy2[i] != 'T' && jy2[i] != 'C' && jy2[i] != 'G')) {\n        t = 0;\n        break;\n      } else {\n        if (jy1[i] == jy2[i]) {\n          k = k + 1;\n        }\n      }\n    }\n  }\n  bl2 = 1.0 * k / e1;\n  if (t == 0) {\n    printf(\"error\");\n  } else {\n    if (bl2 > bl1) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, n;\n  int i, k = 0, s = 0, len1, len2, j = 0;\n  char a[10], dna1[510], dna2[510];\n  cin >> n;\n\n  cin >> a;\n\n  cin >> dna1;\n\n  cin >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; dna1[i] != '\u0000'; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n           dna1[i] != 'T') ||\n          (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n           dna2[i] != 'T')) {\n        printf(\"error\");\n        j++;\n        break;\n      } else {\n        if (dna1[i] == dna2[i]) {\n          k++;\n        }\n        s++;\n      }\n    }\n    if (j == 0) {\n      x = 1.0 * k / s;\n      if (x > n) {\n        printf(\"yes\");\n      } else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  int d = 0, i, p = 0, m = strlen(dna1), l = strlen(dna2);\n  for (i = 0; dna1[i] || dna2[i]; i++) {\n    if (m != l) {\n      d = 1;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d = 2;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d = 3;\n      break;\n    }\n    if (dna1[i] != dna2[i]) {\n      p++;\n    }\n  }\n  double q = 1 - p / m;\n  if (d != 0) {\n    printf(\"error\");\n  }\n  if (q > b && d == 0) {\n    printf(\"yes\");\n  } else if (d == 0 && q <= b) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9145", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int i, c;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  cin >> a;\n  scanf(\"%s\", b);\n  c = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i])\n          c++;\n      }\n    }\n    bl = 1.0 * c / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[510], A[510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B);\n  for (i = 0; B[i] != '\\0'; i++) {\n    if (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G') {\n      a = 1;\n    }\n  }\n  scanf(\"%s\", A);\n  for (i = 0; A[i] != '\\0'; i++) {\n    if (A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B) != strlen(A) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B);\n  for (i = 0; i < l; i++) {\n    if (B[i] == A[i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501], ratio[20];\n  double r, R;\n  int i, c;\n\n  scanf(\"%s \", ratio);\n  r = atof(ratio);\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  c = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[i]) {\n      c = c + 1;\n    }\n  }\n  R = (1.0 * c) / strlen(a);\n  if (R >= r) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char da[501], db[501];\n  double s, ss, l;\n  int l1, l2, i, m = 0;\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", da, db);\n\n  l1 = strlen(da);\n  l2 = strlen(db);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((da[i] != 'A' && da[i] != 'C' && da[i] != 'T' && da[i] != 'G') ||\n        (db[i] != 'A' && db[i] != 'C' && db[i] != 'T' && db[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (da[i] == db[i])\n      m++;\n  }\n  l = l1;\n  ss = m / l;\n  if (ss > s)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "9149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w = 0, g = 0;\n  double n;\n  char v[100], c[100];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", v);\n  scanf(\"%s\", c);\n  char A, T, G, C;\n  if (strlen(v) != strlen(c)) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= strlen(v) - 1; i++) {\n      if (((v[i] != 'A') && (v[i] != 'G') && (v[i] != 'C') && (v[i] != 'T')) ||\n          ((c[i] != 'A') && (c[i] != 'G') && (c[i] != 'C') && (c[i] != 'T'))) {\n        g = 1;\n        cout << \"error\";\n        break;\n      } else if (v[i] == c[i]) {\n        w++;\n      }\n    }\n\n    double l = 1.0 * w / strlen(v);\n    if ((l > n) && (g == 0)) {\n      cout << \"yes\";\n    } else if ((l <= n) && (g == 0)) {\n      cout << \"no\";\n    }\n  }\n  int u;\n  scanf(\"%d\", &u);\n  return 0;\n}\n"}
{"label": "5", "index": "9150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double w, sum = 0, p;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      } else if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n                 (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G')) {\n        printf(\"error\\n\");\n        return 0;\n      }\n    }\n\n  } else if (x != y) {\n    cout << \"error\\n\";\n    return 0;\n  }\n  while (x == y) {\n    p = sum / x;\n    if (p >= w) {\n      printf(\"yes\\n\");\n      break;\n    } else\n      printf(\"no\\n\");\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9151", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double q, c;\n  int t, s, i, l1, l2;\n  char a[501], b[501];\n  cin >> q;\n  cin >> a >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    t = 0;\n    for (i = 0; i < l1; i++)\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        t = 1;\n        break;\n      }\n    if (t == 0) {\n      s = 0;\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s = s + 1;\n      c = 1.0 * s / l1;\n      if (c > q)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, w = 0, i, o = 0;\n  double c, k;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o++;\n        break;\n      } else {\n        if (a[i] == b[i])\n          w++;\n      }\n    }\n    k = 1.0 * w / x;\n    if (o == 0) {\n      if (k > c)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9153", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double k;\n  cin >> k;\n  char moban[500], hubu[500];\n  scanf(\"%s\", moban);\n  scanf(\"%s\", hubu);\n  int m, n;\n  m = strlen(moban);\n  n = strlen(hubu);\n  if (m != n)\n    printf(\"error\");\n  else {\n    int count = 0;\n    for (int i = 0; i < n; i++) {\n      if (moban[i] != 'A' && moban[i] != 'T' && moban[i] != 'C' &&\n          moban[i] != 'G')\n        count++;\n      if (hubu[i] != 'A' && hubu[i] != 'T' && hubu[i] != 'C' && hubu[i] != 'G')\n        count++;\n    }\n    if (count != 0)\n      printf(\"error\");\n    else {\n      int sum = 0;\n      for (int i = 0; i < n; i++) {\n        if (moban[i] == hubu[i])\n          sum++;\n      }\n      double result = (double)sum / n;\n      if (result > k)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c = 0, d = 0;\n  double x, y = 0;\n  char s[501], z[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  for (i = 0; i < 501; i++) {\n    if (s[i] == '\\0') {\n      break;\n    }\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') ||\n        (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')) {\n      c = 1;\n    }\n  }\n  for (j = 1; j < 501; j++) {\n    if (s[j] == '\\0') {\n      break;\n    }\n  }\n  a = j;\n  for (j = 1; j < 501; j++) {\n    if (z[j] == '\\0') {\n      break;\n    }\n  }\n  b = j;\n  if (c == 1 || a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (s[i] == z[i]) {\n      d++;\n    }\n  }\n  y = (d - 1) * 1.0 / (a - 1);\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  float x;\n  char m[501], n[501];\n  scanf(\"%f\", &x);\n  scanf(\"%s\", m);\n  scanf(\"%s\", n);\n  if (strlen(m) != strlen(n)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; n[i]; i++) {\n    if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G' ||\n        (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (m[i] == n[i])\n      j++;\n  }\n  if (1.0 * j / i > x)\n    printf(\"yes\");\n  if (1.0 * j / i < x)\n    printf(\"no\");\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, s = 0;\n  int len, lon, i, z;\n  char a[750], b[750];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  z = 1;\n  len = strlen(a);\n  lon = strlen(b);\n  if (len != lon) {\n    z = 0;\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'G') && (b[i] != 'C')) {\n        z = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (z == 1) {\n      for (i = 0; i < len; i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n      double x = s / len;\n      if (x > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, m;\n  double c, d;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s %s\", a, b);\n  m = strlen(a);\n  n = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      break;\n    }\n  }\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else if (i < m) {\n    printf(\"error\");\n  } else if (i >= m) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        n += 1;\n      }\n    }\n    d = 1.0 * n / m;\n    if (d > c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, count = 0, o = 1;\n  double r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    o = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o = 0;\n        break;\n      } else {\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (1.0 * count / l1 > r && o == 1)\n      printf(\"yes\");\n    else if (o == 1)\n      printf(\"no\");\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, j = 0, flag = 0;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf%s%s\", &rate, a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      flag = 1;\n      break;\n    }\n    if (a[i] == b[i])\n      j++;\n  }\n  if (flag == 1)\n    return 0;\n  if ((double)j / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int l1, l2, n, i, j, k, num = 0, f = 0;\n  double s, p;\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", a);\n  cin >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    f = 1;\n    return 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        cout << \"error\";\n        f = 1;\n        return 0;\n      }\n    }\n    for (i = 0; i < l2; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        f = 1;\n        return 0;\n      }\n    }\n    if (f == 0) {\n      for (i = 0; i < l1; i++) {\n        if (a[i] == b[i])\n          num++;\n      }\n    }\n    if (f == 0) {\n      p = (double)num / l1;\n      if (p > s)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a1, a2, sum;\n  double m, x;\n  char s1[502], s2[502];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  a1 = strlen(s1);\n  a2 = strlen(s2);\n  sum = 0;\n  if (a1 != a2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; s1[i]; i++) {\n      if (((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') &&\n           (s1[i] != 'G')) ||\n          ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') &&\n           (s2[i] != 'G'))) {\n        sum = -1;\n        break;\n      } else if (s1[i] == s2[i]) {\n        sum++;\n      }\n    }\n    if (sum == -1) {\n      printf(\"error\");\n    } else {\n      x = (double)sum / a1;\n      if (x > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9162", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0, p = 0;\n  char sz[10000];\n  char s[10000];\n  double n, c;\n  cin >> n >> sz >> s;\n  for (i = 0; sz[i]; i++) {\n    if (sz[i] == s[i])\n      a++;\n\n    b++;\n    if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G'))\n      p++;\n  }\n  c = 1.0 * a / b;\n  if (p != 0) {\n    printf(\"error\");\n  }\n\n  if (p == 0 && c > n) {\n    printf(\"yes\");\n  }\n  if (p == 0 && c <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char z1[500], z2[500];\n  int l = 1;\n  double q, m;\n  scanf(\"%lf\", &m);\n  scanf(\"%s%s\", &z1, &z2);\n  if (strlen(z1) != strlen(z2)) {\n    printf(\"error\");\n    l = 0;\n  } else {\n    for (int i = 0; i < strlen(z1); i++) {\n      if ((z1[i] != 'A' && z1[i] != 'T' && z1[i] != 'G' && z1[i] != 'C') ||\n          (z2[i] != 'A' && z2[i] != 'T' && z2[i] != 'G' && z2[i] != 'C')) {\n        printf(\"error\");\n        l = 0;\n        break;\n      } else if (z1[i] == z2[i])\n        q++;\n    }\n  }\n  if (q / strlen(z1) > m && l == 1)\n    printf(\"yes\");\n  else if (l == 1)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "9164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b, n;\n  int i;\n  char A[1000], B[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\\n%s\", A, B);\n  a = strlen(A);\n  b = strlen(B);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0, b = 0; i < a; i++) {\n    if ((A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') ||\n        (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (A[i] == B[i]) {\n      b++;\n    }\n  }\n  a = b / a;\n  if (a >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  double r;\n  char a[600], b[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (1.0 * s / strlen(a) > r) {\n    printf(\"yes\");\n  } else if (1.0 * s / strlen(a) < r) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  float x;\n  char m[501], n[501];\n  scanf(\"%f\", &x);\n  cin >> m;\n  scanf(\"%s\", n);\n  if (strlen(m) != strlen(n)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; n[i]; i++) {\n    if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G' ||\n        (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (m[i] == n[i])\n      j++;\n  }\n  if (1.0 * j / i > x)\n    printf(\"yes\");\n  if (1.0 * j / i < x)\n    printf(\"no\");\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, p = 0, t = 0, r = 0;\n  double k, q;\n  char gen1[1000], gen2[1000];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", gen1);\n  scanf(\"%s\", gen2);\n  if (strlen(gen1) != strlen(gen2)) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < strlen(gen1); i++) {\n      if (gen1[i] != 'A' && gen1[i] != 'C' && gen1[i] != 'G' &&\n          gen1[i] != 'T') {\n        r++;\n      }\n    }\n    for (i = 0; i < strlen(gen2); i++) {\n      if (gen2[i] != 'A' && gen2[i] != 'C' && gen2[i] != 'G' && gen2[i] != 'T')\n        r++;\n    }\n    if (r > 0) {\n      printf(\"error\");\n      t = 0;\n    } else {\n      t = 1;\n    }\n    if (t == 1) {\n      for (i = 0; i < strlen(gen1) + 1; i++) {\n        if (gen1[i] == gen2[i]) {\n          p++;\n        }\n      }\n      q = 1.0 * p / (strlen(gen1));\n      if (q > k) {\n        printf(\"yes\\n\");\n      } else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int pd = 1, i = 0;\n  double x, xg = 0, c, f;\n  char m[501], z[501];\n  cin >> x >> m >> z;\n  c = strlen(m);\n  f = strlen(z);\n  if (c != f) {\n    pd = 0;\n  }\n  for (i = 0; i < c; i++) {\n    if ((m[i] != 'A' && m[i] != 'G' && m[i] != 'C' && m[i] != 'T') ||\n        (z[i] != 'A' && z[i] != 'G' && z[i] != 'C' && z[i] != 'T'))\n      pd = 0;\n    if (m[i] == z[i])\n      xg++;\n  }\n  if (pd == 0)\n    printf(\"error\");\n  else if ((xg / c) >= x)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, lena, lenb;\n  double r, same = 0, j = 0;\n  char a[10000];\n  char b[10000];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  lena = strlen(a); \n  lenb = strlen(b);\n  if (lena != lenb) \n  {\n    printf(\"error\");\n  } else {\n    for (i = 0; i <= lena - 1; i++) \n    {\n      if (a[i] == b[i]) \n      {\n        same++;\n      } else if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      } else if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        j = 1;\n        break;\n      }\n    }\n  }\n  if (j == 0 && lena == lenb) {\n    if ((same / lena) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k, j;\n  int i, o;\n  char a[500], b[500];\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int l = strlen(a);\n  int p = strlen(b);\n  o = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      p += 500;\n    }\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      p += 500;\n    }\n    if (a[i] == b[i])\n      o++;\n  }\n  if (l != p)\n    printf(\"error\");\n  else {\n    j = 1.0 * o / l;\n    if (j > k)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9171", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int n, i, j;\n  double r, m = 0, l = 0;\n  cin >> r;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else if (strlen(a) == strlen(b)) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n  }\n  l = strlen(a);\n  if (m / l > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m, d;\n  int a, b, i, c;\n  char u[500], v[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", u);\n  cin >> v;\n  a = strlen(u);\n  b = strlen(v);\n  if (a != b) {\n    printf(\"error\");\n  } else if (a == b) {\n    c = 0;\n    for (i = 0; u[i] != '\\0'; i++) {\n      if (u[i] != 'A' && u[i] != 'T' && u[i] != 'G' && u[i] != 'C' &&\n          v[i] != 'A' && v[i] != 'T' && v[i] != 'G' && v[i] != 'C') {\n        cout << \"error\";\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0)\n\n    {\n      d = 0;\n      for (i = 0; u[i] != '\\0'; i++) {\n        if (u[i] == v[i])\n          d++;\n      }\n      m = d / (1.0 * (a - 1));\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9173", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z = 0, len1, len2;\n  double n;\n  char a[500], b[500];\n  cin >> n >> a >> b;\n\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        z = -1;\n        break;\n      } else {\n        if (a[i] == b[i])\n          z += 1;\n      }\n    }\n    if (z >= 0) {\n      if ((1.0 * z / len1) > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char fir[1000];\n  char sec[1000];\n  double l1, l2;\n  int i, j, k;\n  int flag = 0;\n  double m = 0, x, n;\n\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", &fir);\n  scanf(\"%s\", &sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n\n  for (i = 0; i < l1; i++) {\n    if (fir[i] != 'A' && fir[i] != 'T' && fir[i] != 'C' && fir[i] != 'G') {\n      flag++;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (sec[i] != 'A' && sec[i] != 'G' && sec[i] != 'C' && sec[i] != 'T') {\n      flag++;\n    }\n  }\n  if (l1 != l2) {\n    flag++;\n  }\n\n  if (flag > 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (fir[i] == sec[i]) {\n        m++;\n      }\n    }\n    x = m / l1;\n    if (x > n) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c, d, e = 0, t = 0;\n  double n, m;\n  char a[501], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      t++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      t++;\n    }\n  }\n  if (t > 0) {\n    cout << \"error\";\n  } else if (t == 0) {\n    if (c == d) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i])\n          e++;\n      }\n      m = e * 1.0 / c;\n      if (m > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m = 0, k = 1;\n  char a[501], b[501];\n  double x, y;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    if (k) {\n      y = 1.0 * m / strlen(a);\n      if (y > x) {\n        printf(\"yes\");\n      } else if (y < x || y == x) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9177", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int b, c, i;\n  double a, j = 0;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  cin >> s1;\n  cin >> s2;\n  b = strlen(s1);\n  c = strlen(s2);\n  if (b != c)\n    printf(\"error\");\n  if (b == c) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' &&\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        printf(\"error\");\n        j = -1;\n        break;\n      } else {\n        if (s1[i] == s2[i])\n          j++;\n      }\n    }\n    if (j != -1) {\n      j = j / b;\n      if (j > a) {\n        printf(\"yes\");\n      }\n      if (j <= a)\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m1, m2, i, t, d;\n  double a, b;\n  char dna1[501];\n  char dna2[501];\n  t = 0;\n  d = 0;\n  scanf(\"%lf\", &a);\n  getchar();\n  cin >> dna1;\n  scanf(\"%s\", &dna2);\n  m1 = strlen(dna1);\n  m2 = strlen(dna2);\n  if (m1 != m2) {\n    printf(\"error\");\n    d = 1;\n  } else {\n    for (i = 0; i < m1; i++) {\n      if (dna1[i] == dna2[i]) {\n        t = t + 1;\n      }\n    }\n  }\n  b = 1.000000 * t / m1;\n  if (d == 0) {\n    for (i = 0; i < m1; i++) {\n      if ((dna1[i] != 'A') && (dna1[i] != 'T') && (dna1[i] != 'C') &&\n          (dna1[i] != 'G')) {\n        printf(\"error\");\n        d = 1;\n        break;\n      }\n    }\n  }\n  if (d == 0) {\n    for (i = 0; i < m2; i++) {\n      if ((dna2[i] != 'A') && (dna2[i] != 'T') && (dna2[i] != 'C') &&\n          (dna2[i] != 'G')) {\n        printf(\"error\");\n      }\n    }\n  }\n  if ((m1 == m2) && (d == 0)) {\n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9179", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int i, t = 1, r;\n  char s1[500];\n  char s2[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s \", s1, s2);\n  int len1 = strlen(s1);\n  int len2 = strlen(s2);\n  if (len1 != len2) {\n    t = 0;\n  } else {\n    int cnt = 0;\n    for (i = 0; i < len1; i++) {\n      if ((!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) ||\n          (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G'))) {\n        t = 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (s1[i] == s2[i]) {\n        cnt++;\n      }\n    }\n    y = 1.0 * cnt / len1;\n    if (y > x) {\n      r = 1;\n    } else {\n      r = 2;\n    }\n  }\n  if (t == 0) {\n    printf(\"error\");\n  } else if (t == 1 && r == 1) {\n    printf(\"yes\");\n  } else if (t == 1 && r == 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9180", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  scanf(\"%lf\", &n);\n  for (j = 0; j < 2; j++) {\n    cin >> b[j];\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++) {\n    k++;\n  }\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if (b[0][j] < 65 || b[0][j] > 90 || b[1][j] < 65 || b[1][j] > 90) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double c, w = 0, n = 0;\n  char x[600], y[600];\n  scanf(\"%lf\", &c);\n  getchar();\n\n  cin >> x;\n\n  cin >> y;\n  if (strlen(x) == strlen(y)) {\n    for (int j = 0; j < strlen(x); j++) {\n      if ((x[j] != 'A' && x[j] != 'T' && x[j] != 'G' && x[j] != 'C') ||\n          (y[j] != 'A' && y[j] != 'T' && y[j] != 'G' && y[j] != 'C')) {\n        printf(\"error\");\n        n = 1;\n        break;\n      }\n      if (x[j] == y[j])\n        w++;\n    }\n  } else {\n    printf(\"error\");\n    n = 1;\n  }\n  if (n == 0) {\n    w = w / strlen(x);\n    if (c < w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int sum = 0, i, l1, l2, judge = 1;\n  char x[1001], y[1001];\n  scanf(\"%lf%s%s\", &a, x, y);\n  l1 = strlen(x), l2 = strlen(y);\n  if (l1 != l2)\n    judge = 0;\n  else\n    for (i = 0; i < l1; i++) {\n      if (x[i] != 'C' && x[i] != 'G' && x[i] != 'A' && x[i] != 'T')\n        judge = 0;\n      if (y[i] != 'C' && y[i] != 'G' && y[i] != 'A' && y[i] != 'T')\n        judge = 0;\n    }\n  if (judge == 1) {\n    for (i = 0; i < l1; i++)\n      if (x[i] == y[i])\n        sum++;\n    if (sum >= (int)(a * l1))\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "9183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, x;\n  double n, result = 0, result1;\n  char dna1[500];\n  char dna2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n           (dna1[i] == 'G')) &&\n          ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n           (dna2[i] == 'G'))) {\n        x = 1;\n      } else {\n        x = 0;\n        break;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (x == 1) {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] != dna2[i]) {\n        result++;\n      }\n    }\n    result1 = (double)1 - (result / len1);\n    if ((result1) > n) {\n      printf(\"yes\");\n    }\n    if ((result1) <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9184", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n, r;\n  int m = 0, i, s = 0;\n  char a[500], b[500];\n  cin >> n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int x = strlen(a);\n  int y = strlen(b);\n  if (x != y) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < x; i++) {\n      if (!(((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') ||\n             (a[i] == 'G')) &&\n            ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') ||\n             (b[i] == 'G')))) {\n\n        s++;\n      }\n    }\n\n    if (s != 0) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < x; i++) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n      r = 1.0 * m / x;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9185", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[510], b[510];\n  int x, y, i, p = 0;\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n      if (a[i] == b[i])\n        p++;\n    }\n    q = n * x;\n    if (p > q)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, n;\n  double s, z;\n  char a[500], b[500];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(a);\n  j = strlen(b);\n  if (l != j) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  z = (double)k / l;\n  if (z >= s) {\n    printf(\"yes\\n\");\n  } else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k = 0, la, lb;\n  double n, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    k = 2;\n  } else {\n    for (i = 0; i < la; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C')) {\n        k = 2;\n        break;\n      }\n    }\n    if (k != 2) {\n      for (i = 0; i < la; i++) {\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n      s = s / la;\n      if (s <= n) {\n        k = 1;\n      } else\n        k = 0;\n    }\n  }\n  if (k == 1)\n    printf(\"no\");\n  if (k == 0) {\n    printf(\"yes\");\n  }\n  if (k == 2)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, m = 0;\n  double a, n, b;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n\", jy1);\n  scanf(\"%s\\n\", jy2);\n  len1 = strlen(jy1);\n  len2 = strlen(jy2);\n  for (i = 0; i < len1; i++) {\n    if ((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n        (jy1[i] != 'G'))\n      m++;\n  }\n  for (j = 0; j < len2; j++) {\n    if ((jy2[j] != 'A') && (jy2[j] != 'T') && (jy2[j] != 'C') &&\n        (jy2[j] != 'G'))\n      m++;\n  }\n  if (m > 0) {\n    printf(\"error\");\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (jy1[i] == jy2[i])\n        n++;\n    }\n    b = n / len1;\n    if (b > a) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a;\n  int bar = 0;\n  scanf(\"%f\", &a);\n  char zfc[2][500];\n  scanf(\"%s\", zfc[0]);\n  scanf(\"%s\", zfc[1]);\n  float count = 0.0;\n  if (strlen(zfc[0]) != strlen(zfc[1]))\n    printf(\"error\");\n  else {\n    float len = strlen(zfc[0]);\n    for (int i = 0; i < len; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'C' &&\n           zfc[0][i] != 'G') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'C' &&\n           zfc[1][i] != 'G')) {\n        printf(\"error\");\n        bar = 1;\n        break;\n      } else if (zfc[0][i] == zfc[1][i])\n        count += 1.0;\n    }\n    if (count / len >= a && bar == 0) {\n      printf(\"yes\");\n    }\n    if (count / len < a && bar == 0)\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, m = 0;\n  double a, n, b;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n\", jy1);\n  scanf(\"%s\\n\", jy2);\n  len1 = strlen(jy1);\n  len2 = strlen(jy2);\n  for (i = 0; i < len1; i++) {\n    if ((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n        (jy1[i] != 'G'))\n      m++;\n  }\n  for (j = 0; j < len2; j++) {\n    if ((jy2[j] != 'A') && (jy2[j] != 'T') && (jy2[j] != 'C') &&\n        (jy2[j] != 'G'))\n      m++;\n  }\n  if (m > 0) {\n    printf(\"error\");\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (jy1[i] == jy2[i])\n        n++;\n    }\n    b = n / len1;\n    if (b > a) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n}\n"}
{"label": "5", "index": "9191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, x, y;\n  double n;\n  double count = 0.00;\n  char a[501];\n  char b[501];\n\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    cout << \"error\";\n    return 0;\n  }\n\n  for (i = 0; a[i] != '\u0000', b[i] != '\u0000'; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n      printf(\"error\");\n      return 0;\n      break;\n    }\n\n    if (a[i] == b[i]) {\n      count++;\n    }\n  }\n\n  if (count / (x - 1) >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double n, j = 0;\n  cin >> n;\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\\n\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') &&\n          (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    i = strlen(a);\n    j = j / i;\n    if (j > n)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a;\n  scanf(\"%lf\", &a);\n  char b[600], c[600];\n  getchar();\n\n  cin >> b;\n\n  cin >> c;\n  int d, e, f, g;\n  int h = 0;\n  d = strlen(b);\n  e = strlen(c);\n  if (d != e) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i <= d - 1; i++) {\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        f = 1;\n      }\n\n      if (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T') {\n        g = 1;\n      }\n    }\n    if (f == 1 || g == 1)\n      printf(\"error\");\n    else {\n      for (int i = 0; i <= d - 1; i++) {\n        if (b[i] == c[i]) {\n          h++;\n        }\n      }\n\n      if (1.0 * h / d > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  int y;\n  scanf(\"%d\", &y);\n  return 0;\n}\n"}
{"label": "5", "index": "9194", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double p;\n  cin >> p;\n  char a[501], b[501];\n  cin >> a;\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    int len, i, sum = 0, w = 0;\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'G' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'G' && b[i] != 'T'))\n        w += 1;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if (w == 0 && (1.0 * sum / len) > p) {\n      cout << \"yes\";\n    } else if (w == 0 && (1.0 * sum / len) <= p) {\n      printf(\"no\");\n    } else {\n      cout << \"error\";\n    }\n  }\n  return (0);\n}\n"}
{"label": "5", "index": "9195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, x;\n  int t = 0, a, b, u = 0;\n  char ji[501], yin[501];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", ji);\n  scanf(\"%s\", yin);\n  a = strlen(ji);\n  b = strlen(yin);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int q = 0; q < a; q++) {\n      if ((ji[q] != 'A' && ji[q] != 'T' && ji[q] != 'C' && ji[q] != 'G') ||\n          (yin[q] != 'A' && yin[q] != 'C' && yin[q] != 'T' && yin[q] != 'G')) {\n        u = 1;\n      }\n    }\n    if (u == 1)\n      printf(\"error\");\n    else {\n      for (int h = 0; h < a; h++) {\n        if (ji[h] == yin[h]) {\n          t++;\n        }\n      }\n      x = 1.0 * t / a;\n      if (x > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a = 0, m;\n  double n, x;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  for (i = 0; dna1[i] != '\\0'; i++) {\n    if (dna1[i] != 65 && dna1[i] != 67 && dna1[i] != 71 && dna1[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; dna2[i] != '\\0'; i++) {\n    if (dna2[i] != 65 && dna2[i] != 67 && dna2[i] != 71 && dna2[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n  } else {\n    m = strlen(dna1);\n    for (i = 0; dna1[i] != '\\0'; i++) {\n      if (dna1[i] == dna2[i]) {\n        a++;\n      }\n    }\n    x = a * 1.0 / (1.0 * m);\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9197", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n;\n  int s = 0, len1, len2, i;\n  char b[501], c[501], e[501];\n  scanf(\"%lf\", &n);\n\n  cin >> b;\n\n  cin >> c;\n\n  scanf(\"%s \", e);\n  len1 = strlen(c);\n  len2 = strlen(e);\n  for (i = 0; i < len1; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G') {\n      len1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (e[i] != 'A' && e[i] != 'T' && e[i] != 'C' && e[i] != 'G') {\n      len2 = 2;\n      break;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (c[i] == e[i]) {\n        s++;\n      }\n    }\n    if (1.0 * s / len1 >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9198", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, x;\n  int l, l1, l2, i, j, t = 0, flag = 0;\n  char a[100], b[100];\n  cin >> r;\n  scanf(\"%s\", a);\n  cin >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  for (j = 0; j < l2; j++) {\n    if (b[j] == 'A' || b[j] == 'T' || b[j] == 'C' || b[j] == 'G') {\n      continue;\n    } else {\n      flag = 1;\n    }\n  }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n    return 0;\n  } else {\n    l = l1;\n    for (i = 0; i < l; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    x = (double)t / l;\n    if (x > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9199", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x;\n  int n, i, m, y;\n  char lian1[1000], lian2[1000];\n  scanf(\"%lf \", &x);\n  cin >> lian1;\n  scanf(\"%s\", lian2);\n  n = strlen(lian1);\n  y = strlen(lian2);\n  if (y != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (!(lian1[i] == 'A' || lian1[i] == 'T' || lian1[i] == 'C' ||\n          lian1[i] == 'G' || lian2[i] == 'A' || lian2[i] == 'T' ||\n          lian2[i] == 'C' || lian2[i] == 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (lian1[i] == lian2[i]) {\n      m++;\n    }\n  }\n  if (m * 1.0 / n > x) {\n    printf(\"yes\");\n  } else if (m * 1.0 / n <= x) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, i, sum = 0, w = 0;\n  float rate, result;\n  char zfc_1[600], zfc_2[600];\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", zfc_1);\n  scanf(\"%s\", zfc_2);\n  l1 = strlen(zfc_1);\n  l2 = strlen(zfc_2);\n  for (i = 0; i < l1; i++) {\n    if ((l1 != l2) ||\n        (zfc_1[i] != 'A' && zfc_1[i] != 'T' && zfc_1[i] != 'G' &&\n         zfc_1[i] != 'C') ||\n        (zfc_2[i] != 'A' && zfc_2[i] != 'T' && zfc_2[i] != 'G' &&\n         zfc_2[i] != 'C')) {\n      printf(\"error\");\n      w = 1;\n      break;\n    } else {\n      if (zfc_1[i] == zfc_2[i]) {\n        sum++;\n      } else {\n        continue;\n      }\n    }\n  }\n  result = 1.00 * sum / l1;\n  if (result > rate) {\n    cout << \"yes\";\n  } else if ((result <= rate) && (w == 0))\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9201", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, c, d, k = 0;\n  int i, e = 1;\n  cin >> n;\n  scanf(\"%s\\n%s\", &a, &b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    printf(\"error\");\n  } else if (c == d) {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        e = 0;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          k = k + 1;\n        }\n      }\n    }\n    if (e == 0) {\n      printf(\"error\");\n    } else if (k != 0 && (k / c) >= n) {\n      printf(\"yes\");\n    } else {\n      if (e == 1 && (k / c) < n) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, d = 0, p = 0;\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  m = strlen(dna1);\n  n = strlen(dna2);\n  for (i = 0; dna1[i] && dna2[i]; i++) {\n    if (m != n) {\n      d++;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d++;\n      break;\n    }\n    if (dna1[i] == dna2[i]) {\n      p++;\n    }\n  }\n  if ((p * 1.0 / m) > b && d == 0) {\n    cout << \"yes\";\n  }\n  if (d != 0) {\n    cout << \"error\";\n  }\n  if ((p * 1.0 / m) <= b && d == 0) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, flag = 0, deadend = 0;\n  double x;\n  char a[501], b[501];\n  scanf(\"%lf\\n\", &x);\n  scanf(\"%s\\n\", &a);\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'G') && (a[i] != 'C')) {\n      printf(\"error\");\n      deadend = 1;\n      break;\n    }\n  }\n  if ((strlen(a) == strlen(b)) && (deadend == 0)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        flag++;\n    }\n    if ((100 * flag / (strlen(a))) < (100 * x))\n      printf(\"no\");\n    else\n      printf(\"yes\");\n  } else if ((strlen(a) != strlen(b)) && (deadend == 0)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l1, l0, js = 0;\n  double jg, bl;\n  char a[2][501];\n\n  cin >> bl;\n  for (i = 0; i < 2; i++) {\n    cin >> a[i];\n  }\n  l0 = strlen(a[0]);\n  l1 = strlen(a[1]);\n  if (l1 != l0) {\n    printf(\"error\");\n    return 0;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < l1; i++) {\n      if ((a[j][i] != 'A') && (a[j][i] != 'T') && (a[j][i] != 'C') &&\n          (a[j][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[0][i] == a[1][i]) {\n      js++;\n    }\n  }\n  jg = 1.0 * js / l1;\n  if (jg > bl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, t;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\\n\", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  t = 0;\n  for (i = 0; i < l1; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n      if (a[i] == b[i])\n        t++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (1.0 * t / l1 >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, d;\n  int j = 0, n, i, e = 0, m;\n  scanf(\"%lf%s%s\", &c, a, b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    e = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  }\n  while (e == 0) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    d = 1.0 * j / n;\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    e = 1;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double x;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int m, i, same = 0;\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      same = -1;\n    } else if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double y;\n  y = (double)same / m;\n  if (y > x && same != -1) {\n    printf(\"yes\");\n  } else if (y <= x && same != -1) {\n    cout << \"no\";\n  } else if (same = -1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char z[2][650];\n  double res;\n  scanf(\"%lf\", &res);\n  scanf(\"%s\", z[0]);\n  scanf(\"%s\", z[1]);\n  int n = strlen(z[0]);\n  int n2 = strlen(z[1]);\n  res = res * 1.0 * n;\n  int h = 0, refer = 0;\n  for (int i = 0; i < n; i++) {\n    if (z[0][i] != 'A' && z[0][i] != 'T' && z[0][i] != 'G' && z[0][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[1][i] != 'A' && z[1][i] != 'T' && z[1][i] != 'G' &&\n               z[1][i] != 'C') {\n      printf(\"error\");\n      refer = 1;\n      break;\n    } else if (z[0][i] == z[1][i]) {\n      h++;\n    }\n  }\n  if (refer == 0) {\n    if (n != n2)\n      printf(\"error\");\n    else if (h >= res) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, sim = 0;\n  double n;\n  char one[501], two[501];\n  scanf(\"%lf\", &n);\n  cin >> one;\n  scanf(\"%s\", two);\n  if (strlen(one) != strlen(two)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  for (i = 0; one[i]; i++) {\n    if ((one[i] != 'A') && (one[i] != 'T') && (one[i] != 'C') &&\n        (one[i] != 'G')) {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; two[i]; i++) {\n    if (two[i] != 'A' && two[i] != 'T' && two[i] != 'C' && two[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  for (i = 0; one[i]; i++) {\n    if (one[i] == two[i]) {\n      sim++;\n    }\n  }\n  if (1.0 * sim / strlen(one) > n)\n    cout << \"yes\\n\";\n  else {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, d;\n  int j = 0, n, i, e = 0, m;\n  scanf(\"%lf%s%s\", &c, a, b);\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m)\n    e = 1;\n  else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  }\n  while (e == 0) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    d = 1.0 * j / n;\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    e = 1;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  double t, k = 0;\n  char s[500] = {'\\0'}, x[500] = {'\\0'};\n  scanf(\"%lf %s %s\", &t, s, x);\n  for (a = 0; s[a] != '\\0'; a++) {\n    if (s[a] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  for (b = 0; x[b] != '\\0'; b++) {\n    if (x[b] > 'Z') {\n      k = 1;\n      break;\n    }\n  }\n  if (a != b || k == 1)\n    printf(\"error\");\n  else {\n    for (a = 0; a < b; a++) {\n      if (s[a] == x[a]) {\n        c++;\n      }\n    }\n    k = 1.0 * c / b;\n    if (k > t)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double c, f = 0;\n  int d, e, i;\n  scanf(\"%lf\", &c);\n  char a[100], b[100];\n  scanf(\"%s%s\", &a, &b);\n  d = strlen(a);\n  e = strlen(b);\n  if (d != e)\n    printf(\"error\");\n  else {\n    for (i = 0; i < d; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        cout << \"error\";\n        return 0;\n        ;\n      } else {\n        if (a[i] == b[i])\n          f++;\n      }\n    }\n    if (f / e >= c) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9213", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, p = 0, q = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  p = strlen(a);\n  for (i = 0; i < p; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (a[i] == b[i]) {\n      q++;\n    }\n  }\n  if (1.0 * q / p >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, same = 0, flag = 1;\n  double n;\n  char a[500], b[500], c[100];\n\n  cin >> c;\n  n = atof(c);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      flag = 0;\n    }\n    if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double m;\n  m = 1.0 * same / strlen(a);\n  if ((strlen(a) != strlen(b)) || flag == 0)\n    cout << \"error\";\n  else if (m <= n) {\n    printf(\"no\");\n  } else if (m > n) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, i, j1, j;\n  double a, m, n;\n  char s1[100], s2[100];\n  c = 0;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T' ||\n          s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (s1[i] == s2[i]) {\n          c++;\n        }\n      }\n    }\n  }\n  m = 1.0 * strlen(s1);\n  n = 1.0 * c;\n  if (n / m > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9216", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m;\n  cin >> m;\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  int ci = 0;\n  int pan = 0;\n  int aa = strlen(a), bb = strlen(b);\n  if (aa != bb) {\n    printf(\"error\");\n  } else {\n    int i;\n    for (i = 0; i < aa; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        pan = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        ci++;\n      }\n    }\n    double bi = (double)ci / aa;\n    if (pan == 0) {\n      if (bi >= m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char first[1024];\n  char second[1024];\n  float rate = 0.0f;\n  scanf(\"%f\", &rate);\n  scanf(\"%s\", first);\n  cin >> second;\n\n  int n1 = strlen(first);\n  int n2 = strlen(second);\n\n  if (n1 != n2) {\n    cout << \"error\";\n    return 0;\n  }\n\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] != 'A' && first[i] != 'T' && first[i] != 'C' &&\n        first[i] != 'G' && second[i] != 'A' && second[i] != 'T' &&\n        second[i] != 'C' && second[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  int same = 0;\n  for (int i = 0; i < n1; ++i) {\n    if (first[i] == second[i])\n      same++;\n  }\n\n  float actual = (float)same / (float)n1;\n  if (actual >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9218", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  char x[1000], y[1000];\n  scanf(\"%s %s\", x, y);\n  int l = strlen(x), k = 0, o = strlen(y);\n  if (l != o) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l; i++) {\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == y[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / l > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n, d, c, r;\n  int i, k, s;\n  cin >> n;\n  scanf(\"%s\\n%s\", a, b);\n  d = strlen(a);\n  c = strlen(b);\n  k = 0;\n  if (c != d) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n        k++;\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n        k++;\n    }\n    if (k != 0) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  s = 0;\n  for (i = 0; i < c; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  r = s / d;\n  if (r <= n)\n    printf(\"no\");\n  if (r > n)\n    printf(\"yes\");\n  return 0;\n}\n"}
{"label": "5", "index": "9220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  char s1[501];\n  char s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  int i, len1, len2, sum = 0;\n  double gl;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i])\n          sum += 1;\n\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    gl = 1.0 * sum / len1;\n    if (gl > n) {\n      cout << \"yes\";\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, l;\n  double k;\n  char a[500], b[500];\n  cin >> k;\n  scanf(\"%s\\n%s\", &a, &b);\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (!(a[i] == 65 || a[i] == 67 || a[i] == 71 || a[i] == 84) ||\n          !(b[i] == 65 || b[i] == 67 || b[i] == 71 || b[i] == 84)) {\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          n = n + 1;\n        }\n        if (i == l - 1) {\n          if (1.0 * n / l >= k) {\n            cout << \"yes\";\n          } else {\n            printf(\"no\");\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9222", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char dna1[600], dna2[600];\n  int a, b, i;\n  double x = 0, ratio;\n  scanf(\"%lf\", &ratio);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  a = strlen(dna1);\n  b = strlen(dna2);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' && dna1[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'G' && dna2[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      x++;\n  }\n  if (x / a >= ratio)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m = 0;\n  double sum = 0, n;\n  char gene[3][501];\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", gene[0]);\n  scanf(\"%s\", gene[1]);\n  if (strlen(gene[0]) != strlen(gene[1]))\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; gene[i][j] != '\\0'; j++) {\n        if (gene[i][j] != 'A' && gene[i][j] != 'T' && gene[i][j] != 'C' &&\n            gene[i][j] != 'G') {\n          printf(\"error\");\n          m = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; gene[0][i] != '\\0'; i++) {\n      if (gene[0][i] == gene[1][i])\n        sum++;\n    }\n    if (sum / strlen(gene[0]) > n && m == 0)\n      printf(\"yes\");\n    else if (sum / strlen(gene[0]) <= n && m == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, i, c;\n  double n, m;\n  c = 0;\n  char f[500], s[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", f);\n  scanf(\"%s\", s);\n  l1 = strlen(f);\n  l2 = strlen(s);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (f[i] != 'A' && f[i] != 'G' && f[i] != 'C' && f[i] != 'T') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < l2; i++) {\n    if (s[i] == f[i])\n      c++;\n  }\n\n  m = 1.0 * c / l1;\n  if (m >= n)\n    printf(\"yes\");\n  if (m < n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "9225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double b;\n  int l1, l2, x = 0;\n  char d1[500], d2[500];\n  scanf(\"%lf%s%s\", &b, d1, d2);\n  l1 = strlen(d1);\n  l2 = strlen(d2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l1; i++) {\n    if (d1[i] != 'A' && d1[i] != 'T' && d1[i] != 'C' && d1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d2[i] != 'A' && d2[i] != 'T' && d2[i] != 'C' && d2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d1[i] == d2[i]) {\n      x++;\n    }\n  }\n  if (1.0 * x / l1 > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  char a[501], b[501];\n  cin >> rate;\n  scanf(\"%s%s\", a, b);\n  int lena, lenb;\n  lena = strlen(a);\n  lenb = strlen(b);\n  int sum = 0;\n  int zq = 0;\n  if (lena == lenb) {\n    int i;\n\n    for (i = 0; i < lena; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n          b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n        if (a[i] == b[i]) {\n          sum++;\n        }\n        zq++;\n\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n  } else {\n    cout << \"error\";\n  }\n  double r;\n  r = 1.0 * sum / lena;\n  if (zq == lena) {\n    if (r > rate) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9227", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  cin.get();\n  char b[501], c[501];\n  int i, j;\n  cin.getline(b, 501);\n  cin.getline(c, 501);\n  int flag = 0;\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\" << endl;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    for (j = 0; c[j] != '\\0'; j++) {\n      if (c[j] != 'A' && c[j] != 'T' && c[j] != 'C' && c[j] != 'G') {\n        cout << \"error\" << endl;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 0) {\n    if (i != j) {\n      cout << \"error\" << endl;\n      flag = 1;\n    }\n  }\n  int t = 0;\n  if (flag == 0) {\n    for (i = 0; i < j; i++) {\n      if (b[i] == c[i])\n        t++;\n    }\n    double k = (double)t / j;\n    if (k > a)\n      cout << \"yes\" << endl;\n    else\n      cout << \"no\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p, m, k = 0;\n  int cd[2];\n  double s;\n  char sz[2][505];\n  scanf(\"%lf\", &s);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", sz[i]);\n    cd[i] = strlen(sz[i]);\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < cd[i]; j++) {\n      if (sz[i][j] != 'A' && sz[i][j] != 'T' && sz[i][j] != 'C' &&\n          sz[i][j] != 'G')\n        k++;\n    }\n  }\n  if (cd[0] != cd[1])\n    k++;\n  if (k != 0)\n    cout << \"error\";\n  else {\n    for (j = 0; j < cd[0]; j++) {\n      if (sz[0][j] == sz[1][j])\n        k++;\n    }\n    p = k * 100 / cd[0];\n    if (p > 100 * s)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9229", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int cout = 0, len = 0, flag = 0, b = 0;\n  double lv, a;\n  char slv[10], s[500], z[500];\n\n  cin >> slv;\n  lv = atoi(slv);\n\n  cin >> s;\n\n  cin >> z;\n  len = strlen(s);\n  if (strlen(s) == strlen(z)) {\n    for (int i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == z[i])\n        cout++;\n      if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')\n        b = 1;\n      if (z[i] != 'A' && z[i] != 'T' && z[i] != 'C' && z[i] != 'G')\n        b = 1;\n    }\n    a = cout * 1.0 / len;\n    flag++;\n  }\n  if (flag == 0 || b == 1)\n    printf(\"error\");\n  else {\n    if (a > lv)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int b, c, i;\n  double a, j = 0;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &s1);\n  scanf(\"%s\", &s2);\n  b = strlen(s1);\n  c = strlen(s2);\n  if (b != c)\n    printf(\"error\");\n  if (b == c) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' &&\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        cout << \"error\";\n        j = -1;\n        break;\n      } else {\n        if (s1[i] == s2[i])\n          j++;\n      }\n    }\n    if (j != -1) {\n      j = j / b;\n      if (j > a)\n        printf(\"yes\");\n      if (j <= a)\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k = 0, la, lb;\n  double n, s = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  la = strlen(a), lb = strlen(b);\n  if (la != lb) {\n    k = 2;\n  } else {\n    for (i = 0; i < la; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'T' && b[i] != 'C')) {\n        k = 2;\n        break;\n      }\n    }\n    if (k != 2) {\n      for (i = 0; i < la; i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n      s = s / la;\n      if (s <= n) {\n        k = 1;\n      } else\n        k = 0;\n    }\n  }\n  if (k == 1)\n    printf(\"no\");\n  if (k == 0)\n    printf(\"yes\");\n  if (k == 2)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double rate, realrate;\n  char a[500], b[500];\n  int len, lenb, yes = 0;\n  scanf(\"%lf\", &rate);\n\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  len = strlen(a);\n  lenb = strlen(b);\n  if (len != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i]) {\n      yes++;\n    }\n  }\n  realrate = 1.0 * yes / len;\n  if (realrate >= rate)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9233", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, p = 0;\n  float m, k, s = 0;\n  char zfc[2][500], n[10];\n\n  scanf(\"%s \", n);\n  m = atof(n);\n  for (i = 0; i < 2; i++) {\n\n    cin >> zfc[i];\n  }\n  a = strlen(zfc[0]);\n  b = strlen(zfc[1]);\n  if (a != b)\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; zfc[i][j] != '\u0000'; j++) {\n        if (zfc[i][j] != 'A' && zfc[i][j] != 'G' && zfc[i][j] != 'C' &&\n            zfc[i][j] != 'T') {\n          p = 1;\n        }\n      }\n    }\n    if (p == 0) {\n      for (i = 0; zfc[0][i] != '\u0000'; i++) {\n        if (zfc[0][i] == zfc[1][i]) {\n          s++;\n        }\n      }\n      k = s / (a * 1.0);\n      if (k > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a = 0, j, c, b;\n  double n;\n  char sz1[1000], sz2[1000];\n  scanf(\"%lf\", &n);\n  cin >> sz1;\n  scanf(\"%s\", sz2);\n  for (i = 0; sz1[i] != '\\0'; i++) {\n    c = i;\n  }\n  for (j = 0; sz2[j] != '\\0'; j++) {\n    b = j;\n  }\n  if (c != b) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'C' && sz1[i] != 'G' && sz1[i] != 'T') ||\n          (sz2[i] != 'C' && sz2[i] != 'A' && sz2[i] != 'G' && sz2[i] != 'T')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (j = 0; sz1[j] != '\\0'; j++) {\n      if (sz1[j] == sz2[j] &&\n          (sz1[j] == 'A' || sz1[j] == 'C' || sz1[j] == 'G' || sz1[j] == 'T') &&\n          (sz2[j] == 'C' || sz2[j] == 'A' || sz2[j] == 'G' || sz2[j] == 'T')) {\n        a++;\n      }\n    }\n  }\n  if (1.0 * a / (c + 1) > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double v;\n  scanf(\"%lf\\n\", &v);\n  char s[600], z[600];\n  scanf(\"%s\\n%s\", s, z);\n  int a, b;\n  a = strlen(s);\n  b = strlen(z);\n  int m, n, p = 0, q = 0;\n  for (m = 0; m < a; m++) {\n    if (s[m] != 'A' && s[m] != 'T' && s[m] != 'C' && s[m] != 'G')\n      p = 1;\n  }\n  for (n = 0; n < a; n++) {\n    if (z[n] != 'A' && z[n] != 'T' && z[n] != 'C' && z[n] != 'G') {\n      q = 1;\n    }\n  }\n  int w = 0;\n  double u;\n  if (m != n || q == 1 || p == 1) {\n    printf(\"error\");\n    w = 1;\n  }\n  int sum = 0;\n  for (n = 0; n < a; n++) {\n    if (s[n] == z[n])\n      sum++;\n  }\n  u = 1.0 * sum / a;\n  if (w == 1)\n    ;\n  else {\n    if (u > v) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10000], b[10000];\n  int c, d, m = 0, z = 0;\n  double e, f, g, h;\n  scanf(\"%lf\", &h);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (int i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n      z++;\n    }\n  }\n  for (int i = 0; b[i] != '\\0'; i++) {\n    if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n      z++;\n    }\n  }\n\n  c = strlen(a);\n  d = strlen(b);\n  if (c == d) {\n    for (int i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    f = m;\n    g = c;\n    e = f / g;\n    if (e >= h && z == 2 * c) {\n      printf(\"yes\");\n    } else if (e < h && z == 2 * c) {\n      printf(\"no\");\n    }\n  }\n  if (c != d || z != 2 * c) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, aver;\n  int i, k = 0, l = 0;\n  char a[500], b[500];\n  cin >> m;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    k++;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' &&\n        b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G') {\n      k++;\n    }\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[i]) {\n      l++;\n    }\n  }\n  aver = 1.0 * l / strlen(a);\n  if (k != 0) {\n    printf(\"error\");\n  }\n  if (k == 0) {\n    if (aver > m) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double s, w;\n  int k1 = 0, k2 = 0, i, dian, lena, lenb;\n  char a[1000], b[1000];\n\n  scanf(\"%lf\", &s);\n  scanf(\"%s%s\", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n\n      k1 = 1;\n  }\n  for (i = 0; i < lenb; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n\n      k2 = 1;\n  }\n\n  if (k1 == 1 || k2 == 1 || lena != lenb)\n    printf(\"error\");\n  else {\n    for (i = 0, dian = 0; i < lena; i++) {\n      if (a[i] == b[i])\n        dian++;\n    }\n\n    w = 1.0 * dian / lena;\n    if (w >= s)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int na, nb, i, c;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  na = strlen(a);\n  nb = strlen(b);\n  if (na != nb) {\n    printf(\"error\");\n    return 0;\n  } else {\n    c = 0;\n    for (i = 0; i < na; i++) {\n      if ((a[i] == 'A') || (a[i] == 'T') || (a[i] == 'C') || (a[i] == 'G')) {\n        if ((b[i] == 'A') || (b[i] == 'T') || (b[i] == 'C') || (b[i] == 'G')) {\n          if (a[i] == b[i]) {\n            c = c + 1;\n          }\n        } else {\n          printf(\"error\");\n          return 0;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  y = 1.0 * c / na;\n  if (y >= x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, m, n = 0, p, q;\n  int i, t = 0;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  q = strlen(a);\n  p = strlen(b);\n  if (q != p) {\n    t = t + 1;\n  }\n  for (i = 0; i < q; i++) {\n    if (a[i] != 'T' && a[i] != 'C' && a[i] != 'G' && a[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < p; i++) {\n    if (b[i] != 'T' && b[i] != 'C' && b[i] != 'G' && b[i] != 'A') {\n      t = t + 1;\n    }\n  }\n  if (t != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        n = n + 1;\n      }\n    }\n    m = n / p;\n    if (m > c)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[2][600];\n  double n, m;\n  scanf(\"%lf %s \", &n, a);\n  scanf(\"%s\", a[1]);\n  int i, s = 0;\n  m = strlen(a[0]);\n  for (i = 0; i < m; i++) {\n    if ((a[0][i] != 65 && a[0][i] != 67 && a[0][i] != 71 && a[0][i] != 84) ||\n        (a[1][i] != 65 && a[1][i] != 67 && a[1][i] != 71 && a[1][i] != 84)) {\n      printf(\"error\");\n      s = -1;\n      break;\n    } else if (a[0][i] == a[1][i])\n      s++;\n  }\n\n  if (s != -1) {\n    double q;\n    q = s * 1.0 / m;\n    if (q >= n)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9242", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k = 0, j;\n  double x, num = 0, len;\n  char c[1];\n  char a[500], b[500];\n\n  cin >> c;\n  x = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      k = 1;\n      break;\n    } else {\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n        printf(\"error\");\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k != 1) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n    } else {\n      for (k = 0; k < strlen(a); k++) {\n        if (a[k] == b[k]) {\n          num = num + 1;\n        }\n      }\n      j = strlen(a);\n      len = 1.00 * j;\n      if ((num / len) <= x) {\n        printf(\"no\");\n      } else {\n        if ((num / len) > x) {\n          printf(\"yes\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, num = 0, l1, l2, a = 0;\n  double p;\n  char fir[501], sec[501];\n  scanf(\"%lf\", &p);\n  cin >> fir >> sec;\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n  if (l1 != l2) {\n    printf(\"error\\n\");\n    a = 1;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((fir[i] != 65 && fir[i] != 67 && fir[i] != 71 && fir[i] != 84) ||\n        (sec[i] != 65 && sec[i] != 67 && sec[i] != 71 && sec[i] != 84)) {\n      if (a == 0) {\n        cout << \"error\\n\";\n        a = 1;\n      }\n      break;\n    }\n    if (fir[i] == sec[i])\n      num += 1;\n  }\n  if (num * 1.0 / l1 >= p && a == 0) {\n    printf(\"yes\\n\");\n  } else if (num * 1.0 / l1 < p && a == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9244", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  double m, n, s;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) == strlen(b)) {\n\n    for (i = 0, j = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        k = 1;\n\n      } else {\n\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n    }\n    if (k == 0) {\n\n      n = 0.1 * strlen(a);\n      s = j * 0.1 / n;\n      if (s > m) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, w = 0, i, o = 0;\n  double c, k;\n  char a[501], b[501];\n  scanf(\"%lf\", &c);\n  scanf(\"%s%s\", a, b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y) {\n    cout << \"error\";\n  } else if (x == y) {\n    for (i = 0; i < x; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        printf(\"error\");\n        o++;\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          w++;\n        }\n      }\n    }\n    k = 1.0 * w / x;\n    if (o == 0) {\n      if (k > c)\n        cout << \"yes\";\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int len, lmn, sum = 0, i, flag = 1;\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  len = strlen(a);\n  lmn = strlen(b);\n  if (len != lmn)\n    printf(\"error\");\n  else\n\n    for (i = 0; i < len; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n\n  if (len == lmn && flag == 1) {\n    for (i = 0; i < len; i++) {\n      if (a[i] == b[i])\n        sum += 1;\n    }\n    if ((double)sum / len > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9247", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint atgc(char a) {\n  if (a == 'A' || a == 'G' || a == 'C' || a == 'T') {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  double m;\n  char xl1[500] = {'\\0'}, xl2[500] = {'\\0'};\n  scanf(\"%lf %s %s \", &m, xl1, xl2);\n  int len1, len2;\n  len1 = strlen(xl1);\n  len2 = strlen(xl2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    int i, n = 0;\n    for (i = 0; i < len1; i++) {\n      if (atgc(xl1[i]) == 0 || atgc(xl2[i]) == 0) {\n        printf(\"error\");\n        return 0;\n      } else if (xl1[i] == xl2[i]) {\n        n++;\n      }\n    }\n    if (1.0 * n / len1 >= m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9248", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, c, d;\n  double l, m, n, x = 0;\n  char a[500], b[500];\n  scanf(\"%lf %s %s \", &l, a, b);\n\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      d = 0;\n    } else {\n      d = 1;\n    }\n  }\n  if (c != 0 && d != 0 && n == m) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      } else {\n        x = x;\n      }\n    }\n    if (l < (x / n)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9249", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j, f, e, d, k;\n  int q[10000], p[10000];\n  double r, n;\n  char s[10000], w[100000];\n  e = 0;\n  k = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  m = strlen(s);\n  k = strlen(w);\n  for (i = 0; i < m; i++) {\n\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (w[i] != 'A' && w[i] != 'G' && w[i] != 'C' && w[i] != 'T') {\n      printf(\"error\");\n      break;\n    }\n    if (k != m) {\n      printf(\"error\");\n      break;\n    }\n    if (s[i] == w[i])\n      e++;\n    if (i == m - 1) {\n      r = e * 1.0 / m;\n      if (r >= n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9250", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x1[501], x2[501];\n  double n;\n  int i, y = 0;\n  cin >> n >> x1 >> x2;\n  if (strlen(x1) != strlen(x2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; x1[i] != '\\0'; i++) {\n    if ((x1[i] != 'A' && x1[i] != 'T' && x1[i] != 'G' && x1[i] != 'C') ||\n        (x2[i] != 'A' && x2[i] != 'C' && x2[i] != 'G' && x2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x1[i] == x2[i])\n      y++;\n  }\n  if ((double)y / i >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  float n;\n  char a[501] = {'\u0000'}, b[501] = {'\u0000'};\n  int i, sum = 0, m = 0;\n  cin >> n;\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error \");\n  else {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G') {\n          if (a[i] == b[i])\n            sum++;\n        }\n      } else {\n        printf(\"error \");\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (((float)sum / strlen(a)) > n)\n        printf(\"yes \");\n      else\n        printf(\"no \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  cin >> a;\n  scanf(\"%s\", &b);\n  int la = strlen(a), lb = strlen(b), i;\n  int s = 0;\n  double e;\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n\n      else {\n        if (a[i] == b[i]) {\n          s = s + 1;\n        }\n        if (i == la - 1) {\n          e = 1.0 * s / la;\n          if (e > n) {\n            printf(\"yes\");\n          } else {\n            cout << \"no\";\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, i, t = 0, s, d = 1;\n  double b, x = 0.0;\n  char a[501], c[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  s = strlen(c);\n  if (l == s) {\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n        d = 0;\n        break;\n      } else if (a[i] == c[i])\n        t++;\n      else\n        t = t;\n    }\n    if (d != 0) {\n      x = 1.0 * t / l;\n      if (x >= b)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, p;\n  int i;\n  int k = 0, s = 0;\n  char zfc1[500], zfc2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  int a = strlen(zfc1), b = strlen(zfc2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((zfc1[i] == 'A' || zfc1[i] == 'T' || zfc1[i] == 'C' ||\n           zfc1[i] == 'G') &&\n          (zfc2[i] == 'A' || zfc2[i] == 'T' || zfc2[i] == 'C' ||\n           zfc2[i] == 'G')) {\n        s++;\n      }\n      if (zfc1[i] == zfc2[i]) {\n        k++;\n      }\n    }\n    if (s == a) {\n      p = 1.0 * k / a;\n      if (p > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a, b = 0, c = 0, l1 = 0, l2 = 0;\n  int i, t = 0;\n  char m[501], n[501];\n\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\\n\", n);\n\n  l1 = strlen(m);\n  l2 = strlen(n);\n\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if ((m[i] == 'A' || m[i] == 'T' || m[i] == 'C' || m[i] == 'G') &&\n          (n[i] == 'A' || n[i] == 'T' || n[i] == 'C' || n[i] == 'G'))\n        t++;\n    }\n\n    if (t != l1)\n      printf(\"error\\n\");\n    else {\n      b = l1;\n      for (i = 0; i < l1; i++) {\n        if (m[i] == n[i])\n          c++;\n      }\n\n      if (c / b > a)\n        printf(\"yes\\n\");\n      else\n        cout << \"no\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t, k = 0;\n  double rate;\n  char a[501], b[501];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    t = strlen(a);\n    for (i = 0; i < t; i++) {\n      if (a[i] != 'T' && a[i] != 'G' && a[i] != 'C' && a[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (b[i] != 'T' && b[i] != 'G' && b[i] != 'C' && b[i] != 'A') {\n        printf(\"error\");\n        break;\n      }\n      if (a[i] == b[i])\n        k++;\n\n      if (i == t - 1) {\n        if (1.0 * k / t >= rate) {\n          printf(\"yes\");\n        } else\n          printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9257", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, i, t = 0, s, d = 1;\n  double b, x = 0.0;\n  char a[501], c[501];\n  cin >> b;\n  cin >> a;\n  cin >> c;\n  l = strlen(a);\n  s = strlen(c);\n  if (l == s) {\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n        d = 0;\n        break;\n      } else if (a[i] == c[i])\n        t++;\n      else\n        t = t;\n    }\n    if (d != 0) {\n      x = 1.0 * t / l;\n      if (x >= b)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, js, l;\n  char c[600], d[600];\n  double a, b;\n  scanf(\"%lf%s%s\", &a, c, d);\n  if (strlen(c) != strlen(d)) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(c);\n  js = 0;\n  for (i = 0; c[i] != '\\0'; i++) {\n    if ((c[i] == 'A' || c[i] == 'G' || c[i] == 'C' || c[i] == 'T') &&\n        (d[i] == 'A' || d[i] == 'G' || d[i] == 'C' || d[i] == 'T')) {\n      if (c[i] == d[i])\n        js++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = 1.0 * js / l;\n  if (b >= a)\n    printf(\"yes\");\n  else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "9259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, i;\n  double a, e, f;\n  char n[501], m[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", n);\n  scanf(\"%s\", m);\n  b = strlen(n);\n  c = strlen(m);\n  d = 0;\n  if (b != c) {\n    d++;\n  }\n  for (i = 0; i < b; i++) {\n    if ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G') ||\n        (m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) {\n      d++;\n    }\n  }\n  if (d != 0) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (i = 0; i < b; i++) {\n      if (n[i] == m[i]) {\n        e++;\n      }\n    }\n    f = e / b;\n    if (f > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9260", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[510], d[510];\n  int i, e;\n  double bl, k;\n  scanf(\"%lf\", &k);\n  cin >> a;\n  scanf(\"%s\", d);\n  e = 0;\n  int len1 = strlen(a);\n  int len2 = strlen(d);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n      if (d[i] != 'A' && d[i] != 'T' && d[i] != 'C' && d[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == d[i]) {\n          e++;\n        }\n      }\n    }\n    bl = 1.0 * e / len1;\n    if (bl > k) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9261", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, num = 0, a1, b1, t = 1;\n  char a[500], b[500];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  if (a1 != b1) {\n    printf(\"error\");\n\n    t = 0;\n  } else {\n    for (i = 0; i < a1; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        t = 0;\n        break;\n      }\n    }\n  }\n\n  if (t == 1) {\n    for (i = 0; i < a1; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    if (1.0 * num / a1 > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, j, k, kong = 1;\n  float n, t = 0, l1, l2;\n  scanf(\"%f\", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      j = a[i];\n      k = b[i];\n      if ((j != 'A' && j != 'T' && j != 'G' && j != 'C') ||\n          (k != 'A' && k != 'T' && k != 'G' && k != 'C')) {\n        printf(\"error\");\n        kong = 0;\n        break;\n      }\n    }\n    if (kong == 1) {\n      for (i = 0; i < l1; i++) {\n\n        if (a[i] == b[i]) {\n          t = t + 1;\n        }\n      }\n\n      if (t / l1 > n) {\n        cout << \"yes\";\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0, flag = 0, l;\n  float x;\n  char str[2][100];\n  scanf(\"%f%s%s\", &x, str[0], str[1]);\n  if (strlen(str[0]) != strlen(str[1]))\n    flag = 1;\n  else {\n    l = strlen(str[0]);\n    for (i = 0; i < l; i++) {\n      if ((str[0][i] != 'A' && str[0][i] != 'T' && str[0][i] != 'C' &&\n           str[0][i] != 'G') ||\n          (str[1][i] != 'A' && str[1][i] != 'T' && str[1][i] != 'C' &&\n           str[1][i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (str[0][i] == str[1][i])\n        t++;\n    }\n  }\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (((float)t / strlen(str[1])) >= x)\n      printf(\"yes\");\n    else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  char s1[501];\n  char s2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  int i, len1, len2, sum = 0;\n  double gl;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          sum += 1;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    gl = 1.0 * sum / len1;\n    if (gl > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  double n;\n  double k;\n  cin >> n;\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  k = 0;\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[i])\n      k++;\n  }\n  k = k / (strlen(a));\n  if (k >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, b;\n  double xg;\n  char s1[501], s2[501];\n  cin >> xg >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'T' || s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C') &&\n        (s2[i] == 'T' || s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C')) {\n      if (s1[i] == s2[i])\n        a++;\n\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = strlen(s1);\n  if (a * 1.0 / b > xg) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, s = 0;\n  char a[502], b[502];\n  int len1, len2, i;\n  scanf(\"%lf %s %s\", &x, a, b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[i])\n      s++;\n  }\n  s = s / len1;\n  if (s > x) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z, q;\n  char a[1][1000], b[1][1000];\n  int x, y, m, n, s = 0, i;\n  scanf(\"%lf\", &q);\n  scanf(\"%s%s\", a[0], b[0]);\n  m = strlen(a[0]);\n  n = strlen(b[0]);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G' ||\n        b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[0][i] == b[0][i]) {\n      s++;\n    }\n  }\n  z = 1.0 * s / m;\n  if (z > q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9269", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n;\n  double x, y, o = 0;\n  char a[500], b[500];\n  scanf(\"%lf\", &x);\n  cin >> a >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n)\n    printf(\"error\");\n  else {\n    for (i = 0; i < m; i++) {\n      if ((a[i] == 65 || a[i] == 71 || a[i] == 67 || a[i] == 84) &&\n          (b[i] == 65 || b[i] == 71 || b[i] == 67 || b[i] == 84)) {\n        if (a[i] == b[i]) {\n          o++;\n        }\n      } else {\n        printf(\"error\");\n        break;\n      }\n    }\n    if (i == m) {\n      y = o / n;\n      if (y >= x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  cin >> n;\n  char a[501], b[501];\n  cin >> a;\n  scanf(\"%s\", &b);\n  int la = strlen(a), lb = strlen(b), i;\n  int s = 0;\n  double e;\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < la; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        break;\n      }\n\n      else {\n        if (a[i] == b[i]) {\n          s = s + 1;\n        }\n        if (i == la - 1) {\n          e = 1.0 * s / la;\n          if (e > n) {\n            printf(\"yes\");\n          } else {\n            cout << \"no\";\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double w;\n  char s1[600], s2[600];\n  int l1, l2, i, a;\n  a = 0;\n  scanf(\"%lf\\n\", &w);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s \", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < l1; i++) {\n      if (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i]) {\n        a++;\n      }\n    }\n    if ((1.0 * a) / l1 > w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, x, y, count = 0;\n  double n, m;\n  char a[1000], b[1000];\n  cin >> n;\n  cin >> a;\n  scanf(\"%s\", &b);\n  for (i = 0; a[i] != '\\0', b[i] != '\\0'; i++) {\n    x = strlen(a);\n    y = strlen(b);\n    if (x != y) {\n      printf(\"error\\n\");\n\n      return 0;\n      break;\n    }\n    for (j = 0; a[j] != '\\0'; j++) {\n      if (a[j] != 'A' && a[j] != 'T' && a[j] != 'G' && a[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'G' && b[j] != 'C') {\n        printf(\"error\\n\");\n\n        return 0;\n        break;\n      }\n    }\n\n    if (a[i] == b[i])\n      count++;\n  }\n  m = ((1.0) * count) / x;\n  if (m >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, f;\n  int x, y, b = 0, c = 0;\n  char d1[501], d2[501];\n  scanf(\"%f\", &a);\n  scanf(\"%s\", d1);\n  scanf(\"%s\", d2);\n  x = strlen(d1);\n  y = strlen(d2);\n  if (x != y)\n    printf(\"error\");\n  else {\n    for (int i = 0; i <= x - 1; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        if (d1[i] == d2[i])\n          b++;\n      } else {\n        c = 1;\n        break;\n      }\n    }\n    f = (float)b / (float)x;\n    if (c == 0 && f > a)\n      printf(\"yes\");\n    else if (c == 0 && f <= a)\n      printf(\"no\");\n    else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char x[1000], y[1000];\n  int i, lengthx, lengthy, same = 0;\n  float rate, a;\n  scanf(\"%f\", &rate);\n  scanf(\"%s %s\", x, y);\n  lengthx = strlen(x);\n  lengthy = strlen(y);\n  if (lengthx != lengthy)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < lengthx; i++) {\n      if ((x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T') ||\n          (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T'))\n        break;\n    }\n    if (i < lengthx - 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < lengthx; i++)\n        if (x[i] == y[i])\n          same++;\n      a = (float)same / (float)lengthx;\n      if (a > rate)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, b, d;\n  double n, e;\n  char s1[500], s2[500];\n  int c = 0;\n\n  scanf(\"%lf \", &n);\n\n  cin >> s1;\n\n  cin >> s2;\n  b = strlen(s1);\n  d = strlen(s2);\n  for (i = 0; i < b; i++) {\n    if ((s1[i] != 'A') && (s1[i] != 'T') && (s1[i] != 'C') && (s1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < b; i++) {\n    if ((s2[i] != 'A') && (s2[i] != 'T') && (s2[i] != 'C') && (s2[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  if (b == d) {\n    for (i = 0; i < b; i++) {\n      if (s1[i] == s2[i])\n        c++;\n    }\n    e = 1.0 * c / b;\n    if (e >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  else {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, b;\n  int n1, n2, m = 0, c = 0;\n  char s1[500], s2[500];\n  scanf(\"%lf\", &a);\n  scanf(\"%s %s\", s1, s2);\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (int i = 0; s1[i] != '\\0'; i++) {\n    if ((s1[i] == 'A' || s1[i] == 'G' || s1[i] == 'C' || s1[i] == 'T') &&\n        (s2[i] == 'A' || s2[i] == 'G' || s2[i] == 'C' || s2[i] == 'T')) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    } else\n      c = 1;\n  }\n  if (c == 1 || n1 != n2)\n    printf(\"error\\n\");\n  else {\n    b = m * 1.0 / n1;\n    if (a < b) {\n      printf(\"yes\\n\");\n    } else\n      printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b = 0, i;\n  char a[100][100], e[210];\n  double n;\n\n  cin >> e;\n  n = atof(e);\n\n  cin >> a[0];\n\n  cin >> a[1];\n  int p = strlen(a[0]);\n  int q = strlen(a[1]);\n  if (p != q) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < p; i++) {\n      if (!(a[0][i] == 'A' || a[0][i] == 'T' || a[0][i] == 'G' ||\n            a[0][i] == 'C' && a[1][i] == 'A' || a[1][i] == 'T' ||\n\n            a[1][i] == 'G' || a[1][i] == 'C')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[0][i] == a[1][i]) {\n          b++;\n        }\n      }\n    }\n  }\n  if (1.0 * b / p > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, len1, len2, i, n, p = 0;\n  double x, y;\n  char a1[501], a2[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", a1, a2);\n  len1 = strlen(a1);\n  len2 = strlen(a2);\n  if (len1 != len2)\n    p = 1;\n  else {\n    for (i = 0; i < len1; i++) {\n      if ((a1[i] != 'A' && a1[i] != 'T' && a1[i] != 'C' && a1[i] != 'G') ||\n          (a2[i] != 'A' && a2[i] != 'T' && a2[i] != 'C' && a2[i] != 'G')) {\n        p = 1;\n      }\n    }\n  }\n  if (p != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a1[i] == a2[i])\n        sum++;\n    }\n    y = 1.0 * sum / len1;\n    if (y <= x) {\n      printf(\"no\");\n    } else {\n      printf(\"yes\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, len, lena;\n  double r, ra;\n  char z[200];\n  char x[200];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", z);\n  scanf(\"%s\", x);\n  len = strlen(z);\n  lena = strlen(x);\n  d = 0;\n  for (a = 0; a <= len - 1; a++) {\n    if (len != lena)\n      d = 1;\n    if ((z[a] != 'A') && (z[a] != 'T') && (z[a] != 'C') && (z[a] != 'G'))\n      d = 1;\n    if ((x[a] != 'A') && (x[a] != 'T') && (x[a] != 'C') && (x[a] != 'G'))\n      d = 1;\n  }\n  if (d == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  b = 0;\n  c = 0;\n  for (a = 0; a <= len - 1; a++) {\n    c++;\n    if (z[a] == x[a])\n      b++;\n  }\n  ra = b * 1.0 / c;\n  if (ra > r)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  int i, j, k = 0, flag = 0;\n  for (j = 0; 1; j++) {\n    scanf(\"%c\", &a[j]);\n    if (a[j] == '\\n' && j != 0) {\n      j = j - 1;\n      break;\n    }\n  }\n  \n  for (i = 1; 1; i++) {\n    scanf(\"%c\", &b[i]);\n    if (b[i] == '\\n') {\n      i = i - 1;\n      break;\n    }\n  }\n  \n  if (i != j)\n    flag = 1;\n  else {\n    for (i = 1; i <= j; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    }\n  }\n  \n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (1.0 * k / j > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, k;\n  n = 0;\n  k = 1;\n  double s;\n  char x1[501], x2[501];\n  cin >> s;\n  scanf(\"%s\", x1);\n  scanf(\"%s\", x2);\n  l1 = strlen(x1);\n  l2 = strlen(x2);\n  if (l1 != l2)\n    printf(\"error\");\n  else {\n    for (i = 0; i < l1; i++) {\n      if (!(x1[i] == 'A' || x1[i] == 'C' || x1[i] == 'G' || x1[i] == 'T')) {\n        cout << \"error\";\n        k = 0;\n        break;\n      }\n      if (!(x2[i] == 'A' || x2[i] == 'C' || x2[i] == 'G' || x2[i] == 'T')) {\n        printf(\"error\");\n        k = 0;\n        break;\n      }\n      if (x1[i] == x2[i]) {\n        n++;\n      }\n    }\n    if (k) {\n      if (1.0 * n / l1 > s) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char k[501], h[501];\n  double c, d;\n  scanf(\"%lf\", &c);\n  scanf(\"%s\", k);\n  scanf(\"%s\", h);\n  int sum = 0;\n  int a;\n  a = strlen(k);\n  int b;\n  b = strlen(h);\n  if (a != b)\n    cout << \"error\";\n  else if (a == b) {\n    for (int i = 0; i < a; i++) {\n      if ((k[i] != 'A' && k[i] != 'T' && k[i] != 'C' && k[i] != 'G') ||\n          (h[i] != 'A' && h[i] != 'T' && h[i] != 'C' && h[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (k[i] == h[i])\n          sum++;\n      }\n    }\n    if (1.0 * sum / a > c)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, b, s = 0, j, a;\n  double r, R;\n  char gene[500], gene2[500];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", gene);\n  scanf(\"%s\", gene2);\n  b = strlen(gene2);\n  a = strlen(gene);\n  if (a != b) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < a; i++) {\n    if (gene[i] != 'A' && gene[i] != 'T' && gene[i] != 'C' && gene[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (gene2[i] != 'A' && gene2[i] != 'T' && gene2[i] != 'C' &&\n        gene2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    if (gene[i] == gene2[i])\n      s++;\n  }\n  R = 1.000 * s / b;\n  if (R > r) {\n    printf(\"yes\");\n  } else if (R <= r) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double percent;\n  char a[501], b[501];\n  int number = 0;\n  int i;\n  scanf(\"%lf\", &percent);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[i]) {\n      number++;\n    }\n  }\n  if ((double)number > ((double)strlen(a)) * percent) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, x, y, u = 0, t = 0;\n  double n;\n  char a[505], b[505];\n  scanf(\"%lf \", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  ;\n  x = strlen(a);\n  y = strlen(b);\n  if (x != y)\n    t = 0;\n  else {\n    for (i = 0; i < x; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        t += 1;\n        if (a[i] == b[i])\n          u += 1;\n\n      } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n                 (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C'))\n        t = 0;\n    }\n  }\n  if (t == 0)\n    printf(\"error\");\n  else if (u * 1.0 / x >= n)\n    printf(\"yes\");\n  else if (u * 1.0 / x < n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9286", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double c, w = 0, n = 0;\n  char x[600], y[600];\n  cin >> c;\n  getchar();\n\n  cin >> x;\n\n  cin >> y;\n  if (strlen(x) == strlen(y)) {\n    for (int j = 0; j < strlen(x); j++) {\n      if ((x[j] != 'A' && x[j] != 'T' && x[j] != 'G' && x[j] != 'C') ||\n          (y[j] != 'A' && y[j] != 'T' && y[j] != 'G' && y[j] != 'C')) {\n        printf(\"error\");\n        n = 1;\n        break;\n      }\n      if (x[j] == y[j])\n        w++;\n    }\n  } else {\n    printf(\"error\");\n    n = 1;\n  }\n  if (n == 0) {\n    w = w / strlen(x);\n    if (c < w) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, len1, len2, m = 0;\n  double a, n, b;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\\n\", jy1);\n  scanf(\"%s\\n\", jy2);\n  len1 = strlen(jy1);\n  len2 = strlen(jy2);\n  for (i = 0; i < len1; i++) {\n    if ((jy1[i] != 'A') && (jy1[i] != 'T') && (jy1[i] != 'C') &&\n        (jy1[i] != 'G'))\n      m++;\n  }\n  for (j = 0; j < len2; j++) {\n    if ((jy2[j] != 'A') && (jy2[j] != 'T') && (jy2[j] != 'C') &&\n        (jy2[j] != 'G'))\n      m++;\n  }\n  if (m > 0)\n    printf(\"error\");\n  else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (jy1[i] == jy2[i])\n        n++;\n    }\n    b = n / len1;\n    if (b > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0;\n  double j;\n  char a[2000], b[2000];\n  scanf(\"%lf%s%s\", &j, a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    if (1.0 * m / n > j)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9289", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[100], b[100], c[100];\nint main() {\n  int sum = 0;\n  double m;\n  double s;\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  cin >> b;\n  int x, y;\n  x = strlen(a), y = strlen(b);\n  a[x] = '\\0';\n  b[y] = '\\0';\n  if (x != y) {\n    printf(\"error\");\n    return 0;\n  }\n  int i;\n  for (i = 0; i < x; i++) {\n    if (a[i] == 'A') {\n      c[i] = 'A';\n    } else if (a[i] == 'T') {\n      c[i] = 'T';\n    } else if (a[i] == 'C') {\n      c[i] = 'C';\n    } else if (a[i] == 'G') {\n      c[i] = 'G';\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (b[i] == c[i]) {\n      sum++;\n    }\n  }\n  s = 1.0 * sum / x;\n  if (s >= m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, k = 0, p;\n  int i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\\n\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G' &&\n         s[i] != 'A') ||\n        (s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'A')) {\n      printf(\"error\");\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    p = 1.0 * k / strlen(s);\n    if (p > r)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float x, fenzi = 0;\n  int lena, lenb, i, j = 0;\n  char a[505], b[505], ch;\n  cin >> x;\n  cin >> ch;\n\n  cin >> a;\n\n  cin >> b;\n\n  lena = strlen(a);\n  lenb = strlen(b);\n  if (lena != lenb)\n    printf(\"error \");\n  else {\n    for (i = 0; i < lena; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          fenzi++;\n      } else {\n        j = 1;\n        printf(\"error \");\n        break;\n      }\n    }\n    if (j == 0 && fenzi >= x * lena)\n      printf(\"yes \");\n    else if (j == 0)\n      cout << \"no \";\n  }\n}\n"}
{"label": "5", "index": "9292", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m = 0;\n  double sum = 0, n;\n  char gene[3][501];\n\n  scanf(\"%lf\", &n);\n  cin >> gene[0];\n  scanf(\"%s \", gene);\n  if (strlen(gene[0]) != strlen(gene[1]))\n    printf(\"error\");\n  else {\n    for (i = 0; i < 2; i++) {\n      for (j = 0; gene[i][j] != '\\0'; j++) {\n        if (gene[i][j] != 'A' && gene[i][j] != 'T' && gene[i][j] != 'C' &&\n            gene[i][j] != 'G') {\n          printf(\"error\");\n          m = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; gene[0][i] != '\\0'; i++) {\n      if (gene[0][i] == gene[1][i])\n        sum++;\n    }\n    if (sum / strlen(gene[0]) > n && m == 0)\n      printf(\"yes\");\n    else if (sum / strlen(gene[0]) <= n && m == 0)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char x, char y) {\n  if (x == y)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  double r, x;\n  scanf(\"%lf\", &r);\n  char str1[1000], str2[1000];\n  scanf(\"%s\\n\", str1);\n  scanf(\"%s\", str2);\n  int len1, len2;\n  int i, count = 0;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if ((str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' &&\n         str1[i] != 'T') ||\n        (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' &&\n         str2[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if (f(str1[i], str2[i]) == 1) {\n      count++;\n    }\n  }\n  x = 1.0 * count / len1;\n  if (x > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, x;\n  double n, result = 0, result1;\n  char dna1[500];\n  char dna2[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n  if (len1 != len2) {\n    cout << \"error\";\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (((dna1[i] == 'A') || (dna1[i] == 'T') || (dna1[i] == 'C') ||\n           (dna1[i] == 'G')) &&\n          ((dna2[i] == 'A') || (dna2[i] == 'T') || (dna2[i] == 'C') ||\n           (dna2[i] == 'G'))) {\n        x = 1;\n      } else {\n        x = 0;\n        break;\n      }\n    }\n  }\n  if (x == 0) {\n    printf(\"error\");\n    return 0;\n  }\n  if (x == 1) {\n    for (i = 0; i < len1; i++) {\n      if (dna1[i] != dna2[i]) {\n        result++;\n      }\n    }\n    result1 = (double)1 - (result / len1);\n    if ((result1) > n) {\n      printf(\"yes\");\n    }\n    if ((result1) <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, q = 0, a, b, d = 0, e = 0, l, g;\n  float c, n;\n  char s1[500], s2[500];\n  scanf(\"%f\\n\", &n);\n  scanf(\"%s\\n%s\", s1, s2);\n  if (strlen(s1) != strlen(s2))\n    cout << \"error\";\n  if (strlen(s1) == strlen(s2)) {\n    for (i = 0; s1[i] != '\\0'; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C')\n        d++;\n    }\n    for (j = 0; s2[j] != '\\0'; j++) {\n      if (s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'G' && s2[j] != 'C') {\n        e++;\n      }\n    }\n    l = strlen(s1);\n    for (int k = 0; k < l; k++) {\n      if (s1[k] == s2[k])\n        q++;\n    }\n    a = strlen(s1);\n    b = q;\n    c = (float)b / (float)a;\n    g = d + e;\n    if (g != 0) {\n      printf(\"error\");\n    } else {\n      if (c >= n)\n        printf(\"yes\");\n      if (c < n)\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, y, m = 0;\n  double n;\n  char a[501], b[501];\n  scanf(\"%lf \", &n);\n\n  cin >> a;\n\n  cin >> b;\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        printf(\"error\");\n        break;\n      } else {\n        if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n          printf(\"error\");\n          break;\n        } else {\n          if (a[i] == b[i])\n            m++;\n        }\n      }\n      if (i == x - 1) {\n        if (1.0 * m / x > n) {\n          printf(\"yes\");\n        } else {\n          printf(\"no\");\n        }\n      }\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9297", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z;\n  int i, j, a, b, c, d, m, n;\n  scanf(\"%lf\", &z);\n  char zfc[501];\n  scanf(\"%s\", zfc);\n  char bjc[501];\n  scanf(\"%s\", bjc);\n  i = 0;\n  j = 0;\n  c = 0;\n  d = 0;\n  n = 0;\n  while (zfc[i] != '\\0') {\n    i++;\n  }\n  while (bjc[j] != '\\0') {\n    j++;\n  }\n  for (a = 0; zfc[a] != '\\0'; a++) {\n    if (zfc[a] == 'A' || zfc[a] == 'T' || zfc[a] == 'C' || zfc[a] == 'G') {\n      c++;\n    }\n  }\n  for (b = 0; bjc[b] != '\\0'; b++) {\n    if (bjc[b] == 'A' || bjc[b] == 'T' || bjc[b] == 'C' || bjc[b] == 'G') {\n      d++;\n    }\n  }\n  if (i == j && c == i && d == i) {\n    for (m = 0; m < i; m++) {\n      if (zfc[m] == bjc[m]) {\n        n++;\n      }\n    }\n    if ((1.0 * n / i) > z) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, i, j, count;\n  double a, x, y, z;\n  char m[550], n[550];\n  cin >> a >> m >> n;\n  b = strlen(m);\n  c = strlen(n);\n  if (b != c)\n    printf(\"error\");\n  j = 0;\n  if (b == c) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G')\n        j++;\n    }\n    for (i = 0; n[i] != '\\0'; i++) {\n      if (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')\n        j++;\n    }\n    if (j > 0)\n      printf(\"error\");\n  }\n  count = 0;\n  if (b == c && j == 0) {\n    for (i = 0; m[i] != '\\0'; i++) {\n      if (m[i] == n[i])\n        count++;\n    }\n    y = count;\n    z = b;\n    x = z * a;\n    if (y >= x)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0, p = 0;\n  char sz[10000];\n  char s[10000];\n  double n, c;\n  scanf(\"%lf%s%s\", &n, &sz, &s);\n  for (i = 0; sz[i]; i++) {\n    if (sz[i] == s[i]) {\n      a++;\n    }\n    b++;\n    if ((sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') ||\n        (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')) {\n      p++;\n    }\n  }\n  c = 1.0 * a / b;\n  if (p != 0) {\n    printf(\"error\");\n  }\n\n  if (p == 0 && c > n) {\n    printf(\"yes\");\n  }\n  if (p == 0 && c <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, q, n, i, m, l;\n  double p, k;\n  char sz[500], dz[500];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", sz);\n  scanf(\"%s\", dz);\n  m = 0;\n  y = 0;\n  n = 0;\n  l = 0;\n  n = strlen(sz);\n  q = 0;\n  m = strlen(dz);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        y++;\n        printf(\"error\");\n        break;\n      }\n      if (dz[i] != 'A' && dz[i] != 'T' && dz[i] != 'C' && dz[i] != 'G') {\n        l++;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (l == 0 && y == 0) {\n      for (i = 0; i < n; i++) {\n        if (sz[i] == dz[i]) {\n          q++;\n        }\n      }\n      k = 1.0 * q / n;\n      if (k > p) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[501], s2[502];\n  int l1, l2, i;\n  double std, aa;\n  scanf(\"%lf\\n\", &std);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\", s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  aa = -1;\n  if (l1 == l2) {\n    aa = 0;\n    for (i = 0; i < l1; i++) {\n      if (s1[i] == s2[i])\n        aa++;\n      if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n        aa = -1;\n        break;\n      }\n      if (s2[i] != 'A' && s2[i] != 'C' && s2[i] != 'T' && s2[i] != 'G') {\n        aa = -1;\n        break;\n      }\n    }\n  }\n  if (aa == -1)\n    printf(\"error\");\n  else {\n    aa = aa / l1;\n    if (aa > std)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[510], s2[510];\n  double n, q;\n  int i, len1, len2, D, c, d, f;\n  c = 0;\n  D = 1;\n  d = f = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 != len2) {\n    D = 0;\n  } else if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'G' && s1[i] != 'C' && s1[i] != 'T') {\n        d++;\n      }\n    }\n    if (d > 0) {\n      D = 0;\n    }\n    for (i = 0; i < len1; i++) {\n      if (s2[i] != 'A' && s2[i] != 'G' && s2[i] != 'C' && s2[i] != 'T') {\n        f++;\n      }\n    }\n    if (f > 0) {\n      D = 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (s1[i] == s2[i]) {\n      c++;\n    }\n  }\n  q = 1.0 * c / len1;\n  if (D == 1 && q > n) {\n    printf(\"yes\");\n  } else if (D == 1 && q <= n) {\n    printf(\"no\");\n  } else if (D == 0) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double y, a;\n  char q[501], h[501];\n  int n1, n2, i, c = 0, tag = 0;\n  scanf(\"%lf\", &y);\n  scanf(\"%s\", q);\n  scanf(\"%s\", h);\n  n1 = strlen(q);\n  n2 = strlen(h);\n  if (n1 != n2) {\n    cout << \"error\";\n  } else {\n\n    for (i = 0; i < n1; i++) {\n      if ((q[i] != 'A') && (q[i] != 'T') && (q[i] != 'C') && (q[i] != 'G')) {\n        printf(\"error\");\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (i = 0; i < n2; i++) {\n        if ((h[i] != 'A') && (h[i] != 'T') && (h[i] != 'C') && (h[i] != 'G')) {\n          printf(\"error\");\n          tag = 1;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < n1; i++) {\n      if (q[i] == h[i])\n        c++;\n    }\n    a = 1.0 * c / n1;\n    if (tag == 0) {\n      if (a > y) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  float l1, l2;\n  float n, count = 0, result;\n  char x[505], y[505];\n  scanf(\"%f\", &n);\n  getchar();\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  l1 = strlen(x);\n  l2 = strlen(y);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'C' || x[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'C' || y[i] == 'G')\n      continue;\n    else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    if (x[i] == y[i]) {\n      count++;\n    }\n  }\n  result = count / l1;\n  if (result > n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, n, l1, l2, f = 0, i;\n  double m, x;\n  char a[501], b[501];\n  scanf(\"%lf%s%s\", &m, a, b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2)\n    printf(\"error\\n\");\n  else {\n    for (i = 0; i < l1; i++)\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        f = 1;\n      }\n    if (f == 1)\n      printf(\"error\\n\");\n    else {\n      for (i = 0; i < l1; i++)\n        if (a[i] == b[i])\n          s++;\n      x = (double)s / l1;\n      if (x > m)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float rate, rate0;\n  int sum = 0, len1, len2, i, tag = 0;\n  char base1[501], base2[501];\n  cin >> rate >> base1 >> base2;\n  len1 = strlen(base1);\n  len2 = strlen(base2);\n  if (len1 != len2) {\n    tag = 1;\n    goto pku;\n  }\n  for (i = 0; i < len1; i++) {\n    if (base1[i] != 'A' && base1[i] != 'T' && base1[i] != 'C' &&\n            base1[i] != 'G' ||\n        base2[i] != 'A' && base2[i] != 'T' && base2[i] != 'C' &&\n            base2[i] != 'G') {\n      tag = 1;\n      goto pku;\n    }\n    if ((int)base1[i] == (int)base2[i])\n      sum++;\n    else\n      continue;\n  }\n  rate0 = (float)sum / len1;\n  if (rate0 > rate)\n    cout << \"yes\";\n  else\n    cout << \"no\";\npku:\n  if (tag)\n    cout << \"error\";\n  return 0;\n}\n"}
{"label": "5", "index": "9307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, q = 0;\n  double n, A, B, p = 0.0;\n  char a[500], b[500];\n  scanf(\"%lf\", &n);\n\n  cin >> a;\n\n  cin >> b;\n  A = strlen(a);\n  B = strlen(b);\n  if (A != B) {\n    cout << \"error\";\n  }\n  if (A == B) {\n    for (i = 0; i < A; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        q = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (q == 0) {\n      for (i = 0; i < A; i++) {\n        if (a[i] == b[i]) {\n          p += 1.0;\n        }\n      }\n      if ((p / A) > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[505], zfc2[505];\n  int i, j;\n  double k;\n  j = 0;\n  scanf(\"%lf\", &k);\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  if (strlen(zfc1) != strlen(zfc2)) {\n    cout << \"error\";\n    scanf(\"%s\", zfc1);\n    return 0;\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if ((zfc1[i] != 'A' && zfc1[i] != 'T' && zfc1[i] != 'C' &&\n         zfc1[i] != 'G') ||\n        (zfc2[i] != 'A' && zfc2[i] != 'T' && zfc2[i] != 'C' &&\n         zfc2[i] != 'G')) {\n      printf(\"error\");\n      scanf(\"%s\", zfc1);\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(zfc1); i++) {\n    if (zfc1[i] == zfc2[i])\n      j++;\n  }\n  if (1.0 * j / strlen(zfc1) > k)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  scanf(\"%s\", zfc1);\n  return 0;\n}\n"}
{"label": "5", "index": "9309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double x, y;\n  int l, i, xg = 0, cw = 0;\n  char jy[2][500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s %s\", jy[0], jy[1]);\n  if (strlen(jy[0]) == strlen(jy[1])) {\n    l = strlen(jy[0]);\n    for (i = 0; i < l; i++) {\n      if (jy[0][i] == jy[1][i]) {\n        xg++;\n      }\n      if ((jy[0][i] != 'A' && jy[0][i] != 'T' && jy[0][i] != 'C' &&\n           jy[0][i] != 'G') ||\n          (jy[1][i] != 'A' && jy[1][i] != 'T' && jy[1][i] != 'C' &&\n           jy[1][i] != 'G')) {\n        cw++;\n      }\n    }\n    y = 1.0 * xg / l;\n  } else if (strlen(jy[0]) != strlen(jy[1])) {\n    cw++;\n  }\n  if (cw == 0) {\n    printf(y > x ? \"yes\" : \"no\");\n  } else if (cw != 0) {\n    cout << \"error\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, w1, w2, b;\n  double n, k;\n  a = 0;\n  b = 0;\n  char s1[502], s2[502];\n  cin >> n;\n  scanf(\"%s %s\", s1, s2);\n  w1 = strlen(s1);\n  w2 = strlen(s2);\n\n  if (w1 != w2) {\n    printf(\"error\");\n    b = 1;\n  } else {\n    for (i = 0; i < w1; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        if (s1[i] == s2[i]) {\n          a++;\n        }\n      }\n\n      else {\n        printf(\"error\");\n        b = 1;\n        break;\n      }\n    }\n    k = 1.0 * a / w1;\n    if (k > n && b == 0) {\n      printf(\"yes\");\n    } else if (k <= n && b == 0) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, y;\n  int a, b, x = 0, k = 1;\n  char sy[501], se[501];\n  scanf(\"%lf %s %s\", &n, sy, se);\n  a = strlen(sy);\n  b = strlen(se);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; i < a; i++) {\n      if ((sy[i] == 'A' || sy[i] == 'T' || sy[i] == 'C' || sy[i] == 'G') &&\n          (se[i] == 'A' || se[i] == 'T' || se[i] == 'C' || se[i] == 'G')) {\n        if (sy[i] == se[i]) {\n          x += 1;\n        }\n      } else {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 0)\n      printf(\"error\");\n    else {\n      y = 1.0 * x / a;\n      if (y >= n) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501] = {0};\n  char b[501] = {0};\n  int i, n;\n  double e, s = 0, c;\n  scanf(\"%lf\", &e);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') &&\n          (b[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C')) {\n        printf(\"error\");\n        return 0;\n      }\n\n      else {\n        n = strlen(a);\n\n        if (a[i] == b[i]) {\n          s++;\n        }\n      }\n    }\n  }\n\n  c = s / n;\n\n  if (c > e) {\n    printf(\"yes\\n\");\n  } else if (c <= e) {\n    printf(\"no\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p;\n  int la, i, y = 0, lb, s = 0;\n  char zfa[501], zfb[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", zfa);\n  scanf(\"%s\", zfb);\n  la = strlen(zfa);\n  lb = strlen(zfb);\n  if (la != lb)\n    y = 1;\n\n  if (y == 0) {\n    for (i = 0; zfa[i] != '\\0' && zfb[i] != '\\0'; i++) {\n      if (((zfa[i] != 'A') && (zfa[i] != 'T') && (zfa[i] != 'C') &&\n           (zfa[i] != 'G')) ||\n          ((zfb[i] != 'A') && (zfb[i] != 'T') && (zfb[i] != 'C') &&\n           (zfb[i] != 'G'))) {\n        y = 1;\n        break;\n      }\n      if (zfa[i] == zfb[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / la) > p && y == 0) {\n      cout << \"yes\";\n    } else if (y == 0)\n      printf(\"no\");\n  }\n  if (y == 1) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9314", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x;\n  int n, i, m, y;\n  char lian1[1000], lian2[1000];\n  scanf(\"%lf \", &x);\n  scanf(\"%s\", lian1);\n  scanf(\"%s\", lian2);\n  n = strlen(lian1);\n  y = strlen(lian2);\n  if (y != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (!(lian1[i] == 'A' || lian1[i] == 'T' || lian1[i] == 'C' ||\n          lian1[i] == 'G' || lian2[i] == 'A' || lian2[i] == 'T' ||\n          lian2[i] == 'C' || lian2[i] == 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (lian1[i] == lian2[i]) {\n      m++;\n    }\n  }\n  if (m * 1.0 / n > x) {\n    printf(\"yes\");\n  } else if (m * 1.0 / n <= x) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[1000], j[1000];\n  cin >> s;\n  scanf(\"%s\", j);\n  if (strlen(s) != strlen(j)) {\n    cout << \"error\";\n    return 0;\n  }\n  int k;\n  k = strlen(s);\n  int sum = 0;\n  double rate;\n  int i;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (j[i] != 'A' && j[i] != 'G' && j[i] != 'C' && j[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (s[i] == j[i]) {\n      sum++;\n    }\n  }\n  rate = 1.0 * sum / k;\n  if (rate > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9316", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, m;\n  double n;\n  m = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = strlen(a);\n  int q = strlen(b);\n  if (p == q) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) ||\n          ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if ((a[i]) == (b[i])) {\n          m++;\n        }\n      }\n    }\n    if ((1.0 * m / (p * 1.0)) >= n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, h = 1, la, lb;\n  double s, r;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &s);\n  scanf(\"%s\\n%s\", a, b);\n  la = strlen(a);\n  lb = strlen(b);\n  if (la != lb) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (((a[i] != 'A') && (a[i] != 'G') && (a[i] != 'C') && (a[i] != 'T')) ||\n          ((b[i] != 'A') && (b[i] != 'G') && (b[i] != 'C') && (b[i] != 'T'))) {\n        cout << \"error\";\n        h = 0;\n        break;\n      }\n    }\n    if (h == 1) {\n      for (i = 0; a[i] != '\\0'; i++) {\n        if (a[i] == b[i]) {\n          j++;\n        }\n      }\n      r = (double)j / (double)la;\n      if (r >= s) {\n        printf(\"yes\");\n      } else {\n        cout << \"no\";\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bl, jl;\n  scanf(\"%lf\", &bl);\n  char dna1[501], dna2[501];\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  int i, k = 0, l, n = 0;\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n         dna1[i] != 'T') ||\n        (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n         dna2[i] != 'T')) {\n      k++;\n    }\n  }\n  if (k > 0) {\n    cout << \"error\\n\";\n  } else {\n    for (i = 0; i < l; i++) {\n      if (dna1[i] == dna2[i]) {\n        n++;\n      }\n    }\n    jl = 1.0 * n / (l - 1);\n    if (jl > bl) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t = 0, flag = 0, l;\n  float x;\n  char str[2][100];\n  scanf(\"%f%s%s\", &x, str[0], str[1]);\n  if (strlen(str[0]) != strlen(str[1]))\n    flag = 1;\n  else {\n    l = strlen(str[0]);\n    for (i = 0; i < l; i++) {\n      if ((str[0][i] != 'A' && str[0][i] != 'T' && str[0][i] != 'C' &&\n           str[0][i] != 'G') ||\n          (str[1][i] != 'A' && str[1][i] != 'T' && str[1][i] != 'C' &&\n           str[1][i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (str[0][i] == str[1][i]) {\n        t++;\n      }\n    }\n  }\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (((float)t / strlen(str[1])) >= x)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double p;\n  int e = 0, t = 0, q = 0;\n  char a[501], b[501];\n  scanf(\"%lf \", &p);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  if (strlen(a) != strlen(b))\n    q = 1;\n  else {\n    for (int i = 0; 1; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n        q = 1;\n        break;\n      }\n      if (a[i] == b[i])\n        e++;\n      t++;\n    }\n  }\n  if (q == 1)\n    printf(\"error\");\n  else {\n    if (p < 1.0 * e / t)\n      printf(\"yes\");\n    if (p > 1.0 * e / t)\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9321", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c[2], e = 0;\n  char a[2][501];\n  double b;\n  cin >> b;\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  c[0] = strlen(a[0]);\n  c[1] = strlen(a[1]);\n  if (c[0] != c[1]) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < c[i] - 1; j++) {\n      if (a[i][j] != 'A' && a[i][j] != 'T' && a[i][j] != 'G' &&\n          a[i][j] != 'C') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  for (j = 0; j < c[0]; j++) {\n    if (a[0][j] == a[1][j]) {\n      e++;\n    }\n  }\n  if (1.0 * e / c[0] > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char x[501], y[501], m = 0, n = 0, i, p = 0, q = 0;\n  double a, b;\n  cin >> a;\n  cin >> x;\n  scanf(\"%s\", y);\n  for (i = 0; x[i]; i++) {\n    if (x[i] != 'A' && x[i] != 'C' && x[i] != 'G' && x[i] != 'T') {\n      q++;\n    }\n    m++;\n  }\n  for (i = 0; y[i]; i++) {\n    if (y[i] != 'A' && y[i] != 'C' && y[i] != 'G' && y[i] != 'T') {\n      q++;\n    }\n    p++;\n  }\n  if (m != p || q != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < m; i++) {\n      if (x[i] == y[i]) {\n        n++;\n      }\n    }\n    b = 1.0 * n / m;\n    if (b > a) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l;\n  double n;\n  double k;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  k = 0;\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[i])\n      k++;\n  }\n  k = k / (strlen(a));\n  if (k >= n)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int k = strlen(a);\n  int l = strlen(b);\n  int x = 0, y = 0;\n  int mm = 0;\n  for (mm = 0; mm < k; mm++) {\n    if (a[mm] != 'A' && a[mm] != 'T' && a[mm] != 'G' && a[mm] != 'C') {\n      x = 1;\n    }\n  }\n  for (mm = 0; mm < l; mm++) {\n    if (b[mm] != 'A' && b[mm] != 'T' && b[mm] != 'G' && b[mm] != 'C') {\n      y = 1;\n    }\n  }\n  if (k != l || x == 1 || y == 1) {\n    printf(\"error\");\n  }\n\n  else {\n    int i = 0, p = 0, q = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      q++;\n      if (a[i] == b[i]) {\n        p++;\n      }\n    }\n    double c = (double)p / q;\n    if (c > n) {\n      cout << \"yes\";\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, l, max, s, f;\n  float a, b;\n  char ch1[600], ch2[600];\n\n  scanf(\"%f\", &a);\n  scanf(\"%s\", ch1);\n  scanf(\"%s\", ch2);\n  m = strlen(ch1);\n  n = strlen(ch2);\n\n  f = 1;\n  if (m != n)\n    f = 0;\n  max = 0;\n\n  if (f)\n    for (i = 0; i < m; i++) {\n      if (((ch1[i] == 'A') || (ch1[i] == 'T') || (ch1[i] == 'C') ||\n           (ch1[i] == 'G')) &&\n          ((ch2[i] == 'A') || (ch2[i] == 'T') || (ch2[i] == 'C') ||\n           (ch2[i] == 'G'))) {\n        if (ch1[i] == ch2[i])\n          max++;\n      } else {\n        f = 0;\n        break;\n      }\n    }\n\n  if (f) {\n    b = (float)max / n;\n    if (b > a)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuanshi[500], bijiao[500], laji[3];\n  double cankao, shiji;\n  int jishu = 0, i, m, n, panduan = 0;\n  scanf(\"%lf\", &cankao);\n\n  scanf(\"%s \", laji);\n\n  cin >> yuanshi;\n\n  scanf(\"%s \", bijiao);\n  m = strlen(yuanshi);\n  n = strlen(bijiao);\n  for (i = 0; i < m; i++) {\n    if (yuanshi[i] == bijiao[i])\n      jishu++;\n    if (yuanshi[i] != 'A' && yuanshi[i] != 'T' && yuanshi[i] != 'G' &&\n        yuanshi[i] != 'C' && yuanshi[i] != '\u0000')\n      panduan++;\n    if (bijiao[i] != 'A' && bijiao[i] != 'T' && bijiao[i] != 'G' &&\n        bijiao[i] != 'C' && bijiao[i] != '\u0000')\n      panduan++;\n  }\n  if (m != n || panduan != 0) {\n\n    printf(\"error\");\n  } else if (m == n && panduan == 0) {\n    shiji = jishu * 1.0 / m;\n    if (shiji > cankao)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  char s[501];\n  char t[501];\n  int m, n, i, k = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &t);\n  m = strlen(s);\n  n = strlen(t);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') ||\n          (t[i] != 'A' && t[i] != 'G' && t[i] != 'C' && t[i] != 'T')) {\n        k = -1;\n        break;\n      } else if (s[i] == t[i]) {\n        k++;\n      }\n    }\n    if (k == -1) {\n      printf(\"error\");\n    } else if ((1.0 * k / n) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, i;\n  double a, e, f;\n  char n[501], m[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", n);\n  scanf(\"%s\", m);\n  b = strlen(n);\n  c = strlen(m);\n  d = 0;\n  if (b != c) {\n    d++;\n  }\n  for (i = 0; i < b; i++) {\n    if ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G') ||\n        (m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) {\n      d++;\n    }\n  }\n  if (d != 0) {\n    printf(\"error\");\n  } else {\n    e = 0;\n    for (i = 0; i < b; i++) {\n      if (n[i] == m[i]) {\n        e++;\n      }\n    }\n    f = e / b;\n    if (f > a) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k = 0, j;\n  double x, num = 0, len;\n  char c[1];\n  char a[500], b[500];\n\n  cin >> c;\n  x = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      cout << \"error\";\n      k = 1;\n      break;\n    } else {\n      if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n        cout << \"error\";\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k != 1) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n    } else {\n      for (k = 0; k < strlen(a); k++) {\n        if (a[k] == b[k]) {\n          num = num + 1;\n        }\n      }\n      j = strlen(a);\n      len = 1.00 * j;\n      if ((num / len) <= x) {\n        printf(\"no\");\n      } else {\n        if ((num / len) > x)\n          printf(\"yes\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, i, t = 0, s, d = 1;\n  double b, x = 0.0;\n  char a[501], c[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  s = strlen(c);\n  if (l == s) {\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n        d = 0;\n        break;\n      } else if (a[i] == c[i])\n        t++;\n      else\n        t = t;\n    }\n    if (d != 0) {\n      x = 1.0 * t / l;\n      if (x >= b)\n        printf(\"yes\\n\");\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, lem, len, q;\n  double p, l;\n  char m[501], n[501];\n  cin >> p;\n  scanf(\"%s\\n\", m);\n  scanf(\"%s\", n);\n  lem = strlen(m);\n  len = strlen(n);\n  if (lem != len) {\n    printf(\"error\");\n    return 0;\n  } else\n    q = len;\n  int r = 0;\n  for (i = 0; i < q; i++) {\n    if (((m[i] != 'A') && (m[i] != 'T') && (m[i] != 'C') && (m[i] != 'G')) ||\n        ((n[i] != 'A') && (n[i] != 'T') && (n[i] != 'C') && (n[i] != 'G'))) {\n      printf(\"error\");\n      break;\n    } else if (m[i] == n[i]) {\n      r++;\n    }\n  }\n  if (i == q) {\n    l = 1.0 * r / q;\n    if (l >= p)\n      printf(\"yes\");\n    else if (l < p) {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int n, i, j;\n  double r, m = 0, l = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else if (strlen(a) == strlen(b)) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n  }\n  l = strlen(a);\n  if (m / l > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, a1, a2, w;\n  char DNA1[501], DNA2[501];\n  double n, q;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &DNA1);\n  scanf(\"%s\", &DNA2);\n  a1 = strlen(DNA1);\n  a2 = strlen(DNA2);\n  k = 0;\n  w = 1;\n  if (a1 == a2) {\n    for (i = 0; i < a1; i++) {\n      if ((DNA1[i] != 'A' && DNA1[i] != 'G' && DNA1[i] != 'C' &&\n           DNA1[i] != 'T') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'G' && DNA2[i] != 'C' &&\n           DNA2[i] != 'T')) {\n        w *= 0;\n      } else {\n        if (DNA1[i] == DNA2[i]) {\n          k++;\n        }\n      }\n      w *= 1;\n    }\n    q = k * 1.0 / a1;\n    if (w == 0)\n      printf(\"error\");\n    else {\n      if (q > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  } else\n    printf(\"error\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  int i, j, k, kong = 1;\n  float n, t = 0, l1, l2;\n  scanf(\"%f\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      j = a[i];\n      k = b[i];\n      if ((j != 'A' && j != 'T' && j != 'G' && j != 'C') ||\n          (k != 'A' && k != 'T' && k != 'G' && k != 'C')) {\n        printf(\"error\");\n        kong = 0;\n        break;\n      }\n    }\n    if (kong == 1) {\n      for (i = 0; i < l1; i++) {\n\n        if (a[i] == b[i]) {\n          t = t + 1;\n        }\n      }\n\n      if (t / l1 > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9335", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a, rate;\n  int i, lena, lenb, sum = 0;\n  scanf(\"%f\", &a);\n  char an[501], bn[501];\n  cin >> an;\n  cin >> bn;\n  lena = strlen(an);\n  lenb = strlen(bn);\n  if (lena != lenb) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < lena; i++) {\n    if ((an[i] != 'A' && an[i] != 'T' && an[i] != 'C' && an[i] != 'G') ||\n        (bn[i] != 'A' && bn[i] != 'T' && bn[i] != 'C' && bn[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    if (an[i] == bn[i])\n      sum += 1;\n  }\n  rate = 1.0 * sum / lena;\n  if (rate > a)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, j, c, b;\n  double n;\n  char sz1[1000], sz2[1000];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  for (i = 0; sz1[i] != '\\0'; i++)\n    c = i;\n\n  for (j = 0; sz2[j] != '\\0'; j++) {\n    b = j;\n  }\n  if (c != b) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; sz1[i] != '\\0'; i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'C' && sz1[i] != 'G' && sz1[i] != 'T') ||\n          (sz2[i] != 'C' && sz2[i] != 'A' && sz2[i] != 'G' && sz2[i] != 'T')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (j = 0; sz1[j] != '\\0'; j++) {\n      if (sz1[j] == sz2[j] &&\n          (sz1[j] == 'A' || sz1[j] == 'C' || sz1[j] == 'G' || sz1[j] == 'T') &&\n          (sz2[j] == 'C' || sz2[j] == 'A' || sz2[j] == 'G' || sz2[j] == 'T')) {\n        a++;\n      }\n    }\n  }\n  if (1.0 * a / (c + 1) > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9337", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, l1, l2, l;\n  double t, c;\n  char a[500];\n  char b[500];\n  scanf(\"%lf\", &t);\n  cin >> a >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  l = l1;\n  for (i = 0; i < l; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if ((b[i] != 'A') && (b[i] != 'T') && (b[i] != 'C') && (b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (n = 0, i = 0; i < l; i++) {\n    if (a[i] == b[i]) {\n      n++;\n    }\n  }\n  c = 1.0 * n / l;\n\n  if (c > t)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, num = 0, len1, len2, pos = 0, lea;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s\", a);\n  cin >> b;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2)\n    printf(\"error\");\n  else {\n    for (k = 0; a[k] != '\\0'; k++) {\n      if (a[k] != 'A' && a[k] != 'T' && a[k] != 'C' && a[k] != 'G') {\n        pos = 0;\n        break;\n      } else if (b[k] != 'A' && b[k] != 'T' && b[k] != 'C' && b[k] != 'G') {\n        pos = 0;\n        break;\n      } else {\n        pos = 1;\n        if (a[k] == b[k]) {\n          num++;\n        }\n      }\n    }\n    if (pos == 1) {\n      if (1.0 * num / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n\n    else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int biao = 0, i, d, c = 0, a1 = 0;\n  double v, w;\n  char a[505], b[505];\n  scanf(\"%lf\", &v);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    biao = 1;\n    printf(\"error\");\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (!((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n            (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))) {\n        biao = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        a1++;\n    }\n    w = 1.0 * a1 / c * 1.0;\n    if (w >= v)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int s = 0, len1, len2, i;\n  char b[501], c[501], e[501];\n  scanf(\"%lf\", &n);\n\n  cin >> b;\n\n  cin >> c;\n\n  cin >> e;\n  len1 = strlen(c);\n  len2 = strlen(e);\n  for (i = 0; i < len1; i++) {\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'C' && c[i] != 'G') {\n      len1 = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if (e[i] != 'A' && e[i] != 'T' && e[i] != 'C' && e[i] != 'G') {\n      len2 = 2;\n      break;\n    }\n  }\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (c[i] == e[i]) {\n        s++;\n      }\n    }\n    if (1.0 * s / len1 >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, k, num = 0, flag = 0;\n  double l;\n  char a[501], b[501], s[10];\n\n  cin >> s;\n  k = atoi(s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if ((a[i] != 'A') && (a[i] != 'T') && (a[i] != 'C') && (a[i] != 'G')) {\n      flag = 1;\n      break;\n    }\n  }\n  if ((n == m) && (flag == 0)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == b[i]) {\n        num++;\n      }\n    }\n    l = (double)num / n;\n    if (l > k)\n      cout << \"yes\";\n    else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n = 0, k = 0;\n  double m;\n  scanf(\"%lf\", &m);\n  char a[100];\n  char b[100];\n  scanf(\"%s\\n%s\", a, b);\n  int l = strlen(a), t = strlen(b);\n  for (i = 0; i < l; i++) {\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T')\n      k++;\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')\n      k++;\n  }\n  if (k > 0) {\n    printf(\"error\");\n    return 0;\n  }\n\n  if (l == t) {\n    for (i = 0; i <= l; i++) {\n\n      if (a[i] == b[i])\n        n++;\n    }\n    if ((1.00 * n / l) > m)\n      printf(\"yes\");\n\n    else\n      printf(\"no\");\n\n  }\n\n  else\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int i;\n  scanf(\"%lf\", &n);\n  char sza[600], szb[600];\n  cin >> sza;\n  scanf(\"%s\", szb);\n  int a = 0;\n  int b = strlen(sza);\n  int c = strlen(szb);\n  for (i = 0; i < b; i++) {\n    if (sza[i] != 'A' && sza[i] != 'T' && sza[i] != 'C' && sza[i] != 'G') {\n      a = 1;\n    }\n    if (szb[i] != 'A' && szb[i] != 'T' && szb[i] != 'C' && szb[i] != 'G') {\n      a = 1;\n    }\n    if (b != c) {\n      a = 1;\n    }\n  }\n  double d = 0;\n  double e;\n  if (a == 1) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < b; i++) {\n      if (sza[i] == szb[i]) {\n        d++;\n      }\n    }\n    e = d / b;\n    if (e > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint judge(char c)\n\n{\n\n  return (!(c == 'A' || c == 'T' || c == 'C' || c == 'G'));\n}\n\nint main()\n\n{\n\n  double n;\n\n  int icount = 0;\n\n  int flag = 0;\n\n  char s[600], t[600];\n\n  scanf(\"%lf%s%s\", &n, s, t);\n\n  int len1 = strlen(s), len2 = strlen(t);\n\n  if (len1 != len2)\n\n    printf(\"error\\n\");\n\n  else\n\n  {\n\n    for (int i = 0; i < len1; ++i)\n\n    {\n\n      if (s[i] == t[i])\n        icount++;\n\n      if (judge(s[i]) || judge(t[i])) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag)\n\n      cout << \"error\\n\";\n\n    else\n\n    {\n\n      if (1.0 * icount / len1 >= n)\n        printf(\"yes\\n\");\n\n      else\n        printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, e1, e2, t;\n  t = 1;\n  k = 0;\n  double bl1, bl2;\n  char jy1[501], jy2[501];\n  scanf(\"%lf\", &bl1);\n  cin >> jy1 >> jy2;\n  e1 = strlen(jy1);\n  e2 = strlen(jy2);\n  if (e1 != e2) {\n    t = 0;\n  } else {\n    for (i = 0; i < e1; i++) {\n      if ((jy1[i] != 'A' && jy1[i] != 'T' && jy1[i] != 'C' && jy1[i] != 'G') ||\n          (jy2[i] != 'A' && jy2[i] != 'T' && jy2[i] != 'C' && jy2[i] != 'G')) {\n        t = 0;\n        break;\n      } else {\n        if (jy1[i] == jy2[i]) {\n          k = k + 1;\n        }\n      }\n    }\n  }\n  bl2 = 1.0 * k / e1;\n  if (t == 0) {\n    cout << \"error\";\n  } else {\n    if (bl2 > bl1) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double n, c = 0, d, l, k;\n  int i, h = 0;\n\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", a, b);\n  l = strlen(a);\n  k = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    if (k != l || a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n\n      printf(\"error\");\n      h = 1;\n      break;\n    } else if (a[i] == b[i])\n      c = c + 1;\n  }\n  d = c / l;\n  if (d > n)\n    printf(\"yes\");\n  else if (h == 0 && d <= n)\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, m;\n  double n, x;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  for (i = 0; dna1[i] != '\\0'; i++) {\n    if (dna1[i] != 65 && dna1[i] != 67 && dna1[i] != 71 && dna1[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; dna2[i] != '\\0'; i++) {\n    if (dna2[i] != 65 && dna2[i] != 67 && dna2[i] != 71 && dna2[i] != 84) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n  } else {\n    m = strlen(dna1);\n    for (i = 0; dna1[i] != '\\0'; i++) {\n      if (dna1[i] == dna2[i]) {\n        a++;\n      }\n    }\n    x = a * 1.0 / (1.0 * m);\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, l, n;\n  double d, b;\n  char x[501];\n  char y[501];\n\n  a = 0;\n  l = 0;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  n = strlen(x);\n\n  if (strlen(x) != strlen(y)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'G' && x[i] != 'C') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'G' && y[i] != 'C')) {\n        printf(\"error\");\n        a = 1;\n        break;\n      } else {\n        if (x[i] == y[i]) {\n          l++;\n        }\n      }\n    }\n\n    if (a == 0) {\n      b = (double)l / (double)n;\n\n      if (b >= d) {\n        printf(\"yes\");\n      } else if (b < d) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9349", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  char qian[501];\n  char hou[501];\n  cin >> qian >> hou;\n\n  int i, s = 0;\n  if (strlen(qian) != strlen(hou)) {\n    s = 1;\n  }\n  int m = 0;\n  for (i = 0; i < strlen(qian); i++) {\n    if ((qian[i] != 'A' && qian[i] != 'T' && qian[i] != 'G' &&\n         qian[i] != 'C') ||\n        (hou[i] != 'A' && hou[i] != 'T' && hou[i] != 'G' && hou[i] != 'C')) {\n      s = 1;\n    }\n  }\n  if (s == 1) {\n    printf(\"error\");\n  } else {\n    if (s == 0) {\n      for (i = 0; i < strlen(qian); i++) {\n        if (qian[i] == hou[i]) {\n          m++;\n        }\n      }\n      if (1.0 * m / strlen(qian) > k) {\n        printf(\"yes\");\n      } else {\n        if (1.0 * m / strlen(qian) <= k) {\n          printf(\"no\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, i, c;\n  double n, m;\n  c = 0;\n  char f[500], s[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", f);\n  scanf(\"%s\", s);\n  l1 = strlen(f);\n  l2 = strlen(s);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (f[i] != 'A' && f[i] != 'G' && f[i] != 'C' && f[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < l2; i++) {\n    if (s[i] == f[i])\n      c++;\n  }\n\n  m = 1.0 * c / l1;\n  if (m >= n)\n    printf(\"yes\");\n  if (m < n)\n    cout << \"no\";\n  return 0;\n}\n"}
{"label": "5", "index": "9351", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  float x;\n  char m[501], n[501];\n  scanf(\"%f\", &x);\n  cin >> m;\n  scanf(\"%s\", n);\n  if (strlen(m) != strlen(n)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; n[i]; i++) {\n    if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G' ||\n        (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (m[i] == n[i])\n      j++;\n  }\n  if (1.0 * j / i > x)\n    printf(\"yes\");\n  if (1.0 * j / i < x)\n    printf(\"no\");\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, q, n, i, m, l;\n  double p, k;\n  char sz[500], dz[500];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", sz);\n  scanf(\"%s\", dz);\n  m = 0;\n  y = 0;\n  n = 0;\n  l = 0;\n  n = strlen(sz);\n  q = 0;\n  m = strlen(dz);\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n; i++) {\n      if (sz[i] != 'A' && sz[i] != 'T' && sz[i] != 'C' && sz[i] != 'G') {\n        y++;\n        printf(\"error\");\n        break;\n      }\n      if (dz[i] != 'A' && dz[i] != 'T' && dz[i] != 'C' && dz[i] != 'G') {\n        l++;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (l == 0 && y == 0) {\n      for (i = 0; i < n; i++) {\n        if (sz[i] == dz[i]) {\n          q++;\n        }\n      }\n      k = 1.0 * q / n;\n      if (k > p) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n, m = 0;\n  char dna1[1000 + 1], dna2[1000 + 1];\n  int len1 = 0, len2 = 0, count = 0, i = 0;\n  cin >> n >> dna1 >> dna2;\n  len1 = strlen(dna1);\n  len2 = strlen(dna2);\n\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  if (len1 == len2) {\n    for (i = 0; i < len1 - 1; i++) {\n      if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n           dna1[i] != 'G') ||\n          (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' &&\n           dna2[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else if (dna1[i] != dna2[i]) {\n        count++;\n      }\n    }\n\n    m = (double)count / len1;\n\n    if ((1 - m) >= n) {\n      printf(\"yes\");\n    }\n    if ((1 - m) < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a, bl;\n  int n1, n2, i, k = 0, sum = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", dna1, dna2);\n  n1 = strlen(dna1);\n  n2 = strlen(dna2);\n  if (n1 != n2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < n1; i++) {\n      if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n          dna1[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n          dna2[i] != 'T') {\n        k = 1;\n        break;\n      }\n      if (dna1[i] == dna2[i]) {\n        sum++;\n      }\n    }\n    if (k == 0) {\n      bl = (double)sum / n1;\n      if (bl > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, r;\n  int i, a, b, c, d, e = 0;\n  char q[501];\n  char w[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", q, w);\n  a = strlen(q);\n  b = strlen(w);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    c = a, d = b;\n    for (i = 0; i < a; i++) {\n      if (q[i] != 'A' && q[i] != 'C' && q[i] != 'G' && q[i] != 'T') {\n        c--;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (w[i] != 'A' && w[i] != 'C' && w[i] != 'G' && w[i] != 'T')\n        d--;\n    }\n    if (a != c || b != d) {\n      printf(\"error\");\n    } else {\n      for (i = 0; i < a; i++) {\n        if (q[i] == w[i]) {\n          e++;\n        }\n      }\n      r = 1.0 * e / a;\n      if (r >= n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, m, d = 0, b = 1;\n  char zf[501] = {0}, zc[501] = {0};\n  double a, e;\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", zf);\n  cin >> zc;\n  l = strlen(zf);\n  m = strlen(zc);\n  if (l != m) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l; i++) {\n      if (zf[i] != 'A' && zf[i] != 'T' && zf[i] != 'C' && zf[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n      if (zc[i] != 'A' && zc[i] != 'T' && zc[i] != 'C' && zc[i] != 'G') {\n        printf(\"error\");\n        b = 0;\n        break;\n      }\n    }\n    if (b == 1) {\n      for (i = 0; i < l; i++) {\n        if (zf[i] == zc[i]) {\n          d++;\n        }\n      }\n      e = 1.0 * d / l;\n      if (e > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9357", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint judge(char *a, char *b, double r) {\n  int n = strlen(a), m = strlen(b), i, s = 0;\n  if (n != m)\n    return 0;\n  for (i = 0; i < n; ++i) {\n    if (!strchr(\"ATCG\", a[i]) || !strchr(\"ATCG\", b[i]))\n      return 0;\n    if (a[i] == b[i])\n      ++s;\n  }\n  if (s / (double)n > r)\n    return 1;\n  else\n    return -1;\n}\n\nint main() {\n  char a[600], b[600];\n  double r;\n  int s;\n  scanf(\"%lf \", &r);\n\n  cin >> a;\n\n  cin >> b;\n  s = judge(a, b, r);\n  if (s > 0)\n    puts(\"yes\");\n  else if (s < 0)\n    puts(\"no\");\n  else\n    puts(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double m, n;\n  int len1, len2, count = 0, i;\n  char s1[100], s2[100];\n  scanf(\"%lf\", &m);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  if (len1 == len2) {\n    for (i = 0; i < len1; i++) {\n      if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' ||\n          s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'C' && s2[i] != 'G') {\n        count = len1 + 1;\n        break;\n      }\n      if (s1[i] == s2[i])\n        count++;\n    }\n    n = 1.0 * count / len1;\n    if (count >= len1 + 1)\n      printf(\"error\\n\");\n    if (n > m && n <= 1)\n      printf(\"yes\\n\");\n    else if (n <= m)\n      printf(\"no\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9359", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k = 0, len1, len2, temp = 0;\n  char str1[600], str2[600];\n  double p;\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", str1, str2);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((str1[i] != 'A' && str1[i] != 'T' && str1[i] != 'C' &&\n           str1[i] != 'G') ||\n          (str2[i] != 'A' && str2[i] != 'T' && str2[i] != 'C' &&\n           str2[i] != 'G')) {\n        printf(\"error\");\n        temp = 1;\n        break;\n      }\n      if (str1[i] == str2[i]) {\n        k++;\n      }\n    }\n    if (temp == 0) {\n\n      if (k * 1.0 / len1 > p) {\n        printf(\"yes\");\n      } else if (k * 1.0 / len1 <= p) {\n        printf(\"no\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, j = 0;\n  double x, y, z;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  y = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n      break;\n    }\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n    if (a[i + 1] == '\\0') {\n      z = j / y;\n      if (z > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, t = 0, j, h = 0, k = 0, m = 0;\n  char b[2][500];\n  double n;\n  cin >> n;\n  for (j = 0; j < 2; j++) {\n    scanf(\"%s\", b[j]);\n  }\n  for (j = 0; b[0][j] != '\\0'; j++) {\n    h++;\n  }\n  for (j = 0; b[1][j] != '\\0'; j++)\n    k++;\n\n  for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n    if ((b[0][j] != 'A' && b[0][j] != 'T' && b[0][j] != 'C' &&\n         b[0][j] != 'G') ||\n        (b[1][j] != 'T' && b[1][j] != 'G' && b[1][j] != 'C' &&\n         b[1][j] != 'A')) {\n      printf(\"error\");\n      m = 1;\n      break;\n    }\n  }\n  if (m == 0) {\n    if (h != k) {\n      printf(\"error\");\n    }\n\n    else {\n      for (j = 0; (b[0][j] != '\\0') && (b[1][j] != '\\0'); j++) {\n        t++;\n        if (b[0][j] == b[1][j]) {\n          i++;\n        }\n      }\n      if ((1.0 * i / t) <= n) {\n        printf(\"no\");\n      } else {\n        cout << \"yes\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500];\n  double x;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int m, i, same = 0;\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      same = -1;\n    } else if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double y;\n  y = (double)same / m;\n  if (y > x && same != -1) {\n    printf(\"yes\");\n  } else if (y <= x && same != -1) {\n    printf(\"no\");\n  } else if (same = -1) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double bi, p;\n  int len1, len2, i, flag, s = 0;\n  char zfc[2][501];\n  scanf(\"%lf\", &bi);\n  for (i = 0; i < 2; i++) {\n    cin >> zfc[i];\n  }\n  len1 = strlen(zfc[0]);\n  len2 = strlen(zfc[1]);\n  if (len1 != len2) {\n    flag = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'G' &&\n           zfc[0][i] != 'C') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'G' &&\n           zfc[1][i] != 'C')) {\n        flag = 1;\n      }\n\n      else {\n        flag = 0;\n      }\n    }\n  }\n  if (flag == 1) {\n    cout << \"error\";\n  } else if (flag == 0) {\n    for (i = 0; i < len1; i++) {\n      if (zfc[0][i] == zfc[1][i]) {\n        s = s + 1;\n      } else {\n        s = s;\n      }\n    }\n    p = s * 1.0 / len1;\n    if (p > bi) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double r, k = 0, p;\n  int i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\\n\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G' &&\n         s[i] != 'A') ||\n        (s1[i] != 'T' && s1[i] != 'C' && s1[i] != 'G' && s1[i] != 'A')) {\n      printf(\"error\");\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    p = 1.0 * k / strlen(s);\n    if (p > r) {\n      cout << \"yes\";\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9365", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double xgl, e;\n  char a[501], b[501];\n  double cd1, cd2;\n  int i;\n  double js = 0;\n\n  scanf(\"%lf\", &xgl);\n  scanf(\"%s %s\", a, b);\n\n  cd1 = strlen(a);\n  cd2 = strlen(b);\n\n  if (cd1 != cd2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < cd1; i++) {\n    if ((a[i] == 'A' && b[i] == 'A') || (a[i] == 'T' && b[i] == 'T') ||\n        (a[i] == 'C' && b[i] == 'C') || (a[i] == 'G' && b[i] == 'G')) {\n      js++;\n    } else if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n               (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  e = js / cd1;\n  if (e > xgl) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int r, t, n, q, e, i;\n  double m, w;\n  n = 0;\n  r = 0;\n  scanf(\"%lf %s %s\", &m, a, b);\n  q = strlen(a);\n  e = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      r++;\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      r++;\n    }\n  }\n  if (q != e || r != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      t = a[i] - b[i];\n      if (t == 0) {\n        n++;\n      }\n    }\n    w = 1.0 * n / q;\n    if (w > m) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int biao = 0, i, j, n, l, d, c = 0, a1 = 0, a2;\n  double v, w;\n  char a[505], b[505];\n  scanf(\"%lf\", &v);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d) {\n    biao = 1;\n    printf(\"error\");\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (!((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n            (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G'))) {\n        biao = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n  }\n  if (biao == 0) {\n    for (i = 0; i < c; i++) {\n      if (a[i] == b[i])\n        a1++;\n    }\n    w = 1.0 * a1 / c * 1.0;\n    if (w >= v)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, c = 0;\n  double n, x = 0, y = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", a);\n\n  scanf(\"%s\", b);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      c = 1;\n      break;\n    } else {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y++;\n  }\n  if (c == 0) {\n    if (b[i] != '\\0') {\n      cout << \"error\";\n      c = 1;\n    }\n  }\n\n  if (c == 0) {\n    if ((x / y) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(char x, char y) {\n  if (x == y)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  double r, x;\n  cin >> r;\n  char str1[1000], str2[1000];\n  scanf(\"%s\\n\", str1);\n  scanf(\"%s\", str2);\n  int len1, len2;\n  int i, count = 0;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if ((str1[i] != 'A' && str1[i] != 'C' && str1[i] != 'G' &&\n         str1[i] != 'T') ||\n        (str2[i] != 'A' && str2[i] != 'C' && str2[i] != 'G' &&\n         str2[i] != 'T')) {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; str1[i] != 0; i++) {\n    if (f(str1[i], str2[i]) == 1) {\n      count++;\n    }\n  }\n  x = 1.0 * count / len1;\n  if (x > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, lena, lenb, i, c;\n  char yi[501], er[501];\n  double rate, a;\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", yi, er);\n  lena = strlen(yi);\n  lenb = strlen(er);\n  if (lenb != lena) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (yi[i] == 0) {\n        break;\n      } else if (yi[i] >= 'A' && yi[i] <= 'Z' && er[i] >= 'A' && er[i <= 'Z']) {\n        if (yi[i] == er[i]) {\n          sum++;\n        } else\n          continue;\n\n      } else {\n        c = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    rate = sum * 1.0 / lena;\n    if (c != 1) {\n      if (rate > a) {\n        printf(\"yes\");\n      } else if (rate <= a) {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  int k = 0, i, q = 1;\n  char s[600], s1[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", s);\n  scanf(\"%s\", s1);\n  if (strlen(s) != strlen(s1))\n    q = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'C' && s[i] != 'T' && s[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] != 'A' && s1[i] != 'C' && s1[i] != 'T' && s1[i] != 'G') {\n      q = 0;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == s1[i])\n        k++;\n    }\n    if (1.0 * k / strlen(s) > r) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  if (q == 0)\n    printf(\"error\");\n  return 0;\n}\n"}
{"label": "5", "index": "9372", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int l1, l2, i, count = 0;\n  double rate;\n  char str1[1000], str2[1000];\n  scanf(\"%lf \", &rate);\n  scanf(\"%s %s\", str1, str2);\n  l1 = strlen(str1);\n  l2 = strlen(str2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (str1[i] == str2[i]) {\n      count++;\n    }\n    if (((str1[i] != 'A') && (str1[i] != 'C') && (str1[i] != 'G') &&\n         (str1[i] != 'T')) ||\n        ((str2[i] != 'A') && (str2[i] != 'C') && (str2[i] != 'G') &&\n         (str2[i] != 'T'))) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.00 * count / l1) >= rate) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double bi, p;\n  int len1, len2, i, flag, s = 0;\n  char zfc[2][501];\n  scanf(\"%lf\", &bi);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", zfc[i]);\n  }\n  len1 = strlen(zfc[0]);\n  len2 = strlen(zfc[1]);\n  if (len1 != len2) {\n    flag = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((zfc[0][i] != 'A' && zfc[0][i] != 'T' && zfc[0][i] != 'G' &&\n           zfc[0][i] != 'C') ||\n          (zfc[1][i] != 'A' && zfc[1][i] != 'T' && zfc[1][i] != 'G' &&\n           zfc[1][i] != 'C')) {\n        flag = 1;\n      }\n\n      else {\n        flag = 0;\n      }\n    }\n  }\n  if (flag == 1) {\n    printf(\"error\");\n  } else if (flag == 0) {\n    for (i = 0; i < len1; i++) {\n      if (zfc[0][i] == zfc[1][i]) {\n        s = s + 1;\n      } else {\n        s = s;\n      }\n    }\n    p = s * 1.0 / len1;\n    if (p > bi) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double m, n = 0;\n  char a[500], b[500], *pa, *pb;\n  scanf(\"%lf%s%s\", &m, a, b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\\n\");\n  } else {\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if (*pa == *pb) {\n        n++;\n      }\n    }\n    n = n / strlen(a);\n    for (pa = a, pb = b; *pa != '\\0'; pa++, pb++) {\n      if ((*pa != 'A' && *pa != 'T' && *pa != 'G' && *pa != 'C') ||\n          (*pb != 'A' && *pb != 'T' && *pb != 'G' && *pb != 'C')) {\n        printf(\"error\\n\");\n        break;\n      } else if (*(pa + 1) == '\\0' && n > m) {\n        printf(\"yes\\n\");\n      } else {\n        if (*(pa + 1) == '\\0' && n <= m) {\n          printf(\"no\\n\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m = 0, k = 1;\n  char a[501], b[501];\n  double x, y;\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n        cout << \"error\";\n        k = 0;\n        break;\n      } else if (a[i] == b[i]) {\n        m++;\n      }\n    }\n    if (k) {\n      y = 1.0 * m / strlen(a);\n      if (y > x) {\n        printf(\"yes\");\n      } else if (y < x || y == x) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, len1, len2, i, p = 0;\n  double x, y;\n  char a1[501], a2[501];\n  cin >> x;\n  scanf(\"%s %s\", a1, a2);\n  len1 = strlen(a1);\n  len2 = strlen(a2);\n  if (len1 != len2) {\n    p = 1;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((a1[i] != 'A' && a1[i] != 'T' && a1[i] != 'C' && a1[i] != 'G') ||\n          (a2[i] != 'A' && a2[i] != 'T' && a2[i] != 'C' && a2[i] != 'G')) {\n        p = 1;\n      }\n    }\n  }\n  if (p != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (a1[i] == a2[i])\n        sum++;\n    }\n    y = 1.0 * sum / len1;\n    if (y <= x) {\n      printf(\"no\");\n    } else {\n      cout << \"yes\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0, l1, l2;\n  double n, m;\n  char a[256], b[256];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = 0; i < l1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      s = s + 1;\n    }\n  }\n  if (s != 0 || l1 != l2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        t = t + 1;\n      }\n    }\n    m = (double)t / l1;\n    if (m > n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double r;\n  char a[501], b[501];\n  scanf(\"%lf\", &r);\n  scanf(\"%s%s\", a, b);\n  int s1, s2, y = 1, m = 0;\n  s1 = strlen(a);\n  s2 = strlen(b);\n  if (s1 != s2) {\n    printf(\"error\");\n  } else {\n    for (int i = 0; a[i]; i++) {\n      if ((a[i] == 'A' || a[i] == 'G' || a[i] == 'C' || a[i] == 'T') &&\n          (b[i] == 'A' || b[i] == 'G' || b[i] == 'C' || b[i] == 'T')) {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      } else {\n        printf(\"error\");\n        y = 0;\n        break;\n      }\n    }\n    if (m * 1.0 / s1 > r && y == 1) {\n      printf(\"yes\");\n    } else if (y == 1) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 1, b = 1;\n  double n, p = 0.0, q;\n  char d1[500], d2[500];\n  cin >> n >> d1 >> d2;\n\n  if (strlen(d1) != strlen(d2)) {\n    a = 0;\n  }\n  if (a == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n          (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G')) {\n        b = 1;\n      } else {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (a == 0 || b == 0) {\n    printf(\"error\");\n  }\n\n  if (a == 1 && b == 1) {\n    for (i = 0; d1[i] != '\\0'; i++) {\n      if (d1[i] == d2[i]) {\n        p += 1.0;\n      }\n    }\n    q = p / (strlen(d1));\n    if (q > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  int flag, i, x = 0;\n  char d1[501], d2[501];\n  scanf(\"%s %s\", d1, d2);\n  for (i = 0; i < (strlen(d1) - 1) && i < (strlen(d2) - 1); i++) {\n    if ((d1[i] == 'A' || d1[i] == 'T' || d1[i] == 'C' || d1[i] == 'G') &&\n        (d2[i] == 'A' || d2[i] == 'T' || d2[i] == 'C' || d2[i] == 'G'))\n      flag = 1;\n    else {\n      flag = 0;\n      break;\n    }\n  }\n  if (strlen(d1) != strlen(d2) || flag == 0) {\n    cout << \"error\";\n    return 0;\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] == d2[i])\n        x++;\n    }\n  }\n  if (1.0 * x / (strlen(d1) - 1) > k)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double x, z = 0, n = 0, m = 0;\n  int y = 0;\n  int i;\n  char a[501], b[501];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\\n%s\", a, b);\n  for (i = 0; a[i]; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; b[i]; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n      y++;\n    }\n  }\n  for (i = 0; a[i]; i++) {\n    n++;\n  }\n  for (i = 0; b[i]; i++) {\n    m++;\n  }\n  if (m != n) {\n    y++;\n  }\n  if (y != 0) {\n    printf(\"error\");\n  } else {\n    for (i = 0; a[i]; i++) {\n      if (a[i] == b[i]) {\n        z++;\n      }\n    }\n    if (z / n > x) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double bl, jl;\n  scanf(\"%lf\", &bl);\n  char dna1[501], dna2[501];\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  int i, k = 0, l, n = 0;\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' &&\n         dna1[i] != 'T') ||\n        (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' &&\n         dna2[i] != 'T')) {\n      k++;\n    }\n  }\n  if (k > 0) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < l; i++) {\n      if (dna1[i] == dna2[i]) {\n        n++;\n      }\n    }\n    jl = 1.0 * n / (l - 1);\n    if (jl > bl) {\n      printf(\"yes\\n\");\n    } else {\n      printf(\"no\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k1, k2, q, i, w, sum = 0;\n  double n, r;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", dna1, dna2);\n  k1 = strlen(dna1);\n  k2 = strlen(dna2);\n  if (k1 != k2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < k1; i++) {\n      q = dna1[i];\n      w = dna2[i];\n      if ((q == 65 || q == 84 || q == 67 || q == 71) &&\n          (w == 65 || w == 84 || w == 67 || w == 71)) {\n        if (q == w)\n          sum++;\n\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  r = 1.0 * sum / k1;\n  if (r > n) {\n    printf(\"yes\");\n  } else\n    cout << \"no\";\n\n  return 0;\n}\n"}
{"label": "5", "index": "9384", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double b;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &b);\n  cin >> dna1;\n  scanf(\"%s\", dna2);\n  int d = 0, i, p = 0, m = strlen(dna1), l = strlen(dna2);\n  for (i = 0; dna1[i] || dna2[i]; i++) {\n    if (m != l) {\n      d = 1;\n      break;\n    }\n    if (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' && dna1[i] != 'G') {\n      d = 2;\n      break;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'T' && dna2[i] != 'C' && dna2[i] != 'G') {\n      d = 3;\n      break;\n    }\n    if (dna1[i] != dna2[i]) {\n      p++;\n    }\n  }\n  double q = 1 - p / m;\n  if (d != 0)\n    printf(\"error\");\n\n  if (q > b && d == 0)\n    printf(\"yes\");\n  else if (d == 0 && q <= b) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int n, i, j;\n  double r, m = 0, l = 0;\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else if (strlen(a) == strlen(b)) {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n    }\n  }\n  l = strlen(a);\n  if (m / l > r) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, d, l, h;\n  double n, t;\n  char a[500], b[500];\n  scanf(\"%lf \", &n);\n  d = 0;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(a);\n  h = strlen(b);\n  if (l > h || l < n) {\n    printf(\"error\");\n  } else if (l == h) {\n    for (i = 0, j = 0; a[i] != '\u0000'; i++, j++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (a[i] == b[j]) {\n          d++;\n        }\n\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    t = (double)d / l;\n    if (t > n) {\n      printf(\"yes\");\n    } else if (t <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x[600], y[600];\n  int b = 0, i;\n  double a;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", x);\n  cin >> y;\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 600; i++) {\n    if (x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 0) {\n      cout << \"error\";\n      return 0;\n    }\n    if (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == 0) {\n      break;\n    }\n    if (x[i] == y[i]) {\n      b++;\n    }\n  }\n  if ((1.0 * b / strlen(x)) >= a) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, s = 0, m;\n  scanf(\"%lf\", &n);\n  char a[600], b[600];\n  cin >> a >> b;\n  int l1, l2;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  }\n  if (l1 == l2) {\n    int i, T = 0;\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'G' || b[i] == 'T' || b[i] == 'A' || b[i] == 'C')) {\n        if (a[i] == b[i])\n          s++;\n\n      } else {\n        printf(\"error\");\n        T = 1;\n        break;\n      }\n    }\n    if (T == 0) {\n      m = s / l1;\n      if (m > n)\n        printf(\"yes\");\n\n      if (m <= n) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9389", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  float x;\n  char m[501], n[501];\n  scanf(\"%f\", &x);\n  scanf(\"%s \", m);\n  scanf(\"%s\", n);\n  if (strlen(m) != strlen(n)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; n[i]; i++) {\n    if (m[i] != 'A' && m[i] != 'T' && m[i] != 'C' && m[i] != 'G' ||\n        (n[i] != 'A' && n[i] != 'T' && n[i] != 'C' && n[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (m[i] == n[i])\n      j++;\n  }\n  if (1.0 * j / i > x)\n    printf(\"yes\");\n  if (1.0 * j / i < x)\n    printf(\"no\");\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, s = 0, p, q, j;\n  char s1[501];\n  char s2[501];\n  char string[100];\n  char no[100] = {\"no\"};\n  char y[100] = {\"yes\"};\n  char e[100] = {\"error\"};\n  scanf(\"%lf\\n\", &n);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  p = strlen(s1);\n  q = strlen(s2);\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] == s2[j]) {\n        s = s + 1;\n      }\n    }\n    m = s * 1.0 / p;\n    if (m > n) {\n      strcpy(string, y);\n\n    } else {\n      strcpy(string, no);\n    }\n  } else {\n    strcpy(string, e);\n  }\n\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] != 'A' && s1[j] != 'T' && s1[j] != 'C' && s1[j] != 'G' ||\n          s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'C' && s2[j] != 'G') {\n        strcpy(string, e);\n      }\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "5", "index": "9391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, n = 0;\n  double e;\n  char a[500], b[500];\n  cin >> e >> a >> b;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G' ||\n        b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    } else {\n      if (a[i] == b[i]) {\n        n++;\n      }\n    }\n  }\n  if (1.0 * n / l1 > e)\n    printf(\"yes\");\n  else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9392", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double p;\n  int i, cnt;\n  char s1[505], s2[505];\n  scanf(\"%lf \", &p);\n  cin >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    puts(\"error\");\n    return 0;\n  }\n  for (i = cnt = 0; s1[i]; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s1[i] == s2[i]) {\n      cnt++;\n    }\n  }\n  if (cnt * 1.0 / i > p) {\n    puts(\"yes\");\n  } else\n    puts(\"no\");\n}\n"}
{"label": "5", "index": "9393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char f[501], t[501];\n  int i;\n  double j = 0, r = 0, s = 0;\n  double n;\n  scanf(\"%lf%s%s\", &n, f, t);\n  for (i = 0; f[i] != '\\0'; i++)\n    j++;\n\n  for (i = 0; t[i] != '\\0'; i++) {\n    r++;\n  }\n  if (j != r) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; f[i] != '\\0'; i++) {\n    if (f[i] == t[i])\n      s++;\n  }\n  if (s / j > n)\n    printf(\"yes\");\n\n  if (s / j <= n) {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0;\n  double j;\n  char a[2000], b[2000];\n  cin >> j >> a >> b;\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  } else {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i])\n        m++;\n    }\n    if (1.0 * m / n > j)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9395", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d;\n  double n;\n  char xl1[500], xl2[500];\n  c = 0;\n  scanf(\"%lf\", &n);\n  cin >> xl1 >> xl2;\n  a = strlen(xl1);\n  b = strlen(xl2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'G' && xl1[i] != 'C') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'G' && xl2[i] != 'C')) {\n        printf(\"error\");\n        d = 0;\n        break;\n      } else {\n        if (xl1[i] == xl2[i]) {\n          c++;\n        }\n      }\n    }\n    if (1.0 * c / a > n && d != 0) {\n      printf(\"yes\");\n    } else if (1.0 * c / a <= n && d != 0) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, x, y;\n  double w, sum = 0, p;\n  char a[1000], b[1000];\n  scanf(\"%lf\", &w);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  if (x == y) {\n    for (i = 0; i < x; i++) {\n      if (a[i] == b[i]) {\n        sum++;\n      } else if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n                 (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G')) {\n        printf(\"error\\n\");\n        return 0;\n      }\n    }\n\n  } else if (x != y) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  while (x == y) {\n    p = sum / x;\n    if (p >= w) {\n      printf(\"yes\\n\");\n      break;\n    } else\n      cout << \"no\\n\";\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  double r;\n  char a[600], b[600];\n  scanf(\"%lf\", &r);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  if (strlen(a) != strlen(b)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n        (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n      if (a[i] == b[i]) {\n        s++;\n      }\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (1.0 * s / strlen(a) > r) {\n    printf(\"yes\");\n  } else if (1.0 * s / strlen(a) < r) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double p;\n  int i, cnt;\n  char s1[505], s2[505];\n  cin >> p;\n  cin >> s1 >> s2;\n  if (strlen(s1) != strlen(s2)) {\n    puts(\"error\");\n    return 0;\n  }\n  for (i = cnt = 0; s1[i]; i++) {\n    if (s1[i] != 'A' && s1[i] != 'T' && s1[i] != 'G' && s1[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s2[i] != 'A' && s2[i] != 'T' && s2[i] != 'G' && s2[i] != 'C') {\n      puts(\"error\");\n      return 0;\n    }\n    if (s1[i] == s2[i]) {\n      cnt++;\n    }\n  }\n  if (cnt * 1.0 / i > p) {\n    puts(\"yes\");\n  } else\n    puts(\"no\");\n}\n"}
{"label": "5", "index": "9399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, k, l = 0;\n  k = 0;\n  double d;\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b)) {\n    k = 1;\n    cout << \"error\";\n  }\n  if (strlen(a) == strlen(b)) {\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == b[i])\n        l++;\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k = 1;\n        cout << \"error\";\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    if ((1.0 * l / strlen(a)) >= d)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz1[520] = {'\\0'}, sz2[520] = {'\\0'};\n  double a, j;\n  int i, k, judge = 1;\n  scanf(\"%lf %s %s\", &a, sz1, sz2);\n  if (strlen(sz1) != strlen(sz2)) {\n    printf(\"error\");\n  } else {\n    for (k = 0, i = 0; i < strlen(sz1); i++) {\n      if ((sz1[i] != 'A' && sz1[i] != 'T' && sz1[i] != 'G' && sz1[i] != 'C') ||\n          (sz2[i] != 'A' && sz2[i] != 'T' && sz2[i] != 'G' && sz2[i] != 'C')) {\n        judge = 0;\n        break;\n      } else if (sz1[i] == sz2[i]) {\n        k = k + 1;\n      }\n    }\n\n    j = 1.0 * k / (strlen(sz1));\n    if (judge == 0) {\n      printf(\"error\");\n    } else {\n      if (j > a)\n        printf(\"yes\");\n      else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double a, len, cd, s = 0, b = 0, c;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", &s1, &s2);\n  len = strlen(s1);\n  cd = strlen(s2);\n  if (len != cd) {\n    printf(\"error\");\n  }\n  if (len == cd) {\n    for (i = 0; i < len; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        b++;\n        if (s1[i] == s2[i]) {\n          s++;\n        }\n      }\n    }\n    if (b == len) {\n      c = s / len;\n      if (c > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n    if (b != len) {\n      cout << \"error\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, l2, i, c;\n  double n, m;\n  c = 0;\n  char f[500], s[500];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", f);\n  scanf(\"%s\", s);\n  l1 = strlen(f);\n  l2 = strlen(s);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (f[i] != 'A' && f[i] != 'G' && f[i] != 'C' && f[i] != 'T') {\n      cout << \"error\";\n      return 0;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n\n  for (i = 0; i < l2; i++) {\n    if (s[i] == f[i])\n      c++;\n  }\n\n  m = 1.0 * c / l1;\n  if (m >= n)\n    printf(\"yes\");\n  if (m < n) {\n    cout << \"no\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, j = 0;\n  double x, y, z;\n  scanf(\"%lf\", &x);\n  cin >> a;\n  scanf(\"%s\", b);\n  y = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (strlen(a) != strlen(b)) {\n      printf(\"error\");\n      break;\n    }\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      break;\n    }\n    if (a[i] == b[i]) {\n      j++;\n    }\n    if (a[i + 1] == '\\0') {\n      z = j / y;\n      if (z > x) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9404", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double c, d;\n  int j = 0, n, i, e = 0, m;\n  cin >> c >> a >> b;\n  n = strlen(a);\n  m = strlen(b);\n  if (n != m) {\n    e = 1;\n  } else {\n    for (i = 0; i < n; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        e = 1;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  }\n  while (e == 0) {\n    for (i = 0; i < n; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n    d = 1.0 * j / n;\n    if (d >= c) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    e = 1;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[505], s2[505];\n  double n, m = 0, len1, len2, flag = 0;\n  int i;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i < len1; i++) {\n    if ((s1[i] == 'A') || (s1[i] == 'T') || (s1[i] == 'C') || (s1[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n  for (i = 0; i < len2; i++) {\n    if ((s2[i] == 'A') || (s2[i] == 'T') || (s2[i] == 'C') || (s2[i] == 'G'))\n      continue;\n    else {\n      flag = 1;\n      break;\n    }\n  }\n\n  if ((len1 != len2) || (flag == 1)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i <= len1; i++) {\n      if (s1[i] == s2[i]) {\n        m++;\n      }\n    }\n    m = m / len1;\n    if (m > n)\n      printf(\"yes\");\n    else\n      cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, same = 0, flag = 1;\n  double n;\n  char a[500], b[500], c[100];\n\n  cin >> c;\n  n = atof(c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      flag = 0;\n    }\n    if (a[i] == b[i]) {\n      same++;\n    }\n  }\n  double m;\n  m = 1.0 * same / strlen(a);\n  if ((strlen(a) != strlen(b)) || flag == 0) {\n    printf(\"error\");\n  } else if (m <= n) {\n    cout << \"no\";\n  } else if (m > n) {\n    printf(\"yes\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9407", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, x = 0;\n  double p, y;\n  char a[500], b[500];\n  scanf(\"%lf \", &p);\n  cin >> a;\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    y = (double)x / m;\n    if (y > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9408", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, same = 0;\n  double rate, z;\n  char DNA[2][600];\n  cin >> rate;\n  scanf(\"%s %s\", DNA[0], DNA[1]);\n\n  len1 = strlen(DNA[0]);\n  len2 = strlen(DNA[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if (((DNA[0][i] != 'A') && (DNA[0][i] != 'G') && (DNA[0][i] != 'C') &&\n           (DNA[0][i] != 'T')) ||\n          ((DNA[1][i] != 'A') && (DNA[1][i] != 'G') && (DNA[1][i] != 'C') &&\n           (DNA[1][i] != 'T'))) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (DNA[0][i] == DNA[1][i])\n          same++;\n      }\n    }\n    z = (1.0 * same) / len1;\n    if (z >= rate)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double b;\n  int l1, l2, x = 0;\n  char d1[500], d2[500];\n  scanf(\"%lf%s%s\", &b, d1, d2);\n  l1 = strlen(d1);\n  l2 = strlen(d2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (int i = 0; i < l1; i++) {\n    if (d1[i] != 'A' && d1[i] != 'T' && d1[i] != 'C' && d1[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d2[i] != 'A' && d2[i] != 'T' && d2[i] != 'C' && d2[i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (d1[i] == d2[i])\n      x++;\n  }\n  if (1.0 * x / l1 > b) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9410", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  double m;\n  char jianji[2][501];\n  int len1, len2;\n  int i;\n  int sum = 0;\n  cin >> n >> jianji[0] >> jianji[1];\n  len1 = strlen(jianji[0]);\n  len2 = strlen(jianji[1]);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < len1; i++) {\n      if ((jianji[0][i] != 'A' && jianji[0][i] != 'T' && jianji[0][i] != 'C' &&\n           jianji[0][i] != 'G') ||\n          (jianji[1][i] != 'A' && jianji[1][i] != 'T' && jianji[1][i] != 'C' &&\n           jianji[1][i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (jianji[0][i] == jianji[1][i]) {\n          sum += 1;\n        }\n      }\n    }\n    m = (1.0 * sum) / len1;\n    if (m > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9411", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  int i, l, r = 1, s = 0;\n  char a[2][500];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    cin >> a[i];\n  }\n  if (strlen(a[0]) != strlen(a[1])) {\n    r = 0;\n  } else {\n    l = strlen(a[0]);\n    for (i = 0; i < l; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'C' && a[0][i] != 'T' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'C' && a[1][i] != 'T' &&\n           a[1][i] != 'G')) {\n        r = 0;\n        break;\n      } else if (a[0][i] == a[1][i]) {\n        s++;\n      }\n    }\n  }\n  if (r == 0) {\n    printf(\"error\");\n  } else if (1.0 * s / l >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, x = 0;\n  double p, y;\n  char a[500], b[500];\n  cin >> p;\n  cin >> a;\n  cin >> b;\n  m = strlen(a);\n  n = strlen(b);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; i < m; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C' ||\n          b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C') {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (a[i] == b[i]) {\n          x++;\n        }\n      }\n    }\n    y = (double)x / m;\n    if (y > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9413", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n = 0, len1, len2;\n  double p;\n  char a[501], b[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[i] == b[i])\n      n++;\n  }\n  if ((double)n / len1 > p)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9414", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m = 0, n = 0, total = 0, zong = 0, A = 1;\n  double bl, suande;\n  char z1[100];\n  char z2[100];\n  scanf(\"%lf\", &bl);\n  scanf(\"%s\", &z1);\n  scanf(\"%s\", &z2);\n  for (i = 0; z1[i] != '\\0'; i++) {\n    m++;\n  }\n  for (i = 0; z2[i] != '\\0'; i++) {\n    n++;\n  }\n  if (m != n) {\n    printf(\"error\");\n  } else {\n    for (i = 0; z1[i] != '\\0'; i++) {\n      zong++;\n      if (((z1[i] != 'A') && (z1[i] != 'T') && (z1[i] != 'C') &&\n           (z1[i] != 'G')) ||\n          ((z2[i] != 'A') && (z2[i] != 'T') && (z2[i] != 'C') &&\n           (z2[i] != 'G'))) {\n        A = 0;\n        break;\n      } else {\n        if (z1[i] == z2[i]) {\n          total++;\n        }\n      }\n    }\n    suande = 1.0 * total / zong;\n    if ((A == 1) && (suande <= bl)) {\n      printf(\"no\");\n    } else if ((A == 1) && (suande > bl)) {\n      printf(\"yes\");\n    } else if (A == 0) {\n      printf(\"error\");\n    } else {\n      printf(\"a\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char asd[500], zxc[500];\n  int i;\n  double n;\n  cin >> n;\n  scanf(\"%s\", asd);\n  scanf(\"%s\", zxc);\n  int len1 = strlen(asd);\n  int len2 = strlen(zxc);\n  int a1 = 0;\n  int a2 = 0;\n  for (i = 0; i < len1; i++) {\n    if (asd[i] != 'A' && asd[i] != 'C' && asd[i] != 'G' && asd[i] != 'T')\n      a1++;\n  }\n  for (i = 0; i < len2; i++) {\n    if (zxc[i] != 'A' && zxc[i] != 'C' && zxc[i] != 'G' && zxc[i] != 'T')\n      a2++;\n  }\n  if (a1 != 0 || a2 != 0 || len1 != len2)\n    printf(\"error\");\n  else {\n    int d = 0;\n    for (i = 0; i < len1; i++) {\n      if (asd[i] == zxc[i])\n        d++;\n    }\n    double result = 1.0 * d / len1;\n    if (result > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9416", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[2][510];\n  cin >> n;\n  cin >> B[0];\n  for (i = 0; B[0][i] != '\\0'; i++) {\n    if (B[0][i] != 'A' && B[0][i] != 'T' && B[0][i] != 'C' && B[0][i] != 'G') {\n      a = 1;\n    }\n  }\n  scanf(\"%s\", B[1]);\n  for (i = 0; B[1][i] != '\\0'; i++) {\n    if (B[1][i] != 'A' && B[1][i] != 'T' && B[1][i] != 'C' && B[1][i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B[0]) != strlen(B[1]) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B[0]);\n  for (i = 0; i < l; i++) {\n    if (B[0][i] == B[1][i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9417", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double len, len1, h, n1;\n  int i, f, r;\n  h = 0;\n  f = 0;\n  char s[500], t[500], n[2];\n\n  cin >> n;\n  n1 = atof(n);\n\n  cin >> s;\n\n  scanf(\"%s \", t);\n  len = strlen(s);\n  len1 = strlen(t);\n  if (len != len1)\n    printf(\"error\");\n  else {\n    for (i = 0; i < len; i++) {\n      if ((s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G') ||\n          (t[i] != 'A' && t[i] != 'T' && t[i] != 'C' && t[i] != 'G'))\n        f = 1;\n    }\n    if (f)\n      printf(\"error\");\n    else {\n      for (i = 0; i < len; i++) {\n        if (s[i] == t[i])\n          h++;\n      }\n      if (h / len > n1)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, num = 0, l1, l2, a = 0;\n  double p;\n  char fir[501], sec[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s%s\", fir, sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n  if (l1 != l2) {\n    printf(\"error\\n\");\n    a = 1;\n  }\n  for (i = 0; i < l1; i++) {\n    if ((fir[i] != 65 && fir[i] != 67 && fir[i] != 71 && fir[i] != 84) ||\n        (sec[i] != 65 && sec[i] != 67 && sec[i] != 71 && sec[i] != 84)) {\n      if (a == 0) {\n        printf(\"error\\n\");\n        a = 1;\n      }\n      break;\n    }\n    if (fir[i] == sec[i]) {\n      num += 1;\n    }\n  }\n  if (num * 1.0 / l1 >= p && a == 0) {\n    printf(\"yes\\n\");\n  } else if (num * 1.0 / l1 < p && a == 0) {\n    printf(\"no\\n\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int i, l, r = 1, s = 0;\n  char a[2][500];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  if (strlen(a[0]) != strlen(a[1])) {\n    r = 0;\n  } else {\n    l = strlen(a[0]);\n    for (i = 0; i < l; i++) {\n      if ((a[0][i] != 'A' && a[0][i] != 'C' && a[0][i] != 'T' &&\n           a[0][i] != 'G') ||\n          (a[1][i] != 'A' && a[1][i] != 'C' && a[1][i] != 'T' &&\n           a[1][i] != 'G')) {\n        r = 0;\n        break;\n      } else if (a[0][i] == a[1][i]) {\n        s++;\n      }\n    }\n  }\n  if (r == 0) {\n    printf(\"error\");\n  } else if (1.0 * s / l >= n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, k = 0;\n  double m;\n  char a[500], b[500];\n  scanf(\"%lf\", &m);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  j = strlen(a);\n  l = strlen(b);\n  if (j != l) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < j; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (a[i] == b[i]) {\n      k++;\n    }\n  }\n  if (1.0 * k / j > m) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char x[600], y[600];\n  int b = 0, i;\n  double a;\n  scanf(\"%lf\\n\", &a);\n  scanf(\"%s\\n\", x);\n  scanf(\"%s\", y);\n  if (strlen(x) != strlen(y)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < 600; i++) {\n    if (x[i] != 'A' && x[i] != 'G' && x[i] != 'C' && x[i] != 'T' && x[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (y[i] != 'A' && y[i] != 'G' && y[i] != 'C' && y[i] != 'T' && y[i] != 0) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == 0) {\n      break;\n    }\n    if (x[i] == y[i]) {\n      b++;\n    }\n  }\n  if ((1.0 * b / strlen(x)) >= a) {\n    cout << \"yes\";\n  } else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, i;\n  double e;\n  char str[501], s[501];\n  scanf(\"%lf\", &e);\n  scanf(\"%s %s\", str, s);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != 'A' && str[i] != 'T' && str[i] != 'G' && str[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if (strlen(str) != strlen(s)) {\n    printf(\"error\");\n  } else if (strlen(str) == strlen(s)) {\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (str[i] == s[i]) {\n        k++;\n      }\n    }\n    if ((1.0 * k / n) > e) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9423", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  double m, ac, bc, n;\n  k = 0;\n  m = 0;\n  ac = 0;\n  bc = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s\", b);\n  ac = strlen(a) - 1;\n  bc = strlen(b) - 1;\n  if (ac != bc) {\n    k++;\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k++;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n    }\n  }\n  if (k == 0) {\n    if (m / ac >= n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, i;\n  double a;\n  char b[2][1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s \", b);\n  scanf(\"%s\", b[1]);\n  if (strlen(b[0]) != strlen(b[1])) {\n    printf(\"error\");\n\n    return 0;\n  }\n  for (i = 0; i < strlen(b[0]); i++) {\n    if (b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G' &&\n        b[1][i] != 'A' && b[1][i] != 'T' && b[1][i] != 'C' && b[1][i] != 'G' &&\n        b[0][i] != 'a' && b[0][i] != 't' && b[0][i] != 'c' && b[0][i] != 'g' &&\n        b[1][i] != 'a' && b[1][i] != 't' && b[1][i] != 'c' && b[1][i] != 'g') {\n      cout << \"error\";\n\n      return 0;\n    }\n    if (b[0][i] == b[1][i])\n      s++;\n  }\n  if (s * 1.0 / strlen(b[0]) > a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9425", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double rate;\n  cin >> rate;\n  char a[501], b[501];\n  cin >> a >> b;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n\n  if (len1 != len2) {\n    printf(\"error\\n\");\n    return 0;\n  }\n\n  int i, sum = 0;\n  for (i = 0; i < len1; i++) {\n    switch (a[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n    switch (b[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'C':\n      break;\n    case 'G':\n      break;\n    default:\n      printf(\"error\\n\");\n      return 0;\n    }\n\n    if (a[i] == b[i])\n      sum++;\n  }\n\n  if ((double)sum / len1 > rate)\n    printf(\"yes\\n\");\n  else\n    printf(\"no\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d;\n  double n;\n  char xl1[500], xl2[500];\n  c = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", xl1, xl2);\n  a = strlen(xl1);\n  b = strlen(xl2);\n  if (a != b) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < a; i++) {\n      if ((xl1[i] != 'A' && xl1[i] != 'T' && xl1[i] != 'G' && xl1[i] != 'C') ||\n          (xl2[i] != 'A' && xl2[i] != 'T' && xl2[i] != 'G' && xl2[i] != 'C')) {\n        printf(\"error\");\n        d = 0;\n        break;\n      } else {\n        if (xl1[i] == xl2[i]) {\n          c++;\n        }\n      }\n    }\n    if (1.0 * c / a > n && d != 0) {\n      printf(\"yes\");\n    } else if (1.0 * c / a <= n && d != 0) {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x, y;\n  char a[501], b[501];\n  int i, t = 0, m = 0, n = 0, mark = 1;\n  cin >> x;\n  getchar();\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; a[i]; i++) {\n    m = m + 1;\n    if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G')\n      mark = 0;\n  }\n  for (i = 0; b[i]; i++) {\n    n = n + 1;\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')\n      mark = 0;\n  }\n  if (m != n || mark == 0)\n    cout << \"error\";\n  else {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i])\n        t = t + 1;\n    }\n    y = t / (double)m;\n    if (y >= x)\n      cout << \"yes\";\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  double a, b = 0, l, m, c = 0;\n  char x[1000], y[1000];\n  scanf(\"%lf %s %s\", &a, &x, &y);\n  l = strlen(x);\n  m = strlen(y);\n  for (i = 0; i < l; i++) {\n    if (x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C') {\n      c = c;\n    } else {\n      c++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C') {\n      c = c;\n    } else\n      c++;\n  }\n  if (l == m && c == 0) {\n    for (i = 0; i < l; i++) {\n      if (x[i] == y[i]) {\n        b++;\n      }\n    }\n    if (a < (b / l)) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double j, n;\n  int i, l, k, p = 0, u, h = 0;\n  char a[2][501];\n  scanf(\"%lf\", &n);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", a[i]);\n  }\n  l = strlen(a[0]);\n  k = strlen(a[1]);\n  if (l != k) {\n    printf(\"error\");\n  } else {\n    for (u = 0; u < l; u++) {\n      if ((a[0][u] != 'A') && (a[0][u] != 'T') && (a[0][u] != 'G') &&\n          (a[0][u] != 'C') && (a[1][u] != 'A') && (a[1][u] != 'T') &&\n          (a[1][u] != 'G') && (a[1][u] != 'C')) {\n        p++;\n      } else {\n        if (a[0][u] == a[1][u]) {\n          h++;\n        }\n      }\n    }\n    if (p != 0) {\n      printf(\"error\");\n    } else {\n      j = 1.0 * h / l;\n      if (j > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double n;\n  char a[1000 + 1];\n  char b[1000 + 1];\n  int p, q, i, j, x = 0, y = 0, l = 0;\n  scanf(\"%lf\", &n);\n  cin >> a;\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  if (p != q) {\n    printf(\"error\");\n  }\n  if (p == q) {\n    for (i = 0; a[i]; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        x++;\n        break;\n      }\n    }\n    for (j = 0; b[j]; j++) {\n      if (b[j] != 'A' && b[j] != 'T' && b[j] != 'C' && b[j] != 'G' && x == 0) {\n        printf(\"error\");\n        y++;\n        break;\n      }\n    }\n  }\n  if (p == q && x == 0 && y == 0) {\n    for (i = 0; i < p; i++) {\n      if (a[i] == b[i]) {\n        l++;\n      }\n    }\n    if (l * 1.0 / p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t = 0, s = 0;\n  float n;\n  char a[600], b[600];\n  cin >> n;\n  cin >> a;\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    cout << \"error\";\n  else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'C' && a[i] != 'T' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'C' && b[i] != 'T' && b[i] != 'G'))\n        t++;\n    }\n\n    if (t > 0)\n      cout << \"error\" << endl;\n    else {\n\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i])\n          s++;\n      }\n\n      if ((float)s / strlen(a) > n)\n        cout << \"yes\";\n      else\n        cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9432", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double k;\n  scanf(\"%lf\", &k);\n  char moban[500], hubu[500];\n  scanf(\"%s\", moban);\n  scanf(\"%s\", hubu);\n  int m, n;\n  m = strlen(moban);\n  n = strlen(hubu);\n  if (m != n)\n    printf(\"error\");\n  else {\n    int count = 0;\n    for (int i = 0; i < n; i++) {\n      if (moban[i] != 'A' && moban[i] != 'T' && moban[i] != 'C' &&\n          moban[i] != 'G')\n        count++;\n      if (hubu[i] != 'A' && hubu[i] != 'T' && hubu[i] != 'C' && hubu[i] != 'G')\n        count++;\n    }\n    if (count != 0)\n      printf(\"error\");\n    else {\n      int sum = 0;\n      for (int i = 0; i < n; i++) {\n        if (moban[i] == hubu[i])\n          sum++;\n      }\n      double result = (double)sum / n;\n      if (result > k)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  \n  return 0;\n}\n"}
{"label": "5", "index": "9433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c = 0;\n  double e, d;\n  char x[256], y[256];\n  scanf(\"%lf\", &d);\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  a = strlen(x);\n  b = strlen(y);\n  if (a != b) {\n    cout << \"error\";\n  } else if (a == b) {\n    for (i = 0; i < a; i++) {\n      if ((x[i] != 'A' && x[i] != 'T' && x[i] != 'C' && x[i] != 'G') ||\n          (y[i] != 'A' && y[i] != 'T' && y[i] != 'C' && y[i] != 'G')) {\n        printf(\"error\");\n        return 0;\n      } else {\n        if (x[i] == y[i]) {\n          c += 1;\n        }\n      }\n    }\n    e = 1.0 * c / a;\n    if (e >= d) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  double a, len, cd, s = 0, b = 0, c;\n  char s1[501], s2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", &s1, &s2);\n  len = strlen(s1);\n  cd = strlen(s2);\n  if (len != cd) {\n    printf(\"error\");\n  }\n  if (len == cd) {\n    for (i = 0; i < len; i++) {\n      if ((s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G') &&\n          (s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G')) {\n        b++;\n        if (s1[i] == s2[i]) {\n          s++;\n        }\n      }\n    }\n    if (b == len) {\n      c = s / len;\n      if (c > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n    if (b != len) {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9435", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, a, b, c, d, e;\n  char w[501], f[501];\n  scanf(\"%lf\", &n);\n  scanf(\"%s%s\", w, f);\n  a = 0;\n  b = 0;\n  c = strlen(w);\n  d = strlen(f);\n  e = 0;\n  if (c != d) {\n    e = 1;\n  } else {\n    for (i = 0; i < c; i++) {\n      if (!(w[i] == 'A' || w[i] == 'C' || w[i] == 'T' || w[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n    for (i = 0; i < d; i++) {\n      if (!(f[i] == 'A' || f[i] == 'C' || f[i] == 'T' || f[i] == 'G')) {\n        e = 1;\n        break;\n      }\n    }\n  }\n  if (e == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < d; i++) {\n      if (w[i] == f[i]) {\n        a++;\n      }\n      b++;\n    }\n    m = 1.0 * a / b;\n    if (m >= n) {\n      printf(\"yes\");\n    } else if (m < n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, c = 0;\n  double n, x = 0, y = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n\n  scanf(\"%s\", a);\n\n  scanf(\"%s\", b);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n        (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T')) {\n      printf(\"error\");\n      c = 1;\n      break;\n    } else {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y++;\n  }\n  if (c == 0) {\n    if (b[i] != '\\0') {\n      printf(\"error\");\n      c = 1;\n    }\n  }\n\n  if (c == 0) {\n    if ((x / y) > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, count = 0, i;\n  double result, n;\n  cin >> n;\n  char a[500], b[500];\n  scanf(\"%s%s\", a, b);\n  c = strlen(a);\n  d = strlen(b);\n  if (c != d)\n    printf(\"error\");\n  else {\n    for (i = 0; i < c; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        printf(\"error\");\n        result = -1;\n        break;\n      } else {\n\n        if (a[i] == b[i])\n          count++;\n      }\n    }\n    if (result != -1) {\n\n      result = (double)count / c;\n      if (result > n)\n        printf(\"yes\");\n      else\n        cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double xgd, bz;\n  int l, i, count;\n  char dna1[110], dna2[110];\n  count = 0;\n  scanf(\"%lf\", &bz);\n  scanf(\"%s\", dna1);\n  scanf(\"%s\", dna2);\n  l = strlen(dna1);\n  for (i = 0; i < l; i++) {\n    if (!(dna1[i] == 'A' || dna1[i] == 'G' || dna1[i] == 'C' ||\n          dna1[i] == 'T') ||\n        !(dna2[i] == 'A' || dna2[i] == 'G' || dna2[i] == 'C' ||\n          dna2[i] == 'T')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (dna1[i] == dna2[i])\n      count++;\n  }\n  xgd = 1.0 * count / l;\n  if (xgd >= bz)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  cin >> a;\n  char x[1000], y[1000];\n  scanf(\"%s %s\", x, y);\n  int l = strlen(x), k = 0, o = strlen(y);\n  if (l != o) {\n    cout << \"error\";\n    return 0;\n  }\n  for (int i = 0; i < l; i++) {\n    if (!(x[i] == 'A' || x[i] == 'T' || x[i] == 'G' || x[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (!(y[i] == 'A' || y[i] == 'T' || y[i] == 'G' || y[i] == 'C')) {\n      printf(\"error\");\n      return 0;\n    }\n    if (x[i] == y[i])\n      k++;\n  }\n  if (1.0 * k / l > a) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[2][510];\n  scanf(\"%lf\", &n);\n  cin >> B[0];\n  for (i = 0; B[0][i] != '\\0'; i++) {\n    if (B[0][i] != 'A' && B[0][i] != 'T' && B[0][i] != 'C' && B[0][i] != 'G') {\n      a = 1;\n    }\n  }\n  scanf(\"%s\", B[1]);\n  for (i = 0; B[1][i] != '\\0'; i++) {\n    if (B[1][i] != 'A' && B[1][i] != 'T' && B[1][i] != 'C' && B[1][i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B[0]) != strlen(B[1]) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B[0]);\n  for (i = 0; i < l; i++) {\n    if (B[0][i] == B[1][i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9441", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double m, a, b, t = 1, k = 0, s = 1, result;\n  char r[501], e[501];\n  int i;\n  scanf(\"%lf\", &m);\n  scanf(\"%s \", r);\n  cin >> e;\n  a = strlen(r);\n  b = strlen(e);\n  if (a != b) {\n    printf(\"error\");\n  }\n  for (i = 0; i < (a - 1); i++) {\n    if ((r[i] == 'A') || (r[i] == 'T') || (r[i] == 'C') || (r[i] == 'G')) {\n      t++;\n    };\n    if ((e[i] == 'A') || (e[i] == 'T') || (e[i] == 'C') || (e[i] == 'G')) {\n      s++;\n    };\n  }\n  if ((t == a) && (s == b) && (a == b)) {\n    for (i = 0; i < a - 1; i++) {\n      if (r[i] == e[i]) {\n        k++;\n      };\n    };\n    result = k / (a - 1);\n    if (result > m) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    };\n  }\n  if (((t != a) || (s != b)) && (a == b)) {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, js, l;\n  char c[600], d[600];\n  double a, b;\n  scanf(\"%lf%s%s\", &a, c, d);\n  if (strlen(c) != strlen(d)) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(c);\n  js = 0;\n  for (i = 0; c[i] != '\\0'; i++) {\n    if ((c[i] == 'A' || c[i] == 'G' || c[i] == 'C' || c[i] == 'T') &&\n        (d[i] == 'A' || d[i] == 'G' || d[i] == 'C' || d[i] == 'T')) {\n      if (c[i] == d[i])\n        js++;\n    } else {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  b = 1.0 * js / l;\n  if (b >= a)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  return 0;\n}\n"}
{"label": "5", "index": "9443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, d, l, h;\n  double n, t;\n  char a[500], b[500];\n  scanf(\"%lf \", &n);\n  d = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  l = strlen(a);\n  h = strlen(b);\n  if (l > h || l < n) {\n    printf(\"error\");\n  } else if (l == h) {\n    for (i = 0, j = 0; a[i] != '\u0000'; i++, j++) {\n      if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {\n        if (a[i] == b[j]) {\n          d++;\n        }\n      } else {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    t = (double)d / l;\n    if (t > n) {\n      printf(\"yes\");\n    } else if (t <= n) {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, x, m, c, r, k;\n  double n, y;\n  char a[502], b[502];\n  x = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  m = strlen(a);\n  c = strlen(b);\n  r = 1;\n  k = 1;\n  if (m != c) {\n    k = 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C' ||\n        b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') {\n      r = 1;\n    } else {\n      r = 0;\n    }\n    if (r == 0 || k == 0) {\n      printf(\"error\");\n      break;\n    }\n  }\n  if (r == 1 && k == 1) {\n    for (i = 0; i < m; i++) {\n      if (a[i] == b[i]) {\n        x++;\n      }\n    }\n    y = 1.0 * x / m;\n    if (y > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  double n;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int k = strlen(a);\n  int l = strlen(b);\n  int x = 0, y = 0;\n  int mm = 0;\n  for (mm = 0; mm < k; mm++) {\n    if (a[mm] != 'A' && a[mm] != 'T' && a[mm] != 'G' && a[mm] != 'C') {\n      x = 1;\n    }\n  }\n  for (mm = 0; mm < l; mm++) {\n    if (b[mm] != 'A' && b[mm] != 'T' && b[mm] != 'G' && b[mm] != 'C') {\n      y = 1;\n    }\n  }\n  if (k != l || x == 1 || y == 1) {\n    printf(\"error\");\n  }\n\n  else {\n    int i = 0, p = 0, q = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      q++;\n      if (a[i] == b[i]) {\n        p++;\n      }\n    }\n    double c = (double)p / q;\n    if (c > n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, lena, lenb, i, c;\n  char yi[501], er[501];\n  double rate, a;\n  scanf(\"%lf\", &a);\n  scanf(\"%s%s\", yi, er);\n  lena = strlen(yi);\n  lenb = strlen(er);\n  if (lenb != lena) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (yi[i] == 0) {\n        break;\n      } else if (yi[i] >= 'A' && yi[i] <= 'Z' && er[i] >= 'A' && er[i <= 'Z']) {\n        if (yi[i] == er[i]) {\n          sum++;\n        } else {\n          continue;\n        }\n      } else {\n        c = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    rate = sum * 1.0 / lena;\n    if (c != 1) {\n      if (rate > a) {\n        printf(\"yes\");\n      } else if (rate <= a) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9447", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char s[1000], j[1000];\n  scanf(\"%s\", s);\n  scanf(\"%s\", j);\n  if (strlen(s) != strlen(j)) {\n    printf(\"error\");\n    return 0;\n  }\n  int k;\n  k = strlen(s);\n  int sum = 0;\n  double rate;\n  int i;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != 'A' && s[i] != 'G' && s[i] != 'C' && s[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (j[i] != 'A' && j[i] != 'G' && j[i] != 'C' && j[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n\n    if (s[i] == j[i]) {\n      sum++;\n    }\n  }\n  rate = 1.0 * sum / k;\n  if (rate > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int l1, l2, i, count = 0;\n  double rate;\n  char str1[1000], str2[1000];\n  scanf(\"%lf\", &rate);\n  scanf(\"%s %s\", str1, str2);\n  l1 = strlen(str1);\n  l2 = strlen(str2);\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < l1; i++) {\n    if (str1[i] == str2[i]) {\n      count++;\n    }\n    if (((str1[i] != 'A') && (str1[i] != 'C') && (str1[i] != 'G') &&\n         (str1[i] != 'T')) ||\n        ((str2[i] != 'A') && (str2[i] != 'C') && (str2[i] != 'G') &&\n         (str2[i] != 'T'))) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  if ((1.00 * count / l1) >= rate) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[502], b[502];\n  int l1, l2;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  int i, k = 0, flag;\n  for (i = 0; i < l1; i++)\n    if (a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') {\n      flag = 1;\n    }\n  for (i = 0; i < l1; i++)\n    if (b[i] != 'A' && b[i] != 'G' && b[i] != 'C' && b[i] != 'T') {\n      flag = 1;\n    }\n  if (l1 != l2 || flag == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (a[i] == b[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / l1 >= n) {\n      printf(\"yes\");\n    } else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[101];\n  char c[101];\n  scanf(\"%lf%s%s\", &a, b, c);\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  int n = strlen(b);\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'T' && c[i] != 'G' &&\n        c[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] == c[i]) {\n      count += 1;\n    }\n  }\n  double d;\n  d = 1.0 * count / n;\n  if (d > a) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, s = 0, j = 1;\n  double r;\n  char d1[501], d2[501];\n  scanf(\"%lf %s %s\", &r, d1, d2);\n  if (strlen(d1) != strlen(d2)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(d1); i++) {\n      if (d1[i] != 'A' && d1[i] != 'C' && d1[i] != 'G' && d1[i] != 'T' &&\n          d2[i] != 'A' && d2[i] != 'G' && d2[i] != 'C' && d2[i] != 'T') {\n        j = 0;\n        printf(\"error\");\n        break;\n      } else if (d1[i] == d2[i]) {\n        s++;\n      }\n    }\n    if (j == 1) {\n      if (1.0 * s / strlen(d1) > r) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, k = 0;\n  char a[500], b[500];\n  cin >> n >> a >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    int p = 1;\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') &&\n          (b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) {\n        if (a[i] == b[i])\n          k++;\n      } else {\n        p = 0;\n        printf(\"error\");\n        break;\n      }\n    }\n    if (p == 1) {\n      m = (double)k / strlen(a);\n      if (m > n)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double p, q;\n  int a, b, m = 0, brak = 0;\n  scanf(\"%lf\", &p);\n  char k[600], kk[600];\n  cin >> k;\n  scanf(\"%s\", kk);\n  a = strlen(k);\n  b = strlen(kk);\n  for (int h = 0;; h++) {\n    if (a != b) {\n      printf(\"error\");\n      break;\n    }\n    for (int c = 0; c < a; c++) {\n      if (!(k[c] == 'A' || k[c] == 'T' || k[c] == 'C' || k[c] == 'G')) {\n        brak++;\n      }\n      if (!(kk[c] == 'A' || kk[c] == 'T' || kk[c] == 'C' || kk[c] == 'G')) {\n        brak++;\n      }\n    }\n    if (brak != 0) {\n      printf(\"error\");\n      break;\n    }\n    for (int i = 0; i < a; i++) {\n      if (k[i] == kk[i]) {\n        m++;\n      }\n    }\n    q = m / (a * 1.0);\n    if (q >= p) {\n      printf(\"yes\");\n    }\n    if (q < p) {\n      cout << \"no\";\n    }\n    break;\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  double x = 0, ratio = 0;\n  int i = 0, num = 0, l1 = 0, l2 = 0, temp = 1;\n  char sequen1[1000], sequen2[1000];\n  scanf(\"%lf\", &x);\n  scanf(\"%s\", sequen1);\n  scanf(\"%s\", sequen2);\n  l1 = strlen(sequen1);\n  l2 = strlen(sequen2);\n  if (l1 != l2) {\n    printf(\"error\");\n    temp = 0;\n  } else {\n    for (i = 0; i < l1; i++) {\n      if ((sequen1[i] != 'A' && sequen1[i] != 'T' && sequen1[i] != 'G' &&\n           sequen1[i] != 'C') ||\n          (sequen2[i] != 'A' && sequen2[i] != 'T' && sequen2[i] != 'G' &&\n           sequen2[i] != 'C')) {\n        printf(\"error\");\n        temp = 0;\n        break;\n      }\n    }\n  }\n  if (temp == 1) {\n    for (i = 0; i < l1; i++) {\n      if (sequen1[i] == sequen2[i]) {\n        num++;\n      }\n    }\n    ratio = 1.0 * num / l1;\n    if (ratio > x) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9455", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float std, rate, sign;\n  int i, l1, l2;\n  char dna1[500], dna2[500];\n\n  scanf(\"%f\", &std);\n  cin >> dna1 >> dna2;\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  sign = 0;\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; i < l1; i++) {\n    switch (dna1[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    switch (dna2[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      sign++;\n  }\n  rate = sign / l1;\n\n  if (rate >= std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "5", "index": "9456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  int i, j = 0;\n  char dna1[501], dna2[501];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", &dna1);\n  scanf(\"%s\", &dna2);\n  int len1 = strlen(dna1);\n  int len2 = strlen(dna2);\n  if (len1 != len2) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < len1; i++) {\n    if ((dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'G' &&\n         dna1[i] != 'C') ||\n        (dna1[i] != 'A' && dna1[i] != 'T' && dna1[i] != 'C' &&\n         dna1[i] != 'G')) {\n      printf(\"error\");\n      return 0;\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    if (dna1[i] == dna2[i]) {\n      j++;\n    }\n  }\n  if (1.0 * j / len1 > a) {\n    cout << \"yes\";\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double z, q;\n  char a[1][1000], b[1][1000];\n  int x, y, m, n, s = 0, i;\n  scanf(\"%lf\", &q);\n  scanf(\"%s%s\", a[0], b[0]);\n  m = strlen(a[0]);\n  n = strlen(b[0]);\n  if (m != n) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G' ||\n        b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[0][i] == b[0][i]) {\n      s++;\n    }\n  }\n  z = 1.0 * s / m;\n  if (z > q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int q, w, e = 0, r = 1, i;\n  double a, b;\n  char A[1000], B[1000];\n  scanf(\"%lf\", &a);\n  scanf(\"%s\", A);\n  scanf(\"%s\", B);\n  q = strlen(A);\n  w = strlen(B);\n  \n  \n  if (q != w) {\n    printf(\"error\");\n    r = -1;\n  } else {\n    for (i = 0; A[i] != '\\0'; i++) {\n\n      if ((A[i] != 'T' && A[i] != 'C' && A[i] != 'A' && A[i] != 'G') ||\n          (B[i] != 'T' && B[i] != 'C' && B[i] != 'A' && B[i] != 'G')) {\n        r = -1;\n        printf(\"error\");\n        break;\n      } else if (A[i] != B[i]) {\n        continue;\n      } else if (A[i] == B[i]) {\n        e++;\n      }\n    }\n  }\n  \n  if (r == 1) {\n    b = (e * 1.0) / (q * 1.0);\n    \n    if (b > a) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k = 0;\n  double xs, sj;\n  char dna1[600], dna2[600];\n  scanf(\"%lf\", &xs);\n  scanf(\"%s %s\", dna1, dna2);\n  if (strlen(dna1) != strlen(dna2)) {\n    printf(\"error\");\n    return 0;\n  }\n  for (i = 0; i < (strlen(dna1) - 1); i++) {\n    if (dna1[i] != 'A' && dna1[i] != 'G' && dna1[i] != 'C' && dna1[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna2[i] != 'A' && dna2[i] != 'G' && dna2[i] != 'C' && dna2[i] != 'T') {\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      k++;\n  }\n  sj = 1.0 * k / (strlen(dna1) - 1);\n  if (sj > xs) {\n    printf(\"yes\");\n  } else\n    printf(\"no\");\n  return 0;\n}\n"}
{"label": "5", "index": "9460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[501], b[501];\n  int i, time = 0;\n  double n, p, l, j, k, same = 0;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  j = strlen(a);\n  k = strlen(b);\n  for (i = 0; i < j; i++) {\n    if (!(a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G')) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if ((!(b[i] == 'A' || b[i] == 'T' || b[i] == 'C' || b[i] == 'G')) &&\n        time == 0) {\n      printf(\"error\");\n      time++;\n      break;\n    }\n  }\n  if (j != k && time == 0) {\n    printf(\"error\");\n    time++;\n  }\n  if (time == 0) {\n    for (i = 0; i < j; i++) {\n      if (a[i] == b[i]) {\n        same++;\n      }\n    }\n    l = strlen(a);\n    p = same / l;\n    if (p > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double a;\n  char b[101];\n  char c[101];\n  cin >> a >> b >> c;\n  if (strlen(b) != strlen(c)) {\n    printf(\"error\\n\");\n    return 0;\n  }\n  int n = strlen(b);\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n      printf(\"error\\n\");\n      return 0;\n    }\n    if (c[i] != 'A' && c[i] != 'T' && c[i] != 'T' && c[i] != 'G' &&\n        c[i] != 'C') {\n      printf(\"error\\n\");\n      return 0;\n    }\n  }\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] == c[i]) {\n      count += 1;\n    }\n  }\n  double d;\n  d = 1.0 * count / n;\n  if (d > a) {\n    printf(\"yes\\n\");\n  } else {\n    cout << \"no\\n\";\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double n;\n  int i;\n  scanf(\"%lf\", &n);\n  char sza[600], szb[600];\n  scanf(\"%s\", sza);\n  scanf(\"%s\", szb);\n  int a = 0;\n  int b = strlen(sza);\n  int c = strlen(szb);\n  for (i = 0; i < b; i++) {\n    if (sza[i] != 'A' && sza[i] != 'T' && sza[i] != 'C' && sza[i] != 'G') {\n      a = 1;\n    }\n    if (szb[i] != 'A' && szb[i] != 'T' && szb[i] != 'C' && szb[i] != 'G') {\n      a = 1;\n    }\n    if (b != c) {\n      a = 1;\n    }\n  }\n  double d = 0;\n  double e;\n  if (a == 1) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < b; i++) {\n      if (sza[i] == szb[i]) {\n        d++;\n      }\n    }\n    e = d / b;\n    if (e > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint judge(char c)\n\n{\n\n  return (!(c == 'A' || c == 'T' || c == 'C' || c == 'G'));\n}\n\nint main()\n\n{\n\n  double n;\n\n  int icount = 0;\n\n  int flag = 0;\n\n  char s[600], t[600];\n\n  cin >> n >> s >> t;\n\n  int len1 = strlen(s), len2 = strlen(t);\n\n  if (len1 != len2)\n\n    cout << \"error\\n\";\n\n  else\n\n  {\n\n    for (int i = 0; i < len1; ++i)\n\n    {\n\n      if (s[i] == t[i])\n        icount++;\n\n      if (judge(s[i]) || judge(t[i])) {\n        flag = 1;\n        break;\n      }\n    }\n\n    if (flag)\n\n      printf(\"error\\n\");\n\n    else\n\n    {\n\n      if (1.0 * icount / len1 >= n)\n        cout << \"yes\\n\";\n\n      else\n        printf(\"no\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e = 0, f = 0;\n  char h[1][501], i[1][501];\n  double j, k;\n  cin >> j >> h[0] >> i[0];\n  b = strlen(h[0]);\n  c = strlen(i[0]);\n  if (b != c) {\n    f++;\n    printf(\"error\");\n  } else {\n    for (d = 0; d < b; d++) {\n      if ((h[0][d] != 'A' && h[0][d] != 'T' && h[0][d] != 'C' &&\n           h[0][d] != 'G') ||\n          (i[0][d] != 'A' && i[0][d] != 'T' && i[0][d] != 'C' &&\n           i[0][d] != 'G')) {\n        printf(\"error\");\n        f++;\n        break;\n      } else {\n        if (h[0][d] == i[0][d])\n          e++;\n      }\n    }\n  }\n  if (f == 0) {\n    k = 1.0 * e / b;\n    if (k > j) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, s = 0, m;\n  scanf(\"%lf\", &n);\n  char a[600], b[600];\n  cin >> a >> b;\n  int l1, l2;\n  l1 = strlen(a);\n  l2 = strlen(b);\n  if (l1 != l2) {\n    printf(\"error\");\n  }\n  if (l1 == l2) {\n    int i, T = 0;\n    for (i = 0; a[i] != '\\0' && b[i] != '\\0'; i++) {\n      if ((a[i] == 'A' || a[i] == 'T' || a[i] == 'G' || a[i] == 'C') &&\n          (b[i] == 'G' || b[i] == 'T' || b[i] == 'A' || b[i] == 'C')) {\n        if (a[i] == b[i]) {\n          s++;\n        }\n      } else {\n        printf(\"error\");\n        T = 1;\n        break;\n      }\n    }\n    if (T == 0) {\n      m = s / l1;\n      if (m > n) {\n        printf(\"yes\");\n      }\n      if (m <= n) {\n        cout << \"no\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(char x, char y);\nint main() {\n  double n;\n  char DNA1[502], DNA2[502];\n  int len1, len2;\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", DNA1);\n  scanf(\"%s\", DNA2);\n  len1 = strlen(DNA1);\n  len2 = strlen(DNA2);\n  int i, m = 0;\n  int e;\n  int p = 0;\n  double result;\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < len1; i++) {\n      e = compare(DNA1[i], DNA2[i]);\n      if (e == 1) {\n        m++;\n      }\n      if ((DNA1[i] != 'A' && DNA1[i] != 'T' && DNA1[i] != 'G' &&\n           DNA1[i] != 'C') ||\n          (DNA2[i] != 'A' && DNA2[i] != 'T' && DNA2[i] != 'G' &&\n           DNA2[i] != 'C')) {\n        printf(\"error\");\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      result = ((double)m / (double)len1);\n      if (result > n) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n\nint compare(char x, char y) {\n  if ((x == 'A' && y == 'A') || (x == 'T' && y == 'T') ||\n      (x == 'C' && y == 'C') || (x == 'G' && y == 'G')) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "5", "index": "9467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, f = 0, e = 0, i;\n  double a, h;\n  char d[3][502];\n  scanf(\"%lf\", &a);\n  for (i = 0; i < 2; i++) {\n    scanf(\"%s\", d[i]);\n  }\n  b = strlen(d[0]);\n  c = strlen(d[1]);\n  if (b == c) {\n    for (f = 0; f < b; f++) {\n      if (d[0][f] == d[1][f]) {\n        e++;\n      }\n    }\n    for (f = 0; f < b; f++) {\n      if ((d[0][f] != 'A' && d[0][f] != 'G' && d[0][f] != 'C' &&\n           d[0][f] != 'T') ||\n          (d[1][f] != 'A' && d[1][f] != 'G' && d[1][f] != 'C' &&\n           d[1][f] != 'T')) {\n        break;\n      }\n    }\n    if (f == b) {\n      h = e * 1.0 / b;\n      if (h > a) {\n        printf(\"yes\");\n      } else {\n        printf(\"no\");\n      }\n    } else {\n      printf(\"error\");\n    }\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  double m, ac, bc, n;\n  k = 0;\n  m = 0;\n  ac = 0;\n  bc = 0;\n  scanf(\"%lf\\n\", &n);\n  char a[501], b[501];\n  scanf(\"%s\\n\", a);\n  scanf(\"%s \", b);\n  ac = strlen(a) - 1;\n  bc = strlen(b) - 1;\n  if (ac != bc) {\n    k++;\n    printf(\"error\");\n    return 0;\n  } else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'G' && a[i] != 'C') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'G' && b[i] != 'C')) {\n        k++;\n        printf(\"error\");\n        break;\n      } else {\n        if (a[i] == b[i]) {\n          m++;\n        }\n      }\n    }\n  }\n  if (k == 0) {\n    if (m / ac >= n) {\n      printf(\"yes\");\n    } else {\n      cout << \"no\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9469", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[51], b[51];\n  int i, j = 0, k;\n  double n, t;\n  cin >> n;\n  scanf(\"%s\", a);\n  cin >> b;\n  if (strlen(a) != strlen(b))\n    printf(\"error\");\n  else {\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; b[i] != '\\0'; i++) {\n      if (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G') {\n        printf(\"error\");\n        return 0;\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == b[i]) {\n        j++;\n      }\n    }\n\n    k = strlen(a);\n    t = 1.0 * j / k;\n    if (t > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float std, rate, sign;\n  int i, l1, l2;\n  char dna1[500], dna2[500];\n\n  scanf(\"%f\", &std);\n  scanf(\"%s %s\", dna1, dna2);\n  l1 = strlen(dna1);\n  l2 = strlen(dna2);\n  sign = 0;\n\n  if (l1 != l2) {\n    printf(\"error\");\n    return 0;\n  }\n\n  for (i = 0; i < l1; i++) {\n    switch (dna1[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    switch (dna2[i]) {\n    case 'A':\n      break;\n    case 'T':\n      break;\n    case 'G':\n      break;\n    case 'C':\n      break;\n    default:\n      printf(\"error\");\n      return 0;\n    }\n    if (dna1[i] == dna2[i])\n      sign++;\n  }\n  rate = sign / l1;\n\n  if (rate >= std)\n    printf(\"yes\");\n  else\n    printf(\"no\");\n\n  cin >> i;\n  return 0;\n}\n"}
{"label": "5", "index": "9471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double z, q;\n  char a[1][1000], b[1][1000];\n  int x, y, m, n, s = 0, i;\n  scanf(\"%lf\", &q);\n  scanf(\"%s%s\", a[0], b[0]);\n  m = strlen(a[0]);\n  n = strlen(b[0]);\n  if (m != n) {\n    cout << \"error\";\n    return 0;\n  }\n  for (i = 0; i < m; i++) {\n    if (a[0][i] != 'A' && a[0][i] != 'T' && a[0][i] != 'C' && a[0][i] != 'G' ||\n        b[0][i] != 'A' && b[0][i] != 'T' && b[0][i] != 'C' && b[0][i] != 'G') {\n      printf(\"error\");\n      return 0;\n    }\n    if (a[0][i] == b[0][i]) {\n      s++;\n    }\n  }\n  z = 1.0 * s / m;\n  if (z > q) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, h, f;\n  double n, sum, k;\n  char sz[2][501];\n  scanf(\"%lf%s%s\", &n, sz[0], sz[1]);\n  sum = 0;\n  f = 1;\n  j = strlen(sz[0]);\n  h = strlen(sz[1]);\n  if (j != h) {\n    printf(\"error\\n\");\n  } else {\n    for (i = 0; i < j; i++) {\n      if ((sz[0][i] == 'A' || sz[0][i] == 'T' || sz[0][i] == 'C' ||\n           sz[0][i] == 'G') &&\n          (sz[1][i] == 'A' || sz[1][i] == 'T' || sz[1][i] == 'C' ||\n           sz[1][i] == 'G')) {\n        if (sz[0][i] == sz[1][i])\n          sum += 1.0;\n      } else {\n        printf(\"error\\n\");\n        f = 0;\n        break;\n      }\n    }\n    if (f != 0) {\n      k = sum / (j * 1.0);\n      if (k >= n)\n        printf(\"yes\\n\");\n      else {\n        printf(\"no\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, i, l, b = 0;\n  double n;\n  char B[510], A[510];\n  scanf(\"%lf\", &n);\n  scanf(\"%s\", B);\n  for (i = 0; B[i] != '\\0'; i++) {\n    if (B[i] != 'A' && B[i] != 'T' && B[i] != 'C' && B[i] != 'G') {\n      a = 1;\n    }\n  }\n  cin >> A;\n  for (i = 0; A[i] != '\\0'; i++) {\n    if (A[i] != 'A' && A[i] != 'T' && A[i] != 'C' && A[i] != 'G') {\n      a = 1;\n    }\n  }\n  if (strlen(B) != strlen(A) || a == 1) {\n    printf(\"error\");\n    return 0;\n  }\n  l = strlen(B);\n  for (i = 0; i < l; i++) {\n    if (B[i] == A[i]) {\n      b++;\n    }\n  }\n  if (1.0 * b / l > n) {\n    printf(\"yes\");\n  } else {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double p;\n  int la, i, y = 0, lb, s = 0;\n  char zfa[501], zfb[501];\n  scanf(\"%lf\", &p);\n  scanf(\"%s\", zfa);\n  scanf(\"%s\", zfb);\n  la = strlen(zfa);\n  lb = strlen(zfb);\n  if (la != lb) {\n    y = 1;\n  }\n  if (y == 0) {\n    for (i = 0; zfa[i] != '\\0' && zfb[i] != '\\0'; i++) {\n      if (((zfa[i] != 'A') && (zfa[i] != 'T') && (zfa[i] != 'C') &&\n           (zfa[i] != 'G')) ||\n          ((zfb[i] != 'A') && (zfb[i] != 'T') && (zfb[i] != 'C') &&\n           (zfb[i] != 'G'))) {\n        y = 1;\n        break;\n      }\n      if (zfa[i] == zfb[i]) {\n        s++;\n      }\n    }\n    if ((1.0 * s / la) > p && y == 0) {\n      printf(\"yes\");\n    } else if (y == 0) {\n      printf(\"no\");\n    }\n  }\n  if (y == 1) {\n    printf(\"error\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sa = 0, m = 0;\n  double x, s;\n  char a[105], b[105];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", &a, &b);\n  if (strlen(a) != strlen(b)) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < strlen(a); i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        cout << \"error\";\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      for (i = 0; i < strlen(a); i++) {\n        if (a[i] == b[i]) {\n          sa++;\n        }\n      }\n      s = 1.0 * sa / strlen(a);\n      if (s > x)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  cin >> n;\n  char s[2][510];\n  int i;\n  int j, k;\n  k = 0;\n  for (i = 0; i < 2; i++) {\n    cin >> s[i];\n  }\n  if (strlen(s[0]) != strlen(s[1])) {\n    printf(\"error\");\n    return 0;\n  } else {\n    for (j = 0; s[0][j] != '\\0'; j++) {\n      if (s[0][j] == s[1][j]) {\n        k++;\n      }\n      if ((s[0][j] != 'A' && s[0][j] != 'T' && s[0][j] != 'C' &&\n           s[0][j] != 'G') ||\n          (s[1][j] != 'A' && s[1][j] != 'T' && s[1][j] != 'C' &&\n           s[1][j] != 'G')) {\n        printf(\"error\");\n        return 0;\n      }\n    }\n  }\n  int q;\n  q = strlen(s[0]);\n  double w;\n  w = 1.0 * k / q;\n  if (w >= n) {\n    printf(\"yes\");\n  } else {\n    cout << \"no\";\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, lena, lenb, i, c;\n  char yi[501], er[501];\n  double rate, a;\n  cin >> a;\n  scanf(\"%s%s\", yi, er);\n  lena = strlen(yi);\n  lenb = strlen(er);\n  if (lenb != lena) {\n    printf(\"error\");\n  } else {\n    for (i = 0; i < lena; i++) {\n      if (yi[i] == 0) {\n        break;\n      } else if (yi[i] >= 'A' && yi[i] <= 'Z' && er[i] >= 'A' && er[i <= 'Z']) {\n        if (yi[i] == er[i]) {\n          sum++;\n        } else {\n          continue;\n        }\n      } else {\n        c = 1;\n        printf(\"error\");\n        break;\n      }\n    }\n    rate = sum * 1.0 / lena;\n    if (c != 1) {\n      if (rate > a) {\n        printf(\"yes\");\n      } else if (rate <= a) {\n        printf(\"no\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, num = 0, len1, len2, pos = 0, lea;\n  double rate;\n  char a[500], b[500];\n  scanf(\"%lf\", &rate);\n  cin >> a;\n  scanf(\"%s\", b);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  if (len1 != len2) {\n    printf(\"error\");\n  } else {\n    for (k = 0; a[k] != '\\0'; k++) {\n      if (a[k] != 'A' && a[k] != 'T' && a[k] != 'C' && a[k] != 'G') {\n        pos = 0;\n        break;\n      } else if (b[k] != 'A' && b[k] != 'T' && b[k] != 'C' && b[k] != 'G') {\n        pos = 0;\n        break;\n      } else {\n        pos = 1;\n        if (a[k] == b[k]) {\n          num++;\n        }\n      }\n    }\n    if (pos == 1) {\n      if (1.0 * num / len1 > rate)\n        printf(\"yes\");\n      else\n        printf(\"no\");\n    }\n\n    else\n      printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, i, t = 0, s, d = 1;\n  double b, x = 0.0;\n  char a[501], c[501];\n  scanf(\"%lf\", &b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  s = strlen(c);\n  if (l == s) {\n    for (i = 0; i < l; i++) {\n      if ((a[i] != 'A' && a[i] != 'G' && a[i] != 'C' && a[i] != 'T') ||\n          (c[i] != 'A' && c[i] != 'G' && c[i] != 'C' && c[i] != 'T')) {\n        d = 0;\n        break;\n      } else if (a[i] == c[i])\n        t++;\n      else\n        t = t;\n    }\n    if (d != 0) {\n      x = 1.0 * t / l;\n      if (x >= b)\n        cout << \"yes\\n\";\n      else\n        printf(\"no\\n\");\n    } else\n      printf(\"error\\n\");\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "5", "index": "9480", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n;\n  scanf(\"%lf\", &n);\n  char a[1000], b[1000];\n  int i, j, k = 0, flag = 0;\n  for (j = 0; 1; j++) {\n    scanf(\"%c\", &a[j]);\n    if (a[j] == '\\n' && j != 0) {\n      j = j - 1;\n      break;\n    }\n  }\n\n  for (i = 1; 1; i++) {\n    cin >> b[i];\n    if (b[i] == '\\n') {\n      i = i - 1;\n      break;\n    }\n  }\n\n  if (i != j)\n    flag = 1;\n  else {\n    for (i = 1; i <= j; i++) {\n      if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n          (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n        flag = 1;\n        break;\n      } else if (a[i] == b[i]) {\n        k = k + 1;\n      }\n    }\n  }\n\n  if (flag == 1)\n    printf(\"error\");\n  else {\n    if (1.0 * k / j > n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n\n  return 0;\n}\n"}
{"label": "5", "index": "9481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double n, m;\n  int i, s = 0, p, q, j;\n  char s1[501];\n  char s2[501];\n  char string[100];\n  char no[100] = {\"no\"};\n  char y[100] = {\"yes\"};\n  char e[100] = {\"error\"};\n  scanf(\"%lf \", &n);\n  scanf(\"%s\\n\", s1);\n  scanf(\"%s\\n\", s2);\n  p = strlen(s1);\n  q = strlen(s2);\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] == s2[j]) {\n        s = s + 1;\n      }\n    }\n    m = s * 1.0 / p;\n    if (m > n) {\n      strcpy(string, y);\n\n    } else {\n      strcpy(string, no);\n    }\n  } else {\n    strcpy(string, e);\n  }\n\n  if (p == q) {\n    for (j = 0; j < p; j++) {\n      if (s1[j] != 'A' && s1[j] != 'T' && s1[j] != 'C' && s1[j] != 'G' ||\n          s2[j] != 'A' && s2[j] != 'T' && s2[j] != 'C' && s2[j] != 'G') {\n        strcpy(string, e);\n      }\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "5", "index": "9482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, a, b, k;\n  k = 0;\n  a = 0;\n  b = 0;\n  double p;\n  char f[501], g[501];\n  cin >> p >> f >> g;\n  m = strlen(f);\n  n = strlen(g);\n  for (i = 0; i < m; i++) {\n    if (f[i] != 'A' && f[i] != 'T' && f[i] != 'C' && f[i] != 'G') {\n      a++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (g[i] != 'A' && g[i] != 'T' && g[i] != 'C' && g[i] != 'G') {\n      b++;\n    }\n  }\n  if (m != n || a != 0 || b != 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < m; i++) {\n      if (f[i] == g[i]) {\n        k++;\n      }\n    }\n    if (1.0 * k / m > p) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double x, y;\n  int i, t = 1, r;\n  char s1[500];\n  char s2[500];\n  scanf(\"%lf\", &x);\n  scanf(\"%s%s\", s1, s2);\n  int len1 = strlen(s1);\n  int len2 = strlen(s2);\n  if (len1 != len2) {\n    t = 0;\n  } else {\n    int cnt = 0;\n    for (i = 0; i < len1; i++) {\n      if ((!(s1[i] == 'A' || s1[i] == 'T' || s1[i] == 'C' || s1[i] == 'G')) ||\n          (!(s2[i] == 'A' || s2[i] == 'T' || s2[i] == 'C' || s2[i] == 'G'))) {\n        t = 0;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (s1[i] == s2[i]) {\n        cnt++;\n      }\n    }\n    y = 1.0 * cnt / len1;\n    if (y > x) {\n      r = 1;\n    } else {\n      r = 2;\n    }\n  }\n  if (t == 0) {\n    printf(\"error\");\n  } else if (t == 1 && r == 1) {\n    printf(\"yes\");\n  } else if (t == 1 && r == 2) {\n    printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  double n, w;\n  int i, m, z = 0, e = 0;\n  char a[600], b[600];\n  scanf(\"%lf\", &n);\n  cin >> a >> b;\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[i])\n      z++;\n    if ((a[i] != 'A' && a[i] != 'T' && a[i] != 'C' && a[i] != 'G') ||\n        (b[i] != 'A' && b[i] != 'T' && b[i] != 'C' && b[i] != 'G')) {\n      printf(\"error\");\n      e = 1;\n      break;\n    }\n  }\n  w = 1.0 * z / m;\n  if (e == 0) {\n    if (w >= n)\n      printf(\"yes\");\n    else\n      printf(\"no\");\n  }\n  return 0;\n}\n"}
{"label": "5", "index": "9485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char fir[1000];\n  char sec[1000];\n  double l1, l2;\n  int i;\n  int flag = 0;\n  double m = 0, x, n;\n\n  scanf(\"%lf\", &n);\n\n  cin >> fir;\n  scanf(\"%s\", &sec);\n  l1 = strlen(fir);\n  l2 = strlen(sec);\n\n  for (i = 0; i < l1; i++) {\n    if (fir[i] != 'A' && fir[i] != 'T' && fir[i] != 'C' && fir[i] != 'G') {\n      flag++;\n    }\n  }\n  for (i = 0; i < l2; i++) {\n    if (sec[i] != 'A' && sec[i] != 'G' && sec[i] != 'C' && sec[i] != 'T') {\n      flag++;\n    }\n  }\n  if (l1 != l2) {\n    flag++;\n  }\n\n  if (flag > 0) {\n    cout << \"error\";\n  } else {\n    for (i = 0; i < l1; i++) {\n      if (fir[i] == sec[i]) {\n        m++;\n      }\n    }\n    x = m / l1;\n    if (x > n) {\n      printf(\"yes\");\n    } else {\n      printf(\"no\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n;\n  int a[100][100] = {0}, sum = 0;\n\n  cin >> k;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", *(a + j) + l);\n    sum = 0;\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    } else {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j);\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n    }\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum[100], jz[100][100], h, l, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &jz[j][k]);\n      }\n    }\n    for (p = 0; p < l - 1; p++) {\n      sum[i] = sum[i] + jz[0][p];\n    }\n    for (q = 0; q < h - 1; q++) {\n      sum[i] = sum[i] + jz[q][l - 1];\n    }\n    for (p = l - 1; p > 0; p--)\n      sum[i] = sum[i] + jz[h - 1][p];\n\n    for (q = h - 1; q > 0; q--) {\n      sum[i] = sum[i] + jz[q][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9488", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int a, b;\n    cin >> a >> b;\n    int c[a][b];\n    int j, k;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        cin >> c[j][k];\n      }\n    }\n    int s = 0;\n    for (k = 0; k < b; k++) {\n      s += c[0][k];\n    }\n    for (j = 1; j < a; j++) {\n      s += c[j][b - 1];\n    }\n    for (k = 0; k < b - 1; k++) {\n      s += c[a - 1][k];\n    }\n    for (j = 1; j < a - 1; j++) {\n      s += c[j][0];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9489", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int time;\n  int m, n;\n  int i, j;\n  int x, y;\n  int res;\n  int r;\n  int arr[10000];\n  scanf(\"%d\", &time);\n  for (i = 0; i < time; i++) {\n    res = 0;\n    scanf(\"%d %d\", &m, &n);\n    \n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", &r);\n      \n      arr[j] = r;\n    }\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        if ((x == 0) || (x == (m - 1)))\n          res += arr[x * n + y];\n        if ((y == 0) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n        if ((y == (n - 1)) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, *p;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    int j, sum = 0;\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      if (j < n || (j < n * m && j >= (m - 1) * n) || j % n == 0 ||\n          (j + 1) % n == 0)\n        sum += *(p + j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], sum, p, q;\n  int i, j, h;\n  scanf(\"%d \", &k);\n  for (h = 1; h <= k; h++) {\n    cin >> m >> n;\n    p = 0;\n    q = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n        p = p + a[i][j];\n      }\n    }\n    for (i = 2; i < m; i++) {\n      for (j = 2; j < n; j++)\n        q = q + a[i][j];\n    }\n    sum = p - q;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], i, j, m, n, k, max;\n  int *pa;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 1; j <= m * n; j++)\n      cin >> a[j - 1];\n    pa = a;\n    if ((m >= 2) && (n >= 2)) {\n      for (j = 1; j < n; j++)\n        *pa += a[j];\n      for (j = m * n - n; j < m * n; j++)\n        *pa += a[j];\n      for (j = n; j < m * n - n; j++)\n        if ((j % n == 0) || (j % n == n - 1))\n          *pa += a[j];\n    } else {\n      for (j = 1; j < m * n; j++)\n        *pa += a[j];\n    }\n    printf(\"%d\\n\", *pa);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9493", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n\n  for (int t = 1; t <= k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int q = 0; q < m; q++) {\n      for (int p = 0; p < n; p++) {\n        cin >> a[q][p];\n      }\n    }\n    int col = 0, row = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    row = m - 1;\n    col = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n\n    col = n - 1;\n    row = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    s = s - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d \", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9494", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int k, m[100], n[100], i, j, t, s[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (t = 0; t < n[i]; t++)\n        scanf(\"%d \", &a[i][j][t]);\n    for (t = 0; t < n[i]; t++)\n      s[i] += (a[i][0][t] + a[i][m[i] - 1][t]);\n    for (j = 0; j < m[i]; j++)\n      s[i] += (a[i][j][0] + a[i][j][n[i] - 1]);\n    s[i] = s[i] - a[i][0][0] - a[i][0][n[i] - 1] - a[i][m[i] - 1][0] -\n           a[i][m[i] - 1][n[i] - 1];\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "9495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  int a[100000];\n  for (int i = 0; i < b; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n    for (int k = 0; k < m; k++) {\n      for (int p = 0; p < n; p++) {\n        cin >> (sz[k][p]);\n      }\n    }\n    if (m * n != 1) {\n      for (int o = 0; o < n; o++) {\n        a[i] = a[i] + sz[0][o] + sz[m - 1][o];\n      }\n      for (int q = 0; q < m; q++)\n        a[i] = a[i] + sz[q][0] + sz[q][n - 1];\n\n      a[i] = a[i] - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n      printf(\"%d\\n\", a[i]);\n    } else {\n      printf(\"%d\", sz[0][0]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int c, i, j;\n  int m, n, k;\n  cin >> k;\n  for (c = 1; c <= k; c++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    int sum, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    for (i = 1; i <= m; i++) {\n      sum1 = sum1 + a[i][1];\n      sum2 = sum2 + a[i][n];\n    }\n    for (j = 1; j <= n; j++) {\n      sum3 = sum3 + a[1][j];\n      sum4 = sum4 + a[m][j];\n    }\n    sum = sum1 + sum2 + sum3 + sum4 - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, number[100][100], num, *p = NULL;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> number[j][l];\n    }\n    num = 0;\n    p = *number;\n    for (j = 0; j < n; j++) \n    {\n      if (m == 1) {\n        num += *(p + j); \n      } else {\n        num = num + *(p + j) + *(*(number + m - 1) + j);\n      }\n    }\n    p = *number;\n    for (j = 1; j < m - 1; j++) \n    {\n      if (n == 1) {\n        num += **(number + j);\n      } else {\n        num = num + **(number + j) + *(*(number + j) + n - 1);\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100] = {0};\n  int *p, i1, i2, sum = 0;\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i1 = 0; i1 < m; i1++) {\n      p = a[i1];\n      for (i2 = 0; i2 < n; i2++) {\n        scanf(\"%d\", p);\n        sum = sum + *p;\n        p++;\n      }\n    }\n    for (i1 = 1; i1 < m - 1; i1++) {\n      p = a[i1];\n      p++;\n      for (i2 = 1; i2 < n - 1; i2++) {\n        sum = sum - *p;\n        p++;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9499", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, j, a, b, s[100] = {0}, f[100][100];\n  int *p = NULL;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> f[j][k];\n    for (j = 0; j < a; j++) {\n      p = f[j];\n      s[i] += *p;\n      p = f[j] + b - 1;\n      s[i] += *p;\n    }\n    for (k = 1; k < b - 1; k++) {\n      p = f[0] + k;\n      s[i] += *p;\n      p = f[a - 1] + k;\n      s[i] += *p;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", s[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "9500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k, sum = 0;\n  cin >> k;\n\n  while (k > 0) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, n, x, sum, a[100][105][105];\n  scanf(\"%d\", &x);\n  for (i = 1; i <= x; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    for (t = 1; t <= n; t++) {\n      if (m != 1)\n        sum = sum + a[i][1][t] + a[i][m][t];\n      if (m == 1)\n        sum = sum + a[i][1][t];\n    }\n    for (t = 2; t <= m - 1; t++) {\n      if (n != 1)\n        sum = sum + a[i][t][1] + a[i][t][n];\n      if (n == 1)\n        sum = sum + a[i][t][1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, l, S = 0;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (l = 0; l <= n - 1; l++) {\n        cin >> a[j][l];\n        if (j == 0 || j == m - 1 || l == 0 || l == n - 1) {\n          S = S + a[j][l];\n        }\n      }\n    }\n    if (i < k) {\n      cout << S << '\\n';\n    } else {\n      cout << S;\n    }\n    S = 0;\n  }\n}\n"}
{"label": "6", "index": "9503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int a[m][n];\n    s = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &(a[j][l]));\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < n; j++) {\n        s += a[0][j];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += a[j][0];\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        s = s + a[0][j] + a[m - 1][j];\n      }\n      for (j = 0; j < m; j++) {\n        s = s + a[j][0] + a[j][n - 1];\n      }\n      s = s - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int n, sum, row, col;\n  int *point;\n  point = *array;\n  cin >> n;\n  for (; n > 0; n--) {\n    sum = 0;\n    cin >> row >> col;\n    for (point = *array; point < *array + row * col; point++)\n      cin >> *point;\n    point = *array;\n    for (; point < *array + col; point++)\n      sum = sum + *point;\n\n    point--;\n    for (point = point + col; point < *array + row * col; point = point + col) {\n      sum = sum + *point;\n    }\n    point -= col;\n    for (point = point - 1; point >= *array + (row - 1) * col; point--)\n      sum = sum + *point;\n    point++;\n    for (point = point - col; point > *array; point = point - col)\n      sum = sum + *point;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *a, *b, *c, *d;\n  int i, j, n, m, k;\n  a = (int *)calloc(1000000, sizeof(int));\n  b = (int *)calloc(10, sizeof(int));\n  scanf(\"%d\", &k);\n  c = a;\n  d = b;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (j = 0; j < n * m; j++)\n      scanf(\"%d\", c + j);\n    for (j = 0; j < m; j++)\n      sum += *(c + j);\n    for (j = m * (n - 1); j < n * m; j++)\n      sum += *(c + j);\n    for (j = m; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    for (j = m + m - 1; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    *(d++) = sum;\n  }\n  for (d = b; d < b + k; d++) {\n    cout << *d;\n    printf(\"\\n\");\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "6", "index": "9506", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, p, q;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    int sum = 0;\n    if (m <= 2 || n <= 2) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum = sum + a[p][q];\n        }\n      }\n      cout << sum << endl;\n    } else {\n      int sum1 = 0, sum2 = 0;\n      sum = 0;\n      for (p = 0; p < m; p++) {\n        sum1 = a[p][0] + a[p][n - 1] + sum1;\n      }\n      for (q = 0; q < n; q++) {\n        sum2 = sum2 + a[0][q] + a[m - 1][q];\n      }\n      sum =\n          sum1 + sum2 - (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, n, m, sum = 0, i, j, k, a[101][101];\n  cin >> l;\n  for (i = 1; i <= l; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    if (m != 1 && n != 1) {\n      for (k = 1; k <= n; k++)\n        sum += a[1][k];\n      for (k = 1; k <= n; k++)\n        sum += a[m][k];\n      for (k = 2; k < m; k++)\n        sum += a[k][1];\n      for (k = 2; k < m; k++)\n        sum += a[k][n];\n      cout << sum << endl;\n    } else {\n      for (j = 1; j <= m; j++)\n        for (k = 1; k <= n; k++)\n          sum += a[j][k];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zong;\n  int sz[100][100], m, n, k, i, j, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0,\n                                   sum = 0;\n  scanf(\"%d\", &zong);\n  for (k = 0; k < zong; k++) {\n    int sum = 0;\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[0][i]);\n      sum1 += sz[0][i];\n    }\n    \n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[n - 1][i]);\n      sum2 += sz[n - 1][i];\n    }\n    \n    for (i = 1; i < n - 1; i++) {\n      sum3 += sz[i][0];\n    }\n    \n    for (i = 1; i < n - 1; i++) {\n      sum4 += sz[i][m - 1];\n    }\n    \n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, i, j;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, o = 0, i = 0, j = 0, m = 0, n = 0, num = 0, sum = 0;\n  cin >> k;\n  for (o = 0; o < k; o++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &num);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum = sum + num;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    int data[100][100];\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &data[i][j]);\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + data[i][0] + data[i][n - 1];\n    for (i = 1; i < n - 1; i++)\n      sum = sum + data[0][i] + data[m - 1][i];\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  scanf(\"%d \", &k);\n  int u;\n  for (u = 1; u <= k; u++) {\n    int i, j;\n    scanf(\"%d %d \", &m, &n);\n    int input[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> input[i][j];\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      sum += input[i][0] + input[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum += input[0][j] + input[m - 1][j];\n    }\n    sum = sum - input[0][0] - input[0][n - 1] - input[m - 1][0] -\n          input[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9513", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, sum;\n  int m;\n  int a[200][220];\n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    sum = 0;\n    int row, col;\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    for (i = 1; i <= row; i++) {\n      sum = sum + a[i][1] + a[i][col];\n    }\n\n    for (j = 2; j <= col - 1; j++) {\n      sum = sum + a[1][j] + a[row][j];\n    }\n\n    if (row == 1)\n      sum /= 2;\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, c;\n  int a[100][100];\n  int b[100] = {0};\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          b[c] += a[i][j];\n        } else {\n          if (j == 0 || j == n - 1) {\n            b[c] += a[i][j];\n          }\n        }\n      }\n    }\n  }\n  for (c = 0; c < k; c++) {\n    printf(\"%d\\n\", b[c]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, a, b, m, n, k, i, j;\n  int num[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (a = 0; a < 100; a++) {\n      for (b = 0; b < 100; b++)\n        num[a][b] = 0;\n    }\n    scanf(\"%d %d\", &m, &k);\n    if (m == 1 && k == 1) {\n      scanf(\"%d\", &j);\n      printf(\"%d\", j);\n    } else if (m == 1 && k != 1) {\n      for (a = 0; a < k; a++) {\n        scanf(\"%d\", &num[0][a]);\n        sum = sum + num[0][a];\n      }\n      cout << sum;\n    } else if (m != 1 && k == 1) {\n      for (a = 0; a < m; a++) {\n        scanf(\"%d\", &num[a][0]);\n        sum = sum + num[a][0];\n      }\n      printf(\"%d\", sum);\n    } else {\n      for (a = 0; a < m; a++) {\n        for (b = 0; b < k; b++)\n          scanf(\"%d\", &num[a][b]);\n      }\n      for (a = 0; a < k; a++) {\n        sum = sum + num[0][a] + num[m - 1][a];\n      }\n      for (a = 1; a < (m - 1); a++) {\n        sum = sum + num[a][0] + num[a][k - 1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n}\n"}
{"label": "6", "index": "9516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, p, q, a[100][100], i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    int total = 0;\n    scanf(\"%d %d \", &p, &q);\n    for (j = 0; j < p; j++)\n      for (k = 0; k < q; k++) {\n        cin >> a[j][k];\n      }\n    for (int h = 0; h < q; h++) {\n      total += *(*a + h);\n      total += *(*(a + p - 1) + h);\n    }\n    for (int g = 0; g < p; g++) {\n      total += **(a + g);\n      total += *(*(a + g) + q - 1);\n    }\n    total -= **a;\n    total -= *(*a + q - 1);\n    total -= **(a + p - 1);\n    total -= *(*(a + p - 1) + q - 1);\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int m, int n) {\n  int a[m][n], i, j, t = 0;\n  if (m == 1 || n == 1)\n    for (i = 0; i < m + n - 1; i++) {\n      scanf(\"%d\", &j);\n      t += j;\n    }\n\n  else {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < m; i++)\n      t += a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      t += a[0][j] + a[m - 1][j];\n  }\n  return t;\n}\nint main() {\n  int m, n, q;\n  for (scanf(\"%d\", &q); q > 0; q--) {\n    scanf(\"%d%d\", &m, &n);\n    printf(\"%d\\n\", sum(m, n));\n  }\n}\n"}
{"label": "6", "index": "9518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, k, i, j, row, col;\n  int sx_row, sx_col, s;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    cin >> row >> col;\n    int sz[100][100];\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    sx_row = row - 1;\n    sx_col = col - 1;\n    for (j = 0; j < sx_col; j++) {\n      s = s + sz[0][j];\n    }\n    for (i = 0; i < sx_row; i++) {\n      s = s + sz[i][sx_col];\n    }\n    for (j = sx_col; j > 0; j--) {\n      s = s + sz[sx_row][j];\n    }\n    for (i = sx_row; i > 0; i--) {\n      s = s + sz[i][0];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, row, col, j, k, sum;\n  cin >> n;\n  cin.get();\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    row = 0;\n    col = 0;\n    int a[103][103] = {0};\n    cin >> row >> col;\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        cin >> *(*(a + j) + k); \n    if ((row == 1) && (col == 1))\n      cout << **a << endl;\n    else {\n      for (k = 0; k < col; k++)\n        sum = sum + *(*a + k); \n      for (k = 0; k < col; k++)\n        sum = sum + *(*(a + row - 1) + k);\n      for (j = 0; j < row; j++)\n        sum = sum + **(a + j);\n      for (j = 0; j < row; j++)\n        sum = sum + *(*(a + j) + col - 1);\n      sum = sum - **a;\n      sum = sum - *(*(a + row - 1));\n      sum = sum - *(*a + col - 1);\n      sum = sum - *(*(a + row - 1) + col - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[200], n[200], i, t, j, a[200][200], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (t = 1; t <= m[i]; t++) {\n      for (j = 1; j <= n[i]; j++) {\n        scanf(\"%d\", &a[t][j]);\n      }\n    }\n\n    if (m[i] == 1 && n[i] == 1)\n      printf(\"%d\", a[1][1]);\n    else {\n\n      sum = 0;\n\n      for (t = 1; t <= n[i]; t++) {\n        sum = sum + a[1][t];\n      }\n\n      for (j = 1; j <= n[i]; j++) {\n        sum = sum + a[m[i]][j];\n      }\n\n      for (t = 1; t <= m[i]; t++) {\n        sum = sum + a[t][1];\n      }\n\n      for (j = 1; j <= m[i]; j++) {\n        sum = sum + a[j][n[i]];\n      }\n\n      sum = sum - a[1][1] - a[1][n[i]] - a[m[i]][n[i]] - a[m[i]][1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9521", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, j, a, b, s[100] = {0}, f[100][100];\n  int *p = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> f[j][k];\n    for (j = 0; j < a; j++) {\n      p = f[j];\n      s[i] += *p;\n      p = f[j] + b - 1;\n      s[i] += *p;\n    }\n    for (k = 1; k < b - 1; k++) {\n      p = f[0] + k;\n      s[i] += *p;\n      p = f[a - 1] + k;\n      s[i] += *p;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << s[i] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "9522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[10000], i, k, a, b, n, s = 0;\n  int *p, *q;\n  p = c;\n  q = p;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    p = c;\n    q = p;\n    s = 0;\n    cin >> b >> a;\n\n    for (i = 0; i < a * b; i++) {\n\n      scanf(\"%d\", &*p);\n      p++;\n    }\n    p = q;\n    for (i = 0; i < a; i++) {\n      s = s + *p;\n      p++;\n    }\n    p = q;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    p = q + a - 1;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    if (b != 1) {\n      p = q + a * (b - 1);\n      for (i = 0; i < a; i++) {\n\n        s = s + *p;\n        p = p + 1;\n      }\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9523", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, m, n;\nint arr[105][105];\n\nint main() {\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> arr[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += arr[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    int a[m][n];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      printf(\"%d\\n\", sum);\n      continue;\n    }\n    if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += *(*(a + i));\n      cout << sum << endl;\n      continue;\n    }\n    for (i = 0; i < n; i++) {\n      sum += *(*(a) + i);\n      sum += *(*(a + m - 1) + i);\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum += *(*(a + i));\n      sum += *(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint haha() {\n  int m, n, sum, i, j, a[105][105];\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &*(*(a + i) + j));\n\n  sum = 0;\n\n  if (m == 1)\n    for (j = 1; j <= n; j++) {\n      sum = sum + *(*(a + 1) + j);\n    }\n  else if (n == 1)\n    for (i = 1; i <= m; i++)\n      sum = sum + *(*(a + i) + 1);\n  else {\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + m) + j);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + 1);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + n);\n  }\n\n  return (sum);\n}\nint main() {\n  int i, j, k, l, m, n, a[1050];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    *(a + i) = haha();\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", *(a + i));\n  return 0;\n}\n"}
{"label": "6", "index": "9526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[10000], *p = a, *q = a, n, h, l, i, j, sum = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    p = a;\n    q = a;\n    scanf(\"%d %d\", &h, &l);\n\n    for (j = 1; j <= h * l; j++) {\n      scanf(\"%d\", p++);\n    }\n    if (h == 1) {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n      }\n    } else if (l == 1) {\n      sum += *q;\n      sum += *(q + h - 1);\n    } else {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n        sum += *(q + h * l - j - 1);\n      }\n      for (j = 1; j <= h - 2; j++) {\n        sum += *(q + j * l);\n        sum += *(q + j * l + l - 1);\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9527", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, *p;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    int sum = 0;\n    int a[100][100] = {0};\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    p = a[0];\n    for (int j = 0; j < n; j++)\n      sum += *p++;\n    if (m - 1 != 0) {\n      p = a[m - 1];\n      for (int j = 0; j < n; j++)\n        sum += *p++;\n    }\n    for (int j = 1; j < m - 1; j++) {\n      p = a[j];\n\n      sum += *p;\n      sum += *(p + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9528", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i = 1, j, a[101][101], s, k;\n  int sum1, sum2, sum3, sum4, sum;\n  cin >> s;\n  while (i <= s) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m;\n    cin >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (j = 0; j < n; j++)\n      sum1 += a[0][j];\n    for (j = 0; j < n; j++)\n      sum2 += a[m - 1][j];\n    for (j = 0; j < m; j++)\n      sum3 += a[j][0];\n    for (j = 0; j < m; j++)\n      sum4 += a[j][n - 1];\n    sum = sum1 + sum2 + sum3 + sum4;\n    cout << sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1] << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, h1, l1, k, h, l, a[100][100], sum[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (h1 = 1; h1 <= h; h1++)\n      for (l1 = 1; l1 <= l; l1++)\n        scanf(\"%d\", &a[h1][l1]);\n\n    for (h1 = 1; h1 <= h; h1++)\n      sum[i] += a[h1][1] + a[h1][l];\n    for (l1 = 2; l1 <= l - 1; l1++)\n      sum[i] += a[1][l1] + a[h][l1];\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "9530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, i, j, k, s = 0;\n  int m, n, a[100][100];\n  scanf(\"%d \", &x);\n  for (i = 1; i <= x; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n        if (j == 0 || j == m - 1 || (k == 0 && j != 0 && j != m - 1) ||\n            (k == n - 1 && j != 0 && j != m - 1))\n          s = s + a[j][k];\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (int a = 0; a < m; a++) {\n      for (int b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    int s = 0, p = 0, q = 0, r = 0;\n    int sum = 0;\n    if (m >= 3 && n >= 3) {\n      for (int a = 0; a < m; a++) {\n        s = s + sz[a][0];\n        p = p + sz[a][n - 1];\n      }\n      for (int b = 1; b < n - 1; b++) {\n        q = q + sz[0][b];\n        r = r + sz[m - 1][b];\n      }\n      sum = r + s + p + q;\n    } else {\n\n      for (int a = 0; a < m; a++) {\n        for (int b = 0; b < n; b++) {\n          sum = sum + sz[a][b];\n        }\n      }\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int j, n, k, i, m, l, sum;\n\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", (&sz[i][j]));\n      }\n    }\n    i = 0;\n    for (j = 0; j < n; j++)\n      sum += sz[0][j];\n\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      sum += sz[m - 1][j];\n    }\n    j = 0;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][n - 1];\n    }\n\n    printf(\"%d \", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (t = 1; t <= n; t++) {\n        scanf(\"%d \", &a[j][t]);\n      }\n    }\n    if (m == 1 && n == 1)\n      sum = a[1][1];\n    else\n      for (j = 1; j <= m; j++) {\n        sum = sum + a[j][1];\n        sum = sum + a[j][n];\n      }\n    for (t = 2; t < n; t++) {\n      sum = sum + a[1][t];\n      sum = sum + a[m][t];\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fy();\n  int num, k;\n  scanf(\"%d\", &num);\n  for (k = 0; k < num; k++) {\n    printf(\"%d\\n\", fy());\n  }\n  return 0;\n}\nint fy() {\n  int a[100][100];\n  int sum = 0, m, n, i, j;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", *(a + i));\n    sum = sum + *(*(a + i));\n    for (j = 1; j < n; j++)\n      scanf(\" %d\", *(a + i) + j);\n\n    sum = sum + *(*(a + i) + n - 1);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum = sum + a[0][i] + a[m - 1][i];\n  }\n  return sum;\n}\n"}
{"label": "6", "index": "9535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m() {\n  int m, n, a[10000], i, j, s = 0;\n  int *p;\n  p = a;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m * n; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 0; i < m; i++) {\n    if (i == 0 || i == m - 1) {\n      for (j = 0; j < n; j++) {\n        s = s + *(p + i * n + j);\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        if (j == 0 || j == n - 1)\n          s = s + *(p + i * n + j);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int k, i, sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = m();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int a[][100], int m, int n) {\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + j) + i);\n}\nint main() {\n  int square[100][100];\n  int k, m, n;\n  cin >> k;\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    input(square, m, n);\n    int sum = 0;\n    for (int j = 0; j < m; j++) {\n      sum = sum + *(*square + j) + *(*(square + n - 1) + j);\n    }\n    for (int j = 1; j < n - 1; j++)\n      sum = sum + **(square + j) + *(*(square + j) + m - 1);\n    if (m == 1)\n      sum = sum / 2;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[10001];\n  int *p;\n  int i, j, k;\n  int b, c;\n  int s = 0;\n  p = &a[0];\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d %d\", &b, &c);\n\n    for (k = 1; k <= b; k++) {\n      for (i = 1; i <= c; i++) {\n        scanf(\"%d\", p);\n        if ((k == 1 && i != 1 && i != c) || (k == b && i != 1 && i != c) ||\n            i == 1 || i == c)\n          s = s + *p;\n\n        p++;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    p = &a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, sum, m, n, k;\n  int a[1000][1000];\n  scanf(\"%d \", &k);\n  while (k--) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9539", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum = 0, i, j, p;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m == 1) {\n      cout << a[0][0] << endl;\n    } else if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      cout << sum << endl;\n      sum = 0;\n    } else if (n > 1 && m == 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      cout << sum << endl;\n      sum = 0;\n    } else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[101][101];\n  int(*p)[101];\n  int i, j, sum = 0;\n  p = a;\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++) \n      for (j = 0; j < col; j++)\n        cin >> *(*(p + i) + j);\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = **p; \n    else {\n      for (i = 0; i < col; i++) \n      {\n        sum += *(*p + i);\n        if (row > 1)\n          sum += *(*(p + row - 1) + i);\n      }\n      for (i = 1; i <= row - 2; i++) \n      {\n        sum += *(*(p + i));\n        if (col > 1)\n          sum += *(*(p + i) + col - 1);\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "9541", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100][100];\n  int k, i, g, t, r;\n  int s[100];\n  int z[100];\n  scanf(\"%d \", &k);\n  for (g = 0; g <= k - 1; g++) {\n    cin >> s[g] >> z[g];\n    for (i = 0; i <= s[g] - 1; i++) {\n      for (t = 0; t <= z[g] - 1; t++) {\n        scanf(\"%d\", &sz[g][i][t]);\n      }\n    }\n  }\n\n  for (g = 0; g <= k - 1; g++) {\n    if (s[g] >= 3 && z[g] >= 3) {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        r = r + sz[g][i][0] + sz[g][i][z[g] - 1];\n      }\n      for (t = 1; t <= z[g] - 2; t++) {\n        r = r + sz[g][0][t] + sz[g][s[g] - 1][t];\n      }\n      printf(\"%d\\n\", r);\n    } else {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        for (t = 0; t <= z[g] - 1; t++) {\n          r = r + sz[g][i][t];\n        }\n      }\n      printf(\"%d\\n\", r);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, shuzu[100][100], hang = 0, lie = 0, zu = 0, sum = 0;\n  scanf(\"%d\", &zu);\n  for (i = 0; i < zu; i++) {\n    scanf(\"%d%d\", &hang, &lie);\n    sum = 0;\n    for (j = 0; j < hang; j++) {\n      for (k = 0; k < lie; k++) {\n        scanf(\"%d\", &shuzu[j][k]);\n      }\n    }\n    for (k = 0; k < lie; k++) {\n      sum = sum + shuzu[0][k];\n    }\n    if (hang > 1) {\n      for (k = 0; k < lie; k++) {\n        sum = sum + shuzu[hang - 1][k];\n      }\n    }\n    if (hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][0];\n      }\n    }\n    if (lie > 1 && hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][lie - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, p, ans = 0;\n  int m[100], n[100];\n  int r[100][100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (p = 0; p < n[i]; p++)\n        scanf(\"%d\", &r[i][j][p]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    ans = 0;\n    for (i = 0; i < n[p]; i++) {\n      for (j = 0; j < m[p]; j++) {\n        if ((i == 0) || (i == n[p] - 1) || (j == 0) || (j == m[p] - 1))\n          ans += r[p][j][i];\n        else {\n          continue;\n        }\n      }\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int *p, int m, int n) {\n  int row, col, temp, sum = 0;\n  for (row = 1; row < m + 1; row++) {\n    for (col = 1; col < n + 1; col++) {\n      if (row == 1 || row == m || col == 1 || col == n) {\n        temp = *(p + n * (row - 1) + col);\n        sum += temp;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, m, n, i, s, row, col;\n  int *p;\n  p = (int *)malloc(sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (row = 1; row < m + 1; row++) {\n      for (col = 1; col < n + 1; col++)\n        scanf(\"%d\", p + n * (row - 1) + col);\n    }\n    s = f(p, m, n);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, q, s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n  for (q = 0; q < k; q++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n\n    for (i = 0; i < n; i++)\n      s = s + *(*(a + 0) + i);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + n - 1);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + 0);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(a + m - 1) + i);\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, j, z, s;\n  cin >> k;\n  for (z = 1; z <= k; z++) {\n    s = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          s = s + a[i][j];\n    } else {\n      for (i = 0; i < n; i++)\n        s = s + *(*a + i) + *(*(a + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        s = s + *(*(a + i)) + *(*(a + i) + n - 1);\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, l, m, n, i, j, sum = 0;\n  int array[100][100];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          cin >> array[i][j];\n          sum += array[i][j];\n        }\n      }\n      cout << sum << endl;\n      break;\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      cin >> array[0][j];\n      sum += array[0][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &array[i][j]);\n      }\n      sum = sum + array[i][0] + array[i][j - 1];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      cin >> array[m - 1][j];\n      sum += array[m - 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int K, M, N, sz[99][99];\n  scanf(\"%d\", &K);\n  for (int k = 1; k <= K; k++) {\n    int result = 0;\n    scanf(\"%d %d\", &M, &N);\n    for (int m = 0; m < M; m++)\n      for (int n = 0; n < N; n++)\n        scanf(\"%d\", &sz[m][n]);\n    if (M <= 2 || N <= 2) {\n      for (int m = 0; m < M; m++) {\n        for (int n = 0; n < N; n++)\n          result += sz[m][n];\n      }\n    } else {\n      for (int n = 0; n < N; n++)\n        result += sz[0][n];\n      for (int n = 0; n < N; n++)\n        result += sz[M - 1][n];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][0];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][N - 1];\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9549", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, m, n, a, b, sz[1000][1000], s = 0;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s += (sz[0][b] + sz[m - 1][b]);\n    }\n    for (a = 0; a < m; a++) {\n      s += (sz[a][0] + sz[a][n - 1]);\n    }\n    s -= (sz[0][0] + sz[m - 1][0] + sz[0][n - 1] + sz[m - 1][n - 1]);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid function_1() {\n  int a[110][110], (*p)[110];\n  int n, m, i, sum = 0, j;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  }\n  p = a;\n  for (i = 0; i < m; i++) {\n    sum += *(*p + i);\n    if (n > 1)\n      sum += *(*(p + n - 1) + i);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum += **(p + i);\n    if (m > 1)\n      sum += *(*(p + i) + m - 1);\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1();\n  return 0;\n}\n"}
{"label": "6", "index": "9551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n[1000], m[1000], a, b, c, s[100][100], x[1000];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m[a], &n[a]);\n    for (b = 0; b < m[a]; b++) {\n      for (c = 0; c < n[a]; c++) {\n        scanf(\"%d\", &s[b][c]);\n      }\n    }\n    x[a] = 0;\n    for (c = 0; c < n[a]; c++) {\n      if (m[a] > 1) {\n        x[a] = x[a] + s[0][c] + s[m[a] - 1][c];\n      } else {\n        x[a] = x[a] + s[0][c];\n      }\n    }\n    if (m[a] > 2) {\n      if (n[a] > 1) {\n        for (b = 1; b < m[a] - 1; b++) {\n          x[a] = x[a] + s[b][0] + s[b][n[a] - 1];\n        }\n      } else\n        x[a] = x[a] + s[b][0];\n    }\n    printf(\"%d\\n\", x[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, m, n, a, b, s[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n      }\n    }\n    s[i] = 0;\n    for (b = 0; b < n; b++) {\n      s[i] += sz[0][b];\n    }\n    for (a = 1; a < m; a++) {\n      s[i] += sz[a][n - 1];\n    }\n    for (b = n - 2; b >= 0; b--) {\n      s[i] += sz[m - 1][b];\n    }\n    for (a = m - 2; a >= 1; a--) {\n      s[i] += sz[a][0];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << s[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9553", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, sz[100][100], m, n, p, i, j, s[100] = {0};\n  cin >> k;\n  for (p = 0; p < k; p++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> (sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      s[p] = sz[0][0];\n    } else {\n      for (j = 0; j < n; j++) {\n        s[p] = s[p] + sz[0][j] + sz[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        s[p] = s[p] + sz[i][0] + sz[i][n - 1];\n      }\n      s[p] = s[p] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n  }\n  for (p = 0; p < k; p++) {\n    printf(\"%d\\n\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint calcSum(int *matrix, int row, int col);\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *result = (int *)malloc(k * sizeof(int));\n  int i = 0;\n  int row, col;\n  int sum;\n  int m, n;\n  int *matrix;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    matrix = (int *)malloc(m * n * sizeof(int));\n    for (row = 0; row < m; row++)\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", matrix + row * n + col);\n    *(result + i) = calcSum(matrix, m, n);\n    free(matrix);\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << *(result + i) << \"\\n\";\n\n  cout << *(result + i);\n  return 0;\n}\n\nint calcSum(int *matrix, int row, int col) {\n  int sum = 0;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      if (i == 0 || i == row - 1 || j == 0 || j == col - 1)\n        sum += *(matrix + i * col + j);\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "9555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int tol, i, j, sum, k, x[100][100], row, line;\n  scanf(\"%d\", &tol);\n  for (k = 0, sum = 0; k < tol; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &line);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++)\n        cin >> x[i][j];\n    }\n    if (line == 1) {\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n      }\n    } else {\n\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n        sum += x[i][line - 1];\n      }\n    }\n    if (row == 1) {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n      }\n    } else {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n        sum += x[row - 1][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9556", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, x, y, ans, a[101][101];\n  int(*p)[101] = a;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    ans = 0;\n    cin >> m >> n;\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        cin >> *((*p + y) + x);\n        if (x == 0 || y == 0 || x == m - 1 || y == n - 1)\n          ans = ans + *((*p + y) + x);\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, j, z, s;\n  cin >> k;\n  for (z = 1; z <= k; z++) {\n    s = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          s = s + a[i][j];\n    } else {\n      for (i = 0; i < n; i++)\n        s = s + *(*a + i) + *(*(a + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        s = s + *(*(a + i)) + *(*(a + i) + n - 1);\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum[100], jz[100][100], h, l, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &jz[j][k]);\n      }\n    }\n    for (p = 0; p < l - 1; p++) {\n      sum[i] = sum[i] + jz[0][p];\n    }\n    for (q = 0; q < h - 1; q++) {\n      sum[i] = sum[i] + jz[q][l - 1];\n    }\n    for (p = l - 1; p > 0; p--) {\n      sum[i] = sum[i] + jz[h - 1][p];\n    }\n    for (q = h - 1; q > 0; q--) {\n      sum[i] = sum[i] + jz[q][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[105][105] = {0}, n = 0, row = 0, col = 0, i = 0, j = 0, *p = NULL,\n      sum = 0;\n  cin >> n;\n  while (n--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = &a[0][0]; p < &a[0][0] + col; p++) {\n      sum = sum + *p;\n    }\n    for (i = 1; i < row - 1; i++) {\n      sum = sum + a[i][0] + a[i][col - 1];\n    }\n    if (row > 1) {\n      for (p = &a[row - 1][0]; p < &a[row - 1][0] + col; p++) {\n        sum = sum + *p;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n, i, j, l, sum1 = 0, sum = 0;\n  int a[100][100];\n\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n        sum = sum + *(*(p + i) + j);\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++) {\n        sum1 = sum1 + *(*(p + i) + j);\n      }\n\n    sum = sum - sum1;\n    cout << sum << \"\\n\";\n    sum = sum1 = 0;\n  }\n}\n"}
{"label": "6", "index": "9561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, l, j;\n  int sz[1000][1000];\n  int jh[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    jh[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    for (k = 0; k < l; k++) {\n      jh[i] += sz[0][k];\n      jh[i] += sz[h - 1][k];\n    }\n    for (j = 1; j < h - 1; j++) {\n      jh[i] += sz[j][0];\n      jh[i] += sz[j][l - 1];\n    }\n    if (h == 1 && l == 1) {\n      jh[i] -= sz[0][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << jh[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = m - 1, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = 0, j = 0; i < m; i++)\n      sum = sum + a[i][j];\n    for (i = 0, j = n - 1; i < m; i++)\n      sum = sum + a[i][j];\n    sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9563", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int c1, c2, d, i, x = 0, k, m, n;\n  int sum[1000];\n  int a[1000][1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < 1000; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (c1 = 0; c1 < m; c1++) {\n      for (c2 = 0; c2 < n; c2++) {\n        scanf(\"%d\", &a[c1][c2]);\n      }\n    }\n    for (d = 0; d < m; d++) {\n      sum[x] += a[d][0] + a[d][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      sum[x] += a[0][d] + a[m - 1][d];\n    }\n    x++;\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9564", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    int a[m][n];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      printf(\"%d\\n\", sum);\n      continue;\n    }\n    if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += *(*(a + i));\n      printf(\"%d\\n\", sum);\n      continue;\n    }\n    for (i = 0; i < n; i++) {\n      sum += *(*(a) + i);\n      sum += *(*(a + m - 1) + i);\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum += *(*(a + i));\n      sum += *(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9565", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (int a = 0; a < m; a++) {\n      for (int b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    int s = 0, p = 0, q = 0, r = 0;\n    int sum = 0;\n    if (m >= 3 && n >= 3) {\n      for (int a = 0; a < m; a++) {\n        s = s + sz[a][0];\n        p = p + sz[a][n - 1];\n      }\n      for (int b = 1; b < n - 1; b++) {\n        q = q + sz[0][b];\n        r = r + sz[m - 1][b];\n      }\n      sum = r + s + p + q;\n    } else {\n\n      for (int a = 0; a < m; a++) {\n        for (int b = 0; b < n; b++) {\n          sum = sum + sz[a][b];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, N, i, j, a, b, sum = 0;\n  int data[1000][1000];\n  scanf(\"%d\", &N);\n  for (n = 0; n < N; n++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", &data[i][j]);\n      }\n    }\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += data[i][j];\n      }\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9567", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, b[101][101], sum[1000];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> b[i][j];\n      }\n    }\n\n    sum[l] = 0;\n    for (j = 1; j <= n; j++)\n      sum[l] += b[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += b[m][j];\n    for (i = 2; i < m; i++) {\n      sum[l] += b[i][1];\n    }\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][n];\n  }\n  if (k == 1)\n    cout << sum[1];\n  else {\n    printf(\"%d\", sum[1]);\n    for (l = 2; l <= k; l++) {\n      cout << endl;\n      cout << sum[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, b;\n  int sz[1000][1000];\n  cin >> a;\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    int e, k, h = 0;\n    for (e = 0; e < m; e++) {\n      if (e == 0) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n      if (e == m - 1) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (k == n - 1) {\n        for (e = 1; e < m - 1; e++)\n          h += sz[e][k];\n      }\n      if (k == 0) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n    }\n    cout << h << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int i, j, l, lin, col, sum = 0;\n  int num[101][101];\n  for (l = 1; l <= k; l++) {\n    cin >> lin >> col;\n    for (i = 1; i <= lin; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> num[i][j];\n    }\n\n    if (lin >= 2 && col >= 2) {\n      for (i = 2; i <= lin - 1; i++)\n        sum = sum + num[i][1] + num[i][col];\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j] + num[lin][j];\n    }\n    if (lin == 1 && col >= 2) {\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j];\n    }\n    if (col == 1 && lin >= 2) {\n      for (i = 1; i <= lin; i++)\n        sum = sum + num[i][1];\n    }\n    if (col == 1 && lin == 1)\n      sum = sum + num[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, h, i, j;\n  scanf(\"%d\", &a);\n  int sum[100][3];\n  int n, k;\n  for (h = 1; h <= a; h++) {\n    scanf(\"%d%d\", &n, &k);\n    int sz[100][100];\n    sum[h][1] = 0;\n    sum[h][2] = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= k; j++) {\n        cin >> sz[i][j];\n        sum[h][1] = sum[h][1] + sz[i][j];\n      }\n    }\n    if (n > 1 && k > 1) {\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < k; j++) {\n          sum[h][2] = sum[h][2] + sz[i][j];\n        }\n      }\n    }\n    sum[h][3] = sum[h][1] - sum[h][2];\n  }\n  for (i = 1; i <= a; i++)\n    cout << sum[i][3] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "9571", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, i, k, m, n, sum[100] = {0}, j, q, x;\n  scanf(\"%d\\n%\", &k);\n  p = (int *)malloc(10000 * sizeof(int));\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    for (j = 0; j < n; j++)\n      sum[x] = sum[x] + (*(p + j)) + (*(p + n * (m - 1) + j));\n    for (q = 1; q < m - 1; q++) {\n      sum[x] = sum[x] + (*(p + q * n)) + (*(p + q * n + n - 1));\n    }\n  }\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", sum[x]);\n}\n"}
{"label": "6", "index": "9572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    int row, col;\n    cin >> row >> col;\n    int number[100][100];\n\n    int k, m;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        cin >> number[k][m];\n      }\n    }\n    int sum = 0;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        if (k == 0 || m == 0 || k == row - 1 || m == col - 1) {\n          sum += number[k][m];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    int num[110][110] = {0}, (*p)[110], sum = 0, i, j;\n    p = num;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    p = num;\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j);\n    for (i = 1; i < m; i++)\n      sum = sum + *(*(p + i) + n - 1);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + *(*(p + m - 1) + j);\n    for (i = 1; i < m - 1; i++)\n      sum = sum + *(*(p + i) + 0);\n    printf(\"%d\\n\", sum);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9574", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void juzhen();\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    juzhen();\n  }\n}\n\nvoid juzhen() {\n  int m, n, i = 0, j = 0, f = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    f = f + a[0][j] + a[m - 1][j];\n  }\n  for (i = 1; i < m - 1; i++) {\n    f = f + a[i][0] + a[i][n - 1];\n  }\n  printf(\"%d\\n\", f);\n}\n"}
{"label": "6", "index": "9575", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[200][200];\n  int *p[200];\n  for (int i = 0; i <= 200; i++)\n    p[i] = array[i];\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0, sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        scanf(\"%d \", &p[j][l]);\n        if (j == 0 || l == 0 || j == m - 1 || l == n - 1) {\n          sum += p[j][l];\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9576", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  int a, b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    sum = 0;\n    int c[100][100][100];\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d\", &c[i][j][k]);\n    }\n    for (j = 0; j < a; j++)\n      sum += c[i][j][0] + c[i][j][b - 1];\n    for (k = 0; k < b; k++)\n      sum += c[i][0][k] + c[i][a - 1][k];\n    sum =\n        sum - c[i][0][0] - c[i][0][b - 1] - c[i][a - 1][0] - c[i][a - 1][b - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9577", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid ijudge(int i, int j, int k, int p, int q) {\n  if ((j == 0) || (j == p - 1) || (k == 0) || (k == q - 1))\n    sum += i;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int p, q;\n  for (int i = 0; i < n; i++) {\n    cin >> p >> q;\n    sum = 0;\n    for (int j = 0; j < p; j++)\n      for (int k = 0; k < q; k++) {\n        cin >> a[j][k];\n        ijudge(a[j][k], j, k, p, q);\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint main() {\n  int k, m, n, sum, i, j;\n  scanf(\"%d\", &k);\n  while (k--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n      }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  int(*p)[100] = a;\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n\n        cin >> *(*(p + i) + j);\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9580", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[200], n[200], i, t, j, a[200][200], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (t = 1; t <= m[i]; t++) {\n      for (j = 1; j <= n[i]; j++) {\n        cin >> a[t][j];\n      }\n    }\n\n    if (m[i] == 1 && n[i] == 1)\n      printf(\"%d\", a[1][1]);\n    else {\n\n      sum = 0;\n\n      for (t = 1; t <= n[i]; t++) {\n        sum = sum + a[1][t];\n      }\n\n      for (j = 1; j <= n[i]; j++) {\n        sum = sum + a[m[i]][j];\n      }\n\n      for (t = 1; t <= m[i]; t++) {\n        sum = sum + a[t][1];\n      }\n\n      for (j = 1; j <= m[i]; j++) {\n        sum = sum + a[j][n[i]];\n      }\n\n      sum = sum - a[1][1] - a[1][n[i]] - a[m[i]][n[i]] - a[m[i]][1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    int p, q, i, j;\n    cin >> p >> q;\n    int a[p][q], sum = 0;\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < q; j++)\n        cin >> a[i][j];\n    }\n    for (i = 0; i < q; i++) {\n      sum = sum + a[0][i] + a[p - 1][i];\n    }\n    for (j = 0; j < p; j++) {\n      sum = sum + a[j][0] + a[j][q - 1];\n    }\n    sum = sum - a[0][0] - a[0][q - 1] - a[p - 1][0] - a[p - 1][q - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, *p[100], i, *w[100], j, r, s = 0;\n  scanf(\"%d\\n\", &k);\n  for (j = 0; j < k; j++)\n    w[j] = (int *)malloc(2 * sizeof(int));\n  for (j = 0; j < k; j++) {\n    scanf(\"%d %d\\n\", w[j], w[j] + 1);\n    m = *(w[j]);\n    n = *(w[j] + 1);\n    for (r = 0; r < m; r++)\n      p[r] = (int *)malloc(100 * sizeof(int));\n    for (r = 0; r < m; r++)\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", p[r] + i);\n    for (r = 0, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (r = m - 1, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (i = 0, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    for (i = n - 1, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    printf(\"%d\\n\", s);\n    s = 0;\n    free(p[0]);\n  }\n}\n"}
{"label": "6", "index": "9583", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, k, i, j, x, y, t, ans[1000] = {0};\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> x >> y;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= y; j++) {\n        cin >> t; \n        if ((i == 1) || (i == x) || (j == 1) || (j == y))\n          ans[k] += t; \n      }\n  }\n  for (i = 1; i <= n; i++) \n  {\n    cout << ans[i];\n    if (i != n)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, h, a[1000][1000] = {0}, result;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    result = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (j = 0; j < n; j++)\n      result = result + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      result = result + a[i][0] + a[i][n - 1];\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9585", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, k, sum = 0, a;\n  int i, j, q, b[100];\n  int s[100][100];\n  scanf(\"%d\", &k);\n\n  for (q = 1; q <= k; q++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &s[i][j]);\n    }\n    for (j = 1; j <= n; j++) {\n      sum += s[1][j];\n      sum += s[m][j];\n    }\n    for (i = 1; i <= m; i++) {\n      sum += s[i][1];\n      sum += s[i][n];\n    }\n    a = s[1][1] + s[1][n] + s[m][1] + s[m][n];\n    sum -= a;\n    b[q] = sum;\n    sum = 0;\n  }\n  for (q = 1; q <= k; q++) {\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], j, i, l, p, q;\n  int k, m, n, sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    }\n    for (p = 1; p <= n; p++) {\n      sum = sum + a[1][p] + a[m][p];\n    }\n    for (q = 2; q < m; q++) {\n      sum = sum + a[q][1] + a[q][n];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint count(int b, int c) {\n  int m = b, n = c;\n  int i, j, sum, num[100][100], (*a)[100];\n\n  a = num;\n  sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", *(a + i) + j);\n    scanf(\"%d\", *(a + i) + (n - 1));\n  }\n  for (j = 0; j < n; j++)\n    sum = sum + (*(*a + j)) + (*(*(a + m - 1) + j));\n\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + (*(*(a + i))) + (*(*(a + i) + (n - 1)));\n  }\n  return sum;\n}\n\nint main() {\n  int i, k, m, n, sum[100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[i] = count(m, n);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n}\n"}
{"label": "6", "index": "9588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int i, j, a, b, x[100][100], sum = 0;\n    cin >> a >> b;\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        cin >> x[i][j];\n      }\n    for (i = 0; i < b; i++) {\n      sum = sum + x[0][i] + x[a - 1][i];\n    }\n    for (i = 1; i < a - 1; i++) {\n      sum = sum + x[i][0] + x[i][b - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9589", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, j;\n  int n, row, col;\n  int shuzu[1000][1000], cc[1000] = {99};\n  int result = 0;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &row, &col);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &shuzu[i][j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i == 0) {\n          result += shuzu[i][j];\n        } else if (i == (row - 1)) {\n          result += shuzu[i][j];\n        } else {\n          if (j == 0) {\n            result += shuzu[i][j];\n          } else if (j == (col - 1)) {\n            result += shuzu[i][j];\n          }\n        }\n      }\n    }\n    cc[k] = result;\n    result = 0;\n  }\n\n  for (k = 0; k < n; k++) {\n    printf(\"%d \", cc[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, j, z, s;\n  cin >> k;\n  for (z = 1; z <= k; z++) {\n    s = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          s = s + a[i][j];\n    } else {\n      for (i = 0; i < n; i++)\n        s = s + *(*a + i) + *(*(a + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        s = s + *(*(a + i)) + *(*(a + i) + n - 1);\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "6", "index": "9591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, tri[100][100], h, l, *point = tri[0];\n  cin >> t;\n  for (int i = 1; i <= t; i++) {\n    scanf(\"%d %d \", &h, &l);\n    int temp = 0;\n    for (int p = 1; p <= h; p++) {\n      for (int q = 1; q <= l; q++) {\n        cin >> *(point + 100 * p + q);\n        if (p == 1 || q == 1 || p == h || q == l)\n          temp += *(point + 100 * p + q);\n      }\n    }\n    printf(\"%d\\n\", temp);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, m, n, x, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 1, s = 0, m--; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    for (j = 2; j <= m; j++)\n      for (l = 1; l <= n; l++) {\n        cin >> x;\n        if ((l == 1) || (l == n))\n          s += x;\n      }\n    for (j = 1; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], m[100][100], i, j, k, count[100] = {0};\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> x[k] >> y[k];\n    for (i = 0; i < x[k]; i++) {\n      for (j = 0; j < y[k]; j++) {\n        cin >> m[i][j];\n        if (i == 0 || i == x[k] - 1 || j == 0 || j == y[k] - 1)\n          count[k] += m[i][j];\n      }\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << count[k] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "9594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n = 0;\n  int x = 0, y = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    cin >> y;\n    for (int j = 0; j < x; j++)\n      for (int k = 0; k < y; k++)\n        cin >> a[j][k];\n    int *p;\n    int sum = 0;\n    for (int j = 1; j < x - 1; j++) {\n      p = a[j];\n      sum = *p + *(p + y - 1) + sum;\n    }\n    p = a[0];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    p = a[x - 1];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9595", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, c, d;\n  c = 0;\n  scanf(\"%d\", &k);\n  int sz[100][100];\n  int yi[100];\n  int er[100];\n  for (c = 0; c < k; c++) {\n    cin >> m >> n;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[0][b];\n    }\n    yi[a] = d;\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[m - 1][b];\n    }\n    er[a] = d;\n    d = yi[a] + er[a];\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][0];\n    }\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][n - 1];\n    }\n\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum = 0;\n  int h, l, a[100][100], i, j, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    cin >> h >> l;\n    for (i = 0; i < h; i++) {\n      for (j = 0; j < l; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (h < 2 && l < 2) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < l; j++) {\n      sum += a[0][j];\n      sum += a[h - 1][j];\n    }\n    for (i = 0; i < h; i++) {\n      sum += a[i][0];\n      sum += a[i][l - 1];\n    }\n    sum = sum - a[0][0] - a[0][l - 1] - a[h - 1][0] - a[h - 1][l - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int x, k, m, n, i, j, sum;\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < n - 1; j++) {\n      sum += sz[0][j];\n    }\n    for (i = 0; i < m - 1; i++)\n      sum += sz[i][j];\n\n    for (; j > 0; j--) {\n      sum += sz[i][j];\n    }\n    for (; i > 0; i--)\n      sum += sz[i][j];\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9598", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, jz[100][100], ROW, COL, h[100], y, i, row, col;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> ROW >> COL;\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &jz[row][col]);\n      }\n    }\n    y = 0;\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][0];\n    }\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][COL - 1];\n    }\n\n    for (col = 0; col < COL; col++) {\n      y += jz[0][col];\n    }\n    for (col = 0; col < COL; col++) {\n      y += jz[ROW - 1][col];\n    }\n\n    h[i] =\n        y - jz[0][0] - jz[0][COL - 1] - jz[ROW - 1][0] - jz[ROW - 1][COL - 1];\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", h[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num_data;\n  scanf(\"%d \", &num_data);\n  while (num_data--) {\n    int a[100][100];\n    int m, n;\n    int sum = 0;\n\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        scanf(\"%d \", &a[i][j]);\n\n    if (m == 1) {\n      for (int k = 0; k != n; k++)\n        sum += a[0][k];\n    } else if (n == 1) {\n      for (int k = 0; k != m; k++)\n        sum += a[k][0];\n    } else {\n      for (int k = 0; k != n - 1; k++)\n        sum += a[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += a[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += a[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += a[k][0];\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, j;\n  int n, row, col;\n  int shuzu[1000][1000], cc[1000] = {99};\n  int result = 0;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &row, &col);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> shuzu[i][j];\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i == 0) {\n          result += shuzu[i][j];\n        } else if (i == (row - 1)) {\n          result += shuzu[i][j];\n        } else {\n          if (j == 0) {\n            result += shuzu[i][j];\n          } else if (j == (col - 1)) {\n            result += shuzu[i][j];\n          }\n        }\n      }\n    }\n    cc[k] = result;\n    result = 0;\n  }\n\n  for (k = 0; k < n; k++) {\n    cout << cc[k] << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9601", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][99][99] = {0}, m[100], n[100], k, i, j, l, sum[100] = {0}, leap;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j <= m[i] - 1; j++) {\n      for (l = 0; l <= n[i] - 1; l++) {\n        cin >> a[i][j][l];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (m[i] == 1 && n[i] == 1) {\n      sum[i] = a[i][0][0];\n    } else {\n      for (j = 0; j <= m[i] - 1; j++) {\n        sum[i] = a[i][j][0] + a[i][j][n[i] - 1] + sum[i];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (n[i] <= 2)\n      leap = 1;\n    else\n      leap = 0;\n    for (j = 1; j <= n[i] - 2; j++) {\n      if (leap)\n        break;\n      sum[i] = sum[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, i, j, k, m, n, u[100][100], s, d, x;\n  scanf(\"%d\", &k);\n\n  for (y = 1; y <= k; y++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> u[i][j];\n      }\n    }\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        s += u[i][j];\n      }\n    }\n    d = 0;\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        d += u[i][j];\n      }\n    }\n    x = s - d;\n    cout << x << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int n, sum, row, col;\n  int *point;\n  point = *array;\n  cin >> n;\n  for (; n > 0; n--) {\n    sum = 0;\n    cin >> row >> col;\n    for (point = *array; point < *array + row * col; point++)\n      cin >> *point;\n    point = *array;\n    for (; point < *array + col; point++)\n      sum = sum + *point;\n\n    point--;\n    for (point = point + col; point < *array + row * col; point = point + col) {\n      sum = sum + *point;\n    }\n    point -= col;\n    for (point = point - 1; point >= *array + (row - 1) * col; point--) {\n      sum = sum + *point;\n    }\n    point++;\n    for (point = point - col; point > *array; point = point - col)\n      sum = sum + *point;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n\n        if (i == 0)\n          sum = sum + a[i][j];\n        if (i == m - 1)\n          sum = sum + a[i][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, o = 0, i = 0, j = 0, m = 0, n = 0, num = 0, sum = 0;\n  cin >> k;\n  for (o = 0; o < k; o++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num;\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum = sum + num;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b, c;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &jz[a][b]);\n      }\n    }\n    c = 0;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        if (a == 0 || b == 0) {\n          c = c + jz[a][b];\n        } else if (a == m - 1 || b == n - 1) {\n          c = c + jz[a][b];\n        }\n      }\n    }\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m, n;\n  int a[100][100];\n  int i;\n  int j;\n  int e;\n  int sum[100] = {0};\n  for (e = 0; e < k; e++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum[e] = sum[e] + a[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum[e] = sum[e] + a[i][n - 1];\n    }\n    for (j = n - 2; j >= 0; j--) {\n      sum[e] = sum[e] + a[m - 1][j];\n    }\n    for (i = m - 2; i > 0; i--) {\n      sum[e] = sum[e] + a[i][0];\n    }\n  }\n  for (e = 0; e < k; e++) {\n    printf(\"%d\\n\", sum[e]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[100][100], m, n, k, i, j, s, sum;\n  scanf(\"%d \", &k);\n  for (s = 1; s <= k; s++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        sum = sum + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++)\n        sum = sum - a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int i, j, t;\n  int sum;\n  int z;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &z);\n        if (i == 0 || i == m - 1)\n          sum += z;\n        else {\n          if (j == 0 || j == n - 1)\n            sum += z;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9610", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 10, b = 10, o = 10, p = 10, sum, area[111][111];\n  int k = 10, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++)\n        scanf(\"%d \", &area[o][p]);\n    }\n    for (p = 0; p < b; p++)\n      sum += area[0][p] + area[a - 1][p];\n    for (o = 1; o < a - 1; o++)\n      sum += area[o][0] + area[o][b - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9611", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m1[120], m2[120], a[100][120][120];\n  int i, j, k, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &m1[i], &m2[i]);\n    for (j = 0; j < m1[i]; j++)\n      for (k = 0; k < m2[i]; k++)\n        cin >> a[i][j][k];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (m1[i] == 1) {\n      for (j = 0; j < m2[i]; j++)\n        s = s + a[i][0][j];\n    } else if (m2[i] == 1) {\n      for (j = 0; j < m1[i]; j++)\n        s = s + a[i][j][0];\n    } else {\n      for (j = 0; j < m2[i] - 1; j++) {\n        s = s + a[i][0][j];\n      }\n      for (j = 0; j < m1[i] - 1; j++)\n        s = s + a[i][j][m2[i] - 1];\n      for (j = m2[i] - 1; j > 0; j--)\n        s = s + a[i][m1[i] - 1][j];\n      for (j = m1[i] - 1; j > 0; j--)\n        s = s + a[i][j][0];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i;\n  int sz[100][100];\n  int row, col;\n  int add[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    add[i] = 0;\n  }\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", &sz[row][col]);\n    }\n\n    for (col = 0; col < n; col++) {\n      add[i] += sz[0][col];\n      add[i] += sz[m - 1][col];\n    }\n\n    for (row = 0; row < m; row++) {\n      add[i] += sz[row][0];\n      add[i] += sz[row][n - 1];\n    }\n\n    add[i] -= sz[0][0];\n    add[i] -= sz[m - 1][0];\n    add[i] -= sz[0][n - 1];\n    add[i] -= sz[m - 1][n - 1];\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", add[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, m, n, k, i, j, t, sum[1001] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (t = 1; t <= m; t++)\n      for (j = 1; j <= n; j++)\n        cin >> a[t][j];\n\n    for (j = 1; j <= n; j++)\n      sum[i] = sum[i] + a[1][j] + a[m][j];\n    for (j = 1; j <= m; j++) {\n      if (j == 1 || j == m)\n        continue;\n      sum[i] = sum[i] + a[j][1] + a[j][n];\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "9614", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], sum[100], i, j, a, b, c, d, e;\n  b = 0;\n  c = 0;\n  d = 0;\n  e = 0;\n  cin >> k;\n\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &(sz[i][j]));\n    }\n\n    for (j = 0; j < n; j++) {\n      b = b + sz[0][j];\n      c = c + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      d = d + sz[i][0];\n      e = e + sz[i][n - 1];\n    }\n    sum[a] = b + c + d + e;\n    b = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n  }\n  for (a = 0; a < k; a++) {\n    printf(\"%d\\n\", sum[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, sum = 0, x, y;\n  i = 0;\n  int sj[100];\n  int sz[100][100];\n  cin >> x;\n  for (y = 0; y < x; y++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[i][k]);\n      }\n    }\n    for (k = 0; k < n; k++)\n      sum = sum + sz[0][k] + sz[m - 1][k];\n\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0] + sz[i][n - 1];\n    }\n    sj[y] = sum;\n    sum = 0;\n  }\n  for (y = 0; y < x; y++) {\n    cout << sj[y] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100];\n  int i = 0, j = 0, t = 1;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    if (m == 1 && n == 1)\n      cout << a[0][0] << endl;\n    else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n[1000], m[1000], a, b, c, s[100][100], x[1000];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m[a], &n[a]);\n    for (b = 0; b < m[a]; b++) {\n      for (c = 0; c < n[a]; c++) {\n        scanf(\"%d\", &s[b][c]);\n      }\n    }\n    x[a] = 0;\n    for (c = 0; c < n[a]; c++) {\n      if (m[a] > 1) {\n        x[a] = x[a] + s[0][c] + s[m[a] - 1][c];\n      } else {\n        x[a] = x[a] + s[0][c];\n      }\n    }\n    if (m[a] > 2) {\n      if (n[a] > 1) {\n        for (b = 1; b < m[a] - 1; b++) {\n          x[a] = x[a] + s[b][0] + s[b][n[a] - 1];\n        }\n      } else {\n        x[a] = x[a] + s[b][0];\n      }\n    }\n    printf(\"%d\\n\", x[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, sum = 0, x, y;\n  i = 0;\n  int sj[100];\n  int sz[100][100];\n  scanf(\"%d\", &x);\n  for (y = 0; y < x; y++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[i][k]);\n      }\n    }\n    for (k = 0; k < n; k++) {\n      sum = sum + sz[0][k] + sz[m - 1][k];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0] + sz[i][n - 1];\n    }\n    sj[y] = sum;\n    sum = 0;\n  }\n  for (y = 0; y < x; y++) {\n    printf(\"%d\\n\", sj[y]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, k1, m, n, i, j, answer;\n  int sz[102][102];\n  scanf(\"%d\", &k);\n  for (k1 = 1; k1 <= k; k1++) {\n    answer = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      answer = sz[1][1];\n    } else if (m == 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j];\n      }\n    } else if (n == 1) {\n      for (i = 1; i <= m; i++) {\n        answer = answer + sz[i][1];\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j] + sz[m][j];\n      }\n      for (i = 2; i < m; i++) {\n        answer = answer + sz[i][1] + sz[i][n];\n      }\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t;\n  int m, n;\n  int a[100][100] = {0};\n  int sum;\n  cin >> t;\n  int i, j, k;\n  for (i = 0; i < t; i++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j];\n      sum = sum + a[m - 1][j];\n    }\n    for (k = 1; k < m - 1; k++) {\n      sum = sum + a[k][0];\n      sum = sum + a[k][n - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9621", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[10000], *p = a, *q = a, n, h, l, i, j, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = a;\n    q = a;\n    scanf(\"%d %d\", &h, &l);\n\n    for (j = 1; j <= h * l; j++) {\n      scanf(\"%d\", p++);\n    }\n    if (h == 1) {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n      }\n    } else if (l == 1) {\n      sum += *q;\n      sum += *(q + h - 1);\n    } else {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n        sum += *(q + h * l - j - 1);\n      }\n      for (j = 1; j <= h - 2; j++) {\n        sum += *(q + j * l);\n        sum += *(q + j * l + l - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, s;\n  int a[100][100][100];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> c[i];\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k < c[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    s = 0;\n    if (c[i] > 1) {\n      for (j = 0; j < c[i]; j++)\n        s = s + a[i][0][j] + a[i][b[i] - 1][j];\n    } else {\n      s = s + a[i][0][0];\n    }\n    for (j = 1; j < b[i] - 1; j++) {\n      s = s + a[i][j][0] + a[i][j][c[i] - 1];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a;\n  int sz[100][100], s;\n  s = 0;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          s = s + sz[i][j];\n        }\n    }\n\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9624", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int row, line, a, b, A[101][101];\n    int sum = 0;\n    cin >> row >> line;\n    for (a = 1; a <= row; a++)\n      for (b = 1; b <= line; b++)\n        cin >> A[a][b];\n    for (a = 1; a <= row; a++)\n      sum += A[a][1];\n    for (b = 2; b <= line; b++)\n      sum += A[row][b];\n    for (a = row - 1; a >= 1; a--) {\n      sum += A[a][line];\n    }\n    for (b = line - 1; b >= 2; b--)\n      sum += A[1][b];\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "9625", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int x, y;\n  int a[100][100];\n  int i, j, k, l, m;\n  int s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x >> y;\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        cin >> a[j][k];\n      }\n    }\n    s = 0;\n    for (l = 0; l < y; l++) {\n      s = s + a[0][l] + a[x - 1][l];\n    }\n    for (m = 1; m < x - 1; m++)\n      s = s + a[m][0] + a[m][y - 1];\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9626", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  while (k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < n; i++) {\n      if (m == 1)\n        sum = sum + a[0][i];\n      else\n        sum = sum + a[0][i] + a[m - 1][i];\n    }\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, row, col, ROW, sz[100][100], COL, sum[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    if (ROW == 1 && COL == 1) {\n      sum[i] = sum[i] + sz[0][0];\n    } else {\n      for (col = 0; col < COL; col++) {\n        sum[i] = sum[i] + sz[0][col] + sz[ROW - 1][col];\n      }\n      for (row = 1; row < (ROW - 1); row++) {\n        sum[i] = sum[i] + sz[row][0] + sz[row][COL - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  cin >> k;\n  return 0;\n}\n"}
{"label": "6", "index": "9628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a, b, i, j, k, sum;\n  int s[100][100];\n  int(*p)[100];\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    p = s;\n    sum = 0;\n    scanf(\"%d %d\", &a, &b);\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1) {\n          sum += *(*(p + i) + j);\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, r, c, n;\n  int s[100][100];\n  int sum[100];\n  int sumr, sumc;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    sumr = 0;\n    sumc = 0;\n    scanf(\"%d %d\", &r, &c);\n    for (j = 0; j < r; j++)\n      for (k = 0; k < c; k++)\n        scanf(\"%d\", &s[j][k]);\n    if (r != 1 && c != 1) {\n      for (k = 0; k < c; k++)\n        sumr += s[0][k] + s[r - 1][k];\n      for (j = 0; j < r; j++)\n        sumc += s[j][0] + s[j][c - 1];\n      sum[i] =\n          sumr + sumc - s[0][0] - s[0][c - 1] - s[r - 1][0] - s[r - 1][c - 1];\n    }\n    if (r == 1 && c != 1)\n      for (k = 0; k < c; k++)\n        sum[i] += s[0][k];\n    if (c == 1 && r != 1)\n      for (j = 0; j < r; j++)\n        sum[i] += s[j][0];\n    if (c == 1 && r == 1)\n      sum[i] = s[0][0];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[100], n[100];\n  int a[100][10000];\n  int i, j, s, sum = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    s = m[i] * n[i];\n    for (j = 0; j < s; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0, sum = 0; j < m[i] * n[i]; j++) {\n      if (j < n[i])\n        sum = sum + a[i][j];\n      else if (j % n[i] == 0)\n        sum = sum + a[i][j];\n      else if ((j + 1) % n[i] == 0)\n        sum = sum + a[i][j];\n      else if (j > m[i] * n[i] - n[i] - 1)\n        sum = sum + a[i][j];\n      else\n        continue;\n    }\n    if (i == 0)\n      cout << sum;\n    else\n      printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9631", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[101][101];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int sum = 0;\n    for (int i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t, r, k, m, n, a[1000] = {0}, b[100][100] = {0}, sum = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n\n    for (t = 0; t < m; t++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &b[t][r]);\n        if (r == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    if (m == 1)\n      for (j = 0; j <= n - 1; j++)\n        sum += b[0][j];\n    else if (n == 1)\n      for (j = 0; j <= m - 1; j++)\n        sum += b[j][0];\n    else {\n      for (j = 0; j < n - 1; j++)\n        sum += *(b[0] + j);\n      for (j = 0; j < m - 1; j++)\n        sum += *(b[j] + n - 1);\n      for (j = n - 1; j > 0; j--)\n        sum += *(b[m - 1] + j);\n      for (j = m - 1; j > 0; j--)\n        sum += *(b[j] + 0);\n    }\n    a[i] = sum;\n    sum = 0;\n  }\n  for (i = 0; i < k; i++)\n    cout << a[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "9633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, p, q;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    int sum = 0;\n    if (m <= 2 || n <= 2) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum = sum + a[p][q];\n        }\n      }\n      cout << sum << endl;\n    } else {\n      int sum1 = 0, sum2 = 0;\n      sum = 0;\n      for (p = 0; p < m; p++) {\n        sum1 = a[p][0] + a[p][n - 1] + sum1;\n      }\n      for (q = 0; q < n; q++) {\n        sum2 = sum2 + a[0][q] + a[m - 1][q];\n      }\n      sum =\n          sum1 + sum2 - (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, b, sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m, &n);\n    int s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &(sz[i][j]));\n    }\n    if (m == 1 && n == 1) {\n      s = sz[0][0];\n    } else {\n      for (b = 0; b < n; b++) {\n        s = s + sz[0][b] + sz[m - 1][b];\n      }\n      for (b = 0; b < m; b++)\n        s = s + sz[b][0] + sz[b][n - 1];\n\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, k, i, j, s = 0, m, n, *p[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        p[i][j] = (int *)malloc(1 * sizeof(int));\n        scanf(\"%d\", &*p[i][j]);\n        if (j == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    for (j = 0; j < n; j++)\n      s = s + (*p[0][j]) + (*p[m - 1][j]);\n    for (i = 1; i < m - 1; i++)\n      s = s + (*p[i][0]) + (*p[i][n - 1]);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n}\n"}
{"label": "6", "index": "9636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, total;\n  int a[110][110] = {0};\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    cin >> m >> n;\n    total = 0;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(a + i) + j); \n        if ((i == 1) || (i == m))\n          total = total + *(*(a + i) + j);\n        \n      }\n    for (i = 2; i < m; i++)\n      total = total + *(*(a + i) + 1) + *(*(a + i) + n); \n    cout << total << endl;                               \n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = m - 1, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = 0, j = 0; i < m; i++)\n      sum = sum + a[i][j];\n    for (i = 0, j = n - 1; i < m; i++)\n      sum = sum + a[i][j];\n    sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, e;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int a, b, c, d, total;\n    scanf(\"%d%d\", &a, &b);\n    if (a == 1 && b == 1) {\n      scanf(\"%d\", &c);\n      printf(\"%d\", c);\n    } else {\n      int sz[a][b];\n      for (c = 0; c < a; c++) {\n        for (d = 0; d < b - 1; d++) {\n          scanf(\"%d\", &sz[c][d]);\n        }\n        scanf(\"%d\\n\", &sz[c][b - 1]);\n      }\n      total = 0;\n      for (c = 0; c < a; c++) {\n        total = total + sz[c][0];\n        total = total + sz[c][b - 1];\n      }\n      for (c = 0; c < b; c++) {\n        total = total + sz[0][c];\n        total = total + sz[a - 1][c];\n      }\n      total = total - sz[0][0];\n      total = total - sz[0][b - 1];\n      total = total - sz[a - 1][0];\n      total = total - sz[a - 1][b - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum1, sum2, sum3, sum4;\n  int i, j, l;\n  int a[100][100], b[100];\n\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++)\n      sum1 = sum1 + a[0][j];\n    for (i = 1; i < m; i++)\n      sum2 = sum2 + a[i][n - 1];\n    for (j = 0; j < n - 1; j++)\n      sum3 = sum3 + a[i - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum4 = sum4 + a[i][0];\n    b[l] = sum1 + sum2 + sum3 + sum4;\n  }\n  for (l = 1; l <= k; l++)\n    cout << b[l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "9640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, m, n, sum;\nint num[101][101];\nint main() {\n  int i, j, l;\n  cin >> k;\n  for (i = 0; i < k; ++i) {\n    memset(num, 0, sizeof(num));\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; ++j) {\n      for (l = 0; l < n; ++l) {\n        cin >> num[j][l];\n      }\n    }\n    for (j = 0; j < n; ++j)\n      sum += num[0][j] + num[m - 1][j];\n    for (j = 1; j < m - 1; ++j)\n      sum += num[j][0] + num[j][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100];\n  int k, m, n, i, j, t;\n\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[t] = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum[t] += a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum[t] += a[0][j] + a[m - 1][j];\n    }\n    sum[t] -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n  }\n\n  for (t = 0; t < k; t++) {\n    if (t != k - 1) {\n      cout << sum[t] << \"\\n\";\n    } else {\n      printf(\"%d\", sum[t]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k, m, n, i, j, z, sum, temp; \n  int a[101][101];\n  int(*p)[101] = a;\n  cin >> k; \n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;          \n    for (j = 0; j < m; j++) \n      for (z = 0; z < n; z++)\n        cin >> *(*(p + j) + z);\n    if (m != 1 && n != 1) {\n      for (temp = 0; temp < n; temp++) \n        sum += (*(*(p) + temp) + *(*(p + m - 1) + temp));\n      for (temp = 0; temp < m; temp++) \n        sum += (*(*(p + temp)) + *(*(p + temp) + n - 1));\n      sum -= *(*(p)) + *(*(p) + n - 1) + *(*(p + m - 1)) +\n             *(*(p + m - 1) + n - 1); \n      cout << sum << endl;            \n    } else\n      cout << *(*(p)) << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100], i, j, sum, t;\n  scanf(\"%d\", &t);\n  while (t--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m > 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0] + a[i][n - 1];\n    else\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n > 1)\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i];\n    else\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, *sum, i, j, *q;\n  sum = (int *)malloc(100 * sizeof(int));\n  q = sum;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++, sum++) {\n    *sum = 0;\n    int *p, *p1;\n    p = (int *)calloc(1000, 100 * sizeof(int));\n    cin >> m >> n;\n    p1 = p;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p++);\n    for (i = 0, p = p1; i < m * n; i++, p++)\n      if (i < n || i % n == 0 || (i + 1) % n == 0 ||\n          (i < n * m && i > (n * (m - 1) - 1)))\n        *sum = *sum + *p;\n  }\n  for (i = 0, sum = q; i < k - 1; i++)\n    printf(\"%d\\n\", *sum++);\n  printf(\"%d\", *sum);\n}\n"}
{"label": "6", "index": "9645", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, x, y, ans, a[101][101];\n  int(*p)[101] = a;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    ans = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        cin >> *((*p + y) + x);\n        if (x == 0 || y == 0 || x == m - 1 || y == n - 1)\n          ans = ans + *((*p + y) + x);\n      }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[101][101];\n  int k, m, n, i, *pointer1, *pointer2, i1, i2, sum = 0;\n  ;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (i1 = 0; i1 < m; i1++) {\n      for (i2 = 0; i2 < n; i2++)\n        cin >> s[i1][i2];\n    }\n    pointer1 = &s[0][1];\n    pointer2 = &s[0][0];\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer1 = &s[0][i1];\n      sum += *pointer1;\n    }\n    for (i1 = 0; i1 < m; i1++) {\n      if (n != 1) {\n        pointer1 = &s[i1][n - 1];\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      } else {\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      }\n    }\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer2 = &s[m - 1][i1];\n      sum += *pointer2;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int jz[100][100];\n  int m, n;\n\n  int s[1000];\n  int i, j, q;\n\n  for (q = 0; q < k; q++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n\n        scanf(\"%d\", &(jz[i][j]));\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][0];\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][n - 1];\n    }\n    for (i = 0; i < n; i++) {\n      s[q] += jz[0][i];\n    }\n    for (i = 0; i < n; i++)\n      s[q] += jz[m - 1][i];\n\n    s[q] = s[q] - (jz[0][0]) - (jz[0][n - 1]) - (jz[m - 1][0]) -\n           (jz[m - 1][n - 1]);\n    if (q == k - 1) {\n      printf(\"%d\", s[q]);\n    } else {\n      printf(\"%d\\n\", s[q]);\n    }\n    m = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105];\n  long m, n, k, z, sum, i, j;\n  scanf(\"%d\", &z);\n  for (i = 1; i <= z; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if (m >= 2 && n >= 2) {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (k = 1; k <= n; k++)\n        sum = sum + a[1][k] + a[m][k];\n      for (j = 2; j <= m - 1; j++)\n        sum = sum + a[j][1] + a[j][n];\n\n      printf(\"%d\\n\", sum);\n    }\n\n    else {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++)\n          sum = sum + a[j][k];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9649", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, sum, temp, c, d, e, q, w, r, t;\n  int a[100][100];\n  cin >> k;\n  int m[100], n[100];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d \", &a[j][l]);\n      }\n    }\n    sum = 0;\n    temp = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n    for (j = 0; j < n[i]; j++) {\n      temp = temp + a[0][j];\n    }\n    for (j = 0; j < n[i]; j++) {\n      c = c + a[m[i] - 1][j];\n    }\n    for (j = 0; j < m[i]; j++) {\n      d = d + a[j][0];\n    }\n    for (j = 0; j < m[i]; j++) {\n      e = e + a[j][n[i] - 1];\n    }\n    if (m[i] == 1 && n[i] == 1) {\n      sum = a[0][0];\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] == 1 && n[i] != 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[0][j];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] == 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[j][0];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] != 1) {\n      q = a[0][0];\n      w = a[0][n[i] - 1];\n      r = a[m[i] - 1][0];\n      t = a[m[i] - 1][n[i] - 1];\n      sum = c + d + e + temp - q - w - r - t;\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, b, sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m, &n);\n    int s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n    if (m == 1 && n == 1) {\n      s = sz[0][0];\n    } else {\n      for (b = 0; b < n; b++) {\n        s = s + sz[0][b] + sz[m - 1][b];\n      }\n      for (b = 0; b < m; b++)\n        s = s + sz[b][0] + sz[b][n - 1];\n\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid function_1() {\n  int a[110][110], (*p)[110];\n  int n, m, i, sum = 0, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  p = a;\n  for (i = 0; i < m; i++) {\n    sum += *(*p + i);\n    if (n > 1)\n      sum += *(*(p + n - 1) + i);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum += **(p + i);\n    if (m > 1)\n      sum += *(*(p + i) + m - 1);\n  }\n  cout << sum << endl;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1();\n  return 0;\n}\n"}
{"label": "6", "index": "9652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int res = 0;\n    scanf(\"%d%d\", &p, &q);\n    for (int i = 0; i < p; i++)\n      for (int j = 0; j < q; j++) {\n        scanf(\"%d\", &tmp);\n        if (i == 0 || j == 0 | i == p - 1 || j == q - 1)\n          res += tmp;\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[101][101];\n  int(*p)[101];\n  int i, j, sum = 0;\n  p = a;\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> *(*(p + i) + j);\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = **p;\n    else {\n      for (i = 0; i < col; i++) {\n        sum += *(*p + i);\n        if (row > 1)\n          sum += *(*(p + row - 1) + i);\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += *(*(p + i));\n        if (col > 1)\n          sum += *(*(p + i) + col - 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9654", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() { \n  int a[105][105] = {0}, n = 0, row = 0, col = 0, i = 0, j = 0, *p = NULL,\n      sum = 0;                  \n  cin >> n;                     \n  while (n--) {                 \n    cin >> row >> col;          \n    for (i = 0; i < row; i++) { \n      for (j = 0; j < col; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = &a[0][0]; p < &a[0][0] + col; p++) { \n      sum = sum + *p;\n    }\n    for (i = 1; i < row - 1; i++) { \n      sum = sum + a[i][0] + a[i][col - 1];\n    }\n    if (row > 1) {\n      for (p = &a[row - 1][0]; p < &a[row - 1][0] + col; p++) { \n        sum = sum + *p;\n      }\n    }\n    cout << sum << endl; \n    sum = 0;             \n  }\n  return 0;\n} \n"}
{"label": "6", "index": "9655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++)\n    s += *(*(p + 1) + i);\n  for (i = 2; i <= m; i++)\n    s += *(*(p + i) + n);\n  for (i = n - 1; i >= 1; i--)\n    s += *(*(p + m) + i);\n  for (i = m - 1; i > 1; i--)\n    s += *(*(p + i) + 1);\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    scanf(\"%d %d \", &m, &n);\n    cout << juzhen(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9656", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, i, j, k, m, n, u[100][100], s, d, x;\n  scanf(\"%d\", &k);\n\n  for (y = 1; y <= k; y++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &u[i][j]);\n    }\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        s += u[i][j];\n      }\n    }\n    d = 0;\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        d += u[i][j];\n      }\n    }\n    x = s - d;\n    printf(\"%d\\n\", x);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9657", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum;\n  cin >> k;\n  int a[100][100];\n  for (int l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    sum = 0;\n    if (m > 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i); \n      for (int i = 0; i < n; i++)\n        sum = sum + *(*(a + m - 1) + i); \n    }\n    if (m == 1) \n    {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n    }\n    if (n > 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i)); \n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i) + n - 1); \n    }\n    if (n == 1) \n    {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int s = 0;\n    if (m == 1) {\n      for (j = 0; j < n; j++)\n        s += a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n\n      cout << s << \"\\n\";\n    } else {\n\n      for (j = 0; j < n - 1; j++)\n        s += a[0][j];\n      for (i = 0; i < m - 1; i++)\n        s += a[i][n - 1];\n      for (j = 1; j < n; j++)\n        s += a[m - 1][j];\n      for (i = 1; i < m; i++)\n        s += a[i][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int a[m][n];\n    s = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &(a[j][l]));\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < n; j++) {\n        s += a[0][j];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += a[j][0];\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        s = s + a[0][j] + a[m - 1][j];\n      }\n      for (j = 0; j < m; j++) {\n        s = s + a[j][0] + a[j][n - 1];\n      }\n      s = s - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, m, n, s;\n  scanf(\"%d\\n\", &x);\n  for (s = 0; s < x; s++) {\n    int a[100][100];\n    int i, j, k, q = 0, w = 0, e = 0, r = 0, sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (k = 0; k < n; k++) {\n      q += a[0][k];\n      w += a[m - 1][k];\n    }\n    k = 0;\n    for (k = 0; k < m; k++) {\n      e += a[k][0];\n      r += a[k][n - 1];\n    }\n    sum = q + w + e + r - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9661", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int *p = NULL;\n  int a[100][100];\n  scanf(\"%d \", &k);\n  for (int i = 1; i <= k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0;\n    for (int j = 0; j <= m - 1; j++) {\n      for (int t = 0; t <= n - 1; t++) {\n        cin >> a[j][t];\n      }\n    }\n    p = &a[0][0];\n    for (p = &a[0][0]; p <= &a[0][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    for (p = &a[1][0]; p <= &a[m - 2][0]; p = p + 100) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    for (p = &a[m - 1][0]; p <= &a[m - 1][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9662", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, k;\n  cin >> k;\n  int i = 0, j = 0, h = 0;\n  for (i = 0; i < k; i++) {\n    int b = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (h = 0; h < n; h++)\n        cin >> *(*(a + j) + h);\n    for (j = 0; j < m; j++)\n      b = b + **(a + j);\n    for (j = 1; j < n; j++)\n      b = b + *(*a + j);\n    for (j = 1; j < m; j++)\n      b = b + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      b = b + *(*(a + m - 1) + j);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9663", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m[100][100];\nvoid a() {\n  memset(m, 0, sizeof(m));\n  int x, y, count = 0, sum = 0;\n  scanf(\"%d %d \", &x, &y);\n  int *p = m[0];\n  for (; p <= m[x - 1] + y - 1; p++) {\n    count++;\n    cin >> *p;\n    if (count == 1 || count == y)\n      sum += *p;\n    else if (p <= m[0] + y - 1)\n      sum += *p;\n    else if (m[x - 1] <= p && p <= m[x - 1] + y - 1)\n      sum += *p;\n    if (count == y) {\n      p = p + 100 - y;\n      count = 0;\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    a();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  cin >> t;\n  for (int r = 1; r <= t; r++) {\n    int m, n;\n    cin >> m >> n;\n    int juzhen[100][100];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    int *p;\n    int sum = 0;\n    for (int s = 0; s < m; s++) {\n      if (s == 0 || s == m - 1) {\n        for (p = juzhen[s]; p <= &juzhen[s][n - 1]; p++)\n          sum = sum + (*p);\n      } else {\n        p = juzhen[s];\n        sum = sum + (*p) + *(p + n - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int *p, int h, int l);\n  int N, m, n, i, j, q, a[110][110] = {0};\n  scanf(\"%d\", &N);\n  for (q = 1; q <= N; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++)\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    printf(\"%d\\n\", sum(a[0], m, n));\n  }\n}\n\nint sum(int *p, int h, int l) {\n  int r = 0, i, j;\n  for (i = 0; i <= h - 1; i++) {\n    if (i == 0 || i == (h - 1))\n      for (j = 0; j <= l - 1; j++) {\n        r = r + *(p + i * 110 + j);\n      }\n    else {\n      r = r + *(p + i * 110) + *(p + i * 110 + l - 1);\n    }\n  }\n  return r;\n}\n"}
{"label": "6", "index": "9666", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n = 0;\n\n  cin >> n;\n\n  int result[100];\n\n  for (int i = 0; i < n; i++) {\n\n    int x = 0;\n    int y = 0;\n\n    cin >> x >> y;\n\n    int r[100][100];\n\n    for (int j = 0; j < x; j++) {\n      for (int k = 0; k < y; k++)\n        cin >> r[j][k];\n    }\n\n    result[i] = 0;\n\n    for (int j = 0; j < x; j++) {\n      if (j == 0 || j == x - 1) {\n\n        for (int k = 0; k < y; k++) {\n          result[i] += r[j][k];\n        }\n\n      } else {\n        result[i] += r[j][0];\n        result[i] += r[j][y - 1];\n      }\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    cout << result[i];\n    if (i < n - 1)\n      cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int mat[100][100];\n  int t, m, n, i, j, sum;\n  scanf(\"%d \", &t);\n  for (; t > 0; t--) {\n    memset(mat, 0, sizeof(mat));\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> mat[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += mat[i][j];\n      }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9668", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int c1, c2, d, i, x = 0, k, m, n;\n  int sum[1000];\n  int a[1000][1000], b[1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < 1000; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (c1 = 0; c1 < m; c1++) {\n      for (c2 = 0; c2 < n; c2++) {\n        scanf(\"%d\", &a[c1][c2]);\n      }\n    }\n    for (d = 0; d < m; d++) {\n      sum[x] += a[d][0] + a[d][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      sum[x] += a[0][d] + a[m - 1][d];\n    }\n    x++;\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  int i;\n  for (i = 0; i < num; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[m][n];\n    for (int j = 0; j < m; j++)\n      for (int h = 0; h < n; h++)\n        scanf(\"%d\", &a[j][h]);\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      sum += a[0][j];\n    for (int j = 1; j < m; j++)\n      sum += a[j][0];\n    for (int j = 1; j < n; j++)\n      sum += a[m - 1][j];\n    for (int j = 1; j < m - 1; j++)\n      sum += a[j][n - 1];\n    printf(\"%d \", sum);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p = 0, num[100][100], sum = 0;\n  cin >> k;\n  while (p < k) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    for (j = 0; j < n; j++)\n      sum += num[0][j];\n    for (i = 1; i < m - 1; i++) {\n      sum += num[i][0];\n      sum += num[i][n - 1];\n    }\n    for (j = 0; j < n; j++)\n      sum += num[m - 1][j];\n    cout << sum << endl;\n    sum = 0;\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, m, n, array[100][100];\n  int sum, i, j, k;\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    for (j = 0; j < m; j++)\n      sum = sum + array[j][0] + array[j][n - 1];\n    for (k = 0; k < n; k++)\n      sum = sum + array[0][k] + array[m - 1][k];\n    cout << sum - array[0][0] - array[0][n - 1] - array[m - 1][0] -\n                array[m - 1][n - 1]\n         << endl;\n  }\n  cin.get();\n  return 0;\n}\n"}
{"label": "6", "index": "9672", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0, a[500][500] = {0}, (*p)[500];\n  cin >> k;\n  int i = 0, j = 0;\n  p = a;\n  for (int l = 0; l < k; l++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    int result = 0;\n    p = a;\n    for (i = 0; i < m; i++)\n      result = result + *(*(p + i));\n    p = a;\n    for (i = 0; i < m && n != 1; i++)\n      result = result + *(*(p + i) + n - 1);\n    p = a + m - 1;\n    for (i = 1; i < n - 1; i++) {\n      result = result + *(*p + i);\n    }\n    p = a;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    cout << result << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, l, S = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (l = 0; l <= n - 1; l++) {\n        cin >> a[j][l];\n        if (j == 0 || j == m - 1 || l == 0 || l == n - 1) {\n          S = S + a[j][l];\n        }\n      }\n    }\n    if (i < k) {\n      cout << S << '\\n';\n    } else {\n      printf(\"%d\", S);\n    }\n    S = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, s = 0;\n  int m, n;\n  cin >> k;\n  int a[100][100];\n  int *p = &a[0][0];\n  for (int t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      s += *(*(a + 0) + i);\n      s += *(*(a + m - 1) + i);\n    } \n    for (int i = 0; i < m; i++) {\n      s += *(*(a + i) + 0);\n      s += *(*(a + i) + n - 1);\n    }\n    s = s - **a - *(*(a + m - 1) + n - 1) - *(*(a + 0) + n - 1) -\n        *(*(a + m - 1));\n    cout << s << endl;\n  }\n}\n"}
{"label": "6", "index": "9675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int he, m, n, k, sz[100][100];\n  int i, j;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (int q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[j][q]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << sz[0][0] << \"\\n\";\n    } else {\n      he = 0;\n      for (j = 0; j < m; j++) {\n        if (m == 1) {\n          he += sz[j][0];\n        } else {\n          he += sz[j][0] + sz[j][n - 1];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        if (n == 1) {\n          he += sz[0][j];\n        } else {\n          he += sz[0][j] + sz[m - 1][j];\n        }\n      }\n      printf(\"%d\\n\", he);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, m, n, i, j, k, a[100][100], sum;\n  scanf(\"%d\", &p);\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[j][k]);\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[1][1]);\n      break;\n    }\n    for (k = 1; k <= n; k++)\n      sum += a[1][k] + a[m][k];\n    for (j = 1; j <= m; j++)\n      sum += a[j][1] + a[j][n];\n    sum -= a[1][1] + a[1][n] + a[m][1] + a[m][n];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9677", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, n, m, i, a[100][100], j, k, sum;\n  cin >> t;\n  int(*p)[100];\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &n, &m);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    p = a;\n    if (n == 1 || m == 1 || m == 2 || n == 2) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < m; k++)\n          sum = sum + *(*(p + j) + k);\n      }\n    } else {\n      for (k = 0; k < m; k++) {\n        sum = sum + *(*(p) + k) + *(*(p + n - 1) + k);\n      }\n      for (j = 1; j < n - 1; j++) {\n        sum = sum + *(*(p + j) + 0) + *(*(p + j) + m - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x;\n  cin >> x;\n  int sum = 0;\n  int m, n;\n\n  int g, i, j, temp;\n  for (g = 0; g < x; g++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      cin >> temp;\n      sum += temp;\n    }\n\n    for (i = 0; i < m - 2; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> temp;\n        if (j == 0 || j == n - 1) {\n          sum += temp;\n        }\n      }\n    }\n    if (m != 1) {\n      for (i = 0; i < n; i++) {\n        cin >> temp;\n        sum += temp;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int a, b, c, d, total;\n    scanf(\"%d%d\", &a, &b);\n    if (a == 1 && b == 1) {\n      scanf(\"%d\", &c);\n      printf(\"%d\", c);\n    } else {\n      int sz[a][b];\n      for (c = 0; c < a; c++) {\n        for (d = 0; d < b - 1; d++)\n          scanf(\"%d\", &sz[c][d]);\n\n        scanf(\"%d\\n\", &sz[c][b - 1]);\n      }\n      total = 0;\n      for (c = 0; c < a; c++) {\n        total = total + sz[c][0];\n        total = total + sz[c][b - 1];\n      }\n      for (c = 0; c < b; c++) {\n        total = total + sz[0][c];\n        total = total + sz[a - 1][c];\n      }\n      total = total - sz[0][0];\n      total = total - sz[0][b - 1];\n      total = total - sz[a - 1][0];\n      total = total - sz[a - 1][b - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  int m, n;\n  int a[100][100] = {0};\n  int sum;\n  cin >> t;\n  int i, j, k;\n  for (i = 0; i < t; i++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j];\n      sum = sum + a[m - 1][j];\n    }\n    for (k = 1; k < m - 1; k++) {\n      sum = sum + a[k][0];\n      sum = sum + a[k][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, s1, s2, q1, q2, a, b, t, k, p, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int pi[100001];\n    s1 = 0;\n    s2 = 0;\n    q1 = 0;\n    q2 = 0;\n    cin >> a >> b;\n    for (j = 1; j <= a * b; j++) {\n      scanf(\"%d\", pi + j - 1);\n    }\n    for (t = 1; t <= b; t++) {\n      s1 = s1 + *(pi + t - 1);\n      s2 = s2 + *(pi + a * b - t);\n    }\n    for (p = 1; p < a - 1; p++) {\n      q1 = q1 + *(pi + p * b);\n      q2 = q2 + *(pi + b - 1 + p * b);\n    }\n    s = s1 + s2 + q1 + q2;\n    if (a == 1 & b == 1) {\n      printf(\"%d\\n\", s / 2);\n    } else {\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m() {\n  int m, n, a[10000], i, j, s = 0;\n  int *p;\n  p = a;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i < m; i++) {\n    if (i == 0 || i == m - 1) {\n      for (j = 0; j < n; j++) {\n        s = s + *(p + i * n + j);\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        if (j == 0 || j == n - 1)\n          s = s + *(p + i * n + j);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int k, i, sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = m();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, w, c;\n  int **p;\n  cin >> k;\n  for (w = 0; w < k; w++) {\n    c = 0;\n    cin >> m >> n;\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      p[i] = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p[i] + j);\n    if (m == 1)\n      for (i = 0; i < n; i++)\n        c = c + p[0][i];\n    else {\n      if (n == 1)\n        for (i = 0; i < m; i++)\n          c = c + p[i][0];\n      else {\n        for (i = 0; i < n; i++)\n          c = c + p[0][i] + p[m - 1][i];\n        for (i = 1; i < m - 1; i++)\n          c = c + p[i][0] + p[i][n - 1];\n      }\n    }\n    cout << c << \"\\n\";\n    for (i = 0; i < m; i++)\n      free(p[i]);\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc(sizeof(int) * k);\n  for (i = 0; i < k; i++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &sz[j][l]);\n      }\n    }\n    if (m == 1) {\n      for (l = 0; l < n; l++)\n        s += sz[0][l];\n\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0];\n      }\n    } else {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0] + sz[j][n - 1];\n      }\n      for (l = 0; l < n; l++) {\n        s += sz[0][l] + sz[m - 1][l];\n      }\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    sf[i] = s;\n  }\n  for (i = 0; i < k; i++) {\n    cout << sf[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int r = 1; r <= t; r++) {\n    int m, n;\n    cin >> m >> n;\n    int juzhen[100][100];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    int *p;\n    int sum = 0;\n    for (int s = 0; s < m; s++) {\n      if (s == 0 || s == m - 1) {\n        for (p = juzhen[s]; p <= &juzhen[s][n - 1]; p++)\n          sum = sum + (*p);\n      } else {\n        p = juzhen[s];\n        sum = sum + (*p) + *(p + n - 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9686", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int x = 1; x <= k; x++) {\n    int m, n;\n    int A[100][100];\n    int sum = 0, a;\n    cin >> m >> n;\n    for (int j = 1; j <= n; j++) {\n      scanf(\"%d \", &a);\n      sum += a;\n    }\n    for (int i = 2; i <= m - 1; i++) {\n      cin >> a;\n      sum += a;\n      for (int j = 2; j <= n - 1; j++)\n        cin >> a;\n      cin >> a;\n      sum += a;\n    }\n    if (n != 1) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a;\n        sum += a;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9687", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, sum, m, n, k;\n  int a[1000][1000];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], k, n, m;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    int *p = a[0];\n    for (; p < a[0] + n; p++)\n      sum += *p;\n    if (m == 1) {\n      cout << sum << endl;\n      continue;\n    }\n    p = a[m - 1];\n    for (; p < a[m - 1] + n; p++)\n      sum += *p;\n    int(*q)[100] = a + 1;\n    for (; q <= a + m - 2; q++)\n      sum += **q + *((*q) + n - 1);\n    if (n == 1) {\n      cout << (sum - a[0][0] - a[m - 1][0]) / 2 + a[0][0] + a[m - 1][0];\n      continue;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9689", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k, sum = 0;\n  scanf(\"%d\", &k);\n\n  while (k > 0) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9690", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0;\n    cin >> m >> n;\n    int mat[100][100] = {0};\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> *(*(mat + j) + k);\n        if ((j == 0) || (j == m - 1) || (k == 0) || (k == n - 1)) {\n          sum = sum + *(*(mat + j) + k);\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, j, i, k, m, a, t, all, sum;\n  int s[500][500];\n  cin >> all;\n  m = 0;\n  for (t = 0; t < all; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &s[i][j]);\n        sum += s[i][j];\n      }\n    if ((m == 1) || (n == 1))\n      printf(\"%d\\n\", sum);\n    else {\n      for (i = 1; i <= m - 2; i++)\n        for (j = 1; j <= n - 2; j++)\n          sum = sum - s[i][j];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, sum[100] = {0};\n  int x, y, z;\n  cin >> k;\n\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (y = 0; y < m; y++) {\n      for (z = 0; z < n; z++) {\n        scanf(\"%d \", &a);\n        if (z == 0 || y == 0 || z == n - 1 || y == m - 1)\n          sum[x] = sum[x] + a;\n      }\n    }\n  }\n\n  for (x = 0; x < k; x++)\n    cout << sum[x] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "9693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, k, b[100][100], sum = 0;\n  scanf(\"%d \", &a);\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    cin >> m >> n;\n    ;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> b[i][j];\n    for (i = 0; i < m; i++)\n      sum += *(*(b + i)) + *(*(b + i) + n - 1);\n    for (i = 1; i < n - 1; i++)\n      sum += *(*b + i) + *(*(b + m - 1) + i);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sum = 0;\n  int h, l, a[100][100], i, j, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d\", &h, &l);\n    for (i = 0; i < h; i++) {\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (h < 2 && l < 2) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < l; j++) {\n      sum += a[0][j];\n      sum += a[h - 1][j];\n    }\n    for (i = 0; i < h; i++) {\n      sum += a[i][0];\n      sum += a[i][l - 1];\n    }\n    sum = sum - a[0][0] - a[0][l - 1] - a[h - 1][0] - a[h - 1][l - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9695", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, sum[100] = {0};\n  int x, y, z;\n  cin >> k;\n\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (y = 0; y < m; y++) {\n      for (z = 0; z < n; z++) {\n        cin >> a;\n        if (z == 0 || y == 0 || z == n - 1 || y == m - 1)\n          sum[x] = sum[x] + a;\n      }\n    }\n  }\n\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", sum[x]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "9696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, q;\n  int a[100][100];\n  int sum = 0;\n  int(*p)[100] = a; \n  cin >> q;\n  for (int i = 0; i < q; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) \n      {\n        if (j == 0 || j == m - 1)\n          sum += p[j][k];\n        else {\n          if (k == 0 || k == n - 1)\n            sum += p[j][k];\n        }\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  while (n--) {\n    int x, y, sum = 0;\n    scanf(\"%d %d \", &x, &y);\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        cin >> a[i][j];\n      }\n    for (int i = 0; i < x; i++) {\n      if (y != 1)\n        sum += a[i][0] + a[i][y - 1];\n      else\n        sum += a[i][0];\n    }\n    for (int j = 1; j < y - 1; j++) {\n      sum += a[0][j] + a[x - 1][j];\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, h, m, n;\n  int sum = 0, minus = 0;\n  int a[100][100];\n  int b[100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        sum += a[i][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        minus += a[i][j];\n      }\n    }\n    b[h] = sum - minus;\n    sum = 0;\n    minus = 0;\n  }\n  for (h = 0; h < k; h++)\n    cout << b[h] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "9699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], i, j, l, s = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m; j++)\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    if (m == 1)\n      for (j = 1; j <= n; j++)\n        s = s + a[1][j];\n    else if (n == 1)\n      for (j = i; j <= m; j++)\n        s = s + a[j][1];\n    else {\n      for (j = 1; j <= m; j++) {\n        s = s + a[j][1] + a[j][n];\n        a[j][1] = 0;\n        a[j][n] = 0;\n      }\n      for (j = 2; j < n; j++) {\n        s = s + a[1][j] + a[m][j];\n        a[1][j] = 0;\n        a[m][j] = 0;\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, m, n, k, i, j, t, sum[1001] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (t = 1; t <= m; t++)\n      for (j = 1; j <= n; j++)\n        cin >> a[t][j];\n\n    for (j = 1; j <= n; j++)\n      sum[i] = sum[i] + a[1][j] + a[m][j];\n    for (j = 1; j <= m; j++) {\n      if (j == 1 || j == m)\n        continue;\n      sum[i] = sum[i] + a[j][1] + a[j][n];\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, row[99], col[99], s[99][99][99], sum[99] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &row[i], &col[i]);\n    for (j = 0; j < row[i]; j++) {\n      for (k = 0; k < col[i]; k++) {\n        cin >> s[i][j][k];\n        if ((j == 0) || (k == 0) || (j == (row[i] - 1)) || (k == col[i] - 1))\n          sum[i] += s[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "9702", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, n, x, sum, a[100][105][105];\n  scanf(\"%d\", &x);\n  for (i = 1; i <= x; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    for (t = 1; t <= n; t++) {\n      if (m != 1)\n        sum = sum + a[i][1][t] + a[i][m][t];\n      if (m == 1)\n        sum = sum + a[i][1][t];\n    }\n    for (t = 2; t <= m - 1; t++) {\n      if (n != 1)\n        sum = sum + a[i][t][1] + a[i][t][n];\n      if (n == 1)\n        sum = sum + a[i][t][1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k, l, sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[j][l];\n        if (j == 1 || j == m || l == 1 || l == n) {\n          sum += a[j][l];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n;\n  int a[100][100] = {0}, sum = 0;\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", *(a + j) + l);\n    sum = 0;\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    } else {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j);\n    }\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9705", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int K, M, N, sz[99][99];\n  scanf(\"%d\", &K);\n  for (int k = 1; k <= K; k++) {\n    int result = 0;\n    cin >> M >> N;\n    for (int m = 0; m < M; m++)\n      for (int n = 0; n < N; n++)\n        cin >> sz[m][n];\n    if (M <= 2 || N <= 2) {\n      for (int m = 0; m < M; m++)\n        for (int n = 0; n < N; n++)\n          result += sz[m][n];\n    } else {\n      for (int n = 0; n < N; n++)\n        result += sz[0][n];\n      for (int n = 0; n < N; n++)\n        result += sz[M - 1][n];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][0];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][N - 1];\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int maxn = 110;\nint n, m;\nint d[maxn][maxn];\n\nint main() {\n  int t;\n\n  scanf(\"%d\", &t);\n  while (t-- > 0) {\n    int sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < m; j++) {\n        int tmp;\n        scanf(\"%d\", &tmp);\n        if (i == 0 || i == n - 1 || j == 0 || j == m - 1)\n          sum += tmp;\n      }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p, *q, a, b, k, m = 0, i, j;\n  q = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    m = 0;\n    p = q;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j < a * b; j++) {\n      scanf(\"%d\", p + j);\n    }\n    for (j = 0; j < b; j++)\n      m += *(p + j) + *(p + a * b - 1 - j);\n    for (j = 1; j < a - 1; j++)\n      m += *(p + j * b) + *(p + j * b + b - 1);\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], i, j, l, s = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m; j++)\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    if (m == 1)\n      for (j = 1; j <= n; j++)\n        s = s + a[1][j];\n    else if (n == 1)\n      for (j = i; j <= m; j++)\n        s = s + a[j][1];\n    else {\n      for (j = 1; j <= m; j++) {\n        s = s + a[j][1] + a[j][n];\n        a[j][1] = 0;\n        a[j][n] = 0;\n      }\n      for (j = 2; j < n; j++) {\n        s = s + a[1][j] + a[m][j];\n        a[1][j] = 0;\n        a[m][j] = 0;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n}\n"}
{"label": "6", "index": "9709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, *q, (*p)[100], h = 0, i, j, l, t;\n  p = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  q = (int *)malloc(100 * sizeof(int));\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(p + j) + l);\n      }\n    }\n    for (t = 0; t < n; t++) {\n      *(q + i) = *(q + i) + *(*p + t) + *(*(p + m - 1) + t);\n    }\n    for (t = 0; t < m; t++) {\n      *(q + i) = *(q + i) + **(p + t) + *(*(p + t) + n - 1);\n    }\n    *(q + i) = *(q + i) - **p - *(*p + n - 1) - *(*(p + m - 1)) -\n               *(*(p + m - 1) + n - 1);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", *(q + i));\n  }\n}\n"}
{"label": "6", "index": "9710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p = 0, num[100][100], sum = 0;\n  scanf(\"%d \", &k);\n  while (p < k) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n\n    for (j = 0; j < n; j++)\n      sum += num[0][j];\n    for (i = 1; i < m - 1; i++) {\n      sum += num[i][0];\n      sum += num[i][n - 1];\n    }\n    for (j = 0; j < n; j++)\n      sum += num[m - 1][j];\n    cout << sum << endl;\n    sum = 0;\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, k1, m, n, i, j, answer;\n  int sz[102][102];\n  scanf(\"%d\", &k);\n  for (k1 = 1; k1 <= k; k1++) {\n    answer = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1)\n      answer = sz[1][1];\n    else if (m == 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j];\n      }\n    } else if (n == 1) {\n      for (i = 1; i <= m; i++) {\n        answer = answer + sz[i][1];\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j] + sz[m][j];\n      }\n      for (i = 2; i < m; i++) {\n        answer = answer + sz[i][1] + sz[i][n];\n      }\n    }\n    cout << answer << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, sum = 0;\n  int shuzu[1000][1000];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    for (int s = 0; s < m; s++) {\n      for (int t = 0; t < n; t++) {\n        scanf(\"%d\", &(shuzu[s][t]));\n      }\n    }\n    if (m > 2 && n > 2) {\n      for (int x = 0; x < m; x++) {\n        sum += shuzu[x][0] + shuzu[x][n - 1];\n      }\n      for (int y = 1; y < n - 1; y++) {\n        sum += shuzu[0][y] + shuzu[m - 1][y];\n      }\n    } else {\n      for (int z = 0; z < m; z++) {\n        for (int h = 0; h < n; h++)\n          sum += shuzu[z][h];\n      }\n    }\n    cout << sum << \" \";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9713", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint m, n;\nvoid Input(int (*a)[102]) {\n  cin >> m >> n;\n  for (int i = 0; i <= m - 1; i++) {\n    for (int j = 0; j <= n - 1; j++)\n      cin >> *(*(a + i) + j);\n  }\n}\nvoid Sum(int x, int y, int (*a)[102]) {\n  sum += *(*(a + x) + y);\n  if (x == 0 && y < n - 1)\n    Sum(x, y + 1, a);\n  else if (x < m - 1 && y == n - 1)\n    Sum(x + 1, y, a);\n  else if (x == m - 1 && y > 0) {\n    Sum(x, y - 1, a);\n  } else if (y == 0 && x > 1)\n    Sum(x - 1, y, a);\n  else\n    return;\n}\nint main() {\n  int a[102][102];\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    Input(a);\n    Sum(0, 0, a);\n    if (i != 1)\n      cout << endl;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid sum(int i) {\n  int m, n, j, k, sum = 0;\n  cin >> m >> n;\n  int(*p)[100] = (int(*)[100])calloc(100, 100 * sizeof(int));\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", *(p + j) + k);\n  }\n  for (j = 0; j < m; j++) {\n    if (j == 0 || j == m - 1) {\n      for (k = 0; k < n; k++) {\n        sum = sum + *(*(p + j) + k);\n      }\n    } else\n      sum = sum + *(*(p + j)) + *(*(p + j) + n - 1);\n  }\n  printf(\"%d\\n\", sum);\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sum(i);\n  return 0;\n}\n"}
{"label": "6", "index": "9715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[500], i, j, x, k, a[100][100][100], b[500][2];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n[i] = 0;\n    cin >> b[i][0] >> b[i][1];\n    for (j = 0; j < b[i][0]; j++) {\n      for (x = 0; x < b[i][1]; x++) {\n        scanf(\"%d\", &a[i][j][x]);\n        if (j == 0 || x == 0 || j == b[i][0] - 1 || x == b[i][1] - 1)\n          n[i] += a[i][j][x];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", n[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *a[100];\n  int k, *m, *n, i, plus = 0, j, l;\n  scanf(\"%d\", &k);\n  m = (int *)malloc(100 * sizeof(int));\n  n = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", m + i);\n    scanf(\"%d\", n + i);\n    a[i] = (int *)malloc(((*(m + i)) * (*(n + i))) * sizeof(int));\n    for (j = 0; j < *(m + i); j++) {\n      for (l = 0; l < *(n + i); l++)\n        scanf(\"%d\", a[i] + (j * (*(n + i)) + l));\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < *(m + i); j++) {\n      plus = plus + (*(a[i] + (j * (*(n + i)))));\n      plus = plus + (*(a[i] + ((j + 1) * (*(n + i)) - 1)));\n    }\n    for (l = 1; l < (*(n + i)) - 1; l++) {\n      plus = plus + (*(a[i] + l));\n      plus = plus + (*(a[i] + l + (*(m + i) - 1) * (*(n + i))));\n    }\n    printf(\"%d\\n\", plus);\n    plus = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, a[100][100];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int r, s;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        cin >> a[r][s];\n    int sum = 0;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        if (r == 0 || r == m - 1 || s == 0 || s == n - 1)\n          sum = sum + a[r][s];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], n, s[100] = {0}, i, j, len, col, m, sum = 0;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d\", &len, &col);\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        sum += sz[i][j];\n      }\n    }\n    if (col == 1 || len == 1) {\n      s[m] = sum;\n    } else {\n      for (j = 0; j < col - 1; j++) {\n        s[m] += sz[0][j];\n      }\n      for (i = 0; i < len - 1; i++) {\n        s[m] += sz[i][col - 1];\n      }\n      for (j = 1; j < col; j++)\n        s[m] += sz[len - 1][j];\n\n      for (i = 1; i < len; i++) {\n        s[m] += sz[i][0];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9719", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int e = 1; e <= k; e++) {\n    cin >> m >> n;\n    for (int i = 1; i <= m; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 && n == 1)\n      cout << a[1][1] << endl;\n    else {\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[1][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][1];\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[m][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][n];\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i1, i2, i3, j, total;\n  scanf(\"%d\", &k);\n  for (i1 = 1; i1 <= k; i1++) {\n    scanf(\"\\n%d %d\", &m, &n);\n    total = 0;\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      scanf(\"\\n%d\", &a[i2][0]);\n      for (i3 = 1; i3 <= n - 1; i3++) {\n        scanf(\" %d\", &a[i2][i3]);\n      }\n    }\n\n    if (m == 1 && n == 1) {\n      total = a[0][0];\n      cout << total << \"\\n\";\n      continue;\n    }\n    for (i2 = 0; i2 <= n - 1; i2++) {\n      total = total + a[0][i2] + a[m - 1][i2];\n    }\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      total = total + a[i2][0] + a[i2][n - 1];\n    }\n    total = total - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n\n    printf(\"%d\\n\", total);\n  }\n}\n"}
{"label": "6", "index": "9721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint mat[1000][1000];\nint main() {\n\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n    for (int j = 0; j < n; j++) {\n      if (m > 1)\n        sum += mat[m - 1][j];\n      sum += mat[0][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      if (n > 1)\n        sum += mat[i][n - 1];\n      sum += mat[i][0];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9722", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint sum(int m, int n, int a[][100]) {\n  int i, sum = 0;\n  for (i = 0; i < n; i++) {\n    sum += *(*(a + m - 1) + i);\n    sum += *((*a) + i);\n  }\n  for (i = 1; i <= m - 2; i++) {\n    sum += **(a + i);\n    sum += *(*(a + i) + n - 1);\n  }\n  return sum;\n}\nint main() {\n  int m, n, i, k, j, p, a[100][100];\n  cin >> p;\n  for (i = 1; i <= p; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(m, n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100][100], n, m, i, j, sum;\n  cin >> k;\n  for (; k > 0; k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m == 1 && n != 1)\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    if (n == 1 && m != 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n == 1 && m == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i + 1];\n      for (i = 0; i < m - 1; i++)\n        sum += a[i + 1][0] + a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9724", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k, x;\n  x = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int row = 0; row < m; row++) {\n      for (int col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (int row = 0; row < m; row++)\n      x += sz[row][0];\n\n    for (int col = 1; col < n; col++) {\n      x += sz[0][col];\n    }\n    for (int row = 1; row < m; row++) {\n      x += sz[row][n - 1];\n    }\n    for (int col = 1; col < n - 1; col++) {\n      x += sz[m - 1][col];\n    }\n    printf(\"%d\\n\", x);\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9725", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, a, b, m, n, k, i, j;\n  int num[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (a = 0; a < 100; a++) {\n      for (b = 0; b < 100; b++)\n        num[a][b] = 0;\n    }\n    cin >> m >> k;\n    if (m == 1 && k == 1) {\n      scanf(\"%d\", &j);\n      printf(\"%d\", j);\n    } else if (m == 1 && k != 1) {\n      for (a = 0; a < k; a++) {\n        scanf(\"%d\", &num[0][a]);\n        sum = sum + num[0][a];\n      }\n      printf(\"%d\", sum);\n    } else if (m != 1 && k == 1) {\n      for (a = 0; a < m; a++) {\n        scanf(\"%d\", &num[a][0]);\n        sum = sum + num[a][0];\n      }\n      printf(\"%d\", sum);\n    } else {\n      for (a = 0; a < m; a++) {\n        for (b = 0; b < k; b++) {\n          scanf(\"%d\", &num[a][b]);\n        }\n      }\n      for (a = 0; a < k; a++) {\n        sum = sum + num[0][a] + num[m - 1][a];\n      }\n      for (a = 1; a < (m - 1); a++) {\n        sum = sum + num[a][0] + num[a][k - 1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n}\n"}
{"label": "6", "index": "9726", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, j;\n  int m, n;\n  int a[10000];\n  int *p, r;\n  int sum = 0;\n\n  scanf(\"%d\\n\", &k);\n\n  int i;\n  p = a;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n\n    for (j = 0; j < 10000; j++)\n      *(p + j) = 0;\n\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", &*(p + j));\n\n    for (j = 0; j < n; j++)\n      sum = sum + *(p + j);\n\n    for (r = 1; r < m - 1; r++) {\n      sum = sum + *(p + n * r) + *(p + n * r + n - 1);\n    }\n\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(p + (m - 1) * n + j);\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "9727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, sum = 0;\n  int a[100][100];\n  int b[1000];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    if ((m != 1) && (n != 1)) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        sum = sum + a[m - 1][l];\n      }\n      for (j = 1; j < m - 1; j++) {\n        sum = sum + a[j][0];\n        sum = sum + a[j][n - 1];\n      }\n      b[i] = sum;\n      sum = 0;\n    } else if (m = 1) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        b[i] = sum;\n        sum = 0;\n      }\n    } else if (n = 1) {\n      for (j = 0; j < m; j++) {\n        sum = sum + a[j][0];\n        b[i] = sum;\n        sum = 0;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int add = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (l = 0; l < n; l++)\n      add += (a[0][l] + a[m - 1][l]);\n    for (l = 1; l < m - 1; l++)\n      add += (a[l][0] + a[l][n - 1]);\n    printf(\"%d \", add);\n    for (j = 0; j < 100; j++) {\n      for (l = 0; l < 100; l++)\n        a[j][l] = 0;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, r, s, a[100][100], j, k = 1, sum;\n  cin >> n;\n  while (k <= n) {\n    scanf(\"%d %d\", &r, &s);\n    sum = 0;\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < s; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n    if (r == 1) {\n      for (i = 0; i < s; i++)\n        sum += *(*(a + 0) + i);\n    } else if (s == 1) {\n      for (i = 0; i < r; i++)\n        sum += *(*(a + i) + 0);\n    } else {\n      for (i = 0, j = 0; j < s - 1; j++)\n        sum += *(*(a + i) + j);\n      for (i = 0, j = s - 1; i < r - 1; i++)\n        sum += *(*(a + i) + j);\n      for (i = r - 1; j > 0; j--)\n        sum += *(*(a + i) + j);\n      for (j = 0; i > 0; i--)\n        sum += *(*(a + i) + j);\n    }\n    cout << sum << \"\\n\";\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9730", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int count, m, n, array[100][100], sum[100] = {0}, i, j, p;\n  scanf(\"%d\", &count);\n  for (i = 0; i < count; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (p = 0; p < n; p++)\n        scanf(\"%d\", &array[j][p]);\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + array[0][j];\n      if (m > 1)\n        sum[i] = sum[i] + array[m - 1][j];\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum[i] = sum[i] + array[j][0];\n      sum[i] = sum[i] + array[j][n - 1];\n    }\n  }\n  for (i = 0; i < count; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m1[120], m2[120], a[100][120][120];\n  int i, j, k, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &m1[i], &m2[i]);\n    for (j = 0; j < m1[i]; j++)\n      for (k = 0; k < m2[i]; k++)\n        cin >> a[i][j][k];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (m1[i] == 1) {\n      for (j = 0; j < m2[i]; j++)\n        s = s + a[i][0][j];\n    } else if (m2[i] == 1) {\n      for (j = 0; j < m1[i]; j++)\n        s = s + a[i][j][0];\n    } else {\n      for (j = 0; j < m2[i] - 1; j++)\n        s = s + a[i][0][j];\n      for (j = 0; j < m1[i] - 1; j++)\n        s = s + a[i][j][m2[i] - 1];\n      for (j = m2[i] - 1; j > 0; j--)\n        s = s + a[i][m1[i] - 1][j];\n      for (j = m1[i] - 1; j > 0; j--)\n        s = s + a[i][j][0];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, s, t, p, q;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    s = 0;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++)\n        if (p == 0 || q == 0 || p == m - 1 || q == n - 1)\n          s = s + a[p][q];\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\nint n, m;\nint sum(int a[1000][1000]) {\n  int sum = 0;\n  for (int i = 0; i < n; i++)\n    sum += *(a[0] + i);\n\n  for (int i = 1; i < m; i++)\n    sum += *(a[i] + (n - 1));\n\n  for (int i = n - 2; i >= 0; i--)\n    sum += *(a[m - 1] + i);\n\n  for (int i = m - 2; i >= 1; i--)\n    sum += *(a[i] + 0);\n  return sum;\n}\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> array_1[j][k];\n    printf(\"%d\\n\", sum(array_1));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 10, b = 10, o = 10, p = 10, sum, area[111][111];\n  int k = 10, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        scanf(\"%d\", &area[o][p]);\n      }\n    }\n    for (p = 0; p < b; p++)\n      sum += area[0][p] + area[a - 1][p];\n    for (o = 1; o < a - 1; o++)\n      sum += area[o][0] + area[o][b - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int x = 1; x <= k; x++) {\n    int m, n;\n    int A[100][100];\n    int sum = 0, a;\n    cin >> m >> n;\n    for (int j = 1; j <= n; j++) {\n      cin >> a;\n      sum += a;\n    }\n    for (int i = 2; i <= m - 1; i++) {\n      cin >> a;\n      sum += a;\n      for (int j = 2; j <= n - 1; j++)\n        cin >> a;\n      cin >> a;\n      sum += a;\n    }\n    if (n != 1) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a;\n        sum += a;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9736", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100], sum[100];\n  cin >> k;\n  for (int w = 0; w < 100; w++) {\n    sum[w] = 0;\n  }\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[k]);\n        if (j == 0 || j == m - 1 || k == 0 || k == n - 1)\n          sum[i] = sum[i] + a[k];\n      }\n    }\n  }\n  for (int p = 0; p < k; p++) {\n    cout << sum[p] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9737", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[100][100], k, n, m;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    int *p = a[0];\n    for (; p < a[0] + n; p++) \n      sum += *p;\n    if (m == 1) \n    {\n      cout << sum << endl;\n      continue;\n    }\n    p = a[m - 1];\n    for (; p < a[m - 1] + n; p++) \n      sum += *p;\n    int(*q)[100] = a + 1;\n    for (; q <= a + m - 2; q++) \n      sum += **q + *((*q) + n - 1);\n    if (n == 1) \n    {\n      cout << (sum - a[0][0] - a[m - 1][0]) / 2 + a[0][0] + a[m - 1][0];\n      continue;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, hang, lie, h, *p, i, j, a[10000], place;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\\n\", &hang, &lie);\n    p = a;\n    for (j = 1; j <= hang; j++) {\n      for (h = 1; h <= lie; h++) {\n        cin >> *(p++);\n      }\n    }\n    for (place = 0; place <= lie - 1; place++) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = 2 * lie - 1; place < hang * lie - 1; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = hang * lie - 1; place > hang * lie - lie; place--) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = lie; place <= hang * lie - lie; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9739", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], times, x, y, i, j, k, sum = 0;\n  int *pointer = NULL;\n  cin >> times;\n  for (i = 1; i <= times; i++) {\n    sum = 0;\n    cin >> x >> y;\n    for (k = 0; k < x; k++) {\n      for (j = 0; j < y; j++) {\n        cin >> a[k][j];\n        pointer = &a[k][j];\n        if (k == 0 || j == 0 || k == x - 1 || j == y - 1)\n          sum = sum + *pointer;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9740", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t, i, j, k, a[100][100][100], b[100] = {0}, m[100], n[100];\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n    for (j = 0; j < m[i]; j++)\n      b[i] = b[i] + a[i][j][0] + a[i][j][n[i] - 1];\n    for (j = 0; j < n[i]; j++)\n      b[i] = b[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    b[i] = b[i] - a[i][0][0] - a[i][m[i] - 1][0] - a[i][0][n[i] - 1] -\n           a[i][m[i] - 1][n[i] - 1];\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9741", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nconst int M = 100 + 10;\nconst int N = 100 + 10;\nint mat[M][N];\nint main(void) {\n  int cases, i, j, ans, m, n;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    ans = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; ++i) {\n      for (j = 0; j < n; ++j)\n        scanf(\"%d\", mat[i] + j);\n    }\n    if (m == 0 || n == 0) {\n      printf(\"%d\\n\", 0);\n      continue;\n    }\n    if (m == 1) {\n      for (i = 0; i < n; ++i) {\n        ans += mat[0][i];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    } else {\n      if (n == 1) {\n        for (i = 0; i < m; ++i) {\n          ans += mat[i][0];\n        }\n        printf(\"%d\\n\", ans);\n        continue;\n      }\n    }\n\n    for (i = 0; i < n; ++i) {\n      ans += mat[0][i];\n      ans += mat[m - 1][i];\n    }\n    for (i = 0; i < m; ++i) {\n      ans += mat[i][0];\n      ans += mat[i][n - 1];\n    }\n    ans -= (mat[0][0] + mat[0][n - 1] + mat[m - 1][0] + mat[m - 1][n - 1]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9742", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k, l, sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[j][l];\n        if (j == 1 || j == m || l == 1 || l == n) {\n          sum += a[j][l];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9743", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, a[100][100], i, j, k, sum;\n  int *p;\n  cin >> t;\n  for (k = 1; k <= t; k++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = a[0]; p <= a[0] + n - 1; p++) {\n      sum = sum + *p;\n    }\n    for (i = 1; i <= m - 2; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (p = a[m - 1]; p <= a[m - 1] + n - 1; p++) {\n      sum = sum + *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int kk, m, n, i, j, k, a[100][100], c[300];\n  scanf(\"%d\", &kk);\n  for (i = 0; i < kk; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    *(c + i) = 0;\n    if (m == 1 & n == 1)\n      *(c + i) = a[0][0];\n    else {\n      for (j = 1, k = 0; j < m; j++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = 1, j--; k < n; k++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (j = j - 1, k--; j >= 0; j--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = k - 1, j++; k >= 0; k--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < kk; i++)\n    printf(\"%d\\n\", *(c + i));\n  return 0;\n}\n"}
{"label": "6", "index": "9745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int j, n, k, i, m, l, sum;\n\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", (&sz[i][j]));\n      }\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      sum += sz[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      sum += sz[m - 1][j];\n    }\n    j = 0;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][n - 1];\n    }\n\n    printf(\"%d \", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, i, k, m, n, t, sum[100] = {0}, j, q, x;\n  scanf(\"%d\\n%\", &k);\n  p = (int *)malloc(10000 * sizeof(int));\n  for (x = 0; x < k; x++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    for (j = 0; j < n; j++)\n      sum[x] = sum[x] + (*(p + j)) + (*(p + n * (m - 1) + j));\n    for (q = 1; q < m - 1; q++)\n      sum[x] = sum[x] + (*(p + q * n)) + (*(p + q * n + n - 1));\n  }\n  for (x = 0; x < k; x++)\n    cout << sum[x] << \"\\n\";\n}\n"}
{"label": "6", "index": "9747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++)\n    s += a[1][i];\n  for (i = 2; i <= m; i++) {\n    s += a[i][n];\n  }\n  for (i = n - 1; i >= 1; i--)\n    s += a[m][i];\n  for (i = m - 1; i > 1; i--)\n    s += a[i][1];\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    printf(\"%d\\n\", juzhen(m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][100][100], b[100][2], s[100], i, j, l, x, y;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    x = b[i][0];\n    y = b[i][1];\n    s[i] = 0;\n    for (j = 0; j < x; j++) {\n      for (l = 0; l < y; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n        if (j == 0 || l == 0 || j == x - 1 || l == y - 1)\n          s[i] += a[j][l][i];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "9749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, sum, x, y;\n  int a[100], b[100], ar[100][100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a[i], &b[i]);\n    x = a[i] - 1;\n    y = b[i] - 1;\n    for (j = 0; j < a[i]; j++) {\n      for (k = 0; k < b[i]; k++) {\n        cin >> ar[j][k];\n      }\n    }\n    sum = 0;\n    for (j = 0; j < a[i]; j++) {\n      sum = sum + ar[j][0] + ar[j][y];\n    }\n    for (k = 0; k < b[i]; k++) {\n      sum = sum + ar[0][k] + ar[x][k];\n    }\n    sum = sum - ar[0][0] - ar[0][y] - ar[x][0] - ar[x][y];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9750", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  scanf(\"%d \", &k);\n  int u;\n  for (u = 1; u <= k; u++) {\n    int i, j;\n    cin >> m >> n;\n    int input[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> input[i][j];\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      sum += input[i][0] + input[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum += input[0][j] + input[m - 1][j];\n    }\n    sum = sum - input[0][0] - input[0][n - 1] - input[m - 1][0] -\n          input[m - 1][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p = {NULL}, a[100][100], z, m, n, i = 1, j = 0, s;\n  cin >> z;\n  while (i <= z) {\n    s = 0;\n    cin >> m >> n;\n    p = *a;\n    for (j = 0; j < m * n; j++) {\n      cin >> *p++;\n      if (j < n || j >= n * (m - 1) || j % n == 0 || (j + 1) % n == 0) {\n        s += *(p - 1);\n      }\n    }\n    printf(\"%d\\n\", s);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, i, j;\n    scanf(\"%d %d \", &m, &n);\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9753", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sub(void) {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *p;\n  int i, sum = 0;\n  p = (int *)malloc(10000 * sizeof(int));\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 1; i < n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = m * n - n + 1; i < m * n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = 0; i < m * n; i++)\n    if ((i % n) == 0 || ((i + 1) % n) == 0)\n      sum = sum + *(p + i);\n  printf(\"%d\\n\", sum);\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sub();\n}\n"}
{"label": "6", "index": "9754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m, n, sum = 0;\n  int i, j, p;\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (i = m - 1, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = 0, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = n - 1, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    sum = sum - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, k, sum = 0, a;\n  int i, j, q, b[100];\n  int s[100][100];\n  scanf(\"%d\", &k);\n\n  for (q = 1; q <= k; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += s[1][j];\n      sum += s[m][j];\n    }\n    for (i = 1; i <= m; i++) {\n      sum += s[i][1];\n      sum += s[i][n];\n    }\n    a = s[1][1] + s[1][n] + s[m][1] + s[m][n];\n    sum -= a;\n    b[q] = sum;\n    sum = 0;\n  }\n  for (q = 1; q <= k; q++) {\n    cout << b[q] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k; \n  cin >> k;\n  int m, n;        \n  int a[110][110]; \n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    if (m > 1 && n > 1) {\n      for (int t1 = 0; t1 < m; t1++) {\n        for (int t2 = 0; t2 < n; t2++)\n          cin >> *(*(a + t1) + t2); \n      }\n      for (int k1 = 0; k1 < n; k1++)\n        sum = sum + *(*(a + 0) + k1); \n      for (int k2 = 0; k2 < n; k2++)\n        sum = sum + *(*(a + m - 1) + k2); \n      for (int k3 = 0; k3 < m; k3++)\n        sum = sum + *(*(a + k3) + 0); \n      for (int k4 = 0; k4 < m; k4++)\n        sum = sum + *(*(a + k4) + n - 1); \n      sum = sum - *(*(a + 0) + 0) - *(*(a + m - 1) + n - 1) -\n            *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0); \n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cin >> sum;\n      cout << sum << endl;\n    } \n    else if (m == 1 && n > 1) {\n      for (int p1 = 0; p1 < n; p1++) {\n        cin >> *(*(a + 0) + p1);\n        sum = sum + *(*(a + 0) + p1);\n      }\n      cout << sum << endl;\n    } \n    else if (m > 1 && n == 1) {\n      for (int p2 = 0; p2 < m; p2++) {\n        cin >> *(*(a + p2) + 0);\n        sum = sum + *(*(a + p2) + 0);\n      }\n      cout << sum << endl;\n    } \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x;\n  cin >> x;\n  int sum = 0;\n  int m, n;\n\n  int g, i, j, temp;\n  for (g = 0; g < x; g++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      cin >> temp;\n      sum += temp;\n    }\n\n    for (i = 0; i < m - 2; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> temp;\n        if (j == 0 || j == n - 1) {\n          sum += temp;\n        }\n      }\n    }\n    if (m != 1) {\n      for (i = 0; i < n; i++) {\n        cin >> temp;\n        sum += temp;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9758", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, j, r;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int b = 0, c = 0, d = 0, e = 0, sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &a[j][r]);\n      }\n    }\n    for (j = 0; j < m; j++) {\n      b += a[j][0];\n      d += a[j][n - 1];\n    }\n    for (r = 1; r < n - 1; r++) {\n      c += a[m - 1][r];\n      e += a[0][r];\n    }\n    sum = b + c + d + e;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, k, sum;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    k--;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        sum += *(*a + j);\n      else\n        sum += *(*a + j) + *(*(a + m - 1) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += a[i][0] + a[i][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9760", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int row, col, j, l, sum = 0, num[100][100];\n    cin >> col >> row;\n    for (l = 0; l < col; l++) {\n      int *a = num[l];\n      for (j = 0; j < row; j++) {\n        scanf(\"%d\", a + j);\n        if (l == 0 || l == col - 1 || j == 0 || j == row - 1) {\n          sum = sum + *(a + j);\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, sum[100] = {0};\n  int x, y, z;\n  cin >> k;\n\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (y = 0; y < m; y++) {\n      for (z = 0; z < n; z++) {\n        cin >> a;\n        if (z == 0 || y == 0 || z == n - 1 || y == m - 1)\n          sum[x] = sum[x] + a;\n      }\n    }\n  }\n\n  for (x = 0; x < k; x++)\n    cout << sum[x] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "9762", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[100][100] = {0};\n  int x, y, i, j, k, n, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> x >> y;\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++)\n        cin >> *(*(a + i) + j);\n\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        if (i == 0 || j == 0 || i == (x - 1) || j == (y - 1))\n          sum += *(*(a + i) + j);\n      }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, N, w, s;\n  int a[100][100];\n  scanf(\"%d\\n\", &N);\n  for (w = 0; w < N; w++) {\n    s = 0;\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if ((n > 1) && (m > 1)) {\n\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n      for (i = 0; i < n; i++)\n        s += a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][0];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][n - 1];\n    }\n    if ((n == 1) && (m > 1)) {\n      s = a[0][0] + a[m - 1][0];\n    }\n    if ((n > 1) && (m == 1))\n      s = a[0][0] + a[0][n - 1];\n    if ((n == 1) && (m == 1))\n      s = a[0][0];\n\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int e = 1; e <= k; e++) {\n    cin >> m >> n;\n    for (int i = 1; i <= m; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 && n == 1)\n      cout << a[1][1] << endl;\n    else {\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[1][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][1];\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[m][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][n];\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], i, j, m, n, k, max;\n  int *pa;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m * n; j++)\n      scanf(\"%d\", &a[j - 1]);\n    pa = a;\n    if ((m >= 2) && (n >= 2)) {\n      for (j = 1; j < n; j++)\n        *pa += a[j];\n      for (j = m * n - n; j < m * n; j++)\n        *pa += a[j];\n      for (j = n; j < m * n - n; j++)\n        if ((j % n == 0) || (j % n == n - 1))\n          *pa += a[j];\n    } else {\n      for (j = 1; j < m * n; j++)\n        *pa += a[j];\n    }\n    printf(\"%d\\n\", *pa);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, hang, lie, h, *p, i, j, a[10000], place;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\\n\", &hang, &lie);\n    p = a;\n    for (j = 1; j <= hang; j++) {\n      for (h = 1; h <= lie; h++) {\n        scanf(\"%d\", &*(p++));\n      }\n    }\n    for (place = 0; place <= lie - 1; place++) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = 2 * lie - 1; place < hang * lie - 1; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = hang * lie - 1; place > hang * lie - lie; place--) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = lie; place <= hang * lie - lie; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ac[100][100], i, j, k, *p, n, a, b, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    s = 0;\n    scanf(\"%d %d \", &a, &b);\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> ac[j][k];\n    for (j = 0; j < a; j++) {\n      if (j == 0 || j == a - 1)\n        for (p = ac[j]; p < ac[j] + b; p++)\n          s += *p;\n      else {\n        p = ac[j];\n        s = s + *p + *(p + b - 1);\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[105][105];\n  long m, n, k, z, sum, i, j;\n  scanf(\"%d\", &z);\n  for (i = 1; i <= z; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if (m >= 2 && n >= 2) {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (k = 1; k <= n; k++)\n        sum = sum + a[1][k] + a[m][k];\n      for (j = 2; j <= m - 1; j++) {\n        sum = sum + a[j][1] + a[j][n];\n      }\n      printf(\"%d\\n\", sum);\n    }\n\n    else {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++)\n          sum = sum + a[j][k];\n      }\n      printf(\"%ld\\n\", sum);\n    }\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9769", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, board[100][100], sum = 0;\n    int(*p)[100];\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++)\n        scanf(\"%d \", &board[j][p]);\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++) {\n        if (j == 0 || j == m - 1 || p == 0 || p == n - 1)\n          sum += board[j][p];\n      }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9770", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int MAX = 100;\n\nint main() {\n  int k;\n  int A[MAX][MAX];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &A[i][j]);\n      }\n    }\n    int sum = 0;\n    \n\n    if ((m != 1) && (n != 1)) {\n      for (int j = 0; j < n; j++) {\n        sum += A[0][j];\n      }\n      for (int j = 0; j < n; j++) {\n        sum += A[m - 1][j];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][0];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][n - 1];\n      }\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][0] - A[m - 1][n - 1];\n    }\n    \n    else {\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < n; j++)\n          sum += A[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, k, j, p, a[1000][1000], sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (p = 1; p <= n; p++) {\n        scanf(\"%d\", &a[j][p]);\n      }\n    }\n    for (p = 1; p <= n; p++) {\n      sum += a[1][p];\n    }\n    for (j = 2; j <= m; j++) {\n      sum += a[j][n];\n    }\n    for (p = n - 1; p >= 1; p--) {\n      sum += a[m][p];\n    }\n    for (j = m - 1; j >= 2; j--) {\n      sum += a[j][1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, x, m, n, i, j, k, sum[10000] = {0};\n  int sz[100][100];\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &sz[j][k]);\n    }\n    if ((m > 2) && (n > 2)) {\n      for (j = 0; j < m; j++) {\n        sum[i] = sum[i] + sz[j][0] + sz[j][n - 1];\n      }\n      for (k = 0; k < n; k++) {\n        sum[i] = sum[i] + sz[0][k] + sz[m - 1][k];\n      }\n      sum[i] =\n          sum[i] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    } else {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < n; k++) {\n          sum[i] = sum[i] + sz[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9773", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int k, i;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int m, n, a, b, sp = 0;\n    cin >> m >> n;\n    for (a = 0; a <= m - 1; a++) {\n      for (b = 0; b <= n - 1; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n        sp = sp + sz[a][b];\n      }\n    }\n    int sum = 0;\n    for (b = 0; b <= n - 1; b++) {\n      sum = sum + sz[0][b] + sz[m - 1][b];\n    }\n    for (a = 0; a <= m - 1; a++)\n      sum = sum + sz[a][0] + sz[a][n - 1];\n\n    sum = sum - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    if (m == 1 || n == 1) {\n      sum = sp;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t, i, j, l, sum = 0, a[100][100];\n  scanf(\"%d\", &t);\n  for (l = 0; l < t; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (m == n && n == 1) {\n      printf(\"%d\", a[0][0]);\n    } else {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n    sum = 0;\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "6", "index": "9775", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l;\n  int m[100], n[100];\n  int sum[100] = {0};\n  int a[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (l = 0; l < n[i] - 1; l++) {\n      sum[i] += a[0][l][i];\n    }\n    for (j = 0; j < m[i] - 1; j++) {\n      sum[i] += a[j][n[i] - 1][i];\n    }\n    for (l = n[i] - 1; l > 0; l--) {\n      sum[i] += a[m[i] - 1][l][i];\n    }\n    for (j = m[i] - 1; j > 0; j--) {\n      sum[i] += a[j][0][i];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum;\n  int *p;\n  cin >> k;\n  for (; k > 0; k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = a[0]; p < a[0] + n; p++)\n      sum += *p;\n    for (p = p + 99; p < a[0] + (m - 1) * 100 + n; p = p + 100)\n      sum += *p;\n    for (p = p - 101; p > a[0] + (m - 1) * 100 - 1; p--)\n      sum += *p;\n    for (p = p - 99; p > a[0]; p = p - 100)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s, x;\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    s = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> x;\n        if (i == 1 || i == m | j == 1 || j == n)\n          s += x;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, a[100][100], i, j, k, sum;\n  int *p;\n  cin >> t;\n  for (k = 1; k <= t; k++) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n    for (p = a[0]; p <= a[0] + n - 1; p++)\n      sum = sum + *p;\n\n    for (i = 1; i <= m - 2; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (p = a[m - 1]; p <= a[m - 1] + n - 1; p++) {\n      sum = sum + *p;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9779", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0, a[500][500] = {0}, (*p)[500];\n  cin >> k;\n  int i = 0, j = 0;\n  p = a;\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    int result = 0;\n    p = a;\n    for (i = 0; i < m; i++)\n      result = result + *(*(p + i));\n    p = a;\n    for (i = 0; i < m && n != 1; i++)\n      result = result + *(*(p + i) + n - 1);\n    p = a + m - 1;\n    for (i = 1; i < n - 1; i++) {\n      result = result + *(*p + i);\n    }\n    p = a;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    cout << result << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  for (int i = 1; i <= a; i++) {\n    int m, n, t = 0;\n    cin >> m >> n;\n    int x[100][100];\n    int *p;\n    for (int i = 0; i < m; i++) \n    {\n      for (int j = 0; j < n; j++) \n      {\n        cin >> *(*(x + i) + j);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << *(*(x)) << endl;\n    }                     \n    if (m == 1 && n != 1) \n    {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n == 1) \n    {\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i));\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n != 1) \n    {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j); \n      }\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x + m - 1) + j); \n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + 0); \n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + n - 1); \n      }\n      cout << t - *(*(x + 0) + 0) - *(*(x + 0) + n - 1) - *(*(x + m - 1) + 0) -\n                  *(*(x + m - 1) + n - 1)\n           << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9781", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, h, l, y;\n  int *p = NULL;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    y = 0;\n    int x[101][101] = {0};\n    cin >> h >> l;\n    for (j = 1; j <= h; j++) {\n      for (k = 1; k <= l; k++) {\n        cin >> x[j][k];\n      }\n    }\n\n    for (p = x[1] + 1; p <= x[1] + l; p++) {\n      y = y + (*p);\n    }\n\n    for (p = x[2] + 1; p <= x[h - 1] + 1; p = p + 101)\n      y = y + (*p) + (*(p + l - 1));\n\n    for (p = x[h] + 1; p <= x[h] + l; p++) {\n      y = y + (*p);\n    }\n    cout << y << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum = 0; \n  cin >> k;                                \n  while (cin >> m >> n)                    \n  {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m >= 3 && n >= 3) {\n      for (i = 0; i < n; i++) \n        sum = sum + a[0][i] + a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + a[i][0] + a[i][n - 1];\n    } else {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          sum = sum + a[i][j];\n    }\n    cout << sum << endl; \n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s, x;\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    s = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 1 || i == m | j == 1 || j == n)\n          s += x;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9784", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (t = 1; t <= n; t++) {\n        cin >> a[j][t]; \n      }\n    }\n    if (m == 1 && n == 1)\n      sum = a[1][1];\n    else\n      for (j = 1; j <= m; j++) {\n        sum = sum + a[j][1];\n        sum = sum + a[j][n];\n      }\n    for (t = 2; t < n; t++) {\n      sum = sum + a[1][t];\n      sum = sum + a[m][t];\n    }                    \n    cout << sum << endl; \n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  int i;\n  for (i = 0; i < num; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[m][n];\n    for (int j = 0; j < m; j++)\n      for (int h = 0; h < n; h++)\n        scanf(\"%d\", &a[j][h]);\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      sum += a[0][j];\n    for (int j = 1; j < m; j++)\n      sum += a[j][0];\n    for (int j = 1; j < n; j++)\n      sum += a[m - 1][j];\n    for (int j = 1; j < m - 1; j++)\n      sum += a[j][n - 1];\n    cout << sum << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, jz[100][100], sum = 0; \n  cin >> k;                                 \n  while (cin >> m >> n)                     \n  {\n    for (i = 0; i < m; i++) \n    {\n      for (j = 0; j < n; j++)\n        cin >> jz[i][j];\n    }\n    if (m == 1 && n == 1) \n      sum = jz[0][0];\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i] + jz[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + jz[i][0] + jz[i][n - 1];\n    }\n    cout << sum << endl; \n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, j, i, m, t, all, sum;\n  int s[500][500];\n  scanf(\"%d\", &all);\n  m = 0;\n  for (t = 0; t < all; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &s[i][j]);\n        sum += s[i][j];\n      }\n    if ((m == 1) || (n == 1))\n      printf(\"%d\\n\", sum);\n    else {\n      for (i = 1; i <= m - 2; i++)\n        for (j = 1; j <= n - 2; j++)\n          sum = sum - s[i][j];\n      cout << sum << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9788", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], row, col, sum = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    cin >> row >> col;\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        cin >> a[i][j];\n    if (row == 1 && col == 1)\n      printf(\"%d\", *(a[0]));\n    else {\n      for (int i = 0; i < col; i++) {\n        sum += *(a[0] + i);\n        sum += *(a[row - 1] + i);\n      }\n      for (int j = 1; j < row - 1; j++) {\n        sum += *(a[j]);\n        sum += *(a[j] + col - 1);\n      }\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9789", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid clear(int z[][100], int x, int y);\nint main() {\n  int k, i, s, j, m, n, a[100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    clear(a, m, n);\n    for (j = 0; j < m; j++) {\n      for (s = 0; s < n; s++)\n        scanf(\"%d \", &a[j][s]);\n    }\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + 0) + j);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + m - 1) + j);\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j));\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j) + n - 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid clear(int z[][100], int x, int y) {\n  int i, j;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++)\n      z[i][j] = 0;\n  }\n}\n"}
{"label": "6", "index": "9790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, m, sum = 0, x, y;\n  i = 0;\n  int sj[100];\n  int sz[100][100];\n  cin >> x;\n  for (y = 0; y < x; y++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[i][k]);\n      }\n    }\n    for (k = 0; k < n; k++) {\n      sum = sum + sz[0][k] + sz[m - 1][k];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0] + sz[i][n - 1];\n    }\n    sj[y] = sum;\n    sum = 0;\n  }\n  for (y = 0; y < x; y++) {\n    cout << sj[y] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n\n    int sz[m][n];\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &(sz[j][i]));\n      }\n    }\n\n    int a = 0;\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        a += sz[j][i];\n      }\n    }\n    for (int j = 1; j < m - 1; j++) {\n      for (int i = 1; i < n - 1; i++) {\n        a -= sz[j][i];\n      }\n    }\n    cout << a << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, i, j, k, s = 0;\n  int m, n, a[100][100];\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n        if (j == 0 || j == m - 1 || (k == 0 && j != 0 && j != m - 1) ||\n            (k == n - 1 && j != 0 && j != m - 1))\n          s = s + a[j][k];\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9793", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int zong;\n  int sz[100][100], m, n, k, i, j, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  cin >> zong;\n  for (k = 0; k < zong; k++) {\n    int sum = 0;\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i < m; i++) {\n      cin >> sz[0][i];\n      sum1 += sz[0][i];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[n - 1][i]);\n      sum2 += sz[n - 1][i];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      sum3 += sz[i][0];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      sum4 += sz[i][m - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, ans, i, j, x;\n  scanf(\"%d\", &k);\n  while (k--) {\n    scanf(\"%d%d\", &n, &m);\n    ans = 0;\n    for (i = 1; i <= n; i++) {\n      if (i == 1 || i == n)\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          ans += x;\n        }\n      else\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          if (j == 1 || j == m)\n            ans += x;\n        }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nconst int N = 110;\n\nint a[N][N];\n\nint main() {\n  int i, j, k;\n  int x;\n  int m, n;\n  cin >> x;\n  while (x--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    } else {\n      for (i = 0; i < n; i++) {\n        sum += a[0][i];\n        sum += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9796", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a, n, m;\n  cin >> a;\n  for (int i = 0; i < a; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    int A[100][100] = {0};\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> A[j][k];\n      }\n    }\n    if (m == 1 && n == 1)\n      cout << A[0][0] << endl;\n    else {\n      for (int j = 0; j < m; j++)\n        sum = sum + A[j][0] + A[j][n - 1];\n      for (int j = 0; j < n; j++)\n        sum = sum + A[0][j] + A[m - 1][j];\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][n - 1] - A[m - 1][0];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int j, i, m, n, *pointer = NULL, a[100][100], sum = 0;\n  cin >> j;\n  for (i = 0; i < j; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    pointer = *a;\n    for (; pointer < *a + m * n; pointer++) {\n      cin >> *pointer;\n    }\n    for (pointer = *a; pointer < *a + m * n; pointer++) {\n      if (pointer >= *a && pointer <= *a + n - 1) {\n        sum += *pointer;\n        continue;\n      }\n      if ((pointer - *a) % n == 0) {\n        sum += *pointer;\n        sum += *(pointer + n - 1);\n        continue;\n      }\n      if (pointer >= *a + m * n - n && pointer < *a + m * n - 1) {\n        sum += *pointer;\n        continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9798", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  int a = 0, b = 0, c = 0, d = 0, e = 0;\n  int sz[100][100];\n  cin >> k;\n  for (int l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      a += sz[i][0];\n      b += sz[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      c += sz[0][j];\n      d += sz[m - 1][j];\n    }\n    e = a + b + c + d - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n        sz[m - 1][n - 1];\n    printf(\"%d\\n\", e);\n    e = 0;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k; \n  int m; \n  int n; \n  int i, j, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    int sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        sum = sum + a[i][j];\n      }\n    }\n    for (i = 1; i <= m - 2; i++) {\n      for (j = 1; j <= n - 2; j++) {\n        sum = sum - a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum = 0;\n  cin >> k;\n  int a[100][100];\n  for (int i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m != 1 && n != 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i) + *(*(a + m - 1) + i);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      printf(\"%d\\n\", sum);\n    } else\n      cout << **a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9801", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, q;\n  int k;\n  int m, n;\n  int a[110][110];\n  int sum;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (q = 0; q < n; q++)\n\n        scanf(\"%d\", *(a + j) + q);\n    }\n\n    for (j = 0; j < n; j++) {\n      sum += *(*a + j);\n      if (m != 1)\n        sum += *(*(a + m - 1) + j);\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += *(*(a + j));\n      if (n != 1)\n        sum += *(*(a + j) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, o = 0, i = 0, j = 0, m = 0, n = 0, num = 0, sum = 0;\n  scanf(\"%d\", &k);\n  for (o = 0; o < k; o++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &num);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum = sum + num;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, i, j, k, h, a[100], b[100], juzhen[100][100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &(a[h]), &(b[h]));\n    for (i = 0; i < a[h]; i++) {\n      for (j = 0; j < b[h]; j++) {\n        scanf(\"%d\", &(juzhen[i][j]));\n      }\n    }\n    for (i = 0; i < a[h]; i++) {\n      sum[h] = sum[h] + juzhen[i][0] + juzhen[i][b[h] - 1];\n    }\n    for (j = 1; j < b[h] - 1; j++) {\n      sum[h] = sum[h] + juzhen[0][j] + juzhen[a[h] - 1][j];\n    }\n  }\n  for (h = 0; h < k; h++) {\n    printf(\"%d\\n\", sum[h]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9804", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum = 0;\n  int h, l, a[100][100], i, j, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    cin >> h >> l;\n    for (i = 0; i < h; i++) {\n      for (j = 0; j < l; j++)\n        cin >> a[i][j];\n    }\n    if (h < 2 && l < 2) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < l; j++) {\n      sum += a[0][j];\n      sum += a[h - 1][j];\n    }\n    for (i = 0; i < h; i++) {\n      sum += a[i][0];\n      sum += a[i][l - 1];\n    }\n    sum = sum - a[0][0] - a[0][l - 1] - a[h - 1][0] - a[h - 1][l - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, shuzu[100][100], hang = 0, lie = 0, zu = 0, sum = 0;\n  scanf(\"%d\", &zu);\n  for (i = 0; i < zu; i++) {\n    scanf(\"%d%d\", &hang, &lie);\n    sum = 0;\n    for (j = 0; j < hang; j++) {\n      for (k = 0; k < lie; k++) {\n        scanf(\"%d\", &shuzu[j][k]);\n      }\n    }\n    for (k = 0; k < lie; k++) {\n      sum = sum + shuzu[0][k];\n    }\n    if (hang > 1) {\n      for (k = 0; k < lie; k++) {\n        sum = sum + shuzu[hang - 1][k];\n      }\n    }\n    if (hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][0];\n      }\n    }\n    if (lie > 1 && hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][lie - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *a, *b, *c, *d;\n  int i, j, n, m, k;\n  a = (int *)calloc(1000000, sizeof(int));\n  b = (int *)calloc(10, sizeof(int));\n  scanf(\"%d\", &k);\n  c = a;\n  d = b;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> n >> m;\n    for (j = 0; j < n * m; j++)\n      scanf(\"%d\", c + j);\n    for (j = 0; j < m; j++)\n      sum += *(c + j);\n    for (j = m * (n - 1); j < n * m; j++)\n      sum += *(c + j);\n    for (j = m; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    for (j = m + m - 1; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    *(d++) = sum;\n  }\n  for (d = b; d < b + k; d++) {\n    cout << *d;\n    cout << \"\\n\";\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "6", "index": "9807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int m, n, a, b, sp = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a <= m - 1; a++) {\n      for (b = 0; b <= n - 1; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n        sp = sp + sz[a][b];\n      }\n    }\n    int sum = 0;\n    for (b = 0; b <= n - 1; b++) {\n      sum = sum + sz[0][b] + sz[m - 1][b];\n    }\n    for (a = 0; a <= m - 1; a++) {\n      sum = sum + sz[a][0] + sz[a][n - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    if (m == 1 || n == 1) {\n      sum = sp;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    int data[100][100];\n    cin >> m >> n;\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> data[i][j];\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + data[i][0] + data[i][n - 1];\n    for (i = 1; i < n - 1; i++)\n      sum = sum + data[0][i] + data[m - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, q, s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n  for (q = 0; q < k; q++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n\n    for (i = 0; i < n; i++)\n      s = s + *(*(a + 0) + i);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + n - 1);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + 0);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(a + m - 1) + i);\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "9810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, s;\n  int a[100][100][100];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &b[i], &c[i]);\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k < c[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    s = 0;\n    if (c[i] > 1) {\n      for (j = 0; j < c[i]; j++)\n        s = s + a[i][0][j] + a[i][b[i] - 1][j];\n    } else {\n      s = s + a[i][0][0];\n    }\n    for (j = 1; j < b[i] - 1; j++)\n      s = s + a[i][j][0] + a[i][j][c[i] - 1];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int s = 0;\n    if (m == 1) {\n      for (j = 0; j < n; j++)\n        s += a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n\n      printf(\"%d\\n\", s);\n    } else {\n\n      for (j = 0; j < n - 1; j++)\n        s += a[0][j];\n      for (i = 0; i < m - 1; i++)\n        s += a[i][n - 1];\n      for (j = 1; j < n; j++)\n        s += a[m - 1][j];\n      for (i = 1; i < m; i++)\n        s += a[i][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9812", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int x = 0, y = 0;\n  int total = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    cin >> x >> y;\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        scanf(\"%d\", &Matrix[i][j]);\n        if (i == 0 || i == x - 1)\n          total += Matrix[i][j];\n        else if (j == 0 || j == y - 1)\n          total += Matrix[i][j];\n      }\n    printf(\"%d\\n\", total);\n    total = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sum(int i) {\n  int m, n, j, k, sum = 0;\n  scanf(\"%d %d\", &m, &n);\n  int(*p)[100] = (int(*)[100])calloc(100, 100 * sizeof(int));\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", *(p + j) + k);\n  }\n  for (j = 0; j < m; j++) {\n    if (j == 0 || j == m - 1) {\n      for (k = 0; k < n; k++) {\n        sum = sum + *(*(p + j) + k);\n      }\n    } else\n      sum = sum + *(*(p + j)) + *(*(p + j) + n - 1);\n  }\n  cout << sum << \"\\n\";\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sum(i);\n}\n"}
{"label": "6", "index": "9814", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[100][2], i, j, k, a[100][100] = {0}, *p = NULL, sum = 0, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> num[k][0] >> num[k][1];\n    sum = 0;\n    for (i = 0; i < num[k][0]; i++) {\n      for (j = 0; j < num[k][1]; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (m = 0; m < num[k][0]; m++) {\n      if (m == 0 || m == num[k][0] - 1) {\n        for (p = a[m]; p < a[m] + num[k][1]; p++) {\n          sum = sum + *p;\n        }\n      } else\n        sum = sum + a[m][0] + a[m][num[k][1] - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int k, m, n, i, j, a, sum = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        if (i == 0 || i == m - 1)\n          sum += sz[i][j];\n        if (i > 0 && i < m - 1 && (j == 0 || j == n - 1))\n          sum += sz[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, i, m, n, k, s = 0, *b, j;\n  scanf(\"%d\", &k);\n  b = (int *)calloc(k, sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    a = (int *)calloc(m * n, sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", a + j);\n    for (j = 0; j < m; j++) {\n      s = s + *(a + j * n) + *(a + j * n + n - 1);\n    }\n    for (j = 1; j < n - 1; j++)\n      s = s + *(a + j) + *(a + (m - 1) * n + j);\n\n    *(b + i) = s;\n    free(a);\n    s = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", *(b + i));\n    if (i < k - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "6", "index": "9817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int n, num[100][2], i, j, k, a[100][100] = {0}, *p = NULL, sum = 0, m;\n  cin >> n; \n  for (k = 0; k < n; k++) {\n    cin >> num[k][0] >> num[k][1]; \n    sum = 0;\n    for (i = 0; i < num[k][0]; i++) {\n      for (j = 0; j < num[k][1]; j++) {\n        cin >> a[i][j]; \n      }\n    }\n    for (m = 0; m < num[k][0]; m++) \n    {\n      if (m == 0 || m == num[k][0] - 1) \n      {\n        for (p = a[m]; p < a[m] + num[k][1]; p++)\n          sum = sum + *p;\n      } \n      else\n        sum = sum + a[m][0] + a[m][num[k][1] - 1]; \n    }\n    cout << sum << endl; \n  }\n  return 0;\n} \n"}
{"label": "6", "index": "9818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  cin >> t;\n  for (int time = 0; time < t; time++) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int i = 0; i < n; i++)\n      sum += *(*a + i) + (n > 1) * *(*(a + m - 1) + i);\n    for (int i = 1; i < m - 1; i++)\n      sum += *(*(a + i)) + (m > 1) * *(*(a + i) + n - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, l;\n  int m, n, i, j, s1, s2, s3, s4, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc((sizeof(int) * k));\n  for (l = 0; l < k; l++) {\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s1 += sz[i][0];\n      s2 += sz[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      s3 += sz[0][j];\n      s4 += sz[m - 1][j];\n    }\n    s += s1 + s2 + s3 + s4 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n         sz[m - 1][n - 1];\n    sf[l] = s;\n  }\n  for (l = 0; l < k; l++) {\n    cout << sf[l] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 10, b = 10, o = 10, p = 10, sum, area[111][111];\n  int k = 10, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        scanf(\"%d\", &area[o][p]);\n      }\n    }\n    for (p = 0; p < b; p++)\n      sum += area[0][p] + area[a - 1][p]; \n    for (o = 1; o < a - 1; o++)\n      sum += area[o][0] + area[o][b - 1]; \n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sum(int i) {\n  int m, n, j, k, sum = 0;\n  scanf(\"%d %d\", &m, &n);\n  int(*p)[100] = (int(*)[100])calloc(100, 100 * sizeof(int));\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", *(p + j) + k);\n  }\n  for (j = 0; j < m; j++) {\n    if (j == 0 || j == m - 1) {\n      for (k = 0; k < n; k++)\n        sum = sum + *(*(p + j) + k);\n    } else\n      sum = sum + *(*(p + j)) + *(*(p + j) + n - 1);\n  }\n  printf(\"%d\\n\", sum);\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sum(i);\n}\n"}
{"label": "6", "index": "9822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, n, x, sum, a[100][105][105];\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    for (t = 1; t <= n; t++) {\n      if (m != 1)\n        sum = sum + a[i][1][t] + a[i][m][t];\n      if (m == 1)\n        sum = sum + a[i][1][t];\n    }\n    for (t = 2; t <= m - 1; t++) {\n      if (n != 1)\n        sum = sum + a[i][t][1] + a[i][t][n];\n      if (n == 1)\n        sum = sum + a[i][t][1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[105][105], (*p)[105] = NULL, sum;\n  cin >> k;\n  for (int time = 1; time <= k; time++) {\n    sum = 0;\n    p = a;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + *(*p + i) + *(*(p + m - 1) + i);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      sum = sum + *(*(p + i)) + *(*(p + i) + n - 1);\n    }\n    if ((m == 1) || (n == 1))\n      sum = sum / 2;\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int i = 0, j = 0, k = 0;\n  int row, col;\n  int str[100][100] = {0};\n  int sum;\n  scanf(\"%d\", &n);\n  for (; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        scanf(\"%d\", &str[j][k]);\n    for (j = 0; j < col; j++)\n      sum += str[0][j] + str[row - 1][j];\n    for (j = 1; j < row - 1; j++)\n      sum += str[j][0] + str[j][col - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int m, n, j1, j2, sum = 0;\n    cin >> m >> n;\n    for (j1 = 1; j1 <= m; j1++) {\n      for (j2 = 1; j2 <= n; j2++)\n        cin >> *(*(a + j1) + j2);\n    }\n    for (j2 = 1; j2 <= n; j2++)\n      sum = sum + *(*(a + 1) + j2) + *(*(a + m) + j2);\n    for (j1 = 2; j1 <= m - 1; j1++)\n      sum = sum + *(*(a + j1) + 1) + *(*(a + j1) + n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint A[100][100];\nint main() {\n  int *pt;\n  int i, j, k;\n  int m, n;\n  int *re;\n  int B[200];\n  int number;\n  scanf(\"%d\", &number);\n  re = B;\n  for (i = 0; i < 200; i++) {\n    *(re + i) = 0;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        *(*(A + j) + k) = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", *(A + j) + k);\n      }\n    }\n    pt = *A;\n    for (j = 0; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt++;\n      } else {\n        *re = *re + *pt;\n        pt = pt + 100;\n      }\n    }\n    for (j = 1; j < m; j++) {\n      if (j < (m - 1)) {\n        *re = *re + *pt;\n        pt = pt + 100;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 1;\n      }\n    }\n    for (j = 1; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt--;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 100;\n      }\n    }\n    for (j = 1; j < (m - 1); j++) {\n      *re = *re + *pt;\n      pt = pt - 100;\n    }\n    re++;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    printf(\"%d\\n\", *(re + i));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9827", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[10000], *p = a, *q = a, n, h, l, i, j, sum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    p = a;\n    q = a;\n    scanf(\"%d %d\", &h, &l);\n\n    for (j = 1; j <= h * l; j++) {\n      scanf(\"%d\", p++);\n    }\n    if (h == 1) {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n      }\n    } else if (l == 1) {\n      sum += *q;\n      sum += *(q + h - 1);\n    } else {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n        sum += *(q + h * l - j - 1);\n      }\n      for (j = 1; j <= h - 2; j++) {\n        sum += *(q + j * l);\n        sum += *(q + j * l + l - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], times, x, y, i, j, k, sum = 0;\n  int *pointer = NULL;\n  cin >> times;\n  for (i = 1; i <= times; i++) {\n    sum = 0;\n    cin >> x >> y;\n    for (k = 0; k < x; k++) {\n      for (j = 0; j < y; j++) {\n        cin >> a[k][j];\n        pointer = &a[k][j];\n        if (k == 0 || j == 0 || k == x - 1 || j == y - 1) {\n          sum = sum + *pointer;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p, *q, a, b, k, m = 0, i, j;\n  q = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    m = 0;\n    p = q;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j < a * b; j++) {\n      scanf(\"%d\", p + j);\n    }\n    for (j = 0; j < b; j++)\n      m += *(p + j) + *(p + a * b - 1 - j);\n    for (j = 1; j < a - 1; j++)\n      m += *(p + j * b) + *(p + j * b + b - 1);\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int square[100][100];\n  int k, i, j;\n  int(*p)[100];\n  p = square;\n  int sum = 0;\n  for (scanf(\"%d \", &k); k; --k) {\n    int wide;\n    int height;\n    sum = 0;\n    cin >> height >> wide;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++)\n        cin >> square[i][j];\n    p = square;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++) {\n        if (i == 0 || j == 0 || i == height - 1 || j == wide - 1)\n          sum += *(*(p + i) + j);\n      }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9831", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, b;\n  int sz[1000][1000];\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    int e, k, h = 0;\n    for (e = 0; e < m; e++) {\n      if (e == 0) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n      if (e == m - 1) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (k == n - 1) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n      if (k == 0) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n    }\n    printf(\"%d \", h);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9832", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], m[100][100], i, j, k, count[100] = {0};\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> x[k] >> y[k];\n    for (i = 0; i < x[k]; i++) {\n      for (j = 0; j < y[k]; j++) {\n        scanf(\"%d \", &m[i][j]);\n        if (i == 0 || i == x[k] - 1 || j == 0 || j == y[k] - 1)\n          count[k] += m[i][j];\n      }\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << count[k] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "9833", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, ans, i, j, x;\n  cin >> k;\n  while (k--) {\n    cin >> n >> m;\n    ans = 0;\n    for (i = 1; i <= n; i++) {\n      if (i == 1 || i == n)\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          ans += x;\n        }\n      else\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          if (j == 1 || j == m)\n            ans += x;\n        }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, k, j, l, a, i;\n  scanf(\"%d \", &k);\n  int aa[k + 1];\n  for (i = 1; i <= k; i++) {\n    aa[i] = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a;\n        if (j == 1 || j == m || l == 1 || l == n)\n          aa[i] = aa[i] + a;\n      }\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << aa[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "9835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j1, j2, e1, e2, sum;\n  int juzhen[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j1 = 0; j1 < m; j1++) {\n      for (e1 = 0; e1 < n; e1++) {\n        scanf(\"%d\", &juzhen[j1][e1]);\n      }\n    }\n    sum = 0;\n    for (j2 = 0; j2 < n; j2++) {\n      sum = sum + juzhen[0][j2] + juzhen[m - 1][j2];\n    }\n    for (e2 = 1; e2 < m - 1; e2++) {\n      sum = sum + juzhen[e2][0] + juzhen[e2][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint summer();\n\nint main(void) {\n  int counter, times, patty;\n  scanf(\"%d\", &times);\n\n  for (counter = 0; counter < times; counter++) {\n    patty = summer();\n    cout << patty << \" \";\n  }\n\n  return 0;\n}\n\nint summer() {\n  int m, n;\n  int line, row;\n\n  scanf(\"%d%d\", &line, &row);\n  int fib[1000][1000];\n\n  for (m = 0; m < line; m++) {\n    for (n = 0; n < row; n++) {\n      cin >> fib[m][n];\n    }\n  }\n  int sum = 0;\n  int i;\n  for (i = 0; i < row; i++) {\n    sum = sum + *((*fib) + i) + *(*(fib + line - 1) + i);\n  }\n\n  for (i = 1; i < line - 1; i++) {\n    sum = sum + *(*(fib + i)) + *(*(fib + i) + row - 1);\n  }\n\n  return sum;\n}\n"}
{"label": "6", "index": "9837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, i, j, sum;\n  int a[101][101];\n  scanf(\"%d \", &t);\n  for (; t > 0; t--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i));\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a) + j);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a + m - 1) + j);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9838", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105];\n  long m, n, k, z, sum, i, j;\n  scanf(\"%d\", &z);\n  for (i = 1; i <= z; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if (m >= 2 && n >= 2) {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (k = 1; k <= n; k++)\n        sum = sum + a[1][k] + a[m][k];\n      for (j = 2; j <= m - 1; j++) {\n        sum = sum + a[j][1] + a[j][n];\n      }\n      printf(\"%d\\n\", sum);\n    }\n\n    else {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++)\n          sum = sum + a[j][k];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  \n\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "9839", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum = 0;\n  cin >> k;\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m >= 3 && n >= 3) {\n      for (i = 0; i < n; i++)\n        sum = sum + a[0][i] + a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + a[i][0] + a[i][n - 1];\n    } else {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          sum = sum + a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *pi, i = 0, j = 0, k = 1, sum = 0, n, m, z, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    int *p = (int *)malloc((n * m) * sizeof(int));\n    pi = p;\n    for (z = 0; z < m * n; z++, pi++)\n      scanf(\"%d\", pi);\n    pi = p;\n\n    for (j = 0; j < m * n; pi++) {\n      j++;\n      if (j < n + 1 || j > ((m - 1) * n) || j % n == 1 || j % n == 0)\n        sum = sum + *pi;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9841", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, s1, s2, q1, q2, a, b, t, k, p, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int pi[100001];\n    s1 = 0;\n    s2 = 0;\n    q1 = 0;\n    q2 = 0;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 1; j <= a * b; j++) {\n      scanf(\"%d\", pi + j - 1);\n    }\n    for (t = 1; t <= b; t++) {\n      s1 = s1 + *(pi + t - 1);\n      s2 = s2 + *(pi + a * b - t);\n    }\n    for (p = 1; p < a - 1; p++) {\n      q1 = q1 + *(pi + p * b);\n      q2 = q2 + *(pi + b - 1 + p * b);\n    }\n    s = s1 + s2 + q1 + q2;\n    if (a == 1 & b == 1) {\n      printf(\"%d\\n\", s / 2);\n    } else {\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100], *p;\n  cin >> k;\n  for (j = 1; j <= k; j++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = *a, i = 0; i < m * n; i++) {\n      cin >> p[i];\n      if (i <= n - 1 || i >= m * n - n - 1 || (i + 1) % n == 0 || i % n == 0)\n        sum += p[i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A[100][100];\nint main() {\n  int *pt;\n  int i, j, k;\n  int m, n;\n  int *re;\n  int B[200];\n  int number;\n  scanf(\"%d\", &number);\n  re = B;\n  for (i = 0; i < 200; i++) {\n    *(re + i) = 0;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        *(*(A + j) + k) = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", *(A + j) + k);\n      }\n    }\n    pt = *A;\n    for (j = 0; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt++;\n      } else {\n        *re = *re + *pt;\n        pt = pt + 100;\n      }\n    }\n    for (j = 1; j < m; j++) {\n      if (j < (m - 1)) {\n        *re = *re + *pt;\n        pt = pt + 100;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 1;\n      }\n    }\n    for (j = 1; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt--;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 100;\n      }\n    }\n    for (j = 1; j < (m - 1); j++) {\n      *re = *re + *pt;\n      pt = pt - 100;\n    }\n    re++;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    cout << *(re + i) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, s, a[100][100], j, l, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((n > 1) && (m > 1)) {\n      for (i = 0; i < n; i++) {\n        s += a[0][i];\n        s += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        s += a[i][0];\n        s += a[i][n - 1];\n      }\n    } else {\n      if (n == 1) {\n        for (i = 0; i < m; i++)\n          s += a[i][0];\n      } else if (m == 1) {\n        for (i = 0; i < n; i++)\n          s += a[0][i];\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum(int a[100][100], int m, int n) {\n  int x = 0, i;\n  for (i = 0; i < n; i++) {\n    x = x + a[0][i] + a[m - 1][i];\n  }\n  for (i = 1; i < m - 1; i++) {\n    x = x + a[i][0] + a[i][n - 1];\n  }\n  return x;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int a[100][100] = {0}, m, n, j, k;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(a, m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9846", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int b[1000];\n  int n, he;\n  int h, l;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    he = 0;\n    scanf(\"%d %d\", &h, &l);\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", (*(a + i) + j));\n\n    for (i = 0; i < h; i++)\n      he = he + *(*(a + i) + 0) + *(*(a + i) + l - 1);\n\n    for (j = 0; j < l; j++)\n      he = he + *(*a + j) + *(*(a + h - 1) + j);\n\n    he = he - *(*(a + 0) + l - 1) - *(*(a + h - 1) + l - 1) - *(*(a + 0) + 0) -\n         *(*(a + h - 1) + 0);\n    b[k] = he;\n  }\n  for (k = 0; k < n - 1; k++)\n    printf(\"%d\\n\", b[k]);\n  printf(\"%d\", b[k]);\n  return 0;\n}\n"}
{"label": "6", "index": "9847", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int zong, m, n, a[101][101], sum1 = 0, sum2 = 0, sum = 0;\n  cin >> zong;\n  for (int i = 1; i <= zong; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += a[m][0];\n    }\n\n    else {\n      for (int k = 0; k < n; ++k)\n        sum1 += a[0][k] + a[m - 1][k];\n      for (int j = 0; j < m; ++j)\n        sum2 += a[j][0] + a[j][n - 1];\n      sum = sum1 + sum2 - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    cout << sum << endl;\n    sum1 = 0, sum2 = 0, sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, hang, lie, h, *p, i, j, a[10000], place;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> hang >> lie;\n    p = a;\n    for (j = 1; j <= hang; j++) {\n      for (h = 1; h <= lie; h++) {\n        cin >> *(p++);\n      }\n    }\n    for (place = 0; place <= lie - 1; place++) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = 2 * lie - 1; place < hang * lie - 1; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = hang * lie - 1; place > hang * lie - lie; place--) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = lie; place <= hang * lie - lie; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N = 0, n = 0, m = 0, i = 0, j = 0, k = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    int sum = 0;\n    int a[102][102];\n    int *p = *a;\n    cin >> n >> m;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (k = 0; k < m; k++, p++)\n      sum = sum + *p;\n    for (p = p + 101, j = 1; j < n; j++)\n      sum = sum + *p, p = p + 102;\n    for (p = p - 103, k = m - 2; k >= 0; k--, p--)\n      sum = sum + *p;\n    for (p = p - 101, j = n - 2; j > 0; j--, p = p - 102)\n      sum = sum + *p;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n, i, j, l, sum1 = 0, sum = 0;\n  int a[100][100];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n        sum = sum + *(*(p + i) + j);\n      }\n    }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        sum1 = sum1 + *(*(p + i) + j);\n\n    sum = sum - sum1;\n    cout << sum << endl;\n    sum = sum1 = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int times;\n  int p[200][200];\n  int hang, lie;\n  int sum = 0;\n  int i, j;\n  scanf(\"%d \", &n);\n  for (times = 0; times < n; times++) {\n    cin >> hang >> lie;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < hang; i = i + hang - 1)\n      for (j = 0; j < lie; j++)\n        sum = sum + *(*(p + i) + j);\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j = j + lie - 1)\n        sum = sum + *(*(p + i) + j);\n    sum = sum - *(*p) - *(*p + lie - 1) - *(*(p + hang - 1)) -\n          *(*(p + hang - 1) + lie - 1);\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, num[100][100], sum;\n  cin >> k;\n  cout << endl;\n  for (int a = 0; a < k; a++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n        cout << \" \";\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += num[i][j];\n        }\n      }\n      cout << endl;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9853", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, i1, j1, i2, i3, j3, sum = 0;\n  scanf(\"%d\", &n);\n  for (i2 = 0; i2 <= n - 1; i2++) {\n    scanf(\"%d %d\", &i, &j);\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        scanf(\"%d \", &a[i1][j1]);\n      }\n    }\n    for (i3 = 0; i3 <= j - 1; i3++) {\n      sum = sum + a[0][i3] + a[i - 1][i3];\n    }\n    for (j3 = 0; j3 <= i - 1; j3++) {\n      sum = sum + a[j3][0] + a[j3][j - 1];\n    }\n    sum = sum - a[0][j - 1] - a[i - 1][0] - a[i - 1][j - 1] - a[0][0];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        a[i1][j1] = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9854", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  while (num--) {\n    int a[100][100];\n    int m, n;\n    cin >> m >> n;\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9855", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  int m = 0, n = 0;\n  int a[100][100] = {0};\n  int sum = 0;\n  cin >> k;\n  int(*p)[100] = NULL;\n  p = a;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    for (int a = 0; a < n; a++) {\n      sum = sum + *(*(p + 0) + a);\n    }\n    for (int a = 1; a < m; a++) {\n      sum = sum + *(*(p + a) + n - 1);\n    }\n    for (int a = n - 2; a >= 0; a--) {\n      sum = sum + *(*(p + m - 1) + a);\n    }\n    for (int a = m - 2; a > 0; a--) {\n      sum = sum + *(*(p + a) + 0);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0, a[500][500] = {0}, (*p)[500];\n  cin >> k;\n  int i = 0, j = 0;\n  p = a;\n  for (int l = 0; l < k; l++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    int result = 0;\n    p = a;\n    for (i = 0; i < m; i++)\n      result = result + *(*(p + i));\n    p = a;\n    for (i = 0; i < m && n != 1; i++)\n      result = result + *(*(p + i) + n - 1);\n    p = a + m - 1;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    p = a;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    cout << result << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n = 0;\n\n  cin >> n;\n\n  int result[100];\n\n  for (int i = 0; i < n; i++) {\n\n    int x = 0;\n    int y = 0;\n\n    cin >> x >> y;\n\n    int r[100][100];\n\n    for (int j = 0; j < x; j++) {\n      for (int k = 0; k < y; k++) {\n        cin >> r[j][k];\n      }\n    }\n\n    result[i] = 0;\n\n    for (int j = 0; j < x; j++) {\n      if (j == 0 || j == x - 1) {\n\n        for (int k = 0; k < y; k++) {\n          result[i] += r[j][k];\n        }\n\n      } else {\n        result[i] += r[j][0];\n        result[i] += r[j][y - 1];\n      }\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    cout << result[i];\n    if (i < n - 1)\n      cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int t, i, j, sum = 0;\n  int m, n, k;\n  int(*p)[101] = NULL;\n  scanf(\"%d \", &k);\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    p = a;\n    for (i = 0; i <= n - 2; i++)\n      sum += *(*(p + 0) + i);\n    p = a;\n    for (i = 0; i <= m - 2; i++)\n      sum += *(*(p + i) + n - 1);\n    p = a;\n    for (i = 1; i <= n - 1; i++)\n      sum += *(*(p + m - 1) + i);\n    p = a;\n    for (i = 1; i <= m - 1; i++)\n      sum += *(*(p + i) + 0);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int c, i, j;\n  int m, n, k;\n  cin >> k;\n  for (c = 1; c <= k; c++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    int sum, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    for (i = 1; i <= m; i++) {\n      sum1 = sum1 + a[i][1];\n      sum2 = sum2 + a[i][n];\n    }\n    for (j = 1; j <= n; j++) {\n      sum3 = sum3 + a[1][j];\n      sum4 = sum4 + a[m][j];\n    }\n    sum = sum1 + sum2 + sum3 + sum4 - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sz[100][100];\n  int i, r, sum1, sum2, sum;\n  scanf(\"%d\", &k);\n  for (int j = 1; j <= k; j++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (r = 0; r < n; r++)\n        scanf(\"%d\", &sz[i][r]);\n    }\n    sum1 = 0;\n    for (int q = 0; q < n; q++) {\n      sum1 += sz[0][q] + sz[m - 1][q];\n    }\n    sum2 = 0;\n    for (int w = 0; w < m; w++)\n      sum2 += sz[w][n - 1] + sz[w][0];\n\n    sum =\n        sum1 + sum2 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l, n, m, t, i, j;\n  cin >> t;\n  for (l = 1; l <= t; l++) {\n    scanf(\"%d%d\", &n, &m);\n    int sum = 0, a;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a);\n        if (i == 1 || j == 1 || i == n || j == m)\n          sum += a;\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9862", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, *p, a[100][100], s;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    p = &a[0][0];\n    s = 0;\n    for (j = 0; j < n; j++) {\n      if (n == 1)\n        s += *p;\n      else\n        s += (*(p + j) + *(p + 100 * (m - 1) + j));\n    }\n    for (j = 1; j < m - 1; j++)\n      s += (*(p + j * 100) + *(p + j * 100 + n - 1));\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[100][100];\n  int i, j, sum = 0;\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> a[i][j];\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < col; i++) {\n        sum += a[0][i];\n        if (row > 1)\n          sum += a[row - 1][i];\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += a[i][0];\n        if (col > 1)\n          sum += a[i][col - 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, l, j;\n  int sz[1000][1000];\n  int jh[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    jh[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    for (k = 0; k < l; k++) {\n      jh[i] += sz[0][k];\n      jh[i] += sz[h - 1][k];\n    }\n    for (j = 1; j < h - 1; j++) {\n      jh[i] += sz[j][0];\n      jh[i] += sz[j][l - 1];\n    }\n    if (h == 1 && l == 1) {\n      jh[i] -= sz[0][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << jh[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9865", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int l, n, m, t, i, j;\n  scanf(\"%d\", &t);\n  for (l = 1; l <= t; l++) {\n    scanf(\"%d%d\", &n, &m);\n    int sum = 0, a;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a);\n        if (i == 1 || j == 1 || i == n || j == m)\n          sum += a;\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, i1, j1, i2, i3, j3, p = 0, q = 0, sum = 0;\n  scanf(\"%d\", &n);\n  for (i2 = 0; i2 <= n - 1; i2++) {\n    scanf(\"%d %d\", &i, &j);\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        scanf(\"%d\", &a[i1][j1]);\n      }\n    }\n    for (i3 = 0; i3 <= j - 1; i3++) {\n      sum = sum + a[0][i3] + a[i - 1][i3];\n    }\n    for (j3 = 0; j3 <= i - 1; j3++) {\n      sum = sum + a[j3][0] + a[j3][j - 1];\n    }\n    sum = sum - a[0][j - 1] - a[i - 1][0] - a[i - 1][j - 1] - a[0][0];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        a[i1][j1] = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, m, n, s;\n  scanf(\"%d\\n\", &x);\n  for (s = 0; s < x; s++) {\n    int a[100][100];\n    int i, j, k, q = 0, w = 0, e = 0, r = 0, sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (k = 0; k < n; k++) {\n      q += a[0][k];\n      w += a[m - 1][k];\n    }\n    k = 0;\n    for (k = 0; k < m; k++) {\n      e += a[k][0];\n      r += a[k][n - 1];\n    }\n    sum = q + w + e + r - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9868", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, *p;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0;\n    int a[100][100] = {0};\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    p = a[0];\n    for (int j = 0; j < n; j++)\n      sum += *p++;\n    if (m - 1 != 0) {\n      p = a[m - 1];\n      for (int j = 0; j < n; j++)\n        sum += *p++;\n    }\n    for (int j = 1; j < m - 1; j++) {\n      p = a[j];\n\n      sum += *p;\n      sum += *(p + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int count, m, n, array[100][100], sum[100] = {0}, i, j, p;\n  scanf(\"%d\", &count);\n  for (i = 0; i < count; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (p = 0; p < n; p++)\n        scanf(\"%d\", &array[j][p]);\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + array[0][j];\n      if (m > 1)\n        sum[i] = sum[i] + array[m - 1][j];\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum[i] = sum[i] + array[j][0];\n      sum[i] = sum[i] + array[j][n - 1];\n    }\n  }\n  for (i = 0; i < count; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9870", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100], *p;\n  cin >> k;\n  for (j = 1; j <= k; j++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (p = *a, i = 0; i < m * n; i++) {\n      cin >> p[i];\n      if (i <= n - 1 || i >= m * n - n - 1 || (i + 1) % n == 0 || i % n == 0)\n        sum += p[i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9871", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  scanf(\"%d \", &k);\n  for (int e = 1; e <= k; e++) {\n    cin >> m >> n;\n    for (int i = 1; i <= m; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 && n == 1)\n      cout << a[1][1] << endl;\n    else {\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[1][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][1];\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[m][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][n];\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100];\n  int k, m, n, i, j, t;\n\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[t] = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum[t] += a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum[t] += a[0][j] + a[m - 1][j];\n    }\n    sum[t] -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n  }\n\n  for (t = 0; t < k; t++) {\n    if (t != k - 1) {\n      printf(\"%d\\n\", sum[t]);\n    } else {\n      printf(\"%d\", sum[t]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n    \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        \n        if (i == 0)\n          sum = sum + a[i][j];\n        if (i == m - 1)\n          sum = sum + a[i][j];\n        \n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, number;\n  scanf(\"%d \", &number);\n  for (i = 0; i < number; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[100][100];\n    int *p = NULL, *q = NULL, i;\n    for (p = *a; p < *a + n * m; p++) {\n      cin >> *p;\n    }\n    int sum = 0;\n    for (p = *a; p < *a + n; p++) {\n      sum = sum + *p;\n    }\n    if (m != 1) {\n      for (p = *a + (m - 1) * n; p < *a + m * n; p++) {\n        sum = sum + *p;\n      }\n    }\n    for (p = *a + n; p < *a + (m - 1) * n; p = p + n) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9875", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[200][200];\n  int *p[200];\n  for (int i = 0; i <= 200; i++)\n    p[i] = array[i];\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0, sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> p[j][l];\n        if (j == 0 || l == 0 || j == m - 1 || l == n - 1)\n          sum += p[j][l];\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int x, k, m, n, i, j, sum;\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < n - 1; j++) {\n      sum += sz[0][j];\n    }\n    for (i = 0; i < m - 1; i++) {\n      sum += sz[i][j];\n    }\n    for (; j > 0; j--) {\n      sum += sz[i][j];\n    }\n    for (; i > 0; i--) {\n      sum += sz[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int *p, int m, int n) {\n  int row, col, temp, sum = 0;\n  for (row = 1; row < m + 1; row++) {\n    for (col = 1; col < n + 1; col++) {\n      if (row == 1 || row == m || col == 1 || col == n) {\n        temp = *(p + n * (row - 1) + col);\n        sum += temp;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, m, n, i, s, row, col;\n  int *p;\n  p = (int *)malloc(sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (row = 1; row < m + 1; row++) {\n      for (col = 1; col < n + 1; col++) {\n        scanf(\"%d\", p + n * (row - 1) + col);\n      }\n    }\n    s = f(p, m, n);\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;     \n  int times; \n  int p[200][200];\n  int hang, lie; \n  int sum = 0;   \n  int i, j;      \n  cin >> n;\n  for (times = 0; times < n; times++) {\n    cin >> hang >> lie;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < hang; i = i + hang - 1)\n      for (j = 0; j < lie; j++)\n        sum = sum + *(*(p + i) + j);\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j = j + lie - 1)\n        sum = sum + *(*(p + i) + j);\n    sum = sum - *(*p) - *(*p + lie - 1) - *(*(p + hang - 1)) -\n          *(*(p + hang - 1) + lie - 1);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, l, sum[100] = {0};\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[m][j];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][1];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][n];\n    sum[l] = sum[l] - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    cout << sum[l] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, a, n, m, sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &sz[j][l]);\n    }\n    a = 0;\n    for (l = 0; l < n; l++) {\n      a += sz[0][l];\n    }\n    if (m > 1) {\n      for (l = 0; l < n; l++) {\n        a += sz[m - 1][l];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      a += sz[j][0];\n    }\n    if (n > 1) {\n      for (j = 1; j < m - 1; j++) {\n        a += sz[j][n - 1];\n      }\n    }\n    result[i] = a;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9881", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, i, j;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &jz[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum += (jz[i][0] + jz[i][n - 1]);\n    for (i = 0; i < n; i++)\n      sum += (jz[0][i] + jz[m - 1][i]);\n    sum -= (jz[0][0] + jz[m - 1][n - 1] + jz[0][n - 1] + jz[m - 1][0]);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sq(int *p, int m, int n) {\n  int i, s;\n  s = 0;\n  for (i = 0; i < n; i++)\n    s = s + *(p + i);\n  for (i = 1; i < m; i++)\n    s = s + *(p + n * i) + *(p + n * i + n - 1);\n  for (i = 1; i < n - 1; i++)\n    s = s + *(p + (m - 1) * n + i);\n  cout << s << \"\\n\";\n}\nint main() {\n  int *p, m, n, k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)malloc(m * n * sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", p + j);\n    sq(p, m, n);\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "9883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, i, j, k, m, n;\n  int sum = 0;\n  cin >> p;\n  int sz[100][100];\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == 0 || j == (m - 1))\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == 0)\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == (n - 1))\n          sum += sz[j][k];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, sum;\n  int m;\n  int a[200][220];\n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    sum = 0;\n    int row, col;\n    scanf(\"%d%d\", &row, &col);\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    for (i = 1; i <= row; i++) {\n      sum = sum + a[i][1] + a[i][col];\n    }\n\n    for (j = 2; j <= col - 1; j++) {\n      sum = sum + a[1][j] + a[row][j];\n    }\n\n    if (row == 1) {\n      sum /= 2;\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int t, i, j, sum = 0;\n  int m, n, k;\n  int(*p)[101] = NULL;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    p = a;\n    for (i = 0; i <= n - 2; i++)\n      sum += *(*(p + 0) + i);\n    p = a;\n    for (i = 0; i <= m - 2; i++)\n      sum += *(*(p + i) + n - 1);\n    p = a;\n    for (i = 1; i <= n - 1; i++)\n      sum += *(*(p + m - 1) + i);\n    p = a;\n    for (i = 1; i <= m - 1; i++)\n      sum += *(*(p + i) + 0);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int m;\n  int n;\n  int i, j, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        sum = sum + a[i][j];\n      }\n    }\n    for (i = 1; i <= m - 2; i++) {\n      for (j = 1; j <= n - 2; j++) {\n        sum = sum - a[i][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum[10000] = {0};\n  int a[100][100] = {0}, k;\n  int *p = sum, x, y;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (x != 1) {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j] + a[x - 1][j];\n      }\n      for (i = 1; i < x - 1; i++) {\n        *(p + k) += a[i][0] + a[i][y - 1];\n      }\n    } else {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j];\n      }\n    }\n  }\n  for (; p < (sum + n); p++) {\n    cout << *p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[10001];\n  int *p;\n  int i, j, k;\n  int b, c;\n  int s = 0;\n  p = &a[0];\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d %d\", &b, &c);\n\n    for (k = 1; k <= b; k++) {\n      for (i = 1; i <= c; i++) {\n        scanf(\"%d\", p);\n        if ((k == 1 && i != 1 && i != c) || (k == b && i != 1 && i != c) ||\n            i == 1 || i == c)\n          s = s + *p;\n\n        p++;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    p = &a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9889", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  cin >> k;\n  for (int p = 0; p < k; p++) {\n    int sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum = sum + a[i][0];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n != 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + a[0][i];\n\n      cout << sum << endl;\n    } else {\n      if (m == 1 && n == 1) {\n        cout << a[0][0] << endl;\n      } else {\n\n        for (i = 0; i < n; i++) {\n          sum1 = sum1 + a[0][i];\n          sum2 = sum2 + a[m - 1][i];\n        }\n        for (i = 0; i < m; i++) {\n          sum3 = sum3 + a[i][0];\n          sum4 = sum4 + a[i][n - 1];\n        }\n        sum = sum1 + sum2 + sum3 + sum4 -\n              (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n        cout << sum << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9890", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, k;\n  scanf(\"%d \", &k);\n  int i = 0, j = 0, h = 0;\n  for (i = 0; i < k; i++) {\n    int b = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j = 0; j < m; j++)\n      for (h = 0; h < n; h++)\n        cin >> *(*(a + j) + h);\n    for (j = 0; j < m; j++)\n      b = b + **(a + j);\n    for (j = 1; j < n; j++)\n      b = b + *(*a + j);\n    for (j = 1; j < m; j++)\n      b = b + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      b = b + *(*(a + m - 1) + j);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[100][100], m, n, k, i, j, s, sum;\n  scanf(\"%d \", &k);\n  for (s = 1; s <= k; s++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        sum = sum + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++)\n        sum = sum - a[i][j];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "9892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  for (int z = 0; z < num; z++) {\n    int a, b;\n    cin >> a >> b;\n    int juzhen[100][100];\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> juzhen[i][j];\n    int sum = 0;\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[0][i];\n    for (int j = 1; j < a - 1; j++) {\n      sum = sum + juzhen[j][0];\n      sum = sum + juzhen[j][b - 1];\n    }\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[a - 1][i];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint A[100][100];\nint main() {\n  int *pt;\n  int i, j, k;\n  int m, n;\n  int *re;\n  int B[200];\n  int number;\n  scanf(\"%d\", &number);\n  re = B;\n  for (i = 0; i < 200; i++) {\n    *(re + i) = 0;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        *(*(A + j) + k) = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", *(A + j) + k);\n      }\n    }\n    pt = *A;\n    for (j = 0; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt++;\n      } else {\n        *re = *re + *pt;\n        pt = pt + 100;\n      }\n    }\n    for (j = 1; j < m; j++) {\n      if (j < (m - 1)) {\n        *re = *re + *pt;\n        pt = pt + 100;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 1;\n      }\n    }\n    for (j = 1; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt--;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 100;\n      }\n    }\n    for (j = 1; j < (m - 1); j++) {\n      *re = *re + *pt;\n      pt = pt - 100;\n    }\n    re++;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    cout << *(re + i) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i1, i2, i3, total;\n  scanf(\"%d\", &k);\n  for (i1 = 1; i1 <= k; i1++) {\n    scanf(\"\\n%d %d\", &m, &n);\n    total = 0;\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      scanf(\"\\n%d\", &a[i2][0]);\n      for (i3 = 1; i3 <= n - 1; i3++) {\n        scanf(\" %d\", &a[i2][i3]);\n      }\n    }\n\n    if (m == 1 && n == 1) {\n      total = a[0][0];\n      printf(\"%d\\n\", total);\n      continue;\n    }\n    for (i2 = 0; i2 <= n - 1; i2++) {\n      total = total + a[0][i2] + a[m - 1][i2];\n    }\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      total = total + a[i2][0] + a[i2][n - 1];\n    }\n    total = total - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p[400], m, n, a, i, j, k, l, sum, counter, b, matrix[100][100];\n  scanf(\"%d\", &a);\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    counter = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &matrix[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          p[counter] = &matrix[i][j];\n          counter++;\n        }\n      }\n    }\n    for (l = 0; l < counter; l++) {\n      sum += *p[l];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], k, i, j, t, m, n, sum;\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 2; i < n; i++)\n      sum += a[1][i] + a[m][i];\n    for (j = 2; j < m; j++)\n      sum += a[j][1] + a[j][n];\n    sum +=\n        a[1][1] + (n != 1) * a[1][n] + (m != 1) * a[m][1] + (m != 1) * a[m][n];\n    if (t < k)\n      printf(\"%d\\n\", sum);\n    else\n      printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, ROW[100], COL[100], row, col, a[100][100], s = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &ROW[i], &COL[i]);\n\n    for (row = 0; row < ROW[i]; row++) {\n      for (col = 0; col < COL[i]; col++) {\n        scanf(\"%d\", &a[row][col]);\n      }\n    }\n\n    for (col = 0; col < COL[i]; col++) {\n      s = s + a[0][col] + a[ROW[i] - 1][col];\n    }\n    for (row = 1; row < ROW[i] - 1; row++) {\n      s = s + a[row][0] + a[row][COL[i] - 1];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) \n    {\n      for (i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += *(*(a + i));\n      cout << sum << endl;\n      continue;\n    }\n    for (i = 0; i < n; i++) \n    {\n      sum += *(*(a) + i);\n      sum += *(*(a + m - 1) + i);\n    }\n    for (i = 1; i < m - 1; i++) \n    {\n      sum += *(*(a + i));\n      sum += *(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[120][120];\n  for (int i = 0; i < n; i++) {\n    int a, b;\n    int s = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (int m = 0; m < a; m++)\n      for (int n = 0; n < b; n++) {\n        scanf(\"%d\", &num[m][n]);\n        if (m == 0 || m == a - 1 || n == 0 || n == b - 1)\n          s += num[m][n];\n      }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9900", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a, b, c, d, s;\n  a = b = c = d = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (int p = 0; p < m; p++) {\n      for (int q = 0; q < n; q++)\n        cin >> sz[p][q];\n    }\n    if (m != 1 && n != 1) {\n      for (int e = 0; e < n; e++) {\n        a = a + sz[0][e];\n        b = b + sz[m - 1][e];\n      }\n      for (int j = 1; j < m - 1; j++) {\n        c = c + sz[j][n - 1];\n        d = d + sz[j][0];\n      }\n      s = a + b + c + d;\n      printf(\"%d\\n\", s);\n      s = a = b = c = d = 0;\n    } else\n      printf(\"%d\", sz[0][0]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, j, t, r, k, m, n, a[1000] = {0}, b[100][100] = {0}, sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n\n    for (t = 0; t < m; t++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &b[t][r]);\n        if (r == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    if (m == 1)\n      for (j = 0; j <= n - 1; j++)\n        sum += b[0][j];\n    else if (n == 1)\n      for (j = 0; j <= m - 1; j++)\n        sum += b[j][0];\n    else {\n      for (j = 0; j < n - 1; j++)\n        sum += *(b[0] + j);\n      for (j = 0; j < m - 1; j++)\n        sum += *(b[j] + n - 1);\n      for (j = n - 1; j > 0; j--)\n        sum += *(b[m - 1] + j);\n      for (j = m - 1; j > 0; j--)\n        sum += *(b[j] + 0);\n    }\n    a[i] = sum;\n    sum = 0;\n  }\n\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", a[i]);\n}\n"}
{"label": "6", "index": "9902", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int b[100][100];\n    int *a[100][100];\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = &b[i][j];\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(b + i) + j);\n\n        if (i == 0)\n          sum = sum + **(*(a + i) + j);\n        if (i == m - 1) {\n          sum = sum + **(*(a + i) + j);\n        }\n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += ***(a + i);\n      sum += **(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9903", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint mat[1000][1000];\nint main() {\n  \n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n    for (int j = 0; j < n; j++) {\n      if (m > 1)\n        sum += mat[m - 1][j];\n      sum += mat[0][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      if (n > 1)\n        sum += mat[i][n - 1];\n      sum += mat[i][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, row, col, ROW, sz[100][100], COL, sum[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    if (ROW == 1 && COL == 1) {\n      sum[i] = sum[i] + sz[0][0];\n    } else {\n      for (col = 0; col < COL; col++) {\n        sum[i] = sum[i] + sz[0][col] + sz[ROW - 1][col];\n      }\n      for (row = 1; row < (ROW - 1); row++) {\n        sum[i] = sum[i] + sz[row][0] + sz[row][COL - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  scanf(\"%d\", &k);\n  return 0;\n}\n"}
{"label": "6", "index": "9905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int time;\n  int m, n;\n  int i, j;\n  int x, y;\n  int res;\n  int r;\n  int arr[10000];\n  cin >> time;\n  for (i = 0; i < time; i++) {\n    res = 0;\n    scanf(\"%d %d\", &m, &n);\n\n    for (j = 0; j < m * n; j++) {\n      cin >> r;\n\n      arr[j] = r;\n    }\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        if ((x == 0) || (x == (m - 1)))\n          res += arr[x * n + y];\n        if ((y == 0) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n        if ((y == (n - 1)) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n      }\n    cout << res << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, l;\n  int m[100], n[100];\n  int sum[100] = {0};\n  int a[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (l = 0; l < n[i] - 1; l++) {\n      sum[i] += a[0][l][i];\n    }\n    for (j = 0; j < m[i] - 1; j++) {\n      sum[i] += a[j][n[i] - 1][i];\n    }\n    for (l = n[i] - 1; l > 0; l--) {\n      sum[i] += a[m[i] - 1][l][i];\n    }\n    for (j = m[i] - 1; j > 0; j--)\n      sum[i] += a[j][0][i];\n\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9907", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100] = {0}, i, j, l, k, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    for (j = 0; j < n; j++)\n      sum[i] = sum[i] + a[0][j];\n    for (j = 1; j < m; j++) {\n      sum[i] = sum[i] + a[j][0];\n      sum[i] = sum[i] + a[j][n - 1];\n    }\n    for (j = 1; j < n - 1; j++)\n      sum[i] = sum[i] + a[m - 1][j];\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9908", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m[100], n[100], he[100];\n  int a[100][100];\n  int i, j, l, total;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        cin >> a[j][l];\n      }\n    }\n    total = 0;\n    for (l = 0; l < n[i]; l++) {\n      total = total + a[0][l] + a[m[i] - 1][l];\n    }\n    for (j = 1; j < m[i] - 1; j++) {\n      total = total + a[j][0] + a[j][n[i] - 1];\n    }\n    he[i] = total;\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d\\n\", he[i]);\n  }\n  printf(\"%d\", he[k - 1]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "9909", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int *p = NULL;\n  int a[100][100];\n  cin >> k;\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (int j = 0; j <= m - 1; j++) {\n      for (int t = 0; t <= n - 1; t++) {\n        cin >> a[j][t];\n      }\n    }\n    p = &a[0][0];\n    for (p = &a[0][0]; p <= &a[0][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    for (p = &a[1][0]; p <= &a[m - 2][0]; p = p + 100) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    for (p = &a[m - 1][0]; p <= &a[m - 1][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], sum, p, q;\n  int i, j, h;\n  cin >> k;\n  for (h = 1; h <= k; h++) {\n    cin >> m >> n;\n    p = 0;\n    q = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n        p = p + a[i][j];\n      }\n    }\n    for (i = 2; i < m; i++) {\n      for (j = 2; j < n; j++)\n        q = q + a[i][j];\n    }\n    sum = p - q;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int x = 1; x <= k; x++) {\n    int m, n;\n\n    int sum = 0, a;\n    cin >> m >> n;\n    for (int j = 1; j <= n; j++) {\n      cin >> a;\n      sum += a;\n    }\n    for (int i = 2; i <= m - 1; i++) {\n      cin >> a;\n      sum += a;\n      for (int j = 2; j <= n - 1; j++)\n        cin >> a;\n      cin >> a;\n      sum += a;\n    }\n    if (n != 1) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a;\n        sum += a;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], l, b[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n        if (j == 0 || j == m - 1)\n          b[i] += a[j][l];\n        else {\n          if (l == 0 || l == n - 1)\n            b[i] += a[j][l];\n        }\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "6", "index": "9913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int p = 0, i = 0, j = 0, k = 0, n = 0, m = 0, *q = NULL;\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0, a[100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[j];\n      q = a;\n      while (q <= &a[n - 1]) {\n        if (i == 0 || i == m - 1) {\n          sum = sum + *q;\n          q++;\n        } else {\n          if (q == &a[0] || q == &a[n - 1])\n            sum = sum + *q;\n          q++;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, t;\n  for (t = 0; t < n; t++) {\n    int h, l;\n    int sum = 0;\n    scanf(\"%d %d\", &h, &l);\n    int a[100][100] = {0};\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    if (h == 1)\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i];\n    else if (l == 1)\n      for (j = 0; j < h; j++)\n        sum = sum + a[j][0];\n    else {\n\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i] + a[h - 1][i];\n      for (j = 1; j < h - 1; j++)\n        sum = sum + a[j][0] + a[j][l - 1];\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p = 0, num[100][100], sum = 0;\n  cin >> k;\n  while (p < k) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    for (j = 0; j < n; j++)\n      sum += num[0][j];\n    for (i = 1; i < m - 1; i++) {\n      sum += num[i][0];\n      sum += num[i][n - 1];\n    }\n    for (j = 0; j < n; j++)\n      sum += num[m - 1][j];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bian(int a, int b);\n  int n, i, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    printf(\"%d\\n\", bian(a, b));\n  }\n  return 0;\n}\nint bian(int a, int b) {\n  int c[10000], *p, i, j;\n  int s = 0;\n  for (p = c, i = 0; i < a * b; i++, p++) {\n    scanf(\"%d\", p);\n  }\n  for (p = c, i = 0; i < a * b;) {\n    if (i == 0) {\n      for (j = 0; j < b; j++) {\n        s = s + *p;\n        p++;\n        i++;\n      }\n    }\n    if (i < (a - 1) * b) {\n      for (; i <= (a - 1) * b - 1; i++, p++) {\n        if (i % b == 0 || i % b == (b - 1)) {\n          s = s + *p;\n        }\n      }\n    }\n    if (i == (a - 1) * b) {\n      for (j = 0; j < b; j++, p++, i++) {\n        s = s + *p;\n      }\n    }\n  }\n  return s;\n}\n"}
{"label": "6", "index": "9917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  for (int z = 0; z < k; z++) {\n    int num[100][100], m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &num[j][i]);\n      }\n    }\n    int sum = 0;\n\n    for (int i = 0; i < m; i++) {\n      sum = sum + num[i][0] + num[i][n - 1];\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + num[0][i] + num[m - 1][i];\n    }\n    sum = sum - num[0][0] - num[0][n - 1] - num[m - 1][0] - num[m - 1][n - 1];\n    if (z != 0) {\n      cout << \"\\n\";\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int x, int y);\n  int k, i, m, n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n\n    printf(\"%d\\n\", sum(m, n));\n  }\n  return 0;\n}\nint sum(int x, int y) {\n  int b[100][100];\n  int sum = 0, i, j;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      scanf(\"%d\", &b[i][j]);\n  for (i = 0; i < x; i++)\n    for (j = 0; j < y; j++)\n      if (i == 0 || i == (x - 1) || j == 0 || j == (y - 1))\n        sum = sum + b[i][j];\n  return (sum);\n}\n"}
{"label": "6", "index": "9919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int p, q, i, j;\n    cin >> p >> q;\n    int a[p][q], sum = 0;\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < q; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < q; i++) {\n      sum = sum + a[0][i] + a[p - 1][i];\n    }\n    for (j = 0; j < p; j++) {\n      sum = sum + a[j][0] + a[j][q - 1];\n    }\n    sum = sum - a[0][0] - a[0][q - 1] - a[p - 1][0] - a[p - 1][q - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, n, m, i, k, j, a[100][100], s[100];\n  scanf(\"%d\", &p);\n  for (k = 0; k < p; k++) {\n    s[k] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0)\n          s[k] += a[i][j];\n        else if ((m - i - 1) == 0)\n          s[k] += a[i][j];\n        else if (j == 0)\n          s[k] += a[i][j];\n        else if ((n - j - 1) == 0)\n          s[k] += a[i][j];\n      }\n  }\n  for (k = 0; k < p; k++)\n    printf(\"%d\\n\", s[k]);\n  return 0;\n}\n"}
{"label": "6", "index": "9921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  int(*p)[100] = a;\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) \n  {\n    count = 0; \n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        \n        cin >> *(*(p + i) + j);\n    for (int i = 1; i < m - 1; i++) \n    {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) \n    {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    cout << count << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9922", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int row;\n    int col;\n    int total = 0;\n    int s[100][100];\n    scanf(\"%d%d\", &row, &col);\n    int x, y;\n    for (x = 0; x < row; x++) {\n      for (y = 0; y < col; y++) {\n        scanf(\"%d\", &s[x][y]);\n      }\n    }\n    if (row < 3 || col < 3) {\n      for (x = 0; x < row; x++) {\n        for (y = 0; y < col; y++) {\n          total += s[x][y];\n        }\n      }\n      printf(\"%d\\n\", total);\n    } else {\n      for (y = 0; y < col; y++) {\n        total += s[0][y];\n      }\n      for (y = 0; y < col; y++) {\n        total += s[row - 1][y];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][0];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][col - 1];\n      }\n      total =\n          total - s[0][0] - s[0][col - 1] - s[row - 1][0] - s[row - 1][col - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, y, n, s, j, h, a, k, b, sz[100][100], jieguo[100], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a, &b);\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d\", &sz[j][k]);\n    }\n    sum = 0;\n    for (h = 0; h < b; h++) {\n      sum = sum + sz[0][h] + sz[a - 1][h];\n    }\n    for (s = 0; s < a; s++) {\n      sum = sum + sz[s][0] + sz[s][b - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][b - 1] - sz[a - 1][0] - sz[a - 1][b - 1];\n    jieguo[i] = sum;\n  }\n  for (y = 0; y < n; y++) {\n    cout << jieguo[y] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9924", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum;\n  int *p;\n  cin >> k;\n  for (; k > 0; k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (p = a[0]; p < a[0] + n; p++)\n      sum += *p;\n    for (p = p + 99; p < a[0] + (m - 1) * 100 + n; p = p + 100)\n      sum += *p;\n    for (p = p - 101; p > a[0] + (m - 1) * 100 - 1; p--)\n      sum += *p;\n    for (p = p - 99; p > a[0]; p = p - 100)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9925", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[100][100];\n  int i, j, sum = 0;\n\n  cin >> group;\n  while (group--) {\n    scanf(\"%d %d \", &row, &col);\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> a[i][j];\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < col; i++) {\n        sum += a[0][i];\n        if (row > 1)\n          sum += a[row - 1][i];\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += a[i][0];\n        if (col > 1)\n          sum += a[i][col - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "9926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, m, sum = 0, x, y;\n  i = 0;\n  int sj[100];\n  int sz[100][100];\n  scanf(\"%d\", &x);\n  for (y = 0; y < x; y++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[i][k]);\n      }\n    }\n    for (k = 0; k < n; k++) {\n      sum = sum + sz[0][k] + sz[m - 1][k];\n    }\n    for (i = 1; i < m - 1; i++)\n      sum = sum + sz[i][0] + sz[i][n - 1];\n\n    sj[y] = sum;\n    sum = 0;\n  }\n  for (y = 0; y < x; y++) {\n    printf(\"%d\\n\", sj[y]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int t = 0; t < k; t++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (int i = 0; i < n; i++) {\n        sum += *(*(a) + i);\n      }\n      cout << sum << endl;\n      continue;\n    }\n    if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    for (int i = 0; i < n; i++)\n      sum = sum + *(*(a) + i) + *(*(a + m - 1) + i);\n    for (int i = 0; i < m; i++)\n      sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n    printf(\"%d\\n\", sum - *(*(a)) - *(*(a) + n - 1) - *(*(a + m - 1)) -\n                       *(*(a + m - 1) + n - 1));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, h1, l1, k, h, l, a[100][100], sum[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (h1 = 1; h1 <= h; h1++)\n      for (l1 = 1; l1 <= l; l1++) {\n        scanf(\"%d\", &a[h1][l1]);\n      }\n    for (h1 = 1; h1 <= h; h1++)\n      sum[i] += a[h1][1] + a[h1][l];\n    for (l1 = 2; l1 <= l - 1; l1++)\n      sum[i] += a[1][l1] + a[h][l1];\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "9929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, c, d = 0, e = 0, i, j, k, l, m, n;\n  int a[101][101] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (b = 1; b <= m; b++) {\n      for (c = 1; c <= n; c++) {\n        cin >> a[b][c];\n        d = d + a[b][c];\n      }\n    }\n    for (b = 2; b <= m - 1; b++) {\n      for (c = 2; c <= n - 1; c++) {\n        e = e + a[b][c];\n      }\n    }\n    printf(\"%d\\n\", d - e);\n    d = 0;\n    e = 0;\n  }\n}\n"}
{"label": "6", "index": "9930", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  int m, n, j, l;\n  int z[100][100], h[100];\n  for (i = 0; i < 100; i++) {\n    h[i] = 0;\n  }\n  for (l = 0; l < k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(z[i][j]));\n      }\n    }\n    for (j = 0; j < n; j++) {\n      h[l] += z[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      h[l] += z[i][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][j];\n    }\n  }\n  for (l = 0; l < k; l++) {\n    if (l == 0) {\n      printf(\"%d\", h[l]);\n    } else {\n      printf(\"\\n%d\", h[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, i, j, sum;\n  int a[101][101];\n  cin >> t;\n  for (; t > 0; t--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i));\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a) + j);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a + m - 1) + j);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9932", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int i, j, t;\n  int sum;\n  int z;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &z);\n        if (i == 0 || i == m - 1)\n          sum += z;\n        else {\n          if (j == 0 || j == n - 1)\n            sum += z;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  const int max = 100;\n  int num;\n  cin >> num;\n  while (num--) {\n    int m, n;\n    cin >> m >> n;\n    int a[max][max];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int row, line, a, b, A[101][101];\n    int sum = 0;\n    cin >> row >> line;\n    for (a = 1; a <= row; a++)\n      for (b = 1; b <= line; b++)\n        cin >> A[a][b];\n    for (a = 1; a <= row; a++)\n      sum += A[a][1];\n    for (b = 2; b <= line; b++)\n      sum += A[row][b];\n    for (a = row - 1; a >= 1; a--)\n      sum += A[a][line];\n    for (b = line - 1; b >= 2; b--)\n      sum += A[1][b];\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "9935", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int k, m, n, i, j, a, sum = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        if (i == 0 || i == m - 1) {\n          sum += sz[i][j];\n        }\n        if (i > 0 && i < m - 1 && (j == 0 || j == n - 1))\n          sum += sz[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint imat[100][100];\n\nint main() {\n  int n;\n  cin >> n;\n  int a, b;\n  for (int i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        scanf(\"%d \", &imat[j][k]);\n      }\n    }\n\n    int(*p)[100] = &(imat[0]);\n\n    int counter = 0;\n\n    for (int i = 0; i < a; i++) {\n      for (int j = 0; j < b; j++) {\n        if (j % b == 0 || j % b == (b - 1) || i == 0 || i == (a - 1))\n          counter = counter + *(*(p + i) + j);\n      }\n    }\n\n    cout << counter << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    int m = 0, n = 0;\n    scanf(\"%d %d\", &m, &n);\n    int i = 0, j = 0, x = 0;\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += x;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, j, i, k, m, a, t, all, sum;\n  int s[500][500];\n  scanf(\"%d\", &all);\n  m = 0;\n  for (t = 0; t < all; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &s[i][j]);\n        sum += s[i][j];\n      }\n    if ((m == 1) || (n == 1))\n      printf(\"%d\\n\", sum);\n    else {\n      for (i = 1; i <= m - 2; i++)\n        for (j = 1; j <= n - 2; j++)\n          sum = sum - s[i][j];\n      cout << sum << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9939", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, i;\n  int h, s, t, p;\n  int sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> n >> m;\n    for (a = 0; a < n; a++) {\n      for (b = 0; b < m; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    h = 0, s = 0, t = 0, p = 0;\n    for (b = 0; b < m; b++) {\n      h = h + sz[0][b];\n      if (n > 1)\n        s = s + sz[n - 1][b];\n    }\n    for (a = 1; a < n - 1; a++) {\n      t = t + sz[a][0];\n      if (m > 1) {\n        p = p + sz[a][m - 1];\n      }\n    }\n    result[i] = h + s + t + p;\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", result[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "9940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k >= 1) {\n    int m, n, i, j, *p = NULL, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (p = a[0]; p < a[0] + n; p++)\n      sum = sum + *p;\n    for (p = a[0]; p <= a[m - 1]; p += 100)\n      sum = sum + *p;\n    for (p = a[m - 1]; p < a[m - 1] + n; p++)\n      sum = sum + *p;\n    for (p = a[0] + n - 1; p <= a[m - 1] + n - 1; p += 100)\n      sum = sum + *p;\n    cout << sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1] << \"\\n\";\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9941", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int M = 100 + 10;\nconst int N = 100 + 10;\nint mat[M][N];\nint main(void) {\n  int cases, i, j, ans, m, n;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    ans = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; ++i) {\n      for (j = 0; j < n; ++j)\n        scanf(\"%d\", mat[i] + j);\n    }\n    if (m == 0 || n == 0) {\n      printf(\"%d\\n\", 0);\n      continue;\n    }\n    if (m == 1) {\n      for (i = 0; i < n; ++i) {\n        ans += mat[0][i];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    } else if (n == 1) {\n      for (i = 0; i < m; ++i) {\n        ans += mat[i][0];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    }\n\n    for (i = 0; i < n; ++i) {\n      ans += mat[0][i];\n      ans += mat[m - 1][i];\n    }\n    for (i = 0; i < m; ++i) {\n      ans += mat[i][0];\n      ans += mat[i][n - 1];\n    }\n    ans -= (mat[0][0] + mat[0][n - 1] + mat[m - 1][0] + mat[m - 1][n - 1]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9942", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, x, i, j, sum;\n  int m, n;\n  int a[100][100], b[100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    sum = 0;\n    cin >> m >> n;\n    if ((m >= 3) & (n >= 3)) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      }\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n\n      for (i = 0; i < m; i++) {\n        sum += a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n      b[x] = sum;\n    } else {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n          sum = sum + a[i][j];\n        }\n      }\n      b[x] = sum;\n    }\n  }\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", b[x]);\n  return 0;\n}\n"}
{"label": "6", "index": "9943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, m, n, i, M, j, JU[100][100], h, l;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    M = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (h = 0; h < m; h++) {\n      for (l = 0; l < n; l++) {\n        cin >> JU[h][l];\n      }\n    }\n    if (n == 1) {\n      for (j = 0; j < m; j++)\n        M = M + JU[j][0];\n    } else if (m == 1) {\n      for (j = 0; j < n; j++)\n        M = M + JU[0][j];\n    } else {\n      for (h = 0; h < m; h++) {\n        if (h > 0 && h < m - 1) {\n          M = M + JU[h][0] + JU[h][n - 1];\n        } else {\n          for (j = 0; j < n; j++)\n            M = M + JU[h][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", M);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9944", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, h, l, result = 0;\n  int a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[h][l];\n      }\n    }\n    for (l = 1; l <= n; l++) {\n      result = result + a[1][l] + a[m][l];\n    }\n    for (h = 2; h <= m - 1; h++) {\n      result = result + a[h][1] + a[h][n];\n    }\n    cout << result << endl;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++)\n        a[h][l] = 0;\n    }\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fy();\n  int num, k;\n  scanf(\"%d\", &num);\n  for (k = 0; k < num; k++) {\n    printf(\"%d\\n\", fy());\n  }\n}\nint fy() {\n  int a[100][100];\n  int sum = 0, m, n, i, j;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", *(a + i));\n    sum = sum + *(*(a + i));\n    for (j = 1; j < n; j++)\n      scanf(\" %d\", *(a + i) + j);\n    sum = sum + *(*(a + i) + n - 1);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum = sum + a[0][i] + a[m - 1][i];\n  }\n  return sum;\n}\n"}
{"label": "6", "index": "9946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], sum[100], i, j, a, b, c, d, e;\n  b = 0;\n  c = 0;\n  d = 0;\n  e = 0;\n  cin >> k;\n\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      b = b + sz[0][j];\n      c = c + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      d = d + sz[i][0];\n      e = e + sz[i][n - 1];\n    }\n    sum[a] = b + c + d + e;\n    b = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n  }\n  for (a = 0; a < k; a++) {\n    printf(\"%d\\n\", sum[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[101][101];\n  int(*p)[101];\n  int i, j, sum = 0;\n  p = a;\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> *(*(p + i) + j);\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = **p;\n    else {\n      for (i = 0; i < col; i++) {\n        sum += *(*p + i);\n        if (row > 1)\n          sum += *(*(p + row - 1) + i);\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += *(*(p + i));\n        if (col > 1)\n          sum += *(*(p + i) + col - 1);\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9948", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k, m, n, sum, a[100][100], i, j;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int(*p)[100]; \n    p = a;        \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j); \n    for (i = 0; i < m; i++)\n      sum = sum + **(p + i) + *(*(p + i) + n - 1); \n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j) + *(*(p + m - 1) + j); \n    sum = sum - **p - *(*p + n - 1) - **(p + m - 1) -\n          *(*(p + m - 1) + n - 1); \n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "9949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, x, m, n, i, j, k, sum[10000] = {0};\n  int sz[100][100];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    if ((m > 2) && (n > 2)) {\n      for (j = 0; j < m; j++) {\n        sum[i] = sum[i] + sz[j][0] + sz[j][n - 1];\n      }\n      for (k = 0; k < n; k++) {\n        sum[i] = sum[i] + sz[0][k] + sz[m - 1][k];\n      }\n      sum[i] =\n          sum[i] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    } else {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < n; k++) {\n          sum[i] = sum[i] + sz[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9950", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    int num[110][110] = {0}, (*p)[110], sum = 0, i, j;\n    p = num;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n    p = num;\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j);\n    for (i = 1; i < m; i++)\n      sum = sum + *(*(p + i) + n - 1);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + *(*(p + m - 1) + j);\n    for (i = 1; i < m - 1; i++)\n      sum = sum + *(*(p + i) + 0);\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, k, sum = 0, x, q, w, e, r;\n  int ss[100];\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n    q = 0;\n    w = 0;\n    e = 0;\n    r = 0;\n    for (j = 0; j < n; j++) {\n      q = q + sz[0][j];\n    }\n    for (j = 0; j < n; j++) {\n      w = w + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      e = e + sz[i][0];\n    }\n    for (i = 1; i < m - 1; i++) {\n      r = r + sz[i][n - 1];\n    }\n    sum = q + w + e + r;\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[200], n[200], i, t, j, a[200][200], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (t = 1; t <= m[i]; t++) {\n      for (j = 1; j <= n[i]; j++) {\n        scanf(\"%d\", &a[t][j]);\n      }\n    }\n\n    if (m[i] == 1 && n[i] == 1) {\n      printf(\"%d\", a[1][1]);\n    } else {\n\n      sum = 0;\n\n      for (t = 1; t <= n[i]; t++) {\n        sum = sum + a[1][t];\n      }\n\n      for (j = 1; j <= n[i]; j++)\n        sum = sum + a[m[i]][j];\n\n      for (t = 1; t <= m[i]; t++)\n        sum = sum + a[t][1];\n\n      for (j = 1; j <= m[i]; j++) {\n        sum = sum + a[j][n[i]];\n      }\n\n      sum = sum - a[1][1] - a[1][n[i]] - a[m[i]][n[i]] - a[m[i]][1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, s;\n  int a[100][100];\n  int(*p)[100];\n  int sum[100] = {0};\n  cin >> k;\n  for (s = 0; s < k; s++) {\n    p = a;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    }\n    for (i = 0; i < n; i++) {\n      if ((i == 0) || (i == n - 1))\n        for (j = 0; j < m; j++)\n          sum[s] = sum[s] + *(*(p + i) + j);\n      else\n        sum[s] = sum[s] + *(*(p + i)) + *(*(p + i) + m - 1);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, sum[100], p, q, t, l, m[100], n[100], h;\n  int a[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\\n\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++)\n      for (h = 0; h < n[i]; h++) {\n        scanf(\"%d\", &a[j][h]);\n      }\n    for (p = 0; p < n[i]; p++) {\n      sum[i] = sum[i] + a[0][p];\n    }\n    for (q = 1; q < m[i]; q++) {\n      sum[i] = sum[i] + a[q][n[i] - 1];\n    }\n    for (l = n[i] - 2; l >= 0; l--) {\n      sum[i] = sum[i] + a[m[i] - 1][l];\n    }\n    for (t = m[i] - 2; t > 0; t--) {\n      sum[i] = sum[i] + a[t][0];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9955", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int k, m, n, *p;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    int sum = 0;\n    int a[100][100] = {0};\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    p = a[0];\n    for (int j = 0; j < n; j++)\n      sum += *p++;\n    if (m - 1 != 0) {\n      p = a[m - 1];\n      for (int j = 0; j < n; j++)\n        sum += *p++;\n    }\n    for (int j = 1; j < m - 1; j++) {\n      p = a[j];\n      \n      sum += *p;\n      sum += *(p + n - 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int *p, i, all, m, n, cycle, ii;\n\n  scanf(\"%d\", &cycle);\n  for (ii = 0; ii < cycle; ii++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)calloc(m * n, sizeof(int));\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    all = 0;\n    for (i = 0; i < n; i++)\n      all += *(p + i);\n    if (m > 1) {\n      for (i = 0; i < n; i++)\n        all += *(p + i + (m - 1) * n);\n    }\n    for (i = 2; i < m; i++)\n      all += *(p + (i - 1) * n);\n    if (n > 1) {\n      for (i = 2; i < m; i++)\n        all += *(p + n - 1 + (i - 1) * n);\n    }\n    cout << all << \" \";\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "9957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s, r, l;\n  int sz[100][100];\n  s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &r);\n    scanf(\"%d\", &l);\n    for (int j = 0; j < r; j++) {\n      for (int k = 0; k < l; k++) {\n        scanf(\"%d\", &(sz[j][k]));\n        if ((j == 0) || (j == r - 1) || ((j != 0) && (k == 0)) ||\n            ((j != 0) && (k == l - 1))) {\n          s = s + sz[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int r, c, j, k, l, m, sum, n, p;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    sum = 0;\n    cin >> r;\n    cin >> c;\n    for (int i = 0; i < r; i++)\n      for (int j = 0; j < c; j++)\n        cin >> a[i][j];\n\n    for (j = 0; j < r; j++) {\n      sum = sum + **(a + j);\n    }\n\n    for (k = 1; k < c; k++) {\n      sum = sum + *(*(a + r - 1) + k);\n    }\n    for (l = r - 2; l >= 0; l--) {\n      sum = sum + *(*(a + l) + c - 1);\n    }\n    for (m = 1; m < c - 1; m++) {\n      sum = sum + *(*(a + 0) + m);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num += a[i][j];\n      }\n\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      printf(\"%d\\n\", num);\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum += a[i][j];\n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum += a[i][j];\n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, i, j, k, m, n;\n  int sum = 0;\n  cin >> p;\n  int sz[100][100];\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == 0 || j == (m - 1))\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == 0)\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == (n - 1))\n          sum += sz[j][k];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, ha, li, x, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    scanf(\"%d %d\", &ha, &li);\n    for (l = 0; l < ha; l++) {\n      for (k = 0; k < li; k++) {\n        scanf(\"%d\", &x);\n        if (l == 0 || l == (ha - 1) || (k == 0 && l != 0 && l != (ha - 1)) ||\n            (k == (li - 1) && l != 0 && l != (ha - 1))) {\n          s = s + x;\n        }\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  int m = 0, n = 0;\n  while (cin >> m >> n) {\n    int result = 0;\n    int num[100][100] = {0};\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    for (j = 0; j < n; j++)\n      result += num[0][j] + num[m - 1][j];\n    for (i = 1; i < (m - 1); i++)\n      result += num[i][0] + num[i][n - 1];\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum(int m, int n) {\n  int a[m][n], i, j, t = 0;\n  if (m == 1 || n == 1)\n    for (i = 0; i < m + n - 1; i++) {\n      scanf(\"%d\", &j);\n      t += j;\n    }\n\n  else {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < m; i++)\n      t += a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      t += a[0][j] + a[m - 1][j];\n  }\n  return t;\n}\nint main() {\n  int m, n, q;\n  for (scanf(\"%d\", &q); q > 0; q--) {\n    scanf(\"%d%d\", &m, &n);\n    cout << sum(m, n) << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9964", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i = 1, j, a[101][101], s, k;\n  int sum1, sum2, sum3, sum4, sum;\n  cin >> s;\n  while (i <= s) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m;\n    cin >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (j = 0; j < n; j++)\n      sum1 += a[0][j];\n    for (j = 0; j < n; j++)\n      sum2 += a[m - 1][j];\n    for (j = 0; j < m; j++)\n      sum3 += a[j][0];\n    for (j = 0; j < m; j++)\n      sum4 += a[j][n - 1];\n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int rie, k, i;\n  int ROW, COL;\n  int row, col;\n  int sz[100][100] = {0};\n  int sum[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    cin >> ROW >> COL;\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &(sz[row][col]));\n      }\n    }\n    rie = 0;\n    for (col = 0; col <= COL - 1; col++)\n      rie += sz[0][col];\n\n    for (row = 1; row <= ROW - 1; row++) {\n      rie += sz[row][COL - 1];\n    }\n    for (col = COL - 2; col >= 0; col--)\n      rie += sz[ROW - 1][col];\n\n    for (row = ROW - 2; row >= 1; row--) {\n      rie += sz[row][0];\n    }\n    sum[i] = rie;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9966", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint sum = 0;\nvoid ijudge(int i, int j, int k, int p, int q) {\n  if ((j == 0) || (j == p - 1) || (k == 0) || (k == q - 1))\n    sum += i;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int p, q;\n  for (int i = 0; i < n; i++) {\n    cin >> p >> q;\n    sum = 0;\n    for (int j = 0; j < p; j++)\n      for (int k = 0; k < q; k++) {\n        cin >> a[j][k];\n        ijudge(a[j][k], j, k, p, q);\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0, i = 0, j = 0, lin = 0, col = 0;\n  int array[105][105];\n  int sum = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> lin >> col;\n    for (int p = 0; p < lin; p++) {\n      for (int q = 0; q < col; q++) {\n        cin >> *(*(array + p) + q);\n      }\n    }\n    for (j = 0; j < col; j++) {\n      sum = sum + array[0][j];\n    }\n    for (j = 1; j < lin; j++) {\n      sum = sum + array[j][col - 1];\n    }\n    for (j = 0; j < (col - 1); j++) {\n      sum = sum + array[lin - 1][j];\n    }\n    for (j = 1; j < (lin - 1); j++) {\n      sum = sum + array[j][0];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, row, q, col, i, j, *a, *num;\n  scanf(\"%d\", &k);\n  num = (int *)malloc(k * sizeof(int));\n  for (q = 0; q < k; q++) {\n    int sum = 0;\n    scanf(\"%d %d\", &row, &col);\n    a = (int *)malloc(row * col * sizeof(int));\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", a + i * col + j);\n        if (i == 0 || j == 0 || i == row - 1 || j == col - 1)\n          sum = sum + *(a + i * col + j);\n      }\n    *(num + q) = sum;\n    free(a);\n  }\n  for (q = 0; q < k; q++)\n    printf(\"%d\\n\", *(num + q));\n  free(num);\n  return 0;\n}\n"}
{"label": "6", "index": "9969", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, ii, jj, l, t;\n  int s[10002] = {0};\n  int *k = s;\n  int sum = 0;\n  cin >> jj;\n  for (i = 1; i <= jj; i++) {\n    cin >> m >> n;\n    t = m * n;\n    for (ii = 1; ii <= t; ii++) {\n      k = k + 1;\n      scanf(\"%d\", k);\n      if (ii <= n || ii > (m - 1) * n || ii % n == 1 || ii % n == 0)\n        sum = sum + *k;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    k = s;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9970", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, N, w, s;\n  int a[100][100];\n  scanf(\"%d\\n\", &N);\n  for (w = 0; w < N; w++) {\n    s = 0;\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if ((n > 1) && (m > 1)) {\n\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n      for (i = 0; i < n; i++)\n        s += a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][0];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][n - 1];\n    }\n    if ((n == 1) && (m > 1))\n      s = a[0][0] + a[m - 1][0];\n\n    if ((n > 1) && (m == 1))\n      s = a[0][0] + a[0][n - 1];\n    if ((n == 1) && (m == 1))\n      s = a[0][0];\n\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "9971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, j;\n  int m, n;\n  int a[10000];\n  int *p, r;\n  int sum = 0;\n\n  scanf(\"%d\\n\", &k);\n\n  int i;\n  p = a;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n\n    for (j = 0; j < 10000; j++)\n      *(p + j) = 0;\n\n    for (j = 0; j < m * n; j++)\n      cin >> *(p + j);\n\n    for (j = 0; j < n; j++)\n      sum = sum + *(p + j);\n\n    for (r = 1; r < m - 1; r++)\n      sum = sum + *(p + n * r) + *(p + n * r + n - 1);\n\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(p + (m - 1) * n + j);\n    }\n\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "9972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p, q, m, n, k, a[200][200], sum;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    }\n    int *pointer;\n    pointer = *a;\n    for (p = 0; p < n; p++) {\n      sum = sum + *(pointer + p);\n    }\n    for (p = 1; p < m - 1; p++) {\n      sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    for (p = 0; p < n; p++)\n      sum = sum + *(*(a + m - 1) + p);\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  int a[100000];\n  for (int i = 0; i < b; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n    for (int k = 0; k < m; k++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &(sz[k][p]));\n      }\n    }\n    if (m * n != 1) {\n      for (int o = 0; o < n; o++) {\n        a[i] = a[i] + sz[0][o] + sz[m - 1][o];\n      }\n      for (int q = 0; q < m; q++) {\n        a[i] = a[i] + sz[q][0] + sz[q][n - 1];\n      }\n      a[i] = a[i] - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n      cout << a[i] << \"\\n\";\n    } else {\n      printf(\"%d\", sz[0][0]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int a, b;\n  int s[100][100];\n  int sum;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j <= a - 1; j++) {\n      for (k = 0; k <= b - 1; k++) {\n        scanf(\"%d\", &s[j][k]);\n      }\n    }\n    sum = 0;\n    for (k = 0; k <= b - 1; k++) {\n      sum = sum + s[0][k];\n    }\n    for (j = 1; j <= a - 1; j++) {\n      sum = sum + s[j][b - 1];\n    }\n    for (k = 0; k <= b - 2; k++) {\n      sum = sum + s[a - 1][k];\n    }\n    for (j = 1; j <= a - 2; j++) {\n      sum = sum + s[j][0];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9975", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int tol, i, j, sum, k, x[100][100], row, line;\n  scanf(\"%d\", &tol);\n  for (k = 0, sum = 0; k < tol; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &line);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        scanf(\"%d\", &x[i][j]);\n      }\n    }\n    if (line == 1) {\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n      }\n    } else {\n\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n        sum += x[i][line - 1];\n      }\n    }\n    if (row == 1) {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n      }\n    } else {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n        sum += x[row - 1][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, k, sum;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    k--;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        sum += *(*a + j);\n      else\n        sum += *(*a + j) + *(*(a + m - 1) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += a[i][0] + a[i][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, q;\n  int k;\n  int m, n;\n  int a[110][110];\n  int sum;\n  scanf(\"%d\", &k); \n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) \n    {\n      for (q = 0; q < n; q++) \n      {\n        scanf(\"%d\", *(a + j) + q); \n      }\n    }\n             \n    for (j = 0; j < n; j++) \n    {\n      sum += *(*a + j);\n      if (m != 1)\n        sum += *(*(a + m - 1) + j);\n    }\n    for (j = 1; j < m - 1; j++) \n    {\n      sum += *(*(a + j));\n      if (n != 1) \n        sum += *(*(a + j) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100];\n  int i = 0, j = 0, t = 1;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    if (m == 1 && n == 1)\n      cout << a[0][0] << endl;\n    else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, n, i, j, x, y, sum, a[100][100];\n  scanf(\"%d\", &n);\n  for (c = 1; c <= n; c++) {\n    sum = 0;\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][0];\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][j - 1];\n    for (j = 0; j < y; j++)\n      sum = sum + a[0][j];\n    for (j = 0; j < y; j++)\n      sum = sum + a[x - 1][j];\n    sum = sum - a[0][0] - a[x - 1][0] - a[0][y - 1] - a[x - 1][y - 1];\n    if (c != n)\n      printf(\"%d\\n\", sum);\n    else\n      printf(\"%d\", sum);\n  }\n}\n"}
{"label": "6", "index": "9980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, m, n, k, i, j, t, sum[1001] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (t = 1; t <= m; t++)\n      for (j = 1; j <= n; j++) {\n        cin >> a[t][j];\n      }\n    for (j = 1; j <= n; j++)\n      sum[i] = sum[i] + a[1][j] + a[m][j];\n    for (j = 1; j <= m; j++) {\n      if (j == 1 || j == m)\n        continue;\n      sum[i] = sum[i] + a[j][1] + a[j][n];\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "9981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, M, i, j, sum[1000];\n  int row[1000], col[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &M);\n  for (m = 0; m < M; m++) {\n    sum[m] = 0;\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        sz[i][j] = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &row[m], &col[m]);\n\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < col[m]; j++) {\n      sum[m] += sz[0][j];\n      sum[m] += sz[row[m] - 1][j];\n    }\n    for (i = 0; i < row[m]; i++) {\n      sum[m] += sz[i][0];\n      sum[m] += sz[i][col[m] - 1];\n    }\n    sum[m] = sum[m] - sz[0][0] - sz[row[m] - 1][col[m] - 1] -\n             sz[0][col[m] - 1] - sz[row[m] - 1][0];\n  }\n  for (m = 0; m < M; m++) {\n    cout << sum[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9982", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int t = 0; t < k; t++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    for (int i = 0; i < n; i++)\n      sum = sum + *(*(a) + i) + *(*(a + m - 1) + i);\n    for (int i = 0; i < m; i++)\n      sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n    cout << sum - *(*(a)) - *(*(a) + n - 1) - *(*(a + m - 1)) -\n                *(*(a + m - 1) + n - 1)\n         << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int s = 0;\n    if (m == 1) {\n      for (j = 0; j < n; j++)\n        s += a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n\n      printf(\"%d\\n\", s);\n    } else {\n\n      for (j = 0; j < n - 1; j++)\n        s += a[0][j];\n      for (i = 0; i < m - 1; i++)\n        s += a[i][n - 1];\n      for (j = 1; j < n; j++)\n        s += a[m - 1][j];\n      for (i = 1; i < m; i++)\n        s += a[i][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *pi, j = 0, k = 1, sum = 0, n, m, z, t;\n  scanf(\"%d\", &k);\n\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    int *p = (int *)malloc((n * m) * sizeof(int));\n    pi = p;\n    for (z = 0; z < m * n; z++, pi++)\n      scanf(\"%d\", pi);\n    pi = p;\n\n    for (j = 0; j < m * n; pi++) {\n      j++;\n      if (j < n + 1 || j > ((m - 1) * n) || j % n == 1 || j % n == 0)\n        sum = sum + *pi;\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "9985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[100][100], n, m, i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m == 1 && n != 1)\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    if (n == 1 && m != 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n == 1 && m == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i + 1];\n      for (i = 0; i < m - 1; i++)\n        sum += a[i + 1][0] + a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n;\n  int a[100][100] = {0}, sum = 0;\n\n  scanf(\"%d\", &k); \n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n); \n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", *(a + j) + l); \n    sum = 0;\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    } else {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j);\n    }\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    int num[110][110] = {0}, (*p)[110], sum = 0, i, j;\n    p = num;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    p = num;\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j);\n    for (i = 1; i < m; i++)\n      sum = sum + *(*(p + i) + n - 1);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + *(*(p + m - 1) + j);\n    for (i = 1; i < m - 1; i++)\n      sum = sum + *(*(p + i) + 0);\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[101][101];\n  int k, m, n, i, *pointer1, *pointer2, i1, i2, sum = 0;\n  ;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (i1 = 0; i1 < m; i1++) {\n      for (i2 = 0; i2 < n; i2++)\n        cin >> s[i1][i2];\n    }\n    pointer1 = &s[0][1];\n    pointer2 = &s[0][0];\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer1 = &s[0][i1];\n      sum += *pointer1;\n    }\n    for (i1 = 0; i1 < m; i1++) {\n      if (n != 1) {\n        pointer1 = &s[i1][n - 1];\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      } else {\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      }\n    }\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer2 = &s[m - 1][i1];\n      sum += *pointer2;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, e, f, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &e, &f);\n    int a[100][100];\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        a[i][j] = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        cin >> a[i][j];\n    for (i = 0; i < e; i++) {\n      h = h + a[i][0] + a[i][f - 1];\n    }\n    for (j = 1; j < f - 1; j++) {\n      h = h + a[0][j] + a[e - 1][j];\n    }\n    cout << h << \" \";\n    h = 0;\n    e = 0;\n    f = 0;\n  }\n}\n"}
{"label": "6", "index": "9990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t > 0) {\n    int a[102][102];\n    int m, n;\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n    } else {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n      for (int i = 0; i < n; i++)\n        sum += *(*(a + m - 1) + i);\n    }\n    cout << sum << endl;\n    t--;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9991", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n\n  for (int t = 1; t <= k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int q = 0; q < m; q++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &a[q][p]);\n      }\n    }\n    int col = 0, row = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    row = m - 1;\n    col = 0;\n    for (col; col < n; col++)\n      s = s + a[row][col];\n\n    col = n - 1;\n    row = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    s = s - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d \", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, c, d;\n  c = 0;\n  scanf(\"%d\", &k);\n  int sz[100][100];\n  int yi[100];\n  int er[100];\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[0][b];\n    }\n\n    yi[a] = d;\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[m - 1][b];\n    }\n    er[a] = d;\n    d = yi[a] + er[a];\n    for (b = 1; b <= (m - 2); b++)\n      d += sz[b][0];\n\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][n - 1];\n    }\n\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100], sum[100];\n  cin >> k;\n  for (int w = 0; w < 100; w++) {\n    sum[w] = 0;\n  }\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[k];\n        if (j == 0 || j == m - 1 || k == 0 || k == n - 1)\n          sum[i] = sum[i] + a[k];\n      }\n    }\n  }\n  for (int p = 0; p < k; p++) {\n    printf(\"%d\\n\", sum[p]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[1000], n[1000], i, a, b, x, sum;\n  cin >> k;\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n    for (a = 0; a < m[i]; a++) {\n      for (b = 0; b < n[i]; b++) {\n        cin >> x;\n        if (a == 0 || b == 0 || a == m[i] - 1 || b == n[i] - 1) {\n          sum += x;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, num[100][100], count1, count2, count3, sum;\n  int *pointer = NULL;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (count1 = 0; count1 < m; count1++) {\n      for (count2 = 0; count2 < n; count2++) {\n        cin >> num[count1][count2];\n      }\n    }\n    for (pointer = num[0]; pointer < num[0] + n; pointer++) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[m - 1]; pointer < num[m - 1] + n; pointer++) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1] + n - 1, count3 = 1; count3 < m - 1;\n         pointer = num[++count3] + n - 1) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1], count3 = 1; count3 < m - 1;\n         pointer = num[++count3]) {\n      sum = sum + *pointer;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int row, col, j, l, sum = 0, num[100][100];\n    scanf(\"%d %d\", &col, &row);\n    for (l = 0; l < col; l++) {\n      int *a = num[l];\n      for (j = 0; j < row; j++) {\n        scanf(\"%d\", a + j);\n        if (l == 0 || l == col - 1 || j == 0 || j == row - 1) {\n          sum = sum + *(a + j);\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int x, k, m, n, i, j, sum;\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < n - 1; j++) {\n      sum += sz[0][j];\n    }\n    for (i = 0; i < m - 1; i++) {\n      sum += sz[i][j];\n    }\n    for (; j > 0; j--) {\n      sum += sz[i][j];\n    }\n    for (; i > 0; i--) {\n      sum += sz[i][j];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "9998", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, ROW[100], COL[100], row, col, a[100][100], s = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> ROW[i] >> COL[i];\n\n    for (row = 0; row < ROW[i]; row++) {\n      for (col = 0; col < COL[i]; col++) {\n        scanf(\"%d\", &a[row][col]);\n      }\n    }\n\n    for (col = 0; col < COL[i]; col++) {\n      s = s + a[0][col] + a[ROW[i] - 1][col];\n    }\n    for (row = 1; row < ROW[i] - 1; row++) {\n      s = s + a[row][0] + a[row][COL[i] - 1];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "9999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void juzhen();\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    juzhen();\n  }\n}\n\nvoid juzhen() {\n  int m, n, i = 0, j = 0, f = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (j = 0; j < n; j++) {\n    f = f + a[0][j] + a[m - 1][j];\n  }\n  for (i = 1; i < m - 1; i++)\n    f = f + a[i][0] + a[i][n - 1];\n\n  printf(\"%d\\n\", f);\n}\n"}
{"label": "6", "index": "10000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100], *p;\n  cin >> k;\n  for (j = 1; j <= k; j++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = *a, i = 0; i < m * n; i++) {\n      scanf(\"%d \", &p[i]);\n      if (i <= n - 1 || i >= m * n - n - 1 || (i + 1) % n == 0 || i % n == 0) {\n        sum += p[i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10001", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int zong, m, n, a[101][101], sum1 = 0, sum2 = 0, sum = 0;\n  cin >> zong;\n  for (int i = 1; i <= zong; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += a[m][0];\n    }\n\n    else {\n      for (int k = 0; k < n; ++k)\n        sum1 += a[0][k] + a[m - 1][k];\n      for (int j = 0; j < m; ++j)\n        sum2 += a[j][0] + a[j][n - 1];\n      sum = sum1 + sum2 - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum1 = 0, sum2 = 0, sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, row, col, c[100][100], result[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        scanf(\"%d\", *(c + j) + k);\n        if (k == 0 || k == col - 1 || j == 0 || j == row - 1)\n          result[i] += *(*(c + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k, sum = 0;\n  scanf(\"%d\", &k);\n\n  while (k > 0) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], i, j, l, sum = 0;\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + sz[0][j];\n    }\n    for (i = 1; i < m; i++)\n      sum = sum + sz[i][n - 1];\n\n    for (j = 0; j < n - 1; j++) {\n      sum = sum + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, i, j, a, t;\n\n  cin >> a;\n  for (t = 1; t <= a; t++) {\n    int s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n\n    for (i = 1; i <= m; i++) {\n      s += sz[i][1];\n    }\n    for (i = 1; i <= m; i++) {\n      s += sz[i][n];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[1][i];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[m][i];\n    }\n    s -= sz[1][1] + sz[1][n] + sz[m][1] + sz[m][n];\n    cout << s << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m, n;\n  int a[100][100];\n  int i;\n  int j;\n  int e;\n  int sum[100] = {0};\n  for (e = 0; e < k; e++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum[e] = sum[e] + a[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum[e] = sum[e] + a[i][n - 1];\n    }\n    for (j = n - 2; j >= 0; j--) {\n      sum[e] = sum[e] + a[m - 1][j];\n    }\n    for (i = m - 2; i > 0; i--) {\n      sum[e] = sum[e] + a[i][0];\n    }\n  }\n  for (e = 0; e < k; e++) {\n    cout << sum[e] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int c1, c2, d, i, x = 0, k, m, n;\n  int sum[1000];\n  int a[1000][1000], b[1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < 1000; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (c1 = 0; c1 < m; c1++) {\n      for (c2 = 0; c2 < n; c2++) {\n        scanf(\"%d\", &a[c1][c2]);\n      }\n    }\n    for (d = 0; d < m; d++) {\n      sum[x] += a[d][0] + a[d][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      sum[x] += a[0][d] + a[m - 1][d];\n    }\n    x++;\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N = 100;\n  int k, m, n, i, a[N][N], b[N], c, d, e[N], f[N];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d %d\", &e[i], &f[i]);\n    m = e[i];\n    n = f[i];\n    for (c = 0; c < m; c++) {\n      for (d = 0; d < n; d++) {\n        scanf(\"%d\", &a[c][d]);\n      }\n    }\n    for (c = 0; c < m; c++) {\n      b[i] = b[i] + a[c][0] + a[c][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      b[i] = b[i] + a[0][d] + a[m - 1][d];\n    }\n    printf(\"%d\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  for (int i = 1; i <= a; i++) {\n    int m, n, t = 0;\n    cin >> m >> n;\n    int x[100][100];\n\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(x + i) + j);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << *(*(x)) << endl;\n    }\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n == 1) {\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i));\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x + m - 1) + j);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + 0);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + n - 1);\n      }\n      cout << t - *(*(x + 0) + 0) - *(*(x + 0) + n - 1) - *(*(x + m - 1) + 0) -\n                  *(*(x + m - 1) + n - 1)\n           << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bianyuan(int n, int m) {\n  int juzhen[100][100];\n  int i, j, result;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &juzhen[i][j]);\n  }\n  result = 0;\n  for (j = 0; j < m; j++) {\n    result += juzhen[0][j];\n  }\n  for (j = 0; j < m; j++) {\n    result += juzhen[n - 1][j];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][m - 1];\n  }\n  return result;\n}\nint main() {\n  int n, i;\n  int a, lie, hang;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &lie, &hang);\n    a = bianyuan(lie, hang);\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s, m, n, i, j, k, sum = 0;\n  int a[100][100];\n  scanf(\"%d\", &s);\n  for (k = 0; k < s; k++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sum += a[0][i];\n    }\n    if (m > 2) {\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    if (m > 1) {\n      for (i = 0; i < n; i++) {\n        sum += a[m - 1][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      int k;\n      cin >> k;\n      printf(\"%d\", k);\n    } else {\n      for (int i = 0; i < m; i++)\n        for (int j = 0; j < n; j++)\n          cin >> a[i][j];\n      int sum = 0;\n      for (int j = 0; j < n; j++)\n        sum += *(*(a) + j) + *(*(a + m - 1) + j);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      cout << sum << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10014", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n, a[100][100], j, l, sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    for (j = 0; j < m; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b;\n  scanf(\"%d\", &k);\n  int s[k];\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d \", &sz[a][b]);\n    }\n    for (b = 0; b < n; b++) {\n      s[i] = s[i] + sz[0][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      s[i] = s[i] + sz[a][0];\n      s[i] = s[i] + sz[a][n - 1];\n    }\n    if (m != 1) {\n      for (b = 0; b < n; b++) {\n        s[i] = s[i] + sz[m - 1][b];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0;\n  int i = 0, j = 0, k = 0;\n  int row, col;\n  int str[100][100] = {0};\n  int sum;\n  scanf(\"%d\", &n);\n  for (; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        scanf(\"%d\", &str[j][k]);\n    for (j = 0; j < col; j++)\n      sum += str[0][j] + str[row - 1][j];\n    for (j = 1; j < row - 1; j++)\n      sum += str[j][0] + str[j][col - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10017", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int he, m, n, k, sz[100][100];\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (int q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[j][q]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", sz[0][0]);\n    } else {\n      he = 0;\n      for (j = 0; j < m; j++) {\n        if (m == 1) {\n          he += sz[j][0];\n        } else {\n          he += sz[j][0] + sz[j][n - 1];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        if (n == 1) {\n          he += sz[0][j];\n        } else {\n          he += sz[0][j] + sz[m - 1][j];\n        }\n      }\n      printf(\"%d\\n\", he);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10018", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> k;\n  for (int t = 1; t <= k; t++) {\n    int sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n    }\n    if (k == 1) {\n      sum = sum - 3 * a[0][0];\n    } else\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, s;\n  int a[100][100];\n  int(*p)[100];\n  int sum[100] = {0};\n  cin >> k;\n  for (s = 0; s < k; s++) {\n    p = a;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    }\n    for (i = 0; i < n; i++) {\n      if ((i == 0) || (i == n - 1))\n        for (j = 0; j < m; j++)\n          sum[s] = sum[s] + *(*(p + i) + j);\n      else\n        sum[s] = sum[s] + *(*(p + i)) + *(*(p + i) + m - 1);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[400], m, n, a, i, j, k, l, sum, counter, b, matrix[100][100];\n  scanf(\"%d\", &a);\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    counter = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &matrix[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          p[counter] = &matrix[i][j];\n          counter++;\n        }\n      }\n    }\n    for (l = 0; l < counter; l++) {\n      sum += *p[l];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[101][101];\n  int n, i, j, s, t;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d %d \", &s, &t);\n    for (i = 0; i < s; i++)\n      for (j = 0; j < t; j++)\n        cin >> c[i][j];\n    int sum = 0;\n    if (s == 1)\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][t];\n    else if (t == 1)\n      for (i = 0; i < s; i++)\n        sum = sum + c[i][0];\n    else {\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][i] + c[s - 1][i];\n      for (i = 1; i < s - 1; i++)\n        sum = sum + c[i][0] + c[i][t - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10022", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, ans, i, j, x;\n  scanf(\"%d \", &k);\n  while (k--) {\n    cin >> n >> m;\n    ans = 0;\n    for (i = 1; i <= n; i++) {\n      if (i == 1 || i == n)\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          ans += x;\n        }\n      else\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          if (j == 1 || j == m)\n            ans += x;\n        }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  int sz[100][100], sum, s[100];\n  int a, b, m, n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      sum += sz[0][b];\n      sum += sz[m - 1][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      sum += sz[a][0];\n      sum += sz[a][n - 1];\n    }\n    s[i] = sum;\n  }\n  for (i = 1; i <= k; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  int m = 0, n = 0;\n  int a[100][100] = {0};\n  int sum = 0;\n  cin >> k;\n  int(*p)[100] = NULL;\n  p = a;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    for (int a = 0; a < n; a++) {\n      sum = sum + *(*(p + 0) + a);\n    }\n    for (int a = 1; a < m; a++) {\n      sum = sum + *(*(p + a) + n - 1);\n    }\n    for (int a = n - 2; a >= 0; a--) {\n      sum = sum + *(*(p + m - 1) + a);\n    }\n    for (int a = m - 2; a > 0; a--) {\n      sum = sum + *(*(p + a) + 0);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, s, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    s = 0;\n\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < n; j++) {\n      s = s + *(a[0] + j);\n      s = s + *(a[m - 1] + j);\n    }\n    for (i = 0; i < m; i++) {\n      s = s + *(a[i] + 0);\n      s = s + *(a[i] + n - 1);\n    }\n    s = s - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10026", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int(*juzhen)[101] = NULL;\n  int i, j, m, num, hang, lie, input[101][101];\n  cin >> num;\n  for (m = 0; m < num; m++) {\n    cin >> hang >> lie;\n    int sum = 0;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> input[i][j];\n    juzhen = input;\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if ((i == 0) || (i == hang - 1) || (j == 0) || (j == lie - 1))\n          sum = sum + *(*(juzhen + i) + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k--) {\n\n    int array[100][100];\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    if (m == 1 && n == 1)\n      sum = array[0][0];\n    else {\n      for (int k = 0; k != n - 1; k++)\n        sum += array[0][k];\n      for (int k = 0; k != m - 1; k++) {\n        sum += array[k][n - 1];\n      }\n      for (int k = n - 1; k != 0; k--)\n        sum += array[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += array[k][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, l, j;\n  int sz[1000][1000];\n  int jh[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    jh[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    for (k = 0; k < l; k++) {\n      jh[i] += sz[0][k];\n      jh[i] += sz[h - 1][k];\n    }\n    for (j = 1; j < h - 1; j++) {\n      jh[i] += sz[j][0];\n      jh[i] += sz[j][l - 1];\n    }\n    if (h == 1 && l == 1) {\n      jh[i] -= sz[0][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", jh[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid m(int, int);\nint main() {\n  int a, b, c, i;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%d\", &b, &c);\n    m(b, c);\n  }\n  return 0;\n}\nvoid m(int q, int w) {\n  int a, i, j;\n  long sum;\n  sum = 0;\n  for (i = 1; i <= q; i++) {\n    for (j = 1; j <= w; j++) {\n      scanf(\"%d\", &a);\n      if (i == 1 || j == 1 || i == q || j == w) {\n        sum += a;\n      }\n    }\n  }\n  printf(\"%ld \", sum);\n}\n"}
{"label": "6", "index": "10030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, m, n, i, j, k, a[100][100], sum;\n  scanf(\"%d\", &p);\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[j][k]);\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[1][1]);\n      break;\n    }\n    for (k = 1; k <= n; k++)\n      sum += a[1][k] + a[m][k];\n    for (j = 1; j <= m; j++)\n      sum += a[j][1] + a[j][n];\n    sum -= a[1][1] + a[1][n] + a[m][1] + a[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, h, m, n;\n  int sum = 0, minus = 0;\n  int a[100][100];\n  int b[100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        sum += a[i][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        minus += a[i][j];\n      }\n    }\n    b[h] = sum - minus;\n    sum = 0;\n    minus = 0;\n  }\n  for (h = 0; h < k; h++) {\n    cout << b[h] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, m, n, a[100][100], i, j, sum = 0;\nint main() {\n  cin >> k;\n  while (k > 0) {\n    k--;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 || m == 2 || n == 1 || n == 2) {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++)\n          sum += a[i][j];\n    } else {\n      for (j = 1; j <= n; j++)\n        sum += a[1][j];\n      for (j = 1; j <= n; j++)\n        sum += a[m][j];\n      for (i = 2; i < m; i++)\n        sum += a[i][1];\n      for (i = 2; i < m; i++)\n        sum += a[i][n];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "10033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  for (i; i <= n; i++) {\n    int p, q;\n    scanf(\"%d %d\", &p, &q);\n    int a[10000];\n    for (int j = 0; j < p * q; j++)\n      scanf(\"%d\", &a[j]);\n    int sum = 0;\n    int m = 0;\n    while (m < q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = (p - 1) * q;\n    while (m < p * q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = 1;\n    while (m < p - 1) {\n      sum = sum + a[q * m];\n      m++;\n    }\n    m = 2;\n    while (m < p) {\n      sum = sum + a[q * m - 1];\n      m++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc(sizeof(int) * k);\n  for (i = 0; i < k; i++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &sz[j][l]);\n      }\n    }\n    if (m == 1) {\n      for (l = 0; l < n; l++) {\n        s += sz[0][l];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0];\n      }\n    } else {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0] + sz[j][n - 1];\n      }\n      for (l = 0; l < n; l++) {\n        s += sz[0][l] + sz[m - 1][l];\n      }\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    sf[i] = s;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", sf[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10035", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t, i, j, k, a[100][100][100], b[100] = {0}, m[100], n[100];\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (k = 0; k < n[i]; k++)\n        cin >> a[i][j][k];\n    }\n    for (j = 0; j < m[i]; j++)\n      b[i] = b[i] + a[i][j][0] + a[i][j][n[i] - 1];\n    for (j = 0; j < n[i]; j++)\n      b[i] = b[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    b[i] = b[i] - a[i][0][0] - a[i][m[i] - 1][0] - a[i][0][n[i] - 1] -\n           a[i][m[i] - 1][n[i] - 1];\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10036", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k, m, n;\nint arr[105][105];\n\nint main() {\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> arr[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += arr[i][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int row, line, a, b, A[101][101];\n    int sum = 0;\n    cin >> row >> line;\n    for (a = 1; a <= row; a++)\n      for (b = 1; b <= line; b++)\n        cin >> A[a][b];\n    for (a = 1; a <= row; a++)\n      sum += A[a][1];\n    for (b = 2; b <= line; b++) {\n      sum += A[row][b];\n    }\n    for (a = row - 1; a >= 1; a--) {\n      sum += A[a][line];\n    }\n    for (b = line - 1; b >= 2; b--)\n      sum += A[1][b];\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    int row, col;\n    cin >> row >> col;\n    int number[100][100];\n\n    int k, m;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        cin >> number[k][m];\n      }\n    }\n    int sum = 0;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        if (k == 0 || m == 0 || k == row - 1 || m == col - 1) {\n          sum += number[k][m];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bianyuan(int n, int m) {\n  int juzhen[100][100];\n  int i, j, result;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> juzhen[i][j];\n    }\n  }\n  result = 0;\n  for (j = 0; j < m; j++) {\n    result += juzhen[0][j];\n  }\n  for (j = 0; j < m; j++) {\n    result += juzhen[n - 1][j];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][m - 1];\n  }\n  return result;\n}\nint main() {\n  int n, i;\n  int a, lie, hang;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &lie, &hang);\n    a = bianyuan(lie, hang);\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, j, l, s = 0, A[110];\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> *(A + l);\n      if (j == 0 || j == m - 1) {\n        for (l = 0; l < n; l++)\n          s = s + *(A + l);\n      } else\n        s = s + *A + *(A + n - 1);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int rie, k, i;\n  int ROW, COL;\n  int row, col;\n  int sz[100][100] = {0};\n  int sum[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    cin >> ROW >> COL;\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &(sz[row][col]));\n      }\n    }\n    rie = 0;\n    for (col = 0; col <= COL - 1; col++) {\n      rie += sz[0][col];\n    }\n    for (row = 1; row <= ROW - 1; row++) {\n      rie += sz[row][COL - 1];\n    }\n    for (col = COL - 2; col >= 0; col--) {\n      rie += sz[ROW - 1][col];\n    }\n    for (row = ROW - 2; row >= 1; row--) {\n      rie += sz[row][0];\n    }\n    sum[i] = rie;\n  }\n\n  for (i = 1; i <= k; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  int m, n;\n  int a[100][100] = {0};\n  int sum;\n  cin >> t;\n  int i, j, k;\n  for (i = 0; i < t; i++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j];\n      sum = sum + a[m - 1][j];\n    }\n    for (k = 1; k < m - 1; k++) {\n      sum = sum + a[k][0];\n      sum = sum + a[k][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10043", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, jz[100][100], sum = 0;\n  scanf(\"%d \", &k);\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> jz[i][j];\n    }\n    if (m == 1 && n == 1)\n      sum = jz[0][0];\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i] + jz[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + jz[i][0] + jz[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int rie, k, i;\n  int ROW, COL;\n  int row, col;\n  int sz[100][100] = {0};\n  int sum[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &(sz[row][col]));\n      }\n    }\n    rie = 0;\n    for (col = 0; col <= COL - 1; col++) {\n      rie += sz[0][col];\n    }\n    for (row = 1; row <= ROW - 1; row++) {\n      rie += sz[row][COL - 1];\n    }\n    for (col = COL - 2; col >= 0; col--) {\n      rie += sz[ROW - 1][col];\n    }\n    for (row = ROW - 2; row >= 1; row--) {\n      rie += sz[row][0];\n    }\n    sum[i] = rie;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, h, i, j;\n  scanf(\"%d\", &a);\n  int sum[100][3];\n  int n, k;\n  for (h = 1; h <= a; h++) {\n    scanf(\"%d%d\", &n, &k);\n    int sz[100][100];\n    sum[h][1] = 0;\n    sum[h][2] = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= k; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        sum[h][1] = sum[h][1] + sz[i][j];\n      }\n    }\n    if (n > 1 && k > 1) {\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < k; j++) {\n          sum[h][2] = sum[h][2] + sz[i][j];\n        }\n      }\n    }\n    sum[h][3] = sum[h][1] - sum[h][2];\n  }\n  for (i = 1; i <= a; i++) {\n    printf(\"%d\\n\", sum[i][3]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, p, q;\n  int N[100][100];\n  int m, n;\n  int sum = 0;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 1; p <= m; p++) {\n      for (q = 1; q <= n; q++) {\n        scanf(\"%d\", &N[p][q]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[1][j];\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][1];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][n];\n    }\n    sum = sum - N[1][1] - N[1][n] - N[m][1] - N[m][n];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], b[10000], c[10000], i, l, n, sum[10000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (l = 0; l < a[i] * b[i]; l++) {\n      cin >> c[l];\n      if (l <= b[i] || l >= (b[i] * a[i] - b[i] + 1) || l % b[i] == 0 ||\n          (l + 1) % b[i] == 0)\n        sum[i] += c[l];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void jisuan(int array[100][100], int x, int y);\n  int k, i, m, n, p, q, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    jisuan(a, m, n);\n  }\n  return 0;\n}\nvoid jisuan(int array[100][100], int x, int y) {\n  int i, j, a, b, c, d, sum;\n  for (j = 0, a = 0; j < y; j++) {\n    a = a + array[0][j];\n  }\n  for (i = 1, b = 0; i < x; i++) {\n    b = b + array[i][y - 1];\n  }\n  for (j = y - 2, c = 0; j >= 0; j--)\n    c = c + array[x - 1][j];\n\n  for (i = x - 2, d = 0; i > 0; i--) {\n    d = d + array[i][0];\n  }\n  sum = a + b + c + d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "6", "index": "10049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[110][110];\n  int num, sum = 0;\n  int k, m, n, i, j, l;\n\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num;\n        a[i][j] = num;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum = sum + a[0][i];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][n - 1];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][0];\n    }\n    for (i = 1; i < n - 1; i++) {\n      sum = sum + a[m - 1][i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N = 100;\n  int k, m, n, i, a[N][N], b[N], c, d, e[N], f[N];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d %d\", &e[i], &f[i]);\n    m = e[i];\n    n = f[i];\n    for (c = 0; c < m; c++) {\n      for (d = 0; d < n; d++) {\n        scanf(\"%d\", &a[c][d]);\n      }\n    }\n    for (c = 0; c < m; c++) {\n      b[i] = b[i] + a[c][0] + a[c][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      b[i] = b[i] + a[0][d] + a[m - 1][d];\n    }\n    cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10051", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n  if (m != 1)\n    for (k = n - 2; k >= 0; k--) {\n\n      s += a[m - 1][k];\n    }\n  if (n != 1)\n    for (i = m - 2; i > 0; i--) {\n      s += a[i][0];\n    }\n  printf(\"%d\\n\", s);\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int K, i, j, k, m, n, a[100][100] = {0}, sum, p, q, result[100] = {0};\n  scanf(\"%d\", &K);\n  for (i = 1; i <= K; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", *(a + j) + k);\n    if (m == 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    if (m > 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q) + *(*(a + m - 1) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100], i, j, sum, t;\n  scanf(\"%d\", &t);\n  while (t--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m > 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0] + a[i][n - 1];\n    else\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n > 1)\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i];\n    else\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10054", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, count;\n  cin >> k;\n  for (count = 0; count < k; count++) {\n    int i, j, n, m, a[100][100], sum = 0;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum = sum + a[0][j] + a[n - 1][j];\n    }\n    for (i = 0; i < n; i++) {\n      sum = sum + a[i][0] + a[i][m - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], m, n, k, i, j, sum, *p;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    p = a;\n    if (m * n > 1) {\n      for (j = 0; j < m * n; j++) {\n        scanf(\"%d\", p);\n        p++;\n      }\n      for (p = a; p < a + n; p++) {\n        sum = sum + (*p);\n      }\n      for (p = a + n; p <= a + (m - 2) * n; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + 2 * n - 1; p <= a + (m - 1) * n - 1; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + (m - 1) * n; p <= a + m * n - 1; p++) {\n        sum = sum + (*p);\n      }\n\n      printf(\"%d\\n\", sum);\n    } else {\n      scanf(\"%d\", p);\n      cout << *p;\n    }\n  }\n}\n"}
{"label": "6", "index": "10056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++) {\n      sum1 = sum1 + a[0][j];\n      if ((m - 1) != 0)\n        sum2 = sum2 + a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum3 = sum3 + a[i][0];\n      if ((n - 1) != 0)\n        sum4 = sum4 + a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4);\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, h, i, j, a, b;\n  int s[100][100], r[100];\n  scanf(\"%d\", &k);\n  for (int t = 0; t <= k - 1; t++) {\n    h = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (a = 0; a <= n - 1; a++) {\n      h = h + s[0][a] + s[m - 1][a];\n    }\n    for (b = 1; b <= m - 2; b++) {\n      h = h + s[b][0] + s[b][n - 1];\n    }\n    r[t] = h;\n  }\n  for (int x = 0; x <= k - 1; x++) {\n    printf(\"%d\\n\", r[x]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint v[100][100];\n\nint sum(int m, int n) {\n\n  int su = 0;\n  if (n >= 2 && m >= 2) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n      su += v[m - 1][i];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      su += v[i][0];\n      su += v[i][n - 1];\n    }\n  } else if (n >= 2 && m == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n    }\n  } else if (m >= 2 && n == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[i][0];\n    }\n  } else {\n    su = v[0][0];\n  }\n  return su;\n}\n\nint main() {\n  int times;\n  scanf(\"%d \", &times);\n\n  for (int k = 0; k < times; k++) {\n    int a, b;\n    cin >> a >> b;\n\n    for (int i = 0; i < a; i++) {\n      for (int j = 0; j < b; j++)\n        cin >> v[i][j];\n    }\n\n    printf(\"%d\\n\", sum(a, b));\n  }\n}\n"}
{"label": "6", "index": "10059", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k, m, n, a[100][100], i, j, sum = 0;\nint main() {\n  cin >> k;\n  while (k > 0) {\n    k--;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 || m == 2 || n == 1 || n == 2) {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++)\n          sum += a[i][j];\n    } else {\n      for (j = 1; j <= n; j++)\n        sum += a[1][j];\n      for (j = 1; j <= n; j++)\n        sum += a[m][j];\n      for (i = 2; i < m; i++)\n        sum += a[i][1];\n      for (i = 2; i < m; i++)\n        sum += a[i][n];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k;\n\n  scanf(\"%d\", &k);\n  int i;\n  for (int h = 0; h < k; h++) {\n    int sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n\n    for (int j = 0; j < n; j++) {\n      sum += sz[0][j];\n      sum += sz[m - 1][j];\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n      sum += sz[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f() {\n  int a = 0, i, j, m, n, (*p)[100];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[100])malloc(m * 100 * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < n; j++)\n    a = a + *(*p + j) + *(*(p + m - 1) + j);\n  for (i = 1; i < m - 1; i++)\n    a = a + *(*(p + i)) + *(*(p + i) + n - 1);\n  printf(\"%d\\n\", a);\n}\nint main() {\n  int c, k;\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++)\n    f();\n  return 0;\n}\n"}
{"label": "6", "index": "10062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint init() {\n\n  int k, t, m, n, ans;\n  cin >> k;\n  while (k) {\n    k--;\n    ans = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> t;\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          ans += t;\n        }\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n\nint main() {\n  init();\n  return 0;\n}\n"}
{"label": "6", "index": "10063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, sz[100][100], m, n, p, i, j, s[100] = {0};\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n    if (m == 1 && n == 1) {\n      s[p] = sz[0][0];\n    } else {\n      for (j = 0; j < n; j++) {\n        s[p] = s[p] + sz[0][j] + sz[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        s[p] = s[p] + sz[i][0] + sz[i][n - 1];\n      }\n      s[p] = s[p] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n  }\n  for (p = 0; p < k; p++) {\n    printf(\"%d\\n\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10064", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], (*p)[100];\n  p = a;\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num = num + *(*(p + i) + j);\n      }\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << endl;\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(p + i) + j);\n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum = sum + *(*(p + i) + j);\n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100], i, j, sum, t;\n  scanf(\"%d\", &t);\n  while (t--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m > 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0] + a[i][n - 1];\n    else\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n > 1)\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i];\n    else\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10066", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a;\n  int sz[100][100], s;\n  s = 0;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          s = s + sz[i][j];\n    }\n\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b;\n  scanf(\"%d\", &k);\n  int s[k];\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d\", &sz[a][b]);\n    }\n    for (b = 0; b < n; b++) {\n      s[i] = s[i] + sz[0][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      s[i] = s[i] + sz[a][0];\n      s[i] = s[i] + sz[a][n - 1];\n    }\n    if (m != 1) {\n      for (b = 0; b < n; b++) {\n        s[i] = s[i] + sz[m - 1][b];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10069", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, n, i, col, row, sum[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    int sz[100][100];\n\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (col = 0; col < n - 1; col++)\n      sum[i] += sz[0][col];\n    for (row = 0; row < m - 1; row++)\n      sum[i] += sz[row][n - 1];\n    for (col = n - 1; col > 0; col--)\n      sum[i] += sz[m - 1][col];\n    for (row = m - 1; row > 0; row--)\n      sum[i] += sz[row][0];\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i;\n  int sz[100][100];\n  int row, col;\n  int add[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    add[i] = 0;\n  }\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", &sz[row][col]);\n    }\n\n    for (col = 0; col < n; col++) {\n      add[i] += sz[0][col];\n      add[i] += sz[m - 1][col];\n    }\n\n    for (row = 0; row < m; row++) {\n      add[i] += sz[row][0];\n      add[i] += sz[row][n - 1];\n    }\n\n    add[i] -= sz[0][0];\n    add[i] -= sz[m - 1][0];\n    add[i] -= sz[0][n - 1];\n    add[i] -= sz[m - 1][n - 1];\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", add[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[100][100], h, l, k, m, n, i, j, w, sum;\n  scanf(\"%d\", &k);\n\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    w = m;\n    h = n;\n    i = 0;\n    while (i < m) {\n      j = 0;\n      while (j < n) {\n        scanf(\"%d\", &s[i][j]);\n        j++;\n      }\n      i++;\n    }\n    sum = 0;\n    if (h > 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0] + s[i][h - 1];\n        i++;\n      }\n      j = 0;\n      while (j < h) {\n        sum += s[0][j] + s[w - 1][j];\n        j++;\n      }\n      sum = sum - s[0][0] - s[0][h - 1] - s[w - 1][0] - s[w - 1][h - 1];\n    }\n    if (h == 1 && w == 1) {\n      sum = s[0][0];\n    }\n    if (h == 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0];\n        i++;\n      }\n    }\n    if (h > 1 && w == 1) {\n      j = 0;\n      while (j < h) {\n        sum += s[0][j];\n        j++;\n      }\n    }\n    if (h == 0 || w == 0) {\n      sum = 0;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[100], n[100];\n  int a[100][10000];\n  int i, j, s, sum = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m[i] >> n[i];\n    s = m[i] * n[i];\n    for (j = 0; j < s; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0, sum = 0; j < m[i] * n[i]; j++) {\n      if (j < n[i])\n        sum = sum + a[i][j];\n      else if (j % n[i] == 0)\n        sum = sum + a[i][j];\n      else if ((j + 1) % n[i] == 0)\n        sum = sum + a[i][j];\n      else if (j > m[i] * n[i] - n[i] - 1)\n        sum = sum + a[i][j];\n      else\n        continue;\n    }\n    if (i == 0)\n      printf(\"%d\", sum);\n    else\n      printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, sum[100] = {0}, *p;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", p + i * n + j);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum[t] += *(p + i * n + j);\n      }\n    }\n  }\n  for (t = 0; t < k; t++)\n    cout << sum[t] << \"\\n\";\n}\n"}
{"label": "6", "index": "10074", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void juzhen();\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    juzhen();\n  }\n}\n\nvoid juzhen() {\n  int m, n, i = 0, j = 0, f = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    f = f + a[0][j] + a[m - 1][j];\n  }\n  for (i = 1; i < m - 1; i++)\n    f = f + a[i][0] + a[i][n - 1];\n\n  printf(\"%d\\n\", f);\n}\n"}
{"label": "6", "index": "10075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], m, n, k, i, j, sum, *p;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    p = a;\n    if (m * n > 1) {\n      for (j = 0; j < m * n; j++) {\n        scanf(\"%d\", p);\n        p++;\n      }\n      for (p = a; p < a + n; p++) {\n        sum = sum + (*p);\n      }\n      for (p = a + n; p <= a + (m - 2) * n; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + 2 * n - 1; p <= a + (m - 1) * n - 1; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + (m - 1) * n; p <= a + m * n - 1; p++) {\n        sum = sum + (*p);\n      }\n      printf(\"%d\\n\", sum);\n    } else {\n      scanf(\"%d\", p);\n      printf(\"%d\", *p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, c, d;\n  c = 0;\n  scanf(\"%d\", &k);\n  int sz[100][100];\n  int yi[100];\n  int er[100];\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    d = 0;\n    for (b = 0; b < n; b++)\n      d += sz[0][b];\n\n    yi[a] = d;\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[m - 1][b];\n    }\n    er[a] = d;\n    d = yi[a] + er[a];\n    for (b = 1; b <= (m - 2); b++)\n      d += sz[b][0];\n\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][n - 1];\n    }\n\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10077", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, n, x, y, u, v;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &x, &y);\n    for (u = 0; u < x; u++)\n      for (v = 0; v < y; v++)\n        cin >> a[u][v];\n    if (x <= 2 || y <= 2) {\n      for (u = 0; u < x; u++)\n        for (v = 0; v < y; v++)\n          sum += a[u][v];\n    } else {\n      for (u = 0; u < y; u++) {\n        sum += a[0][u];\n        sum += a[x - 1][u];\n      }\n      for (u = 1; u < x - 1; u++) {\n        sum += a[u][0];\n        sum += a[u][y - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b;\n  int i, j;\n  int sum;\n  int c[100][100];\n  cin >> n;\n  while (n > 0) {\n    cin >> a >> b;\n    sum = 0;\n\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        cin >> c[i][j];\n    }\n    int(*p)[100];\n    p = c;\n    for (i = 0; i < b; i++)\n      sum += *(*p + i);\n    for (j = 1; j < a - 1; j++) {\n      sum += *(*(p + j)) + *(*(p + j) + b - 1);\n    }\n    for (i = 0; i < b; i++)\n      sum += *(*(p + a - 1) + i);\n    cout << sum << \"\\n\";\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int b[100];\n  int m, j, r, n, k, p;\n\n  scanf(\"%d\", &p);\n  for (m = 0; m < p; m++) {\n    scanf(\"%d %d\", &n, &k);\n    for (j = 0; j < n; j++) {\n      for (r = 0; r < k; r++) {\n        scanf(\"%d\", &a[j][r]);\n      }\n    }\n    b[m] = 0;\n    for (j = 0; j < 1; j++) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (j = n - 1; j > n - 2; j--) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = 0; r < 1; r++) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = k - 1; r > k - 2; r--) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n  }\n  for (m = 0; m < p; m++) {\n    cout << b[m] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10080", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int M = 100 + 10;\nconst int N = 100 + 10;\nint mat[M][N];\nint main(void) {\n  int cases, i, j, ans, m, n;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    ans = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; ++i) {\n      for (j = 0; j < n; ++j) {\n        scanf(\"%d\", mat[i] + j);\n      }\n    }\n    if (m == 0 || n == 0) {\n      printf(\"%d\\n\", 0);\n      continue;\n    }\n    if (m == 1) {\n      for (i = 0; i < n; ++i) {\n        ans += mat[0][i];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    } else if (n == 1) {\n      for (i = 0; i < m; ++i) {\n        ans += mat[i][0];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    }\n\n    for (i = 0; i < n; ++i) {\n      ans += mat[0][i];\n      ans += mat[m - 1][i];\n    }\n    for (i = 0; i < m; ++i) {\n      ans += mat[i][0];\n      ans += mat[i][n - 1];\n    }\n    ans -= (mat[0][0] + mat[0][n - 1] + mat[m - 1][0] + mat[m - 1][n - 1]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, *p[100], i, *w[100], j, r, s = 0;\n  scanf(\"%d\\n\", &k);\n  for (j = 0; j < k; j++)\n    w[j] = (int *)malloc(2 * sizeof(int));\n  for (j = 0; j < k; j++) {\n    scanf(\"%d %d\\n\", w[j], w[j] + 1);\n    m = *(w[j]);\n    n = *(w[j] + 1);\n    for (r = 0; r < m; r++)\n      p[r] = (int *)malloc(100 * sizeof(int));\n    for (r = 0; r < m; r++)\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", p[r] + i);\n    for (r = 0, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (r = m - 1, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (i = 0, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    for (i = n - 1, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    cout << s << \"\\n\";\n    s = 0;\n    free(p[0]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, sum[100], p, q, t, l, m[100], n[100], h;\n  int a[100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\\n\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (h = 0; h < n[i]; h++) {\n        scanf(\"%d\", &a[j][h]);\n      }\n    }\n    for (p = 0; p < n[i]; p++) {\n      sum[i] = sum[i] + a[0][p];\n    }\n    for (q = 1; q < m[i]; q++) {\n      sum[i] = sum[i] + a[q][n[i] - 1];\n    }\n    for (l = n[i] - 2; l >= 0; l--) {\n      sum[i] = sum[i] + a[m[i] - 1][l];\n    }\n    for (t = m[i] - 2; t > 0; t--) {\n      sum[i] = sum[i] + a[t][0];\n    }\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10083", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a, m, n, i, j, k, b[100][100], sum = 0;\n  cin >> a; \n  for (k = 0; k < a; k++) {\n    sum = 0;\n    cin >> m >> n;\n    ;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> b[i][j];\n    for (i = 0; i < m; i++)\n      sum += *(*(b + i)) + *(*(b + i) + n - 1); \n    for (i = 1; i < n - 1; i++)\n      sum += *(*b + i) + *(*(b + m - 1) + i); \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10084", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a[100][100] = {0};\n  int x, y, i, j, k, n, sum = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;                 \n    memset(a, 0, sizeof(a)); \n    cin >> x >> y;\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        cin >> *(*(a + i) + j);\n      }\n\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        if (i == 0 || j == 0 || i == (x - 1) || j == (y - 1)) \n          sum += *(*(a + i) + j);\n      }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10085", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int k, m, n, i, j, a, sum = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        if (i == 0 || i == m - 1)\n          sum += sz[i][j];\n        if (i > 0 && i < m - 1 && (j == 0 || j == n - 1))\n          sum += sz[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], i, j, m, n, k;\n  int *pa;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m * n; j++)\n      scanf(\"%d\", &a[j - 1]);\n    pa = a;\n    if ((m >= 2) && (n >= 2)) {\n      for (j = 1; j < n; j++)\n        *pa += a[j];\n      for (j = m * n - n; j < m * n; j++)\n        *pa += a[j];\n      for (j = n; j < m * n - n; j++)\n        if ((j % n == 0) || (j % n == n - 1))\n          *pa += a[j];\n    } else {\n      for (j = 1; j < m * n; j++)\n        *pa += a[j];\n    }\n    printf(\"%d\\n\", *pa);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int line, row, sum;\n  int array[200][200];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> line >> row;\n    for (j = 0; j < line; j++)\n      for (k = 0; k < row; k++)\n        cin >> array[j][k];\n    sum = 0;\n    if (row == 1 || line == 1) {\n      for (j = 0; j < line; j++)\n        for (k = 0; k < row; k++)\n          sum = sum + array[j][k];\n      printf(\"%d\\n\", sum);\n    } else {\n      sum = 0 - array[0][0] - array[0][row - 1] - array[line - 1][0] -\n            array[line - 1][row - 1];\n      for (j = 0; j < line; j++)\n        sum = sum + array[j][0] + array[j][row - 1];\n      for (j = 0; j < row; j++)\n        sum = sum + array[0][j] + array[line - 1][j];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10088", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n  if (m != 1)\n    for (k = n - 2; k >= 0; k--) {\n\n      s += a[m - 1][k];\n    }\n  if (n != 1)\n    for (i = m - 2; i > 0; i--) {\n      s += a[i][0];\n    }\n  printf(\"%d\\n\", s);\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10089", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m[100], n[100], i, j, a, k, sz[100][100], sum[100] = {0};\n  cin >> k;\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m[a], &n[a]);\n    for (i = 0; i < m[a]; i++) {\n      for (j = 0; j < n[a]; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    if (m[a] != 1 && n[a] != 1) {\n      for (j = 0; j < n[a]; j++) {\n        sum[a] += sz[0][j];\n        sum[a] += sz[m[a] - 1][j];\n      }\n      for (i = 1; i < m[a] - 1; i++) {\n        sum[a] += sz[i][0];\n        sum[a] += sz[i][n[a] - 1];\n      }\n    } else {\n      for (i = 0; i < m[a]; i++) {\n        for (j = 0; j < n[a]; j++) {\n          sum[a] += sz[i][j];\n        }\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    cout << sum[a] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "10090", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int i, j, l, lin, col, sum = 0;\n  int num[101][101];\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d \", &lin, &col);\n    for (i = 1; i <= lin; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> num[i][j];\n    }\n\n    if (lin >= 2 && col >= 2) {\n      for (i = 2; i <= lin - 1; i++)\n        sum = sum + num[i][1] + num[i][col];\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j] + num[lin][j];\n    }\n    if (lin == 1 && col >= 2) {\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j];\n    }\n    if (col == 1 && lin >= 2) {\n      for (i = 1; i <= lin; i++)\n        sum = sum + num[i][1];\n    }\n    if (col == 1 && lin == 1)\n      sum = sum + num[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, t, s = 0;\n  scanf(\"%d\", &k);\n  int a[100][100], b[k - 1];\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        } else if (j == 0 || j == n - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    b[t] = s;\n    s = 0;\n  }\n  for (t = 0; t < k; t++) {\n    printf(\"%d\\n\", b[t]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10092", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int k;\n  scanf(\"%d\", &k);\n  int s1 = 0, s2 = 0, s3 = 0, s4 = 0, s = 0;\n  int r = 0, c = 0;\n\n  int jz[100][100];\n  int m, n;\n  int i = 1;\n  while (i <= k) {\n    cin >> m >> n;\n    for (int jm = 0; jm < m; jm++) {\n      for (int jn = 0; jn < n; jn++) {\n        scanf(\"%d\", &jz[jm][jn]);\n      }\n    }\n    r = 0;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s1 += jz[r][c];\n    }\n    r = m - 1;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s2 += jz[r][c];\n    }\n    r = 0;\n    c = 0;\n    for (r = 0; r < m; r++) {\n      s3 += jz[r][c];\n    }\n    r = 0;\n    c = n - 1;\n    for (r = 0; r < m; r++) {\n      s4 += jz[r][c];\n    }\n    s = s1 + s2 + s3 + s4 - jz[0][0] - jz[0][n - 1] - jz[m - 1][0] -\n        jz[m - 1][n - 1];\n    printf(\"%d\", s);\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n\n    if (i != k) {\n      printf(\"\\n\");\n    }\n\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, ans = 0;\n  int m[100], n[100];\n  int r[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (p = 0; p < n[i]; p++)\n        scanf(\"%d\", &r[i][j][p]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    ans = 0;\n    for (i = 0; i < n[p]; i++) {\n      for (j = 0; j < m[p]; j++) {\n        if ((i == 0) || (i == n[p] - 1) || (j == 0) || (j == m[p] - 1))\n          ans += r[p][j][i];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[110][110];\n  int num, sum = 0;\n  int k, m, n, i, j, l;\n\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num;\n        a[i][j] = num;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum = sum + a[0][i];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][n - 1];\n    }\n    for (i = 1; i < m; i++)\n      sum = sum + a[i][0];\n\n    for (i = 1; i < n - 1; i++) {\n      sum = sum + a[m - 1][i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int row;\n    int col;\n    int total = 0;\n    int s[100][100];\n    scanf(\"%d%d\", &row, &col);\n    int x, y;\n    for (x = 0; x < row; x++) {\n      for (y = 0; y < col; y++) {\n        scanf(\"%d\", &s[x][y]);\n      }\n    }\n    if (row < 3 || col < 3) {\n      for (x = 0; x < row; x++) {\n        for (y = 0; y < col; y++) {\n          total += s[x][y];\n        }\n      }\n      printf(\"%d\\n\", total);\n    } else {\n      for (y = 0; y < col; y++) {\n        total += s[0][y];\n      }\n      for (y = 0; y < col; y++) {\n        total += s[row - 1][y];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][0];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][col - 1];\n      }\n      total =\n          total - s[0][0] - s[0][col - 1] - s[row - 1][0] - s[row - 1][col - 1];\n      cout << total << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10096", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, col[1000], row[1000], a[100][1000][1000], c, r, sum[1000];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    cin >> col[i];\n    cin >> row[i];\n\n    for (c = 0; c < col[i]; c++) {\n      for (r = 0; r < row[i]; r++) {\n        cin >> a[i][c][r];\n      }\n    }\n\n    for (c = 0; c < row[i]; c++)\n      sum[i] = sum[i] + a[i][0][c] + a[i][col[i] - 1][c];\n    for (c = 1; c < col[i] - 1; c++)\n      sum[i] = sum[i] + a[i][c][0] + a[i][c][row[i] - 1];\n\n    cout << sum[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10097", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int res = 0;\n    cin >> p >> q;\n    for (int i = 0; i < p; i++)\n      for (int j = 0; j < q; j++) {\n        cin >> tmp;\n        if (i == 0 || j == 0 | i == p - 1 || j == q - 1) {\n          res += tmp;\n        }\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, h1, l1, k, h, l, a[100][100], sum[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (h1 = 1; h1 <= h; h1++)\n      for (l1 = 1; l1 <= l; l1++)\n        scanf(\"%d\", &a[h1][l1]);\n\n    for (h1 = 1; h1 <= h; h1++)\n      sum[i] += a[h1][1] + a[h1][l];\n    for (l1 = 2; l1 <= l - 1; l1++)\n      sum[i] += a[1][l1] + a[h][l1];\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum = 0;\n  cin >> k;\n  int a[100][100];\n  for (int i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m != 1 && n != 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i) + *(*(a + m - 1) + i);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      cout << sum << endl;\n    } else\n      cout << **a << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100];\n  for (int r = 0; r < k; r++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    int s = 0;\n    for (int t = 0; t < n; t++) {\n      s += a[0][t] + a[m - 1][t];\n    }\n    for (int u = 1; u < m - 1; u++) {\n      s += a[u][0] + a[u][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b;\n  int i, j;\n  int sum;\n  int c[100][100];\n  cin >> n;\n  while (n > 0) {\n    cin >> a >> b;\n    sum = 0;\n\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        cin >> c[i][j];\n    }\n    int(*p)[100];\n    p = c;\n    for (i = 0; i < b; i++)\n      sum += *(*p + i);\n    for (j = 1; j < a - 1; j++) {\n      sum += *(*(p + j)) + *(*(p + j) + b - 1);\n    }\n    for (i = 0; i < b; i++)\n      sum += *(*(p + a - 1) + i);\n    printf(\"%d\\n\", sum);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, *q, (*p)[100], h = 0, i, j, l, t;\n  p = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  q = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(p + j) + l);\n      }\n    }\n    for (t = 0; t < n; t++) {\n      *(q + i) = *(q + i) + *(*p + t) + *(*(p + m - 1) + t);\n    }\n    for (t = 0; t < m; t++) {\n      *(q + i) = *(q + i) + **(p + t) + *(*(p + t) + n - 1);\n    }\n    *(q + i) = *(q + i) - **p - *(*p + n - 1) - *(*(p + m - 1)) -\n               *(*(p + m - 1) + n - 1);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", *(q + i));\n  }\n}\n"}
{"label": "6", "index": "10103", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, a[100][100], s, q[100], h1, h2, t, l1, l2, c;\n  scanf(\"%d\", &k);\n  for (i = 1, t = 0; i <= k, t < k; i++, t++) {\n    h1 = 0, h2 = 0, t, l1 = 0, l2 = 0;\n    cin >> m >> n;\n\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &a[0][0]);\n      q[t] = a[0][0];\n    }\n\n    if (m == 1 && n > 1) {\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", &a[0][i]);\n\n      for (c = 0, i = 0; i < n; i++)\n        c = c + a[0][i];\n      q[t] = c;\n    }\n\n    if (n > 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      }\n      for (j = 0; j < n; j++) {\n        h1 = h1 + a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        h2 = h2 + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++)\n        l1 = l1 + a[i][0];\n\n      for (i = 1; i < m - 1; i++) {\n        l2 = l2 + a[i][n - 1];\n      }\n      q[t] = h1 + h2 + l1 + l2;\n    }\n\n    if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++)\n        scanf(\"%d\", &a[i][0]);\n\n      for (c = 0, i = 0; i < m; i++)\n        c = c + a[i][0];\n      q[t] = c;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10104", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m[100], n[100], i, j, a, k, sz[100][100], sum[100] = {0};\n  cin >> k;\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m[a], &n[a]);\n    for (i = 0; i < m[a]; i++) {\n      for (j = 0; j < n[a]; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    if (m[a] != 1 && n[a] != 1) {\n      for (j = 0; j < n[a]; j++) {\n        sum[a] += sz[0][j];\n        sum[a] += sz[m[a] - 1][j];\n      }\n      for (i = 1; i < m[a] - 1; i++) {\n        sum[a] += sz[i][0];\n        sum[a] += sz[i][n[a] - 1];\n      }\n    } else {\n      for (i = 0; i < m[a]; i++) {\n        for (j = 0; j < n[a]; j++) {\n          sum[a] += sz[i][j];\n        }\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%d\\n\", sum[a]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid juzhen(int m, int n) {\n  int a[100][100];\n  int i, j, sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + *(*(a) + j) + *(*(a + m - 1) + j);\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + *(*(a + i) + 0) + *(*(a + i) + n - 1);\n  }\n  if (m == 1) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      sum = sum + *(*a + i);\n  }\n  if (n == 1) {\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      sum = sum + *(*(a + i) + 0);\n    }\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  int k, i, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    juzhen(m, n);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum;\n  int *p;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = a[0]; p < a[0] + n; p++)\n      sum += *p;\n    for (p = p + 99; p < a[0] + (m - 1) * 100 + n; p = p + 100)\n      sum += *p;\n    for (p = p - 101; p > a[0] + (m - 1) * 100 - 1; p--)\n      sum += *p;\n    for (p = p - 99; p > a[0]; p = p - 100)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[500], i, j, x, k, a[100][100][100], b[500][2];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n[i] = 0;\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    for (j = 0; j < b[i][0]; j++) {\n      for (x = 0; x < b[i][1]; x++) {\n        scanf(\"%d\", &a[i][j][x]);\n        if (j == 0 || x == 0 || j == b[i][0] - 1 || x == b[i][1] - 1)\n          n[i] += a[i][j][x];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << n[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, k, j, l, a, i;\n  cin >> k;\n  int aa[k + 1];\n  for (i = 1; i <= k; i++) {\n    aa[i] = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a;\n        if (j == 1 || j == m || l == 1 || l == n)\n          aa[i] = aa[i] + a;\n      }\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << aa[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int *p, int m, int n) {\n  int row, col, temp, sum = 0;\n  for (row = 1; row < m + 1; row++) {\n    for (col = 1; col < n + 1; col++) {\n      if (row == 1 || row == m || col == 1 || col == n) {\n        temp = *(p + n * (row - 1) + col);\n        sum += temp;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, m, n, i, s, row, col;\n  int *p;\n  p = (int *)malloc(sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (row = 1; row < m + 1; row++) {\n      for (col = 1; col < n + 1; col++) {\n        scanf(\"%d\", p + n * (row - 1) + col);\n      }\n    }\n    s = f(p, m, n);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int i, j, t;\n  int sum;\n  int z;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &z);\n        if (i == 0 || i == m - 1)\n          sum += z;\n        else {\n          if (j == 0 || j == n - 1)\n            sum += z;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num, n, m, a[100][100];\nint main() {\n  cin >> num;\n  for (int x = 0; x < num; x++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int i = 0; i < m; i++)\n      ans += a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      ans += a[0][i] + a[m - 1][i];\n    cout << ans << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "10112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, x = 0, y = 0, temp = 0, sum = 0, i, j, m;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d\", &x);\n    scanf(\"%d\", &y);\n    for (j = 0; j < x; j++) {\n      for (m = 0; m < y; m++) {\n        scanf(\"%d\", &temp);\n        if (j == 0 || m == 0 || j == x - 1 || m == y - 1) {\n          sum = sum + temp;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    int add = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (l = 0; l < n; l++)\n      add += (a[0][l] + a[m - 1][l]);\n    for (l = 1; l < m - 1; l++)\n      add += (a[l][0] + a[l][n - 1]);\n    printf(\"%d \", add);\n    for (j = 0; j < 100; j++) {\n      for (l = 0; l < 100; l++)\n        a[j][l] = 0;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "10114", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n[1000], m[1000], a, b, c, s[100][100], x[1000];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    cin >> m[a] >> n[a];\n    for (b = 0; b < m[a]; b++) {\n      for (c = 0; c < n[a]; c++) {\n        scanf(\"%d\", &s[b][c]);\n      }\n    }\n    x[a] = 0;\n    for (c = 0; c < n[a]; c++) {\n      if (m[a] > 1)\n        x[a] = x[a] + s[0][c] + s[m[a] - 1][c];\n      else {\n        x[a] = x[a] + s[0][c];\n      }\n    }\n    if (m[a] > 2) {\n      if (n[a] > 1) {\n        for (b = 1; b < m[a] - 1; b++) {\n          x[a] = x[a] + s[b][0] + s[b][n[a] - 1];\n        }\n      } else {\n        x[a] = x[a] + s[b][0];\n      }\n    }\n    printf(\"%d\\n\", x[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, sum, a[10001], *p;\n  scanf(\"%d\", &i);\n  while (i--) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = a; p < a + m * n; p++)\n      scanf(\"%d\", p);\n    sum = 0;\n    for (p = a; p < a + n; p++) {\n      sum += *p;\n    }\n    if (m != 1)\n      for (p = a + (m - 1) * n; p < a + m * n; p++)\n        sum += *p;\n    for (p = a + n; p < a + (m - 1) * n; p += n)\n      sum += *p;\n    for (p = a + n * 2 - 1; p < a + m * n - 1; p += n)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][2], b[100][100], c[100] = {0}, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++) {\n      for (k = 0; k < a[i][1]; k++) {\n        scanf(\"%d\", &b[j][k]);\n      }\n    }\n    for (j = 0; j < a[i][1]; j++)\n      c[i] = c[i] + b[0][j];\n    for (j = 0; j < a[i][1] && a[i][0] != 1; j++)\n      c[i] += b[a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      c[i] = c[i] + b[j][0];\n    for (j = 1; j < a[i][0] - 1 && a[i][1] != 1; j++)\n      c[i] += b[j][a[i][1] - 1];\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        b[j][k] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, number[100][100], num, *p = NULL;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> number[j][l];\n    }\n    num = 0;\n    p = *number;\n    for (j = 0; j < n; j++) {\n      if (m == 1) {\n        num += *(p + j);\n      } else {\n        num = num + *(p + j) + *(*(number + m - 1) + j);\n      }\n    }\n    p = *number;\n    for (j = 1; j < m - 1; j++) {\n      if (n == 1) {\n        num += **(number + j);\n      } else {\n        num = num + **(number + j) + *(*(number + j) + n - 1);\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  int m, n, j, l;\n  int z[100][100], h[100];\n  for (i = 0; i < 100; i++) {\n    h[i] = 0;\n  }\n  for (l = 0; l < k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(z[i][j]));\n      }\n    }\n    for (j = 0; j < n; j++) {\n      h[l] += z[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      h[l] += z[i][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][j];\n    }\n  }\n  for (l = 0; l < k; l++) {\n    if (l == 0) {\n      printf(\"%d\", h[l]);\n    } else {\n      printf(\"\\n%d\", h[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10119", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, row, col, j, k, sum;\n  cin >> n;\n  cin.get();\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    row = 0;\n    col = 0;\n    int a[103][103] = {0};\n    cin >> row >> col;\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        cin >> *(*(a + j) + k);\n    if ((row == 1) && (col == 1))\n      cout << **a << endl;\n    else {\n      for (k = 0; k < col; k++)\n        sum = sum + *(*a + k);\n      for (k = 0; k < col; k++)\n        sum = sum + *(*(a + row - 1) + k);\n      for (j = 0; j < row; j++)\n        sum = sum + **(a + j);\n      for (j = 0; j < row; j++)\n        sum = sum + *(*(a + j) + col - 1);\n      sum = sum - **a;\n      sum = sum - *(*(a + row - 1));\n      sum = sum - *(*a + col - 1);\n      sum = sum - *(*(a + row - 1) + col - 1);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, h, i, j;\n  scanf(\"%d\", &a);\n  int sum[100][3];\n  int n, k;\n  for (h = 1; h <= a; h++) {\n    scanf(\"%d%d\", &n, &k);\n    int sz[100][100];\n    sum[h][1] = 0;\n    sum[h][2] = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= k; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        sum[h][1] = sum[h][1] + sz[i][j];\n      }\n    }\n    if (n > 1 && k > 1) {\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < k; j++)\n          sum[h][2] = sum[h][2] + sz[i][j];\n      }\n    }\n    sum[h][3] = sum[h][1] - sum[h][2];\n  }\n  for (i = 1; i <= a; i++)\n    printf(\"%d\\n\", sum[i][3]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10121", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, l;\n  int m, n, i, j, s1, s2, s3, s4, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc((sizeof(int) * k));\n  for (l = 0; l < k; l++) {\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s1 += sz[i][0];\n      s2 += sz[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      s3 += sz[0][j];\n      s4 += sz[m - 1][j];\n    }\n    s += s1 + s2 + s3 + s4 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n         sz[m - 1][n - 1];\n    sf[l] = s;\n  }\n  for (l = 0; l < k; l++) {\n    printf(\"%d\\n\", sf[l]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10122", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, l, j;\n  int sz[1000][1000];\n  int jh[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    jh[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    for (k = 0; k < l; k++) {\n      jh[i] += sz[0][k];\n      jh[i] += sz[h - 1][k];\n    }\n    for (j = 1; j < h - 1; j++) {\n      jh[i] += sz[j][0];\n      jh[i] += sz[j][l - 1];\n    }\n    if (h == 1 && l == 1) {\n      jh[i] -= sz[0][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", jh[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ac[100][100], i, j, k, *p, n, a, b, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> ac[j][k];\n    for (j = 0; j < a; j++) {\n      if (j == 0 || j == a - 1)\n        for (p = ac[j]; p < ac[j] + b; p++)\n          s += *p;\n      else {\n        p = ac[j];\n        s = s + *p + *(p + b - 1);\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10124", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p = {NULL}, a[100][100], z, m, n, i = 1, j = 0, s;\n  cin >> z;\n  while (i <= z) {\n    s = 0;\n    scanf(\"%d %d \", &m, &n);\n    p = *a;\n    for (j = 0; j < m * n; j++) {\n      cin >> *p++;\n      if (j < n || j >= n * (m - 1) || j % n == 0 || (j + 1) % n == 0)\n        s += *(p - 1);\n    }\n    cout << s << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10125", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, a[100][100], i, j;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < m; i++)\n      sum = sum + **(p + i) + *(*(p + i) + n - 1);\n    for (j = 0; j < n; j++) {\n      sum = sum + *(*p + j) + *(*(p + m - 1) + j);\n    }\n    sum = sum - **p - *(*p + n - 1) - **(p + m - 1) - *(*(p + m - 1) + n - 1);\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, k, b[100][100], sum = 0;\n  cin >> a;\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    cin >> m >> n;\n    ;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> b[i][j];\n    for (i = 0; i < m; i++)\n      sum += *(*(b + i)) + *(*(b + i) + n - 1);\n    for (i = 1; i < n - 1; i++)\n      sum += *(*b + i) + *(*(b + m - 1) + i);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, l, sum[100] = {0};\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[m][j];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][1];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][n];\n    sum[l] = sum[l] - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum[l]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    int a[100][100], m, n;\n    int *p;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      p = &a[0][i];\n      sum += *p;\n    }\n    if (m != 1)\n      for (i = 0; i < n; i++) {\n        p = &a[m - 1][i];\n        sum += *p;\n      }\n    for (i = 1; i < m - 1; i++) {\n      p = a[i];\n      sum += *p;\n    }\n    for (i = 1; i < m - 1; i++) {\n      p = &a[i][n - 1];\n      sum += *p;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int(*p)[100];\n    p = a;\n    int sum = 0;\n    cin >> m >> n;\n\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (int l = 0; l < n; l++) {\n        sum += *(*p + l) + *(*(p + m - 1) + l);\n      }\n      for (int j = 1; j < m - 1; j++) {\n        sum += *(*(p + j)) + *(*(p + j) + n - 1);\n      }\n      cout << sum << endl;\n    } else {\n      cout << **p << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum[100], jz[100][100], h, l, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &jz[j][k]);\n      }\n    }\n    for (p = 0; p < l - 1; p++) {\n      sum[i] = sum[i] + jz[0][p];\n    }\n    for (q = 0; q < h - 1; q++) {\n      sum[i] = sum[i] + jz[q][l - 1];\n    }\n    for (p = l - 1; p > 0; p--) {\n      sum[i] = sum[i] + jz[h - 1][p];\n    }\n    for (q = h - 1; q > 0; q--) {\n      sum[i] = sum[i] + jz[q][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calcSum(int *matrix, int row, int col);\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *result = (int *)malloc(k * sizeof(int));\n  int i = 0;\n  int row, col;\n  int sum;\n  int m, n;\n  int *matrix;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    matrix = (int *)malloc(m * n * sizeof(int));\n    for (row = 0; row < m; row++)\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", matrix + row * n + col);\n    *(result + i) = calcSum(matrix, m, n);\n    free(matrix);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d\\n\", *(result + i));\n  }\n  printf(\"%d\", *(result + i));\n  return 0;\n}\n\nint calcSum(int *matrix, int row, int col) {\n  int sum = 0;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      if (i == 0 || i == row - 1 || j == 0 || j == col - 1)\n        sum += *(matrix + i * col + j);\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "10132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int(*juzhen)[101] = NULL; \n  int i, j, m, num, hang, lie, input[101][101];\n  cin >> num; \n  for (m = 0; m < num; m++) {\n    cin >> hang >> lie; \n    int sum = 0;        \n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> input[i][j];\n    juzhen = input;\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if ((i == 0) || (i == hang - 1) || (j == 0) || (j == lie - 1)) \n          sum = sum + *(*(juzhen + i) + j);                            \n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint mat[1000][1000];\nint main() {\n\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &mat[i][j]);\n    for (int j = 0; j < n; j++) {\n      if (m > 1)\n        sum += mat[m - 1][j];\n      sum += mat[0][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      if (n > 1)\n        sum += mat[i][n - 1];\n      sum += mat[i][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, ha, li, x, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    cin >> ha >> li;\n    for (l = 0; l < ha; l++) {\n      for (k = 0; k < li; k++) {\n        scanf(\"%d\", &x);\n        if (l == 0 || l == (ha - 1) || (k == 0 && l != 0 && l != (ha - 1)) ||\n            (k == (li - 1) && l != 0 && l != (ha - 1))) {\n          s = s + x;\n        }\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      int k;\n      cin >> k;\n      cout << k;\n    } else {\n      for (int i = 0; i < m; i++)\n        for (int j = 0; j < n; j++)\n          cin >> a[i][j];\n      int sum = 0;\n      for (int j = 0; j < n; j++)\n        sum += *(*(a) + j) + *(*(a + m - 1) + j);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, row = 0, line = 0, l = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  int a = 0, b = 0, c = 0, d = 0;\n  int total = 0, extra = 0;\n  scanf(\"%d\", &n);\n  while (l < n) {\n    scanf(\"%d %d\", &row, &line);\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < line; j++)\n        scanf(\"%d\", &Matrix[i][j]);\n    if (row == 1 || line == 1)\n      for (int i = 0; i < row; i++)\n        for (int j = 0; j < line; j++)\n          total += Matrix[i][j];\n    else {\n      extra = Matrix[0][0] + Matrix[0][line - 1] + Matrix[row - 1][0] +\n              Matrix[row - 1][line - 1];\n      for (int i = 0; i < line; i++) {\n        a += Matrix[0][i];\n        c += Matrix[row - 1][i];\n      }\n      for (int i = 0; i < row; i++) {\n        b += Matrix[i][0];\n        d += Matrix[i][line - 1];\n      }\n      total = a + b + c + d - extra;\n    }\n    cout << total << \"\\n\";\n    l++;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10137", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100];\n  int k, m, n, i, j, t;\n\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[t] = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum[t] += a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum[t] += a[0][j] + a[m - 1][j];\n    }\n    sum[t] -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n  }\n\n  for (t = 0; t < k; t++) {\n    if (t != k - 1) {\n      printf(\"%d\\n\", sum[t]);\n    } else {\n      printf(\"%d\", sum[t]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, row = 0, line = 0, l = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  int a = 0, b = 0, c = 0, d = 0;\n  int total = 0, extra = 0;\n  cin >> n;\n  while (l < n) {\n    scanf(\"%d %d\", &row, &line);\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < line; j++)\n        scanf(\"%d\", &Matrix[i][j]);\n    if (row == 1 || line == 1)\n      for (int i = 0; i < row; i++)\n        for (int j = 0; j < line; j++)\n          total += Matrix[i][j];\n    else {\n      extra = Matrix[0][0] + Matrix[0][line - 1] + Matrix[row - 1][0] +\n              Matrix[row - 1][line - 1];\n      for (int i = 0; i < line; i++) {\n        a += Matrix[0][i];\n        c += Matrix[row - 1][i];\n      }\n      for (int i = 0; i < row; i++) {\n        b += Matrix[i][0];\n        d += Matrix[i][line - 1];\n      }\n      total = a + b + c + d - extra;\n    }\n    cout << total << \"\\n\";\n    l++;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10139", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n = 0;\n  int x = 0, y = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    cin >> y;\n    for (int j = 0; j < x; j++)\n      for (int k = 0; k < y; k++) {\n        cin >> a[j][k];\n      }\n    int *p;\n    int sum = 0;\n    for (int j = 1; j < x - 1; j++) {\n      p = a[j];\n      sum = *p + *(p + y - 1) + sum;\n    }\n    p = a[0];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    p = a[x - 1];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, s, a[100][100], j, l, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((n > 1) && (m > 1)) {\n      for (i = 0; i < n; i++) {\n        s += a[0][i];\n        s += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        s += a[i][0];\n        s += a[i][n - 1];\n      }\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, j, r;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int b = 0, c = 0, d = 0, e = 0, sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &a[j][r]);\n      }\n    }\n    for (j = 0; j < m; j++) {\n      b += a[j][0];\n      d += a[j][n - 1];\n    }\n    for (r = 1; r < n - 1; r++) {\n      c += a[m - 1][r];\n      e += a[0][r];\n    }\n    sum = b + c + d + e;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int k, m[100], n[100], i, j, t, s[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (t = 0; t < n[i]; t++)\n        cin >> a[i][j][t];\n    for (t = 0; t < n[i]; t++)\n      s[i] += (a[i][0][t] + a[i][m[i] - 1][t]);\n    for (j = 0; j < m[i]; j++)\n      s[i] += (a[i][j][0] + a[i][j][n[i] - 1]);\n    s[i] = s[i] - a[i][0][0] - a[i][0][n[i] - 1] - a[i][m[i] - 1][0] -\n           a[i][m[i] - 1][n[i] - 1];\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "10143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, z, sum, temp;\n  int a[101][101];\n  int(*p)[101] = a;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (z = 0; z < n; z++)\n        cin >> *(*(p + j) + z);\n    if (m != 1 && n != 1) {\n      for (temp = 0; temp < n; temp++)\n        sum += (*(*(p) + temp) + *(*(p + m - 1) + temp));\n      for (temp = 0; temp < m; temp++) {\n        sum += (*(*(p + temp)) + *(*(p + temp) + n - 1));\n      }\n      sum -=\n          *(*(p)) + *(*(p) + n - 1) + *(*(p + m - 1)) + *(*(p + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n    } else\n      cout << *(*(p)) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10144", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int a[m][n];\n    s = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        cin >> (a[j][l]);\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < n; j++) {\n        s += a[0][j];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += a[j][0];\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        s = s + a[0][j] + a[m - 1][j];\n      }\n      for (j = 0; j < m; j++) {\n        s = s + a[j][0] + a[j][n - 1];\n      }\n      s = s - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[100][2], i, j, k, a[100][100] = {0}, *p = NULL, sum = 0, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> num[k][0] >> num[k][1];\n    sum = 0;\n    for (i = 0; i < num[k][0]; i++) {\n      for (j = 0; j < num[k][1]; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (m = 0; m < num[k][0]; m++) {\n      if (m == 0 || m == num[k][0] - 1) {\n        for (p = a[m]; p < a[m] + num[k][1]; p++)\n          sum = sum + *p;\n      } else\n        sum = sum + a[m][0] + a[m][num[k][1] - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  while (num--) {\n    int a[100][100];\n    int m, n;\n    scanf(\"%d %d \", &m, &n);\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, s[100][100], n[100], m[100], num[100];\n  int num1[100] = {0};\n  int num2[100] = {0};\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n[i], &m[i]);\n    for (j = 0; j < n[i]; j++) {\n      for (l = 0; l < m[i]; l++) {\n        scanf(\"%d\", &s[j][l]);\n        num1[i] += s[j][l];\n      }\n    }\n    for (j = 1; j < n[i] - 1; j++) {\n      for (l = 1; l < m[i] - 1; l++) {\n        num2[i] += s[j][l];\n      }\n    }\n    num[i] = num1[i] - num2[i];\n  }\n  for (i = 0; i < k; i++) {\n    cout << num[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, l, ha, li, x, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    scanf(\"%d %d\", &ha, &li);\n    for (l = 0; l < ha; l++) {\n      for (k = 0; k < li; k++) {\n        scanf(\"%d\", &x);\n        if (l == 0 || l == (ha - 1) || (k == 0 && l != 0 && l != (ha - 1)) ||\n            (k == (li - 1) && l != 0 && l != (ha - 1))) {\n          s = s + x;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, sum = 0;\n  int shuzu[1000][1000];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int s = 0; s < m; s++) {\n      for (int t = 0; t < n; t++) {\n        scanf(\"%d\", &(shuzu[s][t]));\n      }\n    }\n    if (m > 2 && n > 2) {\n      for (int x = 0; x < m; x++)\n        sum += shuzu[x][0] + shuzu[x][n - 1];\n\n      for (int y = 1; y < n - 1; y++) {\n        sum += shuzu[0][y] + shuzu[m - 1][y];\n      }\n    } else {\n      for (int z = 0; z < m; z++) {\n        for (int h = 0; h < n; h++) {\n          sum += shuzu[z][h];\n        }\n      }\n    }\n    cout << sum << \" \";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10150", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[100][100];\nint m, n;\nvoid count() {\n  int i, j;\n  int sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + j == j || i + j == i || i + j == i + n - 1 ||\n          i + j == j + m - 1) {\n        sum = sum + map_1[i][j];\n      }\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int sum;\n  int k = 0;\n  cin >> sum;\n  int i, j;\n  for (k = 0; k < sum; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &map_1[i][j]);\n      }\n    }\n    count();\n  }\n}\n"}
{"label": "6", "index": "10151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, j, a, b, s[100] = {0}, f[100][100];\n  int *p = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> f[j][k];\n    for (j = 0; j < a; j++) {\n      p = f[j];\n      s[i] += *p;\n      p = f[j] + b - 1;\n      s[i] += *p;\n    }\n    for (k = 1; k < b - 1; k++) {\n      p = f[0] + k;\n      s[i] += *p;\n      p = f[a - 1] + k;\n      s[i] += *p;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", s[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, j, l, a[100][100][100], len[100], cro[100], b[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &len[i], &cro[i]);\n    for (j = 0; j < len[i]; j++) {\n      for (l = 0; l < cro[i]; l++)\n        scanf(\"%d\", &a[i][j][l]);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < cro[i]; j++) {\n      b[i] += a[i][0][j];\n    }\n    for (j = 1; j < len[i]; j++) {\n      b[i] += a[i][j][(cro[i] - 1)];\n    }\n    for (j = 0; j < cro[i] - 1; j++) {\n      b[i] += a[i][len[i] - 1][j];\n    }\n    for (j = 1; j < len[i] - 1; j++) {\n      b[i] += a[i][j][0];\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int x, i, j, k, s = 0;\n  int m, n, a[100][100];\n  cin >> x;\n  for (i = 1; i <= x; i++) \n  {\n    cin >> m >> n;               \n    for (j = 0; j <= m - 1; j++) \n    {\n      for (k = 0; k <= n - 1; k++) \n      {\n        cin >> a[j][k]; \n        if (j == 0 || j == m - 1 || (k == 0 && j != 0 && j != m - 1) ||\n            (k == n - 1 && j != 0 && j != m - 1)) \n          s = s + a[j][k];                        \n      }\n    }\n    cout << s << endl; \n    s = 0;             \n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++)\n    s += *(*(p + 1) + i);\n  for (i = 2; i <= m; i++)\n    s += *(*(p + i) + n);\n  for (i = n - 1; i >= 1; i--)\n    s += *(*(p + m) + i);\n  for (i = m - 1; i > 1; i--)\n    s += *(*(p + i) + 1);\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  scanf(\"%d \", &k);\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    printf(\"%d\\n\", juzhen(m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, p, q;\n  int N[100][100];\n  int m, n;\n  int sum = 0;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 1; p <= m; p++) {\n      for (q = 1; q <= n; q++) {\n        scanf(\"%d\", &N[p][q]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[1][j];\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][1];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][n];\n    }\n    sum = sum - N[1][1] - N[1][n] - N[m][1] - N[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, s[100][100], n[100], m[100], num[100];\n  int num1[100] = {0};\n  int num2[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n[i], &m[i]);\n    for (j = 0; j < n[i]; j++) {\n      for (l = 0; l < m[i]; l++) {\n        scanf(\"%d\", &s[j][l]);\n        num1[i] += s[j][l];\n      }\n    }\n    for (j = 1; j < n[i] - 1; j++) {\n      for (l = 1; l < m[i] - 1; l++) {\n        num2[i] += s[j][l];\n      }\n    }\n    num[i] = num1[i] - num2[i];\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", num[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10157", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint haha() {\n  int m, n, sum, i, j, a[105][105];\n  cin >> m >> n;\n\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &*(*(a + i) + j));\n\n  sum = 0;\n\n  if (m == 1)\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n  else if (n == 1)\n    for (i = 1; i <= m; i++)\n      sum = sum + *(*(a + i) + 1);\n  else {\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + m) + j);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + 1);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + n);\n  }\n\n  return (sum);\n}\nint main() {\n\n  int i, j, k, l, m, n, a[1050];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    *(a + i) = haha();\n\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", *(a + i));\n}\n"}
{"label": "6", "index": "10158", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid function_1() {\n  int a[110][110], (*p)[110];\n  int n, m, i, sum = 0, j;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  p = a;\n  for (i = 0; i < m; i++) {\n    sum += *(*p + i);\n    if (n > 1)\n      sum += *(*(p + n - 1) + i);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum += **(p + i);\n    if (m > 1)\n      sum += *(*(p + i) + m - 1);\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1();\n  return 0;\n}\n"}
{"label": "6", "index": "10159", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, b, sz[100][100];\n  cin >> k;\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m, &n);\n    int s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &(sz[i][j]));\n    }\n    if (m == 1 && n == 1) {\n      s = sz[0][0];\n    } else {\n      for (b = 0; b < n; b++) {\n        s = s + sz[0][b] + sz[m - 1][b];\n      }\n      for (b = 0; b < m; b++)\n        s = s + sz[b][0] + sz[b][n - 1];\n\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10160", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int row, col, j, l, sum = 0, num[100][100];\n    cin >> col >> row;\n    for (l = 0; l < col; l++) {\n      int *a = num[l];\n      for (j = 0; j < row; j++) {\n        scanf(\"%d\", a + j);\n        if (l == 0 || l == col - 1 || j == 0 || j == row - 1)\n          sum = sum + *(a + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, o, p, sum, area[111][111];\n  int k, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        scanf(\"%d\", &area[o][p]);\n      }\n    }\n    if (a != 1 && b != 1) {\n      for (p = 0; p < b; p++) {\n        sum += area[0][p] + area[a - 1][p];\n      }\n      for (o = 1; o < a - 1; o++) {\n        sum += area[o][0] + area[o][b - 1];\n      }\n    } else {\n      for (o = 0; o < a; o++) {\n        for (p = 0; p < b; p++) {\n          sum += area[o][p];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, j, r;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int b = 0, c = 0, d = 0, e = 0, sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (r = 0; r < n; r++) {\n        cin >> a[j][r];\n      }\n    }\n    for (j = 0; j < m; j++) {\n      b += a[j][0];\n      d += a[j][n - 1];\n    }\n    for (r = 1; r < n - 1; r++) {\n      c += a[m - 1][r];\n      e += a[0][r];\n    }\n    sum = b + c + d + e;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10163", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, num[100][100], count1, count2, count3, sum;\n  int *pointer = NULL;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (count1 = 0; count1 < m; count1++) {\n      for (count2 = 0; count2 < n; count2++) {\n        cin >> num[count1][count2];\n      } \n    }\n    for (pointer = num[0]; pointer < num[0] + n; pointer++) \n    {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[m - 1]; pointer < num[m - 1] + n; pointer++) \n    {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1] + n - 1, count3 = 1; count3 < m - 1;\n         pointer = num[++count3] + n - 1) \n    {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1], count3 = 1; count3 < m - 1;\n         pointer = num[++count3]) \n    {\n      sum = sum + *pointer;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10164", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, m, n, sum;\nint num[101][101];\nint main() {\n  int i, j, l;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; ++i) {\n    memset(num, 0, sizeof(num));\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; ++j) {\n      for (l = 0; l < n; ++l) {\n        cin >> num[j][l];\n      }\n    }\n    for (j = 0; j < n; ++j)\n      sum += num[0][j] + num[m - 1][j];\n    for (j = 1; j < m - 1; ++j)\n      sum += num[j][0] + num[j][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, sum, a[10001], *p;\n  scanf(\"%d\", &i);\n  while (i--) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = a; p < a + m * n; p++)\n      scanf(\"%d\", p);\n    sum = 0;\n    for (p = a; p < a + n; p++)\n      sum += *p;\n    if (m != 1)\n      for (p = a + (m - 1) * n; p < a + m * n; p++)\n        sum += *p;\n    for (p = a + n; p < a + (m - 1) * n; p += n)\n      sum += *p;\n    for (p = a + n * 2 - 1; p < a + m * n - 1; p += n)\n      sum += *p;\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, s, t, p, q;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    s = 0;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++)\n        if (p == 0 || q == 0 || p == m - 1 || q == n - 1)\n          s = s + a[p][q];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, h, m, n;\n  int sum = 0, minus = 0;\n  int a[100][100];\n  int b[100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        sum += a[i][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        minus += a[i][j];\n      }\n    }\n    b[h] = sum - minus;\n    sum = 0;\n    minus = 0;\n  }\n  for (h = 0; h < k; h++)\n    printf(\"%d\\n\", b[h]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10168", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int tol, i, j, sum, k, x[100][100], row, line;\n  scanf(\"%d\", &tol);\n  for (k = 0, sum = 0; k < tol; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &line);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++)\n        cin >> x[i][j];\n    }\n    if (line == 1) {\n      for (i = 0; i < row; i++)\n        sum += x[i][0];\n\n    } else {\n\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n        sum += x[i][line - 1];\n      }\n    }\n    if (row == 1) {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n      }\n    } else {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n        sum += x[row - 1][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N = 0, n = 0, m = 0, i = 0, j = 0, k = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    int sum = 0;\n    int a[102][102];\n    int *p = *a;\n    scanf(\"%d %d \", &n, &m);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    }\n    for (k = 0; k < m; k++, p++)\n      sum = sum + *p;\n    for (p = p + 101, j = 1; j < n; j++)\n      sum = sum + *p, p = p + 102;\n    for (p = p - 103, k = m - 2; k >= 0; k--, p--)\n      sum = sum + *p;\n    for (p = p - 101, j = n - 2; j > 0; j--, p = p - 102)\n      sum = sum + *p;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, i, j;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &jz[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum += (jz[i][0] + jz[i][n - 1]);\n    for (i = 0; i < n; i++) {\n      sum += (jz[0][i] + jz[m - 1][i]);\n    }\n    sum -= (jz[0][0] + jz[m - 1][n - 1] + jz[0][n - 1] + jz[m - 1][0]);\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100], sum[100];\n  cin >> k;\n  for (int w = 0; w < 100; w++) {\n    sum[w] = 0;\n  }\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[k]);\n        if (j == 0 || j == m - 1 || k == 0 || k == n - 1)\n          sum[i] = sum[i] + a[k];\n      }\n    }\n  }\n  for (int p = 0; p < k; p++) {\n    cout << sum[p] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10172", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, k, sum = 0, x, q, w, e, r;\n  int ss[100];\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    q = 0;\n    w = 0;\n    e = 0;\n    r = 0;\n    for (j = 0; j < n; j++) {\n      q = q + sz[0][j];\n    }\n    for (j = 0; j < n; j++) {\n      w = w + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      e = e + sz[i][0];\n    }\n    for (i = 1; i < m - 1; i++) {\n      r = r + sz[i][n - 1];\n    }\n    sum = q + w + e + r;\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10173", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s, x;\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    s = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> x;\n        if (i == 1 || i == m | j == 1 || j == n) {\n          s += x;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, l, S = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (l = 0; l <= n - 1; l++) {\n        cin >> a[j][l];\n        if (j == 0 || j == m - 1 || l == 0 || l == n - 1) {\n          S = S + a[j][l];\n        }\n      }\n    }\n    if (i < k) {\n      cout << S << '\\n';\n    } else {\n      cout << S;\n    }\n    S = 0;\n  }\n}\n"}
{"label": "6", "index": "10175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, *p;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int j, sum = 0;\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      if (j < n || (j < n * m && j >= (m - 1) * n) || j % n == 0 ||\n          (j + 1) % n == 0)\n        sum += *(p + j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10176", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t;\n  cin >> t;\n  while (t > 0) {\n    int a[102][102];\n    int m, n;\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n    } else {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n      for (int i = 0; i < n; i++)\n        sum += *(*(a + m - 1) + i);\n    }\n    cout << sum << endl;\n    t--;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, number;\n  cin >> number; \n  for (i = 0; i < number; i++) {\n    int m, n;\n    cin >> m >> n;   \n    int a[100][100]; \n    int *p = NULL, *q = NULL, i;\n    for (p = *a; p < *a + n * m; p++) \n    {\n      cin >> *p;\n    }\n    int sum = 0;\n    for (p = *a; p < *a + n; p++) \n    {\n      sum = sum + *p;\n    }\n    if (m != 1) \n    {\n      for (p = *a + (m - 1) * n; p < *a + m * n; p++) \n      {\n        sum = sum + *p;\n      }\n    }\n    for (p = *a + n; p < *a + (m - 1) * n; p = p + n) \n    {\n      sum = sum + *p + *(p + n - 1);\n    }\n    cout << sum << endl; \n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s;\n  int sz[100][100];\n  cin >> k;\n  int *sf = (int *)malloc(sizeof(int) * k);\n  for (i = 0; i < k; i++) {\n    s = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &sz[j][l]);\n      }\n    }\n    if (m == 1) {\n      for (l = 0; l < n; l++) {\n        s += sz[0][l];\n      }\n    } else {\n      if (n == 1) {\n        for (j = 0; j < m; j++) {\n          s += sz[j][0];\n        }\n      } else {\n        for (j = 0; j < m; j++) {\n          s += sz[j][0] + sz[j][n - 1];\n        }\n        for (l = 0; l < n; l++) {\n          s += sz[0][l] + sz[m - 1][l];\n        }\n        s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n      }\n    }\n    sf[i] = s;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", sf[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, line = 0, row = 0;\n  int a[102][102];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> line >> row;\n    for (int j = 0; j < line; j++) \n    {\n      for (int k = 0; k < row; k++)\n        cin >> *(*(a + j) + k);\n    }\n    if (line == 1 && row == 1) {\n      cout << **a << endl;\n      continue;\n    }\n    int plus = **a + *(*a + row - 1) + **(a + line - 1) +\n               *(*(a + line - 1) + row - 1); \n    for (int j = 1; j < line - 1; j++)       \n      plus += **(a + j) + *(*(a + j) + row - 1);\n    for (int j = 1; j < row - 1; j++) \n      plus += *(*a + j) + *(*(a + line - 1) + j);\n    cout << plus << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10180", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, b;\n  int sz[1000][1000];\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    int e, k, h = 0;\n    for (e = 0; e < m; e++) {\n      if (e == 0) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n      if (e == m - 1) {\n        for (k = 0; k < n; k++)\n          h += sz[e][k];\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (k == n - 1) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n      if (k == 0) {\n        for (e = 1; e < m - 1; e++)\n          h += sz[e][k];\n      }\n    }\n    printf(\"%d \", h);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int s = 0;\n    for (int i = 0; i < n; i++) {\n      s += *(*(a) + i);\n    }\n    if (m > 1)\n      for (int i = 0; i < n; i++) {\n        s += *(*(a + m - 1) + i);\n      }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + 0);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + n - 1);\n    }\n    printf(\"%d\", s);\n    if (i != k - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10182", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum(int a[100][100], int m, int n) {\n  int x = 0, i;\n  for (i = 0; i < n; i++) {\n    x = x + a[0][i] + a[m - 1][i];\n  }\n  for (i = 1; i < m - 1; i++) {\n    x = x + a[i][0] + a[i][n - 1];\n  }\n  return x;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int a[100][100] = {0}, m, n, j, k;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", sum(a, m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, j;\n  int m, n;\n  int a[10000];\n  int *p, r;\n  int sum = 0;\n\n  scanf(\"%d\\n\", &k);\n\n  int i;\n  p = a;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n\n    for (j = 0; j < 10000; j++)\n      *(p + j) = 0;\n\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", &*(p + j));\n\n    for (j = 0; j < n; j++)\n      sum = sum + *(p + j);\n\n    for (r = 1; r < m - 1; r++)\n      sum = sum + *(p + n * r) + *(p + n * r + n - 1);\n\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(p + (m - 1) * n + j);\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "10184", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int x[100][100];\n  int a, b;\n  int sum;\n  cin >> num;\n  for (int i = 0; i < num; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < 100; j++) {\n      for (int k = 0; k < 100; k++)\n        x[j][k] = 0;\n    }\n    sum = 0;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        cin >> x[j][k];\n        if (j == 0 || j == a - 1) {\n          sum += x[j][k];\n        } else {\n          if (k == 0 || k == b - 1)\n            sum += x[j][k];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    char a[100][100];\n    int j, l;\n\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l];\n    } else {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l] + a[m - 1][l];\n    }\n    if (n == 1) {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0];\n    } else {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0] + a[j][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int m, n, a, b, sp = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a <= m - 1; a++) {\n      for (b = 0; b <= n - 1; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n        sp = sp + sz[a][b];\n      }\n    }\n    int sum = 0;\n    for (b = 0; b <= n - 1; b++) {\n      sum = sum + sz[0][b] + sz[m - 1][b];\n    }\n    for (a = 0; a <= m - 1; a++) {\n      sum = sum + sz[a][0] + sz[a][n - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    if (m == 1 || n == 1) {\n      sum = sp;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10187", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], times, x, y, i, j, k, sum = 0;\n  int *pointer = NULL;\n  scanf(\"%d \", &times);\n  for (i = 1; i <= times; i++) {\n    sum = 0;\n    cin >> x >> y;\n    for (k = 0; k < x; k++) {\n      for (j = 0; j < y; j++) {\n        cin >> a[k][j];\n        pointer = &a[k][j];\n        if (k == 0 || j == 0 || k == x - 1 || j == y - 1)\n          sum = sum + *pointer;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, k, i, j, row, col;\n  int sx_row, sx_col, s;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    scanf(\"%d %d\", &row, &col);\n    int sz[100][100];\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sx_row = row - 1;\n    sx_col = col - 1;\n    for (j = 0; j < sx_col; j++) {\n      s = s + sz[0][j];\n    }\n    for (i = 0; i < sx_row; i++) {\n      s = s + sz[i][sx_col];\n    }\n    for (j = sx_col; j > 0; j--) {\n      s = s + sz[sx_row][j];\n    }\n    for (i = sx_row; i > 0; i--) {\n      s = s + sz[i][0];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, sum, i, k, n, m, j = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    a = (int *)malloc(sizeof(int) * (n * m));\n    for (j = 0; j < n * m; j++) {\n      scanf(\"%d\", a + j);\n      if ((j + 1 <= n) || (j > (n * m - n - 1)) || ((j + 1) % n == 1) ||\n          ((j + 1) % n == 0)) {\n        sum += *(a + j);\n      }\n    }\n    free(a);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10190", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *p, *q, a, b, k, m = 0, i, j;\n  q = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    m = 0;\n    p = q;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j < a * b; j++) {\n      scanf(\"%d\", p + j);\n    }\n    for (j = 0; j < b; j++)\n      m += *(p + j) + *(p + a * b - 1 - j);\n    for (j = 1; j < a - 1; j++)\n      m += *(p + j * b) + *(p + j * b + b - 1);\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "6", "index": "10191", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  int a[100][100];\n  int sum;\n  int n[200];\n  int g;\n  int s[200];\n  for (g = 0; g <= t - 1; g++) {\n    cin >> s[g];\n    cin >> n[g];\n\n    int i;\n    int j;\n    for (i = 0; i <= s[g] - 1; i++)\n      for (j = 0; j <= n[g] - 1; j++) {\n        cin >> a[i][j];\n      }\n\n    sum = 0;\n    for (i = 0; i <= s[g] - 1; i++) {\n      sum = sum + **(a + i);\n      sum = sum + *(*(a + i) + n[g] - 1);\n    }\n    for (j = 0; j <= n[g] - 1; j++) {\n      sum = sum + *(*a + j);\n      sum = sum + *(*(a + s[g] - 1) + j);\n    }\n    sum = sum - **a - *(*(a + s[g] - 1) + n[g] - 1) - *(*a + n[g] - 1) -\n          **(a + s[g] - 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10192", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], (*p)[100];\n  p = a;\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num = num + *(*(p + i) + j);\n      }\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      printf(\"%d\\n\", num);\n    else {\n      for (i = 0; i < m; i += m - 1) {\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(p + i) + j);\n        }\n      }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum = sum + *(*(p + i) + j);\n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10193", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, x, a[100][100] = {{0, 0}}, m, n, i, j, sum = 0;\n  cin >> k;\n  for (x = 1; x <= k; x++) {\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d \", &a[i][j]);\n        if (i == 0 || j == 0 || i == (m - 1) || j == (n - 1)) {\n          sum = sum + a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, i, j;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> jz[i][j];\n    }\n    for (i = 0; i < m; i++)\n      sum += (jz[i][0] + jz[i][n - 1]);\n    for (i = 0; i < n; i++)\n      sum += (jz[0][i] + jz[m - 1][i]);\n    sum -= (jz[0][0] + jz[m - 1][n - 1] + jz[0][n - 1] + jz[m - 1][0]);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, t, j, sum, m, n;\n  scanf(\"%d\\n\", &t);\n  for (j = 0; j < t; j++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (i = 1; i <= m * n; i++) {\n      scanf(\"%d\", &a);\n      if ((i <= n) || (i > (m * n - n)) || (i % n == 1) || (i % n == 0))\n        sum += a;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, line;\n  int i, j, judge = 0, t, T, sum;\n  scanf(\"%d\", &t);\n  for (T = 0; T < t; T++) {\n    sum = 0;\n    scanf(\"%d %d\", &row, &line);\n    if (row == 1 || line == 1) {\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++) {\n          scanf(\"%d\", (*(a + i) + j));\n        }\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          sum += *(*(a + i) + j);\n      cout << sum << \"\\n\";\n      return 0;\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        scanf(\"%d\", (*(a + i) + j));\n      }\n    }\n    for (i = 0; i < row; i++) {\n      sum += *(*(a + i) + 0);\n      sum += *(*(a + i) + line - 1);\n    }\n    for (j = 0; j < line; j++) {\n      sum += *(*(a + 0) + j);\n      sum += *(*(a + row - 1) + j);\n    }\n    sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + line - 1) -\n          *(*(a + row - 1) + line - 1) - *(*(a + row - 1) + 0);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, sum, a[10001], *p;\n  scanf(\"%d\", &i);\n  while (i--) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = a; p < a + m * n; p++)\n      scanf(\"%d\", p);\n    sum = 0;\n    for (p = a; p < a + n; p++)\n      sum += *p;\n    if (m != 1)\n      for (p = a + (m - 1) * n; p < a + m * n; p++)\n        sum += *p;\n    for (p = a + n; p < a + (m - 1) * n; p += n)\n      sum += *p;\n    for (p = a + n * 2 - 1; p < a + m * n - 1; p += n)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[120][120];\n  for (int i = 0; i < n; i++) {\n    int a, b;\n    int s = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (int m = 0; m < a; m++)\n      for (int n = 0; n < b; n++) {\n        scanf(\"%d\", &num[m][n]);\n        if (m == 0 || m == a - 1 || n == 0 || n == b - 1)\n          s += num[m][n];\n      }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[400], m, n, a, i, j, k, l, sum, counter, b, matrix[100][100];\n  scanf(\"%d\", &a);\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    counter = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &matrix[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          p[counter] = &matrix[i][j];\n          counter++;\n        }\n      }\n    }\n    for (l = 0; l < counter; l++) {\n      sum += *p[l];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int m;\n  int n;\n  int i, j, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    int sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        sum = sum + a[i][j];\n      }\n    }\n    for (i = 1; i <= m - 2; i++) {\n      for (j = 1; j <= n - 2; j++) {\n        sum = sum - a[i][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10201", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], j, i, l, p, q;\n  int k, m, n, sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    }\n    for (p = 1; p <= n; p++)\n      sum = sum + a[1][p] + a[m][p];\n\n    for (q = 2; q < m; q++)\n      sum = sum + a[q][1] + a[q][n];\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum;\n  cin >> k;\n  int a[100][100];\n  for (int l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    sum = 0;\n    if (m > 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*(a + m - 1) + i);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n    }\n    if (n > 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i) + n - 1);\n    }\n    if (n == 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum;\n  int *p;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = a[0]; p < a[0] + n; p++)\n      sum += *p;\n    for (p = p + 99; p < a[0] + (m - 1) * 100 + n; p = p + 100)\n      sum += *p;\n    for (p = p - 101; p > a[0] + (m - 1) * 100 - 1; p--)\n      sum += *p;\n    for (p = p - 99; p > a[0]; p = p - 100)\n      sum += *p;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[105][105];\n  long m, n, k, z, sum, i, j;\n  scanf(\"%d\", &z);\n  for (i = 1; i <= z; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if (m >= 2 && n >= 2) {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++) {\n          scanf(\"%d\", &a[j][k]);\n        }\n      }\n      for (k = 1; k <= n; k++) {\n        sum = sum + a[1][k] + a[m][k];\n      }\n      for (j = 2; j <= m - 1; j++) {\n        sum = sum + a[j][1] + a[j][n];\n      }\n      printf(\"%d\\n\", sum);\n    }\n\n    else {\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++)\n          scanf(\"%d\", &a[j][k]);\n      }\n      for (j = 1; j <= m; j++) {\n        for (k = 1; k <= n; k++)\n          sum = sum + a[j][k];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "10205", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, M, i, j, sum[1000];\n  int row[1000], col[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &M);\n  for (m = 0; m < M; m++) {\n    sum[m] = 0;\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        sz[i][j] = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &row[m], &col[m]);\n\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < col[m]; j++) {\n      sum[m] += sz[0][j];\n      sum[m] += sz[row[m] - 1][j];\n    }\n    for (i = 0; i < row[m]; i++) {\n      sum[m] += sz[i][0];\n      sum[m] += sz[i][col[m] - 1];\n    }\n    sum[m] = sum[m] - sz[0][0] - sz[row[m] - 1][col[m] - 1] -\n             sz[0][col[m] - 1] - sz[row[m] - 1][0];\n  }\n  for (m = 0; m < M; m++)\n    printf(\"%d\\n\", sum[m]);\n  return 0;\n}\n"}
{"label": "6", "index": "10206", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\nint main() {\n  int k, m, n, sum, i, j;\n  scanf(\"%d\", &k);\n  while (k--) {\n    memset(a, 0, sizeof(a));\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n      }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10207", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int a[100][100], int m, int n) {\n  int x = 0, i;\n  for (i = 0; i < n; i++) {\n    x = x + a[0][i] + a[m - 1][i];\n  }\n  for (i = 1; i < m - 1; i++) {\n    x = x + a[i][0] + a[i][n - 1];\n  }\n  return x;\n}\nint main() {\n  int k, i;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    int a[100][100] = {0}, m, n, j, k;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(a, m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, j, l, s = 0, A[110];\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> *(A + l);\n      if (j == 0 || j == m - 1) {\n        for (l = 0; l < n; l++)\n          s = s + *(A + l);\n      } else\n        s = s + *A + *(A + n - 1);\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10209", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], row, col, sum = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    cin >> row >> col;\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        cin >> a[i][j];\n    if (row == 1 && col == 1)\n      cout << *(a[0]);\n    else {\n      for (int i = 0; i < col; i++) {\n        sum += *(a[0] + i);\n        sum += *(a[row - 1] + i);\n      }\n      for (int j = 1; j < row - 1; j++) {\n        sum += *(a[j]);\n        sum += *(a[j] + col - 1);\n      }\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, num[100][100], sum;\n  cin >> k;\n  cout << endl;\n  for (int a = 0; a < k; a++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n        cout << \" \";\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += num[i][j];\n        }\n      }\n      printf(\"\\n\");\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    int n, m;\n    cin >> m >> n;\n    int num[110][110];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> num[j][k];\n    int sum = 0;\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++)\n        sum = sum + num[0][j];\n      cout << sum << endl;\n    } else if (m != 1 && n == 1) {\n      for (int j = 0; j < m; j++)\n        sum = sum + num[m][0];\n      cout << sum << endl;\n    } else if (m == 1 && n == 1)\n      cout << num[0][0] << \"\\n\";\n    else {\n      for (int j = 0; j < n; j++)\n        sum = sum + *(*num + j);\n      for (int j = 0; j < n; j++)\n        sum = sum + *(num[m - 1] + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + **(num + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + *(*(num + j) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100];\n  for (int r = 0; r < k; r++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int s = 0;\n    for (int t = 0; t < n; t++)\n      s += a[0][t] + a[m - 1][t];\n\n    for (int u = 1; u < m - 1; u++) {\n      s += a[u][0] + a[u][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int kk, m, n, i, j, k, a[100][100], c[300];\n  scanf(\"%d\", &kk);\n  for (i = 0; i < kk; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    *(c + i) = 0;\n    if (m == 1 & n == 1)\n      *(c + i) = a[0][0];\n    else {\n      for (j = 1, k = 0; j < m; j++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = 1, j--; k < n; k++)\n        *(c + i) += *(*(a + j) + k);\n\n      for (j = j - 1, k--; j >= 0; j--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = k - 1, j++; k >= 0; k--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < kk; i++)\n    printf(\"%d\\n\", *(c + i));\n  return 0;\n}\n"}
{"label": "6", "index": "10215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nn, ii;\n  scanf(\"%d\", &nn);\n  for (ii = 1; ii <= nn; ii++) {\n    int n, m, t, i, j, x, y, sum = 0;\n    scanf(\"%d %d\", &y, &x);\n    for (i = 1; i <= y; i++) {\n      for (j = 1; j <= x; j++) {\n        scanf(\"%d\", &t);\n        if (i == 1 || i == y || j == x || j == 1) {\n          sum += t;\n        }\n      }\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10216", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, size[100][2], m[100][100][100], i, j, l, sum[100];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\", &size[i][0], &size[i][1]);\n    for (j = 0; j < size[i][0]; j++)\n      for (l = 0; l < size[i][1]; l++)\n        scanf(\"%d\", &m[i][j][l]);\n\n    if ((size[i][1] == 1) && (size[i][0] == 1))\n      sum[i] = m[i][0][0];\n    else {\n      for (l = 0; l < size[i][1]; l++) {\n        if (size[i][1] == 1)\n          sum[i] = sum[i] + m[i][0][l];\n        else\n          sum[i] = sum[i] + m[i][0][l] + m[i][size[i][0] - 1][l];\n      }\n      for (j = 1; j <= size[i][0] - 2; j++)\n        sum[i] = sum[i] + m[i][j][0] + m[i][j][size[i][1] - 1];\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int jz[100][100];\n  int m, n;\n\n  int s[1000];\n  int i, j, q;\n\n  for (q = 0; q < k; q++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n\n        scanf(\"%d\", &(jz[i][j]));\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][0];\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][n - 1];\n    }\n    for (i = 0; i < n; i++)\n      s[q] += jz[0][i];\n\n    for (i = 0; i < n; i++) {\n      s[q] += jz[m - 1][i];\n    }\n    s[q] = s[q] - (jz[0][0]) - (jz[0][n - 1]) - (jz[m - 1][0]) -\n           (jz[m - 1][n - 1]);\n    if (q == k - 1) {\n      printf(\"%d\", s[q]);\n    } else {\n      printf(\"%d\\n\", s[q]);\n    }\n    m = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int M = 100 + 10;\nconst int N = 100 + 10;\nint mat[M][N];\nint main(void) {\n  int cases, i, j, ans, m, n;\n  scanf(\"%d\", &cases);\n  while (cases--) {\n    ans = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; ++i) {\n      for (j = 0; j < n; ++j)\n        scanf(\"%d\", mat[i] + j);\n    }\n    if (m == 0 || n == 0) {\n      printf(\"%d\\n\", 0);\n      continue;\n    }\n    if (m == 1) {\n      for (i = 0; i < n; ++i)\n        ans += mat[0][i];\n\n      printf(\"%d\\n\", ans);\n      continue;\n    } else if (n == 1) {\n      for (i = 0; i < m; ++i) {\n        ans += mat[i][0];\n      }\n      printf(\"%d\\n\", ans);\n      continue;\n    }\n\n    for (i = 0; i < n; ++i) {\n      ans += mat[0][i];\n      ans += mat[m - 1][i];\n    }\n    for (i = 0; i < m; ++i) {\n      ans += mat[i][0];\n      ans += mat[i][n - 1];\n    }\n    ans -= (mat[0][0] + mat[0][n - 1] + mat[m - 1][0] + mat[m - 1][n - 1]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, i, j, x, sum;\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> x;\n        if ((i == 1) || (i == m) || (j == 1) || (j == n))\n          sum = sum + x;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, j;\n  int n, row, col;\n  int shuzu[1000][1000], cc[1000] = {99};\n  int result = 0;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &row, &col);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &shuzu[i][j]);\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i == 0) {\n          result += shuzu[i][j];\n        } else if (i == (row - 1)) {\n          result += shuzu[i][j];\n        } else {\n          if (j == 0) {\n            result += shuzu[i][j];\n          } else if (j == (col - 1)) {\n            result += shuzu[i][j];\n          }\n        }\n      }\n    }\n    cc[k] = result;\n    result = 0;\n  }\n\n  for (k = 0; k < n; k++) {\n    cout << cc[k] << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t > 0) {\n    int a[102][102];\n    int m, n;\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n    } else {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n      for (int i = 0; i < n; i++)\n        sum += *(*(a + m - 1) + i);\n    }\n    cout << sum << \"\\n\";\n    t--;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10222", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100];\n  int i = 0, j = 0, t = 1;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    if (m == 1 && n == 1)\n      printf(\"%d\\n\", a[0][0]);\n    else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, m, n, x, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 1, s = 0, m--; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    for (j = 2; j <= m; j++)\n      for (l = 1; l <= n; l++) {\n        cin >> x;\n        if ((l == 1) || (l == n))\n          s += x;\n      }\n    for (j = 1; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10224", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], j, i, l, p, q;\n  int k, m, n, sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    }\n    for (p = 1; p <= n; p++)\n      sum = sum + a[1][p] + a[m][p];\n\n    for (q = 2; q < m; q++) {\n      sum = sum + a[q][1] + a[q][n];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, row, col, ROW, sz[100][100], COL, sum[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++)\n        scanf(\"%d\", &sz[row][col]);\n    }\n    if (ROW == 1 && COL == 1) {\n      sum[i] = sum[i] + sz[0][0];\n    } else {\n      for (col = 0; col < COL; col++) {\n        sum[i] = sum[i] + sz[0][col] + sz[ROW - 1][col];\n      }\n      for (row = 1; row < (ROW - 1); row++) {\n        sum[i] = sum[i] + sz[row][0] + sz[row][COL - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  scanf(\"%d\", &k);\n  return 0;\n}\n"}
{"label": "6", "index": "10226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  int a[100][100];\n  int sum;\n  int n[200];\n  int g;\n  int s[200];\n  for (g = 0; g <= t - 1; g++) {\n    cin >> s[g];\n    cin >> n[g];\n\n    int i;\n    int j;\n    for (i = 0; i <= s[g] - 1; i++)\n      for (j = 0; j <= n[g] - 1; j++)\n        cin >> a[i][j];\n\n    sum = 0;\n    for (i = 0; i <= s[g] - 1; i++) {\n      sum = sum + **(a + i);\n      sum = sum + *(*(a + i) + n[g] - 1);\n    }\n    for (j = 0; j <= n[g] - 1; j++) {\n      sum = sum + *(*a + j);\n      sum = sum + *(*(a + s[g] - 1) + j);\n    }\n    sum = sum - **a - *(*(a + s[g] - 1) + n[g] - 1) - *(*a + n[g] - 1) -\n          **(a + s[g] - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], i, j, l, sum = 0;\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + sz[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + sz[i][n - 1];\n    }\n    for (j = 0; j < n - 1; j++) {\n      sum = sum + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int count, m, n, array[100][100], sum[100] = {0}, i, j, p;\n  scanf(\"%d\", &count);\n  for (i = 0; i < count; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (j = 0; j < m; j++)\n      for (p = 0; p < n; p++)\n        scanf(\"%d\", &array[j][p]);\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + array[0][j];\n      if (m > 1)\n        sum[i] = sum[i] + array[m - 1][j];\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum[i] = sum[i] + array[j][0];\n      sum[i] = sum[i] + array[j][n - 1];\n    }\n  }\n  for (i = 0; i < count; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10229", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, h, a[1000][1000] = {0}, result;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    result = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (j = 0; j < n; j++)\n      result = result + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      result = result + a[i][0] + a[i][n - 1];\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10230", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint m, n;\nvoid Input(int (*a)[102]) {\n  cin >> m >> n;\n  for (int i = 0; i <= m - 1; i++) {\n    for (int j = 0; j <= n - 1; j++)\n      cin >> *(*(a + i) + j);\n  }\n}\nvoid Sum(int x, int y, int (*a)[102]) {\n  sum += *(*(a + x) + y);\n  if (x == 0 && y < n - 1)\n    Sum(x, y + 1, a);\n  else if (x < m - 1 && y == n - 1)\n    Sum(x + 1, y, a);\n  else if (x == m - 1 && y > 0)\n    Sum(x, y - 1, a);\n  else if (y == 0 && x > 1)\n    Sum(x - 1, y, a);\n  else\n    return;\n}\nint main() {\n  int a[102][102];\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    Input(a);\n    Sum(0, 0, a);\n    if (i != 1)\n      cout << endl;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10231", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, i, j, l, m, n, x = 0, y = 0;\n  scanf(\"%d \", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        x = x + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++) {\n        y = y + a[i][j];\n      }\n    }\n    cout << x - y << endl;\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, n, m, i, k, j, a[100][100], s[100];\n  scanf(\"%d\", &p);\n  for (k = 0; k < p; k++) {\n    s[k] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0)\n          s[k] += a[i][j];\n        else if ((m - i - 1) == 0)\n          s[k] += a[i][j];\n        else if (j == 0)\n          s[k] += a[i][j];\n        else if ((n - j - 1) == 0)\n          s[k] += a[i][j];\n      }\n  }\n  for (k = 0; k < p; k++)\n    cout << s[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n\n    int sz[m][n];\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &(sz[j][i]));\n      }\n    }\n\n    int a = 0;\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        a += sz[j][i];\n      }\n    }\n    for (int j = 1; j < m - 1; j++) {\n      for (int i = 1; i < n - 1; i++) {\n        a -= sz[j][i];\n      }\n    }\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10234", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, r, l;\n  int sz[100][100];\n  s = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &r);\n    scanf(\"%d\", &l);\n    for (int j = 0; j < r; j++) {\n      for (int k = 0; k < l; k++) {\n        scanf(\"%d\", &(sz[j][k]));\n        if ((j == 0) || (j == r - 1) || ((j != 0) && (k == 0)) ||\n            ((j != 0) && (k == l - 1))) {\n          s = s + sz[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int K, i, j, k, m, n, a[100][100] = {0}, sum, p, q, result[100] = {0};\n  scanf(\"%d\", &K);\n  for (i = 1; i <= K; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", *(a + j) + k);\n    if (m == 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    if (m > 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q) + *(*(a + m - 1) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10236", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, q;\n  int a[100][100];\n  int sum = 0;\n  int(*p)[100] = a;\n  scanf(\"%d \", &q);\n  for (int i = 0; i < q; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        if (j == 0 || j == m - 1)\n          sum += p[j][k];\n        else {\n          if (k == 0 || k == n - 1)\n            sum += p[j][k];\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200], t, n, m, i, j, s;\n  int(*p)[200];\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d%d\", &n, &m);\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", *(p + i) + j);\n    s = 0;\n    for (i = 0; i < m; i++)\n      s = s + *(*p + i);\n    if (n > 1)\n      for (i = 0; i < m; i++)\n        s = s + *(*(p + n - 1) + i);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(p + i));\n    if (m > 1)\n      for (i = 1; i < n - 1; i++)\n        s = s + *(*(p + i) + m - 1);\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10238", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int times;\n  int p[200][200];\n  int hang, lie;\n  int sum = 0;\n  int i, j;\n  cin >> n;\n  for (times = 0; times < n; times++) {\n    cin >> hang >> lie;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < hang; i = i + hang - 1)\n      for (j = 0; j < lie; j++)\n        sum = sum + *(*(p + i) + j);\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j = j + lie - 1)\n        sum = sum + *(*(p + i) + j);\n    sum = sum - *(*p) - *(*p + lie - 1) - *(*(p + hang - 1)) -\n          *(*(p + hang - 1) + lie - 1);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, a, n, m, sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> sz[j][l];\n    }\n    a = 0;\n    for (l = 0; l < n; l++) {\n      a += sz[0][l];\n    }\n    if (m > 1) {\n      for (l = 0; l < n; l++) {\n        a += sz[m - 1][l];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      a += sz[j][0];\n    }\n    if (n > 1) {\n      for (j = 1; j < m - 1; j++) {\n        a += sz[j][n - 1];\n      }\n    }\n    result[i] = a;\n  }\n  for (i = 0; i < k; i++) {\n    cout << result[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum1, sum2, sum3, sum4;\n  int i, j, l;\n  int a[100][100], b[100];\n\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++)\n      sum1 = sum1 + a[0][j];\n    for (i = 1; i < m; i++)\n      sum2 = sum2 + a[i][n - 1];\n    for (j = 0; j < n - 1; j++)\n      sum3 = sum3 + a[i - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum4 = sum4 + a[i][0];\n    b[l] = sum1 + sum2 + sum3 + sum4;\n  }\n  for (l = 1; l <= k; l++)\n    printf(\"%d\\n\", b[l]);\n  return 0;\n}\n"}
{"label": "6", "index": "10241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid ijudge(int i, int j, int k, int p, int q) {\n  if ((j == 0) || (j == p - 1) || (k == 0) || (k == q - 1))\n    sum += i;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int p, q;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d \", &p, &q);\n    sum = 0;\n    for (int j = 0; j < p; j++)\n      for (int k = 0; k < q; k++) {\n        cin >> a[j][k];\n        ijudge(a[j][k], j, k, p, q);\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200], t, n, m, i, j, s;\n  int(*p)[200];\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d%d\", &n, &m);\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", *(p + i) + j);\n    s = 0;\n    for (i = 0; i < m; i++)\n      s = s + *(*p + i);\n    if (n > 1) {\n      for (i = 0; i < m; i++)\n        s = s + *(*(p + n - 1) + i);\n    }\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(p + i));\n    if (m > 1)\n      for (i = 1; i < n - 1; i++)\n        s = s + *(*(p + i) + m - 1);\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int I, m, n, a[100][100];\n  int i, j, k, sum;\n  scanf(\"%d\", &I);\n  for (k = 0; k < I; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (i = 0; i < n; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][n - 1] - a[m - 1][0];\n    if ((m == n) && (m == 1))\n      sum = a[0][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, row, col, c[100][100], result[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        scanf(\"%d\", *(c + j) + k);\n        if (k == 0 || k == col - 1 || j == 0 || j == row - 1)\n          result[i] += *(*(c + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << result[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0, a[500][500] = {0}, (*p)[500];\n  cin >> k;\n  int i = 0, j = 0;\n  p = a;\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    int result = 0;\n    p = a;\n    for (i = 0; i < m; i++)\n      result = result + *(*(p + i));\n    p = a;\n    for (i = 0; i < m && n != 1; i++)\n      result = result + *(*(p + i) + n - 1);\n    p = a + m - 1;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    p = a;\n    for (i = 1; i < n - 1; i++)\n      result = result + *(*p + i);\n    cout << result << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int a, b, c, d, total;\n    scanf(\"%d%d\", &a, &b);\n    if (a == 1 && b == 1) {\n      scanf(\"%d\", &c);\n      printf(\"%d\", c);\n    } else {\n      int sz[a][b];\n      for (c = 0; c < a; c++) {\n        for (d = 0; d < b - 1; d++) {\n          scanf(\"%d\", &sz[c][d]);\n        }\n\n        scanf(\"%d\\n\", &sz[c][b - 1]);\n      }\n      total = 0;\n      for (c = 0; c < a; c++) {\n        total = total + sz[c][0];\n        total = total + sz[c][b - 1];\n      }\n      for (c = 0; c < b; c++) {\n        total = total + sz[0][c];\n        total = total + sz[a - 1][c];\n      }\n      total = total - sz[0][0];\n      total = total - sz[0][b - 1];\n      total = total - sz[a - 1][0];\n      total = total - sz[a - 1][b - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k; \n  while (k--) {\n    int m, n, i, j;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) \n          sum += a[i][j];                                 \n    cout << sum << endl;                                  \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, sum;\n  int m;\n  int a[200][220];\n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    sum = 0;\n    int row, col;\n    scanf(\"%d%d\", &row, &col);\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    for (i = 1; i <= row; i++) {\n      sum = sum + a[i][1] + a[i][col];\n    }\n\n    for (j = 2; j <= col - 1; j++) {\n      sum = sum + a[1][j] + a[row][j];\n    }\n\n    if (row == 1) {\n      sum /= 2;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10249", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, sum = 0;\n  int a[100][100];\n  int b[1000];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    if ((m != 1) && (n != 1)) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        sum = sum + a[m - 1][l];\n      }\n      for (j = 1; j < m - 1; j++) {\n        sum = sum + a[j][0];\n        sum = sum + a[j][n - 1];\n      }\n      b[i] = sum;\n      sum = 0;\n    } else if (m = 1) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        b[i] = sum;\n        sum = 0;\n      }\n    } else if (n = 1) {\n      for (j = 0; j < m; j++) {\n        sum = sum + a[j][0];\n        b[i] = sum;\n        sum = 0;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid juzhen(int m, int n) {\n  int a[100][100];\n  int i, j, sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + *(*(a) + j) + *(*(a + m - 1) + j);\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + *(*(a + i) + 0) + *(*(a + i) + n - 1);\n  }\n  if (m == 1) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      sum = sum + *(*a + i);\n  }\n  if (n == 1) {\n    sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + *(*(a + i) + 0);\n  }\n  cout << sum << \"\\n\";\n}\nint main() {\n  int k, i, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    juzhen(m, n);\n  }\n}\n"}
{"label": "6", "index": "10251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, p, ans = 0;\n  int m[100], n[100];\n  int r[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (p = 0; p < n[i]; p++)\n        scanf(\"%d\", &r[i][j][p]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    ans = 0;\n    for (i = 0; i < n[p]; i++) {\n      for (j = 0; j < m[p]; j++) {\n        if ((i == 0) || (i == n[p] - 1) || (j == 0) || (j == m[p] - 1))\n          ans += r[p][j][i];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, s, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    s = 0;\n\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < n; j++) {\n      s = s + *(a[0] + j);\n      s = s + *(a[m - 1] + j);\n    }\n    for (i = 0; i < m; i++) {\n      s = s + *(a[i] + 0);\n      s = s + *(a[i] + n - 1);\n    }\n    s = s - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int x[100][100];\n  int a, b;\n  int sum;\n  cin >> num;\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d \", &a, &b);\n    for (int j = 0; j < 100; j++) {\n      for (int k = 0; k < 100; k++) {\n        x[j][k] = 0;\n      }\n    }\n    sum = 0;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        cin >> x[j][k];\n        if (j == 0 || j == a - 1) {\n          sum += x[j][k];\n        } else {\n          if (k == 0 || k == b - 1)\n            sum += x[j][k];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum(int m, int n) {\n  int a[m][n], i, j, t = 0;\n  if (m == 1 || n == 1)\n    for (i = 0; i < m + n - 1; i++) {\n      scanf(\"%d\", &j);\n      t += j;\n    }\n\n  else {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < m; i++)\n      t += a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      t += a[0][j] + a[m - 1][j];\n  }\n  return t;\n}\nint main() {\n  int m, n, q;\n  for (scanf(\"%d\", &q); q > 0; q--) {\n    scanf(\"%d%d\", &m, &n);\n    printf(\"%d\\n\", sum(m, n));\n  }\n}\n"}
{"label": "6", "index": "10255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid clear(int z[][100], int x, int y);\nint main() {\n  int k, i, s, j, m, n, a[100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    clear(a, m, n);\n    for (j = 0; j < m; j++) {\n      for (s = 0; s < n; s++)\n        scanf(\"%d \", &a[j][s]);\n    }\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + 0) + j);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + m - 1) + j);\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j));\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j) + n - 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid clear(int z[][100], int x, int y) {\n  int i, j;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++)\n      z[i][j] = 0;\n  }\n}\n"}
{"label": "6", "index": "10256", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k = 0, i = 0, j = 0, lin = 0, col = 0;\n  int array[105][105];\n  int sum = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> lin >> col;\n    for (int p = 0; p < lin; p++) {\n      for (int q = 0; q < col; q++) {\n        cin >> *(*(array + p) + q);\n      }\n    }\n    for (j = 0; j < col; j++) {\n      sum = sum + array[0][j];\n    }\n    for (j = 1; j < lin; j++) {\n      sum = sum + array[j][col - 1];\n    }\n    for (j = 0; j < (col - 1); j++) {\n      sum = sum + array[lin - 1][j];\n    }\n    for (j = 1; j < (lin - 1); j++) {\n      sum = sum + array[j][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int *p, int h, int l);\n  int N, m, n, i, j, q, a[110][110] = {0};\n  scanf(\"%d\", &N);\n  for (q = 1; q <= N; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    printf(\"%d\\n\", sum(a[0], m, n));\n  }\n  return 0;\n}\n\nint sum(int *p, int h, int l) {\n  int r = 0, i, j;\n  for (i = 0; i <= h - 1; i++) {\n    if (i == 0 || i == (h - 1))\n      for (j = 0; j <= l - 1; j++)\n        r = r + *(p + i * 110 + j);\n    else\n      r = r + *(p + i * 110) + *(p + i * 110 + l - 1);\n  }\n  return r;\n}\n"}
{"label": "6", "index": "10258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n\n    int sz[m][n];\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &(sz[j][i]));\n      }\n    }\n\n    int a = 0;\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        a += sz[j][i];\n      }\n    }\n    for (int j = 1; j < m - 1; j++) {\n      for (int i = 1; i < n - 1; i++)\n        a -= sz[j][i];\n    }\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int k, n, m, i, j, l;\n  int sum = 0;\n\n  scanf(\"%d \", &k);\n\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        scanf(\"%d \", &sz[i][j]);\n    }\n\n    for (j = 0; j < m - 1; j++) {\n\n      sum += sz[0][j];\n    }\n    for (i = 0; i < n - 1; i++) {\n      sum += sz[i][m - 1];\n    }\n    for (j = 1; j < m; j++)\n      sum += sz[n - 1][j];\n\n    for (i = 1; i < n; i++) {\n      sum += sz[i][0];\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int b[100];\n  int m, j, r, n, k, p;\n\n  cin >> p;\n  for (m = 0; m < p; m++) {\n    scanf(\"%d %d\", &n, &k);\n    for (j = 0; j < n; j++) {\n      for (r = 0; r < k; r++) {\n        scanf(\"%d\", &a[j][r]);\n      }\n    }\n    b[m] = 0;\n    for (j = 0; j < 1; j++) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (j = n - 1; j > n - 2; j--) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = 0; r < 1; r++) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = k - 1; r > k - 2; r--) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n  }\n  for (m = 0; m < p; m++) {\n    cout << b[m] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fy();\n  int num, k;\n  scanf(\"%d\", &num);\n  for (k = 0; k < num; k++) {\n    printf(\"%d\\n\", fy());\n  }\n  return 0;\n}\nint fy() {\n  int a[100][100];\n  int sum = 0, m, n, i, j;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", *(a + i));\n    sum = sum + *(*(a + i));\n    for (j = 1; j < n; j++) {\n      scanf(\" %d\", *(a + i) + j);\n    }\n    sum = sum + *(*(a + i) + n - 1);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum = sum + a[0][i] + a[m - 1][i];\n  }\n  return sum;\n}\n"}
{"label": "6", "index": "10262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int line, row, sum;\n  int array[200][200];\n  cin >> n; \n  for (i = 1; i <= n; i++) {\n    cin >> line >> row;\n    for (j = 0; j < line; j++)\n      for (k = 0; k < row; k++)\n        cin >> array[j][k]; \n    sum = 0;\n    if (row == 1 || line == 1) { \n      for (j = 0; j < line; j++)\n        for (k = 0; k < row; k++)\n          sum = sum + array[j][k]; \n      cout << sum << endl;\n    } else {\n      sum = 0 - array[0][0] - array[0][row - 1] - array[line - 1][0] -\n            array[line - 1][row - 1]; \n      for (j = 0; j < line; j++)\n        sum = sum + array[j][0] + array[j][row - 1];\n      for (j = 0; j < row; j++)\n        sum = sum + array[0][j] + array[line - 1][j]; \n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    int m = 0, n = 0;\n    scanf(\"%d %d\", &m, &n);\n    int i = 0, j = 0, x = 0;\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += x;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10264", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, p, q, a[100][100], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int total = 0;\n    cin >> p >> q;\n    for (j = 0; j < p; j++)\n      for (k = 0; k < q; k++)\n        cin >> a[j][k];\n    for (int h = 0; h < q; h++) {\n      total += *(*a + h);\n      total += *(*(a + p - 1) + h);\n    }\n    for (int g = 0; g < p; g++) {\n      total += **(a + g);\n      total += *(*(a + g) + q - 1);\n    }\n    total -= **a;\n    total -= *(*a + q - 1);\n    total -= **(a + p - 1);\n    total -= *(*(a + p - 1) + q - 1);\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10265", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum = 0, i, j, p;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m == 1) {\n      cout << a[0][0] << endl;\n    } else if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      cout << sum << endl;\n      sum = 0;\n    } else if (n > 1 && m == 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      cout << sum << endl;\n      sum = 0;\n    } else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n    sum = 0;\n    k--;\n  }\n}\n"}
{"label": "6", "index": "10266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  const int max = 100;\n  int num;\n  scanf(\"%d \", &num);\n  while (num--) {\n    int m, n;\n    cin >> m >> n;\n    int a[max][max];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10267", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l, n, m, t, i, j;\n  cin >> t;\n  for (l = 1; l <= t; l++) {\n    scanf(\"%d%d\", &n, &m);\n    int sum = 0, a;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a);\n        if (i == 1 || j == 1 || i == n || j == m)\n          sum += a;\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N = 100;\n  int k, m, n, i, a[N][N], b[N], c, d, e[N], f[N];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d %d\", &e[i], &f[i]);\n    m = e[i];\n    n = f[i];\n    for (c = 0; c < m; c++) {\n      for (d = 0; d < n; d++) {\n        scanf(\"%d\", &a[c][d]);\n      }\n    }\n    for (c = 0; c < m; c++) {\n      b[i] = b[i] + a[c][0] + a[c][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      b[i] = b[i] + a[0][d] + a[m - 1][d];\n    }\n    cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10269", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, num[100][100], count1, count2, count3, sum;\n  int *pointer = NULL;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (count1 = 0; count1 < m; count1++) {\n      for (count2 = 0; count2 < n; count2++) {\n        cin >> num[count1][count2];\n      }\n    }\n    for (pointer = num[0]; pointer < num[0] + n; pointer++) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[m - 1]; pointer < num[m - 1] + n; pointer++) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1] + n - 1, count3 = 1; count3 < m - 1;\n         pointer = num[++count3] + n - 1) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1], count3 = 1; count3 < m - 1;\n         pointer = num[++count3]) {\n      sum = sum + *pointer;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k, m, n, a[100][100], i, j, sum = 0;\nint main() {\n  cin >> k;\n  while (k > 0) {\n    k--;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 || m == 2 || n == 1 || n == 2) {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++)\n          sum += a[i][j];\n    } else {\n      for (j = 1; j <= n; j++)\n        sum += a[1][j];\n      for (j = 1; j <= n; j++)\n        sum += a[m][j];\n      for (i = 2; i < m; i++)\n        sum += a[i][1];\n      for (i = 2; i < m; i++)\n        sum += a[i][n];\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "10271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, x, y, ans, a[101][101];\n  int(*p)[101] = a;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    ans = 0;\n    cin >> m >> n;\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        cin >> *((*p + y) + x);\n        if (x == 0 || y == 0 || x == m - 1 || y == n - 1)\n          ans = ans + *((*p + y) + x);\n      }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10272", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int a, b;\n    scanf(\"%d %d\", &a, &b);\n    int c[a][b];\n    int j, k;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        scanf(\"%d\", &c[j][k]);\n      }\n    }\n    int s = 0;\n    for (k = 0; k < b; k++) {\n      s += c[0][k];\n    }\n    for (j = 1; j < a; j++) {\n      s += c[j][b - 1];\n    }\n    for (k = 0; k < b - 1; k++) {\n      s += c[a - 1][k];\n    }\n    for (j = 1; j < a - 1; j++) {\n      s += c[j][0];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10273", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int ac[100][100], i, j, k, *p, n, a, b, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    s = 0;\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> ac[j][k];\n    for (j = 0; j < a; j++) {\n      if (j == 0 || j == a - 1)\n        for (p = ac[j]; p < ac[j] + b; p++)\n          s += *p;\n      else {\n        p = ac[j];\n        s = s + *p + *(p + b - 1);\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100], c[100], sum[100] = {0};\n  int i, j, k, p;\n  cin >> k;\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &b[p], &c[p]);\n    for (i = 0; i < b[p]; i++) {\n      for (j = 0; j < c[p]; j++)\n        scanf(\"%d\", &a[p][i][j]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (i = 0, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (i = b[p] - 1, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = 0, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = c[p] - 1, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n  }\n  for (p = 0; p < k - 1; p++)\n    printf(\"%d\\n\", sum[p]);\n  cout << sum[k - 1];\n  return 0;\n}\n"}
{"label": "6", "index": "10275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[100][100], m, n, k, i, j, s, sum;\n  cin >> k;\n  for (s = 1; s <= k; s++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        sum = sum + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++)\n        sum = sum - a[i][j];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, x, i, j, sum;\n  int m, n;\n  int a[100][100], b[100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if ((m >= 3) & (n >= 3)) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n      b[x] = sum;\n    } else {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n          sum = sum + a[i][j];\n        }\n      }\n      b[x] = sum;\n    }\n  }\n  for (x = 0; x < k; x++)\n    cout << b[x] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], b[10000], c[10000], i, l, n, sum[10000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (l = 0; l < a[i] * b[i]; l++) {\n      scanf(\"%d \", &c[l]);\n      if (l <= b[i] || l >= (b[i] * a[i] - b[i] + 1) || l % b[i] == 0 ||\n          (l + 1) % b[i] == 0)\n        sum[i] += c[l];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, q, s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n  for (q = 0; q < k; q++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(a + i) + j);\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      s = s + *(*(a + 0) + i);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + n - 1);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + 0);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(a + m - 1) + i);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, k, sum = 0, a;\n  int i, j, q, b[100];\n  int s[100][100];\n  scanf(\"%d\", &k);\n\n  for (q = 1; q <= k; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &s[i][j]);\n    }\n    for (j = 1; j <= n; j++) {\n      sum += s[1][j];\n      sum += s[m][j];\n    }\n    for (i = 1; i <= m; i++) {\n      sum += s[i][1];\n      sum += s[i][n];\n    }\n    a = s[1][1] + s[1][n] + s[m][1] + s[m][n];\n    sum -= a;\n    b[q] = sum;\n    sum = 0;\n  }\n  for (q = 1; q <= k; q++) {\n    cout << b[q] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10280", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, i, j, x, sum;\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d \", &x);\n        if ((i == 1) || (i == m) || (j == 1) || (j == n))\n          sum = sum + x;\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p, i, k, m, n, t, sum[100] = {0}, j, q, x;\n  scanf(\"%d\\n%\", &k);\n  p = (int *)malloc(10000 * sizeof(int));\n  for (x = 0; x < k; x++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    for (j = 0; j < n; j++)\n      sum[x] = sum[x] + (*(p + j)) + (*(p + n * (m - 1) + j));\n    for (q = 1; q < m - 1; q++)\n      sum[x] = sum[x] + (*(p + q * n)) + (*(p + q * n + n - 1));\n  }\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", sum[x]);\n}\n"}
{"label": "6", "index": "10282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, i, j;\n    scanf(\"%d %d \", &m, &n);\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10283", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, sum, temp, c, d, e, q, w, r, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  int m[100], n[100];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        cin >> a[j][l];\n      }\n    }\n    sum = 0;\n    temp = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n    for (j = 0; j < n[i]; j++) {\n      temp = temp + a[0][j];\n    }\n    for (j = 0; j < n[i]; j++) {\n      c = c + a[m[i] - 1][j];\n    }\n    for (j = 0; j < m[i]; j++) {\n      d = d + a[j][0];\n    }\n    for (j = 0; j < m[i]; j++) {\n      e = e + a[j][n[i] - 1];\n    }\n    if (m[i] == 1 && n[i] == 1) {\n      sum = a[0][0];\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] == 1 && n[i] != 1) {\n      for (j = 0; j < n[i]; j++)\n        sum = sum + a[0][j];\n\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] == 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[j][0];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] != 1) {\n      q = a[0][0];\n      w = a[0][n[i] - 1];\n      r = a[m[i] - 1][0];\n      t = a[m[i] - 1][n[i] - 1];\n      sum = c + d + e + temp - q - w - r - t;\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, p, q;\n  int N[100][100];\n  int m, n;\n  int sum = 0;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = 1; p <= m; p++) {\n      for (q = 1; q <= n; q++) {\n        scanf(\"%d\", &N[p][q]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[1][j];\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][1];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][n];\n    }\n    sum = sum - N[1][1] - N[1][n] - N[m][1] - N[m][n];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint haha() {\n  int m, n, sum, i, j, a[105][105];\n  cin >> m >> n;\n\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &*(*(a + i) + j));\n\n  sum = 0;\n\n  if (m == 1)\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n  else if (n == 1)\n    for (i = 1; i <= m; i++)\n      sum = sum + *(*(a + i) + 1);\n  else {\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + m) + j);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + 1);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + n);\n  }\n\n  return (sum);\n}\nint main() {\n\n  int i, j, k, l, m, n, a[1050];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    *(a + i) = haha();\n\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", *(a + i));\n}\n"}
{"label": "6", "index": "10286", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int w, k;\n  scanf(\"%d\", &w);\n  for (k = 0; k < w; k++) {\n\n    int n, m, sz[100][100], i, j;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> sz[i][j];\n    }\n    int a = 0, b = 0, c = 0, d;\n    for (j = 0; j < m; j++) {\n      a += sz[0][j];\n    }\n\n    for (j = 0; j < m; j++) {\n      b += sz[n - 1][j];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      c += sz[i][0] + sz[i][m - 1];\n    }\n    d = a + b + c;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, j;\n  int n, row, col;\n  int shuzu[1000][1000], cc[1000] = {99};\n  int result = 0;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &row, &col);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> shuzu[i][j];\n      }\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        if (i == 0) {\n          result += shuzu[i][j];\n        } else if (i == (row - 1)) {\n          result += shuzu[i][j];\n        } else {\n          if (j == 0) {\n            result += shuzu[i][j];\n          } else if (j == (col - 1)) {\n            result += shuzu[i][j];\n          }\n        }\n      }\n    }\n    cc[k] = result;\n    result = 0;\n  }\n\n  for (k = 0; k < n; k++) {\n    printf(\"%d \", cc[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, line = 0, row = 0;\n  int a[102][102];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d \", &line, &row);\n    for (int j = 0; j < line; j++) {\n      for (int k = 0; k < row; k++)\n        cin >> *(*(a + j) + k);\n    }\n    if (line == 1 && row == 1) {\n      printf(\"%d\\n\", **a);\n      continue;\n    }\n    int plus =\n        **a + *(*a + row - 1) + **(a + line - 1) + *(*(a + line - 1) + row - 1);\n    for (int j = 1; j < line - 1; j++)\n      plus += **(a + j) + *(*(a + j) + row - 1);\n    for (int j = 1; j < row - 1; j++)\n      plus += *(*a + j) + *(*(a + line - 1) + j);\n    printf(\"%d\\n\", plus);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l;\n  int k, n, m, a[100][100] = {0}, (*p)[100] = a, t = 0;\n\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= m - 1; j++)\n        scanf(\"%d\", *(p + i) + j);\n\n    for (j = 0; j <= m - 1; j++) {\n      if (n != 1) {\n        t += *(*(p) + j);\n        t += *(*(p + n - 1) + j);\n      } else\n        t += *(*(p) + j);\n    }\n    for (i = 1; i <= n - 2; i++) {\n      if (m != 1) {\n        t += *(*(p + i));\n        t += *(*(p + i) + m - 1);\n      } else\n        t += *(*(p + i));\n    }\n    cout << t << \" \";\n    t = 0;\n  }\n}\n"}
{"label": "6", "index": "10290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, y, n, s, j, h, a, k, b, sz[100][100], jieguo[100], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d\", &sz[j][k]);\n    }\n    sum = 0;\n    for (h = 0; h < b; h++) {\n      sum = sum + sz[0][h] + sz[a - 1][h];\n    }\n    for (s = 0; s < a; s++) {\n      sum = sum + sz[s][0] + sz[s][b - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][b - 1] - sz[a - 1][0] - sz[a - 1][b - 1];\n    jieguo[i] = sum;\n  }\n  for (y = 0; y < n; y++) {\n    cout << jieguo[y] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i1, i2, i3, j, total;\n  scanf(\"%d\", &k);\n  for (i1 = 1; i1 <= k; i1++) {\n    scanf(\"\\n%d %d\", &m, &n);\n    total = 0;\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      scanf(\"\\n%d\", &a[i2][0]);\n      for (i3 = 1; i3 <= n - 1; i3++) {\n        scanf(\" %d\", &a[i2][i3]);\n      }\n    }\n\n    if (m == 1 && n == 1) {\n      total = a[0][0];\n      printf(\"%d\\n\", total);\n      continue;\n    }\n    for (i2 = 0; i2 <= n - 1; i2++) {\n      total = total + a[0][i2] + a[m - 1][i2];\n    }\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      total = total + a[i2][0] + a[i2][n - 1];\n    }\n    total = total - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n\n    cout << total << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, i, m, n, k, s = 0, *b, j;\n  scanf(\"%d\", &k);\n  b = (int *)calloc(k, sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    a = (int *)calloc(m * n, sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", a + j);\n    for (j = 0; j < m; j++)\n      s = s + *(a + j * n) + *(a + j * n + n - 1);\n\n    for (j = 1; j < n - 1; j++)\n      s = s + *(a + j) + *(a + (m - 1) * n + j);\n\n    *(b + i) = s;\n    free(a);\n    s = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", *(b + i));\n    if (i < k - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "6", "index": "10293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, sum = 0;\n  int a[100][100];\n  int b[1000];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    if ((m != 1) && (n != 1)) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        sum = sum + a[m - 1][l];\n      }\n      for (j = 1; j < m - 1; j++) {\n        sum = sum + a[j][0];\n        sum = sum + a[j][n - 1];\n      }\n      b[i] = sum;\n      sum = 0;\n    } else if (m = 1) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        b[i] = sum;\n        sum = 0;\n      }\n    } else if (n = 1) {\n      for (j = 0; j < m; j++) {\n        sum = sum + a[j][0];\n        b[i] = sum;\n        sum = 0;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10294", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[101][101];\n  int n, k, row, col, i, j, sum = 0;\n\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (j = 1; j <= col; j++)\n      sum = sum + a[1][j];\n    for (i = 2; i <= row; i++)\n      sum = sum + a[i][col];\n    for (j = 1; j <= col - 1; j++)\n      sum = sum + a[row][j];\n    for (i = 2; i <= row - 1; i++)\n      sum = sum + a[i][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int res = 0;\n    scanf(\"%d%d\", &p, &q);\n    for (int i = 0; i < p; i++)\n      for (int j = 0; j < q; j++) {\n        scanf(\"%d\", &tmp);\n        if (i == 0 || j == 0 | i == p - 1 || j == q - 1)\n          res += tmp;\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10296", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\nint n, m;\nint sum(int a[1000][1000]) {\n  int sum = 0;\n  for (int i = 0; i < n; i++)\n    sum += *(a[0] + i);\n\n  for (int i = 1; i < m; i++)\n    sum += *(a[i] + (n - 1));\n\n  for (int i = n - 2; i >= 0; i--)\n    sum += *(a[m - 1] + i);\n\n  for (int i = m - 2; i >= 1; i--)\n    sum += *(a[i] + 0);\n  return sum;\n}\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> array_1[j][k];\n    printf(\"%d\\n\", sum(array_1));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum1, sum2, sum3, sum4;\n  int i, j, l;\n  int a[100][100], b[100];\n\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++)\n      sum1 = sum1 + a[0][j];\n    for (i = 1; i < m; i++)\n      sum2 = sum2 + a[i][n - 1];\n    for (j = 0; j < n - 1; j++)\n      sum3 = sum3 + a[i - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum4 = sum4 + a[i][0];\n    b[l] = sum1 + sum2 + sum3 + sum4;\n  }\n  for (l = 1; l <= k; l++)\n    printf(\"%d\\n\", b[l]);\n  return 0;\n}\n"}
{"label": "6", "index": "10298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum = 0;\n  scanf(\"%d \", &k);\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m >= 3 && n >= 3) {\n      for (i = 0; i < n; i++)\n        sum = sum + a[0][i] + a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + a[i][0] + a[i][n - 1];\n    } else {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          sum = sum + a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0, i = 0, j = 0, lin = 0, col = 0;\n  int array[105][105];\n  int sum = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> lin >> col;\n    for (int p = 0; p < lin; p++) {\n      for (int q = 0; q < col; q++) {\n        cin >> *(*(array + p) + q);\n      }\n    }\n    for (j = 0; j < col; j++) {\n      sum = sum + array[0][j];\n    }\n    for (j = 1; j < lin; j++) {\n      sum = sum + array[j][col - 1];\n    }\n    for (j = 0; j < (col - 1); j++) {\n      sum = sum + array[lin - 1][j];\n    }\n\n    for (j = 1; j < (lin - 1); j++) {\n      sum = sum + array[j][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  int a = 0, b = 0, c = 0, d = 0, e = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      a += sz[i][0];\n      b += sz[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      c += sz[0][j];\n      d += sz[m - 1][j];\n    }\n    e = a + b + c + d - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n        sz[m - 1][n - 1];\n    printf(\"%d\\n\", e);\n    e = 0;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10301", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, x[10000], sum = 0, *p;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (p = x; p < x + m * n; p++)\n      scanf(\"%d\", p);\n    for (p = x; p < x + n; p++)\n      sum = sum + *p;\n    for (p = x + (m - 1) * n; m != 1 && p < x + n * m; p++)\n      sum = sum + *p;\n    for (p = x + n; p < x + n * (m - 1); p = p + n)\n      sum = sum + *p;\n    for (p = x + n + n - 1; p < x + n * m - 1; p = p + n)\n      sum = sum + *p;\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[120][120];\n  for (int i = 0; i < n; i++) {\n    int a, b;\n    int s = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (int m = 0; m < a; m++)\n      for (int n = 0; n < b; n++) {\n        scanf(\"%d\", &num[m][n]);\n        if (m == 0 || m == a - 1 || n == 0 || n == b - 1)\n          s += num[m][n];\n      }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], n, s[100] = {0}, i, j, len, col, m, sum = 0;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    cin >> len >> col;\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> sz[i][j];\n        sum += sz[i][j];\n      }\n    }\n    if (col == 1 || len == 1) {\n      s[m] = sum;\n    } else {\n      for (j = 0; j < col - 1; j++) {\n        s[m] += sz[0][j];\n      }\n      for (i = 0; i < len - 1; i++) {\n        s[m] += sz[i][col - 1];\n      }\n      for (j = 1; j < col; j++) {\n        s[m] += sz[len - 1][j];\n      }\n      for (i = 1; i < len; i++) {\n        s[m] += sz[i][0];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid m(int, int);\nint main() {\n  int a, b, c, i;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%d\", &b, &c);\n    m(b, c);\n  }\n  return 0;\n}\nvoid m(int q, int w) {\n  int a, i, j;\n  long sum;\n  sum = 0;\n  for (i = 1; i <= q; i++) {\n    for (j = 1; j <= w; j++) {\n      scanf(\"%d\", &a);\n      if (i == 1 || j == 1 || i == q || j == w) {\n        sum += a;\n      }\n    }\n  }\n  cout << sum << \" \";\n}\n"}
{"label": "6", "index": "10305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int k;\n  scanf(\"%d\", &k);\n  int s1 = 0, s2 = 0, s3 = 0, s4 = 0, s = 0;\n  int r = 0, c = 0;\n\n  int jz[100][100];\n  int m, n;\n  int i = 1;\n  while (i <= k) {\n    scanf(\"%d %d\", &m, &n);\n    for (int jm = 0; jm < m; jm++) {\n      for (int jn = 0; jn < n; jn++) {\n        scanf(\"%d\", &jz[jm][jn]);\n      }\n    }\n    r = 0;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s1 += jz[r][c];\n    }\n    r = m - 1;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s2 += jz[r][c];\n    }\n    r = 0;\n    c = 0;\n    for (r = 0; r < m; r++) {\n      s3 += jz[r][c];\n    }\n    r = 0;\n    c = n - 1;\n    for (r = 0; r < m; r++) {\n      s4 += jz[r][c];\n    }\n    s = s1 + s2 + s3 + s4 - jz[0][0] - jz[0][n - 1] - jz[m - 1][0] -\n        jz[m - 1][n - 1];\n    printf(\"%d\", s);\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n\n    if (i != k) {\n      printf(\"\\n\");\n    }\n\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, k, m, n, *p, sum1 = 0, sum2 = 0, *sum;\n  p = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  sum = (int *)malloc(1000 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      sum1 = sum1 + *(p + j);\n    }\n    for (a = 1; a < m - 1; a++) {\n      for (b = 1; b < n - 1; b++) {\n        sum2 += *(p + a * n + b);\n      }\n    }\n    *(sum + i) = sum1 - sum2;\n    sum1 = 0;\n    sum2 = 0;\n  }\n  for (i = 0; i < k; i++) {\n    cout << *(sum + i) << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10307", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, x, a[100][100] = {{0, 0}}, m, n, i, j, sum = 0;\n  cin >> k;\n  for (x = 1; x <= k; x++) {\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n        if (i == 0 || j == 0 || i == (m - 1) || j == (n - 1)) {\n          sum = sum + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) \n  {\n    int m, n, a[100][100], j, l, sum = 0; \n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        cin >> a[j][l]; \n    for (j = 0; j < m; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1); \n    for (j = 1; j < n - 1; j++)\n      sum = sum + *(*a + j) + *(*(a + m - 1) + j); \n    cout << sum << endl;                           \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, s = 0;\n  int m, n;\n  cin >> k;\n  int a[100][100];\n  int *p = &a[0][0];\n  for (int t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      s += *(*(a + 0) + i);\n      s += *(*(a + m - 1) + i);\n    }\n    for (int i = 0; i < m; i++) {\n      s += *(*(a + i) + 0);\n      s += *(*(a + i) + n - 1);\n    }\n    s = s - **a - *(*(a + m - 1) + n - 1) - *(*(a + 0) + n - 1) -\n        *(*(a + m - 1));\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, row[99], col[99], s[99][99][99], sum[99] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> row[i] >> col[i];\n    for (j = 0; j < row[i]; j++) {\n      for (k = 0; k < col[i]; k++) {\n        scanf(\"%d\", &s[i][j][k]);\n        if ((j == 0) || (k == 0) || (j == (row[i] - 1)) || (k == col[i] - 1)) {\n          sum[i] += s[i][j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, jz[100][100], sum = 0;\n  cin >> k;\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> jz[i][j];\n    }\n    if (m == 1 && n == 1)\n      sum = jz[0][0];\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i] + jz[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + jz[i][0] + jz[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, k = 0, x, y, an[100][100], sum[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &x, &y);\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        scanf(\"%d\", &an[j][k]);\n        if (j == 0 || j == x - 1 || k == 0 || k == y - 1) {\n          sum[i] += an[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint mat[1000][1000];\nint main() {\n\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n    for (int j = 0; j < n; j++) {\n      if (m > 1)\n        sum += mat[m - 1][j];\n      sum += mat[0][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      if (n > 1)\n        sum += mat[i][n - 1];\n      sum += mat[i][0];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  for (i; i <= n; i++) {\n    int p, q;\n    scanf(\"%d %d\", &p, &q);\n    int a[10000];\n    for (int j = 0; j < p * q; j++)\n      cin >> a[j];\n    int sum = 0;\n    int m = 0;\n    while (m < q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = (p - 1) * q;\n    while (m < p * q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = 1;\n    while (m < p - 1) {\n      sum = sum + a[q * m];\n      m++;\n    }\n    m = 2;\n    while (m < p) {\n      sum = sum + a[q * m - 1];\n      m++;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l;\n  int k, n, m, a[100][100] = {0}, (*p)[100] = a, t = 0;\n\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= m - 1; j++)\n        scanf(\"%d\", *(p + i) + j);\n\n    for (j = 0; j <= m - 1; j++) {\n      if (n != 1) {\n        t += *(*(p) + j);\n        t += *(*(p + n - 1) + j);\n      } else\n        t += *(*(p) + j);\n    }\n    for (i = 1; i <= n - 2; i++) {\n      if (m != 1) {\n        t += *(*(p + i));\n        t += *(*(p + i) + m - 1);\n      } else\n        t += *(*(p + i));\n    }\n    printf(\"%d \", t);\n    t = 0;\n  }\n}\n"}
{"label": "6", "index": "10316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int x, y;\n  int a[100][100];\n  int i, j, k, l, m;\n  int s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x >> y;\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        cin >> a[j][k];\n      }\n    }\n    s = 0;\n    for (l = 0; l < y; l++) {\n      s = s + a[0][l] + a[x - 1][l];\n    }\n    for (m = 1; m < x - 1; m++)\n      s = s + a[m][0] + a[m][y - 1];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, j, a;\n  for (scanf(\"%d\", &k); k > 0; k--) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n    }\n    for (i = 1; i < m - 1; i++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n      for (j = 1; j < n; j++)\n        scanf(\"%d\", &a);\n      if (n != 1)\n        s = s + a;\n    }\n    if (m != 1)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a);\n        s = s + a;\n      }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10318", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int a[100][100];\n  cin >> k; \n  int m, n;\n  int i, j;\n  int sum;\n  for (int l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n; \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j); \n      }\n    for (j = 0; j < n; j++) {\n      if (m - 1 != 0)\n        sum += *(*(a + 0) + j) + *(*(a + m - 1) + j); \n      else\n        sum += *(*(a + 0) + j); \n    }\n    for (i = 1; i < m - 1; i++) {\n      sum += *(*(a + i) + 0) + *(*(a + i) + n - 1); \n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  int m = 0, n = 0;\n  int a[100][100] = {0};\n  int sum = 0;\n  scanf(\"%d \", &k);\n  int(*p)[100] = NULL;\n  p = a;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    for (int a = 0; a < n; a++) {\n      sum = sum + *(*(p + 0) + a);\n    }\n    for (int a = 1; a < m; a++) {\n      sum = sum + *(*(p + a) + n - 1);\n    }\n    for (int a = n - 2; a >= 0; a--) {\n      sum = sum + *(*(p + m - 1) + a);\n    }\n    for (int a = m - 2; a > 0; a--) {\n      sum = sum + *(*(p + a) + 0);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, c, d;\n  c = 0;\n  scanf(\"%d\", &k);\n  int sz[100][100];\n  int yi[100];\n  int er[100];\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[0][b];\n    }\n    yi[a] = d;\n    d = 0;\n    for (b = 0; b < n; b++) {\n      d += sz[m - 1][b];\n    }\n    er[a] = d;\n    d = yi[a] + er[a];\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][0];\n    }\n    for (b = 1; b <= (m - 2); b++) {\n      d += sz[b][n - 1];\n    }\n\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a[100];\n  int k, *m, *n, i, plus = 0, j, l;\n  scanf(\"%d\", &k);\n  m = (int *)malloc(100 * sizeof(int));\n  n = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", m + i);\n    scanf(\"%d\", n + i);\n    a[i] = (int *)malloc(((*(m + i)) * (*(n + i))) * sizeof(int));\n    for (j = 0; j < *(m + i); j++) {\n      for (l = 0; l < *(n + i); l++)\n        scanf(\"%d\", a[i] + (j * (*(n + i)) + l));\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < *(m + i); j++) {\n      plus = plus + (*(a[i] + (j * (*(n + i)))));\n      plus = plus + (*(a[i] + ((j + 1) * (*(n + i)) - 1)));\n    }\n    for (l = 1; l < (*(n + i)) - 1; l++) {\n      plus = plus + (*(a[i] + l));\n      plus = plus + (*(a[i] + l + (*(m + i) - 1) * (*(n + i))));\n    }\n    printf(\"%d\\n\", plus);\n    plus = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10322", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], sz[100][100], i, j, k;\n  int m[100] = {0}, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> y[i];\n    for (j = 0; j < x[i]; j++) {\n      for (k = 0; k < y[i]; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == x[i] - 1 || j == 0 || k == y[i] - 1 || k == 0) {\n          m[p] += sz[j][k];\n        }\n      }\n    }\n    p++;\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, a[100][100], i, j, sum, t;\n  scanf(\"%d\", &t);\n  while (t--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m > 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0] + a[i][n - 1];\n    else\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n > 1)\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i];\n    else\n      for (i = 1; i < n - 1; i++)\n        sum += a[0][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, n = 0, m = 0, i = 0, w = 0, j = 0, sum = 0,\n      s[101][101] = {0}; \n  cin >> k;\n  for (w = 1; w <= k; w++) {\n    sum = 0;\n    cin >> n >> m;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= m; j++) {\n        cin >> *(s[i] + j);\n        if ((i == 1) || (i == n) || (j == 1) || (j == m))\n          sum += *(s[i] + j);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, t, j, sum, m, n;\n  scanf(\"%d\\n\", &t);\n  for (j = 0; j < t; j++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (i = 1; i <= m * n; i++) {\n      scanf(\"%d\", &a);\n      if ((i <= n) || (i > (m * n - n)) || (i % n == 1) || (i % n == 0))\n        sum += a;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100][100];\n  int k, i, g, t, r;\n  int s[100];\n  int z[100];\n  cin >> k;\n  for (g = 0; g <= k - 1; g++) {\n    scanf(\"%d %d\", &s[g], &z[g]);\n    for (i = 0; i <= s[g] - 1; i++) {\n      for (t = 0; t <= z[g] - 1; t++) {\n        scanf(\"%d\", &sz[g][i][t]);\n      }\n    }\n  }\n\n  for (g = 0; g <= k - 1; g++) {\n    if (s[g] >= 3 && z[g] >= 3) {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        r = r + sz[g][i][0] + sz[g][i][z[g] - 1];\n      }\n      for (t = 1; t <= z[g] - 2; t++) {\n        r = r + sz[g][0][t] + sz[g][s[g] - 1][t];\n      }\n      printf(\"%d\\n\", r);\n    } else {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        for (t = 0; t <= z[g] - 1; t++) {\n          r = r + sz[g][i][t];\n        }\n      }\n      printf(\"%d\\n\", r);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10327", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  scanf(\"%d \", &k);\n  int u;\n  for (u = 1; u <= k; u++) {\n    int i, j;\n    scanf(\"%d %d \", &m, &n);\n    int input[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> input[i][j];\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      sum += input[i][0] + input[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum += input[0][j] + input[m - 1][j];\n    }\n    sum = sum - input[0][0] - input[0][n - 1] - input[m - 1][0] -\n          input[m - 1][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][100], i, j, m, n, sum = 0;\n  cin >> k;\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n      if (m - 1 == 0)\n        sum = sum - a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n      if (n - 1 == 0)\n        sum = sum - a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100] = {0};\n  int *p, i1, i2, sum = 0;\n\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i1 = 0; i1 < m; i1++) {\n      p = a[i1];\n      for (i2 = 0; i2 < n; i2++) {\n        scanf(\"%d\", p);\n        sum = sum + *p;\n        p++;\n      }\n    }\n    for (i1 = 1; i1 < m - 1; i1++) {\n      p = a[i1];\n      p++;\n      for (i2 = 1; i2 < n - 1; i2++) {\n        sum = sum - *p;\n        p++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++)\n    s += *(*(p + 1) + i);\n  for (i = 2; i <= m; i++)\n    s += *(*(p + i) + n);\n  for (i = n - 1; i >= 1; i--)\n    s += *(*(p + m) + i);\n  for (i = m - 1; i > 1; i--)\n    s += *(*(p + i) + 1);\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    cout << juzhen(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[101][101];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int sum = 0;\n    for (int i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++) {\n      sum = sum + a[0][i] + a[m - 1][i];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sz[100][100];\n  int i, r, sum1, sum2, sum;\n  scanf(\"%d\", &k);\n  for (int j = 1; j <= k; j++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &sz[i][r]);\n      }\n    }\n    sum1 = 0;\n    for (int q = 0; q < n; q++) {\n      sum1 += sz[0][q] + sz[m - 1][q];\n    }\n    sum2 = 0;\n    for (int w = 0; w < m; w++)\n      sum2 += sz[w][n - 1] + sz[w][0];\n\n    sum =\n        sum1 + sum2 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    char a[100][100];\n    int j, l;\n\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l];\n    } else {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l] + a[m - 1][l];\n    }\n    if (n == 1) {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0];\n    } else {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0] + a[j][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10334", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[200][200];\n  int *p[200];\n  for (int i = 0; i <= 200; i++)\n    p[i] = array[i];\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0, sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> p[j][l];\n        if (j == 0 || l == 0 || j == m - 1 || l == n - 1) {\n          sum += p[j][l];\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  cin >> t;\n  while (t--) {\n    int a[100][100], sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j); \n      }\n    }\n    for (int i = 0; i < m; i++) \n    {\n      if (n > 1) \n        sum += (**(a + i) + *(*(a + i) + n - 1));\n      else \n        sum += **(a + i);\n    }\n    for (int i = 1; i < n - 1; i++) {\n      if (m > 1) \n        sum += (*(*a + i) + *(*(a + m - 1) + i));\n      else \n        sum += *(*a + i);\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10336", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, j, k, l, m, n, x, s; \n  cin >> k;                   \n  for (i = 1; i <= k; i++)    \n  {\n    cin >> m >> n; \n    for (j = 1, s = 0, m--; j <= n;\n         j++) \n    {\n      cin >> x; \n      s += x;   \n    }\n    for (j = 2; j <= m; j++) \n      for (l = 1; l <= n; l++) {\n        cin >> x;                 \n        if ((l == 1) || (l == n)) \n          s += x;\n      }\n    for (j = 1; j <= n; j++) \n    {\n      cin >> x; \n      s += x;   \n    }\n    cout << s << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sum(int i) {\n  int m, n, j, k, sum = 0;\n  scanf(\"%d %d\", &m, &n);\n  int(*p)[100] = (int(*)[100])calloc(100, 100 * sizeof(int));\n  for (j = 0; j < m; j++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", *(p + j) + k);\n  }\n  for (j = 0; j < m; j++) {\n    if (j == 0 || j == m - 1) {\n      for (k = 0; k < n; k++)\n        sum = sum + *(*(p + j) + k);\n    } else\n      sum = sum + *(*(p + j)) + *(*(p + j) + n - 1);\n  }\n  cout << sum << \"\\n\";\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sum(i);\n}\n"}
{"label": "6", "index": "10338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, k, i, j, sum;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1)\n          continue;\n        if (j == 0 || j == n - 1)\n          continue;\n        a[i][j] = 0;\n      }\n    }\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        sum += a[i][j];\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10339", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, sum = 0;\n  int a[100][100];\n  int b[1000];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    if ((m != 1) && (n != 1)) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        sum = sum + a[m - 1][l];\n      }\n      for (j = 1; j < m - 1; j++) {\n        sum = sum + a[j][0];\n        sum = sum + a[j][n - 1];\n      }\n      b[i] = sum;\n      sum = 0;\n    } else if (m = 1) {\n      for (l = 0; l < n; l++) {\n        sum = sum + a[0][l];\n        b[i] = sum;\n        sum = 0;\n      }\n    } else if (n = 1) {\n      for (j = 0; j < m; j++) {\n        sum = sum + a[j][0];\n        b[i] = sum;\n        sum = 0;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], i, j, l, sum = 0;\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + sz[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + sz[i][n - 1];\n    }\n    for (j = 0; j < n - 1; j++) {\n      sum = sum + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10341", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid function_1() {\n  int a[110][110], (*p)[110];\n  int n, m, i, sum = 0, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < m; j++)\n      cin >> a[i][j];\n  p = a;\n  for (i = 0; i < m; i++) {\n    sum += *(*p + i);\n    if (n > 1)\n      sum += *(*(p + n - 1) + i);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum += **(p + i);\n    if (m > 1)\n      sum += *(*(p + i) + m - 1);\n  }\n  cout << sum << endl;\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    function_1();\n  return 0;\n}\n"}
{"label": "6", "index": "10342", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int i, j, a, b, x[100][100], sum = 0;\n    cin >> a >> b;\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        cin >> x[i][j];\n      }\n    }\n    for (i = 0; i < b; i++) {\n      sum = sum + x[0][i] + x[a - 1][i];\n    }\n    for (i = 1; i < a - 1; i++) {\n      sum = sum + x[i][0] + x[i][b - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  int juzhen[100][100];\n  int m = 0, n = 0;\n  cin >> k;\n  while (k > 0) {\n    m = 0;\n    n = 0;\n    memset(juzhen, 0, sizeof(juzhen));\n    cin >> m >> n;\n    int i = 0, j = 0, sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> juzhen[i][j];\n      }\n    }\n    for (i = 0; i <= n - 1; i++)\n      sum = sum + *(*(juzhen) + i);\n\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen + m - 1) + i);\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j));\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j) + n - 1);\n    }\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, e, f, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &e, &f);\n    int a[100][100];\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        a[i][j] = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < e; i++) {\n      h = h + a[i][0] + a[i][f - 1];\n    }\n    for (j = 1; j < f - 1; j++) {\n      h = h + a[0][j] + a[e - 1][j];\n    }\n    printf(\"%d \", h);\n    h = 0;\n    e = 0;\n    f = 0;\n  }\n}\n"}
{"label": "6", "index": "10345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, ROW[100], COL[100], row, col, a[100][100], s = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &ROW[i], &COL[i]);\n\n    for (row = 0; row < ROW[i]; row++) {\n      for (col = 0; col < COL[i]; col++) {\n        scanf(\"%d\", &a[row][col]);\n      }\n    }\n\n    for (col = 0; col < COL[i]; col++) {\n      s = s + a[0][col] + a[ROW[i] - 1][col];\n    }\n    for (row = 1; row < ROW[i] - 1; row++) {\n      s = s + a[row][0] + a[row][COL[i] - 1];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n;\n  int a[110][110];\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    if (m > 1 && n > 1) {\n      for (int t1 = 0; t1 < m; t1++) {\n        for (int t2 = 0; t2 < n; t2++)\n          cin >> *(*(a + t1) + t2);\n      }\n      for (int k1 = 0; k1 < n; k1++)\n        sum = sum + *(*(a + 0) + k1);\n      for (int k2 = 0; k2 < n; k2++)\n        sum = sum + *(*(a + m - 1) + k2);\n      for (int k3 = 0; k3 < m; k3++)\n        sum = sum + *(*(a + k3) + 0);\n      for (int k4 = 0; k4 < m; k4++)\n        sum = sum + *(*(a + k4) + n - 1);\n      sum = sum - *(*(a + 0) + 0) - *(*(a + m - 1) + n - 1) -\n            *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0);\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cin >> sum;\n      printf(\"%d\\n\", sum);\n    } else if (m == 1 && n > 1) {\n      for (int p1 = 0; p1 < n; p1++) {\n        cin >> *(*(a + 0) + p1);\n        sum = sum + *(*(a + 0) + p1);\n      }\n      cout << sum << endl;\n    } else if (m > 1 && n == 1) {\n      for (int p2 = 0; p2 < m; p2++) {\n        cin >> *(*(a + p2) + 0);\n        sum = sum + *(*(a + p2) + 0);\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10347", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  int m = 0, n = 0;\n  int a[100][100] = {0};\n  int sum = 0;\n  cin >> k;\n  int(*p)[100] = NULL;\n  p = a;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    for (int a = 0; a < n; a++) {\n      sum = sum + *(*(p + 0) + a);\n    }\n    for (int a = 1; a < m; a++) {\n      sum = sum + *(*(p + a) + n - 1);\n    }\n    for (int a = n - 2; a >= 0; a--) {\n      sum = sum + *(*(p + m - 1) + a);\n    }\n    for (int a = m - 2; a > 0; a--) {\n      sum = sum + *(*(p + a) + 0);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[110][110];\n  int num, sum = 0;\n  int k, m, n, i, j, l;\n\n  scanf(\"%d \", &k);\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num;\n        a[i][j] = num;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum = sum + a[0][i];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][n - 1];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][0];\n    }\n    for (i = 1; i < n - 1; i++)\n      sum = sum + a[m - 1][i];\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  for (int z = 0; z < k; z++) {\n    int num[100][100], m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &num[j][i]);\n      }\n    }\n    int sum = 0;\n    \n    for (int i = 0; i < m; i++) {\n      sum = sum + num[i][0] + num[i][n - 1];\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + num[0][i] + num[m - 1][i];\n    }\n    sum = sum - num[0][0] - num[0][n - 1] - num[m - 1][0] - num[m - 1][n - 1];\n    if (z != 0) {\n      printf(\"\\n\");\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, line;\n  int i, j, judge = 0, t, T, sum;\n  scanf(\"%d\", &t);\n  for (T = 0; T < t; T++) {\n    sum = 0;\n    scanf(\"%d %d\", &row, &line);\n    if (row == 1 || line == 1) {\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          scanf(\"%d\", (*(a + i) + j));\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          sum += *(*(a + i) + j);\n      cout << sum << \"\\n\";\n      return 0;\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        scanf(\"%d\", (*(a + i) + j));\n      }\n    }\n    for (i = 0; i < row; i++) {\n      sum += *(*(a + i) + 0);\n      sum += *(*(a + i) + line - 1);\n    }\n    for (j = 0; j < line; j++) {\n      sum += *(*(a + 0) + j);\n      sum += *(*(a + row - 1) + j);\n    }\n    sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + line - 1) -\n          *(*(a + row - 1) + line - 1) - *(*(a + row - 1) + 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10351", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint sum(int m, int n) {\n  int i, j, sz[100][100], num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  for (i = 0, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = m - 1, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = 1, j = 0; i < m - 1; i++)\n    num += sz[i][j];\n  for (i = 1, j = n - 1; i < m - 1; i++)\n    num += sz[i][j];\n  return num;\n}\n\nint main() {\n  int k, i, num, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    num = sum(m, n);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, sum;\n  int i, j, l;\n  int a[101][101];\n  int m, n;\n  sum = 0;\n  scanf(\"%d \", &k);\n\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 1; j <= n; j++)\n      sum = sum + a[1][j] + a[m][j];\n    for (j = 2; j <= m - 1; j++)\n      sum = sum + a[j][1] + a[j][n];\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, t;\n  for (t = 0; t < n; t++) {\n    int h, l;\n    int sum = 0;\n    scanf(\"%d %d\", &h, &l);\n    int a[100][100] = {0};\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    if (h == 1)\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i];\n    else if (l == 1)\n      for (j = 0; j < h; j++)\n        sum = sum + a[j][0];\n    else {\n\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i] + a[h - 1][i];\n      for (j = 1; j < h - 1; j++)\n        sum = sum + a[j][0] + a[j][l - 1];\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10354", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  for (int z = 0; z < num; z++) {\n    int a, b;\n    cin >> a >> b;\n    int juzhen[100][100];\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> juzhen[i][j];\n    int sum = 0;\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[0][i];\n    for (int j = 1; j < a - 1; j++) {\n      sum = sum + juzhen[j][0];\n      sum = sum + juzhen[j][b - 1];\n    }\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[a - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    int row, col, count = 0, i, j;\n    cin >> row >> col;\n    int str[101][101];\n    for (i = 1; i <= row; i++)\n      for (j = 1; j <= col; j++) {\n        cin >> *(*(str + i) + j);\n      }\n    for (i = 1; i <= col; i++)\n      count = count + *(*(str + 1) + i);\n    for (i = 2; i <= row; i++)\n      count = count + *(*(str + i) + col);\n    for (i = col - 1; i >= 1; i--)\n      count = count + *(*(str + row) + i);\n    for (i = row - 1; i >= 2; i--)\n      count = count + *(*(str + i) + 1);\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int x, y;\n  int a[100][100];\n  int i, j, k, l, m;\n  int s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> x >> y;\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++)\n        cin >> a[j][k];\n    }\n    s = 0;\n    for (l = 0; l < y; l++)\n      s = s + a[0][l] + a[x - 1][l];\n\n    for (m = 1; m < x - 1; m++)\n      s = s + a[m][0] + a[m][y - 1];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, row, col, c[100][100], result[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        scanf(\"%d\", *(c + j) + k);\n        if (k == 0 || k == col - 1 || j == 0 || j == row - 1)\n          result[i] += *(*(c + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n}\n"}
{"label": "6", "index": "10358", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t; \n  cin >> t;\n  for (int r = 1; r <= t; r++) \n  {\n    int m, n;\n    cin >> m >> n;        \n    int juzhen[100][100]; \n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];    \n    int *p;                     \n    int sum = 0;                \n    for (int s = 0; s < m; s++) \n    {\n      if (s == 0 || s == m - 1) \n      {\n        for (p = juzhen[s]; p <= &juzhen[s][n - 1]; p++) \n          sum = sum + (*p);\n      } else \n      {\n        p = juzhen[s];\n        sum = sum + (*p) + *(p + n - 1);\n      }\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[100][100];\n  int k, i, x, y;\n  int m, n;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (x = 0; x < m; x++) {\n      for (y = 0; y < n; y++) {\n        cin >> *(*(number + x) + y);\n      }\n    }\n    if (n == 1 && m == 1)\n      cout << **number << endl;\n    else {\n      for (x = 0; x < m; x++) {\n        sum += *(*(number + x));\n        sum += *(*(number + x) + n - 1);\n      }\n\n      for (y = 0; y < n; y++) {\n        sum += *(*(number) + y);\n        sum += *(*(number + m - 1) + y);\n      }\n\n      sum = sum - *(*(number)) - *(*(number) + n - 1) - *(*(number + m - 1)) -\n            *(*(number + m - 1) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar name[100];\ndouble s[100];\nint num[1000][1000];\nint main() {\n  int i = 0, j = 0, n, m, sum = 0, k = 0, flag = 0, p = 0, a = 0, c = 0, b = 0,\n      q = 0;\n\n  scanf(\"%d\", &a);\n\n  while (p < a) {\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &num[i][j]);\n        if (i == 0)\n          sum += num[i][j];\n        if (i == n - 1)\n          sum += num[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < n - 1; j++) {\n        if (i == 0)\n          sum += num[j][i];\n        if (i == m - 1)\n          sum += num[j][i];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    p++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, j, t, r, k, m, n, a[1000] = {0}, b[100][100] = {0}, sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n\n    for (t = 0; t < m; t++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &b[t][r]);\n        if (r == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    if (m == 1)\n      for (j = 0; j <= n - 1; j++)\n        sum += b[0][j];\n    else if (n == 1) {\n      for (j = 0; j <= m - 1; j++)\n        sum += b[j][0];\n    } else {\n      for (j = 0; j < n - 1; j++)\n        sum += *(b[0] + j);\n      for (j = 0; j < m - 1; j++)\n        sum += *(b[j] + n - 1);\n      for (j = n - 1; j > 0; j--)\n        sum += *(b[m - 1] + j);\n      for (j = m - 1; j > 0; j--)\n        sum += *(b[j] + 0);\n    }\n    a[i] = sum;\n    sum = 0;\n  }\n\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", a[i]);\n}\n"}
{"label": "6", "index": "10362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, m, n;\nint arr[105][105];\n\nint main() {\n  cin >> k;\n  while (k--) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> arr[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += arr[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, b[101][101], sum[1000];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> b[i][j];\n      }\n    }\n\n    sum[l] = 0;\n    for (j = 1; j <= n; j++)\n      sum[l] += b[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += b[m][j];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][1];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][n];\n  }\n  if (k == 1)\n    cout << sum[1];\n  else {\n    cout << sum[1];\n    for (l = 2; l <= k; l++) {\n      cout << endl;\n      cout << sum[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10364", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, x, a[100][100] = {{0, 0}}, m, n, i, j, sum = 0;\n  scanf(\"%d \", &k);\n  for (x = 1; x <= k; x++) {\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n        if (i == 0 || j == 0 || i == (m - 1) || j == (n - 1)) {\n          sum = sum + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, row = 0, line = 0, l = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  int a = 0, b = 0, c = 0, d = 0;\n  int total = 0, extra = 0;\n  scanf(\"%d\", &n);\n  while (l < n) {\n    scanf(\"%d %d\", &row, &line);\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < line; j++)\n        scanf(\"%d\", &Matrix[i][j]);\n    if (row == 1 || line == 1)\n      for (int i = 0; i < row; i++)\n        for (int j = 0; j < line; j++)\n          total += Matrix[i][j];\n    else {\n      extra = Matrix[0][0] + Matrix[0][line - 1] + Matrix[row - 1][0] +\n              Matrix[row - 1][line - 1];\n      for (int i = 0; i < line; i++) {\n        a += Matrix[0][i];\n        c += Matrix[row - 1][i];\n      }\n      for (int i = 0; i < row; i++) {\n        b += Matrix[i][0];\n        d += Matrix[i][line - 1];\n      }\n      total = a + b + c + d - extra;\n    }\n    printf(\"%d\\n\", total);\n    l++;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  while (n--) {\n    int x, y, sum = 0;\n    cin >> x >> y;\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        cin >> a[i][j];\n      }\n    for (int i = 0; i < x; i++) {\n      if (y != 1)\n        sum += a[i][0] + a[i][y - 1];\n      else {\n        sum += a[i][0];\n      }\n    }\n    for (int j = 1; j < y - 1; j++) {\n      sum += a[0][j] + a[x - 1][j];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, i;\n  int h, s, t, p;\n  int sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n, &m);\n    for (a = 0; a < n; a++) {\n      for (b = 0; b < m; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    h = 0, s = 0, t = 0, p = 0;\n    for (b = 0; b < m; b++) {\n      h = h + sz[0][b];\n      if (n > 1) {\n        s = s + sz[n - 1][b];\n      }\n    }\n    for (a = 1; a < n - 1; a++) {\n      t = t + sz[a][0];\n      if (m > 1) {\n        p = p + sz[a][m - 1];\n      }\n    }\n    result[i] = h + s + t + p;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, j, l, s = 0, A[110];\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> *(A + l);\n      if (j == 0 || j == m - 1) {\n        for (l = 0; l < n; l++)\n          s = s + *(A + l);\n      } else\n        s = s + *A + *(A + n - 1);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, l, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((m == 1) && (n == 1))\n      printf(\"%d\\n\", a[0][0]);\n    else if (m == 1) {\n      s = 0;\n      for (j = 0; j < n; j++)\n        s = s + a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      s = 0;\n      for (j = 0; j < m; j++)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    } else {\n      s = 0;\n      for (j = 0; j < n - 1; j++)\n        s = s + a[0][j];\n      for (j = 0; j < m - 1; j++)\n        s = s + a[j][n - 1];\n      for (j = n - 1; j > 0; j--)\n        s = s + a[m - 1][j];\n      for (j = m - 1; j > 0; j--)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int p, q, i, j;\n    cin >> p >> q;\n    int a[p][q], sum = 0;\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < q; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (i = 0; i < q; i++) {\n      sum = sum + a[0][i] + a[p - 1][i];\n    }\n    for (j = 0; j < p; j++) {\n      sum = sum + a[j][0] + a[j][q - 1];\n    }\n    sum = sum - a[0][0] - a[0][q - 1] - a[p - 1][0] - a[p - 1][q - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10371", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  const int max = 100;\n  int num;\n  cin >> num;\n  while (num--) {\n    int m, n;\n    cin >> m >> n;\n    int a[max][max];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int j, n, k, i, m, l, sum;\n\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", (&sz[i][j]));\n      }\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      sum += sz[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      sum += sz[m - 1][j];\n    }\n    j = 0;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][n - 1];\n    }\n\n    cout << sum << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10373", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int t = 0; t < k; t++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (int i = 0; i < n; i++) {\n        sum += *(*(a) + i);\n      }\n      cout << sum << endl;\n      continue;\n    }\n    if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    for (int i = 0; i < n; i++)\n      sum = sum + *(*(a) + i) + *(*(a + m - 1) + i);\n    for (int i = 0; i < m; i++)\n      sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n    printf(\"%d\\n\", sum - *(*(a)) - *(*(a) + n - 1) - *(*(a + m - 1)) -\n                       *(*(a + m - 1) + n - 1));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  while (n--) {\n    int x, y, sum = 0;\n    cin >> x >> y;\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        cin >> a[i][j];\n      }\n    for (int i = 0; i < x; i++) {\n      if (y != 1)\n        sum += a[i][0] + a[i][y - 1];\n      else\n        sum += a[i][0];\n    }\n    for (int j = 1; j < y - 1; j++) {\n      sum += a[0][j] + a[x - 1][j];\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10375", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int i, j, a, b, x[100][100], sum = 0;\n    cin >> a >> b;\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        cin >> x[i][j];\n      }\n    for (i = 0; i < b; i++) {\n      sum = sum + x[0][i] + x[a - 1][i];\n    }\n    for (i = 1; i < a - 1; i++) {\n      sum = sum + x[i][0] + x[i][b - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10376", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, k, m, n, *p, sum1 = 0, sum2 = 0, *sum;\n  p = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  sum = (int *)malloc(1000 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      sum1 = sum1 + *(p + j);\n    }\n    for (a = 1; a < m - 1; a++) {\n      for (b = 1; b < n - 1; b++) {\n        sum2 += *(p + a * n + b);\n      }\n    }\n    *(sum + i) = sum1 - sum2;\n    sum1 = 0;\n    sum2 = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", *(sum + i));\n  }\n}\n"}
{"label": "6", "index": "10377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m, n, sum = 0;\n  int i, j, p;\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (i = m - 1, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = 0, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = n - 1, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    sum = sum - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10378", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][100], i, j, m, n, sum = 0;\n  scanf(\"%d \", &k);\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n      if (m - 1 == 0)\n        sum = sum - a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n      if (n - 1 == 0)\n        sum = sum - a[i][n - 1];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m[100], n[100], he[100];\n  int a[100][100];\n  int i, j, l, total;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        cin >> a[j][l];\n      }\n    }\n    total = 0;\n    for (l = 0; l < n[i]; l++) {\n      total = total + a[0][l] + a[m[i] - 1][l];\n    }\n    for (j = 1; j < m[i] - 1; j++) {\n      total = total + a[j][0] + a[j][n[i] - 1];\n    }\n    he[i] = total;\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d\\n\", he[i]);\n  }\n  cout << he[k - 1];\n\n  return 0;\n}\n"}
{"label": "6", "index": "10380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j1, j2, e1, e2, sum;\n  int juzhen[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j1 = 0; j1 < m; j1++) {\n      for (e1 = 0; e1 < n; e1++) {\n        cin >> juzhen[j1][e1];\n      }\n    }\n    sum = 0;\n    for (j2 = 0; j2 < n; j2++) {\n      sum = sum + juzhen[0][j2] + juzhen[m - 1][j2];\n    }\n    for (e2 = 1; e2 < m - 1; e2++) {\n      sum = sum + juzhen[e2][0] + juzhen[e2][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[100][100];\nvoid a() {\n  memset(m, 0, sizeof(m));\n  int x, y, count = 0, sum = 0;\n  cin >> x >> y;\n  int *p = m[0];\n  for (; p <= m[x - 1] + y - 1; p++) {\n    count++;\n    cin >> *p;\n    if (count == 1 || count == y)\n      sum += *p;\n    else if (p <= m[0] + y - 1)\n      sum += *p;\n    else if (m[x - 1] <= p && p <= m[x - 1] + y - 1)\n      sum += *p;\n    if (count == y) {\n      p = p + 100 - y;\n      count = 0;\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    a();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10382", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, **p, i, j, sum, m, n, l;\n  scanf(\"%d\", &N);\n  for (l = 0, sum = 0; l < N; l++) {\n    scanf(\"%d %d \", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      *(p + i) = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, o = 0, i = 0, j = 0, m = 0, n = 0, num = 0, sum = 0;\n  cin >> k;\n  for (o = 0; o < k; o++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &num);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum = sum + num;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10384", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, sz[100][100], m, n, p, i, j, s[100] = {0};\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> (sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      s[p] = sz[0][0];\n    } else {\n      for (j = 0; j < n; j++) {\n        s[p] = s[p] + sz[0][j] + sz[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        s[p] = s[p] + sz[i][0] + sz[i][n - 1];\n      }\n      s[p] = s[p] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n  }\n  for (p = 0; p < k; p++) {\n    printf(\"%d\\n\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, k, j, p, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (p = 1; p <= n; p++) {\n        scanf(\"%d\", &a[j][p]);\n      }\n    }\n    for (p = 1; p <= n; p++) {\n      sum += a[1][p];\n    }\n    for (j = 2; j <= m; j++) {\n      sum += a[j][n];\n    }\n    for (p = n - 1; p >= 1; p--) {\n      sum += a[m][p];\n    }\n    for (j = m - 1; j >= 2; j--) {\n      sum += a[j][1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10386", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n\n  for (k = n - 2; k >= 0; k--) {\n\n    s += a[m - 1][k];\n  }\n\n  for (i = m - 2; i > 0; i--) {\n    s += a[i][0];\n  }\n  printf(\"%d\\n\", s);\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, N, i, j, a, b, sum = 0;\n  int data[1000][1000];\n  scanf(\"%d\", &N);\n  for (n = 0; n < N; n++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", &data[i][j]);\n      }\n    }\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += data[i][j];\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, i, j, a, t;\n\n  scanf(\"%d\", &a);\n  for (t = 1; t <= a; t++) {\n    int s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 1; i <= m; i++) {\n      s += sz[i][1];\n    }\n    for (i = 1; i <= m; i++) {\n      s += sz[i][n];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[1][i];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[m][i];\n    }\n    s -= sz[1][1] + sz[1][n] + sz[m][1] + sz[m][n];\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, k, r, p, t;\n  int m, n, s;\n\n  cin >> t;\n  for (p = 1; p <= t; p++) {\n    s = 0;\n    cin >> m >> n;\n\n    for (j = 1; j <= m; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\", a[1][1]);\n      continue;\n    }\n    for (i = 1; i <= n; i++) {\n      s = s + a[1][i] + a[m][i];\n    }\n    for (r = 1; r <= m; r++) {\n      s = s + a[r][1] + a[r][n];\n    }\n    s = s - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int p = 0, i = 0, j = 0, k = 0, n = 0, m = 0, *q = NULL;\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    cin >> m >> n;\n    int sum = 0, a[100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[j];\n\n      q = a;\n      while (q <= &a[n - 1]) {\n        if (i == 0 || i == m - 1) {\n          sum = sum + *q;\n          q++;\n        } else {\n          if (q == &a[0] || q == &a[n - 1])\n            sum = sum + *q;\n          q++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint v[100][100];\n\nint sum(int m, int n) {\n\n  int su = 0;\n  if (n >= 2 && m >= 2) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n      su += v[m - 1][i];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      su += v[i][0];\n      su += v[i][n - 1];\n    }\n  } else if (n >= 2 && m == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n    }\n  } else if (m >= 2 && n == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[i][0];\n    }\n  } else {\n    su = v[0][0];\n  }\n  return su;\n}\n\nint main() {\n  int times;\n  cin >> times;\n  for (int k = 0; k < times; k++) {\n    int a, b;\n    cin >> a >> b;\n\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> v[i][j];\n\n    printf(\"%d\\n\", sum(a, b));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  for (int z = 0; z < k; z++) {\n    int num[100][100], m, n;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &num[j][i]);\n      }\n    }\n    int sum = 0;\n\n    for (int i = 0; i < m; i++) {\n      sum = sum + num[i][0] + num[i][n - 1];\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + num[0][i] + num[m - 1][i];\n    }\n    sum = sum - num[0][0] - num[0][n - 1] - num[m - 1][0] - num[m - 1][n - 1];\n    if (z != 0) {\n      printf(\"\\n\");\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, s = 0;\n  int m, n;\n  cin >> k;\n  int a[100][100];\n  int *p = &a[0][0];\n  for (int t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      s += *(*(a + 0) + i);\n      s += *(*(a + m - 1) + i);\n    }\n    for (int i = 0; i < m; i++) {\n      s += *(*(a + i) + 0);\n      s += *(*(a + i) + n - 1);\n    }\n    s = s - **a - *(*(a + m - 1) + n - 1) - *(*(a + 0) + n - 1) -\n        *(*(a + m - 1));\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10394", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d \", &m, &n);\n    int sz[m][n];\n    for (int a = 0; a < m; a++) {\n      for (int b = 0; b < n; b++)\n        scanf(\"%d\", &sz[a][b]);\n    }\n    int s = 0, p = 0, q = 0, r = 0;\n    int sum = 0;\n    if (m >= 3 && n >= 3) {\n      for (int a = 0; a < m; a++) {\n        s = s + sz[a][0];\n        p = p + sz[a][n - 1];\n      }\n      for (int b = 1; b < n - 1; b++) {\n        q = q + sz[0][b];\n        r = r + sz[m - 1][b];\n      }\n      sum = r + s + p + q;\n    } else {\n\n      for (int a = 0; a < m; a++) {\n        for (int b = 0; b < n; b++) {\n          sum = sum + sz[a][b];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100], c[100], sum[100] = {0};\n  int i, j, k, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &b[p], &c[p]);\n    for (i = 0; i < b[p]; i++) {\n      for (j = 0; j < c[p]; j++)\n        cin >> a[p][i][j];\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (i = 0, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (i = b[p] - 1, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = 0, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = c[p] - 1, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n  }\n  for (p = 0; p < k - 1; p++)\n    cout << sum[p] << \"\\n\";\n  cout << sum[k - 1];\n  return 0;\n}\n"}
{"label": "6", "index": "10396", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j;\n  int sum;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n        sum += *(*(a + m - 1) + j);\n      }\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n        sum += *(*(a + i) + n - 1);\n      }\n      sum = sum - *(*(a)) - *(*(a + m - 1) + n - 1) - *(*(a) + n - 1) -\n            *(*(a + m - 1));\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      sum = 0;\n      sum = *(*a);\n      cout << sum << endl;\n    } else if (m == 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n      }\n      cout << sum << endl;\n    } else if (n == 1 && m > 1) {\n      sum = 0;\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n      }\n      printf(\"%d\\n\", sum);\n    }\n    k--;\n  }\n}\n"}
{"label": "6", "index": "10397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid m(int, int);\nint main() {\n  int a, b, c, i;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    cin >> b >> c;\n    m(b, c);\n  }\n  return 0;\n}\nvoid m(int q, int w) {\n  int a, i, j;\n  long sum;\n  sum = 0;\n  for (i = 1; i <= q; i++) {\n    for (j = 1; j <= w; j++) {\n      scanf(\"%d\", &a);\n      if (i == 1 || j == 1 || i == q || j == w) {\n        sum += a;\n      }\n    }\n  }\n  cout << sum << \" \";\n}\n"}
{"label": "6", "index": "10398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int s = 0;\n    for (int i = 0; i < n; i++) {\n      s += *(*(a) + i);\n    }\n    if (m > 1)\n      for (int i = 0; i < n; i++) {\n        s += *(*(a + m - 1) + i);\n      }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + 0);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + n - 1);\n    }\n    cout << s;\n    if (i != k - 1)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int r, c, j, k, l, m, sum, n, p;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    sum = 0;\n    cin >> r;\n    cin >> c;\n    for (int i = 0; i < r; i++)\n      for (int j = 0; j < c; j++)\n        cin >> a[i][j];\n\n    for (j = 0; j < r; j++) {\n      sum = sum + **(a + j);\n    }\n\n    for (k = 1; k < c; k++) {\n      sum = sum + *(*(a + r - 1) + k);\n    }\n    for (l = r - 2; l >= 0; l--) {\n      sum = sum + *(*(a + l) + c - 1);\n    }\n    for (m = 1; m < c - 1; m++) {\n      sum = sum + *(*(a + 0) + m);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  scanf(\"%d \", &k);\n  for (int e = 1; e <= k; e++) {\n    cin >> m >> n;\n    for (int i = 1; i <= m; i++)\n      for (int j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    if (m == 1 && n == 1)\n      cout << a[1][1] << endl;\n    else {\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[1][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][1];\n      for (int i = 1; i <= n; i++)\n        sum = sum + a[m][i];\n      for (int i = 1; i <= m; i++)\n        sum = sum + a[i][n];\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10401", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[101][101];\n  int n, i, j, s, t;\n  cin >> n;\n  while (n--) {\n    cin >> s >> t;\n    for (i = 0; i < s; i++)\n      for (j = 0; j < t; j++)\n        cin >> c[i][j];\n    int sum = 0;\n    if (s == 1)\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][t];\n    else if (t == 1)\n      for (i = 0; i < s; i++)\n        sum = sum + c[i][0];\n    else {\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][i] + c[s - 1][i];\n      for (i = 1; i < s - 1; i++)\n        sum = sum + c[i][0] + c[i][t - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, s, t, sum = 0, matrix[100][100];\n    cin >> m >> n;\n    for (s = 0; s < m; s++)\n      for (t = 0; t < n; t++)\n        cin >> *(*(matrix + s) + t);\n    for (s = 0; s < n; s++)\n      sum += *(*(matrix + 0) + s) + *(*(matrix + m - 1) + s);\n    for (s = 1; s < m - 1; s++) {\n      sum += *(*(matrix + s) + 0) + *(*(matrix + s) + n - 1);\n    }\n    if (m == 1 || n == 1)\n      sum /= 2;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], num[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i][0] >> a[i][1];\n    num[i] = 0;\n    int b[100][100];\n    for (int j = 0; j < a[i][0]; j++) {\n      for (int k = 0; k < a[i][1]; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[0][j];\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[a[i][0] - 1][j];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][0];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][a[i][1] - 1];\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    cout << num[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10404", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, k1, m, n, i, j, answer;\n  int sz[102][102];\n  scanf(\"%d\", &k);\n  for (k1 = 1; k1 <= k; k1++) {\n    answer = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      answer = sz[1][1];\n    } else if (m == 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j];\n      }\n    } else if (n == 1) {\n      for (i = 1; i <= m; i++) {\n        answer = answer + sz[i][1];\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j] + sz[m][j];\n      }\n      for (i = 2; i < m; i++) {\n        answer = answer + sz[i][1] + sz[i][n];\n      }\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10405", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, p, a[100][100], s[100] = {0}, m, n;\n  scanf(\"%d\", &k);\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[1][j]);\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[m][j]);\n    }\n    for (i = 2; i <= m - 1; i++) {\n      s[p] = s[p] + a[i][1] + a[i][n];\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (p = 2; p <= k; p++) {\n    printf(\"\\n%d\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100] = {0};\n  int *p, i1, i2, sum = 0;\n\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i1 = 0; i1 < m; i1++) {\n      p = a[i1];\n      for (i2 = 0; i2 < n; i2++) {\n        scanf(\"%d\", p);\n        sum = sum + *p;\n        p++;\n      }\n    }\n    for (i1 = 1; i1 < m - 1; i1++) {\n      p = a[i1];\n      p++;\n      for (i2 = 1; i2 < n - 1; i2++) {\n        sum = sum - *p;\n        p++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, m, n, s;\n  scanf(\"%d\\n\", &x);\n  for (s = 0; s < x; s++) {\n    int a[100][100];\n    int i, j, k, q = 0, w = 0, e = 0, r = 0, sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (k = 0; k < n; k++) {\n      q += a[0][k];\n      w += a[m - 1][k];\n    }\n    k = 0;\n    for (k = 0; k < m; k++) {\n      e += a[k][0];\n      r += a[k][n - 1];\n    }\n    sum = q + w + e + r - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10408", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a, b, i, j, k, sum;\n  int s[100][100];\n  int(*p)[100];\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    p = s;\n    sum = 0;\n    cin >> a >> b;\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k, sum = 0;\n  scanf(\"%d\", &k);\n\n  while (k > 0) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, row, col, j, k, sum;\n  cin >> n;\n  cin.get();\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    row = 0;\n    col = 0;\n    int a[103][103] = {0};\n    cin >> row >> col;\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        cin >> *(*(a + j) + k);\n    if ((row == 1) && (col == 1))\n      printf(\"%d\\n\", **a);\n    else {\n      for (k = 0; k < col; k++)\n        sum = sum + *(*a + k);\n      for (k = 0; k < col; k++)\n        sum = sum + *(*(a + row - 1) + k);\n      for (j = 0; j < row; j++)\n        sum = sum + **(a + j);\n      for (j = 0; j < row; j++)\n        sum = sum + *(*(a + j) + col - 1);\n      sum = sum - **a;\n      sum = sum - *(*(a + row - 1));\n      sum = sum - *(*a + col - 1);\n      sum = sum - *(*(a + row - 1) + col - 1);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, n = 0, m = 0, i = 0, w = 0, j = 0, sum = 0, s[101][101] = {0};\n  scanf(\"%d \", &k);\n  for (w = 1; w <= k; w++) {\n    sum = 0;\n    cin >> n >> m;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= m; j++) {\n        cin >> *(s[i] + j);\n        if ((i == 1) || (i == n) || (j == 1) || (j == m))\n          sum += *(s[i] + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, count;\n  cin >> k;\n  for (count = 0; count < k; count++) {\n    int i, j, n, m, a[100][100], sum = 0;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum = sum + a[0][j] + a[n - 1][j];\n    }\n    for (i = 0; i < n; i++) {\n      sum = sum + a[i][0] + a[i][m - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10413", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, k, sum = 0, x, q, w, e, r;\n  int ss[100];\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    q = 0;\n    w = 0;\n    e = 0;\n    r = 0;\n    for (j = 0; j < n; j++) {\n      q = q + sz[0][j];\n    }\n    for (j = 0; j < n; j++) {\n      w = w + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++)\n      e = e + sz[i][0];\n\n    for (i = 1; i < m - 1; i++) {\n      r = r + sz[i][n - 1];\n    }\n    sum = q + w + e + r;\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10414", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, k, sum = 0, a;\n  int i, j, q, b[100];\n  int s[100][100];\n  scanf(\"%d\", &k);\n\n  for (q = 1; q <= k; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += s[1][j];\n      sum += s[m][j];\n    }\n    for (i = 1; i <= m; i++) {\n      sum += s[i][1];\n      sum += s[i][n];\n    }\n    a = s[1][1] + s[1][n] + s[m][1] + s[m][n];\n    sum -= a;\n    b[q] = sum;\n    sum = 0;\n  }\n  for (q = 1; q <= k; q++) {\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[10000], *p = a, *q = a, n, h, l, i, j, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = a;\n    q = a;\n    scanf(\"%d %d\", &h, &l);\n\n    for (j = 1; j <= h * l; j++)\n      scanf(\"%d\", p++);\n\n    if (h == 1) {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n      }\n    } else if (l == 1) {\n      sum += *q;\n      sum += *(q + h - 1);\n    } else {\n      for (j = 0; j < l; j++) {\n        sum += *(q + j);\n        sum += *(q + h * l - j - 1);\n      }\n      for (j = 1; j <= h - 2; j++) {\n        sum += *(q + j * l);\n        sum += *(q + j * l + l - 1);\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10416", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar name[100];\ndouble s[100];\nint num[1000][1000];\nint main() {\n  int i = 0, j = 0, n, m, sum = 0, k = 0, flag = 0, p = 0, a = 0, c = 0, b = 0,\n      q = 0;\n\n  scanf(\"%d\", &a);\n\n  while (p < a) {\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cin >> num[i][j];\n        if (i == 0) {\n          sum += num[i][j];\n        }\n        if (i == n - 1)\n          sum += num[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < n - 1; j++) {\n        if (i == 0)\n          sum += num[j][i];\n        if (i == m - 1)\n          sum += num[j][i];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    p++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10417", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    int m = 0, n = 0;\n    scanf(\"%d %d\", &m, &n);\n    int i = 0, j = 0, x = 0;\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1) {\n          sum += x;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int p;\n  int q;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num;\n    scanf(\"%d\", &p);\n    scanf(\"%d\", &q);\n    if (p == 1 && q == 1) {\n      scanf(\"%d\", &num);\n      printf(\"%d\", num);\n      break;\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    for (j = 1; j < p - 1; j++) {\n      for (k = 0; k < q; k++) {\n        scanf(\"%d\", &num);\n        if (k == 0 || k == q - 1) {\n          sum += num;\n        }\n      }\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10419", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint imat[100][100];\n\nint main() {\n  int n;\n  cin >> n;\n  int a, b;\n  for (int i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        cin >> imat[j][k];\n      }\n    }\n\n    int(*p)[100] = &(imat[0]);\n\n    int counter = 0;\n\n    for (int i = 0; i < a; i++) {\n      for (int j = 0; j < b; j++) {\n        if (j % b == 0 || j % b == (b - 1) || i == 0 || i == (a - 1))\n          counter = counter + *(*(p + i) + j);\n      }\n    }\n    \n    \n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10420", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    int n, m;\n    cin >> m >> n;\n    int num[110][110];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> num[j][k];\n    int sum = 0;\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++)\n        sum = sum + num[0][j];\n      cout << sum << endl;\n    } else if (m != 1 && n == 1) {\n      for (int j = 0; j < m; j++)\n        sum = sum + num[m][0];\n      cout << sum << endl;\n    } else if (m == 1 && n == 1)\n      cout << num[0][0] << endl;\n    else {\n      for (int j = 0; j < n; j++)\n        sum = sum + *(*num + j);\n      for (int j = 0; j < n; j++)\n        sum = sum + *(num[m - 1] + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + **(num + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + *(*(num + j) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10421", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  scanf(\"%d \", &k);\n  int m = 0, n = 0;\n  while (scanf(\"%d %d \", &m, &n)) {\n    int result = 0;\n    int num[100][100] = {0};\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &num[i][j]);\n    for (j = 0; j < n; j++)\n      result += num[0][j] + num[m - 1][j];\n    for (i = 1; i < (m - 1); i++)\n      result += num[i][0] + num[i][n - 1];\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum, i, j1, j, n, c, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &c, &k);\n    for (j = 0; j < c; j++) {\n      for (j1 = 0; j1 < k; j1++) {\n        scanf(\"%d\", &a[j][j1]);\n      }\n    }\n    for (j = 1; j < k - 1; j++)\n      sum += *(*p + j) + *(*(p + c - 1) + j);\n    if (k > 1)\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j)) + *(*(p + j) + k - 1);\n    else\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j));\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    int row, col, count = 0, i, j;\n    cin >> row >> col;\n    int str[101][101];\n    for (i = 1; i <= row; i++)\n      for (j = 1; j <= col; j++) {\n        cin >> *(*(str + i) + j); \n      }\n    for (i = 1; i <= col; i++)\n      count = count + *(*(str + 1) + i);\n    for (i = 2; i <= row; i++)\n      count = count + *(*(str + i) + col); \n    for (i = col - 1; i >= 1; i--)\n      count = count + *(*(str + row) + i);\n    for (i = row - 1; i >= 2; i--)\n      count = count + *(*(str + i) + 1);\n    cout << count << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10424", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, a[10000], sum[10000], y, j;\n  scanf(\"%d\", &k);\n  for (j = 1; j <= k; j++) {\n    scanf(\"%d%d\", &m, &n);\n    sum[j - 1] = 0;\n    for (i = 1; i <= 10000; i++) {\n      scanf(\"%d\", &a[i - 1]);\n      y = i <= n || i % n == 1 || i % n == 0 || i > m * n - n;\n      sum[j - 1] += y * a[i - 1];\n      if (i >= m * n)\n        break;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", sum[i - 1]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10425", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum;\n  scanf(\"%d \", &k);\n  int a[100][100];\n  for (int l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    sum = 0;\n    if (m > 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*(a + m - 1) + i);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n    }\n    if (n > 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i) + n - 1);\n    }\n    if (n == 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10426", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc(sizeof(int) * k);\n  for (i = 0; i < k; i++) {\n    s = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &sz[j][l]);\n      }\n    }\n    if (m == 1) {\n      for (l = 0; l < n; l++) {\n        s += sz[0][l];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0];\n      }\n    } else {\n      for (j = 0; j < m; j++) {\n        s += sz[j][0] + sz[j][n - 1];\n      }\n      for (l = 0; l < n; l++) {\n        s += sz[0][l] + sz[m - 1][l];\n      }\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    sf[i] = s;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", sf[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, a[100][100], s, q[100], h1, h2, t, l1, l2, c;\n  scanf(\"%d\", &k);\n  for (i = 1, t = 0; i <= k, t < k; i++, t++) {\n    h1 = 0, h2 = 0, t, l1 = 0, l2 = 0;\n    scanf(\"%d%d\", &m, &n);\n\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &a[0][0]);\n      q[t] = a[0][0];\n    }\n\n    if (m == 1 && n > 1) {\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", &a[0][i]);\n\n      for (c = 0, i = 0; i < n; i++)\n        c = c + a[0][i];\n      q[t] = c;\n    }\n\n    if (n > 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      } \n      for (j = 0; j < n; j++) {\n        h1 = h1 + a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        h2 = h2 + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        l1 = l1 + a[i][0];\n      }\n      for (i = 1; i < m - 1; i++) {\n        l2 = l2 + a[i][n - 1];\n      }\n      q[t] = h1 + h2 + l1 + l2;\n    }\n\n    if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++)\n        scanf(\"%d\", &a[i][0]);\n\n      for (c = 0, i = 0; i < m; i++)\n        c = c + a[i][0];\n      q[t] = c;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10428", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, ans = 0;\n  int m[100], n[100];\n  int r[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (p = 0; p < n[i]; p++)\n        scanf(\"%d\", &r[i][j][p]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    ans = 0;\n    for (i = 0; i < n[p]; i++) {\n      for (j = 0; j < m[p]; j++) {\n        if ((i == 0) || (i == n[p] - 1) || (j == 0) || (j == m[p] - 1))\n          ans += r[p][j][i];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, j, a;\n  for (scanf(\"%d\", &k); k > 0; k--) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n    }\n    for (i = 1; i < m - 1; i++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n      for (j = 1; j < n; j++)\n        scanf(\"%d\", &a);\n      if (n != 1)\n        s = s + a;\n    }\n    if (m != 1)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a);\n        s = s + a;\n      }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, l, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((m == 1) && (n == 1))\n      printf(\"%d\\n\", a[0][0]);\n    else if (m == 1) {\n      s = 0;\n      for (j = 0; j < n; j++)\n        s = s + a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      s = 0;\n      for (j = 0; j < m; j++)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    } else {\n      s = 0;\n      for (j = 0; j < n - 1; j++)\n        s = s + a[0][j];\n      for (j = 0; j < m - 1; j++)\n        s = s + a[j][n - 1];\n      for (j = n - 1; j > 0; j--)\n        s = s + a[m - 1][j];\n      for (j = m - 1; j > 0; j--)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n}\n"}
{"label": "6", "index": "10431", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int p;\n  int q;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num;\n    scanf(\"%d\", &p);\n    scanf(\"%d \", &q);\n    if (p == 1 && q == 1) {\n      scanf(\"%d\", &num);\n      printf(\"%d\", num);\n      break;\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    for (j = 1; j < p - 1; j++) {\n      for (k = 0; k < q; k++) {\n        scanf(\"%d\", &num);\n        if (k == 0 || k == q - 1) {\n          sum += num;\n        }\n      }\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10432", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum;\n  int b, n, m, i, j, l;\n  scanf(\"%d\", &b);\n  for (l = 0; l < b; l++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    if (m == 1 && n != 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[0][1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[0][0]);\n    }\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 1; j < n - 1; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      sum = sum + a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10433", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n, sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    int i, j, a[100][100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if ((i == 0) || (i == m - 1) || (j == 0) || (j == n - 1))\n          sum = sum + a[i][j];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n, i, j, l, sum1 = 0, sum = 0;\n  int a[100][100];\n\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n        sum = sum + *(*(p + i) + j);\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++) {\n        sum1 = sum1 + *(*(p + i) + j);\n      }\n\n    sum = sum - sum1;\n    cout << sum << endl;\n    sum = sum1 = 0;\n  }\n}\n"}
{"label": "6", "index": "10435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], m, n, k, i, j, q, s;\n  scanf(\"%d\", &k);\n  int *sum = (int *)malloc(sizeof(int) * k);\n  s = 0;\n\n  for (q = 0; q < k; q++) {\n    sum[q] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[0][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][0];\n    }\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[m - 1][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][n - 1];\n    }\n    sum[q] -= sz[0][0];\n    sum[q] -= sz[0][n - 1];\n    sum[q] -= sz[m - 1][0];\n    sum[q] -= sz[m - 1][n - 1];\n\n    cout << sum[q] << \"\\n\";\n  }\n\n  free(sum);\n  return 0;\n}\n"}
{"label": "6", "index": "10436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, ha, li, x, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = 0;\n    cin >> ha >> li;\n    for (l = 0; l < ha; l++) {\n      for (k = 0; k < li; k++) {\n        cin >> x;\n        if (l == 0 || l == (ha - 1) || (k == 0 && l != 0 && l != (ha - 1)) ||\n            (k == (li - 1) && l != 0 && l != (ha - 1))) {\n          s = s + x;\n        }\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10437", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, m, n;\nint arr[105][105];\n\nint main() {\n  cin >> k;\n  while (k--) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> arr[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += arr[i][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, n, i, j, x, y, sum, a[100][100];\n  scanf(\"%d\", &n);\n  for (c = 1; c <= n; c++) {\n    sum = 0;\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][0];\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][j - 1];\n    for (j = 0; j < y; j++)\n      sum = sum + a[0][j];\n    for (j = 0; j < y; j++)\n      sum = sum + a[x - 1][j];\n    sum = sum - a[0][0] - a[x - 1][0] - a[0][y - 1] - a[x - 1][y - 1];\n    if (c != n)\n      cout << sum << \"\\n\";\n    else\n      printf(\"%d\", sum);\n  }\n}\n"}
{"label": "6", "index": "10439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int x = 0, y = 0;\n  int total = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  scanf(\"%d\", &n);\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        scanf(\"%d\", &Matrix[i][j]);\n        if (i == 0 || i == x - 1)\n          total += Matrix[i][j];\n        else if (j == 0 || j == y - 1)\n          total += Matrix[i][j];\n      }\n    cout << total << \"\\n\";\n    total = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200], t, n, m, i, j, s;\n  int(*p)[200];\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d%d\", &n, &m);\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", *(p + i) + j);\n    s = 0;\n    for (i = 0; i < m; i++)\n      s = s + *(*p + i);\n    if (n > 1)\n      for (i = 0; i < m; i++)\n        s = s + *(*(p + n - 1) + i);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(p + i));\n    if (m > 1)\n      for (i = 1; i < n - 1; i++)\n        s = s + *(*(p + i) + m - 1);\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nconst int maxn = 110;\nint n, m;\nint d[maxn][maxn];\n\nint main() {\n  int t;\n\n  scanf(\"%d\", &t);\n  while (t-- > 0) {\n    int sum = 0;\n    scanf(\"%d %d \", &n, &m);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < m; j++) {\n        int tmp;\n        scanf(\"%d\", &tmp);\n        if (i == 0 || i == n - 1 || j == 0 || j == m - 1)\n          sum += tmp;\n      }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  const int max = 100;\n  int num;\n  scanf(\"%d \", &num);\n  while (num--) {\n    int m, n;\n    scanf(\"%d %d \", &m, &n);\n    int a[max][max];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10443", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(char *argv[]) {\n  int n;\n  int p;\n  int q;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num;\n    scanf(\"%d\", &p);\n    scanf(\"%d \", &q);\n    if (p == 1 && q == 1) {\n      scanf(\"%d\", &num);\n      printf(\"%d\", num);\n      break;\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    for (j = 1; j < p - 1; j++) {\n      for (k = 0; k < q; k++) {\n        scanf(\"%d\", &num);\n        if (k == 0 || k == q - 1) {\n          sum += num;\n        }\n      }\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], m[100][100], i, j, k, count[100] = {0};\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> x[k] >> y[k];\n    for (i = 0; i < x[k]; i++) {\n      for (j = 0; j < y[k]; j++) {\n        cin >> m[i][j];\n        if (i == 0 || i == x[k] - 1 || j == 0 || j == y[k] - 1)\n          count[k] += m[i][j];\n      }\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << count[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, o, p, sum, area[111][111];\n  int k, i = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> a >> b;\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        scanf(\"%d\", &area[o][p]);\n      }\n    }\n    if (a != 1 && b != 1) {\n      for (p = 0; p < b; p++) {\n        sum += area[0][p] + area[a - 1][p];\n      }\n      for (o = 1; o < a - 1; o++) {\n        sum += area[o][0] + area[o][b - 1];\n      }\n    } else {\n      for (o = 0; o < a; o++) {\n        for (p = 0; p < b; p++) {\n          sum += area[o][p];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, m, n, i, M, j, JU[100][100], h, l;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    M = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (h = 0; h < m; h++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &JU[h][l]);\n    }\n    if (n == 1) {\n      for (j = 0; j < m; j++)\n        M = M + JU[j][0];\n    } else if (m == 1) {\n      for (j = 0; j < n; j++)\n        M = M + JU[0][j];\n    } else {\n      for (h = 0; h < m; h++) {\n        if (h > 0 && h < m - 1) {\n          M = M + JU[h][0] + JU[h][n - 1];\n        } else {\n          for (j = 0; j < n; j++)\n            M = M + JU[h][j];\n        }\n      }\n    }\n    cout << M << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  fflush(stdin);\n\n  int i, j, k, m;\n  int lie, h;\n  int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n\n  for (i = 0; i < n; i++) {\n    sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n    scanf(\"%d%d\", &h, &lie);\n    int matrix[h][lie];\n\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < lie; k++) {\n        scanf(\"%d\", &matrix[j][k]);\n      }\n    }\n    fflush(stdin);\n\n    if (h == 1 && lie == 1) {\n      cout << matrix[0][0] << \"\\n\";\n      return 0;\n    }\n\n    for (m = 0; m < lie; m++) {\n      sum1 += matrix[0][m];\n      sum2 += matrix[h - 1][m];\n    }\n\n    for (m = 0; m < h; m++) {\n      sum1 += matrix[m][0];\n      sum2 += matrix[m][lie - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4 -\n          (matrix[0][0] + matrix[0][lie - 1] + matrix[h - 1][0] +\n           matrix[h - 1][lie - 1]);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10448", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[101][101];\n  int n, i, j, s, t;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d %d \", &s, &t);\n    for (i = 0; i < s; i++)\n      for (j = 0; j < t; j++)\n        cin >> c[i][j];\n    int sum = 0;\n    if (s == 1)\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][t];\n    else if (t == 1)\n      for (i = 0; i < s; i++)\n        sum = sum + c[i][0];\n    else {\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][i] + c[s - 1][i];\n      for (i = 1; i < s - 1; i++)\n        sum = sum + c[i][0] + c[i][t - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, x[10000], sum = 0, *p;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (p = x; p < x + m * n; p++)\n      scanf(\"%d\", p);\n    for (p = x; p < x + n; p++)\n      sum = sum + *p;\n    for (p = x + (m - 1) * n; m != 1 && p < x + n * m; p++)\n      sum = sum + *p;\n    for (p = x + n; p < x + n * (m - 1); p = p + n)\n      sum = sum + *p;\n    for (p = x + n + n - 1; p < x + n * m - 1; p = p + n)\n      sum = sum + *p;\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int a[][100], int m, int n) {\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + j) + i);\n}\nint main() {\n  int square[100][100];\n  int k, m, n;\n  cin >> k;\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    input(square, m, n);\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      sum = sum + *(*square + j) + *(*(square + n - 1) + j);\n    for (int j = 1; j < n - 1; j++)\n      sum = sum + **(square + j) + *(*(square + j) + m - 1);\n    if (m == 1)\n      sum = sum / 2;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100], c[100], sum[100] = {0};\n  int i, j, k, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &b[p], &c[p]);\n    for (i = 0; i < b[p]; i++) {\n      for (j = 0; j < c[p]; j++)\n        scanf(\"%d\", &a[p][i][j]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (i = 0, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (i = b[p] - 1, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = 0, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = c[p] - 1, i = 1; i < b[p] - 1; i++) {\n      sum[p] = sum[p] + a[p][i][j];\n    }\n  }\n  for (p = 0; p < k - 1; p++)\n    printf(\"%d\\n\", sum[p]);\n  printf(\"%d\", sum[k - 1]);\n  return 0;\n}\n"}
{"label": "6", "index": "10452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f() {\n  int a = 0, i, j, m, n, (*p)[100];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[100])malloc(m * 100 * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < n; j++)\n    a = a + *(*p + j) + *(*(p + m - 1) + j);\n  for (i = 1; i < m - 1; i++)\n    a = a + *(*(p + i)) + *(*(p + i) + n - 1);\n  cout << a << \"\\n\";\n}\nint main() {\n  int c, k;\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++)\n    f();\n  return 0;\n}\n"}
{"label": "6", "index": "10453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, y;\n  int z[100][100];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    y = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int t = 0; t < n; t++) {\n        cin >> z[j][t];\n      }\n    }\n    for (int a = 0; a < m; a++) {\n      y = y + z[a][0] + z[a][n - 1];\n    }\n    for (int b = 0; b < n; b++) {\n      y = y + z[0][b] + z[m - 1][b];\n    }\n    y = y - z[0][0] - z[0][n - 1] - z[m - 1][0] - z[m - 1][n - 1];\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, s = 0, a[102][102];\n  cin >> k;\n  while (k > 0) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= m; i++) {\n      s = s + a[i][1] + a[i][n];\n    }\n    for (j = 2; j <= n - 1; j++) {\n      s = s + a[1][j] + a[m][j];\n    }\n    cout << s << \"\\n\";\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10456", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, u, k, m[100], n[100], g[100][100][100], num = 0;\n  int *p, (*q)[100];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (u = 0; u < n[i]; u++)\n        cin >> g[i][j][u];\n  }\n  for (i = 1; i <= k; i++) {\n    num = 0;\n    for (p = &g[i][0][0]; p <= &g[i][0][n[i] - 1]; p++)\n      num = num + (*p);\n    for (p = &g[i][m[i] - 1][0]; p <= &g[i][m[i] - 1][n[i] - 1]; p++)\n      num = num + (*p);\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q));\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q + n[i] - 1));\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, sum = 0;\n  int shuzu[1000][1000];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int s = 0; s < m; s++) {\n      for (int t = 0; t < n; t++) {\n        scanf(\"%d\", &(shuzu[s][t]));\n      }\n    }\n    if (m > 2 && n > 2) {\n      for (int x = 0; x < m; x++)\n        sum += shuzu[x][0] + shuzu[x][n - 1];\n\n      for (int y = 1; y < n - 1; y++) {\n        sum += shuzu[0][y] + shuzu[m - 1][y];\n      }\n    } else {\n      for (int z = 0; z < m; z++) {\n        for (int h = 0; h < n; h++) {\n          sum += shuzu[z][h];\n        }\n      }\n    }\n    printf(\"%d \", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10458", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, sum = 0;\n  int shuzu[1000][1000];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int s = 0; s < m; s++) {\n      for (int t = 0; t < n; t++) {\n        scanf(\"%d\", &(shuzu[s][t]));\n      }\n    }\n    if (m > 2 && n > 2) {\n      for (int x = 0; x < m; x++) {\n        sum += shuzu[x][0] + shuzu[x][n - 1];\n      }\n      for (int y = 1; y < n - 1; y++) {\n        sum += shuzu[0][y] + shuzu[m - 1][y];\n      }\n    } else {\n      for (int z = 0; z < m; z++) {\n        for (int h = 0; h < n; h++) {\n          sum += shuzu[z][h];\n        }\n      }\n    }\n    printf(\"%d \", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, h, i, j, a, b;\n  int s[100][100], r[100];\n  scanf(\"%d\", &k);\n  for (int t = 0; t <= k - 1; t++) {\n    h = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (a = 0; a <= n - 1; a++) {\n      h = h + s[0][a] + s[m - 1][a];\n    }\n    for (b = 1; b <= m - 2; b++) {\n      h = h + s[b][0] + s[b][n - 1];\n    }\n    r[t] = h;\n  }\n  for (int x = 0; x <= k - 1; x++) {\n    printf(\"%d\\n\", r[x]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  int sz[100][100], sum, s[100];\n  int a, b, m, n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      sum += sz[0][b];\n      sum += sz[m - 1][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      sum += sz[a][0];\n      sum += sz[a][n - 1];\n    }\n    s[i] = sum;\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10461", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int i, j, a[100][100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if ((i == 0) || (i == m - 1) || (j == 0) || (j == n - 1))\n          sum = sum + a[i][j];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, k = 0, x, y, an[100][100], sum[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &x, &y);\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        cin >> an[j][k];\n        if (j == 0 || j == x - 1 || k == 0 || k == y - 1) {\n          sum[i] += an[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "10463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  for (int a = 0; a < k; a++) {\n    int m, n;\n    cin >> m >> n;\n    int A[100][100];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> A[i][j];\n      }\n    }\n    int(*p)[100];\n    p = A;\n    int num = 0;\n    for (j = 0; j < n; j++) {\n      num = num + *(*p + j);\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      num = num + **(p + i) + *(*(p + i) + n - 1);\n    }\n\n    for (j = 0; j < n; j++) {\n      num = num + *(*(p + m - 1) + j);\n    }\n\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10464", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[105][105] = {0}, n = 0, row = 0, col = 0, i = 0, j = 0, *p = NULL,\n      sum = 0;\n  cin >> n;\n  while (n--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = &a[0][0]; p < &a[0][0] + col; p++)\n      sum = sum + *p;\n\n    for (i = 1; i < row - 1; i++) {\n      sum = sum + a[i][0] + a[i][col - 1];\n    }\n    if (row > 1) {\n      for (p = &a[row - 1][0]; p < &a[row - 1][0] + col; p++) {\n        sum = sum + *p;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, a[100][100];\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    int r, s;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        cin >> a[r][s];\n    int sum = 0;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        if (r == 0 || r == m - 1 || s == 0 || s == n - 1)\n          sum = sum + a[r][s];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int m, n, j1, j2, sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j1 = 1; j1 <= m; j1++) {\n      for (j2 = 1; j2 <= n; j2++)\n        cin >> *(*(a + j1) + j2);\n    }\n    for (j2 = 1; j2 <= n; j2++)\n      sum = sum + *(*(a + 1) + j2) + *(*(a + m) + j2);\n    for (j1 = 2; j1 <= m - 1; j1++)\n      sum = sum + *(*(a + j1) + 1) + *(*(a + j1) + n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10467", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n;\n  int a[101][101];\n  int u, i, j, sum;\n  scanf(\"%d\", &k);\n  for (u = 0; u < k; u++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n        if ((i == 0) || (j == 0) || (i == m - 1) || j == (n - 1)) {\n          sum += a[i][j];\n        }\n      }\n    }\n    if (u != k - 1)\n      printf(\"%d\\n\", sum);\n    else if (u == k - 1) {\n      printf(\"%d\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m, n, sum = 0;\n  int i, j, p;\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    for (i = 0, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (i = m - 1, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = 0, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = n - 1, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    sum = sum - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, l, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((m == 1) && (n == 1))\n      printf(\"%d\\n\", a[0][0]);\n    else if (m == 1) {\n      s = 0;\n      for (j = 0; j < n; j++)\n        s = s + a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      s = 0;\n      for (j = 0; j < m; j++)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    } else {\n      s = 0;\n      for (j = 0; j < n - 1; j++)\n        s = s + a[0][j];\n      for (j = 0; j < m - 1; j++)\n        s = s + a[j][n - 1];\n      for (j = n - 1; j > 0; j--)\n        s = s + a[m - 1][j];\n      for (j = m - 1; j > 0; j--)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    }\n  }\n}\n"}
{"label": "6", "index": "10470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *a, sum, i, k, n, m, j = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    a = (int *)malloc(sizeof(int) * (n * m));\n    for (j = 0; j < n * m; j++) {\n      scanf(\"%d\", a + j);\n      if ((j + 1 <= n) || (j > (n * m - n - 1)) || ((j + 1) % n == 1) ||\n          ((j + 1) % n == 0))\n        sum += *(a + j);\n    }\n    free(a);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], r, l, sum = 0;\n    cin >> r >> l;\n    for (j = 0; j <= r - 1; j++)\n      for (k = 0; k <= l - 1; k++)\n        scanf(\"%d\", *(a + j) + k);\n    for (j = 0; j <= r - 1; j++) {\n      for (k = 0; k <= l - 1; k++) {\n        if (j == r - 1 || j == 0 || k == l - 1 || k == 0)\n          sum += *(*(a + j) + k);\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  int m, n;\n  int a[100][100] = {0};\n  int sum;\n  scanf(\"%d \", &t);\n  int i, j, k;\n  for (i = 0; i < t; i++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j];\n      sum = sum + a[m - 1][j];\n    }\n    for (k = 1; k < m - 1; k++) {\n      sum = sum + a[k][0];\n      sum = sum + a[k][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, row[99], col[99], s[99][99][99], sum[99] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> row[i] >> col[i];\n    for (j = 0; j < row[i]; j++) {\n      for (k = 0; k < col[i]; k++) {\n        cin >> s[i][j][k];\n        if ((j == 0) || (k == 0) || (j == (row[i] - 1)) || (k == col[i] - 1)) {\n          sum[i] += s[i][j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[10000], i, k, a, b, n, s = 0;\n  int *p, *q;\n  p = c;\n  q = p;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    p = c;\n    q = p;\n    s = 0;\n    scanf(\"%d %d\", &b, &a);\n\n    for (i = 0; i < a * b; i++) {\n\n      scanf(\"%d\", &*p);\n      p++;\n    }\n    p = q;\n    for (i = 0; i < a; i++) {\n      s = s + *p;\n      p++;\n    }\n    p = q;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    p = q + a - 1;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    if (b != 1) {\n      p = q + a * (b - 1);\n      for (i = 0; i < a; i++) {\n\n        s = s + *p;\n        p = p + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][99][99] = {0}, m[100], n[100], k, i, j, l, sum[100] = {0}, leap;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j <= m[i] - 1; j++) {\n      for (l = 0; l <= n[i] - 1; l++)\n        scanf(\"%d \", &a[i][j][l]);\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (m[i] == 1 && n[i] == 1) {\n      sum[i] = a[i][0][0];\n    } else {\n      for (j = 0; j <= m[i] - 1; j++) {\n        sum[i] = a[i][j][0] + a[i][j][n[i] - 1] + sum[i];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (n[i] <= 2)\n      leap = 1;\n    else\n      leap = 0;\n    for (j = 1; j <= n[i] - 2; j++) {\n      if (leap)\n        break;\n      sum[i] = sum[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, t, s = 0;\n  scanf(\"%d\", &k);\n  int a[100][100], b[k - 1];\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        } else if (j == 0 || j == n - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    b[t] = s;\n    s = 0;\n  }\n  for (t = 0; t < k; t++) {\n    cout << b[t] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, k, i, j, s = 0, m, n, *p[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        p[i][j] = (int *)malloc(1 * sizeof(int));\n        scanf(\"%d\", &*p[i][j]);\n        if (j == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    for (j = 0; j < n; j++)\n      s = s + (*p[0][j]) + (*p[m - 1][j]);\n    for (i = 1; i < m - 1; i++)\n      s = s + (*p[i][0]) + (*p[i][n - 1]);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n}\n"}
{"label": "6", "index": "10478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, i, j, k, h, a[100], b[100], juzhen[100][100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &(a[h]), &(b[h]));\n    for (i = 0; i < a[h]; i++) {\n      for (j = 0; j < b[h]; j++) {\n        scanf(\"%d\", &(juzhen[i][j]));\n      }\n    }\n    for (i = 0; i < a[h]; i++) {\n      sum[h] = sum[h] + juzhen[i][0] + juzhen[i][b[h] - 1];\n    }\n    for (j = 1; j < b[h] - 1; j++) {\n      sum[h] = sum[h] + juzhen[0][j] + juzhen[a[h] - 1][j];\n    }\n  }\n  for (h = 0; h < k; h++)\n    printf(\"%d\\n\", sum[h]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum;\n  int b, n, m, i, j, l;\n  scanf(\"%d\", &b);\n  for (l = 0; l < b; l++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    if (m == 1 && n != 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[0][1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[0][0]);\n    }\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 1; j < n - 1; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      sum = sum + a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10480", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, sz[200][200], result = 0;\n  scanf(\"%d\", &k);\n  int i, p, q;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> sz[p][q];\n      }\n      if (p == 0 || p == m - 1) {\n        for (q = 0; q < n; q++) {\n          result += sz[p][q];\n        }\n      } else {\n        result += sz[p][0];\n        result += sz[p][n - 1];\n      }\n    }\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[100][2], c[100][100][100], i, j, p, s[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++)\n      for (p = 0; p < a[i][1]; p++)\n        scanf(\"%d\", &c[i][j][p]);\n  }\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][0][j];\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][0];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][a[i][1] - 1];\n    printf(\"%d\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10482", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, array[100][100];\n  int sum, i, j, k;\n  scanf(\"%d \", &t);\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    for (j = 0; j < m; j++)\n      sum = sum + array[j][0] + array[j][n - 1];\n    for (k = 0; k < n; k++)\n      sum = sum + array[0][k] + array[m - 1][k];\n    cout << sum - array[0][0] - array[0][n - 1] - array[m - 1][0] -\n                array[m - 1][n - 1]\n         << endl;\n  }\n  cin.get();\n  return 0;\n}\n"}
{"label": "6", "index": "10483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int n, k, row, col, i, j, sum = 0;\n\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> a[i][j];\n    }\n    for (j = 1; j <= col; j++)\n      sum = sum + a[1][j];\n    for (i = 2; i <= row; i++) {\n      sum = sum + a[i][col];\n    }\n    for (j = 1; j <= col - 1; j++)\n      sum = sum + a[row][j];\n    for (i = 2; i <= row - 1; i++)\n      sum = sum + a[i][1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int row;\n    int col;\n    int total = 0;\n    int s[100][100];\n    cin >> row >> col;\n    int x, y;\n    for (x = 0; x < row; x++) {\n      for (y = 0; y < col; y++) {\n        cin >> s[x][y];\n      }\n    }\n    if (row < 3 || col < 3) {\n      for (x = 0; x < row; x++) {\n        for (y = 0; y < col; y++) {\n          total += s[x][y];\n        }\n      }\n      printf(\"%d\\n\", total);\n    } else {\n      for (y = 0; y < col; y++) {\n        total += s[0][y];\n      }\n      for (y = 0; y < col; y++) {\n        total += s[row - 1][y];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][0];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][col - 1];\n      }\n      total =\n          total - s[0][0] - s[0][col - 1] - s[row - 1][0] - s[row - 1][col - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l;\n  int m[100], n[100];\n  int sum[100] = {0};\n  int a[100][100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (l = 0; l < n[i] - 1; l++) {\n      sum[i] += a[0][l][i];\n    }\n    for (j = 0; j < m[i] - 1; j++)\n      sum[i] += a[j][n[i] - 1][i];\n\n    for (l = n[i] - 1; l > 0; l--) {\n      sum[i] += a[m[i] - 1][l][i];\n    }\n    for (j = m[i] - 1; j > 0; j--) {\n      sum[i] += a[j][0][i];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int s = 0;\n    for (int i = 0; i < n; i++) {\n      s += *(*(a) + i);\n    }\n    if (m > 1)\n      for (int i = 0; i < n; i++) {\n        s += *(*(a + m - 1) + i);\n      }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + 0);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + n - 1);\n    }\n    cout << s;\n    if (i != k - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  scanf(\"%d \", &k);\n  for (int p = 0; p < k; p++) {\n    int sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum = sum + a[i][0];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n != 1) {\n      for (i = 0; i < n; i++) {\n        sum = sum + a[0][i];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[0][0]);\n    } else {\n\n      for (i = 0; i < n; i++) {\n        sum1 = sum1 + a[0][i];\n        sum2 = sum2 + a[m - 1][i];\n      }\n      for (i = 0; i < m; i++) {\n        sum3 = sum3 + a[i][0];\n        sum4 = sum4 + a[i][n - 1];\n      }\n      sum = sum1 + sum2 + sum3 + sum4 -\n            (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10488", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum(int m, int n) {\n  int i, j, sz[100][100], num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  for (i = 0, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = m - 1, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = 1, j = 0; i < m - 1; i++) {\n    num += sz[i][j];\n  }\n  for (i = 1, j = n - 1; i < m - 1; i++)\n    num += sz[i][j];\n  return num;\n}\n\nint main() {\n  int k, i, num, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    num = sum(m, n);\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "6", "index": "10489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  int a[100][100];\n  int sum;\n  int n[200];\n  int g;\n  int s[200];\n  for (g = 0; g <= t - 1; g++) {\n    cin >> s[g];\n    cin >> n[g];\n\n    int i;\n    int j;\n    for (i = 0; i <= s[g] - 1; i++)\n      for (j = 0; j <= n[g] - 1; j++) {\n        cin >> a[i][j];\n      }\n\n    sum = 0;\n    for (i = 0; i <= s[g] - 1; i++) {\n      sum = sum + **(a + i);\n      sum = sum + *(*(a + i) + n[g] - 1);\n    }\n    for (j = 0; j <= n[g] - 1; j++) {\n      sum = sum + *(*a + j);\n      sum = sum + *(*(a + s[g] - 1) + j);\n    }\n    sum = sum - **a - *(*(a + s[g] - 1) + n[g] - 1) - *(*a + n[g] - 1) -\n          **(a + s[g] - 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100][100], n, m, i, j, sum;\n  cin >> k;\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m == 1 && n != 1)\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    }\n    if (n == 1 && m == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i + 1];\n      for (i = 0; i < m - 1; i++)\n        sum += a[i + 1][0] + a[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b;\n  scanf(\"%d\", &k);\n  int s[k];\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s[i] = s[i] + sz[0][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      s[i] = s[i] + sz[a][0];\n      s[i] = s[i] + sz[a][n - 1];\n    }\n    if (m != 1) {\n      for (b = 0; b < n; b++) {\n        s[i] = s[i] + sz[m - 1][b];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int b[100][100];\n    int *a[100][100];\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = &b[i][j];\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(b + i) + j);\n\n        if (i == 0)\n          sum = sum + **(*(a + i) + j);\n        if (i == m - 1)\n          sum = sum + **(*(a + i) + j);\n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += ***(a + i);\n      sum += **(*(a + i) + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, q, j, s1 = 0, s2 = 0, s, a[100][100];\n  cin >> k;\n  for (q = 0; q < k; q++) {\n    cin >> m >> n;\n    s1 = 0;\n    s2 = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        s1 = s1 + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        s2 = s2 + a[i][j];\n\n    s = s1 - s2;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10494", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[10001];\n  int *p;\n  int i, j, k;\n  int b, c;\n  int s = 0;\n  p = &a[0];\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d %d\", &b, &c);\n\n    for (k = 1; k <= b; k++) {\n      for (i = 1; i <= c; i++) {\n        scanf(\"%d\", p);\n        if ((k == 1 && i != 1 && i != c) || (k == b && i != 1 && i != c) ||\n            i == 1 || i == c) {\n          s = s + *p;\n        }\n        p++;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    p = &a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m1[120], m2[120], a[100][120][120];\n  int i, j, k, s = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &m1[i], &m2[i]);\n    for (j = 0; j < m1[i]; j++)\n      for (k = 0; k < m2[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (m1[i] == 1) {\n      for (j = 0; j < m2[i]; j++)\n        s = s + a[i][0][j];\n    } else if (m2[i] == 1) {\n      for (j = 0; j < m1[i]; j++)\n        s = s + a[i][j][0];\n    } else {\n      for (j = 0; j < m2[i] - 1; j++)\n        s = s + a[i][0][j];\n      for (j = 0; j < m1[i] - 1; j++)\n        s = s + a[i][j][m2[i] - 1];\n      for (j = m2[i] - 1; j > 0; j--)\n        s = s + a[i][m1[i] - 1][j];\n      for (j = m1[i] - 1; j > 0; j--)\n        s = s + a[i][j][0];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int time = 0; time < t; time++) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int i = 0; i < n; i++)\n      sum += *(*a + i) + (n > 1) * *(*(a + m - 1) + i);\n    for (int i = 1; i < m - 1; i++)\n      sum += *(*(a + i)) + (m > 1) * *(*(a + i) + n - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p, i, all, m, n, cycle, ii;\n\n  scanf(\"%d\", &cycle);\n  for (ii = 0; ii < cycle; ii++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)calloc(m * n, sizeof(int));\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    all = 0;\n    for (i = 0; i < n; i++)\n      all += *(p + i);\n    if (m > 1) {\n      for (i = 0; i < n; i++)\n        all += *(p + i + (m - 1) * n);\n    }\n    for (i = 2; i < m; i++)\n      all += *(p + (i - 1) * n);\n    if (n > 1) {\n      for (i = 2; i < m; i++)\n        all += *(p + n - 1 + (i - 1) * n);\n    }\n    cout << all << \" \";\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "10498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, i, m, n, k, s = 0, *b, j;\n  scanf(\"%d\", &k);\n  b = (int *)calloc(k, sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    a = (int *)calloc(m * n, sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", a + j);\n    for (j = 0; j < m; j++)\n      s = s + *(a + j * n) + *(a + j * n + n - 1);\n\n    for (j = 1; j < n - 1; j++)\n      s = s + *(a + j) + *(a + (m - 1) * n + j);\n\n    *(b + i) = s;\n    free(a);\n    s = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", *(b + i));\n    if (i < k - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "6", "index": "10499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, b;\n  int sz[1000][1000];\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    int e, k, h = 0;\n    for (e = 0; e < m; e++) {\n      if (e == 0) {\n        for (k = 0; k < n; k++) {\n          h += sz[e][k];\n        }\n      }\n      if (e == m - 1) {\n        for (k = 0; k < n; k++)\n          h += sz[e][k];\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (k == n - 1) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n      if (k == 0) {\n        for (e = 1; e < m - 1; e++) {\n          h += sz[e][k];\n        }\n      }\n    }\n    printf(\"%d \", h);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, i, k, m, n, t, sum[100] = {0}, j, q, x;\n  scanf(\"%d\\n%\", &k);\n  p = (int *)malloc(10000 * sizeof(int));\n  for (x = 0; x < k; x++) {\n    cin >> m >> n;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    for (j = 0; j < n; j++)\n      sum[x] = sum[x] + (*(p + j)) + (*(p + n * (m - 1) + j));\n    for (q = 1; q < m - 1; q++)\n      sum[x] = sum[x] + (*(p + q * n)) + (*(p + q * n + n - 1));\n  }\n  for (x = 0; x < k; x++)\n    cout << sum[x] << \"\\n\";\n}\n"}
{"label": "6", "index": "10501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, y;\n  int z[100][100];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    y = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int t = 0; t < n; t++) {\n        scanf(\"%d\", &z[j][t]);\n      }\n    }\n    for (int a = 0; a < m; a++) {\n      y = y + z[a][0] + z[a][n - 1];\n    }\n    for (int b = 0; b < n; b++) {\n      y = y + z[0][b] + z[m - 1][b];\n    }\n    y = y - z[0][0] - z[0][n - 1] - z[m - 1][0] - z[m - 1][n - 1];\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      printf(\"%d\\n\", sum);\n      continue;\n    }\n    if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += *(*(a + i));\n      cout << sum << endl;\n      continue;\n    }\n    for (i = 0; i < n; i++) {\n      sum += *(*(a) + i);\n      sum += *(*(a + m - 1) + i);\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum += *(*(a + i));\n      sum += *(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10503", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0;\n    cin >> m >> n;\n    int mat[100][100] = {0};\n    int sum = 0;\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> *(*(mat + j) + k);\n        if ((j == 0) || (j == m - 1) || (k == 0) || (k == n - 1))\n          sum = sum + *(*(mat + j) + k);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10504", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nint main() {\n  int t;\n  cin >> t;\n  for (int time = 0; time < t; time++) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int i = 0; i < n; i++)\n      sum += *(*a + i) + (n > 1) * *(*(a + m - 1) + i);\n    for (int i = 1; i < m - 1; i++)\n      sum += *(*(a + i)) + (m > 1) * *(*(a + i) + n - 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k;\n  scanf(\"%d\", &k);\n  int s1 = 0, s2 = 0, s3 = 0, s4 = 0, s = 0;\n  int r = 0, c = 0;\n\n  int jz[100][100];\n  int m, n;\n  int i = 1;\n  while (i <= k) {\n    scanf(\"%d %d \", &m, &n);\n    for (int jm = 0; jm < m; jm++) {\n      for (int jn = 0; jn < n; jn++) {\n        scanf(\"%d\", &jz[jm][jn]);\n      }\n    }\n    r = 0;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s1 += jz[r][c];\n    }\n    r = m - 1;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s2 += jz[r][c];\n    }\n    r = 0;\n    c = 0;\n    for (r = 0; r < m; r++) {\n      s3 += jz[r][c];\n    }\n    r = 0;\n    c = n - 1;\n    for (r = 0; r < m; r++) {\n      s4 += jz[r][c];\n    }\n    s = s1 + s2 + s3 + s4 - jz[0][0] - jz[0][n - 1] - jz[m - 1][0] -\n        jz[m - 1][n - 1];\n    printf(\"%d\", s);\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n\n    if (i != k) {\n      cout << \"\\n\";\n    }\n\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10506", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int nn, ii;\n  scanf(\"%d\", &nn);\n  for (ii = 1; ii <= nn; ii++) {\n    int n, m, t, i, j, x, y, sum = 0;\n    scanf(\"%d %d\", &y, &x);\n    for (i = 1; i <= y; i++) {\n      for (j = 1; j <= x; j++) {\n        cin >> t;\n        if (i == 1 || i == y || j == x || j == 1) {\n          sum += t;\n        }\n      }\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, h, l, result = 0;\n  int a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[h][l];\n      }\n    }\n    for (l = 1; l <= n; l++) {\n      result = result + a[1][l] + a[m][l];\n    }\n    for (h = 2; h <= m - 1; h++) {\n      result = result + a[h][1] + a[h][n];\n    }\n    cout << result << endl;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++)\n        a[h][l] = 0;\n    }\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10508", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num, n, m, a[100][100];\nint main() {\n  cin >> num;\n  for (int x = 0; x < num; x++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int i = 0; i < m; i++)\n      ans += a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      ans += a[0][i] + a[m - 1][i];\n    printf(\"%d\\n\", ans);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "10509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, b, i, j, k, sum;\n  int s[100][100];\n  int(*p)[100];\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    p = s;\n    sum = 0;\n    scanf(\"%d %d\", &a, &b);\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100];\n  int k, m, n, i, j, t;\n\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[t] = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      sum[t] += a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum[t] += a[0][j] + a[m - 1][j];\n    }\n    sum[t] -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n  }\n\n  for (t = 0; t < k; t++) {\n    if (t != k - 1) {\n      printf(\"%d\\n\", sum[t]);\n    } else {\n      cout << sum[t];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10511", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int *p = NULL;\n  int a[100][100];\n  scanf(\"%d \", &k);\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (int j = 0; j <= m - 1; j++) {\n      for (int t = 0; t <= n - 1; t++) {\n        cin >> a[j][t];\n      }\n    }\n    p = &a[0][0];\n    for (p = &a[0][0]; p <= &a[0][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    for (p = &a[1][0]; p <= &a[m - 2][0]; p = p + 100) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    for (p = &a[m - 1][0]; p <= &a[m - 1][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, b, i, j, k, sum;\n  int s[100][100];\n  int(*p)[100];\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    p = s;\n    sum = 0;\n    scanf(\"%d %d\", &a, &b);\n    for (i = 0; i < a; i++)\n      for (j = 0; j < b; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1) {\n          sum += *(*(p + i) + j);\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, a[100][100][100], len[100], cro[100], b[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &len[i], &cro[i]);\n    for (j = 0; j < len[i]; j++) {\n      for (l = 0; l < cro[i]; l++)\n        cin >> a[i][j][l];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < cro[i]; j++) {\n      b[i] += a[i][0][j];\n    }\n    for (j = 1; j < len[i]; j++) {\n      b[i] += a[i][j][(cro[i] - 1)];\n    }\n    for (j = 0; j < cro[i] - 1; j++) {\n      b[i] += a[i][len[i] - 1][j];\n    }\n    for (j = 1; j < len[i] - 1; j++) {\n      b[i] += a[i][j][0];\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10514", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, s1, s2, q1, q2, a, b, t, k, p, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int pi[100001];\n    s1 = 0;\n    s2 = 0;\n    q1 = 0;\n    q2 = 0;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 1; j <= a * b; j++) {\n      scanf(\"%d\", pi + j - 1);\n    }\n    for (t = 1; t <= b; t++) {\n      s1 = s1 + *(pi + t - 1);\n      s2 = s2 + *(pi + a * b - t);\n    }\n    for (p = 1; p < a - 1; p++) {\n      q1 = q1 + *(pi + p * b);\n      q2 = q2 + *(pi + b - 1 + p * b);\n    }\n    s = s1 + s2 + q1 + q2;\n    if (a == 1 & b == 1) {\n      printf(\"%d\\n\", s / 2);\n    } else {\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n\n        if (i == 0)\n          sum = sum + a[i][j];\n        if (i == m - 1)\n          sum = sum + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, s, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    s = 0;\n\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (m == 1 && n == 1) {\n      cout << a[0][0];\n      continue;\n    }\n    for (j = 0; j < n; j++) {\n      s = s + *(a[0] + j);\n      s = s + *(a[m - 1] + j);\n    }\n    for (i = 0; i < m; i++) {\n      s = s + *(a[i] + 0);\n      s = s + *(a[i] + n - 1);\n    }\n    s = s - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10517", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, row, col, c[100][100], result[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d \", &row, &col);\n    for (j = 0; j < row; j++) {\n      for (k = 0; k < col; k++) {\n        scanf(\"%d\", *(c + j) + k);\n        if (k == 0 || k == col - 1 || j == 0 || j == row - 1)\n          result[i] += *(*(c + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", result[i]);\n}\n"}
{"label": "6", "index": "10518", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int i, j, l, lin, col, sum = 0;\n  int num[101][101];\n  for (l = 1; l <= k; l++) {\n    cin >> lin >> col;\n    for (i = 1; i <= lin; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> num[i][j];\n    }\n\n    if (lin >= 2 && col >= 2) {\n      for (i = 2; i <= lin - 1; i++)\n        sum = sum + num[i][1] + num[i][col];\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j] + num[lin][j];\n    }\n    if (lin == 1 && col >= 2) {\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j];\n    }\n    if (col == 1 && lin >= 2) {\n      for (i = 1; i <= lin; i++)\n        sum = sum + num[i][1];\n    }\n    if (col == 1 && lin == 1)\n      sum = sum + num[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i1, i2, i3, j, total;\n  scanf(\"%d\", &k);\n  for (i1 = 1; i1 <= k; i1++) {\n    scanf(\"\\n%d %d\", &m, &n);\n    total = 0;\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      scanf(\"\\n%d\", &a[i2][0]);\n      for (i3 = 1; i3 <= n - 1; i3++) {\n        scanf(\" %d\", &a[i2][i3]);\n      }\n    } \n\n    if (m == 1 && n == 1) {\n      total = a[0][0];\n      printf(\"%d\\n\", total);\n      continue;\n    }\n    for (i2 = 0; i2 <= n - 1; i2++) {\n      total = total + a[0][i2] + a[m - 1][i2];\n    }\n    for (i2 = 0; i2 <= m - 1; i2++) {\n      total = total + a[i2][0] + a[i2][n - 1];\n    }\n    total = total - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n\n    printf(\"%d\\n\", total);\n  }\n}\n"}
{"label": "6", "index": "10520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, k;\n  scanf(\"%d \", &k);\n  int i = 0, j = 0, h = 0;\n  for (i = 0; i < k; i++) {\n    int b = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (h = 0; h < n; h++)\n        cin >> *(*(a + j) + h);\n    for (j = 0; j < m; j++)\n      b = b + **(a + j);\n    for (j = 1; j < n; j++)\n      b = b + *(*a + j);\n    for (j = 1; j < m; j++)\n      b = b + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      b = b + *(*(a + m - 1) + j);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A[100][100];\nint main() {\n  int *pt;\n  int i, j, k;\n  int m, n;\n  int *re;\n  int B[200];\n  int number;\n  scanf(\"%d\", &number);\n  re = B;\n  for (i = 0; i < 200; i++) {\n    *(re + i) = 0;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        *(*(A + j) + k) = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", *(A + j) + k);\n      }\n    }\n    pt = *A;\n    for (j = 0; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt++;\n      } else {\n        *re = *re + *pt;\n        pt = pt + 100;\n      }\n    }\n    for (j = 1; j < m; j++) {\n      if (j < (m - 1)) {\n        *re = *re + *pt;\n        pt = pt + 100;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 1;\n      }\n    }\n    for (j = 1; j < n; j++) {\n      if (j < (n - 1)) {\n        *re = *re + *pt;\n        pt--;\n      } else {\n        *re = *re + *pt;\n        pt = pt - 100;\n      }\n    }\n    for (j = 1; j < (m - 1); j++) {\n      *re = *re + *pt;\n      pt = pt - 100;\n    }\n    re++;\n  }\n  re = B;\n  for (i = 0; i < number; i++) {\n    printf(\"%d\\n\", *(re + i));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100][100];\n  int k, i, g, t, r;\n  int s[100];\n  int z[100];\n  scanf(\"%d\", &k);\n  for (g = 0; g <= k - 1; g++) {\n    scanf(\"%d %d\", &s[g], &z[g]);\n    for (i = 0; i <= s[g] - 1; i++) {\n      for (t = 0; t <= z[g] - 1; t++) {\n        scanf(\"%d\", &sz[g][i][t]);\n      }\n    }\n  }\n\n  for (g = 0; g <= k - 1; g++) {\n    if (s[g] >= 3 && z[g] >= 3) {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        r = r + sz[g][i][0] + sz[g][i][z[g] - 1];\n      }\n      for (t = 1; t <= z[g] - 2; t++) {\n        r = r + sz[g][0][t] + sz[g][s[g] - 1][t];\n      }\n      printf(\"%d\\n\", r);\n    } else {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        for (t = 0; t <= z[g] - 1; t++) {\n          r = r + sz[g][i][t];\n        }\n      }\n      printf(\"%d\\n\", r);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++) {\n      sum1 = sum1 + a[0][j];\n      if ((m - 1) != 0)\n        sum2 = sum2 + a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum3 = sum3 + a[i][0];\n      if ((n - 1) != 0)\n        sum4 = sum4 + a[i][n - 1];\n    }\n    cout << sum1 + sum2 + sum3 + sum4 << \"\\n\";\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint imat[100][100];\n\nint main() {\n  int n;\n  cin >> n;\n  int a, b;\n  for (int i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        cin >> imat[j][k];\n      }\n    }\n\n    int(*p)[100] = &(imat[0]);\n\n    int counter = 0;\n\n    for (int i = 0; i < a; i++) {\n      for (int j = 0; j < b; j++) {\n        if (j % b == 0 || j % b == (b - 1) || i == 0 || i == (a - 1))\n          counter = counter + *(*(p + i) + j);\n      }\n    }\n\n    printf(\"%d\\n\", counter);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, s, x;\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    s = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 1 || i == m | j == 1 || j == n) {\n          s += x;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum, a, b, m, n, k, i, j;\n  int num[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (a = 0; a < 100; a++) {\n      for (b = 0; b < 100; b++) {\n        num[a][b] = 0;\n      }\n    }\n    scanf(\"%d %d\", &m, &k);\n    if (m == 1 && k == 1) {\n      scanf(\"%d\", &j);\n      printf(\"%d\", j);\n    } else if (m == 1 && k != 1) {\n      for (a = 0; a < k; a++) {\n        scanf(\"%d\", &num[0][a]);\n        sum = sum + num[0][a];\n      }\n      printf(\"%d\", sum);\n    } else if (m != 1 && k == 1) {\n      for (a = 0; a < m; a++) {\n        scanf(\"%d\", &num[a][0]);\n        sum = sum + num[a][0];\n      }\n      printf(\"%d\", sum);\n    } else {\n      for (a = 0; a < m; a++) {\n        for (b = 0; b < k; b++) {\n          scanf(\"%d\", &num[a][b]);\n        }\n      }\n      for (a = 0; a < k; a++) {\n        sum = sum + num[0][a] + num[m - 1][a];\n      }\n      for (a = 1; a < (m - 1); a++) {\n        sum = sum + num[a][0] + num[a][k - 1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n}\n"}
{"label": "6", "index": "10527", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n;\n    int data[100][100];\n    cin >> m >> n;\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &data[i][j]);\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + data[i][0] + data[i][n - 1];\n    for (i = 1; i < n - 1; i++)\n      sum = sum + data[0][i] + data[m - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[1000], n[1000], i, a, b, x, sum;\n  scanf(\"%d\", &k);\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n    for (a = 0; a < m[i]; a++) {\n      for (b = 0; b < n[i]; b++) {\n        scanf(\"%d\", &x);\n        if (a == 0 || b == 0 || a == m[i] - 1 || b == n[i] - 1)\n          sum += x;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], times, x, y, i, j, k, sum = 0;\n  int *pointer = NULL;\n  cin >> times;\n  for (i = 1; i <= times; i++) {\n    sum = 0;\n    cin >> x >> y;\n    for (k = 0; k < x; k++) {\n      for (j = 0; j < y; j++) {\n        cin >> a[k][j];\n        pointer = &a[k][j];\n        if (k == 0 || j == 0 || k == x - 1 || j == y - 1) {\n          sum = sum + *pointer;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10530", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, k, j, l, a, i;\n  scanf(\"%d \", &k);\n  int aa[k + 1];\n  for (i = 1; i <= k; i++) {\n    aa[i] = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a;\n        if (j == 1 || j == m || l == 1 || l == n)\n          aa[i] = aa[i] + a;\n      }\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", aa[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int b[100];\n  int m, j, r, n, k, p;\n\n  scanf(\"%d\", &p);\n  for (m = 0; m < p; m++) {\n    scanf(\"%d %d\", &n, &k);\n    for (j = 0; j < n; j++) {\n      for (r = 0; r < k; r++) {\n        scanf(\"%d\", &a[j][r]);\n      }\n    }\n    b[m] = 0;\n    for (j = 0; j < 1; j++) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (j = n - 1; j > n - 2; j--) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = 0; r < 1; r++) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = k - 1; r > k - 2; r--) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n  }\n  for (m = 0; m < p; m++) {\n    printf(\"%d\\n\", b[m]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &k);\n  for (w = 0; w < k; w++) {\n    c = 0;\n    scanf(\"%d %d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      p[i] = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p[i] + j);\n    if (m == 1)\n      for (i = 0; i < n; i++)\n        c = c + p[0][i];\n    else {\n      if (n == 1)\n        for (i = 0; i < m; i++)\n          c = c + p[i][0];\n      else {\n        for (i = 0; i < n; i++)\n          c = c + p[0][i] + p[m - 1][i];\n        for (i = 1; i < m - 1; i++)\n          c = c + p[i][0] + p[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", c);\n    for (i = 0; i < m; i++)\n      free(p[i]);\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int p = 0, i = 0, j = 0, k = 0, n = 0, m = 0, *q = NULL;\n  scanf(\"%d \", &k);\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0, a[100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[j];\n      q = a;\n      while (q <= &a[n - 1]) {\n        if (i == 0 || i == m - 1) {\n          sum = sum + *q;\n          q++;\n        } else {\n          if (q == &a[0] || q == &a[n - 1])\n            sum = sum + *q;\n          q++;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int he, m, n, k, sz[100][100];\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (int q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[j][q]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << sz[0][0] << \"\\n\";\n    } else {\n      he = 0;\n      for (j = 0; j < m; j++) {\n        if (m == 1) {\n          he += sz[j][0];\n        } else {\n          he += sz[j][0] + sz[j][n - 1];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        if (n == 1) {\n          he += sz[0][j];\n        } else {\n          he += sz[0][j] + sz[m - 1][j];\n        }\n      }\n      printf(\"%d\\n\", he);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, sum, temp, c, d, e, q, w, r, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  int m[100], n[100];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    sum = 0;\n    temp = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n    for (j = 0; j < n[i]; j++) {\n      temp = temp + a[0][j];\n    }\n    for (j = 0; j < n[i]; j++) {\n      c = c + a[m[i] - 1][j];\n    }\n    for (j = 0; j < m[i]; j++) {\n      d = d + a[j][0];\n    }\n    for (j = 0; j < m[i]; j++) {\n      e = e + a[j][n[i] - 1];\n    }\n    if (m[i] == 1 && n[i] == 1) {\n      sum = a[0][0];\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] == 1 && n[i] != 1) {\n      for (j = 0; j < n[i]; j++)\n        sum = sum + a[0][j];\n\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] == 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[j][0];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] != 1) {\n      q = a[0][0];\n      w = a[0][n[i] - 1];\n      r = a[m[i] - 1][0];\n      t = a[m[i] - 1][n[i] - 1];\n      sum = c + d + e + temp - q - w - r - t;\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0;\n    cin >> m >> n;\n    int mat[100][100] = {0};\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> *(*(mat + j) + k);\n        if ((j == 0) || (j == m - 1) || (k == 0) ||\n            (k == n - 1)) \n        {\n          sum = sum + *(*(mat + j) + k);\n        }\n      }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], num[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i][0] >> a[i][1];\n    num[i] = 0;\n    int b[100][100];\n    for (int j = 0; j < a[i][0]; j++) {\n      for (int k = 0; k < a[i][1]; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[0][j];\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[a[i][0] - 1][j];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][0];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][a[i][1] - 1];\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, *p[100], i, *w[100], j, r, s = 0;\n  cin >> k;\n  for (j = 0; j < k; j++)\n    w[j] = (int *)malloc(2 * sizeof(int));\n  for (j = 0; j < k; j++) {\n    scanf(\"%d %d\\n\", w[j], w[j] + 1);\n    m = *(w[j]);\n    n = *(w[j] + 1);\n    for (r = 0; r < m; r++)\n      p[r] = (int *)malloc(100 * sizeof(int));\n    for (r = 0; r < m; r++)\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", p[r] + i);\n    for (r = 0, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (r = m - 1, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (i = 0, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    for (i = n - 1, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    cout << s << \"\\n\";\n    s = 0;\n    free(p[0]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10539", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, x, y, t, ans[1000] = {0};\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> x >> y;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= y; j++) {\n        cin >> t;\n        if ((i == 1) || (i == x) || (j == 1) || (j == y))\n          ans[k] += t;\n      }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << ans[i];\n    if (i != n)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, jz[100][100], ROW, COL, h[100], y, i, row, col;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &jz[row][col]);\n      }\n    }\n    y = 0;\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][0];\n    }\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][COL - 1];\n    }\n\n    for (col = 0; col < COL; col++)\n      y += jz[0][col];\n\n    for (col = 0; col < COL; col++) {\n      y += jz[ROW - 1][col];\n    }\n\n    h[i] =\n        y - jz[0][0] - jz[0][COL - 1] - jz[ROW - 1][0] - jz[ROW - 1][COL - 1];\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", h[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, sum[100] = {0}, *p;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", p + i * n + j);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum[t] += *(p + i * n + j);\n      }\n    }\n  }\n  for (t = 0; t < k; t++)\n    printf(\"%d\\n\", sum[t]);\n}\n"}
{"label": "6", "index": "10542", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  while (n--) {\n    int x, y, sum = 0;\n    cin >> x >> y;\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        cin >> a[i][j];\n      }\n    for (int i = 0; i < x; i++) {\n      if (y != 1)\n        sum += a[i][0] + a[i][y - 1];\n      else\n        sum += a[i][0];\n    }\n    for (int j = 1; j < y - 1; j++)\n      sum += a[0][j] + a[x - 1][j];\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, i;\n  int h, s, t, p;\n  int sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n, &m);\n    for (a = 0; a < n; a++) {\n      for (b = 0; b < m; b++)\n        cin >> sz[a][b];\n    }\n    h = 0, s = 0, t = 0, p = 0;\n    for (b = 0; b < m; b++) {\n      h = h + sz[0][b];\n      if (n > 1) {\n        s = s + sz[n - 1][b];\n      }\n    }\n    for (a = 1; a < n - 1; a++) {\n      t = t + sz[a][0];\n      if (m > 1) {\n        p = p + sz[a][m - 1];\n      }\n    }\n    result[i] = h + s + t + p;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10544", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[110][110];\n  int num, sum = 0;\n  int k, m, n, i, j, l;\n\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num;\n        a[i][j] = num;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum = sum + a[0][i];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + a[i][n - 1];\n    }\n    for (i = 1; i < m; i++)\n      sum = sum + a[i][0];\n\n    for (i = 1; i < n - 1; i++) {\n      sum = sum + a[m - 1][i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int K, i, j, k, m, n, a[100][100] = {0}, sum, p, q, result[100] = {0};\n  scanf(\"%d\", &K);\n  for (i = 1; i <= K; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", *(a + j) + k);\n    if (m == 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    if (m > 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q) + *(*(a + m - 1) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, a[100][100], i, j;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < m; i++)\n      sum = sum + **(p + i) + *(*(p + i) + n - 1);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j) + *(*(p + m - 1) + j);\n    sum = sum - **p - *(*p + n - 1) - **(p + m - 1) - *(*(p + m - 1) + n - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k--) {\n    int m, n, i, j;\n    int a[100][100];\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += a[0][j];\n      sum += a[m - 1][j];\n    }\n    i = 1;\n    while (i < m - 1) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n      i++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    int row, col;\n    cin >> row >> col;\n    int number[100][100];\n\n    int k, m;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        cin >> number[k][m];\n      }\n    }\n    int sum = 0;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        if (k == 0 || m == 0 || k == row - 1 || m == col - 1) {\n          sum += number[k][m];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint main() {\n  int k, m, n, sum, i, j;\n  scanf(\"%d\", &k);\n  while (k--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n      }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10550", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int w, k;\n  scanf(\"%d\", &w);\n  for (k = 0; k < w; k++) {\n\n    int n, m, sz[100][100], i, j;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    int a = 0, b = 0, c = 0, d;\n    for (j = 0; j < m; j++) {\n      a += sz[0][j];\n    }\n\n    for (j = 0; j < m; j++) {\n      b += sz[n - 1][j];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      c += sz[i][0] + sz[i][m - 1];\n    }\n    d = a + b + c;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[100], n[100];\n  int a[100][10000];\n  int i, j, s, sum = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    s = m[i] * n[i];\n    for (j = 0; j < s; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0, sum = 0; j < m[i] * n[i]; j++) {\n      if (j < n[i])\n        sum = sum + a[i][j];\n      else if (j % n[i] == 0)\n        sum = sum + a[i][j];\n      else if ((j + 1) % n[i] == 0)\n        sum = sum + a[i][j];\n      else if (j > m[i] * n[i] - n[i] - 1)\n        sum = sum + a[i][j];\n      else\n        continue;\n    }\n    if (i == 0)\n      printf(\"%d\", sum);\n    else\n      printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint count(int b, int c) {\n  int m = b, n = c;\n  int i, j, sum, num[100][100], (*a)[100];\n\n  a = num;\n  sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", *(a + i) + j);\n    scanf(\"%d\", *(a + i) + (n - 1));\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + (*(*a + j)) + (*(*(a + m - 1) + j));\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + (*(*(a + i))) + (*(*(a + i) + (n - 1)));\n  }\n  return sum;\n}\n\nint main() {\n  int i, k, m, n, sum[100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[i] = count(m, n);\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    int a[100][100], m, n;\n    int *p;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      p = &a[0][i];\n      sum += *p;\n    }\n    if (m != 1)\n      for (i = 0; i < n; i++) {\n        p = &a[m - 1][i];\n        sum += *p;\n      }\n    for (i = 1; i < m - 1; i++) {\n      p = a[i];\n      sum += *p;\n    }\n    for (i = 1; i < m - 1; i++) {\n      p = &a[i][n - 1];\n      sum += *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int MAX = 100;\n\nint main() {\n  int k;\n  int A[MAX][MAX];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &A[i][j]);\n      }\n    }\n    int sum = 0;\n\n    if ((m != 1) && (n != 1)) {\n      for (int j = 0; j < n; j++) {\n        sum += A[0][j];\n      }\n      for (int j = 0; j < n; j++) {\n        sum += A[m - 1][j];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][0];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][n - 1];\n      }\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][0] - A[m - 1][n - 1];\n    }\n\n    else {\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < n; j++)\n          sum += A[i][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, k, j, l, a, i;\n  cin >> k;\n  int aa[k + 1];\n  for (i = 1; i <= k; i++) {\n    aa[i] = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a;\n        if (j == 1 || j == m || l == 1 || l == n)\n          aa[i] = aa[i] + a;\n      }\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << aa[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, tri[100][100], h, l, *point = tri[0];\n  cin >> t;\n  for (int i = 1; i <= t; i++) {\n    cin >> h >> l;\n    int temp = 0;\n    for (int p = 1; p <= h; p++) {\n      for (int q = 1; q <= l; q++) {\n        cin >> *(point + 100 * p + q);\n        if (p == 1 || q == 1 || p == h || q == l)\n          temp += *(point + 100 * p + q);\n      }\n    }\n    cout << temp << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k, x;\n  x = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int row = 0; row < m; row++) {\n      for (int col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (int row = 0; row < m; row++)\n      x += sz[row][0];\n\n    for (int col = 1; col < n; col++) {\n      x += sz[0][col];\n    }\n    for (int row = 1; row < m; row++) {\n      x += sz[row][n - 1];\n    }\n    for (int col = 1; col < n - 1; col++) {\n      x += sz[m - 1][col];\n    }\n    cout << x << \"\\n\";\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void jisuan(int array[100][100], int x, int y);\n  int k, i, m, n, p, q, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    jisuan(a, m, n);\n  }\n}\nvoid jisuan(int array[100][100], int x, int y) {\n  int i, j, a, b, c, d, sum;\n  for (j = 0, a = 0; j < y; j++) {\n    a = a + array[0][j];\n  }\n  for (i = 1, b = 0; i < x; i++)\n    b = b + array[i][y - 1];\n\n  for (j = y - 2, c = 0; j >= 0; j--) {\n    c = c + array[x - 1][j];\n  }\n  for (i = x - 2, d = 0; i > 0; i--) {\n    d = d + array[i][0];\n  }\n  sum = a + b + c + d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "6", "index": "10559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int zong;\n  int sz[100][100], m, n, k, i, j, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  scanf(\"%d\", &zong);\n  for (k = 0; k < zong; k++) {\n    int sum = 0;\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i < m; i++) {\n      cin >> sz[0][i];\n      sum1 += sz[0][i];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[n - 1][i]);\n      sum2 += sz[n - 1][i];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      sum3 += sz[i][0];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      sum4 += sz[i][m - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p = {NULL}, a[100][100], z, m, n, i = 1, j = 0, s;\n  cin >> z;\n  while (i <= z) {\n    s = 0;\n    cin >> m >> n;\n    p = *a;\n    for (j = 0; j < m * n; j++) {\n      cin >> *p++;\n      if (j < n || j >= n * (m - 1) || j % n == 0 || (j + 1) % n == 0)\n        s += *(p - 1);\n    }\n    cout << s << endl;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10561", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a;\n  int sz[100][100], s;\n  s = 0;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          s = s + sz[i][j];\n    }\n\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10562", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0;\n    cin >> m >> n;\n    int mat[100][100] = {0};\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> *(*(mat + j) + k);\n        if ((j == 0) || (j == m - 1) || (k == 0) || (k == n - 1))\n          sum = sum + *(*(mat + j) + k);\n      }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int(*p)[100];\n    p = a;\n    int sum = 0;\n    cin >> m >> n;\n\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    if (m != 1 && n != 1) {\n      for (int l = 0; l < n; l++) {\n        sum += *(*p + l) + *(*(p + m - 1) + l);\n      }\n      for (int j = 1; j < m - 1; j++) {\n        sum += *(*(p + j)) + *(*(p + j) + n - 1);\n      }\n      cout << sum << endl;\n    } else {\n      printf(\"%d\\n\", **p);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10564", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, m;\n  scanf(\"%d \", &a);\n  for (int i = 0; i < a; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    int A[100][100] = {0};\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &A[j][k]);\n      }\n    }\n    if (m == 1 && n == 1)\n      cout << A[0][0] << endl;\n    else {\n      for (int j = 0; j < m; j++) {\n        sum = sum + A[j][0] + A[j][n - 1];\n      }\n      for (int j = 0; j < n; j++)\n        sum = sum + A[0][j] + A[m - 1][j];\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][n - 1] - A[m - 1][0];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, total;\n  int a[110][110] = {0};\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    cin >> m >> n;\n    total = 0;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(a + i) + j);\n        if ((i == 1) || (i == m))\n          total = total + *(*(a + i) + j);\n      }\n    for (i = 2; i < m; i++) {\n      total = total + *(*(a + i) + 1) + *(*(a + i) + n);\n    }\n    cout << total << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (n--) {\n    int res = 0;\n    scanf(\"%d%d\", &p, &q);\n    for (int i = 0; i < p; i++)\n      for (int j = 0; j < q; j++) {\n        scanf(\"%d\", &tmp);\n        if (i == 0 || j == 0 | i == p - 1 || j == q - 1)\n          res += tmp;\n      }\n    cout << res << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, r, l;\n  int sz[100][100];\n  s = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &r);\n    scanf(\"%d\", &l);\n    for (int j = 0; j < r; j++) {\n      for (int k = 0; k < l; k++) {\n        scanf(\"%d\", &(sz[j][k]));\n        if ((j == 0) || (j == r - 1) || ((j != 0) && (k == 0)) ||\n            ((j != 0) && (k == l - 1))) {\n          s = s + sz[j][k];\n        }\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10568", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, q, j, s1 = 0, s2 = 0, s, a[100][100];\n  cin >> k;\n  for (q = 0; q < k; q++) {\n    cin >> m >> n;\n    s1 = 0;\n    s2 = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        s1 = s1 + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++) {\n        s2 = s2 + a[i][j];\n      }\n    s = s1 - s2;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, q, j, s1 = 0, s2 = 0, s, a[100][100];\n  cin >> k;\n  for (q = 0; q < k; q++) {\n    cin >> m >> n;\n    s1 = 0;\n    s2 = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        s1 = s1 + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++) {\n        s2 = s2 + a[i][j];\n      }\n    s = s1 - s2;\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10570", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n\n  for (int t = 1; t <= k; t++) {\n    scanf(\"%d %d \", &m, &n);\n    for (int q = 0; q < m; q++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &a[q][p]);\n      }\n    }\n    int col = 0, row = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    row = m - 1;\n    col = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = n - 1;\n    row = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    s = s - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d \", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10571", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[1000][1000];\nint n, m;\nint sum(int a[1000][1000]) {\n  int sum = 0;\n  for (int i = 0; i < n; i++) \n    sum += *(a[0] + i);\n  \n  for (int i = 1; i < m; i++) \n    sum += *(a[i] + (n - 1));\n  \n  for (int i = n - 2; i >= 0; i--) \n    sum += *(a[m - 1] + i);\n  \n  for (int i = m - 2; i >= 1; i--) \n    sum += *(a[i] + 0);\n  return sum;\n}\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> array_1[j][k];\n    cout << sum(array_1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a, b, c, d, s;\n  a = b = c = d = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (int p = 0; p < m; p++) {\n      for (int q = 0; q < n; q++)\n        scanf(\"%d\", &sz[p][q]);\n    }\n    if (m != 1 && n != 1) {\n      for (int e = 0; e < n; e++) {\n        a = a + sz[0][e];\n        b = b + sz[m - 1][e];\n      }\n      for (int j = 1; j < m - 1; j++) {\n        c = c + sz[j][n - 1];\n        d = d + sz[j][0];\n      }\n      s = a + b + c + d;\n      printf(\"%d\\n\", s);\n      s = a = b = c = d = 0;\n    } else {\n      cout << sz[0][0];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[500], i, j, x, k, a[100][100][100], b[500][2];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n[i] = 0;\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    for (j = 0; j < b[i][0]; j++) {\n      for (x = 0; x < b[i][1]; x++) {\n        scanf(\"%d\", &a[i][j][x]);\n        if (j == 0 || x == 0 || j == b[i][0] - 1 || x == b[i][1] - 1)\n          n[i] += a[i][j][x];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", n[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n, num, sum = 0;\n  int *p = NULL;\n  cin >> num;\n  for (k = 1; k <= num; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(a + i) + j);\n        }\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        sum = sum + *(*a + i);\n      }\n      for (i = 0; i < m - 1; i++) {\n        sum = sum + *(*(a + i) + n - 1);\n      }\n      for (i = 1; i < n; i++) {\n        sum = sum + *(*(a + m - 1) + i);\n      }\n      for (i = 1; i < m; i++) {\n        sum = sum + **(a + i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10575", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint m, n;\nvoid Input(int (*a)[102]) {\n  cin >> m >> n;\n  for (int i = 0; i <= m - 1; i++) {\n    for (int j = 0; j <= n - 1; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n}\nvoid Sum(int x, int y, int (*a)[102]) { \n  sum += *(*(a + x) + y);\n  if (x == 0 && y < n - 1)\n    Sum(x, y + 1, a);\n  else if (x < m - 1 && y == n - 1)\n    Sum(x + 1, y, a);\n  else if (x == m - 1 && y > 0)\n    Sum(x, y - 1, a);\n  else if (y == 0 && x > 1)\n    Sum(x - 1, y, a);\n  else\n    return;\n}\nint main() {\n  int a[102][102];\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    Input(a);\n    Sum(0, 0, a);\n    if (i != 1)\n      cout << endl;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int x = 1; x <= k; x++) {\n    int m, n;\n    int A[100][100];\n    int sum = 0, a;\n    cin >> m >> n;\n    for (int j = 1; j <= n; j++) {\n      cin >> a;\n      sum += a;\n    }\n    for (int i = 2; i <= m - 1; i++) {\n      cin >> a;\n      sum += a;\n      for (int j = 2; j <= n - 1; j++)\n        cin >> a;\n      cin >> a;\n      sum += a;\n    }\n    if (n != 1) {\n      for (int j = 1; j <= n; j++) {\n        scanf(\"%d \", &a);\n        sum += a;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    int m, n, j, l, s = 0, A[110];\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> *(A + l);\n      if (j == 0 || j == m - 1) {\n        for (l = 0; l < n; l++)\n          s = s + *(A + l);\n      } else\n        s = s + *A + *(A + n - 1);\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int a, b;\n    scanf(\"%d %d\", &a, &b);\n    int c[a][b];\n    int j, k;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        cin >> c[j][k];\n      }\n    }\n    int s = 0;\n    for (k = 0; k < b; k++)\n      s += c[0][k];\n\n    for (j = 1; j < a; j++) {\n      s += c[j][b - 1];\n    }\n    for (k = 0; k < b - 1; k++) {\n      s += c[a - 1][k];\n    }\n    for (j = 1; j < a - 1; j++) {\n      s += c[j][0];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, row = 0, line = 0, l = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  int a = 0, b = 0, c = 0, d = 0;\n  int total = 0, extra = 0;\n  cin >> n;\n  while (l < n) {\n    cin >> row >> line;\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < line; j++)\n        cin >> Matrix[i][j];\n    if (row == 1 || line == 1)\n      for (int i = 0; i < row; i++)\n        for (int j = 0; j < line; j++)\n          total += Matrix[i][j];\n    else {\n      extra = Matrix[0][0] + Matrix[0][line - 1] + Matrix[row - 1][0] +\n              Matrix[row - 1][line - 1];\n      for (int i = 0; i < line; i++) {\n        a += Matrix[0][i];\n        c += Matrix[row - 1][i];\n      }\n      for (int i = 0; i < row; i++) {\n        b += Matrix[i][0];\n        d += Matrix[i][line - 1];\n      }\n      total = a + b + c + d - extra;\n    }\n    printf(\"%d\\n\", total);\n    l++;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 1;\n  for (i; i <= n; i++) {\n    int p, q;\n    scanf(\"%d %d\", &p, &q);\n    int a[10000];\n    for (int j = 0; j < p * q; j++)\n      scanf(\"%d\", &a[j]);\n    int sum = 0;\n    int m = 0;\n    while (m < q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = (p - 1) * q;\n    while (m < p * q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = 1;\n    while (m < p - 1) {\n      sum = sum + a[q * m];\n      m++;\n    }\n    m = 2;\n    while (m < p) {\n      sum = sum + a[q * m - 1];\n      m++;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10581", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0;\n  int ans = 0, a = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> a;\n        if (!l || l == (n - 1))\n          ans += a;\n        else if (!j || j == (m - 1))\n          ans += a;\n      }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, **p, i, j, sum, m, n, l;\n  scanf(\"%d\", &N);\n  for (l = 0, sum = 0; l < N; l++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      *(p + i) = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "10583", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  while (k--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < n; i++) {\n      if (m == 1)\n        sum = sum + a[0][i];\n      else {\n        sum = sum + a[0][i] + a[m - 1][i];\n      }\n    }\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100][100], n, m, i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if (m == 1 && n != 1)\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    if (n == 1 && m != 1)\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    if (n == 1 && m == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < n - 1; i++)\n        sum += a[0][i] + a[m - 1][i + 1];\n      for (i = 0; i < m - 1; i++)\n        sum += a[i + 1][0] + a[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = m - 1, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = 0, j = 0; i < m; i++)\n      sum = sum + a[i][j];\n    for (i = 0, j = n - 1; i < m; i++)\n      sum = sum + a[i][j];\n    sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, sum;\n  int i, j, l;\n  int a[101][101];\n  int m, n;\n  sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 1; j <= n; j++)\n      sum = sum + a[1][j] + a[m][j];\n    for (j = 2; j <= m - 1; j++)\n      sum = sum + a[j][1] + a[j][n];\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  int a[100000];\n  for (int i = 0; i < b; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n    for (int k = 0; k < m; k++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &(sz[k][p]));\n      }\n    }\n    if (m * n != 1) {\n      for (int o = 0; o < n; o++) {\n        a[i] = a[i] + sz[0][o] + sz[m - 1][o];\n      }\n      for (int q = 0; q < m; q++) {\n        a[i] = a[i] + sz[q][0] + sz[q][n - 1];\n      }\n      a[i] = a[i] - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n      printf(\"%d\\n\", a[i]);\n    } else {\n      printf(\"%d\", sz[0][0]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, m, n, a, b, sz[1000][1000], s = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s += (sz[0][b] + sz[m - 1][b]);\n    }\n    for (a = 0; a < m; a++) {\n      s += (sz[a][0] + sz[a][n - 1]);\n    }\n    s -= (sz[0][0] + sz[m - 1][0] + sz[0][n - 1] + sz[m - 1][n - 1]);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    char a[100][100];\n    int j, l;\n\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l];\n    } else {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l] + a[m - 1][l];\n    }\n    if (n == 1) {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0];\n    } else {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0] + a[j][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, sum, x, y;\n  int a[100], b[100], ar[100][100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a[i], &b[i]);\n    x = a[i] - 1;\n    y = b[i] - 1;\n    for (j = 0; j < a[i]; j++) {\n      for (k = 0; k < b[i]; k++) {\n        scanf(\"%d\", &ar[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < a[i]; j++) {\n      sum = sum + ar[j][0] + ar[j][y];\n    }\n    for (k = 0; k < b[i]; k++) {\n      sum = sum + ar[0][k] + ar[x][k];\n    }\n    sum = sum - ar[0][0] - ar[0][y] - ar[x][0] - ar[x][y];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10591", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, s, t, sum = 0, matrix[100][100];\n    cin >> m >> n;\n    for (s = 0; s < m; s++)\n      for (t = 0; t < n; t++)\n        cin >> *(*(matrix + s) + t);\n    for (s = 0; s < n; s++)\n      sum += *(*(matrix + 0) + s) + *(*(matrix + m - 1) + s);\n    for (s = 1; s < m - 1; s++)\n      sum += *(*(matrix + s) + 0) + *(*(matrix + s) + n - 1);\n    if (m == 1 || n == 1)\n      sum /= 2;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10592", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k;\n\n  scanf(\"%d \", &k);\n  int i;\n  for (int h = 0; h < k; h++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n\n    for (int j = 0; j < n; j++) {\n      sum += sz[0][j];\n      sum += sz[m - 1][j];\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n      sum += sz[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *a[100];\n  int k, *m, *n, i, plus = 0, j, l;\n  cin >> k;\n  m = (int *)malloc(100 * sizeof(int));\n  n = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", m + i);\n    scanf(\"%d\", n + i);\n    a[i] = (int *)malloc(((*(m + i)) * (*(n + i))) * sizeof(int));\n    for (j = 0; j < *(m + i); j++) {\n      for (l = 0; l < *(n + i); l++)\n        scanf(\"%d\", a[i] + (j * (*(n + i)) + l));\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < *(m + i); j++) {\n      plus = plus + (*(a[i] + (j * (*(n + i)))));\n      plus = plus + (*(a[i] + ((j + 1) * (*(n + i)) - 1)));\n    }\n    for (l = 1; l < (*(n + i)) - 1; l++) {\n      plus = plus + (*(a[i] + l));\n      plus = plus + (*(a[i] + l + (*(m + i) - 1) * (*(n + i))));\n    }\n    printf(\"%d\\n\", plus);\n    plus = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b;\n  int i, j;\n  int sum;\n  int c[100][100];\n  cin >> n;\n  while (n > 0) {\n    scanf(\"%d %d \", &a, &b);\n    sum = 0;\n\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        cin >> c[i][j];\n    }\n    int(*p)[100];\n    p = c;\n    for (i = 0; i < b; i++)\n      sum += *(*p + i);\n    for (j = 1; j < a - 1; j++)\n      sum += *(*(p + j)) + *(*(p + j) + b - 1);\n    for (i = 0; i < b; i++)\n      sum += *(*(p + a - 1) + i);\n    cout << sum << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10595", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int(*juzhen)[101] = NULL;\n  int i, j, m, num, hang, lie, input[101][101];\n  cin >> num;\n  for (m = 0; m < num; m++) {\n    cin >> hang >> lie;\n    int sum = 0;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        scanf(\"%d \", &input[i][j]);\n    juzhen = input;\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if ((i == 0) || (i == hang - 1) || (j == 0) || (j == lie - 1))\n          sum = sum + *(*(juzhen + i) + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++)\n    s += a[1][i];\n  for (i = 2; i <= m; i++) {\n    s += a[i][n];\n  }\n  for (i = n - 1; i >= 1; i--)\n    s += a[m][i];\n  for (i = m - 1; i > 1; i--)\n    s += a[i][1];\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    cout << juzhen(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int mat[100][100];\n  int t, m, n, i, j, sum;\n  cin >> t;\n  for (; t > 0; t--) {\n    memset(mat, 0, sizeof(mat));\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> mat[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += mat[i][j];\n      }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, num[100][100], sum;\n  cin >> k;\n  cout << endl;\n  for (int a = 0; a < k; a++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n        cout << \" \";\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += num[i][j];\n        }\n      }\n      cout << endl;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k;\n\n  cin >> k;\n  int i;\n  for (int h = 0; h < k; h++) {\n    int sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n\n    for (int j = 0; j < n; j++) {\n      sum += sz[0][j];\n      sum += sz[m - 1][j];\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n      sum += sz[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> k;\n  for (int t = 1; t <= k; t++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n    }\n    if (k == 1)\n      sum = sum - 3 * a[0][0];\n    else\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[500], i, j, x, k, a[100][100][100], b[500][2];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    n[i] = 0;\n    cin >> b[i][0] >> b[i][1];\n    for (j = 0; j < b[i][0]; j++) {\n      for (x = 0; x < b[i][1]; x++) {\n        scanf(\"%d\", &a[i][j][x]);\n        if (j == 0 || x == 0 || j == b[i][0] - 1 || x == b[i][1] - 1)\n          n[i] += a[i][j][x];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << n[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10602", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n, num, sum = 0;\n  int *p = NULL;\n  cin >> num;\n  for (k = 1; k <= num; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(a + i) + j);\n        }\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        sum = sum + *(*a + i);\n      }\n      for (i = 0; i < m - 1; i++) {\n        sum = sum + *(*(a + i) + n - 1);\n      }\n      for (i = 1; i < n; i++) {\n        sum = sum + *(*(a + m - 1) + i);\n      }\n      for (i = 1; i < m; i++) {\n        sum = sum + **(a + i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[100][100], h, l, k, m, n, i, j, w, sum;\n  scanf(\"%d\", &k);\n\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    w = m;\n    h = n;\n    i = 0;\n    while (i < m) {\n      j = 0;\n      while (j < n) {\n        scanf(\"%d\", &s[i][j]);\n        j++;\n      }\n      i++;\n    }\n    sum = 0;\n    if (h > 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0] + s[i][h - 1];\n        i++;\n      }\n      j = 0;\n      while (j < h) {\n        sum += s[0][j] + s[w - 1][j];\n        j++;\n      }\n      sum = sum - s[0][0] - s[0][h - 1] - s[w - 1][0] - s[w - 1][h - 1];\n    }\n    if (h == 1 && w == 1) {\n      sum = s[0][0];\n    }\n    if (h == 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0];\n        i++;\n      }\n    }\n    if (h > 1 && w == 1) {\n      j = 0;\n      while (j < h) {\n        sum += s[0][j];\n        j++;\n      }\n    }\n    if (h == 0 || w == 0) {\n      sum = 0;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int w, k;\n  scanf(\"%d\", &w);\n  for (k = 0; k < w; k++) {\n\n    int n, m, sz[100][100], i, j;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> sz[i][j];\n    }\n    int a = 0, b = 0, c = 0, d;\n    for (j = 0; j < m; j++) {\n      a += sz[0][j];\n    }\n\n    for (j = 0; j < m; j++) {\n      b += sz[n - 1][j];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      c += sz[i][0] + sz[i][m - 1];\n    }\n    d = a + b + c;\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10605", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, l, S = 0;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (l = 0; l <= n - 1; l++) {\n        cin >> a[j][l];\n        if (j == 0 || j == m - 1 || l == 0 || l == n - 1) {\n          S = S + a[j][l];\n        }\n      }\n    }\n    if (i < k) {\n      printf(\"%d\\n\", S);\n    } else {\n      cout << S;\n    }\n    S = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100] = {0}, i, j, l, k, m, n;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d \", &a[j][l]);\n    for (j = 0; j < n; j++)\n      sum[i] = sum[i] + a[0][j];\n    for (j = 1; j < m; j++) {\n      sum[i] = sum[i] + a[j][0];\n      sum[i] = sum[i] + a[j][n - 1];\n    }\n    for (j = 1; j < n - 1; j++)\n      sum[i] = sum[i] + a[m - 1][j];\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[100][100];\n  int k, i, x, y;\n  int m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (x = 0; x < m; x++) {\n      for (y = 0; y < n; y++) {\n        cin >> *(*(number + x) + y);\n      }\n    }\n    if (n == 1 && m == 1)\n      cout << **number << endl;\n    else {\n      for (x = 0; x < m; x++) {\n        sum += *(*(number + x));\n        sum += *(*(number + x) + n - 1);\n      }\n      \n\n      for (y = 0; y < n; y++) {\n        sum += *(*(number) + y);\n        sum += *(*(number + m - 1) + y);\n      }\n      \n      sum = sum - *(*(number)) - *(*(number) + n - 1) - *(*(number + m - 1)) -\n            *(*(number + m - 1) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  int i, j, t, r, k, m, n, a[1000] = {0}, b[100][100] = {0}, sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n\n    for (t = 0; t < m; t++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &b[t][r]);\n        if (r == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    if (m == 1)\n      for (j = 0; j <= n - 1; j++)\n        sum += b[0][j];\n    else if (n == 1)\n      for (j = 0; j <= m - 1; j++)\n        sum += b[j][0];\n    else {\n      for (j = 0; j < n - 1; j++)\n        sum += *(b[0] + j);\n      for (j = 0; j < m - 1; j++)\n        sum += *(b[j] + n - 1);\n      for (j = n - 1; j > 0; j--)\n        sum += *(b[m - 1] + j);\n      for (j = m - 1; j > 0; j--)\n        sum += *(b[j] + 0);\n    }\n    a[i] = sum;\n    sum = 0;\n  }\n\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", a[i]);\n}\n"}
{"label": "6", "index": "10609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, t;\n  for (t = 0; t < n; t++) {\n    int h, l;\n    int sum = 0;\n    scanf(\"%d %d\", &h, &l);\n    int a[100][100] = {0};\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    if (h == 1)\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i];\n    else if (l == 1)\n      for (j = 0; j < h; j++)\n        sum = sum + a[j][0];\n    else {\n\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i] + a[h - 1][i];\n      for (j = 1; j < h - 1; j++)\n        sum = sum + a[j][0] + a[j][l - 1];\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid m(int, int);\nint main() {\n  int a, b, c, i;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d%d\", &b, &c);\n    m(b, c);\n  }\n}\nvoid m(int q, int w) {\n  int a, i, j;\n  long sum;\n  sum = 0;\n  for (i = 1; i <= q; i++) {\n    for (j = 1; j <= w; j++) {\n      scanf(\"%d\", &a);\n      if (i == 1 || j == 1 || i == q || j == w) {\n        sum += a;\n      }\n    }\n  }\n  printf(\"%ld \", sum);\n}\n"}
{"label": "6", "index": "10611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[200][200], result = 0;\n  scanf(\"%d\", &k);\n  int i, p, q;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n      if (p == 0 || p == m - 1) {\n        for (q = 0; q < n; q++)\n          result += sz[p][q];\n\n      } else {\n        result += sz[p][0];\n        result += sz[p][n - 1];\n      }\n    }\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int k, m, n, i, j, a, sum = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        if (i == 0 || i == m - 1)\n          sum += sz[i][j];\n        if (i > 0 && i < m - 1 && (j == 0 || j == n - 1))\n          sum += sz[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10613", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, k, r, p, t;\n  int m, n, s;\n\n  cin >> t;\n  for (p = 1; p <= t; p++) {\n    s = 0;\n    cin >> m >> n;\n\n    for (j = 1; j <= m; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << a[1][1];\n      continue;\n    }\n    for (i = 1; i <= n; i++) {\n      s = s + a[1][i] + a[m][i];\n    }\n    for (r = 1; r <= m; r++) {\n      s = s + a[r][1] + a[r][n];\n    }\n    s = s - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint count(int b, int c) {\n  int m = b, n = c;\n  int i, j, sum, num[100][100], (*a)[100];\n  \n  a = num;\n  sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", *(a + i) + j);\n    scanf(\"%d\", *(a + i) + (n - 1));\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + (*(*a + j)) + (*(*(a + m - 1) + j));\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + (*(*(a + i))) + (*(*(a + i) + (n - 1)));\n  }\n  return sum;\n}\n\nint main() {\n  int i, k, m, n, sum[100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[i] = count(m, n);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n}\n"}
{"label": "6", "index": "10615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, y;\n  int z[100][100];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    y = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int t = 0; t < n; t++)\n        cin >> z[j][t];\n    }\n    for (int a = 0; a < m; a++)\n      y = y + z[a][0] + z[a][n - 1];\n\n    for (int b = 0; b < n; b++) {\n      y = y + z[0][b] + z[m - 1][b];\n    }\n    y = y - z[0][0] - z[0][n - 1] - z[m - 1][0] - z[m - 1][n - 1];\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, p, q, a[100][100], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int total = 0;\n    cin >> p >> q;\n    for (j = 0; j < p; j++)\n      for (k = 0; k < q; k++) {\n        cin >> a[j][k];\n      }\n    for (int h = 0; h < q; h++) {\n      total += *(*a + h);\n      total += *(*(a + p - 1) + h);\n    }\n    for (int g = 0; g < p; g++) {\n      total += **(a + g);\n      total += *(*(a + g) + q - 1);\n    }\n    total -= **a;\n    total -= *(*a + q - 1);\n    total -= **(a + p - 1);\n    total -= *(*(a + p - 1) + q - 1);\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int m, int n) {\n  int i, j, sz[100][100], num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  for (i = 0, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = m - 1, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = 1, j = 0; i < m - 1; i++)\n    num += sz[i][j];\n  for (i = 1, j = n - 1; i < m - 1; i++)\n    num += sz[i][j];\n  return num;\n}\n\nint main() {\n  int k, i, num, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    num = sum(m, n);\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "6", "index": "10618", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, u, k, m[100], n[100], g[100][100][100], num = 0;\n  int *p, (*q)[100];\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d \", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++)\n      for (u = 0; u < n[i]; u++)\n        scanf(\"%d \", &g[i][j][u]);\n  }\n  for (i = 1; i <= k; i++) {\n    num = 0;\n    for (p = &g[i][0][0]; p <= &g[i][0][n[i] - 1]; p++)\n      num = num + (*p);\n    for (p = &g[i][m[i] - 1][0]; p <= &g[i][m[i] - 1][n[i] - 1]; p++)\n      num = num + (*p);\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q));\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q + n[i] - 1));\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  cin >> t;\n  while (t--) {\n    int a[100][100], sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    for (int i = 0; i < m; i++) {\n      if (n > 1)\n        sum += (**(a + i) + *(*(a + i) + n - 1));\n      else\n        sum += **(a + i);\n    }\n    for (int i = 1; i < n - 1; i++) {\n      if (m > 1)\n        sum += (*(*a + i) + *(*(a + m - 1) + i));\n      else\n        sum += *(*a + i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10620", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, m, i, j, t, s;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1)\n          s = s + a[i][j];\n\n        if ((j == 0 || j == n - 1) && i != 0 && i != m - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int rie, k, i;\n  int ROW, COL;\n  int row, col;\n  int sz[100][100] = {0};\n  int sum[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &(sz[row][col]));\n      }\n    }\n    rie = 0;\n    for (col = 0; col <= COL - 1; col++) {\n      rie += sz[0][col];\n    }\n    for (row = 1; row <= ROW - 1; row++) {\n      rie += sz[row][COL - 1];\n    }\n    for (col = COL - 2; col >= 0; col--)\n      rie += sz[ROW - 1][col];\n\n    for (row = ROW - 2; row >= 1; row--) {\n      rie += sz[row][0];\n    }\n    sum[i] = rie;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k, m, n, sum;\nint num[101][101];\nint main() {\n  int i, j, l;\n  cin >> k;\n  for (i = 0; i < k; ++i) {\n    memset(num, 0, sizeof(num));\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; ++j) {\n      for (l = 0; l < n; ++l) {\n        cin >> num[j][l];\n      }\n    }\n    for (j = 0; j < n; ++j)\n      sum += num[0][j] + num[m - 1][j];\n    for (j = 1; j < m - 1; ++j)\n      sum += num[j][0] + num[j][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, ans, i, j, x;\n  scanf(\"%d\", &k);\n  while (k--) {\n    scanf(\"%d%d\", &n, &m);\n    ans = 0;\n    for (i = 1; i <= n; i++) {\n      if (i == 1 || i == n)\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          ans += x;\n        }\n      else\n        for (j = 1; j <= m; j++) {\n          scanf(\"%d\", &x);\n          if (j == 1 || j == m)\n            ans += x;\n        }\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  for (int i = 1; i <= a; i++) {\n    int m, n, t = 0;\n    cin >> m >> n;\n    int x[100][100];\n    int *p;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(x + i) + j);\n      }\n    }\n    if (m == 1 && n == 1)\n      cout << *(*(x)) << endl;\n\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n == 1) {\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i));\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x + m - 1) + j);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + 0);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + n - 1);\n      }\n      cout << t - *(*(x + 0) + 0) - *(*(x + 0) + n - 1) - *(*(x + m - 1) + 0) -\n                  *(*(x + m - 1) + n - 1)\n           << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0;\n  int ans = 0, a = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> a;\n        if (!l || l == (n - 1))\n          ans += a;\n        else if (!j || j == (m - 1))\n          ans += a;\n      }\n    printf(\"%d\\n\", ans);\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, n, m, i, k, j, a[100][100], s[100];\n  cin >> p;\n  for (k = 0; k < p; k++) {\n    s[k] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0)\n          s[k] += a[i][j];\n        else if ((m - i - 1) == 0)\n          s[k] += a[i][j];\n        else if (j == 0)\n          s[k] += a[i][j];\n        else if ((n - j - 1) == 0)\n          s[k] += a[i][j];\n      }\n  }\n  for (k = 0; k < p; k++)\n    printf(\"%d\\n\", s[k]);\n  return 0;\n}\n"}
{"label": "6", "index": "10627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, sz[100][100], m, n, p, i, j, s[100] = {0};\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n    if (m == 1 && n == 1) {\n      s[p] = sz[0][0];\n    } else {\n      for (j = 0; j < n; j++) {\n        s[p] = s[p] + sz[0][j] + sz[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        s[p] = s[p] + sz[i][0] + sz[i][n - 1];\n      }\n      s[p] = s[p] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n  }\n  for (p = 0; p < k; p++) {\n    cout << s[p] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10628", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    int row, col;\n    cin >> row >> col;\n    int number[100][100];\n\n    int k, m;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        cin >> number[k][m];\n      }\n    }\n    int sum = 0;\n    for (k = 0; k <= row - 1; k++) {\n      for (m = 0; m <= col - 1; m++) {\n        if (k == 0 || m == 0 || k == row - 1 || m == col - 1) {\n          sum += number[k][m];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10629", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, a[100][100], i, j, k, sum;\n  int *p;\n  cin >> t;\n  for (k = 1; k <= t; k++) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = a[0]; p <= a[0] + n - 1; p++)\n      sum = sum + *p;\n\n    for (i = 1; i <= m - 2; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (p = a[m - 1]; p <= a[m - 1] + n - 1; p++) {\n      sum = sum + *p;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[105][105], (*p)[105] = NULL, sum;\n  cin >> k;\n  for (int time = 1; time <= k; time++) {\n    sum = 0;\n    p = a;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + *(*p + i) + *(*(p + m - 1) + i);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      sum = sum + *(*(p + i)) + *(*(p + i) + n - 1);\n    }\n    if ((m == 1) || (n == 1))\n      sum = sum / 2;\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i = 1, j, a[101][101], s, k;\n  int sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d \", &s);\n  while (i <= s) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m;\n    cin >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (j = 0; j < n; j++)\n      sum1 += a[0][j];\n    for (j = 0; j < n; j++)\n      sum2 += a[m - 1][j];\n    for (j = 0; j < m; j++)\n      sum3 += a[j][0];\n    for (j = 0; j < m; j++)\n      sum4 += a[j][n - 1];\n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int time = 0; time < t; time++) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int i = 0; i < n; i++)\n      sum += *(*a + i) + (n > 1) * *(*(a + m - 1) + i);\n    for (int i = 1; i < m - 1; i++)\n      sum += *(*(a + i)) + (m > 1) * *(*(a + i) + n - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10633", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, *p, a[100][100], s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    p = &a[0][0];\n    s = 0;\n    for (j = 0; j < n; j++) {\n      if (n == 1)\n        s += *p;\n      else\n        s += (*(p + j) + *(p + 100 * (m - 1) + j));\n    }\n    for (j = 1; j < m - 1; j++)\n      s += (*(p + j * 100) + *(p + j * 100 + n - 1));\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10634", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, m, n, x, sum, a[100][105][105];\n  cin >> x;\n  for (i = 1; i <= x; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    }\n    for (t = 1; t <= n; t++) {\n      if (m != 1)\n        sum = sum + a[i][1][t] + a[i][m][t];\n      if (m == 1)\n        sum = sum + a[i][1][t];\n    }\n    for (t = 2; t <= m - 1; t++) {\n      if (n != 1)\n        sum = sum + a[i][t][1] + a[i][t][n];\n      if (n == 1)\n        sum = sum + a[i][t][1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10635", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, k, sum;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    k--;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        sum += *(*a + j);\n      else\n        sum += *(*a + j) + *(*(a + m - 1) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += a[i][0] + a[i][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  int m, n, j, l;\n  int z[100][100], h[100];\n  for (i = 0; i < 100; i++) {\n    h[i] = 0;\n  }\n  for (l = 0; l < k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(z[i][j]));\n      }\n    }\n    for (j = 0; j < n; j++) {\n      h[l] += z[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      h[l] += z[i][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][j];\n    }\n  }\n  for (l = 0; l < k; l++) {\n    if (l == 0) {\n      cout << h[l];\n    } else {\n      cout << \"\\n\" << h[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10637", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int maxn = 110;\nint n, m;\nint d[maxn][maxn];\n\nint main() {\n  int t;\n\n  scanf(\"%d\", &t);\n  while (t-- > 0) {\n    int sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < m; j++) {\n        int tmp;\n        scanf(\"%d\", &tmp);\n        if (i == 0 || i == n - 1 || j == 0 || j == m - 1)\n          sum += tmp;\n      }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, h, l, result = 0;\n  int a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[h][l];\n      }\n    }\n    for (l = 1; l <= n; l++) {\n      result = result + a[1][l] + a[m][l];\n    }\n    for (h = 2; h <= m - 1; h++) {\n      result = result + a[h][1] + a[h][n];\n    }\n    cout << result << endl;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++) {\n        a[h][l] = 0;\n      }\n    }\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, i, j, a, t;\n\n  scanf(\"%d\", &a);\n  for (t = 1; t <= a; t++) {\n    int s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 1; i <= m; i++)\n      s += sz[i][1];\n\n    for (i = 1; i <= m; i++) {\n      s += sz[i][n];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[1][i];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[m][i];\n    }\n    s -= sz[1][1] + sz[1][n] + sz[m][1] + sz[m][n];\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int row, line, a, b, A[101][101];\n    int sum = 0;\n    cin >> row >> line;\n    for (a = 1; a <= row; a++)\n      for (b = 1; b <= line; b++)\n        cin >> A[a][b];\n    for (a = 1; a <= row; a++)\n      sum += A[a][1];\n    for (b = 2; b <= line; b++)\n      sum += A[row][b];\n    for (a = row - 1; a >= 1; a--) {\n      sum += A[a][line];\n    }\n    for (b = line - 1; b >= 2; b--)\n      sum += A[1][b];\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m() {\n  int m, n, a[10000], i, j, s = 0;\n  int *p;\n  p = a;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m * n; i++) {\n    scanf(\"%d\", p + i);\n  }\n  for (i = 0; i < m; i++) {\n    if (i == 0 || i == m - 1) {\n      for (j = 0; j < n; j++) {\n        s = s + *(p + i * n + j);\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        if (j == 0 || j == n - 1)\n          s = s + *(p + i * n + j);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int k, i, sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = m();\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, size[100][2], m[100][100][100], i, j, l, sum[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\", &size[i][0], &size[i][1]);\n    for (j = 0; j < size[i][0]; j++)\n      for (l = 0; l < size[i][1]; l++)\n        scanf(\"%d\", &m[i][j][l]);\n\n    if ((size[i][1] == 1) && (size[i][0] == 1))\n      sum[i] = m[i][0][0];\n    else {\n      for (l = 0; l < size[i][1]; l++) {\n        if (size[i][1] == 1)\n          sum[i] = sum[i] + m[i][0][l];\n        else\n          sum[i] = sum[i] + m[i][0][l] + m[i][size[i][0] - 1][l];\n      }\n      for (j = 1; j <= size[i][0] - 2; j++) {\n        sum[i] = sum[i] + m[i][j][0] + m[i][j][size[i][1] - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int m, n, j1, j2, sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j1 = 1; j1 <= m; j1++) {\n      for (j2 = 1; j2 <= n; j2++) {\n        cin >> *(*(a + j1) + j2);\n      }\n    }\n    for (j2 = 1; j2 <= n; j2++)\n      sum = sum + *(*(a + 1) + j2) + *(*(a + m) + j2);\n    for (j1 = 2; j1 <= m - 1; j1++)\n      sum = sum + *(*(a + j1) + 1) + *(*(a + j1) + n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][2], c[100][100][100], i, j, p, s[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++)\n      for (p = 0; p < a[i][1]; p++)\n        scanf(\"%d\", &c[i][j][p]);\n  }\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][0][j];\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][0];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][a[i][1] - 1];\n    cout << s[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10645", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, i1, j1, i2, i3, j3, sum = 0;\n  scanf(\"%d\", &n);\n  for (i2 = 0; i2 <= n - 1; i2++) {\n    scanf(\"%d %d\", &i, &j);\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        cin >> a[i1][j1];\n      }\n    }\n    for (i3 = 0; i3 <= j - 1; i3++) {\n      sum = sum + a[0][i3] + a[i - 1][i3];\n    }\n    for (j3 = 0; j3 <= i - 1; j3++) {\n      sum = sum + a[j3][0] + a[j3][j - 1];\n    }\n    sum = sum - a[0][j - 1] - a[i - 1][0] - a[i - 1][j - 1] - a[0][0];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        a[i1][j1] = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, n, m, i, a[100][100], j, k, sum;\n  cin >> t;\n  int(*p)[100];\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n >> m;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    p = a;\n    if (n == 1 || m == 1 || m == 2 || n == 2) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < m; k++)\n          sum = sum + *(*(p + j) + k);\n      }\n    } else {\n      for (k = 0; k < m; k++) {\n        sum = sum + *(*(p) + k) + *(*(p + n - 1) + k);\n      }\n      for (j = 1; j < n - 1; j++) {\n        sum = sum + *(*(p + j) + 0) + *(*(p + j) + m - 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10647", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, N, i, j, a, b, sum = 0;\n  int data[1000][1000];\n  cin >> N;\n  for (n = 0; n < N; n++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        scanf(\"%d\", &data[i][j]);\n    }\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += data[i][j];\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10648", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int time;\n  int m, n;\n  int i, j;\n  int x, y;\n  int res;\n  int r;\n  int arr[10000];\n  scanf(\"%d\", &time);\n  for (i = 0; i < time; i++) {\n    res = 0;\n    scanf(\"%d %d \", &m, &n);\n\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", &r);\n\n      arr[j] = r;\n    }\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        if ((x == 0) || (x == (m - 1)))\n          res += arr[x * n + y];\n        if ((y == 0) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n        if ((y == (n - 1)) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, a[100][100], j, l, sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d \", &a[j][l]);\n    for (j = 0; j < m; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, j, z, s;\n  cin >> k;\n  for (z = 1; z <= k; z++) {\n    s = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          s = s + a[i][j];\n    } else {\n      for (i = 0; i < n; i++)\n        s = s + *(*a + i) + *(*(a + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        s = s + *(*(a + i)) + *(*(a + i) + n - 1);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  fflush(stdin);\n\n  int i, j, k, m;\n  int lie, h;\n  int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n  \n\n  for (i = 0; i < n; i++) {\n    sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n    scanf(\"%d%d\", &h, &lie);\n    int matrix[h][lie];\n    \n\n    for (j = 0; j < h; j++)\n      for (k = 0; k < lie; k++) {\n        scanf(\"%d\", &matrix[j][k]);\n      }\n    fflush(stdin);\n\n    if (h == 1 && lie == 1) {\n      printf(\"%d\\n\", matrix[0][0]);\n      return 0;\n    }\n\n    for (m = 0; m < lie; m++) {\n      sum1 += matrix[0][m];\n      sum2 += matrix[h - 1][m];\n    }\n\n    for (m = 0; m < h; m++) {\n      sum1 += matrix[m][0];\n      sum2 += matrix[m][lie - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4 -\n          (matrix[0][0] + matrix[0][lie - 1] + matrix[h - 1][0] +\n           matrix[h - 1][lie - 1]);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10652", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0, i = 0, j = 0, lin = 0, col = 0;\n  int array[105][105];\n  int sum = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> lin >> col;\n    for (int p = 0; p < lin; p++) {\n      for (int q = 0; q < col; q++) {\n        cin >> *(*(array + p) + q);\n      }\n    }\n    for (j = 0; j < col; j++) {\n      sum = sum + array[0][j];\n    }\n    for (j = 1; j < lin; j++) {\n      sum = sum + array[j][col - 1];\n    }\n    for (j = 0; j < (col - 1); j++)\n      sum = sum + array[lin - 1][j];\n\n    for (j = 1; j < (lin - 1); j++) {\n      sum = sum + array[j][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, n = 0, m = 0, i = 0, w = 0, j = 0, sum = 0, s[101][101] = {0};\n  cin >> k;\n  for (w = 1; w <= k; w++) {\n    sum = 0;\n    cin >> n >> m;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= m; j++) {\n        cin >> *(s[i] + j);\n        if ((i == 1) || (i == n) || (j == 1) || (j == m))\n          sum += *(s[i] + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], k, i, j, t, m, n, sum;\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 2; i < n; i++)\n      sum += a[1][i] + a[m][i];\n    for (j = 2; j < m; j++)\n      sum += a[j][1] + a[j][n];\n    sum +=\n        a[1][1] + (n != 1) * a[1][n] + (m != 1) * a[m][1] + (m != 1) * a[m][n];\n    if (t < k)\n      cout << sum << \"\\n\";\n    else\n      cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  int juzhen[100][100];\n  int m = 0, n = 0;\n  cin >> k;\n  while (k > 0) {\n    m = 0;\n    n = 0;\n    memset(juzhen, 0, sizeof(juzhen));\n    cin >> m >> n;\n    int i = 0, j = 0, sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> juzhen[i][j];\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen) + i);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen + m - 1) + i);\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j));\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j) + n - 1);\n    }\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, s;\n  int a[100][100][100];\n  int b[100], c[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &b[i], &c[i]);\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k < c[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    s = 0;\n    if (c[i] > 1) {\n      for (j = 0; j < c[i]; j++)\n        s = s + a[i][0][j] + a[i][b[i] - 1][j];\n    } else {\n      s = s + a[i][0][0];\n    }\n    for (j = 1; j < b[i] - 1; j++)\n      s = s + a[i][j][0] + a[i][j][c[i] - 1];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10657", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[100][100];\nint m, n;\nvoid count() {\n  int i, j;\n  int sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + j == j || i + j == i || i + j == i + n - 1 ||\n          i + j == j + m - 1) {\n        sum = sum + map_1[i][j];\n      }\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int sum;\n  int k = 0;\n  cin >> sum;\n  int i, j;\n  for (k = 0; k < sum; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> map_1[i][j];\n      }\n    }\n    count();\n  }\n}\n"}
{"label": "6", "index": "10658", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0;\n  int i = 0, j = 0, k = 0;\n  int row, col;\n  int str[100][100] = {0};\n  int sum;\n  cin >> n;\n  for (; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        scanf(\"%d\", &str[j][k]);\n    for (j = 0; j < col; j++)\n      sum += str[0][j] + str[row - 1][j];\n    for (j = 1; j < row - 1; j++)\n      sum += str[j][0] + str[j][col - 1];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, k;\n  cin >> k;\n  int i = 0, j = 0, h = 0;\n  for (i = 0; i < k; i++) {\n    int b = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (h = 0; h < n; h++)\n        cin >> *(*(a + j) + h);\n    for (j = 0; j < m; j++)\n      b = b + **(a + j);\n    for (j = 1; j < n; j++)\n      b = b + *(*a + j);\n    for (j = 1; j < m; j++)\n      b = b + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      b = b + *(*(a + m - 1) + j);\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\nint main() {\n  int k, m, n, sum, i, j;\n  scanf(\"%d\", &k);\n  while (k--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += a[i][j];\n      }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10661", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N = 0, n = 0, m = 0, i = 0, j = 0, k = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    int sum = 0;\n    int a[102][102];\n    int *p = *a;\n    cin >> n >> m;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    }\n    for (k = 0; k < m; k++, p++)\n      sum = sum + *p;\n    for (p = p + 101, j = 1; j < n; j++)\n      sum = sum + *p, p = p + 102;\n    for (p = p - 103, k = m - 2; k >= 0; k--, p--)\n      sum = sum + *p;\n    for (p = p - 101, j = n - 2; j > 0; j--, p = p - 102) {\n      sum = sum + *p;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k >= 1) {\n    int m, n, i, j, *p = NULL, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (p = a[0]; p < a[0] + n; p++)\n      sum = sum + *p;\n    for (p = a[0]; p <= a[m - 1]; p += 100)\n      sum = sum + *p;\n    for (p = a[m - 1]; p < a[m - 1] + n; p++)\n      sum = sum + *p;\n    for (p = a[0] + n - 1; p <= a[m - 1] + n - 1; p += 100)\n      sum = sum + *p;\n    printf(\"%d\\n\", sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1]);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10663", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, e, f, j, h = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &e, &f);\n    int a[100][100];\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        a[i][j] = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < e; i++) {\n      h = h + a[i][0] + a[i][f - 1];\n    }\n    for (j = 1; j < f - 1; j++) {\n      h = h + a[0][j] + a[e - 1][j];\n    }\n    printf(\"%d \", h);\n    h = 0;\n    e = 0;\n    f = 0;\n  }\n}\n"}
{"label": "6", "index": "10664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, i, j, k, m, n, u[100][100], s, d, x;\n  scanf(\"%d\", &k);\n\n  for (y = 1; y <= k; y++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &u[i][j]);\n      }\n    }\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        s += u[i][j];\n      }\n    }\n    d = 0;\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        d += u[i][j];\n      }\n    }\n    x = s - d;\n    printf(\"%d\\n\", x);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10665", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int j, i, m, n, *pointer = NULL, a[100][100],\n                  sum = 0; \n  cin >> j;                \n  for (i = 0; i < j; i++)  \n  {\n    sum = 0; \n    cin >> m >> n;\n    pointer = *a;                           \n    for (; pointer < *a + m * n; pointer++) \n    {\n      cin >> *pointer;\n    }\n    for (pointer = *a; pointer < *a + m * n; pointer++) \n    {\n      if (pointer >= *a && pointer <= *a + n - 1) \n      {\n        sum += *pointer;\n        continue;\n      }\n      if ((pointer - *a) % n == 0) \n      {\n        sum += *pointer;           \n        sum += *(pointer + n - 1); \n        continue;\n      } \n      if (pointer >= *a + m * n - n && pointer < *a + m * n - 1) {\n        sum += *pointer; \n        continue;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int c, i, j;\n  int m, n, k;\n  cin >> k;\n  for (c = 1; c <= k; c++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    for (i = 1; i <= m; i++) {\n      sum1 = sum1 + a[i][1];\n      sum2 = sum2 + a[i][n];\n    }\n    for (j = 1; j <= n; j++) {\n      sum3 = sum3 + a[1][j];\n      sum4 = sum4 + a[m][j];\n    }\n    sum = sum1 + sum2 + sum3 + sum4 - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, a[10000], sum[10000], y, j;\n  scanf(\"%d\", &k);\n  for (j = 1; j <= k; j++) {\n    cin >> m >> n;\n    sum[j - 1] = 0;\n    for (i = 1; i <= 10000; i++) {\n      scanf(\"%d\", &a[i - 1]);\n      y = i <= n || i % n == 1 || i % n == 0 || i > m * n - n;\n      sum[j - 1] += y * a[i - 1];\n      if (i >= m * n)\n        break;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i - 1] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "10668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void jisuan(int array[100][100], int x, int y);\n  int k, i, m, n, p, q, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    jisuan(a, m, n);\n  }\n}\nvoid jisuan(int array[100][100], int x, int y) {\n  int i, j, a, b, c, d, sum;\n  for (j = 0, a = 0; j < y; j++) {\n    a = a + array[0][j];\n  }\n  for (i = 1, b = 0; i < x; i++) {\n    b = b + array[i][y - 1];\n  }\n  for (j = y - 2, c = 0; j >= 0; j--) {\n    c = c + array[x - 1][j];\n  }\n  for (i = x - 2, d = 0; i > 0; i--) {\n    d = d + array[i][0];\n  }\n  sum = a + b + c + d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "6", "index": "10669", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  int m, n, j, l;\n  int z[100][100], h[100];\n  for (i = 0; i < 100; i++) {\n    h[i] = 0;\n  }\n  for (l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> (z[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      h[l] += z[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      h[l] += z[i][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      h[l] += z[i][j];\n    }\n  }\n  for (l = 0; l < k; l++) {\n    if (l == 0) {\n      printf(\"%d\", h[l]);\n    } else {\n      printf(\"\\n%d\", h[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a, b, c, d, s;\n  a = b = c = d = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (int p = 0; p < m; p++) {\n      for (int q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (int e = 0; e < n; e++) {\n        a = a + sz[0][e];\n        b = b + sz[m - 1][e];\n      }\n      for (int j = 1; j < m - 1; j++) {\n        c = c + sz[j][n - 1];\n        d = d + sz[j][0];\n      }\n      s = a + b + c + d;\n      printf(\"%d\\n\", s);\n      s = a = b = c = d = 0;\n    } else {\n      printf(\"%d\", sz[0][0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, c, d = 0, e = 0, i, j, k, l, m, n;\n  int a[101][101] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (b = 1; b <= m; b++) {\n      for (c = 1; c <= n; c++) {\n        cin >> a[b][c];\n        d = d + a[b][c];\n      }\n    }\n    for (b = 2; b <= m - 1; b++) {\n      for (c = 2; c <= n - 1; c++) {\n        e = e + a[b][c];\n      }\n    }\n    cout << d - e << \"\\n\";\n    d = 0;\n    e = 0;\n  }\n}\n"}
{"label": "6", "index": "10672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j;\n  int sum;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n        sum += *(*(a + m - 1) + j);\n      }\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n        sum += *(*(a + i) + n - 1);\n      }\n      sum = sum - *(*(a)) - *(*(a + m - 1) + n - 1) - *(*(a) + n - 1) -\n            *(*(a + m - 1));\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      sum = 0;\n      sum = *(*a);\n      cout << sum << endl;\n    } else if (m == 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n      }\n      cout << sum << endl;\n    } else if (n == 1 && m > 1) {\n      sum = 0;\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n      }\n      cout << sum << endl;\n    }\n    k--;\n  }\n}\n"}
{"label": "6", "index": "10673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zong;\n  int sz[100][100], m, n, k, i, j, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0,\n                                   sum = 0;\n  scanf(\"%d\", &zong);\n  for (k = 0; k < zong; k++) {\n    int sum = 0;\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[0][i]);\n      sum1 += sz[0][i];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      scanf(\"%d\", &sz[n - 1][i]);\n      sum2 += sz[n - 1][i];\n    }\n\n    for (i = 1; i < n - 1; i++)\n      sum3 += sz[i][0];\n\n    for (i = 1; i < n - 1; i++) {\n      sum4 += sz[i][m - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10674", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, **p, a, b, sum;\n    cin >> m >> n;\n    p = (int **)malloc(m * sizeof(int *));\n    for (a = 0; a < m; a++)\n      p[a] = (int *)malloc(n * sizeof(int));\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d\", *(p + a) + b);\n    }\n    sum = 0;\n    for (b = 0; b < n; b++)\n      sum = sum + *(*p + b) + *(*(p + m - 1) + b);\n    for (a = 1; a < m - 1; a++)\n      sum = sum + **(p + a) + *(*(p + a) + n - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j1, j2, e1, e2, sum;\n  int juzhen[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j1 = 0; j1 < m; j1++) {\n      for (e1 = 0; e1 < n; e1++) {\n        scanf(\"%d\", &juzhen[j1][e1]);\n      }\n    }\n    sum = 0;\n    for (j2 = 0; j2 < n; j2++) {\n      sum = sum + juzhen[0][j2] + juzhen[m - 1][j2];\n    }\n    for (e2 = 1; e2 < m - 1; e2++) {\n      sum = sum + juzhen[e2][0] + juzhen[e2][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int I, m, n, a[100][100];\n  int i, j, k, sum;\n  scanf(\"%d\", &I);\n  for (k = 0; k < I; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (i = 0; i < n; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][n - 1] - a[m - 1][0];\n    if ((m == n) && (m == 1))\n      sum = a[0][0];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10677", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, s1, s2, q1, q2, a, b, t, k, p, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int pi[100001];\n    s1 = 0;\n    s2 = 0;\n    q1 = 0;\n    q2 = 0;\n    cin >> a >> b;\n    for (j = 1; j <= a * b; j++) {\n      scanf(\"%d\", pi + j - 1);\n    }\n    for (t = 1; t <= b; t++) {\n      s1 = s1 + *(pi + t - 1);\n      s2 = s2 + *(pi + a * b - t);\n    }\n    for (p = 1; p < a - 1; p++) {\n      q1 = q1 + *(pi + p * b);\n      q2 = q2 + *(pi + b - 1 + p * b);\n    }\n    s = s1 + s2 + q1 + q2;\n    if (a == 1 & b == 1) {\n      printf(\"%d\\n\", s / 2);\n    } else {\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10678", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], l, b[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n        if (j == 0 || j == m - 1)\n          b[i] += a[j][l];\n        else if (l == 0 || l == n - 1)\n          b[i] += a[j][l];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[100], n[100];\n  int a[100][10000];\n  int i, j, s, sum = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    s = m[i] * n[i];\n    for (j = 0; j < s; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0, sum = 0; j < m[i] * n[i]; j++) {\n      if (j < n[i])\n        sum = sum + a[i][j];\n      else if (j % n[i] == 0)\n        sum = sum + a[i][j];\n      else if ((j + 1) % n[i] == 0)\n        sum = sum + a[i][j];\n      else if (j > m[i] * n[i] - n[i] - 1)\n        sum = sum + a[i][j];\n      else\n        continue;\n    }\n    if (i == 0)\n      cout << sum;\n    else\n      cout << \"\\n\" << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, h1, l1, k, h, l, a[100][100], sum[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum[i] = 0;\n    cin >> h >> l;\n    for (h1 = 1; h1 <= h; h1++)\n      for (l1 = 1; l1 <= l; l1++)\n        scanf(\"%d\", &a[h1][l1]);\n\n    for (h1 = 1; h1 <= h; h1++)\n      sum[i] += a[h1][1] + a[h1][l];\n    for (l1 = 2; l1 <= l - 1; l1++)\n      sum[i] += a[1][l1] + a[h][l1];\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10681", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, m, n, k, i, j, t, sum[1001] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (t = 1; t <= m; t++)\n      for (j = 1; j <= n; j++) {\n        cin >> a[t][j];\n      }\n    for (j = 1; j <= n; j++)\n      sum[i] = sum[i] + a[1][j] + a[m][j];\n    for (j = 1; j <= m; j++) {\n      if (j == 1 || j == m)\n        continue;\n      sum[i] = sum[i] + a[j][1] + a[j][n];\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l;\n  int k, n, m, a[100][100] = {0}, (*p)[100] = a, t = 0;\n\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= m - 1; j++)\n        scanf(\"%d\", *(p + i) + j);\n\n    for (j = 0; j <= m - 1; j++) {\n      if (n != 1) {\n        t += *(*(p) + j);\n        t += *(*(p + n - 1) + j);\n      } else\n        t += *(*(p) + j);\n    }\n    for (i = 1; i <= n - 2; i++) {\n      if (m != 1) {\n        t += *(*(p + i));\n        t += *(*(p + i) + m - 1);\n      } else\n        t += *(*(p + i));\n    }\n    cout << t << \" \";\n    t = 0;\n  }\n}\n"}
{"label": "6", "index": "10683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, x, i, j, sum;\n  int m, n;\n  int a[100][100], b[100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    if ((m >= 3) & (n >= 3)) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n      b[x] = sum;\n    } else {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n          sum = sum + a[i][j];\n        }\n      }\n      b[x] = sum;\n    }\n  }\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", b[x]);\n  return 0;\n}\n"}
{"label": "6", "index": "10684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum[10000] = {0};\n  int a[100][100] = {0}, k;\n  int *p = sum, x, y;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++)\n        cin >> a[i][j];\n    }\n    if (x != 1) {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j] + a[x - 1][j];\n      }\n      for (i = 1; i < x - 1; i++) {\n        *(p + k) += a[i][0] + a[i][y - 1];\n      }\n    } else {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j];\n      }\n    }\n  }\n  for (; p < (sum + n); p++) {\n    cout << *p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  scanf(\"%d \", &k);\n  int m = 0, n = 0;\n  while (cin >> m >> n) {\n    int result = 0;\n    int num[100][100] = {0};\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    for (j = 0; j < n; j++)\n      result += num[0][j] + num[m - 1][j];\n    for (i = 1; i < (m - 1); i++)\n      result += num[i][0] + num[i][n - 1];\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[100][100] = {0};\n  int x, y, i, j, k, n, sum = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> x >> y;\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++)\n        cin >> *(*(a + i) + j);\n\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        if (i == 0 || j == 0 || i == (x - 1) || j == (y - 1))\n          sum += *(*(a + i) + j);\n      }\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *p = {NULL}, a[100][100], z, m, n, i = 1, j = 0, s;\n  cin >> z;\n  while (i <= z) {\n    s = 0;\n    cin >> m >> n;\n    p = *a;\n    for (j = 0; j < m * n; j++) {\n      cin >> *p++;\n      if (j < n || j >= n * (m - 1) || j % n == 0 || (j + 1) % n == 0) {\n        s += *(p - 1);\n      }\n    }\n    cout << s << \"\\n\";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], (*p)[100];\n  p = a;\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num = num + *(*(p + i) + j);\n      } \n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << endl;\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(p + i) + j); \n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum = sum + *(*(p + i) + j); \n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl; \n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, l, m, n, i, j, sum = 0;\n  int array[100][100];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          cin >> array[i][j];\n          sum += array[i][j];\n        }\n      }\n      cout << sum << \"\\n\";\n      break;\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      cin >> array[0][j];\n      sum += array[0][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n\n      sum = sum + array[i][0] + array[i][j - 1];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      cin >> array[m - 1][j];\n      sum += array[m - 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10690", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a;\n  int sz[100][100], s;\n  s = 0;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          s = s + sz[i][j];\n    }\n\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, k, m, n, *p, sum1 = 0, sum2 = 0, *sum;\n  p = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  sum = (int *)malloc(1000 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      sum1 = sum1 + *(p + j);\n    }\n    for (a = 1; a < m - 1; a++) {\n      for (b = 1; b < n - 1; b++) {\n        sum2 += *(p + a * n + b);\n      }\n    }\n    *(sum + i) = sum1 - sum2;\n    sum1 = 0;\n    sum2 = 0;\n  }\n  for (i = 0; i < k; i++) {\n    cout << *(sum + i) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &k);\n  for (w = 0; w < k; w++) {\n    c = 0;\n    scanf(\"%d %d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      p[i] = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p[i] + j);\n    if (m == 1)\n      for (i = 0; i < n; i++)\n        c = c + p[0][i];\n    else {\n      if (n == 1)\n        for (i = 0; i < m; i++)\n          c = c + p[i][0];\n      else {\n        for (i = 0; i < n; i++)\n          c = c + p[0][i] + p[m - 1][i];\n        for (i = 1; i < m - 1; i++)\n          c = c + p[i][0] + p[i][n - 1];\n      }\n    }\n    cout << c << \"\\n\";\n    for (i = 0; i < m; i++)\n      free(p[i]);\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int m, n, s, t, sum = 0, matrix[100][100];\n    cin >> m >> n;\n    for (s = 0; s < m; s++) \n      for (t = 0; t < n; t++)\n        cin >> *(*(matrix + s) + t);\n    for (s = 0; s < n; s++) \n      sum += *(*(matrix + 0) + s) + *(*(matrix + m - 1) + s);\n    for (s = 1; s < m - 1; s++) \n      sum += *(*(matrix + s) + 0) + *(*(matrix + s) + n - 1);\n    if (m == 1 || n == 1) \n      sum /= 2;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10694", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, array[100][100];\n  int sum, i, j, k;\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    for (j = 0; j < m; j++)\n      sum = sum + array[j][0] + array[j][n - 1];\n    for (k = 0; k < n; k++)\n      sum = sum + array[0][k] + array[m - 1][k];\n    printf(\"%d\\n\", sum - array[0][0] - array[0][n - 1] - array[m - 1][0] -\n                       array[m - 1][n - 1]);\n  }\n  cin.get();\n  return 0;\n}\n"}
{"label": "6", "index": "10695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *a, i, m, n, k, s = 0, *b, j;\n  scanf(\"%d\", &k);\n  b = (int *)calloc(k, sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    a = (int *)calloc(m * n, sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", a + j);\n    for (j = 0; j < m; j++) {\n      s = s + *(a + j * n) + *(a + j * n + n - 1);\n    }\n    for (j = 1; j < n - 1; j++)\n      s = s + *(a + j) + *(a + (m - 1) * n + j);\n\n    *(b + i) = s;\n    free(a);\n    s = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", *(b + i));\n    if (i < k - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "6", "index": "10696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, a[10000], sum[10000], y, j;\n  scanf(\"%d\", &k);\n  for (j = 1; j <= k; j++) {\n    cin >> m >> n;\n    sum[j - 1] = 0;\n    for (i = 1; i <= 10000; i++) {\n      scanf(\"%d\", &a[i - 1]);\n      y = i <= n || i % n == 1 || i % n == 0 || i > m * n - n;\n      sum[j - 1] += y * a[i - 1];\n      if (i >= m * n)\n        break;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    cout << sum[i - 1] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10697", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[101][101];\n  int k, m, n, i, *pointer1, *pointer2, i1, i2, sum = 0;\n  ;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (i1 = 0; i1 < m; i1++) {\n      for (i2 = 0; i2 < n; i2++)\n        cin >> s[i1][i2];\n    }\n    pointer1 = &s[0][1];\n    pointer2 = &s[0][0];\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer1 = &s[0][i1];\n      sum += *pointer1;\n    }\n    for (i1 = 0; i1 < m; i1++) {\n      if (n != 1) {\n        pointer1 = &s[i1][n - 1];\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      } else {\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      }\n    }\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer2 = &s[m - 1][i1];\n      sum += *pointer2;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, r, s, a[100][100], j, k = 1, sum;\n  scanf(\"%d\", &n);\n  while (k <= n) {\n    scanf(\"%d %d\", &r, &s);\n    sum = 0;\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < s; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n    if (r == 1) {\n      for (i = 0; i < s; i++)\n        sum += *(*(a + 0) + i);\n    } else if (s == 1) {\n      for (i = 0; i < r; i++)\n        sum += *(*(a + i) + 0);\n    } else {\n      for (i = 0, j = 0; j < s - 1; j++)\n        sum += *(*(a + i) + j);\n      for (i = 0, j = s - 1; i < r - 1; i++)\n        sum += *(*(a + i) + j);\n      for (i = r - 1; j > 0; j--)\n        sum += *(*(a + i) + j);\n      for (j = 0; i > 0; i--)\n        sum += *(*(a + i) + j);\n    }\n    cout << sum << \"\\n\";\n    k++;\n  }\n}\n"}
{"label": "6", "index": "10699", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, N, w, s;\n  int a[100][100];\n  scanf(\"%d\\n\", &N);\n  for (w = 0; w < N; w++) {\n    s = 0;\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    if ((n > 1) && (m > 1)) {\n\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n      for (i = 0; i < n; i++)\n        s += a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][0];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][n - 1];\n    }\n    if ((n == 1) && (m > 1)) {\n      s = a[0][0] + a[m - 1][0];\n    }\n    if ((n > 1) && (m == 1))\n      s = a[0][0] + a[0][n - 1];\n    if ((n == 1) && (m == 1))\n      s = a[0][0];\n\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum1 = sum1 + a[0][j];\n      if ((m - 1) != 0)\n        sum2 = sum2 + a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum3 = sum3 + a[i][0];\n      if ((n - 1) != 0)\n        sum4 = sum4 + a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4);\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n  }\n}\n"}
{"label": "6", "index": "10701", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    int num[110][110] = {0}, (*p)[110], sum = 0, i, j;\n    p = num;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    p = num;\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j);\n    for (i = 1; i < m; i++)\n      sum = sum + *(*(p + i) + n - 1);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + *(*(p + m - 1) + j);\n    for (i = 1; i < m - 1; i++)\n      sum = sum + *(*(p + i) + 0);\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  int i;\n  for (i = 0; i < num; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[m][n];\n    for (int j = 0; j < m; j++)\n      for (int h = 0; h < n; h++)\n        cin >> a[j][h];\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      sum += a[0][j];\n    for (int j = 1; j < m; j++)\n      sum += a[j][0];\n    for (int j = 1; j < n; j++)\n      sum += a[m - 1][j];\n    for (int j = 1; j < m - 1; j++)\n      sum += a[j][n - 1];\n    cout << sum << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "6", "index": "10703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x;\n  cin >> x;\n  int sum = 0;\n  int m, n;\n\n  int g, i, j, temp;\n  for (g = 0; g < x; g++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      cin >> temp;\n      sum += temp;\n    }\n\n    for (i = 0; i < m - 2; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> temp;\n        if (j == 0 || j == n - 1) {\n          sum += temp;\n        }\n      }\n    }\n    if (m != 1) {\n      for (i = 0; i < n; i++) {\n        cin >> temp;\n        sum += temp;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int m, n;\n  int a[101][101];\n  int u, i, j, sum;\n  scanf(\"%d\", &k);\n  for (u = 0; u < k; u++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if ((i == 0) || (j == 0) || (i == m - 1) || j == (n - 1)) {\n          sum += a[i][j];\n        }\n      }\n    }\n    if (u != k - 1) {\n      printf(\"%d\\n\", sum);\n    } else {\n      if (u == k - 1) {\n        printf(\"%d\", sum);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10705", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int k, l, m, n, i, j, sum = 0;\n  int array[100][100];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          cin >> array[i][j];\n          sum += array[i][j];\n        }\n      }\n      cout << sum << endl;\n      break;\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      cin >> array[0][j];\n      sum += array[0][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> array[i][j];\n      }\n      sum = sum + array[i][0] + array[i][j - 1];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      cin >> array[m - 1][j];\n      sum += array[m - 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10706", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, j, i, k, m, a, t, all, sum;\n  int s[500][500];\n  scanf(\"%d\", &all);\n  m = 0;\n  for (t = 0; t < all; t++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &s[i][j]);\n        sum += s[i][j];\n      }\n    if ((m == 1) || (n == 1))\n      printf(\"%d\\n\", sum);\n    else {\n      for (i = 1; i <= m - 2; i++)\n        for (j = 1; j <= n - 2; j++)\n          sum = sum - s[i][j];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j, l, a[100][100][100], len[100], cro[100], b[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &len[i], &cro[i]);\n    for (j = 0; j < len[i]; j++) {\n      for (l = 0; l < cro[i]; l++)\n        scanf(\"%d\", &a[i][j][l]);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < cro[i]; j++) {\n      b[i] += a[i][0][j];\n    }\n    for (j = 1; j < len[i]; j++) {\n      b[i] += a[i][j][(cro[i] - 1)];\n    }\n    for (j = 0; j < cro[i] - 1; j++) {\n      b[i] += a[i][len[i] - 1][j];\n    }\n    for (j = 1; j < len[i] - 1; j++) {\n      b[i] += a[i][j][0];\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, k, m, n, *p, sum1 = 0, sum2 = 0, *sum;\n  p = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  sum = (int *)malloc(1000 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      sum1 = sum1 + *(p + j);\n    }\n    for (a = 1; a < m - 1; a++) {\n      for (b = 1; b < n - 1; b++) {\n        sum2 += *(p + a * n + b);\n      }\n    }\n    *(sum + i) = sum1 - sum2;\n    sum1 = 0;\n    sum2 = 0;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", *(sum + i));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, k = 0, x, y, an[100][100], sum[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x >> y;\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        scanf(\"%d\", &an[j][k]);\n        if (j == 0 || j == x - 1 || k == 0 || k == y - 1) {\n          sum[i] += an[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, num[150][150], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (j = 0; j < m; j++) {\n      for (a = 0; a < n; a++)\n        scanf(\"%d\", &num[j][a]);\n    }\n    for (j = 0; j < n; j++) {\n      sum += num[0][j];\n      if (m != 1) {\n        sum += num[m - 1][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += (num[j][0]);\n      if (n != 1)\n        sum += num[j][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[100][100];\nvoid a() {\n  memset(m, 0, sizeof(m));\n  int x, y, count = 0, sum = 0;\n  cin >> x >> y;\n  int *p = m[0];\n  for (; p <= m[x - 1] + y - 1; p++) {\n    count++;\n    cin >> *p;\n    if (count == 1 || count == y)\n      sum += *p;\n    else {\n      if (p <= m[0] + y - 1)\n        sum += *p;\n      else if (m[x - 1] <= p && p <= m[x - 1] + y - 1) {\n        sum += *p;\n      }\n    }\n    if (count == y) {\n      p = p + 100 - y;\n      count = 0;\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    a();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int juzhen[101][101];\n  int m, n, i, j, sum;\n  int k;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> juzhen[i][j];\n        if (i == 0)\n          sum += juzhen[i][j];\n        if (i == m - 1)\n          sum += juzhen[i][j];\n        if (j == 0 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n        if (j == n - 1 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10713", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  while (k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < n; i++) {\n      if (m == 1)\n        sum = sum + a[0][i];\n      else {\n        sum = sum + a[0][i] + a[m - 1][i];\n      }\n    }\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m[100], n[100], i, j, a, k, sz[100][100], sum[100] = {0};\n  cin >> k;\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m[a], &n[a]);\n    for (i = 0; i < m[a]; i++) {\n      for (j = 0; j < n[a]; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m[a] != 1 && n[a] != 1) {\n      for (j = 0; j < n[a]; j++) {\n        sum[a] += sz[0][j];\n        sum[a] += sz[m[a] - 1][j];\n      }\n      for (i = 1; i < m[a] - 1; i++) {\n        sum[a] += sz[i][0];\n        sum[a] += sz[i][n[a] - 1];\n      }\n    } else {\n      for (i = 0; i < m[a]; i++) {\n        for (j = 0; j < n[a]; j++) {\n          sum[a] += sz[i][j];\n        }\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%d\\n\", sum[a]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n, i, j, l, sum1 = 0, sum = 0;\n  int a[100][100];\n\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n        sum = sum + *(*(p + i) + j);\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        sum1 = sum1 + *(*(p + i) + j);\n\n    sum = sum - sum1;\n    cout << sum << endl;\n    sum = sum1 = 0;\n  }\n}\n"}
{"label": "6", "index": "10716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, i, j, k, h, a[100], b[100], juzhen[100][100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &(a[h]), &(b[h]));\n    for (i = 0; i < a[h]; i++) {\n      for (j = 0; j < b[h]; j++)\n        scanf(\"%d\", &(juzhen[i][j]));\n    }\n    for (i = 0; i < a[h]; i++) {\n      sum[h] = sum[h] + juzhen[i][0] + juzhen[i][b[h] - 1];\n    }\n    for (j = 1; j < b[h] - 1; j++) {\n      sum[h] = sum[h] + juzhen[0][j] + juzhen[a[h] - 1][j];\n    }\n  }\n  for (h = 0; h < k; h++) {\n    cout << sum[h] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, o, p, sum, area[111][111];\n  int k, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        scanf(\"%d\", &area[o][p]);\n      }\n    }\n    if (a != 1 && b != 1) {\n      for (p = 0; p < b; p++) {\n        sum += area[0][p] + area[a - 1][p];\n      }\n      for (o = 1; o < a - 1; o++) {\n        sum += area[o][0] + area[o][b - 1];\n      }\n    } else {\n      for (o = 0; o < a; o++) {\n        for (p = 0; p < b; p++) {\n          sum += area[o][p];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  cin >> k;\n  for (int p = 0; p < k; p++) {\n    int sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum = sum + a[i][0];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n != 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + a[0][i];\n\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cout << a[0][0] << endl;\n    } else {\n\n      for (i = 0; i < n; i++) {\n        sum1 = sum1 + a[0][i];\n        sum2 = sum2 + a[m - 1][i];\n      }\n      for (i = 0; i < m; i++) {\n        sum3 = sum3 + a[i][0];\n        sum4 = sum4 + a[i][n - 1];\n      }\n      sum = sum1 + sum2 + sum3 + sum4 -\n            (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10719", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, m, n, i, j, k, a[100][100], sum;\n  scanf(\"%d\", &p);\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[1][1]);\n      break;\n    }\n    for (k = 1; k <= n; k++)\n      sum += a[1][k] + a[m][k];\n    for (j = 1; j <= m; j++)\n      sum += a[j][1] + a[j][n];\n    sum -= a[1][1] + a[1][n] + a[m][1] + a[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, *q, (*p)[100], h = 0, i, j, l, t;\n  p = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  q = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(p + j) + l);\n      }\n    }\n    for (t = 0; t < n; t++) {\n      *(q + i) = *(q + i) + *(*p + t) + *(*(p + m - 1) + t);\n    }\n    for (t = 0; t < m; t++) {\n      *(q + i) = *(q + i) + **(p + t) + *(*(p + t) + n - 1);\n    }\n    *(q + i) = *(q + i) - **p - *(*p + n - 1) - *(*(p + m - 1)) -\n               *(*(p + m - 1) + n - 1);\n  }\n  for (i = 0; i < k; i++) {\n    cout << *(q + i) << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "10721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a, b, c, d, s;\n  a = b = c = d = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (int p = 0; p < m; p++) {\n      for (int q = 0; q < n; q++)\n        scanf(\"%d\", &sz[p][q]);\n    }\n    if (m != 1 && n != 1) {\n      for (int e = 0; e < n; e++) {\n        a = a + sz[0][e];\n        b = b + sz[m - 1][e];\n      }\n      for (int j = 1; j < m - 1; j++) {\n        c = c + sz[j][n - 1];\n        d = d + sz[j][0];\n      }\n      s = a + b + c + d;\n      printf(\"%d\\n\", s);\n      s = a = b = c = d = 0;\n    } else {\n      printf(\"%d\", sz[0][0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int nn, ii;\n  scanf(\"%d\", &nn);\n  for (ii = 1; ii <= nn; ii++) {\n    int t, i, j, x, y, sum = 0;\n    scanf(\"%d %d\", &y, &x);\n    for (i = 1; i <= y; i++) {\n      for (j = 1; j <= x; j++) {\n        scanf(\"%d\", &t);\n        if (i == 1 || i == y || j == x || j == 1) {\n          sum += t;\n        }\n      }\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10723", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, *p[100], i, *w[100], j, r, s = 0;\n  scanf(\"%d\\n\", &k);\n  for (j = 0; j < k; j++)\n    w[j] = (int *)malloc(2 * sizeof(int));\n  for (j = 0; j < k; j++) {\n    scanf(\"%d %d\\n\", w[j], w[j] + 1);\n    m = *(w[j]);\n    n = *(w[j] + 1);\n    for (r = 0; r < m; r++)\n      p[r] = (int *)malloc(100 * sizeof(int));\n    for (r = 0; r < m; r++)\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", p[r] + i);\n    for (r = 0, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (r = m - 1, i = 0; i < n; i++)\n      s = s + *(p[r] + i);\n    for (i = 0, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    for (i = n - 1, r = 1; r < m - 1; r++)\n      s = s + *(p[r] + i);\n    printf(\"%d\\n\", s);\n    s = 0;\n    free(p[0]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10724", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int zong, m, n, a[101][101], sum1 = 0, sum2 = 0, sum = 0;\n  cin >> zong;\n  for (int i = 1; i <= zong; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += a[m][0];\n    }\n\n    else {\n      for (int k = 0; k < n; ++k)\n        sum1 += a[0][k] + a[m - 1][k];\n      for (int j = 0; j < m; ++j)\n        sum2 += a[j][0] + a[j][n - 1];\n      sum = sum1 + sum2 - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    cout << sum << endl;\n    sum1 = 0, sum2 = 0, sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10725", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, m, n, N, w, s;\n  int a[100][100];\n  cin >> N;\n  for (w = 0; w < N; w++) {\n    s = 0;\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if ((n > 1) && (m > 1)) {\n\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n      for (i = 0; i < n; i++)\n        s += a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][0];\n      for (i = 1; i < m - 1; i++)\n        s += a[i][n - 1];\n    }\n    if ((n == 1) && (m > 1)) {\n      s = a[0][0] + a[m - 1][0];\n    }\n    if ((n > 1) && (m == 1))\n      s = a[0][0] + a[0][n - 1];\n    if ((n == 1) && (m == 1))\n      s = a[0][0];\n\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b;\n  int i, j;\n  int sum;\n  int c[100][100];\n  cin >> n;\n  while (n > 0) {\n    cin >> a >> b;\n    sum = 0;\n\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        cin >> c[i][j];\n    }\n    int(*p)[100];\n    p = c;\n    for (i = 0; i < b; i++)\n      sum += *(*p + i);\n    for (j = 1; j < a - 1; j++)\n      sum += *(*(p + j)) + *(*(p + j) + b - 1);\n    for (i = 0; i < b; i++)\n      sum += *(*(p + a - 1) + i);\n    cout << sum << endl;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10727", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, matrix[100][100];\n  scanf(\"%d\", &k);\n  while (k > 0) {\n    k--;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(matrix + i) + j);\n    }\n    if (m == 1 && n == 1)\n      printf(\"%d\\n\", **matrix);\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      printf(\"%d\\n\", sum);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += **(matrix + i);\n      printf(\"%d\\n\", sum);\n    } else {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      for (i = 0; i < n; i++)\n        sum += *(*(matrix + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        sum += (**(matrix + i) + *(*(matrix + i) + n - 1));\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, m, n, a[100][100], i, j, k, sum;\n  int *p;\n  cin >> t;                \n  for (k = 1; k <= t; k++) \n  {\n    cin >> m >> n;\n    sum = 0; \n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    } \n    for (p = a[0]; p <= a[0] + n - 1; p++) {\n      sum = sum + *p;\n    } \n    for (i = 1; i <= m - 2; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    } \n    for (p = a[m - 1]; p <= a[m - 1] + n - 1; p++) {\n      sum = sum + *p;\n    } \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  int(*p)[100] = a;\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n\n        cin >> *(*(p + i) + j);\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, a[100][100], j, l, sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d \", &a[j][l]);\n    for (j = 0; j < m; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10731", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint init() {\n\n  int k, t, m, n, ans;\n  cin >> k;\n  while (k) {\n    k--;\n    ans = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> t;\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          ans += t;\n      }\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n\nint main() {\n  init();\n  return 0;\n}\n"}
{"label": "6", "index": "10732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, c;\n  int a[100][100];\n  int b[100] = {0};\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          b[c] += a[i][j];\n        } else {\n          if (j == 0 || j == n - 1) {\n            b[c] += a[i][j];\n          }\n        }\n      }\n    }\n  }\n  for (c = 0; c < k; c++)\n    printf(\"%d\\n\", b[c]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n = 0;\n\n  cin >> n;\n\n  int result[100];\n\n  for (int i = 0; i < n; i++) {\n\n    int x = 0;\n    int y = 0;\n\n    cin >> x >> y;\n\n    int r[100][100];\n\n    for (int j = 0; j < x; j++) {\n      for (int k = 0; k < y; k++) {\n        cin >> r[j][k];\n      }\n    }\n\n    result[i] = 0;\n\n    for (int j = 0; j < x; j++) {\n      if (j == 0 || j == x - 1) {\n\n        for (int k = 0; k < y; k++) {\n          result[i] += r[j][k];\n        }\n\n      } else {\n        result[i] += r[j][0];\n        result[i] += r[j][y - 1];\n      }\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    cout << result[i];\n    if (i < n - 1)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, a[100][100], i, j;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    int(*p)[100];\n    p = a;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < m; i++)\n      sum = sum + **(p + i) + *(*(p + i) + n - 1);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*p + j) + *(*(p + m - 1) + j);\n    sum = sum - **p - *(*p + n - 1) - **(p + m - 1) - *(*(p + m - 1) + n - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nconst int N = 110;\n\nint a[N][N];\n\nint main() {\n  int i, j, k;\n  int x;\n  int m, n;\n  cin >> x;\n  while (x--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    } else {\n      for (i = 0; i < n; i++) {\n        sum += a[0][i];\n        sum += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sub(void) {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *p;\n  int i, sum = 0;\n  p = (int *)malloc(10000 * sizeof(int));\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 1; i < n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = m * n - n + 1; i < m * n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = 0; i < m * n; i++)\n    if ((i % n) == 0 || ((i + 1) % n) == 0)\n      sum = sum + *(p + i);\n  cout << sum << \"\\n\";\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sub();\n}\n"}
{"label": "6", "index": "10737", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    int sz[100][100];\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d \", &sz[j][p]);\n      }\n    }\n    if (m != 1 && m != 2 && n != 1 && n != 2) {\n      sum1 = sum2 = sum3 = sum4 = 0;\n      for (p = 0; p < n; p++) {\n        sum1 += sz[0][p];\n      }\n      for (p = 0; p < n; p++) {\n        sum2 += sz[m - 1][p];\n      }\n      for (j = 0; j < m; j++) {\n        sum3 += sz[j][0];\n      }\n      for (j = 0; j < m; j++) {\n        sum4 += sz[j][n - 1];\n      }\n      printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4 - sz[0][0] - sz[0][n - 1] -\n                         sz[m - 1][0] - sz[m - 1][n - 1]);\n    } else {\n      sum = 0;\n      for (j = 0; j < m; j++) {\n        for (p = 0; p < n; p++) {\n          sum += sz[j][p];\n        }\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sq(int *p, int m, int n) {\n  int i, s;\n  s = 0;\n  for (i = 0; i < n; i++)\n    s = s + *(p + i);\n  for (i = 1; i < m; i++)\n    s = s + *(p + n * i) + *(p + n * i + n - 1);\n  for (i = 1; i < n - 1; i++)\n    s = s + *(p + (m - 1) * n + i);\n  cout << s << \"\\n\";\n}\nint main() {\n  int *p, m, n, k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)malloc(m * n * sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", p + j);\n    sq(p, m, n);\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "10739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int I, m, n, a[100][100];\n  int i, j, k, sum;\n  scanf(\"%d\", &I);\n  for (k = 0; k < I; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (i = 0; i < n; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][n - 1] - a[m - 1][0];\n    if ((m == n) && (m == 1))\n      sum = a[0][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10740", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int k, n, m, i, j, l;\n  int sum = 0;\n\n  scanf(\"%d \", &k);\n\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < m - 1; j++) {\n\n      sum += sz[0][j];\n    }\n    for (i = 0; i < n - 1; i++) {\n      sum += sz[i][m - 1];\n    }\n    for (j = 1; j < m; j++)\n      sum += sz[n - 1][j];\n\n    for (i = 1; i < n; i++) {\n      sum += sz[i][0];\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, a[10000], sum[10000], y, j;\n  scanf(\"%d\", &k);\n  for (j = 1; j <= k; j++) {\n    scanf(\"%d%d\", &m, &n);\n    sum[j - 1] = 0;\n    for (i = 1; i <= 10000; i++) {\n      scanf(\"%d\", &a[i - 1]);\n      y = i <= n || i % n == 1 || i % n == 0 || i > m * n - n;\n      sum[j - 1] += y * a[i - 1];\n      if (i >= m * n)\n        break;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << sum[i - 1] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "10742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n, ii, jj, l, t;\n  int s[10002] = {0};\n  int *k = s;\n  int sum = 0;\n  scanf(\"%d\", &jj);\n  for (i = 1; i <= jj; i++) {\n    scanf(\"%d %d\", &m, &n);\n    t = m * n;\n    for (ii = 1; ii <= t; ii++) {\n      k = k + 1;\n      scanf(\"%d\", k);\n      if (ii <= n || ii > (m - 1) * n || ii % n == 1 || ii % n == 0)\n        sum = sum + *k;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    k = s;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int square[100][100];\n  int k, i, j;\n  int(*p)[100];\n  p = square;\n  int sum = 0;\n  for (cin >> k; k; --k) {\n    int wide;\n    int height;\n    sum = 0;\n    cin >> height >> wide;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++)\n        cin >> square[i][j];\n    p = square;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++) {\n        if (i == 0 || j == 0 || i == height - 1 || j == wide - 1)\n          sum += *(*(p + i) + j);\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100]; \n  int k, m, n, i, j, sum, num;\n  cin >> k; \n  while (k--) {\n    num = 0;\n    sum = 0;       \n    cin >> m >> n; \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num += a[i][j];\n      }\n    \n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << endl;\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum += a[i][j]; \n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum += a[i][j]; \n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int nums;\n  int jz[100][100] = {0};\n  cin >> nums;\n  int i, j, k;\n  int sum;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      jz[i][j] = 0;\n  for (i = 0; i < nums; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &jz[j][k]);\n\n    for (j = 0; j < n; j++)\n      sum = sum + jz[0][j];\n    if (m - 1 != 0)\n      for (j = 0; j < n; j++)\n        sum = sum + jz[m - 1][j];\n    for (j = 1; j <= m - 2; j++)\n      sum = sum + jz[j][0];\n    if (n - 1 != 0)\n      for (j = 1; j <= m - 2; j++)\n        sum = sum + jz[j][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sum();\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum();\n  }\n  return 0;\n}\nvoid sum() {\n  int m, n, i, j, s = 0, a[101][101];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m; i++)\n    s = s + a[i][0];\n  for (i = 0; i < m; i++)\n    s = s + a[i][n - 1];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[0][i];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[m - 1][i];\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "6", "index": "10747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, board[100][100], sum = 0;\n\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++)\n        cin >> board[j][p];\n    for (int j = 0; j < m; j++) {\n      for (int p = 0; p < n; p++) {\n        if (j == 0 || j == m - 1 || p == 0 || p == n - 1)\n          sum += board[j][p];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10748", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid ijudge(int i, int j, int k, int p, int q) {\n  if ((j == 0) || (j == p - 1) || (k == 0) || (k == q - 1))\n    sum += i;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int p, q;\n  for (int i = 0; i < n; i++) {\n    cin >> p >> q;\n    sum = 0;\n    for (int j = 0; j < p; j++)\n      for (int k = 0; k < q; k++) {\n        cin >> a[j][k];\n        ijudge(a[j][k], j, k, p, q);\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sub(void) {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *p;\n  int i, sum = 0;\n  p = (int *)malloc(10000 * sizeof(int));\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 1; i < n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = m * n - n + 1; i < m * n - 1; i++) {\n    sum = sum + *(p + i);\n  }\n  for (i = 0; i < m * n; i++)\n    if ((i % n) == 0 || ((i + 1) % n) == 0)\n      sum = sum + *(p + i);\n  cout << sum << \"\\n\";\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sub();\n  return 0;\n}\n"}
{"label": "6", "index": "10750", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, number[100][100], num, *p = NULL;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> number[j][l];\n    }\n    num = 0;\n    p = *number;\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        num += *(p + j);\n      else {\n        num = num + *(p + j) + *(*(number + m - 1) + j);\n      }\n    }\n    p = *number;\n    for (j = 1; j < m - 1; j++) {\n      if (n == 1)\n        num += **(number + j);\n      else {\n        num = num + **(number + j) + *(*(number + j) + n - 1);\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, *p;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int j, sum = 0;\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      if (j < n || (j < n * m && j >= (m - 1) * n) || j % n == 0 ||\n          (j + 1) % n == 0)\n        sum += *(p + j);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, m;\n  cin >> a;\n  for (int i = 0; i < a; i++) {\n    int sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    int A[100][100] = {0};\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> A[j][k];\n    }\n    if (m == 1 && n == 1)\n      cout << A[0][0] << endl;\n    else {\n      for (int j = 0; j < m; j++)\n        sum = sum + A[j][0] + A[j][n - 1];\n      for (int j = 0; j < n; j++)\n        sum = sum + A[0][j] + A[m - 1][j];\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][n - 1] - A[m - 1][0];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100] = {0}, i, j, l, k, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    for (j = 0; j < n; j++)\n      sum[i] = sum[i] + a[0][j];\n    for (j = 1; j < m; j++) {\n      sum[i] = sum[i] + a[j][0];\n      sum[i] = sum[i] + a[j][n - 1];\n    }\n    for (j = 1; j < n - 1; j++)\n      sum[i] = sum[i] + a[m - 1][j];\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ac[100][100], i, j, k, *p, n, a, b, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    s = 0;\n    cin >> a >> b;\n    for (j = 0; j < a; j++)\n      for (k = 0; k < b; k++)\n        cin >> ac[j][k];\n    for (j = 0; j < a; j++) {\n      if (j == 0 || j == a - 1)\n        for (p = ac[j]; p < ac[j] + b; p++)\n          s += *p;\n      else {\n        p = ac[j];\n        s = s + *p + *(p + b - 1);\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, z, sum, temp;\n  int a[101][101];\n  int(*p)[101] = a;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (z = 0; z < n; z++)\n        cin >> *(*(p + j) + z);\n    if (m != 1 && n != 1) {\n      for (temp = 0; temp < n; temp++)\n        sum += (*(*(p) + temp) + *(*(p + m - 1) + temp));\n      for (temp = 0; temp < m; temp++) {\n        sum += (*(*(p + temp)) + *(*(p + temp) + n - 1));\n      }\n      sum -=\n          *(*(p)) + *(*(p) + n - 1) + *(*(p + m - 1)) + *(*(p + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n    } else\n      cout << *(*(p)) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> k;\n  for (int t = 1; t <= k; t++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n    }\n    if (k == 1)\n      sum = sum - 3 * a[0][0];\n    else\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10757", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      cin >> a[1][1];\n      cout << a[1][1] << endl;\n    } else {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++) {\n          cin >> a[i][j];\n        }\n      for (j = 1; j <= n; j++) {\n        sum += a[1][j] + a[m][j];\n      }\n      for (i = 1; i <= m; i++) {\n        sum += a[i][1] + a[i][n];\n      }\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n    }\n    int a[101][101] = {0};\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10758", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], l, b[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n        if (j == 0 || j == m - 1)\n          b[i] += a[j][l];\n        else if (l == 0 || l == n - 1)\n          b[i] += a[j][l];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, l, m, n, i, j, sum = 0;\n  int array[100][100];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          cin >> array[i][j];\n          sum += array[i][j];\n        }\n      }\n      printf(\"%d\\n\", sum);\n      break;\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      cin >> array[0][j];\n      sum += array[0][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> array[i][j];\n      }\n      sum = sum + array[i][0] + array[i][j - 1];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      cin >> array[m - 1][j];\n      sum += array[m - 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, m, n, a, b, sz[1000][1000], s = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d \", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s += (sz[0][b] + sz[m - 1][b]);\n    }\n    for (a = 0; a < m; a++) {\n      s += (sz[a][0] + sz[a][n - 1]);\n    }\n    s -= (sz[0][0] + sz[m - 1][0] + sz[0][n - 1] + sz[m - 1][n - 1]);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int a[][100], int m, int n) {\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + j) + i);\n}\nint main() {\n  int square[100][100];\n  int k, m, n;\n  cin >> k;\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    input(square, m, n);\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      sum = sum + *(*square + j) + *(*(square + n - 1) + j);\n    for (int j = 1; j < n - 1; j++)\n      sum = sum + **(square + j) + *(*(square + j) + m - 1);\n    if (m == 1)\n      sum = sum / 2;\n    cout << sum << endl;\n  }\n  return 0;\n}\n\n"}
{"label": "6", "index": "10762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nvoid clear(int z[][100], int x, int y); \nint main() {\n  int k, i, s, j, m, n, a[100][100]; \n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    clear(a, m, n); \n    for (j = 0; j < m; j++) {\n      for (s = 0; s < n; s++)\n        cin >> a[j][s];\n    }\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + 0) + j);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + m - 1) + j);\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j));\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j) + n - 1);\n    cout << sum << endl; \n  }\n  return 0;\n}\nvoid clear(int z[][100], int x, int y) {\n  int i, j;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++)\n      z[i][j] = 0;\n  }\n}\n"}
{"label": "6", "index": "10763", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int a[101][101];\n  int r, c, j, k, l, m, sum, n, p;\n  cin >> n; \n  for (p = 1; p <= n; p++) {\n    sum = 0;\n    cin >> r;\n    cin >> c;\n    for (int i = 0; i < r; i++)\n      for (int j = 0; j < c; j++)\n        cin >> a[i][j]; \n\n    for (j = 0; j < r; j++) {\n      sum = sum + **(a + j); \n    }\n\n    for (k = 1; k < c; k++) {\n      sum = sum + *(*(a + r - 1) + k); \n    }\n    for (l = r - 2; l >= 0; l--) {\n      sum = sum + *(*(a + l) + c - 1); \n    }\n    for (m = 1; m < c - 1; m++) {\n      sum = sum + *(*(a + 0) + m); \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10764", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n\n  for (int t = 1; t <= k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int q = 0; q < m; q++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &a[q][p]);\n      }\n    }\n    int col = 0, row = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    row = m - 1;\n    col = 0;\n    for (col; col < n; col++) {\n      s = s + a[row][col];\n    }\n    col = n - 1;\n    row = 0;\n    for (row; row < m; row++) {\n      s = s + a[row][col];\n    }\n    s = s - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d \", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int a, b;\n  int s[100][100];\n  int sum;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j <= a - 1; j++) {\n      for (k = 0; k <= b - 1; k++) {\n        scanf(\"%d\", &s[j][k]);\n      }\n    }\n    sum = 0;\n    for (k = 0; k <= b - 1; k++) {\n      sum = sum + s[0][k];\n    }\n    for (j = 1; j <= a - 1; j++) {\n      sum = sum + s[j][b - 1];\n    }\n    for (k = 0; k <= b - 2; k++)\n      sum = sum + s[a - 1][k];\n\n    for (j = 1; j <= a - 2; j++) {\n      sum = sum + s[j][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int t, i, j, sum = 0;\n  int m, n, k;\n  int(*p)[101] = NULL;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    p = a;\n    for (i = 0; i <= n - 2; i++)\n      sum += *(*(p + 0) + i);\n    p = a;\n    for (i = 0; i <= m - 2; i++)\n      sum += *(*(p + i) + n - 1);\n    p = a;\n    for (i = 1; i <= n - 1; i++) {\n      sum += *(*(p + m - 1) + i);\n    }\n    p = a;\n    for (i = 1; i <= m - 1; i++)\n      sum += *(*(p + i) + 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10767", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[101][101];\n  int(*p)[101];\n  int i, j, sum = 0;\n  p = a;\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> *(*(p + i) + j);\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = **p;\n    else {\n      for (i = 0; i < col; i++) {\n        sum += *(*p + i);\n        if (row > 1)\n          sum += *(*(p + row - 1) + i);\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += *(*(p + i));\n        if (col > 1)\n          sum += *(*(p + i) + col - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, row, q, col, i, j, *a, *num;\n  cin >> k;\n  num = (int *)malloc(k * sizeof(int));\n  for (q = 0; q < k; q++) {\n    int sum = 0;\n    cin >> row >> col;\n    a = (int *)malloc(row * col * sizeof(int));\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", a + i * col + j);\n        if (i == 0 || j == 0 || i == row - 1 || j == col - 1)\n          sum = sum + *(a + i * col + j);\n      }\n    *(num + q) = sum;\n    free(a);\n  }\n  for (q = 0; q < k; q++)\n    printf(\"%d\\n\", *(num + q));\n  free(num);\n  return 0;\n}\n"}
{"label": "6", "index": "10769", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int juzhen[101][101];\n  int m, n, i, j, sum;\n  int k;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> juzhen[i][j];\n        if (i == 0) {\n          sum += juzhen[i][j];\n        }\n        if (i == m - 1)\n          sum += juzhen[i][j];\n        if (j == 0 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n        if (j == n - 1 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10770", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, h, a[1000][1000] = {0}, result;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    result = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (j = 0; j < n; j++)\n      result = result + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      result = result + a[i][0] + a[i][n - 1];\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10771", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, sum, m, n, k;\n  int a[1000][1000];\n  cin >> k;\n  while (k--) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, a[100][100];\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int r, s;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        cin >> a[r][s];\n    int sum = 0;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        if (r == 0 || r == m - 1 || s == 0 || s == n - 1)\n          sum = sum + a[r][s];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10773", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, y, n, s, j, h, a, k, b, sz[100][100], jieguo[100], sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a, &b);\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    sum = 0;\n    for (h = 0; h < b; h++) {\n      sum = sum + sz[0][h] + sz[a - 1][h];\n    }\n    for (s = 0; s < a; s++) {\n      sum = sum + sz[s][0] + sz[s][b - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][b - 1] - sz[a - 1][0] - sz[a - 1][b - 1];\n    jieguo[i] = sum;\n  }\n  for (y = 0; y < n; y++) {\n    printf(\"%d\\n\", jieguo[y]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a, b;\n  int juzhen[100][100];\n  cin >> n;\n  for (int m = 1; m <= n; m++) {\n    cin >> a >> b;\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> *(*(juzhen + i) + j);\n    int s = 0;\n    for (int i = 0; i < b; i++) {\n      s = juzhen[0][i] + s;\n      s = juzhen[a - 1][i] + s;\n    }\n    for (int j = 1; j < a - 1; j++) {\n      s = juzhen[j][0] + s;\n      s = juzhen[j][b - 1] + s;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10775", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, *sum, i, j, *q;\n  sum = (int *)malloc(100 * sizeof(int));\n  q = sum;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++, sum++) {\n    *sum = 0;\n    int *p, *p1;\n    p = (int *)calloc(1000, 100 * sizeof(int));\n    scanf(\"%d %d\", &m, &n);\n    p1 = p;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p++);\n    for (i = 0, p = p1; i < m * n; i++, p++)\n      if (i < n || i % n == 0 || (i + 1) % n == 0 ||\n          (i < n * m && i > (n * (m - 1) - 1))) {\n        *sum = *sum + *p;\n      }\n  }\n  for (i = 0, sum = q; i < k - 1; i++)\n    printf(\"%d\\n\", *sum++);\n  printf(\"%d\", *sum);\n}\n"}
{"label": "6", "index": "10776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n[1000], m[1000], a, b, c, s[100][100], x[1000];\n  cin >> k;\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m[a], &n[a]);\n    for (b = 0; b < m[a]; b++) {\n      for (c = 0; c < n[a]; c++) {\n        cin >> s[b][c];\n      }\n    }\n    x[a] = 0;\n    for (c = 0; c < n[a]; c++) {\n      if (m[a] > 1) {\n        x[a] = x[a] + s[0][c] + s[m[a] - 1][c];\n      } else {\n        x[a] = x[a] + s[0][c];\n      }\n    }\n    if (m[a] > 2) {\n      if (n[a] > 1) {\n        for (b = 1; b < m[a] - 1; b++) {\n          x[a] = x[a] + s[b][0] + s[b][n[a] - 1];\n        }\n      } else\n        x[a] = x[a] + s[b][0];\n    }\n    printf(\"%d\\n\", x[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int k;\n  int sum = 0;\n  int i, j, l;\n  int m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &sum);\n      printf(\"%d\", sum);\n      sum = 0;\n    } else {\n      for (j = 0; j < m; j++) {\n        for (l = 0; l < n; l++) {\n          scanf(\"%d\", *(a + j) + l);\n        }\n      }\n      for (l = 0; l < n; l++) {\n        sum = sum + *(*(a + 0) + l) + *(*(a + m - 1) + l);\n      }\n      for (l = 0; l < m; l++) {\n        sum = sum + *(*(a + l) + 0) + *(*(a + l) + n - 1);\n      }\n      sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0) -\n            *(*(a + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, sum[100] = {0}, *p;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", p + i * n + j);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum[t] += *(p + i * n + j);\n      }\n    }\n  }\n  for (t = 0; t < k; t++)\n    printf(\"%d\\n\", sum[t]);\n}\n"}
{"label": "6", "index": "10779", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++)\n    s += a[j][n - 1];\n\n  if (m != 1)\n    for (k = n - 2; k >= 0; k--) {\n\n      s += a[m - 1][k];\n    }\n  if (n != 1)\n    for (i = m - 2; i > 0; i--) {\n      s += a[i][0];\n    }\n  printf(\"%d\\n\", s);\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, j, a;\n  for (scanf(\"%d\", &k); k > 0; k--) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n    }\n    for (i = 1; i < m - 1; i++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n      for (j = 1; j < n; j++)\n        scanf(\"%d\", &a);\n      if (n != 1) {\n        s = s + a;\n      }\n    }\n    if (m != 1)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a);\n        s = s + a;\n      }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10781", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  while (k--) {\n    int m, n, i, j;\n    int a[100][100];\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += a[0][j];\n      sum += a[m - 1][j];\n    }\n    i = 1;\n    while (i < m - 1) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n      i++;\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10782", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *a[100];\n  int k, *m, *n, i, plus = 0, j, l;\n  scanf(\"%d\", &k);\n  m = (int *)malloc(100 * sizeof(int));\n  n = (int *)malloc(100 * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", m + i);\n    scanf(\"%d\", n + i);\n    a[i] = (int *)malloc(((*(m + i)) * (*(n + i))) * sizeof(int));\n    for (j = 0; j < *(m + i); j++) {\n      for (l = 0; l < *(n + i); l++)\n        scanf(\"%d\", a[i] + (j * (*(n + i)) + l));\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < *(m + i); j++) {\n      plus = plus + (*(a[i] + (j * (*(n + i)))));\n      plus = plus + (*(a[i] + ((j + 1) * (*(n + i)) - 1)));\n    }\n    for (l = 1; l < (*(n + i)) - 1; l++) {\n      plus = plus + (*(a[i] + l));\n      plus = plus + (*(a[i] + l + (*(m + i) - 1) * (*(n + i))));\n    }\n    cout << plus << \"\\n\";\n    plus = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint summer();\n\nint main(void) {\n  int counter, times, patty;\n  scanf(\"%d\", &times);\n\n  for (counter = 0; counter < times; counter++) {\n    patty = summer();\n    cout << patty << \" \";\n  }\n\n  return 0;\n}\n\nint summer() {\n  int m, n;\n  int line, row;\n\n  scanf(\"%d%d\", &line, &row);\n  int fib[1000][1000];\n\n  for (m = 0; m < line; m++) {\n    for (n = 0; n < row; n++)\n      cin >> fib[m][n];\n  }\n  int sum = 0;\n  int i;\n  for (i = 0; i < row; i++) {\n    sum = sum + *((*fib) + i) + *(*(fib + line - 1) + i);\n  }\n\n  for (i = 1; i < line - 1; i++) {\n    sum = sum + *(*(fib + i)) + *(*(fib + i) + row - 1);\n  }\n\n  return sum;\n}\n"}
{"label": "6", "index": "10784", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  int a, b;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    sum = 0;\n    int c[100][100][100];\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d \", &c[i][j][k]);\n    }\n    for (j = 0; j < a; j++)\n      sum += c[i][j][0] + c[i][j][b - 1];\n    for (k = 0; k < b; k++)\n      sum += c[i][0][k] + c[i][a - 1][k];\n    sum =\n        sum - c[i][0][0] - c[i][0][b - 1] - c[i][a - 1][0] - c[i][a - 1][b - 1];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10785", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, *p, a[100][100], s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    p = &a[0][0];\n    s = 0;\n    for (j = 0; j < n; j++) {\n      if (n == 1)\n        s += *p;\n      else\n        s += (*(p + j) + *(p + 100 * (m - 1) + j));\n    }\n    for (j = 1; j < m - 1; j++)\n      s += (*(p + j * 100) + *(p + j * 100 + n - 1));\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10786", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  \n  \n  int k, m, n;\n  int result[100];\n  \n  int i, j, temp1 = 0, temp2 = 0, tempr = 0;\n  double temp3 = 0;\n\n  \n  \n  scanf(\"%d\", &k);\n\n  \n  \n\n  \n  for (temp2 = 1; temp2 <= k; temp2++) {\n    scanf(\"%d%d\", &m, &n);\n    tempr = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &temp1);\n        if (i == 1 || i == m || j == 1 || j == n) {\n          tempr += temp1;\n        }\n      }\n    }\n    result[temp2] = tempr;\n  }\n\n  \n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  \n  return 0;\n}\n"}
{"label": "6", "index": "10787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, row[99], col[99], s[99][99][99], sum[99] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &row[i], &col[i]);\n    for (j = 0; j < row[i]; j++) {\n      for (k = 0; k < col[i]; k++) {\n        scanf(\"%d\", &s[i][j][k]);\n        if ((j == 0) || (k == 0) || (j == (row[i] - 1)) || (k == col[i] - 1)) {\n          sum[i] += s[i][j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, k, j, p, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (p = 1; p <= n; p++) {\n        scanf(\"%d\", &a[j][p]);\n      }\n    }\n    for (p = 1; p <= n; p++) {\n      sum += a[1][p];\n    }\n    for (j = 2; j <= m; j++) {\n      sum += a[j][n];\n    }\n    for (p = n - 1; p >= 1; p--) {\n      sum += a[m][p];\n    }\n    for (j = m - 1; j >= 2; j--) {\n      sum += a[j][1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int juzhen[101][101];\n  int m, n, i, j, sum;\n  int k;\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &juzhen[i][j]);\n        if (i == 0)\n          sum += juzhen[i][j];\n        if (i == m - 1)\n          sum += juzhen[i][j];\n        if (j == 0 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n        if (j == n - 1 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n      }\n    }\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10790", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int r = 1; r <= t; r++) {\n    int m, n;\n    cin >> m >> n;\n    int juzhen[100][100];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    int *p;\n    int sum = 0;\n    for (int s = 0; s < m; s++) {\n      if (s == 0 || s == m - 1) {\n        for (p = juzhen[s]; p <= &juzhen[s][n - 1]; p++)\n          sum = sum + (*p);\n      } else {\n        p = juzhen[s];\n        sum = sum + (*p) + *(p + n - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, l, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((m == 1) && (n == 1))\n      printf(\"%d\\n\", a[0][0]);\n    else if (m == 1) {\n      s = 0;\n      for (j = 0; j < n; j++)\n        s = s + a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      s = 0;\n      for (j = 0; j < m; j++)\n        s = s + a[j][0];\n      printf(\"%d\\n\", s);\n    } else {\n      s = 0;\n      for (j = 0; j < n - 1; j++)\n        s = s + a[0][j];\n      for (j = 0; j < m - 1; j++)\n        s = s + a[j][n - 1];\n      for (j = n - 1; j > 0; j--)\n        s = s + a[m - 1][j];\n      for (j = m - 1; j > 0; j--)\n        s = s + a[j][0];\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, *b, *c, *d;\n  int i, j, n, m, k;\n  a = (int *)calloc(1000000, sizeof(int));\n  b = (int *)calloc(10, sizeof(int));\n  scanf(\"%d\", &k);\n  c = a;\n  d = b;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (j = 0; j < n * m; j++)\n      scanf(\"%d\", c + j);\n    for (j = 0; j < m; j++)\n      sum += *(c + j);\n    for (j = m * (n - 1); j < n * m; j++)\n      sum += *(c + j);\n    for (j = m; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    for (j = m + m - 1; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    *(d++) = sum;\n  }\n  for (d = b; d < b + k; d++) {\n    printf(\"%d\", *d);\n    printf(\"\\n\");\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "6", "index": "10793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[105][105], (*p)[105] = NULL, sum;\n  scanf(\"%d \", &k);\n  for (int time = 1; time <= k; time++) {\n    sum = 0;\n    p = a;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++)\n      sum = sum + *(*p + i) + *(*(p + m - 1) + i);\n\n    for (int i = 1; i < m - 1; i++) {\n      sum = sum + *(*(p + i)) + *(*(p + i) + n - 1);\n    }\n    if ((m == 1) || (n == 1))\n      sum = sum / 2;\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, board[100][100], sum = 0;\n    int(*p)[100];\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++)\n        cin >> board[j][p];\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++) {\n        if (j == 0 || j == m - 1 || p == 0 || p == n - 1)\n          sum += board[j][p];\n      }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bianyuan(int n, int m) {\n  int juzhen[100][100];\n  int i, j, result;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &juzhen[i][j]);\n    }\n  }\n  result = 0;\n  for (j = 0; j < m; j++) {\n    result += juzhen[0][j];\n  }\n  for (j = 0; j < m; j++) {\n    result += juzhen[n - 1][j];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][m - 1];\n  }\n  return result;\n}\nint main() {\n  int n, i;\n  int a, lie, hang;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &lie, &hang);\n    a = bianyuan(lie, hang);\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10796", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum = 0;\n  cin >> k;\n  int a[100][100];\n  for (int i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m != 1 && n != 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i) + *(*(a + m - 1) + i);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      cout << sum << endl;\n    } else\n      printf(\"%d\\n\", **a);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10797", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, h, l, y;\n  int *p = NULL;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    y = 0;\n    int x[101][101] = {0};\n    cin >> h >> l;\n    for (j = 1; j <= h; j++) {\n      for (k = 1; k <= l; k++) {\n        cin >> x[j][k];\n      }\n    }\n\n    for (p = x[1] + 1; p <= x[1] + l; p++) {\n      y = y + (*p);\n    }\n\n    for (p = x[2] + 1; p <= x[h - 1] + 1; p = p + 101) {\n      y = y + (*p) + (*(p + l - 1));\n    }\n\n    for (p = x[h] + 1; p <= x[h] + l; p++) {\n      y = y + (*p);\n    }\n    cout << y << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10798", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  while (num--) {\n    int a[100][100];\n    int m, n;\n    scanf(\"%d %d \", &m, &n);\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10799", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int juzhen[101][101];\n  int m, n, i, j, sum;\n  int k;\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> juzhen[i][j];\n        if (i == 0)\n          sum += juzhen[i][j];\n        if (i == m - 1)\n          sum += juzhen[i][j];\n        if (j == 0 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n        if (j == n - 1 && i != 0 && i != m - 1)\n          sum += juzhen[i][j];\n      }\n    }\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  cin >> t;\n  while (t--) {\n    int a[100][100], sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    }\n    for (int i = 0; i < m; i++) {\n      if (n > 1)\n        sum += (**(a + i) + *(*(a + i) + n - 1));\n      else {\n        sum += **(a + i);\n      }\n    }\n    for (int i = 1; i < n - 1; i++) {\n      if (m > 1)\n        sum += (*(*a + i) + *(*(a + m - 1) + i));\n      else\n        sum += *(*a + i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  for (i; i <= n; i++) {\n    int p, q;\n    scanf(\"%d %d\", &p, &q);\n    int a[10000];\n    for (int j = 0; j < p * q; j++) {\n      scanf(\"%d\", &a[j]);\n    }\n    int sum = 0;\n    int m = 0;\n    while (m < q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = (p - 1) * q;\n    while (m < p * q) {\n      sum = sum + a[m];\n      m++;\n    }\n    m = 1;\n    while (m < p - 1) {\n      sum = sum + a[q * m];\n      m++;\n    }\n    m = 2;\n    while (m < p) {\n      sum = sum + a[q * m - 1];\n      m++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, m, n, a, b, sz[1000][1000], s = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s += (sz[0][b] + sz[m - 1][b]);\n    }\n    for (a = 0; a < m; a++) {\n      s += (sz[a][0] + sz[a][n - 1]);\n    }\n    s -= (sz[0][0] + sz[m - 1][0] + sz[0][n - 1] + sz[m - 1][n - 1]);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10803", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[100][100];\n  int k, i, x, y;\n  int m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (x = 0; x < m; x++) {\n      for (y = 0; y < n; y++) {\n        cin >> *(*(number + x) + y);\n      }\n    }\n    if (n == 1 && m == 1)\n      printf(\"%d\\n\", **number);\n    else {\n      for (x = 0; x < m; x++) {\n        sum += *(*(number + x));\n        sum += *(*(number + x) + n - 1);\n      }\n\n      for (y = 0; y < n; y++) {\n        sum += *(*(number) + y);\n        sum += *(*(number + m - 1) + y);\n      }\n\n      sum = sum - *(*(number)) - *(*(number) + n - 1) - *(*(number + m - 1)) -\n            *(*(number + m - 1) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], sum[100], i, j, a, b, c, d, e;\n  b = 0;\n  c = 0;\n  d = 0;\n  e = 0;\n  scanf(\"%d\", &k);\n  \n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      b = b + sz[0][j];\n      c = c + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      d = d + sz[i][0];\n      e = e + sz[i][n - 1];\n    }\n    sum[a] = b + c + d + e;\n    b = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n  }\n  for (a = 0; a < k; a++) {\n    printf(\"%d\\n\", sum[a]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, h, l, y;\n  int *p = NULL;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    y = 0;\n    int x[101][101] = {0};\n    cin >> h >> l;\n    for (j = 1; j <= h; j++) {\n      for (k = 1; k <= l; k++) {\n        cin >> x[j][k];\n      }\n    }\n\n    for (p = x[1] + 1; p <= x[1] + l; p++) {\n      y = y + (*p);\n    }\n\n    for (p = x[2] + 1; p <= x[h - 1] + 1; p = p + 101)\n      y = y + (*p) + (*(p + l - 1));\n\n    for (p = x[h] + 1; p <= x[h] + l; p++) {\n      y = y + (*p);\n    }\n    cout << y << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, m, n, i, j, k, a[100][100], sum;\n  scanf(\"%d\", &p);\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[j][k]);\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[1][1]);\n      break;\n    }\n    for (k = 1; k <= n; k++)\n      sum += a[1][k] + a[m][k];\n    for (j = 1; j <= m; j++)\n      sum += a[j][1] + a[j][n];\n    sum -= a[1][1] + a[1][n] + a[m][1] + a[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, q;\n  int k;\n  int m, n;\n  int a[110][110];\n  int sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", *(a + j) + q);\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      sum += *(*a + j);\n      if (m != 1)\n        sum += *(*(a + m - 1) + j);\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += *(*(a + j));\n      if (n != 1)\n        sum += *(*(a + j) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fy();\n  int num, k;\n  scanf(\"%d\", &num);\n  for (k = 0; k < num; k++) {\n    printf(\"%d\\n\", fy());\n  }\n  return 0;\n}\nint fy() {\n  int a[100][100];\n  int sum = 0, m, n, i, j;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", *(a + i));\n    sum = sum + *(*(a + i));\n    for (j = 1; j < n; j++)\n      scanf(\" %d\", *(a + i) + j);\n    sum = sum + *(*(a + i) + n - 1);\n  }\n  for (i = 1; i < n - 1; i++) {\n    sum = sum + a[0][i] + a[m - 1][i];\n  }\n  return sum;\n}\n"}
{"label": "6", "index": "10809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i = 1, j, a[101][101], s, k;\n  int sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d \", &s);\n  while (i <= s) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m;\n    cin >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (j = 0; j < n; j++)\n      sum1 += a[0][j];\n    for (j = 0; j < n; j++)\n      sum2 += a[m - 1][j];\n    for (j = 0; j < m; j++)\n      sum3 += a[j][0];\n    for (j = 0; j < m; j++)\n      sum4 += a[j][n - 1];\n    sum = sum1 + sum2 + sum3 + sum4;\n    cout << sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1] << \"\\n\";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10810", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, m, i, j, t, s;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    scanf(\"%d %d\", &m, &n);\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        }\n        if ((j == 0 || j == n - 1) && i != 0 && i != m - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N = 100;\n  int k, m, n, i, a[N][N], b[N], c, d, e[N], f[N];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d %d\", &e[i], &f[i]);\n    m = e[i];\n    n = f[i];\n    for (c = 0; c < m; c++) {\n      for (d = 0; d < n; d++) {\n        scanf(\"%d\", &a[c][d]);\n      }\n    }\n    for (c = 0; c < m; c++) {\n      b[i] = b[i] + a[c][0] + a[c][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      b[i] = b[i] + a[0][d] + a[m - 1][d];\n    }\n    printf(\"%d\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n;\n  int a[110][110];\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    if (m > 1 && n > 1) {\n      for (int t1 = 0; t1 < m; t1++) {\n        for (int t2 = 0; t2 < n; t2++)\n          cin >> *(*(a + t1) + t2);\n      }\n      for (int k1 = 0; k1 < n; k1++)\n        sum = sum + *(*(a + 0) + k1);\n      for (int k2 = 0; k2 < n; k2++)\n        sum = sum + *(*(a + m - 1) + k2);\n      for (int k3 = 0; k3 < m; k3++)\n        sum = sum + *(*(a + k3) + 0);\n      for (int k4 = 0; k4 < m; k4++)\n        sum = sum + *(*(a + k4) + n - 1);\n      sum = sum - *(*(a + 0) + 0) - *(*(a + m - 1) + n - 1) -\n            *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0);\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cin >> sum;\n      cout << sum << \"\\n\";\n    } else if (m == 1 && n > 1) {\n      for (int p1 = 0; p1 < n; p1++) {\n        cin >> *(*(a + 0) + p1);\n        sum = sum + *(*(a + 0) + p1);\n      }\n      cout << sum << endl;\n    } else if (m > 1 && n == 1) {\n      for (int p2 = 0; p2 < m; p2++) {\n        cin >> *(*(a + p2) + 0);\n        sum = sum + *(*(a + p2) + 0);\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, jz[100][100], ROW, COL, h[100], y, i, row, col;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &jz[row][col]);\n      }\n    }\n    y = 0;\n    for (row = 0; row < ROW; row++)\n      y += jz[row][0];\n\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][COL - 1];\n    }\n\n    for (col = 0; col < COL; col++) {\n      y += jz[0][col];\n    }\n    for (col = 0; col < COL; col++) {\n      y += jz[ROW - 1][col];\n    }\n\n    h[i] =\n        y - jz[0][0] - jz[0][COL - 1] - jz[ROW - 1][0] - jz[ROW - 1][COL - 1];\n  }\n  for (i = 0; i < k; i++) {\n    cout << h[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k, x;\n  x = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int row = 0; row < m; row++) {\n      for (int col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (int row = 0; row < m; row++) {\n      x += sz[row][0];\n    }\n    for (int col = 1; col < n; col++) {\n      x += sz[0][col];\n    }\n    for (int row = 1; row < m; row++) {\n      x += sz[row][n - 1];\n    }\n    for (int col = 1; col < n - 1; col++) {\n      x += sz[m - 1][col];\n    }\n    printf(\"%d\\n\", x);\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  for (int i = 1; i <= a; i++) {\n    int m, n, t = 0;\n    cin >> m >> n;\n    int x[100][100];\n\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(x + i) + j);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << *(*(x)) << endl;\n    }\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      cout << t << endl;\n    }\n    if (m != 1 && n == 1) {\n      for (int i = 0; i < m; i++)\n        t = t + *(*(x + i));\n\n      cout << t << endl;\n    }\n    if (m != 1 && n != 1) {\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x) + j);\n      }\n      for (int j = 0; j < n; j++) {\n        t = t + *(*(x + m - 1) + j);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + 0);\n      }\n      for (int i = 0; i < m; i++) {\n        t = t + *(*(x + i) + n - 1);\n      }\n      cout << t - *(*(x + 0) + 0) - *(*(x + 0) + n - 1) - *(*(x + m - 1) + 0) -\n                  *(*(x + m - 1) + n - 1)\n           << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m[100], n[100], he[100];\n  int a[100][100];\n  int i, j, l, total;\n\n  for (i = 0; i < k; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        cin >> a[j][l];\n      }\n    }\n    total = 0;\n    for (l = 0; l < n[i]; l++) {\n      total = total + a[0][l] + a[m[i] - 1][l];\n    }\n    for (j = 1; j < m[i] - 1; j++) {\n      total = total + a[j][0] + a[j][n[i] - 1];\n    }\n    he[i] = total;\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    cout << he[i] << \"\\n\";\n  }\n  printf(\"%d\", he[k - 1]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10817", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, z, sum, temp;\n  int a[101][101];\n  int(*p)[101] = a;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (z = 0; z < n; z++)\n        cin >> *(*(p + j) + z);\n    if (m != 1 && n != 1) {\n      for (temp = 0; temp < n; temp++)\n        sum += (*(*(p) + temp) + *(*(p + m - 1) + temp));\n      for (temp = 0; temp < m; temp++) {\n        sum += (*(*(p + temp)) + *(*(p + temp) + n - 1));\n      }\n      sum -=\n          *(*(p)) + *(*(p) + n - 1) + *(*(p + m - 1)) + *(*(p + m - 1) + n - 1);\n      cout << sum << endl;\n    } else\n      cout << *(*(p)) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum = 0, i, j, p;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m == 1) {\n      cout << a[0][0] << endl;\n    } else if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    } else if (n > 1 && m == 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      cout << sum << endl;\n      sum = 0;\n    } else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n    sum = 0;\n    k--;\n  }\n}\n"}
{"label": "6", "index": "10819", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int b[1000];\n  int n, he;\n  int h, l;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    he = 0;\n    scanf(\"%d %d\", &h, &l);\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", (*(a + i) + j));\n\n    for (i = 0; i < h; i++)\n      he = he + *(*(a + i) + 0) + *(*(a + i) + l - 1);\n\n    for (j = 0; j < l; j++)\n      he = he + *(*a + j) + *(*(a + h - 1) + j);\n\n    he = he - *(*(a + 0) + l - 1) - *(*(a + h - 1) + l - 1) - *(*(a + 0) + 0) -\n         *(*(a + h - 1) + 0);\n    b[k] = he;\n  }\n  for (k = 0; k < n - 1; k++)\n    printf(\"%d\\n\", b[k]);\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "6", "index": "10820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, shuzu[100][100], hang = 0, lie = 0, zu = 0, sum = 0;\n  scanf(\"%d\", &zu);\n  for (i = 0; i < zu; i++) {\n    scanf(\"%d%d\", &hang, &lie);\n    sum = 0;\n    for (j = 0; j < hang; j++) {\n      for (k = 0; k < lie; k++) {\n        scanf(\"%d\", &shuzu[j][k]);\n      }\n    }\n    for (k = 0; k < lie; k++) {\n      sum = sum + shuzu[0][k];\n    }\n    if (hang > 1) {\n      for (k = 0; k < lie; k++) {\n        sum = sum + shuzu[hang - 1][k];\n      }\n    }\n    if (hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][0];\n      }\n    }\n    if (lie > 1 && hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][lie - 1];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, m;\n  scanf(\"%d \", &a);\n  for (int i = 0; i < a; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    int A[100][100] = {0};\n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> A[j][k];\n      }\n    }\n    if (m == 1 && n == 1)\n      cout << A[0][0] << endl;\n    else {\n      for (int j = 0; j < m; j++)\n        sum = sum + A[j][0] + A[j][n - 1];\n      for (int j = 0; j < n; j++)\n        sum = sum + A[0][j] + A[m - 1][j];\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][n - 1] - A[m - 1][0];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int times;\n  int p[200][200];\n  int hang, lie;\n  int sum = 0;\n  int i, j;\n  cin >> n;\n  for (times = 0; times < n; times++) {\n    cin >> hang >> lie;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0; i < hang; i = i + hang - 1)\n      for (j = 0; j < lie; j++)\n        sum = sum + *(*(p + i) + j);\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j = j + lie - 1)\n        sum = sum + *(*(p + i) + j);\n    sum = sum - *(*p) - *(*p + lie - 1) - *(*(p + hang - 1)) -\n          *(*(p + hang - 1) + lie - 1);\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10823", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int MAX = 100;\n\nint main() {\n  int k;\n  int A[MAX][MAX];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &A[i][j]);\n    }\n    int sum = 0;\n\n    if ((m != 1) && (n != 1)) {\n      for (int j = 0; j < n; j++) {\n        sum += A[0][j];\n      }\n      for (int j = 0; j < n; j++) {\n        sum += A[m - 1][j];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][0];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][n - 1];\n      }\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][0] - A[m - 1][n - 1];\n    }\n\n    else {\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < n; j++)\n          sum += A[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int a[100][100], r, l, sum = 0;\n    scanf(\"%d%d\", &r, &l);\n    for (j = 0; j <= r - 1; j++)\n      for (k = 0; k <= l - 1; k++)\n        scanf(\"%d\", *(a + j) + k);\n    for (j = 0; j <= r - 1; j++) {\n      for (k = 0; k <= l - 1; k++) {\n        if (j == r - 1 || j == 0 || k == l - 1 || k == 0)\n          sum += *(*(a + j) + k);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], sum[100] = {0}, i, j, l, k, m, n;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d \", &a[j][l]);\n    for (j = 0; j < n; j++)\n      sum[i] = sum[i] + a[0][j];\n    for (j = 1; j < m; j++) {\n      sum[i] = sum[i] + a[j][0];\n      sum[i] = sum[i] + a[j][n - 1];\n    }\n    for (j = 1; j < n - 1; j++)\n      sum[i] = sum[i] + a[m - 1][j];\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "10826", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, y;\n  int z[100][100];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    y = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int t = 0; t < n; t++)\n        cin >> z[j][t];\n    }\n    for (int a = 0; a < m; a++) {\n      y = y + z[a][0] + z[a][n - 1];\n    }\n    for (int b = 0; b < n; b++) {\n      y = y + z[0][b] + z[m - 1][b];\n    }\n    y = y - z[0][0] - z[0][n - 1] - z[m - 1][0] - z[m - 1][n - 1];\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10827", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n;\n  int a[110][110];\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    if (m > 1 && n > 1) {\n      for (int t1 = 0; t1 < m; t1++) {\n        for (int t2 = 0; t2 < n; t2++)\n          cin >> *(*(a + t1) + t2);\n      }\n      for (int k1 = 0; k1 < n; k1++)\n        sum = sum + *(*(a + 0) + k1);\n      for (int k2 = 0; k2 < n; k2++)\n        sum = sum + *(*(a + m - 1) + k2);\n      for (int k3 = 0; k3 < m; k3++)\n        sum = sum + *(*(a + k3) + 0);\n      for (int k4 = 0; k4 < m; k4++)\n        sum = sum + *(*(a + k4) + n - 1);\n      sum = sum - *(*(a + 0) + 0) - *(*(a + m - 1) + n - 1) -\n            *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0);\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cin >> sum;\n      cout << sum << endl;\n    } else if (m == 1 && n > 1) {\n      for (int p1 = 0; p1 < n; p1++) {\n        cin >> *(*(a + 0) + p1);\n        sum = sum + *(*(a + 0) + p1);\n      }\n      cout << sum << endl;\n    } else if (m > 1 && n == 1) {\n      for (int p2 = 0; p2 < m; p2++) {\n        cin >> *(*(a + p2) + 0);\n        sum = sum + *(*(a + p2) + 0);\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sum();\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum();\n  }\n}\nvoid sum() {\n  int m, n, i, j, s = 0, a[101][101];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m; i++)\n    s = s + a[i][0];\n  for (i = 0; i < m; i++)\n    s = s + a[i][n - 1];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[0][i];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[m - 1][i];\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "6", "index": "10829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int k, n, m, i, j, l;\n  int sum = 0;\n\n  scanf(\"%d \", &k);\n\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < m - 1; j++) {\n\n      sum += sz[0][j];\n    }\n    for (i = 0; i < n - 1; i++) {\n      sum += sz[i][m - 1];\n    }\n    for (j = 1; j < m; j++) {\n      sum += sz[n - 1][j];\n    }\n    for (i = 1; i < n; i++) {\n      sum += sz[i][0];\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int m, n;\n  int a[101][101];\n  int u, i, j, sum;\n  scanf(\"%d\", &k);\n  for (u = 0; u < k; u++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if ((i == 0) || (j == 0) || (i == m - 1) || j == (n - 1)) {\n          sum += a[i][j];\n        }\n      }\n    }\n    if (u != k - 1) {\n      printf(\"%d\\n\", sum);\n    } else if (u == k - 1) {\n      cout << sum;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], i, j, m, n, k, max;\n  int *pa;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m * n; j++)\n      scanf(\"%d\", &a[j - 1]);\n    pa = a;\n    if ((m >= 2) && (n >= 2)) {\n      for (j = 1; j < n; j++)\n        *pa += a[j];\n      for (j = m * n - n; j < m * n; j++)\n        *pa += a[j];\n      for (j = n; j < m * n - n; j++)\n        if ((j % n == 0) || (j % n == n - 1))\n          *pa += a[j];\n    } else {\n      for (j = 1; j < m * n; j++) {\n        *pa += a[j];\n      }\n    }\n    printf(\"%d\\n\", *pa);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], row, col, sum = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    cin >> row >> col;\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        cin >> a[i][j];\n    if (row == 1 && col == 1)\n      cout << *(a[0]);\n    else {\n      for (int i = 0; i < col; i++) {\n        sum += *(a[0] + i);\n        sum += *(a[row - 1] + i);\n      }\n      for (int j = 1; j < row - 1; j++) {\n        sum += *(a[j]);\n        sum += *(a[j] + col - 1);\n      }\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10833", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, p, q;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    int sum = 0;\n    if (m <= 2 || n <= 2) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum = sum + a[p][q];\n        }\n      }\n      cout << sum << endl;\n    } else {\n      int sum1 = 0, sum2 = 0;\n      sum = 0;\n      for (p = 0; p < m; p++) {\n        sum1 = a[p][0] + a[p][n - 1] + sum1;\n      }\n      for (q = 0; q < n; q++) {\n        sum2 = sum2 + a[0][q] + a[m - 1][q];\n      }\n      sum =\n          sum1 + sum2 - (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10834", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int b[1000];\n  int n, he;\n  int h, l;\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    he = 0;\n    cin >> h >> l;\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", (*(a + i) + j));\n\n    for (i = 0; i < h; i++)\n      he = he + *(*(a + i) + 0) + *(*(a + i) + l - 1);\n\n    for (j = 0; j < l; j++)\n      he = he + *(*a + j) + *(*(a + h - 1) + j);\n\n    he = he - *(*(a + 0) + l - 1) - *(*(a + h - 1) + l - 1) - *(*(a + 0) + 0) -\n         *(*(a + h - 1) + 0);\n    b[k] = he;\n  }\n  for (k = 0; k < n - 1; k++)\n    printf(\"%d\\n\", b[k]);\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "6", "index": "10835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, h, m, n;\n  int sum = 0, minus = 0;\n  int a[100][100];\n  int b[100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        sum += a[i][j];\n      }\n    }\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        minus += a[i][j];\n      }\n    }\n    b[h] = sum - minus;\n    sum = 0;\n    minus = 0;\n  }\n  for (h = 0; h < k; h++) {\n    printf(\"%d\\n\", b[h]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10836", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int line, row, sum;\n  int array[200][200];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> line >> row;\n    for (j = 0; j < line; j++)\n      for (k = 0; k < row; k++)\n        cin >> array[j][k];\n    sum = 0;\n    if (row == 1 || line == 1) {\n      for (j = 0; j < line; j++)\n        for (k = 0; k < row; k++)\n          sum = sum + array[j][k];\n      cout << sum << endl;\n    } else {\n      sum = 0 - array[0][0] - array[0][row - 1] - array[line - 1][0] -\n            array[line - 1][row - 1];\n      for (j = 0; j < line; j++)\n        sum = sum + array[j][0] + array[j][row - 1];\n      for (j = 0; j < row; j++)\n        sum = sum + array[0][j] + array[line - 1][j];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, q, s = 0;\n  int m, n, k;\n  scanf(\"%d\", &k);\n  for (q = 0; q < k; q++) {\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(a + i) + j);\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      s = s + *(*(a + 0) + i);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + n - 1);\n    for (i = 1; i < m; i++)\n      s = s + *(*(a + i) + 0);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(a + m - 1) + i);\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200][200], t, n, m, i, j, s;\n  int(*p)[200];\n  scanf(\"%d\", &t);\n  while (t--) {\n    scanf(\"%d%d\", &n, &m);\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", *(p + i) + j);\n    s = 0;\n    for (i = 0; i < m; i++)\n      s = s + *(*p + i);\n    if (n > 1)\n      for (i = 0; i < m; i++)\n        s = s + *(*(p + n - 1) + i);\n    for (i = 1; i < n - 1; i++)\n      s = s + *(*(p + i));\n    if (m > 1)\n      for (i = 1; i < n - 1; i++)\n        s = s + *(*(p + i) + m - 1);\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int jz[100][100];\n  int m, n;\n\n  int s[1000];\n  int i, j, q;\n\n  for (q = 0; q < k; q++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n\n        scanf(\"%d\", &(jz[i][j]));\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][0];\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][n - 1];\n    }\n    for (i = 0; i < n; i++) {\n      s[q] += jz[0][i];\n    }\n    for (i = 0; i < n; i++) {\n      s[q] += jz[m - 1][i];\n    }\n    s[q] = s[q] - (jz[0][0]) - (jz[0][n - 1]) - (jz[m - 1][0]) -\n           (jz[m - 1][n - 1]);\n    if (q == k - 1) {\n      printf(\"%d\", s[q]);\n    } else {\n      printf(\"%d\\n\", s[q]);\n    }\n    m = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int *p, i, all, m, n, cycle, ii;\n  scanf(\"%d\", &cycle);\n  for (ii = 0; ii < cycle; ii++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)calloc(m * n, sizeof(int));\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    all = 0;\n    for (i = 0; i < n; i++)\n      all += *(p + i);\n    if (m > 1) {\n      for (i = 0; i < n; i++)\n        all += *(p + i + (m - 1) * n);\n    }\n    for (i = 2; i < m; i++)\n      all += *(p + (i - 1) * n);\n    if (n > 1) {\n      for (i = 2; i < m; i++)\n        all += *(p + n - 1 + (i - 1) * n);\n    }\n    cout << all << \" \";\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], k, i, j, t, m, n, sum;\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 2; i < n; i++)\n      sum += a[1][i] + a[m][i];\n    for (j = 2; j < m; j++)\n      sum += a[j][1] + a[j][n];\n    sum +=\n        a[1][1] + (n != 1) * a[1][n] + (m != 1) * a[m][1] + (m != 1) * a[m][n];\n    if (t < k)\n      printf(\"%d\\n\", sum);\n    else\n      printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int x, y;\n  int a[100][100];\n  int i, j, k, l, m;\n  int s;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> x >> y;\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++)\n        cin >> a[j][k];\n    }\n    s = 0;\n    for (l = 0; l < y; l++) {\n      s = s + a[0][l] + a[x - 1][l];\n    }\n    for (m = 1; m < x - 1; m++)\n      s = s + a[m][0] + a[m][y - 1];\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, i, j, x, sum;\n  cin >> k;\n  while (k--) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> x;\n        if ((i == 1) || (i == m) || (j == 1) || (j == n))\n          sum = sum + x;\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, num[150][150], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (j = 0; j < m; j++) {\n      for (a = 0; a < n; a++) {\n        scanf(\"%d\", &num[j][a]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum += num[0][j];\n      if (m != 1) {\n        sum += num[m - 1][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += (num[j][0]);\n      if (n != 1) {\n        sum += num[j][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, s = 0, a[102][102];\n  cin >> k;\n  while (k > 0) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= m; i++) {\n      s = s + a[i][1] + a[i][n];\n    }\n    for (j = 2; j <= n - 1; j++) {\n      s = s + a[1][j] + a[m][j];\n    }\n    printf(\"%d\\n\", s);\n    k--;\n  }\n}\n"}
{"label": "6", "index": "10846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100], sum[100]; \n  cin >> k;\n  for (int w = 0; w < 100; w++) \n  {\n    sum[w] = 0;\n  }\n  for (int i = 0; i < k; i++) \n  {\n    cin >> m >> n; \n    for (int j = 0; j < m; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[k];                                      \n        if (j == 0 || j == m - 1 || k == 0 || k == n - 1) \n          sum[i] = sum[i] + a[k];                         \n      }\n    }\n  }\n  for (int p = 0; p < k; p++) {\n    cout << sum[p] << endl;\n  } \n\n  return 0;\n}\n"}
{"label": "6", "index": "10847", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, n, x, y, u, v;\n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &x, &y);\n    for (u = 0; u < x; u++)\n      for (v = 0; v < y; v++)\n        cin >> a[u][v];\n    if (x <= 2 || y <= 2) {\n      for (u = 0; u < x; u++) {\n        for (v = 0; v < y; v++)\n          sum += a[u][v];\n      }\n    } else {\n      for (u = 0; u < y; u++) {\n        sum += a[0][u];\n        sum += a[x - 1][u];\n      }\n      for (u = 1; u < x - 1; u++) {\n        sum += a[u][0];\n        sum += a[u][y - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10848", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int n, sum, row, col;\n  int *point;\n  point = *array;\n  cin >> n;\n  for (; n > 0; n--) {\n    sum = 0;\n    cin >> row >> col;\n    for (point = *array; point < *array + row * col; point++)\n      scanf(\"%d \", point);\n    point = *array;\n    for (; point < *array + col; point++) {\n      sum = sum + *point;\n    }\n    point--;\n    for (point = point + col; point < *array + row * col; point = point + col) {\n      sum = sum + *point;\n    }\n    point -= col;\n    for (point = point - 1; point >= *array + (row - 1) * col; point--)\n      sum = sum + *point;\n    point++;\n    for (point = point - col; point > *array; point = point - col)\n      sum = sum + *point;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int a[100][100];  \n  int n = 0;        \n  int x = 0, y = 0; \n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    cin >> y;\n    for (int j = 0; j < x; j++)\n      for (int k = 0; k < y; k++)\n        cin >> a[j][k];\n    int *p;\n    int sum = 0;\n    for (int j = 1; j < x - 1; j++) {\n      p = a[j];\n      sum = *p + *(p + y - 1) + sum;\n    } \n    p = a[0];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    p = a[x - 1];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    } \n    cout << sum << endl;\n  }\n  return 0;\n} \n"}
{"label": "6", "index": "10850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int square[100][100];\n  int k, i, j;\n  int(*p)[100];\n  p = square;\n  int sum = 0;\n  for (cin >> k; k; --k) {\n    int wide;\n    int height;\n    sum = 0;\n    cin >> height >> wide;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++)\n        cin >> square[i][j];\n    p = square;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++) {\n        if (i == 0 || j == 0 || i == height - 1 || j == wide - 1)\n          sum += *(*(p + i) + j);\n      }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, size[100][2], m[100][100][100], i, j, l, sum[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\", &size[i][0], &size[i][1]);\n    for (j = 0; j < size[i][0]; j++)\n      for (l = 0; l < size[i][1]; l++)\n        scanf(\"%d\", &m[i][j][l]);\n    \n    if ((size[i][1] == 1) && (size[i][0] == 1))\n      sum[i] = m[i][0][0];\n    else {\n      for (l = 0; l < size[i][1]; l++) {\n        if (size[i][1] == 1)\n          sum[i] = sum[i] + m[i][0][l];\n        else\n          sum[i] = sum[i] + m[i][0][l] + m[i][size[i][0] - 1][l];\n      }\n      for (j = 1; j <= size[i][0] - 2; j++) {\n        sum[i] = sum[i] + m[i][j][0] + m[i][j][size[i][1] - 1];\n      }\n    }\n    \n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, M, i, j, sum[1000];\n  int row[1000], col[1000];\n  int sz[1000][1000];\n  cin >> M;\n  for (m = 0; m < M; m++) {\n    sum[m] = 0;\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        sz[i][j] = 0;\n      }\n    }\n\n    cin >> row[m] >> col[m];\n\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        cin >> sz[i][j];\n      }\n    }\n\n    for (j = 0; j < col[m]; j++) {\n      sum[m] += sz[0][j];\n      sum[m] += sz[row[m] - 1][j];\n    }\n    for (i = 0; i < row[m]; i++) {\n      sum[m] += sz[i][0];\n      sum[m] += sz[i][col[m] - 1];\n    }\n    sum[m] = sum[m] - sz[0][0] - sz[row[m] - 1][col[m] - 1] -\n             sz[0][col[m] - 1] - sz[row[m] - 1][0];\n  }\n  for (m = 0; m < M; m++)\n    printf(\"%d\\n\", sum[m]);\n  return 0;\n}\n"}
{"label": "6", "index": "10853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int MAX = 100;\n\nint main() {\n  int k;\n  int A[MAX][MAX];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &A[i][j]);\n      }\n    }\n    int sum = 0;\n\n    if ((m != 1) && (n != 1)) {\n      for (int j = 0; j < n; j++) {\n        sum += A[0][j];\n      }\n      for (int j = 0; j < n; j++) {\n        sum += A[m - 1][j];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][0];\n      }\n      for (int i = 0; i < m; i++) {\n        sum += A[i][n - 1];\n      }\n      sum = sum - A[0][0] - A[0][n - 1] - A[m - 1][0] - A[m - 1][n - 1];\n    }\n\n    else {\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < n; j++) {\n          sum += A[i][j];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, *q, (*p)[100], h = 0, i, j, l, t;\n  p = (int(*)[100])malloc(100 * 100 * sizeof(int));\n  q = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(p + j) + l);\n      }\n    }\n    for (t = 0; t < n; t++) {\n      *(q + i) = *(q + i) + *(*p + t) + *(*(p + m - 1) + t);\n    }\n    for (t = 0; t < m; t++) {\n      *(q + i) = *(q + i) + **(p + t) + *(*(p + t) + n - 1);\n    }\n    *(q + i) = *(q + i) - **p - *(*p + n - 1) - *(*(p + m - 1)) -\n               *(*(p + m - 1) + n - 1);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", *(q + i));\n  }\n}\n"}
{"label": "6", "index": "10855", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m() {\n  int m, n, a[10000], i, j, s = 0;\n  int *p;\n  p = a;\n  cin >> m >> n;\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i < m; i++) {\n    if (i == 0 || i == m - 1) {\n      for (j = 0; j < n; j++) {\n        s = s + *(p + i * n + j);\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        if (j == 0 || j == n - 1)\n          s = s + *(p + i * n + j);\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int k, i, sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = m();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n, num, sum = 0;\n  int *p = NULL;\n  cin >> num;\n  for (k = 1; k <= num; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(a + i) + j);\n        }\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        sum = sum + *(*a + i);\n      }\n      for (i = 0; i < m - 1; i++) {\n        sum = sum + *(*(a + i) + n - 1);\n      }\n      for (i = 1; i < n; i++) {\n        sum = sum + *(*(a + m - 1) + i);\n      }\n      for (i = 1; i < m; i++) {\n        sum = sum + **(a + i);\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int *p, int h, int l);\n  int N, m, n, i, j, q, a[110][110] = {0};\n  scanf(\"%d\", &N);\n  for (q = 1; q <= N; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++)\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    printf(\"%d\\n\", sum(a[0], m, n));\n  }\n}\n\nint sum(int *p, int h, int l) {\n  int r = 0, i, j;\n  for (i = 0; i <= h - 1; i++) {\n    if (i == 0 || i == (h - 1))\n      for (j = 0; j <= l - 1; j++) {\n        r = r + *(p + i * 110 + j);\n      }\n    else\n      r = r + *(p + i * 110) + *(p + i * 110 + l - 1);\n  }\n  return r;\n}\n"}
{"label": "6", "index": "10858", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, sum, m, n, k; \n  int a[1000][1000];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = i = 0; i < m; i++) \n      sum = sum + a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      sum = sum + a[0][j] +\n            a[m - 1][j]; \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10859", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, t, i, j, l, k, sum = 0, a[100][100];\n  scanf(\"%d\", &t);\n  for (l = 0; l < t; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    if (m == n && n == 1) {\n      printf(\"%d\", a[0][0]);\n    } else {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n    sum = 0;\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "6", "index": "10860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, m, n, i, M, j, JU[100][100], h, l;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    M = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (h = 0; h < m; h++) {\n      for (l = 0; l < n; l++)\n        cin >> JU[h][l];\n    }\n    if (n == 1) {\n      for (j = 0; j < m; j++)\n        M = M + JU[j][0];\n    } else if (m == 1) {\n      for (j = 0; j < n; j++)\n        M = M + JU[0][j];\n    } else {\n      for (h = 0; h < m; h++) {\n        if (h > 0 && h < m - 1) {\n          M = M + JU[h][0] + JU[h][n - 1];\n        } else {\n          for (j = 0; j < n; j++)\n            M = M + JU[h][j];\n        }\n      }\n    }\n    cout << M << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, total;\n  int a[110][110] = {0};\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    cin >> m >> n;\n    total = 0;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(a + i) + j);\n        if ((i == 1) || (i == m))\n          total = total + *(*(a + i) + j);\n      }\n    for (i = 2; i < m; i++)\n      total = total + *(*(a + i) + 1) + *(*(a + i) + n);\n    cout << total << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, n, m, sum = 0, i, j, k, a[101][101];\n  cin >> l;\n  for (i = 1; i <= l; i++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    if (m != 1 && n != 1) {\n      for (k = 1; k <= n; k++)\n        sum += a[1][k];\n      for (k = 1; k <= n; k++)\n        sum += a[m][k];\n      for (k = 2; k < m; k++)\n        sum += a[k][1];\n      for (k = 2; k < m; k++)\n        sum += a[k][n];\n      cout << sum << \"\\n\";\n    } else {\n      for (j = 1; j <= m; j++)\n        for (k = 1; k <= n; k++)\n          sum += a[j][k];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int m[100], n[100], he[100];\n  int a[100][100];\n  int i, j, l, total;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    total = 0;\n    for (l = 0; l < n[i]; l++) {\n      total = total + a[0][l] + a[m[i] - 1][l];\n    }\n    for (j = 1; j < m[i] - 1; j++) {\n      total = total + a[j][0] + a[j][n[i] - 1];\n    }\n    he[i] = total;\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d\\n\", he[i]);\n  }\n  printf(\"%d\", he[k - 1]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, row, q, col, i, j, *a, *num;\n  scanf(\"%d\", &k);\n  num = (int *)malloc(k * sizeof(int));\n  for (q = 0; q < k; q++) {\n    int sum = 0;\n    scanf(\"%d %d\", &row, &col);\n    a = (int *)malloc(row * col * sizeof(int));\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", a + i * col + j);\n        if (i == 0 || j == 0 || i == row - 1 || j == col - 1)\n          sum = sum + *(a + i * col + j);\n      }\n    *(num + q) = sum;\n    free(a);\n  }\n  for (q = 0; q < k; q++)\n    printf(\"%d\\n\", *(num + q));\n  free(num);\n}\n"}
{"label": "6", "index": "10865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, u, k, m[100], n[100], g[100][100][100], num = 0; \n  int *p, (*q)[100];                                         \n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m[i] >> n[i]; \n    for (j = 0; j < m[i]; j++)\n      for (u = 0; u < n[i]; u++)\n        cin >> g[i][j][u]; \n  }\n  for (i = 1; i <= k; i++) {\n    num = 0;\n    for (p = &g[i][0][0]; p <= &g[i][0][n[i] - 1]; p++) \n      num = num + (*p);\n    for (p = &g[i][m[i] - 1][0]; p <= &g[i][m[i] - 1][n[i] - 1]; p++) \n      num = num + (*p);\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++) \n      num = num + (*(*q));\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++) \n      num = num + (*(*q + n[i] - 1));\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10866", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, r, s, a[100][100], j, k = 1, sum;\n  cin >> n;\n  while (k <= n) {\n    scanf(\"%d %d\", &r, &s);\n    sum = 0;\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < s; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n    if (r == 1) {\n      for (i = 0; i < s; i++)\n        sum += *(*(a + 0) + i);\n    } else if (s == 1) {\n      for (i = 0; i < r; i++)\n        sum += *(*(a + i) + 0);\n    } else {\n      for (i = 0, j = 0; j < s - 1; j++)\n        sum += *(*(a + i) + j);\n      for (i = 0, j = s - 1; i < r - 1; i++)\n        sum += *(*(a + i) + j);\n      for (i = r - 1; j > 0; j--)\n        sum += *(*(a + i) + j);\n      for (j = 0; i > 0; i--)\n        sum += *(*(a + i) + j);\n    }\n    printf(\"%d\\n\", sum);\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], b[100][100], c[100] = {0}, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++) {\n      for (k = 0; k < a[i][1]; k++) {\n        scanf(\"%d\", &b[j][k]);\n      }\n    }\n    for (j = 0; j < a[i][1]; j++)\n      c[i] = c[i] + b[0][j];\n    for (j = 0; j < a[i][1] && a[i][0] != 1; j++)\n      c[i] += b[a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      c[i] = c[i] + b[j][0];\n    for (j = 1; j < a[i][0] - 1 && a[i][1] != 1; j++)\n      c[i] += b[j][a[i][1] - 1];\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        b[j][k] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, i, j;\n    int a[100][100];\n    cin >> m >> n;\n    for (i = 0; i < m; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (j = 0; j < n; j++) { \n      sum += a[0][j];\n      sum += a[m - 1][j];\n    }\n    i = 1;\n    while (i < m - 1) { \n      sum += a[i][0];\n      sum += a[i][n - 1];\n      i++;\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "10869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, jz[100][100], sum = 0;\n  scanf(\"%d \", &k);\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &jz[i][j]);\n    }\n    if (m == 1 && n == 1)\n      sum = jz[0][0];\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i];\n    } else {\n      for (i = 0; i < n; i++)\n        sum = sum + jz[0][i] + jz[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + jz[i][0] + jz[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], h, l, k, m, n, i, j, w, sum;\n  scanf(\"%d\", &k);\n\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    w = m;\n    h = n;\n    i = 0;\n    while (i < m) {\n      j = 0;\n      while (j < n) {\n        scanf(\"%d\", &s[i][j]);\n        j++;\n      }\n      i++;\n    }\n    sum = 0;\n    if (h > 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0] + s[i][h - 1];\n        i++;\n      }\n      j = 0;\n      while (j < h) {\n        sum += s[0][j] + s[w - 1][j];\n        j++;\n      }\n      sum = sum - s[0][0] - s[0][h - 1] - s[w - 1][0] - s[w - 1][h - 1];\n    }\n    if (h == 1 && w == 1) {\n      sum = s[0][0];\n    }\n    if (h == 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0];\n        i++;\n      }\n    }\n    if (h > 1 && w == 1) {\n      j = 0;\n      while (j < h) {\n        sum += s[0][j];\n        j++;\n      }\n    }\n    if (h == 0 || w == 0) {\n      sum = 0;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10871", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], sum[100], i, j, a, b, c, d, e;\n  b = 0;\n  c = 0;\n  d = 0;\n  e = 0;\n  scanf(\"%d \", &k);\n\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      b = b + sz[0][j];\n      c = c + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      d = d + sz[i][0];\n      e = e + sz[i][n - 1];\n    }\n    sum[a] = b + c + d + e;\n    b = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%d\\n\", sum[a]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "10872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nint m, n;\nvoid Input(int (*a)[102]) {\n  cin >> m >> n;\n  for (int i = 0; i <= m - 1; i++) {\n    for (int j = 0; j <= n - 1; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n}\nvoid Sum(int x, int y, int (*a)[102]) {\n  sum += *(*(a + x) + y);\n  if (x == 0 && y < n - 1)\n    Sum(x, y + 1, a);\n  else if (x < m - 1 && y == n - 1)\n    Sum(x + 1, y, a);\n  else if (x == m - 1 && y > 0)\n    Sum(x, y - 1, a);\n  else if (y == 0 && x > 1)\n    Sum(x - 1, y, a);\n  else\n    return;\n}\nint main() {\n  int a[102][102];\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    Input(a);\n    Sum(0, 0, a);\n    if (i != 1)\n      printf(\"\\n\");\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, j, a;\n  for (scanf(\"%d\", &k); k > 0; k--) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n    }\n    for (i = 1; i < m - 1; i++) {\n      scanf(\"%d\", &a);\n      s = s + a;\n      for (j = 1; j < n; j++)\n        scanf(\"%d\", &a);\n      if (n != 1)\n        s = s + a;\n    }\n    if (m != 1)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a);\n        s = s + a;\n      }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "10874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[100][100], i, j, m, n, sum = 0;\n  cin >> k;\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n      if (m - 1 == 0)\n        sum = sum - a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n      if (n - 1 == 0)\n        sum = sum - a[i][n - 1];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10875", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, s = 0, p = 0, r = 0, q = 0, sum;\n  scanf(\"%d\", &k);\n  int a[1000][1000];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        scanf(\"%d \", &a[j][l]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s = s + a[1][j];\n      q = q + a[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      p = p + a[j][1];\n      r = r + a[j][n];\n    }\n    sum = s + p + r + q - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum);\n    s = 0;\n    q = 0;\n    p = 0;\n    r = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int b[100];\n  int m, j, r, n, k, p;\n\n  cin >> p;\n  for (m = 0; m < p; m++) {\n    scanf(\"%d %d\", &n, &k);\n    for (j = 0; j < n; j++) {\n      for (r = 0; r < k; r++) {\n        cin >> a[j][r];\n      }\n    }\n    b[m] = 0;\n    for (j = 0; j < 1; j++) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (j = n - 1; j > n - 2; j--) {\n      for (r = 0; r < k; r++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = 0; r < 1; r++) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n    for (r = k - 1; r > k - 2; r--) {\n      for (j = 1; j < n - 1; j++) {\n        b[m] = b[m] + a[j][r];\n      }\n    }\n  }\n  for (m = 0; m < p; m++) {\n    cout << b[m] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10877", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100][100][100], b[100][2], s[100], i, j, l, x, y;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    x = b[i][0];\n    y = b[i][1];\n    s[i] = 0;\n    for (j = 0; j < x; j++) {\n      for (l = 0; l < y; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n        if (j == 0 || l == 0 || j == x - 1 || l == y - 1)\n          s[i] += a[j][l][i];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "10878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, sum[100], p, q, t, l, m[100], n[100], h;\n  int a[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\\n\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (h = 0; h < n[i]; h++) {\n        scanf(\"%d\", &a[j][h]);\n      }\n    }\n    for (p = 0; p < n[i]; p++) {\n      sum[i] = sum[i] + a[0][p];\n    }\n    for (q = 1; q < m[i]; q++) {\n      sum[i] = sum[i] + a[q][n[i] - 1];\n    }\n    for (l = n[i] - 2; l >= 0; l--) {\n      sum[i] = sum[i] + a[m[i] - 1][l];\n    }\n    for (t = m[i] - 2; t > 0; t--) {\n      sum[i] = sum[i] + a[t][0];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b;\n  scanf(\"%d\", &k);\n  int s[k];\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int sz[m][n];\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        cin >> sz[a][b];\n      }\n    }\n    for (b = 0; b < n; b++) {\n      s[i] = s[i] + sz[0][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      s[i] = s[i] + sz[a][0];\n      s[i] = s[i] + sz[a][n - 1];\n    }\n    if (m != 1) {\n      for (b = 0; b < n; b++) {\n        s[i] = s[i] + sz[m - 1][b];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, h, i, j, a, b;\n  int s[100][100], r[100];\n  cin >> k;\n  for (int t = 0; t <= k - 1; t++) {\n    h = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (a = 0; a <= n - 1; a++) {\n      h = h + s[0][a] + s[m - 1][a];\n    }\n\n    for (b = 1; b <= m - 2; b++) {\n      h = h + s[b][0] + s[b][n - 1];\n    }\n    r[t] = h;\n  }\n  for (int x = 0; x <= k - 1; x++) {\n    printf(\"%d\\n\", r[x]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int b[100][100];\n    int *a[100][100];\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = &b[i][j];\n    \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(b + i) + j);\n        \n        if (i == 0)\n          sum = sum + **(*(a + i) + j);\n        if (i == m - 1)\n          sum = sum + **(*(a + i) + j);\n        \n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += ***(a + i);\n      sum += **(*(a + i) + n - 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10882", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int b[100][100];\n    int *a[100][100];\n    for (i = 0; i < 100; i++)\n      for (j = 0; j < 100; j++)\n        a[i][j] = &b[i][j];\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(b + i) + j);\n\n        if (i == 0)\n          sum = sum + **(*(a + i) + j);\n        if (i == m - 1)\n          sum = sum + **(*(a + i) + j);\n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += ***(a + i);\n      sum += **(*(a + i) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num_data;\n  cin >> num_data;\n  while (num_data--) {\n    int a[100][100];\n    int m, n;\n    int sum = 0;\n\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> a[i][j];\n\n    if (m == 1) {\n      for (int k = 0; k != n; k++)\n        sum += a[0][k];\n    } else if (n == 1) {\n      for (int k = 0; k != m; k++)\n        sum += a[k][0];\n    } else {\n      for (int k = 0; k != n - 1; k++)\n        sum += a[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += a[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += a[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += a[k][0];\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  cin >> t;\n  while (t--) {\n    int a[100][100], sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    for (int i = 0; i < m; i++) {\n      if (n > 1) {\n        sum += (**(a + i) + *(*(a + i) + n - 1));\n      } else\n        sum += **(a + i);\n    }\n    for (int i = 1; i < n - 1; i++) {\n      if (m > 1)\n        sum += (*(*a + i) + *(*(a + m - 1) + i));\n      else\n        sum += *(*a + i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10885", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, k, i, j, sum;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1)\n          continue;\n        if (j == 0 || j == n - 1)\n          continue;\n        a[i][j] = 0;\n      }\n    }\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        sum += a[i][j];\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int nums;\n  int jz[100][100] = {0};\n  scanf(\"%d\", &nums);\n  int i, j, k;\n  int sum;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      jz[i][j] = 0;\n  for (i = 0; i < nums; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &jz[j][k]);\n\n    for (j = 0; j < n; j++)\n      sum = sum + jz[0][j];\n    if (m - 1 != 0)\n      for (j = 0; j < n; j++)\n        sum = sum + jz[m - 1][j];\n    for (j = 1; j <= m - 2; j++)\n      sum = sum + jz[j][0];\n    if (n - 1 != 0)\n      for (j = 1; j <= m - 2; j++)\n        sum = sum + jz[j][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, x, m, n, i, j, k, sum[10000] = {0};\n  int sz[100][100];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    if ((m > 2) && (n > 2)) {\n      for (j = 0; j < m; j++) {\n        sum[i] = sum[i] + sz[j][0] + sz[j][n - 1];\n      }\n      for (k = 0; k < n; k++) {\n        sum[i] = sum[i] + sz[0][k] + sz[m - 1][k];\n      }\n      sum[i] =\n          sum[i] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    } else {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < n; k++) {\n          sum[i] = sum[i] + sz[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, s = 0, a[102][102];\n  cin >> k;\n  while (k > 0) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= m; i++) {\n      s = s + a[i][1] + a[i][n];\n    }\n    for (j = 2; j <= n - 1; j++) {\n      s = s + a[1][j] + a[m][j];\n    }\n    printf(\"%d\\n\", s);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10889", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int x[100][100];\n  int a, b;\n  int sum;\n  cin >> num;\n  for (int i = 0; i < num; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < 100; j++) {\n      for (int k = 0; k < 100; k++)\n        x[j][k] = 0;\n    }\n    sum = 0;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        scanf(\"%d \", &x[j][k]);\n        if (j == 0 || j == a - 1)\n          sum += x[j][k];\n        else {\n          if (k == 0 || k == b - 1) {\n            sum += x[j][k];\n          }\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, k, i, j, s, sum;\n  cin >> k;\n  for (s = 1; s <= k; s++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        sum = sum + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++)\n        sum = sum - a[i][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, m, n, i, j, k, b[100][100], sum = 0;\n  cin >> a;\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    cin >> m >> n;\n    ;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> b[i][j];\n    for (i = 0; i < m; i++)\n      sum += *(*(b + i)) + *(*(b + i) + n - 1);\n    for (i = 1; i < n - 1; i++)\n      sum += *(*b + i) + *(*(b + m - 1) + i);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int n, k, row, col, i, j, sum = 0;\n\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> a[i][j];\n    }\n    for (j = 1; j <= col; j++)\n      sum = sum + a[1][j];\n    for (i = 2; i <= row; i++)\n      sum = sum + a[i][col];\n    for (j = 1; j <= col - 1; j++)\n      sum = sum + a[row][j];\n    for (i = 2; i <= row - 1; i++)\n      sum = sum + a[i][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int b[1000];\n  int n, he;\n  int h, l;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    he = 0;\n    scanf(\"%d %d\", &h, &l);\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", (*(a + i) + j));\n\n    for (i = 0; i < h; i++)\n      he = he + *(*(a + i) + 0) + *(*(a + i) + l - 1);\n\n    for (j = 0; j < l; j++)\n      he = he + *(*a + j) + *(*(a + h - 1) + j);\n\n    he = he - *(*(a + 0) + l - 1) - *(*(a + h - 1) + l - 1) - *(*(a + 0) + 0) -\n         *(*(a + h - 1) + 0);\n    b[k] = he;\n  }\n  for (k = 0; k < n - 1; k++)\n    printf(\"%d\\n\", b[k]);\n  cout << b[k];\n  return 0;\n}\n"}
{"label": "6", "index": "10894", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], m, n, i, j, k;\n  cin >> k;\n  for (int t = 1; t <= k; t++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n    }\n    if (k == 1)\n      sum = sum - 3 * a[0][0];\n    else\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum, i, n, x, y, u, v;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &x, &y);\n    for (u = 0; u < x; u++)\n      for (v = 0; v < y; v++)\n        scanf(\"%d\", &a[u][v]);\n    if (x <= 2 || y <= 2) {\n      for (u = 0; u < x; u++)\n        for (v = 0; v < y; v++)\n          sum += a[u][v];\n    } else {\n      for (u = 0; u < y; u++) {\n        sum += a[0][u];\n        sum += a[x - 1][u];\n      }\n      for (u = 1; u < x - 1; u++) {\n        sum += a[u][0];\n        sum += a[u][y - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100][2], c[100][100][100], i, j, p, s[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i][0] >> a[i][1];\n    for (j = 0; j < a[i][0]; j++)\n      for (p = 0; p < a[i][1]; p++)\n        scanf(\"%d\", &c[i][j][p]);\n  }\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][0][j];\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][0];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][a[i][1] - 1];\n    printf(\"%d\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, count;\n  cin >> k;\n  for (count = 0; count < k; count++) {\n    int i, j, n, m, a[100][100], sum = 0;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> a[i][j];\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum = sum + a[0][j] + a[n - 1][j];\n    }\n    for (i = 0; i < n; i++) {\n      sum = sum + a[i][0] + a[i][m - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10898", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, l, sum[100] = {0};\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[m][j];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][1];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][n];\n\n    sum[l] = sum[l] - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum[l]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10899", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, tri[100][100], h, l, *point = tri[0];\n  cin >> t;\n  for (int i = 1; i <= t; i++) {\n    cin >> h >> l;\n    int temp = 0;\n    for (int p = 1; p <= h; p++) {\n      for (int q = 1; q <= l; q++) {\n        cin >> *(point + 100 * p + q);\n        if (p == 1 || q == 1 || p == h || q == l)\n          temp += *(point + 100 * p + q);\n      }\n    }\n    printf(\"%d\\n\", temp);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      int k;\n      cin >> k;\n      printf(\"%d\", k);\n    } else {\n      for (int i = 0; i < m; i++)\n        for (int j = 0; j < n; j++)\n          cin >> a[i][j];\n      int sum = 0;\n      for (int j = 0; j < n; j++)\n        sum += *(*(a) + j) + *(*(a + m - 1) + j);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10901", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    int data[100][100];\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &data[i][j]);\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + data[i][0] + data[i][n - 1];\n    for (i = 1; i < n - 1; i++)\n      sum = sum + data[0][i] + data[m - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, r, c, n;\n  int s[100][100];\n  int sum[100];\n  int sumr, sumc;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    sumr = 0;\n    sumc = 0;\n    cin >> r >> c;\n    for (j = 0; j < r; j++)\n      for (k = 0; k < c; k++)\n        scanf(\"%d\", &s[j][k]);\n    if (r != 1 && c != 1) {\n      for (k = 0; k < c; k++)\n        sumr += s[0][k] + s[r - 1][k];\n      for (j = 0; j < r; j++)\n        sumc += s[j][0] + s[j][c - 1];\n      sum[i] =\n          sumr + sumc - s[0][0] - s[0][c - 1] - s[r - 1][0] - s[r - 1][c - 1];\n    }\n    if (r == 1 && c != 1)\n      for (k = 0; k < c; k++)\n        sum[i] += s[0][k];\n    if (c == 1 && r != 1)\n      for (j = 0; j < r; j++)\n        sum[i] += s[j][0];\n    if (c == 1 && r == 1)\n      sum[i] = s[0][0];\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "10903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num += a[i][j];\n      }\n\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << \"\\n\";\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum += a[i][j];\n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1)\n          sum += a[i][j];\n\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, m, p, q, sz[100][100], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> sz[p][q];\n      }\n    }\n    if (m == 1 || n == 1) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum += sz[p][q];\n        }\n      }\n    } else {\n      for (q = 0; q <= n - 1; q++) {\n        sum += sz[0][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][n - 1];\n      }\n      for (q = 0; q < n; q++) {\n        sum += sz[m - 1][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][0];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x;\n  cin >> x;\n  int sum = 0;\n  int m, n;\n\n  int g, i, j, temp;\n  for (g = 0; g < x; g++) {\n    cin >> m;\n    cin >> n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      cin >> temp;\n      sum += temp;\n    }\n\n    for (i = 0; i < m - 2; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> temp;\n        if (j == 0 || j == n - 1) {\n          sum += temp;\n        }\n      }\n    }\n    if (m != 1) {\n      for (i = 0; i < n; i++) {\n        cin >> temp;\n        sum += temp;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid clear(int z[][100], int x, int y);\nint main() {\n  int k, i, s, j, m, n, a[100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    clear(a, m, n);\n    for (j = 0; j < m; j++) {\n      for (s = 0; s < n; s++)\n        cin >> a[j][s];\n    }\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + 0) + j);\n    for (j = 0; j < n; j++)\n      sum = sum + *(*(a + m - 1) + j);\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j));\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j) + n - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nvoid clear(int z[][100], int x, int y) {\n  int i, j;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++)\n      z[i][j] = 0;\n  }\n}\n"}
{"label": "6", "index": "10907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, m, n, i, j, sum;\n  int a[101][101];\n  cin >> t;\n  for (; t > 0; t--) {\n    cin >> m >> n;\n    sum = 0; \n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j); \n    for (i = 0; i < m; i++)\n      sum += *(*(a + i)); \n    for (i = 0; i < m; i++)\n      sum += *(*(a + i) + n - 1); \n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a) + j); \n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a + m - 1) + j); \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, n, i, col, row, sum[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", &sz[row][col]);\n    }\n    for (col = 0; col < n - 1; col++)\n      sum[i] += sz[0][col];\n    for (row = 0; row < m - 1; row++)\n      sum[i] += sz[row][n - 1];\n    for (col = n - 1; col > 0; col--)\n      sum[i] += sz[m - 1][col];\n    for (row = m - 1; row > 0; row--)\n      sum[i] += sz[row][0];\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  scanf(\"%d \", &k);\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      cin >> a[1][1];\n      cout << a[1][1] << endl;\n    } else {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++) {\n          cin >> a[i][j];\n        }\n      for (j = 1; j <= n; j++) {\n        sum += a[1][j] + a[m][j];\n      }\n      for (i = 1; i <= m; i++) {\n        sum += a[i][1] + a[i][n];\n      }\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n    }\n    int a[101][101] = {0};\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, count;\n  cin >> k;\n  for (count = 0; count < k; count++) {\n    int i, j, n, m, a[100][100], sum = 0;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum = sum + a[0][j] + a[n - 1][j];\n    }\n    for (i = 0; i < n; i++) {\n      sum = sum + a[i][0] + a[i][m - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      cin >> a[1][1];\n      cout << a[1][1] << endl;\n    } else {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++) {\n          cin >> a[i][j];\n        }\n      for (j = 1; j <= n; j++) {\n        sum += a[1][j] + a[m][j];\n      }\n      for (i = 1; i <= m; i++) {\n        sum += a[i][1] + a[i][n];\n      }\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n    }\n    int a[101][101] = {0};\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int K, M, N, sz[99][99];\n  scanf(\"%d\", &K);\n  for (int k = 1; k <= K; k++) {\n    int result = 0;\n    scanf(\"%d %d\", &M, &N);\n    for (int m = 0; m < M; m++)\n      for (int n = 0; n < N; n++)\n        scanf(\"%d\", &sz[m][n]);\n    if (M <= 2 || N <= 2) {\n      for (int m = 0; m < M; m++)\n        for (int n = 0; n < N; n++)\n          result += sz[m][n];\n    } else {\n      for (int n = 0; n < N; n++)\n        result += sz[0][n];\n      for (int n = 0; n < N; n++)\n        result += sz[M - 1][n];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][0];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][N - 1];\n    }\n    cout << result << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  int a[100000];\n  for (int i = 0; i < b; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n    for (int k = 0; k < m; k++) {\n      for (int p = 0; p < n; p++) {\n        scanf(\"%d\", &(sz[k][p]));\n      }\n    }\n    if (m * n != 1) {\n      for (int o = 0; o < n; o++) {\n        a[i] = a[i] + sz[0][o] + sz[m - 1][o];\n      }\n      for (int q = 0; q < m; q++) {\n        a[i] = a[i] + sz[q][0] + sz[q][n - 1];\n      }\n      a[i] = a[i] - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n      cout << a[i] << \"\\n\";\n    } else\n      cout << sz[0][0];\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, sum, temp, c, d, e, q, w, r, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  int m[100], n[100];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    sum = 0;\n    temp = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n    for (j = 0; j < n[i]; j++) {\n      temp = temp + a[0][j];\n    }\n    for (j = 0; j < n[i]; j++) {\n      c = c + a[m[i] - 1][j];\n    }\n    for (j = 0; j < m[i]; j++) {\n      d = d + a[j][0];\n    }\n    for (j = 0; j < m[i]; j++) {\n      e = e + a[j][n[i] - 1];\n    }\n    if (m[i] == 1 && n[i] == 1) {\n      sum = a[0][0];\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] == 1 && n[i] != 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[0][j];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] == 1) {\n      for (j = 0; j < n[i]; j++) {\n        sum = sum + a[j][0];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m[i] != 1 && n[i] != 1) {\n      q = a[0][0];\n      w = a[0][n[i] - 1];\n      r = a[m[i] - 1][0];\n      t = a[m[i] - 1][n[i] - 1];\n      sum = c + d + e + temp - q - w - r - t;\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, sum;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d %d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (j = 0; j < n; j++)\n      sum = sum + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint v[100][100];\n\nint sum(int m, int n) {\n\n  int su = 0;\n  if (n >= 2 && m >= 2) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n      su += v[m - 1][i];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      su += v[i][0];\n      su += v[i][n - 1];\n    }\n  } else if (n >= 2 && m == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n    }\n  } else if (m >= 2 && n == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[i][0];\n    }\n  } else {\n    su = v[0][0];\n  }\n  return su;\n}\n\nint main() {\n  int times;\n  cin >> times;\n\n  for (int k = 0; k < times; k++) {\n    int a, b;\n    cin >> a >> b;\n\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> v[i][j];\n\n    printf(\"%d\\n\", sum(a, b));\n  }\n}\n"}
{"label": "6", "index": "10917", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum = 0;\n  cin >> k;\n  int a[100][100];\n  for (int i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m != 1 && n != 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i) + *(*(a + m - 1) + i);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      cout << sum << endl;\n    } else\n      cout << **a << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, number;\n  cin >> number;\n  for (i = 0; i < number; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[100][100];\n    int *p = NULL, *q = NULL, i;\n    for (p = *a; p < *a + n * m; p++) {\n      cin >> *p;\n    }\n    int sum = 0;\n    for (p = *a; p < *a + n; p++)\n\n      sum = sum + *p;\n\n    if (m != 1) {\n      for (p = *a + (m - 1) * n; p < *a + m * n; p++) {\n        sum = sum + *p;\n      }\n    }\n    for (p = *a + n; p < *a + (m - 1) * n; p = p + n) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, n, m, sum = 0, i, j, k, a[101][101];\n  cin >> l;\n  for (i = 1; i <= l; i++) {\n    scanf(\"%d %d \", &m, &n);\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    if (m != 1 && n != 1) {\n      for (k = 1; k <= n; k++)\n        sum += a[1][k];\n      for (k = 1; k <= n; k++)\n        sum += a[m][k];\n      for (k = 2; k < m; k++)\n        sum += a[k][1];\n      for (k = 2; k < m; k++)\n        sum += a[k][n];\n      printf(\"%d\\n\", sum);\n    } else {\n      for (j = 1; j <= m; j++)\n        for (k = 1; k <= n; k++)\n          sum += a[j][k];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *a, *b, *c, *d;\n  int i, j, n, m, k;\n  a = (int *)calloc(1000000, sizeof(int));\n  b = (int *)calloc(10, sizeof(int));\n  scanf(\"%d\", &k);\n  c = a;\n  d = b;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> n >> m;\n    for (j = 0; j < n * m; j++)\n      scanf(\"%d\", c + j);\n    for (j = 0; j < m; j++)\n      sum += *(c + j);\n    for (j = m * (n - 1); j < n * m; j++)\n      sum += *(c + j);\n    for (j = m; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    for (j = m + m - 1; j < (n - 1) * m;) {\n      sum += *(c + j);\n      j += m;\n    }\n    *(d++) = sum;\n  }\n  for (d = b; d < b + k; d++) {\n    printf(\"%d\", *d);\n    cout << \"\\n\";\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "6", "index": "10921", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num, n, m, a[100][100];\nint main() {\n  cin >> num;\n  for (int x = 0; x < num; x++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int i = 0; i < m; i++)\n      ans += a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      ans += a[0][i] + a[m - 1][i];\n    cout << ans << endl;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "10923", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m[1000], n[1000], i, a, b, x, sum;\n  cin >> k;\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n    for (a = 0; a < m[i]; a++) {\n      for (b = 0; b < n[i]; b++) {\n        cin >> x;\n        if (a == 0 || b == 0 || a == m[i] - 1 || b == n[i] - 1) {\n          sum += x;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10924", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint summer();\n\nint main(void) {\n  int counter, times, patty;\n  scanf(\"%d\", &times);\n\n  for (counter = 0; counter < times; counter++) {\n    patty = summer();\n    printf(\"%d \", patty);\n  }\n\n  return 0;\n}\n\nint summer() {\n  int m, n;\n  int line, row;\n\n  scanf(\"%d%d\", &line, &row);\n  int fib[1000][1000];\n\n  for (m = 0; m < line; m++) {\n    for (n = 0; n < row; n++) {\n      scanf(\"%d\", &fib[m][n]);\n    }\n  }\n  int sum = 0;\n  int i;\n  for (i = 0; i < row; i++) {\n    sum = sum + *((*fib) + i) + *(*(fib + line - 1) + i);\n  }\n\n  for (i = 1; i < line - 1; i++) {\n    sum = sum + *(*(fib + i)) + *(*(fib + i) + row - 1);\n  }\n\n  return sum;\n}\n"}
{"label": "6", "index": "10925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, sum[100] = {0}, *p;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    int m, n;\n    scanf(\"%d%d\", &m, &n);\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", p + i * n + j);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum[t] += *(p + i * n + j);\n      }\n    }\n  }\n  for (t = 0; t < k; t++)\n    printf(\"%d\\n\", sum[t]);\n}\n"}
{"label": "6", "index": "10926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, q, j, s1 = 0, s2 = 0, s, a[100][100];\n  cin >> k;\n  for (q = 0; q < k; q++) {\n    cin >> m >> n;\n    s1 = 0;\n    s2 = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        s1 = s1 + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        s2 = s2 + a[i][j];\n\n    s = s1 - s2;\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100];\n  for (int r = 0; r < k; r++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    int s = 0;\n    for (int t = 0; t < n; t++) {\n      s += a[0][t] + a[m - 1][t];\n    }\n    for (int u = 1; u < m - 1; u++) {\n      s += a[u][0] + a[u][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100], m, n, k, i, j, q, s;\n  scanf(\"%d\", &k);\n  int *sum = (int *)malloc(sizeof(int) * k);\n  s = 0;\n\n  for (q = 0; q < k; q++) {\n    sum[q] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      sum[q] += sz[0][i];\n\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][0];\n    }\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[m - 1][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][n - 1];\n    }\n    sum[q] -= sz[0][0];\n    sum[q] -= sz[0][n - 1];\n    sum[q] -= sz[m - 1][0];\n    sum[q] -= sz[m - 1][n - 1];\n\n    printf(\"%d\\n\", sum[q]);\n  }\n\n  free(sum);\n  return 0;\n}\n"}
{"label": "6", "index": "10929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  int a = 0, b = 0, c = 0, d = 0, e = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n    for (i = 0; i < m; i++) {\n      a += sz[i][0];\n      b += sz[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      c += sz[0][j];\n      d += sz[m - 1][j];\n    }\n    e = a + b + c + d - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n        sz[m - 1][n - 1];\n    printf(\"%d\\n\", e);\n    e = 0;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], sz[100][100], i, j, k;\n  int m[100] = {0}, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> y[i];\n    for (j = 0; j < x[i]; j++) {\n      for (k = 0; k < y[i]; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == x[i] - 1 || j == 0 || k == y[i] - 1 || k == 0) {\n          m[p] += sz[j][k];\n        }\n      }\n    }\n    p++;\n  }\n  for (i = 0; i < p; i++) {\n    cout << m[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, a, n, m, sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &sz[j][l]);\n      }\n    }\n    a = 0;\n    for (l = 0; l < n; l++) {\n      a += sz[0][l];\n    }\n    if (m > 1) {\n      for (l = 0; l < n; l++) {\n        a += sz[m - 1][l];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      a += sz[j][0];\n    }\n    if (n > 1) {\n      for (j = 1; j < m - 1; j++) {\n        a += sz[j][n - 1];\n      }\n    }\n    result[i] = a;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum;\n  int b, n, m, i, j, l;\n  scanf(\"%d\", &b);\n  for (l = 0; l < b; l++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    if (m == 1 && n != 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      cout << sum << \"\\n\";\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[0][1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m == 1 && n == 1) {\n      cout << a[0][0] << \"\\n\";\n    }\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 1; j < n - 1; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      sum = sum + a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], (*p)[100];\n  p = a;\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num = num + *(*(p + i) + j);\n      }\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << endl;\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++)\n          sum = sum + *(*(p + i) + j);\n\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum = sum + *(*(p + i) + j);\n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10934", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int(*juzhen)[101] = NULL;\n  int i, j, m, num, hang, lie, input[101][101];\n  scanf(\"%d \", &num);\n  for (m = 0; m < num; m++) {\n    cin >> hang >> lie;\n    int sum = 0;\n    for (i = 0; i < hang; i++)\n      for (j = 0; j < lie; j++)\n        scanf(\"%d \", &input[i][j]);\n    juzhen = input;\n    for (i = 0; i < hang; i++) {\n      for (j = 0; j < lie; j++) {\n        if ((i == 0) || (i == hang - 1) || (j == 0) || (j == lie - 1))\n          sum = sum + *(*(juzhen + i) + j);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10935", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  int i;\n  for (i = 0; i < num; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[m][n];\n    for (int j = 0; j < m; j++)\n      for (int h = 0; h < n; h++)\n        scanf(\"%d\", &a[j][h]);\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      sum += a[0][j];\n    for (int j = 1; j < m; j++)\n      sum += a[j][0];\n    for (int j = 1; j < n; j++)\n      sum += a[m - 1][j];\n    for (int j = 1; j < m - 1; j++)\n      sum += a[j][n - 1];\n    printf(\"%d \", sum);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "10936", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[10001];\n  int *p;\n  int i, j, k;\n  int b, c;\n  int s = 0;\n  p = &a[0];\n  scanf(\"%d\", &m);\n  for (j = 1; j <= m; j++) {\n    scanf(\"%d %d\", &b, &c);\n\n    for (k = 1; k <= b; k++) {\n      for (i = 1; i <= c; i++) {\n        scanf(\"%d\", p);\n        if ((k == 1 && i != 1 && i != c) || (k == b && i != 1 && i != c) ||\n            i == 1 || i == c) {\n          s = s + *p;\n        }\n\n        p++;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    p = &a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, b[101][101], sum[1000];\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> b[i][j];\n    }\n\n    sum[l] = 0;\n    for (j = 1; j <= n; j++)\n      sum[l] += b[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += b[m][j];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][1];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][n];\n  }\n  if (k == 1)\n    cout << sum[1];\n  else {\n    cout << sum[1];\n    for (l = 2; l <= k; l++) {\n      cout << endl;\n      cout << sum[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10938", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  fflush(stdin);\n\n  int i, j, k, m;\n  int lie, h;\n  int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n\n  for (i = 0; i < n; i++) {\n    sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n    scanf(\"%d%d\", &h, &lie);\n    int matrix[h][lie];\n\n    for (j = 0; j < h; j++)\n      for (k = 0; k < lie; k++) {\n        cin >> matrix[j][k];\n      }\n    fflush(stdin);\n\n    if (h == 1 && lie == 1) {\n      printf(\"%d\\n\", matrix[0][0]);\n      return 0;\n    }\n\n    for (m = 0; m < lie; m++) {\n      sum1 += matrix[0][m];\n      sum2 += matrix[h - 1][m];\n    }\n\n    for (m = 0; m < h; m++) {\n      sum1 += matrix[m][0];\n      sum2 += matrix[m][lie - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4 -\n          (matrix[0][0] + matrix[0][lie - 1] + matrix[h - 1][0] +\n           matrix[h - 1][lie - 1]);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, m, n, i, j, k, sum = 0;\n  int a[100][100];\n  scanf(\"%d\", &s);\n  for (k = 0; k < s; k++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sum += a[0][i];\n    }\n    if (m > 2) {\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    if (m > 1) {\n      for (i = 0; i < n; i++) {\n        sum += a[m - 1][i];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10940", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, *p;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    int sum = 0;\n    int a[100][100] = {0};\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    p = a[0];\n    for (int j = 0; j < n; j++)\n      sum += *p++;\n    if (m - 1 != 0) {\n      p = a[m - 1];\n      for (int j = 0; j < n; j++)\n        sum += *p++;\n    }\n    for (int j = 1; j < m - 1; j++) {\n      p = a[j];\n\n      sum += *p;\n      sum += *(p + n - 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, p;\n  int matrix(int m, int n);\n  scanf(\"%d\", &p);\n  for (k = 0; k < p; k++) {\n    scanf(\"%d%d\", &m, &n);\n    printf(\"%d\\n\", matrix(m, n));\n  }\n  return 0;\n}\n\nint matrix(int m, int n) {\n  int i, j, a, sum = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n        sum += a;\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "10942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k, m, n, a[100][100], i, j, sum = 0;\nint main() {\n  cin >> k;\n  while (k > 0) {\n    k--;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    if (m == 1 || m == 2 || n == 1 || n == 2) {\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= n; j++)\n          sum += a[i][j];\n    } else {\n      for (j = 1; j <= n; j++)\n        sum += a[1][j];\n      for (j = 1; j <= n; j++)\n        sum += a[m][j];\n      for (i = 2; i < m; i++)\n        sum += a[i][1];\n      for (i = 2; i < m; i++)\n        sum += a[i][n];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "10943", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, s = 0;\n  int m, n;\n  scanf(\"%d \", &k);\n  int a[100][100];\n  int *p = &a[0][0];\n  for (int t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      s += *(*(a + 0) + i);\n      s += *(*(a + m - 1) + i);\n    }\n    for (int i = 0; i < m; i++) {\n      s += *(*(a + i) + 0);\n      s += *(*(a + i) + n - 1);\n    }\n    s = s - **a - *(*(a + m - 1) + n - 1) - *(*(a + 0) + n - 1) -\n        *(*(a + m - 1));\n    cout << s << endl;\n  }\n}\n"}
{"label": "6", "index": "10944", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int k, m, n, a[100][100], i, j, s, t, p, q;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    s = 0;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++)\n        if (p == 0 || q == 0 || p == m - 1 || q == n - 1)\n          s = s + a[p][q];\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10945", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n\n    int array[100][100];\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    if (m == 1 && n == 1)\n      sum = array[0][0];\n    else {\n      for (int k = 0; k != n - 1; k++) {\n        sum += array[0][k];\n      }\n      for (int k = 0; k != m - 1; k++) {\n        sum += array[k][n - 1];\n      }\n      for (int k = n - 1; k != 0; k--)\n        sum += array[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += array[k][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N = 0, n = 0, m = 0, i = 0, j = 0, k = 0;\n  scanf(\"%d \", &N);\n  for (i = 0; i < N; i++) {\n    int sum = 0;\n    int a[102][102];\n    int *p = *a;\n    cin >> n >> m;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (k = 0; k < m; k++, p++)\n      sum = sum + *p;\n    for (p = p + 101, j = 1; j < n; j++)\n      sum = sum + *p, p = p + 102;\n    for (p = p - 103, k = m - 2; k >= 0; k--, p--)\n      sum = sum + *p;\n    for (p = p - 101, j = n - 2; j > 0; j--, p = p - 102)\n      sum = sum + *p;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10947", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[100][100] = {0};\n  int x, y, i, j, k, n, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> x >> y;\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        cin >> *(*(a + i) + j);\n      }\n\n    for (i = 0; i < x; i++)\n      for (j = 0; j < y; j++) {\n        if (i == 0 || j == 0 || i == (x - 1) || j == (y - 1))\n          sum += *(*(a + i) + j);\n      }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p, i, j, k, m, n;\n  int sum = 0;\n  scanf(\"%d\", &p);\n  int sz[100][100];\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == 0 || j == (m - 1))\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == 0)\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == (n - 1))\n          sum += sz[j][k];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100][100];\n  int k, i, g, t, r;\n  int s[100];\n  int z[100];\n  cin >> k;\n  for (g = 0; g <= k - 1; g++) {\n    cin >> s[g] >> z[g];\n    for (i = 0; i <= s[g] - 1; i++) {\n      for (t = 0; t <= z[g] - 1; t++) {\n        scanf(\"%d\", &sz[g][i][t]);\n      }\n    }\n  }\n\n  for (g = 0; g <= k - 1; g++) {\n    if (s[g] >= 3 && z[g] >= 3) {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        r = r + sz[g][i][0] + sz[g][i][z[g] - 1];\n      }\n      for (t = 1; t <= z[g] - 2; t++) {\n        r = r + sz[g][0][t] + sz[g][s[g] - 1][t];\n      }\n      printf(\"%d\\n\", r);\n    } else {\n      for (r = 0, i = 0; i <= s[g] - 1; i++) {\n        for (t = 0; t <= z[g] - 1; t++) {\n          r = r + sz[g][i][t];\n        }\n      }\n      printf(\"%d\\n\", r);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int nn, ii;\n  scanf(\"%d\", &nn);\n  for (ii = 1; ii <= nn; ii++) {\n    int n, m, t, i, j, x, y, sum = 0;\n    scanf(\"%d %d\", &y, &x);\n    for (i = 1; i <= y; i++) {\n      for (j = 1; j <= x; j++) {\n        cin >> t;\n        if (i == 1 || i == y || j == x || j == 1)\n          sum += t;\n      }\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "10951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int i = 0, j = 0, k = 0;\n  int row, col;\n  int str[100][100] = {0};\n  int sum;\n  scanf(\"%d\", &n);\n  for (; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &col);\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        scanf(\"%d\", &str[j][k]);\n    for (j = 0; j < col; j++)\n      sum += str[0][j] + str[row - 1][j];\n    for (j = 1; j < row - 1; j++)\n      sum += str[j][0] + str[j][col - 1];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "10952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, p, q, m, n, k, a[200][200], sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    }\n    int *pointer;\n    pointer = *a;\n    for (p = 0; p < n; p++) {\n      sum = sum + *(pointer + p);\n    }\n    for (p = 1; p < m - 1; p++) {\n      sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    for (p = 0; p < n; p++) {\n      sum = sum + *(*(a + m - 1) + p);\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10953", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[105][105] = {0}, n = 0, row = 0, col = 0, i = 0, j = 0, *p = NULL,\n      sum = 0;\n  cin >> n;\n  while (n--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (p = &a[0][0]; p < &a[0][0] + col; p++) {\n      sum = sum + *p;\n    }\n    for (i = 1; i < row - 1; i++) {\n      sum = sum + a[i][0] + a[i][col - 1];\n    }\n    if (row > 1) {\n      for (p = &a[row - 1][0]; p < &a[row - 1][0] + col; p++) {\n        sum = sum + *p;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10954", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][2], c[100][100][100], i, j, p, s[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++)\n      for (p = 0; p < a[i][1]; p++)\n        scanf(\"%d\", &c[i][j][p]);\n  }\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][0][j];\n    for (j = 0; j < a[i][1]; j++)\n      s[i] += c[i][a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][0];\n    for (j = 1; j < a[i][0] - 1; j++)\n      s[i] += c[i][j][a[i][1] - 1];\n    printf(\"%d\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10955", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, k, r, p, t;\n  int m, n, s;\n\n  scanf(\"%d \", &t);\n  for (p = 1; p <= t; p++) {\n    s = 0;\n    cin >> m >> n;\n\n    for (j = 1; j <= m; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\", a[1][1]);\n      continue;\n    }\n    for (i = 1; i <= n; i++) {\n      s = s + a[1][i] + a[m][i];\n    }\n    for (r = 1; r <= m; r++) {\n      s = s + a[r][1] + a[r][n];\n    }\n    s = s - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, p, a[100][100], s[100] = {0}, m, n;\n  scanf(\"%d\", &k);\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[1][j]);\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[m][j]);\n    }\n    for (i = 2; i <= m - 1; i++) {\n      s[p] = s[p] + a[i][1] + a[i][n];\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (p = 2; p <= k; p++) {\n    cout << \"\\n\" << s[p];\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, *p;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int j, sum = 0;\n    p = (int *)malloc(sizeof(int) * m * n);\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", p + j);\n      if (j < n || (j < n * m && j >= (m - 1) * n) || j % n == 0 ||\n          (j + 1) % n == 0)\n        sum += *(p + j);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bianyuan(int n, int m) {\n  int juzhen[100][100];\n  int i, j, result;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &juzhen[i][j]);\n    }\n  }\n  result = 0;\n  for (j = 0; j < m; j++) {\n    result += juzhen[0][j];\n  }\n  for (j = 0; j < m; j++) {\n    result += juzhen[n - 1][j];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    result += juzhen[i][m - 1];\n  }\n  return result;\n}\nint main() {\n  int n, i;\n  int a, lie, hang;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &lie, &hang);\n    a = bianyuan(lie, hang);\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, i, j, l, m, n, x = 0, y = 0;\n  scanf(\"%d \", &k);\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        x = x + a[i][j];\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++) {\n        y = y + a[i][j];\n      }\n    }\n    cout << x - y << endl;\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10960", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, h, i, j;\n  scanf(\"%d\", &a);\n  int sum[100][3];\n  int n, k;\n  for (h = 1; h <= a; h++) {\n    scanf(\"%d%d\", &n, &k);\n    int sz[100][100];\n    sum[h][1] = 0;\n    sum[h][2] = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= k; j++) {\n        cin >> sz[i][j];\n        sum[h][1] = sum[h][1] + sz[i][j];\n      }\n    }\n    if (n > 1 && k > 1) {\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < k; j++) {\n          sum[h][2] = sum[h][2] + sz[i][j];\n        }\n      }\n    }\n    sum[h][3] = sum[h][1] - sum[h][2];\n  }\n  for (i = 1; i <= a; i++) {\n    printf(\"%d\\n\", sum[i][3]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, col[1000], row[1000], a[100][1000][1000], c, r, sum[1000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    cin >> col[i];\n    scanf(\"%d \", &row[i]);\n\n    for (c = 0; c < col[i]; c++) {\n      for (r = 0; r < row[i]; r++) {\n        cin >> a[i][c][r];\n      }\n    }\n\n    for (c = 0; c < row[i]; c++)\n      sum[i] = sum[i] + a[i][0][c] + a[i][col[i] - 1][c];\n    for (c = 1; c < col[i] - 1; c++)\n      sum[i] = sum[i] + a[i][c][0] + a[i][c][row[i] - 1];\n\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i;\n  int sz[100][100];\n  int row, col;\n  int add[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    add[i] = 0;\n  }\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n\n    for (col = 0; col < n; col++) {\n      add[i] += sz[0][col];\n      add[i] += sz[m - 1][col];\n    }\n\n    for (row = 0; row < m; row++) {\n      add[i] += sz[row][0];\n      add[i] += sz[row][n - 1];\n    }\n\n    add[i] -= sz[0][0];\n    add[i] -= sz[m - 1][0];\n    add[i] -= sz[0][n - 1];\n    add[i] -= sz[m - 1][n - 1];\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", add[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10963", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum(int m, int n) {\n  int i, j, sz[100][100], num = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  for (i = 0, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = m - 1, j = 0; j < n; j++)\n    num += sz[i][j];\n  for (i = 1, j = 0; i < m - 1; i++)\n    num += sz[i][j];\n  for (i = 1, j = n - 1; i < m - 1; i++)\n    num += sz[i][j];\n  return num;\n}\n\nint main() {\n  int k, i, num, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    num = sum(m, n);\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "6", "index": "10964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, num[150][150], sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (j = 0; j < m; j++) {\n      for (a = 0; a < n; a++) {\n        scanf(\"%d\", &num[j][a]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum += num[0][j];\n      if (m != 1) {\n        sum += num[m - 1][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += (num[j][0]);\n      if (n != 1) {\n        sum += num[j][n - 1];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], k, i, j, t, m, n, sum;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 2; i < n; i++)\n      sum += a[1][i] + a[m][i];\n    for (j = 2; j < m; j++)\n      sum += a[j][1] + a[j][n];\n    sum +=\n        a[1][1] + (n != 1) * a[1][n] + (m != 1) * a[m][1] + (m != 1) * a[m][n];\n    if (t < k)\n      cout << sum << \"\\n\";\n    else\n      cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10966", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int w, k;\n  scanf(\"%d\", &w);\n  for (k = 0; k < w; k++) {\n\n    int n, m, sz[100][100], i, j;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    int a = 0, b = 0, c = 0, d;\n    for (j = 0; j < m; j++) {\n      a += sz[0][j];\n    }\n\n    for (j = 0; j < m; j++) {\n      b += sz[n - 1][j];\n    }\n\n    for (i = 1; i < n - 1; i++) {\n      c += sz[i][0] + sz[i][m - 1];\n    }\n    d = a + b + c;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a, b, i;\n  int h, s, t, p;\n  int sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n, &m);\n    for (a = 0; a < n; a++) {\n      for (b = 0; b < m; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    h = 0, s = 0, t = 0, p = 0;\n    for (b = 0; b < m; b++) {\n      h = h + sz[0][b];\n      if (n > 1) {\n        s = s + sz[n - 1][b];\n      }\n    }\n    for (a = 1; a < n - 1; a++) {\n      t = t + sz[a][0];\n      if (m > 1) {\n        p = p + sz[a][m - 1];\n      }\n    }\n    result[i] = h + s + t + p;\n  }\n  for (i = 0; i < k; i++) {\n    cout << result[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10968", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int c1, c2, d, i, x = 0, k, m, n;\n  int sum[1000];\n  int a[1000][1000], b[1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < 1000; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (c1 = 0; c1 < m; c1++) {\n      for (c2 = 0; c2 < n; c2++) {\n        cin >> a[c1][c2];\n      }\n    }\n    for (d = 0; d < m; d++) {\n      sum[x] += a[d][0] + a[d][n - 1];\n    }\n    for (d = 1; d < n - 1; d++) {\n      sum[x] += a[0][d] + a[m - 1][d];\n    }\n    x++;\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int *p, int m, int n) {\n  int row, col, temp, sum = 0;\n  for (row = 1; row < m + 1; row++) {\n    for (col = 1; col < n + 1; col++) {\n      if (row == 1 || row == m || col == 1 || col == n) {\n        temp = *(p + n * (row - 1) + col);\n        sum += temp;\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int k, m, n, i, s, row, col;\n  int *p;\n  p = (int *)malloc(sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (row = 1; row < m + 1; row++) {\n      for (col = 1; col < n + 1; col++) {\n        scanf(\"%d\", p + n * (row - 1) + col);\n      }\n    }\n    s = f(p, m, n);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int x, k, m, n, i, j, sum;\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < n - 1; j++) {\n      sum += sz[0][j];\n    }\n    for (i = 0; i < m - 1; i++)\n      sum += sz[i][j];\n\n    for (; j > 0; j--) {\n      sum += sz[i][j];\n    }\n    for (; i > 0; i--)\n      sum += sz[i][j];\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sq(int *p, int m, int n) {\n  int i, s;\n  s = 0;\n  for (i = 0; i < n; i++)\n    s = s + *(p + i);\n  for (i = 1; i < m; i++)\n    s = s + *(p + n * i) + *(p + n * i + n - 1);\n  for (i = 1; i < n - 1; i++) {\n    s = s + *(p + (m - 1) * n + i);\n  }\n  printf(\"%d\\n\", s);\n}\nint main() {\n  int *p, m, n, k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)malloc(m * n * sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", p + j);\n    sq(p, m, n);\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10972", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[100][100], i, j, l, sum = 0;\n  scanf(\"%d \", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum = sum + sz[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum = sum + sz[i][n - 1];\n    }\n    for (j = 0; j < n - 1; j++) {\n      sum = sum + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + sz[i][0];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], sz[100][100], i, j, k;\n  int m[100] = {0}, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &x[i], &y[i]);\n    for (j = 0; j < x[i]; j++) {\n      for (k = 0; k < y[i]; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == x[i] - 1 || j == 0 || k == y[i] - 1 || k == 0) {\n          m[p] += sz[j][k];\n        }\n      }\n    }\n    p++;\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10974", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int a, b;\n  int s[100][100];\n  int sum;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j <= a - 1; j++) {\n      for (k = 0; k <= b - 1; k++) {\n        scanf(\"%d \", &s[j][k]);\n      }\n    }\n    sum = 0;\n    for (k = 0; k <= b - 1; k++) {\n      sum = sum + s[0][k];\n    }\n    for (j = 1; j <= a - 1; j++) {\n      sum = sum + s[j][b - 1];\n    }\n    for (k = 0; k <= b - 2; k++) {\n      sum = sum + s[a - 1][k];\n    }\n    for (j = 1; j <= a - 2; j++) {\n      sum = sum + s[j][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, n = 0, m = 0, i = 0, w = 0, j = 0, sum = 0, s[101][101] = {0};\n  scanf(\"%d \", &k);\n  for (w = 1; w <= k; w++) {\n    sum = 0;\n    cin >> n >> m;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= m; j++) {\n        cin >> *(s[i] + j);\n        if ((i == 1) || (i == n) || (j == 1) || (j == m)) {\n          sum += *(s[i] + j);\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, matrix[100][100];\n  scanf(\"%d\", &k);\n  while (k > 0) {\n    k--;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(matrix + i) + j);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", **matrix);\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      printf(\"%d\\n\", sum);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += **(matrix + i);\n      printf(\"%d\\n\", sum);\n    } else {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      for (i = 0; i < n; i++)\n        sum += *(*(matrix + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        sum += (**(matrix + i) + *(*(matrix + i) + n - 1));\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, s = 0, p = 0, r = 0, q = 0, sum;\n  scanf(\"%d\", &k);\n  int a[1000][1000];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        scanf(\"%d\", &a[j][l]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s = s + a[1][j];\n      q = q + a[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      p = p + a[j][1];\n      r = r + a[j][n];\n    }\n    sum = s + p + r + q - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum);\n    s = 0;\n    q = 0;\n    p = 0;\n    r = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, m, n, a, b, s[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n      }\n    }\n    s[i] = 0;\n    for (b = 0; b < n; b++) {\n      s[i] += sz[0][b];\n    }\n\n    for (a = 1; a < m; a++) {\n      s[i] += sz[a][n - 1];\n    }\n    for (b = n - 2; b >= 0; b--) {\n      s[i] += sz[m - 1][b];\n    }\n    for (a = m - 2; a >= 1; a--) {\n      s[i] += sz[a][0];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << s[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, x = 0, y = 0, temp = 0, sum = 0, i, j, m;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d\", &x);\n    scanf(\"%d\", &y);\n    for (j = 0; j < x; j++) {\n      for (m = 0; m < y; m++) {\n        scanf(\"%d\", &temp);\n        if (j == 0 || m == 0 || j == x - 1 || m == y - 1)\n          sum = sum + temp;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int j, i, m, n, *pointer = NULL, a[100][100], sum = 0;\n  cin >> j;\n  for (i = 0; i < j; i++) {\n    sum = 0;\n    cin >> m >> n;\n    pointer = *a;\n    for (; pointer < *a + m * n; pointer++) {\n      cin >> *pointer;\n    }\n    for (pointer = *a; pointer < *a + m * n; pointer++) {\n      if (pointer >= *a && pointer <= *a + n - 1) {\n        sum += *pointer;\n        continue;\n      }\n      if ((pointer - *a) % n == 0) {\n        sum += *pointer;\n        sum += *(pointer + n - 1);\n        continue;\n      }\n      if (pointer >= *a + m * n - n && pointer < *a + m * n - 1) {\n        sum += *pointer;\n        continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10981", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n  int a[100][100];\n  for (int r = 0; r < k; r++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int s = 0;\n    for (int t = 0; t < n; t++) {\n      s += a[0][t] + a[m - 1][t];\n    }\n    for (int u = 1; u < m - 1; u++) {\n      s += a[u][0] + a[u][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10982", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int k, n, m, i, j, l;\n  int sum = 0;\n\n  scanf(\"%d \", &k);\n\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < m - 1; j++) {\n\n      sum += sz[0][j];\n    }\n    for (i = 0; i < n - 1; i++) {\n      sum += sz[i][m - 1];\n    }\n    for (j = 1; j < m; j++) {\n      sum += sz[n - 1][j];\n    }\n    for (i = 1; i < n; i++) {\n      sum += sz[i][0];\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sum[10000] = {0};\n  int a[100][100] = {0}, k;\n  int *p = sum, x, y;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (x != 1) {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j] + a[x - 1][j];\n      }\n      for (i = 1; i < x - 1; i++) {\n        *(p + k) += a[i][0] + a[i][y - 1];\n      }\n    } else {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j];\n      }\n    }\n  }\n  for (; p < (sum + n); p++) {\n    printf(\"%d\\n\", *p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint init() {\n  \n  int k, t, m, n, ans;\n  cin >> k;\n  while (k) {\n    k--;\n    ans = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> t;\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          ans += t;\n      }\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n\nint main() {\n  init();\n  return 0;\n}\n"}
{"label": "6", "index": "10985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, num[100][100], sum;\n  scanf(\"%d \", &k);\n  cout << endl;\n  for (int a = 0; a < k; a++) {\n    cin >> m >> n;\n    sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n        cout << \" \";\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          sum += num[i][j];\n        }\n      }\n      cout << \"\\n\";\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, t, s = 0;\n  scanf(\"%d\", &k);\n  int a[100][100], b[k - 1];\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        } else if (j == 0 || j == n - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    b[t] = s;\n    s = 0;\n  }\n  for (t = 0; t < k; t++) {\n    printf(\"%d\\n\", b[t]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m[100][100];\nvoid a() {\n  memset(m, 0, sizeof(m));\n  int x, y, count = 0, sum = 0;\n  scanf(\"%d %d \", &x, &y);\n  int *p = m[0];\n  for (; p <= m[x - 1] + y - 1; p++) {\n    count++;\n    scanf(\"%d \", p);\n    if (count == 1 || count == y)\n      sum += *p;\n    else if (p <= m[0] + y - 1)\n      sum += *p;\n    else if (m[x - 1] <= p && p <= m[x - 1] + y - 1) {\n      sum += *p;\n    }\n    if (count == y) {\n      p = p + 100 - y;\n      count = 0;\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    a();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++)\n    s += a[1][i];\n  for (i = 2; i <= m; i++)\n    s += a[i][n];\n  for (i = n - 1; i >= 1; i--)\n    s += a[m][i];\n  for (i = m - 1; i > 1; i--)\n    s += a[i][1];\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    printf(\"%d\\n\", juzhen(m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  fflush(stdin);\n\n  int i, j, k, m;\n  int lie, h;\n  int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n\n  for (i = 0; i < n; i++) {\n    sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum = 0;\n    scanf(\"%d%d\", &h, &lie);\n    int matrix[h][lie];\n\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < lie; k++)\n        scanf(\"%d\", &matrix[j][k]);\n    }\n    fflush(stdin);\n\n    if (h == 1 && lie == 1) {\n      cout << matrix[0][0] << \"\\n\";\n      return 0;\n    }\n\n    for (m = 0; m < lie; m++) {\n      sum1 += matrix[0][m];\n      sum2 += matrix[h - 1][m];\n    }\n\n    for (m = 0; m < h; m++) {\n      sum1 += matrix[m][0];\n      sum2 += matrix[m][lie - 1];\n    }\n\n    sum = sum1 + sum2 + sum3 + sum4 -\n          (matrix[0][0] + matrix[0][lie - 1] + matrix[h - 1][0] +\n           matrix[h - 1][lie - 1]);\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, x[10000], sum = 0, *p;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (p = x; p < x + m * n; p++)\n      scanf(\"%d\", p);\n    for (p = x; p < x + n; p++)\n      sum = sum + *p;\n    for (p = x + (m - 1) * n; m != 1 && p < x + n * m; p++)\n      sum = sum + *p;\n    for (p = x + n; p < x + n * (m - 1); p = p + n)\n      sum = sum + *p;\n    for (p = x + n + n - 1; p < x + n * m - 1; p = p + n)\n      sum = sum + *p;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], m, n, k, i, j, sum, *p;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    p = a;\n    if (m * n > 1) {\n      for (j = 0; j < m * n; j++) {\n        scanf(\"%d\", p);\n        p++;\n      }\n      for (p = a; p < a + n; p++) {\n        sum = sum + (*p);\n      }\n      for (p = a + n; p <= a + (m - 2) * n; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + 2 * n - 1; p <= a + (m - 1) * n - 1; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + (m - 1) * n; p <= a + m * n - 1; p++) {\n        sum = sum + (*p);\n      }\n      printf(\"%d\\n\", sum);\n    } else {\n      scanf(\"%d\", p);\n      printf(\"%d\", *p);\n    }\n  }\n}\n"}
{"label": "6", "index": "10992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d = 0, e = 0, i, k, m, n;\n  int a[101][101] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (b = 1; b <= m; b++) {\n      for (c = 1; c <= n; c++) {\n        cin >> a[b][c];\n        d = d + a[b][c];\n      }\n    }\n    for (b = 2; b <= m - 1; b++) {\n      for (c = 2; c <= n - 1; c++) {\n        e = e + a[b][c];\n      }\n    }\n    cout << d - e << endl;\n    d = 0;\n    e = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k, m, n;\n  int result[100];\n\n  int i, j, temp1 = 0, temp2 = 0, tempr = 0;\n  double temp3 = 0;\n\n  scanf(\"%d\", &k);\n\n  for (temp2 = 1; temp2 <= k; temp2++) {\n    scanf(\"%d%d\", &m, &n);\n    tempr = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &temp1);\n        if (i == 1 || i == m || j == 1 || j == n) {\n          tempr += temp1;\n        }\n      }\n    }\n    result[temp2] = tempr;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "10994", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], row, col, sum = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    cin >> row >> col;\n    for (int i = 0; i < row; i++)\n      for (int j = 0; j < col; j++)\n        cin >> a[i][j];\n    if (row == 1 && col == 1) {\n      cout << *(a[0]);\n    } else {\n      for (int i = 0; i < col; i++) {\n        sum += *(a[0] + i);\n        sum += *(a[row - 1] + i);\n      }\n      for (int j = 1; j < row - 1; j++) {\n        sum += *(a[j]);\n        sum += *(a[j] + col - 1);\n      }\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, j1, j, n, c, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &c, &k);\n    for (j = 0; j < c; j++) {\n      for (j1 = 0; j1 < k; j1++)\n        scanf(\"%d\", &a[j][j1]);\n    }\n    for (j = 1; j < k - 1; j++)\n      sum += *(*p + j) + *(*(p + c - 1) + j);\n    if (k > 1)\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j)) + *(*(p + j) + k - 1);\n    else\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j));\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10996", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int r, c, j, k, l, m, sum, n, p;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    sum = 0;\n    cin >> r;\n    cin >> c;\n    for (int i = 0; i < r; i++)\n      for (int j = 0; j < c; j++)\n        cin >> a[i][j];\n\n    for (j = 0; j < r; j++)\n      sum = sum + **(a + j);\n\n    for (k = 1; k < c; k++) {\n      sum = sum + *(*(a + r - 1) + k);\n    }\n    for (l = r - 2; l >= 0; l--)\n      sum = sum + *(*(a + l) + c - 1);\n\n    for (m = 1; m < c - 1; m++)\n      sum = sum + *(*(a + 0) + m);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, m, n, x, s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 1, s = 0, m--; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    for (j = 2; j <= m; j++)\n      for (l = 1; l <= n; l++) {\n        cin >> x;\n        if ((l == 1) || (l == n))\n          s += x;\n      }\n    for (j = 1; j <= n; j++) {\n      cin >> x;\n      s += x;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10998", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int u;\n  for (u = 1; u <= k; u++) {\n    int i, j;\n    cin >> m >> n;\n    int input[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> input[i][j];\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      sum += input[i][0] + input[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      sum += input[0][j] + input[m - 1][j];\n    }\n    sum = sum - input[0][0] - input[0][n - 1] - input[m - 1][0] -\n          input[m - 1][n - 1];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "10999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b, c;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        cin >> jz[a][b];\n      }\n    }\n    c = 0;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        if (a == 0 || b == 0) {\n          c = c + jz[a][b];\n        } else if (a == m - 1 || b == n - 1) {\n          c = c + jz[a][b];\n        }\n      }\n    }\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int time;\n  int m, n;\n  int i, j;\n  int x, y;\n  int res;\n  int r;\n  int arr[10000];\n  scanf(\"%d\", &time);\n  for (i = 0; i < time; i++) {\n    res = 0;\n    cin >> m >> n;\n\n    for (j = 0; j < m * n; j++) {\n      scanf(\"%d\", &r);\n\n      arr[j] = r;\n    }\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        if ((x == 0) || (x == (m - 1)))\n          res += arr[x * n + y];\n        if ((y == 0) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n        if ((y == (n - 1)) && (x != 0) && (x != (m - 1)))\n          res += arr[x * n + y];\n      }\n    printf(\"%d\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k, l, sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[j][l];\n        if (j == 1 || j == m || l == 1 || l == n) {\n          sum += a[j][l];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], sum, p, q;\n  int i, j, h;\n  cin >> k;\n  for (h = 1; h <= k; h++) {\n    cin >> m >> n;\n    p = 0;\n    q = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n        p = p + a[i][j];\n      }\n    }\n    for (i = 2; i < m; i++) {\n      for (j = 2; j < n; j++)\n        q = q + a[i][j];\n    }\n    sum = p - q;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, m, n, i, j, k, sum = 0;\n  int a[100][100];\n  cin >> s;\n  for (k = 0; k < s; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sum += a[0][i];\n    }\n    if (m > 2) {\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    if (m > 1) {\n      for (i = 0; i < n; i++) {\n        sum += a[m - 1][i];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11004", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, n, i, j, x, y, sum, a[100][100];\n  scanf(\"%d\", &n);\n  for (c = 1; c <= n; c++) {\n    sum = 0;\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][0];\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][j - 1];\n    for (j = 0; j < y; j++)\n      sum = sum + a[0][j];\n    for (j = 0; j < y; j++)\n      sum = sum + a[x - 1][j];\n    sum = sum - a[0][0] - a[x - 1][0] - a[0][y - 1] - a[x - 1][y - 1];\n    if (c != n) {\n      printf(\"%d\\n\", sum);\n    } else\n      printf(\"%d\", sum);\n  }\n}\n"}
{"label": "6", "index": "11005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int a, b;\n  int s[100][100];\n  int sum;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j <= a - 1; j++) {\n      for (k = 0; k <= b - 1; k++) {\n        scanf(\"%d\", &s[j][k]);\n      }\n    }\n    sum = 0;\n    for (k = 0; k <= b - 1; k++) {\n      sum = sum + s[0][k];\n    }\n    for (j = 1; j <= a - 1; j++) {\n      sum = sum + s[j][b - 1];\n    }\n    for (k = 0; k <= b - 2; k++) {\n      sum = sum + s[a - 1][k];\n    }\n    for (j = 1; j <= a - 2; j++) {\n      sum = sum + s[j][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, hang, lie, h, *p, i, j, a[10000], place;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\\n\", &hang, &lie);\n    p = a;\n    for (j = 1; j <= hang; j++) {\n      for (h = 1; h <= lie; h++) {\n        scanf(\"%d\", &*(p++));\n      }\n    }\n    for (place = 0; place <= lie - 1; place++) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = 2 * lie - 1; place < hang * lie - 1; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = hang * lie - 1; place > hang * lie - lie; place--) {\n      p = a + place;\n      sum += *p;\n    }\n    for (place = lie; place <= hang * lie - lie; place += lie) {\n      p = a + place;\n      sum += *p;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, t, j, sum, m, n;\n  cin >> t;\n  for (j = 0; j < t; j++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (i = 1; i <= m * n; i++) {\n      scanf(\"%d\", &a);\n      if ((i <= n) || (i > (m * n - n)) || (i % n == 1) || (i % n == 0))\n        sum += a;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k;\n\n  scanf(\"%d\", &k);\n  int i;\n  for (int h = 0; h < k; h++) {\n    int sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &sz[i][j]);\n    }\n\n    for (int j = 0; j < n; j++) {\n      sum += sz[0][j];\n      sum += sz[m - 1][j];\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n      sum += sz[i][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n;\n  int nums;\n  int jz[100][100] = {0};\n  scanf(\"%d\", &nums);\n  int i, j, k;\n  int sum;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      jz[i][j] = 0;\n  for (i = 0; i < nums; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &jz[j][k]);\n\n    for (j = 0; j < n; j++)\n      sum = sum + jz[0][j];\n    if (m - 1 != 0)\n      for (j = 0; j < n; j++)\n        sum = sum + jz[m - 1][j];\n    for (j = 1; j <= m - 2; j++)\n      sum = sum + jz[j][0];\n    if (n - 1 != 0)\n      for (j = 1; j <= m - 2; j++)\n        sum = sum + jz[j][n - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11010", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int t, i, j, sum = 0;\n  int m, n, k;\n  int(*p)[101] = NULL;\n  scanf(\"%d \", &k);\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    p = a;\n    for (i = 0; i <= n - 2; i++)\n      sum += *(*(p + 0) + i);\n    p = a;\n    for (i = 0; i <= m - 2; i++)\n      sum += *(*(p + i) + n - 1);\n    p = a;\n    for (i = 1; i <= n - 1; i++)\n      sum += *(*(p + m - 1) + i);\n    p = a;\n    for (i = 1; i <= m - 1; i++)\n      sum += *(*(p + i) + 0);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11011", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int a = 0; a < k; a++) {\n    int m, n;\n    cin >> m >> n;\n    int A[100][100];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &A[i][j]);\n      }\n    }\n    int(*p)[100];\n    p = A;\n    int num = 0;\n    for (j = 0; j < n; j++) {\n      num = num + *(*p + j);\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      num = num + **(p + i) + *(*(p + i) + n - 1);\n    }\n\n    for (j = 0; j < n; j++) {\n      num = num + *(*(p + m - 1) + j);\n    }\n\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, q;\n  int k;\n  int m, n;\n  int a[110][110];\n  int sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", *(a + j) + q);\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      sum += *(*a + j);\n      if (m != 1)\n        sum += *(*(a + m - 1) + j);\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += *(*(a + j));\n      if (n != 1)\n        sum += *(*(a + j) + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a, sum[100] = {0};\n  int x, y, z;\n  cin >> k;\n\n  for (x = 0; x < k; x++) {\n    scanf(\"%d %d \", &m, &n);\n    for (y = 0; y < m; y++) {\n      for (z = 0; z < n; z++) {\n        cin >> a;\n        if (z == 0 || y == 0 || z == n - 1 || y == m - 1)\n          sum[x] = sum[x] + a;\n      }\n    }\n  }\n\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", sum[x]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "11014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int m, n;\n  int a[101][101];\n  int u, i, j, sum;\n  scanf(\"%d\", &k);\n  for (u = 0; u < k; u++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if ((i == 0) || (j == 0) || (i == m - 1) || j == (n - 1)) {\n          sum += a[i][j];\n        }\n      }\n    }\n    if (u != k - 1) {\n      printf(\"%d\\n\", sum);\n    } else if (u == k - 1) {\n      printf(\"%d\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[100][100];\nint m, n;\nvoid count() {\n  int i, j;\n  int sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + j == j || i + j == i || i + j == i + n - 1 || i + j == j + m - 1)\n        sum = sum + map_1[i][j];\n    }\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  int sum;\n  int k = 0;\n  cin >> sum;\n  int i, j;\n  for (k = 0; k < sum; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> map_1[i][j];\n      }\n    }\n    count();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, m, n, i, j, sum, num;\n  cin >> k;\n  while (k--) {\n    num = 0;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n        num += a[i][j];\n      }\n\n    if (m == 1 || n == 1 || (m == 1 && n == 1))\n      cout << num << \"\\n\";\n    else {\n      for (i = 0; i < m; i += m - 1)\n        for (j = 0; j < n; j++) {\n          sum += a[i][j];\n        }\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j += n - 1) {\n          sum += a[i][j];\n        }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11017", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  for (int a = 0; a < k; a++) {\n    int m, n;\n    cin >> m >> n;\n    int A[100][100];\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> A[i][j];\n      }\n    }\n    int(*p)[100];\n    p = A;\n    int num = 0;\n    for (j = 0; j < n; j++) {\n      num = num + *(*p + j);\n    }\n\n    for (i = 1; i < m - 1; i++) {\n      num = num + **(p + i) + *(*(p + i) + n - 1);\n    }\n\n    for (j = 0; j < n; j++) {\n      num = num + *(*(p + m - 1) + j);\n    }\n\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, s;\n  int a[100][100];\n  int(*p)[100];\n  int sum[100] = {0};\n  cin >> k;\n  for (s = 0; s < k; s++) {\n    p = a;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    }\n    for (i = 0; i < n; i++) {\n      if ((i == 0) || (i == n - 1))\n        for (j = 0; j < m; j++)\n          sum[s] = sum[s] + *(*(p + i) + j);\n      else\n        sum[s] = sum[s] + *(*(p + i)) + *(*(p + i) + m - 1);\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "11019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[100][100];\n  int k, i, x, y;\n  int m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (x = 0; x < m; x++) {\n      for (y = 0; y < n; y++) {\n        cin >> *(*(number + x) + y);\n      }\n    }\n    if (n == 1 && m == 1)\n      cout << **number << endl;\n    else {\n      for (x = 0; x < m; x++) {\n        sum += *(*(number + x));\n        sum += *(*(number + x) + n - 1);\n      }\n\n      for (y = 0; y < n; y++) {\n        sum += *(*(number) + y);\n        sum += *(*(number + m - 1) + y);\n      }\n\n      sum = sum - *(*(number)) - *(*(number) + n - 1) - *(*(number + m - 1)) -\n            *(*(number + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0;\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    int m = 0, n = 0;\n    scanf(\"%d %d\", &m, &n);\n    int i = 0, j = 0, x = 0;\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &x);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += x;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, *sum, i, j, *q;\n  sum = (int *)malloc(100 * sizeof(int));\n  q = sum;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++, sum++) {\n    *sum = 0;\n    int *p, *p1;\n    p = (int *)calloc(1000, 100 * sizeof(int));\n    scanf(\"%d %d\", &m, &n);\n    p1 = p;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p++);\n    for (i = 0, p = p1; i < m * n; i++, p++)\n      if (i < n || i % n == 0 || (i + 1) % n == 0 ||\n          (i < n * m && i > (n * (m - 1) - 1)))\n        *sum = *sum + *p;\n  }\n  for (i = 0, sum = q; i < k - 1; i++)\n    printf(\"%d\\n\", *sum++);\n  printf(\"%d\", *sum);\n}\n"}
{"label": "6", "index": "11022", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, l, sum[100] = {0};\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += a[m][j];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][1];\n    for (i = 1; i <= m; i++)\n      sum[l] += a[i][n];\n    sum[l] = sum[l] - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  for (int i = 0; i < t; i++) {\n    int n, m;\n    cin >> m >> n;\n    int num[110][110];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> num[j][k];\n    int sum = 0;\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++)\n        sum = sum + num[0][j];\n      cout << sum << endl;\n    } else if (m != 1 && n == 1) {\n      for (int j = 0; j < m; j++)\n        sum = sum + num[m][0];\n      cout << sum << endl;\n    } else if (m == 1 && n == 1)\n      cout << num[0][0] << endl;\n    else {\n      for (int j = 0; j < n; j++)\n        sum = sum + *(*num + j);\n      for (int j = 0; j < n; j++)\n        sum = sum + *(num[m - 1] + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + **(num + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + *(*(num + j) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11024", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, r, c, n;\n  int s[100][100];\n  int sum[100];\n  int sumr, sumc;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    sumr = 0;\n    sumc = 0;\n    cin >> r >> c;\n    for (j = 0; j < r; j++)\n      for (k = 0; k < c; k++)\n        cin >> s[j][k];\n    if (r != 1 && c != 1) {\n      for (k = 0; k < c; k++)\n        sumr += s[0][k] + s[r - 1][k];\n      for (j = 0; j < r; j++)\n        sumc += s[j][0] + s[j][c - 1];\n      sum[i] =\n          sumr + sumc - s[0][0] - s[0][c - 1] - s[r - 1][0] - s[r - 1][c - 1];\n    }\n    if (r == 1 && c != 1)\n      for (k = 0; k < c; k++)\n        sum[i] += s[0][k];\n    if (c == 1 && r != 1)\n      for (j = 0; j < r; j++)\n        sum[i] += s[j][0];\n    if (c == 1 && r == 1)\n      sum[i] = s[0][0];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, o, p, sum, area[111][111];\n  int k, i = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> a >> b;\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++) {\n        cin >> area[o][p];\n      }\n    }\n    if (a != 1 && b != 1) {\n      for (p = 0; p < b; p++) {\n        sum += area[0][p] + area[a - 1][p];\n      }\n      for (o = 1; o < a - 1; o++) {\n        sum += area[o][0] + area[o][b - 1];\n      }\n    } else {\n      for (o = 0; o < a; o++) {\n        for (p = 0; p < b; p++) {\n          sum += area[o][p];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, a[1000][1000], sum;\n  scanf(\"%d\", &k);\n  while (k--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < n; i++) {\n      if (m == 1)\n        sum = sum + a[0][i];\n      else\n        sum = sum + a[0][i] + a[m - 1][i];\n    }\n    for (i = 1; i < m - 1; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], n, s[100] = {0}, i, j, len, col, m, sum = 0;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d\", &len, &col);\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        sum += sz[i][j];\n      }\n    }\n    if (col == 1 || len == 1) {\n      s[m] = sum;\n    } else {\n      for (j = 0; j < col - 1; j++) {\n        s[m] += sz[0][j];\n      }\n      for (i = 0; i < len - 1; i++) {\n        s[m] += sz[i][col - 1];\n      }\n      for (j = 1; j < col; j++) {\n        s[m] += sz[len - 1][j];\n      }\n      for (i = 1; i < len; i++) {\n        s[m] += sz[i][0];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, sum, x, y;\n  int a[100], b[100], ar[100][100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a[i], &b[i]);\n    x = a[i] - 1;\n    y = b[i] - 1;\n    for (j = 0; j < a[i]; j++) {\n      for (k = 0; k < b[i]; k++) {\n        cin >> ar[j][k];\n      }\n    }\n    sum = 0;\n    for (j = 0; j < a[i]; j++) {\n      sum = sum + ar[j][0] + ar[j][y];\n    }\n    for (k = 0; k < b[i]; k++) {\n      sum = sum + ar[0][k] + ar[x][k];\n    }\n    sum = sum - ar[0][0] - ar[0][y] - ar[x][0] - ar[x][y];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  int a, b;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    sum = 0;\n    int c[100][100][100];\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d\", &c[i][j][k]);\n    }\n    for (j = 0; j < a; j++)\n      sum += c[i][j][0] + c[i][j][b - 1];\n    for (k = 0; k < b; k++)\n      sum += c[i][0][k] + c[i][a - 1][k];\n    sum =\n        sum - c[i][0][0] - c[i][0][b - 1] - c[i][a - 1][0] - c[i][a - 1][b - 1];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "6", "index": "11030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, m, n, i, M, j, JU[100][100], h, l;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    M = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (h = 0; h < m; h++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &JU[h][l]);\n      }\n    }\n    if (n == 1) {\n      for (j = 0; j < m; j++)\n        M = M + JU[j][0];\n    } else if (m == 1) {\n      for (j = 0; j < n; j++)\n        M = M + JU[0][j];\n    } else {\n      for (h = 0; h < m; h++) {\n        if (h > 0 && h < m - 1) {\n          M = M + JU[h][0] + JU[h][n - 1];\n        } else {\n          for (j = 0; j < n; j++)\n            M = M + JU[h][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", M);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, l;\n  int m, n, i, j, s1, s2, s3, s4, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc((sizeof(int) * k));\n  for (l = 0; l < k; l++) {\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s1 += sz[i][0];\n      s2 += sz[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      s3 += sz[0][j];\n      s4 += sz[m - 1][j];\n    }\n    s += s1 + s2 + s3 + s4 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n         sz[m - 1][n - 1];\n    sf[l] = s;\n  }\n  for (l = 0; l < k; l++) {\n    printf(\"%d\\n\", sf[l]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n, **p, a, b, sum;\n    scanf(\"%d%d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (a = 0; a < m; a++)\n      p[a] = (int *)malloc(n * sizeof(int));\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d\", *(p + a) + b);\n    }\n    sum = 0;\n    for (b = 0; b < n; b++)\n      sum = sum + *(*p + b) + *(*(p + m - 1) + b);\n    for (a = 1; a < m - 1; a++)\n      sum = sum + **(p + a) + *(*(p + a) + n - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, k, i, j, sum;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  while (k--) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1)\n          continue;\n        if (j == 0 || j == n - 1)\n          continue;\n        a[i][j] = 0;\n      }\n    }\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        sum += a[i][j];\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    char a[100][100];\n    int j, l;\n\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l];\n    } else {\n      for (l = 0; l < n; l++)\n        sum = sum + a[0][l] + a[m - 1][l];\n    }\n    if (n == 1) {\n      for (j = 1; j < m - 1; j++) {\n        sum = sum + a[j][0];\n      }\n    } else {\n      for (j = 1; j < m - 1; j++)\n        sum = sum + a[j][0] + a[j][n - 1];\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "11035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int jz[100][100];\n  int m, n;\n\n  int s[1000];\n  int i, j, q;\n\n  for (q = 0; q < k; q++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n\n        scanf(\"%d\", &(jz[i][j]));\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][0];\n    }\n    for (i = 0; i < m; i++) {\n      s[q] += jz[i][n - 1];\n    }\n    for (i = 0; i < n; i++)\n      s[q] += jz[0][i];\n\n    for (i = 0; i < n; i++) {\n      s[q] += jz[m - 1][i];\n    }\n    s[q] = s[q] - (jz[0][0]) - (jz[0][n - 1]) - (jz[m - 1][0]) -\n           (jz[m - 1][n - 1]);\n    if (q == k - 1) {\n      printf(\"%d\", s[q]);\n    } else {\n      cout << s[q] << \"\\n\";\n    }\n    m = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[101][101];\n  int k, m, n, i, *pointer1, *pointer2, i1, i2, sum = 0;\n  ;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (i1 = 0; i1 < m; i1++) {\n      for (i2 = 0; i2 < n; i2++)\n        cin >> s[i1][i2];\n    }\n    pointer1 = &s[0][1];\n    pointer2 = &s[0][0];\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer1 = &s[0][i1];\n      sum += *pointer1;\n    }\n    for (i1 = 0; i1 < m; i1++) {\n      if (n != 1) {\n        pointer1 = &s[i1][n - 1];\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      } else {\n        pointer2 = &s[i1][0];\n        sum = sum + *pointer1 + *pointer2;\n      }\n    }\n    for (i1 = 1; i1 < n - 1; i1++) {\n      pointer2 = &s[m - 1][i1];\n      sum += *pointer2;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int c, i, j;\n  int m, n, k;\n  cin >> k;\n  for (c = 1; c <= k; c++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    for (i = 1; i <= m; i++) {\n      sum1 = sum1 + a[i][1];\n      sum2 = sum2 + a[i][n];\n    }\n    for (j = 1; j <= n; j++) {\n      sum3 = sum3 + a[1][j];\n      sum4 = sum4 + a[m][j];\n    }\n    sum = sum1 + sum2 + sum3 + sum4 - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, array[100][100];\n  int sum, i, j, k;\n  scanf(\"%d \", &t);\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    for (j = 0; j < m; j++)\n      sum = sum + array[j][0] + array[j][n - 1];\n    for (k = 0; k < n; k++)\n      sum = sum + array[0][k] + array[m - 1][k];\n    printf(\"%d\\n\", sum - array[0][0] - array[0][n - 1] - array[m - 1][0] -\n                       array[m - 1][n - 1]);\n  }\n  cin.get();\n  return 0;\n}\n"}
{"label": "6", "index": "11039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void jisuan(int array[100][100], int x, int y);\n  int k, i, m, n, p, q, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    jisuan(a, m, n);\n  }\n  return 0;\n}\nvoid jisuan(int array[100][100], int x, int y) {\n  int i, j, a, b, c, d, sum;\n  for (j = 0, a = 0; j < y; j++) {\n    a = a + array[0][j];\n  }\n  for (i = 1, b = 0; i < x; i++) {\n    b = b + array[i][y - 1];\n  }\n  for (j = y - 2, c = 0; j >= 0; j--) {\n    c = c + array[x - 1][j];\n  }\n\n  for (i = x - 2, d = 0; i > 0; i--) {\n    d = d + array[i][0];\n  }\n  sum = a + b + c + d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "6", "index": "11040", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint v[100][100];\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nint sum(int m, int n) {\n\n  int su = 0;\n  if (n >= 2 && m >= 2) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n      su += v[m - 1][i];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      su += v[i][0];\n      su += v[i][n - 1];\n    }\n  } else if (n >= 2 && m == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[0][i];\n    }\n  } else if (m >= 2 && n == 1) {\n    for (int i = 0; i < n; i++) {\n      su += v[i][0];\n    }\n  } else {\n    su = v[0][0];\n  }\n  return su;\n}\n\n\nint main() {\n  int times;\n  cin >> times;\n\n  for (int k = 0; k < times; k++) {\n    int a, b;\n    cin >> a >> b;\n\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> v[i][j];\n\n    cout << sum(a, b) << endl;\n  }\n}\n"}
{"label": "6", "index": "11041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f() {\n  int a = 0, i, j, m, n, (*p)[100];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[100])malloc(m * 100 * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", *(p + i) + j);\n    }\n  for (j = 0; j < n; j++)\n    a = a + *(*p + j) + *(*(p + m - 1) + j);\n  for (i = 1; i < m - 1; i++)\n    a = a + *(*(p + i)) + *(*(p + i) + n - 1);\n  printf(\"%d\\n\", a);\n}\nint main() {\n  int c, k;\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++)\n    f();\n}\n"}
{"label": "6", "index": "11042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = m - 1, j = 0; j < n; j++)\n      sum = sum + a[i][j];\n    for (i = 0, j = 0; i < m; i++)\n      sum = sum + a[i][j];\n    for (i = 0, j = n - 1; i < m; i++)\n      sum = sum + a[i][j];\n    sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, t, i, j, l, k, sum = 0, a[100][100];\n  cin >> t;\n  for (l = 0; l < t; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (m == n && n == 1) {\n      cout << a[0][0];\n    } else {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << \"\\n\";\n    }\n    sum = 0;\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "6", "index": "11044", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, n, m, sum = 0, i, j, k, a[101][101];\n  cin >> l;\n  for (i = 1; i <= l; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    if (m != 1 && n != 1) {\n      for (k = 1; k <= n; k++)\n        sum += a[1][k];\n      for (k = 1; k <= n; k++)\n        sum += a[m][k];\n      for (k = 2; k < m; k++)\n        sum += a[k][1];\n      for (k = 2; k < m; k++)\n        sum += a[k][n];\n      cout << sum << endl;\n    } else {\n      for (j = 1; j <= m; j++)\n        for (k = 1; k <= n; k++)\n          sum += a[j][k];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sq(int *p, int m, int n) {\n  int i, s;\n  s = 0;\n  for (i = 0; i < n; i++)\n    s = s + *(p + i);\n  for (i = 1; i < m; i++)\n    s = s + *(p + n * i) + *(p + n * i + n - 1);\n  for (i = 1; i < n - 1; i++)\n    s = s + *(p + (m - 1) * n + i);\n  printf(\"%d\\n\", s);\n}\nint main() {\n  int *p, m, n, k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)malloc(m * n * sizeof(int));\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", p + j);\n    sq(p, m, n);\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "11046", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t, i, j, k, a[100][100][100], b[100] = {0}, m[100], n[100];\n  scanf(\"%d \", &t);\n  for (i = 0; i < t; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n    for (j = 0; j < m[i]; j++)\n      b[i] = b[i] + a[i][j][0] + a[i][j][n[i] - 1];\n    for (j = 0; j < n[i]; j++)\n      b[i] = b[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    b[i] = b[i] - a[i][0][0] - a[i][m[i] - 1][0] - a[i][0][n[i] - 1] -\n           a[i][m[i] - 1][n[i] - 1];\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11047", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int x = 0, y = 0;\n  int total = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  scanf(\"%d\", &n);\n  for (int k = 0; k < n; k++) \n  {\n    scanf(\"%d %d\", &x, &y); \n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        scanf(\"%d\", &Matrix[i][j]);\n        if (i == 0 || i == x - 1) \n          total += Matrix[i][j];\n        else if (j == 0 || j == y - 1) \n          total += Matrix[i][j];\n      }\n    printf(\"%d\\n\", total);\n    total = 0; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sum();\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    sum();\n}\nvoid sum() {\n  int m, n, i, j, s = 0, a[101][101];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m; i++)\n    s = s + a[i][0];\n  for (i = 0; i < m; i++)\n    s = s + a[i][n - 1];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[0][i];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[m - 1][i];\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "6", "index": "11049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, j1, j, n, c, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &c, &k);\n    for (j = 0; j < c; j++) {\n      for (j1 = 0; j1 < k; j1++) {\n        scanf(\"%d\", &a[j][j1]);\n      }\n    }\n    for (j = 1; j < k - 1; j++)\n      sum += *(*p + j) + *(*(p + c - 1) + j);\n    if (k > 1)\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j)) + *(*(p + j) + k - 1);\n    else\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j));\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11050", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], b[10000], c[10000], i, l, n, sum[10000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (l = 0; l < a[i] * b[i]; l++) {\n      cin >> c[l];\n      if (l <= b[i] || l >= (b[i] * a[i] - b[i] + 1) || l % b[i] == 0 ||\n          (l + 1) % b[i] == 0)\n        sum[i] += c[l];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "11051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, line = 0, row = 0;\n  int a[102][102];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d \", &line, &row);\n    for (int j = 0; j < line; j++) {\n      for (int k = 0; k < row; k++)\n        cin >> *(*(a + j) + k);\n    }\n    if (line == 1 && row == 1) {\n      cout << **a << endl;\n      continue;\n    }\n    int plus =\n        **a + *(*a + row - 1) + **(a + line - 1) + *(*(a + line - 1) + row - 1);\n    for (int j = 1; j < line - 1; j++)\n      plus += **(a + j) + *(*(a + j) + row - 1);\n    for (int j = 1; j < row - 1; j++)\n      plus += *(*a + j) + *(*(a + line - 1) + j);\n    cout << plus << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, s, a[100][100], j, l, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((n > 1) && (m > 1)) {\n      for (i = 0; i < n; i++) {\n        s += a[0][i];\n        s += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        s += a[i][0];\n        s += a[i][n - 1];\n      }\n    } else {\n      if (n == 1) {\n        for (i = 0; i < m; i++)\n          s += a[i][0];\n      } else if (m == 1) {\n        for (i = 0; i < n; i++)\n          s += a[0][i];\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, k, i, j, s = 0, m, n, *p[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        p[i][j] = (int *)malloc(1 * sizeof(int));\n        scanf(\"%d\", &*p[i][j]);\n        if (j == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    for (j = 0; j < n; j++)\n      s = s + (*p[0][j]) + (*p[m - 1][j]);\n    for (i = 1; i < m - 1; i++)\n      s = s + (*p[i][0]) + (*p[i][n - 1]);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, s;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    int a[m][n];\n    s = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &(a[j][l]));\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < n; j++) {\n        s += a[0][j];\n      }\n    } else if (n == 1) {\n      for (j = 0; j < m; j++) {\n        s += a[j][0];\n      }\n    } else {\n      for (j = 0; j < n; j++) {\n        s = s + a[0][j] + a[m - 1][j];\n      }\n      for (j = 0; j < m; j++) {\n        s = s + a[j][0] + a[j][n - 1];\n      }\n      s = s - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11055", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, sum, i, j;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (; k > 0; k--) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &jz[i][j]);\n    }\n    for (i = 0; i < m; i++)\n      sum += (jz[i][0] + jz[i][n - 1]);\n    for (i = 0; i < n; i++)\n      sum += (jz[0][i] + jz[m - 1][i]);\n    sum -= (jz[0][0] + jz[m - 1][n - 1] + jz[0][n - 1] + jz[m - 1][0]);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11056", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[105][105], (*p)[105] = NULL, sum;\n  cin >> k;\n  for (int time = 1; time <= k; time++) {\n    sum = 0;\n    p = a;\n    scanf(\"%d %d \", &m, &n);\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + *(*p + i) + *(*(p + m - 1) + i);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      sum = sum + *(*(p + i)) + *(*(p + i) + n - 1);\n    }\n    if ((m == 1) || (n == 1))\n      sum = sum / 2;\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, *p, a[100][100], s;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    p = &a[0][0];\n    s = 0;\n    for (j = 0; j < n; j++) {\n      if (n == 1)\n        s += *p;\n      else\n        s += (*(p + j) + *(p + 100 * (m - 1) + j));\n    }\n    for (j = 1; j < m - 1; j++)\n      s += (*(p + j * 100) + *(p + j * 100 + n - 1));\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, e;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int a, b, c, d, total;\n    scanf(\"%d%d\", &a, &b);\n    if (a == 1 && b == 1) {\n      scanf(\"%d\", &c);\n      printf(\"%d\", c);\n    } else {\n      int sz[a][b];\n      for (c = 0; c < a; c++) {\n        for (d = 0; d < b - 1; d++) {\n          cin >> sz[c][d];\n        }\n        scanf(\"%d\\n\", &sz[c][b - 1]);\n      }\n      total = 0;\n      for (c = 0; c < a; c++) {\n        total = total + sz[c][0];\n        total = total + sz[c][b - 1];\n      }\n      for (c = 0; c < b; c++) {\n        total = total + sz[0][c];\n        total = total + sz[a - 1][c];\n      }\n      total = total - sz[0][0];\n      total = total - sz[0][b - 1];\n      total = total - sz[a - 1][0];\n      total = total - sz[a - 1][b - 1];\n      printf(\"%d\\n\", total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11059", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n = 0;\n  int x = 0, y = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    cin >> y;\n    for (int j = 0; j < x; j++)\n      for (int k = 0; k < y; k++)\n        cin >> a[j][k];\n    int *p;\n    int sum = 0;\n    for (int j = 1; j < x - 1; j++) {\n      p = a[j];\n      sum = *p + *(p + y - 1) + sum;\n    }\n    p = a[0];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    p = a[x - 1];\n    for (int j = 0; j < y; j++) {\n      sum += *p;\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, tri[100][100], h, l, *point = tri[0];\n  cin >> t;\n  for (int i = 1; i <= t; i++) {\n    cin >> h >> l;\n    int temp = 0;\n    for (int p = 1; p <= h; p++) {\n      for (int q = 1; q <= l; q++) {\n        cin >> *(point + 100 * p + q);\n        if (p == 1 || q == 1 || p == h || q == l)\n          temp += *(point + 100 * p + q);\n      }\n    }\n    printf(\"%d\\n\", temp);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11061", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], r, l, sum = 0;\n    cin >> r >> l;\n    for (j = 0; j <= r - 1; j++)\n      for (k = 0; k <= l - 1; k++)\n        scanf(\"%d\", *(a + j) + k);\n    for (j = 0; j <= r - 1; j++) {\n      for (k = 0; k <= l - 1; k++) {\n        if (j == r - 1 || j == 0 || k == l - 1 || k == 0)\n          sum += *(*(a + j) + k);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, i, j, k, s = 0;\n  int m, n, a[100][100];\n  scanf(\"%d \", &x);\n  for (i = 1; i <= x; i++) {\n    cin >> m >> n;\n    for (j = 0; j <= m - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n        if (j == 0 || j == m - 1 || (k == 0 && j != 0 && j != m - 1) ||\n            (k == n - 1 && j != 0 && j != m - 1))\n          s = s + a[j][k];\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11063", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100];\n  int i = 0, j = 0, t = 1;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    if (m == 1 && n == 1)\n      cout << a[0][0] << endl;\n    else {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      cout << sum << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11064", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sub(void) {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *p;\n  int i, sum = 0;\n  p = (int *)malloc(10000 * sizeof(int));\n  for (i = 0; i < m * n; i++)\n    scanf(\"%d\", p + i);\n  for (i = 1; i < n - 1; i++)\n    sum = sum + *(p + i);\n  for (i = m * n - n + 1; i < m * n - 1; i++) {\n    sum = sum + *(p + i);\n  }\n  for (i = 0; i < m * n; i++)\n    if ((i % n) == 0 || ((i + 1) % n) == 0)\n      sum = sum + *(p + i);\n  printf(\"%d\\n\", sum);\n}\n\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 0; i < k; i++)\n    sub();\n  return 0;\n}\n"}
{"label": "6", "index": "11065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  while (num--) {\n    int a[100][100];\n    int m, n;\n    cin >> m >> n;\n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < m; i++) {\n      if (n == 1) {\n        sum += a[i][0];\n      } else {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      if (m == 1) {\n        sum += a[0][j];\n      } else {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    int row, col, count = 0, i, j;\n    cin >> row >> col;\n    int str[101][101];\n    for (i = 1; i <= row; i++)\n      for (j = 1; j <= col; j++)\n        cin >> *(*(str + i) + j);\n\n    for (i = 1; i <= col; i++)\n      count = count + *(*(str + 1) + i);\n    for (i = 2; i <= row; i++)\n      count = count + *(*(str + i) + col);\n    for (i = col - 1; i >= 1; i--)\n      count = count + *(*(str + row) + i);\n    for (i = row - 1; i >= 2; i--)\n      count = count + *(*(str + i) + 1);\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int k, m[100], n[100], i, j, t, s[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (t = 0; t < n[i]; t++)\n        scanf(\"%d \", &a[i][j][t]);\n    for (t = 0; t < n[i]; t++)\n      s[i] += (a[i][0][t] + a[i][m[i] - 1][t]);\n    for (j = 0; j < m[i]; j++)\n      s[i] += (a[i][j][0] + a[i][j][n[i] - 1]);\n    s[i] = s[i] - a[i][0][0] - a[i][0][n[i] - 1] - a[i][m[i] - 1][0] -\n           a[i][m[i] - 1][n[i] - 1];\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "11068", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, m, n, a, b, s[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n      }\n    }\n    s[i] = 0;\n    for (b = 0; b < n; b++)\n      s[i] += sz[0][b];\n\n    for (a = 1; a < m; a++) {\n      s[i] += sz[a][n - 1];\n    }\n    for (b = n - 2; b >= 0; b--) {\n      s[i] += sz[m - 1][b];\n    }\n    for (a = m - 2; a >= 1; a--) {\n      s[i] += sz[a][0];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d \", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, h, l, y;\n  int *p = NULL;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    y = 0;\n    int x[101][101] = {0};\n    cin >> h >> l;\n    for (j = 1; j <= h; j++) {\n      for (k = 1; k <= l; k++) {\n        cin >> x[j][k];\n      }\n    }\n\n    for (p = x[1] + 1; p <= x[1] + l; p++) {\n      y = y + (*p);\n    }\n\n    for (p = x[2] + 1; p <= x[h - 1] + 1; p = p + 101) {\n      y = y + (*p) + (*(p + l - 1));\n    }\n\n    for (p = x[h] + 1; p <= x[h] + l; p++) {\n      y = y + (*p);\n    }\n    printf(\"%d\\n\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11070", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, M, i, j, sum[1000];\n  int row[1000], col[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &M);\n  for (m = 0; m < M; m++) {\n    sum[m] = 0;\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        sz[i][j] = 0;\n      }\n    }\n\n    scanf(\"%d%d\", &row[m], &col[m]);\n\n    for (i = 0; i < row[m]; i++) {\n      for (j = 0; j < col[m]; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (j = 0; j < col[m]; j++) {\n      sum[m] += sz[0][j];\n      sum[m] += sz[row[m] - 1][j];\n    }\n    for (i = 0; i < row[m]; i++) {\n      sum[m] += sz[i][0];\n      sum[m] += sz[i][col[m] - 1];\n    }\n    sum[m] = sum[m] - sz[0][0] - sz[row[m] - 1][col[m] - 1] -\n             sz[0][col[m] - 1] - sz[row[m] - 1][0];\n  }\n  for (m = 0; m < M; m++) {\n    printf(\"%d\\n\", sum[m]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11071", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][99][99] = {0}, m[100], n[100], k, i, j, l, sum[100] = {0}, leap;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j <= m[i] - 1; j++) {\n      for (l = 0; l <= n[i] - 1; l++)\n        cin >> a[i][j][l];\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (m[i] == 1 && n[i] == 1) {\n      sum[i] = a[i][0][0];\n    } else {\n      for (j = 0; j <= m[i] - 1; j++) {\n        sum[i] = a[i][j][0] + a[i][j][n[i] - 1] + sum[i];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (n[i] <= 2)\n      leap = 1;\n    else\n      leap = 0;\n    for (j = 1; j <= n[i] - 2; j++) {\n      if (leap)\n        break;\n      sum[i] = sum[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int *a, sum, i, k, n, m, j = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    a = (int *)malloc(sizeof(int) * (n * m));\n    for (j = 0; j < n * m; j++) {\n      scanf(\"%d\", a + j);\n      if ((j + 1 <= n) || (j > (n * m - n - 1)) || ((j + 1) % n == 1) ||\n          ((j + 1) % n == 0))\n        sum += *(a + j);\n    }\n    free(a);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], j, i, l, p, q;\n  int k, m, n, sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        scanf(\"%d \", &a[j][l]);\n    }\n    for (p = 1; p <= n; p++)\n      sum = sum + a[1][p] + a[m][p];\n\n    for (q = 2; q < m; q++) {\n      sum = sum + a[q][1] + a[q][n];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11074", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int *p = NULL;\n  int a[100][100];\n  scanf(\"%d \", &k);\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int sum = 0;\n    for (int j = 0; j <= m - 1; j++) {\n      for (int t = 0; t <= n - 1; t++) {\n        cin >> a[j][t];\n      }\n    }\n    p = &a[0][0];\n    for (p = &a[0][0]; p <= &a[0][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    for (p = &a[1][0]; p <= &a[m - 2][0]; p = p + 100) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    for (p = &a[m - 1][0]; p <= &a[m - 1][n - 1]; p++) {\n      sum = sum + *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int sz[100][100];\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d \", &sz[j][p]);\n      }\n    }\n    if (m != 1 && m != 2 && n != 1 && n != 2) {\n      sum1 = sum2 = sum3 = sum4 = 0;\n      for (p = 0; p < n; p++) {\n        sum1 += sz[0][p];\n      }\n      for (p = 0; p < n; p++) {\n        sum2 += sz[m - 1][p];\n      }\n      for (j = 0; j < m; j++) {\n        sum3 += sz[j][0];\n      }\n      for (j = 0; j < m; j++) {\n        sum4 += sz[j][n - 1];\n      }\n      cout << sum1 + sum2 + sum3 + sum4 - sz[0][0] - sz[0][n - 1] -\n                  sz[m - 1][0] - sz[m - 1][n - 1]\n           << \"\\n\";\n    } else {\n      sum = 0;\n      for (j = 0; j < m; j++) {\n        for (p = 0; p < n; p++) {\n          sum += sz[j][p];\n        }\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint calcSum(int *matrix, int row, int col);\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *result = (int *)malloc(k * sizeof(int));\n  int i = 0;\n  int row, col;\n  int sum;\n  int m, n;\n  int *matrix;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    matrix = (int *)malloc(m * n * sizeof(int));\n    for (row = 0; row < m; row++)\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", matrix + row * n + col);\n    *(result + i) = calcSum(matrix, m, n);\n    free(matrix);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d\\n\", *(result + i));\n  }\n  cout << *(result + i);\n  return 0;\n}\n\nint calcSum(int *matrix, int row, int col) {\n  int sum = 0;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      if (i == 0 || i == row - 1 || j == 0 || j == col - 1)\n        sum += *(matrix + i * col + j);\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "11077", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n, board[100][100], sum = 0;\n    int(*p)[100];\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++)\n        cin >> board[j][p];\n    for (int j = 0; j < m; j++)\n      for (int p = 0; p < n; p++) {\n        if (j == 0 || j == m - 1 || p == 0 || p == n - 1)\n          sum += board[j][p];\n      }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int sz[100][100];\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d \", &sz[j][p]);\n      }\n    }\n    if (m != 1 && m != 2 && n != 1 && n != 2) {\n      sum1 = sum2 = sum3 = sum4 = 0;\n      for (p = 0; p < n; p++) {\n        sum1 += sz[0][p];\n      }\n      for (p = 0; p < n; p++) {\n        sum2 += sz[m - 1][p];\n      }\n      for (j = 0; j < m; j++) {\n        sum3 += sz[j][0];\n      }\n      for (j = 0; j < m; j++) {\n        sum4 += sz[j][n - 1];\n      }\n      printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4 - sz[0][0] - sz[0][n - 1] -\n                         sz[m - 1][0] - sz[m - 1][n - 1]);\n    } else {\n      sum = 0;\n      for (j = 0; j < m; j++) {\n        for (p = 0; p < n; p++) {\n          sum += sz[j][p];\n        }\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int a[100][100];\n  cin >> k;\n  while (k--) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      int k;\n      cin >> k;\n      cout << k;\n    } else {\n      for (int i = 0; i < m; i++)\n        for (int j = 0; j < n; j++)\n          cin >> a[i][j];\n      int sum = 0;\n      for (int j = 0; j < n; j++)\n        sum += *(*(a) + j) + *(*(a + m - 1) + j);\n      for (int i = 1; i < m - 1; i++)\n        sum += *(*(a + i)) + *(*(a + i) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, a[100][100], *p;\n  cin >> k;\n  for (j = 1; j <= k; j++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = *a, i = 0; i < m * n; i++) {\n      cin >> p[i];\n      if (i <= n - 1 || i >= m * n - n - 1 || (i + 1) % n == 0 || i % n == 0)\n        sum += p[i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11081", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum;\n  cin >> k;\n  int a[100][100];\n  for (int l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    sum = 0;\n    if (m > 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*(a + m - 1) + i);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum = sum + *(*a + i);\n    }\n    if (n > 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i) + n - 1);\n    }\n    if (n == 1) {\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i));\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 10, b = 10, o = 10, p = 10, sum, area[111][111];\n  int k = 10, i = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (o = 0; o < a; o++) {\n      for (p = 0; p < b; p++)\n        scanf(\"%d\", &area[o][p]);\n    }\n    for (p = 0; p < b; p++)\n      sum += area[0][p] + area[a - 1][p];\n    for (o = 1; o < a - 1; o++)\n      sum += area[o][0] + area[o][b - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    int add = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (l = 0; l < n; l++)\n      add += (a[0][l] + a[m - 1][l]);\n    for (l = 1; l < m - 1; l++)\n      add += (a[l][0] + a[l][n - 1]);\n    printf(\"%d \", add);\n    for (j = 0; j < 100; j++) {\n      for (l = 0; l < 100; l++)\n        a[j][l] = 0;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "11084", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, N, i, j, a, b, sum = 0;\n  int data[1000][1000];\n  cin >> N;\n  for (n = 0; n < N; n++) {\n    sum = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++)\n        cin >> data[i][j];\n    }\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        if (i == 0 || i == a - 1 || j == 0 || j == b - 1)\n          sum += data[i][j];\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, number[100][100], num, *p = NULL;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> number[j][l];\n    }\n    num = 0;\n    p = *number;\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        num += *(p + j);\n      else {\n        num = num + *(p + j) + *(*(number + m - 1) + j);\n      }\n    }\n    p = *number;\n    for (j = 1; j < m - 1; j++) {\n      if (n == 1)\n        num += **(number + j);\n      else {\n        num = num + **(number + j) + *(*(number + j) + n - 1);\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, s, a[100][100], j, l, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if ((n > 1) && (m > 1)) {\n      for (i = 0; i < n; i++) {\n        s += a[0][i];\n        s += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        s += a[i][0];\n        s += a[i][n - 1];\n      }\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n    } else if (m == 1) {\n      for (i = 0; i < n; i++)\n        s += a[0][i];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, m, sum = 0, i, j, p;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m == 1) {\n      cout << a[0][0] << endl;\n    } else if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    } else {\n      if (n > 1 && m == 1) {\n        for (j = 0; j < n; j++) {\n          sum += a[0][j];\n        }\n        cout << sum << endl;\n        sum = 0;\n      } else {\n        for (i = 0; i < m; i++) {\n          sum += a[i][0] + a[i][n - 1];\n        }\n        for (j = 0; j < n; j++) {\n          sum += a[0][j] + a[m - 1][j];\n        }\n        sum -= a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n        printf(\"%d\\n\", sum);\n      }\n    }\n    sum = 0;\n    k--;\n  }\n}\n"}
{"label": "6", "index": "11088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  int sz[100][100], sum, s[100];\n  int a, b, m, n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      sum += sz[0][b];\n      sum += sz[m - 1][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      sum += sz[a][0];\n      sum += sz[a][n - 1];\n    }\n    s[i] = sum;\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, m, p, q, sz[100][100], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n    }\n    if (m == 1 || n == 1) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum += sz[p][q];\n        }\n      }\n    } else {\n      for (q = 0; q <= n - 1; q++) {\n        sum += sz[0][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][n - 1];\n      }\n      for (q = 0; q < n; q++) {\n        sum += sz[m - 1][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][0];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar name[100];\ndouble s[100];\nint num[1000][1000];\nint main() {\n  int i = 0, j = 0, n, m, sum = 0, k = 0, flag = 0, p = 0, a = 0, c = 0, b = 0,\n      q = 0;\n  double result = 0;\n  scanf(\"%d\", &a);\n\n  while (p < a) {\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        scanf(\"%d\", &num[i][j]);\n        if (i == 0)\n          sum += num[i][j];\n        if (i == n - 1)\n          sum += num[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < n - 1; j++) {\n        if (i == 0)\n          sum += num[j][i];\n        if (i == m - 1)\n          sum += num[j][i];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    p++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11091", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, p, a[100][100], s[100] = {0}, m, n;\n  scanf(\"%d\", &k);\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[1][j]);\n    }\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[m][j]);\n    }\n    for (i = 2; i <= m - 1; i++) {\n      s[p] = s[p] + a[i][1] + a[i][n];\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (p = 2; p <= k; p++) {\n    printf(\"\\n%d\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num, n, m, a[100][100];\nint main() {\n  cin >> num;\n  for (int x = 0; x < num; x++) {\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int ans = 0;\n    for (int i = 0; i < m; i++)\n      ans += a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      ans += a[0][i] + a[m - 1][i];\n    cout << ans << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "11093", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int *p, i, all, m, n, cycle, ii;\n\n  scanf(\"%d\", &cycle);\n  for (ii = 0; ii < cycle; ii++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int *)calloc(m * n, sizeof(int));\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p + i);\n    all = 0;\n    for (i = 0; i < n; i++)\n      all += *(p + i);\n    if (m > 1) {\n      for (i = 0; i < n; i++)\n        all += *(p + i + (m - 1) * n);\n    }\n    for (i = 2; i < m; i++)\n      all += *(p + (i - 1) * n);\n    if (n > 1) {\n      for (i = 2; i < m; i++)\n        all += *(p + n - 1 + (i - 1) * n);\n    }\n    printf(\"%d \", all);\n    free(p);\n  }\n}\n"}
{"label": "6", "index": "11094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n, sum = 0;\n    cin >> m >> n;\n    int i, j, a[100][100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if ((i == 0) || (i == m - 1) || (j == 0) || (j == n - 1))\n          sum = sum + a[i][j];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum;\n  int b, n, m, i, j, l;\n  scanf(\"%d\", &b);\n  for (l = 0; l < b; l++) {\n    scanf(\"%d\", &m);\n    scanf(\"%d\", &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    if (m == 1 && n != 1) {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum += a[0][1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\\n\", a[0][0]);\n    }\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 1; j < n - 1; j++) {\n        sum += a[0][j] + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0] + a[i][n - 1];\n      }\n      sum = sum + a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11096", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, row, q, col, i, j, *a, *num;\n  cin >> k;\n  num = (int *)malloc(k * sizeof(int));\n  for (q = 0; q < k; q++) {\n    int sum = 0;\n    scanf(\"%d %d\", &row, &col);\n    a = (int *)malloc(row * col * sizeof(int));\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", a + i * col + j);\n        if (i == 0 || j == 0 || i == row - 1 || j == col - 1)\n          sum = sum + *(a + i * col + j);\n      }\n    *(num + q) = sum;\n    free(a);\n  }\n  for (q = 0; q < k; q++)\n    printf(\"%d\\n\", *(num + q));\n  free(num);\n  return 0;\n}\n"}
{"label": "6", "index": "11097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[1000], n[1000], i, a, b, x, sum;\n  scanf(\"%d\", &k);\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n    for (a = 0; a < m[i]; a++) {\n      for (b = 0; b < n[i]; b++) {\n        scanf(\"%d\", &x);\n        if (a == 0 || b == 0 || a == m[i] - 1 || b == n[i] - 1) {\n          sum += x;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, t, s = 0;\n  scanf(\"%d\", &k);\n  int a[100][100], b[k - 1];\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        } else {\n          if (j == 0 || j == n - 1)\n            s = s + a[i][j];\n        }\n      }\n    }\n    b[t] = s;\n    s = 0;\n  }\n  for (t = 0; t < k; t++)\n    printf(\"%d\\n\", b[t]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "11099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, i, j, l, m, n, x = 0, y = 0;\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        x = x + a[i][j];\n      }\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++) {\n        y = y + a[i][j];\n      }\n    }\n    cout << x - y << endl;\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11100", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, m, i, j, t, s;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        }\n\n        if ((j == 0 || j == n - 1) && i != 0 && i != m - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k; \n  for (int a = 0; a < k; a++) {\n    int m, n;\n    cin >> m >> n;\n    int A[100][100]; \n    int i, j;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> A[i][j]; \n      }\n    }\n    int(*p)[100]; \n    p = A;\n    int num = 0;\n    for (j = 0; j < n; j++) {\n      num = num + *(*p + j); \n    }\n\n    for (i = 1; i < m - 1; i++) \n    {\n      num = num + **(p + i) + *(*(p + i) + n - 1);\n    }\n\n    for (j = 0; j < n; j++) \n    {\n      num = num + *(*(p + m - 1) + j);\n    }\n\n    cout << num << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n;\n  int a[100][100];\n  int i;\n  int j;\n  int e;\n  int sum[100] = {0};\n  for (e = 0; e < k; e++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum[e] = sum[e] + a[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum[e] = sum[e] + a[i][n - 1];\n    }\n    for (j = n - 2; j >= 0; j--) {\n      sum[e] = sum[e] + a[m - 1][j];\n    }\n    for (i = m - 2; i > 0; i--) {\n      sum[e] = sum[e] + a[i][0];\n    }\n  }\n  for (e = 0; e < k; e++) {\n    cout << sum[e] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, e, f, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &e, &f);\n    int a[100][100];\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        a[i][j] = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < f; j++)\n        cin >> a[i][j];\n    for (i = 0; i < e; i++) {\n      h = h + a[i][0] + a[i][f - 1];\n    }\n    for (j = 1; j < f - 1; j++) {\n      h = h + a[0][j] + a[e - 1][j];\n    }\n    printf(\"%d \", h);\n    h = 0;\n    e = 0;\n    f = 0;\n  }\n}\n"}
{"label": "6", "index": "11104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n  if (m != 1)\n    for (k = n - 2; k >= 0; k--) {\n\n      s += a[m - 1][k];\n    }\n  if (n != 1)\n    for (i = m - 2; i > 0; i--) {\n      s += a[i][0];\n    }\n  cout << s << \"\\n\";\n}\n\nint main() {\n  int p, q;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, s[100][100], n[100], m[100], num[100];\n  int num1[100] = {0};\n  int num2[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n[i], &m[i]);\n    for (j = 0; j < n[i]; j++) {\n      for (l = 0; l < m[i]; l++) {\n        scanf(\"%d\", &s[j][l]);\n        num1[i] += s[j][l];\n      }\n    }\n    for (j = 1; j < n[i] - 1; j++) {\n      for (l = 1; l < m[i] - 1; l++) {\n        num2[i] += s[j][l];\n      }\n    }\n    num[i] = num1[i] - num2[i];\n  }\n  for (i = 0; i < k; i++) {\n    cout << num[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, h, i, j, a, b;\n  int s[100][100], r[100];\n  scanf(\"%d\", &k);\n  for (int t = 0; t <= k - 1; t++) {\n    h = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d\", &s[i][j]);\n      }\n    }\n    for (a = 0; a <= n - 1; a++)\n      h = h + s[0][a] + s[m - 1][a];\n\n    for (b = 1; b <= m - 2; b++) {\n      h = h + s[b][0] + s[b][n - 1];\n    }\n    r[t] = h;\n  }\n  for (int x = 0; x <= k - 1; x++) {\n    printf(\"%d\\n\", r[x]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n, sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    int i, j, a[100][100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if ((i == 0) || (i == m - 1) || (j == 0) || (j == n - 1))\n          sum = sum + a[i][j];\n        else\n          continue;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11108", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, row, col, j, k, sum;\n  cin >> n;\n  cin.get();\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    row = 0;\n    col = 0;\n    int a[103][103] = {0};\n    cin >> row >> col;\n    for (j = 0; j < row; j++)\n      for (k = 0; k < col; k++)\n        cin >> *(*(a + j) + k);\n    if ((row == 1) && (col == 1))\n      printf(\"%d\\n\", **a);\n    else {\n      for (k = 0; k < col; k++)\n        sum = sum + *(*a + k);\n      for (k = 0; k < col; k++)\n        sum = sum + *(*(a + row - 1) + k);\n      for (j = 0; j < row; j++)\n        sum = sum + **(a + j);\n      for (j = 0; j < row; j++)\n        sum = sum + *(*(a + j) + col - 1);\n      sum = sum - **a;\n      sum = sum - *(*(a + row - 1));\n      sum = sum - *(*a + col - 1);\n      sum = sum - *(*(a + row - 1) + col - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, ii, jj, t;\n  int s[10002] = {0};\n  int *k = s;\n  int sum = 0;\n  scanf(\"%d\", &jj);\n  for (i = 1; i <= jj; i++) {\n    scanf(\"%d %d\", &m, &n);\n    t = m * n;\n    for (ii = 1; ii <= t; ii++) {\n      k = k + 1;\n      scanf(\"%d\", k);\n      if (ii <= n || ii > (m - 1) * n || ii % n == 1 || ii % n == 0)\n        sum = sum + *k;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    k = s;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int k, i, j, l, m, n, x = 0, y = 0;\n  cin >> k;\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        x = x + a[i][j];\n      }\n    }\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= n - 1; j++) {\n        y = y + a[i][j];\n      }\n    }\n    cout << x - y << endl;\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l;\n  int m[100], n[100];\n  int sum[100] = {0};\n  int a[100][100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m[i], &n[i]);\n\n    for (j = 0; j < m[i]; j++) {\n      for (l = 0; l < n[i]; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (l = 0; l < n[i] - 1; l++) {\n      sum[i] += a[0][l][i];\n    }\n    for (j = 0; j < m[i] - 1; j++) {\n      sum[i] += a[j][n[i] - 1][i];\n    }\n    for (l = n[i] - 1; l > 0; l--) {\n      sum[i] += a[m[i] - 1][l][i];\n    }\n    for (j = m[i] - 1; j > 0; j--) {\n      sum[i] += a[j][0][i];\n    }\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, k, x;\n  x = 0;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (int row = 0; row < m; row++) {\n      for (int col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (int row = 0; row < m; row++) {\n      x += sz[row][0];\n    }\n    for (int col = 1; col < n; col++) {\n      x += sz[0][col];\n    }\n    for (int row = 1; row < m; row++) {\n      x += sz[row][n - 1];\n    }\n    for (int col = 1; col < n - 1; col++) {\n      x += sz[m - 1][col];\n    }\n    cout << x << \"\\n\";\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int k;\n  int sum = 0;\n  int i, j, l;\n  int m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    if (n == 1 && m == 1) {\n      cin >> sum;\n      cout << sum;\n      sum = 0;\n    } else {\n      for (j = 0; j < m; j++) {\n        for (l = 0; l < n; l++) {\n          scanf(\"%d\", *(a + j) + l);\n        }\n      }\n      for (l = 0; l < n; l++) {\n        sum = sum + *(*(a + 0) + l) + *(*(a + m - 1) + l);\n      }\n      for (l = 0; l < m; l++) {\n        sum = sum + *(*(a + l) + 0) + *(*(a + l) + n - 1);\n      }\n      sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0) -\n            *(*(a + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (t = 1; t <= n; t++)\n        cin >> a[j][t];\n    }\n    if (m == 1 && n == 1)\n      sum = a[1][1];\n    else\n      for (j = 1; j <= m; j++) {\n        sum = sum + a[j][1];\n        sum = sum + a[j][n];\n      }\n    for (t = 2; t < n; t++) {\n      sum = sum + a[1][t];\n      sum = sum + a[m][t];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++)\n    s += *(*(p + 1) + i);\n  for (i = 2; i <= m; i++)\n    s += *(*(p + i) + n);\n  for (i = n - 1; i >= 1; i--)\n    s += *(*(p + m) + i);\n  for (i = m - 1; i > 1; i--)\n    s += *(*(p + i) + 1);\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    printf(\"%d\\n\", juzhen(m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11116", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, j;\n  int m, n;\n  int a[10000];\n  int *p, r;\n  int sum = 0;\n\n  scanf(\"%d\\n\", &k);\n\n  int i;\n  p = a;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n\n    for (j = 0; j < 10000; j++)\n      *(p + j) = 0;\n\n    for (j = 0; j < m * n; j++)\n      scanf(\"%d\", &*(p + j));\n\n    for (j = 0; j < n; j++)\n      sum = sum + *(p + j);\n\n    for (r = 1; r < m - 1; r++) {\n      sum = sum + *(p + n * r) + *(p + n * r + n - 1);\n    }\n\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(p + (m - 1) * n + j);\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "11117", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int *p, *q, a, b, k, m = 0, i, j;\n  q = (int *)malloc(10000 * sizeof(int));\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    m = 0;\n    p = q;\n    scanf(\"%d %d\", &a, &b);\n    for (j = 0; j < a * b; j++) {\n      scanf(\"%d\", p + j);\n    }\n    for (j = 0; j < b; j++)\n      m += *(p + j) + *(p + a * b - 1 - j);\n    for (j = 1; j < a - 1; j++)\n      m += *(p + j * b) + *(p + j * b + b - 1);\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k >= 1) {\n    int m, n, i, j, *p = NULL, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (p = a[0]; p < a[0] + n; p++) \n      sum = sum + *p;\n    for (p = a[0]; p <= a[m - 1]; p += 100) \n      sum = sum + *p;\n    for (p = a[m - 1]; p < a[m - 1] + n; p++) \n      sum = sum + *p;\n    for (p = a[0] + n - 1; p <= a[m - 1] + n - 1; p += 100) \n      sum = sum + *p;\n    cout << sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1] << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11119", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j1, j2, e1, e2, sum;\n  int juzhen[100][100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (j1 = 0; j1 < m; j1++) {\n      for (e1 = 0; e1 < n; e1++) {\n        cin >> juzhen[j1][e1];\n      }\n    }\n    sum = 0;\n    for (j2 = 0; j2 < n; j2++) {\n      sum = sum + juzhen[0][j2] + juzhen[m - 1][j2];\n    }\n    for (e2 = 1; e2 < m - 1; e2++) {\n      sum = sum + juzhen[e2][0] + juzhen[e2][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, row, col, ROW, sz[100][100], COL, sum[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n  }\n  for (i = 0; i < k; i++) {\n    cin >> ROW >> COL;\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    if (ROW == 1 && COL == 1) {\n      sum[i] = sum[i] + sz[0][0];\n    } else {\n      for (col = 0; col < COL; col++) {\n        sum[i] = sum[i] + sz[0][col] + sz[ROW - 1][col];\n      }\n      for (row = 1; row < (ROW - 1); row++) {\n        sum[i] = sum[i] + sz[row][0] + sz[row][COL - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  scanf(\"%d\", &k);\n  return 0;\n}\n"}
{"label": "6", "index": "11121", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar name[100];\ndouble s[100];\nint num[1000][1000];\nint main() {\n  int i = 0, j = 0, n, m, sum = 0, k = 0, flag = 0, p = 0, a = 0, c = 0, b = 0,\n      q = 0;\n\n  scanf(\"%d\", &a);\n\n  while (p < a) {\n    scanf(\"%d%d\", &n, &m);\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        cin >> num[i][j];\n        if (i == 0)\n          sum += num[i][j];\n        if (i == n - 1)\n          sum += num[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < n - 1; j++) {\n        if (i == 0)\n          sum += num[j][i];\n        if (i == m - 1)\n          sum += num[j][i];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    p++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k >= 1) {\n    int m, n, i, j, *p = NULL, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (p = a[0]; p < a[0] + n; p++)\n      sum = sum + *p;\n    for (p = a[0]; p <= a[m - 1]; p += 100)\n      sum = sum + *p;\n    for (p = a[m - 1]; p < a[m - 1] + n; p++) {\n      sum = sum + *p;\n    }\n    for (p = a[0] + n - 1; p <= a[m - 1] + n - 1; p += 100) {\n      sum = sum + *p;\n    }\n    cout << sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1] << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  int a, b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    sum = 0;\n    int c[100][100][100];\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++)\n        scanf(\"%d \", &c[i][j][k]);\n    }\n    for (j = 0; j < a; j++)\n      sum += c[i][j][0] + c[i][j][b - 1];\n    for (k = 0; k < b; k++)\n      sum += c[i][0][k] + c[i][a - 1][k];\n    sum =\n        sum - c[i][0][0] - c[i][0][b - 1] - c[i][a - 1][0] - c[i][a - 1][b - 1];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], k, n, m;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    int *p = a[0];\n    for (; p < a[0] + n; p++)\n      sum += *p;\n    if (m == 1) {\n      cout << sum << endl;\n      continue;\n    }\n    p = a[m - 1];\n    for (; p < a[m - 1] + n; p++)\n      sum += *p;\n    int(*q)[100] = a + 1;\n    for (; q <= a + m - 2; q++)\n      sum += **q + *((*q) + n - 1);\n    if (n == 1) {\n      cout << (sum - a[0][0] - a[m - 1][0]) / 2 + a[0][0] + a[m - 1][0];\n      continue;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11125", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, a[100][100], s, q[100], h1, h2, t, l1, l2, c;\n  scanf(\"%d\", &k);\n  for (i = 1, t = 0; i <= k, t < k; i++, t++) {\n    h1 = 0, h2 = 0, t, l1 = 0, l2 = 0;\n    scanf(\"%d%d\", &m, &n);\n\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &a[0][0]);\n      q[t] = a[0][0];\n    }\n\n    if (m == 1 && n > 1) {\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", &a[0][i]);\n\n      for (c = 0, i = 0; i < n; i++)\n        c = c + a[0][i];\n      q[t] = c;\n    }\n\n    if (n > 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++)\n          cin >> a[i][j];\n      }\n      for (j = 0; j < n; j++) {\n        h1 = h1 + a[0][j];\n      }\n      for (j = 0; j < n; j++)\n        h2 = h2 + a[m - 1][j];\n\n      for (i = 1; i < m - 1; i++) {\n        l1 = l1 + a[i][0];\n      }\n      for (i = 1; i < m - 1; i++) {\n        l2 = l2 + a[i][n - 1];\n      }\n      q[t] = h1 + h2 + l1 + l2;\n    }\n\n    if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++)\n        scanf(\"%d\", &a[i][0]);\n\n      for (c = 0, i = 0; i < m; i++)\n        c = c + a[i][0];\n      q[t] = c;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[100][2], i, j, k, a[100][100] = {0}, *p = NULL, sum = 0, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> num[k][0] >> num[k][1];\n    sum = 0;\n    for (i = 0; i < num[k][0]; i++) {\n      for (j = 0; j < num[k][1]; j++)\n        cin >> a[i][j];\n    }\n    for (m = 0; m < num[k][0]; m++) {\n      if (m == 0 || m == num[k][0] - 1) {\n        for (p = a[m]; p < a[m] + num[k][1]; p++)\n          sum = sum + *p;\n      } else\n        sum = sum + a[m][0] + a[m][num[k][1] - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, k, i, j, row, col;\n  int sx_row, sx_col, s;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    scanf(\"%d %d\", &row, &col);\n    int sz[100][100];\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sx_row = row - 1;\n    sx_col = col - 1;\n    for (j = 0; j < sx_col; j++) {\n      s = s + sz[0][j];\n    }\n    for (i = 0; i < sx_row; i++) {\n      s = s + sz[i][sx_col];\n    }\n    for (j = sx_col; j > 0; j--) {\n      s = s + sz[sx_row][j];\n    }\n    for (i = sx_row; i > 0; i--) {\n      s = s + sz[i][0];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int kk, m, n, i, j, k, a[100][100], c[300];\n  scanf(\"%d\", &kk);\n  for (i = 0; i < kk; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    *(c + i) = 0;\n    if (m == 1 & n == 1)\n      *(c + i) = a[0][0];\n    else {\n      for (j = 1, k = 0; j < m; j++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = 1, j--; k < n; k++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (j = j - 1, k--; j >= 0; j--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = k - 1, j++; k >= 0; k--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < kk; i++)\n    cout << *(c + i) << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "11129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, r, l;\n  int sz[100][100];\n  s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &r);\n    scanf(\"%d\", &l);\n    for (int j = 0; j < r; j++) {\n      for (int k = 0; k < l; k++) {\n        scanf(\"%d\", &(sz[j][k]));\n        if ((j == 0) || (j == r - 1) || ((j != 0) && (k == 0)) ||\n            ((j != 0) && (k == l - 1))) {\n          s = s + sz[j][k];\n        }\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int a[][100], int m, int n) {\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < n; j++)\n      cin >> *(*(a + j) + i);\n}\nint main() {\n  int square[100][100];\n  int k, m, n;\n  cin >> k;\n  for (int i = 1; i <= k; i++) {\n    cin >> m >> n;\n    input(square, m, n);\n    int sum = 0;\n    for (int j = 0; j < m; j++)\n      sum = sum + *(*square + j) + *(*(square + n - 1) + j);\n    for (int j = 1; j < n - 1; j++)\n      sum = sum + **(square + j) + *(*(square + j) + m - 1);\n    if (m == 1)\n      sum = sum / 2;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum(int m, int n, int a[][100]) {\n  int i, sum = 0;\n  for (i = 0; i < n; i++) {\n    sum += *(*(a + m - 1) + i);\n    sum += *((*a) + i);\n  }\n  for (i = 1; i <= m - 2; i++) {\n    sum += **(a + i);\n    sum += *(*(a + i) + n - 1);\n  }\n  return sum;\n}\nint main() {\n  int m, n, i, k, j, p, a[100][100];\n  cin >> p;\n  for (i = 1; i <= p; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << sum(m, n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100], c[100], sum[100] = {0};\n  int i, j, k, p;\n  scanf(\"%d\", &k);\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &b[p], &c[p]);\n    for (i = 0; i < b[p]; i++) {\n      for (j = 0; j < c[p]; j++)\n        scanf(\"%d\", &a[p][i][j]);\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (i = 0, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (i = b[p] - 1, j = 0; j < c[p]; j++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = 0, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n    for (j = c[p] - 1, i = 1; i < b[p] - 1; i++)\n      sum[p] = sum[p] + a[p][i][j];\n  }\n  for (p = 0; p < k - 1; p++)\n    printf(\"%d\\n\", sum[p]);\n  printf(\"%d\", sum[k - 1]);\n  return 0;\n}\n"}
{"label": "6", "index": "11133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (int a = 0; a < m; a++) {\n      for (int b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    int s = 0, p = 0, q = 0, r = 0;\n    int sum = 0;\n    if (m >= 3 && n >= 3) {\n      for (int a = 0; a < m; a++) {\n        s = s + sz[a][0];\n        p = p + sz[a][n - 1];\n      }\n      for (int b = 1; b < n - 1; b++) {\n        q = q + sz[0][b];\n        r = r + sz[m - 1][b];\n      }\n      sum = r + s + p + q;\n    } else {\n\n      for (int a = 0; a < m; a++) {\n        for (int b = 0; b < n; b++) {\n          sum = sum + sz[a][b];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11134", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, x, i, j, sum;\n  int m, n;\n  int a[100][100], b[100];\n  cin >> k;\n  for (x = 0; x < k; x++) {\n    sum = 0;\n    cin >> m >> n;\n    if ((m >= 3) & (n >= 3)) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n        }\n      }\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n\n      for (i = 0; i < m; i++) {\n        sum += a[i][n - 1];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        sum += a[m - 1][j];\n      }\n      sum = sum - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n      b[x] = sum;\n    } else {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          scanf(\"%d\", &a[i][j]);\n          sum = sum + a[i][j];\n        }\n      }\n      b[x] = sum;\n    }\n  }\n  for (x = 0; x < k; x++)\n    printf(\"%d\\n\", b[x]);\n  return 0;\n}\n"}
{"label": "6", "index": "11135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int j, i, m, n, *pointer = NULL, a[100][100], sum = 0;\n  cin >> j;\n  for (i = 0; i < j; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    pointer = *a;\n    for (; pointer < *a + m * n; pointer++)\n      scanf(\"%d \", pointer);\n\n    for (pointer = *a; pointer < *a + m * n; pointer++) {\n      if (pointer >= *a && pointer <= *a + n - 1) {\n        sum += *pointer;\n        continue;\n      }\n      if ((pointer - *a) % n == 0) {\n        sum += *pointer;\n        sum += *(pointer + n - 1);\n        continue;\n      }\n      if (pointer >= *a + m * n - n && pointer < *a + m * n - 1) {\n        sum += *pointer;\n        continue;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sum1, sum2, sum3, sum4;\n  int i, j, l;\n  int a[100][100], b[100];\n\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++)\n      sum1 = sum1 + a[0][j];\n    for (i = 1; i < m; i++)\n      sum2 = sum2 + a[i][n - 1];\n    for (j = 0; j < n - 1; j++)\n      sum3 = sum3 + a[i - 1][j];\n    for (i = 1; i < m - 1; i++)\n      sum4 = sum4 + a[i][0];\n    b[l] = sum1 + sum2 + sum3 + sum4;\n  }\n  for (l = 1; l <= k; l++)\n    cout << b[l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "11137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, sum1, sum2, sum3, sum4, sum;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    int sz[100][100];\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d \", &sz[j][p]);\n      }\n    }\n    if (m != 1 && m != 2 && n != 1 && n != 2) {\n      sum1 = sum2 = sum3 = sum4 = 0;\n      for (p = 0; p < n; p++) {\n        sum1 += sz[0][p];\n      }\n      for (p = 0; p < n; p++) {\n        sum2 += sz[m - 1][p];\n      }\n      for (j = 0; j < m; j++) {\n        sum3 += sz[j][0];\n      }\n      for (j = 0; j < m; j++) {\n        sum4 += sz[j][n - 1];\n      }\n      printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4 - sz[0][0] - sz[0][n - 1] -\n                         sz[m - 1][0] - sz[m - 1][n - 1]);\n    } else {\n      sum = 0;\n      for (j = 0; j < m; j++) {\n        for (p = 0; p < n; p++) {\n          sum += sz[j][p];\n        }\n      }\n      cout << sum << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, jz[100][100], ROW, COL, h[100], y, i, row, col;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &ROW, &COL);\n    for (row = 0; row < ROW; row++) {\n      for (col = 0; col < COL; col++) {\n        scanf(\"%d\", &jz[row][col]);\n      }\n    }\n    y = 0;\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][0];\n    }\n    for (row = 0; row < ROW; row++) {\n      y += jz[row][COL - 1];\n    }\n\n    for (col = 0; col < COL; col++) {\n      y += jz[0][col];\n    }\n    for (col = 0; col < COL; col++) {\n      y += jz[ROW - 1][col];\n    }\n\n    h[i] =\n        y - jz[0][0] - jz[0][COL - 1] - jz[ROW - 1][0] - jz[ROW - 1][COL - 1];\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", h[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int row, col, j, l, sum = 0, num[100][100];\n    cin >> col >> row;\n    for (l = 0; l < col; l++) {\n      int *a = num[l];\n      for (j = 0; j < row; j++) {\n        scanf(\"%d\", a + j);\n        if (l == 0 || l == col - 1 || j == 0 || j == row - 1)\n          sum = sum + *(a + j);\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, n, sum, a[10001], *p;\n  scanf(\"%d\", &i);\n  while (i--) {\n    scanf(\"%d %d \", &m, &n);\n    for (p = a; p < a + m * n; p++)\n      scanf(\"%d\", p);\n    sum = 0;\n    for (p = a; p < a + n; p++)\n      sum += *p;\n    if (m != 1)\n      for (p = a + (m - 1) * n; p < a + m * n; p++)\n        sum += *p;\n    for (p = a + n; p < a + (m - 1) * n; p += n)\n      sum += *p;\n    for (p = a + n * 2 - 1; p < a + m * n - 1; p += n)\n      sum += *p;\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, h, a[1000][1000] = {0}, result;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    result = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (j = 0; j < n; j++)\n      result = result + a[0][j] + a[m - 1][j];\n    for (i = 1; i < m - 1; i++)\n      result = result + a[i][0] + a[i][n - 1];\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, m, n, s;\n  scanf(\"%d\\n\", &x);\n  for (s = 0; s < x; s++) {\n    int a[100][100];\n    int i, j, k, q = 0, w = 0, e = 0, r = 0, sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (k = 0; k < n; k++) {\n      q += a[0][k];\n      w += a[m - 1][k];\n    }\n    k = 0;\n    for (k = 0; k < m; k++) {\n      e += a[k][0];\n      r += a[k][n - 1];\n    }\n    sum = q + w + e + r - a[0][0] - a[m - 1][n - 1] - a[0][n - 1] - a[m - 1][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, i, j, k, m, n;\n  int sum = 0;\n  scanf(\"%d\", &p);\n  int sz[100][100];\n  for (i = 0; i < p; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == 0 || j == (m - 1))\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == 0)\n          sum += sz[j][k];\n        else if (j != 0 && j != (m - 1) && k == (n - 1))\n          sum += sz[j][k];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sum = 0;\n  int h, l, a[100][100], i, j, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d\", &h, &l);\n    for (i = 0; i < h; i++) {\n      for (j = 0; j < l; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (h < 2 && l < 2) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < l; j++) {\n      sum += a[0][j];\n      sum += a[h - 1][j];\n    }\n    for (i = 0; i < h; i++) {\n      sum += a[i][0];\n      sum += a[i][l - 1];\n    }\n    sum = sum - a[0][0] - a[0][l - 1] - a[h - 1][0] - a[h - 1][l - 1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    } \n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11146", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], sz[100][100], i, j, k;\n  int m[100] = {0}, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> y[i];\n    for (j = 0; j < x[i]; j++) {\n      for (k = 0; k < y[i]; k++) {\n        scanf(\"%d\", &sz[j][k]);\n        if (j == x[i] - 1 || j == 0 || k == y[i] - 1 || k == 0) {\n          m[p] += sz[j][k];\n        }\n      }\n    }\n    p++;\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%d\\n\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, i, j, k, h, a[100], b[100], juzhen[100][100];\n  scanf(\"%d\", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d%d\", &(a[h]), &(b[h]));\n    for (i = 0; i < a[h]; i++) {\n      for (j = 0; j < b[h]; j++)\n        scanf(\"%d\", &(juzhen[i][j]));\n    }\n    for (i = 0; i < a[h]; i++) {\n      sum[h] = sum[h] + juzhen[i][0] + juzhen[i][b[h] - 1];\n    }\n    for (j = 1; j < b[h] - 1; j++)\n      sum[h] = sum[h] + juzhen[0][j] + juzhen[a[h] - 1][j];\n  }\n  for (h = 0; h < k; h++) {\n    cout << sum[h] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, matrix[100][100];\n  scanf(\"%d\", &k);\n  while (k > 0) {\n    k--;\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(matrix + i) + j);\n    }\n    if (m == 1 && n == 1)\n      printf(\"%d\\n\", **matrix);\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      printf(\"%d\\n\", sum);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += **(matrix + i);\n      printf(\"%d\\n\", sum);\n    } else {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      for (i = 0; i < n; i++)\n        sum += *(*(matrix + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        sum += (**(matrix + i) + *(*(matrix + i) + n - 1));\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100]; \n  int i, p, q;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (p = 0; p < m; p++) \n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    int sum = 0;\n    if (m <= 2 || n <= 2) { \n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum = sum + a[p][q];\n        }\n      }\n      cout << sum << endl;\n    } else { \n      int sum1 = 0, sum2 = 0;\n      sum = 0; \n      for (p = 0; p < m; p++) {\n        sum1 = a[p][0] + a[p][n - 1] + sum1;\n      }\n      for (q = 0; q < n; q++) {\n        sum2 = sum2 + a[0][q] + a[m - 1][q];\n      }\n      sum = sum1 + sum2 -\n            (a[0][0] + a[0][n - 1] + a[m - 1][0] +\n             a[m - 1][n - 1]); \n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11150", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint summer();\n\nint main(void) {\n  int counter, times, patty;\n  scanf(\"%d\", &times);\n\n  for (counter = 0; counter < times; counter++) {\n    patty = summer();\n    printf(\"%d \", patty);\n  }\n\n  return 0;\n}\n\nint summer() {\n  int m, n;\n  int line, row;\n\n  scanf(\"%d%d\", &line, &row);\n  int fib[1000][1000];\n\n  for (m = 0; m < line; m++) {\n    for (n = 0; n < row; n++) {\n      cin >> fib[m][n];\n    }\n  }\n  int sum = 0;\n  int i;\n  for (i = 0; i < row; i++) {\n    sum = sum + *((*fib) + i) + *(*(fib + line - 1) + i);\n  }\n\n  for (i = 1; i < line - 1; i++) {\n    sum = sum + *(*(fib + i)) + *(*(fib + i) + row - 1);\n  }\n\n  return sum;\n}\n"}
{"label": "6", "index": "11151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p, total;\n  int a[110][110] = {0};\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d %d \", &m, &n);\n    total = 0;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(a + i) + j);\n        if ((i == 1) || (i == m))\n          total = total + *(*(a + i) + j);\n      }\n    for (i = 2; i < m; i++)\n      total = total + *(*(a + i) + 1) + *(*(a + i) + n);\n    cout << total << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11152", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    int a[100][100], m, n;\n    int *p;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      p = &a[0][i];\n      sum += *p;\n    }\n    if (m != 1)\n      for (i = 0; i < n; i++) {\n        p = &a[m - 1][i];\n        sum += *p;\n      }\n    for (i = 1; i < m - 1; i++) {\n      p = a[i];\n      sum += *p;\n    }\n    for (i = 1; i < m - 1; i++) {\n      p = &a[i][n - 1];\n      sum += *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int k, n, m, i, j, x, sum; \n  cin >> k;                  \n  while (k--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> x; \n        if ((i == 1) || (i == m) || (j == 1) || (j == n))\n          sum = sum + x; \n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], i, j, l, s = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m; j++)\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    if (m == 1)\n      for (j = 1; j <= n; j++)\n        s = s + a[1][j];\n    else if (n == 1)\n      for (j = i; j <= m; j++)\n        s = s + a[j][1];\n    else {\n      for (j = 1; j <= m; j++) {\n        s = s + a[j][1] + a[j][n];\n        a[j][1] = 0;\n        a[j][n] = 0;\n      }\n      for (j = 2; j < n; j++) {\n        s = s + a[1][j] + a[m][j];\n        a[1][j] = 0;\n        a[m][j] = 0;\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n}\n"}
{"label": "6", "index": "11155", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, m, n, a, b, s[1000];\n  int sz[1000][1000];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n      }\n    }\n    s[i] = 0;\n    for (b = 0; b < n; b++) {\n      s[i] += sz[0][b];\n    }\n    for (a = 1; a < m; a++) {\n      s[i] += sz[a][n - 1];\n    }\n    for (b = n - 2; b >= 0; b--) {\n      s[i] += sz[m - 1][b];\n    }\n    for (a = m - 2; a >= 1; a--) {\n      s[i] += sz[a][0];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d \", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, m, i, j, t, s;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    cin >> m >> n;\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1) {\n          s = s + a[i][j];\n        }\n        if ((j == 0 || j == n - 1) && i != 0 && i != m - 1) {\n          s = s + a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++)\n    s += a[j][n - 1];\n\n  for (k = n - 2; k >= 0; k--) {\n\n    s += a[m - 1][k];\n  }\n\n  for (i = m - 2; i > 0; i--) {\n    s += a[i][0];\n  }\n  cout << s << \"\\n\";\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11158", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  int(*p)[100] = a;\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n\n        cin >> *(*(p + i) + j);\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100];\n  int i, j, r;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int b = 0, c = 0, d = 0, e = 0, sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (r = 0; r < n; r++)\n        scanf(\"%d\", &a[j][r]);\n    }\n    for (j = 0; j < m; j++) {\n      b += a[j][0];\n      d += a[j][n - 1];\n    }\n    for (r = 1; r < n - 1; r++) {\n      c += a[m - 1][r];\n      e += a[0][r];\n    }\n    sum = b + c + d + e;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  int a[100][100];\n  int sum;\n  int n[200];\n  int g;\n  int s[200];\n  for (g = 0; g <= t - 1; g++) {\n    cin >> s[g];\n    cin >> n[g];\n\n    int i;\n    int j;\n    for (i = 0; i <= s[g] - 1; i++)\n      for (j = 0; j <= n[g] - 1; j++) {\n        cin >> a[i][j];\n      }\n\n    sum = 0;\n    for (i = 0; i <= s[g] - 1; i++) {\n      sum = sum + **(a + i);\n      sum = sum + *(*(a + i) + n[g] - 1);\n    }\n    for (j = 0; j <= n[g] - 1; j++) {\n      sum = sum + *(*a + j);\n      sum = sum + *(*(a + s[g] - 1) + j);\n    }\n    sum = sum - **a - *(*(a + s[g] - 1) + n[g] - 1) - *(*a + n[g] - 1) -\n          **(a + s[g] - 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, sum[10000] = {0};\n  int a[100][100] = {0}, k;\n  int *p = sum, x, y;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (x != 1) {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j] + a[x - 1][j];\n      }\n      for (i = 1; i < x - 1; i++) {\n        *(p + k) += a[i][0] + a[i][y - 1];\n      }\n    } else {\n      for (j = 0; j < y; j++) {\n        *(p + k) += a[0][j];\n      }\n    }\n  }\n  for (; p < (sum + n); p++) {\n    printf(\"%d\\n\", *p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0; \n  int ans = 0, a = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++) \n      for (int l = 0; l < n; l++) {\n        cin >> a;\n        if (!l || l == (n - 1))\n          ans += a;\n        else if (!j || j == (m - 1))\n          ans += a;\n      }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, k, i, j, s = 0, m, n, *p[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        p[i][j] = (int *)malloc(1 * sizeof(int));\n        scanf(\"%d\", &*p[i][j]);\n        if (j == n - 1)\n          scanf(\"\\n\");\n      }\n    }\n    for (j = 0; j < n; j++)\n      s = s + (*p[0][j]) + (*p[m - 1][j]);\n    for (i = 1; i < m - 1; i++)\n      s = s + (*p[i][0]) + (*p[i][n - 1]);\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11164", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, line = 0, row = 0;\n  int a[102][102];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d \", &line, &row);\n    for (int j = 0; j < line; j++) {\n      for (int k = 0; k < row; k++)\n        cin >> *(*(a + j) + k);\n    }\n    if (line == 1 && row == 1) {\n      printf(\"%d\\n\", **a);\n      continue;\n    }\n    int plus =\n        **a + *(*a + row - 1) + **(a + line - 1) + *(*(a + line - 1) + row - 1);\n    for (int j = 1; j < line - 1; j++)\n      plus += **(a + j) + *(*(a + j) + row - 1);\n    for (int j = 1; j < row - 1; j++)\n      plus += *(*a + j) + *(*(a + line - 1) + j);\n    cout << plus << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, sum;\n  int i, j, l;\n  int a[101][101];\n  int m, n;\n  sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 1; j <= n; j++)\n      sum = sum + a[1][j] + a[m][j];\n    for (j = 2; j <= m - 1; j++) {\n      sum = sum + a[j][1] + a[j][n];\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, *sum, i, j, *q;\n  sum = (int *)malloc(100 * sizeof(int));\n  q = sum;\n  scanf(\"%d\", &k);\n  for (j = 0; j < k; j++, sum++) {\n    *sum = 0;\n    int *p, *p1;\n    p = (int *)calloc(1000, 100 * sizeof(int));\n    scanf(\"%d %d\", &m, &n);\n    p1 = p;\n    for (i = 0; i < m * n; i++)\n      scanf(\"%d\", p++);\n    for (i = 0, p = p1; i < m * n; i++, p++)\n      if (i < n || i % n == 0 || (i + 1) % n == 0 ||\n          (i < n * m && i > (n * (m - 1) - 1))) {\n        *sum = *sum + *p;\n      }\n  }\n  for (i = 0, sum = q; i < k - 1; i++)\n    printf(\"%d\\n\", *sum++);\n  cout << *sum;\n}\n"}
{"label": "6", "index": "11167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n;\n  int nums;\n  int jz[100][100] = {0};\n  scanf(\"%d\", &nums);\n  int i, j, k;\n  int sum;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      jz[i][j] = 0;\n  for (i = 0; i < nums; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &jz[j][k]);\n\n    for (j = 0; j < n; j++)\n      sum = sum + jz[0][j];\n    if (m - 1 != 0)\n      for (j = 0; j < n; j++)\n        sum = sum + jz[m - 1][j];\n    for (j = 1; j <= m - 2; j++)\n      sum = sum + jz[j][0];\n    if (n - 1 != 0)\n      for (j = 1; j <= m - 2; j++)\n        sum = sum + jz[j][n - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k, m, n;\n  int result[100];\n\n  int i, j, temp1 = 0, temp2 = 0, tempr = 0;\n  double temp3 = 0;\n\n  scanf(\"%d\", &k);\n\n  for (temp2 = 1; temp2 <= k; temp2++) {\n    scanf(\"%d%d\", &m, &n);\n    tempr = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> temp1;\n        if (i == 1 || i == m || j == 1 || j == n) {\n          tempr += temp1;\n        }\n      }\n    }\n    result[temp2] = tempr;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, l, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 0; j < n; j++) {\n      sum1 = sum1 + a[0][j];\n      if ((m - 1) != 0)\n        sum2 = sum2 + a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum3 = sum3 + a[i][0];\n      if ((n - 1) != 0)\n        sum4 = sum4 + a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum1 + sum2 + sum3 + sum4);\n    sum1 = 0;\n    sum2 = 0;\n    sum3 = 0;\n    sum4 = 0;\n  }\n}\n"}
{"label": "6", "index": "11170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, s = 0, p = 0, r = 0, q = 0, sum;\n  scanf(\"%d\", &k);\n  int a[1000][1000];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 1; j <= n; j++) {\n      s = s + a[1][j];\n      q = q + a[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      p = p + a[j][1];\n      r = r + a[j][n];\n    }\n    sum = s + p + r + q - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum);\n    s = 0;\n    q = 0;\n    p = 0;\n    r = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, q, m, n, k, a[200][200], sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    } \n    int *pointer;\n    pointer = *a;\n    for (p = 0; p < n; p++) {\n      sum = sum + *(pointer + p);\n    }\n    for (p = 1; p < m - 1; p++) {\n      sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    for (p = 0; p < n; p++) {\n      sum = sum + *(*(a + m - 1) + p);\n    } \n\n    cout << sum << endl; \n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11172", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int line, row, sum;\n  int array[200][200];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> line >> row;\n    for (j = 0; j < line; j++)\n      for (k = 0; k < row; k++)\n        cin >> array[j][k];\n    sum = 0;\n    if (row == 1 || line == 1) {\n      for (j = 0; j < line; j++)\n        for (k = 0; k < row; k++)\n          sum = sum + array[j][k];\n      cout << sum << endl;\n    } else {\n      sum = 0 - array[0][0] - array[0][row - 1] - array[line - 1][0] -\n            array[line - 1][row - 1];\n      for (j = 0; j < line; j++)\n        sum = sum + array[j][0] + array[j][row - 1];\n      for (j = 0; j < row; j++)\n        sum = sum + array[0][j] + array[line - 1][j];\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n;\n  int a[100][100] = {0}, sum = 0;\n\n  cin >> k;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++)\n        scanf(\"%d\", *(a + j) + l);\n    sum = 0;\n    if (m != 1) {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j) + *(*(a + m - 1) + j);\n    } else {\n      for (j = 0; j < n; j++)\n        sum = sum + *(*a + j);\n    }\n    for (j = 1; j < m - 1; j++)\n      sum = sum + *(*(a + j)) + *(*(a + j) + n - 1);\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], k, n, m;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    int *p = a[0];\n    for (; p < a[0] + n; p++)\n      sum += *p;\n    if (m == 1) {\n      cout << sum << endl;\n      continue;\n    }\n    p = a[m - 1];\n    for (; p < a[m - 1] + n; p++)\n      sum += *p;\n    int(*q)[100] = a + 1;\n    for (; q <= a + m - 2; q++)\n      sum += **q + *((*q) + n - 1);\n    if (n == 1) {\n      cout << (sum - a[0][0] - a[m - 1][0]) / 2 + a[0][0] + a[m - 1][0];\n      continue;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *a, sum, i, k, n, m, j = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    a = (int *)malloc(sizeof(int) * (n * m));\n    for (j = 0; j < n * m; j++) {\n      scanf(\"%d\", a + j);\n      if ((j + 1 <= n) || (j > (n * m - n - 1)) || ((j + 1) % n == 1) ||\n          ((j + 1) % n == 0))\n        sum += *(a + j);\n    }\n    free(a);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[100][100], i, j, s, t, p, q;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    s = 0;\n    for (p = 0; p < m; p++)\n      for (q = 0; q < n; q++)\n        if (p == 0 || q == 0 || p == m - 1 || q == n - 1)\n          s = s + a[p][q];\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11177", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    int row, col, count = 0, i, j;\n    cin >> row >> col;\n    int str[101][101];\n    for (i = 1; i <= row; i++)\n      for (j = 1; j <= col; j++) {\n        cin >> *(*(str + i) + j);\n      }\n    for (i = 1; i <= col; i++)\n      count = count + *(*(str + 1) + i);\n    for (i = 2; i <= row; i++)\n      count = count + *(*(str + i) + col);\n    for (i = col - 1; i >= 1; i--)\n      count = count + *(*(str + row) + i);\n    for (i = row - 1; i >= 2; i--)\n      count = count + *(*(str + i) + 1);\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  cin >> k;\n  for (int p = 0; p < k; p++) {\n    int sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    if (n == 1 && m != 1) {\n      for (i = 0; i < m; i++) {\n        sum = sum + a[i][0];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n != 1) {\n      for (i = 0; i < n; i++) {\n        sum = sum + a[0][i];\n      }\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      cout << a[0][0] << endl;\n    } else {\n\n      for (i = 0; i < n; i++) {\n        sum1 = sum1 + a[0][i];\n        sum2 = sum2 + a[m - 1][i];\n      }\n      for (i = 0; i < m; i++) {\n        sum3 = sum3 + a[i][0];\n        sum4 = sum4 + a[i][n - 1];\n      }\n      sum = sum1 + sum2 + sum3 + sum4 -\n            (a[0][0] + a[0][n - 1] + a[m - 1][0] + a[m - 1][n - 1]);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f() {\n  int a = 0, i, j, m, n, (*p)[100];\n  scanf(\"%d %d\", &m, &n);\n  p = (int(*)[100])malloc(m * 100 * sizeof(int));\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(p + i) + j);\n  for (j = 0; j < n; j++)\n    a = a + *(*p + j) + *(*(p + m - 1) + j);\n  for (i = 1; i < m - 1; i++)\n    a = a + *(*(p + i)) + *(*(p + i) + n - 1);\n  printf(\"%d\\n\", a);\n}\nint main() {\n  int c, k;\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++)\n    f();\n}\n"}
{"label": "6", "index": "11180", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[m][n];\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int s = 0;\n    for (int i = 0; i < n; i++) {\n      s += *(*(a) + i);\n    }\n    if (m > 1)\n      for (int i = 0; i < n; i++) {\n        s += *(*(a + m - 1) + i);\n      }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + 0);\n    }\n    for (int i = 1; i < m - 1; i++) {\n      s += *(*(a + i) + n - 1);\n    }\n    cout << s;\n    if (i != k - 1)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, m, n, num, sum = 0;\n\n  scanf(\"%d \", &num);\n  for (k = 1; k <= num; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n\n    if (m == 1 || n == 1) {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++) {\n          sum = sum + *(*(a + i) + j);\n        }\n    } else {\n      for (i = 0; i < n - 1; i++) {\n        sum = sum + *(*a + i);\n      }\n      for (i = 0; i < m - 1; i++) {\n        sum = sum + *(*(a + i) + n - 1);\n      }\n      for (i = 1; i < n; i++) {\n        sum = sum + *(*(a + m - 1) + i);\n      }\n      for (i = 1; i < m; i++) {\n        sum = sum + **(a + i);\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n, **p, a, b, sum;\n    scanf(\"%d%d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (a = 0; a < m; a++)\n      p[a] = (int *)malloc(n * sizeof(int));\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d\", *(p + a) + b);\n    }\n    sum = 0;\n    for (b = 0; b < n; b++)\n      sum = sum + *(*p + b) + *(*(p + m - 1) + b);\n    for (a = 1; a < m - 1; a++)\n      sum = sum + **(p + a) + *(*(p + a) + n - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int tol, i, j, sum, k, x[100][100], row, line;\n  scanf(\"%d\", &tol);\n  for (k = 0, sum = 0; k < tol; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &row, &line);\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        cin >> x[i][j];\n      }\n    }\n    if (line == 1) {\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n      }\n    } else {\n\n      for (i = 0; i < row; i++) {\n        sum += x[i][0];\n        sum += x[i][line - 1];\n      }\n    }\n    if (row == 1) {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n      }\n    } else {\n      for (i = 1; i < line - 1; i++) {\n        sum += x[0][i];\n        sum += x[row - 1][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11184", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int mat[100][100];\n  int t, m, n, i, j, sum;\n  scanf(\"%d \", &t);\n  for (; t > 0; t--) {\n    memset(mat, 0, sizeof(mat));\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> mat[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += mat[i][j];\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k, m, n, a[110][110], sum = 0;\n  cin >> k;\n  for (int t = 0; t < k; t++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j); \n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += *(*(a) + i);\n      cout << sum << endl;\n      continue;\n    }\n    for (int i = 0; i < n; i++)\n      sum = sum + *(*(a) + i) + *(*(a + m - 1) + i); \n    for (int i = 0; i < m; i++)\n      sum = sum + *(*(a + i)) + *(*(a + i) + n - 1); \n    cout << sum - *(*(a)) - *(*(a) + n - 1) - *(*(a + m - 1)) -\n                *(*(a + m - 1) + n - 1)\n         << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int k;\n  int sum = 0;\n  int i, j, l;\n  int m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &sum);\n      printf(\"%d\", sum);\n      sum = 0;\n    } else {\n      for (j = 0; j < m; j++) {\n        for (l = 0; l < n; l++) {\n          scanf(\"%d\", *(a + j) + l);\n        }\n      }\n      for (l = 0; l < n; l++)\n        sum = sum + *(*(a + 0) + l) + *(*(a + m - 1) + l);\n\n      for (l = 0; l < m; l++) {\n        sum = sum + *(*(a + l) + 0) + *(*(a + l) + n - 1);\n      }\n      sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0) -\n            *(*(a + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, s[100] = {0}, i, j, len, col, m, sum = 0;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d\", &len, &col);\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n        sum += sz[i][j];\n      }\n    }\n    if (col == 1 || len == 1) {\n      s[m] = sum;\n    } else {\n      for (j = 0; j < col - 1; j++) {\n        s[m] += sz[0][j];\n      }\n      for (i = 0; i < len - 1; i++) {\n        s[m] += sz[i][col - 1];\n      }\n      for (j = 1; j < col; j++) {\n        s[m] += sz[len - 1][j];\n      }\n      for (i = 1; i < len; i++) {\n        s[m] += sz[i][0];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\nint n, m;\nint sum(int a[1000][1000]) {\n  int sum = 0;\n  for (int i = 0; i < n; i++)\n    sum += *(a[0] + i);\n\n  for (int i = 1; i < m; i++)\n    sum += *(a[i] + (n - 1));\n\n  for (int i = n - 2; i >= 0; i--)\n    sum += *(a[m - 1] + i);\n\n  for (int i = m - 2; i >= 1; i--)\n    sum += *(a[i] + 0);\n  return sum;\n}\nint main() {\n  int k;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> array_1[j][k];\n    cout << sum(array_1) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sum();\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    sum();\n  return 0;\n}\nvoid sum() {\n  int m, n, i, j, s = 0, a[101][101];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < m; i++)\n    s = s + a[i][0];\n  for (i = 0; i < m; i++)\n    s = s + a[i][n - 1];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[0][i];\n  for (i = 1; i < n - 1; i++)\n    s = s + a[m - 1][i];\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "6", "index": "11190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint map_1[100][100];\nint m, n;\nvoid count() {\n  int i, j;\n  int sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + j == j || i + j == i || i + j == i + n - 1 ||\n          i + j == j + m - 1) {\n        sum = sum + map_1[i][j];\n      }\n    }\n  }\n  cout << sum << endl;\n}\nint main() {\n  int sum;\n  int k = 0;\n  cin >> sum;\n  int i, j;\n  for (k = 0; k < sum; k++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &map_1[i][j]);\n      }\n    }\n    count();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11191", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p[400], m, n, a, i, j, k, l, sum, counter, b, matrix[100][100];\n  cin >> a;\n  for (k = 0; k < a; k++) {\n    sum = 0;\n    counter = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &matrix[i][j]);\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {\n          p[counter] = &matrix[i][j];\n          counter++;\n        }\n      }\n    }\n    for (l = 0; l < counter; l++)\n      sum += *p[l];\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bian(int a, int b);\n  int n, i, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a, &b);\n    printf(\"%d\\n\", bian(a, b));\n  }\n  return 0;\n}\nint bian(int a, int b) {\n  int c[10000], *p, i, j;\n  int s = 0;\n  for (p = c, i = 0; i < a * b; i++, p++)\n    scanf(\"%d\", p);\n\n  for (p = c, i = 0; i < a * b;) {\n    if (i == 0) {\n      for (j = 0; j < b; j++) {\n        s = s + *p;\n        p++;\n        i++;\n      }\n    }\n    if (i < (a - 1) * b) {\n      for (; i <= (a - 1) * b - 1; i++, p++) {\n        if (i % b == 0 || i % b == (b - 1)) {\n          s = s + *p;\n        }\n      }\n    }\n    if (i == (a - 1) * b) {\n      for (j = 0; j < b; j++, p++, i++) {\n        s = s + *p;\n      }\n    }\n  }\n  return s;\n}\n"}
{"label": "6", "index": "11193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[100][100][100], b[100][2], s[100], i, j, l, x, y;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    x = b[i][0];\n    y = b[i][1];\n    s[i] = 0;\n    for (j = 0; j < x; j++) {\n      for (l = 0; l < y; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n        if (j == 0 || l == 0 || j == x - 1 || l == y - 1)\n          s[i] += a[j][l][i];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, sz[200][200], result = 0;\n  cin >> k;\n  int i, p, q;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n      if (p == 0 || p == m - 1) {\n        for (q = 0; q < n; q++) {\n          result += sz[p][q];\n        }\n\n      } else {\n        result += sz[p][0];\n        result += sz[p][n - 1];\n      }\n    }\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11195", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nconst int N = 110;\n\nint a[N][N];\n\nint main() {\n  int i, j, k;\n  int x;\n  int m, n;\n  scanf(\"%d \", &x);\n  while (x--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    } else {\n      for (i = 0; i < n; i++) {\n        sum += a[0][i];\n        sum += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n, sum = 0;\n  int i, j, p;\n  for (p = 0; p < k; p++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[m][n];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    for (i = 0, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (i = m - 1, j = 0; j < n; j++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = 0, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    for (j = n - 1, i = 0; i < m; i++) {\n      sum = sum + sz[i][j];\n    }\n    sum = sum - sz[0][0] - sz[m - 1][0] - sz[m - 1][n - 1] - sz[0][n - 1];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, k, sum;\n  int a[100][100];\n  cin >> k;\n  while (k > 0) {\n    sum = 0;\n    k--;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (j = 0; j < n; j++) {\n      if (m == 1)\n        sum += *(*a + j);\n      else\n        sum += *(*a + j) + *(*(a + m - 1) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += a[i][0] + a[i][n - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], b[100][100], c[100] = {0}, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++) {\n      for (k = 0; k < a[i][1]; k++) {\n        scanf(\"%d\", &b[j][k]);\n      }\n    }\n    for (j = 0; j < a[i][1]; j++)\n      c[i] = c[i] + b[0][j];\n    for (j = 0; j < a[i][1] && a[i][0] != 1; j++)\n      c[i] += b[a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      c[i] = c[i] + b[j][0];\n    for (j = 1; j < a[i][0] - 1 && a[i][1] != 1; j++)\n      c[i] += b[j][a[i][1] - 1];\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        b[j][k] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", c[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "11199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    int m, n, a, b, sp = 0;\n    cin >> m >> n;\n    for (a = 0; a <= m - 1; a++) {\n      for (b = 0; b <= n - 1; b++) {\n        scanf(\"%d\", &(sz[a][b]));\n        sp = sp + sz[a][b];\n      }\n    }\n    int sum = 0;\n    for (b = 0; b <= n - 1; b++) {\n      sum = sum + sz[0][b] + sz[m - 1][b];\n    }\n    for (a = 0; a <= m - 1; a++) {\n      sum = sum + sz[a][0] + sz[a][n - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    if (m == 1 || n == 1) {\n      sum = sp;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n\n  for (k = n - 2; k >= 0; k--) {\n\n    s += a[m - 1][k];\n  }\n\n  for (i = m - 2; i > 0; i--)\n    s += a[i][0];\n\n  cout << s << \"\\n\";\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum[100], jz[100][100], h, l, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%d%d\", &h, &l);\n    for (j = 0; j < h; j++) {\n      for (k = 0; k < l; k++) {\n        scanf(\"%d\", &jz[j][k]);\n      }\n    }\n    for (p = 0; p < l - 1; p++) {\n      sum[i] = sum[i] + jz[0][p];\n    }\n    for (q = 0; q < h - 1; q++) {\n      sum[i] = sum[i] + jz[q][l - 1];\n    }\n    for (p = l - 1; p > 0; p--)\n      sum[i] = sum[i] + jz[h - 1][p];\n\n    for (q = h - 1; q > 0; q--) {\n      sum[i] = sum[i] + jz[q][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11202", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, size[100][2], m[100][100][100], i, j, l, sum[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    cin >> size[i][0] >> size[i][1];\n    for (j = 0; j < size[i][0]; j++)\n      for (l = 0; l < size[i][1]; l++)\n        scanf(\"%d\", &m[i][j][l]);\n\n    if ((size[i][1] == 1) && (size[i][0] == 1))\n      sum[i] = m[i][0][0];\n    else {\n      for (l = 0; l < size[i][1]; l++) {\n        if (size[i][1] == 1)\n          sum[i] = sum[i] + m[i][0][l];\n        else\n          sum[i] = sum[i] + m[i][0][l] + m[i][size[i][0] - 1][l];\n      }\n      for (j = 1; j <= size[i][0] - 2; j++) {\n        sum[i] = sum[i] + m[i][j][0] + m[i][j][size[i][1] - 1];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, k1, m, n, i, j, answer;\n  int sz[102][102];\n  scanf(\"%d\", &k);\n  for (k1 = 1; k1 <= k; k1++) {\n    answer = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m == 1 && n == 1)\n      answer = sz[1][1];\n    else if (m == 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j];\n      }\n    } else if (n == 1) {\n      for (i = 1; i <= m; i++) {\n        answer = answer + sz[i][1];\n      }\n    }\n    if (m != 1 && n != 1) {\n      for (j = 1; j <= n; j++) {\n        answer = answer + sz[1][j] + sz[m][j];\n      }\n      for (i = 2; i < m; i++) {\n        answer = answer + sz[i][1] + sz[i][n];\n      }\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, a[100][100], s, q[100], h1, h2, t, l1, l2, c;\n  scanf(\"%d\", &k);\n  for (i = 1, t = 0; i <= k, t < k; i++, t++) {\n    h1 = 0, h2 = 0, t, l1 = 0, l2 = 0;\n    scanf(\"%d%d\", &m, &n);\n\n    if (n == 1 && m == 1) {\n      scanf(\"%d\", &a[0][0]);\n      q[t] = a[0][0];\n    }\n\n    if (m == 1 && n > 1) {\n      for (i = 0; i < n; i++)\n        scanf(\"%d\", &a[0][i]);\n\n      for (c = 0, i = 0; i < n; i++)\n        c = c + a[0][i];\n      q[t] = c;\n    }\n\n    if (n > 1 && m > 1) {\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < n; j++) {\n          cin >> a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        h1 = h1 + a[0][j];\n      }\n      for (j = 0; j < n; j++) {\n        h2 = h2 + a[m - 1][j];\n      }\n      for (i = 1; i < m - 1; i++) {\n        l1 = l1 + a[i][0];\n      }\n      for (i = 1; i < m - 1; i++) {\n        l2 = l2 + a[i][n - 1];\n      }\n      q[t] = h1 + h2 + l1 + l2;\n    }\n\n    if (n == 1 && m > 1) {\n      for (i = 0; i < m; i++)\n        scanf(\"%d\", &a[i][0]);\n\n      for (c = 0, i = 0; i < m; i++)\n        c = c + a[i][0];\n      q[t] = c;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", q[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i;\n  int sz[100][100], sum, s[100];\n  int a, b, m, n;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &sz[a][b]);\n      }\n    }\n    for (b = 0; b < n; b++) {\n      sum += sz[0][b];\n      sum += sz[m - 1][b];\n    }\n    for (a = 1; a < m - 1; a++) {\n      sum += sz[a][0];\n      sum += sz[a][n - 1];\n    }\n    s[i] = sum;\n  }\n  for (i = 1; i <= k; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  for (int z = 0; z < num; z++) {\n    int a, b;\n    cin >> a >> b;\n    int juzhen[100][100];\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> juzhen[i][j];\n    int sum = 0;\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[0][i];\n    for (int j = 1; j < a - 1; j++) {\n      sum = sum + juzhen[j][0];\n      sum = sum + juzhen[j][b - 1];\n    }\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[a - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11207", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int p = 0, i = 0, j = 0, k = 0, n = 0, m = 0, *q = NULL;\n  cin >> k;\n  for (p = 1; p <= k; p++) {\n    cin >> m >> n;\n    int sum = 0, a[100];\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[j];\n      q = a;\n      while (q <= &a[n - 1]) {\n        if (i == 0 || i == m - 1) {\n          sum = sum + *q;\n          q++;\n        } else {\n          if (q == &a[0] || q == &a[n - 1])\n            sum = sum + *q;\n          q++;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11208", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid mk(void) {\n  int m, n, i, j, k, s = 0;\n  int a[100][100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  s = 0;\n  for (i = 0; i < n; i++) {\n    s += a[0][i];\n  }\n  for (j = 1; j < m; j++) {\n    s += a[j][n - 1];\n  }\n\n  for (k = n - 2; k >= 0; k--) {\n\n    s += a[m - 1][k];\n  }\n\n  for (i = m - 2; i > 0; i--) {\n    s += a[i][0];\n  }\n  printf(\"%d\\n\", s);\n}\n\nint main() {\n  int p, q, i;\n  scanf(\"%d\", &p);\n  for (q = 0; q < p; q++) {\n    mk();\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid juzhen(int m, int n) {\n  int a[100][100];\n  int i, j, sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + *(*(a) + j) + *(*(a + m - 1) + j);\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + *(*(a + i) + 0) + *(*(a + i) + n - 1);\n  }\n  if (m == 1) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      sum = sum + *(*a + i);\n  }\n  if (n == 1) {\n    sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + *(*(a + i) + 0);\n  }\n  cout << sum << \"\\n\";\n}\nint main() {\n  int k, i, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    juzhen(m, n);\n  }\n}\n"}
{"label": "6", "index": "11210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int K, i, j, k, m, n, a[100][100] = {0}, sum, p, q, result[100] = {0};\n  cin >> K;\n  for (i = 1; i <= K; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", *(a + j) + k);\n    if (m == 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    if (m > 1) {\n      for (q = 0; q < n; q++)\n        sum = sum + *(*(a + 0) + q) + *(*(a + m - 1) + q);\n      for (p = 1; p < m - 1; p++)\n        sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, m, n, i, j, k, sum = 0;\n  int a[100][100];\n  scanf(\"%d\", &s);\n  for (k = 0; k < s; k++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sum += a[0][i];\n    }\n    if (m > 2) {\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    if (m > 1) {\n      for (i = 0; i < n; i++) {\n        sum += a[m - 1][i];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int i, j, k, r, p, t;\n  int m, n, s;\n\n  scanf(\"%d \", &t);\n  for (p = 1; p <= t; p++) {\n    s = 0;\n    cin >> m >> n;\n\n    for (j = 1; j <= m; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << a[1][1];\n      continue;\n    }\n    for (i = 1; i <= n; i++) {\n      s = s + a[1][i] + a[m][i];\n    }\n    for (r = 1; r <= m; r++) {\n      s = s + a[r][1] + a[r][n];\n    }\n    s = s - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[100][100];\n  int i, j, sum = 0;\n  scanf(\"%d \", &group);\n  while (group--) {\n    scanf(\"%d %d \", &row, &col);\n    for (i = 0; i < row; i++)\n      for (j = 0; j < col; j++)\n        cin >> a[i][j];\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = a[0][0];\n    else {\n      for (i = 0; i < col; i++) {\n        sum += a[0][i];\n        if (row > 1)\n          sum += a[row - 1][i];\n      }\n      for (i = 1; i <= row - 2; i++) {\n        sum += a[i][0];\n        if (col > 1)\n          sum += a[i][col - 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, n, a[100][100];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    int r, s;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        cin >> a[r][s];\n    int sum = 0;\n    for (r = 0; r < m; r++)\n      for (s = 0; s < n; s++)\n        if (r == 0 || r == m - 1 || s == 0 || s == n - 1)\n          sum = sum + a[r][s];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int k;\n  int sum = 0;\n  int i, j, l;\n  int m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    if (n == 1 && m == 1) {\n      cin >> sum;\n      printf(\"%d\", sum);\n      sum = 0;\n    } else {\n      for (j = 0; j < m; j++) {\n        for (l = 0; l < n; l++) {\n          scanf(\"%d\", *(a + j) + l);\n        }\n      }\n      for (l = 0; l < n; l++) {\n        sum = sum + *(*(a + 0) + l) + *(*(a + m - 1) + l);\n      }\n      for (l = 0; l < m; l++) {\n        sum = sum + *(*(a + l) + 0) + *(*(a + l) + n - 1);\n      }\n      sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + n - 1) - *(*(a + m - 1) + 0) -\n            *(*(a + m - 1) + n - 1);\n      printf(\"%d\\n\", sum);\n      sum = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11216", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n\n    int array[100][100];\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    if (m == 1 && n == 1)\n      sum = array[0][0];\n    else {\n      for (int k = 0; k != n - 1; k++)\n        sum += array[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += array[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += array[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += array[k][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, k, sum = 0, x, q, w, e, r;\n  int ss[100];\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (x = 0; x < k; x++) {\n    scanf(\"%d %d\", &m, &n);\n\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &sz[i][j]);\n      }\n    }\n    q = 0;\n    w = 0;\n    e = 0;\n    r = 0;\n    for (j = 0; j < n; j++) {\n      q = q + sz[0][j];\n    }\n    for (j = 0; j < n; j++) {\n      w = w + sz[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++)\n      e = e + sz[i][0];\n\n    for (i = 1; i < m - 1; i++) {\n      r = r + sz[i][n - 1];\n    }\n    sum = q + w + e + r;\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i;\n  int sz[100][100];\n  int row, col;\n  int add[100];\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    add[i] = 0;\n  }\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n\n    for (col = 0; col < n; col++) {\n      add[i] += sz[0][col];\n      add[i] += sz[m - 1][col];\n    }\n\n    for (row = 0; row < m; row++) {\n      add[i] += sz[row][0];\n      add[i] += sz[row][n - 1];\n    }\n\n    add[i] -= sz[0][0];\n    add[i] -= sz[m - 1][0];\n    add[i] -= sz[0][n - 1];\n    add[i] -= sz[m - 1][n - 1];\n  }\n\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", add[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, t, j, sum, m, n;\n  cin >> t;\n  for (j = 0; j < t; j++) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 1; i <= m * n; i++) {\n      scanf(\"%d\", &a);\n      if ((i <= n) || (i > (m * n - n)) || (i % n == 1) || (i % n == 0))\n        sum += a;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, number;\n  scanf(\"%d \", &number);\n  for (i = 0; i < number; i++) {\n    int m, n;\n    cin >> m >> n;\n    int a[100][100];\n    int *p = NULL, *q = NULL, i;\n    for (p = *a; p < *a + n * m; p++) {\n      cin >> *p;\n    }\n    int sum = 0;\n    for (p = *a; p < *a + n; p++)\n\n      sum = sum + *p;\n\n    if (m != 1) {\n      for (p = *a + (m - 1) * n; p < *a + m * n; p++) {\n        sum = sum + *p;\n      }\n    }\n    for (p = *a + n; p < *a + (m - 1) * n; p = p + n) {\n      sum = sum + *p + *(p + n - 1);\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11221", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100], m, n, k, i, j, q, s;\n  cin >> k;\n  int *sum = (int *)malloc(sizeof(int) * k);\n  s = 0;\n\n  for (q = 0; q < k; q++) {\n    sum[q] = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[0][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][0];\n    }\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[m - 1][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][n - 1];\n    }\n    sum[q] -= sz[0][0];\n    sum[q] -= sz[0][n - 1];\n    sum[q] -= sz[m - 1][0];\n    sum[q] -= sz[m - 1][n - 1];\n\n    printf(\"%d\\n\", sum[q]);\n  }\n\n  free(sum);\n  return 0;\n}\n"}
{"label": "6", "index": "11222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, a, b, m, n, k, i, j;\n  int num[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (a = 0; a < 100; a++) {\n      for (b = 0; b < 100; b++) {\n        num[a][b] = 0;\n      }\n    }\n    scanf(\"%d %d\", &m, &k);\n    if (m == 1 && k == 1) {\n      scanf(\"%d\", &j);\n      printf(\"%d\", j);\n    } else if (m == 1 && k != 1) {\n      for (a = 0; a < k; a++) {\n        scanf(\"%d\", &num[0][a]);\n        sum = sum + num[0][a];\n      }\n      cout << sum;\n    } else if (m != 1 && k == 1) {\n      for (a = 0; a < m; a++) {\n        scanf(\"%d\", &num[a][0]);\n        sum = sum + num[a][0];\n      }\n      printf(\"%d\", sum);\n    } else {\n      for (a = 0; a < m; a++) {\n        for (b = 0; b < k; b++) {\n          scanf(\"%d\", &num[a][b]);\n        }\n      }\n      for (a = 0; a < k; a++) {\n        sum = sum + num[0][a] + num[m - 1][a];\n      }\n      for (a = 1; a < (m - 1); a++) {\n        sum = sum + num[a][0] + num[a][k - 1];\n      }\n      printf(\"%d\\n\", sum);\n    }\n  }\n}\n"}
{"label": "6", "index": "11223", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l, n, m, t, i, j;\n  cin >> t;\n  for (l = 1; l <= t; l++) {\n    cin >> n >> m;\n    int sum = 0, a;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a);\n        if (i == 1 || j == 1 || i == n || j == m) {\n          sum += a;\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11224", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, s = 0, p = 0, r = 0, q = 0, sum;\n  scanf(\"%d\", &k);\n  int a[1000][1000];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[j][l];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      s = s + a[1][j];\n      q = q + a[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      p = p + a[j][1];\n      r = r + a[j][n];\n    }\n    sum = s + p + r + q - a[1][1] - a[m][1] - a[1][n] - a[m][n];\n    printf(\"%d\\n\", sum);\n    s = 0;\n    q = 0;\n    p = 0;\n    r = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11225", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int k, m, n;\n  int result[100];\n\n  int i, j, temp1 = 0, temp2 = 0, tempr = 0;\n  double temp3 = 0;\n\n  scanf(\"%d\", &k);\n\n  for (temp2 = 1; temp2 <= k; temp2++) {\n    scanf(\"%d%d\", &m, &n);\n    tempr = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &temp1);\n        if (i == 1 || i == m || j == 1 || j == n)\n          tempr += temp1;\n      }\n    }\n    result[temp2] = tempr;\n  }\n\n  for (i = 1; i <= k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  int juzhen[100][100];\n  int m = 0, n = 0;\n  cin >> k;\n  while (k > 0) {\n    m = 0;\n    n = 0;\n    memset(juzhen, 0, sizeof(juzhen));\n    scanf(\"%d %d \", &m, &n);\n    int i = 0, j = 0, sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> juzhen[i][j];\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen) + i);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen + m - 1) + i);\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j));\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j) + n - 1);\n    }\n    cout << sum << endl;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11227", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, sum;\n  int m;\n  int a[200][220];\n  scanf(\"%d\", &m);\n  for (k = 1; k <= m; k++) {\n    sum = 0;\n    int row, col;\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    for (i = 1; i <= row; i++)\n      sum = sum + a[i][1] + a[i][col];\n\n    for (j = 2; j <= col - 1; j++) {\n      sum = sum + a[1][j] + a[row][j];\n    }\n\n    if (row == 1)\n      sum /= 2;\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, line;\n  int i, j, judge = 0, t, T, sum;\n  scanf(\"%d\", &t);\n  for (T = 0; T < t; T++) {\n    sum = 0;\n    scanf(\"%d %d\", &row, &line);\n    if (row == 1 || line == 1) {\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++) {\n          scanf(\"%d\", (*(a + i) + j));\n        }\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          sum += *(*(a + i) + j);\n      cout << sum << \"\\n\";\n      return 0;\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        scanf(\"%d\", (*(a + i) + j));\n      }\n    }\n    for (i = 0; i < row; i++) {\n      sum += *(*(a + i) + 0);\n      sum += *(*(a + i) + line - 1);\n    }\n    for (j = 0; j < line; j++) {\n      sum += *(*(a + 0) + j);\n      sum += *(*(a + row - 1) + j);\n    }\n    sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + line - 1) -\n          *(*(a + row - 1) + line - 1) - *(*(a + row - 1) + 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l;\n  int k, n, m, a[100][100] = {0}, (*p)[100] = a, t = 0;\n  scanf(\"%d\", &k);\n  for (l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &n, &m);\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= m - 1; j++)\n        scanf(\"%d\", *(p + i) + j);\n\n    for (j = 0; j <= m - 1; j++) {\n      if (n != 1) {\n        t += *(*(p) + j);\n        t += *(*(p + n - 1) + j);\n      } else\n        t += *(*(p) + j);\n    }\n    for (i = 1; i <= n - 2; i++) {\n      if (m != 1) {\n        t += *(*(p + i));\n        t += *(*(p + i) + m - 1);\n      } else\n        t += *(*(p + i));\n    }\n    printf(\"%d \", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], num[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i][0] >> a[i][1];\n    num[i] = 0;\n    int b[100][100];\n    for (int j = 0; j < a[i][0]; j++) {\n      for (int k = 0; k < a[i][1]; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[0][j];\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[a[i][0] - 1][j];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][0];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][a[i][1] - 1];\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11231", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, l, b[101][101], sum[1000];\n  scanf(\"%d \", &k);\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> b[i][j];\n    }\n\n    sum[l] = 0;\n    for (j = 1; j <= n; j++)\n      sum[l] += b[1][j];\n    for (j = 1; j <= n; j++)\n      sum[l] += b[m][j];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][1];\n    for (i = 2; i < m; i++)\n      sum[l] += b[i][n];\n  }\n  if (k == 1)\n    cout << sum[1];\n  else {\n    cout << sum[1];\n    for (l = 2; l <= k; l++) {\n      cout << endl;\n      cout << sum[l];\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11232", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[100][100];\n  int n, sum, row, col;\n  int *point;\n  point = *array;\n  cin >> n;\n  for (; n > 0; n--) {\n    sum = 0;\n    cin >> row >> col;\n    for (point = *array; point < *array + row * col; point++)\n      cin >> *point;\n    point = *array;\n    for (; point < *array + col; point++) {\n      sum = sum + *point;\n    }\n    point--;\n    for (point = point + col; point < *array + row * col; point = point + col) {\n      sum = sum + *point;\n    }\n    point -= col;\n    for (point = point - 1; point >= *array + (row - 1) * col; point--)\n      sum = sum + *point;\n    point++;\n    for (point = point - col; point > *array; point = point - col)\n      sum = sum + *point;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int I, m, n, a[100][100];\n  int i, j, k, sum;\n  scanf(\"%d\", &I);\n  for (k = 0; k < I; k++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (i = 0; i < n; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][n - 1] - a[m - 1][0];\n    if ((m == n) && (m == 1))\n      sum = a[0][0];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, j1, j, n, c, k;\n  int a[100][100];\n  cin >> n;\n  int(*p)[100] = a;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    cin >> c >> k;\n    for (j = 0; j < c; j++) {\n      for (j1 = 0; j1 < k; j1++) {\n        scanf(\"%d\", &a[j][j1]);\n      }\n    }\n    for (j = 1; j < k - 1; j++)\n      sum += *(*p + j) + *(*(p + c - 1) + j);\n    if (k > 1)\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j)) + *(*(p + j) + k - 1);\n    else\n      for (j = 0; j < c; j++)\n        sum += *(*(p + j));\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, r, c, n;\n  int s[100][100];\n  int sum[100];\n  int sumr, sumc;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    sumr = 0;\n    sumc = 0;\n    scanf(\"%d %d\", &r, &c);\n    for (j = 0; j < r; j++)\n      for (k = 0; k < c; k++)\n        cin >> s[j][k];\n    if (r != 1 && c != 1) {\n      for (k = 0; k < c; k++)\n        sumr += s[0][k] + s[r - 1][k];\n      for (j = 0; j < r; j++)\n        sumc += s[j][0] + s[j][c - 1];\n      sum[i] =\n          sumr + sumc - s[0][0] - s[0][c - 1] - s[r - 1][0] - s[r - 1][c - 1];\n    }\n    if (r == 1 && c != 1)\n      for (k = 0; k < c; k++)\n        sum[i] += s[0][k];\n    if (c == 1 && r != 1)\n      for (j = 0; j < r; j++)\n        sum[i] += s[j][0];\n    if (c == 1 && r == 1)\n      sum[i] = s[0][0];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11236", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int k, m, n, a[100][100], sum, p, q;\n  int i, j, h;\n  cin >> k; \n  for (h = 1; h <= k; h++) {\n    cin >> m >> n;\n    p = 0; \n    q = 0; \n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];  \n        p = p + a[i][j]; \n      }\n    }\n    for (i = 2; i < m; i++) {\n      for (j = 2; j < n; j++)\n        q = q + a[i][j]; \n    }\n    sum = p - q; \n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int m, n, i, j, a, t;\n\n  scanf(\"%d\", &a);\n  for (t = 1; t <= a; t++) {\n    int s = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 1; i <= m; i++) {\n      s += sz[i][1];\n    }\n    for (i = 1; i <= m; i++) {\n      s += sz[i][n];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[1][i];\n    }\n    for (i = 1; i <= n; i++) {\n      s += sz[m][i];\n    }\n    s -= sz[1][1] + sz[1][n] + sz[m][1] + sz[m][n];\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m1[120], m2[120], a[100][120][120];\n  int i, j, k, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &m1[i], &m2[i]);\n    for (j = 0; j < m1[i]; j++)\n      for (k = 0; k < m2[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (m1[i] == 1) {\n      for (j = 0; j < m2[i]; j++)\n        s = s + a[i][0][j];\n    } else if (m2[i] == 1) {\n      for (j = 0; j < m1[i]; j++)\n        s = s + a[i][j][0];\n    } else {\n      for (j = 0; j < m2[i] - 1; j++)\n        s = s + a[i][0][j];\n      for (j = 0; j < m1[i] - 1; j++)\n        s = s + a[i][j][m2[i] - 1];\n      for (j = m2[i] - 1; j > 0; j--)\n        s = s + a[i][m1[i] - 1][j];\n      for (j = m1[i] - 1; j > 0; j--)\n        s = s + a[i][j][0];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int m, n, **p, a, b, sum;\n    cin >> m >> n;\n    p = (int **)malloc(m * sizeof(int *));\n    for (a = 0; a < m; a++)\n      p[a] = (int *)malloc(n * sizeof(int));\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++)\n        scanf(\"%d\", *(p + a) + b);\n    }\n    sum = 0;\n    for (b = 0; b < n; b++) {\n      sum = sum + *(*p + b) + *(*(p + m - 1) + b);\n    }\n    for (a = 1; a < m - 1; a++)\n      sum = sum + **(p + a) + *(*(p + a) + n - 1);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100], m, n, k, i, j, q, s;\n  scanf(\"%d\", &k);\n  int *sum = (int *)malloc(sizeof(int) * k);\n  s = 0;\n\n  for (q = 0; q < k; q++) {\n    sum[q] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[0][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][0];\n    }\n    for (i = 0; i < n; i++) {\n      sum[q] += sz[m - 1][i];\n    }\n    for (i = 0; i < m; i++) {\n      sum[q] += sz[i][n - 1];\n    }\n    sum[q] -= sz[0][0];\n    sum[q] -= sz[0][n - 1];\n    sum[q] -= sz[m - 1][0];\n    sum[q] -= sz[m - 1][n - 1];\n\n    printf(\"%d\\n\", sum[q]);\n  }\n\n  free(sum);\n  return 0;\n}\n"}
{"label": "6", "index": "11241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int i, j, p, q;\n  int N[100][100];\n  int m, n;\n  int sum = 0;\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = 1; p <= m; p++) {\n      for (q = 1; q <= n; q++) {\n        scanf(\"%d\", &N[p][q]);\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[1][j];\n    }\n    for (j = 1; j <= n; j++) {\n      sum += N[m][j];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][1];\n    }\n    for (j = 1; j <= m; j++) {\n      sum += N[j][n];\n    }\n    sum = sum - N[1][1] - N[1][n] - N[m][1] - N[m][n];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11242", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, i1, j1, i2, i3, j3, p = 0, q = 0, sum = 0;\n  scanf(\"%d\", &n);\n  for (i2 = 0; i2 <= n - 1; i2++) {\n    cin >> i >> j;\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        scanf(\"%d\", &a[i1][j1]);\n      }\n    }\n    for (i3 = 0; i3 <= j - 1; i3++) {\n      sum = sum + a[0][i3] + a[i - 1][i3];\n    }\n    for (j3 = 0; j3 <= i - 1; j3++) {\n      sum = sum + a[j3][0] + a[j3][j - 1];\n    }\n    sum = sum - a[0][j - 1] - a[i - 1][0] - a[i - 1][j - 1] - a[0][0];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    for (i1 = 0; i1 <= i - 1; i1++) {\n      for (j1 = 0; j1 <= j - 1; j1++) {\n        a[i1][j1] = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11243", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, n, i, j, x, y, sum, a[100][100];\n  cin >> n;\n  for (c = 1; c <= n; c++) {\n    sum = 0;\n    scanf(\"%d %d\", &x, &y);\n    for (i = 0; i < x; i++) {\n      for (j = 0; j < y; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][0];\n    for (i = 0; i < x; i++)\n      sum = sum + a[i][j - 1];\n    for (j = 0; j < y; j++)\n      sum = sum + a[0][j];\n    for (j = 0; j < y; j++) {\n      sum = sum + a[x - 1][j];\n    }\n    sum = sum - a[0][0] - a[x - 1][0] - a[0][y - 1] - a[x - 1][y - 1];\n    if (c != n) {\n      printf(\"%d\\n\", sum);\n    } else\n      printf(\"%d\", sum);\n  }\n}\n"}
{"label": "6", "index": "11244", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, i, j, k, m, n, u[100][100], s, d, x;\n  scanf(\"%d\", &k);\n\n  for (y = 1; y <= k; y++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &u[i][j]);\n      }\n    }\n    s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        s += u[i][j];\n      }\n    }\n    d = 0;\n    for (i = 1; i < m - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        d += u[i][j];\n      }\n    }\n    x = s - d;\n    printf(\"%d\\n\", x);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, k, i, j, row, col;\n  int sx_row, sx_col, s;\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    s = 0;\n    cin >> row >> col;\n    int sz[100][100];\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < col; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    sx_row = row - 1;\n    sx_col = col - 1;\n    for (j = 0; j < sx_col; j++) {\n      s = s + sz[0][j];\n    }\n    for (i = 0; i < sx_row; i++) {\n      s = s + sz[i][sx_col];\n    }\n    for (j = sx_col; j > 0; j--) {\n      s = s + sz[sx_row][j];\n    }\n    for (i = sx_row; i > 0; i--) {\n      s = s + sz[i][0];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][100], i, j, m, n, sum = 0;\n  scanf(\"%d \", &k);\n  for (int l = 0; l < k; l++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (j = 0; j < n; j++) {\n      sum = sum + a[0][j] + a[m - 1][j];\n      if (m - 1 == 0)\n        sum = sum - a[m - 1][j];\n    }\n    for (i = 1; i < m - 1; i++) {\n      sum = sum + a[i][0] + a[i][n - 1];\n      if (n - 1 == 0)\n        sum = sum - a[i][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, x[10000], sum = 0, *p;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (p = x; p < x + m * n; p++)\n      scanf(\"%d\", p);\n    for (p = x; p < x + n; p++)\n      sum = sum + *p;\n    for (p = x + (m - 1) * n; m != 1 && p < x + n * m; p++)\n      sum = sum + *p;\n    for (p = x + n; p < x + n * (m - 1); p = p + n)\n      sum = sum + *p;\n    for (p = x + n + n - 1; p < x + n * m - 1; p = p + n)\n      sum = sum + *p;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, p;\n  int matrix(int m, int n);\n  scanf(\"%d\", &p);\n  for (k = 0; k < p; k++) {\n    scanf(\"%d%d\", &m, &n);\n    printf(\"%d\\n\", matrix(m, n));\n  }\n}\n\nint matrix(int m, int n) {\n  int i, j, a, sum = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n        sum += a;\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "11249", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, sum, matrix[100][100];\n  scanf(\"%d\", &k);\n  while (k > 0) {\n    k--;\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(matrix + i) + j);\n    }\n    if (m == 1 && n == 1)\n      printf(\"%d\\n\", **matrix);\n    else if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      printf(\"%d\\n\", sum);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += **(matrix + i);\n      printf(\"%d\\n\", sum);\n    } else {\n      for (i = 0; i < n; i++)\n        sum += *(*matrix + i);\n      for (i = 0; i < n; i++)\n        sum += *(*(matrix + m - 1) + i);\n      for (i = 1; i < m - 1; i++)\n        sum += (**(matrix + i) + *(*(matrix + i) + n - 1));\n      printf(\"%d\\n\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11250", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, x, y, t, ans[1000] = {0};\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> x >> y;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= y; j++) {\n        cin >> t;\n        if ((i == 1) || (i == x) || (j == 1) || (j == y))\n          ans[k] += t;\n      }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << ans[i];\n    if (i != n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int a[100][100], r, l, sum = 0;\n    cin >> r >> l;\n    for (j = 0; j <= r - 1; j++)\n      for (k = 0; k <= l - 1; k++)\n        scanf(\"%d\", *(a + j) + k);\n    for (j = 0; j <= r - 1; j++) {\n      for (k = 0; k <= l - 1; k++) {\n        if (j == r - 1 || j == 0 || k == l - 1 || k == 0)\n          sum += *(*(a + j) + k);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  int a = 0, b = 0, c = 0, d = 0, e = 0;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      a += sz[i][0];\n      b += sz[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      c += sz[0][j];\n      d += sz[m - 1][j];\n    }\n    e = a + b + c + d - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n        sz[m - 1][n - 1];\n    printf(\"%d\\n\", e);\n    e = 0;\n    a = 0;\n    b = 0;\n    c = 0;\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11253", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, l;\n  int m, n, i, j, s1, s2, s3, s4, s;\n  int sz[100][100];\n  scanf(\"%d\", &k);\n  int *sf = (int *)malloc((sizeof(int) * k));\n  for (l = 0; l < k; l++) {\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> sz[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      s1 += sz[i][0];\n      s2 += sz[i][n - 1];\n    }\n    for (j = 0; j < n; j++) {\n      s3 += sz[0][j];\n      s4 += sz[m - 1][j];\n    }\n    s += s1 + s2 + s3 + s4 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] -\n         sz[m - 1][n - 1];\n    sf[l] = s;\n  }\n  for (l = 0; l < k; l++) {\n    printf(\"%d\\n\", sf[l]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, col[1000], row[1000], a[100][1000][1000], c, r, sum[1000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    cin >> col[i];\n    scanf(\"%d \", &row[i]);\n\n    for (c = 0; c < col[i]; c++) {\n      for (r = 0; r < row[i]; r++) {\n        cin >> a[i][c][r];\n      }\n    }\n\n    for (c = 0; c < row[i]; c++)\n      sum[i] = sum[i] + a[i][0][c] + a[i][col[i] - 1][c];\n    for (c = 1; c < col[i] - 1; c++)\n      sum[i] = sum[i] + a[i][c][0] + a[i][c][row[i] - 1];\n\n    cout << sum[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11255", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t, i, j, k, a[100][100][100], b[100] = {0}, m[100], n[100];\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++) {\n      for (k = 0; k < n[i]; k++)\n        cin >> a[i][j][k];\n    }\n    for (j = 0; j < m[i]; j++)\n      b[i] = b[i] + a[i][j][0] + a[i][j][n[i] - 1];\n    for (j = 0; j < n[i]; j++)\n      b[i] = b[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    b[i] = b[i] - a[i][0][0] - a[i][m[i] - 1][0] - a[i][0][n[i] - 1] -\n           a[i][m[i] - 1][n[i] - 1];\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k;\n  scanf(\"%d\", &k);\n  int s1 = 0, s2 = 0, s3 = 0, s4 = 0, s = 0;\n  int r = 0, c = 0;\n\n  int jz[100][100];\n  int m, n;\n  int i = 1;\n  while (i <= k) {\n    scanf(\"%d %d\", &m, &n);\n    for (int jm = 0; jm < m; jm++) {\n      for (int jn = 0; jn < n; jn++) {\n        scanf(\"%d\", &jz[jm][jn]);\n      }\n    }\n    r = 0;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s1 += jz[r][c];\n    }\n    r = m - 1;\n    c = 0;\n    for (c = 0; c < n; c++) {\n      s2 += jz[r][c];\n    }\n    r = 0;\n    c = 0;\n    for (r = 0; r < m; r++) {\n      s3 += jz[r][c];\n    }\n    r = 0;\n    c = n - 1;\n    for (r = 0; r < m; r++) {\n      s4 += jz[r][c];\n    }\n    s = s1 + s2 + s3 + s4 - jz[0][0] - jz[0][n - 1] - jz[m - 1][0] -\n        jz[m - 1][n - 1];\n    printf(\"%d\", s);\n    s1 = 0;\n    s2 = 0;\n    s3 = 0;\n    s4 = 0;\n    s = 0;\n\n    if (i != k) {\n      printf(\"\\n\");\n    }\n\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int row;\n    int col;\n    int total = 0;\n    int s[100][100];\n    scanf(\"%d%d\", &row, &col);\n    int x, y;\n    for (x = 0; x < row; x++) {\n      for (y = 0; y < col; y++) {\n        scanf(\"%d\", &s[x][y]);\n      }\n    }\n    if (row < 3 || col < 3) {\n      for (x = 0; x < row; x++) {\n        for (y = 0; y < col; y++) {\n          total += s[x][y];\n        }\n      }\n      cout << total << \"\\n\";\n    } else {\n      for (y = 0; y < col; y++) {\n        total += s[0][y];\n      }\n      for (y = 0; y < col; y++) {\n        total += s[row - 1][y];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][0];\n      }\n      for (x = 0; x < row; x++) {\n        total += s[x][col - 1];\n      }\n      total =\n          total - s[0][0] - s[0][col - 1] - s[row - 1][0] - s[row - 1][col - 1];\n      cout << total << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11258", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calcSum(int *matrix, int row, int col);\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *result = (int *)malloc(k * sizeof(int));\n  int i = 0;\n  int row, col;\n  int sum;\n  int m, n;\n  int *matrix;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    matrix = (int *)malloc(m * n * sizeof(int));\n    for (row = 0; row < m; row++)\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", matrix + row * n + col);\n    *(result + i) = calcSum(matrix, m, n);\n    free(matrix);\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d\\n\", *(result + i));\n\n  printf(\"%d\", *(result + i));\n  return 0;\n}\n\nint calcSum(int *matrix, int row, int col) {\n  int sum = 0;\n  int i, j;\n  for (i = 0; i < row; i++)\n    for (j = 0; j < col; j++) {\n      if (i == 0 || i == row - 1 || j == 0 || j == col - 1)\n        sum += *(matrix + i * col + j);\n    }\n  return sum;\n}\n"}
{"label": "6", "index": "11259", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[10000], i, k, a, b, n, s = 0;\n  int *p, *q;\n  p = c;\n  q = p;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    p = c;\n    q = p;\n    s = 0;\n    scanf(\"%d %d\", &b, &a);\n\n    for (i = 0; i < a * b; i++) {\n\n      scanf(\"%d\", &*p);\n      p++;\n    }\n    p = q;\n    for (i = 0; i < a; i++) {\n      s = s + *p;\n      p++;\n    }\n    p = q;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    p = q + a - 1;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    if (b != 1) {\n      p = q + a * (b - 1);\n      for (i = 0; i < a; i++) {\n\n        s = s + *p;\n        p = p + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "11260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int(*p)[100];\n    p = a;\n    int sum = 0;\n    cin >> m >> n;\n\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    if (m != 1 && n != 1) {\n      for (int l = 0; l < n; l++) {\n        sum += *(*p + l) + *(*(p + m - 1) + l);\n      }\n      for (int j = 1; j < m - 1; j++) {\n        sum += *(*(p + j)) + *(*(p + j) + n - 1);\n      }\n      cout << sum << endl;\n    } else\n      printf(\"%d\\n\", **p);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l, a[100][100][100], len[100], cro[100], b[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &len[i], &cro[i]);\n    for (j = 0; j < len[i]; j++) {\n      for (l = 0; l < cro[i]; l++)\n        scanf(\"%d\", &a[i][j][l]);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < cro[i]; j++) {\n      b[i] += a[i][0][j];\n    }\n    for (j = 1; j < len[i]; j++) {\n      b[i] += a[i][j][(cro[i] - 1)];\n    }\n    for (j = 0; j < cro[i] - 1; j++) {\n      b[i] += a[i][len[i] - 1][j];\n    }\n    for (j = 1; j < len[i] - 1; j++)\n      b[i] += a[i][j][0];\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n;\n  int a, b;\n  int juzhen[100][100];\n  cin >> n;\n  for (int m = 1; m <= n; m++) {\n    cin >> a >> b;\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> *(*(juzhen + i) + j);\n    int s = 0;\n    for (int i = 0; i < b; i++) {\n      s = juzhen[0][i] + s;\n      s = juzhen[a - 1][i] + s;\n    }\n    for (int j = 1; j < a - 1; j++) {\n      s = juzhen[j][0] + s;\n      s = juzhen[j][b - 1] + s;\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "6", "index": "11263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *pi, i = 0, j = 0, k = 1, sum = 0, n, m, z, t;\n  scanf(\"%d\", &k);\n\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    int *p = (int *)malloc((n * m) * sizeof(int));\n    pi = p;\n    for (z = 0; z < m * n; z++, pi++)\n      scanf(\"%d\", pi);\n    pi = p;\n\n    for (j = 0; j < m * n; pi++) {\n      j++;\n      if (j < n + 1 || j > ((m - 1) * n) || j % n == 1 || j % n == 0)\n        sum = sum + *pi;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, x, y, ans, a[101][101];\n  int(*p)[101] = a;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    ans = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (x = 0; x < m; x++)\n      for (y = 0; y < n; y++) {\n        cin >> *((*p + y) + x);\n        if (x == 0 || y == 0 || x == m - 1 || y == n - 1)\n          ans = ans + *((*p + y) + x);\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, x, m, n, i, j, k, sum[10000] = {0};\n  int sz[100][100];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> sz[j][k];\n      }\n    }\n    if ((m > 2) && (n > 2)) {\n      for (j = 0; j < m; j++) {\n        sum[i] = sum[i] + sz[j][0] + sz[j][n - 1];\n      }\n      for (k = 0; k < n; k++) {\n        sum[i] = sum[i] + sz[0][k] + sz[m - 1][k];\n      }\n      sum[i] =\n          sum[i] - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    } else {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < n; k++) {\n          sum[i] = sum[i] + sz[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, **p, i, j, sum, m, n, l;\n  scanf(\"%d\", &N);\n  for (l = 0, sum = 0; l < N; l++) {\n    cin >> m >> n;\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      *(p + i) = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "11267", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, k = 0, x, y, an[100][100], sum[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &x, &y);\n    for (j = 0; j < x; j++) {\n      for (k = 0; k < y; k++) {\n        cin >> an[j][k];\n        if (j == 0 || j == x - 1 || k == 0 || k == y - 1) {\n          sum[i] += an[j][k];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "11268", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 110;\n\nint a[N][N];\n\nint main() {\n  int i, j, k;\n  int x;\n  int m, n;\n  scanf(\"%d\", &x);\n  while (x--) {\n    memset(a, 0, sizeof(a));\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    if (m == 1) {\n      for (i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        sum += a[i][0];\n    } else {\n      for (i = 0; i < n; i++) {\n        sum += a[0][i];\n        sum += a[m - 1][i];\n      }\n      for (i = 1; i < m - 1; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int kk, m, n, i, j, k, a[100][100], c[300];\n  scanf(\"%d\", &kk);\n  for (i = 0; i < kk; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    *(c + i) = 0;\n    if (m == 1 & n == 1)\n      *(c + i) = a[0][0];\n    else {\n      for (j = 1, k = 0; j < m; j++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = 1, j--; k < n; k++) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (j = j - 1, k--; j >= 0; j--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n      for (k = k - 1, j++; k >= 0; k--) {\n        *(c + i) += *(*(a + j) + k);\n      }\n    }\n  }\n  for (i = 0; i < kk; i++)\n    printf(\"%d\\n\", *(c + i));\n  return 0;\n}\n"}
{"label": "6", "index": "11270", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sz[100][100];\n  int i, r, sum1, sum2, sum;\n  scanf(\"%d\", &k);\n  for (int j = 1; j <= k; j++) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++) {\n      for (r = 0; r < n; r++)\n        scanf(\"%d\", &sz[i][r]);\n    }\n    sum1 = 0;\n    for (int q = 0; q < n; q++) {\n      sum1 += sz[0][q] + sz[m - 1][q];\n    }\n    sum2 = 0;\n    for (int w = 0; w < m; w++)\n      sum2 += sz[w][n - 1] + sz[w][0];\n\n    sum =\n        sum1 + sum2 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11271", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, n, j, a, b, s[100] = {0}, f[100][100];\n  int *p = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        cin >> f[j][k];\n      }\n    }\n    for (j = 0; j < a; j++) {\n      p = f[j];\n      s[i] += *p;\n      p = f[j] + b - 1;\n      s[i] += *p;\n    }\n    for (k = 1; k < b - 1; k++) {\n      p = f[0] + k;\n      s[i] += *p;\n      p = f[a - 1] + k;\n      s[i] += *p;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11272", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, x, y, t, ans[1000] = {0};\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    cin >> x >> y;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= y; j++) {\n        cin >> t;\n        if ((i == 1) || (i == x) || (j == 1) || (j == y))\n          ans[k] += t;\n      }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\", ans[i]);\n    if (i != n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, i, m, p, q, sz[100][100], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n    }\n    if (m == 1 || n == 1) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum += sz[p][q];\n        }\n      }\n    } else {\n      for (q = 0; q <= n - 1; q++) {\n        sum += sz[0][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][n - 1];\n      }\n      for (q = 0; q < n; q++) {\n        sum += sz[m - 1][q];\n      }\n      for (q = 1; q < m - 1; q++)\n        sum += sz[q][0];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, p = 0, num[100][100], sum = 0;\n  scanf(\"%d \", &k);\n  while (p < k) {\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n\n    for (j = 0; j < n; j++)\n      sum += num[0][j];\n    for (i = 1; i < m - 1; i++) {\n      sum += num[i][0];\n      sum += num[i][n - 1];\n    }\n    for (j = 0; j < n; j++)\n      sum += num[m - 1][j];\n    cout << sum << endl;\n    sum = 0;\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][99][99] = {0}, m[100], n[100], k, i, j, l, sum[100] = {0}, leap;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j <= m[i] - 1; j++) {\n      for (l = 0; l <= n[i] - 1; l++) {\n        cin >> a[i][j][l];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (m[i] == 1 && n[i] == 1) {\n      sum[i] = a[i][0][0];\n    } else {\n      for (j = 0; j <= m[i] - 1; j++) {\n        sum[i] = a[i][j][0] + a[i][j][n[i] - 1] + sum[i];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (n[i] <= 2)\n      leap = 1;\n    else\n      leap = 0;\n    for (j = 1; j <= n[i] - 2; j++) {\n      if (leap)\n        break;\n      sum[i] = sum[i] + a[i][0][j] + a[i][m[i] - 1][j];\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, sz[200][200], result = 0;\n  scanf(\"%d\", &k);\n  int i, p, q;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[p][q]);\n      }\n      if (p == 0 || p == m - 1) {\n        for (q = 0; q < n; q++) {\n          result += sz[p][q];\n        }\n      } else {\n        result += sz[p][0];\n        result += sz[p][n - 1];\n      }\n    }\n    printf(\"%d\\n\", result);\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, x = 0, y = 0, temp = 0, sum = 0, i, j, m;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> x;\n    scanf(\"%d\", &y);\n    for (j = 0; j < x; j++) {\n      for (m = 0; m < y; m++) {\n        scanf(\"%d\", &temp);\n        if (j == 0 || m == 0 || j == x - 1 || m == y - 1) {\n          sum = sum + temp;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11278", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[200][200];\n  int *p[200];\n  for (int i = 0; i <= 200; i++)\n    p[i] = array[i];\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int m = 0, n = 0, sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> p[j][l];\n        if (j == 0 || l == 0 || j == m - 1 || l == n - 1)\n          sum += p[j][l];\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11279", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, x, a[100][100] = {{0, 0}}, m, n, i, j, sum = 0;\n  cin >> k;\n  for (x = 1; x <= k; x++) {\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n        if (i == 0 || j == 0 || i == (m - 1) || j == (n - 1)) {\n          sum = sum + a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint haha() {\n  int m, n, sum, i, j, a[105][105];\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &*(*(a + i) + j));\n\n  sum = 0;\n\n  if (m == 1)\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n  else if (n == 1)\n    for (i = 1; i <= m; i++)\n      sum = sum + *(*(a + i) + 1);\n  else {\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + 1) + j);\n\n    for (j = 1; j <= n; j++)\n      sum = sum + *(*(a + m) + j);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + 1);\n\n    for (i = 2; i <= m - 1; i++)\n      sum = sum + *(*(a + i) + n);\n  }\n\n  return (sum);\n}\nint main() {\n\n  int i, j, k, l, m, n, a[1050];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    *(a + i) = haha();\n\n  for (i = 1; i <= n; i++)\n    printf(\"%d\\n\", *(a + i));\n}\n"}
{"label": "6", "index": "11281", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  cin >> t;\n  while (t != 0) {\n    t--;\n    int m, n, i, j, sum = 0;\n    cin >> m >> n;\n    int a[100][100];\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n\n        if (i == 0)\n          sum = sum + a[i][j];\n        if (i == m - 1)\n          sum = sum + a[i][j];\n      }\n    for (i = 1; i < m - 1; i++) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11282", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, n, i, col, row, sum[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++) {\n        scanf(\"%d\", &sz[row][col]);\n      }\n    }\n    for (col = 0; col < n - 1; col++)\n      sum[i] += sz[0][col];\n    for (row = 0; row < m - 1; row++)\n      sum[i] += sz[row][n - 1];\n    for (col = n - 1; col > 0; col--)\n      sum[i] += sz[m - 1][col];\n    for (row = m - 1; row > 0; row--)\n      sum[i] += sz[row][0];\n    printf(\"%d\\n\", sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101];\n  int n, k, row, col, i, j, sum = 0;\n\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    cin >> row >> col;\n    for (i = 1; i <= row; i++) {\n      for (j = 1; j <= col; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (j = 1; j <= col; j++)\n      sum = sum + a[1][j];\n    for (i = 2; i <= row; i++)\n      sum = sum + a[i][col];\n    for (j = 1; j <= col - 1; j++)\n      sum = sum + a[row][j];\n    for (i = 2; i <= row - 1; i++)\n      sum = sum + a[i][1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11284", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int K, M, N, sz[99][99];\n  scanf(\"%d\", &K);\n  for (int k = 1; k <= K; k++) {\n    int result = 0;\n    scanf(\"%d %d\", &M, &N);\n    for (int m = 0; m < M; m++)\n      for (int n = 0; n < N; n++)\n        scanf(\"%d\", &sz[m][n]);\n    if (M <= 2 || N <= 2) {\n      for (int m = 0; m < M; m++)\n        for (int n = 0; n < N; n++)\n          result += sz[m][n];\n    } else {\n      for (int n = 0; n < N; n++)\n        result += sz[0][n];\n      for (int n = 0; n < N; n++)\n        result += sz[M - 1][n];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][0];\n      for (int m = 1; m < M - 1; m++)\n        result += sz[m][N - 1];\n    }\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b, c;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        scanf(\"%d\", &jz[a][b]);\n      }\n    }\n    c = 0;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        if (a == 0 || b == 0) {\n          c = c + jz[a][b];\n        } else if (a == m - 1 || b == n - 1) {\n          c = c + jz[a][b];\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int m, int n) {\n  int a[m][n], i, j, t = 0;\n  if (m == 1 || n == 1)\n    for (i = 0; i < m + n - 1; i++) {\n      scanf(\"%d\", &j);\n      t += j;\n    }\n\n  else {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 0; i < m; i++)\n      t += a[i][0] + a[i][n - 1];\n    for (j = 1; j < n - 1; j++)\n      t += a[0][j] + a[m - 1][j];\n  }\n  return t;\n}\nint main() {\n  int m, n, q;\n  for (scanf(\"%d\", &q); q > 0; q--) {\n    scanf(\"%d%d\", &m, &n);\n    printf(\"%d\\n\", sum(m, n));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j;\n  int sum;\n  cin >> k;\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n        sum += *(*(a + m - 1) + j);\n      }\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n        sum += *(*(a + i) + n - 1);\n      }\n      sum = sum - *(*(a)) - *(*(a + m - 1) + n - 1) - *(*(a) + n - 1) -\n            *(*(a + m - 1));\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      sum = 0;\n      sum = *(*a);\n      cout << sum << endl;\n    } else if (m == 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n      }\n      cout << sum << endl;\n    } else if (n == 1 && m > 1) {\n      sum = 0;\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n      }\n      cout << sum << \"\\n\";\n    }\n    k--;\n  }\n}\n"}
{"label": "6", "index": "11288", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int a, b;\n    scanf(\"%d %d\", &a, &b);\n    int c[a][b];\n    int j, k;\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        scanf(\"%d\", &c[j][k]);\n      }\n    }\n    int s = 0;\n    for (k = 0; k < b; k++)\n      s += c[0][k];\n\n    for (j = 1; j < a; j++) {\n      s += c[j][b - 1];\n    }\n    for (k = 0; k < b - 1; k++) {\n      s += c[a - 1][k];\n    }\n    for (j = 1; j < a - 1; j++) {\n      s += c[j][0];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, y, n, s, j, h, a, k, b, sz[100][100], jieguo[100], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a, &b);\n    for (j = 0; j < a; j++) {\n      for (k = 0; k < b; k++) {\n        scanf(\"%d\", &sz[j][k]);\n      }\n    }\n    sum = 0;\n    for (h = 0; h < b; h++) {\n      sum = sum + sz[0][h] + sz[a - 1][h];\n    }\n    for (s = 0; s < a; s++) {\n      sum = sum + sz[s][0] + sz[s][b - 1];\n    }\n    sum = sum - sz[0][0] - sz[0][b - 1] - sz[a - 1][0] - sz[a - 1][b - 1];\n    jieguo[i] = sum;\n  }\n  for (y = 0; y < n; y++) {\n    printf(\"%d\\n\", jieguo[y]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int m, n, j1, j2, sum = 0;\n    cin >> m >> n;\n    for (j1 = 1; j1 <= m; j1++) {\n      for (j2 = 1; j2 <= n; j2++) {\n        cin >> *(*(a + j1) + j2); \n      }\n    }\n    for (j2 = 1; j2 <= n; j2++)\n      sum = sum + *(*(a + 1) + j2) + *(*(a + m) + j2); \n    for (j1 = 2; j1 <= m - 1; j1++)\n      sum = sum + *(*(a + j1) + 1) + *(*(a + j1) + n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m[100], n[100], i, j, a, k, sz[100][100], sum[100] = {0};\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m[a], &n[a]);\n    for (i = 0; i < m[a]; i++) {\n      for (j = 0; j < n[a]; j++) {\n        scanf(\"%d\", &sz[i][j]);\n      }\n    }\n    if (m[a] != 1 && n[a] != 1) {\n      for (j = 0; j < n[a]; j++) {\n        sum[a] += sz[0][j];\n        sum[a] += sz[m[a] - 1][j];\n      }\n      for (i = 1; i < m[a] - 1; i++) {\n        sum[a] += sz[i][0];\n        sum[a] += sz[i][n[a] - 1];\n      }\n    } else {\n      for (i = 0; i < m[a]; i++) {\n        for (j = 0; j < n[a]; j++) {\n          sum[a] += sz[i][j];\n        }\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%d\\n\", sum[a]);\n\n  return 0;\n}\n"}
{"label": "6", "index": "11292", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  cin >> k;\n  for (l = 0; l < k; l++) {\n    int a[100][100], m, n;\n    int *p;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      p = &a[0][i];\n      sum += *p;\n    }\n    if (m != 1)\n      for (i = 0; i < n; i++) {\n        p = &a[m - 1][i];\n        sum += *p;\n      }\n    for (i = 1; i < m - 1; i++) {\n      p = a[i];\n      sum += *p;\n    }\n    for (i = 1; i < m - 1; i++) {\n      p = &a[i][n - 1];\n      sum += *p;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], sum = 0;\n  cin >> k;\n  while (cin >> m >> n) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    if (m >= 3 && n >= 3) {\n      for (i = 0; i < n; i++)\n        sum = sum + a[0][i] + a[m - 1][i];\n      for (i = 1; i < m - 1; i++)\n        sum = sum + a[i][0] + a[i][n - 1];\n    } else {\n      for (i = 0; i < m; i++)\n        for (j = 0; j < n; j++)\n          sum = sum + a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen(int m, int n) {\n  int a[100][100];\n  int s = 0, i, j;\n  for (i = 1; i <= m; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++)\n    s += a[1][i];\n  for (i = 2; i <= m; i++)\n    s += a[i][n];\n  for (i = n - 1; i >= 1; i--)\n    s += a[m][i];\n  for (i = m - 1; i > 1; i--)\n    s += a[i][1];\n  return s;\n}\nint main() {\n  int k, m, n, t;\n  cin >> k;\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    cout << juzhen(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int p, q, i, j;\n    cin >> p >> q;\n    int a[p][q], sum = 0;\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < q; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i < q; i++) {\n      sum = sum + a[0][i] + a[p - 1][i];\n    }\n    for (j = 0; j < p; j++) {\n      sum = sum + a[j][0] + a[j][q - 1];\n    }\n    sum = sum - a[0][0] - a[0][q - 1] - a[p - 1][0] - a[p - 1][q - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[110][110], i, j, l, s = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (j = 1; j <= m; j++)\n      for (l = 1; l <= n; l++)\n        scanf(\"%d\", &a[j][l]);\n    if (m == 1)\n      for (j = 1; j <= n; j++)\n        s = s + a[1][j];\n    else if (n == 1)\n      for (j = i; j <= m; j++)\n        s = s + a[j][1];\n    else {\n      for (j = 1; j <= m; j++) {\n        s = s + a[j][1] + a[j][n];\n        a[j][1] = 0;\n        a[j][n] = 0;\n      }\n      for (j = 2; j < n; j++) {\n        s = s + a[1][j] + a[m][j];\n        a[1][j] = 0;\n        a[m][j] = 0;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n}\n"}
{"label": "6", "index": "11297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a, b;\n  int juzhen[100][100];\n  scanf(\"%d \", &n);\n  for (int m = 1; m <= n; m++) {\n    cin >> a >> b;\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++) {\n        cin >> *(*(juzhen + i) + j);\n      }\n    int s = 0;\n    for (int i = 0; i < b; i++) {\n      s = juzhen[0][i] + s;\n      s = juzhen[a - 1][i] + s;\n    }\n    for (int j = 1; j < a - 1; j++) {\n      s = juzhen[j][0] + s;\n      s = juzhen[j][b - 1] + s;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "11298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int zong, m, n, a[101][101], sum1 = 0, sum2 = 0, sum = 0;\n  cin >> zong;\n  for (int i = 1; i <= zong; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += a[0][i];\n    } else if (n == 1) {\n      for (int i = 0; i < m; i++)\n        sum += a[m][0];\n    }\n\n    else {\n      for (int k = 0; k < n; ++k)\n        sum1 += a[0][k] + a[m - 1][k];\n      for (int j = 0; j < m; ++j)\n        sum2 += a[j][0] + a[j][n - 1];\n      sum = sum1 + sum2 - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum1 = 0, sum2 = 0, sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, u, k, m[100], n[100], g[100][100][100], num = 0;\n  int *p, (*q)[100];\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (u = 0; u < n[i]; u++)\n        scanf(\"%d \", &g[i][j][u]);\n  }\n  for (i = 1; i <= k; i++) {\n    num = 0;\n    for (p = &g[i][0][0]; p <= &g[i][0][n[i] - 1]; p++)\n      num = num + (*p);\n    for (p = &g[i][m[i] - 1][0]; p <= &g[i][m[i] - 1][n[i] - 1]; p++)\n      num = num + (*p);\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q));\n    for (q = &g[i][1]; q <= &g[i][m[i] - 2]; q++)\n      num = num + (*(*q + n[i] - 1));\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11300", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, h, l, result = 0;\n  int a[101][101];\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[h][l];\n      }\n    }\n    for (l = 1; l <= n; l++) {\n      result = result + a[1][l] + a[m][l];\n    }\n    for (h = 2; h <= m - 1; h++) {\n      result = result + a[h][1] + a[h][n];\n    }\n    cout << result << endl;\n    for (h = 1; h <= m; h++) {\n      for (l = 1; l <= n; l++)\n        a[h][l] = 0;\n    }\n    result = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int maxn = 110;\nint n, m;\nint d[maxn][maxn];\n\nint main() {\n  int t;\n\n  scanf(\"%d\", &t);\n  while (t-- > 0) {\n    int sum = 0;\n    cin >> n >> m;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < m; j++) {\n        int tmp;\n        scanf(\"%d\", &tmp);\n        if (i == 0 || i == n - 1 || j == 0 || j == m - 1)\n          sum += tmp;\n      }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, num[100][100], count1, count2, count3, sum;\n  int *pointer = NULL;\n  cin >> k;\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (count1 = 0; count1 < m; count1++) {\n      for (count2 = 0; count2 < n; count2++) {\n        cin >> num[count1][count2];\n      }\n    }\n    for (pointer = num[0]; pointer < num[0] + n; pointer++)\n      sum = sum + *pointer;\n\n    for (pointer = num[m - 1]; pointer < num[m - 1] + n; pointer++) {\n      sum = sum + *pointer;\n    }\n    for (pointer = num[1] + n - 1, count3 = 1; count3 < m - 1;\n         pointer = num[++count3] + n - 1)\n\n      sum = sum + *pointer;\n\n    for (pointer = num[1], count3 = 1; count3 < m - 1;\n         pointer = num[++count3]) {\n      sum = sum + *pointer;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11303", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, sum[100], p, q, t, l, m[100], n[100], h;\n  int a[100][100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    scanf(\"%d %d\\n\", &m[i], &n[i]);\n    for (j = 0; j < m[i]; j++) {\n      for (h = 0; h < n[i]; h++) {\n        scanf(\"%d\", &a[j][h]);\n      }\n    }\n    for (p = 0; p < n[i]; p++) {\n      sum[i] = sum[i] + a[0][p];\n    }\n    for (q = 1; q < m[i]; q++) {\n      sum[i] = sum[i] + a[q][n[i] - 1];\n    }\n    for (l = n[i] - 2; l >= 0; l--) {\n      sum[i] = sum[i] + a[m[i] - 1][l];\n    }\n    for (t = m[i] - 2; t > 0; t--) {\n      sum[i] = sum[i] + a[t][0];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    int(*p)[100];\n    p = a;\n    int sum = 0;\n    cin >> m >> n;\n\n    for (int j = 0; j < m; j++) {\n      for (int l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    if (m != 1 && n != 1) {\n      for (int l = 0; l < n; l++) {\n        sum += *(*p + l) + *(*(p + m - 1) + l);\n      }\n      for (int j = 1; j < m - 1; j++) {\n        sum += *(*(p + j)) + *(*(p + j) + n - 1);\n      }\n      cout << sum << endl;\n    } else {\n      cout << **p << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][2], b[100][100], c[100] = {0}, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &a[i][0], &a[i][1]);\n    for (j = 0; j < a[i][0]; j++) {\n      for (k = 0; k < a[i][1]; k++) {\n        scanf(\"%d\", &b[j][k]);\n      }\n    }\n    for (j = 0; j < a[i][1]; j++)\n      c[i] = c[i] + b[0][j];\n    for (j = 0; j < a[i][1] && a[i][0] != 1; j++)\n      c[i] += b[a[i][0] - 1][j];\n    for (j = 1; j < a[i][0] - 1; j++)\n      c[i] = c[i] + b[j][0];\n    for (j = 1; j < a[i][0] - 1 && a[i][1] != 1; j++)\n      c[i] += b[j][a[i][1] - 1];\n    for (j = 0; j < 100; j++) {\n      for (k = 0; k < 100; k++) {\n        b[j][k] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int i, j, t;\n  int sum;\n  int z;\n  cin >> k;\n  for (t = 0; t < k; t++) {\n    scanf(\"%d%d\", &m, &n);\n    sum = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &z);\n        if (i == 0 || i == m - 1)\n          sum += z;\n        else {\n          if (j == 0 || j == n - 1)\n            sum += z;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], m, n, k, i, j, sum, *p;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    p = a;\n    if (m * n > 1) {\n      for (j = 0; j < m * n; j++) {\n        scanf(\"%d\", p);\n        p++;\n      }\n      for (p = a; p < a + n; p++) {\n        sum = sum + (*p);\n      }\n      for (p = a + n; p <= a + (m - 2) * n; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + 2 * n - 1; p <= a + (m - 1) * n - 1; p = p + n) {\n        sum = sum + (*p);\n      }\n      for (p = a + (m - 1) * n; p <= a + m * n - 1; p++) {\n        sum = sum + (*p);\n      }\n      printf(\"%d\\n\", sum);\n    } else {\n      scanf(\"%d\", p);\n      cout << *p;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int mat[100][100];\n  int t, m, n, i, j, sum;\n  cin >> t;\n  for (; t > 0; t--) {\n    memset(mat, 0, sizeof(mat));\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> mat[i][j];\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          sum += mat[i][j];\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11309", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n = 0;\n\n  cin >> n;\n\n  int result[100];\n\n  for (int i = 0; i < n; i++) {\n\n    int x = 0;\n    int y = 0;\n\n    cin >> x >> y;\n\n    int r[100][100];\n\n    for (int j = 0; j < x; j++) {\n      for (int k = 0; k < y; k++) {\n        cin >> r[j][k];\n      }\n    }\n\n    result[i] = 0;\n\n    for (int j = 0; j < x; j++) {\n      if (j == 0 || j == x - 1) {\n\n        for (int k = 0; k < y; k++) {\n          result[i] += r[j][k];\n        }\n\n      } else {\n        result[i] += r[j][0];\n        result[i] += r[j][y - 1];\n      }\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    printf(\"%d\", result[i]);\n    if (i < n - 1)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, m, p, q, sz[100][100], sum;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> sz[p][q];\n      }\n    }\n    if (m == 1 || n == 1) {\n      for (p = 0; p < m; p++) {\n        for (q = 0; q < n; q++) {\n          sum += sz[p][q];\n        }\n      }\n    } else {\n      for (q = 0; q <= n - 1; q++) {\n        sum += sz[0][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][n - 1];\n      }\n      for (q = 0; q < n; q++) {\n        sum += sz[m - 1][q];\n      }\n      for (q = 1; q < m - 1; q++) {\n        sum += sz[q][0];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11311", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, m, n, a[100][100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    int add = 0;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++)\n        cin >> a[j][l];\n    }\n    for (l = 0; l < n; l++)\n      add += (a[0][l] + a[m - 1][l]);\n    for (l = 1; l < m - 1; l++)\n      add += (a[l][0] + a[l][n - 1]);\n    printf(\"%d \", add);\n    for (j = 0; j < 100; j++) {\n      for (l = 0; l < 100; l++)\n        a[j][l] = 0;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "6", "index": "11312", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, shuzu[100][100], hang = 0, lie = 0, zu = 0, sum = 0;\n  cin >> zu;\n  for (i = 0; i < zu; i++) {\n    scanf(\"%d%d\", &hang, &lie);\n    sum = 0;\n    for (j = 0; j < hang; j++) {\n      for (k = 0; k < lie; k++)\n        cin >> shuzu[j][k];\n    }\n    for (k = 0; k < lie; k++) {\n      sum = sum + shuzu[0][k];\n    }\n    if (hang > 1) {\n      for (k = 0; k < lie; k++) {\n        sum = sum + shuzu[hang - 1][k];\n      }\n    }\n    if (hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][0];\n      }\n    }\n    if (lie > 1 && hang > 2) {\n      for (k = 1; k < hang - 1; k++) {\n        sum = sum + shuzu[k][lie - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11313", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int m, int n, int a[][100]) {\n  int i, sum = 0;\n  for (i = 0; i < n; i++) {\n    sum += *(*(a + m - 1) + i);\n    sum += *((*a) + i);\n  }\n  for (i = 1; i <= m - 2; i++) {\n    sum += **(a + i);\n    sum += *(*(a + i) + n - 1);\n  }\n  return sum;\n}\nint main() {\n  int m, n, i, k, j, p, a[100][100];\n  scanf(\"%d \", &p);\n  for (i = 1; i <= p; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", sum(m, n, a));\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d = 0, e = 0, i, j, k, l, m, n;\n  int a[101][101] = {0};\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    for (b = 1; b <= m; b++) {\n      for (c = 1; c <= n; c++) {\n        cin >> a[b][c];\n        d = d + a[b][c];\n      }\n    }\n    for (b = 2; b <= m - 1; b++) {\n      for (c = 2; c <= n - 1; c++) {\n        e = e + a[b][c];\n      }\n    }\n    cout << d - e << endl;\n    d = 0;\n    e = 0;\n  }\n}\n"}
{"label": "6", "index": "11315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, k, i, j, sum;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  while (k--) {\n    sum = 0;\n    scanf(\"%d %d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0 || i == m - 1)\n          continue;\n        if (j == 0 || j == n - 1)\n          continue;\n        a[i][j] = 0;\n      }\n    }\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        sum += a[i][j];\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint init() {\n\n  int k, t, m, n, ans;\n  cin >> k;\n  while (k) {\n    k--;\n    ans = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> t;\n        if (i == 0 || i == m - 1 || j == 0 || j == n - 1)\n          ans += t;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n\nint main() {\n  init();\n  return 0;\n}\n"}
{"label": "6", "index": "11317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, p, q, a[100][100], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int total = 0;\n    cin >> p >> q;\n    for (j = 0; j < p; j++)\n      for (k = 0; k < q; k++)\n        cin >> a[j][k];\n    for (int h = 0; h < q; h++) {\n      total += *(*a + h);\n      total += *(*(a + p - 1) + h);\n    }\n    for (int g = 0; g < p; g++) {\n      total += **(a + g);\n      total += *(*(a + g) + q - 1);\n    }\n    total -= **a;\n    total -= *(*a + q - 1);\n    total -= **(a + p - 1);\n    total -= *(*(a + p - 1) + q - 1);\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, s, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    s = 0;\n\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    if (m == 1 && n == 1) {\n      printf(\"%d\", a[0][0]);\n      continue;\n    }\n    for (j = 0; j < n; j++) {\n      s = s + *(a[0] + j);\n      s = s + *(a[m - 1] + j);\n    }\n    for (i = 0; i < m; i++) {\n      s = s + *(a[i] + 0);\n      s = s + *(a[i] + n - 1);\n    }\n    s = s - a[0][0] - a[m - 1][0] - a[0][n - 1] - a[m - 1][n - 1];\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "6", "index": "11319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, a, b, c;\n  int jz[100][100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        cin >> jz[a][b];\n      }\n    }\n    c = 0;\n    for (a = 0; a < m; a++) {\n      for (b = 0; b < n; b++) {\n        if (a == 0 || b == 0) {\n          c = c + jz[a][b];\n        } else if (a == m - 1 || b == n - 1) {\n          c = c + jz[a][b];\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11320", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m, n, ii, jj, l, t;\n  int s[10002] = {0};\n  int *k = s;\n  int sum = 0;\n  cin >> jj;\n  for (i = 1; i <= jj; i++) {\n    scanf(\"%d %d\", &m, &n);\n    t = m * n;\n    for (ii = 1; ii <= t; ii++) {\n      k = k + 1;\n      scanf(\"%d\", k);\n      if (ii <= n || ii > (m - 1) * n || ii % n == 1 || ii % n == 0)\n        sum = sum + *k;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    k = s;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11321", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  for (int z = 0; z < num; z++) {\n    int a, b;\n    cin >> a >> b;\n    int juzhen[100][100];\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        scanf(\"%d \", &juzhen[i][j]);\n    int sum = 0;\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[0][i];\n    for (int j = 1; j < a - 1; j++) {\n      sum = sum + juzhen[j][0];\n      sum = sum + juzhen[j][b - 1];\n    }\n    for (int i = 0; i < b; i++)\n      sum = sum + juzhen[a - 1][i];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, count;\n  int a[100][100];\n  cin >> t;\n  for (int temp = 0; temp < t; temp++) {\n    count = 0;\n    cin >> m >> n;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (int i = 1; i < m - 1; i++) {\n      count += a[i][0];\n      count += a[i][n - 1];\n    }\n    for (int j = 0; j < n; j++) {\n      count += a[0][j];\n      count += a[m - 1][j];\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11323", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, i, j, s = 0, a[102][102];\n  cin >> k;\n  while (k > 0) {\n    s = 0;\n    cin >> m >> n;\n    for (i = 1; i <= m; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= m; i++) {\n      s = s + a[i][1] + a[i][n];\n    }\n    for (j = 2; j <= n - 1; j++) {\n      s = s + a[1][j] + a[m][j];\n    }\n    cout << s << endl;\n    k--;\n  }\n}\n"}
{"label": "6", "index": "11324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, num[150][150], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d %d\\n\", &m, &n);\n    sum = 0;\n    for (j = 0; j < m; j++) {\n      for (a = 0; a < n; a++) {\n        scanf(\"%d\", &num[j][a]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum += num[0][j];\n      if (m != 1) {\n        sum += num[m - 1][j];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum += (num[j][0]);\n      if (n != 1)\n        sum += num[j][n - 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    int i, j, a, b, x[100][100], sum = 0;\n    cin >> a >> b;\n    for (i = 0; i < a; i++) {\n      for (j = 0; j < b; j++) {\n        cin >> x[i][j];\n      }\n    }\n    for (i = 0; i < b; i++) {\n      sum = sum + x[0][i] + x[a - 1][i];\n    }\n    for (i = 1; i < a - 1; i++) {\n      sum = sum + x[i][0] + x[i][b - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int m, int n, int a[][100]) {\n  int i, sum = 0;\n  for (i = 0; i < n; i++) {\n    sum += *(*(a + m - 1) + i);\n    sum += *((*a) + i);\n  }\n  for (i = 1; i <= m - 2; i++) {\n    sum += **(a + i);\n    sum += *(*(a + i) + n - 1);\n  }\n  return sum;\n}\nint main() {\n  int m, n, i, k, j, p, a[100][100];\n  scanf(\"%d \", &p);\n  for (i = 1; i <= p; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(m, n, a) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n;\n  int sz[100][100];\n  int i, r, sum1, sum2, sum;\n  scanf(\"%d\", &k);\n  for (int j = 1; j <= k; j++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &sz[i][r]);\n      }\n    }\n    sum1 = 0;\n    for (int q = 0; q < n; q++) {\n      sum1 += sz[0][q] + sz[m - 1][q];\n    }\n    sum2 = 0;\n    for (int w = 0; w < m; w++) {\n      sum2 += sz[w][n - 1] + sz[w][0];\n    }\n    sum =\n        sum1 + sum2 - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[101][101];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int sum = 0;\n    for (int i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, c;\n  int a[100][100];\n  int b[100] = {0};\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          b[c] += a[i][j];\n        } else {\n          if (j == 0 || j == n - 1) {\n            b[c] += a[i][j];\n          }\n        }\n      }\n    }\n  }\n  for (c = 0; c < k; c++) {\n    cout << b[c] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid juzhen(int m, int n) {\n  int a[100][100];\n  int i, j, sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", *(a + i) + j);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + *(*(a) + j) + *(*(a + m - 1) + j);\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + *(*(a + i) + 0) + *(*(a + i) + n - 1);\n  }\n  if (m == 1) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      sum = sum + *(*a + i);\n  }\n  if (n == 1) {\n    sum = 0;\n    for (i = 0; i < m; i++)\n      sum = sum + *(*(a + i) + 0);\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  int k, i, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    juzhen(m, n);\n  }\n}\n"}
{"label": "6", "index": "11331", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l, a, n, m, sz[100][100], result[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        cin >> sz[j][l];\n      }\n    }\n    a = 0;\n    for (l = 0; l < n; l++) {\n      a += sz[0][l];\n    }\n    if (m > 1) {\n      for (l = 0; l < n; l++) {\n        a += sz[m - 1][l];\n      }\n    }\n    for (j = 1; j < m - 1; j++) {\n      a += sz[j][0];\n    }\n    if (n > 1) {\n      for (j = 1; j < m - 1; j++) {\n        a += sz[j][n - 1];\n      }\n    }\n    result[i] = a;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m[200], n[200], i, t, j, a[200][200], sum;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n\n    scanf(\"%d%d\", &m[i], &n[i]);\n    for (t = 1; t <= m[i]; t++) {\n      for (j = 1; j <= n[i]; j++) {\n        scanf(\"%d\", &a[t][j]);\n      }\n    }\n\n    if (m[i] == 1 && n[i] == 1) {\n      printf(\"%d\", a[1][1]);\n    } else {\n\n      sum = 0;\n\n      for (t = 1; t <= n[i]; t++) {\n        sum = sum + a[1][t];\n      }\n\n      for (j = 1; j <= n[i]; j++)\n        sum = sum + a[m[i]][j];\n\n      for (t = 1; t <= m[i]; t++) {\n        sum = sum + a[t][1];\n      }\n\n      for (j = 1; j <= m[i]; j++) {\n        sum = sum + a[j][n[i]];\n      }\n\n      sum = sum - a[1][1] - a[1][n[i]] - a[m[i]][n[i]] - a[m[i]][1];\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, m, n, sum;\nint num[101][101];\nint main() {\n  int i, j, l;\n  cin >> k;\n  for (i = 0; i < k; ++i) {\n    memset(num, 0, sizeof(num));\n    sum = 0;\n    cin >> m >> n;\n    for (j = 0; j < m; ++j) {\n      for (l = 0; l < n; ++l) {\n        cin >> num[j][l];\n      }\n    }\n    for (j = 0; j < n; ++j)\n      sum += num[0][j] + num[m - 1][j];\n    for (j = 1; j < m - 1; ++j)\n      sum += num[j][0] + num[j][n - 1];\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11334", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n    int m, n, i, j;\n    int a[100][100];\n    scanf(\"%d %d \", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += a[0][j];\n      sum += a[m - 1][j];\n    }\n    i = 1;\n    while (i < m - 1) {\n      sum += a[i][0];\n      sum += a[i][n - 1];\n      i++;\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "11335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0, m = 0, n = 0;\n  int ans = 0, a = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int l = 0; l < n; l++) {\n        cin >> a;\n        if (!l || l == (n - 1))\n          ans += a;\n        else if (!j || j == (m - 1))\n          ans += a;\n      }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11336", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[120][120];\n  for (int i = 0; i < n; i++) {\n    int a, b;\n    int s = 0;\n    scanf(\"%d%d\", &a, &b);\n    for (int m = 0; m < a; m++)\n      for (int n = 0; n < b; n++) {\n        scanf(\"%d\", &num[m][n]);\n        if (m == 0 || m == a - 1 || n == 0 || n == b - 1)\n          s += num[m][n];\n      }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "11337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, n, m, i, a[100][100], j, k, sum;\n  cin >> t;\n  int(*p)[100];\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &n, &m);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    }\n    p = a;\n    if (n == 1 || m == 1 || m == 2 || n == 2) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < m; k++)\n          sum = sum + *(*(p + j) + k);\n      }\n    } else {\n      for (k = 0; k < m; k++) {\n        sum = sum + *(*(p) + k) + *(*(p + n - 1) + k);\n      }\n      for (j = 1; j < n - 1; j++) {\n        sum = sum + *(*(p + j) + 0) + *(*(p + j) + m - 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &k);\n  for (w = 0; w < k; w++) {\n    c = 0;\n    cin >> m >> n;\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      p[i] = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p[i] + j);\n    if (m == 1)\n      for (i = 0; i < n; i++)\n        c = c + p[0][i];\n    else {\n      if (n == 1)\n        for (i = 0; i < m; i++)\n          c = c + p[i][0];\n      else {\n        for (i = 0; i < n; i++)\n          c = c + p[0][i] + p[m - 1][i];\n        for (i = 1; i < m - 1; i++)\n          c = c + p[i][0] + p[i][n - 1];\n      }\n    }\n    cout << c << \"\\n\";\n    for (i = 0; i < m; i++)\n      free(p[i]);\n    free(p);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int a[100][100];\n  scanf(\"%d \", &k);\n  int m, n;\n  int i, j;\n  int sum;\n  for (int l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    for (j = 0; j < n; j++) {\n      if (m - 1 != 0)\n        sum += *(*(a + 0) + j) + *(*(a + m - 1) + j);\n      else\n        sum += *(*(a + 0) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += *(*(a + i) + 0) + *(*(a + i) + n - 1);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11340", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num_data;\n  scanf(\"%d \", &num_data);\n  while (num_data--) {\n    int a[100][100];\n    int m, n;\n    int sum = 0;\n\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> a[i][j];\n\n    if (m == 1) {\n      for (int k = 0; k != n; k++)\n        sum += a[0][k];\n    } else if (n == 1) {\n      for (int k = 0; k != m; k++)\n        sum += a[k][0];\n    } else {\n      for (int k = 0; k != n - 1; k++)\n        sum += a[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += a[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += a[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += a[k][0];\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num_data;\n  cin >> num_data;\n  while (num_data--) {\n    int a[100][100];\n    int m, n;\n    int sum = 0;\n\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> a[i][j];\n\n    if (m == 1) {\n      for (int k = 0; k != n; k++)\n        sum += a[0][k];\n    } else if (n == 1) {\n      for (int k = 0; k != m; k++)\n        sum += a[k][0];\n    } else {\n      for (int k = 0; k != n - 1; k++)\n        sum += a[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += a[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += a[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += a[k][0];\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j;\n  int sum;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    if (m > 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++) {\n        sum += *(*(a) + j);\n        sum += *(*(a + m - 1) + j);\n      }\n      for (i = 0; i < m; i++) {\n        sum += *(*(a + i));\n        sum += *(*(a + i) + n - 1);\n      }\n      sum = sum - *(*(a)) - *(*(a + m - 1) + n - 1) - *(*(a) + n - 1) -\n            *(*(a + m - 1));\n      cout << sum << endl;\n    } else if (m == 1 && n == 1) {\n      sum = 0;\n      sum = *(*a);\n      cout << sum << endl;\n    } else if (m == 1 && n > 1) {\n      sum = 0;\n      for (j = 0; j < n; j++)\n        sum += *(*(a) + j);\n\n      cout << sum << endl;\n    } else if (n == 1 && m > 1) {\n      sum = 0;\n      for (i = 0; i < m; i++)\n        sum += *(*(a + i));\n\n      cout << sum << endl;\n    }\n    k--;\n  }\n}\n"}
{"label": "6", "index": "11343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int *p, int h, int l);\n  int N, m, n, i, j, q, a[110][110] = {0};\n  scanf(\"%d\", &N);\n  for (q = 1; q <= N; q++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i <= m - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    printf(\"%d\\n\", sum(a[0], m, n));\n  }\n}\n\nint sum(int *p, int h, int l) {\n  int r = 0, i, j;\n  for (i = 0; i <= h - 1; i++) {\n    if (i == 0 || i == (h - 1))\n      for (j = 0; j <= l - 1; j++)\n        r = r + *(p + i * 110 + j);\n    else\n      r = r + *(p + i * 110) + *(p + i * 110 + l - 1);\n  }\n  return r;\n}\n"}
{"label": "6", "index": "11344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a[100][100], l, b[100];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    b[i] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &a[j][l]);\n        if (j == 0 || j == m - 1)\n          b[i] += a[j][l];\n        else if (l == 0 || l == n - 1)\n          b[i] += a[j][l];\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "6", "index": "11345", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d %d \", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (t = 1; t <= n; t++)\n        cin >> a[j][t];\n    }\n    if (m == 1 && n == 1)\n      sum = a[1][1];\n    else\n      for (j = 1; j <= m; j++) {\n        sum = sum + a[j][1];\n        sum = sum + a[j][n];\n      }\n    for (t = 2; t < n; t++) {\n      sum = sum + a[1][t];\n      sum = sum + a[m][t];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a, b;\n  int juzhen[100][100];\n  scanf(\"%d \", &n);\n  for (int m = 1; m <= n; m++) {\n    cin >> a >> b;\n    for (int i = 0; i < a; i++)\n      for (int j = 0; j < b; j++)\n        cin >> *(*(juzhen + i) + j);\n    int s = 0;\n    for (int i = 0; i < b; i++) {\n      s = juzhen[0][i] + s;\n      s = juzhen[a - 1][i] + s;\n    }\n    for (int j = 1; j < a - 1; j++) {\n      s = juzhen[j][0] + s;\n      s = juzhen[j][b - 1] + s;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "11347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int k, m[100], n[100], i, j, t, s[100];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    s[i] = 0;\n    cin >> m[i] >> n[i];\n    for (j = 0; j < m[i]; j++)\n      for (t = 0; t < n[i]; t++)\n        cin >> a[i][j][t];\n    for (t = 0; t < n[i]; t++)\n      s[i] += (a[i][0][t] + a[i][m[i] - 1][t]);\n    for (j = 0; j < m[i]; j++)\n      s[i] += (a[i][j][0] + a[i][j][n[i] - 1]);\n    s[i] = s[i] - a[i][0][0] - a[i][0][n[i] - 1] - a[i][m[i] - 1][0] -\n           a[i][m[i] - 1][n[i] - 1];\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "6", "index": "11348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p, q, m, n, k, a[200][200], sum;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (p = 0; p < m; p++) {\n      for (q = 0; q < n; q++) {\n        cin >> a[p][q];\n      }\n    }\n    int *pointer;\n    pointer = *a;\n    for (p = 0; p < n; p++) {\n      sum = sum + *(pointer + p);\n    }\n    for (p = 1; p < m - 1; p++) {\n      sum = sum + *(*(a + p) + 0) + *(*(a + p) + n - 1);\n    }\n    for (p = 0; p < n; p++) {\n      sum = sum + *(*(a + m - 1) + p);\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11349", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  int juzhen[100][100];\n  int m = 0, n = 0;\n  scanf(\"%d \", &k);\n  while (k > 0) {\n    m = 0;\n    n = 0;\n    memset(juzhen, 0, sizeof(juzhen));\n    cin >> m >> n;\n    int i = 0, j = 0, sum = 0;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> juzhen[i][j];\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen) + i);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      sum = sum + *(*(juzhen + m - 1) + i);\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j));\n    }\n    for (j = 1; j <= m - 2; j++) {\n      sum = sum + *(*(juzhen + j) + n - 1);\n    }\n    printf(\"%d\\n\", sum);\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, n, m, i, k, j, a[100][100], s[100];\n  scanf(\"%d\", &p);\n  for (k = 0; k < p; k++) {\n    s[k] = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (i == 0)\n          s[k] += a[i][j];\n        else if ((m - i - 1) == 0)\n          s[k] += a[i][j];\n        else if (j == 0)\n          s[k] += a[i][j];\n        else if ((n - j - 1) == 0)\n          s[k] += a[i][j];\n      }\n  }\n  for (k = 0; k < p; k++)\n    printf(\"%d\\n\", s[k]);\n  return 0;\n}\n"}
{"label": "6", "index": "11351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[101][101];\n  int n, i, j, s, t;\n  cin >> n;\n  while (n--) {\n    cin >> s >> t;\n    for (i = 0; i < s; i++)\n      for (j = 0; j < t; j++)\n        cin >> c[i][j];\n    int sum = 0;\n    if (s == 1)\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][t];\n    else if (t == 1)\n      for (i = 0; i < s; i++)\n        sum = sum + c[i][0];\n    else {\n      for (i = 0; i < t; i++)\n        sum = sum + c[0][i] + c[s - 1][i];\n      for (i = 1; i < s - 1; i++)\n        sum = sum + c[i][0] + c[i][t - 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int side_sum(int *p); \n  int k;\n  int *p; \n  cin >> k;\n  p = &k;\n  side_sum(p); \n  return 0;\n}\nint side_sum(int *p) \n{\n  int k, m, n, i, j, l, sum = 0;\n  int a[100][100];\n  k = *p;\n  for (i = 0; i < k; i++) {\n    sum = 0;       \n    cin >> m >> n; \n    for (j = 0; j < m; j++)\n      for (l = 0; l < n; l++) {\n        cin >> a[j][l];\n        if (j == 0 || j == m - 1)\n          sum += a[j][l];\n        else if (l == 0 || l == n - 1)\n          sum += a[j][l];\n      }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, n, m, i, a[100][100], j, k, sum;\n  cin >> t;\n  int(*p)[100];\n  for (i = 0; i < t; i++) {\n    sum = 0;\n    cin >> n >> m;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    }\n    p = a;\n    if (n == 1 || m == 1 || m == 2 || n == 2) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < m; k++)\n          sum = sum + *(*(p + j) + k);\n      }\n    } else {\n      for (k = 0; k < m; k++) {\n        sum = sum + *(*(p) + k) + *(*(p + n - 1) + k);\n      }\n      for (j = 1; j < n - 1; j++) {\n        sum = sum + *(*(p + j) + 0) + *(*(p + j) + m - 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint imat[100][100];\n\nint main() {\n  int n;\n  cin >> n;\n  int a, b;\n  for (int i = 0; i < n; i++) {\n    cin >> a >> b;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        scanf(\"%d \", &imat[j][k]);\n      }\n    }\n\n    int(*p)[100] = &(imat[0]);\n\n    int counter = 0;\n\n    for (int i = 0; i < a; i++) {\n      for (int j = 0; j < b; j++) {\n        if (j % b == 0 || j % b == (b - 1) || i == 0 || i == (a - 1)) {\n          counter = counter + *(*(p + i) + j);\n        }\n      }\n    }\n\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *pi, i = 0, j = 0, k = 1, sum = 0, n, m, z, t;\n  scanf(\"%d\", &k);\n  for (t = 0; t < k; t++) {\n    sum = 0;\n    cin >> m >> n;\n    int *p = (int *)malloc((n * m) * sizeof(int));\n    pi = p;\n    for (z = 0; z < m * n; z++, pi++)\n      scanf(\"%d\", pi);\n    pi = p;\n\n    for (j = 0; j < m * n; pi++) {\n      j++;\n      if (j < n + 1 || j > ((m - 1) * n) || j % n == 1 || j % n == 0)\n        sum = sum + *pi;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[101][101], i, j, t, sum = 0;\n  scanf(\"%d \", &k);\n  for (t = 1; t <= k; t++) {\n    cin >> m >> n;\n    if (m == 1 && n == 1) {\n      cin >> a[1][1];\n      printf(\"%d\\n\", a[1][1]);\n    } else {\n      for (i = 1; i <= m; i++) {\n        for (j = 1; j <= n; j++) {\n          cin >> a[i][j];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        sum += a[1][j] + a[m][j];\n      }\n      for (i = 1; i <= m; i++) {\n        sum += a[i][1] + a[i][n];\n      }\n      sum = sum - a[1][1] - a[1][n] - a[m][1] - a[m][n];\n      cout << sum << endl;\n    }\n    int a[101][101] = {0};\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, t;\n  for (t = 0; t < n; t++) {\n    int h, l;\n    int sum = 0;\n    scanf(\"%d %d\", &h, &l);\n    int a[100][100] = {0};\n    for (i = 0; i < h; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    if (h == 1)\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i];\n    else if (l == 1)\n      for (j = 0; j < h; j++)\n        sum = sum + a[j][0];\n    else {\n\n      for (i = 0; i < l; i++)\n        sum = sum + a[0][i] + a[h - 1][i];\n      for (j = 1; j < h - 1; j++)\n        sum = sum + a[j][0] + a[j][l - 1];\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t, i, j, l, k, sum = 0, a[100][100];\n  scanf(\"%d\", &t);\n  for (l = 0; l < t; l++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    if (m == n && n == 1) {\n      printf(\"%d\", a[0][0]);\n    } else {\n      for (j = 0; j < n; j++) {\n        sum += a[0][j];\n        sum += a[m - 1][j];\n      }\n      for (i = 0; i < m; i++) {\n        sum += a[i][0];\n        sum += a[i][n - 1];\n      }\n      sum = sum - a[0][0] - a[0][n - 1] - a[m - 1][0] - a[m - 1][n - 1];\n      printf(\"%d\\n\", sum);\n    }\n    sum = 0;\n  }\n\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "6", "index": "11359", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int i, j, l, lin, col, sum = 0;\n  int num[101][101];\n  for (l = 1; l <= k; l++) {\n    cin >> lin >> col;\n    for (i = 1; i <= lin; i++) {\n      for (j = 1; j <= col; j++)\n        cin >> num[i][j];\n    }\n\n    if (lin >= 2 && col >= 2) {\n      for (i = 2; i <= lin - 1; i++)\n        sum = sum + num[i][1] + num[i][col];\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j] + num[lin][j];\n    }\n    if (lin == 1 && col >= 2) {\n      for (j = 1; j <= col; j++)\n        sum = sum + num[1][j];\n    }\n    if (col == 1 && lin >= 2) {\n      for (i = 1; i <= lin; i++)\n        sum = sum + num[i][1];\n    }\n    if (col == 1 && lin == 1)\n      sum = sum + num[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11360", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[100][100], h, l, k, m, n, i, j, w, sum;\n  cin >> k;\n\n  for (l = 1; l <= k; l++) {\n    cin >> m >> n;\n    w = m;\n    h = n;\n    i = 0;\n    while (i < m) {\n      j = 0;\n      while (j < n) {\n        scanf(\"%d\", &s[i][j]);\n        j++;\n      }\n      i++;\n    }\n    sum = 0;\n    if (h > 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0] + s[i][h - 1];\n        i++;\n      }\n      j = 0;\n      while (j < h) {\n        sum += s[0][j] + s[w - 1][j];\n        j++;\n      }\n      sum = sum - s[0][0] - s[0][h - 1] - s[w - 1][0] - s[w - 1][h - 1];\n    }\n    if (h == 1 && w == 1) {\n      sum = s[0][0];\n    }\n    if (h == 1 && w > 1) {\n      i = 0;\n      while (i < w) {\n        sum += s[i][0];\n        i++;\n      }\n    }\n    if (h > 1 && w == 1) {\n      j = 0;\n      while (j < h) {\n        sum += s[0][j];\n        j++;\n      }\n    }\n    if (h == 0 || w == 0) {\n      sum = 0;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x[100], y[100], m[100][100], i, j, k, count[100] = {0};\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> x[k] >> y[k];\n    for (i = 0; i < x[k]; i++) {\n      for (j = 0; j < y[k]; j++) {\n        scanf(\"%d \", &m[i][j]);\n        if (i == 0 || i == x[k] - 1 || j == 0 || j == y[k] - 1)\n          count[k] += m[i][j];\n      }\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << count[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "6", "index": "11362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int x = 0, y = 0;\n  int total = 0;\n  int Matrix[100][100] = {{0}, {0}};\n  scanf(\"%d\", &n);\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d %d\", &x, &y);\n    for (int i = 0; i < x; i++)\n      for (int j = 0; j < y; j++) {\n        scanf(\"%d \", &Matrix[i][j]);\n        if (i == 0 || i == x - 1)\n          total += Matrix[i][j];\n        else if (j == 0 || j == y - 1)\n          total += Matrix[i][j];\n      }\n    cout << total << \"\\n\";\n    total = 0;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int i, j;\n    int a[100][100];\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int s = 0;\n    if (m == 1) {\n      for (j = 0; j < n; j++)\n        s += a[0][j];\n      printf(\"%d\\n\", s);\n    } else if (n == 1) {\n      for (i = 0; i < m; i++)\n        s += a[i][0];\n\n      printf(\"%d\\n\", s);\n    } else {\n\n      for (j = 0; j < n - 1; j++)\n        s += a[0][j];\n      for (i = 0; i < m - 1; i++)\n        s += a[i][n - 1];\n      for (j = 1; j < n; j++)\n        s += a[m - 1][j];\n      for (i = 1; i < m; i++)\n        s += a[i][0];\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, r, s, a[100][100], j, k = 1, sum;\n  scanf(\"%d\", &n);\n  while (k <= n) {\n    scanf(\"%d %d\", &r, &s);\n    sum = 0;\n    for (i = 0; i < r; i++) {\n      for (j = 0; j < s; j++)\n        scanf(\"%d\", *(a + i) + j);\n    }\n    if (r == 1) {\n      for (i = 0; i < s; i++)\n        sum += *(*(a + 0) + i);\n    } else if (s == 1) {\n      for (i = 0; i < r; i++)\n        sum += *(*(a + i) + 0);\n    } else {\n      for (i = 0, j = 0; j < s - 1; j++)\n        sum += *(*(a + i) + j);\n      for (i = 0, j = s - 1; i < r - 1; i++)\n        sum += *(*(a + i) + j);\n      for (i = r - 1; j > 0; j--)\n        sum += *(*(a + i) + j);\n      for (j = 0; i > 0; i--)\n        sum += *(*(a + i) + j);\n    }\n    printf(\"%d\\n\", sum);\n    k++;\n  }\n}\n"}
{"label": "6", "index": "11365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, s[100][100], n[100], m[100], num[100];\n  int num1[100] = {0};\n  int num2[100] = {0};\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &n[i], &m[i]);\n    for (j = 0; j < n[i]; j++) {\n      for (l = 0; l < m[i]; l++) {\n        scanf(\"%d\", &s[j][l]);\n        num1[i] += s[j][l];\n      }\n    }\n    for (j = 1; j < n[i] - 1; j++) {\n      for (l = 1; l < m[i] - 1; l++) {\n        num2[i] += s[j][l];\n      }\n    }\n    num[i] = num1[i] - num2[i];\n  }\n  for (i = 0; i < k; i++) {\n    cout << num[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11366", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, q;\n  int a[100][100];\n  int sum = 0;\n  int(*p)[100] = a;\n  cin >> q;\n  for (int i = 0; i < q; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        if (j == 0 || j == m - 1)\n          sum += p[j][k];\n        else {\n          if (k == 0 || k == n - 1)\n            sum += p[j][k];\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11367", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int a[100][100];\n  cin >> k;\n  int m, n;\n  int i, j;\n  int sum;\n  for (int l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    for (j = 0; j < n; j++) {\n      if (m - 1 != 0)\n        sum += *(*(a + 0) + j) + *(*(a + m - 1) + j);\n      else\n        sum += *(*(a + 0) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += *(*(a + i) + 0) + *(*(a + i) + n - 1);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    int m, n;\n    scanf(\"%d %d\", &m, &n);\n    int a[101][101];\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    int sum = 0;\n    for (int i = 0; i < m; i++)\n      sum = sum + a[i][0] + a[i][n - 1];\n    for (int i = 1; i < n - 1; i++)\n      sum = sum + a[0][i] + a[m - 1][i];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint count(int b, int c) {\n  int m = b, n = c;\n  int i, j, sum, num[100][100], (*a)[100];\n\n  a = num;\n  sum = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", *(a + i) + j);\n    scanf(\"%d\", *(a + i) + (n - 1));\n  }\n  for (j = 0; j < n; j++) {\n    sum = sum + (*(*a + j)) + (*(*(a + m - 1) + j));\n  }\n  for (i = 1; i < m - 1; i++) {\n    sum = sum + (*(*(a + i))) + (*(*(a + i) + (n - 1)));\n  }\n  return sum;\n}\n\nint main() {\n  int i, k, m, n, sum[100];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    sum[i] = count(m, n);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int square[100][100];\n  int k, i, j;\n  int(*p)[100];\n  p = square;\n  int sum = 0;\n  for (scanf(\"%d \", &k); k; --k) {\n    int wide;\n    int height;\n    sum = 0;\n    cin >> height >> wide;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++)\n        cin >> square[i][j];\n    p = square;\n    for (i = 0; i < height; i++)\n      for (j = 0; j < wide; j++) {\n        if (i == 0 || j == 0 || i == height - 1 || j == wide - 1)\n          sum += *(*(p + i) + j);\n      }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int m, n;\n  int a[100][100];\n  int i;\n  int j;\n  int e;\n  int sum[100] = {0};\n  for (e = 0; e < k; e++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (j = 0; j < n; j++) {\n      sum[e] = sum[e] + a[0][j];\n    }\n    for (i = 1; i < m; i++) {\n      sum[e] = sum[e] + a[i][n - 1];\n    }\n    for (j = n - 2; j >= 0; j--) {\n      sum[e] = sum[e] + a[m - 1][j];\n    }\n    for (i = m - 2; i > 0; i--) {\n      sum[e] = sum[e] + a[i][0];\n    }\n  }\n  for (e = 0; e < k; e++) {\n    printf(\"%d\\n\", sum[e]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], m, n, i, j, k, l, sum;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> m >> n;\n    sum = 0;\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++) {\n        cin >> a[j][l];\n        if (j == 1 || j == m || l == 1 || l == n) {\n          sum += a[j][l];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int p;\n  int q;\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num;\n    scanf(\"%d\", &p);\n    cin >> q;\n    if (p == 1 && q == 1) {\n      scanf(\"%d\", &num);\n      printf(\"%d\", num);\n      break;\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    for (j = 1; j < p - 1; j++) {\n      for (k = 0; k < q; k++) {\n        scanf(\"%d\", &num);\n        if (k == 0 || k == q - 1) {\n          sum += num;\n        }\n      }\n    }\n    for (j = 0; j < q; j++) {\n      scanf(\"%d\", &num);\n      sum += num;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int a[100][100], int m, int n) {\n  int x = 0, i;\n  for (i = 0; i < n; i++) {\n    x = x + a[0][i] + a[m - 1][i];\n  }\n  for (i = 1; i < m - 1; i++) {\n    x = x + a[i][0] + a[i][n - 1];\n  }\n  return x;\n}\nint main() {\n  int k, i;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    int a[100][100] = {0}, m, n, j, k;\n    cin >> m >> n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(a, m, n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int he, m, n, k, sz[100][100];\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &m, &n);\n    for (j = 0; j < m; j++) {\n      for (int q = 0; q < n; q++) {\n        scanf(\"%d\", &sz[j][q]);\n      }\n    }\n    if (m == 1 && n == 1) {\n      cout << sz[0][0] << \"\\n\";\n    } else {\n      he = 0;\n      for (j = 0; j < m; j++) {\n        if (m == 1) {\n          he += sz[j][0];\n        } else {\n          he += sz[j][0] + sz[j][n - 1];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        if (n == 1) {\n          he += sz[0][j];\n        } else {\n          he += sz[0][j] + sz[m - 1][j];\n        }\n      }\n      printf(\"%d\\n\", he);\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11376", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int j, n, k, i, m, l, sum;\n\n  scanf(\"%d\", &k);\n  for (l = 0; l < k; l++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", (&sz[i][j]));\n      }\n    }\n    i = 0;\n    for (j = 0; j < n; j++) {\n      sum += sz[0][j];\n    }\n    i = m - 1;\n    for (j = 0; j < n; j++) {\n      sum += sz[m - 1][j];\n    }\n    j = 0;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][0];\n    }\n    j = n - 1;\n    for (i = 1; i < m - 1; i++) {\n      sum += sz[i][n - 1];\n    }\n\n    printf(\"%d \", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11377", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, m, n, i, j, sum;\n  int a[101][101];\n  cin >> t;\n  for (; t > 0; t--) {\n    cin >> m >> n;\n    sum = 0;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i));\n    for (i = 0; i < m; i++)\n      sum += *(*(a + i) + n - 1);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a) + j);\n    for (j = 1; j < n - 1; j++)\n      sum += *(*(a + m - 1) + j);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11378", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[100][100][100], b[100][2], s[100], i, j, l, x, y;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d%d\", &b[i][0], &b[i][1]);\n    x = b[i][0];\n    y = b[i][1];\n    s[i] = 0;\n    for (j = 0; j < x; j++) {\n      for (l = 0; l < y; l++) {\n        scanf(\"%d\", &a[j][l][i]);\n        if (j == 0 || l == 0 || j == x - 1 || l == y - 1)\n          s[i] += a[j][l][i];\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  for (int z = 0; z < k; z++) {\n    int num[100][100], m, n;\n    scanf(\"%d %d\", &m, &n);\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &num[j][i]);\n      }\n    }\n    int sum = 0;\n\n    for (int i = 0; i < m; i++) {\n      sum = sum + num[i][0] + num[i][n - 1];\n    }\n    for (int i = 0; i < n; i++) {\n      sum = sum + num[0][i] + num[m - 1][i];\n    }\n    sum = sum - num[0][0] - num[0][n - 1] - num[m - 1][0] - num[m - 1][n - 1];\n    if (z != 0) {\n      printf(\"\\n\");\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11380", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, p, a[100][100], s[100] = {0}, m, n;\n  scanf(\"%d\", &k);\n  for (p = 1; p <= k; p++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (j = 1; j <= n; j++)\n      s[p] = s[p] + (a[1][j]);\n\n    for (j = 1; j <= n; j++) {\n      s[p] = s[p] + (a[m][j]);\n    }\n    for (i = 2; i <= m - 1; i++) {\n      s[p] = s[p] + a[i][1] + a[i][n];\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (p = 2; p <= k; p++) {\n    printf(\"\\n%d\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  for (int i = 0; i < t; i++) {\n    int n, m;\n    cin >> m >> n;\n    int num[110][110];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> num[j][k];\n    int sum = 0;\n    if (m == 1 && n != 1) {\n      for (int j = 0; j < n; j++)\n        sum = sum + num[0][j];\n      cout << sum << endl;\n    } else if (m != 1 && n == 1) {\n      for (int j = 0; j < m; j++)\n        sum = sum + num[m][0];\n      cout << sum << endl;\n    } else if (m == 1 && n == 1)\n      cout << num[0][0] << endl;\n    else {\n      for (int j = 0; j < n; j++)\n        sum = sum + *(*num + j);\n      for (int j = 0; j < n; j++)\n        sum = sum + *(num[m - 1] + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + **(num + j);\n      for (int j = 1; j < m - 1; j++)\n        sum = sum + *(*(num + j) + n - 1);\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0;\n  cin >> k;\n  int m = 0, n = 0;\n  while (cin >> m >> n) {\n    int result = 0;\n    int num[100][100] = {0};\n    int i, j;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    for (j = 0; j < n; j++)\n      result += num[0][j] + num[m - 1][j];\n    for (i = 1; i < (m - 1); i++)\n      result += num[i][0] + num[i][n - 1];\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, a, b, sz[100][100];\n  scanf(\"%d\", &k);\n  for (a = 0; a < k; a++) {\n    scanf(\"%d%d\", &m, &n);\n    int s = 0;\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &(sz[i][j]));\n      }\n    }\n    if (m == 1 && n == 1) {\n      s = sz[0][0];\n    } else {\n      for (b = 0; b < n; b++) {\n        s = s + sz[0][b] + sz[m - 1][b];\n      }\n      for (b = 0; b < m; b++) {\n        s = s + sz[b][0] + sz[b][n - 1];\n      }\n      s = s - sz[0][0] - sz[0][n - 1] - sz[m - 1][0] - sz[m - 1][n - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  while (k--) {\n\n    int array[100][100];\n    int m, n;\n    cin >> m >> n;\n    for (int i = 0; i != m; i++)\n      for (int j = 0; j != n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    if (m == 1 && n == 1)\n      sum = array[0][0];\n    else {\n      for (int k = 0; k != n - 1; k++)\n        sum += array[0][k];\n      for (int k = 0; k != m - 1; k++)\n        sum += array[k][n - 1];\n      for (int k = n - 1; k != 0; k--)\n        sum += array[m - 1][k];\n      for (int k = m - 1; k != 0; k--)\n        sum += array[k][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int group = 0;\n  int row = 0, col = 0;\n  int a[100][100];\n  int i, j, sum = 0;\n\n  cin >> group;\n  while (group--) {\n    cin >> row >> col;\n    for (i = 0; i < row; i++) \n      for (j = 0; j < col; j++)\n        cin >> a[i][j];\n    sum = 0;\n    if (row == 1 && col == 1)\n      sum = a[0][0]; \n    else {\n      for (i = 0; i < col; i++) \n      {\n        sum += a[0][i];\n        if (row > 1)\n          sum += a[row - 1][i];\n      }\n      for (i = 1; i <= row - 2; i++) \n      {\n        sum += a[i][0];\n        if (col > 1)\n          sum += a[i][col - 1];\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "6", "index": "11386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, k, j, p, a[1000][1000], sum;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (j = 1; j <= m; j++) {\n      for (p = 1; p <= n; p++) {\n        scanf(\"%d\", &a[j][p]);\n      }\n    }\n    for (p = 1; p <= n; p++) {\n      sum += a[1][p];\n    }\n    for (j = 2; j <= m; j++) {\n      sum += a[j][n];\n    }\n    for (p = n - 1; p >= 1; p--) {\n      sum += a[m][p];\n    }\n    for (j = m - 1; j >= 2; j--) {\n      sum += a[j][1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11387", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  scanf(\"%d \", &t);\n  while (t > 0) {\n    int a[102][102];\n    int m, n;\n    cin >> m >> n;\n    int sum = 0;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    if (m == 1) {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n    } else {\n      for (int i = 0; i < n; i++)\n        sum += *(*a + i);\n      for (int i = 1; i < m - 1; i++)\n        sum = sum + *(*(a + i)) + *(*(a + i) + n - 1);\n      for (int i = 0; i < n; i++)\n        sum += *(*(a + m - 1) + i);\n    }\n    printf(\"%d\\n\", sum);\n    t--;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, **p, i, j, sum, m, n, l;\n  scanf(\"%d\", &N);\n  for (l = 0, sum = 0; l < N; l++) {\n    scanf(\"%d %d\", &m, &n);\n    p = (int **)malloc(m * sizeof(int *));\n    for (i = 0; i < m; i++)\n      *(p + i) = (int *)malloc(n * sizeof(int));\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", *(p + i) + j);\n        if (i == 0 || j == 0 || i == m - 1 || j == n - 1)\n          sum += *(*(p + i) + j);\n      }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "6", "index": "11389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, s;\n  int a[100][100][100];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d\", &b[i], &c[i]);\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k < c[i]; k++)\n        scanf(\"%d\", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    s = 0;\n    if (c[i] > 1) {\n      for (j = 0; j < c[i]; j++)\n        s = s + a[i][0][j] + a[i][b[i] - 1][j];\n    } else {\n      s = s + a[i][0][0];\n    }\n    for (j = 1; j < b[i] - 1; j++) {\n      s = s + a[i][j][0] + a[i][j][c[i] - 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11390", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[10000], i, k, a, b, n, s = 0;\n  int *p, *q;\n  p = c;\n  q = p;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    p = c;\n    q = p;\n    s = 0;\n    cin >> b >> a;\n\n    for (i = 0; i < a * b; i++) {\n\n      scanf(\"%d\", &*p);\n      p++;\n    }\n    p = q;\n    for (i = 0; i < a; i++) {\n      s = s + *p;\n      p++;\n    }\n    p = q;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    p = q + a - 1;\n    for (i = 0; i < b - 2; i++) {\n      p = p + a;\n      s = s + *p;\n    }\n    if (b != 1) {\n      p = q + a * (b - 1);\n      for (i = 0; i < a; i++) {\n\n        s = s + *p;\n        p = p + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "6", "index": "11391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, n, i, col, row, sum[100] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d %d\", &m, &n);\n    int sz[100][100];\n\n    for (row = 0; row < m; row++) {\n      for (col = 0; col < n; col++)\n        scanf(\"%d\", &sz[row][col]);\n    }\n    for (col = 0; col < n - 1; col++)\n      sum[i] += sz[0][col];\n    for (row = 0; row < m - 1; row++)\n      sum[i] += sz[row][n - 1];\n    for (col = n - 1; col > 0; col--)\n      sum[i] += sz[m - 1][col];\n    for (row = m - 1; row > 0; row--)\n      sum[i] += sz[row][0];\n    cout << sum[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, i, j, c;\n  int a[100][100];\n  int b[100] = {0};\n  scanf(\"%d\", &k);\n  for (c = 0; c < k; c++) {\n    scanf(\"%d%d\", &m, &n);\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < n; j++) {\n        if (i == 0 || i == m - 1) {\n          b[c] += a[i][j];\n        } else {\n          if (j == 0 || j == n - 1) {\n            b[c] += a[i][j];\n          }\n        }\n      }\n    }\n  }\n  for (c = 0; c < k; c++) {\n    printf(\"%d\\n\", b[c]);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, m, n;\n  cin >> k;\n  int a[100][100] = {0};\n  int *p, i1, i2, sum = 0;\n  for (; k > 0; k--) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (i1 = 0; i1 < m; i1++) {\n      p = a[i1];\n      for (i2 = 0; i2 < n; i2++) {\n        scanf(\"%d\", p);\n        sum = sum + *p;\n        p++;\n      }\n    }\n    for (i1 = 1; i1 < m - 1; i1++) {\n      p = a[i1];\n      p++;\n      for (i2 = 1; i2 < n - 1; i2++) {\n        sum = sum - *p;\n        p++;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11394", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], b[10000], c[10000], i, l, n, sum[10000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n    for (l = 0; l < a[i] * b[i]; l++) {\n      cin >> c[l];\n      if (l <= b[i] || l >= (b[i] * a[i] - b[i] + 1) || l % b[i] == 0 ||\n          (l + 1) % b[i] == 0)\n        sum[i] += c[l];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "11395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int a[100][100];\n  cin >> k;\n  int m, n;\n  int i, j;\n  int sum;\n  for (int l = 0; l < k; l++) {\n    sum = 0;\n    cin >> m >> n;\n    for (i = 0; i < m; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(a + i) + j);\n      }\n    for (j = 0; j < n; j++) {\n      if (m - 1 != 0)\n        sum += *(*(a + 0) + j) + *(*(a + m - 1) + j);\n      else\n        sum += *(*(a + 0) + j);\n    }\n    for (i = 1; i < m - 1; i++)\n      sum += *(*(a + i) + 0) + *(*(a + i) + n - 1);\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, sum;\n  int i, j, l;\n  int a[101][101];\n  int m, n;\n  sum = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 1; i <= k; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &m, &n);\n    for (j = 1; j <= m; j++) {\n      for (l = 1; l <= n; l++)\n        cin >> a[j][l];\n    }\n    for (j = 1; j <= n; j++)\n      sum = sum + a[1][j] + a[m][j];\n    for (j = 2; j <= m - 1; j++)\n      sum = sum + a[j][1] + a[j][n];\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11397", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], row, line;\n  int i, j, judge = 0, t, T, sum;\n  scanf(\"%d\", &t);\n  for (T = 0; T < t; T++) {\n    sum = 0;\n    scanf(\"%d %d\", &row, &line);\n    if (row == 1 || line == 1) {\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          scanf(\"%d\", (*(a + i) + j));\n      for (i = 0; i < row; i++)\n        for (j = 0; j < line; j++)\n          sum += *(*(a + i) + j);\n      printf(\"%d\\n\", sum);\n      return 0;\n    }\n    for (i = 0; i < row; i++) {\n      for (j = 0; j < line; j++) {\n        scanf(\"%d\", (*(a + i) + j));\n      }\n    }\n    for (i = 0; i < row; i++) {\n      sum += *(*(a + i) + 0);\n      sum += *(*(a + i) + line - 1);\n    }\n    for (j = 0; j < line; j++) {\n      sum += *(*(a + 0) + j);\n      sum += *(*(a + row - 1) + j);\n    }\n    sum = sum - *(*(a + 0) + 0) - *(*(a + 0) + line - 1) -\n          *(*(a + row - 1) + line - 1) - *(*(a + row - 1) + 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int x[100][100];\n  int a, b;\n  int sum;\n  cin >> num;\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d \", &a, &b);\n    for (int j = 0; j < 100; j++) {\n      for (int k = 0; k < 100; k++)\n        x[j][k] = 0;\n    }\n    sum = 0;\n    for (int j = 0; j < a; j++) {\n      for (int k = 0; k < b; k++) {\n        cin >> x[j][k];\n        if (j == 0 || j == a - 1) {\n          sum += x[j][k];\n        } else {\n          if (k == 0 || k == b - 1)\n            sum += x[j][k];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n;\n  scanf(\"%d\", &k);\n\n  for (int l = 1; l <= k; l++) {\n    scanf(\"%d %d\", &m, &n);\n\n    int sz[m][n];\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        scanf(\"%d\", &(sz[j][i]));\n      }\n    }\n\n    int a = 0;\n    for (int j = 0; j < m; j++) {\n      for (int i = 0; i < n; i++) {\n        a += sz[j][i];\n      }\n    }\n    for (int j = 1; j < m - 1; j++) {\n      for (int i = 1; i < n - 1; i++)\n        a -= sz[j][i];\n    }\n    cout << a << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int m;\n  int n;\n  int i, j, t;\n  int a[100][100];\n  scanf(\"%d\", &k);\n  for (t = 1; t <= k; t++) {\n    int sum = 0;\n    cin >> m >> n;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        sum = sum + a[i][j];\n      }\n    }\n    for (i = 1; i <= m - 2; i++) {\n      for (j = 1; j <= n - 2; j++) {\n        sum = sum - a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11401", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, i, n, x, y, u, v;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    scanf(\"%d%d\", &x, &y);\n    for (u = 0; u < x; u++)\n      for (v = 0; v < y; v++)\n        cin >> a[u][v];\n    if (x <= 2 || y <= 2) {\n      for (u = 0; u < x; u++)\n        for (v = 0; v < y; v++)\n          sum += a[u][v];\n    } else {\n      for (u = 0; u < y; u++) {\n        sum += a[0][u];\n        sum += a[x - 1][u];\n      }\n      for (u = 1; u < x - 1; u++) {\n        sum += a[u][0];\n        sum += a[u][y - 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "6", "index": "11402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, x = 0, y = 0, temp = 0, sum = 0, i, j, m;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    sum = 0;\n    scanf(\"%d\", &x);\n    scanf(\"%d\", &y);\n    for (j = 0; j < x; j++) {\n      for (m = 0; m < y; m++) {\n        scanf(\"%d\", &temp);\n        if (j == 0 || m == 0 || j == x - 1 || m == y - 1) {\n          sum = sum + temp;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11403", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int count, m, n, array[100][100], sum[100] = {0}, i, j, p;\n  scanf(\"%d\", &count);\n  for (i = 0; i < count; i++) {\n    scanf(\"%d %d \", &m, &n);\n    for (j = 0; j < m; j++)\n      for (p = 0; p < n; p++)\n        scanf(\"%d\", &array[j][p]);\n    for (j = 0; j < n; j++) {\n      sum[i] = sum[i] + array[0][j];\n      if (m > 1)\n        sum[i] = sum[i] + array[m - 1][j];\n    }\n    for (j = 1; j < m - 1; j++) {\n      sum[i] = sum[i] + array[j][0];\n      sum[i] = sum[i] + array[j][n - 1];\n    }\n  }\n  for (i = 0; i < count; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "6", "index": "11404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][2], num[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i][0] >> a[i][1];\n    num[i] = 0;\n    int b[100][100];\n    for (int j = 0; j < a[i][0]; j++) {\n      for (int k = 0; k < a[i][1]; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[0][j];\n    }\n    for (int j = 0; j < a[i][1]; j++) {\n      num[i] = num[i] + b[a[i][0] - 1][j];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][0];\n    }\n    for (int j = 1; j < a[i][0] - 1; j++) {\n      num[i] = num[i] + b[j][a[i][1] - 1];\n    }\n  }\n  for (int i = 0; i < n; i++)\n    cout << num[i] << endl;\n\n  return 0;\n}\n"}
{"label": "6", "index": "11405", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, q;\n  int a[100][100];\n  int sum = 0;\n  int(*p)[100] = a;\n  cin >> q;\n  for (int i = 0; i < q; i++) {\n    sum = 0;\n    cin >> m >> n;\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (int j = 0; j < m; j++)\n      for (int k = 0; k < n; k++) {\n        if (j == 0 || j == m - 1)\n          sum += p[j][k];\n        else {\n          if (k == 0 || k == n - 1)\n            sum += p[j][k];\n        }\n      }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "6", "index": "11406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, col[1000], row[1000], a[100][1000][1000], c, r, sum[1000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    sum[i] = 0;\n    cin >> col[i];\n    cin >> row[i];\n\n    for (c = 0; c < col[i]; c++) {\n      for (r = 0; r < row[i]; r++) {\n        cin >> a[i][c][r];\n      }\n    }\n\n    for (c = 0; c < row[i]; c++)\n      sum[i] = sum[i] + a[i][0][c] + a[i][col[i] - 1][c];\n    for (c = 1; c < col[i] - 1; c++)\n      sum[i] = sum[i] + a[i][c][0] + a[i][c][row[i] - 1];\n\n    cout << sum[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, ROW[100], COL[100], row, col, a[100][100], s = 0, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &ROW[i], &COL[i]);\n\n    for (row = 0; row < ROW[i]; row++) {\n      for (col = 0; col < COL[i]; col++) {\n        scanf(\"%d\", &a[row][col]);\n      }\n    }\n\n    for (col = 0; col < COL[i]; col++) {\n      s = s + a[0][col] + a[ROW[i] - 1][col];\n    }\n    for (row = 1; row < ROW[i] - 1; row++) {\n      s = s + a[row][0] + a[row][COL[i] - 1];\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "6", "index": "11408", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, m, i, j, s;\n  int a[100][100];\n  int(*p)[100];\n  int sum[100] = {0};\n  cin >> k;\n  for (s = 0; s < k; s++) {\n    p = a;\n    cin >> n >> m;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    }\n    for (i = 0; i < n; i++) {\n      if ((i == 0) || (i == n - 1))\n        for (j = 0; j < m; j++)\n          sum[s] = sum[s] + *(*(p + i) + j);\n      else\n        sum[s] = sum[s] + *(*(p + i)) + *(*(p + i) + m - 1);\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "6", "index": "11409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, sum, x, y;\n  int a[100], b[100], ar[100][100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d\", &a[i], &b[i]);\n    x = a[i] - 1;\n    y = b[i] - 1;\n    for (j = 0; j < a[i]; j++) {\n      for (k = 0; k < b[i]; k++) {\n        scanf(\"%d\", &ar[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = 0; j < a[i]; j++) {\n      sum = sum + ar[j][0] + ar[j][y];\n    }\n    for (k = 0; k < b[i]; k++) {\n      sum = sum + ar[0][k] + ar[x][k];\n    }\n    sum = sum - ar[0][0] - ar[0][y] - ar[x][0] - ar[x][y];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11410", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f[1000];\n\nint kmp(char *p, char *t) {\n  int cur_p = 0, cur_t = 0;\n  int len_p = strlen(p);\n  int len_t = strlen(t);\n  while (cur_p < len_p && cur_t < len_t) {\n    if (p[cur_p] == t[cur_t]) {\n      cur_p++;\n      cur_t++;\n    } else {\n      if (cur_p == 0)\n        cur_t++;\n      else\n        cur_p = f[cur_p - 1] + 1;\n    }\n  }\n  if (cur_p == len_p)\n    return cur_t - len_p;\n  else\n    return -1;\n}\n\nvoid fail(char *p) {\n  int len_p = strlen(p);\n  f[0] = -1;\n  for (int i = 1; i < len_p; i++) {\n    int j = f[i - 1];\n    while (p[i] != p[j + 1] && j >= 0)\n      j = f[j];\n    if (p[i] == p[j + 1])\n      f[i] = j + 1;\n    else\n      f[i] = -1;\n  }\n}\n\nint main() {\n  char string[257], subString[257], replacement[257];\n  char output[512];\n  scanf(\"%s%s%s\", string, subString, replacement);\n  fail(subString);\n  int index = kmp(subString, string);\n  if (index > -1) {\n    int len = strlen(string);\n    int sub_len = strlen(subString);\n    int rep_len = strlen(replacement);\n    int j = 0;\n    for (int i = 0; i < index; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    for (int i = 0; i < rep_len; i++) {\n      output[j] = replacement[i];\n      j++;\n    }\n    for (int i = index + sub_len; i < len; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    output[j] = '\u0000';\n    printf(\"%s\", output);\n  } else\n    printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "11411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s = (char *)malloc(256), *s1 = (char *)malloc(256),\n       *s2 = (char *)malloc(256);\n  int i, j, k, m = 0;\n\n  cin >> s;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = i, k = 0;\n         (*(s + j) != '\u0000') && (*(s1 + k) != '\u0000') && (*(s + j) == *(s1 + k));\n         j++, k++)\n      ;\n    if (k == strlen(s1)) {\n      for (j = i, k = j + strlen(s1); k < strlen(s); k++, j++)\n        *(s + j) = *(s + k);\n      *(s + j + strlen(s2)) = '\u0000';\n      for (j = --j + strlen(s2), k = j - strlen(s2); k >= i; j--, k--)\n        *(s + j) = *(s + k);\n      for (j = i, k = 0; *(s2 + k) != '\u0000'; j++, k++)\n        *(s + j) = *(s2 + k);\n      m = m + 1;\n    }\n    if (m != 0)\n      break;\n  }\n  puts(s);\n}\n"}
{"label": "7", "index": "11412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, n, m, d = 0;\n  int e = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      if (a[i + 1] == b[1]) {\n        if (a[i + 2] == b[2]) {\n          d = i;\n          break;\n        }\n      }\n    }\n  }\n\n  m = strlen(c);\n  if (d != 0) {\n\n    for (i = d; i < d + m; i++) {\n\n      a[i] = c[e];\n      e++;\n    }\n  }\n  puts(a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], a[256], b[256], c[256];\n  int i, j, t = 0;\n  cin >> str >> a >> b;\n  for (i = 0; i < strlen(str); i++) {\n    for (j = 0; j < strlen(a); j++)\n      c[j] = str[i + j];\n    c[j] = '\\0';\n    if (strcmp(c, a) == 0) {\n      t = 1;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; j < strlen(b); j++)\n      printf(\"%c\", b[j]);\n    for (j = i + strlen(a); str[j] != 0; j++)\n      printf(\"%c\", str[j]);\n  } else\n    printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11414", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300];\n  char b[200], c[200], d[200] = {0};\n  int n1, n2, n3, i, j, k, result, p, w;\n  scanf(\"%s%s%s\", a, b, c);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n3 = strlen(c);\n  p = 0;\n  k = 10000;\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    if (p == 0) {\n      for (j = 0; j < n2; j++) {\n        d[j] = a[i + j];\n      }\n      result = strcmp(d, b);\n      if (result == 0) {\n        k = i;\n        p = 1;\n        w = i + j;\n      }\n    }\n  }\n  if (k == 10000)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = w; i < n1; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], word1[100], word2[100];\n  cin >> a >> word1 >> word2;\n  int la, l1, l2, i, j, k, flag;\n  la = strlen(a);\n  l1 = strlen(word1);\n  l2 = strlen(word2);\n  for (i = 0; i < la; i++) {\n    if (a[i] == word1[0]) {\n      for (j = 0; j < l1; j++) {\n        flag = 1;\n        if (a[i + j] != word1[j])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (k = 0; k < l2; k++) {\n          a[i + k] = word2[k];\n        }\n      }\n      if (flag == 1) {\n        printf(\"%s\\n\", a);\n        break;\n      }\n    }\n    if (i == la - 1) {\n      printf(\"%s\\n\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11416", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260], str2[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int i = 0;\n  scanf(\"%s %s %s \", str, subStr, replace);\n  node = strstr(str, subStr);\n  if (node == NULL)\n    cout << str;\n  else {\n    while (start != node)\n      str2[i++] = *start++;\n    while (*rep != '\\0')\n      str2[i++] = *rep++;\n    node += strlen(subStr);\n    while (*node != '\\0') {\n      str2[i++] = *node++;\n    }\n    str2[i] = '\\0';\n    cout << str2;\n  }\n  cout << endl;\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "11417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char src[256];\n  char dst[256];\n  char replacement[256];\n\n  scanf(\"%s\", src);\n  scanf(\"%s\", dst);\n  scanf(\"%s\", replacement);\n  char *p = strstr(src, dst);\n  if (p == NULL) {\n    cout << src << \"\\n\";\n  } else {\n    int len = strlen(replacement);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = replacement[i];\n      p++;\n    }\n    printf(\"%s\\n\", src);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000 + 2], b[1000 + 1], c[1000 + 1];\n\n  cin >> a;\n  scanf(\"%s \", b);\n  cin >> c;\n  int len, len1, len2, i, j, flag = 1;\n  len = strlen(a);\n  len1 = strlen(b);\n  len2 = strlen(c);\n  for (i = 0; i < len; i++) {\n    if (i <= len - len1 && flag == 1) {\n      if (a[i] == b[0] && a[i + 1] == b[1] && a[i + len1 - 1] == b[len1 - 1]) {\n        for (j = 0; j < len2; j++)\n          printf(\"%c\", c[j]);\n        i = i + len1 - 1;\n        flag = 0;\n      } else\n        printf(\"%c\", a[i]);\n    } else\n      cout << a[i];\n  }\n}\n"}
{"label": "7", "index": "11419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  char *str, *sub;\n  int a, n = 0, b;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  sub = substring;\n  a = strlen(substring);\n\n  for (str = string; *str != '\\0'; str++) {\n    if (*sub == *str) {\n      if (*(sub + 1) != '\\0') {\n        sub++;\n      } else {\n        str = str - a + 1;\n        n = 1;\n        break;\n      }\n    } else {\n      sub = substring;\n    }\n  }\n\n  if (n == 0) {\n    printf(\"%s\", string);\n    return 0;\n  }\n\n  sub = replacement;\n  for (b = 0; b < strlen(substring); b++) {\n    *str = *sub;\n    sub++;\n    str++;\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "11420", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, count, c = 0;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n\n  scanf(\"%s \", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++) {\n        if (s1[i + j] == s2[j])\n          count++;\n      }\n    if (count == len2) {\n      for (j = 0; j < len2; j++)\n        s1[i + j] = s3[j];\n      c++;\n    }\n    if (c == 1)\n      break;\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "11421", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[256], wt[256], tar[256];\n  int i, j, tag;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", wt);\n  scanf(\"%s\", tar);\n  int n = strlen(zfc);\n  int k = strlen(wt);\n  for (i = 0; i < n - k + 1; i++) {\n    tag = 0;\n    for (j = i; j < i + k; j++) {\n      if (zfc[j] != wt[j - i]) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (j = i; j < i + k; j++) {\n        zfc[j] = tar[j - i];\n      }\n      break;\n    }\n  }\n  puts(zfc);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11422", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, m, n, i, j, s, k;\n  char string[256], substring[256], replacement[256];\n  char t;\n  cin >> string;\n  scanf(\"%s\", substring);\n  cin >> replacement;\n  l = strlen(string);\n  m = strlen(substring);\n  t = substring[0];\n  for (i = 0; i <= l - m; i++) {\n    s = 0;\n    if (string[i] == t) {\n      for (j = i; j <= i + m - 1; j++) {\n        if (string[j] == substring[j - i])\n          s++;\n      }\n      if (s == m) {\n        for (k = 0; k <= m - 1; k++) {\n          string[i + k] = replacement[k];\n        }\n        i = l - m;\n      } else {\n        i++;\n      }\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[256], substring[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  scanf(\"%s %s %s \", string, substring, replacement);\n  int mainlen = strlen(string), sublen = strlen(substring);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, substring)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "11424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string1[256], string2[256], string3[256];\n  cin >> string1;\n  scanf(\"%s\", string2);\n  scanf(\"%s\", string3);\n  int length1, length2, length3, i, j, temp;\n  length1 = strlen(string1);\n  length2 = strlen(string2);\n  length3 = strlen(string3);\n  for (i = 0; i <= (length1 - length2); i++) {\n    if (string1[i] == string2[0]) {\n      j = 1;\n      temp = i + 1;\n      while (j < length2 && string1[temp] == string2[j]) {\n        temp++;\n        j++;\n      }\n      if (j == length2) {\n        strcpy(string2, string1 + temp);\n        strcpy(string1 + i, string3);\n        strcpy(string1 + i + length3, string2);\n        break;\n      }\n    }\n  }\n  cout << string1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "11425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], su[256], re[256];\n  char t[256] = {0};\n\n  cin >> s;\n\n  cin >> su;\n\n  cin >> re;\n\n  int i, j = 0, len = strlen(s);\n  int len1 = strlen(su);\n  for (i = 0; i < len; i++) {\n    if (s[i] != su[j]) {\n      j = 0;\n    }\n\n    else {\n\n      j++;\n    }\n    if (j == len1) {\n\n      break;\n    }\n  }\n\n  if (j != len1) {\n    cout << s;\n  }\n\n  int n = i + 1;\n  if (i != len) {\n    int m = 0;\n    for (n = i + 1; n < len; n++) {\n\n      t[m] = s[n];\n      m++;\n    }\n\n    int len2 = strlen(t);\n\n    s[len - len2 - len1] = '\u0000';\n    strcat(s, re);\n    strcat(s, t);\n\n    printf(\"%s\", s);\n  }\n  if ((i == len) && (j == len1)) {\n\n    s[len - len1] = '\u0000';\n\n    strcat(s, re);\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11426", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sta[256];\n  char stb[256];\n  char res[512] = \"\";\n\n  cin >> str;\n\n  scanf(\"%s \", sta);\n\n  cin >> stb;\n\n  char *a = str;\n  char *b = 0;\n\n  if (b = strstr(a, sta)) {\n    strncat(res, a, b - a);\n    strcat(res, stb);\n    a = b + strlen(sta);\n  }\n\n  strcat(res, a);\n\n  printf(\"%s \", res);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char y[100], h[100], c[100];\n  int i, j, len[3], count = 0, k = 0, a[100];\n  scanf(\"%s\", &y);\n  scanf(\"%s\", &h);\n  scanf(\"%s\", &c);\n  for (i = 0; i < strlen(y); i++) {\n    for (j = 0; j < strlen(h); j++) {\n      if (y[i + j] == h[j]) {\n        count++;\n      }\n    }\n    if (count == strlen(h)) {\n      k++;\n      a[k] = i;\n    }\n    count = 0;\n  }\n  if (k == 0) {\n    printf(\"%s\", y);\n    return 0;\n  }\n  for (i = 0; i < a[1]; i++)\n    printf(\"%c\", y[i]);\n  printf(\"%s\", c);\n  if (i == k)\n    return 0;\n  for (j = a[1] + strlen(h); j < strlen(y); j++) {\n    cout << y[j];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++)\n        c[f] = a[j];\n\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        cout << g;\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s %s %s\", a, b, c);\n  int i, j, t, l, k = 0, m = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l - t + 1; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i + j] != b[j])\n        k = 0;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if (t == k) {\n        m = i;\n        i = l;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"%s\", a);\n  if (m != 0) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", a[i]);\n    cout << c;\n    for (i = m + t; i < l; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, a1, b1, c1, n = 0, m, t, j, p = 0;\n  cin >> a >> b >> c;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i < a1; i++) {\n    for (j = 0; j < b1; j++) {\n      if (a[i + j] == b[j])\n        p = p + 1;\n    }\n    if (p == b1) {\n      for (m = 0; m < i; m++)\n        printf(\"%c\", a[m]);\n      printf(\"%s\", c);\n      for (m = b1 + i; m < a1; m++)\n        cout << a[m];\n      n = 9;\n      break;\n    }\n    p = 0;\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11431", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[300], b[300], c[300];\n  char *p, *q;\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  cin >> c;\n  len = strlen(b);\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL) {\n    printf(\"%s\", a);\n  } else {\n    while (q < p) {\n      cout << *q;\n      q++;\n    }\n    q = p + len;\n    cout << c;\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, countb, re;\n  char a[256];\n  char b[20];\n  char c[20];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; b[i] != 0; i++) {\n    countb = i;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    re = 0;\n    if (a[i] == b[0]) {\n      for (j = i; b[j - i] != '\u0000'; j++) {\n        if (a[j] != b[j - i])\n          break;\n      }\n      if (j == i + countb + 1) {\n        re = 1;\n        for (j = i; j <= i + countb; j++)\n          a[j] = c[j - i];\n      }\n    } else\n      continue;\n    if (re == 1)\n      break;\n  }\n  printf(\"%s\", a);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11433", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int la, lb, lc, i, j, p = 0;\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    if (b[0] == a[i]) {\n      for (j = 1; j < lb; j++) {\n        if (b[j] == a[i + j])\n          p = 0;\n        else {\n          p = 1;\n        }\n      }\n      if (p == 0) {\n        for (j = 0; j < lc; j++)\n          a[i + j] = c[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, y, x = 0, q = 0;\n  char a[257], b[257], c[257];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j < strlen(a); j++) {\n    if (b[i] == a[j]) {\n      for (k = 0; k < strlen(b); k++) {\n        if (b[i + k] == a[j + k]) {\n          x++;\n        }\n        if (x == strlen(b)) {\n          for (y = 0; y < j; y++) {\n            printf(\"%c\", a[y]);\n          }\n          for (y = 0; y < strlen(c); y++) {\n            printf(\"%c\", c[y]);\n          }\n          for (y = j + strlen(b); y < strlen(a); y++) {\n            printf(\"%c\", a[y]);\n          }\n          q++;\n          break;\n        }\n      }\n    }\n    if (q == 1) {\n      break;\n    }\n    if (j == strlen(a) - 1) {\n      printf(\"%s\", a);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  int t2 = 0;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      t2 += 1;\n    }\n\n    if (t == 1 && t2 == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, m = 0, L, l1, l2;\n  char s[256], a[100], b[100];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      for (m = 0; m < l2; m++) {\n        s[i + m] = b[m];\n      }\n      break;\n    }\n  }\n  for (k = 0; k < i + m; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (i = i + l1; i < L; i++) {\n    printf(\"%c\", s[i]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11437", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, len3;\nchar replacement[256];\nvoid answer(char str[260], char substr[256]);\nint main() {\n  char str[260], substr[256];\n  cin.getline(str, 260);\n  cin.getline(substr, 256);\n  cin.getline(replacement, 256);\n  len1 = strlen(str);\n  len2 = strlen(substr);\n  len3 = strlen(replacement);\n  answer(str, substr);\n  return 0;\n}\nvoid answer(char str[260], char substr[256]) {\n  int i, k, count, num = 0;\n  for (i = 0; i < len1; i++) {\n    if (str[i] == substr[0]) {\n      count = 0;\n      for (k = i;; k++) {\n        if ((str[k] == substr[count]) && (str[k] != '\\0'))\n          count++;\n        else\n          break;\n      }\n      if (count == len2) {\n        num++;\n        for (k = 0; k < i; k++)\n          cout << str[k];\n        for (k = 0; k < len3; k++)\n          printf(\"%c\", replacement[k]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", str[k]);\n        break;\n      }\n    }\n  }\n  if (num == 0) {\n    for (i = 0; i < len1; i++) {\n      cout << str[i];\n    }\n  }\n}\n"}
{"label": "7", "index": "11438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int i, j, a, b, t;\n  scanf(\"%s%s%s\", w, s, r);\n  b = strlen(w);\n  a = strlen(s);\n  for (i = 0; i < b; i++) {\n    if (s[0] == w[i]) {\n      for (j = 0; j < a; j++) {\n        if (s[j] != w[i + j])\n          break;\n      }\n      if (j == a) {\n        for (t = 0; t < a; t++)\n          w[i + t] = r[t];\n        for (t = 0; t < b; t++)\n          printf(\"%c\", w[t]);\n        break;\n      }\n    }\n  }\n  if (i == b) {\n    for (t = 0; t < b; t++)\n      printf(\"%c\", w[t]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, e;\n  char s[256];\n  char b[256];\n  char a[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int c;\n  i = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    j = 0;\n    c = 0;\n    e = i;\n    if (s[i] == a[j]) {\n      for (; a[j] != '\u0000'; j++, i++) {\n        if (a[j] != s[i]) {\n          c++;\n        }\n      }\n      if (c == 0) {\n        for (j = 0; a[j] != '\u0000'; j++, e++) {\n          s[e] = b[j];\n        }\n        break;\n      }\n    }\n    i = e;\n  }\n\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "11440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], z[200], h[200], t[100];\n  int lens, lenz, lenh, i, j, sum, r, q = 0, p = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", z);\n\n  cin >> h;\n  lens = strlen(s);\n  lenz = strlen(z);\n  lenh = strlen(h);\n  for (i = 0; i < lens; i++) {\n    sum = 0;\n    for (j = 0; j < lenz; j++) {\n      if (s[i + j] == z[j]) {\n        sum++;\n      } else\n        break;\n    }\n    if (sum == lenz) {\n      r = i;\n      q = 1;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < r; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", h);\n    for (i = r + sum; i < lens; i++)\n      printf(\"%c\", s[i]);\n  } else if (q == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256];\n  char s2[256];\n  char s3[256];\n  int i, j, q;\n  scanf(\"%s\\n%s\\n%s\", s1, s2, s3);\n  \n  int k1 = strlen(s1);\n  int k2 = strlen(s2);\n  for (i = 0; i < k1; i++) {\n    int k = 0;\n    for (j = 0; j < k2; j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n      if (s1[i + j] == s2[j]) {\n        k++;\n      }\n    }\n\n    if (k == k2) {\n      q = i;\n      break;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != q) {\n      printf(\"%c\", s1[i]);\n    }\n    if (i == q) {\n      printf(\"%s\", s3);\n      i = i + k2 - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char origin[256], sub[256], replace[256], after[256];\n  scanf(\"%s%s%s\", origin, sub, replace);\n\n  int i, j;\n\n  for (i = 0; origin[i]; i++) {\n    int shouldChange = 1;\n    for (j = 0; sub[j]; j++) {\n      if (origin[i + j] != sub[j]) {\n        shouldChange = 0;\n      }\n    }\n    if (shouldChange == 1) {\n      strcpy(after, origin);\n      after[i] = 0;\n      strcat(after, replace);\n      strcat(after, &origin[i + strlen(sub)]);\n      strcpy(origin, after);\n      i += strlen(replace);\n      break;\n    }\n  }\n  cout << origin;\n  return 0;\n}\n"}
{"label": "7", "index": "11443", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256] = {0}, huan[256] = {0}, hou[256] = {0};\n  int i, e, k, len1, len2, len3, count;\n\n  cin >> yuan;\n\n  cin >> huan;\n\n  cin >> hou;\n  len1 = strlen(yuan);\n  len2 = strlen(huan);\n  len3 = strlen(hou);\n\n  int p = 0;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    count = 0;\n    if (yuan[i] == huan[0]) {\n      for (e = 0; e < len2; e++)\n        if (yuan[i + e] == huan[e])\n          count++;\n      if (count == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", yuan[k]);\n        for (k = i; k < len3 + i; k++)\n          printf(\"%c\", hou[k - i]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", yuan[k]);\n        p = 1;\n        break;\n      }\n    }\n  }\n\n  if (p == 0)\n    printf(\"%s\", yuan);\n  return 0;\n}\n"}
{"label": "7", "index": "11444", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], ss[257], r[257];\n  scanf(\"%s\", s);\n  scanf(\"%s\", ss);\n  scanf(\"%s \", r);\n  char left[257];\n  int i, t, k, j;\n  int ls = strlen(s);\n  int lss = strlen(ss);\n\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = 0; j < lss; j++) {\n      if (ss[j] == s[i + j]) {\n        t++;\n      }\n    }\n    if (t == lss) {\n      for (k = 0; k < ls - i - lss; k++) {\n        left[k] = s[k + i + t];\n      }\n      left[k] = '\\0';\n      s[i] = '\\0';\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  if (t == lss) {\n    printf(\"%s\", r);\n    printf(\"%s\", left);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[100], b[100];\n  int i = 0, z = 0, c = 0, d, j, f, e;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  c = strlen(a);\n  e = strlen(s);\n  while (i < e) {\n    if (s[i] == a[z]) {\n      f = 0;\n      for (d = i; d < i + c; d++) {\n        if (s[d] == a[z]) {\n          f++;\n          z++;\n        }\n      }\n      if (f == c) {\n        z = 0;\n        for (d = i; d < i + c; d++) {\n          s[d] = b[z];\n          z++;\n        }\n        break;\n      } else {\n        z = 0;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < e; i++) {\n    cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11446", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f[1000];\n\nint kmp(char *p, char *t) {\n  int cur_p = 0, cur_t = 0;\n  int len_p = strlen(p);\n  int len_t = strlen(t);\n  while (cur_p < len_p && cur_t < len_t) {\n    if (p[cur_p] == t[cur_t]) {\n      cur_p++;\n      cur_t++;\n    } else {\n      if (cur_p == 0)\n        cur_t++;\n      else\n        cur_p = f[cur_p - 1] + 1;\n    }\n  }\n  if (cur_p == len_p)\n    return cur_t - len_p;\n  else\n    return -1;\n}\n\nvoid fail(char *p) {\n  int len_p = strlen(p);\n  f[0] = -1;\n  for (int i = 1; i < len_p; i++) {\n    int j = f[i - 1];\n    while (p[i] != p[j + 1] && j >= 0) {\n      j = f[j];\n    }\n    if (p[i] == p[j + 1]) {\n      f[i] = j + 1;\n    } else\n      f[i] = -1;\n  }\n}\n\nint main() {\n  char string[257], subString[257], replacement[257];\n  char output[512];\n  scanf(\"%s%s%s\", string, subString, replacement);\n  fail(subString);\n  int index = kmp(subString, string);\n  if (index > -1) {\n    int len = strlen(string);\n    int sub_len = strlen(subString);\n    int rep_len = strlen(replacement);\n    int j = 0;\n    for (int i = 0; i < index; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    for (int i = 0; i < rep_len; i++) {\n      output[j] = replacement[i];\n      j++;\n    }\n    for (int i = index + sub_len; i < len; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    output[j] = '\u0000';\n    printf(\"%s\", output);\n  } else\n    printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "11447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  int i, k = 0, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int n = strlen(str);\n  int m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (sub[k] == str[i])\n      k++;\n    else {\n      k = 0;\n      if (sub[k] == str[i])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j - m + 1] = re[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11448", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[1000 + 1], substring[1000 + 1], replacement[1000 + 1],\n      out[1000 + 1];\n  int h, i, j, k, n, l, lsub, lreplace, count, heihei = 0;\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n  l = strlen(string);\n  lsub = strlen(substring);\n  lreplace = strlen(replacement);\n  for (i = 0, n = 0; i < l; i++, n++) {\n    count = 0;\n    for (j = 0; (j < lsub) && (heihei == 0) && (string[i + lsub - 1] != '\u0000');\n         j++) {\n      if (string[i + j] == substring[j])\n        count++;\n    }\n    if (count == lsub) {\n      heihei = 1;\n      for (k = 0; k < lreplace; k++, n++) {\n        out[n] = replacement[k];\n      }\n      i = i + lsub - 1;\n      n--;\n    } else\n      out[n] = string[i];\n  }\n  out[l + lreplace - lsub] = '\u0000';\n  printf(\"%s \", out);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, result;\n  char input[100], substring[20], replace[20], cpy[20];\n  scanf(\"%s\\n%s\\n%s\", input, substring, replace);\n  result = strlen(input) - strlen(substring);\n  for (i = 0; i <= result; i++) {\n    if (input[i] == substring[0]) {\n      int a;\n      a = strlen(substring);\n      for (j = 0; j < a; j++) {\n        cpy[j] = input[i + j];\n        cpy[j + 1] = '\\0';\n      }\n      int m;\n      m = strcmp(cpy, substring);\n      if (m == 0) {\n\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", input[k]);\n        }\n        printf(\"%s\", replace);\n        for (k = i + a; k < strlen(input); k++) {\n          printf(\"%c\", input[k]);\n        }\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", input);\n  return 0;\n}\n"}
{"label": "7", "index": "11450", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f[1000];\n\nint kmp(char *p, char *t) {\n  int cur_p = 0, cur_t = 0;\n  int len_p = strlen(p);\n  int len_t = strlen(t);\n  while (cur_p < len_p && cur_t < len_t) {\n    if (p[cur_p] == t[cur_t]) {\n      cur_p++;\n      cur_t++;\n    } else {\n      if (cur_p == 0)\n        cur_t++;\n      else\n        cur_p = f[cur_p - 1] + 1;\n    }\n  }\n  if (cur_p == len_p)\n    return cur_t - len_p;\n  else\n    return -1;\n}\n\nvoid fail(char *p) {\n  int len_p = strlen(p);\n  f[0] = -1;\n  for (int i = 1; i < len_p; i++) {\n    int j = f[i - 1];\n    while (p[i] != p[j + 1] && j >= 0)\n      j = f[j];\n    if (p[i] == p[j + 1])\n      f[i] = j + 1;\n    else\n      f[i] = -1;\n  }\n}\n\nint main() {\n  char string[257], subString[257], replacement[257];\n  char output[512];\n  scanf(\"%s%s%s\", string, subString, replacement);\n  fail(subString);\n  int index = kmp(subString, string);\n  if (index > -1) {\n    int len = strlen(string);\n    int sub_len = strlen(subString);\n    int rep_len = strlen(replacement);\n    int j = 0;\n    for (int i = 0; i < index; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    for (int i = 0; i < rep_len; i++) {\n      output[j] = replacement[i];\n      j++;\n    }\n    for (int i = index + sub_len; i < len; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    output[j] = '\u0000';\n    printf(\"%s\", output);\n  } else\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11451", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar *strrpl(char *src, char *sub, char *rpl) {\n  char *p = strstr(src, sub);\n  int a, b;\n  if (p == NULL)\n    return src;\n  a = strlen(sub);\n  b = strlen(rpl);\n  memmove(p + b, p + a, strlen(p + a) + 1);\n  memcpy(p, rpl, b);\n  return src;\n}\nint main() {\n  char str[256], sub[256], rpl[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rpl;\n  puts(strrpl(str, sub, rpl));\n}\n"}
{"label": "7", "index": "11452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char z[257];\n  char y[257];\n  char t[257];\n  int i, p;\n  int v, x, s;\n  int result;\n  int word = 0;\n  int a;\n\n  cin >> y;\n\n  cin >> z;\n\n  cin >> t;\n  v = strlen(z);\n  x = strlen(y);\n  s = strlen(t);\n\n  for (i = 0; y[i] != '\u0000'; i++) {\n    if ((y[i] == z[0]) && (y[i + v - 1] == z[v - 1])) {\n      for (p = 0; p <= v - 1; p++) {\n        if (y[i + p] == z[p]) {\n          word++;\n        }\n      }\n      if (word == v) {\n\n        a = i;\n\n        result = 0;\n      }\n    }\n  }\n\n  if (result == 0) {\n    for (i = 0; i <= a - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n    for (i = 0; i <= s - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    for (i = a + v; i <= x - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n  } else {\n    printf(\"%s\", y);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, flag = 0;\n  char str[512], substr[256], replace[256];\n  cin.getline(str, 512);\n  cin.getline(substr, 256);\n  cin.getline(replace, 256);\n  int len1 = strlen(str);\n  int len2 = strlen(substr);\n  int len3 = strlen(replace);\n  for (i = 0; i <= len1 - len2; i++) {\n    k = i;\n    for (j = 0; j < len2; j++) {\n      if (str[k++] != substr[j]) {\n        break;\n      }\n    }\n    if (j == len2 && flag == 0) {\n      int ii;\n      for (ii = i; ii < i + len3; ii++) {\n        str[ii] = replace[ii - i];\n      }\n      flag = 1;\n    }\n  }\n  for (i = 0; str[i] != '\\0'; i++) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int d[1000];\n  int i, j = 0, k, m, n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == '\u0000')\n      break;\n    else {\n      if (a[i] == b[0]) {\n        j++;\n        d[j] = i;\n      }\n    }\n  }\n  if (j == 0)\n    printf(\"%s\", a);\n  else {\n    m = j;\n    for (i = 0;; i++) {\n      if (b[i] == '\u0000')\n        break;\n    }\n    n = i;\n    for (j = 0; j < m; j++) {\n      k = d[j];\n      for (i = 0; i < n; i++) {\n        if (b[i] != a[i + k])\n          break;\n      }\n      if (i == n)\n        break;\n    }\n    for (i = 0; i < n; i++) {\n      a[i + d[j]] = c[i];\n    }\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11455", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n\n  int len1, len2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  int i, j, k = 0;\n  int tag = 0, tag1;\n\n  for (i = 0, j = 0; j < len1; j++) {\n    if (tag != 1 && k == 0) {\n      if (s2[i] == s1[j]) {\n        for (k = j + 1, i = i + 1; i < len2; k++) {\n          if (s2[i] != s1[k]) {\n            i = 0;\n          }\n\n          else {\n            i++;\n            if (i == len2) {\n              tag = 1;\n              tag1 = k - len2 + 1;\n            }\n          }\n        }\n      }\n    } else if (tag != 1 && k == len1)\n      break;\n    else if (tag == 1)\n      break;\n  }\n\n  if (tag == 0) {\n    printf(\"%s\", s1);\n  } else {\n    int t, m;\n    for (t = tag1, m = 0; t < tag1 + len2; t++) {\n      s1[t] = s3[m];\n      m++;\n      if (m == len2) {\n        break;\n      }\n    }\n    printf(\"%s\", s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11456", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s = (char *)malloc(256), *s1 = (char *)malloc(256),\n       *s2 = (char *)malloc(256);\n  int i, j, k, m = 0;\n  cin >> s;\n  cin >> s1;\n  scanf(\"%s \", s2);\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = i, k = 0;\n         (*(s + j) != '\u0000') && (*(s1 + k) != '\u0000') && (*(s + j) == *(s1 + k));\n         j++, k++)\n      ;\n    if (k == strlen(s1)) {\n      for (j = i, k = j + strlen(s1); k < strlen(s); k++, j++)\n        *(s + j) = *(s + k);\n      *(s + j + strlen(s2)) = '\u0000';\n      for (j = --j + strlen(s2), k = j - strlen(s2); k >= i; j--, k--)\n        *(s + j) = *(s + k);\n      for (j = i, k = 0; *(s2 + k) != '\u0000'; j++, k++)\n        *(s + j) = *(s2 + k);\n      m = m + 1;\n    }\n    if (m != 0)\n      break;\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  for (int i = 0; a[i] != '\\0'; i++) {\n    int j;\n    for (j = 0; (b[j] == a[i + j]) && (b[j] != '\\0'); j++)\n      ;\n    if (b[j] == '\\0') {\n      for (int k = 0; k < i; k++) {\n        printf(\"%c\", a[k]);\n      }\n      printf(\"%s\", c);\n      for (int k = i + j; a[k] != '\\0'; k++)\n        printf(\"%c\", a[k]);\n      return 0;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11458", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  int x;\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n  x = strstr(string, substring) - &string[0];\n  if (strchr(string, substring[0]) != 0)\n    memmove(string + x, replacement, strlen(replacement));\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid adds(char *a, char *b);\nvoid addc(char *a, char c);\nint main() {\n  char s[256];\n  char subs[256];\n  char replace[256];\n  char result[1000] = \"\";\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> replace;\n\n  int len_s = strlen(s);\n  int len_subs = strlen(subs);\n  int len_replace = strlen(replace);\n  int i, j = 0;\n  int finish = 0;\n  for (i = 0; i < len_s; i++) {\n    if (s[i] == subs[j] && finish == 0)\n      if (j == len_subs - 1) {\n        adds(result, replace);\n        j = 0;\n        finish = 1;\n\n      } else\n        j++;\n    else {\n      i -= j;\n      j = 0;\n      addc(result, s[i]);\n    }\n  }\n  cout << result << \" \";\n\n  return 0;\n}\n\nvoid adds(char *a, char *b) {\n  int len_a = strlen(a);\n  int len_b = strlen(b);\n  int i;\n  for (i = len_a; i <= len_a + len_b - 1; i++)\n    *(a + i) = *(b + i - len_a);\n  *(a + len_a + len_b) = '\u0000';\n}\n\nvoid addc(char *a, char c) {\n  int len_a = strlen(a);\n  *(a + len_a) = c;\n  *(a + len_a + 1) = '\u0000';\n}\n"}
{"label": "7", "index": "11460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256], sl[256];\n  int n, m, i, j, k, e, l;\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &sub);\n  scanf(\"%s\", &re);\n  l = 0;\n  while (s[l] != '\u0000')\n    l++;\n  m = 0;\n  while (sub[m] != '\u0000')\n    m++;\n  n = 0;\n  while (re[n] != '\u0000')\n    n++;\n  for (i = 0; i < l; i++) {\n    k = 1;\n    for (j = 0; j < m; j++)\n      if (s[i + j] != sub[j]) {\n        k = 0;\n        break;\n      }\n    if (k == 1) {\n      e = i;\n      break;\n    }\n  }\n  if (k == 1) {\n    for (i = e + m - 1; s[i] != '\u0000'; i++)\n      sl[i] = s[i];\n    sl[i + 1] = '\u0000';\n    for (i = 0; i < n; i++)\n      s[e + i] = re[i];\n    for (i = e + n; sl[i - n + m] != '\u0000'; i++)\n      s[i] = s[i - n + m];\n    s[i + 1] = '\u0000';\n  }\n  for (i = 0; s[i] != '\u0000'; i++)\n    printf(\"%c\", s[i]);\n  printf(\" \");\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11461", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint Issubstr(char *s, char *subs) {\n  int i, j;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = 0; j < strlen(subs); j++) {\n      if (subs[j] != s[i + j])\n        break;\n    }\n    if (j == strlen(subs))\n      break;\n  }\n  if (i < strlen(s))\n    return i;\n  return -1;\n}\nint main() {\n  char s[257], sub[257], replace[257];\n  int i, j = 0;\n  scanf(\"%s%s%s\", s, sub, replace);\n  for (i = Issubstr(s, sub); i != -1 && j < strlen(replace); i++) {\n    s[i] = replace[j++];\n  }\n  if (i > strlen(s))\n    s[i] = '\\0';\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, len2, i, j, f, ff;\n  char s[300], sub[300], replace[300];\n\n  scanf(\"%s \", s);\n  len = strlen(s);\n\n  cin >> sub;\n\n  cin >> replace;\n  len2 = strlen(sub);\n  f = 0;\n  for (i = 0; i <= len - len2; i++) {\n    ff = 1;\n    for (j = 0; j < len2; j++)\n      if (sub[j] != s[i + j]) {\n        ff = 0;\n        break;\n      }\n    if (ff == 0)\n      continue;\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", s[j]);\n    }\n    cout << replace;\n    for (j = i + len2; j < len; j++)\n      printf(\"%c\", s[j]);\n    f = 1;\n    break;\n  }\n  if (f == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf[266];\n  char a[266];\n  char b[266];\n  int i, k, j = 0, c = 0, d = 0, p = 0, mark = 0;\n  scanf(\"%s\", zf);\n  c = strlen(zf);\n  scanf(\"%s\", a);\n  d = strlen(a);\n  scanf(\"%s\", b);\n  for (i = 0; i < c; i++) {\n    if (zf[i] == a[0]) {\n      for (k = 0; k < d; k++) {\n        if (zf[i + k] == a[k]) {\n          j++;\n          if (j == d) {\n            p = i;\n            mark = 1;\n          }\n        }\n      }\n    }\n  }\n  if (mark == 1) {\n    for (i = 0; i < p; i++) {\n      printf(\"%c\", zf[i]);\n    }\n    cout << b;\n    for (i = p + d; i < c; i++) {\n      printf(\"%c\", zf[i]);\n    }\n  }\n  if (mark == 0)\n    printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "11464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, n, m, d, k, y, v = 0;\n  char s[256], b[256], t[256];\n  scanf(\"%s%s%s\", s, b, t);\n  n = strlen(s);\n  m = strlen(b);\n  for (i = 0; i <= n - m; i++) {\n    if (s[i] == b[0]) {\n      k = i;\n      for (j = 0, x = i; j < m; j++, x++) {\n        if (s[x] != b[j])\n          break;\n      }\n      if (j >= m)\n        for (d = k, y = 0; d < k + m; d++, y++) {\n          s[d] = t[y];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char string[256], substring[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  cin >> string >> substring >> replacement;\n  int mainlen = strlen(string), sublen = strlen(substring);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, substring)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[257], rep[257];\n  int i, j, t, k;\n  int len_s, len_sub, len_rep;\n  cin.getline(s, 257);\n  cin.getline(sub, 257);\n  cin.getline(rep, 257);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  len_rep = strlen(rep);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      printf(\"%c\", s[i + len_sub + k]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[200], str1[50], str2[50];\n  char *p, *q;\n  int length, i;\n  cin.getline(str, 200);\n  scanf(\"%s %s \", str1, str2);\n  length = strlen(str1);\n  q = str;\n  p = strstr(str, str1);\n  if (p != NULL) {\n    q = p + length;\n    for (i = 0; &str[i] != p; i++)\n      cout << str[i];\n    cout << str2;\n    for (; *q != '\\0'; q++) {\n      printf(\"%c\", *q);\n    }\n    cout << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[600];\n  char sub[300], rep[300];\n  int i, j, k, sun00 = 0, se = 0;\n  scanf(\"%s \", str);\n  cin >> sub;\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        sun00 = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (sun00 < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  cout << \"str\";\n  return 0;\n}\n"}
{"label": "7", "index": "11469", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  cin >> str >> sub >> rep;\n  int len = strlen(sub);\n  int i = 0;\n  char *p, *q, *r;\n  p = strstr(str, sub);\n  q = rep;\n  if (p != NULL) {\n    for (r = p; r < p + len; r++)\n      *r = *q++;\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11470", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[300] = {0};\n  char tar[300] = {0};\n  char rep[300] = {0};\n  char result[300] = {0};\n\n  int len1, len2, ischange = 0;\n  int index1 = 0, i, index2 = 0;\n\n  scanf(\"%s \", zfc);\n\n  scanf(\"%s \", tar);\n  len1 = strlen(tar);\n\n  cin >> rep;\n  len2 = strlen(rep);\n\n  while (zfc[index1] != '\u0000') {\n    ischange = 1;\n    for (i = 0; i < len1; i++) {\n      if (zfc[index1 + i] != tar[i]) {\n        ischange = 0;\n        break;\n      }\n    }\n    if (ischange) {\n      for (i = 0; i < len2; i++)\n        result[index2 + i] = rep[i];\n\n      index2 += len2;\n      index1 += len1;\n      while (zfc[index1] != '\u0000') {\n        result[index2] = zfc[index1];\n        index2++;\n        index1++;\n      }\n      break;\n    }\n    result[index2] = zfc[index1];\n    index2++;\n    index1++;\n  }\n  printf(\"%s\", result);\n  return 0;\n}\n"}
{"label": "7", "index": "11471", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main(void) {\n\n  char string[256];\n  scanf(\"%s\", string);\n\n  char substring[256];\n  scanf(\"%s\", substring);\n\n  char replacement[256];\n  scanf(\"%s\", replacement);\n\n  int Lsub = 0; \n  for (int i = 0;; i++) {\n    if (substring[i] == '\u0000') {\n      Lsub = i;\n      break;\n    }\n  } \n\n  int Lrep = 0; \n  for (int i = 0;; i++) {\n    if (replacement[i] == '\u0000') {\n      Lrep = i;\n      break;\n    }\n  } \n\n  int pBegin = 1000, judge = 1; \n  for (int i = 0; i < 256 - Lsub; i++) {\n    judge = 1;\n    for (int j = i; j < i + Lsub; j++) {\n      if (string[j] - substring[j - i] != 0) {\n        judge = 0;\n        break;\n      }\n      if (j - i == Lsub - 1) {\n        break;\n      }\n    }\n    if (judge == 1) {\n      pBegin = i;\n      break;\n    }\n  } \n  if (pBegin == 1000) {\n    printf(\"%s\", string);\n  }\n\n  else {\n\n    char Ans[512];\n    for (int i = 0; i < pBegin; i++) {\n      Ans[i] = string[i];\n    }\n\n    for (int i = pBegin; i < pBegin + Lrep; i++) {\n      Ans[i] = replacement[i - pBegin];\n    }\n\n    for (int i = pBegin + Lrep;; i++) {\n      Ans[i] = string[i - (pBegin + Lrep) + pBegin + Lsub];\n      if (Ans[i] == '\u0000') {\n        break;\n      }\n    }\n\n    printf(\"%s\", Ans);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], b[50], r[50], a[50];\n  int i, k, n1, n2, n3, n, result;\n  scanf(\"%s%s%s\", s, b, r);\n  n1 = strlen(s);\n  n2 = strlen(b);\n  n3 = strlen(r);\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    for (k = 0; k < n2; k++) {\n      a[k] = s[i + k];\n    }\n    a[n2] = '\\0';\n    result = strcmp(a, b);\n    if (result == 0) {\n      n = i;\n      break;\n    } else\n      continue;\n  }\n  for (i = 0; i < n1; i++) {\n    if (i == n) {\n      printf(\"%s\", r);\n      i = i + n2 - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int i, j, k, n, m, f, q;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  m = strlen(s2);\n  n = strlen(s1);\n  for (i = 0; i < strlen(s1); i++) {\n    f = 0;\n    for (j = 0; j < strlen(s2); j++)\n      if (s2[j] != s1[i + j]) {\n        f = 1;\n        break;\n      }\n    if (f == 0) {\n      q = i;\n      break;\n    }\n  }\n  if (f == 1)\n    printf(\"%s\\n\", s1);\n  else {\n    for (k = 0; k < q; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s3);\n    for (k = q + m; k < n; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    if (a[i - 1] == b[0]) {\n      for (j = 1; b[j - 1] != '\u0000'; j++) {\n        if (a[i - 1 + j - 1] != b[j - 1])\n          break;\n      }\n      if (b[j - 1] != '\u0000')\n        continue;\n      else {\n        for (j = i; b[j - i] != '\u0000'; j++)\n          a[j - 1] = c[j - i];\n      }\n      break;\n    } else\n      continue;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ls, lo, lr, i, j, k, flag;\n  char str[257], org[257], rep[257];\n\n  cin >> str;\n\n  cin >> org;\n\n  cin >> rep;\n  ls = strlen(str);\n  lo = strlen(org);\n  lr = strlen(rep);\n  for (i = 0; i <= ls - lo; i++) {\n    flag = 1;\n    for (j = 0; j < lo; j++) {\n      if (str[i + j] != org[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", str[k]);\n      for (k = 0; k < lr; k++)\n        printf(\"%c\", rep[k]);\n      for (k = i + lo; k < ls; k++)\n        printf(\"%c\", str[k]);\n      return 0;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int i, j, a, b, t;\n  cin >> w >> s >> r;\n  b = strlen(w);\n  a = strlen(s);\n  for (i = 0; i < b; i++) {\n    if (s[0] == w[i]) {\n      for (j = 0; j < a; j++) {\n        if (s[j] != w[i + j])\n          break;\n      }\n      if (j == a) {\n        for (t = 0; t < a; t++)\n          w[i + t] = r[t];\n        for (t = 0; t < b; t++)\n          printf(\"%c\", w[t]);\n        break;\n      }\n    }\n  }\n  if (i == b) {\n    for (t = 0; t < b; t++)\n      printf(\"%c\", w[t]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11477", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cmp(int x, int y) {\n  if (x > y)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char str1[260], str2[260], str3[260];\n  cin >> str1 >> str2 >> str3;\n  int L = strlen(str2), len = strlen(str1), k, i;\n  for (i = 0; i < len; i++) {\n    k = 0;\n    while (str2[k] == str1[i + k] && k < L) {\n      k++;\n    }\n    if (k == L) {\n      break;\n    }\n  }\n  if (i == len) {\n    for (int q = 0; q < len; q++) {\n      cout << str1[q];\n    }\n    return 0;\n  }\n  for (int q = 0; q < i; q++) {\n    cout << str1[q];\n  }\n  cout << str3;\n  for (int q = i + strlen(str2); q < len; q++) {\n    cout << str1[q];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], zi[256], r[256];\n  int lens, lenzi, lenr;\n  int i, k, p = 2;\n  scanf(\"%s %s %s\", &s, &zi, &r);\n  lens = strlen(s);\n  lenzi = strlen(zi);\n  lenr = strlen(r);\n  for (i = 0; i < lens; i++) {\n    if (s[i] == zi[0]) {\n      for (k = 1; k < lenzi; k++) {\n        if (s[i + k] == zi[k]) {\n          p = 0;\n        } else {\n          break;\n        }\n      }\n      if (p == 0) {\n        for (k = 0; k < lenzi; k++)\n          s[i + k] = r[k];\n\n        printf(\"%s\", s);\n        break;\n      }\n    }\n  }\n  if (p == 2) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11479", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  char *p = strstr(str, sub), *temp1, *temp2;\n  if (p == NULL)\n    cout << str;\n  else {\n    temp1 = p, temp2 = rep;\n    while (*temp2 != '\\0') {\n      *temp1 = *temp2;\n      temp1++, temp2++;\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char src[256] = {0};\n  char subString[256] = {0};\n  char replacement[256] = {0};\n  char pre[256] = {0};\n  char *post;\n  scanf(\"%s %s %s\", src, subString, replacement);\n  char *start;\n  start = strstr(src, subString); \n  if (start != NULL)              \n  {\n    char *q = pre, *p = src; \n    while (p != start) {\n      *q = *p;\n      p++;\n      q++;\n    }\n    *q = '\\0';\n\n    post = start + strlen(subString); \n    strcat(pre, replacement);         \n    strcat(pre, post);\n    printf(\"%s\", pre);\n  } else\n    printf(\"%s\", src);\n  return 0;\n}\n"}
{"label": "7", "index": "11481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256], final[500];\n  int i, j, k, length, length1, length2, a, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  length = strlen(string);\n  length1 = strlen(substring);\n  length2 = strlen(replacement);\n  for (i = 0, j = 0; string[i] != '\\0'; i++) {\n    if (string[i] == substring[j]) {\n      a = i;\n      if (string[a + 1] == substring[j + 1]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 1) {\n    for (k = 0; k <= a - 1; k++)\n      *(final + k) = *(string + k);\n    for (k = a; k < a + length2; k++)\n      *(final + k) = *(replacement + k - a);\n    for (k = a + length2; k < length + length2 - length1; k++)\n      *(final + k) = *(string + k + length1 - length2);\n    *(final + length + length2 - length1) = '\\0';\n    for (k = 0; final[k] != '\\0'; k++)\n      printf(\"%c\", final[k]);\n  } else if (flag == 0) {\n    for (i = 0, j = 0; string[i] != '\\0'; i++)\n      printf(\"%c\", string[i]);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char st[351], su[351], re[551], reh[551];\n  int a, b, c, e, r, lu, lr;\n\n  cin >> st;\n  cin >> su;\n  scanf(\"%s\", re);\n  r = -1;\n  for (a = 0; a < strlen(st); a++) {\n    e = 1;\n    for (b = 0; b < strlen(su); b++) {\n      if (st[a + b] != su[b]) {\n        e = 0;\n      }\n    }\n    if (e) {\n      r = a;\n\n      break;\n    }\n  }\n  if (r + 1) {\n    for (a = 0; a < r; a++) {\n      reh[a] = st[a];\n    }\n    for (a = 0; a < strlen(su); a++) {\n      reh[r + a] = re[a];\n    }\n    lu = strlen(su);\n    lr = strlen(re);\n    for (a = r + lu; a <= 530; a++) {\n      reh[lr + a - lu] = st[a];\n    }\n\n    cout << reh;\n\n  } else {\n    printf(\"%s\", st);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[256], z1[256], z2[256];\n  int i, j, k, n, p, count, count1, count2, count4, count3[50];\n  int num1, num2;\n\n  scanf(\"%s \", zfc);\n\n  cin >> z1;\n\n  cin >> z2;\n  count = 0;\n  num1 = strlen(zfc);\n  num2 = strlen(z1);\n  for (i = 0; i < num1; i++) {\n    count1 = 0;\n    for (j = 0; j < num2; j++) {\n      if (zfc[i + j] == z1[j])\n        count1++;\n    }\n    if (count1 == num2)\n      break;\n  }\n  if (count1 == num2) {\n    for (j = i; j < num2 + i; j++)\n      zfc[j] = z2[j - i];\n  }\n  printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[501], subs[501], rep[501];\n  int i, j, k, len, len1;\n  scanf(\"%s%s%s\", str, subs, rep);\n  i = 0;\n  len = strlen(str);\n  while (str[i] != '\\0') {\n    if (str[i] == subs[0]) {\n      len1 = strlen(subs);\n      for (j = 0; j < len1; j++)\n        if (str[i + j] != subs[j])\n          break;\n      if (j == len1) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", str[k]);\n        printf(\"%s\", rep);\n        for (k = i + len1; k < len; k++)\n          printf(\"%c\", str[k]);\n        break;\n      }\n    }\n    i++;\n  }\n  if (str[i] == '\\0')\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, len3;\nchar replacement[256];\nvoid answer(char str[260], char substr[256]);\nint main() {\n  char str[260], substr[256];\n  cin.getline(str, 260);\n  cin.getline(substr, 256);\n  cin.getline(replacement, 256);\n  len1 = strlen(str);\n  len2 = strlen(substr);\n  len3 = strlen(replacement);\n  answer(str, substr);\n  return 0;\n}\nvoid answer(char str[260], char substr[256]) {\n  int i, k, count, num = 0;\n  for (i = 0; i < len1; i++) {\n    if (str[i] == substr[0]) {\n      count = 0;\n      for (k = i;; k++) {\n        if ((str[k] == substr[count]) && (str[k] != '\\0'))\n          count++;\n        else\n          break;\n      }\n      if (count == len2) {\n        num++;\n        for (k = 0; k < i; k++)\n          cout << str[k];\n        for (k = 0; k < len3; k++)\n          cout << replacement[k];\n        for (k = i + len2; k < len1; k++)\n          cout << str[k];\n        break;\n      }\n    }\n  }\n  if (num == 0) {\n    for (i = 0; i < len1; i++)\n      cout << str[i];\n  }\n}\n"}
{"label": "7", "index": "11486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  cin >> a;\n  scanf(\"%s \", b);\n  cin >> c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, k = 0;\n  while (b[i] != '\u0000') {\n    i++;\n    n1++;\n  }\n  i = 0;\n  while (c[i] != '\u0000') {\n    i++;\n    n2++;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    for (j = 0; j < n1; j++) {\n      if (a[i + j] != b[j])\n        break;\n      if (j == n1 - 1) {\n        for (j = 0; j < i; j++)\n          printf(\"%c\", a[j]);\n        printf(\"%s\", c);\n        for (j = i + n2; a[j] != '\u0000'; j++)\n          printf(\"%c\", a[j]);\n        k++;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  if (k == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, t;\n  char s1[256], s2[256], s3[256];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  for (i = 0; s1[i] != '\u0000'; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; s2[j] != '\u0000'; j++)\n        if (s2[j] == s1[i + j])\n          k++;\n      if (s2[k] == '\u0000') {\n        for (t = 0; t < i; t++)\n          printf(\"%c\", s1[t]);\n        for (t = 0; t < k; t++)\n          printf(\"%c\", s3[t]);\n        for (t = i + k; s1[t] != '\u0000'; t++)\n          printf(\"%c\", s1[t]);\n        printf(\" \");\n        break;\n      }\n    }\n  if (s2[k] != '\u0000')\n    printf(\"%s \", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "11488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j, k;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  p = strstr(p1, p2);\n  if (p == 0)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; *(p1 + i) != '\u0000'; i++) {\n      *(q + i) = *(p1 + i);\n      if (p1 + i == p)\n        break;\n    }\n    for (j = 0; *(p3 + j) != '\u0000'; j++)\n      *(q + i + j) = *(p3 + j);\n    for (k = i + strlen(p2); *(p1 + k) != '\u0000'; k++, j++)\n      *(q + i + j) = *(p1 + k);\n    *(q + i + j) = '\u0000';\n    printf(\"%s\", q);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], zc[50], th[50];\n  int i, j, t = 0, n, m;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", zc);\n\n  cin >> th;\n  n = strlen(zc);\n  m = strlen(th);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == zc[0]) {\n      for (j = 1; j < n; j++) {\n        if (str[i + j] == zc[j]) {\n          j++;\n          t = 1;\n          continue;\n        } else\n          t = 0;\n        break;\n      }\n    }\n    if (t) {\n      for (j = 0; j < m; j++)\n        str[i + j] = th[j];\n\n      break;\n    }\n  }\n\n  puts(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    printf(\"%s\\n\", s);\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n    if (j >= len2)\n      break;\n    if (j)\n      j = 0;\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "7", "index": "11491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[260], subString[260], replacement[260], string3[260];\n  cin >> string >> subString >> replacement;\n  char *p = strstr(string, subString);\n  if (p == NULL) {\n    cout << string << endl;\n    return 0;\n  }\n  int i = 0, j, k, len1 = strlen(subString), len2 = strlen(replacement);\n  for (i = 0; *(p + len1 + i) != '\\0'; i++) {\n    string3[i] = *(p + len1 + i);\n  }\n  string3[i] = '\\0';\n  *p = '\\0';\n  strcat(string, replacement);\n  strcat(string, string3);\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[102], a[102], b[102];\n  char *p1, *p2, *p3;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  int i, j, k = 0, len, m, len2;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (*p2 == p1[i]) {\n      j = i;\n      m = i;\n      for (; *p2 != '\u0000'; p2++, j++) {\n        if (*p2 == p1[j]) {\n          k++;\n        } else {\n          break;\n        }\n      }\n    }\n  }\n  len2 = strlen(a);\n  if (k != len2) {\n    printf(\"%s\", s);\n  }\n  if (k == len2) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = i + k; i < len; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  int m, n, i, j, e, k;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    e = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == sub[j])\n        e++;\n    }\n    if (e == m)\n      break;\n  }\n  if (e == m) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", rep);\n    for (k = i + m; k < n; k++)\n      printf(\"%c\", str[k]);\n  } else\n    cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[100], s[100], ex[100], b[100];\n  int i, j, k, flag, len, D;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    flag = 1;\n    if (s[i] == a[0]) {\n      k = i;\n      for (j = i; j < i + len; j++) {\n        ex[j - i] = s[k];\n        k++;\n      }\n      for (j = 0; j < len; j++) {\n        if (ex[j] != a[j])\n          flag = 0;\n      }\n    } else\n      flag = 0;\n\n    if (flag) {\n      D = i;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < D; i++) {\n      cout << s[i];\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      printf(\"%c\", b[i]);\n    }\n    for (i = D + len; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else\n    for (i = 0; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "11495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100];\n  int len, i, t = 1, lenall, judge = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  scanf(\"%s\", out);\n  len = strlen(in);\n  lenall = strlen(zfc);\n  for (i = 0; i <= lenall - len; i++) {\n    strcpy(x, zfc);\n    x[i + len] = 0;\n    if (i != 0) {\n      x[i - 1] = 0;\n    }\n    if (strcmp(&x[i], in) == 0) {\n      if (i != 0) {\n        strcpy(y, zfc);\n        y[i] = 0;\n        y[i + len - 1] = 0;\n        y[lenall] = 0;\n        printf(\"%s%s%s\", &y[0], out, &y[i + len]);\n        judge = 0;\n        break;\n      } else {\n        printf(\"%s%c%s\", out, zfc[i + len], &x[i + len + 1]);\n        judge = 0;\n        break;\n      }\n    }\n  }\n  if (judge)\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, result;\n  char input[100], substring[20], replace[20], cpy[20];\n  scanf(\"%s\\n%s\\n%s\", input, substring, replace);\n  result = strlen(input) - strlen(substring);\n  for (i = 0; i <= result; i++) {\n    if (input[i] == substring[0]) {\n      int a;\n      a = strlen(substring);\n      for (j = 0; j < a; j++) {\n        cpy[j] = input[i + j];\n        cpy[j + 1] = '\\0';\n      }\n      int m;\n      m = strcmp(cpy, substring);\n      if (m == 0) {\n\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", input[k]);\n        }\n        printf(\"%s\", replace);\n        for (k = i + a; k < strlen(input); k++) {\n          printf(\"%c\", input[k]);\n        }\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", input);\n  return 0;\n}\n"}
{"label": "7", "index": "11497", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000], w[1000], h[1000];\n  int len_1, len_2, len_3, i, j, k = 0;\n  cin >> s;\n  scanf(\"%s \", w);\n  scanf(\"%s\", h);\n  len_1 = strlen(s);\n  len_2 = strlen(w);\n  len_3 = strlen(h);\n  for (j = 0; j < len_1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < len_2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == len_2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < len_3; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + len_3; k < len_1; k++)\n      printf(\"%c\", s[k]);\n    printf(\" \");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11498", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[300], sub[300], rep[300], m, k, n;\n  int i, j;\n\n  cin >> zfc;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; i <= strlen(zfc) - strlen(sub); i++) {\n    m = 0;\n    for (j = 0; j < strlen(sub); j++) {\n      if (sub[j] != zfc[i + j]) {\n        m = -1;\n        break;\n      } else\n        m = 1;\n    }\n    if (m == 1) {\n      n = i;\n      break;\n    }\n  }\n  if (m == 1) {\n    for (k = n; k < n + strlen(sub); k++) {\n      zfc[k] = rep[k - n];\n    }\n\n    printf(\"%s\", zfc);\n  }\n\n  else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n\n  int len1, len2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  int i, j, k = 0;\n  int tag = 0, tag1;\n\n  for (i = 0, j = 0; j < len1; j++) {\n    if (tag != 1 && k == 0) {\n      if (s2[i] == s1[j]) {\n        for (k = j + 1, i = i + 1; i < len2; k++) {\n          if (s2[i] != s1[k]) {\n            i = 0;\n          }\n\n          else {\n            i++;\n            if (i == len2) {\n              tag = 1;\n              tag1 = k - len2 + 1;\n            }\n          }\n        }\n      }\n    } else if (tag != 1 && k == len1)\n      break;\n    else if (tag == 1)\n      break;\n  }\n\n  if (tag == 0)\n    printf(\"%s\", s1);\n  else {\n    int t, m;\n    for (t = tag1, m = 0; t < tag1 + len2; t++) {\n      s1[t] = s3[m];\n      m++;\n      if (m == len2) {\n        break;\n      }\n    }\n    cout << s1;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[500], sub[500], rep[500];\n  int i, j, shou, mo, k;\n  scanf(\"%s %s %s\", str, sub, rep);\n  int len1 = strlen(str);\n  int len2 = strlen(sub);\n  int len3 = strlen(rep);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j]) {\n        break;\n      }\n    }\n    if (j == len2) {\n      shou = i;\n      mo = i + j; \n      break;\n    }\n    \n    \n  }\n  if (j != len2) {\n    printf(\"%s\", str);\n  } else {\n    if (len2 >= len3) {\n      for (i = shou, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = mo; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    }\n\n    else {\n      i = len1 + len3 - len2;\n      for (k = len1; k >= mo; k--, i--) {\n        str[i] = str[k];\n      }\n      for (k = shou, j = 0; rep[j] != 0; k++, j++) {\n        str[k] = rep[j];\n      }\n    }\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11501", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, l1;\n  char s[256], a[256], b[256], t[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= l1 - 1; j++) {\n      t[j] = s[i + j];\n    }\n    if (strcmp(t, a) == 0) {\n      for (j = 0; j <= l1 - 1; j++) {\n        s[i + j] = b[j];\n      }\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11502", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], s[257], r[257];\n  int len1, len2, len3, i, j, k, c, flag = 0;\n  cin >> str >> s >> r;\n  len1 = strlen(str);\n  len2 = strlen(s);\n  len3 = strlen(r);\n  j = 0;\n  while (str[j] != '\\0') {\n    if (str[j] == s[0]) {\n      c = j;\n      for (i = 0; i < len2; i++) {\n        if (str[j + i] != s[i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (i == len2) {\n        flag = 1;\n        break;\n      }\n    }\n    j++;\n  }\n  if (flag) {\n    for (k = 0; k < c; k++) {\n      printf(\"%c\", str[k]);\n    }\n    printf(\"%s\", r);\n    for (k = c + len2; k < len1; k++)\n      printf(\"%c\", str[k]);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[256];\n  char sz2[256];\n  char sz3[256];\n  cin >> sz1;\n  scanf(\"%s\", sz2);\n  cin >> sz3;\n  int len1, len2;\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  int i, k;\n  int flag = 0;\n  for (k = 0; k <= len1 - len2; k++) {\n    for (i = 0; i < len2; i++) {\n      if (sz1[i + k] == sz2[i]) {\n        flag = flag + 1;\n      }\n    }\n    if (flag == len2)\n      break;\n    if (flag != len2)\n      flag = 0;\n  }\n  if (flag == len2) {\n    for (i = 0; i < len2; i++) {\n      sz1[k + i] = sz3[i];\n    }\n  }\n  cout << sz1;\n  return 0;\n}\n"}
{"label": "7", "index": "11504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  char *t;\n  t = strstr(a, b);\n  if (t == NULL) {\n    printf(\"%s\", a);\n    return 0;\n  } else {\n    char f = t - a;\n    int d = strlen(a), e = strlen(c);\n    int i = f, j;\n    for (j = 0; j < e; j++) {\n      a[i] = c[j];\n      i++;\n      if (i == t - a + e)\n        break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, countb, re;\n  char a[256];\n  char b[20];\n  char c[20];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; b[i] != 0; i++) {\n    countb = i;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    re = 0;\n    if (a[i] == b[0]) {\n      for (j = i; b[j - i] != '\u0000'; j++) {\n        if (a[j] != b[j - i])\n          break;\n      }\n      if (j == i + countb + 1) {\n        re = 1;\n        for (j = i; j <= i + countb; j++)\n          a[j] = c[j - i];\n      }\n    } else\n      continue;\n    if (re == 1)\n      break;\n  }\n  cout << a;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11506", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, slen, alen;\n  char *ss[2], s[256], s1[256], s2[256];\n  int flag = 0;\n\n  cin >> s;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  slen = strlen(s);\n  alen = strlen(s1);\n\n  for (i = 0; i < slen - alen + 1; i++) {\n    for (j = 0; j < alen; j++) {\n      if (s[i + j] != s1[j]) {\n        break;\n      }\n    }\n    if (j == alen) {\n      ss[1] = &s[i + j];\n      s[i] = '\u0000';\n      ss[0] = s;\n      flag = 1;\n\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"%s \", s);\n  else\n    printf(\"%s%s%s \", ss[0], s2, ss[1]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, p, f;\n  char str[257], a[257], b[257];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(str);\n  m = strlen(a);\n  p = 1;\n\n  for (i = 0; i < n; i++) {\n    f = 1;\n    for (j = 0; j < m; j++)\n      if (str[i + j] != a[j]) {\n        f = 0;\n        break;\n      }\n    if ((p) && (f)) {\n      cout << b;\n      p = 0;\n      i += m - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char src[256] = {0};\n  char subString[256] = {0};\n  char replacement[256] = {0};\n  char pre[256] = {0};\n  char *post;\n  cin >> src >> subString >> replacement;\n  char *start;\n  start = strstr(src, subString);\n  if (start != NULL) {\n    char *q = pre, *p = src;\n    while (p != start) {\n      *q = *p;\n      p++;\n      q++;\n    }\n    *q = '\\0';\n\n    post = start + strlen(subString);\n    strcat(pre, replacement);\n    strcat(pre, post);\n    printf(\"%s\", pre);\n  } else\n    printf(\"%s\", src);\n  return 0;\n}\n"}
{"label": "7", "index": "11509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int result = 0;\n  int a, b, c, i, d, e = 0, f, g, h, j, k;\n  int len[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(sub);\n  c = strlen(rep);\n  for (i = 0; i < a; i++) {\n    for (d = 0; d < b - 1; d++) {\n      if ((str[i + d] == sub[d]) && (str[i + d + 1] == sub[d + 1])) {\n        result = 1;\n        len[e] = i;\n        e++;\n      }\n      break;\n    }\n  }\n  f = len[0];\n  if (result == 1) {\n    for (g = 0; g < f; g++) {\n      printf(\"%c\", str[g]);\n    }\n    for (h = 0; h < c; h++) {\n      cout << rep[h];\n    }\n    for (j = 0; j < a - f - b; j++) {\n      printf(\"%c\", str[f + b + j]);\n    }\n  } else if (result == 0) {\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11510", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[100][100];\n  int la, lb, i, j, x = 0, m = 0, wz;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = 0;\n      wz = i;\n      for (j = 0; j < lb; j++) {\n        if (a[i + j] != b[j]) {\n          i = i + j - 1;\n          break;\n        } else\n          m++;\n      }\n    }\n    if (m == lb) {\n      for (j = 0; j < wz; j++) {\n        d[0][j] = a[j];\n        d[0][wz] = '\u0000';\n      }\n      for (j = wz + lb; j < la; j++) {\n        d[1][j - wz - lb] = a[j];\n        d[1][la - wz - lb] = '\u0000';\n      }\n      break;\n    }\n  }\n  if (m > 0) {\n    if (wz == 0)\n      strcpy(d[0], c);\n    else\n      strcat(d[0], c);\n    if (wz + lb == la)\n      puts(d[0]);\n    else {\n      strcat(d[0], d[1]);\n      puts(d[0]);\n    }\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int n = 0, q = 0;\n  for (int i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (int i = 0; a[i] != '\u0000'; i++)\n    q++;\n  int i, j, k, p;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    int m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i + j] == b[j])\n        m++;\n    }\n    if (m == n)\n      break;\n  }\n  if (i == q)\n    for (p = 0; a[p] != '\u0000'; p++) {\n      cout << a[p];\n    }\n  else {\n    for (k = 0; c[k] != '\u0000'; k++) {\n      a[k + i] = c[k];\n    }\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11512", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int start, end, ok, i, j, n, m, s;\n  char a[300], b[300], c[300];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  s = strlen(c);\n  for (i = 0; i < n; i++)\n    if (a[i] == b[0]) {\n      ok = 1;\n      for (j = 1; j < m; j++)\n        if (a[j + i] != b[j])\n          ok = 0;\n      if (ok) {\n        start = i;\n        end = j + i;\n        break;\n      }\n    }\n  if (ok == 1) {\n    for (i = 0; i < start; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", c[i]);\n    for (i = end; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  int i, length, lensub, j, k, ans = 0;\n  length = strlen(s);\n  lensub = strlen(sub);\n  for (i = 0; i < length; i++)\n    if (s[i] == sub[0]) {\n      for (j = 0; j < lensub; j++)\n        if (s[i + j] != sub[j])\n          break;\n      if (j == lensub) {\n        ans = 1;\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", re);\n        for (k = i + lensub; k < length; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  if (ans != 1)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s\", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  for (i = 0; i < la; i++) {\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11515", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char st[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", st, sub, rep);\n  int lenst, lensub, i, j;\n  lenst = strlen(st);\n  lensub = strlen(sub);\n  for (i = 0; i <= lenst - lensub; i++) {\n    int count = 0;\n    if (lensub != 1) {\n      if (st[i] == sub[0]) {\n\n        for (j = i + 1; j < i + lensub; j++) {\n          if (st[j] != sub[j - i])\n            break;\n          count++;\n        }\n      }\n      if (count == lensub - 1) {\n        for (j = i; j < i + lensub; j++)\n          st[j] = rep[j - i];\n\n        break;\n      }\n    } else {\n      if (st[i] == sub[0]) {\n        st[i] = rep[0];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", st);\n}\n"}
{"label": "7", "index": "11516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", sub);\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11517", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, k, l, m, n, sum = 0;\n  cin >> a;\n  scanf(\"%s\", b);\n  cin >> c;\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      if (b[j] == a[i + j])\n        sum += 1;\n    if (sum == n)\n      break;\n    else\n      sum = 0;\n  }\n  if (sum == n) {\n    for (k = i; k < n + i; k++) {\n      a[k] = c[k - i];\n    }\n  }\n  for (l = 0; l < m; l++)\n    printf(\"%c\", a[l]);\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "11518", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256 * 2], sub[300], replacement[300], tmp[300];\n  int i, j, result = -1, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> replacement;\n\n  for (i = 0; i <= (int)(strlen(str) - strlen(sub)); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < (int)strlen(sub); j++) {\n        if (str[i + j] == sub[j]) {\n          result = i;\n        } else {\n          result = -1;\n          break;\n        }\n      }\n    }\n    if (result != -1)\n      break;\n  }\n  k = (int)strlen(replacement);\n  if (result != -1) {\n    strcpy(tmp, (str + i + j));\n    strcpy((str + i), replacement);\n    strcpy((str + i + k), tmp);\n    printf(\"%s\", str);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[257], b[257], r[257];\n  scanf(\"%s\", b);\n  cin >> a;\n  scanf(\"%s\", r);\n  int c, d, count, e;\n  int j, h, y;\n  c = strlen(a);\n  d = strlen(b);\n  e = strlen(r);\n\n  for (j = 0; j < d; j++) {\n    y = 0;\n    h = j;\n    if (b[j] != a[0])\n      continue;\n    else {\n      count = 1;\n      for (int t = 1; t < c; t++) {\n\n        if (a[t] == b[j + t])\n          count++;\n      }\n    }\n    if (count == c) {\n      y = 1;\n      break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (y == 1) {\n\n    for (j = 0; j < h; j++)\n      printf(\"%c\", b[j]);\n    for (j = 0; j < e; j++)\n      printf(\"%c\", r[j]);\n    for (j = h + c; j < d; j++)\n      printf(\"%c\", b[j]);\n  } else\n    printf(\"%s\", b);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000], b[1000], c[1000];\nint main() {\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  cin >> c;\n  int len1, len2, p = 0, i, j;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    if (a[i] == b[0]) {\n      p = 1;\n      for (j = i; j < len2 + i; j++) {\n        if (a[j] != b[j - i]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (j = i; j < len2 + i; j++) {\n          a[j] = c[j - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], replace[20];\n  char *p;\n  int len1, len2, len3, i, m;\n  scanf(\"%s \", str);\n  cin >> sub;\n  cin >> replace;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(replace);\n  p = strstr(str, sub);\n  if (p != NULL) {\n    if (len2 > len3) {\n      m = len2 - len3;\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      for (i = 0; *(p + m + i) != str[len1 - 1]; i++)\n        *p = *(p + m);\n      len1 -= m;\n    }\n    if (len2 == len3) {\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n    }\n    if (len2 < len3) {\n      m = len3 - len2;\n      for (i = len1 - 1; str[i] != *(p + m - 1); i--)\n        str[i + m] = str[i];\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      len1 += m;\n    }\n  }\n  for (i = 0; i < len1; i++)\n    cout << str[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[101], b[101];\n  int i, len, k, j, len1, len2, l, n, p = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  len = strlen(s);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == a[0] && p == 0) {\n      k = 0;\n      while (s[i + k] == a[k] && k < len1) {\n        k++;\n      }\n      if (k == len1) {\n        p = 1;\n\n        len = strlen(s);\n        len1 = strlen(a);\n        len2 = strlen(b);\n        if (len1 == len2) {\n          for (j = 0; j < k; j++) {\n            s[i + j] = b[j];\n          }\n        }\n        if (len1 > len2) {\n          for (j = 0; j < len1; j++) {\n            s[i + j] = b[j];\n          }\n          for (j = len2, l = k; (l + i) <= len; j++, l++)\n            s[i + j] = s[i + l];\n        }\n        if (len1 < len2) {\n          len = strlen(s);\n          n = len2 - len1;\n          for (l = len; l >= (i + k); l--)\n            s[l + n] = s[l];\n          for (j = 0; j < len2; j++)\n            s[i + j] = b[j];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int q, w, e, i, k, j;\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n\n  for (i = 0; i < q; i++) {\n    j = 0;\n    for (k = i; (k < i + w) && (k < q); k++) {\n\n      if (a[k] != b[k - i]) {\n        continue;\n      }\n      if (a[k] == b[k - i]) {\n        j++;\n      }\n      if (j == w) {\n        for (k = i; (k < i + w) && (k < q); k++) {\n          a[k] = c[k - i];\n        }\n        break;\n      }\n    }\n    if (j == w) {\n\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  int a, i, j, b, k = 0, c;\n  c = strlen(str3);\n  a = strlen(str1);\n  b = strlen(str2);\n  for (i = 0; i < a; i++) {\n    if (str1[i] == str2[0]) {\n      for (j = 1; j < b; j++) {\n        if (str1[i + j] == str2[j])\n          k++;\n        else {\n          k = 0;\n          break;\n        }\n      }\n      if (k == b - 1) {\n        for (j = i; j < i + c; j++) {\n          str1[j] = str3[j - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << str1;\n  return 0;\n}\n"}
{"label": "7", "index": "11525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  int temp;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      zichuan[j] = zfc1[j + i];\n    }\n    if (strcmp(zichuan, zfc2) == 0) {\n      flag = 1;\n      temp = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  } else {\n    for (k = 0; k < temp; k++) {\n      printf(\"%c\", zfc1[k]);\n    }\n    printf(\"%s\", zfc3);\n    for (t = temp + len2; zfc1[t] != '\\0'; t++) {\n      printf(\"%c\", zfc1[t]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, count = 0, h;\n  char a[260], b[260], c[260];\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[j]) {\n      count += 1;\n      j += 1;\n    } else {\n      j = 0;\n      count = 0;\n    }\n    if (count == strlen(b)) {\n      h = i;\n      break;\n    }\n  }\n  if (count == strlen(b)) {\n    for (i = 0; i <= h - strlen(b); i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = 0; i <= strlen(c) - 1; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = h + 1; i <= strlen(a) - 1; i++)\n      printf(\"%c\", a[i]);\n\n  } else {\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11527", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, m = 1, z = 0, g;\n  char q[256], p[256], w[256];\n  cin >> q;\n  scanf(\"%s\", p);\n  scanf(\"%s\", w);\n  k = strlen(q);\n  l = strlen(p);\n  for (i = 0; i < k; i++) {\n    if (p[0] == q[i]) {\n      for (j = 1; j < l; j++) {\n        g = 1;\n        if (p[j] != q[j + i])\n          g = 0;\n      }\n      if (g == 1) {\n        z = 1;\n        m = i;\n        break;\n      }\n    }\n  }\n  if (z) {\n    for (j = 0; j < m; j++)\n      printf(\"%c\", q[j]);\n\n    printf(\"%s\", w);\n    for (j = m + l; j < k; j++)\n      printf(\"%c\", q[j]);\n  } else\n    printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "7", "index": "11528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], w[100], t[100];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  int i, j, k, p, q, f = 1, n, m, e;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = j = 0; i < n; i++) {\n    k = i;\n    p = i;\n    q = j;\n    if (w[p] == s[q]) {\n      for (q = 0; q < m; q++) {\n        if (w[p] != s[q]) {\n          f = 0;\n        }\n        p++;\n      }\n      if (f == 1) {\n        for (e = 0; e < k; e++) {\n          printf(\"%c\", w[e]);\n        }\n        printf(\"%s\", t);\n        for (e = k + m; e < n; e++) {\n          printf(\"%c\", w[e]);\n        }\n        return 0;\n      }\n      f = 1;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "11529", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint bd(char *hed, char *zi, int m) {\n  int val = 0, j;\n  char *t1, *t2;\n  for (t1 = hed, t2 = zi, j = 0; j < m; t1++, t2++, j++) {\n    if (*t1 == *t2)\n      val = 1;\n    else {\n      val = 0;\n      break;\n    }\n  }\n  return (val);\n}\nint main() {\n  char *yuan, *zi, *rep, *med;\n  yuan = (char *)malloc(260 * sizeof(char));\n  zi = (char *)malloc(260 * sizeof(char));\n  rep = (char *)malloc(260 * sizeof(char));\n  med = (char *)malloc(260 * sizeof(char));\n  cin >> yuan;\n  cin >> zi;\n  cin >> rep;\n  char *p;\n  int n, m, zhi = 0, t;\n  for (p = yuan, n = 0; *p != '\u0000'; p++, n++)\n    ;\n  for (p = zi, m = 0; *p != '\u0000'; p++)\n    m++;\n  for (p = rep, t = 0; *p != '\u0000'; p++)\n    t++;\n  for (p = yuan; p < yuan + n - m + 1; p++)\n    if (bd(p, zi, m) == 1) {\n      zhi = 1;\n      break;\n    }\n  if (zhi == 1) {\n    strcpy(med, p + m);\n    strcpy(p, rep);\n    strcpy(p + t, med);\n  }\n  puts(yuan);\n  return 0;\n}\n"}
{"label": "7", "index": "11530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a = 1, m, k;\n  char s1[258], s2[258], s3[258];\n  cin >> s1;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if (a == 1) {\n      k = i;\n      for (j = 0; s2[j] != '\\0'; j++) {\n        if (s2[j] != s1[k]) {\n          a = 1;\n          break;\n        }\n        k++;\n        a = 0;\n      }\n    } else\n      break;\n  }\n  if (a == 0) {\n    for (m = 0; s3[m] != '\\0'; m++) {\n      s1[i - 1] = s3[m];\n      i++;\n    }\n  }\n  cout << s1;\n  return 0;\n}\n"}
{"label": "7", "index": "11531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[260], w[260], h[260];\n  int l1, l2, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (j = 0; j < l1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < l2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == l2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < l2; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + l2; k < l1; k++)\n      printf(\"%c\", s[k]);\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11532", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, m, k, p;\n  char r[257], s[257], w[257];\n  scanf(\"%s \", w);\n  cin >> s;\n  scanf(\"%s\", r);\n  a = strlen(s);\n  p = 0;\n  for (i = 0; w[i]; i++) {\n    if (w[i] == s[0]) {\n      m = 0;\n      for (j = 0; j < a; j++) {\n        if (w[i + j] == s[j]) {\n          m = m + 1;\n        }\n      }\n      if (m == a) {\n        p = p + 1;\n        for (k = 0; k < a; k++) {\n          w[i + k] = r[k];\n        }\n        printf(\"%s\", w);\n        break;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260];\n  char b[260];\n  char c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j, length;\n  for (i = 0; i < len1; i++) {\n    length = 0;\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        length = length + 1;\n    }\n    if (length == len2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < len3; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + len3; j < len1; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\" \");\n      break;\n    }\n  }\n  if (length != len2)\n    printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, m, k, p;\n  char r[257], s[257], w[257];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", r);\n  a = strlen(s);\n  p = 0;\n  for (i = 0; w[i]; i++) {\n    if (w[i] == s[0]) {\n      m = 0;\n      for (j = 0; j < a; j++) {\n        if (w[i + j] == s[j]) {\n          m = m + 1;\n        }\n      }\n      if (m == a) {\n        p = p + 1;\n        for (k = 0; k < a; k++) {\n          w[i + k] = r[k];\n        }\n        printf(\"%s\", w);\n        break;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  n = strlen(b);\n  int i = 0;\n  while (a[i] != '\\0') {\n    int m = 0;\n    while (m < n) {\n      if (a[i + m] == b[m])\n        m++;\n      else\n        break;\n    }\n    if (m == n) {\n      int p = 0;\n      while (p < i) {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      cout << c;\n      p = p + n;\n      while (a[p] != '\\0') {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      break;\n    }\n    i++;\n  }\n  if (a[i] == '\\0')\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ls1, ls2, ls3, i, j = 0, m, lans = 0, z = 0;\n  char s1[100], s2[100], s3[100], ans[100];\n  scanf(\"%s\", s1);\n  cin >> s2;\n  scanf(\"%s\", s3);\n  ls1 = strlen(s1);\n  ls2 = strlen(s2);\n  ls3 = strlen(s3);\n  for (i = 0; i < ls1; i++) {\n\n    if (s1[i] != s2[0])\n      ans[lans++] = s1[i];\n    else {\n      for (j = 0, m = i; j < ls2; j++, m++) {\n        if (s1[m] != s2[j])\n          break;\n      }\n      if (j == ls2 && z != 1) {\n        i = m - 1;\n        for (j = 0; j < ls3; j++)\n          ans[lans++] = s3[j];\n        z++;\n      } else {\n        for (; i <= m; i++)\n          ans[lans++] = s1[i];\n        i--;\n      }\n    }\n  }\n  ans[lans] = '\\0';\n  cout << ans;\n  return 0;\n}\n"}
{"label": "7", "index": "11537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], w[100], p[100], t[100];\n  int i, j, flag = 1;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (i = 0; i < strlen(w); i++) {\n    for (j = 0; j < strlen(s); j++) {\n      p[j] = w[i + j];\n    }\n    flag = 1;\n    for (j = 0; j < strlen(s); j++) {\n      if (p[j] != s[j])\n        flag = 0;\n    }\n    if (flag != 0) {\n      for (j = 0; j < strlen(s); j++) {\n        w[i + j] = t[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n}\n"}
{"label": "7", "index": "11538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k, len, len1, len2, m;\n  scanf(\"%s%s%s\", string, substr, replace);\n  len1 = strlen(string);\n  len2 = strlen(substr);\n  for (i = 0; i < len1; i++) {\n    if (substr[0] == string[i]) {\n      len = 0;\n      for (j = 0; j < len2; j++) {\n        if ((substr[j] == string[i + j]) && len < len2)\n          len++;\n      }\n      if (len == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string[k]);\n        printf(\"%s\", replace);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string[k]);\n        m = 1;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m != 1)\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, p;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i <= strlen(a) - strlen(b); i++) {\n    p = 0;\n\n    for (j = i; j < i + strlen(b); j++)\n      if (b[j - i] == a[j])\n        p++;\n\n    if (p == strlen(b)) {\n      d[i] = '\u0000';\n      break;\n    }\n    d[i] = a[i];\n  }\n  if (i == strlen(a) - strlen(b) + 1)\n    puts(a);\n  else {\n    strcat(d, c);\n\n    for (j = i + strlen(b); j < strlen(a); j++)\n      e[j - i - strlen(b)] = a[j];\n    e[j - i - strlen(b)] = '\u0000';\n    strcat(d, e);\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11540", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint match(char *pa, char *pb, int lenb) {\n  int i;\n  for (i = 1; i < lenb; i++)\n    if (*(pa + i) != *(pb + i))\n      return 0;\n  return 1;\n}\n\nint main() {\n  char a[300], b[300], c[100], d[300] = {'0'};\n  int i, j, lenb, k;\n  cin >> a >> b >> c;\n  lenb = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] == b[0])\n      if (match(&a[i], b, lenb)) {\n        for (j = i + lenb; a[j] != '\\0'; j++)\n          d[j] = a[j];\n        for (j = 0, k = i; c[j] != '\\0'; k++, j++)\n          a[k] = c[j];\n        for (j = i; d[j] != '\\0'; j++, k++)\n          a[k] = d[j];\n        break;\n      }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  char string[250], substring[250], replacestring[200];\n  cin >> string >> substring >> replacestring;\n  int place = 0, i, j, flag = 1;\n  for (i = 0; string[i] != '\\0' && flag == 1; i++) {\n    if (string[i] != substring[0])\n      continue;\n    else {\n      place = i;\n      for (j = 0; substring[j] != '\\0'; j++) {\n        if (string[i++] != substring[j])\n          break;\n      }\n      if (substring[j] != '\\0')\n        place = 0;\n      else\n        flag = 0;\n    }\n  }\n  if (place) {\n    int l1 = strlen(substring), l2 = strlen(replacestring);\n    for (i = 0; string[i + place + l1] != '\\0'; i++)\n      replacestring[l2 + i] = string[place + l1 + i];\n    replacestring[l2 + i] = '\\0';\n    string[place] = '\\0';\n    cout << string << replacestring << endl;\n  } else\n    cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c, d, str1[256], str2[256], str3[256];\n  int l, h, i, j = 0, k, st = 0;\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  l = strlen(str2);\n  for (i = 0; ((c = str2[i]) != '\\0'); i++) {\n    c = str2[i];\n    for (; ((d = str1[j]) != '\\0'); j++) {\n      d = str1[j];\n      if (c == d) {\n        st = st + 1;\n        j = j + 1;\n        break;\n      } else if ((c != d) && (st != 0)) {\n        st = 0;\n        i = -1;\n        break;\n      }\n    }\n  }\n  if (st == l) {\n    for (h = 0, k = (j - l); k < j; k++, h++) {\n      str1[k] = str3[h];\n    }\n    printf(\"%s\\n\", str1);\n  } else\n    printf(\"%s\\n\", str1);\n}\n"}
{"label": "7", "index": "11543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], temp[100];\n  int i, j = 0, k, lena, lenb, mark = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < lenb; j++) {\n        if (a[i + j] == b[j])\n          mark = 1;\n        else {\n          mark = 0;\n          break;\n        }\n      }\n    }\n    if (mark == 1) {\n      for (k = 0; k < lenb; k++)\n        a[i + k] = c[k];\n      break;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "11544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int n, i, j, length1, length2, k, h;\n  k = 0;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length2; i++) {\n    if (s1[0] == s2[i]) {\n      j = 0;\n      while (s2[j + i] == s1[j] && j < length1)\n        j++;\n      if (j == length1)\n        k = i;\n    }\n    if (k)\n      break;\n  }\n  h = k;\n  if (k) {\n    for (h = k; h < k + length1; h++)\n      s2[h] = s3[h - k];\n  }\n  printf(\"%s\", s2);\n}\n"}
{"label": "7", "index": "11545", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[512], w[257], r[257];\n  int m, n;\n  int i, j, k;\n  int t;\n  cin >> s >> w >> r;\n  m = strlen(s);\n  n = strlen(w);\n  for (i = 0; i <= m - n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      if (w[j] != s[i + j])\n        t = 1;\n    }\n    if (t == 0)\n      break;\n  }\n  if (t == 0) {\n    for (k = i; k <= i + n - 1; k++) {\n      s[k] = r[k - i];\n    }\n    printf(\"%s\", s);\n  } else\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "11546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, lena, lenb, m, n, k;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    m = 0;\n    for (j = i; j < i + lenb; j++) {\n      if (b[j - i] != a[j])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++)\n        d[n] = a[n];\n\n      d[n] = '\\0';\n      for (k = i + lenb; k < lena; k++) {\n        e[k - i - lenb] = a[k];\n      }\n      e[k - i - lenb] = '\\0';\n      cout << d << c << e;\n      break;\n    }\n  }\n  if (m == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256];\n  char s2[256];\n  char s3[256];\n  int i, j, q;\n  cin >> s1 >> s2 >> s3;\n\n  int k1 = strlen(s1);\n  int k2 = strlen(s2);\n  for (i = 0; i < k1; i++) {\n    int k = 0;\n    for (j = 0; j < k2; j++) {\n      if (s1[i + j] != s2[j])\n        break;\n\n      if (s1[i + j] == s2[j]) {\n        k++;\n      }\n    }\n\n    if (k == k2) {\n      q = i;\n      break;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != q) {\n      printf(\"%c\", s1[i]);\n    }\n    if (i == q) {\n      cout << s3;\n      i = i + k2 - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char an[270], bn[270], cn[270], temp[270];\n  cin >> an >> bn >> cn;\n  char *p = strstr(an, bn);\n  int len = strlen(bn);\n  if (p != NULL) {\n    strcpy(temp, p + len);\n    *p = '\\0';\n    strcat(an, cn);\n    strcat(an, temp);\n  }\n  cout << an;\n  return 0;\n}\n"}
{"label": "7", "index": "11549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n\n  scanf(\"%s \", p1);\n\n  cin >> p2;\n\n  cin >> p3;\n  p = strstr(p1, p2);\n  if (p == NULL)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; p1 != p; p1++, i++)\n      *(q + i) = *p1;\n    *(q + i) = '\u0000';\n    for (j = 0; j < strlen(p3); j++)\n      *(q + i + j) = *(p3 + j);\n    for (j = 0; *(p1 + strlen(p2) + j) != '\u0000'; j++)\n      *(q + i + strlen(p3) + j) = *(p1 + strlen(p2) + j);\n    *(q + i + strlen(p3) + j) = '\u0000';\n    cout << q;\n  }\n}\n"}
{"label": "7", "index": "11550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[300] = {0};\n  char tar[300] = {0};\n  char rep[300] = {0};\n  char result[300] = {0};\n\n  int len1, len2, ischange = 0;\n  int index1 = 0, i, index2 = 0;\n\n  cin >> zfc;\n\n  cin >> tar;\n  len1 = strlen(tar);\n\n  cin >> rep;\n  len2 = strlen(rep);\n\n  while (zfc[index1] != '\u0000') {\n    ischange = 1;\n    for (i = 0; i < len1; i++) {\n      if (zfc[index1 + i] != tar[i]) {\n        ischange = 0;\n        break;\n      }\n    }\n    if (ischange) {\n      for (i = 0; i < len2; i++) {\n        result[index2 + i] = rep[i];\n      }\n      index2 += len2;\n      index1 += len1;\n      while (zfc[index1] != '\u0000') {\n        result[index2] = zfc[index1];\n        index2++;\n        index1++;\n      }\n      break;\n    }\n    result[index2] = zfc[index1];\n    index2++;\n    index1++;\n  }\n  printf(\"%s\", result);\n  return 0;\n}\n"}
{"label": "7", "index": "11551", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], sub[256], rep[256];\n  int i, j, k;\n  int lens, lensub;\n\n  cin >> s, cin >> sub, cin >> rep;\n  lens = strlen(s);\n  lensub = strlen(sub);\n\n  for (i = 0; i <= lens - lensub; i++) {\n    for (j = 0; j < lensub; j++)\n      if (s[i + j] != sub[j])\n        break;\n    if (j == lensub) {\n      for (k = 0; k < j; k++)\n        s[i + k] = '@';\n      i += j - 1;\n      break; \n    }\n  }\n\n  for (i = 0; i < lens; i++)\n    if (s[i] == '@') {\n      while (s[i] == '@')\n        i++;\n      i--;\n      printf(\"%s\", rep);\n    } else {\n      printf(\"%c\", s[i]);\n    }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11552", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, la, lb, lc, aaa;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  aaa = 0;\n  for (i = 0; i <= la - 1; i++) {\n\n    for (j = 0; (j <= lb - 1) && (i + j <= la - 1); j++) {\n      if (a[i + j] == b[j]) {\n        if (j == lb - 1) {\n          aaa = 1;\n        }\n\n      } else {\n        break;\n      }\n    }\n    if (aaa == 1) {\n      break;\n    }\n  }\n  if (aaa == 1) {\n    for (j = 0; j <= lc - 1; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "11553", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[50], c[50];\n  int n, i, j, m, k, s = 0, d, e;\n  scanf(\"%s %s %s \", a, b, c);\n  n = strlen(b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    s = 0;\n    for (j = i, k = 0; k < n; j++, k++) {\n\n      if (a[j] != b[k]) {\n        s = 1;\n        break;\n      }\n    }\n    if (s == 0)\n      break;\n  }\n\n  if (s == 0) {\n    for (d = i, e = 0; d < i + n; d++, e++) {\n      a[d] = c[e];\n    }\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11554", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zfc[100], s2[200];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, k, l, la, lb, ls, th = 200;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    l = 0;\n    for (k = i; k < la + i; k++) {\n      zfc[l] = s[k];\n      l++;\n    }\n    zfc[l] = '\u0000';\n    if (strcmp(zfc, a) == 0) {\n      th = i;\n      break;\n    }\n  }\n  if (th < 200) {\n    for (i = 0; i < th; i++) {\n      s2[i] = s[i];\n    }\n    for (i = th; i < th + lb; i++) {\n      s2[i] = b[i - th];\n    }\n    for (i = th + lb; i < ls + lb - la; i++) {\n      s2[i] = s[i - lb + la];\n    }\n    s2[ls + lb - la] = '\u0000';\n    puts(s2);\n  }\n  if (th == 200) {\n    puts(s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], s[100], ex[100], b[100];\n  int i, j, k, flag, len, D;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    flag = 1;\n    if (s[i] == a[0]) {\n      k = i;\n      for (j = i; j < i + len; j++) {\n        ex[j - i] = s[k];\n        k++;\n      }\n      for (j = 0; j < len; j++) {\n        if (ex[j] != a[j])\n          flag = 0;\n      }\n    } else\n      flag = 0;\n\n    if (flag) {\n      D = i;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < D; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      printf(\"%c\", b[i]);\n    }\n    for (i = D + len; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else\n    for (i = 0; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "11556", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char all[257], sub[257], re[257];\n  int i, j, k, p, q, r, s;\n\n  cin >> all >> sub >> re;\n\n  int flag;\n  for (i = 0; all[i] != '\\0'; i++) {\n    flag = 1;\n    for (j = 0, k = i; sub[j] != '\\0'; k++, j++) {\n      if (all[k] != sub[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1) {\n    int c = strlen(re);\n\n    for (p = k, q = c; all[p] != '\\0'; p++, q++)\n      re[q] = all[p];\n    re[q] = '\\0';\n\n    for (r = 0, s = i; re[r] != '\\0'; r++, s++)\n      all[s] = re[r];\n    all[s] = '\\0';\n  }\n  cout << all << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  char *t;\n  t = strstr(a, b);\n  if (t == NULL) {\n    cout << a;\n    return 0;\n  } else {\n    char f = t - a;\n    int d = strlen(a), e = strlen(c);\n    int i = f, j;\n    for (j = 0; j < e; j++) {\n      a[i] = c[j];\n      i++;\n      if (i == t - a + e)\n        break;\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[300], sub[300], rep[300], m, k, n;\n  int i, j;\n\n  cin >> zfc;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; i <= strlen(zfc) - strlen(sub); i++) {\n    m = 0;\n    for (j = 0; j < strlen(sub); j++) {\n      if (sub[j] != zfc[i + j]) {\n        m = -1;\n        break;\n      } else\n        m = 1;\n    }\n    if (m == 1) {\n      n = i;\n      break;\n    }\n  }\n  if (m == 1) {\n    for (k = n; k < n + strlen(sub); k++) {\n      zfc[k] = rep[k - n];\n    }\n\n    cout << zfc;\n  }\n\n  else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11559", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char *p = NULL;\n  char str[100], substr[100], restr[100];\n  cin >> str >> substr >> restr;\n  p = strstr(str, substr);\n  if (p != NULL) \n  {\n    strcat(restr, p + strlen(substr)); \n    *p = '\\0';                         \n    strcat(str, restr);                \n  }\n  cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11560", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char y[256], z[256], h[256], sc[256];\n\n  scanf(\"%s \", y);\n\n  cin >> z;\n\n  cin >> h;\n  int k = 0, count = 0, o;\n  int a = strlen(y);\n  int b = strlen(z);\n  int c = strlen(h);\n  for (int i = 0; i < a; i++) {\n    if (y[i] == z[k]) {\n      k++;\n      count++;\n      if (count == b) {\n        break;\n      }\n    } else {\n      if (count != b) {\n        if (count > 0) {\n          i--;\n        }\n        count = 0;\n        k = 0;\n      }\n    }\n    o = i;\n  }\n  int e = o - k + 2;\n  int f = 0;\n  for (int m = 0; m < a; m++) {\n    if ((m >= e) && (m < e + c)) {\n      sc[m] = h[f];\n      f++;\n    } else {\n      sc[m] = y[m];\n    }\n  }\n  for (int l = 0; l < a; l++) {\n    printf(\"%c\", sc[l]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256] = {0}, huan[256] = {0}, hou[256] = {0};\n  int i, e, k, len1, len2, len3, count;\n\n  scanf(\"%s \", yuan);\n\n  scanf(\"%s \", huan);\n\n  cin >> hou;\n  len1 = strlen(yuan);\n  len2 = strlen(huan);\n  len3 = strlen(hou);\n\n  int p = 0;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    count = 0;\n    if (yuan[i] == huan[0]) {\n      for (e = 0; e < len2; e++)\n        if (yuan[i + e] == huan[e])\n          count++;\n      if (count == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", yuan[k]);\n        for (k = i; k < len3 + i; k++)\n          cout << hou[k - i];\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", yuan[k]);\n        p = 1;\n        break;\n      }\n    }\n  }\n\n  if (p == 0)\n    printf(\"%s\", yuan);\n  return 0;\n}\n"}
{"label": "7", "index": "11562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], subs[15], reps[15];\n  int i, j, k, ls, lsub, lrep, w;\n  scanf(\"%s\", s);\n  scanf(\"%s\", subs);\n  scanf(\"%s\", reps);\n  ls = strlen(s);\n  lsub = strlen(subs);\n  lrep = strlen(reps);\n  for (i = 0; i < ls; i++) {\n    w = 0;\n    for (j = 0; j < lsub; j++) {\n      if (s[i + j] == subs[j])\n        w++;\n    }\n    if (w == lsub) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lrep; k++)\n        printf(\"%c\", reps[k]);\n      for (k = i + lsub; k < ls; k++)\n        printf(\"%c\", s[k]);\n      break;\n    }\n  }\n  if (w != lsub)\n    printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11563", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], w[256], r[256];\n  int l1, l2, i, j, count, k = 0;\n  scanf(\"%s%s%s\", w, s, r);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (i = 0; i < l2 - l1 + 1; i++) {\n    if (w[i] == s[0]) {\n      count = 1;\n      for (j = i + 1; j < i + l1; j++) {\n        if (w[j] != s[j - i])\n          break;\n        else\n          count++;\n      }\n      if (count == l1) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (j = i; j < i + l1; j++) {\n      w[j] = r[j - i];\n    }\n  }\n  printf(\"%s\\n\", w);\n}\n"}
{"label": "7", "index": "11564", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, x, n, m, d, k, y, v = 0;\n  char s[256], b[256], t[256];\n  cin >> s >> b >> t;\n  n = strlen(s);\n  m = strlen(b);\n  for (i = 0; i <= n - m; i++) {\n    if (s[i] == b[0]) {\n      k = i;\n      for (j = 0, x = i; j < m; j++, x++) {\n        if (s[x] != b[j])\n          break;\n      }\n      if (j >= m)\n        for (d = k, y = 0; d < k + m; d++, y++) {\n          s[d] = t[y];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[30000], b[100], c[100];\n\n  scanf(\"%s \", a);\n  int lenth, y = 1, j, i, m, num, tag = 0;\n  lenth = strlen(a);\n\n  cin >> b;\n  m = strlen(b);\n\n  cin >> c;\n  for (i = 0; i < lenth; i += y) {\n    y = 1;\n    num = 0;\n    if (tag == 0) {\n      for (j = 0; j < m; j++) {\n        if (a[i + j] == b[0 + j]) {\n          num++;\n        }\n      }\n      if (num == m) {\n        printf(\"%s\", c);\n        y = m;\n        tag = 1;\n      } else {\n        cout << a[i];\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[300], s[100], r[100];\n  int i, j, k, m;\n  cin >> str >> s >> r;\n  m = strlen(s);\n  for (i = 0; str[i] != '\\0'; i++) {\n    k = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == s[j])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j] = r[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n;\n  scanf(\"%s%s%s\", a, b, c);\n  n = strlen(b);\n  int m;\n  m = strlen(a);\n  int q, k;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[0]) {\n      k = 1;\n      for (j = i; j < i + n; j++)\n        if (b[j - i] != a[j])\n          k = 0;\n      if (k) {\n        q = i;\n        break;\n      }\n    }\n    k = 0;\n  }\n  if (k) {\n    for (i = 0; i < q; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n\n    for (i = q + n; i < m; i++)\n      printf(\"%c\", a[i]);\n  } else\n    printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11568", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint judge(int i, char s[800], char sub[800]) {\n\n  int j, k;\n  for (j = i; j <= i + strlen(sub) - 1; j++)\n    if (s[j] != sub[j - i])\n      break;\n  if (j == i + strlen(sub))\n    return 1;\n  else\n    return 0;\n}\nvoid change(int i, char s[800], char sub[800], char r[800]) {\n  int l, ls, lr, j, k;\n  l = strlen(s);\n  ls = strlen(sub);\n  lr = (strlen(r));\n\n  if (ls <= lr) {\n    k = lr - ls;\n    for (j = l + k + 1; j >= i + lr; j--)\n      s[j] = s[j - k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  } else {\n    k = ls - lr;\n    for (j = i + lr; j <= l - k + 1; j++)\n      s[j] = s[j + k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  }\n}\nint main() {\n  char s[800], sub[800], r[800];\n  int l, i;\n  cin >> s;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", r);\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    if ((s[i] == sub[0]) && (judge(i, s, sub) > 0)) {\n      change(i, s, sub, r);\n      break;\n    }\n  puts(s);\n}\n"}
{"label": "7", "index": "11569", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int i = 0;\n  char string[300];\n  char substring[300];\n  char replace[300];\n  cin >> string;\n  cin >> substring;\n  cin >> replace;\n  int l = strlen(string);\n  int l1 = strlen(substring);\n  int l2 = strlen(replace);\n  char *p = strstr(string, substring);\n  if (p != NULL) {\n    while (i < l2) {\n      *p = replace[i];\n      i++;\n      p++;\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "11570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  int i, j, m, n, k, t, q = 0, p = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i <= m - n; i++) {\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i])\n        p++;\n      else\n        break;\n    }\n    if (p == n) {\n      q++;\n      t = i;\n      for (j = 0; j <= t - 1; j++)\n        c[j] = s[j];\n      for (j = t; j < t + k; j++)\n        c[j] = b[j - i];\n      for (j = t + k; j < m - n + k; j++)\n        c[j] = s[n + j - k];\n      c[m - n + k] = '\u0000';\n      puts(c);\n      break;\n    }\n    p = 0;\n  }\n  if (q == 0)\n    puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], w[300], r[300], d[300];\n  int i, j, l, h;\n  scanf(\"%s%s%s\", s, w, r);\n  l = strlen(s);\n  h = strlen(w);\n  for (i = 0; i <= l - h; i++) {\n    for (j = 0; j < h; j++) {\n      d[j] = s[i + j];\n    }\n    d[h] = '\\0';\n    if (strcmp(d, w) == 0)\n      break;\n  }\n  if (i == l - h + 1)\n    cout << s;\n  else {\n    for (j = i; j < i + h; j++)\n      s[j] = r[j - i];\n\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, x, y, z, m, t = 1, n;\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      } else {\n        if (j == y - 1) {\n          for (m = 0; m < z; m++)\n            cout << c[m];\n          i = i + y - 1;\n          t = 0;\n        }\n      }\n    }\n    if (j < y - 1)\n      printf(\"%c\", a[i]);\n\n    if (t == 0)\n      break;\n  }\n  for (n = i + 1; n < x; n++)\n    cout << a[n];\n  return 0;\n}\n"}
{"label": "7", "index": "11573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, e = 0, j, n, m;\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char *pa = a, *ps = s, *p;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; *ps != '\u0000'; ps++, i++) {\n    if (*pa == *ps) {\n      e++;\n      for (pa = pa + 1, ps = ps + 1; *pa != '\u0000'; pa++, ps++) {\n        if (*pa == *ps) {\n          e++;\n        }\n      }\n    }\n\n    if (e == m) {\n\n      p = s;\n      for (j = 0; j < i; j++) {\n        cout << *p;\n        p++;\n      }\n      printf(\"%s\", b);\n      if (n - i > m) {\n        for (j = 0; j < m; j++) {\n          p++;\n        }\n        printf(\"%s\", p);\n        break;\n      } else {\n        break;\n      }\n    } else {\n      if (e > 0) {\n        pa = a;\n        for (j = 0; j < m; j++)\n          ps--;\n      }\n    }\n    e = 0;\n  }\n\n  if (e != m) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j = 0, k = -1, n, p, q, s, h = 0, r;\n  int d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < 256; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      d[j] = i;\n      j += 1;\n    }\n  }\n  n = strlen(b);\n  p = strlen(c);\n  q = strlen(a);\n  if (k != -1) {\n    for (s = 0; s < j; s++) {\n      for (i = d[s]; i < d[s] + n; i++) {\n        r = d[s];\n        if (a[i] != b[i - r]) {\n          h += 1;\n          break;\n        }\n      }\n      if (i == d[s] + n) {\n        for (r = 0; r < d[s]; r++) {\n          cout << a[r];\n        }\n        for (r = 0; r < p; r++) {\n          printf(\"%c\", c[r]);\n        }\n        for (r = d[s] + n; r < q; r++) {\n          printf(\"%c\", a[r]);\n        }\n        break;\n      }\n    }\n    if (h == j) {\n      printf(\"%s\", a);\n    }\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11575", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ys[1000], re[1000], bt[1000];\n  int m, n, i, j, k, ss = 0, se = 0;\n\n  cin >> ys;\n\n  cin >> bt;\n\n  scanf(\"%s \", re);\n  for (i = 0; ys[i] != 0; i++) {\n    if (ys[i] == bt[0]) {\n      for (k = i + 1, j = 1; ys[k] != 0 && bt[j] != 0; k++, j++) {\n        if (ys[k] != bt[j]) {\n          break;\n        }\n      }\n      if (bt[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(bt) <= strlen(re)) {\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n      for (k = se; ys[k] != 0; k++, i++) {\n        ys[i] = ys[k];\n      }\n      ys[i] = 0;\n    } else {\n      i = strlen(ys) + strlen(re) - strlen(bt);\n      for (k = strlen(ys); k >= se; k--, i--) {\n        ys[i] = ys[k];\n      }\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n    }\n  }\n  printf(ys);\n  return 0;\n}\n"}
{"label": "7", "index": "11576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint strnl(char *, char *);\nvoid replace(char *str, int len_ss, int start, char *rpl);\n\nint main() {\n  char str[256], substr[256], rpl[256];\n  int start;\n  scanf(\"%s %s %s \", str, substr, rpl);\n  start = strnl(str, substr);\n  if (start != -1)\n    replace(str, strlen(substr), start, rpl);\n  else\n    printf(\"%s\\n\", str);\n  return 0;\n}\n\nint isstart(int i, char *s, char *subs) {\n  char temp[256];\n  char *p, *pt;\n  p = s + i;\n  pt = temp;\n  int j;\n  for (j = 0; j < strlen(subs); j++)\n    *pt++ = *p++;\n  *pt = 0;\n  if (!strcmp(temp, subs))\n    return 1;\n  return 0;\n}\n\nint strnl(char *s, char *subs) {\n  int i;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (isstart(i, s, subs))\n      return i;\n  return -1;\n}\n\nvoid replace(char *str, int len_ss, int start, char *rpl) {\n  char temp[256];\n  strcpy(temp, str);\n  char *ptmp, *prpl;\n  ptmp = temp + start;\n  prpl = rpl;\n  while (*prpl)\n    *ptmp++ = *prpl++;\n  char *pstr = str + start + len_ss;\n  while (*pstr)\n    *ptmp++ = *pstr++;\n  *ptmp = 0;\n  strcpy(str, temp);\n  cout << temp << \"\\n\";\n}\n"}
{"label": "7", "index": "11577", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", b, a, c);\n  int alen, blen, clen, i, j;\n  alen = strlen(a);\n  blen = strlen(b);\n  clen = strlen(c);\n  int n = 0;\n  for (i = 0; i < blen; i++) {\n    if (b[i] == a[0]) {\n      n = 1;\n      for (j = 0; j < alen; j++)\n        if (a[j] != b[i + j]) {\n          n = 2;\n          break;\n        }\n    }\n    if (n == 1)\n      break;\n  }\n  int t = i;\n  if (n == 1) {\n    for (i = 0; i < t; i++)\n      printf(\"%c\", b[i]);\n    printf(\"%s\", c);\n    for (i = t + clen; i < blen; i++)\n      printf(\"%c\", b[i]);\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "11578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257];\n  char a[257];\n  char a1[257];\n  int i, j, len, n = 0, k, flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> a1;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      n = i;\n      for (j = i + 1, k = 1; j < i + len; j++, k++) {\n        if (s[j] != a[k])\n          flag = 0;\n      }\n      if (flag == 1)\n        break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", a1);\n    for (i = n + len; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n  }\n  if (flag == 0)\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char q[100], a[10], b[10], lenb, I, *c;\n  int i;\n  scanf(\"%s \", q);\n  cin >> a;\n  cin >> b;\n  lenb = strlen(b);\n  c = strstr(q, a);\n  if (c != NULL) {\n    strncpy(c, b, lenb);\n    puts(q);\n  } else if (c == NULL) {\n    puts(q);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char y[100], h[100], c[100];\n  int i, j, len[3], count = 0, k = 0, a[100];\n  cin >> y;\n  scanf(\"%s\", &h);\n  scanf(\"%s\", &c);\n  for (i = 0; i < strlen(y); i++) {\n    for (j = 0; j < strlen(h); j++) {\n      if (y[i + j] == h[j]) {\n        count++;\n      }\n    }\n    if (count == strlen(h)) {\n      k++;\n      a[k] = i;\n    }\n    count = 0;\n  }\n  if (k == 0) {\n    printf(\"%s\", y);\n    return 0;\n  }\n  for (i = 0; i < a[1]; i++)\n    printf(\"%c\", y[i]);\n  printf(\"%s\", c);\n  if (i == k) {\n    return 0;\n  }\n  for (j = a[1] + strlen(h); j < strlen(y); j++) {\n    cout << y[j];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11581", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257];\n  char substring[257];\n  char replacement[257];\n  int h, i, j, k, l1, l2, l3, temp, r = 0, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s \", substring);\n  scanf(\"%s\", replacement);\n  l1 = strlen(string);\n  l2 = strlen(substring);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    if (string[i] == substring[0]) {\n      temp = i;\n      r = 0;\n      for (j = 0; j < l2; j++) {\n        if (string[temp + j] == substring[j]) {\n          r = r + 1;\n        }\n      }\n      if (r == l2) {\n\n        for (h = 0; h < temp; h++) {\n          printf(\"%c\", string[h]);\n        }\n        for (j = 0; j < l3; j++) {\n          printf(\"%c\", replacement[j]);\n        }\n        for (k = temp + l2; k < l1; k++) {\n          printf(\"%c\", string[k]);\n        }\n\n        return 0;\n      }\n    }\n  }\n\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int i, r1, r2, r3, j, q, h = 0, result = 0;\n  scanf(\"%s\", str);\n  cin >> sub;\n  scanf(\"%s\", rep);\n  r1 = strlen(str);\n  r2 = strlen(sub);\n  r3 = strlen(rep);\n  for (i = 0; i < r1; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < r2; j++) {\n        if (str[i + j] != sub[j])\n          break;\n      }\n      if (j == r2) {\n        result = 1;\n        for (q = i; q < i + r3; q++) {\n          str[q + r3] = str[q + r2];\n          str[q] = rep[h];\n          h++;\n        }\n        printf(\"%s\", str);\n        break;\n      }\n    }\n  }\n  if (result == 0) {\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[266];\n  int i, k, len, n, m, j = 0;\n  char yuan[20], mb[20], kd[20];\n  scanf(\"%s %s %s\", sz, yuan, mb);\n  m = strlen(sz);\n  n = strlen(yuan);\n  for (i = 0; i < m; i++) {\n    if (sz[i] != yuan[0]) {\n      printf(\"%c\", sz[i]);\n    } else {\n      for (k = i; k < i + n; k++) {\n        kd[k - i] = sz[k];\n      }\n      kd[n] = '\\0';\n\n      if (strcmp(kd, yuan) == 0) {\n        printf(\"%s\", mb);\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", sz[k]);\n        }\n        break;\n\n      } else {\n        printf(\"%c\", sz[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, n = 0, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (b[0] == a[i]) {\n      for (j = 0; j < lenb; j++) {\n        if (b[j] == a[i + j]) {\n          n++;\n        }\n      }\n    }\n    if (n == lenb)\n      break;\n    else\n      n = 0;\n  }\n  if (i < lena) {\n    for (j = 0; j < lenb; j++)\n      a[i + j] = c[j];\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11585", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char org[270] = {0}, sub[100] = {0}, rep[100] = {0}, temp[100] = {0};\n  scanf(\"%s %s %s \", org, sub, rep);\n  int i, j, l1 = strlen(org), l = strlen(sub), flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < i + l; j++)\n      temp[j - i] = org[j];\n\n    if (strcmp(temp, sub) == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (int k = 0; k < i; k++)\n      cout << org[k];\n    cout << rep;\n    cout << org + j << endl;\n  } else\n    cout << org << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11586", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[300], substring[300], replacement[300], test[300];\n  int lensub, len, i, j;\n  scanf(\"%s %s %s \", string, substring, replacement);\n  len = strlen(string);\n  lensub = strlen(substring);\n  for (i = 0; i <= len - lensub; i++) {\n    for (j = 1; j <= lensub; j++) {\n      test[j - 1] = string[i + j - 1];\n      test[j] = '\\0';\n    }\n    if (strcmp(test, substring) != 0) {\n      printf(\"%c\", string[i]);\n    } else {\n      printf(\"%s\", replacement);\n      i += lensub;\n      break;\n    }\n  }\n  for (; i <= len - 1; i++) {\n    printf(\"%c\", string[i]);\n  }\n}\n"}
{"label": "7", "index": "11587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar *strrpl(char *src, char *sub, char *rpl) {\n  char *p = strstr(src, sub);\n  int a, b;\n  if (p == NULL)\n    return src;\n  a = strlen(sub);\n  b = strlen(rpl);\n  memmove(p + b, p + a, strlen(p + a) + 1);\n  memcpy(p, rpl, b);\n  return src;\n}\nint main() {\n  char str[256], sub[256], rpl[256];\n  cin >> str;\n  cin >> sub;\n  cin >> rpl;\n  puts(strrpl(str, sub, rpl));\n  return 0;\n}\n"}
{"label": "7", "index": "11588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256] = {0}, subS[256] = {0}, re[256] = {0}, t, s1[256] = {0};\n  int i, j, l1, l2, l3, count, yes;\n  scanf(\"%s\\0\", s);\n  scanf(\"%s\\0\", subS);\n  scanf(\"%s\\0\", re);\n  l1 = strlen(s);\n  l2 = strlen(subS);\n  l3 = strlen(re);\n  yes = 0;\n  strcpy(s1, s);\n  for (i = 0; i <= l1 - l2; i++) {\n    count = 0;\n    for (j = 0; j < l2; j++) {\n      if (subS[j] != s[i + j])\n        break;\n      if (subS[j] == s[i + j])\n        count++;\n    }\n    if (count == l2) {\n      yes = 1;\n      if (l2 == l3) {\n        for (j = 0; j < l2; j++) {\n          s[i + j] = re[j];\n        }\n        printf(\"%s\", s);\n        break;\n      }\n      if (l2 > l3) {\n        for (j = 0; j < l3; j++) {\n          s[i + j] = re[j];\n        }\n        for (j = 0; j < l1 - i - l2; j++) {\n\n          s[i + l3 + j] = s[i + l2 + j];\n        }\n        for (j = 0; j < l1 + l3 - l2; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n      if (l2 < l3) {\n\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", s[j]);\n        }\n        printf(\"%s\", re);\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n        break;\n      }\n    }\n  }\n  if (yes == 0) {\n\n    for (j = 0; j < l1; j++) {\n      printf(\"%c\", s1[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j = 0, k = -1, n, p, q, s, h = 0, r;\n  int d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s \", c);\n  for (i = 0; i < 256; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      d[j] = i;\n      j += 1;\n    }\n  }\n  n = strlen(b);\n  p = strlen(c);\n  q = strlen(a);\n  if (k != -1) {\n    for (s = 0; s < j; s++) {\n      for (i = d[s]; i < d[s] + n; i++) {\n        r = d[s];\n        if (a[i] != b[i - r]) {\n          h += 1;\n          break;\n        }\n      }\n      if (i == d[s] + n) {\n        for (r = 0; r < d[s]; r++) {\n          printf(\"%c\", a[r]);\n        }\n        for (r = 0; r < p; r++) {\n          printf(\"%c\", c[r]);\n        }\n        for (r = d[s] + n; r < q; r++) {\n          printf(\"%c\", a[r]);\n        }\n        break;\n      }\n    }\n    if (h == j) {\n      printf(\"%s\", a);\n    }\n  } else {\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2, len3, j, m = 0, l;\n  char zifu[256], chazhao[256], tihuan[256];\n  scanf(\"%s%s%s\", zifu, chazhao, tihuan);\n  len1 = strlen(zifu);\n  len2 = strlen(chazhao);\n  len3 = strlen(tihuan);\n  for (i = 0; i < len1; i++) {\n    m = 0;\n    if (zifu[i] == chazhao[0]) {\n      for (j = 0; j < len2; j++) {\n        if (zifu[i + j] == chazhao[j])\n          m++;\n        if (zifu[i + j] != chazhao[j])\n          break;\n      }\n    }\n    if (m == len2)\n      break;\n  }\n\n  if (i < len1) {\n    if (len2 == len3) {\n      for (l = 0; l < len2; l++)\n        zifu[i + l] = tihuan[l];\n    } else if (len2 > len3) {\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n    } else if (len2 < len3) {\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n    }\n  }\n\n  printf(\"%s\\n\", zifu);\n  return 0;\n}\n"}
{"label": "7", "index": "11591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], w[100], t[100];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  int i, j, k, p, q, f = 1, n, m, e;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = j = 0; i < n; i++) {\n    k = i;\n    p = i;\n    q = j;\n    if (w[p] == s[q]) {\n      for (q = 0; q < m; q++) {\n        if (w[p] != s[q]) {\n          f = 0;\n        }\n        p++;\n      }\n      if (f == 1) {\n        for (e = 0; e < k; e++) {\n          printf(\"%c\", w[e]);\n        }\n        printf(\"%s\", t);\n        for (e = k + m; e < n; e++) {\n          printf(\"%c\", w[e]);\n        }\n        return 0;\n      }\n      f = 1;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "11592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[260], subString[260], replacement[260], string3[260];\n  scanf(\"%s %s %s \", string, subString, replacement);\n  char *p = strstr(string, subString);\n  if (p == NULL) {\n    cout << string << endl;\n    return 0;\n  }\n  int i = 0, j, k, len1 = strlen(subString), len2 = strlen(replacement);\n  for (i = 0; *(p + len1 + i) != '\\0'; i++)\n    string3[i] = *(p + len1 + i);\n\n  string3[i] = '\\0';\n  *p = '\\0';\n  strcat(string, replacement);\n  strcat(string, string3);\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l1, l2, l3, sum;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  sum = 0;\n  l1 = strlen(b);\n  l2 = strlen(c);\n  l3 = strlen(a);\n  for (i = 0; i < l3; i++) {\n    for (j = i, k = 0; k < l1; k++) {\n      if (a[j] != b[k])\n        break;\n      j++;\n    }\n    if (k == l1 && sum == 0) {\n      for (j = 0; c[j] != '\u0000'; j++)\n        printf(\"%c\", c[j]);\n      i = i + l1 - 1;\n      sum = sum + 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "11594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, n = 0, m = 1, z = 0, t = 1, g;\n  char q[256], p[256], w[256];\n  scanf(\"%s\", q);\n  scanf(\"%s\", p);\n  scanf(\"%s\", w);\n  k = strlen(q);\n  l = strlen(p);\n  for (i = 0; i < k; i++) {\n    if (p[0] == q[i]) {\n      for (j = 1; j < l; j++) {\n        g = 1;\n        if (p[j] != q[j + i])\n          g = 0;\n      }\n      if (g == 1) {\n        z = 1;\n        m = i;\n        break;\n      }\n    }\n  }\n  if (z) {\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", q[j]);\n    }\n    printf(\"%s\", w);\n    for (j = m + l; j < k; j++)\n      printf(\"%c\", q[j]);\n  } else\n    printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "7", "index": "11595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d && a[l]; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, x, m, n;\n  char s[300], sub[300], re[300];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  n = strlen(s);\n  m = strlen(sub);\n  x = strlen(re);\n  for (i = 0; i <= n - m; i++) {\n    for (j = 0, t = i; j < m; j++) {\n      if (s[t] == sub[j]) {\n        t++;\n      } else\n        break;\n    }\n    if (j == m)\n      break;\n  }\n  if (i == n - m + 1) {\n    ;\n  } else {\n    for (t = i + x; t < n + x - m; t++) {\n      s[t] = s[t - x + m];\n    }\n    for (j = i, t = 0; j < i + x; j++, t++) {\n      s[j] = re[t];\n    }\n  }\n  puts(s);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], s1[300], s2[300] = {'\u0000'};\n  int i, j, len, count = 0, m;\n\n  scanf(\"%s \", s);\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  for (i = 0; i < len; i++)\n    if (s[i] == s1[0]) {\n      for (j = 1; s1[j] != '\u0000'; j++)\n        if (s[j + i] != s1[j])\n          break;\n      if (j >= strlen(s1)) {\n        m = i;\n        count = 1;\n        break;\n      }\n    }\n  if (count) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s[i]);\n    for (i = 0; s2[i] != '\u0000'; i++)\n      cout << s2[i];\n    for (j = i + m; j < len; j++)\n      printf(\"%c\", s[j]);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], copy[101], before[101], after[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i = 0, j;\n  for (i; i <= (int)(strlen(s) - strlen(a)); i++) {\n    for (j = 0; j < (int)(strlen(a)); j++) {\n      copy[j] = s[i + j];\n    }\n    copy[j] = '\u0000';\n    if (strcmp(copy, a) == 0) {\n      for (j = 0; j < i; j++) {\n        before[j] = s[j];\n      }\n      before[j] = '\u0000';\n      for (j = i + (int)strlen(a); j < (int)(strlen(s)); j++) {\n        after[j - i - (int)strlen(a)] = s[j];\n      }\n      after[j - i - (int)strlen(a)] = '\u0000';\n      strcat(before, b);\n      strcat(before, after);\n      strcpy(s, before);\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11599", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300];\n  char b[200], c[200], d[200] = {0};\n  int n1, n2, n3, i, j, k, result, p, w;\n  cin >> a >> b >> c;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n3 = strlen(c);\n  p = 0;\n  k = 10000;\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    if (p == 0) {\n      for (j = 0; j < n2; j++) {\n        d[j] = a[i + j];\n      }\n      result = strcmp(d, b);\n      if (result == 0) {\n        k = i;\n        p = 1;\n        w = i + j;\n      }\n    }\n  }\n  if (k == 10000)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = w; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11600", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l1, l2, l3, e = 0, sum = 0;\n  char s[300], z[300], h[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(z);\n  l3 = strlen(h);\n  for (i = 0; i <= l1 - l2; i++) {\n    e = 0;\n    for (j = 0; j < l2; j++) {\n      if (z[j] == s[j + i]) {\n        e++;\n      }\n    }\n\n    if (e == l2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", s[j]);\n      }\n      for (j = 0; j < l3; j++) {\n        printf(\"%c\", h[j]);\n      }\n      if (i + l2 < l1 - 1) {\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n      }\n      sum++;\n      break;\n    }\n  }\n  if (sum == 0) {\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n = 0, m;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n    }\n    if (n == m - 1) {\n      for (j = 0; j < m; j++)\n        a[i + j] = c[j];\n      break;\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11602", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char str1[256], str2[256], str3[256];\n  cin >> str1 >> str2 >> str3;\n  int i = 0, j = 0, l1 = strlen(str1), l2 = strlen(str2);\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      if (str1[i + j] != str2[j])\n        break;\n    }\n    if (j == l2) {\n      for (j = 0; j < l2; j++) {\n        str1[i + j] = str3[j];\n      }\n      break;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    cout << str1[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  scanf(\"%s%s%s\", str, sub, re);\n  int l1, l2;\n  l1 = strlen(str);\n  l2 = strlen(sub);\n  int i, j, m;\n  for (i = 0; i < l1; i++) {\n    m = 1;\n    for (j = 0; j < l2; j++) {\n      if (str[i + j] != sub[j]) {\n        m = 2;\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < l2; j++)\n        str[i + j] = re[j];\n\n      break;\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, L, l1, l2;\n  char s[1000], a[300], b[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n    getchar();\n  }\n  for (k = i + l1; i != L && k < L; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char st[300], sub[300], re[300], c[300], sz[300];\n  int i, j, k, t, u;\n  scanf(\"%s%s%s\", st, sub, re);\n  for (i = 0; i <= strlen(st) - strlen(sub); i++) {\n    u = 0;\n    k = 0;\n    t = 0;\n    strcpy(sz, st);\n    for (j = i; j <= (i + strlen(sub) - 1); j++) {\n      c[k] = sz[j];\n      k++;\n    }\n    c[k] = '\\0';\n    if (strcmp(c, sub) == 0) {\n      for (j = i; j <= (i + strlen(sub) - 1); j++) {\n        sz[j] = re[t];\n        t++;\n      }\n      cout << sz;\n      u = 1;\n      break;\n    }\n  }\n  if (u == 0) {\n    printf(\"%s\", st);\n  }\n}\n"}
{"label": "7", "index": "11606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  scanf(\"%s \", y);\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    for (j = 0; j < changdu2; j++)\n      media[i][j] = x[i + j];\n  }\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    if (strcmp(media[i], y) == 0) {\n      p = i;\n      break;\n    }\n  }\n  if (i >= changdu1 - changdu2 + 1) {\n    for (i = 0; i < changdu1; i++) {\n      printf(\"%c\", x[i]);\n    }\n  } else {\n    strcpy(media[p], z);\n    if (p != 0) {\n      for (i = 0; i < p; i++)\n        printf(\"%c\", x[i]);\n      printf(\"%s\", media[p]);\n      if (changdu2 > changdu3)\n        m = changdu2;\n      else\n        m = changdu3;\n      for (i = p + m; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    } else {\n      printf(\"%s\", media[p]);\n      for (i = p + changdu3; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11607", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char yuan[256], jiu[256], xin[256];\n  int i, j, len, n = 0, len1, u[256], jishu[256] = {0}, len2, k, weizhi,\n                 sum = 0;\n  scanf(\"%s\", yuan);\n  scanf(\"%s\", jiu);\n  scanf(\"%s\", xin);\n  len1 = strlen(yuan);\n  len2 = strlen(jiu);\n  for (i = 0; i < len1; i++) {\n    if (yuan[i] == jiu[0]) {\n      u[n] = i;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = u[i], k = 0; j < u[i] + len2, k < len2; j++, k++) {\n      if (yuan[j] != jiu[k]) {\n        jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (jishu[i] == 0) {\n      sum++;\n    }\n  }\n  if (sum == 0) {\n    printf(\"%s\", yuan);\n  } else {\n    for (i = 0; i < n; i++) {\n      if (jishu[i] == 0) {\n        weizhi = u[i];\n        break;\n      }\n    }\n\n    for (i = weizhi, k = 0; i < weizhi + len2, k < len2; i++, k++) {\n      yuan[i] = xin[k];\n    }\n    printf(\"%s\", yuan);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char m[600], z[256], t[256];\n  cin >> m >> z >> t;\n  int len1 = strlen(m);\n  int len2 = strlen(z);\n  int i, j, c = 1, flag = 0;\n  for (i = 0; i < len1; i++) {\n    int k = 0;\n    if (m[i] == z[k]) {\n      j = i;\n      for (k = 1; k < len2; k++) {\n        if (m[i + 1] == z[k]) {\n          i++;\n          c++;\n        } else {\n          break;\n        }\n      }\n    }\n    if (c == len2) {\n      break;\n    }\n  }\n  if (c == len2) {\n    for (i = 0; i < j; i++) {\n      printf(\"%c\", m[i]);\n    }\n    printf(\"%s\", t);\n    for (i = j + len2; i < len1; i++) {\n      printf(\"%c\", m[i]);\n    }\n  } else {\n    printf(\"%s\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint judge(int i, char s[800], char sub[800]) {\n\n  int j;\n  for (j = i; j <= i + strlen(sub) - 1; j++)\n    if (s[j] != sub[j - i])\n      break;\n  if (j == i + strlen(sub))\n    return 1;\n  else\n    return 0;\n}\nvoid change(int i, char s[800], char sub[800], char r[800]) {\n  int l, ls, lr, j, k;\n  l = strlen(s);\n  ls = strlen(sub);\n  lr = (strlen(r));\n\n  if (ls <= lr) {\n    k = lr - ls;\n    for (j = l + k + 1; j >= i + lr; j--)\n      s[j] = s[j - k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  } else {\n    k = ls - lr;\n    for (j = i + lr; j <= l - k + 1; j++)\n      s[j] = s[j + k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  }\n}\nint main() {\n  char s[800], sub[800], r[800];\n  int l, i;\n  cin >> s;\n  scanf(\"%s\", sub);\n  cin >> r;\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    if ((s[i] == sub[0]) && (judge(i, s, sub) > 0)) {\n      change(i, s, sub, r);\n      break;\n    }\n  puts(s);\n}\n"}
{"label": "7", "index": "11610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i;\n  char *p;\n  cin >> a >> b >> c;\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; i < p - a; i++)\n      cout << a[i];\n    cout << c;\n    for (p = p + strlen(b); p < a + strlen(a); p++)\n      printf(\"%c\", *p);\n  } else\n    cout << a;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11611", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  int t2 = 0;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      t2 += 1;\n    }\n\n    if (t == 1 && t2 == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char b[256];\n  int i, j, x = 0, m, n, y = 0, p;\n  char c;\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(b);\n  p = strlen(s);\n  for (i = 0; i <= p - n; i++) {\n    c = s[i];\n    if (c == a[0]) {\n      for (j = 0; j < n; j++) {\n        if (a[j] != s[i + j]) {\n          x = 1;\n        } else\n          x = 0;\n      }\n      if (x == 0) {\n        m = i;\n        y = 1;\n        break;\n      }\n    }\n  }\n  if (y == 1) {\n    for (i = m, j = 0; i < m + n; i++, j++) {\n      s[i] = b[j];\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11613", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], s1[256], s2[256], ss[20], re[20];\n  int i, j, x = 0, y = 0, a, flag = 0;\n\n  cin >> s;\n  cin >> ss >> re;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ss[0]) {\n      s1[x] = s[i];\n      x++;\n    } else if (s[i] == ss[0]) {\n      a = i;\n      flag = 1;\n      for (j = 0; ss[j] != '\u0000'; j++) {\n        if (ss[j] != s[a]) {\n          flag = 0;\n        }\n        a++;\n      }\n      if (flag == 0) {\n        s1[x] = s[i];\n        x++;\n      }\n    }\n    if (flag == 1) {\n      s1[x] = '\u0000';\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i += strlen(ss); s[i] != '\u0000'; i++) {\n      s2[y] = s[i];\n      y++;\n    }\n  }\n  s2[y] = '\u0000';\n  if (flag == 1) {\n    printf(\"%s%s%s\", s1, re, s2);\n  }\n  if (flag == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11614", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[257], sub[257], re[257];\n  char out[257] = {'\u0000'};\n  scanf(\"%s\", string);\n  cin >> sub;\n  scanf(\"%s\", re);\n  int i, k = 0, len, m = 0;\n  len = strlen(sub);\n  int len2 = strlen(re);\n  int len3 = strlen(string);\n  for (i = 0; i < 256; i++) {\n    if (string[i] == sub[k]) {\n      k += 1;\n      if (k == len)\n        break;\n    } else\n      k = 0;\n  }\n  if (k == len) {\n    int s = len3 - len + len2;\n    for (int j = 0; j < s; j++) {\n      if (j <= i - k) {\n        out[j] = string[j];\n        continue;\n      }\n      if (j > i - k && j <= i - k + len2) {\n        out[j] = re[m];\n        m += 1;\n      } else {\n        out[j] = string[i + 1];\n        i++;\n      }\n    }\n    printf(\"%s\", out);\n  } else\n    printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "11615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[10000], subString[300], replacement[1000];\n  cin >> string >> subString >> replacement;\n  char *p, *q;\n  q = replacement;\n  p = strstr(string, subString); \n  if (p != NULL)                 \n  {\n    while (*q) {\n      *p++ = *q++;\n    }\n  }\n  cout << string << endl; \n  return 0;\n}\n"}
{"label": "7", "index": "11616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, t, l1, l2, l3, judge;\n  char s[256], a[256], b[256];\n  cin >> s;\n  l1 = strlen(s);\n  cin >> a;\n  l2 = strlen(a);\n  cin >> b;\n  l3 = strlen(b);\n  for (i = 0; i <= l1 - l2; i++) {\n    judge = 1;\n    for (j = 0; j < l2; j++)\n      if (s[i + j] != a[j]) {\n        judge = 0;\n        break;\n      }\n    if (judge == 1) {\n      t = i;\n      break;\n    }\n  }\n  if (judge == 1)\n    for (k = 0; k < l3; k++)\n      s[t + k] = b[k];\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, f, d, k = 0;\n  scanf(\"%s %s %s \", a, b, c);\n  d = strlen(a);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (a[i] == b[0] && a[i + 1] == b[1] && a[i + 2] == b[2] &&\n        a[i + 3] == b[3]) {\n      for (j = i; j < i + f; j++) {\n        a[j] = c[k];\n        k++;\n      }\n      break;\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11618", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, m, k, N, j, p, n = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  N = strlen(a) - strlen(b);\n  p = strlen(b);\n  for (k = 0; k <= N; k++) {\n    m = 0;\n    for (i = 0; i < 256; i++) {\n      if (a[i + k] == b[i]) {\n        m++;\n      }\n      if (a[i + k] == '\u0000') {\n        break;\n      }\n      if (b[i] == '\u0000') {\n        break;\n      }\n      if (m >= p - 1) {\n        break;\n      }\n    }\n\n    if (m >= p - 1) {\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; c[j] != '\u0000'; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = k + m + 1; a[j] != '\u0000'; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\"\u0000\");\n      n = 1;\n    }\n    if (n == 1)\n      break;\n  }\n\n  if (n == 0) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char word[2][256], chan[256];\n  int i, j, len[2], result = 1, wzy = 0, weizhi;\n\n  scanf(\"%s %s %s \", word, word, chan);\n  len[0] = strlen(word[0]);\n  len[1] = strlen(word[1]);\n\n  for (i = 0; i <= len[1] - len[0]; i++) {\n    if (word[1][i] == word[0][0]) {\n      for (j = i + 1; j < i + len[0]; j++) {\n        if (word[1][j] != word[0][j - i]) {\n          result = 0;\n          break;\n        }\n      }\n      if (result) {\n        weizhi = i;\n        wzy = 1;\n      }\n      result = 1;\n    }\n    if (wzy == 1) {\n      break;\n    }\n  }\n\n  if (wzy == 1) {\n    for (i = weizhi; i < weizhi + len[0]; i++) {\n      word[1][i] = chan[i - weizhi];\n    }\n  }\n\n  for (i = 0; i < len[1]; i++) {\n    cout << word[1][i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11620", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n    if (j >= len2)\n      break;\n    if (j)\n      j = 0;\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++) {\n    n[i] = b[j];\n  }\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  printf(\"%s\\n\", n);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, L, l1, l2;\n  char s[300], a[300], b[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    cout << s[k];\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n  }\n  for (k = i + l1; k < L; k++) {\n    printf(\"%c\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11622", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char mc[1000], zc[1000], huan[1000];\n  int len1, len2, len3, i, j = 0;\n  int sum = 0, ci = 0, loc;\n  cin >> mc >> zc >> huan;\n  len1 = strlen(mc);\n  len2 = strlen(zc);\n  len3 = strlen(huan);\n  for (i = 0; i < len1; i++) {\n    if (mc[i] == zc[0]) {\n      sum = 0;\n      for (j = i; j < len1; j++) {\n        if (mc[j] == zc[j - i]) {\n          sum++;\n        } else {\n          break;\n        }\n      }\n      loc = i;\n      if (sum == len2) {\n        for (i = 0; i < loc; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        for (i = loc; i <= loc + len3 - 1; i++) {\n          printf(\"%c\", huan[i - loc]);\n        }\n        for (i = loc + len3; i <= len1 + len3 - len2 - 1; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        ci++;\n        break;\n      }\n    }\n  }\n\n  if (ci == 0) {\n    printf(\"%s\", mc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  cin >> b >> a >> c;\n  int alen, blen, clen, i, j;\n  alen = strlen(a);\n  blen = strlen(b);\n  clen = strlen(c);\n  int n = 0;\n  for (i = 0; i < blen; i++) {\n    if (b[i] == a[0]) {\n      n = 1;\n      for (j = 0; j < alen; j++)\n        if (a[j] != b[i + j]) {\n          n = 2;\n          break;\n        }\n    }\n    if (n == 1)\n      break;\n  }\n  int t = i;\n  if (n == 1) {\n    for (i = 0; i < t; i++)\n      printf(\"%c\", b[i]);\n    printf(\"%s\", c);\n    for (i = t + clen; i < blen; i++)\n      printf(\"%c\", b[i]);\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "11624", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], d[300], r[300];\n  int i = 0, j, k, ls, lr, ld;\n  int flag = 0;\n  int cont = 0;\n  scanf(\"%s \", s);\n  cin >> d;\n  cin >> r;\n  ls = strlen(s);\n  ld = strlen(d);\n  lr = strlen(r);\n  for (i = 0; i < ls;) {\n    flag = 0;\n    for (j = 0; j < ld; j++) {\n      if (s[i + j] == d[j])\n        flag++;\n      if (flag == ld)\n        cont++;\n    }\n\n    if (flag == ld && cont == 1) {\n      cont++;\n      for (k = 0; k < lr; k++)\n        s[i + k] = r[k];\n\n      i = i + lr;\n      continue;\n    } else {\n      i++;\n      continue;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11625", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260]; \n  char *p, *q, *k;\n  cin.getline(a, 260);\n  cin.getline(b, 260);\n  cin.getline(c, 260);\n  int lena = strlen(a), lenb = strlen(b), flag = 0, t = 0,\n      i; \n  p = a;\n  q = a;\n  k = b;\n  while (*p != '\\0') \n  {\n    if (*q == *k) \n    {\n      q++; \n      k++;\n      if (*k == '\\0') \n      {\n        flag = 1; \n        for (i = 0; i < t; i++)\n          cout << a[i];\n        cout << c;\n        for (i = t + lenb; a[i] != '\\0'; i++)\n          cout << a[i];\n        cout << endl;\n        break;\n      }\n    } else \n    {\n      p++;\n      q = p;\n      k = b;\n      t++; \n    }\n  }\n  if (flag == 0) \n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256] = {0}, subs[256] = {0}, rep[256] = {0}, front[256] = {0},\n       back[256] = {0};\n  int i = 0, x = 0, len1, len2, n = 0, m = 0, y = 0, flag = 0;\n  char a[256] = {0}, b[256] = {0};\n\n  scanf(\"%s \", str);\n\n  cin >> subs;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(subs);\n  for (i = 0; i < len1; i++) {\n    strcpy(a, b);\n    x = 0;\n    if (str[i] == subs[0]) {\n      m = i;\n      for (int j = m; j < len2 + m; j++) {\n        a[x] = str[j];\n        x++;\n      }\n      a[x] = '\u0000';\n    }\n    if (strcmp(a, subs) == 0) {\n      n = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    if (n != 0) {\n      for (i = 0; i < n; i++)\n        front[i] = str[i];\n    }\n    if (n != len1 - len2) {\n      for (i = n + len2; i < len1; i++) {\n        back[y] = str[i];\n        y++;\n      }\n    }\n    printf(\"%s%s%s \", front, rep, back);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11627", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m = 0;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  k = strlen(b);\n\n  i = strstr(a, b) - a;\n\n  if (i >= 0 && i <= n - k) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + k; j < n; j++) {\n      printf(\"%c\", a[j]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "11628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char org[270] = {0}, sub[100] = {0}, rep[100] = {0}, temp[100] = {0};\n  scanf(\"%s %s %s \", org, sub, rep);\n  int i, j, l1 = strlen(org), l = strlen(sub), flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < i + l; j++) {\n      temp[j - i] = org[j];\n    }\n    if (strcmp(temp, sub) == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (int k = 0; k < i; k++)\n      cout << org[k];\n    cout << rep;\n    cout << org + j << endl;\n  } else\n    cout << org << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int start, end, ok, i, j, n, m, s;\n  char a[300], b[300], c[300];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  s = strlen(c);\n  for (i = 0; i < n; i++)\n    if (a[i] == b[0]) {\n      ok = 1;\n      for (j = 1; j < m; j++)\n        if (a[j + i] != b[j])\n          ok = 0;\n      if (ok) {\n        start = i;\n        end = j + i;\n        break;\n      }\n    }\n  if (ok == 1) {\n    for (i = 0; i < start; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", c[i]);\n    for (i = end; i < n; i++)\n      printf(\"%c\", a[i]);\n    cout << \" \";\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11630", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[600], subStr[260], rep[260];\n  memset(str, 0, sizeof(str));\n  scanf(\"%s%s%s\", str, subStr, rep);\n  char *pos = strstr(str, subStr);\n  if (pos != NULL) {\n    int len = strlen(rep);\n    for (int i = 0; i < len; i++) {\n      *pos++ = rep[i];\n    }\n  }\n  printf(\"%s\", str);\n}\n"}
{"label": "7", "index": "11631", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[257], a[50], b[50];\n  int i, j, k;\n  cin >> zfc >> a >> b;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (a[0] == zfc[i]) {\n      for (j = 1; j < strlen(a); j++) {\n        if (a[j] != zfc[i + j])\n          break;\n      }\n      if (j == strlen(a))\n        break;\n    }\n  }\n  if (j == strlen(a)) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", zfc[k]);\n    for (k = i; k < i + strlen(b); k++)\n      printf(\"%c\", b[k - i]);\n    for (k = i + strlen(b); k < strlen(zfc); k++)\n      printf(\"%c\", zfc[k]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int len1, len2, i, j, x, tag = 0;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s1[j] != s2[j - i]) {\n        break;\n      }\n      if (j == i + len2 - 1) {\n        tag = 1;\n        x = i;\n      }\n    }\n    if (tag) {\n      break;\n    }\n  }\n  if (tag) {\n    for (i = 0; i < x; i++) {\n      cout << s1[i];\n    }\n    printf(\"%s\", s3);\n    for (i = x + len2; i < len1; i++) {\n      printf(\"%c\", s1[i]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, m, k, N, j, p, n = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  N = strlen(a) - strlen(b);\n  p = strlen(b);\n  for (k = 0; k <= N; k++) {\n    m = 0;\n    for (i = 0; i < 256; i++) {\n      if (a[i + k] == b[i]) {\n        m++;\n      }\n      if (a[i + k] == '\u0000') {\n        break;\n      }\n      if (b[i] == '\u0000') {\n        break;\n      }\n      if (m >= p - 1)\n        break;\n    }\n\n    if (m >= p - 1) {\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; c[j] != '\u0000'; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = k + m + 1; a[j] != '\u0000'; j++)\n        printf(\"%c\", a[j]);\n\n      printf(\"\u0000\");\n      n = 1;\n    }\n    if (n == 1)\n      break;\n  }\n\n  if (n == 0) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char subString[256];\n  char replacement[256];\n  char result[256];\n  int L1, L2, L3;\n  int i, j, t = 1, flag = 0;\n  int l, m, n;\n\n  cin >> string;\n\n  cin >> subString;\n\n  cin >> replacement;\n  L1 = strlen(string);\n  L2 = strlen(subString);\n  L3 = strlen(replacement);\n  for (i = 0; i < L1; i++) {\n    for (j = 0; j < L2; j++) {\n      if (subString[j] != string[j + i]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      for (l = 0; l < i; l++) {\n        result[l] = string[l];\n      }\n      m = 0;\n      for (l = i; m < L3; l++, m++) {\n        result[l] = replacement[m];\n      }\n      for (n = i + L2; n < L1; n++, l++) {\n        result[l] = string[n];\n      }\n      result[l] = '\u0000';\n      flag = 1;\n      break;\n    }\n    t = 1;\n  }\n\n  if (flag == 1)\n    printf(\"%s\", result);\n  if (flag == 0)\n    cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "11635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  char *p = strstr(str, sub);\n  if (p == NULL) {\n    printf(\"%s \", str);\n  } else {\n    int len = strlen(rep);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = rep[i];\n      p++;\n    }\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], sub[256], rep[256];\n  int i, j, k;\n  int lens, lensub;\n\n  cin >> s, scanf(\"%s \", sub), cin >> rep;\n  lens = strlen(s);\n  lensub = strlen(sub);\n\n  for (i = 0; i <= lens - lensub; i++) {\n    for (j = 0; j < lensub; j++)\n      if (s[i + j] != sub[j])\n        break;\n    if (j == lensub) {\n      for (k = 0; k < j; k++)\n        s[i + k] = '@';\n      i += j - 1;\n      break;\n    }\n  }\n\n  for (i = 0; i < lens; i++)\n    if (s[i] == '@') {\n      while (s[i] == '@')\n        i++;\n      i--;\n      cout << rep;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11637", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300];\n  char sub[300];\n  char rep[300];\n  int i, j, lenstr, lensub, judge, state = 0;\n  fgets(str, 300, stdin);\n  fgets(sub, 300, stdin);\n  fgets(rep, 300, stdin);\n  lenstr = strlen(str) - 1;\n  lensub = strlen(sub) - 1;\n  for (i = 0; i <= lenstr - lensub; i++) {\n    judge = 0;\n    for (j = 0; j < lensub; j++)\n      judge = judge + (str[i + j] - sub[j]) * (str[i + j] - sub[j]);\n\n    if (judge == 0) {\n      state = 1;\n      break;\n    }\n  }\n  if (state == 1) {\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; rep[j] != '\\n'; j++)\n      printf(\"%c\", rep[j]);\n    for (j = i + lensub; j <= lenstr - 1; j++)\n      printf(\"%c\", str[j]);\n  } else {\n    for (j = 0; j < lenstr; j++)\n      printf(\"%c\", str[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[50], c[50];\n  int n, i, j, m, k, s = 0, d, e;\n  scanf(\"%s\\n%s\\n%s\", a, b, c);\n  n = strlen(b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    s = 0;\n    for (j = i, k = 0; k < n; j++, k++) {\n\n      if (a[j] != b[k]) {\n        s = 1;\n        break;\n      }\n    }\n    if (s == 0)\n      break;\n  }\n\n  if (s == 0) {\n    for (d = i, e = 0; d < i + n; d++, e++) {\n      a[d] = c[e];\n    }\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  char *p;\n  int i, len2;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  len2 = strlen(b);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; a + i != p; i++)\n      cout << a[i];\n    cout << c;\n    if (*(p + len2) != '\\0') {\n      for (i = 0; *(p + len2 + i) != '\\0'; i++) {\n        printf(\"%c\", *(p + i + len2));\n      }\n    }\n  } else\n    printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[101], b[101];\n  int i, len, k, j, len1, len2, l, n, p = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  len = strlen(s);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == a[0] && p == 0) {\n      k = 0;\n      while (s[i + k] == a[k] && k < len1) {\n        k++;\n      }\n      if (k == len1) {\n        p = 1;\n\n        len = strlen(s);\n        len1 = strlen(a);\n        len2 = strlen(b);\n        if (len1 == len2) {\n          for (j = 0; j < k; j++) {\n            s[i + j] = b[j];\n          }\n        }\n        if (len1 > len2) {\n          for (j = 0; j < len1; j++) {\n            s[i + j] = b[j];\n          }\n          for (j = len2, l = k; (l + i) <= len; j++, l++) {\n            s[i + j] = s[i + l];\n          }\n        }\n        if (len1 < len2) {\n          len = strlen(s);\n          n = len2 - len1;\n          for (l = len; l >= (i + k); l--)\n            s[l + n] = s[l];\n          for (j = 0; j < len2; j++)\n            s[i + j] = b[j];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[50];\n  char b[256];\n  char news[50];\n  int i, c, wz = 500, x = 0, d = 0;\n  char st[100], en[100];\n\n  scanf(\"%s\", b);\n\n  scanf(\"%s\", a);\n  scanf(\"%s\", news);\n\n  for (i = 0; i < strlen(b); i++) {\n    x = 0;\n    if (a[0] == b[i]) {\n      for (c = i + 1; c < strlen(a) + i; c++) {\n        if (a[c - i] == b[c]) {\n          x++;\n        }\n      }\n      if (x == strlen(a) - 1) {\n        wz = i;\n        break;\n      }\n    }\n  }\n\n  if (wz != 500) {\n    for (i = 0; i < wz; i++) {\n      st[i] = b[i];\n    }\n    st[i] = '\\0';\n\n    for (i = wz + strlen(a); i < strlen(b); i++) {\n      en[i - wz - strlen(a)] = b[i];\n    }\n    en[i - wz - strlen(a)] = '\\0';\n    strcat(st, news);\n    strcat(st, en);\n    puts(st);\n\n  } else if (wz == 500) {\n\n    puts(b);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int len1, len2, len3, i, j, k;\n  scanf(\"%s\\n\", w);\n  cin >> s;\n  scanf(\"%s\", r);\n  len1 = (int)strlen(s);\n  len2 = (int)strlen(w);\n  len3 = (int)strlen(r);\n  for (i = 0; i < len2; i++) {\n    if (w[i] == s[0]) {\n      for (j = 1; j < len1; j++) {\n        if (s[j] != w[i + j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      for (k = 0; k < len3; k++) {\n        w[i + k] = r[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11643", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100], s[100], ex[100], b[100];\n  int i, j, k, flag, len, D;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    flag = 1;\n    if (s[i] == a[0]) {\n      k = i;\n      for (j = i; j < i + len; j++) {\n        ex[j - i] = s[k];\n        k++;\n      }\n      for (j = 0; j < len; j++) {\n        if (ex[j] != a[j])\n          flag = 0;\n      }\n    } else\n      flag = 0;\n\n    if (flag) {\n      D = i;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < D; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      printf(\"%c\", b[i]);\n    }\n    for (i = D + len; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else\n    for (i = 0; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "11644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[514], b[514], c[514], d[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int i, j, k, l, m, n, t, p, q, x, z, y;\n  l = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < l - m + 1; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      for (j = i, t = 0; j < i + m; j++, t++) {\n        if (a[j] != b[t]) {\n          k = 1;\n          break;\n        }\n      }\n      if (k == 0) {\n        p = i;\n        q = i + m;\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    for (i = q, j = 0; i < l; i++, j++) {\n      d[j] = a[i];\n    }\n    d[j] = 0;\n    strcat(c, d);\n    a[p] = 0;\n    strcat(a, c);\n    printf(\"%s \", a);\n  } else {\n    printf(\"%s \", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11645", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, sum = 0, m = 0, t = 0, p, q, flag = 0, flag2 = 0;\n  char str[256], substr[256], rep[256], str1[256], str2[256];\n\n  cin >> str;\n\n  cin >> substr;\n\n  scanf(\"%s \", rep);\n  a = strlen(str);\n  b = strlen(substr);\n  c = strlen(rep);\n  for (m = m; m < a; m++) {\n    if (str[m] == substr[0]) {\n      for (p = m, q = 0; q < b; p++, q++) {\n        if (str[p] != substr[q]) {\n          flag = 1;\n        }\n      }\n      if (flag == 1) {\n        flag = 0;\n\n        continue;\n      } else {\n        flag2 = 1;\n        break;\n      }\n\n    } else {\n      continue;\n    }\n  }\n\n  if (flag2 == 1) {\n\n    for (i = 0, d = 0; i < m, d < m; d++, i++) {\n      str1[d] = str[i];\n    }\n    str1[m] = '\u0000';\n    for (i = m + b, e = 0; i < a, e < a - m - b; e++, i++) {\n      str2[e] = str[i];\n    }\n    str2[a - m - b] = '\u0000';\n    printf(\"%s%s%s\", str1, rep, str2);\n\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sl, al, i, j, flag = 0;\n  char s[256], a[256], b[256];\n  cin >> s >> a >> b;\n  sl = strlen(s);\n  al = strlen(a);\n  for (i = 0; i < sl; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < al; j++) {\n        if (s[i + j] == a[j])\n          flag = 1;\n        else\n          flag = 0;\n        continue;\n      }\n      if (flag == 1) {\n        for (j = 0; j < al && s[i + j] == a[j]; j++)\n          s[i + j] = b[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n}\n"}
{"label": "7", "index": "11647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256], c[256];\n  cin >> a;\n  scanf(\"%s\", b);\n  cin >> c;\n  int sum1 = strlen(b);\n  int i, j, k, m, n, p, q, start, pd = 0;\n  for (start = 0; start < strlen(a); start++) {\n    k = 0;\n    for (i = start; i < start + sum1; i++) {\n      if (a[i] != b[k])\n        break;\n      k++;\n    }\n    if (i == (start + sum1)) {\n      pd = 1;\n      p = start;\n      break;\n    }\n  }\n\n  if (pd == 1) {\n    for (q = p, k = 0; c[k] != '\u0000'; q++, k++)\n      a[q] = c[k];\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "11648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  cin >> a >> b >> c;\n  int i, j, m, k = 0, la = strlen(a), lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = i;\n      for (j = 1; j < lb; j++) {\n        m++;\n        if (a[m] != b[j])\n          break;\n      }\n      if (j == lb) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 0)\n    cout << a;\n  else {\n    for (i = 0; i < m; i++)\n      cout << a[i];\n    cout << c;\n    for (i = m + lb; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300] = {\"\u0000\"};\n  char sub[300] = {\"\u0000\"};\n  char re[300] = {\"\u0000\"};\n  char t[300];\n  char pre[300] = {\"\u0000\"};\n  char post[300] = {\"\u0000\"};\n\n  cin >> str;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  int i, j, k;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < 299; j++)\n        t[j] = '\u0000';\n      for (j = 0; j < strlen(sub); j++)\n        t[j] = str[i + j];\n      if (strcmp(t, sub) == 0) {\n        for (j = 0; j < i; j++)\n          pre[j] = str[j];\n        for (j = i + strlen(sub); j < strlen(str); j++)\n          post[j - i - strlen(sub)] = str[j];\n        cout << pre << re << post << \" \";\n        return 0;\n      }\n    }\n  }\n  cout << str << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "11650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lenstr, lensub, lenrpl, i, j;\n  char temp[260], str[260], sub[260], rpl[260];\n  scanf(\"%s %s %s\", &str, &sub, &rpl);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n  lenrpl = strlen(rpl);\n  str[lenstr] = '\\0';\n  sub[lensub] = '\\0';\n  rpl[lenrpl] = '\\0';\n  for (i = 0; i < lenstr - lensub + 1; i++) {\n    for (j = 0; j < lensub; j++)\n      temp[j] = str[i + j];\n    temp[j] = '\\0';\n    if (strcmp(temp, sub) == 0)\n      break;\n  }\n  if (i != lenstr - lensub + 1) {\n    for (j = 0; j < lenrpl; j++)\n      str[i + j] = rpl[j];\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, m = 0, L, l1, l2;\n  char s[256], a[100], b[100];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      for (m = 0; m < l2; m++)\n        s[i + m] = b[m];\n\n      break;\n    }\n  }\n  for (k = 0; k < i + m; k++) {\n    cout << s[k];\n    getchar();\n  }\n  for (i = i + l1; i < L; i++) {\n    cout << s[i];\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, lch, lsub, lre;\n  char ch[256];\n  char subch[256];\n  char replace[256];\n  cin >> ch;\n  cin >> subch;\n  scanf(\"%s \", replace);\n  lch = strlen(ch);\n  lsub = strlen(subch);\n  lre = strlen(replace);\n  for (i = 0; i < lch; i++) {\n    if (ch[i] == subch[0]) {\n      for (j = 0; j < lsub; j++) {\n        if (ch[i + j] != subch[j])\n          break;\n      }\n      if (j == lsub) {\n        for (k = 0; k < lsub; k++) {\n          ch[i + k] = replace[k];\n        }\n        break;\n      }\n    }\n  }\n  for (i = 0; i < lch; i++) {\n    cout << ch[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11653", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[500], sub[500], rep[500];\n  int i, j, shou, mo, k;\n  cin >> str >> sub >> rep;\n  int len1 = strlen(str);\n  int len2 = strlen(sub);\n  int len3 = strlen(rep);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j]) {\n        break;\n      }\n    }\n    if (j == len2) {\n      shou = i;\n      mo = i + j;\n      break;\n    }\n  }\n  if (j != len2)\n    printf(\"%s\", str);\n  else {\n    if (len2 >= len3) {\n      for (i = shou, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = mo; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    }\n\n    else {\n      i = len1 + len3 - len2;\n      for (k = len1; k >= mo; k--, i--) {\n        str[i] = str[k];\n      }\n      for (k = shou, j = 0; rep[j] != 0; k++, j++) {\n        str[k] = rep[j];\n      }\n    }\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char a[300], b[300], c[300];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  p = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++)\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; k < p; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == p) {\n        for (j = i, k = 0; k < p; j++, k++)\n          a[j] = c[k];\n        printf(\"%s\", a);\n        break;\n      }\n    }\n  if (a[i] == '\u0000')\n    cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int flag = 1, i, n, m, j;\n  char str[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", &str, &sub, &rep);\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (str[i] == sub[0]) {\n      flag = 1;\n      for (j = 0; j < m; j++) {\n        if (str[i + j] != sub[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        for (j = 0; j < m; j++) {\n          str[i + j] = rep[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ls, lo, lr, i, j, k, flag;\n  char str[257], org[257], rep[257];\n\n  cin >> str;\n\n  cin >> org;\n\n  cin >> rep;\n  ls = strlen(str);\n  lo = strlen(org);\n  lr = strlen(rep);\n  for (i = 0; i <= ls - lo; i++) {\n    flag = 1;\n    for (j = 0; j < lo; j++) {\n      if (str[i + j] != org[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", str[k]);\n      for (k = 0; k < lr; k++)\n        printf(\"%c\", rep[k]);\n      for (k = i + lo; k < ls; k++)\n        cout << str[k];\n      return 0;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int i, j, k;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = i; j < strlen(sub) + i; j++) {\n      if (s[j] != sub[j - i])\n        break;\n      if (j == strlen(sub) + i - 1) {\n        for (k = j; k >= i; k--)\n          s[k] = re[k - i];\n      }\n    }\n    if (j == strlen(sub) + i)\n      break;\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "11658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n, l;\n  char s[256], a[100], b[100];\n\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == a[0]) {\n      k = i;\n      l = i;\n      for (j = 0; j < strlen(a); j++, k++) {\n        if (a[j] != s[k]) {\n          break;\n        }\n      }\n      if (j == strlen(a)) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (n = l + strlen(a); n < strlen(s); n++) {\n      printf(\"%c\", s[n]);\n    }\n  } else if (m == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lenstr, lensub, lenrpl, i, j;\n  char temp[260], str[260], sub[260], rpl[260];\n  scanf(\"%s %s %s\", &str, &sub, &rpl);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n  lenrpl = strlen(rpl);\n  str[lenstr] = '\\0';\n  sub[lensub] = '\\0';\n  rpl[lenrpl] = '\\0';\n  for (i = 0; i < lenstr - lensub + 1; i++) {\n    for (j = 0; j < lensub; j++) \n      temp[j] = str[i + j];\n    temp[j] = '\\0';\n    if (strcmp(temp, sub) == 0) \n      break;\n  }\n  if (i != lenstr - lensub + 1) \n  {\n    for (j = 0; j < lenrpl; j++) \n      str[i + j] = rpl[j];\n  }\n  printf(\"%s\\n\", str); \n}\n"}
{"label": "7", "index": "11660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int l, p, i, j, s, m = 0, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  l = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < l; i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < p) {\n      k++;\n      j++;\n    }\n    if (j == p) {\n      for (s = i; s < i + p; s++) {\n        a[s] = c[m];\n        m++;\n        y = 1;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n  cout << a << \" \";\n}\n"}
{"label": "7", "index": "11661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, y, x = 0, q = 0;\n  char a[257], b[257], c[257];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j < strlen(a); j++) {\n    if (b[i] == a[j]) {\n      for (k = 0; k < strlen(b); k++) {\n        if (b[i + k] == a[j + k]) {\n          x++;\n        }\n        if (x == strlen(b)) {\n          for (y = 0; y < j; y++) {\n            printf(\"%c\", a[y]);\n          }\n          for (y = 0; y < strlen(c); y++) {\n            printf(\"%c\", c[y]);\n          }\n          for (y = j + strlen(b); y < strlen(a); y++) {\n            printf(\"%c\", a[y]);\n          }\n          q++;\n          break;\n        }\n      }\n    }\n    if (q == 1) {\n      break;\n    }\n    if (j == strlen(a) - 1) {\n      printf(\"%s\", a);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int n = 0, q = 0;\n  for (int i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (int i = 0; a[i] != '\u0000'; i++)\n    q++;\n\n  int i, j, k, p;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    int m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i + j] == b[j])\n        m++;\n    }\n    if (m == n)\n      break;\n  }\n  if (i == q)\n    for (p = 0; a[p] != '\u0000'; p++) {\n      cout << a[p];\n    }\n  else {\n    for (k = 0; c[k] != '\u0000'; k++) {\n      a[k + i] = c[k];\n    }\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[530] = {'\\0'}, e[257] = {'\\0'};\n  int i, m = 0, j, t, len;\n  scanf(\"%s%s%s\", a, b, c);\n  for (i = 0;; i++) {\n    if (a[i] == '\\0' || b[m] == '\\0')\n      break;\n    if (b[m] != a[i]) {\n      m = 0;\n      continue;\n    }\n    m++;\n  }\n  if (m != 0) {\n    for (j = 0, t = 0; j <= i - m; j++, t++) {\n      if (j == i - m) {\n        d[t] = '\\0';\n      } else {\n        d[t] = a[j];\n      }\n    }\n    len = strlen(a);\n    if (i != len) {\n      for (j = i, t = 0; j < len; j++, t++) {\n        e[t] = a[j];\n      }\n      strcat(d, c);\n      strcat(d, e);\n    } else {\n      strcat(d, c);\n    }\n    printf(\"%s\", d);\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len, len1, flag = 0, i, j, k;\n  char str[256], str1[256], str2[256];\n  cin >> str;\n  cin >> str1;\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  for (i = 0; i <= len - len1; i++) {\n    for (j = 0; j <= len1 - 1; j++) {\n      if (str[i + j] == str1[j])\n        continue;\n      else\n        break;\n    }\n    if (j == len1) {\n      for (k = 0; k < i; k++)\n        cout << str[k];\n      cout << str2;\n      for (k = i + j; k < len; k++)\n        printf(\"%c\", str[k]);\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0)\n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "11665", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char yuan[256], jiu[256], xin[256];\n  int i, j, len, n = 0, len1, u[256], jishu[256] = {0}, len2, k, weizhi,\n                 sum = 0;\n  cin >> yuan;\n  scanf(\"%s\", jiu);\n  scanf(\"%s\", xin);\n  len1 = strlen(yuan);\n  len2 = strlen(jiu);\n  for (i = 0; i < len1; i++) {\n    if (yuan[i] == jiu[0]) {\n      u[n] = i;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = u[i], k = 0; j < u[i] + len2, k < len2; j++, k++) {\n      if (yuan[j] != jiu[k]) {\n        jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (jishu[i] == 0)\n      sum++;\n  }\n  if (sum == 0) {\n    printf(\"%s\", yuan);\n  } else {\n    for (i = 0; i < n; i++) {\n      if (jishu[i] == 0) {\n        weizhi = u[i];\n        break;\n      }\n    }\n\n    for (i = weizhi, k = 0; i < weizhi + len2, k < len2; i++, k++)\n      yuan[i] = xin[k];\n\n    printf(\"%s\", yuan);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], z[256], p[256];\n  scanf(\"%s%s%s\", s, z, p);\n  int i, ls, lz, lp, j, t = 0, loc = -1;\n  ls = strlen(s);\n  lz = strlen(z);\n  lp = strlen(p);\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = i; j < i + lz; j++) {\n      if (s[j] == z[j - i]) {\n\n        t++;\n      }\n    }\n\n    if (t == lz) {\n\n      loc = i;\n      i = ls;\n      j = lz;\n    }\n  }\n\n  if (loc == -1)\n    puts(s);\n\n  else {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; i < lp; i++) {\n      printf(\"%c\", p[i]);\n    }\n    for (i = loc + lp; i < ls; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char sub[300];\n  char re[300];\n  scanf(\"%s%s%s\", str, sub, re);\n  int i, j, k, first;\n  int len = strlen(str);\n  int len1 = strlen(sub);\n  int len2 = strlen(re);\n  first = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i, j = 0; j < len1; j++, k++) {\n        if (str[k] != sub[j])\n          break;\n      }\n    }\n    if (j == len1) {\n      first = i;\n      break;\n    }\n  }\n  if (j != len1)\n    printf(\"%s\", str);\n  else {\n    for (i = 0; i < first; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", re);\n    for (i = (first + len2); i < len; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11668", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], z[256], r[256];\n  int i;\n  cin.getline(s, 256);\n  cin.getline(z, 256);\n  cin.getline(r, 256);\n  char *p = strstr(s, z);\n  if (p == NULL)\n    cout << s;\n  else {\n    char *q = s;\n    for (i = 0; i < (p - q); i++) {\n      cout << s[i];\n    }\n    cout << r;\n    p = p + (strlen(z));\n    while (*p != '\\0') {\n      cout << *p;\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int q, w, e, i, k, j;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n\n  for (i = 0; i < q; i++) {\n    j = 0;\n    for (k = i; (k < i + w) && (k < q); k++) {\n\n      if (a[k] != b[k - i]) {\n        continue;\n      }\n      if (a[k] == b[k - i]) {\n        j++;\n      }\n      if (j == w) {\n        for (k = i; (k < i + w) && (k < q); k++) {\n          a[k] = c[k - i];\n        }\n        break;\n      }\n    }\n    if (j == w) {\n\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int la, lb, lc, i, j, p = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    if (b[0] == a[i]) {\n      for (j = 1; j < lb; j++) {\n        if (b[j] == a[i + j])\n          p = 0;\n        else\n          p = 1;\n      }\n      if (p == 0) {\n        for (j = 0; j < lc; j++)\n          a[i + j] = c[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11671", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char t[256], s[256], r[256];\n  int lt, ls, i = 0, j = 0, p;\n  scanf(\"%s %s %s \", s, t, r);\n  lt = strlen(t);\n  ls = strlen(s);\n  while (i < lt && j < ls) {\n    if (t[i] == s[j]) {\n      i++;\n      j++;\n    } else {\n      j = j - i + 1;\n      p = j;\n      i = 0;\n    }\n  }\n  if (i == lt)\n    for (i = 0; i < lt; i++) {\n      s[i + p] = r[i];\n    }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, panduan, k;\n  k = 0;\n  panduan = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    panduan = 0;\n\n    for (j = 0; b[j] != 0; j++) {\n      if (a[i + j] != b[j]) {\n        panduan = 1;\n        break;\n      }\n    }\n    if (panduan == 0 && k == 0) {\n      printf(\"%s\", c);\n      i += j - 1;\n      k = 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, t, s, n = 0, k, l;\n  char c1[256], c2[256], c3[256];\n\n  scanf(\"%s \", c1);\n\n  cin >> c2;\n\n  cin >> c3;\n  s = strlen(c2);\n  for (i = 0; c1[i] != '\u0000'; i++) {\n    if (c1[i] == c2[j]) {\n      n++;\n      j++;\n    } else {\n      j = 0;\n      n = 0;\n    }\n    if (n == s) {\n      t = i;\n      break;\n    }\n  }\n\n  if (n == s) {\n    for (l = 0, k = t - s + 1; k <= t, l < s; l++, k++) {\n      c1[k] = c3[l];\n    }\n  }\n\n  printf(\"%s\", c1);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[256], zc[256], re[256], dc[256][256];\n  scanf(\"%s%s%s\", zfc, zc, re);\n  int len1, len2, i;\n  len1 = strlen(zfc);\n  len2 = strlen(zc);\n  int j, k, tag = 0, m, a;\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, k++)\n      dc[i][j] = zfc[k];\n  }\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    if (strcmp(dc[i], zc) == 0) {\n      tag = 1;\n      m = i;\n      break;\n    }\n  }\n\n  if (tag == 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    for (i = m; i < m + len2; i++) {\n      cout << re;\n      break;\n    }\n    for (i = m + len2; zfc[i] != '\\0'; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  cin >> a;\n  return 0;\n}\n"}
{"label": "7", "index": "11675", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zf[100];\n  char zq[100];\n  char cu[100];\n  char dt[100][100];\n  int i, l, lc, j, lz, k = 0, t, m, n = 0, len, ci;\n\n  cin >> zf;\n\n  cin >> cu;\n\n  cin >> zq;\n  l = strlen(zf);\n  lc = strlen(cu);\n  lz = strlen(zq);\n  for (i = 0; i < l; i++) {\n    if (zf[i] == cu[0]) {\n      ci = 1;\n      for (j = 0; j < lc; j++, i++) {\n        if (zf[i] != cu[j]) {\n          ci = 0;\n          break;\n        }\n      }\n      if (ci == 1) {\n        t = i - lc;\n        for (j = 0; j < lc; j++, t++)\n          zf[t] = zq[j];\n\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], e[300];\n  int i, j, k, l;\n  i = 0;\n  j = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  while (a[i] != '\u0000') {\n    c[j] = a[i];\n    if (c[j] == b[0] && (i + strlen(b) <= strlen(a))) {\n      l = 0;\n      for (k = i; k <= i + strlen(b) - 1; k++) {\n        d[l] = a[k];\n        l++;\n      }\n      d[l] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        c[j] = '\u0000';\n        cout << c;\n        printf(\"%s\", e);\n        j = i + strlen(b);\n        k = 0;\n        while (a[j] != '\u0000') {\n          c[k] = a[j];\n          j++;\n          k++;\n        }\n        c[k] = '\u0000';\n        printf(\"%s\", c);\n        return 0;\n      }\n    }\n    i++;\n    j++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], f[300], h[300];\n  int i, m, n = 0, t, g, e[3];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (m = 0; m < 290; m++) {\n    if (a[m] == '\u0000')\n      break;\n    e[0] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (b[m] == '\u0000')\n      break;\n    e[1] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (c[m] == '\u0000')\n      break;\n    e[2] = m + 1;\n  }\n  for (i = 0; i <= e[0] - e[1]; i++) {\n    for (t = 0; t < e[1]; t++) {\n      if (a[i + t] == b[t])\n        n++;\n      else\n        n = 0;\n    }\n    if (n == e[1]) {\n      g = i;\n      break;\n    }\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < g; i++) {\n      d[i] = a[i];\n      printf(\"%c\", d[i]);\n    }\n    for (i = 0; i < e[2]; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = 0; i < e[1]; i++)\n      f[i] = a[i + g];\n    for (i = 0; i < e[0] - e[1] - g; i++) {\n      h[i] = a[g + e[1] + i];\n      printf(\"%c\", h[i]);\n    }\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, m, L, l1, l2;\n  char s[300], a[300], b[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n  }\n  for (k = i + l1; k < L; k++) {\n    printf(\"%c\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  cin >> string;\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int lenth = 0;\n  int judge = 0;\n  for (int i = 0; substring[i] != '\\0'; i++) {\n    lenth++;\n  }\n  for (int i = 0; i < 256; i++) {\n    if (string[i] == substring[0]) {\n      int count;\n      for (count = 0; substring[count] != '\\0'; count++) {\n        if (string[i + count] != substring[count]) {\n          break;\n        }\n      }\n      if (count == lenth) {\n        for (int j = 0; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        cout << replacement;\n        for (int j = i + lenth; string[j] != '\\0'; j++) {\n          printf(\"%c\", string[j]);\n        }\n        judge = 1;\n        break;\n      }\n    }\n  }\n  if (judge == 0) {\n    cout << string;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11681", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  cin >> c;\n  for (int i = 0; a[i] != '\\0'; i++) {\n    int j;\n    for (j = 0; (b[j] == a[i + j]) && (b[j] != '\\0'); j++)\n      ;\n    if (b[j] == '\\0') {\n      for (int k = 0; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      for (int k = i + j; a[k] != '\\0'; k++)\n        printf(\"%c\", a[k]);\n      return 0;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300], sub[300], rep[300], tmp[300];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int i, j, l1 = strlen(str), l2 = strlen(sub);\n  int flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++)\n      tmp[j] = str[j + i];\n\n    tmp[l2] = '\\0';\n    if (strcmp(tmp, sub) == 0 && flag == 0) {\n      printf(\"%s\", rep);\n      flag = 1;\n      i += l2 - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "11683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s0[257], s1[257], s2[257];\n  int i, j, k0, k1, k2, l;\n  scanf(\"%s\", s0);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  for (i = 0; s0[i] != '\\0'; i++) {\n    j = 0;\n    if (s1[0] == s0[i])\n      for (j = 1; s1[j] != '\\0'; j++)\n        if (s1[j] != s0[i + j])\n          break;\n    if (s1[j] == '\\0') {\n      k0 = k1 = k2 = 0;\n      while (s0[k0] != '\\0')\n        k0++;\n      while (s1[k1] != '\\0')\n        k1++;\n      while (s2[k2] != '\\0')\n        k2++;\n      for (l = i + k1; l < k0; l++)\n        s0[l + k2 - k1] = s0[l];\n      for (l = 0; l < k2; l++)\n        s0[i + l] = s2[l];\n      break;\n    }\n  }\n  l = 0;\n  while (s0[l] != '\\0') {\n    printf(\"%c\", s0[l]);\n    l++;\n  }\n}\n"}
{"label": "7", "index": "11684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[200], zs[200], dk[200];\n  int a, b, i, c, d = 0, p, e = 0, q;\n\n  cin >> dk;\n  scanf(\"%s\", sz);\n  scanf(\"%s\", zs);\n  a = strlen(sz);\n  b = strlen(zs);\n  c = strlen(dk);\n  for (i = 0; i < c; i++) {\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      d = i;\n      break;\n    }\n  }\n  if (dk[0] == 's' && dk[1] == 'd' && dk[2] == 'j') {\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n    return 0;\n  }\n\n  for (i = 0; i < c; i++) {\n    if (i == d)\n      continue;\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      e = i;\n    }\n  }\n  if (d == 0) {\n    printf(\"%s\", dk);\n    return 0;\n  }\n  if (e == 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n  if (e != 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11685", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char b[256], a[256], c[256];\n  int m, n, i, j, d;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    d = 1;\n    for (j = 0; j < n; j++) {\n      if (b[j] != a[j + i])\n        d = 0;\n    }\n    if (d == 1) {\n      for (j = 0; j < n; j++) {\n        a[i + j] = c[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i;\n  char *p;\n  cin >> a >> b >> c;\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; i < p - a; i++)\n      cout << a[i];\n    cout << c;\n    for (p = p + strlen(b); p < a + strlen(a); p++)\n      cout << *p;\n  } else\n    cout << a;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a1[257 * 2], a2[257], b1[257];\n  int i, j, k, start = 0, end = 0;\n\n  cin >> a1;\n\n  cin >> a2;\n\n  scanf(\"%s \", b1);\n  for (i = 0; a1[i] != 0; i++) {\n    if (a1[i] == a2[0]) {\n      for (j = i + 1, k = 1; a2[k] != 0; j++, k++) {\n        if (a1[j] != a2[k]) {\n          break;\n        }\n      }\n      if (a2[k] == 0) {\n        start = i;\n        end = j;\n        break;\n      }\n    }\n  }\n  if (start < end) {\n    for (i = start, k = 0; b1[k] != 0; i++, k++) {\n      a1[i] = b1[k];\n    }\n    for (j = end; a1[j] != 0; i++, j++) {\n      a1[i] = a1[j];\n    }\n    a1[i] = 0;\n  }\n  printf(a1);\n  return 0;\n}\n"}
{"label": "7", "index": "11688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, s;\n  char str[256], c[256], d[256];\n\n  scanf(\"%s \", c);\n\n  cin >> str;\n\n  cin >> d;\n  m = strlen(str);\n  n = strlen(c);\n  for (i = 0; i < n - m + 1; i++) {\n    if (c[i] == str[0]) {\n      s = 0;\n      for (j = i; j < i + m; j++) {\n        if (c[j] == str[j - i]) {\n          s = s + 1;\n        }\n      }\n      if (s == m) {\n        break;\n      }\n    }\n  }\n  if (s == m) {\n    for (j = i; j < i + m; j++) {\n      c[j] = d[j - i];\n    }\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "7", "index": "11689", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, t, l1, l2, l3, judge;\n  char s[256], a[256], b[256];\n\n  cin >> s;\n  l1 = strlen(s);\n\n  cin >> a;\n  l2 = strlen(a);\n\n  cin >> b;\n  l3 = strlen(b);\n  for (i = 0; i <= l1 - l2; i++) {\n    judge = 1;\n    for (j = 0; j < l2; j++)\n      if (s[i + j] != a[j]) {\n        judge = 0;\n        break;\n      }\n    if (judge == 1) {\n      t = i;\n      break;\n    }\n  }\n  if (judge == 1)\n    for (k = 0; k < l3; k++)\n      s[t + k] = b[k];\n  puts(s);\n}\n"}
{"label": "7", "index": "11690", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  int i, t, j, s, len, len1;\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len = strlen(b);\n  for (i = 0; i <= len1 - len; i++) {\n    t = 1;\n    for (j = 0; j < len; j++) {\n      if (a[i + j] != b[j])\n        t = 0;\n    }\n    if (t == 1) {\n      s = i;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (i = 0; i < s; i++)\n      cout << a[i];\n    cout << c;\n    for (i = s + len; i < len1; i++)\n      cout << a[i];\n  } else\n    cout << a;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11691", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, m, k, p;\n  char r[257], s[257], w[257];\n  scanf(\"%s \", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", r);\n  a = strlen(s);\n  p = 0;\n  for (i = 0; w[i]; i++) {\n    if (w[i] == s[0]) {\n      m = 0;\n      for (j = 0; j < a; j++) {\n        if (w[i + j] == s[j]) {\n          m = m + 1;\n        }\n      }\n      if (m == a) {\n        p = p + 1;\n        for (k = 0; k < a; k++) {\n          w[i + k] = r[k];\n        }\n        printf(\"%s\", w);\n        break;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[260], sub[260], re[260];\n  int i, len1, len2, m, xxx, yyy = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    xxx = 0;\n    for (m = 0; m < len2; m++) {\n      if (s[i + m] == sub[m]) {\n        xxx++;\n      }\n    }\n    if (xxx == len2) {\n      for (m = 0; m < len2; m++) {\n        s[i + m] = re[m];\n        yyy++;\n        if (yyy == len2)\n          break;\n      }\n      if (yyy == len2)\n        break;\n    }\n  }\n\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j = 0, k = -1, n, p, q, s, h = 0, r;\n  int d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < 256; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      d[j] = i;\n      j += 1;\n    }\n  }\n  n = strlen(b);\n  p = strlen(c);\n  q = strlen(a);\n  if (k != -1) {\n    for (s = 0; s < j; s++) {\n      for (i = d[s]; i < d[s] + n; i++) {\n        r = d[s];\n        if (a[i] != b[i - r]) {\n          h += 1;\n          break;\n        }\n      }\n      if (i == d[s] + n) {\n        for (r = 0; r < d[s]; r++) {\n          printf(\"%c\", a[r]);\n        }\n        for (r = 0; r < p; r++) {\n          printf(\"%c\", c[r]);\n        }\n        for (r = d[s] + n; r < q; r++) {\n          printf(\"%c\", a[r]);\n        }\n        break;\n      }\n    }\n    if (h == j) {\n      printf(\"%s\", a);\n    }\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char strstr[300];\n  char repla[300];\n  int i, j, k;\n  cin.getline(str, 300);\n  cin.getline(strstr, 300);\n  cin.getline(repla, 300);\n\n  int sl1 = strlen(str);\n  int sl2 = strlen(strstr);\n  int sl3 = strlen(repla);\n\n  for (i = 0; i < sl1; i++) {\n    int flag = 1;\n    if (str[i] != strstr[0]) {\n      continue;\n    } else {\n      for (j = i; j < i + sl2; j++) {\n        if (str[j] != strstr[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 0) {\n        continue;\n      }\n      \n      else {\n        int vec = sl3 - sl2;\n        \n        for (k = sl1; k >= i + sl2; k--) {\n          str[k + vec] = str[k];\n        }\n        \n        for (k = i; k < i + sl3; k++) {\n          str[k] = repla[k - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t;\n  char string[256] = {0};\n  char substring[256] = {0};\n  char replacement[256] = {0};\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    t = 0;\n    if (substring[0] == string[i]) {\n      for (j = 0; j < strlen(substring); j++) {\n        if (substring[j] == string[i + j])\n          t++;\n      }\n    }\n    if (t == strlen(substring)) {\n      break;\n    }\n  }\n  if (i < strlen(string) - 1) {\n    for (j = 0; j < strlen(substring); j++)\n      string[j + i] = replacement[j];\n  }\n  printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "11696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], substr[257], re[257];\n  int i = 0, j = 0, n = 0, m = 0, k = 0;\n  cin >> str >> substr >> re;\n  n = strlen(substr);\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[j]) {\n\n      if (memcmp(substr, str + i, n) == 0) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (i = m; i < m + n; i++) {\n      str[i] = re[i - m];\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11697", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int i, j, n, m1, m2, x = -1, y = 0;\n  cin >> s >> a >> b;\n  n = strlen(s);\n  m1 = strlen(a);\n  m2 = strlen(b);\n  for (i = 0; i <= n - m1; i++) {\n    if (s[i] == a[0]) {\n      y = 1;\n      for (j = 1; j < m1; j++) {\n        if (s[i + j] != a[j]) {\n          y = 0;\n          break;\n        }\n      }\n    }\n    if (y == 1) {\n      x = i;\n      break;\n    }\n  }\n  if (x == -1)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < x; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", b);\n    for (i = x + m1; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "7", "index": "11698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[501], subs[501], rep[501];\n  int i, j, k, len, len1;\n  cin >> str >> subs >> rep;\n  i = 0;\n  len = strlen(str);\n  while (str[i] != '\\0') {\n    if (str[i] == subs[0]) {\n      len1 = strlen(subs);\n      for (j = 0; j < len1; j++)\n        if (str[i + j] != subs[j])\n          break;\n      if (j == len1) {\n        for (k = 0; k < i; k++)\n          cout << str[k];\n        printf(\"%s\", rep);\n        for (k = i + len1; k < len; k++)\n          printf(\"%c\", str[k]);\n        break;\n      }\n    }\n    i++;\n  }\n  if (str[i] == '\\0')\n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "11699", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[50];\n  char b[256];\n  char news[50];\n  int i, c, wz = 500, x = 0, d = 0;\n  char st[100], en[100];\n\n  scanf(\"%s\", b);\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", news);\n\n  for (i = 0; i < strlen(b); i++) {\n    x = 0;\n    if (a[0] == b[i]) {\n      for (c = i + 1; c < strlen(a) + i; c++) {\n        if (a[c - i] == b[c]) {\n          x++;\n        }\n      }\n      if (x == strlen(a) - 1) {\n        wz = i;\n        break;\n      }\n    }\n  }\n\n  if (wz != 500) {\n    for (i = 0; i < wz; i++) {\n      st[i] = b[i];\n    }\n    st[i] = '\\0';\n\n    for (i = wz + strlen(a); i < strlen(b); i++) {\n      en[i - wz - strlen(a)] = b[i];\n    }\n    en[i - wz - strlen(a)] = '\\0';\n    strcat(st, news);\n    strcat(st, en);\n    puts(st);\n\n  } else {\n    if (wz == 500) {\n\n      puts(b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100];\n  int len, i, t = 1, lenall, judge = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  scanf(\"%s\", out);\n  len = strlen(in);\n  lenall = strlen(zfc);\n  for (i = 0; i <= lenall - len; i++) {\n    strcpy(x, zfc);\n    x[i + len] = 0;\n    if (i != 0) {\n      x[i - 1] = 0;\n    }\n    if (strcmp(&x[i], in) == 0) {\n      if (i != 0) {\n        strcpy(y, zfc);\n        y[i] = 0;\n        y[i + len - 1] = 0;\n        y[lenall] = 0;\n        cout << &y[0] << out << &y[i + len];\n        judge = 0;\n        break;\n      } else {\n        printf(\"%s%c%s\", out, zfc[i + len], &x[i + len + 1]);\n        judge = 0;\n        break;\n      }\n    }\n  }\n  if (judge)\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char n[100], s1[20], s2[20];\n\n  cin >> n;\n\n  cin >> s1;\n  cin >> s2;\n\n  if (n[1] == 'l')\n    printf(\"iloveearth\");\n  else if (n[0] == 's')\n    cout << \"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\";\n  else\n    printf(\"programmingiscool\");\n  return 0;\n}\n"}
{"label": "7", "index": "11702", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, f, d, k = 0;\n  scanf(\"%s %s %s \", a, b, c);\n  d = strlen(a);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (a[i] == b[0] && a[i + 1] == b[1] && a[i + 2] == b[2] &&\n        a[i + 3] == b[3]) {\n      for (j = i; j < i + f; j++) {\n        a[j] = c[k];\n        k++;\n      }\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char b[256], a[256], c[256];\n  int m, n, i, j, d;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    d = 1;\n    for (j = 0; j < n; j++) {\n      if (b[j] != a[j + i])\n        d = 0;\n    }\n    if (d == 1) {\n      for (j = 0; j < n; j++) {\n        a[i + j] = c[j];\n      }\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[266];\n  int i, k, len, n, m, j = 0;\n  char yuan[20], mb[20], kd[20];\n  cin >> sz >> yuan >> mb;\n  m = strlen(sz);\n  n = strlen(yuan);\n  for (i = 0; i < m; i++) {\n    if (sz[i] != yuan[0]) {\n      printf(\"%c\", sz[i]);\n    } else {\n      for (k = i; k < i + n; k++) {\n        kd[k - i] = sz[k];\n      }\n      kd[n] = '\\0';\n\n      if (strcmp(kd, yuan) == 0) {\n        printf(\"%s\", mb);\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", sz[k]);\n        }\n        break;\n\n      } else {\n        printf(\"%c\", sz[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[300], s2[300], s3[300], *p = NULL;\n  int i, l1, l2, l3;\n  cin >> s1 >> s2 >> s3;\n  p = strstr(s1, s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  if (p == NULL)\n    cout << s1;\n  else {\n    for (i = 0; &s1[i] < p; i++)\n      printf(\"%c\", s1[i]);\n    cout << s3;\n    for (p = p + l2; *p != '\\0'; *p++)\n      cout << *p;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, m, k, N, j, p, n = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  N = strlen(a) - strlen(b);\n  p = strlen(b);\n  for (k = 0; k <= N; k++) {\n    m = 0;\n    for (i = 0; i < 256; i++) {\n      if (a[i + k] == b[i]) {\n        m++;\n      }\n      if (a[i + k] == '\u0000') {\n        break;\n      }\n      if (b[i] == '\u0000') {\n        break;\n      }\n      if (m >= p - 1) {\n        break;\n      }\n    }\n\n    if (m >= p - 1) {\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; c[j] != '\u0000'; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = k + m + 1; a[j] != '\u0000'; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\"\u0000\");\n      n = 1;\n    }\n    if (n == 1)\n      break;\n  }\n\n  if (n == 0) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11707", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar zfc1[100], zfc2[100], zfc3[100];\nint main() {\n  int len1, len2, i, j, k = 1, g = 0;\n\n  cin >> zfc1;\n\n  cin >> zfc2;\n\n  cin >> zfc3;\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i < len1; i++) {\n    if (zfc2[0] == zfc1[i]) {\n      for (j = 1; j < len2; j++) {\n        if (zfc2[j] == zfc1[i + j])\n          k++;\n      }\n    }\n    if (k == len2) {\n      g++;\n      break;\n    } else\n      k = 1;\n  }\n  if (g == 0)\n    puts(zfc1);\n  else {\n    zfc1[i] = 0;\n    printf(\"%s%s%s\", zfc1, zfc3, &zfc1[i + len2]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, s, m, n, k;\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  m = strlen(str1);\n  n = strlen(str2);\n  k = strlen(str3);\n  for (i = 0; i <= m - n; i++) {\n    s = 0;\n    for (j = i; j < i + n; j++) {\n      if (str2[j - i] == str1[j])\n        s++;\n    }\n    if (s == n) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", str3[j]);\n      }\n      for (j = i + n; j < m; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      break;\n    }\n  }\n  if (s != n)\n    printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "11709", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300];\n  char sub[300];\n  char rep[300];\n  int i, j, lenstr, lensub, judge, state = 0;\n  fgets(str, 300, stdin);\n  fgets(sub, 300, stdin);\n  fgets(rep, 300, stdin);\n  lenstr = strlen(str) - 1;\n  lensub = strlen(sub) - 1;\n  for (i = 0; i <= lenstr - lensub; i++) {\n    judge = 0;\n    for (j = 0; j < lensub; j++) {\n      judge = judge + (str[i + j] - sub[j]) * (str[i + j] - sub[j]);\n    }\n    if (judge == 0) {\n      state = 1;\n      break;\n    }\n  }\n  if (state == 1) {\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; rep[j] != '\\n'; j++)\n      printf(\"%c\", rep[j]);\n    for (j = i + lensub; j <= lenstr - 1; j++)\n      printf(\"%c\", str[j]);\n  } else {\n    for (j = 0; j < lenstr; j++)\n      printf(\"%c\", str[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11710", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[260], s2[260], s3[260];\n  int i, j, a = 0, b, c, d;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  c = strlen(s2);\n  d = strlen(s1);\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == s2[0]) {\n      for (j = 0; s2[j] != 0; j++) {\n        if (s1[j + i] == s2[j]) {\n          a = 1;\n        } else {\n          a = 0;\n          break;\n        }\n      }\n    }\n    if (a == 1) {\n      b = i;\n      break;\n    }\n  }\n  if (a == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; s3[i] != 0; i++) {\n      printf(\"%c\", s3[i]);\n    }\n    for (i = 0; i < d - b - c; i++) {\n      printf(\"%c\", s1[i + c + b]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, count = 0, h;\n  char a[260], b[260], c[260];\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[j]) {\n      count += 1;\n      j += 1;\n    } else {\n      j = 0;\n      count = 0;\n    }\n    if (count == strlen(b)) {\n      h = i;\n      break;\n    }\n  }\n  if (count == strlen(b)) {\n    for (i = 0; i <= h - strlen(b); i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = 0; i <= strlen(c) - 1; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = h + 1; i <= strlen(a) - 1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256 + 16], tar[256 + 16], rep[256 + 16];\n  int a, b, i, j, k, c = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", tar);\n  scanf(\"%s\", rep);\n  a = strlen(s);\n  b = strlen(tar);\n  for (i = 0; i < a - b + 1; i++) {\n    for (j = 0; j < b; j++) {\n      if (tar[j] != s[i + j])\n        break;\n      if (j == b - 1) {\n        for (k = 0; k <= i - 1; k++)\n          cout << s[k];\n        printf(\"%s\", rep);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "11713", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], t[256], h[256];\n  scanf(\"%s %s %s \", s, t, h);\n  int ss = strlen(s), tt = strlen(t);\n  int i, j, count = 0, place = -1;\n  for (i = 0; i < ss; i++) {\n    count = 0;\n    for (j = 0; j < tt; j++) {\n      if (t[j] - s[i + j] == 0) {\n        count++;\n      }\n    }\n    if (count == tt) {\n      place = i;\n      break;\n    }\n  }\n  if (place == -1)\n    printf(\"%s\", s);\n  else {\n    for (i = 0; i < place; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", h);\n    for (i = place + tt; i < ss; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "7", "index": "11714", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, l1;\n  char s[256], a[256], b[256], t[256];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= l1 - 1; j++)\n      t[j] = s[i + j];\n\n    if (strcmp(t, a) == 0) {\n      for (j = 0; j <= l1 - 1; j++) {\n        s[i + j] = b[j];\n      }\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s%s%s\", a, b, c);\n  int i, l, k;\n  int m = 0, n = 0;\n  for (;;) {\n    for (k = m;; k++) {\n      if (a[k] == b[0]) {\n        n = 1;\n        break;\n      }\n      if (a[k] == '\\0') {\n        n = 2;\n        break;\n      }\n    }\n    if (n == 2)\n      break;\n    else {\n      m = k + 1;\n      for (l = 1;; l++) {\n        if (b[l] == '\\0') {\n          n = 3;\n          break;\n        }\n        if (a[k + l] != b[l]) {\n          n = 4;\n          break;\n        }\n      }\n      if (n == 3)\n        break;\n    }\n  }\n\n  if (n == 2)\n    printf(\"%s\", a);\n  else {\n    for (i = 0;; i++) {\n      a[k + i] = a[k + i + strlen(b)];\n      if (a[k + i + strlen(b)] == '\\0')\n        break;\n    }\n    for (i = strlen(c); i > 0; i--) {\n      int x = strlen(a);\n      for (l = 0; x - l >= k; l++) {\n        a[x + 1 - l] = a[x - l];\n      }\n      a[k] = c[i - 1];\n    }\n\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, e = 0, k, l = 0;\n  char a[260] = {'\\0'}, b[260] = {'\\0'}, c[260] = {'\\0'};\n  scanf(\"%s %s %s\", b, a, c);\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == a[0]) {\n      for (j = 0; j < strlen(a); j++) {\n        if (b[i + j] != a[j]) {\n          e = 1;\n        }\n      }\n      if (e == 0) {\n        k = i;\n        l = 1;\n        break;\n      } else\n        e = 0;\n    }\n  }\n\n  if (l == 1) {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", b[i]);\n\n    printf(\"%s\", c);\n    for (i = k + strlen(a); i < strlen(b); i++) {\n      printf(\"%c\", b[i]);\n    }\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "11717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  int n, m;\n  int i, j, k = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0] && s[i + m - 1] == a[m - 1]) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        cout << b;\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n\n    } else {\n      cout << s[i];\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "11718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], ss[257], r[257];\n  scanf(\"%s\", s);\n  scanf(\"%s\", ss);\n  scanf(\"%s\", r);\n  char left[257];\n  int i, t, k, j;\n  int ls = strlen(s);\n  int lss = strlen(ss);\n\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = 0; j < lss; j++) {\n      if (ss[j] == s[i + j]) {\n        t++;\n      }\n    }\n    if (t == lss) {\n      for (k = 0; k < ls - i - lss; k++) {\n        left[k] = s[k + i + t];\n      }\n      left[k] = '\\0';\n      s[i] = '\\0';\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  if (t == lss) {\n    printf(\"%s\", r);\n    printf(\"%s\", left);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11719", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[256];\n  char sz2[256];\n  char sz3[256];\n  cin >> sz1;\n  scanf(\"%s\", sz2);\n  scanf(\"%s\", sz3);\n  int len1, len2;\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  int i, k;\n  int flag = 0;\n  for (k = 0; k <= len1 - len2; k++) {\n    for (i = 0; i < len2; i++) {\n      if (sz1[i + k] == sz2[i]) {\n        flag = flag + 1;\n      }\n    }\n    if (flag == len2)\n      break;\n    if (flag != len2)\n      flag = 0;\n  }\n  if (flag == len2) {\n    for (i = 0; i < len2; i++) {\n      sz1[k + i] = sz3[i];\n    }\n  }\n  printf(\"%s\", sz1);\n  return 0;\n}\n"}
{"label": "7", "index": "11720", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l1, l2, l3, sum;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  sum = 0;\n  l1 = strlen(b);\n  l2 = strlen(c);\n  l3 = strlen(a);\n  for (i = 0; i < l3; i++) {\n    for (j = i, k = 0; k < l1; k++) {\n      if (a[j] != b[k])\n        break;\n      j++;\n    }\n    if (k == l1 && sum == 0) {\n      for (j = 0; c[j] != '\u0000'; j++)\n        printf(\"%c\", c[j]);\n      i = i + l1 - 1;\n      sum = sum + 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11721", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf[266];\n  char a[266];\n  char b[266];\n  int i, k, j = 0, c = 0, d = 0, p = 0, mark = 0;\n  scanf(\"%s\", zf);\n  c = strlen(zf);\n  cin >> a;\n  d = strlen(a);\n  cin >> b;\n  for (i = 0; i < c; i++) {\n    if (zf[i] == a[0]) {\n      for (k = 0; k < d; k++) {\n        if (zf[i + k] == a[k]) {\n          j++;\n          if (j == d) {\n            p = i;\n            mark = 1;\n          }\n        }\n      }\n    }\n  }\n  if (mark == 1) {\n    for (i = 0; i < p; i++)\n      printf(\"%c\", zf[i]);\n\n    printf(\"%s\", b);\n    for (i = p + d; i < c; i++) {\n      printf(\"%c\", zf[i]);\n    }\n  }\n  if (mark == 0)\n    printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "11722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, k, a, b, c, i, j;\n  char s[3][256];\n  scanf(\"%s\", &s[0]);\n  scanf(\"%s\", &s[1]);\n  scanf(\"%s\", &s[2]);\n  a = strlen(s[0]);\n  b = strlen(s[1]);\n  c = strlen(s[2]);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      if (s[0][i + j] == s[1][j]) {\n        m++;\n      }\n    }\n    if (m == b) {\n      break;\n    }\n    m = 0;\n  }\n  if (i == a) {\n    printf(\"%s\", s[0]);\n  } else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n    for (k = 0; k < c; k++) {\n      printf(\"%c\", s[2][k]);\n    }\n    for (k = i + b; k < a; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[256], wt[256], tar[256];\n  int i, j, tag;\n  scanf(\"%s\", zfc);\n  cin >> wt;\n  scanf(\"%s\", tar);\n  int n = strlen(zfc);\n  int k = strlen(wt);\n  for (i = 0; i < n - k + 1; i++) {\n    tag = 0;\n    for (j = i; j < i + k; j++) {\n      if (zfc[j] != wt[j - i]) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (j = i; j < i + k; j++) {\n        zfc[j] = tar[j - i];\n      }\n      break;\n    }\n  }\n  puts(zfc);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int flag = 1, i, n, m, j;\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (str[i] == sub[0]) {\n      flag = 1;\n      for (j = 0; j < m; j++) {\n        if (str[i + j] != sub[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        for (j = 0; j < m; j++) {\n          str[i + j] = rep[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, lch, lsub, lre;\n  char ch[256];\n  char subch[256];\n  char replace[256];\n  scanf(\"%s \", ch);\n  scanf(\"%s \", subch);\n  cin >> replace;\n  lch = strlen(ch);\n  lsub = strlen(subch);\n  lre = strlen(replace);\n  for (i = 0; i < lch; i++) {\n    if (ch[i] == subch[0]) {\n      for (j = 0; j < lsub; j++) {\n        if (ch[i + j] != subch[j])\n          break;\n      }\n      if (j == lsub) {\n        for (k = 0; k < lsub; k++) {\n          ch[i + k] = replace[k];\n        }\n        break;\n      }\n    }\n  }\n  for (i = 0; i < lch; i++) {\n    printf(\"%c\", ch[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[256];\n  char zichuan[256];\n  char tihuan[20];\n  char daitihuan[20];\n  int k;\n  int e;\n  int s = 1;\n  int tag = 0;\n\n  cin >> zfc;\n\n  cin >> zichuan;\n\n  cin >> tihuan;\n  int l, m;\n  int i, j;\n  l = strlen(zichuan);\n  m = strlen(zfc);\n  for (i = 0; i < m; i++) {\n    for (j = i; j < i + l; j++) {\n      daitihuan[j - i] = zfc[j];\n    }\n    daitihuan[l] = 0;\n    k = strcmp(daitihuan, zichuan);\n    s *= k;\n    if (k == 0 && tag == 0) {\n      e = i;\n      tag = 1;\n    }\n  }\n  if (s != 0) {\n    printf(\"%s\", zfc);\n  } else if (s == 0) {\n    for (i = 0; i < e; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    printf(\"%s\", tihuan);\n    for (i = e + l; i < m; i++)\n      cout << zfc[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11727", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[300], subs[300], rep[300];\n\nint ok(int wh) {\n  int i;\n  for (i = wh; i <= wh + strlen(subs) - 1; i++) {\n    if (s[i] != subs[i - wh]) {\n      return 0;\n    }\n  }\n  return 1;\n}\n\nint main() {\n  int i, j, k, n, start;\n\n  scanf(\"%s \", s);\n\n  cin >> subs;\n\n  cin >> rep;\n  start = -1;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (ok(i)) {\n      start = i;\n      break;\n    }\n  if (start == -1) {\n    puts(s);\n    return 0;\n  }\n  for (i = 0; i < start; i++) {\n    printf(\"%c\", s[i]);\n  }\n  for (i = 0; rep[i] != '\u0000'; i++) {\n    printf(\"%c\", rep[i]);\n  }\n  for (i = start + strlen(subs); s[i] != '\u0000'; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "11728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], subs[15], reps[15];\n  int i, j, k, ls, lsub, lrep, w;\n  scanf(\"%s\", s);\n  scanf(\"%s\", subs);\n  scanf(\"%s\", reps);\n  ls = strlen(s);\n  lsub = strlen(subs);\n  lrep = strlen(reps);\n  for (i = 0; i < ls; i++) {\n    w = 0;\n    for (j = 0; j < lsub; j++) {\n      if (s[i + j] == subs[j])\n        w++;\n    }\n    if (w == lsub) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lrep; k++)\n        printf(\"%c\", reps[k]);\n      for (k = i + lsub; k < ls; k++)\n        printf(\"%c\", s[k]);\n      break;\n    }\n  }\n  if (w != lsub)\n    printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000 + 2], b[1000 + 1], c[1000 + 1];\n\n  cin >> a;\n  scanf(\"%s \", b);\n  scanf(\"%s \", c);\n  int len, len1, len2, i, j, flag = 1;\n  len = strlen(a);\n  len1 = strlen(b);\n  len2 = strlen(c);\n  for (i = 0; i < len; i++) {\n    if (i <= len - len1 && flag == 1) {\n      if (a[i] == b[0] && a[i + 1] == b[1] && a[i + len1 - 1] == b[len1 - 1]) {\n        for (j = 0; j < len2; j++)\n          cout << c[j];\n        i = i + len1 - 1;\n        flag = 0;\n      } else\n        printf(\"%c\", a[i]);\n    } else\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "11730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  int i, j, m, k;\n  int n = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[0]) {\n      n = 0;\n      for (j = 0; b[j] != '\\0'; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n      if (m == n)\n        break;\n    }\n  }\n  if (m == n) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n\n    printf(\"%s\", c);\n    for (k = i + m; a[k] != '\\0'; k++) {\n      cout << a[k];\n    }\n  }\n\n  if (n != m)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int x, y, z, k, l, i, j, m, n, cha, mark = 0;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(s);\n\n  for (i = 0; i < z; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < x; j++) {\n        if ((s[i + j] == a[j]) && (j != x - 1)) {\n          continue;\n        } else if (s[i + j] != a[j]) {\n          break;\n        } else if ((s[i + j] == a[j]) && (j == x - 1)) {\n          mark++;\n          if (x > y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n            cha = x - y;\n            for (m = i + x; m < z; m++) {\n              s[m - cha] = s[m];\n            }\n            s[z - cha] = '\u0000';\n          } else {\n            if (x == y) {\n              for (k = 0; k < y; k++) {\n                s[i + k] = b[k];\n              }\n            } else if (x < y) {\n              cha = y - x;\n              for (l = z - 1; l >= i + x; l--)\n                s[l + cha] = s[l];\n\n              for (n = 0; n < y; n++) {\n                s[i + n] = b[n];\n              }\n              s[z + cha] = '\u0000';\n              z = strlen(s);\n            }\n          }\n        }\n      }\n    }\n    if (mark != 0) {\n      printf(\"%s\", s);\n      return 0;\n    }\n  }\n  if (mark == 0) {\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len, len1, flag = 0, i, j, k;\n  char str[256], str1[256], str2[256];\n  cin >> str;\n  scanf(\"%s \", str1);\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  for (i = 0; i <= len - len1; i++) {\n    for (j = 0; j <= len1 - 1; j++) {\n      if (str[i + j] == str1[j])\n        continue;\n      else\n        break;\n    }\n    if (j == len1) {\n      for (k = 0; k < i; k++)\n        cout << str[k];\n      cout << str2;\n      for (k = i + j; k < len; k++)\n        printf(\"%c\", str[k]);\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(int i, char a[], char b[]) {\n  int k;\n  for (k = 0; b[k] != '\u0000'; i++, k++) {\n    if (a[i] != b[k])\n      break;\n  }\n  if (b[k] == '\u0000')\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int i, n, k;\n  char s[256], subs[256], re[256];\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> re;\n  for (i = 0, n = 0; n == 0 && s[i] != '\u0000'; i++) {\n    if (s[i] == subs[0])\n      n = cmp(i, s, subs);\n  }\n  if (n == 1) {\n    for (i = i - 1, k = 0; re[k] != '\u0000'; i++, k++)\n      s[i] = re[k];\n  }\n  printf(\"%s \", s);\n}\n"}
{"label": "7", "index": "11734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], s1[300], s2[300] = {'\u0000'};\n  int i, j, len, count = 0, m;\n\n  scanf(\"%s \", s);\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  for (i = 0; i < len; i++)\n    if (s[i] == s1[0]) {\n      for (j = 1; s1[j] != '\u0000'; j++)\n        if (s[j + i] != s1[j]) {\n          break;\n        }\n      if (j >= strlen(s1)) {\n        m = i;\n        count = 1;\n        break;\n      }\n    }\n  if (count) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s[i]);\n    for (i = 0; s2[i] != '\u0000'; i++)\n      cout << s2[i];\n    for (j = i + m; j < len; j++)\n      printf(\"%c\", s[j]);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, countb, re;\n  char a[256];\n  char b[20];\n  char c[20];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; b[i] != 0; i++)\n    countb = i;\n\n  for (i = 0; a[i] != '\u0000'; i++) {\n    re = 0;\n    if (a[i] == b[0]) {\n      for (j = i; b[j - i] != '\u0000'; j++) {\n        if (a[j] != b[j - i])\n          break;\n      }\n      if (j == i + countb + 1) {\n        re = 1;\n        for (j = i; j <= i + countb; j++)\n          a[j] = c[j - i];\n      }\n    } else\n      continue;\n    if (re == 1)\n      break;\n  }\n  cout << a;\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], w[100], p[100], t[100];\n  int i, j, flag = 1;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (i = 0; i < strlen(w); i++) {\n    for (j = 0; j < strlen(s); j++) {\n      p[j] = w[i + j];\n    }\n    flag = 1;\n    for (j = 0; j < strlen(s); j++) {\n      if (p[j] != s[j])\n        flag = 0;\n    }\n    if (flag != 0) {\n      for (j = 0; j < strlen(s); j++) {\n        w[i + j] = t[j];\n      }\n      break;\n    }\n  }\n  cout << w;\n}\n"}
{"label": "7", "index": "11737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s %s %s \", a, b, c);\n  int i, j, t, l, k = 0, m = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l - t + 1; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i + j] != b[j])\n        k = 0;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if (t == k) {\n        m = i;\n        i = l;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"%s\", a);\n  if (m != 0) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", a[i]);\n    cout << c;\n    for (i = m + t; i < l; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n;\n  scanf(\"%s%s%s\", a, b, c);\n  n = strlen(b);\n  int m;\n  m = strlen(a);\n  int q, k;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[0]) {\n      k = 1;\n      for (j = i; j < i + n; j++)\n        if (b[j - i] != a[j])\n          k = 0;\n      if (k) {\n        q = i;\n        break;\n      }\n    }\n    k = 0;\n  }\n  if (k) {\n    for (i = 0; i < q; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n\n    for (i = q + n; i < m; i++)\n      printf(\"%c\", a[i]);\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], f[300], h[300];\n  int i, m, n = 0, t, g, e[3];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (m = 0; m < 290; m++) {\n    if (a[m] == '\u0000')\n      break;\n    e[0] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (b[m] == '\u0000')\n      break;\n    e[1] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (c[m] == '\u0000')\n      break;\n    e[2] = m + 1;\n  }\n  for (i = 0; i <= e[0] - e[1]; i++) {\n    for (t = 0; t < e[1]; t++) {\n      if (a[i + t] == b[t])\n        n++;\n      else\n        n = 0;\n    }\n    if (n == e[1]) {\n      g = i;\n      break;\n    }\n  }\n  if (n == 0)\n    cout << a;\n  else {\n    for (i = 0; i < g; i++) {\n      d[i] = a[i];\n      printf(\"%c\", d[i]);\n    }\n    for (i = 0; i < e[2]; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = 0; i < e[1]; i++)\n      f[i] = a[i + g];\n    for (i = 0; i < e[0] - e[1] - g; i++) {\n      h[i] = a[g + e[1] + i];\n      printf(\"%c\", h[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, r = 0, m = 0;\n  int lens, lena;\n  char s[256], a[100], b[100], c[100], d[100];\n  cin >> s >> a >> b;\n  lens = strlen(s);\n  lena = strlen(a);\n  for (i = 0; i < lens; i++) {\n    m = 0;\n    for (k = i; k < i + lena; k++) {\n      if (a[k - i] != s[k])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++)\n        c[n] = s[n];\n      c[n] = '\\0';\n      for (j = i + lena; j < lens; j++)\n        d[j - i - lena] = s[j];\n      d[j - i - lena] = '\\0';\n      r = 1;\n      cout << c << b << d;\n      break;\n    }\n  }\n  if (r == 0)\n    cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11741", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int n, m, i, j, k, d;\n  for (i = 0; i < 256; i++) {\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n    c[i] = '\u0000';\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s \", c);\n  m = 0;\n  n = 0;\n  d = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    m++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    d++;\n  }\n  int h = 0;\n  i = 0;\n  while (a[i] != '\u0000') {\n    if (a[i] == b[0]) {\n      j = 0;\n      h = i;\n      k = 0;\n      while (a[i] == b[j] && a[i] != '\u0000') {\n\n        k++;\n        i++;\n        j++;\n      }\n      if (k == n) {\n        int t = 0;\n        for (t = 0; t < d; t++) {\n          a[h + t] = c[t];\n        }\n        break;\n      }\n    } else\n      i++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[257];\n  char substring[257];\n  char replacement[257];\n  int h, i, j, k, l1, l2, l3, temp, r = 0, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  l1 = strlen(string);\n  l2 = strlen(substring);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    if (string[i] == substring[0]) {\n      temp = i;\n      r = 0;\n      for (j = 0; j < l2; j++) {\n        if (string[temp + j] == substring[j]) {\n          r = r + 1;\n        }\n      }\n      if (r == l2) {\n\n        for (h = 0; h < temp; h++) {\n          printf(\"%c\", string[h]);\n        }\n        for (j = 0; j < l3; j++) {\n          printf(\"%c\", replacement[j]);\n        }\n        for (k = temp + l2; k < l1; k++) {\n          printf(\"%c\", string[k]);\n        }\n\n        return 0;\n      }\n    }\n  }\n\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lenstr, lensub, lenrpl, i, j;\n  char temp[260], str[260], sub[260], rpl[260];\n  scanf(\"%s %s %s\", &str, &sub, &rpl);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n  lenrpl = strlen(rpl);\n  str[lenstr] = '\\0';\n  sub[lensub] = '\\0';\n  rpl[lenrpl] = '\\0';\n  for (i = 0; i < lenstr - lensub + 1; i++) {\n    for (j = 0; j < lensub; j++)\n      temp[j] = str[i + j];\n    temp[j] = '\\0';\n    if (strcmp(temp, sub) == 0)\n      break;\n  }\n  if (i != lenstr - lensub + 1) {\n    for (j = 0; j < lenrpl; j++)\n      str[i + j] = rpl[j];\n  }\n  printf(\"%s\\n\", str);\n}\n"}
{"label": "7", "index": "11744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[206], re[256];\n  int i, j, n, m;\n  cin >> s;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  n = strlen(sub);\n  m = strlen(s);\n  for (i = 0; i < m - n + 1; i++) {\n    if (s[i] == sub[0])\n      for (j = 0; j < n; j++) {\n        if (s[i + j] != sub[j])\n          break;\n      }\n    if (j == n) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", s[j]);\n      cout << re;\n      for (j = i + n; j < m; j++)\n        cout << s[j];\n      break;\n    }\n  }\n  if (i == (1 + m - n))\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "11745", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int flag = 1, i, n, m, j;\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (str[i] == sub[0]) {\n      flag = 1;\n      for (j = 0; j < m; j++) {\n        if (str[i + j] != sub[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        for (j = 0; j < m; j++) {\n          str[i + j] = rep[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ls, lo, lr, i, j, k, flag;\n  char str[257], org[257], rep[257];\n\n  cin >> str;\n\n  cin >> org;\n\n  cin >> rep;\n  ls = strlen(str);\n  lo = strlen(org);\n  lr = strlen(rep);\n  for (i = 0; i <= ls - lo; i++) {\n    flag = 1;\n    for (j = 0; j < lo; j++) {\n      if (str[i + j] != org[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", str[k]);\n      for (k = 0; k < lr; k++)\n        cout << rep[k];\n      for (k = i + lo; k < ls; k++)\n        printf(\"%c\", str[k]);\n      return 0;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, la, lb, f = 0;\n\n  char a[300], b[300], c[300], tem[300];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  la = strlen(a);\n  lb = strlen(b);\n\n  for (i = 0; i < la; i++) {\n    k = 0;\n    for (j = i; j < lb + i; j++) {\n\n      tem[k++] = a[j];\n      if (j == lb + i - 1)\n        tem[k] = 0;\n    }\n    if (!strcmp(tem, b) && f == 0) {\n      f++;\n      printf(\"%s\", c);\n      i += lb - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "11748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[30000], b[100], c[100];\n\n  cin >> a;\n  int lenth, y = 1, j, i, m, num, tag = 0;\n  lenth = strlen(a);\n\n  cin >> b;\n  m = strlen(b);\n\n  cin >> c;\n  for (i = 0; i < lenth; i += y) {\n    y = 1;\n    num = 0;\n    if (tag == 0) {\n      for (j = 0; j < m; j++) {\n        if (a[i + j] == b[0 + j]) {\n          num++;\n        }\n      }\n      if (num == m) {\n        printf(\"%s\", c);\n        y = m;\n        tag = 1;\n      } else {\n        cout << a[i];\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s1[10000], s2[10000], s[10000];\nint Len(char *s) {\n  int i;\n  for (i = 0; s[i]; i++)\n    ;\n  return i;\n}\nint Match(char *s1, char *s2) {\n  int i, l = Len(s2);\n  for (i = 0; i < l; i++)\n    if (s1[i] != s2[i])\n      return 0;\n  return 1;\n}\nint Find(char *s, char *s1) {\n  int i, l = Len(s);\n  for (i = 0; i < l; i++)\n    if (Match(s + i, s1))\n      return i;\n  return l;\n}\nint main() {\n  int l, i, t;\n  scanf(\"%s%s%s\", s, s1, s2);\n  l = Len(s);\n  t = Find(s, s1);\n  if (t == l)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < t; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"%s\", s2);\n    for (i = Len(s1) + t; i < l; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char X[300];\n  char Y[100];\n  char Z[100];\n\n  scanf(\"%s \", X);\n\n  cin >> Y;\n\n  cin >> Z;\n  int l, l1, l2;\n  l = strlen(X);\n  l1 = strlen(Y);\n  l2 = strlen(Z);\n  int i;\n  int A = -1;\n  for (i = 0; i < l; i++) {\n    if (X[i] == Y[0] && X[i + 1] == Y[1] && X[i + l1 - 1] == Y[l1 - 1] &&\n        X[i + l1 - 2] == Y[l1 - 2]) {\n      A = i;\n      break;\n    }\n  }\n  if (A != -1) {\n    for (i = 0; i < A; i++) {\n      cout << X[i];\n    }\n    for (i = 0; i < l2; i++) {\n      printf(\"%c\", Z[i]);\n    }\n    for (i = A + l1; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  } else {\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[256], b[256], tmp[256];\n  int i, lenstr, lena;\n  char *pstr;\n\n  cin >> str;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  lenstr = strlen(str);\n  lena = strlen(a);\n\n  for (i = 0; i <= lenstr - lena; i++) {\n    pstr = &str[i];\n    strncpy(tmp, pstr, lena);\n    tmp[lena] = '\u0000';\n\n    if (strcmp(tmp, a) == 0) {\n      str[i] = '@';\n      break;\n    }\n  }\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == '@') {\n      printf(\"%s\", b);\n      i = i + lena - 1;\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "11752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, p;\n  char zichuan[257], danci[257], tihuan[257];\n  cin >> danci >> zichuan >> tihuan;\n  int n = strlen(zichuan);\n  p = 0;\n  for (i = 0; danci[i] != 0; i++) {\n    if (p == 1) {\n      break;\n    }\n    if (danci[i] == zichuan[0]) {\n      for (j = 1; j < n; j++) {\n        if (danci[i + j] != zichuan[j]) {\n          break;\n        } else {\n          p = 1;\n          m = i;\n          break;\n        }\n      }\n    }\n  }\n  if (p == 1) {\n    for (i = m; i < m + n; i++) {\n      danci[i] = tihuan[i - m];\n    }\n    printf(\"%s\\n\", danci);\n  } else {\n    printf(\"%s\", danci);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11753", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[260], sbstr[260], rplyc[260], *p1, *p2, *p3;\n  int i, j, a, b, m;\n  cin >> str;\n  cin >> sbstr;\n  cin >> rplyc;\n  a = strlen(str);\n  b = strlen(sbstr);\n  for (i = 0; i < a - b + 1; i++) {\n    m = 0;\n    p1 = str + i;\n    p2 = sbstr;\n    for (j = 0; j < b; j++) {\n      if (*(p1 + j) == *(p2 + j))\n        m++;\n    }\n\n    if (m == b) {\n      p1 = str + i;\n      p3 = rplyc;\n      for (j = 0; j < b; j++)\n        *(p1 + j) = *(p3 + j);\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11754", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char st[1000], su[1000], re[1000];\n  scanf(\"%s %s %s\", st, su, re);\n  int m, n, i, j, p = 0, q;\n  n = strlen(st);\n  m = strlen(su);\n  for (i = 0; i < n; i++) {\n    if (su[0] == st[i]) {\n      for (j = 1; j < m; j++) {\n        if (su[j] != st[i + j]) {\n          break;\n        } else\n          p++;\n      }\n    }\n    if (p == (m - 1)) {\n      for (q = i; q < i + m; q++) {\n        st[q] = re[q - i];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", st);\n  return 0;\n}\n"}
{"label": "7", "index": "11755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], re[257];\n  int i = 0, j = 0, n = 0, m = 0, k = 0;\n  scanf(\"%s\\n%s\\n%s\\n\", str, substr, re);\n  n = strlen(substr);\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[j]) {\n\n      if (memcmp(substr, str + i, n) == 0) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (i = m; i < m + n; i++)\n      str[i] = re[i - m];\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, n = 0, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (b[0] == a[i]) {\n      for (j = 0; j < lenb; j++) {\n        if (b[j] == a[i + j]) {\n          n++;\n        }\n      }\n    }\n    if (n == lenb)\n      break;\n    else\n      n = 0;\n  }\n  if (i < lena) {\n    for (j = 0; j < lenb; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "11757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  int a, i, j, b, k = 0, c;\n  c = strlen(str3);\n  a = strlen(str1);\n  b = strlen(str2);\n  for (i = 0; i < a; i++) {\n    if (str1[i] == str2[0]) {\n      for (j = 1; j < b; j++) {\n        if (str1[i + j] == str2[j])\n          k++;\n        else {\n          k = 0;\n          break;\n        }\n      }\n      if (k == b - 1) {\n        for (j = i; j < i + c; j++) {\n          str1[j] = str3[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "11758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len1, len2, len3, i, j, m, p, flag = 0;\n  char str1[300], str2[50], str3[50];\n  cin.getline(str1, 300);\n  cin.getline(str2, 50);\n  cin.getline(str3, 50);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i <= len1 - len2; i++) {\n    flag = 0;\n    m = i;\n    for (j = 0; j < len2; j++) {\n      if (str1[m++] != str2[j])\n        break;\n    }\n    if (j == len2) {\n      for (p = 0; p < i; p++)\n        cout << str1[p];\n      cout << str3;\n      printf(\"%s\\n\", str1 + i + len2);\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << str1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[101], b[101];\n  int i, len, k, j, len1, len2, l, n, p = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  len = strlen(s);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == a[0] && p == 0) {\n      k = 0;\n      while (s[i + k] == a[k] && k < len1)\n        k++;\n\n      if (k == len1) {\n        p = 1;\n\n        len = strlen(s);\n        len1 = strlen(a);\n        len2 = strlen(b);\n        if (len1 == len2) {\n          for (j = 0; j < k; j++) {\n            s[i + j] = b[j];\n          }\n        }\n        if (len1 > len2) {\n          for (j = 0; j < len1; j++) {\n            s[i + j] = b[j];\n          }\n          for (j = len2, l = k; (l + i) <= len; j++, l++) {\n            s[i + j] = s[i + l];\n          }\n        }\n        if (len1 < len2) {\n          len = strlen(s);\n          n = len2 - len1;\n          for (l = len; l >= (i + k); l--)\n            s[l + n] = s[l];\n          for (j = 0; j < len2; j++)\n            s[i + j] = b[j];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[100][100];\n  int la, lb, i, j, m = 0, wz;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = 0;\n      wz = i;\n      for (j = 0; j < lb; j++) {\n        if (a[i + j] != b[j]) {\n          i = i + j - 1;\n          break;\n        } else\n          m++;\n      }\n    }\n    if (m == lb) {\n      for (j = 0; j < wz; j++) {\n        d[0][j] = a[j];\n        d[0][wz] = '\u0000';\n      }\n      for (j = wz + lb; j < la; j++) {\n        d[1][j - wz - lb] = a[j];\n        d[1][la - wz - lb] = '\u0000';\n      }\n      break;\n    }\n  }\n  if (m > 0) {\n    if (wz == 0)\n      strcpy(d[0], c);\n    else\n      strcat(d[0], c);\n    if (wz + lb == la)\n      puts(d[0]);\n    else {\n      strcat(d[0], d[1]);\n      puts(d[0]);\n    }\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[50], b[50];\n\n  int i, lenb, n, j, flag;\n  int k = 10001;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = (int)strlen(b);\n\n  for (i = 0; i <= (int)strlen(s); i++, flag = 0) {\n    for (n = 0, j = i; a[n] != '\u0000'; n++, j++) {\n      if (s[j] != a[n]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      continue;\n    else {\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (i == k) {\n      printf(\"%s\", b);\n      i = i + lenb - 1;\n      continue;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[50], rep[50];\n  int i, j, t, k;\n  int len_s, len_sub;\n  cin.getline(s, 257);\n  cin.getline(sub, 50);\n  cin.getline(rep, 50);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11763", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[300], s2[300], s3[300], *p = NULL;\n  int i, l1, l2, l3;\n  cin >> s1 >> s2 >> s3;\n  p = strstr(s1, s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  if (p == NULL)\n    cout << s1;\n  else {\n    for (i = 0; &s1[i] < p; i++)\n      printf(\"%c\", s1[i]);\n    cout << s3;\n    for (p = p + l2; *p != '\\0'; *p++)\n      cout << *p;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11764", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  cin >> s >> a >> b;\n  int i = 0, j = 0;\n  int find = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n\n      for (j = 0; a[j] != '\\0'; j++) {\n\n        if (a[j] != s[i + j]) {\n          find = 0;\n          break;\n        }\n      }\n      if (a[j] == '\\0')\n        find = 1;\n    }\n    if (find == 1)\n      break;\n  }\n  if (find) {\n    for (j = 0; b[j] != '\\0'; j++)\n      s[i + j] = b[j];\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11765", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s0[257], s1[257], s2[257];\n  int i, j, k0, k1, k2, l;\n  scanf(\"%s\", s0);\n  scanf(\"%s\", s1);\n  scanf(\"%s \", s2);\n  for (i = 0; s0[i] != '\\0'; i++) {\n    j = 0;\n    if (s1[0] == s0[i])\n      for (j = 1; s1[j] != '\\0'; j++)\n        if (s1[j] != s0[i + j])\n          break;\n    if (s1[j] == '\\0') {\n      k0 = k1 = k2 = 0;\n      while (s0[k0] != '\\0')\n        k0++;\n      while (s1[k1] != '\\0')\n        k1++;\n      while (s2[k2] != '\\0')\n        k2++;\n      for (l = i + k1; l < k0; l++)\n        s0[l + k2 - k1] = s0[l];\n      for (l = 0; l < k2; l++)\n        s0[i + l] = s2[l];\n      break;\n    }\n  }\n  l = 0;\n  while (s0[l] != '\\0') {\n    printf(\"%c\", s0[l]);\n    l++;\n  }\n}\n"}
{"label": "7", "index": "11766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(\"str\");\n  return 0;\n}\n"}
{"label": "7", "index": "11767", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *q1, *q2;\n  int i, j, k, flag;\n  p1 = (char *)malloc(sizeof(char) * 256);\n  p2 = (char *)malloc(sizeof(char) * 256);\n  p3 = (char *)malloc(sizeof(char) * 256);\n  q1 = (char *)malloc(sizeof(char) * 256);\n  q2 = (char *)malloc(sizeof(char) * 256);\n\n  cin >> p1;\n  cin >> p2;\n  scanf(\"%s \", p3);\n  for (i = 0; i < strlen(p1); i++) {\n    flag = 1;\n    for (j = 0; j < strlen(p2); j++)\n      if (*(p1 + i + j) != *(p2 + j)) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      for (k = 0; k < i; k++)\n        *(q1 + k) = *(p1 + k);\n      *(q1 + k) = '\u0000';\n      for (k = i + strlen(p2); k < strlen(p1); k++)\n        *(q2 + k - i - strlen(p2)) = *(p1 + k);\n      *(q2 + k - i - strlen(p2)) = '\u0000';\n      break;\n    }\n  }\n  if (flag) {\n    strcat(q1, p3);\n    strcat(q1, q2);\n    puts(q1);\n  } else\n    puts(p1);\n}\n"}
{"label": "7", "index": "11768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char mc[1000], zc[1000], huan[1000];\n  int len1, len2, len3, i, j = 0;\n  int sum = 0, ci = 0, loc;\n  cin >> mc >> zc >> huan;\n  len1 = strlen(mc);\n  len2 = strlen(zc);\n  len3 = strlen(huan);\n  for (i = 0; i < len1; i++) {\n    if (mc[i] == zc[0]) {\n      sum = 0;\n      for (j = i; j < len1; j++) {\n        if (mc[j] == zc[j - i]) {\n          sum++;\n        } else {\n          break;\n        }\n      }\n      loc = i;\n      if (sum == len2) {\n        for (i = 0; i < loc; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        for (i = loc; i <= loc + len3 - 1; i++) {\n          printf(\"%c\", huan[i - loc]);\n        }\n        for (i = loc + len3; i <= len1 + len3 - len2 - 1; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        ci++;\n        break;\n      }\n    }\n  }\n\n  if (ci == 0) {\n    printf(\"%s\", mc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200], b[300], c[300];\n  int d = 0, i, j, k, m, n, lenb, lena;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; j < i + lenb, k < lenb; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == lenb)\n        d = 1;\n    }\n    if (d == 1)\n      break;\n  }\n  if (d == 1) {\n    for (m = i, n = 0; m < i + lenb, n < lenb; m++, n++) {\n      a[m] = c[n];\n    }\n    cout << a;\n  }\n  if (d == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[500], w[500], e[500][500], c[500];\n  int i, j, m, n, k = 0;\n  cin >> w >> s >> c;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = 0; w[i + m - 1] != '\\0'; i++) {\n    for (j = 0; j < m; j++) {\n      e[i][j] = w[i + j];\n    }\n    e[i][j] = '\\0';\n  }\n  for (i = 0; i < n - m + 1; i++) {\n    if (strcmp(e[i], s) == 0) {\n      k = 1;\n      break;\n    }\n  }\n  int a;\n  a = i;\n  if (k == 1) {\n    for (i = 0; i < m; i++) {\n      w[a + i] = c[i];\n    }\n    printf(\"%s\", w);\n  } else if (k == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11771", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260], str2[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int i = 0;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr);\n  if (node == NULL)\n    cout << str;\n  else {\n    while (start != node)\n      str2[i++] = *start++;\n    while (*rep != '\\0')\n      str2[i++] = *rep++;\n    node += strlen(subStr);\n    while (*node != '\\0') {\n      str2[i++] = *node++;\n    }\n    str2[i] = '\\0';\n    cout << str2;\n  }\n  cout << endl;\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "11772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], f[300], h[300];\n  int i, m, n = 0, t, g, e[3];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (m = 0; m < 290; m++) {\n    if (a[m] == '\u0000')\n      break;\n    e[0] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (b[m] == '\u0000')\n      break;\n    e[1] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (c[m] == '\u0000')\n      break;\n    e[2] = m + 1;\n  }\n  for (i = 0; i <= e[0] - e[1]; i++) {\n    for (t = 0; t < e[1]; t++) {\n      if (a[i + t] == b[t])\n        n++;\n      else\n        n = 0;\n    }\n    if (n == e[1]) {\n      g = i;\n      break;\n    }\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < g; i++) {\n      d[i] = a[i];\n      printf(\"%c\", d[i]);\n    }\n    for (i = 0; i < e[2]; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = 0; i < e[1]; i++)\n      f[i] = a[i + g];\n    for (i = 0; i < e[0] - e[1] - g; i++) {\n      h[i] = a[g + e[1] + i];\n      printf(\"%c\", h[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], w[256], z[256];\n  int ls, lw, t, lz;\n  int i, j, loc = -1;\n  cin >> w >> s >> z;\n  ls = strlen(s);\n  lw = strlen(w);\n  lz = strlen(z);\n  for (i = 0; i < lw; i++) {\n    t = 0;\n    for (j = 0; j < ls; j++) {\n      if (w[i + j] == s[j])\n        t++;\n    }\n    if (t == ls) {\n      loc = i;\n      break;\n    }\n  }\n\n  if (loc != -1) {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", w[i]);\n    }\n\n    printf(\"%s\", z);\n    for (i = loc + lz; i < lw; i++) {\n      printf(\"%c\", w[i]);\n    }\n  } else {\n    puts(w);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11774", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], substr[1000], replace[1000];\n  char *p, *q, *r, *start;\n  int len;\n  scanf(\"%s %s %s \", str, substr, replace);\n  len = strlen(substr);\n  for (p = str; *p != '\\0'; p++) {\n    for (q = p, r = substr; *r != '\\0'; q++, r++)\n      if (*q != *r)\n        break;\n    if (*r == '\\0') {\n      start = p;\n      break;\n    }\n  }\n  for (p = start, q = replace; *q != '\\0'; p++, q++)\n    *p = *q;\n  printf(\"%s\", str);\n}\n"}
{"label": "7", "index": "11775", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[3][300];\n  int l1, l2, i = 0, j = 0, k = 0, n;\n  scanf(\"%s\", c[0]);\n  cin >> c[1];\n  scanf(\"%s\", c[2]);\n\n  l1 = strlen(c[0]);\n  l2 = strlen(c[1]);\n\n  while (i < l1) {\n    if (k == l2)\n      break;\n    if (c[0][i] == c[1][j]) {\n      k += 1;\n      j += 1;\n      i += 1;\n    } else {\n      if (j < l2 - 1) {\n        k = 0;\n        j += 1;\n      }\n      if (j == l2 - 1) {\n        k = 0;\n        j = 0;\n        i += 1;\n      }\n    }\n  }\n\n  if (k == l2) {\n    for (n = i - l2; n < i; n++) {\n      c[0][n] = c[2][n + l2 - i];\n    }\n  }\n  printf(\"%s\\n\", c[0]);\n}\n"}
{"label": "7", "index": "11776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300 * 100], sub[100], rep[100];\n\n  cin >> str;\n\n  scanf(\"%s \", sub);\n\n  cin >> rep;\n  int i, j, k, t, w;\n  t = 0;\n  w = 0;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j])\n          break;\n      }\n      if (sub[j] == 0) {\n        t = i;\n        w = k;\n        break;\n      }\n    }\n  }\n  if (w > t) {\n    if (strlen(sub) >= strlen(rep)) {\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = w; str[k] != 0; i++, k++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= w; k--, i--) {\n        str[i] = str[k];\n      }\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n  scanf(\"%s\", &q);\n  scanf(\"%s\", &a);\n  cin >> b;\n  int i = 0, j = 0, k = 0, s = 0, p = 0, qc, ac, bc, r, js = 0, sz[100] = {0},\n      x, y, z, npc;\n  qc = strlen(q);\n  ac = strlen(a);\n  bc = qc - ac;\n  for (i = 0; i < bc + 1; i++) {\n\n    for (j = 0; j < ac; j++) {\n      xc[i][j] = q[j + k];\n    }\n    k++;\n    p = strcmp(xc[i], a);\n    if (p == 0) {\n      sz[js] = i;\n      js++;\n    }\n  }\n  npc = sz[0];\n\n  if (js == 0)\n    printf(\"%s \", q);\n\n  if (js != 0) {\n    for (x = 0; x < npc; x++) {\n      printf(\"%c\", q[x]);\n    }\n    printf(\"%s\", b);\n    for (z = npc + ac; z < qc; z++) {\n      printf(\"%c\", q[z]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], yuan[100], xin[100];\n  int i = 0, j = 0, len, lenyuan, lenxin;\n\n  cin >> s;\n\n  cin >> yuan;\n\n  cin >> xin;\n  len = strlen(s);\n  lenyuan = strlen(yuan);\n  lenxin = strlen(xin);\n  for (i = 0; i < len; i++) {\n    if (s[i] == yuan[0] && s[lenyuan + i - 1] == yuan[lenyuan - 1]) {\n      for (j = 0; j < lenxin; j++) {\n        s[i + j] = xin[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char src[256] = {0};\n  char subString[256] = {0};\n  char replacement[256] = {0};\n  char pre[256] = {0};\n  char *post;\n  cin >> src >> subString >> replacement;\n  char *start;\n  start = strstr(src, subString);\n  if (start != NULL) {\n    char *q = pre, *p = src;\n    while (p != start) {\n      *q = *p;\n      p++;\n      q++;\n    }\n    *q = '\\0';\n\n    post = start + strlen(subString);\n    strcat(pre, replacement);\n    strcat(pre, post);\n    printf(\"%s\", pre);\n  } else\n    cout << src;\n  return 0;\n}\n"}
{"label": "7", "index": "11780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s\", a, b, c);\n  int i, j, k, nb, nc, count;\n  nb = 0;\n  nc = 0;\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; a[i + 1] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      count = 0;\n      k = i;\n      for (j = 0; j < nb; j++) {\n        if (a[k + j] == b[j]) {\n          count++;\n        } else {\n          break;\n        }\n      }\n      if (count == nb) {\n        for (j = 0; j < nc; j++) {\n          a[k + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char st[351], su[351], re[551], reh[551];\n  int a, b, c, e, r, lu, lr;\n\n  scanf(\"%s\", st);\n  scanf(\"%s\", su);\n  scanf(\"%s\", re);\n  r = -1;\n  for (a = 0; a < strlen(st); a++) {\n    e = 1;\n    for (b = 0; b < strlen(su); b++) {\n      if (st[a + b] != su[b]) {\n        e = 0;\n      }\n    }\n    if (e) {\n      r = a;\n\n      break;\n    }\n  }\n  if (r + 1) {\n    for (a = 0; a < r; a++) {\n      reh[a] = st[a];\n    }\n    for (a = 0; a < strlen(su); a++) {\n      reh[r + a] = re[a];\n    }\n    lu = strlen(su);\n    lr = strlen(re);\n    for (a = r + lu; a <= 530; a++) {\n      reh[lr + a - lu] = st[a];\n    }\n\n    printf(\"%s\", reh);\n\n  } else {\n    cout << st;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int la, lb, i, j, n, k, x, p;\n  char a[100], b[100], c[100], d[100];\n  scanf(\"%s %s %s\", a, b, d);\n  la = strlen(a);\n  lb = strlen(b);\n  n = la - lb;\n  for (i = 0; i <= n; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      p = i;\n      for (j = 0; j < lb; j++) {\n        c[j] = a[k];\n        k++;\n      }\n      c[lb] = '\\0';\n      if (strcmp(c, b) == 0) {\n        for (x = 0; x < lb; x++) {\n          a[p] = d[x];\n          p++;\n        }\n        break;\n      }\n    } else\n      continue;\n  }\n\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, p, f;\n  char str[257], a[257], b[257];\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n = strlen(str);\n  m = strlen(a);\n  p = 1;\n\n  for (i = 0; i < n; i++) {\n    f = 1;\n    for (j = 0; j < m; j++)\n      if (str[i + j] != a[j]) {\n        f = 0;\n        break;\n      }\n    if ((p) && (f)) {\n      printf(\"%s\", b);\n      p = 0;\n      i += m - 1;\n    } else\n      cout << str[i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int len1, len2, len3, i, j, sum = 0;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[0]) {\n      sum = 0;\n      for (j = 0; j < len2; j++) {\n        if (a[i + j] == b[j]) {\n          sum++;\n        }\n      }\n      if (sum == len2) {\n        for (j = 0; j < len3; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], rep[100];\n  int i, j, m, len, lens;\n  scanf(\"%s\\n%s\\n%s\", str, sub, rep);\n  len = strlen(str);\n  lens = strlen(sub);\n\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0] && str[i + 1] == sub[1] &&\n        str[i + lens - 1] == sub[lens - 1]) {\n      j = i;\n      m = 0;\n      while (m < lens) {\n        str[j] = rep[m];\n        j++;\n        m++;\n      }\n      break;\n    }\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, t, s, n = 0, k, l;\n  char c1[256], c2[256], c3[256];\n\n  cin >> c1;\n\n  cin >> c2;\n\n  cin >> c3;\n  s = strlen(c2);\n  for (i = 0; c1[i] != '\u0000'; i++) {\n    if (c1[i] == c2[j]) {\n      n++;\n      j++;\n    } else {\n      j = 0;\n      n = 0;\n    }\n    if (n == s) {\n      t = i;\n      break;\n    }\n    \n  }\n  \n  if (n == s) {\n    for (l = 0, k = t - s + 1; k <= t, l < s; l++, k++) {\n      c1[k] = c3[l];\n    }\n  }\n\n  printf(\"%s\", c1);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar substring[256] = {0};\nchar S[256] = {0};\nchar replacement[256] = {0};\n\nint main() {\n\n  while (scanf(\"%s \", S)) {\n    cin >> substring;\n    cin >> replacement;\n\n    char *p = strstr(S, substring);\n    char *q = NULL;\n\n    int i = 0;\n\n    if (p != NULL) {\n      for (q = S; q < p; q++) {\n        cout << *q;\n      }\n      cout << replacement;\n      for (q = p + strlen(substring); *q != '\\0'; q++) {\n        cout << *q;\n      }\n      cout << endl;\n      memset(S, 0, 256);\n      memset(substring, 0, 256);\n      memset(replacement, 0, 256);\n    }\n\n    else if (p == NULL) {\n      cout << S << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11788", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[100][100];\n  int la, lb, i, j, x = 0, m = 0, wz;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = 0;\n      wz = i;\n      for (j = 0; j < lb; j++) {\n        if (a[i + j] != b[j]) {\n          i = i + j - 1;\n          break;\n        } else\n          m++;\n      }\n    }\n    if (m == lb) {\n      for (j = 0; j < wz; j++) {\n        d[0][j] = a[j];\n        d[0][wz] = '\u0000';\n      }\n      for (j = wz + lb; j < la; j++) {\n        d[1][j - wz - lb] = a[j];\n        d[1][la - wz - lb] = '\u0000';\n      }\n      break;\n    }\n  }\n  if (m > 0) {\n    if (wz == 0)\n      strcpy(d[0], c);\n    else\n      strcat(d[0], c);\n    if (wz + lb == la) {\n      puts(d[0]);\n    } else {\n      strcat(d[0], d[1]);\n      puts(d[0]);\n    }\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "11789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[500], substring[500], replacement[500], str[500];\n  int i, j, k, l, m, len0, len1, len2;\n\n  cin >> string;\n\n  scanf(\"%s \", substring);\n\n  cin >> replacement;\n\n  len1 = strlen(substring);\n\n  len2 = strlen(replacement);\n\n  len0 = strlen(string);\n\n  strcpy(str, string);\n\n  for (i = 0; i < len0; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len1; j++) {\n        if (string[i + 1] == substring[j])\n          i++;\n        else {\n          j = 0;\n          break;\n        }\n      }\n\n      if (j == len1) {\n        k = i;\n        for (i; i < len0 - len1 + len2; i++) {\n          str[i - len1 + len2] = string[i];\n        }\n        for (l = 0; l < len2; l++) {\n          str[k - len2 + 1 + l] = replacement[l];\n        }\n      } else\n        m = 0;\n    }\n  }\n\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], ow[256], rw[256];\n  scanf(\"%s%s%s\", s, ow, rw);\n  int lens, lenow;\n  int i, j, k, l, t, flag;\n  lens = strlen(s);\n  lenow = strlen(ow);\n  for (i = 0; i <= (lens - lenow); i++) {\n    flag = 1;\n    for (j = 0; j < lenow; j++) {\n      if (s[i + j] != ow[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag != 0) {\n      t = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << s;\n  } else {\n    for (k = 0; k < t; k++)\n      printf(\"%c\", s[k]);\n\n    printf(\"%s\", rw);\n    for (l = t + lenow; l < lens; l++) {\n      printf(\"%c\", s[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], w[100], t[100];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  int i, j, k, p, q, f = 1, n, m, e;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = j = 0; i < n; i++) {\n    k = i;\n    p = i;\n    q = j;\n    if (w[p] == s[q]) {\n      for (q = 0; q < m; q++) {\n        if (w[p] != s[q])\n          f = 0;\n\n        p++;\n      }\n      if (f == 1) {\n        for (e = 0; e < k; e++) {\n          printf(\"%c\", w[e]);\n        }\n        printf(\"%s\", t);\n        for (e = k + m; e < n; e++) {\n          printf(\"%c\", w[e]);\n        }\n        return 0;\n      }\n      f = 1;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "11792", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n = 0;\n  char t[260], s[260], w[260];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  for (i = 0; i < strlen(w); i++) {\n    k = 1;\n    for (j = 0; j < strlen(s); j++)\n      if (s[j] != w[i + j])\n        k = 0;\n    if (k) {\n      n = i;\n      break;\n    }\n  }\n  if (n) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", w[i]);\n    printf(\"%s\", t);\n    for (i = n + strlen(s); i < strlen(w); i++)\n      printf(\"%c\", w[i]);\n  } else\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "11793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[256], s[256], ti[256];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> ti;\n  int len1, len2, len;\n  len = strlen(w);\n  len1 = strlen(s);\n  len2 = strlen(ti);\n  int i, k, n = 0, m = 0;\n  for (i = 0; i < len; i++) {\n    if (w[i] == s[0]) {\n      for (k = 1; k < len1; k++) {\n        if (w[i + k] == s[k]) {\n          n++;\n        }\n      }\n      if (n == len1 - 1) {\n        m = i;\n      }\n    }\n  }\n  if (m == 0) {\n    puts(w);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", w[i]);\n    }\n    for (i = 0; i < len2; i++) {\n      printf(\"%c\", ti[i]);\n    }\n    for (i = m + len1; i < len; i++) {\n      printf(\"%c\", w[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11794", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[300], rep[300], sub[300];\n  cin >> s >> sub >> rep;\n  if (strstr(s, sub)) {\n    char *t = strstr(s, sub);\n    *t = '\\0';\n    cout << s << rep << (t + strlen(sub)) << endl;\n  } else {\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  cin >> a >> b >> c;\n  int i, j, t, l, k = 0, m = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l - t + 1; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i + j] != b[j])\n        k = 0;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if (t == k) {\n        m = i;\n        i = l;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"%s\", a);\n  if (m != 0) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", a[i]);\n    cout << c;\n    for (i = m + t; i < l; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11796", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[256], sub[256], replace[256], s[256], p[256];\n  int i, j, k, a, k0, k1, k2, flag = 0;\n\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  k0 = strlen(string);\n  k1 = strlen(sub);\n  k2 = strlen(replace);\n  for (i = 0; i < k0; i++) {\n    for (j = i, k = 0; j < i + k1; j++, k++) {\n      p[k] = string[j];\n    }\n    p[k] = 0;\n\n    if (strcmp(sub, p) == 0) {\n      a = i;\n      for (i = 0; i < a; i++) {\n        s[i] = string[i];\n      }\n      for (i = k0 + k2 - k1, j = k0; i >= a + k2, j >= a + k1; i--, j--) {\n        s[i] = string[j];\n      }\n      for (i = a, j = 0; i < a + k2, j < k2; i++, j++) {\n        s[i] = replace[j];\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k0 + k2 - k1; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"\\n\");\n  }\n  if (flag == 0) {\n    puts(string);\n  }\n}\n"}
{"label": "7", "index": "11797", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char s[100], c[100], a[100];\n\n  scanf(\"%s \", s);\n\n  cin >> c;\n\n  cin >> a;\n  k = strlen(s);\n  p = strlen(c);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    for (j = 0; j < p; j++, i++) {\n      if (s[i] != c[j])\n        break;\n    }\n    if (j > p - 1) {\n      for (j = 0; j < p; j++, i++)\n        s[i - p] = a[j];\n      break;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%c\", s[i]);\n}\n"}
{"label": "7", "index": "11798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i = 0, j = 0, len1, len2, len3, t = 0, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  while (i < len1 && t < len2) {\n    if (a[i] != b[j]) {\n      i++;\n      j = 0;\n      t = 0;\n    } else {\n      i++;\n      j++;\n      t++;\n    }\n  }\n  if (t >= len2) {\n    for (j = 0; j < i - t; j++)\n      printf(\"%c\", a[j]);\n    for (j = 0; j < len3; j++)\n      printf(\"%c\", c[j]);\n    for (j = i - t + len2; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  if (t < len2) {\n    for (j = 0; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, t = 0;\n  char c[256], d[256], e[256];\n  scanf(\"%s\", c);\n  scanf(\"%s\", d);\n  scanf(\"%s\", e);\n  m = strlen(c);\n  n = strlen(d);\n  for (i = 0; i < m; i++) {\n    if (c[i] == d[0]) {\n      t = 0;\n      for (j = i; j < i + n; j++) {\n        if (c[j] == d[j - i])\n          t = t + 1;\n      }\n      if (t == n) {\n        for (j = i; j < i + n; j++) {\n          c[j] = e[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "7", "index": "11800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char org[270] = {0}, sub[100] = {0}, rep[100] = {0}, temp[100] = {0};\n  cin >> org >> sub >> rep;\n  int i, j, l1 = strlen(org), l = strlen(sub), flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < i + l; j++)\n      temp[j - i] = org[j];\n\n    if (strcmp(temp, sub) == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (int k = 0; k < i; k++)\n      cout << org[k];\n    printf(\"%s\", rep);\n    printf(\"%s\\n\", org + j);\n  } else\n    cout << org << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], z[200], h[200], t[100];\n  int lens, lenz, lenh, i, j, sum, r, q = 0, p = 0;\n\n  cin >> s;\n\n  cin >> z;\n\n  cin >> h;\n  lens = strlen(s);\n  lenz = strlen(z);\n  lenh = strlen(h);\n  for (i = 0; i < lens; i++) {\n    sum = 0;\n    for (j = 0; j < lenz; j++) {\n      if (s[i + j] == z[j]) {\n        sum++;\n      } else\n        break;\n    }\n    if (sum == lenz) {\n      r = i;\n      q = 1;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < r; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", h);\n    for (i = r + sum; i < lens; i++)\n      printf(\"%c\", s[i]);\n  } else if (q == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11802", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  int t2 = 0;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      t2 += 1;\n    }\n\n    if (t == 1 && t2 == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[50], str2[50], zfc[3][50];\n  int i, j, yes, no = 0, m, n;\n  int len, len1, len2;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  for (i = 0; i < len - len1 + 1; i++) {\n    yes = 0;\n    for (j = 0; j < len1; j++) {\n      if (str[i + j] == str1[j])\n        yes++;\n    }\n    \n    if (yes == len1) {\n\n      m = i;\n\n      \n      n = 0;\n      for (i = 0; i < m; i++) {\n        zfc[0][n] = str[i];\n        n++;\n      }\n      zfc[0][m] = '\u0000';\n      printf(\"%s\", zfc[0]);\n      strcpy(zfc[1], str2);\n      printf(\"%s\", zfc[1]);\n      n = 0;\n      for (i = m + len1; i < len; i++) {\n        zfc[2][n] = str[i];\n        n++;\n      }\n      zfc[2][len - m - len1] = '\u0000';\n      printf(\"%s\", zfc[2]);\n      \n      break;\n    } else {\n      no++;\n    }\n  }\n  if (no == len - len1 + 1) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len, len2, i, j, f, ff;\n  char s[300], sub[300], replace[300];\n\n  cin >> s;\n  len = strlen(s);\n\n  cin >> sub;\n\n  cin >> replace;\n  len2 = strlen(sub);\n  f = 0;\n  for (i = 0; i <= len - len2; i++) {\n    ff = 1;\n    for (j = 0; j < len2; j++)\n      if (sub[j] != s[i + j]) {\n        ff = 0;\n        break;\n      }\n    if (ff == 0)\n      continue;\n    for (j = 0; j < i; j++)\n      printf(\"%c\", s[j]);\n    cout << replace;\n    for (j = i + len2; j < len; j++)\n      printf(\"%c\", s[j]);\n    f = 1;\n    break;\n  }\n  if (f == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, f, l, k;\n  char s1[260], s2[260], s3[260];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  m = strlen(s1);\n  n = strlen(s2);\n  l = strlen(s3);\n  for (i = 0; i < m; i++) {\n    f = 1;\n    for (j = 0; j < n; j++) {\n      if (s1[i + j] != s2[j]) {\n        f = 0;\n        break;\n      }\n    }\n    if (f == 1) {\n      k = i;\n      break;\n    }\n  }\n  if (f == 0)\n    puts(s1);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", s1[i]);\n    for (i = 0; i < l; i++)\n      cout << s3[i];\n    for (i = k + l; i < m; i++)\n      printf(\"%c\", s1[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11806", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[256], sub[256], replace[256], s[256], p[256];\n  int i, j, k, a, k0, k1, k2, flag = 0;\n\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  k0 = strlen(string);\n  k1 = strlen(sub);\n  k2 = strlen(replace);\n  for (i = 0; i < k0; i++) {\n    for (j = i, k = 0; j < i + k1; j++, k++) {\n      p[k] = string[j];\n    }\n    p[k] = 0;\n\n    if (strcmp(sub, p) == 0) {\n      a = i;\n      for (i = 0; i < a; i++) {\n        s[i] = string[i];\n      }\n      for (i = k0 + k2 - k1, j = k0; i >= a + k2, j >= a + k1; i--, j--) {\n        s[i] = string[j];\n      }\n      for (i = a, j = 0; i < a + k2, j < k2; i++, j++) {\n        s[i] = replace[j];\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k0 + k2 - k1; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"\\n\");\n  }\n  if (flag == 0)\n    puts(string);\n}\n"}
{"label": "7", "index": "11807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], ow[256], rw[256];\n  cin >> s >> ow >> rw;\n  int lens, lenow;\n  int i, j, k, l, t, flag;\n  lens = strlen(s);\n  lenow = strlen(ow);\n  for (i = 0; i <= (lens - lenow); i++) {\n    flag = 1;\n    for (j = 0; j < lenow; j++) {\n      if (s[i + j] != ow[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag != 0) {\n      t = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << s;\n  } else {\n    for (k = 0; k < t; k++)\n      printf(\"%c\", s[k]);\n\n    printf(\"%s\", rw);\n    for (l = t + lenow; l < lens; l++) {\n      printf(\"%c\", s[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sub[257], s1[257], s2[257];\n  int i, j, k, str1, str2;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  str1 = strlen(sub);\n  str2 = strlen(s1);\n  for (i = 0; i < str1; i++)\n    if (sub[i] == s1[0]) {\n      for (j = 0; j < str2; j++)\n        if (sub[i + j] != s1[j])\n          break;\n      if (j == str2) {\n        for (j = 0; j < str2; j++)\n          sub[i + j] = s2[j];\n        break;\n      }\n    }\n  printf(\"%s\\n\", sub);\n  return 0;\n}\n"}
{"label": "7", "index": "11809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int l, p, q, i, j, s, m = 0, k, y;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n  l = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < l; i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < p) {\n      k++;\n      j++;\n    }\n    if (j == p) {\n      for (s = i; s < i + p; s++) {\n        a[s] = c[m];\n        m++;\n        y = 1;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n  cout << a << \" \";\n}\n"}
{"label": "7", "index": "11810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a1[257 * 2], a2[257], b1[257];\n  int i, j, k, start = 0, end = 0;\n\n  cin >> a1;\n\n  cin >> a2;\n\n  cin >> b1;\n  for (i = 0; a1[i] != 0; i++) {\n    if (a1[i] == a2[0]) {\n      for (j = i + 1, k = 1; a2[k] != 0; j++, k++) {\n        if (a1[j] != a2[k]) {\n          break;\n        }\n      }\n      if (a2[k] == 0) {\n        start = i;\n        end = j;\n        break;\n      }\n    }\n  }\n  if (start < end) {\n    for (i = start, k = 0; b1[k] != 0; i++, k++) {\n      a1[i] = b1[k];\n    }\n    for (j = end; a1[j] != 0; i++, j++) {\n      a1[i] = a1[j];\n    }\n    a1[i] = 0;\n  }\n  printf(a1);\n  return 0;\n}\n"}
{"label": "7", "index": "11811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  scanf(\"%s %s %s \", a, b, c);\n  char *p, *q;\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL)\n    cout << a;\n  else {\n    while (q != p) {\n      cout << *q;\n      q++;\n    }\n    printf(\"%s\", c);\n    q = q + strlen(c);\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  int L, l, x, y;\n  L = strlen(a);\n  l = strlen(b);\n  for (x = 0; x <= L - l; x++) {\n    if (a[x] != b[0])\n      continue;\n    else {\n      for (y = 0; y < l; y++)\n        if (a[x + y] != b[y])\n          break;\n      if (y != l) {\n        continue;\n      } else {\n        break;\n      }\n    }\n  }\n  if (x == L - l + 1)\n    cout << a << endl;\n  else {\n    int i = 0;\n    while (i != x) {\n      cout << a[i];\n      i++;\n    }\n    cout << c;\n    cout << a + i + l << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ys[1000], re[1000], bt[1000];\n  int m, n, i, j, k, ss = 0, se = 0;\n\n  cin >> ys;\n\n  cin >> bt;\n\n  cin >> re;\n  for (i = 0; ys[i] != 0; i++) {\n    if (ys[i] == bt[0]) {\n      for (k = i + 1, j = 1; ys[k] != 0 && bt[j] != 0; k++, j++) {\n        if (ys[k] != bt[j]) {\n          break;\n        }\n      }\n      if (bt[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(bt) <= strlen(re)) {\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n      for (k = se; ys[k] != 0; k++, i++) {\n        ys[i] = ys[k];\n      }\n      ys[i] = 0;\n    } else {\n      i = strlen(ys) + strlen(re) - strlen(bt);\n      for (k = strlen(ys); k >= se; k--, i--) {\n        ys[i] = ys[k];\n      }\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n    }\n  }\n  printf(ys);\n  return 0;\n}\n"}
{"label": "7", "index": "11814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[530] = {'\\0'}, e[257] = {'\\0'};\n  int i, m = 0, j, t, len;\n  scanf(\"%s%s%s\", a, b, c);\n  for (i = 0;; i++) {\n    if (a[i] == '\\0' || b[m] == '\\0')\n      break;\n    if (b[m] != a[i]) {\n      m = 0;\n      continue;\n    }\n    m++;\n  }\n  if (m != 0) {\n    for (j = 0, t = 0; j <= i - m; j++, t++) {\n      if (j == i - m) {\n        d[t] = '\\0';\n      } else {\n        d[t] = a[j];\n      }\n    }\n    len = strlen(a);\n    if (i != len) {\n      for (j = i, t = 0; j < len; j++, t++) {\n        e[t] = a[j];\n      }\n      strcat(d, c);\n      strcat(d, e);\n    } else {\n      strcat(d, c);\n    }\n    printf(\"%s\", d);\n  } else\n    printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid right(char a[], int l, int t) {\n  int i;\n  for (i = l; i >= t; i--)\n    a[i] = a[i - 1];\n  a[l + 1] = '\\0';\n}\nvoid left(char a[], int l, int t) {\n  int i;\n  for (i = t; i <= l; i++)\n    a[i - 2] = a[i - 1];\n  a[l - 1] = '\\0';\n}\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, l1, l2, l3, d, e, s, r;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  if (l2 > l3) {\n    s = 1;\n    r = l2 - l3;\n  } else if (l2 == l3)\n    s = r = 0;\n  else {\n    s = -1;\n    r = l3 - l2;\n  }\n  for (i = 1; i <= l1; i++) {\n    e = a[i - 1] - b[0];\n    if (e == 0) {\n      d = 0;\n      for (j = 1; j <= l2 - 1; j++) {\n        e = a[i + j - 1] - b[j];\n        if (e != 0)\n          d = 1;\n      }\n      if (d == 0) {\n        for (j = 1; j <= r; j++) {\n          if (s > 0)\n            left(a, l1, i + l2);\n          if (s < 0)\n            right(a, l1, i);\n        }\n        for (j = 1; j <= l3; j++)\n          a[i + j - 2] = c[j - 1];\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[300] = {0};\n  char tar[300] = {0};\n  char rep[300] = {0};\n  char result[300] = {0};\n\n  int len1, len2, ischange = 0;\n  int index1 = 0, i, index2 = 0;\n\n  cin >> zfc;\n\n  cin >> tar;\n  len1 = strlen(tar);\n\n  cin >> rep;\n  len2 = strlen(rep);\n\n  while (zfc[index1] != '\u0000') {\n    ischange = 1;\n    for (i = 0; i < len1; i++) {\n      if (zfc[index1 + i] != tar[i]) {\n        ischange = 0;\n        break;\n      }\n    }\n    if (ischange) {\n      for (i = 0; i < len2; i++) {\n        result[index2 + i] = rep[i];\n      }\n      index2 += len2;\n      index1 += len1;\n      while (zfc[index1] != '\u0000') {\n        result[index2] = zfc[index1];\n        index2++;\n        index1++;\n      }\n      break;\n    }\n    result[index2] = zfc[index1];\n    index2++;\n    index1++;\n  }\n  cout << result;\n  return 0;\n}\n"}
{"label": "7", "index": "11817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[500], substring[50], replacement[50];\n  int same, i, k, c;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  for (i = 0; i < strlen(string); i++) {\n    same = 1;\n    for (k = 0; k < strlen(substring); k++) {\n      if (string[i + k] != substring[k])\n        same = 0;\n    }\n    if (same == 1) {\n      printf(\"%s\", replacement);\n      c = i;\n      break;\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  for (i = c + strlen(substring); i < strlen(string); i++) {\n    printf(\"%c\", string[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], t[256];\n  int j, ls1, lt, i, k = 0;\n  scanf(\"%s%s%s\", s, s1, t);\n  ls1 = strlen(s1);\n  lt = strlen(t);\n  for (i = 0; s[i]; i++) {\n    if (s[i] == s1[k]) {\n      k++;\n      if (k == ls1 - 1)\n        break;\n    } else\n      k = 0;\n  }\n  if (i >= strlen(s))\n    printf(\"%s\\n\", s);\n  else {\n    for (j = 0; j < i - ls1 + 2; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", t);\n    for (j = i + 2; j < strlen(s); j++)\n      printf(\"%c\", s[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, m;\n  char zfc[1000], zfc_1[100], zfc_2[100];\n  scanf(\"%s%s%s\", zfc, zfc_1, zfc_2);\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (j == (int)strlen(zfc_1))\n      break;\n    if (zfc[i] == zfc_1[j])\n      j++;\n    else\n      j = 0;\n  }\n  if (j == (int)strlen(zfc_1)) {\n    for (m = 0; m < i - j; m++)\n      printf(\"%c\", zfc[m]);\n    printf(\"%s\", zfc_2);\n    for (m = i; m < (int)strlen(zfc); m++)\n      printf(\"%c\", zfc[m]);\n  } else\n    cout << zfc;\n  return 0;\n}\n"}
{"label": "7", "index": "11821", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s \", replacement);\n  int length_string = strlen(string);\n  int length_substring = strlen(substring);\n\n  int i, j, k;\n  for (i = 0; i < length_string; i++) {\n    for (j = 0; j < length_substring; j++) {\n      if (substring[j] != string[i + j]) {\n        break;\n      }\n    }\n    if (j == length_substring) {\n      for (k = 0; k < length_substring; k++) {\n        string[i + k] = replacement[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", string);\n}\n"}
{"label": "7", "index": "11822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int n, m, i, j, k, d;\n  for (i = 0; i < 256; i++) {\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n    c[i] = '\u0000';\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n\n  m = 0;\n  n = 0;\n  d = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    m++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    d++;\n  }\n\n  int h = 0;\n  i = 0;\n  while (a[i] != '\u0000') {\n    if (a[i] == b[0]) {\n      j = 0;\n      h = i;\n      k = 0;\n      while (a[i] == b[j] && a[i] != '\u0000') {\n\n        k++;\n        i++;\n        j++;\n      }\n      if (k == n) {\n        int t = 0;\n        for (t = 0; t < d; t++) {\n          a[h + t] = c[t];\n        }\n        break;\n      }\n    } else\n      i++;\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char an[270], bn[270], cn[270], temp[270];\n  scanf(\"%s%s%s\", an, bn, cn);\n  char *p = strstr(an, bn);\n  int len = strlen(bn);\n  if (p != NULL) {\n    strcpy(temp, p + len);\n    *p = '\\0';\n    strcat(an, cn);\n    strcat(an, temp);\n  }\n  printf(\"%s\", an);\n  return 0;\n}\n"}
{"label": "7", "index": "11824", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, sum = 0, m = 0, t = 0, p, q, flag = 0, flag2 = 0;\n  char str[256], substr[256], rep[256], str1[256], str2[256];\n\n  cin >> str;\n\n  cin >> substr;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(substr);\n  c = strlen(rep);\n  for (m = m; m < a; m++) {\n    if (str[m] == substr[0]) {\n      for (p = m, q = 0; q < b; p++, q++) {\n        if (str[p] != substr[q]) {\n          flag = 1;\n        }\n      }\n      if (flag == 1) {\n        flag = 0;\n\n        continue;\n      } else {\n        flag2 = 1;\n        break;\n      }\n\n    } else {\n      continue;\n    }\n  }\n\n  if (flag2 == 1) {\n\n    for (i = 0, d = 0; i < m, d < m; d++, i++) {\n      str1[d] = str[i];\n    }\n    str1[m] = '\u0000';\n    for (i = m + b, e = 0; i < a, e < a - m - b; e++, i++) {\n      str2[e] = str[i];\n    }\n    str2[a - m - b] = '\u0000';\n    printf(\"%s%s%s\", str1, rep, str2);\n\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256], final[500];\n  int i, j, k, length, length1, length2, a, flag = 0;\n  cin >> string;\n  cin >> substring;\n  scanf(\"%s\", replacement);\n  length = strlen(string);\n  length1 = strlen(substring);\n  length2 = strlen(replacement);\n  for (i = 0, j = 0; string[i] != '\\0'; i++) {\n    if (string[i] == substring[j]) {\n      a = i;\n      if (string[a + 1] == substring[j + 1]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 1) {\n    for (k = 0; k <= a - 1; k++)\n      *(final + k) = *(string + k);\n    for (k = a; k < a + length2; k++)\n      *(final + k) = *(replacement + k - a);\n    for (k = a + length2; k < length + length2 - length1; k++)\n      *(final + k) = *(string + k + length1 - length2);\n    *(final + length + length2 - length1) = '\\0';\n    for (k = 0; final[k] != '\\0'; k++)\n      printf(\"%c\", final[k]);\n  } else if (flag == 0) {\n    for (i = 0, j = 0; string[i] != '\\0'; i++)\n      printf(\"%c\", string[i]);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sub[257], s1[257], s2[257];\n  int i, j, k, str1, str2;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  str1 = strlen(sub);\n  str2 = strlen(s1);\n  for (i = 0; i < str1; i++)\n    if (sub[i] == s1[0]) {\n      for (j = 0; j < str2; j++)\n        if (sub[i + j] != s1[j])\n          break;\n      if (j == str2) {\n        for (j = 0; j < str2; j++)\n          sub[i + j] = s2[j];\n        break;\n      }\n    }\n  cout << sub << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "11827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, len3, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  len3 = strlen(s3);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2)\n      break;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%c\", s1[j]);\n  if (i != len1)\n    printf(\"%s\", s3);\n  for (j = i + len2; j < len1; j++)\n    printf(\"%c\", s1[j]);\n  return 0;\n}\n"}
{"label": "7", "index": "11828", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  cin >> y;\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    for (j = 0; j < changdu2; j++)\n      media[i][j] = x[i + j];\n  }\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    if (strcmp(media[i], y) == 0) {\n      p = i;\n      break;\n    }\n  }\n  if (i >= changdu1 - changdu2 + 1) {\n    for (i = 0; i < changdu1; i++)\n      printf(\"%c\", x[i]);\n  } else {\n    strcpy(media[p], z);\n    if (p != 0) {\n      for (i = 0; i < p; i++)\n        printf(\"%c\", x[i]);\n      printf(\"%s\", media[p]);\n      if (changdu2 > changdu3)\n        m = changdu2;\n      else\n        m = changdu3;\n      for (i = p + m; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    } else {\n      printf(\"%s\", media[p]);\n      for (i = p + changdu3; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], sub[300], re[300];\n  int lenstr, lensub;\n  int i, j, k;\n\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s \", re);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == sub[0]) {\n      for (j = i, k = 0; k < lensub; j++, k++)\n        if (str[j] != sub[k])\n          break;\n      if (k == lensub) {\n        for (j = i, k = 0; k < lensub; j++, k++)\n          str[j] = re[k];\n        break;\n      }\n    }\n  }\n\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "11830", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, la, lb, lc, aaa;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  aaa = 0;\n  for (i = 0; i <= la - 1; i++) {\n\n    for (j = 0; (j <= lb - 1) && (i + j <= la - 1); j++) {\n      if (a[i + j] == b[j]) {\n        if (j == lb - 1) {\n          aaa = 1;\n        }\n      } else {\n        break;\n      }\n    }\n    if (aaa == 1) {\n      break;\n    }\n  }\n  if (aaa == 1) {\n    for (j = 0; j <= lc - 1; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "11831", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  cin >> a >> b >> c;\n  int i, j, m, k = 0, la = strlen(a), lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = i;\n      for (j = 1; j < lb; j++) {\n        m++;\n        if (a[m] != b[j])\n          break;\n      }\n      if (j == lb) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 0)\n    cout << a;\n  else {\n    for (i = 0; i < m; i++)\n      cout << a[i];\n    printf(\"%s\", c);\n    for (i = m + lb; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> e;\n  k = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d && a[l]; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        cout << s;\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  scanf(\"%s \", substring);\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n    if (i >= m && i < b + m) {\n      printf(\"%c\", replacement[i - m]);\n    } else {\n      cout << string[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11834", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[260], sub[260], re[260];\n  int i, len1, len2, m, xxx, yyy = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    xxx = 0;\n    for (m = 0; m < len2; m++) {\n      if (s[i + m] == sub[m])\n        xxx++;\n    }\n    if (xxx == len2) {\n      for (m = 0; m < len2; m++) {\n        s[i + m] = re[m];\n        yyy++;\n        if (yyy == len2)\n          break;\n      }\n      if (yyy == len2)\n        break;\n    }\n  }\n\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[50], b[50];\n\n  int i, lenb, n, j, flag;\n  int k = 10001;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = (int)strlen(b);\n\n  for (i = 0; i <= (int)strlen(s); i++, flag = 0) {\n    for (n = 0, j = i; a[n] != '\u0000'; n++, j++) {\n      if (s[j] != a[n]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      continue;\n    else {\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (i == k) {\n      printf(\"%s\", b);\n      i = i + lenb - 1;\n      continue;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char t[256], s[256], r[256];\n  int lt, ls, i = 0, j = 0, p;\n  scanf(\"%s%s%s\", s, t, r);\n  lt = strlen(t);\n  ls = strlen(s);\n  while (i < lt && j < ls) {\n    if (t[i] == s[j]) {\n      i++;\n      j++;\n    } else {\n      j = j - i + 1;\n      p = j;\n      i = 0;\n    }\n  }\n  if (i == lt)\n    for (i = 0; i < lt; i++) {\n      s[i + p] = r[i];\n    }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "11837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[266];\n  int i, k, len, n, m, j = 0;\n  char yuan[20], mb[20], kd[20];\n  cin >> sz >> yuan >> mb;\n  m = strlen(sz);\n  n = strlen(yuan);\n  for (i = 0; i < m; i++) {\n    if (sz[i] != yuan[0]) {\n      printf(\"%c\", sz[i]);\n    } else {\n      for (k = i; k < i + n; k++) {\n        kd[k - i] = sz[k];\n      }\n      kd[n] = '\\0';\n\n      if (strcmp(kd, yuan) == 0) {\n        printf(\"%s\", mb);\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", sz[k]);\n        }\n        break;\n\n      } else {\n        cout << sz[i];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11838", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], sub[1000], rep[1000];\n  int len1, len2, len3, i, j, k;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(rep);\n  for (j = 0; j < len2; j++)\n\n    for (i = 0; i < len1; i++) {\n      if (str[i] != sub[0])\n        continue;\n\n      if (str[i] == sub[0] && str[i + 1] == sub[1] && str[i + 2] == sub[2] &&\n          str[i + 3] == sub[3])\n        break;\n    }\n  if (i < len1)\n    for (k = i; k < i + len2; k++)\n      str[k] = rep[k - i];\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar zfc[3][257];\nint main() {\n\n  cin >> zfc[1];\n\n  scanf(\"%s \", zfc);\n\n  cin >> zfc[3];\n  int i, k, len, len2, j;\n  len = strlen(zfc[1]);\n  len2 = strlen(zfc[2]);\n  for (i = 0; i < len; i++) {\n    if ((zfc[1][i] == zfc[2][0]) && (zfc[1][i + 1] == zfc[2][1]))\n      break;\n  }\n  if (i != len) {\n    for (k = i; k < (len2 + i); k++) {\n      j = k - i;\n      zfc[1][k] = zfc[3][j];\n      if (k == len2 + i)\n        break;\n    }\n  }\n  cout << zfc[1];\n  return 0;\n}\n"}
{"label": "7", "index": "11840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  int n, m;\n  int i, j, k = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0] && s[i + m - 1] == a[m - 1]) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        cout << b;\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "11841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  int x;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  x = strstr(string, substring) - &string[0];\n  if (strchr(string, substring[0]) != 0)\n    memmove(string + x, replacement, strlen(replacement));\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "11842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, f, l, k;\n  char s1[260], s2[260], s3[260];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  m = strlen(s1);\n  n = strlen(s2);\n  l = strlen(s3);\n  for (i = 0; i < m; i++) {\n    f = 1;\n    for (j = 0; j < n; j++)\n      if (s1[i + j] != s2[j]) {\n        f = 0;\n        break;\n      }\n    if (f == 1) {\n      k = i;\n      break;\n    }\n  }\n  if (f == 0)\n    puts(s1);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", s1[i]);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", s3[i]);\n    for (i = k + l; i < m; i++)\n      printf(\"%c\", s1[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[300], b[300], replace[300];\n  scanf(\"%s %s %s \", a, b, replace);\n  char *p;\n  int alen, blen, relen, i;\n  p = strstr(a, b);\n  if (p == NULL)\n    cout << a << endl;\n  else {\n    alen = strlen(a);\n    blen = strlen(b);\n    relen = strlen(replace);\n    for (i = 0; &a[i] != p; i++)\n      cout << a[i];\n    cout << replace;\n    i += blen;\n    for (; i < alen - blen + relen; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, h = 0;\n  char a[100], b[100], c[100];\n  scanf(\"%s%s%s\", a, b, c);\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0]) {\n      h = 0;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[j + i] == b[j]) {\n          h++;\n        }\n      }\n      if (h == strlen(b)) {\n        for (j = 0; j < strlen(c); j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a1[257 * 2], a2[257], b1[257];\n  int i, j, k, start = 0, end = 0;\n\n  cin >> a1;\n\n  cin >> a2;\n\n  cin >> b1;\n  for (i = 0; a1[i] != 0; i++) {\n    if (a1[i] == a2[0]) {\n      for (j = i + 1, k = 1; a2[k] != 0; j++, k++) {\n        if (a1[j] != a2[k]) {\n          break;\n        }\n      }\n      if (a2[k] == 0) {\n        start = i;\n        end = j;\n        break;\n      }\n    }\n  }\n  if (start < end) {\n    for (i = start, k = 0; b1[k] != 0; i++, k++)\n      a1[i] = b1[k];\n\n    for (j = end; a1[j] != 0; i++, j++) {\n      a1[i] = a1[j];\n    }\n    a1[i] = 0;\n  }\n  printf(a1);\n  return 0;\n}\n"}
{"label": "7", "index": "11846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin >> string >> substring >> replacement;\n  int i, j = 0, length1, length2, m, num = 0;\n  length1 = strlen(string);\n  length2 = strlen(substring);\n  for (i = 0; i < length1; i++) {\n    m = i;\n    if (string[i] == substring[j]) {\n\n      for (j = 0; j < length2; j++) {\n        if (string[i] == substring[j]) {\n          i++;\n          num++;\n        }\n      }\n    }\n    j = 0;\n    i = m;\n    if (num == length2) {\n      for (j = 0; j < length2; j++) {\n        string[i] = replacement[j];\n        i++;\n      }\n      break;\n    }\n    num = 0;\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char s[100], c[100], a[100];\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> a;\n  k = strlen(s);\n  p = strlen(c);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    for (j = 0; j < p; j++, i++) {\n      if (s[i] != c[j])\n        break;\n    }\n    if (j > p - 1) {\n      for (j = 0; j < p; j++, i++) {\n        s[i - p] = a[j];\n      }\n      break;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%c\", s[i]);\n}\n"}
{"label": "7", "index": "11848", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = -2;\n  int lengths, lengtha, lengthb;\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n\n  for (i = 0; i < lengths; i++) {\n    k = 0;\n    for (j = 0; j < lengtha; j++) {\n      if (a[j] == s[i + j]) {\n        k++;\n      }\n    }\n\n    if (k == lengtha) {\n      t = i;\n      break;\n    }\n  }\n  if (t != -2) {\n    for (i = 0; i < t; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = t + lengthb; i < lengths; i++)\n      printf(\"%c\", s[i]);\n\n  } else {\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11849", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int d[1000];\n  int i, j = 0, k, m, n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == '\u0000')\n      break;\n    else {\n      if (a[i] == b[0]) {\n        j++;\n        d[j] = i;\n      }\n    }\n  }\n  if (j == 0)\n    printf(\"%s\", a);\n  else {\n    m = j;\n    for (i = 0;; i++) {\n      if (b[i] == '\u0000')\n        break;\n    }\n    n = i;\n    for (j = 0; j < m; j++) {\n      k = d[j];\n      for (i = 0; i < n; i++) {\n        if (b[i] != a[i + k])\n          break;\n      }\n      if (i == n)\n        break;\n    }\n    for (i = 0; i < n; i++) {\n      a[i + d[j]] = c[i];\n    }\n    printf(\"%s\", a);\n  }\n}\n"}
{"label": "7", "index": "11850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n = 0, m;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n    }\n    if (n == m - 1) {\n      for (j = 0; j < m; j++)\n        a[i + j] = c[j];\n      break;\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "11851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char s[256], z[256], r[256];\n  int i;\n  cin.getline(s, 256);\n  cin.getline(z, 256);\n  cin.getline(r, 256);\n  char *p = strstr(s, z);\n  if (p == NULL)\n    cout << s;\n  else {\n    char *q = s;\n    for (i = 0; i < (p - q); i++)\n      cout << s[i];\n    cout << r;\n    p = p + (strlen(z));\n    while (*p != '\\0') {\n      cout << *p;\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11852", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char origin[256], sub[256], replace[256], after[256];\n  scanf(\"%s%s%s\", origin, sub, replace);\n\n  int i, j, k = 0;\n\n  for (i = 0; origin[i]; i++) {\n    int shouldChange = 1;\n    for (j = 0; sub[j]; j++) {\n      if (origin[i + j] != sub[j])\n        shouldChange = 0;\n    }\n    if (shouldChange == 1) {\n      strcpy(after, origin);\n      after[i] = 0;\n      strcat(after, replace);\n      strcat(after, &origin[i + strlen(sub)]);\n      strcpy(origin, after);\n      i += strlen(replace);\n      break;\n    }\n  }\n  printf(\"%s\", origin);\n  return 0;\n}\n"}
{"label": "7", "index": "11853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  int i;\n  int b, c;\n  char *p;\n\n  scanf(\"%s%s%s\", str1, str2, str3);\n\n  b = strlen(str2);\n\n  p = strstr(str1, str2);\n\n  if (p)\n\n  {\n    for (i = 0; str1 + i < p; i++) {\n      printf(\"%c\", str1[i]);\n    }\n    printf(\"%s\", str3);\n\n    p = p + b;\n\n    printf(\"%s\", p);\n\n  }\n\n  else\n    printf(\"%s\", str1);\n}\n"}
{"label": "7", "index": "11854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], a[256], b[256], c[256];\n  int i, j, t = 0;\n  scanf(\"%s %s %s\", str, a, b);\n  for (i = 0; i < strlen(str); i++) {\n    for (j = 0; j < strlen(a); j++)\n      c[j] = str[i + j];\n    c[j] = '\\0';\n    if (strcmp(c, a) == 0) {\n      t = 1;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; j < strlen(b); j++)\n      cout << b[j];\n    for (j = i + strlen(a); str[j] != 0; j++)\n      printf(\"%c\", str[j]);\n  } else\n    printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11855", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s \", c);\n  int lenth1, lenth2, i, j, t;\n  lenth1 = strlen(a);\n  lenth2 = strlen(b);\n  for (i = 0; i <= lenth1 - 1; i++) {\n    t = i;\n    for (j = 0; j <= lenth2 - 1;) {\n\n      if (a[t] == b[j]) {\n        t = t + 1;\n        j = j + 1;\n\n      } else\n        break;\n    }\n    if (j == lenth2)\n      break;\n  }\n  for (j = 0; j < lenth2; j++, i++)\n    a[i] = c[j];\n  for (i = 0; i < lenth1; i++)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257];\n  char sub[257];\n  char rep[257];\n  int i = 0, j = 0, k = 0, a;\n\n  cin >> str;\n\n  cin >> sub;\n\n  scanf(\"%s \", rep);\n  a = strlen(sub);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[j]) {\n      j++;\n      if (j == a) {\n        k = i;\n        break;\n      }\n    } else\n      j = 0;\n  }\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (i == k - a + 1) {\n      printf(\"%s\", rep);\n      i = k;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j;\n  int m, n;\n  scanf(\"%s \", string);\n  for (i = 0; string[i] != '\u0000';) {\n    i++;\n  }\n  m = i;\n  scanf(\"%s \", substr);\n  for (i = 0; substr[i] != '\u0000';)\n    i++;\n\n  n = i;\n  scanf(\"%s \", replace);\n  for (i = 0; i < m; i++) {\n    if (string[i] == substr[0]) {\n      for (j = 0; j < n; j++) {\n        if (string[i + j] != substr[j])\n          break;\n      }\n      if (j == n) {\n        for (j = 0; j < n; j++)\n          string[i + j] = replace[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "11858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000];\n\n  scanf(\"%s \", s);\n  int i, j, k, m, x = 0;\n  char a[1000];\n\n  cin >> a;\n  char b[1000];\n\n  cin >> b;\n  i = strlen(a);\n  for (j = 0; s[j] != '\u0000'; j++) {\n    if (a[0] == s[j]) {\n      for (k = 1; k < i; k++) {\n        if (a[k] != s[j + k]) {\n          break;\n        }\n      }\n    }\n    if (k == i) {\n      for (m = 0; m < j; m++) {\n        printf(\"%c\", s[m]);\n      }\n      printf(\"%s\", b);\n      for (m = i + j; s[m] != '\u0000'; m++) {\n        printf(\"%c\", s[m]);\n      }\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11859", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200], b[300], c[300];\n  int d = 0, i, j, k, m, n, lenb, lena;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; j < i + lenb, k < lenb; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == lenb)\n        d = 1;\n    }\n    if (d == 1)\n      break;\n  }\n  if (d == 1) {\n    for (m = i, n = 0; m < i + lenb, n < lenb; m++, n++) {\n      a[m] = c[n];\n    }\n    printf(\"%s\", a);\n  }\n  if (d == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11860", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char origin[256], sub[256], replace[256], after[256];\n  scanf(\"%s%s%s\", origin, sub, replace);\n\n  int i, j, k = 0;\n\n  for (i = 0; origin[i]; i++) {\n    int shouldChange = 1;\n    for (j = 0; sub[j]; j++) {\n      if (origin[i + j] != sub[j]) {\n        shouldChange = 0;\n      }\n    }\n    if (shouldChange == 1) {\n      strcpy(after, origin);\n      after[i] = 0;\n      strcat(after, replace);\n      strcat(after, &origin[i + strlen(sub)]);\n      strcpy(origin, after);\n      i += strlen(replace);\n      break;\n    }\n  }\n  printf(\"%s\", origin);\n  return 0;\n}\n"}
{"label": "7", "index": "11861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  char *p;\n  int lenth, d, i;\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  scanf(\"%s\", c);\n  p = strstr(a, b);\n  lenth = strlen(b);\n  d = strlen(a);\n  if (p != NULL) {\n    for (i = 0; i < lenth; p++, i++)\n      *p = c[i];\n  }\n  for (i = 0; i < d; i++)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint strnl(char *, char *);\nvoid replace(char *str, int len_ss, int start, char *rpl);\n\nint main() {\n  char str[256], substr[256], rpl[256];\n  int start;\n  cin >> str >> substr >> rpl;\n  start = strnl(str, substr);\n  if (start != -1)\n    replace(str, strlen(substr), start, rpl);\n  else\n    printf(\"%s\\n\", str);\n  return 0;\n}\n\nint isstart(int i, char *s, char *subs) {\n  char temp[256];\n  char *p, *pt;\n  p = s + i;\n  pt = temp;\n  int j;\n  for (j = 0; j < strlen(subs); j++)\n    *pt++ = *p++;\n  *pt = 0;\n  if (!strcmp(temp, subs))\n    return 1;\n  return 0;\n}\n\nint strnl(char *s, char *subs) {\n  int i;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (isstart(i, s, subs))\n      return i;\n  return -1;\n}\n\nvoid replace(char *str, int len_ss, int start, char *rpl) {\n  char temp[256];\n  strcpy(temp, str);\n  char *ptmp, *prpl;\n  ptmp = temp + start;\n  prpl = rpl;\n  while (*prpl)\n    *ptmp++ = *prpl++;\n  char *pstr = str + start + len_ss;\n  while (*pstr)\n    *ptmp++ = *pstr++;\n  *ptmp = 0;\n  strcpy(str, temp);\n  cout << temp << \"\\n\";\n}\n"}
{"label": "7", "index": "11863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[100][50], x[256], d[256];\n  int i, n1, n2, k, m, n, want = -1;\n  scanf(\"%s%s%s\", a, b, d);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n = n1 - n2 + 1;\n  for (k = 0; k < n; k++) {\n    m = k;\n    for (i = 0; i < n2; i++, m++) {\n      x[i] = a[m];\n    }\n    strcpy(c[k], x);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(b, c[i]) == 0) {\n      want = i;\n      break;\n    }\n  }\n  if (want == 0) {\n    printf(\"%s\", d);\n    for (i = n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n  }\n  if (want > 0 && want < (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n    for (i = want + n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == -1) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  int temp;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      zichuan[j] = zfc1[j + i];\n    }\n    if (strcmp(zichuan, zfc2) == 0) {\n      flag = 1;\n      temp = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  } else {\n    for (k = 0; k < temp; k++)\n      printf(\"%c\", zfc1[k]);\n\n    printf(\"%s\", zfc3);\n    for (t = temp + len2; zfc1[t] != '\\0'; t++) {\n      cout << zfc1[t];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300], s[100], r[100];\n  int i, j, k, m;\n  cin >> str >> s >> r;\n  m = strlen(s);\n  for (i = 0; str[i] != '\\0'; i++) {\n    k = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == s[j])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j] = r[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11866", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[300], b[300], c[300];\n  char *p, *q;\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  len = strlen(b);\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL) {\n    cout << a;\n  } else {\n    while (q < p) {\n      cout << *q;\n      q++;\n    }\n    q = p + len;\n    cout << c;\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int lenth = 0;\n  int judge = 0;\n  for (int i = 0; substring[i] != '\\0'; i++) {\n    lenth++;\n  }\n  for (int i = 0; i < 256; i++) {\n    if (string[i] == substring[0]) {\n      int count;\n      for (count = 0; substring[count] != '\\0'; count++) {\n        if (string[i + count] != substring[count]) {\n          break;\n        }\n      }\n      if (count == lenth) {\n        for (int j = 0; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        printf(\"%s\", replacement);\n        for (int j = i + lenth; string[j] != '\\0'; j++) {\n          printf(\"%c\", string[j]);\n        }\n        judge = 1;\n        break;\n      }\n    }\n  }\n  if (judge == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int la, lb, i, j, n, k, x, p;\n  char a[100], b[100], c[100], d[100];\n  scanf(\"%s %s %s\", a, b, d);\n  la = strlen(a);\n  lb = strlen(b);\n  n = la - lb;\n  for (i = 0; i <= n; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      p = i;\n      for (j = 0; j < lb; j++) {\n        c[j] = a[k];\n        k++;\n      }\n      c[lb] = '\\0';\n      if (strcmp(c, b) == 0) {\n        for (x = 0; x < lb; x++) {\n          a[p] = d[x];\n          p++;\n        }\n        break;\n      }\n    } else {\n      continue;\n    }\n  }\n\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a, b, c;\n  c = 0;\n  char t[256] = {0};\n  char s[256] = {0};\n  char r[256] = {0};\n  char z[256] = {0};\n  scanf(\"%s %s %s\", t, s, r);\n  a = strlen(t);\n  b = strlen(s);\n  for (i = 0; i <= a - b; i++) {\n    for (j = i; j < b + i; j++)\n      z[j - i] = t[j];\n    if (strcmp(z, s) == 0) {\n      c = i;\n      break;\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < a; i++)\n      printf(\"%c\", t[i]);\n  } else {\n    for (i = 0; i < c; i++)\n      printf(\"%c\", t[i]);\n    printf(\"%s\", r);\n    for (j = c + b; j < a; j++)\n      printf(\"%c\", t[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char subString[256];\n  char replacement[256];\n  char result[256];\n  int L1, L2, L3;\n  int i, j, t = 1, flag = 0;\n  int l, m, n;\n\n  cin >> string;\n\n  cin >> subString;\n\n  cin >> replacement;\n  L1 = strlen(string);\n  L2 = strlen(subString);\n  L3 = strlen(replacement);\n  for (i = 0; i < L1; i++) {\n    for (j = 0; j < L2; j++) {\n      if (subString[j] != string[j + i]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      for (l = 0; l < i; l++) {\n        result[l] = string[l];\n      }\n      m = 0;\n      for (l = i; m < L3; l++, m++) {\n        result[l] = replacement[m];\n      }\n      for (n = i + L2; n < L1; n++, l++) {\n        result[l] = string[n];\n      }\n      result[l] = '\u0000';\n      flag = 1;\n      break;\n    }\n    t = 1;\n  }\n\n  if (flag == 1)\n    cout << result;\n  if (flag == 0) {\n    cout << string;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11871", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char all[257], sub[257], re[257];\n  int i, j, k, p, q, r, s;\n\n  cin >> all >> sub >> re;\n\n  int flag;\n  for (i = 0; all[i] != '\\0'; i++) {\n    flag = 1;\n    for (j = 0, k = i; sub[j] != '\\0'; k++, j++) {\n      if (all[k] != sub[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 1) {\n    int c = strlen(re);\n\n    for (p = k, q = c; all[p] != '\\0'; p++, q++)\n      re[q] = all[p];\n    re[q] = '\\0';\n\n    for (r = 0, s = i; re[r] != '\\0'; r++, s++)\n      all[s] = re[r];\n    all[s] = '\\0';\n  }\n  cout << all << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, j = 0, l1, l2, e = 0;\n  char a[256], b[256], c[256], d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  l1 = strlen(b);\n  l2 = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (e == 0) {\n      if (a[i] == b[j]) {\n        d[j] = a[i];\n        j++;\n      } else {\n        if (j != 0 && e != 1) {\n          d[j] = '\\0';\n          printf(\"%s\", d);\n        }\n        j = 0;\n        printf(\"%c\", a[i]);\n      }\n      if (j == l1 && e == 0) {\n        printf(\"%s\", c);\n        i = i - l1 + l2;\n        e = 1;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str1[257], str2[257], str3[257];\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n\n  int i;\n  int j;\n  int k;\n  for (i = 0; i < strlen(str1); i++) {\n    j = 0;\n    k = i;\n    while (j < strlen(str2)) {\n      if (str2[j] != str1[k])\n        break;\n      else\n        j++;\n      k++;\n    }\n    if (j == strlen(str2)) {\n      printf(\"%s\", str3);\n      break;\n    } else\n      cout << str1[i];\n  }\n  if (i != strlen(str1)) {\n    for (i = k; i < strlen(str1); i++)\n      printf(\"%c\", str1[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  scanf(\"%s %s %s \", a, b, c);\n  char *p, *q;\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL)\n    printf(\"%s\", a);\n  else {\n    while (q != p) {\n      cout << *q;\n      q++;\n    }\n    printf(\"%s\", c);\n    q = q + strlen(c);\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n  for (i = 0; i < n - k + 2; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (dec == 0) {\n      cout << rep;\n      break;\n    } else if ((i != n - 1) && (dec != 0)) {\n      printf(\"%c\", zfc[i]);\n      continue;\n    } else if ((i == n - 1) && (dec != 0)) {\n      printf(\"%c \", zfc[i]);\n    }\n  }\n  if (i == n - k + 2) {\n    printf(\"%s \", &(zfc[i]));\n  } else {\n    printf(\"%s \", &(zfc[i + k]));\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11876", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c, d, str1[256], str2[256], str3[256];\n  int l, h, i, j = 0, k, st = 0;\n  scanf(\"%s\", str1);\n  cin >> str2;\n  scanf(\"%s\", str3);\n  l = strlen(str2);\n  for (i = 0; ((c = str2[i]) != '\\0'); i++) {\n    c = str2[i];\n    for (; ((d = str1[j]) != '\\0'); j++) {\n      d = str1[j];\n      if (c == d) {\n        st = st + 1;\n        j = j + 1;\n        break;\n      } else if ((c != d) && (st != 0)) {\n        st = 0;\n        i = -1;\n        break;\n      }\n    }\n  }\n  if (st == l) {\n    for (h = 0, k = (j - l); k < j; k++, h++)\n      str1[k] = str3[h];\n\n    printf(\"%s\\n\", str1);\n  } else\n    printf(\"%s\\n\", str1);\n}\n"}
{"label": "7", "index": "11877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  char str[256], sub[256], replace[20];\n  char *p;\n  int len1, len2, len3, i, m;\n  cin >> str;\n  cin >> sub;\n  cin >> replace;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(replace);\n  p = strstr(str, sub);\n  if (p != NULL) {\n    if (len2 > len3) {\n      m = len2 - len3;\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      for (i = 0; *(p + m + i) != str[len1 - 1]; i++)\n        *p = *(p + m);\n      len1 -= m;\n    }\n    if (len2 == len3) {\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n    }\n    if (len2 < len3) {\n      m = len3 - len2;\n      for (i = len1 - 1; str[i] != *(p + m - 1); i--)\n        str[i + m] = str[i];\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      len1 += m;\n    }\n  }\n  for (i = 0; i < len1; i++)\n    cout << str[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf[100], zf1[100], zf2[100];\n  int i, j, k;\n\n  scanf(\"%s \", zf);\n\n  scanf(\"%s \", zf1);\n\n  cin >> zf2;\n  k = strlen(zf1);\n  for (i = 0; zf[i] != 0; i++) {\n\n    for (j = 0; zf1[j] != 0; j++) {\n      if (zf1[j] != zf[i + j]) {\n        break;\n      }\n    }\n    if (j == (k)) {\n      for (j = 0; zf2[j] != 0; j++) {\n        zf[i + j] = zf2[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "11879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000];\n\n  cin >> s;\n  int i, j, k, m, x = 0;\n  char a[1000];\n\n  cin >> a;\n  char b[1000];\n\n  cin >> b;\n  i = strlen(a);\n  for (j = 0; s[j] != '\u0000'; j++) {\n    if (a[0] == s[j]) {\n      for (k = 1; k < i; k++) {\n        if (a[k] != s[j + k]) {\n          break;\n        }\n      }\n    }\n    if (k == i) {\n      for (m = 0; m < j; m++) {\n        printf(\"%c\", s[m]);\n      }\n      printf(\"%s\", b);\n      for (m = i + j; s[m] != '\u0000'; m++) {\n        printf(\"%c\", s[m]);\n      }\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n\n  int wz = -1;\n  int len1, len2;\n  int i, j, x;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    if (str[i] == sub[0]) {\n      x = 1;\n      wz = i;\n      for (j = 0; j < len2; i++, j++) {\n        if (sub[j] != str[i]) {\n          x = 0;\n          i = wz;\n\n          break;\n        }\n      }\n      if (x != 0) {\n        break;\n      }\n    }\n  }\n  if (wz == -1) {\n    cout << str;\n  } else {\n    for (i = 0; i < wz; i++) {\n      cout << str[i];\n    }\n    printf(\"%s\", rep);\n    for (i += len2; i < len1; i++) {\n      cout << str[i];\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "11881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int n, m, i, j, k, d;\n  for (i = 0; i < 256; i++) {\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n    c[i] = '\u0000';\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n\n  m = 0;\n  n = 0;\n  d = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    m++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    d++;\n  }\n\n  int h = 0;\n  i = 0;\n  while (a[i] != '\u0000') {\n    if (a[i] == b[0]) {\n      j = 0;\n      h = i;\n      k = 0;\n      while (a[i] == b[j] && a[i] != '\u0000') {\n\n        k++;\n        i++;\n        j++;\n      }\n      if (k == n) {\n        int t = 0;\n        for (t = 0; t < d; t++) {\n          a[h + t] = c[t];\n        }\n        break;\n      }\n    } else\n      i++;\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, length1, length2, k, h;\n  k = 0;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length2; i++) {\n    if (s1[0] == s2[i]) {\n      j = 0;\n      while (s2[j + i] == s1[j] && j < length1)\n        j++;\n      if (j == length1)\n        k = i;\n    }\n    if (k)\n      break;\n  }\n  h = k;\n  if (k) {\n    for (h = k; h < k + length1; h++)\n      s2[h] = s3[h - k];\n  }\n  cout << s2;\n}\n"}
{"label": "7", "index": "11883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, m;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n  m = strlen(s1);\n  a = strlen(s2);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < a; j++) {\n      if (s2[j] != s1[i + j]) {\n        break;\n      }\n    }\n    if (j == a) {\n      for (j = 0; j < a; j++)\n        s1[i + j] = s3[j];\n\n      break;\n    };\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "11884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], d[300], r[300];\n  int i = 0, j, k, ls, lr, ld;\n  int flag = 0;\n  int cont = 0;\n  cin >> s;\n  cin >> d;\n  cin >> r;\n  ls = strlen(s);\n  ld = strlen(d);\n  lr = strlen(r);\n  for (i = 0; i < ls;) {\n    flag = 0;\n    for (j = 0; j < ld; j++) {\n      if (s[i + j] == d[j])\n        flag++;\n      if (flag == ld)\n        cont++;\n    }\n\n    if (flag == ld && cont == 1) {\n      cont++;\n      for (k = 0; k < lr; k++) {\n        s[i + k] = r[k];\n      }\n      i = i + lr;\n      continue;\n    } else {\n      i++;\n      continue;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int len1, len2, i, j, x, tag = 0;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s1[j] != s2[j - i]) {\n        break;\n      }\n      if (j == i + len2 - 1) {\n        tag = 1;\n        x = i;\n      }\n    }\n    if (tag) {\n      break;\n    }\n  }\n  if (tag) {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s3);\n    for (i = x + len2; i < len1; i++) {\n      printf(\"%c\", s1[i]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11886", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  for (int i = 0; a[i] != '\\0'; i++) {\n    int j;\n    for (j = 0; (b[j] == a[i + j]) && (b[j] != '\\0'); j++)\n      ;\n    if (b[j] == '\\0') {\n      for (int k = 0; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      for (int k = i + j; a[k] != '\\0'; k++)\n        printf(\"%c\", a[k]);\n      return 0;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j = 0, k, t = 0, l, p, h, n, m;\n  char str[3][600];\n  for (i = 0; i < 3; i++)\n    cin >> str[i];\n  m = strlen(str[1]);\n  n = strlen(str[0]);\n  p = strlen(str[2]);\n  for (i = 0; i < n - m + 1, j < m; i++) {\n    if (str[0][i] == str[1][j]) {\n      t++;\n      j++;\n    } else {\n      j = 0;\n      t = 0;\n    }\n    if (t == m)\n      break;\n  }\n  if (t != m) {\n    printf(\"%s\", str[0]);\n  } else {\n    for (l = i - m + 1, h = 0; h < p; h++, l++)\n      str[0][l] = str[2][h];\n    cout << str[0];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], z[256], r[256];\n  int i;\n  cin.getline(s, 256);\n  cin.getline(z, 256);\n  cin.getline(r, 256);\n  char *p = strstr(s, z);\n  if (p == NULL) {\n    cout << s;\n  } else {\n    char *q = s;\n    for (i = 0; i < (p - q); i++) {\n      cout << s[i];\n    }\n    cout << r;\n    p = p + (strlen(z));\n    while (*p != '\\0') {\n      cout << *p;\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  void copy(char a[], char b[], char c[]);\n  char S[100], sub[100], re[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(re);\n  int m, k;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        cout << re;\n        for (k = i + b; k < a; k++) {\n          printf(\"%c\", S[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n  return 0;\n}\n"}
{"label": "7", "index": "11890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar substring[256] = {0};\nchar S[256] = {0};\nchar replacement[256] = {0};\n\nint main() {\n\n  while (cin >> S) {\n    cin >> substring;\n    cin >> replacement;\n\n    char *p = strstr(S, substring);\n    char *q = NULL;\n\n    int i = 0;\n\n    if (p != NULL) {\n      for (q = S; q < p; q++) {\n        cout << *q;\n      }\n      cout << replacement;\n      for (q = p + strlen(substring); *q != '\\0'; q++) {\n        cout << *q;\n      }\n      printf(\"\\n\");\n      memset(S, 0, 256);\n      memset(substring, 0, 256);\n      memset(replacement, 0, 256);\n    }\n\n    else if (p == NULL) {\n      cout << S << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11891", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, e;\n  char s[256];\n  char b[256];\n  char a[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int c;\n  i = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    j = 0;\n    c = 0;\n    e = i;\n    if (s[i] == a[j]) {\n      for (; a[j] != '\u0000'; j++, i++) {\n        if (a[j] != s[i]) {\n          c++;\n        }\n      }\n      if (c == 0) {\n        for (j = 0; a[j] != '\u0000'; j++, e++) {\n          s[e] = b[j];\n        }\n        break;\n      }\n    }\n    i = e;\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], d[100];\n  char *p, c[100], c1[100], c2[100];\n  int i, k, ls, lc;\n\n  cin >> s;\n\n  scanf(\"%s \", c);\n\n  cin >> d;\n\n  p = strstr(s, c);\n  ls = strlen(s);\n  lc = strlen(c);\n  int lsc = p - s;\n  if (p) {\n    for (i = 0; i < lsc; i++) {\n      c1[i] = s[i];\n    }\n    c1[i] = '\u0000';\n    k = 0;\n    for (i = i + lc; i < ls; i++, k++) {\n      c2[k] = s[i];\n    }\n    c2[k] = '\u0000';\n    printf(\"%s\", c1);\n    printf(\"%s\", d);\n    printf(\"%s\", c2);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11893", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  cin >> str >> sub >> rep;\n  int len = strlen(sub);\n  int i = 0;\n  char *p, *q, *r;\n  p = strstr(str, sub);\n  q = rep;\n  if (p != NULL) {\n    for (r = p; r < p + len; r++)\n      *r = *q++;\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char a[300], b[300], c[300];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  p = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++)\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; k < p; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == p) {\n        for (j = i, k = 0; k < p; j++, k++)\n          a[j] = c[k];\n        printf(\"%s\", a);\n        break;\n      }\n    }\n  if (a[i] == '\u0000')\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar substring[256] = {0};\nchar S[256] = {0};\nchar replacement[256] = {0};\n\nint main() {\n\n  while (cin >> S) {\n    cin >> substring;\n    cin >> replacement;\n\n    char *p = strstr(S, substring);\n    char *q = NULL;\n\n    int i = 0;\n\n    if (p != NULL) {\n      for (q = S; q < p; q++) {\n        cout << *q;\n      }\n      cout << replacement;\n      for (q = p + strlen(substring); *q != '\\0'; q++) {\n        cout << *q;\n      }\n      cout << endl;\n      memset(S, 0, 256);\n      memset(substring, 0, 256);\n      memset(replacement, 0, 256);\n    }\n\n    else if (p == NULL) {\n      cout << S << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256], final[500];\n  int i, j, k, length, length1, length2, a, flag = 0;\n  cin >> string;\n  cin >> substring;\n  scanf(\"%s\", replacement);\n  length = strlen(string);\n  length1 = strlen(substring);\n  length2 = strlen(replacement);\n  for (i = 0, j = 0; string[i] != '\\0'; i++) {\n    if (string[i] == substring[j]) {\n      a = i;\n      if (string[a + 1] == substring[j + 1]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 1) {\n    for (k = 0; k <= a - 1; k++)\n      *(final + k) = *(string + k);\n    for (k = a; k < a + length2; k++)\n      *(final + k) = *(replacement + k - a);\n    for (k = a + length2; k < length + length2 - length1; k++)\n      *(final + k) = *(string + k + length1 - length2);\n    *(final + length + length2 - length1) = '\\0';\n    for (k = 0; final[k] != '\\0'; k++) {\n      printf(\"%c\", final[k]);\n    }\n  } else if (flag == 0) {\n    for (i = 0, j = 0; string[i] != '\\0'; i++)\n      printf(\"%c\", string[i]);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf1[257], zf2[257], zf3[257];\n  int len1, len2, len3, i, k, t, m, fa = 0;\n  scanf(\"%s%s%s\", zf1, zf2, zf3);\n  len1 = strlen(zf1);\n  len2 = strlen(zf2);\n  len3 = strlen(zf3);\n  for (i = 0; i < len1; i++) {\n    for (k = 0; k < len2; k++) {\n      if (zf2[k] != zf1[i + k]) {\n        t = 0;\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (t == len2) {\n      m = i;\n      fa = 1;\n    }\n    if (fa == 1) {\n      break;\n    }\n  }\n  if (fa == 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n    printf(\"%s\", zf3);\n    for (i = m + len2; i < len1; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n  }\n  if (fa == 0) {\n    printf(\"%s\", zf1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11898", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int i, j, k;\n\n  cin >> s;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = i; j < strlen(sub) + i; j++) {\n      if (s[j] != sub[j - i])\n        break;\n      if (j == strlen(sub) + i - 1) {\n        for (k = j; k >= i; k--)\n          s[k] = re[k - i];\n      }\n    }\n    if (j == strlen(sub) + i)\n      break;\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, len3, count, c = 0;\n\n  scanf(\"%s \", s1);\n\n  scanf(\"%s \", s2);\n\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  len3 = strlen(s3);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2)\n      break;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%c\", s1[j]);\n  if (i != len1)\n    cout << s3;\n  for (j = i + len2; j < len1; j++)\n    printf(\"%c\", s1[j]);\n  return 0;\n}\n"}
{"label": "7", "index": "11900", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, y, m, t;\n  char b[1000], a[1000], c[1000];\n  scanf(\"%s\", b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", c);\n\n  for (y = 0; i < 1000; y++) {\n    if (a[y] == '\u0000')\n      break;\n  }\n\n  for (i = 0; i < 1000; i++) {\n    m = 0;\n    for (j = i; j - i < y; j++) {\n      if (a[j - i] == b[j])\n        m++;\n    }\n    if (m >= y)\n      break;\n  }\n\n  for (t = i; c[t - i] != 0 && t < 256; t++) {\n    b[t] = c[t - i];\n    if (c[t - i] == '\u0000')\n      break;\n  }\n  puts(b);\n  return 0;\n}\n"}
{"label": "7", "index": "11901", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  int m, n, i, j, e, k;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    e = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == sub[j])\n        e++;\n    }\n    if (e == m)\n      break;\n  }\n  if (e == m) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", rep);\n    for (k = i + m; k < n; k++)\n      printf(\"%c\", str[k]);\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11902", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k = 0, l, m0, m1, a[100], flag = 0;\n  char str[3][300];\n  for (i = 0; i < 3; i++)\n    cin >> str[i];\n  m0 = strlen(str[0]);\n  m1 = strlen(str[1]);\n  for (i = 0, j = 0; i < m0, j < m1; i++) {\n    if (str[0][i] == str[1][j]) {\n      j++;\n      flag++;\n      if (flag == m1) {\n        k = i - m1;\n        break;\n      }\n    } else {\n      j = 0;\n      flag = 0;\n    }\n  }\n  if (flag == m1) {\n    for (i = k + 1, j = 0; i < k + m1 + 1; i++, j++)\n      str[0][i] = str[2][j];\n    printf(\"%s\", str[0]);\n  } else\n    printf(\"%s\", str[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "11903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  char c[101];\n  int i, j;\n  int length1, length2, length3;\n  int p;\n  scanf(\"%s%s%s\", a, b, c);\n  length1 = strlen(a);\n  length2 = strlen(b);\n  length3 = strlen(c);\n  for (i = 0; i < length1; i++) {\n    if (a[i] == b[0]) {\n      p = 0;\n      for (j = 1; j < length2; j++) {\n        if (a[i + j] != b[j]) {\n          p = 1;\n          break;\n        }\n      }\n      if (p == 0) {\n        for (j = 0; j < i; j++) {\n          cout << a[j];\n        }\n        for (j = 0; j < length3; j++) {\n          printf(\"%c\", c[j]);\n        }\n        for (j = i + length3; j < length1; j++) {\n          printf(\"%c\", a[j]);\n        }\n        p = 2;\n        break;\n      }\n    }\n  }\n  if (p != 2) {\n    for (i = 0; i < length1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100] = {'\u0000'}, w[50] = {'\u0000'}, d[50] = {'\u0000'}, h[100] = {'\u0000'};\n  int i, j, k = 0, t = 0, m, n = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == w[0]) && (n == 0)) {\n      k = 0;\n      for (j = 0; w[j] != '\u0000'; j++) {\n        t = 0;\n        if (w[j] == s[i + j]) {\n          k++;\n          t = 1;\n        }\n      }\n      if (t == 1) {\n        for (m = 0; d[m] != '\u0000'; m++) {\n          cout << d[m];\n        }\n        i = i + k;\n        n = 1;\n      }\n    }\n    if (s[i] != '\u0000') {\n      cout << s[i];\n    }\n  }\n}\n"}
{"label": "7", "index": "11905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, k, m;\n  char s[256], s1[256], s2[256];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  a = strlen(s);\n  b = strlen(s1);\n  c = strlen(s2);\n  for (i = 0; i < a; i++) {\n    if (s[i] == s1[0]) {\n      for (j = 0; j < b; j++) {\n        if (s[i + j] != s1[j])\n          break;\n      }\n      if (s[i + b - 1] == s1[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          cout << s[k];\n        printf(\"%s\", s2);\n        for (k = i + b; k < a; k++)\n          cout << s[k];\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "11906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l1, l2, l3, sum;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  sum = 0;\n  l1 = strlen(b);\n  l2 = strlen(c);\n  l3 = strlen(a);\n  for (i = 0; i < l3; i++) {\n    for (j = i, k = 0; k < l1; k++) {\n      if (a[j] != b[k])\n        break;\n      j++;\n    }\n    if (k == l1 && sum == 0) {\n      for (j = 0; c[j] != '\u0000'; j++)\n        printf(\"%c\", c[j]);\n      i = i + l1 - 1;\n      sum = sum + 1;\n    } else\n      cout << a[i];\n  }\n}\n"}
{"label": "7", "index": "11907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], w[300], r[300], d[300];\n  int i, j, l, h;\n  scanf(\"%s%s%s\", s, w, r);\n  l = strlen(s);\n  h = strlen(w);\n  for (i = 0; i <= l - h; i++) {\n    for (j = 0; j < h; j++) {\n      d[j] = s[i + j];\n    }\n    d[h] = '\\0';\n    if (strcmp(d, w) == 0)\n      break;\n  }\n  if (i == l - h + 1)\n    cout << s;\n  else {\n    for (j = i; j < i + h; j++) {\n      s[j] = r[j - i];\n    }\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n, l;\n  char s[256], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == a[0]) {\n      k = i;\n      l = i;\n      for (j = 0; j < strlen(a); j++, k++) {\n        if (a[j] != s[k]) {\n          break;\n        }\n      }\n      if (j == strlen(a)) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < l; i++) {\n      cout << s[i];\n    }\n    printf(\"%s\", b);\n    for (n = l + strlen(a); n < strlen(s); n++) {\n      cout << s[n];\n    }\n  } else if (m == 0) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], ow[256], rw[256];\n  cin >> s >> ow >> rw;\n  int lens, lenow;\n  int i, j, k, l, t, flag;\n  lens = strlen(s);\n  lenow = strlen(ow);\n  for (i = 0; i <= (lens - lenow); i++) {\n    flag = 1;\n    for (j = 0; j < lenow; j++) {\n      if (s[i + j] != ow[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag != 0) {\n      t = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (k = 0; k < t; k++) {\n      printf(\"%c\", s[k]);\n    }\n    printf(\"%s\", rw);\n    for (l = t + lenow; l < lens; l++) {\n      printf(\"%c\", s[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char yuanchuan[257];\n  char zichuan[257];\n  char replacement[257];\n  int i, j, k;\n  int len1, len2;\n  cin >> yuanchuan >> zichuan >> replacement;\n  len1 = strlen(yuanchuan);\n  len2 = strlen(zichuan);\n  k = len1;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (yuanchuan[i + j] != zichuan[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        k = i;\n      }\n    }\n    if (k != len1) {\n      break;\n    }\n  }\n  if (k == len1) {\n    printf(\"%s\", yuanchuan);\n  } else {\n    for (i = 0; i < k; i++) {\n      cout << yuanchuan[i];\n    }\n    printf(\"%s\", replacement);\n    for (i = k + len2; i < len1; i++) {\n      printf(\"%c\", yuanchuan[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char M[3][20];\n  scanf(\"%s\", M[0]);\n  if (M[0][0] == 'i')\n    printf(\"iloveearth\");\n  else if (M[0][0] == 's')\n    cout << \"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\";\n  else {\n    cout << \"programmingiscool\";\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int x, y, i, j, p, q, k, r, t, z;\n  x = strlen(a);\n  y = strlen(b);\n  q = 0;\n  for (i = 0; q == 0 && i < x; i++) {\n    if (b[0] == a[i]) {\n      p = i;\n      for (j = 0; b[j] == a[p] && b[j] != '\u0000' && a[p] != '\u0000'; j++) {\n        p++;\n      }\n      if (j == y) {\n        q = q + 1;\n      }\n    }\n  }\n  if (q == 0) {\n    for (z = 0; z < x; z++) {\n      cout << a[z];\n    }\n  }\n  if (q != 0) {\n    for (k = 0; k < i - 1; k++) {\n      printf(\"%c\", a[k]);\n    }\n    for (r = 0; r < y; r++) {\n      printf(\"%c\", c[r]);\n    }\n    for (t = i + y - 1; t < x; t++) {\n      printf(\"%c\", a[t]);\n    }\n  }\n}\n"}
{"label": "7", "index": "11913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k, m, j, tag = 1, jieshu = 1;\n  char zfc[257], dth[257], bth[257], danci[257];\n  int zhyw = 0;\n\n  cin >> zfc;\n\n  scanf(\"%s \", dth);\n\n  cin >> bth;\n  n = strlen(zfc);\n  m = strlen(dth);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == dth[0]) {\n      for (k = 1; k < m; k++) {\n        if (zfc[i + k] != dth[k])\n          tag = 0;\n      }\n      if (tag) {\n        printf(\"%s\", bth);\n        for (j = i + m; j < n; j++)\n          printf(\"%c\", zfc[j]);\n        jieshu = 0;\n      }\n      tag = 1;\n    }\n    if (jieshu) {\n      printf(\"%c\", zfc[i]);\n    }\n    if (jieshu == 0)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c, k = 1;\n  char s[300], w[300], t[300];\n  cin >> w;\n  scanf(\"%s\", s);\n  cin >> t;\n  int l1 = strlen(s);\n  int l2 = strlen(w);\n  int l3 = strlen(t);\n  for (i = 0; i < l2; i++) {\n    c = 0;\n    for (j = 0; j < l1; j++) {\n      if (!(s[j] == w[j + i])) {\n        c = 1;\n        break;\n      }\n    }\n    if ((!c) && (k)) {\n      for (j = i; j < i + l3; j++) {\n        w[j] = t[j - i];\n      }\n      k = 0;\n    }\n  }\n  cout << w;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int sum = 0, i, j, k, n, m, h = 0, y = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  k = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 0; j < m; j++) {\n        if (b[j] == a[i + j])\n          sum++;\n      } \n      if (sum == m && y == 0) {\n        for (j = 0; j < k; j++)\n          d[h + j] = c[j];\n        i = i + m;\n        h = h + k;\n        y = 1;\n      }\n      sum = 0;\n    }\n    d[h] = a[i];\n    h++;\n  }\n  d[h] = '\u0000';\n  printf(\"%s \", d);\n  return 0;\n}\n"}
{"label": "7", "index": "11916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int n = 0, q = 0;\n  for (int i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    q++;\n  }\n  int i, j, k, p;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    int m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i + j] == b[j])\n        m++;\n    }\n    if (m == n)\n      break;\n  }\n  if (i == q)\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  else {\n    for (k = 0; c[k] != '\u0000'; k++) {\n      a[k + i] = c[k];\n    }\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11917", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300], subStr[10], re[10];\n  int i, j, lenth, m, n;\n  int flag = 0;\n  cin >> str >> subStr >> re;\n  lenth = strlen(str);\n  n = strlen(subStr);\n  m = strlen(re);\n  for (i = 0; i < lenth; i++) {\n    j = 0;\n    if (str[i] == subStr[j]) {\n      for (j = 0; j < n; j++) {\n        if (str[i] == subStr[j])\n          i++;\n        else\n          break;\n      }\n    }\n    if (j == n) {\n      flag = 1;\n      for (; j > 0; i--, j--) {\n        str[i - 1] = re[j - 1];\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, lch, lsub, lre;\n  char ch[256];\n  char subch[256];\n  char replace[256];\n  cin >> ch;\n  cin >> subch;\n  cin >> replace;\n  lch = strlen(ch);\n  lsub = strlen(subch);\n  lre = strlen(replace);\n  for (i = 0; i < lch; i++) {\n    if (ch[i] == subch[0]) {\n      for (j = 0; j < lsub; j++) {\n        if (ch[i + j] != subch[j])\n          break;\n      }\n      if (j == lsub) {\n        for (k = 0; k < lsub; k++) {\n          ch[i + k] = replace[k];\n        }\n        break;\n      }\n    }\n  }\n  for (i = 0; i < lch; i++) {\n    cout << ch[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], sub[500], rep[500];\n  int n, m, cut, i = 0, flag = 0;\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  cut = strlen(rep);\n  while (str[i] != '\\0') {\n    if (str[i] == sub[0]) {\n      int j = 0;\n      int k = i;\n      while (sub[j] != '\\0') {\n        if (sub[j] == str[k]) {\n          j++;\n          k++;\n        } else\n          break;\n      }\n      if (j == m) {\n        for (int t = n - 1; t >= i + m; t--)\n          str[t + cut - m] = str[t];\n\n        str[n + cut - m] = '\\0';\n        for (int t = i; t < i + cut; t++)\n          str[t] = rep[t - i];\n\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    i++;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "11920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  cin >> y;\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    for (j = 0; j < changdu2; j++)\n      media[i][j] = x[i + j];\n  }\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    if (strcmp(media[i], y) == 0) {\n      p = i;\n      break;\n    }\n  }\n  if (i >= changdu1 - changdu2 + 1) {\n    for (i = 0; i < changdu1; i++)\n      printf(\"%c\", x[i]);\n  } else {\n    strcpy(media[p], z);\n    if (p != 0) {\n      for (i = 0; i < p; i++)\n        printf(\"%c\", x[i]);\n      printf(\"%s\", media[p]);\n      if (changdu2 > changdu3)\n        m = changdu2;\n      else\n        m = changdu3;\n      for (i = p + m; i < changdu1; i++)\n        cout << x[i];\n      printf(\"\\n\");\n    } else {\n      printf(\"%s\", media[p]);\n      for (i = p + changdu3; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100];\n  int n, k, j = 0, i, s, d;\n\n  cin >> words;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(words);\n  s = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (strncmp(words + i, a, s) == 0) {\n      for (j = i, k = 0; k < d; j++, k++) {\n        words[j] = b[k];\n      }\n      break;\n    }\n  }\n  puts(words);\n  return 0;\n}\n"}
{"label": "7", "index": "11922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j, m, control = 0;\n  char st[256], sub[256], re[256];\n\n  cin >> st;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(st);\n  len2 = strlen(sub);\n  int k = 0;\n  for (i = 0, j = 0; i < len1; i++) {\n    if (k == 0 && sub[j] == st[i]) {\n      if (len2 == 1) {\n        for (m = 0; m < i; m++)\n          printf(\"%c\", st[m]);\n        printf(\"%s\", re);\n        for (m = m + 1; m < len1; m++)\n          printf(\"%c\", st[m]);\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    } else if (k != 0 && sub[j] != st[i]) {\n      k = 0;\n      j = 0;\n    } else if (k != 0 && sub[j] == st[i]) {\n      if (j == len2 - 1) {\n        for (m = 0; m < i - j; m++)\n          cout << st[m];\n        printf(\"%s\", re);\n        for (m = m + len2; m < len1; m++)\n          printf(\"%c\", st[m]);\n        printf(\" \");\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    }\n  }\n  if (control == 0)\n    puts(st);\n  return 0;\n}\n"}
{"label": "7", "index": "11923", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  int i, j, k = 0, len1, len2, flag, m, t, q;\n  cin >> b >> a >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len2; i++) {\n    flag = 1;\n    q = 1;\n    if (b[i] == a[0]) {\n      k = i + 1;\n      for (j = 1; j < len1; j++) {\n        if (b[k++] != a[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        t = 0;\n        for (m = i; m < i + len1; m++)\n          b[m] = c[t++];\n        q = 0;\n      }\n    }\n    if (q == 0)\n      break;\n  }\n  printf(\"%s\\n\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "11924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], zc[50], th[50];\n  int i, j, t = 0, n, m;\n\n  cin >> str;\n\n  cin >> zc;\n\n  scanf(\"%s \", th);\n  n = strlen(zc);\n  m = strlen(th);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == zc[0]) {\n      for (j = 1; j < n; j++) {\n        if (str[i + j] == zc[j]) {\n          j++;\n          t = 1;\n          continue;\n        } else\n          t = 0;\n        break;\n      }\n    }\n    if (t) {\n      for (j = 0; j < m; j++) {\n        str[i + j] = th[j];\n      }\n\n      break;\n    }\n  }\n\n  puts(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, lena, lenb, m, n, k;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    m = 0;\n    for (j = i; j < i + lenb; j++) {\n      if (b[j - i] != a[j])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++) {\n        d[n] = a[n];\n      }\n      d[n] = '\\0';\n      for (k = i + lenb; k < lena; k++)\n        e[k - i - lenb] = a[k];\n\n      e[k - i - lenb] = '\\0';\n      cout << d << c << e;\n      break;\n    }\n  }\n  if (m == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int result = 0;\n  int a, b, c, i, d, e = 0, f, g, h, j, k;\n  int len[256];\n\n  cin >> str;\n\n  scanf(\"%s \", sub);\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(sub);\n  c = strlen(rep);\n  for (i = 0; i < a; i++) {\n    for (d = 0; d < b - 1; d++) {\n      if ((str[i + d] == sub[d]) && (str[i + d + 1] == sub[d + 1])) {\n        result = 1;\n        len[e] = i;\n        e++;\n      }\n      break;\n    }\n  }\n  f = len[0];\n  if (result == 1) {\n    for (g = 0; g < f; g++) {\n      printf(\"%c\", str[g]);\n    }\n    for (h = 0; h < c; h++) {\n      printf(\"%c\", rep[h]);\n    }\n    for (j = 0; j < a - f - b; j++) {\n      printf(\"%c\", str[f + b + j]);\n    }\n  } else {\n    if (result == 0) {\n      puts(str);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11927", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], word1[100], word2[100];\n  scanf(\"%s %s %s \", a, word1, word2);\n  int la, l1, l2, i, j, k, flag;\n  la = strlen(a);\n  l1 = strlen(word1);\n  l2 = strlen(word2);\n  for (i = 0; i < la; i++) {\n    if (a[i] == word1[0]) {\n      for (j = 0; j < l1; j++) {\n        flag = 1;\n        if (a[i + j] != word1[j])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (k = 0; k < l2; k++) {\n          a[i + k] = word2[k];\n        }\n      }\n      if (flag == 1) {\n        printf(\"%s\\n\", a);\n        break;\n      }\n    }\n    if (i == la - 1) {\n      printf(\"%s\\n\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  char *p;\n  p = strstr(a, b);\n  if (p) {\n    int n = strlen(a) - strlen(p);\n    int i;\n    int k = strlen(b);\n    int l = strlen(c);\n    int m = 0;\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = n; i < n + l; i++) {\n      cout << c[m];\n      m++;\n    }\n    for (i = n + k; i < (strlen(a)); i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint bd(char *hed, char *zi, int m) {\n  int val = 0, j;\n  char *t1, *t2;\n  for (t1 = hed, t2 = zi, j = 0; j < m; t1++, t2++, j++) {\n    if (*t1 == *t2)\n      val = 1;\n    else {\n      val = 0;\n      break;\n    }\n  }\n  return (val);\n}\nint main() {\n  char *yuan, *zi, *rep, *med;\n  yuan = (char *)malloc(260 * sizeof(char));\n  zi = (char *)malloc(260 * sizeof(char));\n  rep = (char *)malloc(260 * sizeof(char));\n  med = (char *)malloc(260 * sizeof(char));\n\n  scanf(\"%s \", yuan);\n\n  scanf(\"%s \", zi);\n\n  cin >> rep;\n\n  char *p;\n  int n, m, zhi = 0, t;\n\n  for (p = yuan, n = 0; *p != '\u0000'; p++, n++)\n    ;\n  for (p = zi, m = 0; *p != '\u0000'; p++) {\n    m++;\n  }\n  for (p = rep, t = 0; *p != '\u0000'; p++)\n    t++;\n\n  for (p = yuan; p < yuan + n - m + 1; p++)\n    if (bd(p, zi, m) == 1) {\n      zhi = 1;\n      break;\n    }\n\n  if (zhi == 1) {\n    strcpy(med, p + m);\n    strcpy(p, rep);\n    strcpy(p + t, med);\n  }\n  puts(yuan);\n}\n"}
{"label": "7", "index": "11930", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[256], sub[256];\nint f(int x) {\n  int i = x, j = 0;\n  while (sub[j] != '\\0') {\n    if (str[i] != sub[j])\n      return 0;\n    i++;\n    j++;\n  }\n  return 1;\n}\nint main() {\n  char rep[256];\n  int i = 0, j = 0;\n  cin >> str;\n  cin >> sub;\n  scanf(\"%s \", rep);\n  while (str[i] != '\\0') {\n    if (f(i)) {\n      while (rep[j] != '\\0') {\n        str[i] = rep[j];\n        i++;\n        j++;\n      }\n      break;\n    }\n    i++;\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], d[100];\n  char *p, c[100], c1[100], c2[100];\n  int i, k, ls, lc;\n\n  cin >> s;\n\n  scanf(\"%s \", c);\n\n  cin >> d;\n\n  p = strstr(s, c);\n  ls = strlen(s);\n  lc = strlen(c);\n  int lsc = p - s;\n  if (p) {\n    for (i = 0; i < lsc; i++) {\n      c1[i] = s[i];\n    }\n    c1[i] = '\u0000';\n    k = 0;\n    for (i = i + lc; i < ls; i++, k++) {\n      c2[k] = s[i];\n    }\n    c2[k] = '\u0000';\n    cout << c1;\n    printf(\"%s\", d);\n    printf(\"%s\", c2);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int i, j, k, n, m, f, q;\n  cin >> s1;\n  cin >> s2;\n  scanf(\"%s\", s3);\n  m = strlen(s2);\n  n = strlen(s1);\n  for (i = 0; i < strlen(s1); i++) {\n    f = 0;\n    for (j = 0; j < strlen(s2); j++)\n      if (s2[j] != s1[i + j]) {\n        f = 1;\n        break;\n      }\n    if (f == 0) {\n      q = i;\n      break;\n    }\n  }\n  if (f == 1)\n    printf(\"%s\\n\", s1);\n  else {\n    for (k = 0; k < q; k++)\n      cout << s1[k];\n    printf(\"%s\", s3);\n    for (k = q + m; k < n; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  char a[250], b[150], c[150];\n  cin >> a >> b >> c;\n  if (strstr(a, b) == NULL) {\n    cout << a;\n    return 0;\n  }\n  char *p = strstr(a, b);\n  int i = 0;\n  while (c[i] != '\\0') {\n    *p++ = c[i];\n    i++;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256], substr[256], replace[256];\n  cin >> str >> substr >> replace;\n  int lenstr = strlen(str), lensubstr = strlen(substr),\n      lenreplace = strlen(replace);\n  int i, j;\n  int flag = 0; \n  int pos;      \n  for (i = 0; i <= lenstr - lensubstr; i++) {\n    for (j = 0; j < lensubstr; j++) {\n      if (str[i + j] != substr[j]) \n        break;                     \n    }\n    if (j == lensubstr) \n    {\n      pos = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) \n  {\n    for (i = 0; i < pos; i++)\n      cout << str[i];                        \n    cout << replace;                         \n    cout << (str + pos + lensubstr) << endl; \n  } else\n    cout << str << endl; \n  return 0;\n}\n"}
{"label": "7", "index": "11935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], c[256], l[256], g[20], h[20];\n  int b, i, e = 0, q, p, j, k;\n\n  cin >> a;\n  b = strlen(a);\n\n  cin >> h;\n\n  cin >> g;\n  q = strlen(h);\n  for (i = 0; i < b; i++) {\n    if (a[i] == h[0]) {\n      p = 1;\n      for (j = 1; j < q; j++) {\n        if (a[i + j] != h[j]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (k = 0; k < i; k++) {\n          c[k] = a[k];\n          c[k + 1] = '\u0000';\n        }\n        l[0] = -1;\n        for (k = i + q; k < b; k++) {\n          l[k - i - q] = a[k];\n          l[k - i - q + 1] = '\u0000';\n        }\n        strcat(c, g);\n        if (l[0] != -1) {\n          strcat(c, l);\n        }\n        strcpy(a, c);\n        b = strlen(a);\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11936", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300], sub[300], rep[300], tmp[300];\n  scanf(\"%s %s %s \", str, sub, rep);\n  int i, j, l1 = strlen(str), l2 = strlen(sub);\n  int flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      tmp[j] = str[j + i];\n    }\n    tmp[l2] = '\\0';\n    if (strcmp(tmp, sub) == 0 && flag == 0) {\n      printf(\"%s\", rep);\n      flag = 1;\n      i += l2 - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "11937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], yuan[100], xin[100];\n  int i = 0, j = 0, len, lenyuan, lenxin;\n\n  scanf(\"%s \", s);\n\n  cin >> yuan;\n\n  cin >> xin;\n  len = strlen(s);\n  lenyuan = strlen(yuan);\n  lenxin = strlen(xin);\n  for (i = 0; i < len; i++) {\n    if (s[i] == yuan[0] && s[lenyuan + i - 1] == yuan[lenyuan - 1]) {\n      for (j = 0; j < lenxin; j++) {\n        s[i + j] = xin[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11938", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300], sub[300], re[300];\n  int lenstr, lensub;\n  int i, j, k;\n\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == sub[0]) {\n      for (j = i, k = 0; k < lensub; j++, k++)\n        if (str[j] != sub[k])\n          break;\n      if (k == lensub) {\n        for (j = i, k = 0; k < lensub; j++, k++)\n          str[j] = re[k];\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[256], b[256], tmp[256];\n  int i, lenstr, lena;\n  char *pstr;\n\n  cin >> str;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  lenstr = strlen(str);\n  lena = strlen(a);\n\n  for (i = 0; i <= lenstr - lena; i++) {\n    pstr = &str[i];\n    strncpy(tmp, pstr, lena);\n    tmp[lena] = '\u0000';\n\n    if (strcmp(tmp, a) == 0) {\n      str[i] = '@';\n      break;\n    }\n  }\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == '@') {\n      printf(\"%s\", b);\n      i = i + lena - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "11940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], w[256], z[256];\n  int ls, lw, t, lz;\n  int i, j, loc = -1;\n  scanf(\"%s%s%s\", w, s, z);\n  ls = strlen(s);\n  lw = strlen(w);\n  lz = strlen(z);\n  for (i = 0; i < lw; i++) {\n    t = 0;\n    for (j = 0; j < ls; j++) {\n      if (w[i + j] == s[j])\n        t++;\n    }\n    if (t == ls) {\n      loc = i;\n      break;\n    }\n  }\n\n  if (loc != -1) {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", w[i]);\n    }\n\n    printf(\"%s\", z);\n    for (i = loc + lz; i < lw; i++) {\n      printf(\"%c\", w[i]);\n    }\n  } else {\n    puts(w);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "11941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char string[256], sub[256], replace[256], s[256], p[256];\n  int i, j, k, a, k0, k1, k2, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  k0 = strlen(string);\n  k1 = strlen(sub);\n  k2 = strlen(replace);\n  for (i = 0; i < k0; i++) {\n    for (j = i, k = 0; j < i + k1; j++, k++) {\n      p[k] = string[j];\n    }\n    p[k] = 0;\n\n    if (strcmp(sub, p) == 0) {\n      a = i;\n      for (i = 0; i < a; i++) {\n        s[i] = string[i];\n      }\n      for (i = k0 + k2 - k1, j = k0; i >= a + k2, j >= a + k1; i--, j--) {\n        s[i] = string[j];\n      }\n      for (i = a, j = 0; i < a + k2, j < k2; i++, j++) {\n        s[i] = replace[j];\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k0 + k2 - k1; i++) {\n      cout << s[i];\n    }\n    printf(\"\\n\");\n  }\n  if (flag == 0)\n    puts(string);\n  return 0;\n}\n"}
{"label": "7", "index": "11942", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], z[256], p[256];\n  cin >> s >> z >> p;\n  int i, ls, lz, lp, j, t = 0, loc = -1;\n  ls = strlen(s);\n  lz = strlen(z);\n  lp = strlen(p);\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = i; j < i + lz; j++) {\n      if (s[j] == z[j - i]) {\n\n        t++;\n      }\n    }\n\n    if (t == lz) {\n\n      loc = i;\n      i = ls;\n      j = lz;\n    }\n  }\n\n  if (loc == -1) {\n    puts(s);\n  }\n\n  else {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; i < lp; i++) {\n      printf(\"%c\", p[i]);\n    }\n    for (i = loc + lp; i < ls; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n\n  char string[256];\n  scanf(\"%s\", string);\n\n  char substring[256];\n  scanf(\"%s\", substring);\n\n  char replacement[256];\n  cin >> replacement;\n\n  int Lsub = 0;\n  for (int i = 0;; i++) {\n    if (substring[i] == '\u0000') {\n      Lsub = i;\n      break;\n    }\n  }\n\n  int Lrep = 0;\n  for (int i = 0;; i++) {\n    if (replacement[i] == '\u0000') {\n      Lrep = i;\n      break;\n    }\n  }\n\n  int pBegin = 1000, judge = 1;\n  for (int i = 0; i < 256 - Lsub; i++) {\n    judge = 1;\n    for (int j = i; j < i + Lsub; j++) {\n      if (string[j] - substring[j - i] != 0) {\n        judge = 0;\n        break;\n      }\n      if (j - i == Lsub - 1) {\n        break;\n      }\n    }\n    if (judge == 1) {\n      pBegin = i;\n      break;\n    }\n  }\n  if (pBegin == 1000) {\n    printf(\"%s\", string);\n  }\n\n  else {\n\n    char Ans[512];\n    for (int i = 0; i < pBegin; i++) {\n      Ans[i] = string[i];\n    }\n\n    for (int i = pBegin; i < pBegin + Lrep; i++) {\n      Ans[i] = replacement[i - pBegin];\n    }\n\n    for (int i = pBegin + Lrep;; i++) {\n      Ans[i] = string[i - (pBegin + Lrep) + pBegin + Lsub];\n      if (Ans[i] == '\u0000') {\n        break;\n      }\n    }\n\n    printf(\"%s\", Ans);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[100][50], x[256], d[256];\n  int i, n1, n2, k, m, n, want = -1;\n  scanf(\"%s%s%s\", a, b, d);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n = n1 - n2 + 1;\n  for (k = 0; k < n; k++) {\n    m = k;\n    for (i = 0; i < n2; i++, m++) {\n      x[i] = a[m];\n    }\n    strcpy(c[k], x);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(b, c[i]) == 0) {\n      want = i;\n      break;\n    }\n  }\n  if (want == 0) {\n    printf(\"%s\", d);\n    for (i = n2; i < n1; i++) {\n      cout << a[i];\n    }\n  }\n  if (want == (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n  }\n  if (want > 0 && want < (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n    for (i = want + n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == -1) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, L, l1, l2;\n  char s[300], a[300], b[300];\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n  }\n  for (k = i + l1; k < L; k++) {\n    printf(\"%c\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n    if (i >= m && i < b + m) {\n      printf(\"%c\", replacement[i - m]);\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[50], c[50];\n  int n, i, j, m, k, s = 0, d, e;\n  scanf(\"%s\\n%s\\n%s\", a, b, c);\n  n = strlen(b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    s = 0;\n    for (j = i, k = 0; k < n; j++, k++) {\n\n      if (a[j] != b[k]) {\n        s = 1;\n        break;\n      }\n    }\n    if (s == 0)\n      break;\n  }\n\n  if (s == 0) {\n    for (d = i, e = 0; d < i + n; d++, e++)\n      a[d] = c[e];\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n  scanf(\"%s\", &q);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int i = 0, j = 0, k = 0, s = 0, p = 0, qc, ac, bc, r, js = 0, sz[100] = {0},\n      x, y, z, npc;\n  qc = strlen(q);\n  ac = strlen(a);\n  bc = qc - ac;\n  for (i = 0; i < bc + 1; i++) {\n\n    for (j = 0; j < ac; j++) {\n      xc[i][j] = q[j + k];\n    }\n    k++;\n    p = strcmp(xc[i], a);\n    if (p == 0) {\n      sz[js] = i;\n      js++;\n    }\n    \n  }\n  npc = sz[0];\n\n  if (js == 0) {\n    printf(\"%s \", q);\n  }\n  if (js != 0) {\n    for (x = 0; x < npc; x++) {\n      printf(\"%c\", q[x]);\n    }\n    printf(\"%s\", b);\n    for (z = npc + ac; z < qc; z++) {\n      printf(\"%c\", q[z]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], subs[256], rpl[256];\n  int i, j, len1 = 0, len2 = 0, c = 0, m;\n  cin >> str >> subs >> rpl;\n  len1 = strlen(subs);\n  len2 = strlen(rpl);\n  for (i = 0; i < 256 && str[i] != 0; i++) {\n    if (str[i] == subs[0]) {\n      c = 0;\n      for (j = 0; j < len1; j++) {\n        if (str[i + j] != subs[j]) {\n          c = 1;\n          break;\n        } else {\n          c = c + 1;\n        }\n      }\n    }\n    if (c == len1)\n      break;\n  }\n  if (c == 0) {\n    for (m = 0; m < 256 && str[m] != 0; m++) {\n      cout << str[m];\n    }\n  }\n  if (c == len1) {\n    for (m = 0; m < i; m++) {\n      cout << str[m];\n    }\n    for (m = i; m < i + len2; m++) {\n      cout << rpl[m - i];\n    }\n    for (m = i + len2; m < 256 && str[m] != 0; m++) {\n      cout << str[m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11950", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n1, n2;\n  char s1[257], s2[257], s3[257];\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n\n  cin >> s3;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < n1; i++)\n    if (s1[i] == s2[0]) {\n      j = 0;\n      while (s1[i + j] == s2[j] && j < n2)\n        j++;\n      if (j == n2) {\n        for (k = i; k < i + n2; k++)\n          s1[k] = s3[k - i];\n        break;\n      }\n    }\n  for (i = 0; i < n1; i++)\n    printf(\"%c\", s1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void copy(char a[], char b[], char c[]);\n  char S[100], sub[100], re[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(re);\n\n  int m, k;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", re);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n}\n"}
{"label": "7", "index": "11952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[100], h[100], c[100];\n  int i, j, len[3], count = 0, k = 0, a[100];\n  scanf(\"%s\", &y);\n  scanf(\"%s\", &h);\n  scanf(\"%s\", &c);\n  for (i = 0; i < strlen(y); i++) {\n    for (j = 0; j < strlen(h); j++) {\n      if (y[i + j] == h[j]) {\n        count++;\n      }\n    }\n    if (count == strlen(h)) {\n      k++;\n      a[k] = i;\n    }\n    count = 0;\n  }\n  if (k == 0) {\n    printf(\"%s\", y);\n    return 0;\n  }\n  for (i = 0; i < a[1]; i++)\n    printf(\"%c\", y[i]);\n  printf(\"%s\", c);\n  if (i == k) {\n    return 0;\n  }\n  for (j = a[1] + strlen(h); j < strlen(y); j++)\n    printf(\"%c\", y[j]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11953", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a >> b >> c;\n  int i, j, k, nb, nc, count;\n  nb = 0;\n  nc = 0;\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; a[i + 1] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      count = 0;\n      k = i;\n      for (j = 0; j < nb; j++) {\n        if (a[k + j] == b[j]) {\n          count++;\n        } else {\n          break;\n        }\n      }\n      if (count == nb) {\n        for (j = 0; j < nc; j++) {\n          a[k + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "11954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s %s %s\", a, b, c);\n  int i, j, t, l, k = 0, m = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l - t + 1; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i + j] != b[j])\n        k = 0;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if (t == k) {\n        m = i;\n        i = l;\n      }\n    }\n  }\n  if (m == 0)\n    printf(\"%s\", a);\n  if (m != 0) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = m + t; i < l; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  cin >> s >> a >> b;\n  int i, j, n, k, m = 0, max;\n  for (i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    for (j = 0; j < strlen(a); j++) {\n      c[j] = s[i + j];\n    }\n    c[j + 1] = '\\0';\n    if (strcmp(c, a) == 0) {\n      break;\n    }\n    c[j] = 0;\n    m++;\n  }\n\n  if (strlen(b) > strlen(a)) {\n    max = strlen(b);\n  } else {\n    max = strlen(a);\n  }\n  if (m != strlen(s) - strlen(a) + 1) {\n    for (j = 0; j < max; j++) {\n      if (b[j] == '\\0') {\n        break;\n      }\n      s[i + j] = b[j];\n    }\n    cout << s;\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[500], w[500], e[500][500], c[500];\n  int i, j, m, n, k = 0;\n  scanf(\"%s %s %s\", w, s, c);\n  n = strlen(w);\n  m = strlen(s);\n  for (i = 0; w[i + m - 1] != '\\0'; i++) {\n    for (j = 0; j < m; j++) {\n      e[i][j] = w[i + j];\n    }\n    e[i][j] = '\\0';\n  }\n  for (i = 0; i < n - m + 1; i++) {\n    if (strcmp(e[i], s) == 0) {\n      k = 1;\n      break;\n    }\n  }\n  int a;\n  a = i;\n  if (k == 1) {\n    for (i = 0; i < m; i++) {\n      w[a + i] = c[i];\n    }\n    printf(\"%s\", w);\n  } else if (k == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, m;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n  m = strlen(s1);\n  a = strlen(s2);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < a; j++) {\n      if (s2[j] != s1[i + j])\n        break;\n    }\n    if (j == a) {\n      for (j = 0; j < a; j++) {\n        s1[i + j] = s3[j];\n      }\n      break;\n    };\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "11958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (s[i] == a[0]) {\n      k = 0;\n      for (j = 1; j < y; j++) {\n        if (s[i + j] != a[j])\n          k = 1;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < z; j++)\n        printf(\"%c\", b[j]);\n      for (i = i + y; i < x; i++)\n        printf(\"%c\", s[i]);\n      break;\n    }\n    if (k == 1)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "11960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257] = {'0'}, sub[257] = {'0'}, rep[257] = {'0'}, temp[257] = {'0'};\n  scanf(\"%s%s%s\", s, sub, rep);\n  int i, j, k, len1, len2, time;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, i++) {\n      temp[j] = s[i];\n    }\n    i = k;\n    if (strcmp(temp, sub) == 0) {\n      time = i;\n      break;\n    }\n  }\n  if (strcmp(temp, sub) == 0) {\n    for (i = time, j = 0; i < time + len2; i++, j++) {\n      s[i] = rep[j];\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cmp(int i, char a[], char b[]) {\n  int k;\n  for (k = 0; b[k] != '\u0000'; i++, k++) {\n    if (a[i] != b[k])\n      break;\n  }\n  if (b[k] == '\u0000')\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int i, n, k;\n  char s[256], subs[256], re[256];\n\n  cin >> s;\n\n  cin >> subs;\n\n  scanf(\"%s \", re);\n  for (i = 0, n = 0; n == 0 && s[i] != '\u0000'; i++) {\n    if (s[i] == subs[0])\n      n = cmp(i, s, subs);\n  }\n  if (n == 1) {\n    for (i = i - 1, k = 0; re[k] != '\u0000'; i++, k++)\n      s[i] = re[k];\n  }\n  printf(\"%s \", s);\n}\n"}
{"label": "7", "index": "11962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++) {\n        if (s1[i + j] == s2[j])\n          count++;\n      }\n    if (count == len2) {\n      for (j = 0; j < len2; j++)\n        s1[i + j] = s3[j];\n      c++;\n    }\n    if (c == 1)\n      break;\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "11963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], w[100], p[100], t[100];\n  int i, j, flag = 1;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (i = 0; i < strlen(w); i++) {\n    for (j = 0; j < strlen(s); j++)\n      p[j] = w[i + j];\n\n    flag = 1;\n    for (j = 0; j < strlen(s); j++) {\n      if (p[j] != s[j])\n        flag = 0;\n    }\n    if (flag != 0) {\n      for (j = 0; j < strlen(s); j++) {\n        w[i + j] = t[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "11964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  int i, j, m, k;\n  int n = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[0]) {\n      n = 0;\n      for (j = 0; b[j] != '\\0'; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n      if (m == n)\n        break;\n    }\n  }\n  if (m == n) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n\n    printf(\"%s\", c);\n    for (k = i + m; a[k] != '\\0'; k++)\n      cout << a[k];\n  }\n\n  if (n != m)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c;\n  c = 0;\n  char t[256] = {0};\n  char s[256] = {0};\n  char r[256] = {0};\n  char z[256] = {0};\n  scanf(\"%s %s %s\", t, s, r);\n  a = strlen(t);\n  b = strlen(s);\n  for (i = 0; i <= a - b; i++) {\n    for (j = i; j < b + i; j++)\n      z[j - i] = t[j];\n    if (strcmp(z, s) == 0) {\n      c = i;\n      break;\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < a; i++)\n      printf(\"%c\", t[i]);\n  } else {\n    for (i = 0; i < c; i++)\n      printf(\"%c\", t[i]);\n    printf(\"%s\", r);\n    for (j = c + b; j < a; j++)\n      printf(\"%c\", t[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int l, i, j, temp;\n  scanf(\"%s %s %s\", a, b, c);\n  l = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      temp = 0;\n      for (j = 0; j < l; j++) {\n        if (b[j] != a[j + i]) {\n          break;\n        }\n      }\n      if (j == l) {\n        for (j = 0; j < l; j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "11967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], sz[256];\n  cin >> str >> sub >> rep;\n  int a, b, c, tag;\n  a = strlen(sub);\n  c = strlen(str);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    tag = 0;\n    if (str[i] == sub[0]) {\n      for (j = 0; j < a; j++) {\n        sz[j] = str[i + j];\n      }\n      sz[a] = '\\0';\n    }\n    if (strcmp(sz, sub) == 0) {\n      b = i;\n      strcpy(sub, rep);\n      tag = 1;\n      break;\n    }\n  }\n  if (tag == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", sub);\n    for (i = b + a; i < c; i++) {\n      printf(\"%c\", str[i]);\n    }\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], c[256], l[256], g[20], h[20];\n  int b, i, e = 0, q, p, j, k;\n\n  scanf(\"%s \", a);\n  b = strlen(a);\n\n  cin >> h;\n\n  scanf(\"%s \", g);\n  q = strlen(h);\n  for (i = 0; i < b; i++) {\n    if (a[i] == h[0]) {\n      p = 1;\n      for (j = 1; j < q; j++) {\n        if (a[i + j] != h[j]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (k = 0; k < i; k++) {\n          c[k] = a[k];\n          c[k + 1] = '\u0000';\n        }\n        l[0] = -1;\n        for (k = i + q; k < b; k++) {\n          l[k - i - q] = a[k];\n          l[k - i - q + 1] = '\u0000';\n        }\n        strcat(c, g);\n        if (l[0] != -1) {\n          strcat(c, l);\n        }\n        strcpy(a, c);\n        b = strlen(a);\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "11969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i;\n  char *p;\n  scanf(\"%s %s %s \", a, b, c);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; i < p - a; i++)\n      cout << a[i];\n    cout << c;\n    for (p = p + strlen(b); p < a + strlen(a); p++)\n      printf(\"%c\", *p);\n  } else\n    cout << a;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  int i, j, m, n, k, t, q = 0, p = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i <= m - n; i++) {\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i])\n        p++;\n      else\n        break;\n    }\n    if (p == n) {\n      q++;\n      t = i;\n      for (j = 0; j <= t - 1; j++)\n        c[j] = s[j];\n      for (j = t; j < t + k; j++)\n        c[j] = b[j - i];\n      for (j = t + k; j < m - n + k; j++) {\n        c[j] = s[n + j - k];\n      }\n      c[m - n + k] = '\u0000';\n      puts(c);\n      break;\n    }\n    p = 0;\n  }\n  if (q == 0)\n    puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "11971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int n, m, i, j, k, d;\n  for (i = 0; i < 256; i++) {\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n    c[i] = '\u0000';\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n\n  m = 0;\n  n = 0;\n  d = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    m++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    d++;\n  }\n\n  int h = 0;\n  i = 0;\n  while (a[i] != '\u0000') {\n    if (a[i] == b[0]) {\n      j = 0;\n      h = i;\n      k = 0;\n      while (a[i] == b[j] && a[i] != '\u0000') {\n\n        k++;\n        i++;\n        j++;\n      }\n      if (k == n) {\n        int t = 0;\n        for (t = 0; t < d; t++) {\n          a[h + t] = c[t];\n        }\n        break;\n      }\n    } else\n      i++;\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "11972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  cin >> y;\n  cin >> z;\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  if (changdu1 < changdu2)\n    ;\n  else {\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      for (j = 0; j < changdu2; j++)\n        media[i][j] = x[i + j];\n    }\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      if (strcmp(media[i], y) == 0) {\n        p = i;\n        break;\n      }\n    }\n    if (i == changdu1 - changdu2 + 1)\n\n    {\n      printf(\"%s\", x);\n      return 0;\n    } else {\n      strcpy(media[p], z);\n      if (p != 0) {\n        for (i = 0; i < p; i++)\n          printf(\"%c\", x[i]);\n        printf(\"%s\", media[p]);\n        if (changdu2 > changdu3)\n          m = changdu2;\n        else\n          m = changdu3;\n        for (i = p + m; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        cout << \"\\n\";\n      } else {\n        printf(\"%s\", media[p]);\n        for (i = p + changdu3; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int q, w, e;\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  int i, j, k;\n  int result = 1, d;\n  for (k = 0; k < q; k++) {\n    if (a[k] == b[0]) {\n      result = 1;\n      for (i = k, j = 0; i < w + k, j < w; i++, j++) {\n        d = a[i] - b[j];\n        if (d != 0)\n          result = 0;\n      }\n      if (result) {\n        for (i = k, j = 0; j < e, i < w + k; i++, j++)\n          a[i] = c[j];\n\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "11974", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ls1, ls2, ls3, i, j = 0, m, lans = 0, z = 0;\n  char s1[100], s2[100], s3[100], ans[100];\n  scanf(\"%s\", s1);\n  scanf(\"%s \", s2);\n  scanf(\"%s\", s3);\n  ls1 = strlen(s1);\n  ls2 = strlen(s2);\n  ls3 = strlen(s3);\n  for (i = 0; i < ls1; i++) {\n\n    if (s1[i] != s2[0])\n      ans[lans++] = s1[i];\n    else {\n      for (j = 0, m = i; j < ls2; j++, m++) {\n        if (s1[m] != s2[j])\n          break;\n      }\n      if (j == ls2 && z != 1) {\n        i = m - 1;\n        for (j = 0; j < ls3; j++) {\n          ans[lans++] = s3[j];\n        }\n        z++;\n      } else {\n        for (; i <= m; i++)\n          ans[lans++] = s1[i];\n        i--;\n      }\n    }\n  }\n  ans[lans] = '\\0';\n  printf(\"%s\", ans);\n  return 0;\n}\n"}
{"label": "7", "index": "11975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int lenth1, lenth2, i, j, t;\n  lenth1 = strlen(a);\n  lenth2 = strlen(b);\n  for (i = 0; i <= lenth1 - 1; i++) {\n    t = i;\n    for (j = 0; j <= lenth2 - 1;) {\n\n      if (a[t] == b[j]) {\n        t = t + 1;\n        j = j + 1;\n\n      } else\n        break;\n    }\n    if (j == lenth2)\n      break;\n  }\n  for (j = 0; j < lenth2; j++, i++)\n    a[i] = c[j];\n  for (i = 0; i < lenth1; i++)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "11976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[256], z1[256], z2[256];\n  int i, j, k, n, p, count, count1, count2, count4, count3[50];\n  int num1, num2, d = 0;\n\n  cin >> zfc;\n\n  cin >> z1;\n\n  cin >> z2;\n  count = 0;\n  num1 = strlen(zfc);\n  num2 = strlen(z1);\n  for (i = 0; i < num1; i++) {\n    count1 = 0;\n    for (j = 0; j < num2; j++) {\n      if (zfc[i + j] == z1[j])\n        count1++;\n    }\n    if (count1 == num2)\n      break;\n  }\n  if (count1 == num2) {\n    for (j = i; j < num2 + i; j++) {\n      zfc[j] = z2[j - i];\n    }\n  }\n  printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "11977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[256] = {' '}, sstr[256] = {' '}, rpl[256] = {' '};\n  int lstr, lsstr;\n  scanf(\"%s%s%s\", str, sstr, rpl);\n  lstr = strlen(str);\n  lsstr = strlen(sstr);\n  int pst, curr, indi = 0;\n  for (pst = 0; pst <= lstr - lsstr; pst++) {\n    int state = 1;\n    for (curr = 0; curr < lsstr; curr++) {\n      if (sstr[curr] != str[curr + pst]) {\n        state = 0;\n        break;\n      }\n    }\n    if (state == 1) {\n      indi = 1;\n      break;\n    }\n  }\n  if (indi == 0)\n    printf(\"%s\", str);\n  else {\n    for (curr = 0; curr < pst; curr++) {\n      cout << str[curr];\n    }\n    for (curr = 0; curr < lsstr; curr++) {\n      printf(\"%c\", rpl[curr]);\n    }\n    for (curr = pst + lsstr; curr < lstr; curr++) {\n      printf(\"%c\", str[curr]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], w[256], r[256];\n  int l1, l2, i, j, count, k = 0;\n  scanf(\"%s%s%s\", w, s, r);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (i = 0; i < l2 - l1 + 1; i++) {\n    if (w[i] == s[0]) {\n      count = 1;\n      for (j = i + 1; j < i + l1; j++) {\n        if (w[j] != s[j - i])\n          break;\n        else\n          count++;\n      }\n      if (count == l1) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (j = i; j < i + l1; j++)\n      w[j] = r[j - i];\n  }\n  printf(\"%s\\n\", w);\n}\n"}
{"label": "7", "index": "11979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char all[257], sub[257], re[257];\n  int i, j, k, p, q, r, s;\n\n  cin >> all >> sub >> re;\n\n  int flag;\n  for (i = 0; all[i] != '\\0'; i++) {\n    flag = 1;\n    for (j = 0, k = i; sub[j] != '\\0'; k++, j++) {\n      if (all[k] != sub[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  if (flag == 1) {\n    int c = strlen(re);\n\n    for (p = k, q = c; all[p] != '\\0'; p++, q++) {\n      re[q] = all[p];\n    }\n    re[q] = '\\0';\n\n    for (r = 0, s = i; re[r] != '\\0'; r++, s++)\n      all[s] = re[r];\n    all[s] = '\\0';\n  }\n  cout << all << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "7", "index": "11980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[514], b[514], c[514], d[256];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, k, l, m, t, p, q;\n  l = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < l - m + 1; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      for (j = i, t = 0; j < i + m; j++, t++) {\n        if (a[j] != b[t]) {\n          k = 1;\n          break;\n        }\n      }\n      if (k == 0) {\n        p = i;\n        q = i + m;\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    for (i = q, j = 0; i < l; i++, j++) {\n      d[j] = a[i];\n    }\n    d[j] = 0;\n    strcat(c, d);\n    a[p] = 0;\n    strcat(a, c);\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  int i, k = 0, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int n = strlen(str);\n  int m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (sub[k] == str[i]) {\n      k++;\n    } else {\n      k = 0;\n      if (sub[k] == str[i])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j - m + 1] = re[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1000], substr[1000], replace[1000];\n  char *p, *q, *r, *start;\n  int len;\n  scanf(\"%s %s %s\", str, substr, replace);\n  len = strlen(substr);\n  for (p = str; *p != '\\0'; p++) {\n    for (q = p, r = substr; *r != '\\0'; q++, r++)\n      if (*q != *r)\n        break;\n    if (*r == '\\0') {\n      start = p;\n      break;\n    }\n  }\n  for (p = start, q = replace; *q != '\\0'; p++, q++)\n    *p = *q;\n  cout << str;\n}\n"}
{"label": "7", "index": "11983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256 + 16], tar[256 + 16], rep[256 + 16];\n  int a, b, i, j, k, c = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", tar);\n  scanf(\"%s\", rep);\n  a = strlen(s);\n  b = strlen(tar);\n  for (i = 0; i < a - b + 1; i++) {\n    for (j = 0; j < b; j++) {\n      if (tar[j] != s[i + j])\n        break;\n      if (j == b - 1) {\n        for (k = 0; k <= i - 1; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", rep);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "11984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i]) {\n          k++;\n        } else\n          break;\n      }\n    }\n    if (k == b) {\n      c = 1;\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n\n    if (i >= m && i < b + m && c == 1)\n      printf(\"%c\", replacement[i - m]);\n    else\n      printf(\"%c\", string[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11985", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[10000], subString[300], replacement[1000];\n  scanf(\"%s %s %s \", string, subString, replacement);\n  char *p, *q;\n  q = replacement;\n  p = strstr(string, subString);\n  if (p != NULL) {\n    while (*q) {\n      *p++ = *q++;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "11986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256] = {0}, subs[256] = {0}, rep[256] = {0}, front[256] = {0},\n       back[256] = {0};\n  int i = 0, x = 0, len1, len2, n = 0, m = 0, y = 0, flag = 0;\n  char a[256] = {0}, b[256] = {0};\n\n  cin >> str;\n\n  cin >> subs;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(subs);\n  for (i = 0; i < len1; i++) {\n    strcpy(a, b);\n    x = 0;\n    if (str[i] == subs[0]) {\n      m = i;\n      for (int j = m; j < len2 + m; j++) {\n        a[x] = str[j];\n        x++;\n      }\n      a[x] = '\u0000';\n    }\n    if (strcmp(a, subs) == 0) {\n      n = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    if (n != 0) {\n      for (i = 0; i < n; i++) {\n        front[i] = str[i];\n      }\n    }\n    if (n != len1 - len2) {\n      for (i = n + len2; i < len1; i++) {\n        back[y] = str[i];\n        y++;\n      }\n    }\n    printf(\"%s%s%s \", front, rep, back);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11987", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ls1, ls2, ls3, i, j = 0, m, lans = 0, z = 0;\n  char s1[100], s2[100], s3[100], ans[100];\n  scanf(\"%s\", s1);\n  cin >> s2;\n  scanf(\"%s\", s3);\n  ls1 = strlen(s1);\n  ls2 = strlen(s2);\n  ls3 = strlen(s3);\n  for (i = 0; i < ls1; i++) {\n\n    if (s1[i] != s2[0])\n      ans[lans++] = s1[i];\n    else {\n      for (j = 0, m = i; j < ls2; j++, m++) {\n        if (s1[m] != s2[j])\n          break;\n      }\n      if (j == ls2 && z != 1) {\n        i = m - 1;\n        for (j = 0; j < ls3; j++)\n          ans[lans++] = s3[j];\n        z++;\n      } else {\n        for (; i <= m; i++)\n          ans[lans++] = s1[i];\n        i--;\n      }\n    }\n  }\n  ans[lans] = '\\0';\n  printf(\"%s\", ans);\n  return 0;\n}\n"}
{"label": "7", "index": "11988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(int x, int y) {\n  if (x > y)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  char str1[260], str2[260], str3[260];\n  cin >> str1 >> str2 >> str3;\n  int L = strlen(str2), len = strlen(str1), k, i;\n  for (i = 0; i < len; i++) {\n    k = 0;\n    while (str2[k] == str1[i + k] && k < L) {\n      k++;\n    }\n    if (k == L) {\n      break;\n    }\n  }\n  if (i == len) {\n    for (int q = 0; q < len; q++) {\n      cout << str1[q];\n    }\n    return 0;\n  }\n  for (int q = 0; q < i; q++) {\n    printf(\"%c\", str1[q]);\n  }\n  printf(\"%s\", str3);\n  for (int q = i + strlen(str2); q < len; q++) {\n    cout << str1[q];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int sum = 0, i, j, k, n, m, h = 0, y = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  k = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 0; j < m; j++) {\n        if (b[j] == a[i + j])\n          sum++;\n      }\n      if (sum == m && y == 0) {\n        for (j = 0; j < k; j++)\n          d[h + j] = c[j];\n        i = i + m;\n        h = h + k;\n        y = 1;\n      }\n      sum = 0;\n    }\n    d[h] = a[i];\n    h++;\n  }\n  d[h] = '\u0000';\n  printf(\"%s \", d);\n  return 0;\n}\n"}
{"label": "7", "index": "11990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[257];\n  char a[257];\n  char a1[257];\n  int i, j, len, n = 0, k, flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> a1;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      n = i;\n      for (j = i + 1, k = 1; j < i + len; j++, k++) {\n        if (s[j] != a[k]) {\n          flag = 0;\n        }\n      }\n      if (flag == 1)\n        break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", a1);\n    for (i = n + len; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n  }\n  if (flag == 0)\n    cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "11991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, j, k, n1, n2;\n  char x;\n  char zf[300];\n  char s1[100], s2[100];\n\n  scanf(\"%s \", zf);\n\n  cin >> s1;\n\n  cin >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < (strlen(zf)); i++) {\n    if (zf[i] == s1[0] && zf[i + 1] == s1[1] && zf[i + n1 - 1] == s1[n1 - 1]) {\n      for (k = 0; k < n2; k++) {\n        zf[i] = s2[k];\n        i++;\n      }\n      break;\n    }\n  }\n\n  puts(zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], replace[256];\n\n  scanf(\"%s \", s);\n\n  cin >> sub;\n\n  cin >> replace;\n\n  int ls = strlen(s);\n  int lsub = strlen(sub);\n  char sr[256];\n  int i, j;\n  int same;\n  for (i = 0; i < ls; i++) {\n    for (j = 0; j < lsub; j++) {\n      sr[j] = s[i + j];\n    }\n    sr[j] = '\u0000';\n    same = strcmp(sr, sub);\n    if (same == 0) {\n      printf(\"%s\", replace);\n      i = i + lsub;\n      printf(\"%s\", &s[i]);\n      break;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char re[256];\n  scanf(\"%s\", str);\n  cin >> sub;\n  scanf(\"%s\", re);\n  int i, j, k, p;\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[0]) {\n      k = i;\n      for (j = 0; sub[j] != '\u0000'; j++) {\n        if (str[i] == sub[j])\n          i++;\n        else\n          break;\n      }\n      i--;\n      if (sub[j] != '\u0000')\n        i = k;\n      else\n        break;\n    }\n  }\n  if (str[i] == '\u0000')\n    printf(\"%s\", str);\n  else {\n    for (p = 0; p < k; p++)\n      cout << str[p];\n    printf(\"%s\", re);\n    for (p = i + 1; str[p] != '\u0000'; p++)\n      printf(\"%c\", str[p]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[260], s1[260], s2[260], s3[260];\n  int i, j, k, l, h, len, len1, len2;\n\n  scanf(\"%s \", s);\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0, h = 0; i < len; i++, h++) {\n\n    s3[h] = s[i];\n    if (s[i] == s1[0]) {\n      int e = 1;\n      for (j = 0, k = i; j < len1; j++, k++) {\n        if (s[k] != s1[j]) {\n          e = 0;\n          break;\n        }\n      }\n      if (e) {\n        for (l = 0; l < len2; l++, h++) {\n          s3[h] = s2[l];\n        }\n        h--;\n        i = i + len1 - 1;\n        s1[0] = '.';\n      }\n    }\n  }\n  s3[len - len1 + len2] = '\u0000';\n  printf(\"%s\", s3);\n  return 0;\n}\n"}
{"label": "7", "index": "11995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l1, l2, l3, sum;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  sum = 0;\n  l1 = strlen(b);\n  l2 = strlen(c);\n  l3 = strlen(a);\n  for (i = 0; i < l3; i++) {\n    for (j = i, k = 0; k < l1; k++) {\n      if (a[j] != b[k])\n        break;\n      j++;\n    }\n    if (k == l1 && sum == 0) {\n      for (j = 0; c[j] != '\u0000'; j++)\n        cout << c[j];\n      i = i + l1 - 1;\n      sum = sum + 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "11996", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[600], subStr[260], rep[260];\n  memset(str, 0, sizeof(str));\n  scanf(\"%s %s %s \", str, subStr, rep);\n  char *pos = strstr(str, subStr);\n  if (pos != NULL) {\n    int len = strlen(rep);\n    for (int i = 0; i < len; i++) {\n      *pos++ = rep[i];\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "11997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (j >= len2)\n      break;\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n\n    if (j) {\n      i -= j;\n      j = 0;\n    }\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  printf(\"%s\\n\", n);\n\n  return 0;\n}\n"}
{"label": "7", "index": "11998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n[100], s1[20], s2[20];\n\n  cin >> n;\n\n  cin >> s1;\n  cin >> s2;\n\n  if (n[1] == 'l')\n    printf(\"iloveearth\");\n  else if (n[0] == 's')\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n  else\n    printf(\"programmingiscool\");\n  return 0;\n}\n"}
{"label": "7", "index": "11999", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, k, t = 0, l, p, h, n, m;\n  char str[3][600];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m = strlen(str[1]);\n  n = strlen(str[0]);\n  p = strlen(str[2]);\n  for (i = 0; i < n - m + 1, j < m; i++) {\n    if (str[0][i] == str[1][j]) {\n      t++;\n      j++;\n    } else {\n      j = 0;\n      t = 0;\n    }\n    if (t == m)\n      break;\n  }\n  if (t != m)\n    printf(\"%s\", str[0]);\n  else {\n    for (l = i - m + 1, h = 0; h < p; h++, l++)\n      str[0][l] = str[2][h];\n    printf(\"%s\", str[0]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, s, m, n, k;\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  cin >> str3;\n  m = strlen(str1);\n  n = strlen(str2);\n  k = strlen(str3);\n  for (i = 0; i <= m - n; i++) {\n    s = 0;\n    for (j = i; j < i + n; j++) {\n      if (str2[j - i] == str1[j])\n        s++;\n    }\n    if (s == n) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", str3[j]);\n      }\n      for (j = i + n; j < m; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      break;\n    }\n  }\n  if (s != n)\n    printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "12001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char t[256], s[256], r[256];\n  int lt, ls, i = 0, j = 0, p;\n  scanf(\"%s%s%s\", s, t, r);\n  lt = strlen(t);\n  ls = strlen(s);\n  while (i < lt && j < ls) {\n    if (t[i] == s[j]) {\n      i++;\n      j++;\n    } else {\n      j = j - i + 1;\n      p = j;\n      i = 0;\n    }\n  }\n  if (i == lt)\n    for (i = 0; i < lt; i++) {\n      s[i + p] = r[i];\n    }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint judge(int i, char s[800], char sub[800]) {\n  \n  int j, k;\n  for (j = i; j <= i + strlen(sub) - 1; j++)\n    if (s[j] != sub[j - i])\n      break;\n  if (j == i + strlen(sub))\n    return 1;\n  else\n    return 0;\n}\nvoid change(int i, char s[800], char sub[800], char r[800]) {\n  int l, ls, lr, j, k;\n  l = strlen(s);\n  ls = strlen(sub);\n  lr = (strlen(r));\n  \n  if (ls <= lr) {\n    k = lr - ls;\n    for (j = l + k + 1; j >= i + lr; j--)\n      s[j] = s[j - k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  } else {\n    k = ls - lr;\n    for (j = i + lr; j <= l - k + 1; j++)\n      s[j] = s[j + k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  }\n}\nint main() {\n  char s[800], sub[800], r[800];\n  int l, i;\n  scanf(\"%s\", s);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", r);\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    if ((s[i] == sub[0]) && (judge(i, s, sub) > 0)) {\n      change(i, s, sub, r);\n      break;\n    }\n  puts(s);\n}\n"}
{"label": "7", "index": "12003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, m;\n  char zfc[1000], zfc_1[100], zfc_2[100];\n  scanf(\"%s%s%s\", zfc, zfc_1, zfc_2);\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (j == (int)strlen(zfc_1))\n      break;\n    if (zfc[i] == zfc_1[j])\n      j++;\n    else\n      j = 0;\n  }\n  if (j == (int)strlen(zfc_1)) {\n    for (m = 0; m < i - j; m++)\n      printf(\"%c\", zfc[m]);\n    printf(\"%s\", zfc_2);\n    for (m = i; m < (int)strlen(zfc); m++)\n      printf(\"%c\", zfc[m]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[255], sub[255], rep[255], s[255];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  int len1 = strlen(str), len2 = strlen(sub), x = 0;\n  int i, j, n;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    n = 0;\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j])\n        break;\n      else\n        n++;\n    }\n    if (n == len2) {\n      int m = 0;\n      while (i + j + m < len1) {\n        s[m] = str[i + j + m];\n        m++;\n      }\n      s[m] = '\u0000';\n      str[i] = '\u0000';\n      strcat(str, rep);\n      strcat(str, s);\n      puts(str);\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0)\n    puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c, m, d, k, v = 0;\n  char str[100], substr[100], rep[100];\n  scanf(\"%s%s%s\", str, substr, rep);\n  a = strlen(str);\n  b = strlen(substr);\n  for (i = 0; i < a; i++) {\n    k = i;\n    if (substr[0] == str[k]) {\n      d = 0;\n      for (j = i + 1, m = 1; j < i + b; j++, m++) {\n        if (substr[m] == str[j])\n          d++;\n      }\n\n      if (d == b - 1)\n        for (j = i, c = 0; j < i + b; j++, c++) {\n          str[j] = rep[c];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int i, j;\n  int count1 = 0, count2 = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    count1++;\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    count2++;\n  }\n  int k, l, m, n, judge = 0, o, p, judge1 = 0;\n  for (k = 0; k <= count1 - count2; k++) {\n    n = 0;\n    if (a[k] == b[0]) {\n      o = m = k;\n      for (n = 0; n <= count2 - 1; n++) {\n        if (a[m] != b[n]) {\n          break;\n        } else if (n == count2 - 1 && a[m] == b[n]) {\n          judge = 1;\n        } else if (a[m] == b[n] && n != count2 - 1) {\n          m++;\n        }\n      }\n      if (judge == 1) {\n        for (o = k; o <= k + count2 - 1; o++) {\n          a[o] = c[o - k];\n        }\n        for (p = 0; p <= count1 - 1; p++) {\n          printf(\"%c\", a[p]);\n        }\n        judge1 = 1;\n        break;\n      } else if (judge == 0) {\n        continue;\n      }\n    }\n  }\n  if (judge1 == 0) {\n    for (int z = 0; z <= count1 - 1; z++)\n      printf(\"%c\", a[z]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12007", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], substr[50], r[50];\n\n  scanf(\"%s \", str);\n\n  cin >> substr;\n\n  cin >> r;\n  int i, j, n, same = 0;\n  int l = strlen(substr);\n  for (i = 0; str[i] != 0; i++) {\n    if (substr[0] == str[i]) {\n      same = 1;\n      for (j = 1; substr[j] != 0; j++) {\n        if (substr[j] != str[i + j]) {\n          same = 0;\n          break;\n        }\n      }\n      if (same == 1) {\n        n = i;\n        break;\n      }\n    }\n  }\n  if (same == 1) {\n    for (j = 0; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"%s\", r);\n    for (j = n + l; str[j] != 0; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  if (same == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint search(char a[], char b[]) {\n  int la = strlen(a), lb = strlen(b), i, j;\n  for (i = 0; i <= lb - la; i++) {\n    for (j = 0; j < la; j++)\n      if (a[j] != b[i + j])\n        break;\n    if (j == la)\n      return i;\n  }\n  return 999;\n}\nint main() {\n  char s[300], a[300], b[300];\n  int m, i;\n  scanf(\"%s%s%s\", &s, &a, &b);\n  m = search(a, s);\n  if (m == 999) {\n    printf(\"%s\\n\", s);\n    getchar();\n    getchar();\n    return 0;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%c\", s[i]);\n  printf(\"%s\", b);\n  for (i += strlen(a); i < strlen(s); i++)\n    printf(\"%c\", s[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[257], s2[257], s3[257];\n  char *p;\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n\n  cin >> s3;\n  p = strstr(s1, s2);\n  if (p) {\n    int i = p - s1;\n    s1[i] = '\u0000';\n    cout << s1;\n    printf(s3);\n    cout << p + strlen(s2) << \" \";\n  } else {\n    puts(s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int le, len, lenn, i, j, k, a = 0, b, m = 0;\n  char aa[256], bb[256], cc[256];\n  scanf(\"%s %s %s \", aa, bb, cc);\n  le = strlen(aa);\n  len = strlen(bb);\n  lenn = strlen(cc);\n  for (i = 0; i < le; i++) {\n    a = 0;\n    for (j = i, k = 0; j < len + i && k < len; j++, k++) {\n      if (bb[k] == aa[j])\n        a++;\n    }\n    if (a == len) {\n      b = i;\n      m++;\n      break;\n    }\n  }\n\n  if (m == 0)\n    puts(aa);\n  else {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", aa[i]);\n    }\n    for (k = 0; k < lenn; k++) {\n      cout << cc[k];\n    }\n    for (i = b + len; i < le; i++) {\n      printf(\"%c\", aa[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12011", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint comp(char a[100], char b[100], int i) {\n  int l, j;\n  l = strlen(b);\n  for (j = 0; j < l; j++)\n    if (a[i + j] != b[j])\n      return 0;\n  return 1;\n}\n\nint main(int argc, char *argv[]) {\n  int i, j, len1, len2, len3, break1 = 0;\n  char a[100], b[100], c[100];\n  int comp(char a[100], char b[100], int i);\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < 100; i++) {\n    if (a[i] == b[0]) {\n      if (comp(a, b, i)) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        printf(\"%s\", c);\n\n        for (j = j + len2; j < len1 - len2 + len3; j++) {\n          printf(\"%c\", a[j]);\n        }\n        break;\n        break1 = 1;\n      }\n    }\n    if (break1 == 1)\n      break;\n    if (i == strlen(a))\n      printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, count = 0, h;\n  char a[260], b[260], c[260];\n  scanf(\"%s\", &a);\n  cin >> b;\n  scanf(\"%s\", &c);\n\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[j]) {\n      count += 1;\n      j += 1;\n    } else {\n      j = 0;\n      count = 0;\n    }\n    if (count == strlen(b)) {\n      h = i;\n      break;\n    }\n  }\n  if (count == strlen(b)) {\n    for (i = 0; i <= h - strlen(b); i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = 0; i <= strlen(c) - 1; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = h + 1; i <= strlen(a) - 1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    cout << a;\n  }\n}\n"}
{"label": "7", "index": "12013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[514], b[514], c[514], d[256];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  int i, j, k, l, m, n, t, p, q, x, z, y;\n  l = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < l - m + 1; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      for (j = i, t = 0; j < i + m; j++, t++) {\n        if (a[j] != b[t]) {\n          k = 1;\n          break;\n        }\n      }\n      if (k == 0) {\n        p = i;\n        q = i + m;\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    for (i = q, j = 0; i < l; i++, j++) {\n      d[j] = a[i];\n    }\n    d[j] = 0;\n    strcat(c, d);\n    a[p] = 0;\n    strcat(a, c);\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int x, y, z, k, l, i, j, m, n, cha, mark = 0;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(s);\n\n  for (i = 0; i < z; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < x; j++) {\n        if ((s[i + j] == a[j]) && (j != x - 1)) {\n          continue;\n        } else if (s[i + j] != a[j]) {\n          break;\n        } else if ((s[i + j] == a[j]) && (j == x - 1)) {\n          mark++;\n          if (x > y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n            cha = x - y;\n            for (m = i + x; m < z; m++) {\n              s[m - cha] = s[m];\n            }\n            s[z - cha] = '\u0000';\n          } else if (x == y) { \n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n          } else if (x < y) {\n            cha = y - x;\n            for (l = z - 1; l >= i + x; l--) {\n              s[l + cha] = s[l];\n            }\n            for (n = 0; n < y; n++) {\n              s[i + n] = b[n];\n            }\n            s[z + cha] = '\u0000';\n            z = strlen(s); \n          }\n        }\n      }\n    }\n    if (mark != 0) {\n      printf(\"%s\", s);\n      return 0;\n    }\n  }\n  if (mark == 0) {\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[530] = {'\\0'}, e[257] = {'\\0'};\n  int i, m = 0, j, t, len;\n  cin >> a >> b >> c;\n  for (i = 0;; i++) {\n    if (a[i] == '\\0' || b[m] == '\\0')\n      break;\n    if (b[m] != a[i]) {\n      m = 0;\n      continue;\n    }\n    m++;\n  }\n  if (m != 0) {\n    for (j = 0, t = 0; j <= i - m; j++, t++) {\n      if (j == i - m) {\n        d[t] = '\\0';\n      } else {\n        d[t] = a[j];\n      }\n    }\n    len = strlen(a);\n    if (i != len) {\n      for (j = i, t = 0; j < len; j++, t++) {\n        e[t] = a[j];\n      }\n      strcat(d, c);\n      strcat(d, e);\n    } else {\n      strcat(d, c);\n    }\n    printf(\"%s\", d);\n  } else\n    printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int len1, len2, i, j, x, tag = 0;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s1[j] != s2[j - i]) {\n        break;\n      }\n      if (j == i + len2 - 1) {\n        tag = 1;\n        x = i;\n      }\n    }\n    if (tag) {\n      break;\n    }\n  }\n  if (tag) {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s3);\n    for (i = x + len2; i < len1; i++) {\n      printf(\"%c\", s1[i]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12018", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint pd(char *p, char *sub, int n) {\n  int j;\n  char *x, *y;\n  int zhi = 0;\n  for (j = 0, x = p, y = sub; j < n; j++, x++, y++)\n    if (*x == *y)\n      zhi = 1;\n    else {\n      zhi = 0;\n      break;\n    }\n\n  return (zhi);\n}\nint main() {\n  char *a, *sub, *rep, *t;\n  char *p;\n  int n, m;\n  a = (char *)malloc(250 * sizeof(char));\n  sub = (char *)malloc(1000);\n  rep = (char *)malloc(1000);\n  t = (char *)malloc(1000);\n  cin >> a;\n  cin >> sub;\n  cin >> rep;\n  for (n = 0, p = sub; *p != '\u0000'; p++, n++)\n    ;\n  for (m = 0, p = a; *p != '\u0000'; p++, m++)\n    ;\n  for (p = a; p < a + m - n; p++)\n    if (pd(p, sub, n) == 1)\n      break;\n  strcpy(t, p + n);\n  if (pd(p, sub, n) == 1)\n    strcpy(p, rep);\n  strcpy(p + n, t);\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, k, m;\n  char s[256], s1[256], s2[256];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  a = strlen(s);\n  b = strlen(s1);\n  c = strlen(s2);\n  for (i = 0; i < a; i++) {\n    if (s[i] == s1[0]) {\n      for (j = 0; j < b; j++) {\n        if (s[i + j] != s1[j])\n          break;\n      }\n      if (s[i + b - 1] == s1[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          cout << s[k];\n        printf(\"%s\", s2);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, x, m, n;\n  char s[300], sub[300], re[300];\n\n  cin >> s;\n\n  cin >> sub;\n\n  scanf(\"%s \", re);\n  n = strlen(s);\n  m = strlen(sub);\n  x = strlen(re);\n  for (i = 0; i <= n - m; i++) {\n    for (j = 0, t = i; j < m; j++) {\n      if (s[t] == sub[j]) {\n        t++;\n      } else\n        break;\n    }\n    if (j == m) {\n      break;\n    }\n  }\n  if (i == n - m + 1) {\n    ;\n  } else {\n    for (t = i + x; t < n + x - m; t++)\n      s[t] = s[t - x + m];\n\n    for (j = i, t = 0; j < i + x; j++, t++) {\n      s[j] = re[t];\n    }\n  }\n  puts(s);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char strstr[300];\n  char repla[300];\n  int i, j, k;\n  cin.getline(str, 300);\n  cin.getline(strstr, 300);\n  cin.getline(repla, 300);\n\n  int sl1 = strlen(str);\n  int sl2 = strlen(strstr);\n  int sl3 = strlen(repla);\n\n  for (i = 0; i < sl1; i++) {\n    int flag = 1;\n    if (str[i] != strstr[0]) {\n      continue;\n    } else {\n      for (j = i; j < i + sl2; j++) {\n        if (str[j] != strstr[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 0) {\n        continue;\n      }\n\n      else {\n        int vec = sl3 - sl2;\n\n        for (k = sl1; k >= i + sl2; k--)\n          str[k + vec] = str[k];\n\n        for (k = i; k < i + sl3; k++) {\n          str[k] = repla[k - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  int i, j, k = 0, len1, len2, flag, m, t, q;\n  scanf(\"%s%s%s\", b, a, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len2; i++) {\n    flag = 1;\n    q = 1;\n    if (b[i] == a[0]) {\n      k = i + 1;\n      for (j = 1; j < len1; j++) {\n        if (b[k++] != a[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        t = 0;\n        for (m = i; m < i + len1; m++)\n          b[m] = c[t++];\n        q = 0;\n      }\n    }\n    if (q == 0)\n      break;\n  }\n  printf(\"%s\\n\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "12023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, s, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < strlen(a); i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < strlen(b)) {\n      k++;\n      j++;\n    }\n    if (j == strlen(b)) {\n      y = 0;\n      for (s = i; s < i + strlen(b); s++)\n        a[s] = c[s - i];\n\n      y = 1;\n    }\n    if (y == 1)\n      break;\n  }\n\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int le, len, lenn, i, j, k, a = 0, b, m = 0;\n  char aa[256], bb[256], cc[256];\n  scanf(\"%s%s%s\", aa, bb, cc);\n  le = strlen(aa);\n  len = strlen(bb);\n  lenn = strlen(cc);\n  for (i = 0; i < le; i++) {\n    a = 0;\n    for (j = i, k = 0; j < len + i && k < len; j++, k++) {\n      if (bb[k] == aa[j])\n        a++;\n    }\n    if (a == len) {\n      b = i;\n      m++;\n      break;\n    }\n  }\n\n  if (m == 0)\n    puts(aa);\n  else {\n    for (i = 0; i < b; i++)\n      printf(\"%c\", aa[i]);\n\n    for (k = 0; k < lenn; k++) {\n      printf(\"%c\", cc[k]);\n    }\n    for (i = b + len; i < le; i++)\n      printf(\"%c\", aa[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[500], w[500], e[500][500], c[500];\n  int i, j, m, n, k = 0;\n  cin >> w >> s >> c;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = 0; w[i + m - 1] != '\\0'; i++) {\n    for (j = 0; j < m; j++) {\n      e[i][j] = w[i + j];\n    }\n    e[i][j] = '\\0';\n  }\n  for (i = 0; i < n - m + 1; i++) {\n    if (strcmp(e[i], s) == 0) {\n      k = 1;\n      break;\n    }\n  }\n  int a;\n  a = i;\n  if (k == 1) {\n    for (i = 0; i < m; i++) {\n      w[a + i] = c[i];\n    }\n    cout << w;\n  } else if (k == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, flag = 0;\n  char str[512], substr[256], replace[256];\n  cin.getline(str, 512);\n  cin.getline(substr, 256);\n  cin.getline(replace, 256);\n  int len1 = strlen(str);\n  int len2 = strlen(substr);\n  int len3 = strlen(replace);\n  for (i = 0; i <= len1 - len2; i++) {\n    k = i;\n    for (j = 0; j < len2; j++) {\n      if (str[k++] != substr[j])\n        break;\n    }\n    if (j == len2 && flag == 0) {\n      int ii;\n      for (ii = i; ii < i + len3; ii++) {\n        str[ii] = replace[ii - i];\n      }\n      flag = 1;\n    }\n  }\n  for (i = 0; str[i] != '\\0'; i++)\n    cout << str[i];\n\n  return 0;\n}\n"}
{"label": "7", "index": "12027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, m, k, p;\n  char r[257], s[257], w[257];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", r);\n  a = strlen(s);\n  p = 0;\n  for (i = 0; w[i]; i++) {\n    if (w[i] == s[0]) {\n      m = 0;\n      for (j = 0; j < a; j++) {\n        if (w[i + j] == s[j]) {\n          m = m + 1;\n        }\n      }\n      if (m == a) {\n        p = p + 1;\n        for (k = 0; k < a; k++) {\n          w[i + k] = r[k];\n        }\n        cout << w;\n        break;\n      }\n    }\n  }\n  if (p == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[102], a[102], b[102];\n  char *p1, *p2, *p3;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  int i, j, k = 0, len, m, len2;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (*p2 == p1[i]) {\n      j = i;\n      m = i;\n      for (; *p2 != '\u0000'; p2++, j++) {\n        if (*p2 == p1[j]) {\n          k++;\n        } else {\n          break;\n        }\n      }\n    }\n  }\n  len2 = strlen(a);\n  if (k != len2) {\n    printf(\"%s\", s);\n  }\n  if (k == len2) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = i + k; i < len; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12029", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[100], b[100];\n  int i, j, h;\n  int n, m, result = 0;\n  int count;\n\n  cin >> str;\n  scanf(\"%s%s\", a, b);\n  n = strlen(str);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    if (str[i] == a[0]) {\n      h = i;\n      for (j = 0; j < m; j++) {\n        if (str[h + j] == a[j]) {\n          count++;\n        }\n      }\n      if (count == m) {\n        printf(\"%s\", b);\n        result = 1;\n        break;\n      }\n      if (count != m) {\n        printf(\"%c\", str[i]);\n      }\n    } else\n      printf(\"%c\", str[i]);\n    if (result == 1)\n      break;\n  }\n  for (i = h + m; i < n; i++) {\n    printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int length_string = strlen(string);\n  int length_substring = strlen(substring);\n\n  int i, j, k;\n  for (i = 0; i < length_string; i++) {\n    for (j = 0; j < length_substring; j++) {\n      if (substring[j] != string[i + j]) {\n        break;\n      }\n    }\n    if (j == length_substring) {\n      for (k = 0; k < length_substring; k++) {\n        string[i + k] = replacement[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", string);\n}\n"}
{"label": "7", "index": "12031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, n, m, k, p, q, z = 0;\n  char a[260], b[260], c[260], d[260];\n\n  cin >> a >> b >> c;\n  n = strlen(a);\n  m = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (k = 0; k < m; k++) {\n        d[k] = a[k + i];\n      }\n      d[k] = '\\0';\n      if (strcmp(b, d) == 0) {\n        for (p = 0; p < i; p++)\n          printf(\"%c\", a[p]);\n\n        printf(\"%s\", c);\n        for (p = i + q; p < (n - m + q); p++) {\n          cout << a[p];\n        }\n        z = 1;\n        break;\n      }\n    }\n  }\n\n  if (z == 0) {\n    printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n1, n2;\n  char s1[257], s2[257], s3[257];\n\n  scanf(\"%s \", s1);\n\n  scanf(\"%s \", s2);\n\n  cin >> s3;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < n1; i++)\n    if (s1[i] == s2[0]) {\n      j = 0;\n      while (s1[i + j] == s2[j] && j < n2)\n        j++;\n      if (j == n2) {\n        for (k = i; k < i + n2; k++)\n          s1[k] = s3[k - i];\n        break;\n      }\n    }\n  for (i = 0; i < n1; i++)\n    printf(\"%c\", s1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], s2[256], ss[20], re[20];\n  int i, j, x = 0, y = 0, a, flag = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", ss, re);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ss[0]) {\n      s1[x] = s[i];\n      x++;\n    } else if (s[i] == ss[0]) {\n      a = i;\n      flag = 1;\n      for (j = 0; ss[j] != '\u0000'; j++) {\n        if (ss[j] != s[a]) {\n          flag = 0;\n        }\n        a++;\n      }\n      if (flag == 0) {\n        s1[x] = s[i];\n        x++;\n      }\n    }\n    if (flag == 1) {\n      s1[x] = '\u0000';\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i += strlen(ss); s[i] != '\u0000'; i++) {\n      s2[y] = s[i];\n      y++;\n    }\n  }\n  s2[y] = '\u0000';\n  if (flag == 1) {\n    printf(\"%s%s%s\", s1, re, s2);\n  }\n  if (flag == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (s[i] == a[0]) {\n      k = 0;\n      for (j = 1; j < y; j++) {\n        if (s[i + j] != a[j])\n          k = 1;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < z; j++)\n        printf(\"%c\", b[j]);\n      for (i = i + y; i < x; i++)\n        printf(\"%c\", s[i]);\n      break;\n    }\n    if (k == 1)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12035", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, slen, alen;\n  char *ss[2], s[256], s1[256], s2[256];\n  int flag = 0;\n\n  cin >> s;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  slen = strlen(s);\n  alen = strlen(s1);\n\n  for (i = 0; i < slen - alen + 1; i++) {\n    for (j = 0; j < alen; j++) {\n      if (s[i + j] != s1[j])\n        break;\n    }\n    if (j == alen) {\n      ss[1] = &s[i + j];\n      s[i] = '\u0000';\n      ss[0] = s;\n      flag = 1;\n\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"%s \", s);\n  else\n    printf(\"%s%s%s \", ss[0], s2, ss[1]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w[256], s[256], ti[256];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> ti;\n  int len1, len2, len;\n  len = strlen(w);\n  len1 = strlen(s);\n  len2 = strlen(ti);\n  int i, k, n = 0, m = 0;\n  for (i = 0; i < len; i++) {\n    if (w[i] == s[0]) {\n      for (k = 1; k < len1; k++) {\n        if (w[i + k] == s[k]) {\n          n++;\n        }\n      }\n      if (n == len1 - 1) {\n        m = i;\n      }\n    }\n  }\n  if (m == 0) {\n    puts(w);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", w[i]);\n    }\n    for (i = 0; i < len2; i++) {\n      printf(\"%c\", ti[i]);\n    }\n    for (i = m + len1; i < len; i++) {\n      printf(\"%c\", w[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300] = {\"\u0000\"};\n  char sub[300] = {\"\u0000\"};\n  char re[300] = {\"\u0000\"};\n  char t[300];\n  char pre[300] = {\"\u0000\"};\n  char post[300] = {\"\u0000\"};\n\n  cin >> str;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  int i, j, k;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < 299; j++)\n        t[j] = '\u0000';\n      for (j = 0; j < strlen(sub); j++)\n        t[j] = str[i + j];\n      if (strcmp(t, sub) == 0) {\n        for (j = 0; j < i; j++)\n          pre[j] = str[j];\n        for (j = i + strlen(sub); j < strlen(str); j++)\n          post[j - i - strlen(sub)] = str[j];\n        printf(\"%s%s%s \", pre, re, post);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, p;\n  char zichuan[257], danci[257], tihuan[257];\n  cin >> danci >> zichuan >> tihuan;\n  int n = strlen(zichuan);\n  p = 0;\n  for (i = 0; danci[i] != 0; i++) {\n    if (p == 1) {\n      break;\n    }\n    if (danci[i] == zichuan[0]) {\n      for (j = 1; j < n; j++) {\n        if (danci[i + j] != zichuan[j]) {\n          break;\n        } else {\n          p = 1;\n          m = i;\n          break;\n        }\n      }\n    }\n  }\n  if (p == 1) {\n    for (i = m; i < m + n; i++) {\n      danci[i] = tihuan[i - m];\n    }\n    printf(\"%s\\n\", danci);\n  } else {\n    cout << danci;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12039", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257];\n  int i, k = 0, j, len1, len2, len3;\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        k++;\n    }\n    if (k == len2)\n      break;\n    k = 0;\n  }\n  if (k == len2) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < len3; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + len2; j < len1; j++) {\n      printf(\"%c\", a[j]);\n    }\n  }\n  if (k != len2) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], re[257];\n  int i, j, k, n1, n2, n3, h = 0;\n  scanf(\"%s%s%s\", str, sub, re);\n  n1 = strlen(str);\n  n2 = strlen(sub);\n  n3 = strlen(re);\n  for (i = 0; i <= n1 - n2; i++) {\n    if (str[i] == sub[0]) {\n      int ll = 0;\n      for (j = 0; j < n2; j++) {\n        if (str[i + j] != sub[j]) {\n          ll = 1;\n          break;\n        } else\n          continue;\n      }\n      if (ll == 0) {\n        h = 1;\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", str[k]);\n        }\n        for (k = 0; k < n3; k++) {\n          printf(\"%c\", re[k]);\n        }\n        for (k = i + n2; k < n1; k++) {\n          printf(\"%c\", str[k]);\n        }\n        break;\n      } else\n        continue;\n    }\n  }\n  if (h == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12041", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], rep[100];\n  int i, j, m, len, lens;\n  scanf(\"%s %s %s \", str, sub, rep);\n  len = strlen(str);\n  lens = strlen(sub);\n\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0] && str[i + 1] == sub[1] &&\n        str[i + lens - 1] == sub[lens - 1]) {\n      j = i;\n      m = 0;\n      while (m < lens) {\n        str[j] = rep[m];\n        j++;\n        m++;\n      }\n      break;\n    }\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char X[300];\n  char Y[100];\n  char Z[100];\n\n  cin >> X;\n\n  cin >> Y;\n\n  cin >> Z;\n  int l, l1, l2;\n  l = strlen(X);\n  l1 = strlen(Y);\n  l2 = strlen(Z);\n  int i;\n  int A = -1;\n  for (i = 0; i < l; i++) {\n    if (X[i] == Y[0] && X[i + 1] == Y[1] && X[i + l1 - 1] == Y[l1 - 1] &&\n        X[i + l1 - 2] == Y[l1 - 2]) {\n      A = i;\n      break;\n    }\n  }\n  if (A != -1) {\n    for (i = 0; i < A; i++) {\n      printf(\"%c\", X[i]);\n    }\n    for (i = 0; i < l2; i++) {\n      printf(\"%c\", Z[i]);\n    }\n    for (i = A + l1; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  } else {\n    for (i = 0; i < l; i++)\n      printf(\"%c\", X[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12043", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n    if (j >= len2)\n      break;\n    if (j)\n      j = 0;\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  printf(\"%s\\n\", n);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12044", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300];\n  char b[200], c[200], d[200] = {0};\n  int n1, n2, n3, i, j, k, result, p, w;\n  scanf(\"%s %s %s \", a, b, c);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n3 = strlen(c);\n  p = 0;\n  k = 10000;\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    if (p == 0) {\n      for (j = 0; j < n2; j++) {\n        d[j] = a[i + j];\n      }\n      result = strcmp(d, b);\n      if (result == 0) {\n        k = i;\n        p = 1;\n        w = i + j;\n      }\n    }\n  }\n  if (k == 10000)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = w; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, panduan, k;\n  k = 0;\n  panduan = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    panduan = 0;\n\n    for (j = 0; b[j] != 0; j++) {\n      if (a[i + j] != b[j]) {\n        panduan = 1;\n        break;\n      }\n    }\n    if (panduan == 0 && k == 0) {\n      printf(\"%s\", c);\n      i += j - 1;\n      k = 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, m = 0, L, l1, l2;\n  char s[256], a[100], b[100];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      for (m = 0; m < l2; m++)\n        s[i + m] = b[m];\n\n      break;\n    }\n  }\n  for (k = 0; k < i + m; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (i = i + l1; i < L; i++) {\n    cout << s[i];\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, i, j, a = 0;\n  char str[256], sub[256], rep[256], word[256];\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  len = strlen(sub);\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < len; j++) {\n        word[j] = str[i + j];\n      }\n      word[len] = '\u0000';\n      if (strcmp(word, sub) == 0) {\n        strcpy(word, rep);\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", str[j]);\n        }\n        printf(\"%s\", word);\n        for (j = i + len; str[j] != 0; j++) {\n          printf(\"%c\", str[j]);\n        }\n        a = 1;\n        break;\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[2000];\n\n  cin >> zfc;\n  int c;\n  c = strlen(zfc);\n  char tzfc[2000];\n  char hzfc[2000];\n\n  cin >> tzfc;\n\n  cin >> hzfc;\n  int ct, ch;\n  ct = strlen(tzfc);\n  ch = strlen(hzfc);\n\n  int i, wei, an = 0, x, deng = 0;\n  for (i = 0; i < c; i++) {\n    int flag = 0;\n    for (x = i; x < ct + i; x++) {\n      if (zfc[x] != tzfc[x - i]) {\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 0) {\n      wei = i;\n      an++;\n      deng = 1;\n    }\n\n    if (an == 1) {\n      break;\n    }\n  }\n\n  if (deng == 0) {\n    puts(zfc);\n  } else {\n\n    int xzfc[2000];\n    for (i = 0; i < wei; i++) {\n      xzfc[i] = zfc[i];\n    }\n    for (i = wei; i < ch + wei; i++) {\n      xzfc[i] = hzfc[i - wei];\n    }\n    for (i = ch + wei; i < c - ct + ch; i++) {\n      xzfc[i] = zfc[i - (ch - ct)];\n    }\n\n    for (i = 0; i < c - ct + ch; i++) {\n      printf(\"%d\", xzfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12049", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, l, i, j, x = 0;\n  char s[256], a[256], b[256], p[256];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  k = (int)strlen(s);\n  l = (int)strlen(a);\n  for (i = 0; i < k - l + 1; i++) {\n    for (j = 0; j < l; j++) {\n      p[j] = s[j + i];\n    }\n    p[j] = '\u0000';\n    if (strcmp(p, a) == 0) {\n      x = i;\n      break;\n    }\n  }\n  if (x == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < x; i++)\n      printf(\"%c\", s[i]);\n\n    printf(\"%s\", b);\n    for (i = x + l; i < k; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void copy(char a[], char b[], char c[]);\n  char S[100], sub[100], re[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(re);\n  int m, k;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", re);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n  return 0;\n}\n"}
{"label": "7", "index": "12051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint Issubstr(char *s, char *subs) {\n  int i, j;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = 0; j < strlen(subs); j++) {\n      if (subs[j] != s[i + j])\n        break;\n    }\n    if (j == strlen(subs))\n      break;\n  }\n  if (i < strlen(s))\n    return i;\n  return -1;\n}\nint main() {\n  char s[257], sub[257], replace[257];\n  int i, j = 0;\n  cin >> s >> sub >> replace;\n  for (i = Issubstr(s, sub); i != -1 && j < strlen(replace); i++)\n    s[i] = replace[j++];\n\n  if (i > strlen(s))\n    s[i] = '\\0';\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char substr[256];\n  char rep[256];\n  int i, j, flag;\n  int a, b, c;\n\n  cin >> str;\n\n  cin >> substr;\n\n  scanf(\"%s \", rep);\n\n  a = strlen(substr);\n  b = strlen(str);\n  c = strlen(rep);\n\n  for (i = 0; i < b; i++) {\n    flag = 1;\n    for (j = 0; j < a; j++) {\n      if (str[i + j] != substr[j]) {\n        flag = 0;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  if (i == b) {\n    puts(str);\n  } else {\n\n    for (j = 0; j < i; j++) {\n      cout << str[j];\n    }\n    for (j = 0; j < c; j++) {\n      printf(\"%c\", rep[j]);\n    }\n    for (j = i + a; j < b; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[3][256], string[512];\n  int n, m, k, i, j;\n  scanf(\"%s %s %s\", str[0], str[1], str[2]);\n  n = strlen(str[0]);\n  m = strlen(str[1]);\n  k = strlen(str[2]);\n  for (j = 0; j < n - m + 1; j++) {\n    for (i = 0; i < m; i++) {\n      if (str[1][i] != str[0][i + j])\n        break;\n    }\n    if (i == m) {\n      break;\n    }\n  }\n  if (j < n - m + 1) {\n    for (i = 0; i < j; i++)\n      string[i] = str[0][i];\n    for (i = j; i < j + k; i++)\n      string[i] = str[2][i - j];\n    for (i = j + k; str[0][i - k + m] != '\\0'; i++)\n      string[i] = str[0][i - k + m];\n    string[i] = '\\0';\n    printf(\"%s\", string);\n  } else\n    printf(\"%s\", str[0]);\n}\n"}
{"label": "7", "index": "12054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, s;\n  char str[256], c[256], d[256];\n\n  cin >> c;\n\n  cin >> str;\n\n  cin >> d;\n  m = strlen(str);\n  n = strlen(c);\n  for (i = 0; i < n - m + 1; i++) {\n    if (c[i] == str[0]) {\n      s = 0;\n      for (j = i; j < i + m; j++) {\n        if (c[j] == str[j - i]) {\n          s = s + 1;\n        }\n      }\n      if (s == m) {\n        break;\n      }\n    }\n  }\n  if (s == m) {\n    for (j = i; j < i + m; j++) {\n      c[j] = d[j - i];\n    }\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "7", "index": "12055", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar *str_replace(const char *src, const char *newstr);\nint main() {\n  int aa = 0, i;\n  char str1[100], str2[100], str3[100], sub[100] = {0}, sub1[100] = {0},\n                                        sub2[100] = {0};\n\n  scanf(\"%s \", str1);\n\n  cin >> str2;\n\n  cin >> str3;\n  if (strlen(str1) < strlen(str2))\n    cout << str1;\n  else {\n    for (i = 0; i <= strlen(str1) - strlen(str2); i++) {\n      strncpy(sub, str1 + i, strlen(str2));\n      if (strcmp(sub, str2) == 0) {\n        strncpy(sub1, str1, i);\n        strncpy(sub2, str1 + i + strlen(str2), strlen(str1) - i - strlen(str2));\n        strcat(sub1, str3);\n        strcat(sub1, sub2);\n        cout << sub1;\n        aa = 1;\n        break;\n      }\n    }\n    if (aa == 0)\n      cout << str1;\n  }\n\n  return 0;\n}\nchar *str_replace(const char *src, const char *oldstr, const char *newstr) {\n\n  if (NULL == src || NULL == oldstr || NULL == newstr)\n\n  {\n\n    return NULL;\n  }\n\n  char *dest = strdup(src);\n\n  if (strcmp(oldstr, newstr) == 0)\n\n  {\n\n    return dest;\n  }\n\n  char *needle;\n\n  char *tmp, *dest_tmp = dest;\n\n  while (needle = strstr(dest, oldstr))\n\n  {\n\n    tmp = (char *)malloc(strlen(dest) + strlen(newstr) - strlen(oldstr) + 1);\n\n    strncpy(tmp, dest, needle - dest);\n\n    tmp[needle - dest] = '\u0000';\n\n    strcat(tmp, newstr);\n\n    strcat(tmp, needle + strlen(oldstr));\n\n    dest = strdup(tmp);\n\n    free(dest_tmp);\n\n    free(tmp);\n\n    dest_tmp = dest;\n  }\n\n  return dest;\n}\n"}
{"label": "7", "index": "12056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  int a1, b1, c1;\n  int i, j, k;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i <= a1 - 1; i++) {\n    for (j = 0; j <= b1 - 1; j++) {\n      if (a[i + j] != b[j])\n        break;\n    }\n    if (j == b1) {\n      break;\n    }\n  }\n\n  if (i >= a1)\n    printf(\"%s\", a);\n  else {\n    for (k = 0; k < i; k++) {\n      cout << a[k];\n    }\n    printf(\"%s\", c);\n    for (k = i + b1; k <= a1 - 1; k++)\n      printf(\"%c\", a[k]);\n  }\n}\n"}
{"label": "7", "index": "12057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, l, i, j, x = 0;\n  char s[256], a[256], b[256], p[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  k = (int)strlen(s);\n  l = (int)strlen(a);\n  for (i = 0; i < k - l + 1; i++) {\n    for (j = 0; j < l; j++) {\n      p[j] = s[j + i];\n    }\n    p[j] = '\u0000';\n    if (strcmp(p, a) == 0) {\n      x = i;\n      break;\n    }\n  }\n  if (x == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = x + l; i < k; i++) {\n      cout << s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ls, lo, lr, i, j, k, flag;\n  char str[257], org[257], rep[257];\n\n  cin >> str;\n\n  cin >> org;\n\n  cin >> rep;\n  ls = strlen(str);\n  lo = strlen(org);\n  lr = strlen(rep);\n  for (i = 0; i <= ls - lo; i++) {\n    flag = 1;\n    for (j = 0; j < lo; j++) {\n      if (str[i + j] != org[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", str[k]);\n      for (k = 0; k < lr; k++)\n        printf(\"%c\", rep[k]);\n      for (k = i + lo; k < ls; k++)\n        printf(\"%c\", str[k]);\n      return 0;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12059", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  char c[101];\n  int i, j;\n  int length1, length2, length3;\n  int p;\n  cin >> a >> b >> c;\n  length1 = strlen(a);\n  length2 = strlen(b);\n  length3 = strlen(c);\n  for (i = 0; i < length1; i++) {\n    if (a[i] == b[0]) {\n      p = 0;\n      for (j = 1; j < length2; j++) {\n        if (a[i + j] != b[j]) {\n          p = 1;\n          break;\n        }\n      }\n      if (p == 0) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        for (j = 0; j < length3; j++) {\n          printf(\"%c\", c[j]);\n        }\n        for (j = i + length3; j < length1; j++) {\n          printf(\"%c\", a[j]);\n        }\n        p = 2;\n        break;\n      }\n    }\n  }\n  if (p != 2) {\n    for (i = 0; i < length1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int n = strlen(a);\n  int m = strlen(b);\n  int i, j;\n  for (int i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] != b[j])\n          break;\n      }\n      if (j == m) {\n        for (j = 0; j < m; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], w[256], v[256];\n  int i, j, slen, wlen, k;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", v);\n  slen = strlen(s);\n  wlen = strlen(w);\n  for (i = 0; i <= wlen - slen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (w[i + j] != s[j]) {\n        break;\n      }\n    }\n    if (j == slen) {\n      break;\n    }\n  }\n  if (j == slen) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", w[k]);\n    }\n    printf(\"%s\", v);\n    if (w[i + slen] != 0) {\n      for (k = i + slen; k < wlen; k++) {\n        printf(\"%c\", w[k]);\n      }\n    }\n\n  } else if (i == wlen - slen + 1)\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, p;\n  char zichuan[257], danci[257], tihuan[257];\n  scanf(\"%s%s%s\", &danci, &zichuan, &tihuan);\n  int n = strlen(zichuan);\n  p = 0;\n  for (i = 0; danci[i] != 0; i++) {\n    if (p == 1) {\n      break;\n    }\n    if (danci[i] == zichuan[0]) {\n      for (j = 1; j < n; j++) {\n        if (danci[i + j] != zichuan[j]) {\n          break;\n        } else {\n          p = 1;\n          m = i;\n          break;\n        }\n      }\n    }\n  }\n  if (p == 1) {\n    for (i = m; i < m + n; i++) {\n      danci[i] = tihuan[i - m];\n    }\n    printf(\"%s\\n\", danci);\n  } else {\n    cout << danci;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void copy(char a[], char b[], char c[]);\n  char S[100], sub[100], re[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(re);\n  int m, k;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", re);\n        for (k = i + b; k < a; k++) {\n          printf(\"%c\", S[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n  return 0;\n}\n"}
{"label": "7", "index": "12064", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  cin >> str >> subString >> replacement;\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else if (repLen == subLen) {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    move = subLen - repLen;\n    while (*(p + move) != '\\0') {\n      *p++ = *(p + move);\n    }\n    *p = '\\0';\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[300], c[300];\n  int d = 0, i, j, k, m, n, lenb, lena;\n  scanf(\"%s %s %s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; j < i + lenb, k < lenb; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == lenb)\n        d = 1;\n    }\n    if (d == 1)\n      break;\n  }\n  if (d == 1) {\n    for (m = i, n = 0; m < i + lenb, n < lenb; m++, n++) {\n      a[m] = c[n];\n    }\n    printf(\"%s\", a);\n  }\n  if (d == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sl, al, i, j, flag = 0;\n  char s[256], a[256], b[256];\n  scanf(\"%s %s %s\", s, a, b);\n  sl = strlen(s);\n  al = strlen(a);\n  for (i = 0; i < sl; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < al; j++) {\n        if (s[i + j] == a[j])\n          flag = 1;\n        else\n          flag = 0;\n        continue;\n      }\n      if (flag == 1) {\n        for (j = 0; j < al && s[i + j] == a[j]; j++)\n          s[i + j] = b[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n}\n"}
{"label": "7", "index": "12067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  char *p, *q, *k;\n  cin.getline(a, 260);\n  cin.getline(b, 260);\n  cin.getline(c, 260);\n  int lena = strlen(a), lenb = strlen(b), flag = 0, t = 0, i;\n  p = a;\n  q = a;\n  k = b;\n  while (*p != '\\0') {\n    if (*q == *k) {\n      q++;\n      k++;\n      if (*k == '\\0') {\n        flag = 1;\n        for (i = 0; i < t; i++)\n          cout << a[i];\n        cout << c;\n        for (i = t + lenb; a[i] != '\\0'; i++)\n          cout << a[i];\n        cout << endl;\n        break;\n      }\n    } else {\n      p++;\n      q = p;\n      k = b;\n      t++;\n    }\n  }\n  if (flag == 0)\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], substr[50], r[50];\n\n  scanf(\"%s \", str);\n\n  cin >> substr;\n\n  cin >> r;\n  int i, j, n, same = 0;\n  int l = strlen(substr);\n  for (i = 0; str[i] != 0; i++) {\n    if (substr[0] == str[i]) {\n      same = 1;\n      for (j = 1; substr[j] != 0; j++) {\n        if (substr[j] != str[i + j]) {\n          same = 0;\n          break;\n        }\n      }\n      if (same == 1) {\n        n = i;\n        break;\n      }\n    }\n  }\n  if (same == 1) {\n    for (j = 0; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    cout << r;\n    for (j = n + l; str[j] != 0; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  if (same == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12069", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, x, y, m, l = 0, t;\n  char b[1000], a[1000], c[1000];\n  scanf(\"%s\", b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", c);\n\n  for (y = 0; i < 1000; y++) {\n    if (a[y] == '\u0000')\n      break;\n  }\n\n  for (i = 0; i < 1000; i++) {\n    m = 0;\n    for (j = i; j - i < y; j++) {\n      if (a[j - i] == b[j])\n        m++;\n    }\n    if (m >= y)\n      break;\n  }\n\n  for (t = i; c[t - i] != 0 && t < 256; t++) {\n    b[t] = c[t - i];\n    if (c[t - i] == '\u0000')\n      break;\n  }\n  puts(b);\n  return 0;\n}\n"}
{"label": "7", "index": "12070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  a[lena] = '\\0';\n  int x, s;\n  for (i = 0; i < lena; i++) {\n    x = -1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        x = 0;\n        break;\n      }\n    }\n    if (x != 0) {\n      s = i;\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < s; i++) {\n      cout << a[i];\n    }\n    printf(\"%s\", c);\n    for (i = s + lenb; i < lena; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char st[1000], su[1000], re[1000];\n  scanf(\"%s %s %s\", st, su, re);\n  int m, n, i, j, p = 0, q;\n  n = strlen(st);\n  m = strlen(su);\n  for (i = 0; i < n; i++) {\n    if (su[0] == st[i]) {\n      for (j = 1; j < m; j++) {\n        if (su[j] != st[i + j]) {\n          break;\n        } else {\n          p++;\n        }\n      }\n    }\n    if (p == (m - 1)) {\n      for (q = i; q < i + m; q++) {\n        st[q] = re[q - i];\n      }\n      break;\n    }\n  }\n  cout << st;\n  return 0;\n}\n"}
{"label": "7", "index": "12072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[100];\n  scanf(\"%s\", sz);\n  int i, j, m, n, len, len1, len2;\n\n  char as[100], az[100];\n  cin >> as >> az;\n\n  len = strlen(sz);\n  len1 = strlen(as);\n  len2 = strlen(as);\n  for (i = 0; i < len; i++) {\n    for (j = 0; j < len2; j++, i++) {\n      if (sz[i] != as[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        for (m = i - len2 + 1, n = 0; n < len2; n++, m++) {\n          sz[m] = az[n];\n        }\n      }\n      if (j == len2 - 1) {\n        i = len;\n      }\n    }\n  }\n  printf(\"%s\", sz);\n  return 0;\n}\n"}
{"label": "7", "index": "12073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len1, len2, len3, j, m = 0, l;\n  char zifu[256], chazhao[256], tihuan[256];\n  scanf(\"%s%s%s\", zifu, chazhao, tihuan);\n  len1 = strlen(zifu);\n  len2 = strlen(chazhao);\n  len3 = strlen(tihuan);\n  for (i = 0; i < len1; i++) {\n    m = 0;\n    if (zifu[i] == chazhao[0]) {\n      for (j = 0; j < len2; j++) {\n        if (zifu[i + j] == chazhao[j])\n          m++;\n        if (zifu[i + j] != chazhao[j])\n          break;\n      }\n    }\n    if (m == len2)\n      break;\n  }\n\n  if (i < len1) {\n    if (len2 == len3) {\n      for (l = 0; l < len2; l++)\n        zifu[i + l] = tihuan[l];\n    } else if (len2 > len3) {\n      for (l = 0; l < len3; l++) {\n        zifu[i + l] = tihuan[l];\n      }\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n    } else if (len2 < len3) {\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n    }\n  }\n\n  printf(\"%s\\n\", zifu);\n  return 0;\n}\n"}
{"label": "7", "index": "12074", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], temp[256];\n  char *p;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  p = strstr(str, sub);\n  if (p != NULL) {\n    *p = 0;\n    strcpy(temp, str);\n    strcat(temp, rep);\n    strcat(temp, p + strlen(sub));\n    strcpy(str, temp);\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[30000], b[100], c[100];\n\n  cin >> a;\n  int lenth, y = 1, j, i, m, num, tag = 0;\n  lenth = strlen(a);\n\n  cin >> b;\n  m = strlen(b);\n\n  cin >> c;\n  for (i = 0; i < lenth; i += y) {\n    y = 1;\n    num = 0;\n    if (tag == 0) {\n      for (j = 0; j < m; j++) {\n        if (a[i + j] == b[0 + j]) {\n          num++;\n        }\n      }\n      if (num == m) {\n        printf(\"%s\", c);\n        y = m;\n        tag = 1;\n      } else {\n        printf(\"%c\", a[i]);\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12076", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, d, e, f, k;\n  char a[256], b[256], c[256];\n  cin >> a;\n  scanf(\" \");\n  cin >> b;\n  cin;\n  cin >> c;\n  d = strlen(a);\n  e = strlen(b);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      for (j = 0; j < e; j++, k++)\n        if (b[j] != a[k])\n          break;\n      if (j < e)\n        continue;\n      else\n        break;\n    } else\n      continue;\n  }\n  if (i < d) {\n    for (j = i + e; j < (d - i - e); j++)\n      a[f + j - e] = a[j];\n    for (j = i; j < (i + f); j++)\n      a[j] = c[j - i];\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, p;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i <= strlen(a) - strlen(b); i++) {\n    p = 0;\n\n    for (j = i; j < i + strlen(b); j++)\n      if (b[j - i] == a[j])\n        p++;\n\n    if (p == strlen(b)) {\n      d[i] = '\u0000';\n      break;\n    }\n    d[i] = a[i];\n  }\n  if (i == strlen(a) - strlen(b) + 1)\n    puts(a);\n  else {\n    strcat(d, c);\n\n    for (j = i + strlen(b); j < strlen(a); j++)\n      e[j - i - strlen(b)] = a[j];\n    e[j - i - strlen(b)] = '\u0000';\n    strcat(d, e);\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char S[100], sub[100], replace[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(replace);\n  int k, m;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", replace);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n}\n"}
{"label": "7", "index": "12079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL;\n  char str[100], substr[100], restr[100];\n  scanf(\"%s %s %s \", str, substr, restr);\n  p = strstr(str, substr);\n  if (p != NULL) {\n    strcat(restr, p + strlen(substr));\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], d[100];\n  char *p, c[100], c1[100], c2[100];\n  int i, k, ls, lc;\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> d;\n\n  p = strstr(s, c);\n  ls = strlen(s);\n  lc = strlen(c);\n  int lsc = p - s;\n  if (p) {\n    for (i = 0; i < lsc; i++) {\n      c1[i] = s[i];\n    }\n    c1[i] = '\u0000';\n    k = 0;\n    for (i = i + lc; i < ls; i++, k++)\n      c2[k] = s[i];\n\n    c2[k] = '\u0000';\n    printf(\"%s\", c1);\n    printf(\"%s\", d);\n    printf(\"%s\", c2);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000], b[1000], c[1000];\nint main() {\n  cin >> a;\n  scanf(\"%s \", b);\n  cin >> c;\n  int len1, len2, p = 0, i, j;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    if (a[i] == b[0]) {\n      p = 1;\n      for (j = i; j < len2 + i; j++) {\n        if (a[j] != b[j - i]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (j = i; j < len2 + i; j++) {\n          a[j] = c[j - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[256], substr[256], replace[256];\n  char p[256];\n\n  int k = 0;\n\n  int m;\n\n  scanf(\"%s\", str);\n\n  scanf(\"%s\", substr);\n\n  scanf(\"%s\", replace);\n\n  int str1 = strlen(str), str2 = strlen(substr), str3 = strlen(replace);\n  for (int i = 0; i <= str1 - str2; i++) {\n\n    m = 1;\n    for (int l = 0; l < strlen(substr); l++) {\n\n      if (str[i + l] != substr[l]) {\n        m = 0;\n        break;\n      }\n    }\n\n    int j;\n    if (m) {\n      k = 1;\n\n      for (j = i; j < i + str3; j++)\n        p[j] = replace[j - i];\n\n      for (k = i + str2, i = j; k < str1; k++, i++)\n        p[i] = str[k];\n\n      break;\n    } else {\n\n      p[i] = str[i];\n    }\n  }\n\n  if (k) {\n\n    for (int i = 0; i < strlen(str) - strlen(substr) + strlen(replace); i++)\n      cout << p[i];\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dingwei(char duan[50], char chang[50]) {\n  int i, geshu1 = 0, geshu2 = 0;\n  for (i = 0; duan[i] != '\\0'; i++) {\n    geshu1 += 1;\n  }\n  for (i = 0; chang[i] != '\\0'; i++) {\n    geshu2 += 1;\n  }\n  int j, cishu = 0, weizhi = 0;\n  for (i = 0; i <= (geshu2 - geshu1); i++) {\n    for (j = 0; j < geshu1; j++) {\n      if (duan[j] == chang[i]) {\n        cishu++;\n        i++;\n      } else {\n        break;\n      }\n    }\n    if (cishu == geshu1) {\n      weizhi = i - geshu1;\n      break;\n    } else {\n      cishu = 0;\n      continue;\n    }\n  }\n  if (cishu == 0) {\n    return -1;\n  } else {\n    return weizhi;\n  }\n}\nint main() {\n  char zfc[300], beiti[256], ti[256];\n  scanf(\"%s%s%s\", zfc, beiti, ti);\n  int lenzfc, lenbt, lent, weizhi, i;\n  lenzfc = strlen(zfc);\n  lenbt = strlen(beiti);\n  lent = strlen(ti);\n  weizhi = dingwei(beiti, zfc);\n  if (weizhi < 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    if (lenbt == lent) {\n      for (i = 0; i < lenbt; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n\n    } else if (lenbt > lent) {\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      for (i = 0; i < (lenzfc - lenbt - weizhi); i++) {\n        zfc[weizhi + lent + i] = zfc[weizhi + lenbt + i];\n      }\n      zfc[lenzfc - lenbt + lent] = '\\0';\n    } else {\n      if (lenbt < lent) {\n        for (i = lenzfc - 1; i >= weizhi + lenbt; i--) {\n          zfc[i + lent - lenbt] = zfc[i];\n        }\n        for (i = 0; i < lent; i++) {\n          zfc[weizhi + i] = ti[i];\n        }\n        zfc[lenzfc + lent - lenbt] = '\\0';\n      }\n    }\n    printf(\"%s\\n\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (s[i] == a[0]) {\n      k = 0;\n      for (j = 1; j < y; j++) {\n        if (s[i + j] != a[j])\n          k = 1;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < z; j++)\n        printf(\"%c\", b[j]);\n      for (i = i + y; i < x; i++)\n        printf(\"%c\", s[i]);\n      break;\n    }\n    if (k == 1)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12085", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257];\n  char substring[257];\n  char replacement[257];\n  int h, i, j, k, l1, l2, l3, temp, r = 0, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s \", replacement);\n  l1 = strlen(string);\n  l2 = strlen(substring);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    if (string[i] == substring[0]) {\n      temp = i;\n      r = 0;\n      for (j = 0; j < l2; j++) {\n        if (string[temp + j] == substring[j]) {\n          r = r + 1;\n        }\n      }\n      if (r == l2) {\n\n        for (h = 0; h < temp; h++)\n          printf(\"%c\", string[h]);\n\n        for (j = 0; j < l3; j++) {\n          printf(\"%c\", replacement[j]);\n        }\n        for (k = temp + l2; k < l1; k++) {\n          printf(\"%c\", string[k]);\n        }\n\n        return 0;\n      }\n    }\n  }\n\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char X[300];\n  char Y[100];\n  char Z[100];\n\n  cin >> X;\n\n  cin >> Y;\n\n  cin >> Z;\n  int l, l1, l2;\n  l = strlen(X);\n  l1 = strlen(Y);\n  l2 = strlen(Z);\n  int i;\n  int A = -1;\n  for (i = 0; i < l; i++) {\n    if (X[i] == Y[0] && X[i + 1] == Y[1] && X[i + l1 - 1] == Y[l1 - 1] &&\n        X[i + l1 - 2] == Y[l1 - 2]) {\n      A = i;\n      break;\n    }\n  }\n  if (A != -1) {\n    for (i = 0; i < A; i++) {\n      printf(\"%c\", X[i]);\n    }\n    for (i = 0; i < l2; i++) {\n      printf(\"%c\", Z[i]);\n    }\n    for (i = A + l1; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  } else {\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int len1, len2, len3, i, j, k;\n  scanf(\"%s\\n\", w);\n  scanf(\"%s\\n\", s);\n  scanf(\"%s\", r);\n  len1 = (int)strlen(s);\n  len2 = (int)strlen(w);\n  len3 = (int)strlen(r);\n  for (i = 0; i < len2; i++) {\n    if (w[i] == s[0]) {\n      for (j = 1; j < len1; j++) {\n        if (s[j] != w[i + j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      for (k = 0; k < len3; k++) {\n        w[i + k] = r[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], temp[256];\n  char *p;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  p = strstr(str, sub);\n  if (p != NULL) {\n    *p = 0;\n    strcpy(temp, str);\n    strcat(temp, rep);\n    strcat(temp, p + strlen(sub));\n    strcpy(str, temp);\n  }\n  cout << str << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n1, n2;\n  char s1[257], s2[257], s3[257];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < n1; i++)\n    if (s1[i] == s2[0]) {\n      j = 0;\n      while (s1[i + j] == s2[j] && j < n2)\n        j++;\n      if (j == n2) {\n        for (k = i; k < i + n2; k++)\n          s1[k] = s3[k - i];\n        break;\n      }\n    }\n  for (i = 0; i < n1; i++)\n    printf(\"%c\", s1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12090", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    if (a[i - 1] == b[0]) {\n      for (j = 1; b[j - 1] != '\u0000'; j++) {\n        if (a[i - 1 + j - 1] != b[j - 1])\n          break;\n      }\n      if (b[j - 1] != '\u0000')\n        continue;\n      else {\n        for (j = i; b[j - i] != '\u0000'; j++)\n          a[j - 1] = c[j - i];\n      }\n      break;\n    } else\n      continue;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int x, y, z, k, l, i, j, m, n, cha, mark = 0;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(s);\n\n  for (i = 0; i < z; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < x; j++) {\n        if ((s[i + j] == a[j]) && (j != x - 1)) {\n          continue;\n        } else if (s[i + j] != a[j]) {\n          break;\n        } else if ((s[i + j] == a[j]) && (j == x - 1)) {\n          mark++;\n          if (x > y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n            cha = x - y;\n            for (m = i + x; m < z; m++) {\n              s[m - cha] = s[m];\n            }\n            s[z - cha] = '\u0000';\n          } else if (x == y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n          } else if (x < y) {\n            cha = y - x;\n            for (l = z - 1; l >= i + x; l--) {\n              s[l + cha] = s[l];\n            }\n            for (n = 0; n < y; n++) {\n              s[i + n] = b[n];\n            }\n            s[z + cha] = '\u0000';\n            z = strlen(s);\n          }\n        }\n      }\n    }\n    if (mark != 0) {\n      cout << s;\n      return 0;\n    }\n  }\n  if (mark == 0) {\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12092", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p, *q, *r;\n  p = (char *)malloc(1000);\n  q = (char *)malloc(1000);\n  r = (char *)malloc(1000);\n  scanf(\"%s \", p);\n  cin >> q;\n  cin >> r;\n  int a, b, c;\n  a = strlen(p);\n  b = strlen(q);\n  c = strlen(r);\n  int i, j, k;\n  int t = 1;\n  for (i = 0; i < a; i++) {\n    for (j = i, k = 0; j < i + b; j++, k++) {\n      if (p[j] != q[k]) {\n        t = 0;\n        break;\n      }\n    }\n    if (k == b)\n      break;\n  }\n  if (k == b) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", p[j]);\n    printf(\"%s\", r);\n    for (j = i + b; j < a; j++)\n      printf(\"%c\", p[j]);\n  } else\n    printf(\"%s\", p);\n  return 0;\n}\n"}
{"label": "7", "index": "12093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], *p;\n  cin >> a >> b >> c;\n  p = strstr(a, b);\n  if (p == NULL)\n    puts(a);\n  else {\n    *p = '\u0000';\n    strcpy(d, a);\n    strcat(d, c);\n    strcat(d, p + strlen(b));\n    puts(d);\n  }\n}\n"}
{"label": "7", "index": "12094", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n\n  char string[256], sub[256], re[256];\n\n  int i, j;\n\n  cin >> string;\n\n  cin >> sub;\n\n  cin >> re;\n\n  int len1 = strlen(string), len2 = strlen(sub), len3 = strlen(re);\n\n  for (i = 0; i <= len1 - len2; i++)\n\n  {\n\n    for (j = 0; j < len2; j++)\n\n    {\n\n      if (sub[j] != string[i + j])\n        break;\n    }\n\n    if (j != len2)\n      continue;\n\n    if (j == len2)\n\n    {\n\n      for (j = 0; j < len2; j++)\n        string[i + j] = re[j];\n\n      break;\n    }\n  }\n\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12095", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000];\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s\", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j])\n      j++;\n    else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      mubiao[i] = replace[j];\n\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n    if (j >= len2)\n      break;\n    if (j)\n      j = 0;\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, e = 0, k, l = 0;\n  char a[260] = {'\\0'}, b[260] = {'\\0'}, c[260] = {'\\0'};\n  cin >> b >> a >> c;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == a[0]) {\n      for (j = 0; j < strlen(a); j++) {\n        if (b[i + j] != a[j]) {\n          e = 1;\n        }\n      }\n      if (e == 0) {\n        k = i;\n        l = 1;\n        break;\n      } else\n        e = 0;\n    }\n  }\n\n  if (l == 1) {\n    for (i = 0; i < k; i++) {\n      cout << b[i];\n    }\n    printf(\"%s\", c);\n    for (i = k + strlen(a); i < strlen(b); i++) {\n      printf(\"%c\", b[i]);\n    }\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "12098", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], re[257];\n  int i, j, k, n1, n2, n3, h = 0;\n  scanf(\"%s %s %s \", str, sub, re);\n  n1 = strlen(str);\n  n2 = strlen(sub);\n  n3 = strlen(re);\n  for (i = 0; i <= n1 - n2; i++) {\n    if (str[i] == sub[0]) {\n      int ll = 0;\n      for (j = 0; j < n2; j++) {\n        if (str[i + j] != sub[j]) {\n          ll = 1;\n          break;\n        } else\n          continue;\n      }\n      if (ll == 0) {\n        h = 1;\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", str[k]);\n        }\n        for (k = 0; k < n3; k++) {\n          printf(\"%c\", re[k]);\n        }\n        for (k = i + n2; k < n1; k++) {\n          printf(\"%c\", str[k]);\n        }\n        break;\n      } else\n        continue;\n    }\n  }\n  if (h == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], temp[100];\n  int i, j = 0, k, lena, lenb, mark = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  lena = strlen(a);\n  lenb = strlen(b);\n\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < lenb; j++) {\n        if (a[i + j] == b[j])\n          mark = 1;\n        else {\n          mark = 0;\n          break;\n        }\n      }\n    }\n    if (mark == 1) {\n      for (k = 0; k < lenb; k++)\n        a[i + k] = c[k];\n      break;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    cout << a[i];\n  }\n}\n"}
{"label": "7", "index": "12100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[100], h[100], c[100];\n  int i, j, len[3], count = 0, k = 0, a[100];\n  scanf(\"%s\", &y);\n  scanf(\"%s\", &h);\n  scanf(\"%s\", &c);\n  for (i = 0; i < strlen(y); i++) {\n    for (j = 0; j < strlen(h); j++) {\n      if (y[i + j] == h[j]) {\n        count++;\n      }\n    }\n    if (count == strlen(h)) {\n      k++;\n      a[k] = i;\n    }\n    count = 0;\n  }\n  if (k == 0) {\n    printf(\"%s\", y);\n    return 0;\n  }\n  for (i = 0; i < a[1]; i++)\n    printf(\"%c\", y[i]);\n  printf(\"%s\", c);\n  if (i == k)\n    return 0;\n  for (j = a[1] + strlen(h); j < strlen(y); j++) {\n    printf(\"%c\", y[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12101", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sl, al, i, j, flag = 0;\n  char s[256], a[256], b[256];\n  cin >> s >> a >> b;\n  sl = strlen(s);\n  al = strlen(a);\n  for (i = 0; i < sl; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < al; j++) {\n        if (s[i + j] == a[j])\n          flag = 1;\n        else\n          flag = 0;\n        continue;\n      }\n      if (flag == 1) {\n        for (j = 0; j < al && s[i + j] == a[j]; j++) {\n          s[i + j] = b[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char src[256];\n  char dst[256];\n  char replacement[256];\n\n  scanf(\"%s\", src);\n  scanf(\"%s\", dst);\n  scanf(\"%s\", replacement);\n  char *p = strstr(src, dst);\n  if (p == NULL)\n    cout << src << \"\\n\";\n  else {\n    int len = strlen(replacement);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = replacement[i];\n      p++;\n    }\n    cout << src << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12103", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  cin >> str >> subString >> replacement;\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    if (repLen < subLen) {\n      move = subLen - repLen;\n      while (*(p + move) != '\\0') {\n        *p++ = *(p + move);\n      }\n      *p = '\\0';\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin.getline(str, 256);\n  cin.getline(sub, 256);\n  cin.getline(rep, 256);\n  int i, j, len1, len2;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i <= len1 - len2; i++) {\n    j = 0;\n    while (str[i + j] == sub[j] && j < len2)\n      j++;\n    if (j == len2) {\n      while (j > 0) {\n        j--;\n        str[i + j] = rep[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, flag, w, j, len;\n  char str[257], sub[200], rep[50];\n  cin >> str >> sub >> rep;\n  len = strlen(sub);\n  w = 500;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == sub[0]) {\n\n      for (j = i; j < i + len; j++) {\n        if (str[j] != sub[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n\n      if (flag != 0) {\n        w = i;\n        break;\n      } else\n        flag = 1;\n    }\n  }\n  if (w != 500) {\n    j = 0;\n    for (i = w + len; str[i] != '\\0'; i++) {\n      sub[j] = str[i];\n      j++;\n    }\n    sub[j] = '\\0';\n    str[w] = '\\0';\n    cout << str << rep << sub;\n  } else\n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[257], b[257], r[257];\n  scanf(\"%s\", b);\n  cin >> a;\n  scanf(\"%s\", r);\n  int c, d, count, e;\n  int j, h, y;\n  c = strlen(a);\n  d = strlen(b);\n  e = strlen(r);\n\n  for (j = 0; j < d; j++) {\n    y = 0;\n    h = j;\n    if (b[j] != a[0])\n      continue;\n    else {\n      count = 1;\n      for (int t = 1; t < c; t++) {\n\n        if (a[t] == b[j + t])\n          count++;\n      }\n    }\n    if (count == c) {\n      y = 1;\n      break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (y == 1) {\n\n    for (j = 0; j < h; j++)\n      printf(\"%c\", b[j]);\n    for (j = 0; j < e; j++)\n      printf(\"%c\", r[j]);\n    for (j = h + c; j < d; j++)\n      printf(\"%c\", b[j]);\n  } else\n    cout << b;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  int i;\n  int b, c;\n  char *p;\n  scanf(\"%s%s%s\", str1, str2, str3);\n  b = strlen(str2);\n  p = strstr(str1, str2);\n  if (p)\n\n  {\n    for (i = 0; str1 + i < p; i++) {\n      printf(\"%c\", str1[i]);\n    }\n    cout << str3;\n\n    p = p + b;\n\n    printf(\"%s\", p);\n\n  }\n\n  else {\n    printf(\"%s\", str1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  char *str, *sub;\n  int a, n = 0, b;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  sub = substring;\n  a = strlen(substring);\n\n  for (str = string; *str != '\\0'; str++) {\n    if (*sub == *str) {\n      if (*(sub + 1) != '\\0') {\n        sub++;\n      } else {\n        str = str - a + 1;\n        n = 1;\n        break;\n      }\n    } else {\n      sub = substring;\n    }\n  }\n\n  if (n == 0) {\n    printf(\"%s\", string);\n    return 0;\n  }\n\n  sub = replacement;\n  for (b = 0; b < strlen(substring); b++) {\n    *str = *sub;\n    sub++;\n    str++;\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12109", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, n, m, d = 0;\n  int e = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      if (a[i + 1] == b[1]) {\n        if (a[i + 2] == b[2]) {\n          d = i;\n          break;\n        }\n      }\n    }\n  }\n\n  m = strlen(c);\n  if (d != 0) {\n\n    for (i = d; i < d + m; i++) {\n\n      a[i] = c[e];\n      e++;\n    }\n  }\n  puts(a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257];\n  char a[257];\n  char a1[257];\n  int i, j, len, n = 0, k, flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> a1;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      n = i;\n      for (j = i + 1, k = 1; j < i + len; j++, k++) {\n        if (s[j] != a[k]) {\n          flag = 0;\n        }\n      }\n      if (flag == 1)\n        break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", a1);\n    for (i = n + len; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n  }\n  if (flag == 0)\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12111", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256];\n  char s2[256];\n  char s3[256];\n  int i, j, q;\n  cin >> s1 >> s2 >> s3;\n\n  int k1 = strlen(s1);\n  int k2 = strlen(s2);\n  for (i = 0; i < k1; i++) {\n    int k = 0;\n    for (j = 0; j < k2; j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n      if (s1[i + j] == s2[j]) {\n        k++;\n      }\n    }\n\n    if (k == k2) {\n      q = i;\n      break;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != q) {\n      printf(\"%c\", s1[i]);\n    }\n    if (i == q) {\n      printf(\"%s\", s3);\n      i = i + k2 - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    int k = 0;\n    if (a[i] == b[0]) {\n      k = 1;\n      for (int e = 0; b[e] != '\u0000'; e++) {\n        if (a[i + e] != b[e])\n          k = 0;\n      }\n      if (k == 1)\n        for (int f = 0; b[f] != '\u0000'; f++) {\n          a[i + f] = c[f];\n        }\n    }\n    if (k == 1)\n      break;\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12113", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s \", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12114", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  int i, j, len1, len2, ex = 0, a = 0, shit = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (string[i + j] == substring[j]) {\n        ex++;\n      }\n      if (ex == len2 && shit == 0) {\n        shit = 1;\n        for (j = a; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        printf(\"%s\", replacement);\n        a = i + len2;\n      }\n    }\n    ex = 0;\n  }\n  for (j = a; j < len1; j++) {\n    printf(\"%c\", string[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h = 0;\n  char a[100], b[100], c[100];\n  cin >> a >> b >> c;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0]) {\n      h = 0;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[j + i] == b[j]) {\n          h++;\n        }\n      }\n      if (h == strlen(b)) {\n        for (j = 0; j < strlen(c); j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m = 0;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  k = strlen(b);\n\n  i = strstr(a, b) - a;\n\n  if (i >= 0 && i <= n - k) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + k; j < n; j++) {\n      printf(\"%c\", a[j]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      cout << a[i];\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[257];\n  char str2[257];\n  char str3[257];\n  scanf(\"%s %s %s \", str1, str2, str3);\n  char *p = NULL;\n  p = strstr(str1, str2);\n  if (p != NULL) {\n    for (int i = 0; i < strlen(str3); i++) {\n      *p = *(str3 + i);\n      p++;\n    }\n  }\n  cout << str1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12118", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[300], sub[300], rep[300], m, k, n;\n  int i, j;\n\n  cin >> zfc;\n\n  cin >> sub;\n\n  scanf(\"%s \", rep);\n  for (i = 0; i <= strlen(zfc) - strlen(sub); i++) {\n    m = 0;\n    for (j = 0; j < strlen(sub); j++) {\n      if (sub[j] != zfc[i + j]) {\n        m = -1;\n        break;\n      } else\n        m = 1;\n    }\n    if (m == 1) {\n      n = i;\n      break;\n    }\n  }\n  if (m == 1) {\n    for (k = n; k < n + strlen(sub); k++) {\n      zfc[k] = rep[k - n];\n    }\n\n    printf(\"%s\", zfc);\n  }\n\n  else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], re[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int bar = 0, min = 0;\n  int len1 = strlen(str), len2 = strlen(sub);\n  for (int i = 0; i < len1;) {\n    bar = 0;\n    if (str[i] == sub[0]) {\n      for (int j = 0; j < len2; j++) {\n        if (str[i + j] != sub[j]) {\n          bar = 1;\n        }\n      }\n      if (bar == 0 && min == 0) {\n        printf(\"%s\", re);\n        i = i + len2;\n        min = 1;\n      } else {\n        printf(\"%c\", str[i]);\n        i = i + 1;\n        bar = 0;\n      }\n    } else {\n      printf(\"%c\", str[i]);\n      i = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], sub[256], rep[256];\n  int i, j, k;\n  int lens, lensub;\n\n  cin >> s, cin >> sub, cin >> rep;\n  lens = strlen(s);\n  lensub = strlen(sub);\n\n  for (i = 0; i <= lens - lensub; i++) {\n    for (j = 0; j < lensub; j++)\n      if (s[i + j] != sub[j])\n        break;\n    if (j == lensub) {\n      for (k = 0; k < j; k++)\n        s[i + k] = '@';\n      i += j - 1;\n      break;\n    }\n  }\n\n  for (i = 0; i < lens; i++)\n    if (s[i] == '@') {\n      while (s[i] == '@')\n        i++;\n      i--;\n      printf(\"%s\", rep);\n    } else\n      printf(\"%c\", s[i]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int d[1000];\n  int i, j = 0, k, m, n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == '\u0000')\n      break;\n    else {\n      if (a[i] == b[0]) {\n        j++;\n        d[j] = i;\n      }\n    }\n  }\n  if (j == 0)\n    printf(\"%s\", a);\n  else {\n    m = j;\n    for (i = 0;; i++) {\n      if (b[i] == '\u0000')\n        break;\n    }\n    n = i;\n    for (j = 0; j < m; j++) {\n      k = d[j];\n      for (i = 0; i < n; i++) {\n        if (b[i] != a[i + k])\n          break;\n      }\n      if (i == n)\n        break;\n    }\n    for (i = 0; i < n; i++) {\n      a[i + d[j]] = c[i];\n    }\n    printf(\"%s\", a);\n  }\n}\n"}
{"label": "7", "index": "12122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char sub[300];\n  char re[300];\n  scanf(\"%s %s %s \", str, sub, re);\n  int i, j, k, first;\n  int len = strlen(str);\n  int len1 = strlen(sub);\n  int len2 = strlen(re);\n  first = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i, j = 0; j < len1; j++, k++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      first = i;\n      break;\n    }\n  }\n  if (j != len1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < first; i++) {\n      cout << str[i];\n    }\n    printf(\"%s\", re);\n    for (i = (first + len2); i < len; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, a;\n  char s[1000], s1[1000], s2[1000];\n  char *ps1 = s1, *ps2 = s2;\n\n  scanf(\"%s \", s2);\n\n  scanf(\"%s \", s1);\n\n  cin >> s;\n  int l1 = strlen(s1);\n  int l2 = strlen(s2);\n  for (a = 0, b = 0; a < l2 && b == 0; a = i + 1) {\n    for (i = a, ps1 = s1, ps2 = s2 + a;\n         *ps1 != *ps2 && *ps1 != '\u0000' && *ps2 != '\u0000'; ps2++, i++)\n      ;\n    for (j = 0, b = 1; *ps1 != '\u0000' && *ps2 != '\u0000'; ps1++, ps2++, j++) {\n      if (*ps1 != *ps2 && j < l1) {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (i == l2)\n    printf(\"%s\", s2);\n  else {\n    n = i;\n    s2[n] = '\u0000';\n    printf(\"%s\", s2);\n    printf(\"%s\", s);\n    ps2 = s2 + n + l1;\n    printf(\"%s\", ps2);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12124", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  cin >> str >> sub >> rep;\n  int len = strlen(sub);\n  int i = 0;\n  char *p, *q, *r;\n  p = strstr(str, sub);\n  q = rep;\n  if (p != NULL) {\n    for (r = p; r < p + len; r++)\n      *r = *q++;\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char z[257];\n  char y[257];\n  char t[257];\n  int i, j, p;\n  int v, x, s;\n  int result;\n  int word = 0;\n  int a;\n\n  cin >> y;\n\n  cin >> z;\n\n  cin >> t;\n  v = strlen(z);\n  x = strlen(y);\n  s = strlen(t);\n\n  for (i = 0; y[i] != '\u0000'; i++) {\n    if ((y[i] == z[0]) && (y[i + v - 1] == z[v - 1])) {\n      for (p = 0; p <= v - 1; p++) {\n        if (y[i + p] == z[p]) {\n          word++;\n        }\n      }\n      if (word == v) {\n\n        a = i;\n\n        result = 0;\n      }\n    }\n    \n    \n    \n  }\n  \n  if (result == 0) {\n    for (i = 0; i <= a - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n    for (i = 0; i <= s - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    for (i = a + v; i <= x - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n  } else\n    printf(\"%s\", y);\n  return 0;\n}\n"}
{"label": "7", "index": "12126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL;\n  char str[100], substr[100], restr[100];\n  cin >> str >> substr >> restr;\n  p = strstr(str, substr);\n  if (p != NULL) {\n    strcat(restr, p + strlen(substr));\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  int i;\n  int b;\n  char *p;\n\n  scanf(\"%s%s%s\", str1, str2, str3);\n\n  b = strlen(str2);\n\n  p = strstr(str1, str2);\n\n  if (p)\n\n  {\n    for (i = 0; str1 + i < p; i++) {\n      printf(\"%c\", str1[i]);\n    }\n    printf(\"%s\", str3);\n\n    p = p + b;\n\n    printf(\"%s\", p);\n\n  }\n\n  else\n    printf(\"%s\", str1);\n}\n"}
{"label": "7", "index": "12128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int n, i, j, length1, length2, k, h;\n  k = 0;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length2; i++) {\n    if (s1[0] == s2[i]) {\n      j = 0;\n      while (s2[j + i] == s1[j] && j < length1)\n        j++;\n      if (j == length1)\n        k = i;\n    }\n    if (k)\n      break;\n  }\n  h = k;\n  if (k) {\n    for (h = k; h < k + length1; h++)\n      s2[h] = s3[h - k];\n  }\n  cout << s2;\n}\n"}
{"label": "7", "index": "12129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000], sub[500], rep[500];\n  int n, m, cut, i = 0, flag = 0;\n  scanf(\"%s %s %s \", str, sub, rep);\n  n = strlen(str);\n  m = strlen(sub);\n  cut = strlen(rep);\n  while (str[i] != '\\0') {\n    if (str[i] == sub[0]) {\n      int j = 0;\n      int k = i;\n      while (sub[j] != '\\0') {\n        if (sub[j] == str[k]) {\n          j++;\n          k++;\n        } else\n          break;\n      }\n      if (j == m) {\n        for (int t = n - 1; t >= i + m; t--) {\n          str[t + cut - m] = str[t];\n        }\n        str[n + cut - m] = '\\0';\n        for (int t = i; t < i + cut; t++) {\n          str[t] = rep[t - i];\n        }\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    i++;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], rep[256];\n  int t, i, j, k;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    t = 0;\n    if (s[i] == sub[0]) {\n      for (j = i, k = 0; sub[k] != '\u0000'; j++, k++) {\n        if (s[j] != sub[k]) {\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        for (j = i; rep[j - i] != '\u0000'; j++) {\n          s[j] = rep[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], substr[50], r[50];\n\n  scanf(\"%s \", str);\n\n  cin >> substr;\n\n  cin >> r;\n  int i, j, n, same = 0;\n  int l = strlen(substr);\n  for (i = 0; str[i] != 0; i++) {\n    if (substr[0] == str[i]) {\n      same = 1;\n      for (j = 1; substr[j] != 0; j++) {\n        if (substr[j] != str[i + j]) {\n          same = 0;\n          break;\n        }\n      }\n      if (same == 1) {\n        n = i;\n        break;\n      }\n    }\n  }\n  if (same == 1) {\n    for (j = 0; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"%s\", r);\n    for (j = n + l; str[j] != 0; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  if (same == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12132", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[257], rep[257];\n  int i, j, t, k;\n  int len_s, len_sub, len_rep;\n  cin.getline(s, 257);\n  cin.getline(sub, 257);\n  cin.getline(rep, 257);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  len_rep = strlen(rep);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", sub);\n\n  scanf(\"%s \", re);\n  int i, length, lensub, j, k, ans = 0;\n  length = strlen(s);\n  lensub = strlen(sub);\n  for (i = 0; i < length; i++)\n    if (s[i] == sub[0]) {\n      for (j = 0; j < lensub; j++)\n        if (s[i + j] != sub[j])\n          break;\n      if (j == lensub) {\n        ans = 1;\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", re);\n        for (k = i + lensub; k < length; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  if (ans != 1)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char M[3][20];\n  scanf(\"%s\", M[0]);\n  if (M[0][0] == 'i')\n    printf(\"iloveearth\");\n  else if (M[0][0] == 's')\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n  else {\n    printf(\"programmingiscool\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[260] = {0}, substring[50] = {0}, replacement[50] = {0},\n       temp[50] = {0}, length, length_s, length_r, i, j, k = 0, m, n;\n  cin >> string >> substring >> replacement;\n  length = strlen(string);\n  length_s = strlen(substring);\n  length_r = strlen(replacement);\n  for (i = 0; i <= length - length_s; i++) {\n    memset(temp, 0, sizeof(temp));\n    k = 0;\n    for (j = i; j < i + length_s; j++) {\n      temp[k++] = string[j];\n    }\n    if (!strcmp(temp, substring)) {\n      if (length_s != length_r) {\n        n = i + length_s;\n        for (m = i + length_r; m < length; m++) {\n          string[m] = string[n++];\n        }\n      }\n      n = 0;\n      for (m = i; m < i + length_r; m++) {\n        string[m] = replacement[n++];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[101], b[101];\n  int i, len, k, j, len1, len2, l, n, p = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  len = strlen(s);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == a[0] && p == 0) {\n      k = 0;\n      while (s[i + k] == a[k] && k < len1)\n        k++;\n\n      if (k == len1) {\n        p = 1;\n\n        len = strlen(s);\n        len1 = strlen(a);\n        len2 = strlen(b);\n        if (len1 == len2) {\n          for (j = 0; j < k; j++) {\n            s[i + j] = b[j];\n          }\n        }\n        if (len1 > len2) {\n          for (j = 0; j < len1; j++) {\n            s[i + j] = b[j];\n          }\n          for (j = len2, l = k; (l + i) <= len; j++, l++) {\n            s[i + j] = s[i + l];\n          }\n        }\n        if (len1 < len2) {\n          len = strlen(s);\n          n = len2 - len1;\n          for (l = len; l >= (i + k); l--)\n            s[l + n] = s[l];\n          for (j = 0; j < len2; j++)\n            s[i + j] = b[j];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[256], substring[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  scanf(\"%s %s %s\", string, substring, replacement);\n  int mainlen = strlen(string), sublen = strlen(substring);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, substring)) {\n      strncpy(result, string, i); \n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  printf(\"%s\", string); \n  return 0;\n}\n"}
{"label": "7", "index": "12138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(int i, char a[], char b[]) {\n  int k;\n  for (k = 0; b[k] != '\u0000'; i++, k++) {\n    if (a[i] != b[k])\n      break;\n  }\n  if (b[k] == '\u0000')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, n, k;\n  char s[256], subs[256], re[256];\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> re;\n  for (i = 0, n = 0; n == 0 && s[i] != '\u0000'; i++) {\n    if (s[i] == subs[0])\n      n = cmp(i, s, subs);\n  }\n  if (n == 1) {\n    for (i = i - 1, k = 0; re[k] != '\u0000'; i++, k++)\n      s[i] = re[k];\n  }\n  printf(\"%s \", s);\n}\n"}
{"label": "7", "index": "12139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char st[1000], su[1000], re[1000];\n  cin >> st >> su >> re;\n  int m, n, i, j, p = 0, q;\n  n = strlen(st);\n  m = strlen(su);\n  for (i = 0; i < n; i++) {\n    if (su[0] == st[i]) {\n      for (j = 1; j < m; j++) {\n        if (su[j] != st[i + j]) {\n          break;\n        } else\n          p++;\n      }\n    }\n    if (p == (m - 1)) {\n      for (q = i; q < i + m; q++) {\n        st[q] = re[q - i];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", st);\n  return 0;\n}\n"}
{"label": "7", "index": "12140", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, m = 0, L, l1, l2;\n  char s[256], a[100], b[100];\n  scanf(\"%s\", s);\n  cin >> a;\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      for (m = 0; m < l2; m++) {\n        s[i + m] = b[m];\n      }\n      break;\n    }\n  }\n  for (k = 0; k < i + m; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (i = i + l1; i < L; i++) {\n    printf(\"%c\", s[i]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12141", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  cin >> string;\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int lenth = 0;\n  int judge = 0;\n  for (int i = 0; substring[i] != '\\0'; i++) {\n    lenth++;\n  }\n  for (int i = 0; i < 256; i++) {\n    if (string[i] == substring[0]) {\n      int count;\n      for (count = 0; substring[count] != '\\0'; count++) {\n        if (string[i + count] != substring[count]) {\n          break;\n        }\n      }\n      if (count == lenth) {\n        for (int j = 0; j < i; j++)\n          printf(\"%c\", string[j]);\n\n        printf(\"%s\", replacement);\n        for (int j = i + lenth; string[j] != '\\0'; j++) {\n          printf(\"%c\", string[j]);\n        }\n        judge = 1;\n        break;\n      }\n    }\n  }\n  if (judge == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int n = 0, q = 0;\n  for (int i = 0; b[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    q++;\n  }\n  int i, j, k, p;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    int m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i + j] == b[j])\n        m++;\n    }\n    if (m == n)\n      break;\n  }\n  if (i == q)\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  else {\n    for (k = 0; c[k] != '\u0000'; k++) {\n      a[k + i] = c[k];\n    }\n    for (p = 0; a[p] != '\u0000'; p++) {\n      printf(\"%c\", a[p]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12143", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100] = {'\u0000'}, w[50] = {'\u0000'}, d[50] = {'\u0000'};\n  int i, j, k = 0, t = 0, m, n = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == w[0]) && (n == 0)) {\n      k = 0;\n      for (j = 0; w[j] != '\u0000'; j++) {\n        t = 0;\n        if (w[j] == s[i + j]) {\n          k++;\n          t = 1;\n        }\n      }\n      if (t == 1) {\n        for (m = 0; d[m] != '\u0000'; m++) {\n          printf(\"%c\", d[m]);\n        }\n        i = i + k;\n        n = 1;\n      }\n    }\n    if (s[i] != '\u0000') {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100] = {'\u0000'}, w[50] = {'\u0000'}, d[50] = {'\u0000'}, h[100] = {'\u0000'};\n  int i, j, k = 0, t = 0, m, n = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == w[0]) && (n == 0)) {\n      k = 0;\n      for (j = 0; w[j] != '\u0000'; j++) {\n        t = 0;\n        if (w[j] == s[i + j]) {\n          k++;\n          t = 1;\n        }\n      }\n      if (t == 1) {\n        for (m = 0; d[m] != '\u0000'; m++) {\n          cout << d[m];\n        }\n        i = i + k;\n        n = 1;\n      }\n    }\n    if (s[i] != '\u0000') {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[260], s1[260], s2[260], s3[260];\n  int i, j, k, l, h, len, len1, len2;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0, h = 0; i < len; i++, h++) {\n\n    s3[h] = s[i];\n    if (s[i] == s1[0]) {\n      int e = 1;\n      for (j = 0, k = i; j < len1; j++, k++) {\n        if (s[k] != s1[j]) {\n          e = 0;\n          break;\n        }\n      }\n      if (e) {\n        for (l = 0; l < len2; l++, h++) {\n          s3[h] = s2[l];\n        }\n        h--;\n        i = i + len1 - 1;\n        s1[0] = '.';\n      }\n    }\n  }\n  s3[len - len1 + len2] = '\u0000';\n  printf(\"%s\", s3);\n  return 0;\n}\n"}
{"label": "7", "index": "12146", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL, *q = NULL;\n  char str[100], substr[100], restr[100];\n  cin >> str >> substr >> restr;\n  p = strstr(str, substr);\n  if (p != NULL) {\n    q = p + strlen(substr);\n    strcat(restr, q);\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int n = strlen(a);\n  int m = strlen(b);\n  int i, j;\n  for (int i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] != b[j])\n          break;\n      }\n      if (j == m) {\n        for (j = 0; j < m; j++)\n          a[i + j] = c[j];\n\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[256], z1[256], z2[256];\n  int i, j, k, n, p, count, count1, count2, count4, count3[50];\n  int num1, num2;\n\n  cin >> zfc;\n\n  cin >> z1;\n\n  cin >> z2;\n  count = 0;\n  num1 = strlen(zfc);\n  num2 = strlen(z1);\n  for (i = 0; i < num1; i++) {\n    count1 = 0;\n    for (j = 0; j < num2; j++) {\n      if (zfc[i + j] == z1[j])\n        count1++;\n    }\n    if (count1 == num2)\n      break;\n  }\n  if (count1 == num2) {\n    for (j = i; j < num2 + i; j++) {\n      zfc[j] = z2[j - i];\n    }\n  }\n  cout << zfc;\n  return 0;\n}\n"}
{"label": "7", "index": "12149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  int i, j, k = 0, len1, len2, flag, m, t, q;\n  cin >> b >> a >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len2; i++) {\n    flag = 1;\n    q = 1;\n    if (b[i] == a[0]) {\n      k = i + 1;\n      for (j = 1; j < len1; j++) {\n        if (b[k++] != a[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        t = 0;\n        for (m = i; m < i + len1; m++)\n          b[m] = c[t++];\n        q = 0;\n      }\n    }\n    if (q == 0)\n      break;\n  }\n  printf(\"%s\\n\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "12150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, k, m;\n  char s[256], s1[256], s2[256];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  a = strlen(s);\n  b = strlen(s1);\n  c = strlen(s2);\n  for (i = 0; i < a; i++) {\n    if (s[i] == s1[0]) {\n      for (j = 0; j < b; j++) {\n        if (s[i + j] != s1[j])\n          break;\n      }\n      if (s[i + b - 1] == s1[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", s2);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256 * 2], sub[300], replacement[300], tmp[300];\n  int i, j, result = -1, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> replacement;\n\n  for (i = 0; i <= (int)(strlen(str) - strlen(sub)); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < (int)strlen(sub); j++) {\n        if (str[i + j] == sub[j])\n          result = i;\n        else {\n          result = -1;\n          break;\n        }\n      }\n    }\n    if (result != -1)\n      break;\n  }\n  k = (int)strlen(replacement);\n  if (result != -1) {\n    strcpy(tmp, (str + i + j));\n    strcpy((str + i), replacement);\n    strcpy((str + i + k), tmp);\n    printf(\"%s\", str);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, s, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < strlen(a); i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < strlen(b)) {\n      k++;\n      j++;\n    }\n    if (j == strlen(b)) {\n      y = 0;\n      for (s = i; s < i + strlen(b); s++) {\n        a[s] = c[s - i];\n      }\n      y = 1;\n    }\n    if (y == 1)\n      break;\n  }\n\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12153", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000], w[1000], h[1000];\n  int len_1, len_2, len_3, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s \", w);\n  scanf(\"%s\", h);\n  len_1 = strlen(s);\n  len_2 = strlen(w);\n  len_3 = strlen(h);\n  for (j = 0; j < len_1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < len_2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == len_2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < len_3; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + len_3; k < len_1; k++)\n      printf(\"%c\", s[k]);\n    printf(\" \");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[266];\n  char a[266];\n  char b[266];\n  int i, k, j = 0, c = 0, d = 0, p = 0, mark = 0;\n  scanf(\"%s\", zf);\n  c = strlen(zf);\n  scanf(\"%s\", a);\n  d = strlen(a);\n  scanf(\"%s\", b);\n  for (i = 0; i < c; i++) {\n    if (zf[i] == a[0]) {\n      for (k = 0; k < d; k++) {\n        if (zf[i + k] == a[k]) {\n          j++;\n          if (j == d) {\n            p = i;\n            mark = 1;\n          }\n        }\n      }\n    }\n  }\n  if (mark == 1) {\n    for (i = 0; i < p; i++) {\n      printf(\"%c\", zf[i]);\n    }\n    printf(\"%s\", b);\n    for (i = p + d; i < c; i++) {\n      printf(\"%c\", zf[i]);\n    }\n  }\n  if (mark == 0)\n    printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "12155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  char *str, *sub;\n  int a, n = 0, b;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  sub = substring;\n  a = strlen(substring);\n\n  for (str = string; *str != '\\0'; str++) {\n    if (*sub == *str) {\n      if (*(sub + 1) != '\\0') {\n        sub++;\n      } else {\n        str = str - a + 1;\n        n = 1;\n        break;\n      }\n    } else\n      sub = substring;\n  }\n\n  if (n == 0) {\n    printf(\"%s\", string);\n    return 0;\n  }\n\n  sub = replacement;\n  for (b = 0; b < strlen(substring); b++) {\n    *str = *sub;\n    sub++;\n    str++;\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12156", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[257 * 2], a[257], b[257];\n  scanf(\"%s \", s1);\n  cin >> a;\n  scanf(\"%s\", b);\n  int i, j, k, st, end;\n  st = 0;\n  end = 0;\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == a[0]) {\n      for (k = i + 1, j = 1; s1[k] != 0 && a[j] != 0; k++, j++) {\n        if (s1[k] != a[j])\n          break;\n      }\n      if (a[j] == 0) {\n        st = i;\n        end = k;\n        break;\n      }\n    }\n  }\n  if (st < end) {\n    if (strlen(a) > strlen(b)) {\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n      for (k = end; s1[k] != 0; k++, i++) {\n        s1[i] = s1[k];\n      }\n      s1[i] = 0;\n    } else {\n      i = strlen(s1) + strlen(b) - strlen(a);\n      for (k = strlen(s1); k >= end; k--, i--) {\n        s1[i] = s1[k];\n      }\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, k = 0;\n  while (b[i] != '\u0000') {\n    i++;\n    n1++;\n  }\n  i = 0;\n  while (c[i] != '\u0000') {\n    i++;\n    n2++;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    for (j = 0; j < n1; j++) {\n      if (a[i + j] != b[j])\n        break;\n      if (j == n1 - 1) {\n        for (j = 0; j < i; j++)\n          printf(\"%c\", a[j]);\n        printf(\"%s\", c);\n        for (j = i + n2; a[j] != '\u0000'; j++)\n          printf(\"%c\", a[j]);\n        k++;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  if (k == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[3][257];\n  int i;\n  int l1, l2, l3, re;\n  for (i = 0; i < 3; i++)\n    cin >> a[i];\n  l1 = strlen(a[0]);\n  l2 = strlen(a[1]);\n  l3 = strlen(a[2]);\n  int j, k, z = 0, num = 0, x = 0, count = 0;\n  for (j = 0; j < l1; j++) {\n    if (a[0][j] == a[1][0]) {\n      z = j + 1;\n      for (k = 1; k < l2; k++) {\n        if (a[0][z] == a[1][k])\n          num++;\n        else\n          break;\n        z++;\n      }\n      if (num == l2 - 1) {\n        re = 1;\n        count = j;\n      } else\n        continue;\n    } else if (re == 1)\n      break;\n    else\n      continue;\n  }\n  if (re == 1) {\n    for (i = count; i < l2 + count; i++) {\n      a[0][i] = a[2][x];\n      x++;\n    }\n    printf(\"%s\", a[0]);\n  } else\n    printf(\"%s\", a[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "12159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[1000], x[1000], y[1000], w[1000];\n  int len1, len2, len3, i, j, flag = 0, m, tag, k = 0;\n\n  cin >> zfc;\n\n  cin >> x;\n\n  cin >> y;\n  len1 = strlen(zfc);\n  len2 = strlen(x);\n  len3 = strlen(y);\n  for (i = 0; i < len1; i++) {\n    if (zfc[i] == x[0]) {\n      m = i;\n      tag = 0;\n      for (j = 0; j < len2; j++) {\n        if (zfc[i + j] != x[j]) {\n          tag = 1;\n          break;\n        }\n      }\n      if (tag == 0) {\n        strcpy(w, zfc);\n        for (j = 0; j < len3; j++) {\n          zfc[m + j] = y[j];\n        }\n        if (m + len3 > len1 || m + len3 == len1) {\n          zfc[m + len3] = '\u0000';\n        } else if (m + len3 < len1) {\n          for (i = m + len3; i < len1 + len3 - len2; i++) {\n            zfc[i] = w[m + len2 + k];\n            k++;\n          }\n          zfc[len1 + len3 - len2] = '\u0000';\n        }\n        flag = 1;\n      }\n    }\n  }\n\n  printf(\"%s \", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12160", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int i, j, n, m1, m2, x = -1, y = 0;\n  cin >> s >> a >> b;\n  n = strlen(s);\n  m1 = strlen(a);\n  m2 = strlen(b);\n  for (i = 0; i <= n - m1; i++) {\n    if (s[i] == a[0]) {\n      y = 1;\n      for (j = 1; j < m1; j++) {\n        if (s[i + j] != a[j]) {\n          y = 0;\n          break;\n        }\n      }\n    }\n    if (y == 1) {\n      x = i;\n      break;\n    }\n  }\n  if (x == -1)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < x; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", b);\n    for (i = x + m1; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i = 0, j = 0, l = strlen(a), l_sub = strlen(sub);\n  while (i < l) {\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j]) {\n        b[i]++;\n      }\n    }\n    i++;\n  }\n  int k = 0, count = 0, w = 999;\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w = k;\n      count++;\n      break;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w) {\n        printf(\"%s\", c);\n        q += l_sub;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12162", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], re[100];\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> re;\n  int bar = 0, min = 0;\n  int len1 = strlen(str), len2 = strlen(sub);\n  for (int i = 0; i < len1;) {\n    bar = 0;\n    if (str[i] == sub[0]) {\n      for (int j = 0; j < len2; j++) {\n        if (str[i + j] != sub[j]) {\n          bar = 1;\n        }\n      }\n      if (bar == 0 && min == 0) {\n        printf(\"%s\", re);\n        i = i + len2;\n        min = 1;\n      } else {\n        printf(\"%c\", str[i]);\n        i = i + 1;\n        bar = 0;\n      }\n    } else {\n      printf(\"%c\", str[i]);\n      i = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char mubiao[1000];\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  cin >> zichuan;\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      mubiao[i] = replace[j];\n\n      i--;\n    }\n  }\n  cout << mubiao << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, p, e;\n  char sz[1000], sf[1000], sc[1000];\n\n  cin >> sz;\n\n  cin >> sf;\n\n  cin >> sc;\n  int len = strlen(sz);\n  int len1 = strlen(sf);\n  for (i = 0; i < len; i++) {\n    e = 0;\n    if (sz[i] == sf[0]) {\n      for (k = 0; k < len1; k++) {\n        if (sz[i + k] == sf[k]) {\n          e++;\n        }\n      }\n\n      if (e == len1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", sz[m]);\n        }\n        printf(\"%s\", sc);\n        for (p = i + len1; p < len; p++) {\n          printf(\"%c\", sz[p]);\n        }\n\n        break;\n      }\n    }\n  }\n  if (e != len1) {\n    printf(\"%s\", sz);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[206], re[256];\n  int i, j, n, m;\n  scanf(\"%s\", s);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  n = strlen(sub);\n  m = strlen(s);\n  for (i = 0; i < m - n + 1; i++) {\n    if (s[i] == sub[0])\n      for (j = 0; j < n; j++) {\n        if (s[i + j] != sub[j])\n          break;\n      }\n    if (j == n) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", s[j]);\n      printf(\"%s\", re);\n      for (j = i + n; j < m; j++)\n        printf(\"%c\", s[j]);\n      break;\n    }\n  }\n  if (i == (1 + m - n))\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256];\n  char s2[256];\n  char s3[256];\n  int i, j, q;\n  cin >> s1 >> s2 >> s3;\n\n  int k1 = strlen(s1);\n  int k2 = strlen(s2);\n  for (i = 0; i < k1; i++) {\n    int k = 0;\n    for (j = 0; j < k2; j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n      if (s1[i + j] == s2[j]) {\n        k++;\n      }\n    }\n\n    if (k == k2) {\n      q = i;\n      break;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != q) {\n      printf(\"%c\", s1[i]);\n    }\n    if (i == q) {\n      cout << s3;\n      i = i + k2 - 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[257], ss[257], r[257];\n  scanf(\"%s\", s);\n  scanf(\"%s\", ss);\n  cin >> r;\n  char left[257];\n  int i, t, k, j;\n  int ls = strlen(s);\n  int lss = strlen(ss);\n\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = 0; j < lss; j++) {\n      if (ss[j] == s[i + j]) {\n        t++;\n      }\n    }\n    if (t == lss) {\n      for (k = 0; k < ls - i - lss; k++) {\n        left[k] = s[k + i + t];\n      }\n      left[k] = '\\0';\n      s[i] = '\\0';\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  if (t == lss) {\n    printf(\"%s\", r);\n    printf(\"%s\", left);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12168", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, n = 0, m = 1, z = 0, t = 1, g;\n  char q[256], p[256], w[256];\n  scanf(\"%s\", q);\n  scanf(\"%s\", p);\n  cin >> w;\n  k = strlen(q);\n  l = strlen(p);\n  for (i = 0; i < k; i++) {\n    if (p[0] == q[i]) {\n      for (j = 1; j < l; j++) {\n        g = 1;\n        if (p[j] != q[j + i])\n          g = 0;\n      }\n      if (g == 1) {\n        z = 1;\n        m = i;\n        break;\n      }\n    }\n  }\n  if (z) {\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", q[j]);\n    }\n    printf(\"%s\", w);\n    for (j = m + l; j < k; j++)\n      printf(\"%c\", q[j]);\n  } else\n    printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "7", "index": "12169", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar word[256], substring[256], replacement[256];\nint l1, l2, l3;\nint the_same(char *ch) {\n  int i;\n  for (i = 0; i < l2; i++) {\n    if (*(ch + i) != substring[i])\n      return 0;\n  }\n  return 1;\n}\nint main() {\n  char *p = NULL, *q = NULL;\n  int i, t;\n  cin.getline(word, 256);\n  l1 = strlen(word);\n  cin.getline(substring, 256);\n  l2 = strlen(substring);\n  cin.getline(replacement, 256);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    t = the_same(&word[i]);\n    if (t == 1) {\n      p = word + i;\n      break;\n    }\n  }\n  if (p == NULL) {\n    for (i = 0; i < l1; i++)\n      cout << word[i];\n  } else {\n    for (q = word; q < p; q++)\n      cout << *q;\n    for (i = 0; i < l3; i++)\n      cout << replacement[i];\n    for (q = p + l2; q < word + l1; q++)\n      cout << *q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[256], b[256], tmp[256];\n  int i, lenstr, lena;\n  char *pstr;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  lenstr = strlen(str);\n  lena = strlen(a);\n\n  for (i = 0; i <= lenstr - lena; i++) {\n    pstr = &str[i];\n    strncpy(tmp, pstr, lena);\n    tmp[lena] = '\u0000';\n\n    if (strcmp(tmp, a) == 0) {\n      str[i] = '@';\n      break;\n    }\n  }\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == '@') {\n      printf(\"%s\", b);\n      i = i + lena - 1;\n    } else\n      cout << str[i];\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "12171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  int t2 = 0;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      t2 += 1;\n    }\n\n    if (t == 1 && t2 == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  int i, j, m, k;\n  int n = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[0]) {\n      n = 0;\n      for (j = 0; b[j] != '\\0'; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n      if (m == n)\n        break;\n    }\n  }\n  if (m == n) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", a[k]);\n    }\n    printf(\"%s\", c);\n    for (k = i + m; a[k] != '\\0'; k++) {\n      printf(\"%c\", a[k]);\n    }\n  }\n\n  if (n != m)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[100], s1[20], s2[20];\n\n  cin >> n;\n\n  cin >> s1;\n  cin >> s2;\n\n  if (n[1] == 'l')\n    cout << \"iloveearth\";\n  else if (n[0] == 's')\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n  else\n    printf(\"programmingiscool\");\n  return 0;\n}\n"}
{"label": "7", "index": "12174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, m, j, tag = 1, jieshu = 1;\n  char zfc[257], dth[257], bth[257], danci[257];\n  int zhyw = 0;\n\n  cin >> zfc;\n\n  cin >> dth;\n\n  cin >> bth;\n  n = strlen(zfc);\n  m = strlen(dth);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == dth[0]) {\n      for (k = 1; k < m; k++) {\n        if (zfc[i + k] != dth[k])\n          tag = 0;\n      }\n      if (tag) {\n        cout << bth;\n        for (j = i + m; j < n; j++)\n          printf(\"%c\", zfc[j]);\n        jieshu = 0;\n      }\n      tag = 1;\n    }\n    if (jieshu) {\n      printf(\"%c\", zfc[i]);\n    }\n    if (jieshu == 0) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256], sl[256];\n  int n, m, i, j, k, e, l;\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &sub);\n  scanf(\"%s\", &re);\n  l = 0;\n  while (s[l] != '\u0000')\n    l++;\n  m = 0;\n  while (sub[m] != '\u0000')\n    m++;\n  n = 0;\n  while (re[n] != '\u0000')\n    n++;\n  for (i = 0; i < l; i++) {\n    k = 1;\n    for (j = 0; j < m; j++)\n      if (s[i + j] != sub[j]) {\n        k = 0;\n        break;\n      }\n    if (k == 1) {\n      e = i;\n      break;\n    }\n  }\n  if (k == 1) {\n    for (i = e + m - 1; s[i] != '\u0000'; i++)\n      sl[i] = s[i];\n    sl[i + 1] = '\u0000';\n    for (i = 0; i < n; i++)\n      s[e + i] = re[i];\n    for (i = e + n; sl[i - n + m] != '\u0000'; i++)\n      s[i] = s[i - n + m];\n    s[i + 1] = '\u0000';\n  }\n  for (i = 0; s[i] != '\u0000'; i++)\n    cout << s[i];\n  cout << \" \";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12176", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char a[257], b[257], c[256]; \n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);                                      \n  int len1 = strlen(a), len2 = strlen(b), len3 = strlen(c); \n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      } \n      if (count == len2) {\n        flag = i;\n        break;\n      } \n    }\n  }\n  if (flag == -1)\n    cout << a; \n  else {\n    for (i = flag; i <= flag + len2 - 1; i++)\n      a[i] = c[i - flag];\n    for (i = 0; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12177", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[260] = {0}, substring[50] = {0}, replacement[50] = {0},\n       temp[50] = {0}, length, length_s, length_r, i, j, k = 0, m, n;\n  scanf(\"%s %s %s \", string, substring, replacement);\n  length = strlen(string);\n  length_s = strlen(substring);\n  length_r = strlen(replacement);\n  for (i = 0; i <= length - length_s; i++) {\n    memset(temp, 0, sizeof(temp));\n    k = 0;\n    for (j = i; j < i + length_s; j++) {\n      temp[k++] = string[j];\n    }\n    if (!strcmp(temp, substring)) {\n      if (length_s != length_r) {\n        n = i + length_s;\n        for (m = i + length_r; m < length; m++) {\n          string[m] = string[n++];\n        }\n      }\n      n = 0;\n      for (m = i; m < i + length_r; m++)\n        string[m] = replacement[n++];\n\n      break;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t = -1, u = -1, e = -1, c = 0;\n  char st[300] = {'0'};\n  char su[300] = {'0'};\n  char re[300] = {'0'};\n  int i, j, m = 0, b = 1;\n  for (i = 0; st[i - 1] != ' '; i++) {\n    scanf(\"%c\", &st[i]);\n  }\n  for (i = 0; su[i - 1] != ' '; i++) {\n    scanf(\"%c\", &su[i]);\n    u++;\n  }\n  for (i = 0; re[i - 1] != ' '; i++) {\n    scanf(\"%c\", &re[i]);\n    e++;\n  }\n  for (i = 0; st[i] != '\u0000'; i++) {\n\n    if (st[i] == su[0]) {\n      m = i;\n      b = 1;\n      for (j = 1; j < u; j++) {\n        if (su[j] != st[m + j]) {\n          b = 0;\n          break;\n        }\n      }\n      if (b == 1) {\n        for (i = m; i < m + u; i++)\n          st[i] = re[i - m];\n        c = 1;\n      }\n      if (c == 1) {\n        break;\n      }\n    }\n  }\n  printf(\"%s\", st);\n  return 0;\n}\n"}
{"label": "7", "index": "12179", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], re[257];\n  int i, j, k, n1, n2, n3, h = 0;\n  cin >> str >> sub >> re;\n  n1 = strlen(str);\n  n2 = strlen(sub);\n  n3 = strlen(re);\n  for (i = 0; i <= n1 - n2; i++) {\n    if (str[i] == sub[0]) {\n      int ll = 0;\n      for (j = 0; j < n2; j++) {\n        if (str[i + j] != sub[j]) {\n          ll = 1;\n          break;\n        } else\n          continue;\n      }\n      if (ll == 0) {\n        h = 1;\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", str[k]);\n        }\n        for (k = 0; k < n3; k++) {\n          printf(\"%c\", re[k]);\n        }\n        for (k = i + n2; k < n1; k++) {\n          printf(\"%c\", str[k]);\n        }\n        break;\n      } else\n        continue;\n    }\n  }\n  if (h == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0}, c[100] = {0};\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int lb, la;\n  lb = strlen(b);\n  la = strlen(a);\n  int count = 0;\n\n  for (int i = 0; i <= la - lb; i++) {\n    count = 0;\n    for (int j = 0; j < lb; j++) {\n      if (a[i + j] != b[j]) {\n        count = 1;\n        break;\n      }\n    }\n\n    if (count == 0) {\n      a[i] = 1;\n      for (int j = 1; j < lb; j++)\n        a[i + j] = 2;\n      break;\n    }\n  }\n  for (int i = 0; i < la; i++) {\n    if (a[i] == 1)\n      printf(\"%s\", c);\n    if (a[i] == 2)\n      ;\n    if (a[i] != 2 && a[i] != 1)\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "12181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sr[1000];\n\n  cin >> sr;\n  char a[1000], b[1000];\n  scanf(\"%s%s\", a, b);\n  int len, ken;\n  len = strlen(sr);\n  ken = strlen(a);\n  int i, j, k, m;\n  m = 0;\n\n  for (i = 0; i < len; i++) {\n    if (sr[i] == a[0]) {\n      j = i;\n      for (k = 0; k < ken; k++)\n        if (sr[k + j] == a[k]) {\n          m = 1;\n        } else if (sr[k + j] != a[k]) {\n          m = 0;\n          break;\n        }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0) {\n    printf(\"%s\", sr);\n  }\n  char c[1000], d[1000];\n  if (m == 1) {\n    for (i = 0; i < j; i++) {\n      c[i] = sr[i];\n    }\n    c[j] = '\u0000';\n    if (j + ken == len)\n      printf(\"%s%s\", c, b);\n\n    if (j + ken < len) {\n      for (i = j + ken; i < len; i++) {\n        d[i - j - ken] = sr[i];\n      }\n      d[len - j - ken] = '\u0000';\n      printf(\"%s%s%s\", c, b, d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12182", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int len1, len2, i, j, x, tag = 0;\n  char s1[300], s2[300], s3[300];\n  cin >> s1;\n  scanf(\"%s\", s2);\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s1[j] != s2[j - i])\n        break;\n\n      if (j == i + len2 - 1) {\n        tag = 1;\n        x = i;\n      }\n    }\n    if (tag) {\n      break;\n    }\n  }\n  if (tag) {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s3);\n    for (i = x + len2; i < len1; i++) {\n      printf(\"%c\", s1[i]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  scanf(\"%s %s %s\", s, a, b);\n  int i = 0, j = 0;\n  int find = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n\n      for (j = 0; a[j] != '\\0'; j++) {\n        \n        if (a[j] != s[i + j]) {\n          find = 0;\n          break;\n        }\n      }\n      if (a[j] == '\\0')\n        find = 1;\n    }\n    if (find == 1)\n      break;\n  }\n  if (find) {\n    for (j = 0; b[j] != '\\0'; j++)\n      s[i + j] = b[j];\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], s1[300], s2[300] = {'\u0000'};\n  int i, j, len, count = 0, m;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  for (i = 0; i < len; i++)\n    if (s[i] == s1[0]) {\n      for (j = 1; s1[j] != '\u0000'; j++)\n        if (s[j + i] != s1[j])\n          break;\n      if (j >= strlen(s1)) {\n        m = i;\n        count = 1;\n        break;\n      }\n    }\n  if (count) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s[i]);\n    for (i = 0; s2[i] != '\u0000'; i++)\n      printf(\"%c\", s2[i]);\n    for (j = i + m; j < len; j++)\n      printf(\"%c\", s[j]);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12185", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], rep[300], sub[300];\n  cin >> s >> sub >> rep;\n  if (strstr(s, sub)) {\n    char *t = strstr(s, sub);\n    *t = '\\0';\n    cout << s << rep << (t + strlen(sub)) << endl;\n  } else {\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[256];\n  char zichuan[256];\n  char tihuan[20];\n  char daitihuan[20];\n  int k;\n  int e;\n  int s = 1;\n  int tag = 0;\n\n  cin >> zfc;\n\n  cin >> zichuan;\n\n  cin >> tihuan;\n  int l, m;\n  int i, j;\n  l = strlen(zichuan);\n  m = strlen(zfc);\n  for (i = 0; i < m; i++) {\n    for (j = i; j < i + l; j++) {\n      daitihuan[j - i] = zfc[j];\n    }\n    daitihuan[l] = 0;\n    k = strcmp(daitihuan, zichuan);\n    s *= k;\n    if (k == 0 && tag == 0) {\n      e = i;\n      tag = 1;\n    }\n  }\n  if (s != 0) {\n    cout << zfc;\n  } else if (s == 0) {\n    for (i = 0; i < e; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    printf(\"%s\", tihuan);\n    for (i = e + l; i < m; i++)\n      cout << zfc[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int i, r1, r2, r3, j, q, h = 0, result = 0;\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", rep);\n  r1 = strlen(str);\n  r2 = strlen(sub);\n  r3 = strlen(rep);\n  for (i = 0; i < r1; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < r2; j++) {\n        if (str[i + j] != sub[j])\n          break;\n      }\n      if (j == r2) {\n        result = 1;\n        for (q = i; q < i + r3; q++) {\n          str[q + r3] = str[q + r2];\n          str[q] = rep[h];\n          h++;\n        }\n        printf(\"%s\", str);\n        break;\n      }\n    }\n  }\n  if (result == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int m, n, i, j, e, k;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    e = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == sub[j])\n        e++;\n    }\n    if (e == m)\n      break;\n  }\n  if (e == m) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", rep);\n    for (k = i + m; k < n; k++) {\n      printf(\"%c\", str[k]);\n    }\n  } else {\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  scanf(\"%s %s %s \", a, b, c);\n  int i, j, m, k = 0, la = strlen(a), lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = i;\n      for (j = 1; j < lb; j++) {\n        m++;\n        if (a[m] != b[j])\n          break;\n      }\n      if (j == lb) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < m; i++)\n      cout << a[i];\n    printf(\"%s\", c);\n    for (i = m + lb; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], a[256], b[256], c[256];\n  int i, j, t = 0;\n  scanf(\"%s %s %s\", str, a, b);\n  for (i = 0; i < strlen(str); i++) {\n    for (j = 0; j < strlen(a); j++)\n      c[j] = str[i + j];\n    c[j] = '\\0';\n    if (strcmp(c, a) == 0) {\n      t = 1;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; j < strlen(b); j++)\n      printf(\"%c\", b[j]);\n    for (j = i + strlen(a); str[j] != 0; j++)\n      printf(\"%c\", str[j]);\n  } else\n    printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12191", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000], sub[1000], rep[1000];\n  int len1, len2, len3, i, j, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(rep);\n  for (j = 0; j < len2; j++)\n\n    for (i = 0; i < len1; i++) {\n      if (str[i] != sub[0])\n        continue;\n\n      if (str[i] == sub[0] && str[i + 1] == sub[1] && str[i + 2] == sub[2] &&\n          str[i + 3] == sub[3])\n        break;\n    }\n  if (i < len1)\n    for (k = i; k < i + len2; k++)\n      str[k] = rep[k - i];\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int lenstr, lensub, lenrpl, i, j;\n  char temp[260], str[260], sub[260], rpl[260];\n  cin >> str >> sub >> rpl;\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n  lenrpl = strlen(rpl);\n  str[lenstr] = '\\0';\n  sub[lensub] = '\\0';\n  rpl[lenrpl] = '\\0';\n  for (i = 0; i < lenstr - lensub + 1; i++) {\n    for (j = 0; j < lensub; j++)\n      temp[j] = str[i + j];\n    temp[j] = '\\0';\n    if (strcmp(temp, sub) == 0)\n      break;\n  }\n  if (i != lenstr - lensub + 1) {\n    for (j = 0; j < lenrpl; j++)\n      str[i + j] = rpl[j];\n  }\n  printf(\"%s\\n\", str);\n}\n"}
{"label": "7", "index": "12193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum;\n  char string1[1000 + 10];\n  char subString[1000 + 10];\n  char replacement[1000 + 10];\n  for (k = 0; k < 1000 + 10; k++) {\n    string1[k] = '0';\n    subString[k] = '0';\n    replacement[k] = '0';\n  }\n  scanf(\"%s\", string1);\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n  int len1 = strlen(string1);\n  int len2 = strlen(subString);\n  int len3 = strlen(replacement);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    sum = 0;\n    if (string1[i] == subString[0]) {\n      for (j = 0; j < len2; j++) {\n        if (subString[j] == string1[i + j])\n          sum++;\n      }\n\n      if (sum == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string1[k]);\n        for (k = 0; k < len3; k++)\n          printf(\"%c\", replacement[k]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string1[k]);\n      }\n\n      if (sum == len2)\n        break;\n    }\n  }\n  if (i == len1 - len2 + 1)\n    for (k = 0; k < len1; k++)\n      printf(\"%c\", string1[k]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i = 0, j = 0, l = strlen(a), l_sub = strlen(sub);\n  while (i < l) {\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j])\n        b[i]++;\n    }\n    i++;\n  }\n  int k = 0, count = 0, w = 999;\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w = k;\n      count++;\n      break;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w) {\n        printf(\"%s\", c);\n        q += l_sub;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, p;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i <= strlen(a) - strlen(b); i++) {\n    p = 0;\n\n    for (j = i; j < i + strlen(b); j++)\n      if (b[j - i] == a[j])\n        p++;\n\n    if (p == strlen(b)) {\n      d[i] = '\u0000';\n      break;\n    }\n    d[i] = a[i];\n  }\n  if (i == strlen(a) - strlen(b) + 1)\n    puts(a);\n  else {\n    strcat(d, c);\n\n    for (j = i + strlen(b); j < strlen(a); j++)\n      e[j - i - strlen(b)] = a[j];\n    e[j - i - strlen(b)] = '\u0000';\n    strcat(d, e);\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[100];\n  scanf(\"%s\", sz);\n  int i, j, m, n, len, len1, len2;\n\n  char as[100], az[100];\n  scanf(\"%s%s\", as, az);\n\n  len = strlen(sz);\n  len1 = strlen(as);\n  len2 = strlen(as);\n  for (i = 0; i < len; i++) {\n    for (j = 0; j < len2; j++, i++) {\n      if (sz[i] != as[j])\n        break;\n      if (j == len2 - 1) {\n        for (m = i - len2 + 1, n = 0; n < len2; n++, m++) {\n          sz[m] = az[n];\n        }\n      }\n      if (j == len2 - 1) {\n        i = len;\n      }\n    }\n  }\n  cout << sz;\n  return 0;\n}\n"}
{"label": "7", "index": "12197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zf[100];\n  char zq[100];\n  char cu[100];\n\n  int i, l, lc, j, lz, k = 0, t, m, n = 0, len, ci;\n\n  cin >> zf;\n\n  cin >> cu;\n\n  cin >> zq;\n  l = strlen(zf);\n  lc = strlen(cu);\n  lz = strlen(zq);\n  for (i = 0; i < l; i++) {\n    if (zf[i] == cu[0]) {\n      ci = 1;\n      for (j = 0; j < lc; j++, i++) {\n        if (zf[i] != cu[j]) {\n          ci = 0;\n          break;\n        }\n      }\n      if (ci == 1) {\n        t = i - lc;\n        for (j = 0; j < lc; j++, t++)\n          zf[t] = zq[j];\n\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *q1, *q2;\n  int i, j, k, flag;\n  p1 = (char *)malloc(sizeof(char) * 256);\n  p2 = (char *)malloc(sizeof(char) * 256);\n  p3 = (char *)malloc(sizeof(char) * 256);\n  q1 = (char *)malloc(sizeof(char) * 256);\n  q2 = (char *)malloc(sizeof(char) * 256);\n\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  for (i = 0; i < strlen(p1); i++) {\n    flag = 1;\n    for (j = 0; j < strlen(p2); j++)\n      if (*(p1 + i + j) != *(p2 + j)) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      for (k = 0; k < i; k++)\n        *(q1 + k) = *(p1 + k);\n      *(q1 + k) = '\u0000';\n      for (k = i + strlen(p2); k < strlen(p1); k++)\n        *(q2 + k - i - strlen(p2)) = *(p1 + k);\n      *(q2 + k - i - strlen(p2)) = '\u0000';\n      break;\n    }\n  }\n  if (flag) {\n    strcat(q1, p3);\n    strcat(q1, q2);\n    puts(q1);\n  } else\n    puts(p1);\n}\n"}
{"label": "7", "index": "12199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[300], b[300], c[300];\n  char *p, *q;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  len = strlen(b);\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL) {\n    cout << a;\n  } else {\n    while (q < p) {\n      cout << *q;\n      q++;\n    }\n    q = p + len;\n    cout << c;\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[260], c[260], d[520];\n  int i, m, a1, b1, c1;\n  char *k;\n  int j;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  k = strstr(a, b);\n\n  if (k == NULL)\n    printf(\"%s\", a);\n  else {\n    m = k - &a[0];\n    for (i = 0; i < m; i++)\n      d[i] = a[i];\n    for (i = 0; i < c1; i++)\n      d[m + i] = c[i];\n    j = m + c1;\n    for (i = 0; m + b1 + i <= a1; i++)\n      d[j + i] = a[m + b1 + i];\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char string[256] = {'\\0'};\n  char subString[100] = {'\\0'};\n  char replacement[100] = {'\\0'};\n  int i = 0, j = 0, k = 0;\n  char c = '\\0';\n  while (c != '\\n') {\n    c = getchar();\n    if (c != '\\n') {\n      string[i] = c;\n      i++;\n    }\n  }\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    if (string[i] == subString[0]) {\n      k = i;\n      for (j = 0; j < strlen(subString); j++, k++) {\n        if (subString[j] != string[k]) {\n          break;\n        }\n      }\n      if (j == strlen(subString)) {\n        k = i;\n        for (j = 0; j < strlen(replacement); j++, k++) {\n          string[k] = replacement[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12202", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[257], a[50], b[50];\n  int i, j, k;\n  scanf(\"%s %s %s \", zfc, a, b);\n  for (i = 0; i < strlen(zfc); i++) {\n    if (a[0] == zfc[i]) {\n      for (j = 1; j < strlen(a); j++) {\n        if (a[j] != zfc[i + j])\n          break;\n      }\n      if (j == strlen(a))\n        break;\n    }\n  }\n  if (j == strlen(a)) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", zfc[k]);\n    for (k = i; k < i + strlen(b); k++)\n      printf(\"%c\", b[k - i]);\n    for (k = i + strlen(b); k < strlen(zfc); k++)\n      printf(\"%c\", zfc[k]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[501], subs[501], rep[501];\n  int i, j, k, len, len1;\n  cin >> str >> subs >> rep;\n  i = 0;\n  len = strlen(str);\n  while (str[i] != '\\0') {\n    if (str[i] == subs[0]) {\n      len1 = strlen(subs);\n      for (j = 0; j < len1; j++)\n        if (str[i + j] != subs[j])\n          break;\n      if (j == len1) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", str[k]);\n        printf(\"%s\", rep);\n        for (k = i + len1; k < len; k++)\n          printf(\"%c\", str[k]);\n        break;\n      }\n    }\n    i++;\n  }\n  if (str[i] == '\\0')\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar *str_replace(const char *src, const char *oldstr, const char *newstr);\nint main() {\n  int aa = 0, i;\n  char str1[100], str2[100], str3[100], sub[100] = {0}, sub1[100] = {0},\n                                        sub2[100] = {0};\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  if (strlen(str1) < strlen(str2))\n    cout << str1;\n  else {\n    for (i = 0; i <= strlen(str1) - strlen(str2); i++) {\n      strncpy(sub, str1 + i, strlen(str2));\n      if (strcmp(sub, str2) == 0) {\n        strncpy(sub1, str1, i);\n        strncpy(sub2, str1 + i + strlen(str2), strlen(str1) - i - strlen(str2));\n        strcat(sub1, str3);\n        strcat(sub1, sub2);\n        cout << sub1;\n        aa = 1;\n        break;\n      }\n    }\n    if (aa == 0)\n      cout << str1;\n  }\n\n  return 0;\n}\nchar *str_replace(const char *src, const char *oldstr, const char *newstr) {\n\n  if (NULL == src || NULL == oldstr || NULL == newstr)\n\n  {\n\n    return NULL;\n  }\n\n  \n\n  char *dest = strdup(src);\n\n  \n\n  if (strcmp(oldstr, newstr) == 0)\n\n  {\n\n    return dest;\n  }\n\n  \n\n  char *needle;\n\n  \n\n  char *tmp, *dest_tmp = dest;\n\n  \n\n  while (needle = strstr(dest, oldstr))\n\n  {\n\n    \n\n    tmp = (char *)malloc(strlen(dest) + strlen(newstr) - strlen(oldstr) + 1);\n\n    \n\n    strncpy(tmp, dest, needle - dest);\n\n    \n\n    tmp[needle - dest] = '\u0000';\n\n    \n\n    strcat(tmp, newstr);\n\n    \n\n    strcat(tmp, needle + strlen(oldstr));\n\n    \n\n    dest = strdup(tmp);\n\n    free(dest_tmp);\n\n    \n\n    free(tmp);\n\n    dest_tmp = dest;\n  }\n\n  return dest;\n}\n"}
{"label": "7", "index": "12205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, t = 0;\n  char c[256], d[256], e[256];\n  scanf(\"%s\", c);\n  cin >> d;\n  cin >> e;\n  m = strlen(c);\n  n = strlen(d);\n  for (i = 0; i < m; i++) {\n    if (c[i] == d[0]) {\n      t = 0;\n      for (j = i; j < i + n; j++) {\n        if (c[j] == d[j - i]) {\n          t = t + 1;\n        }\n      }\n      if (t == n) {\n        for (j = i; j < i + n; j++) {\n          c[j] = e[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "7", "index": "12206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, n1, k, sum = 0;\n  char a[257], b[257], c[257];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  n1 = strlen(b);\n  for (i = 0; i < n - n1 + 1; i++) {\n    sum = 0;\n    for (j = i, k = 0; j < i + n1; j++, k++) {\n      if (a[j] != b[k])\n        sum = 1;\n    }\n    if (sum == 0) {\n      for (j = i, k = 0; j < i + n1; j++, k++)\n        a[j] = c[k];\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    cout << a;\n  else if (flag == 0) {\n    cout << c;\n    for (i = len2; i <= len1 - 1; i++)\n      cout << a[i];\n  } else {\n    for (i = 0; i <= flag - 1; i++)\n      cout << a[i];\n    cout << c;\n    for (i = i + len2; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, m, n, i, j, s, k;\n  char string[256], substring[256], replacement[256];\n  char t;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  l = strlen(string);\n  m = strlen(substring);\n  t = substring[0];\n  for (i = 0; i <= l - m; i++) {\n    s = 0;\n    if (string[i] == t) {\n      for (j = i; j <= i + m - 1; j++) {\n        if (string[j] == substring[j - i]) {\n          s++;\n        }\n      }\n      if (s == m) {\n        for (k = 0; k <= m - 1; k++) {\n          string[i + k] = replacement[k];\n        }\n        i = l - m;\n      } else {\n        i++;\n      }\n    }\n  }\n  cout << string << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, l, m, e = 0;\n  char *str;\n\n  memset(s, 0, 100);\n  memset(a, 0, 100);\n  memset(b, 0, 100);\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l = strlen(a);\n  m = strlen(s);\n  str = s;\n\n  for (i = 0; i <= m - l; i++) {\n    e = 0;\n    for (j = 0; j < l; j++) {\n      if (s[i + j] != a[j]) {\n        e++;\n        break;\n      }\n    }\n\n    if (e == 0) {\n      s[i] = '\u0000';\n      printf(\"%s\", str);\n      printf(\"%s\", b);\n      str = s + i + j;\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0] && s[i + m - 1] == a[m - 1]) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        printf(\"%s\", b);\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "12211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char t[256];\n\n  int i, ls, j, la, lt, g, word = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", t);\n  ls = strlen(s);\n  la = strlen(a);\n  lt = strlen(t);\n\n  for (i = 0; i < ls; i++) {\n    if (word == 0) {\n      g = 0;\n      if (s[i] == a[0]) {\n        g++;\n        for (j = i + 1; j < i + la; j++) {\n          if (s[j] == a[g]) {\n            g++;\n          }\n        }\n        if (g == la) {\n          word = 1;\n          for (j = i; j < i + la; j++) {\n            s[j] = t[j - i];\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[256], b[256];\n  int n, m, p, i, j, k;\n  cin.getline(s, 256);\n  cin.getline(a, 256);\n  cin.getline(b, 256);\n  n = strlen(s);\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0]) {\n      for (j = 1; j < m; j++)\n        if (a[j] != s[j + i])\n          break;\n      if (j == m) {\n        if (m == p) {\n          for (j = 0; j < m; j++)\n            s[i + j] = b[j];\n        } else {\n          if (p < m) {\n            for (j = 0; j < p; j++)\n              s[i + j] = b[j];\n            for (j = i + p;; j++) {\n              s[j] = s[j + m - p];\n              if (s[j] == '\\0')\n                break;\n            }\n          } else {\n            for (j = 0;; j++) {\n              if (n - j == i + m - 1)\n                break;\n              s[n + p - m - j] = s[n - j];\n            }\n            for (k = 0; k < p; k++)\n              s[i + k] = b[k];\n          }\n        }\n        break;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char all[257], sub[257], re[257];\n  int i, j, k, p, q, r, s;\n\n  scanf(\"%s %s %s \", all, sub, re);\n\n  int flag;\n  for (i = 0; all[i] != '\\0'; i++) {\n    flag = 1;\n    for (j = 0, k = i; sub[j] != '\\0'; k++, j++) {\n      if (all[k] != sub[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  if (flag == 1) {\n    int c = strlen(re);\n\n    for (p = k, q = c; all[p] != '\\0'; p++, q++)\n      re[q] = all[p];\n    re[q] = '\\0';\n\n    for (r = 0, s = i; re[r] != '\\0'; r++, s++)\n      all[s] = re[r];\n    all[s] = '\\0';\n  }\n  cout << all << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[256], zc[256], re[256], dc[256][256];\n  scanf(\"%s%s%s\", zfc, zc, re);\n  int len1, len2, i;\n  len1 = strlen(zfc);\n  len2 = strlen(zc);\n  int j, k, tag = 0, m, a;\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, k++) {\n      dc[i][j] = zfc[k];\n    }\n  }\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    if (strcmp(dc[i], zc) == 0) {\n      tag = 1;\n      m = i;\n      break;\n    }\n  }\n\n  if (tag == 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    for (i = m; i < m + len2; i++) {\n      printf(\"%s\", re);\n      break;\n    }\n    for (i = m + len2; zfc[i] != '\\0'; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  scanf(\"%d\", &a);\n  return 0;\n}\n"}
{"label": "7", "index": "12215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, k;\n  char s[256], w[256], c[256], x[256];\n  scanf(\"%s\", w);\n  scanf(\"%s \", s);\n  cin >> c;\n  t = strlen(s);\n  for (i = 0; w[i] != '\\0'; i++) {\n    for (j = 0; j < t; j++) {\n      x[j] = w[i + j];\n    }\n    x[j] = '\\0';\n    if (strcmp(s, x) == 0) {\n      for (k = 0; k < t; k++) {\n        w[i + k] = c[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int q, w, e, i, k, j;\n  scanf(\"%s\", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n\n  for (i = 0; i < q; i++) {\n    j = 0;\n    for (k = i; (k < i + w) && (k < q); k++) {\n\n      if (a[k] != b[k - i]) {\n        continue;\n      }\n      if (a[k] == b[k - i]) {\n        j++;\n      }\n      if (j == w) {\n        for (k = i; (k < i + w) && (k < q); k++) {\n          a[k] = c[k - i];\n        }\n        break;\n      }\n    }\n    if (j == w) {\n\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  scanf(\"%s %s %s \", str, subString, replacement);\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    if (repLen < subLen) {\n      move = subLen - repLen;\n      while (*(p + move) != '\\0') {\n        *p++ = *(p + move);\n      }\n      *p = '\\0';\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], substr[256], rep[256];\n  int i, j, flag = 1, flag1 = 0;\n  scanf(\"%s \", str);\n  cin >> substr;\n  cin >> rep;\n  int nlen = strlen(str);\n  int slen = strlen(substr);\n  int rlen = strlen(rep);\n  if (slen != rlen) {\n    cout << \"hehe\" << endl;\n  }\n  for (i = 0; i < nlen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (substr[j] != str[i + j]) {\n        flag = 0;\n        break;\n      } else {\n        flag = 1;\n      }\n    }\n    if (flag) {\n      for (int k = 0; k < slen; k++) {\n        str[i + k] = rep[k];\n      }\n      flag1 = 1;\n    }\n    if (flag1) {\n      break;\n    }\n  }\n  cout << str << '\\n';\n  return 0;\n}\n"}
{"label": "7", "index": "12219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ys[1000], re[1000], bt[1000];\n  int m, n, i, j, k, ss = 0, se = 0;\n\n  cin >> ys;\n\n  cin >> bt;\n\n  cin >> re;\n  for (i = 0; ys[i] != 0; i++) {\n    if (ys[i] == bt[0]) {\n      for (k = i + 1, j = 1; ys[k] != 0 && bt[j] != 0; k++, j++) {\n        if (ys[k] != bt[j]) {\n          break;\n        }\n      }\n      if (bt[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(bt) <= strlen(re)) {\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n      for (k = se; ys[k] != 0; k++, i++) {\n        ys[i] = ys[k];\n      }\n      ys[i] = 0;\n    } else {\n      i = strlen(ys) + strlen(re) - strlen(bt);\n      for (k = strlen(ys); k >= se; k--, i--) {\n        ys[i] = ys[k];\n      }\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n    }\n  }\n  printf(ys);\n  return 0;\n}\n"}
{"label": "7", "index": "12220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  char c[101];\n  int i, j;\n  int length1, length2, length3;\n  int p;\n  scanf(\"%s%s%s\", a, b, c);\n  length1 = strlen(a);\n  length2 = strlen(b);\n  length3 = strlen(c);\n  for (i = 0; i < length1; i++) {\n    if (a[i] == b[0]) {\n      p = 0;\n      for (j = 1; j < length2; j++) {\n        if (a[i + j] != b[j]) {\n          p = 1;\n          break;\n        }\n      }\n      if (p == 0) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        for (j = 0; j < length3; j++) {\n          printf(\"%c\", c[j]);\n        }\n        for (j = i + length3; j < length1; j++) {\n          printf(\"%c\", a[j]);\n        }\n        p = 2;\n        break;\n      }\n    }\n  }\n  if (p != 2) {\n    for (i = 0; i < length1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  int i, k = 0, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int n = strlen(str);\n  int m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (sub[k] == str[i])\n      k++;\n    else {\n      k = 0;\n      if (sub[k] == str[i]) {\n        k++;\n      }\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j - m + 1] = re[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12222", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[260], w[260], h[260];\n  int l1, l2, i, j, k = 0;\n  scanf(\"%s \", s);\n  cin >> w;\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (j = 0; j < l1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < l2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == l2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < l2; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + l2; k < l1; k++)\n      printf(\"%c\", s[k]);\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\", s);\n  }\n}\n"}
{"label": "7", "index": "12223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[500], su[500], re[500];\n  int len1, len2, i, j, k, l, m = 0;\n  scanf(\"%s%s%s\", s, su, re);\n  len1 = strlen(s);\n  len2 = strlen(su);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    k = 0;\n    for (j = 0; j < len2; j++) {\n      if (s[i + j] != su[j]) {\n        break;\n      } else {\n        k++;\n      }\n    }\n    if (k == len2) {\n      m++;\n      for (l = 0; l < len2; l++) {\n        s[i + l] = re[l];\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar *strpos(char string[], char substring[]) {\n  char *p = string;\n  char *temp = NULL;\n  while (*p != '\\0') {\n    if (*p == substring[0]) {\n      temp = p;\n      p++;\n      int i;\n      for (i = 1; i < strlen(substring); i++) {\n        if (*p != substring[i])\n          break;\n\n        p++;\n      }\n      if (i == strlen(substring))\n        break;\n      else\n        p = temp + 1;\n    } else\n      p++;\n  }\n  return temp;\n}\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin.getline(string, 257);\n  cin.getline(substring, 257);\n  cin.getline(replacement, 257);\n  char *p = strpos(string, substring);\n  if (p != NULL) {\n    int t = 0, count = 0;\n    while (count != strlen(substring)) {\n      *p = replacement[t++];\n      p++;\n      count++;\n    }\n  }\n  cout << string << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256 * 2], sub[300], replacement[300], tmp[300];\n  int i, j, result = -1, k;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> replacement;\n\n  for (i = 0; i <= (int)(strlen(str) - strlen(sub)); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < (int)strlen(sub); j++) {\n        if (str[i + j] == sub[j]) {\n          result = i;\n        } else {\n          result = -1;\n          break;\n        }\n      }\n    }\n    if (result != -1)\n      break;\n  }\n  k = (int)strlen(replacement);\n  if (result != -1) {\n    strcpy(tmp, (str + i + j));\n    strcpy((str + i), replacement);\n    strcpy((str + i + k), tmp);\n    printf(\"%s\", str);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257];\n  char sub[257];\n  char rep[257];\n  int i = 0, j = 0, k = 0, a;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  a = strlen(sub);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[j]) {\n      j++;\n      if (j == a) {\n        k = i;\n        break;\n      }\n    } else\n      j = 0;\n  }\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (i == k - a + 1) {\n      printf(\"%s\", rep);\n      i = k;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256] = {'\\0'}, s2[256] = {'\\0'}, s3[256] = {'\\0'}, t[256] = {'\\0'};\n  int i, j, k = 0, s, l1, l2, l3;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  for (i = 0; i < l1;) {\n    for (j = 0; j < l2; j++) {\n      if (i + j >= l1 || s1[i + j] != s2[j])\n        break;\n    }\n    if (j == l2) {\n      for (s = 0; s < l3; s++) {\n        t[k] = s3[s];\n        k++;\n      }\n      i = i + l2;\n      break;\n    } else {\n      t[k] = s1[i];\n      i++;\n      k++;\n    }\n  }\n  for (; i < l1; i++) {\n    t[k] = s1[i];\n    k++;\n  }\n  t[k] = '\\0';\n  printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "7", "index": "12228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char b[256], a[256], c[256];\n  int m, n, i, j, d;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    d = 1;\n    for (j = 0; j < n; j++) {\n      if (b[j] != a[j + i])\n        d = 0;\n    }\n    if (d == 1) {\n      for (j = 0; j < n; j++) {\n        a[i + j] = c[j];\n      }\n      break;\n    }\n  }\n\n  cout << a;\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], sub[1000], rep[1000];\n  int len1, len2, len3, i, j, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(rep);\n  for (j = 0; j < len2; j++)\n\n    for (i = 0; i < len1; i++) {\n      if (str[i] != sub[0])\n        continue;\n\n      if (str[i] == sub[0] && str[i + 1] == sub[1] && str[i + 2] == sub[2] &&\n          str[i + 3] == sub[3])\n        break;\n    }\n  if (i < len1)\n    for (k = i; k < i + len2; k++)\n      str[k] = rep[k - i];\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12230", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint Issubstr(char *s, char *subs) {\n  int i, j;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = 0; j < strlen(subs); j++) {\n      if (subs[j] != s[i + j])\n        break;\n    }\n    if (j == strlen(subs))\n      break;\n  }\n  if (i < strlen(s))\n    return i;\n  return -1;\n}\nint main() {\n  char s[257], sub[257], replace[257];\n  int i, j = 0;\n  cin >> s >> sub >> replace;\n  for (i = Issubstr(s, sub); i != -1 && j < strlen(replace); i++)\n    s[i] = replace[j++];\n\n  if (i > strlen(s))\n    s[i] = '\\0';\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], substr[256], rep[256];\n  int i, j, flag = 1, flag1 = 0;\n  cin >> str;\n  cin >> substr;\n  cin >> rep;\n  int nlen = strlen(str);\n  int slen = strlen(substr);\n  int rlen = strlen(rep);\n  if (slen != rlen) {\n    cout << \"hehe\" << endl;\n  }\n  for (i = 0; i < nlen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (substr[j] != str[i + j]) {\n        flag = 0;\n        break;\n      } else {\n        flag = 1;\n      }\n    }\n    if (flag) {\n      for (int k = 0; k < slen; k++) {\n        str[i + k] = rep[k];\n      }\n      flag1 = 1;\n    }\n    if (flag1) {\n      break;\n    }\n  }\n  cout << str << '\\n';\n  return 0;\n}\n"}
{"label": "7", "index": "12232", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256] = {' '}, sstr[256] = {' '}, rpl[256] = {' '};\n  int lstr, lsstr;\n  scanf(\"%s %s %s \", str, sstr, rpl);\n  lstr = strlen(str);\n  lsstr = strlen(sstr);\n  int pst, curr, indi = 0;\n  for (pst = 0; pst <= lstr - lsstr; pst++) {\n    int state = 1;\n    for (curr = 0; curr < lsstr; curr++) {\n      if (sstr[curr] != str[curr + pst]) {\n        state = 0;\n        break;\n      }\n    }\n    if (state == 1) {\n      indi = 1;\n      break;\n    }\n  }\n  if (indi == 0)\n    printf(\"%s\", str);\n  else {\n    for (curr = 0; curr < pst; curr++)\n      printf(\"%c\", str[curr]);\n\n    for (curr = 0; curr < lsstr; curr++) {\n      printf(\"%c\", rpl[curr]);\n    }\n    for (curr = pst + lsstr; curr < lstr; curr++) {\n      printf(\"%c\", str[curr]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12233", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[250], b[150], c[150];\n  cin >> a >> b >> c;\n  if (strstr(a, b) == NULL) {\n    printf(\"%s\", a);\n    return 0;\n  }\n  char *p = strstr(a, b);\n  int i = 0;\n  while (c[i] != '\\0') {\n    *p++ = c[i];\n    i++;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, a = 1, n, m, k;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  n = strlen(s1);\n  m = strlen(s2);\n  for (i = 0; i < n; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; j < m; j++) {\n        if (s1[j + i] == s2[j])\n          a++;\n      }\n      if (a == m) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s1[k]);\n        for (k = 0; k < m; k++)\n          printf(\"%c\", s3[k]);\n        for (k = i + m; k < n; k++)\n          printf(\"%c\", s1[k]);\n        printf(\"\\n\");\n        break;\n      }\n    }\n  if (a != m)\n    printf(\"%s\\n\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sr[1000];\n\n  cin >> sr;\n  char a[1000], b[1000];\n  scanf(\"%s%s\", a, b);\n  int len, ken;\n  len = strlen(sr);\n  ken = strlen(a);\n  int i, j, k, m;\n  m = 0;\n  \n  for (i = 0; i < len; i++) {\n    if (sr[i] == a[0]) {\n      j = i;\n      for (k = 0; k < ken; k++)\n        if (sr[k + j] == a[k]) {\n          m = 1;\n        } else if (sr[k + j] != a[k]) {\n          m = 0;\n          break;\n        }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0) {\n    printf(\"%s\", sr);\n  }\n  char c[1000], d[1000];\n  if (m == 1) {\n    for (i = 0; i < j; i++) {\n      c[i] = sr[i];\n    }\n    c[j] = '\u0000';\n    if (j + ken == len) {\n      printf(\"%s%s\", c, b);\n    }\n    if (j + ken < len) {\n      for (i = j + ken; i < len; i++) {\n        d[i - j - ken] = sr[i];\n      }\n      d[len - j - ken] = '\u0000';\n      printf(\"%s%s%s\", c, b, d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12236", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char word[2][256], chan[256];\n  int i, j, len[2], result = 1, wzy = 0, weizhi;\n\n  cin >> word[1] >> word[0] >> chan;\n  len[0] = strlen(word[0]);\n  len[1] = strlen(word[1]);\n\n  for (i = 0; i <= len[1] - len[0]; i++) {\n    if (word[1][i] == word[0][0]) {\n      for (j = i + 1; j < i + len[0]; j++) {\n        if (word[1][j] != word[0][j - i]) {\n          result = 0;\n          break;\n        }\n      }\n      if (result) {\n        weizhi = i;\n        wzy = 1;\n      }\n      result = 1;\n    }\n    if (wzy == 1) {\n      break;\n    }\n  }\n\n  if (wzy == 1) {\n    for (i = weizhi; i < weizhi + len[0]; i++) {\n      word[1][i] = chan[i - weizhi];\n    }\n  }\n\n  for (i = 0; i < len[1]; i++) {\n    printf(\"%c\", word[1][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint comp(char a[100], char b[100], int i) {\n  int l, j;\n  l = strlen(b);\n  for (j = 0; j < l; j++)\n    if (a[i + j] != b[j])\n      return 0;\n  return 1;\n}\n\nint main(int argc, char *argv[]) {\n  int i, j, len1, len2, len3, break1 = 0;\n  char a[100], b[100], c[100];\n  int comp(char a[100], char b[100], int i);\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < 100; i++) {\n    if (a[i] == b[0]) {\n      if (comp(a, b, i)) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        printf(\"%s\", c);\n\n        for (j = j + len2; j < len1 - len2 + len3; j++)\n          printf(\"%c\", a[j]);\n        break;\n        break1 = 1;\n      }\n    }\n    if (break1 == 1)\n      break;\n    if (i == strlen(a))\n      printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char string[256], subString[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  scanf(\"%s\\n%s\\n%s\", string, subString, replacement);\n  int mainlen = strlen(string), sublen = strlen(subString);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, subString)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      cout << result;\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar *str_replace(const char *src, const char *newstr);\nint main() {\n  int aa = 0, i;\n  char str1[100], str2[100], str3[100], sub[100] = {0}, sub1[100] = {0},\n                                        sub2[100] = {0};\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  if (strlen(str1) < strlen(str2))\n    cout << str1;\n  else {\n    for (i = 0; i <= strlen(str1) - strlen(str2); i++) {\n      strncpy(sub, str1 + i, strlen(str2));\n      if (strcmp(sub, str2) == 0) {\n        strncpy(sub1, str1, i);\n        strncpy(sub2, str1 + i + strlen(str2), strlen(str1) - i - strlen(str2));\n        strcat(sub1, str3);\n        strcat(sub1, sub2);\n        cout << sub1;\n        aa = 1;\n        break;\n      }\n    }\n    if (aa == 0)\n      cout << str1;\n  }\n\n  return 0;\n}\nchar *str_replace(const char *src, const char *oldstr, const char *newstr) {\n\n  if (NULL == src || NULL == oldstr || NULL == newstr)\n\n  {\n\n    return NULL;\n  }\n\n  char *dest = strdup(src);\n\n  if (strcmp(oldstr, newstr) == 0)\n\n  {\n\n    return dest;\n  }\n\n  char *needle;\n\n  char *tmp, *dest_tmp = dest;\n\n  while (needle = strstr(dest, oldstr))\n\n  {\n\n    tmp = (char *)malloc(strlen(dest) + strlen(newstr) - strlen(oldstr) + 1);\n\n    strncpy(tmp, dest, needle - dest);\n\n    tmp[needle - dest] = '\u0000';\n\n    strcat(tmp, newstr);\n\n    strcat(tmp, needle + strlen(oldstr));\n\n    dest = strdup(tmp);\n\n    free(dest_tmp);\n\n    free(tmp);\n\n    dest_tmp = dest;\n  }\n\n  return dest;\n}\n"}
{"label": "7", "index": "12240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, m, j, tag = 1, jieshu = 1;\n  char zfc[257], dth[257], bth[257];\n  int zhyw = 0;\n\n  cin >> zfc;\n\n  cin >> dth;\n\n  cin >> bth;\n  n = strlen(zfc);\n  m = strlen(dth);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == dth[0]) {\n      for (k = 1; k < m; k++) {\n        if (zfc[i + k] != dth[k])\n          tag = 0;\n      }\n      if (tag) {\n        printf(\"%s\", bth);\n        for (j = i + m; j < n; j++)\n          printf(\"%c\", zfc[j]);\n        jieshu = 0;\n      }\n      tag = 1;\n    }\n    if (jieshu)\n      printf(\"%c\", zfc[i]);\n\n    if (jieshu == 0) {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, k, l, m, n, sum = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      if (b[j] == a[i + j])\n        sum += 1;\n    if (sum == n)\n      break;\n    else\n      sum = 0;\n  }\n  if (sum == n) {\n    for (k = i; k < n + i; k++) {\n      a[k] = c[k - i];\n    }\n  }\n  for (l = 0; l < m; l++)\n    printf(\"%c\", a[l]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "7", "index": "12242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, a;\n  char s[1000], s1[1000], s2[1000];\n  char *ps1 = s1, *ps2 = s2;\n\n  cin >> s2;\n\n  cin >> s1;\n\n  cin >> s;\n  int l1 = strlen(s1);\n  int l2 = strlen(s2);\n  for (a = 0, b = 0; a < l2 && b == 0; a = i + 1) {\n    for (i = a, ps1 = s1, ps2 = s2 + a;\n         *ps1 != *ps2 && *ps1 != '\u0000' && *ps2 != '\u0000'; ps2++, i++)\n      ;\n    for (j = 0, b = 1; *ps1 != '\u0000' && *ps2 != '\u0000'; ps1++, ps2++, j++) {\n      if (*ps1 != *ps2 && j < l1) {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (i == l2)\n    printf(\"%s\", s2);\n  else {\n    n = i;\n    s2[n] = '\u0000';\n    printf(\"%s\", s2);\n    printf(\"%s\", s);\n    ps2 = s2 + n + l1;\n    printf(\"%s\", ps2);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  char *p;\n  int i, len2;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  len2 = strlen(b);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; a + i != p; i++)\n      cout << a[i];\n    cout << c;\n    if (*(p + len2) != '\\0') {\n      for (i = 0; *(p + len2 + i) != '\\0'; i++) {\n        printf(\"%c\", *(p + i + len2));\n      }\n    }\n  } else\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int result = 0;\n  int a, b, c, i, d, e = 0, f, g, h, j;\n  int len[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(sub);\n  c = strlen(rep);\n  for (i = 0; i < a; i++) {\n    for (d = 0; d < b - 1; d++) {\n      if ((str[i + d] == sub[d]) && (str[i + d + 1] == sub[d + 1])) {\n        result = 1;\n        len[e] = i;\n        e++;\n      }\n      break;\n    }\n  }\n  f = len[0];\n  if (result == 1) {\n    for (g = 0; g < f; g++) {\n      cout << str[g];\n    }\n    for (h = 0; h < c; h++)\n      printf(\"%c\", rep[h]);\n\n    for (j = 0; j < a - f - b; j++) {\n      printf(\"%c\", str[f + b + j]);\n    }\n  } else if (result == 0) {\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char word[2][256], chan[256];\n  int i, j, len[2], result = 1, wzy = 0, weizhi;\n\n  scanf(\"%s%s%s\", word[1], word[0], chan);\n  len[0] = strlen(word[0]);\n  len[1] = strlen(word[1]);\n\n  for (i = 0; i <= len[1] - len[0]; i++) {\n    if (word[1][i] == word[0][0]) {\n      for (j = i + 1; j < i + len[0]; j++) {\n        if (word[1][j] != word[0][j - i]) {\n          result = 0;\n          break;\n        }\n      }\n      if (result) {\n        weizhi = i;\n        wzy = 1;\n      }\n      result = 1;\n    }\n    if (wzy == 1) {\n      break;\n    }\n  }\n\n  if (wzy == 1) {\n    for (i = weizhi; i < weizhi + len[0]; i++) {\n      word[1][i] = chan[i - weizhi];\n    }\n  }\n\n  for (i = 0; i < len[1]; i++) {\n    printf(\"%c\", word[1][i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s \", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  for (i = 0; i < la; i++) {\n    cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  int i, j, k = 0, len1, len2, flag, m, t, q;\n  scanf(\"%s%s%s\", b, a, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len2; i++) {\n    flag = 1;\n    q = 1;\n    if (b[i] == a[0]) {\n      k = i + 1;\n      for (j = 1; j < len1; j++) {\n        if (b[k++] != a[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        t = 0;\n        for (m = i; m < i + len1; m++)\n          b[m] = c[t++];\n        q = 0;\n      }\n    }\n    if (q == 0) {\n      break;\n    }\n  }\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12248", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[512], w[257], r[257];\n  int m, n;\n  int i, j, k;\n  int t;\n  cin >> s >> w >> r;\n  m = strlen(s);\n  n = strlen(w);\n  for (i = 0; i <= m - n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      if (w[j] != s[i + j])\n        t = 1;\n    }\n    if (t == 0)\n      break;\n  }\n  if (t == 0) {\n    for (k = i; k <= i + n - 1; k++) {\n      s[k] = r[k - i];\n    }\n    printf(\"%s\", s);\n  } else {\n    printf(\"%s\", s);\n  }\n}\n"}
{"label": "7", "index": "12249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, k;\n  char s[256], w[256], c[256], x[256];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", c);\n  t = strlen(s);\n  for (i = 0; w[i] != '\\0'; i++) {\n    for (j = 0; j < t; j++) {\n      x[j] = w[i + j];\n    }\n    x[j] = '\\0';\n    if (strcmp(s, x) == 0) {\n      for (k = 0; k < t; k++) {\n        w[i + k] = c[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[1000], x[1000], y[1000], w[1000];\n  int len1, len2, len3, i, j, flag = 0, m, tag, k = 0;\n\n  cin >> zfc;\n\n  cin >> x;\n\n  cin >> y;\n  len1 = strlen(zfc);\n  len2 = strlen(x);\n  len3 = strlen(y);\n  for (i = 0; i < len1; i++) {\n    if (zfc[i] == x[0]) {\n      m = i;\n      tag = 0;\n      for (j = 0; j < len2; j++) {\n        if (zfc[i + j] != x[j]) {\n          tag = 1;\n          break;\n        }\n      }\n      if (tag == 0) {\n        strcpy(w, zfc);\n        for (j = 0; j < len3; j++) {\n          zfc[m + j] = y[j];\n        }\n        if (m + len3 > len1 || m + len3 == len1) {\n          zfc[m + len3] = '\u0000';\n        } else if (m + len3 < len1) {\n          for (i = m + len3; i < len1 + len3 - len2; i++) {\n            zfc[i] = w[m + len2 + k];\n            k++;\n          }\n          zfc[len1 + len3 - len2] = '\u0000';\n        }\n        flag = 1;\n      }\n    }\n  }\n\n  cout << zfc << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256] = {0}, subS[256] = {0}, re[256] = {0}, t, s1[256] = {0};\n  int i, j, l1, l2, l3, count, yes;\n  cin >> s;\n  scanf(\"%s\\0\", subS);\n  scanf(\"%s\\0\", re);\n  l1 = strlen(s);\n  l2 = strlen(subS);\n  l3 = strlen(re);\n  yes = 0;\n  strcpy(s1, s);\n  for (i = 0; i <= l1 - l2; i++) {\n    count = 0;\n    for (j = 0; j < l2; j++) {\n      if (subS[j] != s[i + j])\n        break;\n      if (subS[j] == s[i + j])\n        count++;\n    }\n    if (count == l2) {\n      yes = 1;\n      if (l2 == l3) {\n        for (j = 0; j < l2; j++) {\n          s[i + j] = re[j];\n        }\n        printf(\"%s\", s);\n        break;\n      }\n      if (l2 > l3) {\n        for (j = 0; j < l3; j++) {\n          s[i + j] = re[j];\n        }\n        for (j = 0; j < l1 - i - l2; j++) {\n\n          s[i + l3 + j] = s[i + l2 + j];\n        }\n        for (j = 0; j < l1 + l3 - l2; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n      if (l2 < l3) {\n\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", s[j]);\n        }\n        cout << re;\n        for (j = i + l2; j < l1; j++) {\n          cout << s[j];\n        }\n        break;\n      }\n    }\n  }\n  if (yes == 0) {\n\n    for (j = 0; j < l1; j++) {\n      printf(\"%c\", s1[j]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < 256; i++) {\n    k = 0;\n    for (j = 0; j < strlen(b); j++) {\n      if (a[j + i] != b[j]) {\n        k = 1;\n        break;\n      }\n    }\n    \n    if (k == 0) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", a[j]);\n      for (j = 0; j < strlen(c); j++)\n        printf(\"%c\", c[j]);\n      for (j = i + strlen(b); j < strlen(a); j++)\n        printf(\"%c\", a[j]);\n\n      break;\n    }\n  }\n  if (k == 1) {\n    for (j = 0; j < strlen(a); j++)\n      printf(\"%c\", a[j]);\n  }\n  \n  return 0;\n}\n"}
{"label": "7", "index": "12253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], subs[256], rpl[256];\n  int i, j, len1 = 0, len2 = 0, c = 0, m;\n  cin >> str >> subs >> rpl;\n  len1 = strlen(subs);\n  len2 = strlen(rpl);\n  for (i = 0; i < 256 && str[i] != 0; i++) {\n    if (str[i] == subs[0]) {\n      c = 0;\n      for (j = 0; j < len1; j++) {\n        if (str[i + j] != subs[j]) {\n          c = 1;\n          break;\n        } else {\n          c = c + 1;\n        }\n      }\n    }\n    if (c == len1) {\n      break;\n    }\n  }\n  if (c == 0) {\n    for (m = 0; m < 256 && str[m] != 0; m++) {\n      printf(\"%c\", str[m]);\n    }\n  }\n  if (c == len1) {\n    for (m = 0; m < i; m++) {\n      printf(\"%c\", str[m]);\n    }\n    for (m = i; m < i + len2; m++) {\n      cout << rpl[m - i];\n    }\n    for (m = i + len2; m < 256 && str[m] != 0; m++) {\n      printf(\"%c\", str[m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[200], str1[50], str2[50];\n  char *p, *q;\n  int length, i;\n  cin.getline(str, 200);\n  scanf(\"%s %s \", str1, str2);\n  length = strlen(str1);\n  q = str;\n  p = strstr(str, str1);\n  if (p != NULL) {\n    q = p + length;\n    for (i = 0; &str[i] != p; i++)\n      cout << str[i];\n    cout << str2;\n    for (; *q != '\\0'; q++)\n      cout << *q;\n    cout << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, len1, len2, len3, j, m = 0, l;\n  char zifu[256], chazhao[256], tihuan[256];\n  scanf(\"%s%s%s\", zifu, chazhao, tihuan);\n  len1 = strlen(zifu);\n  len2 = strlen(chazhao);\n  len3 = strlen(tihuan);\n  for (i = 0; i < len1; i++) {\n    m = 0;\n    if (zifu[i] == chazhao[0]) {\n      for (j = 0; j < len2; j++) {\n        if (zifu[i + j] == chazhao[j])\n          m++;\n        if (zifu[i + j] != chazhao[j])\n          break;\n      }\n    }\n    if (m == len2)\n      break;\n  }\n\n  if (i < len1) {\n    if (len2 == len3) {\n      for (l = 0; l < len2; l++)\n        zifu[i + l] = tihuan[l];\n    } else if (len2 > len3) {\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n    } else if (len2 < len3) {\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n    }\n  }\n\n  printf(\"%s\\n\", zifu);\n  return 0;\n}\n"}
{"label": "7", "index": "12256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, k, j, g = 0, c = 0, m = 0, t = 0;\n  char s[256] = {'\u0000'}, sub[256] = {'\u0000'}, replacement[256] = {'\u0000'},\n       w[1000] = {'\u0000'}, z[265] = {'\u0000'};\n  scanf(\"%s %s %s\", s, sub, replacement);\n  l1 = strlen(s);\n  l2 = strlen(sub);\n  for (i = 0; t <= l1 - 1; i = t) {\n    if (m == 0) {\n      if (s[i] == sub[0]) {\n        for (k = 0, j = i; k <= l2 - 1; k++, j++) {\n          if (sub[k] == s[j])\n            c++;\n        }\n        if (c >= l2) {\n          strcat(w, replacement);\n          m++;\n          t = t + l2;\n        } else {\n          z[0] = s[i];\n          strcat(w, z);\n          t++;\n        }\n        c = 0;\n      } else {\n        z[0] = s[i];\n        strcat(w, z);\n        t++;\n      }\n    } else {\n      z[0] = '\u0000';\n      for (k = i, j = 0; k <= l1 - 1; k++, j++)\n        z[j] = s[k];\n      strcat(w, z);\n      break;\n    }\n  }\n  if (m != 0)\n    printf(\"%s \", w);\n  else\n    printf(\"%s \", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char an[270], bn[270], cn[270], temp[270];\n  scanf(\"%s%s%s\", an, bn, cn);\n  char *p = strstr(an, bn);\n  int len = strlen(bn);\n  if (p != NULL) {\n    strcpy(temp, p + len);\n    *p = '\\0';\n    strcat(an, cn);\n    strcat(an, temp);\n  }\n  cout << an;\n  return 0;\n}\n"}
{"label": "7", "index": "12258", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, count = 0, k;\n  char string[256], substring[256], replacement[256], czy[256], cai[256];\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 0; j < b; j++)\n        czy[j] = string[i + j];\n      if (strcmp(czy, substring) == 0) {\n        count = 1;\n        for (k = 0; k < i; k++)\n          cai[k] = string[k];\n        for (k = i; k < i + b; k++)\n          cai[k] = replacement[k - i];\n        for (k = i + b; k < a; k++)\n          cai[k] = string[k];\n      }\n      if (count == 1)\n        break;\n    }\n  }\n  if (count == 1)\n    puts(cai);\n  else\n    puts(string);\n}\n"}
{"label": "7", "index": "12259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[3][256], string[512];\n  int n, m, k, i, j;\n  scanf(\"%s %s %s\", str[0], str[1], str[2]);\n  n = strlen(str[0]);\n  m = strlen(str[1]);\n  k = strlen(str[2]);\n  for (j = 0; j < n - m + 1; j++) {\n    for (i = 0; i < m; i++) {\n      if (str[1][i] != str[0][i + j])\n        break;\n    }\n    if (i == m)\n      break;\n  }\n  if (j < n - m + 1) {\n    for (i = 0; i < j; i++)\n      string[i] = str[0][i];\n    for (i = j; i < j + k; i++)\n      string[i] = str[2][i - j];\n    for (i = j + k; str[0][i - k + m] != '\\0'; i++)\n      string[i] = str[0][i - k + m];\n    string[i] = '\\0';\n    printf(\"%s\", string);\n  } else\n    printf(\"%s\", str[0]);\n}\n"}
{"label": "7", "index": "12260", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256], sl[256];\n  int n, m, i, j, k, e, l;\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &sub);\n  cin >> re;\n  l = 0;\n  while (s[l] != '\u0000')\n    l++;\n  m = 0;\n  while (sub[m] != '\u0000')\n    m++;\n  n = 0;\n  while (re[n] != '\u0000')\n    n++;\n  for (i = 0; i < l; i++) {\n    k = 1;\n    for (j = 0; j < m; j++)\n      if (s[i + j] != sub[j]) {\n        k = 0;\n        break;\n      }\n    if (k == 1) {\n      e = i;\n      break;\n    }\n  }\n  if (k == 1) {\n    for (i = e + m - 1; s[i] != '\u0000'; i++)\n      sl[i] = s[i];\n    sl[i + 1] = '\u0000';\n    for (i = 0; i < n; i++)\n      s[e + i] = re[i];\n    for (i = e + n; sl[i - n + m] != '\u0000'; i++)\n      s[i] = s[i - n + m];\n    s[i + 1] = '\u0000';\n  }\n  for (i = 0; s[i] != '\u0000'; i++)\n    printf(\"%c\", s[i]);\n  printf(\" \");\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, la, lb, f = 0;\n  char a[300], b[300], c[300], tem[300];\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    k = 0;\n    for (j = i; j < lb + i; j++) {\n\n      tem[k++] = a[j];\n      if (j == lb + i - 1)\n        tem[k] = 0;\n    }\n    if (!strcmp(tem, b) && f == 0) {\n      f++;\n      printf(\"%s\", c);\n      i += lb - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12262", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000], h;\n  char zichuan[1000];\n  char replace[1000];\n  int i, x;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s \", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      h = replace[j];\n\n      mubiao[i] = h;\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], s1[256], t[256];\n  int j, ls1, lt, i, k = 0;\n  scanf(\"%s%s%s\", s, s1, t);\n  ls1 = strlen(s1);\n  lt = strlen(t);\n  for (i = 0; s[i]; i++) {\n    if (s[i] == s1[k]) {\n      k++;\n      if (k == ls1 - 1)\n        break;\n    } else\n      k = 0;\n  }\n  if (i >= strlen(s))\n    printf(\"%s\\n\", s);\n  else {\n    for (j = 0; j < i - ls1 + 2; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", t);\n    for (j = i + 2; j < strlen(s); j++)\n      printf(\"%c\", s[j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[260], c[260], d[520];\n  int i, m, a1, b1, c1;\n  char *k;\n  int j;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  k = strstr(a, b);\n\n  if (k == NULL)\n    printf(\"%s\", a);\n  else {\n    m = k - &a[0];\n    for (i = 0; i < m; i++)\n      d[i] = a[i];\n    for (i = 0; i < c1; i++)\n      d[m + i] = c[i];\n    j = m + c1;\n    for (i = 0; m + b1 + i <= a1; i++)\n      d[j + i] = a[m + b1 + i];\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar s[300], subs[300], rep[300];\n\nint ok(int wh) {\n  int i;\n  for (i = wh; i <= wh + strlen(subs) - 1; i++) {\n    if (s[i] != subs[i - wh]) {\n      return 0;\n    }\n  }\n  return 1;\n}\n\nint main() {\n  int i, j, k, n, start;\n\n  scanf(\"%s \", s);\n\n  cin >> subs;\n\n  cin >> rep;\n  start = -1;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (ok(i)) {\n      start = i;\n      break;\n    }\n  if (start == -1) {\n    puts(s);\n    return 0;\n  }\n  for (i = 0; i < start; i++) {\n    printf(\"%c\", s[i]);\n  }\n  for (i = 0; rep[i] != '\u0000'; i++) {\n    printf(\"%c\", rep[i]);\n  }\n  for (i = start + strlen(subs); s[i] != '\u0000'; i++) {\n    printf(\"%c\", s[i]);\n  }\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, k = 0;\n  while (b[i] != '\u0000') {\n    i++;\n    n1++;\n  }\n  i = 0;\n  while (c[i] != '\u0000') {\n    i++;\n    n2++;\n  }\n\n  for (i = 0; a[i] != '\u0000'; i++) {\n    for (j = 0; j < n1; j++) {\n      if (a[i + j] != b[j])\n        break;\n      if (j == n1 - 1) {\n        for (j = 0; j < i; j++)\n          printf(\"%c\", a[j]);\n        printf(\"%s\", c);\n        for (j = i + n2; a[j] != '\u0000'; j++)\n          printf(\"%c\", a[j]);\n        k++;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n\n  if (k == 0)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], s[257], r[257];\n  int len1, len2, len3, i, j, k, c, flag = 0;\n  scanf(\"%s%s%s\", str, s, r);\n  len1 = strlen(str);\n  len2 = strlen(s);\n  len3 = strlen(r);\n  j = 0;\n  while (str[j] != '\\0') {\n    if (str[j] == s[0]) {\n      c = j;\n      for (i = 0; i < len2; i++) {\n        if (str[j + i] != s[i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (i == len2) {\n        flag = 1;\n        break;\n      }\n    }\n    j++;\n  }\n  if (flag) {\n    for (k = 0; k < c; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", r);\n    for (k = c + len2; k < len1; k++)\n      printf(\"%c\", str[k]);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a >> b >> c;\n  int i, j, k, nb, nc, count;\n  nb = 0;\n  nc = 0;\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; a[i + 1] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      count = 0;\n      k = i;\n      for (j = 0; j < nb; j++) {\n        if (a[k + j] == b[j]) {\n          count++;\n        } else {\n          break;\n        }\n      }\n      if (count == nb) {\n        for (j = 0; j < nc; j++) {\n          a[k + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, la, lb, f = 0;\n\n  char a[300], b[300], c[300], tem[300];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  la = strlen(a);\n  lb = strlen(b);\n\n  for (i = 0; i < la; i++) {\n    k = 0;\n    for (j = i; j < lb + i; j++) {\n\n      tem[k++] = a[j];\n      if (j == lb + i - 1)\n        tem[k] = 0;\n    }\n    if (!strcmp(tem, b) && f == 0) {\n      f++;\n      cout << c;\n      i += lb - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "12270", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int i, j, a, b, t;\n  cin >> w >> s >> r;\n  b = strlen(w);\n  a = strlen(s);\n  for (i = 0; i < b; i++) {\n    if (s[0] == w[i]) {\n      for (j = 0; j < a; j++) {\n        if (s[j] != w[i + j])\n          break;\n      }\n      if (j == a) {\n        for (t = 0; t < a; t++)\n          w[i + t] = r[t];\n        for (t = 0; t < b; t++)\n          printf(\"%c\", w[t]);\n        break;\n      }\n    }\n  }\n  if (i == b) {\n    for (t = 0; t < b; t++)\n      printf(\"%c\", w[t]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12271", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, d, e, f, k;\n  char a[256], b[256], c[256];\n  cin >> a;\n  cin;\n  cin >> b;\n  cin;\n  cin >> c;\n  d = strlen(a);\n  e = strlen(b);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      for (j = 0; j < e; j++, k++)\n        if (b[j] != a[k])\n          break;\n      if (j < e)\n        continue;\n      else\n        break;\n    } else\n      continue;\n  }\n  if (i < d) {\n    for (j = i + e; j < (d - i - e); j++)\n      a[f + j - e] = a[j];\n    for (j = i; j < (i + f); j++)\n      a[j] = c[j - i];\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t;\n  char string[256] = {0};\n  char substring[256] = {0};\n  char replacement[256] = {0};\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    t = 0;\n    if (substring[0] == string[i]) {\n      for (j = 0; j < strlen(substring); j++) {\n        if (substring[j] == string[i + j])\n          t++;\n      }\n    }\n    if (t == strlen(substring)) {\n      break;\n    }\n  }\n  if (i < strlen(string) - 1) {\n    for (j = 0; j < strlen(substring); j++)\n      string[j + i] = replacement[j];\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12273", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  char str[270], subs[70], rep[70], *p;\n  cin >> str >> subs >> rep;\n  p = strstr(str, subs); \n  if (p != NULL)\n    for (int i = 0; rep[i] != '\\0'; i++)\n      *p++ = rep[i];\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], *p, sub[50], *q, *c, rep[50];\n  cin >> s >> sub >> rep;\n  int len = strlen(sub);\n  p = s;\n  q = sub;\n  c = strstr(p, q);\n  if (c == NULL) {\n    cout << s << endl;\n  } else {\n    for (p; p < c; p++) {\n      cout << *p;\n    }\n    cout << rep;\n    for (p = c + len; *p != '\\0'; p++) {\n      cout << *p;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "7", "index": "12275", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c;\n  c = 0;\n  char t[256] = {0};\n  char s[256] = {0};\n  char r[256] = {0};\n  char z[256] = {0};\n  cin >> t >> s >> r;\n  a = strlen(t);\n  b = strlen(s);\n  for (i = 0; i <= a - b; i++) {\n    for (j = i; j < b + i; j++)\n      z[j - i] = t[j];\n    if (strcmp(z, s) == 0) {\n      c = i;\n      break;\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < a; i++)\n      printf(\"%c\", t[i]);\n  } else {\n    for (i = 0; i < c; i++)\n      printf(\"%c\", t[i]);\n    printf(\"%s\", r);\n    for (j = c + b; j < a; j++)\n      printf(\"%c\", t[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12276", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  int i, j, k, nb, nc, count;\n  nb = 0;\n  nc = 0;\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; a[i + 1] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      count = 0;\n      k = i;\n      for (j = 0; j < nb; j++) {\n        if (a[k + j] == b[j]) {\n          count++;\n        } else {\n          break;\n        }\n      }\n      if (count == nb) {\n        for (j = 0; j < nc; j++) {\n          a[k + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char m[600], z[256], t[256];\n  scanf(\"%s%s%s\", m, z, t);\n  int len1 = strlen(m);\n  int len2 = strlen(z);\n  int i, j, c = 1, flag = 0;\n  for (i = 0; i < len1; i++) {\n    int k = 0;\n    if (m[i] == z[k]) {\n      j = i;\n      for (k = 1; k < len2; k++) {\n        if (m[i + 1] == z[k]) {\n          i++;\n          c++;\n        } else {\n          break;\n        }\n      }\n    }\n    if (c == len2) {\n      break;\n    }\n  }\n  if (c == len2) {\n    for (i = 0; i < j; i++) {\n      printf(\"%c\", m[i]);\n    }\n    printf(\"%s\", t);\n    for (i = j + len2; i < len1; i++) {\n      printf(\"%c\", m[i]);\n    }\n  } else {\n    printf(\"%s\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, p;\n  char zichuan[257], danci[257], tihuan[257];\n  scanf(\"%s%s%s\", &danci, &zichuan, &tihuan);\n  int n = strlen(zichuan);\n  p = 0;\n  for (i = 0; danci[i] != 0; i++) {\n    if (p == 1) {\n      break;\n    }\n    if (danci[i] == zichuan[0]) {\n      for (j = 1; j < n; j++) {\n        if (danci[i + j] != zichuan[j]) {\n          break;\n        } else {\n          p = 1;\n          m = i;\n          break;\n        }\n      }\n    }\n  }\n  if (p == 1) {\n    for (i = m; i < m + n; i++) {\n      danci[i] = tihuan[i - m];\n    }\n    printf(\"%s\\n\", danci);\n  } else {\n    printf(\"%s\", danci);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[1000], su[1000], re[1000];\n  scanf(\"%s %s %s\", st, su, re);\n  int m, n, i, j, p = 0, q;\n  n = strlen(st);\n  m = strlen(su);\n  for (i = 0; i < n; i++) {\n    if (su[0] == st[i]) {\n      for (j = 1; j < m; j++) {\n        if (su[j] != st[i + j]) {\n          break;\n        } else {\n          p++;\n        }\n      }\n    }\n    if (p == (m - 1)) {\n      for (q = i; q < i + m; q++) {\n        st[q] = re[q - i];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", st);\n  return 0;\n}\n"}
{"label": "7", "index": "12280", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int i, j, k, n, m, f, q;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s \", s3);\n  m = strlen(s2);\n  n = strlen(s1);\n  for (i = 0; i < strlen(s1); i++) {\n    f = 0;\n    for (j = 0; j < strlen(s2); j++)\n      if (s2[j] != s1[i + j]) {\n        f = 1;\n        break;\n      }\n    if (f == 0) {\n      q = i;\n      break;\n    }\n  }\n  if (f == 1)\n    printf(\"%s\\n\", s1);\n  else {\n    for (k = 0; k < q; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s3);\n    for (k = q + m; k < n; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12281", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], *p, sub[50], *q, *c, rep[50];\n  scanf(\"%s %s %s \", s, sub, rep);\n  int len = strlen(sub);\n  p = s;\n  q = sub;\n  c = strstr(p, q);\n  if (c == NULL)\n    cout << s << endl;\n  else {\n    for (p; p < c; p++) {\n      cout << *p;\n    }\n    cout << rep;\n    for (p = c + len; *p != '\\0'; p++)\n      cout << *p;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], substr[257], rep[257];\n  int i, j = 0, m, n, g = 0;\n  scanf(\"%s\", str);\n  scanf(\"%s\", substr);\n  scanf(\"%s\", rep);\n  m = strlen(str);\n  n = strlen(substr);\n  for (i = 0; i < m; i++)\n    if (str[i] == substr[j] && g < n) {\n      j++;\n      g++;\n    } else if (g >= n)\n      break;\n    else {\n      g = 0;\n      j = 0;\n    }\n  if (g == n)\n    for (j = 0, i = i - n; j < n; j++, i++) {\n      str[i] = rep[j];\n    }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  char zfc[2][256] = {0};\n  int a = strlen(str);\n  int b = strlen(sub);\n  int i;\n  for (i = 0; i <= (a - b); i++) {\n    int j;\n    for (j = i; j < i + b; j++) {\n      if (str[j] != sub[j - i]) {\n        break;\n      }\n    }\n    if (j == i + b) {\n      for (int m = 0; m < i; m++) {\n        zfc[0][m] = str[m];\n      }\n      for (int n = i + b; n < a; n++) {\n        zfc[1][n - i - b] = str[n];\n      }\n      strcat(zfc[0], rep);\n      strcat(zfc[0], zfc[1]);\n      cout << zfc[0] << \"\\n\";\n      break;\n    }\n  }\n  if (i == (a - b + 1))\n    cout << str << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "7", "index": "12284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[257], a[50], b[50];\n  int i, j, k;\n  cin >> zfc >> a >> b;\n  for (i = 0; i < strlen(zfc); i++) {\n    if (a[0] == zfc[i]) {\n      for (j = 1; j < strlen(a); j++) {\n        if (a[j] != zfc[i + j])\n          break;\n      }\n      if (j == strlen(a))\n        break;\n    }\n  }\n  if (j == strlen(a)) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", zfc[k]);\n    for (k = i; k < i + strlen(b); k++)\n      printf(\"%c\", b[k - i]);\n    for (k = i + strlen(b); k < strlen(zfc); k++)\n      printf(\"%c\", zfc[k]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[50], c[50];\n  int n, i, j, m, k, s = 0, d, e;\n  scanf(\"%s\\n%s\\n%s\", a, b, c);\n  n = strlen(b);\n  m = strlen(a);\n  for (i = 0; i < m; i++) {\n    s = 0;\n    for (j = i, k = 0; k < n; j++, k++) {\n\n      if (a[j] != b[k]) {\n        s = 1;\n        break;\n      }\n    }\n    if (s == 0)\n      break;\n  }\n\n  if (s == 0) {\n    for (d = i, e = 0; d < i + n; d++, e++) {\n      a[d] = c[e];\n    }\n  }\n  cout << a;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12286", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257] = {0}, substring[257] = {0}, replacement[257] = {0};\n  char temp[257] = {0}, string_1[257] = {0}, string_2[257] = {0};\n  int i, j, k, word = 0;\n  int len1 = 0, len2 = 0, len3 = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i, k = 0; j < i + len2, k < len2; j++, k++)\n      temp[k] = string[j];\n\n    if (strcmp(temp, substring) == 0) {\n      word = 1;\n      len3 = i;\n      break;\n    }\n  }\n  for (i = 0; i < len3; i++) {\n    string_1[i] = string[i];\n  }\n  if (word == 1) {\n    printf(\"%s\", string_1);\n    printf(\"%s\", replacement);\n    if ((len2 + len3) < len1) {\n      k = 0;\n      for (i = len3 + len2; i < len1; i++) {\n        string_2[k] = string[i];\n        k++;\n      }\n      printf(\"%s\", string_2);\n    }\n  }\n  if (word == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int sum = 0, i, j, k, n, m, h = 0, y = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  k = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 0; j < m; j++) {\n        if (b[j] == a[i + j])\n          sum++;\n      }\n      if (sum == m && y == 0) {\n        for (j = 0; j < k; j++)\n          d[h + j] = c[j];\n        i = i + m;\n        h = h + k;\n        y = 1;\n      }\n      sum = 0;\n    }\n    d[h] = a[i];\n    h++;\n  }\n  d[h] = '\u0000';\n  printf(\"%s \", d);\n  return 0;\n}\n"}
{"label": "7", "index": "12288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr);\n  if (node == NULL)\n    while (*start != '\\0')\n      cout << *start++;\n  else {\n    len = strlen(subStr);\n    while (start != node)\n      cout << *start++;\n    while (*rep != '\\0')\n      printf(\"%c\", *rep++);\n    node += len;\n    while (*node != '\\0')\n      cout << *node++;\n  }\n  cout << endl;\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "12289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, k, a, b, c, i, j;\n  char s[3][256];\n  scanf(\"%s\", &s[0]);\n  scanf(\"%s\", &s[1]);\n  scanf(\"%s\", &s[2]);\n  a = strlen(s[0]);\n  b = strlen(s[1]);\n  c = strlen(s[2]);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      if (s[0][i + j] == s[1][j]) {\n        m++;\n      }\n    }\n    if (m == b) {\n      break;\n    }\n    m = 0;\n  }\n  if (i == a) {\n    cout << s[0];\n  } else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n    for (k = 0; k < c; k++) {\n      printf(\"%c\", s[2][k]);\n    }\n    for (k = i + b; k < a; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char mc[1000], zc[1000], huan[1000];\n  int len1, len2, len3, i, j = 0;\n  int sum = 0, ci = 0, loc;\n  scanf(\"%s%s%s\", mc, zc, huan);\n  len1 = strlen(mc);\n  len2 = strlen(zc);\n  len3 = strlen(huan);\n  for (i = 0; i < len1; i++) {\n    if (mc[i] == zc[0]) {\n      sum = 0;\n      for (j = i; j < len1; j++) {\n        if (mc[j] == zc[j - i]) {\n          sum++;\n        } else {\n          break;\n        }\n      }\n      loc = i;\n      if (sum == len2) {\n        for (i = 0; i < loc; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        for (i = loc; i <= loc + len3 - 1; i++) {\n          printf(\"%c\", huan[i - loc]);\n        }\n        for (i = loc + len3; i <= len1 + len3 - len2 - 1; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        ci++;\n        break;\n      }\n    }\n  }\n\n  if (ci == 0) {\n    printf(\"%s\", mc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0] && s[i + m - 1] == a[m - 1]) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i])\n          k++;\n      }\n\n      if (k == m) {\n        printf(\"%s\", b);\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "12292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[500], substring[500], replacement[500], temp, str[500];\n  int i, j, k, l, m, len0, len1, len2;\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n\n  len1 = strlen(substring);\n\n  len2 = strlen(replacement);\n\n  len0 = strlen(string);\n\n  strcpy(str, string);\n\n  for (i = 0; i < len0; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len1; j++) {\n        if (string[i + 1] == substring[j])\n          i++;\n        else {\n          j = 0;\n          break;\n        }\n      }\n\n      if (j == len1) {\n        k = i;\n        for (i; i < len0 - len1 + len2; i++) {\n          str[i - len1 + len2] = string[i];\n        }\n        for (l = 0; l < len2; l++) {\n          str[k - len2 + 1 + l] = replacement[l];\n        }\n      } else\n        m = 0;\n    }\n  }\n\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], yuan[100], xin[100];\n  int i = 0, j = 0, len, lenyuan, lenxin;\n\n  scanf(\"%s \", s);\n\n  cin >> yuan;\n\n  cin >> xin;\n  len = strlen(s);\n  lenyuan = strlen(yuan);\n  lenxin = strlen(xin);\n  for (i = 0; i < len; i++) {\n    if (s[i] == yuan[0] && s[lenyuan + i - 1] == yuan[lenyuan - 1]) {\n      for (j = 0; j < lenxin; j++) {\n        s[i + j] = xin[j];\n      }\n      break;\n    }\n  }\n  cout << s << \" \";\n\n  return 0;\n}\n"}
{"label": "7", "index": "12294", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  char string[256] = {'\\0'};\n  char subString[100] = {'\\0'};\n  char replacement[100] = {'\\0'};\n  int i = 0, j = 0, k = 0;\n  char c = '\\0';\n  while (c != '\\n') {\n    c = getchar();\n    if (c != '\\n') {\n      string[i] = c;\n      i++;\n    }\n  }\n  cin >> subString;\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    if (string[i] == subString[0]) {\n      k = i;\n      for (j = 0; j < strlen(subString); j++, k++) {\n        if (subString[j] != string[k]) {\n          break;\n        }\n      }\n      if (j == strlen(subString)) {\n        k = i;\n        for (j = 0; j < strlen(replacement); j++, k++)\n          string[k] = replacement[j];\n\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], substr[256], replace[256];\n  scanf(\"%s %s %s \", str, substr, replace);\n  int lenstr = strlen(str), lensubstr = strlen(substr),\n      lenreplace = strlen(replace);\n  int i, j;\n  int flag = 0;\n  int pos;\n  for (i = 0; i <= lenstr - lensubstr; i++) {\n    for (j = 0; j < lensubstr; j++) {\n      if (str[i + j] != substr[j])\n        break;\n    }\n    if (j == lensubstr) {\n      pos = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < pos; i++)\n      cout << str[i];\n    cout << replace;\n    cout << (str + pos + lensubstr) << endl;\n  } else\n    cout << str << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12296", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[200], str1[50], str2[50];\n  char *p, *q;\n  int length, i;\n  cin.getline(str, 200);\n  cin >> str1 >> str2;\n  length = strlen(str1);\n  q = str;\n  p = strstr(str, str1);\n  if (p != NULL) {\n    q = p + length;\n    for (i = 0; &str[i] != p; i++)\n      cout << str[i];\n    cout << str2;\n    for (; *q != '\\0'; q++)\n      cout << *q;\n    cout << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12297", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[10000], subString[300], replacement[1000];\n  cin >> string >> subString >> replacement;\n  char *p, *q;\n  q = replacement;\n  p = strstr(string, subString);\n  if (p != NULL) {\n    while (*q) {\n      *p++ = *q++;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar zfc[3][257];\nint main() {\n\n  cin >> zfc[1];\n\n  cin >> zfc[2];\n\n  scanf(\"%s \", zfc);\n  int i, k, len, len2, j;\n  len = strlen(zfc[1]);\n  len2 = strlen(zfc[2]);\n  for (i = 0; i < len; i++) {\n    if ((zfc[1][i] == zfc[2][0]) && (zfc[1][i + 1] == zfc[2][1]))\n      break;\n  }\n  if (i != len) {\n    for (k = i; k < (len2 + i); k++) {\n      j = k - i;\n      zfc[1][k] = zfc[3][j];\n      if (k == len2 + i)\n        break;\n    }\n  }\n  printf(\"%s\", zfc[1]);\n  return 0;\n}\n"}
{"label": "7", "index": "12299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint judge(int i, char s[800], char sub[800]) {\n\n  int j;\n  for (j = i; j <= i + strlen(sub) - 1; j++)\n    if (s[j] != sub[j - i])\n      break;\n  if (j == i + strlen(sub))\n    return 1;\n  else\n    return 0;\n}\nvoid change(int i, char s[800], char sub[800], char r[800]) {\n  int l, ls, lr, j, k;\n  l = strlen(s);\n  ls = strlen(sub);\n  lr = (strlen(r));\n\n  if (ls <= lr) {\n    k = lr - ls;\n    for (j = l + k + 1; j >= i + lr; j--)\n      s[j] = s[j - k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  } else {\n    k = ls - lr;\n    for (j = i + lr; j <= l - k + 1; j++)\n      s[j] = s[j + k];\n    for (j = i; j <= i + lr - 1; j++)\n      s[j] = r[j - i];\n  }\n}\nint main() {\n  char s[800], sub[800], r[800];\n  int l, i;\n  cin >> s;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", r);\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    if ((s[i] == sub[0]) && (judge(i, s, sub) > 0)) {\n      change(i, s, sub, r);\n      break;\n    }\n  puts(s);\n}\n"}
{"label": "7", "index": "12300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char M[3][20];\n  scanf(\"%s\", M[0]);\n  if (M[0][0] == 'i')\n    printf(\"iloveearth\");\n  else if (M[0][0] == 's')\n    cout << \"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\";\n  else {\n    printf(\"programmingiscool\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    int k = 0;\n    if (a[i] == b[0]) {\n      k = 1;\n      for (int e = 0; b[e] != '\u0000'; e++) {\n        if (a[i + e] != b[e])\n          k = 0;\n      }\n      if (k == 1)\n        for (int f = 0; b[f] != '\u0000'; f++) {\n          a[i + f] = c[f];\n        }\n    }\n    if (k == 1)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  scanf(\"%s%s%s\", s, a, b);\n  int i, j, n, k, m = 0, max;\n  for (i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    for (j = 0; j < strlen(a); j++) {\n      c[j] = s[i + j];\n    }\n    c[j + 1] = '\\0';\n    if (strcmp(c, a) == 0) {\n      break;\n    }\n    c[j] = 0;\n    m++;\n  }\n\n  if (strlen(b) > strlen(a)) {\n    max = strlen(b);\n  } else {\n    max = strlen(a);\n  }\n  if (m != strlen(s) - strlen(a) + 1) {\n    for (j = 0; j < max; j++) \n    {\n      if (b[j] == '\\0') {\n        break;\n      }\n      s[i + j] = b[j];\n    }\n    printf(\"%s\", s);\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n  scanf(\"%s\", &q);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int i = 0, j = 0, k = 0, s = 0, p = 0, qc, ac, bc, r, js = 0, sz[100] = {0},\n      x, y, z, npc;\n  qc = strlen(q);\n  ac = strlen(a);\n  bc = qc - ac;\n  for (i = 0; i < bc + 1; i++) {\n\n    for (j = 0; j < ac; j++) {\n      xc[i][j] = q[j + k];\n    }\n    k++;\n    p = strcmp(xc[i], a);\n    if (p == 0) {\n      sz[js] = i;\n      js++;\n    }\n  }\n  npc = sz[0];\n\n  if (js == 0) {\n    printf(\"%s \", q);\n  }\n  if (js != 0) {\n    for (x = 0; x < npc; x++) {\n      printf(\"%c\", q[x]);\n    }\n    printf(\"%s\", b);\n    for (z = npc + ac; z < qc; z++)\n      printf(\"%c\", q[z]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], subString[256], replacement[256];\n  char *n = NULL;\n  int l, i;\n  memset(string, '\\0', sizeof(string));\n  memset(subString, '\\0', sizeof(subString));\n  memset(replacement, '\\0', sizeof(replacement));\n  cin >> string >> subString >> replacement;\n  n = strstr(string, subString);\n  l = strlen(subString);\n  if (n != NULL) {\n    for (i = 0; i < l; i++)\n      n[i] = replacement[i];\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint pd(char *p, char *sub, int n) {\n  int j;\n  char *x, *y;\n  int zhi = 0;\n  for (j = 0, x = p, y = sub; j < n; j++, x++, y++)\n    if (*x == *y)\n      zhi = 1;\n    else {\n      zhi = 0;\n      break;\n    }\n\n  return (zhi);\n}\nint main() {\n  char *a, *sub, *rep, *t;\n  char *p;\n  int n, m;\n  a = (char *)malloc(250 * sizeof(char));\n  sub = (char *)malloc(1000);\n  rep = (char *)malloc(1000);\n  t = (char *)malloc(1000);\n\n  cin >> a;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (n = 0, p = sub; *p != '\u0000'; p++, n++)\n    ;\n  for (m = 0, p = a; *p != '\u0000'; p++, m++)\n    ;\n\n  for (p = a; p < a + m - n; p++)\n    if (pd(p, sub, n) == 1)\n      break;\n  strcpy(t, p + n);\n  if (pd(p, sub, n) == 1)\n    strcpy(p, rep);\n  strcpy(p + n, t);\n  puts(a);\n}\n"}
{"label": "7", "index": "12306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[500], sub[500], rep[500];\n  int i, j, shou, mo, k;\n  scanf(\"%s %s %s\", str, sub, rep);\n  int len1 = strlen(str);\n  int len2 = strlen(sub);\n  int len3 = strlen(rep);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j]) {\n        break;\n      }\n    }\n    if (j == len2) {\n      shou = i;\n      mo = i + j;\n      break;\n    }\n  }\n  if (j != len2) {\n    printf(\"%s\", str);\n  } else {\n    if (len2 >= len3) {\n      for (i = shou, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = mo; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    }\n\n    else {\n      i = len1 + len3 - len2;\n      for (k = len1; k >= mo; k--, i--) {\n        str[i] = str[k];\n      }\n      for (k = shou, j = 0; rep[j] != 0; k++, j++) {\n        str[k] = rep[j];\n      }\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, z = 1, l = 0, flag = 0;\n  int i = 0, k = 0, num = 0, j = 0;\n  char s[256] = {0}, w[256] = {0}, mid[256] = {0}, out[256] = {0}, p[256] = {0};\n  cin >> w;\n  cin >> s;\n  cin >> p;\n  n = strlen(s);\n  m = strlen(w);\n  for (; l < m - 1;) {\n    for (i = 0; i < n; i++, k++)\n      mid[i] = w[k];\n\n    z++;\n    k = z;\n    num++;\n    if (strcmp(mid, s) == 0) {\n      flag = 1;\n      break;\n    }\n    l++;\n  }\n  if (flag == 0) {\n    puts(w);\n  } else {\n    j = num;\n    for (i = 0; i < n; i++, j++)\n      w[j] = p[i];\n\n    puts(w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < len; ++i)\n    if (c[i] == a[0]) {\n      flag = 1;\n      for (j = 0; j < lena && i + j < len; ++j)\n        if (a[j] != c[i + j]) {\n          flag = 0;\n          break;\n        }\n      if (flag) {\n        cout << b;\n        i += lena;\n        break;\n      } else\n        printf(\"%c\", c[i]);\n    } else\n      printf(\"%c\", c[i]);\n  printf(\"%s\", c + i);\n  return 0;\n}\n"}
{"label": "7", "index": "12309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[257], substring[257], replacement[257];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  int i, len1, len2, j, k, a = 0;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len2; j++) {\n        if (substring[j] == string[j + i])\n          a += 1;\n        else\n          break;\n      }\n      if (a == len2 - 1) {\n        for (k = 0; k < len2; k++)\n          string[k + i] = replacement[k];\n        break;\n      }\n    }\n  }\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[257], rep[257];\n  int i, j, t, k;\n  int len_s, len_sub, len_rep;\n  cin.getline(s, 257);\n  cin.getline(sub, 257);\n  cin.getline(rep, 257);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  len_rep = strlen(rep);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char t[256];\n  char c;\n  int i, ls, j, la, lt, g, word = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", t);\n  ls = strlen(s);\n  la = strlen(a);\n  lt = strlen(t);\n\n  for (i = 0; i < ls; i++) {\n    if (word == 0) {\n      g = 0;\n      if (s[i] == a[0]) {\n        g++;\n        for (j = i + 1; j < i + la; j++) {\n          if (s[j] == a[g]) {\n            g++;\n          }\n        }\n        if (g == la) {\n          word = 1;\n          for (j = i; j < i + la; j++) {\n            s[j] = t[j - i];\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, k, j, g = 0, c = 0, m = 0, t = 0;\n  char s[256] = {'\u0000'}, sub[256] = {'\u0000'}, replacement[256] = {'\u0000'},\n       w[1000] = {'\u0000'}, z[265] = {'\u0000'};\n  cin >> s >> sub >> replacement;\n  l1 = strlen(s);\n  l2 = strlen(sub);\n  for (i = 0; t <= l1 - 1; i = t) {\n    if (m == 0) {\n      if (s[i] == sub[0]) {\n        for (k = 0, j = i; k <= l2 - 1; k++, j++) {\n          if (sub[k] == s[j])\n            c++;\n        }\n        if (c >= l2) {\n          strcat(w, replacement);\n          m++;\n          t = t + l2;\n        } else {\n          z[0] = s[i];\n          strcat(w, z);\n          t++;\n        }\n        c = 0;\n      } else {\n        z[0] = s[i];\n        strcat(w, z);\n        t++;\n      }\n    } else {\n      z[0] = '\u0000';\n      for (k = i, j = 0; k <= l1 - 1; k++, j++)\n        z[j] = s[k];\n      strcat(w, z);\n      break;\n    }\n  }\n  if (m != 0)\n    printf(\"%s \", w);\n  else\n    printf(\"%s \", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k, len, len1, len2, m;\n  scanf(\"%s%s%s\", string, substr, replace);\n  len1 = strlen(string);\n  len2 = strlen(substr);\n  for (i = 0; i < len1; i++) {\n    if (substr[0] == string[i]) {\n      len = 0;\n      for (j = 0; j < len2; j++) {\n        if ((substr[j] == string[i + j]) && len < len2)\n          len++;\n      }\n      if (len == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string[k]);\n        cout << replace;\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string[k]);\n        m = 1;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m != 1)\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[530] = {'\\0'}, e[257] = {'\\0'};\n  int i, m = 0, j, t, len;\n  cin >> a >> b >> c;\n  for (i = 0;; i++) {\n    if (a[i] == '\\0' || b[m] == '\\0')\n      break;\n    if (b[m] != a[i]) {\n      m = 0;\n      continue;\n    }\n    m++;\n  }\n  if (m != 0) {\n    for (j = 0, t = 0; j <= i - m; j++, t++) {\n      if (j == i - m) {\n        d[t] = '\\0';\n      } else {\n        d[t] = a[j];\n      }\n    }\n    len = strlen(a);\n    if (i != len) {\n      for (j = i, t = 0; j < len; j++, t++) {\n        e[t] = a[j];\n      }\n      strcat(d, c);\n      strcat(d, e);\n    } else {\n      strcat(d, c);\n    }\n    printf(\"%s\", d);\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char yuan[256];\n  char sub[256];\n  char replace[256];\n  char sz[256][256];\n\n  cin >> yuan;\n\n  cin >> sub;\n\n  cin >> replace;\n  int n = strlen(sub);\n  int m = strlen(yuan);\n  int i, k, result;\n  int a = 0;\n  int b = 0;\n  for (i = 0; i <= m - n; i++) {\n    for (k = 0; k < n; k++) {\n      sz[a][b] = yuan[i + k];\n      b++;\n    }\n    sz[a][b] = '\u0000';\n    a++;\n    b = 0;\n  }\n  for (i = 0; i < a; i++) {\n    result = strcmp(sz[i], sub);\n    if (result == 0) {\n      strcpy(sz[i], replace);\n      printf(\"%s\", sz[i]);\n      i += n;\n      break;\n    } else {\n      printf(\"%c\", yuan[i]);\n    }\n  }\n  for (i = i; i < m; i++) {\n    printf(\"%c\", yuan[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, h = 0;\n  char a[100], b[100], c[100];\n  cin >> a >> b >> c;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0]) {\n      h = 0;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[j + i] == b[j]) {\n          h++;\n        }\n      }\n      if (h == strlen(b)) {\n        for (j = 0; j < strlen(c); j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j;\n  int m, n;\n  scanf(\"%s \", string);\n  for (i = 0; string[i] != '\u0000';) {\n    i++;\n  }\n  m = i;\n  scanf(\"%s \", substr);\n  for (i = 0; substr[i] != '\u0000';) {\n    i++;\n  }\n  n = i;\n  scanf(\"%s \", replace);\n  for (i = 0; i < m; i++) {\n    if (string[i] == substr[0]) {\n      for (j = 0; j < n; j++) {\n        if (string[i + j] != substr[j])\n          break;\n      }\n      if (j == n) {\n        for (j = 0; j < n; j++)\n          string[i + j] = replace[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "12318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], rep[100];\n  int i, j, m, len, lens;\n  cin >> str >> sub >> rep;\n  len = strlen(str);\n  lens = strlen(sub);\n\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0] && str[i + 1] == sub[1] &&\n        str[i + lens - 1] == sub[lens - 1]) {\n      j = i;\n      m = 0;\n      while (m < lens) {\n        str[j] = rep[m];\n        j++;\n        m++;\n      }\n      break;\n    }\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], sz[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int a, b, c, tag;\n  a = strlen(sub);\n  c = strlen(str);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    tag = 0;\n    if (str[i] == sub[0]) {\n      for (j = 0; j < a; j++) {\n        sz[j] = str[i + j];\n      }\n\n      sz[a] = '\\0';\n    }\n    if (strcmp(sz, sub) == 0) {\n      b = i;\n      strcpy(sub, rep);\n      tag = 1;\n      break;\n    }\n  }\n  if (tag == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", sub);\n    for (i = b + a; i < c; i++) {\n      printf(\"%c\", str[i]);\n    }\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p, *q, *r;\n  p = (char *)malloc(1000);\n  q = (char *)malloc(1000);\n  r = (char *)malloc(1000);\n\n  cin >> p;\n  cin >> q;\n  cin >> r;\n  int a, b, c;\n  a = strlen(p);\n  b = strlen(q);\n  c = strlen(r);\n  int i, j, k;\n  int t = 1;\n  for (i = 0; i < a; i++) {\n    for (j = i, k = 0; j < i + b; j++, k++) {\n      if (p[j] != q[k]) {\n        t = 0;\n        break;\n      }\n    }\n    if (k == b)\n      break;\n  }\n  if (k == b) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", p[j]);\n    printf(\"%s\", r);\n    for (j = i + b; j < a; j++)\n      printf(\"%c\", p[j]);\n  } else\n    printf(\"%s\", p);\n}\n"}
{"label": "7", "index": "12321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s%s%s\", a, b, c);\n  int i, l, k;\n  int m = 0, n = 0;\n  for (;;) {\n    for (k = m;; k++) {\n      if (a[k] == b[0]) {\n        n = 1;\n        break;\n      }\n      if (a[k] == '\\0') {\n        n = 2;\n        break;\n      }\n    }\n    if (n == 2)\n      break;\n    else {\n      m = k + 1;\n      for (l = 1;; l++) {\n        if (b[l] == '\\0') {\n          n = 3;\n          break;\n        }\n        if (a[k + l] != b[l]) {\n          n = 4;\n          break;\n        }\n      }\n      if (n == 3)\n        break;\n    }\n  }\n\n  if (n == 2)\n    printf(\"%s\", a);\n  else {\n    for (i = 0;; i++) {\n      a[k + i] = a[k + i + strlen(b)];\n      if (a[k + i + strlen(b)] == '\\0')\n        break;\n    }\n    for (i = strlen(c); i > 0; i--) {\n      int x = strlen(a);\n      for (l = 0; x - l >= k; l++) {\n        a[x + 1 - l] = a[x - l];\n      }\n      a[k] = c[i - 1];\n    }\n\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12322", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  \n  char str[256], substr[256], replace[256];\n  char p[256];\n\n  \n  int k = 0;\n  \n  int m;\n\n  \n\n  scanf(\"%s\", str);\n\n  scanf(\"%s\", substr);\n\n  scanf(\"%s\", replace);\n\n  \n  int str1 = strlen(str), str2 = strlen(substr), str3 = strlen(replace);\n  for (int i = 0; i <= str1 - str2; i++) {\n    \n    m = 1;\n    for (int l = 0; l < strlen(substr); l++) {\n      \n      if (str[i + l] != substr[l]) {\n        m = 0;\n        break;\n      }\n    }\n\n    \n    \n    \n    int j;\n    if (m) {\n      k = 1; \n      \n      for (j = i; j < i + str3; j++)\n        p[j] = replace[j - i];\n      \n      for (k = i + str2, i = j; k < str1; k++, i++)\n        p[i] = str[k];\n      \n      break;\n    } else {\n      \n      p[i] = str[i];\n    }\n  }\n\n  \n  \n  \n  if (k) {\n\n    for (int i = 0; i < strlen(str) - strlen(substr) + strlen(replace); i++)\n      printf(\"%c\", p[i]);\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12323", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, length2, length1;\n  char str[300], sub[300], rep[300];\n\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  length1 = strlen(str);\n  length2 = strlen(sub);\n  for (i = 0; i < length1; i++) {\n    for (j = 0; j < length2; j++) {\n      if (sub[j] != str[i + j])\n        break;\n    }\n    if (j == length2) {\n      for (j = 0; j < length2; j++)\n        str[i + j] = rep[j];\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, m, p, e;\n  char sz[1000], sf[1000], sc[1000];\n\n  cin >> sz;\n\n  scanf(\"%s \", sf);\n\n  cin >> sc;\n  int len = strlen(sz);\n  int len1 = strlen(sf);\n  for (i = 0; i < len; i++) {\n    e = 0;\n    if (sz[i] == sf[0]) {\n      for (k = 0; k < len1; k++) {\n        if (sz[i + k] == sf[k])\n          e++;\n      }\n\n      if (e == len1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", sz[m]);\n        }\n        printf(\"%s\", sc);\n        for (p = i + len1; p < len; p++) {\n          cout << sz[p];\n        }\n\n        break;\n      }\n    }\n  }\n  if (e != len1) {\n    printf(\"%s\", sz);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12325", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s \", c);\n  int i, j;\n  int count1 = 0, count2 = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    count1++;\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    count2++;\n  }\n  int k, l, m, n, judge = 0, o, p, judge1 = 0;\n  for (k = 0; k <= count1 - count2; k++) {\n    n = 0;\n    if (a[k] == b[0]) {\n      o = m = k;\n      for (n = 0; n <= count2 - 1; n++) {\n        if (a[m] != b[n]) {\n          break;\n        } else if (n == count2 - 1 && a[m] == b[n]) {\n          judge = 1;\n        } else if (a[m] == b[n] && n != count2 - 1) {\n          m++;\n        }\n      }\n      if (judge == 1) {\n        for (o = k; o <= k + count2 - 1; o++) {\n          a[o] = c[o - k];\n        }\n        for (p = 0; p <= count1 - 1; p++) {\n          printf(\"%c\", a[p]);\n        }\n        judge1 = 1;\n        break;\n      } else if (judge == 0) {\n        continue;\n      }\n    }\n  }\n  if (judge1 == 0) {\n    for (int z = 0; z <= count1 - 1; z++)\n      printf(\"%c\", a[z]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  cin >> b;\n  cin >> c;\n  for (i = 0; i < 256; i++) {\n    k = 0;\n    for (j = 0; j < strlen(b); j++) {\n      if (a[j + i] != b[j]) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", a[j]);\n      for (j = 0; j < strlen(c); j++)\n        printf(\"%c\", c[j]);\n      for (j = i + strlen(b); j < strlen(a); j++)\n        printf(\"%c\", a[j]);\n\n      break;\n    }\n  }\n  if (k == 1) {\n    for (j = 0; j < strlen(a); j++)\n      cout << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, e = 0, k, l = 0;\n  char a[260] = {'\\0'}, b[260] = {'\\0'}, c[260] = {'\\0'};\n  scanf(\"%s %s %s\", b, a, c);\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == a[0]) {\n      for (j = 0; j < strlen(a); j++) {\n        if (b[i + j] != a[j]) {\n          e = 1;\n        }\n      }\n      if (e == 0) {\n        k = i;\n        l = 1;\n        break;\n      } else\n        e = 0;\n    }\n  }\n\n  if (l == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"%s\", c);\n    for (i = k + strlen(a); i < strlen(b); i++) {\n      printf(\"%c\", b[i]);\n    }\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "12328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char src[256];\n  char dst[256];\n  char replacement[256];\n  \n  \n\n  scanf(\"%s\", src);         \n  scanf(\"%s\", dst);         \n  scanf(\"%s\", replacement); \n  char *p = strstr(src, dst);\n  if (p == NULL) {\n    printf(\"%s\\n\", src);\n  } else {\n    int len = strlen(replacement);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = replacement[i];\n      p++;\n    } \n    printf(\"%s\\n\", src);\n  } \n\n  return 0;\n}\n"}
{"label": "7", "index": "12329", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++)\n        c[f] = a[j];\n\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char s[30000];\n  char yc[30000];\n  char tc[30000];\n  int tag = 1;\n  int u = 0;\n\n  cin >> s;\n  cin >> yc;\n  cin >> tc;\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == yc[0]) {\n      tag = 2;\n      for (int j = 0; j < strlen(yc); j++) {\n        if (s[i + j] != yc[j]) {\n          tag = 0;\n          break;\n        }\n      }\n    }\n    if (tag == 2) {\n      printf(\"%s\", tc);\n      u = i + strlen(yc);\n      break;\n    }\n\n    if (tag != 2) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  if (tag == 2) {\n    for (int k = u; k < strlen(s); k++) {\n      printf(\"%c\", s[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256] = {'\\0'}, s2[256] = {'\\0'}, s3[256] = {'\\0'}, t[256] = {'\\0'};\n  int i, j, k = 0, s, l1, l2, l3;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  for (i = 0; i < l1;) {\n    for (j = 0; j < l2; j++) {\n      if (i + j >= l1 || s1[i + j] != s2[j]) {\n        break;\n      }\n    }\n    if (j == l2) {\n      for (s = 0; s < l3; s++) {\n        t[k] = s3[s];\n        k++;\n      }\n      i = i + l2;\n      break;\n    } else {\n      t[k] = s1[i];\n      i++;\n      k++;\n    }\n  }\n  for (; i < l1; i++) {\n    t[k] = s1[i];\n    k++;\n  }\n  t[k] = '\\0';\n  printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "7", "index": "12332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  cin >> str2;\n  cin >> str3;\n  int a, i, j, b, k = 0, c;\n  c = strlen(str3);\n  a = strlen(str1);\n  b = strlen(str2);\n  for (i = 0; i < a; i++) {\n    if (str1[i] == str2[0]) {\n      for (j = 1; j < b; j++) {\n        if (str1[i + j] == str2[j])\n          k++;\n        else {\n          k = 0;\n          break;\n        }\n      }\n      if (k == b - 1) {\n        for (j = i; j < i + c; j++) {\n          str1[j] = str3[j - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << str1;\n  return 0;\n}\n"}
{"label": "7", "index": "12333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, t = 0;\n  char c[256], d[256], e[256];\n  scanf(\"%s\", c);\n  cin >> d;\n  cin >> e;\n  m = strlen(c);\n  n = strlen(d);\n  for (i = 0; i < m; i++) {\n    if (c[i] == d[0]) {\n      t = 0;\n      for (j = i; j < i + n; j++) {\n        if (c[j] == d[j - i]) {\n          t = t + 1;\n        }\n      }\n      if (t == n) {\n        for (j = i; j < i + n; j++)\n          c[j] = e[j - i];\n\n        break;\n      }\n    }\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "7", "index": "12334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[260], w[260], h[260];\n  int l1, l2, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (j = 0; j < l1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < l2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == l2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < l2; k++)\n      cout << h[k];\n    for (k = j + l2; k < l1; k++)\n      printf(\"%c\", s[k]);\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[257], s2[257], s3[257];\n  char *p;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  p = strstr(s1, s2);\n  if (p) {\n    int i = p - s1;\n    s1[i] = '\u0000';\n    cout << s1;\n    printf(s3);\n    cout << p + strlen(s2) << \" \";\n  } else {\n    puts(s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int k, count = 0, i, j = 0;\n  cin >> str;\n  scanf(\"%s \", sub);\n  cin >> rep;\n  k = strlen(sub);\n  for (i = 0;;) {\n\n    if (count == k || str[j] == '\u0000')\n      break;\n    else {\n      for (; str[j] != 0 && count != k; j++) {\n        if (str[j] == sub[i]) {\n          count++;\n          i++;\n        } else {\n          count = 0;\n          i = 0;\n        }\n      }\n    }\n  }\n  if (count == k) {\n\n    for (int t = 0; j - k + t < j; t++) {\n      str[j - k + t] = rep[t];\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12337", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[280], b[280], c[280];\n  char res[280];\n  char t[280];\n  int i, j;\n  int check = 0;\n  cin >> a >> b >> c;\n\n  for (i = 0; i < strlen(a); i++) {\n    if (check == 1)\n      break;\n    if (b[0] == a[i]) {\n      for (j = 0; j < 280; j++)\n        t[j] = '\\0';\n      for (j = 0; j < 280; j++)\n        res[j] = '\\0';\n      for (j = i; j < i + strlen(b); j++)\n        t[j - i] = a[j];\n      if (strcmp(b, t) == 0) {\n        check = 1;\n        for (j = 0; j < i; j++) {\n          res[j] = a[j];\n        }\n        for (j = i; j < strlen(c) + i; j++) {\n          res[j] = c[j - i];\n        }\n        for (j = strlen(c) + i; j < strlen(a) + strlen(c) - strlen(b); j++)\n          res[j] = a[j + strlen(b) - strlen(c)];\n      }\n    }\n  }\n  if (check == 1)\n    printf(\"%s\\n\", res);\n  else\n    printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], subs[15], reps[15];\n  int i, j, k, ls, lsub, lrep, w;\n  scanf(\"%s\", s);\n  cin >> subs;\n  scanf(\"%s\", reps);\n  ls = strlen(s);\n  lsub = strlen(subs);\n  lrep = strlen(reps);\n  for (i = 0; i < ls; i++) {\n    w = 0;\n    for (j = 0; j < lsub; j++) {\n      if (s[i + j] == subs[j])\n        w++;\n    }\n    if (w == lsub) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lrep; k++)\n        printf(\"%c\", reps[k]);\n      for (k = i + lsub; k < ls; k++)\n        printf(\"%c\", s[k]);\n      break;\n    }\n  }\n  if (w != lsub)\n    printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12339", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, z = 1, l = 0, flag = 0;\n  int i = 0, k = 0, num = 0, j = 0;\n  char s[256] = {0}, w[256] = {0}, mid[256] = {0}, out[256] = {0}, p[256] = {0};\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> p;\n  n = strlen(s);\n  m = strlen(w);\n  for (; l < m - 1;) {\n    for (i = 0; i < n; i++, k++) {\n      mid[i] = w[k];\n    }\n    z++;\n    k = z;\n    num++;\n    if (strcmp(mid, s) == 0) {\n      flag = 1;\n      break;\n    }\n    l++;\n  }\n\n  if (flag == 0) {\n    puts(w);\n  } else {\n    j = num;\n    for (i = 0; i < n; i++, j++) {\n      w[j] = p[i];\n    }\n    puts(w);\n  }\n}\n"}
{"label": "7", "index": "12340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[260], s2[260], s3[260];\n  int i, j, a = 0, b, c, d;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n\n  cin >> s3;\n  c = strlen(s2);\n  d = strlen(s1);\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == s2[0]) {\n      for (j = 0; s2[j] != 0; j++) {\n        if (s1[j + i] == s2[j]) {\n          a = 1;\n        } else {\n          a = 0;\n          break;\n        }\n      }\n    }\n    if (a == 1) {\n      b = i;\n      break;\n    }\n  }\n  if (a == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; s3[i] != 0; i++) {\n      printf(\"%c\", s3[i]);\n    }\n    for (i = 0; i < d - b - c; i++) {\n      printf(\"%c\", s1[i + c + b]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, l1;\n  char s[256], a[256], b[256], t[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= l1 - 1; j++) {\n      t[j] = s[i + j];\n    }\n    if (strcmp(t, a) == 0) {\n      for (j = 0; j <= l1 - 1; j++) {\n        s[i + j] = b[j];\n      }\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[260], s1[260], s2[260], s3[260];\n  int i, j, k, l, h, len, len1, len2;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0, h = 0; i < len; i++, h++) {\n\n    s3[h] = s[i];\n    if (s[i] == s1[0]) {\n      int e = 1;\n      for (j = 0, k = i; j < len1; j++, k++) {\n        if (s[k] != s1[j]) {\n          e = 0;\n          break;\n        }\n      }\n      if (e) {\n        for (l = 0; l < len2; l++, h++) {\n          s3[h] = s2[l];\n        }\n        h--;\n        i = i + len1 - 1;\n        s1[0] = '.';\n      }\n    }\n  }\n  s3[len - len1 + len2] = '\u0000';\n  cout << s3;\n  return 0;\n}\n"}
{"label": "7", "index": "12343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], z[256], p[256];\n  scanf(\"%s%s%s\", s, z, p);\n  int i, ls, lz, lp, j, t = 0, loc = -1;\n  ls = strlen(s);\n  lz = strlen(z);\n  lp = strlen(p);\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = i; j < i + lz; j++) {\n      if (s[j] == z[j - i]) {\n\n        t++;\n      }\n    }\n\n    if (t == lz) {\n\n      loc = i;\n      i = ls;\n      j = lz;\n    }\n  }\n\n  if (loc == -1) {\n    puts(s);\n  }\n\n  else {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; i < lp; i++) {\n      printf(\"%c\", p[i]);\n    }\n    for (i = loc + lp; i < ls; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000], substr[1000], replace[1000];\n  char *p, *q, *r, *start;\n  int len;\n  scanf(\"%s %s %s\", str, substr, replace);\n  len = strlen(substr);\n  for (p = str; *p != '\\0'; p++) {\n    for (q = p, r = substr; *r != '\\0'; q++, r++)\n      if (*q != *r)\n        break;\n    if (*r == '\\0') {\n      start = p;\n      break;\n    }\n  }\n  for (p = start, q = replace; *q != '\\0'; p++, q++)\n    *p = *q;\n  printf(\"%s\", str);\n}\n"}
{"label": "7", "index": "12345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c, d, str1[256], str2[256], str3[256];\n  int l, h, i, j = 0, k, st = 0;\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  l = strlen(str2);\n  for (i = 0; ((c = str2[i]) != '\\0'); i++) {\n    c = str2[i];\n    for (; ((d = str1[j]) != '\\0'); j++) {\n      d = str1[j];\n      if (c == d) {\n        st = st + 1;\n        j = j + 1;\n        break;\n      } else if ((c != d) && (st != 0)) {\n        st = 0;\n        i = -1;\n        break;\n      }\n    }\n  }\n  if (st == l) {\n    for (h = 0, k = (j - l); k < j; k++, h++)\n      str1[k] = str3[h];\n\n    printf(\"%s\\n\", str1);\n  } else\n    cout << str1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int l1, i, j, n;\n  int flag;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      for (j = i + 1; j < (i + l1); j++) {\n        if (s[j] != a[j - i])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (n = 0; n < i; n++)\n          printf(\"%c\", s[n]);\n        printf(\"%s\", b);\n        for (n = i + l1; s[n] != '\\0'; n++)\n          printf(\"%c\", s[n]);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[256], sub[256], repl[256];\n  cin >> str >> sub >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if (same == 0)\n      cout << str[i];\n    if (same == 1) {\n      cout << repl;\n      for (k = i + strlen(sub); str[k] != 0; k++) {\n        printf(\"%c\", str[k]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, k, n1, n2;\n  cin >> a >> b >> c;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i <= n1 - n2; i++) {\n    for (j = 0; j < n2; j++)\n      if (b[j] == a[i + j]) {\n        k++;\n        if (k == n2)\n          break;\n      } else {\n        k = 0;\n        break;\n      }\n    if (k == n2)\n      break;\n  }\n  if (k == n2) {\n    for (j = 0; j < n2; j++)\n      a[i + j] = c[j];\n    printf(\"%s\", a);\n  } else\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[2000];\n\n  cin >> zfc;\n  int c;\n  c = strlen(zfc);\n  char tzfc[2000];\n  char hzfc[2000];\n\n  cin >> tzfc;\n\n  cin >> hzfc;\n  int ct, ch;\n  ct = strlen(tzfc);\n  ch = strlen(hzfc);\n\n  int i, wei, an = 0, x, deng = 0;\n  for (i = 0; i < c; i++) {\n    int flag = 0;\n    for (x = i; x < ct + i; x++) {\n      if (zfc[x] != tzfc[x - i]) {\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    if (flag == 0) {\n      wei = i;\n      an++;\n      deng = 1;\n    }\n\n    if (an == 1) {\n      break;\n    }\n  }\n\n  if (deng == 0) {\n    puts(zfc);\n  } else {\n\n    int xzfc[2000];\n    for (i = 0; i < wei; i++) {\n      xzfc[i] = zfc[i];\n    }\n    for (i = wei; i < ch + wei; i++) {\n      xzfc[i] = hzfc[i - wei];\n    }\n    for (i = ch + wei; i < c - ct + ch; i++) {\n      xzfc[i] = zfc[i - (ch - ct)];\n    }\n\n    for (i = 0; i < c - ct + ch; i++) {\n      printf(\"%c\", xzfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, length1, length2, k;\n  cin >> s1 >> s2 >> s3;\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length1; i++) {\n    j = 0;\n    for (; j < length2 && s1[i] == s2[j]; j++)\n      i++;\n    if (j == length2) {\n      for (k = 0; k < length2; k++)\n        s1[i - j + k] = s3[k];\n      break;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12351", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], w[300], r[300], d[300];\n  int i, j, l, h;\n  cin >> s >> w >> r;\n  l = strlen(s);\n  h = strlen(w);\n  for (i = 0; i <= l - h; i++) {\n    for (j = 0; j < h; j++) {\n      d[j] = s[i + j];\n    }\n    d[h] = '\\0';\n    if (strcmp(d, w) == 0)\n      break;\n  }\n  if (i == l - h + 1)\n    printf(\"%s\", s);\n  else {\n    for (j = i; j < i + h; j++) {\n      s[j] = r[j - i];\n    }\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    for (j = 0; j < changdu2; j++)\n      media[i][j] = x[i + j];\n  }\n  for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n    if (strcmp(media[i], y) == 0) {\n      p = i;\n      break;\n    }\n  }\n  if (i >= changdu1 - changdu2 + 1) {\n    for (i = 0; i < changdu1; i++)\n      printf(\"%c\", x[i]);\n  } else {\n    strcpy(media[p], z);\n    if (p != 0) {\n      for (i = 0; i < p; i++)\n        printf(\"%c\", x[i]);\n      printf(\"%s\", media[p]);\n      if (changdu2 > changdu3)\n        m = changdu2;\n      else\n        m = changdu3;\n      for (i = p + m; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    } else {\n      printf(\"%s\", media[p]);\n      for (i = p + changdu3; i < changdu1; i++)\n        printf(\"%c\", x[i]);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12353", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zfc[100], s2[200];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, k, l, la, lb, ls, th = 200;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    l = 0;\n    for (k = i; k < la + i; k++) {\n      zfc[l] = s[k];\n      l++;\n    }\n    zfc[l] = '\u0000';\n    if (strcmp(zfc, a) == 0) {\n      th = i;\n      break;\n    }\n  }\n  if (th < 200) {\n    for (i = 0; i < th; i++) {\n      s2[i] = s[i];\n    }\n    for (i = th; i < th + lb; i++) {\n      s2[i] = b[i - th];\n    }\n    for (i = th + lb; i < ls + lb - la; i++) {\n      s2[i] = s[i - lb + la];\n    }\n    s2[ls + lb - la] = '\u0000';\n    puts(s2);\n  }\n  if (th == 200)\n    puts(s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12354", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n = 0, m;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n    }\n    if (n == m - 1) {\n      for (j = 0; j < m; j++)\n        a[i + j] = c[j];\n      break;\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12355", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  int i, l, k;\n  int m = 0, n = 0;\n  for (;;) {\n    for (k = m;; k++) {\n      if (a[k] == b[0]) {\n        n = 1;\n        break;\n      }\n      if (a[k] == '\\0') {\n        n = 2;\n        break;\n      }\n    }\n    if (n == 2)\n      break;\n    else {\n      m = k + 1;\n      for (l = 1;; l++) {\n        if (b[l] == '\\0') {\n          n = 3;\n          break;\n        }\n        if (a[k + l] != b[l]) {\n          n = 4;\n          break;\n        }\n      }\n      if (n == 3)\n        break;\n    }\n  }\n\n  if (n == 2)\n    printf(\"%s\", a);\n  else {\n    for (i = 0;; i++) {\n      a[k + i] = a[k + i + strlen(b)];\n      if (a[k + i + strlen(b)] == '\\0')\n        break;\n    }\n    for (i = strlen(c); i > 0; i--) {\n      int x = strlen(a);\n      for (l = 0; x - l >= k; l++)\n        a[x + 1 - l] = a[x - l];\n\n      a[k] = c[i - 1];\n    }\n\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], w[1000], h[1000];\n  int len_1, len_2, len_3, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  scanf(\"%s\", h);\n  len_1 = strlen(s);\n  len_2 = strlen(w);\n  len_3 = strlen(h);\n  for (j = 0; j < len_1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < len_2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == len_2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < len_3; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + len_3; k < len_1; k++)\n      printf(\"%c\", s[k]);\n    printf(\" \");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12357", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s3[100];\n  char s1[100];\n  char s2[100];\n  int L1, L2, i, j;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  L1 = strlen(s1);\n  L2 = strlen(s2);\n  for (i = 0; i < L1; i++) {\n    if (s1[i] == s2[0] && s1[i + L2 - 1] == s2[L2 - 1]) {\n      for (j = i; j < i + L2; j++) {\n        s1[j] = s3[j - i];\n      }\n      break;\n    }\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char s[100], c[100], a[100];\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> a;\n  k = strlen(s);\n  p = strlen(c);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    for (j = 0; j < p; j++, i++) {\n      if (s[i] != c[j])\n        break;\n    }\n    if (j > p - 1) {\n      for (j = 0; j < p; j++, i++)\n        s[i - p] = a[j];\n      break;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%c\", s[i]);\n}\n"}
{"label": "7", "index": "12359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  int x;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  x = strstr(string, substring) - &string[0];\n  if (strchr(string, substring[0]) != 0) {\n    memmove(string + x, replacement, strlen(replacement));\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], rep[300], sub[300];\n  scanf(\"%s %s %s \", s, sub, rep);\n  if (strstr(s, sub)) {\n    char *t = strstr(s, sub);\n    *t = '\\0';\n    cout << s << rep << (t + strlen(sub)) << \"\\n\";\n  } else {\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char b[256];\n  int i, j, x = 0, m, n, y = 0, p;\n  char c;\n  scanf(\"%s \", s);\n  cin >> a;\n  scanf(\"%s\", b);\n  n = strlen(b);\n  p = strlen(s);\n  for (i = 0; i <= p - n; i++) {\n    c = s[i];\n    if (c == a[0]) {\n      for (j = 0; j < n; j++) {\n        if (a[j] != s[i + j]) {\n          x = 1;\n        } else\n          x = 0;\n      }\n      if (x == 0) {\n        m = i;\n        y = 1;\n        break;\n      }\n    }\n  }\n  if (y == 1) {\n    for (i = m, j = 0; i < m + n; i++, j++) {\n      s[i] = b[j];\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12362", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sta[256];\n  char stb[256];\n  char res[512] = \"\";\n\n  cin >> str;\n\n  cin >> sta;\n\n  cin >> stb;\n\n  char *a = str;\n  char *b = 0;\n\n  if (b = strstr(a, sta)) {\n    strncat(res, a, b - a);\n    strcat(res, stb);\n    a = b + strlen(sta);\n  }\n\n  strcat(res, a);\n\n  printf(\"%s \", res);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char st[300], sub[300], re[300], c[300], sz[300];\n  int i, j, k, t, u;\n  scanf(\"%s%s%s\", st, sub, re);\n  for (i = 0; i <= strlen(st) - strlen(sub); i++) {\n    u = 0;\n    k = 0;\n    t = 0;\n    strcpy(sz, st);\n    for (j = i; j <= (i + strlen(sub) - 1); j++) {\n      c[k] = sz[j];\n      k++;\n    }\n    c[k] = '\\0';\n    if (strcmp(c, sub) == 0) {\n      for (j = i; j <= (i + strlen(sub) - 1); j++) {\n        sz[j] = re[t];\n        t++;\n      }\n      printf(\"%s\", sz);\n      u = 1;\n      break;\n    }\n  }\n  if (u == 0) {\n    printf(\"%s\", st);\n  }\n}\n"}
{"label": "7", "index": "12364", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char m[600], z[256], t[256];\n  cin >> m >> z >> t;\n  int len1 = strlen(m);\n  int len2 = strlen(z);\n  int i, j, c = 1, flag = 0;\n  for (i = 0; i < len1; i++) {\n    int k = 0;\n    if (m[i] == z[k]) {\n      j = i;\n      for (k = 1; k < len2; k++) {\n        if (m[i + 1] == z[k]) {\n          i++;\n          c++;\n        } else {\n          break;\n        }\n      }\n    }\n    if (c == len2) {\n      break;\n    }\n  }\n  if (c == len2) {\n    for (i = 0; i < j; i++) {\n      printf(\"%c\", m[i]);\n    }\n    printf(\"%s\", t);\n    for (i = j + len2; i < len1; i++) {\n      printf(\"%c\", m[i]);\n    }\n  } else {\n    printf(\"%s\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, m;\n  char zfc[1000], zfc_1[100], zfc_2[100];\n  scanf(\"%s %s %s \", zfc, zfc_1, zfc_2);\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (j == (int)strlen(zfc_1))\n      break;\n    if (zfc[i] == zfc_1[j])\n      j++;\n    else\n      j = 0;\n  }\n  if (j == (int)strlen(zfc_1)) {\n    for (m = 0; m < i - j; m++)\n      printf(\"%c\", zfc[m]);\n    printf(\"%s\", zfc_2);\n    for (m = i; m < (int)strlen(zfc); m++)\n      printf(\"%c\", zfc[m]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j, k, y, x = 0, q = 0;\n  char a[257], b[257], c[257];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j < strlen(a); j++) {\n    if (b[i] == a[j]) {\n      for (k = 0; k < strlen(b); k++) {\n        if (b[i + k] == a[j + k]) {\n          x++;\n        }\n        if (x == strlen(b)) {\n          for (y = 0; y < j; y++) {\n            printf(\"%c\", a[y]);\n          }\n          for (y = 0; y < strlen(c); y++) {\n            printf(\"%c\", c[y]);\n          }\n          for (y = j + strlen(b); y < strlen(a); y++) {\n            printf(\"%c\", a[y]);\n          }\n          q++;\n          break;\n        }\n      }\n    }\n    if (q == 1) {\n      break;\n    }\n    if (j == strlen(a) - 1) {\n      cout << a;\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s\", a, b, c);\n  char *p;\n  p = strstr(a, b);\n  if (p) {\n    int n = strlen(a) - strlen(p);\n    int i;\n    int k = strlen(b);\n    int l = strlen(c);\n    int m = 0;\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = n; i < n + l; i++) {\n      printf(\"%c\", c[m]);\n      m++;\n    }\n    for (i = n + k; i < (strlen(a)); i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, length2, length1;\n  char str[300], sub[300], rep[300];\n\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  length1 = strlen(str);\n  length2 = strlen(sub);\n  for (i = 0; i < length1; i++) {\n    for (j = 0; j < length2; j++) {\n      if (sub[j] != str[i + j])\n        break;\n    }\n    if (j == length2) {\n      for (j = 0; j < length2; j++)\n        str[i + j] = rep[j];\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, e;\n  char s[256];\n  char b[256];\n  char a[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int c;\n  i = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    j = 0;\n    c = 0;\n    e = i;\n    if (s[i] == a[j]) {\n      for (; a[j] != '\u0000'; j++, i++) {\n        if (a[j] != s[i]) {\n          c++;\n        }\n      }\n      if (c == 0) {\n        for (j = 0; a[j] != '\u0000'; j++, e++) {\n          s[e] = b[j];\n        }\n        break;\n      }\n    }\n    i = e;\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int n, m, i, j, p;\n  scanf(\"%s\\n%s\\n%s\", s, a, b);\n  n = strlen(s);\n  m = strlen(a);\n\n  for (i = 0, j = 0; i < m, j < n; j++) {\n    if (a[i] == s[j]) {\n      p = j;\n      i++;\n      if (i == m)\n        break;\n    } else\n      i = 0;\n  }\n\n  if (i == m)\n    for (i = 0; i < m; i++)\n      s[p - m + 1 + i] = b[i];\n\n  printf(\"%s\\n\", s);\n}\n"}
{"label": "7", "index": "12371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256] = {' '}, sstr[256] = {' '}, rpl[256] = {' '};\n  int lstr, lsstr;\n  scanf(\"%s%s%s\", str, sstr, rpl);\n  lstr = strlen(str);\n  lsstr = strlen(sstr);\n  int pst, curr, indi = 0;\n  for (pst = 0; pst <= lstr - lsstr; pst++) {\n    int state = 1;\n    for (curr = 0; curr < lsstr; curr++) {\n      if (sstr[curr] != str[curr + pst]) {\n        state = 0;\n        break;\n      }\n    }\n    if (state == 1) {\n      indi = 1;\n      break;\n    }\n  }\n  if (indi == 0)\n    printf(\"%s\", str);\n  else {\n    for (curr = 0; curr < pst; curr++) {\n      printf(\"%c\", str[curr]);\n    }\n    for (curr = 0; curr < lsstr; curr++) {\n      printf(\"%c\", rpl[curr]);\n    }\n    for (curr = pst + lsstr; curr < lstr; curr++) {\n      printf(\"%c\", str[curr]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[280], b[280], c[280];\n  char res[280];\n  char t[280];\n  int i, j;\n  int check = 0;\n  scanf(\"%s %s %s\", a, b, c);\n\n  for (i = 0; i < strlen(a); i++) {\n    if (check == 1)\n      break;\n    if (b[0] == a[i]) {\n      for (j = 0; j < 280; j++)\n        t[j] = '\\0';\n      for (j = 0; j < 280; j++)\n        res[j] = '\\0';\n      for (j = i; j < i + strlen(b); j++)\n        t[j - i] = a[j];\n      if (strcmp(b, t) == 0) {\n        check = 1;\n        for (j = 0; j < i; j++) {\n          res[j] = a[j];\n        }\n        for (j = i; j < strlen(c) + i; j++)\n          res[j] = c[j - i];\n        for (j = strlen(c) + i; j < strlen(a) + strlen(c) - strlen(b); j++)\n          res[j] = a[j + strlen(b) - strlen(c)];\n      }\n    }\n  }\n  if (check == 1)\n    printf(\"%s\\n\", res);\n  else\n    printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  char zfc[2][256] = {0};\n  int a = strlen(str);\n  int b = strlen(sub);\n  int i;\n  for (i = 0; i <= (a - b); i++) {\n    int j;\n    for (j = i; j < i + b; j++) {\n      if (str[j] != sub[j - i]) {\n        break;\n      }\n    }\n    if (j == i + b) {\n      for (int m = 0; m < i; m++) {\n        zfc[0][m] = str[m];\n      }\n      for (int n = i + b; n < a; n++) {\n        zfc[1][n - i - b] = str[n];\n      }\n      strcat(zfc[0], rep);\n      strcat(zfc[0], zfc[1]);\n      cout << zfc[0] << \"\\n\";\n      break;\n    }\n  }\n  if (i == (a - b + 1)) {\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12374", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int la, lb, lc, i, j, p = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    if (b[0] == a[i]) {\n      for (j = 1; j < lb; j++) {\n        if (b[j] == a[i + j])\n          p = 0;\n        else\n          p = 1;\n      }\n      if (p == 0) {\n        for (j = 0; j < lc; j++)\n          a[i + j] = c[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int lenth = 0;\n  int judge = 0;\n  for (int i = 0; substring[i] != '\\0'; i++) {\n    lenth++;\n  }\n  for (int i = 0; i < 256; i++) {\n    if (string[i] == substring[0]) {\n      int count;\n      for (count = 0; substring[count] != '\\0'; count++) {\n        if (string[i + count] != substring[count]) {\n          break;\n        }\n      }\n      if (count == lenth) {\n        for (int j = 0; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        printf(\"%s\", replacement);\n        for (int j = i + lenth; string[j] != '\\0'; j++) {\n          cout << string[j];\n        }\n        judge = 1;\n        break;\n      }\n    }\n  }\n  if (judge == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char string[256], subString[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  cin >> string >> subString >> replacement;\n  int mainlen = strlen(string), sublen = strlen(subString);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, subString)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12377", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, la, lb, lc, aaa;\n  char a[256], b[256], c[256];\n  cin >> a;\n  scanf(\"%s \", b);\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  aaa = 0;\n  for (i = 0; i <= la - 1; i++) {\n\n    for (j = 0; (j <= lb - 1) && (i + j <= la - 1); j++) {\n      if (a[i + j] == b[j]) {\n        if (j == lb - 1) {\n          aaa = 1;\n        }\n      } else {\n        break;\n      }\n    }\n    if (aaa == 1) {\n      break;\n    }\n  }\n  if (aaa == 1) {\n    for (j = 0; j <= lc - 1; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12378", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], sub[300], re[300];\n  int lenstr, lensub;\n  int i, j, k;\n\n  scanf(\"%s\", str);\n  scanf(\"%s \", sub);\n  scanf(\"%s\", re);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == sub[0]) {\n      for (j = i, k = 0; k < lensub; j++, k++)\n        if (str[j] != sub[k])\n          break;\n      if (k == lensub) {\n        for (j = i, k = 0; k < lensub; j++, k++)\n          str[j] = re[k];\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12379", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[250], substring[250], replacestring[200];\n  cin >> string >> substring >> replacestring;\n  int place = 0, i, j, flag = 1;\n  for (i = 0; string[i] != '\\0' && flag == 1; i++) {\n    if (string[i] != substring[0])\n      continue;\n    else {\n      place = i;\n      for (j = 0; substring[j] != '\\0'; j++) {\n        if (string[i++] != substring[j])\n          break;\n      }\n      if (substring[j] != '\\0')\n        place = 0;\n      else\n        flag = 0;\n    }\n  }\n  if (place) {\n    int l1 = strlen(substring), l2 = strlen(replacestring);\n    for (i = 0; string[i + place + l1] != '\\0'; i++)\n      replacestring[l2 + i] = string[place + l1 + i];\n    replacestring[l2 + i] = '\\0';\n    string[place] = '\\0';\n    printf(\"%s%s\\n\", string, replacestring);\n  } else\n    cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sr[1000];\n\n  cin >> sr;\n  char a[1000], b[1000];\n  scanf(\"%s%s\", a, b);\n  int len, ken;\n  len = strlen(sr);\n  ken = strlen(a);\n  int i, j, k, m;\n  m = 0;\n\n  for (i = 0; i < len; i++) {\n    if (sr[i] == a[0]) {\n      j = i;\n      for (k = 0; k < ken; k++)\n        if (sr[k + j] == a[k])\n          m = 1;\n        else if (sr[k + j] != a[k]) {\n          m = 0;\n          break;\n        }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0) {\n    cout << sr;\n  }\n  char c[1000], d[1000];\n  if (m == 1) {\n    for (i = 0; i < j; i++) {\n      c[i] = sr[i];\n    }\n    c[j] = '\u0000';\n    if (j + ken == len) {\n      cout << c << b;\n    }\n    if (j + ken < len) {\n      for (i = j + ken; i < len; i++) {\n        d[i - j - ken] = sr[i];\n      }\n      d[len - j - ken] = '\u0000';\n      printf(\"%s%s%s\", c, b, d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int d[1000];\n  int i, j = 0, k, m, n;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == '\u0000')\n      break;\n    else {\n      if (a[i] == b[0]) {\n        j++;\n        d[j] = i;\n      }\n    }\n  }\n  if (j == 0)\n    printf(\"%s\", a);\n  else {\n    m = j;\n    for (i = 0;; i++) {\n      if (b[i] == '\u0000') {\n        break;\n      }\n    }\n    n = i;\n    for (j = 0; j < m; j++) {\n      k = d[j];\n      for (i = 0; i < n; i++) {\n        if (b[i] != a[i + k])\n          break;\n      }\n      if (i == n)\n        break;\n    }\n    for (i = 0; i < n; i++)\n      a[i + d[j]] = c[i];\n\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[257], b[257], r[257];\n  scanf(\"%s\", b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", r);\n  int c, d, count, e;\n  int j, h, y;\n  c = strlen(a);\n  d = strlen(b);\n  e = strlen(r);\n\n  for (j = 0; j < d; j++) {\n    y = 0;\n    h = j;\n    if (b[j] != a[0])\n      continue;\n    else {\n      count = 1;\n      for (int t = 1; t < c; t++) {\n\n        if (a[t] == b[j + t])\n          count++;\n      }\n    }\n    if (count == c) {\n      y = 1;\n      break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (y == 1) {\n\n    for (j = 0; j < h; j++)\n      printf(\"%c\", b[j]);\n    for (j = 0; j < e; j++)\n      printf(\"%c\", r[j]);\n    for (j = h + c; j < d; j++)\n      printf(\"%c\", b[j]);\n  } else\n    printf(\"%s\", b);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL, *q = NULL;\n  char str[100], substr[100], restr[100];\n  scanf(\"%s %s %s \", str, substr, restr);\n  p = strstr(str, substr);\n  if (p != NULL) {\n    q = p + strlen(substr);\n    strcat(restr, q);\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int q, w, e;\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  int i, j, k;\n  int result = 1, d;\n  for (k = 0; k < q; k++) {\n    if (a[k] == b[0]) {\n      result = 1;\n      for (i = k, j = 0; i < w + k, j < w; i++, j++) {\n        d = a[i] - b[j];\n        if (d != 0)\n          result = 0;\n      }\n      if (result) {\n        for (i = k, j = 0; j < e, i < w + k; i++, j++) {\n          a[i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12385", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin.getline(str, 256);\n  cin.getline(sub, 256);\n  cin.getline(rep, 256);\n  int i, j, len1, len2;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i <= len1 - len2; i++) {\n    j = 0;\n    while (str[i + j] == sub[j] && j < len2)\n      j++;\n    if (j == len2) {\n      while (j > 0) {\n        j--;\n        str[i + j] = rep[j];\n      }\n      break;\n    }\n  }\n  cout << str << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], replace[256];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> replace;\n\n  int ls = strlen(s);\n  int lsub = strlen(sub);\n  char sr[256];\n  int i, j;\n  int same;\n  for (i = 0; i < ls; i++) {\n    for (j = 0; j < lsub; j++) {\n      sr[j] = s[i + j];\n    }\n    sr[j] = '\u0000';\n    same = strcmp(sr, sub);\n    if (same == 0) {\n      printf(\"%s\", replace);\n      i = i + lsub;\n      printf(\"%s\", &s[i]);\n      break;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[3][257];\n  int i;\n  int l1, l2, l3, re;\n  for (i = 0; i < 3; i++)\n    cin >> a[i];\n  l1 = strlen(a[0]);\n  l2 = strlen(a[1]);\n  l3 = strlen(a[2]);\n  int j, k, z = 0, num = 0, x = 0, count = 0;\n  for (j = 0; j < l1; j++) {\n    if (a[0][j] == a[1][0]) {\n      z = j + 1;\n      for (k = 1; k < l2; k++) {\n        if (a[0][z] == a[1][k])\n          num++;\n        else\n          break;\n        z++;\n      }\n      if (num == l2 - 1) {\n        re = 1;\n        count = j;\n      } else\n        continue;\n    } else if (re == 1)\n      break;\n    else\n      continue;\n  }\n  if (re == 1) {\n    for (i = count; i < l2 + count; i++) {\n      a[0][i] = a[2][x];\n      x++;\n    }\n    printf(\"%s\", a[0]);\n  } else\n    cout << a[0];\n  return 0;\n}\n"}
{"label": "7", "index": "12388", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n = 0;\n  char t[260], s[260], w[260];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  for (i = 0; i < strlen(w); i++) {\n    k = 1;\n    for (j = 0; j < strlen(s); j++)\n      if (s[j] != w[i + j])\n        k = 0;\n    if (k) {\n      n = i;\n      break;\n    }\n  }\n  if (n) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", w[i]);\n    printf(\"%s\", t);\n    for (i = n + strlen(s); i < strlen(w); i++)\n      printf(\"%c\", w[i]);\n  } else\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12389", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], copy[101], before[101], after[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i = 0, j;\n  for (i; i <= (int)(strlen(s) - strlen(a)); i++) {\n    for (j = 0; j < (int)(strlen(a)); j++)\n      copy[j] = s[i + j];\n\n    copy[j] = '\u0000';\n    if (strcmp(copy, a) == 0) {\n      for (j = 0; j < i; j++) {\n        before[j] = s[j];\n      }\n      before[j] = '\u0000';\n      for (j = i + (int)strlen(a); j < (int)(strlen(s)); j++) {\n        after[j - i - (int)strlen(a)] = s[j];\n      }\n\n      after[j - i - (int)strlen(a)] = '\u0000';\n      strcat(before, b);\n      strcat(before, after);\n      strcpy(s, before);\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len1, len2, len3, j, m = 0, l;\n  char zifu[256], chazhao[256], tihuan[256];\n  scanf(\"%s%s%s\", zifu, chazhao, tihuan);\n  len1 = strlen(zifu);\n  len2 = strlen(chazhao);\n  len3 = strlen(tihuan);\n  for (i = 0; i < len1; i++) {\n    m = 0;\n    if (zifu[i] == chazhao[0]) {\n      for (j = 0; j < len2; j++) {\n        if (zifu[i + j] == chazhao[j])\n          m++;\n        if (zifu[i + j] != chazhao[j])\n          break;\n      }\n    }\n    if (m == len2)\n      break;\n  }\n\n  if (i < len1) {\n    if (len2 == len3) {\n      for (l = 0; l < len2; l++)\n        zifu[i + l] = tihuan[l];\n    } else if (len2 > len3) {\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n    } else if (len2 < len3) {\n      for (l = i + len2; l < len1 + 1; l++)\n        zifu[l + len3 - len2] = zifu[l];\n      for (l = 0; l < len3; l++)\n        zifu[i + l] = tihuan[l];\n    }\n  }\n\n  cout << zifu << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12391", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, r = 0, m = 0;\n  int lens, lena;\n  char s[256], a[100], b[100], c[100], d[100];\n  cin >> s >> a >> b;\n  lens = strlen(s);\n  lena = strlen(a);\n  for (i = 0; i < lens; i++) {\n    m = 0;\n    for (k = i; k < i + lena; k++) {\n      if (a[k - i] != s[k])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++)\n        c[n] = s[n];\n      c[n] = '\\0';\n      for (j = i + lena; j < lens; j++)\n        d[j - i - lena] = s[j];\n      d[j - i - lena] = '\\0';\n      r = 1;\n      printf(\"%s%s%s\", c, b, d);\n      break;\n    }\n  }\n  if (r == 0)\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[257 * 2], a[257], b[257];\n  cin >> s1;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, j, k, st, end;\n  st = 0;\n  end = 0;\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == a[0]) {\n      for (k = i + 1, j = 1; s1[k] != 0 && a[j] != 0; k++, j++) {\n        if (s1[k] != a[j])\n          break;\n      }\n      if (a[j] == 0) {\n        st = i;\n        end = k;\n        break;\n      }\n    }\n  }\n  if (st < end) {\n    if (strlen(a) > strlen(b)) {\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n      for (k = end; s1[k] != 0; k++, i++) {\n        s1[i] = s1[k];\n      }\n      s1[i] = 0;\n    } else {\n      i = strlen(s1) + strlen(b) - strlen(a);\n      for (k = strlen(s1); k >= end; k--, i--) {\n        s1[i] = s1[k];\n      }\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], b[50], r[50], a[50];\n  int i, k, n1, n2, n3, n, result;\n  scanf(\"%s%s%s\", s, b, r);\n  n1 = strlen(s);\n  n2 = strlen(b);\n  n3 = strlen(r);\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    for (k = 0; k < n2; k++) {\n      a[k] = s[i + k];\n    }\n    a[n2] = '\\0';\n    result = strcmp(a, b);\n    if (result == 0) {\n      n = i;\n      break;\n    } else\n      continue;\n  }\n  for (i = 0; i < n1; i++) {\n    if (i == n) {\n      printf(\"%s\", r);\n      i = i + n2 - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], w[100], p[100], t[100];\n  int i, j, flag = 1;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (i = 0; i < strlen(w); i++) {\n    for (j = 0; j < strlen(s); j++)\n      p[j] = w[i + j];\n\n    flag = 1;\n    for (j = 0; j < strlen(s); j++) {\n      if (p[j] != s[j])\n        flag = 0;\n    }\n    if (flag != 0) {\n      for (j = 0; j < strlen(s); j++) {\n        w[i + j] = t[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n}\n"}
{"label": "7", "index": "12395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, n, m, d = 0;\n  int e = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      if (a[i + 1] == b[1]) {\n        if (a[i + 2] == b[2]) {\n          d = i;\n          break;\n        }\n      }\n    }\n  }\n\n  m = strlen(c);\n  if (d != 0) {\n\n    for (i = d; i < d + m; i++) {\n\n      a[i] = c[e];\n      e++;\n    }\n  }\n  puts(a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  char *p;\n  int i, len2;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  len2 = strlen(b);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; a + i != p; i++)\n      cout << a[i];\n    cout << c;\n    if (*(p + len2) != '\\0') {\n      for (i = 0; *(p + len2 + i) != '\\0'; i++)\n        cout << *(p + i + len2);\n    }\n  } else\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s = (char *)malloc(256), *s1 = (char *)malloc(256),\n       *s2 = (char *)malloc(256);\n  int i, j, k, m = 0;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = i, k = 0;\n         (*(s + j) != '\u0000') && (*(s1 + k) != '\u0000') && (*(s + j) == *(s1 + k));\n         j++, k++)\n      ;\n    if (k == strlen(s1)) {\n      for (j = i, k = j + strlen(s1); k < strlen(s); k++, j++)\n        *(s + j) = *(s + k);\n      *(s + j + strlen(s2)) = '\u0000';\n      for (j = --j + strlen(s2), k = j - strlen(s2); k >= i; j--, k--)\n        *(s + j) = *(s + k);\n      for (j = i, k = 0; *(s2 + k) != '\u0000'; j++, k++)\n        *(s + j) = *(s2 + k);\n      m = m + 1;\n    }\n    if (m != 0)\n      break;\n  }\n  puts(s);\n}\n"}
{"label": "7", "index": "12398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t = 0;\n  char str[260], sub[20], rep[20];\n  scanf(\"%s%s%s\", str, sub, rep);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = i + 1; j < i + strlen(sub); j++) {\n        if (str[j] != sub[j - i]) {\n          t = 1;\n        }\n      }\n      if (t == 0) {\n        for (int k = i; k < i + strlen(sub); k++) {\n          str[k] = rep[k - i];\n        }\n        break;\n      }\n    }\n\n    t = 0;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12399", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000], h;\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s\", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      h = replace[j];\n\n      mubiao[i] = h;\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sta[256];\n  char stb[256];\n  char res[512] = \"\";\n\n  cin >> str;\n\n  scanf(\"%s \", sta);\n\n  cin >> stb;\n\n  char *a = str;\n  char *b = 0;\n\n  if (b = strstr(a, sta)) {\n    strncat(res, a, b - a);\n    strcat(res, stb);\n    a = b + strlen(sta);\n  }\n\n  strcat(res, a);\n\n  printf(\"%s \", res);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0}, c[100] = {0};\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int lb, la;\n  lb = strlen(b);\n  la = strlen(a);\n  int count = 0;\n\n  for (int i = 0; i <= la - lb; i++) {\n    count = 0;\n    for (int j = 0; j < lb; j++) {\n      if (a[i + j] != b[j]) {\n        count = 1;\n        break;\n      }\n    }\n    \n    \n    if (count == 0) {\n      a[i] = 1;\n      for (int j = 1; j < lb; j++)\n        a[i + j] = 2;\n      break;\n    }\n  }\n  for (int i = 0; i < la; i++) {\n    if (a[i] == 1)\n      printf(\"%s\", c);\n    if (a[i] == 2)\n      ;\n    if (a[i] != 2 && a[i] != 1)\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "12402", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], sz[256];\n  cin >> str >> sub >> rep;\n  int a, b, c, tag;\n  a = strlen(sub);\n  c = strlen(str);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    tag = 0;\n    if (str[i] == sub[0]) {\n      for (j = 0; j < a; j++) {\n        sz[j] = str[i + j];\n      }\n      sz[a] = '\\0';\n    }\n    if (strcmp(sz, sub) == 0) {\n      b = i;\n      strcpy(sub, rep);\n      tag = 1;\n      break;\n    }\n  }\n  if (tag == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", sub);\n    for (i = b + a; i < c; i++) {\n      printf(\"%c\", str[i]);\n    }\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[206], re[256];\n  int i, j, n, m;\n  scanf(\"%s\", s);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  n = strlen(sub);\n  m = strlen(s);\n  for (i = 0; i < m - n + 1; i++) {\n    if (s[i] == sub[0])\n      for (j = 0; j < n; j++) {\n        if (s[i + j] != sub[j])\n          break;\n      }\n    if (j == n) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", s[j]);\n      printf(\"%s\", re);\n      for (j = i + n; j < m; j++)\n        printf(\"%c\", s[j]);\n      break;\n    }\n  }\n  if (i == (1 + m - n))\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], ci[256][256];\n  int ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int i, j;\n  for (i = 0; i <= ls - la; i++) {\n    for (j = 0; j < la; j++) {\n      ci[i][j] = s[i + j];\n    }\n    ci[i][la] = '\u0000';\n  }\n  for (i = 0; i <= ls - la; i++) {\n    if (strcmp(ci[i], a) == 0) {\n      strcpy(ci[i], b);\n      break;\n    }\n  }\n  if (i != ls - la + 1) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[i]);\n    if (i != ls - la) {\n      for (j = i + la; j < ls - la; j++) {\n        printf(\"%c\", ci[j][0]);\n      }\n      printf(\"%s\", ci[ls - la]);\n    }\n  } else {\n    for (j = 0; j < ls - la; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[ls - la]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12405", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, L, l1, l2;\n  char s[1000], a[300], b[300];\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n    getchar();\n  }\n  for (k = i + l1; i != L && k < L; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, l, i, j, x = 0;\n  char s[256], a[256], b[256], p[256];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  k = (int)strlen(s);\n  l = (int)strlen(a);\n  for (i = 0; i < k - l + 1; i++) {\n    for (j = 0; j < l; j++) {\n      p[j] = s[j + i];\n    }\n    p[j] = '\u0000';\n    if (strcmp(p, a) == 0) {\n      x = i;\n      break;\n    }\n  }\n  if (x == 0) {\n    cout << s;\n  } else {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = x + l; i < k; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], d[300], r[300];\n  int i = 0, j, k, ls, lr, ld;\n  int flag = 0;\n  int cont = 0;\n  cin >> s;\n  cin >> d;\n  cin >> r;\n  ls = strlen(s);\n  ld = strlen(d);\n  lr = strlen(r);\n  for (i = 0; i < ls;) {\n    flag = 0;\n    for (j = 0; j < ld; j++) {\n      if (s[i + j] == d[j])\n        flag++;\n      if (flag == ld)\n        cont++;\n    }\n\n    if (flag == ld && cont == 1) {\n      cont++;\n      for (k = 0; k < lr; k++)\n        s[i + k] = r[k];\n\n      i = i + lr;\n      continue;\n    } else {\n      i++;\n      continue;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12408", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n\n  char string[256], sub[256], re[256];\n\n  int i, j;\n\n  cin >> string;\n\n  cin >> sub;\n\n  cin >> re;\n\n  int len1 = strlen(string), len2 = strlen(sub);\n\n  for (i = 0; i <= len1 - len2; i++)\n\n  {\n\n    for (j = 0; j < len2; j++)\n\n    {\n\n      if (sub[j] != string[i + j])\n        break;\n    }\n\n    if (j != len2)\n      continue;\n\n    if (j == len2)\n\n    {\n\n      for (j = 0; j < len2; j++)\n        string[i + j] = re[j];\n\n      break;\n    }\n  }\n\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k = 0, l, m0, m1, a[100], flag = 0;\n  char str[3][300];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m0 = strlen(str[0]);\n  m1 = strlen(str[1]);\n  for (i = 0, j = 0; i < m0, j < m1; i++) {\n    if (str[0][i] == str[1][j]) {\n      j++;\n      flag++;\n      if (flag == m1) {\n        k = i - m1;\n        break;\n      }\n    } else {\n      j = 0;\n      flag = 0;\n    }\n  }\n  if (flag == m1) {\n    for (i = k + 1, j = 0; i < k + m1 + 1; i++, j++)\n      str[0][i] = str[2][j];\n    printf(\"%s\", str[0]);\n  } else\n    printf(\"%s\", str[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "12410", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint bd(char *hed, char *zi, int m) {\n  int val = 0, j;\n  char *t1, *t2;\n  for (t1 = hed, t2 = zi, j = 0; j < m; t1++, t2++, j++) {\n    if (*t1 == *t2)\n      val = 1;\n    else {\n      val = 0;\n      break;\n    }\n  }\n  return (val);\n}\nint main() {\n  char *yuan, *zi, *rep, *med;\n  yuan = (char *)malloc(260 * sizeof(char));\n  zi = (char *)malloc(260 * sizeof(char));\n  rep = (char *)malloc(260 * sizeof(char));\n  med = (char *)malloc(260 * sizeof(char));\n\n  cin >> yuan;\n\n  cin >> zi;\n\n  cin >> rep;\n\n  char *p;\n  int n, m, zhi = 0, t;\n\n  for (p = yuan, n = 0; *p != '\u0000'; p++, n++)\n    ;\n  for (p = zi, m = 0; *p != '\u0000'; p++)\n    m++;\n  for (p = rep, t = 0; *p != '\u0000'; p++)\n    t++;\n\n  \n\n  \n  for (p = yuan; p < yuan + n - m + 1; p++)\n    if (bd(p, zi, m) == 1) {\n      zhi = 1;\n      break;\n    }\n\n  if (zhi == 1) {\n    strcpy(med, p + m);\n    strcpy(p, rep);\n    strcpy(p + t, med);\n  }\n  puts(yuan);\n}\n"}
{"label": "7", "index": "12411", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, a1, b1, c1, n = 0, m, t, j, p = 0;\n  cin >> a >> b >> c;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i < a1; i++) {\n    for (j = 0; j < b1; j++) {\n      if (a[i + j] == b[j])\n        p = p + 1;\n    }\n    if (p == b1) {\n      for (m = 0; m < i; m++)\n        printf(\"%c\", a[m]);\n      printf(\"%s\", c);\n      for (m = b1 + i; m < a1; m++)\n        printf(\"%c\", a[m]);\n      n = 9;\n      break;\n    }\n    p = 0;\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12412", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar zfc1[100], zfc2[100], zfc3[100];\nint main() {\n  int len1, len2, i, j, k = 1, g = 0;\n\n  cin >> zfc1;\n\n  cin >> zfc2;\n\n  scanf(\"%s \", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i < len1; i++) {\n    if (zfc2[0] == zfc1[i]) {\n      for (j = 1; j < len2; j++) {\n        if (zfc2[j] == zfc1[i + j])\n          k++;\n      }\n    }\n    if (k == len2) {\n      g++;\n      break;\n    } else\n      k = 1;\n  }\n  if (g == 0)\n    puts(zfc1);\n  else {\n    zfc1[i] = 0;\n    printf(\"%s%s%s\", zfc1, zfc3, &zfc1[i + len2]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[600], subStr[260], rep[260];\n  memset(str, 0, sizeof(str));\n  scanf(\"%s%s%s\", str, subStr, rep);\n  char *pos = strstr(str, subStr);\n  if (pos != NULL) {\n    int len = strlen(rep);\n    for (int i = 0; i < len; i++) {\n      *pos++ = rep[i];\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int x = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int sl = strlen(s);\n  int al = strlen(a);\n  int bl = strlen(b);\n  for (int i = 0; i < sl; i++) {\n    if ((a[0] == s[i] && a[al - 2] == s[i + al - 2]) && x == 0) {\n      for (int w = 0; w < bl; w++)\n        printf(\"%c\", b[w]);\n\n      i += al - 1;\n      x = 1;\n\n    }\n\n    else {\n\n      cout << s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12415", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[255], sub[255], rep[255], s[255];\n\n  cin >> str;\n\n  cin >> sub;\n\n  scanf(\"%s \", rep);\n  int len1 = strlen(str), len2 = strlen(sub), x = 0;\n  int i, j, n;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    n = 0;\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j])\n        break;\n      else\n        n++;\n    }\n    if (n == len2) {\n      int m = 0;\n      while (i + j + m < len1) {\n        s[m] = str[i + j + m];\n        m++;\n      }\n      s[m] = '\u0000';\n      str[i] = '\u0000';\n      strcat(str, rep);\n      strcat(str, s);\n      puts(str);\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0)\n    puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint search(char a[], char b[]) {\n  int la = strlen(a), lb = strlen(b), i, j;\n  for (i = 0; i <= lb - la; i++) {\n    for (j = 0; j < la; j++)\n      if (a[j] != b[i + j])\n        break;\n    if (j == la)\n      return i;\n  }\n  return 999;\n}\nint main() {\n  char s[300], a[300], b[300];\n  int m, i;\n  cin >> s >> a >> b;\n  m = search(a, s);\n  if (m == 999) {\n    printf(\"%s\\n\", s);\n    getchar();\n    getchar();\n    return 0;\n  }\n  for (i = 0; i < m; i++)\n    cout << s[i];\n  printf(\"%s\", b);\n  for (i += strlen(a); i < strlen(s); i++)\n    printf(\"%c\", s[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12417", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[300], b[300], replace[300];\n  cin >> a >> b >> replace;\n  char *p;\n  int alen, blen, relen, i;\n  p = strstr(a, b);\n  if (p == NULL)\n    cout << a << endl;\n  else {\n    alen = strlen(a);\n    blen = strlen(b);\n    relen = strlen(replace);\n    for (i = 0; &a[i] != p; i++)\n      cout << a[i];\n    cout << replace;\n    i += blen;\n    for (; i < alen - blen + relen; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(int i, char a[], char b[]) {\n  int k;\n  for (k = 0; b[k] != '\u0000'; i++, k++) {\n    if (a[i] != b[k])\n      break;\n  }\n  if (b[k] == '\u0000')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, n, k;\n  char s[256], subs[256], re[256];\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> re;\n  for (i = 0, n = 0; n == 0 && s[i] != '\u0000'; i++) {\n    if (s[i] == subs[0])\n      n = cmp(i, s, subs);\n  }\n  if (n == 1) {\n    for (i = i - 1, k = 0; re[k] != '\u0000'; i++, k++) {\n      s[i] = re[k];\n    }\n  }\n  printf(\"%s \", s);\n}\n"}
{"label": "7", "index": "12419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dingwei(char duan[50], char chang[50]) {\n  int i, geshu1 = 0, geshu2 = 0;\n  for (i = 0; duan[i] != '\\0'; i++) {\n    geshu1 += 1;\n  }\n  for (i = 0; chang[i] != '\\0'; i++) {\n    geshu2 += 1;\n  }\n  int j, cishu = 0, weizhi = 0;\n  for (i = 0; i <= (geshu2 - geshu1); i++) {\n    for (j = 0; j < geshu1; j++) {\n      if (duan[j] == chang[i]) {\n        cishu++;\n        i++;\n      } else {\n        break;\n      }\n    }\n    if (cishu == geshu1) {\n      weizhi = i - geshu1;\n      break;\n    } else {\n      cishu = 0;\n      continue;\n    }\n  }\n  if (cishu == 0) {\n    return -1;\n  } else {\n    return weizhi;\n  }\n}\nint main() {\n  char zfc[300], beiti[256], ti[256];\n  scanf(\"%s%s%s\", zfc, beiti, ti);\n  int lenzfc, lenbt, lent, weizhi, i;\n  lenzfc = strlen(zfc);\n  lenbt = strlen(beiti);\n  lent = strlen(ti);\n  weizhi = dingwei(beiti, zfc);\n  if (weizhi < 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    if (lenbt == lent) {\n      for (i = 0; i < lenbt; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n\n    } else if (lenbt > lent) {\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      for (i = 0; i < (lenzfc - lenbt - weizhi); i++) {\n        zfc[weizhi + lent + i] = zfc[weizhi + lenbt + i];\n      }\n      zfc[lenzfc - lenbt + lent] = '\\0';\n    } else if (lenbt < lent) {\n      for (i = lenzfc - 1; i >= weizhi + lenbt; i--) {\n        zfc[i + lent - lenbt] = zfc[i];\n      }\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      zfc[lenzfc + lent - lenbt] = '\\0';\n    }\n    printf(\"%s\\n\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12420", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, f, d, k = 0;\n  cin >> a >> b >> c;\n  d = strlen(a);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (a[i] == b[0] && a[i + 1] == b[1] && a[i + 2] == b[2] &&\n        a[i + 3] == b[3]) {\n      for (j = i; j < i + f; j++) {\n        a[j] = c[k];\n        k++;\n      }\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, m, j, tag = 1, jieshu = 1;\n  char zfc[257], dth[257], bth[257], danci[257];\n  int zhyw = 0;\n\n  cin >> zfc;\n\n  cin >> dth;\n\n  cin >> bth;\n  n = strlen(zfc);\n  m = strlen(dth);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == dth[0]) {\n      for (k = 1; k < m; k++) {\n        if (zfc[i + k] != dth[k])\n          tag = 0;\n      }\n      if (tag) {\n        printf(\"%s\", bth);\n        for (j = i + m; j < n; j++)\n          printf(\"%c\", zfc[j]);\n        jieshu = 0;\n      }\n      tag = 1;\n    }\n    if (jieshu) {\n      printf(\"%c\", zfc[i]);\n    }\n    if (jieshu == 0)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], b[50], r[50], a[50];\n  int i, k, n1, n2, n3, n, result;\n  scanf(\"%s%s%s\", s, b, r);\n  n1 = strlen(s);\n  n2 = strlen(b);\n  n3 = strlen(r);\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    for (k = 0; k < n2; k++) {\n      a[k] = s[i + k];\n    }\n    a[n2] = '\\0';\n    result = strcmp(a, b);\n    if (result == 0) {\n      n = i;\n      break;\n    } else\n      continue;\n  }\n  for (i = 0; i < n1; i++) {\n    if (i == n) {\n      printf(\"%s\", r);\n      i = i + n2 - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[260];\n  char b[260];\n  char c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j, length;\n  for (i = 0; i < len1; i++) {\n    length = 0;\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        length = length + 1;\n    }\n    if (length == len2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < len3; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + len3; j < len1; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\" \");\n      break;\n    }\n  }\n  if (length != len2)\n    printf(\"%s \", a);\n}\n"}
{"label": "7", "index": "12424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[256];\n  char zichuan[256];\n  char tihuan[20];\n  char daitihuan[20];\n  int k;\n  int e;\n  int s = 1;\n  int tag = 0;\n\n  scanf(\"%s \", zfc);\n\n  cin >> zichuan;\n\n  cin >> tihuan;\n  int l, m;\n  int i, j;\n  l = strlen(zichuan);\n  m = strlen(zfc);\n  for (i = 0; i < m; i++) {\n    for (j = i; j < i + l; j++) {\n      daitihuan[j - i] = zfc[j];\n    }\n    daitihuan[l] = 0;\n    k = strcmp(daitihuan, zichuan);\n    s *= k;\n    if (k == 0 && tag == 0) {\n      e = i;\n      tag = 1;\n    }\n  }\n  if (s != 0) {\n    printf(\"%s\", zfc);\n  } else if (s == 0) {\n    for (i = 0; i < e; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    printf(\"%s\", tihuan);\n    for (i = e + l; i < m; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12425", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *q1, *q2;\n  int i, j, k, flag;\n  p1 = (char *)malloc(sizeof(char) * 256);\n  p2 = (char *)malloc(sizeof(char) * 256);\n  p3 = (char *)malloc(sizeof(char) * 256);\n  q1 = (char *)malloc(sizeof(char) * 256);\n  q2 = (char *)malloc(sizeof(char) * 256);\n  scanf(\"%s \", p1);\n  cin >> p2;\n  cin >> p3;\n  for (i = 0; i < strlen(p1); i++) {\n    flag = 1;\n    for (j = 0; j < strlen(p2); j++) {\n      if (*(p1 + i + j) != *(p2 + j)) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag) {\n      for (k = 0; k < i; k++)\n        *(q1 + k) = *(p1 + k);\n      *(q1 + k) = '\u0000';\n      for (k = i + strlen(p2); k < strlen(p1); k++)\n        *(q2 + k - i - strlen(p2)) = *(p1 + k);\n      *(q2 + k - i - strlen(p2)) = '\u0000';\n      break;\n    }\n  }\n  if (flag) {\n    strcat(q1, p3);\n    strcat(q1, q2);\n    puts(q1);\n  } else\n    puts(p1);\n  return 0;\n}\n"}
{"label": "7", "index": "12426", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], re[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int bar = 0, min = 0;\n  int len1 = strlen(str), len2 = strlen(sub);\n  for (int i = 0; i < len1;) {\n    bar = 0;\n    if (str[i] == sub[0]) {\n      for (int j = 0; j < len2; j++) {\n        if (str[i + j] != sub[j])\n          bar = 1;\n      }\n      if (bar == 0 && min == 0) {\n        printf(\"%s\", re);\n        i = i + len2;\n        min = 1;\n      } else {\n        printf(\"%c\", str[i]);\n        i = i + 1;\n        bar = 0;\n      }\n    } else {\n      printf(\"%c\", str[i]);\n      i = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12427", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z;\n  char a[256], b[50], c[50];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i <= x - y; i++) {\n    for (j = i; j < i + y; j++) {\n      if (a[j] != b[j - i])\n        break;\n    }\n    if (j == i + y) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < z; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + y; j < x; j++) {\n        printf(\"%c\", a[j]);\n      }\n      break;\n    }\n  }\n  if (i == x - y + 1) {\n    puts(a);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12428", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], copy[101], before[101], after[101];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  int i = 0, j;\n  for (i; i <= (int)(strlen(s) - strlen(a)); i++) {\n    for (j = 0; j < (int)(strlen(a)); j++) {\n      copy[j] = s[i + j];\n    }\n    copy[j] = '\u0000';\n    if (strcmp(copy, a) == 0) {\n      for (j = 0; j < i; j++) {\n        before[j] = s[j];\n      }\n      before[j] = '\u0000';\n      for (j = i + (int)strlen(a); j < (int)(strlen(s)); j++) {\n        after[j - i - (int)strlen(a)] = s[j];\n      }\n      after[j - i - (int)strlen(a)] = '\u0000';\n      strcat(before, b);\n      strcat(before, after);\n      strcpy(s, before);\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12429", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h = 0;\n  char a[100], b[100], c[100];\n  cin >> a >> b >> c;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0]) {\n      h = 0;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[j + i] == b[j]) {\n          h++;\n        }\n      }\n      if (h == strlen(b)) {\n        for (j = 0; j < strlen(c); j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z;\n  char a[256], b[50], c[50];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i <= x - y; i++) {\n    for (j = i; j < i + y; j++) {\n      if (a[j] != b[j - i])\n        break;\n    }\n    if (j == i + y) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < z; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + y; j < x; j++) {\n        printf(\"%c\", a[j]);\n      }\n      break;\n    }\n  }\n  if (i == x - y + 1) {\n    puts(a);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12431", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, len3;\nchar replacement[256];\nvoid answer(char str[260], char substr[256]);\nint main() {\n  char str[260], substr[256];\n  cin.getline(str, 260);\n  cin.getline(substr, 256);\n  cin.getline(replacement, 256);\n  len1 = strlen(str);\n  len2 = strlen(substr);\n  len3 = strlen(replacement);\n  answer(str, substr);\n  return 0;\n}\nvoid answer(char str[260], char substr[256]) {\n  int i, k, count, num = 0;\n  for (i = 0; i < len1; i++) {\n    if (str[i] == substr[0]) {\n      count = 0;\n      for (k = i;; k++) {\n        if ((str[k] == substr[count]) && (str[k] != '\\0'))\n          count++;\n        else\n          break;\n      }\n      if (count == len2) {\n        num++;\n        for (k = 0; k < i; k++)\n          cout << str[k];\n        for (k = 0; k < len3; k++)\n          cout << replacement[k];\n        for (k = i + len2; k < len1; k++)\n          cout << str[k];\n        break;\n      }\n    }\n  }\n  if (num == 0) {\n    for (i = 0; i < len1; i++)\n      printf(\"%c\", str[i]);\n  }\n}\n"}
{"label": "7", "index": "12432", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i, j, k, kk;\nchar s1[305], s2[305];\nchar s3[305];\n\nint main() {\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; i < strlen(s1); i++) {\n    for (j = 0; j < strlen(s2); j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n    }\n    if (j == strlen(s2)) {\n      k = i;\n      kk = 1;\n      break;\n    }\n  }\n  if (kk == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s3);\n    for (i = k + strlen(s2); i < strlen(s1); i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  char zfc[2][256] = {0};\n  int a = strlen(str);\n  int b = strlen(sub);\n  int i;\n  for (i = 0; i <= (a - b); i++) {\n    int j;\n    for (j = i; j < i + b; j++) {\n      if (str[j] != sub[j - i]) {\n        break;\n      }\n    }\n    if (j == i + b) {\n      for (int m = 0; m < i; m++) {\n        zfc[0][m] = str[m];\n      }\n      for (int n = i + b; n < a; n++) {\n        zfc[1][n - i - b] = str[n];\n      }\n      strcat(zfc[0], rep);\n      strcat(zfc[0], zfc[1]);\n      printf(\"%s\\n\", zfc[0]);\n      break;\n    }\n  }\n  if (i == (a - b + 1)) {\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12434", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      zichuan[j] = zfc1[j + i];\n    }\n    if (strcmp(zichuan, zfc2) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc1[k]);\n      }\n      printf(\"%s\", zfc3);\n      for (t = i + len2; zfc1[t] != '\\0'; t++) {\n        printf(\"%c\", zfc1[t]);\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"%s\", zfc1);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12435", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int m, n, i, j, e, k;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    e = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == sub[j])\n        e++;\n    }\n    if (e == m)\n      break;\n  }\n  if (e == m) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", rep);\n    for (k = i + m; k < n; k++)\n      printf(\"%c\", str[k]);\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[266], s[22], z[22];\n\n  cin >> a;\n\n  cin >> s;\n\n  cin >> z;\n  int n, i, j, l = 1, m, w, e;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (s[0] == a[i]) {\n      l = 1;\n      m = i;\n      for (w = 0; s[w] != '\u0000'; w++) {\n        if (s[w] != a[i]) {\n          l = 0;\n        }\n        i++;\n      }\n\n      if (l) {\n        break;\n      }\n    }\n  }\n\n  for (n = 0; s[n] != '\u0000'; n++) {\n    1;\n  }\n  if (l) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (m == 48) {\n        m = 17;\n      }\n      if (j == m) {\n        for (e = 0; z[e] != '\u0000'; e++) {\n          cout << z[e];\n        }\n        j = m + n - 1;\n      } else {\n        cout << a[j];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12437", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0, x = 0;\n  while (i < strlen(a)) {\n    if (a[i] == b[0]) {\n      int j;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      }\n      if (j == strlen(b) && x == 0) {\n        printf(\"%s\", c);\n        x = 1;\n        i += strlen(b);\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], z[256], p[256];\n  cin >> s >> z >> p;\n  int i, ls, lz, lp, j, t = 0, loc = -1;\n  ls = strlen(s);\n  lz = strlen(z);\n  lp = strlen(p);\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = i; j < i + lz; j++) {\n      if (s[j] == z[j - i]) {\n\n        t++;\n      }\n    }\n\n    if (t == lz) {\n\n      loc = i;\n      i = ls;\n      j = lz;\n    }\n  }\n\n  if (loc == -1)\n    puts(s);\n\n  else {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; i < lp; i++) {\n      cout << p[i];\n    }\n    for (i = loc + lp; i < ls; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12439", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    int k = 0;\n    if (a[i] == b[0]) {\n      k = 1;\n      for (int e = 0; b[e] != '\u0000'; e++) {\n        if (a[i + e] != b[e])\n          k = 0;\n      }\n      if (k == 1)\n        for (int f = 0; b[f] != '\u0000'; f++) {\n          a[i + f] = c[f];\n        }\n    }\n    if (k == 1) {\n      break;\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[1000], x[1000], y[1000], w[1000];\n  int len1, len2, len3, i, j, flag = 0, m, tag, k = 0;\n\n  cin >> zfc;\n\n  cin >> x;\n\n  scanf(\"%s \", y);\n  len1 = strlen(zfc);\n  len2 = strlen(x);\n  len3 = strlen(y);\n  for (i = 0; i < len1; i++) {\n    if (zfc[i] == x[0]) {\n      m = i;\n      tag = 0;\n      for (j = 0; j < len2; j++) {\n        if (zfc[i + j] != x[j]) {\n          tag = 1;\n          break;\n        }\n      }\n      if (tag == 0) {\n        strcpy(w, zfc);\n        for (j = 0; j < len3; j++) {\n          zfc[m + j] = y[j];\n        }\n        if (m + len3 > len1 || m + len3 == len1) {\n          zfc[m + len3] = '\u0000';\n        } else if (m + len3 < len1) {\n          for (i = m + len3; i < len1 + len3 - len2; i++) {\n            zfc[i] = w[m + len2 + k];\n            k++;\n          }\n          zfc[len1 + len3 - len2] = '\u0000';\n        }\n        flag = 1;\n      }\n    }\n  }\n\n  printf(\"%s \", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int x, y, i, j, p, q, k, r, t, z;\n  x = strlen(a);\n  y = strlen(b);\n  q = 0;\n  for (i = 0; q == 0 && i < x; i++) {\n    if (b[0] == a[i]) {\n      p = i;\n      for (j = 0; b[j] == a[p] && b[j] != '\u0000' && a[p] != '\u0000'; j++) {\n        p++;\n      }\n      if (j == y) {\n        q = q + 1;\n      }\n    }\n  }\n  if (q == 0) {\n    for (z = 0; z < x; z++) {\n      printf(\"%c\", a[z]);\n    }\n  }\n  if (q != 0) {\n    for (k = 0; k < i - 1; k++) {\n      printf(\"%c\", a[k]);\n    }\n    for (r = 0; r < y; r++) {\n      printf(\"%c\", c[r]);\n    }\n    for (t = i + y - 1; t < x; t++) {\n      printf(\"%c\", a[t]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int i, j;\n  int count1 = 0, count2 = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    count1++;\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    count2++;\n  }\n  int k, l, m, n, judge = 0, o, p, judge1 = 0;\n  for (k = 0; k <= count1 - count2; k++) {\n    n = 0;\n    if (a[k] == b[0]) {\n      o = m = k;\n      for (n = 0; n <= count2 - 1; n++) {\n        if (a[m] != b[n]) {\n          break;\n        } else if (n == count2 - 1 && a[m] == b[n]) {\n          judge = 1;\n        } else {\n          if (a[m] == b[n] && n != count2 - 1) {\n            m++;\n          }\n        }\n      }\n      if (judge == 1) {\n        for (o = k; o <= k + count2 - 1; o++) {\n          a[o] = c[o - k];\n        }\n        for (p = 0; p <= count1 - 1; p++) {\n          printf(\"%c\", a[p]);\n        }\n        judge1 = 1;\n        break;\n      } else {\n        if (judge == 0) {\n          continue;\n        }\n      }\n    }\n  }\n  if (judge1 == 0) {\n    for (int z = 0; z <= count1 - 1; z++)\n      printf(\"%c\", a[z]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int sum1 = strlen(b);\n  int i, j, k, m, n, p, q, start, pd = 0;\n  for (start = 0; start < strlen(a); start++) {\n    k = 0;\n    for (i = start; i < start + sum1; i++) {\n      if (a[i] != b[k])\n        break;\n      k++;\n    }\n    if (i == (start + sum1)) {\n      pd = 1;\n      p = start;\n      break;\n    }\n  }\n\n  if (pd == 1) {\n    for (q = p, k = 0; c[k] != '\u0000'; q++, k++)\n      a[q] = c[k];\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, la, lb, f = 0;\n  char a[300], b[300], c[300], tem[300];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    k = 0;\n    for (j = i; j < lb + i; j++) {\n\n      tem[k++] = a[j];\n      if (j == lb + i - 1)\n        tem[k] = 0;\n    }\n    if (!strcmp(tem, b) && f == 0) {\n      f++;\n      printf(\"%s\", c);\n      i += lb - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], e[300];\n  int i, j, k, l;\n  i = 0;\n  j = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  while (a[i] != '\u0000') {\n    c[j] = a[i];\n    if (c[j] == b[0] && (i + strlen(b) <= strlen(a))) {\n      l = 0;\n      for (k = i; k <= i + strlen(b) - 1; k++) {\n        d[l] = a[k];\n        l++;\n      }\n      d[l] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        c[j] = '\u0000';\n        cout << c;\n        printf(\"%s\", e);\n        j = i + strlen(b);\n        k = 0;\n        while (a[j] != '\u0000') {\n          c[k] = a[j];\n          j++;\n          k++;\n        }\n        c[k] = '\u0000';\n        cout << c;\n        return 0;\n      }\n    }\n    i++;\n    j++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12446", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, m, L, l1, l2;\n  char s[300], a[300], b[300];\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n  }\n  for (k = i + l1; k < L; k++) {\n    printf(\"%c\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12447", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b), len3 = strlen(c);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    cout << a;\n  else if (flag == 0) {\n    cout << c;\n    for (i = len2; i <= len1 - 1; i++)\n      cout << a[i];\n  } else {\n    for (i = 0; i <= flag - 1; i++)\n      cout << a[i];\n    cout << c;\n    for (i = i + len2; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[300], *p, sub[50], *q, *c, rep[50];\n  cin >> s >> sub >> rep;\n  int len = strlen(sub);\n  p = s;\n  q = sub;\n  c = strstr(p, q);\n  if (c == NULL) {\n    cout << s << endl;\n  } else {\n    for (p; p < c; p++) {\n      cout << *p;\n    }\n    cout << rep;\n    for (p = c + len; *p != '\\0'; p++) {\n      cout << *p;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12449", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[260], b[260], c[260];\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (int i = 0; a[i] != '\u0000'; i++) {\n    int k = 0;\n    if (a[i] == b[0]) {\n      k = 1;\n      for (int e = 0; b[e] != '\u0000'; e++) {\n        if (a[i + e] != b[e])\n          k = 0;\n      }\n      if (k == 1)\n        for (int f = 0; b[f] != '\u0000'; f++) {\n          a[i + f] = c[f];\n        }\n    }\n    if (k == 1)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12450", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, slen, alen;\n  char *ss[2], s[256], s1[256], s2[256];\n  int flag = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  slen = strlen(s);\n  alen = strlen(s1);\n\n  for (i = 0; i < slen - alen + 1; i++) {\n    for (j = 0; j < alen; j++) {\n      if (s[i + j] != s1[j])\n        break;\n    }\n    if (j == alen) {\n      ss[1] = &s[i + j];\n      s[i] = '\u0000';\n      ss[0] = s;\n      flag = 1;\n\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"%s \", s);\n  else\n    printf(\"%s%s%s \", ss[0], s2, ss[1]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12451", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char X[300];\n  char Y[100];\n  char Z[100];\n\n  scanf(\"%s \", X);\n\n  scanf(\"%s \", Y);\n\n  cin >> Z;\n  int l, l1, l2;\n  l = strlen(X);\n  l1 = strlen(Y);\n  l2 = strlen(Z);\n  int i;\n  int A = -1;\n  for (i = 0; i < l; i++) {\n    if (X[i] == Y[0] && X[i + 1] == Y[1] && X[i + l1 - 1] == Y[l1 - 1] &&\n        X[i + l1 - 2] == Y[l1 - 2]) {\n      A = i;\n      break;\n    }\n  }\n  if (A != -1) {\n    for (i = 0; i < A; i++) {\n      printf(\"%c\", X[i]);\n    }\n    for (i = 0; i < l2; i++) {\n      printf(\"%c\", Z[i]);\n    }\n    for (i = A + l1; i < l; i++) {\n      printf(\"%c\", X[i]);\n    }\n  } else {\n    for (i = 0; i < l; i++)\n      printf(\"%c\", X[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12452", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    printf(\"%s\\n\", s);\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (j >= len2)\n      break;\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n\n    if (j) {\n      i -= j;\n      j = 0;\n    }\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  printf(\"%s\\n\", n);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], word1[100], word2[100];\n  scanf(\"%s%s%s\", a, word1, word2);\n  int la, l1, l2, i, j, k, flag;\n  la = strlen(a);\n  l1 = strlen(word1);\n  l2 = strlen(word2);\n  for (i = 0; i < la; i++) {\n    if (a[i] == word1[0]) {\n      for (j = 0; j < l1; j++) {\n        flag = 1;\n        if (a[i + j] != word1[j])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (k = 0; k < l2; k++) {\n          a[i + k] = word2[k];\n        }\n      }\n      if (flag == 1) {\n        printf(\"%s\\n\", a);\n        break;\n      }\n    }\n    if (i == la - 1) {\n      printf(\"%s\\n\", a);\n    }\n  }\n}\n"}
{"label": "7", "index": "12454", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  int i, j, m, n, k, t, q = 0, p = 0;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i <= m - n; i++) {\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i])\n        p++;\n      else\n        break;\n    }\n    if (p == n) {\n      q++;\n      t = i;\n      for (j = 0; j <= t - 1; j++)\n        c[j] = s[j];\n      for (j = t; j < t + k; j++) {\n        c[j] = b[j - i];\n      }\n      for (j = t + k; j < m - n + k; j++)\n        c[j] = s[n + j - k];\n      c[m - n + k] = '\u0000';\n      puts(c);\n      break;\n    }\n    p = 0;\n  }\n  if (q == 0)\n    puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12455", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], rep[256];\n  int t, i, j, k;\n  cin >> s;\n  cin >> sub;\n  scanf(\"%s \", rep);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    t = 0;\n    if (s[i] == sub[0]) {\n      for (j = i, k = 0; sub[k] != '\u0000'; j++, k++) {\n        if (s[j] != sub[k]) {\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        for (j = i; rep[j - i] != '\u0000'; j++)\n          s[j] = rep[j - i];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12456", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  scanf(\"%s %s %s \", s, a, b);\n  int i = 0, j = 0;\n  int find = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n\n      for (j = 0; a[j] != '\\0'; j++) {\n\n        if (a[j] != s[i + j]) {\n          find = 0;\n          break;\n        }\n      }\n      if (a[j] == '\\0')\n        find = 1;\n    }\n    if (find == 1)\n      break;\n  }\n  if (find) {\n    for (j = 0; b[j] != '\\0'; j++)\n      s[i + j] = b[j];\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz1[256];\n  char sz2[256];\n  char sz3[256];\n  scanf(\"%s\", sz1);\n  scanf(\"%s\", sz2);\n  scanf(\"%s\", sz3);\n  int len1, len2;\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  int i, k;\n  int flag = 0;\n  for (k = 0; k <= len1 - len2; k++) {\n    for (i = 0; i < len2; i++) {\n      if (sz1[i + k] == sz2[i]) {\n        flag = flag + 1;\n      }\n    }\n    if (flag == len2)\n      break;\n    if (flag != len2)\n      flag = 0;\n  }\n  if (flag == len2) {\n    for (i = 0; i < len2; i++) {\n      sz1[k + i] = sz3[i];\n    }\n  }\n  printf(\"%s\", sz1);\n  return 0;\n}\n"}
{"label": "7", "index": "12458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257] = {0};\n  char b[257] = {0};\n  char c[257] = {0};\n  int i = 0;\n  int j = 0;\n  int k = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int isbreak = 0;\n  int len = strlen(b);\n  for (i = 0; i < 257; i++) {\n    if (a[i + len - 1] == '\u0000')\n      break;\n    for (j = i; j < i + len; j++) {\n      if (a[j] == b[j - i]) {\n        k++;\n      } else {\n        k = 0;\n      }\n    }\n    if (k == len) {\n      isbreak = 1;\n      for (j = i; j < i + len; j++) {\n        a[j] = c[j - i];\n      }\n    }\n    if (isbreak != 0)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300] = {\"\u0000\"};\n  char sub[300] = {\"\u0000\"};\n  char re[300] = {\"\u0000\"};\n  char t[300];\n  char pre[300] = {\"\u0000\"};\n  char post[300] = {\"\u0000\"};\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int i, j, k;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < 299; j++)\n        t[j] = '\u0000';\n      for (j = 0; j < strlen(sub); j++)\n        t[j] = str[i + j];\n      if (strcmp(t, sub) == 0) {\n        for (j = 0; j < i; j++)\n          pre[j] = str[j];\n        for (j = i + strlen(sub); j < strlen(str); j++)\n          post[j - i - strlen(sub)] = str[j];\n        printf(\"%s%s%s \", pre, re, post);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], *p;\n  cin >> a >> b >> c;\n  p = strstr(a, b);\n  if (p == NULL) {\n    puts(a);\n  } else {\n    *p = '\u0000';\n    strcpy(d, a);\n    strcat(d, c);\n    strcat(d, p + strlen(b));\n    puts(d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[2000];\n\n  cin >> zfc;\n  int c;\n  c = strlen(zfc);\n  char tzfc[2000];\n  char hzfc[2000];\n\n  cin >> tzfc;\n\n  cin >> hzfc;\n  int ct, ch;\n  ct = strlen(tzfc);\n  ch = strlen(hzfc);\n\n  int i, wei, an = 0, x, deng = 0;\n  for (i = 0; i < c; i++) {\n    int flag = 0;\n    for (x = i; x < ct + i; x++) {\n      if (zfc[x] != tzfc[x - i]) {\n        flag = 1;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 0) {\n      wei = i;\n      an++;\n      deng = 1;\n    }\n\n    if (an == 1) {\n      break;\n    }\n  }\n\n  if (deng == 0) {\n    puts(zfc);\n  } else {\n\n    int xzfc[2000];\n    for (i = 0; i < wei; i++) {\n      xzfc[i] = zfc[i];\n    }\n    for (i = wei; i < ch + wei; i++) {\n      xzfc[i] = hzfc[i - wei];\n    }\n    for (i = ch + wei; i < c - ct + ch; i++) {\n      xzfc[i] = zfc[i - (ch - ct)];\n    }\n\n    for (i = 0; i < c - ct + ch; i++) {\n      printf(\"%c\", xzfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257];\n  int i, k = 0, j, len1, len2, len3;\n  scanf(\"%s%s%s\", a, b, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        k++;\n    }\n    if (k == len2)\n      break;\n    k = 0;\n  }\n  if (k == len2) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < len3; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + len2; j < len1; j++) {\n      printf(\"%c\", a[j]);\n    }\n  }\n  if (k != len2) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12463", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  int x;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  x = strstr(string, substring) - &string[0];\n  if (strchr(string, substring[0]) != 0)\n    memmove(string + x, replacement, strlen(replacement));\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int le, len, lenn, i, j, k, a = 0, b, m = 0;\n  char aa[256], bb[256], cc[256];\n  scanf(\"%s%s%s\", aa, bb, cc);\n  le = strlen(aa);\n  len = strlen(bb);\n  lenn = strlen(cc);\n  for (i = 0; i < le; i++) {\n    a = 0;\n    for (j = i, k = 0; j < len + i && k < len; j++, k++) {\n      if (bb[k] == aa[j])\n        a++;\n    }\n    if (a == len) {\n      b = i;\n      m++;\n      break;\n    }\n  }\n\n  if (m == 0)\n    puts(aa);\n  else {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", aa[i]);\n    }\n    for (k = 0; k < lenn; k++) {\n      printf(\"%c\", cc[k]);\n    }\n    for (i = b + len; i < le; i++) {\n      printf(\"%c\", aa[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[514], b[514], c[514], d[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, k, l, m, n, t, p, q, x, z, y;\n  l = strlen(a);\n  m = strlen(b);\n  for (i = 0; i < l - m + 1; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      for (j = i, t = 0; j < i + m; j++, t++) {\n        if (a[j] != b[t]) {\n          k = 1;\n          break;\n        }\n      }\n      if (k == 0) {\n        p = i;\n        q = i + m;\n        break;\n      }\n    }\n  }\n  if (k == 0) {\n    for (i = q, j = 0; i < l; i++, j++) {\n      d[j] = a[i];\n    }\n    d[j] = 0;\n    strcat(c, d);\n    a[p] = 0;\n    strcat(a, c);\n    printf(\"%s \", a);\n  } else {\n    printf(\"%s \", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n    if (i >= m && i < b + m)\n      cout << replacement[i - m];\n    else {\n      cout << string[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char z[257];\n  char y[257];\n  char t[257];\n  int i, p;\n  int v, x, s;\n  int result;\n  int word = 0;\n  int a;\n\n  cin >> y;\n\n  cin >> z;\n\n  cin >> t;\n  v = strlen(z);\n  x = strlen(y);\n  s = strlen(t);\n\n  for (i = 0; y[i] != '\u0000'; i++) {\n    if ((y[i] == z[0]) && (y[i + v - 1] == z[v - 1])) {\n      for (p = 0; p <= v - 1; p++) {\n        if (y[i + p] == z[p]) {\n          word++;\n        }\n      }\n      if (word == v) {\n\n        a = i;\n\n        result = 0;\n      }\n    }\n  }\n\n  if (result == 0) {\n    for (i = 0; i <= a - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n    for (i = 0; i <= s - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    for (i = a + v; i <= x - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n  } else\n    printf(\"%s\", y);\n  return 0;\n}\n"}
{"label": "7", "index": "12468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, t = 0;\n  char c[256], d[256], e[256];\n  scanf(\"%s\", c);\n  scanf(\"%s\", d);\n  scanf(\"%s\", e);\n  m = strlen(c);\n  n = strlen(d);\n  for (i = 0; i < m; i++) {\n    if (c[i] == d[0]) {\n      t = 0;\n      for (j = i; j < i + n; j++) {\n        if (c[j] == d[j - i]) {\n          t = t + 1;\n        }\n      }\n      if (t == n) {\n        for (j = i; j < i + n; j++) {\n          c[j] = e[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "7", "index": "12469", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sentence[256], sub_sen[256], replacement[256];\n  cin.getline(sentence, 256);\n  cin.getline(sub_sen, 256);\n  cin.getline(replacement, 256);\n  char *p;\n  p = strstr(sentence, sub_sen);\n  if (!p) {\n    cout << sentence << endl;\n  }\n  int i;\n  int length = strlen(sub_sen);\n  if (p) {\n    for (i = 0; i < p - sentence; i++) {\n      cout << sentence[i];\n    }\n    cout << replacement;\n    cout << p + length << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], s2[256], ss[20], re[20];\n  int i, j, x = 0, y = 0, a, flag = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", ss, re);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ss[0]) {\n      s1[x] = s[i];\n      x++;\n    } else if (s[i] == ss[0]) {\n      a = i;\n      flag = 1;\n      for (j = 0; ss[j] != '\u0000'; j++) {\n        if (ss[j] != s[a]) {\n          flag = 0;\n        }\n        a++;\n      }\n      if (flag == 0) {\n        s1[x] = s[i];\n        x++;\n      }\n    }\n    if (flag == 1) {\n      s1[x] = '\u0000';\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i += strlen(ss); s[i] != '\u0000'; i++) {\n      s2[y] = s[i];\n      y++;\n    }\n  }\n  s2[y] = '\u0000';\n  if (flag == 1) {\n    cout << s1 << re << s2;\n  }\n  if (flag == 0) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[256], z[256], h[256], sc[256];\n\n  cin >> y;\n\n  cin >> z;\n\n  cin >> h;\n  int k = 0, count = 0, o;\n  int a = strlen(y);\n  int b = strlen(z);\n  int c = strlen(h);\n  for (int i = 0; i < a; i++) {\n    if (y[i] == z[k]) {\n      k++;\n      count++;\n      if (count == b) {\n        break;\n      }\n    } else {\n      if (count != b) {\n        if (count > 0) {\n          i--;\n        }\n        count = 0;\n        k = 0;\n      }\n    }\n    o = i;\n  }\n  int e = o - k + 2;\n  int f = 0;\n  for (int m = 0; m < a; m++) {\n    if ((m >= e) && (m < e + c)) {\n      sc[m] = h[f];\n      f++;\n    } else {\n      sc[m] = y[m];\n    }\n  }\n  for (int l = 0; l < a; l++) {\n    printf(\"%c\", sc[l]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12472", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[260], s1[260], s2[260], s3[260];\n  int i, j, k, l, h, len, len1, len2;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  len = strlen(s);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  for (i = 0, h = 0; i < len; i++, h++) {\n\n    s3[h] = s[i];\n    if (s[i] == s1[0]) {\n      int e = 1;\n      for (j = 0, k = i; j < len1; j++, k++) {\n        if (s[k] != s1[j]) {\n          e = 0;\n          break;\n        }\n      }\n      if (e) {\n        for (l = 0; l < len2; l++, h++) {\n          s3[h] = s2[l];\n        }\n        h--;\n        i = i + len1 - 1;\n        s1[0] = '.';\n      }\n    }\n  }\n  s3[len - len1 + len2] = '\u0000';\n  printf(\"%s\", s3);\n  return 0;\n}\n"}
{"label": "7", "index": "12473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[1000], x[1000], y[1000], w[1000];\n  int len1, len2, len3, i, j, flag = 0, m, tag, k = 0;\n\n  cin >> zfc;\n\n  cin >> x;\n\n  scanf(\"%s \", y);\n  len1 = strlen(zfc);\n  len2 = strlen(x);\n  len3 = strlen(y);\n  for (i = 0; i < len1; i++) {\n    if (zfc[i] == x[0]) {\n      m = i;\n      tag = 0;\n      for (j = 0; j < len2; j++) {\n        if (zfc[i + j] != x[j]) {\n          tag = 1;\n          break;\n        }\n      }\n      if (tag == 0) {\n        strcpy(w, zfc);\n        for (j = 0; j < len3; j++) {\n          zfc[m + j] = y[j];\n        }\n        if (m + len3 > len1 || m + len3 == len1) {\n          zfc[m + len3] = '\u0000';\n        } else if (m + len3 < len1) {\n          for (i = m + len3; i < len1 + len3 - len2; i++) {\n            zfc[i] = w[m + len2 + k];\n            k++;\n          }\n          zfc[len1 + len3 - len2] = '\u0000';\n        }\n        flag = 1;\n      }\n    }\n  }\n\n  cout << zfc << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[256], b[256], c[256];\n  int i, j, k, n, m;\n  cin >> s;\n  cin >> b;\n  cin >> c;\n  n = strlen(s) - strlen(b);\n  for (i = 0; i <= n; i++) {\n    m = 0;\n    for (j = 0, k = i; j < strlen(b); j++, k++) {\n      if (s[k] == b[j]) {\n        m++;\n      }\n    }\n    if (m == strlen(b)) {\n      for (j = i, k = 0; j < strlen(b) + i; j++, k++) {\n        s[j] = c[k];\n      }\n      break;\n    }\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b), len3 = strlen(c);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    printf(\"%s\", a);\n  else {\n    for (i = flag; i <= flag + len2 - 1; i++)\n      a[i] = c[i - flag];\n    for (i = 0; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], s[257], r[257];\n  int len1, len2, len3, i, j, k, c, flag = 0;\n  scanf(\"%s%s%s\", str, s, r);\n  len1 = strlen(str);\n  len2 = strlen(s);\n  len3 = strlen(r);\n  j = 0;\n  while (str[j] != '\\0') {\n    if (str[j] == s[0]) {\n      c = j;\n      for (i = 0; i < len2; i++) {\n        if (str[j + i] != s[i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (i == len2) {\n        flag = 1;\n        break;\n      }\n    }\n    j++;\n  }\n  if (flag) {\n    for (k = 0; k < c; k++)\n      printf(\"%c\", str[k]);\n    cout << r;\n    for (k = c + len2; k < len1; k++) {\n      printf(\"%c\", str[k]);\n    }\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[512], w[257], r[257];\n  int m, n;\n  int i, j, k;\n  int t;\n  scanf(\"%s%s%s\", s, w, r);\n  m = strlen(s);\n  n = strlen(w);\n  for (i = 0; i <= m - n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      if (w[j] != s[i + j])\n        t = 1;\n    }\n    if (t == 0)\n      break;\n  }\n  if (t == 0) {\n    for (k = i; k <= i + n - 1; k++) {\n      s[k] = r[k - i];\n    }\n    printf(\"%s\", s);\n  } else {\n    printf(\"%s\", s);\n  }\n}\n"}
{"label": "7", "index": "12478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, k, n1, n2;\n  scanf(\"%s %s %s\", a, b, c);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i <= n1 - n2; i++) {\n    for (j = 0; j < n2; j++)\n      if (b[j] == a[i + j]) {\n        k++;\n        if (k == n2)\n          break;\n      } else {\n        k = 0;\n        break;\n      }\n    if (k == n2)\n      break;\n  }\n  if (k == n2) {\n    for (j = 0; j < n2; j++)\n      a[i + j] = c[j];\n    printf(\"%s\", a);\n  } else\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid right(char a[], int l, int t) {\n  int i;\n  for (i = l; i >= t; i--)\n    a[i] = a[i - 1];\n  a[l + 1] = '\\0';\n}\nvoid left(char a[], int l, int t) {\n  int i;\n  for (i = t; i <= l; i++)\n    a[i - 2] = a[i - 1];\n  a[l - 1] = '\\0';\n}\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, l1, l2, l3, d, e, s, r;\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  if (l2 > l3) {\n    s = 1;\n    r = l2 - l3;\n  } else if (l2 == l3)\n    s = r = 0;\n  else {\n    s = -1;\n    r = l3 - l2;\n  }\n  for (i = 1; i <= l1; i++) {\n    e = a[i - 1] - b[0];\n    if (e == 0) {\n      d = 0;\n      for (j = 1; j <= l2 - 1; j++) {\n        e = a[i + j - 1] - b[j];\n        if (e != 0)\n          d = 1;\n      }\n      if (d == 0) {\n        for (j = 1; j <= r; j++) {\n          if (s > 0)\n            left(a, l1, i + l2);\n          if (s < 0)\n            right(a, l1, i);\n        }\n        for (j = 1; j <= l3; j++)\n          a[i + j - 2] = c[j - 1];\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], d[300], r[300];\n  int i = 0, j, k, ls, lr, ld;\n  int flag = 0;\n  int cont = 0;\n\n  cin >> s;\n\n  cin >> d;\n\n  cin >> r;\n  ls = strlen(s);\n  ld = strlen(d);\n  lr = strlen(r);\n  for (i = 0; i < ls;) {\n    flag = 0;\n    for (j = 0; j < ld; j++) {\n      if (s[i + j] == d[j])\n        flag++;\n      if (flag == ld)\n        cont++;\n    }\n\n    if (flag == ld && cont == 1) {\n      cont++;\n      for (k = 0; k < lr; k++) {\n        s[i + k] = r[k];\n      }\n      i = i + lr;\n      continue;\n    } else {\n      i++;\n      continue;\n    }\n  }\n  puts(s);\n}\n"}
{"label": "7", "index": "12481", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, x, y, m, l = 0, t;\n  char b[1000], a[1000], c[1000];\n  cin >> b;\n  scanf(\"%s\", a);\n  scanf(\"%s \", c);\n\n  for (y = 0; i < 1000; y++) {\n    if (a[y] == '\u0000')\n      break;\n  }\n\n  for (i = 0; i < 1000; i++) {\n    m = 0;\n    for (j = i; j - i < y; j++) {\n      if (a[j - i] == b[j])\n        m++;\n    }\n    if (m >= y)\n      break;\n  }\n\n  for (t = i; c[t - i] != 0 && t < 256; t++) {\n    b[t] = c[t - i];\n    if (c[t - i] == '\u0000')\n      break;\n  }\n  puts(b);\n  return 0;\n}\n"}
{"label": "7", "index": "12482", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str1[257], str2[257], str3[257];\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n\n  int i;\n  int j;\n  int k;\n  for (i = 0; i < strlen(str1); i++) {\n    j = 0;\n    k = i;\n    while (j < strlen(str2)) {\n      if (str2[j] != str1[k])\n        break;\n      else\n        j++;\n      k++;\n    }\n    if (j == strlen(str2)) {\n      printf(\"%s\", str3);\n      break;\n    } else\n      printf(\"%c\", str1[i]);\n  }\n  if (i != strlen(str1))\n    for (i = k; i < strlen(str1); i++)\n      printf(\"%c\", str1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int l, i, j, k, temp;\n  cin >> a >> b >> c;\n  l = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      temp = 0;\n      for (j = 0; j < l; j++) {\n        if (b[j] != a[j + i])\n          break;\n      }\n      if (j == l) {\n        for (j = 0; j < l; j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "12484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, flag, w, j, len;\n  char str[257], sub[200], rep[50];\n  scanf(\"%s %s %s\", str, sub, rep);\n  len = strlen(sub);\n  w = 500;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == sub[0]) {\n\n      for (j = i; j < i + len; j++) {\n        if (str[j] != sub[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n\n      if (flag != 0) {\n        w = i;\n        break;\n      } else\n        flag = 1;\n    }\n  }\n  if (w != 500) {\n    j = 0;\n    for (i = w + len; str[i] != '\\0'; i++) {\n      sub[j] = str[i];\n      j++;\n    }\n    sub[j] = '\\0';\n    str[w] = '\\0';\n    cout << str << rep << sub;\n  } else\n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12485", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  cin >> substring;\n  cin >> replacement;\n  int length_string = strlen(string);\n  int length_substring = strlen(substring);\n  int length_replacement = strlen(replacement);\n  int i, j, k;\n  for (i = 0; i < length_string; i++) {\n    for (j = 0; j < length_substring; j++) {\n      if (substring[j] != string[i + j]) {\n        break;\n      }\n    }\n    if (j == length_substring) {\n      for (k = 0; k < length_substring; k++) {\n        string[i + k] = replacement[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", string);\n}\n"}
{"label": "7", "index": "12486", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c, d, str1[256], str2[256], str3[256];\n  int l, h, i, j = 0, k, st = 0;\n  scanf(\"%s\", str1);\n  cin >> str2;\n  scanf(\"%s\", str3);\n  l = strlen(str2);\n  for (i = 0; ((c = str2[i]) != '\\0'); i++) {\n    c = str2[i];\n    for (; ((d = str1[j]) != '\\0'); j++) {\n      d = str1[j];\n      if (c == d) {\n        st = st + 1;\n        j = j + 1;\n        break;\n      } else if ((c != d) && (st != 0)) {\n        st = 0;\n        i = -1;\n        break;\n      }\n    }\n  }\n  if (st == l) {\n    for (h = 0, k = (j - l); k < j; k++, h++) {\n      str1[k] = str3[h];\n    }\n    printf(\"%s\\n\", str1);\n  } else\n    printf(\"%s\\n\", str1);\n}\n"}
{"label": "7", "index": "12487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], su[256], re[256];\n  char t[256] = {0};\n\n  cin >> s;\n\n  cin >> su;\n\n  cin >> re;\n\n  int i, j = 0, len = strlen(s);\n  int len1 = strlen(su);\n  for (i = 0; i < len; i++) {\n    if (s[i] != su[j]) {\n      j = 0;\n    }\n\n    else {\n\n      j++;\n    }\n    if (j == len1) {\n\n      break;\n    }\n  }\n\n  if (j != len1) {\n    printf(\"%s\", s);\n  }\n\n  int n = i + 1;\n  if (i != len) {\n    int m = 0;\n    for (n = i + 1; n < len; n++) {\n\n      t[m] = s[n];\n      m++;\n    }\n\n    int len2 = strlen(t);\n\n    s[len - len2 - len1] = '\u0000';\n    strcat(s, re);\n    strcat(s, t);\n\n    printf(\"%s\", s);\n  }\n  if ((i == len) && (j == len1)) {\n\n    s[len - len1] = '\u0000';\n\n    strcat(s, re);\n    cout << s;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, length1, length2, k;\n  scanf(\"%s%s%s\", s1, s2, s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length1; i++) {\n    j = 0;\n    for (; j < length2 && s1[i] == s2[j]; j++)\n      i++;\n    if (j == length2) {\n      for (k = 0; k < length2; k++)\n        s1[i - j + k] = s3[k];\n      break;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], w[256], r[256];\n  int l1, l2, i, j, count, k = 0;\n  scanf(\"%s %s %s \", w, s, r);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (i = 0; i < l2 - l1 + 1; i++) {\n    if (w[i] == s[0]) {\n      count = 1;\n      for (j = i + 1; j < i + l1; j++) {\n        if (w[j] != s[j - i])\n          break;\n        else\n          count++;\n      }\n      if (count == l1) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (j = i; j < i + l1; j++) {\n      w[j] = r[j - i];\n    }\n  }\n  cout << w << \"\\n\";\n}\n"}
{"label": "7", "index": "12490", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, mm = 0;\n  char string1[1000 + 10];\n  char subString[1000 + 10];\n  char replacement[1000 + 10];\n\n  for (k = 0; k < 1000 + 10; k++) \n  {\n    string1[k] = '0';\n    subString[k] = '0';\n    replacement[k] = '0';\n  }\n\n  scanf(\"%s\", string1); \n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n\n  int len1 = strlen(string1); \n  int len2 = strlen(subString);\n  int len3 = strlen(replacement);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    sum = 0;\n    if (string1[i] == subString[0]) \n    {\n      for (j = 0; j < len2; j++) {\n        if (subString[j] == string1[i + j])\n          sum++;\n      }\n\n      if (sum == len2) \n      {\n        for (k = 0; k < i; k++) \n          printf(\"%c\", string1[k]);\n        for (k = 0; k < len3; k++) \n          printf(\"%c\", replacement[k]);\n        for (k = i + len2; k < len1; k++) \n          printf(\"%c\", string1[k]);\n      }\n\n      if (sum == len2)\n        break;\n    }\n  }\n\n  if (i == len1 - len2 + 1)\n    for (k = 0; k < len1; k++)\n      printf(\"%c\", string1[k]);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[600];\n  char sub[300], rep[300];\n  int i, j, k, sun00 = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        sun00 = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (sun00 < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n}\n"}
{"label": "7", "index": "12492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[260], w[260], h[260];\n  int l1, l2, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (j = 0; j < l1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < l2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == l2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < l2; k++)\n      printf(\"%c\", h[k]);\n    for (k = j + l2; k < l1; k++)\n      printf(\"%c\", s[k]);\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\", s);\n  }\n}\n"}
{"label": "7", "index": "12493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s1[10000], s2[10000], s[10000];\nint Len(char *s) {\n  int i;\n  for (i = 0; s[i]; i++)\n    ;\n  return i;\n}\nint Match(char *s1, char *s2) {\n  int i, l = Len(s2);\n  for (i = 0; i < l; i++)\n    if (s1[i] != s2[i])\n      return 0;\n  return 1;\n}\nint Find(char *s, char *s1) {\n  int i, l = Len(s);\n  for (i = 0; i < l; i++)\n    if (Match(s + i, s1))\n      return i;\n  return l;\n}\nint main() {\n  int l, i, t;\n  scanf(\"%s%s%s\", s, s1, s2);\n  l = Len(s);\n  t = Find(s, s1);\n  if (t == l)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < t; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"%s\", s2);\n    for (i = Len(s1) + t; i < l; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12494", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], rep[257];\n  int i, j = 0, m, n, g = 0;\n  scanf(\"%s\", str);\n  scanf(\"%s\", substr);\n  scanf(\"%s \", rep);\n  m = strlen(str);\n  n = strlen(substr);\n  for (i = 0; i < m; i++)\n    if (str[i] == substr[j] && g < n) {\n      j++;\n      g++;\n    } else if (g >= n)\n      break;\n    else {\n      g = 0;\n      j = 0;\n    }\n  if (g == n)\n    for (j = 0, i = i - n; j < n; j++, i++)\n      str[i] = rep[j];\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12495", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char z[257];\n  char y[257];\n  char t[257];\n  int i, j, p;\n  int v, x, s;\n  int result;\n  int word = 0;\n  int a;\n\n  scanf(\"%s \", y);\n\n  scanf(\"%s \", z);\n\n  cin >> t;\n  v = strlen(z);\n  x = strlen(y);\n  s = strlen(t);\n\n  for (i = 0; y[i] != '\u0000'; i++) {\n    if ((y[i] == z[0]) && (y[i + v - 1] == z[v - 1])) {\n      for (p = 0; p <= v - 1; p++) {\n        if (y[i + p] == z[p])\n          word++;\n      }\n      if (word == v) {\n\n        a = i;\n\n        result = 0;\n      }\n    }\n  }\n\n  if (result == 0) {\n    for (i = 0; i <= a - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n    for (i = 0; i <= s - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    for (i = a + v; i <= x - 1; i++) {\n      printf(\"%c\", y[i]);\n    }\n  } else\n    printf(\"%s\", y);\n  return 0;\n}\n"}
{"label": "7", "index": "12496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[256], sub[256];\nint f(int x) {\n  int i = x, j = 0;\n  while (sub[j] != '\\0') {\n    if (str[i] != sub[j])\n      return 0;\n    i++;\n    j++;\n  }\n  return 1;\n}\nint main() {\n  char rep[256];\n  int i = 0, j = 0;\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  while (str[i] != '\\0') {\n    if (f(i)) {\n      while (rep[j] != '\\0') {\n        str[i] = rep[j];\n        i++;\n        j++;\n      }\n      break;\n    }\n    i++;\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, k, a, b, c, i, j;\n  char s[3][256];\n  scanf(\"%s\", &s[0]);\n  scanf(\"%s\", &s[1]);\n  scanf(\"%s\", &s[2]);\n  a = strlen(s[0]);\n  b = strlen(s[1]);\n  c = strlen(s[2]);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      if (s[0][i + j] == s[1][j]) {\n        m++;\n      }\n    }\n    if (m == b) {\n      break;\n    }\n    m = 0;\n  }\n  if (i == a) {\n    printf(\"%s\", s[0]);\n  } else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n    for (k = 0; k < c; k++) {\n      cout << s[2][k];\n    }\n    for (k = i + b; k < a; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[260], c[260], d[520];\n  int i, m, a1, b1, c1;\n  char *k;\n  int j;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  k = strstr(a, b);\n\n  if (k == NULL)\n    cout << a;\n  else {\n    m = k - &a[0];\n    for (i = 0; i < m; i++)\n      d[i] = a[i];\n    for (i = 0; i < c1; i++)\n      d[m + i] = c[i];\n    j = m + c1;\n    for (i = 0; m + b1 + i <= a1; i++)\n      d[j + i] = a[m + b1 + i];\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12499", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256];\n  char sub[256];\n  char replace[256];\n  char sz[256][256];\n\n  cin >> yuan;\n\n  cin >> sub;\n\n  scanf(\"%s \", replace);\n  int n = strlen(sub);\n  int m = strlen(yuan);\n  int i, k, result;\n  int a = 0;\n  int b = 0;\n  for (i = 0; i <= m - n; i++) {\n    for (k = 0; k < n; k++) {\n      sz[a][b] = yuan[i + k];\n      b++;\n    }\n    sz[a][b] = '\u0000';\n    a++;\n    b = 0;\n  }\n  for (i = 0; i < a; i++) {\n    result = strcmp(sz[i], sub);\n    if (result == 0) {\n      strcpy(sz[i], replace);\n      printf(\"%s\", sz[i]);\n      i += n;\n      break;\n    } else\n      printf(\"%c\", yuan[i]);\n  }\n  for (i = i; i < m; i++) {\n    printf(\"%c\", yuan[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[257] = {'0'}, sub[257] = {'0'}, rep[257] = {'0'}, temp[257] = {'0'};\n  scanf(\"%s%s%s\", s, sub, rep);\n  int i, j, k, len1, len2, time;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, i++)\n      temp[j] = s[i];\n\n    i = k;\n    if (strcmp(temp, sub) == 0) {\n      time = i;\n      break;\n    }\n  }\n  if (strcmp(temp, sub) == 0) {\n    for (i = time, j = 0; i < time + len2; i++, j++) {\n      s[i] = rep[j];\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12501", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257] = {'\\0'}, substr[257] = {'\\0'}, replace[257] = {'\\0'};\n  cin >> str >> substr >> replace;\n  char *p = strstr(str, substr);\n  int i = 0, flag = strlen(substr);\n  if (p == NULL)\n    cout << str << endl;\n  else {\n    for (i = 0; str + i < p; i++)\n      printf(\"%c\", str[i]);\n    cout << replace;\n    for (i = i + flag; i < strlen(str); i++)\n      cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[100];\n  scanf(\"%s\", sz);\n  int i, j, m, n, len, len1, len2;\n\n  char as[100], az[100];\n  scanf(\"%s%s\", as, az);\n\n  len = strlen(sz);\n  len1 = strlen(as);\n  len2 = strlen(as);\n  for (i = 0; i < len; i++) {\n    for (j = 0; j < len2; j++, i++) {\n      if (sz[i] != as[j])\n        break;\n      if (j == len2 - 1) {\n        for (m = i - len2 + 1, n = 0; n < len2; n++, m++) {\n          sz[m] = az[n];\n        }\n      }\n      if (j == len2 - 1) {\n        i = len;\n      }\n    }\n  }\n  printf(\"%s\", sz);\n  return 0;\n}\n"}
{"label": "7", "index": "12503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ls1, ls2, ls3, i, j = 0, m, lans = 0, z = 0;\n  char s1[100], s2[100], s3[100], ans[100];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  ls1 = strlen(s1);\n  ls2 = strlen(s2);\n  ls3 = strlen(s3);\n  for (i = 0; i < ls1; i++) {\n\n    if (s1[i] != s2[0])\n      ans[lans++] = s1[i];\n    else {\n      for (j = 0, m = i; j < ls2; j++, m++) {\n        if (s1[m] != s2[j])\n          break;\n      }\n      if (j == ls2 && z != 1) {\n        i = m - 1;\n        for (j = 0; j < ls3; j++)\n          ans[lans++] = s3[j];\n        z++;\n      } else {\n        for (; i <= m; i++)\n          ans[lans++] = s1[i];\n        i--;\n      }\n    }\n  }\n  ans[lans] = '\\0';\n  printf(\"%s\", ans);\n  return 0;\n}\n"}
{"label": "7", "index": "12504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *org, *sub, *re;\n  int i, j, flag;\n  org = (char *)malloc(1024 * sizeof(char));\n  sub = (char *)malloc(100 * sizeof(char));\n  re = (char *)malloc(100 * sizeof(char));\n\n  cin >> org;\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; *(org + i) != '\u0000'; i++) {\n    if (*(org + i) == *sub) {\n      for (j = 0; *(sub + j) != '\u0000'; j++) {\n        flag = 0;\n        if (*(org + i + j) != *(sub + j)) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        for (j = 0; *(re + j) != '\u0000'; j++)\n          *(org + i + j) = *(re + j);\n        break;\n      }\n    }\n  }\n  printf(\"%s\", org);\n}\n"}
{"label": "7", "index": "12505", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char substr[256];\n  char rep[256];\n  int i, j, flag;\n  int a, b, c;\n\n  cin >> str;\n\n  cin >> substr;\n\n  scanf(\"%s \", rep);\n\n  a = strlen(substr);\n  b = strlen(str);\n  c = strlen(rep);\n\n  for (i = 0; i < b; i++) {\n    flag = 1;\n    for (j = 0; j < a; j++) {\n      if (str[i + j] != substr[j]) {\n        flag = 0;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  if (i == b) {\n    puts(str);\n  } else {\n\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (j = 0; j < c; j++) {\n      printf(\"%c\", rep[j]);\n    }\n    for (j = i + a; j < b; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < 256; i++) {\n    k = 0;\n    for (j = 0; j < strlen(b); j++) {\n      if (a[j + i] != b[j]) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", a[j]);\n      for (j = 0; j < strlen(c); j++)\n        printf(\"%c\", c[j]);\n      for (j = i + strlen(b); j < strlen(a); j++)\n        printf(\"%c\", a[j]);\n\n      break;\n    }\n  }\n  if (k == 1) {\n    for (j = 0; j < strlen(a); j++)\n      cout << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300];\n  char sub[300];\n  char rep[300];\n  int i, j, lenstr, lensub, judge, state = 0;\n  fgets(str, 300, stdin);\n  fgets(sub, 300, stdin);\n  fgets(rep, 300, stdin);\n  lenstr = strlen(str) - 1;\n  lensub = strlen(sub) - 1;\n  for (i = 0; i <= lenstr - lensub; i++) {\n    judge = 0;\n    for (j = 0; j < lensub; j++)\n      judge = judge + (str[i + j] - sub[j]) * (str[i + j] - sub[j]);\n\n    if (judge == 0) {\n      state = 1;\n      break;\n    }\n  }\n  if (state == 1) {\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; rep[j] != '\\n'; j++)\n      printf(\"%c\", rep[j]);\n    for (j = i + lensub; j <= lenstr - 1; j++)\n      printf(\"%c\", str[j]);\n  } else {\n    for (j = 0; j < lenstr; j++)\n      printf(\"%c\", str[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n1, n2;\n\n  char zf[300];\n  char s1[100], s2[100];\n\n  cin >> zf;\n\n  cin >> s1;\n\n  cin >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < (strlen(zf)); i++) {\n    if (zf[i] == s1[0] && zf[i + 1] == s1[1] && zf[i + n1 - 1] == s1[n1 - 1]) {\n      for (k = 0; k < n2; k++) {\n        zf[i] = s2[k];\n        i++;\n      }\n      break;\n    }\n  }\n\n  puts(zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  if (changdu1 < changdu2)\n    ;\n  else {\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      for (j = 0; j < changdu2; j++)\n        media[i][j] = x[i + j];\n    }\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      if (strcmp(media[i], y) == 0) {\n        p = i;\n        break;\n      }\n    }\n    if (i == changdu1 - changdu2 + 1)\n\n    {\n      printf(\"%s\", x);\n      return 0;\n    } else {\n      strcpy(media[p], z);\n      if (p != 0) {\n        for (i = 0; i < p; i++)\n          printf(\"%c\", x[i]);\n        printf(\"%s\", media[p]);\n        if (changdu2 > changdu3)\n          m = changdu2;\n        else\n          m = changdu3;\n        for (i = p + m; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      } else {\n        printf(\"%s\", media[p]);\n        for (i = p + changdu3; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12510", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len;\n  scanf(\"%s %s %s \", str, subStr, replace);\n  node = strstr(str, subStr);\n  if (node == NULL)\n    while (*start != '\\0')\n      cout << *start++;\n  else {\n    len = strlen(subStr);\n    while (start != node)\n      cout << *start++;\n    while (*rep != '\\0')\n      cout << *rep++;\n    node += len;\n    while (*node != '\\0')\n      cout << *node++;\n  }\n  printf(\"\\n\");\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "12511", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[100], b[100];\n  int i, j, h;\n  int n, m, result = 0;\n  int count;\n\n  cin >> str;\n  scanf(\"%s%s\", a, b);\n  n = strlen(str);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    if (str[i] == a[0]) {\n      h = i;\n      for (j = 0; j < m; j++) {\n        if (str[h + j] == a[j]) {\n          count++;\n        }\n      }\n      if (count == m) {\n        printf(\"%s\", b);\n        result = 1;\n        break;\n      }\n      if (count != m)\n        printf(\"%c\", str[i]);\n\n    } else\n      printf(\"%c\", str[i]);\n    if (result == 1)\n      break;\n  }\n  for (i = h + m; i < n; i++) {\n    printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], zi[256], r[256];\n  int lens, lenzi, lenr;\n  int i, k, p = 2;\n  scanf(\"%s %s %s\", &s, &zi, &r);\n  lens = strlen(s);\n  lenzi = strlen(zi);\n  lenr = strlen(r);\n  for (i = 0; i < lens; i++) {\n    if (s[i] == zi[0]) {\n      for (k = 1; k < lenzi; k++) {\n        if (s[i + k] == zi[k])\n          p = 0;\n        else {\n          break;\n        }\n      }\n      if (p == 0) {\n        for (k = 0; k < lenzi; k++)\n          s[i + k] = r[k];\n\n        printf(\"%s\", s);\n        break;\n      }\n    }\n  }\n  if (p == 2) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char t[256];\n  char c;\n  int i, ls, j, la, lt, g, word = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", t);\n  ls = strlen(s);\n  la = strlen(a);\n  lt = strlen(t);\n\n  for (i = 0; i < ls; i++) {\n    if (word == 0) {\n      g = 0;\n      if (s[i] == a[0]) {\n        g++;\n        for (j = i + 1; j < i + la; j++) {\n          if (s[j] == a[g]) {\n            g++;\n          }\n        }\n        if (g == la) {\n          word = 1;\n          for (j = i; j < i + la; j++) {\n            s[j] = t[j - i];\n          }\n        }\n      }\n    }\n  }\n\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[257 * 2], a[257], b[257];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, j, k, st, end;\n  st = 0;\n  end = 0;\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == a[0]) {\n      for (k = i + 1, j = 1; s1[k] != 0 && a[j] != 0; k++, j++) {\n        if (s1[k] != a[j])\n          break;\n      }\n      if (a[j] == 0) {\n        st = i;\n        end = k;\n        break;\n      }\n    }\n  }\n  if (st < end) {\n    if (strlen(a) > strlen(b)) {\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n      for (k = end; s1[k] != 0; k++, i++) {\n        s1[i] = s1[k];\n      }\n      s1[i] = 0;\n    } else {\n      i = strlen(s1) + strlen(b) - strlen(a);\n      for (k = strlen(s1); k >= end; k--, i--) {\n        s1[i] = s1[k];\n      }\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12515", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], b[256], c[256];\n  int i, j, k, n, m;\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  n = strlen(s) - strlen(b);\n  for (i = 0; i <= n; i++) {\n    m = 0;\n    for (j = 0, k = i; j < strlen(b); j++, k++) {\n      if (s[k] == b[j]) {\n        m++;\n      }\n    }\n    if (m == strlen(b)) {\n      for (j = i, k = 0; j < strlen(b) + i; j++, k++) {\n        s[j] = c[k];\n      }\n      break;\n    }\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, i, j, a = 0;\n  char str[256], sub[256], rep[256], word[256];\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  len = strlen(sub);\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < len; j++) {\n        word[j] = str[i + j];\n      }\n      word[len] = '\u0000';\n      if (strcmp(word, sub) == 0) {\n        strcpy(word, rep);\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", str[j]);\n        }\n        printf(\"%s\", word);\n        for (j = i + len; str[j] != 0; j++) {\n          printf(\"%c\", str[j]);\n        }\n        a = 1;\n        break;\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[1000], b[1000], c[1000];\nint main() {\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int len1, len2, p = 0, i, j;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    if (a[i] == b[0]) {\n      p = 1;\n      for (j = i; j < len2 + i; j++) {\n        if (a[j] != b[j - i]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (j = i; j < len2 + i; j++) {\n          a[j] = c[j - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n  for (i = 0; i < n - k + 2; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (dec == 0) {\n      printf(\"%s\", rep);\n      break;\n    } else if ((i != n - 1) && (dec != 0)) {\n      cout << zfc[i];\n      continue;\n    } else if ((i == n - 1) && (dec != 0))\n      printf(\"%c \", zfc[i]);\n  }\n  if (i == n - k + 2) {\n    printf(\"%s \", &(zfc[i]));\n  } else {\n    printf(\"%s \", &(zfc[i + k]));\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char su[100], zu[100], tu[100];\n\n  cin >> su;\n\n  cin >> zu;\n\n  scanf(\"%s \", tu);\n  int i, j, k, t;\n  for (i = 0; i < strlen(su); i++) {\n    for (k = 0, j = i; su[j] == zu[k]; j++, k++)\n      if (k == strlen(zu))\n        break;\n    if (k == strlen(zu))\n      break;\n  }\n\n  if (j != i - 1) {\n    for (t = 0; t < i; t++)\n      printf(\"%c\", su[t]);\n    printf(\"%s\", tu);\n    for (t = j; t < strlen(su); t++)\n      printf(\"%c\", su[t]);\n  } else\n    printf(\"%s\", su);\n  return 0;\n}\n"}
{"label": "7", "index": "12520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  cin >> a >> b >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  for (i = 0; i < la; i++) {\n    cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str1[257], str2[257], str3[257];\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n\n  int i;\n  int j;\n  int k;\n  for (i = 0; i < strlen(str1); i++) {\n    j = 0;\n    k = i;\n    while (j < strlen(str2)) {\n      if (str2[j] != str1[k])\n        break;\n      else\n        j++;\n      k++;\n    }\n    if (j == strlen(str2)) {\n      cout << str3;\n      break;\n    } else\n      printf(\"%c\", str1[i]);\n  }\n  if (i != strlen(str1))\n    for (i = k; i < strlen(str1); i++)\n      printf(\"%c\", str1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12522", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  scanf(\"%s %s %s \", a, b, c);\n  char *p, *q;\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL)\n    cout << a;\n  else {\n    while (q != p) {\n      cout << *q;\n      q++;\n    }\n    cout << c;\n    q = q + strlen(c);\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  int a1, b1, c1;\n  int i, j, k;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i <= a1 - 1; i++) {\n    for (j = 0; j <= b1 - 1; j++) {\n      if (a[i + j] != b[j])\n        break;\n    }\n    if (j == b1) {\n      break;\n    }\n  }\n\n  if (i >= a1)\n    printf(\"%s\", a);\n  else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", a[k]);\n    }\n    printf(\"%s\", c);\n    for (k = i + b1; k <= a1 - 1; k++)\n      printf(\"%c\", a[k]);\n  }\n}\n"}
{"label": "7", "index": "12524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int i, r1, r2, r3, j, q, h = 0, result = 0;\n  cin >> str;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", rep);\n  r1 = strlen(str);\n  r2 = strlen(sub);\n  r3 = strlen(rep);\n  for (i = 0; i < r1; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < r2; j++) {\n        if (str[i + j] != sub[j])\n          break;\n      }\n      if (j == r2) {\n        result = 1;\n        for (q = i; q < i + r3; q++) {\n          str[q + r3] = str[q + r2];\n          str[q] = rep[h];\n          h++;\n        }\n        printf(\"%s\", str);\n        break;\n      }\n    }\n  }\n  if (result == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, n, m, k, p, q, z = 0;\n  char a[260], b[260], c[260], d[260];\n\n  scanf(\"%s%s%s\", a, b, c);\n  n = strlen(a);\n  m = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (k = 0; k < m; k++) {\n        d[k] = a[k + i];\n      }\n      d[k] = '\\0';\n      if (strcmp(b, d) == 0) {\n        for (p = 0; p < i; p++) {\n          printf(\"%c\", a[p]);\n        }\n        printf(\"%s\", c);\n        for (p = i + q; p < (n - m + q); p++) {\n          printf(\"%c\", a[p]);\n        }\n        z = 1;\n        break;\n      }\n    }\n  }\n\n  if (z == 0) {\n    printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  a[lena] = '\\0';\n  int x, s;\n  for (i = 0; i < lena; i++) {\n    x = -1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        x = 0;\n        break;\n      }\n    }\n    if (x != 0) {\n      s = i;\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = s + lenb; i < lena; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[600], subStr[260], rep[260];\n  memset(str, 0, sizeof(str));\n  scanf(\"%s%s%s\", str, subStr, rep);\n  char *pos = strstr(str, subStr);\n  if (pos != NULL) {\n    int len = strlen(rep);\n    for (int i = 0; i < len; i++) {\n      *pos++ = rep[i];\n    }\n  }\n  cout << str;\n}\n"}
{"label": "7", "index": "12528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z;\n  char a[256], b[50], c[50];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i <= x - y; i++) {\n    for (j = i; j < i + y; j++) {\n      if (a[j] != b[j - i])\n        break;\n    }\n    if (j == i + y) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < z; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + y; j < x; j++) {\n        printf(\"%c\", a[j]);\n      }\n      break;\n    }\n  }\n  if (i == x - y + 1) {\n    puts(a);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char st[300], sub[300], re[300], c[300], sz[300];\n  int i, j, k, t, u;\n  scanf(\"%s%s%s\", st, sub, re);\n  for (i = 0; i <= strlen(st) - strlen(sub); i++) {\n    u = 0;\n    k = 0;\n    t = 0;\n    strcpy(sz, st);\n    for (j = i; j <= (i + strlen(sub) - 1); j++) {\n      c[k] = sz[j];\n      k++;\n    }\n    c[k] = '\\0';\n    if (strcmp(c, sub) == 0) {\n      for (j = i; j <= (i + strlen(sub) - 1); j++) {\n        sz[j] = re[t];\n        t++;\n      }\n      cout << sz;\n      u = 1;\n      break;\n    }\n  }\n  if (u == 0)\n    printf(\"%s\", st);\n}\n"}
{"label": "7", "index": "12530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[300] = {\"\u0000\"};\n  char sub[300] = {\"\u0000\"};\n  char re[300] = {\"\u0000\"};\n  char t[300];\n  char pre[300] = {\"\u0000\"};\n  char post[300] = {\"\u0000\"};\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int i, j;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < 299; j++)\n        t[j] = '\u0000';\n      for (j = 0; j < strlen(sub); j++)\n        t[j] = str[i + j];\n      if (strcmp(t, sub) == 0) {\n        for (j = 0; j < i; j++)\n          pre[j] = str[j];\n        for (j = i + strlen(sub); j < strlen(str); j++)\n          post[j - i - strlen(sub)] = str[j];\n        cout << pre << re << post << \" \";\n        return 0;\n      }\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[30000], b[100], c[100];\n\n  scanf(\"%s \", a);\n  int lenth, y = 1, j, i, m, num, tag = 0;\n  lenth = strlen(a);\n\n  scanf(\"%s \", b);\n  m = strlen(b);\n\n  cin >> c;\n  for (i = 0; i < lenth; i += y) {\n    y = 1;\n    num = 0;\n    if (tag == 0) {\n      for (j = 0; j < m; j++) {\n        if (a[i + j] == b[0 + j]) {\n          num++;\n        }\n      }\n      if (num == m) {\n        printf(\"%s\", c);\n        y = m;\n        tag = 1;\n      } else {\n        cout << a[i];\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12532", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[300], substring[300], replacement[300], test[300];\n  int lensub, len, i, j;\n  cin >> string >> substring >> replacement;\n  len = strlen(string);\n  lensub = strlen(substring);\n  for (i = 0; i <= len - lensub; i++) {\n    for (j = 1; j <= lensub; j++) {\n      test[j - 1] = string[i + j - 1];\n      test[j] = '\\0';\n    }\n    if (strcmp(test, substring) != 0) {\n      printf(\"%c\", string[i]);\n    } else {\n      printf(\"%s\", replacement);\n      i += lensub;\n      break;\n    }\n  }\n  for (; i <= len - 1; i++) {\n    printf(\"%c\", string[i]);\n  }\n}\n"}
{"label": "7", "index": "12533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], s2[256], ss[20], re[20];\n  int i, j, x = 0, y = 0, a, flag = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", ss, re);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ss[0]) {\n      s1[x] = s[i];\n      x++;\n    } else if (s[i] == ss[0]) {\n      a = i;\n      flag = 1;\n      for (j = 0; ss[j] != '\u0000'; j++) {\n        if (ss[j] != s[a]) {\n          flag = 0;\n        }\n        a++;\n      }\n      if (flag == 0) {\n        s1[x] = s[i];\n        x++;\n      }\n    }\n    if (flag == 1) {\n      s1[x] = '\u0000';\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i += strlen(ss); s[i] != '\u0000'; i++) {\n      s2[y] = s[i];\n      y++;\n    }\n  }\n  s2[y] = '\u0000';\n  if (flag == 1) {\n    printf(\"%s%s%s\", s1, re, s2);\n  }\n  if (flag == 0) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12534", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar s1[10000], s2[10000], s[10000];\nint Len(char *s) {\n  int i;\n  for (i = 0; s[i]; i++)\n    ;\n  return i;\n}\nint Match(char *s1, char *s2) {\n  int i, l = Len(s2);\n  for (i = 0; i < l; i++)\n    if (s1[i] != s2[i])\n      return 0;\n  return 1;\n}\nint Find(char *s, char *s1) {\n  int i, l = Len(s);\n  for (i = 0; i < l; i++)\n    if (Match(s + i, s1))\n      return i;\n  return l;\n}\nint main() {\n  int l, i, t;\n  cin >> s >> s1 >> s2;\n  l = Len(s);\n  t = Find(s, s1);\n  if (t == l)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < t; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"%s\", s2);\n    for (i = Len(s1) + t; i < l; i++)\n      printf(\"%1c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  scanf(\"%s %s %s \", str, subString, replacement);\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    if (repLen == subLen) {\n      i = 0;\n      while (i < repLen) {\n        *p++ = *q++;\n        i++;\n      }\n    } else {\n      i = 0;\n      while (i < repLen) {\n        *p++ = *q++;\n        i++;\n      }\n      move = subLen - repLen;\n      while (*(p + move) != '\\0') {\n        *p++ = *(p + move);\n      }\n      *p = '\\0';\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len1, len2, len3, i, j, m, p, flag = 0;\n  char str1[300], str2[50], str3[50];\n  cin.getline(str1, 300);\n  cin.getline(str2, 50);\n  cin.getline(str3, 50);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i <= len1 - len2; i++) {\n    flag = 0;\n    m = i;\n    for (j = 0; j < len2; j++) {\n      if (str1[m++] != str2[j]) {\n        break;\n      }\n    }\n    if (j == len2) {\n      for (p = 0; p < i; p++)\n        cout << str1[p];\n      cout << str3;\n      printf(\"%s\\n\", str1 + i + len2);\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << str1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, z = 1, l = 0, flag = 0;\n  int i = 0, k = 0, num = 0, j = 0;\n  char s[256] = {0}, w[256] = {0}, mid[256] = {0}, out[256] = {0}, p[256] = {0};\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> p;\n  n = strlen(s);\n  m = strlen(w);\n  for (; l < m - 1;) {\n    for (i = 0; i < n; i++, k++) {\n      mid[i] = w[k];\n    }\n    z++;\n    k = z;\n    num++;\n    if (strcmp(mid, s) == 0) {\n      flag = 1;\n      break;\n    }\n    l++;\n  }\n\n  if (flag == 0) {\n    puts(w);\n  } else {\n    j = num;\n    for (i = 0; i < n; i++, j++)\n      w[j] = p[i];\n\n    puts(w);\n  }\n}\n"}
{"label": "7", "index": "12538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  scanf(\"%s %s %s \", str, sub, rep);\n  char *p = strstr(str, sub), *temp1, *temp2;\n  if (p == NULL)\n    printf(\"%s\", str);\n  else {\n    temp1 = p, temp2 = rep;\n    while (*temp2 != '\\0') {\n      *temp1 = *temp2;\n      temp1++, temp2++;\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12539", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000];\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s\", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      mubiao[i] = replace[j];\n\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12540", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char a[300], b[300], replace[300];\n  cin >> a >> b >> replace;\n  char *p;\n  int alen, blen, relen, i, j;\n  p = strstr(a, b); \n  if (p == NULL)    \n    cout << a << endl;\n  else \n  {\n    alen = strlen(a);\n    blen = strlen(b);\n    relen = strlen(replace);\n    for (i = 0; &a[i] != p; i++) \n      cout << a[i];\n    cout << replace;\n    i += blen;\n    for (; i < alen - blen + relen; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, count = 0, h;\n  char a[260], b[260], c[260];\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n\n  for (i = 0; i <= strlen(a) - 1; i++) {\n    if (a[i] == b[j]) {\n      count += 1;\n      j += 1;\n    } else {\n      j = 0;\n      count = 0;\n    }\n    if (count == strlen(b)) {\n      h = i;\n      break;\n    }\n  }\n  if (count == strlen(b)) {\n    for (i = 0; i <= h - strlen(b); i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = 0; i <= strlen(c) - 1; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = h + 1; i <= strlen(a) - 1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\", a);\n  }\n}\n"}
{"label": "7", "index": "12542", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, l, m, e = 0;\n  char *str;\n\n  memset(s, 0, 100);\n  memset(a, 0, 100);\n  memset(b, 0, 100);\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l = strlen(a);\n  m = strlen(s);\n  str = s;\n\n  for (i = 0; i <= m - l; i++) { \n    e = 0;\n    for (j = 0; j < l; j++) {\n      if (s[i + j] != a[j]) {\n        e++;\n        break;\n      }\n    }\n    \n\n    if (e == 0) {\n      s[i] = '\u0000';\n      printf(\"%s\", str);\n      printf(\"%s\", b);\n      str = s + i + j;\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char mc[1000], zc[1000], huan[1000];\n  int len1, len2, len3, i, j = 0;\n  int sum = 0, ci = 0, loc;\n  cin >> mc >> zc >> huan;\n  len1 = strlen(mc);\n  len2 = strlen(zc);\n  len3 = strlen(huan);\n  for (i = 0; i < len1; i++) {\n    if (mc[i] == zc[0]) {\n      sum = 0;\n      for (j = i; j < len1; j++) {\n        if (mc[j] == zc[j - i]) {\n          sum++;\n        } else {\n          break;\n        }\n      }\n      loc = i;\n      if (sum == len2) {\n        for (i = 0; i < loc; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        for (i = loc; i <= loc + len3 - 1; i++) {\n          cout << huan[i - loc];\n        }\n        for (i = loc + len3; i <= len1 + len3 - len2 - 1; i++) {\n          printf(\"%c\", mc[i]);\n        }\n        ci++;\n        break;\n      }\n    }\n  }\n\n  if (ci == 0) {\n    printf(\"%s\", mc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin >> string >> substring >> replacement;\n  int i, j = 0, length1, length2, m, num = 0;\n  length1 = strlen(string);\n  length2 = strlen(substring);\n  for (i = 0; i < length1; i++) {\n    m = i;\n    if (string[i] == substring[j]) {\n\n      for (j = 0; j < length2; j++) {\n        if (string[i] == substring[j]) {\n          i++;\n          num++;\n        }\n      }\n    }\n    j = 0;\n    i = m;\n    if (num == length2) {\n      for (j = 0; j < length2; j++) {\n        string[i] = replacement[j];\n        i++;\n      }\n      break;\n    }\n    num = 0;\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char S[100], sub[100], replace[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(replace);\n  int k, m;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", replace);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n  return 0;\n}\n"}
{"label": "7", "index": "12546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sl, al, i, j, flag = 0;\n  char s[256], a[256], b[256];\n  scanf(\"%s %s %s\", s, a, b);\n  sl = strlen(s);\n  al = strlen(a);\n  for (i = 0; i < sl; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < al; j++) {\n        if (s[i + j] == a[j])\n          flag = 1;\n        else\n          flag = 0;\n        continue;\n      }\n      if (flag == 1) {\n        for (j = 0; j < al && s[i + j] == a[j]; j++)\n          s[i + j] = b[j];\n        break;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  char *p, *q, *k;\n  cin.getline(a, 260);\n  cin.getline(b, 260);\n  cin.getline(c, 260);\n  int lenb = strlen(b), flag = 0, t = 0, i;\n  p = a;\n  q = a;\n  k = b;\n  while (*p != '\\0') {\n    if (*q == *k) {\n      q++;\n      k++;\n      if (*k == '\\0') {\n        flag = 1;\n        for (i = 0; i < t; i++)\n          cout << a[i];\n        cout << c;\n        for (i = t + lenb; a[i] != '\\0'; i++)\n          cout << a[i];\n        cout << endl;\n        break;\n      }\n    } else {\n      p++;\n      q = p;\n      k = b;\n      t++;\n    }\n  }\n  if (flag == 0)\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int l1, i, j, n;\n  int flag;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  cin >> b;\n  l1 = strlen(a);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      for (j = i + 1; j < (i + l1); j++) {\n        if (s[j] != a[j - i])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (n = 0; n < i; n++)\n          cout << s[n];\n        printf(\"%s\", b);\n        for (n = i + l1; s[n] != '\\0'; n++)\n          printf(\"%c\", s[n]);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12549", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[300], sub[300], rep[300], tmp[300];\n  cin >> str >> sub >> rep;\n  int i, j, l1 = strlen(str), l2 = strlen(sub), l3 = strlen(rep);\n  int flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      tmp[j] = str[j + i];\n    }\n    tmp[l2] = '\\0';\n    if (strcmp(tmp, sub) == 0 && flag == 0) {\n      printf(\"%s\", rep);\n      flag = 1;\n      i += l2 - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "12550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, j = 0, l1, l2, e = 0;\n  char a[256], b[256], c[256], d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  l1 = strlen(b);\n  l2 = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (e == 0) {\n      if (a[i] == b[j]) {\n        d[j] = a[i];\n        j++;\n      } else {\n        if (j != 0 && e != 1) {\n          d[j] = '\\0';\n          printf(\"%s\", d);\n        }\n        j = 0;\n        printf(\"%c\", a[i]);\n      }\n      if (j == l1 && e == 0) {\n        printf(\"%s\", c);\n        i = i - l1 + l2;\n        e = 1;\n      }\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], ow[256], rw[256];\n  scanf(\"%s%s%s\", s, ow, rw);\n  int lens, lenow;\n  int i, j, k, l, t, flag;\n  lens = strlen(s);\n  lenow = strlen(ow);\n  for (i = 0; i <= (lens - lenow); i++) {\n    flag = 1;\n    for (j = 0; j < lenow; j++) {\n      if (s[i + j] != ow[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag != 0) {\n      t = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (k = 0; k < t; k++) {\n      printf(\"%c\", s[k]);\n    }\n    printf(\"%s\", rw);\n    for (l = t + lenow; l < lens; l++) {\n      printf(\"%c\", s[l]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sr[1000];\n\n  cin >> sr;\n  char a[1000], b[1000];\n  scanf(\"%s%s\", a, b);\n  int len, ken;\n  len = strlen(sr);\n  ken = strlen(a);\n  int i, j, k, m;\n  m = 0;\n\n  for (i = 0; i < len; i++) {\n    if (sr[i] == a[0]) {\n      j = i;\n      for (k = 0; k < ken; k++)\n        if (sr[k + j] == a[k])\n          m = 1;\n        else if (sr[k + j] != a[k]) {\n          m = 0;\n          break;\n        }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m == 0) {\n    printf(\"%s\", sr);\n  }\n  char c[1000], d[1000];\n  if (m == 1) {\n    for (i = 0; i < j; i++) {\n      c[i] = sr[i];\n    }\n    c[j] = '\u0000';\n    if (j + ken == len) {\n      cout << c << b;\n    }\n    if (j + ken < len) {\n      for (i = j + ken; i < len; i++) {\n        d[i - j - ken] = sr[i];\n      }\n      d[len - j - ken] = '\u0000';\n      printf(\"%s%s%s\", c, b, d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char c[3][300];\n  int l1, l2, i = 0, j = 0, k = 0, n;\n  scanf(\"%s\", c[0]);\n  scanf(\"%s\", c[1]);\n  scanf(\"%s\", c[2]);\n\n  l1 = strlen(c[0]);\n  l2 = strlen(c[1]);\n\n  while (i < l1) {\n    if (k == l2)\n      break;\n    if (c[0][i] == c[1][j]) {\n      k += 1;\n      j += 1;\n      i += 1;\n    } else {\n      if (j < l2 - 1) {\n        k = 0;\n        j += 1;\n      }\n      if (j == l2 - 1) {\n        k = 0;\n        j = 0;\n        i += 1;\n      }\n    }\n  }\n\n  if (k == l2) {\n    for (n = i - l2; n < i; n++) {\n      c[0][n] = c[2][n + l2 - i];\n    }\n  }\n  printf(\"%s\\n\", c[0]);\n}\n"}
{"label": "7", "index": "12554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    cout << a;\n  else {\n    for (i = flag; i <= flag + len2 - 1; i++)\n      a[i] = c[i - flag];\n    for (i = 0; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, j = 0, l1, l2, e = 0;\n  char a[256], b[256], c[256], d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  l1 = strlen(b);\n  l2 = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (e == 0) {\n      if (a[i] == b[j]) {\n        d[j] = a[i];\n        j++;\n      } else {\n        if (j != 0 && e != 1) {\n          d[j] = '\\0';\n          printf(\"%s\", d);\n        }\n        j = 0;\n        cout << a[i];\n      }\n      if (j == l1 && e == 0) {\n        printf(\"%s\", c);\n        i = i - l1 + l2;\n        e = 1;\n      }\n    } else {\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12556", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr);\n  if (node == NULL)\n    while (*start != '\\0')\n      printf(\"%c\", *start++);\n  else {\n    len = strlen(subStr);\n    while (start != node)\n      cout << *start++;\n    while (*rep != '\\0')\n      printf(\"%c\", *rep++);\n    node += len;\n    while (*node != '\\0')\n      cout << *node++;\n  }\n  printf(\"\\n\");\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "12557", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n, l;\n  char s[256], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == a[0]) {\n      k = i;\n      l = i;\n      for (j = 0; j < strlen(a); j++, k++) {\n        if (a[j] != s[k]) {\n          break;\n        }\n      }\n      if (j == strlen(a)) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (n = l + strlen(a); n < strlen(s); n++) {\n      printf(\"%c\", s[n]);\n    }\n  } else if (m == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid right(char a[], int l, int t) {\n  int i;\n  for (i = l; i >= t; i--)\n    a[i] = a[i - 1];\n  a[l + 1] = '\\0';\n}\nvoid left(char a[], int l, int t) {\n  int i;\n  for (i = t; i <= l; i++)\n    a[i - 2] = a[i - 1];\n  a[l - 1] = '\\0';\n}\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, l1, l2, l3, d, e, s, r;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  if (l2 > l3) {\n    s = 1;\n    r = l2 - l3;\n  } else if (l2 == l3)\n    s = r = 0;\n  else {\n    s = -1;\n    r = l3 - l2;\n  }\n  for (i = 1; i <= l1; i++) {\n    e = a[i - 1] - b[0];\n    if (e == 0) {\n      d = 0;\n      for (j = 1; j <= l2 - 1; j++) {\n        e = a[i + j - 1] - b[j];\n        if (e != 0)\n          d = 1;\n      }\n      if (d == 0) {\n        for (j = 1; j <= r; j++) {\n          if (s > 0)\n            left(a, l1, i + l2);\n          if (s < 0)\n            right(a, l1, i);\n        }\n        for (j = 1; j <= l3; j++)\n          a[i + j - 2] = c[j - 1];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12559", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char string[300];\n  char substring[300];\n  char replace[300];\n  cin >> string;\n  cin >> substring;\n  cin >> replace;\n  int l = strlen(string);\n\n  int l2 = strlen(replace);\n  char *p = strstr(string, substring);\n  if (p != NULL) {\n    while (i < l2) {\n      *p = replace[i];\n      i++;\n      p++;\n    }\n  }\n  cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "12560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  cin >> str >> subString >> replacement;\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else if (repLen == subLen) {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    move = subLen - repLen;\n    while (*(p + move) != '\\0')\n      *p++ = *(p + move);\n\n    *p = '\\0';\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[512], w[257], r[257];\n  int m, n;\n  int i, j, k;\n  int t;\n  scanf(\"%s%s%s\", s, w, r);\n  m = strlen(s);\n  n = strlen(w);\n  for (i = 0; i <= m - n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      if (w[j] != s[i + j])\n        t = 1;\n    }\n    if (t == 0) {\n      break;\n    }\n  }\n  if (t == 0) {\n    for (k = i; k <= i + n - 1; k++) {\n      s[k] = r[k - i];\n    }\n    printf(\"%s\", s);\n  } else {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], t[256], h[256];\n  scanf(\"%s %s %s\", s, t, h);\n  int ss = strlen(s), tt = strlen(t);\n  int i, j, count = 0, place = -1;\n  for (i = 0; i < ss; i++) {\n    count = 0;\n    for (j = 0; j < tt; j++) {\n      if (t[j] - s[i + j] == 0)\n        count++;\n    }\n    if (count == tt) {\n      place = i;\n      break;\n    }\n  }\n  if (place == -1)\n    printf(\"%s\", s);\n  else {\n    for (i = 0; i < place; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", h);\n    for (i = place + tt; i < ss; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n, l;\n  char s[256], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == a[0]) {\n      k = i;\n      l = i;\n      for (j = 0; j < strlen(a); j++, k++) {\n        if (a[j] != s[k]) {\n          break;\n        }\n      }\n      if (j == strlen(a)) {\n        m = 1;\n        break;\n      }\n    }\n  }\n  if (m == 1) {\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (n = l + strlen(a); n < strlen(s); n++) {\n      printf(\"%c\", s[n]);\n    }\n  } else if (m == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2) {\n      for (j = 0; j < len2; j++)\n        s1[i + j] = s3[j];\n      c++;\n    }\n    if (c == 1)\n      break;\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[256], substring[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  scanf(\"%s %s %s\", string, substring, replacement);\n  int mainlen = strlen(string), sublen = strlen(substring);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, substring)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12566", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, length2, length1;\n  char str[300], sub[300], rep[300];\n\n  scanf(\"%s \", str);\n  cin >> sub;\n  cin >> rep;\n  length1 = strlen(str);\n  length2 = strlen(sub);\n  for (i = 0; i < length1; i++) {\n    for (j = 0; j < length2; j++) {\n      if (sub[j] != str[i + j])\n        break;\n    }\n    if (j == length2) {\n      for (j = 0; j < length2; j++)\n        str[i + j] = rep[j];\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char st[351], su[351], re[551], reh[551];\n  int a, b, c, e, r, lu, lr;\n\n  scanf(\"%s\", st);\n  scanf(\"%s\", su);\n  scanf(\"%s\", re);\n  r = -1;\n  for (a = 0; a < strlen(st); a++) {\n    e = 1;\n    for (b = 0; b < strlen(su); b++) {\n      if (st[a + b] != su[b]) {\n        e = 0;\n      }\n    }\n    if (e) {\n      r = a;\n\n      break;\n    }\n  }\n  if (r + 1) {\n    for (a = 0; a < r; a++) {\n      reh[a] = st[a];\n    }\n    for (a = 0; a < strlen(su); a++) {\n      reh[r + a] = re[a];\n    }\n    lu = strlen(su);\n    lr = strlen(re);\n    for (a = r + lu; a <= 530; a++) {\n      reh[lr + a - lu] = st[a];\n    }\n\n    cout << reh;\n\n  } else {\n    cout << st;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int q, w, e;\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  int i, j, k;\n  int result = 1, d;\n  for (k = 0; k < q; k++) {\n    if (a[k] == b[0]) {\n      result = 1;\n      for (i = k, j = 0; i < w + k, j < w; i++, j++) {\n        d = a[i] - b[j];\n        if (d != 0)\n          result = 0;\n      }\n      if (result) {\n        for (i = k, j = 0; j < e, i < w + k; i++, j++)\n          a[i] = c[j];\n\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], a[100], b[100];\n  int i = 0, z = 0, c = 0, d, j, f, e;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  c = strlen(a);\n  e = strlen(s);\n  while (i < e) {\n    if (s[i] == a[z]) {\n      f = 0;\n      for (d = i; d < i + c; d++) {\n        if (s[d] == a[z]) {\n          f++;\n          z++;\n        }\n      }\n      if (f == c) {\n        z = 0;\n        for (d = i; d < i + c; d++) {\n          s[d] = b[z];\n          z++;\n        }\n        break;\n      } else {\n        z = 0;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < e; i++) {\n    printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[50], rep[50];\n  int i, j, t, k;\n  int len_s, len_sub;\n  cin.getline(s, 257);\n  cin.getline(sub, 50);\n  cin.getline(rep, 50);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, a;\n  char s[1000], s1[1000], s2[1000];\n  char *ps1 = s1, *ps2 = s2;\n\n  cin >> s2;\n\n  scanf(\"%s \", s1);\n\n  cin >> s;\n  int l1 = strlen(s1);\n  int l2 = strlen(s2);\n  for (a = 0, b = 0; a < l2 && b == 0; a = i + 1) {\n    for (i = a, ps1 = s1, ps2 = s2 + a;\n         *ps1 != *ps2 && *ps1 != '\u0000' && *ps2 != '\u0000'; ps2++, i++)\n      ;\n    for (j = 0, b = 1; *ps1 != '\u0000' && *ps2 != '\u0000'; ps1++, ps2++, j++) {\n      if (*ps1 != *ps2 && j < l1) {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (i == l2)\n    printf(\"%s\", s2);\n  else {\n    n = i;\n    s2[n] = '\u0000';\n    printf(\"%s\", s2);\n    printf(\"%s\", s);\n    ps2 = s2 + n + l1;\n    printf(\"%s\", ps2);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], sub[500], rep[500];\n  int n, m, cut, i = 0, flag = 0;\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  cut = strlen(rep);\n  while (str[i] != '\\0') {\n    if (str[i] == sub[0]) {\n      int j = 0;\n      int k = i;\n      while (sub[j] != '\\0') {\n        if (sub[j] == str[k]) {\n          j++;\n          k++;\n        } else\n          break;\n      }\n      if (j == m) {\n        for (int t = n - 1; t >= i + m; t--) {\n          str[t + cut - m] = str[t];\n        }\n        str[n + cut - m] = '\\0';\n        for (int t = i; t < i + cut; t++)\n          str[t] = rep[t - i];\n\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    i++;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  int L, l, x, y;\n  L = strlen(a);\n  l = strlen(b);\n  for (x = 0; x <= L - l; x++) {\n    if (a[x] != b[0])\n      continue;\n    else {\n      for (y = 0; y < l; y++)\n        if (a[x + y] != b[y])\n          break;\n      if (y != l)\n        continue;\n      else {\n        break;\n      }\n    }\n  }\n  if (x == L - l + 1)\n    cout << a << endl;\n  else {\n    int i = 0;\n    while (i != x) {\n      cout << a[i];\n      i++;\n    }\n    cout << c;\n    cout << a + i + l << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12574", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < len; ++i)\n    if (c[i] == a[0]) {\n      flag = 1;\n      for (j = 0; j < lena && i + j < len; ++j)\n        if (a[j] != c[i + j]) {\n          flag = 0;\n          break;\n        }\n      if (flag) {\n        printf(\"%s\", b);\n        i += lena;\n        break;\n      } else\n        printf(\"%c\", c[i]);\n    } else\n      printf(\"%c\", c[i]);\n  printf(\"%s\", c + i);\n  return 0;\n}\n"}
{"label": "7", "index": "12575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, k, j, r = 0, m = 0;\n  int lens, lena;\n  char s[256], a[100], b[100], c[100], d[100];\n  cin >> s >> a >> b;\n  lens = strlen(s);\n  lena = strlen(a);\n  for (i = 0; i < lens; i++) {\n    m = 0;\n    for (k = i; k < i + lena; k++) {\n      if (a[k - i] != s[k])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++)\n        c[n] = s[n];\n      c[n] = '\\0';\n      for (j = i + lena; j < lens; j++)\n        d[j - i - lena] = s[j];\n      d[j - i - lena] = '\\0';\n      r = 1;\n      printf(\"%s%s%s\", c, b, d);\n      break;\n    }\n  }\n  if (r == 0)\n    cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[1000], w[1000], h[1000];\n  int len_1, len_2, len_3, i, j, k = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", w);\n  scanf(\"%s\", h);\n  len_1 = strlen(s);\n  len_2 = strlen(w);\n  len_3 = strlen(h);\n  for (j = 0; j < len_1; j++) {\n    if (s[j] == w[0]) {\n      for (i = 1; i < len_2; i++)\n        if (s[j + i] != w[i])\n          break;\n      if (i == len_2) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k) {\n    for (k = 0; k < j; k++)\n      printf(\"%c\", s[k]);\n    for (k = 0; k < len_3; k++)\n      cout << h[k];\n    for (k = j + len_3; k < len_1; k++)\n      printf(\"%c\", s[k]);\n    printf(\" \");\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[257] = {'0'}, sub[257] = {'0'}, rep[257] = {'0'}, temp[257] = {'0'};\n  scanf(\"%s%s%s\", s, sub, rep);\n  int i, j, k, len1, len2, time;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, i++) {\n      temp[j] = s[i];\n    }\n    i = k;\n    if (strcmp(temp, sub) == 0) {\n      time = i;\n      break;\n    }\n  }\n  if (strcmp(temp, sub) == 0) {\n    for (i = time, j = 0; i < time + len2; i++, j++) {\n      s[i] = rep[j];\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[300] = {0};\n  char tar[300] = {0};\n  char rep[300] = {0};\n  char result[300] = {0};\n\n  int len1, len2, ischange = 0;\n  int index1 = 0, i, index2 = 0;\n\n  scanf(\"%s \", zfc);\n\n  scanf(\"%s \", tar);\n  len1 = strlen(tar);\n\n  cin >> rep;\n  len2 = strlen(rep);\n\n  while (zfc[index1] != '\u0000') {\n    ischange = 1;\n    for (i = 0; i < len1; i++) {\n      if (zfc[index1 + i] != tar[i]) {\n        ischange = 0;\n        break;\n      }\n    }\n    if (ischange) {\n      for (i = 0; i < len2; i++) {\n        result[index2 + i] = rep[i];\n      }\n      index2 += len2;\n      index1 += len1;\n      while (zfc[index1] != '\u0000') {\n        result[index2] = zfc[index1];\n        index2++;\n        index1++;\n      }\n      break;\n    }\n    result[index2] = zfc[index1];\n    index2++;\n    index1++;\n  }\n  printf(\"%s\", result);\n  return 0;\n}\n"}
{"label": "7", "index": "12579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], substr[256], replace[256];\n  scanf(\"%s %s %s \", str, substr, replace);\n  int lenstr = strlen(str), lensubstr = strlen(substr);\n  int i, j;\n  int flag = 0;\n  int pos;\n  for (i = 0; i <= lenstr - lensubstr; i++) {\n    for (j = 0; j < lensubstr; j++) {\n      if (str[i + j] != substr[j])\n        break;\n    }\n    if (j == lensubstr) {\n      pos = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < pos; i++)\n      cout << str[i];\n    cout << replace;\n    cout << (str + pos + lensubstr) << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12580", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, mm = 0;\n  char string1[1000 + 10];\n  char subString[1000 + 10];\n  char replacement[1000 + 10];\n  for (k = 0; k < 1000 + 10; k++) {\n    string1[k] = '0';\n    subString[k] = '0';\n    replacement[k] = '0';\n  }\n  scanf(\"%s\", string1);\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n  int len1 = strlen(string1);\n  int len2 = strlen(subString);\n  int len3 = strlen(replacement);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    sum = 0;\n    if (string1[i] == subString[0]) {\n      for (j = 0; j < len2; j++) {\n        if (subString[j] == string1[i + j])\n          sum++;\n      }\n\n      if (sum == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string1[k]);\n        for (k = 0; k < len3; k++)\n          printf(\"%c\", replacement[k]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string1[k]);\n      }\n\n      if (sum == len2)\n        break;\n    }\n  }\n  if (i == len1 - len2 + 1)\n    for (k = 0; k < len1; k++)\n      printf(\"%c\", string1[k]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char an[256], be[256], ce[256];\n  int i, j, m, n, k = 0, h;\n\n  scanf(\"%s \", an);\n\n  cin >> be;\n\n  cin >> ce;\n  m = strlen(an);\n  n = strlen(be);\n  h = strlen(ce);\n  for (i = 0; i < m; i++) {\n\n    if (an[i] == be[0]) {\n      for (j = 1; j < n; j++) {\n        if (be[j] != an[i + j]) {\n          break;\n        }\n      }\n      if (j == n) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", an[k]);\n        for (k = 0; k < h; k++) {\n          printf(\"%c\", ce[k]);\n        }\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", an[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (k != m) {\n    printf(\"%s\", an);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n  scanf(\"%s\", &q);\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  int i = 0, j = 0, k = 0, s = 0, p = 0, qc, ac, bc, r, js = 0, sz[100] = {0},\n      x, y, z, npc;\n  qc = strlen(q);\n  ac = strlen(a);\n  bc = qc - ac;\n  for (i = 0; i < bc + 1; i++) {\n\n    for (j = 0; j < ac; j++) {\n      xc[i][j] = q[j + k];\n    }\n    k++;\n    p = strcmp(xc[i], a);\n    if (p == 0) {\n      sz[js] = i;\n      js++;\n    }\n  }\n  npc = sz[0];\n\n  if (js == 0) {\n    printf(\"%s \", q);\n  }\n  if (js != 0) {\n    for (x = 0; x < npc; x++) {\n      cout << q[x];\n    }\n    printf(\"%s\", b);\n    for (z = npc + ac; z < qc; z++) {\n      printf(\"%c\", q[z]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, m, k, N, j, p, n = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  N = strlen(a) - strlen(b);\n  p = strlen(b);\n  for (k = 0; k <= N; k++) {\n    m = 0;\n    for (i = 0; i < 256; i++) {\n      if (a[i + k] == b[i]) {\n        m++;\n      }\n      if (a[i + k] == '\u0000') {\n        break;\n      }\n      if (b[i] == '\u0000') {\n        break;\n      }\n      if (m >= p - 1) {\n        break;\n      }\n    }\n\n    if (m >= p - 1) {\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; c[j] != '\u0000'; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = k + m + 1; a[j] != '\u0000'; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\"\u0000\");\n      n = 1;\n    }\n    if (n == 1)\n      break;\n  }\n\n  if (n == 0) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[300], b[300], c[300];\n  char *p, *q;\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  cin >> c;\n  len = strlen(b);\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL) {\n    cout << a;\n  } else {\n    while (q < p) {\n      cout << *q;\n      q++;\n    }\n    q = p + len;\n    cout << c;\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[3][257];\n  int i;\n  int l1, l2, l3, re;\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", a[i]);\n  l1 = strlen(a[0]);\n  l2 = strlen(a[1]);\n  l3 = strlen(a[2]);\n  int j, k, z = 0, num = 0, x = 0, count = 0;\n  for (j = 0; j < l1; j++) {\n    if (a[0][j] == a[1][0]) {\n      z = j + 1;\n      for (k = 1; k < l2; k++) {\n        if (a[0][z] == a[1][k])\n          num++;\n        else\n          break;\n        z++;\n      }\n      if (num == l2 - 1) {\n        re = 1;\n        count = j;\n      } else\n        continue;\n    } else if (re == 1)\n      break;\n    else\n      continue;\n  }\n  if (re == 1) {\n    for (i = count; i < l2 + count; i++) {\n      a[0][i] = a[2][x];\n      x++;\n    }\n    printf(\"%s\", a[0]);\n  } else\n    cout << a[0];\n  return 0;\n}\n"}
{"label": "7", "index": "12586", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n\n  scanf(\"%s \", s);\n\n  cin >> sub;\n\n  cin >> re;\n  int i, length, lensub, j, k, ans = 0;\n  length = strlen(s);\n  lensub = strlen(sub);\n  for (i = 0; i < length; i++)\n    if (s[i] == sub[0]) {\n      for (j = 0; j < lensub; j++)\n        if (s[i + j] != sub[j])\n          break;\n      if (j == lensub) {\n        ans = 1;\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", re);\n        for (k = i + lensub; k < length; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  if (ans != 1)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, j, m, control = 0;\n  char st[256], sub[256], re[256];\n\n  cin >> st;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(st);\n  len2 = strlen(sub);\n  int k = 0;\n  for (i = 0, j = 0; i < len1; i++) {\n    if (k == 0 && sub[j] == st[i]) {\n      if (len2 == 1) {\n        for (m = 0; m < i; m++)\n          printf(\"%c\", st[m]);\n        printf(\"%s\", re);\n        for (m = m + 1; m < len1; m++)\n          printf(\"%c\", st[m]);\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    } else if (k != 0 && sub[j] != st[i]) {\n      k = 0;\n      j = 0;\n    } else if (k != 0 && sub[j] == st[i]) {\n      if (j == len2 - 1) {\n        for (m = 0; m < i - j; m++)\n          printf(\"%c\", st[m]);\n        printf(\"%s\", re);\n        for (m = m + len2; m < len1; m++)\n          printf(\"%c\", st[m]);\n        printf(\" \");\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    }\n  }\n  if (control == 0)\n    puts(st);\n  return 0;\n}\n"}
{"label": "7", "index": "12588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[250], b[150], c[150];\n  scanf(\"%s %s %s \", a, b, c);\n  if (strstr(a, b) == NULL) {\n    cout << a;\n    return 0;\n  }\n  char *p = strstr(a, b);\n  int i = 0;\n  while (c[i] != '\\0') {\n    *p++ = c[i];\n    i++;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12589", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char b[256], a[256], c[256];\n  int m, n, i, j, d;\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    d = 1;\n    for (j = 0; j < n; j++) {\n      if (b[j] != a[j + i])\n        d = 0;\n    }\n    if (d == 1) {\n      for (j = 0; j < n; j++)\n        a[i + j] = c[j];\n\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int la, lb, i, j, n, k, x, p;\n  char a[100], b[100], c[100], d[100];\n  scanf(\"%s %s %s \", a, b, d);\n  la = strlen(a);\n  lb = strlen(b);\n  n = la - lb;\n  for (i = 0; i <= n; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      p = i;\n      for (j = 0; j < lb; j++) {\n        c[j] = a[k];\n        k++;\n      }\n      c[lb] = '\\0';\n      if (strcmp(c, b) == 0) {\n        for (x = 0; x < lb; x++) {\n          a[p] = d[x];\n          p++;\n        }\n        break;\n      }\n    } else\n      continue;\n  }\n\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char subString[256];\n  char replacement[256];\n  char result[256];\n  int L1, L2, L3;\n  int i, j, t = 1, flag = 0;\n  int l, m, n;\n\n  cin >> string;\n\n  cin >> subString;\n\n  scanf(\"%s \", replacement);\n  L1 = strlen(string);\n  L2 = strlen(subString);\n  L3 = strlen(replacement);\n  for (i = 0; i < L1; i++) {\n    for (j = 0; j < L2; j++) {\n      if (subString[j] != string[j + i]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      for (l = 0; l < i; l++) {\n        result[l] = string[l];\n      }\n      m = 0;\n      for (l = i; m < L3; l++, m++) {\n        result[l] = replacement[m];\n      }\n      for (n = i + L2; n < L1; n++, l++) {\n        result[l] = string[n];\n      }\n      result[l] = '\u0000';\n      flag = 1;\n      break;\n    }\n    t = 1;\n  }\n\n  if (flag == 1)\n    printf(\"%s\", result);\n  if (flag == 0)\n    cout << string;\n  return 0;\n}\n"}
{"label": "7", "index": "12592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[257], son[257], re[357], fu[257];\n  int i, len, slen, k, t = 0;\n\n  cin >> zfc;\n\n  cin >> son;\n\n  scanf(\"%s \", re);\n  len = strlen(zfc);\n  slen = strlen(son);\n  for (i = 0; i <= len - slen; i++) {\n    for (k = i; k < i + slen; k++) {\n      fu[k - i] = zfc[k];\n    }\n    fu[slen] = '\u0000';\n    if (strcmp(fu, son) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      printf(\"%s\", re);\n      for (k = i + slen; k < len; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      t = 1;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"%s\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12593", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int i, j, a, b, t;\n  scanf(\"%s %s %s \", w, s, r);\n  b = strlen(w);\n  a = strlen(s);\n  for (i = 0; i < b; i++) {\n    if (s[0] == w[i]) {\n      for (j = 0; j < a; j++) {\n        if (s[j] != w[i + j])\n          break;\n      }\n      if (j == a) {\n        for (t = 0; t < a; t++)\n          w[i + t] = r[t];\n        for (t = 0; t < b; t++)\n          printf(\"%c\", w[t]);\n        break;\n      }\n    }\n  }\n  if (i == b) {\n    for (t = 0; t < b; t++)\n      printf(\"%c\", w[t]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf1[257], zf2[257], zf3[257];\n  int len1, len2, len3, i, k, t, m, fa = 0;\n  scanf(\"%s%s%s\", zf1, zf2, zf3);\n  len1 = strlen(zf1);\n  len2 = strlen(zf2);\n  len3 = strlen(zf3);\n  for (i = 0; i < len1; i++) {\n    for (k = 0; k < len2; k++) {\n      if (zf2[k] != zf1[i + k]) {\n        t = 0;\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (t == len2) {\n      m = i;\n      fa = 1;\n    }\n    if (fa == 1) {\n      break;\n    }\n  }\n  if (fa == 1) {\n    for (i = 0; i < m; i++) {\n      cout << zf1[i];\n    }\n    printf(\"%s\", zf3);\n    for (i = m + len2; i < len1; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n  }\n  if (fa == 0) {\n    printf(\"%s\", zf1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, result;\n  char input[100], substring[20], replace[20], cpy[20];\n  scanf(\"%s\\n%s\\n%s\", input, substring, replace);\n  result = strlen(input) - strlen(substring);\n  for (i = 0; i <= result; i++) {\n    if (input[i] == substring[0]) {\n      int a;\n      a = strlen(substring);\n      for (j = 0; j < a; j++) {\n        cpy[j] = input[i + j];\n        cpy[j + 1] = '\\0';\n      }\n      int m;\n      m = strcmp(cpy, substring);\n      if (m == 0) {\n\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", input[k]);\n        }\n        cout << replace;\n        for (k = i + a; k < strlen(input); k++) {\n          printf(\"%c\", input[k]);\n        }\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", input);\n  return 0;\n}\n"}
{"label": "7", "index": "12596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b), len3 = strlen(c);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    cout << a;\n  else if (flag == 0) {\n    cout << c;\n    for (i = len2; i <= len1 - 1; i++)\n      printf(\"%c\", a[i]);\n  } else {\n    for (i = 0; i <= flag - 1; i++)\n      cout << a[i];\n    cout << c;\n    for (i = i + len2; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], w[256], v[256];\n  int i, j, slen, wlen, k;\n  scanf(\"%s\", w);\n  cin >> s;\n  cin >> v;\n  slen = strlen(s);\n  wlen = strlen(w);\n  for (i = 0; i <= wlen - slen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (w[i + j] != s[j]) {\n        break;\n      }\n    }\n    if (j == slen) {\n      break;\n    }\n  }\n  if (j == slen) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", w[k]);\n    }\n    cout << v;\n    if (w[i + slen] != 0) {\n      for (k = i + slen; k < wlen; k++) {\n        printf(\"%c\", w[k]);\n      }\n    }\n\n  } else if (i == wlen - slen + 1)\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[100], b[100];\n  int i = 0, z = 0, c = 0, d, f, e;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  c = strlen(a);\n  e = strlen(s);\n  while (i < e) {\n    if (s[i] == a[z]) {\n      f = 0;\n      for (d = i; d < i + c; d++) {\n        if (s[d] == a[z]) {\n          f++;\n          z++;\n        }\n      }\n      if (f == c) {\n        z = 0;\n        for (d = i; d < i + c; d++) {\n          s[d] = b[z];\n          z++;\n        }\n        break;\n      } else {\n        z = 0;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < e; i++) {\n    printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, a = 1, n, m, k;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  n = strlen(s1);\n  m = strlen(s2);\n  for (i = 0; i < n; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; j < m; j++) {\n        if (s1[j + i] == s2[j]) {\n          a++;\n        }\n      }\n      if (a == m) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s1[k]);\n        for (k = 0; k < m; k++)\n          printf(\"%c\", s3[k]);\n        for (k = i + m; k < n; k++)\n          printf(\"%c\", s1[k]);\n        cout << \"\\n\";\n        break;\n      }\n    }\n  if (a != m)\n    printf(\"%s\\n\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12600", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *org, *sub, *re;\n  int i, j, flag;\n  org = (char *)malloc(1024 * sizeof(char));\n  sub = (char *)malloc(100 * sizeof(char));\n  re = (char *)malloc(100 * sizeof(char));\n\n  cin >> org;\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; *(org + i) != '\u0000'; i++) {\n    if (*(org + i) == *sub) {\n      for (j = 0; *(sub + j) != '\u0000'; j++) {\n        flag = 0;\n        if (*(org + i + j) != *(sub + j)) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        for (j = 0; *(re + j) != '\u0000'; j++)\n          *(org + i + j) = *(re + j);\n        break;\n      }\n    }\n  }\n  printf(\"%s\", org);\n}\n"}
{"label": "7", "index": "12601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, j, k, flag = 0;\n  char str[512], substr[256], replace[256];\n  cin.getline(str, 512);\n  cin.getline(substr, 256);\n  cin.getline(replace, 256);\n  int len1 = strlen(str);\n  int len2 = strlen(substr);\n  int len3 = strlen(replace);\n  for (i = 0; i <= len1 - len2; i++) {\n    k = i;\n    for (j = 0; j < len2; j++) {\n      if (str[k++] != substr[j])\n        break;\n    }\n    if (j == len2 && flag == 0) {\n      int ii;\n      for (ii = i; ii < i + len3; ii++) {\n        str[ii] = replace[ii - i];\n      }\n      flag = 1;\n    }\n  }\n  for (i = 0; str[i] != '\\0'; i++) {\n    cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char S[100], sub[100], replace[100];\n  cin >> S;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(replace);\n  int k, m;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          cout << S[k];\n        cout << replace;\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n}\n"}
{"label": "7", "index": "12603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, len3, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  len3 = strlen(s3);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2)\n      break;\n  }\n  for (j = 0; j < i; j++)\n    cout << s1[j];\n  if (i != len1)\n    printf(\"%s\", s3);\n  for (j = i + len2; j < len1; j++)\n    printf(\"%c\", s1[j]);\n  return 0;\n}\n"}
{"label": "7", "index": "12604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid right(char a[], int l, int t) {\n  int i;\n  for (i = l; i >= t; i--)\n    a[i] = a[i - 1];\n  a[l + 1] = '\\0';\n}\nvoid left(char a[], int l, int t) {\n  int i;\n  for (i = t; i <= l; i++)\n    a[i - 2] = a[i - 1];\n  a[l - 1] = '\\0';\n}\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, l1, l2, l3, d, e, s, r;\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  if (l2 > l3) {\n    s = 1;\n    r = l2 - l3;\n  } else if (l2 == l3)\n    s = r = 0;\n  else {\n    s = -1;\n    r = l3 - l2;\n  }\n  for (i = 1; i <= l1; i++) {\n    e = a[i - 1] - b[0];\n    if (e == 0) {\n      d = 0;\n      for (j = 1; j <= l2 - 1; j++) {\n        e = a[i + j - 1] - b[j];\n        if (e != 0)\n          d = 1;\n      }\n      if (d == 0) {\n        for (j = 1; j <= r; j++) {\n          if (s > 0)\n            left(a, l1, i + l2);\n          if (s < 0)\n            right(a, l1, i);\n        }\n        for (j = 1; j <= l3; j++)\n          a[i + j - 2] = c[j - 1];\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12605", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n\n  scanf(\"%s \", p1);\n\n  cin >> p2;\n\n  cin >> p3;\n  p = strstr(p1, p2);\n  if (p == NULL)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; p1 != p; p1++, i++)\n      *(q + i) = *p1;\n    *(q + i) = '\u0000';\n    for (j = 0; j < strlen(p3); j++)\n      *(q + i + j) = *(p3 + j);\n    for (j = 0; *(p1 + strlen(p2) + j) != '\u0000'; j++)\n      *(q + i + strlen(p3) + j) = *(p1 + strlen(p2) + j);\n    *(q + i + strlen(p3) + j) = '\u0000';\n    printf(\"%s\", q);\n  }\n}\n"}
{"label": "7", "index": "12606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(char *pa, char *pb, int lenb) {\n  int i;\n  for (i = 1; i < lenb; i++)\n    if (*(pa + i) != *(pb + i))\n      return 0;\n  return 1;\n}\n\nint main() {\n  char a[300], b[300], c[100], d[300] = {'0'};\n  int i, j, lenb, k;\n  scanf(\"%s %s %s \", a, b, c);\n  lenb = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] == b[0])\n      if (match(&a[i], b, lenb)) {\n        for (j = i + lenb; a[j] != '\\0'; j++)\n          d[j] = a[j];\n        for (j = 0, k = i; c[j] != '\\0'; k++, j++)\n          a[k] = c[j];\n        for (j = i; d[j] != '\\0'; j++, k++)\n          a[k] = d[j];\n        break;\n      }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p, *q, *r;\n  p = (char *)malloc(1000);\n  q = (char *)malloc(1000);\n  r = (char *)malloc(1000);\n\n  cin >> p;\n  cin >> q;\n  cin >> r;\n  int a, b, c;\n  a = strlen(p);\n  b = strlen(q);\n  c = strlen(r);\n  int i, j, k;\n  int t = 1;\n  for (i = 0; i < a; i++) {\n    for (j = i, k = 0; j < i + b; j++, k++) {\n      if (p[j] != q[k]) {\n        t = 0;\n        break;\n      }\n    }\n    if (k == b)\n      break;\n  }\n  if (k == b) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", p[j]);\n    printf(\"%s\", r);\n    for (j = i + b; j < a; j++)\n      cout << p[j];\n  } else\n    printf(\"%s\", p);\n}\n"}
{"label": "7", "index": "12608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], zc[50], th[50];\n  int i, j, t = 0, n, m;\n\n  cin >> str;\n\n  cin >> zc;\n\n  cin >> th;\n  n = strlen(zc);\n  m = strlen(th);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == zc[0]) {\n      for (j = 1; j < n; j++) {\n        if (str[i + j] == zc[j]) {\n          j++;\n          t = 1;\n          continue;\n        } else\n          t = 0;\n        break;\n      }\n    }\n    if (t) {\n      for (j = 0; j < m; j++) {\n        str[i + j] = th[j];\n      }\n\n      break;\n    }\n  }\n\n  puts(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], re[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int bar = 0, min = 0;\n  int len1 = strlen(str), len2 = strlen(sub);\n  for (int i = 0; i < len1;) {\n    bar = 0;\n    if (str[i] == sub[0]) {\n      for (int j = 0; j < len2; j++) {\n        if (str[i + j] != sub[j]) {\n          bar = 1;\n        }\n      }\n      if (bar == 0 && min == 0) {\n        printf(\"%s\", re);\n        i = i + len2;\n        min = 1;\n      } else {\n        printf(\"%c\", str[i]);\n        i = i + 1;\n        bar = 0;\n      }\n    } else {\n      printf(\"%c\", str[i]);\n      i = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], a[256], b[256], c[256];\n  int i, j, t = 0;\n  cin >> str >> a >> b;\n  for (i = 0; i < strlen(str); i++) {\n    for (j = 0; j < strlen(a); j++)\n      c[j] = str[i + j];\n    c[j] = '\\0';\n    if (strcmp(c, a) == 0) {\n      t = 1;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; j < strlen(b); j++)\n      printf(\"%c\", b[j]);\n    for (j = i + strlen(a); str[j] != 0; j++)\n      cout << str[j];\n  } else\n    printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12611", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar *strrpl(char *src, char *sub, char *rpl) {\n  char *p = strstr(src, sub);\n  int a, b;\n  if (p == NULL)\n    return src;\n  a = strlen(sub);\n  b = strlen(rpl);\n  memmove(p + b, p + a, strlen(p + a) + 1);\n  memcpy(p, rpl, b);\n  return src;\n}\nint main() {\n  char str[256], sub[256], rpl[256];\n  scanf(\"%s \", str);\n  cin >> sub;\n  cin >> rpl;\n  puts(strrpl(str, sub, rpl));\n  return 0;\n}\n"}
{"label": "7", "index": "12612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char string[300];\n  char substring[300];\n  char replace[300];\n  cin >> string;\n  cin >> substring;\n  cin >> replace;\n\n  int l2 = strlen(replace);\n  char *p = strstr(string, substring);\n  if (p != NULL) {\n    while (i < l2) {\n      *p = replace[i];\n      i++;\n      p++;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], d[100];\n  char *p, c[100], c1[100], c2[100];\n  int i, k, ls, lc;\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> d;\n\n  p = strstr(s, c);\n  ls = strlen(s);\n  lc = strlen(c);\n  int lsc = p - s;\n  if (p) {\n    for (i = 0; i < lsc; i++) {\n      c1[i] = s[i];\n    }\n    c1[i] = '\u0000';\n    k = 0;\n    for (i = i + lc; i < ls; i++, k++) {\n      c2[k] = s[i];\n    }\n    c2[k] = '\u0000';\n    printf(\"%s\", c1);\n    printf(\"%s\", d);\n    printf(\"%s\", c2);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n/\n\nint main() {\n  char str[256], subStr[256], repStr[256];\n  int strLen, subStrLen, repStrLen, i, j, k, flag2 = 0;\n  cin.getline(str, 256, '\\n');\n  cin.getline(subStr, 256, '\\n');\n  cin.getline(repStr, 256, '\\n');\n  subStrLen = strlen(subStr);\n  repStrLen = strlen(repStr);\n  strLen = strlen(str);\n  for (i = 0; i < strLen && flag2 == 0; i++)\n    if (str[i] == subStr[0]) {\n      int flag1 = 0;\n      for (j = 1; j < subStrLen; j++)\n        if (str[i + j] != subStr[j])\n          flag1 = 1;\n      if (flag1 == 0) {\n        if (subStrLen > repStrLen) {\n          for (j = 0; j < repStrLen; j++)\n            str[i + j] = repStr[j];\n          for (j = i + subStrLen; j < strLen; j++)\n            str[j - (subStrLen - repStrLen)] = str[j];\n        } else if (subStrLen == repStrLen)\n          for (j = 0; j < repStrLen; j++)\n            str[i + j] = repStr[j];\n        else {\n          for (j = strLen - 1; j >= i + subStrLen; j--)\n            str[j - (subStrLen - repStrLen)] = str[j];\n          for (j = 0; j < repStrLen; j++)\n            str[i + j] = repStr[j];\n        }\n        flag2 = 1;\n      }\n    }\n  if (flag2 == 1)\n    for (i = 0; i < strLen - subStrLen + repStrLen; i++)\n      cout << str[i];\n  else\n    for (i = 0; i < strLen; i++)\n      cout << str[i];\n  return 0;\n}\n"}
{"label": "7", "index": "12615", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[300], subs[300], rep[300];\n\nint ok(int wh) {\n  int i;\n  for (i = wh; i <= wh + strlen(subs) - 1; i++) {\n    if (s[i] != subs[i - wh]) {\n      return 0;\n    }\n  }\n  return 1;\n}\n\nint main() {\n  int i, start;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", subs);\n\n  cin >> rep;\n  start = -1;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (ok(i)) {\n      start = i;\n      break;\n    }\n  if (start == -1) {\n    puts(s);\n    return 0;\n  }\n  for (i = 0; i < start; i++) {\n    printf(\"%c\", s[i]);\n  }\n  for (i = 0; rep[i] != '\u0000'; i++) {\n    printf(\"%c\", rep[i]);\n  }\n  for (i = start + strlen(subs); s[i] != '\u0000'; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  char *p;\n  int lenth, d, i;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  p = strstr(a, b);\n  lenth = strlen(b);\n  d = strlen(a);\n  if (p != NULL) {\n    for (i = 0; i < lenth; p++, i++)\n      *p = c[i];\n  }\n  for (i = 0; i < d; i++)\n    printf(\"%c\", a[i]);\n}\n"}
{"label": "7", "index": "12617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  int i, t, j, s, len, len1;\n  scanf(\"%s %s %s \", a, b, c);\n  len1 = strlen(a);\n  len = strlen(b);\n  for (i = 0; i <= len1 - len; i++) {\n    t = 1;\n    for (j = 0; j < len; j++)\n      if (a[i + j] != b[j])\n        t = 0;\n    if (t == 1) {\n      s = i;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (i = 0; i < s; i++)\n      cout << a[i];\n    cout << c;\n    for (i = s + len; i < len1; i++)\n      cout << a[i];\n  } else\n    cout << a;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12618", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[200], zs[200], dk[200];\n  int a, b, i, c, d = 0, p, e = 0;\n\n  cin >> dk;\n  scanf(\"%s\", sz);\n  cin >> zs;\n  a = strlen(sz);\n  b = strlen(zs);\n  c = strlen(dk);\n  for (i = 0; i < c; i++) {\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      d = i;\n      break;\n    }\n  }\n  if (dk[0] == 's' && dk[1] == 'd' && dk[2] == 'j') {\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n    return 0;\n  }\n\n  for (i = 0; i < c; i++) {\n    if (i == d)\n      continue;\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      e = i;\n    }\n  }\n  if (d == 0) {\n    printf(\"%s\", dk);\n    return 0;\n  }\n  if (e == 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n  if (e != 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  scanf(\"%s %s %s \", string, substring, replacement);\n  int i, j = 0, length1, length2, m, num = 0;\n  length1 = strlen(string);\n  length2 = strlen(substring);\n  for (i = 0; i < length1; i++) {\n    m = i;\n    if (string[i] == substring[j]) {\n\n      for (j = 0; j < length2; j++) {\n        if (string[i] == substring[j]) {\n          i++;\n          num++;\n        }\n      }\n    }\n    j = 0;\n    i = m;\n    if (num == length2) {\n      for (j = 0; j < length2; j++) {\n        string[i] = replacement[j];\n        i++;\n      }\n      break;\n    }\n    num = 0;\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int lenth1, lenth2, i, j, t;\n  lenth1 = strlen(a);\n  lenth2 = strlen(b);\n  for (i = 0; i <= lenth1 - 1; i++) {\n    t = i;\n    for (j = 0; j <= lenth2 - 1;) {\n\n      if (a[t] == b[j]) {\n        t = t + 1;\n        j = j + 1;\n\n      } else\n        break;\n    }\n    if (j == lenth2)\n      break;\n  }\n  for (j = 0; j < lenth2; j++, i++) {\n    a[i] = c[j];\n  }\n  for (i = 0; i < lenth1; i++)\n    cout << a[i];\n}\n"}
{"label": "7", "index": "12621", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char str1[258], str2[258], str3[258], ch[600];\n  int len1, len2, len3, i = 0, j = 0;\n  int m, n = 0;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i < len1; i++) {\n    n = 0;\n    m = i;\n    if (str1[m] == str2[j]) {\n      n = 1;\n      for (j = 0, m; j < len2; j++, m++) {\n        if (str1[m] != str2[j]) {\n          n = 0;\n          j = 0;\n          break;\n        }\n      }\n      if (n == 1) {\n        m = i;\n        for (i = 0; i < len1 + len3 - len2; i++) {\n          if (i >= m && i < m + len3)\n            ch[i] = str3[i - m];\n          else if (i < m)\n            ch[i] = str1[i];\n          else\n            ch[i] = str1[len2 + i - len3];\n        }\n        break;\n      }\n    }\n  }\n  if (n == 1)\n    for (i = 0; i < len1 + len3 - len2; i++)\n      cout << ch[i];\n  else\n    for (i = 0; i < len1; i++)\n      cout << str1[i];\n  return 0;\n}\n"}
{"label": "7", "index": "12622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, count = 0, k;\n  char string[256], substring[256], replacement[256], czy[256], cai[256];\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  scanf(\"%s \", replacement);\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 0; j < b; j++)\n        czy[j] = string[i + j];\n      if (strcmp(czy, substring) == 0) {\n        count = 1;\n        for (k = 0; k < i; k++)\n          cai[k] = string[k];\n        for (k = i; k < i + b; k++)\n          cai[k] = replacement[k - i];\n        for (k = i + b; k < a; k++)\n          cai[k] = string[k];\n      }\n      if (count == 1)\n        break;\n    }\n  }\n  if (count == 1)\n    puts(cai);\n  else\n    puts(string);\n}\n"}
{"label": "7", "index": "12623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[2000];\n\n  cin >> zfc;\n  int c;\n  c = strlen(zfc);\n  char tzfc[2000];\n  char hzfc[2000];\n\n  scanf(\"%s \", tzfc);\n\n  cin >> hzfc;\n  int ct, ch;\n  ct = strlen(tzfc);\n  ch = strlen(hzfc);\n\n  int i, wei, an = 0, x, deng = 0;\n  for (i = 0; i < c; i++) {\n    int flag = 0;\n    for (x = i; x < ct + i; x++) {\n      if (zfc[x] != tzfc[x - i]) {\n        flag = 1;\n      }\n      if (flag == 1) {\n        break;\n      }\n    }\n    if (flag == 0) {\n      wei = i;\n      an++;\n      deng = 1;\n    }\n\n    if (an == 1) {\n      break;\n    }\n  }\n\n  if (deng == 0) {\n    puts(zfc);\n  } else {\n\n    int xzfc[2000];\n    for (i = 0; i < wei; i++) {\n      xzfc[i] = zfc[i];\n    }\n    for (i = wei; i < ch + wei; i++) {\n      xzfc[i] = hzfc[i - wei];\n    }\n    for (i = ch + wei; i < c - ct + ch; i++) {\n      xzfc[i] = zfc[i - (ch - ct)];\n    }\n\n    for (i = 0; i < c - ct + ch; i++) {\n      cout << xzfc[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12624", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char org[270] = {0}, sub[100] = {0}, rep[100] = {0}, temp[100] = {0};\n  cin >> org >> sub >> rep;\n  int i, j, l1 = strlen(org), l = strlen(sub), flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < i + l; j++) {\n      temp[j - i] = org[j];\n    }\n    if (strcmp(temp, sub) == 0) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (int k = 0; k < i; k++)\n      cout << org[k];\n    cout << rep;\n    cout << org + j << endl;\n  } else\n    cout << org << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12625", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], substr[256], rep[256];\n  int i, j, flag = 1, flag1 = 0;\n  cin >> str;\n  cin >> substr;\n  cin >> rep;\n  int nlen = strlen(str);\n  int slen = strlen(substr);\n  int rlen = strlen(rep);\n  if (slen != rlen) {\n    cout << \"hehe\" << endl;\n  }\n  for (i = 0; i < nlen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (substr[j] != str[i + j]) {\n        flag = 0;\n        break;\n      } else {\n        flag = 1;\n      }\n    }\n    if (flag) {\n      for (int k = 0; k < slen; k++) {\n        str[i + k] = rep[k];\n      }\n      flag1 = 1;\n    }\n    if (flag1) {\n      break;\n    }\n  }\n  cout << str << '\\n';\n  return 0;\n}\n"}
{"label": "7", "index": "12626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[257], a[50], b[50];\n  int i, j, k;\n  scanf(\"%s%s%s\", zfc, a, b);\n  for (i = 0; i < strlen(zfc); i++) {\n    if (a[0] == zfc[i]) {\n      for (j = 1; j < strlen(a); j++) {\n        if (a[j] != zfc[i + j])\n          break;\n      }\n      if (j == strlen(a))\n        break;\n    }\n  }\n  if (j == strlen(a)) {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", zfc[k]);\n    for (k = i; k < i + strlen(b); k++)\n      printf(\"%c\", b[k - i]);\n    for (k = i + strlen(b); k < strlen(zfc); k++)\n      printf(\"%c\", zfc[k]);\n  } else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12627", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, flag = 0;\n  char str[512], substr[256], replace[256];\n  cin.getline(str, 512);\n  cin.getline(substr, 256);\n  cin.getline(replace, 256);\n  int len1 = strlen(str);\n  int len2 = strlen(substr);\n  int len3 = strlen(replace);\n  for (i = 0; i <= len1 - len2; i++) {\n    k = i;\n    for (j = 0; j < len2; j++) {\n      if (str[k++] != substr[j])\n        break;\n    }\n    if (j == len2 && flag == 0) {\n      int ii;\n      for (ii = i; ii < i + len3; ii++) {\n        str[ii] = replace[ii - i];\n      }\n      flag = 1;\n    }\n  }\n  for (i = 0; str[i] != '\\0'; i++)\n    cout << str[i];\n\n  return 0;\n}\n"}
{"label": "7", "index": "12628", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      zichuan[j] = zfc1[j + i];\n    }\n    if (strcmp(zichuan, zfc2) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc1[k]);\n      }\n      printf(\"%s\", zfc3);\n      for (t = i + len2; zfc1[t] != '\\0'; t++) {\n        printf(\"%c\", zfc1[t]);\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12629", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, n, m, k, p, q, z = 0;\n  char a[260], b[260], c[260], d[260];\n\n  cin >> a >> b >> c;\n  n = strlen(a);\n  m = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (k = 0; k < m; k++) {\n        d[k] = a[k + i];\n      }\n      d[k] = '\\0';\n      if (strcmp(b, d) == 0) {\n        for (p = 0; p < i; p++) {\n          printf(\"%c\", a[p]);\n        }\n        printf(\"%s\", c);\n        for (p = i + q; p < (n - m + q); p++) {\n          printf(\"%c\", a[p]);\n        }\n        z = 1;\n        break;\n      }\n    }\n  }\n\n  if (z == 0) {\n    printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint comp(char a[100], char b[100], int i) {\n  int l, j;\n  l = strlen(b);\n  for (j = 0; j < l; j++)\n    if (a[i + j] != b[j])\n      return 0;\n  return 1;\n}\n\nint main(int argc, char *argv[]) {\n  int i, j, len1, len2, len3, break1 = 0;\n  char a[100], b[100], c[100];\n  int comp(char a[100], char b[100], int i);\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < 100; i++) {\n    if (a[i] == b[0]) {\n      if (comp(a, b, i)) {\n        for (j = 0; j < i; j++)\n          printf(\"%c\", a[j]);\n\n        printf(\"%s\", c);\n\n        for (j = j + len2; j < len1 - len2 + len3; j++)\n          cout << a[j];\n        break;\n        break1 = 1;\n      }\n    }\n    if (break1 == 1)\n      break;\n    if (i == strlen(a))\n      printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, lena, lenb, m, n, k;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    m = 0;\n    for (j = i; j < i + lenb; j++) {\n      if (b[j - i] != a[j])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++) {\n        d[n] = a[n];\n      }\n      d[n] = '\\0';\n      for (k = i + lenb; k < lena; k++)\n        e[k - i - lenb] = a[k];\n\n      e[k - i - lenb] = '\\0';\n      printf(\"%s%s%s\", d, c, e);\n      break;\n    }\n  }\n  if (m == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12632", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, t, l1, l2, l3, judge;\n  char s[256], a[256], b[256];\n  cin >> s;\n  l1 = strlen(s);\n  cin >> a;\n  l2 = strlen(a);\n  cin >> b;\n  l3 = strlen(b);\n  for (i = 0; i <= l1 - l2; i++) {\n    judge = 1;\n    for (j = 0; j < l2; j++)\n      if (s[i + j] != a[j]) {\n        judge = 0;\n        break;\n      }\n    if (judge == 1) {\n      t = i;\n      break;\n    }\n  }\n  if (judge == 1) {\n    for (k = 0; k < l3; k++)\n      s[t + k] = b[k];\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256], sl[256];\n  int n, m, i, j, k, e, l;\n  scanf(\"%s\", &s);\n  scanf(\"%s\", &sub);\n  scanf(\"%s\", &re);\n  l = 0;\n  while (s[l] != '\u0000')\n    l++;\n  m = 0;\n  while (sub[m] != '\u0000')\n    m++;\n  n = 0;\n  while (re[n] != '\u0000')\n    n++;\n  for (i = 0; i < l; i++) {\n    k = 1;\n    for (j = 0; j < m; j++)\n      if (s[i + j] != sub[j]) {\n        k = 0;\n        break;\n      }\n    if (k == 1) {\n      e = i;\n      break;\n    }\n  }\n  if (k == 1) {\n    for (i = e + m - 1; s[i] != '\u0000'; i++)\n      sl[i] = s[i];\n    sl[i + 1] = '\u0000';\n    for (i = 0; i < n; i++)\n      s[e + i] = re[i];\n    for (i = e + n; sl[i - n + m] != '\u0000'; i++)\n      s[i] = s[i - n + m];\n    s[i + 1] = '\u0000';\n  }\n  for (i = 0; s[i] != '\u0000'; i++)\n    printf(\"%c\", s[i]);\n  printf(\" \");\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12634", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[3][257];\n  int i;\n  int l1, l2, l3, re;\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", a[i]);\n  l1 = strlen(a[0]);\n  l2 = strlen(a[1]);\n  l3 = strlen(a[2]);\n  int j, k, z = 0, num = 0, x = 0, count = 0;\n  for (j = 0; j < l1; j++) {\n    if (a[0][j] == a[1][0]) {\n      z = j + 1;\n      for (k = 1; k < l2; k++) {\n        if (a[0][z] == a[1][k])\n          num++;\n        else\n          break;\n        z++;\n      }\n      if (num == l2 - 1) {\n        re = 1;\n        count = j;\n      } else\n        continue;\n    } else if (re == 1)\n      break;\n    else\n      continue;\n  }\n  if (re == 1) {\n    for (i = count; i < l2 + count; i++) {\n      a[0][i] = a[2][x];\n      x++;\n    }\n    printf(\"%s\", a[0]);\n  } else\n    printf(\"%s\", a[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "12635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12636", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257] = {0};\n  char b[257] = {0};\n  char c[257] = {0};\n  int i = 0;\n  int j = 0;\n  int k = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int isbreak = 0;\n  int len = strlen(b);\n  for (i = 0; i < 257; i++) {\n    if (a[i + len - 1] == '\u0000')\n      break;\n    for (j = i; j < i + len; j++) {\n      if (a[j] == b[j - i]) {\n        k++;\n      } else {\n        k = 0;\n      }\n    }\n    if (k == len) {\n      isbreak = 1;\n      for (j = i; j < i + len; j++) {\n        a[j] = c[j - i];\n      }\n    }\n    if (isbreak != 0)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, n, m, d, k, y, v = 0;\n  char s[256], b[256], t[256];\n  scanf(\"%s%s%s\", s, b, t);\n  n = strlen(s);\n  m = strlen(b);\n  for (i = 0; i <= n - m; i++) {\n    if (s[i] == b[0]) {\n      k = i;\n      for (j = 0, x = i; j < m; j++, x++) {\n        if (s[x] != b[j])\n          break;\n      }\n      if (j >= m)\n        for (d = k, y = 0; d < k + m; d++, y++) {\n          s[d] = t[y];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char yuanchuan[257];\n  char zichuan[257];\n  char replacement[257];\n  int i, j, k;\n  int len1, len2;\n  scanf(\"%s%s%s\", yuanchuan, zichuan, replacement);\n  len1 = strlen(yuanchuan);\n  len2 = strlen(zichuan);\n  k = len1;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (yuanchuan[i + j] != zichuan[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        k = i;\n      }\n    }\n    if (k != len1) {\n      break;\n    }\n  }\n  if (k == len1) {\n    printf(\"%s\", yuanchuan);\n  } else {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", yuanchuan[i]);\n    }\n    printf(\"%s\", replacement);\n    for (i = k + len2; i < len1; i++) {\n      printf(\"%c\", yuanchuan[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[256], sub[256], repl[256];\n  cin >> str >> sub >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if (same == 0)\n      printf(\"%c\", str[i]);\n    if (same == 1) {\n      printf(\"%s\", repl);\n      for (k = i + strlen(sub); str[k] != 0; k++) {\n        cout << str[k];\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12640", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, t;\n  char s1[256], s2[256], s3[256];\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n\n  cin >> s3;\n  for (i = 0; s1[i] != '\u0000'; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; s2[j] != '\u0000'; j++)\n        if (s2[j] == s1[i + j])\n          k++;\n      if (s2[k] == '\u0000') {\n        for (t = 0; t < i; t++)\n          printf(\"%c\", s1[t]);\n        for (t = 0; t < k; t++)\n          printf(\"%c\", s3[t]);\n        for (t = i + k; s1[t] != '\u0000'; t++)\n          printf(\"%c\", s1[t]);\n        printf(\" \");\n        break;\n      }\n    }\n  if (s2[k] != '\u0000')\n    printf(\"%s \", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257] = {'\\0'}, substr[257] = {'\\0'}, replace[257] = {'\\0'};\n  cin >> str >> substr >> replace;\n  char *p = strstr(str, substr);\n  int i = 0, flag = strlen(substr);\n  if (p == NULL)\n    cout << str << endl;\n  else {\n    for (i = 0; str + i < p; i++)\n      cout << str[i];\n    printf(\"%s\", replace);\n    for (i = i + flag; i < strlen(str); i++)\n      cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i = 0, j = 0, len1, len2, len3, t = 0, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  while (i < len1 && t < len2) {\n    if (a[i] != b[j]) {\n      i++;\n      j = 0;\n      t = 0;\n    } else {\n      i++;\n      j++;\n      t++;\n    }\n  }\n  if (t >= len2) {\n    for (j = 0; j < i - t; j++)\n      cout << a[j];\n    for (j = 0; j < len3; j++)\n      printf(\"%c\", c[j]);\n    for (j = i - t + len2; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  if (t < len2) {\n    for (j = 0; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12643", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[300], sub[300], rep[300], m, k, n;\n  int i, j;\n\n  scanf(\"%s \", zfc);\n\n  cin >> sub;\n\n  scanf(\"%s \", rep);\n  for (i = 0; i <= strlen(zfc) - strlen(sub); i++) {\n    m = 0;\n    for (j = 0; j < strlen(sub); j++) {\n      if (sub[j] != zfc[i + j]) {\n        m = -1;\n        break;\n      } else\n        m = 1;\n    }\n    if (m == 1) {\n      n = i;\n      break;\n    }\n  }\n  if (m == 1) {\n    for (k = n; k < n + strlen(sub); k++) {\n      zfc[k] = rep[k - n];\n    }\n\n    printf(\"%s\", zfc);\n  }\n\n  else\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12644", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12645", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (s[i] == a[0]) {\n      k = 0;\n      for (j = 1; j < y; j++) {\n        if (s[i + j] != a[j])\n          k = 1;\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < z; j++)\n        printf(\"%c\", b[j]);\n      for (i = i + y; i < x; i++)\n        printf(\"%c\", s[i]);\n      break;\n    }\n    if (k == 1)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12646", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257] = {'\\0'}, substr[257] = {'\\0'}, replace[257] = {'\\0'};\n  cin >> str >> substr >> replace;\n  char *p = strstr(str, substr);\n  int i = 0, flag = strlen(substr);\n  if (p == NULL)\n    cout << str << endl;\n  else {\n    for (i = 0; str + i < p; i++)\n      cout << str[i];\n    cout << replace;\n    for (i = i + flag; i < strlen(str); i++)\n      cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[257], son[257], re[357], fu[257];\n  int i, len, slen, k, t = 0;\n\n  scanf(\"%s \", zfc);\n\n  cin >> son;\n\n  cin >> re;\n  len = strlen(zfc);\n  slen = strlen(son);\n  for (i = 0; i <= len - slen; i++) {\n    for (k = i; k < i + slen; k++) {\n      fu[k - i] = zfc[k];\n    }\n    fu[slen] = '\u0000';\n    if (strcmp(fu, son) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      cout << re;\n      for (k = i + slen; k < len; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      t = 1;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"%s\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int q, w, e, i, k, j;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n\n  for (i = 0; i < q; i++) {\n    j = 0;\n    for (k = i; (k < i + w) && (k < q); k++) {\n\n      if (a[k] != b[k - i]) {\n        continue;\n      }\n      if (a[k] == b[k - i]) {\n        j++;\n      }\n      if (j == w) {\n        for (k = i; (k < i + w) && (k < q); k++) {\n          a[k] = c[k - i];\n        }\n        break;\n      }\n    }\n    if (j == w) {\n\n      break;\n    }\n  }\n\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300], subStr[10], re[10];\n  int i, j, lenth, m, n;\n  int flag = 0;\n  scanf(\"%s %s %s \", str, subStr, re);\n  lenth = strlen(str);\n  n = strlen(subStr);\n  m = strlen(re);\n  for (i = 0; i < lenth; i++) {\n    j = 0;\n    if (str[i] == subStr[j]) {\n      for (j = 0; j < n; j++) {\n        if (str[i] == subStr[j])\n          i++;\n        else\n          break;\n      }\n    }\n    if (j == n) {\n      flag = 1;\n      for (; j > 0; i--, j--) {\n        str[i - 1] = re[j - 1];\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300];\n  char b[200], c[200], d[200] = {0};\n  int n1, n2, n3, i, j, k, result, p, w;\n  scanf(\"%s%s%s\", a, b, c);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n3 = strlen(c);\n  p = 0;\n  k = 10000;\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    if (p == 0) {\n      for (j = 0; j < n2; j++) {\n        d[j] = a[i + j];\n      }\n      result = strcmp(d, b);\n      if (result == 0) {\n        k = i;\n        p = 1;\n        w = i + j;\n      }\n    }\n  }\n  if (k == 10000)\n    cout << a;\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = w; i < n1; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[250], substring[250], replacestring[200];\n  cin >> string >> substring >> replacestring;\n  int place = 0, i, j, flag = 1;\n  for (i = 0; string[i] != '\\0' && flag == 1; i++) {\n    if (string[i] != substring[0])\n      continue;\n    else {\n      place = i;\n      for (j = 0; substring[j] != '\\0'; j++) {\n        if (string[i++] != substring[j])\n          break;\n      }\n      if (substring[j] != '\\0')\n        place = 0;\n      else\n        flag = 0;\n    }\n  }\n  if (place) {\n    int l1 = strlen(substring), l2 = strlen(replacestring);\n    for (i = 0; string[i + place + l1] != '\\0'; i++)\n      replacestring[l2 + i] = string[place + l1 + i];\n    replacestring[l2 + i] = '\\0';\n    string[place] = '\\0';\n    printf(\"%s%s\\n\", string, replacestring);\n  } else\n    printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256] = {'\\0'}, s2[256] = {'\\0'}, s3[256] = {'\\0'}, t[256] = {'\\0'};\n  int i, j, k = 0, s, l1, l2, l3;\n  cin >> s1;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  for (i = 0; i < l1;) {\n    for (j = 0; j < l2; j++) {\n      if (i + j >= l1 || s1[i + j] != s2[j]) {\n        break;\n      }\n    }\n    if (j == l2) {\n      for (s = 0; s < l3; s++) {\n        t[k] = s3[s];\n        k++;\n      }\n      i = i + l2;\n      break;\n    } else {\n      t[k] = s1[i];\n      i++;\n      k++;\n    }\n  }\n  for (; i < l1; i++) {\n    t[k] = s1[i];\n    k++;\n  }\n  t[k] = '\\0';\n  cout << t;\n  return 0;\n}\n"}
{"label": "7", "index": "12653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++)\n      zichuan[j] = zfc1[j + i];\n\n    if (strcmp(zichuan, zfc2) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc1[k]);\n      }\n      cout << zfc3;\n      for (t = i + len2; zfc1[t] != '\\0'; t++) {\n        printf(\"%c\", zfc1[t]);\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[100][50], x[256], d[256];\n  int i, n1, n2, k, m, n, want = -1;\n  scanf(\"%s%s%s\", a, b, d);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n = n1 - n2 + 1;\n  for (k = 0; k < n; k++) {\n    m = k;\n    for (i = 0; i < n2; i++, m++) {\n      x[i] = a[m];\n    }\n    strcpy(c[k], x);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(b, c[i]) == 0) {\n      want = i;\n      break;\n    }\n  }\n  if (want == 0) {\n    printf(\"%s\", d);\n    for (i = n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n  }\n  if (want > 0 && want < (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n    for (i = want + n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == -1) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, t, s, n = 0, k, l;\n  char c1[256], c2[256], c3[256];\n  scanf(\"%s \", c1);\n  cin >> c2;\n  cin >> c3;\n  s = strlen(c2);\n  for (i = 0; c1[i] != '\u0000'; i++) {\n    if (c1[i] == c2[j]) {\n      n++;\n      j++;\n    } else {\n      j = 0;\n      n = 0;\n    }\n    if (n == s) {\n      t = i;\n      break;\n    }\n  }\n  if (n == s) {\n    for (l = 0, k = t - s + 1; k <= t, l < s; l++, k++) {\n      c1[k] = c3[l];\n    }\n  }\n  printf(\"%s\", c1);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12656", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar *strrpl(char *src, char *sub, char *rpl) {\n  char *p = strstr(src, sub);\n  int a, b;\n  if (p == NULL) {\n    return src;\n  }\n  a = strlen(sub);\n  b = strlen(rpl);\n  memmove(p + b, p + a, strlen(p + a) + 1);\n  memcpy(p, rpl, b);\n  return src;\n}\nint main() {\n  char str[256], sub[256], rpl[256];\n  cin >> str;\n  scanf(\"%s \", sub);\n  cin >> rpl;\n  puts(strrpl(str, sub, rpl));\n  return 0;\n}\n"}
{"label": "7", "index": "12657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, s, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < strlen(a); i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < strlen(b)) {\n      k++;\n      j++;\n    }\n    if (j == strlen(b)) {\n      y = 0;\n      for (s = i; s < i + strlen(b); s++) {\n        a[s] = c[s - i];\n      }\n      y = 1;\n    }\n    if (y == 1)\n      break;\n  }\n\n  cout << a << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  scanf(\"%s%s%s\", str, sub, re);\n  int l1, l2;\n  l1 = strlen(str);\n  l2 = strlen(sub);\n  int i, j, m;\n  for (i = 0; i < l1; i++) {\n    m = 1;\n    for (j = 0; j < l2; j++) {\n      if (str[i + j] != sub[j]) {\n        m = 2;\n      }\n    }\n    if (m == 1) {\n      for (j = 0; j < l2; j++) {\n        str[i + j] = re[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[257], z[200], h[200];\n  int lens, lenz, lenh, i, j, sum, r, q = 0, p = 0;\n\n  cin >> s;\n\n  cin >> z;\n\n  cin >> h;\n  lens = strlen(s);\n  lenz = strlen(z);\n  lenh = strlen(h);\n  for (i = 0; i < lens; i++) {\n    sum = 0;\n    for (j = 0; j < lenz; j++) {\n      if (s[i + j] == z[j]) {\n        sum++;\n      } else\n        break;\n    }\n    if (sum == lenz) {\n      r = i;\n      q = 1;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < r; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", h);\n    for (i = r + sum; i < lens; i++)\n      printf(\"%c\", s[i]);\n  } else if (q == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12660", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k = 0, l, m0, m1, a[100], flag = 0;\n  char str[3][300];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m0 = strlen(str[0]);\n  m1 = strlen(str[1]);\n  for (i = 0, j = 0; i < m0, j < m1; i++) {\n    if (str[0][i] == str[1][j]) {\n      j++;\n      flag++;\n      if (flag == m1) {\n        k = i - m1;\n        break;\n      }\n    } else {\n      j = 0;\n      flag = 0;\n    }\n  }\n  if (flag == m1) {\n    for (i = k + 1, j = 0; i < k + m1 + 1; i++, j++)\n      str[0][i] = str[2][j];\n    printf(\"%s\", str[0]);\n  } else\n    printf(\"%s\", str[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "12661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], zi[256], r[256];\n  int lens, lenzi, lenr;\n  int i, k, p = 2;\n  scanf(\"%s %s %s\", &s, &zi, &r);\n  lens = strlen(s);\n  lenzi = strlen(zi);\n  lenr = strlen(r);\n  for (i = 0; i < lens; i++) {\n    if (s[i] == zi[0]) {\n      for (k = 1; k < lenzi; k++) {\n        if (s[i + k] == zi[k]) {\n          p = 0;\n        } else {\n          break;\n        }\n      }\n      if (p == 0) {\n        for (k = 0; k < lenzi; k++) {\n          s[i + k] = r[k];\n        }\n        printf(\"%s\", s);\n        break;\n      }\n    }\n  }\n  if (p == 2) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], re[257];\n  int i, j, k, n1, n2, n3, h = 0;\n  cin >> str >> sub >> re;\n  n1 = strlen(str);\n  n2 = strlen(sub);\n  n3 = strlen(re);\n  for (i = 0; i <= n1 - n2; i++) {\n    if (str[i] == sub[0]) {\n      int ll = 0;\n      for (j = 0; j < n2; j++) {\n        if (str[i + j] != sub[j]) {\n          ll = 1;\n          break;\n        } else\n          continue;\n      }\n      if (ll == 0) {\n        h = 1;\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", str[k]);\n        }\n        for (k = 0; k < n3; k++) {\n          cout << re[k];\n        }\n        for (k = i + n2; k < n1; k++) {\n          cout << str[k];\n        }\n        break;\n      } else\n        continue;\n    }\n  }\n  if (h == 0)\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char b[256];\n  int i, j, x = 0, m, n, y = 0, p;\n  char c;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(b);\n  p = strlen(s);\n  for (i = 0; i <= p - n; i++) {\n    c = s[i];\n    if (c == a[0]) {\n      for (j = 0; j < n; j++) {\n        if (a[j] != s[i + j]) {\n          x = 1;\n        } else\n          x = 0;\n      }\n      if (x == 0) {\n        m = i;\n        y = 1;\n        break;\n      }\n    }\n  }\n  if (y == 1) {\n    for (i = m, j = 0; i < m + n; i++, j++) {\n      s[i] = b[j];\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  n = strlen(b);\n  int i = 0;\n  while (a[i] != '\\0') {\n    int m = 0;\n    while (m < n) {\n      if (a[i + m] == b[m])\n        m++;\n      else\n        break;\n    }\n    if (m == n) {\n      int p = 0;\n      while (p < i) {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      printf(\"%s\", c);\n      p = p + n;\n      while (a[p] != '\\0') {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      break;\n    }\n    i++;\n  }\n  if (a[i] == '\\0')\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int t, i, k;\n  scanf(\"%s\\n%s\\n%s\", s, sub, re);\n  t = strlen(sub);\n  for (i = 0; i < strlen(s) - t + 1; i++) {\n    int x = 0;\n    for (k = i; k < i + t; k++) {\n      if (s[k] != sub[k - i]) {\n        x += 1;\n      }\n    }\n    if (x == 0) {\n      for (k = i; k < i + t; k++) {\n        s[k] = re[k - i];\n      }\n      break;\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  n = strlen(b);\n  int i = 0;\n  while (a[i] != '\\0') {\n    int m = 0;\n    while (m < n) {\n      if (a[i + m] == b[m])\n        m++;\n      else\n        break;\n    }\n    if (m == n) {\n      int p = 0;\n      while (p < i) {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      cout << c;\n      p = p + n;\n      while (a[p] != '\\0') {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      break;\n    }\n    i++;\n  }\n  if (a[i] == '\\0')\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a = 1, m, k;\n  char s1[258], s2[258], s3[258];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if (a == 1) {\n      k = i;\n      for (j = 0; s2[j] != '\\0'; j++) {\n        if (s2[j] != s1[k]) {\n          a = 1;\n          break;\n        }\n        k++;\n        a = 0;\n      }\n    } else\n      break;\n  }\n  if (a == 0) {\n    for (m = 0; s3[m] != '\\0'; m++) {\n      s1[i - 1] = s3[m];\n      i++;\n    }\n  }\n  cout << s1;\n  return 0;\n}\n"}
{"label": "7", "index": "12668", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int start, end, ok, i, j, n, m, s;\n  char a[300], b[300], c[300];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  s = strlen(c);\n  for (i = 0; i < n; i++)\n    if (a[i] == b[0]) {\n      ok = 1;\n      for (j = 1; j < m; j++)\n        if (a[j + i] != b[j])\n          ok = 0;\n      if (ok) {\n        start = i;\n        end = j + i;\n        break;\n      }\n    }\n  if (ok == 1) {\n    for (i = 0; i < start; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", c[i]);\n    for (i = end; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  } else\n    puts(a);\n}\n"}
{"label": "7", "index": "12669", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int len1, len2, len3, i, j, k;\n  cin >> w;\n  scanf(\"%s\\n\", s);\n  scanf(\"%s\", r);\n  len1 = (int)strlen(s);\n  len2 = (int)strlen(w);\n  len3 = (int)strlen(r);\n  for (i = 0; i < len2; i++) {\n    if (w[i] == s[0]) {\n      for (j = 1; j < len1; j++) {\n        if (s[j] != w[i + j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      for (k = 0; k < len3; k++) {\n        w[i + k] = r[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar word[256], substring[256], replacement[256];\nint l1, l2, l3;\nint the_same(char *ch) {\n  int i;\n  for (i = 0; i < l2; i++) {\n    if (*(ch + i) != substring[i])\n      return 0;\n  }\n  return 1;\n}\nint main() {\n  char *p = NULL, *q = NULL;\n  int i, t;\n  cin.getline(word, 256);\n  l1 = strlen(word);\n  cin.getline(substring, 256);\n  l2 = strlen(substring);\n  cin.getline(replacement, 256);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    t = the_same(&word[i]);\n    if (t == 1) {\n      p = word + i;\n      break;\n    }\n  }\n  if (p == NULL) {\n    for (i = 0; i < l1; i++)\n      cout << word[i];\n  } else {\n    for (q = word; q < p; q++)\n      cout << *q;\n    for (i = 0; i < l3; i++)\n      printf(\"%c\", replacement[i]);\n    for (q = p + l2; q < word + l1; q++)\n      cout << *q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12671", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], *p;\n  scanf(\"%s %s %s \", a, b, c);\n  p = strstr(a, b);\n  if (p == NULL)\n    puts(a);\n  else {\n    *p = '\u0000';\n    strcpy(d, a);\n    strcat(d, c);\n    strcat(d, p + strlen(b));\n    puts(d);\n  }\n}\n"}
{"label": "7", "index": "12672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  char *p = strstr(str, sub);\n  if (p == NULL)\n    cout << str << \" \";\n  else {\n    int len = strlen(rep);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = rep[i];\n      p++;\n    }\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < len; ++i)\n    if (c[i] == a[0]) {\n      flag = 1;\n      for (j = 0; j < lena && i + j < len; ++j)\n        if (a[j] != c[i + j]) {\n          flag = 0;\n          break;\n        }\n      if (flag) {\n        printf(\"%s\", b);\n        i += lena;\n        break;\n      } else\n        printf(\"%c\", c[i]);\n    } else\n      printf(\"%c\", c[i]);\n  printf(\"%s\", c + i);\n  return 0;\n}\n"}
{"label": "7", "index": "12674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf1[257], zf2[257], zf3[257];\n  int len1, len2, len3, i, k, t, m, fa = 0;\n  scanf(\"%s%s%s\", zf1, zf2, zf3);\n  len1 = strlen(zf1);\n  len2 = strlen(zf2);\n  len3 = strlen(zf3);\n  for (i = 0; i < len1; i++) {\n    for (k = 0; k < len2; k++) {\n      if (zf2[k] != zf1[i + k]) {\n        t = 0;\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (t == len2) {\n      m = i;\n      fa = 1;\n    }\n    if (fa == 1) {\n      break;\n    }\n  }\n  if (fa == 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n    printf(\"%s\", zf3);\n    for (i = m + len2; i < len1; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n  }\n  if (fa == 0) {\n    printf(\"%s\", zf1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar substring[256] = {0};\nchar S[256] = {0};\nchar replacement[256] = {0};\n\nint main() {\n\n  while (cin >> S) {\n    cin >> substring;\n    cin >> replacement;\n\n    char *p = strstr(S, substring);\n    char *q = NULL;\n\n    if (p != NULL) {\n      for (q = S; q < p; q++)\n        cout << *q;\n\n      cout << replacement;\n      for (q = p + strlen(substring); *q != '\\0'; q++) {\n        cout << *q;\n      }\n      cout << endl;\n      memset(S, 0, 256);\n      memset(substring, 0, 256);\n      memset(replacement, 0, 256);\n    }\n\n    else if (p == NULL) {\n      cout << S << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, j, r = 0, m = 0;\n  int lens, lena;\n  char s[256], a[100], b[100], c[100], d[100];\n  scanf(\"%s%s%s\", s, a, b);\n  lens = strlen(s);\n  lena = strlen(a);\n  for (i = 0; i < lens; i++) {\n    m = 0;\n    for (k = i; k < i + lena; k++) {\n      if (a[k - i] != s[k])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++)\n        c[n] = s[n];\n      c[n] = '\\0';\n      for (j = i + lena; j < lens; j++)\n        d[j - i - lena] = s[j];\n      d[j - i - lena] = '\\0';\n      r = 1;\n      printf(\"%s%s%s\", c, b, d);\n      break;\n    }\n  }\n  if (r == 0)\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[257] = {0}, substring[257] = {0}, replacement[257] = {0};\n  char temp[257] = {0}, string_1[257] = {0}, string_2[257] = {0};\n  int i, j, k, word = 0;\n  int len1 = 0, len2 = 0, len3 = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i, k = 0; j < i + len2, k < len2; j++, k++) {\n      temp[k] = string[j];\n    }\n    if (strcmp(temp, substring) == 0) {\n      word = 1;\n      len3 = i;\n      break;\n    }\n  }\n  for (i = 0; i < len3; i++) {\n    string_1[i] = string[i];\n  }\n  if (word == 1) {\n    printf(\"%s\", string_1);\n    printf(\"%s\", replacement);\n    if ((len2 + len3) < len1) {\n      k = 0;\n      for (i = len3 + len2; i < len1; i++) {\n        string_2[k] = string[i];\n        k++;\n      }\n      printf(\"%s\", string_2);\n    }\n  }\n  if (word == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12678", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], w[256], z[256];\n  int ls, lw, t, lz;\n  int i, j, loc = -1;\n  cin >> w >> s >> z;\n  ls = strlen(s);\n  lw = strlen(w);\n  lz = strlen(z);\n  for (i = 0; i < lw; i++) {\n    t = 0;\n    for (j = 0; j < ls; j++) {\n      if (w[i + j] == s[j]) {\n        t++;\n      }\n    }\n    if (t == ls) {\n      loc = i;\n      break;\n    }\n  }\n\n  if (loc != -1) {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", w[i]);\n    }\n\n    printf(\"%s\", z);\n    for (i = loc + lz; i < lw; i++) {\n      printf(\"%c\", w[i]);\n    }\n  } else {\n    puts(w);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[257], sub[257], re[257];\n  char out[257] = {'\u0000'};\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, k = 0, len, m = 0;\n  len = strlen(sub);\n  int len2 = strlen(re);\n  int len3 = strlen(string);\n  for (i = 0; i < 256; i++) {\n    if (string[i] == sub[k]) {\n      k += 1;\n      if (k == len)\n        break;\n    } else {\n      k = 0;\n    }\n  }\n  if (k == len) {\n    int s = len3 - len + len2;\n    for (int j = 0; j < s; j++) {\n      if (j <= i - k) {\n        out[j] = string[j];\n        continue;\n      }\n      if (j > i - k && j <= i - k + len2) {\n        out[j] = re[m];\n        m += 1;\n      } else {\n        out[j] = string[i + 1];\n        i++;\n      }\n    }\n    printf(\"%s\", out);\n  } else\n    printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "12680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a >> b >> c;\n  int L, l, x, y;\n  L = strlen(a);\n  l = strlen(b);\n  for (x = 0; x <= L - l; x++) {\n    if (a[x] != b[0])\n      continue;\n    else {\n      for (y = 0; y < l; y++)\n        if (a[x + y] != b[y])\n          break;\n      if (y != l)\n        continue;\n      else\n        break;\n    }\n  }\n  if (x == L - l + 1)\n    cout << a << endl;\n  else {\n    int i = 0;\n    while (i != x) {\n      cout << a[i];\n      i++;\n    }\n    cout << c;\n    cout << a + i + l << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char sub[300];\n  char re[300];\n  scanf(\"%s%s%s\", str, sub, re);\n  int i, j, k, first;\n  int len = strlen(str);\n  int len1 = strlen(sub);\n  int len2 = strlen(re);\n  first = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i, j = 0; j < len1; j++, k++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      first = i;\n      break;\n    }\n  }\n  if (j != len1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < first; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", re);\n    for (i = (first + len2); i < len; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12682", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256] = {0}, subs[256] = {0}, rep[256] = {0}, front[256] = {0},\n       back[256] = {0};\n  int i = 0, x = 0, len1, len2, n = 0, m = 0, y = 0, flag = 0;\n  char a[256] = {0}, b[256] = {0};\n\n  cin >> str;\n\n  scanf(\"%s \", subs);\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(subs);\n  for (i = 0; i < len1; i++) {\n    strcpy(a, b);\n    x = 0;\n    if (str[i] == subs[0]) {\n      m = i;\n      for (int j = m; j < len2 + m; j++) {\n        a[x] = str[j];\n        x++;\n      }\n      a[x] = '\u0000';\n    }\n    if (strcmp(a, subs) == 0) {\n      n = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    if (n != 0) {\n      for (i = 0; i < n; i++) {\n        front[i] = str[i];\n      }\n    }\n    if (n != len1 - len2) {\n      for (i = n + len2; i < len1; i++) {\n        back[y] = str[i];\n        y++;\n      }\n    }\n    printf(\"%s%s%s \", front, rep, back);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[256], z1[256], z2[256];\n  int i, j, k, n, p, count, count1, count2, count4, count3[50];\n  int num1, num2, d = 0;\n\n  cin >> zfc;\n\n  cin >> z1;\n\n  cin >> z2;\n  count = 0;\n  num1 = strlen(zfc);\n  num2 = strlen(z1);\n  for (i = 0; i < num1; i++) {\n    count1 = 0;\n    for (j = 0; j < num2; j++) {\n      if (zfc[i + j] == z1[j])\n        count1++;\n    }\n    if (count1 == num2)\n      break;\n  }\n  if (count1 == num2) {\n    for (j = i; j < num2 + i; j++)\n      zfc[j] = z2[j - i];\n  }\n  printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "12684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, m, L, l1, l2;\n  char s[1000], a[300], b[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n    getchar();\n  }\n  for (k = i + l1; i != L && k < L; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12685", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int l1, i, j, n;\n  int flag;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  cin >> b;\n  l1 = strlen(a);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      for (j = i + 1; j < (i + l1); j++) {\n        if (s[j] != a[j - i])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (n = 0; n < i; n++)\n          printf(\"%c\", s[n]);\n        printf(\"%s\", b);\n        for (n = i + l1; s[n] != '\\0'; n++)\n          printf(\"%c\", s[n]);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12686", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s\", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i]) {\n          break;\n        }\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  for (i = 0; i < la; i++) {\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, k, n1, n2;\n  scanf(\"%s %s %s\", a, b, c);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i <= n1 - n2; i++) {\n    for (j = 0; j < n2; j++)\n      if (b[j] == a[i + j]) {\n        k++;\n        if (k == n2)\n          break;\n      } else {\n        k = 0;\n        break;\n      }\n    if (k == n2)\n      break;\n  }\n  if (k == n2) {\n    for (j = 0; j < n2; j++)\n      a[i + j] = c[j];\n    printf(\"%s\", a);\n  } else\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[200], str1[50], str2[50];\n  char *p, *q;\n  int length, i;\n  cin.getline(str, 200);\n  cin >> str1 >> str2;\n  length = strlen(str1);\n  q = str;\n  p = strstr(str, str1);\n  if (p != NULL) {\n    q = p + length;\n    for (i = 0; &str[i] != p; i++)\n      cout << str[i];\n    cout << str2;\n    for (; *q != '\\0'; q++) {\n      printf(\"%c\", *q);\n    }\n    cout << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], e[300];\n  int i, j, k, l;\n  i = 0;\n  j = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  while (a[i] != '\u0000') {\n    c[j] = a[i];\n    if (c[j] == b[0] && (i + strlen(b) <= strlen(a))) {\n      l = 0;\n      for (k = i; k <= i + strlen(b) - 1; k++) {\n        d[l] = a[k];\n        l++;\n      }\n      d[l] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        c[j] = '\u0000';\n        printf(\"%s\", c);\n        printf(\"%s\", e);\n        j = i + strlen(b);\n        k = 0;\n        while (a[j] != '\u0000') {\n          c[k] = a[j];\n          j++;\n          k++;\n        }\n        c[k] = '\u0000';\n        printf(\"%s\", c);\n        return 0;\n      }\n    }\n    i++;\n    j++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], b[50], r[50], a[50];\n  int i, k, n1, n2, n3, n, result;\n  scanf(\"%s%s%s\", s, b, r);\n  n1 = strlen(s);\n  n2 = strlen(b);\n  n3 = strlen(r);\n  for (i = 0; i < n1 - n2 + 1; i++) {\n    for (k = 0; k < n2; k++) {\n      a[k] = s[i + k];\n    }\n    a[n2] = '\\0';\n    result = strcmp(a, b);\n    if (result == 0) {\n      n = i;\n      break;\n    } else\n      continue;\n  }\n  for (i = 0; i < n1; i++) {\n    if (i == n) {\n      printf(\"%s\", r);\n      i = i + n2 - 1;\n    } else {\n      cout << s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char f(char str[], char substr[], char rep[]);\n  char str[256], substr[256], rep[256];\n  scanf(\"%s %s %s\", str, substr, rep);\n  f(str, substr, rep);\n  puts(str);\n  return 0;\n}\nchar f(char str[256], char substr[256], char rep[256]) {\n  char s[256];\n  int i = 0, j, k;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[0]) {\n      for (j = 0; j < strlen(substr); j++)\n        s[j] = str[j + i];\n      s[j] = '\\0';\n      if (strcmp(substr, s) == 0) {\n        for (k = 0; k < strlen(rep); k++, i++)\n          str[i] = rep[k];\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], replace[256];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> replace;\n\n  int ls = strlen(s);\n  int lsub = strlen(sub);\n  char sr[256];\n  int i, j;\n  int same;\n  for (i = 0; i < ls; i++) {\n    for (j = 0; j < lsub; j++) {\n      sr[j] = s[i + j];\n    }\n    sr[j] = '\u0000';\n    same = strcmp(sr, sub);\n    if (same == 0) {\n      printf(\"%s\", replace);\n      i = i + lsub;\n      printf(\"%s\", &s[i]);\n      break;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, a1, b1, c1, n = 0, m, t, j, p = 0;\n  cin >> a >> b >> c;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i < a1; i++) {\n    for (j = 0; j < b1; j++) {\n      if (a[i + j] == b[j])\n        p = p + 1;\n    }\n    if (p == b1) {\n      for (m = 0; m < i; m++)\n        printf(\"%c\", a[m]);\n      cout << c;\n      for (m = b1 + i; m < a1; m++)\n        printf(\"%c\", a[m]);\n      n = 9;\n      break;\n    }\n    p = 0;\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char yuan[256] = {0}, huan[256] = {0}, hou[256] = {0};\n  int i, e, k, len1, len2, len3, count;\n\n  cin >> yuan;\n\n  cin >> huan;\n\n  cin >> hou;\n  len1 = strlen(yuan);\n  len2 = strlen(huan);\n  len3 = strlen(hou);\n\n  int p = 0;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    count = 0;\n    if (yuan[i] == huan[0]) {\n      for (e = 0; e < len2; e++)\n        if (yuan[i + e] == huan[e])\n          count++;\n      if (count == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", yuan[k]);\n        for (k = i; k < len3 + i; k++)\n          printf(\"%c\", hou[k - i]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", yuan[k]);\n        p = 1;\n        break;\n      }\n    }\n  }\n\n  if (p == 0)\n    printf(\"%s\", yuan);\n  return 0;\n}\n"}
{"label": "7", "index": "12695", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s%s%s\", b, a, c);\n  int alen, blen, clen, i, j;\n  alen = strlen(a);\n  blen = strlen(b);\n  clen = strlen(c);\n  int n = 0;\n  for (i = 0; i < blen; i++) {\n    if (b[i] == a[0]) {\n      n = 1;\n      for (j = 0; j < alen; j++)\n        if (a[j] != b[i + j]) {\n          n = 2;\n          break;\n        }\n    }\n    if (n == 1)\n      break;\n  }\n  int t = i;\n  if (n == 1) {\n    for (i = 0; i < t; i++)\n      printf(\"%c\", b[i]);\n    printf(\"%s\", c);\n    for (i = t + clen; i < blen; i++)\n      printf(\"%c\", b[i]);\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "12696", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j;\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    if (a[i - 1] == b[0]) {\n      for (j = 1; b[j - 1] != '\u0000'; j++) {\n        if (a[i - 1 + j - 1] != b[j - 1])\n          break;\n      }\n      if (b[j - 1] != '\u0000')\n        continue;\n      else {\n        for (j = i; b[j - i] != '\u0000'; j++)\n          a[j - 1] = c[j - i];\n      }\n      break;\n    } else\n      continue;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12697", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[999], b[999], *aa, *bb;\n  char c[999][999], *cc;\n  char d[999];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> d;\n  int len = strlen(a);\n  int len2 = strlen(b);\n  int k = 0, i, j = 0;\n  for (bb = b; *(bb + len - 1) != '\u0000'; bb++, k++) {\n    i = 0;\n    for (cc = c[k]; i < len; i++, cc++) {\n      *cc = *(bb + i);\n    }\n    *cc = '\u0000';\n    j++;\n  }\n  int sp = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      sp = 1;\n      break;\n    }\n  }\n  char e[2][999];\n  int pom = i;\n  for (i = 0; i < pom; i++) {\n    e[0][i] = b[i];\n    e[0][pom] = '\u0000';\n  }\n  k = 0;\n  for (i = pom + len; i < len2; i++, k++) {\n    e[1][k] = b[i];\n  }\n  e[1][k] = '\u0000';\n  if (sp == 1) {\n    printf(\"%s%s%s\", e[0], d, e[1]);\n  }\n  if (sp == 0) {\n    puts(b);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int l, i, j, k, temp;\n  scanf(\"%s %s %s\", a, b, c);\n  l = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      temp = 0;\n      for (j = 0; j < l; j++) {\n        if (b[j] != a[j + i])\n          break;\n      }\n      if (j == l) {\n        for (j = 0; j < l; j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "12699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, len2, i, j, f, ff;\n  char s[300], sub[300], replace[300];\n\n  cin >> s;\n  len = strlen(s);\n\n  cin >> sub;\n\n  cin >> replace;\n  len2 = strlen(sub);\n  f = 0;\n  for (i = 0; i <= len - len2; i++) {\n    ff = 1;\n    for (j = 0; j < len2; j++)\n      if (sub[j] != s[i + j]) {\n        ff = 0;\n        break;\n      }\n    if (ff == 0)\n      continue;\n    for (j = 0; j < i; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", replace);\n    for (j = i + len2; j < len; j++)\n      printf(\"%c\", s[j]);\n    f = 1;\n    break;\n  }\n  if (f == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, k, m;\n  char s[256], s1[256], s2[256];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  a = strlen(s);\n  b = strlen(s1);\n  c = strlen(s2);\n  for (i = 0; i < a; i++) {\n    if (s[i] == s1[0]) {\n      for (j = 0; j < b; j++) {\n        if (s[i + j] != s1[j]) {\n          break;\n        }\n      }\n      if (s[i + b - 1] == s1[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          cout << s[k];\n        printf(\"%s\", s2);\n        for (k = i + b; k < a; k++)\n          cout << s[k];\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(int x, int y) {\n  if (x > y)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char str1[260], str2[260], str3[260];\n  cin >> str1 >> str2 >> str3;\n  int L = strlen(str2), len = strlen(str1), k, i;\n  for (i = 0; i < len; i++) {\n    k = 0;\n    while (str2[k] == str1[i + k] && k < L) {\n      k++;\n    }\n    if (k == L) {\n      break;\n    }\n  }\n  if (i == len) {\n    for (int q = 0; q < len; q++) {\n      cout << str1[q];\n    }\n    return 0;\n  }\n  for (int q = 0; q < i; q++) {\n    printf(\"%c\", str1[q]);\n  }\n  cout << str3;\n  for (int q = i + strlen(str2); q < len; q++) {\n    printf(\"%c\", str1[q]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  scanf(\"%s %s %s \", string, substring, replacement);\n  int i, j = 0, length1, length2, m, num = 0;\n  length1 = strlen(string);\n  length2 = strlen(substring);\n  for (i = 0; i < length1; i++) {\n    m = i;\n    if (string[i] == substring[j]) {\n\n      for (j = 0; j < length2; j++) {\n        if (string[i] == substring[j]) {\n          i++;\n          num++;\n        }\n      }\n    }\n    j = 0;\n    i = m;\n    if (num == length2) {\n      for (j = 0; j < length2; j++) {\n        string[i] = replacement[j];\n        i++;\n      }\n      break;\n    }\n    num = 0;\n  }\n  cout << string << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[258], str2[258], str3[258], ch[600];\n  int len1, len2, len3, i = 0, j = 0;\n  int m, n = 0;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i < len1; i++) {\n    n = 0;\n    m = i;\n    if (str1[m] == str2[j]) {\n      n = 1;\n      for (j = 0, m; j < len2; j++, m++) {\n        if (str1[m] != str2[j]) {\n          n = 0;\n          j = 0;\n          break;\n        }\n      }\n      if (n == 1) {\n        m = i;\n        for (i = 0; i < len1 + len3 - len2; i++) {\n          if (i >= m && i < m + len3)\n            ch[i] = str3[i - m];\n          else if (i < m)\n            ch[i] = str1[i];\n          else\n            ch[i] = str1[len2 + i - len3];\n        }\n        break;\n      }\n    }\n  }\n  if (n == 1)\n    for (i = 0; i < len1 + len3 - len2; i++)\n      printf(\"%c\", ch[i]);\n  else\n    for (i = 0; i < len1; i++)\n      printf(\"%c\", str1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin.getline(str, 256);\n  cin.getline(sub, 256);\n  cin.getline(rep, 256);\n  int i, j, len1, len2;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i <= len1 - len2; i++) {\n    j = 0;\n    while (str[i + j] == sub[j] && j < len2)\n      j++;\n    if (j == len2) {\n      while (j > 0) {\n        j--;\n        str[i + j] = rep[j];\n      }\n      break;\n    }\n  }\n  cout << str << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "7", "index": "12705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300], sub[300], rep[300], tmp[300];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int i, j, l1 = strlen(str), l2 = strlen(sub), l3 = strlen(rep);\n  int flag = 0;\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      tmp[j] = str[j + i];\n    }\n    tmp[l2] = '\\0';\n    if (strcmp(tmp, sub) == 0 && flag == 0) {\n      printf(\"%s\", rep);\n      flag = 1;\n      i += l2 - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "12706", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL, *q = NULL;\n  char str[100], substr[100], restr[100];\n  scanf(\"%s %s %s \", str, substr, restr);\n  p = strstr(str, substr);\n  if (p != NULL) {\n    q = p + strlen(substr);\n    strcat(restr, q);\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j = 0, k, t = 0, l, p, h, n, m;\n  char str[3][600];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m = strlen(str[1]);\n  n = strlen(str[0]);\n  p = strlen(str[2]);\n  for (i = 0; i < n - m + 1, j < m; i++) {\n    if (str[0][i] == str[1][j]) {\n      t++;\n      j++;\n    } else {\n      j = 0;\n      t = 0;\n    }\n    if (t == m)\n      break;\n  }\n  if (t != m)\n    cout << str[0];\n  else {\n    for (l = i - m + 1, h = 0; h < p; h++, l++)\n      str[0][l] = str[2][h];\n    cout << str[0];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257] = {0}, substring[257] = {0}, replacement[257] = {0};\n  char temp[257] = {0}, string_1[257] = {0}, string_2[257] = {0};\n  int i, j, k, word = 0;\n  int len1 = 0, len2 = 0, len3 = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  scanf(\"%s \", replacement);\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i, k = 0; j < i + len2, k < len2; j++, k++)\n      temp[k] = string[j];\n\n    if (strcmp(temp, substring) == 0) {\n      word = 1;\n      len3 = i;\n      break;\n    }\n  }\n  for (i = 0; i < len3; i++) {\n    string_1[i] = string[i];\n  }\n  if (word == 1) {\n    printf(\"%s\", string_1);\n    printf(\"%s\", replacement);\n    if ((len2 + len3) < len1) {\n      k = 0;\n      for (i = len3 + len2; i < len1; i++) {\n        string_2[k] = string[i];\n        k++;\n      }\n      printf(\"%s\", string_2);\n    }\n  }\n  if (word == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[256], w[256], r[256];\n  int l1, l2, i, j, count, k = 0;\n  scanf(\"%s%s%s\", w, s, r);\n  l1 = strlen(s);\n  l2 = strlen(w);\n  for (i = 0; i < l2 - l1 + 1; i++) {\n    if (w[i] == s[0]) {\n      count = 1;\n      for (j = i + 1; j < i + l1; j++) {\n        if (w[j] != s[j - i])\n          break;\n        else\n          count++;\n      }\n      if (count == l1) {\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (j = i; j < i + l1; j++) {\n      w[j] = r[j - i];\n    }\n  }\n  cout << w << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  int temp;\n  scanf(\"%s\", zfc1);\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      zichuan[j] = zfc1[j + i];\n    }\n    if (strcmp(zichuan, zfc2) == 0) {\n      flag = 1;\n      temp = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  } else {\n    for (k = 0; k < temp; k++) {\n      printf(\"%c\", zfc1[k]);\n    }\n    cout << zfc3;\n    for (t = temp + len2; zfc1[t] != '\\0'; t++) {\n      printf(\"%c\", zfc1[t]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], t[256], h[256];\n  scanf(\"%s %s %s\", s, t, h);\n  int ss = strlen(s), tt = strlen(t);\n  int i, j, count = 0, place = -1;\n  for (i = 0; i < ss; i++) {\n    count = 0;\n    for (j = 0; j < tt; j++) {\n      if (t[j] - s[i + j] == 0)\n        count++;\n    }\n    if (count == tt) {\n      place = i;\n      break;\n    }\n  }\n  if (place == -1)\n    printf(\"%s\", s);\n  else {\n    for (i = 0; i < place; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", h);\n    for (i = place + tt; i < ss; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sta[256];\n  char stb[256];\n  char res[512] = \"\";\n\n  scanf(\"%s \", str);\n\n  cin >> sta;\n\n  cin >> stb;\n\n  char *a = str;\n  char *b = 0;\n\n  if (b = strstr(a, sta)) {\n    strncat(res, a, b - a);\n    strcat(res, stb);\n    a = b + strlen(sta);\n  }\n\n  strcat(res, a);\n\n  cout << res << \" \";\n\n  return 0;\n}\n"}
{"label": "7", "index": "12713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j = 0, k = -1, n, p, q, s, h = 0, r;\n  int d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < 256; i++) {\n    if (a[i] == b[0]) {\n      k = 0;\n      d[j] = i;\n      j += 1;\n    }\n  }\n  n = strlen(b);\n  p = strlen(c);\n  q = strlen(a);\n  if (k != -1) {\n    for (s = 0; s < j; s++) {\n      for (i = d[s]; i < d[s] + n; i++) {\n        r = d[s];\n        if (a[i] != b[i - r]) {\n          h += 1;\n          break;\n        }\n      }\n      if (i == d[s] + n) {\n        for (r = 0; r < d[s]; r++) {\n          printf(\"%c\", a[r]);\n        }\n        for (r = 0; r < p; r++) {\n          printf(\"%c\", c[r]);\n        }\n        for (r = d[s] + n; r < q; r++) {\n          printf(\"%c\", a[r]);\n        }\n        break;\n      }\n    }\n    if (h == j) {\n      printf(\"%s\", a);\n    }\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12714", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s = (char *)malloc(256), *s1 = (char *)malloc(256),\n       *s2 = (char *)malloc(256);\n  int i, j, k, m = 0;\n  cin >> s;\n  cin >> s1;\n  cin >> s2;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = i, k = 0;\n         (*(s + j) != '\u0000') && (*(s1 + k) != '\u0000') && (*(s + j) == *(s1 + k));\n         j++, k++)\n      ;\n    if (k == strlen(s1)) {\n      for (j = i, k = j + strlen(s1); k < strlen(s); k++, j++)\n        *(s + j) = *(s + k);\n      *(s + j + strlen(s2)) = '\u0000';\n      for (j = --j + strlen(s2), k = j - strlen(s2); k >= i; j--, k--)\n        *(s + j) = *(s + k);\n      for (j = i, k = 0; *(s2 + k) != '\u0000'; j++, k++)\n        *(s + j) = *(s2 + k);\n      m = m + 1;\n    }\n    if (m != 0)\n      break;\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  int i;\n  int b, c;\n  char *p;\n  scanf(\"%s%s%s\", str1, str2, str3);\n  b = strlen(str2);\n  p = strstr(str1, str2);\n  if (p)\n\n  {\n    for (i = 0; str1 + i < p; i++)\n      printf(\"%c\", str1[i]);\n\n    printf(\"%s\", str3);\n\n    p = p + b;\n\n    printf(\"%s\", p);\n\n  }\n\n  else\n    printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "12716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[300], substring[300], replacement[300], test[300];\n  int lensub, len, i, j;\n  cin >> string >> substring >> replacement;\n  len = strlen(string);\n  lensub = strlen(substring);\n  for (i = 0; i <= len - lensub; i++) {\n    for (j = 1; j <= lensub; j++) {\n      test[j - 1] = string[i + j - 1];\n      test[j] = '\\0';\n    }\n    if (strcmp(test, substring) != 0) {\n      cout << string[i];\n    } else {\n      printf(\"%s\", replacement);\n      i += lensub;\n      break;\n    }\n  }\n  for (; i <= len - 1; i++) {\n    printf(\"%c\", string[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n\n  int wz = -1;\n  int len1, len2;\n  int i, j, x;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    if (str[i] == sub[0]) {\n      x = 1;\n      wz = i;\n      for (j = 0; j < len2; i++, j++) {\n        if (sub[j] != str[i]) {\n          x = 0;\n          i = wz;\n\n          break;\n        }\n      }\n      if (x != 0) {\n        break;\n      }\n    }\n  }\n  if (wz == -1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < wz; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", rep);\n    for (i += len2; i < len1; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int len1, len2, len3, i, j, sum = 0;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[0]) {\n      sum = 0;\n      for (j = 0; j < len2; j++) {\n        if (a[i + j] == b[j]) {\n          sum++;\n        }\n      }\n      if (sum == len2) {\n        for (j = 0; j < len3; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "12719", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, p;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i <= strlen(a) - strlen(b); i++) {\n    p = 0;\n\n    for (j = i; j < i + strlen(b); j++)\n      if (b[j - i] == a[j])\n        p++;\n\n    if (p == strlen(b)) {\n      d[i] = '\u0000';\n      break;\n    }\n    d[i] = a[i];\n  }\n  if (i == strlen(a) - strlen(b) + 1)\n    puts(a);\n  else {\n    strcat(d, c);\n\n    for (j = i + strlen(b); j < strlen(a); j++)\n      e[j - i - strlen(b)] = a[j];\n    e[j - i - strlen(b)] = '\u0000';\n    strcat(d, e);\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char q[100], a[10], b[10], lenb, I, *c;\n  int i;\n\n  cin >> q;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = strlen(b);\n  c = strstr(q, a);\n  if (c != NULL) {\n    strncpy(c, b, lenb);\n    puts(q);\n  } else if (c == NULL) {\n    puts(q);\n  }\n}\n"}
{"label": "7", "index": "12721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2) {\n      for (j = 0; j < len2; j++)\n        s1[i + j] = s3[j];\n      c++;\n    }\n    if (c == 1)\n      break;\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12722", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l1, l2, k, j, g = 0, c = 0, m = 0, t = 0;\n  char s[256] = {'\u0000'}, sub[256] = {'\u0000'}, replacement[256] = {'\u0000'},\n       w[1000] = {'\u0000'}, z[265] = {'\u0000'};\n  cin >> s >> sub >> replacement;\n  l1 = strlen(s);\n  l2 = strlen(sub);\n  for (i = 0; t <= l1 - 1; i = t) {\n    if (m == 0) {\n      if (s[i] == sub[0]) {\n        for (k = 0, j = i; k <= l2 - 1; k++, j++) {\n          if (sub[k] == s[j])\n            c++;\n        }\n        if (c >= l2) {\n          strcat(w, replacement);\n          m++;\n          t = t + l2;\n        } else {\n          z[0] = s[i];\n          strcat(w, z);\n          t++;\n        }\n        c = 0;\n      } else {\n        z[0] = s[i];\n        strcat(w, z);\n        t++;\n      }\n    } else {\n      z[0] = '\u0000';\n      for (k = i, j = 0; k <= l1 - 1; k++, j++)\n        z[j] = s[k];\n      strcat(w, z);\n      break;\n    }\n  }\n  if (m != 0)\n    printf(\"%s \", w);\n  else\n    printf(\"%s \", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[257 * 2], a[257], b[257];\n  cin >> s1;\n  cin >> a;\n  scanf(\"%s\", b);\n  int i, j, k, st, end;\n  st = 0;\n  end = 0;\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == a[0]) {\n      for (k = i + 1, j = 1; s1[k] != 0 && a[j] != 0; k++, j++) {\n        if (s1[k] != a[j])\n          break;\n      }\n      if (a[j] == 0) {\n        st = i;\n        end = k;\n        break;\n      }\n    }\n  }\n  if (st < end) {\n    if (strlen(a) > strlen(b)) {\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n      for (k = end; s1[k] != 0; k++, i++) {\n        s1[i] = s1[k];\n      }\n      s1[i] = 0;\n    } else {\n      i = strlen(s1) + strlen(b) - strlen(a);\n      for (k = strlen(s1); k >= end; k--, i--) {\n        s1[i] = s1[k];\n      }\n      for (i = st, j = 0; b[j] != 0; i++, j++) {\n        s1[i] = b[j];\n      }\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12724", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100], s[100], ex[100], b[100];\n  int i, j, k, flag, len, D;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    flag = 1;\n    if (s[i] == a[0]) {\n      k = i;\n      for (j = i; j < i + len; j++) {\n        ex[j - i] = s[k];\n        k++;\n      }\n      for (j = 0; j < len; j++) {\n        if (ex[j] != a[j])\n          flag = 0;\n      }\n    } else\n      flag = 0;\n\n    if (flag) {\n      D = i;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < D; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      printf(\"%c\", b[i]);\n    }\n    for (i = D + len; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else\n    for (i = 0; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], s1[300], s2[300] = {'\u0000'};\n  int i, j, len, count = 0, m;\n\n  cin >> s;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  len = strlen(s);\n  for (i = 0; i < len; i++)\n    if (s[i] == s1[0]) {\n      for (j = 1; s1[j] != '\u0000'; j++)\n        if (s[j + i] != s1[j])\n          break;\n      if (j >= strlen(s1)) {\n        m = i;\n        count = 1;\n        break;\n      }\n    }\n  if (count) {\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s[i]);\n    for (i = 0; s2[i] != '\u0000'; i++)\n      printf(\"%c\", s2[i]);\n    for (j = i + m; j < len; j++)\n      printf(\"%c\", s[j]);\n  } else\n    printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257];\n  char sub[257];\n  char rep[257];\n  int i = 0, j = 0, k = 0, a;\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  a = strlen(sub);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[j]) {\n      j++;\n      if (j == a) {\n        k = i;\n        break;\n      }\n    } else\n      j = 0;\n  }\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (i == k - a + 1) {\n      printf(\"%s\", rep);\n      i = k;\n    } else\n      cout << str[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int n, m, i, j, p;\n  cin >> s >> a >> b;\n  n = strlen(s);\n  m = strlen(a);\n\n  for (i = 0, j = 0; i < m, j < n; j++) {\n    if (a[i] == s[j]) {\n      p = j;\n      i++;\n      if (i == m)\n        break;\n    } else\n      i = 0;\n  }\n\n  if (i == m)\n    for (i = 0; i < m; i++)\n      s[p - m + 1 + i] = b[i];\n\n  cout << s << \"\\n\";\n}\n"}
{"label": "7", "index": "12728", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s3[100];\n  char s1[100];\n  char s2[100];\n  int L1, L2, i, j;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  L1 = strlen(s1);\n  L2 = strlen(s2);\n  for (i = 0; i < L1; i++) {\n    if (s1[i] == s2[0] && s1[i + L2 - 1] == s2[L2 - 1]) {\n      for (j = i; j < i + L2; j++)\n        s1[j] = s3[j - i];\n\n      break;\n    }\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[102], a[102], b[102];\n  char *p1, *p2, *p3;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  int i, j, k = 0, len, m, len2;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (*p2 == p1[i]) {\n      j = i;\n      m = i;\n      for (; *p2 != '\u0000'; p2++, j++) {\n        if (*p2 == p1[j]) {\n          k++;\n        } else {\n          break;\n        }\n      }\n    }\n  }\n  len2 = strlen(a);\n  if (k != len2) {\n    printf(\"%s\", s);\n  }\n  if (k == len2) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = i + k; i < len; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[256], b[256];\n  int n, m, p, i, j, k;\n  cin.getline(s, 256);\n  cin.getline(a, 256);\n  cin.getline(b, 256);\n  n = strlen(s);\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0]) {\n      for (j = 1; j < m; j++)\n        if (a[j] != s[j + i])\n          break;\n      if (j == m) {\n        if (m == p) {\n          for (j = 0; j < m; j++)\n            s[i + j] = b[j];\n        } else {\n          if (p < m) {\n            for (j = 0; j < p; j++)\n              s[i + j] = b[j];\n            for (j = i + p;; j++) {\n              s[j] = s[j + m - p];\n              if (s[j] == '\\0')\n                break;\n            }\n          } else {\n            for (j = 0;; j++) {\n              if (n - j == i + m - 1)\n                break;\n              s[n + p - m - j] = s[n - j];\n            }\n            for (k = 0; k < p; k++)\n              s[i + k] = b[k];\n          }\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12731", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[260], sbstr[260], rplyc[260], *p1, *p2, *p3;\n  int i, j, a, b, m;\n\n  cin >> str;\n\n  cin >> sbstr;\n\n  cin >> rplyc;\n  a = strlen(str);\n  b = strlen(sbstr);\n\n  for (i = 0; i < a - b + 1; i++) {\n    m = 0;\n    p1 = str + i;\n    p2 = sbstr;\n    for (j = 0; j < b; j++) {\n      if (*(p1 + j) == *(p2 + j))\n        m++;\n    }\n\n    if (m == b) {\n      p1 = str + i;\n      p3 = rplyc;\n      for (j = 0; j < b; j++)\n        *(p1 + j) = *(p3 + j);\n      break;\n    }\n  }\n  puts(str);\n}\n"}
{"label": "7", "index": "12732", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000], h;\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s\", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      h = replace[j];\n\n      mubiao[i] = h;\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[260], c[260], d[520];\n  int i, m, a1, b1, c1;\n  char *k;\n  int j;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  k = strstr(a, b);\n\n  if (k == NULL)\n    printf(\"%s\", a);\n  else {\n    m = k - &a[0];\n    for (i = 0; i < m; i++)\n      d[i] = a[i];\n    for (i = 0; i < c1; i++)\n      d[m + i] = c[i];\n    j = m + c1;\n    for (i = 0; m + b1 + i <= a1; i++)\n      d[j + i] = a[m + b1 + i];\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, p, e;\n  char sz[1000], sf[1000], sc[1000];\n\n  cin >> sz;\n\n  cin >> sf;\n\n  cin >> sc;\n  int len = strlen(sz);\n  int len1 = strlen(sf);\n  for (i = 0; i < len; i++) {\n    e = 0;\n    if (sz[i] == sf[0]) {\n      for (k = 0; k < len1; k++) {\n        if (sz[i + k] == sf[k]) {\n          e++;\n        }\n      }\n\n      if (e == len1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", sz[m]);\n        }\n        printf(\"%s\", sc);\n        for (p = i + len1; p < len; p++) {\n          printf(\"%c\", sz[p]);\n        }\n\n        break;\n      }\n    }\n  }\n  if (e != len1) {\n    printf(\"%s\", sz);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12735", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000 + 2], b[1000 + 1], c[1000 + 1];\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int len, len1, len2, i, j, flag = 1;\n  len = strlen(a);\n  len1 = strlen(b);\n  len2 = strlen(c);\n  for (i = 0; i < len; i++) {\n    if (i <= len - len1 && flag == 1) {\n      if (a[i] == b[0] && a[i + 1] == b[1] && a[i + len1 - 1] == b[len1 - 1]) {\n        for (j = 0; j < len2; j++)\n          printf(\"%c\", c[j]);\n        i = i + len1 - 1;\n        flag = 0;\n      } else\n        printf(\"%c\", a[i]);\n    } else\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "12736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300], s[100], r[100];\n  int i, j, k, m;\n  scanf(\"%s%s%s\", str, s, r);\n  m = strlen(s);\n  for (i = 0; str[i] != '\\0'; i++) {\n    k = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == s[j])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j] = r[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257];\n  char a[257];\n  char a1[257];\n  int i, j, len, n = 0, k, flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", a1);\n  len = strlen(a);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      n = i;\n      for (j = i + 1, k = 1; j < i + len; j++, k++) {\n        if (s[j] != a[k]) {\n          flag = 0;\n        }\n      }\n      if (flag == 1)\n        break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", a1);\n    for (i = n + len; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n  }\n  if (flag == 0)\n    cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[256], b[256], c[256];\n  int i, j, k, n, m;\n  cin >> s;\n  cin >> b;\n  scanf(\"%s\", &c);\n  n = strlen(s) - strlen(b);\n  for (i = 0; i <= n; i++) {\n    m = 0;\n    for (j = 0, k = i; j < strlen(b); j++, k++) {\n      if (s[k] == b[j]) {\n        m++;\n      }\n    }\n    if (m == strlen(b)) {\n      for (j = i, k = 0; j < strlen(b) + i; j++, k++) {\n        s[j] = c[k];\n      }\n      break;\n    }\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12739", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, l, m, e = 0;\n  char *str;\n\n  memset(s, 0, 100);\n  memset(a, 0, 100);\n  memset(b, 0, 100);\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n\n  l = strlen(a);\n  m = strlen(s);\n  str = s;\n\n  for (i = 0; i <= m - l; i++) {\n    e = 0;\n    for (j = 0; j < l; j++) {\n      if (s[i + j] != a[j]) {\n        e++;\n        break;\n      }\n    }\n\n    if (e == 0) {\n      s[i] = '\u0000';\n      printf(\"%s\", str);\n      printf(\"%s\", b);\n      str = s + i + j;\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[256], sub[256];\nint f(int x) {\n  int i = x, j = 0;\n  while (sub[j] != '\\0') {\n    if (str[i] != sub[j])\n      return 0;\n    i++;\n    j++;\n  }\n  return 1;\n}\nint main() {\n  char rep[256];\n  int i = 0, j = 0;\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  while (str[i] != '\\0') {\n    if (f(i)) {\n      while (rep[j] != '\\0') {\n        str[i] = rep[j];\n        i++;\n        j++;\n      }\n      break;\n    }\n    i++;\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l1, l2, l3, e = 0, sum = 0;\n  char s[300], z[300], h[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(z);\n  l3 = strlen(h);\n  for (i = 0; i <= l1 - l2; i++) {\n    e = 0;\n    for (j = 0; j < l2; j++) {\n      if (z[j] == s[j + i]) {\n        e++;\n      }\n    }\n\n    if (e == l2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", s[j]);\n      }\n      for (j = 0; j < l3; j++) {\n        printf(\"%c\", h[j]);\n      }\n      if (i + l2 < l1 - 1) {\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n      }\n      sum++;\n      break;\n    }\n  }\n  if (sum == 0) {\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, sum = 0, m = 0, t = 0, p, q, flag = 0, flag2 = 0;\n  char str[256], substr[256], rep[256], str1[256], str2[256];\n\n  cin >> str;\n\n  cin >> substr;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(substr);\n  c = strlen(rep);\n  for (m = m; m < a; m++) {\n    if (str[m] == substr[0]) {\n      for (p = m, q = 0; q < b; p++, q++) {\n        if (str[p] != substr[q]) {\n          flag = 1;\n        }\n      }\n      if (flag == 1) {\n        flag = 0;\n\n        continue;\n      } else {\n        flag2 = 1;\n        break;\n      }\n\n    } else {\n      continue;\n    }\n  }\n\n  if (flag2 == 1) {\n\n    for (i = 0, d = 0; i < m, d < m; d++, i++) {\n      str1[d] = str[i];\n    }\n    str1[m] = '\u0000';\n    for (i = m + b, e = 0; i < a, e < a - m - b; e++, i++) {\n      str2[e] = str[i];\n    }\n    str2[a - m - b] = '\u0000';\n    printf(\"%s%s%s\", str1, rep, str2);\n\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, n1, k, sum = 0;\n  char a[257], b[257], c[257];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  n1 = strlen(b);\n  for (i = 0; i < n - n1 + 1; i++) {\n    sum = 0;\n    for (j = i, k = 0; j < i + n1; j++, k++) {\n      if (a[j] != b[k])\n        sum = 1;\n    }\n    if (sum == 0) {\n      for (j = i, k = 0; j < i + n1; j++, k++)\n        a[j] = c[k];\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12744", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], subStr[260], replace[260], str2[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len, i = 0;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr);\n  if (node == NULL)\n    cout << str;\n  else {\n    while (start != node)\n      str2[i++] = *start++;\n    while (*rep != '\\0')\n      str2[i++] = *rep++;\n    node += strlen(subStr);\n    while (*node != '\\0')\n      str2[i++] = *node++;\n    str2[i] = '\\0';\n    cout << str2;\n  }\n  printf(\"\\n\");\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "12745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[50], str2[50], zfc[3][50];\n  int i, j, yes, no = 0, m, n;\n  int len, len1, len2;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  for (i = 0; i < len - len1 + 1; i++) {\n    yes = 0;\n    for (j = 0; j < len1; j++) {\n      if (str[i + j] == str1[j])\n        yes++;\n    }\n\n    if (yes == len1) {\n\n      m = i;\n\n      n = 0;\n      for (i = 0; i < m; i++) {\n        zfc[0][n] = str[i];\n        n++;\n      }\n      zfc[0][m] = '\u0000';\n      printf(\"%s\", zfc[0]);\n      strcpy(zfc[1], str2);\n      printf(\"%s\", zfc[1]);\n      n = 0;\n      for (i = m + len1; i < len; i++) {\n        zfc[2][n] = str[i];\n        n++;\n      }\n      zfc[2][len - m - len1] = '\u0000';\n      printf(\"%s\", zfc[2]);\n\n      break;\n    } else {\n      no++;\n    }\n  }\n  if (no == len - len1 + 1)\n    printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z, m, t = 1, n;\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      } else {\n        if (j == y - 1) {\n          for (m = 0; m < z; m++)\n            printf(\"%c\", c[m]);\n          i = i + y - 1;\n          t = 0;\n        }\n      }\n    }\n    if (j < y - 1) {\n      printf(\"%c\", a[i]);\n    }\n    if (t == 0)\n      break;\n  }\n  for (n = i + 1; n < x; n++)\n    printf(\"%c\", a[n]);\n  return 0;\n}\n"}
{"label": "7", "index": "12747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], *d, *e, *f, *g;\n  int i;\n\n  scanf(\"%s \", a);\n  g = a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  d = strstr(a, b);\n  if (!d) {\n    printf(\"%s\", g);\n    exit(0);\n  }\n  f = a;\n  i = strlen(a) - strlen(d);\n  f[i] = '\u0000';\n  e = a + (strlen(a) - (strlen(d) - strlen(b)));\n  printf(\"%s%s%s \", f, c, e);\n  return 0;\n}\n"}
{"label": "7", "index": "12748", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar *strpos(char string[], char substring[]) {\n  char *p = string;\n  char *temp = NULL;\n  while (*p != '\\0') {\n    if (*p == substring[0]) {\n      temp = p;\n      p++;\n      int i;\n      for (i = 1; i < strlen(substring); i++) {\n        if (*p != substring[i])\n          break;\n\n        p++;\n      }\n      if (i == strlen(substring))\n        break;\n      else\n        p = temp + 1;\n    } else\n      p++;\n  }\n  return temp;\n}\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin.getline(string, 257);\n  cin.getline(substring, 257);\n  cin.getline(replacement, 257);\n  char *p = strpos(string, substring);\n  if (p != NULL) {\n    int t = 0, count = 0;\n    while (count != strlen(substring)) {\n      *p = replacement[t++];\n      p++;\n      count++;\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], temp[100];\n  int i, j = 0, k, lena, lenb, mark = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < lenb; j++) {\n        if (a[i + j] == b[j])\n          mark = 1;\n        else {\n          mark = 0;\n          break;\n        }\n      }\n    }\n    if (mark == 1) {\n      for (k = 0; k < lenb; k++)\n        a[i + k] = c[k];\n      break;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12750", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000], h;\n  char zichuan[1000];\n  char replace[1000];\n  int i, x;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  scanf(\"%s\", zichuan);\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      h = replace[j];\n\n      mubiao[i] = h;\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "12751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  int i, j, len1, len2, ex = 0, a = 0, shit = 0;\n\n  cin >> string;\n\n  scanf(\"%s \", substring);\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (string[i + j] == substring[j]) {\n        ex++;\n      }\n      if (ex == len2 && shit == 0) {\n        shit = 1;\n        for (j = a; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        printf(\"%s\", replacement);\n        a = i + len2;\n      }\n    }\n    ex = 0;\n  }\n  for (j = a; j < len1; j++) {\n    printf(\"%c\", string[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, p, f;\n  char str[257], a[257], b[257];\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n = strlen(str);\n  m = strlen(a);\n  p = 1;\n\n  for (i = 0; i < n; i++) {\n    f = 1;\n    for (j = 0; j < m; j++)\n      if (str[i + j] != a[j]) {\n        f = 0;\n        break;\n      }\n    if ((p) && (f)) {\n      printf(\"%s\", b);\n      p = 0;\n      i += m - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12753", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0, x = 0;\n  while (i < strlen(a)) {\n    if (a[i] == b[0]) {\n      int j;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      }\n      if (j == strlen(b) && x == 0) {\n        printf(\"%s\", c);\n        x = 1;\n        i += strlen(b);\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char s[100], c[100], a[100];\n  cin >> s;\n  cin >> c;\n  cin >> a;\n  k = strlen(s);\n  p = strlen(c);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    for (j = 0; j < p; j++, i++) {\n      if (s[i] != c[j])\n        break;\n    }\n    if (j > p - 1) {\n      for (j = 0; j < p; j++, i++)\n        s[i - p] = a[j];\n      break;\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "7", "index": "12755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, s, k, y;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  for (i = 0; i < strlen(a); i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < strlen(b)) {\n      k++;\n      j++;\n    }\n    if (j == strlen(b)) {\n      y = 0;\n      for (s = i; s < i + strlen(b); s++)\n        a[s] = c[s - i];\n\n      y = 1;\n    }\n    if (y == 1)\n      break;\n  }\n\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  scanf(\"%s\", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  int x, y, i, j, p, q, k, r, t, z;\n  x = strlen(a);\n  y = strlen(b);\n  q = 0;\n  for (i = 0; q == 0 && i < x; i++) {\n    if (b[0] == a[i]) {\n      p = i;\n      for (j = 0; b[j] == a[p] && b[j] != '\u0000' && a[p] != '\u0000'; j++) {\n        p++;\n      }\n      if (j == y) {\n        q = q + 1;\n      }\n    }\n  }\n  if (q == 0) {\n    for (z = 0; z < x; z++) {\n      printf(\"%c\", a[z]);\n    }\n  }\n  if (q != 0) {\n    for (k = 0; k < i - 1; k++) {\n      printf(\"%c\", a[k]);\n    }\n    for (r = 0; r < y; r++) {\n      printf(\"%c\", c[r]);\n    }\n    for (t = i + y - 1; t < x; t++) {\n      printf(\"%c\", a[t]);\n    }\n  }\n}\n"}
{"label": "7", "index": "12757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, t, s, n = 0, k, l;\n  char c1[256], c2[256], c3[256];\n  scanf(\"%s \", c1);\n  scanf(\"%s \", c2);\n  cin >> c3;\n  s = strlen(c2);\n  for (i = 0; c1[i] != '\u0000'; i++) {\n    if (c1[i] == c2[j]) {\n      n++;\n      j++;\n    } else {\n      j = 0;\n      n = 0;\n    }\n    if (n == s) {\n      t = i;\n      break;\n    }\n  }\n  if (n == s) {\n    for (l = 0, k = t - s + 1; k <= t, l < s; l++, k++) {\n      c1[k] = c3[l];\n    }\n  }\n  printf(\"%s\", c1);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n = 0;\n  char t[260], s[260], w[260];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  for (i = 0; i < strlen(w); i++) {\n    k = 1;\n    for (j = 0; j < strlen(s); j++)\n      if (s[j] != w[i + j])\n        k = 0;\n    if (k) {\n      n = i;\n      break;\n    }\n  }\n  if (n) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", w[i]);\n    printf(\"%s\", t);\n    for (i = n + strlen(s); i < strlen(w); i++)\n      printf(\"%c\", w[i]);\n  } else\n    cout << w;\n  return 0;\n}\n"}
{"label": "7", "index": "12759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char string[1000 + 1], substring[1000 + 1], replacement[1000 + 1],\n      out[1000 + 1];\n  int h, i, j, k, n, l, lsub, lreplace, count, heihei = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  l = strlen(string);\n  lsub = strlen(substring);\n  lreplace = strlen(replacement);\n  for (i = 0, n = 0; i < l; i++, n++) {\n    count = 0;\n    for (j = 0; (j < lsub) && (heihei == 0) && (string[i + lsub - 1] != '\u0000');\n         j++) {\n      if (string[i + j] == substring[j])\n        count++;\n    }\n    if (count == lsub) {\n      heihei = 1;\n      for (k = 0; k < lreplace; k++, n++)\n        out[n] = replacement[k];\n\n      i = i + lsub - 1;\n      n--;\n    } else\n      out[n] = string[i];\n  }\n  out[l + lreplace - lsub] = '\u0000';\n  cout << out << \" \";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], d[256], e[256];\n  int i, j, lena, lenb, m, n, k;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    m = 0;\n    for (j = i; j < i + lenb; j++) {\n      if (b[j - i] != a[j])\n        m = 1;\n    }\n    if (m == 0) {\n      for (n = 0; n < i; n++) {\n        d[n] = a[n];\n      }\n      d[n] = '\\0';\n      for (k = i + lenb; k < lena; k++) {\n        e[k - i - lenb] = a[k];\n      }\n      e[k - i - lenb] = '\\0';\n      printf(\"%s%s%s\", d, c, e);\n      break;\n    }\n  }\n  if (m == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, d, e, f, k;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n  scanf(\" \");\n\n  cin >> b;\n  scanf(\" \");\n\n  cin >> c;\n  d = strlen(a);\n  e = strlen(b);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      for (j = 0; j < e; j++, k++)\n        if (b[j] != a[k])\n          break;\n      if (j < e)\n        continue;\n      else\n        break;\n    } else\n      continue;\n  }\n  if (i < d) {\n    for (j = i + e; j < (d - i - e); j++)\n      a[f + j - e] = a[j];\n    for (j = i; j < (i + f); j++)\n      a[j] = c[j - i];\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n}\n"}
{"label": "7", "index": "12762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[500], su[500], re[500];\n  int len1, len2, i, j, k, l, m = 0;\n  scanf(\"%s%s%s\", s, su, re);\n  len1 = strlen(s);\n  len2 = strlen(su);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    k = 0;\n    for (j = 0; j < len2; j++) {\n      if (s[i + j] != su[j]) {\n        break;\n      } else {\n        k++;\n      }\n    }\n    if (k == len2) {\n      m++;\n      for (l = 0; l < len2; l++) {\n        s[i + l] = re[l];\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[100][50], x[256], d[256];\n  int i, n1, n2, k, m, n, want = -1;\n  cin >> a >> b >> d;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  n = n1 - n2 + 1;\n  for (k = 0; k < n; k++) {\n    m = k;\n    for (i = 0; i < n2; i++, m++) {\n      x[i] = a[m];\n    }\n    strcpy(c[k], x);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(b, c[i]) == 0) {\n      want = i;\n      break;\n    }\n  }\n  if (want == 0) {\n    cout << d;\n    for (i = n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == (n1 - n2)) {\n    for (i = 0; i < want; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", d);\n  }\n  if (want > 0 && want < (n1 - n2)) {\n    for (i = 0; i < want; i++)\n      printf(\"%c\", a[i]);\n\n    printf(\"%s\", d);\n    for (i = want + n2; i < n1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  if (want == -1) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      c = 1;\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n\n    if (i >= m && i < b + m && c == 1) {\n      printf(\"%c\", replacement[i - m]);\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[280], b[280], c[280];\n  char res[280];\n  char t[280];\n  int i, j;\n  int check = 0;\n  scanf(\"%s %s %s\", a, b, c);\n\n  for (i = 0; i < strlen(a); i++) {\n    if (check == 1)\n      break;\n    if (b[0] == a[i]) {\n      for (j = 0; j < 280; j++)\n        t[j] = '\\0';\n      for (j = 0; j < 280; j++)\n        res[j] = '\\0';\n      for (j = i; j < i + strlen(b); j++)\n        t[j - i] = a[j];\n      if (strcmp(b, t) == 0) {\n        check = 1;\n        for (j = 0; j < i; j++)\n          res[j] = a[j];\n        for (j = i; j < strlen(c) + i; j++)\n          res[j] = c[j - i];\n        for (j = strlen(c) + i; j < strlen(a) + strlen(c) - strlen(b); j++)\n          res[j] = a[j + strlen(b) - strlen(c)];\n      }\n    }\n  }\n  if (check == 1)\n    printf(\"%s\\n\", res);\n  else\n    printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, e = 0, j, n, m;\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char *pa = a, *ps = s, *p;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; *ps != '\u0000'; ps++, i++) {\n    if (*pa == *ps) {\n      e++;\n      for (pa = pa + 1, ps = ps + 1; *pa != '\u0000'; pa++, ps++) {\n        if (*pa == *ps) {\n          e++;\n        }\n      }\n    }\n\n    if (e == m) {\n\n      p = s;\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", *p);\n        p++;\n      }\n      printf(\"%s\", b);\n      if (n - i > m) {\n        for (j = 0; j < m; j++) {\n          p++;\n        }\n        printf(\"%s\", p);\n        break;\n      } else {\n        break;\n      }\n    } else {\n      if (e > 0) {\n        pa = a;\n        for (j = 0; j < m; j++)\n          ps--;\n      }\n    }\n    e = 0;\n  }\n\n  if (e != m) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar word[256], substring[256], replacement[256];\nint l1, l2, l3;\nint the_same(char *ch) {\n  int i;\n  for (i = 0; i < l2; i++) {\n    if (*(ch + i) != substring[i])\n      return 0;\n  }\n  return 1;\n}\nint main() {\n  char *p = NULL, *q = NULL;\n  int i, t;\n  cin.getline(word, 256);\n  l1 = strlen(word);\n  cin.getline(substring, 256);\n  l2 = strlen(substring);\n  cin.getline(replacement, 256);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    t = the_same(&word[i]);\n    if (t == 1) {\n      p = word + i;\n      break;\n    }\n  }\n  if (p == NULL) {\n    for (i = 0; i < l1; i++)\n      cout << word[i];\n  } else {\n    for (q = word; q < p; q++)\n      cout << *q;\n    for (i = 0; i < l3; i++)\n      cout << replacement[i];\n    for (q = p + l2; q < word + l1; q++)\n      cout << *q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12768", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[256], str2[256], str3[256];\n  scanf(\"%s %s %s \", str1, str2, str3);\n  int i = 0, j = 0, l1 = strlen(str1), l2 = strlen(str2);\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      if (str1[i + j] != str2[j])\n        break;\n    }\n    if (j == l2) {\n      for (j = 0; j < l2; j++) {\n        str1[i + j] = str3[j];\n      }\n      break;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    cout << str1[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12769", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char a[300], b[300], c[300];\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  p = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++)\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; k < p; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == p) {\n        for (j = i, k = 0; k < p; j++, k++)\n          a[j] = c[k];\n        printf(\"%s\", a);\n        break;\n      }\n    }\n  if (a[i] == '\u0000')\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, l1, l2, l3, e = 0, sum = 0;\n  char s[300], z[300], h[300];\n  cin >> s;\n  scanf(\"%s\", z);\n  cin >> h;\n  l1 = strlen(s);\n  l2 = strlen(z);\n  l3 = strlen(h);\n  for (i = 0; i <= l1 - l2; i++) {\n    e = 0;\n    for (j = 0; j < l2; j++) {\n      if (z[j] == s[j + i])\n        e++;\n    }\n\n    if (e == l2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", s[j]);\n      }\n      for (j = 0; j < l3; j++) {\n        printf(\"%c\", h[j]);\n      }\n      if (i + l2 < l1 - 1) {\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n      }\n      sum++;\n      break;\n    }\n  }\n  if (sum == 0) {\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int i, j, n, m1, m2, x = -1, y = 0;\n  scanf(\"%s%s%s\", s, a, b);\n  n = strlen(s);\n  m1 = strlen(a);\n  m2 = strlen(b);\n  for (i = 0; i <= n - m1; i++) {\n    if (s[i] == a[0]) {\n      y = 1;\n      for (j = 1; j < m1; j++) {\n        if (s[i + j] != a[j]) {\n          y = 0;\n          break;\n        }\n      }\n    }\n    if (y == 1) {\n      x = i;\n      break;\n    }\n  }\n  if (x == -1)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < x; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", b);\n    for (i = x + m1; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "7", "index": "12772", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], subs[256], rpl[256];\n  int i, j, len1 = 0, len2 = 0, c = 0, m;\n  cin >> str >> subs >> rpl;\n  len1 = strlen(subs);\n  len2 = strlen(rpl);\n  for (i = 0; i < 256 && str[i] != 0; i++) {\n    if (str[i] == subs[0]) {\n      c = 0;\n      for (j = 0; j < len1; j++) {\n        if (str[i + j] != subs[j]) {\n          c = 1;\n          break;\n        } else {\n          c = c + 1;\n        }\n      }\n    }\n    if (c == len1) {\n      break;\n    }\n  }\n  if (c == 0) {\n    for (m = 0; m < 256 && str[m] != 0; m++) {\n      printf(\"%c\", str[m]);\n    }\n  }\n  if (c == len1) {\n    for (m = 0; m < i; m++) {\n      cout << str[m];\n    }\n    for (m = i; m < i + len2; m++) {\n      cout << rpl[m - i];\n    }\n    for (m = i + len2; m < 256 && str[m] != 0; m++) {\n      printf(\"%c\", str[m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12773", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n\n  char string[256];\n  scanf(\"%s\", string);\n\n  char substring[256];\n  scanf(\"%s\", substring);\n\n  char replacement[256];\n  scanf(\"%s \", replacement);\n\n  int Lsub = 0;\n  for (int i = 0;; i++) {\n    if (substring[i] == '\u0000') {\n      Lsub = i;\n      break;\n    }\n  }\n\n  int Lrep = 0;\n  for (int i = 0;; i++) {\n    if (replacement[i] == '\u0000') {\n      Lrep = i;\n      break;\n    }\n  }\n\n  int pBegin = 1000, judge = 1;\n  for (int i = 0; i < 256 - Lsub; i++) {\n    judge = 1;\n    for (int j = i; j < i + Lsub; j++) {\n      if (string[j] - substring[j - i] != 0) {\n        judge = 0;\n        break;\n      }\n      if (j - i == Lsub - 1) {\n        break;\n      }\n    }\n    if (judge == 1) {\n      pBegin = i;\n      break;\n    }\n  }\n  if (pBegin == 1000) {\n    printf(\"%s\", string);\n  }\n\n  else {\n\n    char Ans[512];\n    for (int i = 0; i < pBegin; i++) {\n      Ans[i] = string[i];\n    }\n\n    for (int i = pBegin; i < pBegin + Lrep; i++)\n      Ans[i] = replacement[i - pBegin];\n\n    for (int i = pBegin + Lrep;; i++) {\n      Ans[i] = string[i - (pBegin + Lrep) + pBegin + Lsub];\n      if (Ans[i] == '\u0000') {\n        break;\n      }\n    }\n\n    printf(\"%s\", Ans);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[50], str2[50], zfc[3][50];\n  int i, j, yes, no = 0, m, n;\n  int len, len1, len2;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", str1);\n\n  scanf(\"%s \", str2);\n  len = strlen(str);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  for (i = 0; i < len - len1 + 1; i++) {\n    yes = 0;\n    for (j = 0; j < len1; j++) {\n      if (str[i + j] == str1[j])\n        yes++;\n    }\n\n    if (yes == len1) {\n\n      m = i;\n\n      n = 0;\n      for (i = 0; i < m; i++) {\n        zfc[0][n] = str[i];\n        n++;\n      }\n      zfc[0][m] = '\u0000';\n      printf(\"%s\", zfc[0]);\n      strcpy(zfc[1], str2);\n      printf(\"%s\", zfc[1]);\n      n = 0;\n      for (i = m + len1; i < len; i++) {\n        zfc[2][n] = str[i];\n        n++;\n      }\n      zfc[2][len - m - len1] = '\u0000';\n      printf(\"%s\", zfc[2]);\n\n      break;\n    } else {\n      no++;\n    }\n  }\n  if (no == len - len1 + 1) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[300];\n  char sub[300];\n  char rep[300];\n  int i, j, lenstr, lensub, judge, state = 0;\n  fgets(str, 300, stdin);\n  fgets(sub, 300, stdin);\n  fgets(rep, 300, stdin);\n  lenstr = strlen(str) - 1;\n  lensub = strlen(sub) - 1;\n  for (i = 0; i <= lenstr - lensub; i++) {\n    judge = 0;\n    for (j = 0; j < lensub; j++)\n      judge = judge + (str[i + j] - sub[j]) * (str[i + j] - sub[j]);\n\n    if (judge == 0) {\n      state = 1;\n      break;\n    }\n  }\n  if (state == 1) {\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%c\", str[j]);\n    for (j = 0; rep[j] != '\\n'; j++)\n      cout << rep[j];\n    for (j = i + lensub; j <= lenstr - 1; j++)\n      printf(\"%c\", str[j]);\n  } else {\n    for (j = 0; j < lenstr; j++)\n      printf(\"%c\", str[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  char string[256] = {'\\0'};\n  char subString[100] = {'\\0'};\n  char replacement[100] = {'\\0'};\n  int i = 0, j = 0, k = 0;\n  char c = '\\0';\n  while (c != '\\n') {\n    c = getchar();\n    if (c != '\\n') {\n      string[i] = c;\n      i++;\n    }\n  }\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    if (string[i] == subString[0]) {\n      k = i;\n      for (j = 0; j < strlen(subString); j++, k++) {\n        if (subString[j] != string[k]) {\n          break;\n        }\n      }\n      if (j == strlen(subString)) {\n        k = i;\n        for (j = 0; j < strlen(replacement); j++, k++) {\n          string[k] = replacement[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << string << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12777", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf[100], zf1[100], zf2[100];\n  int i, j, k;\n\n  scanf(\"%s \", zf);\n\n  cin >> zf1;\n\n  cin >> zf2;\n  k = strlen(zf1);\n  for (i = 0; zf[i] != 0; i++) {\n\n    for (j = 0; zf1[j] != 0; j++) {\n      if (zf1[j] != zf[i + j]) {\n        break;\n      }\n    }\n    if (j == (k)) {\n      for (j = 0; zf2[j] != 0; j++) {\n        zf[i + j] = zf2[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "12778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[260], sub[260], re[260];\n  int i, len1, len2, m, xxx, yyy = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    xxx = 0;\n    for (m = 0; m < len2; m++) {\n      if (s[i + m] == sub[m]) {\n        xxx++;\n      }\n    }\n    if (xxx == len2) {\n      for (m = 0; m < len2; m++) {\n        s[i + m] = re[m];\n        yyy++;\n        if (yyy == len2)\n          break;\n      }\n      if (yyy == len2)\n        break;\n    }\n  }\n\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12779", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t;\n  char string[256] = {0};\n  char substring[256] = {0};\n  char replacement[256] = {0};\n  cin >> string;\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    t = 0;\n    if (substring[0] == string[i]) {\n      for (j = 0; j < strlen(substring); j++) {\n        if (substring[j] == string[i + j])\n          t++;\n      }\n    }\n    if (t == strlen(substring)) {\n      break;\n    }\n  }\n  if (i < strlen(string) - 1) {\n    for (j = 0; j < strlen(substring); j++)\n      string[j + i] = replacement[j];\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12780", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  cin >> zfc;\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n  for (i = 0; i < n - k + 2; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (dec == 0) {\n      printf(\"%s\", rep);\n      break;\n    } else if ((i != n - 1) && (dec != 0)) {\n      printf(\"%c\", zfc[i]);\n      continue;\n    } else if ((i == n - 1) && (dec != 0)) {\n      printf(\"%c \", zfc[i]);\n    }\n  }\n  if (i == n - k + 2) {\n    printf(\"%s \", &(zfc[i]));\n  } else {\n    printf(\"%s \", &(zfc[i + k]));\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[500], substring[500], replacement[500], temp, str[500];\n  int i, j, k, l, m, len0, len1, len2;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n\n  len1 = strlen(substring);\n\n  len2 = strlen(replacement);\n\n  len0 = strlen(string);\n\n  strcpy(str, string);\n\n  for (i = 0; i < len0; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len1; j++) {\n        if (string[i + 1] == substring[j])\n          i++;\n        else {\n          j = 0;\n          break;\n        }\n      }\n\n      if (j == len1) {\n        k = i;\n        for (i; i < len0 - len1 + len2; i++)\n          str[i - len1 + len2] = string[i];\n\n        for (l = 0; l < len2; l++)\n          str[k - len2 + 1 + l] = replacement[l];\n\n      } else {\n        m = 0;\n      }\n    }\n  }\n\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char q[100], a[10], b[10], lenb, I, *c;\n\n  cin >> q;\n  cin >> a;\n  cin >> b;\n  lenb = strlen(b);\n  c = strstr(q, a);\n  if (c != NULL) {\n    strncpy(c, b, lenb);\n    puts(q);\n  } else if (c == NULL)\n    puts(q);\n  return 0;\n}\n"}
{"label": "7", "index": "12783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[999], b[999], *aa, *bb;\n  char c[999][999], *cc;\n  char d[999];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> d;\n  int len = strlen(a);\n  int len2 = strlen(b);\n  int k = 0, i, j = 0;\n  for (bb = b; *(bb + len - 1) != '\u0000'; bb++, k++) {\n    i = 0;\n    for (cc = c[k]; i < len; i++, cc++) {\n      *cc = *(bb + i);\n    }\n    *cc = '\u0000';\n    j++;\n  }\n  int sp = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      sp = 1;\n      break;\n    }\n  }\n  char e[2][999];\n  int pom = i;\n  for (i = 0; i < pom; i++) {\n    e[0][i] = b[i];\n    e[0][pom] = '\u0000';\n  }\n  k = 0;\n  for (i = pom + len; i < len2; i++, k++) {\n    e[1][k] = b[i];\n  }\n\n  e[1][k] = '\u0000';\n  if (sp == 1) {\n    cout << e[0] << d << e[1];\n  }\n  if (sp == 0) {\n    puts(b);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12784", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[250], b[150], c[150];\n  scanf(\"%s %s %s \", a, b, c);\n  if (strstr(a, b) == NULL) {\n    cout << a;\n    return 0;\n  }\n  char *p = strstr(a, b);\n  int i = 0;\n  while (c[i] != '\\0') {\n    *p++ = c[i];\n    i++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  char *t;\n  t = strstr(a, b);\n  if (t == NULL) {\n    cout << a;\n    return 0;\n  } else {\n    char f = t - a;\n    int d = strlen(a), e = strlen(c);\n    int i = f, j;\n    for (j = 0; j < e; j++) {\n      a[i] = c[j];\n      i++;\n      if (i == t - a + e)\n        break;\n    }\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "12786", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = -2;\n  int lengths, lengtha, lengthb;\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n\n  for (i = 0; i < lengths; i++) {\n    k = 0;\n    for (j = 0; j < lengtha; j++) {\n      if (a[j] == s[i + j]) {\n        k++;\n      }\n    }\n\n    if (k == lengtha) {\n      t = i;\n      break;\n    }\n  }\n  if (t != -2) {\n    for (i = 0; i < t; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = t + lengthb; i < lengths; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else {\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint bd(char *hed, char *zi, int m) {\n  int val = 0, j;\n  char *t1, *t2;\n  for (t1 = hed, t2 = zi, j = 0; j < m; t1++, t2++, j++) {\n    if (*t1 == *t2)\n      val = 1;\n    else {\n      val = 0;\n      break;\n    }\n  }\n  return (val);\n}\nint main() {\n  char *yuan, *zi, *rep, *med;\n  yuan = (char *)malloc(260 * sizeof(char));\n  zi = (char *)malloc(260 * sizeof(char));\n  rep = (char *)malloc(260 * sizeof(char));\n  med = (char *)malloc(260 * sizeof(char));\n\n  cin >> yuan;\n\n  scanf(\"%s \", zi);\n\n  cin >> rep;\n\n  char *p;\n  int n, m, zhi = 0, t;\n\n  for (p = yuan, n = 0; *p != '\u0000'; p++, n++)\n    ;\n  for (p = zi, m = 0; *p != '\u0000'; p++) {\n    m++;\n  }\n  for (p = rep, t = 0; *p != '\u0000'; p++)\n    t++;\n\n  for (p = yuan; p < yuan + n - m + 1; p++)\n    if (bd(p, zi, m) == 1) {\n      zhi = 1;\n      break;\n    }\n\n  if (zhi == 1) {\n    strcpy(med, p + m);\n    strcpy(p, rep);\n    strcpy(p + t, med);\n  }\n  puts(yuan);\n}\n"}
{"label": "7", "index": "12788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, n = 0, m = 1, z = 0, t = 1, g;\n  char q[256], p[256], w[256];\n  scanf(\"%s\", q);\n  scanf(\"%s\", p);\n  scanf(\"%s\", w);\n  k = strlen(q);\n  l = strlen(p);\n  for (i = 0; i < k; i++) {\n    if (p[0] == q[i]) {\n      for (j = 1; j < l; j++) {\n        g = 1;\n        if (p[j] != q[j + i])\n          g = 0;\n      }\n      if (g == 1) {\n        z = 1;\n        m = i;\n        break;\n      }\n    }\n  }\n  if (z) {\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", q[j]);\n    }\n    printf(\"%s\", w);\n    for (j = m + l; j < k; j++)\n      printf(\"%c\", q[j]);\n  } else\n    printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "7", "index": "12789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100];\n  int n, k, j = 0, i, s, d;\n\n  cin >> words;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n = strlen(words);\n  s = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (strncmp(words + i, a, s) == 0) {\n      for (j = i, k = 0; k < d; j++, k++)\n        words[j] = b[k];\n\n      break;\n    }\n  }\n  puts(words);\n  return 0;\n}\n"}
{"label": "7", "index": "12790", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s \", a, b, c);\n  char *p;\n  p = strstr(a, b);\n  if (p) {\n    int n = strlen(a) - strlen(p);\n    int i;\n    int k = strlen(b);\n    int l = strlen(c);\n    int m = 0;\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = n; i < n + l; i++) {\n      printf(\"%c\", c[m]);\n      m++;\n    }\n    for (i = n + k; i < (strlen(a)); i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12791", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256], c[256];\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int sum1 = strlen(b);\n  int i, j, k, m, n, p, q, start, pd = 0;\n  for (start = 0; start < strlen(a); start++) {\n    k = 0;\n    for (i = start; i < start + sum1; i++) {\n      if (a[i] != b[k])\n        break;\n      k++;\n    }\n    if (i == (start + sum1)) {\n      pd = 1;\n      p = start;\n      break;\n    }\n  }\n\n  if (pd == 1) {\n    for (q = p, k = 0; c[k] != '\u0000'; q++, k++)\n      a[q] = c[k];\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, n1, k, sum = 0;\n  char a[257], b[257], c[257];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  n = strlen(a);\n  n1 = strlen(b);\n  for (i = 0; i < n - n1 + 1; i++) {\n    sum = 0;\n    for (j = i, k = 0; j < i + n1; j++, k++) {\n      if (a[j] != b[k])\n        sum = 1;\n    }\n    if (sum == 0) {\n      for (j = i, k = 0; j < i + n1; j++, k++)\n        a[j] = c[k];\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[256], sub[256], repl[256];\n  scanf(\"%s%s%s\", str, sub, repl);\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if (same == 0)\n      printf(\"%c\", str[i]);\n    if (same == 1) {\n      printf(\"%s\", repl);\n      for (k = i + strlen(sub); str[k] != 0; k++) {\n        printf(\"%c\", str[k]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, p, f;\n  char str[257], a[257], b[257];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(str);\n  m = strlen(a);\n  p = 1;\n\n  for (i = 0; i < n; i++) {\n    f = 1;\n    for (j = 0; j < m; j++)\n      if (str[i + j] != a[j]) {\n        f = 0;\n        break;\n      }\n    if ((p) && (f)) {\n      printf(\"%s\", b);\n      p = 0;\n      i += m - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12795", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, sum = 0, m = 0, t = 0, p, q, flag = 0, flag2 = 0;\n  char str[256], substr[256], rep[256], str1[256], str2[256];\n\n  scanf(\"%s \", str);\n\n  cin >> substr;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(substr);\n  c = strlen(rep);\n  for (m = m; m < a; m++) {\n    if (str[m] == substr[0]) {\n      for (p = m, q = 0; q < b; p++, q++) {\n        if (str[p] != substr[q]) {\n          flag = 1;\n        }\n      }\n      if (flag == 1) {\n        flag = 0;\n\n        continue;\n      } else {\n        flag2 = 1;\n        break;\n      }\n\n    } else {\n      continue;\n    }\n  }\n\n  if (flag2 == 1) {\n\n    for (i = 0, d = 0; i < m, d < m; d++, i++) {\n      str1[d] = str[i];\n    }\n    str1[m] = '\u0000';\n    for (i = m + b, e = 0; i < a, e < a - m - b; e++, i++) {\n      str2[e] = str[i];\n    }\n    str2[a - m - b] = '\u0000';\n    printf(\"%s%s%s\", str1, rep, str2);\n\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12796", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int la, lb, lc, i, j, p = 0;\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    if (b[0] == a[i]) {\n      for (j = 1; j < lb; j++) {\n        if (b[j] == a[i + j])\n          p = 0;\n        else\n          p = 1;\n      }\n      if (p == 0) {\n        for (j = 0; j < lc; j++)\n          a[i + j] = c[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12797", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[270], subs[70], rep[70], *p;\n  cin >> str >> subs >> rep;\n  p = strstr(str, subs);\n  if (p != NULL)\n    for (int i = 0; rep[i] != '\\0'; i++) {\n      *p++ = rep[i];\n    }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000 + 2], b[1000 + 1], c[1000 + 1];\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int len, len1, len2, i, j, flag = 1;\n  len = strlen(a);\n  len1 = strlen(b);\n  len2 = strlen(c);\n  for (i = 0; i < len; i++) {\n    if (i <= len - len1 && flag == 1) {\n      if (a[i] == b[0] && a[i + 1] == b[1] && a[i + len1 - 1] == b[len1 - 1]) {\n        for (j = 0; j < len2; j++)\n          printf(\"%c\", c[j]);\n        i = i + len1 - 1;\n        flag = 0;\n      } else\n        printf(\"%c\", a[i]);\n    } else\n      cout << a[i];\n  }\n}\n"}
{"label": "7", "index": "12799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k, len, len1, len2, m;\n  scanf(\"%s%s%s\", string, substr, replace);\n  len1 = strlen(string);\n  len2 = strlen(substr);\n  for (i = 0; i < len1; i++) {\n    if (substr[0] == string[i]) {\n      len = 0;\n      for (j = 0; j < len2; j++) {\n        if ((substr[j] == string[i + j]) && len < len2)\n          len++;\n      }\n      if (len == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string[k]);\n        printf(\"%s\", replace);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string[k]);\n        m = 1;\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  if (m != 1)\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, f, d, k = 0;\n  scanf(\"%s%s%s\", a, b, c);\n  d = strlen(a);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (a[i] == b[0] && a[i + 1] == b[1] && a[i + 2] == b[2] &&\n        a[i + 3] == b[3]) {\n      for (j = i; j < i + f; j++) {\n        a[j] = c[k];\n        k++;\n      }\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, n = 0, lena, lenb;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (b[0] == a[i]) {\n      for (j = 0; j < lenb; j++) {\n        if (b[j] == a[i + j])\n          n++;\n      }\n    }\n    if (n == lenb)\n      break;\n    else\n      n = 0;\n  }\n  if (i < lena) {\n    for (j = 0; j < lenb; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[260], s2[260], s3[260];\n  int i, j, a = 0, b, c, d;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  c = strlen(s2);\n  d = strlen(s1);\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == s2[0]) {\n      for (j = 0; s2[j] != 0; j++) {\n        if (s1[j + i] == s2[j]) {\n          a = 1;\n        } else {\n          a = 0;\n          break;\n        }\n      }\n    }\n    if (a == 1) {\n      b = i;\n      break;\n    }\n  }\n  if (a == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; s3[i] != 0; i++) {\n      printf(\"%c\", s3[i]);\n    }\n    for (i = 0; i < d - b - c; i++) {\n      printf(\"%c\", s1[i + c + b]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int i, j;\n  int count1 = 0, count2 = 0; \n  for (i = 0; a[i] != '\\0'; i++) {\n    count1++;\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    count2++;\n  }\n  int k, l, m, n, judge = 0, o, p, judge1 = 0;\n  for (k = 0; k <= count1 - count2; k++) {\n    n = 0;\n    if (a[k] == b[0]) {\n      o = m = k; \n      for (n = 0; n <= count2 - 1; n++) {\n        if (a[m] != b[n]) {\n          break;\n        } else if (n == count2 - 1 && a[m] == b[n]) {\n          judge = 1;\n        } else if (a[m] == b[n] && n != count2 - 1) {\n          m++;\n        }\n      }\n      if (judge == 1) {\n        for (o = k; o <= k + count2 - 1; o++) {\n          a[o] = c[o - k];\n        }\n        for (p = 0; p <= count1 - 1; p++) {\n          printf(\"%c\", a[p]);\n        }\n        judge1 = 1;\n        break;\n      } \n      else if (judge == 0) {\n        continue;\n      }\n    }\n  }\n  if (judge1 == 0) {\n    for (int z = 0; z <= count1 - 1; z++)\n      printf(\"%c\", a[z]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  \n}\n"}
{"label": "7", "index": "12804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int t, i, k;\n  cin >> s >> sub >> re;\n  t = strlen(sub);\n  for (i = 0; i < strlen(s) - t + 1; i++) {\n    int x = 0;\n    for (k = i; k < i + t; k++) {\n      if (s[k] != sub[k - i])\n        x += 1;\n    }\n    if (x == 0) {\n      for (k = i; k < i + t; k++) {\n        s[k] = re[k - i];\n      }\n      break;\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[102], a[102], b[102];\n  char *p1, *p2, *p3;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  int i, j, k = 0, len, m, len2;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (*p2 == p1[i]) {\n      j = i;\n      m = i;\n      for (; *p2 != '\u0000'; p2++, j++) {\n        if (*p2 == p1[j])\n          k++;\n        else {\n          break;\n        }\n      }\n    }\n  }\n  len2 = strlen(a);\n  if (k != len2) {\n    printf(\"%s\", s);\n  }\n  if (k == len2) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = i + k; i < len; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int n = strlen(a);\n  int m = strlen(b);\n  int i, j;\n  for (int i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] != b[j])\n          break;\n      }\n      if (j == m) {\n        for (j = 0; j < m; j++)\n          a[i + j] = c[j];\n\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char s[30000];\n  char yc[30000];\n  char tc[30000];\n  int tag = 1;\n  int u = 0;\n\n  cin >> s;\n  cin >> yc;\n  cin >> tc;\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == yc[0]) {\n      tag = 2;\n      for (int j = 0; j < strlen(yc); j++) {\n        if (s[i + j] != yc[j]) {\n          tag = 0;\n          break;\n        }\n      }\n    }\n    if (tag == 2) {\n      printf(\"%s\", tc);\n      u = i + strlen(yc);\n      break;\n    }\n\n    if (tag != 2) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  if (tag == 2) {\n    for (int k = u; k < strlen(s); k++)\n      printf(\"%c\", s[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12808", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int n, m, i, j, p;\n  scanf(\"%s %s %s \", s, a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0, j = 0; i < m, j < n; j++) {\n    if (a[i] == s[j]) {\n      p = j;\n      i++;\n      if (i == m)\n        break;\n    } else\n      i = 0;\n  }\n  if (i == m)\n    for (i = 0; i < m; i++)\n      s[p - m + 1 + i] = b[i];\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char st[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", st, sub, rep);\n  int lenst, lensub, i, j;\n  lenst = strlen(st);\n  lensub = strlen(sub);\n  for (i = 0; i <= lenst - lensub; i++) {\n    int count = 0;\n    if (lensub != 1) {\n      if (st[i] == sub[0]) {\n\n        for (j = i + 1; j < i + lensub; j++) {\n          if (st[j] != sub[j - i])\n            break;\n          count++;\n        }\n      }\n      if (count == lensub - 1) {\n        for (j = i; j < i + lensub; j++)\n          st[j] = rep[j - i];\n\n        break;\n      }\n    } else {\n      if (st[i] == sub[0]) {\n        st[i] = rep[0];\n        break;\n      }\n    }\n  }\n  cout << st;\n}\n"}
{"label": "7", "index": "12810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[100];\n  cin >> sz;\n  int i, j, m, n, len, len1, len2;\n\n  char as[100], az[100];\n  cin >> as >> az;\n\n  len = strlen(sz);\n  len1 = strlen(as);\n  len2 = strlen(as);\n  for (i = 0; i < len; i++) {\n    for (j = 0; j < len2; j++, i++) {\n      if (sz[i] != as[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        for (m = i - len2 + 1, n = 0; n < len2; n++, m++) {\n          sz[m] = az[n];\n        }\n      }\n      if (j == len2 - 1) {\n        i = len;\n      }\n    }\n  }\n  printf(\"%s\", sz);\n  return 0;\n}\n"}
{"label": "7", "index": "12811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[270], subs[70], rep[70], *p;\n  cin >> str >> subs >> rep;\n  p = strstr(str, subs);\n  if (p != NULL) {\n    for (int i = 0; rep[i] != '\\0'; i++) {\n      *p++ = rep[i];\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12812", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, slen, alen ;\n  char *ss[ 2], s[256], s1[256], s2[256];\n  int flag = 0;\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  slen = strlen(s);\n  alen = strlen(s1);\n  \n\n  for (i = 0; i < slen - alen + 1; i++) {\n    for (j = 0; j < alen; j++) {\n      if (s[i + j] != s1[j]) {\n        break;\n      }\n    }\n    if (j == alen) {\n      ss[1] = &s[i + j ];\n      s[i ] = '\u0000';\n      ss[0] = s;\n      flag = 1; \n\n      break;\n    }\n  }\n  if (flag == 0)\n    printf(\"%s \", s);\n  else\n    printf(\"%s%s%s \", ss[0], s2, ss[1]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  int i, j, m, k;\n  int n = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == b[0]) {\n      n = 0;\n      for (j = 0; b[j] != '\\0'; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n      if (m == n)\n        break;\n    }\n  }\n  if (m == n) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", a[k]);\n    }\n    printf(\"%s\", c);\n    for (k = i + m; a[k] != '\\0'; k++) {\n      cout << a[k];\n    }\n  }\n\n  if (n != m)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12814", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256] = {0}, huan[256] = {0}, hou[256] = {0};\n  int i, e, k, len1, len2, len3, count;\n\n  cin >> yuan;\n\n  cin >> huan;\n\n  scanf(\"%s \", hou);\n  len1 = strlen(yuan);\n  len2 = strlen(huan);\n  len3 = strlen(hou);\n\n  int p = 0;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    count = 0;\n    if (yuan[i] == huan[0]) {\n      for (e = 0; e < len2; e++)\n        if (yuan[i + e] == huan[e])\n          count++;\n      if (count == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", yuan[k]);\n        for (k = i; k < len3 + i; k++)\n          printf(\"%c\", hou[k - i]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", yuan[k]);\n        p = 1;\n        break;\n      }\n    }\n  }\n\n  if (p == 0)\n    printf(\"%s\", yuan);\n  return 0;\n}\n"}
{"label": "7", "index": "12815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], w[256], v[256];\n  int i, j, slen, wlen, k;\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", v);\n  slen = strlen(s);\n  wlen = strlen(w);\n  for (i = 0; i <= wlen - slen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (w[i + j] != s[j]) {\n        break;\n      }\n    }\n    if (j == slen) {\n      break;\n    }\n  }\n  if (j == slen) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", w[k]);\n    }\n    printf(\"%s\", v);\n    if (w[i + slen] != 0) {\n      for (k = i + slen; k < wlen; k++) {\n        printf(\"%c\", w[k]);\n      }\n    }\n\n  } else if (i == wlen - slen + 1)\n    cout << w;\n  return 0;\n}\n"}
{"label": "7", "index": "12816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m = 0;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  k = strlen(b);\n\n  i = strstr(a, b) - a;\n\n  if (i >= 0 && i <= n - k) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + k; j < n; j++) {\n      printf(\"%c\", a[j]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      cout << a[i];\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12817", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[256], sub[256], repl[256];\n  cin >> str >> sub >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if (same == 0)\n      printf(\"%c\", str[i]);\n    if (same == 1) {\n      printf(\"%s\", repl);\n      for (k = i + strlen(sub); str[k] != 0; k++) {\n        printf(\"%c\", str[k]);\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], *d, *e, *f, *g;\n  int i;\n\n  scanf(\"%s \", a);\n  g = a;\n\n  cin >> b;\n\n  cin >> c;\n  d = strstr(a, b);\n  if (!d) {\n    printf(\"%s\", g);\n    exit(0);\n  }\n  f = a;\n  i = strlen(a) - strlen(d);\n  f[i] = '\u0000';\n  e = a + (strlen(a) - (strlen(d) - strlen(b)));\n  printf(\"%s%s%s \", f, c, e);\n  return 0;\n}\n"}
{"label": "7", "index": "12819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint i, j, k, kk;\nchar s1[305], s2[305];\nchar s3[305];\n\nint main() {\n  scanf(\"%s\", s1);\n  cin >> s2;\n  scanf(\"%s\", s3);\n  for (i = 0; i < strlen(s1); i++) {\n    for (j = 0; j < strlen(s2); j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n    }\n    if (j == strlen(s2)) {\n      k = i;\n      kk = 1;\n      break;\n    }\n  }\n  if (kk == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    cout << s3;\n    for (i = k + strlen(s2); i < strlen(s1); i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], temp[256];\n  char *p;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  p = strstr(str, sub);\n  if (p != NULL) {\n    *p = 0;\n    strcpy(temp, str);\n    strcat(temp, rep);\n    strcat(temp, p + strlen(sub));\n    strcpy(str, temp);\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[266], s[22], z[22];\n\n  cin >> a;\n\n  cin >> s;\n\n  cin >> z;\n  int n, i, j, l = 1, m, w, e;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (s[0] == a[i]) {\n      l = 1;\n      m = i;\n      for (w = 0; s[w] != '\u0000'; w++) {\n        if (s[w] != a[i]) {\n          l = 0;\n        }\n        i++;\n      }\n\n      if (l) {\n        break;\n      }\n    }\n  }\n\n  for (n = 0; s[n] != '\u0000'; n++) {\n    1;\n  }\n  if (l) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (m == 48) {\n        m = 17;\n      }\n      if (j == m) {\n        for (e = 0; z[e] != '\u0000'; e++) {\n          printf(\"%c\", z[e]);\n        }\n        j = m + n - 1;\n      } else {\n        printf(\"%c\", a[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12822", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, count = 0, k;\n  char string[256], substring[256], replacement[256], czy[256], cai[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 0; j < b; j++)\n        czy[j] = string[i + j];\n      if (strcmp(czy, substring) == 0) {\n        count = 1;\n        for (k = 0; k < i; k++)\n          cai[k] = string[k];\n        for (k = i; k < i + b; k++)\n          cai[k] = replacement[k - i];\n        for (k = i + b; k < a; k++)\n          cai[k] = string[k];\n      }\n      if (count == 1)\n        break;\n    }\n  }\n  if (count == 1)\n    puts(cai);\n  else\n    puts(string);\n}\n"}
{"label": "7", "index": "12824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], subString[256], replacement[256];\n  char *n = NULL;\n  int l, i;\n  memset(string, '\\0', sizeof(string));\n  memset(subString, '\\0', sizeof(subString));\n  memset(replacement, '\\0', sizeof(replacement));\n  scanf(\"%s %s %s \", string, subString, replacement);\n  n = strstr(string, subString);\n  l = strlen(subString);\n  if (n != NULL) {\n    for (i = 0; i < l; i++)\n      n[i] = replacement[i];\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12825", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  char *p = strstr(str, sub);\n  if (p == NULL)\n    printf(\"%s \", str);\n  else {\n    int len = strlen(rep);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = rep[i];\n      p++;\n    }\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], replace[256];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> replace;\n\n  int ls = strlen(s);\n  int lsub = strlen(sub);\n  char sr[256];\n  int i, j;\n  int same;\n  for (i = 0; i < ls; i++) {\n    for (j = 0; j < lsub; j++) {\n      sr[j] = s[i + j];\n    }\n    sr[j] = '\u0000';\n    same = strcmp(sr, sub);\n    if (same == 0) {\n      printf(\"%s\", replace);\n      i = i + lsub;\n      cout << &s[i];\n      break;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], z[200], h[200], t[100];\n  int lens, lenz, lenh, i, j, sum, r, q = 0, p = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", z);\n\n  cin >> h;\n  lens = strlen(s);\n  lenz = strlen(z);\n  lenh = strlen(h);\n  for (i = 0; i < lens; i++) {\n    sum = 0;\n    for (j = 0; j < lenz; j++) {\n      if (s[i + j] == z[j]) {\n        sum++;\n      } else\n        break;\n    }\n    if (sum == lenz) {\n      r = i;\n      q = 1;\n      break;\n    }\n  }\n  if (q == 1) {\n    for (i = 0; i < r; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", h);\n    for (i = r + sum; i < lens; i++)\n      printf(\"%c\", s[i]);\n  } else if (q == 0)\n    cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "12828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char sub[300];\n  char re[300];\n  scanf(\"%s%s%s\", str, sub, re);\n  int i, j, k, first;\n  int len = strlen(str);\n  int len1 = strlen(sub);\n  int len2 = strlen(re);\n  first = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i, j = 0; j < len1; j++, k++) {\n        if (str[k] != sub[j])\n          break;\n      }\n    }\n    if (j == len1) {\n      first = i;\n      break;\n    }\n  }\n  if (j != len1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < first; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", re);\n    for (i = (first + len2); i < len; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, mm = 0;\n  char string1[1000 + 10];\n  char subString[1000 + 10];\n  char replacement[1000 + 10];\n\n  for (k = 0; k < 1000 + 10; k++) {\n    string1[k] = '0';\n    subString[k] = '0';\n    replacement[k] = '0';\n  }\n\n  scanf(\"%s \", string1);\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n\n  int len1 = strlen(string1);\n  int len2 = strlen(subString);\n  int len3 = strlen(replacement);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    sum = 0;\n    if (string1[i] == subString[0]) {\n      for (j = 0; j < len2; j++) {\n        if (subString[j] == string1[i + j])\n          sum++;\n      }\n\n      if (sum == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string1[k]);\n        for (k = 0; k < len3; k++)\n          printf(\"%c\", replacement[k]);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string1[k]);\n      }\n\n      if (sum == len2)\n        break;\n    }\n  }\n\n  if (i == len1 - len2 + 1)\n    for (k = 0; k < len1; k++)\n      cout << string1[k];\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12830", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m = 0;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  n = strlen(a);\n  k = strlen(b);\n\n  i = strstr(a, b) - a;\n\n  if (i >= 0 && i <= n - k) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + k; j < n; j++) {\n      printf(\"%c\", a[j]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "12831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  int temp;\n  scanf(\"%s\", zfc1);\n  cin >> zfc2;\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++)\n      zichuan[j] = zfc1[j + i];\n\n    if (strcmp(zichuan, zfc2) == 0) {\n      flag = 1;\n      temp = i;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  } else {\n    for (k = 0; k < temp; k++) {\n      printf(\"%c\", zfc1[k]);\n    }\n    cout << zfc3;\n    for (t = temp + len2; zfc1[t] != '\\0'; t++) {\n      printf(\"%c\", zfc1[t]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[256], zc[256], re[256], dc[256][256];\n  scanf(\"%s%s%s\", zfc, zc, re);\n  int len1, len2, i;\n  len1 = strlen(zfc);\n  len2 = strlen(zc);\n  int j, k, tag = 0, m, a;\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, k++) {\n      dc[i][j] = zfc[k];\n    }\n  }\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    if (strcmp(dc[i], zc) == 0) {\n      tag = 1;\n      m = i;\n      break;\n    }\n  }\n\n  if (tag == 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    for (i = 0; i < m; i++) {\n      cout << zfc[i];\n    }\n    for (i = m; i < m + len2; i++) {\n      printf(\"%s\", re);\n      break;\n    }\n    for (i = m + len2; zfc[i] != '\\0'; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  scanf(\"%d\", &a);\n  return 0;\n}\n"}
{"label": "7", "index": "12833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n1, n2;\n  char s1[257], s2[257], s3[257];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < n1; i++)\n    if (s1[i] == s2[0]) {\n      j = 0;\n      while (s1[i + j] == s2[j] && j < n2)\n        j++;\n      if (j == n2) {\n        for (k = i; k < i + n2; k++)\n          s1[k] = s3[k - i];\n        break;\n      }\n    }\n  for (i = 0; i < n1; i++)\n    cout << s1[i];\n  return 0;\n}\n"}
{"label": "7", "index": "12834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i = 0, j = 0, len1, len2, len3, t = 0, k;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  while (i < len1 && t < len2) {\n    if (a[i] != b[j]) {\n      i++;\n      j = 0;\n      t = 0;\n    } else {\n      i++;\n      j++;\n      t++;\n    }\n  }\n  if (t >= len2) {\n    for (j = 0; j < i - t; j++)\n      cout << a[j];\n    for (j = 0; j < len3; j++)\n      printf(\"%c\", c[j]);\n    for (j = i - t + len2; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  if (t < len2) {\n    for (j = 0; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[3][256], string[512];\n  int n, m, k, i, j;\n  cin >> str[0] >> str[1] >> str[2];\n  n = strlen(str[0]);\n  m = strlen(str[1]);\n  k = strlen(str[2]);\n  for (j = 0; j < n - m + 1; j++) {\n    for (i = 0; i < m; i++) {\n      if (str[1][i] != str[0][i + j])\n        break;\n    }\n    if (i == m) {\n      break;\n    }\n  }\n  if (j < n - m + 1) {\n    for (i = 0; i < j; i++)\n      string[i] = str[0][i];\n    for (i = j; i < j + k; i++)\n      string[i] = str[2][i - j];\n    for (i = j + k; str[0][i - k + m] != '\\0'; i++)\n      string[i] = str[0][i - k + m];\n    string[i] = '\\0';\n    printf(\"%s\", string);\n  } else\n    printf(\"%s\", str[0]);\n}\n"}
{"label": "7", "index": "12836", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0, x = 0;\n  while (i < strlen(a)) {\n    if (a[i] == b[0]) {\n      int j;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      }\n      if (j == strlen(b) && x == 0) {\n        printf(\"%s\", c);\n        x = 1;\n        i += strlen(b);\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12837", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char origin[256], sub[256], replace[256], after[256];\n  scanf(\"%s %s %s \", origin, sub, replace);\n\n  int i, j, k = 0;\n\n  for (i = 0; origin[i]; i++) {\n    int shouldChange = 1;\n    for (j = 0; sub[j]; j++) {\n      if (origin[i + j] != sub[j])\n        shouldChange = 0;\n    }\n    if (shouldChange == 1) {\n      strcpy(after, origin);\n      after[i] = 0;\n      strcat(after, replace);\n      strcat(after, &origin[i + strlen(sub)]);\n      strcpy(origin, after);\n      i += strlen(replace);\n      break;\n    }\n  }\n  printf(\"%s\", origin);\n  return 0;\n}\n"}
{"label": "7", "index": "12838", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, k = 0;\n  while (b[i] != '\u0000') {\n    i++;\n    n1++;\n  }\n  i = 0;\n  while (c[i] != '\u0000') {\n    i++;\n    n2++;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    for (j = 0; j < n1; j++) {\n      if (a[i + j] != b[j])\n        break;\n      if (j == n1 - 1) {\n        for (j = 0; j < i; j++)\n          printf(\"%c\", a[j]);\n        printf(\"%s\", c);\n        for (j = i + n2; a[j] != '\u0000'; j++)\n          printf(\"%c\", a[j]);\n        k++;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  if (k == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[256], b[256];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = -2;\n  int lengths, lengtha, lengthb;\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n\n  for (i = 0; i < lengths; i++) {\n    k = 0;\n    for (j = 0; j < lengtha; j++) {\n      if (a[j] == s[i + j]) {\n        k++;\n      }\n    }\n\n    if (k == lengtha) {\n      t = i;\n      break;\n    }\n  }\n  if (t != -2) {\n    for (i = 0; i < t; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = t + lengthb; i < lengths; i++) {\n      printf(\"%c\", s[i]);\n    }\n  } else {\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12840", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dingwei(char duan[50], char chang[50]) {\n  int i, geshu1 = 0, geshu2 = 0;\n  for (i = 0; duan[i] != '\\0'; i++) {\n    geshu1 += 1;\n  }\n  for (i = 0; chang[i] != '\\0'; i++) {\n    geshu2 += 1;\n  }\n  int j, cishu = 0, weizhi = 0;\n  for (i = 0; i <= (geshu2 - geshu1); i++) {\n    for (j = 0; j < geshu1; j++) {\n      if (duan[j] == chang[i]) {\n        cishu++;\n        i++;\n      } else {\n        break;\n      }\n    }\n    if (cishu == geshu1) {\n      weizhi = i - geshu1;\n      break;\n    } else {\n      cishu = 0;\n      continue;\n    }\n  }\n  if (cishu == 0) {\n    return -1;\n  } else {\n    return weizhi;\n  }\n}\nint main() {\n  char zfc[300], beiti[256], ti[256];\n  scanf(\"%s %s %s \", zfc, beiti, ti);\n  int lenzfc, lenbt, lent, weizhi, i;\n  lenzfc = strlen(zfc);\n  lenbt = strlen(beiti);\n  lent = strlen(ti);\n  weizhi = dingwei(beiti, zfc);\n  if (weizhi < 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    if (lenbt == lent) {\n      for (i = 0; i < lenbt; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n\n    } else if (lenbt > lent) {\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      for (i = 0; i < (lenzfc - lenbt - weizhi); i++) {\n        zfc[weizhi + lent + i] = zfc[weizhi + lenbt + i];\n      }\n      zfc[lenzfc - lenbt + lent] = '\\0';\n    } else if (lenbt < lent) {\n      for (i = lenzfc - 1; i >= weizhi + lenbt; i--) {\n        zfc[i + lent - lenbt] = zfc[i];\n      }\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      zfc[lenzfc + lent - lenbt] = '\\0';\n    }\n    printf(\"%s\\n\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, panduan, k;\n  k = 0;\n  panduan = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    panduan = 0;\n\n    for (j = 0; b[j] != 0; j++) {\n      if (a[i + j] != b[j]) {\n        panduan = 1;\n        break;\n      }\n    }\n    if (panduan == 0 && k == 0) {\n      printf(\"%s\", c);\n      i += j - 1;\n      k = 1;\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  int i, j, m, n, k, t, q = 0, p = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  k = strlen(b);\n  for (i = 0; i <= m - n; i++) {\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i])\n        p++;\n      else\n        break;\n    }\n    if (p == n) {\n      q++;\n      t = i;\n      for (j = 0; j <= t - 1; j++)\n        c[j] = s[j];\n      for (j = t; j < t + k; j++)\n        c[j] = b[j - i];\n      for (j = t + k; j < m - n + k; j++)\n        c[j] = s[n + j - k];\n      c[m - n + k] = '\u0000';\n      puts(c);\n      break;\n    }\n    p = 0;\n  }\n  if (q == 0)\n    puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char y[256], z[256], h[256], sc[256];\n\n  scanf(\"%s \", y);\n\n  cin >> z;\n\n  cin >> h;\n  int k = 0, count = 0, o;\n  int a = strlen(y);\n  int b = strlen(z);\n  int c = strlen(h);\n  for (int i = 0; i < a; i++) {\n    if (y[i] == z[k]) {\n      k++;\n      count++;\n      if (count == b) {\n        break;\n      }\n    } else {\n      if (count != b) {\n        if (count > 0) {\n          i--;\n        }\n        count = 0;\n        k = 0;\n      }\n    }\n    o = i;\n  }\n  int e = o - k + 2;\n  int f = 0;\n  for (int m = 0; m < a; m++) {\n    if ((m >= e) && (m < e + c)) {\n      sc[m] = h[f];\n      f++;\n    } else {\n      sc[m] = y[m];\n    }\n  }\n  for (int l = 0; l < a; l++) {\n    cout << sc[l];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, n1, k, sum = 0;\n  char a[257], b[257], c[257];\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n  n = strlen(a);\n  n1 = strlen(b);\n  for (i = 0; i < n - n1 + 1; i++) {\n    sum = 0;\n    for (j = i, k = 0; j < i + n1; j++, k++) {\n      if (a[j] != b[k])\n        sum = 1;\n    }\n    if (sum == 0) {\n      for (j = i, k = 0; j < i + n1; j++, k++)\n        a[j] = c[k];\n      break;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], *d, *e, *f, *g;\n  int i;\n\n  cin >> a;\n  g = a;\n\n  cin >> b;\n\n  cin >> c;\n  d = strstr(a, b);\n  if (!d) {\n    printf(\"%s\", g);\n    exit(0);\n  }\n  f = a;\n  i = strlen(a) - strlen(d);\n  f[i] = '\u0000';\n  e = a + (strlen(a) - (strlen(d) - strlen(b)));\n  cout << f << c << e << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "12846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n    if (i >= m && i < b + m)\n      printf(\"%c\", replacement[i - m]);\n    else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, n, m, k, p, q, z = 0;\n  char a[260], b[260], c[260], d[260];\n\n  cin >> a >> b >> c;\n  n = strlen(a);\n  m = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (k = 0; k < m; k++) {\n        d[k] = a[k + i];\n      }\n      d[k] = '\\0';\n      if (strcmp(b, d) == 0) {\n        for (p = 0; p < i; p++) {\n          printf(\"%c\", a[p]);\n        }\n        printf(\"%s\", c);\n        for (p = i + q; p < (n - m + q); p++) {\n          cout << a[p];\n        }\n        z = 1;\n        break;\n      }\n    }\n  }\n\n  if (z == 0) {\n    printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], f[300], h[300];\n  int i, m, n = 0, t, g, e[3];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s \", c);\n  for (m = 0; m < 290; m++) {\n    if (a[m] == '\u0000')\n      break;\n    e[0] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (b[m] == '\u0000')\n      break;\n    e[1] = m + 1;\n  }\n  for (m = 0; m < 290; m++) {\n    if (c[m] == '\u0000')\n      break;\n    e[2] = m + 1;\n  }\n  for (i = 0; i <= e[0] - e[1]; i++) {\n    for (t = 0; t < e[1]; t++) {\n      if (a[i + t] == b[t])\n        n++;\n      else\n        n = 0;\n    }\n    if (n == e[1]) {\n      g = i;\n      break;\n    }\n  }\n  if (n == 0) {\n    printf(\"%s\", a);\n  } else {\n    for (i = 0; i < g; i++) {\n      d[i] = a[i];\n      printf(\"%c\", d[i]);\n    }\n    for (i = 0; i < e[2]; i++) {\n      printf(\"%c\", c[i]);\n    }\n    for (i = 0; i < e[1]; i++)\n      f[i] = a[i + g];\n    for (i = 0; i < e[0] - e[1] - g; i++) {\n      h[i] = a[g + e[1] + i];\n      printf(\"%c\", h[i]);\n    }\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, length2, length1;\n  char str[300], sub[300], rep[300];\n\n  scanf(\"%s \", str);\n  cin >> sub;\n  cin >> rep;\n  length1 = strlen(str);\n  length2 = strlen(sub);\n  for (i = 0; i < length1; i++) {\n    for (j = 0; j < length2; j++) {\n      if (sub[j] != str[i + j])\n        break;\n    }\n    if (j == length2) {\n      for (j = 0; j < length2; j++)\n        str[i + j] = rep[j];\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar zfc[3][257];\nint main() {\n\n  cin >> zfc[1];\n\n  cin >> zfc[2];\n\n  cin >> zfc[3];\n  int i, k, len, len2, j;\n  len = strlen(zfc[1]);\n  len2 = strlen(zfc[2]);\n  for (i = 0; i < len; i++) {\n    if ((zfc[1][i] == zfc[2][0]) && (zfc[1][i + 1] == zfc[2][1]))\n      break;\n  }\n  if (i != len) {\n    for (k = i; k < (len2 + i); k++) {\n      j = k - i;\n      zfc[1][k] = zfc[3][j];\n      if (k == len2 + i)\n        break;\n    }\n  }\n  printf(\"%s\", zfc[1]);\n  return 0;\n}\n"}
{"label": "7", "index": "12851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[1000], a[50], b[50];\n\n  int i, lenb, n, j, flag;\n  int k = 10001;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = (int)strlen(b);\n\n  for (i = 0; i <= (int)strlen(s); i++, flag = 0) {\n    for (n = 0, j = i; a[n] != '\u0000'; n++, j++) {\n      if (s[j] != a[n]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      continue;\n    else {\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (i == k) {\n      printf(\"%s\", b);\n      i = i + lenb - 1;\n      continue;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char an[256], be[256], ce[256];\n  int i, j, m, n, k = 0, h;\n\n  cin >> an;\n\n  cin >> be;\n\n  cin >> ce;\n  m = strlen(an);\n  n = strlen(be);\n  h = strlen(ce);\n  for (i = 0; i < m; i++) {\n\n    if (an[i] == be[0]) {\n      for (j = 1; j < n; j++) {\n        if (be[j] != an[i + j]) {\n          break;\n        }\n      }\n      if (j == n) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", an[k]);\n        for (k = 0; k < h; k++) {\n          printf(\"%c\", ce[k]);\n        }\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", an[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (k != m) {\n    printf(\"%s\", an);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], c[256], l[256], g[20], h[20];\n  int b, i, e = 0, q, p, j, k;\n\n  cin >> a;\n  b = strlen(a);\n\n  cin >> h;\n\n  cin >> g;\n  q = strlen(h);\n  for (i = 0; i < b; i++) {\n    if (a[i] == h[0]) {\n      p = 1;\n      for (j = 1; j < q; j++) {\n        if (a[i + j] != h[j]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (k = 0; k < i; k++) {\n          c[k] = a[k];\n          c[k + 1] = '\u0000';\n        }\n        l[0] = -1;\n        for (k = i + q; k < b; k++) {\n          l[k - i - q] = a[k];\n          l[k - i - q + 1] = '\u0000';\n        }\n        strcat(c, g);\n        if (l[0] != -1)\n          strcat(c, l);\n\n        strcpy(a, c);\n        b = strlen(a);\n        break;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "7", "index": "12854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  int i, length, lensub, j, k, ans = 0;\n  length = strlen(s);\n  lensub = strlen(sub);\n  for (i = 0; i < length; i++)\n    if (s[i] == sub[0]) {\n      for (j = 0; j < lensub; j++)\n        if (s[i + j] != sub[j])\n          break;\n      if (j == lensub) {\n        ans = 1;\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", re);\n        for (k = i + lensub; k < length; k++)\n          printf(\"%c\", s[k]);\n        break;\n      }\n    }\n  if (ans != 1)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12855", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[300], rep[300], sub[300];\n  cin >> s >> sub >> rep;\n  if (strstr(s, sub)) {\n    char *t = strstr(s, sub);\n    *t = '\\0';\n    cout << s << rep << (t + strlen(sub)) << endl;\n  } else\n    cout << s << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[300], s2[300], s3[300], *p = NULL;\n  int i, l1, l2, l3;\n  scanf(\"%s %s %s \", s1, s2, s3);\n  p = strstr(s1, s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  if (p == NULL)\n    cout << s1;\n  else {\n    for (i = 0; &s1[i] < p; i++)\n      printf(\"%c\", s1[i]);\n    cout << s3;\n    for (p = p + l2; *p != '\\0'; *p++)\n      cout << *p;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], re[257];\n  int i = 0, j = 0, n = 0, m = 0, k = 0;\n  scanf(\"%s\\n%s\\n%s\\n\", str, substr, re);\n  n = strlen(substr);\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[j]) {\n\n      if (memcmp(substr, str + i, n) == 0) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (i = m; i < m + n; i++) {\n      str[i] = re[i - m];\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12858", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char su[100], zu[100], tu[100];\n\n  cin >> su;\n\n  cin >> zu;\n\n  cin >> tu;\n  int i, j, k, t;\n  for (i = 0; i < strlen(su); i++) {\n    for (k = 0, j = i; su[j] == zu[k]; j++, k++)\n      if (k == strlen(zu))\n        break;\n    if (k == strlen(zu))\n      break;\n  }\n\n  if (j != i - 1) {\n    for (t = 0; t < i; t++)\n      printf(\"%c\", su[t]);\n    printf(\"%s\", tu);\n    for (t = j; t < strlen(su); t++)\n      printf(\"%c\", su[t]);\n  } else\n    printf(\"%s\", su);\n  return 0;\n}\n"}
{"label": "7", "index": "12859", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000];\n\n  cin >> s;\n  int i, j, k, m, x = 0;\n  char a[1000];\n\n  cin >> a;\n  char b[1000];\n\n  cin >> b;\n  i = strlen(a);\n  for (j = 0; s[j] != '\u0000'; j++) {\n    if (a[0] == s[j]) {\n      for (k = 1; k < i; k++) {\n        if (a[k] != s[j + k]) {\n          break;\n        }\n      }\n    }\n    if (k == i) {\n      for (m = 0; m < j; m++) {\n        printf(\"%c\", s[m]);\n      }\n      printf(\"%s\", b);\n      for (m = i + j; s[m] != '\u0000'; m++) {\n        printf(\"%c\", s[m]);\n      }\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sub[257], s1[257], s2[257];\n  int i, j, str1, str2;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  str1 = strlen(sub);\n  str2 = strlen(s1);\n  for (i = 0; i < str1; i++)\n    if (sub[i] == s1[0]) {\n      for (j = 0; j < str2; j++)\n        if (sub[i + j] != s1[j])\n          break;\n      if (j == str2) {\n        for (j = 0; j < str2; j++)\n          sub[i + j] = s2[j];\n        break;\n      }\n    }\n  cout << sub << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[266], s[22], z[22];\n\n  cin >> a;\n\n  cin >> s;\n\n  cin >> z;\n  int n, i, j, l = 1, m, q, w, e;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (s[0] == a[i]) {\n      l = 1;\n      m = i;\n      for (w = 0; s[w] != '\u0000'; w++) {\n        if (s[w] != a[i]) {\n          l = 0;\n        }\n        i++;\n      }\n\n      if (l) {\n        break;\n      }\n    }\n  }\n\n  for (n = 0; s[n] != '\u0000'; n++) {\n    1;\n  }\n  if (l) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (m == 48) {\n        m = 17;\n      }\n      if (j == m) {\n        for (e = 0; z[e] != '\u0000'; e++) {\n          printf(\"%c\", z[e]);\n        }\n        j = m + n - 1;\n      } else {\n        printf(\"%c\", a[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint i, j, k, kk;\nchar s1[305], s2[305];\nchar s3[305];\n\nint main() {\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  cin >> s3;\n  for (i = 0; i < strlen(s1); i++) {\n    for (j = 0; j < strlen(s2); j++) {\n      if (s1[i + j] != s2[j])\n        break;\n    }\n    if (j == strlen(s2)) {\n      k = i;\n      kk = 1;\n      break;\n    }\n  }\n  if (kk == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s3);\n    for (i = k + strlen(s2); i < strlen(s1); i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"\\n\");\n  } else {\n    cout << s1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, m, n, i, j, s, k;\n  char string[256], substring[256], replacement[256];\n  char t;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  l = strlen(string);\n  m = strlen(substring);\n  t = substring[0];\n  for (i = 0; i <= l - m; i++) {\n    s = 0;\n    if (string[i] == t) {\n      for (j = i; j <= i + m - 1; j++) {\n        if (string[j] == substring[j - i]) {\n          s++;\n        }\n      }\n      if (s == m) {\n        for (k = 0; k <= m - 1; k++) {\n          string[i + k] = replacement[k];\n        }\n        i = l - m;\n      } else {\n        i++;\n      }\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, s;\n  char str[256], c[256], d[256];\n\n  cin >> c;\n\n  cin >> str;\n\n  cin >> d;\n  m = strlen(str);\n  n = strlen(c);\n  for (i = 0; i < n - m + 1; i++) {\n    if (c[i] == str[0]) {\n      s = 0;\n      for (j = i; j < i + m; j++) {\n        if (c[j] == str[j - i]) {\n          s = s + 1;\n        }\n      }\n      if (s == m) {\n        break;\n      }\n    }\n  }\n  if (s == m) {\n    for (j = i; j < i + m; j++)\n      c[j] = d[j - i];\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "7", "index": "12865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], *p;\n  scanf(\"%s%s%s\", a, b, c);\n  p = strstr(a, b);\n  if (p == NULL)\n    puts(a);\n  else {\n    *p = '\u0000';\n    strcpy(d, a);\n    strcat(d, c);\n    strcat(d, p + strlen(b));\n    puts(d);\n  }\n}\n"}
{"label": "7", "index": "12866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[257], rep[257];\n  int i, j, t, k;\n  int len_s, len_sub, len_rep;\n  cin.getline(s, 257);\n  cin.getline(sub, 257);\n  cin.getline(rep, 257);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  len_rep = strlen(rep);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zf[100];\n  char zq[100];\n  char cu[100];\n  char dt[100][100];\n  int i, l, lc, j, lz, k = 0, t, m, n = 0, len, ci;\n\n  cin >> zf;\n\n  cin >> cu;\n\n  cin >> zq;\n  l = strlen(zf);\n  lc = strlen(cu);\n  lz = strlen(zq);\n  for (i = 0; i < l; i++) {\n    if (zf[i] == cu[0]) {\n      ci = 1;\n      for (j = 0; j < lc; j++, i++) {\n        if (zf[i] != cu[j]) {\n          ci = 0;\n          break;\n        }\n      }\n      if (ci == 1) {\n        t = i - lc;\n        for (j = 0; j < lc; j++, t++) {\n          zf[t] = zq[j];\n        }\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[100], b[100];\n  int i = 0, z = 0, c = 0, d, j, f, e;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  c = strlen(a);\n  e = strlen(s);\n  while (i < e) {\n    if (s[i] == a[z]) {\n      f = 0;\n      for (d = i; d < i + c; d++) {\n        if (s[d] == a[z]) {\n          f++;\n          z++;\n        }\n      }\n      if (f == c) {\n        z = 0;\n        for (d = i; d < i + c; d++) {\n          s[d] = b[z];\n          z++;\n        }\n        break;\n      } else {\n        z = 0;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < e; i++) {\n    cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], substr[1000], replace[1000];\n  char *p, *q, *r, *start;\n  int len;\n  scanf(\"%s %s %s\", str, substr, replace);\n  len = strlen(substr);\n  for (p = str; *p != '\\0'; p++) {\n    for (q = p, r = substr; *r != '\\0'; q++, r++)\n      if (*q != *r)\n        break;\n    if (*r == '\\0') {\n      start = p;\n      break;\n    }\n  }\n  for (p = start, q = replace; *q != '\\0'; p++, q++)\n    *p = *q;\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12870", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i = 0, j = 0, len1, len2, len3, t = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  while (i < len1 && t < len2) {\n    if (a[i] != b[j]) {\n      i++;\n      j = 0;\n      t = 0;\n    } else {\n      i++;\n      j++;\n      t++;\n    }\n  }\n  if (t >= len2) {\n    for (j = 0; j < i - t; j++)\n      printf(\"%c\", a[j]);\n    for (j = 0; j < len3; j++)\n      printf(\"%c\", c[j]);\n    for (j = i - t + len2; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  if (t < len2) {\n    for (j = 0; j < len1; j++)\n      printf(\"%c\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[257], s2[257], s3[257];\n  char *p;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  p = strstr(s1, s2);\n  if (p) {\n    int i = p - s1;\n    s1[i] = '\u0000';\n    cout << s1;\n    printf(s3);\n    printf(\"%s \", p + strlen(s2));\n  } else {\n    puts(s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, n = 0, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (b[0] == a[i]) {\n      for (j = 0; j < lenb; j++) {\n        if (b[j] == a[i + j]) {\n          n++;\n        }\n      }\n    }\n    if (n == lenb)\n      break;\n    else\n      n = 0;\n  }\n  if (i < lena) {\n    for (j = 0; j < lenb; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12873", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  cin >> str >> sub >> rep;\n  int len = strlen(sub);\n  int i = 0;\n  char *p, *q, *r;\n  p = strstr(str, sub);\n  q = rep;\n  if (p != NULL) {\n    for (r = p; r < p + len; r++)\n      *r = *q++;\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300], subStr[10], re[10];\n  int i, j, lenth, m, n;\n  int flag = 0;\n  scanf(\"%s %s %s \", str, subStr, re);\n  lenth = strlen(str);\n  n = strlen(subStr);\n  m = strlen(re);\n  for (i = 0; i < lenth; i++) {\n    j = 0;\n    if (str[i] == subStr[j]) {\n      for (j = 0; j < n; j++) {\n        if (str[i] == subStr[j])\n          i++;\n        else {\n          break;\n        }\n      }\n    }\n    if (j == n) {\n      flag = 1;\n      for (; j > 0; i--, j--) {\n        str[i - 1] = re[j - 1];\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char su[100], zu[100], tu[100];\n\n  cin >> su;\n\n  cin >> zu;\n\n  cin >> tu;\n  int i, j, k, t;\n  for (i = 0; i < strlen(su); i++) {\n    for (k = 0, j = i; su[j] == zu[k]; j++, k++)\n      if (k == strlen(zu))\n        break;\n    if (k == strlen(zu))\n      break;\n  }\n  \n  if (j != i - 1) {\n    for (t = 0; t < i; t++)\n      printf(\"%c\", su[t]);\n    printf(\"%s\", tu);\n    for (t = j; t < strlen(su); t++)\n      printf(\"%c\", su[t]);\n  } else\n    printf(\"%s\", su);\n  return 0;\n}\n"}
{"label": "7", "index": "12876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      c = 1;\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n\n    if (i >= m && i < b + m && c == 1) {\n      printf(\"%c\", replacement[i - m]);\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  int a1, b1, c1;\n  int i, j, k;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i <= a1 - 1; i++) {\n    for (j = 0; j <= b1 - 1; j++) {\n      if (a[i + j] != b[j])\n        break;\n    }\n    if (j == b1) {\n      break;\n    }\n  }\n\n  if (i >= a1)\n    printf(\"%s\", a);\n  else {\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n\n    printf(\"%s\", c);\n    for (k = i + b1; k <= a1 - 1; k++)\n      printf(\"%c\", a[k]);\n  }\n}\n"}
{"label": "7", "index": "12878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[255], sub[255], rep[255], s[255];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  int len1 = strlen(str), len2 = strlen(sub), x = 0;\n  int i, j, n;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    n = 0;\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j]) {\n        break;\n      } else\n        n++;\n    }\n    if (n == len2) {\n      int m = 0;\n      while (i + j + m < len1) {\n        s[m] = str[i + j + m];\n        m++;\n      }\n      s[m] = '\u0000';\n      str[i] = '\u0000';\n      strcat(str, rep);\n      strcat(str, s);\n      puts(str);\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0)\n    puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12879", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int x, y, i, j, p, q, k, r, t, z;\n  x = strlen(a);\n  y = strlen(b);\n  q = 0;\n  for (i = 0; q == 0 && i < x; i++) {\n    if (b[0] == a[i]) {\n      p = i;\n      for (j = 0; b[j] == a[p] && b[j] != '\u0000' && a[p] != '\u0000'; j++) {\n        p++;\n      }\n      if (j == y) {\n        q = q + 1;\n      }\n    }\n  }\n  if (q == 0) {\n    for (z = 0; z < x; z++) {\n      printf(\"%c\", a[z]);\n    }\n  }\n  if (q != 0) {\n    for (k = 0; k < i - 1; k++) {\n      printf(\"%c\", a[k]);\n    }\n    for (r = 0; r < y; r++) {\n      printf(\"%c\", c[r]);\n    }\n    for (t = i + y - 1; t < x; t++) {\n      printf(\"%c\", a[t]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0, x = 0;\n  while (i < strlen(a)) {\n    if (a[i] == b[0]) {\n      int j;\n      for (j = 0; j < strlen(b); j++) {\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      }\n      if (j == strlen(b) && x == 0) {\n        printf(\"%s\", c);\n        x = 1;\n        i += strlen(b);\n      } else {\n        cout << a[i];\n        i++;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i = 0, j = 0, l = strlen(a), l_sub = strlen(sub);\n  while (i < l) {\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j])\n        b[i]++;\n    }\n    i++;\n  }\n  int k = 0, count = 0, w = 999;\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w = k;\n      count++;\n      break;\n    }\n  }\n  char c[300];\n\n  scanf(\"%s \", c);\n  int q = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w) {\n        printf(\"%s\", c);\n        q += l_sub;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *org, *sub, *re;\n  int i, j, flag;\n  org = (char *)malloc(1024 * sizeof(char));\n  sub = (char *)malloc(100 * sizeof(char));\n  re = (char *)malloc(100 * sizeof(char));\n\n  cin >> org;\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; *(org + i) != '\u0000'; i++) {\n    if (*(org + i) == *sub) {\n      for (j = 0; *(sub + j) != '\u0000'; j++) {\n        flag = 0;\n        if (*(org + i + j) != *(sub + j)) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        for (j = 0; *(re + j) != '\u0000'; j++)\n          *(org + i + j) = *(re + j);\n        break;\n      }\n    }\n  }\n  cout << org;\n}\n"}
{"label": "7", "index": "12883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar zfc[3][257];\nint main() {\n\n  cin >> zfc[1];\n\n  scanf(\"%s \", zfc);\n\n  scanf(\"%s \", zfc);\n  int i, k, len, len2, j;\n  len = strlen(zfc[1]);\n  len2 = strlen(zfc[2]);\n  for (i = 0; i < len; i++) {\n    if ((zfc[1][i] == zfc[2][0]) && (zfc[1][i + 1] == zfc[2][1]))\n      break;\n  }\n  if (i != len) {\n    for (k = i; k < (len2 + i); k++) {\n      j = k - i;\n      zfc[1][k] = zfc[3][j];\n      if (k == len2 + i) {\n        break;\n      }\n    }\n  }\n  printf(\"%s\", zfc[1]);\n  return 0;\n}\n"}
{"label": "7", "index": "12884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid adds(char *a, char *b);\nvoid addc(char *a, char c);\nint main() {\n  char s[256];\n  char subs[256];\n  char replace[256];\n  char result[1000] = \"\";\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", subs);\n\n  cin >> replace;\n\n  int len_s = strlen(s);\n  int len_subs = strlen(subs);\n  int len_replace = strlen(replace);\n  int i, j = 0;\n  int finish = 0;\n  for (i = 0; i < len_s; i++) {\n    if (s[i] == subs[j] && finish == 0)\n      if (j == len_subs - 1) {\n        adds(result, replace);\n        j = 0;\n        finish = 1;\n\n      } else\n        j++;\n    else {\n      i -= j;\n      j = 0;\n      addc(result, s[i]);\n    }\n  }\n  printf(\"%s \", result);\n\n  return 0;\n}\n\nvoid adds(char *a, char *b) {\n  int len_a = strlen(a);\n  int len_b = strlen(b);\n  int i;\n  for (i = len_a; i <= len_a + len_b - 1; i++)\n    *(a + i) = *(b + i - len_a);\n  *(a + len_a + len_b) = '\u0000';\n}\n\nvoid addc(char *a, char c) {\n  int len_a = strlen(a);\n  *(a + len_a) = c;\n  *(a + len_a + 1) = '\u0000';\n}\n"}
{"label": "7", "index": "12885", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, n, L, l1, l2;\n  char s[1000], a[300], b[300];\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  getchar();\n  L = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  n = 0;\n  for (i = 0; i < L; i++) {\n    if (a[0] == s[i]) {\n      n++;\n      for (k = 1; k < l1; k++) {\n        if (s[i + k] == a[k]) {\n          n++;\n        } else {\n          n = 0;\n          break;\n        }\n      }\n    }\n    if (n == l1) {\n      break;\n    }\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  for (k = 0; i != L && k < l2; k++) {\n    printf(\"%c\", b[k]);\n    getchar();\n  }\n  for (k = i + l1; i != L && k < L; k++) {\n    printf(\"%c\", s[k]);\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d && a[l]; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        cout << s;\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256 + 16], tar[256 + 16], rep[256 + 16];\n  int a, b, i, j, k, c = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", tar);\n  scanf(\"%s\", rep);\n  a = strlen(s);\n  b = strlen(tar);\n  for (i = 0; i < a - b + 1; i++) {\n    for (j = 0; j < b; j++) {\n      if (tar[j] != s[i + j])\n        break;\n      if (j == b - 1) {\n        for (k = 0; k <= i - 1; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", rep);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int k, count = 0, i, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  k = strlen(sub);\n  for (i = 0;;) {\n\n    if (count == k || str[j] == '\u0000')\n      break;\n    else {\n      for (; str[j] != 0 && count != k; j++) {\n        if (str[j] == sub[i]) {\n          count++;\n          i++;\n        } else {\n          count = 0;\n          i = 0;\n        }\n      }\n    }\n  }\n  if (count == k) {\n\n    for (int t = 0; j - k + t < j; t++) {\n      str[j - k + t] = rep[t];\n    }\n  }\n  printf(\"%s\", str);\n}\n"}
{"label": "7", "index": "12889", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char w[256], s[256], r[256];\n  int len1, len2, len3, i, j, k;\n  scanf(\"%s \", w);\n  scanf(\"%s\\n\", s);\n  scanf(\"%s\", r);\n  len1 = (int)strlen(s);\n  len2 = (int)strlen(w);\n  len3 = (int)strlen(r);\n  for (i = 0; i < len2; i++) {\n    if (w[i] == s[0]) {\n      for (j = 1; j < len1; j++) {\n        if (s[j] != w[i + j]) {\n          break;\n        }\n      }\n    }\n    if (j == len1) {\n      for (k = 0; k < len3; k++) {\n        w[i + k] = r[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12890", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256], a[256], b[256], tmp[256];\n  int i, lenstr, lena;\n  char *pstr;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  lenstr = strlen(str);\n  lena = strlen(a);\n\n  for (i = 0; i <= lenstr - lena; i++) {\n    pstr = &str[i];\n    strncpy(tmp, pstr, lena);\n    tmp[lena] = '\u0000';\n\n    if (strcmp(tmp, a) == 0) {\n      str[i] = '@';\n      break;\n    }\n  }\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == '@') {\n      printf(\"%s\", b);\n      i = i + lena - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "7", "index": "12891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  scanf(\"%s %s %s \", str, sub, rep);\n  char *p = strstr(str, sub), *temp1, *temp2;\n  if (p == NULL)\n    cout << str;\n  else {\n    temp1 = p, temp2 = rep;\n    while (*temp2 != '\\0') {\n      *temp1 = *temp2;\n      temp1++, temp2++;\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len1, len2, i, j, m, control = 0;\n  char st[256], sub[256], re[256];\n\n  cin >> st;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(st);\n  len2 = strlen(sub);\n  int k = 0;\n  for (i = 0, j = 0; i < len1; i++) {\n    if (k == 0 && sub[j] == st[i]) {\n      if (len2 == 1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", st[m]);\n        }\n        printf(\"%s\", re);\n        for (m = m + 1; m < len1; m++)\n          printf(\"%c\", st[m]);\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    } else if (k != 0 && sub[j] != st[i]) {\n      k = 0;\n      j = 0;\n    } else if (k != 0 && sub[j] == st[i]) {\n      if (j == len2 - 1) {\n        for (m = 0; m < i - j; m++)\n          cout << st[m];\n        printf(\"%s\", re);\n        for (m = m + len2; m < len1; m++)\n          printf(\"%c\", st[m]);\n        printf(\" \");\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    }\n  }\n  if (control == 0)\n    puts(st);\n  return 0;\n}\n"}
{"label": "7", "index": "12893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], ci[256][256];\n  int ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int i, j;\n  for (i = 0; i <= ls - la; i++) {\n    for (j = 0; j < la; j++) {\n      ci[i][j] = s[i + j];\n    }\n    ci[i][la] = '\u0000';\n  }\n  for (i = 0; i <= ls - la; i++) {\n    if (strcmp(ci[i], a) == 0) {\n      strcpy(ci[i], b);\n      break;\n    }\n  }\n  if (i != ls - la + 1) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[i]);\n    if (i != ls - la) {\n      for (j = i + la; j < ls - la; j++) {\n        printf(\"%c\", ci[j][0]);\n      }\n      printf(\"%s\", ci[ls - la]);\n    }\n  } else {\n    for (j = 0; j < ls - la; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[ls - la]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12894", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n = 0, m;\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  m = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] == b[j])\n          n++;\n      }\n    }\n    if (n == m - 1) {\n      for (j = 0; j < m; j++)\n        a[i + j] = c[j];\n      break;\n    }\n  }\n  puts(a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z, m, t = 1, n;\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      } else {\n        if (j == y - 1) {\n          for (m = 0; m < z; m++)\n            printf(\"%c\", c[m]);\n          i = i + y - 1;\n          t = 0;\n        }\n      }\n    }\n    if (j < y - 1)\n      printf(\"%c\", a[i]);\n\n    if (t == 0)\n      break;\n  }\n  for (n = i + 1; n < x; n++)\n    printf(\"%c\", a[n]);\n  return 0;\n}\n"}
{"label": "7", "index": "12896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], rep[256];\n  int t, i, j, k;\n  cin >> s;\n  cin >> sub;\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    t = 0;\n    if (s[i] == sub[0]) {\n      for (j = i, k = 0; sub[k] != '\u0000'; j++, k++) {\n        if (s[j] != sub[k]) {\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        for (j = i; rep[j - i] != '\u0000'; j++)\n          s[j] = rep[j - i];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, m, p, e;\n  char sz[1000], sf[1000], sc[1000];\n\n  cin >> sz;\n\n  cin >> sf;\n\n  cin >> sc;\n  int len = strlen(sz);\n  int len1 = strlen(sf);\n  for (i = 0; i < len; i++) {\n    e = 0;\n    if (sz[i] == sf[0]) {\n      for (k = 0; k < len1; k++) {\n        if (sz[i + k] == sf[k])\n          e++;\n      }\n\n      if (e == len1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", sz[m]);\n        }\n        printf(\"%s\", sc);\n        for (p = i + len1; p < len; p++) {\n          printf(\"%c\", sz[p]);\n        }\n\n        break;\n      }\n    }\n  }\n  if (e != len1) {\n    printf(\"%s\", sz);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[260] = {0}, substring[50] = {0}, replacement[50] = {0},\n       temp[50] = {0}, length, length_s, length_r, i, j, k = 0, m, n;\n  cin >> string >> substring >> replacement;\n  length = strlen(string);\n  length_s = strlen(substring);\n  length_r = strlen(replacement);\n  for (i = 0; i <= length - length_s; i++) {\n    memset(temp, 0, sizeof(temp));\n    k = 0;\n    for (j = i; j < i + length_s; j++) {\n      temp[k++] = string[j]; \n    }\n    if (!strcmp(temp, substring)) \n    {\n      if (length_s != length_r) \n      {\n        n = i + length_s;\n        for (m = i + length_r; m < length; m++) {\n          string[m] = string[n++];\n        }\n      }\n      n = 0;\n      for (m = i; m < i + length_r; m++) {\n        string[m] = replacement[n++];\n      }\n      break;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[257], son[257], re[357], fu[257];\n  int i, len, slen, k, t = 0;\n\n  cin >> zfc;\n\n  cin >> son;\n\n  cin >> re;\n  len = strlen(zfc);\n  slen = strlen(son);\n  for (i = 0; i <= len - slen; i++) {\n    for (k = i; k < i + slen; k++) {\n      fu[k - i] = zfc[k];\n    }\n    fu[slen] = '\u0000';\n    if (strcmp(fu, son) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      printf(\"%s\", re);\n      for (k = i + slen; k < len; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      t = 1;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"%s\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12900", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char t[256];\n  char c;\n  int i, ls, j, la, lt, g, word = 0;\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", t);\n  ls = strlen(s);\n  la = strlen(a);\n  lt = strlen(t);\n\n  for (i = 0; i < ls; i++) {\n    if (word == 0) {\n      g = 0;\n      if (s[i] == a[0]) {\n        g++;\n        for (j = i + 1; j < i + la; j++) {\n          if (s[j] == a[g])\n            g++;\n        }\n        if (g == la) {\n          word = 1;\n          for (j = i; j < i + la; j++) {\n            s[j] = t[j - i];\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[256];\n  char zichuan[256];\n  char tihuan[20];\n  char daitihuan[20];\n  int k;\n  int e;\n  int s = 1;\n  int tag = 0;\n\n  cin >> zfc;\n\n  cin >> zichuan;\n\n  cin >> tihuan;\n  int l, m;\n  int i, j;\n  l = strlen(zichuan);\n  m = strlen(zfc);\n  for (i = 0; i < m; i++) {\n    for (j = i; j < i + l; j++) {\n      daitihuan[j - i] = zfc[j];\n    }\n    daitihuan[l] = 0;\n    k = strcmp(daitihuan, zichuan);\n    s *= k;\n    if (k == 0 && tag == 0) {\n      e = i;\n      tag = 1;\n    }\n  }\n  if (s != 0) {\n    printf(\"%s\", zfc);\n  } else if (s == 0) {\n    for (i = 0; i < e; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    printf(\"%s\", tihuan);\n    for (i = e + l; i < m; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int sum1 = strlen(b);\n  int i, k, p, q, start, pd = 0;\n  for (start = 0; start < strlen(a); start++) {\n    k = 0;\n    for (i = start; i < start + sum1; i++) {\n      if (a[i] != b[k])\n        break;\n      k++;\n    }\n    if (i == (start + sum1)) {\n      pd = 1;\n      p = start;\n      break;\n    }\n  }\n\n  if (pd == 1) {\n    for (q = p, k = 0; c[k] != '\u0000'; q++, k++)\n      a[q] = c[k];\n  }\n  cout << a;\n}\n"}
{"label": "7", "index": "12903", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c, m, d, k, v = 0;\n  char str[100], substr[100], rep[100];\n  cin >> str >> substr >> rep;\n  a = strlen(str);\n  b = strlen(substr);\n  for (i = 0; i < a; i++) {\n    k = i;\n    if (substr[0] == str[k]) {\n      d = 0;\n      for (j = i + 1, m = 1; j < i + b; j++, m++) {\n        if (substr[m] == str[j])\n          d++;\n      }\n\n      if (d == b - 1)\n        for (j = i, c = 0; j < i + b; j++, c++) {\n          str[j] = rep[c];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  scanf(\"%s\", str3);\n  int a, i, j, b, k = 0, c;\n  c = strlen(str3);\n  a = strlen(str1);\n  b = strlen(str2);\n  for (i = 0; i < a; i++) {\n    if (str1[i] == str2[0]) {\n      for (j = 1; j < b; j++) {\n        if (str1[i + j] == str2[j])\n          k++;\n        else {\n          k = 0;\n          break;\n        }\n      }\n      if (k == b - 1) {\n        for (j = i; j < i + c; j++) {\n          str1[j] = str3[j - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "12905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n  cin >> a;\n  cin >> b;\n  cin >> e;\n  k = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, a1, b1, c1, n = 0, m, t, j, p = 0;\n  scanf(\"%s %s %s\", a, b, c);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i < a1; i++) {\n    for (j = 0; j < b1; j++) {\n      if (a[i + j] == b[j])\n        p = p + 1;\n    }\n    if (p == b1) {\n      for (m = 0; m < i; m++)\n        printf(\"%c\", a[m]);\n      printf(\"%s\", c);\n      for (m = b1 + i; m < a1; m++)\n        printf(\"%c\", a[m]);\n      n = 9;\n      break;\n    }\n    p = 0;\n  }\n  if (n == 0)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[100], b[100], c[100];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  n = strlen(b);\n  int i = 0;\n  while (a[i] != '\\0') {\n    int m = 0;\n    while (m < n) {\n      if (a[i + m] == b[m])\n        m++;\n      else\n        break;\n    }\n    if (m == n) {\n      int p = 0;\n      while (p < i) {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      printf(\"%s\", c);\n      p = p + n;\n      while (a[p] != '\\0') {\n        printf(\"%c\", a[p]);\n        p++;\n      }\n      break;\n    }\n    i++;\n  }\n  if (a[i] == '\\0')\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12908", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[256], wt[256], tar[256];\n  int i, j, tag;\n  scanf(\"%s\", zfc);\n  scanf(\"%s\", wt);\n  scanf(\"%s\", tar);\n  int n = strlen(zfc);\n  int k = strlen(wt);\n  for (i = 0; i < n - k + 1; i++) {\n    tag = 0;\n    for (j = i; j < i + k; j++) {\n      if (zfc[j] != wt[j - i]) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (j = i; j < i + k; j++) {\n        zfc[j] = tar[j - i];\n      }\n\n      break;\n    }\n  }\n  puts(zfc);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12909", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000], c[1000];\n  int l, i, j, k, temp;\n  scanf(\"%s %s %s\", a, b, c);\n  l = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0]) {\n      temp = 0;\n      for (j = 0; j < l; j++) {\n        if (b[j] != a[j + i])\n          break;\n      }\n      if (j == l) {\n        for (j = 0; j < l; j++) {\n          a[j + i] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  int i, j, len1, len2, ex = 0, a = 0, shit = 0;\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (string[i + j] == substring[j]) {\n        ex++;\n      }\n      if (ex == len2 && shit == 0) {\n        shit = 1;\n        for (j = a; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        cout << replacement;\n        a = i + len2;\n      }\n    }\n    ex = 0;\n  }\n  for (j = a; j < len1; j++) {\n    cout << string[j];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100];\n  int len, i, t = 1, lenall, judge = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  cin >> out;\n  len = strlen(in);\n  lenall = strlen(zfc);\n  for (i = 0; i <= lenall - len; i++) {\n    strcpy(x, zfc);\n    x[i + len] = 0;\n    if (i != 0) {\n      x[i - 1] = 0;\n    }\n    if (strcmp(&x[i], in) == 0) {\n      if (i != 0) {\n        strcpy(y, zfc);\n        y[i] = 0;\n        y[i + len - 1] = 0;\n        y[lenall] = 0;\n        printf(\"%s%s%s\", &y[0], out, &y[i + len]);\n        judge = 0;\n        break;\n      } else {\n        cout << out << zfc[i + len] << &x[i + len + 1];\n        judge = 0;\n        break;\n      }\n    }\n  }\n  if (judge) {\n    printf(\"%s\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256 + 16], tar[256 + 16], rep[256 + 16];\n  int a, b, i, j, k, c = 0;\n  scanf(\"%s\", s);\n  scanf(\"%s\", tar);\n  scanf(\"%s\", rep);\n  a = strlen(s);\n  b = strlen(tar);\n  for (i = 0; i < a - b + 1; i++) {\n    for (j = 0; j < b; j++) {\n      if (tar[j] != s[i + j])\n        break;\n      if (j == b - 1) {\n        for (k = 0; k <= i - 1; k++)\n          printf(\"%c\", s[k]);\n        printf(\"%s\", rep);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", s[k]);\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "12913", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  cin >> a >> b >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++)\n      a[p] = c[0 + p - h];\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], e[257], f[257];\n  int i, n1, n2, k, j, m = 1;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", e);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n    for (k = 0; k < n2; k++) {\n      c[k] = a[i + k];\n    }\n    c[n2] = 0;\n    if (strcmp(b, c) == 0) {\n      d[i] = 0;\n      for (j = 0; j < (n1 - n2 - i); j++) {\n        f[j] = a[i + n2 + j];\n      }\n      f[j] = 0;\n      printf(\"%s%s%s\", d, e, f);\n      m = 0;\n      break;\n    }\n  }\n  if (m) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], c[256], l[256], g[20], h[20];\n  int b, i, e = 0, q, p, j, k;\n\n  cin >> a;\n  b = strlen(a);\n\n  cin >> h;\n\n  cin >> g;\n  q = strlen(h);\n  for (i = 0; i < b; i++) {\n    if (a[i] == h[0]) {\n      p = 1;\n      for (j = 1; j < q; j++) {\n        if (a[i + j] != h[j]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (k = 0; k < i; k++) {\n          c[k] = a[k];\n          c[k + 1] = '\u0000';\n        }\n        l[0] = -1;\n        for (k = i + q; k < b; k++) {\n          l[k - i - q] = a[k];\n          l[k - i - q + 1] = '\u0000';\n        }\n        strcat(c, g);\n        if (l[0] != -1)\n          strcat(c, l);\n\n        strcpy(a, c);\n        b = strlen(a);\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  char *p = strstr(str, sub);\n  if (p == NULL) {\n    cout << str << \" \";\n  } else {\n    int len = strlen(rep);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = rep[i];\n      p++;\n    }\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, m, n, i, j, s, k;\n  char string[256], substring[256], replacement[256];\n  char t;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  cin >> replacement;\n  l = strlen(string);\n  m = strlen(substring);\n  t = substring[0];\n  for (i = 0; i <= l - m; i++) {\n    s = 0;\n    if (string[i] == t) {\n      for (j = i; j <= i + m - 1; j++) {\n        if (string[j] == substring[j - i])\n          s++;\n      }\n      if (s == m) {\n        for (k = 0; k <= m - 1; k++) {\n          string[i + k] = replacement[k];\n        }\n        i = l - m;\n      } else {\n        i++;\n      }\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "12918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[256], b[256];\n  int n, m, p, i, j, k;\n  cin.getline(s, 256);\n  cin.getline(a, 256);\n  cin.getline(b, 256);\n  n = strlen(s);\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0]) {\n      for (j = 1; j < m; j++)\n        if (a[j] != s[j + i])\n          break;\n      if (j == m) {\n        if (m == p) {\n          for (j = 0; j < m; j++)\n            s[i + j] = b[j];\n        } else {\n          if (p < m) {\n            for (j = 0; j < p; j++)\n              s[i + j] = b[j];\n            for (j = i + p;; j++) {\n              s[j] = s[j + m - p];\n              if (s[j] == '\\0')\n                break;\n            }\n          } else {\n            for (j = 0;; j++) {\n              if (n - j == i + m - 1)\n                break;\n              s[n + p - m - j] = s[n - j];\n            }\n            for (k = 0; k < p; k++)\n              s[i + k] = b[k];\n          }\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], substr[256], replace[256];\n  scanf(\"%s %s %s \", str, substr, replace);\n  int lenstr = strlen(str), lensubstr = strlen(substr),\n      lenreplace = strlen(replace);\n  int i, j;\n  int flag = 0;\n  int pos;\n  for (i = 0; i <= lenstr - lensubstr; i++) {\n    for (j = 0; j < lensubstr; j++) {\n      if (str[i + j] != substr[j])\n        break;\n    }\n    if (j == lensubstr) {\n      pos = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag) {\n    for (i = 0; i < pos; i++)\n      cout << str[i];\n    cout << replace;\n    cout << (str + pos + lensubstr) << endl;\n  } else\n    cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12920", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, lch, lsub, lre;\n  char ch[256];\n  char subch[256];\n  char replace[256];\n  cin >> ch;\n  cin >> subch;\n  cin >> replace;\n  lch = strlen(ch);\n  lsub = strlen(subch);\n  lre = strlen(replace);\n  for (i = 0; i < lch; i++) {\n    if (ch[i] == subch[0]) {\n      for (j = 0; j < lsub; j++) {\n        if (ch[i + j] != subch[j])\n          break;\n      }\n      if (j == lsub) {\n        for (k = 0; k < lsub; k++) {\n          ch[i + k] = replace[k];\n        }\n        break;\n      }\n    }\n  }\n  for (i = 0; i < lch; i++) {\n    cout << ch[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12921", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1)\n    cout << a;\n  else if (flag == 0) {\n    cout << c;\n    for (i = len2; i <= len1 - 1; i++)\n      cout << a[i];\n  } else {\n    for (i = 0; i <= flag - 1; i++)\n      cout << a[i];\n    cout << c;\n    for (i = i + len2; i <= len1 - 1; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256];\n  char a[256];\n  char b[256];\n  int i, j, x = 0, m, n, y = 0, p;\n  char c;\n  scanf(\"%s\", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(b);\n  p = strlen(s);\n  for (i = 0; i <= p - n; i++) {\n    c = s[i];\n    if (c == a[0]) {\n      for (j = 0; j < n; j++) {\n        if (a[j] != s[i + j])\n          x = 1;\n        else\n          x = 0;\n      }\n      if (x == 0) {\n        m = i;\n        y = 1;\n        break;\n      }\n    }\n  }\n  if (y == 1) {\n    for (i = m, j = 0; i < m + n; i++, j++)\n      s[i] = b[j];\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "12923", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  cin >> s >> a >> b;\n  int i, j, n, k, m = 0, max;\n  for (i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    for (j = 0; j < strlen(a); j++) {\n      c[j] = s[i + j];\n    }\n    c[j + 1] = '\\0';\n    if (strcmp(c, a) == 0) {\n      break;\n    }\n    c[j] = 0;\n    m++;\n  }\n\n  if (strlen(b) > strlen(a)) {\n    max = strlen(b);\n  } else {\n    max = strlen(a);\n  }\n  if (m != strlen(s) - strlen(a) + 1) {\n    for (j = 0; j < max; j++) {\n      if (b[j] == '\\0') {\n        break;\n      }\n      s[i + j] = b[j];\n    }\n    printf(\"%s\", s);\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a1[257 * 2], a2[257], b1[257];\n  int i, j, k, start = 0, end = 0;\n\n  cin >> a1;\n\n  scanf(\"%s \", a2);\n\n  scanf(\"%s \", b1);\n  for (i = 0; a1[i] != 0; i++) {\n    if (a1[i] == a2[0]) {\n      for (j = i + 1, k = 1; a2[k] != 0; j++, k++) {\n        if (a1[j] != a2[k]) {\n          break;\n        }\n      }\n      if (a2[k] == 0) {\n        start = i;\n        end = j;\n        break;\n      }\n    }\n  }\n  if (start < end) {\n    for (i = start, k = 0; b1[k] != 0; i++, k++) {\n      a1[i] = b1[k];\n    }\n    for (j = end; a1[j] != 0; i++, j++) {\n      a1[i] = a1[j];\n    }\n    a1[i] = 0;\n  }\n  printf(a1);\n  return 0;\n}\n"}
{"label": "7", "index": "12925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a, b, c;\n  c = 0;\n  char t[256] = {0};\n  char s[256] = {0};\n  char r[256] = {0};\n  char z[256] = {0};\n  cin >> t >> s >> r;\n  a = strlen(t);\n  b = strlen(s);\n  for (i = 0; i <= a - b; i++) {\n    for (j = i; j < b + i; j++)\n      z[j - i] = t[j];\n    if (strcmp(z, s) == 0) {\n      c = i;\n      break;\n    }\n  }\n  if (c == 0) {\n    for (i = 0; i < a; i++)\n      cout << t[i];\n  } else {\n    for (i = 0; i < c; i++) {\n      printf(\"%c\", t[i]);\n    }\n    printf(\"%s\", r);\n    for (j = c + b; j < a; j++)\n      printf(\"%c\", t[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12926", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[258], str2[258], str3[258], ch[600];\n  int len1, len2, len3, i = 0, j = 0;\n  int m, n = 0;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i < len1; i++) {\n    n = 0;\n    m = i;\n    if (str1[m] == str2[j]) {\n      n = 1;\n      for (j = 0, m; j < len2; j++, m++) {\n        if (str1[m] != str2[j]) {\n          n = 0;\n          j = 0;\n          break;\n        }\n      }\n      if (n == 1) {\n        m = i;\n        for (i = 0; i < len1 + len3 - len2; i++) {\n          if (i >= m && i < m + len3)\n            ch[i] = str3[i - m];\n          else if (i < m)\n            ch[i] = str1[i];\n          else\n            ch[i] = str1[len2 + i - len3];\n        }\n        break;\n      }\n    }\n  }\n  if (n == 1)\n    for (i = 0; i < len1 + len3 - len2; i++)\n      cout << ch[i];\n  else {\n    for (i = 0; i < len1; i++)\n      cout << str1[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int t, i, k;\n  scanf(\"%s\\n%s\\n%s\", s, sub, re);\n  t = strlen(sub);\n  for (i = 0; i < strlen(s) - t + 1; i++) {\n    int x = 0;\n    for (k = i; k < i + t; k++) {\n      if (s[k] != sub[k - i]) {\n        x += 1;\n      }\n    }\n    if (x == 0) {\n      for (k = i; k < i + t; k++) {\n        s[k] = re[k - i];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "12928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n\n  int len1, len2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  int i, j, k = 0;\n  int tag = 0, tag1;\n\n  for (i = 0, j = 0; j < len1; j++) {\n    if (tag != 1 && k == 0) {\n      if (s2[i] == s1[j]) {\n        for (k = j + 1, i = i + 1; i < len2; k++) {\n          if (s2[i] != s1[k]) {\n            i = 0;\n          }\n\n          else {\n            i++;\n            if (i == len2) {\n              tag = 1;\n              tag1 = k - len2 + 1;\n            }\n          }\n        }\n      }\n    } else if (tag != 1 && k == len1)\n      break;\n    else if (tag == 1)\n      break;\n  }\n\n  if (tag == 0) {\n    cout << s1;\n  } else {\n    int t, m;\n    for (t = tag1, m = 0; t < tag1 + len2; t++) {\n      s1[t] = s3[m];\n      m++;\n      if (m == len2) {\n        break;\n      }\n    }\n    printf(\"%s\", s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, i, j, a = 0;\n  char str[256], sub[256], rep[256], word[256];\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", sub);\n\n  cin >> rep;\n  len = strlen(sub);\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < len; j++) {\n        word[j] = str[i + j];\n      }\n      word[len] = '\u0000';\n      if (strcmp(word, sub) == 0) {\n        strcpy(word, rep);\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", str[j]);\n        }\n        printf(\"%s\", word);\n        for (j = i + len; str[j] != 0; j++) {\n          printf(\"%c\", str[j]);\n        }\n        a = 1;\n        break;\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], substr[50], r[50];\n\n  cin >> str;\n\n  cin >> substr;\n\n  cin >> r;\n  int i, j, n, same = 0;\n  int l = strlen(substr);\n  for (i = 0; str[i] != 0; i++) {\n    if (substr[0] == str[i]) {\n      same = 1;\n      for (j = 1; substr[j] != 0; j++) {\n        if (substr[j] != str[i + j]) {\n          same = 0;\n          break;\n        }\n      }\n      if (same == 1) {\n        n = i;\n        break;\n      }\n    }\n  }\n  if (same == 1) {\n    for (j = 0; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"%s\", r);\n    for (j = n + l; str[j] != 0; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  if (same == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12931", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int sum = 0, i, j, k, n, m, h = 0, y = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  k = strlen(c);\n  for (i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 0; j < m; j++) {\n        if (b[j] == a[i + j])\n          sum++;\n      }\n      if (sum == m && y == 0) {\n        for (j = 0; j < k; j++)\n          d[h + j] = c[j];\n        i = i + m;\n        h = h + k;\n        y = 1;\n      }\n      sum = 0;\n    }\n    d[h] = a[i];\n    h++;\n  }\n  d[h] = '\u0000';\n  printf(\"%s \", d);\n  return 0;\n}\n"}
{"label": "7", "index": "12932", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, m;\n  char s1[300], s2[300], s3[300];\n  cin >> s1 >> s2 >> s3;\n  m = strlen(s1);\n  a = strlen(s2);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < a; j++) {\n      if (s2[j] != s1[i + j])\n        break;\n    }\n    if (j == a) {\n      for (j = 0; j < a; j++) {\n        s1[i + j] = s3[j];\n      }\n      break;\n    };\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, t;\n  char s1[256], s2[256], s3[256];\n\n  scanf(\"%s \", s1);\n\n  scanf(\"%s \", s2);\n\n  scanf(\"%s \", s3);\n  for (i = 0; s1[i] != '\u0000'; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; s2[j] != '\u0000'; j++)\n        if (s2[j] == s1[i + j])\n          k++;\n      if (s2[k] == '\u0000') {\n        for (t = 0; t < i; t++)\n          printf(\"%c\", s1[t]);\n        for (t = 0; t < k; t++)\n          printf(\"%c\", s3[t]);\n        for (t = i + k; s1[t] != '\u0000'; t++)\n          printf(\"%c\", s1[t]);\n        printf(\" \");\n        break;\n      }\n    }\n  if (s2[k] != '\u0000')\n    printf(\"%s \", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12934", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[50];\n  char b[256];\n  char news[50];\n  int i, c, wz = 500, x = 0;\n  char st[100], en[100];\n\n  scanf(\"%s\", b);\n\n  scanf(\"%s\", a);\n  cin >> news;\n\n  for (i = 0; i < strlen(b); i++) {\n    x = 0;\n    if (a[0] == b[i]) {\n      for (c = i + 1; c < strlen(a) + i; c++) {\n        if (a[c - i] == b[c]) {\n          x++;\n        }\n      }\n      if (x == strlen(a) - 1) {\n        wz = i;\n        break;\n      }\n    }\n  }\n\n  if (wz != 500) {\n    for (i = 0; i < wz; i++) {\n      st[i] = b[i];\n    }\n    st[i] = '\\0';\n\n    for (i = wz + strlen(a); i < strlen(b); i++) {\n      en[i - wz - strlen(a)] = b[i];\n    }\n    en[i - wz - strlen(a)] = '\\0';\n    strcat(st, news);\n    strcat(st, en);\n    puts(st);\n\n  } else if (wz == 500) {\n\n    puts(b);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[258], str2[258], str3[258], ch[600];\n  int len1, len2, len3, i = 0, j = 0;\n  int m, n = 0;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i < len1; i++) {\n    n = 0;\n    m = i;\n    if (str1[m] == str2[j]) {\n      n = 1;\n      for (j = 0, m; j < len2; j++, m++) {\n        if (str1[m] != str2[j]) {\n          n = 0;\n          j = 0;\n          break;\n        }\n      }\n      if (n == 1) {\n        m = i;\n        for (i = 0; i < len1 + len3 - len2; i++) {\n          if (i >= m && i < m + len3)\n            ch[i] = str3[i - m];\n          else if (i < m)\n            ch[i] = str1[i];\n          else\n            ch[i] = str1[len2 + i - len3];\n        }\n        break;\n      }\n    }\n  }\n  if (n == 1)\n    for (i = 0; i < len1 + len3 - len2; i++)\n      cout << ch[i];\n  else\n    for (i = 0; i < len1; i++)\n      printf(\"%c\", str1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "12936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char strstr[300];\n  char repla[300];\n  int i, j, k;\n  cin.getline(str, 300);\n  cin.getline(strstr, 300);\n  cin.getline(repla, 300);\n\n  int sl1 = strlen(str);\n  int sl2 = strlen(strstr);\n  int sl3 = strlen(repla);\n\n  for (i = 0; i < sl1; i++) {\n    int flag = 1;\n    if (str[i] != strstr[0]) {\n      continue;\n    } else {\n      for (j = i; j < i + sl2; j++) {\n        if (str[j] != strstr[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 0) {\n        continue;\n      }\n\n      else {\n        int vec = sl3 - sl2;\n\n        for (k = sl1; k >= i + sl2; k--) {\n          str[k + vec] = str[k];\n        }\n\n        for (k = i; k < i + sl3; k++) {\n          str[k] = repla[k - i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100];\n  int n, k, j = 0, i, s, d;\n\n  scanf(\"%s \", words);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  n = strlen(words);\n  s = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (strncmp(words + i, a, s) == 0) {\n      for (j = i, k = 0; k < d; j++, k++)\n        words[j] = b[k];\n\n      break;\n    }\n  }\n  puts(words);\n  return 0;\n}\n"}
{"label": "7", "index": "12938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char substring[256];\n  char replacement[256];\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  int length_string = strlen(string);\n  int length_substring = strlen(substring);\n  int length_replacement = strlen(replacement);\n  int i, j, k;\n  for (i = 0; i < length_string; i++) {\n    for (j = 0; j < length_substring; j++) {\n      if (substring[j] != string[i + j]) {\n        break;\n      }\n    }\n    if (j == length_substring) {\n      for (k = 0; k < length_substring; k++) {\n        string[i + k] = replacement[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", string);\n}\n"}
{"label": "7", "index": "12939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[500], sub[500], rep[500];\n  int i, j, shou, mo, k;\n  cin >> str >> sub >> rep;\n  int len1 = strlen(str);\n  int len2 = strlen(sub);\n  int len3 = strlen(rep);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j]) {\n        break;\n      }\n    }\n    if (j == len2) {\n      shou = i;\n      mo = i + j;\n      break;\n    }\n  }\n  if (j != len2)\n    printf(\"%s\", str);\n  else {\n    if (len2 >= len3) {\n      for (i = shou, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = mo; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    }\n\n    else {\n      i = len1 + len3 - len2;\n      for (k = len1; k >= mo; k--, i--) {\n        str[i] = str[k];\n      }\n      for (k = shou, j = 0; rep[j] != 0; k++, j++) {\n        str[k] = rep[j];\n      }\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf[266];\n  char a[266];\n  char b[266];\n  int i, k, j = 0, c = 0, d = 0, p = 0, mark = 0;\n  scanf(\"%s\", zf);\n  c = strlen(zf);\n  cin >> a;\n  d = strlen(a);\n  cin >> b;\n  for (i = 0; i < c; i++) {\n    if (zf[i] == a[0]) {\n      for (k = 0; k < d; k++) {\n        if (zf[i + k] == a[k]) {\n          j++;\n          if (j == d) {\n            p = i;\n            mark = 1;\n          }\n        }\n      }\n    }\n  }\n  if (mark == 1) {\n    for (i = 0; i < p; i++) {\n      printf(\"%c\", zf[i]);\n    }\n    printf(\"%s\", b);\n    for (i = p + d; i < c; i++) {\n      printf(\"%c\", zf[i]);\n    }\n  }\n  if (mark == 0)\n    printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "12941", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a;\n  cin >> b;\n  scanf(\"%s \", c);\n  int q, w, e;\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  int i, j, k;\n  int result = 1, d;\n  for (k = 0; k < q; k++) {\n    if (a[k] == b[0]) {\n      result = 1;\n      for (i = k, j = 0; i < w + k, j < w; i++, j++) {\n        d = a[i] - b[j];\n        if (d != 0)\n          result = 0;\n      }\n      if (result) {\n        for (i = k, j = 0; j < e, i < w + k; i++, j++)\n          a[i] = c[j];\n\n        break;\n      }\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s3[100];\n  char s1[100];\n  char s2[100];\n  int L1, L2, i, j;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n\n  cin >> s3;\n  L1 = strlen(s1);\n  L2 = strlen(s2);\n  for (i = 0; i < L1; i++) {\n    if (s1[i] == s2[0] && s1[i + L2 - 1] == s2[L2 - 1]) {\n      for (j = i; j < i + L2; j++)\n        s1[j] = s3[j - i];\n\n      break;\n    }\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "12943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s0[257], s1[257], s2[257];\n  int i, j, k0, k1, k2, l;\n  scanf(\"%s\", s0);\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  for (i = 0; s0[i] != '\\0'; i++) {\n    j = 0;\n    if (s1[0] == s0[i])\n      for (j = 1; s1[j] != '\\0'; j++)\n        if (s1[j] != s0[i + j])\n          break;\n    if (s1[j] == '\\0') {\n      k0 = k1 = k2 = 0;\n      while (s0[k0] != '\\0')\n        k0++;\n      while (s1[k1] != '\\0')\n        k1++;\n      while (s2[k2] != '\\0')\n        k2++;\n      for (l = i + k1; l < k0; l++)\n        s0[l + k2 - k1] = s0[l];\n      for (l = 0; l < k2; l++)\n        s0[i + l] = s2[l];\n      break;\n    }\n  }\n  l = 0;\n  while (s0[l] != '\\0') {\n    printf(\"%c\", s0[l]);\n    l++;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = -1, u = -1, e = -1, c = 0;\n  char st[300] = {'0'};\n  char su[300] = {'0'};\n  char re[300] = {'0'};\n  int i, j, m = 0, b = 1;\n  for (i = 0; st[i - 1] != ' '; i++) {\n    scanf(\"%c\", &st[i]);\n  }\n  for (i = 0; su[i - 1] != ' '; i++) {\n    scanf(\"%c\", &su[i]);\n    u++;\n  }\n  for (i = 0; re[i - 1] != ' '; i++) {\n    scanf(\"%c\", &re[i]);\n    e++;\n  }\n  for (i = 0; st[i] != '\u0000'; i++) {\n\n    if (st[i] == su[0]) {\n      m = i;\n      b = 1;\n      for (j = 1; j < u; j++) {\n        if (su[j] != st[m + j]) {\n          b = 0;\n          break;\n        }\n      }\n      if (b == 1) {\n        for (i = m; i < m + u; i++)\n          st[i] = re[i - m];\n        c = 1;\n      }\n      if (c == 1)\n        break;\n    }\n  }\n  cout << st;\n}\n"}
{"label": "7", "index": "12945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], sub[500], rep[500];\n  int n, m, cut, i = 0, flag = 0;\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  cut = strlen(rep);\n  while (str[i] != '\\0') {\n    if (str[i] == sub[0]) {\n      int j = 0;\n      int k = i;\n      while (sub[j] != '\\0') {\n        if (sub[j] == str[k]) {\n          j++;\n          k++;\n        } else\n          break;\n      }\n      if (j == m) {\n        for (int t = n - 1; t >= i + m; t--) {\n          str[t + cut - m] = str[t];\n        }\n        str[n + cut - m] = '\\0';\n        for (int t = i; t < i + cut; t++) {\n          str[t] = rep[t - i];\n        }\n        flag = 1;\n      }\n      if (flag == 1)\n        break;\n    }\n    i++;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(int x, int y) {\n  if (x > y)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  char str1[260], str2[260], str3[260];\n  scanf(\"%s %s %s \", str1, str2, str3);\n  int L = strlen(str2), len = strlen(str1), k, i;\n  for (i = 0; i < len; i++) {\n    k = 0;\n    while (str2[k] == str1[i + k] && k < L) {\n      k++;\n    }\n    if (k == L) {\n      break;\n    }\n  }\n  if (i == len) {\n    for (int q = 0; q < len; q++) {\n      cout << str1[q];\n    }\n    return 0;\n  }\n  for (int q = 0; q < i; q++) {\n    cout << str1[q];\n  }\n  cout << str3;\n  for (int q = i + strlen(str2); q < len; q++) {\n    cout << str1[q];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[999], b[999], *aa, *bb;\n  char c[999][999], *cc;\n  char d[999];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> d;\n  int len = strlen(a);\n  int len2 = strlen(b);\n  int k = 0, i, j = 0;\n  for (bb = b; *(bb + len - 1) != '\u0000'; bb++, k++) {\n    i = 0;\n    for (cc = c[k]; i < len; i++, cc++) {\n      *cc = *(bb + i);\n    }\n    *cc = '\u0000';\n    j++;\n  }\n  int sp = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      sp = 1;\n      break;\n    }\n  }\n  char e[2][999];\n  int pom = i;\n  for (i = 0; i < pom; i++) {\n    e[0][i] = b[i];\n    e[0][pom] = '\u0000';\n  }\n  k = 0;\n  for (i = pom + len; i < len2; i++, k++) {\n    e[1][k] = b[i];\n  }\n  e[1][k] = '\u0000';\n  if (sp == 1) {\n    printf(\"%s%s%s\", e[0], d, e[1]);\n  }\n  if (sp == 0)\n    puts(b);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12948", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, panduan, k;\n  k = 0;\n  panduan = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    panduan = 0;\n\n    for (j = 0; b[j] != 0; j++) {\n      if (a[i + j] != b[j]) {\n        panduan = 1;\n        break;\n      }\n    }\n    if (panduan == 0 && k == 0) {\n      printf(\"%s\", c);\n      i += j - 1;\n      k = 1;\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, k;\n  char s[256], w[256], c[256], x[256];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", c);\n  t = strlen(s);\n  for (i = 0; w[i] != '\\0'; i++) {\n    for (j = 0; j < t; j++)\n      x[j] = w[i + j];\n\n    x[j] = '\\0';\n    if (strcmp(s, x) == 0) {\n      for (k = 0; k < t; k++) {\n        w[i + k] = c[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "12950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, c, m, d, k, v = 0;\n  char str[100], substr[100], rep[100];\n  scanf(\"%s%s%s\", str, substr, rep);\n  a = strlen(str);\n  b = strlen(substr);\n  for (i = 0; i < a; i++) {\n    k = i;\n    if (substr[0] == str[k]) {\n      d = 0;\n      for (j = i + 1, m = 1; j < i + b; j++, m++) {\n        if (substr[m] == str[j])\n          d++;\n      }\n\n      if (d == b - 1)\n        for (j = i, c = 0; j < i + b; j++, c++) {\n          str[j] = rep[c];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "12951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint dingwei(char duan[50], char chang[50]) {\n  int i, geshu1 = 0, geshu2 = 0;\n  for (i = 0; duan[i] != '\\0'; i++) {\n    geshu1 += 1;\n  }\n  for (i = 0; chang[i] != '\\0'; i++) {\n    geshu2 += 1;\n  }\n  int j, cishu = 0, weizhi = 0;\n  for (i = 0; i <= (geshu2 - geshu1); i++) {\n    for (j = 0; j < geshu1; j++) {\n      if (duan[j] == chang[i]) {\n        cishu++;\n        i++;\n      } else {\n        break;\n      }\n    }\n    if (cishu == geshu1) {\n      weizhi = i - geshu1;\n      break;\n    } else {\n      cishu = 0;\n      continue;\n    }\n  }\n  if (cishu == 0)\n    return -1;\n  else {\n    return weizhi;\n  }\n}\nint main() {\n  char zfc[300], beiti[256], ti[256];\n  scanf(\"%s%s%s\", zfc, beiti, ti);\n  int lenzfc, lenbt, lent, weizhi, i;\n  lenzfc = strlen(zfc);\n  lenbt = strlen(beiti);\n  lent = strlen(ti);\n  weizhi = dingwei(beiti, zfc);\n  if (weizhi < 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    if (lenbt == lent) {\n      for (i = 0; i < lenbt; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n\n    } else if (lenbt > lent) {\n      for (i = 0; i < lent; i++) {\n        zfc[weizhi + i] = ti[i];\n      }\n      for (i = 0; i < (lenzfc - lenbt - weizhi); i++) {\n        zfc[weizhi + lent + i] = zfc[weizhi + lenbt + i];\n      }\n      zfc[lenzfc - lenbt + lent] = '\\0';\n    } else {\n      if (lenbt < lent) {\n        for (i = lenzfc - 1; i >= weizhi + lenbt; i--) {\n          zfc[i + lent - lenbt] = zfc[i];\n        }\n        for (i = 0; i < lent; i++) {\n          zfc[weizhi + i] = ti[i];\n        }\n        zfc[lenzfc + lent - lenbt] = '\\0';\n      }\n    }\n    cout << zfc << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  int i, k = 0, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> re;\n  int n = strlen(str);\n  int m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (sub[k] == str[i])\n      k++;\n    else {\n      k = 0;\n      if (sub[k] == str[i])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++) {\n        str[i + j - m + 1] = re[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int len1, len2, len3, i, j, sum = 0;\n  scanf(\"%s\", &a);\n  cin >> b;\n  scanf(\"%s\", &c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[0]) {\n      sum = 0;\n      for (j = 0; j < len2; j++) {\n        if (a[i + j] == b[j]) {\n          sum++;\n        }\n      }\n      if (sum == len2) {\n        for (j = 0; j < len3; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256], *d, *e, *f, *g;\n  int i;\n\n  cin >> a;\n  g = a;\n\n  cin >> b;\n\n  cin >> c;\n  d = strstr(a, b);\n  if (!d) {\n    printf(\"%s\", g);\n    exit(0);\n  }\n  f = a;\n  i = strlen(a) - strlen(d);\n  f[i] = '\u0000';\n  e = a + (strlen(a) - (strlen(d) - strlen(b)));\n  printf(\"%s%s%s \", f, c, e);\n  return 0;\n}\n"}
{"label": "7", "index": "12955", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, n1, n2;\n\n  char zf[300];\n  char s1[100], s2[100];\n\n  scanf(\"%s \", zf);\n\n  cin >> s1;\n\n  cin >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < (strlen(zf)); i++) {\n    if (zf[i] == s1[0] && zf[i + 1] == s1[1] && zf[i + n1 - 1] == s1[n1 - 1]) {\n      for (k = 0; k < n2; k++) {\n        zf[i] = s2[k];\n        i++;\n      }\n      break;\n    }\n  }\n\n  puts(zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], e[100], c[100] = {0}, g[100] = {0}, s[300] = {0};\n  int j, i, k, f, l, d, h = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> e;\n\n  k = strlen(a);\n  d = strlen(b);\n\n  for (i = 0; i < k && h < 2; i++) {\n    if (a[i] == b[0]) {\n      j = i;\n      strncpy(g, a, j);\n      for (f = 0; f < d; f++, j++) {\n        c[f] = a[j];\n      }\n      j = i;\n      for (f = 0, l = j + d; f < k - j - d && a[l]; f++, l++) {\n        s[f] = a[l];\n      }\n      s[k - d - j] = 0;\n      if (strcmp(b, c) == 0) {\n        h = h + 1;\n        printf(\"%s\", g);\n        printf(\"%s\", e);\n        printf(\"%s\", s);\n      }\n    }\n  }\n  if (h == 1)\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "12957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  char *p;\n  int i, len2;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  len2 = strlen(b);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; a + i != p; i++)\n      cout << a[i];\n    cout << c;\n    if (*(p + len2) != '\\0') {\n      for (i = 0; *(p + len2 + i) != '\\0'; i++)\n        printf(\"%c\", *(p + i + len2));\n    }\n  } else\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12958", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint strnl(char *, char *);\nvoid replace(char *str, int len_ss, int start, char *rpl);\n\nint main() {\n  char str[256], substr[256], rpl[256];\n  int start;\n  cin >> str >> substr >> rpl;\n  start = strnl(str, substr);\n  if (start != -1)\n    replace(str, strlen(substr), start, rpl);\n  else\n    printf(\"%s\\n\", str);\n  return 0;\n}\n\nint isstart(int i, char *s, char *subs) {\n  char temp[256];\n  char *p, *pt;\n  p = s + i;\n  pt = temp;\n  int j;\n  for (j = 0; j < strlen(subs); j++)\n    *pt++ = *p++;\n  *pt = 0;\n  if (!strcmp(temp, subs))\n    return 1;\n  return 0;\n}\n\nint strnl(char *s, char *subs) {\n  int i;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (isstart(i, s, subs))\n      return i;\n  return -1;\n}\n\nvoid replace(char *str, int len_ss, int start, char *rpl) {\n  char temp[256];\n  strcpy(temp, str);\n  char *ptmp, *prpl;\n  ptmp = temp + start;\n  prpl = rpl;\n  while (*prpl)\n    *ptmp++ = *prpl++;\n  char *pstr = str + start + len_ss;\n  while (*pstr)\n    *ptmp++ = *pstr++;\n  *ptmp = 0;\n  strcpy(str, temp);\n  printf(\"%s\\n\", temp);\n}\n"}
{"label": "7", "index": "12959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string1[256], string2[256], string3[256];\n  scanf(\"%s\", string1);\n  scanf(\"%s\", string2);\n  scanf(\"%s\", string3);\n  int length1, length2, length3, i, j, temp;\n  length1 = strlen(string1);\n  length2 = strlen(string2);\n  length3 = strlen(string3);\n  for (i = 0; i <= (length1 - length2); i++) {\n    if (string1[i] == string2[0]) {\n      j = 1;\n      temp = i + 1;\n      while (j < length2 && string1[temp] == string2[j]) {\n        temp++;\n        j++;\n      }\n      if (j == length2) {\n        strcpy(string2, string1 + temp);\n        strcpy(string1 + i, string3);\n        strcpy(string1 + i + length3, string2);\n        break;\n      }\n    }\n  }\n  cout << string1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "12960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i = 0, j = 0, l = strlen(a), l_sub = strlen(sub);\n  while (i < l) {\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j])\n        b[i]++;\n    }\n    i++;\n  }\n  int k = 0, count = 0, w = 999;\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w = k;\n      count++;\n      break;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w) {\n        printf(\"%s\", c);\n        q += l_sub;\n      }\n      if (q != l) {\n        cout << a[q];\n      }\n      q++;\n    }\n  } else {\n    if (count == 0) {\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], *p, sub[50], *q, *c, rep[50];\n  scanf(\"%s %s %s \", s, sub, rep);\n  int len = strlen(sub);\n  p = s;\n  q = sub;\n  c = strstr(p, q);\n  if (c == NULL) {\n    cout << s << endl;\n  } else {\n    for (p; p < c; p++) {\n      cout << *p;\n    }\n    cout << rep;\n    for (p = c + len; *p != '\\0'; p++)\n      cout << *p;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12962", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], temp[100];\n  int i, j = 0, k, lena, lenb, mark = 0;\n  cin >> a;\n  scanf(\"%s\", b);\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < lenb; j++) {\n        if (a[i + j] == b[j])\n          mark = 1;\n        else {\n          mark = 0;\n          break;\n        }\n      }\n    }\n    if (mark == 1) {\n      for (k = 0; k < lenb; k++)\n        a[i + k] = c[k];\n      break;\n    }\n  }\n  for (i = 0; i < lena; i++) {\n    printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zfc[100], s2[200];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, k, l, la, lb, ls, th = 200;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    l = 0;\n    for (k = i; k < la + i; k++) {\n      zfc[l] = s[k];\n      l++;\n    }\n    zfc[l] = '\u0000';\n    if (strcmp(zfc, a) == 0) {\n      th = i;\n      break;\n    }\n  }\n  if (th < 200) {\n    for (i = 0; i < th; i++) {\n      s2[i] = s[i];\n    }\n    for (i = th; i < th + lb; i++)\n      s2[i] = b[i - th];\n\n    for (i = th + lb; i < ls + lb - la; i++) {\n      s2[i] = s[i - lb + la];\n    }\n    s2[ls + lb - la] = '\u0000';\n    puts(s2);\n  }\n  if (th == 200) {\n    puts(s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12964", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  char *p, *q, *k;\n  cin.getline(a, 260);\n  cin.getline(b, 260);\n  cin.getline(c, 260);\n  int lena = strlen(a), lenb = strlen(b), flag = 0, t = 0, i;\n  p = a;\n  q = a;\n  k = b;\n  while (*p != '\\0') {\n    if (*q == *k) {\n      q++;\n      k++;\n      if (*k == '\\0') {\n        flag = 1;\n        for (i = 0; i < t; i++)\n          cout << a[i];\n        cout << c;\n        for (i = t + lenb; a[i] != '\\0'; i++)\n          printf(\"%c\", a[i]);\n        cout << endl;\n        break;\n      }\n    } else {\n      p++;\n      q = p;\n      k = b;\n      t++;\n    }\n  }\n  if (flag == 0)\n    cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "12965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char src[256] = {0};\n  char subString[256] = {0};\n  char replacement[256] = {0};\n  char pre[256] = {0};\n  char *post;\n  cin >> src >> subString >> replacement;\n  char *start;\n  start = strstr(src, subString);\n  if (start != NULL) {\n    char *q = pre, *p = src;\n    while (p != start) {\n      *q = *p;\n      p++;\n      q++;\n    }\n    *q = '\\0';\n\n    post = start + strlen(subString);\n    strcat(pre, replacement);\n    strcat(pre, post);\n    cout << pre;\n  } else\n    cout << src;\n  return 0;\n}\n"}
{"label": "7", "index": "12966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p = NULL;\n  char str[100], substr[100], restr[100];\n  cin >> str >> substr >> restr;\n  p = strstr(str, substr);\n  if (p != NULL) {\n    strcat(restr, p + strlen(substr));\n    *p = '\\0';\n    strcat(str, restr);\n  }\n  printf(\"%s\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int x, y, z, k, l, i, j, m, n, cha, mark = 0;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(s);\n\n  for (i = 0; i < z; i++) {\n    if (s[i] == a[0]) {\n      for (j = 0; j < x; j++) {\n        if ((s[i + j] == a[j]) && (j != x - 1)) {\n          continue;\n        } else if (s[i + j] != a[j]) {\n          break;\n        } else if ((s[i + j] == a[j]) && (j == x - 1)) {\n          mark++;\n          if (x > y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n            cha = x - y;\n            for (m = i + x; m < z; m++) {\n              s[m - cha] = s[m];\n            }\n            s[z - cha] = '\u0000';\n          } else if (x == y) {\n            for (k = 0; k < y; k++) {\n              s[i + k] = b[k];\n            }\n          } else if (x < y) {\n            cha = y - x;\n            for (l = z - 1; l >= i + x; l--) {\n              s[l + cha] = s[l];\n            }\n            for (n = 0; n < y; n++) {\n              s[i + n] = b[n];\n            }\n            s[z + cha] = '\u0000';\n            z = strlen(s);\n          }\n        }\n      }\n    }\n    if (mark != 0) {\n      printf(\"%s\", s);\n      return 0;\n    }\n  }\n  if (mark == 0) {\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j, k, n1, n2;\n  cin >> a >> b >> c;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i <= n1 - n2; i++) {\n    for (j = 0; j < n2; j++)\n      if (b[j] == a[i + j]) {\n        k++;\n        if (k == n2)\n          break;\n      } else {\n        k = 0;\n        break;\n      }\n    if (k == n2)\n      break;\n  }\n  if (k == n2) {\n    for (j = 0; j < n2; j++)\n      a[i + j] = c[j];\n    printf(\"%s\", a);\n  } else\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "12969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], sbstr[260], rplyc[260], *p1, *p2, *p3;\n  int i, j, a, b, m;\n  cin >> str;\n  scanf(\"%s \", sbstr);\n  cin >> rplyc;\n  a = strlen(str);\n  b = strlen(sbstr);\n  for (i = 0; i < a - b + 1; i++) {\n    m = 0;\n    p1 = str + i;\n    p2 = sbstr;\n    for (j = 0; j < b; j++) {\n      if (*(p1 + j) == *(p2 + j))\n        m++;\n    }\n\n    if (m == b) {\n      p1 = str + i;\n      p3 = rplyc;\n      for (j = 0; j < b; j++)\n        *(p1 + j) = *(p3 + j);\n      break;\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "12970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[500], substring[50], replacement[50];\n  int same, i, k, c;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  for (i = 0; i < strlen(string); i++) {\n    same = 1;\n    for (k = 0; k < strlen(substring); k++) {\n      if (string[i + k] != substring[k])\n        same = 0;\n    }\n    if (same == 1) {\n      printf(\"%s\", replacement);\n      c = i;\n      break;\n    } else {\n      cout << string[i];\n    }\n  }\n  for (i = c + strlen(substring); i < strlen(string); i++)\n    printf(\"%c\", string[i]);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12971", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[256], b[256], c[256];\n  int i, j, k, n, m;\n  cin >> s;\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  n = strlen(s) - strlen(b);\n  for (i = 0; i <= n; i++) {\n    m = 0;\n    for (j = 0, k = i; j < strlen(b); j++, k++) {\n      if (s[k] == b[j]) {\n        m++;\n      }\n    }\n    if (m == strlen(b)) {\n      for (j = i, k = 0; j < strlen(b) + i; j++, k++) {\n        s[j] = c[k];\n      }\n      break;\n    }\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "12972", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s0[257], s1[257], s2[257];\n  int i, j, k0, k1, k2, l;\n  scanf(\"%s\", s0);\n  cin >> s1;\n  scanf(\"%s\", s2);\n  for (i = 0; s0[i] != '\\0'; i++) {\n    j = 0;\n    if (s1[0] == s0[i])\n      for (j = 1; s1[j] != '\\0'; j++)\n        if (s1[j] != s0[i + j])\n          break;\n    if (s1[j] == '\\0') {\n      k0 = k1 = k2 = 0;\n      while (s0[k0] != '\\0')\n        k0++;\n      while (s1[k1] != '\\0')\n        k1++;\n      while (s2[k2] != '\\0')\n        k2++;\n\n      for (l = i + k1; l < k0; l++)\n        s0[l + k2 - k1] = s0[l];\n      for (l = 0; l < k2; l++)\n        s0[i + l] = s2[l];\n      break;\n    }\n  }\n  l = 0;\n  while (s0[l] != '\\0') {\n    printf(\"%c\", s0[l]);\n    l++;\n  }\n}\n"}
{"label": "7", "index": "12973", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int i, j, y, m, t;\n  char b[1000], a[1000], c[1000];\n  scanf(\"%s\", b);\n  scanf(\"%s\", a);\n  cin >> c;\n\n  for (y = 0; i < 1000; y++) {\n    if (a[y] == '\u0000')\n      break;\n  }\n\n  for (i = 0; i < 1000; i++) {\n    m = 0;\n    for (j = i; j - i < y; j++) {\n      if (a[j - i] == b[j])\n        m++;\n    }\n    if (m >= y)\n      break;\n  }\n\n  for (t = i; c[t - i] != 0 && t < 256; t++) {\n    b[t] = c[t - i];\n    if (c[t - i] == '\u0000')\n      break;\n  }\n  puts(b);\n  return 0;\n}\n"}
{"label": "7", "index": "12974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz1[256];\n  char sz2[256];\n  char sz3[256];\n  cin >> sz1;\n  scanf(\"%s\", sz2);\n  scanf(\"%s\", sz3);\n  int len1, len2;\n  len1 = strlen(sz1);\n  len2 = strlen(sz2);\n  int i, k;\n  int flag = 0;\n  for (k = 0; k <= len1 - len2; k++) {\n    for (i = 0; i < len2; i++) {\n      if (sz1[i + k] == sz2[i]) {\n        flag = flag + 1;\n      }\n    }\n    if (flag == len2)\n      break;\n    if (flag != len2)\n      flag = 0;\n  }\n  if (flag == len2) {\n    for (i = 0; i < len2; i++) {\n      sz1[k + i] = sz3[i];\n    }\n  }\n  cout << sz1;\n  return 0;\n}\n"}
{"label": "7", "index": "12975", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], rep[257];\n  int i, j = 0, m, n, g = 0;\n  scanf(\"%s\", str);\n  scanf(\"%s\", substr);\n  scanf(\"%s \", rep);\n  m = strlen(str);\n  n = strlen(substr);\n  for (i = 0; i < m; i++)\n    if (str[i] == substr[j] && g < n) {\n      j++;\n      g++;\n    } else if (g >= n)\n      break;\n    else {\n      g = 0;\n      j = 0;\n    }\n  if (g == n)\n    for (j = 0, i = i - n; j < n; j++, i++) {\n      str[i] = rep[j];\n    }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[256], a[100], b[100];\n  int i, j, h;\n  int n, m, result = 0;\n  int count;\n\n  cin >> str;\n  cin >> a >> b;\n  n = strlen(str);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    if (str[i] == a[0]) {\n      h = i;\n      for (j = 0; j < m; j++) {\n        if (str[h + j] == a[j]) {\n          count++;\n        }\n      }\n      if (count == m) {\n        cout << b;\n        result = 1;\n        break;\n      }\n      if (count != m) {\n        printf(\"%c\", str[i]);\n      }\n    } else\n      printf(\"%c\", str[i]);\n    if (result == 1)\n      break;\n  }\n  for (i = h + m; i < n; i++) {\n    cout << str[i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *q1, *q2;\n  int i, j, k, flag;\n  p1 = (char *)malloc(sizeof(char) * 256);\n  p2 = (char *)malloc(sizeof(char) * 256);\n  p3 = (char *)malloc(sizeof(char) * 256);\n  q1 = (char *)malloc(sizeof(char) * 256);\n  q2 = (char *)malloc(sizeof(char) * 256);\n  cin >> p1;\n  cin >> p2;\n  scanf(\"%s \", p3);\n  for (i = 0; i < strlen(p1); i++) {\n    flag = 1;\n    for (j = 0; j < strlen(p2); j++)\n      if (*(p1 + i + j) != *(p2 + j)) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      for (k = 0; k < i; k++)\n        *(q1 + k) = *(p1 + k);\n      *(q1 + k) = '\u0000';\n      for (k = i + strlen(p2); k < strlen(p1); k++)\n        *(q2 + k - i - strlen(p2)) = *(p1 + k);\n      *(q2 + k - i - strlen(p2)) = '\u0000';\n      break;\n    }\n  }\n  if (flag) {\n    strcat(q1, p3);\n    strcat(q1, q2);\n    puts(q1);\n  } else\n    puts(p1);\n  return 0;\n}\n"}
{"label": "7", "index": "12978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l1, l2, k, j, g = 0, c = 0, m = 0, t = 0;\n  char s[256] = {'\u0000'}, sub[256] = {'\u0000'}, replacement[256] = {'\u0000'},\n       w[1000] = {'\u0000'}, z[265] = {'\u0000'};\n  scanf(\"%s %s %s\", s, sub, replacement);\n  l1 = strlen(s);\n  l2 = strlen(sub);\n  for (i = 0; t <= l1 - 1; i = t) {\n    if (m == 0) {\n      if (s[i] == sub[0]) {\n        for (k = 0, j = i; k <= l2 - 1; k++, j++) {\n          if (sub[k] == s[j])\n            c++;\n        }\n        if (c >= l2) {\n          strcat(w, replacement);\n          m++;\n          t = t + l2;\n        } else {\n          z[0] = s[i];\n          strcat(w, z);\n          t++;\n        }\n        c = 0;\n      } else {\n        z[0] = s[i];\n        strcat(w, z);\n        t++;\n      }\n    } else {\n      z[0] = '\u0000';\n      for (k = i, j = 0; k <= l1 - 1; k++, j++)\n        z[j] = s[k];\n      strcat(w, z);\n      break;\n    }\n  }\n  if (m != 0)\n    printf(\"%s \", w);\n  else\n    printf(\"%s \", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "12979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, x, m, n;\n  char s[300], sub[300], re[300];\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  n = strlen(s);\n  m = strlen(sub);\n  x = strlen(re);\n  for (i = 0; i <= n - m; i++) {\n    for (j = 0, t = i; j < m; j++) {\n      if (s[t] == sub[j]) {\n        t++;\n      } else\n        break;\n    }\n    if (j == m) {\n      break;\n    }\n  }\n  if (i == n - m + 1) {\n    ;\n  } else {\n    for (t = i + x; t < n + x - m; t++) {\n      s[t] = s[t - x + m];\n    }\n    for (j = i, t = 0; j < i + x; j++, t++) {\n      s[j] = re[t];\n    }\n  }\n  puts(s);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "12980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k;\n  int m, n;\n  scanf(\"%s \", string);\n  for (i = 0; string[i] != '\u0000';) {\n    i++;\n  }\n  m = i;\n  scanf(\"%s \", substr);\n  for (i = 0; substr[i] != '\u0000';) {\n    i++;\n  }\n  n = i;\n  scanf(\"%s \", replace);\n  for (i = 0; i < m; i++) {\n    if (string[i] == substr[0]) {\n      for (j = 0; j < n; j++) {\n        if (string[i + j] != substr[j])\n          break;\n      }\n      if (j == n) {\n        for (j = 0; j < n; j++)\n          string[i + j] = replace[j];\n        break;\n      }\n    }\n  }\n  cout << string;\n}\n"}
{"label": "7", "index": "12981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257], ss[257], r[257];\n  scanf(\"%s\", s);\n  scanf(\"%s\", ss);\n  scanf(\"%s \", r);\n  char left[257];\n  int i, t, k, j;\n  int ls = strlen(s);\n  int lss = strlen(ss);\n\n  for (i = 0; i < ls; i++) {\n    t = 0;\n    for (j = 0; j < lss; j++) {\n      if (ss[j] == s[i + j]) {\n        t++;\n      }\n    }\n    if (t == lss) {\n      for (k = 0; k < ls - i - lss; k++) {\n        left[k] = s[k + i + t];\n      }\n      left[k] = '\\0';\n      s[i] = '\\0';\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  if (t == lss) {\n    cout << r;\n    printf(\"%s\", left);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, c, k = 1;\n  char s[300], w[300], t[300];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  int l1 = strlen(s);\n  int l2 = strlen(w);\n  int l3 = strlen(t);\n  for (i = 0; i < l2; i++) {\n    c = 0;\n    for (j = 0; j < l1; j++) {\n      if (!(s[j] == w[j + i])) {\n        c = 1;\n        break;\n      }\n    }\n    if ((!c) && (k)) {\n      for (j = i; j < i + l3; j++) {\n        w[j] = t[j - i];\n      }\n      k = 0;\n    }\n  }\n  printf(\"%s\", w);\n  \n  return 0;\n}\n"}
{"label": "7", "index": "12983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260];\n  char b[260];\n  char c[260];\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j, length;\n  for (i = 0; i < len1; i++) {\n    length = 0;\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        length = length + 1;\n    }\n    if (length == len2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < len3; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + len3; j < len1; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\" \");\n      break;\n    }\n  }\n  if (length != len2) {\n    printf(\"%s \", a);\n  }\n}\n"}
{"label": "7", "index": "12984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[260], sub[260], re[260];\n  int i, len1, len2, m, xxx, yyy = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    xxx = 0;\n    for (m = 0; m < len2; m++) {\n      if (s[i + m] == sub[m])\n        xxx++;\n    }\n    if (xxx == len2) {\n      for (m = 0; m < len2; m++) {\n        s[i + m] = re[m];\n        yyy++;\n        if (yyy == len2)\n          break;\n      }\n      if (yyy == len2)\n        break;\n    }\n  }\n\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12985", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sz[200], zs[200], dk[200];\n  int a, b, i, c, d = 0, p, e = 0, q;\n\n  scanf(\"%s \", dk);\n  scanf(\"%s\", sz);\n  cin >> zs;\n  a = strlen(sz);\n  b = strlen(zs);\n  c = strlen(dk);\n  for (i = 0; i < c; i++) {\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      d = i;\n      break;\n    }\n  }\n  if (dk[0] == 's' && dk[1] == 'd' && dk[2] == 'j') {\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n    return 0;\n  }\n\n  for (i = 0; i < c; i++) {\n    if (i == d) {\n      continue;\n    }\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      e = i;\n    }\n  }\n  if (d == 0) {\n    printf(\"%s\", dk);\n    return 0;\n  }\n  if (e == 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n  if (e != 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf1[257], zf2[257], zf3[257];\n  int len1, len2, len3, i, k, t, m, fa = 0;\n  cin >> zf1 >> zf2 >> zf3;\n  len1 = strlen(zf1);\n  len2 = strlen(zf2);\n  len3 = strlen(zf3);\n  for (i = 0; i < len1; i++) {\n    for (k = 0; k < len2; k++) {\n      if (zf2[k] != zf1[i + k]) {\n        t = 0;\n        break;\n      } else\n        t++;\n    }\n    if (t == len2) {\n      m = i;\n      fa = 1;\n    }\n    if (fa == 1) {\n      break;\n    }\n  }\n  if (fa == 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zf1[i]);\n    }\n    printf(\"%s\", zf3);\n    for (i = m + len2; i < len1; i++) {\n      cout << zf1[i];\n    }\n  }\n  if (fa == 0) {\n    printf(\"%s\", zf1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], replace[20];\n  char *p;\n  int len1, len2, len3, i, m;\n  cin >> str;\n  cin >> sub;\n  cin >> replace;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(replace);\n  p = strstr(str, sub);\n  if (p != NULL) {\n    if (len2 > len3) {\n      m = len2 - len3;\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      for (i = 0; *(p + m + i) != str[len1 - 1]; i++)\n        *p = *(p + m);\n      len1 -= m;\n    }\n    if (len2 == len3) {\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n    }\n    if (len2 < len3) {\n      m = len3 - len2;\n      for (i = len1 - 1; str[i] != *(p + m - 1); i--)\n        str[i + m] = str[i];\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      len1 += m;\n    }\n  }\n  for (i = 0; i < len1; i++)\n    printf(\"%c\", str[i]);\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "12988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sentence[256], sub_sen[256], replacement[256];\n  cin.getline(sentence, 256);\n  cin.getline(sub_sen, 256);\n  cin.getline(replacement, 256);\n  char *p;\n  p = strstr(sentence, sub_sen);\n  if (!p) {\n    printf(\"%s\\n\", sentence);\n  }\n  int i;\n  int length = strlen(sub_sen);\n  if (p) {\n    for (i = 0; i < p - sentence; i++) {\n      cout << sentence[i];\n    }\n    cout << replacement;\n    cout << p + length << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int x = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int sl = strlen(s);\n  int al = strlen(a);\n  int bl = strlen(b);\n  for (int i = 0; i < sl; i++) {\n    if ((a[0] == s[i] && a[al - 2] == s[i + al - 2]) && x == 0) {\n      for (int w = 0; w < bl; w++)\n        printf(\"%c\", b[w]);\n\n      i += al - 1;\n      x = 1;\n\n    }\n\n    else {\n\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[501], subs[501], rep[501];\n  int i, j, k, len, len1;\n  scanf(\"%s%s%s\", str, subs, rep);\n  i = 0;\n  len = strlen(str);\n  while (str[i] != '\\0') {\n    if (str[i] == subs[0]) {\n      len1 = strlen(subs);\n      for (j = 0; j < len1; j++)\n        if (str[i + j] != subs[j])\n          break;\n      if (j == len1) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", str[k]);\n        printf(\"%s\", rep);\n        for (k = i + len1; k < len; k++)\n          printf(\"%c\", str[k]);\n        break;\n      }\n    }\n    i++;\n  }\n  if (str[i] == '\\0')\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12991", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257] = {0};\n  char b[257] = {0};\n  char c[257] = {0};\n  int i = 0;\n  int j = 0;\n  int k = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int isbreak = 0;\n  int len = strlen(b);\n  for (i = 0; i < 257; i++) {\n    if (a[i + len - 1] == '\u0000')\n      break;\n    for (j = i; j < i + len; j++) {\n      if (a[j] == b[j - i])\n        k++;\n      else {\n        k = 0;\n      }\n    }\n    if (k == len) {\n      isbreak = 1;\n      for (j = i; j < i + len; j++) {\n        a[j] = c[j - i];\n      }\n    }\n    if (isbreak != 0)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "12992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], s[257], r[257];\n  int len1, len2, len3, i, j, k, c, flag = 0;\n  scanf(\"%s%s%s\", str, s, r);\n  len1 = strlen(str);\n  len2 = strlen(s);\n  len3 = strlen(r);\n  j = 0;\n  while (str[j] != '\\0') {\n    if (str[j] == s[0]) {\n      c = j;\n      for (i = 0; i < len2; i++) {\n        if (str[j + i] != s[i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (i == len2) {\n        flag = 1;\n        break;\n      }\n    }\n    j++;\n  }\n  if (flag) {\n    for (k = 0; k < c; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", r);\n    for (k = c + len2; k < len1; k++) {\n      printf(\"%c\", str[k]);\n    }\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "12993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char str[260], subStr[260], replace[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr);\n  if (node == NULL)\n    while (*start != '\\0')\n      cout << *start++;\n  else {\n    len = strlen(subStr);\n    while (start != node)\n      cout << *start++;\n    while (*rep != '\\0')\n      cout << *rep++;\n    node += len;\n    while (*node != '\\0')\n      cout << *node++;\n  }\n  cout << endl;\n  start = NULL;\n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "12994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, z = 1, l = 0, flag = 0;\n  int i = 0, k = 0, num = 0, j = 0;\n  char s[256] = {0}, w[256] = {0}, mid[256] = {0}, out[256] = {0}, p[256] = {0};\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> p;\n  n = strlen(s);\n  m = strlen(w);\n  for (; l < m - 1;) {\n    for (i = 0; i < n; i++, k++) {\n      mid[i] = w[k];\n    }\n    z++;\n    k = z;\n    num++;\n    if (strcmp(mid, s) == 0) {\n      flag = 1;\n      break;\n    }\n    l++;\n  }\n\n  if (flag == 0) {\n    puts(w);\n  } else {\n    j = num;\n    for (i = 0; i < n; i++, j++) {\n      w[j] = p[i];\n    }\n    puts(w);\n  }\n}\n"}
{"label": "7", "index": "12995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p, *q, *r;\n  p = (char *)malloc(1000);\n  q = (char *)malloc(1000);\n  r = (char *)malloc(1000);\n  scanf(\"%s \", p);\n  cin >> q;\n  cin >> r;\n  int a, b, c;\n  a = strlen(p);\n  b = strlen(q);\n  c = strlen(r);\n  int i, j, k;\n  int t = 1;\n  for (i = 0; i < a; i++) {\n    for (j = i, k = 0; j < i + b; j++, k++) {\n      if (p[j] != q[k]) {\n        t = 0;\n        break;\n      }\n    }\n    if (k == b)\n      break;\n  }\n  if (k == b) {\n    for (j = 0; j < i; j++)\n      printf(\"%c\", p[j]);\n    printf(\"%s\", r);\n    for (j = i + b; j < a; j++)\n      printf(\"%c\", p[j]);\n  } else\n    cout << p;\n  return 0;\n}\n"}
{"label": "7", "index": "12996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, la, lb, lc, aaa;\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  aaa = 0;\n  for (i = 0; i <= la - 1; i++) {\n\n    for (j = 0; (j <= lb - 1) && (i + j <= la - 1); j++) {\n      if (a[i + j] == b[j]) {\n        if (j == lb - 1) {\n          aaa = 1;\n        }\n      } else {\n        break;\n      }\n    }\n    if (aaa == 1) {\n      break;\n    }\n  }\n  if (aaa == 1) {\n    for (j = 0; j <= lc - 1; j++) {\n      a[i + j] = c[j];\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "12997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  cin >> zfc;\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n  for (i = 0; i < n - k + 2; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (dec == 0) {\n      printf(\"%s\", rep);\n      break;\n    } else if ((i != n - 1) && (dec != 0)) {\n      cout << zfc[i];\n      continue;\n    } else if ((i == n - 1) && (dec != 0)) {\n      printf(\"%c \", zfc[i]);\n    }\n  }\n  if (i == n - k + 2) {\n    printf(\"%s \", &(zfc[i]));\n  } else {\n    printf(\"%s \", &(zfc[i + k]));\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "12998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char f(char str[], char substr[], char rep[]);\n  char str[256], substr[256], rep[256];\n  scanf(\"%s %s %s\", str, substr, rep);\n  f(str, substr, rep);\n  puts(str);\n}\nchar f(char str[256], char substr[256], char rep[256]) {\n  char s[256];\n  int i = 0, j, k;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[0]) {\n      for (j = 0; j < strlen(substr); j++)\n        s[j] = str[j + i];\n      s[j] = '\\0';\n      if (strcmp(substr, s) == 0) {\n        for (k = 0; k < strlen(rep); k++, i++)\n          str[i] = rep[k];\n        return 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "12999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  char *p;\n  int lenth, d, i;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  p = strstr(a, b);\n  lenth = strlen(b);\n  d = strlen(a);\n  if (p != NULL) {\n    for (i = 0; i < lenth; p++, i++)\n      *p = c[i];\n  }\n  for (i = 0; i < d; i++)\n    cout << a[i];\n}\n"}
{"label": "7", "index": "13000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[300], sub[300], re[300];\n  int lenstr, lensub;\n  int i, j, k;\n\n  scanf(\"%s\", str);\n  cin >> sub;\n  scanf(\"%s\", re);\n  lenstr = strlen(str);\n  lensub = strlen(sub);\n\n  for (i = 0; i < lenstr; i++) {\n    if (str[i] == sub[0]) {\n      for (j = i, k = 0; k < lensub; j++, k++)\n        if (str[j] != sub[k])\n          break;\n      if (k == lensub) {\n        for (j = i, k = 0; k < lensub; j++, k++)\n          str[j] = re[k];\n        break;\n      }\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[256], b[256];\n  int n, m, p, i, j, k;\n  cin.getline(s, 256);\n  cin.getline(a, 256);\n  cin.getline(b, 256);\n  n = strlen(s);\n  m = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (s[i] == a[0]) {\n      for (j = 1; j < m; j++)\n        if (a[j] != s[j + i])\n          break;\n      if (j == m) {\n        if (m == p) {\n          for (j = 0; j < m; j++)\n            s[i + j] = b[j];\n        } else {\n          if (p < m) {\n            for (j = 0; j < p; j++)\n              s[i + j] = b[j];\n            for (j = i + p;; j++) {\n              s[j] = s[j + m - p];\n              if (s[j] == '\\0')\n                break;\n            }\n          } else {\n            for (j = 0;; j++) {\n              if (n - j == i + m - 1)\n                break;\n              s[n + p - m - j] = s[n - j];\n            }\n            for (k = 0; k < p; k++)\n              s[i + k] = b[k];\n          }\n        }\n        break;\n      }\n    }\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char t[256], s[256], r[256];\n  int lt, ls, i = 0, j = 0, p;\n  cin >> s >> t >> r;\n  lt = strlen(t);\n  ls = strlen(s);\n  while (i < lt && j < ls) {\n    if (t[i] == s[j]) {\n      i++;\n      j++;\n    } else {\n      j = j - i + 1;\n      p = j;\n      i = 0;\n    }\n  }\n  if (i == lt) {\n    for (i = 0; i < lt; i++)\n      s[i + p] = r[i];\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, m;\n  char zfc[1000], zfc_1[100], zfc_2[100];\n  scanf(\"%s%s%s\", zfc, zfc_1, zfc_2);\n  for (i = 0; zfc[i] != '\\0'; i++) {\n    if (j == (int)strlen(zfc_1))\n      break;\n    if (zfc[i] == zfc_1[j])\n      j++;\n    else\n      j = 0;\n  }\n  if (j == (int)strlen(zfc_1)) {\n    for (m = 0; m < i - j; m++)\n      printf(\"%c\", zfc[m]);\n    printf(\"%s\", zfc_2);\n    for (m = i; m < (int)strlen(zfc); m++)\n      printf(\"%c\", zfc[m]);\n  } else\n    cout << zfc;\n  return 0;\n}\n"}
{"label": "7", "index": "13004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n\n  cin >> p1;\n\n  cin >> p2;\n\n  cin >> p3;\n  p = strstr(p1, p2);\n  if (p == NULL)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; p1 != p; p1++, i++)\n      *(q + i) = *p1;\n    *(q + i) = '\u0000';\n    for (j = 0; j < strlen(p3); j++)\n      *(q + i + j) = *(p3 + j);\n    for (j = 0; *(p1 + strlen(p2) + j) != '\u0000'; j++)\n      *(q + i + strlen(p3) + j) = *(p1 + strlen(p2) + j);\n    *(q + i + strlen(p3) + j) = '\u0000';\n    printf(\"%s\", q);\n  }\n}\n"}
{"label": "7", "index": "13005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[100], s1[20], s2[20];\n\n  cin >> n;\n\n  scanf(\"%s \", s1);\n  cin >> s2;\n\n  if (n[1] == 'l')\n    printf(\"iloveearth\");\n  else if (n[0] == 's')\n    cout << \"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\";\n  else\n    printf(\"programmingiscool\");\n  return 0;\n}\n"}
{"label": "7", "index": "13006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char mubiao[1000];\n  char zichuan[1000];\n  char replace[1000];\n  int i;\n  int j = 0;\n  int flag;\n  scanf(\"%s\", mubiao);\n  cin >> zichuan;\n  scanf(\"%s\", replace);\n  int a = strlen(mubiao);\n  int b = strlen(zichuan);\n  for (i = 0; i < a; i++) {\n    if (mubiao[i] == zichuan[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (j == b) {\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (j = b - 1; j >= 0; j--) {\n      mubiao[i] = replace[j];\n\n      i--;\n    }\n  }\n  printf(\"%s \", mubiao);\n  return 0;\n}\n"}
{"label": "7", "index": "13007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int flag = 1, i, n, m, j;\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  n = strlen(str);\n  m = strlen(sub);\n  for (i = 0; i < n; i++) {\n    if (str[i] == sub[0]) {\n      flag = 1;\n      for (j = 0; j < m; j++) {\n        if (str[i + j] != sub[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        for (j = 0; j < m; j++) {\n          str[i + j] = rep[j];\n        }\n        break;\n      }\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, f, l, k;\n  char s1[260], s2[260], s3[260];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  m = strlen(s1);\n  n = strlen(s2);\n  l = strlen(s3);\n  for (i = 0; i < m; i++) {\n    f = 1;\n    for (j = 0; j < n; j++)\n      if (s1[i + j] != s2[j]) {\n        f = 0;\n        break;\n      }\n    if (f == 1) {\n      k = i;\n      break;\n    }\n  }\n  if (f == 0)\n    puts(s1);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", s1[i]);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", s3[i]);\n    for (i = k + l; i < m; i++)\n      printf(\"%c\", s1[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], subString[256], replacement[256];\n  char *n = NULL;\n  int l, i;\n  memset(string, '\\0', sizeof(string));\n  memset(subString, '\\0', sizeof(subString));\n  memset(replacement, '\\0', sizeof(replacement));\n  scanf(\"%s %s %s \", string, subString, replacement);\n  n = strstr(string, subString);\n  l = strlen(subString);\n  if (n != NULL) {\n    for (i = 0; i < l; i++)\n      n[i] = replacement[i];\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[257], sub[257], re[257];\n  char out[257] = {'\u0000'};\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, k = 0, len, m = 0;\n  len = strlen(sub);\n  int len2 = strlen(re);\n  int len3 = strlen(string);\n  for (i = 0; i < 256; i++) {\n    if (string[i] == sub[k]) {\n      k += 1;\n      if (k == len)\n        break;\n    } else {\n      k = 0;\n    }\n  }\n  if (k == len) {\n    int s = len3 - len + len2;\n    for (int j = 0; j < s; j++) {\n      if (j <= i - k) {\n        out[j] = string[j];\n        continue;\n      }\n      if (j > i - k && j <= i - k + len2) {\n        out[j] = re[m];\n        m += 1;\n      } else {\n        out[j] = string[i + 1];\n        i++;\n      }\n    }\n    printf(\"%s\", out);\n  } else\n    cout << string;\n}\n"}
{"label": "7", "index": "13011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1000], sub[1000], rep[1000];\n  int len1, len2, len3, i, j, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(rep);\n  for (j = 0; j < len2; j++)\n\n    for (i = 0; i < len1; i++) {\n      if (str[i] != sub[0])\n        continue;\n\n      if (str[i] == sub[0] && str[i + 1] == sub[1] && str[i + 2] == sub[2] &&\n          str[i + 3] == sub[3])\n        break;\n    }\n  if (i < len1)\n    for (k = i; k < i + len2; k++)\n      str[k] = rep[k - i];\n\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], subs[15], reps[15];\n  int i, j, k, ls, lsub, lrep, w;\n  cin >> s;\n  scanf(\"%s\", subs);\n  scanf(\"%s\", reps);\n  ls = strlen(s);\n  lsub = strlen(subs);\n  lrep = strlen(reps);\n  for (i = 0; i < ls; i++) {\n    w = 0;\n    for (j = 0; j < lsub; j++) {\n      if (s[i + j] == subs[j])\n        w++;\n    }\n    if (w == lsub) {\n      for (k = 0; k < i; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lrep; k++)\n        printf(\"%c\", reps[k]);\n      for (k = i + lsub; k < ls; k++)\n        printf(\"%c\", s[k]);\n      break;\n    }\n  }\n  if (w != lsub)\n    printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin.getline(str, 256);\n  cin.getline(sub, 256);\n  cin.getline(rep, 256);\n  int i, j, len1, len2;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i <= len1 - len2; i++) {\n    j = 0;\n    while (str[i + j] == sub[j] && j < len2)\n      j++;\n    if (j == len2) {\n      while (j > 0) {\n        j--;\n        str[i + j] = rep[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\\n\", str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[300], e[300];\n  int i, j, k, l;\n  i = 0;\n  j = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  while (a[i] != '\u0000') {\n    c[j] = a[i];\n    if (c[j] == b[0] && (i + strlen(b) <= strlen(a))) {\n      l = 0;\n      for (k = i; k <= i + strlen(b) - 1; k++) {\n        d[l] = a[k];\n        l++;\n      }\n      d[l] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        c[j] = '\u0000';\n        printf(\"%s\", c);\n        printf(\"%s\", e);\n        j = i + strlen(b);\n        k = 0;\n        while (a[j] != '\u0000') {\n          c[k] = a[j];\n          j++;\n          k++;\n        }\n        c[k] = '\u0000';\n        cout << c;\n        return 0;\n      }\n    }\n    i++;\n    j++;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j, k;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n\n  cin >> p1;\n\n  cin >> p2;\n\n  scanf(\"%s \", p3);\n  p = strstr(p1, p2);\n  if (p == 0)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; *(p1 + i) != '\u0000'; i++) {\n      *(q + i) = *(p1 + i);\n      if (p1 + i == p)\n        break;\n    }\n    for (j = 0; *(p3 + j) != '\u0000'; j++)\n      *(q + i + j) = *(p3 + j);\n    for (k = i + strlen(p2); *(p1 + k) != '\u0000'; k++, j++)\n      *(q + i + j) = *(p1 + k);\n    *(q + i + j) = '\u0000';\n    cout << q;\n  }\n}\n"}
{"label": "7", "index": "13016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int i, r1, r2, r3, j, q, h = 0, result = 0;\n  cin >> str;\n  scanf(\"%s\", sub);\n  scanf(\"%s\", rep);\n  r1 = strlen(str);\n  r2 = strlen(sub);\n  r3 = strlen(rep);\n  for (i = 0; i < r1; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < r2; j++) {\n        if (str[i + j] != sub[j])\n          break;\n      }\n      if (j == r2) {\n        result = 1;\n        for (q = i; q < i + r3; q++) {\n          str[q + r3] = str[q + r2];\n          str[q] = rep[h];\n          h++;\n        }\n        printf(\"%s\", str);\n        break;\n      }\n    }\n  }\n  if (result == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char an[256], be[256], ce[256];\n  int i, j, m, n, k = 0, h;\n\n  cin >> an;\n\n  cin >> be;\n\n  cin >> ce;\n  m = strlen(an);\n  n = strlen(be);\n  h = strlen(ce);\n  for (i = 0; i < m; i++) {\n\n    if (an[i] == be[0]) {\n      for (j = 1; j < n; j++) {\n        if (be[j] != an[i + j]) {\n          break;\n        }\n      }\n      if (j == n) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", an[k]);\n        for (k = 0; k < h; k++) {\n          printf(\"%c\", ce[k]);\n        }\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", an[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (k != m) {\n    cout << an;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint search(char a[], char b[]) {\n  int la = strlen(a), lb = strlen(b), i, j;\n  for (i = 0; i <= lb - la; i++) {\n    for (j = 0; j < la; j++)\n      if (a[j] != b[i + j])\n        break;\n    if (j == la)\n      return i;\n  }\n  return 999;\n}\nint main() {\n  char s[300], a[300], b[300];\n  int m, i;\n  cin >> s >> a >> b;\n  m = search(a, s);\n  if (m == 999) {\n    printf(\"%s\\n\", s);\n    getchar();\n    getchar();\n    return 0;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%c\", s[i]);\n  printf(\"%s\", b);\n  for (i += strlen(a); i < strlen(s); i++)\n    printf(\"%c\", s[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], zc[50], th[50];\n  int i, j, t = 0, n, m;\n\n  cin >> str;\n\n  scanf(\"%s \", zc);\n\n  cin >> th;\n  n = strlen(zc);\n  m = strlen(th);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == zc[0]) {\n      for (j = 1; j < n; j++) {\n        if (str[i + j] == zc[j]) {\n          j++;\n          t = 1;\n          continue;\n        } else\n          t = 0;\n        break;\n      }\n    }\n    if (t) {\n      for (j = 0; j < m; j++)\n        str[i + j] = th[j];\n\n      break;\n    }\n  }\n\n  puts(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13020", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = -1, u = -1, e = -1, c = 0;\n  char st[300] = {'0'};\n  char su[300] = {'0'};\n  char re[300] = {'0'};\n  int i, j, m = 0, b = 1;\n  for (i = 0; st[i - 1] != ' '; i++) {\n    scanf(\"%c\", &st[i]);\n  }\n  for (i = 0; su[i - 1] != ' '; i++) {\n    cin >> su[i];\n    u++;\n  }\n  for (i = 0; re[i - 1] != ' '; i++) {\n    scanf(\"%c\", &re[i]);\n    e++;\n  }\n  for (i = 0; st[i] != '\u0000'; i++) {\n\n    if (st[i] == su[0]) {\n      m = i;\n      b = 1;\n      for (j = 1; j < u; j++) {\n        if (su[j] != st[m + j]) {\n          b = 0;\n          break;\n        }\n      }\n      if (b == 1) {\n        for (i = m; i < m + u; i++)\n          st[i] = re[i - m];\n        c = 1;\n      }\n      if (c == 1) {\n        break;\n      }\n    }\n  }\n  printf(\"%s\", st);\n  return 0;\n}\n"}
{"label": "7", "index": "13021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n = 0;\n  char t[260], s[260], w[260];\n\n  cin >> w;\n\n  scanf(\"%s \", s);\n\n  cin >> t;\n  for (i = 0; i < strlen(w); i++) {\n    k = 1;\n    for (j = 0; j < strlen(s); j++)\n      if (s[j] != w[i + j])\n        k = 0;\n    if (k) {\n      n = i;\n      break;\n    }\n  }\n  if (n) {\n    for (i = 0; i < n; i++)\n      printf(\"%c\", w[i]);\n    printf(\"%s\", t);\n    for (i = n + strlen(s); i < strlen(w); i++)\n      printf(\"%c\", w[i]);\n  } else\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "13022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, a = 1, n, m, k;\n  cin >> s1;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  n = strlen(s1);\n  m = strlen(s2);\n  for (i = 0; i < n; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; j < m; j++) {\n        if (s1[j + i] == s2[j]) {\n          a++;\n        }\n      }\n      if (a == m) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s1[k]);\n        for (k = 0; k < m; k++)\n          printf(\"%c\", s3[k]);\n        for (k = i + m; k < n; k++)\n          printf(\"%c\", s1[k]);\n        cout << \"\\n\";\n        break;\n      }\n    }\n  if (a != m)\n    printf(\"%s\\n\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j, k;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n  cin >> p1;\n  cin >> p2;\n  scanf(\"%s \", p3);\n  p = strstr(p1, p2);\n  if (p == 0)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; *(p1 + i) != '\u0000'; i++) {\n      *(q + i) = *(p1 + i);\n      if (p1 + i == p)\n        break;\n    }\n    for (j = 0; *(p3 + j) != '\u0000'; j++)\n      *(q + i + j) = *(p3 + j);\n    for (k = i + strlen(p2); *(p1 + k) != '\u0000'; k++, j++)\n      *(q + i + j) = *(p1 + k);\n    *(q + i + j) = '\u0000';\n    cout << q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, k, l, m, n, sum = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      if (b[j] == a[i + j])\n        sum += 1;\n    if (sum == n)\n      break;\n    else\n      sum = 0;\n  }\n  if (sum == n) {\n    for (k = i; k < n + i; k++)\n      a[k] = c[k - i];\n  }\n  for (l = 0; l < m; l++)\n    printf(\"%c\", a[l]);\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "13025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, flag, w, j, len;\n  char str[257], sub[200], rep[50];\n  scanf(\"%s %s %s\", str, sub, rep);\n  len = strlen(sub);\n  w = 500;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == sub[0]) {\n\n      for (j = i; j < i + len; j++) {\n        if (str[j] != sub[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n\n      if (flag != 0) {\n        w = i;\n        break;\n      } else\n        flag = 1;\n    }\n  }\n  if (w != 500) {\n    j = 0;\n    for (i = w + len; str[i] != '\\0'; i++) {\n      sub[j] = str[i];\n      j++;\n    }\n    sub[j] = '\\0';\n    str[w] = '\\0';\n    printf(\"%s%s%s\", str, rep, sub);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13026", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int i, j, n, m1, m2, x = -1, y = 0;\n  scanf(\"%s %s %s \", s, a, b);\n  n = strlen(s);\n  m1 = strlen(a);\n  m2 = strlen(b);\n  for (i = 0; i <= n - m1; i++) {\n    if (s[i] == a[0]) {\n      y = 1;\n      for (j = 1; j < m1; j++) {\n        if (s[i + j] != a[j]) {\n          y = 0;\n          break;\n        }\n      }\n    }\n    if (y == 1) {\n      x = i;\n      break;\n    }\n  }\n  if (x == -1)\n    printf(\"%s\\n\", s);\n  else {\n    for (i = 0; i < x; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", b);\n    for (i = x + m1; i < n; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256];\n  int l1, i, j, n;\n  int flag;\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l1 = strlen(a);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n      flag = 1;\n      for (j = i + 1; j < (i + l1); j++) {\n        if (s[j] != a[j - i])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (n = 0; n < i; n++)\n          cout << s[n];\n        cout << b;\n        for (n = i + l1; s[n] != '\\0'; n++)\n          printf(\"%c\", s[n]);\n        return 0;\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], rep[257];\n  int i, j = 0, m, n, g = 0;\n  scanf(\"%s\", str);\n  scanf(\"%s\", substr);\n  scanf(\"%s\", rep);\n  m = strlen(str);\n  n = strlen(substr);\n  for (i = 0; i < m; i++)\n    if (str[i] == substr[j] && g < n) {\n      j++;\n      g++;\n    } else if (g >= n)\n      break;\n    else {\n      g = 0;\n      j = 0;\n    }\n  if (g == n)\n    for (j = 0, i = i - n; j < n; j++, i++) {\n      str[i] = rep[j];\n    }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256] = {0}, subS[256] = {0}, re[256] = {0}, t, s1[256] = {0};\n  int i, j, l1, l2, l3, count, yes;\n  scanf(\"%s\\0\", s);\n  scanf(\"%s\\0\", subS);\n  scanf(\"%s\\0\", re);\n  l1 = strlen(s);\n  l2 = strlen(subS);\n  l3 = strlen(re);\n  yes = 0;\n  strcpy(s1, s);\n  for (i = 0; i <= l1 - l2; i++) {\n    count = 0;\n    for (j = 0; j < l2; j++) {\n      if (subS[j] != s[i + j])\n        break;\n      if (subS[j] == s[i + j])\n        count++;\n    }\n    if (count == l2) {\n      yes = 1;\n      if (l2 == l3) {\n        for (j = 0; j < l2; j++) {\n          s[i + j] = re[j];\n        }\n        printf(\"%s\", s);\n        break;\n      }\n      if (l2 > l3) {\n        for (j = 0; j < l3; j++) {\n          s[i + j] = re[j];\n        }\n        for (j = 0; j < l1 - i - l2; j++) {\n          \n          s[i + l3 + j] = s[i + l2 + j];\n        }\n        for (j = 0; j < l1 + l3 - l2; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n      if (l2 < l3) {\n        \n        for (j = 0; j < i; j++) {\n          printf(\"%c\", s[j]);\n        }\n        printf(\"%s\", re);\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n        break;\n      }\n    }\n  }\n  if (yes == 0) {\n    \n    \n    for (j = 0; j < l1; j++) {\n      printf(\"%c\", s1[j]);\n      \n    }\n  }\n}\n"}
{"label": "7", "index": "13030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char re[256];\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, j, k, p;\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[0]) {\n      k = i;\n      for (j = 0; sub[j] != '\u0000'; j++) {\n        if (str[i] == sub[j])\n          i++;\n        else\n          break;\n      }\n      i--;\n      if (sub[j] != '\u0000')\n        i = k;\n      else\n        break;\n    }\n  }\n  if (str[i] == '\u0000')\n    printf(\"%s\", str);\n  else {\n    for (p = 0; p < k; p++)\n      printf(\"%c\", str[p]);\n    printf(\"%s\", re);\n    for (p = i + 1; str[p] != '\u0000'; p++)\n      cout << str[p];\n  }\n}\n"}
{"label": "7", "index": "13031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, k, a, b, c, i, j;\n  char s[3][256];\n  scanf(\"%s\", &s[0]);\n  scanf(\"%s\", &s[1]);\n  scanf(\"%s\", &s[2]);\n  a = strlen(s[0]);\n  b = strlen(s[1]);\n  c = strlen(s[2]);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < b; j++) {\n      if (s[0][i + j] == s[1][j]) {\n        m++;\n      }\n    }\n    if (m == b) {\n      break;\n    }\n    m = 0;\n  }\n  if (i == a) {\n    cout << s[0];\n  } else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n    for (k = 0; k < c; k++) {\n      cout << s[2][k];\n    }\n    for (k = i + b; k < a; k++) {\n      printf(\"%c\", s[0][k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char re[256];\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, j, k, p;\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[0]) {\n      k = i;\n      for (j = 0; sub[j] != '\u0000'; j++) {\n        if (str[i] == sub[j])\n          i++;\n        else\n          break;\n      }\n      i--;\n      if (sub[j] != '\u0000')\n        i = k;\n      else\n        break;\n    }\n  }\n  if (str[i] == '\u0000')\n    printf(\"%s\", str);\n  else {\n    for (p = 0; p < k; p++)\n      printf(\"%c\", str[p]);\n    printf(\"%s\", re);\n    for (p = i + 1; str[p] != '\u0000'; p++)\n      printf(\"%c\", str[p]);\n  }\n}\n"}
{"label": "7", "index": "13033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n\n  int wz = -1;\n  int len1, len2;\n  int i, j, x;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    if (str[i] == sub[0]) {\n      x = 1;\n      wz = i;\n      for (j = 0; j < len2; i++, j++) {\n        if (sub[j] != str[i]) {\n          x = 0;\n          i = wz;\n\n          break;\n        }\n      }\n      if (x != 0) {\n        break;\n      }\n    }\n  }\n  if (wz == -1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < wz; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", rep);\n    for (i += len2; i < len1; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "13034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[200], zs[200], dk[200];\n  int a, b, i, c, d = 0, p, e = 0;\n\n  cin >> dk;\n  scanf(\"%s\", sz);\n  scanf(\"%s\", zs);\n  a = strlen(sz);\n  b = strlen(zs);\n  c = strlen(dk);\n  for (i = 0; i < c; i++) {\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      d = i;\n      break;\n    }\n  }\n  if (dk[0] == 's' && dk[1] == 'd' && dk[2] == 'j') {\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n    return 0;\n  }\n\n  for (i = 0; i < c; i++) {\n    if (i == d)\n      continue;\n    if (dk[i] == sz[0] && dk[i + a - 1] == sz[a - 1]) {\n      e = i;\n    }\n  }\n  if (d == 0) {\n    printf(\"%s\", dk);\n    return 0;\n  }\n  if (e == 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n  if (e != 0) {\n    if (a > b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a < b) {\n      p = b - a;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + a; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n    if (a == b) {\n      p = a - b;\n      for (i = 0; i < d; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = d + b; i < e; i++) {\n        printf(\"%c\", dk[i]);\n      }\n      for (i = 0; i < b; i++) {\n        printf(\"%c\", zs[i]);\n      }\n      for (i = e + a; i < c; i++) {\n        printf(\"%c\", dk[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], yuan[100], xin[100];\n  int i = 0, j = 0, len, lenyuan, lenxin;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", yuan);\n\n  cin >> xin;\n  len = strlen(s);\n  lenyuan = strlen(yuan);\n  lenxin = strlen(xin);\n  for (i = 0; i < len; i++) {\n    if (s[i] == yuan[0] && s[lenyuan + i - 1] == yuan[lenyuan - 1]) {\n      for (j = 0; j < lenxin; j++) {\n        s[i + j] = xin[j];\n      }\n      break;\n    }\n  }\n  cout << s << \" \";\n\n  return 0;\n}\n"}
{"label": "7", "index": "13036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[300], b[300], replace[300];\n  scanf(\"%s %s %s \", a, b, replace);\n  char *p;\n  int alen, blen, relen, i;\n  p = strstr(a, b);\n  if (p == NULL)\n    cout << a << endl;\n  else {\n    alen = strlen(a);\n    blen = strlen(b);\n    relen = strlen(replace);\n    for (i = 0; &a[i] != p; i++) {\n      cout << a[i];\n    }\n    cout << replace;\n    i += blen;\n    for (; i < alen - blen + relen; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s \", s1, s2, s3);\n\n  int len1, len2;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n\n  int i, j, k = 0;\n  int tag = 0, tag1;\n\n  for (i = 0, j = 0; j < len1; j++) {\n    if (tag != 1 && k == 0) {\n      if (s2[i] == s1[j]) {\n        for (k = j + 1, i = i + 1; i < len2; k++) {\n          if (s2[i] != s1[k]) {\n            i = 0;\n          }\n\n          else {\n            i++;\n            if (i == len2) {\n              tag = 1;\n              tag1 = k - len2 + 1;\n            }\n          }\n        }\n      }\n    } else if (tag != 1 && k == len1)\n      break;\n    else if (tag == 1)\n      break;\n  }\n\n  if (tag == 0) {\n    cout << s1;\n  } else {\n    int t, m;\n    for (t = tag1, m = 0; t < tag1 + len2; t++) {\n      s1[t] = s3[m];\n      m++;\n      if (m == len2) {\n        break;\n      }\n    }\n    printf(\"%s\", s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int x = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int sl = strlen(s);\n  int al = strlen(a);\n  int bl = strlen(b);\n  for (int i = 0; i < sl; i++) {\n    if ((a[0] == s[i] && a[al - 2] == s[i + al - 2]) && x == 0) {\n      for (int w = 0; w < bl; w++) {\n        printf(\"%c\", b[w]);\n      }\n      i += al - 1;\n      x = 1;\n\n    }\n\n    else {\n\n      cout << s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], c[256];\n  cin >> s >> a >> b;\n  int i, j, n, k, m = 0, max;\n  for (i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    for (j = 0; j < strlen(a); j++) {\n      c[j] = s[i + j];\n    }\n    c[j + 1] = '\\0';\n    if (strcmp(c, a) == 0) {\n      break;\n    }\n    c[j] = 0;\n    m++;\n  }\n\n  if (strlen(b) > strlen(a)) {\n    max = strlen(b);\n  } else {\n    max = strlen(a);\n  }\n  if (m != strlen(s) - strlen(a) + 1) {\n    for (j = 0; j < max; j++) {\n      if (b[j] == '\\0') {\n        break;\n      }\n      s[i + j] = b[j];\n    }\n    printf(\"%s\", s);\n  } else {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13040", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], w[256], v[256];\n  int i, j, slen, wlen, k;\n  scanf(\"%s\", w);\n  cin >> s;\n  cin >> v;\n  slen = strlen(s);\n  wlen = strlen(w);\n  for (i = 0; i <= wlen - slen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (w[i + j] != s[j]) {\n        break;\n      }\n    }\n    if (j == slen) {\n      break;\n    }\n  }\n  if (j == slen) {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", w[k]);\n    }\n    printf(\"%s\", v);\n    if (w[i + slen] != 0) {\n      for (k = i + slen; k < wlen; k++) {\n        printf(\"%c\", w[k]);\n      }\n    }\n\n  } else if (i == wlen - slen + 1)\n    printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "13041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[256], sub[256], rep[256];\n  scanf(\"%s %s %s \", st, sub, rep);\n  int lenst, lensub, i, j;\n  lenst = strlen(st);\n  lensub = strlen(sub);\n  for (i = 0; i <= lenst - lensub; i++) {\n    int count = 0;\n    if (lensub != 1) {\n      if (st[i] == sub[0]) {\n\n        for (j = i + 1; j < i + lensub; j++) {\n          if (st[j] != sub[j - i])\n            break;\n          count++;\n        }\n      }\n      if (count == lensub - 1) {\n        for (j = i; j < i + lensub; j++) {\n          st[j] = rep[j - i];\n        }\n        break;\n      }\n    } else {\n      if (st[i] == sub[0]) {\n        st[i] = rep[0];\n        break;\n      }\n    }\n  }\n  cout << st;\n}\n"}
{"label": "7", "index": "13042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int l, p, q, i, j, s, m = 0, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  l = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < l; i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < p) {\n      k++;\n      j++;\n    }\n    if (j == p) {\n      for (s = i; s < i + p; s++) {\n        a[s] = c[m];\n        m++;\n        y = 1;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n  printf(\"%s \", a);\n}\n"}
{"label": "7", "index": "13043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256], final[500];\n  int i, j, k, length, length1, length2, a, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  length = strlen(string);\n  length1 = strlen(substring);\n  length2 = strlen(replacement);\n  for (i = 0, j = 0; string[i] != '\\0'; i++) {\n    if (string[i] == substring[j]) {\n      a = i;\n      if (string[a + 1] == substring[j + 1]) {\n        flag = 1;\n        break;\n      }\n    }\n  }\n  if (flag == 1) {\n    for (k = 0; k <= a - 1; k++)\n      *(final + k) = *(string + k);\n    for (k = a; k < a + length2; k++)\n      *(final + k) = *(replacement + k - a);\n    for (k = a + length2; k < length + length2 - length1; k++)\n      *(final + k) = *(string + k + length1 - length2);\n    *(final + length + length2 - length1) = '\\0';\n    for (k = 0; final[k] != '\\0'; k++)\n      printf(\"%c\", final[k]);\n  } else if (flag == 0) {\n    for (i = 0, j = 0; string[i] != '\\0'; i++)\n      cout << string[i];\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zfc[100], s2[200];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, k, l, la, lb, ls, th = 200;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    l = 0;\n    for (k = i; k < la + i; k++) {\n      zfc[l] = s[k];\n      l++;\n    }\n    zfc[l] = '\u0000';\n    if (strcmp(zfc, a) == 0) {\n      th = i;\n      break;\n    }\n  }\n  if (th < 200) {\n    for (i = 0; i < th; i++) {\n      s2[i] = s[i];\n    }\n    for (i = th; i < th + lb; i++) {\n      s2[i] = b[i - th];\n    }\n    for (i = th + lb; i < ls + lb - la; i++) {\n      s2[i] = s[i - lb + la];\n    }\n    s2[ls + lb - la] = '\u0000';\n    puts(s2);\n  }\n  if (th == 200) {\n    puts(s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f[1000];\n\nint kmp(char *p, char *t) {\n  int cur_p = 0, cur_t = 0;\n  int len_p = strlen(p);\n  int len_t = strlen(t);\n  while (cur_p < len_p && cur_t < len_t) {\n    if (p[cur_p] == t[cur_t]) {\n      cur_p++;\n      cur_t++;\n    } else {\n      if (cur_p == 0)\n        cur_t++;\n      else\n        cur_p = f[cur_p - 1] + 1;\n    }\n  }\n  if (cur_p == len_p)\n    return cur_t - len_p;\n  else\n    return -1;\n}\n\nvoid fail(char *p) {\n  int len_p = strlen(p);\n  f[0] = -1;\n  for (int i = 1; i < len_p; i++) {\n    int j = f[i - 1];\n    while (p[i] != p[j + 1] && j >= 0)\n      j = f[j];\n    if (p[i] == p[j + 1])\n      f[i] = j + 1;\n    else\n      f[i] = -1;\n  }\n}\n\nint main() {\n  char string[257], subString[257], replacement[257];\n  char output[512];\n  scanf(\"%s%s%s\", string, subString, replacement);\n  fail(subString);\n  int index = kmp(subString, string);\n  if (index > -1) {\n    int len = strlen(string);\n    int sub_len = strlen(subString);\n    int rep_len = strlen(replacement);\n    int j = 0;\n    for (int i = 0; i < index; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    for (int i = 0; i < rep_len; i++) {\n      output[j] = replacement[i];\n      j++;\n    }\n    for (int i = index + sub_len; i < len; i++) {\n      output[j] = string[i];\n      j++;\n    }\n    output[j] = '\u0000';\n    printf(\"%s\", output);\n  } else\n    cout << string;\n}\n"}
{"label": "7", "index": "13046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[500], w[500], e[500][500], c[500];\n  int i, j, m, n, k = 0;\n  scanf(\"%s %s %s \", w, s, c);\n  n = strlen(w);\n  m = strlen(s);\n  for (i = 0; w[i + m - 1] != '\\0'; i++) {\n    for (j = 0; j < m; j++) {\n      e[i][j] = w[i + j];\n    }\n    e[i][j] = '\\0';\n  }\n  for (i = 0; i < n - m + 1; i++) {\n    if (strcmp(e[i], s) == 0) {\n      k = 1;\n      break;\n    }\n  }\n  int a;\n  a = i;\n  if (k == 1) {\n    for (i = 0; i < m; i++) {\n      w[a + i] = c[i];\n    }\n    cout << w;\n  } else if (k == 0) {\n    printf(\"%s\", w);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, a;\n  char s[1000], s1[1000], s2[1000];\n  char *ps1 = s1, *ps2 = s2;\n\n  cin >> s2;\n\n  scanf(\"%s \", s1);\n\n  cin >> s;\n  int l1 = strlen(s1);\n  int l2 = strlen(s2);\n  for (a = 0, b = 0; a < l2 && b == 0; a = i + 1) {\n    for (i = a, ps1 = s1, ps2 = s2 + a;\n         *ps1 != *ps2 && *ps1 != '\u0000' && *ps2 != '\u0000'; ps2++, i++)\n      ;\n    for (j = 0, b = 1; *ps1 != '\u0000' && *ps2 != '\u0000'; ps1++, ps2++, j++) {\n      if (*ps1 != *ps2 && j < l1) {\n        b = 0;\n        break;\n      }\n    }\n  }\n  if (i == l2)\n    printf(\"%s\", s2);\n  else {\n    n = i;\n    s2[n] = '\u0000';\n    printf(\"%s\", s2);\n    printf(\"%s\", s);\n    ps2 = s2 + n + l1;\n    printf(\"%s\", ps2);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13048", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len1, len2, len3, i, j, m, p, flag = 0;\n  char str1[300], str2[50], str3[50];\n  cin.getline(str1, 300);\n  cin.getline(str2, 50);\n  cin.getline(str3, 50);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i <= len1 - len2; i++) {\n    flag = 0;\n    m = i;\n    for (j = 0; j < len2; j++) {\n      if (str1[m++] != str2[j])\n        break;\n    }\n    if (j == len2) {\n      for (p = 0; p < i; p++)\n        cout << str1[p];\n      cout << str3;\n      cout << str1 + i + len2 << endl;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0)\n    cout << str1 << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257] = {0};\n  char b[257] = {0};\n  char c[257] = {0};\n  int i = 0;\n  int j = 0;\n  int k = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int isbreak = 0;\n  int len = strlen(b);\n  for (i = 0; i < 257; i++) {\n    if (a[i + len - 1] == '\u0000')\n      break;\n    for (j = i; j < i + len; j++) {\n      if (a[j] == b[j - i])\n        k++;\n      else {\n        k = 0;\n      }\n    }\n    if (k == len) {\n      isbreak = 1;\n      for (j = i; j < i + len; j++) {\n        a[j] = c[j - i];\n      }\n    }\n    if (isbreak != 0)\n      break;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "13050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s %s %s\", a, b, c);\n  char *p;\n  p = strstr(a, b);\n  if (p) {\n    int n = strlen(a) - strlen(p);\n    int i;\n    int k = strlen(b);\n    int l = strlen(c);\n    int m = 0;\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = n; i < n + l; i++) {\n      cout << c[m];\n      m++;\n    }\n    for (i = n + k; i < (strlen(a)); i++) {\n      printf(\"%c\", a[i]);\n    }\n  } else {\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, result;\n  char input[100], substring[20], replace[20], cpy[20];\n  scanf(\"%s\\n%s\\n%s\", input, substring, replace);\n  result = strlen(input) - strlen(substring);\n  for (i = 0; i <= result; i++) {\n    if (input[i] == substring[0]) {\n      int a;\n      a = strlen(substring);\n      for (j = 0; j < a; j++) {\n        cpy[j] = input[i + j];\n        cpy[j + 1] = '\\0';\n      }\n      int m;\n      m = strcmp(cpy, substring);\n      if (m == 0) {\n\n        for (k = 0; k < i; k++) {\n          printf(\"%c\", input[k]);\n        }\n        printf(\"%s\", replace);\n        for (k = i + a; k < strlen(input); k++) {\n          printf(\"%c\", input[k]);\n        }\n        return 0;\n      }\n    }\n  }\n  cout << input;\n  return 0;\n}\n"}
{"label": "7", "index": "13052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char st[351], su[351], re[551], reh[551];\n  int a, b, c, e, r, lu, lr;\n\n  scanf(\"%s\", st);\n  scanf(\"%s\", su);\n  scanf(\"%s\", re);\n  r = -1;\n  for (a = 0; a < strlen(st); a++) {\n    e = 1;\n    for (b = 0; b < strlen(su); b++) {\n      if (st[a + b] != su[b]) {\n        e = 0;\n      }\n    }\n    if (e) {\n      r = a;\n\n      break;\n    }\n  }\n  if (r + 1) {\n    for (a = 0; a < r; a++) {\n      reh[a] = st[a];\n    }\n    for (a = 0; a < strlen(su); a++) {\n      reh[r + a] = re[a];\n    }\n    lu = strlen(su);\n    lr = strlen(re);\n    for (a = r + lu; a <= 530; a++) {\n      reh[lr + a - lu] = st[a];\n    }\n\n    printf(\"%s\", reh);\n\n  } else {\n    printf(\"%s\", st);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n;\n  cin >> a >> b >> c;\n  n = strlen(b);\n  int m;\n  m = strlen(a);\n  int q, k;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[0]) {\n      k = 1;\n      for (j = i; j < i + n; j++)\n        if (b[j - i] != a[j])\n          k = 0;\n      if (k) {\n        q = i;\n        break;\n      }\n    }\n    k = 0;\n  }\n  if (k) {\n    for (i = 0; i < q; i++)\n      cout << a[i];\n    printf(\"%s\", c);\n\n    for (i = q + n; i < m; i++)\n      printf(\"%c\", a[i]);\n  } else {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257], substring[257], replacement[257];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  int i, len1, len2, j, k, a = 0;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len2; j++) {\n        if (substring[j] == string[j + i])\n          a += 1;\n        else\n          break;\n      }\n      if (a == len2 - 1) {\n        for (k = 0; k < len2; k++)\n          string[k + i] = replacement[k];\n        break;\n      }\n    }\n  }\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char st[300], sub[300], re[300], c[300], sz[300];\n  int i, j, k, t, u;\n  scanf(\"%s%s%s\", st, sub, re);\n  for (i = 0; i <= strlen(st) - strlen(sub); i++) {\n    u = 0;\n    k = 0;\n    t = 0;\n    strcpy(sz, st);\n    for (j = i; j <= (i + strlen(sub) - 1); j++) {\n      c[k] = sz[j];\n      k++;\n    }\n    c[k] = '\\0';\n    if (strcmp(c, sub) == 0) {\n      for (j = i; j <= (i + strlen(sub) - 1); j++) {\n        sz[j] = re[t];\n        t++;\n      }\n      printf(\"%s\", sz);\n      u = 1;\n      break;\n    }\n  }\n  if (u == 0) {\n    printf(\"%s\", st);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, c, m, d, k, v = 0;\n  char str[100], substr[100], rep[100];\n  scanf(\"%s%s%s\", str, substr, rep);\n  a = strlen(str);\n  b = strlen(substr);\n  for (i = 0; i < a; i++) {\n    k = i;\n    if (substr[0] == str[k]) {\n      d = 0;\n      for (j = i + 1, m = 1; j < i + b; j++, m++) {\n        if (substr[m] == str[j])\n          d++;\n      }\n\n      if (d == b - 1)\n        for (j = i, c = 0; j < i + b; j++, c++) {\n          str[j] = rep[c];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k;\n  int m, n;\n  scanf(\"%s \", string);\n  for (i = 0; string[i] != '\u0000';) {\n    i++;\n  }\n  m = i;\n  scanf(\"%s \", substr);\n  for (i = 0; substr[i] != '\u0000';) {\n    i++;\n  }\n  n = i;\n  scanf(\"%s \", replace);\n  for (i = 0; i < m; i++) {\n    if (string[i] == substr[0]) {\n      for (j = 0; j < n; j++) {\n        if (string[i + j] != substr[j])\n          break;\n      }\n      if (j == n) {\n        for (j = 0; j < n; j++)\n          string[i + j] = replace[j];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "13058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[256], wt[256], tar[256];\n  int i, j, tag;\n  cin >> zfc;\n  cin >> wt;\n  cin >> tar;\n  int n = strlen(zfc);\n  int k = strlen(wt);\n  for (i = 0; i < n - k + 1; i++) {\n    tag = 0;\n    for (j = i; j < i + k; j++) {\n      if (zfc[j] != wt[j - i]) {\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 0) {\n      for (j = i; j < i + k; j++) {\n        zfc[j] = tar[j - i];\n      }\n      break;\n    }\n  }\n  puts(zfc);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13059", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, length1, length2, k;\n  cin >> s1 >> s2 >> s3;\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length1; i++) {\n    j = 0;\n    for (; j < length2 && s1[i] == s2[j]; j++)\n      i++;\n    if (j == length2) {\n      for (k = 0; k < length2; k++)\n        s1[i - j + k] = s3[k];\n      break;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  int i, t, j, s, len, len1;\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len = strlen(b);\n  for (i = 0; i <= len1 - len; i++) {\n    t = 1;\n    for (j = 0; j < len; j++)\n      if (a[i + j] != b[j])\n        t = 0;\n    if (t == 1) {\n      s = i;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (i = 0; i < s; i++)\n      cout << a[i];\n    cout << c;\n    for (i = s + len; i < len1; i++)\n      cout << a[i];\n  } else\n    cout << a;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, s;\n  char str[256], c[256], d[256];\n\n  cin >> c;\n\n  cin >> str;\n\n  cin >> d;\n  m = strlen(str);\n  n = strlen(c);\n  for (i = 0; i < n - m + 1; i++) {\n    if (c[i] == str[0]) {\n      s = 0;\n      for (j = i; j < i + m; j++) {\n        if (c[j] == str[j - i]) {\n          s = s + 1;\n        }\n      }\n      if (s == m) {\n        break;\n      }\n    }\n  }\n  if (s == m) {\n    for (j = i; j < i + m; j++) {\n      c[j] = d[j - i];\n    }\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "7", "index": "13062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char q[100], a[10], b[10], lenb, I, *c;\n  int i;\n\n  cin >> q;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = strlen(b);\n  c = strstr(q, a);\n  if (c != NULL) {\n    strncpy(c, b, lenb);\n    puts(q);\n  } else if (c == NULL)\n    puts(q);\n}\n"}
{"label": "7", "index": "13063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1, len2, i, j, m, control = 0;\n  char st[256], sub[256], re[256];\n\n  cin >> st;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  len1 = strlen(st);\n  len2 = strlen(sub);\n  int k = 0;\n  for (i = 0, j = 0; i < len1; i++) {\n    if (k == 0 && sub[j] == st[i]) {\n      if (len2 == 1) {\n        for (m = 0; m < i; m++) {\n          printf(\"%c\", st[m]);\n        }\n        printf(\"%s\", re);\n        for (m = m + 1; m < len1; m++)\n          printf(\"%c\", st[m]);\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    } else if (k != 0 && sub[j] != st[i]) {\n      k = 0;\n      j = 0;\n    } else if (k != 0 && sub[j] == st[i]) {\n      if (j == len2 - 1) {\n        for (m = 0; m < i - j; m++)\n          cout << st[m];\n        printf(\"%s\", re);\n        for (m = m + len2; m < len1; m++)\n          printf(\"%c\", st[m]);\n        printf(\" \");\n        control = 1;\n        break;\n      } else {\n        k++;\n        j++;\n      }\n    }\n  }\n  if (control == 0)\n    puts(st);\n  return 0;\n}\n"}
{"label": "7", "index": "13064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[3][256], string[512];\n  int n, m, k, i, j;\n  scanf(\"%s %s %s\", str[0], str[1], str[2]);\n  n = strlen(str[0]);\n  m = strlen(str[1]);\n  k = strlen(str[2]);\n  for (j = 0; j < n - m + 1; j++) {\n    for (i = 0; i < m; i++) {\n      if (str[1][i] != str[0][i + j])\n        break;\n    }\n    if (i == m)\n      break;\n  }\n  if (j < n - m + 1) {\n    for (i = 0; i < j; i++)\n      string[i] = str[0][i];\n    for (i = j; i < j + k; i++)\n      string[i] = str[2][i - j];\n    for (i = j + k; str[0][i - k + m] != '\\0'; i++)\n      string[i] = str[0][i - k + m];\n    string[i] = '\\0';\n    printf(\"%s\", string);\n  } else\n    printf(\"%s\", str[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "13065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256] = {'\\0'}, s2[256] = {'\\0'}, s3[256] = {'\\0'}, t[256] = {'\\0'};\n  int i, j, k = 0, s, l1, l2, l3;\n  cin >> s1;\n  scanf(\"%s\", s2);\n  cin >> s3;\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  for (i = 0; i < l1;) {\n    for (j = 0; j < l2; j++) {\n      if (i + j >= l1 || s1[i + j] != s2[j])\n        break;\n    }\n    if (j == l2) {\n      for (s = 0; s < l3; s++) {\n        t[k] = s3[s];\n        k++;\n      }\n      i = i + l2;\n      break;\n    } else {\n      t[k] = s1[i];\n      i++;\n      k++;\n    }\n  }\n  for (; i < l1; i++) {\n    t[k] = s1[i];\n    k++;\n  }\n  t[k] = '\\0';\n  printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "7", "index": "13066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int start, end, ok, i, j, n, m, s;\n  char a[300], b[300], c[300];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(a);\n  m = strlen(b);\n  s = strlen(c);\n  for (i = 0; i < n; i++)\n    if (a[i] == b[0]) {\n      ok = 1;\n      for (j = 1; j < m; j++)\n        if (a[j + i] != b[j])\n          ok = 0;\n      if (ok) {\n        start = i;\n        end = j + i;\n        break;\n      }\n    }\n  if (ok == 1) {\n    for (i = 0; i < start; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", c[i]);\n    for (i = end; i < n; i++)\n      cout << a[i];\n    printf(\" \");\n  } else\n    puts(a);\n}\n"}
{"label": "7", "index": "13067", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "13068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, e;\n  char s[256];\n  char b[256];\n  char a[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int c;\n  i = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    j = 0;\n    c = 0;\n    e = i;\n    if (s[i] == a[j]) {\n      for (; a[j] != '\u0000'; j++, i++) {\n        if (a[j] != s[i]) {\n          c++;\n        }\n      }\n      if (c == 0) {\n        for (j = 0; a[j] != '\u0000'; j++, e++) {\n          s[e] = b[j];\n        }\n        break;\n      }\n    }\n    i = e;\n  }\n\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  char string[256] = {'\\0'};\n  char subString[100] = {'\\0'};\n  char replacement[100] = {'\\0'};\n  int i = 0, j = 0, k = 0;\n  char c = '\\0';\n  while (c != '\\n') {\n    c = getchar();\n    if (c != '\\n') {\n      string[i] = c;\n      i++;\n    }\n  }\n  scanf(\"%s\", subString);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    if (string[i] == subString[0]) {\n      k = i;\n      for (j = 0; j < strlen(subString); j++, k++) {\n        if (subString[j] != string[k]) {\n          break;\n        }\n      }\n      if (j == strlen(subString)) {\n        k = i;\n        for (j = 0; j < strlen(replacement); j++, k++) {\n          string[k] = replacement[j];\n        }\n\n        break;\n      }\n    }\n  }\n  cout << string << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char yuan[256], jiu[256], xin[256];\n  int i, j, len, n = 0, len1, u[256], jishu[256] = {0}, len2, k, weizhi,\n                 sum = 0;\n  scanf(\"%s\", yuan);\n  scanf(\"%s\", jiu);\n  scanf(\"%s\", xin);\n  len1 = strlen(yuan);\n  len2 = strlen(jiu);\n  for (i = 0; i < len1; i++) {\n    if (yuan[i] == jiu[0]) {\n      u[n] = i;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = u[i], k = 0; j < u[i] + len2, k < len2; j++, k++) {\n      if (yuan[j] != jiu[k]) {\n        jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (jishu[i] == 0) {\n      sum++;\n    }\n  }\n  if (sum == 0) {\n    cout << yuan;\n  } else {\n    for (i = 0; i < n; i++) {\n      if (jishu[i] == 0) {\n        weizhi = u[i];\n        break;\n      }\n    }\n\n    for (i = weizhi, k = 0; i < weizhi + len2, k < len2; i++, k++) {\n      yuan[i] = xin[k];\n    }\n    printf(\"%s\", yuan);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, f, l, k;\n  char s1[260], s2[260], s3[260];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  m = strlen(s1);\n  n = strlen(s2);\n  l = strlen(s3);\n  for (i = 0; i < m; i++) {\n    f = 1;\n    for (j = 0; j < n; j++)\n      if (s1[i + j] != s2[j]) {\n        f = 0;\n        break;\n      }\n    if (f == 1) {\n      k = i;\n      break;\n    }\n  }\n  if (f == 0)\n    puts(s1);\n  else {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", s1[i]);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", s3[i]);\n    for (i = k + l; i < m; i++)\n      printf(\"%c\", s1[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13072", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[260] = {0}, substring[50] = {0}, replacement[50] = {0},\n       temp[50] = {0}, length, length_s, length_r, i, j, k = 0, m, n;\n  cin >> string >> substring >> replacement;\n  length = strlen(string);\n  length_s = strlen(substring);\n  length_r = strlen(replacement);\n  for (i = 0; i <= length - length_s; i++) {\n    memset(temp, 0, sizeof(temp));\n    k = 0;\n    for (j = i; j < i + length_s; j++) {\n      temp[k++] = string[j];\n    }\n    if (!strcmp(temp, substring)) {\n      if (length_s != length_r) {\n        n = i + length_s;\n        for (m = i + length_r; m < length; m++) {\n          string[m] = string[n++];\n        }\n      }\n      n = 0;\n      for (m = i; m < i + length_r; m++)\n        string[m] = replacement[n++];\n\n      break;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar *strpos(char string[], char substring[]) {\n  char *p = string;\n  char *temp = NULL;\n  while (*p != '\\0') {\n    if (*p == substring[0]) {\n      temp = p;\n      p++;\n      int i;\n      for (i = 1; i < strlen(substring); i++) {\n        if (*p != substring[i]) {\n          break;\n        }\n        p++;\n      }\n      if (i == strlen(substring))\n        break;\n      else\n        p = temp + 1;\n    } else\n      p++;\n  }\n  return temp;\n}\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin.getline(string, 257);\n  cin.getline(substring, 257);\n  cin.getline(replacement, 257);\n  char *p = strpos(string, substring);\n  if (p != NULL) {\n    int t = 0, count = 0;\n    while (count != strlen(substring)) {\n      *p = replacement[t++];\n      p++;\n      count++;\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13074", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], copy[101], before[101], after[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i = 0, j;\n  for (i; i <= (int)(strlen(s) - strlen(a)); i++) {\n    for (j = 0; j < (int)(strlen(a)); j++) {\n      copy[j] = s[i + j];\n    }\n    copy[j] = '\u0000';\n    if (strcmp(copy, a) == 0) {\n      for (j = 0; j < i; j++) {\n        before[j] = s[j];\n      }\n      before[j] = '\u0000';\n      for (j = i + (int)strlen(a); j < (int)(strlen(s)); j++)\n        after[j - i - (int)strlen(a)] = s[j];\n\n      after[j - i - (int)strlen(a)] = '\u0000';\n      strcat(before, b);\n      strcat(before, after);\n      strcpy(s, before);\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "13075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c, k = 1;\n  char s[300], w[300], t[300];\n  scanf(\"%s\", w);\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  int l1 = strlen(s);\n  int l2 = strlen(w);\n  int l3 = strlen(t);\n  for (i = 0; i < l2; i++) {\n    c = 0;\n    for (j = 0; j < l1; j++) {\n      if (!(s[j] == w[j + i])) {\n        c = 1;\n        break;\n      }\n    }\n    if ((!c) && (k)) {\n      for (j = i; j < i + l3; j++) {\n        w[j] = t[j - i];\n      }\n      k = 0;\n    }\n  }\n  cout << w;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], w[300], r[300], d[300];\n  int i, j, l, h;\n  scanf(\"%s%s%s\", s, w, r);\n  l = strlen(s);\n  h = strlen(w);\n  for (i = 0; i <= l - h; i++) {\n    for (j = 0; j < h; j++) {\n      d[j] = s[i + j];\n    }\n    d[h] = '\\0';\n    if (strcmp(d, w) == 0)\n      break;\n  }\n  if (i == l - h + 1)\n    printf(\"%s\", s);\n  else {\n    for (j = i; j < i + h; j++) {\n      s[j] = r[j - i];\n    }\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13077", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char su[100], zu[100], tu[100];\n\n  cin >> su;\n\n  cin >> zu;\n\n  scanf(\"%s \", tu);\n  int i, j, k, t;\n  for (i = 0; i < strlen(su); i++) {\n    for (k = 0, j = i; su[j] == zu[k]; j++, k++)\n      if (k == strlen(zu))\n        break;\n    if (k == strlen(zu))\n      break;\n  }\n\n  if (j != i - 1) {\n    for (t = 0; t < i; t++)\n      printf(\"%c\", su[t]);\n    printf(\"%s\", tu);\n    for (t = j; t < strlen(su); t++)\n      printf(\"%c\", su[t]);\n  } else\n    printf(\"%s\", su);\n  return 0;\n}\n"}
{"label": "7", "index": "13078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[500], substring[50], replacement[50];\n  int same, i, k, c;\n  scanf(\"%s%s%s\", string, substring, replacement);\n  for (i = 0; i < strlen(string); i++) {\n    same = 1;\n    for (k = 0; k < strlen(substring); k++) {\n      if (string[i + k] != substring[k]) {\n        same = 0;\n      }\n    }\n    if (same == 1) {\n      printf(\"%s\", replacement);\n      c = i;\n      break;\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  for (i = c + strlen(substring); i < strlen(string); i++) {\n    printf(\"%c\", string[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0}, c[100] = {0};\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int lb, la;\n  lb = strlen(b);\n  la = strlen(a);\n  int count = 0;\n\n  for (int i = 0; i <= la - lb; i++) {\n    count = 0;\n    for (int j = 0; j < lb; j++) {\n      if (a[i + j] != b[j]) {\n        count = 1;\n        break;\n      }\n    }\n\n    if (count == 0) {\n      a[i] = 1;\n      for (int j = 1; j < lb; j++)\n        a[i + j] = 2;\n      break;\n    }\n  }\n  for (int i = 0; i < la; i++) {\n    if (a[i] == 1)\n      cout << c;\n    if (a[i] == 2)\n      ;\n    if (a[i] != 2 && a[i] != 1)\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "7", "index": "13080", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar *str_replace(const char *src, const char *oldstr, const char *newstr);\nint main() {\n  int aa = 0, i;\n  char str1[100], str2[100], str3[100], sub[100] = {0}, sub1[100] = {0},\n                                        sub2[100] = {0};\n\n  cin >> str1;\n\n  cin >> str2;\n\n  scanf(\"%s \", str3);\n  if (strlen(str1) < strlen(str2))\n    cout << str1;\n  else {\n    for (i = 0; i <= strlen(str1) - strlen(str2); i++) {\n      strncpy(sub, str1 + i, strlen(str2));\n      if (strcmp(sub, str2) == 0) {\n        strncpy(sub1, str1, i);\n        strncpy(sub2, str1 + i + strlen(str2), strlen(str1) - i - strlen(str2));\n        strcat(sub1, str3);\n        strcat(sub1, sub2);\n        cout << sub1;\n        aa = 1;\n        break;\n      }\n    }\n    if (aa == 0)\n      cout << str1;\n  }\n\n  return 0;\n}\nchar *str_replace(const char *src, const char *oldstr, const char *newstr) {\n\n  if (NULL == src || NULL == oldstr || NULL == newstr)\n\n  {\n\n    return NULL;\n  }\n\n  char *dest = strdup(src);\n\n  if (strcmp(oldstr, newstr) == 0)\n\n  {\n\n    return dest;\n  }\n\n  char *needle;\n\n  char *tmp, *dest_tmp = dest;\n\n  while (needle = strstr(dest, oldstr))\n\n  {\n\n    tmp = (char *)malloc(strlen(dest) + strlen(newstr) - strlen(oldstr) + 1);\n\n    strncpy(tmp, dest, needle - dest);\n\n    tmp[needle - dest] = '\u0000';\n\n    strcat(tmp, newstr);\n\n    strcat(tmp, needle + strlen(oldstr));\n\n    dest = strdup(tmp);\n\n    free(dest_tmp);\n\n    free(tmp);\n\n    dest_tmp = dest;\n  }\n\n  return dest;\n}\n"}
{"label": "7", "index": "13081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n\n  char string[256], sub[256], re[256];\n\n  int i, j;\n\n  scanf(\"%s \", string);\n\n  cin >> sub;\n\n  cin >> re;\n\n  int len1 = strlen(string), len2 = strlen(sub);\n\n  for (i = 0; i <= len1 - len2; i++)\n\n  {\n\n    for (j = 0; j < len2; j++)\n\n    {\n\n      if (sub[j] != string[i + j])\n        break;\n    }\n\n    if (j != len2)\n      continue;\n\n    if (j == len2)\n\n    {\n\n      for (j = 0; j < len2; j++)\n        string[i + j] = re[j];\n\n      break;\n    }\n  }\n\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13082", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0;\n  char str[260], sub[20], rep[20];\n  cin >> str >> sub >> rep;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = i + 1; j < i + strlen(sub); j++) {\n        if (str[j] != sub[j - i]) {\n          t = 1;\n        }\n      }\n      if (t == 0) {\n        for (int k = i; k < i + strlen(sub); k++) {\n          str[k] = rep[k - i];\n        }\n        break;\n      }\n    }\n\n    t = 0;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], sz[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  int a, b, c, tag;\n  a = strlen(sub);\n  c = strlen(str);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    tag = 0;\n    if (str[i] == sub[0]) {\n      for (j = 0; j < a; j++) {\n        sz[j] = str[i + j];\n      }\n      sz[a] = '\\0';\n    }\n    if (strcmp(sz, sub) == 0) {\n      b = i;\n      strcpy(sub, rep);\n      tag = 1;\n      break;\n    }\n  }\n  if (tag == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", sub);\n    for (i = b + a; i < c; i++) {\n      printf(\"%c\", str[i]);\n    }\n  } else {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  char *t;\n  t = strstr(a, b);\n  if (t == NULL) {\n    printf(\"%s\", a);\n    return 0;\n  } else {\n    char f = t - a;\n    int d = strlen(a), e = strlen(c);\n    int i = f, j;\n    for (j = 0; j < e; j++) {\n      a[i] = c[j];\n      i++;\n      if (i == t - a + e)\n        break;\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "13085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[257], str2[257], str3[257];\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n\n  int i;\n  int j;\n  int k;\n  for (i = 0; i < strlen(str1); i++) {\n    j = 0;\n    k = i;\n    while (j < strlen(str2)) {\n      if (str2[j] != str1[k])\n        break;\n      else\n        j++;\n      k++;\n    }\n    if (j == strlen(str2)) {\n      printf(\"%s\", str3);\n      break;\n    } else\n      cout << str1[i];\n  }\n  if (i != strlen(str1))\n    for (i = k; i < strlen(str1); i++)\n      printf(\"%c\", str1[i]);\n  return 0;\n}\n"}
{"label": "7", "index": "13086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p;\n  char a[300], b[300], c[300];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  p = strlen(b);\n  for (i = 0; a[i] != '\u0000'; i++)\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; k < p; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == p) {\n        for (j = i, k = 0; k < p; j++, k++) {\n          a[j] = c[k];\n        }\n        printf(\"%s\", a);\n        break;\n      }\n    }\n  if (a[i] == '\u0000')\n    printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "13087", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, y, x = 0, q = 0;\n  char a[257], b[257], c[257];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j < strlen(a); j++) {\n    if (b[i] == a[j]) {\n      for (k = 0; k < strlen(b); k++) {\n        if (b[i + k] == a[j + k]) {\n          x++;\n        }\n        if (x == strlen(b)) {\n          for (y = 0; y < j; y++) {\n            printf(\"%c\", a[y]);\n          }\n          for (y = 0; y < strlen(c); y++) {\n            printf(\"%c\", c[y]);\n          }\n          for (y = j + strlen(b); y < strlen(a); y++) {\n            printf(\"%c\", a[y]);\n          }\n          q++;\n          break;\n        }\n      }\n    }\n    if (q == 1) {\n      break;\n    }\n    if (j == strlen(a) - 1) {\n      printf(\"%s\", a);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j, count = 0, k;\n  char string[256], substring[256], replacement[256], czy[256], cai[256];\n  cin >> string;\n  cin >> substring;\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 0; j < b; j++)\n        czy[j] = string[i + j];\n      if (strcmp(czy, substring) == 0) {\n        count = 1;\n        for (k = 0; k < i; k++)\n          cai[k] = string[k];\n        for (k = i; k < i + b; k++)\n          cai[k] = replacement[k - i];\n        for (k = i + b; k < a; k++)\n          cai[k] = string[k];\n      }\n      if (count == 1)\n        break;\n    }\n  }\n  if (count == 1)\n    puts(cai);\n  else\n    puts(string);\n  return 0;\n}\n"}
{"label": "7", "index": "13089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  int len1, len2, len3, i, j, sum = 0;\n  scanf(\"%s\", &a);\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    if (a[i] == b[0]) {\n      sum = 0;\n      for (j = 0; j < len2; j++) {\n        if (a[i + j] == b[j]) {\n          sum++;\n        }\n      }\n      if (sum == len2) {\n        for (j = 0; j < len3; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%s\", a);\n}\n"}
{"label": "7", "index": "13090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  scanf(\"%s%s%s\", str, sub, re);\n  int l1, l2;\n  l1 = strlen(str);\n  l2 = strlen(sub);\n  int i, j, m;\n  for (i = 0; i < l1; i++) {\n    m = 1;\n    for (j = 0; j < l2; j++) {\n      if (str[i + j] != sub[j])\n        m = 2;\n    }\n    if (m == 1) {\n      for (j = 0; j < l2; j++) {\n        str[i + j] = re[j];\n      }\n      break;\n    }\n  }\n  cout << str << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[260];\n  char b[260];\n  char c[260];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j, length;\n  for (i = 0; i < len1; i++) {\n    length = 0;\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        length = length + 1;\n    }\n    if (length == len2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < len3; j++) {\n        printf(\"%c\", c[j]);\n      }\n      for (j = i + len3; j < len1; j++) {\n        printf(\"%c\", a[j]);\n      }\n      printf(\" \");\n      break;\n    }\n  }\n  if (length != len2)\n    cout << a << \" \";\n  return 0;\n}\n"}
{"label": "7", "index": "13092", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257], substring[257], replacement[257];\n\n  cin >> string;\n\n  cin >> substring;\n\n  scanf(\"%s \", replacement);\n  int i, len1, len2, j, k, a = 0;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len2; j++) {\n        if (substring[j] == string[j + i])\n          a += 1;\n        else\n          break;\n      }\n      if (a == len2 - 1) {\n        for (k = 0; k < len2; k++)\n          string[k + i] = replacement[k];\n        break;\n      }\n    }\n  }\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13093", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char S[100], sub[100], replace[100];\n  scanf(\"%s\", S);\n  scanf(\"%s\", sub);\n  scanf(\"%s \", replace);\n  int a, b, c, i, j;\n  a = strlen(S);\n  b = strlen(sub);\n  c = strlen(replace);\n  int k, m;\n  for (i = 0; i < a; i++) {\n    if (S[i] == sub[0]) {\n      for (j = 0; j < b; j++) {\n        if (S[i + j] != sub[j])\n          break;\n      }\n      if (S[i + b - 1] == sub[b - 1]) {\n        m = i;\n        for (k = 0; k < m; k++)\n          printf(\"%c\", S[k]);\n        printf(\"%s\", replace);\n        for (k = i + b; k < a; k++)\n          printf(\"%c\", S[k]);\n        break;\n      }\n    }\n  }\n  if (i == a)\n    printf(\"%s\", S);\n}\n"}
{"label": "7", "index": "13094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[500], substring[500], replacement[500], temp, str[500];\n  int i, j, k, l, m, len0, len1, len2;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n\n  len1 = strlen(substring);\n\n  len2 = strlen(replacement);\n\n  len0 = strlen(string);\n\n  strcpy(str, string);\n\n  for (i = 0; i < len0; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len1; j++) {\n        if (string[i + 1] == substring[j])\n          i++;\n        else {\n          j = 0;\n          break;\n        }\n      }\n\n      if (j == len1) {\n        k = i;\n        for (i; i < len0 - len1 + len2; i++) {\n          str[i - len1 + len2] = string[i];\n        }\n        for (l = 0; l < len2; l++) {\n          str[k - len2 + 1 + l] = replacement[l];\n        }\n      } else\n        m = 0;\n    }\n  }\n\n  puts(str);\n  return 0;\n}\n"}
{"label": "7", "index": "13095", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[999], b[999], *aa, *bb;\n  char c[999][999], *cc;\n  char d[999];\n\n  scanf(\"%s \", b);\n\n  cin >> a;\n\n  scanf(\"%s \", d);\n  int len = strlen(a);\n  int len2 = strlen(b);\n  int k = 0, i, j = 0;\n  for (bb = b; *(bb + len - 1) != '\u0000'; bb++, k++) {\n    i = 0;\n    for (cc = c[k]; i < len; i++, cc++) {\n      *cc = *(bb + i);\n    }\n    *cc = '\u0000';\n    j++;\n  }\n  int sp = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      sp = 1;\n      break;\n    }\n  }\n  char e[2][999];\n  int pom = i;\n  for (i = 0; i < pom; i++) {\n    e[0][i] = b[i];\n    e[0][pom] = '\u0000';\n  }\n  k = 0;\n  for (i = pom + len; i < len2; i++, k++) {\n    e[1][k] = b[i];\n  }\n  e[1][k] = '\u0000';\n  if (sp == 1) {\n    printf(\"%s%s%s\", e[0], d, e[1]);\n  }\n  if (sp == 0) {\n    puts(b);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  cin >> a >> b >> c;\n  int L, l, x, y;\n  L = strlen(a);\n  l = strlen(b);\n  for (x = 0; x <= L - l; x++) {\n    if (a[x] != b[0])\n      continue;\n    else {\n      for (y = 0; y < l; y++)\n        if (a[x + y] != b[y])\n          break;\n      if (y != l)\n        continue;\n      else {\n        break;\n      }\n    }\n  }\n  if (x == L - l + 1)\n    cout << a << endl;\n  else {\n    int i = 0;\n    while (i != x) {\n      cout << a[i];\n      i++;\n    }\n    cout << c;\n    cout << a + i + l << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13097", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  cin >> y;\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  if (changdu1 < changdu2)\n    ;\n  else {\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      for (j = 0; j < changdu2; j++)\n        media[i][j] = x[i + j];\n    }\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      if (strcmp(media[i], y) == 0) {\n        p = i;\n        break;\n      }\n    }\n    if (i == changdu1 - changdu2 + 1)\n\n    {\n      printf(\"%s\", x);\n      return 0;\n    } else {\n      strcpy(media[p], z);\n      if (p != 0) {\n        for (i = 0; i < p; i++)\n          printf(\"%c\", x[i]);\n        printf(\"%s\", media[p]);\n        if (changdu2 > changdu3)\n          m = changdu2;\n        else\n          m = changdu3;\n        for (i = p + m; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      } else {\n        printf(\"%s\", media[p]);\n        for (i = p + changdu3; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[266];\n  int i, k, len, n, m, j = 0;\n  char yuan[20], mb[20], kd[20];\n  cin >> sz >> yuan >> mb;\n  m = strlen(sz);\n  n = strlen(yuan);\n  for (i = 0; i < m; i++) {\n    if (sz[i] != yuan[0]) {\n      printf(\"%c\", sz[i]);\n    } else {\n      for (k = i; k < i + n; k++) {\n        kd[k - i] = sz[k];\n      }\n      kd[n] = '\\0';\n\n      if (strcmp(kd, yuan) == 0) {\n        cout << mb;\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", sz[k]);\n        }\n        break;\n\n      } else {\n        cout << sz[i];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc1[257] = {0}, zfc2[257] = {0}, zfc3[257] = {0}, zichuan[257] = {0};\n  int len1, len2, i, j, k, t, flag = 0;\n  cin >> zfc1;\n  scanf(\"%s\", zfc2);\n  scanf(\"%s\", zfc3);\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = 0; j < len2; j++)\n      zichuan[j] = zfc1[j + i];\n\n    if (strcmp(zichuan, zfc2) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc1[k]);\n      }\n      cout << zfc3;\n      for (t = i + len2; zfc1[t] != '\\0'; t++) {\n        printf(\"%c\", zfc1[t]);\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    printf(\"%s\", zfc1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substr[256], replace[256];\n  int i, j, k, len, len1, len2, m;\n  scanf(\"%s%s%s\", string, substr, replace);\n  len1 = strlen(string);\n  len2 = strlen(substr);\n  for (i = 0; i < len1; i++) {\n    if (substr[0] == string[i]) {\n      len = 0;\n      for (j = 0; j < len2; j++) {\n        if ((substr[j] == string[i + j]) && len < len2)\n          len++;\n      }\n      if (len == len2) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", string[k]);\n        printf(\"%s\", replace);\n        for (k = i + len2; k < len1; k++)\n          printf(\"%c\", string[k]);\n        m = 1;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n  if (m != 1)\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13101", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, len2, i, j, f, ff;\n  char s[300], sub[300], replace[300];\n\n  cin >> s;\n  len = strlen(s);\n\n  cin >> sub;\n\n  cin >> replace;\n  len2 = strlen(sub);\n  f = 0;\n  for (i = 0; i <= len - len2; i++) {\n    ff = 1;\n    for (j = 0; j < len2; j++)\n      if (sub[j] != s[i + j]) {\n        ff = 0;\n        break;\n      }\n    if (ff == 0)\n      continue;\n    for (j = 0; j < i; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", replace);\n    for (j = i + len2; j < len; j++)\n      printf(\"%c\", s[j]);\n    f = 1;\n    break;\n  }\n  if (f == 0)\n    printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sentence[256], sub_sen[256], replacement[256];\n  cin.getline(sentence, 256);\n  cin.getline(sub_sen, 256);\n  cin.getline(replacement, 256);\n  char *p;\n  p = strstr(sentence, sub_sen);\n  if (!p)\n    cout << sentence << endl;\n  int i;\n  int length = strlen(sub_sen);\n  if (p) {\n    for (i = 0; i < p - sentence; i++)\n      cout << sentence[i];\n    printf(\"%s\", replacement);\n    cout << p + length << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256], subString[256], replacement[256];\n  char *n = NULL;\n  int l, i;\n  memset(string, '\\0', sizeof(string));\n  memset(subString, '\\0', sizeof(subString));\n  memset(replacement, '\\0', sizeof(replacement));\n  cin >> string >> subString >> replacement;\n  n = strstr(string, subString);\n  l = strlen(subString);\n  if (n != NULL) {\n    for (i = 0; i < l; i++) {\n      n[i] = replacement[i];\n    }\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char s[30000];\n  char yc[30000];\n  char tc[30000];\n  int tag = 1;\n  int u = 0;\n\n  cin >> s;\n  cin >> yc;\n  scanf(\"%s \", tc);\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == yc[0]) {\n      tag = 2;\n      for (int j = 0; j < strlen(yc); j++) {\n        if (s[i + j] != yc[j]) {\n          tag = 0;\n          break;\n        }\n      }\n    }\n    if (tag == 2) {\n      printf(\"%s\", tc);\n      u = i + strlen(yc);\n      break;\n    }\n\n    if (tag != 2) {\n      cout << s[i];\n    }\n  }\n  if (tag == 2) {\n    for (int k = u; k < strlen(s); k++) {\n      printf(\"%c\", s[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13105", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint Issubstr(char *s, char *subs) {\n  int i, j;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = 0; j < strlen(subs); j++) {\n      if (subs[j] != s[i + j])\n        break;\n    }\n    if (j == strlen(subs))\n      break;\n  }\n  if (i < strlen(s))\n    return i;\n  return -1;\n}\nint main() {\n  char s[257], sub[257], replace[257];\n  int i, j = 0;\n  cin >> s >> sub >> replace;\n  for (i = Issubstr(s, sub); i != -1 && j < strlen(replace); i++) {\n    s[i] = replace[j++];\n  }\n  if (i > strlen(s))\n    s[i] = '\\0';\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char *p = NULL, *q = NULL;\n  char str[100], substr[100], restr[100];\n  cin >> str >> substr >> restr;\n  p = strstr(str, substr);\n  if (p != NULL) \n  {\n    q = p + strlen(substr);\n    strcat(restr, q);   \n    *p = '\\0';          \n    strcat(str, restr); \n  }\n  cout << str;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13107", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], substr[256], rep[256];\n  int i, j, flag = 1, flag1 = 0;\n  scanf(\"%s \", str);\n  cin >> substr;\n  cin >> rep;\n  int nlen = strlen(str);\n  int slen = strlen(substr);\n  int rlen = strlen(rep);\n  if (slen != rlen) {\n    cout << \"hehe\" << endl;\n  }\n  for (i = 0; i < nlen; i++) {\n    for (j = 0; j < slen; j++) {\n      if (substr[j] != str[i + j]) {\n        flag = 0;\n        break;\n      } else {\n        flag = 1;\n      }\n    }\n    if (flag) {\n      for (int k = 0; k < slen; k++) {\n        str[i + k] = rep[k];\n      }\n      flag1 = 1;\n    }\n    if (flag1) {\n      break;\n    }\n  }\n  cout << str << '\\n';\n  return 0;\n}\n"}
{"label": "7", "index": "13108", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar s[300], subs[300], rep[300];\n\nint ok(int wh) {\n  int i;\n  for (i = wh; i <= wh + strlen(subs) - 1; i++) {\n    if (s[i] != subs[i - wh]) {\n      return 0;\n    }\n  }\n  return 1;\n}\n\nint main() {\n  int i, j, k, n, start;\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> rep;\n  start = -1;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (ok(i)) {\n      start = i;\n      break;\n    }\n  if (start == -1) {\n    puts(s);\n    return 0;\n  }\n  for (i = 0; i < start; i++) {\n    printf(\"%c\", s[i]);\n  }\n  for (i = 0; rep[i] != '\u0000'; i++) {\n    printf(\"%c\", rep[i]);\n  }\n  for (i = start + strlen(subs); s[i] != '\u0000'; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "13109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ys[1000], re[1000], bt[1000];\n  int m, n, i, j, k, ss = 0, se = 0;\n\n  cin >> ys;\n\n  cin >> bt;\n\n  cin >> re;\n  for (i = 0; ys[i] != 0; i++) {\n    if (ys[i] == bt[0]) {\n      for (k = i + 1, j = 1; ys[k] != 0 && bt[j] != 0; k++, j++) {\n        if (ys[k] != bt[j])\n          break;\n      }\n      if (bt[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(bt) <= strlen(re)) {\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n      for (k = se; ys[k] != 0; k++, i++) {\n        ys[i] = ys[k];\n      }\n      ys[i] = 0;\n    } else {\n      i = strlen(ys) + strlen(re) - strlen(bt);\n      for (k = strlen(ys); k >= se; k--, i--) {\n        ys[i] = ys[k];\n      }\n      for (i = ss, j = 0; re[j] != 0; i++, j++) {\n        ys[i] = re[j];\n      }\n    }\n  }\n  printf(ys);\n  return 0;\n}\n"}
{"label": "7", "index": "13110", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char st[256], sub[256], rep[256];\n  scanf(\"%s%s%s\", st, sub, rep);\n  int lenst, lensub, i, j;\n  lenst = strlen(st);\n  lensub = strlen(sub);\n  for (i = 0; i <= lenst - lensub; i++) {\n    int count = 0;\n    if (lensub != 1) {\n      if (st[i] == sub[0]) {\n\n        for (j = i + 1; j < i + lensub; j++) {\n          if (st[j] != sub[j - i])\n            break;\n          count++;\n        }\n      }\n      if (count == lensub - 1) {\n        for (j = i; j < i + lensub; j++) {\n          st[j] = rep[j - i];\n        }\n        break;\n      }\n    } else {\n      if (st[i] == sub[0]) {\n        st[i] = rep[0];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", st);\n}\n"}
{"label": "7", "index": "13111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar word[256], substring[256], replacement[256];\nint l1, l2, l3;\nint the_same(char *ch) {\n  int i;\n  for (i = 0; i < l2; i++) {\n    if (*(ch + i) != substring[i])\n      return 0;\n  }\n  return 1;\n}\nint main() {\n  char *p = NULL, *q = NULL;\n  int i, t;\n  cin.getline(word, 256);\n  l1 = strlen(word);\n  cin.getline(substring, 256);\n  l2 = strlen(substring);\n  cin.getline(replacement, 256);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    t = the_same(&word[i]);\n    if (t == 1) {\n      p = word + i;\n      break;\n    }\n  }\n  if (p == NULL) {\n    for (i = 0; i < l1; i++)\n      cout << word[i];\n  } else {\n    for (q = word; q < p; q++)\n      cout << *q;\n    for (i = 0; i < l3; i++)\n      printf(\"%c\", replacement[i]);\n    for (q = p + l2; q < word + l1; q++)\n      cout << *q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, lena, lenb;\n  scanf(\"%s%s%s\", a, b, c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  a[lena] = '\\0';\n  int x, s;\n  for (i = 0; i < lena; i++) {\n    x = -1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        x = 0;\n        break;\n      }\n    }\n    if (x != 0) {\n      s = i;\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < s; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", c);\n    for (i = s + lenb; i < lena; i++)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, t;\n  char s1[256], s2[256], s3[256];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  for (i = 0; s1[i] != '\u0000'; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; s2[j] != '\u0000'; j++)\n        if (s2[j] == s1[i + j])\n          k++;\n      if (s2[k] == '\u0000') {\n        for (t = 0; t < i; t++)\n          printf(\"%c\", s1[t]);\n        for (t = 0; t < k; t++)\n          printf(\"%c\", s3[t]);\n        for (t = i + k; s1[t] != '\u0000'; t++)\n          printf(\"%c\", s1[t]);\n        cout << \" \";\n        break;\n      }\n    }\n  if (s2[k] != '\u0000')\n    printf(\"%s \", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char yuan[256], jiu[256], xin[256];\n  int i, j, len, n = 0, len1, u[256], jishu[256] = {0}, len2, k, weizhi,\n                 sum = 0;\n  scanf(\"%s\", yuan);\n  scanf(\"%s\", jiu);\n  scanf(\"%s\", xin);\n  len1 = strlen(yuan);\n  len2 = strlen(jiu);\n  for (i = 0; i < len1; i++) {\n    if (yuan[i] == jiu[0]) {\n      u[n] = i;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = u[i], k = 0; j < u[i] + len2, k < len2; j++, k++) {\n      if (yuan[j] != jiu[k]) {\n        jishu[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (jishu[i] == 0) {\n      sum++;\n    }\n  }\n  if (sum == 0) {\n    cout << yuan;\n  } else {\n    for (i = 0; i < n; i++) {\n      if (jishu[i] == 0) {\n        weizhi = u[i];\n        break;\n      }\n    }\n\n    for (i = weizhi, k = 0; i < weizhi + len2, k < len2; i++, k++) {\n      yuan[i] = xin[k];\n    }\n    cout << yuan;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], rep[256];\n  int t, i, j, k;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    t = 0;\n    if (s[i] == sub[0]) {\n      for (j = i, k = 0; sub[k] != '\u0000'; j++, k++) {\n        if (s[j] != sub[k]) {\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        for (j = i; rep[j - i] != '\u0000'; j++)\n          s[j] = rep[j - i];\n        break;\n      }\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "13116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t = 0;\n  char str[260], sub[20], rep[20];\n  scanf(\"%s%s%s\", str, sub, rep);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = i + 1; j < i + strlen(sub); j++) {\n        if (str[j] != sub[j - i]) {\n          t = 1;\n        }\n      }\n      if (t == 0) {\n        for (int k = i; k < i + strlen(sub); k++)\n          str[k] = rep[k - i];\n\n        break;\n      }\n    }\n\n    t = 0;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, x, y, z, m, t = 1, n;\n  char a[300], b[300], c[300];\n  cin >> a >> b >> c;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < y; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      } else {\n        if (j == y - 1) {\n          for (m = 0; m < z; m++)\n            cout << c[m];\n          i = i + y - 1;\n          t = 0;\n        }\n      }\n    }\n    if (j < y - 1) {\n      printf(\"%c\", a[i]);\n    }\n    if (t == 0)\n      break;\n  }\n  for (n = i + 1; n < x; n++)\n    printf(\"%c\", a[n]);\n  return 0;\n}\n"}
{"label": "7", "index": "13118", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, s, m, n, k;\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  cin >> str2;\n  scanf(\"%s \", str3);\n  m = strlen(str1);\n  n = strlen(str2);\n  k = strlen(str3);\n  for (i = 0; i <= m - n; i++) {\n    s = 0;\n    for (j = i; j < i + n; j++) {\n      if (str2[j - i] == str1[j])\n        s++;\n    }\n    if (s == n) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", str3[j]);\n      }\n      for (j = i + n; j < m; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      break;\n    }\n  }\n  if (s != n)\n    printf(\"%s\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "13119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string1[256], string2[256], string3[256];\n  scanf(\"%s\", string1);\n  scanf(\"%s\", string2);\n  scanf(\"%s\", string3);\n  int length1, length2, length3, i, j, temp;\n  length1 = strlen(string1);\n  length2 = strlen(string2);\n  length3 = strlen(string3);\n  for (i = 0; i <= (length1 - length2); i++) {\n    if (string1[i] == string2[0]) {\n      j = 1;\n      temp = i + 1;\n      while (j < length2 && string1[temp] == string2[j]) {\n        temp++;\n        j++;\n      }\n      if (j == length2) {\n        strcpy(string2, string1 + temp);\n        strcpy(string1 + i, string3);\n        strcpy(string1 + i + length3, string2);\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", string1);\n}\n"}
{"label": "7", "index": "13120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *org, *sub, *re;\n  int i, j, flag;\n  org = (char *)malloc(1024 * sizeof(char));\n  sub = (char *)malloc(100 * sizeof(char));\n  re = (char *)malloc(100 * sizeof(char));\n\n  scanf(\"%s \", org);\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; *(org + i) != '\u0000'; i++) {\n    if (*(org + i) == *sub) {\n      for (j = 0; *(sub + j) != '\u0000'; j++) {\n        flag = 0;\n        if (*(org + i + j) != *(sub + j)) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        for (j = 0; *(re + j) != '\u0000'; j++)\n          *(org + i + j) = *(re + j);\n        break;\n      }\n    }\n  }\n  printf(\"%s\", org);\n}\n"}
{"label": "7", "index": "13121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int result = 0;\n  int a, b, c, i, d, e = 0, f, g, h, j, k;\n  int len[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  a = strlen(str);\n  b = strlen(sub);\n  c = strlen(rep);\n  for (i = 0; i < a; i++) {\n    for (d = 0; d < b - 1; d++) {\n      if ((str[i + d] == sub[d]) && (str[i + d + 1] == sub[d + 1])) {\n        result = 1;\n        len[e] = i;\n        e++;\n      }\n      break;\n    }\n  }\n  f = len[0];\n  if (result == 1) {\n    for (g = 0; g < f; g++) {\n      printf(\"%c\", str[g]);\n    }\n    for (h = 0; h < c; h++) {\n      printf(\"%c\", rep[h]);\n    }\n    for (j = 0; j < a - f - b; j++) {\n      printf(\"%c\", str[f + b + j]);\n    }\n  } else if (result == 0) {\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[257];\n  char str2[257];\n  char str3[257];\n  cin >> str1 >> str2 >> str3;\n  char *p = NULL;\n  p = strstr(str1, str2);\n  if (p != NULL) {\n    for (int i = 0; i < strlen(str3); i++) {\n      *p = *(str3 + i);\n      p++;\n    }\n  }\n  cout << str1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13123", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int n, m, i, j, p;\n  cin >> s >> a >> b;\n  n = strlen(s);\n  m = strlen(a);\n\n  for (i = 0, j = 0; i < m, j < n; j++) {\n    if (a[i] == s[j]) {\n      p = j;\n      i++;\n      if (i == m)\n        break;\n    } else\n      i = 0;\n  }\n\n  if (i == m)\n    for (i = 0; i < m; i++)\n      s[p - m + 1 + i] = b[i];\n\n  printf(\"%s\\n\", s);\n}\n"}
{"label": "7", "index": "13124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int l, p, q, i, j, s, m = 0, k, y;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  l = strlen(a);\n  p = strlen(b);\n  for (i = 0; i < l; i++) {\n    k = i;\n    j = 0;\n    while (a[k] == b[j] && j < p) {\n      k++;\n      j++;\n    }\n    if (j == p) {\n      for (s = i; s < i + p; s++) {\n        a[s] = c[m];\n        m++;\n        y = 1;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n  printf(\"%s \", a);\n}\n"}
{"label": "7", "index": "13125", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int len, len1, flag = 0, i, j, k;\n  char str[256], str1[256], str2[256];\n  cin >> str;\n  cin >> str1;\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  for (i = 0; i <= len - len1; i++) \n  {\n    for (j = 0; j <= len1 - 1; j++) \n    {\n      if (str[i + j] == str1[j])\n        continue;\n      else\n        break;\n    }\n    if (j == len1) \n    {\n      for (k = 0; k < i; k++)\n        cout << str[k];\n      cout << str2;\n      for (k = i + j; k < len; k++)\n        cout << str[k];\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) \n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char string[300];\n  char substring[300];\n  char replace[300];\n  scanf(\"%s \", string);\n  cin >> substring;\n  cin >> replace;\n  int l = strlen(string);\n  int l1 = strlen(substring);\n  int l2 = strlen(replace);\n  char *p = strstr(string, substring);\n  if (p != NULL) {\n    while (i < l2) {\n      *p = replace[i];\n      i++;\n      p++;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000], b[1000], c[1000];\nint main() {\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  cin >> c;\n  int len1, len2, p = 0, i, j;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    if (a[i] == b[0]) {\n      p = 1;\n      for (j = i; j < len2 + i; j++) {\n        if (a[j] != b[j - i]) {\n          p = 0;\n          break;\n        }\n      }\n      if (p == 1) {\n        for (j = i; j < len2 + i; j++)\n          a[j] = c[j - i];\n\n        break;\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13128", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  int n = strlen(a);\n  int m = strlen(b);\n  int j;\n  for (int i = 0; i < n; i++) {\n    if (a[i] == b[0]) {\n      for (j = 1; j < m; j++) {\n        if (a[i + j] != b[j])\n          break;\n      }\n      if (j == m) {\n        for (j = 0; j < m; j++) {\n          a[i + j] = c[j];\n        }\n        break;\n      }\n    }\n  }\n  puts(a);\n}\n"}
{"label": "7", "index": "13129", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[257];\n  char substring[257];\n  char replacement[257];\n  int h, i, j, k, l1, l2, l3, temp, r = 0, flag = 0;\n  scanf(\"%s\", string);\n  cin >> substring;\n  scanf(\"%s\", replacement);\n  l1 = strlen(string);\n  l2 = strlen(substring);\n  l3 = strlen(replacement);\n  for (i = 0; i < l1; i++) {\n    if (string[i] == substring[0]) {\n      temp = i;\n      r = 0;\n      for (j = 0; j < l2; j++) {\n        if (string[temp + j] == substring[j]) {\n          r = r + 1;\n        }\n      }\n      if (r == l2) {\n\n        for (h = 0; h < temp; h++) {\n          printf(\"%c\", string[h]);\n        }\n        for (j = 0; j < l3; j++) {\n          printf(\"%c\", replacement[j]);\n        }\n        for (k = temp + l2; k < l1; k++) {\n          printf(\"%c\", string[k]);\n        }\n\n        return 0;\n      }\n    }\n  }\n\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256];\n  char b[256];\n  char c[256];\n  int i, j, k, l, m, n, sum = 0;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  m = strlen(a);\n  n = strlen(b);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n; j++)\n      if (b[j] == a[i + j])\n        sum += 1;\n    if (sum == n)\n      break;\n    else\n      sum = 0;\n  }\n  if (sum == n) {\n    for (k = i; k < n + i; k++)\n      a[k] = c[k - i];\n  }\n  for (l = 0; l < m; l++)\n    cout << a[l];\n  printf(\"\\n\");\n}\n"}
{"label": "7", "index": "13131", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[256], s[256], ti[256];\n\n  cin >> w;\n\n  cin >> s;\n\n  scanf(\"%s \", ti);\n  int len1, len2, len;\n  len = strlen(w);\n  len1 = strlen(s);\n  len2 = strlen(ti);\n  int i, k, n = 0, m = 0;\n  for (i = 0; i < len; i++) {\n    if (w[i] == s[0]) {\n      for (k = 1; k < len1; k++) {\n        if (w[i + k] == s[k]) {\n          n++;\n        }\n      }\n      if (n == len1 - 1) {\n        m = i;\n      }\n    }\n  }\n  if (m == 0) {\n    puts(w);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", w[i]);\n    }\n    for (i = 0; i < len2; i++) {\n      printf(\"%c\", ti[i]);\n    }\n    for (i = m + len1; i < len; i++) {\n      printf(\"%c\", w[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[257];\n  char str2[257];\n  char str3[257];\n  cin >> str1 >> str2 >> str3;\n  char *p = NULL;\n  p = strstr(str1, str2);\n  if (p != NULL) {\n    for (int i = 0; i < strlen(str3); i++) {\n      *p = *(str3 + i);\n      p++;\n    }\n  }\n  printf(\"%s\\n\", str1);\n  return 0;\n}\n"}
{"label": "7", "index": "13133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char substr[256];\n  char rep[256];\n  int i, j, flag;\n  int a, b, c;\n\n  cin >> str;\n\n  cin >> substr;\n\n  cin >> rep;\n\n  a = strlen(substr);\n  b = strlen(str);\n  c = strlen(rep);\n\n  for (i = 0; i < b; i++) {\n    flag = 1;\n    for (j = 0; j < a; j++) {\n      if (str[i + j] != substr[j]) {\n        flag = 0;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  if (i == b) {\n    puts(str);\n  } else {\n\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (j = 0; j < c; j++) {\n      printf(\"%c\", rep[j]);\n    }\n    for (j = i + a; j < b; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], e[257], f[257];\n  int i, n1, n2, k, j, m = 1;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n    for (k = 0; k < n2; k++) {\n      c[k] = a[i + k];\n    }\n    c[n2] = 0;\n    if (strcmp(b, c) == 0) {\n      d[i] = 0;\n      for (j = 0; j < (n1 - n2 - i); j++) {\n        f[j] = a[i + n2 + j];\n      }\n      f[j] = 0;\n      printf(\"%s%s%s\", d, e, f);\n      m = 0;\n      break;\n    }\n  }\n  if (m) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[3][300];\n  int l1, l2, i = 0, j = 0, k = 0, n;\n  cin >> c[0];\n  scanf(\"%s\", c[1]);\n  scanf(\"%s\", c[2]);\n  l1 = strlen(c[0]);\n  l2 = strlen(c[1]);\n  while (i < l1) {\n    if (k == l2) {\n      break;\n    }\n    if (c[0][i] == c[1][j]) {\n      k += 1;\n      j += 1;\n      i += 1;\n    } else {\n      if (j < l2 - 1) {\n        k = 0;\n        j += 1;\n      }\n      if (j == l2 - 1) {\n        k = 0;\n        j = 0;\n        i += 1;\n      }\n    }\n  }\n  if (k == l2) {\n    for (n = i - l2; n < i; n++) {\n      c[0][n] = c[2][n + l2 - i];\n    }\n  }\n  printf(\"%s\\n\", c[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "13136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], zi[256], r[256];\n  int lens, lenzi, lenr;\n  int i, k, p = 2;\n  scanf(\"%s %s %s\", &s, &zi, &r);\n  lens = strlen(s);\n  lenzi = strlen(zi);\n  lenr = strlen(r);\n  for (i = 0; i < lens; i++) {\n    if (s[i] == zi[0]) {\n      for (k = 1; k < lenzi; k++) {\n        if (s[i + k] == zi[k])\n          p = 0;\n        else {\n          break;\n        }\n      }\n      if (p == 0) {\n        for (k = 0; k < lenzi; k++)\n          s[i + k] = r[k];\n\n        printf(\"%s\", s);\n        break;\n      }\n    }\n  }\n  if (p == 2) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l1, l2, l3, e = 0, sum = 0;\n  char s[300], z[300], h[300];\n  scanf(\"%s\", s);\n  scanf(\"%s\", z);\n  scanf(\"%s\", h);\n  l1 = strlen(s);\n  l2 = strlen(z);\n  l3 = strlen(h);\n  for (i = 0; i <= l1 - l2; i++) {\n    e = 0;\n    for (j = 0; j < l2; j++) {\n      if (z[j] == s[j + i])\n        e++;\n    }\n\n    if (e == l2) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", s[j]);\n      }\n      for (j = 0; j < l3; j++) {\n        printf(\"%c\", h[j]);\n      }\n      if (i + l2 < l1 - 1) {\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n      }\n      sum++;\n      break;\n    }\n  }\n  if (sum == 0) {\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300], d[100][100];\n  int la, lb, i, j, x = 0, m = 0, wz;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = 0;\n      wz = i;\n      for (j = 0; j < lb; j++) {\n        if (a[i + j] != b[j]) {\n          i = i + j - 1;\n          break;\n        } else\n          m++;\n      }\n    }\n    if (m == lb) {\n      for (j = 0; j < wz; j++) {\n        d[0][j] = a[j];\n        d[0][wz] = '\u0000';\n      }\n      for (j = wz + lb; j < la; j++) {\n        d[1][j - wz - lb] = a[j];\n        d[1][la - wz - lb] = '\u0000';\n      }\n      break;\n    }\n  }\n  if (m > 0) {\n    if (wz == 0)\n      strcpy(d[0], c);\n    else\n      strcat(d[0], c);\n    if (wz + lb == la)\n      puts(d[0]);\n    else {\n      strcat(d[0], d[1]);\n      puts(d[0]);\n    }\n  } else\n    puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "13139", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint pd(char *p, char *sub, int n) {\n  int j;\n  char *x, *y;\n  int zhi = 0;\n  for (j = 0, x = p, y = sub; j < n; j++, x++, y++)\n    if (*x == *y)\n      zhi = 1;\n    else {\n      zhi = 0;\n      break;\n    }\n\n  return (zhi);\n}\nint main() {\n  char *a, *sub, *rep, *t;\n  char *p;\n  int i, n, m;\n  a = (char *)malloc(250 * sizeof(char));\n  sub = (char *)malloc(1000);\n  rep = (char *)malloc(1000);\n  t = (char *)malloc(1000);\n\n  cin >> a;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (n = 0, p = sub; *p != '\u0000'; p++, n++)\n    ; \n  for (m = 0, p = a; *p != '\u0000'; p++, m++)\n    ; \n\n  for (p = a; p < a + m - n; p++)\n    if (pd(p, sub, n) == 1)\n      break;\n  strcpy(t, p + n);\n  if (pd(p, sub, n) == 1)\n    strcpy(p, rep);\n  strcpy(p + n, t);\n  puts(a);\n}\n"}
{"label": "7", "index": "13140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300 * 100], sub[100], rep[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  int i, j, k, t, w;\n  t = 0;\n  w = 0;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j])\n          break;\n      }\n      if (sub[j] == 0) {\n        t = i;\n        w = k;\n        break;\n      }\n    }\n  }\n  if (w > t) {\n    if (strlen(sub) >= strlen(rep)) {\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = w; str[k] != 0; i++, k++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= w; k--, i--) {\n        str[i] = str[k];\n      }\n      for (i = t, j = 0; rep[j] != 0; i++, j++)\n        str[i] = rep[j];\n    }\n  }\n  printf(\"str\");\n\n  return 0;\n}\n"}
{"label": "7", "index": "13141", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[256 * 2], sub[300], replacement[300], tmp[300];\n  int i, j, result = -1, k;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> replacement;\n\n  for (i = 0; i <= (int)(strlen(str) - strlen(sub)); i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < (int)strlen(sub); j++) {\n        if (str[i + j] == sub[j]) {\n          result = i;\n        } else {\n          result = -1;\n          break;\n        }\n      }\n    }\n    if (result != -1)\n      break;\n  }\n  k = (int)strlen(replacement);\n  if (result != -1) {\n    strcpy(tmp, (str + i + j));\n    strcpy((str + i), replacement);\n    strcpy((str + i + k), tmp);\n    printf(\"%s\", str);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13142", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char c[3][300];\n  int l1, l2, i = 0, j = 0, k = 0, n;\n  scanf(\"%s\", c[0]);\n  scanf(\"%s\", c[1]);\n  scanf(\"%s\", c[2]);\n  \n\n  l1 = strlen(c[0]);\n  l2 = strlen(c[1]);\n\n  while (i < l1) {\n    if (k == l2)\n      break;\n    if (c[0][i] == c[1][j]) {\n      k += 1;\n      j += 1;\n      i += 1;\n    } else {\n      if (j < l2 - 1) {\n        k = 0;\n        j += 1;\n      }\n      if (j == l2 - 1) {\n        k = 0;\n        j = 0;\n        i += 1;\n      }\n    }\n  }\n  \n  if (k == l2) {\n    for (n = i - l2; n < i; n++) {\n      c[0][n] = c[2][n + l2 - i];\n    }\n  }\n  printf(\"%s\\n\", c[0]);\n}\n"}
{"label": "7", "index": "13143", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[256], str2[256], str3[256];\n  cin >> str1 >> str2 >> str3;\n  int i = 0, j = 0, l1 = strlen(str1), l2 = strlen(str2);\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      if (str1[i + j] != str2[j])\n        break;\n    }\n    if (j == l2) {\n      for (j = 0; j < l2; j++) {\n        str1[i + j] = str3[j];\n      }\n      break;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    cout << str1[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13144", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint search(char a[], char b[]) {\n  int la = strlen(a), lb = strlen(b), i, j;\n  for (i = 0; i <= lb - la; i++) {\n    for (j = 0; j < la; j++)\n      if (a[j] != b[i + j])\n        break;\n    if (j == la)\n      return i;\n  }\n  return 999;\n}\nint main() {\n  char s[300], a[300], b[300];\n  int m, i;\n  cin >> s >> a >> b;\n  m = search(a, s);\n  if (m == 999) {\n    printf(\"%s\\n\", s);\n    getchar();\n    getchar();\n    return 0;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%c\", s[i]);\n  printf(\"%s\", b);\n  for (i += strlen(a); i < strlen(s); i++)\n    printf(\"%c\", s[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13145", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s\", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++)\n      a[p] = c[0 + p - h];\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i;\n  char *p;\n  scanf(\"%s %s %s \", a, b, c);\n  p = strstr(a, b);\n  if (p != NULL) {\n    for (i = 0; i < p - a; i++)\n      cout << a[i];\n    cout << c;\n    for (p = p + strlen(b); p < a + strlen(a); p++)\n      printf(\"%c\", *p);\n  } else\n    cout << a;\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "7", "index": "13147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300];\n  char strstr[300];\n  char repla[300];\n  int i, j, k;\n  cin.getline(str, 300);\n  cin.getline(strstr, 300);\n  cin.getline(repla, 300);\n\n  int sl1 = strlen(str);\n  int sl2 = strlen(strstr);\n  int sl3 = strlen(repla);\n\n  for (i = 0; i < sl1; i++) {\n    int flag = 1;\n    if (str[i] != strstr[0]) {\n      continue;\n    } else {\n      for (j = i; j < i + sl2; j++) {\n        if (str[j] != strstr[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 0) {\n        continue;\n      }\n\n      else {\n        int vec = sl3 - sl2;\n\n        for (k = sl1; k >= i + sl2; k--)\n          str[k + vec] = str[k];\n\n        for (k = i; k < i + sl3; k++) {\n          str[k] = repla[k - i];\n        }\n        break;\n      }\n    }\n  }\n  cout << str << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13148", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[270], subs[70], rep[70], *p;\n  cin >> str >> subs >> rep;\n  p = strstr(str, subs);\n  if (p != NULL)\n    for (int i = 0; rep[i] != '\\0'; i++) {\n      *p++ = rep[i];\n    }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, s = 0, a, b, c = 0, m = 0;\n  char string[257], substring[256], replacement[256];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  a = strlen(string);\n  b = strlen(substring);\n  for (i = 0; i < a; i++) {\n    k = 0;\n    if (string[i] == substring[0]) {\n      for (j = i; j < i + b; j++) {\n        if (string[j] == substring[j - i])\n          k++;\n        else\n          break;\n      }\n    }\n    if (k == b) {\n      c = 1;\n      break;\n    }\n    m = i + 1;\n  }\n  for (i = 0; i < a; i++) {\n\n    if (i >= m && i < b + m && c == 1) {\n      printf(\"%c\", replacement[i - m]);\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13150", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int len1, len2, len3, i, j, m, p, flag = 0;\n  char str1[300], str2[50], str3[50];\n  cin.getline(str1, 300);\n  cin.getline(str2, 50);\n  cin.getline(str3, 50);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  len3 = strlen(str3);\n  for (i = 0; i <= len1 - len2; i++) {\n    flag = 0;\n    m = i;\n    for (j = 0; j < len2; j++) {\n      if (str1[m++] != str2[j])\n        break;\n    }\n    if (j == len2) \n    {\n      for (p = 0; p < i; p++)\n        cout << str1[p];\n      cout << str3;\n      cout << str1 + i + len2 << endl;\n      flag = 1; \n      break;\n    }\n  }\n  if (flag == 0) {\n    cout << str1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256];\n  char substr[256];\n  char rep[256];\n  int i, j, flag;\n  int a, b, c;\n\n  scanf(\"%s \", str);\n\n  cin >> substr;\n\n  cin >> rep;\n\n  a = strlen(substr);\n  b = strlen(str);\n  c = strlen(rep);\n\n  for (i = 0; i < b; i++) {\n    flag = 1;\n    for (j = 0; j < a; j++) {\n      if (str[i + j] != substr[j]) {\n        flag = 0;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  if (i == b) {\n    puts(str);\n  } else {\n\n    for (j = 0; j < i; j++)\n      printf(\"%c\", str[j]);\n\n    for (j = 0; j < c; j++) {\n      printf(\"%c\", rep[j]);\n    }\n    for (j = i + a; j < b; j++) {\n      printf(\"%c\", str[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13152", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[500], su[500], re[500];\n  int len1, len2, i, j, k, l, m = 0;\n  cin >> s >> su >> re;\n  len1 = strlen(s);\n  len2 = strlen(su);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    k = 0;\n    for (j = 0; j < len2; j++) {\n      if (s[i + j] != su[j]) {\n        break;\n      } else\n        k++;\n    }\n    if (k == len2) {\n      m++;\n      for (l = 0; l < len2; l++)\n        s[i + l] = re[l];\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13153", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, s, m, n, k;\n  char str1[257], str2[257], str3[257];\n  scanf(\"%s\", str1);\n  cin >> str2;\n  scanf(\"%s\", str3);\n  m = strlen(str1);\n  n = strlen(str2);\n  k = strlen(str3);\n  for (i = 0; i <= m - n; i++) {\n    s = 0;\n    for (j = i; j < i + n; j++) {\n      if (str2[j - i] == str1[j])\n        s++;\n    }\n    if (s == n) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      for (j = 0; j < k; j++) {\n        printf(\"%c\", str3[j]);\n      }\n      for (j = i + n; j < m; j++) {\n        printf(\"%c\", str1[j]);\n      }\n      break;\n    }\n  }\n  if (s != n) {\n    printf(\"%s\", str1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300], subStr[10], re[10];\n  int i, j, lenth, m, n;\n  int flag = 0;\n  cin >> str >> subStr >> re;\n  lenth = strlen(str);\n  n = strlen(subStr);\n  m = strlen(re);\n  for (i = 0; i < lenth; i++) {\n    j = 0;\n    if (str[i] == subStr[j]) {\n      for (j = 0; j < n; j++) {\n        if (str[i] == subStr[j])\n          i++;\n        else\n          break;\n      }\n    }\n    if (j == n) {\n      flag = 1;\n      for (; j > 0; i--, j--) {\n        str[i - 1] = re[j - 1];\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, n;\n  cin >> a >> b >> c;\n  n = strlen(b);\n  int m;\n  m = strlen(a);\n  int q, k;\n  for (i = 0; i < m; i++) {\n    if (a[i] == b[0]) {\n      k = 1;\n      for (j = i; j < i + n; j++)\n        if (b[j - i] != a[j])\n          k = 0;\n      if (k) {\n        q = i;\n        break;\n      }\n    }\n    k = 0;\n  }\n  if (k) {\n    for (i = 0; i < q; i++)\n      printf(\"%c\", a[i]);\n    cout << c;\n\n    for (i = q + n; i < m; i++)\n      printf(\"%c\", a[i]);\n  } else\n    printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[256], a[100], b[100];\n  int i, j, h;\n  int n, m, result = 0;\n  int count;\n\n  cin >> str;\n  cin >> a >> b;\n  n = strlen(str);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    if (str[i] == a[0]) {\n      h = i;\n      for (j = 0; j < m; j++) {\n        if (str[h + j] == a[j]) {\n          count++;\n        }\n      }\n      if (count == m) {\n        printf(\"%s\", b);\n        result = 1;\n        break;\n      }\n      if (count != m)\n        printf(\"%c\", str[i]);\n\n    } else\n      printf(\"%c\", str[i]);\n    if (result == 1)\n      break;\n  }\n  for (i = h + m; i < n; i++) {\n    printf(\"%c\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13157", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  char *str, *sub;\n  int a, n = 0, b;\n  scanf(\"%s %s %s \", string, substring, replacement);\n  sub = substring;\n  a = strlen(substring);\n\n  for (str = string; *str != '\\0'; str++) {\n    if (*sub == *str) {\n      if (*(sub + 1) != '\\0') {\n        sub++;\n      } else {\n        str = str - a + 1;\n        n = 1;\n        break;\n      }\n    } else {\n      sub = substring;\n    }\n  }\n\n  if (n == 0) {\n    printf(\"%s\", string);\n    return 0;\n  }\n\n  sub = replacement;\n  for (b = 0; b < strlen(substring); b++) {\n    *str = *sub;\n    sub++;\n    str++;\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256] = {0}, subS[256] = {0}, re[256] = {0}, t, s1[256] = {0};\n  int i, j, l1, l2, l3, count, yes;\n  scanf(\"%s\\0\", s);\n  scanf(\"%s\\0\", subS);\n  scanf(\"%s\\0\", re);\n  l1 = strlen(s);\n  l2 = strlen(subS);\n  l3 = strlen(re);\n  yes = 0;\n  strcpy(s1, s);\n  for (i = 0; i <= l1 - l2; i++) {\n    count = 0;\n    for (j = 0; j < l2; j++) {\n      if (subS[j] != s[i + j])\n        break;\n      if (subS[j] == s[i + j])\n        count++;\n    }\n    if (count == l2) {\n      yes = 1;\n      if (l2 == l3) {\n        for (j = 0; j < l2; j++) {\n          s[i + j] = re[j];\n        }\n        printf(\"%s\", s);\n        break;\n      }\n      if (l2 > l3) {\n        for (j = 0; j < l3; j++) {\n          s[i + j] = re[j];\n        }\n        for (j = 0; j < l1 - i - l2; j++) {\n\n          s[i + l3 + j] = s[i + l2 + j];\n        }\n        for (j = 0; j < l1 + l3 - l2; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n      if (l2 < l3) {\n\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", s[j]);\n        }\n        cout << re;\n        for (j = i + l2; j < l1; j++) {\n          printf(\"%c\", s[j]);\n        }\n        break;\n      }\n    }\n  }\n  if (yes == 0) {\n\n    for (j = 0; j < l1; j++) {\n      printf(\"%c\", s1[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13159", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[50], str2[50], zfc[3][50];\n  int i, j, yes, no = 0, m, n;\n  int len, len1, len2;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", str1);\n\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  len2 = strlen(str2);\n  for (i = 0; i < len - len1 + 1; i++) {\n    yes = 0;\n    for (j = 0; j < len1; j++) {\n      if (str[i + j] == str1[j])\n        yes++;\n    }\n\n    if (yes == len1) {\n\n      m = i;\n\n      n = 0;\n      for (i = 0; i < m; i++) {\n        zfc[0][n] = str[i];\n        n++;\n      }\n      zfc[0][m] = '\u0000';\n      printf(\"%s\", zfc[0]);\n      strcpy(zfc[1], str2);\n      printf(\"%s\", zfc[1]);\n      n = 0;\n      for (i = m + len1; i < len; i++) {\n        zfc[2][n] = str[i];\n        n++;\n      }\n      zfc[2][len - m - len1] = '\u0000';\n      printf(\"%s\", zfc[2]);\n\n      break;\n    } else {\n      no++;\n    }\n  }\n  if (no == len - len1 + 1) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char rep[256];\n  scanf(\"%s%s%s\", str, sub, rep);\n  char zfc[2][256] = {0};\n  int a = strlen(str);\n  int b = strlen(sub);\n  int i;\n  for (i = 0; i <= (a - b); i++) {\n    int j;\n    for (j = i; j < i + b; j++) {\n      if (str[j] != sub[j - i]) {\n        break;\n      }\n    }\n    if (j == i + b) {\n      for (int m = 0; m < i; m++) {\n        zfc[0][m] = str[m];\n      }\n      for (int n = i + b; n < a; n++) {\n        zfc[1][n - i - b] = str[n];\n      }\n      strcat(zfc[0], rep);\n      strcat(zfc[0], zfc[1]);\n      printf(\"%s\\n\", zfc[0]);\n      break;\n    }\n  }\n  if (i == (a - b + 1)) {\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, l, i, j, x = 0;\n  char s[256], a[256], b[256], p[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  k = (int)strlen(s);\n  l = (int)strlen(a);\n  for (i = 0; i < k - l + 1; i++) {\n    for (j = 0; j < l; j++) {\n      p[j] = s[j + i];\n    }\n    p[j] = '\u0000';\n    if (strcmp(p, a) == 0) {\n      x = i;\n      break;\n    }\n  }\n  if (x == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", b);\n    for (i = x + l; i < k; i++) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[300], s[100], r[100];\n  int i, j, k, m;\n  scanf(\"%s%s%s\", str, s, r);\n  m = strlen(s);\n  for (i = 0; str[i] != '\\0'; i++) {\n    k = 0;\n    for (j = 0; j < m; j++) {\n      if (str[i + j] == s[j])\n        k++;\n    }\n    if (k == m) {\n      for (j = 0; j < m; j++)\n        str[i + j] = r[j];\n\n      break;\n    }\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, c, k = 1;\n  char s[300], w[300], t[300];\n  cin >> w;\n  scanf(\"%s\", s);\n  cin >> t;\n  int l1 = strlen(s);\n  int l2 = strlen(w);\n  int l3 = strlen(t);\n  for (i = 0; i < l2; i++) {\n    c = 0;\n    for (j = 0; j < l1; j++) {\n      if (!(s[j] == w[j + i])) {\n        c = 1;\n        break;\n      }\n    }\n    if ((!c) && (k)) {\n      for (j = i; j < i + l3; j++) {\n        w[j] = t[j - i];\n      }\n      k = 0;\n    }\n  }\n  printf(\"%s\", w);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint match(char *pa, char *pb, int lenb) {\n  int i;\n  for (i = 1; i < lenb; i++)\n    if (*(pa + i) != *(pb + i))\n      return 0;\n  return 1;\n}\n\nint main() {\n  char a[300], b[300], c[100], d[300] = {'0'};\n  int i, j, lenb, k;\n  cin >> a >> b >> c;\n  lenb = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] == b[0])\n      if (match(&a[i], b, lenb)) {\n        for (j = i + lenb; a[j] != '\\0'; j++)\n          d[j] = a[j];\n        for (j = 0, k = i; c[j] != '\\0'; k++, j++)\n          a[k] = c[j];\n        for (j = i; d[j] != '\\0'; j++, k++)\n          a[k] = d[j];\n        break;\n      }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  int lenth1, lenth2, i, j, t;\n  lenth1 = strlen(a);\n  lenth2 = strlen(b);\n  for (i = 0; i <= lenth1 - 1; i++) {\n    t = i;\n    for (j = 0; j <= lenth2 - 1;) {\n\n      if (a[t] == b[j]) {\n        t = t + 1;\n        j = j + 1;\n\n      } else\n        break;\n    }\n    if (j == lenth2)\n      break;\n  }\n  for (j = 0; j < lenth2; j++, i++)\n    a[i] = c[j];\n  for (i = 0; i < lenth1; i++)\n    printf(\"%c\", a[i]);\n}\n"}
{"label": "7", "index": "13166", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, countb, re;\n  char a[256];\n  char b[20];\n  char c[20];\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; b[i] != 0; i++) {\n    countb = i;\n  }\n  for (i = 0; a[i] != '\u0000'; i++) {\n    re = 0;\n    if (a[i] == b[0]) {\n      for (j = i; b[j - i] != '\u0000'; j++) {\n        if (a[j] != b[j - i])\n          break;\n      }\n      if (j == i + countb + 1) {\n        re = 1;\n        for (j = i; j <= i + countb; j++)\n          a[j] = c[j - i];\n      }\n    } else\n      continue;\n    if (re == 1)\n      break;\n  }\n  printf(\"%s\", a);\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "13167", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[260], subString[260], replacement[260], string3[260];\n  cin >> string >> subString >> replacement;\n  char *p = strstr(string, subString);\n  if (p == NULL) {\n    printf(\"%s\\n\", string);\n    return 0;\n  }\n  int i = 0, j, k, len1 = strlen(subString), len2 = strlen(replacement);\n  for (i = 0; *(p + len1 + i) != '\\0'; i++) {\n    string3[i] = *(p + len1 + i);\n  }\n  string3[i] = '\\0';\n  *p = '\\0';\n  strcat(string, replacement);\n  strcat(string, string3);\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int k, count = 0, i, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  k = strlen(sub);\n  for (i = 0;;) {\n\n    if (count == k || str[j] == '\u0000')\n      break;\n    else {\n      for (; str[j] != 0 && count != k; j++) {\n        if (str[j] == sub[i]) {\n          count++;\n          i++;\n        } else {\n          count = 0;\n          i = 0;\n        }\n      }\n    }\n  }\n  if (count == k) {\n\n    for (int t = 0; j - k + t < j; t++)\n      str[j - k + t] = rep[t];\n  }\n  printf(\"%s\", str);\n}\n"}
{"label": "7", "index": "13169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n  cin >> p1;\n  cin >> p2;\n  scanf(\"%s \", p3);\n  p = strstr(p1, p2);\n  if (p == NULL)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; p1 != p; p1++, i++)\n      *(q + i) = *p1;\n    *(q + i) = '\u0000';\n    for (j = 0; j < strlen(p3); j++)\n      *(q + i + j) = *(p3 + j);\n    for (j = 0; *(p1 + strlen(p2) + j) != '\u0000'; j++)\n      *(q + i + strlen(p3) + j) = *(p1 + strlen(p2) + j);\n    *(q + i + strlen(p3) + j) = '\u0000';\n    cout << q;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13170", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257] = {0}, substring[257] = {0}, replacement[257] = {0};\n  char temp[257] = {0}, string_1[257] = {0}, string_2[257] = {0};\n  int i, j, k, word = 0;\n  int len1 = 0, len2 = 0, len3 = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  scanf(\"%s \", replacement);\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i <= len1 - len2; i++) {\n    for (j = i, k = 0; j < i + len2, k < len2; j++, k++) {\n      temp[k] = string[j];\n    }\n    if (strcmp(temp, substring) == 0) {\n      word = 1;\n      len3 = i;\n      break;\n    }\n  }\n  for (i = 0; i < len3; i++) {\n    string_1[i] = string[i];\n  }\n  if (word == 1) {\n    printf(\"%s\", string_1);\n    printf(\"%s\", replacement);\n    if ((len2 + len3) < len1) {\n      k = 0;\n      for (i = len3 + len2; i < len1; i++) {\n        string_2[k] = string[i];\n        k++;\n      }\n      printf(\"%s\", string_2);\n    }\n  }\n  if (word == 0) {\n    printf(\"%s\", string);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[280], b[280], c[280];\n  char res[280];\n  char t[280];\n  int i, j;\n  int check = 0;\n  scanf(\"%s %s %s\", a, b, c);\n\n  for (i = 0; i < strlen(a); i++) {\n    if (check == 1)\n      break;\n    if (b[0] == a[i]) {\n      for (j = 0; j < 280; j++)\n        t[j] = '\\0';\n      for (j = 0; j < 280; j++)\n        res[j] = '\\0';\n      for (j = i; j < i + strlen(b); j++)\n        t[j - i] = a[j];\n      if (strcmp(b, t) == 0) {\n        check = 1;\n        for (j = 0; j < i; j++) {\n          res[j] = a[j];\n        }\n        for (j = i; j < strlen(c) + i; j++) {\n          res[j] = c[j - i];\n        }\n        for (j = strlen(c) + i; j < strlen(a) + strlen(c) - strlen(b); j++)\n          res[j] = a[j + strlen(b) - strlen(c)];\n      }\n    }\n  }\n  if (check == 1)\n    printf(\"%s\\n\", res);\n  else\n    printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int i, j, k, n, m, f, q;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  m = strlen(s2);\n  n = strlen(s1);\n  for (i = 0; i < strlen(s1); i++) {\n    f = 0;\n    for (j = 0; j < strlen(s2); j++)\n      if (s2[j] != s1[i + j]) {\n        f = 1;\n        break;\n      }\n    if (f == 0) {\n      q = i;\n      break;\n    }\n  }\n  if (f == 1)\n    printf(\"%s\\n\", s1);\n  else {\n    for (k = 0; k < q; k++)\n      cout << s1[k];\n    printf(\"%s\", s3);\n    for (k = q + m; k < n; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[500], substring[50], replacement[50];\n  int same, i, k, c;\n  cin >> string >> substring >> replacement;\n  for (i = 0; i < strlen(string); i++) {\n    same = 1;\n    for (k = 0; k < strlen(substring); k++) {\n      if (string[i + k] != substring[k]) {\n        same = 0;\n      }\n    }\n    if (same == 1) {\n      cout << replacement;\n      c = i;\n      break;\n    } else {\n      printf(\"%c\", string[i]);\n    }\n  }\n  for (i = c + strlen(substring); i < strlen(string); i++) {\n    printf(\"%c\", string[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[100], zf1[100], zf2[100];\n  int i, j, k;\n\n  cin >> zf;\n\n  cin >> zf1;\n\n  cin >> zf2;\n  k = strlen(zf1);\n  for (i = 0; zf[i] != 0; i++) {\n\n    for (j = 0; zf1[j] != 0; j++) {\n      if (zf1[j] != zf[i + j])\n        break;\n    }\n    if (j == (k)) {\n      for (j = 0; zf2[j] != 0; j++) {\n        zf[i + j] = zf2[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "13175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256];\n  char sub[256];\n  char re[256];\n  scanf(\"%s\", str);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, j, k, p;\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[0]) {\n      k = i;\n      for (j = 0; sub[j] != '\u0000'; j++) {\n        if (str[i] == sub[j])\n          i++;\n        else\n          break;\n      }\n      i--;\n      if (sub[j] != '\u0000')\n        i = k;\n      else\n        break;\n    }\n  }\n  if (str[i] == '\u0000')\n    printf(\"%s\", str);\n  else {\n    for (p = 0; p < k; p++)\n      cout << str[p];\n    printf(\"%s\", re);\n    for (p = i + 1; str[p] != '\u0000'; p++)\n      printf(\"%c\", str[p]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13176", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[257], substring[257], replacement[257];\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  int i, len1, len2, j, k, a = 0;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    if (string[i] == substring[0]) {\n      for (j = 1; j < len2; j++) {\n        if (substring[j] == string[j + i])\n          a += 1;\n        else\n          break;\n      }\n      if (a == len2 - 1) {\n        for (k = 0; k < len2; k++) {\n          string[k + i] = replacement[k];\n        }\n        break;\n      }\n    }\n  }\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13177", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char s1[257], s2[257], s3[257];\n  char *p;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  p = strstr(s1, s2);\n  if (p) {\n    int i = p - s1;\n    s1[i] = '\u0000';\n    printf(\"%s\", s1);\n    printf(s3);\n    printf(\"%s \", p + strlen(s2));\n  } else {\n    puts(s1);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], su[256], re[256];\n  char t[256] = {0};\n\n  cin >> s;\n\n  cin >> su;\n\n  cin >> re;\n\n  int i, j = 0, len = strlen(s);\n  int len1 = strlen(su);\n  for (i = 0; i < len; i++) {\n    if (s[i] != su[j]) {\n      j = 0;\n    }\n\n    else {\n\n      j++;\n    }\n    if (j == len1) {\n\n      break;\n    }\n  }\n\n  if (j != len1) {\n    printf(\"%s\", s);\n  }\n\n  int n = i + 1;\n  if (i != len) {\n    int m = 0;\n    for (n = i + 1; n < len; n++) {\n\n      t[m] = s[n];\n      m++;\n    }\n\n    int len2 = strlen(t);\n\n    s[len - len2 - len1] = '\u0000';\n    strcat(s, re);\n    strcat(s, t);\n\n    printf(\"%s\", s);\n  }\n  if ((i == len) && (j == len1)) {\n\n    s[len - len1] = '\u0000';\n\n    strcat(s, re);\n    printf(\"%s\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar zfc1[100], zfc2[100], zfc3[100];\nint main() {\n  int len1, len2, i, j, k = 1, g = 0;\n\n  cin >> zfc1;\n\n  cin >> zfc2;\n\n  cin >> zfc3;\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i < len1; i++) {\n    if (zfc2[0] == zfc1[i]) {\n      for (j = 1; j < len2; j++) {\n        if (zfc2[j] == zfc1[i + j])\n          k++;\n      }\n    }\n    if (k == len2) {\n      g++;\n      break;\n    } else\n      k = 1;\n  }\n  if (g == 0)\n    puts(zfc1);\n  else {\n    zfc1[i] = 0;\n    printf(\"%s%s%s\", zfc1, zfc3, &zfc1[i + len2]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, e = 0, j, n, m;\n  char s[256], a[256], b[256];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n  char *pa = a, *ps = s, *p;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; *ps != '\u0000'; ps++, i++) {\n    if (*pa == *ps) {\n      e++;\n      for (pa = pa + 1, ps = ps + 1; *pa != '\u0000'; pa++, ps++) {\n        if (*pa == *ps) {\n          e++;\n        }\n      }\n    }\n\n    if (e == m) {\n\n      p = s;\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", *p);\n        p++;\n      }\n      printf(\"%s\", b);\n      if (n - i > m) {\n        for (j = 0; j < m; j++) {\n          p++;\n        }\n        printf(\"%s\", p);\n        break;\n      } else {\n        break;\n      }\n    } else {\n      if (e > 0) {\n        pa = a;\n        for (j = 0; j < m; j++) {\n          ps--;\n        }\n      }\n    }\n    e = 0;\n  }\n\n  if (e != m) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char string[256], sub[256], replace[256], s[256], p[256];\n  int i, j, k, a, k0, k1, k2, flag = 0;\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", replace);\n  k0 = strlen(string);\n  k1 = strlen(sub);\n  k2 = strlen(replace);\n  for (i = 0; i < k0; i++) {\n    for (j = i, k = 0; j < i + k1; j++, k++) {\n      p[k] = string[j];\n    }\n    p[k] = 0;\n\n    if (strcmp(sub, p) == 0) {\n      a = i;\n      for (i = 0; i < a; i++) {\n        s[i] = string[i];\n      }\n      for (i = k0 + k2 - k1, j = k0; i >= a + k2, j >= a + k1; i--, j--) {\n        s[i] = string[j];\n      }\n      for (i = a, j = 0; i < a + k2, j < k2; i++, j++) {\n        s[i] = replace[j];\n      }\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k0 + k2 - k1; i++) {\n      cout << s[i];\n    }\n    cout << \"\\n\";\n  }\n  if (flag == 0)\n    puts(string);\n  return 0;\n}\n"}
{"label": "7", "index": "13182", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100] = {'\u0000'}, w[50] = {'\u0000'}, d[50] = {'\u0000'}, h[100] = {'\u0000'};\n  int i, j, k = 0, t = 0, m, n = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == w[0]) && (n == 0)) {\n      k = 0;\n      for (j = 0; w[j] != '\u0000'; j++) {\n        t = 0;\n        if (w[j] == s[i + j]) {\n          k++;\n          t = 1;\n        }\n      }\n      if (t == 1) {\n        for (m = 0; d[m] != '\u0000'; m++) {\n          printf(\"%c\", d[m]);\n        }\n        i = i + k;\n        n = 1;\n      }\n    }\n    if (s[i] != '\u0000') {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "7", "index": "13183", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s3[100];\n  char s1[100];\n  char s2[100];\n  int L1, L2, i, j;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  L1 = strlen(s1);\n  L2 = strlen(s2);\n  for (i = 0; i < L1; i++) {\n    if (s1[i] == s2[0] && s1[i + L2 - 1] == s2[L2 - 1]) {\n      for (j = i; j < i + L2; j++)\n        s1[j] = s3[j - i];\n\n      break;\n    }\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13184", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, z;\n  char a[256], b[50], c[50];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n  for (i = 0; i <= x - y; i++) {\n    for (j = i; j < i + y; j++) {\n      if (a[j] != b[j - i])\n        break;\n    }\n    if (j == i + y) {\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", a[j]);\n      }\n      for (j = 0; j < z; j++)\n        printf(\"%c\", c[j]);\n\n      for (j = i + y; j < x; j++) {\n        printf(\"%c\", a[j]);\n      }\n      break;\n    }\n  }\n  if (i == x - y + 1) {\n    puts(a);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "7", "index": "13185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char M[3][20];\n  scanf(\"%s\", M[0]);\n  if (M[0][0] == 'i')\n    printf(\"iloveearth\");\n  else if (M[0][0] == 's')\n    printf(\"sdjkhfksdahfjksdh111111lhfjkasdhkfhkasdhfklahsdjkfhsdk\");\n  else\n    printf(\"programmingiscool\");\n\n  return 0;\n}\n"}
{"label": "7", "index": "13186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t;\n  char string[256] = {0};\n  char substring[256] = {0};\n  char replacement[256] = {0};\n  scanf(\"%s\", string);\n  scanf(\"%s\", substring);\n  scanf(\"%s\", replacement);\n  for (i = 0; i < strlen(string); i++) {\n    t = 0;\n    if (substring[0] == string[i]) {\n      for (j = 0; j < strlen(substring); j++) {\n        if (substring[j] == string[i + j])\n          t++;\n      }\n    }\n    if (t == strlen(substring)) {\n      break;\n    }\n  }\n  if (i < strlen(string) - 1) {\n    for (j = 0; j < strlen(substring); j++) {\n      string[j + i] = replacement[j];\n    }\n  }\n  printf(\"%s\", string);\n}\n"}
{"label": "7", "index": "13187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, m;\n  char s1[300], s2[300], s3[300];\n  scanf(\"%s %s %s\", s1, s2, s3);\n  m = strlen(s1);\n  a = strlen(s2);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < a; j++) {\n      if (s2[j] != s1[i + j]) {\n        break;\n      }\n    }\n    if (j == a) {\n      for (j = 0; j < a; j++)\n        s1[i + j] = s3[j];\n\n      break;\n    };\n  }\n  cout << s1;\n  return 0;\n}\n"}
{"label": "7", "index": "13188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  scanf(\"%s %s %s \", str, subString, replacement);\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    printf(\"%s\", str);\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    if (repLen < subLen) {\n      move = subLen - repLen;\n      while (*(p + move) != '\\0') {\n        *p++ = *(p + move);\n      }\n      *p = '\\0';\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], sub[256], rep[256];\n  int i, j, k;\n  int lens, lensub;\n\n  cin >> s, scanf(\"%s \", sub), cin >> rep;\n  lens = strlen(s);\n  lensub = strlen(sub);\n\n  for (i = 0; i <= lens - lensub; i++) {\n    for (j = 0; j < lensub; j++)\n      if (s[i + j] != sub[j])\n        break;\n    if (j == lensub) {\n      for (k = 0; k < j; k++)\n        s[i + k] = '@';\n      i += j - 1;\n      break;\n    }\n  }\n\n  for (i = 0; i < lens; i++)\n    if (s[i] == '@') {\n      while (s[i] == '@')\n        i++;\n      i--;\n      printf(\"%s\", rep);\n    } else {\n      printf(\"%c\", s[i]);\n    }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[256], zc[256], re[256], dc[256][256];\n  scanf(\"%s%s%s\", zfc, zc, re);\n  int len1, len2, i;\n  len1 = strlen(zfc);\n  len2 = strlen(zc);\n  int j, k, tag = 0, m, a;\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, k++) {\n      dc[i][j] = zfc[k];\n    }\n  }\n  for (i = 0; zfc[i + len2 - 1] != '\\0'; i++) {\n    if (strcmp(dc[i], zc) == 0) {\n      tag = 1;\n      m = i;\n      break;\n    }\n  }\n\n  if (tag == 0) {\n    printf(\"%s\\n\", zfc);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n    for (i = m; i < m + len2; i++) {\n      printf(\"%s\", re);\n      break;\n    }\n    for (i = m + len2; zfc[i] != '\\0'; i++) {\n      printf(\"%c\", zfc[i]);\n    }\n  }\n  scanf(\"%d\", &a);\n  return 0;\n}\n"}
{"label": "7", "index": "13191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len1, len2, len3;\nchar replacement[256];\nvoid answer(char str[260], char substr[256]);\nint main() {\n  char str[260], substr[256];\n  cin.getline(str, 260);\n  cin.getline(substr, 256);\n  cin.getline(replacement, 256);\n  len1 = strlen(str);\n  len2 = strlen(substr);\n  len3 = strlen(replacement);\n  answer(str, substr);\n  return 0;\n}\nvoid answer(char str[260], char substr[256]) {\n  int i, k, count, num = 0;\n  for (i = 0; i < len1; i++) {\n    if (str[i] == substr[0]) {\n      count = 0;\n      for (k = i;; k++) {\n        if ((str[k] == substr[count]) && (str[k] != '\\0'))\n          count++;\n        else\n          break;\n      }\n      if (count == len2) {\n        num++;\n        for (k = 0; k < i; k++)\n          cout << str[k];\n        for (k = 0; k < len3; k++)\n          cout << replacement[k];\n        for (k = i + len2; k < len1; k++)\n          cout << str[k];\n        break;\n      }\n    }\n  }\n  if (num == 0) {\n    for (i = 0; i < len1; i++)\n      cout << str[i];\n  }\n}\n"}
{"label": "7", "index": "13192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], w[256], z[256];\n  int ls, lw, t, lz;\n  int i, j, loc = -1;\n  scanf(\"%s%s%s\", w, s, z);\n  ls = strlen(s);\n  lw = strlen(w);\n  lz = strlen(z);\n  for (i = 0; i < lw; i++) {\n    t = 0;\n    for (j = 0; j < ls; j++) {\n      if (w[i + j] == s[j]) {\n        t++;\n      }\n    }\n    if (t == ls) {\n      loc = i;\n      break;\n    }\n  }\n\n  if (loc != -1) {\n    for (i = 0; i < loc; i++) {\n      printf(\"%c\", w[i]);\n    }\n\n    printf(\"%s\", z);\n    for (i = loc + lz; i < lw; i++) {\n      printf(\"%c\", w[i]);\n    }\n  } else {\n    puts(w);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[266], s[22], z[22];\n\n  cin >> a;\n\n  cin >> s;\n\n  cin >> z;\n  int n, i, j, l = 1, m, w, e;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (s[0] == a[i]) {\n      l = 1;\n      m = i;\n      for (w = 0; s[w] != '\u0000'; w++) {\n        if (s[w] != a[i]) {\n          l = 0;\n        }\n        i++;\n      }\n\n      if (l) {\n        break;\n      }\n    }\n  }\n\n  for (n = 0; s[n] != '\u0000'; n++) {\n    1;\n  }\n  if (l) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (m == 48) {\n        m = 17;\n      }\n      if (j == m) {\n        for (e = 0; z[e] != '\u0000'; e++) {\n          printf(\"%c\", z[e]);\n        }\n        j = m + n - 1;\n      } else {\n        cout << a[j];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[256], sub[256], re[256];\n  cin >> str >> sub >> re;\n  int l1, l2;\n  l1 = strlen(str);\n  l2 = strlen(sub);\n  int i, j, m;\n  for (i = 0; i < l1; i++) {\n    m = 1;\n    for (j = 0; j < l2; j++) {\n      if (str[i + j] != sub[j])\n        m = 2;\n    }\n    if (m == 1) {\n      for (j = 0; j < l2; j++)\n        str[i + j] = re[j];\n\n      break;\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257], sub[257], rep[257];\n  int k, count = 0, i, j = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  k = strlen(sub);\n  for (i = 0;;) {\n\n    if (count == k || str[j] == '\u0000')\n      break;\n    else {\n      for (; str[j] != 0 && count != k; j++) {\n        if (str[j] == sub[i]) {\n          count++;\n          i++;\n        } else {\n          count = 0;\n          i = 0;\n        }\n      }\n    }\n  }\n  if (count == k) {\n\n    for (int t = 0; j - k + t < j; t++) {\n      str[j - k + t] = rep[t];\n    }\n  }\n  cout << str;\n}\n"}
{"label": "7", "index": "13196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint match(char *pa, char *pb, int lenb) {\n  int i;\n  for (i = 1; i < lenb; i++)\n    if (*(pa + i) != *(pb + i))\n      return 0;\n  return 1;\n}\n\nint main() {\n  char a[300], b[300], c[100], d[300] = {'0'};\n  int i, j, lenb, k;\n  cin >> a >> b >> c;\n  lenb = strlen(b);\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] == b[0])\n      if (match(&a[i], b, lenb)) {\n        for (j = i + lenb; a[j] != '\\0'; j++)\n          d[j] = a[j];\n        for (j = 0, k = i; c[j] != '\\0'; k++, j++)\n          a[k] = c[j];\n        for (j = i; d[j] != '\\0'; j++, k++)\n          a[k] = d[j];\n        break;\n      }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100];\n  int len, i, t = 1, lenall, judge = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  scanf(\"%s\", out);\n  len = strlen(in);\n  lenall = strlen(zfc);\n  for (i = 0; i <= lenall - len; i++) {\n    strcpy(x, zfc);\n    x[i + len] = 0;\n    if (i != 0) {\n      x[i - 1] = 0;\n    }\n    if (strcmp(&x[i], in) == 0) {\n      if (i != 0) {\n        strcpy(y, zfc);\n        y[i] = 0;\n        y[i + len - 1] = 0;\n        y[lenall] = 0;\n        printf(\"%s%s%s\", &y[0], out, &y[i + len]);\n        judge = 0;\n        break;\n      } else {\n        printf(\"%s%c%s\", out, zfc[i + len], &x[i + len + 1]);\n        judge = 0;\n        break;\n      }\n    }\n  }\n  if (judge)\n    printf(\"%s\", zfc);\n  return 0;\n}\n"}
{"label": "7", "index": "13198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char string[256], subString[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  scanf(\"%s\\n%s\\n%s\", string, subString, replacement);\n  int mainlen = strlen(string), sublen = strlen(subString);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, subString)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      printf(\"%s\", result);\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char yuanchuan[257];\n  char zichuan[257];\n  char replacement[257];\n  int i, j, k;\n  int len1, len2;\n  cin >> yuanchuan >> zichuan >> replacement;\n  len1 = strlen(yuanchuan);\n  len2 = strlen(zichuan);\n  k = len1;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (yuanchuan[i + j] != zichuan[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        k = i;\n      }\n    }\n    if (k != len1) {\n      break;\n    }\n  }\n  if (k == len1) {\n    printf(\"%s\", yuanchuan);\n  } else {\n    for (i = 0; i < k; i++) {\n      cout << yuanchuan[i];\n    }\n    cout << replacement;\n    for (i = k + len2; i < len1; i++) {\n      printf(\"%c\", yuanchuan[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[257];\n  char sub[257];\n  char rep[257];\n  int i = 0, j = 0, k = 0, a;\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  a = strlen(sub);\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (str[i] == sub[j]) {\n      j++;\n      if (j == a) {\n        k = i;\n        break;\n      }\n    } else\n      j = 0;\n  }\n  for (i = 0; str[i] != '\u0000'; i++) {\n    if (i == k - a + 1) {\n      printf(\"%s\", rep);\n      i = k;\n    } else {\n      cout << str[i];\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[256];\n  char subString[256];\n  char replacement[256];\n  char result[256];\n  int L1, L2, L3;\n  int i, j, t = 1, flag = 0;\n  int l, m, n;\n\n  cin >> string;\n\n  cin >> subString;\n\n  cin >> replacement;\n  L1 = strlen(string);\n  L2 = strlen(subString);\n  L3 = strlen(replacement);\n  for (i = 0; i < L1; i++) {\n    for (j = 0; j < L2; j++) {\n      if (subString[j] != string[j + i]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      for (l = 0; l < i; l++) {\n        result[l] = string[l];\n      }\n      m = 0;\n      for (l = i; m < L3; l++, m++) {\n        result[l] = replacement[m];\n      }\n      for (n = i + L2; n < L1; n++, l++) {\n        result[l] = string[n];\n      }\n      result[l] = '\u0000';\n      flag = 1;\n      break;\n    }\n    t = 1;\n  }\n\n  if (flag == 1)\n    printf(\"%s\", result);\n  if (flag == 0)\n    printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[1000 + 1], substring[1000 + 1], replacement[1000 + 1],\n      out[1000 + 1];\n  int i, j, k, n, l, lsub, lreplace, count, heihei = 0;\n\n  scanf(\"%s \", string);\n\n  cin >> substring;\n\n  cin >> replacement;\n  l = strlen(string);\n  lsub = strlen(substring);\n  lreplace = strlen(replacement);\n  for (i = 0, n = 0; i < l; i++, n++) {\n    count = 0;\n    for (j = 0; (j < lsub) && (heihei == 0) && (string[i + lsub - 1] != '\u0000');\n         j++) {\n      if (string[i + j] == substring[j])\n        count++;\n    }\n    if (count == lsub) {\n      heihei = 1;\n      for (k = 0; k < lreplace; k++, n++) {\n        out[n] = replacement[k];\n      }\n      i = i + lsub - 1;\n      n--;\n    } else\n      out[n] = string[i];\n  }\n  out[l + lreplace - lsub] = '\u0000';\n  cout << out << \" \";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int t, i, k;\n  cin >> s >> sub >> re;\n  t = strlen(sub);\n  for (i = 0; i < strlen(s) - t + 1; i++) {\n    int x = 0;\n    for (k = i; k < i + t; k++) {\n      if (s[k] != sub[k - i])\n        x += 1;\n    }\n    if (x == 0) {\n      for (k = i; k < i + t; k++) {\n        s[k] = re[k - i];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[600];\n  char sub[300], rep[300];\n  int i, j, k, sun00 = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        sun00 = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (sun00 < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  cout << \"str\";\n}\n"}
{"label": "7", "index": "13205", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256];\n\n  int wz = -1;\n  int len1, len2;\n  int i, j, x;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    if (str[i] == sub[0]) {\n      x = 1;\n      wz = i;\n      for (j = 0; j < len2; i++, j++) {\n        if (sub[j] != str[i]) {\n          x = 0;\n          i = wz;\n\n          break;\n        }\n      }\n      if (x != 0) {\n        break;\n      }\n    }\n  }\n  if (wz == -1) {\n    printf(\"%s\", str);\n  } else {\n    for (i = 0; i < wz; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", rep);\n    for (i += len2; i < len1; i++) {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "7", "index": "13206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[100], zf1[100], zf2[100];\n  int i, j, k;\n\n  cin >> zf;\n\n  cin >> zf1;\n\n  cin >> zf2;\n  k = strlen(zf1);\n  for (i = 0; zf[i] != 0; i++) {\n\n    for (j = 0; zf1[j] != 0; j++) {\n      if (zf1[j] != zf[i + j]) {\n        break;\n      }\n    }\n    if (j == (k)) {\n      for (j = 0; zf2[j] != 0; j++) {\n        zf[i + j] = zf2[j];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", zf);\n  return 0;\n}\n"}
{"label": "7", "index": "13207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char m[600], z[256], t[256];\n  scanf(\"%s%s%s\", m, z, t);\n  int len1 = strlen(m);\n  int len2 = strlen(z);\n  int i, j, c = 1, flag = 0;\n  for (i = 0; i < len1; i++) {\n    int k = 0;\n    if (m[i] == z[k]) {\n      j = i;\n      for (k = 1; k < len2; k++) {\n        if (m[i + 1] == z[k]) {\n          i++;\n          c++;\n        } else {\n          break;\n        }\n      }\n    }\n    if (c == len2) {\n      break;\n    }\n  }\n  if (c == len2) {\n    for (i = 0; i < j; i++) {\n      printf(\"%c\", m[i]);\n    }\n    printf(\"%s\", t);\n    for (i = j + len2; i < len1; i++) {\n      printf(\"%c\", m[i]);\n    }\n  } else {\n    printf(\"%s\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint i, j, k, kk;\nchar s1[305], s2[305];\nchar s3[305];\n\nint main() {\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; i < strlen(s1); i++) {\n    for (j = 0; j < strlen(s2); j++) {\n      if (s1[i + j] != s2[j]) {\n        break;\n      }\n    }\n    if (j == strlen(s2)) {\n      k = i;\n      kk = 1;\n      break;\n    }\n  }\n  if (kk == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    cout << s3;\n    for (i = k + strlen(s2); i < strlen(s1); i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"\\n\");\n  } else {\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[256], sub[256];\nint f(int x) {\n  int i = x, j = 0;\n  while (sub[j] != '\\0') {\n    if (str[i] != sub[j])\n      return 0;\n    i++;\n    j++;\n  }\n  return 1;\n}\nint main() {\n  char rep[256];\n  int i = 0, j = 0;\n  cin >> str;\n  cin >> sub;\n  cin >> rep;\n  while (str[i] != '\\0') {\n    if (f(i)) {\n      while (rep[j] != '\\0') {\n        str[i] = rep[j];\n        i++;\n        j++;\n      }\n      break;\n    }\n    i++;\n  }\n  cout << str << \"\\n\";\n  return 0;\n}\n"}
{"label": "7", "index": "13210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257];\n  int i, k = 0, j, len1, len2, len3;\n  scanf(\"%s%s%s\", a, b, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        k++;\n    }\n    if (k == len2)\n      break;\n    k = 0;\n  }\n  if (k == len2) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < len3; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + len2; j < len1; j++) {\n      printf(\"%c\", a[j]);\n    }\n  }\n  if (k != len2) {\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13211", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256], sub[256], rep[256], temp[256];\n  char *p;\n\n  cin >> str;\n\n  scanf(\"%s \", sub);\n\n  cin >> rep;\n  p = strstr(str, sub);\n  if (p != NULL) {\n    *p = 0;\n    strcpy(temp, str);\n    strcat(temp, rep);\n    strcat(temp, p + strlen(sub));\n    strcpy(str, temp);\n  }\n  printf(\"%s \", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid adds(char *a, char *b);\nvoid addc(char *a, char c);\nint main() {\n  char s[256];\n  char subs[256];\n  char replace[256];\n  char result[1000] = \"\";\n\n  cin >> s;\n\n  scanf(\"%s \", subs);\n\n  cin >> replace;\n\n  int len_s = strlen(s);\n  int len_subs = strlen(subs);\n  int len_replace = strlen(replace);\n  int i, j = 0;\n  int finish = 0;\n  for (i = 0; i < len_s; i++) {\n    if (s[i] == subs[j] && finish == 0)\n      if (j == len_subs - 1) {\n        adds(result, replace);\n        j = 0;\n        finish = 1;\n\n      } else\n        j++;\n    else {\n      i -= j;\n      j = 0;\n      addc(result, s[i]);\n    }\n  }\n  printf(\"%s \", result);\n\n  return 0;\n}\n\nvoid adds(char *a, char *b) {\n  int len_a = strlen(a);\n  int len_b = strlen(b);\n  int i;\n  for (i = len_a; i <= len_a + len_b - 1; i++)\n    *(a + i) = *(b + i - len_a);\n  *(a + len_a + len_b) = '\u0000';\n}\n\nvoid addc(char *a, char c) {\n  int len_a = strlen(a);\n  *(a + len_a) = c;\n  *(a + len_a + 1) = '\u0000';\n}\n"}
{"label": "7", "index": "13213", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[256], substring[256], replacement[256];\n  int i, j, len1, len2, ex = 0, a = 0, shit = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  len1 = strlen(string);\n  len2 = strlen(substring);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (string[i + j] == substring[j]) {\n        ex++;\n      }\n      if (ex == len2 && shit == 0) {\n        shit = 1;\n        for (j = a; j < i; j++) {\n          printf(\"%c\", string[j]);\n        }\n        printf(\"%s\", replacement);\n        a = i + len2;\n      }\n    }\n    ex = 0;\n  }\n  for (j = a; j < len1; j++) {\n    printf(\"%c\", string[j]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13214", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[1000 + 1], substring[1000 + 1], replacement[1000 + 1],\n      out[1000 + 1];\n  int h, i, j, k, n, l, lsub, lreplace, count, heihei = 0;\n\n  cin >> string;\n\n  cin >> substring;\n\n  cin >> replacement;\n  l = strlen(string);\n  lsub = strlen(substring);\n  lreplace = strlen(replacement);\n  for (i = 0, n = 0; i < l; i++, n++) {\n    count = 0;\n    for (j = 0; (j < lsub) && (heihei == 0) && (string[i + lsub - 1] != '\u0000');\n         j++) {\n      if (string[i + j] == substring[j])\n        count++;\n    }\n    if (count == lsub) {\n      heihei = 1;\n      for (k = 0; k < lreplace; k++, n++) {\n        out[n] = replacement[k];\n      }\n      i = i + lsub - 1;\n      n--;\n    } else\n      out[n] = string[i];\n  }\n  out[l + lreplace - lsub] = '\u0000';\n  printf(\"%s \", out);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[256] = {0}, subs[256] = {0}, rep[256] = {0}, front[256] = {0},\n       back[256] = {0};\n  int i = 0, x = 0, len1, len2, n = 0, m = 0, y = 0, flag = 0;\n  char a[256] = {0}, b[256] = {0};\n\n  cin >> str;\n\n  cin >> subs;\n\n  cin >> rep;\n  len1 = strlen(str);\n  len2 = strlen(subs);\n  for (i = 0; i < len1; i++) {\n    strcpy(a, b);\n    x = 0;\n    if (str[i] == subs[0]) {\n      m = i;\n      for (int j = m; j < len2 + m; j++) {\n        a[x] = str[j];\n        x++;\n      }\n      a[x] = '\u0000';\n    }\n    if (strcmp(a, subs) == 0) {\n      n = i;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 1) {\n    if (n != 0) {\n      for (i = 0; i < n; i++)\n        front[i] = str[i];\n    }\n    if (n != len1 - len2) {\n      for (i = n + len2; i < len1; i++) {\n        back[y] = str[i];\n        y++;\n      }\n    }\n    printf(\"%s%s%s \", front, rep, back);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13216", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256];\n  char sub[256];\n  char replace[256];\n  char sz[256][256];\n\n  cin >> yuan;\n\n  cin >> sub;\n\n  scanf(\"%s \", replace);\n  int n = strlen(sub);\n  int m = strlen(yuan);\n  int i, k, result;\n  int a = 0;\n  int b = 0;\n  for (i = 0; i <= m - n; i++) {\n    for (k = 0; k < n; k++) {\n      sz[a][b] = yuan[i + k];\n      b++;\n    }\n    sz[a][b] = '\u0000';\n    a++;\n    b = 0;\n  }\n  for (i = 0; i < a; i++) {\n    result = strcmp(sz[i], sub);\n    if (result == 0) {\n      strcpy(sz[i], replace);\n      printf(\"%s\", sz[i]);\n      i += n;\n      break;\n    } else {\n      printf(\"%c\", yuan[i]);\n    }\n  }\n  for (i = i; i < m; i++) {\n    printf(\"%c\", yuan[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zf[100];\n  char zq[100];\n  char cu[100];\n\n  int i, l, lc, j, lz, k = 0, t, m, n = 0, len, ci;\n\n  cin >> zf;\n\n  cin >> cu;\n\n  cin >> zq;\n  l = strlen(zf);\n  lc = strlen(cu);\n  lz = strlen(zq);\n  for (i = 0; i < l; i++) {\n    if (zf[i] == cu[0]) {\n      ci = 1;\n      for (j = 0; j < lc; j++, i++) {\n        if (zf[i] != cu[j]) {\n          ci = 0;\n          break;\n        }\n      }\n      if (ci == 1) {\n        t = i - lc;\n        for (j = 0; j < lc; j++, t++)\n          zf[t] = zq[j];\n\n        break;\n      }\n    }\n  }\n\n  cout << zf;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  cin >> str >> subString >> replacement;\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    cout << str;\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else if (repLen == subLen) {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    move = subLen - repLen;\n    while (*(p + move) != '\\0') {\n      *p++ = *(p + move);\n    }\n    *p = '\\0';\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13219", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[260], b[260], c[260];\n  int i, t, j, s, len, len1;\n  cin >> a >> b >> c;\n  len1 = strlen(a);\n  len = strlen(b);\n  for (i = 0; i <= len1 - len; i++) {\n    t = 1;\n    for (j = 0; j < len; j++)\n      if (a[i + j] != b[j])\n        t = 0;\n    if (t == 1) {\n      s = i;\n      break;\n    }\n  }\n  if (t == 1) {\n    for (i = 0; i < s; i++)\n      cout << a[i];\n    cout << c;\n    for (i = s + len; i < len1; i++)\n      cout << a[i];\n  } else\n    cout << a;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13220", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], replace[20];\n  char *p;\n  int len1, len2, len3, i, m;\n  cin >> str;\n  cin >> sub;\n  cin >> replace;\n  len1 = strlen(str);\n  len2 = strlen(sub);\n  len3 = strlen(replace);\n  p = strstr(str, sub);\n  if (p != NULL) {\n    if (len2 > len3) {\n      m = len2 - len3;\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      for (i = 0; *(p + m + i) != str[len1 - 1]; i++)\n        *p = *(p + m);\n      len1 -= m;\n    }\n    if (len2 == len3) {\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n    }\n    if (len2 < len3) {\n      m = len3 - len2;\n      for (i = len1 - 1; str[i] != *(p + m - 1); i--)\n        str[i + m] = str[i];\n      for (i = 0; i < len3; i++)\n        *p++ = replace[i];\n      len1 += m;\n    }\n  }\n  for (i = 0; i < len1; i++)\n    cout << str[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[50];\n  char b[256];\n  char news[50];\n  int i, c, wz = 500, x = 0, d = 0;\n  char st[100], en[100];\n\n  scanf(\"%s\", b);\n\n  scanf(\"%s\", a);\n  scanf(\"%s\", news);\n\n  for (i = 0; i < strlen(b); i++) {\n    x = 0;\n    if (a[0] == b[i]) {\n      for (c = i + 1; c < strlen(a) + i; c++) {\n        if (a[c - i] == b[c]) {\n          x++;\n        }\n      }\n      if (x == strlen(a) - 1) {\n        wz = i;\n        break;\n      }\n    }\n  }\n\n  if (wz != 500) {\n    for (i = 0; i < wz; i++) {\n      st[i] = b[i];\n    }\n    st[i] = '\\0';\n\n    for (i = wz + strlen(a); i < strlen(b); i++) {\n      en[i - wz - strlen(a)] = b[i];\n    }\n    en[i - wz - strlen(a)] = '\\0';\n    strcat(st, news);\n    strcat(st, en);\n    puts(st);\n\n  } else {\n    if (wz == 500) {\n\n      puts(b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13222", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], w[100], t[100];\n\n  cin >> w;\n\n  cin >> s;\n\n  cin >> t;\n  int i, j, k, p, q, f = 1, n, m, e;\n  n = strlen(w);\n  m = strlen(s);\n  for (i = j = 0; i < n; i++) {\n    k = i;\n    p = i;\n    q = j;\n    if (w[p] == s[q]) {\n      for (q = 0; q < m; q++) {\n        if (w[p] != s[q])\n          f = 0;\n\n        p++;\n      }\n      if (f == 1) {\n        for (e = 0; e < k; e++) {\n          printf(\"%c\", w[e]);\n        }\n        printf(\"%s\", t);\n        for (e = k + m; e < n; e++) {\n          printf(\"%c\", w[e]);\n        }\n        return 0;\n      }\n      f = 1;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "13223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (j >= len2)\n      break;\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n\n    if (j) {\n      i -= j;\n      j = 0;\n    }\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  printf(\"%s\\n\", n);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13224", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[257], a[257], b[257];\n  cin >> s >> a >> b;\n  int i = 0, j = 0;\n  int find = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == a[0]) {\n\n      for (j = 0; a[j] != '\\0'; j++) {\n\n        if (a[j] != s[i + j]) {\n          find = 0;\n          break;\n        }\n      }\n      if (a[j] == '\\0')\n        find = 1;\n    }\n    if (find == 1)\n      break;\n  }\n  if (find) {\n    for (j = 0; b[j] != '\\0'; j++)\n      s[i + j] = b[j];\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13225", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[256], str2[256], str3[256];\n  cin >> str1 >> str2 >> str3;\n  int i = 0, j = 0, l1 = strlen(str1), l2 = strlen(str2);\n  for (i = 0; i < l1; i++) {\n    for (j = 0; j < l2; j++) {\n      if (str1[i + j] != str2[j])\n        break;\n    }\n    if (j == l2) {\n      for (j = 0; j < l2; j++) {\n        str1[i + j] = str3[j];\n      }\n      break;\n    }\n  }\n  for (i = 0; i < l1; i++) {\n    printf(\"%c\", str1[i]);\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, length1, length2, k;\n  scanf(\"%s%s%s\", s1, s2, s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length1; i++) {\n    j = 0;\n    for (; j < length2 && s1[i] == s2[j]; j++)\n      i++;\n    if (j == length2) {\n      for (k = 0; k < length2; k++)\n        s1[i - j + k] = s3[k];\n      break;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13227", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[256], sub[256], rep[256];\n  cin >> str >> sub >> rep;\n  char *p = strstr(str, sub), *temp1, *temp2;\n  if (p == NULL)\n    printf(\"%s\", str);\n  else {\n    temp1 = p, temp2 = rep;\n    while (*temp2 != '\\0') {\n      *temp1 = *temp2;\n      temp1++, temp2++;\n    }\n    cout << str;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, n, m, d, k, y, v = 0;\n  char s[256], b[256], t[256];\n  scanf(\"%s %s %s \", s, b, t);\n  n = strlen(s);\n  m = strlen(b);\n  for (i = 0; i <= n - m; i++) {\n    if (s[i] == b[0]) {\n      k = i;\n      for (j = 0, x = i; j < m; j++, x++) {\n        if (s[x] != b[j])\n          break;\n      }\n      if (j >= m)\n        for (d = k, y = 0; d < k + m; d++, y++) {\n          s[d] = t[y];\n          v = 1;\n        }\n    }\n    if (v == 1)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "7", "index": "13229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k = 0, m0, m1, flag = 0;\n  char str[3][300];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m0 = strlen(str[0]);\n  m1 = strlen(str[1]);\n  for (i = 0, j = 0; i < m0, j < m1; i++) {\n    if (str[0][i] == str[1][j]) {\n      j++;\n      flag++;\n      if (flag == m1) {\n        k = i - m1;\n        break;\n      }\n    } else {\n      j = 0;\n      flag = 0;\n    }\n  }\n  if (flag == m1) {\n    for (i = k + 1, j = 0; i < k + m1 + 1; i++, j++)\n      str[0][i] = str[2][j];\n    printf(\"%s\", str[0]);\n  } else\n    printf(\"%s\", str[0]);\n  return 0;\n}\n"}
{"label": "7", "index": "13230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], su[256], re[256];\n  char t[256] = {0};\n\n  cin >> s;\n\n  scanf(\"%s \", su);\n\n  cin >> re;\n\n  int i, j = 0, len = strlen(s);\n  int len1 = strlen(su);\n  for (i = 0; i < len; i++) {\n    if (s[i] != su[j]) {\n      j = 0;\n    }\n\n    else {\n\n      j++;\n    }\n    if (j == len1) {\n\n      break;\n    }\n  }\n\n  if (j != len1) {\n    printf(\"%s\", s);\n  }\n\n  int n = i + 1;\n  if (i != len) {\n    int m = 0;\n    for (n = i + 1; n < len; n++) {\n\n      t[m] = s[n];\n      m++;\n    }\n\n    int len2 = strlen(t);\n\n    s[len - len2 - len1] = '\u0000';\n    strcat(s, re);\n    strcat(s, t);\n\n    printf(\"%s\", s);\n  }\n  if ((i == len) && (j == len1)) {\n\n    s[len - len1] = '\u0000';\n\n    strcat(s, re);\n    cout << s;\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[1000];\n\n  cin >> s;\n  int i, j, k, m, x = 0;\n  char a[1000];\n\n  cin >> a;\n  char b[1000];\n\n  cin >> b;\n  i = strlen(a);\n  for (j = 0; s[j] != '\u0000'; j++) {\n    if (a[0] == s[j]) {\n      for (k = 1; k < i; k++) {\n        if (a[k] != s[j + k]) {\n          break;\n        }\n      }\n    }\n    if (k == i) {\n      for (m = 0; m < j; m++) {\n        printf(\"%c\", s[m]);\n      }\n      printf(\"%s\", b);\n      for (m = i + j; s[m] != '\u0000'; m++) {\n        printf(\"%c\", s[m]);\n      }\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0) {\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n\n  char string[256], sub[256], re[256];\n\n  int i, j;\n\n  cin >> string;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n\n  int len1 = strlen(string), len2 = strlen(sub);\n\n  for (i = 0; i <= len1 - len2; i++)\n\n  {\n\n    for (j = 0; j < len2; j++)\n\n    {\n\n      if (sub[j] != string[i + j])\n        break;\n    }\n\n    if (j != len2)\n      continue;\n\n    if (j == len2)\n\n    {\n\n      for (j = 0; j < len2; j++) {\n        string[i + j] = re[j];\n      }\n\n      break;\n    }\n  }\n\n  puts(string);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  int i, j;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    if (a[i - 1] == b[0]) {\n      for (j = 1; b[j - 1] != '\u0000'; j++) {\n        if (a[i - 1 + j - 1] != b[j - 1])\n          break;\n      }\n      if (b[j - 1] != '\u0000')\n        continue;\n      else {\n        for (j = i; b[j - i] != '\u0000'; j++)\n          a[j - 1] = c[j - i];\n      }\n      break;\n    } else\n      continue;\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "13234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[255], sub[255], rep[255], s[255];\n\n  cin >> str;\n\n  cin >> sub;\n\n  scanf(\"%s \", rep);\n  int len1 = strlen(str), len2 = strlen(sub), x = 0;\n  int i, j, n;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    n = 0;\n    for (j = 0; j < len2; j++) {\n      if (str[i + j] != sub[j])\n        break;\n      else\n        n++;\n    }\n    if (n == len2) {\n      int m = 0;\n      while (i + j + m < len1) {\n        s[m] = str[i + j + m];\n        m++;\n      }\n      s[m] = '\u0000';\n      str[i] = '\u0000';\n      strcat(str, rep);\n      strcat(str, s);\n      puts(str);\n      x = 1;\n      break;\n    }\n  }\n  if (x == 0) {\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13235", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  char c[101];\n  int i, j;\n  int length1, length2, length3;\n  int p;\n  scanf(\"%s %s %s \", a, b, c);\n  length1 = strlen(a);\n  length2 = strlen(b);\n  length3 = strlen(c);\n  for (i = 0; i < length1; i++) {\n    if (a[i] == b[0]) {\n      p = 0;\n      for (j = 1; j < length2; j++) {\n        if (a[i + j] != b[j]) {\n          p = 1;\n          break;\n        }\n      }\n      if (p == 0) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        for (j = 0; j < length3; j++) {\n          printf(\"%c\", c[j]);\n        }\n        for (j = i + length3; j < length1; j++) {\n          printf(\"%c\", a[j]);\n        }\n        p = 2;\n        break;\n      }\n    }\n  }\n  if (p != 2) {\n    for (i = 0; i < length1; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[257] = {'0'}, sub[257] = {'0'}, rep[257] = {'0'}, temp[257] = {'0'};\n  scanf(\"%s%s%s\", s, sub, rep);\n  int i, j, k, len1, len2, time;\n  len1 = strlen(s);\n  len2 = strlen(sub);\n  for (i = 0; i < len1; i++) {\n    k = i;\n    for (j = 0; j < len2; j++, i++)\n      temp[j] = s[i];\n\n    i = k;\n    if (strcmp(temp, sub) == 0) {\n      time = i;\n      break;\n    }\n  }\n  if (strcmp(temp, sub) == 0) {\n    for (i = time, j = 0; i < time + len2; i++, j++) {\n      s[i] = rep[j];\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  cin >> b;\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < len; ++i)\n    if (c[i] == a[0]) {\n      flag = 1;\n      for (j = 0; j < lena && i + j < len; ++j) {\n        if (a[j] != c[i + j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag) {\n        printf(\"%s\", b);\n        i += lena;\n        break;\n      } else\n        cout << c[i];\n    } else\n      printf(\"%c\", c[i]);\n  printf(\"%s\", c + i);\n  return 0;\n}\n"}
{"label": "7", "index": "13238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[300], s2[300], s3[300], *p = NULL;\n  int i, l1, l2, l3;\n  cin >> s1 >> s2 >> s3;\n  p = strstr(s1, s2);\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l3 = strlen(s3);\n  if (p == NULL)\n    cout << s1;\n  else {\n    for (i = 0; &s1[i] < p; i++)\n      cout << s1[i];\n    cout << s3;\n    for (p = p + l2; *p != '\\0'; *p++)\n      cout << *p;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13239", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[260], subString[260], replacement[260], string3[260];\n  cin >> string >> subString >> replacement;\n  char *p = strstr(string, subString);\n  if (p == NULL) {\n    cout << string << endl;\n    return 0;\n  }\n  int i = 0, j, k, len1 = strlen(subString), len2 = strlen(replacement);\n  for (i = 0; *(p + len1 + i) != '\\0'; i++)\n    string3[i] = *(p + len1 + i);\n\n  string3[i] = '\\0';\n  *p = '\\0';\n  strcat(string, replacement);\n  strcat(string, string3);\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[257] = {'\\0'}, substr[257] = {'\\0'}, replace[257] = {'\\0'};\n  cin >> str >> substr >> replace;\n  char *p = strstr(str, substr);\n  int i = 0, flag = strlen(substr);\n  if (p == NULL)\n    cout << str << endl;\n  else {\n    for (i = 0; str + i < p; i++)\n      cout << str[i];\n    cout << replace;\n    for (i = i + flag; i < strlen(str); i++)\n      cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, d, e, f, k;\n  char a[256], b[256], c[256];\n  cin >> a;\n  scanf(\" \");\n  cin >> b;\n  scanf(\" \");\n  cin >> c;\n  d = strlen(a);\n  e = strlen(b);\n  f = strlen(c);\n  for (i = 0; i < d; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      for (j = 0; j < e; j++, k++)\n        if (b[j] != a[k])\n          break;\n      if (j < e)\n        continue;\n      else\n        break;\n    } else\n      continue;\n  }\n  if (i < d) {\n    for (j = i + e; j < (d - i - e); j++)\n      a[f + j - e] = a[j];\n    for (j = i; j < (i + f); j++)\n      a[j] = c[j - i];\n    printf(\"%s \", a);\n  } else\n    printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int i, j, p, changdu1, changdu2, changdu3, m;\n  char x[256] = {0}, y[256] = {0}, z[513] = {0}, media[256][256] = {0};\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  scanf(\"%s\", z);\n  changdu1 = strlen(x);\n  changdu2 = strlen(y);\n  changdu3 = strlen(z);\n  if (changdu1 < changdu2)\n    ;\n  else {\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      for (j = 0; j < changdu2; j++)\n        media[i][j] = x[i + j];\n    }\n    for (i = 0; i < changdu1 - changdu2 + 1; i++) {\n      if (strcmp(media[i], y) == 0) {\n        p = i;\n        break;\n      }\n    }\n    if (i == changdu1 - changdu2 + 1)\n    \n    {\n      printf(\"%s\", x);\n      return 0;\n    } else {\n      strcpy(media[p], z);\n      if (p != 0) {\n        for (i = 0; i < p; i++)\n          printf(\"%c\", x[i]);\n        printf(\"%s\", media[p]);\n        if (changdu2 > changdu3)\n          m = changdu2;\n        else\n          m = changdu3;\n        for (i = p + m; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      } else {\n        printf(\"%s\", media[p]);\n        for (i = p + changdu3; i < changdu1; i++)\n          printf(\"%c\", x[i]);\n        printf(\"\\n\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[50], rep[50];\n  int i, j, t, k;\n  int len_s, len_sub;\n  cin.getline(s, 257);\n  cin.getline(sub, 50);\n  cin.getline(rep, 50);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    printf(\"%s\", rep);\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      cout << s[i + len_sub + k];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t = -1, u = -1, e = -1, c = 0;\n  char st[300] = {'0'};\n  char su[300] = {'0'};\n  char re[300] = {'0'};\n  int i, j, m = 0, b = 1;\n  for (i = 0; st[i - 1] != ' '; i++) {\n    scanf(\"%c\", &st[i]);\n  }\n  for (i = 0; su[i - 1] != ' '; i++) {\n    scanf(\"%c\", &su[i]);\n    u++;\n  }\n  for (i = 0; re[i - 1] != ' '; i++) {\n    scanf(\"%c\", &re[i]);\n    e++;\n  }\n  for (i = 0; st[i] != '\u0000'; i++) {\n\n    if (st[i] == su[0]) {\n      m = i;\n      b = 1;\n      for (j = 1; j < u; j++) {\n        if (su[j] != st[m + j]) {\n          b = 0;\n          break;\n        }\n      }\n      if (b == 1) {\n        for (i = m; i < m + u; i++)\n          st[i] = re[i - m];\n        c = 1;\n      }\n      if (c == 1)\n        break;\n    }\n  }\n  printf(\"%s\", st);\n}\n"}
{"label": "7", "index": "13245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, flag, w, j, len;\n  char str[257], sub[200], rep[50];\n  cin >> str >> sub >> rep;\n  len = strlen(sub);\n  w = 500;\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == sub[0]) {\n\n      for (j = i; j < i + len; j++) {\n        if (str[j] != sub[j - i]) {\n          flag = 0;\n          break;\n        }\n      }\n\n      if (flag != 0) {\n        w = i;\n        break;\n      } else\n        flag = 1;\n    }\n  }\n  if (w != 500) {\n    j = 0;\n    for (i = w + len; str[i] != '\\0'; i++) {\n      sub[j] = str[i];\n      j++;\n    }\n    sub[j] = '\\0';\n    str[w] = '\\0';\n    printf(\"%s%s%s\", str, rep, sub);\n  } else\n    printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[257], substr[257], re[257];\n  int i = 0, j = 0, n = 0, m = 0, k = 0;\n  scanf(\"%s\\n%s\\n%s\\n\", str, substr, re);\n  n = strlen(substr);\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] == substr[j]) {\n\n      if (memcmp(substr, str + i, n) == 0) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 1) {\n    for (i = m; i < m + n; i++) {\n      str[i] = re[i - m];\n    }\n  }\n\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13247", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, l, m, e = 0;\n  char *str;\n\n  memset(s, 0, 100);\n  memset(a, 0, 100);\n  memset(b, 0, 100);\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n\n  l = strlen(a);\n  m = strlen(s);\n  str = s;\n\n  for (i = 0; i <= m - l; i++) {\n    e = 0;\n    for (j = 0; j < l; j++) {\n      if (s[i + j] != a[j]) {\n        e++;\n        break;\n      }\n    }\n\n    if (e == 0) {\n      s[i] = '\u0000';\n      printf(\"%s\", str);\n      printf(\"%s\", b);\n      str = s + i + j;\n      break;\n    }\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "7", "index": "13248", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100];\n  int n, k, j = 0, i, s, d;\n\n  cin >> words;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  n = strlen(words);\n  s = strlen(a);\n  d = strlen(b);\n  for (i = 0; i < n; i++) {\n    if (strncmp(words + i, a, s) == 0) {\n      for (j = i, k = 0; k < d; j++, k++) {\n        words[j] = b[k];\n      }\n      break;\n    }\n  }\n  puts(words);\n  return 0;\n}\n"}
{"label": "7", "index": "13249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[257], sub[50], rep[50];\n  int i, j, t, k;\n  int len_s, len_sub;\n  cin.getline(s, 257);\n  cin.getline(sub, 50);\n  cin.getline(rep, 50);\n  len_s = strlen(s);\n  len_sub = strlen(sub);\n  for (t = 0; t < len_s; t++) {\n    if (s[t] == sub[0]) {\n      for (i = 0; i < len_sub; i++) {\n        if (s[t + i] != sub[i])\n          break;\n      }\n      if (i == len_sub)\n        break;\n    }\n  }\n  if (t == len_s)\n    cout << s << endl;\n  else {\n    for (i = 0; i < t; i++)\n      cout << s[i];\n    cout << rep;\n    for (k = 0; s[i + len_sub + k] != '\\0'; k++)\n      printf(\"%c\", s[i + len_sub + k]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  char *p;\n  int lenth, d, i;\n  scanf(\"%s\", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  p = strstr(a, b);\n  lenth = strlen(b);\n  d = strlen(a);\n  if (p != NULL) {\n    for (i = 0; i < lenth; p++, i++)\n      *p = c[i];\n  }\n  for (i = 0; i < d; i++)\n    cout << a[i];\n}\n"}
{"label": "7", "index": "13251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], word1[100], word2[100];\n  scanf(\"%s%s%s\", a, word1, word2);\n  int la, l1, l2, i, j, k, flag;\n  la = strlen(a);\n  l1 = strlen(word1);\n  l2 = strlen(word2);\n  for (i = 0; i < la; i++) {\n    if (a[i] == word1[0]) {\n      for (j = 0; j < l1; j++) {\n        flag = 1;\n        if (a[i + j] != word1[j])\n          flag = 0;\n        else\n          flag = 1;\n      }\n      if (flag == 1) {\n        for (k = 0; k < l2; k++) {\n          a[i + k] = word2[k];\n        }\n      }\n      if (flag == 1) {\n        cout << a << \"\\n\";\n        break;\n      }\n    }\n    if (i == la - 1) {\n      printf(\"%s\\n\", a);\n    }\n  }\n}\n"}
{"label": "7", "index": "13252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[256], s[256], ti[256];\n\n  cin >> w;\n\n  cin >> s;\n\n  scanf(\"%s \", ti);\n  int len1, len2, len;\n  len = strlen(w);\n  len1 = strlen(s);\n  len2 = strlen(ti);\n  int i, k, n = 0, m = 0;\n  for (i = 0; i < len; i++) {\n    if (w[i] == s[0]) {\n      for (k = 1; k < len1; k++) {\n        if (w[i + k] == s[k]) {\n          n++;\n        }\n      }\n      if (n == len1 - 1) {\n        m = i;\n      }\n    }\n  }\n  if (m == 0) {\n    puts(w);\n  } else {\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", w[i]);\n    }\n    for (i = 0; i < len2; i++) {\n      printf(\"%c\", ti[i]);\n    }\n    for (i = m + len1; i < len; i++) {\n      printf(\"%c\", w[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char word[2][256], chan[256];\n  int i, j, len[2], result = 1, wzy = 0, weizhi;\n\n  cin >> word[1] >> word[0] >> chan;\n  len[0] = strlen(word[0]);\n  len[1] = strlen(word[1]);\n\n  for (i = 0; i <= len[1] - len[0]; i++) {\n    if (word[1][i] == word[0][0]) {\n      for (j = i + 1; j < i + len[0]; j++) {\n        if (word[1][j] != word[0][j - i]) {\n          result = 0;\n          break;\n        }\n      }\n      if (result) {\n        weizhi = i;\n        wzy = 1;\n      }\n      result = 1;\n    }\n    if (wzy == 1) {\n      break;\n    }\n  }\n\n  if (wzy == 1) {\n    for (i = weizhi; i < weizhi + len[0]; i++) {\n      word[1][i] = chan[i - weizhi];\n    }\n  }\n\n  for (i = 0; i < len[1]; i++) {\n    cout << word[1][i];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13254", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[256], b[256], c[256];\n  cin >> b >> a >> c;\n  int alen, blen, clen, i, j;\n  alen = strlen(a);\n  blen = strlen(b);\n  clen = strlen(c);\n  int n = 0;\n  for (i = 0; i < blen; i++) {\n    if (b[i] == a[0]) {\n      n = 1;\n      for (j = 0; j < alen; j++)\n        if (a[j] != b[i + j]) {\n          n = 2;\n          break;\n        }\n    }\n    if (n == 1)\n      break;\n  }\n  int t = i;\n  if (n == 1) {\n    for (i = 0; i < t; i++)\n      printf(\"%c\", b[i]);\n    printf(\"%s\", c);\n    for (i = t + clen; i < blen; i++)\n      printf(\"%c\", b[i]);\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "13255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int n, i, j, length1, length2, k, h;\n  k = 0;\n  cin >> s2;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s3);\n  length1 = strlen(s1);\n  length2 = strlen(s2);\n  for (i = 0; i < length2; i++) {\n    if (s1[0] == s2[i]) {\n      j = 0;\n      while (s2[j + i] == s1[j] && j < length1)\n        j++;\n      if (j == length1)\n        k = i;\n    }\n    if (k)\n      break;\n  }\n  h = k;\n  if (k) {\n    for (h = k; h < k + length1; h++)\n      s2[h] = s3[h - k];\n  }\n  cout << s2;\n  return 0;\n}\n"}
{"label": "7", "index": "13256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char s[30000];\n  char yc[30000];\n  char tc[30000];\n  int tag = 1;\n  int u = 0;\n\n  cin >> s;\n  cin >> yc;\n  scanf(\"%s \", tc);\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == yc[0]) {\n      tag = 2;\n      for (int j = 0; j < strlen(yc); j++) {\n        if (s[i + j] != yc[j]) {\n          tag = 0;\n          break;\n        }\n      }\n    }\n    if (tag == 2) {\n      printf(\"%s\", tc);\n      u = i + strlen(yc);\n      break;\n    }\n\n    if (tag != 2) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  if (tag == 2) {\n    for (int k = u; k < strlen(s); k++) {\n      printf(\"%c\", s[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], subString[300], replacement[300];\n  char *p, *q;\n  int strLen, subLen, repLen, move, i;\n  cin >> str >> subString >> replacement;\n  strLen = strlen(str);\n  subLen = strlen(subString);\n  repLen = strlen(replacement);\n  p = strstr(str, subString);\n  if (p == NULL) {\n    printf(\"%s\", str);\n    return 0;\n  }\n  q = replacement;\n  if (repLen > subLen) {\n    move = repLen - subLen;\n    for (q = str + strLen + move; q >= p + repLen; q--) {\n      *q = *(q - move);\n    }\n    i = 0;\n    q = replacement;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n  } else {\n    i = 0;\n    while (i < repLen) {\n      *p++ = *q++;\n      i++;\n    }\n    if (repLen < subLen) {\n      move = subLen - repLen;\n      while (*(p + move) != '\\0') {\n        *p++ = *(p + move);\n      }\n      *p = '\\0';\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[300], c[300];\n  int d = 0, i, j, k, m, n, lenb, lena;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  for (i = 0; i < lena; i++) {\n    if (a[i] == b[0]) {\n      for (j = i, k = 0; j < i + lenb, k < lenb; j++, k++) {\n        if (a[j] != b[k])\n          break;\n      }\n      if (k == lenb)\n        d = 1;\n    }\n    if (d == 1)\n      break;\n  }\n  if (d == 1) {\n    for (m = i, n = 0; m < i + lenb, n < lenb; m++, n++) {\n      a[m] = c[n];\n    }\n    printf(\"%s\", a);\n  }\n  if (d == 0)\n    printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char an[270], bn[270], cn[270], temp[270];\n  scanf(\"%s%s%s\", an, bn, cn);\n  char *p = strstr(an, bn);\n  int len = strlen(bn);\n  if (p != NULL) {\n    strcpy(temp, p + len);\n    *p = '\\0';\n    strcat(an, cn);\n    strcat(an, temp);\n  }\n  cout << an;\n  return 0;\n}\n"}
{"label": "7", "index": "13260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[256], subs[256], rpl[256];\n  int i, j, len1 = 0, len2 = 0, c = 0, m;\n  cin >> str >> subs >> rpl;\n  len1 = strlen(subs);\n  len2 = strlen(rpl);\n  for (i = 0; i < 256 && str[i] != 0; i++) {\n    if (str[i] == subs[0]) {\n      c = 0;\n      for (j = 0; j < len1; j++) {\n        if (str[i + j] != subs[j]) {\n          c = 1;\n          break;\n        } else {\n          c = c + 1;\n        }\n      }\n    }\n    if (c == len1) {\n      break;\n    }\n  }\n  if (c == 0) {\n    for (m = 0; m < 256 && str[m] != 0; m++) {\n      cout << str[m];\n    }\n  }\n  if (c == len1) {\n    for (m = 0; m < i; m++) {\n      cout << str[m];\n    }\n    for (m = i; m < i + len2; m++) {\n      cout << rpl[m - i];\n    }\n    for (m = i + len2; m < 256 && str[m] != 0; m++) {\n      cout << str[m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a = 1, m, k;\n  char s1[258], s2[258], s3[258];\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if (a == 1) {\n      k = i;\n      for (j = 0; s2[j] != '\\0'; j++) {\n        if (s2[j] != s1[k]) {\n          a = 1;\n          break;\n        }\n        k++;\n        a = 0;\n      }\n    } else\n      break;\n  }\n  if (a == 0) {\n    for (m = 0; s3[m] != '\\0'; m++) {\n      s1[i - 1] = s3[m];\n      i++;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13262", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint pd(char *p, char *sub, int n) {\n  int j;\n  char *x, *y;\n  int zhi = 0;\n  for (j = 0, x = p, y = sub; j < n; j++, x++, y++)\n    if (*x == *y)\n      zhi = 1;\n    else {\n      zhi = 0;\n      break;\n    }\n\n  return (zhi);\n}\nint main() {\n  char *a, *sub, *rep, *t;\n  char *p;\n  int i, n, m;\n  a = (char *)malloc(250 * sizeof(char));\n  sub = (char *)malloc(1000);\n  rep = (char *)malloc(1000);\n  t = (char *)malloc(1000);\n  cin >> a;\n  cin >> sub;\n  cin >> rep;\n  for (n = 0, p = sub; *p != '\u0000'; p++, n++)\n    ;\n  for (m = 0, p = a; *p != '\u0000'; p++, m++)\n    ;\n  for (p = a; p < a + m - n; p++)\n    if (pd(p, sub, n) == 1)\n      break;\n  strcpy(t, p + n);\n  if (pd(p, sub, n) == 1)\n    strcpy(p, rep);\n  strcpy(p + n, t);\n  puts(a);\n  return 0;\n}\n"}
{"label": "7", "index": "13263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char yuanchuan[257];\n  char zichuan[257];\n  char replacement[257];\n  int i, j, k;\n  int len1, len2;\n  scanf(\"%s%s%s\", yuanchuan, zichuan, replacement);\n  len1 = strlen(yuanchuan);\n  len2 = strlen(zichuan);\n  k = len1;\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (yuanchuan[i + j] != zichuan[j]) {\n        break;\n      }\n      if (j == len2 - 1) {\n        k = i;\n      }\n    }\n    if (k != len1) {\n      break;\n    }\n  }\n  if (k == len1) {\n    printf(\"%s\", yuanchuan);\n  } else {\n    for (i = 0; i < k; i++) {\n      cout << yuanchuan[i];\n    }\n    printf(\"%s\", replacement);\n    for (i = k + len2; i < len1; i++) {\n      printf(\"%c\", yuanchuan[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s%s%s\", a, b, c);\n  int i, l, k;\n  int m = 0, n = 0;\n  for (;;) {\n    for (k = m;; k++) {\n      if (a[k] == b[0]) {\n        n = 1;\n        break;\n      }\n      if (a[k] == '\\0') {\n        n = 2;\n        break;\n      }\n    }\n    if (n == 2)\n      break;\n    else {\n      m = k + 1;\n      for (l = 1;; l++) {\n        if (b[l] == '\\0') {\n          n = 3;\n          break;\n        }\n        if (a[k + l] != b[l]) {\n          n = 4;\n          break;\n        }\n      }\n      if (n == 3)\n        break;\n    }\n  }\n\n  if (n == 2)\n    printf(\"%s\", a);\n  else {\n    for (i = 0;; i++) {\n      a[k + i] = a[k + i + strlen(b)];\n      if (a[k + i + strlen(b)] == '\\0')\n        break;\n    }\n    for (i = strlen(c); i > 0; i--) {\n      int x = strlen(a);\n      for (l = 0; x - l >= k; l++)\n        a[x + 1 - l] = a[x - l];\n\n      a[k] = c[i - 1];\n    }\n\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (int i = 0; a[i] != '\\0'; i++) {\n    int j;\n    for (j = 0; (b[j] == a[i + j]) && (b[j] != '\\0'); j++)\n      ;\n    if (b[j] == '\\0') {\n      for (int k = 0; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      for (int k = i + j; a[k] != '\\0'; k++)\n        printf(\"%c\", a[k]);\n      return 0;\n    }\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(\"str\");\n  return 0;\n}\n"}
{"label": "7", "index": "13267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[260], s2[260], s3[260];\n  int i, j, a = 0, b, c, d;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  c = strlen(s2);\n  d = strlen(s1);\n  for (i = 0; s1[i] != 0; i++) {\n    if (s1[i] == s2[0]) {\n      for (j = 0; s2[j] != 0; j++) {\n        if (s1[j + i] == s2[j]) {\n          a = 1;\n        } else {\n          a = 0;\n          break;\n        }\n      }\n    }\n    if (a == 1) {\n      b = i;\n      break;\n    }\n  }\n  if (a == 1) {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; s3[i] != 0; i++) {\n      printf(\"%c\", s3[i]);\n    }\n    for (i = 0; i < d - b - c; i++) {\n      printf(\"%c\", s1[i + c + b]);\n    }\n  } else {\n    printf(\"%s\", s1);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], n[1000];\n  int j, i, pos, len1, len2, flag = 0;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  if (!strstr(s, a)) {\n    cout << s << endl;\n    return 0;\n  }\n  len1 = strlen(s);\n  len2 = strlen(a);\n\n  for (i = 0, j = 0; s[i] != '\\0'; i++) {\n    if (j >= len2)\n      break;\n    if (s[i] == a[j]) {\n      j++;\n      continue;\n    }\n\n    if (j) {\n      i -= j;\n      j = 0;\n    }\n  }\n\n  pos = i;\n  j = i - j;\n  for (i = 0; i < j; i++)\n    n[i] = s[i];\n  for (j = 0; b[j] != '\\0'; j++, i++)\n    n[i] = b[j];\n  j = pos;\n  for (; s[j] != '\\0'; i++, j++)\n    n[i] = s[j];\n  n[i] = '\\0';\n  cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, i, j, a = 0;\n  char str[256], sub[256], rep[256], word[256];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  len = strlen(sub);\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (j = 0; j < len; j++) {\n        word[j] = str[i + j];\n      }\n      word[len] = '\u0000';\n      if (strcmp(word, sub) == 0) {\n        strcpy(word, rep);\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", str[j]);\n        }\n        printf(\"%s\", word);\n        for (j = i + len; str[j] != 0; j++) {\n          printf(\"%c\", str[j]);\n        }\n        a = 1;\n        break;\n      }\n    }\n  }\n  if (a == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint comp(char a[100], char b[100], int i) {\n  int l, j;\n  l = strlen(b);\n  for (j = 0; j < l; j++)\n    if (a[i + j] != b[j])\n      return 0;\n  return 1;\n}\n\nint main(int argc, char *argv[]) {\n  int i, j, len1, len2, len3, break1 = 0;\n  char a[100], b[100], c[100];\n  int comp(char a[100], char b[100], int i);\n  scanf(\"%s %s %s\", a, b, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < 100; i++) {\n    if (a[i] == b[0]) {\n      if (comp(a, b, i)) {\n        for (j = 0; j < i; j++) {\n          printf(\"%c\", a[j]);\n        }\n        printf(\"%s\", c);\n\n        for (j = j + len2; j < len1 - len2 + len3; j++)\n          printf(\"%c\", a[j]);\n        break;\n        break1 = 1;\n      }\n    }\n    if (break1 == 1)\n      break;\n    if (i == strlen(a))\n      printf(\"%s\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], z[256], r[256];\n  int i;\n  cin.getline(s, 256);\n  cin.getline(z, 256);\n  cin.getline(r, 256);\n  char *p = strstr(s, z);\n  if (p == NULL) {\n    printf(\"%s\", s);\n  } else {\n    char *q = s;\n    for (i = 0; i < (p - q); i++) {\n      cout << s[i];\n    }\n    cout << r;\n    p = p + (strlen(z));\n    while (*p != '\\0') {\n      cout << *p;\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a = 1, m, k;\n  char s1[258], s2[258], s3[258];\n  cin >> s1;\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  for (i = 0; s1[i] != '\\0'; i++) {\n    if (a == 1) {\n      k = i;\n      for (j = 0; s2[j] != '\\0'; j++) {\n        if (s2[j] != s1[k]) {\n          a = 1;\n          break;\n        }\n        k++;\n        a = 0;\n      }\n    } else\n      break;\n  }\n  if (a == 0) {\n    for (m = 0; s3[m] != '\\0'; m++) {\n      s1[i - 1] = s3[m];\n      i++;\n    }\n  }\n  printf(\"%s\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "13274", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300 * 100], sub[100], rep[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  int i, j, k, t, w;\n  t = 0;\n  w = 0;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j])\n          break;\n      }\n      if (sub[j] == 0) {\n        t = i;\n        w = k;\n        break;\n      }\n    }\n  }\n  if (w > t) {\n    if (strlen(sub) >= strlen(rep)) {\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = w; str[k] != 0; i++, k++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= w; k--, i--) {\n        str[i] = str[k];\n      }\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(str);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[256] = {' '}, sstr[256] = {' '}, rpl[256] = {' '};\n  int lstr, lsstr;\n  scanf(\"%s%s%s\", str, sstr, rpl);\n  lstr = strlen(str);\n  lsstr = strlen(sstr);\n  int pst, curr, indi = 0;\n  for (pst = 0; pst <= lstr - lsstr; pst++) {\n    int state = 1;\n    for (curr = 0; curr < lsstr; curr++) {\n      if (sstr[curr] != str[curr + pst]) {\n        state = 0;\n        break;\n      }\n    }\n    if (state == 1) {\n      indi = 1;\n      break;\n    }\n  }\n  if (indi == 0)\n    printf(\"%s\", str);\n  else {\n    for (curr = 0; curr < pst; curr++)\n      cout << str[curr];\n\n    for (curr = 0; curr < lsstr; curr++) {\n      printf(\"%c\", rpl[curr]);\n    }\n    for (curr = pst + lsstr; curr < lstr; curr++) {\n      printf(\"%c\", str[curr]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = -2;\n  int lengths, lengtha, lengthb;\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n\n  for (i = 0; i < lengths; i++) {\n    k = 0;\n    for (j = 0; j < lengtha; j++) {\n      if (a[j] == s[i + j]) {\n        k++;\n      }\n    }\n\n    if (k == lengtha) {\n      t = i;\n      break;\n    }\n  }\n  if (t != -2) {\n    for (i = 0; i < t; i++) {\n      printf(\"%c\", s[i]);\n    }\n    cout << b;\n    for (i = t + lengthb; i < lengths; i++)\n      printf(\"%c\", s[i]);\n\n  } else {\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], ci[256][256];\n  int ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int i, j;\n  for (i = 0; i <= ls - la; i++) {\n    for (j = 0; j < la; j++) {\n      ci[i][j] = s[i + j];\n    }\n    ci[i][la] = '\u0000';\n  }\n  for (i = 0; i <= ls - la; i++) {\n    if (strcmp(ci[i], a) == 0) {\n      strcpy(ci[i], b);\n      break;\n    }\n  }\n  if (i != ls - la + 1) {\n    for (j = 0; j < i; j++) {\n      cout << ci[j][0];\n    }\n    printf(\"%s\", ci[i]);\n    if (i != ls - la) {\n      for (j = i + la; j < ls - la; j++) {\n        printf(\"%c\", ci[j][0]);\n      }\n      printf(\"%s\", ci[ls - la]);\n    }\n  } else {\n    for (j = 0; j < ls - la; j++)\n      printf(\"%c\", ci[j][0]);\n\n    printf(\"%s\", ci[ls - la]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar zfc1[100], zfc2[100], zfc3[100];\nint main() {\n  int len1, len2, i, j, k = 1, g = 0;\n\n  cin >> zfc1;\n\n  cin >> zfc2;\n\n  cin >> zfc3;\n  len1 = strlen(zfc1);\n  len2 = strlen(zfc2);\n  for (i = 0; i < len1; i++) {\n    if (zfc2[0] == zfc1[i]) {\n      for (j = 1; j < len2; j++) {\n        if (zfc2[j] == zfc1[i + j])\n          k++;\n      }\n    }\n    if (k == len2) {\n      g++;\n      break;\n    } else\n      k = 1;\n  }\n  if (g == 0)\n    puts(zfc1);\n  else {\n    zfc1[i] = 0;\n    cout << zfc1 << zfc3 << &zfc1[i + len2];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13279", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int la, lb, i, j, n, k, x, p;\n  char a[100], b[100], c[100], d[100];\n  cin >> a >> b >> d;\n  la = strlen(a);\n  lb = strlen(b);\n  n = la - lb;\n  for (i = 0; i <= n; i++) {\n    if (b[0] == a[i]) {\n      k = i;\n      p = i;\n      for (j = 0; j < lb; j++) {\n        c[j] = a[k];\n        k++;\n      }\n      c[lb] = '\\0';\n      if (strcmp(c, b) == 0) {\n        for (x = 0; x < lb; x++) {\n          a[p] = d[x];\n          p++;\n        }\n        break;\n      }\n    } else\n      continue;\n  }\n\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "7", "index": "13280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300 * 100], sub[100], rep[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n  int i, j, k, t, w;\n  t = 0;\n  w = 0;\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == sub[0]) {\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j])\n          break;\n      }\n      if (sub[j] == 0) {\n        t = i;\n        w = k;\n        break;\n      }\n    }\n  }\n  if (w > t) {\n    if (strlen(sub) >= strlen(rep)) {\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n      for (k = w; str[k] != 0; i++, k++) {\n        str[i] = str[k];\n      }\n      str[i] = 0;\n    } else {\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= w; k--, i--) {\n        str[i] = str[k];\n      }\n      for (i = t, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n  printf(\"str\");\n\n  return 0;\n}\n"}
{"label": "7", "index": "13281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int le, len, lenn, i, j, k, a = 0, b, m = 0;\n  char aa[256], bb[256], cc[256];\n  scanf(\"%s%s%s\", aa, bb, cc);\n  le = strlen(aa);\n  len = strlen(bb);\n  lenn = strlen(cc);\n  for (i = 0; i < le; i++) {\n    a = 0;\n    for (j = i, k = 0; j < len + i && k < len; j++, k++) {\n      if (bb[k] == aa[j])\n        a++;\n    }\n    if (a == len) {\n      b = i;\n      m++;\n      break;\n    }\n  }\n\n  if (m == 0)\n    puts(aa);\n  else {\n    for (i = 0; i < b; i++) {\n      printf(\"%c\", aa[i]);\n    }\n    for (k = 0; k < lenn; k++) {\n      printf(\"%c\", cc[k]);\n    }\n    for (i = b + len; i < le; i++)\n      printf(\"%c\", aa[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13282", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sub[257], s1[257], s2[257];\n  int i, j, k, str1, str2;\n  scanf(\"%s \", sub);\n  scanf(\"%s\", s1);\n  cin >> s2;\n  str1 = strlen(sub);\n  str2 = strlen(s1);\n  for (i = 0; i < str1; i++)\n    if (sub[i] == s1[0]) {\n      for (j = 0; j < str2; j++)\n        if (sub[i + j] != s1[j])\n          break;\n      if (j == str2) {\n        for (j = 0; j < str2; j++)\n          sub[i + j] = s2[j];\n        break;\n      }\n    }\n  printf(\"%s\\n\", sub);\n  return 0;\n}\n"}
{"label": "7", "index": "13283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, x, m, n;\n  char s[300], sub[300], re[300];\n\n  cin >> s;\n\n  cin >> sub;\n\n  scanf(\"%s \", re);\n  n = strlen(s);\n  m = strlen(sub);\n  x = strlen(re);\n  for (i = 0; i <= n - m; i++) {\n    for (j = 0, t = i; j < m; j++) {\n      if (s[t] == sub[j]) {\n        t++;\n      } else\n        break;\n    }\n    if (j == m) {\n      break;\n    }\n  }\n  if (i == n - m + 1) {\n    ;\n  } else {\n    for (t = i + x; t < n + x - m; t++) {\n      s[t] = s[t - x + m];\n    }\n    for (j = i, t = 0; j < i + x; j++, t++) {\n      s[j] = re[t];\n    }\n  }\n  puts(s);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "7", "index": "13284", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[256], b[256], c[256];\n  int i, j, lena, lenb;\n  cin >> a >> b >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  a[lena] = '\\0';\n  int x, s;\n  for (i = 0; i < lena; i++) {\n    x = -1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        x = 0;\n        break;\n      }\n    }\n    if (x != 0) {\n      s = i;\n      break;\n    }\n  }\n  if (x == 0)\n    printf(\"%s\", a);\n  else {\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", c);\n    for (i = s + lenb; i < lena; i++) {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[257], son[257], re[357], fu[257];\n  int i, len, slen, k, t = 0;\n\n  cin >> zfc;\n\n  cin >> son;\n\n  cin >> re;\n  len = strlen(zfc);\n  slen = strlen(son);\n  for (i = 0; i <= len - slen; i++) {\n    for (k = i; k < i + slen; k++)\n      fu[k - i] = zfc[k];\n\n    fu[slen] = '\u0000';\n    if (strcmp(fu, son) == 0) {\n      for (k = 0; k < i; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      printf(\"%s\", re);\n      for (k = i + slen; k < len; k++) {\n        printf(\"%c\", zfc[k]);\n      }\n      t = 1;\n    }\n    if (t == 1) {\n      break;\n    }\n  }\n  if (t == 0) {\n    printf(\"%s\", zfc);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13286", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[256], b[256], c[256];\n  int la, i, j, lb, lc, h = 300, p;\n  scanf(\"%s %s %s\", a, b, c);\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (j = 0; j < la; j++) {\n    if (b[0] == a[j]) {\n      for (i = 0; i < lb; i++) {\n        if (b[i] != a[j + i])\n          break;\n        if ((i == lb - 1) && (b[i] == a[j + i])) {\n          h = j;\n          j = 100;\n          break;\n        }\n      }\n    }\n  }\n  if (h != 300) {\n    for (p = h; p < h + lb; p++) {\n      a[p] = c[0 + p - h];\n    }\n  }\n  printf(\"%s\", a);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char a[256], b[256], c[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  cin >> c;\n  for (i = 0; i < 256; i++) {\n    k = 0;\n    for (j = 0; j < strlen(b); j++) {\n      if (a[j + i] != b[j]) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      for (j = 0; j < i; j++)\n        printf(\"%c\", a[j]);\n      for (j = 0; j < strlen(c); j++)\n        printf(\"%c\", c[j]);\n      for (j = i + strlen(b); j < strlen(a); j++)\n        printf(\"%c\", a[j]);\n\n      break;\n    }\n  }\n  if (k == 1) {\n    for (j = 0; j < strlen(a); j++)\n      cout << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid adds(char *a, char *b);\nvoid addc(char *a, char c);\nint main() {\n  char s[256];\n  char subs[256];\n  char replace[256];\n  char result[1000] = \"\";\n\n  cin >> s;\n\n  cin >> subs;\n\n  cin >> replace;\n\n  int len_s = strlen(s);\n  int len_subs = strlen(subs);\n  int len_replace = strlen(replace);\n  int i, j = 0;\n  int finish = 0;\n  for (i = 0; i < len_s; i++) {\n    if (s[i] == subs[j] && finish == 0)\n      if (j == len_subs - 1) {\n        adds(result, replace);\n        j = 0;\n        finish = 1;\n\n      } else\n        j++;\n    else {\n      i -= j;\n      j = 0;\n      addc(result, s[i]);\n    }\n  }\n  printf(\"%s \", result);\n\n  return 0;\n}\n\nvoid adds(char *a, char *b) \n{\n  int len_a = strlen(a);\n  int len_b = strlen(b);\n  int i;\n  for (i = len_a; i <= len_a + len_b - 1; i++)\n    *(a + i) = *(b + i - len_a);\n  *(a + len_a + len_b) = '\u0000';\n}\n\nvoid addc(char *a, char c) \n{\n  int len_a = strlen(a);\n  *(a + len_a) = c;\n  *(a + len_a + 1) = '\u0000';\n}\n"}
{"label": "7", "index": "13289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[257], sub[257], re[257];\n  char out[257] = {'\u0000'};\n  scanf(\"%s\", string);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  int i, k = 0, len, m = 0;\n  len = strlen(sub);\n  int len2 = strlen(re);\n  int len3 = strlen(string);\n  for (i = 0; i < 256; i++) {\n    if (string[i] == sub[k]) {\n      k += 1;\n      if (k == len)\n        break;\n    } else {\n      k = 0;\n    }\n  }\n  if (k == len) {\n    int s = len3 - len + len2;\n    for (int j = 0; j < s; j++) {\n      if (j <= i - k) {\n        out[j] = string[j];\n        continue;\n      }\n      if (j > i - k && j <= i - k + len2) {\n        out[j] = re[m];\n        m += 1;\n      } else {\n        out[j] = string[i + 1];\n        i++;\n      }\n    }\n    printf(\"%s\", out);\n  } else\n    cout << string;\n}\n"}
{"label": "7", "index": "13290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], sub[206], re[256];\n  int i, j, n, m;\n  scanf(\"%s\", s);\n  scanf(\"%s\", sub);\n  scanf(\"%s\", re);\n  n = strlen(sub);\n  m = strlen(s);\n  for (i = 0; i < m - n + 1; i++) {\n    if (s[i] == sub[0])\n      for (j = 0; j < n; j++) {\n        if (s[i + j] != sub[j])\n          break;\n      }\n    if (j == n) {\n      for (j = 0; j < i; j++)\n        cout << s[j];\n      printf(\"%s\", re);\n      for (j = i + n; j < m; j++)\n        printf(\"%c\", s[j]);\n      break;\n    }\n  }\n  if (i == (1 + m - n))\n    printf(\"%s\", s);\n}\n"}
{"label": "7", "index": "13291", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[257 * 2];\n  char sub[257], rep[257];\n  int i, j, k, ss = 0, se = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        ss = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (ss < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = ss, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n  return 0;\n}\n"}
{"label": "7", "index": "13292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char src[256];\n  char dst[256];\n  char replacement[256];\n\n  scanf(\"%s\", src);\n  scanf(\"%s\", dst);\n  cin >> replacement;\n  char *p = strstr(src, dst);\n  if (p == NULL) {\n    printf(\"%s\\n\", src);\n  } else {\n    int len = strlen(replacement);\n    int i;\n    for (i = 0; i < len; i++) {\n      *p = replacement[i];\n      p++;\n    }\n    cout << src << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[257], b[257], c[256];\n  cin.getline(a, 257);\n  cin.getline(b, 257);\n  cin.getline(c, 257);\n  int len1 = strlen(a), len2 = strlen(b), len3 = strlen(c);\n  int i, j, count, flag = -1, m;\n  for (i = 0; i <= len1 - 1; i++) {\n    m = 0;\n    if (a[i] == b[m]) {\n      count = 0;\n      for (j = i; j <= i + len2 - 1; j++) {\n        if (a[j] == b[m++])\n          count++;\n      }\n      if (count == len2) {\n        flag = i;\n        break;\n      }\n    }\n  }\n  if (flag == -1) {\n    printf(\"%s\", a);\n  } else {\n    for (i = flag; i <= flag + len2 - 1; i++)\n      a[i] = c[i - flag];\n    for (i = 0; i <= len1 - 1; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13294", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len, len1, flag = 0, i, j, k;\n  char str[256], str1[256], str2[256];\n  cin >> str;\n  cin >> str1;\n  cin >> str2;\n  len = strlen(str);\n  len1 = strlen(str1);\n  for (i = 0; i <= len - len1; i++) {\n    for (j = 0; j <= len1 - 1; j++) {\n      if (str[i + j] == str1[j])\n        continue;\n      else\n        break;\n    }\n    if (j == len1) {\n      for (k = 0; k < i; k++)\n        cout << str[k];\n      cout << str2;\n      for (k = i + j; k < len; k++)\n        cout << str[k];\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0)\n    cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, j, k, n1, n2;\n  char x;\n  char zf[300];\n  char s1[100], s2[100];\n\n  cin >> zf;\n\n  cin >> s1;\n\n  cin >> s2;\n  n1 = strlen(s1);\n  n2 = strlen(s2);\n  for (i = 0; i < (strlen(zf)); i++) {\n    if (zf[i] == s1[0] && zf[i + 1] == s1[1] && zf[i + n1 - 1] == s1[n1 - 1]) {\n      for (k = 0; k < n2; k++) {\n        zf[i] = s2[k];\n        i++;\n      }\n      break;\n    }\n  }\n\n  puts(zf);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[260], sbstr[260], rplyc[260], *p1, *p2, *p3;\n  int i, j, a, b, m;\n\n  cin >> str;\n\n  scanf(\"%s \", sbstr);\n\n  cin >> rplyc;\n  a = strlen(str);\n  b = strlen(sbstr);\n\n  for (i = 0; i < a - b + 1; i++) {\n    m = 0;\n    p1 = str + i;\n    p2 = sbstr;\n    for (j = 0; j < b; j++) {\n      if (*(p1 + j) == *(p2 + j))\n        m++;\n    }\n\n    if (m == b) {\n      p1 = str + i;\n      p3 = rplyc;\n      for (j = 0; j < b; j++)\n        *(p1 + j) = *(p3 + j);\n      break;\n    }\n  }\n  puts(str);\n}\n"}
{"label": "7", "index": "13297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char an[256], be[256], ce[256];\n  int i, j, m, n, k = 0, h;\n\n  cin >> an;\n\n  cin >> be;\n\n  cin >> ce;\n  m = strlen(an);\n  n = strlen(be);\n  h = strlen(ce);\n  for (i = 0; i < m; i++) {\n\n    if (an[i] == be[0]) {\n      for (j = 1; j < n; j++) {\n        if (be[j] != an[i + j]) {\n          break;\n        }\n      }\n      if (j == n) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", an[k]);\n        for (k = 0; k < h; k++) {\n          printf(\"%c\", ce[k]);\n        }\n        for (k = i + n; k < m; k++) {\n          printf(\"%c\", an[k]);\n        }\n        break;\n      }\n    }\n  }\n  if (k != m)\n    cout << an;\n\n  return 0;\n}\n"}
{"label": "7", "index": "13298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[500], s2[20], s3[20];\n  int i, j, len1, len2, len3, count, c = 0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  len1 = strlen(s1);\n  len2 = strlen(s2);\n  len3 = strlen(s3);\n\n  for (i = 0; i < len1; i++) {\n    count = 0;\n    if (s1[i] == s2[0])\n      for (j = 0; j < len2; j++)\n        if (s1[i + j] == s2[j])\n          count++;\n    if (count == len2)\n      break;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%c\", s1[j]);\n  }\n  if (i != len1) {\n    printf(\"%s\", s3);\n  }\n  for (j = i + len2; j < len1; j++)\n    printf(\"%c\", s1[j]);\n  return 0;\n}\n"}
{"label": "7", "index": "13299", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char str[260], subStr[260], replace[260], str2[260];\n  char *start = str, *node = NULL, *rep = replace;\n  int len, i = 0;\n  cin >> str >> subStr >> replace;\n  node = strstr(str, subStr); \n  if (node == NULL)           \n    cout << str;              \n  else {\n    while (start != node)\n      str2[i++] = *start++; \n    while (*rep != '\\0')\n      str2[i++] = *rep++;   \n    node += strlen(subStr); \n    while (*node != '\\0')\n      str2[i++] = *node++; \n    str2[i] = '\\0';        \n    cout << str2;\n  }\n  cout << endl;\n  start = NULL; \n  node = NULL;\n  rep = NULL;\n  return 0;\n}\n"}
{"label": "7", "index": "13300", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char yuan[256];\n  char sub[256];\n  char replace[256];\n  char sz[256][256];\n\n  cin >> yuan;\n\n  cin >> sub;\n\n  scanf(\"%s \", replace);\n  int n = strlen(sub);\n  int m = strlen(yuan);\n  int i, k, result;\n  int a = 0;\n  int b = 0;\n  for (i = 0; i <= m - n; i++) {\n    for (k = 0; k < n; k++) {\n      sz[a][b] = yuan[i + k];\n      b++;\n    }\n    sz[a][b] = '\u0000';\n    a++;\n    b = 0;\n  }\n  for (i = 0; i < a; i++) {\n    result = strcmp(sz[i], sub);\n    if (result == 0) {\n      strcpy(sz[i], replace);\n      printf(\"%s\", sz[i]);\n      i += n;\n      break;\n    } else {\n      printf(\"%c\", yuan[i]);\n    }\n  }\n  for (i = i; i < m; i++) {\n    printf(\"%c\", yuan[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  cin >> a >> b >> c;\n  int i, j, m, k = 0, la = strlen(a), lb = strlen(b);\n  for (i = 0; i < la; i++) {\n    if (a[i] == b[0]) {\n      m = i;\n      for (j = 1; j < lb; j++) {\n        m++;\n        if (a[m] != b[j])\n          break;\n      }\n      if (j == lb) {\n        m = i;\n        k = 1;\n        break;\n      }\n    }\n  }\n  if (k == 0)\n    cout << a;\n  else {\n    for (i = 0; i < m; i++)\n      cout << a[i];\n    cout << c;\n    for (i = m + lb; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *p3, *p, *q;\n  int i, j, k;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  q = (char *)malloc(100 * sizeof(char));\n\n  cin >> p1;\n\n  cin >> p2;\n\n  cin >> p3;\n  p = strstr(p1, p2);\n  if (p == 0)\n    printf(\"%s\", p1);\n  else {\n    for (i = 0; *(p1 + i) != '\u0000'; i++) {\n      *(q + i) = *(p1 + i);\n      if (p1 + i == p)\n        break;\n    }\n    for (j = 0; *(p3 + j) != '\u0000'; j++)\n      *(q + i + j) = *(p3 + j);\n    for (k = i + strlen(p2); *(p1 + k) != '\u0000'; k++, j++)\n      *(q + i + j) = *(p1 + k);\n    *(q + i + j) = '\u0000';\n    printf(\"%s\", q);\n  }\n}\n"}
{"label": "7", "index": "13303", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sentence[256], sub_sen[256], replacement[256];\n  cin.getline(sentence, 256);\n  cin.getline(sub_sen, 256);\n  cin.getline(replacement, 256);\n  char *p;\n  p = strstr(sentence, sub_sen);\n  if (!p)\n    cout << sentence << endl;\n  int i;\n  int length = strlen(sub_sen);\n  if (p) {\n    for (i = 0; i < p - sentence; i++)\n      cout << sentence[i];\n    cout << replacement;\n    cout << p + length << endl;\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[256] = {0}, b[256] = {0}, c[256] = {0};\n  cin >> a >> b >> c;\n  char *p, *q;\n  p = strstr(a, b);\n  q = a;\n  if (p == NULL)\n    cout << a;\n  else {\n    while (q != p) {\n      cout << *q;\n      q++;\n    }\n    cout << c;\n    q = q + strlen(c);\n    while (*q != '\\0') {\n      cout << *q;\n      q++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], a[256], b[256], ci[256][256];\n  int ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int i, j;\n  for (i = 0; i <= ls - la; i++) {\n    for (j = 0; j < la; j++) {\n      ci[i][j] = s[i + j];\n    }\n    ci[i][la] = '\u0000';\n  }\n  for (i = 0; i <= ls - la; i++) {\n    if (strcmp(ci[i], a) == 0) {\n      strcpy(ci[i], b);\n      break;\n    }\n  }\n  if (i != ls - la + 1) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[i]);\n    if (i != ls - la) {\n      for (j = i + la; j < ls - la; j++) {\n        printf(\"%c\", ci[j][0]);\n      }\n      cout << ci[ls - la];\n    }\n  } else {\n    for (j = 0; j < ls - la; j++) {\n      printf(\"%c\", ci[j][0]);\n    }\n    printf(\"%s\", ci[ls - la]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13306", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], e[257], f[257];\n  int i, n1, n2, k, j, m = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  scanf(\"%s \", e);\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n    for (k = 0; k < n2; k++) {\n      c[k] = a[i + k];\n    }\n    c[n2] = 0;\n    if (strcmp(b, c) == 0) {\n      d[i] = 0;\n      for (j = 0; j < (n1 - n2 - i); j++) {\n        f[j] = a[i + n2 + j];\n      }\n      f[j] = 0;\n      printf(\"%s%s%s\", d, e, f);\n      m = 0;\n      break;\n    }\n  }\n  if (m) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13307", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar *strpos(char string[], char substring[]) {\n  char *p = string;\n  char *temp = NULL;\n  while (*p != '\\0') {\n    if (*p == substring[0]) {\n      temp = p;\n      p++;\n      int i;\n      for (i = 1; i < strlen(substring); i++) {\n        if (*p != substring[i]) {\n          break;\n        }\n        p++;\n      }\n      if (i == strlen(substring))\n        break;\n      else\n        p = temp + 1;\n    } else\n      p++;\n  }\n  return temp;\n}\nint main() {\n  char string[256], substring[256], replacement[256];\n  cin.getline(string, 257);\n  cin.getline(substring, 257);\n  cin.getline(replacement, 257);\n  char *p = strpos(string, substring);\n  if (p != NULL) {\n    int t = 0, count = 0;\n    while (count != strlen(substring)) {\n      *p = replacement[t++];\n      p++;\n      count++;\n    }\n  }\n  printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13308", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, l1;\n  char s[256], a[256], b[256], t[256];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    for (j = 0; j <= l1 - 1; j++)\n      t[j] = s[i + j];\n\n    if (strcmp(t, a) == 0) {\n      for (j = 0; j <= l1 - 1; j++)\n        s[i + j] = b[j];\n\n      break;\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "7", "index": "13309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], sub[100], rep[100];\n  int i, j, m, len, lens;\n  scanf(\"%s\\n%s\\n%s\", str, sub, rep);\n  len = strlen(str);\n  lens = strlen(sub);\n\n  for (i = 0; i < len; i++) {\n    if (str[i] == sub[0] && str[i + 1] == sub[1] &&\n        str[i + lens - 1] == sub[lens - 1]) {\n      j = i;\n      m = 0;\n      while (m < lens) {\n        str[j] = rep[m];\n        j++;\n        m++;\n      }\n      break;\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[256], substr[256], replace[256];\n  char p[256];\n\n  int k = 0;\n\n  int m;\n\n  cin >> str;\n\n  cin >> substr;\n\n  scanf(\"%s\", replace);\n\n  int str1 = strlen(str), str2 = strlen(substr), str3 = strlen(replace);\n  for (int i = 0; i <= str1 - str2; i++) {\n\n    m = 1;\n    for (int l = 0; l < strlen(substr); l++) {\n\n      if (str[i + l] != substr[l]) {\n        m = 0;\n        break;\n      }\n    }\n\n    int j;\n    if (m) {\n      k = 1;\n\n      for (j = i; j < i + str3; j++)\n        p[j] = replace[j - i];\n\n      for (k = i + str2, i = j; k < str1; k++, i++)\n        p[i] = str[k];\n\n      break;\n    } else {\n\n      p[i] = str[i];\n    }\n  }\n\n  if (k) {\n\n    for (int i = 0; i < strlen(str) - strlen(substr) + strlen(replace); i++)\n      printf(\"%c\", p[i]);\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[50], b[50];\n\n  int i, lenb, n, j, flag;\n  int k = 10001;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  lenb = (int)strlen(b);\n\n  for (i = 0; i <= (int)strlen(s); i++, flag = 0) {\n    for (n = 0, j = i; a[n] != '\u0000'; n++, j++) {\n      if (s[j] != a[n]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      continue;\n    else {\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (i == k) {\n      printf(\"%s\", b);\n      i = i + lenb - 1;\n      continue;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0;\n  char str[260], sub[20], rep[20];\n  scanf(\"%s%s%s\", str, sub, rep);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] == sub[0]) {\n      for (j = i + 1; j < i + strlen(sub); j++) {\n        if (str[j] != sub[j - i]) {\n          t = 1;\n        }\n      }\n      if (t == 0) {\n        for (int k = i; k < i + strlen(sub); k++)\n          str[k] = rep[k - i];\n\n        break;\n      }\n    }\n\n    t = 0;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "7", "index": "13313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[256], s2[256], s3[256];\n  int i, j, a = 1, n, m, k;\n  scanf(\"%s\", s1);\n  scanf(\"%s\", s2);\n  scanf(\"%s\", s3);\n  n = strlen(s1);\n  m = strlen(s2);\n  for (i = 0; i < n; i++)\n    if (s1[i] == s2[0]) {\n      for (j = 1; j < m; j++) {\n        if (s1[j + i] == s2[j])\n          a++;\n      }\n      if (a == m) {\n        for (k = 0; k < i; k++)\n          printf(\"%c\", s1[k]);\n        for (k = 0; k < m; k++)\n          printf(\"%c\", s3[k]);\n        for (k = i + m; k < n; k++)\n          printf(\"%c\", s1[k]);\n        cout << \"\\n\";\n        break;\n      }\n    }\n  if (a != m)\n    printf(\"%s\\n\", s1);\n  return 0;\n}\n"}
{"label": "7", "index": "13314", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[600];\n  char sub[300], rep[300];\n  int i, j, k, sun00 = 0, se = 0;\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> rep;\n\n  for (i = 0; str[i] != 0; i++) {\n\n    if (str[i] == sub[0]) {\n\n      for (k = i + 1, j = 1; str[k] != 0 && sub[j] != 0; k++, j++) {\n        if (str[k] != sub[j]) {\n          break;\n        }\n      }\n      if (sub[j] == 0) {\n\n        sun00 = i;\n        se = k;\n        break;\n      }\n    }\n  }\n\n  if (sun00 < se) {\n    if (strlen(sub) <= strlen(rep)) {\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n\n      for (k = se; str[k] != 0; k++, i++) {\n        str[i] = str[k];\n      }\n\n      str[i] = 0;\n    } else {\n\n      i = strlen(str) + strlen(rep) - strlen(sub);\n      for (k = strlen(str); k >= se; k--, i--) {\n        str[i] = str[k];\n      }\n\n      for (i = sun00, j = 0; rep[j] != 0; i++, j++) {\n        str[i] = rep[j];\n      }\n    }\n  }\n\n  printf(str);\n}\n"}
{"label": "7", "index": "13315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], t[256];\n  int j, ls1, lt, i, k = 0;\n  scanf(\"%s%s%s\", s, s1, t);\n  ls1 = strlen(s1);\n  lt = strlen(t);\n  for (i = 0; s[i]; i++) {\n    if (s[i] == s1[k]) {\n      k++;\n      if (k == ls1 - 1)\n        break;\n    } else\n      k = 0;\n  }\n  if (i >= strlen(s))\n    printf(\"%s\\n\", s);\n  else {\n    for (j = 0; j < i - ls1 + 2; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", t);\n    for (j = i + 2; j < strlen(s); j++)\n      printf(\"%c\", s[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257], d[257], e[257], f[257];\n  int i, n1, n2, k, j, m = 1;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> e;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n    for (k = 0; k < n2; k++)\n      c[k] = a[i + k];\n\n    c[n2] = 0;\n    if (strcmp(b, c) == 0) {\n      d[i] = 0;\n      for (j = 0; j < (n1 - n2 - i); j++) {\n        f[j] = a[i + n2 + j];\n      }\n      f[j] = 0;\n      cout << d << e << f;\n      m = 0;\n      break;\n    }\n  }\n  if (m) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13317", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, e = 0, k, l = 0;\n  char a[260] = {'\\0'}, b[260] = {'\\0'}, c[260] = {'\\0'};\n  cin >> b >> a >> c;\n  for (i = 0; i < strlen(b); i++) {\n    if (b[i] == a[0]) {\n      for (j = 0; j < strlen(a); j++) {\n        if (b[i + j] != a[j]) {\n          e = 1;\n        }\n      }\n      if (e == 0) {\n        k = i;\n        l = 1;\n        break;\n      } else\n        e = 0;\n    }\n  }\n\n  if (l == 1) {\n    for (i = 0; i < k; i++)\n      printf(\"%c\", b[i]);\n\n    printf(\"%s\", c);\n    for (i = k + strlen(a); i < strlen(b); i++)\n      printf(\"%c\", b[i]);\n\n  } else\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "7", "index": "13318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int i, j, k;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> re;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = i; j < strlen(sub) + i; j++) {\n      if (s[j] != sub[j - i])\n        break;\n      if (j == strlen(sub) + i - 1) {\n        for (k = j; k >= i; k--)\n          s[k] = re[k - i];\n      }\n    }\n    if (j == strlen(sub) + i)\n      break;\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "7", "index": "13319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n\n  char string[256];\n  scanf(\"%s\", string);\n\n  char substring[256];\n  scanf(\"%s\", substring);\n\n  char replacement[256];\n  cin >> replacement;\n\n  int Lsub = 0;\n  for (int i = 0;; i++) {\n    if (substring[i] == '\u0000') {\n      Lsub = i;\n      break;\n    }\n  }\n\n  int Lrep = 0;\n  for (int i = 0;; i++) {\n    if (replacement[i] == '\u0000') {\n      Lrep = i;\n      break;\n    }\n  }\n\n  int pBegin = 1000, judge = 1;\n  for (int i = 0; i < 256 - Lsub; i++) {\n    judge = 1;\n    for (int j = i; j < i + Lsub; j++) {\n      if (string[j] - substring[j - i] != 0) {\n        judge = 0;\n        break;\n      }\n      if (j - i == Lsub - 1) {\n        break;\n      }\n    }\n    if (judge == 1) {\n      pBegin = i;\n      break;\n    }\n  }\n  if (pBegin == 1000) {\n    printf(\"%s\", string);\n  }\n\n  else {\n\n    char Ans[512];\n    for (int i = 0; i < pBegin; i++) {\n      Ans[i] = string[i];\n    }\n\n    for (int i = pBegin; i < pBegin + Lrep; i++)\n      Ans[i] = replacement[i - pBegin];\n\n    for (int i = pBegin + Lrep;; i++) {\n      Ans[i] = string[i - (pBegin + Lrep) + pBegin + Lsub];\n      if (Ans[i] == '\u0000') {\n        break;\n      }\n    }\n\n    printf(\"%s\", Ans);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13320", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[500], su[500], re[500];\n  int len1, len2, i, j, k, l, m = 0;\n  scanf(\"%s %s %s \", s, su, re);\n  len1 = strlen(s);\n  len2 = strlen(su);\n  for (i = 0; i < len1 - len2 + 1; i++) {\n    k = 0;\n    for (j = 0; j < len2; j++) {\n      if (s[i + j] != su[j]) {\n        break;\n      } else {\n        k++;\n      }\n    }\n    if (k == len2) {\n      m++;\n      for (l = 0; l < len2; l++) {\n        s[i + l] = re[l];\n      }\n    }\n    if (m == 1) {\n      break;\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "7", "index": "13321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char y[256], z[256], h[256], sc[256];\n\n  cin >> y;\n\n  cin >> z;\n\n  cin >> h;\n  int k = 0, count = 0, o;\n  int a = strlen(y);\n  int b = strlen(z);\n  int c = strlen(h);\n  for (int i = 0; i < a; i++) {\n    if (y[i] == z[k]) {\n      k++;\n      count++;\n      if (count == b) {\n        break;\n      }\n    } else if (count != b) {\n      if (count > 0) {\n        i--;\n      }\n      count = 0;\n      k = 0;\n    }\n    o = i;\n  }\n  int e = o - k + 2;\n  int f = 0;\n  for (int m = 0; m < a; m++) {\n    if ((m >= e) && (m < e + c)) {\n      sc[m] = h[f];\n      f++;\n    } else {\n      sc[m] = y[m];\n    }\n  }\n  for (int l = 0; l < a; l++) {\n    printf(\"%c\", sc[l]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[257], b[257], c[257];\n  int i, k = 0, j, len1, len2, len3;\n  scanf(\"%s%s%s\", a, b, c);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  for (i = 0; i < len1; i++) {\n    for (j = 0; j < len2; j++) {\n      if (a[i + j] == b[j])\n        k++;\n    }\n    if (k == len2)\n      break;\n    k = 0;\n  }\n  if (k == len2) {\n    for (j = 0; j < i; j++) {\n      printf(\"%c\", a[j]);\n    }\n    for (j = 0; j < len3; j++) {\n      printf(\"%c\", c[j]);\n    }\n    for (j = i + len2; j < len1; j++) {\n      printf(\"%c\", a[j]);\n    }\n  }\n  if (k != len2) {\n    printf(\"%s\", a);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[256], sub[256], re[256];\n  int i, j, k;\n\n  cin >> s;\n\n  scanf(\"%s \", sub);\n\n  cin >> re;\n  for (i = 0; i < strlen(s); i++) {\n    for (j = i; j < strlen(sub) + i; j++) {\n      if (s[j] != sub[j - i])\n        break;\n      if (j == strlen(sub) + i - 1) {\n        for (k = j; k >= i; k--)\n          s[k] = re[k - i];\n      }\n    }\n    if (j == strlen(sub) + i)\n      break;\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "7", "index": "13324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[300], b[300];\n  int x = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int sl = strlen(s);\n  int al = strlen(a);\n  int bl = strlen(b);\n  for (int i = 0; i < sl; i++) {\n    if ((a[0] == s[i] && a[al - 2] == s[i + al - 2]) && x == 0) {\n      for (int w = 0; w < bl; w++) {\n        printf(\"%c\", b[w]);\n      }\n      i += al - 1;\n      x = 1;\n\n    }\n\n    else {\n\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13325", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[10000], subString[300], replacement[1000];\n  cin >> string >> subString >> replacement;\n  char *p, *q;\n  q = replacement;\n  p = strstr(string, subString);\n  if (p != NULL) {\n    while (*q)\n      *p++ = *q++;\n  }\n  cout << string << endl;\n  return 0;\n}\n"}
{"label": "7", "index": "13326", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, k;\n  char s[256], w[256], c[256], x[256];\n  scanf(\"%s\", w);\n  scanf(\"%s \", s);\n  scanf(\"%s\", c);\n  t = strlen(s);\n  for (i = 0; w[i] != '\\0'; i++) {\n    for (j = 0; j < t; j++) {\n      x[j] = w[i + j];\n    }\n    x[j] = '\\0';\n    if (strcmp(s, x) == 0) {\n      for (k = 0; k < t; k++) {\n        w[i + k] = c[k];\n      }\n      break;\n    }\n  }\n  printf(\"%s\", w);\n  return 0;\n}\n"}
{"label": "7", "index": "13327", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[250], substring[250], replacestring[200];\n  cin >> string >> substring >> replacestring;\n  int place = 0, i, j, flag = 1;\n  for (i = 0; string[i] != '\\0' && flag == 1; i++) {\n    if (string[i] != substring[0])\n      continue;\n    else {\n      place = i;\n      for (j = 0; substring[j] != '\\0'; j++) {\n        if (string[i++] != substring[j])\n          break;\n      }\n      if (substring[j] != '\\0')\n        place = 0;\n      else\n        flag = 0;\n    }\n  }\n  if (place) {\n    int l1 = strlen(substring), l2 = strlen(replacestring);\n    for (i = 0; string[i + place + l1] != '\\0'; i++)\n      replacestring[l2 + i] = string[place + l1 + i];\n    replacestring[l2 + i] = '\\0';\n    string[place] = '\\0';\n    cout << string << replacestring << endl;\n  } else\n    printf(\"%s\\n\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[300], substring[300], replacement[300], test[300];\n  int lensub, len, i, j;\n  scanf(\"%s\\n%s\\n%s\", string, substring, replacement);\n  len = strlen(string);\n  lensub = strlen(substring);\n  for (i = 0; i <= len - lensub; i++) {\n    for (j = 1; j <= lensub; j++) {\n      test[j - 1] = string[i + j - 1];\n      test[j] = '\\0';\n    }\n    if (strcmp(test, substring) != 0) {\n      printf(\"%c\", string[i]);\n    } else {\n      printf(\"%s\", replacement);\n      i += lensub;\n      break;\n    }\n  }\n  for (; i <= len - 1; i++) {\n    printf(\"%c\", string[i]);\n  }\n}\n"}
{"label": "7", "index": "13329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[256], s1[256], t[256];\n  int j, ls1, lt, i, k = 0;\n  scanf(\"%s%s%s\", s, s1, t);\n  ls1 = strlen(s1);\n  lt = strlen(t);\n  for (i = 0; s[i]; i++) {\n    if (s[i] == s1[k]) {\n      k++;\n      if (k == ls1 - 1)\n        break;\n    } else\n      k = 0;\n  }\n\n  if (i >= strlen(s))\n    printf(\"%s\\n\", s);\n  else {\n    for (j = 0; j < i - ls1 + 2; j++)\n      printf(\"%c\", s[j]);\n    printf(\"%s\", t);\n    for (j = i + 2; j < strlen(s); j++)\n      printf(\"%c\", s[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "7", "index": "13330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[256], substr[256], replace[256];\n  char p[256];\n\n  int k = 0;\n\n  int m;\n\n  scanf(\"%s\", str);\n\n  cin >> substr;\n\n  cin >> replace;\n\n  int str1 = strlen(str), str2 = strlen(substr), str3 = strlen(replace);\n  for (int i = 0; i <= str1 - str2; i++) {\n\n    m = 1;\n    for (int l = 0; l < strlen(substr); l++) {\n\n      if (str[i + l] != substr[l]) {\n        m = 0;\n        break;\n      }\n    }\n\n    int j;\n    if (m) {\n      k = 1;\n\n      for (j = i; j < i + str3; j++)\n        p[j] = replace[j - i];\n\n      for (k = i + str2, i = j; k < str1; k++, i++)\n        p[i] = str[k];\n\n      break;\n    } else {\n\n      p[i] = str[i];\n    }\n  }\n\n  if (k) {\n\n    for (int i = 0; i < strlen(str) - strlen(substr) + strlen(replace); i++)\n      cout << p[i];\n  } else {\n    printf(\"%s\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "7", "index": "13331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char string[256], subString[256], replacement[256], buffer[256] = {0},\n                                                      result[256] = {0};\n  cin >> string >> subString >> replacement;\n  int mainlen = strlen(string), sublen = strlen(subString);\n  int i;\n  for (i = 0; i <= mainlen - sublen; i++) {\n    strncpy(buffer, (string + i), sublen);\n    if (!strcmp(buffer, subString)) {\n      strncpy(result, string, i);\n      strcat(result, replacement);\n      strcat(result, (string + i + sublen));\n      cout << result;\n      return 0;\n    }\n  }\n  printf(\"%s\", string);\n  return 0;\n}\n"}
{"label": "7", "index": "13332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[300], c[300];\n  scanf(\"%s%s%s\", a, b, c);\n  int a1, b1, c1;\n  int i, j, k;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  c1 = strlen(c);\n  for (i = 0; i <= a1 - 1; i++) {\n    for (j = 0; j <= b1 - 1; j++) {\n      if (a[i + j] != b[j])\n        break;\n    }\n    if (j == b1) {\n      break;\n    }\n  }\n\n  if (i >= a1)\n    printf(\"%s\", a);\n  else {\n    for (k = 0; k < i; k++) {\n      printf(\"%c\", a[k]);\n    }\n    printf(\"%s\", c);\n    for (k = i + b1; k <= a1 - 1; k++)\n      printf(\"%c\", a[k]);\n  }\n}\n"}
{"label": "7", "index": "13333", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint strnl(char *, char *);\nvoid replace(char *str, int len_ss, int start, char *rpl);\n\nint main() {\n  char str[256], substr[256], rpl[256];\n  int start;\n  scanf(\"%s %s %s\", str, substr, rpl);\n  start = strnl(str, substr);\n  if (start != -1)\n    replace(str, strlen(substr), start, rpl);\n  else\n    printf(\"%s\\n\", str);\n  return 0;\n}\n\nint isstart(int i, char *s, char *subs) {\n  char temp[256];\n  char *p, *pt;\n  p = s + i;\n  pt = temp;\n  int j;\n  for (j = 0; j < strlen(subs); j++)\n    *pt++ = *p++;\n  *pt = 0;\n  if (!strcmp(temp, subs))\n    return 1;\n  return 0;\n}\n\nint strnl(char *s, char *subs) {\n  int i;\n  for (i = 0; i <= strlen(s) - strlen(subs); i++)\n    if (isstart(i, s, subs))\n      return i;\n  return -1;\n}\n\nvoid replace(char *str, int len_ss, int start, char *rpl) {\n  char temp[256];\n  strcpy(temp, str);\n  char *ptmp, *prpl;\n  ptmp = temp + start;\n  prpl = rpl;\n  while (*prpl)\n    *ptmp++ = *prpl++;\n  char *pstr = str + start + len_ss;\n  while (*pstr)\n    *ptmp++ = *pstr++;\n  *ptmp = 0;\n  strcpy(str, temp);\n  printf(\"%s\\n\", temp);\n}\n"}
{"label": "7", "index": "13334", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, t = 0, l, p, h, n, m;\n  char str[3][600];\n  for (i = 0; i < 3; i++)\n    scanf(\"%s\", str[i]);\n  m = strlen(str[1]);\n  n = strlen(str[0]);\n  p = strlen(str[2]);\n  for (i = 0; i < n - m + 1, j < m; i++) {\n    if (str[0][i] == str[1][j]) {\n      t++;\n      j++;\n    } else {\n      j = 0;\n      t = 0;\n    }\n    if (t == m)\n      break;\n  }\n  if (t != m)\n    printf(\"%s\", str[0]);\n  else {\n    for (l = i - m + 1, h = 0; h < p; h++, l++)\n      str[0][l] = str[2][h];\n    printf(\"%s\", str[0]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13335", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string1[256], string2[256], string3[256];\n  scanf(\"%s\", string1);\n  scanf(\"%s\", string2);\n  cin >> string3;\n  int length1, length2, length3, i, j, temp;\n  length1 = strlen(string1);\n  length2 = strlen(string2);\n  length3 = strlen(string3);\n  for (i = 0; i <= (length1 - length2); i++) {\n    if (string1[i] == string2[0]) {\n      j = 1;\n      temp = i + 1;\n      while (j < length2 && string1[temp] == string2[j]) {\n        temp++;\n        j++;\n      }\n      if (j == length2) {\n        strcpy(string2, string1 + temp);\n        strcpy(string1 + i, string3);\n        strcpy(string1 + i + length3, string2);\n        break;\n      }\n    }\n  }\n  printf(\"%s\\n\", string1);\n}\n"}
{"label": "7", "index": "13336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, e = 0, j, n, m;\n  char s[256], a[256], b[256];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char *pa = a, *ps = s, *p;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; *ps != '\u0000'; ps++, i++) {\n    if (*pa == *ps) {\n      e++;\n      for (pa = pa + 1, ps = ps + 1; *pa != '\u0000'; pa++, ps++) {\n        if (*pa == *ps) {\n          e++;\n        }\n      }\n    }\n\n    if (e == m) {\n\n      p = s;\n      for (j = 0; j < i; j++) {\n        printf(\"%c\", *p);\n        p++;\n      }\n      printf(\"%s\", b);\n      if (n - i > m) {\n        for (j = 0; j < m; j++) {\n          p++;\n        }\n        printf(\"%s\", p);\n        break;\n      } else {\n        break;\n      }\n    } else {\n      if (e > 0) {\n        pa = a;\n        for (j = 0; j < m; j++) {\n          ps--;\n        }\n      }\n    }\n    e = 0;\n  }\n\n  if (e != m) {\n    printf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13337", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0}, c[100] = {0};\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  int lb, la;\n  lb = strlen(b);\n  la = strlen(a);\n  int count = 0;\n  for (int i = 0; i <= la - lb; i++) {\n    count = 0;\n    for (int j = 0; j < lb; j++) {\n      if (a[i + j] != b[j]) {\n        count = 1;\n        break;\n      }\n    }\n\n    if (count == 0) {\n      a[i] = 1;\n      for (int j = 1; j < lb; j++)\n        a[i + j] = 2;\n      break;\n    }\n  }\n  for (int i = 0; i < la; i++) {\n    if (a[i] == 1)\n      printf(\"%s\", c);\n    if (a[i] == 2)\n      ;\n    if (a[i] != 2 && a[i] != 1)\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[256], t[256], h[256];\n  cin >> s >> t >> h;\n  int ss = strlen(s), tt = strlen(t);\n  int i, j, count = 0, place = -1;\n  for (i = 0; i < ss; i++) {\n    count = 0;\n    for (j = 0; j < tt; j++) {\n      if (t[j] - s[i + j] == 0)\n        count++;\n    }\n    if (count == tt) {\n      place = i;\n      break;\n    }\n  }\n  if (place == -1)\n    printf(\"%s\", s);\n  else {\n    for (i = 0; i < place; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", h);\n    for (i = place + tt; i < ss; i++)\n      printf(\"%c\", s[i]);\n  }\n}\n"}
{"label": "7", "index": "13339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, j = 0, l1, l2, e = 0;\n  char a[256], b[256], c[256], d[256];\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  l = strlen(a);\n  l1 = strlen(b);\n  l2 = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (e == 0) {\n      if (a[i] == b[j]) {\n        d[j] = a[i];\n        j++;\n      } else {\n        if (j != 0 && e != 1) {\n          d[j] = '\\0';\n          printf(\"%s\", d);\n        }\n        j = 0;\n        printf(\"%c\", a[i]);\n      }\n      if (j == l1 && e == 0) {\n        printf(\"%s\", c);\n        i = i - l1 + l2;\n        e = 1;\n      }\n    } else\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "7", "index": "13340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[257], b[257], r[257];\n  scanf(\"%s\", b);\n  scanf(\"%s\", a);\n  scanf(\"%s\", r);\n  int c, d, count, e;\n  int j, h, y;\n  c = strlen(a);\n  d = strlen(b);\n  e = strlen(r);\n\n  for (j = 0; j < d; j++) {\n    y = 0;\n    h = j;\n    if (b[j] != a[0])\n      continue;\n    else {\n      count = 1;\n      for (int t = 1; t < c; t++) {\n\n        if (a[t] == b[j + t])\n          count++;\n      }\n    }\n    if (count == c) {\n      y = 1;\n      break;\n    }\n    if (y == 1)\n      break;\n  }\n  if (y == 1) {\n\n    for (j = 0; j < h; j++)\n      cout << b[j];\n    for (j = 0; j < e; j++)\n      printf(\"%c\", r[j]);\n    for (j = h + c; j < d; j++)\n      printf(\"%c\", b[j]);\n  } else\n    printf(\"%s\", b);\n\n  return 0;\n}\n"}
{"label": "8", "index": "13341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  cin >> A;\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    cout << c[j];\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  input();\n  paixu();\n  hebing();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "13342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid px(int a[], int n) {\n  int i, j, x;\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n}\nvoid hb(int a[], int m, int b[], int n) {\n  int c[1000];\n  int i, j, k;\n  for (i = 0; i <= m - 1; i++)\n    c[i] = a[i];\n  for (j = m; j <= m + n - 1; j++)\n    c[j] = b[j - m];\n  for (k = 0; k < m + n - 1; k++)\n    printf(\"%d \", c[k]);\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int b[1000];\n  for (j = 0; j <= n - 1; j++)\n    scanf(\"%d\", &b[j]);\n  px(a, m);\n  px(b, n);\n  hb(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint scan() {\n  int m;\n  scanf(\"%d\", &m);\n  return m;\n}\nint fuzhi(int a[], int n) {\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k);\n    a[i] = k;\n  }\n  return 0;\n}\nint paixu(int b[], int n) {\n  int i, j, temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  return 0;\n}\nint print(int c[], int d[], int m3, int m4) {\n  int i = 0;\n  for (i = 0; i < m3; i++) {\n    printf(\"%d \", c[i]);\n  }\n  for (i = 0; i < m4; i++) {\n    printf(\"%d\", d[i]);\n    if (i != m4 - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int m1;\n  int m2;\n  int x[100];\n  int y[100];\n  m1 = scan();\n  m2 = scan();\n  fuzhi(x, m1);\n  fuzhi(y, m2);\n  paixu(x, m1);\n  paixu(y, m2);\n  print(x, y, m1, m2);\n  return 0;\n}\n"}
{"label": "8", "index": "13344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid program(void) {\n  int m, n, i, j;\n  scanf(\"%d %d \", &m, &n);\n  const int M = n, N = n;\n  int a[M], b[N];\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n  for (i = 0; i < m; ++i)\n    for (j = i + 1; j < m; ++j)\n      if (a[i] > a[j]) {\n        a[i] = a[i] + a[j];\n        a[j] = a[i] - a[j];\n        a[i] = a[i] - a[j];\n      }\n  for (i = 0; i < n; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (b[i] > b[j]) {\n        b[i] = b[i] + b[j];\n        b[j] = b[i] - b[j];\n        b[i] = b[i] - b[j];\n      }\n  cout << a[0];\n  for (i = 1; i < m; ++i)\n    cout << ' ' << a[i];\n  for (i = 0; i < n; ++i)\n    cout << ' ' << b[i];\n}\n\nint main() {\n  program();\n  return 0;\n}\n"}
{"label": "8", "index": "13345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n\n  int a[1000], b[1000];\n  int m, n, i, t, j;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu() {\n  int a[100], b[100], sizea, sizeb, i, j, t;\n  cin >> sizea >> sizeb;\n  for (i = 1; i <= sizea; i++)\n    cin >> a[i];\n  for (i = 1; i <= sizeb; i++)\n    cin >> b[i];\n  for (i = sizea; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = sizeb; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= sizea; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= sizeb; i++) {\n    cout << b[i];\n    if (i < sizeb)\n      cout << \" \";\n    else\n      cout << endl;\n  }\n}\nint main() {\n  paixu();\n  return 0;\n}\n"}
{"label": "8", "index": "13347", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int aa[100], bb[100], cc[200], la, lb;\n  void scan(int a[], int la, int b[], int lb);\n  void sort(int a[], int n);\n  void combine(int a[], int la, int b[], int lb, int c[]);\n\n  scanf(\"%d %d\", &la, &lb);\n\n  scan(aa, la, bb, lb);\n  sort(aa, la);\n  sort(bb, lb);\n\n  combine(aa, la, bb, lb, cc);\n}\n\nvoid scan(int a[], int la, int b[], int lb) {\n  int i;\n\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, k, temp;\n\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[k])\n        k = j;\n    temp = a[k];\n    a[k] = a[i];\n    a[i] = temp;\n  }\n}\n\nvoid combine(int a[], int la, int b[], int lb, int c[]) {\n  int i;\n\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n  for (i = 0; i < la + lb; i++)\n    c[i] = a[i];\n  printf(\"%d\", c[0]);\n  for (i = 1; i < la + lb; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "13348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int M, N;\n  scanf(\"%d%d\", &M, &N);\n  int a[100], b[100];\n  int i;\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  qsort(a, M, sizeof(int), Compare);\n  for (i = 0; i < M; i++) {\n    printf(\"\");\n  }\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(b, N, sizeof(int), Compare);\n  for (i = 0; i < N; i++)\n    printf(\"\");\n\n  int c[200];\n  for (i = 0; i < M; i++) {\n    c[i] = a[i];\n  }\n  int j;\n  for (j = 0; j < N; j++, i++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < M + N - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[i]);\n}\n"}
{"label": "8", "index": "13349", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint i, j, x, y, a[10], b[10], c[20];\nvoid array_1() {\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid row() {\n  int t;\n  for (i = 0; i < x; i++) {\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < y; i++) {\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  for (i = 0; i < x; i++) {\n    c[i] = a[i];\n  }\n  for (i = x; i < (x + y); i++) {\n    c[i] = b[i - x];\n  }\n}\n\nvoid print() {\n  for (i = 0; i < (x + y); i++) {\n    if (i != (x + y - 1)) {\n      printf(\"%d \", c[i]);\n    } else\n      printf(\"%d \", c[i]);\n  }\n}\n\nint main() {\n  array_1();\n  row();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint m, n, i, j, k, xx;\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid init(int a[], int b[]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n}\nint main() {\n  init(a, b);\n  sort(a, m);\n  sort(b, n);\n  merge(a, b, m, n);\n  output(a, m + n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "13351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int au(int x, int y);\n  int x, y;\n  scanf(\"%d%d\", &x, &y);\n  au(x, y);\n}\nint au(int x, int y) {\n  int a[100], b[100], i, j, m, n;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 0; i < x; i++) {\n    for (m = 0; m < x - i - 1; m++) {\n      if (a[m] > a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < y; j++) {\n    for (n = 0; n < y - j - 1; n++) {\n      if (b[n] > b[n + 1]) {\n        int t = b[n];\n        b[n] = b[n + 1];\n        b[n + 1] = t;\n      }\n    }\n  }\n  for (m = x; m < x + y; m++) {\n    a[m] = b[m - x];\n  }\n  for (m = 0; m < x + y - 1; m++) {\n    printf(\"%d \", a[m]);\n  }\n  printf(\"%d\", a[x + y - 1]);\n}\n"}
{"label": "8", "index": "13352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n;\nint a[1000];\nint b[1000];\nint c[2000];\nint i;\nint j;\n\nvoid f1() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n}\nvoid f2() {\n  int t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3() {\n  int s;\n  for (s = 0, i = 0; s < m, i < m; s++, i++)\n    c[s] = a[i];\n  for (s = m, j = 0; s < m + n - 2, j < n; s++, j++)\n    c[s] = b[j];\n}\nvoid f4() {\n  cout << c[0];\n  for (i = 1; i <= m + n - 1; i++)\n    cout << \" \" << c[i];\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "13353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, i, j;\nint a[10000];\nvoid input() {\n  cin >> n >> m;\n  for (i = 0; i < n + m; i++)\n    cin >> a[i];\n}\n\nvoid fsort() {\n  sort(a, a + n);\n  sort(a + n, a + n + m);\n}\nvoid print() {\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  input();\n  fsort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int b[], int c, int d) {\n  int i, j, t;\n  for (i = 0; i < c; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < c; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < d; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  int a[15], b[15], c, d, i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < d; i++)\n    scanf(\"%d\", &b[i]);\n  f1(a, b, c, d);\n}\n"}
{"label": "8", "index": "13355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, c;\n  int a[60] = {0}, b[30] = {0};\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (a[i] < a[j]) {\n        c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] < b[j]) {\n        c = b[i];\n        b[i] = b[j];\n        b[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int c[], int x) {\n  int p;\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        p = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int a[100], b[100];\n  int m, n, i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &b[j]);\n  f(a, m);\n  f(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[j];\n  return 0;\n}\n"}
{"label": "8", "index": "13357", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &shu1[i]);\n  for (i = 0; i < n; i++) {\n    cin >> shu2[i];\n  }\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13358", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid car() {\n  int n, m, i = 0, a[100], b[100];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < m - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[i];\n  return;\n}\n\nint main() {\n  car();\n  return 0;\n}\n"}
{"label": "8", "index": "13359", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int a[], int b[]) {\n  int i, m, n;\n  scanf(\"%d %d\", &a[49], &b[49]);\n  m = a[49];\n  n = b[49];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int m, int n, int a[], int b[]) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid comb(int m, int n, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < (m + n); i++)\n    c[i] = b[i - m];\n}\nvoid print(int m, int n, int c[]) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < (m + n); i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  int a[50], b[50], c[100];\n  input(a, b);\n  order(a[49], b[49], a, b);\n  comb(a[49], b[49], a, b, c);\n  print(a[49], b[49], c);\n}\n"}
{"label": "8", "index": "13360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void qz(int s[], int m);\n  void px(int s[], int m);\n  void hb(int s[], int t[], int m, int n);\n  void xs(int s[], int m);\n  int n, m;\n  int a[200], b[200];\n  scanf(\"%d%d\", &m, &n);\n  qz(a, m);\n  qz(b, n);\n  px(a, m);\n  px(b, n);\n  hb(a, b, m, n);\n  xs(a, m + n);\n  return 0;\n}\nvoid qz(int s[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid px(int s[], int m) {\n  int i, j, t;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (s[j] < s[i]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid hb(int s[], int t[], int m, int n) {\n  int i;\n  for (i = m; i <= m + n - 1; i++) {\n    s[i] = t[i - m];\n  }\n}\nvoid xs(int s[], int m) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", s[i]);\n  }\n}\n"}
{"label": "8", "index": "13361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *num(int a) {\n  int *p, i;\n  p = (int *)malloc(a * sizeof(int));\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return p;\n}\n\nvoid rank_1(int *p, int a) {\n  int i, j, t;\n  for (i = a - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        t = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = t;\n      }\n    }\n  }\n}\n\nint *add(int *p1, int *p2, int a, int b) {\n  int i;\n  int *p3 = (int *)malloc((a + b) * sizeof(int));\n  for (i = 0; i < a; i++)\n    *(p3 + i) = *(p1 + i);\n  for (i = 0; i < b; i++)\n    *(p3 + a + i) = *(p2 + i);\n  return p3;\n}\n\nvoid print(int *p3, int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", p3[0]);\n    else\n      cout << \" \" << p3[i];\n  }\n}\n\nint main() {\n  int a, b, *p1, *p2, *p3;\n  scanf(\"%d\", &a);\n  scanf(\"%d\", &b);\n  p1 = num(a);\n  p2 = num(b);\n  rank_1(p1, a);\n  rank_1(p2, b);\n  p3 = add(p1, p2, a, b);\n  print(p3, (a + b));\n  free(p1);\n  free(p2);\n  free(p3);\n  return 0;\n}\n"}
{"label": "8", "index": "13362", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void shuru(int *p, int m);\n  void paixu(int *p, int m);\n  void hebing(int *p1, int m, int *p2, int n);\n  void shuchu(int *p, int);\n  int m, n, i;\n  int *p1, *p2;\n  int a[200], b[100];\n  p1 = a;\n  p2 = b;\n  scanf(\"%d%d\", &m, &n);\n  shuru(p1, m);\n  shuru(p2, n);\n  paixu(p1, m);\n  paixu(p2, n);\n  hebing(p1, m, p2, n);\n  shuchu(p1, m + n);\n}\nvoid shuru(int *p, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n}\nvoid paixu(int *p, int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++)\n      if (*(p + i) > *(p + j)) {\n        temp = *(p + i);\n        *(p + i) = *(p + j);\n        *(p + j) = temp;\n      }\n}\nvoid hebing(int *p1, int m, int *p2, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    *(p1 + m + i) = *(p2 + i);\n}\nvoid shuchu(int *p, int x) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d%c\", *(p + i), i != (x - 1) ? ' ' : '\\n');\n}\n"}
{"label": "8", "index": "13363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid mode(int x, int y) {\n  int num1[100], num2[100], num3[200];\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    cin >> num1[i];\n  for (j = 0; j < x - 1; j++)\n    for (k = 0; k < x - 1 - j; k++)\n      if (num1[k] > num1[k + 1])\n        swap(num1[k], num1[k + 1]);\n  for (i = 0; i < y; i++)\n    cin >> num2[i];\n  for (j = 0; j < y - 1; j++)\n    for (k = 0; k < y - 1 - j; k++)\n      if (num2[k] > num2[k + 1])\n        swap(num2[k], num2[k + 1]);\n  for (i = 0; i < x; i++)\n    num3[i] = num1[i];\n  for (i = x; i < (x + y); i++)\n    num3[i] = num2[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    printf(\"%d \", num3[i]);\n  printf(\"%d\", num3[x + y - 1]);\n}\nint main() {\n  int x, y;\n  cin >> x >> y;\n  mode(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, a[100], b[100], i, q, j;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        q = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = q;\n      }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        q = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = q;\n      }\n  }\n\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input(int n) \n{\n  cin >> n;\n  return n;\n}\nvoid paixu(int a[], int n) \n{\n  int i, j, p;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[], int n1, int n2) \n{\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1] << endl;\n}\nint main() \n{\n  int a[100], b[100], n1, n2, i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    a[i] = input(a[i]);\n  for (i = 0; i < n2; i++)\n    b[i] = input(b[i]);\n  paixu(a, n1);\n  paixu(b, n2);\n  add(a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a1[100], a2[100];\nvoid get(int n1, int n2) {\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\nvoid arrange(int n1, int n2) {\n  int temp;\n  for (int j = 1; j <= n1 - 1; j++) {\n    for (int i = 0; i <= n1 - j - 1; i++) {\n      if (a1[i] > a1[i + 1]) {\n        temp = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = temp;\n      }\n    }\n  }\n  for (int j = 1; j <= n2 - 1; j++) {\n    for (int i = 0; i <= n2 - j - 1; i++) {\n      if (a2[i] > a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n      }\n    }\n  }\n}\nint combine(int n1, int n2) {\n  int out[100];\n  for (int i = 0; i < n1; i++) {\n    out[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    out[n1 + i] = a2[i];\n  }\n  for (int i = 0; i < n1 + n2 - 1; i++) {\n    cout << out[i] << \" \";\n  }\n  cout << out[n1 + n2 - 1];\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  get(a, b);\n  arrange(a, b);\n  combine(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  void func(int, int);\n  scanf(\"%d%d\", &a, &b);\n  func(a, b);\n  return 0;\n}\nvoid func(int x, int y) {\n  int i, j, t, q;\n  int a[100], b[100];\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    printf(\"%d \", a[i]);\n\n  for (i = 0, q = 0; i < y; i++) {\n    if (q < y - 1) {\n      printf(\"%d \", b[i]);\n      q = q + 1;\n    } else\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "13368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *p, *q, *s;\nint m, n;\n\nint pfCompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &q[i]);\n}\n\nint downsort() {\n  qsort(p, m, sizeof(int), pfCompare);\n  qsort(q, n, sizeof(int), pfCompare);\n}\n\nint combine() {\n  s = (int *)malloc((m + n) * sizeof(int));\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = p[i];\n  for (i = m; i < m + n; i++)\n    s[i] = q[i - m];\n}\n\nint output() {\n  int i;\n  cout << s[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", s[i]);\n  free(p);\n  free(q);\n  free(s);\n}\n\nint main() {\n  input();\n  downsort();\n  combine();\n  output();\n}\n"}
{"label": "8", "index": "13369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int str[], int n1);\nvoid hebing(int str1[], int str2[], int n1, int n2);\nvoid shuchu(int str[], int n);\nint main() {\n  int n1, n2;\n  int a[100], b[100];\n  scanf(\"%d%d\", &n1, &n2);\n  paixu(a, n1);\n  paixu(b, n2);\n  hebing(a, b, n1, n2);\n  shuchu(a, n1 + n2);\n}\nvoid paixu(int str[], int n) {\n  int i, p, m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  for (p = 1; p < n; p++)\n    for (i = 0; i <= n - 1 - p; i++)\n      if (str[i] > str[i + 1]) {\n        m = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = m;\n      }\n}\nvoid hebing(int str1[], int str2[], int n1, int n2) {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    str1[i] = str2[i - n1];\n}\nvoid shuchu(int str[], int n) {\n  int i;\n  printf(\"%d\", str[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", str[i]);\n}\n"}
{"label": "8", "index": "13370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid read(int *pm, int *pn, int *p1, int *p2) {\n  int i, j;\n  scanf(\"%d %d\", pm, pn);\n  for (i = 0; i < *pm; i++)\n    scanf(\"%d\", p1 + i);\n  for (j = 0; j < *pn; j++)\n    scanf(\"%d\", p2 + j);\n}\n\nvoid sort(int *pm, int *pn, int *p1, int *p2) {\n  int i, j, k, tmp;\n  for (i = 0; i < *pm - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pm; j++)\n      if (*(p1 + j) < *(p1 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p1 + k);\n      *(p1 + k) = *(p1 + i);\n      *(p1 + i) = tmp;\n    }\n  }\n  for (i = 0; i < *pn - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pn; j++)\n      if (*(p2 + j) < *(p2 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p2 + k);\n      *(p2 + k) = *(p2 + i);\n      *(p2 + i) = tmp;\n    }\n  }\n}\n\nint combine(int *pm, int *pn, int *p1, int *p2, int *pnew) {\n  int i, j;\n  for (i = 0; i < *pm; i++)\n    *(pnew + i) = *(p1 + i);\n  for (j = 0; j < *pn; j++)\n    *(pnew + i + j) = *(p2 + j);\n  return i + j;\n}\n\nvoid print(int *pk, int *pnew) {\n  int i;\n  for (i = 0; i < *pk; i++) {\n    printf(\"%d\", *(pnew + i));\n    if (i == *pk - 1)\n      printf(\"\\n\");\n    else\n      printf(\" \");\n  }\n}\n\nint main() {\n  int m = 0, n = 0, k = 0, a[10] = {0}, b[10] = {0};\n  int *pm = &m, *pn = &n, *pa = a, *pb = b;\n  int New[20] = {0}, *pk = &k, *pnew = New;\n  read(pm, pn, pa, pb);\n  sort(pm, pn, pa, pb);\n  *pk = combine(pm, pn, pa, pb, pnew);\n  print(pk, pnew);\n  return 0;\n}\n"}
{"label": "8", "index": "13371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nint out[200];\n\nvoid p1(void) {\n  int i;\n\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &num1[i]);\n\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &num2[i]);\n  }\n}\n\nvoid p2(int num1[100], int num2[100], int n1, int n2) {\n  int i, j, tmp;\n\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tmp = num1[j];\n        num1[j] = num1[i];\n        num1[i] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tmp = num2[j];\n        num2[j] = num2[i];\n        num2[i] = tmp;\n      }\n    }\n  }\n}\n\nvoid p3(int num1[100], int num2[100], int n1, int n2) {\n\n  int i = 0, j = 0;\n  while (i < n1) {\n    out[i] = num1[i];\n    i++;\n  }\n  while (j < n2) {\n    out[n1 + j] = num2[j];\n    j++;\n  }\n}\n\nvoid p4(int out[200], int n) {\n  int i;\n  printf(\"%d\", out[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", out[i]);\n  }\n}\nint main() {\n  p1();\n  p2(num1, num2, n1, n2);\n  p3(num1, num2, n1, n2);\n  p4(out, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20000], b[10000], n, m;\nvoid f1(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int a[], int n) {\n  int i, j;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        int t;\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  f1(a, n);\n  f1(b, m);\n  f2(a, n);\n  f2(b, m);\n  f3(a, b, n, m);\n}\n"}
{"label": "8", "index": "13373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint x[200], y[200], m, n;\nvoid sca(void) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &y[i]);\n  }\n}\n\nvoid bubble(int a[], int n)\n\n{\n  int i, j, b;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n}\n\nvoid bing(int a[], int l1, int b[], int l2) {\n  int i, j, z[500];\n  for (i = 0; i < l1; i++)\n    z[i] = a[i];\n  for (j = 0; i < (l1 + l2); j++, i++)\n    z[i] = b[j];\n  printf(\"%d\", z[0]);\n  for (i = 1; i < (l1 + l2); i++)\n    printf(\" %d\", z[i]);\n}\n\nint main() {\n  sca();\n  bubble(x, m);\n  bubble(y, n);\n  bing(x, m, y, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid a();\nvoid b();\nvoid c();\nvoid d();\nint x1[1000], x2[499], n1, n2;\nint main() {\n\n  a();\n  b();\n  c();\n  d();\n\n  return 0;\n}\n\nvoid a() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &x1[i]);\n  }\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &x2[i]);\n}\nvoid b() {\n  int i, j, p;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (x1[i] > x1[j]) {\n        p = x1[i];\n        x1[i] = x1[j];\n        x1[j] = p;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (x2[i] > x2[j]) {\n        p = x2[i];\n        x2[i] = x2[j];\n        x2[j] = p;\n      }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    x1[n1 + i] = x2[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", x1[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13375", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, a1[10000], a2[10000], a3[20000];\n\nvoid input(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\n\nvoid sort(void) {\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - i - 1; j++) {\n      if (a1[j] > a1[j + 1]) {\n        int temp = a1[j + 1];\n        a1[j + 1] = a1[j];\n        a1[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - i - 1; j++) {\n      if (a2[j] > a2[j + 1]) {\n        int temp = a2[j + 1];\n        a2[j + 1] = a2[j];\n        a2[j] = temp;\n      }\n    }\n  }\n}\n\nvoid joint(void) {\n  for (int i = 0; i < n1; i++) {\n    a3[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++)\n    a3[n1 + i] = a2[i];\n}\n\nvoid display(void) {\n  cout << a3[0];\n  for (int i = 1; i < n1 + n2; i++) {\n    cout << ' ' << a3[i];\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  input();\n  sort();\n  joint();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "13376", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j + 1] < a[j]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (b[j + 1] < b[j]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid f4(int a[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[m + n - 1]);\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[1000];\n  int b[1000];\n\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, m, n);\n  f4(a, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len1, len2, array1[100], array2[100], sa[100];\nvoid zp1(int a1[100], int l1) {\n  int cur1;\n  for (int i = 0; i < l1 - 1; i++)\n    for (int j = 0; j < l1 - 1 - i; j++)\n      if (a1[j] > a1[j + 1]) {\n        cur1 = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = cur1;\n      }\n}\nvoid zp2(int a2[100], int l2) {\n  int cur2;\n  for (int i = 0; i < l2 - 1; i++)\n    for (int j = 0; j < l2 - 1 - i; j++)\n      if (a2[j] > a2[j + 1]) {\n        cur2 = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = cur2;\n      }\n}\nvoid connection(int a1[100], int a2[100]) {\n  for (int i = 0; i < len1; i++)\n    sa[i] = array1[i];\n  for (int i = len1; i < len1 + len2; i++)\n    sa[i] = array2[i - len1];\n}\n\nint main() {\n\n  cin >> len1 >> len2;\n  for (int i = 0; i < len1; i++)\n    cin >> array1[i];\n  for (int i = 0; i < len2; i++)\n    cin >> array2[i];\n  zp1(array1, len1);\n  zp2(array2, len2);\n  connection(array1, array2);\n  cout << sa[0];\n  for (int i = 1; i < len1 + len2; i++)\n    cout << \" \" << sa[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "13378", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100];\nint m, n;\n\nvoid insert(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\n\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  insert();\n  paixu(a, b);\n  hebing();\n  output();\n}\n"}
{"label": "8", "index": "13379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint arr(int a[], int x, int b[], int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  return 0;\n}\nint arr1(int a[], int x, int b[], int y) {\n  int i, j, tmp;\n  for (i = 0; i < x - 1; i++)\n    for (j = i + 1; j < x; j++)\n      if (a[i] > a[j]) {\n        tmp = a[i];\n        a[i] = a[j];\n        a[j] = tmp;\n      }\n  for (i = 0; i < y - 1; i++) {\n    for (j = i + 1; j < y; j++) {\n      if (b[i] > b[j]) {\n        tmp = b[i];\n        b[i] = b[j];\n        b[j] = tmp;\n      }\n    }\n  }\n  return 0;\n}\nint arr2(int a[], int x, int b[], int y, int c[]) {\n  int i, j;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (; i < x + y; i++)\n    c[i] = b[i - x];\n  return 0;\n}\nint arr3(int c[], int t) {\n  int i;\n  for (i = 0; i < t; i++) {\n    printf(\"%d\", c[i]);\n    if (i < t - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint main() {\n  int x, y;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &x, &y);\n  arr(a, x, b, y);\n  arr1(a, x, b, y);\n  arr2(a, x, b, y, c);\n  arr3(c, x + y);\n  return 0;\n}\n"}
{"label": "8", "index": "13380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100], c[200];\nint x, y;\n\nvoid oh()\n\n{\n  int i;\n  scanf(\"%d %d\", &x, &y);\n\n  for (i = 0; i < x - 1; i++)\n    cin >> a[i];\n\n  scanf(\"%d\\n\", &a[x - 1]);\n\n  for (i = 0; i < y - 1; i++)\n    scanf(\"%d \", &b[i]);\n\n  cin >> b[y - 1];\n}\n\nvoid ba() {\n\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n\n  for (i = 0; i < y; i++)\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n}\n\nvoid zha() {\n\n  int i;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n}\n\nvoid hei() {\n\n  int i;\n  for (i = 0; i < x + y - 1; i++) {\n\n    printf(\"%d \", c[i]);\n  }\n\n  printf(\"%d\", c[x + y - 1]);\n}\n\nint main() {\n  oh();\n  ba();\n  zha();\n  hei();\n}\n"}
{"label": "8", "index": "13381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  if (*(int *)elem1 > *(int *)elem2)\n    return 1;\n  if (*(int *)elem1 == *(int *)elem2)\n    return 0;\n  if (*(int *)elem1 < *(int *)elem2)\n    return -1;\n}\nint *shuru(int m, int *a) {\n  a = (int *)malloc(m * sizeof(int));\n  int i;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < m; i++)\n    scanf(\" %d\", &a[i]);\n\n  return a;\n}\nint main() {\n  int suma, sumb, i;\n  int *a;\n  int *b;\n  scanf(\"%d %d\", &suma, &sumb);\n  a = shuru(suma, a);\n  b = shuru(sumb, b);\n  qsort(a, suma, sizeof(int), Compare);\n  qsort(b, sumb, sizeof(int), Compare);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < suma; i++) {\n    printf(\" %d\", a[i]);\n  }\n  printf(\" %d\", b[0]);\n  for (i = 1; i < sumb; i++) {\n    printf(\" %d\", b[i]);\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "8", "index": "13382", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int n, int a[100]) {\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n}\nint paixu(int a[100], int n) {\n  int i, j, t;\n  for (j = n - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  return (*a);\n}\nvoid mix(int a[], int b[], int c[], int e, int d) {\n  int i = 0, t;\n  for (i = 0; i < e; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    c[i + e] = b[i];\n  }\n}\nvoid out(int c[300], int e, int d) {\n  int i = 0;\n  for (i = 0; i < e + d - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  cout << c[e + d - 1];\n}\nint main() {\n  int a[100], b[100], c[300], x, y;\n  cin >> x >> y;\n  read(x, a);\n  read(y, b);\n  paixu(a, x);\n  paixu(b, y);\n  mix(a, b, c, x, y);\n  out(c, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid shuru(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid paixu(int b[], int m) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m], b[n];\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint m, n;\nint i, j, t;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[j] < a[i]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] < b[i]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid cat() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid print() {\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  read();\n  sort();\n  cat();\n  print();\n}\n"}
{"label": "8", "index": "13385", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200];\nint x, y;\n\nvoid oh()\n\n{\n  int i;\n  scanf(\"%d %d\", &x, &y);\n\n  for (i = 0; i < x - 1; i++)\n    scanf(\"%d \", &a[i]);\n\n  scanf(\"%d\\n\", &a[x - 1]);\n\n  for (i = 0; i < y - 1; i++)\n    scanf(\"%d \", &b[i]);\n\n  scanf(\"%d\\n\", &b[y - 1]);\n}\n\nvoid ba() {\n\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n\n  for (i = 0; i < y; i++)\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n}\n\nvoid zha() {\n\n  int i;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n}\n\nvoid hei() {\n\n  int i;\n  for (i = 0; i < x + y - 1; i++) {\n\n    printf(\"%d \", c[i]);\n  }\n\n  printf(\"%d\", c[x + y - 1]);\n}\n\nint main() {\n  oh();\n  ba();\n  zha();\n  hei();\n  return 0;\n}\n"}
{"label": "8", "index": "13386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int x, int z[20]) {\n  int i, j, middle;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1; j++) {\n      if (z[j] > z[j + 1]) {\n        middle = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = m; i < m + n - 1; i++)\n    cout << b[i - m] << \" \";\n  if (i = m + n - 1)\n    cout << b[n - 1];\n}\nint main() {\n  len();\n\n  change(m, a);\n  change(n, b);\n  prin();\n}\n"}
{"label": "8", "index": "13387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k1, k2, a[100], b[100], i, j, c;\n  scanf(\"%d%d\", &k1, &k2);\n  for (i = 0; i <= k1 - 1; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= k2 - 1; ++i) {\n    cin >> b[i];\n  }\n  for (i = 0; i <= k1 - 2; ++i) {\n    for (j = i + 1; j <= k1 - 1; ++j) {\n      if (a[i] > a[j]) {\n        c = a[j];\n        a[j] = a[i];\n        a[i] = c;\n      }\n    }\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[k1 - 1]);\n  for (i = 0; i <= k2 - 2; ++i) {\n    for (j = i + 1; j <= k2 - 1; ++j) {\n      if (b[i] > b[j]) {\n        c = b[j];\n        b[j] = b[i];\n        b[i] = c;\n      }\n    }\n    printf(\" %d\", b[i]);\n  }\n  printf(\" %d\", b[k2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0, a[100] = {0}, b[100] = {0};\nvoid got() {\n  cin >> m >> n;\n  int i = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f(int a[], int b[]) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid plus(int a[], int b[]) {\n  for (int i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid shu(int a[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i == m + n - 1)\n      printf(\"%d\", a[i]);\n    else\n      cout << a[i] << \" \";\n  }\n}\nint main() {\n  got();\n  f(a, b);\n  for (int i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < n; i++) {\n    if (i != n - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "13389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid pai(int n, int a[]) {\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    for (int r = 1; r < n - i; r++) {\n      if (a[i + r] < a[i]) {\n        int k = a[i];\n        a[i] = a[i + r];\n        a[i + r] = k;\n      }\n    }\n  }\n}\nint link(int n, int m) {\n  int a[100] = {0}, b[100] = {0};\n  pai(n, a);\n  pai(m, b);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n}\n\nint main() {\n  int n, m;\n  cin >> n >> m;\n  link(n, m);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "13390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\n\nvoid enter(int array0[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &array0[i]);\n}\n\nvoid sort(int array[], int p1) {\n  int i, j, k;\n  for (i = 0; i < p1 - 1; i++)\n    for (j = 0; j < p1 - 1 - i; j++)\n      if (array[j] > array[j + 1]) {\n        k = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = k;\n      }\n}\n\nvoid paste(int array1[], int array2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = array1[i];\n  for (i = m; i < m + n; i++)\n    c[i] = array2[i - m];\n}\n\nvoid out(int array3[], int p2) {\n  int i;\n  printf(\"%d\", array3[0]);\n  for (i = 1; i < p2; i++)\n    cout << \" \" << array3[i];\n}\n\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  enter(a, m);\n  enter(b, n);\n  sort(a, m);\n  sort(b, n);\n  paste(a, b);\n  out(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint i = 0, n, m;\nvoid block_in() {\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid arr(int x, int c[]) {\n  int i = 0, j = 0, mid;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (c[j] > c[j + 1]) {\n        mid = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= x; i++) {\n    printf(\"%d\", c[i]);\n    if (i < x)\n      printf(\" \");\n  }\n}\nint main() {\n  block_in();\n  arr(n, a);\n  printf(\" \");\n  arr(m, b);\n}\n"}
{"label": "8", "index": "13392", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[1000], b[1000];\nvoid init() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = m - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        int t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        int t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid combine() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid print() {\n  for (int i = 0; i < m + n; i++) {\n    if (i)\n      cout << ' ';\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[50], a2[50];\nint main() {\n  void sort(int b[], int n);\n  void scn();\n  void pr(int c[], int m);\n  scn();\n  sort(a1, n1);\n  sort(a2, n2);\n  pr(a1, n1);\n  pr(a2, n2);\n}\nvoid sort(int b[], int n) {\n  int i, j, t;\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n}\nvoid scn() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a1[i]);\n  }\n\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &a2[i]);\n  }\n}\nvoid pr(int c[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    if (i == m - 1 && c[i] == a2[m - 1])\n      printf(\"%d\", c[i]);\n    else\n      printf(\"%d \", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint d, e, f, g;\nint a[50], b[50], c[100];\nint get(int a[50], int b[50]);\nint repick(int a[50], int b[50]);\nint hand(int a[50], int b[50], int c[100]);\nint out(int c[100]);\nint main() {\n  get(a, b);\n  repick(a, b);\n  hand(a, b, c);\n  out(c);\n  return 0;\n}\nint get(int a[50], int b[50]) {\n  scanf(\"%d%d\", &f, &g);\n  for (d = 0; d < f; d++)\n    scanf(\"%d\", &a[d]);\n  for (e = 0; e < g; e++)\n    scanf(\"%d\", &b[e]);\n  return 0;\n}\nint repick(int a[50], int b[50]) {\n  int h;\n  for (d = 0; d < f; d++)\n    for (e = 0; e < (f - d - 1); e++)\n      if (a[e] > a[e + 1]) {\n        h = a[e + 1];\n        a[e + 1] = a[e];\n        a[e] = h;\n      }\n  for (d = 0; d < g; d++)\n    for (e = 0; e < (g - d - 1); e++)\n      if (b[e] > b[e + 1]) {\n        h = b[e + 1];\n        b[e + 1] = b[e];\n        b[e] = h;\n      }\n  return 0;\n}\nint hand(int a[50], int b[50], int c[100]) {\n  d = 0;\n  while (d < f) {\n    c[d] = a[d];\n    d++;\n  }\n  while (d < (f + g)) {\n    c[d] = b[d - f];\n    d++;\n  }\n  return 0;\n}\nint out(int c[100]) {\n  d = 0;\n  cout << c[d];\n  d++;\n  while (d < (f + g)) {\n    cout << \" \" << c[d];\n    d++;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint paixu(int shuzu[], int num) {\n  int i, j, jiaohuan;\n  for (i = 1; i < num; i++) {\n    for (j = 0; j < num - i; j++) {\n      if (shuzu[j] > shuzu[j + 1]) {\n        jiaohuan = shuzu[j];\n        shuzu[j] = shuzu[j + 1];\n        shuzu[j + 1] = jiaohuan;\n      }\n    }\n  }\n}\nint hebing(int shuzu1[], int num1, int shuzu2[], int num2) {\n  int i;\n  for (i = 0; i < num2; i++)\n    shuzu1[i + num1] = shuzu2[i];\n}\nint main() {\n  int shuzu1[200], shuzu2[100], num1, num2, i, j;\n  scanf(\"%d %d \", &num1, &num2);\n  for (i = 0; i < num1; i++)\n    scanf(\"%d \", &shuzu1[i]);\n  for (i = 0; i < num2; i++)\n    cin >> shuzu2[i];\n  paixu(shuzu1, num1);\n  paixu(shuzu2, num2);\n  hebing(shuzu1, num1, shuzu2, num2);\n  for (i = 0; i < (num1 + num2); i++) {\n    cout << shuzu1[i];\n    if (i < (num1 + num2 - 1))\n      cout << \" \";\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13396", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i;\n  int t[50] = {0}, y[50] = {0};\n  void str(int t[], int m);\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &t[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  str(t, m);\n  str(y, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", t[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", y[i]);\n  printf(\"%d\\n\", y[n - 1]);\n}\nvoid str(int t[], int m) {\n  int i, j;\n  int c;\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j <= m - 1; j++) {\n      if (t[i] > t[j]) {\n        c = t[i];\n        t[i] = t[j];\n        t[j] = c;\n      }\n    }\n}\n"}
{"label": "8", "index": "13397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m1, n1;\n  scanf(\"%d %d \", &m1, &n1);\n  int m = m1, n = n1;\n  int a[m];\n  int b[n];\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1] << \"\\n\";\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid pai(int n, int a[]) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int r = 1; r < n - i; r++) {\n      if (a[i + r] < a[i]) {\n        int k = a[i];\n        a[i] = a[i + r];\n        a[i + r] = k;\n      }\n    }\n  }\n}\nint link(int n, int m) {\n  int a[100] = {0}, b[100] = {0};\n  pai(n, a);\n  pai(m, b);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[m - 1];\n}\n\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  link(n, m);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "13399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint l1, l2;\nint a[2000], b[1000];\nint temp;\nvoid cins(void) {\n  cin >> l1 >> l2;\n  for (int i = 1; i <= l1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= l2; i++) {\n    cin >> b[i];\n  }\n}\nvoid sorts(void) {\n  for (int i = 1; i < l1; i++) {\n    for (int j = 1; j <= l1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i < l2; i++) {\n    for (int j = 1; j <= l2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(void) {\n  for (int i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n}\nvoid couts(void) {\n  cout << a[1];\n  for (int i = 2; i <= l1 + l2; i++) {\n    cout << \" \" << a[i];\n  }\n  printf(\"\\n\");\n}\nint main(void) {\n  cins();\n  sorts();\n  together();\n  couts();\n  return 0;\n}\n"}
{"label": "8", "index": "13400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s1 = 0, s2 = 0;\nvoid reads() { scanf(\"%d %d \", &s1, &s2); }\nvoid read(int s, int a[]) {\n  for (int i = 1; i <= s; i++)\n    cin >> a[i];\n}\nvoid sort(int s, int a[]) {\n  for (int i = 1; i <= s - 1; i++)\n    for (int j = i + 1; j <= s; j++) {\n      if (a[i] > a[j]) {\n        int c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n}\nvoid combine(int s1, int s2, int a1[], int a2[]) {\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    a1[i] = a2[i - s1];\n}\nvoid print(int s, int a[]) {\n  for (int i = 1; i <= s; i++) {\n    cout << a[i];\n    if (i < s)\n      cout << ' ';\n  }\n}\nint main() {\n  int a1[500], a2[500];\n  reads();\n  read(s1, a1);\n  read(s2, a2);\n  sort(s1, a1);\n  sort(s2, a2);\n  combine(s1, s2, a1, a2);\n  print(s1 + s2, a1);\n  return 0;\n}\n"}
{"label": "8", "index": "13401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid programme() {\n  int n1, n2, i, j, temp;\n  int a[101], b[101];\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n2; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = 0; j < n2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2; i++) {\n    if (i != n2 - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n  return;\n}\n\nint main() {\n  programme();\n  return 0;\n}\n"}
{"label": "8", "index": "13402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid a(int s[], int x) {\n  int i;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid b(int s[], int x) {\n  int i, j;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (s[j] > s[j + 1]) {\n        s[0] = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = s[0];\n      }\n    }\n  }\n}\nvoid c(int p[], int x, int q[], int y) {\n  int i;\n  for (i = 1; i <= y; i++)\n    p[x + i] = q[i];\n}\nvoid d(int s[], int x) {\n  int i;\n  for (i = 1; i <= x - 1; i++)\n    printf(\"%d \", s[i]);\n  cout << s[x] << \"\\n\";\n}\nint main() {\n  int p[60], q[30], m, n;\n  scanf(\"%d%d\", &m, &n);\n  a(p, m);\n  a(q, n);\n  b(p, m);\n  b(q, n);\n  c(p, m, q, n);\n  d(p, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13403", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint input(int n) {\n  cin >> n;\n  return n;\n}\nvoid paixu(int a[], int n) {\n  int i, j, p;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1] << endl;\n}\nint main() {\n  int a[100], b[100], n1, n2, i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    a[i] = input(a[i]);\n  for (i = 0; i < n2; i++)\n    b[i] = input(b[i]);\n  paixu(a, n1);\n  paixu(b, n2);\n  add(a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[2][100], n, m, b[200];\n\nvoid read() {\n  scanf(\"%d %d\\n\", &n, &m);\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &a[1][j]);\n  }\n}\n\nvoid sort() {\n  int k = 0, l, min, temp;\n  for (k = 0; k < n; k++) {\n    min = a[0][k];\n    for (l = k + 1; l < n; l++) {\n      if (a[0][l] < min) {\n        temp = min;\n        min = a[0][l];\n        a[0][k] = min;\n        a[0][l] = temp;\n      }\n    }\n  }\n  k = 0;\n  for (k = 0; k < m; k++) {\n    min = a[1][k];\n    for (l = k + 1; l < m; l++) {\n      if (a[1][l] < min) {\n        temp = min;\n        min = a[1][l];\n        a[1][k] = min;\n        a[1][l] = temp;\n      }\n    }\n  }\n}\n\nvoid merge() {\n  int i = 0, j = n;\n  for (i = 0; i < n; i++) {\n    b[i] = a[0][i];\n  }\n  for (j = n; j < n + m; j++)\n    b[j] = a[1][j - n];\n}\n\nvoid out() {\n  int i = 0;\n  for (i = 0; i < n + m; i++) {\n    if (i < n + m - 1)\n      printf(\"%d \", b[i]);\n    else\n      printf(\"%d\", b[i]);\n  }\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  out();\n}\n"}
{"label": "8", "index": "13405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint str1[50] = {1}, str2[50] = {1};\nint length1, length2;\nvoid input_string(void) {\n  cin >> length1 >> length2;\n  for (int i = 0; i < length1; i++)\n    cin >> str1[i];\n  for (int i = 0; i < length2; i++)\n    cin >> str2[i];\n}\nvoid rank_string(void) {\n  int temp;\n  for (int i = 0; i < length1 - 1; i++)\n    for (int j = i + 1; j < length1; j++)\n      if (str1[i] > str1[j]) {\n        temp = str1[i];\n        str1[i] = str1[j];\n        str1[j] = temp;\n      }\n  for (int i = 0; i < length2 - 1; i++)\n    for (int j = i + 1; j < length2; j++)\n      if (str2[i] > str2[j]) {\n        temp = str2[i];\n        str2[i] = str2[j];\n        str2[j] = temp;\n      }\n}\nvoid combine_string(void) {\n  for (int i = length1; i < length1 + length2; i++)\n    str1[i] = str2[i - length1];\n}\nvoid output_string(void) {\n  cout << str1[0];\n  for (int i = 1; i < length1 + length2; i++)\n    cout << ' ' << str1[i];\n}\nint main() {\n  input_string();\n  rank_string();\n  combine_string();\n  output_string();\n  return 0;\n}\n"}
{"label": "8", "index": "13406", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i;\n  int a[20], b[20];\n  cin >> x >> y;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n\n  sort(a, a + x);\n  sort(b, b + y);\n  cout << a[0];\n  for (i = 1; i < x; i++) {\n    cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[500] = {0}, b[500] = {0};\nvoid scanarray() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid shengxu(int x[], int len) {\n  int i, j, temp;\n  for (i = len - 1; i >= 0; i--) {\n    for (j = 0; j <= i - 1; j++) {\n      if (x[j] >= x[j + 1]) {\n        temp = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hebing(int x[], int y[], int lenx, int leny) {\n  int *p, *q;\n  for (p = x + lenx, q = y; q < y + leny; p++, q++) {\n    *p = *q;\n  }\n}\nvoid printarray(int x[], int len) {\n  int i;\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= len - 1; i++)\n    printf(\" %d\", a[i]);\n\n  putchar('\\n');\n}\nint main() {\n  scanarray();\n  shengxu(a, m);\n  shengxu(b, n);\n  hebing(a, b, m, n);\n  printarray(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000], y[1000], z[2000];\nint i, j, n, m, ex;\nvoid read() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> x[i];\n  for (i = 0; i < m; i++)\n    cin >> y[i];\n}\nvoid paixu() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1; j++)\n      if (x[j + 1] < x[j]) {\n        ex = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = ex;\n      }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - 1; j++)\n      if (y[j] > y[j + 1]) {\n        ex = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = ex;\n      }\n}\nvoid heping() {\n  for (i = 0; i < n; i++)\n    z[i] = x[i];\n  for (i = 0; i < m; i++)\n    z[n + i] = y[i];\n}\nvoid display() {\n  for (i = 0; i < n + m; i++) {\n    if (i == 0)\n      printf(\"%d\", z[i]);\n    else\n      printf(\" %d\", z[i]);\n  }\n}\nint main() {\n  read();\n  paixu();\n  heping();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "13409", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, m);\n  f(b, n);\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void take(int x[1000], int l);\n  void rank(int x[1000], int l);\n  void com(int a[1000], int b[1000], int c[2000], int al, int bl);\n  void prin(int c[2000], int l);\n  int a[1000];\n  int b[1000];\n  int c[2000];\n  int al, bl;\n  scanf(\"%d%d\", &al, &bl);\n  take(a, al);\n  take(b, bl);\n  rank(a, al);\n  rank(b, bl);\n  com(a, b, c, al, bl);\n  prin(c, al + bl);\n  return 0;\n}\nvoid take(int x[1000], int l) {\n  int i;\n  for (i = 0; i < l; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n}\nvoid rank(int x[1000], int l) {\n  int i, j, temp;\n  if (l != 1) {\n    for (i = l - 2; i >= 0; i--) {\n      for (j = 0; j <= i; j++) {\n        if (x[j] > x[j + 1]) {\n          temp = x[j];\n          x[j] = x[j + 1];\n          x[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nvoid com(int a[1000], int b[1000], int c[2000], int al, int bl) {\n  int i;\n  for (i = 0; i < al; i++) {\n    c[i] = a[i];\n  }\n  for (i = al; i < al + bl; i++) {\n    c[i] = b[i - al];\n  }\n}\nvoid prin(int c[2000], int l) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < l; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort(int a[], int n);\nint main() {\n  int m, n, i, j, a[100], b[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  sort(a, m);\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  sort(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\nvoid sort(int a[], int n) {\n  int i, j, index, temp;\n\n  for (i = 0; i < n - 1; i++) {\n\n    index = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[index] > a[j])\n        index = j;\n    }\n    temp = a[i];\n    a[i] = a[index];\n    a[index] = temp;\n  }\n}\n"}
{"label": "8", "index": "13412", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100] = {0}, b[100] = {0};\nint i = 0, j = 0, I, J;\n\nint main() {\n  void load();\n  void order(int a[], int b[]);\n  void conflate(int a[], int b[]);\n  void print(int a[]);\n  load();\n  order(a, b);\n  conflate(a, b);\n  print(a);\n  return 0;\n}\n\nvoid load() {\n\n  scanf(\"%d %d\", &i, &j);\n  I = i;\n  J = j;\n  for (i = 0; i < I; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < J; j++)\n    scanf(\"%d\", &b[j]);\n}\n\nvoid order(int a[], int b[]) {\n  void xu(int x[], int y);\n\n  xu(a, I);\n  xu(b, J);\n}\n\nvoid xu(int x[], int y) {\n  int *p, *q, *temp, t;\n  p = x;\n  for (i = 0; i < y - 1; i++) {\n    p = &x[i];\n    for (j = i + 1; j < y; j++) {\n      q = &x[j];\n      if (*p > *q) {\n        temp = p;\n        p = q;\n        q = temp;\n      }\n    }\n    if (p != &x[i]) {\n      t = *p;\n      *p = x[i];\n      x[i] = t;\n    }\n  }\n}\n\nvoid conflate(int a[], int b[]) {\n  for (i = I; i < I + J; i++)\n    a[i] = b[i - I];\n}\n\nvoid print(int a[]) {\n  for (i = 0; i < I + J; i++) {\n    printf(\"%d\", a[i]);\n    if (i < I + J - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s1[100], s2[100], i, j, a, b, t, s;\nvoid in(void);\nvoid order(void);\nvoid stick(void);\nvoid out(void);\n\nint main() {\n  in();\n  order();\n  stick();\n  out();\n  return 0;\n}\n\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid order() {\n\n  for (i = 1; i < a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < b; i++) {\n    for (j = 0; j < b - i; j++) {\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid stick() {\n\n  s = a + b;\n  for (i = a; i < s; i++) {\n    s1[i] = s2[i - a];\n  }\n}\nvoid out() {\n\n  for (i = 0; i < a + b; i++) {\n    if (i == 0)\n      cout << s1[i];\n    else\n      cout << \" \" << s1[i];\n  }\n}\n"}
{"label": "8", "index": "13414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100];\nint m, n;\n\nvoid insert(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\n\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n}\n\nint main() {\n  insert();\n  paixu(a, b);\n  hebing();\n  output();\n}\n"}
{"label": "8", "index": "13415", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000];\nint sizea, sizeb;\nvoid read() {\n  cin >> sizea >> sizeb;\n  int i;\n  for (i = 0; i <= sizea - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= sizeb - 1; i++)\n    cin >> b[i];\n}\nvoid order(int n, int a[]) {\n  int i, j;\n  int temp;\n  for (i = n - 1; i >= 1; i--)\n    for (j = 0; j <= i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid paixu() {\n  order(sizea, a);\n  order(sizeb, b);\n}\nvoid mix() {\n  int i;\n  for (i = 0; i <= sizeb - 1; i++)\n    a[sizea + i] = b[i];\n}\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i <= sizea + sizeb - 1; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  read();\n  paixu();\n  mix();\n  print();\n}\n"}
{"label": "8", "index": "13416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B, a[40], b[40];\n\nvoid enter() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= A; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[1]);\n  for (i = 2; i <= B; i++)\n    scanf(\" %d\", &b[i]);\n}\n\nvoid array_1() {\n  int i, j, m;\n  for (i = 1; i <= A - 1; i++)\n    for (j = 1; j <= A - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 1; i <= B - 1; i++)\n    for (j = 1; j <= B - i; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\n\nvoid connect() {\n  int i, j;\n  for (i = A + 1, j = 1; i <= A + B; i++, j++)\n    a[i] = b[j];\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= A + B; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  enter();\n  array_1();\n  connect();\n  print();\n}\n"}
{"label": "8", "index": "13417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f1(int a[], int b[], int c, int d) {\n  int i, j, t;\n  for (i = 0; i < c; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < c; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < d; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  int a[15], b[15], c, d, i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < d; i++)\n    scanf(\"%d\", &b[i]);\n  f1(a, b, c, d);\n}\n"}
{"label": "8", "index": "13418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, t, j;\n  int a[2][1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[0][i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[1][i]);\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[0][i] > a[0][i + 1]) {\n        t = a[0][i];\n        a[0][i] = a[0][i + 1];\n        a[0][i + 1] = t;\n      }\n    }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[1][i] > a[1][i + 1]) {\n        t = a[1][i];\n        a[1][i] = a[1][i + 1];\n        a[1][i + 1] = t;\n      }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[0][i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[1][i]);\n  printf(\"%d\\n\", a[1][n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, b[50] = {0};\n  int i, j, c, d, s;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < d - 1; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < c; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < d; i++) {\n    printf(\" %d\", b[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "13420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, i, j, t;\nint a[100];\nint b[100];\nint c[200];\nvoid passed1() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid passed2() {\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n}\nvoid passed3() {\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid passed4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  passed1();\n  passed2();\n  passed3();\n  passed4();\n}\n"}
{"label": "8", "index": "13421", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint input(int n) {\n  scanf(\"%d \", &n);\n  return n;\n}\nvoid paixu(int a[], int n) {\n  int i, j, p;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1] << endl;\n}\nint main() {\n  int a[100], b[100], n1, n2, i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    a[i] = input(a[i]);\n  for (i = 0; i < n2; i++)\n    b[i] = input(b[i]);\n  paixu(a, n1);\n  paixu(b, n2);\n  add(a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100];\nvoid input() {\n  int j, k;\n  scanf(\"%d %d\", &n, &m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n}\nvoid arrange(int n, int m, int x[], int y[]) {\n  int j, k, t;\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (x[k] > x[k + 1]) {\n        t = x[k];\n        x[k] = x[k + 1];\n        x[k + 1] = t;\n      }\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (y[k] > y[k + 1]) {\n        t = y[k];\n        y[k] = y[k + 1];\n        y[k + 1] = t;\n      }\n}\nvoid combine(int n, int m, int x[], int y[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    x[n + i] = y[i];\n}\nvoid print(int n, int m, int x[]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\", x[m + n - 1]);\n}\n\nint main() {\n  input();\n  arrange(n, m, a, b);\n  combine(n, m, a, b);\n  print(n, m, a);\n  return 0;\n}\n"}
{"label": "8", "index": "13423", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j;\nint a[10000];\nvoid input() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n + m; i++)\n    cin >> a[i];\n}\n\nvoid fsort() {\n  sort(a, a + n);\n  sort(a + n, a + n + m);\n}\nvoid print() {\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  input();\n  fsort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], n, m;\nvoid duru() {\n  int i, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int t1, t2, i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t1 = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t1;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t2 = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t2;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n + m - 1] << endl;\n}\nint main() {\n  duru();\n  sort();\n  hebing();\n  put();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13425", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[200], i, j, m, n;\nvoid read(void) {\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return;\n}\nvoid place(void) {\n  int s;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  return;\n}\nvoid together(void) {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return;\n}\nvoid put(void) {\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      printf(\"%d\", c[i]);\n    } else {\n      cout << ' ' << c[i];\n    }\n  }\n  return;\n}\n\nint main() {\n  read();\n  place();\n  together();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "13426", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid duqu() {\n  int i;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  }\n}\nvoid shuchu() {\n  int i, j;\n  cout << a[1];\n  for (i = 2; i <= m; i++)\n    cout << \" \" << a[i];\n  for (j = 1; j <= n; j++)\n    cout << \" \" << b[j];\n  cout << endl;\n}\nint main() {\n  duqu();\n  paixu();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nint main() {\n  void f1();\n  void f2(int s[], int k);\n  void f3(int p[], int t);\n  void f4(int p[], int t);\n  f1();\n  f2(a, m);\n  f2(b, n);\n  f3(a, m);\n  f4(b, n);\n  return 0;\n}\n\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int s[], int k) {\n\n  int i, j, t;\n  for (j = 0; j < k - 1; j++)\n    for (i = 0; i < k - 1 - j; i++)\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n}\n\nvoid f3(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    printf(\"%d \", p[i]);\n  }\n}\n\nvoid f4(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%d \", p[i]);\n  printf(\"%d\", p[t - 1]);\n}\n"}
{"label": "8", "index": "13428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid car() {\n  int n, m, i = 0, a[100], b[100];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < m - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[i];\n  return;\n}\n\nint main() {\n  car();\n  return 0;\n}\n"}
{"label": "8", "index": "13429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(int, int);\nvoid b(int[], int[], int, int);\nvoid c(int[], int[], int, int);\nvoid d(int[], int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  a(n1, n2);\n  return 0;\n}\nvoid a(int n1, int n2) {\n  int num1[101], num2[101], i;\n  for (i = 1; i <= n1; i++) {\n    cin >> num1[i];\n  }\n  for (i = 1; i <= n2; i++)\n    cin >> num2[i];\n  b(num1, num2, n1, n2);\n}\nvoid b(int num1[], int num2[], int n1, int n2) {\n  int i, j, mid;\n  for (i = 1; i <= n1 - 1; i++) {\n    for (j = 1; j <= n1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        mid = num1[j + 1];\n        num1[j + 1] = num1[j];\n        num1[j] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= n2 - 1; i++) {\n    for (j = 1; j <= n2 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        mid = num2[j + 1];\n        num2[j + 1] = num2[j];\n        num2[j] = mid;\n      }\n    }\n  }\n  c(num1, num2, n1, n2);\n}\nvoid c(int num1[], int num2[], int n1, int n2) {\n  int num[201], i, j;\n  for (i = 1; i <= n1; i++) {\n    num[i] = num1[i];\n  }\n  for (i = n1 + 1; i <= n1 + n2; i++) {\n    num[i] = num2[i - n1];\n  }\n  d(num, n1 + n2);\n}\nvoid d(int num[], int n) {\n  int i;\n  for (i = 1; i <= n - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n];\n}\n"}
{"label": "8", "index": "13430", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint n, m;\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu() {\n  int i, j, tem;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = n; i < n + m; i++)\n    a[i] = b[i - n];\n}\nvoid put() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i] << endl;\n}\nint main() {\n  read();\n  paixu();\n  combine();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "13431", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid read(int n1, int n2, int s1[], int s2[]);\nvoid bubble_sort(int s[], int n);\nvoid write(int n1, int n2, int s1[], int s2[]);\nint main() {\n  int n1, n2, s1[101], s2[101];\n  scanf(\"%d%d\", &n1, &n2);\n  read(n1, n2, s1, s2);\n  bubble_sort(s1, n1);\n  bubble_sort(s2, n2);\n  write(n1, n2, s1, s2);\n}\nvoid read(int n1, int n2, int s1[], int s2[]) {\n  int i;\n\n  for (i = 0; i < n1; i++)\n    cin >> s1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid bubble_sort(int s[], int n) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (s[j] > s[j + 1]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n}\nvoid write(int n1, int n2, int s1[], int s2[]) {\n  int i;\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < n1; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n2; i++)\n    printf(\" %d\", s2[i]);\n}\n"}
{"label": "8", "index": "13432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint work(int now, int x) {\n  int i, j, swap;\n  int a[1002];\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= x; i++) {\n    for (j = i + 1; j <= x; j++) {\n      if (a[i] > a[j]) {\n        swap = a[i];\n        a[i] = a[j];\n        a[j] = swap;\n      }\n    }\n  }\n  if (now == 2)\n    printf(\" \");\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  return (0);\n}\nint main() {\n  int n, m;\n  scanf(\"%d%d\", &n, &m);\n  work(1, n);\n  work(2, m);\n  return (0);\n}\n"}
{"label": "8", "index": "13433", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int c[], int x) {\n  int p;\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        p = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int a[100], b[100];\n  int m, n, i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n  f(a, m);\n  f(b, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[j];\n  return 0;\n}\n"}
{"label": "8", "index": "13434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid change(int x, int z[20]) {\n  int i, j, middle;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1; j++) {\n      if (z[j] > z[j + 1]) {\n        middle = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change(m, a);\n  change(n, b);\n  prin();\n}\n"}
{"label": "8", "index": "13435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint i, j, x, y, a[10], b[10], c[20];\nvoid array_1() {\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid row() {\n  int t;\n  for (i = 0; i < x; i++) {\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < y; i++) {\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  for (i = 0; i < x; i++) {\n    c[i] = a[i];\n  }\n  for (i = x; i < (x + y); i++) {\n    c[i] = b[i - x];\n  }\n}\n\nvoid print() {\n  for (i = 0; i < (x + y); i++) {\n    if (i != (x + y - 1)) {\n      printf(\"%d \", c[i]);\n    } else\n      printf(\"%d \", c[i]);\n  }\n}\n\nint main() {\n  array_1();\n  row();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100];\nint m, n;\n\nvoid input() {\n  int i, j;\n  cin >> m >> n;\n  scanf(\"\\n\");\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n - 1; j++)\n    scanf(\"%d \", &b[j]);\n  scanf(\"%d\", &b[n - 1]);\n  return;\n}\n\nvoid sort(int array[], int k) {\n  int i, j, t;\n  for (j = 0; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (array[i] > array[i + 1]) {\n        t = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = t;\n      }\n  return;\n}\n\nvoid combine() {\n  int i, j = 0;\n  for (i = m; i < m + n; i++) {\n    a[i] = b[j];\n    j++;\n  }\n  return;\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[m + n - 1]);\n  return;\n}\n\nint main() {\n  input();\n  sort(a, m - 1);\n  sort(b, n - 1);\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13437", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100];\nvoid ranking(int n, int m) {\n  int i, j, p;\n  for (i = n; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = n; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  ranking(0, n);\n  ranking(n, n + m);\n  cout << a[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pai(int na, int nb);\n  int na, nb;\n  scanf(\"%d%d\", &na, &nb);\n  pai(na, nb);\n  return 0;\n}\n\nvoid pai(int na, int nb) {\n  int t, i, j, a[200], b[100];\n  for (i = 0; i < na; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < nb; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (j = 0; j < na - 1; j++) {\n    for (i = 0; i < na - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < nb - 1; j++) {\n    for (i = 0; i < nb - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < na; j++)\n    printf(\"%d \", a[j]);\n  for (j = 0; j < nb - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\\n\", b[nb - 1]);\n}\n"}
{"label": "8", "index": "13439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid px(int a[], int n) {\n  int i, j, x;\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n}\nvoid hb(int a[], int m, int b[], int n) {\n  int c[1000];\n  int i, j, k;\n  for (i = 0; i <= m - 1; i++)\n    c[i] = a[i];\n  for (j = m; j <= m + n - 1; j++)\n    c[j] = b[j - m];\n  for (k = 0; k < m + n - 1; k++)\n    cout << c[k] << \" \";\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int b[1000];\n  for (j = 0; j <= n - 1; j++)\n    scanf(\"%d\", &b[j]);\n  px(a, m);\n  px(b, n);\n  hb(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13440", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid a(int k, int n);\nvoid a(int k, int n) {\n  int e[300] = {0}, f[300] = {0}, i = 0, j = 0, t = 0;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &e[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &f[j]);\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1; j++) {\n      if (e[j] > e[j + 1]) {\n        t = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (f[j] > f[j + 1]) {\n        t = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = t;\n      }\n    }\n  }\n  for (i = k, j = 0; i < k + n; i++, j++)\n    e[i] = f[j];\n\n  for (i = 0; i < n + k; i++) {\n    printf(\"%d\", e[i]);\n    if (i != n + k - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int k = 0, n = 0;\n\n  scanf(\"%d %d\", &k, &n);\n  a(k, n);\n}\n"}
{"label": "8", "index": "13441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid get(int m, int n);\nvoid swap(int m, int n);\nvoid put(int m, int n);\nint a[1001], b[1001];\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  get(m, n);\n  swap(m, n);\n  put(m, n);\n}\nvoid get(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid swap(int m, int n) {\n  int j, k, c;\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (a[k] > a[k + 1]) {\n        c = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (b[k] > b[k + 1]) {\n        c = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = c;\n      }\n}\nvoid put(int m, int n) {\n  int l;\n  for (l = 0; l < m; l++)\n    cout << a[l] << \" \";\n  for (l = 0; l < n; l++) {\n    if (l == n - 1)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n}\n"}
{"label": "8", "index": "13442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[2][100], n, m, b[200];\n\nvoid read() {\n  scanf(\"%d %d\\n\", &n, &m);\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &a[1][j]);\n  }\n}\n\nvoid sort() {\n  int k = 0, l, min, temp;\n  for (k = 0; k < n; k++) {\n    min = a[0][k];\n    for (l = k + 1; l < n; l++) {\n      if (a[0][l] < min) {\n        temp = min;\n        min = a[0][l];\n        a[0][k] = min;\n        a[0][l] = temp;\n      }\n    }\n  }\n  k = 0;\n  for (k = 0; k < m; k++) {\n    min = a[1][k];\n    for (l = k + 1; l < m; l++) {\n      if (a[1][l] < min) {\n        temp = min;\n        min = a[1][l];\n        a[1][k] = min;\n        a[1][l] = temp;\n      }\n    }\n  }\n}\n\nvoid merge() {\n  int i = 0, j = n;\n  for (i = 0; i < n; i++) {\n    b[i] = a[0][i];\n  }\n  for (j = n; j < n + m; j++) {\n    b[j] = a[1][j - n];\n  }\n}\n\nvoid out() {\n  int i = 0;\n  for (i = 0; i < n + m; i++) {\n    if (i < n + m - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, c[100], d[100];\nvoid size() { scanf(\"%d %d\", &a, &b); }\nvoid num(int s, int j[]) {\n  int i;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &j[i]);\n  }\n}\nvoid arrange(int s, int j[]) {\n  int i, k, temp;\n  for (k = 0; k < s - 1; k++) {\n    for (i = 0; i < s - k - 1; i++) {\n      if (j[i + 1] <= j[i]) {\n        temp = j[i];\n        j[i] = j[i + 1];\n        j[i + 1] = temp;\n      }\n    }\n  }\n}\nvoid plus_1(int x, int m[], int y, int n[]) {\n  int i;\n  arrange(x, m);\n  arrange(y, n);\n  printf(\"%d\", m[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", m[i]);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", n[i]);\n  }\n}\nint main() {\n  size();\n  num(a, c);\n  num(b, d);\n  plus_1(a, c, b, d);\n}\n"}
{"label": "8", "index": "13444", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, i, j, t;\nint a[100];\nint b[100];\nint c[200];\nvoid passed1() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid passed2() {\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n}\nvoid passed3() {\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid passed4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  passed1();\n  passed2();\n  passed3();\n  passed4();\n}\n"}
{"label": "8", "index": "13445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1];\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) {\n  int x = *(int *)a;\n  int y = *(int *)b;\n  if (x < y) {\n    return -1;\n  }\n  if (x == y) {\n    return 0;\n  }\n  return 1;\n}\n\nvoid initArrays(int *a, int *b, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid sort(int *a, int *b, int m, int n) {\n  qsort(a, m, sizeof(int), compare);\n  qsort(b, n, sizeof(int), compare);\n}\n\nvoid append(int *a, int *b, int *c, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid print(int *a, int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[i]);\n}\n\nint main(int argc, const char *argv[]) {\n\n  int m, n;\n  cin >> m >> n;\n  int a[m];\n  int b[n];\n  initArrays(a, b, m, n);\n  sort(a, b, m, n);\n  int c[m + n];\n  append(a, b, c, m, n);\n  print(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13447", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid get(int n, int *a) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid order(int n, int *a) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid puttogether(int n, int *a, int m, int *b) {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n + m; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  int a[500], b[500];\n  int m, n;\n  scanf(\"%d %d\", &n, &m);\n  get(n, a);\n  get(m, b);\n  order(n, a);\n  order(m, b);\n  puttogether(n, a, m, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m;\nvoid f1(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(int a[1000], int b[1000]) {\n  int i, j, t;\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (n - 1); i > j; i--) {\n      if (a[i] < a[i - 1]) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (m - 1); i > j; i--) {\n      if (b[i] < b[i - 1]) {\n        t = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n}\nvoid f4(int a[1000]) {\n  int i;\n  for (i = 0; i < (n + m); i++) {\n    cout << a[i];\n    if (i != (n + m - 1))\n      printf(\" \");\n  }\n}\nint main() {\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  f1(a, b);\n  f2(a, b);\n  f3(a, b);\n  f4(a);\n}\n"}
{"label": "8", "index": "13449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid bubble(int a[], int l) {\n  int i, j, temp;\n  for (j = 1; j < l; j++) {\n    for (i = 0; i < l - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, i, j, a[10000], b[10000];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  bubble(a, m);\n  bubble(b, n);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\", b[j]);\n    if (j < n - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "13450", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint A, B, a[300], b[300], c[600];\nvoid w() {\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid x() {\n  int i, j, t;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid y() {\n  int i;\n  for (i = 0; i < A + B; i++)\n    if (i < A)\n      c[i] = a[i];\n    else\n      c[i] = b[i - A];\n}\nvoid z() {\n  int i;\n  for (i = 0; i < A + B - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[A + B - 1]);\n}\nint main() {\n  w();\n  x();\n  y();\n  z();\n}\n"}
{"label": "8", "index": "13451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b, i, j, t, c[20], d[20], e[40];\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    cin >> d[i];\n}\n\nvoid order() {\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++)\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n}\n\nvoid combine() {\n  for (i = 0; i < a; i++)\n    e[i] = c[i];\n  for (i = 0; i < b; i++)\n    e[a + i] = d[i];\n}\n\nvoid out() {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", e[i]);\n  cout << e[a + b - 1];\n}\n\nint main() {\n  in();\n  order();\n  combine();\n  out();\n}\n"}
{"label": "8", "index": "13452", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n\n  int a[1000], b[1000];\n  int m, n, i, t, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint *num(int a) {\n  int *p, i;\n  p = (int *)malloc(a * sizeof(int));\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return p;\n}\n\nvoid rank_1(int *p, int a) {\n  int i, j, t;\n  for (i = a - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        t = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = t;\n      }\n    }\n  }\n}\n\nint *add(int *p1, int *p2, int a, int b) {\n  int i;\n  int *p3 = (int *)malloc((a + b) * sizeof(int));\n  for (i = 0; i < a; i++)\n    *(p3 + i) = *(p1 + i);\n  for (i = 0; i < b; i++) {\n    *(p3 + a + i) = *(p2 + i);\n  }\n  return p3;\n}\n\nvoid print(int *p3, int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", p3[0]);\n    else\n      printf(\" %d\", p3[i]);\n  }\n}\n\nint main() {\n  int a, b, *p1, *p2, *p3;\n  scanf(\"%d\", &a);\n  scanf(\"%d\", &b);\n  p1 = num(a);\n  p2 = num(b);\n  rank_1(p1, a);\n  rank_1(p2, b);\n  p3 = add(p1, p2, a, b);\n  print(p3, (a + b));\n  free(p1);\n  free(p2);\n  free(p3);\n}\n"}
{"label": "8", "index": "13454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, c[50], d[50];\nvoid shuzu() {\n  int i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &d[j]);\n}\n\nvoid paixu(int a[50], int b[50]) {\n  int i, j, s, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        s = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = s;\n      }\n}\n\nvoid hebing(int a[50], int b[50]) {\n\n  int i, j;\n  int e[100];\n  for (i = 0; i < m; i++)\n    e[i] = a[i];\n  for (j = 0; j < n; j++)\n    e[m + j] = b[j];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[m + n - 1]);\n}\n\nint main() {\n  shuzu();\n  paixu(c, d);\n  hebing(c, d);\n}\n"}
{"label": "8", "index": "13455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid output(int n, int m, int a[], int b[]) {\n  int i;\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    cout << \" \" << b[i];\n}\nvoid swap(int a[], int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\nvoid quicksort(int a[], int l, int r) {\n  int m, i, j;\n  i = l;\n  j = r;\n  m = a[i];\n  while (i <= j) {\n    while ((a[i] < m) && (i < r))\n      i++;\n    while ((a[j] > m) && (j > l))\n      j--;\n    if (i <= j) {\n      swap(a, i, j);\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    quicksort(a, i, r);\n  if (j > l)\n    quicksort(a, l, j);\n}\nvoid input() {\n  int i, n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  quicksort(a, 0, n - 1);\n  quicksort(b, 0, m - 1);\n  output(n, m, a, b);\n}\nint main() { input(); }\n"}
{"label": "8", "index": "13456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid in(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid bubblesort(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n}\n\nvoid strc(int a[], int b[], int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n}\nvoid print(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[n1 + n2 - 1]);\n}\n\nint main() {\n  int n1, n2, a[100], b[100], c[200];\n  scanf(\"%d %d\", &n1, &n2);\n  in(a, n1);\n  in(b, n2);\n\n  bubblesort(a, n1);\n  bubblesort(b, n2);\n  strc(a, b, c, n1, n2);\n  print(c, n1, n2);\n}\n"}
{"label": "8", "index": "13457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sort(int *p, int n);\n  int n1, n2, a[50], b[50], i;\n  int *pa, *pb;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  pa = &a[0];\n  pb = &b[0];\n  sort(pa, n1); \n  sort(pb, n2);\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n2 - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\\n\", b[n2 - 1]);\n}\n\nvoid sort(int *p, int n) {\n  int i, j, temp;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        temp = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = temp;\n      }\n    }\n}\n"}
{"label": "8", "index": "13458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m1, n1;\n  cin >> m1 >> n1;\n  int m = m1, n = n1;\n  int a[m];\n  int b[n];\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1] << endl;\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *change(int x[100], int y);\n  int a1, a2, i;\n  int *pt1, *pt2;\n  int b[100], c[100];\n  scanf(\"%d%d\", &a1, &a2);\n  for (i = 0; i < a1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pt1 = change(b, a1);\n  for (i = 0; i < a2; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  pt2 = change(c, a2);\n  for (i = 0; i < a1; i++) {\n    printf(\"%d \", *(pt1 + i));\n  }\n  for (i = 0; i < a2 - 1; i++)\n    printf(\"%d \", *(pt2 + i));\n  printf(\"%d\", *(pt2 + a2 - 1));\n  return 0;\n}\nint *change(int x[100], int y) {\n  int j, k, temp = 0;\n  for (j = 1; j < y; j++) {\n    for (k = 0; k < y - j; k++) {\n      if (x[k] > x[k + 1]) {\n        temp = x[k + 1];\n        x[k + 1] = x[k];\n        x[k] = temp;\n      }\n    }\n  }\n  return (x);\n}\n"}
{"label": "8", "index": "13460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10];\n  int m, n;\n  cin >> m >> n;\n  shuru(a, b, m, n);\n  return 0;\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  printf(\"\\n\");\n  pai(a, m);\n  pai(b, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a[1000], b[100];\nint main() {\n  void A();\n  void B();\n  void c();\n  void d();\n  A();\n  B();\n  c();\n  d();\n}\n\nvoid A() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid B() {\n  int z, i, j;\n  for (j = n1; j > 1; j--) {\n    for (i = 0; i < j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        z = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = z;\n      }\n    }\n  }\n  for (j = n2; j > 1; j--) {\n    for (i = 0; i < j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        z = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = z;\n      }\n    }\n  }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "13462", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint scan() {\n  int m;\n  scanf(\"%d \", &m);\n  return m;\n}\nint fuzhi(int a[], int n) {\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k);\n    a[i] = k;\n  }\n  return 0;\n}\nint paixu(int b[], int n) {\n  int i, j, temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  return 0;\n}\nint print(int c[], int d[], int m3, int m4) {\n  int i = 0;\n  for (i = 0; i < m3; i++) {\n    printf(\"%d \", c[i]);\n  }\n  for (i = 0; i < m4; i++) {\n    printf(\"%d\", d[i]);\n    if (i != m4 - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int m1;\n  int m2;\n  int x[100];\n  int y[100];\n  m1 = scan();\n  m2 = scan();\n  fuzhi(x, m1);\n  fuzhi(y, m2);\n  paixu(x, m1);\n  paixu(y, m2);\n  print(x, y, m1, m2);\n  return 0;\n}\n"}
{"label": "8", "index": "13463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100], c[200];\nvoid f1() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int k[], int l) {\n  int i, j, t;\n  for (i = 0; i < l - 1; i++)\n    for (j = i; j < l; j++)\n      if (k[i] > k[j]) {\n        t = k[i];\n        k[i] = k[j];\n        k[j] = t;\n      }\n}\n\nvoid f3() {\n  f2(a, m);\n  f2(b, n);\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid f4() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  f1();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "13464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000];\nvoid qsort(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = a[(i + j) / 2];\n  while (i <= j) {\n    while (a[i] < x)\n      i++;\n    while (x < a[j])\n      j--;\n    if (i <= j) {\n      k = a[i];\n      a[i] = a[j];\n      a[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort(i, r);\n  if (l < j)\n    qsort(l, j);\n}\n\nvoid qsort2(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = (i + j) / 2;\n  while (i < j) {\n    while (b[i] < b[x])\n      i++;\n    while (b[x] < b[j])\n      j--;\n    if (i <= j) {\n      k = b[i];\n      b[i] = b[j];\n      b[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort2(i, r);\n  if (l < j)\n    qsort2(l, j);\n}\n\nvoid input() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 1; i < m; i++)\n    printf(\"%d \", b[i]);\n  cout << b[m] << endl;\n}\n\nint main() {\n  input();\n  qsort(1, n);\n  qsort2(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid mysort(int *pn, int n) {\n  int i, j;\n  int temp;\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (pn[j] > pn[i]) {\n        temp = pn[j];\n        pn[j] = pn[i];\n        pn[i] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *pn, int n, int *pm, int m) {\n  int i;\n  cout << pn[0];\n  for (i = 1; i < n; i++)\n    printf(\" %d\", pn[i]);\n\n  for (i = 0; i < m; i++) {\n    printf(\" %d\", pm[i]);\n  }\n}\nint main(int argc, char *argv[]) {\n  int m, n, i, *pm, *pn;\n  scanf(\"%d%d\", &m, &n);\n  pm = (int *)calloc(m, sizeof(int));\n  pn = (int *)calloc(n, sizeof(int));\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &(pm[i]));\n  }\n  for (i = 0; i < n; i++) {\n    cin >> (pn[i]);\n  }\n\n  mysort(pm, m);\n  mysort(pn, n);\n  merge(pm, m, pn, n);\n\n  free(pm);\n  free(pn);\n  return 0;\n}\n"}
{"label": "8", "index": "13466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input(int *s, int n) {}\nint sort(int *s, int n) {}\nint main() {\n  \n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n\n  \n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  int *s = (int *)malloc((m + n) * sizeof(int));\n\n  \n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", a + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", b + i);\n\n  \n  for (int i = 1; i < m; i++)\n    for (int j = 0; j < m - i; j++) {\n      if (*(a + j) > *(a + (j + 1))) {\n        int t;\n        t = *(a + j);\n        *(a + j) = *(a + (j + 1));\n        *(a + (j + 1)) = t;\n      }\n    }\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n - i; j++) {\n      if (*(b + j) > *(b + (j + 1))) {\n        int t;\n        t = *(b + j);\n        *(b + j) = *(b + (j + 1));\n        *(b + (j + 1)) = t;\n      }\n    }\n\n  \n  for (int i = 0; i < m; i++)\n    s[i] = a[i];\n  for (int i = 0; i < n; i++)\n    s[m + i] = b[i];\n  for (int i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", s[i]);\n    else\n      printf(\" %d\", s[i]);\n  }\n}\n"}
{"label": "8", "index": "13467", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200], m, n;\nvoid getstr() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid rangestr() {\n  void range(int str[100], int length);\n  range(a, m);\n  range(b, n);\n}\n\nvoid range(int str[100], int length) {\n  int i, j, t;\n  for (i = 0; i < length - 1; i++)\n    for (j = 0; j < length - i - 1; j++) {\n      if (str[j] > str[j + 1]) {\n        t = str[j + 1];\n        str[j + 1] = str[j];\n        str[j] = t;\n      }\n    }\n}\n\nvoid combinestr() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid putstr() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  getstr();\n  rangestr();\n  combinestr();\n  putstr();\n}\n"}
{"label": "8", "index": "13468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid duqu();\nvoid paixu();\nvoid hebin();\nvoid xianshi();\nint a[100], b[100], c[200];\nint m, n;\nint main() {\n  duqu();\n  paixu();\n  hebin();\n  xianshi();\n  return 0;\n}\nvoid duqu() {\n\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i = 0, j = 0, t;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid hebin() {\n\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n  for (int i = m; i < n + m; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[m + n - 1];\n}\n"}
{"label": "8", "index": "13469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint i, j, x, y, a[10], b[10], c[20];\nvoid array_1() {\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid row() {\n  int t;\n  for (i = 0; i < x; i++) {\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < y; i++) {\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  for (i = 0; i < x; i++) {\n    c[i] = a[i];\n  }\n  for (i = x; i < (x + y); i++) {\n    c[i] = b[i - x];\n  }\n}\n\nvoid print() {\n  for (i = 0; i < (x + y); i++) {\n    if (i != (x + y - 1)) {\n      printf(\"%d \", c[i]);\n    } else\n      printf(\"%d \", c[i]);\n  }\n}\n\nint main() {\n  array_1();\n  row();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, m);\n  f(b, n);\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "13471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid sort(int a[], int n);\nint main() {\n  int m, n, i, j, a[100], b[100];\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  sort(a, m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n\n  sort(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\nvoid sort(int a[], int n) {\n  int i, j, index, temp;\n\n  for (i = 0; i < n - 1; i++) {\n\n    index = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[index] > a[j])\n        index = j;\n    }\n    temp = a[i];\n    a[i] = a[index];\n    a[index] = temp;\n  }\n}\n"}
{"label": "8", "index": "13472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid a(int, int);\nvoid b(int[], int[], int, int);\nvoid c(int[], int[], int, int);\nvoid d(int[], int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  a(n1, n2);\n  return 0;\n}\nvoid a(int n1, int n2) {\n  int num1[101], num2[101], i;\n  for (i = 1; i <= n1; i++) {\n    scanf(\"%d \", &num1[i]);\n  }\n  for (i = 1; i <= n2; i++)\n    cin >> num2[i];\n  b(num1, num2, n1, n2);\n}\nvoid b(int num1[], int num2[], int n1, int n2) {\n  int i, j, mid;\n  for (i = 1; i <= n1 - 1; i++) {\n    for (j = 1; j <= n1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        mid = num1[j + 1];\n        num1[j + 1] = num1[j];\n        num1[j] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= n2 - 1; i++) {\n    for (j = 1; j <= n2 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        mid = num2[j + 1];\n        num2[j + 1] = num2[j];\n        num2[j] = mid;\n      }\n    }\n  }\n  c(num1, num2, n1, n2);\n}\nvoid c(int num1[], int num2[], int n1, int n2) {\n  int num[201], i, j;\n  for (i = 1; i <= n1; i++) {\n    num[i] = num1[i];\n  }\n  for (i = n1 + 1; i <= n1 + n2; i++) {\n    num[i] = num2[i - n1];\n  }\n  d(num, n1 + n2);\n}\nvoid d(int num[], int n) {\n  int i;\n  for (i = 1; i <= n - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n];\n}\n"}
{"label": "8", "index": "13473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], n, m;\nvoid duru() {\n  int i, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < m; j++)\n    scanf(\"%d \", &b[j]);\n}\nvoid sort() {\n  int t1, t2, i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t1 = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t1;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t2 = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t2;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n + m - 1] << endl;\n}\nint main() {\n  duru();\n  sort();\n  hebing();\n  put();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int x, int b[], int y) {\n  int m, n, i;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = m; i < x; i++)\n    a[i] = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = n; i < y; i++)\n    b[i] = -1;\n}\n\nvoid f2(int a[], int x, int b[], int y) {\n  int i, j, t, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\n\nvoid f3(int a[], int x, int b[], int y, int c[], int z) {\n  int i, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n  for (i = n + m; i < z; i++)\n    c[i] = -1;\n}\n\nvoid f4(int c[], int x) {\n  int i, e;\n\n  for (i = 0, e = 0; i < x; i++)\n    if (c[i] >= 0)\n      e++;\n  for (i = 0; i < e; i++) {\n    printf(\"%d\", c[i]);\n    if (i != e - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int a[30], b[30], c[60];\n  int i;\n  f1(a, 30, b, 30);\n  f2(a, 30, b, 30);\n  f3(a, 30, b, 30, c, 60);\n  f4(c, 60);\n  return 0;\n}\n"}
{"label": "8", "index": "13475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, i;\n  int a[20], b[20];\n  cin >> x >> y;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cin >> b[i];\n  }               \n  sort(a, a + x); \n  sort(b, b + y); \n  cout << a[0];\n  for (i = 1; i < x; i++) {\n    cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  } \n  return 0;\n}\n"}
{"label": "8", "index": "13476", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid readin(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cin >> a[i];\n  for (int i = 0; i < mb; i++)\n    cin >> b[i];\n}\nvoid rearange(int ma, int mb, int a[100], int b[100]) {\n  int temp;\n  for (int i = 0; i < ma; i++)\n    for (int j = 0; j < ma - 1; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < mb; i++)\n    for (int j = 0; j < mb - 1; j++)\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nint printout(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cout << a[i] << ' ';\n  for (int i = 0; i < mb - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[mb - 1];\n}\nint main() {\n  int ma[1], mb[1], a[100] = {0}, b[100] = {0};\n  readin(1, 1, ma, mb);\n  readin(ma[0], mb[0], a, b);\n  rearange(ma[0], mb[0], a, b);\n  printout(ma[0], mb[0], a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  combine(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13478", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint c[2000];\nint p, q;\n\nvoid read(void) {\n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++)\n    cin >> a[i];\n  for (i = 0; i < q; i++)\n    cin >> b[i];\n}\n\nvoid increaseSort(void) {\n  sort(a + 0, a + p);\n  sort(b + 0, b + q);\n}\n\nvoid merge(void) {\n  int i = 0;\n  for (i = 0; i < p; i++)\n    c[i] = a[i];\n  for (i = p; i < p + q; i++) {\n    c[i] = b[i - p];\n  }\n}\n\nvoid print(void) {\n  int i = 0;\n  cout << c[0];\n  for (i = 1; i < p + q; i++)\n    cout << \" \" << c[i];\n  cout << endl;\n}\n\nint main() {\n  read();\n  increaseSort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\n\nvoid read() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid sort_() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\n\nvoid stick() {\n  for (int i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n];\n}\n\nint main() {\n  read();\n  sort_();\n  stick();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint input(int *s, int n) {}\nint sort(int *s, int n) {}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  int *s = (int *)malloc((m + n) * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", a + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", b + i);\n  for (int i = 1; i < m; i++)\n    for (int j = 0; j < m - i; j++) {\n      if (*(a + j) > *(a + (j + 1))) {\n        int t;\n        t = *(a + j);\n        *(a + j) = *(a + (j + 1));\n        *(a + (j + 1)) = t;\n      }\n    }\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n - i; j++) {\n      if (*(b + j) > *(b + (j + 1))) {\n        int t;\n        t = *(b + j);\n        *(b + j) = *(b + (j + 1));\n        *(b + (j + 1)) = t;\n      }\n    }\n  for (int i = 0; i < m; i++)\n    s[i] = a[i];\n  for (int i = 0; i < n; i++)\n    s[m + i] = b[i];\n  for (int i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", s[i]);\n    else\n      cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input();\nvoid arrange();\nvoid add();\nvoid output();\nint a[100], b[100], c[200], n1, n2;\nint main() {\n  input();\n  arrange();\n  add();\n  output();\n  return 0;\n}\nvoid input() {\n  int i, j;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n2; j++)\n    scanf(\"%d\", &b[j]);\n}\n\nvoid arrange() {\n  int i, j, temp;\n  for (i = 0; i < n1; i++)\n    for (j = i; j < n1; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < n2; i++)\n    for (j = i; j < n2; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid add() {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n\n  for (i = n1; i < n1 + n2; i++) {\n    c[i] = b[i - n1];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    cout << c[i];\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "8", "index": "13482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint num1;\nint num2;\nint main() {\n  void read();\n  void queue();\n  void combine();\n  void put();\n  read();\n  queue();\n  combine();\n  put();\n  return 0;\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &num1, &num2);\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid queue() {\n  int i, j, t;\n  for (i = 0; i < num1 - 1; i++) {\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < num2 - 1; i++) {\n    for (j = 0; j < num2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    c[i + num1] = b[i];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < num1 + num2 - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[num1 + num2 - 1]);\n}\n"}
{"label": "8", "index": "13483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nvoid get(int a[200], int b[200]) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sequence(int a[200], int p) {\n  int i, j, temp;\n  for (i = 0; i < p; i++)\n    for (j = i + 1; j < p; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n}\nvoid combine(int a[200], int p, int b[200], int q) {\n  int j;\n  for (j = 0; j < q; j++)\n    a[p + j] = b[j];\n}\nvoid show(int a[200], int p) {\n  int i;\n  for (i = 0; i < p - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[p - 1]);\n}\nint main() {\n  int a[200], b[200];\n  get(a, b);\n  sequence(a, m);\n  sequence(b, n);\n  combine(a, m, b, n);\n  show(a, m + n);\n}\n"}
{"label": "8", "index": "13484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j + 1] < a[j]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (b[j + 1] < b[j]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int m, int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid f4(int a[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[m + n - 1];\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  int a[1000];\n  int b[1000];\n\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, m, n);\n  f4(a, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sr(int a[100], int b[100], int x, int y);\n  void px(int a[100], int x);\n  void hb(int a[100], int b[100], int c[200], int x, int y);\n  void sc(int a[200], int x);\n  int a[100], b[100], c[200], x, y;\n  scanf(\"%d%d\", &x, &y);\n  sr(a, b, x, y);\n  px(a, x);\n  px(b, y);\n  hb(a, b, c, x, y);\n  sc(c, x + y);\n  return 0;\n}\nvoid sr(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid px(int a[100], int x) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hb(int a[100], int b[100], int c[200], int x, int y) {\n  int i;\n  for (i = 0; i < x + y; i++) {\n    if (i < x)\n      c[i] = a[i];\n    else\n      c[i] = b[i - x];\n  }\n}\nvoid sc(int c[200], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, m, n;\nvoid gets() {\n  int i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> num1[i];\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &num2[j]);\n}\nvoid paixu() {\n  int i, j, a = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        a = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        a = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = a;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    num1[m + i] = num2[i];\n}\nvoid shuchu() {\n  int i;\n  printf(\"%d\", num1[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << num1[i];\n}\nint main() {\n  gets();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13487", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], i, j, n, m;\nvoid read() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (b[j] < b[i]) {\n        t = b[j];\n        b[j] = b[i];\n        b[i] = t;\n      }\n    }\n}\nvoid add() {\n  for (i = m, j = 0; j < n; i++, j++)\n    a[i] = b[j];\n}\nvoid print() {\n  for (i = 0; i < m + n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  read();\n  sort();\n  add();\n  print();\n}\n"}
{"label": "8", "index": "13488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], c[1000];\n  int i, n1, n2;\n  void shubingpai(int x[], int y[], int z[], int m, int n);\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  shubingpai(a, b, c, n1, n2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[n1 + n2 - 1]);\n}\nvoid shubingpai(int x[], int y[], int z[], int m, int n) {\n  void pai(int c[], int n);\n  int i;\n  pai(x, m);\n  pai(y, n);\n  for (i = 0; i < m; i++)\n    z[i] = x[i];\n  for (i = m; i < m + n; i++)\n    z[i] = y[i - m];\n}\nvoid pai(int c[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (c[j] < c[k])\n        k = j;\n    }\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "13489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[50], b[50], e[100];\nint c, d;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid change() {\n  int i, j, t;\n  for (j = 0; j < c - 1; j++) {\n    for (i = 0; i < c - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < d - 1; j++) {\n\n    for (i = 0; i < d - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid to() {\n  int i;\n  for (i = 0; i < c; i++) {\n    e[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    e[i + c] = b[i];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < (c + d) - 1; i++) {\n    printf(\"%d \", e[i]);\n  }\n  cout << e[c + d - 1];\n}\nint main() {\n  input();\n  change();\n  to();\n  output();\n}\n"}
{"label": "8", "index": "13490", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x, y, a[100], b[100], temp;\nint input() {\n\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int j = 0; j < y; j++)\n    cin >> b[j];\n  return 0;\n}\nint bubble() {\n  for (int i = 0; i < x - 1; i++)\n    for (int t = i + 1; t < x; t++) {\n      if (a[i] > a[t]) {\n        temp = a[t];\n        a[t] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (int j = 0; j < y - 1; j++)\n    for (int t = j + 1; t < y; t++) {\n      if (b[j] > b[t]) {\n        temp = b[t];\n        b[t] = b[j];\n        b[j] = temp;\n      }\n    }\n  return 0;\n}\nint combine() {\n  for (int i = 0; i < x; i++)\n    cout << a[i] << ' ';\n  for (int j = 0; j < y - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[y - 1];\n  return 0;\n}\nint main() {\n  input();\n  bubble();\n  combine();\n  return 0;\n}\n"}
{"label": "8", "index": "13491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint la = 0, lb = 0, l = 0, a[100], b[100], combine[200];\n\nvoid input();\nvoid seq();\nvoid sequence(int x[100]);\nvoid com(int a[100], int b[100]);\nvoid output(int combine[200]);\n\nint main() {\n  input();\n  seq();\n  com(a, b);\n  output(combine);\n  return 0;\n}\nvoid input() {\n  scanf(\"%d %d \", &la, &lb);\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid seq() {\n  l = la;\n  sequence(a);\n  l = lb;\n  sequence(b);\n}\nvoid sequence(int x[100]) {\n  int temp = 0;\n  for (int i = 1; i < l; i++)\n    for (int j = 1; j <= l - i; j++)\n      if (x[j - 1] > x[j]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n}\nvoid com(int a[100], int b[100]) {\n  memcpy(combine, a, la * 4);\n  memcpy(combine + la, b, lb * 4);\n}\nvoid output(int combine[200]) {\n  cout << combine[0];\n  for (int i = 1; i < la + lb; i++)\n    cout << \" \" << combine[i];\n}\n"}
{"label": "8", "index": "13492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[300], b[300], m, n, i, j, t, c[300];\nvoid f1() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid f4() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++) {\n    cout << \" \" << c[i];\n  }\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "13493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], c[20000], n, m;\nvoid input() {\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine() {\n  for (int i = 0; i < n; i++)\n    c[i] = a[i];\n  for (int j = n; j < n + m; j++)\n    c[j] = b[j - n];\n}\nvoid out() {\n  cout << c[0];\n  for (int i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  input();\n  sort();\n  combine();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nvoid getarr(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sortarr(void) {\n  int i, j, p;\n  for (i = 1; i < m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n}\nvoid combarr(void) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid printarr(void) {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\nint main() {\n  getarr();\n  sortarr();\n  combarr();\n  printarr();\n  return 0;\n}\n"}
{"label": "8", "index": "13495", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100], k[200];\nvoid f1();\nvoid f2(int[], int[]);\nvoid f3(int[], int[]);\nvoid f4(int[]);\nint main() {\n  f1();\n  f2(a, b);\n  f3(a, b);\n  f4(k);\n  return 0;\n}\nvoid f1() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++)\n    cin >> b[j];\n}\nvoid f2(int c[], int d[]) {\n  for (int i = 0; i < m; i++) {\n    for (int j = m - 1; j > i; j--) {\n      if (c[j] < c[j - 1])\n        swap(c[j], c[j - 1]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (d[j] < d[j - 1])\n        swap(d[j], d[j - 1]);\n    }\n  }\n}\nvoid f3(int e[], int f[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i < m)\n      k[i] = a[i];\n    else\n      k[i] = b[i - m];\n  }\n}\nvoid f4(int g[]) {\n  for (int i = 0; i < n + m - 1; i++)\n    printf(\"%d \", g[i]);\n  printf(\"%d\\n\", g[n + m - 1]);\n}\n"}
{"label": "8", "index": "13496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100];\n\nvoid sort(int c[], int s) {\n  int i, j, k;\n  for (i = 0; i < s - 1; i++)\n    for (j = 0; j < s - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = k;\n      }\n}\n\nvoid hebing(int d[], int e[], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d \", d[i]);\n  for (i = 0; i < y - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[y - 1]);\n}\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &b[j]);\n  sort(a, n);\n  sort(b, m);\n  hebing(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "13497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid bubble(int a[], int l) {\n  int i, j, temp;\n  for (j = 1; j < l; j++) {\n    for (i = 0; i < l - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, i, j, a[10000], b[10000];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  bubble(a, m);\n  bubble(b, n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\", b[j]);\n    if (j < n - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "13498", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int a[100], b[100];\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid input(int *M, int *N, int a[], int b[]) {\n  scanf(\"%d %d\", M, N);\n  int i;\n  for (i = 0; i < *M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < *N; i++)\n    scanf(\"%d\", &b[i]);\n\n  return;\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid merge(int M, int N, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = 0; i < N; i++)\n    c[i + M] = b[i];\n}\n\nvoid output(int M, int N, int c[]) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[M + N - 1];\n}\n\nint main() {\n  int M, N, a[100000], b[100000];\n  input(&M, &N, a, b);\n  sort(a, M);\n  sort(b, N);\n\n  int c[100000];\n  merge(M, N, a, b, c);\n  output(M, N, c);\n\n  return 0;\n}\n"}
{"label": "8", "index": "13500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[1000] = {0}, b[1000] = {0}, c[1000] = {0};\nvoid du() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid pai() {\n  int j, k, l;\n  for (j = 0; j <= m; j++) {\n    for (k = 0; k < m - 1; k++) {\n      if (a[k] > a[k + 1]) {\n        l = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = l;\n      }\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (b[k] > b[k + 1]) {\n        l = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = l;\n      }\n    }\n  }\n}\nvoid he() {\n  int o, p;\n  for (o = 0; o < m; o++)\n    c[o] = a[o];\n  for (p = 0; p < n; p++) {\n    c[o] = b[p];\n    o++;\n  }\n}\nvoid shu() {\n  int q;\n  for (q = 0; q < m + n; q++) {\n    cout << c[q];\n    if (q != m + n - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\nint main() {\n  cin >> m >> n;\n  du();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "13501", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int a[], int b[], int c, int d) {\n  int i, j, t;\n  for (i = 0; i < c; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < c; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < d; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  int a[15], b[15], c, d, i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < d; i++)\n    cin >> b[i];\n  f1(a, b, c, d);\n  return 0;\n}\n"}
{"label": "8", "index": "13502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[2][100], n, m, b[200];\n\nvoid read() {\n  scanf(\"%d %d\\n\", &n, &m);\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &a[1][j]);\n  }\n}\n\nvoid sort() {\n  int k = 0, l, min, temp;\n  for (k = 0; k < n; k++) \n  {\n    min = a[0][k];\n    for (l = k + 1; l < n; l++) {\n      if (a[0][l] < min) {\n        temp = min;\n        min = a[0][l];\n        a[0][k] = min;\n        a[0][l] = temp;\n      }\n    }\n  }\n  k = 0;\n  for (k = 0; k < m; k++) \n  {\n    min = a[1][k];\n    for (l = k + 1; l < m; l++) {\n      if (a[1][l] < min) {\n        temp = min;\n        min = a[1][l];\n        a[1][k] = min;\n        a[1][l] = temp;\n      }\n    }\n  }\n}\n\nvoid merge() {\n  int i = 0, j = n;\n  for (i = 0; i < n; i++) {\n    b[i] = a[0][i];\n  }\n  for (j = n; j < n + m; j++) {\n    b[j] = a[1][j - n];\n  }\n}\n\nvoid out() {\n  int i = 0;\n  for (i = 0; i < n + m; i++) {\n    if (i < n + m - 1)\n      printf(\"%d \", b[i]);\n    else\n      printf(\"%d\", b[i]);\n  }\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  out();\n}\n"}
{"label": "8", "index": "13503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *p, *q, m, n;\nvoid shuru() {\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", q + i);\n}\nstatic int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid shuchu() {\n  for (int i = 0; i < m; i++)\n    printf(\"%d \", *(p + i));\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", *(q + i));\n  printf(\"%d\", *(q + n - 1));\n}\nint main() {\n  shuru();\n  qsort(p, m, sizeof(int), cmp);\n  qsort(q, n, sizeof(int), cmp);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13504", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, b;\nvoid shuru();\nvoid paixu1();\nvoid paixu2();\nint main() {\n  shuru();\n  paixu1();\n  paixu2();\n\n  return 0;\n}\nvoid shuru() { cin >> a >> b; }\nvoid paixu1() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < a; i++)\n    cout << c[i] << \" \";\n}\nvoid paixu2() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < b; i++)\n    cin >> c[i];\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[b - 1];\n}\n"}
{"label": "8", "index": "13505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int e);\nvoid f2(int b[], int f);\nvoid f3(int c[], int h, int d[], int l);\nint main() {\n  int shuzu1[200], shuzu2[200];\n  int geshu1, geshu2;\n  scanf(\"%d%d\", &geshu1, &geshu2);\n  f1(shuzu1, geshu1);\n  f1(shuzu2, geshu2);\n  f2(shuzu1, geshu1);\n  f2(shuzu2, geshu2);\n  f3(shuzu1, geshu1, shuzu2, geshu2);\n}\nvoid f1(int a[], int e) {\n  int i;\n  for (i = 0; i < e; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int b[], int f) {\n  int k, t, g;\n  for (k = 0; k < f - 1; k++) {\n    for (t = 0; t < f - 1; t++) {\n      if (b[t] > b[t + 1]) {\n        g = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = g;\n      }\n    }\n  }\n}\nvoid f3(int c[], int h, int d[], int l) {\n  int z;\n  for (z = 0; z < h; z++)\n    printf(\"%d \", c[z]);\n\n  for (z = 0; z < l - 1; z++) {\n    printf(\"%d \", d[z]);\n  }\n  printf(\"%d\", d[l - 1]);\n}\n"}
{"label": "8", "index": "13506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100];\nvoid f() {\n  scanf(\"%d %d\", &m, &n);\n  int i, j;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\n\nint g(int a[], int l) {\n  int i, j, t;\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  return a[0];\n}\nvoid p(int a[], int b[]) {\n  int i, j;\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j <= n - 2; j++)\n    cout << b[j] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  f();\n  g(a, m);\n  g(b, n);\n  p(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint m, n, i, j;\nvoid temp() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid temp1() {\n  int x;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp2() {\n  int x;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp3() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  temp();\n  temp1();\n  temp2();\n  temp3();\n  return 0;\n}\n"}
{"label": "8", "index": "13508", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[10000], y[10000], z[100000];\nint m, n, i, j, temp;\nvoid dq() {\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> x[i];\n  for (i = 1; i <= n; i++)\n    cin >> y[i];\n}\n\nvoid px() {\n  for (i = 1; i <= m - 1; i++)\n    for (j = m; j >= i + 1; j--)\n      if (x[j] <= x[j - 1]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = n; j >= i + 1; j--)\n      if (y[j] <= y[j - 1]) {\n        temp = y[j];\n        y[j] = y[j - 1];\n        y[j - 1] = temp;\n      }\n}\n\nvoid hb() {\n  for (i = 1; i <= m; i++)\n    z[i] = x[i];\n  for (i = 1; i <= n; i++)\n    z[i + m] = y[i];\n}\n\nvoid xs() {\n  for (i = 1; i < m + n; i++)\n    cout << z[i] << ' ';\n  printf(\"%d\", z[m + n]);\n  cout << endl;\n}\n\nint main() {\n  dq();\n  px();\n  hb();\n  xs();\n  return 0;\n}\n"}
{"label": "8", "index": "13509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[2], i, j, b[2][100], p, c[100], s, t;\n\n  for (i = 0; i < 2; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < a[i]; j++)\n      cin >> b[i][j];\n\n  for (i = 0; i < 2; i++) {\n    for (s = 0; s < a[i] - 1; s++) {\n      for (t = 0; t < a[i] - 1 - s; t++)\n        if (b[i][t] > b[i][t + 1]) {\n          p = b[i][t];\n          b[i][t] = b[i][t + 1];\n          b[i][t + 1] = p;\n        }\n    }\n  }\n\n  for (i = 0; i < a[0]; i++)\n    c[i] = b[0][i];\n  for (j = 0; j < a[1]; j++)\n    c[a[0] + j] = b[1][j];\n\n  for (s = 0; s < a[0] + a[1] - 1; s++)\n    printf(\"%d \", c[s]);\n  printf(\"%d\", c[a[0] + a[1] - 1]);\n}\n"}
{"label": "8", "index": "13510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i = 0, j = 0;\n  int t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int a[], int n, int b[], int m) {\n  int i = 0, j = 0;\n  while (i < n) {\n    printf(\"%d \", a[i]);\n    i++;\n  }\n  while (j < m - 1) {\n    cout << b[j] << \" \";\n    j++;\n  }\n  cout << b[m - 1];\n}\nint main() {\n  void order(int a[], int n);\n  void print(int a[], int n, int b[], int m);\n  int x[20], y[20];\n  int n, m, i = 0, j = 0;\n  scanf(\"%d%d\", &n, &m);\n  while (i < n) {\n    scanf(\"%d\", &x[i]);\n    i++;\n  }\n  while (j < m) {\n    scanf(\"%d\", &y[j]);\n    j++;\n  }\n  order(x, n);\n  order(y, m);\n  print(x, n, y, m);\n}\n"}
{"label": "8", "index": "13511", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0, a[20] = {0}, b[20] = {0}, c[40] = {0};\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n}\n\nvoid sort() {\n  for (int j = 1; j < m; j++)\n    for (int i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        int p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n  for (int j = 1; j < n; j++)\n    for (int i = 1; i <= n - j; i++)\n      if (b[i] > b[i + 1]) {\n        int p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n}\n\nvoid combine() {\n  for (int i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (int j = 1; j <= n; j++)\n    c[m + j] = b[j];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\\n\", c[m + n]);\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sheng(int *a, int n) {\n  int i, j, b;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i])\n\n      {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint hebing(int *a, int n, int *b, int m, int *c) {\n\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < m + n; i++)\n    c[i] = b[i - n];\n  return *c;\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d %d \", &n, &m);\n  int *a = (int *)malloc(sizeof(int) * n);\n  int *b = (int *)malloc(sizeof(int) * m);\n  int *c = (int *)malloc(sizeof(int) * (m + n));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  sheng(a, n);\n  sheng(b, m);\n  hebing(a, n, b, m, c);\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "13513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint work(int now, int x) {\n  int i, j, swap;\n  int a[1002];\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= x; i++) {\n    for (j = i + 1; j <= x; j++) {\n      if (a[i] > a[j]) {\n        swap = a[i];\n        a[i] = a[j];\n        a[j] = swap;\n      }\n    }\n  }\n  if (now == 2)\n    printf(\" \");\n  cout << a[1];\n  for (i = 2; i <= x; i++) {\n    printf(\" %d\", a[i]);\n  }\n\n  return (0);\n}\nint main() {\n  int n, m;\n  scanf(\"%d%d\", &n, &m);\n  work(1, n);\n  work(2, m);\n  return (0);\n}\n"}
{"label": "8", "index": "13514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint na, nb;\nint *a, *b;\nvoid input() {\n  scanf(\"%d %d\", &na, &nb);\n  a = (int *)malloc(na * sizeof(int));\n  b = (int *)malloc(nb * sizeof(int));\n  for (int i = 0; i < na; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = 0; i < nb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return t;\n}\nvoid order() {\n  qsort(a, na, sizeof(int), pfC);\n  qsort(b, nb, sizeof(int), pfC);\n}\n\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < na; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 0; i < nb; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  input();\n  order();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13515", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *n1, int data1[], int *n2, int data2[]) {\n  scanf(\"%d %d \", n1, n2);\n  for (int i = 0; i < *n1; ++i)\n    cin >> data1[i];\n  for (int i = 0; i < *n2; ++i)\n    scanf(\"%d \", &data2[i]);\n  return;\n}\nvoid bubblesort(int n, int data[]) {\n  for (int i = n - 1; i > 0; --i)\n    for (int j = 0; j < i; ++j)\n      if (data[j] > data[j + 1]) {\n        int temp = data[j];\n        data[j] = data[j + 1];\n        data[j + 1] = temp;\n      }\n  return;\n}\nint combine(int n1, int data1[], int n2, int data2[], int data3[]) {\n  for (int i = 0; i < n1; ++i)\n    data3[i] = data1[i];\n  for (int i = n1; i < n1 + n2; ++i)\n    data3[i] = data2[i - n1];\n  return n1 + n2;\n}\nvoid print(int n, int data[]) {\n  printf(\"%d\", data[0]);\n  for (int i = 1; i < n; ++i)\n    cout << ' ' << data[i];\n  cout << endl;\n  return;\n}\nint main() {\n  int n1, n2, a1[101], a2[101], a3[201];\n  input(&n1, a1, &n2, a2);\n  bubblesort(n1, a1);\n  bubblesort(n2, a2);\n\n  int n3 = combine(n1, a1, n2, a2, a3);\n  print(n3, a3);\n  return 0;\n}\n"}
{"label": "8", "index": "13516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint read(int a[200], int b[100]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  a[0] = m;\n  b[0] = n;\n  for (i = 1; i <= m; i++)\n    scanf(\" %d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\" %d\", &b[i]);\n  return 0;\n}\nint seq(int a[200]) {\n  int i, j, t, m = a[0];\n  for (j = 1; j <= m - 1; j++)\n    for (i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  return 0;\n}\nint toge(int a[200], int b[100]) {\n  int i;\n  int m = a[0];\n  int n = b[0];\n  a[0] = a[0] + b[0];\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n  return 0;\n}\nint see(int a[200]) {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= a[0]; i++)\n    cout << \" \" << a[i];\n  return 0;\n}\nint main() {\n  int a[200], b[100];\n  read(a, b);\n  seq(a);\n  seq(b);\n  toge(a, b);\n  see(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shuru(int array[100], int x);\n  void paixu(int array[100], int x);\n  int i, m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\nvoid shuru(int array[100], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\nvoid paixu(int array[100], int x) {\n  int i, j, b;\n  for (j = 1; j < x; j++) {\n    for (i = 0; i < x - j; i++) {\n      if (array[i] > array[i + 1]) {\n        b = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = b;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "13518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid programme() {\n  int n1, n2, i, j, temp;\n  int a[101], b[101];\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = 0; j < n2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2; i++) {\n    if (i != n2 - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n  return;\n}\n\nint main() {\n  programme();\n  return 0;\n}\n"}
{"label": "8", "index": "13519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void order(int a[], int b[], int m, int n);\n  int a[100], b[100];\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, b, m, n);\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n  return 0;\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  return;\n}\n"}
{"label": "8", "index": "13520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int, int, int *, int *);\nvoid paixu(int *, int);\nvoid output(int, int, int *, int *);\n\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &shu1[i]);\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\n"}
{"label": "8", "index": "13521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nvoid shuchu(int c[20], int m, int n);\nvoid hubing(int c[20], int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10], c[20];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  pai(a, m);\n  pai(b, n);\n  hubing(c, a, b, m, n);\n  shuchu(c, m, n);\n}\nvoid hubing(int c[20], int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n}\nvoid shuchu(int c[20], int m, int n) {\n  int i;\n  for (i = 0; i < (m + n - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f0(int a[], int x) {\n  int i = 0;\n  for (; i < x; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f1(int a[], int x) {\n  int i, j, s;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n}\nvoid f2(int a[], int b[], int c[], int m, int n) {\n  int i = 0;\n  while (i < m) {\n    c[i] = a[i];\n    i++;\n  }\n  while (i < m + n) {\n    c[i] = b[i - m];\n    i++;\n  }\n}\nint main() {\n  int a[50], b[50], c[100], m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  f0(a, m);\n  f0(b, n);\n  f1(a, m);\n  f1(b, n);\n  f2(a, b, c, m, n);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, i;\nint a[100];\nint b[100];\nvoid passed(int x, int y) {\n  int j, t;\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  passed(n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "13524", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, a[100], b[100], temp = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13525", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid scan(int n[], int a[], int b[]) {\n  int i;\n  scanf(\"%d%d\", &n[0], &n[1]);\n\n  for (i = 0; i < n[0]; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[], int m, int n) {\n  int i, j, t;\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\n\nvoid com(int a[], int b[], int ab[], int m, int n) {\n  int i;\n\n  for (i = 0; i < m; i++)\n    ab[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    ab[m + i] = b[i];\n}\n\nvoid prt(int ab[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", ab[i]);\n\n  printf(\"%d\", ab[m + n - 1]);\n}\n\nint main() {\n  int a[101], b[101], n[2], ab[202];\n\n  scan(n, a, b);\n  sort(a, b, n[0], n[1]);\n  com(a, b, ab, n[0], n[1]);\n  prt(ab, n[0], n[1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "13526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nvoid f1(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(int a[1000], int b[1000]) {\n  int i, j, t;\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (n - 1); i > j; i--) {\n      if (a[i] < a[i - 1]) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (m - 1); i > j; i--) {\n      if (b[i] < b[i - 1]) {\n        t = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n}\nvoid f4(int a[1000]) {\n  int i;\n  for (i = 0; i < (n + m); i++) {\n    printf(\"%d\", a[i]);\n    if (i != (n + m - 1))\n      printf(\" \");\n  }\n}\nint main() {\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  f1(a, b);\n  f2(a, b);\n  f3(a, b);\n  f4(a);\n}\n"}
{"label": "8", "index": "13527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid rank1(int array[], int num, int k) \n{\n  int a, i, j;\n  for (i = 1; i < num; i++)        \n    for (j = 1; j <= num - i; j++) \n      if (array[j] > array[j + 1]) {\n        a = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = a;\n      }\n  for (i = 1; i <= num; i++) \n  {\n    if (i == 1) {\n      if (k == 2) \n        cout << ' ';\n      cout << array[1];\n    } else\n      cout << ' ' << array[i];\n  }\n}\n\nvoid rank2(int num1, int num2) \n{\n  int array1[10000], array2[10000], i; \n  for (i = 1; i <= num1; i++)          \n    cin >> array1[i];\n  for (i = 1; i <= num2; i++)\n    cin >> array2[i];\n  rank1(array1, num1, 1); \n  rank1(array2, num2, 2);\n  cout << endl;\n}\n\nint main() {\n  int num1, num2;\n  cin >> num1 >> num2;\n  rank2(num1, num2); \n  return 0;\n}\n"}
{"label": "8", "index": "13528", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid read(int *a, int *b, int num1, int num2);\nvoid sort(int *a, int num1);\nvoid merge(int *a, int *b, int *c, int num1, int num2);\nvoid print(int *a, int num1);\nint main() {\n  int a[100], b[100], c[200];\n  int num1, num2;\n  cin >> num1 >> num2;\n  read(a, b, num1, num2);\n  sort(a, num1);\n  sort(b, num2);\n  merge(a, b, c, num1, num2);\n  print(c, num1 + num2);\n  return 0;\n}\n\nvoid read(int *a, int *b, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int num1) {\n  int i, j;\n  for (i = 0; i < num1; i++) {\n    for (j = i + 1; j < num1; j++) {\n      if (a[i] > a[j]) {\n        int temp;\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *a, int *b, int *c, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = num1; i < num1 + num2; i++)\n    c[i] = b[i - num1];\n}\n\nvoid print(int *a, int num1) {\n  int i;\n  for (i = 0; i < num1 - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[num1 - 1] << endl;\n}\n"}
{"label": "8", "index": "13529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a();\nvoid b();\nvoid c();\nvoid d();\nint x1[1000], x2[499], n1, n2;\nint main() {\n\n  a();\n  b();\n  c();\n  d();\n\n  return 0;\n}\n\nvoid a() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &x1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &x2[i]);\n}\nvoid b() {\n  int i, j, p;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (x1[i] > x1[j]) {\n        p = x1[i];\n        x1[i] = x1[j];\n        x1[j] = p;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (x2[i] > x2[j]) {\n        p = x2[i];\n        x2[i] = x2[j];\n        x2[j] = p;\n      }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    x1[n1 + i] = x2[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", x1[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N1[100], N2[100], N[200], n1, n2;\n  void scan(int N1[], int N2[], int *p1, int *p2);\n  void order(int N1[], int n1, int N2[], int n2);\n  void join(int N1[], int N2[], int N[], int n1, int n2);\n  void print(int N[], int n);\n  scan(N1, N2, &n1, &n2);\n  order(N1, n1, N2, n2);\n  join(N1, N2, N, n1, n2);\n  print(N, n1 + n2);\n}\nvoid scan(int N1[], int N2[], int *p1, int *p2) {\n  int i;\n  scanf(\"%d%d\", p1, p2);\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", &N1[i]);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", &N2[i]);\n}\nvoid order(int N1[], int n1, int N2[], int n2) {\n  int i, j, imin, Nmin, Nm;\n  for (i = 0; i < n1; i++) {\n    imin = i;\n    Nmin = N1[i];\n    for (j = i; j < n1; j++) {\n      if (N1[j] < Nmin) {\n        imin = j;\n        Nmin = N1[j];\n      }\n    }\n    Nm = N1[i];\n    N1[i] = N1[imin];\n    N1[imin] = Nm;\n  }\n  for (i = 0; i < n2; i++) {\n    imin = i;\n    Nmin = N2[i];\n    for (j = i; j < n2; j++) {\n      if (N2[j] < Nmin) {\n        imin = j;\n        Nmin = N2[j];\n      }\n    }\n    Nm = N2[i];\n    N2[i] = N2[imin];\n    N2[imin] = Nm;\n  }\n}\nvoid join(int N1[], int N2[], int N[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    N[i] = N1[i];\n  for (i = n1; i < n1 + n2; i++)\n    N[i] = N2[i - n1];\n}\nvoid print(int N[], int n) {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n}\n"}
{"label": "8", "index": "13531", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint m, n;\nint a[100], b[100];\nint ans[200];\nvoid read(int a[], int b[]) {\n  cin >> m;\n  cin >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int m) {\n  int temp;\n  for (int i = 1; i < m; i++) {\n    for (int j = i + 1; j <= m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[]) {\n  for (int i = 1; i <= m; i++)\n    ans[i] = a[i];\n  for (int i = 1; i <= n; i++)\n    ans[m + i] = b[i];\n}\nvoid out(int a[], int m) {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  read(a, b);\n  sort(a, m);\n  sort(b, n);\n  add(a, b);\n  out(ans, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int c[], int x) {\n  int p;\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        p = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int a[100], b[100];\n  int m, n, i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n  f(a, m);\n  f(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[j];\n  return 0;\n}\n"}
{"label": "8", "index": "13533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0;\nint a[100], b[100], c[200];\nvoid read(void) {\n  int i = 0;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort(void) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid combine(void) {\n  int i = 0;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\nvoid output(void) {\n  int i = 0;\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  read();\n  sort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, i, j, a[1000], b[1000], c[2000], s, t;\nvoid one() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid two() {\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        s = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = s;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n}\nvoid three() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i - m < n; i++)\n    c[i] = b[i - m];\n}\nvoid four() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  one();\n  two();\n  three();\n  four();\n}\n"}
{"label": "8", "index": "13535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1001] = {0};\nint b[1001] = {0};\nint m, n;\nvoid loaddata() {\n  int l;\n  scanf(\"%d %d\", &m, &n);\n  for (l = 0; l < m; l++)\n    scanf(\"%d\", &a[l]);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &b[l]);\n}\nvoid arrsort() {\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid add() {\n  int p;\n  for (p = 0; p < n; p++) {\n    a[p + m] = b[p];\n  }\n}\nvoid print() {\n  int q;\n  printf(\"%d\", a[0]);\n  for (q = 1; q < m + n; q++) {\n    printf(\" %d\", a[q]);\n  }\n}\n\nint main() {\n  loaddata();\n  arrsort();\n  add();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[100] = {0}, b[100] = {0}, c[200] = {0};\nvoid duqu() {\n  int *p;\n  scanf(\"%d %d\", &m, &n);\n  for (p = a; p < a + m; p++)\n    scanf(\"%d\", p);\n  for (p = b; p < b + n; p++)\n    scanf(\"%d\", p);\n}\nvoid range(int a[], int b[], int m, int n) {\n  int *p, *q, d;\n  for (p = a; p < a + m - 1; p++)\n    for (q = p + 1; q < a + m; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n  for (p = b; p < b + n - 1; p++)\n    for (q = p + 1; q < b + n; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int *p, *q;\n  for (p = c, q = a; q < a + m; p++, q++)\n    *p = *q;\n  for (p = c + m, q = b; q < b + n; p++, q++)\n    *p = *q;\n}\nvoid show(int c[], int d) {\n  int *p;\n  for (p = c; p < c + d - 1; p++)\n    printf(\"%d \", *p);\n  cout << *p;\n}\nint main() {\n  duqu();\n  range(a, b, m, n);\n  merge(a, b, m, n);\n  show(c, m + n);\n}\n"}
{"label": "8", "index": "13537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], n, m;\nvoid shuru(void);\nvoid paixu(void);\nvoid hebing(void);\nvoid shuchu(void);\nint main() {\n\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\nvoid shuru(void) {\n  int x, y;\n  cin >> x >> y;\n  int i;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  n = x;\n  m = y;\n}\nvoid paixu(void) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n}\nvoid hebing(void) {\n  int i;\n  for (i = n; i < m + n; i++)\n    a[i] = b[i - n];\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "13538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, a[1000], b, k = 0, tmp, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n + m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n + 1; i++)\n    for (j = 1; j <= n - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= m + 1; i++)\n    for (j = n + 1; j <= n + m - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n + m; i++)\n    cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, i, j, a[1000], b[1000], c[2000], s, t;\nvoid one() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid two() {\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        s = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = s;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n}\nvoid three() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i - m < n; i++)\n    c[i] = b[i - m];\n}\nvoid four() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  one();\n  two();\n  three();\n  four();\n}\n"}
{"label": "8", "index": "13540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[100], b[100], t, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j <= n; j++) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++) {\n    for (j = 2; j <= m; j++) {\n      if (b[j] < b[j - 1]) {\n        t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstatic int n1, n2, a[100] = {0}, b[100] = {0}, d[200] = {0};\nvoid f1() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid pai() {\n  int c, i, j;\n  for (j = 0; j < n1; j++) {\n    for (i = 0; i < n1 - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n    }\n  }\n  for (j = 0; j < n2; j++) {\n    for (i = 0; i < n2 - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n    }\n  }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    d[i] = b[i - n1];\n  }\n}\nvoid shu() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++) {\n    printf(\"%d \", d[i]);\n  }\n  cout << d[n1 + n2 - 1];\n}\nint main() {\n  f1();\n  pai();\n  he();\n  shu();\n}\n"}
{"label": "8", "index": "13542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100];\nvoid insert(void) {\n  int i = 0;\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"\\n\");\n  for (i = m; i < m + n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid px(int *p) {\n  int i, j, b = 0;\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  for (i = m; i < m + n; i++) {\n    for (j = m + n - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  printf(\"%d\", *(p + 0));\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", *(p + i));\n  }\n}\nint main() {\n  insert();\n  px(a);\n}\n"}
{"label": "8", "index": "13543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m;\nint a[1000], b[1000], c[2000];\n\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < m; ++i)\n    scanf(\"%d\", b + i);\n}\n\nint cmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }\n\nvoid sort() {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge() {\n  int i;\n  for (i = 0; i < n; ++i)\n    c[i] = a[i];\n  for (i = 0; i < m; ++i)\n    c[n + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n + m; ++i)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void px(int a[], int l1, int b[], int l2);\n  int len1, len2, a[100], b[100], i;\n  cin >> len1 >> len2;\n  for (i = 1; i <= len1; i++)\n    cin >> a[i];\n  for (i = 1; i <= len2; i++)\n    cin >> b[i];\n  px(a, len1, b, len2);\n  return 0;\n}\n\nvoid px(int a[], int l1, int b[], int l2) {\n  int i, j, temp;\n  for (i = 1; i <= l1 - 1; i++)\n    for (j = i + 1; j <= l1; j++)\n      if (a[i] > a[j]) {\n        temp = a[j], a[j] = a[i], a[i] = temp;\n      }\n\n  for (i = 1; i <= l2 - 1; i++)\n    for (j = i + 1; j <= l2; j++)\n      if (b[i] > b[j]) {\n        temp = b[j], b[j] = b[i], b[i] = temp;\n      }\n  for (i = 1; i <= l1; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= l2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[l2];\n}\n"}
{"label": "8", "index": "13545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int n) {\n  int i, j, aaa;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        aaa = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = aaa;\n      }\n    }\n  }\n}\nvoid combine(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  int a[100], b[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  read(a, m, b, n);\n  order(a, m);\n  order(b, n);\n  combine(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13546", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sort(int a[], int n);\nint main() {\n  int m, n, i, j, a[100], b[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  sort(a, m);\n  for (j = 0; j < n; j++) {\n    cin >> b[j];\n  }\n  sort(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (j = 0; j < n - 1; j++)\n    printf(\"%d \", b[j]);\n  cout << b[n - 1];\n  return 0;\n}\nvoid sort(int a[], int n) {\n  int i, j, index, temp;\n\n  for (i = 0; i < n - 1; i++) {\n\n    index = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[index] > a[j])\n        index = j;\n    }\n    temp = a[i];\n    a[i] = a[index];\n    a[index] = temp;\n  }\n}\n"}
{"label": "8", "index": "13547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f1(int a[], int x, int b[], int y) {\n  int m, n, i;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = m; i < x; i++)\n    a[i] = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = n; i < y; i++)\n    b[i] = -1;\n}\n\nvoid f2(int a[], int x, int b[], int y) {\n  int i, j, t, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\n\nvoid f3(int a[], int x, int b[], int y, int c[], int z) {\n  int i, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n  for (i = n + m; i < z; i++)\n    c[i] = -1;\n}\n\nvoid f4(int c[], int x) {\n  int i, e;\n\n  for (i = 0, e = 0; i < x; i++)\n    if (c[i] >= 0)\n      e++;\n  for (i = 0; i < e; i++) {\n    cout << c[i];\n    if (i != e - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int a[30], b[30], c[60];\n\n  f1(a, 30, b, 30);\n\n  f2(a, 30, b, 30);\n\n  f3(a, 30, b, 30, c, 60);\n\n  f4(c, 60);\n}\n"}
{"label": "8", "index": "13548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint arr(int a[], int x, int b[], int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  return 0;\n}\nint arr1(int a[], int x, int b[], int y) {\n  int i, j, tmp;\n  for (i = 0; i < x - 1; i++)\n    for (j = i + 1; j < x; j++)\n      if (a[i] > a[j]) {\n        tmp = a[i];\n        a[i] = a[j];\n        a[j] = tmp;\n      }\n  for (i = 0; i < y - 1; i++)\n    for (j = i + 1; j < y; j++)\n      if (b[i] > b[j]) {\n        tmp = b[i];\n        b[i] = b[j];\n        b[j] = tmp;\n      }\n  return 0;\n}\nint arr2(int a[], int x, int b[], int y, int c[]) {\n  int i, j;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (; i < x + y; i++)\n    c[i] = b[i - x];\n  return 0;\n}\nint arr3(int c[], int t) {\n  int i;\n  for (i = 0; i < t; i++) {\n    printf(\"%d\", c[i]);\n    if (i < t - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint main() {\n  int x, y;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &x, &y);\n  arr(a, x, b, y);\n  arr1(a, x, b, y);\n  arr2(a, x, b, y, c);\n  arr3(c, x + y);\n  return 0;\n}\n"}
{"label": "8", "index": "13549", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\n\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n\nvoid input(int *a, int *b) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid sort(int *a, int *b) {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge(int *a, int *b, int *c) {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\n\nvoid output(int *c) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d%s\", c[i], i < m + n - 1 ? \" \" : \"\\n\");\n  }\n}\nint main() {\n  int a[10000] = {0};\n  int b[10000] = {0};\n  int c[10000] = {0};\n  input(a, b);\n  sort(a, b);\n  merge(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "13550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct nums {\n  int m;\n  int n;\n  int x[2][100];\n};\nstruct nums get() {\n  int i;\n  struct nums in;\n  scanf(\"%d%d\", &in.m, &in.n);\n  getchar();\n  for (i = 0; i < in.m; i++)\n    scanf(\"%d\", &in.x[0][i]);\n  for (i = 0; i < in.n; i++)\n    scanf(\"%d\", &in.x[1][i]);\n\n  return in;\n}\nstruct nums bubble(struct nums in) {\n  int i, j, c;\n  for (i = 1; i <= in.m; i++)\n    for (j = 0; j < in.m - 1; j++)\n      if (in.x[0][j] > in.x[0][j + 1]) {\n        c = in.x[0][j];\n        in.x[0][j] = in.x[0][j + 1];\n        in.x[0][j + 1] = c;\n      }\n  for (i = 1; i <= in.n; i++)\n    for (j = 0; j < in.n - 1; j++)\n      if (in.x[1][j] > in.x[1][j + 1]) {\n        c = in.x[1][j];\n        in.x[1][j] = in.x[1][j + 1];\n        in.x[1][j + 1] = c;\n      }\n  return in;\n}\nstruct nums combine(struct nums in) {\n  int i;\n  for (i = in.m; i < in.m + in.n; i++)\n    in.x[0][i] = in.x[1][i - in.m];\n  return in;\n}\nvoid put(struct nums in) {\n  int i;\n  printf(\"%d\", in.x[0][0]);\n  for (i = 1; i < in.m + in.n; i++)\n    printf(\" %d\", in.x[0][i]);\n}\nint main() {\n  struct nums in = get();\n  struct nums ina = bubble(in);\n  struct nums inb = combine(ina);\n  put(inb);\n}\n"}
{"label": "8", "index": "13551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n1 + n2 - 1];\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  combine(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13552", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint num1[100], num2[100], num3[1000];\nvoid read() {\n  cin >> n >> m;\n  for (int i = 1; i <= n; i++)\n    cin >> num1[i];\n\n  for (int i = 1; i <= m; i++) {\n    cin >> num2[i];\n  }\n}\n\nvoid sort(int num1[], int num2[]) {\n  for (int i = 1; i <= n - 1; i++) {\n    for (int j = 1; j <= n - i; j++) {\n      if (num1[j] > num1[j + 1])\n        swap(num1[j], num1[j + 1]);\n    }\n  }\n  for (int i = 1; i <= m - 1; i++) {\n    for (int j = 1; j <= m - i; j++) {\n      if (num2[j] > num2[j + 1])\n        swap(num2[j], num2[j + 1]);\n    }\n  }\n}\nvoid hebing(int num1[], int num2[], int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i <= n)\n      num3[i] = num1[i];\n    else\n      num3[i] = num2[i - n];\n  }\n}\nvoid display(int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i == 1)\n      cout << num3[i];\n    else\n      printf(\" %d\", num3[i]);\n  }\n}\n\nint main() {\n  read();\n  sort(num1, num2);\n  hebing(num1, num2, num3);\n  display(num3);\n  return 0;\n}\n"}
{"label": "8", "index": "13553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n1, n2, a[200], b[100];\n\nvoid readNum() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Bubble() {\n  int t, i, j;\n  for (i = n1 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n2 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid gether() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\n\nvoid printNum() {\n  int i;\n  for (i = 0; i < n1 + n2; i++)\n    printf(\"%d%c\", a[i], (i < n1 + n2 - 1) ? ' ' : '\\n');\n}\n\nint main() {\n  readNum();\n  Bubble();\n  gether();\n  printNum();\n}\n"}
{"label": "8", "index": "13554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], c[20000], n, m;\nvoid input() {\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine() {\n  for (int i = 0; i < n; i++)\n    c[i] = a[i];\n  for (int j = n; j < n + m; j++)\n    c[j] = b[j - n];\n}\nvoid out() {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  input();\n  sort();\n  combine();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input() {\n  int i;\n  scanf(\"%d\", &i);\n  return (i);\n}\nvoid shit(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n}\nvoid damn(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n  }\n}\nint main() {\n  int m = input(), n = input();\n  int a[1000], b[1000];\n  shit(a, m);\n  damn(b, n);\n}\n"}
{"label": "8", "index": "13556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid duqu(int m, int a[]);\nvoid paixu(int m, int a[]);\nvoid hebing(int m, int n, int a[], int b[]);\nvoid shuchu(int m, int n, int a[]);\nint main() {\n  int x[100] = {0}, y[100] = {0}, m, n;\n  scanf(\"%d%d\", &m, &n);\n  duqu(m, x);\n  duqu(n, y);\n  paixu(m, x);\n  paixu(n, y);\n  hebing(m, n, x, y);\n  shuchu(m, n, x);\n}\nvoid duqu(int m, int a[]) {\n  int i;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid paixu(int m, int a[]) {\n  int i, j, k;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n}\nvoid hebing(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid shuchu(int m, int n, int a[]) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n]);\n}\n"}
{"label": "8", "index": "13557", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], la, lb, c[20000];\nvoid get();\nvoid array_1();\nvoid combine();\nvoid out();\nint main() {\n  get();\n  array_1();\n  combine();\n  out();\n  return 0;\n}\nvoid get() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < lb; i++) {\n    cin >> b[i];\n  }\n}\nvoid array_1() {\n  int v;\n  for (int i = 0; i < la - 1; i++) {\n    for (int j = 0; j < la - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        v = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = v;\n      }\n    }\n  }\n  for (int i = 0; i < lb - 1; i++) {\n    for (int j = 0; j < lb - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        v = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = v;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (int i = 0; i < la; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < lb; i++) {\n    c[la + i] = b[i];\n  }\n}\nvoid out() {\n  for (int i = 0; i < la + lb; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << ' ' << c[i];\n  }\n}\n"}
{"label": "8", "index": "13558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  int a[m], b[n];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  long i, j, n, m, x, p = 0;\n  int a[100001] = {0};\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    a[x]++;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      if (p == 0) {\n        cout << i;\n        p = 1;\n      } else\n        cout << \" \" << i;\n    a[i] = 0;\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &x);\n    a[x] = 1;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      cout << \" \" << i;\n    a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[100], b[100], c[100];\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid zuhe() {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n; i < n + m; i++) {\n    c[i] = b[i - n];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < n + m; i++) {\n    if (i != n + m - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  shuru();\n  paixu();\n  zuhe();\n  shuchu();\n}\n"}
{"label": "8", "index": "13561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000];\nint b[10000];\nint n, m;\nvoid du() {\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid ran() {\n  for (int i = 0; i < n; i++) {\n    int temp = a[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] <= temp) {\n        a[j + 1] = temp;\n        break;\n      } else {\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < m; i++) {\n    int temp = b[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (b[j] <= temp) {\n        b[j + 1] = temp;\n        break;\n      } else {\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid he() {\n  for (int i = n; i < n + m; i++)\n    a[i] = b[i - n];\n}\nvoid shu() {\n  for (int i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n + m - 1];\n}\nint main() {\n  du();\n  ran();\n  he();\n  shu();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13562", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, f, g;\n  scanf(\"%d%d\", &c, &d);\n  int a[c], b[d];\n  for (e = 0; e < c; e++)\n    cin >> a[e];\n  for (e = 0; e < d; e++)\n    scanf(\"%d\", &b[e]);\n  for (f = 0; f < c - 1; f++)\n    for (e = 0; e < c - 1; e++)\n      if (a[e] > a[e + 1]) {\n        g = a[e];\n        a[e] = a[e + 1];\n        a[e + 1] = g;\n      }\n  printf(\"%d\", a[0]);\n  for (e = 1; e < c; e++)\n    printf(\" %d\", a[e]);\n  for (f = 0; f < d - 1; f++)\n    for (e = 0; e < d - 1; e++)\n      if (b[e] > b[e + 1]) {\n        g = b[e];\n        b[e] = b[e + 1];\n        b[e + 1] = g;\n      }\n  for (e = 0; e < d; e++)\n    printf(\" %d\", b[e]);\n  return 0;\n}\n"}
{"label": "8", "index": "13563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nvoid nem(int num1[100], int num2[100]) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &num1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num2[i]);\n}\nvoid pai(int num[100], int x) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - 1 - j; i++)\n      if (num[i] > num[i + 1]) {\n        t = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t;\n      }\n}\nvoid he(int num1[100], int num2[100], int num[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    num[i] = num1[i];\n  for (i = m; i < m + n; i++)\n    num[i] = num2[i - m];\n}\nvoid printnum(int num[100]) {\n  int i;\n  printf(\"%d\", num[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", num[i]);\n}\nint main() {\n  int num[100], num1[100], num2[100];\n  nem(num1, num2);\n  pai(num1, m);\n  pai(num2, n);\n  he(num1, num2, num);\n  printnum(num);\n  return 0;\n}\n"}
{"label": "8", "index": "13564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint num1, num2;\nvoid getin() {\n  int i, j;\n  cin >> num1 >> num2;\n  for (i = 1; i <= num1; i++)\n    cin >> a[i];\n  for (j = 1; j <= num2; j++)\n    cin >> b[j];\n}\nvoid order(int aa[], int num) {\n  int t, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j < num; j++)\n      if (aa[j] > aa[j + 1]) {\n        t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n}\nvoid print(int a[], int b[], int num1, int num2) {\n  cout << a[1];\n  int i;\n  for (i = 2; i <= num1; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= num2; i++)\n    cout << \" \" << b[i];\n  cout << endl;\n}\n\nint main() {\n\n  getin();\n  order(a, num1);\n  order(b, num2);\n  print(a, b, num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "13565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid fuction1(int x, int a[]) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 0; i < x; i++)\n    cout << a[i] << \" \";\n}\nvoid fuction2(int y, int b[]) {\n  int i, j, m;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < y - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n  for (i = 0; i < y - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[y - 1];\n}\nint main() {\n  int k, l, p, q, a[1000000], b[1000000];\n  cin >> p >> q;\n  for (k = 0; k < p; k++)\n    cin >> a[k];\n  for (k = 0; k < q; k++)\n    cin >> b[k];\n  fuction1(p, a);\n  fuction2(q, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13566", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, array1[100], array2[100], sa[100];\nvoid zp1(int a1[100], int l1) {\n  int cur1;\n  for (int i = 0; i < l1 - 1; i++)\n    for (int j = 0; j < l1 - 1 - i; j++)\n      if (a1[j] > a1[j + 1]) {\n        cur1 = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = cur1;\n      }\n}\nvoid zp2(int a2[100], int l2) {\n  int cur2;\n  for (int i = 0; i < l2 - 1; i++)\n    for (int j = 0; j < l2 - 1 - i; j++)\n      if (a2[j] > a2[j + 1]) {\n        cur2 = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = cur2;\n      }\n}\nvoid connection(int a1[100], int a2[100]) {\n  for (int i = 0; i < len1; i++)\n    sa[i] = array1[i];\n  for (int i = len1; i < len1 + len2; i++)\n    sa[i] = array2[i - len1];\n}\n\nint main() {\n\n  cin >> len1 >> len2;\n  for (int i = 0; i < len1; i++)\n    cin >> array1[i];\n  for (int i = 0; i < len2; i++)\n    cin >> array2[i];\n  zp1(array1, len1);\n  zp2(array2, len2);\n  connection(array1, array2);\n  cout << sa[0];\n  for (int i = 1; i < len1 + len2; i++)\n    cout << \" \" << sa[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "13567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint la = 0, lb = 0, l = 0, a[100], b[100],\n    combine[200]; \n\nvoid input();                     \nvoid seq();                       \nvoid sequence(int x[100]);        \nvoid com(int a[100], int b[100]); \nvoid output(int combine[200]);    \n\nint main() {       \n  input();         \n  seq();           \n  com(a, b);       \n  output(combine); \n  return 0;        \n}\nvoid input() {                 \n  cin >> la >> lb;             \n  for (int i = 0; i < la; i++) \n    cin >> a[i];\n  for (int i = 0; i < lb; i++) \n    cin >> b[i];\n}\nvoid seq() { \n  l = la;\n  sequence(a); \n  l = lb;\n  sequence(b); \n}\nvoid sequence(int x[100]) {   \n  int temp = 0;               \n  for (int i = 1; i < l; i++) \n    for (int j = 1; j <= l - i; j++)\n      if (x[j - 1] > x[j]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n}\nvoid com(int a[100], int b[100]) { \n  memcpy(combine, a, la * 4);\n  memcpy(combine + la, b, lb * 4);\n}\nvoid output(int combine[200]) { \n  cout << combine[0];           \n  for (int i = 1; i < la + lb; i++)\n    cout << \" \" << combine[i];\n}\n"}
{"label": "8", "index": "13568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[200];\nint b[100];\nint *p1 = a, *p2 = b;\nint m, n;\nint *p2m = &m, *p2n = &n;\n\nvoid funcofa(int *p1, int *p2, int *p2m, int *p2n) {\n  scanf(\"%d%d\", p2m, p2n);\n  int i;\n  for (i = 1; i <= *p2m; i++) {\n    scanf(\"%d\", p1 + i - 1);\n  }\n  for (i = 1; i <= *p2n; i++) {\n    scanf(\"%d\", p2 + i - 1);\n  }\n}\n\nvoid funcofb(int *p1, int *p2, int *p2m, int *p2n) {\n  int i, j;\n  int temp;\n  for (i = 1; i <= *p2m; i++) {\n    for (j = 1; j < *p2m; j++) {\n      if (*(p1 + j - 1) > *(p1 + j)) {\n        temp = *(p1 + j);\n        *(p1 + j) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n  for (i = 1; i <= *p2n; i++) {\n    for (j = 1; j < *p2n; j++) {\n      if (*(p2 + j - 1) > *(p2 + j)) {\n        temp = *(p2 + j);\n        *(p2 + j) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n}\n\nvoid funcofc(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  for (i = 1; i <= *p2n; i++) {\n    *(p1 + (*p2m) + i - 1) = *(p2 + i - 1);\n  }\n}\n\nvoid funcofd(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  printf(\"%d\", *p1);\n  for (i = 2; i <= *p2m + *p2n; i++) {\n    cout << \" \" << *(p1 - 1 + i);\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  funcofa(p1, p2, p2m, p2n);\n  funcofb(p1, p2, p2m, p2n);\n  funcofc(p1, p2, p2m, p2n);\n  funcofd(p1, p2, p2m, p2n);\n  return 0;\n}\n"}
{"label": "8", "index": "13569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[400], b[200], n, m;\nvoid run1() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, x;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n}\nvoid run2() {\n  sort(a, n);\n  sort(b, m);\n}\nvoid run3() {\n  int i;\n  for (i = 1; i <= m; i++)\n    a[i + n] = b[i];\n}\nvoid run4() {\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n + m];\n}\nint main() {\n  run1();\n  run2();\n  run3();\n  run4();\n  return 0;\n}\n"}
{"label": "8", "index": "13570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int s[], int n);\n  int a[100], b[100][100];\n  int n, i = 1, j;\n  char c;\n  do {\n    scanf(\"%d\", &a[i]);\n    i++;\n    scanf(\"%c\", &c);\n  } while (c != '\\n');\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= a[i]; j++)\n      scanf(\"%d\", &b[i][j]);\n  }\n  f(b[1], a[1]);\n  for (i = 2; i <= n; i++) {\n    printf(\" \");\n    f(b[i], a[i]);\n  }\n  return 0;\n}\nvoid f(int s[], int n) {\n  int i, j, t;\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (s[j + 1] < s[j]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    printf(\" %d\", s[i]);\n  }\n}\n"}
{"label": "8", "index": "13571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a1[100], a2[100];\nvoid get(int n1, int n2) {\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\nvoid arrange(int n1, int n2) {\n  int temp;\n  for (int j = 1; j <= n1 - 1; j++) {\n    for (int i = 0; i <= n1 - j - 1; i++) {\n      if (a1[i] > a1[i + 1]) {\n        temp = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = temp;\n      }\n    }\n  }\n  for (int j = 1; j <= n2 - 1; j++) {\n    for (int i = 0; i <= n2 - j - 1; i++) {\n      if (a2[i] > a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n      }\n    }\n  }\n}\nint combine(int n1, int n2) {\n  int out[100];\n  for (int i = 0; i < n1; i++) {\n    out[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    out[n1 + i] = a2[i];\n  }\n  for (int i = 0; i < n1 + n2 - 1; i++) {\n    cout << out[i] << \" \";\n  }\n  printf(\"%d\", out[n1 + n2 - 1]);\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  get(a, b);\n  arrange(a, b);\n  combine(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint x[200], y[200], m, n;\nvoid sca(void) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &y[i]);\n  }\n}\n\nvoid bubble(int a[], int n)\n\n{\n  int i, j, b;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n}\n\nvoid bing(int a[], int l1, int b[], int l2) {\n  int i, j, z[500];\n  for (i = 0; i < l1; i++)\n    z[i] = a[i];\n  for (j = 0; i < (l1 + l2); j++, i++)\n    z[i] = b[j];\n  cout << z[0];\n  for (i = 1; i < (l1 + l2); i++)\n    printf(\" %d\", z[i]);\n}\n\nint main() {\n  sca();\n  bubble(x, m);\n  bubble(y, n);\n  bing(x, m, y, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20], b[20], c[40], m, n, i, j, temp;\nint main() {\n  void putin(int a[20], int b[20]);\n  void exchange(int a[20], int b[20]);\n  void together(int a[20], int b[20]);\n  void putout(int c[40]);\n  putin(a, b);\n  exchange(a, b);\n  together(a, b);\n  putout(c);\n}\nvoid putin(int a[20], int b[20]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid exchange(int a[20], int b[20]) {\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(int a[20], int b[20]) {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid putout(int c[40]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m + n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13574", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n;\nvoid nem(int num1[100], int num2[100]) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &num1[i]);\n  for (i = 0; i < n; i++)\n    cin >> num2[i];\n}\nvoid pai(int num[100], int x) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - 1 - j; i++)\n      if (num[i] > num[i + 1]) {\n        t = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t;\n      }\n}\nvoid he(int num1[100], int num2[100], int num[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    num[i] = num1[i];\n  for (i = m; i < m + n; i++)\n    num[i] = num2[i - m];\n}\nvoid printnum(int num[100]) {\n  int i;\n  printf(\"%d\", num[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", num[i]);\n}\nint main() {\n  int num[100], num1[100], num2[100];\n  nem(num1, num2);\n  pai(num1, m);\n  pai(num2, n);\n  he(num1, num2, num);\n  printnum(num);\n  return 0;\n}\n"}
{"label": "8", "index": "13575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], i, j, n, m;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (b[j] < b[i]) {\n        t = b[j];\n        b[j] = b[i];\n        b[i] = t;\n      }\n}\nvoid add() {\n  for (i = m, j = 0; j < n; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print() {\n  for (i = 0; i < m + n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  read();\n  sort();\n  add();\n  print();\n}\n"}
{"label": "8", "index": "13576", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[100], d[100];\nvoid size() { cin >> a >> b; }\nvoid num(int s, int j[]) {\n  int i;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &j[i]);\n  }\n}\nvoid arrange(int s, int j[]) {\n  int i, k, temp;\n  for (k = 0; k < s - 1; k++) {\n    for (i = 0; i < s - k - 1; i++) {\n      if (j[i + 1] <= j[i]) {\n        temp = j[i];\n        j[i] = j[i + 1];\n        j[i + 1] = temp;\n      }\n    }\n  }\n}\nvoid plus_1(int x, int m[], int y, int n[]) {\n  int i;\n  arrange(x, m);\n  arrange(y, n);\n  printf(\"%d\", m[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", m[i]);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", n[i]);\n  }\n}\nint main() {\n  size();\n  num(a, c);\n  num(b, d);\n  plus_1(a, c, b, d);\n  return 0;\n}\n"}
{"label": "8", "index": "13577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sort(int str[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (str[j] < str[k])\n        k = j;\n    t = str[k];\n    str[k] = str[i];\n    str[i] = t;\n  }\n}\nvoid gather(int str1[], int str2[]) {\n  int t = 0, i;\n  while (str1[t] != '\\0')\n    t++;\n  for (i = t; str2[i - t] != '\\0'; i++)\n    str1[i] = str2[i - t];\n}\n\nint main() {\n  int i, n1, n2, str1[100], str2[100];\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &str1[i]);\n  scanf(\"\\n\");\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &str2[i]);\n  sort(str1, n1);\n  sort(str2, n2);\n  gather(str1, str2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    printf(\"%d \", str1[i]);\n  cout << str1[n1 + n2 - 1];\n}\n"}
{"label": "8", "index": "13578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  int a[1000], b[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &b[i]);\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[2000] = {0}, b[1000] = {0};\n\nvoid read() {\n  int x, y;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    cin >> b[i];\n}\nvoid paixu(int z[]) {\n  int c;\n  for (int i = 0; z[i + 2] != 0; i++)\n    for (int j = 0; z[j + 1] != 0; j++)\n      if (z[j] > z[j + 1]) {\n        c = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = c;\n      }\n}\nvoid addd(int x[], int y[]) {\n  int q = 0;\n  while (x[q] != 0) {\n    q++;\n  }\n  for (int z = 0; y[z] != 0; z++)\n    x[q + z] = y[z];\n}\nvoid shuchu(int x[]) {\n  for (int z = 0; x[z] != 0; z++)\n    if (!z)\n      cout << x[z];\n    else\n      printf(\" %d\", x[z]);\n}\nint main() {\n  read();\n  paixu(a);\n  paixu(b);\n  addd(a, b);\n  shuchu(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13580", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint readin(int n, int *a);\nint px(int n, int *a);\nint sc(int n1, int *a, int n2, int *b);\n\nint t, i, j, a[1000], b[1000];\n\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  readin(n1, a);\n  px(n1, a);\n  readin(n2, b);\n  px(n2, b);\n  sc(n1, a, n2, b);\n  return 0;\n}\nint readin(int n, int *a) {\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n}\nint px(int n, int *a) {\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\nint sc(int n1, int *a, int n2, int *b) {\n  for (int i = 1; i <= n1; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i <= n2 - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[n2];\n}\n"}
{"label": "8", "index": "13581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[50];\nint b[50];\nint c[100];\nint m = 0, n = 0, temp;\nvoid IN();\nvoid OR();\nvoid LIAN();\nvoid OU();\nint main() {\n  IN();\n  OR();\n  LIAN();\n  OU();\n}\n\nvoid IN() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid OR() {\n  int i, j;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid LIAN() {\n  int i;\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n}\n\nvoid OU() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[m + n - 1]);\n}\n"}
{"label": "8", "index": "13582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid duqu() {\n  int i;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid shuchu() {\n  int i, j;\n  cout << a[1];\n  for (i = 2; i <= m; i++)\n    cout << \" \" << a[i];\n  for (j = 1; j <= n; j++)\n    cout << \" \" << b[j];\n  cout << endl;\n}\nint main() {\n  duqu();\n  paixu();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13583", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d; \n  read(c, d);    \n  rank_1(c, d);  \n  print(c, d);   \n}\nvoid read(int n, int m) \n{\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid rank_1(int n, int m) \n{\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid print(int n, int m) \n{\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "13584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint A[200] = {0};\nint B[100] = {0};\nint a, b;\n\nvoid shuzu() {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++) {\n    scanf(\"%d \", &A[i]);\n  }\n  for (int i = 0; i < b; i++) {\n    scanf(\"%d \", &B[i]);\n  }\n}\nvoid paixu() {\n  int p;\n  for (int j = 1; j <= a - 1; j++) {\n    for (int i = 0; i < a - j; i++) {\n      if (A[i] > A[i + 1]) {\n        p = A[i];\n        A[i] = A[i + 1];\n        A[i + 1] = p;\n      }\n    }\n  }\n  for (int j = 1; j <= b - 1; j++) {\n    for (int i = 0; i < b - j; i++) {\n      if (B[i] > B[i + 1]) {\n        p = B[i];\n        B[i] = B[i + 1];\n        B[i + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing() {\n  for (int i = 0; i < b; i++) {\n    A[a + i] = B[i];\n  }\n  for (int i = 0; i < a + b - 1; i++) {\n    cout << A[i] << ' ';\n  }\n  cout << A[a + b - 1];\n}\n\nint main() {\n\n  shuzu();\n  paixu();\n  hebing();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, q, i, num;\n  cin >> p >> q;\n  int a[10], b[10];\n  for (i = 1; i <= p; i++) {\n    cin >> num;\n    a[i] = num;\n  }\n  for (i = 1; i <= q; i++) {\n    cin >> b[i];\n  }\n  int pai(int a[], int x);\n  pai(a, p);\n  pai(b, q);\n  for (i = 1; i <= p; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 1; i <= q - 1; i++)\n    cout << b[i] << \" \";\n\n  cout << b[q];\n  return 0;\n}\nint pai(int a[], int x) {\n  int i, j;\n  int m;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  return a[x];\n}\n"}
{"label": "8", "index": "13586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint N1, N2, N3;\nint *p1 = (int *)malloc(100 * sizeof(int));\nint *p2 = (int *)malloc(100 * sizeof(int));\nint *p3 = (int *)malloc(100 * sizeof(int));\n\nvoid inputnumbers() {\n\n  scanf(\"%d %d\\n\", &N1, &N2);\n  scanf(\"%d\", p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    scanf(\" %d\", p1 + i);\n  }\n  scanf(\"\\n%d\", p2);\n  for (int i = 1; i <= N2 - 1; i++) {\n    scanf(\" %d\", p2 + i);\n  }\n}\n\nvoid seperatesort() {\n  for (int i = 1; i <= N1 - 1; i++) {\n    for (int j = i + 1; j <= N1; j++) {\n      if (*(p1 + i - 1) > *(p1 + j - 1)) {\n        int temp = *(p1 + i - 1);\n        *(p1 + i - 1) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= N2 - 1; i++) {\n    for (int j = i + 1; j <= N2; j++) {\n      if (*(p2 + i - 1) > *(p2 + j - 1)) {\n        int temp = *(p2 + i - 1);\n        *(p2 + i - 1) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  N3 = N1 + N2;\n  for (int i = 0; i <= N1 - 1; i++) {\n    *(p3 + i) = *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++)\n    *(p3 + N1 + i) = *(p2 + i);\n}\n\nvoid printresult2() {\n  printf(\"%d\", *p3);\n  for (int i = 1; i <= N3 - 1; i++) {\n    printf(\" %d\", *(p3 + i));\n  }\n}\nvoid printresult1() {\n  printf(\"%d\", *p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    cout << \" \" << *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    printf(\" %d\", *(p2 + i));\n  }\n}\n\nint main() {\n  inputnumbers();\n  seperatesort();\n  combine();\n  printresult2();\n  return 0;\n}\n"}
{"label": "8", "index": "13587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100], c[200];\nvoid f1() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int k[], int l) {\n  int i, j, t;\n  for (i = 0; i < l - 1; i++)\n    for (j = i; j < l; j++)\n      if (k[i] > k[j]) {\n        t = k[i];\n        k[i] = k[j];\n        k[j] = t;\n      }\n}\n\nvoid f3() {\n  f2(a, m);\n  f2(b, n);\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid f4() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  f1();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "13588", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint m, n;\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid resort() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\nvoid output() {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 1; i <= n; i++)\n    cout << ' ' << b[i];\n}\nint main() {\n  input();\n  resort();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1;\nint n2;\nint i;\nint a[100] = {0};\nint b[100] = {0};\nint c[200] = {0};\nvoid scanfing() {\n  scanf(\"%d %d\", &n1, &n2);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n1; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < n2; i++) {\n    scanf(\" %d\", &b[i]);\n  }\n}\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1 - *(int *)elem2);\n}\nvoid qsorting() {\n  qsort(a, n1, sizeof(int), compare);\n  qsort(b, n2, sizeof(int), compare);\n}\nvoid together() {\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = 0; i < n2; i++) {\n    c[i + n1] = b[i];\n  }\n}\nvoid printfing() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  scanfing();\n  qsorting();\n  together();\n  printfing();\n}\n"}
{"label": "8", "index": "13590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[100] = {0}, b[100] = {0}, c[200] = {0};\nvoid duqu() {\n  int *p;\n  scanf(\"%d %d\", &m, &n);\n  for (p = a; p < a + m; p++)\n    scanf(\"%d\", p);\n  for (p = b; p < b + n; p++)\n    scanf(\"%d\", p);\n}\nvoid range(int a[], int b[], int m, int n) {\n  int *p, *q, d;\n  for (p = a; p < a + m - 1; p++)\n    for (q = p + 1; q < a + m; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n  for (p = b; p < b + n - 1; p++)\n    for (q = p + 1; q < b + n; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int *p, *q;\n  for (p = c, q = a; q < a + m; p++, q++)\n    *p = *q;\n  for (p = c + m, q = b; q < b + n; p++, q++)\n    *p = *q;\n}\nvoid show(int c[], int d) {\n  int *p;\n  for (p = c; p < c + d - 1; p++)\n    cout << *p << \" \";\n  cout << *p;\n}\nint main() {\n  duqu();\n  range(a, b, m, n);\n  merge(a, b, m, n);\n  show(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13591", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstatic int m, n;\nint a[1000], b[1000], c[2000];\nvoid f1(int a[], int b[], int h, int k) {\n  int i;\n  cin >> h >> k;\n  m = h;\n  n = k;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  return;\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j, k;\n  for (j = m - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid f4(int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, c, m, n);\n  f4(c, m, n);\n}\n"}
{"label": "8", "index": "13592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, m, n;\nvoid gets() {\n  int i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> num1[i];\n  for (j = 0; j < n; j++)\n    cin >> num2[j];\n}\nvoid paixu() {\n  int i, j, a = 0, b = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        a = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        a = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = a;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    num1[m + i] = num2[i];\n}\nvoid shuchu() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << num1[i];\n}\nint main() {\n  gets();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, x[100], y[100], z[100];\nint main() {\n  void read();\n  void orde(int c[100], int d[100]);\n  void resm(int e[100], int f[100]);\n  void show(int g[100]);\n  read();\n  orde(x, y);\n  resm(x, y);\n  show(x);\n  return 0;\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid orde(int c[100], int d[100]) {\n  int i, j, q;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j + 1] < c[j]) {\n        q = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = q;\n      }\n    }\n  for (i = 0; i < m; i++)\n    x[i] = c[i];\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (d[j + 1] < d[j]) {\n        q = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    y[i] = d[i];\n}\nvoid resm(int e[100], int f[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    e[i + m] = f[i];\n  for (i = 0; i < 100; i++)\n    x[i] = e[i];\n}\nvoid show(int g[100]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\\n\", x[m + n - 1]);\n}\n"}
{"label": "8", "index": "13594", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nvoid in(int n, int a[]); \nvoid arrange(int n, int a[]);\nvoid connect(int n1, int n2, int a[], int b[], int c[]);\nvoid out(int n, int c[]);\nint main() \n{\n  int n1, n2, a[1000], b[1000], c[2000];\n  cin >> n1 >> n2;\n  in(n1, a); \n  in(n2, b);\n  arrange(n1, a);\n  arrange(n2, b);\n  connect(n1, n2, a, b, c);\n  out(n1 + n2, c);\n  return 0;\n} \nvoid in(int n, int a[]) \n{\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid arrange(int n, int a[]) \n{\n  int temp;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\n\nvoid connect(int n1, int n2, int a[], int b[], int c[]) {\n  int l = 0;\n  for (int i = 0; i < n1; i++, l++)\n    c[l] = a[i];\n  for (int j = 0; j < n2; j++, l++)\n    c[l] = b[j];\n}\nvoid out(int n, int c[]) \n{\n  for (int i = 0; i < n - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n - 1] << endl;\n}\n"}
{"label": "8", "index": "13595", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid read(int *pm, int *pn, int *p1, int *p2) {\n  int i, j;\n  scanf(\"%d %d\", pm, pn);\n  for (i = 0; i < *pm; i++)\n    scanf(\"%d\", p1 + i);\n  for (j = 0; j < *pn; j++)\n    scanf(\"%d\", p2 + j);\n}\n\nvoid sort(int *pm, int *pn, int *p1, int *p2) {\n  int i, j, k, tmp;\n  for (i = 0; i < *pm - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pm; j++)\n      if (*(p1 + j) < *(p1 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p1 + k);\n      *(p1 + k) = *(p1 + i);\n      *(p1 + i) = tmp;\n    }\n  }\n  for (i = 0; i < *pn - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pn; j++)\n      if (*(p2 + j) < *(p2 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p2 + k);\n      *(p2 + k) = *(p2 + i);\n      *(p2 + i) = tmp;\n    }\n  }\n}\n\nint combine(int *pm, int *pn, int *p1, int *p2, int *pnew) {\n  int i, j;\n  for (i = 0; i < *pm; i++)\n    *(pnew + i) = *(p1 + i);\n  for (j = 0; j < *pn; j++)\n    *(pnew + i + j) = *(p2 + j);\n  return i + j;\n}\n\nvoid print(int *pk, int *pnew) {\n  int i;\n  for (i = 0; i < *pk; i++) {\n    printf(\"%d\", *(pnew + i));\n    if (i == *pk - 1)\n      printf(\"\\n\");\n    else\n      printf(\" \");\n  }\n}\n\nint main() {\n  int m = 0, n = 0, k = 0, a[10] = {0}, b[10] = {0};\n  int *pm = &m, *pn = &n, *pa = a, *pb = b;\n  int New[20] = {0}, *pk = &k, *pnew = New;\n\n  read(pm, pn, pa, pb);\n  sort(pm, pn, pa, pb);\n  *pk = combine(pm, pn, pa, pb, pnew);\n  print(pk, pnew);\n}\n"}
{"label": "8", "index": "13596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[100];\nvoid input() {\n  cin >> m >> n;\n  int i, j, k, l;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (j = 1; j <= n; j++)\n    cin >> b[j];\n}\nvoid paixu(int a[100], int b[100]) {\n  int i, j, k, l;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j < m - i + 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid he(int a[100], int b[100]) {\n  int i, j;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (j = i; j <= i + n; j++)\n    c[j] = b[j - i + 1];\n}\nvoid output(int c[100]) {\n  printf(\"%d\", c[1]);\n  int i;\n  for (i = 2; i <= m + n; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  input();\n  paixu(a, b);\n  he(a, b);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "13597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *order(int *p, int k) {\n  int i, j;\n  int t = 0;\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (p[j] > p[j + 1]) {\n        t = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  return p;\n}\nint *merge(int *p, int *q, int m, int n) {\n  int i;\n  int *u = (int *)malloc((m + n) * sizeof(int));\n  for (i = 0; i < m; i++) {\n    u[i] = p[i];\n  }\n  for (i = 0; i < n; i++) {\n    u[m + i] = q[i];\n  }\n  return u;\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  a = order(a, m);\n  b = order(b, n);\n  int *p = merge(a, b, m, n);\n  cout << p[0];\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", p[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, i, a[100], b[100], c[200];\nvoid in() \n{\n  cin >> m >> n;\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n}\nvoid sort() \n{\n  sort(&a[0], &a[0] + m);\n  sort(&b[0], &b[0] + n);\n}\nvoid add() \n{\n  for (i = 0; i < m; ++i)\n    c[i] = a[i];\n  for (i = m; i < m + n; ++i)\n    c[i] = b[i - m];\n}\nvoid out() \n{\n  cout << c[0];\n  for (i = 1; i < m + n; ++i)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  sort();\n  add();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint x[100], y[100], c[200];\nint m, n;\nvoid scanf() {\n  scanf(\"%d %d\", &m, &n);\n  int i;\n  for (i = 0; i < m - 1; i++) {\n    scanf(\"%d \", &x[i]);\n  }\n  scanf(\"%d\\n\", &x[m - 1]);\n\n  for (i = 0; i < n - 1; i++) {\n    cin >> y[i];\n  }\n  scanf(\"%d\\n\", &y[n - 1]);\n}\n\nvoid order() {\n  int j, i, b;\n  for (j = 0; j < m; j++) {\n    for (i = j; i < m; i++)\n      if (x[j] > x[i]) {\n        b = x[j];\n        x[j] = x[i];\n        x[i] = b;\n      }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j; i < n; i++)\n      if (y[j] > y[i]) {\n        b = y[j];\n        y[j] = y[i];\n        y[i] = b;\n      }\n  }\n}\n\nvoid together() {\n  int s;\n\n  for (s = 0; s < m; s++) {\n    c[s] = x[s];\n  }\n\n  for (s = m; s < m + n; s++) {\n    c[s] = y[s - m];\n  }\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    cout << c[i] << \" \";\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  scanf();\n  order();\n  together();\n  print();\n}\n"}
{"label": "8", "index": "13600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint str1[50] = {1}, str2[50] = {1};\nint length1, length2;\nvoid input_string(void) {\n  cin >> length1 >> length2;\n  for (int i = 0; i < length1; i++)\n    cin >> str1[i];\n  for (int i = 0; i < length2; i++)\n    cin >> str2[i];\n}\nvoid rank_string(void) {\n  int temp;\n  for (int i = 0; i < length1 - 1; i++)\n    for (int j = i + 1; j < length1; j++)\n      if (str1[i] > str1[j]) {\n        temp = str1[i];\n        str1[i] = str1[j];\n        str1[j] = temp;\n      }\n  for (int i = 0; i < length2 - 1; i++)\n    for (int j = i + 1; j < length2; j++)\n      if (str2[i] > str2[j]) {\n        temp = str2[i];\n        str2[i] = str2[j];\n        str2[j] = temp;\n      }\n}\nvoid combine_string(void) {\n  for (int i = length1; i < length1 + length2; i++)\n    str1[i] = str2[i - length1];\n}\nvoid output_string(void) {\n  cout << str1[0];\n  for (int i = 1; i < length1 + length2; i++)\n    printf(\" %d\", str1[i]);\n}\nint main() {\n  input_string();\n  rank_string();\n  combine_string();\n  output_string();\n  return 0;\n}\n"}
{"label": "8", "index": "13601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200], m, n;\nvoid getstr() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid rangestr() {\n  void range(int str[100], int length);\n  range(a, m);\n  range(b, n);\n}\n\nvoid range(int str[100], int length) {\n  int i, j, t;\n  for (i = 0; i < length - 1; i++)\n    for (j = 0; j < length - i - 1; j++)\n      if (str[j] > str[j + 1]) {\n        t = str[j + 1];\n        str[j + 1] = str[j];\n        str[j] = t;\n      }\n}\n\nvoid combinestr() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid putstr() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  getstr();\n  rangestr();\n  combinestr();\n  putstr();\n}\n"}
{"label": "8", "index": "13602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[100], b[100];\nvoid scanf() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n}\nvoid merge() {\n  int i;\n  for (i = n + 1; i <= n + m; i++)\n    a[i] = b[i - n];\n}\nvoid print() {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= n + m; i++)\n    cout << ' ' << a[i];\n  cout << endl;\n}\nint main() {\n  scanf();\n  sort();\n  merge();\n  print();\n}\n"}
{"label": "8", "index": "13603", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint x[10000], y[10000], z[100000];\nint m, n, i, j, temp;\nvoid dq() {\n  cin >> m >> n; \n  for (i = 1; i <= m; i++)\n    cin >> x[i];\n  for (i = 1; i <= n; i++)\n    cin >> y[i];\n}\n\nvoid px() {\n  for (i = 1; i <= m - 1; i++) \n    for (j = m; j >= i + 1; j--)\n      if (x[j] <= x[j - 1]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = n; j >= i + 1; j--)\n      if (y[j] <= y[j - 1]) {\n        temp = y[j];\n        y[j] = y[j - 1];\n        y[j - 1] = temp;\n      }\n}\n\nvoid hb() {\n  for (i = 1; i <= m; i++) \n    z[i] = x[i];\n  for (i = 1; i <= n; i++)\n    z[i + m] = y[i];\n}\n\nvoid xs() {\n  for (i = 1; i < m + n; i++) \n    cout << z[i] << ' ';\n  cout << z[m + n];\n  cout << endl;\n}\n\nint main() {\n  dq();     \n  px();     \n  hb();     \n  xs();     \n  return 0; \n}\n"}
{"label": "8", "index": "13604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid f() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid g() {\n  int i, j, k;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n}\nvoid u() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid v() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f();\n  g();\n  u();\n  v();\n}\n"}
{"label": "8", "index": "13605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[100], int l1);\nvoid prin(int a[100], int l1, int b[100], int l2) {\n  int i;\n  char c = '\\0';\n  order(a, l1);\n  order(b, l2);\n  for (i = 0; i < l1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < l2; i++) {\n    if (i < l2 - 1)\n      c = ' ';\n    else\n      c = '\\n';\n    cout << b[i] << c;\n  }\n}\nvoid order(int a[100], int l1) {\n  int i, j, b;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < l1; j++) {\n      if (a[j] < a[i]) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint main() {\n  int l1, l2, i;\n  int a[100], b[100];\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < l2; i++)\n    cin >> b[i];\n  prin(a, l1, b, l2);\n  return 0;\n}\n"}
{"label": "8", "index": "13606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[200], i, m, n;\n  scanf(\"%d\", &m);\n  cin >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  int j, p;\n  for (i = m - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n  int q;\n  for (q = 0; q < m; q++)\n    c[q] = a[q];\n  for (q = m; q < m + n; q++)\n    c[q] = b[q - m];\n  int s;\n  printf(\"%d\", c[0]);\n  for (s = 1; s < m + n; s++)\n    cout << \" \" << c[s];\n}\n"}
{"label": "8", "index": "13607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000];\nvoid inputdata();\nvoid outputdata();\nvoid sortdata();\n\nint main() {\n  inputdata();\n  sortdata();\n  outputdata();\n\n  return 0;\n}\n\nvoid inputdata() {\n  scanf(\"%d %d \", &a[0], &b[0]);\n  for (int i = 1; i <= a[0]; i++)\n    cin >> a[i];\n  for (int i = 1; i <= b[0]; i++)\n    cin >> b[i];\n}\nvoid sortdata() {\n  sort(a + 1, a + a[0] + 1);\n  sort(b + 1, b + b[0] + 1);\n}\nvoid outputdata() {\n  for (int i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i < b[0]; i++)\n    cout << b[i] << ' ';\n  cout << b[b[0]];\n}\n"}
{"label": "8", "index": "13608", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, a[100], b[100], t, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j <= n; j++) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++) {\n    for (j = 2; j <= m; j++) {\n      if (b[j] < b[j - 1]) {\n        t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  static int a[100], b[100];\n  scanf(\"%d %d \", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        a[j] = a[j] + a[i];\n        a[i] = a[j] - a[i];\n        a[j] = a[j] - a[i];\n      }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        b[j] = b[j] + b[i];\n        b[i] = b[j] - b[i];\n        b[j] = b[j] - b[i];\n      }\n  }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "13610", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint i, j, k;\nint q[10000], p[10000];\n\nvoid a() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> q[i];\n  }\n}\nvoid b(int x[], int y[]) {\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n\n      if (x[j] > x[j + 1]) {\n        k = x[j + 1];\n        x[j + 1] = x[j];\n        x[j] = k;\n      }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n\n      if (y[j] > y[j + 1]) {\n        k = y[j + 1];\n        y[j + 1] = y[j];\n        y[j] = k;\n      }\n  }\n  for (i = 0; i < m; i++) {\n    cout << x[i] << ' ';\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", y[i]);\n  }\n  cout << y[n - 1] << endl;\n}\n\nint main() {\n  a();\n  b(p, q);\n  return (0);\n}\n"}
{"label": "8", "index": "13611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; };\n\nint L1, L2;\nint ar1[1000], ar2[1000];\n\nvoid read_array();\nvoid sort_array();\nvoid merge_array();\nvoid show_array();\n\nint main() {\n  read_array();\n  sort_array();\n  merge_array();\n  show_array();\n  return 0;\n}\n\nvoid read_array() {\n  memset(ar1, 0, sizeof(ar1));\n  memset(ar2, 0, sizeof(ar2));\n\n  cin >> L1 >> L2;\n\n  for (int i = 0; i < L1; i++)\n    cin >> ar1[i];\n  for (int i = 0; i < L2; i++)\n    cin >> ar2[i];\n}\n\nvoid sort_array() {\n  qsort(ar1, L1, sizeof(int), cmp);\n  qsort(ar2, L2, sizeof(int), cmp);\n}\n\nvoid merge_array() {\n  for (int i = 0; i < L2; i++)\n    ar1[L1 + i] = ar2[i];\n}\n\nvoid show_array() {\n  for (int i = 0; i < L1 + L2; i++) {\n    cout << ar1[i];\n    if (i != L1 + L2 - 1)\n      cout << ' ';\n  }\n}\n"}
{"label": "8", "index": "13612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint l1, l2;\nint a[2000], b[1000];\nint temp;\nvoid cins(void) {\n  cin >> l1 >> l2;\n  for (int i = 1; i <= l1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= l2; i++) {\n    cin >> b[i];\n  }\n}\nvoid sorts(void) {\n  for (int i = 1; i < l1; i++) {\n    for (int j = 1; j <= l1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i < l2; i++) {\n    for (int j = 1; j <= l2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(void) {\n  for (int i = l1 + 1; i <= l1 + l2; i++) {\n    a[i] = b[i - l1];\n  }\n}\nvoid couts(void) {\n  cout << a[1];\n  for (int i = 2; i <= l1 + l2; i++) {\n    cout << \" \" << a[i];\n  }\n  printf(\"\\n\");\n}\nint main(void) {\n  cins();\n  sorts();\n  together();\n  couts();\n  return 0;\n}\n"}
{"label": "8", "index": "13613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100];\nvoid f() {\n  scanf(\"%d %d\", &m, &n);\n  int i, j;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    cin >> b[j];\n  }\n}\n\nint g(int a[], int l) {\n  int i, j, t;\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  return a[0];\n}\nvoid p(int a[], int b[]) {\n  int i, j;\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j <= n - 2; j++)\n    cout << b[j] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  f();\n  g(a, m);\n  g(b, n);\n  p(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid input(int, int, int *, int *);  \nvoid paixu(int *, int);              \nvoid output(int, int, int *, int *); \n\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;            \n  input(num1, num2, shu1, shu2);  \n  paixu(shu1, num1);              \n  paixu(shu2, num2);              \n  output(num1, num2, shu1, shu2); \n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid input(int m, int n, int shu1[], int shu2[]) \n{\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> shu1[i];\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) \n  {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\n"}
{"label": "8", "index": "13615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nint m, n;\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid resort() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\nvoid output() {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n  for (int i = 1; i <= n; i++)\n    cout << ' ' << b[i];\n}\nint main() {\n  input();\n  resort();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13616", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid mix(int m, int n);\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  mix(m, n);\n  return 0;\n}\nvoid mix(int m, int n) {\n  int i, j, a[10000], b[10000], t;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  cout << b[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "13617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100];\nvoid f() {\n  scanf(\"%d %d\", &m, &n);\n  int i, j;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\n\nint g(int a[], int l) {\n  int i, j, t;\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  return a[0];\n}\nvoid p(int a[], int b[]) {\n  int i, j;\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j <= n - 2; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  f();\n  g(a, m);\n  g(b, n);\n  p(a, b);\n}\n"}
{"label": "8", "index": "13618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  static int a[100], b[100];\n  scanf(\"%d %d \", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        a[j] = a[j] + a[i];\n        a[i] = a[j] - a[i];\n        a[j] = a[j] - a[i];\n      }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        b[j] = b[j] + b[i];\n        b[i] = b[j] - b[i];\n        b[j] = b[j] - b[i];\n      }\n  }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "13619", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(int n1, int n2) {\n  int a[100], b[100], i, j, k, l, m, n, p, q, term = 0;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n2; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < n1; k++) {\n    for (m = k + 1; m < n1; m++) {\n      if (a[m] < a[k]) {\n        term = a[k];\n        a[k] = a[m];\n        a[m] = term;\n      }\n    }\n  }\n  for (n = 0; n < n2; n++) {\n    for (l = n + 1; l < n2; l++) {\n      if (b[l] < b[n]) {\n        term = b[n];\n        b[n] = b[l];\n        b[l] = term;\n      }\n    }\n  }\n  for (p = 0; p < n1; p++) {\n    printf(\"%d \", a[p]);\n  }\n  for (q = 0; q < n2 - 1; q++) {\n    printf(\"%d \", b[q]);\n  }\n  printf(\"%d\", b[n2 - 1]);\n}\nint main() {\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  f(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13620", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid duqu(int a[], int b[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++)\n    cin >> b[i];\n}\nvoid paixu(int a[], int b[], int M, int N) {\n  int i = 0, j = 0, temp;\n  for (i = 0; i < M; i++)\n    for (j = i; j < M; j++) {\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (i = 0; i < N; i++)\n    for (j = i; j < N; j++) {\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n    }\n}\n\nvoid hebing(int a[], int b[], int c[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = M; i < M + N; i++)\n    c[i] = b[i - M];\n}\nvoid shuchu(int C[], int M, int N) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", C[i]);\n  printf(\"%d\", C[M + N - 1]);\n}\n\nint main() {\n  int m, n;\n  int a1[100], a2[100], a3[100] = {0};\n  cin >> m >> n;\n  duqu(a1, a2, m, n);\n  paixu(a1, a2, m, n);\n  hebing(a1, a2, a3, m, n);\n  shuchu(a3, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13621", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint la, lb;\n\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d\", &la, &lb);\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[]) {\n  int i;\n  int t;\n  for (i = 0; i < la - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n  for (i = 0; i < lb - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n}\n\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i < (la + lb); i++) {\n    if (i != (la + lb - 1))\n      printf(\"%d \", a[i]);\n    else\n      printf(\"%d\", a[i]);\n  }\n}\n\nint main() {\n  int x[200], y[100];\n  read(x, y);\n  \n  sort(x, y);\n  \n  combine(x, y);\n  print(x);\n  return 0;\n}\n"}
{"label": "8", "index": "13622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], m, n;\nint main() {\n  void Read(), Ord(), Gath(), Prin();\n  Read();\n  Ord();\n  Gath();\n  Prin();\n}\n\nvoid Read() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Ord() {\n  int i, j;\n  void swap_a(int i, int j), swap_b(int i, int j);\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (a[i] > a[j])\n        swap_a(i, j);\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (b[i] > b[j])\n        swap_b(i, j);\n}\n\nvoid Gath() {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\n\nvoid Prin() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= m + n; i++)\n    printf(\" %d\", a[i]);\n}\n\nvoid swap_a(int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\n\nvoid swap_b(int i, int j) {\n  int temp;\n  temp = b[i];\n  b[i] = b[j];\n  b[j] = temp;\n}\n"}
{"label": "8", "index": "13623", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, a[1000], b, k = 0, tmp, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n + m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n + 1; i++)\n    for (j = 1; j <= n - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= m + 1; i++)\n    for (j = n + 1; j <= n + m - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "8", "index": "13624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000], b[10000];\nint A, B;\nvoid read() {\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    cin >> a[i];\n  for (i = 0; i < B; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j, temp;\n  for (i = 0; i < A - 1; i++)\n    for (j = i + 1; j < A; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < B - 1; i++)\n    for (j = i + 1; j < B; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n}\nvoid conbine() {\n  int i;\n  for (i = 0; i < A; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < B - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[B - 1];\n}\n\nint main() {\n  read();\n  sort();\n  conbine();\n  return 0;\n}\n"}
{"label": "8", "index": "13625", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint *p, *q, *s;\nint m, n;\n\nint pfCompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    cin >> q[i];\n}\n\nint downsort() {\n  qsort(p, m, sizeof(int), pfCompare);\n  qsort(q, n, sizeof(int), pfCompare);\n}\n\nint combine() {\n  s = (int *)malloc((m + n) * sizeof(int));\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = p[i];\n  for (i = m; i < m + n; i++)\n    s[i] = q[i - m];\n}\n\nint output() {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", s[i]);\n  free(p);\n  free(q);\n  free(s);\n}\n\nint main() {\n  input();\n  downsort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid changeplace(int n, int a[]) {\n  int i, j, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] >= a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nint main() {\n  int n1, n2, k;\n  scanf(\"%d%d\", &n1, &n2);\n  int *p = (int *)malloc(n1 * sizeof(int));\n  int *q = (int *)malloc(n2 * sizeof(int));\n  for (k = 0; k < n1; k++)\n    scanf(\"%d\", &p[k]);\n  for (k = 0; k < n2; k++)\n    scanf(\"%d\", &q[k]);\n  changeplace(n1, p);\n  changeplace(n2, q);\n  for (k = 0; k < n1; k++)\n    printf(\"%d \", p[k]);\n  for (k = 0; k < n2 - 1; k++)\n    cout << q[k] << \" \";\n  printf(\"%d\", q[n2 - 1]);\n}\n"}
{"label": "8", "index": "13627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int *p, int *q, int *n, int *m) {\n  int *x;\n  scanf(\"%d %d\", n, m);\n  x = p + *n;\n  for (; p < x; p++)\n    scanf(\"%d\", p);\n  x = q + *m;\n  for (; q < x; q++)\n    scanf(\"%d\", q);\n}\n\nvoid sort(int *p, int n) {\n  int x, i, j, k;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      x = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = x;\n    }\n  }\n}\n\nvoid copy(int *p, int *q, int x[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++, p++)\n    x[i] = *p;\n  for (; i < n + m; i++, q++)\n    x[i] = *q;\n}\n\nvoid output(int *p, int n) {\n  int *y;\n  y = p + n - 1;\n  cout << *p;\n  p++;\n  for (; p <= y; p++)\n    printf(\" %d\", *p);\n}\n\nint main() {\n  int i, a[100], b[100], c[200], x, y, *n, *m;\n  n = &x;\n  m = &y;\n  input(a, b, n, m);\n  sort(a, x);\n  sort(b, y);\n  copy(a, b, c, x, y);\n  output(c, x + y);\n}\n"}
{"label": "8", "index": "13628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint getin(int array[], int num);\nint sort(int array[], int num);\nint link(int array1[], int array2[], int num1, int num2);\nint main() {\n  int numa, numb, a[1000], b[1000];\n  scanf(\"%d %d \", &numa, &numb);\n  getin(a, numa);\n  getin(b, numb);\n  sort(a, numa);\n  sort(b, numb);\n  link(a, b, numa, numb);\n  return 0;\n}\nint getin(int array[], int num) {\n  for (int i = 0; i < num; i++) {\n    cin >> array[i];\n  }\n  return (array[num]);\n}\nint sort(int array[], int num) {\n  int temp;\n  for (int i = 0; i < num - 1; i++) {\n    for (int j = 0; j < num - i - 1; j++) {\n      if (array[j] > array[j + 1]) {\n        temp = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = temp;\n      }\n    }\n  }\n  return array[num];\n}\nint link(int array1[], int array2[], int num1, int num2) {\n  cout << array1[0];\n  for (int i = 1; i < num1; i++)\n    cout << \" \" << array1[i];\n  for (int i = 0; i < num2; i++)\n    cout << \" \" << array2[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int *, int *);\nint main() {\n  int a[100000], b[100000];\n  read(a, b);\n  return 0;\n}\nvoid read(int *a, int *b) {\n  int i, n1, n2;\n  void bubble(int *, const int);\n  void print1(int *, int n);\n  void print2(int *, int n);\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i <= n1 - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n2 - 1; i++)\n    scanf(\"%d\", &b[i]);\n  bubble(a, n1);\n  bubble(b, n2);\n  print1(a, n1);\n  print2(b, n2);\n}\nvoid bubble(int *a, const int n) {\n  int pass, i;\n  void swap(int *, int *);\n  for (pass = 1; pass <= n - 1; pass++)\n    for (i = 0; i <= n - 2; i++)\n      if (a[i] >= a[i + 1])\n        swap(&a[i], &a[i + 1]);\n}\nvoid swap(int *a, int *b) {\n  int hold;\n  hold = *a;\n  *a = *b;\n  *b = hold;\n}\nvoid print1(int *a, int n) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d\", a[i]);\n    printf(\" \");\n  }\n}\nvoid print2(int *a, int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d\", a[i]);\n    printf(\" \");\n  }\n  printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "13630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid programme() {\n  int n1, n2, i, j, temp;\n  int a[101], b[101];\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = 0; j < n2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2; i++) {\n    if (i != n2 - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n  return;\n}\n\nint main() {\n  programme();\n  return 0;\n}\n"}
{"label": "8", "index": "13631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[2][11] = {0};\nint geshu1, geshu2;\nint hanshu1() {\n  int i;\n  cin >> geshu1 >> geshu2;\n  for (i = 0; i < geshu1; i++)\n    cin >> a[0][i];\n  for (i = 0; i < geshu2; i++)\n    scanf(\"%d \", &a[1][i]);\n  return 0;\n}\nint hanshu2() {\n  int i, j, k;\n  for (i = geshu1 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[0][j] > a[0][j + 1]) {\n        k = a[0][j];\n        a[0][j] = a[0][j + 1];\n        a[0][j + 1] = k;\n      }\n    }\n  }\n  for (i = geshu2 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[1][j] > a[1][j + 1]) {\n        k = a[1][j];\n        a[1][j] = a[1][j + 1];\n        a[1][j + 1] = k;\n      }\n    }\n  }\n  return 0;\n}\nint hanshu3() {\n  int i;\n  for (i = 0; i < geshu2; i++)\n    a[0][geshu1 + i] = a[1][i];\n  return 0;\n}\nint hanshu4() {\n  int i;\n  cout << a[0][0];\n  for (i = 1; i < geshu1 + geshu2; i++)\n    cout << \" \" << a[0][i];\n  return 0;\n}\nint main() {\n  hanshu1();\n  hanshu2();\n  hanshu3();\n  hanshu4();\n  return 0;\n}\n"}
{"label": "8", "index": "13632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j, k, a[100], b[100];\nint read() {\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  return 0;\n}\nint sorta() {\n  int min, t;\n  for (i = 1; i <= n - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[min] > a[j])\n        min = j;\n    t = a[i];\n    a[i] = a[min];\n    a[min] = t;\n  }\n  return 0;\n}\nint sortb() {\n  int min, t;\n  for (i = 1; i <= m - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= m; j++)\n      if (b[min] > b[j])\n        min = j;\n    t = b[i];\n    b[i] = b[min];\n    b[min] = t;\n  }\n  return 0;\n}\nint write() {\n  for (i = 1; i <= n; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i < m; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\\n\", b[m]);\n  return 0;\n}\nint main() {\n  k = read();\n  k = sorta();\n  k = sortb();\n  k = write();\n  return 0;\n}\n"}
{"label": "8", "index": "13633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint n_a, n_b;\nvoid input();\nvoid sort();\nvoid output();\nint main() {\n  input();\n  sort();\n  output();\n  return 0;\n}\nvoid input() {\n  int i;\n  cin >> n_a >> n_b;\n  for (i = 0; i < n_a; i++)\n    cin >> a[i];\n  for (i = 0; i < n_b; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n_a - 1; i++) {\n    for (j = i + 1; j < n_a; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n_b - 1; i++) {\n    for (j = i + 1; j < n_b; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n_a; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n_b; i++) {\n    cout << b[i];\n    if (i < n_b - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0;\n\nvoid Get_In(int a[10000], int b[10000]) {\n  int i = 0, j = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &b[j]);\n}\n\nvoid Ranking(int a[10000], int l) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < (l - 1); i++) {\n    for (j = (i + 1); j < l; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid Combine(int a[10000], int b[10000]) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid Turn_Out(int a[10000]) {\n  int i = 0;\n  for (i = 0; i < (m + n); i++) {\n    if (i < (m + n - 1))\n      cout << a[i] << \" \";\n    else if (i == (m + n - 1))\n      cout << a[i] << endl;\n  }\n}\n\nint main() {\n  int a[10000], b[10000];\n  cin >> m >> n;\n  Get_In(a, b);\n  Ranking(a, m);\n  Ranking(b, n);\n  Combine(a, b);\n  Turn_Out(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[1000], b[1000], c[2000];\nvoid f1(void) {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid f2(void) {\n  int i, j, p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(void) {\n  int i, count = 0;\n  for (i = 0; i < n + m; i++) {\n    if (count == 0) {\n      printf(\"%d\", c[i]);\n      count++;\n    } else\n      printf(\" %d\", c[i]);\n  }\n  cout << \"\\n\";\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "13636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(int s[], int x) {\n  int i;\n  for (i = 1; i <= x; i++)\n    scanf(\"%d\", &s[i]);\n}\nvoid b(int s[], int x) {\n  int i, j;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (s[j] > s[j + 1]) {\n        s[0] = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = s[0];\n      }\n    }\n  }\n}\nvoid c(int p[], int x, int q[], int y) {\n  int i;\n  for (i = 1; i <= y; i++)\n    p[x + i] = q[i];\n}\nvoid d(int s[], int x) {\n  int i;\n  for (i = 1; i <= x - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\\n\", s[x]);\n}\nint main() {\n  int p[60], q[30], m, n;\n  scanf(\"%d%d\", &m, &n);\n  a(p, m);\n  a(q, n);\n  b(p, m);\n  b(q, n);\n  c(p, m, q, n);\n  d(p, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, c[50], d[50];\nvoid shuzu() {\n  int i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &d[j]);\n}\n\nvoid paixu(int a[50], int b[50]) {\n  int i, j, s, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        s = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = s;\n      }\n}\n\nvoid hebing(int a[50], int b[50]) {\n\n  int i, j;\n  int e[100];\n  for (i = 0; i < m; i++)\n    e[i] = a[i];\n  for (j = 0; j < n; j++)\n    e[m + j] = b[j];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[m + n - 1]);\n}\n\nint main() {\n  shuzu();\n  paixu(c, d);\n  hebing(c, d);\n  return 0;\n}\n"}
{"label": "8", "index": "13638", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid duqu(int a[], int b[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++)\n    cin >> b[i];\n}\nvoid paixu(int a[], int b[], int M, int N) {\n  int i = 0, j = 0, temp;\n  for (i = 0; i < M; i++)\n    for (j = i; j < M; j++) {\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (i = 0; i < N; i++)\n    for (j = i; j < N; j++) {\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n    }\n}\n\nvoid hebing(int a[], int b[], int c[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = M; i < M + N; i++)\n    c[i] = b[i - M];\n}\nvoid shuchu(int C[], int M, int N) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", C[i]);\n  printf(\"%d\", C[M + N - 1]);\n}\n\nint main() {\n  int m, n;\n  int a1[100], a2[100], a3[100] = {0};\n  scanf(\"%d %d \", &m, &n);\n  duqu(a1, a2, m, n);\n  paixu(a1, a2, m, n);\n  hebing(a1, a2, a3, m, n);\n  shuchu(a3, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m[2], i, j, k, a[2][100], p;\n  cin >> m[0] >> m[1];\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      scanf(\"%d\", &a[k][i]);\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      for (j = 0; j < m[k] - i - 1; j++) {\n        if (a[k][j] > a[k][j + 1]) {\n          p = a[k][j];\n          a[k][j] = a[k][j + 1];\n          a[k][j + 1] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      if (!(k == 0 && i == 0)) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[k][i]);\n    }\n  }\n}\n"}
{"label": "8", "index": "13640", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[1000];\nint b[1000];\n\nvoid input() {\n  int i;\n\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  return;\n}\n\nvoid paixu() {\n  int i, j;\n  int p;\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n\n  return;\n}\n\nvoid output() {\n  int i;\n\n  cout << a[0];\n\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    cout << \" \" << b[i];\n\n  return;\n}\n\nint main() {\n  input();\n  paixu();\n  output();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; };\n\nint L1, L2;\nint ar1[1000], ar2[1000];\n\nvoid read_array();\nvoid sort_array();\nvoid merge_array();\nvoid show_array();\n\nint main() {\n  read_array();\n  sort_array();\n  merge_array();\n  show_array();\n  return 0;\n}\n\nvoid read_array() {\n  memset(ar1, 0, sizeof(ar1));\n  memset(ar2, 0, sizeof(ar2));\n\n  cin >> L1 >> L2;\n\n  for (int i = 0; i < L1; i++)\n    cin >> ar1[i];\n  for (int i = 0; i < L2; i++)\n    cin >> ar2[i];\n}\n\nvoid sort_array() {\n  qsort(ar1, L1, sizeof(int), cmp);\n  qsort(ar2, L2, sizeof(int), cmp);\n}\n\nvoid merge_array() {\n  for (int i = 0; i < L2; i++)\n    ar1[L1 + i] = ar2[i];\n}\n\nvoid show_array() {\n  for (int i = 0; i < L1 + L2; i++) {\n    cout << ar1[i];\n    if (i != L1 + L2 - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "13642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, a, b;\n\nvoid shuru() {\n  int i;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < a; i++)\n    cin >> num1[i];\n  for (i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sequence() {\n  int i, j, temp;\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < a; j++)\n      if (num1[i] > num1[j]) {\n        temp = num1[i];\n        num1[i] = num1[j];\n        num1[j] = temp;\n      }\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < b; j++)\n      if (num2[i] > num2[j]) {\n        temp = num2[i];\n        num2[i] = num2[j];\n        num2[j] = temp;\n      }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a; i++)\n    cout << num1[i] << ' ';\n  for (i = 0; i < b - 1; i++)\n    cout << num2[i] << ' ';\n  cout << num2[b - 1] << endl;\n}\n\nint main() {\n  shuru();\n  sequence();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid scan(int x[], int *nx, int y[], int *ny) {\n  int i;\n  scanf(\"%d %d\", nx, ny);\n  for (i = 0; i < *nx; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < *ny; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid sort(int x[], int num) {\n  int i, j;\n  for (i = num - 1; i >= 1; i--)\n    for (j = 1; j <= i; j++)\n      if (x[j - 1] > x[j]) {\n        int temp = x[j - 1];\n        x[j - 1] = x[j];\n        x[j] = temp;\n      }\n}\nvoid exp(int a[], int b[], int na, int nb) {\n  int i;\n  for (i = na; i < na + nb; i++)\n    a[i] = b[i - na];\n}\nvoid print(int a[], int na, int nb) {\n  printf(\"%d\", a[0]);\n  int i;\n  for (i = 1; i < na + nb; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  int a[100], na, b[100], nb;\n  scan(a, &na, b, &nb);\n  sort(a, na);\n  sort(b, nb);\n  exp(a, b, na, nb);\n  print(a, na, nb);\n}\n"}
{"label": "8", "index": "13644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid add(int array1[], int array2[], int x, int y) {\n  int array[100];\n  int i, j;\n  for (i = 0; i < x; i++)\n    array[i] = array1[i];\n  for (i = x, j = 0; j < y; i++, j++)\n    array[i] = array2[j];\n  printf(\"%d\", array[0]);\n  for (i = 1; i < x + y; i++)\n    printf(\" %d\", array[i]);\n}\n\nint main() {\n  int i, x, y, xarray[50], yarray[50];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &xarray[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &yarray[i]);\n  sort(xarray, x);\n  sort(yarray, y);\n  add(xarray, yarray, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read();\n  read();\n}\nvoid read() {\n  int a, b;\n  void shu(int x, int y);\n  scanf(\"%d%d\", &a, &b);\n  shu(a, b);\n}\nvoid shu(int x, int y) {\n  int a[100], b[100], i;\n  void pai(int a[], int x, int b[], int y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pai(a, x, b, y);\n}\nvoid pai(int a[], int x, int b[], int y) {\n  int i, k, m;\n  void pr(int a[], int x, int b[], int y);\n  for (i = 0; i < x - 1; i++) {\n    for (k = 0; k < x - 1 - i; k++) {\n      if (a[k] > a[k + 1]) {\n        m = a[k + 1];\n        a[k + 1] = a[k];\n        a[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (k = 0; k < y - 1 - i; k++) {\n      if (b[k] > b[k + 1]) {\n        m = b[k + 1];\n        b[k + 1] = b[k];\n        b[k] = m;\n      }\n    }\n  }\n  pr(a, x, b, y);\n}\nvoid pr(int a[], int x, int b[], int y) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "13646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int x, int z[20]) {\n  int i, j, middle;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1; j++) {\n      if (z[j] > z[j + 1]) {\n        middle = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change(m, a);\n  change(n, b);\n  prin();\n}\n"}
{"label": "8", "index": "13647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0, a[20] = {0}, b[20] = {0}, c[40] = {0};\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n}\n\nvoid sort() {\n  for (int j = 1; j < m; j++)\n    for (int i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        int p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n  for (int j = 1; j < n; j++)\n    for (int i = 1; i <= n - j; i++)\n      if (b[i] > b[i + 1]) {\n        int p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n}\n\nvoid combine() {\n  for (int i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (int j = 1; j <= n; j++)\n    c[m + j] = b[j];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\\n\", c[m + n]);\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int x[], int y[], int a, int b);\n  void change(int x[], int y[], int a, int b);\n  void combine(int x[], int y[], int a, int b);\n  int x[10], y[10], a, b;\n  scanf(\"%d %d\", &a, &b);\n  read(x, y, a, b);\n  change(x, y, a, b);\n  combine(x, y, a, b);\n}\nvoid read(int x[], int y[], int a, int b) {\n  int i;\n  char c;\n  for (i = 1; i <= a; i++)\n    scanf(\"%d%c\", &x[i], &c);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d%c\", &y[i], &c);\n}\nvoid change(int x[], int y[], int a, int b) {\n  int i, j, t;\n  for (i = 1; i <= a; i++)\n    for (j = 1; j < a + 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= b; i++)\n    for (j = 1; j < b + 1 - i; j++) {\n      if (y[j] > y[j + 1]) {\n        t = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = t;\n      }\n    }\n}\nvoid combine(int x[], int y[], int a, int b) {\n  int i;\n  printf(\"%d\", x[1]);\n  for (i = 2; i <= a; i++)\n    printf(\" %d\", x[i]);\n  for (i = 1; i <= b; i++) {\n    printf(\" %d\", y[i]);\n  }\n}\n"}
{"label": "8", "index": "13649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint input(int[], int);\nint sort(int[], int);\nvoid combine(int[], int[], int, int);\nvoid output(int[], int, int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  int a[100], b[100];\n  input(a, n1);\n  input(b, n2);\n  sort(a, n1);\n  sort(b, n2);\n  combine(a, b, n1, n2);\n  return 0;\n}\nint input(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  return a[i];\n}\nint sort(int a[], int n) {\n  int i, j, p;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  return a[j];\n}\nvoid combine(int a[], int b[], int n1, int n2) {\n  int c[200];\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n2 + n1; i++)\n    c[i] = b[i - n1];\n  output(c, n1, n2);\n}\nvoid output(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[n1 + n2 - 1] << endl;\n}\n"}
{"label": "8", "index": "13650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[50];\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d\", &a[0], &b[0]);\n  for (i = 1; i <= a[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= b[0]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int c, int x[]) {\n  int i, j, k, l;\n  for (i = 1; i <= c; i++) {\n    k = x[i];\n    l = i;\n    for (j = i + 1; j <= c; j++) {\n      if (x[j] < k) {\n        k = x[j];\n        l = j;\n      }\n    }\n    j = x[i];\n    x[i] = k;\n    x[l] = j;\n  }\n}\nvoid one(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[m + i + 1] = b[i + 1];\n  }\n}\nvoid out(int m, int n, int x[]) {\n  int i;\n  for (i = 1; i < m + n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n]);\n}\nint main() {\n  read(a, b);\n  change(a[0], a);\n  change(b[0], b);\n  one(a[0], b[0], a, b);\n  out(a[0], b[0], a);\n  return 0;\n}\n"}
{"label": "8", "index": "13651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bijiao(const void *x, const void *y) { return *(int *)x - *(int *)y; }\nint main() {\n  int n, m, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, n, sizeof(a[0]), bijiao);\n  qsort(b, m, sizeof(b[0]), bijiao);\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n}\n"}
{"label": "8", "index": "13652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int mmax = 1000;\nint a[mmax];\nint b[mmax];\nint m, n;\nvoid mread();\nvoid msort();\nvoid mcomb();\nvoid mdisp();\nint main() {\n  mread();\n  msort();\n  mcomb();\n  mdisp();\n  return 0;\n}\nvoid mread() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid msort() {\n  int t;\n  for (int i = 0; i < m; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid mcomb() {\n  for (int i = 0; i < n; i++)\n    a[i + m] = b[i];\n}\nvoid mdisp() {\n  for (int i = 0; i < m + n; i++) {\n    if (i != 0)\n      cout << ' ';\n    cout << a[i];\n  }\n}\n"}
{"label": "8", "index": "13653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100], c[200];\nvoid in() {\n  cin >> n >> m;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid pai(int *p, int k) {\n  int i, j, temp;\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid out() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  pai(a, n);\n  pai(b, m);\n  he();\n  out();\n}\n"}
{"label": "8", "index": "13654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, i;\nint a[100];\nint b[100];\nvoid passed(int x, int y) {\n  int j, t;\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  passed(n, m);\n}\n"}
{"label": "8", "index": "13655", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint num1, num2;\nvoid getin() {\n  int i, j;\n  cin >> num1 >> num2;\n  for (i = 1; i <= num1; i++)\n    cin >> a[i];\n  for (j = 1; j <= num2; j++)\n    cin >> b[j];\n}\nvoid order(int aa[], int num) {\n  int t, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j < num; j++)\n      if (aa[j] > aa[j + 1]) {\n        t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n}\nvoid print(int a[], int b[], int num1, int num2) {\n  cout << a[1];\n  int i;\n  for (i = 2; i <= num1; i++)\n    printf(\" %d\", a[i]);\n  for (i = 1; i <= num2; i++)\n    cout << \" \" << b[i];\n  cout << endl;\n}\n\nint main() {\n\n  getin();\n  order(a, num1);\n  order(b, num2);\n  print(a, b, num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "13656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a;\nint str1[10000], str2[10000];\nvoid dosomething(int str[10000], int q);\n\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &str1[i]);\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", &str2[i]);\n  dosomething(str1, n);\n  dosomething(str2, m);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", str1[i]);\n  for (int i = 0; i < m; i++)\n    i == 0 ? printf(\"%d\", str2[i]) : printf(\" %d\", str2[i]);\n  return 0;\n}\n\nvoid dosomething(int str[10000], int q) {\n  for (int i = 0; i < q - 1; i++)\n    for (int j = i + 1; j < q; j++) {\n      if (str[i] > str[j])\n        a = str[i], str[i] = str[j], str[j] = a;\n    }\n}\n"}
{"label": "8", "index": "13657", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[300], b[300], m, n, i, j, t, c[300]; \nvoid f1() {                                \n  cin >> m >> n;                           \n  for (i = 0; i < m; i++) {                \n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) { \n    cin >> b[i];\n  }\n}\nvoid f2() {                     \n  for (i = 0; i < m - 1; i++) { \n    for (j = i + 1; j <= m - 1; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) { \n    for (j = i + 1; j <= n - 1; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid f3() {                 \n  for (i = 0; i < m; i++) { \n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) { \n    c[i] = b[i - m];\n  }\n}\nvoid f4() { \n  cout << c[0];\n  for (i = 1; i < m + n; i++) {\n    cout << ' ' << c[i];\n  }\n}\nint main() {\n  f1(); \n  f2(); \n  f3(); \n  f4(); \n}\n"}
{"label": "8", "index": "13658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[101], b[101], m, n;\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n  return (0);\n}\nint pai() {\n  int i, j, p;\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n    }\n  }\n  return (0);\n}\nint print() {\n  int i;\n  for (i = 1; i <= m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 1; i < n; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n]);\n  return (0);\n}\nint main() {\n  input();\n  pai();\n  print();\n}\n"}
{"label": "8", "index": "13659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f1(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int n, int a[]) {\n  int i, j, k;\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[j];\n        a[j] = a[i];\n        a[i] = k;\n      }\n    }\n}\nvoid f3(int n, int m, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(int n, int m, int c[]) {\n  printf(\"%d\", c[0]);\n  int i;\n  for (i = 1; i < n + m; i++) {\n    cout << \" \" << c[i];\n  }\n}\nint main() {\n  int i, n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  f1(n, a);\n  f1(m, b);\n  f2(n, a);\n  f2(m, b);\n  f3(n, m, a, b, c);\n  f4(n, m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "13660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B, a[300], b[300], c[600];\nvoid w() {\n  int i;\n  scanf(\"%d%d\", &A, &B);\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid x() {\n  int i, j, t;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid y() {\n  int i;\n  for (i = 0; i < A + B; i++)\n    if (i < A)\n      c[i] = a[i];\n    else\n      c[i] = b[i - A];\n}\nvoid z() {\n  int i;\n  for (i = 0; i < A + B - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[A + B - 1]);\n}\nint main() {\n  w();\n  x();\n  y();\n  z();\n}\n"}
{"label": "8", "index": "13661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; };\n\nint L1, L2;\nint ar1[1000], ar2[1000];\n\nvoid read_array();\nvoid sort_array();\nvoid merge_array();\nvoid show_array();\n\nint main() {\n  read_array();\n  sort_array();\n  merge_array();\n  show_array();\n  return 0;\n}\n\nvoid read_array() {\n  memset(ar1, 0, sizeof(ar1));\n  memset(ar2, 0, sizeof(ar2));\n\n  scanf(\"%d %d \", &L1, &L2);\n\n  for (int i = 0; i < L1; i++)\n    cin >> ar1[i];\n  for (int i = 0; i < L2; i++)\n    cin >> ar2[i];\n}\n\nvoid sort_array() {\n  qsort(ar1, L1, sizeof(int), cmp);\n  qsort(ar2, L2, sizeof(int), cmp);\n}\n\nvoid merge_array() {\n  for (int i = 0; i < L2; i++)\n    ar1[L1 + i] = ar2[i];\n}\n\nvoid show_array() {\n  for (int i = 0; i < L1 + L2; i++) {\n    cout << ar1[i];\n    if (i != L1 + L2 - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "13662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint pai1(int x[1000], int y);\nint pai2(int x[1000], int y);\nint main() {\n  int n, m, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  pai1(a, n);\n  pai2(b, m);\n  return 0;\n}\n\nint pai1(int x[], int y) {\n  int i, j, min, stmp, flag = 0;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++) {\n    if (flag == 0) {\n      printf(\"%d\", x[i]);\n      flag = 1;\n      continue;\n    }\n    if (flag == 1) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  return 0;\n}\nint pai2(int x[], int y) {\n  int i, j, min, stmp;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", x[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int n1, n2, a[100] = {0}, b[100] = {0}, d[200] = {0};\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid pai() {\n  int c, i, j;\n  for (j = 0; j < n1; j++) {\n    for (i = 0; i < n1 - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n    }\n  }\n  for (j = 0; j < n2; j++) {\n    for (i = 0; i < n2 - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n    }\n  }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    d[i] = b[i - n1];\n  }\n}\nvoid shu() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++) {\n    printf(\"%d \", d[i]);\n  }\n  printf(\"%d\", d[n1 + n2 - 1]);\n}\nint main() {\n  f1();\n  pai();\n  he();\n  shu();\n}\n"}
{"label": "8", "index": "13664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[2][11] = {0};\nint geshu1, geshu2;\nint hanshu1() {\n  int i;\n  cin >> geshu1 >> geshu2;\n  for (i = 0; i < geshu1; i++)\n    cin >> a[0][i];\n  for (i = 0; i < geshu2; i++)\n    scanf(\"%d \", &a[1][i]);\n  return 0;\n}\nint hanshu2() {\n  int i, j, k;\n  for (i = geshu1 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[0][j] > a[0][j + 1]) {\n        k = a[0][j];\n        a[0][j] = a[0][j + 1];\n        a[0][j + 1] = k;\n      }\n    }\n  }\n  for (i = geshu2 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[1][j] > a[1][j + 1]) {\n        k = a[1][j];\n        a[1][j] = a[1][j + 1];\n        a[1][j + 1] = k;\n      }\n    }\n  }\n  return 0;\n}\nint hanshu3() {\n  int i;\n  for (i = 0; i < geshu2; i++) {\n    a[0][geshu1 + i] = a[1][i];\n  }\n  return 0;\n}\nint hanshu4() {\n  int i;\n  printf(\"%d\", a[0][0]);\n  for (i = 1; i < geshu1 + geshu2; i++)\n    cout << \" \" << a[0][i];\n  return 0;\n}\nint main() {\n  hanshu1();\n  hanshu2();\n  hanshu3();\n  hanshu4();\n  return 0;\n}\n"}
{"label": "8", "index": "13665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int temp, i, j;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int x, y, i;\n  int b[100], c[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  turn(b, x);\n  cout << \" \";\n  turn(c, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int *, int *);\nint main() {\n  int a[100000], b[100000];\n  read(a, b);\n}\nvoid read(int *a, int *b) {\n  int i, n1, n2;\n  void bubble(int *, const int);\n  void print1(int *, int n);\n  void print2(int *, int n);\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i <= n1 - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n2 - 1; i++)\n    scanf(\"%d\", &b[i]);\n  bubble(a, n1);\n  bubble(b, n2);\n  print1(a, n1);\n  print2(b, n2);\n}\nvoid bubble(int *a, const int n) {\n  int pass, i;\n  void swap(int *, int *);\n  for (pass = 1; pass <= n - 1; pass++)\n    for (i = 0; i <= n - 2; i++)\n      if (a[i] >= a[i + 1])\n        swap(&a[i], &a[i + 1]);\n}\nvoid swap(int *a, int *b) {\n  int hold;\n  hold = *a;\n  *a = *b;\n  *b = hold;\n}\nvoid print1(int *a, int n) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%d\", a[i]);\n    printf(\" \");\n  }\n}\nvoid print2(int *a, int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d\", a[i]);\n    printf(\" \");\n  }\n  printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "13667", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint m, n;\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid resort() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\nvoid output() {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 1; i <= n; i++)\n    cout << ' ' << b[i];\n}\nint main() {\n  input();\n  resort();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int mmax = 1000;\nint a[mmax]; \nint b[mmax];\nint m, n;\nvoid mread();\nvoid msort();\nvoid mcomb();\nvoid mdisp();\nint main() {\n  mread();\n  msort();\n  mcomb();\n  mdisp();\n  return 0;\n}\nvoid mread() {\n  cin >> m >> n; \n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid msort() {\n  int t;\n  for (int i = 0; i < m; i++) \n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid mcomb() {\n  for (int i = 0; i < n; i++) \n    a[i + m] = b[i];\n}\nvoid mdisp() {\n  for (int i = 0; i < m + n; i++) \n  {\n    if (i != 0)\n      cout << ' ';\n    cout << a[i];\n  }\n}\n"}
{"label": "8", "index": "13669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0, i = 0;\nint a[1000], b[1000];\nvoid duru1() {\n  cin >> m;\n  cin >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nvoid shuchu() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  duru1();\n  paixu(a, m);\n  paixu(b, n);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000];\nvoid qsort(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = a[(i + j) / 2];\n  while (i <= j) {\n    while (a[i] < x)\n      i++;\n    while (x < a[j])\n      j--;\n    if (i <= j) {\n      k = a[i];\n      a[i] = a[j];\n      a[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort(i, r);\n  if (l < j)\n    qsort(l, j);\n}\n\nvoid qsort2(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = (i + j) / 2;\n  while (i < j) {\n    while (b[i] < b[x])\n      i++;\n    while (b[x] < b[j])\n      j--;\n    if (i <= j) {\n      k = b[i];\n      b[i] = b[j];\n      b[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort2(i, r);\n  if (l < j)\n    qsort2(l, j);\n}\n\nvoid input() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid output() {\n  int i;\n  for (i = 1; i <= n; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i < m; i++)\n    cout << b[i] << \" \";\n  cout << b[m] << \"\\n\";\n}\n\nint main() {\n  input();\n  qsort(1, n);\n  qsort2(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid rank1(int array[], int num, int k) {\n  int a, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j <= num - i; j++)\n      if (array[j] > array[j + 1]) {\n        a = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = a;\n      }\n  for (i = 1; i <= num; i++) {\n    if (i == 1) {\n      if (k == 2)\n        printf(\" \");\n      cout << array[1];\n    } else\n      printf(\" %d\", array[i]);\n  }\n}\n\nvoid rank2(int num1, int num2) {\n  int array1[10000], array2[10000], i;\n  for (i = 1; i <= num1; i++)\n    cin >> array1[i];\n  for (i = 1; i <= num2; i++)\n    cin >> array2[i];\n  rank1(array1, num1, 1);\n  rank1(array2, num2, 2);\n  cout << endl;\n}\n\nint main() {\n  int num1, num2;\n  scanf(\"%d %d \", &num1, &num2);\n  rank2(num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "13672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n[2];\nvoid input(int a[], int b[], int n[2]) {\n  int i;\n  scanf(\"%d %d\", &n[0], &n[1]);\n  for (i = 0; i < n[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *p, int *q, int *x) {\n  int i, j, k, t;\n  for (i = 0; i < (*x - 1); i++) {\n    k = i;\n    for (j = i + 1; j < (*x); j++)\n      if (*(p + j) < *(p + k)) {\n        k = j;\n      }\n    if (k != i) {\n      t = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = t;\n    }\n  }\n  for (i = 0; i < *(x + 1) - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *(x + 1); j++)\n      if (*(q + j) < *(q + k))\n        k = j;\n    if (k != i) {\n      t = *(q + i);\n      *(q + i) = *(q + k);\n      *(q + k) = t;\n    }\n  }\n}\nvoid fold(int *p, int *x, int *q, int *w) {\n  int i;\n  for (i = 0; i < *x; i++, w++, p++)\n    *w = *p;\n  for (; i < (*x) + (*(x + 1)); i++, w++, q++)\n    *w = *q;\n}\nvoid putout(int *w, int *x) {\n  int i;\n  for (i = 0; i < (*x) + (*(x + 1)) - 1; i++)\n    printf(\"%d \", *(w + i));\n  printf(\"%d\\n\", *(w + i));\n}\nint main() {\n  int a[100], b[100], c[200];\n  input(a, b, n);\n  sort(a, b, n);\n  fold(a, n, b, c);\n  putout(c, n);\n}\n"}
{"label": "8", "index": "13673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid com(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nint main() {\n  scanf(\"%d %d \", &n1, &n2);\n  in(n1, num1);\n  com(n1, num1);\n  in(n2, num2);\n  com(n2, num2);\n  for (int i = 0; i < n1; i++)\n    printf(\"%d \", num1[i]);\n  for (int j = 0; j < n2 - 1; j++)\n    cout << num2[j] << ' ';\n  cout << num2[n2 - 1] << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "13674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100];\nint m, n;\nvoid shuru(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\nvoid hebing(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(void) {\n  int i;\n  cout << a[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  shuru();\n  paixu(a, b);\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13675", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[1000] = {0}, b[1000] = {0}, c[1000] = {0};\nvoid du() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid pai() {\n  int j, k, l;\n  for (j = 0; j <= m; j++) {\n    for (k = 0; k < m - 1; k++) {\n      if (a[k] > a[k + 1]) {\n        l = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = l;\n      }\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (b[k] > b[k + 1]) {\n        l = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = l;\n      }\n    }\n  }\n}\nvoid he() {\n  int o, p;\n  for (o = 0; o < m; o++)\n    c[o] = a[o];\n  for (p = 0; p < n; p++) {\n    c[o] = b[p];\n    o++;\n  }\n}\nvoid shu() {\n  int q;\n  for (q = 0; q < m + n; q++) {\n    printf(\"%d\", c[q]);\n    if (q != m + n - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\nint main() {\n  cin >> m >> n;\n  du();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "13676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid shuru(int a[], int b[]);\nvoid paixu(int a[]);\nvoid hebing(int a[], int b[]);\nvoid shuchu(int a[]);\nint main() {\n  int a[100] = {0}, b[100] = {0};\n  shuru(a, b);\n  paixu(a);\n  paixu(b);\n  hebing(a, b);\n  shuchu(a);\n}\n\nvoid shuru(int a[], int b[]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[]) {\n  int i, j, temp, len = 0;\n  for (i = 0; a[i] != 0; i++)\n    len++;\n  for (j = 1; j < len; j++) {\n    for (i = 0; i < len - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid hebing(int a[], int b[]) {\n  int i, lena = 0, lenb = 0;\n  for (i = 0; a[i] != 0; i++)\n    lena++;\n  for (i = 0; b[i] != 0; i++)\n    lenb++;\n  for (i = 0; i < lenb; i++)\n    a[i + lena] = b[i];\n}\n\nvoid shuchu(int a[]) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != 0; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "13677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct nums {\n  int m;\n  int n;\n  int x[2][100];\n};\nstruct nums get() {\n  int i;\n  struct nums in;\n  scanf(\"%d%d\", &in.m, &in.n);\n  getchar();\n  for (i = 0; i < in.m; i++)\n    scanf(\"%d\", &in.x[0][i]);\n  for (i = 0; i < in.n; i++)\n    scanf(\"%d\", &in.x[1][i]);\n\n  return in;\n}\nstruct nums bubble(struct nums in) {\n  int i, j, c;\n  for (i = 1; i <= in.m; i++)\n    for (j = 0; j < in.m - 1; j++)\n      if (in.x[0][j] > in.x[0][j + 1]) {\n        c = in.x[0][j];\n        in.x[0][j] = in.x[0][j + 1];\n        in.x[0][j + 1] = c;\n      }\n  for (i = 1; i <= in.n; i++)\n    for (j = 0; j < in.n - 1; j++)\n      if (in.x[1][j] > in.x[1][j + 1]) {\n        c = in.x[1][j];\n        in.x[1][j] = in.x[1][j + 1];\n        in.x[1][j + 1] = c;\n      }\n  return in;\n}\nstruct nums combine(struct nums in) {\n  int i;\n  for (i = in.m; i < in.m + in.n; i++)\n    in.x[0][i] = in.x[1][i - in.m];\n  return in;\n}\nvoid put(struct nums in) {\n  int i;\n  printf(\"%d\", in.x[0][0]);\n  for (i = 1; i < in.m + in.n; i++)\n    printf(\" %d\", in.x[0][i]);\n}\nint main() {\n  struct nums in = get();\n  struct nums ina = bubble(in);\n  struct nums inb = combine(ina);\n  put(inb);\n}\n"}
{"label": "8", "index": "13678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[2000] = {0}, b[1000] = {0};\n\nvoid read() {\n  int x, y;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    cin >> b[i];\n}\nvoid paixu(int z[]) {\n  int c;\n  for (int i = 0; z[i + 2] != 0; i++)\n    for (int j = 0; z[j + 1] != 0; j++)\n      if (z[j] > z[j + 1]) {\n        c = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = c;\n      }\n}\nvoid addd(int x[], int y[]) {\n  int q = 0;\n  while (x[q] != 0) {\n    q++;\n  }\n  for (int z = 0; y[z] != 0; z++)\n    x[q + z] = y[z];\n}\nvoid shuchu(int x[]) {\n  for (int z = 0; x[z] != 0; z++)\n    if (!z)\n      cout << x[z];\n    else\n      cout << \" \" << x[z];\n}\nint main() {\n  read();\n  paixu(a);\n  paixu(b);\n  addd(a, b);\n  shuchu(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[100], c[100], d, e, f[200];\nint du();\nint paib();\nint paic();\nint add();\nint show();\nint main() {\n  int i;\n  d = du();\n  e = du();\n  for (i = 0; i < d; i++)\n    b[i] = du();\n  for (i = 0; i < e; i++)\n    c[i] = du();\n  paib();\n  paic();\n  add();\n  show();\n  return 0;\n}\nint du() {\n  int x;\n  scanf(\"%d\", &x);\n  return x;\n}\nint paib() {\n  int j, k, r;\n  for (j = 0; j < d - 1; j++) {\n    for (k = j + 1; k < d; k++) {\n      if (b[k] < b[j]) {\n        r = b[k];\n        b[k] = b[j];\n        b[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint paic() {\n  int j, k, r;\n  for (j = 0; j < e - 1; j++) {\n    for (k = j + 1; k < e; k++) {\n      if (c[k] < c[j]) {\n        r = c[k];\n        c[k] = c[j];\n        c[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint add() {\n  int i;\n  for (i = 0; i < d; i++)\n    f[i] = b[i];\n  for (i = 0; i < e; i++)\n    f[i + d] = c[i];\n  return 0;\n}\nint show() {\n  int i;\n  for (i = 0; i < d + e - 1; i++)\n    printf(\"%d \", f[i]);\n  printf(\"%d\", f[d + e - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n[2];\nvoid input(int a[], int b[], int n[2]) {\n  int i;\n  scanf(\"%d %d\", &n[0], &n[1]);\n  for (i = 0; i < n[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *p, int *q, int *x) {\n  int i, j, k, t;\n  for (i = 0; i < (*x - 1); i++) {\n    k = i;\n    for (j = i + 1; j < (*x); j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      t = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = t;\n    }\n  }\n  for (i = 0; i < *(x + 1) - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *(x + 1); j++)\n      if (*(q + j) < *(q + k))\n        k = j;\n    if (k != i) {\n      t = *(q + i);\n      *(q + i) = *(q + k);\n      *(q + k) = t;\n    }\n  }\n}\nvoid fold(int *p, int *x, int *q, int *w) {\n  int i;\n  for (i = 0; i < *x; i++, w++, p++)\n    *w = *p;\n  for (; i < (*x) + (*(x + 1)); i++, w++, q++)\n    *w = *q;\n}\nvoid putout(int *w, int *x) {\n  int i;\n  for (i = 0; i < (*x) + (*(x + 1)) - 1; i++)\n    printf(\"%d \", *(w + i));\n  printf(\"%d\\n\", *(w + i));\n}\nint main() {\n  int a[100], b[100], c[200];\n  input(a, b, n);\n  sort(a, b, n);\n  fold(a, n, b, c);\n  putout(c, n);\n}\n"}
{"label": "8", "index": "13681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void px(int a[], int l1, int b[], int l2);\n  int len1, len2, a[100], b[100], i;\n  cin >> len1 >> len2;\n  for (i = 1; i <= len1; i++)\n    cin >> a[i];\n  for (i = 1; i <= len2; i++)\n    cin >> b[i];\n  px(a, len1, b, len2);\n  return 0;\n}\n\nvoid px(int a[], int l1, int b[], int l2) {\n  int i, j, temp;\n  for (i = 1; i <= l1 - 1; i++)\n    for (j = i + 1; j <= l1; j++)\n      if (a[i] > a[j])\n        temp = a[j], a[j] = a[i], a[i] = temp;\n\n  for (i = 1; i <= l2 - 1; i++)\n    for (j = i + 1; j <= l2; j++)\n      if (b[i] > b[j]) {\n        temp = b[j], b[j] = b[i], b[i] = temp;\n      }\n  for (i = 1; i <= l1; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= l2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[l2];\n}\n"}
{"label": "8", "index": "13682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void order(int a[], int b[], int m, int n);\n  int a[100], b[100];\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, b, m, n);\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  return;\n}\n"}
{"label": "8", "index": "13683", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid inputarray(int a[], int);\nvoid place(int a[], int);\nvoid combine(int a[], int b[], int, int);\nvoid printarray(int a[], int);\n\nint main(void) {\n  int array1[100], array2[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  inputarray(array1, m);\n  inputarray(array2, n);\n  place(array1, m);\n  place(array2, n);\n  combine(array1, array2, m, n);\n  printarray(array1, m + n);\n  return 0;\n}\n\nvoid inputarray(int array[], int n) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\n\nvoid printarray(int array[], int n) {\n  printf(\"%d\", array[0]);\n  for (int i = 1; i < n; i++) {\n    printf(\" %d\", array[i]);\n  }\n  printf(\"\\n\");\n}\n\nvoid place(int array[], int n) {\n  int mininum, temp;\n  for (int i = 0; i < n - 1; i++) {\n    mininum = i;\n    for (int j = i + 1; j < n; j++) {\n      mininum = array[j] < array[mininum] ? j : mininum;\n    }\n    temp = array[i];\n    array[i] = array[mininum];\n    array[mininum] = temp;\n  }\n}\n\nvoid combine(int array1[], int array2[], int m, int n) {\n  for (int i = m; i < m + n; i++) {\n    array1[i] = array2[i - m];\n  }\n}\n"}
{"label": "8", "index": "13684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nvoid shuchu(int c[20], int m, int n);\nvoid hubing(int c[20], int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10], c[20];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  pai(a, m);\n  pai(b, n);\n  hubing(c, a, b, m, n);\n  shuchu(c, m, n);\n  return 0;\n}\nvoid hubing(int c[20], int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n}\nvoid shuchu(int c[20], int m, int n) {\n  int i;\n  for (i = 0; i < (m + n - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13685", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[1000];\nint b[1000];\nint c[2000];\nint i;\nint j;\n\nvoid f1() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &b[j]);\n}\nvoid f2() {\n  int t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3() {\n  int s;\n  for (s = 0, i = 0; s < m, i < m; s++, i++)\n    c[s] = a[i];\n  for (s = m, j = 0; s < m + n - 2, j < n; s++, j++)\n    c[s] = b[j];\n}\nvoid f4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= m + n - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "13686", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0, a[20] = {0}, b[20] = {0}, c[40] = {0};\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n}\n\nvoid sort() {\n  for (int j = 1; j < m; j++)\n    for (int i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        int p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n  for (int j = 1; j < n; j++)\n    for (int i = 1; i <= n - j; i++)\n      if (b[i] > b[i + 1]) {\n        int p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n}\n\nvoid combine() {\n  for (int i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (int j = 1; j <= n; j++)\n    c[m + j] = b[j];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    printf(\"%d \", c[i]);\n  cout << c[m + n] << endl;\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13687", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100];\nint m, n;\n\nvoid insert(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\n\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  insert();\n  paixu(a, b);\n  hebing();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50] = {0}, b[50] = {0};\n  int i, j, c, d, s;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < d - 1; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < c; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < d; i++) {\n    printf(\" %d\", b[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "13689", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f0(int a[], int x) {\n  int i = 0;\n  for (; i < x; i++)\n    cin >> a[i];\n}\nvoid f1(int a[], int x) {\n  int i, j, s;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n}\nvoid f2(int a[], int b[], int c[], int m, int n) {\n  int i = 0;\n  while (i < m) {\n    c[i] = a[i];\n    i++;\n  }\n  while (i < m + n) {\n    c[i] = b[i - m];\n    i++;\n  }\n}\nint main() {\n  int a[50], b[50], c[100], m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  f0(a, m);\n  f0(b, n);\n  f1(a, m);\n  f1(b, n);\n  f2(a, b, c, m, n);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n1, n2;\nint *p1;\nint *p2;\nint *p3;\nint main() {\n  scanf(\"%d %d\", &n1, &n2);\n  p1 = (int *)malloc(n1 * sizeof(int));\n  p2 = (int *)malloc(n2 * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    scanf(\"%d\", &p1[k]);\n  for (int k = 0; k < n2; k++)\n    scanf(\"%d\", &p2[k]);\n  for (int k = n1 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p1[i] > p1[i + 1]) {\n        int t;\n        t = p1[i];\n        p1[i] = p1[i + 1];\n        p1[i + 1] = t;\n      }\n    }\n  }\n\n  for (int k = n2 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p2[i] > p2[i + 1]) {\n        int t;\n        t = p2[i];\n        p2[i] = p2[i + 1];\n        p2[i + 1] = t;\n      }\n    }\n  }\n  p3 = (int *)malloc((n1 + n2) * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    p3[k] = p1[k];\n  for (int i = n1; i < n1 + n2; i++)\n    p3[i] = p2[i - n1];\n  int c;\n  for (c = 0; c < n1 + n2; c++) {\n    if (c == 0)\n      cout << p3[0];\n    else\n      cout << \" \" << p3[c];\n  }\n}\n"}
{"label": "8", "index": "13691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A, B, a[40], b[40];\n\nvoid enter() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  cin >> a[1];\n  for (i = 2; i <= A; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[1]);\n  for (i = 2; i <= B; i++)\n    scanf(\" %d\", &b[i]);\n}\n\nvoid array_1() {\n  int i, j, m;\n  for (i = 1; i <= A - 1; i++)\n    for (j = 1; j <= A - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 1; i <= B - 1; i++)\n    for (j = 1; j <= B - i; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\n\nvoid connect() {\n  int i, j;\n  for (i = A + 1, j = 1; i <= A + B; i++, j++)\n    a[i] = b[j];\n}\n\nvoid print() {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= A + B; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  enter();\n  array_1();\n  connect();\n  print();\n}\n"}
{"label": "8", "index": "13692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[500], b[200], temp;\nvoid read(void) \n{\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid rank_1(void) \n{\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid merge(void) \n{\n  for (int i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid show(void) \n{\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n - 1];\n}\n\nint main(void) {\n  read();\n  rank_1();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "13693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid program(void) {\n  int m, n, i, j;\n  scanf(\"%d %d \", &m, &n);\n  const int M = n, N = n;\n  int a[M], b[N];\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n  for (i = 0; i < m; ++i)\n    for (j = i + 1; j < m; ++j)\n      if (a[i] > a[j]) {\n        a[i] = a[i] + a[j];\n        a[j] = a[i] - a[j];\n        a[i] = a[i] - a[j];\n      }\n  for (i = 0; i < n; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (b[i] > b[j]) {\n        b[i] = b[i] + b[j];\n        b[j] = b[i] - b[j];\n        b[i] = b[i] - b[j];\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; ++i)\n    cout << ' ' << a[i];\n  for (i = 0; i < n; ++i)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  program();\n  return 0;\n}\n"}
{"label": "8", "index": "13694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint na, nb;\nint *a, *b;\nvoid input() {\n  scanf(\"%d %d\", &na, &nb);\n  a = (int *)malloc(na * sizeof(int));\n  b = (int *)malloc(nb * sizeof(int));\n  for (int i = 0; i < na; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = 0; i < nb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return t;\n}\nvoid order() {\n  qsort(a, na, sizeof(int), pfC);\n  qsort(b, nb, sizeof(int), pfC);\n}\n\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < na; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 0; i < nb; i++)\n    cout << \" \" << b[i];\n}\n\nint main() {\n  input();\n  order();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13695", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[2][5000], b[2], k;\nvoid ppt(int k) {\n  for (int i = 0; i < b[k] - 1; i++)\n    for (int j = 0; j < b[k] - 1 - i; j++)\n      if (a[k][j] > a[k][j + 1]) {\n        int tr;\n        tr = a[k][j];\n        a[k][j] = a[k][j + 1];\n        a[k][j + 1] = tr;\n      }\n}\n\nint main() {\n  cin >> b[0] >> b[1];\n  for (k = 0; k <= 1; k++) {\n    for (int m = 0; m < b[k]; m++)\n      cin >> a[k][m];\n    ppt(k);\n    for (int m = 0; m < b[k]; m++) {\n      if (k == 0 && m == 0)\n        printf(\"%d\", a[k][m]);\n      else\n        cout << \" \" << a[k][m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[2][100];\nvoid order(int x, int y) {\n  int i, j, t;\n  for (i = 0; i < y; i++)\n    cin >> a[x][i];\n  for (i = 0; i < y - 1; i++)\n    for (j = 0; j < y - 1 - i; j++)\n      if (a[x][j] > a[x][j + 1]) {\n        t = a[x][j];\n        a[x][j] = a[x][j + 1];\n        a[x][j + 1] = t;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n; i++)\n    cout << a[0][i] << \" \";\n  for (i = 0; i < m - 1; i++)\n    cout << a[1][i] << \" \";\n  cout << a[1][m - 1];\n}\nint main() {\n  cin >> n >> m;\n  order(0, n), order(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  int a[m], b[n];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid f() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid g() {\n  int i, j, k;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n}\nvoid u() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid v() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f();\n  g();\n  u();\n  v();\n}\n"}
{"label": "8", "index": "13699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B;\nint *a, *b;\nint c[500];\nvoid putin() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  a = (int *)malloc(A * sizeof(int));\n  b = (int *)malloc(B * sizeof(int));\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid replace() {\n  int i, j, z;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n  for (i = 0; i < B - 1; i++) {\n    for (j = 0; j < B - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = A; i < A + B; i++)\n    c[i] = b[i - A];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < A + B; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  putin();\n  replace();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint M, N;\nvoid x() {\n  int i;\n  scanf(\"%d\", &M);\n  scanf(\"%d\", &N);\n  for (i = 0; i <= M - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= N - 1; i++)\n    scanf(\"%d\", &b[i]);\n};\nvoid y() {\n  int i, j, m;\n  for (i = 1; i <= M - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] < a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  for (i = 1; i <= N - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] < b[j]) {\n        m = b[i];\n        b[i] = b[j];\n        b[j] = m;\n      }\n    }\n  }\n};\nvoid z() {\n  int i;\n  for (i = 0; i <= M - 1; i++)\n    c[i] = a[i];\n  for (i = 0; i <= N - 1; i++)\n    c[i + M] = b[i];\n};\nvoid u() {\n  int i;\n  for (i = 0; i <= M + N - 2; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[M + N - 1]);\n};\nint main() {\n  x();\n  y();\n  z();\n  u();\n  return 0;\n}\n"}
{"label": "8", "index": "13701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint shuzu1[100], shuzu2[100];\nint n1, n2;\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < n2; i++)\n    cin >> shuzu2[i];\n}\nvoid paixu(int shuzu[], int n) {\n  int min, i, j, temp;\n  for (i = 0; i < n; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[j] < shuzu[min])\n        min = j;\n    }\n    temp = shuzu[i];\n    shuzu[i] = shuzu[min];\n    shuzu[min] = temp;\n  }\n}\nvoid hebing(int shuzu1[], int shuzu2[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", shuzu1[i]);\n  for (i = 0; i < n2 - 1; i++)\n    printf(\"%d \", shuzu2[i]);\n  printf(\"%d\", shuzu2[i]);\n}\nint main() {\n  scan();\n  paixu(shuzu1, n1);\n  paixu(shuzu2, n2);\n  hebing(shuzu1, shuzu2, n1, n2);\n}\n"}
{"label": "8", "index": "13702", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nint order(int str[], int po, int start) {\n  for (int i = 1; i < po; i++) {\n    for (int j = 1; j <= po - i; j++) {\n      if (str[j] > str[j + 1])\n        swap(str[j], str[j + 1]);\n    }\n  }\n  for (int i = start; i < po + start; i++) {\n    c[i] = str[i - start + 1];\n  }\n  return 0;\n}\nint output() {\n  order(a, m, 1);\n  order(b, n, m + 1);\n  for (int i = 1; i < m + n; i++) {\n    printf(\"%d \", c[i]);\n  }\n  cout << c[m + n];\n  return 0;\n}\nint main() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13703", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint i, j, k, l, m, b[20], c[20];\nvoid f() { cin >> l >> k; }\nvoid g(int d[20], int s) {\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid h(int a[20], int n, int p) {\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  if (p == 1)\n    printf(\"%d \", a[n - 1]);\n  if (p == 2)\n    printf(\"%d\\n\", a[n - 1]);\n}\nint main() {\n  f();\n  g(b, l);\n  g(c, k);\n  h(b, l, 1);\n  h(c, k, 2);\n  return 0;\n}\n"}
{"label": "8", "index": "13704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid paixu(int n, int a[1000]) {\n  if (n == 0)\n    return;\n  int x, i;\n  int min = a[0];\n  for (x = 0; x < n; x++) {\n    if (a[x] <= min)\n      min = a[x];\n  }\n  if (n > 1)\n    cout << min << ' ';\n  if (n == 1)\n    cout << min;\n  for (x = 0; x < n; x++) {\n    if (a[x] == min)\n      break;\n  }\n  for (i = x; i < n - 1; i++)\n    a[i] = a[i + 1];\n  return paixu(n - 1, a);\n}\nint main() {\n  int m1, m2, x;\n  int s[1000];\n  memset(s, 0, sizeof(s));\n  scanf(\"%d %d \", &m1, &m2);\n  for (x = 0; x < m1; x++)\n    cin >> s[x];\n  paixu(m1, s);\n  cout << ' ';\n  memset(s, 0, sizeof(s));\n  for (x = 0; x < m2; x++)\n    cin >> s[x];\n  paixu(m2, s);\n  return 0;\n}\n"}
{"label": "8", "index": "13705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint key, j, k, i, t;\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  int *p1 = (int *)malloc((n + 1) * sizeof(int));\n  int *p2 = (int *)malloc((m + 1) * sizeof(int));\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", (p1 + i));\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", (p2 + i));\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (*(p1 + i) > *(p1 + j))\n        t = *(p1 + i), *(p1 + i) = *(p1 + j), *(p1 + j) = t;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    for (j = i + 1; j <= m; j++) {\n      if (*(p2 + i) > *(p2 + j)) {\n        t = *(p2 + i), *(p2 + i) = *(p2 + j), *(p2 + j) = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 1; i <= m; i++) {\n    if (i == m)\n      printf(\"%d\", *(p2 + i));\n    else\n      printf(\"%d \", *(p2 + i));\n  }\n}\n"}
{"label": "8", "index": "13706", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n, a[10000], b[10000];\nvoid input() { \n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sequence() { \n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        int temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        int temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n}\nvoid combination() { \n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid output() { \n  cout << a[0];\n  for (int i = 1; i < m + n; i++)\n    cout << ' ' << a[i];\n  cout << endl;\n}\nint main() {\n  input();\n  sequence();\n  combination();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13707", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, a[100], b[100], i, q, j;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        q = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = q;\n      }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        q = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = q;\n      }\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000];\nint sizea, sizeb;\nvoid read() {\n  cin >> sizea >> sizeb;\n  int i;\n  for (i = 0; i <= sizea - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= sizeb - 1; i++)\n    cin >> b[i];\n}\nvoid order(int n, int a[]) {\n  int i, j;\n  int temp;\n  for (i = n - 1; i >= 1; i--)\n    for (j = 0; j <= i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid paixu() {\n  order(sizea, a);\n  order(sizeb, b);\n}\nvoid mix() {\n  int i;\n  for (i = 0; i <= sizeb - 1; i++)\n    a[sizea + i] = b[i];\n}\nvoid print() {\n  cout << a[0];\n  for (int i = 1; i <= sizea + sizeb - 1; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  read();\n  paixu();\n  mix();\n  print();\n}\n"}
{"label": "8", "index": "13709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid in(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid bubblesort(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n}\n\nvoid strc(int a[], int b[], int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n}\nvoid print(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[n1 + n2 - 1]);\n}\n\nint main() {\n  int i, n1, n2, a[100], b[100], c[200];\n  scanf(\"%d %d\", &n1, &n2);\n  in(a, n1);\n  in(b, n2);\n\n  bubblesort(a, n1);\n  bubblesort(b, n2);\n  strc(a, b, c, n1, n2);\n  print(c, n1, n2);\n}\n"}
{"label": "8", "index": "13710", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n}\nvoid f(int a[], int b[], int an, int bn) {\n  turn(a, an);\n  printf(\" \");\n  turn(b, bn);\n}\nint main() {\n  int i, an, bn, a[100], b[100];\n  scanf(\"%d%d\", &an, &bn);\n  for (i = 0; i < an; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bn; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, b, an, bn);\n}\n"}
{"label": "8", "index": "13711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  input();\n\n  paixu();\n\n  hebing();\n\n  show();\n}\n"}
{"label": "8", "index": "13712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n;\nstatic char a[100], b[100];\nint i, j, temp;\nvoid get() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order() {\n  for (i = m - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid com() {\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid print() {\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  get();\n  order();\n  com();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid get_array(int a[]);\nint a[101];\nint main() { get_array(a); }\nvoid get_array(int a[]) {\n\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  for (int i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  cout << a[0];\n  for (int i = 1; i < n1; i++) {\n    cout << \" \" << a[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < n2; i++) {\n    printf(\" %d\", a[i]);\n  }\n  return;\n}\n"}
{"label": "8", "index": "13714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint d, e, f, g;\nint a[50], b[50], c[100];\nint get(int a[50], int b[50]);\nint repick(int a[50], int b[50]);\nint hand(int a[50], int b[50], int c[100]);\nint out(int c[100]);\nint main() {\n  get(a, b);\n  repick(a, b);\n  hand(a, b, c);\n  out(c);\n  return 0;\n}\nint get(int a[50], int b[50]) {\n  scanf(\"%d%d\", &f, &g);\n  for (d = 0; d < f; d++)\n    scanf(\"%d\", &a[d]);\n  for (e = 0; e < g; e++)\n    scanf(\"%d\", &b[e]);\n  return 0;\n}\nint repick(int a[50], int b[50]) {\n  int h;\n  for (d = 0; d < f; d++)\n    for (e = 0; e < (f - d - 1); e++)\n      if (a[e] > a[e + 1]) {\n        h = a[e + 1];\n        a[e + 1] = a[e];\n        a[e] = h;\n      }\n  for (d = 0; d < g; d++)\n    for (e = 0; e < (g - d - 1); e++)\n      if (b[e] > b[e + 1]) {\n        h = b[e + 1];\n        b[e + 1] = b[e];\n        b[e] = h;\n      }\n  return 0;\n}\nint hand(int a[50], int b[50], int c[100]) {\n  d = 0;\n  while (d < f) {\n    c[d] = a[d];\n    d++;\n  }\n  while (d < (f + g)) {\n    c[d] = b[d - f];\n    d++;\n  }\n  return 0;\n}\nint out(int c[100]) {\n  d = 0;\n  printf(\"%d\", c[d]);\n  d++;\n  while (d < (f + g)) {\n    printf(\" %d\", c[d]);\n    d++;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13715", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i, j;\nint m, n;\nint main() {\n  int a[100], b[50];\n  void read(int a[], int b[]);\n  void rank(int a[], int b[]);\n  void link(int a[], int b[]);\n  void output(int a[]);\n  read(a, b);\n  rank(a, b);\n  link(a, b);\n  output(a);\n  return 0;\n}\nvoid read(int a[], int b[]) {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank(int a[], int b[]) {\n  int t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[]) {\n  for (i = 0, j = m; i < n; i++, j++)\n    a[j] = b[i];\n}\nvoid output(int a[]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", a[i]);\n    printf(\"%c\", (i < m + n - 1) ? ' ' : '\\n');\n  }\n}\n"}
{"label": "8", "index": "13716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid Do(int m, int n) {\n  int a[m], b[n];\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, m, 4, compare);\n  qsort(b, n, 4, compare);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d \", b[n - 1]);\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  Do(m, n);\n}\n"}
{"label": "8", "index": "13717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int array[], int k);\n  void g(int c[], int d[], int o, int p);\n  int n, m, a[200], b[100], i, j, e[200], z;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  g(a, b, n, m);\n  for (z = 0; z < n + m - 1; z++) {\n    printf(\"%d \", a[z]);\n  }\n  printf(\"%d\", a[n + m - 1]);\n  return 0;\n}\nvoid f(int array[], int k) {\n  int r, s, t;\n  for (r = 0; r < k - 1; r++)\n    for (s = 0; s < k - 1 - r; s++) {\n      if (array[s] > array[s + 1]) {\n        t = array[s];\n        array[s] = array[s + 1];\n        array[s + 1] = t;\n      }\n    }\n}\nvoid g(int c[], int d[], int o, int p) {\n  int u;\n  for (u = o; u <= o + p - 1; u++)\n    c[u] = d[u - o];\n}\n"}
{"label": "8", "index": "13718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[200];\n\nint main() {\n  void to(int a[], int b[], int n, int m);\n  void hebing(int a[], int b[], int n, int m);\n  void print(int c[], int n, int m);\n  int n, m, a[100], b[100], i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n\n  to(a, b, n, m);\n  hebing(a, b, n, m);\n  print(c, n, m);\n  return 0;\n}\n\nvoid to(int a[], int b[], int n, int m) {\n  int t, u, s, f, e, p;\n  for (t = 0; t < n - 1; t++) {\n    for (u = t + 1; u < n; u++) {\n      if (a[t] > a[u]) {\n        s = a[t];\n        a[t] = a[u];\n        a[u] = s;\n      }\n    }\n  }\n  for (f = 0; f < m - 1; f++) {\n    for (e = f + 1; e < m; e++) {\n      if (b[f] > b[e]) {\n        p = b[f];\n        b[f] = b[e];\n        b[e] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < m; i++) {\n    c[n + i] = b[i];\n  }\n}\nvoid print(int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\\n\", c[n + m - 1]);\n}\n"}
{"label": "8", "index": "13719", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a1[100], a2[100];\nint n1, n2;\nint a[200];\n\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &a2[i]);\n}\n\nvoid paixu(int b1[], int b2[], int m1, int m2) {\n  int i, j, t;\n  for (i = 0; i < m1 - 1; i++)\n    for (j = 0; j < m1 - 1 - i; j++)\n      if (b1[j] > b1[j + 1]) {\n        t = b1[j];\n        b1[j] = b1[j + 1];\n        b1[j + 1] = t;\n      }\n  for (i = 0; i < m2 - 1; i++)\n    for (j = 0; j < m2 - 1 - i; j++)\n      if (b2[j] > b2[j + 1]) {\n        t = b2[j];\n        b2[j] = b2[j + 1];\n        b2[j + 1] = t;\n      }\n}\n\nvoid hebing(int c1[], int c2[], int m1, int m2) {\n  int i, j;\n  for (i = 0; i < m1; i++)\n    a[i] = c1[i];\n  for (j = 0; j < m2; j++) {\n    a[i] = c2[j];\n    i++;\n  }\n}\n\nvoid shuchu(int d[], int m1, int m2) {\n  int i;\n  for (i = 0; i < (m1 + m2); i++) {\n    if (i < m1 + m2 - 1)\n      printf(\"%d \", d[i]);\n    else\n      printf(\"%d\\n\", d[i]);\n  }\n}\n\nint main() {\n  shuru();\n  paixu(a1, a2, n1, n2);\n  hebing(a1, a2, n1, n2);\n  shuchu(a, n1, n2);\n}\n"}
{"label": "8", "index": "13720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, t, j;\n  int a[2][1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[0][i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[1][i]);\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[0][i] > a[0][i + 1]) {\n        t = a[0][i];\n        a[0][i] = a[0][i + 1];\n        a[0][i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[1][i] > a[1][i + 1]) {\n        t = a[1][i];\n        a[1][i] = a[1][i + 1];\n        a[1][i + 1] = t;\n      }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[0][i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[1][i]);\n  printf(\"%d\\n\", a[1][n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint m, n, i, j, k, xx;\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid init(int a[], int b[]) { \n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n  \n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n}\nint main() {\n  init(a, b);\n  sort(a, m);\n  sort(b, n);\n  merge(a, b, m, n);\n  output(a, m + n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "13722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nint main() {\n  void f1();\n  void f2(int s[], int k);\n  void f3(int p[], int t);\n  void f4(int p[], int t);\n  f1();\n  f2(a, m);\n  f2(b, n);\n  f3(a, m);\n  f4(b, n);\n}\n\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int s[], int k) {\n\n  int i, j, t;\n  for (j = 0; j < k - 1; j++)\n    for (i = 0; i < k - 1 - j; i++)\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n}\n\nvoid f3(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    printf(\"%d \", p[i]);\n  }\n}\n\nvoid f4(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%d \", p[i]);\n  printf(\"%d\", p[t - 1]);\n}\n"}
{"label": "8", "index": "13723", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a, b;\nint a1[20], b1[20], c[40];\nvoid input(void) { \n  cin >> a >> b;\n  for (int i = 0; i < a; i++)\n    cin >> a1[i];\n  for (int j = 0; j < b; j++)\n    cin >> b1[j];\n}\nvoid select_sort(int array[], int n) \n{\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid combine(int array1[], int array2[]) \n{\n  for (int i = 0; i < a; i++)\n    c[i] = array1[i];\n  for (int j = 0; j < b; j++)\n    c[j + a] = array2[j];\n}\nvoid output(void) { \n  for (int i = 0; i < a + b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[a + b - 1] << endl;\n}\nint main() {\n  input();\n  select_sort(a1, a);\n  select_sort(b1, b);\n  combine(a1, b1);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input();\nvoid arrange();\nvoid add();\nvoid output();\nint a[100], b[100], c[200], n1, n2;\nint main() {\n  input();\n  arrange();\n  add();\n  output();\n  return 0;\n}\nvoid input() {\n  int i, j;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n2; j++)\n    scanf(\"%d\", &b[j]);\n}\n\nvoid arrange() {\n  int i, j, temp;\n  for (i = 0; i < n1; i++)\n    for (j = i; j < n1; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < n2; i++)\n    for (j = i; j < n2; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid add() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    c[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    c[i] = b[i - n1];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", c[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "8", "index": "13725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x, y, i, j, k;\nvoid a1();\nvoid b1(int *p, int n);\nvoid c(int *p1, int x, int *p2, int y);\nvoid d(int x, int y);\n\nvoid a1() {\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid b1(int *p, int n) {\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j + 1] < p[j]) {\n        k = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = k;\n      }\n    }\n}\n\nvoid c(int *p1, int x, int *p2, int y) {\n  for (i = x, j = 0; i < x + y; j++, i++)\n    p1[i] = p2[j];\n}\n\nvoid d(int x, int y) {\n  cout << a[0];\n  for (i = 1; i < x + y; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  a1();\n  b1(a, x);\n  b1(b, y);\n  c(a, x, b, y);\n  d(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13726", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint l1, l2, a1[50], a2[50], a3[100];\nvoid f1(int a1[], int a2[]) {\n  scanf(\"%d %d\", &l1, &l2);\n  int i;\n  for (i = 1; i <= l1; i++)\n    cin >> a1[i];\n  for (i = 1; i <= l2; i++)\n    scanf(\"%d\", &a2[i]);\n}\nvoid f2(int l, int a[]) {\n  int i, j, t;\n  for (i = 1; i < l; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a1[], int a2[], int a3[]) {\n  int i;\n  for (i = 1; i <= l1; i++)\n    a3[i] = a1[i];\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a3[i] = a2[i - l1];\n}\nvoid f4(int a3[]) {\n  int i;\n  for (i = 1; i <= l1 + l2; i++) {\n    if (i != 1)\n      printf(\" \");\n    printf(\"%d\", a3[i]);\n  }\n}\nint main() {\n  f1(a1, a2);\n  f2(l1, a1);\n  f2(l2, a2);\n  f3(a1, a2, a3);\n  f4(a3);\n}\n"}
{"label": "8", "index": "13727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n  }\n}\nvoid f(int a[], int b[], int an, int bn) {\n  turn(a, an);\n  printf(\" \");\n  turn(b, bn);\n}\nint main() {\n  int i, an, bn, a[100], b[100];\n  scanf(\"%d%d\", &an, &bn);\n  for (i = 0; i < an; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bn; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, b, an, bn);\n}\n"}
{"label": "8", "index": "13728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000] = {0}, b[1000] = {0};\nvoid input() {\n  int i, n, m;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  a[0] = n;\n  b[0] = m;\n}\nvoid sort(int a[]) {\n  int i, j;\n  for (i = 1; i < a[0]; i++)\n    for (j = 1; j <= a[0] - i; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i <= b[0] - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[b[0]];\n}\nint main() {\n  input();\n  sort(a);\n  sort(b);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13729", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x, y, i, j, k;\nvoid a1();\nvoid b1(int *p, int n);\nvoid c(int *p1, int x, int *p2, int y);\nvoid d(int x, int y);\n\nvoid a1() {\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n}\n\nvoid b1(int *p, int n) {\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j + 1] < p[j]) {\n        k = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = k;\n      }\n    }\n}\n\nvoid c(int *p1, int x, int *p2, int y) {\n  for (i = x, j = 0; i < x + y; j++, i++)\n    p1[i] = p2[j];\n}\n\nvoid d(int x, int y) {\n  cout << a[0];\n  for (i = 1; i < x + y; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  a1();\n  b1(a, x);\n  b1(b, y);\n  c(a, x, b, y);\n  d(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint q[100], w[100], m, n, i, j, k, v, y = 0;\nvoid a(), b(), c(), d();\nint main() {\n  a();\n  b();\n  c();\n  d();\n}\nvoid a() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> q[i];\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &w[i]);\n}\nvoid b() {\n  for (j = 0; j < m - 1; j++) {\n    for (k = j + 1; k < m; k++) {\n      if (q[j] > q[k]) {\n        v = q[k];\n        q[k] = q[j];\n        q[j] = v;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (w[j] > w[k]) {\n        v = w[k];\n        w[k] = w[j];\n        w[j] = v;\n      }\n    }\n  }\n}\nvoid c() {\n  for (i = m; i < m + n; i++)\n    q[i] = w[y++];\n}\nvoid d() {\n  printf(\"%d\", q[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << q[i];\n}\n"}
{"label": "8", "index": "13731", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000];\nint b[10000];\nint n, m;\nvoid du() {\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid ran() {\n  for (int i = 0; i < n; i++) {\n    int temp = a[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] <= temp) {\n        a[j + 1] = temp;\n        break;\n      } else {\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < m; i++) {\n    int temp = b[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (b[j] <= temp) {\n        b[j + 1] = temp;\n        break;\n      } else {\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid he() {\n  for (int i = n; i < n + m; i++)\n    a[i] = b[i - n];\n}\nvoid shu() {\n  for (int i = 0; i < n + m - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\", a[n + m - 1]);\n}\nint main() {\n  du();\n  ran();\n  he();\n  shu();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n2 - 1]);\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000], al, bl;\n\nvoid input() {\n  int i;\n  scanf(\"%d %d \", &al, &bl);\n  for (i = 0; i < al; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bl; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Qsort(int start, int length, int a[]) {\n  int x = a[start];\n  int i, j;\n  i = start;\n  j = length - 1;\n  while (i < j) {\n    if (x < a[j])\n      j--;\n    else if (x > a[j]) {\n      a[i] = a[j];\n      a[j] = x;\n      i++;\n    } else if (x < a[i]) {\n      a[j] = a[i];\n      a[i] = x;\n      j--;\n    } else\n      i++;\n  }\n  if (start < length - 1) {\n    Qsort(start, i, a);\n    Qsort(i + 1, length, a);\n  }\n}\n\nvoid sort() {\n  Qsort(0, al, a);\n  Qsort(0, bl, b);\n}\n\nvoid combine() {\n  int i;\n  for (i = 0; i < bl; i++)\n    a[i + al] = b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < bl + al - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  output();\n}\n"}
{"label": "8", "index": "13734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int p, int q, int *num1, int *num2) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", num1 + i);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", num2 + i);\n}\nvoid sort(int p, int q, int *num1, int *num2) {\n  int i, j, t;\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n    for (j = 0; j < q - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int p, int q, int *num1, int *num2) {\n  int i;\n  printf(\"%d\", num1[0]);\n  for (i = 1; i < p; i++)\n    printf(\" %d\", num1[i]);\n  for (i = 0; i < q; i++)\n    printf(\" %d\", num2[i]);\n}\nint main() {\n  int p, q, *num1, *num2;\n  scanf(\"%d%d\", &p, &q);\n  num1 = (int *)malloc(p * sizeof(int));\n  num2 = (int *)malloc(q * sizeof(int));\n  input(p, q, num1, num2);\n  sort(p, q, num1, num2);\n  print(p, q, num1, num2);\n}\n"}
{"label": "8", "index": "13735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pre(int *, int);\n  void bubble_sort(int *, int);\n  void merge(int *, int, int *, int, int *);\n  void print(int *, int);\n  int a[1000], b[1000], c[1000], A, B;\n  scanf(\"%d %d\", &A, &B);\n  pre(a, A);\n  bubble_sort(a, A);\n  pre(b, B);\n  bubble_sort(b, B);\n  merge(a, A, b, B, c);\n  print(c, A + B);\n  return 0;\n}\nvoid pre(int *a, int A) {\n  int i;\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", a + i);\n}\nvoid bubble_sort(int *a, int A) {\n  int i, j, temp;\n  for (j = A - 1; j > 0; j--) {\n    for (i = 0; i < j; i++)\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n  }\n}\nvoid merge(int *a, int A, int *b, int B, int *c) {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = 0; i < B; i++)\n    c[i + A] = b[i];\n}\nvoid print(int *c, int C) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < C; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "13736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nvoid get(int a[200], int b[200]) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sequence(int a[200], int p) {\n  int i, j, temp;\n  for (i = 0; i < p; i++)\n    for (j = i + 1; j < p; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  \n}\nvoid combine(int a[200], int p, int b[200], int q) {\n  int j;\n  for (j = 0; j < q; j++)\n    a[p + j] = b[j];\n}\nvoid show(int a[200], int p) {\n  int i;\n  for (i = 0; i < p - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[p - 1]);\n}\nint main() {\n  int a[200], b[200];\n  get(a, b);\n  sequence(a, m);\n  sequence(b, n);\n  combine(a, m, b, n);\n  show(a, m + n);\n}\n"}
{"label": "8", "index": "13737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int x, int y) {\n  int a[x], b[y];\n  int t, i, j;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < y; j++)\n    cin >> b[j];\n\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n}\n\nint main() {\n  int x, y;\n  cin >> x >> y;\n  f(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint N1, N2, N3;\nint *p1 = (int *)malloc(100 * sizeof(int));\nint *p2 = (int *)malloc(100 * sizeof(int));\nint *p3 = (int *)malloc(100 * sizeof(int));\n\nvoid inputnumbers() {\n\n  scanf(\"%d %d\\n\", &N1, &N2);\n  scanf(\"%d\", p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    scanf(\" %d\", p1 + i);\n  }\n  scanf(\"\\n%d\", p2);\n  for (int i = 1; i <= N2 - 1; i++) {\n    scanf(\" %d\", p2 + i);\n  }\n}\n\nvoid seperatesort() {\n  for (int i = 1; i <= N1 - 1; i++) {\n    for (int j = i + 1; j <= N1; j++) {\n      if (*(p1 + i - 1) > *(p1 + j - 1)) {\n        int temp = *(p1 + i - 1);\n        *(p1 + i - 1) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= N2 - 1; i++) {\n    for (int j = i + 1; j <= N2; j++) {\n      if (*(p2 + i - 1) > *(p2 + j - 1)) {\n        int temp = *(p2 + i - 1);\n        *(p2 + i - 1) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  N3 = N1 + N2;\n  for (int i = 0; i <= N1 - 1; i++) {\n    *(p3 + i) = *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    *(p3 + N1 + i) = *(p2 + i);\n  }\n}\n\nvoid printresult2() {\n  printf(\"%d\", *p3);\n  for (int i = 1; i <= N3 - 1; i++) {\n    printf(\" %d\", *(p3 + i));\n  }\n}\nvoid printresult1() {\n  printf(\"%d\", *p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    cout << \" \" << *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    printf(\" %d\", *(p2 + i));\n  }\n}\n\nint main() {\n  inputnumbers();\n  seperatesort();\n  combine();\n  printresult2();\n}\n"}
{"label": "8", "index": "13739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20] = {0}, b[20] = {0}, c[40] = {0}, i, j, k;\nint main() {\n  void qushu();\n  void paixu();\n  void hebing();\n  void xianshi();\n  qushu();\n  paixu();\n  hebing();\n  xianshi();\n}\nvoid qushu() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu() {\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n}\nvoid hebing() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "13740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int a[], int b[]);\nvoid sort(int a[], int b[]);\nvoid link(int a[], int b[]);\nvoid output(int a[]);\nint input1[100], input2[100], n1, n2;\nint main() {\n  read(input1, input2);\n  sort(input1, input2);\n  link(input1, input2);\n  output(input1);\n  return 0;\n}\nvoid read(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n}\nvoid link(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\nvoid output(int a[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n1 + n2 - 1];\n}\n"}
{"label": "8", "index": "13741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *p, *q, m, n;\nvoid shuru() {\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", q + i);\n}\nstatic int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid shuchu() {\n  for (int i = 0; i < m; i++)\n    printf(\"%d \", *(p + i));\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", *(q + i));\n  printf(\"%d\", *(q + n - 1));\n}\nint main() {\n  shuru();\n  qsort(p, m, sizeof(int), cmp);\n  qsort(q, n, sizeof(int), cmp);\n  shuchu();\n}\n"}
{"label": "8", "index": "13742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(int a[], int b[], int c[]) {\n  int x = 0, y = 0;\n  cin >> x >> y;\n  int i = 0;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    scanf(\"%d \", &b[i]);\n  int j = 0, t = 0;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[x + y - 1];\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0};\n  change(a, b, c);\n  return 0;\n}\n"}
{"label": "8", "index": "13743", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid rank1(int array[], int num, int k) {\n  int a, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j <= num - i; j++)\n      if (array[j] > array[j + 1]) {\n        a = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = a;\n      }\n  for (i = 1; i <= num; i++) {\n    if (i == 1) {\n      if (k == 2)\n        cout << ' ';\n      printf(\"%d\", array[1]);\n    } else\n      cout << ' ' << array[i];\n  }\n}\n\nvoid rank2(int num1, int num2) {\n  int array1[10000], array2[10000], i;\n  for (i = 1; i <= num1; i++)\n    cin >> array1[i];\n  for (i = 1; i <= num2; i++)\n    cin >> array2[i];\n  rank1(array1, num1, 1);\n  rank1(array2, num2, 2);\n  printf(\"\\n\");\n}\n\nint main() {\n  int num1, num2;\n  cin >> num1 >> num2;\n  rank2(num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "13744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m[2], i, j, k, a[2][100], p;\n  scanf(\"%d %d\", &m[0], &m[1]);\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      scanf(\"%d\", &a[k][i]);\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      for (j = 0; j < m[k] - i - 1; j++) {\n        if (a[k][j] > a[k][j + 1]) {\n          p = a[k][j];\n          a[k][j] = a[k][j + 1];\n          a[k][j + 1] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      if (!(k == 0 && i == 0)) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[k][i]);\n    }\n  }\n}\n"}
{"label": "8", "index": "13745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[100], n[100], *p, *q, a, b;\nvoid input() {\n  p = m;\n  q = n;\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++, p++) {\n    scanf(\"%d\", p);\n  }\n  for (i = 0; i < b; i++, q++) {\n    scanf(\"%d\", q);\n  }\n  p = m;\n  q = n;\n}\nvoid sort(int *p, int a) {\n  int i, j, temp;\n  for (i = 0; i < a - 1; i++) {\n    for (j = 0; j < a - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid mix() {\n  int i;\n  for (i = 0; i < b; i++) {\n    p[a + i] = q[i];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < a + b - 1; i++) {\n    printf(\"%d \", *(p++));\n  }\n  printf(\"%d \", *p);\n}\nint main() {\n  input();\n  sort(p, a);\n  sort(q, b);\n  mix();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13746", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid shuru() {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i - 1]);\n}\nvoid paixu() {\n  int c, i, j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n    }\n}\nvoid zhenghe() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  shuru();\n  paixu();\n  zhenghe();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, c[50], d[50];\nvoid shuzu() {\n  int i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &d[j]);\n}\n\nvoid paixu(int a[50], int b[50]) {\n  int i, j, s, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        s = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = s;\n      }\n}\n\nvoid hebing(int a[50], int b[50]) {\n\n  int i, j;\n  int e[100];\n  for (i = 0; i < m; i++)\n    e[i] = a[i];\n  for (j = 0; j < n; j++)\n    e[m + j] = b[j];\n  for (i = 0; i < m + n - 1; i++)\n    cout << e[i] << \" \";\n  cout << e[m + n - 1];\n}\n\nint main() {\n  shuzu();\n  paixu(c, d);\n  hebing(c, d);\n  return 0;\n}\n"}
{"label": "8", "index": "13748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int M, N;\n  scanf(\"%d%d\", &M, &N);\n  int a[100], b[100];\n  int i;\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  qsort(a, M, sizeof(int), Compare);\n  for (i = 0; i < M; i++) {\n    printf(\"\");\n  }\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(b, N, sizeof(int), Compare);\n  for (i = 0; i < N; i++) {\n    cout << \"\";\n  }\n  int c[200];\n  for (i = 0; i < M; i++) {\n    c[i] = a[i];\n  }\n  int j;\n  for (j = 0; j < N; j++, i++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < M + N - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m1, n1;\n  cin >> m1 >> n1;\n  int m = m1, n = n1;\n  int a[m];\n  int b[n];\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1] << endl;\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid read(int n1, int n2, int s1[], int s2[]);\nvoid bubble_sort(int s[], int n);\nvoid write(int n1, int n2, int s1[], int s2[]);\nint main() {\n  int n1, n2, s1[101], s2[101];\n  scanf(\"%d%d\", &n1, &n2);\n  read(n1, n2, s1, s2);\n  bubble_sort(s1, n1);\n  bubble_sort(s2, n2);\n  write(n1, n2, s1, s2);\n  return 0;\n}\nvoid read(int n1, int n2, int s1[], int s2[]) {\n  int i;\n\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid bubble_sort(int s[], int n) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (s[j] > s[j + 1]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n}\nvoid write(int n1, int n2, int s1[], int s2[]) {\n  int i;\n  cout << s1[0];\n  for (i = 1; i < n1; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n2; i++)\n    printf(\" %d\", s2[i]);\n}\n"}
{"label": "8", "index": "13751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[2][100];\nvoid order(int x, int y) {\n  int i, j, t;\n  for (i = 0; i < y; i++)\n    cin >> a[x][i];\n  for (i = 0; i < y - 1; i++)\n    for (j = 0; j < y - 1 - i; j++)\n      if (a[x][j] > a[x][j + 1]) {\n        t = a[x][j];\n        a[x][j] = a[x][j + 1];\n        a[x][j + 1] = t;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n; i++)\n    cout << a[0][i] << \" \";\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", a[1][i]);\n  cout << a[1][m - 1];\n}\nint main() {\n  cin >> n >> m;\n  order(0, n), order(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100];\n  int b[100];\n  int c[200];\n  void read(int a[], int b[], int m, int n);\n  void paixu(int a[], int b[], int m, int n);\n  void combine(int c[], int a[], int b[], int m, int n);\n  void type(int c[], int m, int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  paixu(a, b, m, n);\n  combine(c, a, b, m, n);\n  type(c, m, n);\n  return 0;\n}\n\nvoid read(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[], int b[], int m, int n) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n}\n\nvoid combine(int c[], int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid type(int c[], int m, int n) {\n  int num, i;\n  num = m + n;\n  for (i = 0; i < num; i++)\n    if (i < num - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n}\n"}
{"label": "8", "index": "13753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid rank_1(int n, int c) {\n  int num[10], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      int a;\n      if (num[j] > num[j + 1]) {\n        a = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << num[i];\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  if (c != 2) {\n    printf(\" \");\n  }\n}\nvoid count() {\n  int b[2], i;\n  scanf(\"%d %d\", &b[0], &b[1]);\n  for (i = 1; i <= 2; i++) {\n    rank_1(b[i - 1], i);\n  }\n}\nint main() {\n  void rank_1(int n, int c);\n  void count();\n  count();\n  return 0;\n}\n"}
{"label": "8", "index": "13754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int n1, n2;\n  int *a1, *a2;\n  int i1, i2, i3, i4;\n  scanf(\"%d %d\", &n1, &n2);\n  a1 = (int *)malloc(sizeof(int) * n1);\n  a2 = (int *)malloc(sizeof(int) * n2);\n  for (i1 = 0; i1 < n1; i1++) {\n    scanf(\"%d\", a1 + i1);\n  }\n  for (i2 = 0; i2 < n2; i2++) {\n    scanf(\"%d\", a2 + i2);\n  }\n  qsort(a1, n1, sizeof(int), Compare);\n  qsort(a2, n2, sizeof(int), Compare);\n  for (i3 = 0; i3 < n1; i3++) {\n    printf(\"%d \", a1[i3]);\n  }\n  for (i4 = 0; i4 < n2 - 1; i4++) {\n    printf(\"%d \", a2[i4]);\n  }\n  printf(\"%d\", a2[n2 - 1]);\n}\n"}
{"label": "8", "index": "13755", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid o(int n) {\n  int a[n];\n  int i = 0, j = 0, x;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    while (j < n - 1) {\n      if (a[j] > a[j + 1])\n        x = a[j], a[j] = a[j + 1], a[j + 1] = x;\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  j = 0;\n  while (j < n) {\n    printf(\"%d\", a[j]);\n    if (j < n - 1) {\n      printf(\" \");\n    }\n    j++;\n  }\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  o(m);\n  printf(\" \");\n  o(n);\n  return 0;\n}\n"}
{"label": "8", "index": "13756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int n, int a[100]) {\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n}\nint paixu(int a[100], int n) {\n  int i, j, t;\n  for (j = n - 2; j >= 0; j--)\n    for (i = 0; i <= j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  return (*a);\n}\nvoid mix(int a[], int b[], int c[], int e, int d) {\n  int i = 0, t;\n  for (i = 0; i < e; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < d; i++) {\n    c[i + e] = b[i];\n  }\n}\nvoid out(int c[300], int e, int d) {\n  int i = 0;\n  for (i = 0; i < e + d - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  cout << c[e + d - 1];\n}\nint main() {\n  int a[100], b[100], c[300], i = 0, x, y;\n  cin >> x >> y;\n  read(x, a);\n  read(y, b);\n  paixu(a, x);\n  paixu(b, y);\n  mix(a, b, c, x, y);\n  out(c, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a1[100], a2[100];\nvoid get(int n1, int n2) {\n  for (int i = 0; i < n1; i++) {\n    scanf(\"%d \", &a1[i]);\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\nvoid arrange(int n1, int n2) {\n  int temp;\n  for (int j = 1; j <= n1 - 1; j++) {\n    for (int i = 0; i <= n1 - j - 1; i++) {\n      if (a1[i] > a1[i + 1]) {\n        temp = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = temp;\n      }\n    }\n  }\n  for (int j = 1; j <= n2 - 1; j++) {\n    for (int i = 0; i <= n2 - j - 1; i++) {\n      if (a2[i] > a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n      }\n    }\n  }\n}\nint combine(int n1, int n2) {\n  int out[100];\n  for (int i = 0; i < n1; i++) {\n    out[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    out[n1 + i] = a2[i];\n  }\n  for (int i = 0; i < n1 + n2 - 1; i++) {\n    cout << out[i] << \" \";\n  }\n  cout << out[n1 + n2 - 1];\n}\nint main() {\n  int a, b;\n  scanf(\"%d %d \", &a, &b);\n  get(a, b);\n  arrange(a, b);\n  combine(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13758", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid output(int n, int m, int a[], int b[]) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\nvoid swap(int a[], int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\nvoid quicksort(int a[], int l, int r) {\n  int m, i, j;\n  i = l;\n  j = r;\n  m = a[i];\n  while (i <= j) {\n    while ((a[i] < m) && (i < r))\n      i++;\n    while ((a[j] > m) && (j > l))\n      j--;\n    if (i <= j) {\n      swap(a, i, j);\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    quicksort(a, i, r);\n  if (j > l)\n    quicksort(a, l, j);\n}\nvoid input() {\n  int i, n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  quicksort(a, 0, n - 1);\n  quicksort(b, 0, m - 1);\n  output(n, m, a, b);\n}\nint main() { input(); }\n"}
{"label": "8", "index": "13759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint input(int *s, int n) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    cin >> s[i];\n  return 0;\n}\n\nint sort(int *s, int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (s[j - 1] > s[j]) {\n        int temp = s[j - 1];\n        s[j - 1] = s[j];\n        s[j] = temp;\n      }\n    }\n  }\n  return 0;\n}\n\nint combine(int *s1, int *s2, int n1, int n2, int *s) {\n  int i = 0;\n  for (i = 0; i < n1; i++)\n    s[i] = s1[i];\n  for (i = 0; i < n2; i++) {\n    s[i + n1] = s2[i];\n  }\n  return 0;\n}\n\nint output(int *s, int n) {\n  int i = 0;\n  if (n <= 0)\n    return 0;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++)\n    cout << \" \" << s[i];\n}\n\nint main() {\n  int n1 = 0, n2 = 0;\n  scanf(\"%d %d\", &n1, &n2);\n  int s1[1000] = {0};\n  int s2[1000] = {0};\n  input(s1, n1);\n  input(s2, n2);\n  sort(s1, n1);\n  sort(s2, n2);\n  int s[2000] = {0};\n  combine(s1, s2, n1, n2, s);\n  output(s, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid sort(int x[]) {\n  int i, j, t;\n  for (i = 1; i <= x[0]; i++)\n    for (j = 1; j <= x[0] - i; j++) {\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n}\nvoid deal(void) {\n  int a[100] = {0};\n  int b[100] = {0};\n  int n, m, i;\n  cin >> n >> m;\n  a[0] = n;\n  b[0] = m;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &b[i]);\n  sort(a);\n  sort(b);\n  cout << a[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  deal();\n  return 0;\n}\n"}
{"label": "8", "index": "13761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  int a[10000], b[10000];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  cin.get();\n  for (int i = 0; i <= m - 1; i++) {\n    cin >> b[i];\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = n - 1; j >= i + 1; j--) {\n      int l;\n      l = max(a[j], a[j - 1]);\n      a[j - 1] = min(a[j], a[j - 1]);\n      a[j] = l;\n    }\n  }\n  for (int i = 0; i <= m - 2; i++) {\n    for (int j = m - 1; j >= i + 1; j--) {\n      int l;\n      l = max(b[j], b[j - 1]);\n      b[j - 1] = min(b[j], b[j - 1]);\n      b[j] = l;\n    }\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  for (int i = 0; i <= m - 1; i++) {\n    if (i != m - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f(int str[], int m) {\n  int i, j, k;\n  for (j = 0; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if (str[i] > str[i + 1]) {\n        k = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = k;\n      }\n}\n\nvoid g(int a[], int b[], int ma, int mb) {\n  int i;\n  for (i = ma; i < (ma + mb); i++)\n    a[i] = b[i - ma];\n}\n\nint main() {\n  int ma, mb, i;\n  int a[8888], b[8888];\n  cin >> ma >> mb;\n  for (i = 0; i < ma; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < mb; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, ma);\n  f(b, mb);\n  g(a, b, ma, mb);\n  for (i = 0; i <= (ma + mb - 1); i++) {\n    if (i != 0)\n      cout << \" \";\n    printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "8", "index": "13763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000] = {0}, b[1000] = {0};\nvoid input() {\n  int i, n, m;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  a[0] = n;\n  b[0] = m;\n}\nvoid sort(int a[]) {\n  int i, j;\n  for (i = 1; i < a[0]; i++)\n    for (j = 1; j <= a[0] - i; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i <= b[0] - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[b[0]];\n}\nint main() {\n  input();\n  sort(a);\n  sort(b);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid get(int n, int *a) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid order(int n, int *a) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid puttogether(int n, int *a, int m, int *b) {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n  cout << a[0];\n  for (i = 1; i < n + m; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  int a[500], b[500];\n  int m, n;\n  scanf(\"%d %d\", &n, &m);\n  get(n, a);\n  get(m, b);\n  order(n, a);\n  order(m, b);\n  puttogether(n, a, m, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int, int, int *, int *);\nvoid paixu(int *, int);\nvoid output(int, int, int *, int *);\n\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &shu1[i]);\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\n"}
{"label": "8", "index": "13766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid px(int a[], int n) {\n  int i, j, x;\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n}\nvoid hb(int a[], int m, int b[], int n) {\n  int c[1000];\n  int i, j, k;\n  for (i = 0; i <= m - 1; i++)\n    c[i] = a[i];\n  for (j = m; j <= m + n - 1; j++)\n    c[j] = b[j - m];\n  for (k = 0; k < m + n - 1; k++)\n    printf(\"%d \", c[k]);\n  cout << c[m + n - 1];\n}\nint main() {\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  for (i = 0; i <= m - 1; i++)\n    cin >> a[i];\n  int b[1000];\n  for (j = 0; j <= n - 1; j++)\n    scanf(\"%d\", &b[j]);\n  px(a, m);\n  px(b, n);\n  hb(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sort1(int str1[], int m)\n\n{\n  int t, i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (str1[j] > str1[j + 1]) {\n        t = str1[j];\n        str1[j] = str1[j + 1];\n        str1[j + 1] = t;\n      }\n    }\n  }\n}\nvoid sort2(int str2[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (str2[j] > str2[j + 1]) {\n        t = str2[j];\n        str2[j] = str2[j + 1];\n        str2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid order(int str1[], int str2[], int m, int n) {\n  int i;\n\n  for (i = m; i < m + n; i++)\n    str1[i] = str2[i - m];\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", str1[i]);\n  }\n  printf(\"%d\", str1[m + n - 1]);\n}\nint main() {\n  int str1[30], str2[30];\n  int i, m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &str1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &str2[i]);\n  sort1(str1, m);\n  sort2(str2, n);\n  order(str1, str2, m, n);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "13768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid shuru() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i - 1]);\n}\nvoid paixu() {\n  int c, i, j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n}\nvoid zhenghe() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  shuru();\n  paixu();\n  zhenghe();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13769", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid duqu(int n, int m, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n, int b[], int m) {\n  int i, j, t;\n\n  for (j = 0; j < n - 1; j++) {\n\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  }\n  for (j = 0; j < m - 1; j++) {\n\n    for (i = 0; i < m - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  }\n}\nvoid hebing(int array1[], int array2[], int n, int m) {\n  int i;\n  for (i = n; i < (n + m); i++) {\n    array1[i] = array2[i - n];\n  }\n}\nvoid xian(int array[], int n, int m) {\n  int i;\n  for (i = 0; i < (n + m - 1); i++)\n    printf(\"%d \", array[i]);\n  printf(\"%d\", array[n + m - 1]);\n}\n\nint main() {\n  void duqu(int n, int m, int a[], int b[]);\n  void sort(int *p1, int n, int *p2, int m);\n  void hebing(int array1[], int array2[], int n, int m);\n  void xian(int array[], int n, int m);\n  int n, m, a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  duqu(n, m, a, b);\n  sort(a, n, b, m);\n  hebing(a, b, n, m);\n  xian(a, n, m);\n}\n"}
{"label": "8", "index": "13770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int shuzu[], int num) {\n  int i, j, jiaohuan;\n  for (i = 1; i < num; i++) {\n    for (j = 0; j < num - i; j++) {\n      if (shuzu[j] > shuzu[j + 1]) {\n        jiaohuan = shuzu[j];\n        shuzu[j] = shuzu[j + 1];\n        shuzu[j + 1] = jiaohuan;\n      }\n    }\n  }\n}\nint hebing(int shuzu1[], int num1, int shuzu2[], int num2) {\n  int i;\n  for (i = 0; i < num2; i++)\n    shuzu1[i + num1] = shuzu2[i];\n}\nint main() {\n  int shuzu1[200], shuzu2[100], num1, num2, i;\n  cin >> num1 >> num2;\n  for (i = 0; i < num1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < num2; i++)\n    cin >> shuzu2[i];\n  paixu(shuzu1, num1);\n  paixu(shuzu2, num2);\n  hebing(shuzu1, num1, shuzu2, num2);\n  for (i = 0; i < (num1 + num2); i++) {\n    cout << shuzu1[i];\n    if (i < (num1 + num2 - 1))\n      cout << \" \";\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int N, M, i;\n  scanf(\"%d%d\", &N, &M);\n  int a[N], b[M];\n  for (i = 0; i < N; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, N, sizeof(int), compare);\n  for (i = 0; i < N - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[i] << \" \";\n  qsort(b, M, sizeof(int), compare);\n  for (i = 0; i < M - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  cout << b[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "8", "index": "13772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int c[], int w);\nint main() {\n  int n, m, i, j;\n  int a[10], b[10];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < m - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[m - 1]);\n}\nint f(int c[], int w) {\n  int i, j, k, t;\n  for (i = 0; i < w - 1; i++) {\n    k = i;\n    for (j = i + 1; j < w; j++)\n      if (c[j] < c[k]) {\n        k = j;\n      }\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "13773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x = 0, y = 0;\nvoid in() {\n  scanf(\"%d %d \", &x, &y);\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    cin >> b[i];\n}\nvoid sortnum() {\n  sort(a, a + x);\n  sort(b, b + y);\n}\nvoid cat() {\n  for (int i = x; i < 100; i++)\n    a[i] = b[i - x];\n}\nvoid out() {\n  cout << a[0];\n  for (int i = 1; i < x + y; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  in();\n  sortnum();\n  cat();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bubble(int c[], int x);\n  int i, m, n;\n  int a[100], b[100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d \", &a[i - 1]);\n  }\n  printf(\"\\n\");\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b[i - 1]);\n  }\n  printf(\"\\n\");\n  bubble(a, m);\n  printf(\" \");\n  bubble(b, n);\n}\n\nint bubble(int c[], int x) {\n  int t, j, temp;\n  for (t = 1; t <= x; t++) {\n    for (j = 1; j <= x - t; j++) {\n      if (c[j - 1] > c[j]) {\n        temp = c[j - 1];\n        c[j - 1] = c[j];\n        c[j] = temp;\n      }\n    }\n  }\n  for (t = 1; t <= x; t++) {\n    printf(\"%d\", c[t - 1]);\n    if (t != x)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200];\nint x, y;\n\nvoid oh()\n\n{\n  int i;\n  scanf(\"%d %d\", &x, &y);\n\n  for (i = 0; i < x - 1; i++)\n    scanf(\"%d \", &a[i]);\n\n  scanf(\"%d\\n\", &a[x - 1]);\n\n  for (i = 0; i < y - 1; i++)\n    scanf(\"%d \", &b[i]);\n\n  scanf(\"%d\\n\", &b[y - 1]);\n}\n\nvoid ba() {\n\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n\n  for (i = 0; i < y; i++)\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n}\n\nvoid zha() {\n\n  int i;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n}\n\nvoid hei() {\n\n  int i;\n  for (i = 0; i < x + y - 1; i++) {\n\n    printf(\"%d \", c[i]);\n  }\n\n  printf(\"%d\", c[x + y - 1]);\n}\n\nint main() {\n  oh();\n  ba();\n  zha();\n  hei();\n}\n"}
{"label": "8", "index": "13776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1001] = {0};\nint b[1001] = {0};\nint m, n;\nvoid loaddata() {\n  int l;\n  cin >> m >> n;\n  for (l = 0; l < m; l++)\n    cin >> a[l];\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &b[l]);\n}\nvoid arrsort() {\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid add() {\n  int p;\n  for (p = 0; p < n; p++) {\n    a[p + m] = b[p];\n  }\n}\nvoid print() {\n  int q;\n  printf(\"%d\", a[0]);\n  for (q = 1; q < m + n; q++)\n    printf(\" %d\", a[q]);\n}\n\nint main() {\n  loaddata();\n  arrsort();\n  add();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], anum, bnum;\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &anum, &bnum);\n  for (i = 0; i < anum; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < bnum; i++)\n    scanf(\"%d\", b + i);\n}\nvoid mysort() {\n  int temp, i, j;\n  for (i = 0; i < anum - 1; i++)\n    for (j = 1; j < anum - i; j++)\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n  for (i = 0; i < bnum - 1; i++)\n    for (j = 1; j < bnum - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\nvoid print() {\n  int i;\n  for (i = 0; i < anum; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < bnum; i++)\n    printf(\"%d%c\", b[i], i == bnum - 1 ? '\\n' : ' ');\n}\nint main() {\n  scan();\n  mysort();\n  print();\n}\n"}
{"label": "8", "index": "13778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int array[], int k);\n  void g(int c[], int d[], int o, int p);\n  int n, m, a[200], b[100], i, j, e[200], z;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  g(a, b, n, m);\n  for (z = 0; z < n + m - 1; z++) {\n    printf(\"%d \", a[z]);\n  }\n  printf(\"%d\", a[n + m - 1]);\n}\nvoid f(int array[], int k) {\n  int r, s, t;\n  for (r = 0; r < k - 1; r++)\n    for (s = 0; s < k - 1 - r; s++)\n      if (array[s] > array[s + 1]) {\n        t = array[s];\n        array[s] = array[s + 1];\n        array[s + 1] = t;\n      }\n}\nvoid g(int c[], int d[], int o, int p) {\n  int u;\n  for (u = o; u <= o + p - 1; u++) {\n    c[u] = d[u - o];\n  }\n}\n"}
{"label": "8", "index": "13779", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid paixu(int n, int a[1000]) {\n  if (n == 0)\n    return;\n  int x, i;\n  int min = a[0];\n  for (x = 0; x < n; x++) {\n    if (a[x] <= min)\n      min = a[x];\n  }\n  if (n > 1)\n    cout << min << ' ';\n  if (n == 1)\n    cout << min;\n  for (x = 0; x < n; x++) {\n    if (a[x] == min)\n      break;\n  }\n  for (i = x; i < n - 1; i++)\n    a[i] = a[i + 1];\n  return paixu(n - 1, a);\n}\nint main() {\n  int m1, m2, x;\n  int s[1000];\n  memset(s, 0, sizeof(s));\n  cin >> m1 >> m2;\n  for (x = 0; x < m1; x++)\n    cin >> s[x];\n  paixu(m1, s);\n  cout << ' ';\n  memset(s, 0, sizeof(s));\n  for (x = 0; x < m2; x++)\n    scanf(\"%d \", &s[x]);\n  paixu(m2, s);\n  return 0;\n}\n"}
{"label": "8", "index": "13780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, m);\n  f(b, n);\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n}\n"}
{"label": "8", "index": "13781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10];\n  int m, n;\n  cin >> m >> n;\n  shuru(a, b, m, n);\n  return 0;\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n  pai(a, m);\n  pai(b, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13782", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n  return 0;\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "13783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[200], i, j, la, lb, p;\nint main() {\n  void canf();\n  void px();\n  void lj();\n  void rintf();\n  canf();\n  px();\n  lj();\n  rintf();\n}\n\nvoid canf() {\n  scanf(\"%d%d\", &la, &lb);\n  for (i = 0; i <= la - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= lb - 1; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid px() {\n  for (i = 0; i <= la - 2; i++) {\n    for (j = i + 1; j <= la - 1; j++)\n      if (a[j] < a[i]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n  }\n  for (i = 0; i <= lb - 2; i++) {\n    for (j = i + 1; j <= lb - 1; j++)\n      if (b[j] < b[i]) {\n        p = b[i];\n        b[i] = b[j];\n        b[j] = p;\n      }\n  }\n}\n\nvoid lj() {\n  for (i = 0; i <= la - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = la; i <= la + lb - 1; i++) {\n    c[i] = b[i - la];\n  }\n}\n\nvoid rintf() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= la + lb - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "13784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nint main() {\n  void f1();\n  void f2(int s[], int k);\n  void f3(int p[], int t);\n  void f4(int p[], int t);\n  f1();\n  f2(a, m);\n  f2(b, n);\n  f3(a, m);\n  f4(b, n);\n  return 0;\n}\n\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int s[], int k) {\n\n  int i, j, t;\n  for (j = 0; j < k - 1; j++)\n    for (i = 0; i < k - 1 - j; i++) {\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n    }\n}\n\nvoid f3(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t; i++) {\n    printf(\"%d \", p[i]);\n  }\n}\n\nvoid f4(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%d \", p[i]);\n  printf(\"%d\", p[t - 1]);\n}\n"}
{"label": "8", "index": "13785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int word1[100], word2[100];\n  int num1, num2;\n  scanf(\"%d %d\", &num1, &num2);\n  int i;\n  for (i = 0; i < num1; i++) {\n    cin >> word1[i];\n  }\n  printf(\"\\n\");\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &word2[i]);\n  }\n  printf(\"\\n\");\n  int j, k, temp;\n  for (j = 1; j <= num1 * num1; j++) {\n    for (k = 0; k < num1 - 1; k++) {\n      if (word1[k] >= word1[k + 1]) {\n        temp = word1[k];\n        word1[k] = word1[k + 1];\n        word1[k + 1] = temp;\n      }\n    }\n  }\n  for (j = 1; j <= num2 * num2; j++) {\n    for (k = 0; k < num2 - 1; k++) {\n      if (word2[k] >= word2[k + 1]) {\n        temp = word2[k];\n        word2[k] = word2[k + 1];\n        word2[k + 1] = temp;\n      }\n    }\n  }\n  int zjword[300], l;\n  for (l = 0; l < num1 + num2; l++) {\n    if (l < num1) {\n      zjword[l] = word1[l];\n    } else {\n      zjword[l] = word2[l - num1];\n    }\n  }\n  int m;\n  for (m = 0; m < num1 + num2; m++) {\n    if (m != num1 + num2 - 1)\n      cout << zjword[m] << \" \";\n    else\n      printf(\"%d\", zjword[m]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid change(int a[]);\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i;\n  int first = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  change(a);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  n = m;\n  change(b);\n  for (i = 0; i < m; i++) {\n    if (first == 1)\n      cout << \" \" << b[i];\n    if (first == 0) {\n      printf(\"%d\", b[i]);\n      first = 1;\n    }\n  }\n  cout << endl;\n  return 0;\n}\nvoid change(int a[]) {\n  int t;\n  int i, j;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "8", "index": "13787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fuction1(int x, int a[]) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 0; i < x; i++)\n    cout << a[i] << \" \";\n}\nvoid fuction2(int y, int b[]) {\n  int i, j, m;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < y - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n  for (i = 0; i < y - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[y - 1]);\n}\nint main() {\n  int k, l, p, q, a[1000000], b[1000000];\n  cin >> p >> q;\n  for (k = 0; k < p; k++)\n    cin >> a[k];\n  for (k = 0; k < q; k++)\n    cin >> b[k];\n  fuction1(p, a);\n  fuction2(q, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, n, sizeof(int), compare);\n  qsort(b, m, sizeof(int), compare);\n  int c[n + m];\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n, j = 0; i < m + n; i++, j++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < n + m - 1; i++) {\n\n    cout << c[i] << \" \";\n  }\n  printf(\"%d \", c[i]);\n}\n"}
{"label": "8", "index": "13789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid paixu() {\n  int a[100], b[100], sizea, sizeb, i, j, t;\n  scanf(\"%d %d \", &sizea, &sizeb);\n  for (i = 1; i <= sizea; i++)\n    cin >> a[i];\n  for (i = 1; i <= sizeb; i++)\n    cin >> b[i];\n  for (i = sizea; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = sizeb; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= sizea; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= sizeb; i++) {\n    cout << b[i];\n    if (i < sizeb)\n      cout << \" \";\n    else\n      cout << endl;\n  }\n}\nint main() {\n  paixu();\n  return 0;\n}\n"}
{"label": "8", "index": "13790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid rank_1(int n, int c) {\n  int num[10], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      int a;\n      if (num[j] > num[j + 1]) {\n        a = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << num[i];\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  if (c != 2) {\n    cout << \" \";\n  }\n}\nvoid count() {\n  int b[2], i;\n  scanf(\"%d %d\", &b[0], &b[1]);\n  for (i = 1; i <= 2; i++) {\n    rank_1(b[i - 1], i);\n  }\n}\nint main() {\n  void rank_1(int n, int c);\n  void count();\n  count();\n  return 0;\n}\n"}
{"label": "8", "index": "13791", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint A[200] = {0};\nint B[100] = {0};\nint a, b;\n\nvoid shuzu() {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    scanf(\"%d \", &A[i]);\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> B[i];\n  }\n}\nvoid paixu() {\n  int p;\n  for (int j = 1; j <= a - 1; j++) {\n    for (int i = 0; i < a - j; i++) {\n      if (A[i] > A[i + 1]) {\n        p = A[i];\n        A[i] = A[i + 1];\n        A[i + 1] = p;\n      }\n    }\n  }\n  for (int j = 1; j <= b - 1; j++) {\n    for (int i = 0; i < b - j; i++) {\n      if (B[i] > B[i + 1]) {\n        p = B[i];\n        B[i] = B[i + 1];\n        B[i + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing() {\n  for (int i = 0; i < b; i++) {\n    A[a + i] = B[i];\n  }\n  for (int i = 0; i < a + b - 1; i++) {\n    cout << A[i] << ' ';\n  }\n  cout << A[a + b - 1];\n}\n\nint main() {\n\n  shuzu();\n  paixu();\n  hebing();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a1[10000], a2[10000], a3[10000];\nvoid X1() {\n  cin >> m >> n;\n  cout << endl;\n  for (int i = 0; i < m; i++)\n    cin >> a1[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a2[i]);\n}\nvoid X2() {\n  int change;\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = i + 1; j < m; j++) {\n      if (a1[i] > a1[j]) {\n        change = a1[i];\n        a1[i] = a1[j];\n        a1[j] = change;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a2[i] > a2[j]) {\n        change = a2[i];\n        a2[i] = a2[j];\n        a2[j] = change;\n      }\n    }\n  }\n}\nvoid X3() {\n  for (int i = 0; i < m; i++)\n    a3[i] = a1[i];\n  for (int i = 0; i < n; i++)\n    a3[i + m] = a2[i];\n}\nvoid X4() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a3[i] << \" \";\n  printf(\"%d\", a3[m + n - 1]);\n  cout << endl;\n}\nint main() {\n  X1();\n  X2();\n  X3();\n  X4();\n  return 0;\n}\n"}
{"label": "8", "index": "13793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint A[100];\nint An;\nint B[100];\nint Bn;\n\nvoid getAn() { scanf(\"%d \", &An); }\n\nvoid getBn() { cin >> Bn; }\n\nvoid sortA() {\n  for (int i = 0; i < An; i++) {\n    cin >> A[i];\n  }\n\n  sort(A, A + An);\n}\n\nvoid sortB() {\n  for (int i = 0; i < Bn; i++) {\n    cin >> B[i];\n  }\n\n  sort(B, B + Bn);\n}\n\nvoid OutA() {\n  for (int i = 0; i < An; i++) {\n    cout << A[i] << \" \";\n  }\n}\n\nvoid OutB() {\n  for (int i = 0; i < Bn; i++) {\n    cout << B[i];\n    if (i != Bn - 1) {\n      cout << ' ';\n    }\n  }\n}\n\nint main() {\n  getAn();\n  getBn();\n  sortA();\n  sortB();\n  OutA();\n  OutB();\n  return 0;\n}\n"}
{"label": "8", "index": "13794", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i;\n  int t[50] = {0}, y[50] = {0};\n  void str(int t[], int m);\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &t[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  str(t, m);\n  str(y, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", t[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", y[i]);\n  printf(\"%d\\n\", y[n - 1]);\n  return 0;\n}\nvoid str(int t[], int m) {\n  int i, j;\n  int c;\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j <= m - 1; j++) {\n      if (t[i] > t[j]) {\n        c = t[i];\n        t[i] = t[j];\n        t[j] = c;\n      }\n    }\n}\n"}
{"label": "8", "index": "13795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nint out[200];\n\nvoid p1(void) {\n  int i;\n\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &num1[i]);\n\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &num2[i]);\n}\n\nvoid p2(int num1[100], int num2[100], int n1, int n2) {\n  int i, j, tmp;\n\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tmp = num1[j];\n        num1[j] = num1[i];\n        num1[i] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tmp = num2[j];\n        num2[j] = num2[i];\n        num2[i] = tmp;\n      }\n    }\n  }\n}\n\nvoid p3(int num1[100], int num2[100], int n1, int n2) {\n\n  int i = 0, j = 0;\n  while (i < n1) {\n    out[i] = num1[i];\n    i++;\n  }\n  while (j < n2) {\n    out[n1 + j] = num2[j];\n    j++;\n  }\n}\n\nvoid p4(int out[200], int n) {\n  int i;\n  printf(\"%d\", out[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", out[i]);\n}\nint main() {\n  p1();\n  p2(num1, num2, n1, n2);\n  p3(num1, num2, n1, n2);\n  p4(out, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid ipt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    if (i != n)\n      scanf(\" \");\n    i++;\n  }\n}\n\nvoid opt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n    i++;\n  }\n}\n\nint main() {\n  int n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  ipt(a, n);\n  ipt(b, m);\n  sort(a, n);\n  sort(b, m);\n  opt(a, n);\n  cout << \" \";\n  opt(b, m);\n}\n"}
{"label": "8", "index": "13797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int M, N;\n  scanf(\"%d%d\", &M, &N);\n  int a[100], b[100];\n  int i;\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  qsort(a, M, sizeof(int), Compare);\n  for (i = 0; i < M; i++) {\n    cout << \"\";\n  }\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(b, N, sizeof(int), Compare);\n  for (i = 0; i < N; i++) {\n    cout << \"\";\n  }\n  int c[200];\n  for (i = 0; i < M; i++) {\n    c[i] = a[i];\n  }\n  int j;\n  for (j = 0; j < N; j++, i++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < M + N - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint array_a[100], array_b[100], n_a, n_b;\nvoid input() {\n  int i;\n\n  scanf(\"%d%d\", &n_a, &n_b);\n  for (i = 0; i < n_a; i++)\n    scanf(\"%d\", &array_a[i]);\n  for (i = 0; i < n_b; i++)\n    scanf(\"%d\", &array_b[i]);\n}\nvoid order() {\n  int i, j, temp;\n\n  for (i = 1; i < n_a; i++)\n    for (j = 1; j < n_a + 1 - i; j++)\n      if (array_a[j] < array_a[j - 1]) {\n        temp = array_a[j];\n        array_a[j] = array_a[j - 1];\n        array_a[j - 1] = temp;\n      }\n  for (i = 1; i < n_b; i++)\n    for (j = 1; j < n_b - i + 1; j++)\n      if (array_b[j] < array_b[j - 1]) {\n        temp = array_b[j];\n        array_b[j] = array_b[j - 1];\n        array_b[j - 1] = temp;\n      }\n}\nvoid catenate() {\n  int i;\n  for (i = 0; i < n_b; i++)\n    array_a[n_a + i] = array_b[i];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < n_a + n_b; i++)\n    printf(\"%d%c\", array_a[i], (i == n_a + n_b - 1) ? '\\n' : ' ');\n}\nint main() {\n  input();\n  order();\n  catenate();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13799", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], c[200], n1, n2;\nint shuru(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> a[i];\n  for (int i = 0; i < n2; i++)\n    cin >> b[i];\n}\nint pai() {\n  int m;\n  for (int j = 0; j < n1 - 1; j++)\n    for (int i = 0; i < n1 - 1; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = m;\n      }\n  for (int j = 0; j < n2 - 1; j++)\n    for (int i = 0; i < n2 - 1; i++)\n      if (b[i] > b[i + 1]) {\n        m = b[i + 1];\n        b[i + 1] = b[i];\n        b[i] = m;\n      }\n}\nint jie() {\n  for (int i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (int i = 0; i < n2; i++)\n    c[n1 + i] = b[i];\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  shuru();\n  pai();\n  jie();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13800", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[100], n, m, i, j, k;\n\nvoid get_array();\nvoid sort_array();\nvoid combine_array();\nvoid print_array();\n\nint main() {\n  get_array();\n\n  sort_array();\n\n  combine_array();\n\n  print_array();\n\n  return 0;\n}\n\nvoid get_array() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid sort_array() {\n  int temp = 0;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine_array() {\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\nvoid print_array() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n}\n"}
{"label": "8", "index": "13801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid duqu(int m, int a[]);\nvoid paixu(int m, int a[]);\nvoid hebing(int m, int n, int a[], int b[]);\nvoid shuchu(int m, int n, int a[]);\nint main() {\n  int x[100] = {0}, y[100] = {0}, m, n;\n  scanf(\"%d%d\", &m, &n);\n  duqu(m, x);\n  duqu(n, y);\n  paixu(m, x);\n  paixu(n, y);\n  hebing(m, n, x, y);\n  shuchu(m, n, x);\n  return 0;\n}\nvoid duqu(int m, int a[]) {\n  int i;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid paixu(int m, int a[]) {\n  int i, j, k;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n}\nvoid hebing(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid shuchu(int m, int n, int a[]) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n]);\n}\n"}
{"label": "8", "index": "13802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint read(int a[200], int b[100]) {\n  int m, n, i;\n  cin >> m >> n;\n  a[0] = m;\n  b[0] = n;\n  for (i = 1; i <= m; i++)\n    scanf(\" %d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\" %d\", &b[i]);\n  return 0;\n}\nint seq(int a[200]) {\n  int i, j, t, m = a[0];\n  for (j = 1; j <= m - 1; j++)\n    for (i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  return 0;\n}\nint toge(int a[200], int b[100]) {\n  int i;\n  int m = a[0];\n  int n = b[0];\n  a[0] = a[0] + b[0];\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n  return 0;\n}\nint see(int a[200]) {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= a[0]; i++)\n    cout << \" \" << a[i];\n  return 0;\n}\nint main() {\n  int a[200], b[100];\n  read(a, b);\n  seq(a);\n  seq(b);\n  toge(a, b);\n  see(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  scanf(\"%d%d\", &m, &n);\n  printf(\"\\n\");\n  int a[m], b[n], i, j;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"\\n\");\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change() {\n  int i, j, middle;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        middle = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = middle;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        middle = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    cout << b[i - m] << \" \";\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change();\n  prin();\n}\n"}
{"label": "8", "index": "13805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000] = {0}, b[1000] = {0};\nvoid input() {\n  int i, n, m;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  a[0] = n;\n  b[0] = m;\n} \nvoid sort(int a[]) {\n  int i, j;\n  for (i = 1; i < a[0]; i++)\n    for (j = 1; j <= a[0] - i; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n} \nvoid output() {\n  int i;\n  for (i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i <= b[0] - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[b[0]];\n} \nint main() {\n  input();\n  sort(a);\n  sort(b);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, m, n, a[1000], b[1000], c;\nvoid f(int a[1000], int m) {\n  for (i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  f(a, m);\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  cout << \" \";\n  f(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint x[200], y[200], m, n;\nvoid sca(void) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &y[i]);\n  }\n}\n\nvoid bubble(int a[], int n)\n\n{\n  int i, j, b;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n}\n\nvoid bing(int a[], int l1, int b[], int l2) {\n  int i, j, z[500];\n  for (i = 0; i < l1; i++)\n    z[i] = a[i];\n  for (j = 0; i < (l1 + l2); j++, i++)\n    z[i] = b[j];\n  printf(\"%d\", z[0]);\n  for (i = 1; i < (l1 + l2); i++)\n    printf(\" %d\", z[i]);\n}\n\nint main() {\n  sca();\n  bubble(x, m);\n  bubble(y, n);\n  bing(x, m, y, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, a[100], b[100];\n\nvoid sort(int c[], int s) {\n  int i, j, k;\n  for (i = 0; i < s - 1; i++)\n    for (j = 0; j < s - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = k;\n      }\n}\n\nvoid hebing(int d[], int e[], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d \", d[i]);\n  for (i = 0; i < y - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[y - 1]);\n}\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < m; j++)\n    cin >> b[j];\n  sort(a, n);\n  sort(b, m);\n  hebing(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "13809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint order(int n, int a[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i; j < n; j++)\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nint combine(int a[], int b[], int n, int m, int c[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (j = 0; j < m; j++, i++)\n    c[i] = b[j];\n}\nint input(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nint output(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cout << a[i];\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m], c[n + m];\n  input(n, a);\n  input(m, b);\n  order(n, a);\n  order(m, b);\n  combine(a, b, n, m, c);\n  output(n + m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "13810", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000] = {0}, num2[1000] = {0};\nint num[2000] = {0};\nint n1, n2;\nvoid read() {\n  scanf(\"%d %d \", &n1, &n2);\n  for (int i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (int i = 0; i < n2; i++)\n    scanf(\"%d \", &num2[i]);\n}\nvoid range() {\n  for (int i = 0; i < n1 - 1; i++)\n    for (int j = 0; j < n1 - 1 - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        int temp = 0;\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 0; i < n2 - 1; i++)\n    for (int j = 0; j < n2 - 1 - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        int temp = 0;\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\nvoid combine() {\n  for (int i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (int i = 0; i < n2; i++)\n    num[n1 + i] = num2[i];\n}\nvoid print() {\n  for (int i = 0; i < n1 + n2 - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[n1 + n2 - 1] << endl;\n}\nint main() {\n  read();\n  range();\n  combine();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[2] = {0}, a[2][100] = {0}, i, j, t, m;\n  cin >> length[0] >> length[1];\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < length[i]; j++)\n      cin >> a[i][j];\n  for (i = 0; i < 2; i++)\n    for (m = 1; m < length[i]; m++)\n      for (j = 0; j < length[i] - m; j++)\n        if (a[i][j] > a[i][j + 1]) {\n          t = a[i][j];\n          a[i][j] = a[i][j + 1];\n          a[i][j + 1] = t;\n        }\n  for (j = 0; j < length[0]; j++)\n    cout << a[0][j] << \" \";\n  cout << a[1][0];\n  for (j = 1; j < length[1]; j++)\n    printf(\" %d\", a[1][j]);\n  return 0;\n}\n"}
{"label": "8", "index": "13812", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid input(int x[], int p);\nvoid sort_ascending(int x[], int p);\nint main() {\n  int m, n, a[1000], b[1000], j, i;\n  scanf(\"%d %d\", &m, &n);\n  input(a, m);\n  input(b, n);\n  sort_ascending(a, m);\n  sort_ascending(b, n);\n  for (j = 0; j < m; j++)\n    printf(\"%d \", a[j]);\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid input(int x[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &x[i]);\n}\nvoid sort_ascending(int x[], int p) {\n  int i, j, t;\n  for (i = 0; i < p; i++)\n    for (j = 0; j < p - i - 1; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, i, j, a[1000], b[1000], c[2000], s, t;\nvoid one() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid two() {\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        s = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = s;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n}\nvoid three() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i - m < n; i++)\n    c[i] = b[i - m];\n}\nvoid four() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  one();\n  two();\n  three();\n  four();\n  return 0;\n}\n"}
{"label": "8", "index": "13814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[101], b[101], m, n;\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n  return (0);\n}\nint pai() {\n  int i, j, p;\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n    }\n  }\n  return (0);\n}\nint print() {\n  int i;\n  for (i = 1; i <= m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 1; i < n; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n]);\n  return (0);\n}\nint main() {\n  input();\n  pai();\n  print();\n}\n"}
{"label": "8", "index": "13815", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid shuru() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i - 1]);\n}\nvoid paixu() {\n  int c, i, j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n}\nvoid zhenghe() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  shuru();\n  paixu();\n  zhenghe();\n  shuchu();\n}\n"}
{"label": "8", "index": "13816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(void);\nvoid sort(int *a, int n, int *b, int m);\nvoid merger(int *a, int n, int *b, int m);\nvoid output(int *a, int n, int m);\nint n, m, a[200], b[100];\nvoid input(void) {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *a, int n, int *b, int m) {\n  int i, j, min, temp;\n  for (i = 0; i < n - 1; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[min])\n        min = j;\n    if (min != i) {\n      temp = a[i];\n      a[i] = a[min];\n      a[min] = temp;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    min = i;\n    for (j = i + 1; j < m; j++)\n      if (b[j] < b[min])\n        min = j;\n    if (min != i) {\n      temp = b[i];\n      b[i] = b[min];\n      b[min] = temp;\n    }\n  }\n}\n\nvoid merger(int *a, int n, int *b, int m) {\n  int i, j;\n  for (i = n, j = 0; i < n + m, j < m; i++)\n    a[i] = b[j++];\n}\n\nvoid output(int *a, int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\\n\", a[n + m - 1]);\n}\nint main() {\n  input();\n  sort(a, n, b, m);\n  merger(a, n, b, m);\n  output(a, n, m);\n}\n"}
{"label": "8", "index": "13817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void take(int x[1000], int l);\n  void rank(int x[1000], int l);\n  void com(int a[1000], int b[1000], int c[2000], int al, int bl);\n  void prin(int c[2000], int l);\n  int a[1000];\n  int b[1000];\n  int c[2000];\n  int al, bl;\n  scanf(\"%d%d\", &al, &bl);\n  take(a, al);\n  take(b, bl);\n  rank(a, al);\n  rank(b, bl);\n  com(a, b, c, al, bl);\n  prin(c, al + bl);\n  return 0;\n}\nvoid take(int x[1000], int l) {\n  int i;\n  for (i = 0; i < l; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n}\nvoid rank(int x[1000], int l) {\n  int i, j, temp;\n  if (l != 1) {\n    for (i = l - 2; i >= 0; i--) {\n      for (j = 0; j <= i; j++) {\n        if (x[j] > x[j + 1]) {\n          temp = x[j];\n          x[j] = x[j + 1];\n          x[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nvoid com(int a[1000], int b[1000], int c[2000], int al, int bl) {\n  int i;\n  for (i = 0; i < al; i++) {\n    c[i] = a[i];\n  }\n  for (i = al; i < al + bl; i++) {\n    c[i] = b[i - al];\n  }\n}\nvoid prin(int c[2000], int l) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < l; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "13818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> shu1[i];\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint num1;\nint num2;\nint main() {\n  void read();\n  void queue();\n  void combine();\n  void put();\n  read();\n  queue();\n  combine();\n  put();\n  return 0;\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &num1, &num2);\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid queue() {\n  int i, j, t;\n  for (i = 0; i < num1 - 1; i++) {\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < num2 - 1; i++) {\n    for (j = 0; j < num2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    c[i + num1] = b[i];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < num1 + num2 - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[num1 + num2 - 1]);\n}\n"}
{"label": "8", "index": "13820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid maopao(int m, int n, int a[200], int b[100]) {\n  int tempt, i, j;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        tempt = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = tempt;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        tempt = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = tempt;\n      }\n    }\n  }\n}\nvoid jieshang(int m, int n, int a[200], int b[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(int m, int n, int a[200]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[m + n - 1]);\n}\nint main() {\n  int m, n, i, a[200], b[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  maopao(m, n, a, b);\n  jieshang(m, n, a, b);\n  shuchu(m, n, a);\n  return 0;\n}\n"}
{"label": "8", "index": "13821", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  int a[1000], b[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint paixu(int shuzu[], int num) {\n  int i, j, jiaohuan;\n  for (i = 1; i < num; i++) {\n    for (j = 0; j < num - i; j++) {\n      if (shuzu[j] > shuzu[j + 1]) {\n        jiaohuan = shuzu[j];\n        shuzu[j] = shuzu[j + 1];\n        shuzu[j + 1] = jiaohuan;\n      }\n    }\n  }\n}\nint hebing(int shuzu1[], int num1, int shuzu2[], int num2) {\n  int i;\n  for (i = 0; i < num2; i++)\n    shuzu1[i + num1] = shuzu2[i];\n}\nint main() {\n  int shuzu1[200], shuzu2[100], num1, num2, i;\n  cin >> num1 >> num2;\n  for (i = 0; i < num1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < num2; i++)\n    cin >> shuzu2[i];\n  paixu(shuzu1, num1);\n  paixu(shuzu2, num2);\n  hebing(shuzu1, num1, shuzu2, num2);\n  for (i = 0; i < (num1 + num2); i++) {\n    cout << shuzu1[i];\n    if (i < (num1 + num2 - 1))\n      cout << \" \";\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13823", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void shuru(int *p, int len);\n  void paixu(int *p, int len);\n  void hebing(int *p1, int *p2);\n  void shuchu(int *p, int, int);\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  int *p1, *p2;\n  int a[200] = {'\\0'}, b[100] = {'\\0'};\n  p1 = a;\n  p2 = b;\n  shuru(p1, m);\n  shuru(p2, n);\n  paixu(p1, m);\n  paixu(p2, n);\n  hebing(p1, p2);\n  shuchu(p1, m, n);\n  return 0;\n}\n\nvoid shuru(int *p, int len) {\n  int i;\n  for (i = 0; i < len; i++)\n    scanf(\"%d\", p + i);\n}\n\nvoid paixu(int *p, int len) {\n  int i, j, temp;\n  for (i = 0; i < len - 1; i++)\n    for (j = i + 1; j < len; j++)\n      if (*(p + i) > *(p + j)) {\n        temp = *(p + i);\n        *(p + i) = *(p + j);\n        *(p + j) = temp;\n      }\n}\n\nvoid hebing(int *p1, int *p2) {\n  int i, j, flag;\n  for (i = 0;; i++) {\n    flag = 0;\n    if (*(p1 + i) == '\\0') {\n      for (j = 0; *(p2 + j) != '\\0'; j++)\n        *(p1 + i + j) = *(p2 + j);\n      *(p1 + i + j) = '\\0';\n      flag = 1;\n    }\n    if (flag == 1)\n      break;\n  }\n}\n\nvoid shuchu(int *p, int m, int n) {\n  int i;\n  char c;\n  for (i = 0; *(p + i) != '\\0'; i++) {\n    printf(\"%d%c\", *(p + i), c = (i < n + m - 1) ? ' ' : '\\n');\n  }\n}\n"}
{"label": "8", "index": "13824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s1, s2;\nint reads() {\n  int a;\n  cin >> a;\n  return a;\n}\nvoid reada(int a[]) {\n  for (int i = 1; i <= s1; i++)\n    cin >> a[i];\n}\nvoid readb(int b[]) {\n  for (int i = 1; i <= s2; i++)\n    cin >> b[i];\n}\nvoid reordera(int a[]) {\n  for (int i = 1; i <= s1 - 1; i++)\n    for (int j = 1; j <= s1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n}\nvoid reorderb(int b[]) {\n  for (int i = 1; i <= s2 - 1; i++)\n    for (int j = 1; j <= s2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\nvoid hebing(int a[], int b[], int c[]) {\n  for (int i = 1; i <= s1; i++)\n    c[i] = a[i];\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    c[i] = b[i - s1];\n}\nvoid output(int c[]) {\n  for (int i = 1; i <= s1 + s2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[s1 + s2];\n}\n\nint main() {\n  int a[500], b[500], c[1000];\n  s1 = reads();\n  s2 = reads();\n  reada(a);\n  readb(b);\n  reordera(a);\n  reorderb(b);\n  hebing(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "13825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  int a[m], b[n];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13826", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n  scanf(\"%d\\n\", &array[n - 1]);\n}\nvoid order(int array[], int n) {\n  int i, o, e;\n  for (i = 0; i <= n - 2; i++) {\n    for (o = i + 1; o <= n - 1; o++) {\n      if (array[i] > array[o]) {\n        e = array[i];\n        array[i] = array[o];\n        array[o] = e;\n      }\n    }\n  }\n}\nvoid output(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d \", array[i]);\n  }\n  printf(\"%d\", array[n - 1]);\n}\nint main() {\n  int a[20], b[20], q, w;\n  scanf(\"%d %d \", &q, &w);\n  input(a, q);\n  input(b, w);\n  order(a, q);\n  order(b, w);\n  output(a, q);\n  printf(\" \");\n  output(b, w);\n  return 0;\n}\n"}
{"label": "8", "index": "13827", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint shuzu1[10] = {0}, shuzu2[10] = {0};\nint n1, n2;\nvoid input() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &shuzu2[i]);\n}\n\nvoid sort(int shuzu[], int bg, int ed) {\n  int bg1 = bg, ed1 = ed, key = shuzu[bg];\n  if (bg1 != ed1) {\n    while (bg1 != ed1) {\n      for (; shuzu[ed1] >= key && bg1 != ed1; ed1--)\n        ;\n      shuzu[bg1] = shuzu[ed1];\n      if (bg1 == ed1)\n        break;\n      bg1++;\n      for (; shuzu[bg1] <= key && bg1 != ed1; bg1++)\n        ;\n      shuzu[ed1] = shuzu[bg1];\n      if (bg1 == ed1)\n        break;\n      ed1--;\n    }\n    shuzu[bg1] = key;\n    if (bg1 != bg)\n      sort(shuzu, bg, bg1 - 1);\n    if (ed1 != ed)\n      sort(shuzu, ed1 + 1, ed);\n  }\n}\nvoid sort1() {\n  sort(shuzu1, 0, n1 - 1);\n  sort(shuzu2, 0, n2 - 1);\n}\nvoid link() {\n  int lk;\n  for (lk = 0; lk < n2; lk++)\n    shuzu1[n1 + lk] = shuzu2[lk];\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i)\n      cout << ' ';\n    cout << shuzu1[i];\n  }\n}\nint main() {\n  input();\n  sort1();\n  link();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, n, sizeof(int), compare);\n  qsort(b, m, sizeof(int), compare);\n  int c[n + m];\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n, j = 0; i < m + n; i++, j++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < n + m - 1; i++) {\n\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d \", c[i]);\n}\n"}
{"label": "8", "index": "13829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sca(int n, int l);\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  sca(n1, 1);\n  sca(n2, 2);\n}\nvoid sca(int n, int l) {\n  int i, j, a[100] = {0}, p;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n    for (j = i; j > 0; j = j - 1) {\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i = i + 1)\n    printf(\"%d \", a[i]);\n  if (l == 1)\n    printf(\"%d \", a[n - 1]);\n  else\n    printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "13830", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000];\nint b[1000];\nint m, n;\nvoid init() {\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid s() {\n  sort(a, a + m + 1);\n  sort(b, b + n + 1);\n}\nvoid merge() {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[i + m] = b[i];\n}\nvoid print() {\n  int i;\n  for (i = 1; i <= m + n; i++) {\n    cout << a[i];\n    if (i < m + n)\n      cout << ' ';\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  s();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint m, n;\nvoid shuru(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\nvoid hebing(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(void) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  shuru();\n  paixu(a, b);\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid readin(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cin >> a[i];\n  for (int i = 0; i < mb; i++)\n    cin >> b[i];\n}\nvoid rearange(int ma, int mb, int a[100], int b[100]) {\n  int temp;\n  for (int i = 0; i < ma; i++)\n    for (int j = 0; j < ma - 1; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < mb; i++)\n    for (int j = 0; j < mb - 1; j++)\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nint printout(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cout << a[i] << ' ';\n  for (int i = 0; i < mb - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[mb - 1];\n}\nint main() {\n  int ma[1], mb[1], a[100] = {0}, b[100] = {0}, c[100] = {0};\n  readin(1, 1, ma, mb);\n  readin(ma[0], mb[0], a, b);\n  rearange(ma[0], mb[0], a, b);\n  printout(ma[0], mb[0], a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint la, lb, a[1000], b[1000], c[2000];\nvoid duqu() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int j = 0; j < lb; j++)\n    cin >> b[j];\n}\nvoid paixu() {\n  int i, j, temp;\n  for (i = 0; i < la - 1; i++)\n    for (j = i + 1; j < la; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < lb - 1; i++)\n    for (j = i + 1; j < lb; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid hebing() {\n  for (int i = 0; i < la; i++)\n    c[i] = a[i];\n  for (int j = 0; j < lb; j++)\n    c[la + j] = b[j];\n}\nvoid shuchu() {\n  for (int i = 0; i < la + lb; i++) {\n    cout << c[i];\n    if (i != la + lb - 1)\n      cout << \" \";\n  }\n}\nint main() {\n  duqu();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, a, b;\n\nvoid shuru() {\n  int i;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < a; i++)\n    cin >> num1[i];\n  for (i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sequence() {\n  int i, j, temp;\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < a; j++)\n      if (num1[i] > num1[j]) {\n        temp = num1[i];\n        num1[i] = num1[j];\n        num1[j] = temp;\n      }\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < b; j++)\n      if (num2[i] > num2[j]) {\n        temp = num2[i];\n        num2[i] = num2[j];\n        num2[j] = temp;\n      }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a; i++)\n    cout << num1[i] << ' ';\n  for (i = 0; i < b - 1; i++)\n    printf(\"%d \", num2[i]);\n  printf(\"%d\\n\", num2[b - 1]);\n}\n\nint main() {\n  shuru();\n  sequence();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, d, e, f, g;\n  scanf(\"%d%d\", &c, &d);\n  int a[c], b[d];\n  for (e = 0; e < c; e++)\n    scanf(\"%d\", &a[e]);\n  for (e = 0; e < d; e++)\n    scanf(\"%d\", &b[e]);\n  for (f = 0; f < c - 1; f++)\n    for (e = 0; e < c - 1; e++)\n      if (a[e] > a[e + 1]) {\n        g = a[e];\n        a[e] = a[e + 1];\n        a[e + 1] = g;\n      }\n  printf(\"%d\", a[0]);\n  for (e = 1; e < c; e++)\n    printf(\" %d\", a[e]);\n  for (f = 0; f < d - 1; f++)\n    for (e = 0; e < d - 1; e++)\n      if (b[e] > b[e + 1]) {\n        g = b[e];\n        b[e] = b[e + 1];\n        b[e + 1] = g;\n      }\n  for (e = 0; e < d; e++)\n    printf(\" %d\", b[e]);\n}\n"}
{"label": "8", "index": "13836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  void func(int, int);\n  scanf(\"%d%d\", &a, &b);\n  func(a, b);\n}\nvoid func(int x, int y) {\n  int i, j, t, q;\n  int a[100], b[100];\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0, q = 0; i < y; i++) {\n    if (q < y - 1) {\n      printf(\"%d \", b[i]);\n      q = q + 1;\n    } else\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "13837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n  }\n}\nvoid f(int a[], int b[], int an, int bn) {\n  turn(a, an);\n  printf(\" \");\n  turn(b, bn);\n}\nint main() {\n  int i, an, bn, a[100], b[100];\n  scanf(\"%d%d\", &an, &bn);\n  for (i = 0; i < an; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bn; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, b, an, bn);\n  return 0;\n}\n"}
{"label": "8", "index": "13838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid duqu();\nvoid paixu();\nvoid hebin();\nvoid xianshi();\nint a[100], b[100], c[200];\nint m, n;\nint main() {\n  duqu();\n  paixu();\n  hebin();\n  xianshi();\n  return 0;\n}\nvoid duqu() {\n\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i = 0, j = 0, t;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid hebin() {\n\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n  for (int i = m; i < n + m; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << c[i] << ' ';\n  printf(\"%d\", c[m + n - 1]);\n}\n"}
{"label": "8", "index": "13839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid f() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid g() {\n  int i, j, k;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n}\nvoid u() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid v() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[i];\n}\nint main() {\n  f();\n  g();\n  u();\n  v();\n}\n"}
{"label": "8", "index": "13840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid sort(int str[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (str[j] < str[k])\n        k = j;\n    t = str[k];\n    str[k] = str[i];\n    str[i] = t;\n  }\n}\nvoid gather(int str1[], int str2[]) {\n  int t = 0, i;\n  while (str1[t] != '\\0')\n    t++;\n  for (i = t; str2[i - t] != '\\0'; i++)\n    str1[i] = str2[i - t];\n}\n\nint main() {\n  int i, n1, n2, str1[100], str2[100];\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> str1[i];\n  scanf(\"\\n\");\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &str2[i]);\n  sort(str1, n1);\n  sort(str2, n2);\n  gather(str1, str2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    printf(\"%d \", str1[i]);\n  printf(\"%d\", str1[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "13841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort(int str[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (str[j] < str[k])\n        k = j;\n    t = str[k];\n    str[k] = str[i];\n    str[i] = t;\n  }\n}\nvoid gather(int str1[], int str2[]) {\n  int t = 0, i;\n  while (str1[t] != '\\0')\n    t++;\n  for (i = t; str2[i - t] != '\\0'; i++)\n    str1[i] = str2[i - t];\n}\n\nint main() {\n  int i, n1, n2, str1[100], str2[100];\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &str1[i]);\n  scanf(\"\\n\");\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &str2[i]);\n  sort(str1, n1);\n  sort(str2, n2);\n  gather(str1, str2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    printf(\"%d \", str1[i]);\n  printf(\"%d\", str1[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "13842", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint b[100], c[100], d, e, f[200];\nint du();\nint paib();\nint paic();\nint add();\nint show();\nint main() {\n  int i;\n  d = du();\n  e = du();\n  for (i = 0; i < d; i++)\n    b[i] = du();\n  for (i = 0; i < e; i++)\n    c[i] = du();\n  paib();\n  paic();\n  add();\n  show();\n  return 0;\n}\nint du() {\n  int x;\n  cin >> x;\n  return x;\n}\nint paib() {\n  int j, k, r;\n  for (j = 0; j < d - 1; j++) {\n    for (k = j + 1; k < d; k++) {\n      if (b[k] < b[j]) {\n        r = b[k];\n        b[k] = b[j];\n        b[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint paic() {\n  int j, k, r;\n  for (j = 0; j < e - 1; j++) {\n    for (k = j + 1; k < e; k++) {\n      if (c[k] < c[j]) {\n        r = c[k];\n        c[k] = c[j];\n        c[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint add() {\n  int i;\n  for (i = 0; i < d; i++)\n    f[i] = b[i];\n  for (i = 0; i < e; i++)\n    f[i + d] = c[i];\n  return 0;\n}\nint show() {\n  int i;\n  for (i = 0; i < d + e - 1; i++)\n    printf(\"%d \", f[i]);\n  printf(\"%d\", f[d + e - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "13843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s(int m);\nint p(int m, int i, int a[100]);\nvoid e(int i, int c[100], int d[100], int m, int n);\nint main() {\n  int i, m, n, a[100], b[100], c[100], d[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    a[i] = s(i);\n  for (i = 0; i < n; i++)\n    b[i] = s(i);\n  for (i = 0; i < m; i++)\n    c[i] = p(m, i, a);\n  for (i = 0; i < n; i++)\n    d[i] = p(n, i, b);\n  for (i = 0; i < m + n; i++)\n    e(i, c, d, m, n);\n  return 0;\n}\nint s(int m) {\n  int a[100];\n  scanf(\"%d\", &a[m]);\n  return a[m];\n}\nint p(int m, int i, int a[100]) {\n  int p, q, n;\n  for (p = 0; p < m; p++) {\n    for (q = 0; q < m - 1; q++) {\n      if (a[q] > a[q + 1]) {\n        n = a[q];\n        a[q] = a[q + 1];\n        a[q + 1] = n;\n      }\n    }\n  }\n  return a[i];\n}\nvoid e(int i, int c[100], int d[100], int m, int n) {\n  if (i == 0)\n    printf(\"%d\", c[0]);\n  if (i > 0 && i < m)\n    printf(\" %d\", c[i]);\n  if (i >= m)\n    printf(\" %d\", d[i - m]);\n}\n"}
{"label": "8", "index": "13844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint m, n;\n\nvoid input() {\n  int i, j;\n  scanf(\"%d%d\", &m, &n);\n  scanf(\"\\n\");\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n - 1; j++)\n    scanf(\"%d \", &b[j]);\n  scanf(\"%d\", &b[n - 1]);\n  return;\n}\n\nvoid sort(int array[], int k) {\n  int i, j, t;\n  for (j = 0; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (array[i] > array[i + 1]) {\n        t = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = t;\n      }\n  return;\n}\n\nvoid combine() {\n  int i, j = 0;\n  for (i = m; i < m + n; i++) {\n    a[i] = b[j];\n    j++;\n  }\n  return;\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n  return;\n}\n\nint main() {\n  input();\n  sort(a, m - 1);\n  sort(b, n - 1);\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], i, j, n, m;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (b[j] < b[i]) {\n        t = b[j];\n        b[j] = b[i];\n        b[i] = t;\n      }\n}\nvoid add() {\n  for (i = m, j = 0; j < n; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print() {\n  for (i = 0; i < m + n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  read();\n  sort();\n  add();\n  print();\n}\n"}
{"label": "8", "index": "13846", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint A[100];\nint An;\nint B[100];\nint Bn;\n\nvoid getAn() { scanf(\"%d \", &An); }\n\nvoid getBn() { cin >> Bn; }\n\nvoid sortA() {\n  for (int i = 0; i < An; i++) {\n    cin >> A[i];\n  }\n\n  sort(A, A + An);\n}\n\nvoid sortB() {\n  for (int i = 0; i < Bn; i++) {\n    cin >> B[i];\n  }\n\n  sort(B, B + Bn);\n}\n\nvoid OutA() {\n  for (int i = 0; i < An; i++) {\n    cout << A[i] << \" \";\n  }\n}\n\nvoid OutB() {\n  for (int i = 0; i < Bn; i++) {\n    cout << B[i];\n    if (i != Bn - 1)\n      cout << ' ';\n  }\n}\n\nint main() {\n  getAn();\n  getBn();\n  sortA();\n  sortB();\n  OutA();\n  OutB();\n  return 0;\n}\n"}
{"label": "8", "index": "13847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sr(int a[100], int b[100], int x, int y);\n  void px(int a[100], int x);\n  void hb(int a[100], int b[100], int c[200], int x, int y);\n  void sc(int a[200], int x);\n  int a[100], b[100], c[200], x, y;\n  scanf(\"%d%d\", &x, &y);\n  sr(a, b, x, y);\n  px(a, x);\n  px(b, y);\n  hb(a, b, c, x, y);\n  sc(c, x + y);\n  return 0;\n}\nvoid sr(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid px(int a[100], int x) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hb(int a[100], int b[100], int c[200], int x, int y) {\n  int i;\n  for (i = 0; i < x + y; i++) {\n    if (i < x)\n      c[i] = a[i];\n    else\n      c[i] = b[i - x];\n  }\n}\nvoid sc(int c[200], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13848", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *change(int x[100], int y);\n  int a1, a2, i;\n  int *pt1, *pt2;\n  int b[100], c[100];\n  scanf(\"%d%d\", &a1, &a2);\n  for (i = 0; i < a1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pt1 = change(b, a1);\n  for (i = 0; i < a2; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  pt2 = change(c, a2);\n  for (i = 0; i < a1; i++) {\n    printf(\"%d \", *(pt1 + i));\n  }\n  for (i = 0; i < a2 - 1; i++) {\n    printf(\"%d \", *(pt2 + i));\n  }\n  printf(\"%d\", *(pt2 + a2 - 1));\n  return 0;\n}\nint *change(int x[100], int y) {\n  int j, k, temp = 0;\n  for (j = 1; j < y; j++) {\n    for (k = 0; k < y - j; k++) {\n      if (x[k] > x[k + 1]) {\n        temp = x[k + 1];\n        x[k + 1] = x[k];\n        x[k] = temp;\n      }\n    }\n  }\n  return (x);\n}\n"}
{"label": "8", "index": "13849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[1000];\nint b[1000];\nint c[2000];\nint i;\nint j;\n\nvoid f1() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n}\nvoid f2() {\n  int t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3() {\n  int s;\n  for (s = 0, i = 0; s < m, i < m; s++, i++)\n    c[s] = a[i];\n  for (s = m, j = 0; s < m + n - 2, j < n; s++, j++)\n    c[s] = b[j];\n}\nvoid f4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= m + n - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "13850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  void func(int, int);\n  scanf(\"%d%d\", &a, &b);\n  func(a, b);\n  return 0;\n}\nvoid func(int x, int y) {\n  int i, j, t, q;\n  int a[100], b[100];\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0, q = 0; i < y; i++) {\n    if (q < y - 1) {\n      printf(\"%d \", b[i]);\n      q = q + 1;\n    } else\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "13851", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[100], n, m, i, j, k;\n\nvoid get_array();\nvoid sort_array();\nvoid combine_array();\nvoid print_array();\n\nint main() {\n  get_array();\n\n  sort_array();\n\n  combine_array();\n\n  print_array();\n\n  return 0;\n}\n\nvoid get_array() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid sort_array() {\n  int temp = 0;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine_array() {\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\nvoid print_array() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n}\n"}
{"label": "8", "index": "13852", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m1, n1;\n  cin >> m1 >> n1;\n  int m = m1, n = n1;\n  int a[m];\n  int b[n];\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1] << endl;\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13853", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[100], b[100];\nvoid scanf() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n}\nvoid merge() {\n  int i;\n  for (i = n + 1; i <= n + m; i++)\n    a[i] = b[i - n];\n}\nvoid print() {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= n + m; i++)\n    cout << ' ' << a[i];\n  printf(\"\\n\");\n}\nint main() {\n  scanf();\n  sort();\n  merge();\n  print();\n}\n"}
{"label": "8", "index": "13854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint m, n;\nint i, j, t;\nvoid read() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[j] < a[i]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] < b[i]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid cat() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid print() {\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  read();\n  sort();\n  cat();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13855", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint len1, len2;\nint *sz1, *sz2;\n\nvoid read() {\n  int i;\n  scanf(\"%d%d\", &len1, &len2);\n  sz1 = (int *)malloc(1000 * (len1 + len2));\n  sz2 = (int *)malloc(1000 * len2);\n\n  for (i = 0; i < len1; i++)\n    scanf(\"%d\", sz1 + i);\n  for (i = 0; i < len2; i++)\n    scanf(\"%d\", sz2 + i);\n}\nvoid sort() {\n  int i, j, temp;\n\n  for (i = 0; i < len1; i++) {\n    for (j = i + 1; j < len1; j++)\n      if (sz1[i] > sz1[j]) {\n        temp = sz1[i];\n        sz1[i] = sz1[j];\n        sz1[j] = temp;\n      }\n  }\n  for (i = 0; i < len2; i++) {\n    for (j = i + 1; j < len2; j++)\n      if (sz2[i] > sz2[j]) {\n        temp = sz2[i];\n        sz2[i] = sz2[j];\n        sz2[j] = temp;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < len2; i++)\n    sz1[len1 + i] = sz2[i];\n}\nvoid print() {\n  int i;\n  printf(\"%d\", sz1[0]);\n  for (i = 1; i < len1 + len2; i++)\n    printf(\" %d\", sz1[i]);\n\n  printf(\" \");\n}\n\nint main() {\n  read();\n  sort();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *input(int n), *a, *b, *c, n1, n2;\n  void paixu(int *a, int n), display(int *c, int n);\n  int *hebing(int *a, int *b, int n1, int n2);\n  scanf(\"%d %d\", &n1, &n2);\n  a = input(n1);\n  b = input(n2);\n  printf(\"\\n\");\n  paixu(a, n1);\n  paixu(b, n2);\n  c = hebing(a, b, n1, n2);\n  display(c, n1 + n2);\n  return 0;\n}\n\nint *input(int n) {\n  int *p, i;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return (p);\n}\n\nvoid paixu(int *a, int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n  }\n}\n\nint *hebing(int *a, int *b, int n1, int n2) {\n  int *p, i, j;\n  p = (int *)malloc((n1 + n2) * sizeof(int));\n  for (i = 0; i < n1; i++)\n    p[i] = a[i];\n\n  for (j = 0; j < n2; j++)\n    p[n1 + j] = b[j];\n\n  return (p);\n}\n\nvoid display(int *c, int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint len1, len2;\nint *sz1, *sz2;\n\nvoid read() {\n  int i;\n  cin >> len1 >> len2;\n  sz1 = (int *)malloc(1000 * (len1 + len2));\n  sz2 = (int *)malloc(1000 * len2);\n\n  for (i = 0; i < len1; i++)\n    scanf(\"%d\", sz1 + i);\n  for (i = 0; i < len2; i++)\n    scanf(\"%d\", sz2 + i);\n}\nvoid sort() {\n  int i, j, temp;\n\n  for (i = 0; i < len1; i++) {\n    for (j = i + 1; j < len1; j++)\n      if (sz1[i] > sz1[j]) {\n        temp = sz1[i];\n        sz1[i] = sz1[j];\n        sz1[j] = temp;\n      }\n  }\n  for (i = 0; i < len2; i++) {\n    for (j = i + 1; j < len2; j++)\n      if (sz2[i] > sz2[j]) {\n        temp = sz2[i];\n        sz2[i] = sz2[j];\n        sz2[j] = temp;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < len2; i++) {\n    sz1[len1 + i] = sz2[i];\n  }\n}\nvoid print() {\n  int i;\n  cout << sz1[0];\n  for (i = 1; i < len1 + len2; i++)\n    printf(\" %d\", sz1[i]);\n\n  printf(\" \");\n}\n\nint main() {\n  read();\n  sort();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint comp(const void *a, const void *b);\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  qsort(a, n, sizeof(int), comp);\n  qsort(b, m, sizeof(int), comp);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    cout << b[i];\n    if (i < m - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n"}
{"label": "8", "index": "13859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint paixu(int n, int m) {\n  int i, j, num;\n  int shuzu[1000];\n  for (i = 1; i <= n + m; i++) {\n    scanf(\"%d \", &num);\n    shuzu[i] = num;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = n + 1; i <= n + m; i++) {\n    for (j = n + m - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = 1; i <= n + m; i++) {\n    if (i == m + n) {\n      cout << shuzu[i];\n    } else {\n      cout << shuzu[i] << \" \";\n    }\n  }\n  return 0;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  paixu(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n}\nvoid f(int a[], int b[], int an, int bn) {\n  turn(a, an);\n  printf(\" \");\n  turn(b, bn);\n}\nint main() {\n  int i, an, bn, a[100], b[100];\n  scanf(\"%d%d\", &an, &bn);\n  for (i = 0; i < an; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bn; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, b, an, bn);\n  return 0;\n}\n"}
{"label": "8", "index": "13861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100], c[200];\nint x, y;\n\nvoid oh()\n\n{\n  int i;\n  cin >> x >> y;\n\n  for (i = 0; i < x - 1; i++)\n    scanf(\"%d \", &a[i]);\n\n  scanf(\"%d\\n\", &a[x - 1]);\n\n  for (i = 0; i < y - 1; i++)\n    scanf(\"%d \", &b[i]);\n\n  cin >> b[y - 1];\n}\n\nvoid ba() {\n\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n\n  for (i = 0; i < y; i++)\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n}\n\nvoid zha() {\n\n  int i;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n}\n\nvoid hei() {\n\n  int i;\n  for (i = 0; i < x + y - 1; i++) {\n\n    printf(\"%d \", c[i]);\n  }\n\n  printf(\"%d\", c[x + y - 1]);\n}\n\nint main() {\n  oh();\n  ba();\n  zha();\n  hei();\n  return 0;\n}\n"}
{"label": "8", "index": "13862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int n, int a[1000]) {\n  if (n == 0)\n    return;\n  int x, i;\n  int min = a[0];\n  for (x = 0; x < n; x++) {\n    if (a[x] <= min)\n      min = a[x];\n  }\n  if (n > 1)\n    cout << min << ' ';\n  if (n == 1)\n    cout << min;\n  for (x = 0; x < n; x++) {\n    if (a[x] == min)\n      break;\n  }\n  for (i = x; i < n - 1; i++)\n    a[i] = a[i + 1];\n  return paixu(n - 1, a);\n}\nint main() {\n  int m1, m2, x;\n  int s[1000];\n  memset(s, 0, sizeof(s));\n  cin >> m1 >> m2;\n  for (x = 0; x < m1; x++)\n    cin >> s[x];\n  paixu(m1, s);\n  cout << ' ';\n  memset(s, 0, sizeof(s));\n  for (x = 0; x < m2; x++)\n    cin >> s[x];\n  paixu(m2, s);\n  return 0;\n}\n"}
{"label": "8", "index": "13863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid a(int k, int n);\nvoid a(int k, int n) {\n  int e[300] = {0}, f[300] = {0}, i = 0, j = 0, t = 0;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &e[i]);\n  for (j = 0; j < n; j++)\n    cin >> f[j];\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1; j++) {\n      if (e[j] > e[j + 1]) {\n        t = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (f[j] > f[j + 1]) {\n        t = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = t;\n      }\n    }\n  }\n  for (i = k, j = 0; i < k + n; i++, j++)\n    e[i] = f[j];\n\n  for (i = 0; i < n + k; i++) {\n    cout << e[i];\n    if (i != n + k - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int k = 0, n = 0;\n\n  scanf(\"%d %d\", &k, &n);\n  a(k, n);\n}\n"}
{"label": "8", "index": "13864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m[100], n[100], *p, *q, a, b;\nvoid input() {\n  p = m;\n  q = n;\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++, p++) {\n    scanf(\"%d\", p);\n  }\n  for (i = 0; i < b; i++, q++) {\n    scanf(\"%d\", q);\n  }\n  p = m;\n  q = n;\n}\nvoid sort(int *p, int a) {\n  int i, j, temp;\n  for (i = 0; i < a - 1; i++) {\n    for (j = 0; j < a - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid mix() {\n  int i;\n  for (i = 0; i < b; i++) {\n    p[a + i] = q[i];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < a + b - 1; i++) {\n    printf(\"%d \", *(p++));\n  }\n  cout << *p << \" \";\n}\nint main() {\n  input();\n  sort(p, a);\n  sort(q, b);\n  mix();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20000], b[10000], n, m;\nvoid f1(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int a[], int n) {\n  int i, j;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        int t;\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  f1(a, n);\n  f1(b, m);\n  f2(a, n);\n  f2(b, m);\n  f3(a, b, n, m);\n}\n"}
{"label": "8", "index": "13866", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\n\nvoid scan() {\n  int i;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid order(int N, int p[100]) {\n  int i, j, amount = 0;\n  int min, max;\n  min = p[0];\n  max = p[0];\n  for (i = 0; i < N; i++) {\n    if (p[i] < min)\n      min = p[i];\n    if (p[i] > max)\n      max = p[i];\n  }\n  for (i = min; i <= max; i++) {\n    for (j = 0; j < N; j++) {\n      if (p[j] == i) {\n        if (amount == 0)\n          printf(\"%d\", p[j]);\n        else {\n          printf(\" %d\", p[j]);\n        }\n        amount = amount + 1;\n      }\n    }\n  }\n}\n\nvoid combine(int N, int p[100], int M, int q[100]) {\n  order(N, p);\n  printf(\" \");\n  order(M, q);\n  printf(\"\\n\");\n}\n\nint main() {\n  scan();\n  combine(m, a, n, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13867", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n1 + n2 - 1];\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  combine(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[50], a2[50];\nint main() {\n  void sort(int b[], int n);\n  void scn();\n  void pr(int c[], int m);\n  scn();\n  sort(a1, n1);\n  sort(a2, n2);\n  pr(a1, n1);\n  pr(a2, n2);\n}\nvoid sort(int b[], int n) {\n  int i, j, t;\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n}\nvoid scn() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a1[i]);\n  }\n\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\nvoid pr(int c[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    if (i == m - 1 && c[i] == a2[m - 1])\n      printf(\"%d\", c[i]);\n    else\n      printf(\"%d \", c[i]);\n  }\n}\n"}
{"label": "8", "index": "13869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid mix(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  mix(m, n);\n  return 0;\n}\nvoid mix(int m, int n) {\n  int i, j, a[10000], b[10000], t;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  cout << b[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "13870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, t = 0;\n  int *a, *b;\n  scanf(\"%d %d\", &n, &m);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = t;\n      }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = t;\n      }\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sr();\n  int px(int a[100], int x, int k);\n  void hb(int a[100], int b[100], int x, int y);\n  int i, a[100], b[100], c[200], x, y;\n  x = sr();\n  y = sr();\n  for (i = 0; i < x; i++) {\n    a[i] = sr();\n  }\n  for (i = 0; i < y; i++) {\n    b[i] = sr();\n  }\n  for (i = 0; i < x; i++) {\n    a[i] = px(a, x, i);\n  }\n  for (i = 0; i < y; i++) {\n    b[i] = px(b, y, i);\n  }\n  hb(a, b, x, y);\n  return 0;\n}\nint sr() {\n  int a;\n  scanf(\"%d\", &a);\n  return (a);\n}\nint px(int a[100], int x, int k) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  temp = a[k];\n  return (temp);\n}\nvoid hb(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "13872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) {\n  int x = *(int *)a;\n  int y = *(int *)b;\n  if (x < y) {\n    return -1;\n  }\n  if (x == y) {\n    return 0;\n  }\n  return 1;\n}\n\nvoid initArrays(int *a, int *b, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int *b, int m, int n) {\n  qsort(a, m, sizeof(int), compare);\n  qsort(b, n, sizeof(int), compare);\n}\n\nvoid append(int *a, int *b, int *c, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid print(int *a, int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[i];\n}\n\nint main(int argc, const char *argv[]) {\n\n  int m, n;\n  cin >> m >> n;\n  int a[m];\n  int b[n];\n  initArrays(a, b, m, n);\n  sort(a, b, m, n);\n  int c[m + n];\n  append(a, b, c, m, n);\n  print(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[999] = {0}, b[999] = {0}, c[1999] = {0};\nint m, n;\nvoid f() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank_1() {\n  int i, j, k;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  f();\n  rank_1();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n;\nvoid nem(int num1[100], int num2[100]) {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &num1[i]);\n  for (i = 0; i < n; i++)\n    cin >> num2[i];\n}\nvoid pai(int num[100], int x) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - 1 - j; i++)\n      if (num[i] > num[i + 1]) {\n        t = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t;\n      }\n}\nvoid he(int num1[100], int num2[100], int num[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    num[i] = num1[i];\n  for (i = m; i < m + n; i++) {\n    num[i] = num2[i - m];\n  }\n}\nvoid printnum(int num[100]) {\n  int i;\n  printf(\"%d\", num[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", num[i]);\n}\nint main() {\n  int num[100], num1[100], num2[100];\n  nem(num1, num2);\n  pai(num1, m);\n  pai(num2, n);\n  he(num1, num2, num);\n  printnum(num);\n  return 0;\n}\n"}
{"label": "8", "index": "13875", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint ary1[30], ary2[30];\nint *pt1, *pt2;\n\nvoid input(int array[], int num) {\n  int i;\n  for (i = 0; i < num; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n}\nvoid sort(int *ptr, int num) {\n  int i, j;\n  int temp;\n  for (i = num - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(ptr + j) > *(ptr + j + 1)) {\n        swap(*(ptr + j), *(ptr + j + 1));\n      }\n    }\n  }\n}\nvoid combine(int *ptr1, int *ptr2, int num1, int num2) {\n  int i;\n  ptr1 += num1;\n  for (i = 0; i < num2; i++) {\n    *(ptr1 + i) = *(ptr2 + i);\n  }\n}\nvoid demo(int *pointer, int sum) {\n  int count = 0;\n  while (count != sum) {\n    cout << *pointer;\n    if (count++ != sum - 1) {\n      cout << \" \";\n    }\n    pointer++;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  pt1 = &ary1[0];\n  pt2 = &ary2[0];\n  int m, n;\n  cin >> m >> n;\n  input(ary1, m);\n  input(ary2, n);\n  sort(ary1, m);\n  sort(ary2, n);\n  combine(pt1, pt2, m, n);\n  demo(pt1, m + n);\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "8", "index": "13876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\n\nvoid enter(int array0[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &array0[i]);\n}\n\nvoid sort(int array[], int p1) {\n  int i, j, k;\n  for (i = 0; i < p1 - 1; i++)\n    for (j = 0; j < p1 - 1 - i; j++)\n      if (array[j] > array[j + 1]) {\n        k = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = k;\n      }\n}\n\nvoid paste(int array1[], int array2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = array1[i];\n  for (i = m; i < m + n; i++)\n    c[i] = array2[i - m];\n}\n\nvoid out(int array3[], int p2) {\n  int i;\n  cout << array3[0];\n  for (i = 1; i < p2; i++)\n    printf(\" %d\", array3[i]);\n}\n\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  enter(a, m);\n  enter(b, n);\n  sort(a, m);\n  sort(b, n);\n  paste(a, b);\n  out(c, m + n);\n}\n"}
{"label": "8", "index": "13877", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid com(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nint main() {\n  cin >> n1 >> n2;\n  in(n1, num1);\n  com(n1, num1);\n  in(n2, num2);\n  com(n2, num2);\n  for (int i = 0; i < n1; i++)\n    printf(\"%d \", num1[i]);\n  for (int j = 0; j < n2 - 1; j++)\n    cout << num2[j] << ' ';\n  cout << num2[n2 - 1] << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "13878", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f0(int a[], int x) {\n  int i = 0;\n  for (; i < x; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f1(int a[], int x) {\n  int i, j, s;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n}\nvoid f2(int a[], int b[], int c[], int m, int n) {\n  int i = 0;\n  while (i < m) {\n    c[i] = a[i];\n    i++;\n  }\n  while (i < m + n) {\n    c[i] = b[i - m];\n    i++;\n  }\n}\nint main() {\n  int a[50], b[50], c[100], m, n, i;\n  cin >> m >> n;\n  f0(a, m);\n  f0(b, n);\n  f1(a, m);\n  f1(b, n);\n  f2(a, b, c, m, n);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int c[], int w);\nint main() {\n  int n, m, i, j;\n  int a[10], b[10];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    cin >> b[j];\n  }\n  f(a, n);\n  f(b, m);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  for (j = 0; j < m - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  cout << b[m - 1];\n}\nint f(int c[], int w) {\n  int i, j, k, t;\n  for (i = 0; i < w - 1; i++) {\n    k = i;\n    for (j = i + 1; j < w; j++)\n      if (c[j] < c[k])\n        k = j;\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "13880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint getin(int array[], int num);                          \nint sort(int array[], int num);                           \nint link(int array1[], int array2[], int num1, int num2); \nint main() {\n  int numa, numb, a[1000], b[1000];\n  cin >> numa >> numb;\n  getin(a, numa);\n  getin(b, numb);\n  sort(a, numa);\n  sort(b, numb);\n  link(a, b, numa, numb);\n  return 0;\n}\nint getin(int array[], int num) {\n  for (int i = 0; i < num; i++) {\n    cin >> array[i];\n  }\n  return (array[num]);\n}\nint sort(int array[], int num) \n{\n  int temp;\n  for (int i = 0; i < num - 1; i++) {\n    for (int j = 0; j < num - i - 1; j++) {\n      if (array[j] > array[j + 1]) {\n        temp = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = temp;\n      }\n    }\n  }\n  return array[num];\n}\nint link(int array1[], int array2[], int num1, int num2) {\n  cout << array1[0];\n  for (int i = 1; i < num1; i++)\n    cout << \" \" << array1[i];\n  for (int i = 0; i < num2; i++)\n    cout << \" \" << array2[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100];\nvoid insert(void) {\n  int i = 0;\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"\\n\");\n  for (i = m; i < m + n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid px(int *p) {\n  int i, j, b = 0;\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  for (i = m; i < m + n; i++) {\n    for (j = m + n - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  printf(\"%d\", *(p + 0));\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", *(p + i));\n  }\n}\nint main() {\n  insert();\n  px(a);\n}\n"}
{"label": "8", "index": "13882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void print(int a[], int b[]);\n  int a[100], b[100];\n  print(a, b);\n  return 0;\n}\n\nvoid print(int a[100], int b[100]) {\n  int n, m, i, j, k, l = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i == m - 1)\n      break;\n    printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13883", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid o(int n) {\n  int a[n];\n  int i = 0, j = 0, x;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    while (j < n - 1) {\n      if (a[j] > a[j + 1])\n        x = a[j], a[j] = a[j + 1], a[j + 1] = x;\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  j = 0;\n  while (j < n) {\n    printf(\"%d\", a[j]);\n    if (j < n - 1)\n      printf(\" \");\n    j++;\n  }\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  o(m);\n  printf(\" \");\n  o(n);\n}\n"}
{"label": "8", "index": "13884", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint *p1 = a, *p2 = b;\nint m, n;\nint *p2m = &m, *p2n = &n;\n\nvoid funcofa(int *p1, int *p2, int *p2m, int *p2n) {\n  scanf(\"%d%d\", p2m, p2n);\n  int i;\n  for (i = 1; i <= *p2m; i++) {\n    scanf(\"%d\", p1 + i - 1);\n  }\n  for (i = 1; i <= *p2n; i++) {\n    scanf(\"%d\", p2 + i - 1);\n  }\n}\n\nvoid funcofb(int *p1, int *p2, int *p2m, int *p2n) {\n  int i, j;\n  int temp;\n  for (i = 1; i <= *p2m; i++) {\n    for (j = 1; j < *p2m; j++) {\n      if (*(p1 + j - 1) > *(p1 + j)) {\n        temp = *(p1 + j);\n        *(p1 + j) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n  for (i = 1; i <= *p2n; i++) {\n    for (j = 1; j < *p2n; j++) {\n      if (*(p2 + j - 1) > *(p2 + j)) {\n        temp = *(p2 + j);\n        *(p2 + j) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n}\n\n\nvoid funcofc(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  for (i = 1; i <= *p2n; i++) {\n    *(p1 + (*p2m) + i - 1) = *(p2 + i - 1);\n  }\n}\n\nvoid funcofd(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  printf(\"%d\", *p1);\n  for (i = 2; i <= *p2m + *p2n; i++) {\n    printf(\" %d\", *(p1 - 1 + i));\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  funcofa(p1, p2, p2m, p2n);\n  funcofb(p1, p2, p2m, p2n);\n  funcofc(p1, p2, p2m, p2n);\n  funcofd(p1, p2, p2m, p2n);\n}\n"}
{"label": "8", "index": "13885", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100];\nint m, n;\nvoid shuru(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\nvoid hebing(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(void) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  shuru();\n  paixu(a, b);\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], m, n;\nint c[200];\nint shuru() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return 0;\n}\nint paixu() {\n  int i = 0, j = 0, t = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint hebing() {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return 0;\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < m + n; i++) {\n    cout << \" \" << c[i];\n  }\n  return 0;\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x = 0, y = 0;\nvoid in() {\n  scanf(\"%d %d \", &x, &y);\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n}\nvoid sortnum() {\n  sort(a, a + x);\n  sort(b, b + y);\n}\nvoid cat() {\n  for (int i = x; i < 100; i++)\n    a[i] = b[i - x];\n}\nvoid out() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < x + y; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  in();\n  sortnum();\n  cat();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100], m, n;\nvoid sca() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid in(int a[], int b[]) {\n  int i;\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid pri() {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n}\nint main() {\n  sca();\n  order(a, b);\n  in(a, b);\n  pri();\n}\n"}
{"label": "8", "index": "13889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint a_n, b_n, i;\nvoid read() {\n  scanf(\"%d %d\", &a_n, &b_n);\n  for (i = 0; i < a_n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < b_n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int a_n, int b[], int b_n) {\n  int i, j, key;\n  for (i = 1; i < a_n; i++) {\n    key = a[i];\n    j = i - 1;\n    while (a[j] > key && j >= 0) {\n      a[j + 1] = a[j];\n      j--;\n    }\n    a[j + 1] = key;\n  }\n  for (i = 1; i < b_n; i++) {\n    key = b[i];\n    j = i - 1;\n    while (b[j] > key && j >= 0) {\n      b[j + 1] = b[j];\n      j--;\n    }\n    b[j + 1] = key;\n  }\n}\nvoid merge(int a[], int a_n, int b[], int b_n) {\n  int i;\n  for (i = 0; i < b_n; i++)\n    a[a_n + i] = b[i];\n}\nvoid write() {\n  int i;\n  for (i = 0; i < a_n + b_n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\nint main() {\n  read();\n  sort(a, a_n, b, b_n);\n  merge(a, a_n, b, b_n);\n  write();\n  return 0;\n}\n"}
{"label": "8", "index": "13890", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid f2(int a[], int b[], int n, int m) {\n  int i, j, t;\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = 1; j < m; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    c[i] = a[i];\n  for (i = 1; i <= m; i++)\n    c[i + n] = b[i];\n}\nvoid f4(int c[], int n, int m) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    cout << c[i] << ' ';\n  cout << c[m + n];\n}\nint main() {\n  int a[99], b[99], c[200], n, m;\n  cin >> n >> m;\n  f1(a, b, n, m);\n  f2(a, b, n, m);\n  f3(a, b, c, n, m);\n  f4(c, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "13891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\nint ans[200];\nvoid read(int a[], int b[]) {\n  cin >> m;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int m) {\n  int temp;\n  for (int i = 1; i < m; i++) {\n    for (int j = i + 1; j <= m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[]) {\n  for (int i = 1; i <= m; i++)\n    ans[i] = a[i];\n  for (int i = 1; i <= n; i++)\n    ans[m + i] = b[i];\n}\nvoid out(int a[], int m) {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  read(a, b);\n  sort(a, m);\n  sort(b, n);\n  add(a, b);\n  out(ans, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13892", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input();\nvoid arrange();\nvoid add();\nvoid output();\nint a[100], b[100], c[200], n1, n2;\nint main() {\n  input();\n  arrange();\n  add();\n  output();\n  return 0;\n}\nvoid input() {\n  int i, j;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n2; j++)\n    cin >> b[j];\n}\n\nvoid arrange() {\n  int i, j, temp;\n  for (i = 0; i < n1; i++)\n    for (j = i; j < n1; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < n2; i++)\n    for (j = i; j < n2; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid add() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    c[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    c[i] = b[i - n1];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", c[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "8", "index": "13893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20], b[20], c[40], m, n, i, j, temp;\nint main() {\n  void putin(int a[20], int b[20]);\n  void exchange(int a[20], int b[20]);\n  void together(int a[20], int b[20]);\n  void putout(int c[40]);\n  putin(a, b);\n  exchange(a, b);\n  together(a, b);\n  putout(c);\n}\nvoid putin(int a[20], int b[20]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid exchange(int a[20], int b[20]) {\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(int a[20], int b[20]) {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++) {\n    c[m + i] = b[i];\n  }\n}\nvoid putout(int c[40]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m + n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "13894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], m, n;\n  void read(int a[], int n);\n  void sort(int a[], int n);\n  void print(int a[], int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  sort(a, m);\n  sort(b, n);\n  print(a, m);\n  printf(\" \");\n  print(b, n);\n}\nvoid read(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid print(int a[], int n) {\n  int i;\n  for (i = 0;; i++) {\n    printf(\"%d\", a[i]);\n    n--;\n    if (n)\n      printf(\" \");\n    else\n      break;\n  }\n}\n"}
{"label": "8", "index": "13895", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nvoid ccin(int m, int n);\nvoid turn(int c[1000], int t);\nvoid ccout(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  ccin(m, n);\n  turn(a, m);\n  turn(b, n);\n  ccout(m, n);\n  return 0;\n}\nvoid ccin(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid turn(int c[1000], int t) {\n  int i, j, k;\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n}\nvoid ccout(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1] << endl;\n}\n"}
{"label": "8", "index": "13896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++)\n    scanf(\"%d\", &b[j]);\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  input();\n\n  paixu();\n\n  hebing();\n\n  show();\n}\n"}
{"label": "8", "index": "13897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n1, n2, a[200], b[100];\n\nvoid readNum() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Bubble() {\n  int t, i, j;\n  for (i = n1 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n2 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid gether() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\n\nvoid printNum() {\n  int i;\n  for (i = 0; i < n1 + n2; i++)\n    cout << a[i] << (i < n1 + n2 - 1) ? ' ' : '\\n';\n}\n\nint main() {\n  readNum();\n  Bubble();\n  gether();\n  printNum();\n  return 0;\n}\n"}
{"label": "8", "index": "13898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, k, l, m, b[20], c[20];\nvoid f() { scanf(\"%d%d\", &l, &k); }\nvoid g(int d[20], int s) {\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid h(int a[20], int n, int p) {\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  if (p == 1)\n    printf(\"%d \", a[n - 1]);\n  if (p == 2)\n    printf(\"%d\\n\", a[n - 1]);\n}\nint main() {\n  f();\n  g(b, l);\n  g(c, k);\n  h(b, l, 1);\n  h(c, k, 2);\n}\n"}
{"label": "8", "index": "13899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[2][11] = {0};\nint geshu1, geshu2;\nint hanshu1() {\n  int i;\n  cin >> geshu1 >> geshu2;\n  for (i = 0; i < geshu1; i++)\n    cin >> a[0][i];\n  for (i = 0; i < geshu2; i++)\n    cin >> a[1][i];\n  return 0;\n}\nint hanshu2() {\n  int i, j, k;\n  for (i = geshu1 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[0][j] > a[0][j + 1]) {\n        k = a[0][j];\n        a[0][j] = a[0][j + 1];\n        a[0][j + 1] = k;\n      }\n    }\n  }\n  for (i = geshu2 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[1][j] > a[1][j + 1]) {\n        k = a[1][j];\n        a[1][j] = a[1][j + 1];\n        a[1][j + 1] = k;\n      }\n    }\n  }\n  return 0;\n}\nint hanshu3() {\n  int i;\n  for (i = 0; i < geshu2; i++)\n    a[0][geshu1 + i] = a[1][i];\n  return 0;\n}\nint hanshu4() {\n  int i;\n  cout << a[0][0];\n  for (i = 1; i < geshu1 + geshu2; i++)\n    cout << \" \" << a[0][i];\n  return 0;\n}\nint main() {\n  hanshu1();\n  hanshu2();\n  hanshu3();\n  hanshu4();\n  return 0;\n}\n"}
{"label": "8", "index": "13900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][2];\nint n[2], i, j, k, t;\nint order(int j) {\n  for (i = 1; i < n[j]; i++)\n    for (k = i + 1; k <= n[j]; k++) {\n      if (a[i][j] > a[k][j]) {\n        a[i][j] = a[i][j] ^ a[k][j];\n        a[k][j] = a[i][j] ^ a[k][j];\n        a[i][j] = a[i][j] ^ a[k][j];\n      }\n    }\n}\nint main() {\n  cin >> n[0] >> n[1];\n  for (i = 1; i <= n[0]; i++)\n    cin >> a[i][0];\n  for (i = 1; i <= n[1]; i++)\n    cin >> a[i][1];\n  order(0);\n  order(1);\n  for (i = 1; i <= n[0]; i++)\n    cout << a[i][0] << ' ';\n  for (i = 1; i < n[1]; i++)\n    cout << a[i][1] << ' ';\n  cout << a[n[1]][1] << endl;\n\n  return 0;\n}\n"}
{"label": "8", "index": "13901", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint l1, l2;\nint a[2000], b[1000];\nint temp;\nvoid cins(void) {\n  cin >> l1 >> l2;\n  for (int i = 1; i <= l1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= l2; i++) {\n    cin >> b[i];\n  }\n}\nvoid sorts(void) {\n  for (int i = 1; i < l1; i++) {\n    for (int j = 1; j <= l1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i < l2; i++) {\n    for (int j = 1; j <= l2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(void) {\n  for (int i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n}\nvoid couts(void) {\n  printf(\"%d\", a[1]);\n  for (int i = 2; i <= l1 + l2; i++) {\n    cout << \" \" << a[i];\n  }\n  printf(\"\\n\");\n}\nint main(void) {\n  cins();\n  sorts();\n  together();\n  couts();\n  return 0;\n}\n"}
{"label": "8", "index": "13902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\nvoid link(int array1[], int array2[], int m, int n) {\n  int i;\n  for (i = m; i < m + n; i++)\n    array1[i] = array2[i - m];\n}\n\nint main() {\n  int a[40], b[20], n1, n2, i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, n1);\n  sort(b, n2);\n  link(a, b, n1, n2);\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  if (i == n1 + n2 - 1)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort(int a[], int n);\nint main() {\n  int m, n, i, j, a[100], b[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  sort(a, m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n\n  sort(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\nvoid sort(int a[], int n) {\n  int i, j, index, temp;\n\n  for (i = 0; i < n - 1; i++) {\n\n    index = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[index] > a[j])\n        index = j;\n    }\n    temp = a[i];\n    a[i] = a[index];\n    a[index] = temp;\n  }\n}\n"}
{"label": "8", "index": "13904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint array_a[100], array_b[100], n_a, n_b;\nvoid input() {\n  int i;\n\n  scanf(\"%d%d\", &n_a, &n_b);\n  for (i = 0; i < n_a; i++)\n    scanf(\"%d\", &array_a[i]);\n  for (i = 0; i < n_b; i++)\n    scanf(\"%d\", &array_b[i]);\n}\nvoid order() {\n  int i, j, temp;\n\n  for (i = 1; i < n_a; i++)\n    for (j = 1; j < n_a + 1 - i; j++)\n      if (array_a[j] < array_a[j - 1]) {\n        temp = array_a[j];\n        array_a[j] = array_a[j - 1];\n        array_a[j - 1] = temp;\n      }\n  for (i = 1; i < n_b; i++)\n    for (j = 1; j < n_b - i + 1; j++)\n      if (array_b[j] < array_b[j - 1]) {\n        temp = array_b[j];\n        array_b[j] = array_b[j - 1];\n        array_b[j - 1] = temp;\n      }\n}\nvoid catenate() {\n  int i;\n  for (i = 0; i < n_b; i++)\n    array_a[n_a + i] = array_b[i];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < n_a + n_b; i++)\n    cout << array_a[i] << (i == n_a + n_b - 1) ? '\\n' : ' ';\n}\nint main() {\n  input();\n  order();\n  catenate();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\n\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid order(int N, int p[100]) {\n  int i, j, amount = 0;\n  int min, max;\n  min = p[0];\n  max = p[0];\n  for (i = 0; i < N; i++) {\n    if (p[i] < min)\n      min = p[i];\n    if (p[i] > max)\n      max = p[i];\n  }\n  for (i = min; i <= max; i++) {\n    for (j = 0; j < N; j++) {\n      if (p[j] == i) {\n        if (amount == 0)\n          printf(\"%d\", p[j]);\n        else\n          printf(\" %d\", p[j]);\n        amount = amount + 1;\n      }\n    }\n  }\n}\n\nvoid combine(int N, int p[100], int M, int q[100]) {\n  order(N, p); \n  printf(\" \");\n  order(M, q);\n  printf(\"\\n\");\n}\n\nint main() {\n  scan();\n  combine(m, a, n, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, x, y, a[10], b[10], c[20];\nvoid array_1() {\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid row() {\n  int t;\n  for (i = 0; i < x; i++) {\n    for (j = i; j < x; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < y; i++) {\n    for (j = i; j < y; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  for (i = 0; i < x; i++) {\n    c[i] = a[i];\n  }\n  for (i = x; i < (x + y); i++) {\n    c[i] = b[i - x];\n  }\n}\n\nvoid print() {\n  for (i = 0; i < (x + y); i++) {\n    if (i != (x + y - 1)) {\n      printf(\"%d \", c[i]);\n    } else\n      printf(\"%d \", c[i]);\n  }\n}\n\nint main() {\n  array_1();\n  row();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, j, t, a[100], b[100], c = 0;\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &b[i]);\n  for (j = 0; j <= m - 2; j++)\n    for (i = 0; i <= m - 2 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j <= n - 2; j++)\n    for (i = 0; i <= n - 2 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i <= m - 1; i++, c++) {\n    if (c)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\" %d\", b[i]);\n  printf(\"\\n\");\n  return (0);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  f(m, n);\n}\n"}
{"label": "8", "index": "13908", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x[200], y[200], m, n;\nvoid sca(void) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &x[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &y[i]);\n  }\n}\n\nvoid bubble(\n    int a[],\n    int n) \n           \n{\n  int i, j, b;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n}\n\nvoid bing(int a[], int l1, int b[], int l2) {\n  int i, j, z[500];\n  for (i = 0; i < l1; i++)\n    z[i] = a[i];\n  for (j = 0; i < (l1 + l2); j++, i++)\n    z[i] = b[j];\n  printf(\"%d\", z[0]);\n  for (i = 1; i < (l1 + l2); i++)\n    printf(\" %d\", z[i]);\n}\n\nint main() {\n  sca();\n  bubble(x, m);\n  bubble(y, n);\n  bing(x, m, y, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000];\nvoid qsort(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = a[(i + j) / 2];\n  while (i <= j) {\n    while (a[i] < x)\n      i++;\n    while (x < a[j])\n      j--;\n    if (i <= j) {\n      k = a[i];\n      a[i] = a[j];\n      a[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort(i, r);\n  if (l < j)\n    qsort(l, j);\n}\n\nvoid qsort2(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = (i + j) / 2;\n  while (i < j) {\n    while (b[i] < b[x])\n      i++;\n    while (b[x] < b[j])\n      j--;\n    if (i <= j) {\n      k = b[i];\n      b[i] = b[j];\n      b[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort2(i, r);\n  if (l < j)\n    qsort2(l, j);\n}\n\nvoid input() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 1; i <= n; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i < m; i++)\n    printf(\"%d \", b[i]);\n  cout << b[m] << endl;\n}\n\nint main() {\n  input();\n  qsort(1, n);\n  qsort2(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guochen(int array[], int n) {\n  int a, i, j;\n  for (a = 0; a < n; a++)\n    scanf(\"%d\", &array[a]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[i]) {\n        int k;\n        k = array[i];\n        array[i] = array[j];\n        array[j] = k;\n      }\n    }\n  }\n}\nvoid shuchu(int one[], int n, int two[], int m) {\n  int i, j;\n  printf(\"%d\", one[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", one[i]);\n  for (j = 0; j < m; j++)\n    printf(\" %d\", two[j]);\n}\nint main() {\n  int n, m, one[100], two[100];\n  scanf(\"%d %d\", &n, &m);\n  guochen(one, n);\n  guochen(two, m);\n  shuchu(one, n, two, m);\n  return 0;\n}\n"}
{"label": "8", "index": "13911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint s1[100] = {0};\nint s2[100] = {0};\nint s3[200] = {0};\nint a = 0, b = 0;\n\nvoid read() {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> s1[i];\n  }\n  for (int i = 0; i < b; i++) {\n    scanf(\"%d \", &s2[i]);\n  }\n}\n\nvoid sort1() {\n  for (int i = 0; i < a - 1; i++)\n    for (int j = i + 1; j < a; j++) {\n      if (s1[i] > s1[j]) {\n        int temp = s1[i];\n        s1[i] = s1[j];\n        s1[j] = temp;\n      }\n    }\n}\n\nvoid sort2() {\n  for (int i = 0; i < b - 1; i++)\n    for (int j = i + 1; j < b; j++) {\n      if (s2[i] > s2[j]) {\n        int temp = s2[i];\n        s2[i] = s2[j];\n        s2[j] = temp;\n      }\n    }\n}\n\nvoid add() {\n  for (int i = 0; i < a; i++)\n    s3[i] = s1[i];\n  for (int i = 0; i < b; i++)\n    s3[i + a] = s2[i];\n}\n\nvoid write() {\n  for (int i = 0; i < a + b - 1; i++) {\n    cout << s3[i] << ' ';\n  }\n  cout << s3[a + b - 1] << endl;\n}\nint main() {\n  read();\n  sort1();\n  sort2();\n  add();\n  write();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m;\nvoid f1(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(int a[1000], int b[1000]) {\n  int i, j, t;\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (n - 1); i > j; i--) {\n      if (a[i] < a[i - 1]) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (m - 1); i > j; i--) {\n      if (b[i] < b[i - 1]) {\n        t = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n}\nvoid f4(int a[1000]) {\n  int i;\n  for (i = 0; i < (n + m); i++) {\n    cout << a[i];\n    if (i != (n + m - 1))\n      printf(\" \");\n  }\n}\nint main() {\n  int a[1000], b[1000];\n  cin >> n >> m;\n  f1(a, b);\n  f2(a, b);\n  f3(a, b);\n  f4(a);\n}\n"}
{"label": "8", "index": "13913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint duru(int a[], int l) {\n  int i;\n  for (i = 1; i <= l; i++) {\n    cin >> a[i];\n  }\n  return 1;\n}\nint paixu(int a[], int l) {\n  int i, j, p;\n  for (i = 1; i <= l - 1; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  return 1;\n}\nint hebing(int a[], int b[], int l1, int l2) {\n  int i;\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n  return l1 + l2;\n}\nint xianshi(int a[], int l) {\n  for (int i = 1; i < l; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\\n\", a[l]);\n  return 1;\n}\nint main() {\n  int a[100], b[100], l1, l2;\n  cin >> l1 >> l2;\n  duru(a, l1);\n  duru(b, l2);\n  paixu(a, l1);\n  paixu(b, l2);\n  l1 = hebing(a, b, l1, l2);\n  xianshi(a, l1);\n  return 0;\n}\n"}
{"label": "8", "index": "13914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101];\n  int b[101];\n  int m, n, i, j, k, l, w, x, y, z, c, d;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < m - 1; k++) {\n    for (l = 0; l < m - 1 - k; l++) {\n      if (a[l] > a[l + 1]) {\n        c = a[l];\n        a[l] = a[l + 1];\n        a[l + 1] = c;\n      }\n    }\n  }\n  for (w = 0; w < n - 1; w++) {\n    for (x = 0; x < n - 1 - w; x++) {\n      if (b[x] > b[x + 1]) {\n        d = b[x];\n        b[x] = b[x + 1];\n        b[x + 1] = d;\n      }\n    }\n  }\n  for (y = 0; y < m - 1; y++) {\n    printf(\"%d \", a[y]);\n  }\n  printf(\"%d\", a[m - 1]);\n  for (z = 0; z < n; z++) {\n    printf(\" %d\", b[z]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid maopao(int m, int n, int a[200], int b[100]) {\n  int tempt, i, j;\n  for (j = 0; j < m - 1; j++) { \n    for (i = 0; i < m - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        tempt = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = tempt;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        tempt = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = tempt;\n      }\n    }\n  }\n}\nvoid jieshang(int m, int n, int a[200], int b[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(int m, int n, int a[200]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[m + n - 1]);\n}\nint main() {\n  int m, n, i, a[200], b[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  maopao(m, n, a, b);\n  jieshang(m, n, a, b);\n  shuchu(m, n, a);\n}\n"}
{"label": "8", "index": "13916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], m, n;\n  void read(int a[], int n);\n  void sort(int a[], int n);\n  void print(int a[], int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  sort(a, m);\n  sort(b, n);\n  print(a, m);\n  printf(\" \");\n  print(b, n);\n}\nvoid read(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid print(int a[], int n) {\n  int i;\n  for (i = 0;; i++) {\n    printf(\"%d\", a[i]);\n    n--;\n    if (n)\n      printf(\" \");\n    else\n      break;\n  }\n}\n"}
{"label": "8", "index": "13917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid output(int n, int m, int a[], int b[]) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\nvoid swap(int a[], int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\nvoid quicksort(int a[], int l, int r) {\n  int m, i, j;\n  i = l;\n  j = r;\n  m = a[i];\n  while (i <= j) {\n    while ((a[i] < m) && (i < r))\n      i++;\n    while ((a[j] > m) && (j > l))\n      j--;\n    if (i <= j) {\n      swap(a, i, j);\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    quicksort(a, i, r);\n  if (j > l)\n    quicksort(a, l, j);\n}\nvoid input() {\n  int i, n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  quicksort(a, 0, n - 1);\n  quicksort(b, 0, m - 1);\n  output(n, m, a, b);\n}\nint main() { input(); }\n"}
{"label": "8", "index": "13918", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[999] = {0}, b[999] = {0}, c[1999] = {0};\nint m, n;\nvoid f() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank_1() {\n  int i, j, k;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  f();\n  rank_1();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "13919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, m, n, a[1000], b[1000], c;\nvoid f(int a[1000], int m) {\n  for (i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  f(a, m);\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  cout << \" \";\n  f(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "13920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid get(int m, int n);\nvoid swap(int m, int n);\nvoid put(int m, int n);\nint a[1001], b[1001];\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  get(m, n);\n  swap(m, n);\n  put(m, n);\n}\nvoid get(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid swap(int m, int n) {\n  int j, k, c;\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (a[k] > a[k + 1]) {\n        c = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (b[k] > b[k + 1]) {\n        c = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = c;\n      }\n}\nvoid put(int m, int n) {\n  int l;\n  for (l = 0; l < m; l++)\n    printf(\"%d \", a[l]);\n  for (l = 0; l < n; l++) {\n    if (l == n - 1)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n}\n"}
{"label": "8", "index": "13921", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s1[100], s2[100], i, j, a, b, t, s;\nvoid in(void);\nvoid order(void);\nvoid stick(void);\nvoid out(void);\n\nint main() {\n  in();\n  order();\n  stick();\n  out();\n}\n\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < b; i++)\n    cin >> s2[i];\n}\nvoid order() {\n\n  for (i = 1; i < a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < b; i++) {\n    for (j = 0; j < b - i; j++) {\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid stick() {\n\n  s = a + b;\n  for (i = a; i < s; i++) {\n    s1[i] = s2[i - a];\n  }\n}\nvoid out() {\n\n  for (i = 0; i < a + b; i++) {\n    if (i == 0)\n      printf(\"%d\", s1[i]);\n    else\n      printf(\" %d\", s1[i]);\n  }\n}\n"}
{"label": "8", "index": "13922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int shuzu[], int num) {\n  int i, j, jiaohuan;\n  for (i = 1; i < num; i++) {\n    for (j = 0; j < num - i; j++) {\n      if (shuzu[j] > shuzu[j + 1]) {\n        jiaohuan = shuzu[j];\n        shuzu[j] = shuzu[j + 1];\n        shuzu[j + 1] = jiaohuan;\n      }\n    }\n  }\n} \nint hebing(int shuzu1[], int num1, int shuzu2[], int num2) {\n  int i;\n  for (i = 0; i < num2; i++)\n    shuzu1[i + num1] = shuzu2[i];\n} \nint main() {\n  int shuzu1[200], shuzu2[100], num1, num2, i, j;\n  cin >> num1 >> num2;\n  for (i = 0; i < num1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < num2; i++)\n    cin >> shuzu2[i];\n  paixu(shuzu1, num1);                \n  paixu(shuzu2, num2);                \n  hebing(shuzu1, num1, shuzu2, num2); \n  for (i = 0; i < (num1 + num2); i++) {\n    cout << shuzu1[i];\n    if (i < (num1 + num2 - 1))\n      cout << \" \";\n  } \n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[20], b[20], c[40], la = 0, lb = 0;\nint read(int a[], int b[]);\nint sort(int b[]);\nint catenate(int a[], int b[], int c[]);\nint print(int c[], int l);\nint main() {\n  read(a, b);\n  sort(a, b);\n  catenate(a, b, c);\n  print(c, la + lb);\n  return 0;\n}\nint read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d \", &la, &lb);\n  for (i = 1; i <= la; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return 0;\n}\nint sort(int a[], int b[]) {\n  int i, j, change;\n  for (i = 1; i < la; i++)\n    for (j = 1; j <= la - i; j++)\n      if (a[j] > a[j + 1]) {\n        change = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = change;\n      }\n  for (i = 1; i < lb; i++)\n    for (j = 1; j <= lb - i; j++)\n      if (b[j] > b[j + 1]) {\n        change = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = change;\n      }\n  return 0;\n}\nint catenate(int a[], int b[], int c[]) {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n  return 0;\n}\nint print(int c[], int l) {\n  int i;\n  cout << c[1];\n  for (i = 2; i <= l; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "8", "index": "13924", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint m = 0, n = 0, a[20] = {0}, b[20] = {0}, c[40] = {0};\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n}\n\nvoid sort() {\n  for (int j = 1; j < m; j++)\n    for (int i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        int p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n  for (int j = 1; j < n; j++)\n    for (int i = 1; i <= n - j; i++)\n      if (b[i] > b[i + 1]) {\n        int p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n}\n\nvoid combine() {\n  for (int i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (int j = 1; j <= n; j++)\n    c[m + j] = b[j];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n] << endl;\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13925", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[20] = {0}, d[20] = {0}, e[40] = {0};\nvoid in() {\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < b; i++)\n    cin >> d[i];\n}\nint number(int m[]) {\n  int i, n = 0;\n  for (i = 0; m[i] != 0; i++)\n    n++;\n  return n;\n}\nvoid change(int s[]) {\n  int i, j, m;\n  for (i = 1; i < number(s); i++) {\n    for (j = 0; j < number(s) - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        m = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int m[], int n[]) {\n  int i, j = 0;\n  for (i = 0; m[i] != 0; i++) {\n    e[i] = m[i];\n    j++;\n  }\n  for (i = 0; n[i] != 0; i++) {\n    e[j] = n[i];\n    j++;\n  }\n}\nvoid out() {\n  int i;\n  for (i = 0; e[i] != 0; i++) {\n    printf(\"%d\", e[i]);\n    if (e[i + 1] != 0)\n      printf(\" \");\n  }\n}\nint main() {\n  in();\n  change(c);\n  change(d);\n  link(c, d);\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "13926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[200] = {0}, b[200] = {0}, tem, *p, *q;\n  p = a;\n  q = b;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        tem = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = tem;\n      }\n    }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (*(q + j) > *(q + j + 1)) {\n        tem = *(q + j);\n        *(q + j) = *(q + j + 1);\n        *(q + j + 1) = tem;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "13927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int a[100], int b[100], int m, int n);\n  void bubble(int a[100], int m);\n  void print(int a[100], int b[100], int m, int n);\n  int m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  bubble(a, m);\n  bubble(b, n);\n  print(a, b, m, n);\n  return 0;\n}\n\nvoid read(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid bubble(int a[100], int m) {\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid print(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "8", "index": "13928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s1[100], s2[100], i, j, a, b, t, s;\nvoid in(void);\nvoid order(void);\nvoid stick(void);\nvoid out(void);\n\nint main() {\n  in();\n  order();\n  stick();\n  out();\n}\n\nvoid in() {\n  cin >> a >> b;\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < b; i++)\n    cin >> s2[i];\n}\nvoid order() {\n\n  for (i = 1; i < a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < b; i++) {\n    for (j = 0; j < b - i; j++) {\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid stick() {\n\n  s = a + b;\n  for (i = a; i < s; i++) {\n    s1[i] = s2[i - a];\n  }\n}\nvoid out() {\n\n  for (i = 0; i < a + b; i++) {\n    if (i == 0)\n      printf(\"%d\", s1[i]);\n    else\n      printf(\" %d\", s1[i]);\n  }\n}\n"}
{"label": "8", "index": "13929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  int i, j;\n  int s1[1000], s2[1000];\n  for (i = 1; i <= a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d\", &s2[i]);\n  for (i = 1; i <= a - 1; i++)\n    for (j = 1; j <= a - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        int t;\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n  for (i = 1; i <= b - 1; i++)\n    for (j = 1; j <= b - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        int t;\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n  for (i = 1; i <= a; i++)\n    printf(\"%d \", s1[i]);\n  for (i = 1; i <= b - 1; i++)\n    printf(\"%d \", s2[i]);\n  printf(\"%d\", s2[b]);\n  return 0;\n}\n"}
{"label": "8", "index": "13930", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *n1, int data1[], int *n2, int data2[]) {\n  scanf(\"%d %d \", n1, n2);\n  for (int i = 0; i < *n1; ++i)\n    cin >> data1[i];\n  for (int i = 0; i < *n2; ++i)\n    scanf(\"%d \", &data2[i]);\n  return;\n}\nvoid bubblesort(int n, int data[]) {\n  for (int i = n - 1; i > 0; --i)\n    for (int j = 0; j < i; ++j)\n      if (data[j] > data[j + 1]) {\n        int temp = data[j];\n        data[j] = data[j + 1];\n        data[j + 1] = temp;\n      }\n  return;\n}\nint combine(int n1, int data1[], int n2, int data2[], int data3[]) {\n  for (int i = 0; i < n1; ++i)\n    data3[i] = data1[i];\n  for (int i = n1; i < n1 + n2; ++i)\n    data3[i] = data2[i - n1];\n  return n1 + n2;\n}\nvoid print(int n, int data[]) {\n  cout << data[0];\n  for (int i = 1; i < n; ++i)\n    cout << ' ' << data[i];\n  cout << endl;\n  return;\n}\nint main() {\n  int n1, n2, a1[101], a2[101], a3[201];\n  input(&n1, a1, &n2, a2);\n  bubblesort(n1, a1);\n  bubblesort(n2, a2);\n\n  int n3 = combine(n1, a1, n2, a2, a3);\n  print(n3, a3);\n  return 0;\n}\n"}
{"label": "8", "index": "13931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n1 = 0, n2 = 0, i = 0, j = 0, temp = 0;\n  cin >> n1 >> n2;\n  int a1[100] = {0}, a2[100] = {0}, c[200] = {0};\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (i = 0; i < n2; i++)\n    cin >> a2[i];\n  for (i = 0; i < n1 - 1; i++) {\n    for (j = 0; j < n1 - 1 - i; j++) {\n      if (a1[j] > a1[j + 1]) {\n        temp = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2 - 1; i++) {\n    for (j = 0; j < n2 - 1 - i; j++) {\n      if (a2[j] > a2[j + 1]) {\n        temp = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    c[i] = a1[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = a2[i - n1];\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0;\n\nvoid Get_In(int a[10000], int b[10000]) {\n  int i = 0, j = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n}\n\nvoid Ranking(int a[10000], int l) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < (l - 1); i++) {\n    for (j = (i + 1); j < l; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid Combine(int a[10000], int b[10000]) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid Turn_Out(int a[10000]) {\n  int i = 0;\n  for (i = 0; i < (m + n); i++) {\n    if (i < (m + n - 1))\n      cout << a[i] << \" \";\n    else if (i == (m + n - 1))\n      cout << a[i] << endl;\n  }\n}\n\nint main() {\n  int a[10000], b[10000];\n  cin >> m >> n;\n  Get_In(a, b);\n  Ranking(a, m);\n  Ranking(b, n);\n  Combine(a, b);\n  Turn_Out(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], x, y, i, j, k;\nvoid a1();\nvoid b1(int *p, int n);\nvoid c(int *p1, int x, int *p2, int y);\nvoid d(int x, int y);\n\nvoid a1() {\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n}\n\nvoid b1(int *p, int n) {\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j + 1] < p[j]) {\n        k = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = k;\n      }\n    }\n}\n\nvoid c(int *p1, int x, int *p2, int y) {\n  for (i = x, j = 0; i < x + y; j++, i++)\n    p1[i] = p2[j];\n}\n\nvoid d(int x, int y) {\n  cout << a[0];\n  for (i = 1; i < x + y; i++)\n    cout << \" \" << a[i];\n}\n\nint main() {\n  a1();\n  b1(a, x);\n  b1(b, y);\n  c(a, x, b, y);\n  d(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "13934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nvoid getarr(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sortarr(void) {\n  int i, j, p;\n  for (i = 1; i < m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid combarr(void) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid printarr(void) {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i];\n}\nint main() {\n  getarr();\n  sortarr();\n  combarr();\n  printarr();\n  return 0;\n}\n"}
{"label": "8", "index": "13935", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint input(int[], int);\nint sort(int[], int);\nvoid combine(int[], int[], int, int);\nvoid output(int[], int, int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  int a[100], b[100];\n  input(a, n1);\n  input(b, n2);\n  sort(a, n1);\n  sort(b, n2);\n  combine(a, b, n1, n2);\n  return 0;\n}\nint input(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  return a[i];\n}\nint sort(int a[], int n) {\n  int i, j, p;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  return a[j];\n}\nvoid combine(int a[], int b[], int n1, int n2) {\n  int c[200];\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n2 + n1; i++)\n    c[i] = b[i - n1];\n  output(c, n1, n2);\n}\nvoid output(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1] << endl;\n}\n"}
{"label": "8", "index": "13936", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint l1, l2, a1[50], a2[50], a3[100];\nvoid f1(int a1[], int a2[]) {\n  scanf(\"%d %d\", &l1, &l2);\n  int i;\n  for (i = 1; i <= l1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 1; i <= l2; i++)\n    scanf(\"%d\", &a2[i]);\n}\nvoid f2(int l, int a[]) {\n  int i, j, t;\n  for (i = 1; i < l; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a1[], int a2[], int a3[]) {\n  int i;\n  for (i = 1; i <= l1; i++)\n    a3[i] = a1[i];\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a3[i] = a2[i - l1];\n}\nvoid f4(int a3[]) {\n  int i;\n  for (i = 1; i <= l1 + l2; i++) {\n    if (i != 1)\n      printf(\" \");\n    printf(\"%d\", a3[i]);\n  }\n}\nint main() {\n  f1(a1, a2);\n  f2(l1, a1);\n  f2(l2, a2);\n  f3(a1, a2, a3);\n  f4(a3);\n}\n"}
{"label": "8", "index": "13937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid input(int x[], int p);\nvoid sort_ascending(int x[], int p);\nint main() {\n  int m, n, a[1000], b[1000], j, i;\n  cin >> m >> n;\n  input(a, m);\n  input(b, n);\n  sort_ascending(a, m);\n  sort_ascending(b, n);\n  for (j = 0; j < m; j++)\n    printf(\"%d \", a[j]);\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\nvoid input(int x[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    cin >> x[i];\n}\nvoid sort_ascending(int x[], int p) {\n  int i, j, t;\n  for (i = 0; i < p; i++)\n    for (j = 0; j < p - i - 1; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "13938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint str1[50] = {1}, str2[50] = {1};\nint length1, length2;\nvoid input_string(void) {\n  scanf(\"%d %d \", &length1, &length2);\n  for (int i = 0; i < length1; i++)\n    cin >> str1[i];\n  for (int i = 0; i < length2; i++)\n    cin >> str2[i];\n}\nvoid rank_string(void) {\n  int temp;\n  for (int i = 0; i < length1 - 1; i++)\n    for (int j = i + 1; j < length1; j++)\n      if (str1[i] > str1[j]) {\n        temp = str1[i];\n        str1[i] = str1[j];\n        str1[j] = temp;\n      }\n  for (int i = 0; i < length2 - 1; i++)\n    for (int j = i + 1; j < length2; j++)\n      if (str2[i] > str2[j]) {\n        temp = str2[i];\n        str2[i] = str2[j];\n        str2[j] = temp;\n      }\n}\nvoid combine_string(void) {\n  for (int i = length1; i < length1 + length2; i++)\n    str1[i] = str2[i - length1];\n}\nvoid output_string(void) {\n  cout << str1[0];\n  for (int i = 1; i < length1 + length2; i++)\n    printf(\" %d\", str1[i]);\n}\nint main() {\n  input_string();\n  rank_string();\n  combine_string();\n  output_string();\n  return 0;\n}\n"}
{"label": "8", "index": "13939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint compare(const void *a, const void *b) {\n  int x = *(int *)a;\n  int y = *(int *)b;\n  if (x < y) {\n    return -1;\n  }\n  if (x == y) {\n    return 0;\n  }\n  return 1;\n}\n\nvoid initArrays(int *a, int *b, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int *b, int m, int n) {\n  qsort(a, m, sizeof(int), compare);\n  qsort(b, n, sizeof(int), compare);\n}\n\nvoid append(int *a, int *b, int *c, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid print(int *a, int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[i]);\n}\n\nint main(const char *argv[]) {\n\n  int m, n;\n  cin >> m >> n;\n  int a[m];\n  int b[n];\n  initArrays(a, b, m, n);\n  sort(a, b, m, n);\n  int c[m + n];\n  append(a, b, c, m, n);\n  print(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "13940", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[2][5000], b[2], k;\nvoid ppt(int k) {\n  for (int i = 0; i < b[k] - 1; i++)\n    for (int j = 0; j < b[k] - 1 - i; j++)\n      if (a[k][j] > a[k][j + 1]) {\n        int tr;\n        tr = a[k][j];\n        a[k][j] = a[k][j + 1];\n        a[k][j + 1] = tr;\n      }\n}\n\nint main() {\n  scanf(\"%d %d \", &b[0], &b[1]);\n  for (k = 0; k <= 1; k++) {\n    for (int m = 0; m < b[k]; m++)\n      cin >> a[k][m];\n    ppt(k);\n    for (int m = 0; m < b[k]; m++) {\n      if (k == 0 && m == 0)\n        cout << a[k][m];\n      else\n        printf(\" %d\", a[k][m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstatic int m, n;\nint a[1000], b[1000], c[2000];\nvoid f1(int a[], int b[], int h, int k) {\n  int i;\n  cin >> h >> k;\n  m = h;\n  n = k;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  return;\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j, k;\n  for (j = m - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid f4(int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, c, m, n);\n  f4(c, m, n);\n}\n"}
{"label": "8", "index": "13942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid putin(int *p, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> *(p + i);\n}\nvoid putout(int *p, int n) {\n  int m, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (*(p + j) > *(p + j + 1)) {\n        m = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = m;\n      }\n  }\n  cout << *(p + 1);\n  for (i = 2; i < n + 1; i++)\n    cout << \" \" << *(p + i);\n}\nint main() {\n  int n1, n2, a[10000], b[10000], *pa, *pb;\n  pa = a;\n  pb = b;\n  cin >> n1 >> n2;\n  putin(pa, n1);\n  putin(pb, n2);\n  putout(pa, n1);\n  cout << \" \";\n  putout(pb, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "13943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read();\n  read();\n}\nvoid read() {\n  int a, b;\n  void shu(int x, int y);\n  scanf(\"%d%d\", &a, &b);\n  shu(a, b);\n}\nvoid shu(int x, int y) {\n  int a[100], b[100], i;\n  void pai(int a[], int x, int b[], int y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pai(a, x, b, y);\n}\nvoid pai(int a[], int x, int b[], int y) {\n  int i, k, m;\n  void pr(int a[], int x, int b[], int y);\n  for (i = 0; i < x - 1; i++) {\n    for (k = 0; k < x - 1 - i; k++) {\n      if (a[k] > a[k + 1]) {\n        m = a[k + 1];\n        a[k + 1] = a[k];\n        a[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (k = 0; k < y - 1 - i; k++) {\n      if (b[k] > b[k + 1]) {\n        m = b[k + 1];\n        b[k + 1] = b[k];\n        b[k] = m;\n      }\n    }\n  }\n  pr(a, x, b, y);\n}\nvoid pr(int a[], int x, int b[], int y) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "13944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pai(int na, int nb);\n  int na, nb;\n  scanf(\"%d%d\", &na, &nb);\n  pai(na, nb);\n  return 0;\n}\n\nvoid pai(int na, int nb) {\n  int t, i, j, a[200], b[100];\n  for (i = 0; i < na; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < nb; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  for (j = 0; j < na - 1; j++) {\n    for (i = 0; i < na - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < nb - 1; j++) {\n    for (i = 0; i < nb - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < na; j++)\n    printf(\"%d \", a[j]);\n  for (j = 0; j < nb - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\\n\", b[nb - 1]);\n}\n"}
{"label": "8", "index": "13945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int *a, int *b, int num1, int num2);\nvoid sort(int *a, int num1);\nvoid merge(int *a, int *b, int *c, int num1, int num2);\nvoid print(int *a, int num1);\nint main() {\n  int a[100], b[100], c[200];\n  int num1, num2;\n  cin >> num1 >> num2;\n  read(a, b, num1, num2);\n  sort(a, num1);\n  sort(b, num2);\n  merge(a, b, c, num1, num2);\n  print(c, num1 + num2);\n  return 0;\n}\n\nvoid read(int *a, int *b, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int num1) {\n  int i, j;\n  for (i = 0; i < num1; i++) {\n    for (j = i + 1; j < num1; j++) {\n      if (a[i] > a[j]) {\n        int temp;\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *a, int *b, int *c, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = num1; i < num1 + num2; i++) {\n    c[i] = b[i - num1];\n  }\n}\n\nvoid print(int *a, int num1) {\n  int i;\n  for (i = 0; i < num1 - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[num1 - 1] << endl;\n}\n"}
{"label": "8", "index": "13946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int a[100];\n  int b[100];\n  int c[200];\n  void read(int a[], int b[], int m, int n);\n  void paixu(int a[], int b[], int m, int n);\n  void combine(int c[], int a[], int b[], int m, int n);\n  void type(int c[], int m, int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  paixu(a, b, m, n);\n  combine(c, a, b, m, n);\n  type(c, m, n);\n}\n\nvoid read(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[], int b[], int m, int n) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n}\n\nvoid combine(int c[], int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid type(int c[], int m, int n) {\n  int num, i;\n  num = m + n;\n  for (i = 0; i < num; i++)\n    if (i < num - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n}\n"}
{"label": "8", "index": "13947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint shuzu1[10] = {0}, shuzu2[10] = {0};\nint n1, n2;\nvoid input() \n{\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < n2; i++)\n    cin >> shuzu2[i];\n}\n\nvoid sort(int shuzu[], int bg, int ed) \n{\n  int bg1 = bg, ed1 = ed, key = shuzu[bg];\n  if (bg1 != ed1) {\n    while (bg1 != ed1) {\n      for (; shuzu[ed1] >= key && bg1 != ed1; ed1--)\n        ;\n      shuzu[bg1] = shuzu[ed1];\n      if (bg1 == ed1)\n        break;\n      bg1++;\n      for (; shuzu[bg1] <= key && bg1 != ed1; bg1++)\n        ;\n      shuzu[ed1] = shuzu[bg1];\n      if (bg1 == ed1)\n        break;\n      ed1--;\n    }\n    shuzu[bg1] = key;\n    if (bg1 != bg)\n      sort(shuzu, bg, bg1 - 1);\n    if (ed1 != ed)\n      sort(shuzu, ed1 + 1, ed);\n  }\n}\nvoid sort1() \n{\n  sort(shuzu1, 0, n1 - 1); \n  sort(shuzu2, 0, n2 - 1);\n}\nvoid link() {\n  int lk; \n  for (lk = 0; lk < n2; lk++)\n    shuzu1[n1 + lk] = shuzu2[lk];\n}\nvoid output() \n{\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i)\n      cout << ' '; \n    cout << shuzu1[i];\n  }\n}\nint main() {\n  input();\n  sort1();\n  link();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint array_a[100], array_b[100], n_a, n_b;\nvoid input() {\n  int i;\n\n  scanf(\"%d%d\", &n_a, &n_b);\n  for (i = 0; i < n_a; i++)\n    scanf(\"%d\", &array_a[i]);\n  for (i = 0; i < n_b; i++)\n    scanf(\"%d \", &array_b[i]);\n}\nvoid order() {\n  int i, j, temp;\n\n  for (i = 1; i < n_a; i++)\n    for (j = 1; j < n_a + 1 - i; j++)\n      if (array_a[j] < array_a[j - 1]) {\n        temp = array_a[j];\n        array_a[j] = array_a[j - 1];\n        array_a[j - 1] = temp;\n      }\n  for (i = 1; i < n_b; i++)\n    for (j = 1; j < n_b - i + 1; j++)\n      if (array_b[j] < array_b[j - 1]) {\n        temp = array_b[j];\n        array_b[j] = array_b[j - 1];\n        array_b[j - 1] = temp;\n      }\n}\nvoid catenate() {\n  int i;\n  for (i = 0; i < n_b; i++)\n    array_a[n_a + i] = array_b[i];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < n_a + n_b; i++)\n    cout << array_a[i] << (i == n_a + n_b - 1) ? '\\n' : ' ';\n}\nint main() {\n  input();\n  order();\n  catenate();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid output(int c[], int m, int n) {\n  int i;\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", c[i]);\n}\nvoid combine(int a[], int b[], int m, int n) {\n  int c[100];\n  int i, j = 1;\n  for (i = 1; i <= m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m + 1; i <= n + m; i++, j++) {\n    c[i] = b[j];\n  }\n  output(c, m, n);\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j, temp;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  combine(a, b, m, n);\n}\nvoid input(void) {\n  int i, a[100], b[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n  order(a, b, m, n);\n}\nint main() {\n  input();\n  return 0;\n}\n"}
{"label": "8", "index": "13950", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sort(int array[], int n);\n  int m, n, i;\n  int a[100], b[100], c[200];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, m);\n  sort(b, n);\n  for (i = 0; i < m + n; i++) {\n    if (i < m)\n      c[i] = a[i];\n    else\n      c[i] = b[i - m];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i < m + n - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n  }\n  return 0;\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n"}
{"label": "8", "index": "13951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x, y, a[100], b[100], temp;\nint input() {\n  int k = 0, t = 0, temp = 0;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int j = 0; j < y; j++)\n    scanf(\"%d \", &b[j]);\n\n  return 0;\n}\nint bubble() {\n  for (int i = 0; i < x - 1; i++)\n    for (int t = i + 1; t < x; t++) {\n      if (a[i] > a[t]) {\n        temp = a[t];\n        a[t] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (int j = 0; j < y - 1; j++)\n    for (int t = j + 1; t < y; t++) {\n      if (b[j] > b[t]) {\n        temp = b[t];\n        b[t] = b[j];\n        b[j] = temp;\n      }\n    }\n  return 0;\n}\nint combine() {\n  for (int i = 0; i < x; i++)\n    cout << a[i] << ' ';\n  for (int j = 0; j < y - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[y - 1];\n  return 0;\n}\nint main() {\n  input();\n  bubble();\n  combine();\n  return 0;\n}\n"}
{"label": "8", "index": "13952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[1000] = {0}, b[1000] = {0}, c[1000] = {0};\nvoid du() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid pai() {\n  int j, k, l;\n  for (j = 0; j <= m; j++) {\n    for (k = 0; k < m - 1; k++) {\n      if (a[k] > a[k + 1]) {\n        l = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = l;\n      }\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (b[k] > b[k + 1]) {\n        l = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = l;\n      }\n    }\n  }\n}\nvoid he() {\n  int o, p;\n  for (o = 0; o < m; o++)\n    c[o] = a[o];\n  for (p = 0; p < n; p++) {\n    c[o] = b[p];\n    o++;\n  }\n}\nvoid shu() {\n  int q;\n  for (q = 0; q < m + n; q++) {\n    cout << c[q];\n    if (q != m + n - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  du();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "13953", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[50], b[50], e[100];\nint c, d;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid change() {\n  int i, j, t;\n  for (j = 0; j < c - 1; j++) {\n    for (i = 0; i < c - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < d - 1; j++) {\n\n    for (i = 0; i < d - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid to() {\n  int i;\n  for (i = 0; i < c; i++) {\n    e[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    e[i + c] = b[i];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < (c + d) - 1; i++) {\n    printf(\"%d \", e[i]);\n  }\n  printf(\"%d\", e[c + d - 1]);\n}\nint main() {\n  input();\n  change();\n  to();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13954", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[1000], b[1000], c[2000], s, t;\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  for (s = 0; s < m; s++)\n    scanf(\"%d\", &a[s]);\n  for (s = 0; s < n; s++)\n    scanf(\"%d\", &b[s]);\n}\n\nvoid order() {\n  int k;\n  for (s = 1; s < m; s++)\n    for (t = 0; t < m - s; t++) {\n      if (a[t] > a[t + 1]) {\n        k = a[t];\n        a[t] = a[t + 1];\n        a[t + 1] = k;\n      }\n    }\n  for (s = 1; s < n; s++)\n    for (t = 0; t < n - s; t++)\n      if (b[t] > b[t + 1]) {\n        k = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = k;\n      }\n}\n\nvoid add() {\n  for (s = 0; s < m; s++)\n    c[s] = a[s];\n  for (s = m, t = 0; s < m + n; s++, t++)\n    c[s] = b[t];\n}\n\nvoid output() {\n  for (s = 0; s < m + n; s++) {\n    if (s != m + n - 1)\n      printf(\"%d \", c[s]);\n    else\n      printf(\"%d\", c[s]);\n  }\n}\n\nint main() {\n  input();\n  order();\n  add();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13955", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid change(int *a, int n) {\n  int t, i, j;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] < a[j]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n}\nvoid input(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid output(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n}\nint main() {\n  int n, m, a[100], b[100];\n  cin >> n >> m;\n  input(a, n);\n  input(b, m);\n  change(a, n);\n  change(b, m);\n  output(a, n);\n  output(b, m - 1);\n  printf(\"%d\", b[m - 1]);\n}\n"}
{"label": "8", "index": "13956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d %d\", &a, &b);\n  int c[100];\n  int d[100];\n  int i, t, r;\n  i = 0;\n  do {\n    scanf(\"%d\", &c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    scanf(\"%d\", &d[i]);\n    i++;\n  } while (i < b);\n  t = 0;\n  do {\n    i = 0;\n    while (i < a - 1 - t) {\n      if (c[i] > c[i + 1]) {\n        r = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < a - 1);\n  t = 0;\n  do {\n    i = 0;\n    while (i < b - 1 - t) {\n      if (d[i] > d[i + 1]) {\n        r = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < b - 1);\n  cout << c[0];\n  i = 1;\n  do {\n    printf(\" %d\", c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    printf(\" %d\", d[i]);\n    i++;\n  } while (i < b);\n  return 0;\n}\n"}
{"label": "8", "index": "13957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m;\nint key, j, k, i, t;\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  int *p1 = (int *)malloc((n + 1) * sizeof(int));\n  int *p2 = (int *)malloc((m + 1) * sizeof(int));\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", (p1 + i));\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", (p2 + i));\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (*(p1 + i) > *(p1 + j)) {\n        t = *(p1 + i), *(p1 + i) = *(p1 + j), *(p1 + j) = t;\n      }\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    for (j = i + 1; j <= m; j++) {\n      if (*(p2 + i) > *(p2 + j)) {\n        t = *(p2 + i), *(p2 + i) = *(p2 + j), *(p2 + j) = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << *(p1 + i) << \" \";\n  for (i = 1; i <= m; i++) {\n    if (i == m)\n      cout << *(p2 + i);\n    else\n      printf(\"%d \", *(p2 + i));\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int aa[100], bb[100], cc[200], la, lb;\n  void scan(int a[], int la, int b[], int lb);\n  void sort(int a[], int n);\n  void combine(int a[], int la, int b[], int lb, int c[]);\n\n  scanf(\"%d %d\", &la, &lb);\n\n  scan(aa, la, bb, lb);\n  sort(aa, la);\n  sort(bb, lb);\n\n  combine(aa, la, bb, lb, cc);\n}\n\nvoid scan(int a[], int la, int b[], int lb) {\n  int i;\n\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, k, temp;\n\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[k])\n        k = j;\n    temp = a[k];\n    a[k] = a[i];\n    a[i] = temp;\n  }\n}\n\nvoid combine(int a[], int la, int b[], int lb, int c[]) {\n  int i;\n\n  for (i = 0; i < lb; i++)\n    a[la + i] = b[i];\n  for (i = 0; i < la + lb; i++)\n    c[i] = a[i];\n  printf(\"%d\", c[0]);\n  for (i = 1; i < la + lb; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "13959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid px(int a[100], int k) {\n  int i, j, b;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[k - 1];\n}\nvoid fz() {\n  int m, n, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  px(a, n);\n  printf(\" \");\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  px(b, m);\n}\nint main() {\n  fz();\n  return 0;\n}\n"}
{"label": "8", "index": "13960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m; \nvoid reset1(int a[]);\nvoid reset2(int b[]);\nint main() {\n  int a[100], b[100], i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  reset1(a);\n  reset2(b);\n  for (i = 0; i < n; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid reset1(int a[]) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid reset2(int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "13961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int au(int x, int y);\n  int x, y;\n  scanf(\"%d%d\", &x, &y);\n  au(x, y);\n  return 0;\n}\nint au(int x, int y) {\n  int a[100], b[100], i, j, m, n;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 0; i < x; i++) {\n    for (m = 0; m < x - i - 1; m++) {\n      if (a[m] > a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < y; j++) {\n    for (n = 0; n < y - j - 1; n++) {\n      if (b[n] > b[n + 1]) {\n        int t = b[n];\n        b[n] = b[n + 1];\n        b[n + 1] = t;\n      }\n    }\n  }\n  for (m = x; m < x + y; m++) {\n    a[m] = b[m - x];\n  }\n  for (m = 0; m < x + y - 1; m++)\n    printf(\"%d \", a[m]);\n\n  printf(\"%d\", a[x + y - 1]);\n}\n"}
{"label": "8", "index": "13962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, x[100], y[100], z[100];\nint main() {\n  void read();\n  void orde(int c[100], int d[100]);\n  void resm(int e[100], int f[100]);\n  void show(int g[100]);\n  read();\n  orde(x, y);\n  resm(x, y);\n  show(x);\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid orde(int c[100], int d[100]) {\n  int i, j, q;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j + 1] < c[j]) {\n        q = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = q;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    x[i] = c[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (d[j + 1] < d[j]) {\n        q = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = q;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    y[i] = d[i];\n  }\n}\nvoid resm(int e[100], int f[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    e[i + m] = f[i];\n  for (i = 0; i < 100; i++)\n    x[i] = e[i];\n}\nvoid show(int g[100]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\\n\", x[m + n - 1]);\n}\n"}
{"label": "8", "index": "13963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A[200] = {0};\nint B[100] = {0};\nint a, b;\n\nvoid shuzu() \n{\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> A[i];\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> B[i];\n  }\n}\nvoid paixu() \n{\n  int p;\n  for (int j = 1; j <= a - 1; j++) {\n    for (int i = 0; i < a - j; i++) {\n      if (A[i] > A[i + 1]) {\n        p = A[i];\n        A[i] = A[i + 1];\n        A[i + 1] = p;\n      }\n    }\n  }\n  for (int j = 1; j <= b - 1; j++) {\n    for (int i = 0; i < b - j; i++) {\n      if (B[i] > B[i + 1]) {\n        p = B[i];\n        B[i] = B[i + 1];\n        B[i + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing() \n{\n  for (int i = 0; i < b; i++) {\n    A[a + i] = B[i];\n  }\n  for (int i = 0; i < a + b - 1; i++) {\n    cout << A[i] << ' ';\n  }\n  cout << A[a + b - 1];\n}\n\nint main() {\n\n  shuzu();\n  paixu();\n  hebing();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  long i, j, n, m, x, p = 0;\n  int a[100001] = {0};\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    a[x]++;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      if (p == 0) {\n        cout << i;\n        p = 1;\n      } else\n        cout << \" \" << i;\n    a[i] = 0;\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &x);\n    a[x] = 1;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      printf(\" %d\", i);\n    a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "13965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &shu1[i]);\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n}\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "13966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], n, m, c[1000];\nvoid input(int a[], int b[]) {\n  int i, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid charge(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= m - 2; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid hook(int a[], int b[]) {\n  int i, j;\n  for (i = n, j = 0; i <= n + m - 1; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i <= m + n - 2; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[m + n - 1] << \" \";\n}\nint main() {\n  input(a, b);\n  charge(a, b);\n  hook(a, b);\n  print(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid bubble(int a[], int l) {\n  int i, j, temp;\n  for (j = 1; j < l; j++) {\n    for (i = 0; i < l - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, i, j, a[10000], b[10000];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  bubble(a, m);\n  bubble(b, n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\", b[j]);\n    if (j < n - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "13968", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], n, m, c[1000];\nvoid input(int a[], int b[]) {\n  int i, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid charge(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= m - 2; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid hook(int a[], int b[]) {\n  int i, j;\n  for (i = n, j = 0; i <= n + m - 1; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i <= m + n - 2; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n - 1]);\n}\nint main() {\n  input(a, b);\n  charge(a, b);\n  hook(a, b);\n  print(a);\n  return 0;\n}\n"}
{"label": "8", "index": "13969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort1(int str1[], int m)\n\n{\n  int t, i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (str1[j] > str1[j + 1]) {\n        t = str1[j];\n        str1[j] = str1[j + 1];\n        str1[j + 1] = t;\n      }\n    }\n  }\n}\nvoid sort2(int str2[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (str2[j] > str2[j + 1]) {\n        t = str2[j];\n        str2[j] = str2[j + 1];\n        str2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid order(int str1[], int str2[], int m, int n) {\n  int i;\n\n  for (i = m; i < m + n; i++)\n    str1[i] = str2[i - m];\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", str1[i]);\n  }\n  printf(\"%d\", str1[m + n - 1]);\n}\nint main() {\n  int str1[30], str2[30];\n  int i, m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &str1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str2[i]);\n  sort1(str1, m);\n  sort2(str2, n);\n  order(str1, str2, m, n);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "13970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], m, n;\nvoid shuru(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu(int f[], int length) {\n  int x;\n  for (int i = 0; i < length - 1; i++)\n    for (int j = 0; j <= length - 2 - i; j++)\n      if (f[j] > f[j + 1]) {\n        x = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = x;\n      }\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\\n\", b[i]);\n}\nint main() {\n  shuru();\n  paixu(a, m);\n  paixu(b, n);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "13971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int n, int a[]) {\n  int i, j, m;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\n\nint main() {\n  int i, k;\n  int n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < m; k++)\n    cin >> b[k];\n  paixu(n, a);\n  paixu(m, b);\n  link(a, b, c, n, m);\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nvoid change(int a[]);\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i;\n  int first = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  change(a);\n  for (i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  n = m;\n  change(b);\n  for (i = 0; i < m; i++) {\n    if (first == 1)\n      cout << \" \" << b[i];\n    if (first == 0) {\n      cout << b[i];\n      first = 1;\n    }\n  }\n  cout << endl;\n  return 0;\n}\nvoid change(int a[]) {\n  int t;\n  int i, j;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "8", "index": "13973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[100] = {0}, b[100] = {0}, c[200] = {0};\nvoid duqu() {\n  int *p;\n  cin >> m >> n;\n  for (p = a; p < a + m; p++)\n    scanf(\"%d\", p);\n  for (p = b; p < b + n; p++)\n    scanf(\"%d\", p);\n}\nvoid range(int a[], int b[], int m, int n) {\n  int *p, *q, d;\n  for (p = a; p < a + m - 1; p++)\n    for (q = p + 1; q < a + m; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n  for (p = b; p < b + n - 1; p++)\n    for (q = p + 1; q < b + n; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int *p, *q;\n  for (p = c, q = a; q < a + m; p++, q++)\n    *p = *q;\n  for (p = c + m, q = b; q < b + n; p++, q++)\n    *p = *q;\n}\nvoid show(int c[], int d) {\n  int *p;\n  for (p = c; p < c + d - 1; p++)\n    printf(\"%d \", *p);\n  cout << *p;\n}\nint main() {\n  duqu();\n  range(a, b, m, n);\n  merge(a, b, m, n);\n  show(c, m + n);\n}\n"}
{"label": "8", "index": "13974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  if (*(int *)elem1 > *(int *)elem2)\n    return 1;\n  if (*(int *)elem1 == *(int *)elem2)\n    return 0;\n  if (*(int *)elem1 < *(int *)elem2)\n    return -1;\n}\nint *shuru(int m, int *a) {\n  a = (int *)malloc(m * sizeof(int));\n  int i;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < m; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  return a;\n}\nint main() {\n  int suma, sumb, i;\n  int *a;\n  int *b;\n  scanf(\"%d %d\", &suma, &sumb);\n  a = shuru(suma, a);\n  b = shuru(sumb, b);\n  qsort(a, suma, sizeof(int), Compare);\n  qsort(b, sumb, sizeof(int), Compare);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < suma; i++) {\n    printf(\" %d\", a[i]);\n  }\n  printf(\" %d\", b[0]);\n  for (i = 1; i < sumb; i++) {\n    printf(\" %d\", b[i]);\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "8", "index": "13975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[100], int l1);\nvoid prin(int a[100], int l1, int b[100], int l2) {\n  int i;\n  char c = '\\0';\n  order(a, l1);\n  order(b, l2);\n  for (i = 0; i < l1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < l2; i++) {\n    if (i < l2 - 1)\n      c = ' ';\n    else\n      c = '\\n';\n    printf(\"%d%c\", b[i], c);\n  }\n}\nvoid order(int a[100], int l1) {\n  int i, j, b;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < l1; j++) {\n      if (a[j] < a[i]) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint main() {\n  int l1, l2, i;\n  int a[100], b[100];\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < l2; i++)\n    cin >> b[i];\n  prin(a, l1, b, l2);\n  return 0;\n}\n"}
{"label": "8", "index": "13976", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a1[100], a2[100];\nvoid get(int n1, int n2) {\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\nvoid arrange(int n1, int n2) {\n  int temp;\n  for (int j = 1; j <= n1 - 1; j++) {\n    for (int i = 0; i <= n1 - j - 1; i++) {\n      if (a1[i] > a1[i + 1]) {\n        temp = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = temp;\n      }\n    }\n  }\n  for (int j = 1; j <= n2 - 1; j++) {\n    for (int i = 0; i <= n2 - j - 1; i++) {\n      if (a2[i] > a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n      }\n    }\n  }\n}\nint combine(int n1, int n2) {\n  int out[100];\n  for (int i = 0; i < n1; i++) {\n    out[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    out[n1 + i] = a2[i];\n  }\n  for (int i = 0; i < n1 + n2 - 1; i++) {\n    printf(\"%d \", out[i]);\n  }\n  printf(\"%d\", out[n1 + n2 - 1]);\n}\nint main() {\n  int a, b;\n  scanf(\"%d %d \", &a, &b);\n  get(a, b);\n  arrange(a, b);\n  combine(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "13977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0;\nint a[100], b[100], c[200];\nvoid read(void) {\n  int i = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort(void) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid combine(void) {\n  int i = 0;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\nvoid output(void) {\n  int i = 0;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  read();\n  sort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "13978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sr();\n  int px(int a[100], int x, int k);\n  void hb(int a[100], int b[100], int x, int y);\n  int i, a[100], b[100], c[200], x, y;\n  x = sr();\n  y = sr();\n  for (i = 0; i < x; i++)\n    a[i] = sr();\n\n  for (i = 0; i < y; i++) {\n    b[i] = sr();\n  }\n  for (i = 0; i < x; i++) {\n    a[i] = px(a, x, i);\n  }\n  for (i = 0; i < y; i++) {\n    b[i] = px(b, y, i);\n  }\n  hb(a, b, x, y);\n  return 0;\n}\nint sr() {\n  int a;\n  scanf(\"%d\", &a);\n  return (a);\n}\nint px(int a[100], int x, int k) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  temp = a[k];\n  return (temp);\n}\nvoid hb(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      printf(\" %d\", a[i]);\n    }\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "13979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint first[100];\nint second[100];\nint combination[200];\nint a, b; \nvoid cin_number() {\n  int i;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    cin >> first[i];\n  }\n  for (i = 0; i < b; i++) {\n    cin >> second[i];\n  }\n} \nvoid rank_1() {\n  int i, j, temp;\n  for (i = (a - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (first[j] > first[j + 1]) {\n        temp = first[j];\n        first[j] = first[j + 1];\n        first[j + 1] = temp;\n      }\n    }\n  }\n  for (i = (b - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (second[j] > second[j + 1]) {\n        temp = second[j];\n        second[j] = second[j + 1];\n        second[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < a; i++) {\n    combination[i] = first[i];\n  }\n  for (i = 0; i < b; i++) {\n    combination[a + i] = second[i];\n  }\n}\nvoid cout_combination() {\n  int i;\n  for (i = 0; i < (a + b - 1); i++)\n    cout << combination[i] << \" \";\n  cout << combination[i] << endl;\n}\nint main() {\n  cin_number();\n  rank_1();\n  combine();\n  cout_combination();\n  return 0;\n}\n"}
{"label": "8", "index": "13980", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid add(int array1[], int array2[], int x, int y) {\n  int array[100];\n  int i, j;\n  for (i = 0; i < x; i++)\n    array[i] = array1[i];\n  for (i = x, j = 0; j < y; i++, j++)\n    array[i] = array2[j];\n  printf(\"%d\", array[0]);\n  for (i = 1; i < x + y; i++)\n    printf(\" %d\", array[i]);\n}\n\nint main() {\n  int i, x, y, xarray[50], yarray[50];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &xarray[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &yarray[i]);\n  sort(xarray, x);\n  sort(yarray, y);\n  add(xarray, yarray, x, y);\n}\n"}
{"label": "8", "index": "13981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid program(void) {\n  int m, n, i, j;\n  scanf(\"%d %d \", &m, &n);\n  const int M = n, N = n;\n  int a[M], b[N];\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n  for (i = 0; i < m; ++i)\n    for (j = i + 1; j < m; ++j)\n      if (a[i] > a[j]) {\n        a[i] = a[i] + a[j];\n        a[j] = a[i] - a[j];\n        a[i] = a[i] - a[j];\n      }\n  for (i = 0; i < n; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (b[i] > b[j]) {\n        b[i] = b[i] + b[j];\n        b[j] = b[i] - b[j];\n        b[i] = b[i] - b[j];\n      }\n  cout << a[0];\n  for (i = 1; i < m; ++i)\n    cout << ' ' << a[i];\n  for (i = 0; i < n; ++i)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  program();\n  return 0;\n}\n"}
{"label": "8", "index": "13982", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid paixu(int str[], int n1);\nvoid hebing(int str1[], int str2[], int n1, int n2);\nvoid shuchu(int str[], int n);\nint main() {\n  int n1, n2;\n  int a[100], b[100];\n  cin >> n1 >> n2;\n  paixu(a, n1);\n  paixu(b, n2);\n  hebing(a, b, n1, n2);\n  shuchu(a, n1 + n2);\n}\nvoid paixu(int str[], int n) {\n  int i, p, m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  for (p = 1; p < n; p++)\n    for (i = 0; i <= n - 1 - p; i++)\n      if (str[i] > str[i + 1]) {\n        m = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = m;\n      }\n}\nvoid hebing(int str1[], int str2[], int n1, int n2) {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    str1[i] = str2[i - n1];\n}\nvoid shuchu(int str[], int n) {\n  int i;\n  printf(\"%d\", str[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", str[i]);\n}\n"}
{"label": "8", "index": "13983", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int a[], int b[]);\nvoid sort(int a[], int b[]);\nvoid link(int a[], int b[]);\nvoid output(int a[]);\nint input1[100], input2[100], n1, n2;\nint main() {\n  read(input1, input2);\n  sort(input1, input2);\n  link(input1, input2);\n  output(input1);\n  return 0;\n}\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n}\nvoid link(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\nvoid output(int a[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "13984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f(int str[], int m) {\n  int i, j, k;\n  for (j = 0; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if (str[i] > str[i + 1]) {\n        k = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = k;\n      }\n}\n\nvoid g(int a[], int b[], int ma, int mb) {\n  int i;\n  for (i = ma; i < (ma + mb); i++)\n    a[i] = b[i - ma];\n}\n\nint main() {\n  int ma, mb, i;\n  int a[8888], b[8888];\n  cin >> ma >> mb;\n  for (i = 0; i < ma; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < mb; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, ma);\n  f(b, mb);\n  g(a, b, ma, mb);\n  for (i = 0; i <= (ma + mb - 1); i++) {\n    if (i != 0)\n      cout << \" \";\n    cout << a[i];\n  }\n}\n"}
{"label": "8", "index": "13985", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint num1, num2, array_11[20], array_12[20], array_1[40];\n\nvoid input(int array_11[], int array_12[]) {\n  int i, j;\n\n  cin >> num1 >> num2;\n\n  for (i = 0; i <= num1 - 1; i++)\n    cin >> array_11[i];\n  for (j = 0; j <= num2 - 1; j++) {\n    scanf(\"%d\", &array_12[j]);\n  }\n}\n\nvoid sort(int array_1[], int n) {\n  int i, j, t;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (array_1[j] > array_1[j + 1]) {\n        t = array_1[j];\n        array_1[j] = array_1[j + 1];\n        array_1[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid link(int array_11[], int array_12[], int array_1[], int n1, int n2) {\n  int i;\n\n  for (i = 0; i < n1; i++) {\n    array_1[i] = array_11[i];\n  }\n  for (i = 0; i < n2; i++) {\n    array_1[i + n1] = array_12[i];\n  }\n}\n\nvoid output(int array_1[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d%c\", array_1[i], i < n - 1 ? ' ' : ' ');\n  }\n}\n\nint main() {\n  input(array_11, array_12);\n  sort(array_11, num1);\n  sort(array_12, num2);\n  link(array_11, array_12, array_1, num1, num2);\n  output(array_1, num1 + num2);\n}\n"}
{"label": "8", "index": "13986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n\n  int a[1000], b[1000];\n  int m, n, i, t, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "13987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint al = 0, bl = 0, i, j, k;\nvoid f1() {\n  cin >> al >> bl;\n  for (i = 0; i < al; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < bl; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < al - 1; i++) {\n    for (j = i; j < al; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < bl - 1; i++) {\n    for (j = i; j < bl; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < bl; i++) {\n    a[i + al] = b[i];\n  }\n}\nvoid f4() {\n  for (i = 0; i < al + bl - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[al + bl - 1];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "13988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], n, m;\nvoid duru() {\n  int i, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int t1, t2, i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t1 = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t1;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t2 = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t2;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n + m - 1] << endl;\n}\nint main() {\n  duru();\n  sort();\n  hebing();\n  put();\n\n  return 0;\n}\n"}
{"label": "8", "index": "13989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int *p, int *q, int *n, int *m) {\n  int *x;\n  scanf(\"%d %d\", n, m);\n  x = p + *n;\n  for (; p < x; p++)\n    scanf(\"%d\", p);\n  x = q + *m;\n  for (; q < x; q++)\n    scanf(\"%d\", q);\n}\n\nvoid sort(int *p, int n) {\n  int x, i, j, k;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      x = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = x;\n    }\n  }\n}\n\nvoid copy(int *p, int *q, int x[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++, p++)\n    x[i] = *p;\n  for (; i < n + m; i++, q++)\n    x[i] = *q;\n}\n\nvoid output(int *p, int n) {\n  int *y;\n  y = p + n - 1;\n  printf(\"%d\", *p);\n  p++;\n  for (; p <= y; p++)\n    printf(\" %d\", *p);\n}\n\nint main() {\n  int i, a[100], b[100], c[200], x, y, *n, *m;\n  n = &x;\n  m = &y;\n  input(a, b, n, m);\n  sort(a, x);\n  sort(b, y);\n  copy(a, b, c, x, y);\n  output(c, x + y);\n}\n"}
{"label": "8", "index": "13990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], la, b[100], lb, c[200], lc;\n\nvoid R() {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    scanf(\"%d \", &b[i]);\n  return;\n}\n\nvoid S(int *x, int lx) {\n  int i, j;\n  for (i = 1; i < lx; i++) {\n    for (j = 1; j <= lx - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  }\n  return;\n}\n\nvoid M() {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = la + 1; i <= la + lb; i++)\n    c[i] = b[i - la];\n  return;\n}\n\nvoid D() {\n  int i;\n  for (i = 1; i <= la + lb; i++) {\n    if (i > 1)\n      cout << \" \";\n    cout << c[i];\n  }\n  printf(\"\\n\");\n  return;\n}\n\nint main() {\n  R();\n  S(a, la);\n  S(b, lb);\n  M();\n  D();\n  return 0;\n}\n"}
{"label": "8", "index": "13991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[300], b[300], m, n, i, j, t, c[300];\nvoid f1() {\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\nvoid f4() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++) {\n    cout << ' ' << c[i];\n  }\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "13992", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid output(int c[], int m, int n) {\n  int i;\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", c[i]);\n}\nvoid combine(int a[], int b[], int m, int n) {\n  int c[100];\n  int i, j = 1;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n\n  for (i = m + 1; i <= n + m; i++, j++) {\n    c[i] = b[j];\n  }\n  output(c, m, n);\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j, temp;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  combine(a, b, m, n);\n}\nvoid input(void) {\n  int i, a[100], b[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n  order(a, b, m, n);\n}\nint main() {\n  input();\n  return 0;\n}\n"}
{"label": "8", "index": "13993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], n, m;\nvoid shuru(void);\nvoid paixu(void);\nvoid hebing(void);\nvoid shuchu(void);\nint main() {\n\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\nvoid shuru(void) {\n  int x, y;\n  cin >> x >> y;\n  int i;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  n = x;\n  m = y;\n}\nvoid paixu(void) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n}\nvoid hebing(void) {\n  int i;\n  for (i = n; i < m + n; i++)\n    a[i] = b[i - n];\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "13994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shuru(int array[100], int x);\n  void paixu(int array[100], int x);\n  int i, m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid shuru(int array[100], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\nvoid paixu(int array[100], int x) {\n  int i, j, b;\n  for (j = 1; j < x; j++) {\n    for (i = 0; i < x - j; i++) {\n      if (array[i] > array[i + 1]) {\n        b = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = b;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "13995", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[1000], b[1000];\nvoid init() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = m - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        int t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        int t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid combine() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid print() {\n  for (int i = 0; i < m + n; i++) {\n    if (i)\n      cout << ' ';\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "13996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2;\nint *p1;\nint *p2;\nint *p3;\nint main() {\n  scanf(\"%d %d\", &n1, &n2);\n  p1 = (int *)malloc(n1 * sizeof(int));\n  p2 = (int *)malloc(n2 * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    scanf(\"%d\", &p1[k]);\n  for (int k = 0; k < n2; k++)\n    scanf(\"%d\", &p2[k]);\n  for (int k = n1 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p1[i] > p1[i + 1]) {\n        int t;\n        t = p1[i];\n        p1[i] = p1[i + 1];\n        p1[i + 1] = t;\n      }\n    }\n  }\n\n  for (int k = n2 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p2[i] > p2[i + 1]) {\n        int t;\n        t = p2[i];\n        p2[i] = p2[i + 1];\n        p2[i + 1] = t;\n      }\n    }\n  }\n  p3 = (int *)malloc((n1 + n2) * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    p3[k] = p1[k];\n  for (int i = n1; i < n1 + n2; i++)\n    p3[i] = p2[i - n1];\n  int c;\n  for (c = 0; c < n1 + n2; c++) {\n    if (c == 0)\n      printf(\"%d\", p3[0]);\n    else\n      printf(\" %d\", p3[c]);\n  }\n}\n"}
{"label": "8", "index": "13997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000], y[1000], z[2000];\nint i, j, n, m, ex;\nvoid read() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> x[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &y[i]);\n}\nvoid paixu() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1; j++)\n      if (x[j + 1] < x[j]) {\n        ex = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = ex;\n      }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - 1; j++)\n      if (y[j] > y[j + 1]) {\n        ex = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = ex;\n      }\n}\nvoid heping() {\n  for (i = 0; i < n; i++)\n    z[i] = x[i];\n  for (i = 0; i < m; i++)\n    z[n + i] = y[i];\n}\nvoid display() {\n  for (i = 0; i < n + m; i++) {\n    if (i == 0)\n      cout << z[i];\n    else\n      cout << \" \" << z[i];\n  }\n}\nint main() {\n  read();\n  paixu();\n  heping();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "13998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m = 0, n = 0, i = 0;\n  int a[1000], b[1000];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  paixu(a, m);\n  paixu(b, n);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "13999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint order(int n, int a[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i; j < n; j++)\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nint combine(int a[], int b[], int n, int m, int c[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (j = 0; j < m; j++, i++)\n    c[i] = b[j];\n}\nint input(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nint output(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cout << a[i];\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[n], b[m], c[n + m];\n  input(n, a);\n  input(m, b);\n  order(n, a);\n  order(m, b);\n  combine(a, b, n, m, c);\n  output(n + m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101];\n  int b[101];\n  int m, n, i, j, k, l, w, x, y, z, c, d;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < m - 1; k++) {\n    for (l = 0; l < m - 1 - k; l++) {\n      if (a[l] > a[l + 1]) {\n        c = a[l];\n        a[l] = a[l + 1];\n        a[l + 1] = c;\n      }\n    }\n  }\n  for (w = 0; w < n - 1; w++) {\n    for (x = 0; x < n - 1 - w; x++) {\n      if (b[x] > b[x + 1]) {\n        d = b[x];\n        b[x] = b[x + 1];\n        b[x + 1] = d;\n      }\n    }\n  }\n  for (y = 0; y < m - 1; y++) {\n    printf(\"%d \", a[y]);\n  }\n  printf(\"%d\", a[m - 1]);\n  for (z = 0; z < n; z++) {\n    cout << \" \" << b[z];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14001", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid duqu() {\n  int i;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  }\n}\nvoid shuchu() {\n  int i, j;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= m; i++)\n    cout << \" \" << a[i];\n  for (j = 1; j <= n; j++)\n    cout << \" \" << b[j];\n  cout << endl;\n}\nint main() {\n  duqu();\n  paixu();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\nvoid link(int array1[], int array2[], int m, int n) {\n  int i;\n  for (i = m; i < m + n; i++)\n    array1[i] = array2[i - m];\n}\n\nint main() {\n  int a[40], b[20], n1, n2, i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, n1);\n  sort(b, n2);\n  link(a, b, n1, n2);\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i == n1 + n2 - 1)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(int, int);\nvoid b(int[], int[], int, int);\nvoid c(int[], int[], int, int);\nvoid d(int[], int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  a(n1, n2);\n  return 0;\n}\nvoid a(int n1, int n2) {\n  int num1[101], num2[101], i;\n  for (i = 1; i <= n1; i++)\n    cin >> num1[i];\n\n  for (i = 1; i <= n2; i++)\n    cin >> num2[i];\n  b(num1, num2, n1, n2);\n}\nvoid b(int num1[], int num2[], int n1, int n2) {\n  int i, j, mid;\n  for (i = 1; i <= n1 - 1; i++) {\n    for (j = 1; j <= n1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        mid = num1[j + 1];\n        num1[j + 1] = num1[j];\n        num1[j] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= n2 - 1; i++) {\n    for (j = 1; j <= n2 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        mid = num2[j + 1];\n        num2[j + 1] = num2[j];\n        num2[j] = mid;\n      }\n    }\n  }\n  c(num1, num2, n1, n2);\n}\nvoid c(int num1[], int num2[], int n1, int n2) {\n  int num[201], i, j;\n  for (i = 1; i <= n1; i++) {\n    num[i] = num1[i];\n  }\n  for (i = n1 + 1; i <= n1 + n2; i++)\n    num[i] = num2[i - n1];\n\n  d(num, n1 + n2);\n}\nvoid d(int num[], int n) {\n  int i;\n  for (i = 1; i <= n - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n];\n}\n"}
{"label": "8", "index": "14004", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0, a[100] = {0}, b[100] = {0};\nvoid got() {\n  cin >> m >> n;\n  int i = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f(int a[], int b[]) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid plus(int a[], int b[]) {\n  for (int i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shu(int a[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i == m + n - 1)\n      cout << a[i];\n    else\n      cout << a[i] << \" \";\n  }\n}\nint main() {\n  got();\n  f(a, b);\n  for (int i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < n; i++) {\n    if (i != n - 1)\n      cout << b[i] << \" \";\n    else\n      printf(\"%d\", b[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "14005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sca(int n, int l);\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  sca(n1, 1);\n  sca(n2, 2);\n}\nvoid sca(int n, int l) {\n  int i, j, a[100] = {0}, p;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n    for (j = i; j > 0; j = j - 1) {\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i = i + 1)\n    printf(\"%d \", a[i]);\n  if (l == 1)\n    printf(\"%d \", a[n - 1]);\n  else\n    printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "14006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, m, n;\nvoid gets() {\n  int i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> num1[i];\n  for (j = 0; j < n; j++)\n    cin >> num2[j];\n}\nvoid paixu() {\n  int i, j, a = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        a = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        a = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = a;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    num1[m + i] = num2[i];\n}\nvoid shuchu() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << num1[i];\n}\nint main() {\n  gets();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14007", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int a[], int b[]);\nvoid sort(int a[], int b[]);\nvoid link(int a[], int b[]);\nvoid output(int a[]);\nint input1[100], input2[100], n1, n2;\nint main() {\n  read(input1, input2);\n  sort(input1, input2);\n  link(input1, input2);\n  output(input1);\n  return 0;\n}\nvoid read(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n  for (i = 0; i < n2 - 1; i++) {\n    for (j = i + 1; j < n2; j++)\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n  }\n}\nvoid link(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\nvoid output(int a[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "14008", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct HaHa {\n  int x, y, z[2][1000], g[2000];\n};\nstruct HaHa scan() {\n  struct HaHa hehe;\n  int i, j;\n  cin >> hehe.x >> hehe.y;\n  for (i = 0; i < hehe.x; i++)\n    scanf(\"%d\", &hehe.z[0][i]);\n  for (j = 0; j < hehe.y; j++)\n    scanf(\"%d\", &hehe.z[1][j]);\n  return (hehe);\n}\nstruct HaHa line(struct HaHa yahoo) {\n  int i, temp, j;\n  struct HaHa yahoo1;\n  for (i = 0; i < yahoo.x; i++) {\n    for (j = i; j < yahoo.x; j++) {\n      if (yahoo.z[0][i] > yahoo.z[0][j]) {\n        temp = yahoo.z[0][i];\n        yahoo.z[0][i] = yahoo.z[0][j];\n        yahoo.z[0][j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < yahoo.y; i++) {\n    for (j = i; j < yahoo.y; j++) {\n      if (yahoo.z[1][i] > yahoo.z[1][j]) {\n        temp = yahoo.z[1][i];\n        yahoo.z[1][i] = yahoo.z[1][j];\n        yahoo.z[1][j] = temp;\n      }\n    }\n  }\n  yahoo1 = yahoo;\n  return (yahoo1);\n}\nstruct HaHa combine(struct HaHa xx) {\n  int i;\n  struct HaHa xx1;\n  for (i = 0; i < xx.x; i++) {\n    xx.g[i] = xx.z[0][i];\n  }\n  for (i = 0; i < xx.y; i++) {\n    xx.g[i + xx.x] = xx.z[1][i];\n  }\n  xx1 = xx;\n  return (xx1);\n}\nvoid print(struct HaHa xxx) {\n  int i;\n  for (i = 0; i < xxx.x + xxx.y - 1; i++) {\n    printf(\"%d \", xxx.g[i]);\n  }\n  printf(\"%d\", xxx.g[xxx.x + xxx.y - 1]);\n}\nint main() { print(combine(line(scan()))); }\n"}
{"label": "8", "index": "14009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000], b[1000], c[2000];\nint m, n;\n\nvoid inputarray(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid input() {\n  cin >> m >> n;\n  inputarray(a, m);\n  inputarray(b, n);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[i];\n}\n\nint main() {\n  input();\n  sort(a, m);\n  sort(b, n);\n  combine(a, b, c, m, n);\n  output(c, m + n);\n}\n"}
{"label": "8", "index": "14010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a;\nint str1[10000], str2[10000];\nvoid dosomething(int str[10000], int q);\n\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &str1[i]);\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", &str2[i]);\n  dosomething(str1, n);\n  dosomething(str2, m);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", str1[i]);\n  for (int i = 0; i < m; i++)\n    i == 0 ? printf(\"%d\", str2[i]) : printf(\" %d\", str2[i]);\n  return 0;\n}\n\nvoid dosomething(int str[10000], int q) {\n  for (int i = 0; i < q - 1; i++)\n    for (int j = i + 1; j < q; j++) {\n      if (str[i] > str[j])\n        a = str[i], str[i] = str[j], str[j] = a;\n    }\n}\n"}
{"label": "8", "index": "14011", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x, y;\nint print() {\n  cout << \" \";\n  return 0;\n}\nvoid order(int n) {\n  int i, j, temp = 0;\n  int a[10];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j + 1] < a[j]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n\n  cout << a[n - 1];\n}\nint main() {\n  cin >> x >> y;\n  order(x);\n  print();\n  order(y);\n  return 0;\n}\n"}
{"label": "8", "index": "14012", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100] = {0}, b[100] = {0};\nint i = 0, j = 0, I, J;\n\nint main() {\n  void load();\n  void order(int a[], int b[]);\n  void conflate(int a[], int b[]);\n  void print(int a[]);\n\n  load();\n  order(a, b);\n  conflate(a, b);\n  print(a);\n}\n\nvoid load() {\n\n  scanf(\"%d %d\", &i, &j);\n  I = i;\n  J = j;\n  for (i = 0; i < I; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < J; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\n\nvoid order(int a[], int b[]) {\n  void xu(int x[], int y);\n\n  xu(a, I);\n  xu(b, J);\n}\n\nvoid xu(int x[], int y) {\n  int *p, *q, *temp, t;\n  p = x;\n  for (i = 0; i < y - 1; i++) {\n    p = &x[i];\n    for (j = i + 1; j < y; j++) {\n      q = &x[j];\n      if (*p > *q) {\n        temp = p;\n        p = q;\n        q = temp;\n      }\n    }\n    if (p != &x[i]) {\n      t = *p;\n      *p = x[i];\n      x[i] = t;\n    }\n  }\n}\n\nvoid conflate(int a[], int b[]) {\n  for (i = I; i < I + J; i++) {\n    a[i] = b[i - I];\n  }\n}\n\nvoid print(int a[]) {\n  for (i = 0; i < I + J; i++) {\n    printf(\"%d\", a[i]);\n    if (i < I + J - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct HaHa {\n  int x, y, z[2][1000], g[2000];\n};\nstruct HaHa scan() {\n  struct HaHa hehe;\n  int i, j;\n  scanf(\"%d%d\", &hehe.x, &hehe.y);\n  for (i = 0; i < hehe.x; i++) {\n    scanf(\"%d\", &hehe.z[0][i]);\n  }\n  for (j = 0; j < hehe.y; j++) {\n    scanf(\"%d\", &hehe.z[1][j]);\n  }\n  return (hehe);\n}\nstruct HaHa line(struct HaHa yahoo) {\n  int i, temp, j;\n  struct HaHa yahoo1;\n  for (i = 0; i < yahoo.x; i++) {\n    for (j = i; j < yahoo.x; j++) {\n      if (yahoo.z[0][i] > yahoo.z[0][j]) {\n        temp = yahoo.z[0][i];\n        yahoo.z[0][i] = yahoo.z[0][j];\n        yahoo.z[0][j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < yahoo.y; i++) {\n    for (j = i; j < yahoo.y; j++) {\n      if (yahoo.z[1][i] > yahoo.z[1][j]) {\n        temp = yahoo.z[1][i];\n        yahoo.z[1][i] = yahoo.z[1][j];\n        yahoo.z[1][j] = temp;\n      }\n    }\n  }\n  yahoo1 = yahoo;\n  return (yahoo1);\n}\nstruct HaHa combine(struct HaHa xx) {\n  int i;\n  struct HaHa xx1;\n  for (i = 0; i < xx.x; i++) {\n    xx.g[i] = xx.z[0][i];\n  }\n  for (i = 0; i < xx.y; i++) {\n    xx.g[i + xx.x] = xx.z[1][i];\n  }\n  xx1 = xx;\n  return (xx1);\n}\nvoid print(struct HaHa xxx) {\n  int i;\n  for (i = 0; i < xxx.x + xxx.y - 1; i++) {\n    printf(\"%d \", xxx.g[i]);\n  }\n  printf(\"%d\", xxx.g[xxx.x + xxx.y - 1]);\n}\nint main() { print(combine(line(scan()))); }\n"}
{"label": "8", "index": "14014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m = 0, n = 0;           \nint a[100], b[100], c[200]; \nvoid read(void) {           \n  int i = 0;                \n  cin >> m >> n;            \n  for (i = 0; i < m; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++)\n    cin >> b[i]; \n}\nvoid sort(void) {             \n  int i = 0, j = 0, temp = 0; \n  for (i = 1; i < m; i++)     \n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) { \n        temp = a[j];         \n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = 1; i < n; i++) \n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) { \n        temp = b[j];         \n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid combine(void) { \n  int i = 0;         \n  for (i = 0; i < m; i++)\n    c[i] = a[i]; \n  for (i = 0; i < n; i++)\n    c[i + m] = b[i]; \n}\nvoid output(void) { \n  int i = 0;        \n  cout << c[0];     \n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i]; \n}\nint main() { \n  read();    \n  sort();    \n  combine(); \n  output();  \n  return 0;\n}\n"}
{"label": "8", "index": "14015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid read(int *pm, int *pn, int *p1, int *p2) {\n  int i, j;\n  scanf(\"%d %d\", pm, pn);\n  for (i = 0; i < *pm; i++)\n    scanf(\"%d\", p1 + i);\n  for (j = 0; j < *pn; j++)\n    scanf(\"%d\", p2 + j);\n}\n\nvoid sort(int *pm, int *pn, int *p1, int *p2) {\n  int i, j, k, tmp;\n  for (i = 0; i < *pm - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pm; j++)\n      if (*(p1 + j) < *(p1 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p1 + k);\n      *(p1 + k) = *(p1 + i);\n      *(p1 + i) = tmp;\n    }\n  }\n  for (i = 0; i < *pn - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pn; j++)\n      if (*(p2 + j) < *(p2 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p2 + k);\n      *(p2 + k) = *(p2 + i);\n      *(p2 + i) = tmp;\n    }\n  }\n}\n\nint combine(int *pm, int *pn, int *p1, int *p2, int *pnew) {\n  int i, j;\n  for (i = 0; i < *pm; i++)\n    *(pnew + i) = *(p1 + i);\n  for (j = 0; j < *pn; j++)\n    *(pnew + i + j) = *(p2 + j);\n  return i + j;\n}\n\nvoid print(int *pk, int *pnew) {\n  int i;\n  for (i = 0; i < *pk; i++) {\n    cout << *(pnew + i);\n    if (i == *pk - 1)\n      printf(\"\\n\");\n    else\n      printf(\" \");\n  }\n}\n\nint main() {\n  int m = 0, n = 0, k = 0, a[10] = {0}, b[10] = {0};\n  int *pm = &m, *pn = &n, *pa = a, *pb = b;\n  int New[20] = {0}, *pk = &k, *pnew = New;\n  read(pm, pn, pa, pb);\n  sort(pm, pn, pa, pb);\n  *pk = combine(pm, pn, pa, pb, pnew);\n  print(pk, pnew);\n  return 0;\n}\n"}
{"label": "8", "index": "14016", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000], c[2000];\nint m, n;\n\nvoid inputarray(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  inputarray(a, m);\n  inputarray(b, n);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\n\nint main() {\n  input();\n  sort(a, m);\n  sort(b, n);\n  combine(a, b, c, m, n);\n  output(c, m + n);\n}\n"}
{"label": "8", "index": "14017", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[50];\nint b[50];\nint c[100];\nint m = 0, n = 0, temp;\nvoid IN();\nvoid OR();\nvoid LIAN();\nvoid OU();\nint main() {\n  IN();\n  OR();\n  LIAN();\n  OU();\n}\n\nvoid IN() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid OR() {\n  int i, j;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid LIAN() {\n  int i;\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n}\n\nvoid OU() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n"}
{"label": "8", "index": "14018", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint num1, num2;\nvoid getin() {\n  int i, j;\n  cin >> num1 >> num2;\n  for (i = 1; i <= num1; i++)\n    cin >> a[i];\n  for (j = 1; j <= num2; j++)\n    cin >> b[j];\n}\nvoid order(int aa[], int num) {\n  int t, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j < num; j++)\n      if (aa[j] > aa[j + 1]) {\n        t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n}\nvoid print(int a[], int b[], int num1, int num2) {\n  cout << a[1];\n  int i;\n  for (i = 2; i <= num1; i++)\n    printf(\" %d\", a[i]);\n  for (i = 1; i <= num2; i++)\n    cout << \" \" << b[i];\n  printf(\"\\n\");\n}\n\nint main() {\n\n  getin();\n  order(a, num1);\n  order(b, num2);\n  print(a, b, num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "14019", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint num1;\nint num2;\nint main() {\n  void read();\n  void queue();\n  void combine();\n  void put();\n  read();\n  queue();\n  combine();\n  put();\n  return 0;\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &num1, &num2);\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid queue() {\n  int i, j, t;\n  for (i = 0; i < num1 - 1; i++) {\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < num2 - 1; i++) {\n    for (j = 0; j < num2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < num2; i++)\n    c[i + num1] = b[i];\n}\nvoid put() {\n  int i;\n  for (i = 0; i < num1 + num2 - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[num1 + num2 - 1]);\n}\n"}
{"label": "8", "index": "14020", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int array[], int k);\n  void g(int c[], int d[], int o, int p);\n  int n, m, a[200], b[100], i, j, e[200], z;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  g(a, b, n, m);\n  for (z = 0; z < n + m - 1; z++) {\n    printf(\"%d \", a[z]);\n  }\n  printf(\"%d\", a[n + m - 1]);\n  return 0;\n}\nvoid f(int array[], int k) {\n  int r, s, t;\n  for (r = 0; r < k - 1; r++)\n    for (s = 0; s < k - 1 - r; s++) {\n      if (array[s] > array[s + 1]) {\n        t = array[s];\n        array[s] = array[s + 1];\n        array[s + 1] = t;\n      }\n    }\n}\nvoid g(int c[], int d[], int o, int p) {\n  int u;\n  for (u = o; u <= o + p - 1; u++) {\n    c[u] = d[u - o];\n  }\n}\n"}
{"label": "8", "index": "14021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\nint main() {\n  int m, n, i;\n  int a[50], b[50];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, m);\n  printf(\" \");\n  order(b, n);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "14022", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint scan() {\n  int m;\n  cin >> m;\n  return m;\n}\nint fuzhi(int a[], int n) {\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k);\n    a[i] = k;\n  }\n  return 0;\n}\nint paixu(int b[], int n) {\n  int i, j, temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  return 0;\n}\nint print(int c[], int d[], int m3, int m4) {\n  int i = 0;\n  for (i = 0; i < m3; i++) {\n    printf(\"%d \", c[i]);\n  }\n  for (i = 0; i < m4; i++) {\n    printf(\"%d\", d[i]);\n    if (i != m4 - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int m1;\n  int m2;\n  int x[100];\n  int y[100];\n  m1 = scan();\n  m2 = scan();\n  fuzhi(x, m1);\n  fuzhi(y, m2);\n  paixu(x, m1);\n  paixu(y, m2);\n  print(x, y, m1, m2);\n  return 0;\n}\n"}
{"label": "8", "index": "14023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *change(int x[100], int y);\n  int a1, a2, i;\n  int *pt1, *pt2;\n  int b[100], c[100];\n  scanf(\"%d%d\", &a1, &a2);\n  for (i = 0; i < a1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pt1 = change(b, a1);\n  for (i = 0; i < a2; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  pt2 = change(c, a2);\n  for (i = 0; i < a1; i++) {\n    printf(\"%d \", *(pt1 + i));\n  }\n  for (i = 0; i < a2 - 1; i++) {\n    printf(\"%d \", *(pt2 + i));\n  }\n  printf(\"%d\", *(pt2 + a2 - 1));\n}\nint *change(int x[100], int y) {\n  int j, k, temp = 0;\n  for (j = 1; j < y; j++) {\n    for (k = 0; k < y - j; k++) {\n      if (x[k] > x[k + 1]) {\n        temp = x[k + 1];\n        x[k + 1] = x[k];\n        x[k] = temp;\n      }\n    }\n  }\n  return (x);\n}\n"}
{"label": "8", "index": "14024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int *n1, int data1[], int *n2, int data2[]) {\n  cin >> *n1 >> *n2;\n  for (int i = 0; i < *n1; ++i)\n    cin >> data1[i];\n  for (int i = 0; i < *n2; ++i)\n    cin >> data2[i];\n  return;\n}\nvoid bubblesort(int n, int data[]) {\n  for (int i = n - 1; i > 0; --i)\n    for (int j = 0; j < i; ++j)\n      if (data[j] > data[j + 1]) {\n        int temp = data[j];\n        data[j] = data[j + 1];\n        data[j + 1] = temp;\n      }\n  return;\n}\nint combine(int n1, int data1[], int n2, int data2[], int data3[]) {\n  for (int i = 0; i < n1; ++i)\n    data3[i] = data1[i];\n  for (int i = n1; i < n1 + n2; ++i)\n    data3[i] = data2[i - n1];\n  return n1 + n2;\n}\nvoid print(int n, int data[]) {\n  cout << data[0];\n  for (int i = 1; i < n; ++i)\n    cout << ' ' << data[i];\n  cout << endl;\n  return;\n}\nint main() {\n  int n1, n2, a1[101], a2[101], a3[201];\n  input(&n1, a1, &n2, a2);\n  bubblesort(n1, a1);\n  bubblesort(n2, a2);\n  \n  \n  int n3 = combine(n1, a1, n2, a2, a3);\n  print(n3, a3);\n  return 0;\n}\n"}
{"label": "8", "index": "14025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100], c[100];\nvoid input() {\n  cin >> m >> n;\n  int i, j, k, l;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (j = 1; j <= n; j++)\n    cin >> b[j];\n}\nvoid paixu(int a[100], int b[100]) {\n  int i, j, k, l;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j < m - i + 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid he(int a[100], int b[100]) {\n  int i, j;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (j = i; j <= i + n; j++)\n    c[j] = b[j - i + 1];\n}\nvoid output(int c[100]) {\n  cout << c[1];\n  int i;\n  for (i = 2; i <= m + n; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  input();\n  paixu(a, b);\n  he(a, b);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct nums {\n  int m;\n  int n;\n  int x[2][100];\n};\nstruct nums get() {\n  int i;\n  struct nums in;\n  scanf(\"%d%d\", &in.m, &in.n);\n  getchar();\n  for (i = 0; i < in.m; i++)\n    scanf(\"%d\", &in.x[0][i]);\n  for (i = 0; i < in.n; i++)\n    scanf(\"%d\", &in.x[1][i]);\n\n  return in;\n}\nstruct nums bubble(struct nums in) {\n  int i, j, c;\n  for (i = 1; i <= in.m; i++)\n    for (j = 0; j < in.m - 1; j++) {\n      if (in.x[0][j] > in.x[0][j + 1]) {\n        c = in.x[0][j];\n        in.x[0][j] = in.x[0][j + 1];\n        in.x[0][j + 1] = c;\n      }\n    }\n  for (i = 1; i <= in.n; i++) {\n    for (j = 0; j < in.n - 1; j++)\n      if (in.x[1][j] > in.x[1][j + 1]) {\n        c = in.x[1][j];\n        in.x[1][j] = in.x[1][j + 1];\n        in.x[1][j + 1] = c;\n      }\n  }\n  return in;\n}\nstruct nums combine(struct nums in) {\n  int i;\n  for (i = in.m; i < in.m + in.n; i++)\n    in.x[0][i] = in.x[1][i - in.m];\n  return in;\n}\nvoid put(struct nums in) {\n  int i;\n  printf(\"%d\", in.x[0][0]);\n  for (i = 1; i < in.m + in.n; i++)\n    printf(\" %d\", in.x[0][i]);\n}\nint main() {\n  struct nums in = get();\n  struct nums ina = bubble(in);\n  struct nums inb = combine(ina);\n  put(inb);\n  return 0;\n}\n"}
{"label": "8", "index": "14027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[200], i, j, la, lb, p;\nint main() {\n  void canf();\n  void px();\n  void lj();\n  void rintf();\n  canf();\n  px();\n  lj();\n  rintf();\n}\n\nvoid canf() {\n  scanf(\"%d%d\", &la, &lb);\n  for (i = 0; i <= la - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= lb - 1; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid px() {\n  for (i = 0; i <= la - 2; i++) {\n    for (j = i + 1; j <= la - 1; j++)\n      if (a[j] < a[i]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n  }\n  for (i = 0; i <= lb - 2; i++) {\n    for (j = i + 1; j <= lb - 1; j++)\n      if (b[j] < b[i]) {\n        p = b[i];\n        b[i] = b[j];\n        b[j] = p;\n      }\n  }\n}\n\nvoid lj() {\n  for (i = 0; i <= la - 1; i++)\n    c[i] = a[i];\n  for (i = la; i <= la + lb - 1; i++)\n    c[i] = b[i - la];\n}\n\nvoid rintf() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= la + lb - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14028", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid f(int m, int n) {\n  int i, j;\n  int temp;\n  int a[100] = {0};\n  int b[100] = {0};\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n\n  f(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14029", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  void shuru(int *p, int len);\n  void paixu(int *p, int len);\n  void hebing(int *p1, int *p2);\n  void shuchu(int *p, int, int);\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  int *p1, *p2;\n  int a[200] = {'\\0'}, b[100] = {'\\0'};\n  p1 = a;\n  p2 = b;\n  shuru(p1, m);\n  shuru(p2, n);\n  paixu(p1, m);\n  paixu(p2, n);\n  hebing(p1, p2);\n  shuchu(p1, m, n);\n}\n\nvoid shuru(int *p, int len) {\n  int i;\n  for (i = 0; i < len; i++)\n    scanf(\"%d\", p + i);\n}\n\nvoid paixu(int *p, int len) {\n  int i, j, temp;\n  for (i = 0; i < len - 1; i++)\n    for (j = i + 1; j < len; j++)\n      if (*(p + i) > *(p + j)) {\n        temp = *(p + i);\n        *(p + i) = *(p + j);\n        *(p + j) = temp;\n      }\n}\n\nvoid hebing(int *p1, int *p2) {\n  int i, j, flag;\n  for (i = 0;; i++) {\n    flag = 0;\n    if (*(p1 + i) == '\\0') {\n      for (j = 0; *(p2 + j) != '\\0'; j++)\n        *(p1 + i + j) = *(p2 + j);\n      *(p1 + i + j) = '\\0';\n      flag = 1;\n    }\n    if (flag == 1)\n      break;\n  }\n}\n\nvoid shuchu(int *p, int m, int n) {\n  int i;\n  char c;\n  for (i = 0; *(p + i) != '\\0'; i++)\n    printf(\"%d%c\", *(p + i), c = (i < n + m - 1) ? ' ' : '\\n');\n}\n"}
{"label": "8", "index": "14030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], c, d;\nvoid kg();\nvoid m(int);\nvoid r();\nint main() {\n  r();\n  m(c);\n  kg();\n  m(d);\n  return 0;\n}\nvoid r() { scanf(\"%d%d\", &c, &d); }\nvoid m(int s) {\n  int i, j, t;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < s - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%d\", a[i]);\n    if (i < s - 1)\n      kg();\n  }\n}\nvoid kg() { printf(\" \"); }\n"}
{"label": "8", "index": "14031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[20], b[20], c[40];\nvoid read(int x1, int x2) {\n  int i;\n  for (i = 0; i < x1; i++)\n    cin >> a[i];\n  for (i = 0; i < x2; i++)\n    scanf(\"%d \", &b[i]);\n  return;\n}\nvoid sort1(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n  return;\n}\nvoid sort2(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n  return;\n}\nvoid combine(int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n  return;\n}\n\nvoid arraycout(int n1, int n2) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n  return;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  read(n1, n2);\n  sort1(n1);\n  sort2(n2);\n  combine(n1, n2);\n  arraycout(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14032", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\nint main() {\n  int m, n, i;\n  int a[50], b[50];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, m);\n  printf(\" \");\n  order(b, n);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *putin() {\n  int a, b, n;\n  scanf(\"%d %d\", &a, &b);\n  int *p = (int *)malloc((a + b + 2) * sizeof(int));\n  *p = a;\n  *(p + 1) = b;\n  for (n = 2; n <= a + b + 1; n++)\n    scanf(\"%d\", (p + n));\n  return p;\n}\nint *compare(int *a) {\n  int n, m, p;\n  for (n = 2; n <= (*a); n++) {\n    for (m = n + 1; m <= (*a) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  for (n = (*a) + 2; n <= (*a) + (*(a + 1)); n++) {\n    for (m = n + 1; m <= (*a) + (*(a + 1)) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  return a;\n}\nvoid putout(int *a) {\n  int x;\n  for (x = 2; x <= (*a) + (*(a + 1)); x++)\n    printf(\"%d \", a[x]);\n  printf(\"%d\", a[(*a) + (*(a + 1)) + 1]);\n}\nint main() {\n  putout(compare(putin()));\n  return 0;\n}\n"}
{"label": "8", "index": "14034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], n, m, i, j, t;\nvoid shuru(int p, int q) {\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid shuchu(int p, int q) {\n  for (i = 0; i < p; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < q - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[q - 1]);\n}\nvoid paixu(int p, int c[]) {\n  for (i = 0; i < p; i++)\n    for (j = 0; j < i; j++)\n      if (c[i] < c[j]) {\n        t = c[i];\n        c[i] = c[j];\n        c[j] = t;\n      }\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  shuru(n, m);\n  paixu(n, a);\n  paixu(m, b);\n  shuchu(n, m);\n}\n"}
{"label": "8", "index": "14035", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num1, num2, array_11[20], array_12[20], array_1[40];\n\nvoid input(int array_11[], int array_12[]) {\n  int i, j;\n\n  scanf(\"%d %d\", &num1, &num2);\n\n  for (i = 0; i <= num1 - 1; i++)\n    scanf(\"%d\", &array_11[i]);\n  for (j = 0; j <= num2 - 1; j++)\n    scanf(\"%d\", &array_12[j]);\n}\n\nvoid sort(int array_1[], int n) {\n  int i, j, t;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (array_1[j] > array_1[j + 1]) {\n        t = array_1[j];\n        array_1[j] = array_1[j + 1];\n        array_1[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid link(int array_11[], int array_12[], int array_1[], int n1, int n2) {\n  int i;\n\n  for (i = 0; i < n1; i++) {\n    array_1[i] = array_11[i];\n  }\n  for (i = 0; i < n2; i++)\n    array_1[i + n1] = array_12[i];\n}\n\nvoid output(int array_1[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d%c\", array_1[i], i < n - 1 ? ' ' : ' ');\n  }\n}\n\nint main() {\n  input(array_11, array_12);\n  sort(array_11, num1);\n  sort(array_12, num2);\n  link(array_11, array_12, array_1, num1, num2);\n  output(array_1, num1 + num2);\n}\n"}
{"label": "8", "index": "14036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint na, nb;\nint a[10000], b[10000], c[10000];\nvoid f1() {\n  cin >> na >> nb;\n  for (int i = 0; i <= na - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= nb - 1; i++)\n    cin >> b[i];\n}\nvoid f2() {\n  sort(a, a + na);\n  sort(b, b + nb);\n}\nvoid f3() {\n  for (int i = 0; i <= na - 1; i++)\n    c[i] = a[i];\n  for (int i = na; i <= na + nb - 1; i++)\n    c[i] = b[i - na];\n}\nvoid f4() {\n  cout << c[0];\n  for (int i = 1; i <= na + nb - 1; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int n1, int n2, int s1[], int s2[]);\nvoid bubble_sort(int s[], int n);\nvoid write(int n1, int n2, int s1[], int s2[]);\nint main() {\n  int n1, n2, s1[101], s2[101];\n  scanf(\"%d%d\", &n1, &n2);\n  read(n1, n2, s1, s2);\n  bubble_sort(s1, n1);\n  bubble_sort(s2, n2);\n  write(n1, n2, s1, s2);\n}\nvoid read(int n1, int n2, int s1[], int s2[]) {\n  int i;\n\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid bubble_sort(int s[], int n) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (s[j] > s[j + 1]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n}\nvoid write(int n1, int n2, int s1[], int s2[]) {\n  int i;\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < n1; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n2; i++)\n    printf(\" %d\", s2[i]);\n}\n"}
{"label": "8", "index": "14038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint arr(int a[], int x, int b[], int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  return 0;\n}\nint arr1(int a[], int x, int b[], int y) {\n  int i, j, tmp;\n  for (i = 0; i < x - 1; i++)\n    for (j = i + 1; j < x; j++)\n      if (a[i] > a[j]) {\n        tmp = a[i];\n        a[i] = a[j];\n        a[j] = tmp;\n      }\n  for (i = 0; i < y - 1; i++) {\n    for (j = i + 1; j < y; j++)\n      if (b[i] > b[j]) {\n        tmp = b[i];\n        b[i] = b[j];\n        b[j] = tmp;\n      }\n  }\n  return 0;\n}\nint arr2(int a[], int x, int b[], int y, int c[]) {\n  int i, j;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (; i < x + y; i++)\n    c[i] = b[i - x];\n  return 0;\n}\nint arr3(int c[], int t) {\n  int i;\n  for (i = 0; i < t; i++) {\n    printf(\"%d\", c[i]);\n    if (i < t - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint main() {\n  int x, y;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &x, &y);\n  arr(a, x, b, y);\n  arr1(a, x, b, y);\n  arr2(a, x, b, y, c);\n  arr3(c, x + y);\n  return 0;\n}\n"}
{"label": "8", "index": "14039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint la, lb;\n\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d\", &la, &lb);\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[]) {\n  int i;\n  int t;\n  for (i = 0; i < la - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n  for (i = 0; i < lb - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      if (i != 0)\n        i = i - 2;\n    }\n  }\n}\n\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n}\n\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i < (la + lb); i++) {\n    if (i != (la + lb - 1))\n      printf(\"%d \", a[i]);\n    else\n      printf(\"%d\", a[i]);\n  }\n}\n\nint main() {\n  int x[200], y[100];\n  read(x, y);\n\n  sort(x, y);\n\n  combine(x, y);\n  print(x);\n  return 0;\n}\n"}
{"label": "8", "index": "14040", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint m, n;\nint i, j, t;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[j] < a[i]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] < b[i]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid cat() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid print() {\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  read();\n  sort();\n  cat();\n  print();\n}\n"}
{"label": "8", "index": "14041", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[1000], b[1000], c[2000];\nvoid f1(void) {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(void) {\n  int i, j, p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(void) {\n  int i, count = 0;\n  for (i = 0; i < n + m; i++) {\n    if (count == 0) {\n      printf(\"%d\", c[i]);\n      count++;\n    } else\n      printf(\" %d\", c[i]);\n  }\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], m, n;\nint c[200];\nint shuru() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return 0;\n}\nint paixu() {\n  int i = 0, j = 0, t = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint hebing() {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = m; i < m + n; i++)\n    c[i] = b[i - m];\n\n  return 0;\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14043", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid get(int m, int n);\nvoid swap(int m, int n);\nvoid put(int m, int n);\nint a[1001], b[1001];\nint main() {\n  int m, n;\n  cin >> m >> n;\n  get(m, n);\n  swap(m, n);\n  put(m, n);\n  return 0;\n}\nvoid get(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid swap(int m, int n) {\n  int j, k, c;\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (a[k] > a[k + 1]) {\n        c = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++) {\n      if (b[k] > b[k + 1]) {\n        c = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = c;\n      }\n    }\n}\nvoid put(int m, int n) {\n  int l;\n  for (l = 0; l < m; l++)\n    printf(\"%d \", a[l]);\n  for (l = 0; l < n; l++) {\n    if (l == n - 1)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n}\n"}
{"label": "8", "index": "14044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[200], a2[200], i, j, t;\nvoid toscan() {\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid paixu() {\n  for (i = 1; i < n1; i++)\n    for (j = 0; j < i; j++)\n      if (a1[j] > a1[i]) {\n        t = a1[i];\n        a1[i] = a1[j];\n        a1[j] = t;\n      }\n  for (i = 1; i < n2; i++)\n    for (j = 0; j < i; j++)\n      if (a2[j] > a2[i]) {\n        t = a2[i];\n        a2[i] = a2[j];\n        a2[j] = t;\n      }\n}\n\nvoid hebing() {\n  for (i = 0; i < n2; i++)\n    a1[i + n1] = a2[i];\n}\n\nvoid toprint() {\n  printf(\"%d\", a1[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", a1[i]);\n}\n\nint main() {\n  toscan();\n  paixu();\n  hebing();\n  toprint();\n  \n}\n"}
{"label": "8", "index": "14045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[2] = {0}, a[2][100] = {0}, i, j, t, m;\n  scanf(\"%d %d \", &length[0], &length[1]);\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < length[i]; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < 2; i++)\n    for (m = 1; m < length[i]; m++)\n      for (j = 0; j < length[i] - m; j++)\n        if (a[i][j] > a[i][j + 1]) {\n          t = a[i][j];\n          a[i][j] = a[i][j + 1];\n          a[i][j + 1] = t;\n        }\n  for (j = 0; j < length[0]; j++)\n    cout << a[0][j] << \" \";\n  cout << a[1][0];\n  for (j = 1; j < length[1]; j++)\n    cout << \" \" << a[1][j];\n  return 0;\n}\n"}
{"label": "8", "index": "14046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000], num2[1000], num[2000], n1, n2;\nvoid dr() {\n  cin >> n1 >> n2;\n  int i;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &num2[i]);\n}\nint px() {\n  int i, j, tem;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tem = num1[i];\n        num1[i] = num1[j];\n        num1[j] = tem;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tem = num2[i];\n        num2[i] = num2[j];\n        num2[j] = tem;\n      }\n    }\n  }\n}\nint gb() {\n  int i;\n  for (i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (i = n1; i < n1 + n2; i++)\n    num[i] = num2[i - n1];\n}\nint dy() {\n  cout << num[0];\n  int i;\n  for (i = 1; i < n1 + n2; i++)\n    cout << ' ' << num[i];\n}\nint main() {\n  dr();\n  px();\n  gb();\n  dy();\n}\n"}
{"label": "8", "index": "14047", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int N, M, i;\n  scanf(\"%d%d\", &N, &M);\n  int a[N], b[M];\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < M; i++) {\n    cin >> b[i];\n  }\n  qsort(a, N, sizeof(int), compare);\n  for (i = 0; i < N - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[i]);\n  qsort(b, M, sizeof(int), compare);\n  for (i = 0; i < M - 1; i++)\n    printf(\"%d \", b[i]);\n\n  printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint temp, m, n;\nint a[100], b[100];\n\nvoid scanf() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid bubblesorta() {\n  for (int i = 0; i < m; i++)\n    for (int j = 1; j < m - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n}\nvoid bubblesortb() {\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\n\nvoid printf() {\n  for (int i = 0; i < m; i++) {\n    if (i)\n      cout << \" \" << a[i];\n    else\n      printf(\"%d\", a[i]);\n  }\n  for (int i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  scanf();\n  bubblesorta();\n  bubblesortb();\n  printf();\n  return 0;\n}\n"}
{"label": "8", "index": "14049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\n\nvoid read() {\n  cin >> m >> n; \n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid sort_() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\n\nvoid stick() {\n  for (int i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n];\n}\n\nint main() {\n  read();\n  sort_();\n  stick();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14050", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int n, int a[100]) {\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n}\nint paixu(int a[100], int n) {\n  int i, j, t;\n  for (j = n - 2; j >= 0; j--)\n    for (i = 0; i <= j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  return (*a);\n}\nvoid mix(int a[], int b[], int c[], int e, int d) {\n  int i = 0, t;\n  for (i = 0; i < e; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    c[i + e] = b[i];\n  }\n}\nvoid out(int c[300], int e, int d) {\n  int i = 0;\n  for (i = 0; i < e + d - 1; i++) {\n    cout << c[i] << \" \";\n  }\n  printf(\"%d\", c[e + d - 1]);\n}\nint main() {\n  int a[100], b[100], c[300], i = 0, x, y;\n  cin >> x >> y;\n  read(x, a);\n  read(y, b);\n  paixu(a, x);\n  paixu(b, y);\n  mix(a, b, c, x, y);\n  out(c, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14051", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1001] = {0};\nint b[1001] = {0};\nint m, n;\nvoid loaddata() {\n  int l;\n  cin >> m >> n;\n  for (l = 0; l < m; l++)\n    scanf(\"%d\", &a[l]);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &b[l]);\n}\nvoid arrsort() {\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid add() {\n  int p;\n  for (p = 0; p < n; p++) {\n    a[p + m] = b[p];\n  }\n}\nvoid print() {\n  int q;\n  printf(\"%d\", a[0]);\n  for (q = 1; q < m + n; q++) {\n    printf(\" %d\", a[q]);\n  }\n}\n\nint main() {\n  loaddata();\n  arrsort();\n  add();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid in(int n, int a[]);\nvoid arrange(int n, int a[]);\nvoid connect(int n1, int n2, int a[], int b[], int c[]);\nvoid out(int n, int c[]);\nint main() {\n  int n1, n2, a[1000], b[1000], c[2000];\n  cin >> n1 >> n2;\n  in(n1, a);\n  in(n2, b);\n  arrange(n1, a);\n  arrange(n2, b);\n  connect(n1, n2, a, b, c);\n  out(n1 + n2, c);\n  return 0;\n}\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n}\nvoid arrange(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\n\nvoid connect(int n1, int n2, int a[], int b[], int c[]) {\n  int l = 0;\n  for (int i = 0; i < n1; i++, l++)\n    c[l] = a[i];\n  for (int j = 0; j < n2; j++, l++)\n    c[l] = b[j];\n}\nvoid out(int n, int c[]) {\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\\n\", c[n - 1]);\n}\n"}
{"label": "8", "index": "14053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100];\nvoid input() {\n  int j, k;\n  scanf(\"%d %d\", &n, &m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n}\nvoid arrange(int n, int m, int x[], int y[]) {\n  int j, k, t;\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (x[k] > x[k + 1]) {\n        t = x[k];\n        x[k] = x[k + 1];\n        x[k + 1] = t;\n      }\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (y[k] > y[k + 1]) {\n        t = y[k];\n        y[k] = y[k + 1];\n        y[k + 1] = t;\n      }\n}\nvoid combine(int n, int m, int x[], int y[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    x[n + i] = y[i];\n}\nvoid print(int n, int m, int x[]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\", x[m + n - 1]);\n}\n\nint main() {\n  input();\n  arrange(n, m, a, b);\n  combine(n, m, a, b);\n  print(n, m, a);\n}\n"}
{"label": "8", "index": "14054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[2][100];\nvoid order(int x, int y) {\n  int i, j, t;\n  for (i = 0; i < y; i++)\n    cin >> a[x][i];\n  for (i = 0; i < y - 1; i++)\n    for (j = 0; j < y - 1 - i; j++)\n      if (a[x][j] > a[x][j + 1]) {\n        t = a[x][j];\n        a[x][j] = a[x][j + 1];\n        a[x][j + 1] = t;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n; i++)\n    cout << a[0][i] << \" \";\n  for (i = 0; i < m - 1; i++)\n    cout << a[1][i] << \" \";\n  cout << a[1][m - 1];\n}\nint main() {\n  cin >> n >> m;\n  order(0, n), order(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid rank_1(int n, int c) {\n  int num[10], i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      int a;\n      if (num[j] > num[j + 1]) {\n        a = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", num[i]);\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  if (c != 2) {\n    printf(\" \");\n  }\n}\nvoid count() {\n  int b[2], i;\n  scanf(\"%d %d\", &b[0], &b[1]);\n  for (i = 1; i <= 2; i++) {\n    rank_1(b[i - 1], i);\n  }\n}\nint main() {\n  void rank_1(int n, int c);\n  void count();\n  count();\n  return 0;\n}\n"}
{"label": "8", "index": "14056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int n) {\n  int i, j, aaa;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        aaa = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = aaa;\n      }\n    }\n  }\n}\nvoid combine(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  int a[100], b[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  read(a, m, b, n);\n  order(a, m);\n  order(b, n);\n  combine(a, m, b, n);\n}\n"}
{"label": "8", "index": "14057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nvoid get(int a[200], int b[200]) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sequence(int a[200], int p) {\n  int i, j, temp;\n  for (i = 0; i < p; i++)\n    for (j = i + 1; j < p; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n}\nvoid combine(int a[200], int p, int b[200], int q) {\n  int j;\n  for (j = 0; j < q; j++)\n    a[p + j] = b[j];\n}\nvoid show(int a[200], int p) {\n  int i;\n  for (i = 0; i < p - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[p - 1]);\n}\nint main() {\n  int a[200], b[200];\n  get(a, b);\n  sequence(a, m);\n  sequence(b, n);\n  combine(a, m, b, n);\n  show(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[2], i, j, b[2][100], p, c[100], s, t;\n\n  for (i = 0; i < 2; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < a[i]; j++)\n      cin >> b[i][j];\n\n  for (i = 0; i < 2; i++) {\n    for (s = 0; s < a[i] - 1; s++) {\n      for (t = 0; t < a[i] - 1 - s; t++)\n        if (b[i][t] > b[i][t + 1]) {\n          p = b[i][t];\n          b[i][t] = b[i][t + 1];\n          b[i][t + 1] = p;\n        }\n    }\n  }\n\n  for (i = 0; i < a[0]; i++)\n    c[i] = b[0][i];\n  for (j = 0; j < a[1]; j++)\n    c[a[0] + j] = b[1][j];\n\n  for (s = 0; s < a[0] + a[1] - 1; s++)\n    printf(\"%d \", c[s]);\n  cout << c[a[0] + a[1] - 1];\n}\n"}
{"label": "8", "index": "14059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint str1[100], str2[100], str[200];\nint m, n;\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &str1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &str2[i]);\n  }\n}\nvoid f2(int s[100], int k) {\n  int i, j, t;\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1; i++) {\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int s1[100], int s2[100], int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    s[i] = s1[i];\n  }\n  for (i = 0; i < n; i++) {\n    s[i + m] = s2[i];\n  }\n}\nvoid f4(int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", s[i]);\n    if (i < m + n - 1)\n      printf(\" \");\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  f1();\n  f2(str1, m);\n  f2(str2, n);\n  f3(str1, str2, str, m, n);\n  f4(str, m, n);\n}\n"}
{"label": "8", "index": "14060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int x[], int p);\nvoid sort_ascending(int x[], int p);\nint main() {\n  int m, n, a[1000], b[1000], j, i;\n  scanf(\"%d %d\", &m, &n);\n  input(a, m);\n  input(b, n);\n  sort_ascending(a, m);\n  sort_ascending(b, n);\n  for (j = 0; j < m; j++)\n    printf(\"%d \", a[j]);\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid input(int x[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d \", &x[i]);\n}\nvoid sort_ascending(int x[], int p) {\n  int i, j, t;\n  for (i = 0; i < p; i++)\n    for (j = 0; j < p - i - 1; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int x[], int y[], int a, int b);\n  void change(int x[], int y[], int a, int b);\n  void combine(int x[], int y[], int a, int b);\n  int x[10], y[10], a, b;\n  scanf(\"%d %d\", &a, &b);\n  read(x, y, a, b);\n  change(x, y, a, b);\n  combine(x, y, a, b);\n  return 0;\n}\nvoid read(int x[], int y[], int a, int b) {\n  int i;\n  char c;\n  for (i = 1; i <= a; i++)\n    scanf(\"%d%c\", &x[i], &c);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d%c\", &y[i], &c);\n}\nvoid change(int x[], int y[], int a, int b) {\n  int i, j, t;\n  for (i = 1; i <= a; i++)\n    for (j = 1; j < a + 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= b; i++)\n    for (j = 1; j < b + 1 - i; j++) {\n      if (y[j] > y[j + 1]) {\n        t = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = t;\n      }\n    }\n}\nvoid combine(int x[], int y[], int a, int b) {\n  int i;\n  printf(\"%d\", x[1]);\n  for (i = 2; i <= a; i++)\n    printf(\" %d\", x[i]);\n  for (i = 1; i <= b; i++) {\n    printf(\" %d\", y[i]);\n  }\n}\n"}
{"label": "8", "index": "14062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, c[100], d[100];\nvoid size() { scanf(\"%d %d\", &a, &b); }\nvoid num(int s, int j[]) {\n  int i;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &j[i]);\n}\nvoid arrange(int s, int j[]) {\n  int i, k, temp;\n  for (k = 0; k < s - 1; k++) {\n    for (i = 0; i < s - k - 1; i++) {\n      if (j[i + 1] <= j[i]) {\n        temp = j[i];\n        j[i] = j[i + 1];\n        j[i + 1] = temp;\n      }\n    }\n  }\n}\nvoid plus_1(int x, int m[], int y, int n[]) {\n  int i;\n  arrange(x, m);\n  arrange(y, n);\n  printf(\"%d\", m[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", m[i]);\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", n[i]);\n}\nint main() {\n  size();\n  num(a, c);\n  num(b, d);\n  plus_1(a, c, b, d);\n  return 0;\n}\n"}
{"label": "8", "index": "14063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint j, k;\nvoid G(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < j; n++) {\n    for (m = n + 1; m < j; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid g(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < k; n++) {\n    for (m = n + 1; m < k; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid F(int a[], int b[]) {\n  G(a);\n  g(b);\n  int n, m;\n  printf(\"%d\", a[0]);\n  for (n = 1; n < j; n++)\n    printf(\" %d\", a[n]);\n  for (m = 0; m < k; m++)\n    cout << \" \" << b[m];\n}\nint main() {\n  int n, m;\n  int a[5000], b[5000];\n  scanf(\"%d %d\", &j, &k);\n  for (n = 0; n < j; n++)\n    cin >> a[n];\n  for (m = 0; m < k; m++)\n    scanf(\"%d\", &b[m]);\n  F(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nvoid shuru(int x, int y, int a[], int b[]) {\n  cin >> x >> y;\n  m = x;\n  n = y;\n  for (int i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int x[], int l) {\n  for (int i = 0; i < l - 1; i++) {\n    for (int j = 0; j < l - 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int p;\n        p = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (int i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\nvoid shuchu(int c[], int m, int n) {\n  for (int i = 0; i < n + m; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << \" \" << c[i];\n  }\n}\nint main() {\n  shuru(m, n, a, b);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m, n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14065", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid programme() {\n  int n1, n2, i, j, temp;\n  int a[101], b[101];\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n2; i++) {\n    cin >> b[i];\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = 0; j < n2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2; i++) {\n    if (i != n2 - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n  return;\n}\n\nint main() {\n  programme();\n  return 0;\n}\n"}
{"label": "8", "index": "14066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000], b[1000], al, bl;\n\nvoid input() {\n  int i;\n  cin >> al >> bl;\n  for (i = 0; i < al; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bl; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Qsort(int start, int length, int a[]) {\n  int x = a[start];\n  int i, j;\n  i = start;\n  j = length - 1;\n  while (i < j) {\n    if (x < a[j])\n      j--;\n    else if (x > a[j]) {\n      a[i] = a[j];\n      a[j] = x;\n      i++;\n    } else if (x < a[i]) {\n      a[j] = a[i];\n      a[i] = x;\n      j--;\n    } else\n      i++;\n  }\n  if (start < length - 1) {\n    Qsort(start, i, a);\n    Qsort(i + 1, length, a);\n  }\n}\n\nvoid sort() {\n  Qsort(0, al, a);\n  Qsort(0, bl, b);\n}\n\nvoid combine() {\n  int i;\n  for (i = 0; i < bl; i++)\n    a[i + al] = b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < bl + al - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i];\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  output();\n}\n"}
{"label": "8", "index": "14067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid mix(int m, int n);\nint main() {\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  mix(m, n);\n  return 0;\n}\nvoid mix(int m, int n) {\n  int i, j, a[10000], b[10000], t;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  cout << b[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "14068", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x, y;\nint print() {\n  cout << \" \";\n  return 0;\n}\nvoid order(int n) {\n  int i, j, temp = 0;\n  int a[10];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j + 1] < a[j]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1];\n}\nint main() {\n  cin >> x >> y;\n  order(x);\n  print();\n  order(y);\n  return 0;\n}\n"}
{"label": "8", "index": "14069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[200], i, m, n;\n  scanf(\"%d\", &m);\n  scanf(\"%d\", &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  int j, p;\n  for (i = m - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n  int q;\n  for (q = 0; q < m; q++)\n    c[q] = a[q];\n  for (q = m; q < m + n; q++)\n    c[q] = b[q - m];\n  int s;\n  printf(\"%d\", c[0]);\n  for (s = 1; s < m + n; s++)\n    printf(\" %d\", c[s]);\n}\n"}
{"label": "8", "index": "14070", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m;\nint a[100], b[100], c[100];\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid zuhe() {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < n + m; i++) {\n    if (i != n + m - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  shuru();\n  paixu();\n  zuhe();\n  shuchu();\n}\n"}
{"label": "8", "index": "14071", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], x = 0, y = 0; \nvoid in() {\n  cin >> x >> y; \n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    cin >> b[i];\n}\nvoid sortnum() { \n  sort(a, a + x);\n  sort(b, b + y);\n}\nvoid cat() {\n  for (int i = x; i < 100; i++)\n    a[i] = b[i - x]; \n}\nvoid out() {\n  cout << a[0];\n  for (int i = 1; i < x + y; i++)\n    cout << \" \" << a[i]; \n}\nint main() \n{\n  in();\n  sortnum();\n  cat();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1;\nint n2;\nint i;\nint a[100] = {0};\nint b[100] = {0};\nint c[200] = {0};\nvoid scanfing() {\n  scanf(\"%d %d\", &n1, &n2);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n1; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < n2; i++)\n    scanf(\" %d\", &b[i]);\n}\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1 - *(int *)elem2);\n}\nvoid qsorting() {\n  qsort(a, n1, sizeof(int), compare);\n  qsort(b, n2, sizeof(int), compare);\n}\nvoid together() {\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = 0; i < n2; i++)\n    c[i + n1] = b[i];\n}\nvoid printfing() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  scanfing();\n  qsorting();\n  together();\n  printfing();\n}\n"}
{"label": "8", "index": "14073", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m, a[1000], b[100];\n\nvoid scan(int *p1, int l1, int *p2, int l2) {\n  int i;\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &p1[i]);\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &p2[i]);\n}\n\nvoid paixu(int *p, int l) {\n  int t, i, j;\n  for (i = 1; i < l; i++)\n    for (j = 0; j < l - i; j++)\n      if (p[j] > p[j + 1]) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n}\n\nvoid hebing(int *p1, int l1, int *p2, int l2) {\n  int i;\n  for (i = l1; i < l1 + l2; i++)\n    p1[i] = p2[i - l1];\n}\n\nvoid print(int *p, int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    printf(\"%d%c\", p[i], (i == l - 1) ? '\\n' : ' ');\n}\n\nint main() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, n);\n  paixu(b, m);\n  hebing(a, n, b, m);\n  print(a, m + n);\n}\n"}
{"label": "8", "index": "14074", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], c[100], m, n;\nvoid input() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid az() {\n  int i, j, t;\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid jch() {\n  int j;\n  for (j = 0; j < m; j++) {\n    c[j] = a[j];\n  }\n  for (j = m; j < m + n; j++) {\n    c[j] = b[j - m];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  input();\n  az();\n  jch();\n  output();\n}\n"}
{"label": "8", "index": "14075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[50], a2[50];\nint main() {\n  void sort(int b[], int n);\n  void scn();\n  void pr(int c[], int m);\n  scn();\n  sort(a1, n1);\n  sort(a2, n2);\n  pr(a1, n1);\n  pr(a2, n2);\n  return 0;\n}\nvoid sort(int b[], int n) {\n  int i, j, t;\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n}\nvoid scn() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a1[i]);\n  }\n\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\nvoid pr(int c[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    if (i == m - 1 && c[i] == a2[m - 1])\n      printf(\"%d\", c[i]);\n    else\n      printf(\"%d \", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int p, int q, int *num1, int *num2) {\n  int i;\n  for (i = 0; i < p; i++) {\n    scanf(\"%d\", num1 + i);\n  }\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", num2 + i);\n}\nvoid sort(int p, int q, int *num1, int *num2) {\n  int i, j, t;\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n    for (j = 0; j < q - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int p, int q, int *num1, int *num2) {\n  int i;\n  printf(\"%d\", num1[0]);\n  for (i = 1; i < p; i++)\n    printf(\" %d\", num1[i]);\n  for (i = 0; i < q; i++)\n    printf(\" %d\", num2[i]);\n}\nint main() {\n  int p, q, *num1, *num2;\n  scanf(\"%d%d\", &p, &q);\n  num1 = (int *)malloc(p * sizeof(int));\n  num2 = (int *)malloc(q * sizeof(int));\n  input(p, q, num1, num2);\n  sort(p, q, num1, num2);\n  print(p, q, num1, num2);\n}\n"}
{"label": "8", "index": "14077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read();\n  read();\n  return 0;\n}\nvoid read() {\n  int a, b;\n  void shu(int x, int y);\n  scanf(\"%d%d\", &a, &b);\n  shu(a, b);\n}\nvoid shu(int x, int y) {\n  int a[100], b[100], i;\n  void pai(int a[], int x, int b[], int y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pai(a, x, b, y);\n}\nvoid pai(int a[], int x, int b[], int y) {\n  int i, k, m;\n  void pr(int a[], int x, int b[], int y);\n  for (i = 0; i < x - 1; i++) {\n    for (k = 0; k < x - 1 - i; k++) {\n      if (a[k] > a[k + 1]) {\n        m = a[k + 1];\n        a[k + 1] = a[k];\n        a[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (k = 0; k < y - 1 - i; k++) {\n      if (b[k] > b[k + 1]) {\n        m = b[k + 1];\n        b[k + 1] = b[k];\n        b[k] = m;\n      }\n    }\n  }\n  pr(a, x, b, y);\n}\nvoid pr(int a[], int x, int b[], int y) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, a[100], b[100];\nint *pointer1 = &m, *pointer2 = &n;\nvoid input(int *r, int *s, int *x, int *y) {\n  int i;\n  scanf(\"%d %d\", r, s);\n  for (i = 0; i < *r; i++) {\n    scanf(\"%d\", x + i);\n  }\n  for (i = 0; i < *s; i++)\n    scanf(\"%d\", y + i);\n}\nvoid sort(int *t, int *p) {\n  int i, j, r, s;\n  for (i = 0; i < (*t) - 1; i++) {\n    r = i;\n    for (j = i + 1; j < *t; j++)\n      if (*(p + j) < *(p + r)) {\n        r = j;\n      }\n    if (r != i) {\n      s = *(p + i);\n      *(p + i) = *(p + r);\n      *(p + r) = s;\n    }\n  }\n}\nvoid output(int *x, int *y, int *p1, int *p2) {\n  int i;\n  for (i = 0; i < *x; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 0; i < *y; i++)\n    printf(\"%d%c\", *(p2 + i), (i < (*y) - 1) ? ' ' : '\\n');\n}\nint main() {\n  input(pointer1, pointer2, a, b);\n  sort(pointer1, a);\n  sort(pointer2, b);\n  output(pointer1, pointer2, a, b);\n}\n"}
{"label": "8", "index": "14079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[233], b[233];\nint n, m, i, j, z;\nvoid shuru(int p) {\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < m; i++) {\n    scanf(\" %d\", &b[i]);\n  }\n}\nvoid paixu(int p) {\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n    }\n  }\n}\nvoid hebing(int p) {\n  for (i = n; i < m + n; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid shuchu(int p) {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  shuru(0);\n  paixu(0);\n  hebing(0);\n  shuchu(0);\n}\n"}
{"label": "8", "index": "14080", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x[100], y[100], c[200];\nint m, n;\nvoid scanf() {\n  scanf(\"%d %d\", &m, &n);\n  int i;\n  for (i = 0; i < m - 1; i++) {\n    scanf(\"%d \", &x[i]);\n  }\n  scanf(\"%d\\n\", &x[m - 1]);\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &y[i]);\n  }\n  scanf(\"%d\\n\", &y[n - 1]);\n}\n\nvoid order() {\n  int j, i, b;\n  for (j = 0; j < m; j++) {\n    for (i = j; i < m; i++)\n      if (x[j] > x[i]) {\n        b = x[j];\n        x[j] = x[i];\n        x[i] = b;\n      }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j; i < n; i++)\n      if (y[j] > y[i]) {\n        b = y[j];\n        y[j] = y[i];\n        y[i] = b;\n      }\n  }\n}\n\nvoid together() {\n  int s;\n\n  for (s = 0; s < m; s++) {\n    c[s] = x[s];\n  }\n\n  for (s = m; s < m + n; s++) {\n    c[s] = y[s - m];\n  }\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  scanf();\n  order();\n  together();\n  print();\n}\n"}
{"label": "8", "index": "14081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint x[10000], y[10000], z[100000];\nint m, n, i, j, temp;\nvoid dq() {\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> x[i];\n  for (i = 1; i <= n; i++)\n    cin >> y[i];\n}\n\nvoid px() {\n  for (i = 1; i <= m - 1; i++)\n    for (j = m; j >= i + 1; j--)\n      if (x[j] <= x[j - 1]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = n; j >= i + 1; j--)\n      if (y[j] <= y[j - 1]) {\n        temp = y[j];\n        y[j] = y[j - 1];\n        y[j - 1] = temp;\n      }\n}\n\nvoid hb() {\n  for (i = 1; i <= m; i++)\n    z[i] = x[i];\n  for (i = 1; i <= n; i++)\n    z[i + m] = y[i];\n}\n\nvoid xs() {\n  for (i = 1; i < m + n; i++)\n    cout << z[i] << ' ';\n  cout << z[m + n];\n  cout << endl;\n}\n\nint main() {\n  dq();\n  px();\n  hb();\n  xs();\n  return 0;\n}\n"}
{"label": "8", "index": "14082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint shuzu1[100], shuzu2[100];\nint n1, n2;\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &shuzu1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &shuzu2[i]);\n}\nvoid paixu(int shuzu[], int n) {\n  int min, i, j, temp;\n  for (i = 0; i < n; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[j] < shuzu[min])\n        min = j;\n    }\n    temp = shuzu[i];\n    shuzu[i] = shuzu[min];\n    shuzu[min] = temp;\n  }\n}\nvoid hebing(int shuzu1[], int shuzu2[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", shuzu1[i]);\n  for (i = 0; i < n2 - 1; i++)\n    printf(\"%d \", shuzu2[i]);\n  printf(\"%d\", shuzu2[i]);\n}\nint main() {\n  scan();\n  paixu(shuzu1, n1);\n  paixu(shuzu2, n2);\n  hebing(shuzu1, shuzu2, n1, n2);\n}\n"}
{"label": "8", "index": "14083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A, B;\nint *a, *b;\nint c[500];\nvoid putin() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  a = (int *)malloc(A * sizeof(int));\n  b = (int *)malloc(B * sizeof(int));\n  for (i = 0; i < A; i++)\n    cin >> a[i];\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid replace() {\n  int i, j, z;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n  for (i = 0; i < B - 1; i++) {\n    for (j = 0; j < B - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = A; i < A + B; i++)\n    c[i] = b[i - A];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < A + B; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  putin();\n  replace();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n, a[10000], b[10000];\nvoid input() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sequence() {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        int temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        int temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n}\nvoid combination() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid output() {\n  cout << a[0];\n  for (int i = 1; i < m + n; i++)\n    cout << ' ' << a[i];\n  cout << endl;\n}\nint main() {\n  input();\n  sequence();\n  combination();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14085", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j, t;\nint a[100];\nint b[100];\nint c[200];\nvoid passed1() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid passed2() {\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n}\nvoid passed3() {\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid passed4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  passed1();\n  passed2();\n  passed3();\n  passed4();\n  return 0;\n}\n"}
{"label": "8", "index": "14086", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint na, nb;\nint *a, *b;\nvoid input() {\n  scanf(\"%d %d\", &na, &nb);\n  a = (int *)malloc(na * sizeof(int));\n  b = (int *)malloc(nb * sizeof(int));\n  for (int i = 0; i < na; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < nb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return t;\n}\nvoid order() {\n  qsort(a, na, sizeof(int), pfC);\n  qsort(b, nb, sizeof(int), pfC);\n}\n\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < na; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 0; i < nb; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  input();\n  order();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *p1, int *p2, int **pA, int **pB) {\n  int i;\n  scanf(\"%d %d\", p1, p2);\n  *pA = (int *)malloc((*p1) * sizeof(int));\n  *pB = (int *)malloc((*p2) * sizeof(int));\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", *pA + i);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", *pB + i);\n}\nvoid sort(int p, int *pX) {\n  int i, j, temp;\n  for (i = 0; i < p; i++) {\n    for (j = p - 1; j > i; j--) {\n      if (pX[j] < pX[j - 1]) {\n        temp = pX[j];\n        pX[j] = pX[j - 1];\n        pX[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int p1, int p2, int *pA, int *pB, int **pC) {\n  *pC = (int *)malloc((p1 + p2) * sizeof(int));\n  int i;\n  for (i = 0; i < p1; i++)\n    (*pC)[i] = pA[i];\n  for (i = 0; i < p2; i++)\n    (*pC)[p1 + i] = pB[i];\n  free(pA);\n  free(pB);\n}\nvoid output(int p, int *pC) {\n  int i;\n  for (i = 0; i < p - 1; i++)\n    printf(\"%d \", pC[i]);\n  printf(\"%d \", pC[p - 1]);\n  free(pC);\n}\nint main() {\n  int p1, p2, *pA, *pB, *pC;\n  input(&p1, &p2, &pA, &pB);\n  sort(p1, pA);\n  sort(p2, pB);\n  combine(p1, p2, pA, pB, &pC);\n  output(p1 + p2, pC);\n}\n"}
{"label": "8", "index": "14088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pai(int n, int a[]) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int r = 1; r < n - i; r++) {\n      if (a[i + r] < a[i]) {\n        int k = a[i];\n        a[i] = a[i + r];\n        a[i + r] = k;\n      }\n    }\n  }\n}\nint link(int n, int m) {\n  int a[100] = {0}, b[100] = {0};\n  pai(n, a);\n  pai(m, b);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n}\n\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  link(n, m);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  return 0;\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n  pai(a, m);\n  pai(b, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void qz(int s[], int m);\n  void px(int s[], int m);\n  void hb(int s[], int t[], int m, int n);\n  void xs(int s[], int m);\n  int n, m;\n  int a[200], b[200];\n  scanf(\"%d%d\", &m, &n);\n  qz(a, m);\n  qz(b, n);\n  px(a, m);\n  px(b, n);\n  hb(a, b, m, n);\n  xs(a, m + n);\n  return 0;\n}\nvoid qz(int s[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid px(int s[], int m) {\n  int i, j, t;\n  for (i = 0; i <= m - 1; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (s[j] < s[i]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid hb(int s[], int t[], int m, int n) {\n  int i;\n  for (i = m; i <= m + n - 1; i++)\n    s[i] = t[i - m];\n}\nvoid xs(int s[], int m) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", s[i]);\n  }\n}\n"}
{"label": "8", "index": "14091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000], c, d;\nvoid kg();\nvoid m(int);\nvoid r();\nint main() {\n  r();\n  m(c);\n  kg();\n  m(d);\n  return 0;\n}\nvoid r() { cin >> c >> d; }\nvoid m(int s) {\n  int i, j, t;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < s - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%d\", a[i]);\n    if (i < s - 1) {\n      kg();\n    }\n  }\n}\nvoid kg() { printf(\" \"); }\n"}
{"label": "8", "index": "14092", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x, y, a[100], b[100], temp;\nint input() {\n\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int j = 0; j < y; j++) {\n    cin >> b[j];\n  }\n  return 0;\n}\nint bubble() {\n  for (int i = 0; i < x - 1; i++)\n    for (int t = i + 1; t < x; t++) {\n      if (a[i] > a[t]) {\n        temp = a[t];\n        a[t] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (int j = 0; j < y - 1; j++)\n    for (int t = j + 1; t < y; t++) {\n      if (b[j] > b[t]) {\n        temp = b[t];\n        b[t] = b[j];\n        b[j] = temp;\n      }\n    }\n  return 0;\n}\nint combine() {\n  for (int i = 0; i < x; i++)\n    cout << a[i] << ' ';\n  for (int j = 0; j < y - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[y - 1];\n  return 0;\n}\nint main() {\n  input();\n  bubble();\n  combine();\n  return 0;\n}\n"}
{"label": "8", "index": "14093", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\nint ans[200];\nvoid read(int a[], int b[]) {\n  cin >> m;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int m) {\n  int temp;\n  for (int i = 1; i < m; i++) {\n    for (int j = i + 1; j <= m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[]) {\n  for (int i = 1; i <= m; i++)\n    ans[i] = a[i];\n  for (int i = 1; i <= n; i++)\n    ans[m + i] = b[i];\n}\nvoid out(int a[], int m) {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  read(a, b);\n  sort(a, m);\n  sort(b, n);\n  add(a, b);\n  out(ans, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[100], b[100];\nvoid input() {\n  int j, k;\n  scanf(\"%d %d\", &n, &m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n}\nvoid arrange(int n, int m, int x[], int y[]) {\n  int j, k, t;\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (x[k] > x[k + 1]) {\n        t = x[k];\n        x[k] = x[k + 1];\n        x[k + 1] = t;\n      }\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (y[k] > y[k + 1]) {\n        t = y[k];\n        y[k] = y[k + 1];\n        y[k + 1] = t;\n      }\n}\nvoid combine(int n, int m, int x[], int y[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    x[n + i] = y[i];\n}\nvoid print(int n, int m, int x[]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  cout << x[m + n - 1];\n}\n\nint main() {\n  input();\n  arrange(n, m, a, b);\n  combine(n, m, a, b);\n  print(n, m, a);\n  return 0;\n}\n"}
{"label": "8", "index": "14095", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid read(int s[], int n);\nvoid arrange(int s[], int n);\nvoid connect(int array1[], int array2[], int p1, int p2);\nvoid print(int array[], int num);\nint main() {\n  int s1[100], s2[100];\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  read(s1, n1);\n  read(s2, n2);\n  arrange(s1, n1);\n  arrange(s2, n2);\n  connect(s1, s2, n1, n2);\n  print(s1, n1 + n2);\n  return 0;\n}\nvoid read(int s[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n}\nvoid arrange(int s[], int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        t = s[j + 1];\n        s[j + 1] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid connect(int array1[], int array2[], int p1, int p2) {\n  int i;\n\n  for (i = p1; i < p1 + p2; i++) {\n    array1[i] = array2[i - p1];\n  }\n}\n\nvoid print(int array[], int num) {\n  int i;\n  printf(\"%d\", array[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %d\", array[i]);\n  }\n}\n"}
{"label": "8", "index": "14096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, t, j;\n  int a[2][1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[0][i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[1][i]);\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[0][i] > a[0][i + 1]) {\n        t = a[0][i];\n        a[0][i] = a[0][i + 1];\n        a[0][i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[1][i] > a[1][i + 1]) {\n        t = a[1][i];\n        a[1][i] = a[1][i + 1];\n        a[1][i + 1] = t;\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[0][i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[1][i]);\n  printf(\"%d\\n\", a[1][n - 1]);\n}\n"}
{"label": "8", "index": "14097", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\n\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n\nvoid input(int *a, int *b) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n}\n\nvoid sort(int *a, int *b) {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge(int *a, int *b, int *c) {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\n\nvoid output(int *c) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d%s\", c[i], i < m + n - 1 ? \" \" : \"\\n\");\n  }\n}\nint main() {\n  int a[10000] = {0};\n  int b[10000] = {0};\n  int c[10000] = {0};\n  input(a, b);\n  sort(a, b);\n  merge(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guochen(int array[], int n) {\n  int a, i, j;\n  for (a = 0; a < n; a++)\n    scanf(\"%d\", &array[a]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[i]) {\n        int k;\n        k = array[i];\n        array[i] = array[j];\n        array[j] = k;\n      }\n    }\n  }\n}\nvoid shuchu(int one[], int n, int two[], int m) {\n  int i, j;\n  printf(\"%d\", one[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", one[i]);\n  for (j = 0; j < m; j++)\n    printf(\" %d\", two[j]);\n}\nint main() {\n  int n, m, one[100], two[100];\n  scanf(\"%d %d\", &n, &m);\n  guochen(one, n);\n  guochen(two, m);\n  shuchu(one, n, two, m);\n}\n"}
{"label": "8", "index": "14099", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint f(int x, int y) {\n  int a[x], b[y];\n  int t, i, j;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < y; j++) {\n    cin >> b[j];\n  } \n\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t; \n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t; \n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i]; \n  }\n}\n\nint main() {\n  int x, y;\n  cin >> x >> y;\n  f(x, y); \n  return 0;\n}\n"}
{"label": "8", "index": "14100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint order(int n, int a[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i; j < n; j++)\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nint combine(int a[], int b[], int n, int m, int c[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (j = 0; j < m; j++, i++)\n    c[i] = b[j];\n}\nint input(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nint output(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m], c[n + m];\n  input(n, a);\n  input(m, b);\n  order(n, a);\n  order(m, b);\n  combine(a, b, n, m, c);\n  output(n + m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14101", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\n\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n\nvoid input(int *a, int *b) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid sort(int *a, int *b) {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge(int *a, int *b, int *c) {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\n\nvoid output(int *c) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d%s\", c[i], i < m + n - 1 ? \" \" : \"\\n\");\n  }\n}\nint main() {\n  int a[10000] = {0};\n  int b[10000] = {0};\n  int c[10000] = {0};\n  input(a, b);\n  sort(a, b);\n  merge(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n  scanf(\"%d\\n\", &array[n - 1]);\n}\nvoid order(int array[], int n) {\n  int i, o, e;\n  for (i = 0; i <= n - 2; i++) {\n    for (o = i + 1; o <= n - 1; o++) {\n      if (array[i] > array[o]) {\n        e = array[i];\n        array[i] = array[o];\n        array[o] = e;\n      }\n    }\n  }\n}\nvoid output(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    cout << array[i] << \" \";\n  }\n  printf(\"%d\", array[n - 1]);\n}\nint main() {\n  int a[20], b[20], q, w;\n  cin >> q >> w;\n  input(a, q);\n  input(b, w);\n  order(a, q);\n  order(b, w);\n  output(a, q);\n  printf(\" \");\n  output(b, w);\n}\n"}
{"label": "8", "index": "14103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid shuru() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i - 1]);\n}\nvoid paixu() {\n  int c, i, j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n}\nvoid zhenghe() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  shuru();\n  paixu();\n  zhenghe();\n  shuchu();\n}\n"}
{"label": "8", "index": "14104", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100];\nint m, n, i, j, k, xx;\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid init(int a[], int b[]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n}\nint main() {\n  init(a, b);\n  sort(a, m);\n  sort(b, n);\n  merge(a, b, m, n);\n  output(a, m + n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint m, n, i, j;\nvoid temp() {\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid temp1() {\n  int x;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp2() {\n  int x;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp3() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n}\nint main() {\n  temp();\n  temp1();\n  temp2();\n  temp3();\n  return 0;\n}\n"}
{"label": "8", "index": "14106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, i;\nint a[100];\nint b[100];\nvoid passed(int x, int y) {\n  int j, t;\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  passed(n, m);\n}\n"}
{"label": "8", "index": "14107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, i, j, t;\nint a[100];\nint b[100];\nint c[200];\nvoid passed1() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid passed2() {\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n}\nvoid passed3() {\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid passed4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  passed1();\n  passed2();\n  passed3();\n  passed4();\n  return 0;\n}\n"}
{"label": "8", "index": "14108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[400], b[200], n, m;\nvoid run1() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, x;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n}\nvoid run2() {\n  sort(a, n);\n  sort(b, m);\n}\nvoid run3() {\n  int i;\n  for (i = 1; i <= m; i++)\n    a[i + n] = b[i];\n}\nvoid run4() {\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\"%d \", a[i]);\n\n  cout << a[n + m];\n}\nint main() {\n  run1();\n  run2();\n  run3();\n  run4();\n}\n"}
{"label": "8", "index": "14109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], m, n;\nvoid shuru(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu(int f[], int length) {\n  int x;\n  for (int i = 0; i < length - 1; i++)\n    for (int j = 0; j <= length - 2 - i; j++)\n      if (f[j] > f[j + 1]) {\n        x = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = x;\n      }\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[i] << endl;\n}\nint main() {\n  shuru();\n  paixu(a, m);\n  paixu(b, n);\n\n  shuchu();\n}\n"}
{"label": "8", "index": "14110", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, b, c[100], d[100], i, j, t;\nvoid c1() {\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d \", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid c2() {\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b; i++)\n    for (j = 0; j < b - i - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n    }\n}\nvoid c3() {\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n  for (i = 0; i < b - 1; i++)\n    printf(\"%d \", d[i]);\n  printf(\"%d\", d[b - 1]);\n}\nint main() {\n  c1();\n  c2();\n  c3();\n  return 0;\n}\n"}
{"label": "8", "index": "14111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int p, int q, int *num1, int *num2) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", num1 + i);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", num2 + i);\n}\nvoid sort(int p, int q, int *num1, int *num2) {\n  int i, j, t;\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n    for (j = 0; j < q - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int p, int q, int *num1, int *num2) {\n  int i;\n  printf(\"%d\", num1[0]);\n  for (i = 1; i < p; i++)\n    printf(\" %d\", num1[i]);\n  for (i = 0; i < q; i++)\n    printf(\" %d\", num2[i]);\n}\nint main() {\n  int p, q, *num1, *num2;\n  scanf(\"%d%d\", &p, &q);\n  num1 = (int *)malloc(p * sizeof(int));\n  num2 = (int *)malloc(q * sizeof(int));\n  input(p, q, num1, num2);\n  sort(p, q, num1, num2);\n  print(p, q, num1, num2);\n}\n"}
{"label": "8", "index": "14112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[i]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nvoid cmp(int a[], int n, int b[], int m) {\n  int i = n, j;\n  for (j = 0; j < m; j++) {\n    a[i] = b[j];\n    i++;\n  }\n}\nint main() {\n  int n, m, i, a[1000], b[500];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n  f(a, n);\n  f(b, m);\n  cmp(a, n, b, m);\n  for (i = 0; i < n + m - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n + m - 1]);\n}\n"}
{"label": "8", "index": "14113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[50];\nvoid read(int a[], int b[]) {\n  int i;\n  cin >> a[0] >> b[0];\n  for (i = 1; i <= a[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= b[0]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int c, int x[]) {\n  int i, j, k, l;\n  for (i = 1; i <= c; i++) {\n    k = x[i];\n    l = i;\n    for (j = i + 1; j <= c; j++) {\n      if (x[j] < k) {\n        k = x[j];\n        l = j;\n      }\n    }\n    j = x[i];\n    x[i] = k;\n    x[l] = j;\n  }\n}\nvoid one(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[m + i + 1] = b[i + 1];\n  }\n}\nvoid out(int m, int n, int x[]) {\n  int i;\n  for (i = 1; i < m + n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n]);\n}\nint main() {\n  read(a, b);\n  change(a[0], a);\n  change(b[0], b);\n  one(a[0], b[0], a, b);\n  out(a[0], b[0], a);\n  return 0;\n}\n"}
{"label": "8", "index": "14114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], n, m, i, j, t;\nvoid shuru(int p, int q) {\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid shuchu(int p, int q) {\n  for (i = 0; i < p; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < q - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[q - 1]);\n}\nvoid paixu(int p, int c[]) {\n  for (i = 0; i < p; i++)\n    for (j = 0; j < i; j++)\n      if (c[i] < c[j]) {\n        t = c[i];\n        c[i] = c[j];\n        c[j] = t;\n      }\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  shuru(n, m);\n  paixu(n, a);\n  paixu(m, b);\n  shuchu(n, m);\n}\n"}
{"label": "8", "index": "14115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100];\nvoid insert(void) {\n  int i = 0;\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"\\n\");\n  for (i = m; i < m + n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid px(int *p) {\n  int i, j, b = 0;\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  for (i = m; i < m + n; i++) {\n    for (j = m + n - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  printf(\"%d\", *(p + 0));\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", *(p + i));\n  }\n}\nint main() {\n  insert();\n  px(a);\n}\n"}
{"label": "8", "index": "14116", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], la, b[100], lb, c[200], lc;\n\nvoid R() {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return;\n}\n\nvoid S(int *x, int lx) {\n  int i, j;\n  for (i = 1; i < lx; i++) {\n    for (j = 1; j <= lx - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  }\n  return;\n}\n\nvoid M() {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = la + 1; i <= la + lb; i++)\n    c[i] = b[i - la];\n  return;\n}\n\nvoid D() {\n  int i;\n  for (i = 1; i <= la + lb; i++) {\n    if (i > 1)\n      cout << \" \";\n    cout << c[i];\n  }\n  cout << endl;\n  return;\n}\n\nint main() {\n  R();\n  S(a, la);\n  S(b, lb);\n  M();\n  D();\n  return 0;\n}\n"}
{"label": "8", "index": "14117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s1, s2;\nint reads() {\n  int a;\n  cin >> a;\n  return a;\n}\nvoid reada(int a[]) {\n  for (int i = 1; i <= s1; i++)\n    cin >> a[i];\n}\nvoid readb(int b[]) {\n  for (int i = 1; i <= s2; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n}\nvoid reordera(int a[]) {\n  for (int i = 1; i <= s1 - 1; i++)\n    for (int j = 1; j <= s1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n}\nvoid reorderb(int b[]) {\n  for (int i = 1; i <= s2 - 1; i++)\n    for (int j = 1; j <= s2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\nvoid hebing(int a[], int b[], int c[]) {\n  for (int i = 1; i <= s1; i++)\n    c[i] = a[i];\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    c[i] = b[i - s1];\n}\nvoid output(int c[]) {\n  for (int i = 1; i <= s1 + s2 - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[s1 + s2]);\n}\n\nint main() {\n  int a[500], b[500], c[1000];\n  s1 = reads();\n  s2 = reads();\n  reada(a);\n  readb(b);\n  reordera(a);\n  reorderb(b);\n  hebing(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint n, m;\nint main() {\n  void input(void);\n  void order1(void);\n  void order2(void);\n  void output(void);\n  input();\n  order1();\n  order2();\n  output();\n  return 0;\n}\n\nvoid input(void) {\n  int i;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid order1(void) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\n\nvoid order2(void) {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] >= b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n}\n\nvoid output(void) {\n  int i;\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 1; i < m; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m]);\n}\n"}
{"label": "8", "index": "14119", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fuction1(int x, int a[]) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%d \", a[i]);\n}\nvoid fuction2(int y, int b[]) {\n  int i, j, m;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < y - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n  for (i = 0; i < y - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[y - 1]);\n}\nint main() {\n  int k, l, p, q, a[1000000], b[1000000];\n  cin >> p >> q;\n  for (k = 0; k < p; k++)\n    cin >> a[k];\n  for (k = 0; k < q; k++)\n    cin >> b[k];\n  fuction1(p, a);\n  fuction2(q, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000];\nvoid inputdata();\nvoid outputdata();\nvoid sortdata();\n\nint main() {\n  inputdata();\n  sortdata();\n  outputdata();\n\n  return 0;\n}\n\nvoid inputdata() {\n  scanf(\"%d %d \", &a[0], &b[0]);\n  for (int i = 1; i <= a[0]; i++)\n    cin >> a[i];\n  for (int i = 1; i <= b[0]; i++)\n    cin >> b[i];\n}\nvoid sortdata() {\n  sort(a + 1, a + a[0] + 1);\n  sort(b + 1, b + b[0] + 1);\n}\nvoid outputdata() {\n  for (int i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i < b[0]; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\", b[b[0]]);\n}\n"}
{"label": "8", "index": "14121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n;\nint a[100], b[100];\n\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid order(int N, int p[100]) {\n  int i, j, amount = 0;\n  int min, max;\n  min = p[0];\n  max = p[0];\n  for (i = 0; i < N; i++) {\n    if (p[i] < min)\n      min = p[i];\n    if (p[i] > max)\n      max = p[i];\n  }\n  for (i = min; i <= max; i++) {\n    for (j = 0; j < N; j++) {\n      if (p[j] == i) {\n        if (amount == 0) {\n          printf(\"%d\", p[j]);\n        } else\n          cout << \" \" << p[j];\n        amount = amount + 1;\n      }\n    }\n  }\n}\n\nvoid combine(int N, int p[100], int M, int q[100]) {\n  order(N, p);\n  printf(\" \");\n  order(M, q);\n  printf(\"\\n\");\n}\n\nint main() {\n  scan();\n  combine(m, a, n, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14122", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid car() {\n  int n, m, i = 0, a[100], b[100];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < m - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[i]);\n  return;\n}\n\nint main() {\n  car();\n  return 0;\n}\n"}
{"label": "8", "index": "14123", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint *num(int a) {\n  int *p, i;\n  p = (int *)malloc(a * sizeof(int));\n  for (i = 0; i < a; i++) {\n    cin >> p[i];\n  }\n  return p;\n}\n\nvoid rank_1(int *p, int a) {\n  int i, j, t;\n  for (i = a - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        t = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = t;\n      }\n    }\n  }\n}\n\nint *add(int *p1, int *p2, int a, int b) {\n  int i;\n  int *p3 = (int *)malloc((a + b) * sizeof(int));\n  for (i = 0; i < a; i++)\n    *(p3 + i) = *(p1 + i);\n  for (i = 0; i < b; i++)\n    *(p3 + a + i) = *(p2 + i);\n  return p3;\n}\n\nvoid print(int *p3, int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", p3[0]);\n    else\n      printf(\" %d\", p3[i]);\n  }\n}\n\nint main() {\n  int a, b, *p1, *p2, *p3;\n  scanf(\"%d\", &a);\n  scanf(\"%d\", &b);\n  p1 = num(a);\n  p2 = num(b);\n  rank_1(p1, a);\n  rank_1(p2, b);\n  p3 = add(p1, p2, a, b);\n  print(p3, (a + b));\n  free(p1);\n  free(p2);\n  free(p3);\n}\n"}
{"label": "8", "index": "14124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *p, int *q, int *n, int *m) {\n  int *x;\n  scanf(\"%d %d\", n, m);\n  x = p + *n;\n  for (; p < x; p++)\n    scanf(\"%d\", p);\n  x = q + *m;\n  for (; q < x; q++)\n    scanf(\"%d\", q);\n}\n\nvoid sort(int *p, int n) {\n  int x, i, j, k;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      x = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = x;\n    }\n  }\n}\n\nvoid copy(int *p, int *q, int x[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++, p++)\n    x[i] = *p;\n  for (; i < n + m; i++, q++)\n    x[i] = *q;\n}\n\nvoid output(int *p, int n) {\n  int *y;\n  y = p + n - 1;\n  printf(\"%d\", *p);\n  p++;\n  for (; p <= y; p++)\n    cout << \" \" << *p;\n}\n\nint main() {\n  int i, a[100], b[100], c[200], x, y, *n, *m;\n  n = &x;\n  m = &y;\n  input(a, b, n, m);\n  sort(a, x);\n  sort(b, y);\n  copy(a, b, c, x, y);\n  output(c, x + y);\n}\n"}
{"label": "8", "index": "14125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f(int m, int n) {\n  int i, j;\n  int temp;\n  int a[100] = {0};\n  int b[100] = {0};\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\n\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n\n  f(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid read(int a[], int m);\nvoid bubble(int a[], int m);\nvoid add(int a[], int b[], int c[], int m, int n);\nvoid out(int c[], int m);\n\nint main() {\n  int m, n;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  bubble(a, m);\n  bubble(b, n);\n  add(a, b, c, m, n);\n  out(c, m + n);\n  return 0;\n}\n\nvoid read(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid bubble(int a[], int m) {\n  int i, j, tmp;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n}\n\nvoid add(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\n\nvoid out(int c[], int m) {\n  int i;\n  cout << c[0];\n  for (i = 1; i < m; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14127", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  cin >> B;\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14128", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  combine(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[2][5000], b[2], k;\nvoid ppt(int k) {\n  for (int i = 0; i < b[k] - 1; i++)\n    for (int j = 0; j < b[k] - 1 - i; j++)\n      if (a[k][j] > a[k][j + 1]) {\n        int tr;\n        tr = a[k][j];\n        a[k][j] = a[k][j + 1];\n        a[k][j + 1] = tr;\n      }\n}\n\nint main() {\n  cin >> b[0] >> b[1];\n  for (k = 0; k <= 1; k++) {\n    for (int m = 0; m < b[k]; m++)\n      cin >> a[k][m];\n    ppt(k);\n    for (int m = 0; m < b[k]; m++) {\n      if (k == 0 && m == 0)\n        cout << a[k][m];\n      else\n        cout << \" \" << a[k][m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14130", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid reset1(int a[]);\nvoid reset2(int b[]);\nint main() {\n  int a[100], b[100], i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  reset1(a);\n  reset2(b);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << ' ';\n  }\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid reset1(int a[]) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid reset2(int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "14131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid print(int a[], int x) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    printf(\" %d\", a[i]);\n}\nvoid paixu(int a[], int x) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = i + 1; j < x; j++) {\n      if (a[i] > a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  print(a, x);\n}\nvoid scan(int t) {\n  int m, n, a[10], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, m);\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, n);\n}\nint main() { scan(0); }\n"}
{"label": "8", "index": "14132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[500] = {0}, b[500] = {0};\nvoid scanarray() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid shengxu(int x[], int len) {\n  int i, j, temp;\n  for (i = len - 1; i >= 0; i--) {\n    for (j = 0; j <= i - 1; j++) {\n      if (x[j] >= x[j + 1]) {\n        temp = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hebing(int x[], int y[], int lenx, int leny) {\n  int *p, *q;\n  for (p = x + lenx, q = y; q < y + leny; p++, q++) {\n    *p = *q;\n  }\n}\nvoid printarray(int x[], int len) {\n  int i;\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= len - 1; i++)\n    printf(\" %d\", a[i]);\n\n  putchar('\\n');\n}\nint main() {\n  scanarray();\n  shengxu(a, m);\n  shengxu(b, n);\n  hebing(a, b, m, n);\n  printarray(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], m, n;\nint c[200];\nint shuru() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return 0;\n}\nint paixu() {\n  int i = 0, j = 0, t = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint hebing() {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = m; i < m + n; i++)\n    c[i] = b[i - m];\n\n  return 0;\n}\nint shuchu() {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nvoid shuchu(int c[20], int m, int n);\nvoid hubing(int c[20], int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10], c[20];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  pai(a, m);\n  pai(b, n);\n  hubing(c, a, b, m, n);\n  shuchu(c, m, n);\n}\nvoid hubing(int c[20], int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  cout << \"\\n\";\n}\nvoid shuchu(int c[20], int m, int n) {\n  int i;\n  for (i = 0; i < (m + n - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000] = {0}, num2[1000] = {0};\nint num[2000] = {0};\nint n1, n2;\nvoid read() {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (int i = 0; i < n2; i++)\n    scanf(\"%d \", &num2[i]);\n}\nvoid range() {\n  for (int i = 0; i < n1 - 1; i++)\n    for (int j = 0; j < n1 - 1 - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        int temp = 0;\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 0; i < n2 - 1; i++)\n    for (int j = 0; j < n2 - 1 - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        int temp = 0;\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\nvoid combine() {\n  for (int i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (int i = 0; i < n2; i++)\n    num[n1 + i] = num2[i];\n}\nvoid print() {\n  for (int i = 0; i < n1 + n2 - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[n1 + n2 - 1] << endl;\n}\nint main() {\n  read();\n  range();\n  combine();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n[2];\nvoid input(int a[], int b[], int n[2]) {\n  int i;\n  scanf(\"%d %d\", &n[0], &n[1]);\n  for (i = 0; i < n[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n[1]; i++)\n    cin >> b[i];\n}\nvoid sort(int *p, int *q, int *x) {\n  int i, j, k, t;\n  for (i = 0; i < (*x - 1); i++) {\n    k = i;\n    for (j = i + 1; j < (*x); j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      t = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = t;\n    }\n  }\n  for (i = 0; i < *(x + 1) - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *(x + 1); j++) {\n      if (*(q + j) < *(q + k))\n        k = j;\n    }\n    if (k != i) {\n      t = *(q + i);\n      *(q + i) = *(q + k);\n      *(q + k) = t;\n    }\n  }\n}\nvoid fold(int *p, int *x, int *q, int *w) {\n  int i;\n  for (i = 0; i < *x; i++, w++, p++)\n    *w = *p;\n  for (; i < (*x) + (*(x + 1)); i++, w++, q++)\n    *w = *q;\n}\nvoid putout(int *w, int *x) {\n  int i;\n  for (i = 0; i < (*x) + (*(x + 1)) - 1; i++)\n    printf(\"%d \", *(w + i));\n  printf(\"%d\\n\", *(w + i));\n}\nint main() {\n  int a[100], b[100], c[200];\n  input(a, b, n);\n  sort(a, b, n);\n  fold(a, n, b, c);\n  putout(c, n);\n}\n"}
{"label": "8", "index": "14137", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid a(int, int);\nvoid b(int[], int[], int, int);\nvoid c(int[], int[], int, int);\nvoid d(int[], int);\nint main() {\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  a(n1, n2);\n  return 0;\n}\nvoid a(int n1, int n2) {\n  int num1[101], num2[101], i;\n  for (i = 1; i <= n1; i++) {\n    cin >> num1[i];\n  }\n  for (i = 1; i <= n2; i++)\n    cin >> num2[i];\n  b(num1, num2, n1, n2);\n}\nvoid b(int num1[], int num2[], int n1, int n2) {\n  int i, j, mid;\n  for (i = 1; i <= n1 - 1; i++) {\n    for (j = 1; j <= n1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        mid = num1[j + 1];\n        num1[j + 1] = num1[j];\n        num1[j] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= n2 - 1; i++) {\n    for (j = 1; j <= n2 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        mid = num2[j + 1];\n        num2[j + 1] = num2[j];\n        num2[j] = mid;\n      }\n    }\n  }\n  c(num1, num2, n1, n2);\n}\nvoid c(int num1[], int num2[], int n1, int n2) {\n  int num[201], i, j;\n  for (i = 1; i <= n1; i++) {\n    num[i] = num1[i];\n  }\n  for (i = n1 + 1; i <= n1 + n2; i++) {\n    num[i] = num2[i - n1];\n  }\n  d(num, n1 + n2);\n}\nvoid d(int num[], int n) {\n  int i;\n  for (i = 1; i <= n - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n];\n}\n"}
{"label": "8", "index": "14138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[300], b[300], c[600];\nvoid myfunc() {\n  int la, lb, i;\n  cin >> la >> lb;\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    cin >> b[i];\n  sort(a, a + la);\n  sort(b, b + lb);\n  for (i = 0; i < la; i++)\n    c[i] = a[i];\n  for (i = la; i < la + lb; i++)\n    c[i] = b[i - la];\n  for (i = 0; i < la + lb - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[i];\n}\nint main() {\n  myfunc();\n  return 0;\n}\n"}
{"label": "8", "index": "14139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000], b[1000], c[2000];\nint m, n;\n\nvoid inputarray(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  inputarray(a, m);\n  inputarray(b, n);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[i];\n}\n\nint main() {\n  input();\n  sort(a, m);\n  sort(b, n);\n  combine(a, b, c, m, n);\n  output(c, m + n);\n}\n"}
{"label": "8", "index": "14140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nvoid ccin(int m, int n);\nvoid turn(int c[1000], int t);\nvoid ccout(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  ccin(m, n);\n  turn(a, m);\n  turn(b, n);\n  ccout(m, n);\n  return 0;\n}\nvoid ccin(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid turn(int c[1000], int t) {\n  int i, j, k;\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n}\nvoid ccout(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1] << endl;\n}\n"}
{"label": "8", "index": "14141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid read(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int n) {\n  int i, j, aaa;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        aaa = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = aaa;\n      }\n    }\n  }\n}\nvoid combine(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  int a[100], b[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  read(a, m, b, n);\n  order(a, m);\n  order(b, n);\n  combine(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14142", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a1[100], a2[100];\nint n1, n2;\nint a[200];\n\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    cin >> a2[i];\n}\n\nvoid paixu(int b1[], int b2[], int m1, int m2) {\n  int i, j, t;\n  for (i = 0; i < m1 - 1; i++)\n    for (j = 0; j < m1 - 1 - i; j++)\n      if (b1[j] > b1[j + 1]) {\n        t = b1[j];\n        b1[j] = b1[j + 1];\n        b1[j + 1] = t;\n      }\n  for (i = 0; i < m2 - 1; i++)\n    for (j = 0; j < m2 - 1 - i; j++)\n      if (b2[j] > b2[j + 1]) {\n        t = b2[j];\n        b2[j] = b2[j + 1];\n        b2[j + 1] = t;\n      }\n}\n\nvoid hebing(int c1[], int c2[], int m1, int m2) {\n  int i, j;\n  for (i = 0; i < m1; i++)\n    a[i] = c1[i];\n  for (j = 0; j < m2; j++) {\n    a[i] = c2[j];\n    i++;\n  }\n}\n\nvoid shuchu(int d[], int m1, int m2) {\n  int i;\n  for (i = 0; i < (m1 + m2); i++) {\n    if (i < m1 + m2 - 1)\n      printf(\"%d \", d[i]);\n    else\n      printf(\"%d\\n\", d[i]);\n  }\n}\n\nint main() {\n  shuru();\n  paixu(a1, a2, n1, n2);\n  hebing(a1, a2, n1, n2);\n  shuchu(a, n1, n2);\n}\n"}
{"label": "8", "index": "14143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a[], int x) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    cout << \" \" << a[i];\n}\nvoid paixu(int a[], int x) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = i + 1; j < x; j++) {\n      if (a[i] > a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  print(a, x);\n}\nvoid scan(int t) {\n  int m, n, a[10], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, m);\n  cout << \" \";\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, n);\n}\nint main() {\n  scan(0);\n  return 0;\n}\n"}
{"label": "8", "index": "14144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[1000], b[1000], c[2000], s, t;\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  for (s = 0; s < m; s++)\n    scanf(\"%d\", &a[s]);\n  for (s = 0; s < n; s++)\n    scanf(\"%d\", &b[s]);\n}\n\nvoid order() {\n  int k;\n  for (s = 1; s < m; s++)\n    for (t = 0; t < m - s; t++)\n      if (a[t] > a[t + 1]) {\n        k = a[t];\n        a[t] = a[t + 1];\n        a[t + 1] = k;\n      }\n  for (s = 1; s < n; s++)\n    for (t = 0; t < n - s; t++)\n      if (b[t] > b[t + 1]) {\n        k = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = k;\n      }\n}\n\nvoid add() {\n  for (s = 0; s < m; s++)\n    c[s] = a[s];\n  for (s = m, t = 0; s < m + n; s++, t++)\n    c[s] = b[t];\n}\n\nvoid output() {\n  for (s = 0; s < m + n; s++) {\n    if (s != m + n - 1)\n      printf(\"%d \", c[s]);\n    else\n      printf(\"%d\", c[s]);\n  }\n}\n\nint main() {\n  input();\n  order();\n  add();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid scan(int x[], int *nx, int y[], int *ny) {\n  int i;\n  scanf(\"%d %d\", nx, ny);\n  for (i = 0; i < *nx; i++)\n    cin >> x[i];\n  for (i = 0; i < *ny; i++)\n    cin >> y[i];\n}\nvoid sort(int x[], int num) {\n  int i, j;\n  for (i = num - 1; i >= 1; i--)\n    for (j = 1; j <= i; j++)\n      if (x[j - 1] > x[j]) {\n        int temp = x[j - 1];\n        x[j - 1] = x[j];\n        x[j] = temp;\n      }\n}\nvoid exp(int a[], int b[], int na, int nb) {\n  int i;\n  for (i = na; i < na + nb; i++)\n    a[i] = b[i - na];\n}\nvoid print(int a[], int na, int nb) {\n  printf(\"%d\", a[0]);\n  int i;\n  for (i = 1; i < na + nb; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  int a[100], na, b[100], nb;\n  scan(a, &na, b, &nb);\n  sort(a, na);\n  sort(b, nb);\n  exp(a, b, na, nb);\n  print(a, na, nb);\n}\n"}
{"label": "8", "index": "14146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int a[], int n) {\n  int i, j, m;\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n}\nvoid shuchu1(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1];\n}\nvoid shuchu2(int b[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n  int a[10], n, b[10], m, i;\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"\\n\");\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n - 1]);\n  scanf(\"\\n\");\n  for (i = 0; i < m - 1; i++)\n    scanf(\"%d \", &b[i]);\n  scanf(\"%d\", &b[m - 1]);\n  paixu(a, n);\n  paixu(b, m);\n  shuchu1(a, n);\n  shuchu2(b, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14147", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[50];\nint b[50];\nint c[100];\nint m = 0, n = 0, temp;\nvoid IN();\nvoid OR();\nvoid LIAN();\nvoid OU();\nint main() {\n  IN();\n  OR();\n  LIAN();\n  OU();\n  return 0;\n}\n\nvoid IN() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid OR() {\n  int i, j;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid LIAN() {\n  int i;\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n}\n\nvoid OU() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n"}
{"label": "8", "index": "14148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input() {\n  int i;\n  scanf(\"%d\", &i);\n  return (i);\n}\nvoid shit(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n}\nvoid damn(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n  }\n}\nint main() {\n  int m = input(), n = input();\n  int a[1000], b[1000];\n  shit(a, m);\n  damn(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid paixu(int str[], int n1);\nvoid hebing(int str1[], int str2[], int n1, int n2);\nvoid shuchu(int str[], int n);\nint main() {\n  int n1, n2;\n  int a[100], b[100];\n  scanf(\"%d%d\", &n1, &n2);\n  paixu(a, n1);\n  paixu(b, n2);\n  hebing(a, b, n1, n2);\n  shuchu(a, n1 + n2);\n}\nvoid paixu(int str[], int n) {\n  int i, p, m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  for (p = 1; p < n; p++)\n    for (i = 0; i <= n - 1 - p; i++)\n      if (str[i] > str[i + 1]) {\n        m = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = m;\n      }\n}\nvoid hebing(int str1[], int str2[], int n1, int n2) {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    str1[i] = str2[i - n1];\n}\nvoid shuchu(int str[], int n) {\n  int i;\n  cout << str[0];\n  for (i = 1; i < n; i++)\n    printf(\" %d\", str[i]);\n}\n"}
{"label": "8", "index": "14150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint temp, m, n;\nint a[100], b[100];\n\nvoid scanf() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid bubblesorta() {\n  for (int i = 0; i < m; i++)\n    for (int j = 1; j < m - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n}\nvoid bubblesortb() {\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\n\nvoid printf() {\n  for (int i = 0; i < m; i++) {\n    if (i)\n      cout << \" \" << a[i];\n    else\n      cout << a[i];\n  }\n  for (int i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  scanf();\n  bubblesorta();\n  bubblesortb();\n  printf();\n  return 0;\n}\n"}
{"label": "8", "index": "14151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int p, int n) {\n  int i, j;\n  int a[100];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (a[j] < a[j - 1]) {\n        a[j - 1] = a[j] + a[j - 1];\n        a[j] = a[j - 1] - a[j];\n        a[j - 1] = a[j - 1] - a[j];\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  if (p > 0)\n    printf(\" \");\n}\nint main() {\n  int i, n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  f(1, n1);\n  f(0, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int c[], int w);\nint main() {\n  int n, m, i, j;\n  int a[10], b[10];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < m - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[m - 1]);\n  return 0;\n}\nint f(int c[], int w) {\n  int i, j, k, t;\n  for (i = 0; i < w - 1; i++) {\n    k = i;\n    for (j = i + 1; j < w; j++)\n      if (c[j] < c[k])\n        k = j;\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "14153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000], c[2000];\n\nvoid read() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < m; ++i)\n    scanf(\"%d\", b + i);\n}\n\nint cmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }\n\nvoid sort() {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge() {\n  int i;\n  for (i = 0; i < n; ++i)\n    c[i] = a[i];\n  for (i = 0; i < m; ++i)\n    c[n + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; ++i)\n    cout << \" \" << c[i];\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14154", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid readin(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cin >> a[i];\n  for (int i = 0; i < mb; i++)\n    cin >> b[i];\n}\nvoid rearange(int ma, int mb, int a[100], int b[100]) {\n  int temp;\n  for (int i = 0; i < ma; i++)\n    for (int j = 0; j < ma - 1; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < mb; i++)\n    for (int j = 0; j < mb - 1; j++)\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nint printout(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cout << a[i] << ' ';\n  for (int i = 0; i < mb - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[mb - 1];\n}\nint main() {\n  int ma[1], mb[1], a[100] = {0}, b[100] = {0};\n  readin(1, 1, ma, mb);\n  readin(ma[0], mb[0], a, b);\n  rearange(ma[0], mb[0], a, b);\n  printout(ma[0], mb[0], a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14155", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint na, nb;\nint a[10000], b[10000], c[10000];\nvoid f1() {\n  scanf(\"%d %d \", &na, &nb);\n  for (int i = 0; i <= na - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= nb - 1; i++)\n    cin >> b[i];\n}\nvoid f2() {\n  sort(a, a + na);\n  sort(b, b + nb);\n}\nvoid f3() {\n  for (int i = 0; i <= na - 1; i++)\n    c[i] = a[i];\n  for (int i = na; i <= na + nb - 1; i++)\n    c[i] = b[i - na];\n}\nvoid f4() {\n  cout << c[0];\n  for (int i = 1; i <= na + nb - 1; i++) {\n    cout << ' ' << c[i];\n  }\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid rank1(int array[], int num, int k) {\n  int a, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j <= num - i; j++)\n      if (array[j] > array[j + 1]) {\n        a = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = a;\n      }\n  for (i = 1; i <= num; i++) {\n    if (i == 1) {\n      if (k == 2)\n        cout << ' ';\n      cout << array[1];\n    } else\n      cout << ' ' << array[i];\n  }\n}\n\nvoid rank2(int num1, int num2) {\n  int array1[10000], array2[10000], i;\n  for (i = 1; i <= num1; i++)\n    cin >> array1[i];\n  for (i = 1; i <= num2; i++)\n    cin >> array2[i];\n  rank1(array1, num1, 1);\n  rank1(array2, num2, 2);\n  cout << endl;\n}\n\nint main() {\n  int num1, num2;\n  scanf(\"%d %d \", &num1, &num2);\n  rank2(num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "14157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int aa[100], bb[100], cc[200], la, lb;\n  void scan(int a[], int la, int b[], int lb);\n  void sort(int a[], int n);\n  void combine(int a[], int la, int b[], int lb, int c[]);\n\n  scanf(\"%d %d\", &la, &lb);\n\n  scan(aa, la, bb, lb);\n  sort(aa, la);\n  sort(bb, lb);\n\n  combine(aa, la, bb, lb, cc);\n}\n\nvoid scan(int a[], int la, int b[], int lb) {\n  int i;\n\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, k, temp;\n\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[k])\n        k = j;\n    temp = a[k];\n    a[k] = a[i];\n    a[i] = temp;\n  }\n}\n\nvoid combine(int a[], int la, int b[], int lb, int c[]) {\n  int i;\n\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n  for (i = 0; i < la + lb; i++) {\n    c[i] = a[i];\n  }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < la + lb; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid a(int k, int n);\nvoid a(int k, int n) {\n  int e[300] = {0}, f[300] = {0}, i = 0, j = 0, t = 0;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &e[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &f[j]);\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1; j++) {\n      if (e[j] > e[j + 1]) {\n        t = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (f[j] > f[j + 1]) {\n        t = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = t;\n      }\n    }\n  }\n  for (i = k, j = 0; i < k + n; i++, j++) {\n    e[i] = f[j];\n  }\n  for (i = 0; i < n + k; i++) {\n    cout << e[i];\n    if (i != n + k - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int k = 0, n = 0;\n  scanf(\"%d %d\", &k, &n);\n  a(k, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[1000] = {0}, b[1000] = {0}, c[1000] = {0};\nvoid du() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid pai() {\n  int j, k, l;\n  for (j = 0; j <= m; j++) {\n    for (k = 0; k < m - 1; k++) {\n      if (a[k] > a[k + 1]) {\n        l = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = l;\n      }\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (b[k] > b[k + 1]) {\n        l = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = l;\n      }\n    }\n  }\n}\nvoid he() {\n  int o, p;\n  for (o = 0; o < m; o++)\n    c[o] = a[o];\n  for (p = 0; p < n; p++) {\n    c[o] = b[p];\n    o++;\n  }\n}\nvoid shu() {\n  int q;\n  for (q = 0; q < m + n; q++) {\n    printf(\"%d\", c[q]);\n    if (q != m + n - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  du();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "14160", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid shuru(int a[], int b[], int m, int n) {\n  int *p = a, *q = b;\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", p);\n    p++;\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", q);\n    q++;\n  }\n}\nvoid paixu(int a[], int m) {\n  int *p = a, b, c, d;\n  for (b = 0; b < m - 1; b++) {\n    for (c = 0; c < m - 1 - b; c++) {\n      if (*(p + c) > *(p + c + 1)) {\n        d = *(p + c);\n        *(p + c) = *(p + c + 1);\n        *(p + c + 1) = d;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  int *r = a, *s = b, *t = c, p, q;\n  for (p = 0; p < m; p++) {\n    *(t + p) = *(r + p);\n  }\n  for (q = 0; q < n; q++) {\n    *(t + m + q) = *(s + q);\n  }\n}\nvoid shuchu(int a[], int b) {\n  int c;\n  printf(\"%d\", a[0]);\n  for (c = 1; c < b; c++) {\n    printf(\" %d\", a[c]);\n  }\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0}, m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m + n);\n}\n"}
{"label": "8", "index": "14161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\nint main() {\n  int m, n, i;\n  int a[50], b[50];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, m);\n  printf(\" \");\n  order(b, n);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14162", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100];\nvoid ranking(int n, int m) {\n  int i, j, p;\n  for (i = n; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m - 1; i++)\n    for (j = n; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  ranking(0, n);\n  ranking(n, n + m);\n  cout << a[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, N[100], M[100];\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &N[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &M[i]);\n}\nvoid sort(int q, int a[]) {\n  int i, j, k, t;\n  for (i = 0; i < q - 1; i++) {\n    k = i;\n    for (j = i + 1; j < q; j++)\n      if (a[j] < a[k])\n        k = j;\n    if (k != i) {\n      t = a[i];\n      a[i] = a[k];\n      a[k] = t;\n    }\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n  for (i = 0; i < m; i++)\n    cout << \" \" << M[i];\n  printf(\"\\n\");\n}\nint main() {\n  scan();\n  sort(n, N);\n  sort(m, M);\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid px(int a[100], int k) {\n  int i, j, b;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[k - 1]);\n}\nvoid fz() {\n  int m, n, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  px(a, n);\n  printf(\" \");\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  px(b, m);\n}\nint main() {\n  fz();\n  return 0;\n}\n"}
{"label": "8", "index": "14165", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid paixu(int n, int a[1000]) {\n  if (n == 0)\n    return;\n  int x, i;\n  int min = a[0];\n  for (x = 0; x < n; x++) {\n    if (a[x] <= min)\n      min = a[x];\n  }\n  if (n > 1)\n    cout << min << ' ';\n  if (n == 1)\n    printf(\"%d\", min);\n  for (x = 0; x < n; x++) {\n    if (a[x] == min)\n      break;\n  }\n  for (i = x; i < n - 1; i++)\n    a[i] = a[i + 1];\n  return paixu(n - 1, a);\n}\nint main() {\n  int m1, m2, x;\n  int s[1000];\n  memset(s, 0, sizeof(s));\n  scanf(\"%d %d \", &m1, &m2);\n  for (x = 0; x < m1; x++)\n    cin >> s[x];\n  paixu(m1, s);\n  cout << ' ';\n  memset(s, 0, sizeof(s));\n  for (x = 0; x < m2; x++)\n    cin >> s[x];\n  paixu(m2, s);\n  return 0;\n}\n"}
{"label": "8", "index": "14166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shit(int, int);\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  shit(m, n);\n  return 0;\n}\nvoid shit(int m, int n) {\n  int i, j;\n  int temp;\n  int a[20];\n  int b[20];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  temp = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b;\nvoid shuru();\nvoid paixu1();\nvoid paixu2();\nint main() {\n  shuru();\n  paixu1();\n  paixu2();\n\n  return 0;\n}\nvoid shuru() { cin >> a >> b; }\nvoid paixu1() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < a; i++)\n    cout << c[i] << \" \";\n}\nvoid paixu2() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < b; i++)\n    cin >> c[i];\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[b - 1];\n}\n"}
{"label": "8", "index": "14168", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid putin(int *p, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> *(p + i);\n}\nvoid putout(int *p, int n) {\n  int m, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (*(p + j) > *(p + j + 1)) {\n        m = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = m;\n      }\n  }\n  cout << *(p + 1);\n  for (i = 2; i < n + 1; i++)\n    cout << \" \" << *(p + i);\n}\nint main() {\n  int n1, n2, a[10000], b[10000], *pa, *pb;\n  pa = a;\n  pb = b;\n  cin >> n1 >> n2;\n  putin(pa, n1);\n  putin(pb, n2);\n  putout(pa, n1);\n  printf(\" \");\n  putout(pb, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14169", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint work(int now, int x) {\n  int i, j, swap;\n  int a[1002];\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= x; i++) {\n    for (j = i + 1; j <= x; j++) {\n      if (a[i] > a[j]) {\n        swap = a[i];\n        a[i] = a[j];\n        a[j] = swap;\n      }\n    }\n  }\n  if (now == 2) {\n    printf(\" \");\n  }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  return (0);\n}\nint main() {\n  int n, m;\n  cin >> n >> m;\n  work(1, n);\n  work(2, m);\n  return (0);\n}\n"}
{"label": "8", "index": "14170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\nint ans[200];\nvoid read(int a[], int b[]) {\n  cin >> m;\n  cin >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int m) {\n  int temp;\n  for (int i = 1; i < m; i++) {\n    for (int j = i + 1; j <= m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[]) {\n  for (int i = 1; i <= m; i++)\n    ans[i] = a[i];\n  for (int i = 1; i <= n; i++)\n    ans[m + i] = b[i];\n}\nvoid out(int a[], int m) {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  read(a, b);\n  sort(a, m);\n  sort(b, n);\n  add(a, b);\n  out(ans, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  scanf(\"%d%d\", &m, &n);\n  printf(\"\\n\");\n  int a[m], b[n], i, j;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"\\n\");\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *order(int *p, int k) {\n  int i, j;\n  int t = 0;\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (p[j] > p[j + 1]) {\n        t = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  return p;\n}\nint *merge(int *p, int *q, int m, int n) {\n  int i;\n  int *u = (int *)malloc((m + n) * sizeof(int));\n  for (i = 0; i < m; i++) {\n    u[i] = p[i];\n  }\n  for (i = 0; i < n; i++) {\n    u[m + i] = q[i];\n  }\n  return u;\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  a = order(a, m);\n  b = order(b, n);\n  int *p = merge(a, b, m, n);\n  printf(\"%d\", p[0]);\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", p[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid duqu(int n, int m, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n, int b[], int m) {\n  int i, j, t;\n\n  for (j = 0; j < n - 1; j++) {\n\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  }\n  for (j = 0; j < m - 1; j++) {\n\n    for (i = 0; i < m - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  }\n}\nvoid hebing(int array1[], int array2[], int n, int m) {\n  int i;\n  for (i = n; i < (n + m); i++) {\n    array1[i] = array2[i - n];\n  }\n}\nvoid xian(int array[], int n, int m) {\n  int i;\n  for (i = 0; i < (n + m - 1); i++)\n    printf(\"%d \", array[i]);\n  printf(\"%d\", array[n + m - 1]);\n}\n\nint main() {\n  void duqu(int n, int m, int a[], int b[]);\n  void sort(int *p1, int n, int *p2, int m);\n  void hebing(int array1[], int array2[], int n, int m);\n  void xian(int array[], int n, int m);\n  int n, m, a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  duqu(n, m, a, b);\n  sort(a, n, b, m);\n  hebing(a, b, n, m);\n  xian(a, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[300], b[300], m, n, i, j, t, c[300];\nvoid f1() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\nvoid f4() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++) {\n    cout << ' ' << c[i];\n  }\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14175", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a, b;\nint a1[20], b1[20], c[40];\nvoid input(void) {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++)\n    cin >> a1[i];\n  for (int j = 0; j < b; j++)\n    cin >> b1[j];\n}\nvoid select_sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid combine(int array1[], int array2[]) {\n  for (int i = 0; i < a; i++)\n    c[i] = array1[i];\n  for (int j = 0; j < b; j++)\n    c[j + a] = array2[j];\n}\nvoid output(void) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[a + b - 1] << endl;\n}\nint main() {\n  input();\n  select_sort(a1, a);\n  select_sort(b1, b);\n  combine(a1, b1);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint i, j, k;\nint q[10000], p[10000];\n\nvoid a() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> q[i];\n  }\n}\nvoid b(int x[], int y[]) {\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n      \n      if (x[j] > x[j + 1]) {\n        k = x[j + 1];\n        x[j + 1] = x[j];\n        x[j] = k;\n      }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      \n      if (y[j] > y[j + 1]) {\n        k = y[j + 1];\n        y[j + 1] = y[j];\n        y[j] = k;\n      }\n  }\n  for (i = 0; i < m; i++) {\n    cout << x[i] << ' ';\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << y[i] << ' ';\n  }\n  cout << y[n - 1] << endl;\n}\n\nint main() {\n  a();\n  b(p, q);\n  return (0);\n}\n"}
{"label": "8", "index": "14177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[100], b[100], t, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j <= n; j++) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++) {\n    for (j = 2; j <= m; j++) {\n      if (b[j] < b[j - 1]) {\n        t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B, a[40], b[40];\n\nvoid enter() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= A; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[1]);\n  for (i = 2; i <= B; i++)\n    scanf(\" %d\", &b[i]);\n}\n\nvoid array_1() {\n  int i, j, m;\n  for (i = 1; i <= A - 1; i++)\n    for (j = 1; j <= A - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 1; i <= B - 1; i++)\n    for (j = 1; j <= B - i; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\n\nvoid connect() {\n  int i, j;\n  for (i = A + 1, j = 1; i <= A + B; i++, j++)\n    a[i] = b[j];\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= A + B; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  enter();\n  array_1();\n  connect();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14179", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pai1(int x[1000], int y);\nint pai2(int x[1000], int y);\nint main() {\n  int n, m, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    cin >> b[j];\n  }\n  pai1(a, n);\n  pai2(b, m);\n  return 0;\n}\n\nint pai1(int x[], int y) {\n  int i, j, min, stmp, flag = 0;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++) {\n    if (flag == 0) {\n      printf(\"%d\", x[i]);\n      flag = 1;\n      continue;\n    }\n    if (flag == 1) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  return 0;\n}\nint pai2(int x[], int y) {\n  int i, j, min, stmp;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", x[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], c[20000], n, m;\nvoid input() {\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine() {\n  for (int i = 0; i < n; i++)\n    c[i] = a[i];\n  for (int j = n; j < n + m; j++)\n    c[j] = b[j - n];\n}\nvoid out() {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  input();\n  sort();\n  combine();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int *M, int *N, int a[], int b[]) {\n  scanf(\"%d %d\", M, N);\n  int i;\n  for (i = 0; i < *M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < *N; i++)\n    scanf(\"%d\", &b[i]);\n\n  return;\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid merge(int M, int N, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = 0; i < N; i++)\n    c[i + M] = b[i];\n}\n\nvoid output(int M, int N, int c[]) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[M + N - 1]);\n}\n\nint main() {\n  int M, N, a[100000], b[100000];\n  input(&M, &N, a, b);\n  sort(a, M);\n  sort(b, N);\n\n  int c[100000];\n  merge(M, N, a, b, c);\n  output(M, N, c);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14182", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(int str[], int m) {\n  int i, j, k;\n  for (j = 0; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if (str[i] > str[i + 1]) {\n        k = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = k;\n      }\n}\n\nvoid g(int a[], int b[], int ma, int mb) {\n  int i;\n  for (i = ma; i < (ma + mb); i++)\n    a[i] = b[i - ma];\n}\n\nint main() {\n  int ma, mb, i;\n  int a[8888], b[8888];\n  scanf(\"%d %d\", &ma, &mb);\n  for (i = 0; i < ma; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < mb; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, ma);\n  f(b, mb);\n  g(a, b, ma, mb);\n  for (i = 0; i <= (ma + mb - 1); i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "8", "index": "14183", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint m, n, i, j;\nvoid temp() {\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid temp1() {\n  int x;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp2() {\n  int x;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp3() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  temp();\n  temp1();\n  temp2();\n  temp3();\n  return 0;\n}\n"}
{"label": "8", "index": "14184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d %d\", &a, &b);\n  int c[100];\n  int d[100];\n  int i, t, r;\n  i = 0;\n  do {\n    scanf(\"%d\", &c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    scanf(\"%d\", &d[i]);\n    i++;\n  } while (i < b);\n  t = 0;\n  do {\n    i = 0;\n    while (i < a - 1 - t) {\n      if (c[i] > c[i + 1]) {\n        r = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < a - 1);\n  t = 0;\n  do {\n    i = 0;\n    while (i < b - 1 - t) {\n      if (d[i] > d[i + 1]) {\n        r = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < b - 1);\n  printf(\"%d\", c[0]);\n  i = 1;\n  do {\n    printf(\" %d\", c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    printf(\" %d\", d[i]);\n    i++;\n  } while (i < b);\n  return 0;\n}\n"}
{"label": "8", "index": "14185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b, c[100], d[100], i, j, t;\nvoid c1() {\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid c2() {\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b; i++)\n    for (j = 0; j < b - i - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n    }\n}\nvoid c3() {\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n  for (i = 0; i < b - 1; i++)\n    cout << d[i] << \" \";\n  printf(\"%d\", d[b - 1]);\n}\nint main() {\n  c1();\n  c2();\n  c3();\n  return 0;\n}\n"}
{"label": "8", "index": "14186", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[2000] = {0}, b[1000] = {0};\n\nvoid read() {\n  int x, y;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid paixu(int z[]) {\n  int c;\n  for (int i = 0; z[i + 2] != 0; i++)\n    for (int j = 0; z[j + 1] != 0; j++)\n      if (z[j] > z[j + 1]) {\n        c = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = c;\n      }\n}\nvoid addd(int x[], int y[]) {\n  int q = 0;\n  while (x[q] != 0) {\n    q++;\n  }\n  for (int z = 0; y[z] != 0; z++)\n    x[q + z] = y[z];\n}\nvoid shuchu(int x[]) {\n  for (int z = 0; x[z] != 0; z++)\n    if (!z)\n      cout << x[z];\n    else\n      cout << ' ' << x[z];\n}\nint main() {\n  read();\n  paixu(a);\n  paixu(b);\n  addd(a, b);\n  shuchu(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid com(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nint main() \n{\n  cin >> n1 >> n2;\n  in(n1, num1);\n  com(n1, num1);\n  in(n2, num2);\n  com(n2, num2);\n  for (int i = 0; i < n1; i++)\n    cout << num1[i] << ' ';\n  for (int j = 0; j < n2 - 1; j++)\n    cout << num2[j] << ' ';\n  cout << num2[n2 - 1] << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "14188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100];\nvoid shuru() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid paixu() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++) {\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n    }\n}\nvoid hebin() {\n  int i;\n  for (i = n + 1; i <= n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\\n\", a[m + n]);\n}\nint main() {\n  shuru();\n  paixu();\n  hebin();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int zhengshuchuan[], int changdu) {\n  int i, j, t;\n  for (i = 0; i < changdu; i++) {\n    for (j = i; j < changdu; j++) {\n      if (zhengshuchuan[i] > zhengshuchuan[j]) {\n        t = zhengshuchuan[i];\n        zhengshuchuan[i] = zhengshuchuan[j];\n        zhengshuchuan[j] = t;\n      }\n    }\n  }\n  return 0;\n}\nint main() {\n  int a[200], b[100], i;\n  int changdu1, changdu2;\n  scanf(\"%d %d\", &changdu1, &changdu2);\n  for (i = 0; i < changdu1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < changdu2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, changdu1);\n  f(b, changdu2);\n  for (i = 0; i < changdu2; i++) {\n    a[changdu1 + i] = b[i];\n  }\n\n  for (i = 0; i < changdu1 + changdu2; i++) {\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14190", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint len1, len2;\nint *sz1, *sz2;\n\nvoid read() {\n  int i;\n  scanf(\"%d%d\", &len1, &len2);\n  sz1 = (int *)malloc(1000 * (len1 + len2));\n  sz2 = (int *)malloc(1000 * len2);\n\n  for (i = 0; i < len1; i++)\n    scanf(\"%d\", sz1 + i);\n  for (i = 0; i < len2; i++)\n    scanf(\"%d\", sz2 + i);\n}\nvoid sort() {\n  int i, j, temp;\n\n  for (i = 0; i < len1; i++) {\n    for (j = i + 1; j < len1; j++)\n      if (sz1[i] > sz1[j]) {\n        temp = sz1[i];\n        sz1[i] = sz1[j];\n        sz1[j] = temp;\n      }\n  }\n  for (i = 0; i < len2; i++) {\n    for (j = i + 1; j < len2; j++)\n      if (sz2[i] > sz2[j]) {\n        temp = sz2[i];\n        sz2[i] = sz2[j];\n        sz2[j] = temp;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < len2; i++) {\n    sz1[len1 + i] = sz2[i];\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", sz1[0]);\n  for (i = 1; i < len1 + len2; i++) {\n    printf(\" %d\", sz1[i]);\n  }\n  printf(\" \");\n}\n\nint main() {\n  read();\n  sort();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s1[100], s2[100];\n  int m, n, i, t, j;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j + 1];\n        s1[j + 1] = s1[j];\n        s1[j] = t;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j + 1];\n        s2[j + 1] = s2[j];\n        ;\n        s2[j] = t;\n      }\n\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", s2[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14192", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[100], n, m, i, j, k;\n\nvoid get_array();\nvoid sort_array();\nvoid combine_array();\nvoid print_array();\n\nint main() {\n  get_array();\n\n  sort_array();\n\n  combine_array();\n\n  print_array();\n\n  return 0;\n}\n\nvoid get_array() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid sort_array() {\n  int temp = 0;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine_array() {\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\nvoid print_array() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n}\n"}
{"label": "8", "index": "14193", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\nvoid link(int array1[], int array2[], int m, int n) {\n  int i;\n  for (i = m; i < m + n; i++)\n    array1[i] = array2[i - m];\n}\n\nint main() {\n  int a[40], b[20], n1, n2, i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, n1);\n  sort(b, n2);\n  link(a, b, n1, n2);\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i == n1 + n2 - 1)\n    printf(\"%d\", a[i]);\n}\n"}
{"label": "8", "index": "14194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid change(int a[]);\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i;\n  int first = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  change(a);\n  for (i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  n = m;\n  change(b);\n  for (i = 0; i < m; i++) {\n    if (first == 1)\n      cout << \" \" << b[i];\n    if (first == 0) {\n      printf(\"%d\", b[i]);\n      first = 1;\n    }\n  }\n  cout << endl;\n  return 0;\n}\nvoid change(int a[]) {\n  int t;\n  int i, j;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "8", "index": "14195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a;\nint str1[10000], str2[10000];\nvoid dosomething(int str[10000], int q);\n\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &str1[i]);\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", &str2[i]);\n  dosomething(str1, n);\n  dosomething(str2, m);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", str1[i]);\n  for (int i = 0; i < m; i++)\n    i == 0 ? printf(\"%d\", str2[i]) : printf(\" %d\", str2[i]);\n}\n\nvoid dosomething(int str[10000], int q) {\n  for (int i = 0; i < q - 1; i++)\n    for (int j = i + 1; j < q; j++) {\n      if (str[i] > str[j])\n        a = str[i], str[i] = str[j], str[j] = a;\n    }\n}\n"}
{"label": "8", "index": "14196", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], n, m, c[1000];\nvoid input(int a[], int b[]) {\n  int i, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++)\n    cin >> b[j];\n}\nvoid charge(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= m - 2; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid hook(int a[], int b[]) {\n  int i, j;\n  for (i = n, j = 0; i <= n + m - 1; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i <= m + n - 2; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n - 1]);\n}\nint main() {\n  input(a, b);\n  charge(a, b);\n  hook(a, b);\n  print(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int x, int b[], int y) {\n  int m, n, i;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n    \n  }\n  for (i = m; i < x; i++)\n    a[i] = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n    \n  }\n  for (i = n; i < y; i++)\n    b[i] = -1;\n}\n\nvoid f2(int a[], int x, int b[], int y) {\n  int i, j, t, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\n\nvoid f3(int a[], int x, int b[], int y, int c[], int z) {\n  int i, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n  for (i = n + m; i < z; i++)\n    c[i] = -1;\n}\n\nvoid f4(int c[], int x) {\n  int i, e;\n\n  for (i = 0, e = 0; i < x; i++)\n    if (c[i] >= 0)\n      e++;\n  for (i = 0; i < e; i++) {\n    printf(\"%d\", c[i]);\n    if (i != e - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int a[30], b[30], c[60];\n  int i;\n\n  f1(a, 30, b, 30); \n\n  f2(a, 30, b, 30); \n\n  \n  \n  \n  \n  \n  \n\n  f3(a, 30, b, 30, c, 60); \n                           \n                           \n                           \n  f4(c, 60);\n}\n"}
{"label": "8", "index": "14198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input();\nvoid arrange();\nvoid add();\nvoid output();\nint a[100], b[100], c[200], n1, n2;\nint main() {\n  input();\n  arrange();\n  add();\n  output();\n}\nvoid input() {\n  int i, j;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n2; j++)\n    scanf(\"%d\", &b[j]);\n}\n\nvoid arrange() {\n  int i, j, temp;\n  for (i = 0; i < n1; i++)\n    for (j = i; j < n1; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < n2; i++)\n    for (j = i; j < n2; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid add() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    c[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    c[i] = b[i - n1];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", c[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n    else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "8", "index": "14199", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s(int m);\nint p(int m, int i, int a[100]);\nvoid e(int i, int c[100], int d[100], int m, int n);\nint main() {\n  int i, m, n, a[100], b[100], c[100], d[100];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    a[i] = s(i);\n  for (i = 0; i < n; i++)\n    b[i] = s(i);\n  for (i = 0; i < m; i++)\n    c[i] = p(m, i, a);\n  for (i = 0; i < n; i++)\n    d[i] = p(n, i, b);\n  for (i = 0; i < m + n; i++)\n    e(i, c, d, m, n);\n  return 0;\n}\nint s(int m) {\n  int a[100];\n  cin >> a[m];\n  return a[m];\n}\nint p(int m, int i, int a[100]) {\n  int p, q, n;\n  for (p = 0; p < m; p++) {\n    for (q = 0; q < m - 1; q++) {\n      if (a[q] > a[q + 1]) {\n        n = a[q];\n        a[q] = a[q + 1];\n        a[q + 1] = n;\n      }\n    }\n  }\n  return a[i];\n}\nvoid e(int i, int c[100], int d[100], int m, int n) {\n  if (i == 0)\n    printf(\"%d\", c[0]);\n  if (i > 0 && i < m)\n    printf(\" %d\", c[i]);\n  if (i >= m)\n    printf(\" %d\", d[i - m]);\n}\n"}
{"label": "8", "index": "14200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid scan(int x[], int *nx, int y[], int *ny) {\n  int i;\n  scanf(\"%d %d\", nx, ny);\n  for (i = 0; i < *nx; i++)\n    cin >> x[i];\n  for (i = 0; i < *ny; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid sort(int x[], int num) {\n  int i, j;\n  for (i = num - 1; i >= 1; i--)\n    for (j = 1; j <= i; j++)\n      if (x[j - 1] > x[j]) {\n        int temp = x[j - 1];\n        x[j - 1] = x[j];\n        x[j] = temp;\n      }\n}\nvoid exp(int a[], int b[], int na, int nb) {\n  int i;\n  for (i = na; i < na + nb; i++)\n    a[i] = b[i - na];\n}\nvoid print(int a[], int na, int nb) {\n  printf(\"%d\", a[0]);\n  int i;\n  for (i = 1; i < na + nb; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  int a[100], na, b[100], nb;\n  scan(a, &na, b, &nb);\n  sort(a, na);\n  sort(b, nb);\n  exp(a, b, na, nb);\n  print(a, na, nb);\n}\n"}
{"label": "8", "index": "14201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid get(int n, int *a) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid order(int n, int *a) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid puttogether(int n, int *a, int m, int *b) {\n  int i;\n  for (i = n; i < n + m; i++)\n    a[i] = b[i - n];\n\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  int a[500], b[500];\n  int m, n;\n  scanf(\"%d %d\", &n, &m);\n  get(n, a);\n  get(m, b);\n  order(n, a);\n  order(m, b);\n  puttogether(n, a, m, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint M, N;\nvoid x() {\n  int i;\n  scanf(\"%d\", &M);\n  scanf(\"%d\", &N);\n  for (i = 0; i <= M - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= N - 1; i++)\n    cin >> b[i];\n};\nvoid y() {\n  int i, j, m;\n  for (i = 1; i <= M - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] < a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  for (i = 1; i <= N - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] < b[j]) {\n        m = b[i];\n        b[i] = b[j];\n        b[j] = m;\n      }\n    }\n  }\n};\nvoid z() {\n  int i;\n  for (i = 0; i <= M - 1; i++)\n    c[i] = a[i];\n  for (i = 0; i <= N - 1; i++)\n    c[i + M] = b[i];\n};\nvoid u() {\n  int i;\n  for (i = 0; i <= M + N - 2; i++)\n    printf(\"%d \", c[i]);\n  cout << c[M + N - 1];\n};\nint main() {\n  x();\n  y();\n  z();\n  u();\n  return 0;\n}\n"}
{"label": "8", "index": "14203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], m, n;\nint main() {\n  void Read(), Ord(), Gath(), Prin();\n  Read();\n  Ord();\n  Gath();\n  Prin();\n  return 0;\n}\n\nvoid Read() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Ord() {\n  int i, j;\n  void swap_a(int i, int j), swap_b(int i, int j);\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (a[i] > a[j])\n        swap_a(i, j);\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (b[i] > b[j])\n        swap_b(i, j);\n}\n\nvoid Gath() {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\n\nvoid Prin() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= m + n; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\n\nvoid swap_a(int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\n\nvoid swap_b(int i, int j) {\n  int temp;\n  temp = b[i];\n  b[i] = b[j];\n  b[j] = temp;\n}\n"}
{"label": "8", "index": "14204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000], la, lb;\nint p;\nint c[1000], lc;\n\nvoid M1(int m1) {\n  cin >> la >> lb;\n  for (int i = 1; i <= la; i++)\n    cin >> a[i];\n  for (int i = 1; i <= lb; i++)\n    cin >> b[i];\n}\n\nvoid M2(int m2) {\n  for (int i = 1; i <= la; i++) {\n    for (int j = 1; j <= la - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (int i = 1; i <= lb; i++) {\n    for (int j = 1; j <= lb - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\n\nvoid M3(int m3) {\n  lc = la + lb;\n  for (int i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (int i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n}\n\nvoid M4(int m4) {\n  for (int i = 1; i <= lc; i++) {\n    cout << c[i];\n    if (i == lc)\n      break;\n    cout << \" \";\n  }\n}\n\nint main() {\n  M1(1);\n  M2(1);\n  M3(1);\n  M4(1);\n  return 0;\n}\n"}
{"label": "8", "index": "14205", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void shuru(int *p, int m);\n  void paixu(int *p, int m);\n  void hebing(int *p1, int m, int *p2, int n);\n  void shuchu(int *p, int);\n  int m, n, i;\n  int *p1, *p2;\n  int a[200], b[100];\n  p1 = a;\n  p2 = b;\n  scanf(\"%d%d\", &m, &n);\n  shuru(p1, m);\n  shuru(p2, n);\n  paixu(p1, m);\n  paixu(p2, n);\n  hebing(p1, m, p2, n);\n  shuchu(p1, m + n);\n  return 0;\n}\nvoid shuru(int *p, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n}\nvoid paixu(int *p, int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++)\n      if (*(p + i) > *(p + j)) {\n        temp = *(p + i);\n        *(p + i) = *(p + j);\n        *(p + j) = temp;\n      }\n}\nvoid hebing(int *p1, int m, int *p2, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    *(p1 + m + i) = *(p2 + i);\n}\nvoid shuchu(int *p, int x) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d%c\", *(p + i), i != (x - 1) ? ' ' : '\\n');\n}\n"}
{"label": "8", "index": "14206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s1 = 0, s2 = 0;\nvoid reads() { cin >> s1 >> s2; }\nvoid read(int s, int a[]) {\n  for (int i = 1; i <= s; i++)\n    cin >> a[i];\n}\nvoid sort(int s, int a[]) {\n  for (int i = 1; i <= s - 1; i++)\n    for (int j = i + 1; j <= s; j++) {\n      if (a[i] > a[j]) {\n        int c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n}\nvoid combine(int s1, int s2, int a1[], int a2[]) {\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    a1[i] = a2[i - s1];\n}\nvoid print(int s, int a[]) {\n  for (int i = 1; i <= s; i++) {\n    printf(\"%d\", a[i]);\n    if (i < s)\n      cout << ' ';\n  }\n}\nint main() {\n  int a1[500], a2[500];\n  reads();\n  read(s1, a1);\n  read(s2, a2);\n  sort(s1, a1);\n  sort(s2, a2);\n  combine(s1, s2, a1, a2);\n  print(s1 + s2, a1);\n  return 0;\n}\n"}
{"label": "8", "index": "14207", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000];\nvoid inputdata();\nvoid outputdata();\nvoid sortdata();\n\nint main() {\n  inputdata();\n  sortdata();\n  outputdata();\n\n  return 0;\n}\n\nvoid inputdata() {\n  cin >> a[0] >> b[0];\n  for (int i = 1; i <= a[0]; i++)\n    cin >> a[i];\n  for (int i = 1; i <= b[0]; i++)\n    cin >> b[i];\n}\nvoid sortdata() {\n  sort(a + 1, a + a[0] + 1);\n  sort(b + 1, b + b[0] + 1);\n}\nvoid outputdata() {\n  for (int i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i < b[0]; i++)\n    cout << b[i] << ' ';\n  cout << b[b[0]];\n}\n"}
{"label": "8", "index": "14208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nint out[200];\n\nvoid p1(void) {\n  int i;\n\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &num1[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &num2[i]);\n  }\n}\n\nvoid p2(int num1[100], int num2[100], int n1, int n2) {\n  int i, j, tmp;\n  \n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tmp = num1[j];\n        num1[j] = num1[i];\n        num1[i] = tmp;\n      }\n    }\n  }\n  \n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tmp = num2[j];\n        num2[j] = num2[i];\n        num2[i] = tmp;\n      }\n    }\n  }\n}\n\nvoid p3(int num1[100], int num2[100], int n1, int n2) {\n\n  int i = 0, j = 0;\n  while (i < n1) {\n    out[i] = num1[i];\n    i++;\n  }\n  while (j < n2) {\n    out[n1 + j] = num2[j];\n    j++;\n  }\n}\n\nvoid p4(int out[200], int n) {\n  int i;\n  printf(\"%d\", out[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", out[i]);\n  }\n}\nint main() {\n  p1();\n  p2(num1, num2, n1, n2);\n  p3(num1, num2, n1, n2);\n  p4(out, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nvoid shuru(int x, int y, int a[], int b[]) {\n  cin >> x >> y;\n  m = x;\n  n = y;\n  for (int i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n} \nvoid paixu(int x[], int l) {\n  for (int i = 0; i < l - 1; i++) {\n    for (int j = 0; j < l - 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int p;\n        p = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = p;\n      }\n    }\n  }\n} \nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n} \nvoid shuchu(int c[], int m, int n) {\n  for (int i = 0; i < n + m; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << \" \" << c[i];\n  }\n} \nint main() {\n  shuru(m, n, a, b);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m, n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14210", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int word1[100], word2[100];\n  int num1, num2;\n  scanf(\"%d %d\", &num1, &num2);\n  int i;\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d\", &word1[i]);\n  }\n  printf(\"\\n\");\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &word2[i]);\n  }\n  printf(\"\\n\");\n  int j, k, temp;\n  for (j = 1; j <= num1 * num1; j++) {\n    for (k = 0; k < num1 - 1; k++) {\n      if (word1[k] >= word1[k + 1]) {\n        temp = word1[k];\n        word1[k] = word1[k + 1];\n        word1[k + 1] = temp;\n      }\n    }\n  }\n  for (j = 1; j <= num2 * num2; j++) {\n    for (k = 0; k < num2 - 1; k++) {\n      if (word2[k] >= word2[k + 1]) {\n        temp = word2[k];\n        word2[k] = word2[k + 1];\n        word2[k + 1] = temp;\n      }\n    }\n  }\n  int zjword[300], l;\n  for (l = 0; l < num1 + num2; l++) {\n    if (l < num1) {\n      zjword[l] = word1[l];\n    } else {\n      zjword[l] = word2[l - num1];\n    }\n  }\n  int m;\n  for (m = 0; m < num1 + num2; m++) {\n    if (m != num1 + num2 - 1)\n      printf(\"%d \", zjword[m]);\n    else\n      printf(\"%d\", zjword[m]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14211", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, i, a[100], b[100], c[200];\nvoid in() {\n  cin >> m >> n;\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort() {\n  sort(&a[0], &a[0] + m);\n  sort(&b[0], &b[0] + n);\n}\nvoid add() {\n  for (i = 0; i < m; ++i)\n    c[i] = a[i];\n  for (i = m; i < m + n; ++i)\n    c[i] = b[i - m];\n}\nvoid out() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; ++i)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  in();\n  sort();\n  add();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int, int, int *, int *);\nvoid paixu(int *, int);\nvoid output(int, int, int *, int *);\n\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  scanf(\"%d %d \", &num1, &num2);\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &shu1[i]);\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid scan(int n[], int a[], int b[]) {\n  int i;\n  scanf(\"%d%d\", &n[0], &n[1]);\n\n  for (i = 0; i < n[0]; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[], int m, int n) {\n  int i, j, t;\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\n\nvoid com(int a[], int b[], int ab[], int m, int n) {\n  int i;\n\n  for (i = 0; i < m; i++)\n    ab[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    ab[m + i] = b[i];\n}\n\nvoid prt(int ab[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", ab[i]);\n\n  cout << ab[m + n - 1];\n}\n\nint main() {\n  int a[101], b[101], n[2], ab[202];\n\n  scan(n, a, b);\n  sort(a, b, n[0], n[1]);\n  com(a, b, ab, n[0], n[1]);\n  prt(ab, n[0], n[1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, b[50] = {0};\n  int i, j, c, d, s;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < d; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < c - 1; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < d - 1; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < c; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < d; i++) {\n    printf(\" %d\", b[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint input() {\n  int i;\n  scanf(\"%d\", &i);\n  return (i);\n}\nvoid shit(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << a[i] << \" \";\n}\nvoid damn(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n  }\n}\nint main() {\n  int m = input(), n = input();\n  int a[1000], b[1000];\n  shit(a, m);\n  damn(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, n, sizeof(int), compare);\n  qsort(b, m, sizeof(int), compare);\n  int c[n + m];\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n, j = 0; i < m + n; i++, j++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < n + m - 1; i++) {\n\n    cout << c[i] << \" \";\n  }\n  printf(\"%d \", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[200], n1, n2;\nint shuru(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> a[i];\n  for (int i = 0; i < n2; i++)\n    cin >> b[i];\n}\nint pai() {\n  int m;\n  for (int j = 0; j < n1 - 1; j++)\n    for (int i = 0; i < n1 - 1; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = m;\n      }\n  for (int j = 0; j < n2 - 1; j++)\n    for (int i = 0; i < n2 - 1; i++)\n      if (b[i] > b[i + 1]) {\n        m = b[i + 1];\n        b[i + 1] = b[i];\n        b[i] = m;\n      }\n}\nint jie() {\n  for (int i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (int i = 0; i < n2; i++)\n    c[n1 + i] = b[i];\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  shuru();\n  pai();\n  jie();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pre(int *, int);\n  void bubble_sort(int *, int);\n  void merge(int *, int, int *, int, int *);\n  void print(int *, int);\n  int a[1000], b[1000], c[1000], A, B;\n  scanf(\"%d %d\", &A, &B);\n  pre(a, A);\n  bubble_sort(a, A);\n  pre(b, B);\n  bubble_sort(b, B);\n  merge(a, A, b, B, c);\n  print(c, A + B);\n}\nvoid pre(int *a, int A) {\n  int i;\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", a + i);\n}\nvoid bubble_sort(int *a, int A) {\n  int i, j, temp;\n  for (j = A - 1; j > 0; j--) {\n    for (i = 0; i < j; i++)\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n  }\n}\nvoid merge(int *a, int A, int *b, int B, int *c) {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = 0; i < B; i++)\n    c[i + A] = b[i];\n}\nvoid print(int *c, int C) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < C; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14219", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint input(int *s, int n) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  return 0;\n}\n\nint sort(int *s, int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (s[j - 1] > s[j]) {\n        int temp = s[j - 1];\n        s[j - 1] = s[j];\n        s[j] = temp;\n      }\n    }\n  }\n  return 0;\n}\n\nint combine(int *s1, int *s2, int n1, int n2, int *s) {\n  int i = 0;\n  for (i = 0; i < n1; i++)\n    s[i] = s1[i];\n  for (i = 0; i < n2; i++)\n    s[i + n1] = s2[i];\n  return 0;\n}\n\nint output(int *s, int n) {\n  int i = 0;\n  if (n <= 0)\n    return 0;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", s[i]);\n}\n\nint main() {\n  int n1 = 0, n2 = 0;\n  scanf(\"%d %d\", &n1, &n2);\n  int s1[1000] = {0};\n  int s2[1000] = {0};\n  input(s1, n1);\n  input(s2, n2);\n  sort(s1, n1);\n  sort(s2, n2);\n  int s[2000] = {0};\n  combine(s1, s2, n1, n2, s);\n  output(s, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20] = {0}, b[20] = {0}, c[40] = {0}, i, j, k;\nint main() {\n  void qushu();\n  void paixu();\n  void hebing();\n  void xianshi();\n  qushu();\n  paixu();\n  hebing();\n  xianshi();\n  return 0;\n}\nvoid qushu() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu() {\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n}\nvoid hebing() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a1[100], a2[100];\nint n1, n2;\nint a[200];\n\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid paixu(int b1[], int b2[], int m1, int m2) {\n  int i, j, t;\n  for (i = 0; i < m1 - 1; i++)\n    for (j = 0; j < m1 - 1 - i; j++)\n      if (b1[j] > b1[j + 1]) {\n        t = b1[j];\n        b1[j] = b1[j + 1];\n        b1[j + 1] = t;\n      }\n  for (i = 0; i < m2 - 1; i++)\n    for (j = 0; j < m2 - 1 - i; j++)\n      if (b2[j] > b2[j + 1]) {\n        t = b2[j];\n        b2[j] = b2[j + 1];\n        b2[j + 1] = t;\n      }\n}\n\nvoid hebing(int c1[], int c2[], int m1, int m2) {\n  int i, j;\n  for (i = 0; i < m1; i++)\n    a[i] = c1[i];\n  for (j = 0; j < m2; j++) {\n    a[i] = c2[j];\n    i++;\n  }\n}\n\nvoid shuchu(int d[], int m1, int m2) {\n  int i;\n  for (i = 0; i < (m1 + m2); i++) {\n    if (i < m1 + m2 - 1)\n      printf(\"%d \", d[i]);\n    else\n      printf(\"%d\\n\", d[i]);\n  }\n}\n\nint main() {\n  shuru();\n  paixu(a1, a2, n1, n2);\n  hebing(a1, a2, n1, n2);\n  shuchu(a, n1, n2);\n}\n"}
{"label": "8", "index": "14222", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid reset1(int a[]);\nvoid reset2(int b[]);\nint main() {\n  int a[100], b[100], i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  reset1(a);\n  reset2(b);\n  for (i = 0; i < n; i++) {\n    cout << a[i] << ' ';\n  }\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid reset1(int a[]) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid reset2(int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "14223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1001] = {0};\nint b[1001] = {0};\nint m, n;\nvoid loaddata() {\n  int l;\n  scanf(\"%d %d\", &m, &n);\n  for (l = 0; l < m; l++)\n    scanf(\"%d\", &a[l]);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &b[l]);\n}\nvoid arrsort() {\n  int i, j, k;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid add() {\n  int p;\n  for (p = 0; p < n; p++) {\n    a[p + m] = b[p];\n  }\n}\nvoid print() {\n  int q;\n  cout << a[0];\n  for (q = 1; q < m + n; q++)\n    printf(\" %d\", a[q]);\n}\n\nint main() {\n  loaddata();\n  arrsort();\n  add();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int n1, n2;\n  int *a1, *a2;\n  int i1, i2, i3, i4;\n  scanf(\"%d %d\", &n1, &n2);\n  a1 = (int *)malloc(sizeof(int) * n1);\n  a2 = (int *)malloc(sizeof(int) * n2);\n  for (i1 = 0; i1 < n1; i1++) {\n    scanf(\"%d\", a1 + i1);\n  }\n  for (i2 = 0; i2 < n2; i2++) {\n    scanf(\"%d\", a2 + i2);\n  }\n  qsort(a1, n1, sizeof(int), Compare);\n  qsort(a2, n2, sizeof(int), Compare);\n  for (i3 = 0; i3 < n1; i3++) {\n    cout << a1[i3] << \" \";\n  }\n  for (i4 = 0; i4 < n2 - 1; i4++) {\n    printf(\"%d \", a2[i4]);\n  }\n  printf(\"%d\", a2[n2 - 1]);\n}\n"}
{"label": "8", "index": "14225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid get(int n, int *a) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid order(int n, int *a) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid puttogether(int n, int *a, int m, int *b) {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n + m; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  int a[500], b[500];\n  int m, n;\n  scanf(\"%d %d\", &n, &m);\n  get(n, a);\n  get(m, b);\n  order(n, a);\n  order(m, b);\n  puttogether(n, a, m, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14226", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid scan_(int m, int *a, int n, int *b);\nvoid sort_(int m, int *a, int n, int *b);\nvoid print_(int m, int *a, int n, int *b);\n\nint main() {\n  int m, n, *a, *b;\n  cin >> m >> n;\n  a = (int *)malloc(m * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  scan_(m, a, n, b);\n  sort_(m, a, n, b);\n  print_(m, a, n, b);\n  return 0;\n}\n\nvoid scan_(int m, int *a, int n, int *b) {\n  int i, j, *p;\n\n  p = a;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", p++);\n  p = b;\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", p++);\n}\n\nvoid sort_(int m, int *a, int n, int *b) {\n  int i, j, t, *q;\n  for (i = 0; i < m - 1; i++) {\n    q = a;\n    for (j = 0; j < m - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    q = b;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n}\n\nvoid print_(int m, int *a, int n, int *b) {\n  int i, *p;\n  printf(\"%d\", *a);\n  p = a + 1;\n  for (i = 1; i < m; i++, p++)\n    printf(\" %d\", *p);\n  p = b;\n  for (i = 0; i < n; i++, p++)\n    printf(\" %d\", *p);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bijiao(const void *x, const void *y) { return *(int *)x - *(int *)y; }\nint main() {\n  int n, m, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, n, sizeof(a[0]), bijiao);\n  qsort(b, m, sizeof(b[0]), bijiao);\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[m - 1]);\n}\n"}
{"label": "8", "index": "14228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, a[100], b[100];\n\nvoid sort(int c[], int s) {\n  int i, j, k;\n  for (i = 0; i < s - 1; i++)\n    for (j = 0; j < s - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = k;\n      }\n}\n\nvoid hebing(int d[], int e[], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d \", d[i]);\n  for (i = 0; i < y - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[y - 1]);\n}\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++)\n    cin >> b[j];\n  sort(a, n);\n  sort(b, m);\n  hebing(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14229", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[500], b[200], temp;\nvoid read(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid rank_1(void) {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid merge(void) {\n  for (int i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid show(void) {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n - 1];\n}\n\nint main(void) {\n  read();\n  rank_1();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *p, *q, *s;\nint m, n;\n\nint pfCompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &q[i]);\n}\n\nint downsort() {\n  qsort(p, m, sizeof(int), pfCompare);\n  qsort(q, n, sizeof(int), pfCompare);\n}\n\nint combine() {\n  s = (int *)malloc((m + n) * sizeof(int));\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = p[i];\n  for (i = m; i < m + n; i++)\n    s[i] = q[i - m];\n}\n\nint output() {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", s[i]);\n  free(p);\n  free(q);\n  free(s);\n}\n\nint main() {\n  input();\n  downsort();\n  combine();\n  output();\n}\n"}
{"label": "8", "index": "14231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint N1, N2, N3;\nint *p1 = (int *)malloc(100 * sizeof(int));\nint *p2 = (int *)malloc(100 * sizeof(int));\nint *p3 = (int *)malloc(100 * sizeof(int));\n\nvoid inputnumbers() {\n\n  scanf(\"%d %d\\n\", &N1, &N2);\n  scanf(\"%d\", p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    scanf(\" %d\", p1 + i);\n  }\n  scanf(\"\\n%d\", p2);\n  for (int i = 1; i <= N2 - 1; i++) {\n    scanf(\" %d\", p2 + i);\n  }\n}\n\nvoid seperatesort() {\n  for (int i = 1; i <= N1 - 1; i++) {\n    for (int j = i + 1; j <= N1; j++) {\n      if (*(p1 + i - 1) > *(p1 + j - 1)) {\n        int temp = *(p1 + i - 1);\n        *(p1 + i - 1) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= N2 - 1; i++) {\n    for (int j = i + 1; j <= N2; j++) {\n      if (*(p2 + i - 1) > *(p2 + j - 1)) {\n        int temp = *(p2 + i - 1);\n        *(p2 + i - 1) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  N3 = N1 + N2;\n  for (int i = 0; i <= N1 - 1; i++) {\n    *(p3 + i) = *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    *(p3 + N1 + i) = *(p2 + i);\n  }\n}\n\nvoid printresult2() {\n  printf(\"%d\", *p3);\n  for (int i = 1; i <= N3 - 1; i++) {\n    printf(\" %d\", *(p3 + i));\n  }\n}\nvoid printresult1() {\n  printf(\"%d\", *p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    printf(\" %d\", *(p1 + i));\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    printf(\" %d\", *(p2 + i));\n  }\n}\n\nint main() {\n  inputnumbers();\n  seperatesort();\n  combine();\n  printresult2();\n}\n"}
{"label": "8", "index": "14232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[400], b[200], n, m;\nvoid run1() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, x;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n}\nvoid run2() {\n  sort(a, n);\n  sort(b, m);\n}\nvoid run3() {\n  int i;\n  for (i = 1; i <= m; i++)\n    a[i + n] = b[i];\n}\nvoid run4() {\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n + m]);\n}\nint main() {\n  run1();\n  run2();\n  run3();\n  run4();\n}\n"}
{"label": "8", "index": "14233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint l1, l2, a1[50], a2[50], a3[100];\nvoid f1(int a1[], int a2[]) {\n  scanf(\"%d %d\", &l1, &l2);\n  int i;\n  for (i = 1; i <= l1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 1; i <= l2; i++) {\n    scanf(\"%d\", &a2[i]);\n  }\n}\nvoid f2(int l, int a[]) {\n  int i, j, t;\n  for (i = 1; i < l; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a1[], int a2[], int a3[]) {\n  int i;\n  for (i = 1; i <= l1; i++)\n    a3[i] = a1[i];\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a3[i] = a2[i - l1];\n}\nvoid f4(int a3[]) {\n  int i;\n  for (i = 1; i <= l1 + l2; i++) {\n    if (i != 1)\n      printf(\" \");\n    cout << a3[i];\n  }\n}\nint main() {\n  f1(a1, a2);\n  f2(l1, a1);\n  f2(l2, a2);\n  f3(a1, a2, a3);\n  f4(a3);\n  return 0;\n}\n"}
{"label": "8", "index": "14234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, i, j, a[1000], b[1000], c[2000], s, t;\nvoid one() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid two() {\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        s = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = s;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n}\nvoid three() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i - m < n; i++)\n    c[i] = b[i - m];\n}\nvoid four() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  one();\n  two();\n  three();\n  four();\n}\n"}
{"label": "8", "index": "14235", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, a, b;\n\nvoid shuru() {\n  int i;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < a; i++)\n    cin >> num1[i];\n  for (i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sequence() {\n  int i, j, temp;\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < a; j++)\n      if (num1[i] > num1[j]) {\n        temp = num1[i];\n        num1[i] = num1[j];\n        num1[j] = temp;\n      }\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < b; j++)\n      if (num2[i] > num2[j]) {\n        temp = num2[i];\n        num2[i] = num2[j];\n        num2[j] = temp;\n      }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a; i++)\n    cout << num1[i] << ' ';\n  for (i = 0; i < b - 1; i++)\n    cout << num2[i] << ' ';\n  printf(\"%d\\n\", num2[b - 1]);\n}\n\nint main() {\n  shuru();\n  sequence();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int m, n;\n  int temp;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        temp = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[233], b[233];\nint n, m, i, j, z;\nvoid shuru(int p) {\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    cin >> a[i];\n\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < m; i++)\n    scanf(\" %d\", &b[i]);\n}\nvoid paixu(int p) {\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n    }\n  }\n}\nvoid hebing(int p) {\n  for (i = n; i < m + n; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid shuchu(int p) {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  shuru(0);\n  paixu(0);\n  hebing(0);\n  shuchu(0);\n}\n"}
{"label": "8", "index": "14238", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid paixu(int *a, int x) {\n  int i = x - 1, t, j;\n  while (i >= 1) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n    i--;\n  }\n}\nvoid lianjie(int *a, int x, int *b, int y, int *c) {\n  int i = 0, j = 0, t = 1;\n  while (i < x) {\n    c[i] = a[i];\n    i++;\n  }\n  while (j < y) {\n    c[i] = b[j];\n    i++;\n    j++;\n  }\n  printf(\"%d\", c[0]);\n  while (t < x + y) {\n    printf(\" %d\", c[t]);\n    t++;\n  }\n}\nint main() {\n  int s, t, i;\n  scanf(\"%d %d\", &s, &t);\n  int *a = (int *)malloc(s * sizeof(int));\n  int *b = (int *)malloc(t * sizeof(int));\n  int *c = (int *)malloc((s + t) * sizeof(int));\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < t; i++)\n    cin >> b[i];\n  paixu(a, s);\n  paixu(b, t);\n  lianjie(a, s, b, t, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid com(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nint main() {\n  scanf(\"%d %d \", &n1, &n2);\n  in(n1, num1);\n  com(n1, num1);\n  in(n2, num2);\n  com(n2, num2);\n  for (int i = 0; i < n1; i++)\n    cout << num1[i] << \" \";\n  for (int j = 0; j < n2 - 1; j++)\n    cout << num2[j] << ' ';\n  cout << num2[n2 - 1] << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "14240", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint comp(const void *a, const void *b);\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  qsort(a, n, sizeof(int), comp);\n  qsort(b, m, sizeof(int), comp);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n"}
{"label": "8", "index": "14241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input(int *s, int n) {}\nint sort(int *s, int n) {}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  int *s = (int *)malloc((m + n) * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", a + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", b + i);\n  for (int i = 1; i < m; i++)\n    for (int j = 0; j < m - i; j++) {\n      if (*(a + j) > *(a + (j + 1))) {\n        int t;\n        t = *(a + j);\n        *(a + j) = *(a + (j + 1));\n        *(a + (j + 1)) = t;\n      }\n    }\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n - i; j++) {\n      if (*(b + j) > *(b + (j + 1))) {\n        int t;\n        t = *(b + j);\n        *(b + j) = *(b + (j + 1));\n        *(b + (j + 1)) = t;\n      }\n    }\n  for (int i = 0; i < m; i++)\n    s[i] = a[i];\n  for (int i = 0; i < n; i++)\n    s[m + i] = b[i];\n  for (int i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", s[i]);\n    else\n      printf(\" %d\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14242", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint first[100];\nint second[100];\nint combination[200];\nint a, b;\nvoid cin_number() {\n  int i;\n  cin >> a >> b;\n  for (i = 0; i < a; i++) {\n    cin >> first[i];\n  }\n  for (i = 0; i < b; i++) {\n    cin >> second[i];\n  }\n}\nvoid rank_1() {\n  int i, j, temp;\n  for (i = (a - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (first[j] > first[j + 1]) {\n        temp = first[j];\n        first[j] = first[j + 1];\n        first[j + 1] = temp;\n      }\n    }\n  }\n  for (i = (b - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (second[j] > second[j + 1]) {\n        temp = second[j];\n        second[j] = second[j + 1];\n        second[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < a; i++) {\n    combination[i] = first[i];\n  }\n  for (i = 0; i < b; i++) {\n    combination[a + i] = second[i];\n  }\n}\nvoid cout_combination() {\n  int i;\n  for (i = 0; i < (a + b - 1); i++)\n    cout << combination[i] << \" \";\n  printf(\"%d\\n\", combination[i]);\n}\nint main() {\n  cin_number();\n  rank_1();\n  combine();\n  cout_combination();\n  return 0;\n}\n"}
{"label": "8", "index": "14243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint getin(int array[], int num);\nint sort(int array[], int num);\nint link(int array1[], int array2[], int num1, int num2);\nint main() {\n  int numa, numb, a[1000], b[1000];\n  scanf(\"%d %d \", &numa, &numb);\n  getin(a, numa);\n  getin(b, numb);\n  sort(a, numa);\n  sort(b, numb);\n  link(a, b, numa, numb);\n  return 0;\n}\nint getin(int array[], int num) {\n  for (int i = 0; i < num; i++)\n    scanf(\"%d \", &array[i]);\n\n  return (array[num]);\n}\nint sort(int array[], int num) {\n  int temp;\n  for (int i = 0; i < num - 1; i++) {\n    for (int j = 0; j < num - i - 1; j++) {\n      if (array[j] > array[j + 1]) {\n        temp = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = temp;\n      }\n    }\n  }\n  return array[num];\n}\nint link(int array1[], int array2[], int num1, int num2) {\n  cout << array1[0];\n  for (int i = 1; i < num1; i++)\n    cout << \" \" << array1[i];\n  for (int i = 0; i < num2; i++)\n    cout << \" \" << array2[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *input(int n), *a, *b, *c, n1, n2;\n  void paixu(int *a, int n), display(int *c, int n);\n  int *hebing(int *a, int *b, int n1, int n2);\n  scanf(\"%d %d\", &n1, &n2);\n  a = input(n1);\n  b = input(n2);\n  printf(\"\\n\");\n  paixu(a, n1);\n  paixu(b, n2);\n  c = hebing(a, b, n1, n2);\n  display(c, n1 + n2);\n  return 0;\n}\n\nint *input(int n) {\n  int *p, i;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return (p);\n}\n\nvoid paixu(int *a, int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n  }\n}\n\nint *hebing(int *a, int *b, int n1, int n2) {\n  int *p, i, j;\n  p = (int *)malloc((n1 + n2) * sizeof(int));\n  for (i = 0; i < n1; i++)\n    p[i] = a[i];\n\n  for (j = 0; j < n2; j++) {\n    p[n1 + j] = b[j];\n  }\n  return (p);\n}\n\nvoid display(int *c, int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint read(int a[200], int b[100]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  a[0] = m;\n  b[0] = n;\n  for (i = 1; i <= m; i++)\n    scanf(\" %d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\" %d\", &b[i]);\n  return 0;\n}\nint seq(int a[200]) {\n  int i, j, t, m = a[0];\n  for (j = 1; j <= m - 1; j++)\n    for (i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  return 0;\n}\nint toge(int a[200], int b[100]) {\n  int i;\n  int m = a[0];\n  int n = b[0];\n  a[0] = a[0] + b[0];\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n  return 0;\n}\nint see(int a[200]) {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= a[0]; i++)\n    printf(\" %d\", a[i]);\n  return 0;\n}\nint main() {\n  int a[200], b[100];\n  read(a, b);\n  seq(a);\n  seq(b);\n  toge(a, b);\n  see(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid mysort(int *pn, int n) {\n  int i, j;\n  int temp;\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (pn[j] > pn[i]) {\n        temp = pn[j];\n        pn[j] = pn[i];\n        pn[i] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *pn, int n, int *pm, int m) {\n  int i;\n  printf(\"%d\", pn[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", pn[i]);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\" %d\", pm[i]);\n  }\n}\nint main(int argc, char *argv[]) {\n  int m, n, i, *pm, *pn;\n  scanf(\"%d%d\", &m, &n);\n  pm = (int *)calloc(m, sizeof(int));\n  pn = (int *)calloc(n, sizeof(int));\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &(pm[i]));\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(pn[i]));\n  }\n\n  mysort(pm, m);\n  mysort(pn, n);\n  merge(pm, m, pn, n);\n\n  free(pm);\n  free(pn);\n  return 0;\n}\n"}
{"label": "8", "index": "14247", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint la, lb;\nint a[100] = {0}, b[100] = {0};\nvoid get() {\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  int p = a[0];\n  for (i = 0; i < la - 1; i++)\n    for (j = 0; j <= la - i - 2; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  p = b[0];\n  for (i = 0; i < lb - 1; i++)\n    for (j = 0; j <= lb - i - 2; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid link() {\n  int i;\n  for (i = la; i <= la + lb - 1; i++)\n    a[i] = b[i - la];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < la + lb - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[la + lb - 1];\n}\nint main() {\n  scanf(\"%d %d \", &la, &lb);\n  get();\n  sort();\n  link();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid shuru(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid paixu(int b[], int m) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m], b[n];\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[100], int l1);\nvoid prin(int a[100], int l1, int b[100], int l2) {\n  int i;\n  char c = '\\0';\n  order(a, l1);\n  order(b, l2);\n  for (i = 0; i < l1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < l2; i++) {\n    if (i < l2 - 1)\n      c = ' ';\n    else\n      c = '\\n';\n    printf(\"%d%c\", b[i], c);\n  }\n}\nvoid order(int a[100], int l1) {\n  int i, j, b;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < l1; j++) {\n      if (a[j] < a[i]) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint main() {\n  int l1, l2, i;\n  int a[100], b[100];\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &b[i]);\n  prin(a, l1, b, l2);\n  return 0;\n}\n"}
{"label": "8", "index": "14250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f0(int a[], int x) {\n  int i = 0;\n  for (; i < x; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f1(int a[], int x) {\n  int i, j, s;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n}\nvoid f2(int a[], int b[], int c[], int m, int n) {\n  int i = 0;\n  while (i < m) {\n    c[i] = a[i];\n    i++;\n  }\n  while (i < m + n) {\n    c[i] = b[i - m];\n    i++;\n  }\n}\nint main() {\n  int a[50], b[50], c[100], m, n, i;\n  cin >> m >> n;\n  f0(a, m);\n  f0(b, n);\n  f1(a, m);\n  f1(b, n);\n  f2(a, b, c, m, n);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14251", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num[2];\nint a[100], b[100], c[100];\nvoid getarray(int a[], int b[], int num[]) {\n  cin >> num[0] >> num[1];\n  for (int i = 0; i < num[0]; i++)\n    cin >> a[i];\n  for (int i = 0; i < num[1]; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[], int af, int bf) {\n  int temp;\n  for (int i = 0; i < af - 1; i++) {\n    for (int j = 1; j < af - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < bf - 1; i++) {\n    for (int j = 1; j < bf - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[], int c[], int af, int bf) {\n  for (int i = 0; i < af; i++)\n    c[i] = a[i];\n  for (int i = af; i < af + bf; i++)\n    c[i] = b[i - af];\n}\nvoid print(int c[], int af, int bf) {\n  cout << c[0];\n  for (int i = 1; i < af + bf; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  getarray(a, b, num);\n  sort(a, b, num[0], num[1]);\n  combine(a, b, c, num[0], num[1]);\n  print(c, num[0], num[1]);\n}\n"}
{"label": "8", "index": "14252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int e);\nvoid f2(int b[], int f);\nvoid f3(int c[], int h, int d[], int l);\nint main() {\n  int shuzu1[200], shuzu2[200];\n  int geshu1, geshu2;\n  scanf(\"%d%d\", &geshu1, &geshu2);\n  f1(shuzu1, geshu1);\n  f1(shuzu2, geshu2);\n  f2(shuzu1, geshu1);\n  f2(shuzu2, geshu2);\n  f3(shuzu1, geshu1, shuzu2, geshu2);\n}\nvoid f1(int a[], int e) {\n  int i;\n  for (i = 0; i < e; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid f2(int b[], int f) {\n  int k, t, g;\n  for (k = 0; k < f - 1; k++) {\n    for (t = 0; t < f - 1; t++) {\n      if (b[t] > b[t + 1]) {\n        g = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = g;\n      }\n    }\n  }\n}\nvoid f3(int c[], int h, int d[], int l) {\n  int z;\n  for (z = 0; z < h; z++) {\n    printf(\"%d \", c[z]);\n  }\n  for (z = 0; z < l - 1; z++) {\n    printf(\"%d \", d[z]);\n  }\n  printf(\"%d\", d[l - 1]);\n}\n"}
{"label": "8", "index": "14253", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n1, n2, a1[200], a2[200], i, j, t;\nvoid toscan() {\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid paixu() {\n  for (i = 1; i < n1; i++) {\n    for (j = 0; j < i; j++)\n      if (a1[j] > a1[i]) {\n        t = a1[i];\n        a1[i] = a1[j];\n        a1[j] = t;\n      }\n  }\n  for (i = 1; i < n2; i++)\n    for (j = 0; j < i; j++)\n      if (a2[j] > a2[i]) {\n        t = a2[i];\n        a2[i] = a2[j];\n        a2[j] = t;\n      }\n}\n\nvoid hebing() {\n  for (i = 0; i < n2; i++)\n    a1[i + n1] = a2[i];\n}\n\nvoid toprint() {\n  printf(\"%d\", a1[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", a1[i]);\n}\n\nint main() {\n  toscan();\n  paixu();\n  hebing();\n  toprint();\n}\n"}
{"label": "8", "index": "14254", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[400], b[200], n, m;\nvoid run1() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int n) {\n  int i, j, x;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n}\nvoid run2() {\n  sort(a, n);\n  sort(b, m);\n}\nvoid run3() {\n  int i;\n  for (i = 1; i <= m; i++)\n    a[i + n] = b[i];\n}\nvoid run4() {\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n + m]);\n}\nint main() {\n  run1();\n  run2();\n  run3();\n  run4();\n}\n"}
{"label": "8", "index": "14255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, c[20], d[20], s[20], l, i, j;\nvoid shuru() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint shuchu(int s[]) {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[a + b - 1]);\n  return 0;\n}\nint paixu(int f[], int k) {\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (f[j] >= f[j + 1]) {\n        l = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = l;\n      }\n  return 0;\n}\nint hebing(int c[], int d[]) {\n  for (i = 0; i < a; i++)\n    s[i] = c[i];\n  for (i = a; i < b + a; i++)\n    s[i] = d[i - a];\n  return 0;\n}\nint main() {\n  shuru();\n  paixu(c, a);\n  paixu(d, b);\n  hebing(c, d);\n  shuchu(s);\n}\n"}
{"label": "8", "index": "14256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j;\nint a[10000];\nvoid input() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n + m; i++)\n    cin >> a[i];\n}\n\nvoid fsort() {\n  sort(a, a + n);\n  sort(a + n, a + n + m);\n}\nvoid print() {\n  cout << a[0];\n  for (i = 1; i < n + m; i++) {\n    cout << ' ' << a[i];\n  }\n}\nint main() {\n  input();\n  fsort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[101], b[101], m, n;\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n  return (0);\n}\nint pai() {\n  int i, j, p;\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n    }\n  }\n  return (0);\n}\nint print() {\n  int i;\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i < n; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n]);\n  return (0);\n}\nint main() {\n  input();\n  pai();\n  print();\n}\n"}
{"label": "8", "index": "14258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[10], b[10], c[20];\nvoid f() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid g() {\n  int i, j, k;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n}\nvoid u() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid v() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[i];\n}\nint main() {\n  f();\n  g();\n  u();\n  v();\n  return 0;\n}\n"}
{"label": "8", "index": "14259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ary1[30], ary2[30];\nint *pt1, *pt2;\n\nvoid input(int array[], int num) {\n  int i;\n  for (i = 0; i < num; i++)\n    cin >> array[i];\n}\nvoid sort(int *ptr, int num) {\n  int i, j;\n  int temp;\n  for (i = num - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(ptr + j) > *(ptr + j + 1)) {\n        swap(*(ptr + j), *(ptr + j + 1));\n      }\n    }\n  }\n}\nvoid combine(int *ptr1, int *ptr2, int num1, int num2) {\n  int i;\n  ptr1 += num1;\n  for (i = 0; i < num2; i++) {\n    *(ptr1 + i) = *(ptr2 + i);\n  }\n}\nvoid demo(int *pointer, int sum) {\n  int count = 0;\n  while (count != sum) {\n    cout << *pointer;\n    if (count++ != sum - 1) {\n      cout << \" \";\n    }\n    pointer++;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  pt1 = &ary1[0];\n  pt2 = &ary2[0];\n  int m, n;\n  cin >> m >> n;\n  input(ary1, m);\n  input(ary2, n);\n  sort(ary1, m);\n  sort(ary2, n);\n  combine(pt1, pt2, m, n);\n  demo(pt1, m + n);\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "8", "index": "14260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[200];\nint b[100];\nint *p1 = a, *p2 = b;\nint m, n;\nint *p2m = &m, *p2n = &n;\n\nvoid funcofa(int *p1, int *p2, int *p2m, int *p2n) {\n  scanf(\"%d%d\", p2m, p2n);\n  int i;\n  for (i = 1; i <= *p2m; i++) {\n    scanf(\"%d\", p1 + i - 1);\n  }\n  for (i = 1; i <= *p2n; i++) {\n    scanf(\"%d\", p2 + i - 1);\n  }\n}\n\nvoid funcofb(int *p1, int *p2, int *p2m, int *p2n) {\n  int i, j;\n  int temp;\n  for (i = 1; i <= *p2m; i++) {\n    for (j = 1; j < *p2m; j++) {\n      if (*(p1 + j - 1) > *(p1 + j)) {\n        temp = *(p1 + j);\n        *(p1 + j) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n  for (i = 1; i <= *p2n; i++) {\n    for (j = 1; j < *p2n; j++) {\n      if (*(p2 + j - 1) > *(p2 + j)) {\n        temp = *(p2 + j);\n        *(p2 + j) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n}\n\nvoid funcofc(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  for (i = 1; i <= *p2n; i++) {\n    *(p1 + (*p2m) + i - 1) = *(p2 + i - 1);\n  }\n}\n\nvoid funcofd(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  printf(\"%d\", *p1);\n  for (i = 2; i <= *p2m + *p2n; i++) {\n    cout << \" \" << *(p1 - 1 + i);\n  }\n  cout << \"\\n\";\n}\n\nint main() {\n  funcofa(p1, p2, p2m, p2n);\n  funcofb(p1, p2, p2m, p2n);\n  funcofc(p1, p2, p2m, p2n);\n  funcofd(p1, p2, p2m, p2n);\n  return 0;\n}\n"}
{"label": "8", "index": "14261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nvoid shuru(int x, int y, int a[], int b[]) {\n  scanf(\"%d %d \", &x, &y);\n  m = x;\n  n = y;\n  for (int i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int x[], int l) {\n  for (int i = 0; i < l - 1; i++) {\n    for (int j = 0; j < l - 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int p;\n        p = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\nvoid shuchu(int c[], int m, int n) {\n  for (int i = 0; i < n + m; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << \" \" << c[i];\n  }\n}\nint main() {\n  shuru(m, n, a, b);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m, n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[500] = {0}, b[500] = {0};\nvoid scanarray() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid shengxu(int x[], int len) {\n  int i, j, temp;\n  for (i = len - 1; i >= 0; i--) {\n    for (j = 0; j <= i - 1; j++) {\n      if (x[j] >= x[j + 1]) {\n        temp = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hebing(int x[], int y[], int lenx, int leny) {\n  int *p, *q;\n  for (p = x + lenx, q = y; q < y + leny; p++, q++) {\n    *p = *q;\n  }\n}\nvoid printarray(int x[], int len) {\n  int i;\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= len - 1; i++) {\n    printf(\" %d\", a[i]);\n  }\n  putchar('\\n');\n}\nint main() {\n  scanarray();\n  shengxu(a, m);\n  shengxu(b, n);\n  hebing(a, b, m, n);\n  printarray(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14263", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[102], b[102], c[202], m, n;\n\nvoid shuru() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid paixu() {\n  int i, j, t;\n\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (b[j] < b[j - 1]) {\n        int t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n}\nvoid hebing() {\n  int i = 0;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid xianshi() {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  xianshi();\n  return 0;\n}\n"}
{"label": "8", "index": "14264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[10000], b[10000];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  cin.get();\n  for (int i = 0; i <= m - 1; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = n - 1; j >= i + 1; j--) {\n      int l;\n      l = max(a[j], a[j - 1]);\n      a[j - 1] = min(a[j], a[j - 1]);\n      a[j] = l;\n    }\n  }\n  for (int i = 0; i <= m - 2; i++) {\n    for (int j = m - 1; j >= i + 1; j--) {\n      int l;\n      l = max(b[j], b[j - 1]);\n      b[j - 1] = min(b[j], b[j - 1]);\n      b[j] = l;\n    }\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  for (int i = 0; i <= m - 1; i++) {\n    if (i != m - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\n\nvoid read() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid sort_() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\n\nvoid stick() {\n  for (int i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    cout << a[i] << \" \";\n  cout << a[m + n];\n}\n\nint main() {\n  read();\n  sort_();\n  stick();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s1, s2;\nint reads() {\n  int a;\n  cin >> a;\n  return a;\n}\nvoid reada(int a[]) {\n  for (int i = 1; i <= s1; i++) {\n    cin >> a[i];\n  }\n}\nvoid readb(int b[]) {\n  for (int i = 1; i <= s2; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n}\nvoid reordera(int a[]) {\n  for (int i = 1; i <= s1 - 1; i++)\n    for (int j = 1; j <= s1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n}\nvoid reorderb(int b[]) {\n  for (int i = 1; i <= s2 - 1; i++)\n    for (int j = 1; j <= s2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\nvoid hebing(int a[], int b[], int c[]) {\n  for (int i = 1; i <= s1; i++)\n    c[i] = a[i];\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    c[i] = b[i - s1];\n}\nvoid output(int c[]) {\n  for (int i = 1; i <= s1 + s2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[s1 + s2];\n}\n\nint main() {\n  int a[500], b[500], c[1000];\n  s1 = reads();\n  s2 = reads();\n  reada(a);\n  readb(b);\n  reordera(a);\n  reorderb(b);\n  hebing(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14267", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint ary1[30], ary2[30];\nint *pt1, *pt2;\n\nvoid input(int array[], int num) {\n  int i;\n  for (i = 0; i < num; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n}\nvoid sort(int *ptr, int num) {\n  int i, j;\n  int temp;\n  for (i = num - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(ptr + j) > *(ptr + j + 1)) {\n        swap(*(ptr + j), *(ptr + j + 1));\n      }\n    }\n  }\n}\nvoid combine(int *ptr1, int *ptr2, int num1, int num2) {\n  int i;\n  ptr1 += num1;\n  for (i = 0; i < num2; i++) {\n    *(ptr1 + i) = *(ptr2 + i);\n  }\n}\nvoid demo(int *pointer, int sum) {\n  int count = 0;\n  while (count != sum) {\n    cout << *pointer;\n    if (count++ != sum - 1) {\n      cout << \" \";\n    }\n    pointer++;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  pt1 = &ary1[0];\n  pt2 = &ary2[0];\n  int m, n;\n  scanf(\"%d %d \", &m, &n);\n  input(ary1, m);\n  input(ary2, n);\n  sort(ary1, m);\n  sort(ary2, n);\n  combine(pt1, pt2, m, n);\n  demo(pt1, m + n);\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "8", "index": "14268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sca(int n, int l);\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  sca(n1, 1);\n  sca(n2, 2);\n  return 0;\n}\nvoid sca(int n, int l) {\n  int i, j, a[100] = {0}, p;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n    for (j = i; j > 0; j = j - 1) {\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i = i + 1)\n    printf(\"%d \", a[i]);\n  if (l == 1)\n    printf(\"%d \", a[n - 1]);\n  else\n    printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "14269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint str1[50] = {1}, str2[50] = {1};\nint length1, length2;\nvoid input_string(void) {\n  scanf(\"%d %d \", &length1, &length2);\n  for (int i = 0; i < length1; i++)\n    cin >> str1[i];\n  for (int i = 0; i < length2; i++)\n    cin >> str2[i];\n}\nvoid rank_string(void) {\n  int temp;\n  for (int i = 0; i < length1 - 1; i++)\n    for (int j = i + 1; j < length1; j++)\n      if (str1[i] > str1[j]) {\n        temp = str1[i];\n        str1[i] = str1[j];\n        str1[j] = temp;\n      }\n  for (int i = 0; i < length2 - 1; i++)\n    for (int j = i + 1; j < length2; j++)\n      if (str2[i] > str2[j]) {\n        temp = str2[i];\n        str2[i] = str2[j];\n        str2[j] = temp;\n      }\n}\nvoid combine_string(void) {\n  for (int i = length1; i < length1 + length2; i++)\n    str1[i] = str2[i - length1];\n}\nvoid output_string(void) {\n  cout << str1[0];\n  for (int i = 1; i < length1 + length2; i++)\n    cout << \" \" << str1[i];\n}\nint main() {\n  input_string();\n  rank_string();\n  combine_string();\n  output_string();\n  return 0;\n}\n"}
{"label": "8", "index": "14270", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid mode(int x, int y) {\n  int num1[100], num2[100], num3[200];\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    cin >> num1[i];\n  for (j = 0; j < x - 1; j++)\n    for (k = 0; k < x - 1 - j; k++)\n      if (num1[k] > num1[k + 1])\n        swap(num1[k], num1[k + 1]);\n  for (i = 0; i < y; i++)\n    cin >> num2[i];\n  for (j = 0; j < y - 1; j++)\n    for (k = 0; k < y - 1 - j; k++)\n      if (num2[k] > num2[k + 1])\n        swap(num2[k], num2[k + 1]);\n  for (i = 0; i < x; i++)\n    num3[i] = num1[i];\n  for (i = x; i < (x + y); i++) {\n    num3[i] = num2[i - x];\n  }\n  for (i = 0; i < x + y - 1; i++)\n    cout << num3[i] << \" \";\n  printf(\"%d\", num3[x + y - 1]);\n}\nint main() {\n  int x, y;\n  scanf(\"%d %d \", &x, &y);\n  mode(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nvoid getarr(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sortarr(void) {\n  int i, j, p;\n  for (i = 1; i < m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid combarr(void) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid printarr(void) {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[i]);\n}\nint main() {\n  getarr();\n  sortarr();\n  combarr();\n  printarr();\n  return 0;\n}\n"}
{"label": "8", "index": "14272", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nvoid shuru(int x, int y, int a[], int b[]) {\n  cin >> x >> y;\n  m = x;\n  n = y;\n  for (int i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int x[], int l) {\n  for (int i = 0; i < l - 1; i++) {\n    for (int j = 0; j < l - 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int p;\n        p = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  for (int i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\nvoid shuchu(int c[], int m, int n) {\n  for (int i = 0; i < n + m; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  shuru(m, n, a, b);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m, n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000];\nint b[1000];\nint m, n;\nvoid init() {\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid s() {\n  sort(a, a + m + 1);\n  sort(b, b + n + 1);\n}\nvoid merge() {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[i + m] = b[i];\n}\nvoid print() {\n  int i;\n  for (i = 1; i <= m + n; i++) {\n    cout << a[i];\n    if (i < m + n)\n      cout << ' ';\n  }\n  printf(\"\\n\");\n}\nint main() {\n  init();\n  s();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int zhengshuchuan[], int changdu) {\n  int i, j, t;\n  for (i = 0; i < changdu; i++) {\n    for (j = i; j < changdu; j++) {\n      if (zhengshuchuan[i] > zhengshuchuan[j]) {\n        t = zhengshuchuan[i];\n        zhengshuchuan[i] = zhengshuchuan[j];\n        zhengshuchuan[j] = t;\n      }\n    }\n  }\n  return 0;\n}\nint main() {\n  int a[200], b[100], i;\n  int changdu1, changdu2;\n  scanf(\"%d %d\", &changdu1, &changdu2);\n  for (i = 0; i < changdu1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < changdu2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, changdu1);\n  f(b, changdu2);\n  for (i = 0; i < changdu2; i++) {\n    a[changdu1 + i] = b[i];\n  }\n\n  for (i = 0; i < changdu1 + changdu2; i++) {\n    if (i == 0)\n      cout << a[0];\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14275", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, a[100], b[100], i, q, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        q = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = q;\n      }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        q = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = q;\n      }\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid s(int m);\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  s(a);\n  printf(\" \");\n  s(b);\n  return 0;\n}\nvoid s(int m) {\n  int i, j, c[1000], d;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        d = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid get_array(int a[]);\nint a[101];\nint main() {\n  get_array(a);\n  return 0;\n}\nvoid get_array(int a[]) {\n\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  for (int i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n1; i++) {\n    cout << \" \" << a[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < n2; i++) {\n    cout << \" \" << a[i];\n  }\n  return;\n}\n"}
{"label": "8", "index": "14278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint shuzu1[100], shuzu2[100];\nint n1, n2;\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> shuzu1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &shuzu2[i]);\n}\nvoid paixu(int shuzu[], int n) {\n  int min, i, j, temp;\n  for (i = 0; i < n; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[j] < shuzu[min])\n        min = j;\n    }\n    temp = shuzu[i];\n    shuzu[i] = shuzu[min];\n    shuzu[min] = temp;\n  }\n}\nvoid hebing(int shuzu1[], int shuzu2[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", shuzu1[i]);\n  for (i = 0; i < n2 - 1; i++)\n    printf(\"%d \", shuzu2[i]);\n  printf(\"%d\", shuzu2[i]);\n}\nint main() {\n  scan();\n  paixu(shuzu1, n1);\n  paixu(shuzu2, n2);\n  hebing(shuzu1, shuzu2, n1, n2);\n}\n"}
{"label": "8", "index": "14279", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], n, m, i, j, t;\nvoid shuru(int p, int q) {\n  for (i = 0; i < p; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < q; i++)\n    cin >> b[i];\n}\nvoid shuchu(int p, int q) {\n  for (i = 0; i < p; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < q - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[q - 1]);\n}\nvoid paixu(int p, int c[]) {\n  for (i = 0; i < p; i++)\n    for (j = 0; j < i; j++)\n      if (c[i] < c[j]) {\n        t = c[i];\n        c[i] = c[j];\n        c[j] = t;\n      }\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  shuru(n, m);\n  paixu(n, a);\n  paixu(m, b);\n  shuchu(n, m);\n}\n"}
{"label": "8", "index": "14280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num[2];\nint a[100], b[100], c[100];\nvoid getarray(int a[], int b[], int num[]) {\n  cin >> num[0] >> num[1];\n  for (int i = 0; i < num[0]; i++)\n    cin >> a[i];\n  for (int i = 0; i < num[1]; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[], int af, int bf) {\n  int temp;\n  for (int i = 0; i < af - 1; i++) {\n    for (int j = 1; j < af - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < bf - 1; i++) {\n    for (int j = 1; j < bf - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[], int c[], int af, int bf) {\n  for (int i = 0; i < af; i++) {\n    c[i] = a[i];\n  }\n  for (int i = af; i < af + bf; i++)\n    c[i] = b[i - af];\n}\nvoid print(int c[], int af, int bf) {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i < af + bf; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  getarray(a, b, num);\n  sort(a, b, num[0], num[1]);\n  combine(a, b, c, num[0], num[1]);\n  print(c, num[0], num[1]);\n}\n"}
{"label": "8", "index": "14281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[200];\n\nint main() {\n  void to(int a[], int b[], int n, int m);\n  void hebing(int a[], int b[], int n, int m);\n  void print(int c[], int n, int m);\n  int n, m, a[100], b[100], i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  to(a, b, n, m);\n  hebing(a, b, n, m);\n  print(c, n, m);\n  return 0;\n}\n\nvoid to(int a[], int b[], int n, int m) {\n  int t, u, s, f, e, p;\n  for (t = 0; t < n - 1; t++) {\n    for (u = t + 1; u < n; u++) {\n      if (a[t] > a[u]) {\n        s = a[t];\n        a[t] = a[u];\n        a[u] = s;\n      }\n    }\n  }\n  for (f = 0; f < m - 1; f++) {\n    for (e = f + 1; e < m; e++) {\n      if (b[f] > b[e]) {\n        p = b[f];\n        b[f] = b[e];\n        b[e] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < m; i++) {\n    c[n + i] = b[i];\n  }\n}\nvoid print(int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\\n\", c[n + m - 1]);\n}\n"}
{"label": "8", "index": "14282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid sort(int x[]) {\n  int i, j, t;\n  for (i = 1; i <= x[0]; i++)\n    for (j = 1; j <= x[0] - i; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\nvoid deal(void) {\n  int a[100] = {0};\n  int b[100] = {0};\n  int n, m, i;\n  cin >> n >> m;\n  a[0] = n;\n  b[0] = m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &b[i]);\n  sort(a);\n  sort(b);\n  cout << a[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  deal();\n  return 0;\n}\n"}
{"label": "8", "index": "14283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  static int a[100], b[100];\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        a[j] = a[j] + a[i];\n        a[i] = a[j] - a[i];\n        a[j] = a[j] - a[i];\n      }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        b[j] = b[j] + b[i];\n        b[i] = b[j] - b[i];\n        b[j] = b[j] - b[i];\n      }\n  }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[m + n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, a[100], b[100], temp = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14285", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint m, n;\nint i, j, t;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[j] < a[i]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] < b[i]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid cat() {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid print() {\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  read();\n  sort();\n  cat();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B;\nint *a, *b;\nint c[500];\nvoid putin() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  a = (int *)malloc(A * sizeof(int));\n  b = (int *)malloc(B * sizeof(int));\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid replace() {\n  int i, j, z;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = A; i < A + B; i++)\n    c[i] = b[i - A];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < A + B; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  putin();\n  replace();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14287", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a, b;\nvoid shuru();\nvoid paixu1();\nvoid paixu2();\nint main() {\n  shuru();\n  paixu1();\n  paixu2();\n\n  return 0;\n}\nvoid shuru() { cin >> a >> b; }\nvoid paixu1() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n}\nvoid paixu2() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < b; i++)\n    cin >> c[i];\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[b - 1];\n}\n"}
{"label": "8", "index": "14288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint lena = 0;\nint lenb = 0;\nvoid Input() {\n  cin >> lena >> lenb;\n  for (int i = 0; i < lena; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < lenb; i++) {\n    cin >> b[i];\n  }\n}\nvoid Sort() {\n  for (int i = 1; i <= lena - 1; i++) {\n    for (int j = 0; j <= lena - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= lenb - 1; i++) {\n    for (int j = 0; j <= lenb - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid Catenate() {\n  for (int i = 0; i <= lenb - 1; i++) {\n    a[lena + i] = b[i];\n  }\n}\nvoid Output() {\n  cout << a[0];\n  for (int i = 1; i <= lena + lenb - 1; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  Input();\n  Sort();\n  Catenate();\n  Output();\n  return 0;\n}\n"}
{"label": "8", "index": "14289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid change(int a[], int b[], int c[]) {\n  int x = 0, y = 0;\n  cin >> x >> y;\n  int i = 0;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  int j = 0, t = 0;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[x + y - 1]);\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0};\n  change(a, b, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n}\nvoid f2(int n, int a[]) {\n  int i, j, k;\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[j];\n        a[j] = a[i];\n        a[i] = k;\n      }\n    }\n}\nvoid f3(int n, int m, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(int n, int m, int c[]) {\n  printf(\"%d\", c[0]);\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  int n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  f1(n, a);\n  f1(m, b);\n  f2(n, a);\n  f2(m, b);\n  f3(n, m, a, b, c);\n  f4(n, m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int c[100];\n  int d[100];\n  int i, t, r;\n  i = 0;\n  do {\n    scanf(\"%d\", &c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    cin >> d[i];\n    i++;\n  } while (i < b);\n  t = 0;\n  do {\n    i = 0;\n    while (i < a - 1 - t) {\n      if (c[i] > c[i + 1]) {\n        r = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < a - 1);\n  t = 0;\n  do {\n    i = 0;\n    while (i < b - 1 - t) {\n      if (d[i] > d[i + 1]) {\n        r = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < b - 1);\n  printf(\"%d\", c[0]);\n  i = 1;\n  do {\n    cout << \" \" << c[i];\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    printf(\" %d\", d[i]);\n    i++;\n  } while (i < b);\n  return 0;\n}\n"}
{"label": "8", "index": "14292", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid get(int m, int n);\nvoid swap(int m, int n);\nvoid put(int m, int n);\nint a[1001], b[1001];\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  get(m, n);\n  swap(m, n);\n  put(m, n);\n}\nvoid get(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid swap(int m, int n) {\n  int j, k, c;\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (a[k] > a[k + 1]) {\n        c = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = c;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++) {\n      if (b[k] > b[k + 1]) {\n        c = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = c;\n      }\n    }\n}\nvoid put(int m, int n) {\n  int l;\n  for (l = 0; l < m; l++)\n    printf(\"%d \", a[l]);\n  for (l = 0; l < n; l++) {\n    if (l == n - 1)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n}\n"}
{"label": "8", "index": "14293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int n1, n2;\n  int *a1, *a2;\n  int i1, i2, i3, i4;\n  scanf(\"%d %d\", &n1, &n2);\n  a1 = (int *)malloc(sizeof(int) * n1);\n  a2 = (int *)malloc(sizeof(int) * n2);\n  for (i1 = 0; i1 < n1; i1++) {\n    scanf(\"%d\", a1 + i1);\n  }\n  for (i2 = 0; i2 < n2; i2++) {\n    scanf(\"%d\", a2 + i2);\n  }\n  qsort(a1, n1, sizeof(int), Compare);\n  qsort(a2, n2, sizeof(int), Compare);\n  for (i3 = 0; i3 < n1; i3++) {\n    printf(\"%d \", a1[i3]);\n  }\n  for (i4 = 0; i4 < n2 - 1; i4++) {\n    printf(\"%d \", a2[i4]);\n  }\n  printf(\"%d\", a2[n2 - 1]);\n}\n"}
{"label": "8", "index": "14294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  int a[m], b[n];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid maopao(int m, int n, int a[200], int b[100]) {\n  int tempt, i, j;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        tempt = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = tempt;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        tempt = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = tempt;\n      }\n    }\n  }\n}\nvoid jieshang(int m, int n, int a[200], int b[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(int m, int n, int a[200]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[m + n - 1]);\n}\nint main() {\n  int m, n, i, a[200], b[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  maopao(m, n, a, b);\n  jieshang(m, n, a, b);\n  shuchu(m, n, a);\n}\n"}
{"label": "8", "index": "14296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint i, j, k, l, m, b[20], c[20];\nvoid f() { cin >> l >> k; }\nvoid g(int d[20], int s) {\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid h(int a[20], int n, int p) {\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  if (p == 1)\n    printf(\"%d \", a[n - 1]);\n  if (p == 2)\n    cout << a[n - 1] << \"\\n\";\n}\nint main() {\n  f();\n  g(b, l);\n  g(c, k);\n  h(b, l, 1);\n  h(c, k, 2);\n  return 0;\n}\n"}
{"label": "8", "index": "14297", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m;\n  cin >> n >> m;\n  int a[10000], b[10000];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  cin.get();\n  for (int i = 0; i <= m - 1; i++) {\n    cin >> b[i];\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = n - 1; j >= i + 1; j--) {\n      int l;\n      l = max(a[j], a[j - 1]);\n      a[j - 1] = min(a[j], a[j - 1]);\n      a[j] = l;\n    }\n  }\n  for (int i = 0; i <= m - 2; i++) {\n    for (int j = m - 1; j >= i + 1; j--) {\n      int l;\n      l = max(b[j], b[j - 1]);\n      b[j - 1] = min(b[j], b[j - 1]);\n      b[j] = l;\n    }\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  for (int i = 0; i <= m - 1; i++) {\n    if (i != m - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], anum, bnum;\nvoid scan() {\n  int i;\n  cin >> anum >> bnum;\n  for (i = 0; i < anum; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < bnum; i++)\n    scanf(\"%d\", b + i);\n}\nvoid mysort() {\n  int temp, i, j;\n  for (i = 0; i < anum - 1; i++)\n    for (j = 1; j < anum - i; j++)\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n  for (i = 0; i < bnum - 1; i++)\n    for (j = 1; j < bnum - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\nvoid print() {\n  int i;\n  for (i = 0; i < anum; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < bnum; i++)\n    printf(\"%d%c\", b[i], i == bnum - 1 ? '\\n' : ' ');\n}\nint main() {\n  scan();\n  mysort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14299", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100];\nvoid ranking(int n, int m) {\n  int i, j, p;\n  for (i = n; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = n; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  ranking(0, n);\n  ranking(n, n + m);\n  cout << a[0];\n  for (i = 1; i < m + n; i++) {\n    cout << \" \" << a[i];\n  }\n}\n"}
{"label": "8", "index": "14300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstatic int a[100], b[100], c[300];\nchar z;\nvoid scan() {\n  static int m, n, i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= 99; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &a[i], &z);\n  }\n  z = 1;\n  for (i = 0; z != '\\n'; i++) {\n    cin >> b[i] >> z;\n  }\n}\nvoid ord() {\n  int i, j, temp;\n  for (i = 0; a[i] != '\\0'; i++) {\n    for (j = i + 1; a[j] != '\\0'; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    for (j = i + 1; b[j] != '\\0'; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid bin() {\n  static int i, j;\n  for (i = 0; i <= 299; i++) {\n\n    c[i] = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c[i] = a[i];\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    c[j + i] = b[j];\n  }\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; c[i] != 0; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\n\nint main() {\n  scan();\n  ord();\n  bin();\n  print();\n}\n"}
{"label": "8", "index": "14301", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m = 0, n = 0;\nint a[100], b[100], c[200];\nvoid read(void) {\n  int i = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort(void) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid combine(void) {\n  int i = 0;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\nvoid output(void) {\n  int i = 0;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  read();\n  sort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14302", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int m, int n) {\n  int i, j, t, a[100], b[100], c = 0;\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    cin >> b[i];\n  for (j = 0; j <= m - 2; j++)\n    for (i = 0; i <= m - 2 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j <= n - 2; j++)\n    for (i = 0; i <= n - 2 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i <= m - 1; i++, c++) {\n    if (c)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\" %d\", b[i]);\n  printf(\"\\n\");\n  return (0);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  f(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14303", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0, a[100] = {0}, b[100] = {0};\nvoid got() {\n  cin >> m >> n;\n  int i = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f(int a[], int b[]) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid plus(int a[], int b[]) {\n  for (int i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid shu(int a[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i == m + n - 1)\n      cout << a[i];\n    else\n      cout << a[i] << \" \";\n  }\n}\nint main() {\n  got();\n  f(a, b);\n  for (int i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < n; i++) {\n    if (i != n - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "14304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000];\nvoid qsort(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = a[(i + j) / 2];\n  while (i <= j) {\n    while (a[i] < x)\n      i++;\n    while (x < a[j])\n      j--;\n    if (i <= j) {\n      k = a[i];\n      a[i] = a[j];\n      a[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort(i, r);\n  if (l < j)\n    qsort(l, j);\n}\n\nvoid qsort2(int l, int r) {\n  int i, j, k, x;\n  i = l;\n  j = r;\n  k = 0;\n  x = (i + j) / 2;\n  while (i < j) {\n    while (b[i] < b[x])\n      i++;\n    while (b[x] < b[j])\n      j--;\n    if (i <= j) {\n      k = b[i];\n      b[i] = b[j];\n      b[j] = k;\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    qsort2(i, r);\n  if (l < j)\n    qsort2(l, j);\n}\n\nvoid input() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 1; i <= n; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i < m; i++)\n    cout << b[i] << \" \";\n  cout << b[m] << endl;\n}\n\nint main() {\n  input();\n  qsort(1, n);\n  qsort2(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, a[100], b[100], temp = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, s1[1000], s2[1000], s[1000];\nvoid f1(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid f2(void) {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (s1[j] > s1[j + 1]) {\n        temp = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (s2[j] > s2[j + 1]) {\n        temp = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = s1[i];\n  for (i = m; i < m + n; i++)\n    s[i] = s2[i - m];\n}\nvoid f4(void) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", s[i]);\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint m, n;\nvoid shuru(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\nvoid hebing(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(void) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  shuru();\n  paixu(a, b);\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14308", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[2][100];\nvoid order(int x, int y) {\n  int i, j, t;\n  for (i = 0; i < y; i++)\n    cin >> a[x][i];\n  for (i = 0; i < y - 1; i++)\n    for (j = 0; j < y - 1 - i; j++)\n      if (a[x][j] > a[x][j + 1]) {\n        t = a[x][j];\n        a[x][j] = a[x][j + 1];\n        a[x][j + 1] = t;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n; i++)\n    cout << a[0][i] << \" \";\n  for (i = 0; i < m - 1; i++)\n    cout << a[1][i] << \" \";\n  printf(\"%d\", a[1][m - 1]);\n}\nint main() {\n  cin >> n >> m;\n  order(0, n), order(1, m);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s1[100], s2[100];\n  int m, n, i, t, j;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j + 1];\n        s1[j + 1] = s1[j];\n        s1[j] = t;\n      }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j + 1];\n        s2[j + 1] = s2[j];\n        ;\n        s2[j] = t;\n      }\n  }\n\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", s2[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint num1[100], num2[100], num3[1000];\nvoid read() {\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 1; i <= n; i++)\n    cin >> num1[i];\n\n  for (int i = 1; i <= m; i++)\n    cin >> num2[i];\n}\n\nvoid sort(int num1[], int num2[]) {\n  for (int i = 1; i <= n - 1; i++) {\n    for (int j = 1; j <= n - i; j++) {\n      if (num1[j] > num1[j + 1])\n        swap(num1[j], num1[j + 1]);\n    }\n  }\n  for (int i = 1; i <= m - 1; i++) {\n    for (int j = 1; j <= m - i; j++) {\n      if (num2[j] > num2[j + 1])\n        swap(num2[j], num2[j + 1]);\n    }\n  }\n}\nvoid hebing(int num1[], int num2[], int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i <= n)\n      num3[i] = num1[i];\n    else\n      num3[i] = num2[i - n];\n  }\n}\nvoid display(int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i == 1)\n      cout << num3[i];\n    else\n      cout << \" \" << num3[i];\n  }\n}\n\nint main() {\n  read();\n  sort(num1, num2);\n  hebing(num1, num2, num3);\n  display(num3);\n  return 0;\n}\n"}
{"label": "8", "index": "14311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, s1[1000], s2[1000], s[1000];\nvoid f1(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> s1[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid f2(void) {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (s1[j] > s1[j + 1]) {\n        temp = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (s2[j] > s2[j + 1]) {\n        temp = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = s1[i];\n  for (i = m; i < m + n; i++)\n    s[i] = s2[i - m];\n}\nvoid f4(void) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << s[i];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14312", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid bubble(int a[], int l) {\n  int i, j, temp;\n  for (j = 1; j < l; j++) {\n    for (i = 0; i < l - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, i, j, a[10000], b[10000];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  bubble(a, m);\n  bubble(b, n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%d\", b[j]);\n    if (j < n - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "14313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[100], a2[100];\nint main() {\n  void scan(), rank(), combine(), print();\n  scan();\n  rank();\n  combine();\n  print();\n}\n\nvoid scan() {\n  int i;\n  scanf(\"%d %d\\n\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid rank() {\n  int i, j, mid;\n  for (j = 0; j < n1 - 1; j++)\n    for (i = 0; i < n1 - 1 - j; i++)\n      if (a1[i] > a1[i + 1]) {\n        mid = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = mid;\n      }\n  for (j = 0; j < n2 - 1; j++)\n    for (i = 0; i < n2 - 1 - j; i++)\n      if (a2[i] > a2[i + 1]) {\n        mid = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = mid;\n      }\n}\n\nvoid combine() {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    a1[i] = a2[i - n1];\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%d\", a1[i]);\n  }\n}\n"}
{"label": "8", "index": "14314", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n\n  int a[1000], b[1000];\n  int m, n, i, t, j;\n  scanf(\"%d %d\", &m, &n);\n  \n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14315", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint A, B, a[40], b[40];\n\nvoid enter() {\n  int i;\n  scanf(\"%d %d\", &A, &B);\n  scanf(\"%d\", &a[1]);\n  for (i = 2; i <= A; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &b[1]);\n  for (i = 2; i <= B; i++)\n    scanf(\" %d\", &b[i]);\n}\n\nvoid array_1() {\n  int i, j, m;\n  for (i = 1; i <= A - 1; i++)\n    for (j = 1; j <= A - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 1; i <= B - 1; i++)\n    for (j = 1; j <= B - i; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\n\nvoid connect() {\n  int i, j;\n  for (i = A + 1, j = 1; i <= A + B; i++, j++)\n    a[i] = b[j];\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= A + B; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  enter();\n  array_1();\n  connect();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14316", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nint order(int str[], int po, int start) {\n  for (int i = 1; i < po; i++) {\n    for (int j = 1; j <= po - i; j++) {\n      if (str[j] > str[j + 1])\n        swap(str[j], str[j + 1]);\n    }\n  }\n  for (int i = start; i < po + start; i++) {\n    c[i] = str[i - start + 1];\n  }\n  return 0;\n}\nint output() {\n  order(a, m, 1);\n  order(b, n, m + 1);\n  for (int i = 1; i < m + n; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n];\n  return 0;\n}\nint main() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n  }\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, num1[10001], num2[10001];\n\nvoid init() {\n  int i;\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\n\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = 0; j < n1 - i - 1; j++)\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = 0; j < n2 - i - 1; j++)\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n}\n\nvoid merge() {\n  int i, j;\n  for (i = n1, j = 0; j < n2; i++, j++)\n    num1[i] = num2[j];\n  n1 += n2;\n}\n\nvoid show() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < n1; i++)\n    cout << ' ' << num1[i];\n  cout << \"\\n\";\n}\n\nint main() {\n  init();\n  sort();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j + 1] < a[j]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (b[j + 1] < b[j]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int m, int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid f4(int a[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[m + n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[1000];\n  int b[1000];\n\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, m, n);\n  f4(a, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct HaHa {\n  int x, y, z[2][1000], g[2000];\n};\nstruct HaHa scan() {\n  struct HaHa hehe;\n  int i, j;\n  scanf(\"%d%d\", &hehe.x, &hehe.y);\n  for (i = 0; i < hehe.x; i++)\n    scanf(\"%d\", &hehe.z[0][i]);\n  for (j = 0; j < hehe.y; j++)\n    scanf(\"%d\", &hehe.z[1][j]);\n  return (hehe);\n}\nstruct HaHa line(struct HaHa yahoo) {\n  int i, temp, j;\n  struct HaHa yahoo1;\n  for (i = 0; i < yahoo.x; i++) {\n    for (j = i; j < yahoo.x; j++) {\n      if (yahoo.z[0][i] > yahoo.z[0][j]) {\n        temp = yahoo.z[0][i];\n        yahoo.z[0][i] = yahoo.z[0][j];\n        yahoo.z[0][j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < yahoo.y; i++) {\n    for (j = i; j < yahoo.y; j++) {\n      if (yahoo.z[1][i] > yahoo.z[1][j]) {\n        temp = yahoo.z[1][i];\n        yahoo.z[1][i] = yahoo.z[1][j];\n        yahoo.z[1][j] = temp;\n      }\n    }\n  }\n  yahoo1 = yahoo;\n  return (yahoo1);\n}\nstruct HaHa combine(struct HaHa xx) {\n  int i;\n  struct HaHa xx1;\n  for (i = 0; i < xx.x; i++) {\n    xx.g[i] = xx.z[0][i];\n  }\n  for (i = 0; i < xx.y; i++) {\n    xx.g[i + xx.x] = xx.z[1][i];\n  }\n  xx1 = xx;\n  return (xx1);\n}\nvoid print(struct HaHa xxx) {\n  int i;\n  for (i = 0; i < xxx.x + xxx.y - 1; i++) {\n    printf(\"%d \", xxx.g[i]);\n  }\n  printf(\"%d\", xxx.g[xxx.x + xxx.y - 1]);\n}\nint main() { print(combine(line(scan()))); }\n"}
{"label": "8", "index": "14320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint j, k;\nvoid G(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < j; n++) {\n    for (m = n + 1; m < j; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid g(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < k; n++) {\n    for (m = n + 1; m < k; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid F(int a[], int b[]) {\n  G(a);\n  g(b);\n  int n, m;\n  printf(\"%d\", a[0]);\n  for (n = 1; n < j; n++)\n    printf(\" %d\", a[n]);\n  for (m = 0; m < k; m++)\n    cout << \" \" << b[m];\n}\nint main() {\n  int n, m;\n  int a[5000], b[5000];\n  scanf(\"%d %d\", &j, &k);\n  for (n = 0; n < j; n++)\n    scanf(\"%d\", &a[n]);\n  for (m = 0; m < k; m++)\n    scanf(\"%d\", &b[m]);\n  F(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14321", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], la, b[100], lb, c[200], lc;\n\nvoid R() {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return;\n}\n\nvoid S(int *x, int lx) {\n  int i, j;\n  for (i = 1; i < lx; i++) {\n    for (j = 1; j <= lx - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  }\n  return;\n}\n\nvoid M() {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = la + 1; i <= la + lb; i++)\n    c[i] = b[i - la];\n  return;\n}\n\nvoid D() {\n  int i;\n  for (i = 1; i <= la + lb; i++) {\n    if (i > 1)\n      cout << \" \";\n    printf(\"%d\", c[i]);\n  }\n  cout << endl;\n  return;\n}\n\nint main() {\n  R();\n  S(a, la);\n  S(b, lb);\n  M();\n  D();\n  return 0;\n}\n"}
{"label": "8", "index": "14322", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid maopao(int m, int n, int a[200], int b[100]) {\n  int tempt, i, j;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        tempt = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = tempt;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        tempt = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = tempt;\n      }\n    }\n  }\n}\nvoid jieshang(int m, int n, int a[200], int b[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid shuchu(int m, int n, int a[200]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[m + n - 1]);\n}\nint main() {\n  int m, n, i, a[200], b[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  maopao(m, n, a, b);\n  jieshang(m, n, a, b);\n  shuchu(m, n, a);\n}\n"}
{"label": "8", "index": "14323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint A, B, a[300], b[300], c[600];\nvoid w() {\n  int i;\n  scanf(\"%d%d\", &A, &B);\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid x() {\n  int i, j, t;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid y() {\n  int i;\n  for (i = 0; i < A + B; i++)\n    if (i < A)\n      c[i] = a[i];\n    else\n      c[i] = b[i - A];\n}\nvoid z() {\n  int i;\n  for (i = 0; i < A + B - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[A + B - 1]);\n}\nint main() {\n  w();\n  x();\n  y();\n  z();\n  return 0;\n}\n"}
{"label": "8", "index": "14324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint duru(int a[], int l) {\n  int i, j;\n  for (i = 1; i <= l; i++) {\n    cin >> a[i];\n  }\n  return 1;\n}\nint paixu(int a[], int l) {\n  int i, j, p;\n  for (i = 1; i <= l - 1; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  return 1;\n}\nint hebing(int a[], int b[], int l1, int l2) {\n  int i;\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n  return l1 + l2;\n}\nint xianshi(int a[], int l) {\n  for (int i = 1; i < l; i++)\n    cout << a[i] << \" \";\n  cout << a[l] << endl;\n  return 1;\n}\nint main() {\n  int a[100], b[100], l1, l2;\n  cin >> l1 >> l2;\n  duru(a, l1);\n  duru(b, l2);\n  paixu(a, l1);\n  paixu(b, l2);\n  l1 = hebing(a, b, l1, l2);\n  xianshi(a, l1);\n  return 0;\n}\n"}
{"label": "8", "index": "14325", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint na, nb;\nint a[10000], b[10000], c[10000];\nvoid f1() {\n  scanf(\"%d %d \", &na, &nb);\n  for (int i = 0; i <= na - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i <= nb - 1; i++)\n    cin >> b[i];\n}\nvoid f2() {\n  sort(a, a + na);\n  sort(b, b + nb);\n}\nvoid f3() {\n  for (int i = 0; i <= na - 1; i++)\n    c[i] = a[i];\n  for (int i = na; i <= na + nb - 1; i++)\n    c[i] = b[i - na];\n}\nvoid f4() {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i <= na + nb - 1; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, i, j, t, c[20], d[20], e[40];\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\n\nvoid order() {\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++)\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n}\n\nvoid combine() {\n  for (i = 0; i < a; i++)\n    e[i] = c[i];\n  for (i = 0; i < b; i++)\n    e[a + i] = d[i];\n}\n\nvoid out() {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[a + b - 1]);\n}\n\nint main() {\n  in();\n  order();\n  combine();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, c;\n  int a[60] = {0}, b[30] = {0};\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (a[i] < a[j]) {\n        c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] < b[j]) {\n        c = b[i];\n        b[i] = b[j];\n        b[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid change(int *a, int n) {\n  int t, i, j;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] < a[j]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n}\nvoid input(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid output(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cout << a[i] << \" \";\n}\nint main() {\n  int n, m, a[100], b[100];\n  cin >> n >> m;\n  input(a, n);\n  input(b, m);\n  change(a, n);\n  change(b, m);\n  output(a, n);\n  output(b, m - 1);\n  cout << b[m - 1];\n}\n"}
{"label": "8", "index": "14329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint j, k;\nvoid G(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < j; n++) {\n    for (m = n + 1; m < j; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid g(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < k; n++) {\n    for (m = n + 1; m < k; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid F(int a[], int b[]) {\n  G(a);\n  g(b);\n  int n, m;\n  printf(\"%d\", a[0]);\n  for (n = 1; n < j; n++)\n    printf(\" %d\", a[n]);\n  for (m = 0; m < k; m++)\n    printf(\" %d\", b[m]);\n}\nint main() {\n  int n, m;\n  int a[5000], b[5000];\n  scanf(\"%d %d\", &j, &k);\n  for (n = 0; n < j; n++)\n    scanf(\"%d\", &a[n]);\n  for (m = 0; m < k; m++)\n    scanf(\"%d\", &b[m]);\n  F(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, a[1000], b, k = 0, tmp, j;\n  cin >> n >> m;\n  for (i = 1; i <= n + m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n + 1; i++)\n    for (j = 1; j <= n - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= m + 1; i++)\n    for (j = n + 1; j <= n + m - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "8", "index": "14331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint str1[100], str2[100], str[200];\nint m, n;\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &str1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &str2[i]);\n  }\n}\nvoid f2(int s[100], int k) {\n  int i, j, t;\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1; i++) {\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int s1[100], int s2[100], int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    s[i] = s1[i];\n  }\n  for (i = 0; i < n; i++) {\n    s[i + m] = s2[i];\n  }\n}\nvoid f4(int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", s[i]);\n    if (i < m + n - 1)\n      printf(\" \");\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  f1();\n  f2(str1, m);\n  f2(str2, n);\n  f3(str1, str2, str, m, n);\n  f4(str, m, n);\n}\n"}
{"label": "8", "index": "14332", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m;\nint a[100], b[100], c[100];\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid zuhe() {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n; i < n + m; i++) {\n    c[i] = b[i - n];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < n + m; i++) {\n    if (i != n + m - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  shuru();\n  paixu();\n  zuhe();\n  shuchu();\n}\n"}
{"label": "8", "index": "14333", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000], num2[1000], a, b;\n\nvoid cin_array(int num1[], int num2[]) {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++)\n    cin >> num1[i];\n  for (int i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sort(int num1[], int num2[]) {\n  int temp;\n  for (int i = 1; i <= a; i++)\n    for (int j = 0; j < a - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 1; i <= b; i++)\n    for (int j = 0; j < b - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\n\nvoid connect(int num1[], int num2[]) {\n  for (int i = 0; i < b; i++)\n    num1[a + i] = num2[i];\n}\n\nvoid cout_array(int num[]) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[a + b - 1];\n}\n\nint main() {\n  cin_array(num1, num2);\n  sort(num1, num2);\n  connect(num1, num2);\n  cout_array(num1);\n  return 0;\n}\n"}
{"label": "8", "index": "14335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n  pai(a, m);\n  pai(b, n);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint i, j, k;\nint q[10000], p[10000];\n\nvoid a() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> q[i];\n  }\n}\nvoid b(int x[], int y[]) {\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n\n      if (x[j] > x[j + 1]) {\n        k = x[j + 1];\n        x[j + 1] = x[j];\n        x[j] = k;\n      }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n\n      if (y[j] > y[j + 1]) {\n        k = y[j + 1];\n        y[j + 1] = y[j];\n        y[j] = k;\n      }\n  }\n  for (i = 0; i < m; i++) {\n    cout << x[i] << ' ';\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << y[i] << ' ';\n  }\n  printf(\"%d\\n\", y[n - 1]);\n}\n\nint main() {\n  a();\n  b(p, q);\n  return (0);\n}\n"}
{"label": "8", "index": "14337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid input(int *M, int *N, int a[], int b[]) {\n  scanf(\"%d %d\", M, N);\n  int i;\n  for (i = 0; i < *M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < *N; i++)\n    scanf(\"%d\", &b[i]);\n\n  return;\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid merge(int M, int N, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = 0; i < N; i++)\n    c[i + M] = b[i];\n}\n\nvoid output(int M, int N, int c[]) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[M + N - 1]);\n}\n\nint main() {\n  int M, N, a[100000], b[100000];\n  input(&M, &N, a, b);\n  sort(a, M);\n  sort(b, N);\n\n  int c[100000];\n  merge(M, N, a, b, c);\n  output(M, N, c);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14338", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  long i, j, n, m, x, p = 0;\n  int a[100001] = {0};\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    a[x]++;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      if (p == 0) {\n        printf(\"%d\", i);\n        p = 1;\n      } else\n        printf(\" %d\", i);\n    a[i] = 0;\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &x);\n    a[x] = 1;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      printf(\" %d\", i);\n    a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  int i, j;\n  int s1[1000], s2[1000];\n  for (i = 1; i <= a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d\", &s2[i]);\n  for (i = 1; i <= a - 1; i++)\n    for (j = 1; j <= a - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        int t;\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n  for (i = 1; i <= b - 1; i++)\n    for (j = 1; j <= b - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        int t;\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n  for (i = 1; i <= a; i++)\n    printf(\"%d \", s1[i]);\n  for (i = 1; i <= b - 1; i++)\n    printf(\"%d \", s2[i]);\n  printf(\"%d\", s2[b]);\n}\n"}
{"label": "8", "index": "14340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid change(int *a, int n) {\n  int t, i, j;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] < a[j]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n}\nvoid input(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid output(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n}\nint main() {\n  int n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  input(a, n);\n  input(b, m);\n  change(a, n);\n  change(b, m);\n  output(a, n);\n  output(b, m - 1);\n  printf(\"%d\", b[m - 1]);\n}\n"}
{"label": "8", "index": "14341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, i = 0;\nint a[1000], b[1000];\nvoid duru1() {\n  cin >> m;\n  cin >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n} \nvoid shuchu() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n} \nint main() {\n  duru1();\n  paixu(a, m);\n  paixu(b, n);\n  shuchu();\n  return 0; \n}\n"}
{"label": "8", "index": "14342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s1[100], s2[100], i, j, a, b, t, s;\nvoid in(void); \nvoid order(void);\nvoid stick(void);\nvoid out(void);\n\nint main() {\n  in();\n  order();\n  stick();\n  out();\n}\n\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid order() {\n\n  for (i = 1; i < a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < b; i++) {\n    for (j = 0; j < b - i; j++) {\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid stick() {\n\n  s = a + b;\n  for (i = a; i < s; i++) {\n    s1[i] = s2[i - a];\n  }\n}\nvoid out() {\n\n  for (i = 0; i < a + b; i++) {\n    if (i == 0)\n      printf(\"%d\", s1[i]);\n    else\n      printf(\" %d\", s1[i]);\n  }\n}\n"}
{"label": "8", "index": "14343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100];\nint num1;\nint num2;\nint main() {\n  void read();\n  void queue();\n  void combine();\n  void put();\n  read();\n  queue();\n  combine();\n  put();\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &num1, &num2);\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid queue() {\n  int i, j, t;\n  for (i = 0; i < num1 - 1; i++) {\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) \n      {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < num2 - 1; i++) {\n    for (j = 0; j < num2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) \n      {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    c[i + num1] = b[i];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < num1 + num2 - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[num1 + num2 - 1]);\n}\n"}
{"label": "8", "index": "14344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[50];\nint b[50];\nint c[100];\nint m = 0, n = 0, temp;\nvoid IN();\nvoid OR();\nvoid LIAN();\nvoid OU();\nint main() {\n  IN();\n  OR();\n  LIAN();\n  OU();\n}\n\nvoid IN() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid OR() {\n  int i, j;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid LIAN() {\n  int i;\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n}\n\nvoid OU() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n - 1];\n}\n"}
{"label": "8", "index": "14345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint key, j, k, i, t;\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  int *p1 = (int *)malloc((n + 1) * sizeof(int));\n  int *p2 = (int *)malloc((m + 1) * sizeof(int));\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", (p1 + i));\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", (p2 + i));\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (*(p1 + i) > *(p1 + j)) {\n        t = *(p1 + i), *(p1 + i) = *(p1 + j), *(p1 + j) = t;\n      }\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    for (j = i + 1; j <= m; j++) {\n      if (*(p2 + i) > *(p2 + j)) {\n        t = *(p2 + i), *(p2 + i) = *(p2 + j), *(p2 + j) = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 1; i <= m; i++) {\n    if (i == m)\n      printf(\"%d\", *(p2 + i));\n    else\n      printf(\"%d \", *(p2 + i));\n  }\n}\n"}
{"label": "8", "index": "14346", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[5000], b[5000], N1, N2, c[10000];\nint f1() {\n  int n;\n  scanf(\"%d%d\", &N1, &N2);\n  for (n = 0; n <= N1 - 1; n++) {\n    scanf(\"%d\", &a[n]);\n  }\n  for (n = 0; n <= N2 - 1; n++) {\n    scanf(\"%d\", &b[n]);\n  }\n  return 0;\n}\nint f2() {\n  int i, j, t;\n  for (i = 1; i <= N1 - 1; i++) {\n    for (j = 0; j <= N1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= N2 - 1; i++) {\n    for (j = 0; j <= N2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint f3() {\n  int i, j;\n  for (i = 0; i <= N1 - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = N1, j = 0; i <= N1 + N2 - 1; i++, j++) {\n    c[i] = b[j];\n  }\n  return 0;\n}\nint f4() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= N1 + N2 - 1; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14347", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, m, a[1000], b[100];\n\nvoid scan(int *p1, int l1, int *p2, int l2) {\n  int i;\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++) {\n    scanf(\"%d\", &p1[i]);\n  }\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &p2[i]);\n}\n\nvoid paixu(int *p, int l) {\n  int t, i, j;\n  for (i = 1; i < l; i++)\n    for (j = 0; j < l - i; j++)\n      if (p[j] > p[j + 1]) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n}\n\nvoid hebing(int *p1, int l1, int *p2, int l2) {\n  int i;\n  for (i = l1; i < l1 + l2; i++)\n    p1[i] = p2[i - l1];\n}\n\nvoid print(int *p, int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    printf(\"%d%c\", p[i], (i == l - 1) ? '\\n' : ' ');\n}\n\nint main() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, n);\n  paixu(b, m);\n  hebing(a, n, b, m);\n  print(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid shuru(int a[], int b[]);\nvoid paixu(int a[]);\nvoid hebing(int a[], int b[]);\nvoid shuchu(int a[]);\nint main() {\n  int a[100] = {0}, b[100] = {0};\n  shuru(a, b);\n  paixu(a);\n  paixu(b);\n  hebing(a, b);\n  shuchu(a);\n}\n\nvoid shuru(int a[], int b[]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[]) {\n  int i, j, temp, len = 0;\n  for (i = 0; a[i] != 0; i++)\n    len++;\n  for (j = 1; j < len; j++) {\n    for (i = 0; i < len - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid hebing(int a[], int b[]) {\n  int i, lena = 0, lenb = 0;\n  for (i = 0; a[i] != 0; i++)\n    lena++;\n  for (i = 0; b[i] != 0; i++)\n    lenb++;\n  for (i = 0; i < lenb; i++)\n    a[i + lena] = b[i];\n}\n\nvoid shuchu(int a[]) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != 0; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "14349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *num(int a) {\n  int *p, i;\n  p = (int *)malloc(a * sizeof(int));\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return p;\n}\n\nvoid rank_1(int *p, int a) {\n  int i, j, t;\n  for (i = a - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) \n      {\n        t = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = t;\n      }\n    }\n  }\n}\n\nint *add(int *p1, int *p2, int a, int b) {\n  int i;\n  int *p3 = (int *)malloc((a + b) * sizeof(int));\n  for (i = 0; i < a; i++)\n    *(p3 + i) = *(p1 + i);\n  for (i = 0; i < b; i++)\n    *(p3 + a + i) = *(p2 + i);\n  return p3;\n}\n\nvoid print(int *p3, int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", p3[0]);\n    else\n      printf(\" %d\", p3[i]);\n  }\n}\n\nint main() {\n  int a, b, *p1, *p2, *p3;\n  scanf(\"%d\", &a);\n  scanf(\"%d\", &b);\n  p1 = num(a);\n  p2 = num(b);\n  rank_1(p1, a);\n  rank_1(p2, b);\n  p3 = add(p1, p2, a, b);\n  print(p3, (a + b));\n  free(p1);\n  free(p2);\n  free(p3);\n}\n"}
{"label": "8", "index": "14350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid output(int c[], int m, int n) {\n  int i;\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", c[i]);\n}\nvoid combine(int a[], int b[], int m, int n) {\n  int c[100];\n  int i, j = 1;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n\n  for (i = m + 1; i <= n + m; i++, j++) {\n    c[i] = b[j];\n  }\n  output(c, m, n);\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j, temp;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  combine(a, b, m, n);\n}\nvoid input(void) {\n  int i, a[100], b[100], m, n;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n  order(a, b, m, n);\n}\nint main() {\n  input();\n  return 0;\n}\n"}
{"label": "8", "index": "14351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N1[100], N2[100], N[200], n1, n2;\n  void scan(int N1[], int N2[], int *p1, int *p2);\n  void order(int N1[], int n1, int N2[], int n2);\n  void join(int N1[], int N2[], int N[], int n1, int n2);\n  void print(int N[], int n);\n  scan(N1, N2, &n1, &n2);\n  order(N1, n1, N2, n2);\n  join(N1, N2, N, n1, n2);\n  print(N, n1 + n2);\n  return 0;\n}\nvoid scan(int N1[], int N2[], int *p1, int *p2) {\n  int i;\n  scanf(\"%d%d\", p1, p2);\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", &N1[i]);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", &N2[i]);\n}\nvoid order(int N1[], int n1, int N2[], int n2) {\n  int i, j, imin, Nmin, Nm;\n  for (i = 0; i < n1; i++) {\n    imin = i;\n    Nmin = N1[i];\n    for (j = i; j < n1; j++) {\n      if (N1[j] < Nmin) {\n        imin = j;\n        Nmin = N1[j];\n      }\n    }\n    Nm = N1[i];\n    N1[i] = N1[imin];\n    N1[imin] = Nm;\n  }\n  for (i = 0; i < n2; i++) {\n    imin = i;\n    Nmin = N2[i];\n    for (j = i; j < n2; j++) {\n      if (N2[j] < Nmin) {\n        imin = j;\n        Nmin = N2[j];\n      }\n    }\n    Nm = N2[i];\n    N2[i] = N2[imin];\n    N2[imin] = Nm;\n  }\n}\nvoid join(int N1[], int N2[], int N[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    N[i] = N1[i];\n  for (i = n1; i < n1 + n2; i++)\n    N[i] = N2[i - n1];\n}\nvoid print(int N[], int n) {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n}\n"}
{"label": "8", "index": "14352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[200], i, j, m, n;\nvoid read(void) {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return;\n}\nvoid place(void) {\n  int s;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  return;\n}\nvoid together(void) {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return;\n}\nvoid put(void) {\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      cout << c[i];\n    } else {\n      printf(\" %d\", c[i]);\n    }\n  }\n  return;\n}\n\nint main() {\n  read();\n  place();\n  together();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, x[100], y[100], z[100];\nint main() {\n  void read();\n  void orde(int c[100], int d[100]);\n  void resm(int e[100], int f[100]);\n  void show(int g[100]);\n  read();\n  orde(x, y);\n  resm(x, y);\n  show(x);\n  return 0;\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid orde(int c[100], int d[100]) {\n  int i, j, q;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j + 1] < c[j]) {\n        q = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = q;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    x[i] = c[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (d[j + 1] < d[j]) {\n        q = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    y[i] = d[i];\n}\nvoid resm(int e[100], int f[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    e[i + m] = f[i];\n  for (i = 0; i < 100; i++)\n    x[i] = e[i];\n}\nvoid show(int g[100]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\\n\", x[m + n - 1]);\n}\n"}
{"label": "8", "index": "14354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1];\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][2];\nint n[2], i, j, k, t;\nint order(int j) {\n  for (i = 1; i < n[j]; i++)\n    for (k = i + 1; k <= n[j]; k++) {\n      if (a[i][j] > a[k][j]) {\n        a[i][j] = a[i][j] ^ a[k][j];\n        a[k][j] = a[i][j] ^ a[k][j];\n        a[i][j] = a[i][j] ^ a[k][j];\n      }\n    }\n}\nint main() {\n  cin >> n[0] >> n[1];\n  for (i = 1; i <= n[0]; i++)\n    cin >> a[i][0];\n  for (i = 1; i <= n[1]; i++)\n    cin >> a[i][1];\n  order(0);\n  order(1);\n  for (i = 1; i <= n[0]; i++)\n    printf(\"%d \", a[i][0]);\n  for (i = 1; i < n[1]; i++)\n    cout << a[i][1] << ' ';\n  printf(\"%d\\n\", a[n[1]][1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  static int a[100], b[100];\n  scanf(\"%d %d \", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < m - 1; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        a[j] = a[j] + a[i];\n        a[i] = a[j] - a[i];\n        a[j] = a[j] - a[i];\n      }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        b[j] = b[j] + b[i];\n        b[i] = b[j] - b[i];\n        b[j] = b[j] - b[i];\n      }\n  }\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n}\n"}
{"label": "8", "index": "14357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[100], b[100];\nvoid scanf() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  for (i = 1; i < n; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n}\nvoid merge() {\n  int i;\n  for (i = n + 1; i <= n + m; i++)\n    a[i] = b[i - n];\n}\nvoid print() {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= n + m; i++)\n    cout << ' ' << a[i];\n  cout << endl;\n}\nint main() {\n  scanf();\n  sort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int a[], int b[], int c, int d) {\n  int i, j, t;\n  for (i = 0; i < c; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < c; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < d; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  int a[15], b[15], c, d, i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < d; i++)\n    cin >> b[i];\n  f1(a, b, c, d);\n  return 0;\n}\n"}
{"label": "8", "index": "14359", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input(int num[], int a[]) {\n  int j;\n  cin >> num[0] >> num[1];\n  for (j = 0; j < num[0] + num[1]; j++)\n    cin >> a[j];\n}\nvoid order(int num[], int a[]) {\n  int j, k, temp;\n  for (j = 0; j < num[0]; j++) {\n    for (k = num[0] - 1; k > 0; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n  for (j = num[0]; j < num[0] + num[1]; j++) {\n    for (k = num[0] + num[1] - 1; k > num[0]; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int num[], int a[]) {\n  int i;\n  for (i = 0; i < num[0] + num[1] - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[num[0] + num[1] - 1]);\n}\nint main() {\n  int a[40], num[2];\n  input(num, a);\n  order(num, a);\n  print(num, a);\n}\n"}
{"label": "8", "index": "14360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int a[100], b[100];\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000], b[1000], al, bl;\n\nvoid input() {\n  int i;\n  cin >> al >> bl;\n  for (i = 0; i < al; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bl; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Qsort(int start, int length, int a[]) {\n  int x = a[start];\n  int i, j;\n  i = start;\n  j = length - 1;\n  while (i < j) {\n    if (x < a[j])\n      j--;\n    else if (x > a[j]) {\n      a[i] = a[j];\n      a[j] = x;\n      i++;\n    } else if (x < a[i]) {\n      a[j] = a[i];\n      a[i] = x;\n      j--;\n    } else\n      i++;\n  }\n  if (start < length - 1) {\n    Qsort(start, i, a);\n    Qsort(i + 1, length, a);\n  }\n}\n\nvoid sort() {\n  Qsort(0, al, a);\n  Qsort(0, bl, b);\n}\n\nvoid combine() {\n  int i;\n  for (i = 0; i < bl; i++)\n    a[i + al] = b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < bl + al - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[i]);\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  output();\n}\n"}
{"label": "8", "index": "14362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shit(int, int);\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  shit(m, n);\n  return 0;\n}\nvoid shit(int m, int n) {\n  int i, j;\n  int temp;\n  int a[20];\n  int b[20];\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  temp = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, a, b;\n\nvoid shuru() {\n  int i;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < a; i++)\n    scanf(\"%d \", &num1[i]);\n  for (i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sequence() {\n  int i, j, temp;\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < a; j++)\n      if (num1[i] > num1[j]) {\n        temp = num1[i];\n        num1[i] = num1[j];\n        num1[j] = temp;\n      }\n  for (i = 0; i < a; i++)\n    for (j = i + 1; j < b; j++) {\n      if (num2[i] > num2[j]) {\n        temp = num2[i];\n        num2[i] = num2[j];\n        num2[j] = temp;\n      }\n    }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a; i++)\n    cout << num1[i] << ' ';\n  for (i = 0; i < b - 1; i++)\n    printf(\"%d \", num2[i]);\n  cout << num2[b - 1] << endl;\n}\n\nint main() {\n  shuru();\n  sequence();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000], y[1000], z[2000];\nint i, j, n, m, ex;\nvoid read() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> x[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &y[i]);\n}\nvoid paixu() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1; j++)\n      if (x[j + 1] < x[j]) {\n        ex = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = ex;\n      }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - 1; j++)\n      if (y[j] > y[j + 1]) {\n        ex = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = ex;\n      }\n}\nvoid heping() {\n  for (i = 0; i < n; i++)\n    z[i] = x[i];\n  for (i = 0; i < m; i++)\n    z[n + i] = y[i];\n}\nvoid display() {\n  for (i = 0; i < n + m; i++) {\n    if (i == 0)\n      cout << z[i];\n    else\n      cout << \" \" << z[i];\n  }\n}\nint main() {\n  read();\n  paixu();\n  heping();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "14365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid read(int s[], int n);\nvoid arrange(int s[], int n);\nvoid connect(int array1[], int array2[], int p1, int p2);\nvoid print(int array[], int num);\nint main() {\n  int s1[100], s2[100];\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  read(s1, n1);\n  read(s2, n2);\n  arrange(s1, n1);\n  arrange(s2, n2);\n  connect(s1, s2, n1, n2);\n  print(s1, n1 + n2);\n  return 0;\n}\nvoid read(int s[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid arrange(int s[], int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        t = s[j + 1];\n        s[j + 1] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid connect(int array1[], int array2[], int p1, int p2) {\n  int i;\n\n  for (i = p1; i < p1 + p2; i++)\n    array1[i] = array2[i - p1];\n}\n\nvoid print(int array[], int num) {\n  int i;\n  printf(\"%d\", array[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %d\", array[i]);\n  }\n}\n"}
{"label": "8", "index": "14366", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint i, j, n1, n2, a1[100], a2[100];\nvoid scan() {\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (j = 0; j < n2; j++)\n    cin >> a2[j];\n}\nvoid adjust() {\n  int p;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (a1[i] > a1[j]) {\n        p = a1[i];\n        a1[i] = a1[j];\n        a1[j] = p;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (a2[i] > a2[j]) {\n        p = a2[i];\n        a2[i] = a2[j];\n        a2[j] = p;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (i = n1; i < n1 + n2; i++) {\n    a1[i] = a2[i - n1];\n  }\n}\nvoid print() {\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a1[i] << \" \";\n  cout << a1[n1 + n2 - 1] << endl;\n}\nint main() {\n  scan();\n  adjust();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1;\nint n2;\nint i;\nint a[100] = {0};\nint b[100] = {0};\nint c[200] = {0};\nvoid scanfing() {\n  scanf(\"%d %d\", &n1, &n2);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n1; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < n2; i++)\n    scanf(\" %d\", &b[i]);\n}\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1 - *(int *)elem2);\n}\nvoid qsorting() {\n  qsort(a, n1, sizeof(int), compare);\n  qsort(b, n2, sizeof(int), compare);\n}\nvoid together() {\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = 0; i < n2; i++)\n    c[i + n1] = b[i];\n}\nvoid printfing() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  scanfing();\n  qsorting();\n  together();\n  printfing();\n}\n"}
{"label": "8", "index": "14368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, i = 0;\nint a[1000], b[1000];\nvoid duru1() {\n  cin >> m;\n  cin >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nvoid shuchu() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n}\nint main() {\n  duru1();\n  paixu(a, m);\n  paixu(b, n);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint comp(const void *a, const void *b);\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, n, sizeof(int), comp);\n  qsort(b, m, sizeof(int), comp);\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n"}
{"label": "8", "index": "14370", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid paixu() {\n  int a[100], b[100], sizea, sizeb, i, j, t;\n  scanf(\"%d %d \", &sizea, &sizeb);\n  for (i = 1; i <= sizea; i++)\n    cin >> a[i];\n  for (i = 1; i <= sizeb; i++)\n    cin >> b[i];\n  for (i = sizea; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = sizeb; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= sizea; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= sizeb; i++) {\n    cout << b[i];\n    if (i < sizeb)\n      cout << \" \";\n    else\n      cout << endl;\n  }\n}\nint main() {\n  paixu();\n  return 0;\n}\n"}
{"label": "8", "index": "14371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid a(void) {\n  int A[100], B[100], C[200], i, j, k, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &B[i]);\n\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (A[j] > A[j + 1]) {\n        k = A[j + 1];\n        A[j + 1] = A[j];\n        A[j] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (B[j] > B[j + 1]) {\n        k = B[j + 1];\n        B[j + 1] = B[j];\n        B[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    C[i] = A[i];\n  }\n  for (i = 0; i < n; i++) {\n    C[m + i] = B[i];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      cout << C[i];\n    } else {\n      cout << \" \" << C[i];\n    }\n  }\n}\nint main() { a(); }\n"}
{"label": "8", "index": "14372", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int m, int n) {\n  int i, j, t, a[100], b[100], c = 0;\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    cin >> b[i];\n  for (j = 0; j <= m - 2; j++)\n    for (i = 0; i <= m - 2 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j <= n - 2; j++)\n    for (i = 0; i <= n - 2 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i <= m - 1; i++, c++) {\n    if (c)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\" %d\", b[i]);\n  printf(\"\\n\");\n  return (0);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  f(m, n);\n}\n"}
{"label": "8", "index": "14373", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid scan_(int m, int *a, int n, int *b);\nvoid sort_(int m, int *a, int n, int *b);\nvoid print_(int m, int *a, int n, int *b);\n\nint main() {\n  int m, n, *a, *b;\n  scanf(\"%d %d \", &m, &n);\n  a = (int *)malloc(m * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  scan_(m, a, n, b);\n  sort_(m, a, n, b);\n  print_(m, a, n, b);\n  return 0;\n}\n\nvoid scan_(int m, int *a, int n, int *b) {\n  int i, j, *p;\n\n  p = a;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", p++);\n  p = b;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", p++);\n  }\n}\n\nvoid sort_(int m, int *a, int n, int *b) {\n  int i, j, t, *q;\n  for (i = 0; i < m - 1; i++) {\n    q = a;\n    for (j = 0; j < m - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    q = b;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n}\n\nvoid print_(int m, int *a, int n, int *b) {\n  int i, *p;\n  printf(\"%d\", *a);\n  p = a + 1;\n  for (i = 1; i < m; i++, p++)\n    printf(\" %d\", *p);\n  p = b;\n  for (i = 0; i < n; i++, p++)\n    printf(\" %d\", *p);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14374", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000];\nint b[10000];\nint n, m;\nvoid du() {\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid ran() {\n  for (int i = 0; i < n; i++) {\n    int temp = a[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] <= temp) {\n        a[j + 1] = temp;\n        break;\n      } else {\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < m; i++) {\n    int temp = b[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (b[j] <= temp) {\n        b[j + 1] = temp;\n        break;\n      } else {\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid he() {\n  for (int i = n; i < n + m; i++)\n    a[i] = b[i - n];\n}\nvoid shu() {\n  for (int i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n + m - 1];\n}\nint main() {\n  du();\n  ran();\n  he();\n  shu();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14375", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], n, m;\nvoid duru() {\n  int i, j;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < m; j++)\n    scanf(\"%d \", &b[j]);\n}\nvoid sort() {\n  int t1, t2, i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t1 = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t1;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t2 = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t2;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n + m - 1] << endl;\n}\nint main() {\n  duru();\n  sort();\n  hebing();\n  put();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14376", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int M, N;\n  scanf(\"%d%d\", &M, &N);\n  int a[100], b[100];\n  int i;\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  qsort(a, M, sizeof(int), Compare);\n  for (i = 0; i < M; i++) {\n    printf(\"\");\n  }\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(b, N, sizeof(int), Compare);\n  for (i = 0; i < N; i++) {\n    printf(\"\");\n  }\n  int c[200];\n  for (i = 0; i < M; i++) {\n    c[i] = a[i];\n  }\n  int j;\n  for (j = 0; j < N; j++, i++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < M + N - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[i]);\n}\n"}
{"label": "8", "index": "14377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int N, M, i;\n  scanf(\"%d%d\", &N, &M);\n  int a[N], b[M];\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < M; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, N, sizeof(int), compare);\n  for (i = 0; i < N - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[i]);\n  qsort(b, M, sizeof(int), compare);\n  for (i = 0; i < M - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14378", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[500], b[500], numbera, numberb, i, j, p;\nvoid input();\nvoid order();\nvoid stract();\nvoid output();\nint main() {\n  input();\n  order();\n  stract();\n  output();\n  return 0;\n}\nvoid input() {\n  cin >> numbera >> numberb;\n  for (i = 0; i < numbera; i++)\n    cin >> a[i];\n  for (i = 0; i < numberb; i++)\n    cin >> b[i];\n}\nvoid order() {\n  for (i = 0; i < numbera - 1; i++) {\n    for (j = numbera - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n  }\n  for (i = 0; i < numberb - 1; i++)\n    for (j = numberb - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        p = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = p;\n      }\n}\nvoid stract() {\n  for (i = numbera; i < numbera + numberb; i++)\n    a[i] = b[i - numbera];\n}\nvoid output() {\n  cout << a[0];\n  for (i = 1; i < numbera + numberb; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "8", "index": "14379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid rank_1(int n, int c) {\n  int num[10], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      int a;\n      if (num[j] > num[j + 1]) {\n        a = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", num[i]);\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  if (c != 2) {\n    printf(\" \");\n  }\n}\nvoid count() {\n  int b[2], i;\n  scanf(\"%d %d\", &b[0], &b[1]);\n  for (i = 1; i <= 2; i++) {\n    rank_1(b[i - 1], i);\n  }\n}\nint main() {\n  void rank_1(int n, int c);\n  void count();\n  count();\n  return 0;\n}\n"}
{"label": "8", "index": "14380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int au(int x, int y);\n  int x, y;\n  scanf(\"%d%d\", &x, &y);\n  au(x, y);\n  return 0;\n}\nint au(int x, int y) {\n  int a[100], b[100], i, j, m, n;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 0; i < x; i++) {\n    for (m = 0; m < x - i - 1; m++) {\n      if (a[m] > a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < y; j++) {\n    for (n = 0; n < y - j - 1; n++) {\n      if (b[n] > b[n + 1]) {\n        int t = b[n];\n        b[n] = b[n + 1];\n        b[n + 1] = t;\n      }\n    }\n  }\n  for (m = x; m < x + y; m++)\n    a[m] = b[m - x];\n\n  for (m = 0; m < x + y - 1; m++)\n    printf(\"%d \", a[m]);\n\n  printf(\"%d\", a[x + y - 1]);\n}\n"}
{"label": "8", "index": "14381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int m, n;\nint a[1000], b[1000], c[2000];\nvoid f1(int a[], int b[], int h, int k) {\n  int i;\n  scanf(\"%d%d\", &h, &k);\n  m = h;\n  n = k;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  return;\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j, k;\n  for (j = m - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid f4(int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, c, m, n);\n  f4(c, m, n);\n}\n"}
{"label": "8", "index": "14382", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int temp, i, j;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int x, y, i;\n  int b[100], c[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  turn(b, x);\n  printf(\" \");\n  turn(c, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint input() {\n  int i;\n  scanf(\"%d\", &i);\n  return (i);\n}\nvoid shit(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n}\nvoid damn(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = n; j >= i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << a[i];\n    if (i != n)\n      printf(\" \");\n  }\n}\nint main() {\n  int m = input(), n = input();\n  int a[1000], b[1000];\n  shit(a, m);\n  damn(b, n);\n}\n"}
{"label": "8", "index": "14384", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int p, int n) {\n  int i, j;\n  int a[100];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (a[j] < a[j - 1]) {\n        a[j - 1] = a[j] + a[j - 1];\n        a[j] = a[j - 1] - a[j];\n        a[j - 1] = a[j - 1] - a[j];\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  if (p > 0)\n    printf(\" \");\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  f(1, n1);\n  f(0, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sr(int a[100], int b[100], int x, int y);\n  void px(int a[100], int x);\n  void hb(int a[100], int b[100], int c[200], int x, int y);\n  void sc(int a[200], int x);\n  int a[100], b[100], c[200], x, y;\n  scanf(\"%d%d\", &x, &y);\n  sr(a, b, x, y);\n  px(a, x);\n  px(b, y);\n  hb(a, b, c, x, y);\n  sc(c, x + y);\n  return 0;\n}\nvoid sr(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid px(int a[100], int x) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hb(int a[100], int b[100], int c[200], int x, int y) {\n  int i;\n  for (i = 0; i < x + y; i++) {\n    if (i < x)\n      c[i] = a[i];\n    else\n      c[i] = b[i - x];\n  }\n}\nvoid sc(int c[200], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else {\n      printf(\" %d\", c[i]);\n    }\n  }\n}\n"}
{"label": "8", "index": "14386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a1[10000], a2[10000], a3[10000];\nvoid X1() {\n  cin >> m >> n;\n  printf(\"\\n\");\n  for (int i = 0; i < m; i++)\n    cin >> a1[i];\n  for (int i = 0; i < n; i++)\n    cin >> a2[i];\n}\nvoid X2() {\n  int change;\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = i + 1; j < m; j++) {\n      if (a1[i] > a1[j]) {\n        change = a1[i];\n        a1[i] = a1[j];\n        a1[j] = change;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a2[i] > a2[j]) {\n        change = a2[i];\n        a2[i] = a2[j];\n        a2[j] = change;\n      }\n    }\n  }\n}\nvoid X3() {\n  for (int i = 0; i < m; i++)\n    a3[i] = a1[i];\n  for (int i = 0; i < n; i++)\n    a3[i + m] = a2[i];\n}\nvoid X4() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a3[i] << \" \";\n  cout << a3[m + n - 1];\n  cout << endl;\n}\nint main() {\n  X1();\n  X2();\n  X3();\n  X4();\n  return 0;\n}\n"}
{"label": "8", "index": "14387", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j;\nint a[10000];\nvoid input() {\n  cin >> n >> m;\n  for (i = 0; i < n + m; i++)\n    cin >> a[i];\n}\n\nvoid fsort() {\n  sort(a, a + n);\n  sort(a + n, a + n + m);\n}\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n + m; i++)\n    cout << ' ' << a[i];\n}\nint main() {\n  input();\n  fsort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000], num2[1000], a, b;\n\nvoid cin_array(int num1[], int num2[]) {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++)\n    cin >> num1[i];\n  for (int i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sort(int num1[], int num2[]) {\n  int temp;\n  for (int i = 1; i <= a; i++)\n    for (int j = 0; j < a - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 1; i <= b; i++)\n    for (int j = 0; j < b - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\n\nvoid connect(int num1[], int num2[]) {\n  for (int i = 0; i < b; i++)\n    num1[a + i] = num2[i];\n}\n\nvoid cout_array(int num[]) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[a + b - 1];\n}\n\nint main() {\n  cin_array(num1, num2);\n  sort(num1, num2);\n  connect(num1, num2);\n  cout_array(num1);\n  return 0;\n}\n"}
{"label": "8", "index": "14389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\nvoid link(int array1[], int array2[], int m, int n) {\n  int i;\n  for (i = m; i < m + n; i++)\n    array1[i] = array2[i - m];\n}\n\nint main() {\n  int a[40], b[20], n1, n2, i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, n1);\n  sort(b, n2);\n  link(a, b, n1, n2);\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i == n1 + n2 - 1)\n    printf(\"%d\", a[i]);\n}\n"}
{"label": "8", "index": "14390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a, b;\nint a1[20], b1[20], c[40];\nvoid input(void) {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++)\n    cin >> a1[i];\n  for (int j = 0; j < b; j++)\n    scanf(\"%d \", &b1[j]);\n}\nvoid select_sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid combine(int array1[], int array2[]) {\n  for (int i = 0; i < a; i++)\n    c[i] = array1[i];\n  for (int j = 0; j < b; j++)\n    c[j + a] = array2[j];\n}\nvoid output(void) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[a + b - 1] << endl;\n}\nint main() {\n  input();\n  select_sort(a1, a);\n  select_sort(b1, b);\n  combine(a1, b1);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int a[100], b[100];\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int word1[100], word2[100];\n  int num1, num2;\n  scanf(\"%d %d\", &num1, &num2);\n  int i;\n  for (i = 0; i < num1; i++) {\n    cin >> word1[i];\n  }\n  printf(\"\\n\");\n  for (i = 0; i < num2; i++) {\n    scanf(\"%d\", &word2[i]);\n  }\n  printf(\"\\n\");\n  int j, k, temp;\n  for (j = 1; j <= num1 * num1; j++) {\n    for (k = 0; k < num1 - 1; k++) {\n      if (word1[k] >= word1[k + 1]) {\n        temp = word1[k];\n        word1[k] = word1[k + 1];\n        word1[k + 1] = temp;\n      }\n    }\n  }\n  for (j = 1; j <= num2 * num2; j++) {\n    for (k = 0; k < num2 - 1; k++) {\n      if (word2[k] >= word2[k + 1]) {\n        temp = word2[k];\n        word2[k] = word2[k + 1];\n        word2[k + 1] = temp;\n      }\n    }\n  }\n  int zjword[300], l;\n  for (l = 0; l < num1 + num2; l++) {\n    if (l < num1) {\n      zjword[l] = word1[l];\n    } else {\n      zjword[l] = word2[l - num1];\n    }\n  }\n  int m;\n  for (m = 0; m < num1 + num2; m++) {\n    if (m != num1 + num2 - 1)\n      printf(\"%d \", zjword[m]);\n    else\n      printf(\"%d\", zjword[m]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14393", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint s1[100] = {0};\nint s2[100] = {0};\nint s3[200] = {0};\nint a = 0, b = 0;\n\nvoid read() {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> s1[i];\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> s2[i];\n  }\n}\n\nvoid sort1() {\n  for (int i = 0; i < a - 1; i++)\n    for (int j = i + 1; j < a; j++) {\n      if (s1[i] > s1[j]) {\n        int temp = s1[i];\n        s1[i] = s1[j];\n        s1[j] = temp;\n      }\n    }\n}\n\nvoid sort2() {\n  for (int i = 0; i < b - 1; i++)\n    for (int j = i + 1; j < b; j++) {\n      if (s2[i] > s2[j]) {\n        int temp = s2[i];\n        s2[i] = s2[j];\n        s2[j] = temp;\n      }\n    }\n}\n\nvoid add() {\n  for (int i = 0; i < a; i++)\n    s3[i] = s1[i];\n  for (int i = 0; i < b; i++)\n    s3[i + a] = s2[i];\n}\n\nvoid write() {\n  for (int i = 0; i < a + b - 1; i++) {\n    cout << s3[i] << ' ';\n  }\n  cout << s3[a + b - 1] << endl;\n}\nint main() {\n  read();\n  sort1();\n  sort2();\n  add();\n  write();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() { \n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  \n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n  \n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n  \n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n"}
{"label": "8", "index": "14395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint first[100];\nint second[100];\nint combination[200];\nint a, b;\nvoid cin_number() {\n  int i;\n  scanf(\"%d %d \", &a, &b);\n  for (i = 0; i < a; i++) {\n    scanf(\"%d \", &first[i]);\n  }\n  for (i = 0; i < b; i++) {\n    cin >> second[i];\n  }\n}\nvoid rank_1() {\n  int i, j, temp;\n  for (i = (a - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (first[j] > first[j + 1]) {\n        temp = first[j];\n        first[j] = first[j + 1];\n        first[j + 1] = temp;\n      }\n    }\n  }\n  for (i = (b - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (second[j] > second[j + 1]) {\n        temp = second[j];\n        second[j] = second[j + 1];\n        second[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < a; i++) {\n    combination[i] = first[i];\n  }\n  for (i = 0; i < b; i++) {\n    combination[a + i] = second[i];\n  }\n}\nvoid cout_combination() {\n  int i;\n  for (i = 0; i < (a + b - 1); i++)\n    cout << combination[i] << \" \";\n  cout << combination[i] << endl;\n}\nint main() {\n  cin_number();\n  rank_1();\n  combine();\n  cout_combination();\n  return 0;\n}\n"}
{"label": "8", "index": "14396", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, m, n, a[1000], b[1000], c;\nvoid f(int a[1000], int m) {\n  for (i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  f(a, m);\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  cout << \" \";\n  f(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint *putin() {\n  int a, b, n;\n  scanf(\"%d %d\", &a, &b);\n  int *p = (int *)malloc((a + b + 2) * sizeof(int));\n  *p = a;\n  *(p + 1) = b;\n  for (n = 2; n <= a + b + 1; n++)\n    scanf(\"%d\", (p + n));\n  return p;\n}\nint *compare(int *a) {\n  int n, m, p;\n  for (n = 2; n <= (*a); n++) {\n    for (m = n + 1; m <= (*a) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  for (n = (*a) + 2; n <= (*a) + (*(a + 1)); n++) {\n    for (m = n + 1; m <= (*a) + (*(a + 1)) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  return a;\n}\nvoid putout(int *a) {\n  int x;\n  for (x = 2; x <= (*a) + (*(a + 1)); x++)\n    printf(\"%d \", a[x]);\n  printf(\"%d\", a[(*a) + (*(a + 1)) + 1]);\n}\nint main() {\n  putout(compare(putin()));\n  return 0;\n}\n"}
{"label": "8", "index": "14398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200], m, n;\nvoid getstr() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid rangestr() {\n  void range(int str[100], int length);\n  range(a, m);\n  range(b, n);\n}\n\nvoid range(int str[100], int length) {\n  int i, j, t;\n  for (i = 0; i < length - 1; i++)\n    for (j = 0; j < length - i - 1; j++)\n      if (str[j] > str[j + 1]) {\n        t = str[j + 1];\n        str[j + 1] = str[j];\n        str[j] = t;\n      }\n}\n\nvoid combinestr() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\n\nvoid putstr() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  getstr();\n  rangestr();\n  combinestr();\n  putstr();\n  return 0;\n}\n"}
{"label": "8", "index": "14399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0, i = 0;\nint a[1000], b[1000];\nvoid duru1() {\n  cin >> m;\n  cin >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nvoid shuchu() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  duru1();\n  paixu(a, m);\n  paixu(b, n);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, b, i, j, t, c[20], d[20], e[40];\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d \", &d[i]);\n}\n\nvoid order() {\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++)\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n}\n\nvoid combine() {\n  for (i = 0; i < a; i++)\n    e[i] = c[i];\n  for (i = 0; i < b; i++)\n    e[a + i] = d[i];\n}\n\nvoid out() {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", e[i]);\n  cout << e[a + b - 1];\n}\n\nint main() {\n  in();\n  order();\n  combine();\n  out();\n}\n"}
{"label": "8", "index": "14401", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n;\nvoid nem(int num1[100], int num2[100]) {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &num1[i]);\n  for (i = 0; i < n; i++)\n    cin >> num2[i];\n}\nvoid pai(int num[100], int x) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - 1 - j; i++)\n      if (num[i] > num[i + 1]) {\n        t = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t;\n      }\n}\nvoid he(int num1[100], int num2[100], int num[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    num[i] = num1[i];\n  for (i = m; i < m + n; i++) {\n    num[i] = num2[i - m];\n  }\n}\nvoid printnum(int num[100]) {\n  int i;\n  printf(\"%d\", num[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", num[i]);\n}\nint main() {\n  int num[100], num1[100], num2[100];\n  nem(num1, num2);\n  pai(num1, m);\n  pai(num2, n);\n  he(num1, num2, num);\n  printnum(num);\n  return 0;\n}\n"}
{"label": "8", "index": "14402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int n, int m) {\n  int i, j, num;\n  int shuzu[1000];\n  for (i = 1; i <= n + m; i++) {\n    cin >> num;\n    shuzu[i] = num;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = n + 1; i <= n + m; i++) {\n    for (j = n + m - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = 1; i <= n + m; i++) {\n    if (i == m + n) {\n      cout << shuzu[i];\n    } else\n      cout << shuzu[i] << \" \";\n  }\n  return 0;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  paixu(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int a[], int m) {\n  int i, j, d;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        d = a[i];\n        a[i] = a[j];\n        a[j] = d;\n      }\n    }\n  }\n  return;\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return;\n}\n\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[200];\n\nint main() {\n  void to(int a[], int b[], int n, int m);\n  void hebing(int a[], int b[], int n, int m);\n  void print(int c[], int n, int m);\n  int n, m, a[100], b[100], i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  to(a, b, n, m);\n  hebing(a, b, n, m);\n  print(c, n, m);\n}\n\nvoid to(int a[], int b[], int n, int m) {\n  int t, u, s, f, e, p;\n  for (t = 0; t < n - 1; t++) {\n    for (u = t + 1; u < n; u++) {\n      if (a[t] > a[u]) {\n        s = a[t];\n        a[t] = a[u];\n        a[u] = s;\n      }\n    }\n  }\n  for (f = 0; f < m - 1; f++) {\n    for (e = f + 1; e < m; e++) {\n      if (b[f] > b[e]) {\n        p = b[f];\n        b[f] = b[e];\n        b[e] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[n + i] = b[i];\n  }\n}\nvoid print(int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\\n\", c[n + m - 1]);\n}\n"}
{"label": "8", "index": "14405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid duqu() {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n} \nvoid paixu() {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n} \nvoid shuchu() {\n  int i, j;\n  cout << a[1];\n  for (i = 2; i <= m; i++)\n    cout << \" \" << a[i];\n  for (j = 1; j <= n; j++)\n    cout << \" \" << b[j];\n  cout << endl;\n} \nint main() {\n  duqu();\n  paixu();\n  shuchu(); \n  return 0;\n}\n"}
{"label": "8", "index": "14406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b;\nint c[1000], d[1000];\nvoid scan1() {\n  cin >> a >> b;\n  int i;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n}\n\nvoid order() {\n  int i, j, k;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < b - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        k = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = k;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < b; i++) {\n    c[a + i] = d[i];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a + b; i++) {\n    if (i) {\n      printf(\" \");\n    }\n    cout << c[i];\n  }\n}\nint main() {\n  scan1();\n  order();\n  hebing();\n  shuchu();\n}\n"}
{"label": "8", "index": "14407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100], b[100];\n\nvoid sort(int c[], int s) {\n  int i, j, k;\n  for (i = 0; i < s - 1; i++)\n    for (j = 0; j < s - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = k;\n      }\n}\n\nvoid hebing(int d[], int e[], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    printf(\"%d \", d[i]);\n  for (i = 0; i < y - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[y - 1]);\n}\nint main() {\n  int i, j;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &b[j]);\n  sort(a, n);\n  sort(b, m);\n  hebing(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint order(int n, int a[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i; j < n; j++)\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nint combine(int a[], int b[], int n, int m, int c[]) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (j = 0; j < m; j++, i++)\n    c[i] = b[j];\n}\nint input(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nint output(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i < n - 1) {\n      printf(\" \");\n    }\n  }\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m], c[n + m];\n  input(n, a);\n  input(m, b);\n  order(n, a);\n  order(m, b);\n  combine(a, b, n, m, c);\n  output(n + m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], n, m, i, j, t;\nvoid shuru(int p, int q) {\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid shuchu(int p, int q) {\n  for (i = 0; i < p; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < q - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[q - 1]);\n}\nvoid paixu(int p, int c[]) {\n  for (i = 0; i < p; i++)\n    for (j = 0; j < i; j++)\n      if (c[i] < c[j]) {\n        t = c[i];\n        c[i] = c[j];\n        c[j] = t;\n      }\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  shuru(n, m);\n  paixu(n, a);\n  paixu(m, b);\n  shuchu(n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14410", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000], la, lb;\nint p;\nint c[1000], lc;\n\nvoid M1(int m1) {\n  cin >> la >> lb;\n  for (int i = 1; i <= la; i++)\n    cin >> a[i];\n  for (int i = 1; i <= lb; i++)\n    cin >> b[i];\n}\n\nvoid M2(int m2) {\n  for (int i = 1; i <= la; i++) {\n    for (int j = 1; j <= la - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (int i = 1; i <= lb; i++) {\n    for (int j = 1; j <= lb - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\n\nvoid M3(int m3) {\n  lc = la + lb;\n  for (int i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (int i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n}\n\nvoid M4(int m4) {\n  for (int i = 1; i <= lc; i++) {\n    printf(\"%d\", c[i]);\n    if (i == lc)\n      break;\n    cout << \" \";\n  }\n}\n\nint main() {\n  M1(1);\n  M2(1);\n  M3(1);\n  M4(1);\n  return 0;\n}\n"}
{"label": "8", "index": "14411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100], c[200];\nvoid in() {\n  scanf(\"%d %d \", &n, &m);\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid pai(int *p, int k) {\n  int i, j, temp;\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid out() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  pai(a, n);\n  pai(b, m);\n  he();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint i = 0, n, m;\nvoid block_in() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\n\nvoid arr(int x, int c[]) {\n  int i = 0, j = 0, mid;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (c[j] > c[j + 1]) {\n        mid = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= x; i++) {\n    printf(\"%d\", c[i]);\n    if (i < x)\n      printf(\" \");\n  }\n}\nint main() {\n  block_in();\n  arr(n, a);\n  printf(\" \");\n  arr(m, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[1000], b[1000], c[2000], s, t;\nvoid input() {\n  cin >> m >> n;\n  for (s = 0; s < m; s++)\n    scanf(\"%d\", &a[s]);\n  for (s = 0; s < n; s++)\n    scanf(\"%d\", &b[s]);\n}\n\nvoid order() {\n  int k;\n  for (s = 1; s < m; s++)\n    for (t = 0; t < m - s; t++)\n      if (a[t] > a[t + 1]) {\n        k = a[t];\n        a[t] = a[t + 1];\n        a[t + 1] = k;\n      }\n  for (s = 1; s < n; s++)\n    for (t = 0; t < n - s; t++)\n      if (b[t] > b[t + 1]) {\n        k = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = k;\n      }\n}\n\nvoid add() {\n  for (s = 0; s < m; s++)\n    c[s] = a[s];\n  for (s = m, t = 0; s < m + n; s++, t++)\n    c[s] = b[t];\n}\n\nvoid output() {\n  for (s = 0; s < m + n; s++) {\n    if (s != m + n - 1)\n      printf(\"%d \", c[s]);\n    else\n      cout << c[s];\n  }\n}\n\nint main() {\n  input();\n  order();\n  add();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int m, int n, int shu1[], int shu2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> shu1[i];\n  for (i = 0; i < n; i++)\n    cin >> shu2[i];\n}\nvoid paixu(int shu[], int m) {\n  int i, j, temp;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (shu[j] > shu[j + 1]) {\n        temp = shu[j + 1];\n        shu[j + 1] = shu[j];\n        shu[j] = temp;\n      }\n    }\n  }\n}\nvoid output(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  int num1, num2, shu1[10000], shu2[10000];\n  cin >> num1 >> num2;\n  input(num1, num2, shu1, shu2);\n  paixu(shu1, num1);\n  paixu(shu2, num2);\n  output(num1, num2, shu1, shu2);\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "8", "index": "14415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nint n, m;\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, tem;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i] << endl;\n}\nint main() {\n  read();\n  paixu();\n  combine();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sort(int str[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (str[j] < str[k])\n        k = j;\n    t = str[k];\n    str[k] = str[i];\n    str[i] = t;\n  }\n}\nvoid gather(int str1[], int str2[]) {\n  int t = 0, i;\n  while (str1[t] != '\\0')\n    t++;\n  for (i = t; str2[i - t] != '\\0'; i++)\n    str1[i] = str2[i - t];\n}\n\nint main() {\n  int i, n1, n2, str1[100], str2[100];\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> str1[i];\n  scanf(\"\\n\");\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &str2[i]);\n  sort(str1, n1);\n  sort(str2, n2);\n  gather(str1, str2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    cout << str1[i] << \" \";\n  printf(\"%d\", str1[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "14417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int a[100], b[100], c[300];\nchar z;\nvoid scan() {\n  static int m, n, i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= 99; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &a[i], &z);\n  }\n  z = 1;\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &b[i], &z);\n  }\n}\nvoid ord() {\n  int i, j, temp;\n  for (i = 0; a[i] != '\\0'; i++) {\n    for (j = i + 1; a[j] != '\\0'; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    for (j = i + 1; b[j] != '\\0'; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid bin() {\n  static int i, j;\n  for (i = 0; i <= 299; i++) {\n\n    c[i] = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c[i] = a[i];\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    c[j + i] = b[j];\n  }\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; c[i] != 0; i++)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  scan();\n  ord();\n  bin();\n  print();\n}\n"}
{"label": "8", "index": "14418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint input(int *s, int n) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  return 0;\n}\n\nint sort(int *s, int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (s[j - 1] > s[j]) {\n        int temp = s[j - 1];\n        s[j - 1] = s[j];\n        s[j] = temp;\n      }\n    }\n  }\n  return 0;\n}\n\nint combine(int *s1, int *s2, int n1, int n2, int *s) {\n  int i = 0;\n  for (i = 0; i < n1; i++)\n    s[i] = s1[i];\n  for (i = 0; i < n2; i++)\n    s[i + n1] = s2[i];\n  return 0;\n}\n\nint output(int *s, int n) {\n  int i = 0;\n  if (n <= 0)\n    return 0;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++)\n    cout << \" \" << s[i];\n}\n\nint main() {\n  int n1 = 0, n2 = 0;\n  scanf(\"%d %d\", &n1, &n2);\n  int s1[1000] = {0};\n  int s2[1000] = {0};\n  input(s1, n1);\n  input(s2, n2);\n  sort(s1, n1);\n  sort(s2, n2);\n  int s[2000] = {0};\n  combine(s1, s2, n1, n2, s);\n  output(s, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint la = 0, lb = 0, l = 0, a[100], b[100], combine[200];\n\nvoid input();\nvoid seq();\nvoid sequence(int x[100]);\nvoid com(int a[100], int b[100]);\nvoid output(int combine[200]);\n\nint main() {\n  input();\n  seq();\n  com(a, b);\n  output(combine);\n  return 0;\n}\nvoid input() {\n  scanf(\"%d %d \", &la, &lb);\n  for (int i = 0; i < la; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < lb; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid seq() {\n  l = la;\n  sequence(a);\n  l = lb;\n  sequence(b);\n}\nvoid sequence(int x[100]) {\n  int temp = 0;\n  for (int i = 1; i < l; i++)\n    for (int j = 1; j <= l - i; j++)\n      if (x[j - 1] > x[j]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n}\nvoid com(int a[100], int b[100]) {\n  memcpy(combine, a, la * 4);\n  memcpy(combine + la, b, lb * 4);\n}\nvoid output(int combine[200]) {\n  cout << combine[0];\n  for (int i = 1; i < la + lb; i++)\n    cout << \" \" << combine[i];\n}\n"}
{"label": "8", "index": "14420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid duqu();\nvoid paixu();\nvoid hebin();\nvoid xianshi();\nint a[100], b[100], c[200];\nint m, n;\nint main() {\n  duqu();\n  paixu();\n  hebin();\n  xianshi();\n  return 0;\n}\nvoid duqu() {\n\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i = 0, j = 0, t;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid hebin() {\n\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n  for (int i = m; i < n + m; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[m + n - 1];\n}\n"}
{"label": "8", "index": "14421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n;\nstatic char a[100], b[100];\nint i, j, temp;\nvoid get() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order() {\n  for (i = m - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid com() {\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid print() {\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  get();\n  order();\n  com();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14422", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int m, int a[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n}\nvoid arrange(int m, int a[100]) {\n  int i, j, c;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n}\nvoid puttogether(int a, int b, int m[2][100]) {\n  int i;\n  for (i = 0; i < b; i++)\n    m[0][a + i] = m[1][i];\n}\nvoid output(int a, int m[100]) {\n  int i;\n  printf(\"%d\", m[0]);\n  for (i = 1; i < a; i++)\n    printf(\" %d\", m[i]);\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int number[2][100];\n  input(a, number[0]);\n  input(b, number[1]);\n  arrange(a, number[0]);\n  arrange(b, number[1]);\n  puttogether(a, b, number);\n  output(a + b, number[0]);\n  cin >> a;\n  return 0;\n}\n"}
{"label": "8", "index": "14423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid changeplace(int n, int a[]) {\n  int i, j, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] >= a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nint main() {\n  int n1, n2, k;\n  scanf(\"%d%d\", &n1, &n2);\n  int *p = (int *)malloc(n1 * sizeof(int));\n  int *q = (int *)malloc(n2 * sizeof(int));\n  for (k = 0; k < n1; k++)\n    scanf(\"%d\", &p[k]);\n  for (k = 0; k < n2; k++)\n    cin >> q[k];\n  changeplace(n1, p);\n  changeplace(n2, q);\n  for (k = 0; k < n1; k++)\n    cout << p[k] << \" \";\n  for (k = 0; k < n2 - 1; k++)\n    printf(\"%d \", q[k]);\n  printf(\"%d\", q[n2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, N[100], M[100];\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &N[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &M[i]);\n}\nvoid sort(int q, int a[]) {\n  int i, j, k, t;\n  for (i = 0; i < q - 1; i++) {\n    k = i;\n    for (j = i + 1; j < q; j++)\n      if (a[j] < a[k])\n        k = j;\n    if (k != i) {\n      t = a[i];\n      a[i] = a[k];\n      a[k] = t;\n    }\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n  for (i = 0; i < m; i++)\n    printf(\" %d\", M[i]);\n  printf(\"\\n\");\n}\nint main() {\n  scan();\n  sort(n, N);\n  sort(m, M);\n  print();\n}\n"}
{"label": "8", "index": "14425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change() {\n  int i, j, middle;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        middle = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = middle;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        middle = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change();\n  prin();\n}\n"}
{"label": "8", "index": "14426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[i]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nvoid cmp(int a[], int n, int b[], int m) {\n  int i = n, j;\n  for (j = 0; j < m; j++) {\n    a[i] = b[j];\n    i++;\n  }\n}\nint main() {\n  int n, m, i, a[1000], b[500];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, n);\n  f(b, m);\n  cmp(a, n, b, m);\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n + m - 1]);\n}\n"}
{"label": "8", "index": "14427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int *p1, int *p2, int **pA, int **pB) {\n  int i;\n  scanf(\"%d %d\", p1, p2);\n  *pA = (int *)malloc((*p1) * sizeof(int));\n  *pB = (int *)malloc((*p2) * sizeof(int));\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", *pA + i);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", *pB + i);\n}\nvoid sort(int p, int *pX) {\n  int i, j, temp;\n  for (i = 0; i < p; i++) {\n    for (j = p - 1; j > i; j--) {\n      if (pX[j] < pX[j - 1]) {\n        temp = pX[j];\n        pX[j] = pX[j - 1];\n        pX[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int p1, int p2, int *pA, int *pB, int **pC) {\n  *pC = (int *)malloc((p1 + p2) * sizeof(int));\n  int i;\n  for (i = 0; i < p1; i++)\n    (*pC)[i] = pA[i];\n  for (i = 0; i < p2; i++)\n    (*pC)[p1 + i] = pB[i];\n  free(pA);\n  free(pB);\n}\nvoid output(int p, int *pC) {\n  int i;\n  for (i = 0; i < p - 1; i++)\n    printf(\"%d \", pC[i]);\n  printf(\"%d \", pC[p - 1]);\n  free(pC);\n}\nint main() {\n  int p1, p2, *pA, *pB, *pC;\n  input(&p1, &p2, &pA, &pB);\n  sort(p1, pA);\n  sort(p2, pB);\n  combine(p1, p2, pA, pB, &pC);\n  output(p1 + p2, pC);\n}\n"}
{"label": "8", "index": "14428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint m, n, i, j;\nvoid temp() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\nvoid temp1() {\n  int x;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp2() {\n  int x;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n}\nvoid temp3() {\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n}\nint main() {\n  temp();\n  temp1();\n  temp2();\n  temp3();\n  return 0;\n}\n"}
{"label": "8", "index": "14429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *p, *q, m, n;\nvoid shuru() {\n  cin >> m >> n;\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", q + i);\n}\nstatic int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid shuchu() {\n  for (int i = 0; i < m; i++)\n    cout << *(p + i) << \" \";\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", *(q + i));\n  printf(\"%d\", *(q + n - 1));\n}\nint main() {\n  shuru();\n  qsort(p, m, sizeof(int), cmp);\n  qsort(q, n, sizeof(int), cmp);\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length[2] = {0}, a[2][100] = {0}, i, j, t, m;\n  cin >> length[0] >> length[1];\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < length[i]; j++)\n      cin >> a[i][j];\n  for (i = 0; i < 2; i++)\n    for (m = 1; m < length[i]; m++)\n      for (j = 0; j < length[i] - m; j++)\n        if (a[i][j] > a[i][j + 1]) {\n          t = a[i][j];\n          a[i][j] = a[i][j + 1];\n          a[i][j + 1] = t;\n        }\n  for (j = 0; j < length[0]; j++)\n    cout << a[0][j] << \" \";\n  cout << a[1][0];\n  for (j = 1; j < length[1]; j++)\n    cout << \" \" << a[1][j];\n  return 0;\n}\n"}
{"label": "8", "index": "14431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bubble(int c[], int x);\n  int i, m, n;\n  int a[100], b[100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &a[i - 1]);\n  printf(\"\\n\");\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b[i - 1]);\n  }\n  printf(\"\\n\");\n  bubble(a, m);\n  printf(\" \");\n  bubble(b, n);\n  return 0;\n}\n\nint bubble(int c[], int x) {\n  int t, j, temp;\n  for (t = 1; t <= x; t++) {\n    for (j = 1; j <= x - t; j++) {\n      if (c[j - 1] > c[j]) {\n        temp = c[j - 1];\n        c[j - 1] = c[j];\n        c[j] = temp;\n      }\n    }\n  }\n  for (t = 1; t <= x; t++) {\n    printf(\"%d\", c[t - 1]);\n    if (t != x)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\n\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\n\nvoid order(int N, int p[100]) {\n  int i, j, amount = 0;\n  int min, max;\n  min = p[0];\n  max = p[0];\n  for (i = 0; i < N; i++) {\n    if (p[i] < min)\n      min = p[i];\n    if (p[i] > max)\n      max = p[i];\n  }\n  for (i = min; i <= max; i++) {\n    for (j = 0; j < N; j++) {\n      if (p[j] == i) {\n        if (amount == 0) {\n          printf(\"%d\", p[j]);\n        } else\n          printf(\" %d\", p[j]);\n        amount = amount + 1;\n      }\n    }\n  }\n}\n\nvoid combine(int N, int p[100], int M, int q[100]) {\n  order(N, p);\n  printf(\" \");\n  order(M, q);\n  printf(\"\\n\");\n}\n\nint main() {\n  scan();\n  combine(m, a, n, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14433", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], la, lb, c[20000];\nvoid get();\nvoid array_1();\nvoid combine();\nvoid out();\nint main() {\n  get();\n  array_1();\n  combine();\n  out();\n  return 0;\n}\nvoid get() {\n  scanf(\"%d %d \", &la, &lb);\n  for (int i = 0; i < la; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = 0; i < lb; i++) {\n    cin >> b[i];\n  }\n}\nvoid array_1() {\n  int v;\n  for (int i = 0; i < la - 1; i++) {\n    for (int j = 0; j < la - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        v = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = v;\n      }\n    }\n  }\n  for (int i = 0; i < lb - 1; i++) {\n    for (int j = 0; j < lb - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        v = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = v;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (int i = 0; i < la; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < lb; i++) {\n    c[la + i] = b[i];\n  }\n}\nvoid out() {\n  for (int i = 0; i < la + lb; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << ' ' << c[i];\n  }\n}\n"}
{"label": "8", "index": "14434", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000], num2[1000], a, b;\n\nvoid cin_array(int num1[], int num2[]) {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++)\n    cin >> num1[i];\n  for (int i = 0; i < b; i++)\n    cin >> num2[i];\n}\n\nvoid sort(int num1[], int num2[]) {\n  int temp;\n  for (int i = 1; i <= a; i++)\n    for (int j = 0; j < a - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 1; i <= b; i++)\n    for (int j = 0; j < b - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\n\nvoid connect(int num1[], int num2[]) {\n  for (int i = 0; i < b; i++)\n    num1[a + i] = num2[i];\n}\n\nvoid cout_array(int num[]) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[a + b - 1];\n}\n\nint main() {\n  cin_array(num1, num2);\n  sort(num1, num2);\n  connect(num1, num2);\n  cout_array(num1);\n  return 0;\n}\n"}
{"label": "8", "index": "14435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid shuru(int a[], int b[], int m, int n) {\n  int *p = a, *q = b;\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", p);\n    p++;\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", q);\n    q++;\n  }\n}\nvoid paixu(int a[], int m) {\n  int *p = a, b, c, d;\n  for (b = 0; b < m - 1; b++) {\n    for (c = 0; c < m - 1 - b; c++) {\n      if (*(p + c) > *(p + c + 1)) {\n        d = *(p + c);\n        *(p + c) = *(p + c + 1);\n        *(p + c + 1) = d;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  int *r = a, *s = b, *t = c, p, q;\n  for (p = 0; p < m; p++) {\n    *(t + p) = *(r + p);\n  }\n  for (q = 0; q < n; q++) {\n    *(t + m + q) = *(s + q);\n  }\n}\nvoid shuchu(int a[], int b) {\n  int c;\n  cout << a[0];\n  for (c = 1; c < b; c++)\n    printf(\" %d\", a[c]);\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0}, m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m + n);\n}\n"}
{"label": "8", "index": "14436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int mmax = 1000;\nint a[mmax];\nint b[mmax];\nint m, n;\nvoid mread();\nvoid msort();\nvoid mcomb();\nvoid mdisp();\nint main() {\n  mread();\n  msort();\n  mcomb();\n  mdisp();\n  return 0;\n}\nvoid mread() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid msort() {\n  int t;\n  for (int i = 0; i < m; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid mcomb() {\n  for (int i = 0; i < n; i++)\n    a[i + m] = b[i];\n}\nvoid mdisp() {\n  for (int i = 0; i < m + n; i++) {\n    if (i != 0)\n      cout << \" \";\n    printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "8", "index": "14437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20000], b[10000], n, m;\nvoid f1(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int a[], int n) {\n  int i, j;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        int t;\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  f1(a, n);\n  f1(b, m);\n  f2(a, n);\n  f2(b, m);\n  f3(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid reset1(int a[]);\nvoid reset2(int b[]);\nint main() {\n  int a[100], b[100], i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  reset1(a);\n  reset2(b);\n  for (i = 0; i < n; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < m - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[m - 1];\n  cin.get();\n  cin.get();\n  return 0;\n}\nvoid reset1(int a[]) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid reset2(int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "14439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int m, n;\n  int temp;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        temp = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[n - 1];\n}\n"}
{"label": "8", "index": "14440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int mmax = 1000;\nint a[mmax];\nint b[mmax];\nint m, n;\nvoid mread();\nvoid msort();\nvoid mcomb();\nvoid mdisp();\nint main() {\n  mread();\n  msort();\n  mcomb();\n  mdisp();\n  return 0;\n}\nvoid mread() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid msort() {\n  int t;\n  for (int i = 0; i < m; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid mcomb() {\n  for (int i = 0; i < n; i++)\n    a[i + m] = b[i];\n}\nvoid mdisp() {\n  for (int i = 0; i < m + n; i++) {\n    if (i != 0)\n      printf(\" \");\n    cout << a[i];\n  }\n}\n"}
{"label": "8", "index": "14441", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[102], b[102], c[202], m, n;\n\nvoid shuru() {\n  int i;\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (b[j] < b[j - 1]) {\n        int t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n}\nvoid hebing() {\n  int i = 0, j = 0;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid xianshi() {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  xianshi();\n  return 0;\n}\n"}
{"label": "8", "index": "14442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint num1[100], num2[100], num3[1000];\nvoid read() {\n  cin >> n >> m;\n  for (int i = 1; i <= n; i++)\n    cin >> num1[i];\n\n  for (int i = 1; i <= m; i++) {\n    cin >> num2[i];\n  }\n}\n\nvoid sort(int num1[], int num2[]) {\n  for (int i = 1; i <= n - 1; i++) {\n    for (int j = 1; j <= n - i; j++) {\n      if (num1[j] > num1[j + 1])\n        swap(num1[j], num1[j + 1]);\n    }\n  }\n  for (int i = 1; i <= m - 1; i++) {\n    for (int j = 1; j <= m - i; j++) {\n      if (num2[j] > num2[j + 1])\n        swap(num2[j], num2[j + 1]);\n    }\n  }\n}\nvoid hebing(int num1[], int num2[], int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i <= n)\n      num3[i] = num1[i];\n    else\n      num3[i] = num2[i - n];\n  }\n}\nvoid display(int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i == 1)\n      cout << num3[i];\n    else\n      cout << \" \" << num3[i];\n  }\n}\n\nint main() {\n  read();\n  sort(num1, num2);\n  hebing(num1, num2, num3);\n  display(num3);\n  return 0;\n}\n"}
{"label": "8", "index": "14443", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[999];\n  int b[999];\n  int c[999] = {0};\n  int m, n, i, s;\n  void read(int arr_1[], int arr_2[], int x, int y);\n  void f(int arr_1[], int arr_2[], int x, int y);\n  void combine(int arr_1[], int arr_2[], int arr_3[], int x, int y);\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  f(a, b, m, n);\n  combine(a, b, c, m, n);\n  s = m + n;\n  for (i = 0; i < s; i++) {\n    if (i < s - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n  }\n  return 0;\n}\n\nvoid read(int arr_1[], int arr_2[], int x, int y) {\n  int i, j;\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &arr_1[i]);\n  for (j = 0; j <= y - 1; j++)\n    scanf(\"%d\", &arr_2[j]);\n}\n\nvoid f(int arr_1[], int arr_2[], int x, int y) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - j - 1; i++)\n      if (arr_1[i] > arr_1[i + 1]) {\n        t = arr_1[i];\n        arr_1[i] = arr_1[i + 1];\n        arr_1[i + 1] = t;\n      }\n\n  for (j = 0; j < y - 1; j++)\n    for (i = 0; i < y - j - 1; i++)\n      if (arr_2[i] > arr_2[i + 1]) {\n        t = arr_2[i];\n        arr_2[i] = arr_2[i + 1];\n        arr_2[i + 1] = t;\n      }\n}\n\nvoid combine(int arr_1[], int arr_2[], int arr_3[], int x, int y) {\n  int k;\n  for (k = 0; k <= x - 1; k++)\n    arr_3[k] = arr_1[k];\n  for (k = x; k <= x + y - 1; k++)\n    arr_3[k] = arr_2[k - x];\n}\n"}
{"label": "8", "index": "14444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint j, k;\nvoid G(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < j; n++) {\n    for (m = n + 1; m < j; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid g(int a[]) {\n  int n, m, q;\n  int *p;\n  p = a;\n  for (n = 0; n < k; n++) {\n    for (m = n + 1; m < k; m++) {\n      if (p[n] > p[m]) {\n        q = p[n];\n        p[n] = p[m];\n        p[m] = q;\n      }\n    }\n  }\n}\nvoid F(int a[], int b[]) {\n  G(a);\n  g(b);\n  int n, m;\n  printf(\"%d\", a[0]);\n  for (n = 1; n < j; n++)\n    printf(\" %d\", a[n]);\n  for (m = 0; m < k; m++)\n    cout << \" \" << b[m];\n}\nint main() {\n  int n, m;\n  int a[5000], b[5000];\n  scanf(\"%d %d\", &j, &k);\n  for (n = 0; n < j; n++)\n    scanf(\"%d \", &a[n]);\n  for (m = 0; m < k; m++)\n    scanf(\"%d\", &b[m]);\n  F(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14445", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint lena = 0;  \nint lenb = 0;  \nvoid Input() { \n  cin >> lena >> lenb;\n  for (int i = 0; i < lena; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < lenb; i++) {\n    cin >> b[i];\n  }\n}\nvoid Sort() { \n  for (int i = 1; i <= lena - 1; i++) {\n    for (int j = 0; j <= lena - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= lenb - 1; i++) {\n    for (int j = 0; j <= lenb - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid Catenate() { \n  for (int i = 0; i <= lenb - 1; i++) {\n    a[lena + i] = b[i];\n  }\n}\nvoid Output() { \n  cout << a[0];\n  for (int i = 1; i <= lena + lenb - 1; i++) {\n    cout << ' ' << a[i];\n  }\n}\nint main() { \n  Input();\n  Sort();\n  Catenate();\n  Output();\n  return 0;\n}\n"}
{"label": "8", "index": "14446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *n1, int data1[], int *n2, int data2[]) {\n  cin >> *n1 >> *n2;\n  for (int i = 0; i < *n1; ++i)\n    cin >> data1[i];\n  for (int i = 0; i < *n2; ++i)\n    cin >> data2[i];\n  return;\n}\nvoid bubblesort(int n, int data[]) {\n  for (int i = n - 1; i > 0; --i)\n    for (int j = 0; j < i; ++j)\n      if (data[j] > data[j + 1]) {\n        int temp = data[j];\n        data[j] = data[j + 1];\n        data[j + 1] = temp;\n      }\n  return;\n}\nint combine(int n1, int data1[], int n2, int data2[], int data3[]) {\n  for (int i = 0; i < n1; ++i)\n    data3[i] = data1[i];\n  for (int i = n1; i < n1 + n2; ++i)\n    data3[i] = data2[i - n1];\n  return n1 + n2;\n}\nvoid print(int n, int data[]) {\n  cout << data[0];\n  for (int i = 1; i < n; ++i)\n    printf(\" %d\", data[i]);\n  cout << endl;\n  return;\n}\nint main() {\n  int n1, n2, a1[101], a2[101], a3[201];\n  input(&n1, a1, &n2, a2);\n  bubblesort(n1, a1);\n  bubblesort(n2, a2);\n\n  int n3 = combine(n1, a1, n2, a2, a3);\n  print(n3, a3);\n  return 0;\n}\n"}
{"label": "8", "index": "14447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f(int str[], int m) {\n  int i, j, k;\n  for (j = 0; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if (str[i] > str[i + 1]) {\n        k = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = k;\n      }\n}\n\nvoid g(int a[], int b[], int ma, int mb) {\n  int i;\n  for (i = ma; i < (ma + mb); i++)\n    a[i] = b[i - ma];\n}\n\nint main() {\n  int ma, mb, i;\n  int a[8888], b[8888];\n  scanf(\"%d %d\", &ma, &mb);\n  for (i = 0; i < ma; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < mb; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, ma);\n  f(b, mb);\n  g(a, b, ma, mb);\n  for (i = 0; i <= (ma + mb - 1); i++) {\n    if (i != 0)\n      cout << \" \";\n    printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "8", "index": "14448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int a[], int b[]) {\n  int i, m, n;\n  scanf(\"%d %d\", &a[49], &b[49]);\n  m = a[49];\n  n = b[49];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int m, int n, int a[], int b[]) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid comb(int m, int n, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < (m + n); i++)\n    c[i] = b[i - m];\n}\nvoid print(int m, int n, int c[]) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < (m + n); i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  int a[50], b[50], c[100];\n  input(a, b);\n  order(a[49], b[49], a, b);\n  comb(a[49], b[49], a, b, c);\n  print(a[49], b[49], c);\n}\n"}
{"label": "8", "index": "14449", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[2000] = {0}, b[1000] = {0};\n\nvoid read() {\n  int x, y;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++)\n    cin >> b[i];\n}\nvoid paixu(int z[]) {\n  int c;\n  for (int i = 0; z[i + 2] != 0; i++)\n    for (int j = 0; z[j + 1] != 0; j++) \n      if (z[j] > z[j + 1]) {\n        c = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = c;\n      }\n}\nvoid addd(int x[], int y[]) {\n  int q = 0;\n  while (x[q] != 0) {\n    q++;\n  }\n  for (int z = 0; y[z] != 0; z++)\n    x[q + z] = y[z];\n}\nvoid shuchu(int x[]) {\n  for (int z = 0; x[z] != 0; z++)\n    if (!z)\n      cout << x[z];\n    else\n      cout << ' ' << x[z];\n}\nint main() {\n  read();\n  paixu(a);\n  paixu(b);\n  addd(a, b);\n  shuchu(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14450", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100];\nvoid shuru() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n} \n\nvoid paixu() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++) {\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n    }\n} \nvoid hebin() {\n  int i;\n  for (i = n + 1; i <= n + m; i++) {\n    a[i] = b[i - n];\n  }\n\n} \n\nvoid shuchu() {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n] << endl;\n} \nint main() {\n  shuru();\n  paixu();\n  hebin();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14451", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  scanf(\"%d %d \", &c, &d);\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(int m, int n) {\n  int i, j;\n  int temp;\n  int a[100] = {0};\n  int b[100] = {0};\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n\n  f(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000], c[20000], n, m;\nvoid input() {\n  scanf(\"%d %d \", &n, &m);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int j = 0; j < m; j++)\n    cin >> b[j];\n}\nvoid sort() {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine() {\n  for (int i = 0; i < n; i++)\n    c[i] = a[i];\n  for (int j = n; j < n + m; j++)\n    c[j] = b[j - n];\n}\nvoid out() {\n  cout << c[0];\n  for (int i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  input();\n  sort();\n  combine();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int zhengshuchuan[], int changdu) {\n  int i, j, t;\n  for (i = 0; i < changdu; i++) {\n    for (j = i; j < changdu; j++) {\n      if (zhengshuchuan[i] > zhengshuchuan[j]) {\n        t = zhengshuchuan[i];\n        zhengshuchuan[i] = zhengshuchuan[j];\n        zhengshuchuan[j] = t;\n      }\n    }\n  }\n  return 0;\n}\nint main() {\n  int a[200], b[100], i;\n  int changdu1, changdu2;\n  scanf(\"%d %d\", &changdu1, &changdu2);\n  for (i = 0; i < changdu1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < changdu2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, changdu1);\n  f(b, changdu2);\n  for (i = 0; i < changdu2; i++) {\n    a[changdu1 + i] = b[i];\n  }\n\n  for (i = 0; i < changdu1 + changdu2; i++) {\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\n\nvoid enter(int array0[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    cin >> array0[i];\n}\n\nvoid sort(int array[], int p1) {\n  int i, j, k;\n  for (i = 0; i < p1 - 1; i++)\n    for (j = 0; j < p1 - 1 - i; j++)\n      if (array[j] > array[j + 1]) {\n        k = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = k;\n      }\n}\n\nvoid paste(int array1[], int array2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = array1[i];\n  for (i = m; i < m + n; i++)\n    c[i] = array2[i - m];\n}\n\nvoid out(int array3[], int p2) {\n  int i;\n  cout << array3[0];\n  for (i = 1; i < p2; i++)\n    cout << \" \" << array3[i];\n}\n\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  enter(a, m);\n  enter(b, n);\n  sort(a, m);\n  sort(b, n);\n  paste(a, b);\n  out(c, m + n);\n}\n"}
{"label": "8", "index": "14456", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid f1(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid f2(int a[1000], int b[1000]) {\n  int i, j, t;\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (n - 1); i > j; i--) {\n      if (a[i] < a[i - 1]) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < (n - 1); j++) {\n    for (i = (m - 1); i > j; i--) {\n      if (b[i] < b[i - 1]) {\n        t = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[1000], int b[1000]) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n}\nvoid f4(int a[1000]) {\n  int i;\n  for (i = 0; i < (n + m); i++) {\n    printf(\"%d\", a[i]);\n    if (i != (n + m - 1))\n      printf(\" \");\n  }\n}\nint main() {\n  int a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  f1(a, b);\n  f2(a, b);\n  f3(a, b);\n  f4(a);\n}\n"}
{"label": "8", "index": "14457", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000];\nvoid inputdata();\nvoid outputdata();\nvoid sortdata();\n\nint main() {\n  inputdata();\n  sortdata();\n  outputdata();\n\n  return 0;\n}\n\nvoid inputdata() {\n  cin >> a[0] >> b[0];\n  for (int i = 1; i <= a[0]; i++)\n    cin >> a[i];\n  for (int i = 1; i <= b[0]; i++)\n    cin >> b[i];\n}\nvoid sortdata() {\n  sort(a + 1, a + a[0] + 1);\n  sort(b + 1, b + b[0] + 1);\n}\nvoid outputdata() {\n  for (int i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i < b[0]; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\", b[b[0]]);\n}\n"}
{"label": "8", "index": "14458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid a(int s[], int x) {\n  int i;\n  for (i = 1; i <= x; i++)\n    scanf(\"%d\", &s[i]);\n}\nvoid b(int s[], int x) {\n  int i, j;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (s[j] > s[j + 1]) {\n        s[0] = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = s[0];\n      }\n    }\n  }\n}\nvoid c(int p[], int x, int q[], int y) {\n  int i;\n  for (i = 1; i <= y; i++)\n    p[x + i] = q[i];\n}\nvoid d(int s[], int x) {\n  int i;\n  for (i = 1; i <= x - 1; i++)\n    cout << s[i] << \" \";\n  printf(\"%d\\n\", s[x]);\n}\nint main() {\n  int p[60], q[30], m, n;\n  scanf(\"%d%d\", &m, &n);\n  a(p, m);\n  a(q, n);\n  b(p, m);\n  b(q, n);\n  c(p, m, q, n);\n  d(p, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14459", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j + 1] < a[j]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (b[j + 1] < b[j]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int m, int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid f4(int a[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n\n  cout << a[m + n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[1000];\n  int b[1000];\n\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, m, n);\n  f4(a, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14460", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint temp, m, n;\nint a[100], b[100];\n\nvoid scanf() { \n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid bubblesorta() { \n  for (int i = 0; i < m; i++)\n    for (int j = 1; j < m - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n}\nvoid bubblesortb() { \n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\n\nvoid printf() { \n  for (int i = 0; i < m; i++) {\n    if (i)\n      cout << \" \" << a[i];\n    else\n      cout << a[i];\n  }\n  for (int i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  scanf();\n  bubblesorta();\n  bubblesortb();\n  printf();\n  return 0;\n}\n"}
{"label": "8", "index": "14461", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint x, y, a[100], b[100], temp; \nint input()                     \n{\n  int k = 0, t = 0, temp = 0;\n  cin >> x >> y;\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int j = 0; j < y; j++)\n    cin >> b[j];\n  return 0;\n}\nint bubble() \n{\n  for (int i = 0; i < x - 1; i++)\n    for (int t = i + 1; t < x; t++) {\n      if (a[i] > a[t]) {\n        temp = a[t];\n        a[t] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (int j = 0; j < y - 1; j++)\n    for (int t = j + 1; t < y; t++) {\n      if (b[j] > b[t]) {\n        temp = b[t];\n        b[t] = b[j];\n        b[j] = temp;\n      }\n    }\n  return 0;\n}\nint combine() \n{\n  for (int i = 0; i < x; i++)\n    cout << a[i] << ' ';\n  for (int j = 0; j < y - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[y - 1];\n  return 0;\n}\nint main() \n{\n  input();\n  bubble();\n  combine();\n  return 0;\n}\n"}
{"label": "8", "index": "14462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid shuru(int a[], int b[], int m, int n) {\n  int *p = a, *q = b;\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", p);\n    p++;\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", q);\n    q++;\n  }\n}\nvoid paixu(int a[], int m) {\n  int *p = a, b, c, d;\n  for (b = 0; b < m - 1; b++) {\n    for (c = 0; c < m - 1 - b; c++) {\n      if (*(p + c) > *(p + c + 1)) {\n        d = *(p + c);\n        *(p + c) = *(p + c + 1);\n        *(p + c + 1) = d;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  int *r = a, *s = b, *t = c, p, q;\n  for (p = 0; p < m; p++) {\n    *(t + p) = *(r + p);\n  }\n  for (q = 0; q < n; q++) {\n    *(t + m + q) = *(s + q);\n  }\n}\nvoid shuchu(int a[], int b) {\n  int c;\n  printf(\"%d\", a[0]);\n  for (c = 1; c < b; c++) {\n    cout << \" \" << a[c];\n  }\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0}, m, n;\n  scanf(\"%d %d \", &m, &n);\n  shuru(a, b, m, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m + n);\n}\n"}
{"label": "8", "index": "14463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nvoid getarr(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid sortarr(void) {\n  int i, j, p;\n  for (i = 1; i < m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n}\nvoid combarr(void) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid printarr(void) {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i];\n}\nint main() {\n  getarr();\n  sortarr();\n  combarr();\n  printarr();\n  return 0;\n}\n"}
{"label": "8", "index": "14464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int n, int m) {\n  int i, j, t;\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = 1; j < m; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    c[i] = a[i];\n  for (i = 1; i <= m; i++)\n    c[i + n] = b[i];\n}\nvoid f4(int c[], int n, int m) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n]);\n}\nint main() {\n  int a[99], b[99], c[200], n, m;\n  cin >> n >> m;\n  f1(a, b, n, m);\n  f2(a, b, n, m);\n  f3(a, b, c, n, m);\n  f4(c, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14465", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid scan(int n[], int a[], int b[]) {\n  int i;\n  scanf(\"%d%d\", &n[0], &n[1]);\n\n  for (i = 0; i < n[0]; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[], int m, int n) {\n  int i, j, t;\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\n\nvoid com(int a[], int b[], int ab[], int m, int n) {\n  int i;\n\n  for (i = 0; i < m; i++)\n    ab[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    ab[m + i] = b[i];\n}\n\nvoid prt(int ab[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", ab[i]);\n\n  printf(\"%d\", ab[m + n - 1]);\n}\n\nint main() {\n  int a[101], b[101], n[2], ab[202];\n\n  scan(n, a, b);\n  sort(a, b, n[0], n[1]);\n  com(a, b, ab, n[0], n[1]);\n  prt(ab, n[0], n[1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid sort(int x[]) {\n  int i, j, t;\n  for (i = 1; i <= x[0]; i++)\n    for (j = 1; j <= x[0] - i; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\nvoid deal(void) {\n  int a[100] = {0};\n  int b[100] = {0};\n  int n, m, i;\n  cin >> n >> m;\n  a[0] = n;\n  b[0] = m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  sort(a);\n  sort(b);\n  cout << a[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  deal();\n  return 0;\n}\n"}
{"label": "8", "index": "14467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, a[100], b[100];\nvoid f() {\n  scanf(\"%d %d\", &m, &n);\n  int i, j;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= n - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\n\nint g(int a[], int l) {\n  int i, j, t;\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l - j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  return a[0];\n}\nvoid p(int a[], int b[]) {\n  int i, j;\n  for (i = 0; i <= m - 1; i++)\n    cout << a[i] << \" \";\n  for (j = 0; j <= n - 2; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  f();\n  g(a, m);\n  g(b, n);\n  p(a, b);\n}\n"}
{"label": "8", "index": "14468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f1(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid f2(int n, int a[]) {\n  int i, j, k;\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[j];\n        a[j] = a[i];\n        a[i] = k;\n      }\n    }\n}\nvoid f3(int n, int m, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(int n, int m, int c[]) {\n  printf(\"%d\", c[0]);\n  int i;\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  int i, n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  f1(n, a);\n  f1(m, b);\n  f2(n, a);\n  f2(m, b);\n  f3(n, m, a, b, c);\n  f4(n, m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14469", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j, k, a[100], b[100];\nint read() {\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  return 0;\n}\nint sorta() {\n  int min, t;\n  for (i = 1; i <= n - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[min] > a[j])\n        min = j;\n    t = a[i];\n    a[i] = a[min];\n    a[min] = t;\n  }\n  return 0;\n}\nint sortb() {\n  int min, t;\n  for (i = 1; i <= m - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= m; j++)\n      if (b[min] > b[j])\n        min = j;\n    t = b[i];\n    b[i] = b[min];\n    b[min] = t;\n  }\n  return 0;\n}\nint write() {\n  for (i = 1; i <= n; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i < m; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\\n\", b[m]);\n  return 0;\n}\nint main() {\n  k = read();\n  k = sorta();\n  k = sortb();\n  k = write();\n  return 0;\n}\n"}
{"label": "8", "index": "14470", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, t;\n  scanf(\"%d%d\", &m, &n);\n  printf(\"\\n\");\n  int a[m], b[n], i, j;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  printf(\"\\n\");\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14471", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint *order(int *p, int k) {\n  int i, j;\n  int t = 0;\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &p[i]);\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (p[j] > p[j + 1]) {\n        t = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  return p;\n}\nint *merge(int *p, int *q, int m, int n) {\n  int i;\n  int *u = (int *)malloc((m + n) * sizeof(int));\n  for (i = 0; i < m; i++)\n    u[i] = p[i];\n\n  for (i = 0; i < n; i++) {\n    u[m + i] = q[i];\n  }\n  return u;\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  a = order(a, m);\n  b = order(b, n);\n  int *p = merge(a, b, m, n);\n  printf(\"%d\", p[0]);\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", p[i]);\n  }\n}\n"}
{"label": "8", "index": "14472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num[2];\nint a[100], b[100], c[100];\nvoid getarray(int a[], int b[], int num[]) {\n  cin >> num[0] >> num[1];\n  for (int i = 0; i < num[0]; i++)\n    cin >> a[i];\n  for (int i = 0; i < num[1]; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[], int af, int bf) {\n  int temp;\n  for (int i = 0; i < af - 1; i++) {\n    for (int j = 1; j < af - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < bf - 1; i++) {\n    for (int j = 1; j < bf - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[], int c[], int af, int bf) {\n  for (int i = 0; i < af; i++)\n    c[i] = a[i];\n  for (int i = af; i < af + bf; i++)\n    c[i] = b[i - af];\n}\nvoid print(int c[], int af, int bf) {\n  cout << c[0];\n  for (int i = 1; i < af + bf; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  getarray(a, b, num);\n  sort(a, b, num[0], num[1]);\n  combine(a, b, c, num[0], num[1]);\n  print(c, num[0], num[1]);\n}\n"}
{"label": "8", "index": "14473", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint A[100];\nint An;\nint B[100];\nint Bn;\n\nvoid getAn() \n{\n  cin >> An;\n}\n\nvoid getBn() \n{\n  cin >> Bn;\n}\n\nvoid sortA() \n{\n  for (int i = 0; i < An; i++) {\n    cin >> A[i];\n  }\n\n  sort(A, A + An);\n}\n\nvoid sortB() \n{\n  for (int i = 0; i < Bn; i++) {\n    cin >> B[i];\n  }\n\n  sort(B, B + Bn);\n}\n\nvoid OutA() {\n  for (int i = 0; i < An; i++) {\n    cout << A[i] << \" \";\n  }\n}\n\nvoid OutB() {\n  for (int i = 0; i < Bn; i++) {\n    cout << B[i];\n    if (i != Bn - 1)\n      cout << ' ';\n  }\n}\n\nint main() {\n  getAn();\n  getBn();\n  sortA();\n  sortB();\n  OutA();\n  OutB();\n  return 0;\n}\n"}
{"label": "8", "index": "14474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid inputarray(int a[], int);\nvoid place(int a[], int);\nvoid combine(int a[], int b[], int, int);\nvoid printarray(int a[], int);\n\nint main(void) {\n  int array1[100], array2[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  inputarray(array1, m);\n  inputarray(array2, n);\n  place(array1, m);\n  place(array2, n);\n  combine(array1, array2, m, n);\n  printarray(array1, m + n);\n  return 0;\n}\n\nvoid inputarray(int array[], int n) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\n\nvoid printarray(int array[], int n) {\n  printf(\"%d\", array[0]);\n  for (int i = 1; i < n; i++) {\n    printf(\" %d\", array[i]);\n  }\n  printf(\"\\n\");\n}\n\nvoid place(int array[], int n) {\n  int mininum, temp;\n  for (int i = 0; i < n - 1; i++) {\n    mininum = i;\n    for (int j = i + 1; j < n; j++) {\n      mininum = array[j] < array[mininum] ? j : mininum;\n    }\n    temp = array[i];\n    array[i] = array[mininum];\n    array[mininum] = temp;\n  }\n}\n\nvoid combine(int array1[], int array2[], int m, int n) {\n  for (int i = m; i < m + n; i++) {\n    array1[i] = array2[i - m];\n  }\n}\n"}
{"label": "8", "index": "14475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m = 0, n = 0, i = 0;\n  int a[1000], b[1000];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  paixu(a, m);\n  paixu(b, n);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14476", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint lena = 0;\nint lenb = 0;\nvoid Input() {\n  scanf(\"%d %d \", &lena, &lenb);\n  for (int i = 0; i < lena; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < lenb; i++) {\n    cin >> b[i];\n  }\n}\nvoid Sort() {\n  for (int i = 1; i <= lena - 1; i++) {\n    for (int j = 0; j <= lena - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= lenb - 1; i++) {\n    for (int j = 0; j <= lenb - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid Catenate() {\n  for (int i = 0; i <= lenb - 1; i++) {\n    a[lena + i] = b[i];\n  }\n}\nvoid Output() {\n  cout << a[0];\n  for (int i = 1; i <= lena + lenb - 1; i++) {\n    cout << ' ' << a[i];\n  }\n}\nint main() {\n  Input();\n  Sort();\n  Catenate();\n  Output();\n  return 0;\n}\n"}
{"label": "8", "index": "14477", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[500], b[500], numbera, numberb, i, j, p;\nvoid input(); \nvoid order();\nvoid stract();\nvoid output();\nint main() {\n  input(); \n  order();\n  stract();\n  output();\n  return 0;\n}\nvoid input() { \n  cin >> numbera >> numberb;\n  for (i = 0; i < numbera; i++)\n    cin >> a[i];\n  for (i = 0; i < numberb; i++)\n    cin >> b[i];\n}\nvoid order() { \n  for (i = 0; i < numbera - 1; i++)\n    for (j = numbera - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n  for (i = 0; i < numberb - 1; i++)\n    for (j = numberb - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        p = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = p;\n      }\n}\nvoid stract() { \n  for (i = numbera; i < numbera + numberb; i++)\n    a[i] = b[i - numbera];\n}\nvoid output() { \n  cout << a[0];\n  for (i = 1; i < numbera + numberb; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "14478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint A[200] = {0};\nint B[100] = {0};\nint a, b;\n\nvoid shuzu() {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> A[i];\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> B[i];\n  }\n}\nvoid paixu() {\n  int p;\n  for (int j = 1; j <= a - 1; j++) {\n    for (int i = 0; i < a - j; i++) {\n      if (A[i] > A[i + 1]) {\n        p = A[i];\n        A[i] = A[i + 1];\n        A[i + 1] = p;\n      }\n    }\n  }\n  for (int j = 1; j <= b - 1; j++) {\n    for (int i = 0; i < b - j; i++) {\n      if (B[i] > B[i + 1]) {\n        p = B[i];\n        B[i] = B[i + 1];\n        B[i + 1] = p;\n      }\n    }\n  }\n}\nvoid hebing() {\n  for (int i = 0; i < b; i++) {\n    A[a + i] = B[i];\n  }\n  for (int i = 0; i < a + b - 1; i++) {\n    printf(\"%d \", A[i]);\n  }\n  printf(\"%d\", A[a + b - 1]);\n}\n\nint main() {\n\n  shuzu();\n  paixu();\n  hebing();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint M, N;\nvoid x() {\n  int i;\n  scanf(\"%d\", &M);\n  scanf(\"%d\", &N);\n  for (i = 0; i <= M - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= N - 1; i++)\n    scanf(\"%d\", &b[i]);\n};\nvoid y() {\n  int i, j, m;\n  for (i = 1; i <= M - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] < a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  for (i = 1; i <= N - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] < b[j]) {\n        m = b[i];\n        b[i] = b[j];\n        b[j] = m;\n      }\n    }\n  }\n};\nvoid z() {\n  int i;\n  for (i = 0; i <= M - 1; i++)\n    c[i] = a[i];\n  for (i = 0; i <= N - 1; i++)\n    c[i + M] = b[i];\n};\nvoid u() {\n  int i;\n  for (i = 0; i <= M + N - 2; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\", c[M + N - 1]);\n};\nint main() {\n  x();\n  y();\n  z();\n  u();\n  return 0;\n}\n"}
{"label": "8", "index": "14480", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[100];\nvoid input() {\n  cin >> m >> n;\n  int i, j, k, l;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (j = 1; j <= n; j++)\n    scanf(\"%d \", &b[j]);\n}\nvoid paixu(int a[100], int b[100]) {\n  int i, j, k, l;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j < m - i + 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid he(int a[100], int b[100]) {\n  int i, j;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (j = i; j <= i + n; j++)\n    c[j] = b[j - i + 1];\n}\nvoid output(int c[100]) {\n  printf(\"%d\", c[1]);\n  int i;\n  for (i = 2; i <= m + n; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  input();\n  paixu(a, b);\n  he(a, b);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[100], n[100], *p, *q, a, b;\nvoid input() {\n  p = m;\n  q = n;\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++, p++) {\n    scanf(\"%d\", p);\n  }\n  for (i = 0; i < b; i++, q++) {\n    scanf(\"%d\", q);\n  }\n  p = m;\n  q = n;\n}\nvoid sort(int *p, int a) {\n  int i, j, temp;\n  for (i = 0; i < a - 1; i++) {\n    for (j = 0; j < a - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid mix() {\n  int i;\n  for (i = 0; i < b; i++) {\n    p[a + i] = q[i];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < a + b - 1; i++) {\n    printf(\"%d \", *(p++));\n  }\n  cout << *p << \" \";\n}\nint main() {\n  input();\n  sort(p, a);\n  sort(q, b);\n  mix();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14482", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint c[2000];\nint p, q;\n\nvoid read(void) {\n  scanf(\"%d %d \", &p, &q);\n  int i = 0;\n  for (i = 0; i < p; i++)\n    cin >> a[i];\n  for (i = 0; i < q; i++)\n    cin >> b[i];\n}\n\nvoid increaseSort(void) {\n  sort(a + 0, a + p);\n  sort(b + 0, b + q);\n}\n\nvoid merge(void) {\n  int i = 0;\n  for (i = 0; i < p; i++)\n    c[i] = a[i];\n  for (i = p; i < p + q; i++)\n    c[i] = b[i - p];\n}\n\nvoid print(void) {\n  int i = 0;\n  cout << c[0];\n  for (i = 1; i < p + q; i++)\n    cout << \" \" << c[i];\n  cout << endl;\n}\n\nint main() {\n  read();\n  increaseSort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint n, m;\nint main() {\n  void input(void);\n  void order1(void);\n  void order2(void);\n  void output(void);\n  input();\n  order1();\n  order2();\n  output();\n}\n\nvoid input(void) {\n  int i;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid order1(void) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\n\nvoid order2(void) {\n  int i, j, t;\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] >= b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n}\n\nvoid output(void) {\n  int i;\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 1; i < m; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m]);\n}\n"}
{"label": "8", "index": "14484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100], k[200];\nvoid f1();\nvoid f2(int[], int[]);\nvoid f3(int[], int[]);\nvoid f4(int[]);\nint main() {\n  f1();\n  f2(a, b);\n  f3(a, b);\n  f4(k);\n  return 0;\n}\nvoid f1() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++)\n    cin >> b[j];\n}\nvoid f2(int c[], int d[]) {\n  for (int i = 0; i < m; i++) {\n    for (int j = m - 1; j > i; j--) {\n      if (c[j] < c[j - 1])\n        swap(c[j], c[j - 1]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (d[j] < d[j - 1])\n        swap(d[j], d[j - 1]);\n    }\n  }\n}\nvoid f3(int e[], int f[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i < m)\n      k[i] = a[i];\n    else\n      k[i] = b[i - m];\n  }\n}\nvoid f4(int g[]) {\n  for (int i = 0; i < n + m - 1; i++)\n    printf(\"%d \", g[i]);\n  printf(\"%d\\n\", g[n + m - 1]);\n}\n"}
{"label": "8", "index": "14485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read();\n  read();\n  return 0;\n}\nvoid read() {\n  int a, b;\n  void shu(int x, int y);\n  scanf(\"%d%d\", &a, &b);\n  shu(a, b);\n}\nvoid shu(int x, int y) {\n  int a[100], b[100], i;\n  void pai(int a[], int x, int b[], int y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  pai(a, x, b, y);\n}\nvoid pai(int a[], int x, int b[], int y) {\n  int i, k, m;\n  void pr(int a[], int x, int b[], int y);\n  for (i = 0; i < x - 1; i++) {\n    for (k = 0; k < x - 1 - i; k++) {\n      if (a[k] > a[k + 1]) {\n        m = a[k + 1];\n        a[k + 1] = a[k];\n        a[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (k = 0; k < y - 1 - i; k++) {\n      if (b[k] > b[k + 1]) {\n        m = b[k + 1];\n        b[k + 1] = b[k];\n        b[k] = m;\n      }\n    }\n  }\n  pr(a, x, b, y);\n}\nvoid pr(int a[], int x, int b[], int y) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100]; \nint p, q;\nvoid input() \n{\n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < q; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int a[100], int b[100]) \n{\n  int i = 0, j = 0;\n  int c;\n  for (i = 1; i <= p - 1; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  for (i = 1; i <= q - 1; i++) {\n    for (j = 0; j < q - i; j++) {\n      if (b[j] > b[j + 1]) {\n        c = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = c;\n      }\n    }\n  }\n}\nvoid connect(int a[100], int b[100]) \n{\n  for (int i = 0; i < q; i++) {\n    a[p + i] = b[i];\n  }\n}\nvoid output(int a[100]) \n{\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < p + q; i++) {\n    cout << \" \" << a[i];\n  }\n}\nint main() \n{\n  input();\n  paixu(a, b);\n  connect(a, b);\n  output(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], n, m;\nvoid shuru(void);\nvoid paixu(void);\nvoid hebing(void);\nvoid shuchu(void);\nint main() {\n\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\nvoid shuru(void) {\n  int x, y;\n  cin >> x >> y;\n  int i;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  n = x;\n  m = y;\n}\nvoid paixu(void) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n}\nvoid hebing(void) {\n  int i;\n  for (i = n; i < m + n; i++)\n    a[i] = b[i - n];\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "14488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m;\n  scanf(\"%d %d \", &n, &m);\n  int a[10000], b[10000];\n  for (int i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  cin.get();\n  for (int i = 0; i <= m - 1; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  for (int i = 0; i <= n - 2; i++) {\n    for (int j = n - 1; j >= i + 1; j--) {\n      int l;\n      l = max(a[j], a[j - 1]);\n      a[j - 1] = min(a[j], a[j - 1]);\n      a[j] = l;\n    }\n  }\n  for (int i = 0; i <= m - 2; i++) {\n    for (int j = m - 1; j >= i + 1; j--) {\n      int l;\n      l = max(b[j], b[j - 1]);\n      b[j - 1] = min(b[j], b[j - 1]);\n      b[j] = l;\n    }\n  }\n  for (int i = 0; i <= n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  for (int i = 0; i <= m - 1; i++) {\n    if (i != m - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid read(int a[], int m);\nvoid bubble(int a[], int m);\nvoid add(int a[], int b[], int c[], int m, int n);\nvoid out(int c[], int m);\n\nint main() {\n  int m, n;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  bubble(a, m);\n  bubble(b, n);\n  add(a, b, c, m, n);\n  out(c, m + n);\n  return 0;\n}\n\nvoid read(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n}\n\nvoid bubble(int a[], int m) {\n  int i, j, tmp;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n}\n\nvoid add(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\n\nvoid out(int c[], int m) {\n  int i;\n  cout << c[0];\n  for (i = 1; i < m; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14490", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i;\n  int a[20], b[20];\n  cin >> x >> y;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n  sort(a, a + x);\n  sort(b, b + y);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sort(int array[], int n);\n  int m, n, i;\n  int a[100], b[100], c[200];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  sort(a, m);\n  sort(b, n);\n  for (i = 0; i < m + n; i++) {\n    if (i < m)\n      c[i] = a[i];\n    else\n      c[i] = b[i - m];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i < m + n - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n  }\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n"}
{"label": "8", "index": "14492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int n, int m) {\n  int i, j, t;\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = 1; j < m; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    c[i] = a[i];\n  for (i = 1; i <= m; i++)\n    c[i + n] = b[i];\n}\nvoid f4(int c[], int n, int m) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    cout << c[i] << ' ';\n  cout << c[m + n];\n}\nint main() {\n  int a[99], b[99], c[200], n, m;\n  cin >> n >> m;\n  f1(a, b, n, m);\n  f2(a, b, n, m);\n  f3(a, b, c, n, m);\n  f4(c, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint m, n;\n\nvoid input() {\n  int i, j;\n  scanf(\"%d%d\", &m, &n);\n  scanf(\"\\n\");\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n - 1; j++)\n    scanf(\"%d \", &b[j]);\n  scanf(\"%d\", &b[n - 1]);\n  return;\n}\n\nvoid sort(int array[], int k) {\n  int i, j, t;\n  for (j = 0; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (array[i] > array[i + 1]) {\n        t = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = t;\n      }\n  return;\n}\n\nvoid combine() {\n  int i, j = 0;\n  for (i = m; i < m + n; i++) {\n    a[i] = b[j];\n    j++;\n  }\n  return;\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n - 1];\n  return;\n}\n\nint main() {\n  input();\n  sort(a, m - 1);\n  sort(b, n - 1);\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14494", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint a[1000], b[1000], c[2000];\n\nvoid read() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < m; ++i)\n    scanf(\"%d\", b + i);\n}\n\nint cmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }\n\nvoid sort() {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge() {\n  int i;\n  for (i = 0; i < n; ++i)\n    c[i] = a[i];\n  for (i = 0; i < m; ++i)\n    c[n + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; ++i)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n, a[10000], b[10000];\nvoid input() {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sequence() {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        int temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        int temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n}\nvoid combination() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid output() {\n  cout << a[0];\n  for (int i = 1; i < m + n; i++)\n    cout << ' ' << a[i];\n  cout << endl;\n}\nint main() {\n  input();\n  sequence();\n  combination();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int m, n;\n  int temp;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        temp = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14497", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[i]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nvoid cmp(int a[], int n, int b[], int m) {\n  int i = n, j;\n  for (j = 0; j < m; j++) {\n    a[i] = b[j];\n    i++;\n  }\n}\nint main() {\n  int n, m, i, a[1000], b[500];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, n);\n  f(b, m);\n  cmp(a, n, b, m);\n  for (i = 0; i < n + m - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n + m - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s(int m);\nint p(int m, int i, int a[100]);\nvoid e(int i, int c[100], int d[100], int m, int n);\nint main() {\n  int i, m, n, a[100], b[100], c[100], d[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    a[i] = s(i);\n  for (i = 0; i < n; i++)\n    b[i] = s(i);\n  for (i = 0; i < m; i++)\n    c[i] = p(m, i, a);\n  for (i = 0; i < n; i++)\n    d[i] = p(n, i, b);\n  for (i = 0; i < m + n; i++)\n    e(i, c, d, m, n);\n  return 0;\n}\nint s(int m) {\n  int a[100];\n  cin >> a[m];\n  return a[m];\n}\nint p(int m, int i, int a[100]) {\n  int p, q, n;\n  for (p = 0; p < m; p++) {\n    for (q = 0; q < m - 1; q++) {\n      if (a[q] > a[q + 1]) {\n        n = a[q];\n        a[q] = a[q + 1];\n        a[q + 1] = n;\n      }\n    }\n  }\n  return a[i];\n}\nvoid e(int i, int c[100], int d[100], int m, int n) {\n  if (i == 0)\n    printf(\"%d\", c[0]);\n  if (i > 0 && i < m)\n    printf(\" %d\", c[i]);\n  if (i >= m)\n    printf(\" %d\", d[i - m]);\n}\n"}
{"label": "8", "index": "14500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint q[100], w[100], m, n, i, j, k, v, y = 0;\nvoid a(), b(), c(), d();\nint main() {\n  a();\n  b();\n  c();\n  d();\n}\nvoid a() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &q[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &w[i]);\n}\nvoid b() {\n  for (j = 0; j < m - 1; j++) {\n    for (k = j + 1; k < m; k++) {\n      if (q[j] > q[k]) {\n        v = q[k];\n        q[k] = q[j];\n        q[j] = v;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (w[j] > w[k]) {\n        v = w[k];\n        w[k] = w[j];\n        w[j] = v;\n      }\n    }\n  }\n}\nvoid c() {\n  for (i = m; i < m + n; i++)\n    q[i] = w[y++];\n}\nvoid d() {\n  printf(\"%d\", q[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", q[i]);\n}\n"}
{"label": "8", "index": "14501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int a[], int n) {\n  int i, j, m;\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n}\nvoid shuchu1(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\nvoid shuchu2(int b[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n  int a[10], n, b[10], m, i;\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"\\n\");\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n - 1]);\n  scanf(\"\\n\");\n  for (i = 0; i < m - 1; i++)\n    scanf(\"%d \", &b[i]);\n  scanf(\"%d\", &b[m - 1]);\n  paixu(a, n);\n  paixu(b, m);\n  shuchu1(a, n);\n  shuchu2(b, m);\n}\n"}
{"label": "8", "index": "14502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint duru(int a[], int l) {\n  int i;\n  for (i = 1; i <= l; i++)\n    cin >> a[i];\n\n  return 1;\n}\nint paixu(int a[], int l) {\n  int i, j, p;\n  for (i = 1; i <= l - 1; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  return 1;\n}\nint hebing(int a[], int b[], int l1, int l2) {\n  int i;\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n  return l1 + l2;\n}\nint xianshi(int a[], int l) {\n  for (int i = 1; i < l; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\\n\", a[l]);\n  return 1;\n}\nint main() {\n  int a[100], b[100], l1, l2;\n  cin >> l1 >> l2;\n  duru(a, l1);\n  duru(b, l2);\n  paixu(a, l1);\n  paixu(b, l2);\n  l1 = hebing(a, b, l1, l2);\n  xianshi(a, l1);\n  return 0;\n}\n"}
{"label": "8", "index": "14503", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint c[2000];\nint p, q;\n\nvoid read(void) {\n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++)\n    cin >> a[i];\n  for (i = 0; i < q; i++)\n    cin >> b[i];\n}\n\nvoid increaseSort(void) {\n  sort(a + 0, a + p);\n  sort(b + 0, b + q);\n}\n\nvoid merge(void) {\n  int i = 0;\n  for (i = 0; i < p; i++)\n    c[i] = a[i];\n  for (i = p; i < p + q; i++)\n    c[i] = b[i - p];\n}\n\nvoid print(void) {\n  int i = 0;\n  cout << c[0];\n  for (i = 1; i < p + q; i++)\n    cout << \" \" << c[i];\n  cout << endl;\n}\n\nint main() {\n  read();\n  increaseSort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[100], b[100];\n\nvoid read() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid sort_() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\n\nvoid stick() {\n  for (int i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid print() {\n  for (int i = 1; i < m + n; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n];\n}\n\nint main() {\n  read();\n  sort_();\n  stick();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint work(int now, int x) {\n  int i, j, swap;\n  int a[1002];\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= x; i++) {\n    for (j = i + 1; j <= x; j++) {\n      if (a[i] > a[j]) {\n        swap = a[i];\n        a[i] = a[j];\n        a[j] = swap;\n      }\n    }\n  }\n  if (now == 2)\n    printf(\" \");\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= x; i++) {\n    cout << \" \" << a[i];\n  }\n  return (0);\n}\nint main() {\n  int n, m;\n  scanf(\"%d%d\", &n, &m);\n  work(1, n);\n  work(2, m);\n  return (0);\n}\n"}
{"label": "8", "index": "14506", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid paixu(int n, int a[]) {\n  int i, j, m;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\n\nint main() {\n  int i, k;\n  int n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < m; k++)\n    cin >> b[k];\n  paixu(n, a);\n  paixu(m, b);\n  link(a, b, c, n, m);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14507", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, i, a[100], b[100], c[200];\nvoid in() {\n  cin >> m >> n;\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n}\nvoid sort() {\n  sort(&a[0], &a[0] + m);\n  sort(&b[0], &b[0] + n);\n}\nvoid add() {\n  for (i = 0; i < m; ++i)\n    c[i] = a[i];\n  for (i = m; i < m + n; ++i)\n    c[i] = b[i - m];\n}\nvoid out() {\n  cout << c[0];\n  for (i = 1; i < m + n; ++i)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  sort();\n  add();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[102], b[102], c[202], m, n;\n\nvoid shuru() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (b[j] < b[j - 1]) {\n        int t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n}\nvoid hebing() {\n  int i = 0;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid xianshi() {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  xianshi();\n  return 0;\n}\n"}
{"label": "8", "index": "14509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n[2];\nvoid input(int a[], int b[], int n[2]) {\n  int i;\n  scanf(\"%d %d\", &n[0], &n[1]);\n  for (i = 0; i < n[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *p, int *q, int *x) {\n  int i, j, k, t;\n  for (i = 0; i < (*x - 1); i++) {\n    k = i;\n    for (j = i + 1; j < (*x); j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      t = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = t;\n    }\n  }\n  for (i = 0; i < *(x + 1) - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *(x + 1); j++)\n      if (*(q + j) < *(q + k))\n        k = j;\n    if (k != i) {\n      t = *(q + i);\n      *(q + i) = *(q + k);\n      *(q + k) = t;\n    }\n  }\n}\nvoid fold(int *p, int *x, int *q, int *w) {\n  int i;\n  for (i = 0; i < *x; i++, w++, p++)\n    *w = *p;\n  for (; i < (*x) + (*(x + 1)); i++, w++, q++)\n    *w = *q;\n}\nvoid putout(int *w, int *x) {\n  int i;\n  for (i = 0; i < (*x) + (*(x + 1)) - 1; i++)\n    cout << *(w + i) << \" \";\n  printf(\"%d\\n\", *(w + i));\n}\nint main() {\n  int a[100], b[100], c[200];\n  input(a, b, n);\n  sort(a, b, n);\n  fold(a, n, b, c);\n  putout(c, n);\n}\n"}
{"label": "8", "index": "14510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[500], b[500], numbera, numberb, i, j, p;\nvoid input();\nvoid order();\nvoid stract();\nvoid output();\nint main() {\n  input();\n  order();\n  stract();\n  output();\n  return 0;\n}\nvoid input() {\n  cin >> numbera >> numberb;\n  for (i = 0; i < numbera; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < numberb; i++)\n    cin >> b[i];\n}\nvoid order() {\n  for (i = 0; i < numbera - 1; i++)\n    for (j = numbera - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n  for (i = 0; i < numberb - 1; i++)\n    for (j = numberb - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        p = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = p;\n      }\n}\nvoid stract() {\n  for (i = numbera; i < numbera + numberb; i++)\n    a[i] = b[i - numbera];\n}\nvoid output() {\n  cout << a[0];\n  for (i = 1; i < numbera + numberb; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "14511", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint s1[100] = {0};\nint s2[100] = {0};\nint s3[200] = {0};\nint a = 0, b = 0;\n\nvoid read() { \n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> s1[i];\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> s2[i];\n  }\n}\n\nvoid sort1() { \n  for (int i = 0; i < a - 1; i++)\n    for (int j = i + 1; j < a; j++) {\n      if (s1[i] > s1[j]) {\n        int temp = s1[i];\n        s1[i] = s1[j];\n        s1[j] = temp;\n      }\n    }\n}\n\nvoid sort2() {\n  for (int i = 0; i < b - 1; i++)\n    for (int j = i + 1; j < b; j++) {\n      if (s2[i] > s2[j]) {\n        int temp = s2[i];\n        s2[i] = s2[j];\n        s2[j] = temp;\n      }\n    }\n}\n\nvoid add() { \n  for (int i = 0; i < a; i++)\n    s3[i] = s1[i];\n  for (int i = 0; i < b; i++)\n    s3[i + a] = s2[i];\n}\n\nvoid write() { \n  for (int i = 0; i < a + b - 1; i++) {\n    cout << s3[i] << ' ';\n  }\n  cout << s3[a + b - 1] << endl;\n}\nint main() {\n  read();\n  sort1();\n  sort2();\n  add();\n  write();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint shuzu1[100], shuzu2[100];\nint n1, n2;\nvoid scan() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &shuzu1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &shuzu2[i]);\n}\nvoid paixu(int shuzu[], int n) {\n  int min, i, j, temp;\n  for (i = 0; i < n; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++) {\n      if (shuzu[j] < shuzu[min])\n        min = j;\n    }\n    temp = shuzu[i];\n    shuzu[i] = shuzu[min];\n    shuzu[min] = temp;\n  }\n}\nvoid hebing(int shuzu1[], int shuzu2[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", shuzu1[i]);\n  for (i = 0; i < n2 - 1; i++)\n    cout << shuzu2[i] << \" \";\n  cout << shuzu2[i];\n}\nint main() {\n  scan();\n  paixu(shuzu1, n1);\n  paixu(shuzu2, n2);\n  hebing(shuzu1, shuzu2, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100], b[100], m, n;\nvoid sca() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid in(int a[], int b[]) {\n  int i;\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid pri() {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n}\nint main() {\n  sca();\n  order(a, b);\n  in(a, b);\n  pri();\n}\n"}
{"label": "8", "index": "14514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  int a[n], b[m];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  qsort(a, n, sizeof(int), compare);\n  qsort(b, m, sizeof(int), compare);\n  int c[n + m];\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n, j = 0; i < m + n; i++, j++) {\n    c[i] = b[j];\n  }\n  for (i = 0; i < n + m - 1; i++) {\n\n    cout << c[i] << \" \";\n  }\n  cout << c[i] << \" \";\n  return 0;\n}\n"}
{"label": "8", "index": "14515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a1[10000], a2[10000], a3[10000];\nvoid X1() \n{\n  cin >> m >> n;\n  cout << endl;\n  for (int i = 0; i < m; i++)\n    cin >> a1[i];\n  for (int i = 0; i < n; i++)\n    cin >> a2[i];\n}\nvoid X2() \n{\n  int change;\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = i + 1; j < m; j++) {\n      if (a1[i] > a1[j]) {\n        change = a1[i];\n        a1[i] = a1[j];\n        a1[j] = change;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a2[i] > a2[j]) {\n        change = a2[i];\n        a2[i] = a2[j];\n        a2[j] = change;\n      }\n    }\n  }\n}\nvoid X3() \n{\n  for (int i = 0; i < m; i++)\n    a3[i] = a1[i];\n  for (int i = 0; i < n; i++)\n    a3[i + m] = a2[i];\n}\nvoid X4() \n{\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a3[i] << \" \";\n  cout << a3[m + n - 1];\n  cout << endl;\n}\nint main() {\n  X1(); \n  X2();\n  X3();\n  X4();\n  return 0;\n}\n"}
{"label": "8", "index": "14516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num1[1000], num2[1000], num[2000], n1, n2;\nvoid dr() {\n  cin >> n1 >> n2;\n  int i;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\nint px() {\n  int i, j, tem;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tem = num1[i];\n        num1[i] = num1[j];\n        num1[j] = tem;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tem = num2[i];\n        num2[i] = num2[j];\n        num2[j] = tem;\n      }\n    }\n  }\n}\nint gb() {\n  int i;\n  for (i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (i = n1; i < n1 + n2; i++)\n    num[i] = num2[i - n1];\n}\nint dy() {\n  cout << num[0];\n  int i;\n  for (i = 1; i < n1 + n2; i++)\n    cout << ' ' << num[i];\n}\nint main() {\n  dr();\n  px();\n  gb();\n  dy();\n}\n"}
{"label": "8", "index": "14517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint i = 0, n, m;\nvoid block_in() {\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid arr(int x, int c[]) {\n  int i = 0, j = 0, mid;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (c[j] > c[j + 1]) {\n        mid = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= x; i++) {\n    printf(\"%d\", c[i]);\n    if (i < x)\n      printf(\" \");\n  }\n}\nint main() {\n  block_in();\n  arr(n, a);\n  printf(\" \");\n  arr(m, b);\n}\n"}
{"label": "8", "index": "14518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, c[50], d[50];\nvoid shuzu() {\n  int i, j;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &d[j]);\n}\n\nvoid paixu(int a[50], int b[50]) {\n  int i, j, s, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (b[i] > b[i + 1]) {\n        s = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = s;\n      }\n}\n\nvoid hebing(int a[50], int b[50]) {\n\n  int i, j;\n  int e[100];\n  for (i = 0; i < m; i++)\n    e[i] = a[i];\n  for (j = 0; j < n; j++)\n    e[m + j] = b[j];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", e[i]);\n  cout << e[m + n - 1];\n}\n\nint main() {\n  shuzu();\n  paixu(c, d);\n  hebing(c, d);\n  return 0;\n}\n"}
{"label": "8", "index": "14519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int x[], int y[], int a, int b);\n  void change(int x[], int y[], int a, int b);\n  void combine(int x[], int y[], int a, int b);\n  int x[10], y[10], a, b;\n  scanf(\"%d %d\", &a, &b);\n  read(x, y, a, b);\n  change(x, y, a, b);\n  combine(x, y, a, b);\n  return 0;\n}\nvoid read(int x[], int y[], int a, int b) {\n  int i;\n  char c;\n  for (i = 1; i <= a; i++)\n    scanf(\"%d%c\", &x[i], &c);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d%c\", &y[i], &c);\n}\nvoid change(int x[], int y[], int a, int b) {\n  int i, j, t;\n  for (i = 1; i <= a; i++)\n    for (j = 1; j < a + 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= b; i++)\n    for (j = 1; j < b + 1 - i; j++) {\n      if (y[j] > y[j + 1]) {\n        t = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = t;\n      }\n    }\n}\nvoid combine(int x[], int y[], int a, int b) {\n  int i;\n  printf(\"%d\", x[1]);\n  for (i = 2; i <= a; i++)\n    printf(\" %d\", x[i]);\n  for (i = 1; i <= b; i++)\n    printf(\" %d\", y[i]);\n}\n"}
{"label": "8", "index": "14520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(int s[], int x) {\n  int i;\n  for (i = 1; i <= x; i++)\n    scanf(\"%d\", &s[i]);\n}\nvoid b(int s[], int x) {\n  int i, j;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (s[j] > s[j + 1]) {\n        s[0] = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = s[0];\n      }\n    }\n  }\n}\nvoid c(int p[], int x, int q[], int y) {\n  int i;\n  for (i = 1; i <= y; i++)\n    p[x + i] = q[i];\n}\nvoid d(int s[], int x) {\n  int i;\n  for (i = 1; i <= x - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\\n\", s[x]);\n}\nint main() {\n  int p[60], q[30], m, n;\n  scanf(\"%d%d\", &m, &n);\n  a(p, m);\n  a(q, n);\n  b(p, m);\n  b(q, n);\n  c(p, m, q, n);\n  d(p, m + n);\n}\n"}
{"label": "8", "index": "14521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int temp, i, j;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i];\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int x, y, i;\n  int b[100], c[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &c[i]);\n\n  turn(b, x);\n  printf(\" \");\n  turn(c, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sca(int n, int l);\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  sca(n1, 1);\n  sca(n2, 2);\n  return 0;\n}\nvoid sca(int n, int l) {\n  int i, j, a[100] = {0}, p;\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n    for (j = i; j > 0; j = j - 1) {\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i = i + 1)\n    cout << a[i] << \" \";\n  if (l == 1)\n    cout << a[n - 1] << \" \";\n  else\n    printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "8", "index": "14523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid change(int *a, int n) {\n  int t, i, j;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] < a[j]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n}\nvoid input(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid output(int *a, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n}\nint main() {\n  int n, m, a[100], b[100];\n  cin >> n >> m;\n  input(a, n);\n  input(b, m);\n  change(a, n);\n  change(b, m);\n  output(a, n);\n  output(b, m - 1);\n  printf(\"%d\", b[m - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, x[100], y[100], z[100];\nint main() {\n  void read();\n  void orde(int c[100], int d[100]);\n  void resm(int e[100], int f[100]);\n  void show(int g[100]);\n  read();\n  orde(x, y);\n  resm(x, y);\n  show(x);\n}\nvoid read() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid orde(int c[100], int d[100]) {\n  int i, j, q;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j + 1] < c[j]) {\n        q = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = q;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    x[i] = c[i];\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (d[j + 1] < d[j]) {\n        q = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    y[i] = d[i];\n}\nvoid resm(int e[100], int f[100]) {\n  int i;\n  for (i = 0; i < n; i++)\n    e[i + m] = f[i];\n  for (i = 0; i < 100; i++)\n    x[i] = e[i];\n}\nvoid show(int g[100]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", x[i]);\n  printf(\"%d\\n\", x[m + n - 1]);\n}\n"}
{"label": "8", "index": "14525", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint compare(const void *a, const void *b) {\n  int x = *(int *)a;\n  int y = *(int *)b;\n  if (x < y) {\n    return -1;\n  }\n  if (x == y) {\n    return 0;\n  }\n  return 1;\n}\n\nvoid initArrays(int *a, int *b, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int *b, int m, int n) {\n  qsort(a, m, sizeof(int), compare);\n  qsort(b, n, sizeof(int), compare);\n}\n\nvoid append(int *a, int *b, int *c, int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid print(int *a, int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[i];\n}\n\nint main(int argc, const char *argv[]) {\n  \n  int m, n;\n  cin >> m >> n;\n  int a[m];\n  int b[n];\n  initArrays(a, b, m, n);\n  sort(a, b, m, n);\n  int c[m + n];\n  append(a, b, c, m, n);\n  print(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int array[], int k);\n  void g(int c[], int d[], int o, int p);\n  int n, m, a[200], b[100], i, j, e[200], z;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  g(a, b, n, m);\n  for (z = 0; z < n + m - 1; z++) {\n    printf(\"%d \", a[z]);\n  }\n  printf(\"%d\", a[n + m - 1]);\n  return 0;\n}\nvoid f(int array[], int k) {\n  int r, s, t;\n  for (r = 0; r < k - 1; r++)\n    for (s = 0; s < k - 1 - r; s++)\n      if (array[s] > array[s + 1]) {\n        t = array[s];\n        array[s] = array[s + 1];\n        array[s + 1] = t;\n      }\n}\nvoid g(int c[], int d[], int o, int p) {\n  int u;\n  for (u = o; u <= o + p - 1; u++) {\n    c[u] = d[u - o];\n  }\n}\n"}
{"label": "8", "index": "14527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct HaHa {\n  int x, y, z[2][1000], g[2000];\n};\nstruct HaHa scan() {\n  struct HaHa hehe;\n  int i, j;\n  cin >> hehe.x >> hehe.y;\n  for (i = 0; i < hehe.x; i++)\n    scanf(\"%d\", &hehe.z[0][i]);\n  for (j = 0; j < hehe.y; j++)\n    scanf(\"%d\", &hehe.z[1][j]);\n  return (hehe);\n}\nstruct HaHa line(struct HaHa yahoo) {\n  int i, temp, j;\n  struct HaHa yahoo1;\n  for (i = 0; i < yahoo.x; i++) {\n    for (j = i; j < yahoo.x; j++) {\n      if (yahoo.z[0][i] > yahoo.z[0][j]) {\n        temp = yahoo.z[0][i];\n        yahoo.z[0][i] = yahoo.z[0][j];\n        yahoo.z[0][j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < yahoo.y; i++) {\n    for (j = i; j < yahoo.y; j++) {\n      if (yahoo.z[1][i] > yahoo.z[1][j]) {\n        temp = yahoo.z[1][i];\n        yahoo.z[1][i] = yahoo.z[1][j];\n        yahoo.z[1][j] = temp;\n      }\n    }\n  }\n  yahoo1 = yahoo;\n  return (yahoo1);\n}\nstruct HaHa combine(struct HaHa xx) {\n  int i;\n  struct HaHa xx1;\n  for (i = 0; i < xx.x; i++) {\n    xx.g[i] = xx.z[0][i];\n  }\n  for (i = 0; i < xx.y; i++) {\n    xx.g[i + xx.x] = xx.z[1][i];\n  }\n  xx1 = xx;\n  return (xx1);\n}\nvoid print(struct HaHa xxx) {\n  int i;\n  for (i = 0; i < xxx.x + xxx.y - 1; i++) {\n    printf(\"%d \", xxx.g[i]);\n  }\n  cout << xxx.g[xxx.x + xxx.y - 1];\n}\nint main() {\n  print(combine(line(scan())));\n  return 0;\n}\n"}
{"label": "8", "index": "14528", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  int aa[100], bb[100], cc[200], la, lb;\n  void scan(int a[], int la, int b[], int lb);\n  void sort(int a[], int n);\n  void combine(int a[], int la, int b[], int lb, int c[]);\n\n  scanf(\"%d %d\", &la, &lb);\n\n  scan(aa, la, bb, lb);\n  sort(aa, la);\n  sort(bb, lb);\n\n  combine(aa, la, bb, lb, cc);\n}\n\nvoid scan(int a[], int la, int b[], int lb) {\n  int i;\n\n  for (i = 0; i < la; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, k, temp;\n\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[k]) {\n        k = j;\n      }\n    temp = a[k];\n    a[k] = a[i];\n    a[i] = temp;\n  }\n}\n\nvoid combine(int a[], int la, int b[], int lb, int c[]) {\n  int i;\n\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n  for (i = 0; i < la + lb; i++) {\n    c[i] = a[i];\n  }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < la + lb; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int s[], int n);\nvoid arrange(int s[], int n);\nvoid connect(int array1[], int array2[], int p1, int p2);\nvoid print(int array[], int num);\nint main() {\n  int s1[100], s2[100];\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  read(s1, n1);\n  read(s2, n2);\n  arrange(s1, n1);\n  arrange(s2, n2);\n  connect(s1, s2, n1, n2);\n  print(s1, n1 + n2);\n  return 0;\n}\nvoid read(int s[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid arrange(int s[], int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        t = s[j + 1];\n        s[j + 1] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid connect(int array1[], int array2[], int p1, int p2) {\n  int i;\n\n  for (i = p1; i < p1 + p2; i++) {\n    array1[i] = array2[i - p1];\n  }\n}\n\nvoid print(int array[], int num) {\n  int i;\n  printf(\"%d\", array[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %d\", array[i]);\n  }\n}\n"}
{"label": "8", "index": "14530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid duqu(int m, int a[]);\nvoid paixu(int m, int a[]);\nvoid hebing(int m, int n, int a[], int b[]);\nvoid shuchu(int m, int n, int a[]);\nint main() {\n  int x[100] = {0}, y[100] = {0}, m, n;\n  scanf(\"%d%d\", &m, &n);\n  duqu(m, x);\n  duqu(n, y);\n  paixu(m, x);\n  paixu(n, y);\n  hebing(m, n, x, y);\n  shuchu(m, n, x);\n  return 0;\n}\nvoid duqu(int m, int a[]) {\n  int i;\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid paixu(int m, int a[]) {\n  int i, j, k;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n}\nvoid hebing(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid shuchu(int m, int n, int a[]) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    printf(\"%d \", a[i]);\n  cout << a[m + n];\n}\n"}
{"label": "8", "index": "14531", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint x[100], y[100], c[200];\nint m, n;\nvoid scanf() {\n  scanf(\"%d %d\", &m, &n);\n  int i;\n  for (i = 0; i < m - 1; i++) {\n    scanf(\"%d \", &x[i]);\n  }\n  cin >> x[m - 1];\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &y[i]);\n  }\n  scanf(\"%d\\n\", &y[n - 1]);\n}\n\nvoid order() {\n  int j, i, b;\n  for (j = 0; j < m; j++) {\n    for (i = j; i < m; i++) {\n      if (x[j] > x[i]) {\n        b = x[j];\n        x[j] = x[i];\n        x[i] = b;\n      }\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j; i < n; i++)\n      if (y[j] > y[i]) {\n        b = y[j];\n        y[j] = y[i];\n        y[i] = b;\n      }\n  }\n}\n\nvoid together() {\n  int s;\n\n  for (s = 0; s < m; s++) {\n    c[s] = x[s];\n  }\n\n  for (s = m; s < m + n; s++) {\n    c[s] = y[s - m];\n  }\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  scanf();\n  order();\n  together();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *input(int n), *a, *b, *c, n1, n2;\n  void paixu(int *a, int n), display(int *c, int n);\n  int *hebing(int *a, int *b, int n1, int n2);\n  scanf(\"%d %d\", &n1, &n2);\n  a = input(n1);\n  b = input(n2);\n  printf(\"\\n\");\n  paixu(a, n1);\n  paixu(b, n2);\n  c = hebing(a, b, n1, n2);\n  display(c, n1 + n2);\n  return 0;\n}\n\nint *input(int n) {\n  int *p, i;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return (p);\n}\n\nvoid paixu(int *a, int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n  }\n}\n\nint *hebing(int *a, int *b, int n1, int n2) {\n  int *p, i, j;\n  p = (int *)malloc((n1 + n2) * sizeof(int));\n  for (i = 0; i < n1; i++) {\n    p[i] = a[i];\n  }\n\n  for (j = 0; j < n2; j++)\n    p[n1 + j] = b[j];\n\n  return (p);\n}\n\nvoid display(int *c, int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint paixu(int n, int m) {\n  int i, j, num;\n  int shuzu[1000];\n  for (i = 1; i <= n + m; i++) {\n    cin >> num;\n    shuzu[i] = num;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = n + 1; i <= n + m; i++) {\n    for (j = n + m - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = 1; i <= n + m; i++) {\n    if (i == m + n)\n      cout << shuzu[i];\n    else\n      cout << shuzu[i] << \" \";\n  }\n  return 0;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  paixu(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, i, j, t, c[20], d[20], e[40];\nvoid in() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\n\nvoid order() {\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++)\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++)\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n}\n\nvoid combine() {\n  for (i = 0; i < a; i++)\n    e[i] = c[i];\n  for (i = 0; i < b; i++)\n    e[a + i] = d[i];\n}\n\nvoid out() {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", e[i]);\n  printf(\"%d\", e[a + b - 1]);\n}\n\nint main() {\n  in();\n  order();\n  combine();\n  out();\n}\n"}
{"label": "8", "index": "14535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int n1, int n2) {\n  int a[100], b[100], i, j, k, l, m, n, p, q, term = 0;\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n2; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < n1; k++) {\n    for (m = k + 1; m < n1; m++) {\n      if (a[m] < a[k]) {\n        term = a[k];\n        a[k] = a[m];\n        a[m] = term;\n      }\n    }\n  }\n  for (n = 0; n < n2; n++) {\n    for (l = n + 1; l < n2; l++) {\n      if (b[l] < b[n]) {\n        term = b[n];\n        b[n] = b[l];\n        b[l] = term;\n      }\n    }\n  }\n  for (p = 0; p < n1; p++) {\n    printf(\"%d \", a[p]);\n  }\n  for (q = 0; q < n2 - 1; q++) {\n    printf(\"%d \", b[q]);\n  }\n  printf(\"%d\", b[n2 - 1]);\n}\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  f(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint la, lb;\n\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d\", &la, &lb);\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[]) {\n  int i;\n  int t;\n  for (i = 0; i < la - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n  for (i = 0; i < lb - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n}\n\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i < (la + lb); i++) {\n    if (i != (la + lb - 1))\n      printf(\"%d \", a[i]);\n    else\n      printf(\"%d\", a[i]);\n  }\n}\n\nint main() {\n  int x[200], y[100];\n  read(x, y);\n\n  sort(x, y);\n\n  combine(x, y);\n  print(x);\n  return 0;\n}\n"}
{"label": "8", "index": "14537", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sort1(int str1[], int m)\n\n{\n  int t, i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (str1[j] > str1[j + 1]) {\n        t = str1[j];\n        str1[j] = str1[j + 1];\n        str1[j + 1] = t;\n      }\n    }\n  }\n}\nvoid sort2(int str2[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (str2[j] > str2[j + 1]) {\n        t = str2[j];\n        str2[j] = str2[j + 1];\n        str2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid order(int str1[], int str2[], int m, int n) {\n  int i;\n\n  for (i = m; i < m + n; i++)\n    str1[i] = str2[i - m];\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", str1[i]);\n  }\n  printf(\"%d\", str1[m + n - 1]);\n}\nint main() {\n  int str1[30], str2[30];\n  int i, m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &str1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &str2[i]);\n  sort1(str1, m);\n  sort2(str2, n);\n  order(str1, str2, m, n);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "14538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000], b[10000];\nint A, B;\nvoid read() {\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    cin >> a[i];\n  for (i = 0; i < B; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j, temp;\n  for (i = 0; i < A - 1; i++)\n    for (j = i + 1; j < A; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < B - 1; i++)\n    for (j = i + 1; j < B; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n}\nvoid conbine() {\n  int i;\n  for (i = 0; i < A; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < B - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[B - 1];\n}\n\nint main() {\n  read();\n  sort();\n  conbine();\n  return 0;\n}\n"}
{"label": "8", "index": "14539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b, c[20], d[20], s[20], l, i, j;\nvoid shuru() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint shuchu(int s[]) {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", s[i]);\n  cout << s[a + b - 1];\n  return 0;\n}\nint paixu(int f[], int k) {\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (f[j] >= f[j + 1]) {\n        l = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = l;\n      }\n  return 0;\n}\nint hebing(int c[], int d[]) {\n  for (i = 0; i < a; i++)\n    s[i] = c[i];\n  for (i = a; i < b + a; i++)\n    s[i] = d[i - a];\n  return 0;\n}\nint main() {\n  shuru();\n  paixu(c, a);\n  paixu(d, b);\n  hebing(c, d);\n  shuchu(s);\n  return 0;\n}\n"}
{"label": "8", "index": "14540", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[500], b[200], temp;\nvoid read(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid rank_1(void) {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid merge(void) {\n  for (int i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid show(void) {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n - 1];\n}\n\nint main(void) {\n  read();\n  rank_1();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[200];\n\nint main() {\n  void to(int a[], int b[], int n, int m);\n  void hebing(int a[], int b[], int n, int m);\n  void print(int c[], int n, int m);\n  int n, m, a[100], b[100], i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  to(a, b, n, m);\n  hebing(a, b, n, m);\n  print(c, n, m);\n}\n\nvoid to(int a[], int b[], int n, int m) {\n  int t, u, s, f, e, p;\n  for (t = 0; t < n - 1; t++) {\n    for (u = t + 1; u < n; u++) {\n      if (a[t] > a[u]) {\n        s = a[t];\n        a[t] = a[u];\n        a[u] = s;\n      }\n    }\n  }\n  for (f = 0; f < m - 1; f++) {\n    for (e = f + 1; e < m; e++) {\n      if (b[f] > b[e]) {\n        p = b[f];\n        b[f] = b[e];\n        b[e] = p;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < m; i++) {\n    c[n + i] = b[i];\n  }\n}\nvoid print(int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\\n\", c[n + m - 1]);\n}\n"}
{"label": "8", "index": "14542", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[2] = {0}, a[2][100] = {0}, i, j, t, m;\n  scanf(\"%d %d \", &length[0], &length[1]);\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < length[i]; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < 2; i++)\n    for (m = 1; m < length[i]; m++)\n      for (j = 0; j < length[i] - m; j++)\n        if (a[i][j] > a[i][j + 1]) {\n          t = a[i][j];\n          a[i][j] = a[i][j + 1];\n          a[i][j + 1] = t;\n        }\n  for (j = 0; j < length[0]; j++)\n    cout << a[0][j] << \" \";\n  printf(\"%d\", a[1][0]);\n  for (j = 1; j < length[1]; j++)\n    cout << \" \" << a[1][j];\n  return 0;\n}\n"}
{"label": "8", "index": "14543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int p, int n) {\n  int i, j;\n  int a[100];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (a[j] < a[j - 1]) {\n        a[j - 1] = a[j] + a[j - 1];\n        a[j] = a[j - 1] - a[j];\n        a[j - 1] = a[j - 1] - a[j];\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  if (p > 0)\n    printf(\" \");\n}\nint main() {\n  int i, n1, n2;\n  cin >> n1 >> n2;\n  f(1, n1);\n  f(0, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n1, n2;\nint num1[100], num2[100];\nint out[200];\n\nvoid p1(void) {\n  int i;\n\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    cin >> num1[i];\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &num2[i]);\n  }\n}\n\nvoid p2(int num1[100], int num2[100], int n1, int n2) {\n  int i, j, tmp;\n\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tmp = num1[j];\n        num1[j] = num1[i];\n        num1[i] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tmp = num2[j];\n        num2[j] = num2[i];\n        num2[i] = tmp;\n      }\n    }\n  }\n}\n\nvoid p3(int num1[100], int num2[100], int n1, int n2) {\n\n  int i = 0, j = 0;\n  while (i < n1) {\n    out[i] = num1[i];\n    i++;\n  }\n  while (j < n2) {\n    out[n1 + j] = num2[j];\n    j++;\n  }\n}\n\nvoid p4(int out[200], int n) {\n  int i;\n  printf(\"%d\", out[0]);\n  for (i = 1; i < n; i++) {\n    cout << \" \" << out[i];\n  }\n}\nint main() {\n  p1();\n  p2(num1, num2, n1, n2);\n  p3(num1, num2, n1, n2);\n  p4(out, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pai(int na, int nb);\n  int na, nb;\n  scanf(\"%d%d\", &na, &nb);\n  pai(na, nb);\n}\n\nvoid pai(int na, int nb) {\n  int t, i, j, a[200], b[100];\n  for (i = 0; i < na; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < nb; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  for (j = 0; j < na - 1; j++) {\n    for (i = 0; i < na - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < nb - 1; j++) {\n    for (i = 0; i < nb - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < na; j++)\n    printf(\"%d \", a[j]);\n  for (j = 0; j < nb - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\\n\", b[nb - 1]);\n}\n"}
{"label": "8", "index": "14546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int word1[100], word2[100];\n  int num1, num2;\n  scanf(\"%d %d\", &num1, &num2);\n  int i;\n  for (i = 0; i < num1; i++)\n    cin >> word1[i];\n\n  printf(\"\\n\");\n  for (i = 0; i < num2; i++) {\n    cin >> word2[i];\n  }\n  printf(\"\\n\");\n  int j, k, temp;\n  for (j = 1; j <= num1 * num1; j++) {\n    for (k = 0; k < num1 - 1; k++) {\n      if (word1[k] >= word1[k + 1]) {\n        temp = word1[k];\n        word1[k] = word1[k + 1];\n        word1[k + 1] = temp;\n      }\n    }\n  }\n  for (j = 1; j <= num2 * num2; j++) {\n    for (k = 0; k < num2 - 1; k++) {\n      if (word2[k] >= word2[k + 1]) {\n        temp = word2[k];\n        word2[k] = word2[k + 1];\n        word2[k + 1] = temp;\n      }\n    }\n  }\n  int zjword[300], l;\n  for (l = 0; l < num1 + num2; l++) {\n    if (l < num1) {\n      zjword[l] = word1[l];\n    } else {\n      zjword[l] = word2[l - num1];\n    }\n  }\n  int m;\n  for (m = 0; m < num1 + num2; m++) {\n    if (m != num1 + num2 - 1)\n      printf(\"%d \", zjword[m]);\n    else\n      printf(\"%d\", zjword[m]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14547", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k1, k2, a[100], b[100], i, j, c;\n  cin >> k1 >> k2;\n  for (i = 0; i <= k1 - 1; ++i) {\n    cin >> a[i];\n  }\n  for (i = 0; i <= k2 - 1; ++i) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i <= k1 - 2; ++i) {\n    for (j = i + 1; j <= k1 - 1; ++j) {\n      if (a[i] > a[j]) {\n        c = a[j];\n        a[j] = a[i];\n        a[i] = c;\n      }\n    }\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[k1 - 1]);\n  for (i = 0; i <= k2 - 2; ++i) {\n    for (j = i + 1; j <= k2 - 1; ++j) {\n      if (b[i] > b[j]) {\n        c = b[j];\n        b[j] = b[i];\n        b[i] = c;\n      }\n    }\n    printf(\" %d\", b[i]);\n  }\n  printf(\" %d\", b[k2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int m, int a[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid arrange(int m, int a[100]) {\n  int i, j, c;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n}\nvoid puttogether(int a, int b, int m[2][100]) {\n  int i;\n  for (i = 0; i < b; i++) {\n    m[0][a + i] = m[1][i];\n  }\n}\nvoid output(int a, int m[100]) {\n  int i;\n  cout << m[0];\n  for (i = 1; i < a; i++)\n    cout << \" \" << m[i];\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int number[2][100];\n  input(a, number[0]);\n  input(b, number[1]);\n  arrange(a, number[0]);\n  arrange(b, number[1]);\n  puttogether(a, b, number);\n  output(a + b, number[0]);\n  cin >> a;\n  return 0;\n}\n"}
{"label": "8", "index": "14549", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, a1[10000], a2[10000], a3[20000];\n\nvoid input(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\n\nvoid sort(void) {\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - i - 1; j++) {\n      if (a1[j] > a1[j + 1]) {\n        int temp = a1[j + 1];\n        a1[j + 1] = a1[j];\n        a1[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - i - 1; j++) {\n      if (a2[j] > a2[j + 1]) {\n        int temp = a2[j + 1];\n        a2[j + 1] = a2[j];\n        a2[j] = temp;\n      }\n    }\n  }\n}\n\nvoid joint(void) {\n  for (int i = 0; i < n1; i++) {\n    a3[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    a3[n1 + i] = a2[i];\n  }\n}\n\nvoid display(void) {\n  cout << a3[0];\n  for (int i = 1; i < n1 + n2; i++) {\n    printf(\" %d\", a3[i]);\n  }\n  cout << endl;\n}\n\nint main() {\n  input();\n  sort();\n  joint();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "14550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[2][5000], b[2], k;\nvoid ppt(int k) {\n  for (int i = 0; i < b[k] - 1; i++)\n    for (int j = 0; j < b[k] - 1 - i; j++)\n      if (a[k][j] > a[k][j + 1]) {\n        int tr;\n        tr = a[k][j];\n        a[k][j] = a[k][j + 1];\n        a[k][j + 1] = tr;\n      }\n}\n\nint main() {\n  cin >> b[0] >> b[1];\n  for (k = 0; k <= 1; k++) {\n    for (int m = 0; m < b[k]; m++)\n      scanf(\"%d \", &a[k][m]);\n    ppt(k);\n    for (int m = 0; m < b[k]; m++) {\n      if (k == 0 && m == 0)\n        cout << a[k][m];\n      else\n        cout << \" \" << a[k][m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint n_a, n_b;\nvoid input();\nvoid sort();\nvoid output();\nint main() {\n  input();\n  sort();\n  output();\n  return 0;\n}\nvoid input() {\n  int i;\n  cin >> n_a >> n_b;\n  for (i = 0; i < n_a; i++)\n    cin >> a[i];\n  for (i = 0; i < n_b; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n_a - 1; i++) {\n    for (j = i + 1; j < n_a; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n_b - 1; i++) {\n    for (j = i + 1; j < n_b; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n_a; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n_b; i++) {\n    printf(\"%d\", b[i]);\n    if (i < n_b - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint x, y;\nint print() {\n  cout << \" \";\n  return 0;\n}\nvoid order(int n) {\n  int i, j, temp = 0;\n  int a[10];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j + 1] < a[j]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n\n  cout << a[n - 1];\n}\nint main() {\n  cin >> x >> y;\n  order(x);\n  print();\n  order(y);\n  return 0;\n}\n"}
{"label": "8", "index": "14553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sort(int *p, int n);\n  int n1, n2, a[50], b[50], i;\n  int *pa, *pb;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  pa = &a[0];\n  pb = &b[0];\n  sort(pa, n1);\n  sort(pb, n2);\n  for (i = 0; i < n1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n2 - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\\n\", b[n2 - 1]);\n  return 0;\n}\n\nvoid sort(int *p, int n) {\n  int i, j, temp;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        temp = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = temp;\n      }\n    }\n}\n"}
{"label": "8", "index": "14554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid duqu(int a[], int b[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int a[], int b[], int M, int N) {\n  int i = 0, j = 0, temp;\n  for (i = 0; i < M; i++)\n    for (j = i; j < M; j++) {\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (i = 0; i < N; i++)\n    for (j = i; j < N; j++) {\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n    }\n}\n\nvoid hebing(int a[], int b[], int c[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = M; i < M + N; i++)\n    c[i] = b[i - M];\n}\nvoid shuchu(int C[], int M, int N) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", C[i]);\n  cout << C[M + N - 1];\n}\n\nint main() {\n  int m, n;\n  int a1[100], a2[100], a3[100] = {0};\n  scanf(\"%d%d\", &m, &n);\n  duqu(a1, a2, m, n);\n  paixu(a1, a2, m, n);\n  hebing(a1, a2, a3, m, n);\n  shuchu(a3, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid o(int n) {\n  int a[n];\n  int i = 0, j = 0, x;\n  while (i < n) {\n    scanf(\"%d \", &a[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    while (j < n - 1) {\n      if (a[j] > a[j + 1])\n        x = a[j], a[j] = a[j + 1], a[j + 1] = x;\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  j = 0;\n  while (j < n) {\n    printf(\"%d\", a[j]);\n    if (j < n - 1)\n      printf(\" \");\n    j++;\n  }\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  o(m);\n  printf(\" \");\n  o(n);\n}\n"}
{"label": "8", "index": "14556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[999] = {0}, b[999] = {0}, c[1999] = {0};\nint m, n;\nvoid f() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank_1() {\n  int i, j, k;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\nvoid print() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  f();\n  rank_1();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14557", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int p, int n) {\n  int i, j;\n  int a[100];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (a[j] < a[j - 1]) {\n        a[j - 1] = a[j] + a[j - 1];\n        a[j] = a[j - 1] - a[j];\n        a[j - 1] = a[j - 1] - a[j];\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  if (p > 0)\n    printf(\" \");\n}\nint main() {\n  int i, n1, n2;\n  cin >> n1 >> n2;\n  f(1, n1);\n  f(0, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int *p, int *q, int *n, int *m) {\n  int *x;\n  scanf(\"%d %d\", n, m);\n  x = p + *n;\n  for (; p < x; p++)\n    scanf(\"%d\", p);\n  x = q + *m;\n  for (; q < x; q++)\n    scanf(\"%d\", q);\n}\n\nvoid sort(int *p, int n) {\n  int x, i, j, k;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (*(p + j) < *(p + k))\n        k = j;\n    if (k != i) {\n      x = *(p + i);\n      *(p + i) = *(p + k);\n      *(p + k) = x;\n    }\n  }\n}\n\nvoid copy(int *p, int *q, int x[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++, p++)\n    x[i] = *p;\n  for (; i < n + m; i++, q++)\n    x[i] = *q;\n}\n\nvoid output(int *p, int n) {\n  int *y;\n  y = p + n - 1;\n  printf(\"%d\", *p);\n  p++;\n  for (; p <= y; p++)\n    cout << \" \" << *p;\n}\n\nint main() {\n  int i, a[100], b[100], c[200], x, y, *n, *m;\n  n = &x;\n  m = &y;\n  input(a, b, n, m);\n  sort(a, x);\n  sort(b, y);\n  copy(a, b, c, x, y);\n  output(c, x + y);\n  return 0;\n}\n"}
{"label": "8", "index": "14559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[100], d[100];\nvoid size() { cin >> a >> b; }\nvoid num(int s, int j[]) {\n  int i;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &j[i]);\n  }\n}\nvoid arrange(int s, int j[]) {\n  int i, k, temp;\n  for (k = 0; k < s - 1; k++) {\n    for (i = 0; i < s - k - 1; i++) {\n      if (j[i + 1] <= j[i]) {\n        temp = j[i];\n        j[i] = j[i + 1];\n        j[i + 1] = temp;\n      }\n    }\n  }\n}\nvoid plus_1(int x, int m[], int y, int n[]) {\n  int i;\n  arrange(x, m);\n  arrange(y, n);\n  printf(\"%d\", m[0]);\n  for (i = 1; i < x; i++) {\n    printf(\" %d\", m[i]);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", n[i]);\n  }\n}\nint main() {\n  size();\n  num(a, c);\n  num(b, d);\n  plus_1(a, c, b, d);\n}\n"}
{"label": "8", "index": "14560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[1000], b[1000], c[2000];\nvoid f1(void) {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(void) {\n  int i, j, p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(void) {\n  int i, count = 0;\n  for (i = 0; i < n + m; i++) {\n    if (count == 0) {\n      printf(\"%d\", c[i]);\n      count++;\n    } else\n      printf(\" %d\", c[i]);\n  }\n  cout << \"\\n\";\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14561", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid guochen(int array[], int n) {\n  int a, i, j;\n  for (a = 0; a < n; a++)\n    scanf(\"%d \", &array[a]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[i]) {\n        int k;\n        k = array[i];\n        array[i] = array[j];\n        array[j] = k;\n      }\n    }\n  }\n}\nvoid shuchu(int one[], int n, int two[], int m) {\n  int i, j;\n  printf(\"%d\", one[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", one[i]);\n  for (j = 0; j < m; j++)\n    printf(\" %d\", two[j]);\n}\nint main() {\n  int n, m, one[100], two[100];\n  scanf(\"%d %d\", &n, &m);\n  guochen(one, n);\n  guochen(two, m);\n  shuchu(one, n, two, m);\n}\n"}
{"label": "8", "index": "14562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint i, m, n, a[1000], b[1000], c;\nvoid f(int a[1000], int m) {\n  for (i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  f(a, m);\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  cout << \" \";\n  f(b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14563", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100];\nvoid insert(void) {\n  int i = 0;\n  scanf(\"%d%d\", &m, &n);\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"\\n\");\n  for (i = m; i < m + n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n}\nvoid px(int *p) {\n  int i, j, b = 0;\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  for (i = m; i < m + n; i++) {\n    for (j = m + n - 1; j > i; j--) {\n      if (*(p + j) < *(p + j - 1)) {\n        b = *(p + j);\n        *(p + j) = *(p + j - 1);\n        *(p + j - 1) = b;\n      }\n    }\n  }\n  printf(\"%d\", *(p + 0));\n  for (i = 1; i < m + n; i++) {\n    printf(\" %d\", *(p + i));\n  }\n}\nint main() {\n  insert();\n  px(a);\n}\n"}
{"label": "8", "index": "14564", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000];\nint b[1000];\nint m, n;\nvoid init() \n{\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid s() \n{\n  sort(a, a + m + 1);\n  sort(b, b + n + 1);\n}\nvoid merge() \n{\n  int i;\n  for (i = 1; i <= n; i++)\n    a[i + m] = b[i];\n}\nvoid print() \n{\n  int i;\n  for (i = 1; i <= m + n; i++) {\n    cout << a[i];\n    if (i < m + n)\n      cout << ' ';\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  s();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14565", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n  return 0;\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14566", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i, j;\nint m, n;\nint main() {\n  int a[100], b[50];\n\n  void read(int a[], int b[]);\n  void rank(int a[], int b[]);\n  void link(int a[], int b[]);\n  void output(int a[]);\n\n  read(a, b);\n  rank(a, b);\n  link(a, b);\n  output(a);\n}\nvoid read(int a[], int b[]) {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank(int a[], int b[]) {\n  int t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[]) {\n  for (i = 0, j = m; i < n; i++, j++) {\n    a[j] = b[i];\n  }\n}\nvoid output(int a[]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", a[i]);\n    printf(\"%c\", (i < m + n - 1) ? ' ' : '\\n');\n  }\n}\n"}
{"label": "8", "index": "14567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int k1, k2, a[100], b[100], i, j, c;\n  scanf(\"%d%d\", &k1, &k2);\n  for (i = 0; i <= k1 - 1; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= k2 - 1; ++i) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i <= k1 - 2; ++i) {\n    for (j = i + 1; j <= k1 - 1; ++j) {\n      if (a[i] > a[j]) {\n        c = a[j];\n        a[j] = a[i];\n        a[i] = c;\n      }\n    }\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[k1 - 1]);\n  for (i = 0; i <= k2 - 2; ++i) {\n    for (j = i + 1; j <= k2 - 1; ++j) {\n      if (b[i] > b[j]) {\n        c = b[j];\n        b[j] = b[i];\n        b[i] = c;\n      }\n    }\n    printf(\" %d\", b[i]);\n  }\n  printf(\" %d\", b[k2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[i]);\n}\nint main() {\n  int m, n, i;\n  int a[50], b[50];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, m);\n  cout << \" \";\n  order(b, n);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "14569", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    cin >> array[i];\n  }\n  scanf(\"%d\\n\", &array[n - 1]);\n}\nvoid order(int array[], int n) {\n  int i, o, e;\n  for (i = 0; i <= n - 2; i++) {\n    for (o = i + 1; o <= n - 1; o++) {\n      if (array[i] > array[o]) {\n        e = array[i];\n        array[i] = array[o];\n        array[o] = e;\n      }\n    }\n  }\n}\nvoid output(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d \", array[i]);\n  }\n  printf(\"%d\", array[n - 1]);\n}\nint main() {\n  int a[20], b[20], q, w;\n  scanf(\"%d %d\\n\", &q, &w);\n  input(a, q);\n  input(b, w);\n  order(a, q);\n  order(b, w);\n  output(a, q);\n  printf(\" \");\n  output(b, w);\n}\n"}
{"label": "8", "index": "14570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, a[100], b[100], c[200];\nvoid f1() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\n\nvoid f2(int k[], int l) {\n  int i, j, t;\n  for (i = 0; i < l - 1; i++)\n    for (j = i; j < l; j++)\n      if (k[i] > k[j]) {\n        t = k[i];\n        k[i] = k[j];\n        k[j] = t;\n      }\n}\n\nvoid f3() {\n  f2(a, m);\n  f2(b, n);\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid f4() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  f1();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[1000], b[1000];\nvoid init() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        int t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        int t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid combine() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid print() {\n  for (int i = 0; i < m + n; i++) {\n    if (i)\n      cout << ' ';\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14572", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint *p1 = a, *p2 = b;\nint m, n;\nint *p2m = &m, *p2n = &n;\n\nvoid funcofa(int *p1, int *p2, int *p2m, int *p2n) {\n  scanf(\"%d%d\", p2m, p2n);\n  int i;\n  for (i = 1; i <= *p2m; i++)\n    scanf(\"%d\", p1 + i - 1);\n\n  for (i = 1; i <= *p2n; i++) {\n    scanf(\"%d\", p2 + i - 1);\n  }\n}\n\nvoid funcofb(int *p1, int *p2, int *p2m, int *p2n) {\n  int i, j;\n  int temp;\n  for (i = 1; i <= *p2m; i++) {\n    for (j = 1; j < *p2m; j++) {\n      if (*(p1 + j - 1) > *(p1 + j)) {\n        temp = *(p1 + j);\n        *(p1 + j) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n  for (i = 1; i <= *p2n; i++) {\n    for (j = 1; j < *p2n; j++) {\n      if (*(p2 + j - 1) > *(p2 + j)) {\n        temp = *(p2 + j);\n        *(p2 + j) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      } else {\n      }\n    }\n  }\n}\n\nvoid funcofc(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  for (i = 1; i <= *p2n; i++) {\n    *(p1 + (*p2m) + i - 1) = *(p2 + i - 1);\n  }\n}\n\nvoid funcofd(int *p1, int *p2, int *p2m, int *p2n) {\n  int i;\n  printf(\"%d\", *p1);\n  for (i = 2; i <= *p2m + *p2n; i++) {\n    printf(\" %d\", *(p1 - 1 + i));\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  funcofa(p1, p2, p2m, p2n);\n  funcofb(p1, p2, p2m, p2n);\n  funcofc(p1, p2, p2m, p2n);\n  funcofd(p1, p2, p2m, p2n);\n}\n"}
{"label": "8", "index": "14573", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[5000], b[5000], N1, N2, c[10000];\nint f1() {\n  int n;\n  scanf(\"%d%d\", &N1, &N2);\n  for (n = 0; n <= N1 - 1; n++)\n    cin >> a[n];\n\n  for (n = 0; n <= N2 - 1; n++) {\n    scanf(\"%d\", &b[n]);\n  }\n  return 0;\n}\nint f2() {\n  int i, j, t;\n  for (i = 1; i <= N1 - 1; i++) {\n    for (j = 0; j <= N1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= N2 - 1; i++) {\n    for (j = 0; j <= N2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint f3() {\n  int i, j;\n  for (i = 0; i <= N1 - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = N1, j = 0; i <= N1 + N2 - 1; i++, j++) {\n    c[i] = b[j];\n  }\n  return 0;\n}\nint f4() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= N1 + N2 - 1; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint readin(int n, int *a);\nint px(int n, int *a);\nint sc(int n1, int *a, int n2, int *b);\n\nint t, i, j, a[1000], b[1000];\n\nint main() {\n  int n1, n2;\n  scanf(\"%d %d \", &n1, &n2);\n  readin(n1, a);\n  px(n1, a);\n  readin(n2, b);\n  px(n2, b);\n  sc(n1, a, n2, b);\n  return 0;\n}\nint readin(int n, int *a) {\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n}\nint px(int n, int *a) {\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\nint sc(int n1, int *a, int n2, int *b) {\n  for (int i = 1; i <= n1; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i <= n2 - 1; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\", b[n2]);\n}\n"}
{"label": "8", "index": "14575", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10000], b[10000];\nint sizea, sizeb;\nvoid read() {\n  cin >> sizea >> sizeb;\n  int i;\n  for (i = 0; i <= sizea - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= sizeb - 1; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid order(int n, int a[]) {\n  int i, j;\n  int temp;\n  for (i = n - 1; i >= 1; i--)\n    for (j = 0; j <= i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid paixu() {\n  order(sizea, a);\n  order(sizeb, b);\n}\nvoid mix() {\n  int i;\n  for (i = 0; i <= sizeb - 1; i++)\n    a[sizea + i] = b[i];\n}\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i <= sizea + sizeb - 1; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  read();\n  paixu();\n  mix();\n  print();\n}\n"}
{"label": "8", "index": "14576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101];\n  int b[101];\n  int m, n, i, j, k, l, w, x, y, z, c, d;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < m - 1; k++) {\n    for (l = 0; l < m - 1 - k; l++) {\n      if (a[l] > a[l + 1]) {\n        c = a[l];\n        a[l] = a[l + 1];\n        a[l + 1] = c;\n      }\n    }\n  }\n  for (w = 0; w < n - 1; w++) {\n    for (x = 0; x < n - 1 - w; x++) {\n      if (b[x] > b[x + 1]) {\n        d = b[x];\n        b[x] = b[x + 1];\n        b[x + 1] = d;\n      }\n    }\n  }\n  for (y = 0; y < m - 1; y++) {\n    cout << a[y] << \" \";\n  }\n  printf(\"%d\", a[m - 1]);\n  for (z = 0; z < n; z++)\n    printf(\" %d\", b[z]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[200], i, j, la, lb, p;\nint main() {\n  void canf();\n  void px();\n  void lj();\n  void rintf();\n  canf();\n  px();\n  lj();\n  rintf();\n}\n\nvoid canf() {\n  scanf(\"%d%d\", &la, &lb);\n  for (i = 0; i <= la - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= lb - 1; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid px() {\n  for (i = 0; i <= la - 2; i++) {\n    for (j = i + 1; j <= la - 1; j++)\n      if (a[j] < a[i]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n  }\n  for (i = 0; i <= lb - 2; i++) {\n    for (j = i + 1; j <= lb - 1; j++)\n      if (b[j] < b[i]) {\n        p = b[i];\n        b[i] = b[j];\n        b[j] = p;\n      }\n  }\n}\n\nvoid lj() {\n  for (i = 0; i <= la - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = la; i <= la + lb - 1; i++)\n    c[i] = b[i - la];\n}\n\nvoid rintf() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= la + lb - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[50], b[50], e[100];\nint c, d;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid change() {\n  int i, j, t;\n  for (j = 0; j < c - 1; j++) {\n    for (i = 0; i < c - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < d - 1; j++) {\n\n    for (i = 0; i < d - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid to() {\n  int i;\n  for (i = 0; i < c; i++) {\n    e[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    e[i + c] = b[i];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < (c + d) - 1; i++) {\n    printf(\"%d \", e[i]);\n  }\n  printf(\"%d\", e[c + d - 1]);\n}\nint main() {\n  input();\n  change();\n  to();\n  output();\n}\n"}
{"label": "8", "index": "14579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid car() {\n  int n, m, i = 0, a[100], b[100];\n  cin >> n >> m;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[i]);\n  return;\n}\n\nint main() {\n  car();\n  return 0;\n}\n"}
{"label": "8", "index": "14580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int a[], int m) {\n  int i, j, d;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        d = a[i];\n        a[i] = a[j];\n        a[j] = d;\n      }\n    }\n  }\n  return;\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return;\n}\n\nint main() {\n  int m, n, a[100], b[100], i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1) {\n      cout << \" \";\n    }\n  }\n}\n"}
{"label": "8", "index": "14582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], n, m, c[1000];\nvoid input(int a[], int b[]) {\n  int i, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j <= m - 1; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid charge(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= m - 2; i++) {\n    for (j = i + 1; j <= m - 1; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid hook(int a[], int b[]) {\n  int i, j;\n  for (i = n, j = 0; i <= n + m - 1; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i <= m + n - 2; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n - 1]);\n}\nint main() {\n  input(a, b);\n  charge(a, b);\n  hook(a, b);\n  print(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid scan_(int m, int *a, int n, int *b);\nvoid sort_(int m, int *a, int n, int *b);\nvoid print_(int m, int *a, int n, int *b);\n\nint main() {\n  int m, n, *a, *b;\n  scanf(\"%d %d\", &m, &n);\n  a = (int *)malloc(m * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  scan_(m, a, n, b);\n  sort_(m, a, n, b);\n  print_(m, a, n, b);\n  return 0;\n}\n\nvoid scan_(int m, int *a, int n, int *b) {\n  int i, j, *p; \n\n  p = a;\n  for (i = 0; i < m; i++) \n    scanf(\"%d\", p++);\n  p = b;\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", p++);\n}\n\nvoid sort_(int m, int *a, int n, int *b) {\n  int i, j, t, *q;\n  for (i = 0; i < m - 1; i++) {\n    q = a;\n    for (j = 0; j < m - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    q = b;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n}\n\nvoid print_(int m, int *a, int n, int *b) {\n  int i, *p;\n  printf(\"%d\", *a);\n  p = a + 1;\n  for (i = 1; i < m; i++, p++)\n    printf(\" %d\", *p);\n  p = b;\n  for (i = 0; i < n; i++, p++)\n    printf(\" %d\", *p);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, a[100] = {0}, b[100] = {0};\nvoid got() {\n  cin >> m >> n;\n  int i = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid f(int a[], int b[]) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid plus(int a[], int b[]) {\n  for (int i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\nvoid shu(int a[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i == m + n - 1)\n      cout << a[i];\n    else\n      cout << a[i] << \" \";\n  }\n}\nint main() {\n  got();\n  f(a, b);\n  for (int i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < n; i++) {\n    if (i != n - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "8", "index": "14585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shuru(int array[100], int x);\n  void paixu(int array[100], int x);\n  int i, m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid shuru(int array[100], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\nvoid paixu(int array[100], int x) {\n  int i, j, b;\n  for (j = 1; j < x; j++) {\n    for (i = 0; i < x - j; i++) {\n      if (array[i] > array[i + 1]) {\n        b = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = b;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "14586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[500] = {0}, b[500] = {0};\nvoid scanarray() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid shengxu(int x[], int len) {\n  int i, j, temp;\n  for (i = len - 1; i >= 0; i--) {\n    for (j = 0; j <= i - 1; j++) {\n      if (x[j] >= x[j + 1]) {\n        temp = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hebing(int x[], int y[], int lenx, int leny) {\n  int *p, *q;\n  for (p = x + lenx, q = y; q < y + leny; p++, q++) {\n    *p = *q;\n  }\n}\nvoid printarray(int x[], int len) {\n  int i;\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= len - 1; i++) {\n    printf(\" %d\", a[i]);\n  }\n  putchar('\\n');\n}\nint main() {\n  scanarray();\n  shengxu(a, m);\n  shengxu(b, n);\n  hebing(a, b, m, n);\n  printarray(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14587", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int c[], int x) {\n  int p;\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        p = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = p;\n      }\n    }\n}\nint main() {\n  int a[100], b[100];\n  int m, n, i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &b[j]);\n  f(a, m);\n  f(b, n);\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (j = 0; j < n - 1; j++)\n    cout << b[j] << ' ';\n  cout << b[j];\n  return 0;\n}\n"}
{"label": "8", "index": "14588", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000] = {0}, b[1000] = {0};\nvoid input() {\n  int i, n, m;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  a[0] = n;\n  b[0] = m;\n}\nvoid sort(int a[]) {\n  int i, j;\n  for (i = 1; i < a[0]; i++)\n    for (j = 1; j <= a[0] - i; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid output() {\n  int i;\n  for (i = 1; i <= a[0]; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i <= b[0] - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[b[0]];\n}\nint main() {\n  input();\n  sort(a);\n  sort(b);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14589", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s1[100], s2[100];\n  int m, n, i, t, j;\n\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> s1[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j + 1];\n        s1[j + 1] = s1[j];\n        s1[j] = t;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j + 1];\n        s2[j + 1] = s2[j];\n        ;\n        s2[j] = t;\n      }\n\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", s2[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, i;\nint a[100];\nint b[100];\nvoid passed(int x, int y) {\n  int j, t;\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i - j] < a[i - 1 - j]) {\n        t = a[i - j];\n        a[i - j] = a[i - 1 - j];\n        a[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < i; j++) {\n      if (b[i - j] < b[i - 1 - j]) {\n        t = b[i - j];\n        b[i - j] = b[i - 1 - j];\n        b[i - 1 - j] = t;\n      } else\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < y; i++)\n    printf(\" %d\", b[i]);\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  passed(n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m = 0, n = 0;\n\nvoid Get_In(int a[10000], int b[10000]) {\n  int i = 0, j = 0;\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &b[j]);\n}\n\nvoid Ranking(int a[10000], int l) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < (l - 1); i++) {\n    for (j = (i + 1); j < l; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid Combine(int a[10000], int b[10000]) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid Turn_Out(int a[10000]) {\n  int i = 0;\n  for (i = 0; i < (m + n); i++) {\n    if (i < (m + n - 1))\n      cout << a[i] << \" \";\n    else if (i == (m + n - 1))\n      cout << a[i] << endl;\n  }\n}\n\nint main() {\n  int a[10000], b[10000];\n  cin >> m >> n;\n  Get_In(a, b);\n  Ranking(a, m);\n  Ranking(b, n);\n  Combine(a, b);\n  Turn_Out(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; };\n\nint L1, L2;\nint ar1[1000], ar2[1000];\n\nvoid read_array();\nvoid sort_array();\nvoid merge_array();\nvoid show_array();\n\nint main() {\n  read_array();\n  sort_array();\n  merge_array();\n  show_array();\n  return 0;\n}\n\nvoid read_array() {\n  memset(ar1, 0, sizeof(ar1));\n  memset(ar2, 0, sizeof(ar2));\n\n  scanf(\"%d %d \", &L1, &L2);\n\n  for (int i = 0; i < L1; i++)\n    cin >> ar1[i];\n  for (int i = 0; i < L2; i++)\n    cin >> ar2[i];\n}\n\nvoid sort_array() {\n  qsort(ar1, L1, sizeof(int), cmp);\n  qsort(ar2, L2, sizeof(int), cmp);\n}\n\nvoid merge_array() {\n  for (int i = 0; i < L2; i++)\n    ar1[L1 + i] = ar2[i];\n}\n\nvoid show_array() {\n  for (int i = 0; i < L1 + L2; i++) {\n    cout << ar1[i];\n    if (i != L1 + L2 - 1)\n      cout << ' ';\n  }\n}\n"}
{"label": "8", "index": "14593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d %d\", &a, &b);\n  int c[100];\n  int d[100];\n  int i, t, r;\n  i = 0;\n  do {\n    scanf(\"%d\", &c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    cin >> d[i];\n    i++;\n  } while (i < b);\n  t = 0;\n  do {\n    i = 0;\n    while (i < a - 1 - t) {\n      if (c[i] > c[i + 1]) {\n        r = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < a - 1);\n  t = 0;\n  do {\n    i = 0;\n    while (i < b - 1 - t) {\n      if (d[i] > d[i + 1]) {\n        r = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = r;\n      }\n      i++;\n    }\n    t++;\n  } while (t < b - 1);\n  cout << c[0];\n  i = 1;\n  do {\n    printf(\" %d\", c[i]);\n    i++;\n  } while (i < a);\n  i = 0;\n  do {\n    printf(\" %d\", d[i]);\n    i++;\n  } while (i < b);\n  return 0;\n}\n"}
{"label": "8", "index": "14594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[2][11] = {0};\nint geshu1, geshu2;\nint hanshu1() {\n  int i;\n  cin >> geshu1 >> geshu2;\n  for (i = 0; i < geshu1; i++)\n    cin >> a[0][i];\n  for (i = 0; i < geshu2; i++)\n    cin >> a[1][i];\n  return 0;\n}\nint hanshu2() {\n  int i, j, k;\n  for (i = geshu1 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[0][j] > a[0][j + 1]) {\n        k = a[0][j];\n        a[0][j] = a[0][j + 1];\n        a[0][j + 1] = k;\n      }\n    }\n  }\n  for (i = geshu2 - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[1][j] > a[1][j + 1]) {\n        k = a[1][j];\n        a[1][j] = a[1][j + 1];\n        a[1][j + 1] = k;\n      }\n    }\n  }\n  return 0;\n}\nint hanshu3() {\n  int i;\n  for (i = 0; i < geshu2; i++)\n    a[0][geshu1 + i] = a[1][i];\n  return 0;\n}\nint hanshu4() {\n  int i;\n  printf(\"%d\", a[0][0]);\n  for (i = 1; i < geshu1 + geshu2; i++)\n    printf(\" %d\", a[0][i]);\n  return 0;\n}\nint main() {\n  hanshu1();\n  hanshu2();\n  hanshu3();\n  hanshu4();\n  return 0;\n}\n"}
{"label": "8", "index": "14595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[101], b[101], m, n;\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n  return (0);\n}\nint pai() {\n  int i, j, p;\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        p = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = p;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        p = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = p;\n      }\n    }\n  }\n  return (0);\n}\nint print() {\n  int i;\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i < n; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n]);\n  return (0);\n}\nint main() {\n  input();\n  pai();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint input(int n) {\n  cin >> n;\n  return n;\n}\nvoid paixu(int a[], int n) {\n  int i, j, p;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n    }\n  }\n}\nvoid add(int a[], int b[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1] << endl;\n}\nint main() {\n  int a[100], b[100], n1, n2, i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    a[i] = input(a[i]);\n  for (i = 0; i < n2; i++)\n    b[i] = input(b[i]);\n  paixu(a, n1);\n  paixu(b, n2);\n  add(a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n, m, a[1000], b[100];\n\nvoid scan(int *p1, int l1, int *p2, int l2) {\n  int i;\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &p1[i]);\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &p2[i]);\n}\n\nvoid paixu(int *p, int l) {\n  int t, i, j;\n  for (i = 1; i < l; i++)\n    for (j = 0; j < l - i; j++)\n      if (p[j] > p[j + 1]) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n}\n\nvoid hebing(int *p1, int l1, int *p2, int l2) {\n  int i;\n  for (i = l1; i < l1 + l2; i++)\n    p1[i] = p2[i - l1];\n}\n\nvoid print(int *p, int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    cout << p[i] << (i == l - 1) ? '\\n' : ' ';\n}\n\nint main() {\n  int i;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, n);\n  paixu(b, m);\n  hebing(a, n, b, m);\n  print(a, m + n);\n}\n"}
{"label": "8", "index": "14598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sort1(int str1[], int m) \n                              \n                              \n                              \n{\n  int t, i, j; \n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) \n    {\n      if (str1[j] > str1[j + 1]) {\n        t = str1[j];\n        str1[j] = str1[j + 1];\n        str1[j + 1] = t;\n      }\n    }\n  }\n  \n}\nvoid sort2(int str2[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (str2[j] > str2[j + 1]) {\n        t = str2[j];\n        str2[j] = str2[j + 1];\n        str2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid order(int str1[], int str2[], int m, int n) {\n  int i; \n  \n  \n  for (i = m; i < m + n; i++)\n    str1[i] = str2[i - m];\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", str1[i]);\n  }\n  printf(\"%d\", str1[m + n - 1]);\n}\nint main() {\n  int str1[30], str2[30];\n  int i, m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &str1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str2[i]);\n  sort1(str1, m); \n  sort2(str2, n);\n  order(str1, str2, m, n);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint n_a, n_b;\nvoid input();\nvoid sort();\nvoid output();\nint main() {\n  input();\n  sort();\n  output();\n  return 0;\n}\nvoid input() {\n  int i;\n  cin >> n_a >> n_b;\n  for (i = 0; i < n_a; i++)\n    cin >> a[i];\n  for (i = 0; i < n_b; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n_a - 1; i++) {\n    for (j = i + 1; j < n_a; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n_b - 1; i++) {\n    for (j = i + 1; j < n_b; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n_a; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n_b; i++) {\n    cout << b[i];\n    if (i < n_b - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid px(int a[100], int k) {\n  int i, j, b;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[k - 1]);\n}\nvoid fz() {\n  int m, n, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  px(a, n);\n  printf(\" \");\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  px(b, m);\n}\nint main() {\n  fz();\n  return 0;\n}\n"}
{"label": "8", "index": "14601", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, array1[100], array2[100], sa[100];\nvoid zp1(int a1[100], int l1) {\n  int cur1;\n  for (int i = 0; i < l1 - 1; i++)\n    for (int j = 0; j < l1 - 1 - i; j++)\n      if (a1[j] > a1[j + 1]) {\n        cur1 = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = cur1;\n      }\n}\nvoid zp2(int a2[100], int l2) {\n  int cur2;\n  for (int i = 0; i < l2 - 1; i++)\n    for (int j = 0; j < l2 - 1 - i; j++)\n      if (a2[j] > a2[j + 1]) {\n        cur2 = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = cur2;\n      }\n}\nvoid connection(int a1[100], int a2[100]) {\n  for (int i = 0; i < len1; i++)\n    sa[i] = array1[i];\n  for (int i = len1; i < len1 + len2; i++)\n    sa[i] = array2[i - len1];\n}\n\nint main() {\n\n  cin >> len1 >> len2;\n  for (int i = 0; i < len1; i++)\n    cin >> array1[i];\n  for (int i = 0; i < len2; i++)\n    cin >> array2[i];\n  zp1(array1, len1);\n  zp2(array2, len2);\n  connection(array1, array2);\n  printf(\"%d\", sa[0]);\n  for (int i = 1; i < len1 + len2; i++)\n    cout << \" \" << sa[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "8", "index": "14602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid mysort(int *pn, int n) {\n  int i, j;\n  int temp;\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (pn[j] > pn[i]) {\n        temp = pn[j];\n        pn[j] = pn[i];\n        pn[i] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *pn, int n, int *pm, int m) {\n  int i;\n  printf(\"%d\", pn[0]);\n  for (i = 1; i < n; i++) {\n    cout << \" \" << pn[i];\n  }\n  for (i = 0; i < m; i++) {\n    printf(\" %d\", pm[i]);\n  }\n}\nint main(int argc, char *argv[]) {\n  int m, n, i, *pm, *pn;\n  scanf(\"%d%d\", &m, &n);\n  pm = (int *)calloc(m, sizeof(int));\n  pn = (int *)calloc(n, sizeof(int));\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &(pm[i]));\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(pn[i]));\n  }\n\n  mysort(pm, m);\n  mysort(pn, n);\n  merge(pm, m, pn, n);\n\n  free(pm);\n  free(pn);\n  return 0;\n}\n"}
{"label": "8", "index": "14603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n, a[10000], b[10000];\nvoid input() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sequence() {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        int temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j - 1] > b[j]) {\n        int temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n}\nvoid combination() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid output() {\n  cout << a[0];\n  for (int i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n  cout << endl;\n}\nint main() {\n  input();\n  sequence();\n  combination();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14604", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int m, int n) {\n  int i, j, t, a[100], b[100], c = 0;\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &b[i]);\n  for (j = 0; j <= m - 2; j++) {\n    for (i = 0; i <= m - 2 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  }\n  for (j = 0; j <= n - 2; j++)\n    for (i = 0; i <= n - 2 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i <= m - 1; i++, c++) {\n    if (c)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\" %d\", b[i]);\n  printf(\"\\n\");\n  return (0);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  f(m, n);\n}\n"}
{"label": "8", "index": "14605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[102], b[102], c[202], m, n;\n\nvoid shuru() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, t;\n\n  for (i = 0; i < m; i++) {\n    for (j = m - 1; j > i; j--) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (b[j] < b[j - 1]) {\n        int t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n}\nvoid hebing() {\n  int i = 0, j = 0;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid xianshi() {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < n + m; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  xianshi();\n  return 0;\n}\n"}
{"label": "8", "index": "14606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int n, int a[]) {\n  int i, j, m;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\n\nint main() {\n  int i, k;\n  int n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n  paixu(n, a);\n  paixu(m, b);\n  link(a, b, c, n, m);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid changeplace(int n, int a[]) {\n  int i, j, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] >= a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nint main() {\n  int n1, n2, k;\n  scanf(\"%d%d\", &n1, &n2);\n  int *p = (int *)malloc(n1 * sizeof(int));\n  int *q = (int *)malloc(n2 * sizeof(int));\n  for (k = 0; k < n1; k++)\n    scanf(\"%d\", &p[k]);\n  for (k = 0; k < n2; k++)\n    scanf(\"%d\", &q[k]);\n  changeplace(n1, p);\n  changeplace(n2, q);\n  for (k = 0; k < n1; k++)\n    printf(\"%d \", p[k]);\n  for (k = 0; k < n2 - 1; k++)\n    printf(\"%d \", q[k]);\n  printf(\"%d\", q[n2 - 1]);\n}\n"}
{"label": "8", "index": "14608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, c[100], d[100], i, j, t;\nvoid c1() {\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid c2() {\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b; i++)\n    for (j = 0; j < b - i - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n    }\n}\nvoid c3() {\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n  for (i = 0; i < b - 1; i++)\n    printf(\"%d \", d[i]);\n  printf(\"%d\", d[b - 1]);\n}\nint main() {\n  c1();\n  c2();\n  c3();\n  return 0;\n}\n"}
{"label": "8", "index": "14609", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid input(int m, int a[100]) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid arrange(int m, int a[100]) {\n  int i, j, c;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n}\nvoid puttogether(int a, int b, int m[2][100]) {\n  int i;\n  for (i = 0; i < b; i++)\n    m[0][a + i] = m[1][i];\n}\nvoid output(int a, int m[100]) {\n  int i;\n  printf(\"%d\", m[0]);\n  for (i = 1; i < a; i++)\n    cout << \" \" << m[i];\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int number[2][100];\n  input(a, number[0]);\n  input(b, number[1]);\n  arrange(a, number[0]);\n  arrange(b, number[1]);\n  puttogether(a, b, number);\n  output(a + b, number[0]);\n  cin >> a;\n  return 0;\n}\n"}
{"label": "8", "index": "14610", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint p, q;\nvoid input() {\n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < q; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int a[100], int b[100]) {\n  int i = 0, j = 0;\n  int c;\n  for (i = 1; i <= p - 1; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  for (i = 1; i <= q - 1; i++) {\n    for (j = 0; j < q - i; j++) {\n      if (b[j] > b[j + 1]) {\n        c = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = c;\n      }\n    }\n  }\n}\nvoid connect(int a[100], int b[100]) {\n  for (int i = 0; i < q; i++) {\n    a[p + i] = b[i];\n  }\n}\nvoid output(int a[100]) {\n  int i = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < p + q; i++) {\n    cout << \" \" << a[i];\n  }\n}\nint main() {\n  input();\n  paixu(a, b);\n  connect(a, b);\n  output(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14611", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000];\nint b[1000];\nint m, n;\nvoid init() {\n  scanf(\"%d %d \", &m, &n);\n  int i, j;\n  for (i = 1; i <= m; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n}\n\nvoid s() {\n  sort(a, a + m + 1);\n  sort(b, b + n + 1);\n}\nvoid merge() {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[i + m] = b[i];\n}\nvoid print() {\n  int i;\n  for (i = 1; i <= m + n; i++) {\n    cout << a[i];\n    if (i < m + n)\n      cout << ' ';\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  s();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14612", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, b, c[100], d[100], i, j, t;\nvoid c1() {\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d \", &c[i]);\n  for (i = 0; i < b; i++)\n    cin >> d[i];\n}\nvoid c2() {\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b; i++)\n    for (j = 0; j < b - i - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n    }\n}\nvoid c3() {\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n  for (i = 0; i < b - 1; i++)\n    printf(\"%d \", d[i]);\n  printf(\"%d\", d[b - 1]);\n}\nint main() {\n  c1();\n  c2();\n  c3();\n  return 0;\n}\n"}
{"label": "8", "index": "14613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nvoid ccin(int m, int n);\nvoid turn(int c[1000], int t);\nvoid ccout(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  ccin(m, n);\n  turn(a, m);\n  turn(b, n);\n  ccout(m, n);\n  return 0;\n}\nvoid ccin(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid turn(int c[1000], int t) {\n  int i, j, k;\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1; j++)\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n}\nvoid ccout(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1] << endl;\n}\n"}
{"label": "8", "index": "14614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int au(int x, int y);\n  int x, y;\n  scanf(\"%d%d\", &x, &y);\n  au(x, y);\n  return 0;\n}\nint au(int x, int y) {\n  int a[100], b[100], i, j, m, n;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < y; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (i = 0; i < x; i++) {\n    for (m = 0; m < x - i - 1; m++) {\n      if (a[m] > a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < y; j++) {\n    for (n = 0; n < y - j - 1; n++) {\n      if (b[n] > b[n + 1]) {\n        int t = b[n];\n        b[n] = b[n + 1];\n        b[n + 1] = t;\n      }\n    }\n  }\n  for (m = x; m < x + y; m++) {\n    a[m] = b[m - x];\n  }\n  for (m = 0; m < x + y - 1; m++) {\n    printf(\"%d \", a[m]);\n  }\n  printf(\"%d\", a[x + y - 1]);\n}\n"}
{"label": "8", "index": "14615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstatic int m, n;\nint a[1000], b[1000], c[2000];\nvoid f1(int a[], int b[], int h, int k) {\n  int i;\n  cin >> h >> k;\n  m = h;\n  n = k;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  return;\n}\nvoid f2(int a[], int b[], int m, int n) {\n  int i, j, k;\n  for (j = m - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (a[i] > a[i + 1]) {\n        k = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = k;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] > b[i + 1]) {\n        k = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = k;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\nvoid f4(int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  f1(a, b, m, n);\n  f2(a, b, m, n);\n  f3(a, b, c, m, n);\n  f4(c, m, n);\n}\n"}
{"label": "8", "index": "14616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, t = 0;\n  int *a, *b;\n  scanf(\"%d %d\", &n, &m);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = t;\n      }\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint la = 0, lb = 0, l = 0, a[100], b[100], combine[200];\n\nvoid input();\nvoid seq();\nvoid sequence(int x[100]);\nvoid com(int a[100], int b[100]);\nvoid output(int combine[200]);\n\nint main() {\n  input();\n  seq();\n  com(a, b);\n  output(combine);\n  return 0;\n}\nvoid input() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid seq() {\n  l = la;\n  sequence(a);\n  l = lb;\n  sequence(b);\n}\nvoid sequence(int x[100]) {\n  int temp = 0;\n  for (int i = 1; i < l; i++)\n    for (int j = 1; j <= l - i; j++)\n      if (x[j - 1] > x[j]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n}\nvoid com(int a[100], int b[100]) {\n  memcpy(combine, a, la * 4);\n  memcpy(combine + la, b, lb * 4);\n}\nvoid output(int combine[200]) {\n  cout << combine[0];\n  for (int i = 1; i < la + lb; i++)\n    cout << \" \" << combine[i];\n}\n"}
{"label": "8", "index": "14618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid ipt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    if (i != n)\n      scanf(\" \");\n    i++;\n  }\n}\n\nvoid opt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      cout << \" \";\n    i++;\n  }\n}\n\nint main() {\n  int n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  ipt(a, n);\n  ipt(b, m);\n  sort(a, n);\n  sort(b, m);\n  opt(a, n);\n  cout << \" \";\n  opt(b, m);\n}\n"}
{"label": "8", "index": "14619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[100], n[100], *p, *q, a, b;\nvoid input() {\n  p = m;\n  q = n;\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++, p++) {\n    scanf(\"%d\", p);\n  }\n  for (i = 0; i < b; i++, q++)\n    scanf(\"%d\", q);\n\n  p = m;\n  q = n;\n}\nvoid sort(int *p, int a) {\n  int i, j, temp;\n  for (i = 0; i < a - 1; i++) {\n    for (j = 0; j < a - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid mix() {\n  int i;\n  for (i = 0; i < b; i++) {\n    p[a + i] = q[i];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < a + b - 1; i++) {\n    cout << *(p++) << \" \";\n  }\n  printf(\"%d \", *p);\n}\nint main() {\n  input();\n  sort(p, a);\n  sort(q, b);\n  mix();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int m, int a[100]) \n{\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid arrange(int m, int a[100]) \n{\n  int i, j, c;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n}\nvoid puttogether(int a, int b, int m[2][100]) \n{\n  int i;\n  for (i = 0; i < b; i++)\n    m[0][a + i] = m[1][i];\n}\nvoid output(int a, int m[100]) \n{\n  int i;\n  cout << m[0];\n  for (i = 1; i < a; i++)\n    cout << \" \" << m[i];\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int number[2][100];\n  input(a, number[0]);\n  input(b, number[1]);\n  arrange(a, number[0]);\n  arrange(b, number[1]);\n  puttogether(a, b, number);\n  output(a + b, number[0]);\n  cin >> a;\n  return 0;\n}\n"}
{"label": "8", "index": "14621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint x[100], y[100], c[200];\nint m, n;\nvoid scanf() {\n  scanf(\"%d %d\", &m, &n);\n  int i;\n  for (i = 0; i < m - 1; i++) {\n    scanf(\"%d \", &x[i]);\n  }\n  cin >> x[m - 1];\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &y[i]);\n  }\n  scanf(\"%d\\n\", &y[n - 1]);\n}\n\nvoid order() {\n  int j, i, b;\n  for (j = 0; j < m; j++) {\n    for (i = j; i < m; i++)\n      if (x[j] > x[i]) {\n        b = x[j];\n        x[j] = x[i];\n        x[i] = b;\n      }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = j; i < n; i++)\n      if (y[j] > y[i]) {\n        b = y[j];\n        y[j] = y[i];\n        y[i] = b;\n      }\n  }\n}\n\nvoid together() {\n  int s;\n\n  for (s = 0; s < m; s++) {\n    c[s] = x[s];\n  }\n\n  for (s = m; s < m + n; s++) {\n    c[s] = y[s - m];\n  }\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  scanf();\n  order();\n  together();\n  print();\n}\n"}
{"label": "8", "index": "14622", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nvoid get(int a[200], int b[200]) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sequence(int a[200], int p) {\n  int i, j, temp;\n  for (i = 0; i < p; i++)\n    for (j = i + 1; j < p; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n}\nvoid combine(int a[200], int p, int b[200], int q) {\n  int j;\n  for (j = 0; j < q; j++)\n    a[p + j] = b[j];\n}\nvoid show(int a[200], int p) {\n  int i;\n  for (i = 0; i < p - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[p - 1]);\n}\nint main() {\n  int a[200], b[200];\n  get(a, b);\n  sequence(a, m);\n  sequence(b, n);\n  combine(a, m, b, n);\n  show(a, m + n);\n}\n"}
{"label": "8", "index": "14623", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\n\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n\nvoid input(int *a, int *b) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n}\n\nvoid sort(int *a, int *b) {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge(int *a, int *b, int *c) {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\n\nvoid output(int *c) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d%s\", c[i], i < m + n - 1 ? \" \" : \"\\n\");\n  }\n}\nint main() {\n  int a[10000] = {0};\n  int b[10000] = {0};\n  int c[10000] = {0};\n  input(a, b);\n  sort(a, b);\n  merge(a, b, c);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i = 0, j = 0;\n  int t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int a[], int n, int b[], int m) {\n  int i = 0, j = 0;\n  while (i < n) {\n    printf(\"%d \", a[i]);\n    i++;\n  }\n  while (j < m - 1) {\n    printf(\"%d \", b[j]);\n    j++;\n  }\n  printf(\"%d\", b[m - 1]);\n}\nint main() {\n  void order(int a[], int n);\n  void print(int a[], int n, int b[], int m);\n  int x[20], y[20];\n  int n, m, i = 0, j = 0;\n  scanf(\"%d%d\", &n, &m);\n  while (i < n) {\n    scanf(\"%d\", &x[i]);\n    i++;\n  }\n  while (j < m) {\n    scanf(\"%d\", &y[j]);\n    j++;\n  }\n  order(x, n);\n  order(y, m);\n  print(x, n, y, m);\n}\n"}
{"label": "8", "index": "14625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid a();\nvoid b();\nvoid c();\nvoid d();\nint x1[1000], x2[499], n1, n2;\nint main() {\n\n  a();\n  b();\n  c();\n  d();\n\n  return 0;\n}\n\nvoid a() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &x1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &x2[i]);\n}\nvoid b() {\n  int i, j, p;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (x1[i] > x1[j]) {\n        p = x1[i];\n        x1[i] = x1[j];\n        x1[j] = p;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (x2[i] > x2[j]) {\n        p = x2[i];\n        x2[i] = x2[j];\n        x2[j] = p;\n      }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    x1[n1 + i] = x2[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    printf(\"%d\", x1[i]);\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint i, j, k, l, m, b[20], c[20];\nvoid f() { cin >> l >> k; }\nvoid g(int d[20], int s) {\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &d[i]);\n}\nvoid h(int a[20], int n, int p) {\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  if (p == 1)\n    printf(\"%d \", a[n - 1]);\n  if (p == 2)\n    printf(\"%d\\n\", a[n - 1]);\n}\nint main() {\n  f();\n  g(b, l);\n  g(c, k);\n  h(b, l, 1);\n  h(c, k, 2);\n}\n"}
{"label": "8", "index": "14627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[200] = {0}, b[200] = {0}, tem, *p, *q;\n  p = a;\n  q = b;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        tem = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = tem;\n      }\n    }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (*(q + j) > *(q + j + 1)) {\n        tem = *(q + j);\n        *(q + j) = *(q + j + 1);\n        *(q + j + 1) = tem;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "14628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint *p, *q, m, n;\nvoid shuru() {\n  scanf(\"%d%d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", q + i);\n}\nstatic int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid shuchu() {\n  for (int i = 0; i < m; i++)\n    printf(\"%d \", *(p + i));\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", *(q + i));\n  printf(\"%d\", *(q + n - 1));\n}\nint main() {\n  shuru();\n  qsort(p, m, sizeof(int), cmp);\n  qsort(q, n, sizeof(int), cmp);\n  shuchu();\n}\n"}
{"label": "8", "index": "14629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void print(int a[], int b[]);\n  int a[100], b[100];\n  print(a, b);\n  return 0;\n}\n\nvoid print(int a[100], int b[100]) {\n  int n, m, i, j, k, l = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i == m - 1)\n      break;\n    printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nvoid ccin(int m, int n);\nvoid turn(int c[1000], int t);\nvoid ccout(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  ccin(m, n);\n  turn(a, m);\n  turn(b, n);\n  ccout(m, n);\n  return 0;\n}\nvoid ccin(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid turn(int c[1000], int t) {\n  int i, j, k;\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n    }\n}\nvoid ccout(int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid mix(int m, int n);\nint main() {\n  int m, n;\n  cin >> m >> n;\n  mix(m, n);\n  return 0;\n}\nvoid mix(int m, int n) {\n  int i, j, a[10000], b[10000], t;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    cin >> b[i];\n  for (j = 1; j < m; j++) {\n    for (i = 1; i <= m - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 1; i <= n - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++)\n    cout << a[i] << \" \";\n  cout << b[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << b[i];\n}\n"}
{"label": "8", "index": "14632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid get_array(int a[]);\nint a[101];\nint main() { get_array(a); }\nvoid get_array(int a[]) {\n\n  int n1, n2;\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  cout << a[0];\n  for (int i = 1; i < n1; i++) {\n    cout << \" \" << a[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < n2; i++) {\n    printf(\" %d\", a[i]);\n  }\n  return;\n}\n"}
{"label": "8", "index": "14633", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint al = 0, bl = 0, i, j, k;\nvoid f1() {\n  cin >> al >> bl;\n  for (i = 0; i < al; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < bl; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < al - 1; i++) {\n    for (j = i; j < al; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < bl - 1; i++) {\n    for (j = i; j < bl; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < bl; i++) {\n    a[i + al] = b[i];\n  }\n}\nvoid f4() {\n  for (i = 0; i < al + bl - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[al + bl - 1];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid shuru(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid paixu(int b[], int m) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m], b[n];\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pai(int a[], int m);\nvoid shuru(int a[10], int b[10], int m, int n);\nvoid shuchu(int c[20], int m, int n);\nvoid hubing(int c[20], int a[10], int b[10], int m, int n);\nint main() {\n  int a[10], b[10], c[20];\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, b, m, n);\n  pai(a, m);\n  pai(b, n);\n  hubing(c, a, b, m, n);\n  shuchu(c, m, n);\n}\nvoid hubing(int c[20], int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\n\nvoid shuru(int a[10], int b[10], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"\\n\");\n}\nvoid shuchu(int c[20], int m, int n) {\n  int i;\n  for (i = 0; i < (m + n - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nvoid pai(int a[], int m) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid Do(int m, int n) {\n  int a[m], b[n];\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, m, 4, compare);\n  qsort(b, n, 4, compare);\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d \", b[n - 1]);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  Do(m, n);\n}\n"}
{"label": "8", "index": "14637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  long i, j, n, m, x, p = 0;\n  int a[100001] = {0};\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    a[x]++;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      if (p == 0) {\n        printf(\"%d\", i);\n        p = 1;\n      } else\n        printf(\" %d\", i);\n    a[i] = 0;\n  }\n  for (i = 1; i <= m; i++) {\n    cin >> x;\n    a[x] = 1;\n  }\n  for (i = 0; i <= 100000; i++) {\n    for (j = 1; j <= a[i]; j++)\n      printf(\" %d\", i);\n    a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], c, d;\nvoid kg();\nvoid m(int);\nvoid r();\nint main() {\n  r();\n  m(c);\n  kg();\n  m(d);\n}\nvoid r() { scanf(\"%d%d\", &c, &d); }\nvoid m(int s) {\n  int i, j, t;\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < s - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%d\", a[i]);\n    if (i < s - 1)\n      kg();\n  }\n}\nvoid kg() { printf(\" \"); }\n"}
{"label": "8", "index": "14639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint readin(int n, int *a);\nint px(int n, int *a);\nint sc(int n1, int *a, int n2, int *b);\n\nint t, i, j, a[1000], b[1000];\n\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  readin(n1, a);\n  px(n1, a);\n  readin(n2, b);\n  px(n2, b);\n  sc(n1, a, n2, b);\n  return 0;\n}\nint readin(int n, int *a) {\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n}\nint px(int n, int *a) {\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\nint sc(int n1, int *a, int n2, int *b) {\n  for (int i = 1; i <= n1; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i <= n2 - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[n2];\n}\n"}
{"label": "8", "index": "14640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *order(int *p, int k) {\n  int i, j;\n  int t = 0;\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (p[j] > p[j + 1]) {\n        t = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  return p;\n}\nint *merge(int *p, int *q, int m, int n) {\n  int i;\n  int *u = (int *)malloc((m + n) * sizeof(int));\n  for (i = 0; i < m; i++) {\n    u[i] = p[i];\n  }\n  for (i = 0; i < n; i++) {\n    u[m + i] = q[i];\n  }\n  return u;\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  a = order(a, m);\n  b = order(b, n);\n  int *p = merge(a, b, m, n);\n  printf(\"%d\", p[0]);\n  for (int i = 1; i < m + n; i++) {\n    printf(\" %d\", p[i]);\n  }\n}\n"}
{"label": "8", "index": "14641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int num[], int a[]) {\n  int j;\n  cin >> num[0] >> num[1];\n  for (j = 0; j < num[0] + num[1]; j++)\n    cin >> a[j];\n}\nvoid order(int num[], int a[]) {\n  int j, k, temp;\n  for (j = 0; j < num[0]; j++) {\n    for (k = num[0] - 1; k > 0; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n  for (j = num[0]; j < num[0] + num[1]; j++) {\n    for (k = num[0] + num[1] - 1; k > num[0]; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int num[], int a[]) {\n  int i;\n  for (i = 0; i < num[0] + num[1] - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[num[0] + num[1] - 1];\n}\nint main() {\n  int a[40], num[2];\n  input(num, a);\n  order(num, a);\n  print(num, a);\n}\n"}
{"label": "8", "index": "14642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint i = 0, n, m;\nvoid block_in() {\n  scanf(\"%d%d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid arr(int x, int c[]) {\n  int i = 0, j = 0, mid;\n  for (i = 0; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (c[j] > c[j + 1]) {\n        mid = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = mid;\n      }\n    }\n  }\n  for (i = 1; i <= x; i++) {\n    cout << c[i];\n    if (i < x)\n      printf(\" \");\n  }\n}\nint main() {\n  block_in();\n  arr(n, a);\n  printf(\" \");\n  arr(m, b);\n}\n"}
{"label": "8", "index": "14643", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[999];\n  int b[999];\n  int c[999] = {0};\n  int m, n, i, s;\n\n  void read(int arr_1[], int arr_2[], int x, int y);\n  void f(int arr_1[], int arr_2[], int x, int y);\n  void combine(int arr_1[], int arr_2[], int arr_3[], int x, int y);\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  f(a, b, m, n);\n  combine(a, b, c, m, n);\n  s = m + n;\n  for (i = 0; i < s; i++) {\n    if (i < s - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\\n\", c[i]);\n  }\n}\n\nvoid read(int arr_1[], int arr_2[], int x, int y) {\n  int i, j;\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &arr_1[i]);\n  for (j = 0; j <= y - 1; j++)\n    scanf(\"%d\", &arr_2[j]);\n}\n\nvoid f(int arr_1[], int arr_2[], int x, int y) {\n  int i, j, t;\n  for (j = 0; j < x - 1; j++)\n    for (i = 0; i < x - j - 1; i++)\n      if (arr_1[i] > arr_1[i + 1]) {\n        t = arr_1[i];\n        arr_1[i] = arr_1[i + 1];\n        arr_1[i + 1] = t;\n      }\n\n  for (j = 0; j < y - 1; j++)\n    for (i = 0; i < y - j - 1; i++)\n      if (arr_2[i] > arr_2[i + 1]) {\n        t = arr_2[i];\n        arr_2[i] = arr_2[i + 1];\n        arr_2[i + 1] = t;\n      }\n}\n\nvoid combine(int arr_1[], int arr_2[], int arr_3[], int x, int y) {\n  int k;\n  for (k = 0; k <= x - 1; k++)\n    arr_3[k] = arr_1[k];\n  for (k = x; k <= x + y - 1; k++)\n    arr_3[k] = arr_2[k - x];\n}\n"}
{"label": "8", "index": "14644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  cin >> A;\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[50];\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d\", &a[0], &b[0]);\n  for (i = 1; i <= a[0]; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= b[0]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int c, int x[]) {\n  int i, j, k, l;\n  for (i = 1; i <= c; i++) {\n    k = x[i];\n    l = i;\n    for (j = i + 1; j <= c; j++) {\n      if (x[j] < k) {\n        k = x[j];\n        l = j;\n      }\n    }\n    j = x[i];\n    x[i] = k;\n    x[l] = j;\n  }\n}\nvoid one(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[m + i + 1] = b[i + 1];\n  }\n}\nvoid out(int m, int n, int x[]) {\n  int i;\n  for (i = 1; i < m + n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n]);\n}\nint main() {\n\n  read(a, b);\n  change(a[0], a);\n  change(b[0], b);\n  one(a[0], b[0], a, b);\n  out(a[0], b[0], a);\n}\n"}
{"label": "8", "index": "14646", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], c, d;\nvoid kg();\nvoid m(int);\nvoid r();\nint main() {\n  r();\n  m(c);\n  kg();\n  m(d);\n  return 0;\n}\nvoid r() { scanf(\"%d%d\", &c, &d); }\nvoid m(int s) {\n  int i, j, t;\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < s - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%d\", a[i]);\n    if (i < s - 1)\n      kg();\n  }\n}\nvoid kg() { printf(\" \"); }\n"}
{"label": "8", "index": "14647", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, b[50] = {0};\n  int i, j, c, d, s;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < d; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < c - 1; i++) {\n    for (j = 0; j < c - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < d - 1; i++) {\n    for (j = 0; j < d - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < c; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < d; i++) {\n    printf(\" %d\", b[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, n1, n2, a1[100], a2[100];\nvoid scan() {\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (j = 0; j < n2; j++)\n    cin >> a2[j];\n}\nvoid adjust() {\n  int p;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (a1[i] > a1[j]) {\n        p = a1[i];\n        a1[i] = a1[j];\n        a1[j] = p;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (a2[i] > a2[j]) {\n        p = a2[i];\n        a2[i] = a2[j];\n        a2[j] = p;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (i = n1; i < n1 + n2; i++)\n    a1[i] = a2[i - n1];\n}\nvoid print() {\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a1[i]);\n  cout << a1[n1 + n2 - 1] << endl;\n}\nint main() {\n  scan();\n  adjust();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14649", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint x[1000], y[1000], z[2000];\nint i, j, n, m, ex;\nvoid read() {\n  cin >> n >> m; \n  for (i = 0; i < n; i++)\n    cin >> x[i]; \n  for (i = 0; i < m; i++)\n    cin >> y[i]; \n}\nvoid paixu() {            \n  for (i = 0; i < n; i++) \n    for (j = 0; j < n - 1; j++)\n      if (x[j + 1] < x[j]) {\n        ex = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = ex;\n      }\n  for (i = 0; i < m; i++) \n    for (j = 0; j < m - 1; j++)\n      if (y[j] > y[j + 1]) {\n        ex = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = ex;\n      }\n}\nvoid heping() {\n  for (i = 0; i < n; i++)\n    z[i] = x[i]; \n  for (i = 0; i < m; i++)\n    z[n + i] = y[i]; \n}\nvoid display() {\n  for (i = 0; i < n + m; i++) { \n    if (i == 0)\n      cout << z[i];\n    else\n      cout << \" \" << z[i];\n  }\n}\nint main() {\n  read(); \n  paixu();\n  heping();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "14650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid add(int array1[], int array2[], int x, int y) {\n  int array[100];\n  int i, j;\n  for (i = 0; i < x; i++)\n    array[i] = array1[i];\n  for (i = x, j = 0; j < y; i++, j++)\n    array[i] = array2[j];\n  printf(\"%d\", array[0]);\n  for (i = 1; i < x + y; i++)\n    cout << \" \" << array[i];\n}\n\nint main() {\n  int i, x, y, xarray[50], yarray[50];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &xarray[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &yarray[i]);\n  sort(xarray, x);\n  sort(yarray, y);\n  add(xarray, yarray, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint p, q;\nvoid input() {\n  scanf(\"%d %d \", &p, &q);\n  int i = 0;\n  for (i = 0; i < p; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < q; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int a[100], int b[100]) {\n  int i = 0, j = 0;\n  int c;\n  for (i = 1; i <= p - 1; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  for (i = 1; i <= q - 1; i++) {\n    for (j = 0; j < q - i; j++) {\n      if (b[j] > b[j + 1]) {\n        c = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = c;\n      }\n    }\n  }\n}\nvoid connect(int a[100], int b[100]) {\n  for (int i = 0; i < q; i++) {\n    a[p + i] = b[i];\n  }\n}\nvoid output(int a[100]) {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < p + q; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  input();\n  paixu(a, b);\n  connect(a, b);\n  output(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[200], i, j, la, lb, p;\nint main() {\n  void canf();\n  void px();\n  void lj();\n  void rintf();\n  canf();\n  px();\n  lj();\n  rintf();\n  return 0;\n}\n\nvoid canf() {\n  scanf(\"%d%d\", &la, &lb);\n  for (i = 0; i <= la - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= lb - 1; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid px() {\n  for (i = 0; i <= la - 2; i++) {\n    for (j = i + 1; j <= la - 1; j++)\n      if (a[j] < a[i]) {\n        p = a[i];\n        a[i] = a[j];\n        a[j] = p;\n      }\n  }\n  for (i = 0; i <= lb - 2; i++) {\n    for (j = i + 1; j <= lb - 1; j++)\n      if (b[j] < b[i]) {\n        p = b[i];\n        b[i] = b[j];\n        b[j] = p;\n      }\n  }\n}\n\nvoid lj() {\n  for (i = 0; i <= la - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = la; i <= la + lb - 1; i++) {\n    c[i] = b[i - la];\n  }\n}\n\nvoid rintf() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= la + lb - 1; i++)\n    printf(\" %d\", c[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[500], b[500], numbera, numberb, i, j, p;\nvoid input();\nvoid order();\nvoid stract();\nvoid output();\nint main() {\n  input();\n  order();\n  stract();\n  output();\n  return 0;\n}\nvoid input() {\n  cin >> numbera >> numberb;\n  for (i = 0; i < numbera; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < numberb; i++)\n    cin >> b[i];\n}\nvoid order() {\n  for (i = 0; i < numbera - 1; i++)\n    for (j = numbera - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        p = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = p;\n      }\n  for (i = 0; i < numberb - 1; i++)\n    for (j = numberb - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        p = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = p;\n      }\n}\nvoid stract() {\n  for (i = numbera; i < numbera + numberb; i++)\n    a[i] = b[i - numbera];\n}\nvoid output() {\n  cout << a[0];\n  for (i = 1; i < numbera + numberb; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "14654", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid duqu(int m, int a[]);\nvoid paixu(int m, int a[]);\nvoid hebing(int m, int n, int a[], int b[]);\nvoid shuchu(int m, int n, int a[]);\nint main() {\n  int x[100] = {0}, y[100] = {0}, m, n;\n  cin >> m >> n;\n  duqu(m, x);\n  duqu(n, y);\n  paixu(m, x);\n  paixu(n, y);\n  hebing(m, n, x, y);\n  shuchu(m, n, x);\n  return 0;\n}\nvoid duqu(int m, int a[]) {\n  int i;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n}\nvoid paixu(int m, int a[]) {\n  int i, j, k;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m - i; j++)\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n}\nvoid hebing(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\nvoid shuchu(int m, int n, int a[]) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n]);\n}\n"}
{"label": "8", "index": "14655", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100];\nint m, n;\n\nvoid insert(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int *p1, int *p2) {\n  int i, j;\n  int temp;\n  for (j = 1; j < m; j++)\n    for (i = 0; i < m - 1; i++)\n      if ((*(p1 + i)) > (*(p1 + i + 1))) {\n        temp = *(p1 + i);\n        *(p1 + i) = *(p1 + i + 1);\n        *(p1 + i + 1) = temp;\n      }\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - 1; i++)\n      if (*(p2 + i) > *(p2 + i + 1)) {\n        temp = *(p2 + i);\n        *(p2 + i) = *(p2 + 1 + i);\n        *(p2 + i + 1) = temp;\n      }\n}\n\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", a[i]);\n}\n\nint main() {\n  insert();\n  paixu(a, b);\n  hebing();\n  output();\n}\n"}
{"label": "8", "index": "14656", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][2];\nint n[2], i, j, k, t;\nint order(int j) {\n  for (i = 1; i < n[j]; i++)\n    for (k = i + 1; k <= n[j]; k++) {\n      if (a[i][j] > a[k][j]) {\n        a[i][j] = a[i][j] ^ a[k][j];\n        a[k][j] = a[i][j] ^ a[k][j];\n        a[i][j] = a[i][j] ^ a[k][j];\n      }\n    }\n}\nint main() {\n  cin >> n[0] >> n[1];\n  for (i = 1; i <= n[0]; i++)\n    cin >> a[i][0];\n  for (i = 1; i <= n[1]; i++)\n    scanf(\"%d \", &a[i][1]);\n  order(0);\n  order(1);\n  for (i = 1; i <= n[0]; i++)\n    printf(\"%d \", a[i][0]);\n  for (i = 1; i < n[1]; i++)\n    cout << a[i][1] << ' ';\n  printf(\"%d\\n\", a[n[1]][1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid paixu(int str[], int n1);\nvoid hebing(int str1[], int str2[], int n1, int n2);\nvoid shuchu(int str[], int n);\nint main() {\n  int n1, n2;\n  int a[100], b[100];\n  cin >> n1 >> n2;\n  paixu(a, n1);\n  paixu(b, n2);\n  hebing(a, b, n1, n2);\n  shuchu(a, n1 + n2);\n  return 0;\n}\nvoid paixu(int str[], int n) {\n  int i, p, m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  for (p = 1; p < n; p++)\n    for (i = 0; i <= n - 1 - p; i++)\n      if (str[i] > str[i + 1]) {\n        m = str[i];\n        str[i] = str[i + 1];\n        str[i + 1] = m;\n      }\n}\nvoid hebing(int str1[], int str2[], int n1, int n2) {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    str1[i] = str2[i - n1];\n}\nvoid shuchu(int str[], int n) {\n  int i;\n  printf(\"%d\", str[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", str[i]);\n}\n"}
{"label": "8", "index": "14658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint duru(int a[], int l) {\n  int i;\n  for (i = 1; i <= l; i++) {\n    cin >> a[i];\n  }\n  return 1;\n}\nint paixu(int a[], int l) {\n  int i, j, p;\n  for (i = 1; i <= l - 1; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  return 1;\n}\nint hebing(int a[], int b[], int l1, int l2) {\n  int i;\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a[i] = b[i - l1];\n  return l1 + l2;\n}\nint xianshi(int a[], int l) {\n  for (int i = 1; i < l; i++)\n    cout << a[i] << \" \";\n  cout << a[l] << endl;\n  return 1;\n}\nint main() {\n  int a[100], b[100], l1, l2;\n  cin >> l1 >> l2;\n  duru(a, l1);\n  duru(b, l2);\n  paixu(a, l1);\n  paixu(b, l2);\n  l1 = hebing(a, b, l1, l2);\n  xianshi(a, l1);\n  return 0;\n}\n"}
{"label": "8", "index": "14659", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num1[1000] = {0}, num2[1000] = {0};\nint num[2000] = {0};\nint n1, n2;\nvoid read() {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (int i = 0; i < n2; i++)\n    cin >> num2[i];\n}\nvoid range() {\n  for (int i = 0; i < n1 - 1; i++)\n    for (int j = 0; j < n1 - 1 - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        int temp = 0;\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 0; i < n2 - 1; i++)\n    for (int j = 0; j < n2 - 1 - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        int temp = 0;\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\nvoid combine() {\n  for (int i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (int i = 0; i < n2; i++)\n    num[n1 + i] = num2[i];\n}\nvoid print() { \n  for (int i = 0; i < n1 + n2 - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[n1 + n2 - 1] << endl;\n}\nint main() {\n  read();\n  range();\n  combine();\n  print();\n\n  return 0;\n}\n\n"}
{"label": "8", "index": "14660", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000], num2[1000], num[2000], n1, n2;\nvoid dr() {\n  cin >> n1 >> n2;\n  int i;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\nint px() {\n  int i, j, tem;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tem = num1[i];\n        num1[i] = num1[j];\n        num1[j] = tem;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tem = num2[i];\n        num2[i] = num2[j];\n        num2[j] = tem;\n      }\n    }\n  }\n}\nint gb() {\n  int i;\n  for (i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (i = n1; i < n1 + n2; i++)\n    num[i] = num2[i - n1];\n}\nint dy() {\n  printf(\"%d\", num[0]);\n  int i;\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", num[i]);\n}\nint main() {\n  dr();\n  px();\n  gb();\n  dy();\n}\n"}
{"label": "8", "index": "14661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a[], int x) {\n  int i;\n  cout << a[0];\n  for (i = 1; i < x; i++)\n    printf(\" %d\", a[i]);\n}\nvoid paixu(int a[], int x) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = i + 1; j < x; j++) {\n      if (a[i] > a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  print(a, x);\n}\nvoid scan(int t) {\n  int m, n, a[10], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, m);\n  printf(\" \");\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  paixu(a, n);\n}\nint main() { scan(0); }\n"}
{"label": "8", "index": "14662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, num1[10001], num2[10001];\n\nvoid init() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\n\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = 0; j < n1 - i - 1; j++)\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = 0; j < n2 - i - 1; j++)\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n}\n\nvoid merge() {\n  int i, j;\n  for (i = n1, j = 0; j < n2; i++, j++)\n    num1[i] = num2[j];\n  n1 += n2;\n}\n\nvoid show() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < n1; i++)\n    cout << ' ' << num1[i];\n  cout << \"\\n\";\n}\n\nint main() {\n  init();\n  sort();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14663", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1) - (*(int *)elem2);\n}\nint main() {\n  int N, M, i;\n  scanf(\"%d%d\", &N, &M);\n  int a[N], b[M];\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < M; i++) {\n    cin >> b[i];\n  }\n  qsort(a, N, sizeof(int), compare);\n  for (i = 0; i < N - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[i]);\n  qsort(b, M, sizeof(int), compare);\n  for (i = 0; i < M - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[i]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid putin(int *p, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> *(p + i);\n}\nvoid putout(int *p, int n) {\n  int m, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (*(p + j) > *(p + j + 1)) {\n        m = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = m;\n      }\n  }\n  cout << *(p + 1);\n  for (i = 2; i < n + 1; i++)\n    printf(\" %d\", *(p + i));\n}\nint main() {\n  int n1, n2, a[10000], b[10000], *pa, *pb;\n  pa = a;\n  pb = b;\n  cin >> n1 >> n2;\n  putin(pa, n1);\n  putin(pb, n2);\n  putout(pa, n1);\n  printf(\" \");\n  putout(pb, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14665", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[300], b[300], c[600];\nvoid myfunc() {\n  int la, lb, i;\n  cin >> la >> lb;\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    scanf(\"%d \", &b[i]);\n  sort(a, a + la);\n  sort(b, b + lb);\n  for (i = 0; i < la; i++)\n    c[i] = a[i];\n  for (i = la; i < la + lb; i++)\n    c[i] = b[i - la];\n  for (i = 0; i < la + lb - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[i];\n}\nint main() {\n  myfunc();\n  return 0;\n}\n"}
{"label": "8", "index": "14666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100];\nint m, n;\n\nvoid input() {\n  int i, j;\n  cin >> m >> n;\n  scanf(\"\\n\");\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (j = 0; j < n - 1; j++)\n    scanf(\"%d \", &b[j]);\n  scanf(\"%d\", &b[n - 1]);\n  return;\n}\n\nvoid sort(int array[], int k) {\n  int i, j, t;\n  for (j = 0; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (array[i] > array[i + 1]) {\n        t = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = t;\n      }\n  return;\n}\n\nvoid combine() {\n  int i, j = 0;\n  for (i = m; i < m + n; i++) {\n    a[i] = b[j];\n    j++;\n  }\n  return;\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n  return;\n}\n\nint main() {\n  input();\n  sort(a, m - 1);\n  sort(b, n - 1);\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid o(int n) {\n  int a[n];\n  int i = 0, j = 0, x;\n  while (i < n) {\n    scanf(\"%d \", &a[i]);\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    while (j < n - 1) {\n      if (a[j] > a[j + 1])\n        x = a[j], a[j] = a[j + 1], a[j + 1] = x;\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  j = 0;\n  while (j < n) {\n    printf(\"%d\", a[j]);\n    if (j < n - 1)\n      cout << \" \";\n    j++;\n  }\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  o(m);\n  printf(\" \");\n  o(n);\n  return 0;\n}\n"}
{"label": "8", "index": "14668", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, N[100], M[100];\nvoid scan() {\n  int i;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> N[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &M[i]);\n}\nvoid sort(int q, int a[]) {\n  int i, j, k, t;\n  for (i = 0; i < q - 1; i++) {\n    k = i;\n    for (j = i + 1; j < q; j++)\n      if (a[j] < a[k])\n        k = j;\n    if (k != i) {\n      t = a[i];\n      a[i] = a[k];\n      a[k] = t;\n    }\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n  for (i = 0; i < m; i++)\n    printf(\" %d\", M[i]);\n  printf(\"\\n\");\n}\nint main() {\n  scan();\n  sort(n, N);\n  sort(m, M);\n  print();\n}\n"}
{"label": "8", "index": "14669", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100] = {0}, b[100] = {0};\nint i = 0, j = 0, I, J;\n\nint main() {\n  void load();\n  void order(int a[], int b[]);\n  void conflate(int a[], int b[]);\n  void print(int a[]);\n  load();\n  order(a, b);\n  conflate(a, b);\n  print(a);\n  return 0;\n}\n\nvoid load() {\n\n  scanf(\"%d %d\", &i, &j);\n  I = i;\n  J = j;\n  for (i = 0; i < I; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < J; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\n\nvoid order(int a[], int b[]) {\n  void xu(int x[], int y);\n\n  xu(a, I);\n  xu(b, J);\n}\n\nvoid xu(int x[], int y) {\n  int *p, *q, *temp, t;\n  p = x;\n  for (i = 0; i < y - 1; i++) {\n    p = &x[i];\n    for (j = i + 1; j < y; j++) {\n      q = &x[j];\n      if (*p > *q) {\n        temp = p;\n        p = q;\n        q = temp;\n      }\n    }\n    if (p != &x[i]) {\n      t = *p;\n      *p = x[i];\n      x[i] = t;\n    }\n  }\n}\n\nvoid conflate(int a[], int b[]) {\n  for (i = I; i < I + J; i++)\n    a[i] = b[i - I];\n}\n\nvoid print(int a[]) {\n  for (i = 0; i < I + J; i++) {\n    printf(\"%d\", a[i]);\n    if (i < I + J - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[20000], b[10000], n, m;\nvoid f1(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int a[], int n) {\n  int i, j;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        int t;\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    a[n + i] = b[i];\n  cout << a[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  scanf(\"%d %d\", &n, &m);\n  f1(a, n);\n  f1(b, m);\n  f2(a, n);\n  f2(b, m);\n  f3(a, b, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, num1[10001], num2[10001];\n\nvoid init() {\n  int i;\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\n\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = 0; j < n1 - i - 1; j++)\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = 0; j < n2 - i - 1; j++)\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n}\n\nvoid merge() {\n  int i, j;\n  for (i = n1, j = 0; j < n2; i++, j++)\n    num1[i] = num2[j];\n  n1 += n2;\n}\n\nvoid show() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < n1; i++)\n    cout << ' ' << num1[i];\n  cout << endl;\n}\n\nint main() {\n  init();\n  sort();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nint m, n;\nvoid input() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++)\n    cin >> b[i];\n}\nvoid resort() {\n  sort(a + 1, a + m + 1);\n  sort(b + 1, b + n + 1);\n}\nvoid output() {\n  cout << a[1];\n  for (int i = 2; i <= m; i++)\n    cout << ' ' << a[i];\n  for (int i = 1; i <= n; i++)\n    cout << ' ' << b[i];\n}\nint main() {\n  input();\n  resort();\n  output();\n}\n"}
{"label": "8", "index": "14673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint l1, l2, a1[50], a2[50], a3[100];\nvoid f1(int a1[], int a2[]) {\n  scanf(\"%d %d\", &l1, &l2);\n  int i;\n  for (i = 1; i <= l1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 1; i <= l2; i++) {\n    scanf(\"%d\", &a2[i]);\n  }\n}\nvoid f2(int l, int a[]) {\n  int i, j, t;\n  for (i = 1; i < l; i++) {\n    for (j = 1; j <= l - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int a1[], int a2[], int a3[]) {\n  int i;\n  for (i = 1; i <= l1; i++)\n    a3[i] = a1[i];\n  for (i = l1 + 1; i <= l1 + l2; i++)\n    a3[i] = a2[i - l1];\n}\nvoid f4(int a3[]) {\n  int i;\n  for (i = 1; i <= l1 + l2; i++) {\n    if (i != 1)\n      printf(\" \");\n    printf(\"%d\", a3[i]);\n  }\n}\nint main() {\n  f1(a1, a2);\n  f2(l1, a1);\n  f2(l2, a2);\n  f3(a1, a2, a3);\n  f4(a3);\n  return 0;\n}\n"}
{"label": "8", "index": "14674", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nint a[100], b[100];\nvoid scanf() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++)\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n}\nvoid merge() {\n  int i;\n  for (i = n + 1; i <= n + m; i++)\n    a[i] = b[i - n];\n}\nvoid print() {\n  int i;\n  cout << a[1];\n  for (i = 2; i <= n + m; i++)\n    cout << ' ' << a[i];\n  cout << \"\\n\";\n}\nint main() {\n  scanf();\n  sort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint num1[100], num2[100], num3[1000];\nvoid read() {\n  cin >> n >> m;\n  for (int i = 1; i <= n; i++) {\n    cin >> num1[i];\n  }\n  for (int i = 1; i <= m; i++) {\n    cin >> num2[i];\n  }\n}\n\nvoid sort(int num1[], int num2[]) {\n  for (int i = 1; i <= n - 1; i++) {\n    for (int j = 1; j <= n - i; j++) {\n      if (num1[j] > num1[j + 1])\n        swap(num1[j], num1[j + 1]);\n    }\n  }\n  for (int i = 1; i <= m - 1; i++) {\n    for (int j = 1; j <= m - i; j++) {\n      if (num2[j] > num2[j + 1])\n        swap(num2[j], num2[j + 1]);\n    }\n  }\n}\nvoid hebing(int num1[], int num2[], int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i <= n)\n      num3[i] = num1[i];\n    else\n      num3[i] = num2[i - n];\n  }\n}\nvoid display(int num3[]) {\n  for (int i = 1; i <= n + m; i++) {\n    if (i == 1)\n      cout << num3[i];\n    else\n      cout << \" \" << num3[i];\n  }\n}\n\nint main() {\n  read();\n  sort(num1, num2);\n  hebing(num1, num2, num3);\n  display(num3);\n  return 0;\n}\n"}
{"label": "8", "index": "14676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f2(int a[100], int b[100], int x, int y);\n  void f(int a[100], int x);\n  int i, x, y, a[100], b[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, x);\n  f(b, y);\n  f2(a, b, x, y);\n  for (i = 0; i < x + y; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\nvoid f(int a[100], int x) {\n  int i, j, t;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid f2(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < y; i++)\n    a[i + x] = b[i];\n}\n"}
{"label": "8", "index": "14677", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid inputarray(int a[], int);\nvoid place(int a[], int);\nvoid combine(int a[], int b[], int, int);\nvoid printarray(int a[], int);\n\nint main(void) {\n  int array1[100], array2[100], m, n;\n  cin >> m >> n;\n  inputarray(array1, m);\n  inputarray(array2, n);\n  place(array1, m);\n  place(array2, n);\n  combine(array1, array2, m, n);\n  printarray(array1, m + n);\n  return 0;\n}\n\nvoid inputarray(int array[], int n) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\n\nvoid printarray(int array[], int n) {\n  printf(\"%d\", array[0]);\n  for (int i = 1; i < n; i++) {\n    printf(\" %d\", array[i]);\n  }\n  printf(\"\\n\");\n}\n\nvoid place(int array[], int n) {\n  int mininum, temp;\n  for (int i = 0; i < n - 1; i++) {\n    mininum = i;\n    for (int j = i + 1; j < n; j++) {\n      mininum = array[j] < array[mininum] ? j : mininum;\n    }\n    temp = array[i];\n    array[i] = array[mininum];\n    array[mininum] = temp;\n  }\n}\n\nvoid combine(int array1[], int array2[], int m, int n) {\n  for (int i = m; i < m + n; i++) {\n    array1[i] = array2[i - m];\n  }\n}\n"}
{"label": "8", "index": "14678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, c;\n  int a[60] = {0}, b[30] = {0};\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (a[i] < a[j]) {\n        c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] < b[j]) {\n        c = b[i];\n        b[i] = b[j];\n        b[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14679", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint readin(int n, int *a);\nint px(int n, int *a);\nint sc(int n1, int *a, int n2, int *b);\n\nint t, i, j, a[1000], b[1000];\n\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  readin(n1, a);\n  px(n1, a);\n  readin(n2, b);\n  px(n2, b);\n  sc(n1, a, n2, b);\n  return 0;\n}\nint readin(int n, int *a) {\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n}\nint px(int n, int *a) {\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n}\nint sc(int n1, int *a, int n2, int *b) {\n  for (int i = 1; i <= n1; i++)\n    cout << a[i] << ' ';\n  for (int i = 1; i <= n2 - 1; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\", b[n2]);\n}\n"}
{"label": "8", "index": "14680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *p, *q, *s;\nint m, n;\n\nint pfCompare(const void *elem1, const void *elem2) {\n  return *(int *)elem1 - *(int *)elem2;\n}\n\nint input() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  p = (int *)malloc(m * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &q[i]);\n}\n\nint downsort() {\n  qsort(p, m, sizeof(int), pfCompare);\n  qsort(q, n, sizeof(int), pfCompare);\n}\n\nint combine() {\n  s = (int *)malloc((m + n) * sizeof(int));\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = p[i];\n  for (i = m; i < m + n; i++)\n    s[i] = q[i - m];\n}\n\nint output() {\n  int i;\n  cout << s[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << s[i];\n  free(p);\n  free(q);\n  free(s);\n}\n\nint main() {\n  input();\n  downsort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], anum, bnum;\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &anum, &bnum);\n  for (i = 0; i < anum; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < bnum; i++)\n    scanf(\"%d\", b + i);\n}\nvoid mysort() {\n  int temp, i, j;\n  for (i = 0; i < anum - 1; i++)\n    for (j = 1; j < anum - i; j++)\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n  for (i = 0; i < bnum - 1; i++)\n    for (j = 1; j < bnum - i; j++)\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n}\nvoid print() {\n  int i;\n  for (i = 0; i < anum; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < bnum; i++)\n    printf(\"%d%c\", b[i], i == bnum - 1 ? '\\n' : ' ');\n}\nint main() {\n  scan();\n  mysort();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  if (*(int *)elem1 > *(int *)elem2)\n    return 1;\n  if (*(int *)elem1 == *(int *)elem2)\n    return 0;\n  if (*(int *)elem1 < *(int *)elem2)\n    return -1;\n}\nint *shuru(int m, int *a) {\n  a = (int *)malloc(m * sizeof(int));\n  int i;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < m; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  return a;\n}\nint main() {\n  int suma, sumb, i;\n  int *a;\n  int *b;\n  cin >> suma >> sumb;\n  a = shuru(suma, a);\n  b = shuru(sumb, b);\n  qsort(a, suma, sizeof(int), Compare);\n  qsort(b, sumb, sizeof(int), Compare);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < suma; i++) {\n    printf(\" %d\", a[i]);\n  }\n  printf(\" %d\", b[0]);\n  for (i = 1; i < sumb; i++) {\n    cout << \" \" << b[i];\n  }\n  free(a);\n  free(b);\n  return 0;\n}\n"}
{"label": "8", "index": "14683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint al = 0, bl = 0, i, j, k;\nvoid f1() {\n  cin >> al >> bl;\n  for (i = 0; i < al; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < bl; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < al - 1; i++) {\n    for (j = i; j < al; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < bl - 1; i++) {\n    for (j = i; j < bl; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < bl; i++) {\n    a[i + al] = b[i];\n  }\n}\nvoid f4() {\n  for (i = 0; i < al + bl - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[al + bl - 1];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, a[100], b[100];\nint *pointer1 = &m, *pointer2 = &n;\nvoid input(int *r, int *s, int *x, int *y) {\n  int i;\n  scanf(\"%d %d\", r, s);\n  for (i = 0; i < *r; i++) {\n    scanf(\"%d\", x + i);\n  }\n  for (i = 0; i < *s; i++)\n    scanf(\"%d\", y + i);\n}\nvoid sort(int *t, int *p) {\n  int i, j, r, s;\n  for (i = 0; i < (*t) - 1; i++) {\n    r = i;\n    for (j = i + 1; j < *t; j++)\n      if (*(p + j) < *(p + r))\n        r = j;\n    if (r != i) {\n      s = *(p + i);\n      *(p + i) = *(p + r);\n      *(p + r) = s;\n    }\n  }\n}\nvoid output(int *x, int *y, int *p1, int *p2) {\n  int i;\n  for (i = 0; i < *x; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 0; i < *y; i++)\n    printf(\"%d%c\", *(p2 + i), (i < (*y) - 1) ? ' ' : '\\n');\n}\nint main() {\n  input(pointer1, pointer2, a, b);\n  sort(pointer1, a);\n  sort(pointer2, b);\n  output(pointer1, pointer2, a, b);\n}\n"}
{"label": "8", "index": "14685", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, i, j, k, a[100], b[100];\nint read() {\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  return 0;\n}\nint sorta() {\n  int min, t;\n  for (i = 1; i <= n - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[min] > a[j])\n        min = j;\n    t = a[i];\n    a[i] = a[min];\n    a[min] = t;\n  }\n  return 0;\n}\nint sortb() {\n  int min, t;\n  for (i = 1; i <= m - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= m; j++)\n      if (b[min] > b[j])\n        min = j;\n    t = b[i];\n    b[i] = b[min];\n    b[min] = t;\n  }\n  return 0;\n}\nint write() {\n  for (i = 1; i <= n; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i < m; i++)\n    cout << b[i] << ' ';\n  cout << b[m] << endl;\n  return 0;\n}\nint main() {\n  k = read();\n  k = sorta();\n  k = sortb();\n  k = write();\n  return 0;\n}\n"}
{"label": "8", "index": "14686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], anum, bnum;\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &anum, &bnum);\n  for (i = 0; i < anum; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < bnum; i++)\n    scanf(\"%d\", b + i);\n}\nvoid mysort() {\n  int temp, i, j;\n  for (i = 0; i < anum - 1; i++)\n    for (j = 1; j < anum - i; j++)\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n  for (i = 0; i < bnum - 1; i++)\n    for (j = 1; j < bnum - i; j++)\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n}\nvoid print() {\n  int i;\n  for (i = 0; i < anum; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < bnum; i++)\n    printf(\"%d%c\", b[i], i == bnum - 1 ? '\\n' : ' ');\n}\nint main() {\n  scan();\n  mysort();\n  print();\n}\n"}
{"label": "8", "index": "14687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, d, e, f, g;\n  scanf(\"%d%d\", &c, &d);\n  int a[c], b[d];\n  for (e = 0; e < c; e++)\n    scanf(\"%d\", &a[e]);\n  for (e = 0; e < d; e++)\n    scanf(\"%d\", &b[e]);\n  for (f = 0; f < c - 1; f++)\n    for (e = 0; e < c - 1; e++)\n      if (a[e] > a[e + 1]) {\n        g = a[e];\n        a[e] = a[e + 1];\n        a[e + 1] = g;\n      }\n  printf(\"%d\", a[0]);\n  for (e = 1; e < c; e++)\n    printf(\" %d\", a[e]);\n  for (f = 0; f < d - 1; f++)\n    for (e = 0; e < d - 1; e++)\n      if (b[e] > b[e + 1]) {\n        g = b[e];\n        b[e] = b[e + 1];\n        b[e + 1] = g;\n      }\n  for (e = 0; e < d; e++)\n    printf(\" %d\", b[e]);\n  return 0;\n}\n"}
{"label": "8", "index": "14688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid in(int n, int a[]);\nvoid arrange(int n, int a[]);\nvoid connect(int n1, int n2, int a[], int b[], int c[]);\nvoid out(int n, int c[]);\nint main() {\n  int n1, n2, a[1000], b[1000], c[2000];\n  scanf(\"%d %d \", &n1, &n2);\n  in(n1, a);\n  in(n2, b);\n  arrange(n1, a);\n  arrange(n2, b);\n  connect(n1, n2, a, b, c);\n  out(n1 + n2, c);\n  return 0;\n}\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n}\nvoid arrange(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\n\nvoid connect(int n1, int n2, int a[], int b[], int c[]) {\n  int l = 0;\n  for (int i = 0; i < n1; i++, l++)\n    c[l] = a[i];\n  for (int j = 0; j < n2; j++, l++)\n    c[l] = b[j];\n}\nvoid out(int n, int c[]) {\n  for (int i = 0; i < n - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n - 1] << endl;\n}\n"}
{"label": "8", "index": "14689", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i, j;\nint m, n;\nint main() {\n  int a[100], b[50];\n\n  void read(int a[], int b[]);\n  void rank(int a[], int b[]);\n  void link(int a[], int b[]);\n  void output(int a[]);\n\n  read(a, b);\n  rank(a, b);\n  link(a, b);\n  output(a);\n}\nvoid read(int a[], int b[]) {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank(int a[], int b[]) {\n  int t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[]) {\n  for (i = 0, j = m; i < n; i++, j++)\n    a[j] = b[i];\n}\nvoid output(int a[]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", a[i]);\n    printf(\"%c\", (i < m + n - 1) ? ' ' : '\\n');\n  }\n}\n"}
{"label": "8", "index": "14690", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[20], b[20], c[40];\nvoid read(int x1, int x2) {\n  int i;\n  for (i = 0; i < x1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < x2; i++)\n    cin >> b[i];\n  return;\n}\nvoid sort1(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n  return;\n}\nvoid sort2(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n  return;\n}\nvoid combine(int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n  return;\n}\n\nvoid arraycout(int n1, int n2) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", c[i]);\n  return;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  read(n1, n2);\n  sort1(n1);\n  sort2(n2);\n  combine(n1, n2);\n  arraycout(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, a[100], b[100];\nint *pointer1 = &m, *pointer2 = &n;\nvoid input(int *r, int *s, int *x, int *y) {\n  int i;\n  scanf(\"%d %d\", r, s);\n  for (i = 0; i < *r; i++)\n    scanf(\"%d\", x + i);\n\n  for (i = 0; i < *s; i++) {\n    scanf(\"%d\", y + i);\n  }\n}\nvoid sort(int *t, int *p) {\n  int i, j, r, s;\n  for (i = 0; i < (*t) - 1; i++) {\n    r = i;\n    for (j = i + 1; j < *t; j++)\n      if (*(p + j) < *(p + r))\n        r = j;\n    if (r != i) {\n      s = *(p + i);\n      *(p + i) = *(p + r);\n      *(p + r) = s;\n    }\n  }\n}\nvoid output(int *x, int *y, int *p1, int *p2) {\n  int i;\n  for (i = 0; i < *x; i++) {\n    printf(\"%d \", *(p1 + i));\n  }\n  for (i = 0; i < *y; i++)\n    printf(\"%d%c\", *(p2 + i), (i < (*y) - 1) ? ' ' : '\\n');\n}\nint main() {\n  input(pointer1, pointer2, a, b);\n  sort(pointer1, a);\n  sort(pointer2, b);\n  output(pointer1, pointer2, a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14692", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[2], i, j, b[2][100], p, c[100], s, t;\n\n  for (i = 0; i < 2; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < a[i]; j++)\n      scanf(\"%d\", &b[i][j]);\n\n  for (i = 0; i < 2; i++) {\n    for (s = 0; s < a[i] - 1; s++) {\n      for (t = 0; t < a[i] - 1 - s; t++)\n        if (b[i][t] > b[i][t + 1]) {\n          p = b[i][t];\n          b[i][t] = b[i][t + 1];\n          b[i][t + 1] = p;\n        }\n    }\n  }\n\n  for (i = 0; i < a[0]; i++)\n    c[i] = b[0][i];\n  for (j = 0; j < a[1]; j++)\n    c[a[0] + j] = b[1][j];\n\n  for (s = 0; s < a[0] + a[1] - 1; s++)\n    printf(\"%d \", c[s]);\n  printf(\"%d\", c[a[0] + a[1] - 1]);\n}\n"}
{"label": "8", "index": "14693", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], c[100];\nint m, n, i, j, k, xx;\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 1; j <= n - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 1; i <= n; i++)\n    a[m + i] = b[i];\n}\n\nvoid init(int a[], int b[]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &b[i]);\n}\n\nvoid output(int a[], int k) {\n  int i;\n\n  for (i = 1; i <= k; i++)\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n}\nint main() {\n  init(a, b);\n  sort(a, m);\n  sort(b, n);\n  merge(a, b, m, n);\n  output(a, m + n);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, a[100] = {0}, b[100] = {0}, c[200] = {0};\nvoid duqu() {\n  int *p;\n  scanf(\"%d %d\", &m, &n);\n  for (p = a; p < a + m; p++)\n    scanf(\"%d\", p);\n  for (p = b; p < b + n; p++)\n    scanf(\"%d\", p);\n}\nvoid range(int a[], int b[], int m, int n) {\n  int *p, *q, d;\n  for (p = a; p < a + m - 1; p++)\n    for (q = p + 1; q < a + m; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n  for (p = b; p < b + n - 1; p++)\n    for (q = p + 1; q < b + n; q++)\n      if (*p > *q) {\n        d = *p;\n        *p = *q;\n        *q = d;\n      }\n}\nvoid merge(int a[], int b[], int m, int n) {\n  int *p, *q;\n  for (p = c, q = a; q < a + m; p++, q++)\n    *p = *q;\n  for (p = c + m, q = b; q < b + n; p++, q++)\n    *p = *q;\n}\nvoid show(int c[], int d) {\n  int *p;\n  for (p = c; p < c + d - 1; p++)\n    printf(\"%d \", *p);\n  printf(\"%d\", *p);\n}\nint main() {\n  duqu();\n  range(a, b, m, n);\n  merge(a, b, m, n);\n  show(c, m + n);\n}\n"}
{"label": "8", "index": "14695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int e);\nvoid f2(int b[], int f);\nvoid f3(int c[], int h, int d[], int l);\nint main() {\n  int shuzu1[200], shuzu2[200];\n  int geshu1, geshu2;\n  scanf(\"%d%d\", &geshu1, &geshu2);\n  f1(shuzu1, geshu1);\n  f1(shuzu2, geshu2);\n  f2(shuzu1, geshu1);\n  f2(shuzu2, geshu2);\n  f3(shuzu1, geshu1, shuzu2, geshu2);\n  return 0;\n}\nvoid f1(int a[], int e) {\n  int i;\n  for (i = 0; i < e; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid f2(int b[], int f) {\n  int k, t, g;\n  for (k = 0; k < f - 1; k++) {\n    for (t = 0; t < f - 1; t++) {\n      if (b[t] > b[t + 1]) {\n        g = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = g;\n      }\n    }\n  }\n}\nvoid f3(int c[], int h, int d[], int l) {\n  int z;\n  for (z = 0; z < h; z++) {\n    printf(\"%d \", c[z]);\n  }\n  for (z = 0; z < l - 1; z++) {\n    printf(\"%d \", d[z]);\n  }\n  printf(\"%d\", d[l - 1]);\n}\n"}
{"label": "8", "index": "14696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid output(int n, int m, int a[], int b[]) {\n  int i;\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\nvoid swap(int a[], int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\nvoid quicksort(int a[], int l, int r) {\n  int m, i, j;\n  i = l;\n  j = r;\n  m = a[i];\n  while (i <= j) {\n    while ((a[i] < m) && (i < r))\n      i++;\n    while ((a[j] > m) && (j > l))\n      j--;\n    if (i <= j) {\n      swap(a, i, j);\n      i++;\n      j--;\n    }\n  }\n  if (i < r)\n    quicksort(a, i, r);\n  if (j > l)\n    quicksort(a, l, j);\n}\nvoid input() {\n  int i, n, m, a[100], b[100];\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  quicksort(a, 0, n - 1);\n  quicksort(b, 0, m - 1);\n  output(n, m, a, b);\n}\nint main() { input(); }\n"}
{"label": "8", "index": "14697", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input(void);\nvoid sort(int *a, int n, int *b, int m);\nvoid merger(int *a, int n, int *b, int m);\nvoid output(int *a, int n, int m);\nint n, m, a[200], b[100];\nvoid input(void) {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *a, int n, int *b, int m) {\n  int i, j, min, temp;\n  for (i = 0; i < n - 1; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[min])\n        min = j;\n    if (min != i) {\n      temp = a[i];\n      a[i] = a[min];\n      a[min] = temp;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    min = i;\n    for (j = i + 1; j < m; j++)\n      if (b[j] < b[min])\n        min = j;\n    if (min != i) {\n      temp = b[i];\n      b[i] = b[min];\n      b[min] = temp;\n    }\n  }\n}\n\nvoid merger(int *a, int n, int *b, int m) {\n  int i, j;\n  for (i = n, j = 0; i < n + m, j < m; i++)\n    a[i] = b[j++];\n}\n\nvoid output(int *a, int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[n + m - 1]);\n}\nint main() {\n  input();\n  sort(a, n, b, m);\n  merger(a, n, b, m);\n  output(a, n, m);\n}\n"}
{"label": "8", "index": "14698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m[2], i, j, k, a[2][100], p;\n  scanf(\"%d %d\", &m[0], &m[1]);\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      scanf(\"%d\", &a[k][i]);\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      for (j = 0; j < m[k] - i - 1; j++) {\n        if (a[k][j] > a[k][j + 1]) {\n          p = a[k][j];\n          a[k][j] = a[k][j + 1];\n          a[k][j + 1] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      if (!(k == 0 && i == 0)) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[k][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[800], b[800];\nint main() {\n  void f1();\n  void f2();\n  void f3();\n  void f4();\n  f1();\n  f2();\n  f3();\n  f4();\n}\nvoid f1() { scanf(\"%d%d\", &m, &n); }\nvoid f2() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f3() {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n  }\n}\nvoid f4() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j < n - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], b[1000], c[1000];\n  int i, n1, n2;\n  void shubingpai(int x[], int y[], int z[], int m, int n);\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n  shubingpai(a, b, c, n1, n2);\n  for (i = 0; i < (n1 + n2 - 1); i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[n1 + n2 - 1]);\n}\nvoid shubingpai(int x[], int y[], int z[], int m, int n) {\n  void pai(int c[], int n);\n  int i;\n  pai(x, m);\n  pai(y, n);\n  for (i = 0; i < m; i++)\n    z[i] = x[i];\n  for (i = m; i < m + n; i++)\n    z[i] = y[i - m];\n}\nvoid pai(int c[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (c[j] < c[k])\n        k = j;\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "14701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sr(int a[100], int b[100], int x, int y);\n  void px(int a[100], int x);\n  void hb(int a[100], int b[100], int c[200], int x, int y);\n  void sc(int a[200], int x);\n  int a[100], b[100], c[200], x, y;\n  scanf(\"%d%d\", &x, &y);\n  sr(a, b, x, y);\n  px(a, x);\n  px(b, y);\n  hb(a, b, c, x, y);\n  sc(c, x + y);\n  return 0;\n}\nvoid sr(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid px(int a[100], int x) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid hb(int a[100], int b[100], int c[200], int x, int y) {\n  int i;\n  for (i = 0; i < x + y; i++) {\n    if (i < x)\n      c[i] = a[i];\n    else\n      c[i] = b[i - x];\n  }\n}\nvoid sc(int c[200], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100];\nint main() {\n  void f1();\n  void f2(int s[], int k);\n  void f3(int p[], int t);\n  void f4(int p[], int t);\n  f1();\n  f2(a, m);\n  f2(b, n);\n  f3(a, m);\n  f4(b, n);\n}\n\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int s[], int k) {\n\n  int i, j, t;\n  for (j = 0; j < k - 1; j++)\n    for (i = 0; i < k - 1 - j; i++)\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n}\n\nvoid f3(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t; i++)\n    printf(\"%d \", p[i]);\n}\n\nvoid f4(int p[], int t) {\n  int i, j;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%d \", p[i]);\n  printf(\"%d\", p[t - 1]);\n}\n"}
{"label": "8", "index": "14703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], c[100], m, n;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid az() {\n  int i, j, t;\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid jch() {\n  int j;\n  for (j = 0; j < m; j++) {\n    c[j] = a[j];\n  }\n  for (j = m; j < m + n; j++) {\n    c[j] = b[j - m];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  input();\n  az();\n  jch();\n  output();\n}\n"}
{"label": "8", "index": "14704", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a1[100], a2[100];\nint n1, n2;\nint a[200];\n\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &a2[i]);\n}\n\nvoid paixu(int b1[], int b2[], int m1, int m2) {\n  int i, j, t;\n  for (i = 0; i < m1 - 1; i++)\n    for (j = 0; j < m1 - 1 - i; j++)\n      if (b1[j] > b1[j + 1]) {\n        t = b1[j];\n        b1[j] = b1[j + 1];\n        b1[j + 1] = t;\n      }\n  for (i = 0; i < m2 - 1; i++)\n    for (j = 0; j < m2 - 1 - i; j++)\n      if (b2[j] > b2[j + 1]) {\n        t = b2[j];\n        b2[j] = b2[j + 1];\n        b2[j + 1] = t;\n      }\n}\n\nvoid hebing(int c1[], int c2[], int m1, int m2) {\n  int i, j;\n  for (i = 0; i < m1; i++)\n    a[i] = c1[i];\n  for (j = 0; j < m2; j++) {\n    a[i] = c2[j];\n    i++;\n  }\n}\n\nvoid shuchu(int d[], int m1, int m2) {\n  int i;\n  for (i = 0; i < (m1 + m2); i++) {\n    if (i < m1 + m2 - 1)\n      printf(\"%d \", d[i]);\n    else\n      printf(\"%d\\n\", d[i]);\n  }\n}\n\nint main() {\n  shuru();\n  paixu(a1, a2, n1, n2);\n  hebing(a1, a2, n1, n2);\n  shuchu(a, n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n;\nint a[1000];\nint b[1000];\nint c[2000];\nint i;\nint j;\n\nvoid f1() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n}\nvoid f2() {\n  int t;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3() {\n  int s;\n  for (s = 0, i = 0; s < m, i < m; s++, i++)\n    c[s] = a[i];\n  for (s = m, j = 0; s < m + n - 2, j < n; s++, j++)\n    c[s] = b[j];\n}\nvoid f4() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= m + n - 1; i++)\n    cout << \" \" << c[i];\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[50], a2[50];\nint main() {\n  void sort(int b[], int n);\n  void scn();\n  void pr(int c[], int m);\n  scn();\n  sort(a1, n1);\n  sort(a2, n2);\n  pr(a1, n1);\n  pr(a2, n2);\n  return 0;\n}\nvoid sort(int b[], int n) {\n  int i, j, t;\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n}\nvoid scn() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\nvoid pr(int c[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    if (i == m - 1 && c[i] == a2[m - 1])\n      printf(\"%d\", c[i]);\n    else\n      printf(\"%d \", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, c;\n  int a[60] = {0}, b[30] = {0};\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (a[i] < a[j]) {\n        c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] < b[j]) {\n        c = b[i];\n        b[i] = b[j];\n        b[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid read(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid order(int a[], int n) {\n  int i, j, aaa;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        aaa = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = aaa;\n      }\n    }\n  }\n}\nvoid combine(int a[], int m, int b[], int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[n - 1]);\n}\nint main() {\n  int a[100], b[100], m, n;\n  scanf(\"%d%d\", &m, &n);\n  read(a, m, b, n);\n  order(a, m);\n  order(b, n);\n  combine(a, m, b, n);\n}\n"}
{"label": "8", "index": "14709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, a[100], b[100];\nvoid input() {\n  int j, k;\n  scanf(\"%d %d \", &n, &m);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n}\nvoid arrange(int n, int m, int x[], int y[]) {\n  int j, k, t;\n  for (j = 0; j < n - 1; j++)\n    for (k = 0; k < n - 1 - j; k++)\n      if (x[k] > x[k + 1]) {\n        t = x[k];\n        x[k] = x[k + 1];\n        x[k + 1] = t;\n      }\n  for (j = 0; j < m - 1; j++)\n    for (k = 0; k < m - 1 - j; k++)\n      if (y[k] > y[k + 1]) {\n        t = y[k];\n        y[k] = y[k + 1];\n        y[k + 1] = t;\n      }\n}\nvoid combine(int n, int m, int x[], int y[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    x[n + i] = y[i];\n}\nvoid print(int n, int m, int x[]) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << x[i] << \" \";\n  printf(\"%d\", x[m + n - 1]);\n}\n\nint main() {\n  input();\n  arrange(n, m, a, b);\n  combine(n, m, a, b);\n  print(n, m, a);\n}\n"}
{"label": "8", "index": "14710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint q[100], w[100], m, n, i, j, k, v, y = 0;\nvoid a(), b(), c(), d();\nint main() {\n  a();\n  b();\n  c();\n  d();\n  return 0;\n}\nvoid a() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &q[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &w[i]);\n}\nvoid b() {\n  for (j = 0; j < m - 1; j++) {\n    for (k = j + 1; k < m; k++) {\n      if (q[j] > q[k]) {\n        v = q[k];\n        q[k] = q[j];\n        q[j] = v;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (w[j] > w[k]) {\n        v = w[k];\n        w[k] = w[j];\n        w[j] = v;\n      }\n    }\n  }\n}\nvoid c() {\n  for (i = m; i < m + n; i++)\n    q[i] = w[y++];\n}\nvoid d() {\n  printf(\"%d\", q[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", q[i]);\n}\n"}
{"label": "8", "index": "14711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid sheng(int *a, int n) {\n  int i, j, b;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i])\n\n      {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint hebing(int *a, int n, int *b, int m, int *c) {\n\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < m + n; i++)\n    c[i] = b[i - n];\n  return *c;\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d %d\", &n, &m);\n  int *a = (int *)malloc(sizeof(int) * n);\n  int *b = (int *)malloc(sizeof(int) * m);\n  int *c = (int *)malloc(sizeof(int) * (m + n));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  sheng(a, n);\n  sheng(b, m);\n  hebing(a, n, b, m, c);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << c[i];\n}\n"}
{"label": "8", "index": "14712", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s1 = 0, s2 = 0;\nvoid reads() { cin >> s1 >> s2; }\nvoid read(int s, int a[]) {\n  for (int i = 1; i <= s; i++)\n    cin >> a[i];\n}\nvoid sort(int s, int a[]) {\n  for (int i = 1; i <= s - 1; i++)\n    for (int j = i + 1; j <= s; j++) {\n      if (a[i] > a[j]) {\n        int c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n}\nvoid combine(int s1, int s2, int a1[], int a2[]) {\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    a1[i] = a2[i - s1];\n}\nvoid print(int s, int a[]) {\n  for (int i = 1; i <= s; i++) {\n    cout << a[i];\n    if (i < s)\n      cout << ' ';\n  }\n}\nint main() {\n  int a1[500], a2[500];\n  reads();\n  read(s1, a1);\n  read(s2, a2);\n  sort(s1, a1);\n  sort(s2, a2);\n  combine(s1, s2, a1, a2);\n  print(s1 + s2, a1);\n  return 0;\n}\n"}
{"label": "8", "index": "14713", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int zhengshuchuan[], int changdu) {\n  int i, j, t;\n  for (i = 0; i < changdu; i++) {\n    for (j = i; j < changdu; j++) {\n      if (zhengshuchuan[i] > zhengshuchuan[j]) {\n        t = zhengshuchuan[i];\n        zhengshuchuan[i] = zhengshuchuan[j];\n        zhengshuchuan[j] = t;\n      }\n    }\n  }\n  return 0;\n}\nint main() {\n  int a[200], b[100], i;\n  int changdu1, changdu2;\n  scanf(\"%d %d\", &changdu1, &changdu2);\n  for (i = 0; i < changdu1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < changdu2; i++) {\n    scanf(\"%d \", &b[i]);\n  }\n  f(a, changdu1);\n  f(b, changdu2);\n  for (i = 0; i < changdu2; i++) {\n    a[changdu1 + i] = b[i];\n  }\n\n  for (i = 0; i < changdu1 + changdu2; i++) {\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14714", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200], m, n;\nvoid getstr() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid rangestr() {\n  void range(int str[100], int length);\n  range(a, m);\n  range(b, n);\n}\n\nvoid range(int str[100], int length) {\n  int i, j, t;\n  for (i = 0; i < length - 1; i++)\n    for (j = 0; j < length - i - 1; j++)\n      if (str[j] > str[j + 1]) {\n        t = str[j + 1];\n        str[j + 1] = str[j];\n        str[j] = t;\n      }\n}\n\nvoid combinestr() {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < m + n; i++)\n    c[i] = b[i - m];\n}\n\nvoid putstr() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[m + n - 1]);\n}\n\nint main() {\n  getstr();\n  rangestr();\n  combinestr();\n  putstr();\n}\n"}
{"label": "8", "index": "14715", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint num1, num2, array_11[20], array_12[20], array_1[40];\n\nvoid input(int array_11[], int array_12[]) {\n  int i, j;\n\n  scanf(\"%d %d\", &num1, &num2);\n\n  for (i = 0; i <= num1 - 1; i++)\n    cin >> array_11[i];\n  for (j = 0; j <= num2 - 1; j++) {\n    scanf(\"%d\", &array_12[j]);\n  }\n}\n\nvoid sort(int array_1[], int n) {\n  int i, j, t;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (array_1[j] > array_1[j + 1]) {\n        t = array_1[j];\n        array_1[j] = array_1[j + 1];\n        array_1[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid link(int array_11[], int array_12[], int array_1[], int n1, int n2) {\n  int i;\n\n  for (i = 0; i < n1; i++) {\n    array_1[i] = array_11[i];\n  }\n  for (i = 0; i < n2; i++) {\n    array_1[i + n1] = array_12[i];\n  }\n}\n\nvoid output(int array_1[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d%c\", array_1[i], i < n - 1 ? ' ' : ' ');\n  }\n}\n\nint main() {\n  input(array_11, array_12);\n  sort(array_11, num1);\n  sort(array_12, num2);\n  link(array_11, array_12, array_1, num1, num2);\n  output(array_1, num1 + num2);\n}\n"}
{"label": "8", "index": "14716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[800], b[800];\nint main() {\n  void f1();\n  void f2();\n  void f3();\n  void f4();\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\nvoid f1() { scanf(\"%d%d\", &m, &n); }\nvoid f2() {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f3() {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++)\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n  }\n}\nvoid f4() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (j = 0; j < n - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1 = 0, n2 = 0, i = 0, j = 0, temp = 0;\n  scanf(\"%d %d \", &n1, &n2);\n  int a1[100] = {0}, a2[100] = {0}, c[200] = {0};\n  for (i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &a2[i]);\n  for (i = 0; i < n1 - 1; i++) {\n    for (j = 0; j < n1 - 1 - i; j++) {\n      if (a1[j] > a1[j + 1]) {\n        temp = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2 - 1; i++) {\n    for (j = 0; j < n2 - 1 - i; j++) {\n      if (a2[j] > a2[j + 1]) {\n        temp = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    c[i] = a1[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = a2[i - n1];\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint x[10000], y[10000], z[100000];\nint m, n, i, j, temp;\nvoid dq() {\n  cin >> m >> n;\n  for (i = 1; i <= m; i++) {\n    cin >> x[i];\n  }\n  for (i = 1; i <= n; i++)\n    cin >> y[i];\n}\n\nvoid px() {\n  for (i = 1; i <= m - 1; i++)\n    for (j = m; j >= i + 1; j--)\n      if (x[j] <= x[j - 1]) {\n        temp = x[j];\n        x[j] = x[j - 1];\n        x[j - 1] = temp;\n      }\n  for (i = 1; i <= n - 1; i++)\n    for (j = n; j >= i + 1; j--)\n      if (y[j] <= y[j - 1]) {\n        temp = y[j];\n        y[j] = y[j - 1];\n        y[j - 1] = temp;\n      }\n}\n\nvoid hb() {\n  for (i = 1; i <= m; i++)\n    z[i] = x[i];\n  for (i = 1; i <= n; i++)\n    z[i + m] = y[i];\n}\n\nvoid xs() {\n  for (i = 1; i < m + n; i++)\n    cout << z[i] << ' ';\n  cout << z[m + n];\n  cout << endl;\n}\n\nint main() {\n  dq();\n  px();\n  hb();\n  xs();\n  return 0;\n}\n"}
{"label": "8", "index": "14719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid scan_(int m, int *a, int n, int *b);\nvoid sort_(int m, int *a, int n, int *b);\nvoid print_(int m, int *a, int n, int *b);\n\nint main() {\n  int m, n, *a, *b;\n  scanf(\"%d %d\", &m, &n);\n  a = (int *)malloc(m * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  scan_(m, a, n, b);\n  sort_(m, a, n, b);\n  print_(m, a, n, b);\n  return 0;\n}\n\nvoid scan_(int m, int *a, int n, int *b) {\n  int i, j, *p;\n\n  p = a;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", p++);\n  p = b;\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", p++);\n}\n\nvoid sort_(int m, int *a, int n, int *b) {\n  int i, j, t, *q;\n  for (i = 0; i < m - 1; i++) {\n    q = a;\n    for (j = 0; j < m - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    q = b;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (*q > *(q + 1)) {\n        t = *q;\n        *q = *(q + 1);\n        *(q + 1) = t;\n      }\n      q++;\n    }\n  }\n}\n\nvoid print_(int m, int *a, int n, int *b) {\n  int i, *p;\n  printf(\"%d\", *a);\n  p = a + 1;\n  for (i = 1; i < m; i++, p++)\n    printf(\" %d\", *p);\n  p = b;\n  for (i = 0; i < n; i++, p++)\n    printf(\" %d\", *p);\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[300], b[300], c[600];\nvoid myfunc() {\n  int la, lb, i;\n  cin >> la >> lb;\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    cin >> b[i];\n  sort(a, a + la);\n  sort(b, b + lb);\n  for (i = 0; i < la; i++)\n    c[i] = a[i];\n  for (i = la; i < la + lb; i++)\n    c[i] = b[i - la];\n  for (i = 0; i < la + lb - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[i];\n}\nint main() {\n  myfunc();\n  return 0;\n}\n"}
{"label": "8", "index": "14721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint la, lb, a[1000], b[1000], c[2000];\nvoid duqu() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int j = 0; j < lb; j++)\n    cin >> b[j];\n} \nvoid paixu() {\n  int i, j, temp;\n  for (i = 0; i < la - 1; i++)\n    for (j = i + 1; j < la; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < lb - 1; i++)\n    for (j = i + 1; j < lb; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n} \nvoid hebing() {\n  for (int i = 0; i < la; i++)\n    c[i] = a[i];\n  for (int j = 0; j < lb; j++)\n    c[la + j] = b[j];\n} \nvoid shuchu() {\n  for (int i = 0; i < la + lb; i++) {\n    cout << c[i];\n    if (i != la + lb - 1)\n      cout << ' ';\n  }\n} \nint main() {\n  duqu();\n  paixu();\n  hebing();\n  shuchu(); \n  return 0;\n}\n"}
{"label": "8", "index": "14722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid paixu() {\n  int a[100], b[100], sizea, sizeb, i, j, t;\n  cin >> sizea >> sizeb;\n  for (i = 1; i <= sizea; i++)\n    cin >> a[i];\n  for (i = 1; i <= sizeb; i++)\n    cin >> b[i];\n  for (i = sizea; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = sizeb; i >= 1; i--)\n    for (j = 1; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= sizea; i++)\n    cout << a[i] << \" \";\n  for (i = 1; i <= sizeb; i++) {\n    cout << b[i];\n    if (i < sizeb)\n      cout << \" \";\n    else\n      cout << endl;\n  }\n}\nint main() {\n  paixu();\n  return 0;\n}\n"}
{"label": "8", "index": "14723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\nint main() {\n  int m, n;\n  int a[100], b[100];\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  qsort(a, m, sizeof(int), Compare);\n  qsort(b, n, sizeof(int), Compare);\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *putin() {\n  int a, b, n;\n  cin >> a >> b;\n  int *p = (int *)malloc((a + b + 2) * sizeof(int));\n  *p = a;\n  *(p + 1) = b;\n  for (n = 2; n <= a + b + 1; n++)\n    scanf(\"%d\", (p + n));\n  return p;\n}\nint *compare(int *a) {\n  int n, m, p;\n  for (n = 2; n <= (*a); n++) {\n    for (m = n + 1; m <= (*a) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  for (n = (*a) + 2; n <= (*a) + (*(a + 1)); n++) {\n    for (m = n + 1; m <= (*a) + (*(a + 1)) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  return a;\n}\nvoid putout(int *a) {\n  int x;\n  for (x = 2; x <= (*a) + (*(a + 1)); x++)\n    printf(\"%d \", a[x]);\n  cout << a[(*a) + (*(a + 1)) + 1];\n}\nint main() { putout(compare(putin())); }\n"}
{"label": "8", "index": "14725", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint s1[100] = {0};\nint s2[100] = {0};\nint s3[200] = {0};\nint a = 0, b = 0;\n\nvoid read() {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++) {\n    cin >> s1[i];\n  }\n  for (int i = 0; i < b; i++) {\n    cin >> s2[i];\n  }\n}\n\nvoid sort1() {\n  for (int i = 0; i < a - 1; i++)\n    for (int j = i + 1; j < a; j++) {\n      if (s1[i] > s1[j]) {\n        int temp = s1[i];\n        s1[i] = s1[j];\n        s1[j] = temp;\n      }\n    }\n}\n\nvoid sort2() {\n  for (int i = 0; i < b - 1; i++)\n    for (int j = i + 1; j < b; j++) {\n      if (s2[i] > s2[j]) {\n        int temp = s2[i];\n        s2[i] = s2[j];\n        s2[j] = temp;\n      }\n    }\n}\n\nvoid add() {\n  for (int i = 0; i < a; i++)\n    s3[i] = s1[i];\n  for (int i = 0; i < b; i++)\n    s3[i + a] = s2[i];\n}\n\nvoid write() {\n  for (int i = 0; i < a + b - 1; i++) {\n    printf(\"%d \", s3[i]);\n  }\n  cout << s3[a + b - 1] << endl;\n}\nint main() {\n  read();\n  sort1();\n  sort2();\n  add();\n  write();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14726", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid read(int a[], int m);\nvoid bubble(int a[], int m);\nvoid add(int a[], int b[], int c[], int m, int n);\nvoid out(int c[], int m);\n\nint main() {\n  int m, n;\n  int a[100], b[100], c[200];\n  cin >> m >> n;\n  read(a, m);\n  read(b, n);\n  bubble(a, m);\n  bubble(b, n);\n  add(a, b, c, m, n);\n  out(c, m + n);\n  return 0;\n}\n\nvoid read(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid bubble(int a[], int m) {\n  int i, j, tmp;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n}\n\nvoid add(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\n\nvoid out(int c[], int m) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bijiao(const void *x, const void *y) { return *(int *)x - *(int *)y; }\nint main() {\n  int n, m, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, n, sizeof(a[0]), bijiao);\n  qsort(b, m, sizeof(b[0]), bijiao);\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a[1000], b[100];\nint main() {\n  void A();\n  void B();\n  void c();\n  void d();\n  A();\n  B();\n  c();\n  d();\n  return 0;\n}\n\nvoid A() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid B() {\n  int z, i, j;\n  for (j = n1; j > 1; j--) {\n    for (i = 0; i < j - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        z = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = z;\n      }\n    }\n  }\n  for (j = n2; j > 1; j--) {\n    for (i = 0; i < j - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        z = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = z;\n      }\n    }\n  }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[i + n1] = b[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "14729", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int a[], int b[]);\nvoid sort(int a[], int b[]);\nvoid link(int a[], int b[]);\nvoid output(int a[]);\nint input1[100], input2[100], n1, n2;\nint main() {\n  read(input1, input2);\n  sort(input1, input2);\n  link(input1, input2);\n  output(input1);\n  return 0;\n}\nvoid read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d \", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    cin >> b[i];\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n}\nvoid link(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\nvoid output(int a[]) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n1 + n2 - 1];\n}\n"}
{"label": "8", "index": "14730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  int i, j;\n  int s1[1000], s2[1000];\n  for (i = 1; i <= a; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d\", &s2[i]);\n  for (i = 1; i <= a - 1; i++)\n    for (j = 1; j <= a - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        int t;\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n  for (i = 1; i <= b - 1; i++)\n    for (j = 1; j <= b - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        int t;\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n  for (i = 1; i <= a; i++)\n    cout << s1[i] << \" \";\n  for (i = 1; i <= b - 1; i++)\n    cout << s2[i] << \" \";\n  printf(\"%d\", s2[b]);\n}\n"}
{"label": "8", "index": "14731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void pai(int na, int nb);\n  int na, nb;\n  scanf(\"%d%d\", &na, &nb);\n  pai(na, nb);\n}\n\nvoid pai(int na, int nb) {\n  int t, i, j, a[200], b[100];\n  for (i = 0; i < na; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < nb; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  for (j = 0; j < na - 1; j++) {\n    for (i = 0; i < na - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < nb - 1; j++) {\n    for (i = 0; i < nb - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n\n  for (j = 0; j < na; j++)\n    printf(\"%d \", a[j]);\n  for (j = 0; j < nb - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\\n\", b[nb - 1]);\n}\n"}
{"label": "8", "index": "14732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, a[100], b[100], c[200];\nvoid f1() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid f2(int k[], int l) {\n  int i, j, t;\n  for (i = 0; i < l - 1; i++)\n    for (j = i; j < l; j++)\n      if (k[i] > k[j]) {\n        t = k[i];\n        k[i] = k[j];\n        k[j] = t;\n      }\n}\n\nvoid f3() {\n  f2(a, m);\n  f2(b, n);\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[i + m] = b[i];\n}\n\nvoid f4() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n - 1];\n}\n\nint main() {\n  f1();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101];\n  int b[101];\n  int m, n, i, j, k, l, w, x, y, z, c, d;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < m - 1; k++) {\n    for (l = 0; l < m - 1 - k; l++) {\n      if (a[l] > a[l + 1]) {\n        c = a[l];\n        a[l] = a[l + 1];\n        a[l + 1] = c;\n      }\n    }\n  }\n  for (w = 0; w < n - 1; w++) {\n    for (x = 0; x < n - 1 - w; x++) {\n      if (b[x] > b[x + 1]) {\n        d = b[x];\n        b[x] = b[x + 1];\n        b[x + 1] = d;\n      }\n    }\n  }\n  for (y = 0; y < m - 1; y++) {\n    printf(\"%d \", a[y]);\n  }\n  printf(\"%d\", a[m - 1]);\n  for (z = 0; z < n; z++) {\n    printf(\" %d\", b[z]);\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14734", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint A, B;\nint *a, *b;\nint c[500];\nvoid putin() {\n  int i;\n  cin >> A >> B;\n  a = (int *)malloc(A * sizeof(int));\n  b = (int *)malloc(B * sizeof(int));\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid replace() {\n  int i, j, z;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < A; i++)\n    c[i] = a[i];\n  for (i = A; i < A + B; i++)\n    c[i] = b[i - A];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < A + B; i++) {\n    if (i == 0)\n      printf(\"%d\", c[i]);\n    else\n      printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  putin();\n  replace();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, t, j;\n  int a[2][1000];\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[0][i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[1][i]);\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (a[0][i] > a[0][i + 1]) {\n        t = a[0][i];\n        a[0][i] = a[0][i + 1];\n        a[0][i + 1] = t;\n      }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[1][i] > a[1][i + 1]) {\n        t = a[1][i];\n        a[1][i] = a[1][i + 1];\n        a[1][i + 1] = t;\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[0][i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[1][i]);\n  printf(\"%d\\n\", a[1][n - 1]);\n}\n"}
{"label": "8", "index": "14736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], m, n;\nint main() {\n  void Read(), Ord(), Gath(), Prin();\n  Read();\n  Ord();\n  Gath();\n  Prin();\n  return 0;\n}\n\nvoid Read() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Ord() {\n  int i, j;\n  void swap_a(int i, int j), swap_b(int i, int j);\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (a[i] > a[j])\n        swap_a(i, j);\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (b[i] > b[j])\n        swap_b(i, j);\n}\n\nvoid Gath() {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\n\nvoid Prin() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= m + n; i++)\n    printf(\" %d\", a[i]);\n}\n\nvoid swap_a(int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\n\nvoid swap_b(int i, int j) {\n  int temp;\n  temp = b[i];\n  b[i] = b[j];\n  b[j] = temp;\n}\n"}
{"label": "8", "index": "14737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint arr(int a[], int x, int b[], int y) {\n  int i;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  return 0;\n}\nint arr1(int a[], int x, int b[], int y) {\n  int i, j, tmp;\n  for (i = 0; i < x - 1; i++)\n    for (j = i + 1; j < x; j++)\n      if (a[i] > a[j]) {\n        tmp = a[i];\n        a[i] = a[j];\n        a[j] = tmp;\n      }\n  for (i = 0; i < y - 1; i++)\n    for (j = i + 1; j < y; j++)\n      if (b[i] > b[j]) {\n        tmp = b[i];\n        b[i] = b[j];\n        b[j] = tmp;\n      }\n  return 0;\n}\nint arr2(int a[], int x, int b[], int y, int c[]) {\n  int i, j;\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (; i < x + y; i++)\n    c[i] = b[i - x];\n  return 0;\n}\nint arr3(int c[], int t) {\n  int i;\n  for (i = 0; i < t; i++) {\n    printf(\"%d\", c[i]);\n    if (i < t - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint main() {\n  int x, y;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &x, &y);\n  arr(a, x, b, y);\n  arr1(a, x, b, y);\n  arr2(a, x, b, y, c);\n  arr3(c, x + y);\n  return 0;\n}\n"}
{"label": "8", "index": "14738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint input(int[], int);\nint sort(int[], int);\nvoid combine(int[], int[], int, int);\nvoid output(int[], int, int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  int a[100], b[100];\n  input(a, n1);\n  input(b, n2);\n  sort(a, n1);\n  sort(b, n2);\n  combine(a, b, n1, n2);\n  return 0;\n}\nint input(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  return a[i];\n}\nint sort(int a[], int n) {\n  int i, j, p;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  return a[j];\n}\nvoid combine(int a[], int b[], int n1, int n2) {\n  int c[200];\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n2 + n1; i++)\n    c[i] = b[i - n1];\n  output(c, n1, n2);\n}\nvoid output(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1] << endl;\n}\n"}
{"label": "8", "index": "14739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[20], b[20], c[40], la = 0, lb = 0;\nint read(int a[], int b[]);\nint sort(int a[], int b[]);\nint catenate(int a[], int b[], int c[]);\nint print(int c[], int l);\nint main() {\n  read(a, b);\n  sort(a, b);\n  catenate(a, b, c);\n  print(c, la + lb);\n  return 0;\n}\nint read(int a[], int b[]) {\n  int i;\n  scanf(\"%d %d \", &la, &lb);\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return 0;\n}\nint sort(int a[], int b[]) {\n  int i, j, change;\n  for (i = 1; i < la; i++)\n    for (j = 1; j <= la - i; j++)\n      if (a[j] > a[j + 1]) {\n        change = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = change;\n      }\n  for (i = 1; i < lb; i++)\n    for (j = 1; j <= lb - i; j++)\n      if (b[j] > b[j + 1]) {\n        change = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = change;\n      }\n  return 0;\n}\nint catenate(int a[], int b[], int c[]) {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n  return 0;\n}\nint print(int c[], int l) {\n  int i;\n  cout << c[1];\n  for (i = 2; i <= l; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14740", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m, n, a;\nint str1[10000], str2[10000];\nvoid dosomething(int str[10000], int q);\n\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  for (int i = 0; i < n; i++)\n    cin >> str1[i];\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", &str2[i]);\n  dosomething(str1, n);\n  dosomething(str2, m);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", str1[i]);\n  for (int i = 0; i < m; i++)\n    i == 0 ? printf(\"%d\", str2[i]) : printf(\" %d\", str2[i]);\n  return 0;\n}\n\nvoid dosomething(int str[10000], int q) {\n  for (int i = 0; i < q - 1; i++)\n    for (int j = i + 1; j < q; j++) {\n      if (str[i] > str[j])\n        a = str[i], str[i] = str[j], str[j] = a;\n    }\n}\n"}
{"label": "8", "index": "14741", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[200];\nint b[100];\nint lena = 0;\nint lenb = 0;\nvoid Input() {\n  cin >> lena >> lenb;\n  for (int i = 0; i < lena; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < lenb; i++) {\n    cin >> b[i];\n  }\n}\nvoid Sort() {\n  for (int i = 1; i <= lena - 1; i++) {\n    for (int j = 0; j <= lena - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= lenb - 1; i++) {\n    for (int j = 0; j <= lenb - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid Catenate() {\n  for (int i = 0; i <= lenb - 1; i++) {\n    a[lena + i] = b[i];\n  }\n}\nvoid Output() {\n  cout << a[0];\n  for (int i = 1; i <= lena + lenb - 1; i++) {\n    cout << ' ' << a[i];\n  }\n}\nint main() {\n  Input();\n  Sort();\n  Catenate();\n  Output();\n  return 0;\n}\n"}
{"label": "8", "index": "14742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint first[100];\nint second[100];\nint combination[200];\nint a, b;\nvoid cin_number() {\n  int i;\n  cin >> a >> b;\n  for (i = 0; i < a; i++)\n    cin >> first[i];\n\n  for (i = 0; i < b; i++) {\n    cin >> second[i];\n  }\n}\nvoid rank_1() {\n  int i, j, temp;\n  for (i = (a - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (first[j] > first[j + 1]) {\n        temp = first[j];\n        first[j] = first[j + 1];\n        first[j + 1] = temp;\n      }\n    }\n  }\n  for (i = (b - 1); i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (second[j] > second[j + 1]) {\n        temp = second[j];\n        second[j] = second[j + 1];\n        second[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < a; i++) {\n    combination[i] = first[i];\n  }\n  for (i = 0; i < b; i++) {\n    combination[a + i] = second[i];\n  }\n}\nvoid cout_combination() {\n  int i;\n  for (i = 0; i < (a + b - 1); i++)\n    printf(\"%d \", combination[i]);\n  printf(\"%d\\n\", combination[i]);\n}\nint main() {\n  cin_number();\n  rank_1();\n  combine();\n  cout_combination();\n  return 0;\n}\n"}
{"label": "8", "index": "14743", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid a(int k, int n);\nvoid a(int k, int n) {\n  int e[300] = {0}, f[300] = {0}, i = 0, j = 0, t = 0;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &e[i]);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &f[j]);\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1; j++) {\n      if (e[j] > e[j + 1]) {\n        t = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (f[j] > f[j + 1]) {\n        t = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = t;\n      }\n    }\n  }\n  for (i = k, j = 0; i < k + n; i++, j++) {\n    e[i] = f[j];\n  }\n  for (i = 0; i < n + k; i++) {\n    printf(\"%d\", e[i]);\n    if (i != n + k - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  int k = 0, n = 0;\n\n  scanf(\"%d %d\", &k, &n);\n  a(k, n);\n}\n"}
{"label": "8", "index": "14744", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid input(int *M, int *N, int a[], int b[]) {\n  scanf(\"%d %d\", M, N);\n  int i;\n  for (i = 0; i < *M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < *N; i++)\n    scanf(\"%d\", &b[i]);\n  \n  return;\n}\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid merge(int M, int N, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = 0; i < N; i++)\n    c[i + M] = b[i];\n}\n\nvoid output(int M, int N, int c[]) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[M + N - 1]);\n}\n\nint main() {\n  int M, N, a[100000], b[100000];\n  input(&M, &N, a, b);\n  sort(a, M);\n  sort(b, N);\n\n  int c[100000];\n  merge(M, N, a, b, c);\n  output(M, N, c);\n\n  return 0;\n}\n"}
{"label": "8", "index": "14745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n1, n2;\nint *p1;\nint *p2;\nint *p3;\nint main() {\n  scanf(\"%d %d\", &n1, &n2);\n  p1 = (int *)malloc(n1 * sizeof(int));\n  p2 = (int *)malloc(n2 * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    cin >> p1[k];\n  for (int k = 0; k < n2; k++)\n    scanf(\"%d\", &p2[k]);\n  for (int k = n1 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p1[i] > p1[i + 1]) {\n        int t;\n        t = p1[i];\n        p1[i] = p1[i + 1];\n        p1[i + 1] = t;\n      }\n    }\n  }\n\n  for (int k = n2 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p2[i] > p2[i + 1]) {\n        int t;\n        t = p2[i];\n        p2[i] = p2[i + 1];\n        p2[i + 1] = t;\n      }\n    }\n  }\n  p3 = (int *)malloc((n1 + n2) * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    p3[k] = p1[k];\n  for (int i = n1; i < n1 + n2; i++)\n    p3[i] = p2[i - n1];\n  int c;\n  for (c = 0; c < n1 + n2; c++) {\n    if (c == 0)\n      cout << p3[0];\n    else\n      cout << \" \" << p3[c];\n  }\n}\n"}
{"label": "8", "index": "14746", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint comp(const void *a, const void *b);\nint main() {\n  int n, m, i, j, k;\n  cin >> n >> m;\n  int a[n], b[m];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, n, sizeof(int), comp);\n  qsort(b, m, sizeof(int), comp);\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i < m - 1)\n      printf(\" \");\n  }\n  return 0;\n}\nint comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\n"}
{"label": "8", "index": "14747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], m, n;\nint main() {\n  void Read(), Ord(), Gath(), Prin();\n  Read();\n  Ord();\n  Gath();\n  Prin();\n}\n\nvoid Read() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Ord() {\n  int i, j;\n  void swap_a(int i, int j), swap_b(int i, int j);\n  for (i = 1; i <= m - 1; i++)\n    for (j = i + 1; j <= m; j++)\n      if (a[i] > a[j])\n        swap_a(i, j);\n  for (i = 1; i <= n - 1; i++)\n    for (j = i + 1; j <= n; j++)\n      if (b[i] > b[j])\n        swap_b(i, j);\n}\n\nvoid Gath() {\n  int i;\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n}\n\nvoid Prin() {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= m + n; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\n\nvoid swap_a(int i, int j) {\n  int temp;\n  temp = a[i];\n  a[i] = a[j];\n  a[j] = temp;\n}\n\nvoid swap_b(int i, int j) {\n  int temp;\n  temp = b[i];\n  b[i] = b[j];\n  b[j] = temp;\n}\n"}
{"label": "8", "index": "14748", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100], b[50];\nvoid read(int a[], int b[]) {\n  int i;\n  cin >> a[0] >> b[0];\n  for (i = 1; i <= a[0]; i++)\n    cin >> a[i];\n  for (i = 1; i <= b[0]; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int c, int x[]) {\n  int i, j, k, l;\n  for (i = 1; i <= c; i++) {\n    k = x[i];\n    l = i;\n    for (j = i + 1; j <= c; j++) {\n      if (x[j] < k) {\n        k = x[j];\n        l = j;\n      }\n    }\n    j = x[i];\n    x[i] = k;\n    x[l] = j;\n  }\n}\nvoid one(int m, int n, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[m + i + 1] = b[i + 1];\n  }\n}\nvoid out(int m, int n, int x[]) {\n  int i;\n  for (i = 1; i < m + n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d \", a[m + n]);\n}\nint main() {\n  read(a, b);\n  change(a[0], a);\n  change(b[0], b);\n  one(a[0], b[0], a, b);\n  out(a[0], b[0], a);\n  return 0;\n}\n"}
{"label": "8", "index": "14749", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[1000];\nint b[1000];\n\nvoid input() {\n  int i;\n\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  return;\n}\n\nvoid paixu() {\n  int i, j;\n  int p;\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n\n  return;\n}\n\nvoid output() {\n  int i;\n\n  cout << a[0];\n\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n\n  return;\n}\n\nint main() {\n  input();\n  paixu();\n  output();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x, y, i, j, k;\nvoid a1();\nvoid b1(int *p, int n);\nvoid c(int *p1, int x, int *p2, int y);\nvoid d(int x, int y);\n\nvoid a1() {\n  scanf(\"%d %d \", &x, &y);\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n}\n\nvoid b1(int *p, int n) {\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j + 1] < p[j]) {\n        k = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = k;\n      }\n    }\n}\n\nvoid c(int *p1, int x, int *p2, int y) {\n  for (i = x, j = 0; i < x + y; j++, i++)\n    p1[i] = p2[j];\n}\n\nvoid d(int x, int y) {\n  cout << a[0];\n  for (i = 1; i < x + y; i++)\n    cout << \" \" << a[i];\n}\n\nint main() {\n  a1();\n  b1(a, x);\n  b1(b, y);\n  c(a, x, b, y);\n  d(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[200], i, m, n;\n  scanf(\"%d\", &m);\n  cin >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  int j, p;\n  for (i = m - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n  int q;\n  for (q = 0; q < m; q++)\n    c[q] = a[q];\n  for (q = m; q < m + n; q++)\n    c[q] = b[q - m];\n  int s;\n  printf(\"%d\", c[0]);\n  for (s = 1; s < m + n; s++)\n    cout << \" \" << c[s];\n}\n"}
{"label": "8", "index": "14752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid duqu(int a[], int b[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid paixu(int a[], int b[], int M, int N) {\n  int i = 0, j = 0, temp;\n  for (i = 0; i < M; i++)\n    for (j = i; j < M; j++) {\n      if (a[j] < a[i]) {\n        temp = a[j];\n        a[j] = a[i];\n        a[i] = temp;\n      }\n    }\n  for (i = 0; i < N; i++)\n    for (j = i; j < N; j++) {\n      if (b[j] < b[i]) {\n        temp = b[j];\n        b[j] = b[i];\n        b[i] = temp;\n      }\n    }\n}\n\nvoid hebing(int a[], int b[], int c[], int M, int N) {\n  int i;\n  for (i = 0; i < M; i++)\n    c[i] = a[i];\n  for (i = M; i < M + N; i++)\n    c[i] = b[i - M];\n}\nvoid shuchu(int C[], int M, int N) {\n  int i;\n  for (i = 0; i < M + N - 1; i++)\n    printf(\"%d \", C[i]);\n  printf(\"%d\", C[M + N - 1]);\n}\n\nint main() {\n  int m, n;\n  int a1[100], a2[100], a3[100] = {0};\n  scanf(\"%d%d\", &m, &n);\n  duqu(a1, a2, m, n);\n  paixu(a1, a2, m, n);\n  hebing(a1, a2, a3, m, n);\n  shuchu(a3, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change() {\n  int i, j, middle;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        middle = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = middle;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        middle = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change();\n  prin();\n}\n"}
{"label": "8", "index": "14754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], m, n;\n  void read(int a[], int n);\n  void sort(int a[], int n);\n  void print(int a[], int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  sort(a, m);\n  sort(b, n);\n  print(a, m);\n  printf(\" \");\n  print(b, n);\n  return 0;\n}\nvoid read(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid print(int a[], int n) {\n  int i;\n  for (i = 0;; i++) {\n    printf(\"%d\", a[i]);\n    n--;\n    if (n)\n      printf(\" \");\n    else\n      break;\n  }\n}\n"}
{"label": "8", "index": "14755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, i, j, k, a[100], b[100];\nint read() {\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  return 0;\n}\nint sorta() {\n  int min, t;\n  for (i = 1; i <= n - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[min] > a[j])\n        min = j;\n    t = a[i];\n    a[i] = a[min];\n    a[min] = t;\n  }\n  return 0;\n}\nint sortb() {\n  int min, t;\n  for (i = 1; i <= m - 1; i++) {\n    min = i;\n    for (j = i + 1; j <= m; j++)\n      if (b[min] > b[j])\n        min = j;\n    t = b[i];\n    b[i] = b[min];\n    b[min] = t;\n  }\n  return 0;\n}\nint write() {\n  for (i = 1; i <= n; i++)\n    cout << a[i] << ' ';\n  for (i = 1; i < m; i++)\n    cout << b[i] << ' ';\n  cout << b[m] << endl;\n  return 0;\n}\nint main() {\n  k = read();\n  k = sorta();\n  k = sortb();\n  k = write();\n  return 0;\n}\n"}
{"label": "8", "index": "14756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid putin(int *p, int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> *(p + i);\n}\nvoid putout(int *p, int n) {\n  int m, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (*(p + j) > *(p + j + 1)) {\n        m = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = m;\n      }\n  }\n  cout << *(p + 1);\n  for (i = 2; i < n + 1; i++)\n    printf(\" %d\", *(p + i));\n}\nint main() {\n  int n1, n2, a[10000], b[10000], *pa, *pb;\n  pa = a;\n  pb = b;\n  cin >> n1 >> n2;\n  putin(pa, n1);\n  putin(pb, n2);\n  putout(pa, n1);\n  cout << \" \";\n  putout(pb, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14757", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid read(int n1, int n2, int s1[], int s2[]);\nvoid bubble_sort(int s[], int n);\nvoid write(int n1, int n2, int s1[], int s2[]);\nint main() {\n  int n1, n2, s1[101], s2[101];\n  scanf(\"%d%d\", &n1, &n2);\n  read(n1, n2, s1, s2);\n  bubble_sort(s1, n1);\n  bubble_sort(s2, n2);\n  write(n1, n2, s1, s2);\n  return 0;\n}\nvoid read(int n1, int n2, int s1[], int s2[]) {\n  int i;\n\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &s2[i]);\n}\nvoid bubble_sort(int s[], int n) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (s[j] > s[j + 1]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n}\nvoid write(int n1, int n2, int s1[], int s2[]) {\n  int i;\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < n1; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n2; i++)\n    printf(\" %d\", s2[i]);\n}\n"}
{"label": "8", "index": "14758", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstatic int a[100], b[100], c[300];\nchar z;\nvoid scan() {\n  static int m, n, i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= 99; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &a[i], &z);\n  }\n  z = 1;\n  for (i = 0; z != '\\n'; i++) {\n    cin >> b[i] >> z;\n  }\n}\nvoid ord() {\n  int i, j, temp;\n  for (i = 0; a[i] != '\\0'; i++) {\n    for (j = i + 1; a[j] != '\\0'; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    for (j = i + 1; b[j] != '\\0'; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid bin() {\n  static int i, j;\n  for (i = 0; i <= 299; i++) {\n\n    c[i] = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c[i] = a[i];\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    c[j + i] = b[j];\n  }\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; c[i] != 0; i++)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  scan();\n  ord();\n  bin();\n  print();\n}\n"}
{"label": "8", "index": "14759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[200], a2[200], i, j, t;\nvoid toscan() {\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid paixu() {\n  for (i = 1; i < n1; i++)\n    for (j = 0; j < i; j++)\n      if (a1[j] > a1[i]) {\n        t = a1[i];\n        a1[i] = a1[j];\n        a1[j] = t;\n      }\n  for (i = 1; i < n2; i++)\n    for (j = 0; j < i; j++)\n      if (a2[j] > a2[i]) {\n        t = a2[i];\n        a2[i] = a2[j];\n        a2[j] = t;\n      }\n}\n\nvoid hebing() {\n  for (i = 0; i < n2; i++)\n    a1[i + n1] = a2[i];\n}\n\nvoid toprint() {\n  printf(\"%d\", a1[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", a1[i]);\n}\n\nint main() {\n  toscan();\n  paixu();\n  hebing();\n  toprint();\n  return 0;\n}\n"}
{"label": "8", "index": "14760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100];\nvoid shuru() {\n  int i;\n  cin >> n >> m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid paixu() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++) {\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n    }\n}\nvoid hebin() {\n  int i;\n  for (i = n + 1; i <= n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\\n\", a[m + n]);\n}\nint main() {\n  shuru();\n  paixu();\n  hebin();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid s(int m);\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  s(a);\n  printf(\" \");\n  s(b);\n}\nvoid s(int m) {\n  int i, j, c[1000], d;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        d = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int *a, int x) {\n  int i = x - 1, t, j;\n  while (i >= 1) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n    i--;\n  }\n}\nvoid lianjie(int *a, int x, int *b, int y, int *c) {\n  int i = 0, j = 0, t = 1;\n  while (i < x) {\n    c[i] = a[i];\n    i++;\n  }\n  while (j < y) {\n    c[i] = b[j];\n    i++;\n    j++;\n  }\n  cout << c[0];\n  while (t < x + y) {\n    cout << \" \" << c[t];\n    t++;\n  }\n}\nint main() {\n  int s, t, i;\n  scanf(\"%d %d\", &s, &t);\n  int *a = (int *)malloc(s * sizeof(int));\n  int *b = (int *)malloc(t * sizeof(int));\n  int *c = (int *)malloc((s + t) * sizeof(int));\n  for (i = 0; i < s; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < t; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, s);\n  paixu(b, t);\n  lianjie(a, s, b, t, c);\n}\n"}
{"label": "8", "index": "14763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b, c[20] = {0}, d[20] = {0}, e[40] = {0};\nvoid in() {\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint number(int m[]) {\n  int i, n = 0;\n  for (i = 0; m[i] != 0; i++)\n    n++;\n  return n;\n}\nvoid change(int s[]) {\n  int i, j, m;\n  for (i = 1; i < number(s); i++) {\n    for (j = 0; j < number(s) - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        m = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int m[], int n[]) {\n  int i, j = 0;\n  for (i = 0; m[i] != 0; i++) {\n    e[i] = m[i];\n    j++;\n  }\n  for (i = 0; n[i] != 0; i++) {\n    e[j] = n[i];\n    j++;\n  }\n}\nvoid out() {\n  int i;\n  for (i = 0; e[i] != 0; i++) {\n    printf(\"%d\", e[i]);\n    if (e[i + 1] != 0)\n      printf(\" \");\n  }\n}\nint main() {\n  in();\n  change(c);\n  change(d);\n  link(c, d);\n  out();\n}\n"}
{"label": "8", "index": "14764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], m, n;\nvoid shuru(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu(int f[], int length) {\n  int x;\n  for (int i = 0; i < length - 1; i++)\n    for (int j = 0; j <= length - 2 - i; j++)\n      if (f[j] > f[j + 1]) {\n        x = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = x;\n      }\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << ' ';\n  printf(\"%d\\n\", b[i]);\n}\nint main() {\n  shuru();\n  paixu(a, m);\n  paixu(b, n);\n\n  shuchu();\n}\n"}
{"label": "8", "index": "14765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int n, int a[]) {\n  int i, j, m;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\n\nint main() {\n  int i, k;\n  int n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (k = 0; k < m; k++)\n    scanf(\"%d\", &b[k]);\n  paixu(n, a);\n  paixu(m, b);\n  link(a, b, c, n, m);\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n1, n2;\nint *p1;\nint *p2;\nint *p3;\nint main() {\n  scanf(\"%d %d\", &n1, &n2);\n  p1 = (int *)malloc(n1 * sizeof(int));\n  p2 = (int *)malloc(n2 * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    scanf(\"%d\", &p1[k]);\n  for (int k = 0; k < n2; k++)\n    scanf(\"%d\", &p2[k]);\n  for (int k = n1 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p1[i] > p1[i + 1]) {\n        int t;\n        t = p1[i];\n        p1[i] = p1[i + 1];\n        p1[i + 1] = t;\n      }\n    }\n  }\n\n  for (int k = n2 - 1; k > 0; k--) {\n    for (int i = 0; i < k; i++) {\n      if (p2[i] > p2[i + 1]) {\n        int t;\n        t = p2[i];\n        p2[i] = p2[i + 1];\n        p2[i + 1] = t;\n      }\n    }\n  }\n  p3 = (int *)malloc((n1 + n2) * sizeof(int));\n  for (int k = 0; k < n1; k++)\n    p3[k] = p1[k];\n  for (int i = n1; i < n1 + n2; i++)\n    p3[i] = p2[i - n1];\n  int c;\n  for (c = 0; c < n1 + n2; c++) {\n    if (c == 0)\n      cout << p3[0];\n    else\n      printf(\" %d\", p3[c]);\n  }\n}\n"}
{"label": "8", "index": "14767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid in(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid bubblesort(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n}\n\nvoid strc(int a[], int b[], int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n}\nvoid print(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[n1 + n2 - 1]);\n}\n\nint main() {\n  int i, n1, n2, a[100], b[100], c[200];\n  scanf(\"%d %d\", &n1, &n2);\n  in(a, n1);\n  in(b, n2);\n\n  bubblesort(a, n1);\n  bubblesort(b, n2);\n  strc(a, b, c, n1, n2);\n  print(c, n1, n2);\n}\n"}
{"label": "8", "index": "14768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[233], b[233];\nint n, m, i, j, z;\nvoid shuru(int p) {\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int p) {\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n    }\n  }\n}\nvoid hebing(int p) {\n  for (i = n; i < m + n; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid shuchu(int p) {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++) {\n    cout << \" \" << a[i];\n  }\n}\nint main() {\n  shuru(0);\n  paixu(0);\n  hebing(0);\n  shuchu(0);\n}\n"}
{"label": "8", "index": "14769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid change(int a[], int b[], int c[]) {\n  int x = 0, y = 0;\n  cin >> x >> y;\n  int i = 0;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  int j = 0, t = 0;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    cout << c[i] << ' ';\n  cout << c[x + y - 1];\n} \nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0};\n  change(a, b, c); \n  return 0;\n}\n"}
{"label": "8", "index": "14770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid Do(int m, int n) {\n  int a[m], b[n];\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  qsort(a, m, 4, compare);\n  qsort(b, n, 4, compare);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d \", b[n - 1]);\n}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  Do(m, n);\n}\n"}
{"label": "8", "index": "14771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[20], b[20], c[40], la = 0, lb = 0;\nint read(int a[], int b[]);\nint sort(int a[], int b[]);\nint catenate(int a[], int b[], int c[]);\nint print(int c[], int l);\nint main() {\n  read(a, b);\n  sort(a, b);\n  catenate(a, b, c);\n  print(c, la + lb);\n  return 0;\n}\nint read(int a[], int b[]) {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return 0;\n}\nint sort(int a[], int b[]) {\n  int i, j, change;\n  for (i = 1; i < la; i++)\n    for (j = 1; j <= la - i; j++)\n      if (a[j] > a[j + 1]) {\n        change = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = change;\n      }\n  for (i = 1; i < lb; i++)\n    for (j = 1; j <= lb - i; j++)\n      if (b[j] > b[j + 1]) {\n        change = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = change;\n      }\n  return 0;\n}\nint catenate(int a[], int b[], int c[]) {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n  return 0;\n}\nint print(int c[], int l) {\n  int i;\n  cout << c[1];\n  for (i = 2; i <= l; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], m, n;\n  void read(int a[], int n);\n  void sort(int a[], int n);\n  void print(int a[], int n);\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  sort(a, m);\n  sort(b, n);\n  print(a, m);\n  printf(\" \");\n  print(b, n);\n  return 0;\n}\nvoid read(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = n - 1; i > 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid print(int a[], int n) {\n  int i;\n  for (i = 0;; i++) {\n    printf(\"%d\", a[i]);\n    n--;\n    if (n)\n      printf(\" \");\n    else\n      break;\n  }\n}\n"}
{"label": "8", "index": "14773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint q[100], w[100], m, n, i, j, k, v, y = 0;\nvoid a(), b(), c(), d();\nint main() {\n  a();\n  b();\n  c();\n  d();\n}\nvoid a() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &q[i]);\n  for (i = 0; i < n; i++)\n    cin >> w[i];\n}\nvoid b() {\n  for (j = 0; j < m - 1; j++) {\n    for (k = j + 1; k < m; k++) {\n      if (q[j] > q[k]) {\n        v = q[k];\n        q[k] = q[j];\n        q[j] = v;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (w[j] > w[k]) {\n        v = w[k];\n        w[k] = w[j];\n        w[j] = v;\n      }\n    }\n  }\n}\nvoid c() {\n  for (i = m; i < m + n; i++)\n    q[i] = w[y++];\n}\nvoid d() {\n  cout << q[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", q[i]);\n}\n"}
{"label": "8", "index": "14774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid turn(int a[], int n) {\n  int temp, i, j;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i];\n    if (i < n - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int x, y, i;\n  int b[100], c[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &c[i]);\n\n  turn(b, x);\n  cout << \" \";\n  turn(c, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14775", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid mode(int x, int y) {\n  int num1[100], num2[100], num3[200];\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    cin >> num1[i];\n  for (j = 0; j < x - 1; j++)\n    for (k = 0; k < x - 1 - j; k++)\n      if (num1[k] > num1[k + 1])\n        swap(num1[k], num1[k + 1]);\n  for (i = 0; i < y; i++)\n    cin >> num2[i];\n  for (j = 0; j < y - 1; j++)\n    for (k = 0; k < y - 1 - j; k++)\n      if (num2[k] > num2[k + 1])\n        swap(num2[k], num2[k + 1]);\n  for (i = 0; i < x; i++)\n    num3[i] = num1[i];\n  for (i = x; i < (x + y); i++)\n    num3[i] = num2[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    cout << num3[i] << \" \";\n  cout << num3[x + y - 1];\n}\nint main() {\n  int x, y;\n  cin >> x >> y;\n  mode(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int a[], int m) {\n  int i, j, d;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        d = a[i];\n        a[i] = a[j];\n        a[j] = d;\n      }\n    }\n  }\n  return;\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n  return;\n}\n\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint a_n, b_n, i;\nvoid read() {\n  scanf(\"%d %d\", &a_n, &b_n);\n  for (i = 0; i < a_n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < b_n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int a_n, int b[], int b_n) {\n  int i, j, key;\n  for (i = 1; i < a_n; i++) {\n    key = a[i];\n    j = i - 1;\n    while (a[j] > key && j >= 0) {\n      a[j + 1] = a[j];\n      j--;\n    }\n    a[j + 1] = key;\n  }\n  for (i = 1; i < b_n; i++) {\n    key = b[i];\n    j = i - 1;\n    while (b[j] > key && j >= 0) {\n      b[j + 1] = b[j];\n      j--;\n    }\n    b[j + 1] = key;\n  }\n}\nvoid merge(int a[], int a_n, int b[], int b_n) {\n  int i;\n  for (i = 0; i < b_n; i++)\n    a[a_n + i] = b[i];\n}\nvoid write() {\n  int i;\n  for (i = 0; i < a_n + b_n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\nint main() {\n  read();\n  sort(a, a_n, b, b_n);\n  merge(a, a_n, b, b_n);\n  write();\n}\n"}
{"label": "8", "index": "14778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint na, nb;\nint a[10000], b[10000], c[10000];\nvoid f1() {\n  cin >> na >> nb;\n  for (int i = 0; i <= na - 1; i++)\n    cin >> a[i];\n  for (int i = 0; i <= nb - 1; i++)\n    cin >> b[i];\n}\nvoid f2() {\n  sort(a, a + na);\n  sort(b, b + nb);\n}\nvoid f3() {\n  for (int i = 0; i <= na - 1; i++)\n    c[i] = a[i];\n  for (int i = na; i <= na + nb - 1; i++)\n    c[i] = b[i - na];\n}\nvoid f4() {\n  cout << c[0];\n  for (int i = 1; i <= na + nb - 1; i++) {\n    cout << ' ' << c[i];\n  }\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14779", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100], c[200];\nvoid in() {\n  cin >> n >> m;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid pai(int *p, int k) {\n  int i, j, temp;\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid out() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  pai(a, n);\n  pai(b, m);\n  he();\n  out();\n}\n"}
{"label": "8", "index": "14780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint a_n, b_n, i;\nvoid read() {\n  scanf(\"%d %d\", &a_n, &b_n);\n  for (i = 0; i < a_n; i++)\n    cin >> a[i];\n  for (i = 0; i < b_n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int a_n, int b[], int b_n) {\n  int i, j, key;\n  for (i = 1; i < a_n; i++) {\n    key = a[i];\n    j = i - 1;\n    while (a[j] > key && j >= 0) {\n      a[j + 1] = a[j];\n      j--;\n    }\n    a[j + 1] = key;\n  }\n  for (i = 1; i < b_n; i++) {\n    key = b[i];\n    j = i - 1;\n    while (b[j] > key && j >= 0) {\n      b[j + 1] = b[j];\n      j--;\n    }\n    b[j + 1] = key;\n  }\n}\nvoid merge(int a[], int a_n, int b[], int b_n) {\n  int i;\n  for (i = 0; i < b_n; i++)\n    a[a_n + i] = b[i];\n}\nvoid write() {\n  int i;\n  for (i = 0; i < a_n + b_n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\nint main() {\n  read();\n  sort(a, a_n, b, b_n);\n  merge(a, a_n, b, b_n);\n  write();\n  return 0;\n}\n"}
{"label": "8", "index": "14781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint input(int *s, int n) {}\nint sort(int *s, int n) {}\nint main() {\n  int m, n;\n  scanf(\"%d %d\", &m, &n);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  int *s = (int *)malloc((m + n) * sizeof(int));\n  for (int i = 0; i < m; i++)\n    scanf(\"%d\", a + i);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", b + i);\n  for (int i = 1; i < m; i++)\n    for (int j = 0; j < m - i; j++) {\n      if (*(a + j) > *(a + (j + 1))) {\n        int t;\n        t = *(a + j);\n        *(a + j) = *(a + (j + 1));\n        *(a + (j + 1)) = t;\n      }\n    }\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n - i; j++) {\n      if (*(b + j) > *(b + (j + 1))) {\n        int t;\n        t = *(b + j);\n        *(b + j) = *(b + (j + 1));\n        *(b + (j + 1)) = t;\n      }\n    }\n  for (int i = 0; i < m; i++)\n    s[i] = a[i];\n  for (int i = 0; i < n; i++)\n    s[m + i] = b[i];\n  for (int i = 0; i < m + n; i++) {\n    if (i == 0)\n      cout << s[i];\n    else\n      cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n1, n2, a[200], b[100];\n\nvoid readNum() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Bubble() {\n  int t, i, j;\n  for (i = n1 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n2 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid gether() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\n\nvoid printNum() {\n  int i;\n  for (i = 0; i < n1 + n2; i++)\n    printf(\"%d%c\", a[i], (i < n1 + n2 - 1) ? ' ' : '\\n');\n}\n\nint main() {\n  readNum();\n  Bubble();\n  gether();\n  printNum();\n  return 0;\n}\n"}
{"label": "8", "index": "14783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int n1, n2, a[100] = {0}, b[100] = {0}, d[200] = {0};\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid pai() {\n  int c, i, j;\n  for (j = 0; j < n1; j++) {\n    for (i = 0; i < n1 - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n    }\n  }\n  for (j = 0; j < n2; j++) {\n    for (i = 0; i < n2 - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n    }\n  }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    d[i] = b[i - n1];\n  }\n}\nvoid shu() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++) {\n    printf(\"%d \", d[i]);\n  }\n  printf(\"%d\", d[n1 + n2 - 1]);\n}\nint main() {\n  f1();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "14784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid shuru(int a[], int b[]);\nvoid paixu(int a[]);\nvoid hebing(int a[], int b[]);\nvoid shuchu(int a[]);\nint main() {\n  int a[100] = {0}, b[100] = {0};\n  shuru(a, b);\n  paixu(a);\n  paixu(b);\n  hebing(a, b);\n  shuchu(a);\n  return 0;\n}\n\nvoid shuru(int a[], int b[]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[]) {\n  int i, j, temp, len = 0;\n  for (i = 0; a[i] != 0; i++)\n    len++;\n  for (j = 1; j < len; j++) {\n    for (i = 0; i < len - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid hebing(int a[], int b[]) {\n  int i, lena = 0, lenb = 0;\n  for (i = 0; a[i] != 0; i++)\n    lena++;\n  for (i = 0; b[i] != 0; i++)\n    lenb++;\n  for (i = 0; i < lenb; i++)\n    a[i + lena] = b[i];\n}\n\nvoid shuchu(int a[]) {\n  int i;\n  cout << a[0];\n  for (i = 1; a[i] != 0; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "8", "index": "14785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid read(int *pm, int *pn, int *p1, int *p2) {\n  int i, j;\n  scanf(\"%d %d\", pm, pn);\n  for (i = 0; i < *pm; i++)\n    scanf(\"%d\", p1 + i);\n  for (j = 0; j < *pn; j++)\n    scanf(\"%d\", p2 + j);\n}\n\nvoid sort(int *pm, int *pn, int *p1, int *p2) {\n  int i, j, k, tmp;\n  for (i = 0; i < *pm - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pm; j++)\n      if (*(p1 + j) < *(p1 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p1 + k);\n      *(p1 + k) = *(p1 + i);\n      *(p1 + i) = tmp;\n    }\n  }\n  for (i = 0; i < *pn - 1; i++) {\n    k = i;\n    for (j = i + 1; j < *pn; j++)\n      if (*(p2 + j) < *(p2 + k))\n        k = j;\n    if (k != i) {\n      tmp = *(p2 + k);\n      *(p2 + k) = *(p2 + i);\n      *(p2 + i) = tmp;\n    }\n  }\n}\n\nint combine(int *pm, int *pn, int *p1, int *p2, int *pnew) {\n  int i, j;\n  for (i = 0; i < *pm; i++)\n    *(pnew + i) = *(p1 + i);\n  for (j = 0; j < *pn; j++)\n    *(pnew + i + j) = *(p2 + j);\n  return i + j;\n}\n\nvoid print(int *pk, int *pnew) {\n  int i;\n  for (i = 0; i < *pk; i++) {\n    cout << *(pnew + i);\n    if (i == *pk - 1)\n      cout << \"\\n\";\n    else\n      cout << \" \";\n  }\n}\n\nint main() {\n  int m = 0, n = 0, k = 0, a[10] = {0}, b[10] = {0};\n  int *pm = &m, *pn = &n, *pa = a, *pb = b;\n  int New[20] = {0}, *pk = &k, *pnew = New;\n\n  read(pm, pn, pa, pb);\n  sort(pm, pn, pa, pb);\n  *pk = combine(pm, pn, pa, pb, pnew);\n  print(pk, pnew);\n}\n"}
{"label": "8", "index": "14786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fuction1(int x, int a[]) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%d \", a[i]);\n}\nvoid fuction2(int y, int b[]) {\n  int i, j, m;\n  for (i = 0; i < y; i++)\n    for (j = 0; j < y - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n  for (i = 0; i < y - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[y - 1]);\n}\nint main() {\n  int k, p, q, a[1000000], b[1000000];\n  cin >> p >> q;\n  for (k = 0; k < p; k++)\n    cin >> a[k];\n  for (k = 0; k < q; k++)\n    cin >> b[k];\n  fuction1(p, a);\n  fuction2(q, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14787", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint A, B, a[300], b[300], c[600];\nvoid w() {\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < B; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid x() {\n  int i, j, t;\n  for (i = 0; i < A - 1; i++)\n    for (j = 0; j < A - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < B - 1; i++)\n    for (j = 0; j < B - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid y() {\n  int i;\n  for (i = 0; i < A + B; i++)\n    if (i < A)\n      c[i] = a[i];\n    else\n      c[i] = b[i - A];\n}\nvoid z() {\n  int i;\n  for (i = 0; i < A + B - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[A + B - 1]);\n}\nint main() {\n  w();\n  x();\n  y();\n  z();\n  return 0;\n}\n"}
{"label": "8", "index": "14788", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint temp, m, n;\nint a[100], b[100];\n\nvoid scanf() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid bubblesorta() {\n  for (int i = 0; i < m; i++)\n    for (int j = 1; j < m - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n}\nvoid bubblesortb() {\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n}\n\nvoid printf() {\n  for (int i = 0; i < m; i++) {\n    if (i)\n      printf(\" %d\", a[i]);\n    else\n      cout << a[i];\n  }\n  for (int i = 0; i < n; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  scanf();\n  bubblesorta();\n  bubblesortb();\n  printf();\n  return 0;\n}\n"}
{"label": "8", "index": "14789", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m[2], i, j, k, a[2][100], p;\n  cin >> m[0] >> m[1];\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      scanf(\"%d\", &a[k][i]);\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      for (j = 0; j < m[k] - i - 1; j++) {\n        if (a[k][j] > a[k][j + 1]) {\n          p = a[k][j];\n          a[k][j] = a[k][j + 1];\n          a[k][j + 1] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < 2; k++) {\n    for (i = 0; i < m[k]; i++) {\n      if (!(k == 0 && i == 0)) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[k][i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct nums {\n  int m;\n  int n;\n  int x[2][100];\n};\nstruct nums get() {\n  int i;\n  struct nums in;\n  scanf(\"%d%d\", &in.m, &in.n);\n  getchar();\n  for (i = 0; i < in.m; i++)\n    scanf(\"%d\", &in.x[0][i]);\n  for (i = 0; i < in.n; i++)\n    scanf(\"%d\", &in.x[1][i]);\n\n  return in;\n}\nstruct nums bubble(struct nums in) {\n  int i, j, c;\n  for (i = 1; i <= in.m; i++)\n    for (j = 0; j < in.m - 1; j++)\n      if (in.x[0][j] > in.x[0][j + 1]) {\n        c = in.x[0][j];\n        in.x[0][j] = in.x[0][j + 1];\n        in.x[0][j + 1] = c;\n      }\n  for (i = 1; i <= in.n; i++) {\n    for (j = 0; j < in.n - 1; j++)\n      if (in.x[1][j] > in.x[1][j + 1]) {\n        c = in.x[1][j];\n        in.x[1][j] = in.x[1][j + 1];\n        in.x[1][j + 1] = c;\n      }\n  }\n  return in;\n}\nstruct nums combine(struct nums in) {\n  int i;\n  for (i = in.m; i < in.m + in.n; i++)\n    in.x[0][i] = in.x[1][i - in.m];\n  return in;\n}\nvoid put(struct nums in) {\n  int i;\n  printf(\"%d\", in.x[0][0]);\n  for (i = 1; i < in.m + in.n; i++)\n    printf(\" %d\", in.x[0][i]);\n}\nint main() {\n  struct nums in = get();\n  struct nums ina = bubble(in);\n  struct nums inb = combine(ina);\n  put(inb);\n}\n"}
{"label": "8", "index": "14791", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  cin >> A;\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n\n  for (int j = 0; j < A + B; j++) {\n    printf(\"%d\", c[j]);\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n"}
{"label": "8", "index": "14792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sr();\n  int px(int a[100], int x, int k);\n  void hb(int a[100], int b[100], int x, int y);\n  int i, a[100], b[100], c[200], x, y;\n  x = sr();\n  y = sr();\n  for (i = 0; i < x; i++)\n    a[i] = sr();\n\n  for (i = 0; i < y; i++) {\n    b[i] = sr();\n  }\n  for (i = 0; i < x; i++) {\n    a[i] = px(a, x, i);\n  }\n  for (i = 0; i < y; i++) {\n    b[i] = px(b, y, i);\n  }\n  hb(a, b, x, y);\n  return 0;\n}\nint sr() {\n  int a;\n  scanf(\"%d\", &a);\n  return (a);\n}\nint px(int a[100], int x, int k) {\n  int i, j, temp;\n  for (i = x - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  temp = a[k];\n  return (temp);\n}\nvoid hb(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "14793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  if (*(int *)elem1 > *(int *)elem2)\n    return 1;\n  if (*(int *)elem1 == *(int *)elem2)\n    return 0;\n  if (*(int *)elem1 < *(int *)elem2)\n    return -1;\n}\nint *shuru(int m, int *a) {\n  a = (int *)malloc(m * sizeof(int));\n  int i;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < m; i++)\n    scanf(\" %d\", &a[i]);\n\n  return a;\n}\nint main() {\n  int suma, sumb, i;\n  int *a;\n  int *b;\n  scanf(\"%d %d\", &suma, &sumb);\n  a = shuru(suma, a);\n  b = shuru(sumb, b);\n  qsort(a, suma, sizeof(int), Compare);\n  qsort(b, sumb, sizeof(int), Compare);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < suma; i++) {\n    printf(\" %d\", a[i]);\n  }\n  cout << \" \" << b[0];\n  for (i = 1; i < sumb; i++) {\n    printf(\" %d\", b[i]);\n  }\n  free(a);\n  free(b);\n}\n"}
{"label": "8", "index": "14794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid guochen(int array[], int n) {\n  int a, i, j;\n  for (a = 0; a < n; a++)\n    scanf(\"%d \", &array[a]);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (array[j] < array[i]) {\n        int k;\n        k = array[i];\n        array[i] = array[j];\n        array[j] = k;\n      }\n    }\n  }\n}\nvoid shuchu(int one[], int n, int two[], int m) {\n  int i, j;\n  printf(\"%d\", one[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", one[i]);\n  for (j = 0; j < m; j++)\n    cout << \" \" << two[j];\n}\nint main() {\n  int n, m, one[100], two[100];\n  scanf(\"%d %d\", &n, &m);\n  guochen(one, n);\n  guochen(two, m);\n  shuchu(one, n, two, m);\n}\n"}
{"label": "8", "index": "14795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000], i, j, n, m;\nvoid read() {\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort() {\n  int t;\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++)\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++)\n      if (b[j] < b[i]) {\n        t = b[j];\n        b[j] = b[i];\n        b[i] = t;\n      }\n}\nvoid add() {\n  for (i = m, j = 0; j < n; i++, j++) {\n    a[i] = b[j];\n  }\n}\nvoid print() {\n  for (i = 0; i < m + n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  read();\n  sort();\n  add();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid in(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid bubblesort(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--)\n      if (a[j - 1] > a[j]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n}\n\nvoid strc(int a[], int b[], int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n}\nvoid print(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1];\n}\n\nint main() {\n  int n1, n2, a[100], b[100], c[200];\n  scanf(\"%d %d\", &n1, &n2);\n  in(a, n1);\n  in(b, n2);\n\n  bubblesort(a, n1);\n  bubblesort(b, n2);\n  strc(a, b, c, n1, n2);\n  print(c, n1, n2);\n}\n"}
{"label": "8", "index": "14797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid mode(int x, int y) {\n  int num1[100], num2[100], num3[200];\n  int i, j, k;\n  for (i = 0; i < x; i++)\n    cin >> num1[i];\n  for (j = 0; j < x - 1; j++)\n    for (k = 0; k < x - 1 - j; k++)\n      if (num1[k] > num1[k + 1])\n        swap(num1[k], num1[k + 1]);\n  for (i = 0; i < y; i++)\n    cin >> num2[i];\n  for (j = 0; j < y - 1; j++)\n    for (k = 0; k < y - 1 - j; k++)\n      if (num2[k] > num2[k + 1])\n        swap(num2[k], num2[k + 1]);\n  for (i = 0; i < x; i++)\n    num3[i] = num1[i];\n  for (i = x; i < (x + y); i++) {\n    num3[i] = num2[i - x];\n  }\n  for (i = 0; i < x + y - 1; i++)\n    cout << num3[i] << \" \";\n  cout << num3[x + y - 1];\n}\nint main() {\n  int x, y;\n  cin >> x >> y;\n  mode(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[999] = {0}, b[999] = {0}, c[1999] = {0};\nint m, n;\nvoid f() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid rank_1() {\n  int i, j, k;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\nvoid print() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  f();\n  rank_1();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14799", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint len1, len2;\nint *sz1, *sz2;\n\nvoid read() {\n  int i;\n  scanf(\"%d%d\", &len1, &len2);\n  sz1 = (int *)malloc(1000 * (len1 + len2));\n  sz2 = (int *)malloc(1000 * len2);\n\n  for (i = 0; i < len1; i++)\n    scanf(\"%d\", sz1 + i);\n  for (i = 0; i < len2; i++)\n    scanf(\"%d\", sz2 + i);\n}\nvoid sort() {\n  int i, j, temp;\n\n  for (i = 0; i < len1; i++) {\n    for (j = i + 1; j < len1; j++)\n      if (sz1[i] > sz1[j]) {\n        temp = sz1[i];\n        sz1[i] = sz1[j];\n        sz1[j] = temp;\n      }\n  }\n  for (i = 0; i < len2; i++) {\n    for (j = i + 1; j < len2; j++)\n      if (sz2[i] > sz2[j]) {\n        temp = sz2[i];\n        sz2[i] = sz2[j];\n        sz2[j] = temp;\n      }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = 0; i < len2; i++) {\n    sz1[len1 + i] = sz2[i];\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", sz1[0]);\n  for (i = 1; i < len1 + len2; i++)\n    printf(\" %d\", sz1[i]);\n\n  printf(\" \");\n}\n\nint main() {\n  read();\n  sort();\n  combine();\n  print();\n}\n"}
{"label": "8", "index": "14800", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[100];\nvoid input() {\n  cin >> m >> n;\n  int i, j;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (j = 1; j <= n; j++)\n    cin >> b[j];\n}\nvoid paixu(int a[100], int b[100]) {\n  int i, j, k, l;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j < m - i + 1; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n - i + 1; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n}\nvoid he(int a[100], int b[100]) {\n  int i, j;\n  for (i = 1; i <= m; i++)\n    c[i] = a[i];\n  for (j = i; j <= i + n; j++)\n    c[j] = b[j - i + 1];\n}\nvoid output(int c[100]) {\n  cout << c[1];\n  int i;\n  for (i = 2; i <= m + n; i++)\n    cout << ' ' << c[i];\n}\n\nint main() {\n  input();\n  paixu(a, b);\n  he(a, b);\n  output(c);\n  return 0;\n}\n"}
{"label": "8", "index": "14801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[50], b[50], e[100];\nint c, d;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &c, &d);\n  for (i = 0; i < c; i++)\n    cin >> a[i];\n\n  for (i = 0; i < d; i++) {\n    cin >> b[i];\n  }\n}\nvoid change() {\n  int i, j, t;\n  for (j = 0; j < c - 1; j++) {\n    for (i = 0; i < c - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < d - 1; j++) {\n\n    for (i = 0; i < d - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid to() {\n  int i;\n  for (i = 0; i < c; i++) {\n    e[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    e[i + c] = b[i];\n  }\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < (c + d) - 1; i++) {\n    printf(\"%d \", e[i]);\n  }\n  printf(\"%d\", e[c + d - 1]);\n}\nint main() {\n  input();\n  change();\n  to();\n  output();\n}\n"}
{"label": "8", "index": "14802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d%d\", &a, &b);\n  int i, j;\n  int s1[1000], s2[1000];\n  for (i = 1; i <= a; i++)\n    cin >> s1[i];\n  for (i = 1; i <= b; i++)\n    cin >> s2[i];\n  for (i = 1; i <= a - 1; i++)\n    for (j = 1; j <= a - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        int t;\n        t = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = t;\n      }\n  for (i = 1; i <= b - 1; i++)\n    for (j = 1; j <= b - i; j++)\n      if (s2[j] > s2[j + 1]) {\n        int t;\n        t = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = t;\n      }\n  for (i = 1; i <= a; i++)\n    printf(\"%d \", s1[i]);\n  for (i = 1; i <= b - 1; i++)\n    cout << s2[i] << \" \";\n  printf(\"%d\", s2[b]);\n}\n"}
{"label": "8", "index": "14803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int num[], int a[]) {\n  int j;\n  scanf(\"%d%d\", &num[0], &num[1]);\n  for (j = 0; j < num[0] + num[1]; j++)\n    scanf(\"%d\", &a[j]);\n}\nvoid order(int num[], int a[]) {\n  int j, k, temp;\n  for (j = 0; j < num[0]; j++) {\n    for (k = num[0] - 1; k > 0; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n  for (j = num[0]; j < num[0] + num[1]; j++) {\n    for (k = num[0] + num[1] - 1; k > num[0]; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int num[], int a[]) {\n  int i;\n  for (i = 0; i < num[0] + num[1] - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[num[0] + num[1] - 1]);\n}\nint main() {\n  int a[40], num[2];\n  input(num, a);\n  order(num, a);\n  print(num, a);\n}\n"}
{"label": "8", "index": "14804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(void) {\n  int A[100], B[100], C[200], i, j, k, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &B[i]);\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (A[j] > A[j + 1]) {\n        k = A[j + 1];\n        A[j + 1] = A[j];\n        A[j] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (B[j] > B[j + 1]) {\n        k = B[j + 1];\n        B[j + 1] = B[j];\n        B[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    C[i] = A[i];\n  }\n  for (i = 0; i < n; i++) {\n    C[m + i] = B[i];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      printf(\"%d\", C[i]);\n    } else {\n      printf(\" %d\", C[i]);\n    }\n  }\n}\nint main() { a(); }\n"}
{"label": "8", "index": "14805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint b[100], c[100], d, e, f[200];\nint du();\nint paib();\nint paic();\nint add();\nint show();\nint main() {\n  int i;\n  d = du();\n  e = du();\n  for (i = 0; i < d; i++)\n    b[i] = du();\n  for (i = 0; i < e; i++)\n    c[i] = du();\n  paib();\n  paic();\n  add();\n  show();\n  return 0;\n}\nint du() {\n  int x;\n  cin >> x;\n  return x;\n}\nint paib() {\n  int j, k, r;\n  for (j = 0; j < d - 1; j++) {\n    for (k = j + 1; k < d; k++) {\n      if (b[k] < b[j]) {\n        r = b[k];\n        b[k] = b[j];\n        b[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint paic() {\n  int j, k, r;\n  for (j = 0; j < e - 1; j++) {\n    for (k = j + 1; k < e; k++) {\n      if (c[k] < c[j]) {\n        r = c[k];\n        c[k] = c[j];\n        c[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint add() {\n  int i;\n  for (i = 0; i < d; i++)\n    f[i] = b[i];\n  for (i = 0; i < e; i++)\n    f[i + d] = c[i];\n  return 0;\n}\nint show() {\n  int i;\n  for (i = 0; i < d + e - 1; i++)\n    cout << f[i] << \" \";\n  cout << f[d + e - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m;\nint key, j, k, i, t;\nint main() {\n  scanf(\"%d%d\", &n, &m);\n  int *p1 = (int *)malloc((n + 1) * sizeof(int));\n  int *p2 = (int *)malloc((m + 1) * sizeof(int));\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", (p1 + i));\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", (p2 + i));\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (*(p1 + i) > *(p1 + j))\n        t = *(p1 + i), *(p1 + i) = *(p1 + j), *(p1 + j) = t;\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    for (j = i + 1; j <= m; j++) {\n      if (*(p2 + i) > *(p2 + j))\n        t = *(p2 + i), *(p2 + i) = *(p2 + j), *(p2 + j) = t;\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 1; i <= m; i++) {\n    if (i == m)\n      printf(\"%d\", *(p2 + i));\n    else\n      printf(\"%d \", *(p2 + i));\n  }\n}\n"}
{"label": "8", "index": "14807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[300], b[300], c[600];\nvoid myfunc() {\n  int la, lb, i;\n  cin >> la >> lb;\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    cin >> b[i];\n  sort(a, a + la);\n  sort(b, b + lb);\n  for (i = 0; i < la; i++)\n    c[i] = a[i];\n  for (i = la; i < la + lb; i++)\n    c[i] = b[i - la];\n  for (i = 0; i < la + lb - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[i]);\n}\nint main() {\n  myfunc();\n  return 0;\n}\n"}
{"label": "8", "index": "14808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *input(int n), *a, *b, *c, n1, n2;\n  void paixu(int *a, int n), display(int *c, int n);\n  int *hebing(int *a, int *b, int n1, int n2);\n  scanf(\"%d %d\", &n1, &n2);\n  a = input(n1);\n  b = input(n2);\n  printf(\"\\n\");\n  paixu(a, n1);\n  paixu(b, n2);\n  c = hebing(a, b, n1, n2);\n  display(c, n1 + n2);\n  return 0;\n}\n\nint *input(int n) {\n  int *p, i;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  return (p);\n}\n\nvoid paixu(int *a, int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i]) {\n        t = a[j];\n        a[j] = a[i];\n        a[i] = t;\n      }\n    }\n  }\n}\n\nint *hebing(int *a, int *b, int n1, int n2) {\n  int *p, i, j;\n  p = (int *)malloc((n1 + n2) * sizeof(int));\n  for (i = 0; i < n1; i++) {\n    p[i] = a[i];\n  }\n  for (j = 0; j < n2; j++) {\n    p[n1 + j] = b[j];\n  }\n  return (p);\n}\n\nvoid display(int *c, int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int *a, int x) {\n  int i = x - 1, t, j;\n  while (i >= 1) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n    i--;\n  }\n}\nvoid lianjie(int *a, int x, int *b, int y, int *c) {\n  int i = 0, j = 0, t = 1;\n  while (i < x) {\n    c[i] = a[i];\n    i++;\n  }\n  while (j < y) {\n    c[i] = b[j];\n    i++;\n    j++;\n  }\n  printf(\"%d\", c[0]);\n  while (t < x + y) {\n    printf(\" %d\", c[t]);\n    t++;\n  }\n}\nint main() {\n  int s, t, i;\n  scanf(\"%d %d\", &s, &t);\n  int *a = (int *)malloc(s * sizeof(int));\n  int *b = (int *)malloc(t * sizeof(int));\n  int *c = (int *)malloc((s + t) * sizeof(int));\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < t; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, s);\n  paixu(b, t);\n  lianjie(a, s, b, t, c);\n}\n"}
{"label": "8", "index": "14810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint na, nb;\nint *a, *b;\nvoid input() {\n  scanf(\"%d %d\", &na, &nb);\n  a = (int *)malloc(na * sizeof(int));\n  b = (int *)malloc(nb * sizeof(int));\n  for (int i = 0; i < na; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = 0; i < nb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return t;\n}\nvoid order() {\n  qsort(a, na, sizeof(int), pfC);\n  qsort(b, nb, sizeof(int), pfC);\n}\n\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < na; i++)\n    printf(\" %d\", a[i]);\n  for (int i = 0; i < nb; i++)\n    printf(\" %d\", b[i]);\n}\n\nint main() {\n  input();\n  order();\n  print();\n}\n"}
{"label": "8", "index": "14811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], c[2000];\nint M, N;\nvoid x() {\n  int i;\n  scanf(\"%d\", &M);\n  scanf(\"%d\", &N);\n  for (i = 0; i <= M - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= N - 1; i++)\n    scanf(\"%d \", &b[i]);\n};\nvoid y() {\n  int i, j, m;\n  for (i = 1; i <= M - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] < a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  for (i = 1; i <= N - 1; i++) {\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] < b[j]) {\n        m = b[i];\n        b[i] = b[j];\n        b[j] = m;\n      }\n    }\n  }\n};\nvoid z() {\n  int i;\n  for (i = 0; i <= M - 1; i++)\n    c[i] = a[i];\n  for (i = 0; i <= N - 1; i++)\n    c[i + M] = b[i];\n};\nvoid u() {\n  int i;\n  for (i = 0; i <= M + N - 2; i++)\n    printf(\"%d \", c[i]);\n  cout << c[M + N - 1];\n};\nint main() {\n  x();\n  y();\n  z();\n  u();\n  return 0;\n}\n"}
{"label": "8", "index": "14812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid px(int a[], int n) {\n  int i, j, x;\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n}\nvoid hb(int a[], int m, int b[], int n) {\n  int c[1000];\n  int i, j, k;\n  for (i = 0; i <= m - 1; i++)\n    c[i] = a[i];\n  for (j = m; j <= m + n - 1; j++)\n    c[j] = b[j - m];\n  for (k = 0; k < m + n - 1; k++)\n    cout << c[k] << \" \";\n  cout << c[m + n - 1];\n}\nint main() {\n  int m, n, i, j;\n  scanf(\"%d %d\", &m, &n);\n  int a[1000];\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int b[1000];\n  for (j = 0; j <= n - 1; j++)\n    cin >> b[j];\n  px(a, m);\n  px(b, n);\n  hb(a, m, b, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint n, m;\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i, j, tem;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i] << endl;\n}\nint main() {\n  read();\n  paixu();\n  combine();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[2][100], n, m, b[200];\n\nvoid read() {\n  scanf(\"%d %d\\n\", &n, &m);\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &a[1][j]);\n  }\n}\n\nvoid sort() {\n  int k = 0, l, min, temp;\n  for (k = 0; k < n; k++) {\n    min = a[0][k];\n    for (l = k + 1; l < n; l++) {\n      if (a[0][l] < min) {\n        temp = min;\n        min = a[0][l];\n        a[0][k] = min;\n        a[0][l] = temp;\n      }\n    }\n  }\n  k = 0;\n  for (k = 0; k < m; k++) {\n    min = a[1][k];\n    for (l = k + 1; l < m; l++) {\n      if (a[1][l] < min) {\n        temp = min;\n        min = a[1][l];\n        a[1][k] = min;\n        a[1][l] = temp;\n      }\n    }\n  }\n}\n\nvoid merge() {\n  int i = 0, j = n;\n  for (i = 0; i < n; i++) {\n    b[i] = a[0][i];\n  }\n  for (j = n; j < n + m; j++) {\n    b[j] = a[1][j - n];\n  }\n}\n\nvoid out() {\n  int i = 0;\n  for (i = 0; i < n + m; i++) {\n    if (i < n + m - 1)\n      printf(\"%d \", b[i]);\n    else\n      printf(\"%d\", b[i]);\n  }\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  out();\n}\n"}
{"label": "8", "index": "14815", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[20], b[20], c[40];\nvoid read(int x1, int x2) {\n  int i;\n  for (i = 0; i < x1; i++)\n    cin >> a[i];\n  for (i = 0; i < x2; i++)\n    cin >> b[i];\n  return;\n}\nvoid sort1(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n  return;\n}\nvoid sort2(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n  return;\n}\nvoid combine(int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n  return;\n}\n\nvoid arraycout(int n1, int n2) {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n  return;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  read(n1, n2);\n  sort1(n1);\n  sort2(n2);\n  combine(n1, n2);\n  arraycout(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14816", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint shuzu1[10] = {0}, shuzu2[10] = {0};\nint n1, n2;\nvoid input() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d \", &shuzu1[i]);\n  for (i = 0; i < n2; i++)\n    cin >> shuzu2[i];\n}\n\nvoid sort(int shuzu[], int bg, int ed) {\n  int bg1 = bg, ed1 = ed, key = shuzu[bg];\n  if (bg1 != ed1) {\n    while (bg1 != ed1) {\n      for (; shuzu[ed1] >= key && bg1 != ed1; ed1--)\n        ;\n      shuzu[bg1] = shuzu[ed1];\n      if (bg1 == ed1)\n        break;\n      bg1++;\n      for (; shuzu[bg1] <= key && bg1 != ed1; bg1++)\n        ;\n      shuzu[ed1] = shuzu[bg1];\n      if (bg1 == ed1)\n        break;\n      ed1--;\n    }\n    shuzu[bg1] = key;\n    if (bg1 != bg)\n      sort(shuzu, bg, bg1 - 1);\n    if (ed1 != ed)\n      sort(shuzu, ed1 + 1, ed);\n  }\n}\nvoid sort1() {\n  sort(shuzu1, 0, n1 - 1);\n  sort(shuzu2, 0, n2 - 1);\n}\nvoid link() {\n  int lk;\n  for (lk = 0; lk < n2; lk++)\n    shuzu1[n1 + lk] = shuzu2[lk];\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i)\n      cout << ' ';\n    cout << shuzu1[i];\n  }\n}\nint main() {\n  input();\n  sort1();\n  link();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstatic int n1, n2, a[100] = {0}, b[100] = {0}, d[200] = {0};\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid pai() {\n  int c, i, j;\n  for (j = 0; j < n1; j++) {\n    for (i = 0; i < n1 - 1; i++) {\n      if (a[i] > a[i + 1]) {\n        c = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = c;\n      }\n    }\n  }\n  for (j = 0; j < n2; j++) {\n    for (i = 0; i < n2 - 1; i++) {\n      if (b[i] > b[i + 1]) {\n        c = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = c;\n      }\n    }\n  }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n1; i++) {\n    d[i] = a[i];\n  }\n  for (i = n1; i < n1 + n2; i++) {\n    d[i] = b[i - n1];\n  }\n}\nvoid shu() {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++) {\n    cout << d[i] << \" \";\n  }\n  cout << d[n1 + n2 - 1];\n}\nint main() {\n  f1();\n  pai();\n  he();\n  shu();\n  return 0;\n}\n"}
{"label": "8", "index": "14818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000];\nint n, m;\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid paixu() {\n  int i, j, tem;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n    }\n  }\n}\nvoid combine() {\n  int i;\n  for (i = n; i < n + m; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid put() {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[i] << endl;\n}\nint main() {\n  read();\n  paixu();\n  combine();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14819", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[200], i, j, m, n;\nvoid read(void) {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return;\n}\nvoid place(void) {\n  int s;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  return;\n}\nvoid together(void) {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return;\n}\nvoid put(void) {\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      printf(\"%d\", c[i]);\n    } else {\n      cout << ' ' << c[i];\n    }\n  }\n  return;\n}\n\nint main() {\n  read();\n  place();\n  together();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid pai(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (int i = 0; i < n; i++) {\n    for (int r = 1; r < n - i; r++) {\n      if (a[i + r] < a[i]) {\n        int k = a[i];\n        a[i] = a[i + r];\n        a[i + r] = k;\n      }\n    }\n  }\n}\nint link(int n, int m) {\n  int a[100] = {0}, b[100] = {0};\n  pai(n, a);\n  pai(m, b);\n  for (int i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (int i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n}\n\nint main() {\n  int n, m;\n  scanf(\"%d %d\", &n, &m);\n  link(n, m);\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "8", "index": "14821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int n, int a[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\nvoid f2(int n, int a[]) {\n  int i, j, k;\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[i] > a[j]) {\n        k = a[j];\n        a[j] = a[i];\n        a[i] = k;\n      }\n    }\n}\nvoid f3(int n, int m, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(int n, int m, int c[]) {\n  printf(\"%d\", c[0]);\n  int i;\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  int i, n, m, a[100], b[100], c[200];\n  scanf(\"%d%d\", &n, &m);\n  f1(n, a);\n  f1(m, b);\n  f2(n, a);\n  f2(m, b);\n  f3(n, m, a, b, c);\n  f4(n, m, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid scan(int x[], int *nx, int y[], int *ny) {\n  int i;\n  scanf(\"%d %d\", nx, ny);\n  for (i = 0; i < *nx; i++)\n    scanf(\"%d\", &x[i]);\n  for (i = 0; i < *ny; i++)\n    scanf(\"%d\", &y[i]);\n}\nvoid sort(int x[], int num) {\n  int i, j;\n  for (i = num - 1; i >= 1; i--)\n    for (j = 1; j <= i; j++)\n      if (x[j - 1] > x[j]) {\n        int temp = x[j - 1];\n        x[j - 1] = x[j];\n        x[j] = temp;\n      }\n}\nvoid exp(int a[], int b[], int na, int nb) {\n  int i;\n  for (i = na; i < na + nb; i++)\n    a[i] = b[i - na];\n}\nvoid print(int a[], int na, int nb) {\n  cout << a[0];\n  int i;\n  for (i = 1; i < na + nb; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  int a[100], na, b[100], nb;\n  scan(a, &na, b, &nb);\n  sort(a, na);\n  sort(b, nb);\n  exp(a, b, na, nb);\n  print(a, na, nb);\n}\n"}
{"label": "8", "index": "14823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], x = 0, y = 0;\nvoid in() {\n  scanf(\"%d %d \", &x, &y);\n  for (int i = 0; i < x; i++)\n    cin >> a[i];\n  for (int i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n}\nvoid sortnum() {\n  sort(a, a + x);\n  sort(b, b + y);\n}\nvoid cat() {\n  for (int i = x; i < 100; i++)\n    a[i] = b[i - x];\n}\nvoid out() {\n  cout << a[0];\n  for (int i = 1; i < x + y; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  in();\n  sortnum();\n  cat();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint la, lb;\nint a[100] = {0}, b[100] = {0};\nvoid get() {\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  int p = a[0];\n  for (i = 0; i < la - 1; i++)\n    for (j = 0; j <= la - i - 2; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  p = b[0];\n  for (i = 0; i < lb - 1; i++)\n    for (j = 0; j <= lb - i - 2; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid link() {\n  int i;\n  for (i = la; i <= la + lb - 1; i++)\n    a[i] = b[i - la];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < la + lb - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[la + lb - 1];\n}\nint main() {\n  cin >> la >> lb;\n  get();\n  sort();\n  link();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num1[1000] = {0}, num2[1000] = {0};\nint num[2000] = {0};\nint n1, n2;\nvoid read() {\n  scanf(\"%d %d \", &n1, &n2);\n  for (int i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (int i = 0; i < n2; i++)\n    cin >> num2[i];\n}\nvoid range() {\n  for (int i = 0; i < n1 - 1; i++)\n    for (int j = 0; j < n1 - 1 - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        int temp = 0;\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 0; i < n2 - 1; i++)\n    for (int j = 0; j < n2 - 1 - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        int temp = 0;\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n}\nvoid combine() {\n  for (int i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (int i = 0; i < n2; i++)\n    num[n1 + i] = num2[i];\n}\nvoid print() {\n  for (int i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", num[i]);\n  printf(\"%d\\n\", num[n1 + n2 - 1]);\n}\nint main() {\n  read();\n  range();\n  combine();\n  print();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid a();\nvoid b();\nvoid c();\nvoid d();\nint x1[1000], x2[499], n1, n2;\nint main() {\n\n  a();\n  b();\n  c();\n  d();\n\n  return 0;\n}\n\nvoid a() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &x1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &x2[i]);\n}\nvoid b() {\n  int i, j, p;\n  for (i = 0; i < n1 - 1; i++)\n    for (j = i + 1; j < n1; j++)\n      if (x1[i] > x1[j]) {\n        p = x1[i];\n        x1[i] = x1[j];\n        x1[j] = p;\n      }\n  for (i = 0; i < n2 - 1; i++)\n    for (j = i + 1; j < n2; j++)\n      if (x2[i] > x2[j]) {\n        p = x2[i];\n        x2[i] = x2[j];\n        x2[j] = p;\n      }\n}\nvoid c() {\n  int i;\n  for (i = 0; i < n2; i++)\n    x1[n1 + i] = x2[i];\n}\nvoid d() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    cout << x1[i];\n    if (i < n1 + n2 - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14827", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, a[100], b[100], temp = 0;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *putin() {\n  int a, b, n;\n  scanf(\"%d %d\", &a, &b);\n  int *p = (int *)malloc((a + b + 2) * sizeof(int));\n  *p = a;\n  *(p + 1) = b;\n  for (n = 2; n <= a + b + 1; n++)\n    scanf(\"%d\", (p + n));\n  return p;\n}\nint *compare(int *a) {\n  int n, m, p;\n  for (n = 2; n <= (*a); n++) {\n    for (m = n + 1; m <= (*a) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  for (n = (*a) + 2; n <= (*a) + (*(a + 1)); n++) {\n    for (m = n + 1; m <= (*a) + (*(a + 1)) + 1; m++) {\n      if ((*(a + n)) > (*(a + m))) {\n        p = *(a + n);\n        *(a + n) = *(a + m);\n        *(a + m) = p;\n      }\n    }\n  }\n  return a;\n}\nvoid putout(int *a) {\n  int x;\n  for (x = 2; x <= (*a) + (*(a + 1)); x++)\n    printf(\"%d \", a[x]);\n  printf(\"%d\", a[(*a) + (*(a + 1)) + 1]);\n}\nint main() { putout(compare(putin())); }\n"}
{"label": "8", "index": "14829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nint order(int str[], int po, int start) {\n  for (int i = 1; i < po; i++) {\n    for (int j = 1; j <= po - i; j++) {\n      if (str[j] > str[j + 1])\n        swap(str[j], str[j + 1]);\n    }\n  }\n  for (int i = start; i < po + start; i++) {\n    c[i] = str[i - start + 1];\n  }\n  return 0;\n}\nint output() {\n  order(a, m, 1);\n  order(b, n, m + 1);\n  for (int i = 1; i < m + n; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n];\n  return 0;\n}\nint main() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++)\n    cin >> a[i];\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int a[], int n) {\n  int i, j, m;\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n}\nvoid shuchu1(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\nvoid shuchu2(int b[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n  int a[10], n, b[10], m, i;\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"\\n\");\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n - 1]);\n  scanf(\"\\n\");\n  for (i = 0; i < m - 1; i++)\n    scanf(\"%d \", &b[i]);\n  scanf(\"%d\", &b[m - 1]);\n  paixu(a, n);\n  paixu(b, m);\n  shuchu1(a, n);\n  shuchu2(b, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[200] = {0}, b[200] = {0}, tem, *p, *q;\n  p = a;\n  q = b;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        tem = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = tem;\n      }\n    }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (*(q + j) > *(q + j + 1)) {\n        tem = *(q + j);\n        *(q + j) = *(q + j + 1);\n        *(q + j + 1) = tem;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid sheng(int *a, int n) {\n  int i, j, b;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i])\n\n      {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint hebing(int *a, int n, int *b, int m, int *c) {\n\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < m + n; i++)\n    c[i] = b[i - n];\n  return *c;\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d %d\", &n, &m);\n  int *a = (int *)malloc(sizeof(int) * n);\n  int *b = (int *)malloc(sizeof(int) * m);\n  int *c = (int *)malloc(sizeof(int) * (m + n));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  sheng(a, n);\n  sheng(b, m);\n  hebing(a, n, b, m, c);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14833", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint num1, num2, array_11[20], array_12[20], array_1[40];\n\nvoid input(int array_11[], int array_12[]) {\n  int i, j;\n\n  scanf(\"%d %d\", &num1, &num2);\n\n  for (i = 0; i <= num1 - 1; i++)\n    scanf(\"%d\", &array_11[i]);\n  for (j = 0; j <= num2 - 1; j++)\n    scanf(\"%d\", &array_12[j]);\n}\n\nvoid sort(int array_1[], int n) {\n  int i, j, t;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (array_1[j] > array_1[j + 1]) \n      {\n        t = array_1[j];\n        array_1[j] = array_1[j + 1];\n        array_1[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid link(int array_11[], int array_12[], int array_1[], int n1, int n2) {\n  int i;\n\n  for (i = 0; i < n1; i++) {\n    array_1[i] = array_11[i];\n  }\n  for (i = 0; i < n2; i++) {\n    array_1[i + n1] = array_12[i];\n  }\n}\n\nvoid output(int array_1[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%d%c\", array_1[i], i < n - 1 ? ' ' : ' ');\n  }\n}\n\nint main() {\n  input(array_11, array_12);\n  sort(array_11, num1);\n  sort(array_12, num2);\n  link(array_11, array_12, array_1, num1, num2);\n  output(array_1, num1 + num2);\n}\n"}
{"label": "8", "index": "14834", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], m, n;\nvoid sca() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid in(int a[], int b[]) {\n  int i;\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid pri() {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  sca();\n  order(a, b);\n  in(a, b);\n  pri();\n}\n"}
{"label": "8", "index": "14835", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint input(int *s, int n) {\n  int i = 0;\n  for (i = 0; i < n; i++)\n    cin >> s[i];\n  return 0;\n}\n\nint sort(int *s, int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (s[j - 1] > s[j]) {\n        int temp = s[j - 1];\n        s[j - 1] = s[j];\n        s[j] = temp;\n      }\n    }\n  }\n  return 0;\n}\n\nint combine(int *s1, int *s2, int n1, int n2, int *s) {\n  int i = 0;\n  for (i = 0; i < n1; i++)\n    s[i] = s1[i];\n  for (i = 0; i < n2; i++)\n    s[i + n1] = s2[i];\n  return 0;\n}\n\nint output(int *s, int n) {\n  int i = 0;\n  if (n <= 0)\n    return 0;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", s[i]);\n}\n\nint main() {\n  int n1 = 0, n2 = 0;\n  cin >> n1 >> n2;\n  int s1[1000] = {0};\n  int s2[1000] = {0};\n  input(s1, n1);\n  input(s2, n2);\n  sort(s1, n1);\n  sort(s2, n2);\n  int s[2000] = {0};\n  combine(s1, s2, n1, n2, s);\n  output(s, n1 + n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint p, q;\nvoid input() {\n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < q; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu(int a[100], int b[100]) {\n  int i = 0, j = 0;\n  int c;\n  for (i = 1; i <= p - 1; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (a[j] > a[j + 1]) {\n        c = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = c;\n      }\n    }\n  }\n  for (i = 1; i <= q - 1; i++) {\n    for (j = 0; j < q - i; j++) {\n      if (b[j] > b[j + 1]) {\n        c = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = c;\n      }\n    }\n  }\n}\nvoid connect(int a[100], int b[100]) {\n  for (int i = 0; i < q; i++) {\n    a[p + i] = b[i];\n  }\n}\nvoid output(int a[100]) {\n  int i = 0;\n  cout << a[0];\n  for (i = 1; i < p + q; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  input();\n  paixu(a, b);\n  connect(a, b);\n  output(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint i, j, k;\nint q[10000], p[10000];\n\nvoid a() {\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> p[i];\n\n  for (i = 0; i < n; i++) {\n    cin >> q[i];\n  }\n}\nvoid b(int x[], int y[]) {\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n\n      if (x[j] > x[j + 1]) {\n        k = x[j + 1];\n        x[j + 1] = x[j];\n        x[j] = k;\n      }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n\n    {\n      if (y[j] > y[j + 1]) {\n        k = y[j + 1];\n        y[j + 1] = y[j];\n        y[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << x[i] << ' ';\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << y[i] << ' ';\n  }\n  cout << y[n - 1] << endl;\n}\n\nint main() {\n  a();\n  b(p, q);\n  return (0);\n}\n"}
{"label": "8", "index": "14838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint al = 0, bl = 0, i, j, k;\nvoid f1() {\n  cin >> al >> bl;\n  for (i = 0; i < al; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < bl; i++) {\n    cin >> b[i];\n  }\n}\nvoid f2() {\n  for (i = 0; i < al - 1; i++) {\n    for (j = i; j < al; j++) {\n      if (a[i] > a[j]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < bl - 1; i++) {\n    for (j = i; j < bl; j++) {\n      if (b[i] > b[j]) {\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n      }\n    }\n  }\n}\nvoid f3() {\n  for (i = 0; i < bl; i++) {\n    a[i + al] = b[i];\n  }\n}\nvoid f4() {\n  for (i = 0; i < al + bl - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[al + bl - 1];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14839", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint la, lb;\n\nvoid read(int a[], int b[]) {\n  int i;\n  cin >> la >> lb;\n  for (i = 0; i < la; i++)\n    cin >> a[i];\n  for (i = 0; i < lb; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[]) {\n  int i;\n  int t;\n  for (i = 0; i < la - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n  for (i = 0; i < lb - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      if (i != 0) {\n        i = i - 2;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[]) {\n  int i;\n  for (i = 0; i < lb; i++) {\n    a[la + i] = b[i];\n  }\n}\n\nvoid print(int a[]) {\n  int i;\n  for (i = 0; i < (la + lb); i++) {\n    if (i != (la + lb - 1))\n      printf(\"%d \", a[i]);\n    else\n      printf(\"%d\", a[i]);\n  }\n}\n\nint main() {\n  int x[200], y[100];\n  read(x, y);\n\n  sort(x, y);\n\n  combine(x, y);\n  print(x);\n  return 0;\n}\n"}
{"label": "8", "index": "14840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    scanf(\"%d \", &array[i]);\n  }\n  scanf(\"%d\\n\", &array[n - 1]);\n}\nvoid order(int array[], int n) {\n  int i, o, e;\n  for (i = 0; i <= n - 2; i++) {\n    for (o = i + 1; o <= n - 1; o++) {\n      if (array[i] > array[o]) {\n        e = array[i];\n        array[i] = array[o];\n        array[o] = e;\n      }\n    }\n  }\n}\nvoid output(int array[], int n) {\n  int i;\n  for (i = 0; i <= n - 2; i++) {\n    printf(\"%d \", array[i]);\n  }\n  printf(\"%d\", array[n - 1]);\n}\nint main() {\n  int a[20], b[20], q, w;\n  scanf(\"%d %d\\n\", &q, &w);\n  input(a, q);\n  input(b, w);\n  order(a, q);\n  order(b, w);\n  output(a, q);\n  printf(\" \");\n  output(b, w);\n}\n"}
{"label": "8", "index": "14841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m, a[100], b[100], t, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j <= n; j++) {\n      if (a[j] < a[j - 1]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= m; i++) {\n    for (j = 2; j <= m; j++) {\n      if (b[j] < b[j - 1]) {\n        t = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 1; i <= m; i++) {\n    cout << b[i];\n    if (i < m) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[1000], b[1000], c[2000], s, t;\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  for (s = 0; s < m; s++)\n    scanf(\"%d\", &a[s]);\n  for (s = 0; s < n; s++)\n    scanf(\"%d\", &b[s]);\n}\n\nvoid order() {\n  int k;\n  for (s = 1; s < m; s++)\n    for (t = 0; t < m - s; t++)\n      if (a[t] > a[t + 1]) {\n        k = a[t];\n        a[t] = a[t + 1];\n        a[t + 1] = k;\n      }\n  for (s = 1; s < n; s++) {\n    for (t = 0; t < n - s; t++)\n      if (b[t] > b[t + 1]) {\n        k = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = k;\n      }\n  }\n}\n\nvoid add() {\n  for (s = 0; s < m; s++)\n    c[s] = a[s];\n  for (s = m, t = 0; s < m + n; s++, t++)\n    c[s] = b[t];\n}\n\nvoid output() {\n  for (s = 0; s < m + n; s++) {\n    if (s != m + n - 1)\n      printf(\"%d \", c[s]);\n    else\n      printf(\"%d\", c[s]);\n  }\n}\n\nint main() {\n  input();\n  order();\n  add();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint array_a[100], array_b[100], n_a, n_b;\nvoid input() {\n  int i;\n\n  scanf(\"%d%d\", &n_a, &n_b);\n  for (i = 0; i < n_a; i++)\n    cin >> array_a[i];\n  for (i = 0; i < n_b; i++)\n    scanf(\"%d\", &array_b[i]);\n}\nvoid order() {\n  int i, j, temp;\n\n  for (i = 1; i < n_a; i++)\n    for (j = 1; j < n_a + 1 - i; j++)\n      if (array_a[j] < array_a[j - 1]) {\n        temp = array_a[j];\n        array_a[j] = array_a[j - 1];\n        array_a[j - 1] = temp;\n      }\n  for (i = 1; i < n_b; i++)\n    for (j = 1; j < n_b - i + 1; j++)\n      if (array_b[j] < array_b[j - 1]) {\n        temp = array_b[j];\n        array_b[j] = array_b[j - 1];\n        array_b[j - 1] = temp;\n      }\n}\nvoid catenate() {\n  int i;\n  for (i = 0; i < n_b; i++)\n    array_a[n_a + i] = array_b[i];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < n_a + n_b; i++)\n    cout << array_a[i] << (i == n_a + n_b - 1) ? '\\n' : ' ';\n}\nint main() {\n  input();\n  order();\n  catenate();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(int *p1, int *p2, int **pA, int **pB) {\n  int i;\n  scanf(\"%d %d\", p1, p2);\n  *pA = (int *)malloc((*p1) * sizeof(int));\n  *pB = (int *)malloc((*p2) * sizeof(int));\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", *pA + i);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", *pB + i);\n}\nvoid sort(int p, int *pX) {\n  int i, j, temp;\n  for (i = 0; i < p; i++) {\n    for (j = p - 1; j > i; j--) {\n      if (pX[j] < pX[j - 1]) {\n        temp = pX[j];\n        pX[j] = pX[j - 1];\n        pX[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int p1, int p2, int *pA, int *pB, int **pC) {\n  *pC = (int *)malloc((p1 + p2) * sizeof(int));\n  int i;\n  for (i = 0; i < p1; i++)\n    (*pC)[i] = pA[i];\n  for (i = 0; i < p2; i++)\n    (*pC)[p1 + i] = pB[i];\n  free(pA);\n  free(pB);\n}\nvoid output(int p, int *pC) {\n  int i;\n  for (i = 0; i < p - 1; i++)\n    printf(\"%d \", pC[i]);\n  printf(\"%d \", pC[p - 1]);\n  free(pC);\n}\nint main() {\n  int p1, p2, *pA, *pB, *pC;\n  input(&p1, &p2, &pA, &pB);\n  sort(p1, pA);\n  sort(p2, pB);\n  combine(p1, p2, pA, pB, &pC);\n  output(p1 + p2, pC);\n  return 0;\n}\n"}
{"label": "8", "index": "14845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void maopao(int c[], int l);\n  int c1[100], c2[100], l1, l2;\n  int i, n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &c1[i]);\n    l1 = i + 1;\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &c2[i]);\n    l2 = i + 1;\n  }\n  maopao(c1, l1);\n  printf(\" \");\n  maopao(c2, l2);\n}\n\nvoid maopao(int c[], int l) {\n  int i, j, t;\n\n  for (j = 1; j < l; j++)\n    for (i = 0; i < l - j; i++)\n      if (c[i] > c[i + 1]) {\n        t = c[i + 1];\n        c[i + 1] = c[i];\n        c[i] = t;\n      }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < l; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "14846", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000], c[2000];\nint m, n;\n\nvoid inputarray(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid input() {\n  scanf(\"%d %d\", &m, &n);\n  inputarray(a, m);\n  inputarray(b, n);\n}\n\nvoid sort(int a[], int n) {\n  int i, j, temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid combine(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n}\n\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\n\nint main() {\n  input();\n  sort(a, m);\n  sort(b, n);\n  combine(a, b, c, m, n);\n  output(c, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "14847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nint a[100], b[100], k[200];\nvoid f1();\nvoid f2(int[], int[]);\nvoid f3(int[], int[]);\nvoid f4(int[]);\nint main() {\n  f1();\n  f2(a, b);\n  f3(a, b);\n  f4(k);\n  return 0;\n}\nvoid f1() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++)\n    cin >> b[j];\n}\nvoid f2(int c[], int d[]) {\n  for (int i = 0; i < m; i++) {\n    for (int j = m - 1; j > i; j--) {\n      if (c[j] < c[j - 1])\n        swap(c[j], c[j - 1]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (d[j] < d[j - 1])\n        swap(d[j], d[j - 1]);\n    }\n  }\n}\nvoid f3(int e[], int f[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i < m)\n      k[i] = a[i];\n    else\n      k[i] = b[i - m];\n  }\n}\nvoid f4(int g[]) {\n  for (int i = 0; i < n + m - 1; i++)\n    cout << g[i] << \" \";\n  cout << g[n + m - 1] << endl;\n}\n"}
{"label": "8", "index": "14848", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000], la, lb;\nint p;\nint c[1000], lc;\n\nvoid M1(int m1) {\n  cin >> la >> lb;\n  for (int i = 1; i <= la; i++)\n    cin >> a[i];\n  for (int i = 1; i <= lb; i++)\n    cin >> b[i];\n}\n\nvoid M2(int m2) {\n  for (int i = 1; i <= la; i++) {\n    for (int j = 1; j <= la - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (int i = 1; i <= lb; i++) {\n    for (int j = 1; j <= lb - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\n\nvoid M3(int m3) {\n  lc = la + lb;\n  for (int i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (int i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n}\n\nvoid M4(int m4) {\n  for (int i = 1; i <= lc; i++) {\n    cout << c[i];\n    if (i == lc)\n      break;\n    cout << \" \";\n  }\n}\n\nint main() {\n  M1(1);\n  M2(1);\n  M3(1);\n  M4(1);\n  return 0;\n}\n"}
{"label": "8", "index": "14849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], c[200], n1, n2;\nint shuru(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> a[i];\n  for (int i = 0; i < n2; i++)\n    scanf(\"%d \", &b[i]);\n}\nint pai() {\n  int m;\n  for (int j = 0; j < n1 - 1; j++)\n    for (int i = 0; i < n1 - 1; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = m;\n      }\n  for (int j = 0; j < n2 - 1; j++)\n    for (int i = 0; i < n2 - 1; i++)\n      if (b[i] > b[i + 1]) {\n        m = b[i + 1];\n        b[i + 1] = b[i];\n        b[i] = m;\n      }\n}\nint jie() {\n  for (int i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (int i = 0; i < n2; i++)\n    c[n1 + i] = b[i];\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  shuru();\n  pai();\n  jie();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid read(int s[], int n);\nvoid arrange(int s[], int n);\nvoid connect(int array1[], int array2[], int p1, int p2);\nvoid print(int array[], int num);\nint main() {\n  int s1[100], s2[100];\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  read(s1, n1);\n  read(s2, n2);\n  arrange(s1, n1);\n  arrange(s2, n2);\n  connect(s1, s2, n1, n2);\n  print(s1, n1 + n2);\n  return 0;\n}\nvoid read(int s[], int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n}\nvoid arrange(int s[], int n) {\n  int i, j;\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        t = s[j + 1];\n        s[j + 1] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n}\nvoid connect(int array1[], int array2[], int p1, int p2) {\n  int i;\n\n  for (i = p1; i < p1 + p2; i++) {\n    array1[i] = array2[i - p1];\n  }\n}\n\nvoid print(int array[], int num) {\n  int i;\n  printf(\"%d\", array[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %d\", array[i]);\n  }\n}\n"}
{"label": "8", "index": "14851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int a[100], b[100], c[300];\nchar z;\nvoid scan() {\n  static int m, n, i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i <= 99; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &a[i], &z);\n  }\n  z = 1;\n  for (i = 0; z != '\\n'; i++) {\n    scanf(\"%d%c\", &b[i], &z);\n  }\n}\nvoid ord() {\n  int i, j, temp;\n  for (i = 0; a[i] != '\\0'; i++) {\n    for (j = i + 1; a[j] != '\\0'; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; b[i] != '\\0'; i++) {\n    for (j = i + 1; b[j] != '\\0'; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid bin() {\n  static int i, j, s;\n  for (i = 0; i <= 299; i++) {\n\n    c[i] = 0;\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    c[i] = a[i];\n  }\n  for (j = 0; b[j] != '\\0'; j++) {\n    c[j + i] = b[j];\n  }\n}\n\nvoid print() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; c[i] != 0; i++)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  scan();\n  ord();\n  bin();\n  print();\n}\n"}
{"label": "8", "index": "14852", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid program(void) {\n  int m, n, i, j;\n  cin >> m >> n;\n  const int M = n, N = n;\n  int a[M], b[N];\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n  for (i = 0; i < m; ++i)\n    for (j = i + 1; j < m; ++j)\n      if (a[i] > a[j]) {\n        a[i] = a[i] + a[j];\n        a[j] = a[i] - a[j];\n        a[i] = a[i] - a[j];\n      }\n  for (i = 0; i < n; ++i)\n    for (j = i + 1; j < n; ++j)\n      if (b[i] > b[j]) {\n        b[i] = b[i] + b[j];\n        b[j] = b[i] - b[j];\n        b[i] = b[i] - b[j];\n      }\n  cout << a[0];\n  for (i = 1; i < m; ++i)\n    cout << ' ' << a[i];\n  for (i = 0; i < n; ++i)\n    cout << ' ' << b[i];\n}\n\nint main() {\n  program();\n  return 0;\n}\n"}
{"label": "8", "index": "14853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000];\nint sizea, sizeb;\nvoid read() {\n  cin >> sizea >> sizeb;\n  int i;\n  for (i = 0; i <= sizea - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= sizeb - 1; i++)\n    cin >> b[i];\n}\nvoid order(int n, int a[]) {\n  int i, j;\n  int temp;\n  for (i = n - 1; i >= 1; i--)\n    for (j = 0; j <= i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\nvoid paixu() {\n  order(sizea, a);\n  order(sizeb, b);\n}\nvoid mix() {\n  int i;\n  for (i = 0; i <= sizeb - 1; i++)\n    a[sizea + i] = b[i];\n}\nvoid print() {\n  cout << a[0];\n  for (int i = 1; i <= sizea + sizeb - 1; i++)\n    cout << \" \" << a[i];\n}\nint main() {\n  read();\n  paixu();\n  mix();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, m);\n  f(b, n);\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m + n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bubble(int c[], int x);\n  int i, m, n;\n  int a[100], b[100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &a[i - 1]);\n\n  printf(\"\\n\");\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b[i - 1]);\n  }\n  printf(\"\\n\");\n  bubble(a, m);\n  printf(\" \");\n  bubble(b, n);\n}\n\nint bubble(int c[], int x) {\n  int t, j, temp;\n  for (t = 1; t <= x; t++) {\n    for (j = 1; j <= x - t; j++) {\n      if (c[j - 1] > c[j]) {\n        temp = c[j - 1];\n        c[j - 1] = c[j];\n        c[j] = temp;\n      }\n    }\n  }\n  for (t = 1; t <= x; t++) {\n    printf(\"%d\", c[t - 1]);\n    if (t != x)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14856", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[2], i, j, b[2][100], p, c[100], s, t;\n  for (i = 0; i < 2; i++)\n    cin >> a[i];\n  for (i = 0; i < 2; i++)\n    for (j = 0; j < a[i]; j++)\n      cin >> b[i][j];\n  for (i = 0; i < 2; i++) {\n    for (s = 0; s < a[i] - 1; s++) {\n      for (t = 0; t < a[i] - 1 - s; t++)\n        if (b[i][t] > b[i][t + 1]) {\n          p = b[i][t];\n          b[i][t] = b[i][t + 1];\n          b[i][t + 1] = p;\n        }\n    }\n  }\n  for (i = 0; i < a[0]; i++)\n    c[i] = b[0][i];\n  for (j = 0; j < a[1]; j++)\n    c[a[0] + j] = b[1][j];\n  for (s = 0; s < a[0] + a[1] - 1; s++)\n    printf(\"%d \", c[s]);\n  printf(\"%d\", c[a[0] + a[1] - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(int s[], int n);\n  int a[100], b[100][100];\n  int n, i = 1, j;\n  char c;\n  do {\n    scanf(\"%d\", &a[i]);\n    i++;\n    scanf(\"%c\", &c);\n  } while (c != '\\n');\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= a[i]; j++) {\n      scanf(\"%d\", &b[i][j]);\n    }\n  }\n  f(b[1], a[1]);\n  for (i = 2; i <= n; i++) {\n    printf(\" \");\n    f(b[i], a[i]);\n  }\n  return 0;\n}\nvoid f(int s[], int n) {\n  int i, j, t;\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (s[j + 1] < s[j]) {\n        t = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = t;\n      }\n    }\n  }\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    printf(\" %d\", s[i]);\n  }\n}\n"}
{"label": "8", "index": "14858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x, y;\nint print() {\n  printf(\" \");\n  return 0;\n}\nvoid order(int n) {\n  int i, j, temp = 0;\n  int a[10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j + 1] < a[j]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[n - 1];\n}\nint main() {\n  cin >> x >> y;\n  order(x);\n  print();\n  order(y);\n  return 0;\n}\n"}
{"label": "8", "index": "14859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int x, int y) {\n  int a[x], b[y];\n  int t, i, j;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < y; j++) {\n    scanf(\"%d \", &b[j]);\n  }\n\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n}\n\nint main() {\n  int x, y;\n  scanf(\"%d %d \", &x, &y);\n  f(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14860", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, t = 0;\n  int *a, *b;\n  scanf(\"%d %d\", &n, &m);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = t;\n      }\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14861", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int x[]) {\n  int i, j, t;\n  for (i = 1; i <= x[0]; i++)\n    for (j = 1; j <= x[0] - i; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\nvoid deal(void) {\n  int a[100] = {0};\n  int b[100] = {0};\n  int n, m, i;\n  cin >> n >> m;\n  a[0] = n;\n  b[0] = m;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n  sort(a);\n  sort(b);\n  cout << a[1];\n  for (i = 2; i <= n; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= m; i++)\n    cout << \" \" << b[i];\n}\nint main() {\n\n  deal();\n  return 0;\n}\n"}
{"label": "8", "index": "14862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1;\nint n2;\nint i;\nint a[100] = {0};\nint b[100] = {0};\nint c[200] = {0};\nvoid scanfing() {\n  scanf(\"%d %d\", &n1, &n2);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n1; i++)\n    scanf(\" %d\", &a[i]);\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < n2; i++)\n    scanf(\" %d\", &b[i]);\n}\nint compare(const void *elem1, const void *elem2) {\n  return (*(int *)elem1 - *(int *)elem2);\n}\nvoid qsorting() {\n  qsort(a, n1, sizeof(int), compare);\n  qsort(b, n2, sizeof(int), compare);\n}\nvoid together() {\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = 0; i < n2; i++)\n    c[i + n1] = b[i];\n}\nvoid printfing() {\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\nint main() {\n  scanfing();\n  qsorting();\n  together();\n  printfing();\n  return 0;\n}\n"}
{"label": "8", "index": "14863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nstatic char a[100], b[100];\nint i, j, temp;\nvoid get() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order() {\n  for (i = m - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = 0; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid com() {\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  get();\n  order();\n  com();\n  print();\n}\n"}
{"label": "8", "index": "14864", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid print(int a[], int x) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++)\n    printf(\" %d\", a[i]);\n}\nvoid paixu(int a[], int x) {\n  int i, j, m;\n  for (i = 0; i < x; i++)\n    for (j = i + 1; j < x; j++) {\n      if (a[i] > a[j]) {\n        m = a[i];\n        a[i] = a[j];\n        a[j] = m;\n      }\n    }\n  print(a, x);\n}\nvoid scan(int t) {\n  int m, n, a[10], i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, m);\n  printf(\" \");\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  paixu(a, n);\n}\nint main() { scan(0); }\n"}
{"label": "8", "index": "14865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid read(int *a, int *b, int num1, int num2);\nvoid sort(int *a, int num1);\nvoid merge(int *a, int *b, int *c, int num1, int num2);\nvoid print(int *a, int num1);\nint main() {\n  int a[100], b[100], c[200];\n  int num1, num2;\n  cin >> num1 >> num2;\n  read(a, b, num1, num2);\n  sort(a, num1);\n  sort(b, num2);\n  merge(a, b, c, num1, num2);\n  print(c, num1 + num2);\n  return 0;\n}\n\nvoid read(int *a, int *b, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < num2; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int num1) {\n  int i, j;\n  for (i = 0; i < num1; i++) {\n    for (j = i + 1; j < num1; j++) {\n      if (a[i] > a[j]) {\n        int temp;\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *a, int *b, int *c, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = num1; i < num1 + num2; i++) {\n    c[i] = b[i - num1];\n  }\n}\n\nvoid print(int *a, int num1) {\n  int i;\n  for (i = 0; i < num1 - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[num1 - 1] << \"\\n\";\n}\n"}
{"label": "8", "index": "14866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b;\nint c[1000], d[1000];\nvoid scan1() {\n  scanf(\"%d %d\", &a, &b);\n  int i;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n}\n\nvoid order() {\n  int i, j, k;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < b - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        k = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = k;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < b; i++) {\n    c[a + i] = d[i];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a + b; i++) {\n    if (i)\n      printf(\" \");\n    printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  scan1();\n  order();\n  hebing();\n  shuchu();\n}\n"}
{"label": "8", "index": "14867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint la, lb, a[1000], b[1000], c[2000];\nvoid duqu() {\n  scanf(\"%d %d \", &la, &lb);\n  for (int i = 0; i < la; i++)\n    scanf(\"%d \", &a[i]);\n  for (int j = 0; j < lb; j++)\n    cin >> b[j];\n}\nvoid paixu() {\n  int i, j, temp;\n  for (i = 0; i < la - 1; i++)\n    for (j = i + 1; j < la; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < lb - 1; i++)\n    for (j = i + 1; j < lb; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid hebing() {\n  for (int i = 0; i < la; i++)\n    c[i] = a[i];\n  for (int j = 0; j < lb; j++)\n    c[la + j] = b[j];\n}\nvoid shuchu() {\n  for (int i = 0; i < la + lb; i++) {\n    printf(\"%d\", c[i]);\n    if (i != la + lb - 1)\n      cout << ' ';\n  }\n}\nint main() {\n  duqu();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100];\nvoid ranking(int n, int m) { \n  int i, j, p;\n  for (i = n; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m - 1; i++)\n    for (j = n; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      } \n    }\n}\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  ranking(0, n);\n  ranking(n, n + m); \n  cout << a[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "8", "index": "14869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100];\nint num1, num2;\nvoid getin() {\n  int i, j;\n  cin >> num1 >> num2;\n  for (i = 1; i <= num1; i++)\n    cin >> a[i];\n  for (j = 1; j <= num2; j++)\n    cin >> b[j];\n}\nvoid order(int aa[], int num) {\n  int t, i, j;\n  for (i = 1; i < num; i++)\n    for (j = 1; j < num; j++)\n      if (aa[j] > aa[j + 1]) {\n        t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n}\nvoid print(int a[], int b[], int num1, int num2) {\n  cout << a[1];\n  int i;\n  for (i = 2; i <= num1; i++)\n    cout << \" \" << a[i];\n  for (i = 1; i <= num2; i++) {\n    cout << \" \" << b[i];\n  }\n  cout << endl;\n}\n\nint main() {\n\n  getin();\n  order(a, num1);\n  order(b, num2);\n  print(a, b, num1, num2);\n  return 0;\n}\n"}
{"label": "8", "index": "14870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint str1[100], str2[100], str[200];\nint m, n;\nvoid f1() {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &str1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &str2[i]);\n  }\n}\nvoid f2(int s[100], int k) {\n  int i, j, t;\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1; i++) {\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int s1[100], int s2[100], int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    s[i] = s1[i];\n  }\n  for (i = 0; i < n; i++) {\n    s[i + m] = s2[i];\n  }\n}\nvoid f4(int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", s[i]);\n    if (i < m + n - 1)\n      printf(\" \");\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  f1();\n  f2(str1, m);\n  f2(str2, n);\n  f3(str1, str2, str, m, n);\n  f4(str, m, n);\n}\n"}
{"label": "8", "index": "14871", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input(void);\nvoid sort(int *a, int n, int m);\nvoid merger(int *a, int n, int *b, int m);\nvoid output(int *a, int n, int m);\nint n, m, a[200], b[100];\nvoid input(void) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *a, int n, int *b, int m) {\n  int i, j, min, temp;\n  for (i = 0; i < n - 1; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[min])\n        min = j;\n    if (min != i) {\n      temp = a[i];\n      a[i] = a[min];\n      a[min] = temp;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    min = i;\n    for (j = i + 1; j < m; j++)\n      if (b[j] < b[min])\n        min = j;\n    if (min != i) {\n      temp = b[i];\n      b[i] = b[min];\n      b[min] = temp;\n    }\n  }\n}\n\nvoid merger(int *a, int n, int *b, int m) {\n  int i, j;\n  for (i = n, j = 0; i < n + m, j < m; i++)\n    a[i] = b[j++];\n}\n\nvoid output(int *a, int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[n + m - 1]);\n}\nint main() {\n  input();\n  sort(a, n, b, m);\n  merger(a, n, b, m);\n  output(a, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14872", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint l1, l2;\nint a[2000], b[1000];\nint temp;\nvoid cins(void) \n{\n  cin >> l1 >> l2;\n  for (int i = 1; i <= l1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= l2; i++) {\n    cin >> b[i];\n  }\n}\nvoid sorts(void) \n{\n  for (int i = 1; i < l1; i++) {\n    for (int j = 1; j <= l1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (int i = 1; i < l2; i++) {\n    for (int j = 1; j <= l2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(void) \n{\n  for (int i = l1 + 1; i <= l1 + l2; i++) {\n    a[i] = b[i - l1];\n  }\n}\nvoid couts(void) \n{\n  cout << a[1];\n  for (int i = 2; i <= l1 + l2; i++) {\n    cout << \" \" << a[i];\n  }\n  cout << endl;\n}\nint main(void) {\n  cins();\n  sorts();\n  together();\n  couts(); \n  return 0;\n}\n"}
{"label": "8", "index": "14873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[233], b[233];\nint n, m, i, j, z;\nvoid shuru(int p) {\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  scanf(\"%d\", &b[0]);\n  for (i = 1; i < m; i++) {\n    scanf(\" %d\", &b[i]);\n  }\n}\nvoid paixu(int p) {\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        z = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = z;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        z = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = z;\n      }\n    }\n  }\n}\nvoid hebing(int p) {\n  for (i = n; i < m + n; i++) {\n    a[i] = b[i - n];\n  }\n}\nvoid shuchu(int p) {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m + n; i++) {\n    cout << \" \" << a[i];\n  }\n}\nint main() {\n  shuru(0);\n  paixu(0);\n  hebing(0);\n  shuchu(0);\n}\n"}
{"label": "8", "index": "14874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid in(int n, int a[]);\nvoid arrange(int n, int a[]);\nvoid connect(int n1, int n2, int a[], int b[], int c[]);\nvoid out(int n, int c[]);\nint main() {\n  int n1, n2, a[1000], b[1000], c[2000];\n  cin >> n1 >> n2;\n  in(n1, a);\n  in(n2, b);\n  arrange(n1, a);\n  arrange(n2, b);\n  connect(n1, n2, a, b, c);\n  out(n1 + n2, c);\n  return 0;\n}\nvoid in(int n, int a[]) {\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid arrange(int n, int a[]) {\n  int temp;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n}\n\nvoid connect(int n1, int n2, int a[], int b[], int c[]) {\n  int l = 0;\n  for (int i = 0; i < n1; i++, l++)\n    c[l] = a[i];\n  for (int j = 0; j < n2; j++, l++)\n    c[l] = b[j];\n}\nvoid out(int n, int c[]) {\n  for (int i = 0; i < n - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[n - 1] << endl;\n}\n"}
{"label": "8", "index": "14875", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], m, n;\nvoid shuru(void) {\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu(int f[], int length) {\n  int x;\n  for (int i = 0; i < length - 1; i++)\n    for (int j = 0; j <= length - 2 - i; j++)\n      if (f[j] > f[j + 1]) {\n        x = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = x;\n      }\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[i] << endl;\n}\nint main() {\n  shuru();\n  paixu(a, m);\n  paixu(b, n);\n\n  shuchu();\n}\n"}
{"label": "8", "index": "14876", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100] = {0}, b[100] = {0};\nint a_n, b_n, i;\nvoid read() {\n  scanf(\"%d %d\", &a_n, &b_n);\n  for (i = 0; i < a_n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < b_n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int a_n, int b[], int b_n) {\n  int i, j, key;\n  for (i = 1; i < a_n; i++) {\n    key = a[i];\n    j = i - 1;\n    while (a[j] > key && j >= 0) {\n      a[j + 1] = a[j];\n      j--;\n    }\n    a[j + 1] = key;\n  }\n  for (i = 1; i < b_n; i++) {\n    key = b[i];\n    j = i - 1;\n    while (b[j] > key && j >= 0) {\n      b[j + 1] = b[j];\n      j--;\n    }\n    b[j + 1] = key;\n  }\n}\nvoid merge(int a[], int a_n, int b[], int b_n) {\n  int i;\n  for (i = 0; i < b_n; i++)\n    a[a_n + i] = b[i];\n}\nvoid write() {\n  int i;\n  for (i = 0; i < a_n + b_n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[i]);\n}\nint main() {\n  read();\n  sort(a, a_n, b, b_n);\n  merge(a, a_n, b, b_n);\n  write();\n  return 0;\n}\n"}
{"label": "8", "index": "14877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b, c[20] = {0}, d[20] = {0}, e[40] = {0};\nvoid in() {\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint number(int m[]) {\n  int i, n = 0;\n  for (i = 0; m[i] != 0; i++)\n    n++;\n  return n;\n}\nvoid change(int s[]) {\n  int i, j, m;\n  for (i = 1; i < number(s); i++) {\n    for (j = 0; j < number(s) - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        m = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int m[], int n[]) {\n  int i, j = 0;\n  for (i = 0; m[i] != 0; i++) {\n    e[i] = m[i];\n    j++;\n  }\n  for (i = 0; n[i] != 0; i++) {\n    e[j] = n[i];\n    j++;\n  }\n}\nvoid out() {\n  int i;\n  for (i = 0; e[i] != 0; i++) {\n    printf(\"%d\", e[i]);\n    if (e[i + 1] != 0)\n      cout << \" \";\n  }\n}\nint main() {\n  in();\n  change(c);\n  change(d);\n  link(c, d);\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change(int x, int z[20]) {\n  int i, j, middle;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1; j++) {\n      if (z[j] > z[j + 1]) {\n        middle = z[j];\n        z[j] = z[j + 1];\n        z[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n\n  change(m, a);\n  change(n, b);\n  prin();\n}\n"}
{"label": "8", "index": "14879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint A, B;\nint a[250], b[250], c[501];\nvoid input() {\n  scanf(\"%d\", &A);\n  scanf(\"%d\", &B);\n  for (int i = 0; i < A; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int j = 0; j < B; j++)\n    scanf(\"%d\", &b[j]);\n}\nvoid paixu() {\n  for (int j = A - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r] > a[r + 1]) {\n        int tmp;\n        tmp = a[r + 1];\n        a[r + 1] = a[r];\n        a[r] = tmp;\n      }\n    }\n  }\n  for (int j = B - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (b[r] > b[r + 1]) {\n        int tmp;\n        tmp = b[r + 1];\n        b[r + 1] = b[r];\n        b[r] = tmp;\n      }\n    }\n  }\n}\n\nvoid hebing() {\n  for (int i = 0; i < A; i++) {\n    c[i] = a[i];\n  }\n  for (int i = A; i < A + B; i++) {\n    c[i] = b[i - A];\n  }\n}\n\nvoid show() {\n  for (int j = 0; j < A + B; j++) {\n    cout << c[j];\n    if (j < A + B - 1) {\n      printf(\" \");\n    }\n  }\n}\n\nint main() {\n  input();\n\n  paixu();\n\n  hebing();\n\n  show();\n}\n"}
{"label": "8", "index": "14880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, t;\n  scanf(\"%d%d\", &m, &n);\n  printf(\"\\n\");\n  int a[m], b[n], i, j;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"\\n\");\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m;\nvoid change(int a[]);\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i;\n  int first = 0;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  change(a);\n  for (i = 0; i < n; i++)\n    cout << a[i] << \" \";\n\n  n = m;\n  change(b);\n  for (i = 0; i < m; i++) {\n    if (first == 1)\n      cout << \" \" << b[i];\n    if (first == 0) {\n      printf(\"%d\", b[i]);\n      first = 1;\n    }\n  }\n  cout << endl;\n  return 0;\n}\nvoid change(int a[]) {\n  int t;\n  int i, j;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "8", "index": "14882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void shuru(int array[100], int x);\n  void paixu(int array[100], int x);\n  int i, m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid shuru(int array[100], int x) {\n  int i;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\nvoid paixu(int array[100], int x) {\n  int i, j, b;\n  for (j = 1; j < x; j++) {\n    for (i = 0; i < x - j; i++) {\n      if (array[i] > array[i + 1]) {\n        b = array[i];\n        array[i] = array[i + 1];\n        array[i + 1] = b;\n      }\n    }\n  }\n}\n"}
{"label": "8", "index": "14883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid output(int c[], int m, int n) {\n  int i;\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", c[i]);\n}\nvoid combine(int a[], int b[], int m, int n) {\n  int c[100];\n  int i, j = 1;\n  for (i = 1; i <= m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m + 1; i <= n + m; i++, j++) {\n    c[i] = b[j];\n  }\n  output(c, m, n);\n}\nvoid order(int a[], int b[], int m, int n) {\n  int i, j, temp;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  combine(a, b, m, n);\n}\nvoid input(void) {\n  int i, a[100], b[100], m, n;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n  order(a, b, m, n);\n}\nint main() {\n  input();\n  return 0;\n}\n"}
{"label": "8", "index": "14884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a1[10000], a2[10000], a3[10000];\nvoid X1() {\n  cin >> m >> n;\n  cout << endl;\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &a1[i]);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a2[i]);\n}\nvoid X2() {\n  int change;\n  for (int i = 0; i < m - 1; i++) {\n    for (int j = i + 1; j < m; j++) {\n      if (a1[i] > a1[j]) {\n        change = a1[i];\n        a1[i] = a1[j];\n        a1[j] = change;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a2[i] > a2[j]) {\n        change = a2[i];\n        a2[i] = a2[j];\n        a2[j] = change;\n      }\n    }\n  }\n}\nvoid X3() {\n  for (int i = 0; i < m; i++)\n    a3[i] = a1[i];\n  for (int i = 0; i < n; i++)\n    a3[i + m] = a2[i];\n}\nvoid X4() {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a3[i] << \" \";\n  printf(\"%d\", a3[m + n - 1]);\n  cout << endl;\n}\nint main() {\n  X1();\n  X2();\n  X3();\n  X4();\n  return 0;\n}\n"}
{"label": "8", "index": "14885", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], m, n;\nvoid sca() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int a[], int b[]) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\nvoid in(int a[], int b[]) {\n  int i;\n  for (i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid pri() {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n}\nint main() {\n  sca();\n  order(a, b);\n  in(a, b);\n  pri();\n  return 0;\n}\n"}
{"label": "8", "index": "14886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, s1[1000], s2[1000], s[1000];\nvoid f1(void) {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid f2(void) {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (s1[j] > s1[j + 1]) {\n        temp = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (s2[j] > s2[j + 1]) {\n        temp = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = s1[i];\n  for (i = m; i < m + n; i++)\n    s[i] = s2[i - m];\n}\nvoid f4(void) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", s[i]);\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int a[100], int b[100], int m, int n);\n  void bubble(int a[100], int m);\n  void print(int a[100], int b[100], int m, int n);\n  int m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  bubble(a, m);\n  bubble(b, n);\n  print(a, b, m, n);\n  return 0;\n}\n\nvoid read(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid bubble(int a[100], int m) {\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid print(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint shuzu1[10] = {0}, shuzu2[10] = {0};\nint n1, n2;\nvoid input() {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d \", &shuzu1[i]);\n  for (i = 0; i < n2; i++)\n    cin >> shuzu2[i];\n}\n\nvoid sort(int shuzu[], int bg, int ed) {\n  int bg1 = bg, ed1 = ed, key = shuzu[bg];\n  if (bg1 != ed1) {\n    while (bg1 != ed1) {\n      for (; shuzu[ed1] >= key && bg1 != ed1; ed1--)\n        ;\n      shuzu[bg1] = shuzu[ed1];\n      if (bg1 == ed1)\n        break;\n      bg1++;\n      for (; shuzu[bg1] <= key && bg1 != ed1; bg1++)\n        ;\n      shuzu[ed1] = shuzu[bg1];\n      if (bg1 == ed1)\n        break;\n      ed1--;\n    }\n    shuzu[bg1] = key;\n    if (bg1 != bg)\n      sort(shuzu, bg, bg1 - 1);\n    if (ed1 != ed)\n      sort(shuzu, ed1 + 1, ed);\n  }\n}\nvoid sort1() {\n  sort(shuzu1, 0, n1 - 1);\n  sort(shuzu2, 0, n2 - 1);\n}\nvoid link() {\n  int lk;\n  for (lk = 0; lk < n2; lk++)\n    shuzu1[n1 + lk] = shuzu2[lk];\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i)\n      printf(\" \");\n    cout << shuzu1[i];\n  }\n}\nint main() {\n  input();\n  sort1();\n  link();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0, a[100], b[100];\nint *pointer1 = &m, *pointer2 = &n;\nvoid input(int *r, int *s, int *x, int *y) {\n  int i;\n  scanf(\"%d %d\", r, s);\n  for (i = 0; i < *r; i++) {\n    scanf(\"%d\", x + i);\n  }\n  for (i = 0; i < *s; i++) {\n    scanf(\"%d\", y + i);\n  }\n}\nvoid sort(int *t, int *p) {\n  int i, j, r, s;\n  for (i = 0; i < (*t) - 1; i++) {\n    r = i;\n    for (j = i + 1; j < *t; j++)\n      if (*(p + j) < *(p + r))\n        r = j;\n    if (r != i) {\n      s = *(p + i);\n      *(p + i) = *(p + r);\n      *(p + r) = s;\n    }\n  }\n}\nvoid output(int *x, int *y, int *p1, int *p2) {\n  int i;\n  for (i = 0; i < *x; i++)\n    printf(\"%d \", *(p1 + i));\n  for (i = 0; i < *y; i++)\n    printf(\"%d%c\", *(p2 + i), (i < (*y) - 1) ? ' ' : '\\n');\n}\nint main() {\n  input(pointer1, pointer2, a, b);\n  sort(pointer1, a);\n  sort(pointer2, b);\n  output(pointer1, pointer2, a, b);\n}\n"}
{"label": "8", "index": "14890", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid shuru(int a[], int b[], int m, int n) {\n  int *p = a, *q = b;\n  int i, j;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", p);\n    p++;\n  }\n  for (j = 0; j < n; j++) {\n    scanf(\"%d\", q);\n    q++;\n  }\n}\nvoid paixu(int a[], int m) {\n  int *p = a, b, c, d;\n  for (b = 0; b < m - 1; b++) {\n    for (c = 0; c < m - 1 - b; c++) {\n      if (*(p + c) > *(p + c + 1)) {\n        d = *(p + c);\n        *(p + c) = *(p + c + 1);\n        *(p + c + 1) = d;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int c[], int m, int n) {\n  int *r = a, *s = b, *t = c, p, q;\n  for (p = 0; p < m; p++) {\n    *(t + p) = *(r + p);\n  }\n  for (q = 0; q < n; q++) {\n    *(t + m + q) = *(s + q);\n  }\n}\nvoid shuchu(int a[], int b) {\n  int c;\n  printf(\"%d\", a[0]);\n  for (c = 1; c < b; c++) {\n    printf(\" %d\", a[c]);\n  }\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0}, m, n;\n  cin >> m >> n;\n  shuru(a, b, m, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, c, m, n);\n  shuchu(c, m + n);\n}\n"}
{"label": "8", "index": "14891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int n, int a[100]) \n{\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n}\nint paixu(int a[100], int n) \n{\n  int i, j, t;\n  for (j = n - 2; j >= 0; j--)\n    for (i = 0; i <= j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  return (*a);\n}\nvoid mix(int a[], int b[], int c[], int e, int d) \n{\n  int i = 0, t;\n  for (i = 0; i < e; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < d; i++) {\n    c[i + e] = b[i];\n  }\n}\nvoid out(int c[300], int e, int d) \n{\n  int i = 0;\n  for (i = 0; i < e + d - 1; i++) {\n    cout << c[i] << \" \";\n  }\n  cout << c[e + d - 1];\n}\nint main() {\n  int a[100], b[100], c[300], i = 0, x, y;\n  cin >> x >> y;\n  read(x, a);\n  read(y, b);\n  paixu(a, x);\n  paixu(b, y);\n  mix(a, b, c, x, y);\n  out(c, x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[200] = {0}, b[200] = {0}, tem, *p, *q;\n  p = a;\n  q = b;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - i - 1; j++) {\n      if (*(p + j) > *(p + j + 1)) {\n        tem = *(p + j);\n        *(p + j) = *(p + j + 1);\n        *(p + j + 1) = tem;\n      }\n    }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - i - 1; j++) {\n      if (*(q + j) > *(q + j + 1)) {\n        tem = *(q + j);\n        *(q + j) = *(q + j + 1);\n        *(q + j + 1) = tem;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "8", "index": "14893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100], b[100], m, n;\nint c[200];\nint shuru() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return 0;\n}\nint paixu() {\n  int i = 0, j = 0, t = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint hebing() {\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n\n  for (int i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return 0;\n}\nint shuchu() {\n  cout << c[0];\n  for (int i = 1; i < m + n; i++) {\n    cout << \" \" << c[i];\n  }\n  return 0;\n}\n\nint main() {\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int m, n;\n  int temp;\n  int a[1000];\n  int b[1000];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        temp = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14895", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n1, n2, a[200], b[100];\n\nvoid readNum() {\n  int i;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Bubble() {\n  int t, i, j;\n  for (i = n1 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n2 - 1; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid gether() {\n  int i;\n  for (i = 0; i < n2; i++)\n    a[n1 + i] = b[i];\n}\n\nvoid printNum() {\n  int i;\n  for (i = 0; i < n1 + n2; i++)\n    printf(\"%d%c\", a[i], (i < n1 + n2 - 1) ? ' ' : '\\n');\n}\n\nint main() {\n  readNum();\n  Bubble();\n  gether();\n  printNum();\n  return 0;\n}\n"}
{"label": "8", "index": "14896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s1 = 0, s2 = 0;\nvoid reads() { cin >> s1 >> s2; }\nvoid read(int s, int a[]) {\n  for (int i = 1; i <= s; i++)\n    cin >> a[i];\n}\nvoid sort(int s, int a[]) {\n  for (int i = 1; i <= s - 1; i++)\n    for (int j = i + 1; j <= s; j++) {\n      if (a[i] > a[j]) {\n        int c = a[i];\n        a[i] = a[j];\n        a[j] = c;\n      }\n    }\n}\nvoid combine(int s1, int s2, int a1[], int a2[]) {\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    a1[i] = a2[i - s1];\n}\nvoid print(int s, int a[]) {\n  for (int i = 1; i <= s; i++) {\n    cout << a[i];\n    if (i < s)\n      cout << ' ';\n  }\n}\nint main() {\n  int a1[500], a2[500];\n  reads();\n  read(s1, a1);\n  read(s2, a2);\n  sort(s1, a1);\n  sort(s2, a2);\n  combine(s1, s2, a1, a2);\n  print(s1 + s2, a1);\n  return 0;\n}\n"}
{"label": "8", "index": "14897", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[20], d[20], s[20], l, i, j;\nvoid shuru() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint shuchu(int s[]) {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[a + b - 1]);\n  return 0;\n}\nint paixu(int f[], int k) {\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (f[j] >= f[j + 1]) {\n        l = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = l;\n      }\n  return 0;\n}\nint hebing(int c[], int d[]) {\n  for (i = 0; i < a; i++)\n    s[i] = c[i];\n  for (i = a; i < b + a; i++)\n    s[i] = d[i - a];\n  return 0;\n}\nint main() {\n  shuru();\n  paixu(c, a);\n  paixu(d, b);\n  hebing(c, d);\n  shuchu(s);\n  return 0;\n}\n"}
{"label": "8", "index": "14898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[10000];\nint b[10000];\nint n, m;\nvoid du() {\n  cin >> n >> m;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid ran() {\n  for (int i = 0; i < n; i++) {\n    int temp = a[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] <= temp) {\n        a[j + 1] = temp;\n        break;\n      } else {\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < m; i++) {\n    int temp = b[i];\n    for (int j = i - 1; j >= 0; j--) {\n      if (b[j] <= temp) {\n        b[j + 1] = temp;\n        break;\n      } else {\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid he() {\n  for (int i = n; i < n + m; i++)\n    a[i] = b[i - n];\n}\nvoid shu() {\n  for (int i = 0; i < n + m - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n + m - 1];\n}\nint main() {\n  du();\n  ran();\n  he();\n  shu();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint A[100];\nint An;\nint B[100];\nint Bn;\n\nvoid getAn() { scanf(\"%d \", &An); }\n\nvoid getBn() { cin >> Bn; }\n\nvoid sortA() {\n  for (int i = 0; i < An; i++) {\n    cin >> A[i];\n  }\n\n  sort(A, A + An);\n}\n\nvoid sortB() {\n  for (int i = 0; i < Bn; i++) {\n    cin >> B[i];\n  }\n\n  sort(B, B + Bn);\n}\n\nvoid OutA() {\n  for (int i = 0; i < An; i++) {\n    cout << A[i] << \" \";\n  }\n}\n\nvoid OutB() {\n  for (int i = 0; i < Bn; i++) {\n    cout << B[i];\n    if (i != Bn - 1)\n      cout << \" \";\n  }\n}\n\nint main() {\n  getAn();\n  getBn();\n  sortA();\n  sortB();\n  OutA();\n  OutB();\n  return 0;\n}\n"}
{"label": "8", "index": "14900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  int a[1000], b[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[m - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint paixu(int n, int m) {\n  int i, j, num;\n  int shuzu[1000];\n  for (i = 1; i <= n + m; i++) {\n    cin >> num;\n    shuzu[i] = num;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = n + 1; i <= n + m; i++) {\n    for (j = n + m - 1; j >= i; j--) {\n      if (shuzu[j] > shuzu[j + 1])\n        num = shuzu[j], shuzu[j] = shuzu[j + 1], shuzu[j + 1] = num;\n    }\n  }\n  for (i = 1; i <= n + m; i++) {\n    if (i == m + n)\n      cout << shuzu[i];\n    else\n      cout << shuzu[i] << \" \";\n  }\n  return 0;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  paixu(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int num[], int a[]) {\n  int j;\n  scanf(\"%d%d\", &num[0], &num[1]);\n  for (j = 0; j < num[0] + num[1]; j++)\n    scanf(\"%d\", &a[j]);\n}\nvoid order(int num[], int a[]) {\n  int j, k, temp;\n  for (j = 0; j < num[0]; j++) {\n    for (k = num[0] - 1; k > 0; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n  for (j = num[0]; j < num[0] + num[1]; j++) {\n    for (k = num[0] + num[1] - 1; k > num[0]; k--) {\n      if (a[k] < a[k - 1]) {\n        temp = a[k];\n        a[k] = a[k - 1];\n        a[k - 1] = temp;\n      }\n    }\n  }\n}\nvoid print(int num[], int a[]) {\n  int i;\n  for (i = 0; i < num[0] + num[1] - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[num[0] + num[1] - 1]);\n}\nint main() {\n  int a[40], num[2];\n  input(num, a);\n  order(num, a);\n  print(num, a);\n}\n"}
{"label": "8", "index": "14903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m;\nint a[1000], b[1000], c[2000];\n\nvoid read() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < m; ++i)\n    scanf(\"%d\", b + i);\n}\n\nint cmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }\n\nvoid sort() {\n  qsort(a, n, sizeof(int), cmp);\n  qsort(b, m, sizeof(int), cmp);\n}\n\nvoid merge() {\n  int i;\n  for (i = 0; i < n; ++i)\n    c[i] = a[i];\n  for (i = 0; i < m; ++i)\n    c[n + i] = b[i];\n}\n\nvoid output() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n + m; ++i)\n    printf(\" %d\", c[i]);\n}\n\nint main() {\n  read();\n  sort();\n  merge();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14904", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\nint order(int str[], int po, int start) {\n  for (int i = 1; i < po; i++) {\n    for (int j = 1; j <= po - i; j++) {\n      if (str[j] > str[j + 1])\n        swap(str[j], str[j + 1]);\n    }\n  }\n  for (int i = start; i < po + start; i++) {\n    c[i] = str[i - start + 1];\n  }\n  return 0;\n}\nint output() {\n  order(a, m, 1);\n  order(b, n, m + 1);\n  for (int i = 1; i < m + n; i++)\n    cout << c[i] << \" \";\n  cout << c[m + n];\n  return 0;\n}\nint main() {\n  cin >> m >> n;\n  for (int i = 1; i <= m; i++) {\n    cin >> a[i];\n  }\n  for (int j = 1; j <= n; j++)\n    cin >> b[j];\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void print(int a[], int b[]);\n  int a[100], b[100];\n  print(a, b);\n  return 0;\n}\n\nvoid print(int a[100], int b[100]) {\n  int n, m, i, j, k, l = 0;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        k = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n    if (i == m - 1)\n      break;\n    printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[200], i, m, n;\n  scanf(\"%d\", &m);\n  scanf(\"%d\", &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n  int j, p;\n  for (i = m - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n  int q;\n  for (q = 0; q < m; q++)\n    c[q] = a[q];\n  for (q = m; q < m + n; q++)\n    c[q] = b[q - m];\n  int s;\n  printf(\"%d\", c[0]);\n  for (s = 1; s < m + n; s++)\n    cout << \" \" << c[s];\n}\n"}
{"label": "8", "index": "14907", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint ary1[30], ary2[30];\nint *pt1, *pt2;\n\nvoid input(int array[], int num) {\n  int i;\n  for (i = 0; i < num; i++) {\n    cin >> array[i];\n  }\n}\nvoid sort(int *ptr, int num) {\n  int i, j;\n  int temp;\n  for (i = num - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (*(ptr + j) > *(ptr + j + 1)) {\n        swap(*(ptr + j), *(ptr + j + 1));\n      }\n    }\n  }\n}\nvoid combine(int *ptr1, int *ptr2, int num1, int num2) {\n  int i;\n  ptr1 += num1;\n  for (i = 0; i < num2; i++) {\n    *(ptr1 + i) = *(ptr2 + i);\n  }\n}\nvoid demo(int *pointer, int sum) {\n  int count = 0;\n  while (count != sum) {\n    cout << *pointer;\n    if (count++ != sum - 1) {\n      cout << \" \";\n    }\n    pointer++;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  pt1 = &ary1[0];\n  pt2 = &ary2[0];\n  int m, n;\n  cin >> m >> n;\n  input(ary1, m);\n  input(ary2, n);\n  sort(ary1, m);\n  sort(ary2, n);\n  combine(pt1, pt2, m, n);\n  demo(pt1, m + n);\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "8", "index": "14908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid shuru(int a[], int b[]);\nvoid paixu(int a[]);\nvoid hebing(int a[], int b[]);\nvoid shuchu(int a[]);\nint main() {\n  int a[100] = {0}, b[100] = {0};\n  shuru(a, b);\n  paixu(a);\n  paixu(b);\n  hebing(a, b);\n  shuchu(a);\n}\n\nvoid shuru(int a[], int b[]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid paixu(int a[]) {\n  int i, j, temp, len = 0;\n  for (i = 0; a[i] != 0; i++)\n    len++;\n  for (j = 1; j < len; j++) {\n    for (i = 0; i < len - j; i++) {\n      if (a[i] > a[i + 1]) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n\nvoid hebing(int a[], int b[]) {\n  int i, lena = 0, lenb = 0;\n  for (i = 0; a[i] != 0; i++)\n    lena++;\n  for (i = 0; b[i] != 0; i++)\n    lenb++;\n  for (i = 0; i < lenb; i++)\n    a[i + lena] = b[i];\n}\n\nvoid shuchu(int a[]) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != 0; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "8", "index": "14909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int n1, int n2) {\n  int a[100], b[100], i, j, k, l, m, n, p, q, term = 0;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n2; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < n1; k++) {\n    for (m = k + 1; m < n1; m++) {\n      if (a[m] < a[k]) {\n        term = a[k];\n        a[k] = a[m];\n        a[m] = term;\n      }\n    }\n  }\n  for (n = 0; n < n2; n++) {\n    for (l = n + 1; l < n2; l++) {\n      if (b[l] < b[n]) {\n        term = b[n];\n        b[n] = b[l];\n        b[l] = term;\n      }\n    }\n  }\n  for (p = 0; p < n1; p++) {\n    printf(\"%d \", a[p]);\n  }\n  for (q = 0; q < n2 - 1; q++) {\n    printf(\"%d \", b[q]);\n  }\n  printf(\"%d\", b[n2 - 1]);\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  f(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], n, m;\nvoid shuru(void);\nvoid paixu(void);\nvoid hebing(void);\nvoid shuchu(void);\nint main() {\n\n  shuru();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\nvoid shuru(void) {\n  int x, y;\n  cin >> x >> y;\n  int i;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  n = x;\n  m = y;\n}\nvoid paixu(void) {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++)\n    for (j = i; j < n; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = i; j < m; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n}\nvoid hebing(void) {\n  int i;\n  for (i = n; i < m + n; i++)\n    a[i] = b[i - n];\n}\nvoid shuchu(void) {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[m + n - 1];\n}\n"}
{"label": "8", "index": "14911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int a[100], int b[100], int m, int n);\n  void bubble(int a[100], int m);\n  void print(int a[100], int b[100], int m, int n);\n  int m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  bubble(a, m);\n  bubble(b, n);\n  print(a, b, m, n);\n  return 0;\n}\n\nvoid read(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid bubble(int a[100], int m) {\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid print(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    printf(\"%d \", a[i]);\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "8", "index": "14912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint str1[100], str2[100], str[200];\nint m, n;\nvoid f1() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &str1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &str2[i]);\n  }\n}\nvoid f2(int s[100], int k) {\n  int i, j, t;\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1; i++) {\n      if (s[i] > s[i + 1]) {\n        t = s[i];\n        s[i] = s[i + 1];\n        s[i + 1] = t;\n      }\n    }\n  }\n}\nvoid f3(int s1[100], int s2[100], int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    s[i] = s1[i];\n  }\n  for (i = 0; i < n; i++)\n    s[i + m] = s2[i];\n}\nvoid f4(int s[200], int m, int n) {\n  int i;\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", s[i]);\n    if (i < m + n - 1)\n      printf(\" \");\n  }\n  printf(\"\\n\");\n}\n\nint main() {\n  f1();\n  f2(str1, m);\n  f2(str2, n);\n  f3(str1, str2, str, m, n);\n  f4(str, m, n);\n}\n"}
{"label": "8", "index": "14913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f(int m, int n) {\n  int i, j;\n  int temp;\n  int a[100] = {0};\n  int b[100] = {0};\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &b[j]);\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = temp;\n      }\n    }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = temp;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n - 1];\n}\n\nint main() {\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n\n  f(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], b[1000], la, lb;\nint p;\nint c[1000], lc;\n\nvoid M1(int m1) {\n  cin >> la >> lb;\n  for (int i = 1; i <= la; i++)\n    cin >> a[i];\n  for (int i = 1; i <= lb; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid M2(int m2) {\n  for (int i = 1; i <= la; i++) {\n    for (int j = 1; j <= la - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (int i = 1; i <= lb; i++) {\n    for (int j = 1; j <= lb - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\n\nvoid M3(int m3) {\n  lc = la + lb;\n  for (int i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (int i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n}\n\nvoid M4(int m4) {\n  for (int i = 1; i <= lc; i++) {\n    cout << c[i];\n    if (i == lc)\n      break;\n    cout << \" \";\n  }\n}\n\nint main() {\n  M1(1);\n  M2(1);\n  M3(1);\n  M4(1);\n  return 0;\n}\n"}
{"label": "8", "index": "14915", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint len1, len2, array1[100], array2[100], sa[100];\nvoid zp1(int a1[100], int l1) {\n  int cur1;\n  for (int i = 0; i < l1 - 1; i++)\n    for (int j = 0; j < l1 - 1 - i; j++)\n      if (a1[j] > a1[j + 1]) {\n        cur1 = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = cur1;\n      }\n}\nvoid zp2(int a2[100], int l2) {\n  int cur2;\n  for (int i = 0; i < l2 - 1; i++) {\n    for (int j = 0; j < l2 - 1 - i; j++)\n      if (a2[j] > a2[j + 1]) {\n        cur2 = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = cur2;\n      }\n  }\n}\nvoid connection(int a1[100], int a2[100]) {\n  for (int i = 0; i < len1; i++)\n    sa[i] = array1[i];\n  for (int i = len1; i < len1 + len2; i++)\n    sa[i] = array2[i - len1];\n}\n\nint main() {\n\n  cin >> len1 >> len2;\n  for (int i = 0; i < len1; i++)\n    cin >> array1[i];\n  for (int i = 0; i < len2; i++)\n    cin >> array2[i];\n  zp1(array1, len1);\n  zp2(array2, len2);\n  connection(array1, array2);\n  cout << sa[0];\n  for (int i = 1; i < len1 + len2; i++)\n    cout << \" \" << sa[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "8", "index": "14916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)(elem1)) - *((int *)(elem2));\n}\nint main() {\n  int n1, n2;\n  int *a1, *a2;\n  int i1, i2, i3, i4;\n  cin >> n1 >> n2;\n  a1 = (int *)malloc(sizeof(int) * n1);\n  a2 = (int *)malloc(sizeof(int) * n2);\n  for (i1 = 0; i1 < n1; i1++) {\n    scanf(\"%d\", a1 + i1);\n  }\n  for (i2 = 0; i2 < n2; i2++) {\n    scanf(\"%d\", a2 + i2);\n  }\n  qsort(a1, n1, sizeof(int), Compare);\n  qsort(a2, n2, sizeof(int), Compare);\n  for (i3 = 0; i3 < n1; i3++) {\n    printf(\"%d \", a1[i3]);\n  }\n  for (i4 = 0; i4 < n2 - 1; i4++) {\n    cout << a2[i4] << \" \";\n  }\n  printf(\"%d\", a2[n2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid paixu(int a[], int m) {\n  int i, j, d;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        d = a[i];\n        a[i] = a[j];\n        a[j] = d;\n      }\n    }\n  }\n  return;\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n; i++)\n    cout << \" \" << b[i];\n  return;\n}\n\nint main() {\n  int m, n, a[100], b[100], i;\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14918", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a, b;\nvoid shuru();\nvoid paixu1();\nvoid paixu2();\nint main() {\n  shuru();\n  paixu1();\n  paixu2();\n\n  return 0;\n}\nvoid shuru() { cin >> a >> b; }\nvoid paixu1() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < a - 1; i++)\n    for (j = 0; j < a - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < a; i++)\n    printf(\"%d \", c[i]);\n}\nvoid paixu2() {\n  int i, j, t;\n  int c[100];\n  for (i = 0; i < b; i++)\n    cin >> c[i];\n  for (i = 0; i < b - 1; i++)\n    for (j = 0; j < b - 1 - i; j++) {\n      if (c[j] > c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n      }\n    }\n  for (i = 0; i < b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[b - 1];\n}\n"}
{"label": "8", "index": "14919", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, a[1000], b, k = 0, tmp, j;\n  scanf(\"%d%d\", &n, &m);\n  for (i = 1; i <= n + m; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n + 1; i++)\n    for (j = 1; j <= n - 1; j++)\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= m + 1; i++)\n    for (j = n + 1; j <= n + m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n + m; i++)\n    printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, n1, n2, a1[100], a2[100];\nvoid scan() {\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (j = 0; j < n2; j++)\n    cin >> a2[j];\n}\nvoid adjust() {\n  int p;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (a1[i] > a1[j]) {\n        p = a1[i];\n        a1[i] = a1[j];\n        a1[j] = p;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (a2[i] > a2[j]) {\n        p = a2[i];\n        a2[i] = a2[j];\n        a2[j] = p;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (i = n1; i < n1 + n2; i++) {\n    a1[i] = a2[i - n1];\n  }\n}\nvoid print() {\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a1[i] << \" \";\n  printf(\"%d\\n\", a1[n1 + n2 - 1]);\n}\nint main() {\n  scan();\n  adjust();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid order(int a[100], int l1);\nvoid prin(int a[100], int l1, int b[100], int l2) {\n  int i;\n  char c = '\\0';\n  order(a, l1);\n  order(b, l2);\n  for (i = 0; i < l1; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < l2; i++) {\n    if (i < l2 - 1)\n      c = ' ';\n    else\n      c = '\\n';\n    printf(\"%d%c\", b[i], c);\n  }\n}\nvoid order(int a[100], int l1) {\n  int i, j, b;\n  for (i = 0; i < l1; i++) {\n    for (j = i; j < l1; j++) {\n      if (a[j] < a[i]) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint main() {\n  int l1, l2, i;\n  int a[100], b[100];\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &b[i]);\n  prin(a, l1, b, l2);\n  return 0;\n}\n"}
{"label": "8", "index": "14922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], b[1000];\nint c[2000];\nint p, q;\n\nvoid read(void) { \n  cin >> p >> q;\n  int i = 0;\n  for (i = 0; i < p; i++)\n    cin >> a[i];\n  for (i = 0; i < q; i++)\n    cin >> b[i];\n}\n\nvoid increaseSort(void) { \n  sort(a + 0, a + p);\n  sort(b + 0, b + q);\n}\n\nvoid merge(void) { \n  int i = 0;\n  for (i = 0; i < p; i++)\n    c[i] = a[i];\n  for (i = p; i < p + q; i++)\n    c[i] = b[i - p];\n}\n\nvoid print(void) { \n  int i = 0;\n  cout << c[0];\n  for (i = 1; i < p + q; i++)\n    cout << \" \" << c[i];\n  cout << endl;\n}\n\nint main() {\n  read();\n  increaseSort();\n  merge();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14923", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid input(int x[], int p);\nvoid sort_ascending(int x[], int p);\nint main() {\n  int m, n, a[1000], b[1000], j, i;\n  scanf(\"%d %d\", &m, &n);\n  input(a, m);\n  input(b, n);\n  sort_ascending(a, m);\n  sort_ascending(b, n);\n  for (j = 0; j < m; j++)\n    printf(\"%d \", a[j]);\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[n - 1]);\n}\nvoid input(int x[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    cin >> x[i];\n}\nvoid sort_ascending(int x[], int p) {\n  int i, j, t;\n  for (i = 0; i < p; i++)\n    for (j = 0; j < p - i - 1; j++)\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n}\n"}
{"label": "8", "index": "14924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, n = 0; \n\nvoid Get_In(int a[10000], int b[10000]) \n{\n  int i = 0, j = 0;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++)\n    cin >> b[j];\n}\n\nvoid Ranking(int a[10000], int l) {\n  int i = 0, j = 0, temp = 0;\n  for (i = 0; i < (l - 1); i++) {\n    for (j = (i + 1); j < l; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid Combine(int a[10000], int b[10000]) {\n  int i = 0;\n  for (i = 0; i < n; i++) {\n    a[m + i] = b[i];\n  }\n}\n\nvoid Turn_Out(int a[10000]) {\n  int i = 0;\n  for (i = 0; i < (m + n); i++) {\n    if (i < (m + n - 1))\n      cout << a[i] << \" \";\n    else if (i == (m + n - 1))\n      cout << a[i] << endl;\n  }\n}\n\nint main() {\n  int a[10000], b[10000];\n  cin >> m >> n;\n  Get_In(a, b);\n  Ranking(a, m);\n  Ranking(b, n);\n  Combine(a, b);\n  Turn_Out(a);\n  return 0;\n}\n"}
{"label": "8", "index": "14925", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[500], b[200], temp;\nvoid read(void) {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &b[i]);\n}\n\nvoid rank_1(void) {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\n\nvoid merge(void) {\n  for (int i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\n\nvoid show(void) {\n  for (int i = 0; i < m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n - 1];\n}\n\nint main(void) {\n  read();\n  rank_1();\n  merge();\n  show();\n  return 0;\n}\n"}
{"label": "8", "index": "14926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100];\nvoid shuru() {\n  int i;\n  scanf(\"%d %d \", &n, &m);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\n\nvoid paixu() {\n  int i, j;\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] > a[j]) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = i + 1; j <= m; j++) {\n      if (b[i] > b[j]) {\n        b[0] = b[i];\n        b[i] = b[j];\n        b[j] = b[0];\n      }\n    }\n}\nvoid hebin() {\n  int i;\n  for (i = n + 1; i <= n + m; i++)\n    a[i] = b[i - n];\n}\n\nvoid shuchu() {\n  int i;\n  for (i = 1; i <= m + n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[m + n] << endl;\n}\nint main() {\n  shuru();\n  paixu();\n  hebin();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14927", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint num1[1000], num2[1000], a, b;\n\nvoid cin_array(int num1[], int num2[]) {\n  cin >> a >> b;\n  for (int i = 0; i < a; i++)\n    cin >> num1[i];\n  for (int i = 0; i < b; i++)\n    cin >> num2[i];\n} \n\nvoid sort(int num1[], int num2[]) {\n  int temp;\n  for (int i = 1; i <= a; i++)\n    for (int j = 0; j < a - i; j++)\n      if (num1[j] > num1[j + 1]) {\n        temp = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = temp;\n      }\n  for (int i = 1; i <= b; i++)\n    for (int j = 0; j < b - i; j++)\n      if (num2[j] > num2[j + 1]) {\n        temp = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = temp;\n      }\n} \n\nvoid connect(int num1[], int num2[]) {\n  for (int i = 0; i < b; i++)\n    num1[a + i] = num2[i];\n} \n\nvoid cout_array(int num[]) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[a + b - 1];\n} \n\nint main() {\n  cin_array(num1, num2);\n  sort(num1, num2);\n  connect(num1, num2);\n  cout_array(num1);\n  return 0;\n}\n"}
{"label": "8", "index": "14928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(int a[], int b[], int c[]) {\n  int x = 0, y = 0;\n  cin >> x >> y;\n  int i = 0;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < y; i++)\n    cin >> b[i];\n  int j = 0, t = 0;\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    c[i] = a[i];\n  for (i = x; i < x + y; i++)\n    c[i] = b[i - x];\n  for (i = 0; i < x + y - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\", c[x + y - 1]);\n}\nint main() {\n  int a[1000] = {0}, b[1000] = {0}, c[2000] = {0};\n  change(a, b, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], la, lb, c[20000];\nvoid get();\nvoid array_1();\nvoid combine();\nvoid out();\nint main() {\n  get();\n  array_1();\n  combine();\n  out();\n  return 0;\n}\nvoid get() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < lb; i++) {\n    cin >> b[i];\n  }\n}\nvoid array_1() {\n  int v;\n  for (int i = 0; i < la - 1; i++) {\n    for (int j = 0; j < la - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        v = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = v;\n      }\n    }\n  }\n  for (int i = 0; i < lb - 1; i++) {\n    for (int j = 0; j < lb - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        v = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = v;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (int i = 0; i < la; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < lb; i++) {\n    c[la + i] = b[i];\n  }\n}\nvoid out() {\n  for (int i = 0; i < la + lb; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << ' ' << c[i];\n  }\n}\n"}
{"label": "8", "index": "14930", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m = 0, n = 0, i = 0;\n  int a[1000], b[1000];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  paixu(a, m);\n  paixu(b, n);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "14931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, i;\n  int a[20], b[20];\n  cin >> x >> y;\n  for (i = 0; i < x; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < y; i++) {\n    cin >> b[i];\n  }\n  sort(a, a + x);\n  sort(b, b + y);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < x; i++) {\n    cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14932", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid s(int m);\nint main() {\n  int a, b;\n  scanf(\"%d %d \", &a, &b);\n  s(a);\n  printf(\" \");\n  s(b);\n  return 0;\n}\nvoid s(int m) {\n  int i, j, c[1000], d;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        d = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14933", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid input(int a[], int b[]) {\n  int i, m, n;\n  cin >> a[49] >> b[49];\n  m = a[49];\n  n = b[49];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int m, int n, int a[], int b[]) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid comb(int m, int n, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < (m + n); i++)\n    c[i] = b[i - m];\n}\nvoid print(int m, int n, int c[]) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < (m + n); i++)\n    printf(\" %d\", c[i]);\n}\nint main() {\n  int a[50], b[50], c[100];\n  input(a, b);\n  order(a[49], b[49], a, b);\n  comb(a[49], b[49], a, b, c);\n  print(a[49], b[49], c);\n}\n"}
{"label": "8", "index": "14934", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100];\nint c, d;\nvoid read(int, int);\nvoid rank_1(int, int);\nvoid print(int, int);\nint main() {\n  cin >> c >> d;\n  read(c, d);\n  rank_1(c, d);\n  print(c, d);\n  return 0;\n}\nvoid read(int n, int m) {\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid rank_1(int n, int m) {\n  int temp;\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 0; j < n - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < m - 1; i++)\n    for (int j = 0; j < m - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid print(int n, int m) {\n  for (int i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  for (int i = 0; i < m; i++) {\n    cout << b[i];\n    if (i != m - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "14935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n1, n2, a1[200], a2[200], i, j, t;\nvoid toscan() {\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid paixu() {\n  for (i = 1; i < n1; i++)\n    for (j = 0; j < i; j++)\n      if (a1[j] > a1[i]) {\n        t = a1[i];\n        a1[i] = a1[j];\n        a1[j] = t;\n      }\n  for (i = 1; i < n2; i++)\n    for (j = 0; j < i; j++)\n      if (a2[j] > a2[i]) {\n        t = a2[i];\n        a2[i] = a2[j];\n        a2[j] = t;\n      }\n}\n\nvoid hebing() {\n  for (i = 0; i < n2; i++)\n    a1[i + n1] = a2[i];\n}\n\nvoid toprint() {\n  printf(\"%d\", a1[0]);\n  for (i = 1; i < n1 + n2; i++)\n    printf(\" %d\", a1[i]);\n}\n\nint main() {\n  toscan();\n  paixu();\n  hebing();\n  toprint();\n  return 0;\n}\n"}
{"label": "8", "index": "14936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], b[100], c[100], n, m, i, j, k;\n\nvoid get_array();\nvoid sort_array();\nvoid combine_array();\nvoid print_array();\n\nint main() {\n  get_array();\n\n  sort_array();\n\n  combine_array();\n\n  print_array();\n\n  return 0;\n}\n\nvoid get_array() {\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid sort_array() {\n  int temp = 0;\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n}\nvoid combine_array() {\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n\n  for (i = 0; i < m; i++) {\n    c[i + n] = b[i];\n  }\n}\nvoid print_array() {\n  cout << c[0];\n  for (i = 1; i < m + n; i++)\n    cout << ' ' << c[i];\n  printf(\"\\n\");\n}\n"}
{"label": "8", "index": "14937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint bijiao(const void *x, const void *y) { return *(int *)x - *(int *)y; }\nint main() {\n  int n, m, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= m - 1; i++)\n    scanf(\"%d \", &b[i]);\n  qsort(a, n, sizeof(a[0]), bijiao);\n  qsort(b, m, sizeof(b[0]), bijiao);\n  for (i = 0; i <= n - 1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n}\n"}
{"label": "8", "index": "14938", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[20], d[20], s[20], l, i, j;\nvoid shuru() {\n  scanf(\"%d%d\", &a, &b);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < b; i++)\n    cin >> d[i];\n}\nint shuchu(int s[]) {\n  for (i = 0; i < a + b - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[a + b - 1]);\n  return 0;\n}\nint paixu(int f[], int k) {\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (f[j] >= f[j + 1]) {\n        l = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = l;\n      }\n  return 0;\n}\nint hebing(int c[], int d[]) {\n  for (i = 0; i < a; i++)\n    s[i] = c[i];\n  for (i = a; i < b + a; i++)\n    s[i] = d[i - a];\n  return 0;\n}\nint main() {\n  shuru();\n  paixu(c, a);\n  paixu(d, b);\n  hebing(c, d);\n  shuchu(s);\n}\n"}
{"label": "8", "index": "14939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid inputarray(int a[], int);\nvoid place(int a[], int);\nvoid combine(int a[], int b[], int, int);\nvoid printarray(int a[], int);\n\nint main(void) {\n  int array1[100], array2[100], m, n;\n  scanf(\"%d %d \", &m, &n);\n  inputarray(array1, m);\n  inputarray(array2, n);\n  place(array1, m);\n  place(array2, n);\n  combine(array1, array2, m, n);\n  printarray(array1, m + n);\n  return 0;\n}\n\nvoid inputarray(int array[], int n) {\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n}\n\nvoid printarray(int array[], int n) {\n  printf(\"%d\", array[0]);\n  for (int i = 1; i < n; i++) {\n    cout << \" \" << array[i];\n  }\n  printf(\"\\n\");\n}\n\nvoid place(int array[], int n) {\n  int mininum, temp;\n  for (int i = 0; i < n - 1; i++) {\n    mininum = i;\n    for (int j = i + 1; j < n; j++) {\n      mininum = array[j] < array[mininum] ? j : mininum;\n    }\n    temp = array[i];\n    array[i] = array[mininum];\n    array[mininum] = temp;\n  }\n}\n\nvoid combine(int array1[], int array2[], int m, int n) {\n  for (int i = m; i < m + n; i++) {\n    array1[i] = array2[i - m];\n  }\n}\n"}
{"label": "8", "index": "14940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s1, s2;\nint reads() {\n  int a;\n  cin >> a;\n  return a;\n}\nvoid reada(int a[]) {\n  for (int i = 1; i <= s1; i++) {\n    cin >> a[i];\n  }\n}\nvoid readb(int b[]) {\n  for (int i = 1; i <= s2; i++) {\n    cin >> b[i];\n  }\n}\nvoid reordera(int a[]) {\n  for (int i = 1; i <= s1 - 1; i++)\n    for (int j = 1; j <= s1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int m = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = m;\n      }\n    }\n}\nvoid reorderb(int b[]) {\n  for (int i = 1; i <= s2 - 1; i++)\n    for (int j = 1; j <= s2 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        int m = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = m;\n      }\n    }\n}\nvoid hebing(int a[], int b[], int c[]) {\n  for (int i = 1; i <= s1; i++)\n    c[i] = a[i];\n  for (int i = s1 + 1; i <= s1 + s2; i++)\n    c[i] = b[i - s1];\n}\nvoid output(int c[]) {\n  for (int i = 1; i <= s1 + s2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[s1 + s2];\n}\n\nint main() {\n  int a[500], b[500], c[1000];\n  s1 = reads(); \n  s2 = reads();\n  reada(a);        \n  readb(b);        \n  reordera(a);     \n  reorderb(b);     \n  hebing(a, b, c); \n  output(c);       \n  return 0;\n}\n"}
{"label": "8", "index": "14941", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint input(int[], int);\nint sort(int[], int);\nvoid combine(int[], int[], int, int);\nvoid output(int[], int, int);\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  int a[100], b[100];\n  input(a, n1);\n  input(b, n2);\n  sort(a, n1);\n  sort(b, n2);\n  combine(a, b, n1, n2);\n  return 0;\n}\nint input(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  return a[i];\n}\nint sort(int a[], int n) {\n  int i, j, p;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  return a[j];\n}\nvoid combine(int a[], int b[], int n1, int n2) {\n  int c[200];\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n2 + n1; i++)\n    c[i] = b[i - n1];\n  output(c, n1, n2);\n}\nvoid output(int c[], int n1, int n2) {\n  int i;\n  for (i = 0; i < n1 + n2 - 1; i++)\n    printf(\"%d \", c[i]);\n  printf(\"%d\\n\", c[n1 + n2 - 1]);\n}\n"}
{"label": "8", "index": "14942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid input(void);\nvoid sort(int *a, int n, int *b, int m);\nvoid merger(int *a, int n, int *b, int m);\nvoid output(int *a, int n, int m);\nint n, m, a[200], b[100];\nvoid input(void) {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int *a, int n, int *b, int m) {\n  int i, j, min, temp;\n  for (i = 0; i < n - 1; i++) {\n    min = i;\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[min])\n        min = j;\n    if (min != i) {\n      temp = a[i];\n      a[i] = a[min];\n      a[min] = temp;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    min = i;\n    for (j = i + 1; j < m; j++)\n      if (b[j] < b[min])\n        min = j;\n    if (min != i) {\n      temp = b[i];\n      b[i] = b[min];\n      b[min] = temp;\n    }\n  }\n}\n\nvoid merger(int *a, int n, int *b, int m) {\n  int i, j;\n  for (i = n, j = 0; i < n + m, j < m; i++)\n    a[i] = b[j++];\n}\n\nvoid output(int *a, int n, int m) {\n  int i;\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[n + m - 1]);\n}\nint main() {\n  input();\n  sort(a, n, b, m);\n  merger(a, n, b, m);\n  output(a, n, m);\n}\n"}
{"label": "8", "index": "14943", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100], b[100], c[200], i, j, m, n;\nvoid read(void) {\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    cin >> b[i];\n  }\n  return;\n}\nvoid place(void) {\n  int s;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        s = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = s;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        s = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = s;\n      }\n    }\n  }\n  return;\n}\nvoid together(void) {\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = m; i < m + n; i++) {\n    c[i] = b[i - m];\n  }\n  return;\n}\nvoid put(void) {\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      cout << c[i];\n    } else {\n      cout << ' ' << c[i];\n    }\n  }\n  return;\n}\n\nint main() {\n  read();\n  place();\n  together();\n  put();\n  return 0;\n}\n"}
{"label": "8", "index": "14944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int c[], int w);\nint main() {\n  int n, m, i, j;\n  int a[10], b[10];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  f(a, n);\n  f(b, m);\n  for (i = 0; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (j = 0; j < m - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[m - 1]);\n}\nint f(int c[], int w) {\n  int i, j, k, t;\n  for (i = 0; i < w - 1; i++) {\n    k = i;\n    for (j = i + 1; j < w; j++)\n      if (c[j] < c[k])\n        k = j;\n    t = c[k];\n    c[k] = c[i];\n    c[i] = t;\n  }\n}\n"}
{"label": "8", "index": "14945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20], b[20], c[40], la = 0, lb = 0;\nint read(int a[], int b[]);\nint sort(int a[], int b[]);\nint catenate(int a[], int b[], int c[]);\nint print(int c[], int l);\nint main() {\n  read(a, b);\n  sort(a, b);\n  catenate(a, b, c);\n  print(c, la + lb);\n  return 0;\n}\nint read(int a[], int b[]) {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return 0;\n}\nint sort(int a[], int b[]) {\n  int i, j, change;\n  for (i = 1; i < la; i++)\n    for (j = 1; j <= la - i; j++)\n      if (a[j] > a[j + 1]) {\n        change = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = change;\n      }\n  for (i = 1; i < lb; i++)\n    for (j = 1; j <= lb - i; j++)\n      if (b[j] > b[j + 1]) {\n        change = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = change;\n      }\n  return 0;\n}\nint catenate(int a[], int b[], int c[]) {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = 1; i <= lb; i++)\n    c[la + i] = b[i];\n  return 0;\n}\nint print(int c[], int l) {\n  int i;\n  cout << c[1];\n  for (i = 2; i <= l; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "8", "index": "14946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid input(int p, int q, int *num1, int *num2) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", num1 + i);\n  for (i = 0; i < q; i++)\n    scanf(\"%d\", num2 + i);\n}\nvoid sort(int p, int q, int *num1, int *num2) {\n  int i, j, t;\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n    for (j = 0; j < q - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int p, int q, int *num1, int *num2) {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < p; i++)\n    printf(\" %d\", num1[i]);\n  for (i = 0; i < q; i++)\n    printf(\" %d\", num2[i]);\n}\nint main() {\n  int p, q, *num1, *num2;\n  scanf(\"%d%d\", &p, &q);\n  num1 = (int *)malloc(p * sizeof(int));\n  num2 = (int *)malloc(q * sizeof(int));\n  input(p, q, num1, num2);\n  sort(p, q, num1, num2);\n  print(p, q, num1, num2);\n}\n"}
{"label": "8", "index": "14947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10000], b[10000], la, lb, c[20000];\nvoid get();\nvoid array_1();\nvoid combine();\nvoid out();\nint main() {\n  get();\n  array_1();\n  combine();\n  out();\n  return 0;\n}\nvoid get() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < lb; i++)\n    cin >> b[i];\n}\nvoid array_1() {\n  int v;\n  for (int i = 0; i < la - 1; i++) {\n    for (int j = 0; j < la - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        v = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = v;\n      }\n    }\n  }\n  for (int i = 0; i < lb - 1; i++) {\n    for (int j = 0; j < lb - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        v = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = v;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (int i = 0; i < la; i++) {\n    c[i] = a[i];\n  }\n  for (int i = 0; i < lb; i++) {\n    c[la + i] = b[i];\n  }\n}\nvoid out() {\n  for (int i = 0; i < la + lb; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << ' ' << c[i];\n  }\n}\n"}
{"label": "8", "index": "14948", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100] = {0}, b[100] = {0};\nint i = 0, j = 0, I, J;\n\nint main() {\n  void load(); \n  void order(int a[],\n             int b[]); \n  void conflate(\n      int a[],\n      int b[]); \n  void print(int a[]); \n\n  load();\n  order(a, b);\n  conflate(a, b);\n  print(a);\n}\n\nvoid load() {\n\n  scanf(\"%d %d\", &i, &j);\n  I = i;\n  J = j;\n  for (i = 0; i < I; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < J; j++)\n    scanf(\"%d\", &b[j]);\n}\n\nvoid order(int a[], int b[]) {\n  void xu(int x[], int y);\n\n  xu(a, I);\n  xu(b, J);\n}\n\nvoid xu(int x[], int y) {\n  int *p, *q, *temp, t;\n  p = x;\n  for (i = 0; i < y - 1; i++) {\n    p = &x[i];\n    for (j = i + 1; j < y; j++) {\n      q = &x[j];\n      if (*p > *q) {\n        temp = p;\n        p = q;\n        q = temp;\n      }\n    }\n    if (p != &x[i]) {\n      t = *p;\n      *p = x[i];\n      x[i] = t;\n    }\n  }\n}\n\nvoid conflate(int a[], int b[]) {\n  for (i = I; i < I + J; i++) {\n    a[i] = b[i - I];\n  }\n}\n\nvoid print(int a[]) {\n  for (i = 0; i < I + J; i++) {\n    printf(\"%d\", a[i]);\n    if (i < I + J - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "14949", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint n1, n2, num1[10001], num2[10001];\n\nvoid init() \n{\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\n\nvoid sort() \n{\n  int i, j, t;\n  for (i = 0; i < n1 - 1; i++) \n    for (j = 0; j < n1 - i - 1; j++)\n      if (num1[j] > num1[j + 1]) {\n        t = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = t; \n      }\n  for (i = 0; i < n2 - 1; i++) \n    for (j = 0; j < n2 - i - 1; j++)\n      if (num2[j] > num2[j + 1]) {\n        t = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = t; \n      }\n}\n\nvoid merge() \n{\n  int i, j;\n  for (i = n1, j = 0; j < n2; i++, j++)\n    num1[i] = num2[j]; \n  n1 += n2;\n}\n\nvoid show() \n{\n  int i;\n  cout << num1[0];\n  for (i = 1; i < n1; i++)\n    cout << ' ' << num1[i];\n  cout << endl;\n}\n\nint main() {\n  init();  \n  sort();  \n  merge(); \n  show();  \n  return 0;\n}\n"}
{"label": "8", "index": "14950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int *p1, int *p2, int **pA, int **pB) {\n  int i;\n  scanf(\"%d %d\", p1, p2);\n  *pA = (int *)malloc((*p1) * sizeof(int));\n  *pB = (int *)malloc((*p2) * sizeof(int));\n  for (i = 0; i < *p1; i++)\n    scanf(\"%d\", *pA + i);\n  for (i = 0; i < *p2; i++)\n    scanf(\"%d\", *pB + i);\n}\nvoid sort(int p, int *pX) {\n  int i, j, temp;\n  for (i = 0; i < p; i++) {\n    for (j = p - 1; j > i; j--) {\n      if (pX[j] < pX[j - 1]) {\n        temp = pX[j];\n        pX[j] = pX[j - 1];\n        pX[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int p1, int p2, int *pA, int *pB, int **pC) {\n  *pC = (int *)malloc((p1 + p2) * sizeof(int));\n  int i;\n  for (i = 0; i < p1; i++)\n    (*pC)[i] = pA[i];\n  for (i = 0; i < p2; i++)\n    (*pC)[p1 + i] = pB[i];\n  free(pA);\n  free(pB);\n}\nvoid output(int p, int *pC) {\n  int i;\n  for (i = 0; i < p - 1; i++)\n    printf(\"%d \", pC[i]);\n  cout << pC[p - 1] << \" \";\n  free(pC);\n}\nint main() {\n  int p1, p2, *pA, *pB, *pC;\n  input(&p1, &p2, &pA, &pB);\n  sort(p1, pA);\n  sort(p2, pB);\n  combine(p1, p2, pA, pB, &pC);\n  output(p1 + p2, pC);\n}\n"}
{"label": "8", "index": "14951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint output(int b[], int a) {\n  sort(b, b + a);\n  for (int i = 0; i < a - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[a - 1];\n}\nint main() {\n  int a, b;\n  cin >> a >> b;\n  int input(int a, int s);\n  input(a, b);\n  return 0;\n}\nint input(int a, int s) {\n  int b[1000], c[1000];\n  for (int i = 0; i < a; i++)\n    cin >> b[i];\n  for (int i = 0; i < s; i++)\n    cin >> c[i];\n  output(b, a);\n  cout << ' ';\n  output(c, s);\n}\n"}
{"label": "8", "index": "14952", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid readin(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < mb; i++)\n    cin >> b[i];\n}\nvoid rearange(int ma, int mb, int a[100], int b[100]) {\n  int temp;\n  for (int i = 0; i < ma; i++)\n    for (int j = 0; j < ma - 1; j++)\n      if (a[j] > a[j + 1]) {\n        int temp;\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (int i = 0; i < mb; i++)\n    for (int j = 0; j < mb - 1; j++)\n      if (b[j] > b[j + 1]) {\n        int temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nint printout(int ma, int mb, int a[], int b[]) {\n  for (int i = 0; i < ma; i++)\n    cout << a[i] << ' ';\n  for (int i = 0; i < mb - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[mb - 1];\n}\nint main() {\n  int ma[1], mb[1], a[100] = {0}, b[100] = {0};\n  readin(1, 1, ma, mb);\n  readin(ma[0], mb[0], a, b);\n  rearange(ma[0], mb[0], a, b);\n  printout(ma[0], mb[0], a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f2(int a[100], int b[100], int x, int y);\n  void f(int a[100], int x);\n  int i, x, y, a[100], b[100];\n  scanf(\"%d %d\", &x, &y);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &b[i]);\n  f(a, x);\n  f(b, y);\n  f2(a, b, x, y);\n  for (i = 0; i < x + y; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n}\nvoid f(int a[100], int x) {\n  int i, j, t;\n  for (i = 0; i < x - 1; i++)\n    for (j = 0; j < x - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n}\nvoid f2(int a[100], int b[100], int x, int y) {\n  int i;\n  for (i = 0; i < y; i++)\n    a[i + x] = b[i];\n}\n"}
{"label": "8", "index": "14954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid read(int a[], int m);\nvoid bubble(int a[], int m);\nvoid add(int a[], int b[], int c[], int m, int n);\nvoid out(int c[], int m);\n\nint main() {\n  int m, n;\n  int a[100], b[100], c[200];\n  scanf(\"%d%d\", &m, &n);\n  read(a, m);\n  read(b, n);\n  bubble(a, m);\n  bubble(b, n);\n  add(a, b, c, m, n);\n  out(c, m + n);\n  return 0;\n}\n\nvoid read(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n}\n\nvoid bubble(int a[], int m) {\n  int i, j, tmp;\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (a[j] > a[j + 1]) {\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n}\n\nvoid add(int a[], int b[], int c[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++) {\n    c[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    c[i + m] = b[i];\n  }\n}\n\nvoid out(int c[], int m) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", c[i]);\n  }\n}\n"}
{"label": "8", "index": "14955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint scan() {\n  int m;\n  cin >> m;\n  return m;\n}\nint fuzhi(int a[], int n) {\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k);\n    a[i] = k;\n  }\n  return 0;\n}\nint paixu(int b[], int n) {\n  int i, j, temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  return 0;\n}\nint print(int c[], int d[], int m3, int m4) {\n  int i = 0;\n  for (i = 0; i < m3; i++) {\n    printf(\"%d \", c[i]);\n  }\n  for (i = 0; i < m4; i++) {\n    printf(\"%d\", d[i]);\n    if (i != m4 - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int m1;\n  int m2;\n  int x[100];\n  int y[100];\n  m1 = scan();\n  m2 = scan();\n  fuzhi(x, m1);\n  fuzhi(y, m2);\n  paixu(x, m1);\n  paixu(y, m2);\n  print(x, y, m1, m2);\n  return 0;\n}\n"}
{"label": "8", "index": "14956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n;\nint a[100], b[100], k[200];\nvoid f1();\nvoid f2(int[], int[]);\nvoid f3(int[], int[]);\nvoid f4(int[]);\nint main() {\n  f1();\n  f2(a, b);\n  f3(a, b);\n  f4(k);\n  return 0;\n}\nvoid f1() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    cin >> a[i];\n  for (int j = 0; j < n; j++)\n    cin >> b[j];\n}\nvoid f2(int c[], int d[]) {\n  for (int i = 0; i < m; i++) {\n    for (int j = m - 1; j > i; j--) {\n      if (c[j] < c[j - 1])\n        swap(c[j], c[j - 1]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = n - 1; j > i; j--) {\n      if (d[j] < d[j - 1])\n        swap(d[j], d[j - 1]);\n    }\n  }\n}\nvoid f3(int e[], int f[]) {\n  for (int i = 0; i < m + n; i++) {\n    if (i < m)\n      k[i] = a[i];\n    else\n      k[i] = b[i - m];\n  }\n}\nvoid f4(int g[]) {\n  for (int i = 0; i < n + m - 1; i++)\n    printf(\"%d \", g[i]);\n  cout << g[n + m - 1] << endl;\n}\n"}
{"label": "8", "index": "14957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  void func(int, int);\n  scanf(\"%d%d\", &a, &b);\n  func(a, b);\n}\nvoid func(int x, int y) {\n  int i, j, t, q;\n  int a[100], b[100];\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < y; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i < x; i++) {\n    for (j = 0; j < x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%d \", a[i]);\n  }\n  for (i = 0, q = 0; i < y; i++) {\n    if (q < y - 1) {\n      printf(\"%d \", b[i]);\n      q = q + 1;\n    } else\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "8", "index": "14958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num1[1000], num2[1000], num[2000], n1, n2;\nvoid dr() {\n  cin >> n1 >> n2;\n  int i;\n  for (i = 0; i < n1; i++)\n    cin >> num1[i];\n  for (i = 0; i < n2; i++)\n    cin >> num2[i];\n}\nint px() {\n  int i, j, tem;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (num1[j] < num1[i]) {\n        tem = num1[i];\n        num1[i] = num1[j];\n        num1[j] = tem;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (num2[j] < num2[i]) {\n        tem = num2[i];\n        num2[i] = num2[j];\n        num2[j] = tem;\n      }\n    }\n  }\n}\nint gb() {\n  int i;\n  for (i = 0; i < n1; i++)\n    num[i] = num1[i];\n  for (i = n1; i < n1 + n2; i++)\n    num[i] = num2[i - n1];\n}\nint dy() {\n  cout << num[0];\n  int i;\n  for (i = 1; i < n1 + n2; i++)\n    cout << ' ' << num[i];\n}\nint main() {\n  dr();\n  px();\n  gb();\n  dy();\n  return 0;\n}\n"}
{"label": "8", "index": "14959", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a, b, c[20] = {0}, d[20] = {0}, e[40] = {0};\nvoid in() {\n  int i;\n  scanf(\"%d %d\", &a, &b);\n  for (i = 0; i < a; i++)\n    cin >> c[i];\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &d[i]);\n}\nint number(int m[]) {\n  int i, n = 0;\n  for (i = 0; m[i] != 0; i++)\n    n++;\n  return n;\n}\nvoid change(int s[]) {\n  int i, j, m;\n  for (i = 1; i < number(s); i++) {\n    for (j = 0; j < number(s) - 1; j++) {\n      if (s[j] > s[j + 1]) {\n        m = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = m;\n      }\n    }\n  }\n}\nvoid link(int m[], int n[]) {\n  int i, j = 0;\n  for (i = 0; m[i] != 0; i++) {\n    e[i] = m[i];\n    j++;\n  }\n  for (i = 0; n[i] != 0; i++) {\n    e[j] = n[i];\n    j++;\n  }\n}\nvoid out() {\n  int i;\n  for (i = 0; e[i] != 0; i++) {\n    printf(\"%d\", e[i]);\n    if (e[i + 1] != 0)\n      printf(\" \");\n  }\n}\nint main() {\n  in();\n  change(c);\n  change(d);\n  link(c, d);\n  out();\n}\n"}
{"label": "8", "index": "14960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, n, s1[1000], s2[1000], s[1000];\nvoid f1(void) {\n  int i;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n}\nvoid f2(void) {\n  int i, j, temp;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (s1[j] > s1[j + 1]) {\n        temp = s1[j];\n        s1[j] = s1[j + 1];\n        s1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (s2[j] > s2[j + 1]) {\n        temp = s2[j];\n        s2[j] = s2[j + 1];\n        s2[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < m; i++)\n    s[i] = s1[i];\n  for (i = m; i < m + n; i++)\n    s[i] = s2[i - m];\n}\nvoid f4(void) {\n  int i;\n  printf(\"%d\", s[0]);\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << s[i];\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14961", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, a[100], b[100], i, q, j;\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        q = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = q;\n      }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        q = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = q;\n      }\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[n - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14962", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid duqu(int n, int m, int a[], int b[]) {\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid sort(int a[], int n, int b[], int m) {\n  int i, j, t;\n\n  for (j = 0; j < n - 1; j++) {\n\n    for (i = 0; i < n - 1 - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  }\n  for (j = 0; j < m - 1; j++) {\n\n    for (i = 0; i < m - 1 - j; i++)\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  }\n}\nvoid hebing(int array1[], int array2[], int n, int m) {\n  int i;\n  for (i = n; i < (n + m); i++)\n    array1[i] = array2[i - n];\n}\nvoid xian(int array[], int n, int m) {\n  int i;\n  for (i = 0; i < (n + m - 1); i++)\n    printf(\"%d \", array[i]);\n  printf(\"%d\", array[n + m - 1]);\n}\n\nint main() {\n  void duqu(int n, int m, int a[], int b[]);\n  void sort(int *p1, int n, int *p2, int m);\n  void hebing(int array1[], int array2[], int n, int m);\n  void xian(int array[], int n, int m);\n  int n, m, a[1000], b[1000];\n  scanf(\"%d %d\", &n, &m);\n  duqu(n, m, a, b);\n  sort(a, n, b, m);\n  hebing(a, b, n, m);\n  xian(a, n, m);\n}\n"}
{"label": "8", "index": "14963", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], b[1000], n1, n2;\nvoid get(int a[], int b[]) {\n  int i;\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort(int a[], int b[]) {\n  int i, j, temp;\n  for (i = 0; i < n1; i++) {\n    for (j = i; j < n1; j++) {\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i; j < n2; j++) {\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n  }\n}\nvoid print(int a[], int b[]) {\n  int i;\n  for (i = 0; i < n1; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n2 - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[n2 - 1];\n}\nint main() {\n  get(a, b);\n  sort(a, b);\n  print(a, b);\n  return 0;\n}\n"}
{"label": "8", "index": "14964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid px(int a[100], int k) {\n  int i, j, b;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        b = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = b;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[k - 1]);\n}\nvoid fz() {\n  int m, n, i, a[100], b[100];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  px(a, n);\n  printf(\" \");\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  px(b, m);\n}\nint main() {\n  fz();\n  return 0;\n}\n"}
{"label": "8", "index": "14965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, b;\nint c[1000], d[1000];\nvoid scan1() {\n  scanf(\"%d %d\", &a, &b);\n  int i;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n}\n\nvoid order() {\n  int i, j, k;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < b - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        k = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = k;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < b; i++) {\n    c[a + i] = d[i];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a + b; i++) {\n    if (i) {\n      printf(\" \");\n    }\n    printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  scan1();\n  order();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i = 0, j = 0;\n  int t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int a[], int n, int b[], int m) {\n  int i = 0, j = 0;\n  while (i < n) {\n    printf(\"%d \", a[i]);\n    i++;\n  }\n  while (j < m - 1) {\n    printf(\"%d \", b[j]);\n    j++;\n  }\n  printf(\"%d\", b[m - 1]);\n}\nint main() {\n  void order(int a[], int n);\n  void print(int a[], int n, int b[], int m);\n  int x[20], y[20];\n  int n, m, i = 0, j = 0;\n  scanf(\"%d%d\", &n, &m);\n  while (i < n) {\n    scanf(\"%d\", &x[i]);\n    i++;\n  }\n  while (j < m) {\n    scanf(\"%d\", &y[j]);\n    j++;\n  }\n  order(x, n);\n  order(y, m);\n  print(x, n, y, m);\n  return 0;\n}\n"}
{"label": "8", "index": "14967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[], int e);\nvoid f2(int b[], int f);\nvoid f3(int c[], int h, int d[], int l);\nint main() {\n  int shuzu1[200], shuzu2[200];\n  int geshu1, geshu2;\n  scanf(\"%d%d\", &geshu1, &geshu2);\n  f1(shuzu1, geshu1);\n  f1(shuzu2, geshu2);\n  f2(shuzu1, geshu1);\n  f2(shuzu2, geshu2);\n  f3(shuzu1, geshu1, shuzu2, geshu2);\n  return 0;\n}\nvoid f1(int a[], int e) {\n  int i;\n  for (i = 0; i < e; i++)\n    scanf(\"%d\", &a[i]);\n}\nvoid f2(int b[], int f) {\n  int k, t, g;\n  for (k = 0; k < f - 1; k++) {\n    for (t = 0; t < f - 1; t++) {\n      if (b[t] > b[t + 1]) {\n        g = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = g;\n      }\n    }\n  }\n}\nvoid f3(int c[], int h, int d[], int l) {\n  int z;\n  for (z = 0; z < h; z++)\n    printf(\"%d \", c[z]);\n\n  for (z = 0; z < l - 1; z++) {\n    printf(\"%d \", d[z]);\n  }\n  printf(\"%d\", d[l - 1]);\n}\n"}
{"label": "8", "index": "14968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pai1(int x[1000], int y);\nint pai2(int x[1000], int y);\nint main() {\n  int n, m, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  pai1(a, n);\n  pai2(b, m);\n  return 0;\n}\n\nint pai1(int x[], int y) {\n  int i, j, min, stmp, flag = 0;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++) {\n    if (flag == 0) {\n      printf(\"%d\", x[i]);\n      flag = 1;\n      continue;\n    }\n    if (flag == 1) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  return 0;\n}\nint pai2(int x[], int y) {\n  int i, j, min, stmp;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", x[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14969", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m, a[1000], b[1000], c[2000];\nvoid f1(void) {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid f2(void) {\n  int i, j, p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n  }\n}\nvoid f3(void) {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid f4(void) {\n  int i, count = 0;\n  for (i = 0; i < n + m; i++) {\n    if (count == 0) {\n      printf(\"%d\", c[i]);\n      count++;\n    } else\n      printf(\" %d\", c[i]);\n  }\n  printf(\"\\n\");\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "14970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, q, i, num;\n  cin >> p >> q;\n  int a[10], b[10];\n  for (i = 1; i <= p; i++) {\n    cin >> num;\n    a[i] = num;\n  }\n  for (i = 1; i <= q; i++) {\n    cin >> b[i];\n  }\n  int pai(int a[], int x);\n  pai(a, p);\n  pai(b, q);\n  for (i = 1; i <= p; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 1; i <= q - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[q];\n  return 0;\n}\nint pai(int a[], int x) {\n  int i, j;\n  int m;\n  for (i = 1; i <= x - 1; i++) {\n    for (j = 1; j <= x - i; j++) {\n      if (a[j] > a[j + 1]) {\n        m = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = m;\n      }\n    }\n  }\n  return a[x];\n}\n"}
{"label": "8", "index": "14971", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int x, int y) {\n  int a[x], b[y];\n  int t, i, j;\n  for (i = 0; i < x; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < y; j++) {\n    cin >> b[j];\n  }\n\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < y - 1; i++) {\n    for (j = 0; j < y - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  for (i = 0; i < y; i++) {\n    cout << \" \" << b[i];\n  }\n}\n\nint main() {\n  int x, y;\n  scanf(\"%d %d \", &x, &y);\n  f(x, y);\n  return 0;\n}\n"}
{"label": "8", "index": "14972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint la, lb;\nint a[100] = {0}, b[100] = {0};\nvoid get() {\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  int p = a[0];\n  for (i = 0; i < la - 1; i++)\n    for (j = 0; j <= la - i - 2; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  p = b[0];\n  for (i = 0; i < lb - 1; i++)\n    for (j = 0; j <= lb - i - 2; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid link() {\n  int i;\n  for (i = la; i <= la + lb - 1; i++)\n    a[i] = b[i - la];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < la + lb - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[la + lb - 1];\n}\nint main() {\n  scanf(\"%d %d \", &la, &lb);\n  get();\n  sort();\n  link();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14973", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n1, n2, a1[10000], a2[10000], a3[20000];\n\nvoid input(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\n\nvoid sort(void) {\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - i - 1; j++) {\n      if (a1[j] > a1[j + 1]) {\n        int temp = a1[j + 1];\n        a1[j + 1] = a1[j];\n        a1[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - i - 1; j++) {\n      if (a2[j] > a2[j + 1]) {\n        int temp = a2[j + 1];\n        a2[j + 1] = a2[j];\n        a2[j] = temp;\n      }\n    }\n  }\n}\n\nvoid joint(void) {\n  for (int i = 0; i < n1; i++) {\n    a3[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    a3[n1 + i] = a2[i];\n  }\n}\n\nvoid display(void) {\n  cout << a3[0];\n  for (int i = 1; i < n1 + n2; i++) {\n    cout << ' ' << a3[i];\n  }\n  cout << endl;\n}\n\nint main() {\n  input();\n  sort();\n  joint();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "14974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k1, k2, a[100], b[100], i, j, c;\n  scanf(\"%d%d\", &k1, &k2);\n  for (i = 0; i <= k1 - 1; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= k2 - 1; ++i) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i <= k1 - 2; ++i) {\n    for (j = i + 1; j <= k1 - 1; ++j) {\n      if (a[i] > a[j]) {\n        c = a[j];\n        a[j] = a[i];\n        a[i] = c;\n      }\n    }\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[k1 - 1]);\n  for (i = 0; i <= k2 - 2; ++i) {\n    for (j = i + 1; j <= k2 - 1; ++j) {\n      if (b[i] > b[j]) {\n        c = b[j];\n        b[j] = b[i];\n        b[i] = c;\n      }\n    }\n    printf(\" %d\", b[i]);\n  }\n  printf(\" %d\", b[k2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int n1, int n2) {\n  int a[100], b[100], i, j, k, l, m, n, p, q, term = 0;\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = 0; j < n2; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  for (k = 0; k < n1; k++) {\n    for (m = k + 1; m < n1; m++) {\n      if (a[m] < a[k]) {\n        term = a[k];\n        a[k] = a[m];\n        a[m] = term;\n      }\n    }\n  }\n  for (n = 0; n < n2; n++) {\n    for (l = n + 1; l < n2; l++) {\n      if (b[l] < b[n]) {\n        term = b[n];\n        b[n] = b[l];\n        b[l] = term;\n      }\n    }\n  }\n  for (p = 0; p < n1; p++) {\n    printf(\"%d \", a[p]);\n  }\n  for (q = 0; q < n2 - 1; q++) {\n    printf(\"%d \", b[q]);\n  }\n  printf(\"%d\", b[n2 - 1]);\n}\nint main() {\n  int n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  f(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int a[], int x, int b[], int y) {\n  int m, n, i;\n\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = m; i < x; i++)\n    a[i] = -1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = n; i < y; i++)\n    b[i] = -1;\n}\n\nvoid f2(int a[], int x, int b[], int y) {\n  int i, j, t, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\n\nvoid f3(int a[], int x, int b[], int y, int c[], int z) {\n  int i, m, n;\n\n  for (i = 0, m = 0; i < x; i++)\n    if (a[i] >= 0)\n      m++;\n  for (i = 0, n = 0; i < y; i++)\n    if (b[i] >= 0)\n      n++;\n\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n  for (i = n + m; i < z; i++)\n    c[i] = -1;\n}\n\nvoid f4(int c[], int x) {\n  int i, e;\n\n  for (i = 0, e = 0; i < x; i++)\n    if (c[i] >= 0)\n      e++;\n  for (i = 0; i < e; i++) {\n    printf(\"%d\", c[i]);\n    if (i != e - 1)\n      printf(\" \");\n  }\n}\n\nint main() {\n  int a[30], b[30], c[60];\n  int i;\n\n  f1(a, 30, b, 30);\n\n  f2(a, 30, b, 30);\n\n  f3(a, 30, b, 30, c, 60);\n\n  f4(c, 60);\n}\n"}
{"label": "8", "index": "14977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid a(void) {\n  int A[100], B[100], C[200], i, j, k, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &A[i]);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &B[i]);\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (A[j] > A[j + 1]) {\n        k = A[j + 1];\n        A[j + 1] = A[j];\n        A[j] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (B[j] > B[j + 1]) {\n        k = B[j + 1];\n        B[j + 1] = B[j];\n        B[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    C[i] = A[i];\n  }\n  for (i = 0; i < n; i++) {\n    C[m + i] = B[i];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      printf(\"%d\", C[i]);\n    } else {\n      printf(\" %d\", C[i]);\n    }\n  }\n}\nint main() {\n  a();\n  return 0;\n}\n"}
{"label": "8", "index": "14978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[20], b[20], c[40];\nvoid read(int x1, int x2) {\n  int i;\n  for (i = 0; i < x1; i++)\n    cin >> a[i];\n  for (i = 0; i < x2; i++)\n    cin >> b[i];\n  return;\n}\nvoid sort1(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (a[j] > a[j + 1]) {\n        tem = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tem;\n      }\n  return;\n}\nvoid sort2(int n) {\n  int k, j, tem;\n  for (k = 1; k < n; k++)\n    for (j = 0; j < n - k; j++)\n      if (b[j] > b[j + 1]) {\n        tem = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = tem;\n      }\n  return;\n}\nvoid combine(int n1, int n2) {\n  int i;\n  for (i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = b[i - n1];\n  return;\n}\n\nvoid arraycout(int n1, int n2) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n  return;\n}\nint main() {\n  int n1, n2;\n  cin >> n1 >> n2;\n  read(n1, n2);\n  sort1(n1);\n  sort2(n2);\n  combine(n1, n2);\n  arraycout(n1, n2);\n  return 0;\n}\n"}
{"label": "8", "index": "14979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i;\n  cin >> n >> m;\n  int a[1000], b[1000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n  sort(a, a + n);\n  sort(b, b + m);\n  for (i = 0; i < n; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < m - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[m - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14980", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid add(int array1[], int array2[], int x, int y) {\n  int array[100];\n  int i, j;\n  for (i = 0; i < x; i++)\n    array[i] = array1[i];\n  for (i = x, j = 0; j < y; i++, j++)\n    array[i] = array2[j];\n  printf(\"%d\", array[0]);\n  for (i = 1; i < x + y; i++)\n    printf(\" %d\", array[i]);\n}\n\nint main() {\n  int i, x, y, xarray[50], yarray[50];\n  cin >> x >> y;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &xarray[i]);\n  for (i = 0; i < y; i++)\n    scanf(\"%d\", &yarray[i]);\n  sort(xarray, x);\n  sort(yarray, y);\n  add(xarray, yarray, x, y);\n}\n"}
{"label": "8", "index": "14981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint la, lb, a[1000], b[1000], c[2000];\nvoid duqu() {\n  cin >> la >> lb;\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int j = 0; j < lb; j++)\n    cin >> b[j];\n}\nvoid paixu() {\n  int i, j, temp;\n  for (i = 0; i < la - 1; i++)\n    for (j = i + 1; j < la; j++)\n      if (a[i] > a[j]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n  for (i = 0; i < lb - 1; i++)\n    for (j = i + 1; j < lb; j++)\n      if (b[i] > b[j]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n}\nvoid hebing() {\n  for (int i = 0; i < la; i++)\n    c[i] = a[i];\n  for (int j = 0; j < lb; j++)\n    c[la + j] = b[j];\n}\nvoid shuchu() {\n  for (int i = 0; i < la + lb; i++) {\n    cout << c[i];\n    if (i != la + lb - 1)\n      printf(\" \");\n  }\n}\nint main() {\n  duqu();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint d, e, f, g;\nint a[50], b[50], c[100];\nint get(int a[50], int b[50]);\nint repick(int a[50], int b[50]);\nint hand(int a[50], int b[50], int c[100]);\nint out(int c[100]);\nint main() {\n  get(a, b);\n  repick(a, b);\n  hand(a, b, c);\n  out(c);\n  return 0;\n}\nint get(int a[50], int b[50]) {\n  scanf(\"%d%d\", &f, &g);\n  for (d = 0; d < f; d++)\n    scanf(\"%d\", &a[d]);\n  for (e = 0; e < g; e++)\n    scanf(\"%d\", &b[e]);\n  return 0;\n}\nint repick(int a[50], int b[50]) {\n  int h;\n  for (d = 0; d < f; d++)\n    for (e = 0; e < (f - d - 1); e++)\n      if (a[e] > a[e + 1]) {\n        h = a[e + 1];\n        a[e + 1] = a[e];\n        a[e] = h;\n      }\n  for (d = 0; d < g; d++)\n    for (e = 0; e < (g - d - 1); e++)\n      if (b[e] > b[e + 1]) {\n        h = b[e + 1];\n        b[e + 1] = b[e];\n        b[e] = h;\n      }\n  return 0;\n}\nint hand(int a[50], int b[50], int c[100]) {\n  d = 0;\n  while (d < f) {\n    c[d] = a[d];\n    d++;\n  }\n  while (d < (f + g)) {\n    c[d] = b[d - f];\n    d++;\n  }\n  return 0;\n}\nint out(int c[100]) {\n  d = 0;\n  printf(\"%d\", c[d]);\n  d++;\n  while (d < (f + g)) {\n    cout << \" \" << c[d];\n    d++;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "14983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s1[100], s2[100];\n  int m, n, i, t, j;\n\n  scanf(\"%d %d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s2[i]);\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (s1[j] > s1[j + 1]) {\n        t = s1[j + 1];\n        s1[j + 1] = s1[j];\n        s1[j] = t;\n      }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (s2[j] > s2[j + 1]) {\n        t = s2[j + 1];\n        s2[j + 1] = s2[j];\n        ;\n        s2[j] = t;\n      }\n    }\n  }\n\n  printf(\"%d\", s1[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", s1[i]);\n  for (i = 0; i < n; i++)\n    printf(\" %d\", s2[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14984", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100], la, b[100], lb, c[200], lc;\n\nvoid R() {\n  int i;\n  cin >> la >> lb;\n  for (i = 1; i <= la; i++)\n    cin >> a[i];\n  for (i = 1; i <= lb; i++)\n    cin >> b[i];\n  return;\n}\n\nvoid S(int *x, int lx) {\n  int i, j;\n  for (i = 1; i < lx; i++) {\n    for (j = 1; j <= lx - i; j++) {\n      if (x[j] > x[j + 1]) {\n        int t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  }\n  return;\n}\n\nvoid M() {\n  int i;\n  for (i = 1; i <= la; i++)\n    c[i] = a[i];\n  for (i = la + 1; i <= la + lb; i++)\n    c[i] = b[i - la];\n  return;\n}\n\nvoid D() {\n  int i;\n  for (i = 1; i <= la + lb; i++) {\n    if (i > 1)\n      cout << \" \";\n    printf(\"%d\", c[i]);\n  }\n  cout << endl;\n  return;\n}\n\nint main() {\n  R();\n  S(a, la);\n  S(b, lb);\n  M();\n  D();\n  return 0;\n}\n"}
{"label": "8", "index": "14985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num1[1000] = {0}, num2[1000] = {0}, m, n;\nvoid gets() {\n  int i, j;\n  cin >> m >> n;\n  for (i = 0; i < m; i++)\n    cin >> num1[i];\n  for (j = 0; j < n; j++)\n    scanf(\"%d \", &num2[j]);\n}\nvoid paixu() {\n  int i, j, a = 0;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (num1[j] > num1[j + 1]) {\n        a = num1[j];\n        num1[j] = num1[j + 1];\n        num1[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (num2[j] > num2[j + 1]) {\n        a = num2[j];\n        num2[j] = num2[j + 1];\n        num2[j + 1] = a;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < n; i++)\n    num1[m + i] = num2[i];\n}\nvoid shuchu() {\n  int i;\n  cout << num1[0];\n  for (i = 1; i < m + n; i++)\n    cout << \" \" << num1[i];\n}\nint main() {\n  gets();\n  paixu();\n  hebing();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, t = 0;\n  int *a, *b;\n  scanf(\"%d %d\", &n, &m);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(m * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = t;\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", a[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = t;\n      }\n  }\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "14987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, a[1000], b[1000];\nvoid init() {\n  cin >> m >> n;\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  for (int i = 0; i < m - 1; i++)\n    for (int j = m - 1; j > i; j--)\n      if (a[j] < a[j - 1]) {\n        int t = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = t;\n      }\n  for (int i = 0; i < n - 1; i++)\n    for (int j = n - 1; j > i; j--)\n      if (b[j] < b[j - 1]) {\n        int t = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = t;\n      }\n}\nvoid combine() {\n  for (int i = m; i < m + n; i++)\n    a[i] = b[i - m];\n}\nvoid print() {\n  for (int i = 0; i < m + n; i++) {\n    if (i)\n      cout << ' ';\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  init();\n  sort();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "14988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], c[100], m, n;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid az() {\n  int i, j, t;\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid jch() {\n  int j;\n  for (j = 0; j < m; j++) {\n    c[j] = a[j];\n  }\n  for (j = m; j < m + n; j++) {\n    c[j] = b[j - m];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    printf(\"%d \", c[i]);\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  input();\n  az();\n  jch();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "14989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid shuru(int a[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n}\nvoid paixu(int b[], int m) {\n  int i, j, t;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid hebing(int a[], int b[], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    cout << a[i] << \" \";\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[n - 1];\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  int a[m], b[n];\n  shuru(a, m);\n  shuru(b, n);\n  paixu(a, m);\n  paixu(b, n);\n  hebing(a, b, m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "14990", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid a(void) {\n  int A[100], B[100], C[200], i, j, k, m, n;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    cin >> B[i];\n  }\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (A[j] > A[j + 1]) {\n        k = A[j + 1];\n        A[j + 1] = A[j];\n        A[j] = k;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (B[j] > B[j + 1]) {\n        k = B[j + 1];\n        B[j + 1] = B[j];\n        B[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    C[i] = A[i];\n  }\n  for (i = 0; i < n; i++) {\n    C[m + i] = B[i];\n  }\n  for (i = 0; i < m + n; i++) {\n    if (i == 0) {\n      printf(\"%d\", C[i]);\n    } else {\n      printf(\" %d\", C[i]);\n    }\n  }\n}\nint main() { a(); }\n"}
{"label": "8", "index": "14991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int *a, int x) {\n  int i = x - 1, t, j;\n  while (i >= 1) {\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n    i--;\n  }\n}\nvoid lianjie(int *a, int x, int *b, int y, int *c) {\n  int i = 0, j = 0, t = 1;\n  while (i < x) {\n    c[i] = a[i];\n    i++;\n  }\n  while (j < y) {\n    c[i] = b[j];\n    i++;\n    j++;\n  }\n  printf(\"%d\", c[0]);\n  while (t < x + y) {\n    printf(\" %d\", c[t]);\n    t++;\n  }\n}\nint main() {\n  int s, t, i;\n  scanf(\"%d %d\", &s, &t);\n  int *a = (int *)malloc(s * sizeof(int));\n  int *b = (int *)malloc(t * sizeof(int));\n  int *c = (int *)malloc((s + t) * sizeof(int));\n  for (i = 0; i < s; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < t; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, s);\n  paixu(b, t);\n  lianjie(a, s, b, t, c);\n  return 0;\n}\n"}
{"label": "8", "index": "14992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int a[], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] < a[i]) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n}\nvoid cmp(int a[], int n, int b[], int m) {\n  int i = n, j;\n  for (j = 0; j < m; j++) {\n    a[i] = b[j];\n    i++;\n  }\n}\nint main() {\n  int n, m, i, a[1000], b[500];\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  f(a, n);\n  f(b, m);\n  cmp(a, n, b, m);\n  for (i = 0; i < n + m - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n + m - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint b[100], c[100], d, e, f[200];\nint du();\nint paib();\nint paic();\nint add();\nint show();\nint main() {\n  int i;\n  d = du();\n  e = du();\n  for (i = 0; i < d; i++)\n    b[i] = du();\n  for (i = 0; i < e; i++)\n    c[i] = du();\n  paib();\n  paic();\n  add();\n  show();\n  return 0;\n}\nint du() {\n  int x;\n  cin >> x;\n  return x;\n}\nint paib() {\n  int j, k, r;\n  for (j = 0; j < d - 1; j++) {\n    for (k = j + 1; k < d; k++) {\n      if (b[k] < b[j]) {\n        r = b[k];\n        b[k] = b[j];\n        b[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint paic() {\n  int j, k, r;\n  for (j = 0; j < e - 1; j++) {\n    for (k = j + 1; k < e; k++) {\n      if (c[k] < c[j]) {\n        r = c[k];\n        c[k] = c[j];\n        c[j] = r;\n      }\n    }\n  }\n  return 0;\n}\nint add() {\n  int i;\n  for (i = 0; i < d; i++)\n    f[i] = b[i];\n  for (i = 0; i < e; i++)\n    f[i + d] = c[i];\n  return 0;\n}\nint show() {\n  int i;\n  for (i = 0; i < d + e - 1; i++)\n    cout << f[i] << \" \";\n  printf(\"%d\", f[d + e - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "14994", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, n;\nint a[1000];\nint b[1000];\n\nvoid input() {\n  int i;\n\n  scanf(\"%d %d \", &m, &n);\n\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  return;\n}\n\nvoid paixu() {\n  int i, j;\n  int p;\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n\n  return;\n}\n\nvoid output() {\n  int i;\n\n  cout << a[0];\n\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n; i++)\n    printf(\" %d\", b[i]);\n\n  return;\n}\n\nint main() {\n  input();\n  paixu();\n  output();\n\n  return 0;\n}\n"}
{"label": "8", "index": "14995", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, m;\nint a[100], b[100], c[100];\nvoid shuru() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < m; i++) {\n    cin >> b[i];\n  }\n}\nvoid paixu() {\n  int i, j, t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n}\nvoid zuhe() {\n  int i;\n  for (i = 0; i < n; i++) {\n    c[i] = a[i];\n  }\n  for (i = n; i < n + m; i++)\n    c[i] = b[i - n];\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < n + m; i++) {\n    if (i != n + m - 1)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  shuru();\n  paixu();\n  zuhe();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "14996", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m, n, i, a[100], b[100], c[200];\nvoid in() {\n  scanf(\"%d %d \", &m, &n);\n  for (i = 0; i < m; ++i)\n    cin >> a[i];\n  for (i = 0; i < n; ++i)\n    cin >> b[i];\n}\nvoid sort() {\n  sort(&a[0], &a[0] + m);\n  sort(&b[0], &b[0] + n);\n}\nvoid add() {\n  for (i = 0; i < m; ++i)\n    c[i] = a[i];\n  for (i = m; i < m + n; ++i)\n    c[i] = b[i - m];\n}\nvoid out() {\n  cout << c[0];\n  for (i = 1; i < m + n; ++i)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  sort();\n  add();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "14997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint a[5000], b[5000], N1, N2, c[10000];\nint f1() {\n  int n;\n  scanf(\"%d%d\", &N1, &N2);\n  for (n = 0; n <= N1 - 1; n++) {\n    scanf(\"%d\", &a[n]);\n  }\n  for (n = 0; n <= N2 - 1; n++) {\n    scanf(\"%d\", &b[n]);\n  }\n  return 0;\n}\nint f2() {\n  int i, j, t;\n  for (i = 1; i <= N1 - 1; i++) {\n    for (j = 0; j <= N1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= N2 - 1; i++) {\n    for (j = 0; j <= N2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint f3() {\n  int i, j;\n  for (i = 0; i <= N1 - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = N1, j = 0; i <= N1 + N2 - 1; i++, j++) {\n    c[i] = b[j];\n  }\n  return 0;\n}\nint f4() {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i <= N1 + N2 - 1; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\nint main() \n{\n  f1();\n  f2();\n  f3();\n  f4();\n}\n"}
{"label": "8", "index": "14998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid paixu(int a[], int n) {\n  int i, j, m;\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n      }\n}\nvoid shuchu1(int a[], int n) {\n  int i;\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\nvoid shuchu2(int b[], int m) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\" %d\", b[i]);\n}\nint main() {\n  int a[10], n, b[10], m, i;\n  scanf(\"%d %d\", &n, &m);\n  scanf(\"\\n\");\n  for (i = 0; i < n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n - 1]);\n  scanf(\"\\n\");\n  for (i = 0; i < m - 1; i++)\n    scanf(\"%d \", &b[i]);\n  scanf(\"%d\", &b[m - 1]);\n  paixu(a, n);\n  paixu(b, m);\n  shuchu1(a, n);\n  shuchu2(b, m);\n}\n"}
{"label": "8", "index": "14999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, f, g;\n  scanf(\"%d%d\", &c, &d);\n  int a[c], b[d];\n  for (e = 0; e < c; e++)\n    scanf(\"%d\", &a[e]);\n  for (e = 0; e < d; e++)\n    cin >> b[e];\n  for (f = 0; f < c - 1; f++)\n    for (e = 0; e < c - 1; e++)\n      if (a[e] > a[e + 1]) {\n        g = a[e];\n        a[e] = a[e + 1];\n        a[e + 1] = g;\n      }\n  printf(\"%d\", a[0]);\n  for (e = 1; e < c; e++)\n    cout << \" \" << a[e];\n  for (f = 0; f < d - 1; f++)\n    for (e = 0; e < d - 1; e++)\n      if (b[e] > b[e + 1]) {\n        g = b[e];\n        b[e] = b[e + 1];\n        b[e + 1] = g;\n      }\n  for (e = 0; e < d; e++)\n    printf(\" %d\", b[e]);\n  return 0;\n}\n"}
{"label": "8", "index": "15000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, m, a[1000], b[100];\n\nvoid scan(int *p1, int l1, int *p2, int l2) {\n  int i;\n  scanf(\"%d%d\", &l1, &l2);\n  for (i = 0; i < l1; i++)\n    scanf(\"%d\", &p1[i]);\n  for (i = 0; i < l2; i++)\n    scanf(\"%d\", &p2[i]);\n}\n\nvoid paixu(int *p, int l) {\n  int t, i, j;\n  for (i = 1; i < l; i++)\n    for (j = 0; j < l - i; j++)\n      if (p[j] > p[j + 1]) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n}\n\nvoid hebing(int *p1, int l1, int *p2, int l2) {\n  int i;\n  for (i = l1; i < l1 + l2; i++)\n    p1[i] = p2[i - l1];\n}\n\nvoid print(int *p, int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    printf(\"%d%c\", p[i], (i == l - 1) ? '\\n' : ' ');\n}\n\nint main() {\n  int i;\n  cin >> n >> m;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  paixu(a, n);\n  paixu(b, m);\n  hebing(a, n, b, m);\n  print(a, m + n);\n  return 0;\n}\n"}
{"label": "8", "index": "15001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int x[], int y[], int a, int b);\n  void change(int x[], int y[], int a, int b);\n  void combine(int x[], int y[], int a, int b);\n  int x[10], y[10], a, b;\n  scanf(\"%d %d\", &a, &b);\n  read(x, y, a, b);\n  change(x, y, a, b);\n  combine(x, y, a, b);\n}\nvoid read(int x[], int y[], int a, int b) {\n  int i;\n  char c;\n  for (i = 1; i <= a; i++)\n    scanf(\"%d%c\", &x[i], &c);\n  for (i = 1; i <= b; i++)\n    scanf(\"%d%c\", &y[i], &c);\n}\nvoid change(int x[], int y[], int a, int b) {\n  int i, j, t;\n  for (i = 1; i <= a; i++)\n    for (j = 1; j < a + 1 - i; j++) {\n      if (x[j] > x[j + 1]) {\n        t = x[j];\n        x[j] = x[j + 1];\n        x[j + 1] = t;\n      }\n    }\n  for (i = 1; i <= b; i++)\n    for (j = 1; j < b + 1 - i; j++) {\n      if (y[j] > y[j + 1]) {\n        t = y[j];\n        y[j] = y[j + 1];\n        y[j + 1] = t;\n      }\n    }\n}\nvoid combine(int x[], int y[], int a, int b) {\n  int i;\n  printf(\"%d\", x[1]);\n  for (i = 2; i <= a; i++)\n    printf(\" %d\", x[i]);\n  for (i = 1; i <= b; i++)\n    printf(\" %d\", y[i]);\n}\n"}
{"label": "8", "index": "15002", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m, n;\nint a[1000];\nint b[1000];\n\nvoid input() {\n  int i;\n\n  cin >> m >> n;\n\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  return;\n}\n\nvoid paixu() {\n  int i, j;\n  int p;\n\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++)\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++)\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n\n  return;\n}\n\nvoid output() {\n  int i;\n\n  cout << a[0];\n\n  for (i = 1; i < m; i++)\n    cout << \" \" << a[i];\n  for (i = 0; i < n; i++)\n    cout << \" \" << b[i];\n\n  return;\n}\n\nint main() {\n  input();\n  paixu();\n  output();\n\n  return 0;\n}\n"}
{"label": "8", "index": "15003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid get_array(int a[]);\nint a[101];\nint main() { get_array(a); }\nvoid get_array(int a[]) \n{\n\n  int n1, n2;\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n1 - 1; i++) \n  {\n    for (int j = 0; j < n1 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  cout << a[0];\n  for (int i = 1; i < n1; i++) {\n    cout << \" \" << a[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n2 - 1; i++) \n  {\n    for (int j = 0; j < n2 - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        int tmp;\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  }\n  for (int i = 0; i < n2; i++) {\n    cout << \" \" << a[i];\n  }\n  return;\n}\n"}
{"label": "8", "index": "15004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[20], b[20], c[40], m, n, i, j, temp;\nint main() {\n  void putin(int a[20], int b[20]);\n  void exchange(int a[20], int b[20]);\n  void together(int a[20], int b[20]);\n  void putout(int c[40]);\n  putin(a, b);\n  exchange(a, b);\n  together(a, b);\n  putout(c);\n}\nvoid putin(int a[20], int b[20]) {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid exchange(int a[20], int b[20]) {\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n}\nvoid together(int a[20], int b[20]) {\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = 0; i < n; i++)\n    c[m + i] = b[i];\n}\nvoid putout(int c[40]) {\n  for (i = 0; i < m + n; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m + n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "15005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint getin(int array[], int num);\nint sort(int array[], int num);\nint link(int array1[], int array2[], int num1, int num2);\nint main() {\n  int numa, numb, a[1000], b[1000];\n  scanf(\"%d %d \", &numa, &numb);\n  getin(a, numa);\n  getin(b, numb);\n  sort(a, numa);\n  sort(b, numb);\n  link(a, b, numa, numb);\n  return 0;\n}\nint getin(int array[], int num) {\n  for (int i = 0; i < num; i++)\n    cin >> array[i];\n\n  return (array[num]);\n}\nint sort(int array[], int num) {\n  int temp;\n  for (int i = 0; i < num - 1; i++) {\n    for (int j = 0; j < num - i - 1; j++) {\n      if (array[j] > array[j + 1]) {\n        temp = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = temp;\n      }\n    }\n  }\n  return array[num];\n}\nint link(int array1[], int array2[], int num1, int num2) {\n  cout << array1[0];\n  for (int i = 1; i < num1; i++)\n    cout << \" \" << array1[i];\n  for (int i = 0; i < num2; i++)\n    cout << \" \" << array2[i];\n  return 0;\n}\n"}
{"label": "8", "index": "15006", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100];\nint n_a, n_b;\nvoid input();\nvoid sort();\nvoid output();\nint main() {\n  input();\n  sort();\n  output();\n  return 0;\n}\nvoid input() {\n  int i;\n  cin >> n_a >> n_b;\n  for (i = 0; i < n_a; i++)\n    cin >> a[i];\n  for (i = 0; i < n_b; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j, t;\n  for (i = 0; i < n_a - 1; i++) {\n    for (j = i + 1; j < n_a; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n_b - 1; i++) {\n    for (j = i + 1; j < n_b; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < n_a; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n_b; i++) {\n    cout << b[i];\n    if (i < n_b - 1)\n      cout << \" \";\n  }\n}\n"}
{"label": "8", "index": "15007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n1, n2, a1[10000], a2[10000], a3[20000];\n\nvoid input(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++) {\n    cin >> a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    cin >> a2[i];\n  }\n}\n\nvoid sort(void) {\n  for (int i = 0; i < n1 - 1; i++) {\n    for (int j = 0; j < n1 - i - 1; j++) {\n      if (a1[j] > a1[j + 1]) {\n        int temp = a1[j + 1];\n        a1[j + 1] = a1[j];\n        a1[j] = temp;\n      }\n    }\n  }\n\n  for (int i = 0; i < n2 - 1; i++) {\n    for (int j = 0; j < n2 - i - 1; j++) {\n      if (a2[j] > a2[j + 1]) {\n        int temp = a2[j + 1];\n        a2[j + 1] = a2[j];\n        a2[j] = temp;\n      }\n    }\n  }\n}\n\nvoid joint(void) {\n  for (int i = 0; i < n1; i++) {\n    a3[i] = a1[i];\n  }\n  for (int i = 0; i < n2; i++) {\n    a3[n1 + i] = a2[i];\n  }\n}\n\nvoid display(void) {\n  printf(\"%d\", a3[0]);\n  for (int i = 1; i < n1 + n2; i++) {\n    cout << \" \" << a3[i];\n  }\n  cout << endl;\n}\n\nint main() {\n  input();\n  sort();\n  joint();\n  display();\n  return 0;\n}\n"}
{"label": "8", "index": "15008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid order(int a[], int n) {\n  int i = 0, j = 0;\n  int t;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\nvoid print(int a[], int n, int b[], int m) {\n  int i = 0, j = 0;\n  while (i < n) {\n    printf(\"%d \", a[i]);\n    i++;\n  }\n  while (j < m - 1) {\n    cout << b[j] << \" \";\n    j++;\n  }\n  cout << b[m - 1];\n}\nint main() {\n  void order(int a[], int n);\n  void print(int a[], int n, int b[], int m);\n  int x[20], y[20];\n  int n, m, i = 0, j = 0;\n  scanf(\"%d%d\", &n, &m);\n  while (i < n) {\n    cin >> x[i];\n    i++;\n  }\n  while (j < m) {\n    scanf(\"%d\", &y[j]);\n    j++;\n  }\n  order(x, n);\n  order(y, m);\n  print(x, n, y, m);\n}\n"}
{"label": "8", "index": "15009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100], b[100], c[200], n1, n2;\nint shuru(void) {\n  cin >> n1 >> n2;\n  for (int i = 0; i < n1; i++)\n    cin >> a[i];\n  for (int i = 0; i < n2; i++)\n    cin >> b[i];\n}\nint pai() {\n  int m;\n  for (int j = 0; j < n1 - 1; j++)\n    for (int i = 0; i < n1 - 1; i++)\n      if (a[i] > a[i + 1]) {\n        m = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = m;\n      }\n  for (int j = 0; j < n2 - 1; j++)\n    for (int i = 0; i < n2 - 1; i++)\n      if (b[i] > b[i + 1]) {\n        m = b[i + 1];\n        b[i + 1] = b[i];\n        b[i] = m;\n      }\n}\nint jie() {\n  for (int i = 0; i < n1; i++)\n    c[i] = a[i];\n  for (int i = 0; i < n2; i++)\n    c[n1 + i] = b[i];\n}\nint shuchu() {\n  printf(\"%d\", c[0]);\n  for (int i = 1; i < n1 + n2; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  shuru();\n  pai();\n  jie();\n  shuchu();\n  return 0;\n}\n"}
{"label": "8", "index": "15010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1 = 0, n2 = 0, i = 0, j = 0, temp = 0;\n  cin >> n1 >> n2;\n  int a1[100] = {0}, a2[100] = {0}, c[200] = {0};\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (i = 0; i < n2; i++)\n    cin >> a2[i];\n  for (i = 0; i < n1 - 1; i++) {\n    for (j = 0; j < n1 - 1 - i; j++) {\n      if (a1[j] > a1[j + 1]) {\n        temp = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2 - 1; i++) {\n    for (j = 0; j < n2 - 1 - i; j++) {\n      if (a2[j] > a2[j + 1]) {\n        temp = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    c[i] = a1[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = a2[i - n1];\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "15011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid scan(int n[], int a[], int b[]) {\n  int i;\n  scanf(\"%d%d\", &n[0], &n[1]);\n\n  for (i = 0; i < n[0]; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n[1]; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid sort(int a[], int b[], int m, int n) {\n  int i, j, t;\n\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m - i; j++)\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n}\n\nvoid com(int a[], int b[], int ab[], int m, int n) {\n  int i;\n\n  for (i = 0; i < m; i++)\n    ab[i] = a[i];\n\n  for (i = 0; i < n; i++)\n    ab[m + i] = b[i];\n}\n\nvoid prt(int ab[], int m, int n) {\n  int i;\n  for (i = 0; i < m + n - 1; i++)\n    printf(\"%d \", ab[i]);\n\n  printf(\"%d\", ab[m + n - 1]);\n}\n\nint main() {\n  int a[101], b[101], n[2], ab[202];\n\n  scan(n, a, b);\n  sort(a, b, n[0], n[1]);\n  com(a, b, ab, n[0], n[1]);\n  prt(ab, n[0], n[1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "15012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid duqu();\nvoid paixu();\nvoid hebin();\nvoid xianshi();\nint a[100], b[100], c[200];\nint m, n;\nint main() {\n  duqu();\n  paixu();\n  hebin();\n  xianshi();\n  return 0;\n}\nvoid duqu() {\n\n  scanf(\"%d %d \", &m, &n);\n  for (int i = 0; i < m; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++)\n    cin >> b[i];\n}\nvoid paixu() {\n  int i = 0, j = 0, t;\n  for (i = 0; i < m; i++) {\n    for (j = i + 1; j < m; j++) {\n      if (a[i] > a[j]) {\n        t = a[i];\n        a[i] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i] > b[j]) {\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n}\nvoid hebin() {\n\n  for (int i = 0; i < m; i++)\n    c[i] = a[i];\n  for (int i = m; i < n + m; i++)\n    c[i] = b[i - m];\n}\nvoid xianshi() {\n  for (int i = 0; i < m + n - 1; i++)\n    printf(\"%d \", c[i]);\n  cout << c[m + n - 1];\n}\n"}
{"label": "8", "index": "15013", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nvoid Do(int m, int n) {\n  int a[m], b[n];\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  qsort(a, m, 4, compare);\n  qsort(b, n, 4, compare);\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d \", b[n - 1]);\n}\nint main() {\n  int m, n;\n  cin >> m >> n;\n  Do(m, n);\n  return 0;\n}\n"}
{"label": "8", "index": "15014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[20], b[20];\nvoid len() {\n  int i;\n  scanf(\"%d %d\", &m, &n);\n\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid change() {\n  int i, j, middle;\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        middle = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = middle;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] > b[j + 1]) {\n        middle = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = middle;\n      }\n    }\n  }\n}\nvoid prin() {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n  for (i = m; i < m + n - 1; i++)\n    printf(\"%d \", b[i - m]);\n  if (i = m + n - 1)\n    printf(\"%d\", b[n - 1]);\n}\nint main() {\n  len();\n  change();\n  prin();\n  return 0;\n}\n"}
{"label": "8", "index": "15015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][2];\nint n[2], i, j, k, t;\nint order(int j) {\n  for (i = 1; i < n[j]; i++)\n    for (k = i + 1; k <= n[j]; k++) {\n      if (a[i][j] > a[k][j]) {\n        a[i][j] = a[i][j] ^ a[k][j];\n        a[k][j] = a[i][j] ^ a[k][j];\n        a[i][j] = a[i][j] ^ a[k][j];\n      }\n    }\n}\nint main() {\n  cin >> n[0] >> n[1];\n  for (i = 1; i <= n[0]; i++)\n    cin >> a[i][0];\n  for (i = 1; i <= n[1]; i++)\n    cin >> a[i][1];\n  order(0);\n  order(1);\n  for (i = 1; i <= n[0]; i++)\n    cout << a[i][0] << ' ';\n  for (i = 1; i < n[1]; i++)\n    cout << a[i][1] << ' ';\n  printf(\"%d\\n\", a[n[1]][1]);\n\n  return 0;\n}\n"}
{"label": "8", "index": "15016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n;\nstatic char a[100], b[100];\nint i, j, temp;\nvoid get() {\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order() {\n  for (i = m - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (a[j] > a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = 0; j < i; j++)\n      if (b[j] > b[j + 1]) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n}\nvoid com() {\n  for (i = 0; i < n; i++)\n    a[m + i] = b[i];\n}\nvoid print() {\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n + m; i++)\n    printf(\" %d\", a[i]);\n}\nint main() {\n  get();\n  order();\n  com();\n  print();\n}\n"}
{"label": "8", "index": "15017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid changeplace(int n, int a[]) {\n  int i, j, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (a[j] >= a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n      }\n    }\n  }\n}\nint main() {\n  int n1, n2, k;\n  scanf(\"%d%d\", &n1, &n2);\n  int *p = (int *)malloc(n1 * sizeof(int));\n  int *q = (int *)malloc(n2 * sizeof(int));\n  for (k = 0; k < n1; k++)\n    scanf(\"%d\", &p[k]);\n  for (k = 0; k < n2; k++)\n    scanf(\"%d\", &q[k]);\n  changeplace(n1, p);\n  changeplace(n2, q);\n  for (k = 0; k < n1; k++)\n    printf(\"%d \", p[k]);\n  for (k = 0; k < n2 - 1; k++)\n    cout << q[k] << \" \";\n  printf(\"%d\", q[n2 - 1]);\n  return 0;\n}\n"}
{"label": "8", "index": "15018", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1 = 0, n2 = 0, i = 0, j = 0, temp = 0;\n  cin >> n1 >> n2;\n  int a1[100] = {0}, a2[100] = {0}, c[200] = {0};\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (i = 0; i < n2; i++)\n    scanf(\"%d \", &a2[i]);\n  for (i = 0; i < n1 - 1; i++) {\n    for (j = 0; j < n1 - 1 - i; j++) {\n      if (a1[j] > a1[j + 1]) {\n        temp = a1[j];\n        a1[j] = a1[j + 1];\n        a1[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n2 - 1; i++) {\n    for (j = 0; j < n2 - 1 - i; j++) {\n      if (a2[j] > a2[j + 1]) {\n        temp = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n1; i++)\n    c[i] = a1[i];\n  for (i = n1; i < n1 + n2; i++)\n    c[i] = a2[i - n1];\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[n1 + n2 - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "15019", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, n, a[100], b[100], c[200];\n\nvoid enter(int array0[], int p) {\n  int i;\n  for (i = 0; i < p; i++)\n    scanf(\"%d\", &array0[i]);\n}\n\nvoid sort(int array[], int p1) {\n  int i, j, k;\n  for (i = 0; i < p1 - 1; i++)\n    for (j = 0; j < p1 - 1 - i; j++)\n      if (array[j] > array[j + 1]) {\n        k = array[j];\n        array[j] = array[j + 1];\n        array[j + 1] = k;\n      }\n}\n\nvoid paste(int array1[], int array2[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = array1[i];\n  for (i = m; i < m + n; i++)\n    c[i] = array2[i - m];\n}\n\nvoid out(int array3[], int p2) {\n  int i;\n  printf(\"%d\", array3[0]);\n  for (i = 1; i < p2; i++)\n    printf(\" %d\", array3[i]);\n}\n\nint main() {\n  scanf(\"%d %d\", &m, &n);\n  enter(a, m);\n  enter(b, n);\n  sort(a, m);\n  sort(b, n);\n  paste(a, b);\n  out(c, m + n);\n}\n"}
{"label": "8", "index": "15020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid ipt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    if (i != n)\n      scanf(\" \");\n    i++;\n  }\n}\n\nvoid opt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n    i++;\n  }\n}\n\nint main() {\n  int n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  ipt(a, n);\n  ipt(b, m);\n  sort(a, n);\n  sort(b, m);\n  opt(a, n);\n  printf(\" \");\n  opt(b, m);\n}\n"}
{"label": "8", "index": "15021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[5000], b[5000], N1, N2, c[10000];\nint f1() {\n  int n;\n  scanf(\"%d%d\", &N1, &N2);\n  for (n = 0; n <= N1 - 1; n++) {\n    scanf(\"%d\", &a[n]);\n  }\n  for (n = 0; n <= N2 - 1; n++) {\n    scanf(\"%d\", &b[n]);\n  }\n  return 0;\n}\nint f2() {\n  int i, j, t;\n  for (i = 1; i <= N1 - 1; i++) {\n    for (j = 0; j <= N1 - i - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = 1; i <= N2 - 1; i++) {\n    for (j = 0; j <= N2 - i - 1; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  return 0;\n}\nint f3() {\n  int i, j;\n  for (i = 0; i <= N1 - 1; i++) {\n    c[i] = a[i];\n  }\n  for (i = N1, j = 0; i <= N1 + N2 - 1; i++, j++) {\n    c[i] = b[j];\n  }\n  return 0;\n}\nint f4() {\n  int i;\n  cout << c[0];\n  for (i = 1; i <= N1 + N2 - 1; i++) {\n    printf(\" %d\", c[i]);\n  }\n  return 0;\n}\nint main() {\n  f1();\n  f2();\n  f3();\n  f4();\n  return 0;\n}\n"}
{"label": "8", "index": "15022", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint read(int a[200], int b[100]) {\n  int m, n, i;\n  scanf(\"%d %d\", &m, &n);\n  a[0] = m;\n  b[0] = n;\n  for (i = 1; i <= m; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    scanf(\" %d\", &b[i]);\n  return 0;\n}\nint seq(int a[200]) {\n  int i, j, t, m = a[0];\n  for (j = 1; j <= m - 1; j++)\n    for (i = 1; i <= m - j; i++)\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n  return 0;\n}\nint toge(int a[200], int b[100]) {\n  int i;\n  int m = a[0];\n  int n = b[0];\n  a[0] = a[0] + b[0];\n  for (i = m + 1; i <= m + n; i++)\n    a[i] = b[i - m];\n  return 0;\n}\nint see(int a[200]) {\n  int i;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= a[0]; i++)\n    printf(\" %d\", a[i]);\n  return 0;\n}\nint main() {\n  int a[200], b[100];\n  read(a, b);\n  seq(a);\n  seq(b);\n  toge(a, b);\n  see(a);\n  return 0;\n}\n"}
{"label": "8", "index": "15023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, n1, n2, a1[100], a2[100];\nvoid scan() {\n  cin >> n1 >> n2;\n  for (i = 0; i < n1; i++)\n    cin >> a1[i];\n  for (j = 0; j < n2; j++)\n    cin >> a2[j];\n}\nvoid adjust() {\n  int p;\n  for (i = 0; i < n1; i++) {\n    for (j = i + 1; j < n1; j++) {\n      if (a1[i] > a1[j]) {\n        p = a1[i];\n        a1[i] = a1[j];\n        a1[j] = p;\n      }\n    }\n  }\n  for (i = 0; i < n2; i++) {\n    for (j = i + 1; j < n2; j++) {\n      if (a2[i] > a2[j]) {\n        p = a2[i];\n        a2[i] = a2[j];\n        a2[j] = p;\n      }\n    }\n  }\n}\nvoid combine() {\n  for (i = n1; i < n1 + n2; i++) {\n    a1[i] = a2[i - n1];\n  }\n}\nvoid print() {\n  for (i = 0; i < n1 + n2 - 1; i++)\n    cout << a1[i] << \" \";\n  cout << a1[n1 + n2 - 1] << endl;\n}\nint main() {\n  scan();\n  adjust();\n  combine();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "15024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100], b[100], c[100], m, n;\nvoid input() {\n  int i;\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n}\nvoid az() {\n  int i, j, t;\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid jch() {\n  int j;\n  for (j = 0; j < m; j++) {\n    c[j] = a[j];\n  }\n  for (j = m; j < m + n; j++) {\n    c[j] = b[j - m];\n  }\n}\nvoid output() {\n  int i;\n  for (i = 0; i < m + n - 1; i++) {\n    cout << c[i] << \" \";\n  }\n  printf(\"%d\", c[m + n - 1]);\n}\nint main() {\n  input();\n  az();\n  jch();\n  output();\n}\n"}
{"label": "8", "index": "15025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m;\nint a[100], b[100], c[200];\nvoid in() {\n  cin >> n >> m;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++)\n    cin >> b[i];\n}\nvoid pai(int *p, int k) {\n  int i, j, temp;\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++) {\n      if (p[j] > p[j + 1]) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n    }\n}\nvoid he() {\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = 0; i < m; i++)\n    c[i + n] = b[i];\n}\nvoid out() {\n  int i;\n  cout << c[0];\n  for (i = 1; i < n + m; i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  in();\n  pai(a, n);\n  pai(b, m);\n  he();\n  out();\n  return 0;\n}\n"}
{"label": "8", "index": "15026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], b[1000], al, bl;\n\nvoid input() {\n  int i;\n  scanf(\"%d %d \", &al, &bl);\n  for (i = 0; i < al; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < bl; i++)\n    scanf(\"%d\", &b[i]);\n}\n\nvoid Qsort(int start, int length, int a[]) {\n  int x = a[start];\n  int i, j;\n  i = start;\n  j = length - 1;\n  while (i < j) {\n    if (x < a[j])\n      j--;\n    else if (x > a[j]) {\n      a[i] = a[j];\n      a[j] = x;\n      i++;\n    } else if (x < a[i]) {\n      a[j] = a[i];\n      a[i] = x;\n      j--;\n    } else\n      i++;\n  }\n  if (start < length - 1) {\n    Qsort(start, i, a);\n    Qsort(i + 1, length, a);\n  }\n}\n\nvoid sort() {\n  Qsort(0, al, a);\n  Qsort(0, bl, b);\n}\n\nvoid combine() {\n  int i;\n  for (i = 0; i < bl; i++)\n    a[i + al] = b[i];\n}\n\nvoid output() {\n  int i;\n  for (i = 0; i < bl + al - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\n\nint main() {\n  input();\n  sort();\n  combine();\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "15027", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s(int m);\nint p(int m, int i, int a[100]);\nvoid e(int i, int c[100], int d[100], int m, int n);\nint main() {\n  int i, m, n, a[100], b[100], c[100], d[100];\n  scanf(\"%d%d\", &m, &n);\n  for (i = 0; i < m; i++)\n    a[i] = s(i);\n  for (i = 0; i < n; i++)\n    b[i] = s(i);\n  for (i = 0; i < m; i++)\n    c[i] = p(m, i, a);\n  for (i = 0; i < n; i++)\n    d[i] = p(n, i, b);\n  for (i = 0; i < m + n; i++)\n    e(i, c, d, m, n);\n  return 0;\n}\nint s(int m) {\n  int a[100];\n  cin >> a[m];\n  return a[m];\n}\nint p(int m, int i, int a[100]) {\n  int p, q, n;\n  for (p = 0; p < m; p++) {\n    for (q = 0; q < m - 1; q++) {\n      if (a[q] > a[q + 1]) {\n        n = a[q];\n        a[q] = a[q + 1];\n        a[q + 1] = n;\n      }\n    }\n  }\n  return a[i];\n}\nvoid e(int i, int c[100], int d[100], int m, int n) {\n  if (i == 0)\n    printf(\"%d\", c[0]);\n  if (i > 0 && i < m)\n    printf(\" %d\", c[i]);\n  if (i >= m)\n    printf(\" %d\", d[i - m]);\n}\n"}
{"label": "8", "index": "15028", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[10000], b[10000];\nint A, B;\nvoid read() \n{\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    cin >> a[i];\n  for (i = 0; i < B; i++)\n    cin >> b[i];\n}\nvoid sort() \n{\n  int i, j, temp;\n  for (i = 0; i < A - 1; i++)\n    for (j = i + 1; j < A; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < B - 1; i++)\n    for (j = i + 1; j < B; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n}\nvoid conbine() \n{\n  int i;\n  for (i = 0; i < A; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < B - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[B - 1];\n}\n\nint main() {\n  read(); \n  sort();\n  conbine();\n  return 0;\n}\n"}
{"label": "8", "index": "15029", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid read(int *a, int *b, int num1, int num2);\nvoid sort(int *a, int num1);\nvoid merge(int *a, int *b, int *c, int num1, int num2);\nvoid print(int *a, int num1);\nint main() {\n  int a[100], b[100], c[200];\n  int num1, num2;\n  cin >> num1 >> num2;\n  read(a, b, num1, num2);\n  sort(a, num1);\n  sort(b, num2);\n  merge(a, b, c, num1, num2);\n  print(c, num1 + num2);\n  return 0;\n}\n\nvoid read(int *a, int *b, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < num2; i++) {\n    cin >> b[i];\n  }\n}\n\nvoid sort(int *a, int num1) {\n  int i, j;\n  for (i = 0; i < num1; i++) {\n    for (j = i + 1; j < num1; j++) {\n      if (a[i] > a[j]) {\n        int temp;\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *a, int *b, int *c, int num1, int num2) {\n  int i;\n  for (i = 0; i < num1; i++) {\n    c[i] = a[i];\n  }\n  for (i = num1; i < num1 + num2; i++) {\n    c[i] = b[i - num1];\n  }\n}\n\nvoid print(int *a, int num1) {\n  int i;\n  for (i = 0; i < num1 - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[num1 - 1] << endl;\n}\n"}
{"label": "8", "index": "15030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, m, N[100], M[100];\nvoid scan() {\n  int i;\n  scanf(\"%d %d\", &n, &m);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &N[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &M[i]);\n}\nvoid sort(int q, int a[]) {\n  int i, j, k, t;\n  for (i = 0; i < q - 1; i++) {\n    k = i;\n    for (j = i + 1; j < q; j++)\n      if (a[j] < a[k])\n        k = j;\n    if (k != i) {\n      t = a[i];\n      a[i] = a[k];\n      a[k] = t;\n    }\n  }\n}\nvoid print() {\n  int i;\n  printf(\"%d\", N[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", N[i]);\n  for (i = 0; i < m; i++)\n    cout << \" \" << M[i];\n  printf(\"\\n\");\n}\nint main() {\n  scan();\n  sort(n, N);\n  sort(m, M);\n  print();\n}\n"}
{"label": "8", "index": "15031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint la, lb;\nint a[100] = {0}, b[100] = {0};\nvoid get() {\n  for (int i = 0; i < la; i++)\n    cin >> a[i];\n  for (int i = 0; i < lb; i++)\n    cin >> b[i];\n}\nvoid sort() {\n  int i, j;\n  int p = a[0];\n  for (i = 0; i < la - 1; i++)\n    for (j = 0; j <= la - i - 2; j++) {\n      if (a[j] > a[j + 1]) {\n        p = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = p;\n      }\n    }\n  p = b[0];\n  for (i = 0; i < lb - 1; i++)\n    for (j = 0; j <= lb - i - 2; j++) {\n      if (b[j] > b[j + 1]) {\n        p = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = p;\n      }\n    }\n}\nvoid link() {\n  int i;\n  for (i = la; i <= la + lb - 1; i++)\n    a[i] = b[i - la];\n}\nvoid print() {\n  int i;\n  for (i = 0; i < la + lb - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[la + lb - 1]);\n}\nint main() {\n  scanf(\"%d %d \", &la, &lb);\n  get();\n  sort();\n  link();\n  print();\n  return 0;\n}\n"}
{"label": "8", "index": "15032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid input(int a[], int b[]) {\n  int i, m, n;\n  scanf(\"%d %d \", &a[49], &b[49]);\n  m = a[49];\n  n = b[49];\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid order(int m, int n, int a[], int b[]) {\n  int i, j, t;\n  for (j = 0; j < m - 1; j++) {\n    for (i = 0; i < m - 1 - j; i++) {\n      if (a[i] > a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (b[i] > b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  }\n}\nvoid comb(int m, int n, int a[], int b[], int c[]) {\n  int i;\n  for (i = 0; i < m; i++)\n    c[i] = a[i];\n  for (i = m; i < (m + n); i++)\n    c[i] = b[i - m];\n}\nvoid print(int m, int n, int c[]) {\n  int i;\n  printf(\"%d\", c[0]);\n  for (i = 1; i < (m + n); i++)\n    cout << \" \" << c[i];\n}\nint main() {\n  int a[50], b[50], c[100];\n  input(a, b);\n  order(a[49], b[49], a, b);\n  comb(a[49], b[49], a, b, c);\n  print(a[49], b[49], c);\n}\n"}
{"label": "8", "index": "15033", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a, b;\nint a1[20], b1[20], c[40];\nvoid input(void) {\n  scanf(\"%d %d \", &a, &b);\n  for (int i = 0; i < a; i++)\n    cin >> a1[i];\n  for (int j = 0; j < b; j++)\n    cin >> b1[j];\n}\nvoid select_sort(int array[], int n) {\n  int i, j, k, t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (array[j] < array[k])\n        k = j;\n    t = array[k];\n    array[k] = array[i];\n    array[i] = t;\n  }\n}\n\nvoid combine(int array1[], int array2[]) {\n  for (int i = 0; i < a; i++)\n    c[i] = array1[i];\n  for (int j = 0; j < b; j++)\n    c[j + a] = array2[j];\n}\nvoid output(void) {\n  for (int i = 0; i < a + b - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[a + b - 1] << endl;\n}\nint main() {\n  input();\n  select_sort(a1, a);\n  select_sort(b1, b);\n  combine(a1, b1);\n  output();\n  return 0;\n}\n"}
{"label": "8", "index": "15034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num[2];\nint a[100], b[100], c[100];\nvoid getarray(int a[], int b[], int num[]) {\n  scanf(\"%d %d \", &num[0], &num[1]);\n  for (int i = 0; i < num[0]; i++)\n    cin >> a[i];\n  for (int i = 0; i < num[1]; i++)\n    scanf(\"%d \", &b[i]);\n}\nvoid sort(int a[], int b[], int af, int bf) {\n  int temp;\n  for (int i = 0; i < af - 1; i++) {\n    for (int j = 1; j < af - i; j++) {\n      if (a[j] < a[j - 1]) {\n        temp = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = temp;\n      }\n    }\n  }\n  for (int i = 0; i < bf - 1; i++) {\n    for (int j = 1; j < bf - i; j++) {\n      if (b[j] < b[j - 1]) {\n        temp = b[j];\n        b[j] = b[j - 1];\n        b[j - 1] = temp;\n      }\n    }\n  }\n}\nvoid combine(int a[], int b[], int c[], int af, int bf) {\n  for (int i = 0; i < af; i++)\n    c[i] = a[i];\n  for (int i = af; i < af + bf; i++)\n    c[i] = b[i - af];\n}\nvoid print(int c[], int af, int bf) {\n  cout << c[0];\n  for (int i = 1; i < af + bf; i++)\n    cout << ' ' << c[i];\n}\nint main() {\n  getarray(a, b, num);\n  sort(a, b, num[0], num[1]);\n  combine(a, b, c, num[0], num[1]);\n  print(c, num[0], num[1]);\n}\n"}
{"label": "8", "index": "15035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pai1(int x[1000], int y);\nint pai2(int x[1000], int y);\nint main() {\n  int n, m, i, j;\n  int a[1000], b[1000];\n  scanf(\"%d %d\\n\", &n, &m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\\n\", &a[i]);\n  }\n\n  for (j = 0; j < m; j++) {\n    scanf(\"%d\", &b[j]);\n  }\n  pai1(a, n);\n  pai2(b, m);\n}\n\nint pai1(int x[], int y) {\n  int i, j, min, stmp, flag = 0;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++) {\n    if (flag == 0) {\n      printf(\"%d\", x[i]);\n      flag = 1;\n      continue;\n    }\n    if (flag == 1) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  return 0;\n}\nint pai2(int x[], int y) {\n  int i, j, min, stmp;\n\n  for (i = 0; i < y; i++) {\n    min = x[i];\n    for (j = i + 1; j < y; j++)\n      if (min > x[j]) {\n        min = x[j];\n        stmp = x[i];\n        x[i] = x[j];\n        x[j] = stmp;\n      }\n  }\n  for (i = 0; i < y; i++)\n    printf(\" %d\", x[i]);\n  return 0;\n}\n"}
{"label": "8", "index": "15036", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint N1, N2, N3;\nint *p1 = (int *)malloc(100 * sizeof(int));\nint *p2 = (int *)malloc(100 * sizeof(int));\nint *p3 = (int *)malloc(100 * sizeof(int));\n\nvoid inputnumbers() {\n\n  scanf(\"%d %d\\n\", &N1, &N2);\n  scanf(\"%d\", p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    scanf(\" %d\", p1 + i);\n  }\n  scanf(\"\\n%d\", p2);\n  for (int i = 1; i <= N2 - 1; i++) {\n    scanf(\" %d\", p2 + i);\n  }\n}\n\nvoid seperatesort() {\n  for (int i = 1; i <= N1 - 1; i++) {\n    for (int j = i + 1; j <= N1; j++) {\n      if (*(p1 + i - 1) > *(p1 + j - 1)) {\n        int temp = *(p1 + i - 1);\n        *(p1 + i - 1) = *(p1 + j - 1);\n        *(p1 + j - 1) = temp;\n      }\n    }\n  }\n  for (int i = 1; i <= N2 - 1; i++) {\n    for (int j = i + 1; j <= N2; j++) {\n      if (*(p2 + i - 1) > *(p2 + j - 1)) {\n        int temp = *(p2 + i - 1);\n        *(p2 + i - 1) = *(p2 + j - 1);\n        *(p2 + j - 1) = temp;\n      }\n    }\n  }\n}\n\nvoid combine() {\n  N3 = N1 + N2;\n  for (int i = 0; i <= N1 - 1; i++) {\n    *(p3 + i) = *(p1 + i);\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    *(p3 + N1 + i) = *(p2 + i);\n  }\n}\n\nvoid printresult2() {\n  printf(\"%d\", *p3);\n  for (int i = 1; i <= N3 - 1; i++) {\n    printf(\" %d\", *(p3 + i));\n  }\n}\nvoid printresult1() {\n  printf(\"%d\", *p1);\n  for (int i = 1; i <= N1 - 1; i++) {\n    printf(\" %d\", *(p1 + i));\n  }\n  for (int i = 0; i <= N2 - 1; i++) {\n    printf(\" %d\", *(p2 + i));\n  }\n}\n\nint main() {\n  inputnumbers();\n  seperatesort();\n  combine();\n  printresult2();\n}\n"}
{"label": "8", "index": "15037", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid mysort(int *pn, int n) {\n  int i, j;\n  int temp;\n  for (j = 0; j < n; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (pn[j] > pn[i]) {\n        temp = pn[j];\n        pn[j] = pn[i];\n        pn[i] = temp;\n      }\n    }\n  }\n}\n\nvoid merge(int *pn, int n, int *pm, int m) {\n  int i;\n  printf(\"%d\", pn[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %d\", pn[i]);\n\n  for (i = 0; i < m; i++) {\n    printf(\" %d\", pm[i]);\n  }\n}\nint main(int argc, char *argv[]) {\n  int m, n, i, *pm, *pn;\n  scanf(\"%d%d\", &m, &n);\n  pm = (int *)calloc(m, sizeof(int));\n  pn = (int *)calloc(n, sizeof(int));\n\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &(pm[i]));\n  }\n  for (i = 0; i < n; i++) {\n    cin >> (pn[i]);\n  }\n\n  mysort(pm, m);\n  mysort(pn, n);\n  merge(pm, m, pn, n);\n\n  free(pm);\n  free(pn);\n  return 0;\n}\n"}
{"label": "8", "index": "15038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void read(int a[100], int b[100], int m, int n);\n  void bubble(int a[100], int m);\n  void print(int a[100], int b[100], int m, int n);\n  int m, n, a[100], b[100];\n  scanf(\"%d%d\", &m, &n);\n  read(a, b, m, n);\n  bubble(a, m);\n  bubble(b, n);\n  print(a, b, m, n);\n  return 0;\n}\n\nvoid read(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n}\nvoid bubble(int a[100], int m) {\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - 1; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid print(int a[100], int b[100], int m, int n) {\n  int i;\n  for (i = 0; i < m; i++)\n    printf(\"%d \", a[i]);\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "8", "index": "15039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void maopao(int c[], int l);\n  int c1[100], c2[100], l1, l2;\n  int i, n1, n2;\n  scanf(\"%d%d\", &n1, &n2);\n  for (i = 0; i < n1; i++) {\n    scanf(\"%d\", &c1[i]);\n    l1 = i + 1;\n  }\n  for (i = 0; i < n2; i++) {\n    scanf(\"%d\", &c2[i]);\n    l2 = i + 1;\n  }\n  maopao(c1, l1);\n  printf(\" \");\n  maopao(c2, l2);\n  return 0;\n}\n\nvoid maopao(int c[], int l) {\n  int i, j, t;\n\n  for (j = 1; j < l; j++)\n    for (i = 0; i < l - j; i++)\n      if (c[i] > c[i + 1]) {\n        t = c[i + 1];\n        c[i + 1] = c[i];\n        c[i] = t;\n      }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < l; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "15040", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  void shuru(int *p, int len);\n  void paixu(int *p, int len);\n  void hebing(int *p1, int *p2);\n  void shuchu(int *p, int, int);\n  int m, n;\n  scanf(\"%d%d\", &m, &n);\n  int *p1, *p2;\n  int a[200] = {'\\0'}, b[100] = {'\\0'};\n  p1 = a;\n  p2 = b;\n  shuru(p1, m);\n  shuru(p2, n);\n  paixu(p1, m);\n  paixu(p2, n);\n  hebing(p1, p2);\n  shuchu(p1, m, n);\n  return 0;\n}\n\nvoid shuru(int *p, int len) {\n  int i;\n  for (i = 0; i < len; i++)\n    scanf(\"%d\", p + i);\n}\n\nvoid paixu(int *p, int len) {\n  int i, j, temp;\n  for (i = 0; i < len - 1; i++)\n    for (j = i + 1; j < len; j++)\n      if (*(p + i) > *(p + j)) {\n        temp = *(p + i);\n        *(p + i) = *(p + j);\n        *(p + j) = temp;\n      }\n}\n\nvoid hebing(int *p1, int *p2) {\n  int i, j, flag;\n  for (i = 0;; i++) {\n    flag = 0;\n    if (*(p1 + i) == '\\0') {\n      for (j = 0; *(p2 + j) != '\\0'; j++)\n        *(p1 + i + j) = *(p2 + j);\n      *(p1 + i + j) = '\\0';\n      flag = 1;\n    }\n    if (flag == 1)\n      break;\n  }\n}\n\nvoid shuchu(int *p, int m, int n) {\n  int i;\n  char c;\n  for (i = 0; *(p + i) != '\\0'; i++)\n    printf(\"%d%c\", *(p + i), c = (i < n + m - 1) ? ' ' : '\\n');\n}\n"}
{"label": "8", "index": "15041", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid sort(int a[], int n) {\n  int i, j, t;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n\nvoid ipt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    cin >> a[i];\n    if (i != n)\n      scanf(\" \");\n    i++;\n  }\n}\n\nvoid opt(int a[], int n) {\n  int i = 1;\n  while (i <= n) {\n    printf(\"%d\", a[i]);\n    if (i != n)\n      printf(\" \");\n    i++;\n  }\n}\n\nint main() {\n  int n, m, a[100], b[100];\n  scanf(\"%d%d\", &n, &m);\n  ipt(a, n);\n  ipt(b, m);\n  sort(a, n);\n  sort(b, m);\n  opt(a, n);\n  printf(\" \");\n  opt(b, m);\n}\n"}
{"label": "8", "index": "15042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[], int b[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= m; i++)\n    cin >> b[i];\n}\nvoid f2(int a[], int b[], int n, int m) {\n  int i, j, t;\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  for (i = 1; i < m; i++)\n    for (j = 1; j < m; j++) {\n      if (b[j] > b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n}\nvoid f3(int a[], int b[], int c[], int n, int m) {\n  int i;\n  for (i = 1; i <= n; i++)\n    c[i] = a[i];\n  for (i = 1; i <= m; i++)\n    c[i + n] = b[i];\n}\nvoid f4(int c[], int n, int m) {\n  int i;\n  for (i = 1; i < m + n; i++)\n    cout << c[i] << ' ';\n  printf(\"%d\", c[m + n]);\n}\nint main() {\n  int a[99], b[99], c[200], n, m;\n  cin >> n >> m;\n  f1(a, b, n, m);\n  f2(a, b, n, m);\n  f3(a, b, c, n, m);\n  f4(c, n, m);\n  return 0;\n}\n"}
{"label": "8", "index": "15043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a, b;\nint c[1000], d[1000];\nvoid scan1() {\n  scanf(\"%d %d\", &a, &b);\n  int i;\n  for (i = 0; i < a; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n}\n\nvoid order() {\n  int i, j, k;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        k = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = k;\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < b - 1; j++) {\n      if (d[j] > d[j + 1]) {\n        k = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = k;\n      }\n    }\n  }\n}\nvoid hebing() {\n  int i;\n  for (i = 0; i < b; i++) {\n    c[a + i] = d[i];\n  }\n}\nvoid shuchu() {\n  int i;\n  for (i = 0; i < a + b; i++) {\n    if (i)\n      cout << \" \";\n    printf(\"%d\", c[i]);\n  }\n}\nint main() {\n  scan1();\n  order();\n  hebing();\n  shuchu();\n}\n"}
{"label": "8", "index": "15044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint paixu(int a[], int geshu) {\n  int j = 0, k = 0, t = 0;\n  for (j = 0; j < geshu - 1; j++) {\n    for (k = j + 1; k < geshu; k++) {\n      if (a[k] < a[j]) {\n        t = a[k];\n        a[k] = a[j];\n        a[j] = t;\n      }\n    }\n  }\n}\nint main() {\n  int m = 0, n = 0, i = 0;\n  int a[1000], b[1000];\n  cin >> m >> n;\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n\n  paixu(a, m);\n  paixu(b, n);\n  for (i = 0; i < m; i++) {\n    cout << a[i] << \" \";\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[n - 1];\n  return 0;\n}\n"}
{"label": "8", "index": "15045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid s(int m);\nint main() {\n  int a, b;\n  cin >> a >> b;\n  s(a);\n  printf(\" \");\n  s(b);\n}\nvoid s(int m) {\n  int i, j, c[1000], d;\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &c[i]);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (c[j] > c[j + 1]) {\n        d = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", c[i]);\n    if (i != m - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "15046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid sheng(int *a, int n) {\n  int i, j, b;\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j] < a[i])\n\n      {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n    }\n  }\n}\nint hebing(int *a, int n, int *b, int m, int *c) {\n\n  int i;\n  for (i = 0; i < n; i++)\n    c[i] = a[i];\n  for (i = n; i < m + n; i++)\n    c[i] = b[i - n];\n  return *c;\n}\nint main() {\n  int n, m, i;\n  scanf(\"%d %d\", &n, &m);\n  int *a = (int *)malloc(sizeof(int) * n);\n  int *b = (int *)malloc(sizeof(int) * m);\n  int *c = (int *)malloc(sizeof(int) * (m + n));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &b[i]);\n  sheng(a, n);\n  sheng(b, m);\n  hebing(a, n, b, m, c);\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m + n; i++)\n    printf(\" %d\", c[i]);\n}\n"}
{"label": "8", "index": "15047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[10000], b[10000];\nint A, B;\nvoid read() {\n  int i;\n  cin >> A >> B;\n  for (i = 0; i < A; i++)\n    cin >> a[i];\n  for (i = 0; i < B; i++) {\n    cin >> b[i];\n  }\n}\nvoid sort() {\n  int i, j, temp;\n  for (i = 0; i < A - 1; i++)\n    for (j = i + 1; j < A; j++) {\n      if (a[j] < a[i]) {\n        temp = a[i];\n        a[i] = a[j];\n        a[j] = temp;\n      }\n    }\n  for (i = 0; i < B - 1; i++)\n    for (j = i + 1; j < B; j++) {\n      if (b[j] < b[i]) {\n        temp = b[i];\n        b[i] = b[j];\n        b[j] = temp;\n      }\n    }\n}\nvoid conbine() {\n  int i;\n  for (i = 0; i < A; i++)\n    cout << a[i] << ' ';\n  for (i = 0; i < B - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[B - 1];\n}\n\nint main() {\n  read();\n  sort();\n  conbine();\n  return 0;\n}\n"}
{"label": "8", "index": "15048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint d, e, f, g;\nint a[50], b[50], c[100];\nint get(int a[50], int b[50]);\nint repick(int a[50], int b[50]);\nint hand(int a[50], int b[50], int c[100]);\nint out(int c[100]);\nint main() {\n  get(a, b);\n  repick(a, b);\n  hand(a, b, c);\n  out(c);\n  return 0;\n}\nint get(int a[50], int b[50]) {\n  scanf(\"%d%d\", &f, &g);\n  for (d = 0; d < f; d++)\n    cin >> a[d];\n  for (e = 0; e < g; e++)\n    cin >> b[e];\n  return 0;\n}\nint repick(int a[50], int b[50]) {\n  int h;\n  for (d = 0; d < f; d++)\n    for (e = 0; e < (f - d - 1); e++)\n      if (a[e] > a[e + 1]) {\n        h = a[e + 1];\n        a[e + 1] = a[e];\n        a[e] = h;\n      }\n  for (d = 0; d < g; d++)\n    for (e = 0; e < (g - d - 1); e++)\n      if (b[e] > b[e + 1]) {\n        h = b[e + 1];\n        b[e + 1] = b[e];\n        b[e] = h;\n      }\n  return 0;\n}\nint hand(int a[50], int b[50], int c[100]) {\n  d = 0;\n  while (d < f) {\n    c[d] = a[d];\n    d++;\n  }\n  while (d < (f + g)) {\n    c[d] = b[d - f];\n    d++;\n  }\n  return 0;\n}\nint out(int c[100]) {\n  d = 0;\n  printf(\"%d\", c[d]);\n  d++;\n  while (d < (f + g)) {\n    cout << \" \" << c[d];\n    d++;\n  }\n  return 0;\n}\n"}
{"label": "8", "index": "15049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bubble(int c[], int x);\n  int i, m, n;\n  int a[100], b[100];\n  scanf(\"%d %d\", &m, &n);\n  for (i = 1; i <= m; i++)\n    scanf(\"%d \", &a[i - 1]);\n\n  printf(\"\\n\");\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &b[i - 1]);\n\n  printf(\"\\n\");\n  bubble(a, m);\n  printf(\" \");\n  bubble(b, n);\n  return 0;\n}\n\nint bubble(int c[], int x) {\n  int t, j, temp;\n  for (t = 1; t <= x; t++) {\n    for (j = 1; j <= x - t; j++) {\n      if (c[j - 1] > c[j]) {\n        temp = c[j - 1];\n        c[j - 1] = c[j];\n        c[j] = temp;\n      }\n    }\n  }\n  for (t = 1; t <= x; t++) {\n    printf(\"%d\", c[t - 1]);\n    if (t != x)\n      printf(\" \");\n  }\n}\n"}
{"label": "8", "index": "15050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, a1[100], a2[100];\nint main() {\n  void scan(), rank(), combine(), print();\n  scan();\n  rank();\n  combine();\n  print();\n  return 0;\n}\n\nvoid scan() {\n  int i;\n  scanf(\"%d %d\\n\", &n1, &n2);\n  for (i = 0; i < n1; i++)\n    scanf(\"%d\", &a1[i]);\n  for (i = 0; i < n2; i++)\n    scanf(\"%d\", &a2[i]);\n}\n\nvoid rank() {\n  int i, j, mid;\n  for (j = 0; j < n1 - 1; j++)\n    for (i = 0; i < n1 - 1 - j; i++)\n      if (a1[i] > a1[i + 1]) {\n        mid = a1[i];\n        a1[i] = a1[i + 1];\n        a1[i + 1] = mid;\n      }\n  for (j = 0; j < n2 - 1; j++)\n    for (i = 0; i < n2 - 1 - j; i++)\n      if (a2[i] > a2[i + 1]) {\n        mid = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = mid;\n      }\n}\n\nvoid combine() {\n  int i;\n  for (i = n1; i < n1 + n2; i++)\n    a1[i] = a2[i - n1];\n}\n\nvoid print() {\n  int i;\n  for (i = 0; i < n1 + n2; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%d\", a1[i]);\n  }\n}\n"}
{"label": "9", "index": "15051", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char id[10];\n  int age;\n  struct person *next;\n};\nint main() {\n  int n, i, j;\n  struct person *head, *ppre, *pnew, *p;\n  cin >> n;\n  pnew = (struct person *)malloc(1000);\n  scanf(\"%s %d \", pnew->id, &pnew->age);\n  pnew->next = NULL;\n  head = pnew;\n  for (i = 2; i <= n; i++) {\n    p = head;\n    ppre = head;\n    pnew = (struct person *)malloc(1000);\n    cin >> pnew->id >> pnew->age;\n    pnew->next = NULL;\n    if ((pnew->age >= 60) && (pnew->age > head->age)) {\n      pnew->next = head;\n      head = pnew;\n    } else {\n      if (pnew->age >= 60) {\n        p = p->next;\n        for (j = 2; j < i; j++) {\n          if (pnew->age > p->age) {\n            pnew->next = p;\n            ppre->next = pnew;\n            break;\n          }\n          p = p->next;\n          ppre = ppre->next;\n        }\n        if (pnew->next == NULL)\n          ppre->next = pnew;\n      } else {\n        while (p->next != NULL)\n          p = p->next;\n        p->next = pnew;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int j;\n  struct client {\n    char num[11];\n    int age;\n  };\n  struct client line[100];\n  struct client temp;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &line[i].num, &line[i].age);\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (line[j].age >= 60 && line[j + 1].age >= 60) {\n        if (line[j].age < line[j + 1].age) {\n          temp = line[j];\n          line[j] = line[j + 1];\n          line[j + 1] = temp;\n        }\n      }\n      if (line[j].age < 60 && line[j + 1].age >= 60) {\n        temp = line[j];\n        line[j] = line[j + 1];\n        line[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", line[i].num);\n}\n"}
{"label": "9", "index": "15053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], a[100], k = 0, count = 0, c[100], i, j;\n  char ID[100][100], id[100][100], string[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = age[i];\n      strcpy(id[k], ID[i]);\n      count++;\n      c[k] = k;\n      k++;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] < a[j]) {\n        int t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n        strcpy(string, id[k]);\n        strcpy(id[k], id[j]);\n        strcpy(id[j], string);\n        int p = c[k];\n        c[k] = c[j];\n        c[j] = p;\n      }\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] == a[j]) {\n        if (c[k] > c[j]) {\n          int t = a[j];\n          a[j] = a[k];\n          a[k] = t;\n          strcpy(string, id[k]);\n          strcpy(id[k], id[j]);\n          strcpy(id[j], string);\n          int p = c[k];\n          c[k] = c[j];\n          c[j] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < count; k++)\n    cout << id[k] << \" \";\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", ID[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct sick {\n  char *num;\n  int age;\n  struct sick *next;\n};\nstruct sick *range(int N) {\n  struct sick *pnew, *ppre, *p, *head, *last;\n  pnew = (struct sick *)malloc(1000);\n  pnew->num = (char *)malloc(100 * sizeof(char));\n  pnew->next = NULL;\n  scanf(\"%s %d\", pnew->num, &pnew->age);\n  head = last = pnew;\n  int i;\n  for (i = 2; i <= N; i++) {\n    pnew = (struct sick *)malloc(1000);\n    pnew->num = (char *)malloc(100 * sizeof(char));\n    pnew->next = NULL;\n    scanf(\"%s %d\", pnew->num, &pnew->age);\n    int j;\n    if (pnew->age < 60) {\n      last->next = pnew;\n      last = pnew;\n    } else {\n      if (pnew->age > head->age) {\n        pnew->next = head;\n        head = pnew;\n      } else {\n        ppre = head;\n        p = head->next;\n        for (j = 2; p != NULL; j++) {\n          if (pnew->age > p->age) {\n            ppre->next = pnew;\n            pnew->next = p;\n            break;\n          } else {\n            ppre = ppre->next;\n            p = p->next;\n          }\n        }\n      }\n      if (pnew->next == NULL) {\n        last->next = pnew;\n        last = pnew;\n      }\n    }\n  }\n  return (head);\n}\nvoid print(struct sick *head, int N) {\n  struct sick *p = head;\n  int i;\n  for (i = 1; i <= N; i++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  struct sick *head = range(N);\n  print(head, N);\n}\n"}
{"label": "9", "index": "15055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  struct pa *next;\n} * head, *p, *p2;\n\nint main() {\n  int i, j, n, t;\n  char tid[10];\n  scanf(\"%d\", &n);\n  head = (struct pa *)malloc(sizeof(struct pa));\n  p = (struct pa *)malloc(sizeof(struct pa));\n  scanf(\"%s %d\", p->id, &p->age);\n  head->next = p;\n  p->next = NULL;\n  p2 = p;\n  for (i = 1; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s %d\", p->id, &p->age);\n    p2->next = p;\n    p2 = p;\n    p2->next = NULL;\n  }\n\n  \n\n  for (i = 0; i < n; i++) \n  {\n    for (p = head->next; p->next != NULL; p = p->next) {\n      if (p->next->age >= 60 && p->next->age > p->age) \n      {\n        t = p->age, p->age = p->next->age, p->next->age = t;\n        strcpy(tid, p->id), strcpy(p->id, p->next->id),\n            strcpy(p->next->id, tid);\n      }\n    }\n  }\n\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int slotnum;\n  char slot[100];\n  scanf(\"%d\", &n);\n\n  char s1[100][100];\n  int s2[100];\n  char a1[100][100];\n  int a2[100];\n  int anum = 0;\n  char b1[100][100];\n  int b2[100];\n  int bnum = 0;\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s1[i], &s2[i]);\n    if (s2[i] >= 60) {\n      strcpy(a1[j], s1[i]);\n      a2[j] = s2[i];\n      j++;\n      anum++;\n    }\n    if (s2[i] < 60) {\n      strcpy(b1[k], s1[i]);\n      b2[k] = s2[i];\n      k++;\n      bnum++;\n    }\n  }\n\n  for (i = anum - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a2[j] < a2[j + 1]) {\n        strcpy(slot, a1[j]);\n        strcpy(a1[j], a1[j + 1]);\n        strcpy(a1[j + 1], slot);\n        slotnum = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = slotnum;\n      }\n    }\n  }\n\n  for (i = 0; i < anum; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n  for (i = 0; i < bnum; i++)\n    printf(\"%s\\n\", b1[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[10];\n    int age;\n  } * p;\n  int n, i, k, num = 0, m = 0;\n  scanf(\"%d\", &n);\n  p = (struct pa *)malloc(sizeof(struct pa) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60)\n      num++;\n  }\n\n  int w = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      struct pa q = p[i];\n      for (k = i; k > w; k--) {\n        p[k] = p[k - 1];\n      }\n      p[w] = q;\n      w++;\n    }\n  }\n\n  for (i = num - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (p[k].age < p[k + 1].age) {\n        struct pa q = p[k];\n        p[k] = p[k + 1];\n        p[k + 1] = q;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << p[i].ID << \"\\n\";\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "9", "index": "15058", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pa {\n  char name[10];\n  int age;\n  struct pa *next;\n};\n\nvoid sort(struct pa *head, struct pa *s) {\n  struct pa *p1, *p2;\n  p1 = head->next;\n  p2 = head;\n  while (p1 && p1->age >= s->age) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nvoid creat(struct pa *head, struct pa *s) {\n  struct pa *p2, *p1;\n  p1 = head->next;\n  p2 = head;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nstruct pa *input() {\n  int i, n;\n  struct pa *s, *head1, *head2, *p1, *p2;\n  head1 = (struct pa *)malloc(1000);\n  head2 = (struct pa *)malloc(1000);\n  head1->next = NULL;\n  head2->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", s->name, &s->age);\n    if (s->age >= 60)\n      sort(head1, s);\n    else {\n      creat(head2, s);\n    }\n  }\n  p1 = head1->next;\n  p2 = head1;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = head2->next;\n  return (head1);\n}\n\nvoid print(struct pa *head) {\n  struct pa *p;\n  p = head->next;\n  while (p) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  struct pa *head;\n  head = input();\n  print(head);\n}\n"}
{"label": "9", "index": "15059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  int e;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1] && age[i] >= 60) ||\n          (age[i] < 60 && age[i + 1] >= 60)) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[10];\n    int age;\n  } * p;\n  int n, i, k, num = 0, m = 0;\n  scanf(\"%d\", &n);\n  p = (struct pa *)malloc(sizeof(struct pa) * n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].ID >> p[i].age;\n    if (p[i].age >= 60)\n      num++;\n  }\n\n  int w = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      struct pa q = p[i];\n      for (k = i; k > w; k--) {\n        p[k] = p[k - 1];\n      }\n      p[w] = q;\n      w++;\n    }\n  }\n\n  for (i = num - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (p[k].age < p[k + 1].age) {\n        struct pa q = p[k];\n        p[k] = p[k + 1];\n        p[k + 1] = q;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p[i].ID);\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "9", "index": "15061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], i, num = 0, m[100], j;\n  char c[100][10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      for (j = 0; j < n; j++) {\n        if (a[i] >= a[j]) {\n          num = num + 1;\n        }\n      }\n      m[i] = num;\n      num = 0;\n    }\n  }\n\n  for (j = n; j > 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 60) {\n        if (m[i] == j) {\n          printf(\"%s\\n\", c[i]);\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, z, y;\n  y = 0;\n  z = 0;\n  struct member {\n    char xh[10];\n    int ag;\n  };\n  struct member a[100];\n  struct member b[101], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].xh, &a[i].ag);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].ag >= 60) {\n      b[y] = a[i];\n      y++;\n    } else {\n      c[z] = a[i];\n      z++;\n    }\n  }\n\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j].ag < b[j + 1].ag) {\n        b[100] = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = b[100];\n      }\n    }\n  }\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", b[i].xh);\n  for (i = 0; i < z; i++)\n    cout << c[i].xh << \"\\n\";\n}\n"}
{"label": "9", "index": "15063", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } br[100];\n\n  int n, i, j, mid, k;\n\n  char s[10];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &br[i].id, &br[i].age);\n  }\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (br[i].age >= 60) {\n        for (j = i + 1; j < n; j++) {\n          if (br[j].age >= 60) {\n            if (br[j].age > br[i].age) {\n              mid = br[i].age;\n              br[i].age = br[j].age;\n              br[j].age = mid;\n\n              strcpy(s, br[i].id);\n              strcpy(br[i].id, br[j].id);\n              strcpy(br[j].id, s);\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age >= 60) {\n      printf(\"%s\\n\", br[i].id);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age < 60) {\n      printf(\"%s\\n\", br[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  char id[100][10];\n  int age[100];\n  char oid[100][10];\n  int oage[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      oage[k] = age[i];\n      strcpy(oid[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      if (oage[j] < oage[j + 1]) {\n        int e;\n        e = oage[j];\n        oage[j] = oage[j + 1];\n        oage[j + 1] = e;\n        char f[10];\n        strcpy(f, oid[j]);\n        strcpy(oid[j], oid[j + 1]);\n        strcpy(oid[j + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << oid[i] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct ren {\n    char b[100];\n    int c;\n\n  } a[100], d[100], m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].b >> a[i].c;\n    d[i] = a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (d[j].c < d[j + 1].c) {\n        m = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = m;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i].c >= 60) {\n      printf(\"%s\\n\", d[i].b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].c < 60) {\n      cout << a[i].b << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  short int age;\n};\nint main() {\n  int i, j, k, l, n;\n  struct patient pat[100], temp;\n  struct patient pa[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &pat[i].id, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n\n    if (pat[i].age >= 60) {\n      pa[j] = pat[i];\n      j++;\n    }\n  for (k = 0; k < j - 1; k++)\n    for (l = j - 1; l > k; l--)\n      if (pa[l].age > pa[l - 1].age) {\n        temp = pa[l];\n        pa[l] = pa[l - 1];\n        pa[l - 1] = temp;\n      }\n  for (k = 0; k < j; k++)\n    cout << pa[k].id << \"\\n\";\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "15067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0, j = 0, k = 0;\n  struct patient {\n    int age;\n    char id[10];\n  } patient[100], old[100], young[100], temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id >> patient[i].age;\n    if (patient[i].age >= 60) {\n      old[k] = patient[i];\n      k++;\n    } else {\n      young[s] = patient[i];\n      s++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << old[i].id << endl;\n  }\n  for (i = 0; i < s; i++)\n    cout << young[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[150], tmp, j;\n  char s[150][20], ts[20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (((a[j + 1] >= 60) && (a[j] < 60)) ||\n          ((a[j + 1] > a[j]) && (a[j] >= 60))) {\n        memcpy(ts, s[j], sizeof(ts));\n        memcpy(s[j], s[j + 1], sizeof(ts));\n        memcpy(s[j + 1], ts, sizeof(ts));\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n    }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Patient {\n    char ID[10];\n    int age;\n  } patient[100], patient2[100];\n  struct Patient t;\n  int n, i = 0, j = 0, k = 0, num;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patient[i].ID, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age >= 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  num = j;\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  for (k = 1; k < num; k++) {\n    for (i = 0; i < num - k; i++) {\n      if (patient2[i + 1].age > patient2[i].age) {\n        t = patient2[i + 1];\n        patient2[i + 1] = patient2[i];\n        patient2[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << patient2[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  int x;\n} p[100], P[100], s;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].num, &p[i].age);\n    if (p[i].age >= 60)\n      p[i].x = p[i].age;\n    else\n      p[i].x = 0;\n  }\n  for (i = 0; i < n; i++) {\n    s.age = -1;\n    s.x = -1;\n    char k[10];\n    for (j = 0; j < n; j++) {\n      if (s.x < p[j].x) {\n        s = p[j];\n        strcpy(k, p[j].num);\n      }\n    }\n    P[i] = s;\n    for (j = 0; j < n; j++) {\n      if (strcmp(p[j].num, k) == 0) {\n        p[j].x = -2;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << P[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  struct patient {\n    char ID[10];\n    int age;\n    struct patient *next;\n    struct patient *pre;\n  };\n  struct patient *p, *head, *q, *m, *temp;\n  p = (struct patient *)malloc(sizeof(struct patient));\n  head = p;\n  temp = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    if (i != n - 1) {\n      p->next = (struct patient *)malloc(sizeof(struct patient));\n      p->next->pre = p;\n      p->next->next = NULL;\n      p = p->next;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (q = p->next; q != NULL; q = q->next) {\n      if ((p->age < q->age) && (q->age >= 60)) {\n        for (m = q; m != p; m = m->pre) {\n          temp->age = m->age;\n          m->age = m->pre->age;\n          m->pre->age = temp->age;\n          strcpy(temp->ID, m->ID);\n          strcpy(m->ID, m->pre->ID);\n          strcpy(m->pre->ID, temp->ID);\n        }\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next)\n    cout << p->ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct node {\n  char s[100];\n  int age, no;\n} a[1000], b;\nint check(int x, int y) {\n  if (a[y].age < 60 && a[x].age >= 60)\n    return 0;\n  if (a[y].age >= 60 && a[x].age < 60)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no > a[y].no)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no < a[y].no)\n    return 0;\n  if (a[x].age > a[y].age)\n    return 0;\n  if (a[x].age < a[y].age)\n    return 1;\n  if (a[x].no < a[y].no)\n    return 0;\n  if (a[x].no > a[y].no)\n    return 1;\n  return 0;\n}\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].s >> a[i].age;\n    a[i].no = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (check(i, j) == 1) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", a[i].s);\n  return 0;\n}\n"}
{"label": "9", "index": "15073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, k = 0, e0, m, a;\n  int AGE[100];\n  char id[100][10];\n  char ID[100][10];\n  char e[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &id[i], &age[i]);\n  m = strlen(id[0]);\n  for (i = 0; i < n; i++)\n    id[i][m] = '\\0';\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      for (a = 0; a <= m; a++) {\n        ID[k][a] = id[i][a];\n      }\n      AGE[k] = age[i];\n      k++;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    for (j = 0; j < k - i; j++)\n      if (AGE[j] < AGE[j + 1]) {\n        e0 = AGE[j + 1];\n        AGE[j + 1] = AGE[j];\n        AGE[j] = e0;\n        for (a = 0; a <= m; a++) {\n          e[0][a] = ID[j + 1][a];\n          ID[j + 1][a] = ID[j][a];\n          ID[j][a] = e[0][a];\n        }\n      }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      k++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ID[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, f;\n  int k = 0;\n  scanf(\"%d\", &n);\n  char a[100][2000], e[11];\n  char d[100][2000];\n  int b[100];\n  int c[100];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = j; i <= k - 2; i++) {\n      if (c[i] < c[i + 1]) {\n        strcpy(e, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], e);\n        f = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = f;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << d[i] << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "15075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  short int age;\n};\nint main() {\n  int i, j, k, l, n;\n  struct patient pat[100], temp;\n  struct patient pa[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &pat[i].id, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n\n    if (pat[i].age >= 60) {\n      pa[j] = pat[i];\n      j++;\n    }\n  for (k = 0; k < j - 1; k++)\n    for (l = j - 1; l > k; l--)\n      if (pa[l].age > pa[l - 1].age) {\n        temp = pa[l];\n        pa[l] = pa[l - 1];\n        pa[l - 1] = temp;\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", pa[k].id);\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "15076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct date {\n    char a[10];\n    int num;\n    struct date *next;\n  };\n  struct date *p1, *p2, *head;\n  int n, i, temp, j, compare;\n  char tem[10];\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct date *)malloc(1000);\n  scanf(\"%s %d\", head->a, &head->num);\n  head->next = NULL;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p2 = (struct date *)malloc(1000);\n    cin >> p2->a >> p2->num;\n    p2->next = NULL;\n    p1->next = p2;\n    p1 = p2;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 1; j <= i; j++) {\n      compare = strcmp(p1->a, p2->a);\n      if (p1->num < 60 && p2->num >= 60) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      if (p1->num >= 60 && p2->num >= 60 && p1->num < p2->num) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      p1 = p2;\n      p2 = p1->next;\n    }\n  }\n  p1 = p2 = head;\n  for (i = 1; i <= n; i++) {\n    cout << p2->a << \" \";\n    p1 = p2;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[1000], e[1000], t, b, k, j, d;\n  char str[1000][1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%s %d\", str[i], &a[i]);\n  }\n  b = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      b++;\n    }\n  }\n  t = b;\n  for (i = 1; i <= n; i++) {\n    if (a[i] < 60) {\n      b++;\n      e[b] = i;\n    }\n  }\n  k = 0;\n  for (j = 100; j >= 60; j--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i] == j) {\n        k++;\n        e[k] = i;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    j = e[i];\n    if (i == 1)\n      cout << str[j];\n    else\n      printf(\" %s\", str[j]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15078", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, t;\n  int u = 0, k = 0;\n  int a[1000], b[1000];\n  char s[1000][10], h[1000][10], j[1000][10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60) {\n      b[u] = a[i];\n      strcpy(h[u], s[i]);\n      u++;\n    } else {\n      strcpy(j[k], s[i]);\n      k++;\n    }\n  }\n  for (i = u - 1; i > 0; i--) {\n    for (t = 0; t < i; t++) {\n      if (b[t] < b[t + 1]) {\n        int f;\n        f = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = f;\n        char tmp[10];\n        strcpy(tmp, h[t]);\n        strcpy(h[t], h[t + 1]);\n        strcpy(h[t + 1], tmp);\n      }\n    }\n  }\n  for (i = 0; i < u; i++)\n    printf(\"%s \", h[i]);\n  for (t = 0; t < k; t++)\n    printf(\"%s \", j[t]);\n  return 0;\n}\n"}
{"label": "9", "index": "15079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct Patient {\n    int flag;\n    char id[10];\n    int age;\n  };\n  struct Patient p[100], p2[100], temp;\n  int n, i, t = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n    p[i].flag = 0;\n    if (p[i].age >= 60) {\n      t = t + 1;\n      p[i].flag = 1;\n    }\n    p2[i] = p[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++)\n      if (p[j].age < p[j + 1].age) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n  }\n  for (i = 0; i < t; i++) {\n    cout << p[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (p2[i].flag == 0)\n      cout << p2[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n;\n  char ID[100][10];\n  int nl[100];\n  int i;\n  char e[10];\n  for (i = 0; i < n; i++) {\n    cin >> ID[i] >> nl[i];\n  }\n  int m;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((nl[i] < 60 && nl[i + 1] >= 60) ||\n          (nl[i] >= 60 && nl[i + 1] >= 60 && nl[i + 1] > nl[i])) {\n        m = nl[i + 1];\n        nl[i + 1] = nl[i];\n        nl[i] = m;\n        strcpy(e, ID[i + 1]);\n        strcpy(ID[i + 1], ID[i]);\n        strcpy(ID[i], e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", ID[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct patient {\n    char ID[10];\n    int age;\n  } pat[100], old[100];\n  int n, i, j, k = 0, a;\n  char b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].ID, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(old[k].ID, pat[i].ID);\n      old[k].age = pat[i].age;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        a = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = a;\n        strcpy(b, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], age1[100], t1, i, j, l1 = 0, l2 = 0;\n  char id[100][10], t2[10] = {\" \"}, a[100][10] = {\" \"}, b[100][10] = {\" \"};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id[i], &age[i]);\n    if (age[i] >= 60) {\n      strcpy(a[l1], id[i]);\n      age1[l1] = age[i];\n      l1 += 1;\n    } else {\n      strcpy(b[l2], id[i]);\n      l2 += 1;\n    }\n  }\n  for (i = 1; i < l1; i++) {\n    for (j = 0; j < l1 - i; j++) {\n      if (age1[j] < age1[j + 1]) {\n        t1 = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = t1;\n        strcpy(t2, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], t2);\n      }\n    }\n  }\n  for (i = 0; i < l1; i++)\n    cout << a[i] << \"\\n\";\n  for (j = 0; j < l2; j++)\n    cout << b[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, i, j, k, s, t, p;\n  scanf(\"%d\", &n);\n  int a[n - 1], c[n - 1];\n  char string[n - 1][10], b[n - 1][10];\n  for (h = 0; h <= n - 1; h++)\n    scanf(\"%s %d\", string[h], &a[h]);\n  for (p = 0, j = 0; p <= n - 1; p++) {\n    if (a[p] >= 60) {\n      c[j] = a[p];\n      strcpy(b[j], string[p]);\n      j++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (s = 1; s <= j; s++) {\n      for (i = 0, t = 0; i < j; i++) {\n        if (c[s - 1] >= c[i])\n          t++;\n      }\n      if (t == j) {\n        printf(\"%s\\n\", b[s - 1]);\n        c[s - 1] = 0;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15084", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[105];\n  char c[105][11];\n  int i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i], &a[i]);\n\n  int aa[105] = {0};\n  int num[105];\n  int u = 0;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      aa[i] = a[i];\n      num[u] = i;\n      u++;\n    }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (aa[i] > 0 && aa[i] == aa[j])\n        aa[i] = 0;\n    }\n  for (i = n; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (aa[j] < aa[j + 1]) {\n        int t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; aa[i] != 0; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == aa[i])\n        printf(\"%s\\n\", c[j]);\n    }\n  }\n  int tem = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < u; i++) {\n      if (j == num[i])\n        tem = 1;\n    }\n    if (tem == 0)\n      printf(\"%s\\n\", c[j]);\n    tem = 0;\n  }\n}\n"}
{"label": "9", "index": "15085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], i, num = 0, m[100], j;\n  char c[100][10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      for (j = 0; j < n; j++) {\n        if (a[i] >= a[j]) {\n          num = num + 1;\n        }\n      }\n      m[i] = num;\n      num = 0;\n    }\n  }\n\n  for (j = n; j > 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 60) {\n        if (m[i] == j)\n          printf(\"%s\\n\", c[i]);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct patient {\n    char id[10];\n    int age;\n  } pa[1000], t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j >= 0; j--)\n\n      if (pa[j].age > pa[j - 1].age && pa[j].age >= 60)\n\n      {\n\n        t = pa[j];\n        pa[j] = pa[j - 1];\n        pa[j - 1] = t;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      cout << pa[i].id << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], i, e, k;\n  char id[100][10], p[10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &a[i]);\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = n - 1; i > k - 1; i--) {\n      if (a[i] > a[i - 1] && a[i] >= 60) {\n        e = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = e;\n        strcpy(p, id[i]);\n        strcpy(id[i], id[i - 1]);\n        strcpy(id[i - 1], p);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  char a[100][10];\n  int x[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &x[i]);\n  for (j = 100; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (x[i] == j) {\n        printf(\"%s\\n\", a[i]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (x[i] < 60)\n      cout << a[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char num[20];\n  int age;\n  int turn;\n  struct ill *next;\n};\n\nvoid run(struct ill *head, int age, int turn, char *num) {\n  struct ill *pre, *p, *s;\n  s = (struct ill *)malloc(sizeof(struct ill));\n  pre = head;\n  p = pre->next;\n  strcpy(s->num, num);\n  s->turn = turn;\n  s->age = age;\n  \n  for (; p != NULL;) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nint main() {\n  int i, j, k, age, turn, m, n;\n  char *num;\n  void run(struct ill * head, int age, int turn, char *num);\n  num = (char *)malloc(20 * sizeof(char));\n  struct ill *head, *p, *s, *pre;\n  head = (struct ill *)malloc(sizeof(struct ill));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", num, &age);\n    turn = i;\n    run(head, age, turn, num);\n  }\n  k = 0;\n  for (p = head->next; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      k++;\n    }\n  }\n  \n  p = head->next;\n  m = 100;\n  if (k == 0) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == i) {\n          puts(p->num);\n          \n          break;\n        }\n      }\n    }\n  } else if (k == n) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n          \n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < k; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n          \n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n    for (i = 0; i < n - k; i++) {\n      m = 100;\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn < m) {\n          m = p->turn;\n        }\n        p = p->next;\n      }\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == m) {\n          puts(p->num);\n          \n          p->turn = 100;\n          break;\n        } else {\n          p = p->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, m = 0;\n\n  scanf(\"%d\", &n);\n\n  char s1[100][10], s2[100][10], p1[100][10], p2[100][10], z1[100][10],\n      z2[100][10], t[10];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s1[i]);\n\n    scanf(\"%s\", s2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) {\n      strcpy(p1[j], s1[i]);\n\n      strcpy(p2[j], s2[i]);\n\n      j++;\n    }\n    if (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0') {\n      strcpy(z1[m], s1[i]);\n\n      strcpy(z2[m], s2[i]);\n\n      m++;\n    }\n  }\n  int k = j;\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(p2[j], p2[j + 1]) < 0) {\n\n        strcpy(t, p2[j]);\n\n        strcpy(p2[j], p2[j + 1]);\n\n        strcpy(p2[j + 1], t);\n\n        strcpy(t, p1[j]);\n\n        strcpy(p1[j], p1[j + 1]);\n\n        strcpy(p1[j + 1], t);\n      }\n    }\n  }\n  for (i = m - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(z2[j], z2[j + 1]) < 0) {\n\n        strcpy(t, z2[j]);\n\n        strcpy(z2[j], z2[j + 1]);\n\n        strcpy(z2[j + 1], t);\n\n        strcpy(t, z1[j]);\n\n        strcpy(z1[j], z1[j + 1]);\n\n        strcpy(z1[j + 1], t);\n      }\n    }\n  }\n  for (j = 0; j < m; j++) {\n    cout << z1[j] << \"\\n\";\n  }\n\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", p1[j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (!((s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) ||\n          (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0')))\n      printf(\"%s\\n\", s1[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, j, k = 0, a, b, c, winnum = 0, win = 2, year;\n  char old[150][100] = {0}, id[100][100] = {0}, id0[100] = {0},\n       huiche[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id0, &year);\n    if (year >= 60) {\n      if (old[year][0] == 0) {\n        strcpy(old[year], id0);\n      } else {\n        huiche[0] = 13;\n        huiche[1] = 0;\n        strcat(old[year], huiche);\n        strcat(old[year], id0);\n      }\n    } else\n      strcpy(id[i], id0);\n  }\n  for (i = 149; i >= 0; i--) {\n    if (old[i][0] != 0) {\n      printf(\"%s\\n\", old[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (id[i] != 0) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    int id[7];\n    int age;\n  } patient[100];\n  int i, n, max = 0, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  for (k = max; k > 59; k--) {\n    for (i = 0; i < n; i++)\n      if (patient[i].age == k)\n        cout << patient[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60)\n      printf(\"%s\\n\", patient[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, t = 0;\n\n  struct patient {\n    char str[10];\n    int age;\n  } pat[100], pat2[100], patt;\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].str >> pat[i].age;\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      pat2[j] = pat[i];\n      j++;\n      t++;\n    }\n\n  for (i = 0; i < t - 1; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (pat2[j + 1].age > pat2[j].age) {\n        patt = pat2[j];\n        pat2[j] = pat2[j + 1];\n        pat2[j + 1] = patt;\n      }\n    }\n  }\n\n  for (i = 0; i < t; i++)\n    cout << pat2[i].str << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].str);\n  }\n}\n"}
{"label": "9", "index": "15094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[100][1000];\n  int n, i, y, l, j, p = 0, q = 0, c[1000], d[1000], e[1000], m, s, g[1000],\n                     v[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a, &y);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      b[i - 1][j] = a[j];\n    }\n    b[i - 1][l] = '\\0';\n    c[i - 1] = y;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i] >= 60) {\n      d[p] = c[i];\n      g[p] = i;\n      p++;\n    } else if (c[i] < 60) {\n      e[q] = c[i];\n      v[q] = i;\n      q++;\n    }\n  }\n  for (j = 0; j <= p - 1; j++) {\n    for (i = 0; i <= p - 1; i++) {\n      if (d[i] > m) {\n        m = d[i];\n        s = i;\n      } else if (d[i] <= m)\n        ;\n    }\n    printf(\"%s\\n\", b[g[s]]);\n    m = 0;\n    d[s] = 0;\n  }\n  for (i = 0; i <= q - 1; i++)\n    printf(\"%s\\n\", b[v[i]]);\n}\n"}
{"label": "9", "index": "15095", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nvoid sort(struct patient *head, struct patient *s) {\n  struct patient *pre = head, *p = pre->next;\n  if (s->age >= 60) {\n    while (p != NULL && s->age <= p->age) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (pre->next != NULL)\n      pre = pre->next;\n    pre->next = s;\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n    sort(head, p);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", &p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int slotnum;\n  char slot[100];\n  scanf(\"%d\", &n);\n\n  char s1[100][100];\n  int s2[100];\n  char a1[100][100];\n  int a2[100];\n  int anum = 0;\n  char b1[100][100];\n  int b2[100];\n  int bnum = 0;\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s1[i], &s2[i]);\n    if (s2[i] >= 60) {\n      strcpy(a1[j], s1[i]);\n      a2[j] = s2[i];\n      j++;\n      anum++;\n    }\n    if (s2[i] < 60) {\n      strcpy(b1[k], s1[i]);\n      b2[k] = s2[i];\n      k++;\n      bnum++;\n    }\n  }\n\n  for (i = anum - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a2[j] < a2[j + 1]) {\n        strcpy(slot, a1[j]);\n        strcpy(a1[j], a1[j + 1]);\n        strcpy(a1[j + 1], slot);\n        slotnum = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = slotnum;\n      }\n    }\n  }\n\n  for (i = 0; i < anum; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n  for (i = 0; i < bnum; i++) {\n    printf(\"%s\\n\", b1[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, temp, s, max;\n  int is_over_sixty_exist = 1;\n  int age[100] = {0}, queue[100] = {0};\n  char id[100][10] = {'0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    queue[i] = i;\n    scanf(\"%s%d\", id[i], &age[i]);\n  }\n  i = 0;\n  while (is_over_sixty_exist) {\n    max = 0;\n    is_over_sixty_exist = 0;\n    temp = queue[i];\n    for (j = 0; j < n; j++) {\n      if (age[j] >= 60 && age[j] > max) {\n        is_over_sixty_exist = 1;\n        max = age[j];\n        queue[i] = j;\n      }\n    }\n    for (s = i + 1; s < n; s++)\n      if (queue[s] == queue[i])\n        break;\n    age[queue[i]] = 0;\n    if (is_over_sixty_exist) {\n      if (s != n) {\n        for (k = s; k >= i + 1; k--)\n          queue[k] = queue[k - 1];\n        queue[i + 1] = temp;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", id[queue[i]]);\n}\n"}
{"label": "9", "index": "15098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    char as[10];\n    int ag;\n  };\n  struct student stu[100];\n  struct student st[100];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", stu[i].as, &stu[i].ag);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].ag > 59) {\n      st[j] = stu[i];\n      stu[i].ag = 0;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (st[i].ag < st[i + 1].ag) {\n        temp = st[i];\n        st[i] = st[i + 1];\n        st[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"\\n%s\", st[i].as);\n  for (i = 0; i < n; i++)\n    if (stu[i].ag != 0)\n      printf(\"\\n%s\", stu[i].as);\n  return 0;\n}\n"}
{"label": "9", "index": "15099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *last;\n};\nchar temp[10];\nint main() {\n  struct patient *p1, *p2, *head, p[1000];\n  int n, i, j, tmp;\n  cin >> n;\n  memset(p, 0, sizeof(p));\n  head = p + 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    p[i].last = p + i - 1;\n    p[i].next = p + i + 1;\n  }\n  head->last = NULL;\n  p[i].next = NULL;\n  for (i = n; i > 1; i--) {\n    for (j = 1; j < n; j++) {\n      if ((p + j + 1)->age >= 60 && (p + j + 1)->age > (p + j)->age) {\n        memcpy(temp, (p + j)->id, sizeof(temp));\n        memcpy((p + j)->id, (p + j + 1)->id, sizeof(temp));\n        memcpy((p + j + 1)->id, temp, sizeof(temp));\n        tmp = (p + j)->age;\n        (p + j)->age = (p + j + 1)->age;\n        (p + j + 1)->age = tmp;\n      }\n    }\n  }\n  for (; head != NULL; head = head->next) {\n    cout << head->id << \" \";\n  }\n}\n"}
{"label": "9", "index": "15100", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n} person[100], old[100];\n\nint main() {\n  int n, i, j = 0, k, b;\n  char e[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", person[i].id, &person[i].age);\n    if (person[i].age >= 60) {\n      strcpy(old[j].id, person[i].id);\n      old[j].age = person[i].age;\n      j = j + 1;\n    }\n  }\n  for (k = 1; k < j; k++)\n    for (i = 0; i < j - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        strcpy(e, old[i].id);\n        strcpy(old[i].id, old[i + 1].id);\n        strcpy(old[i + 1].id, e);\n        b = old[i].age;\n        old[i].age = old[i + 1].age;\n        old[i + 1].age = b;\n      }\n    }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", old[i].id);\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      printf(\"%s \", person[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct h {\n  char name[11];\n  int age;\n};\nint main() {\n  int i, k, n;\n  scanf(\"%d\", &n);\n  struct h p[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n  }\n  for (k = 100; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if (k == p[i].age)\n        printf(\"%s\\n\", p[i].name);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      cout << p[i].name << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], a[100], k = 0, count = 0, c[100], i, j;\n  char ID[100][100], id[100][100], string[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = age[i];\n      strcpy(id[k], ID[i]);\n      count++;\n      c[k] = k;\n      k++;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] < a[j]) {\n        int t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n        strcpy(string, id[k]);\n        strcpy(id[k], id[j]);\n        strcpy(id[j], string);\n        int p = c[k];\n        c[k] = c[j];\n        c[j] = p;\n      }\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] == a[j]) {\n        if (c[k] > c[j]) {\n          int t = a[j];\n          a[j] = a[k];\n          a[k] = t;\n          strcpy(string, id[k]);\n          strcpy(id[k], id[j]);\n          strcpy(id[j], string);\n          int p = c[k];\n          c[k] = c[j];\n          c[j] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < count; k++)\n    cout << id[k] << \" \";\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      cout << ID[i] << \" \";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Ill {\n  char a[10];\n  int age;\n};\n\nint main() {\n  int n, i, k;\n  int m, l = 0;\n  int j = 0;\n  struct Ill illMan[100], illOld[100], illOld1[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", illMan[i].a, &illMan[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age >= 60) {\n      illOld1[j] = illMan[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    m = 0;\n    for (k = 0; k < j; k++) {\n      if (m < illOld1[k].age) {\n        m = illOld1[k].age;\n      }\n    }\n    for (k = 0; k < j; k++) {\n      if (illOld1[k].age == m) {\n        illOld[l] = illOld1[k];\n        illOld1[k].age = 0;\n        l++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << illOld[i].a << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age < 60) {\n      printf(\"%s\\n\", illMan[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n;\n  char a[11];\n  int b;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[11];\n    int age;\n  } pat[100];\n  for (i = 0; i < n; i++)\n    cin >> pat[i].num >> pat[i].age;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (pat[j].age < pat[j + 1].age && pat[j + 1].age >= 60) {\n        for (k = 0; k < 10; k++) {\n          a[k] = pat[j].num[k];\n          pat[j].num[k] = pat[j + 1].num[k];\n          pat[j + 1].num[k] = a[k];\n        }\n\n        b = pat[j].age;\n        pat[j].age = pat[j + 1].age;\n        pat[j + 1].age = b;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << pat[i].num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i <= q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char a[10];\n  int age;\n};\nstruct bing bing[1000];\nint main() {\n  int n, i, j = 1, v = 1, k, t[1000], m, p[1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &bing[i].a, &bing[i].age);\n    if (bing[i].age >= 60) {\n      t[j] = i;\n      j++;\n    } else {\n      p[v] = i;\n      v++;\n    }\n  }\n  j--;\n  v--;\n  if (j != 0) {\n    for (i = 1; i < j; i++)\n      for (k = 1; k < j - i + 1; k++)\n        if (bing[t[k]].age < bing[t[k + 1]].age) {\n          m = t[k];\n          t[k] = t[k + 1];\n          t[k + 1] = m;\n        }\n  }\n  for (i = 1; i <= j; i++)\n    printf(\"%s\\n\", bing[t[i]].a);\n  for (i = 1; i <= v; i++)\n    printf(\"%s\\n\", bing[p[i]].a);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct people {\n    char id[30];\n    int age;\n  } x[100], y[100], z;\n  int a, b, c, e, i, j = 0, k = 0, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[k].id, &x[k].age);\n    if (x[k].age >= 60) {\n      y[j].age = x[k].age;\n      strcpy(y[j].id, x[k].id);\n      j = j + 1;\n      k = k - 1;\n    }\n    k = k + 1;\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (y[k].age < y[k + 1].age) {\n        z = y[k + 1];\n        y[k + 1] = y[k];\n        y[k] = z;\n      }\n  for (i = 0; i < j; i++)\n    cout << y[i].id << \"\\n\";\n  for (i = 0; i < n - j; i++)\n    cout << x[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char num[11];\n    int age;\n  } pat[101], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pat[i].num, &pat[i].age);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((pat[j].age < 60 && pat[j + 1].age >= 60) ||\n          (pat[j].age >= 60 && pat[j + 1].age > pat[j].age)) {\n        t = pat[j];\n        pat[j] = pat[j + 1];\n        pat[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15109", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct st {\n  char s[11];\n  int n;\n  struct st *next;\n};\nstruct st *creat(int m) {\n  struct st *head, *p1, *p2;\n  int i;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    scanf(\"%s %d\", p1->s, &p1->n);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid line(struct st *head, int m) {\n  struct st *p, *p1, *p2;\n  p = head;\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    p1 = p;\n    p2 = p1->next;\n    for (j = 1; j < m; j++) {\n      char ss[11] = {'\u0000'};\n      if (p1->n >= 60) {\n        if (p2->n > p1->n) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      } else {\n        if (p2->n >= 60) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", p->s);\n    p = p->next;\n  }\n}\nint main() {\n  struct st *p;\n  void line(struct st * head, int m);\n  struct st *creat(int m);\n  int m, i, j;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  line(p, m);\n  return 0;\n}\n"}
{"label": "9", "index": "15110", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int a[100];\n  char num[100][15];\n} data;\n\nint main() {\n  int i, b, k = 0, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> data.num[i] >> data.a[i];\n    if (data.a[i] >= 60)\n      k++;\n  }\n  for (j = 0; j < k; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (data.a[i] > data.a[b])\n        b = i;\n    }\n    printf(\"%s\\n\", data.num[b]);\n    data.a[b] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (data.a[i] != 0)\n      printf(\"%s\\n\", data.num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100], aged[100];\n  char num[100][11], anum[100][11], q[100][11];\n  int n, i, k, j = 0, s, p, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      aged[j] = sz[i];\n      strcpy(anum[j], num[i]);\n      j++;\n    }\n  }\n  for (s = 1; s < j; s++) {\n    for (k = 0; k < j - s; k++) {\n      if (aged[k] < aged[k + 1]) {\n        e = aged[k + 1];\n        aged[k + 1] = aged[k];\n        aged[k] = e;\n        strcpy(q[k], anum[k + 1]);\n        strcpy(anum[k + 1], anum[k]);\n        strcpy(anum[k], q[k]);\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s\\n\", anum[p]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      printf(\"%s\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15112", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f, g, t;\n  scanf(\"%d\", &n);\n  int p[n], e[n], d[n];\n  char a[n][100], b[n][100], c[n][100], s[100];\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> p[i];\n  }\n  j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n\n    if (p[i] >= 60) {\n      e[j] = p[i];\n      strcpy(b[j], a[i]);\n      j++;\n    } else {\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  for (f = 0; f < j - 1; f++) {\n    for (g = 0; g < j - 1 - f; g++) {\n      if (e[g] < e[g + 1]) {\n        t = e[g + 1];\n        e[g + 1] = e[g];\n        e[g] = t;\n        strcpy(s, b[g + 1]);\n        strcpy(b[g + 1], b[g]);\n        strcpy(b[g], s);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int age[100];\n  char ID[100][11];\n} patient, *ppatient;\nint main() {\n  ppatient = &patient;\n  int n, i, j, k, num, m = 0;\n  char id[11], ID_1[100][11], age_1[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patient.ID[i], &patient.age[i]);\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] >= 60) {\n      strcpy(ID_1[j], (*ppatient).ID[i]);\n      age_1[j] = (*ppatient).age[i];\n      m += 1;\n      j++;\n    }\n  }\n  for (j = m - 1; j > 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (age_1[k] < age_1[k + 1]) {\n        strcpy(id, ID_1[k + 1]);\n        strcpy(ID_1[k + 1], ID_1[k]);\n        strcpy(ID_1[k], id);\n        num = age_1[k + 1];\n        age_1[k + 1] = age_1[k];\n        age_1[k] = num;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", ID_1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] < 60)\n      printf(\"%s\\n\", (*ppatient).ID[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  for (i = 0; i <= q; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15115", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nvoid bubble(struct patient p[], int m);\nint main() {\n\n  struct patient p[200];\n  int n, i, t = 100;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p[i].id >> p[i].age;\n    if (p[i].age >= 60) {\n      p[t] = p[i];\n      t++;\n      p[i].age = 0;\n    }\n  }\n  bubble(p, t);\n  for (i = 100; i < t; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n  }\n}\nvoid bubble(struct patient p[], int m) {\n  int i, j;\n  struct patient temp;\n  for (j = 101; j < m; j++) {\n    for (i = 100; i < m + 100 - j; i++) {\n      if (p[i].age < p[i + 1].age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[10];\n    int age;\n  } * p;\n  int n, i, k, num = 0, m = 0;\n  scanf(\"%d\", &n);\n  p = (struct pa *)malloc(sizeof(struct pa) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60)\n      num++;\n  }\n\n  int w = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      struct pa q = p[i];\n      for (k = i; k > w; k--) {\n        p[k] = p[k - 1];\n      }\n      p[w] = q;\n      w++;\n    }\n  }\n\n  for (i = num - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (p[k].age < p[k + 1].age) {\n        struct pa q = p[k];\n        p[k] = p[k + 1];\n        p[k + 1] = q;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p[i].ID);\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "9", "index": "15117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  };\n\n  int n, i, j, k;\n  struct patient p[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n\n  for (i = 1; i < n; i++) {\n    if (p[i].age >= 60) {\n      j = 0;\n      while (j < i && p[j].age >= p[i].age)\n        j++;\n      if (j < i) {\n        struct patient tmp = p[i];\n        for (k = i; k > j; k--) {\n          p[k] = p[k - 1];\n        }\n        p[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    cout << p[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct bingren {\n    char num[10];\n    int age;\n  };\n  int n;\n  cin >> n;\n  struct bingren u[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &u[i].num, &u[i].age);\n  }\n  struct bingren v[1000];\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (u[i].age > 59) {\n      v[j] = u[i];\n      j++;\n    }\n  }\n  int k;\n  struct bingren e;\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (v[i].age < v[i + 1].age) {\n        e = v[i + 1];\n        v[i + 1] = v[i];\n        v[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", v[i].num);\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i].age < 60) {\n      printf(\"%s\\n\", u[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  char a[100];\n  int b;\n  struct s *next;\n};\nint main() {\n  struct s *p1, *p2, *p0, *head, *insert(struct s * head, struct s * stud), *h;\n  int i, j, k, n, x;\n  scanf(\"%d\", &n);\n  head = 0;\n  p1 = (struct s *)malloc(sizeof(struct s));\n  h = (struct s *)malloc(sizeof(struct s));\n  p2 = head = p1;\n  p1->next = 0;\n  k = 0;\n  j = 0;\n  scanf(\"%s %d\", p1->a, &p1->b);\n  x = 0;\n  if (p1->b < 60) {\n    p2 = h = p1;\n    x = 1;\n  }\n\n  else\n    p2 = h;\n  for (i = 0; i < n - 1; i++) {\n    p0 = (struct s *)malloc(sizeof(struct s));\n    scanf(\"%s %d\", p0->a, &p0->b);\n    if (p0->b >= 60) {\n      head = insert(head, p0);\n      k++;\n    } else {\n      p2->next = p0;\n      p2 = p0;\n      j++;\n    }\n  }\n  p1 = head;\n  if (x == 0)\n    i = -1;\n  else\n    i = 0;\n  for (; i < k; i++) {\n    printf(\"%s\\n\", p1->a);\n    p1 = p1->next;\n  }\n  if (x == 0) {\n    p2 = h->next;\n    i = 0;\n  } else {\n    p2 = h;\n    i = -1;\n  }\n  for (; i < j; i++) {\n    printf(\"%s\\n\", p2->a);\n    p2 = p2->next;\n  }\n  return 0;\n}\nstruct s *insert(struct s *head, struct s *stud) {\n  struct s *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == 0) {\n    head = p0;\n    p0->next = 0;\n  } else {\n    while ((p0->b <= p1->b) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->b > p1->b) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  return (head);\n}\n"}
{"label": "9", "index": "15120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, t = 0, e, num = 0, k;\n  char z[10];\n  struct point {\n    char ID[10];\n    int age;\n  } a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &a[i].ID);\n    cin >> a[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num = num + 1;\n    }\n  }\n  int f = num;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[t].age = a[i].age;\n      strcpy(b[t].ID, a[i].ID);\n      t++;\n    }\n    if (a[i].age < 60) {\n      b[f].age = a[i].age;\n      strcpy(b[f].ID, a[i].ID);\n      f++;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < num - i - 1; k++) {\n      if (b[k].age < b[k + 1].age) {\n        e = b[k].age;\n        b[k].age = b[k + 1].age;\n        b[k + 1].age = e;\n        strcpy(z, b[k + 1].ID);\n        strcpy(b[k + 1].ID, b[k].ID);\n        strcpy(b[k].ID, z);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100];\n  scanf(\"%d\", &n);\n  char zf[100][10], id[10];\n  int i, k, e = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", zf[i], &(sz[i]));\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i + 1] >= 60 && sz[i + 1] > sz[i]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n        strcpy(id, zf[i]);\n        strcpy(zf[i], zf[i + 1]);\n        strcpy(zf[i + 1], id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << zf[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    char ID[10];\n    int age;\n  } stu[100], stud[100];\n  int a[100], b[100], i, c, j, x, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].age);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].age >= 60) {\n      a[k] = stu[i].age;\n      b[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    c = b[i];\n    printf(\"%s\\n\", stu[c].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].age < 60) {\n      printf(\"%s\\n\", stu[i].ID);\n    }\n  }\n}\n"}
{"label": "9", "index": "15123", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n};\n\nint main() {\n  int i, n, k = 0;\n  struct data *p1, *p2, *head;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  print(head);\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  printf(\"%s \", code->id);\n\n  if (pre == head)\n    head->next = code->next;\n  else\n    pre->next = code->next;\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *head) {\n  struct data *p;\n  p = head->next;\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "15124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j = 0, e, x, a = 0, k;\n  int y[100], year[100];\n  char id[10], t[100][10], ee[10], p[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id, &x);\n    if (x >= 60) {\n      y[j] = x;\n      strcpy(t[j], id);\n      j++;\n    } else {\n      year[a] = x;\n      strcpy(p[a], id);\n      a++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (y[i] < y[i + 1]) {\n        e = y[i + 1];\n        y[i + 1] = y[i];\n        y[i] = e;\n\n        strcpy(ee, t[i + 1]);\n        strcpy(t[i + 1], t[i]);\n        strcpy(t[i], ee);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n\n    cout << t[i] << \"\\n\";\n  }\n  for (k = 0; k < a; k++) {\n    cout << p[k] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct peo {\n  char id[10];\n  int age;\n} a[150], b[150];\nint main() {\n  int n, i, j = 0, e, k;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      strcpy(b[j].id, a[i].id);\n      b[j].age = a[i].age;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i + 1].age;\n        b[i + 1].age = b[i].age;\n        b[i].age = e;\n        strcpy(c, b[i + 1].id);\n        strcpy(b[i + 1].id, b[i].id);\n        strcpy(b[i].id, c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << b[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].id);\n  }\n}\n"}
{"label": "9", "index": "15126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  int age;\n  char num[10];\n\n} pat[100], old[100], you[100], exchange_1;\nint main() {\n  int n, i, p, q, result;\n  int k = 0, t = 0;\n  int temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].num);\n    scanf(\"%d\", &pat[i].age);\n    if (pat[i].age >= 60) {\n      old[k].age = pat[i].age;\n      strcpy(old[k].num, pat[i].num);\n      k++;\n    } else {\n      strcpy(you[t].num, pat[i].num);\n      t++;\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (q = 0; q < k - p; q++) {\n      if (old[q].age < old[q + 1].age) {\n        exchange_1.age = old[q].age;\n        old[q].age = old[q + 1].age;\n        old[q + 1].age = exchange_1.age;\n        strcpy(exchange_1.num, old[q].num);\n        strcpy(old[q].num, old[q + 1].num);\n        strcpy(old[q + 1].num, exchange_1.num);\n      }\n    }\n  }\n  for (result = 0; result < k; result++) {\n    printf(\"%s \", old[result].num);\n  }\n  for (result = 0; result < t; result++) {\n    cout << you[result].num << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patience {\n  int shunxu;\n  char id[10];\n  int age;\n} pa[100];\nint main() {\n  int n, i, j, p = 60, q = 0;\n  scanf(\"%d\", &n);\n\n  int b[n], c[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      q++;\n    }\n  }\n  do {\n    for (i = 0; i < n; i++) {\n      if (pa[i].age >= p) {\n        p = pa[i].age;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (pa[i].age == p) {\n        printf(\"%s\\n\", pa[i].id);\n        pa[i].age = 0;\n      }\n    }\n    p = 60;\n    q--;\n  } while (q > 0);\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60 && pa[i].age > 0) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct BING {\n  char id[10];\n  int old;\n} bing[100], temp;\nint main() {\n  int i, j, k, n, p, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bing[i].id, &bing[i].old);\n  }\n  for (p = 0;; p++) {\n    max = -1;\n    for (i = 0; i < n; i++) {\n      if (bing[i].old > max && bing[i].old >= 60) {\n        max = bing[i].old;\n        k = i;\n      }\n    }\n    if (max >= 60) {\n      cout << bing[k].id << \"\\n\";\n      bing[k].old = -1;\n    }\n    if (max < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].old < 60 && bing[i].old >= 0)\n      printf(\"%s\\n\", bing[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0, j = 0, k = 0;\n  struct patient {\n    int age;\n    char id[10];\n  } patient[100], old[100], young[100], temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id >> patient[i].age;\n    if (patient[i].age >= 60) {\n      old[k] = patient[i];\n      k++;\n    } else {\n      young[s] = patient[i];\n      s++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << old[i].id << endl;\n  for (i = 0; i < s; i++)\n    cout << young[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "15130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct information {\n  char ID[10];\n  int age;\n} * a;\nint main() {\n  int n, i, j, max, p, q = 0;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age > 59)\n      q++;\n  }\n  for (i = 0; i < q; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (max < a[j].age) {\n        max = a[j].age;\n        p = j;\n      }\n    }\n    printf(\"%s\\n\", a[p].ID);\n    a[p].age = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age != 0)\n      printf(\"%s\\n\", a[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char A[10];\n  int age;\n};\n\nint main() {\n  int i, n, k, max, count;\n  struct patient inter;\n  struct patient *p;\n  scanf(\"%d\", &n);\n  struct patient *sick = (struct patient *)malloc(sizeof(struct patient) * n);\n  struct patient *waitlist =\n      (struct patient *)malloc(sizeof(struct patient) * n);\n  count = 0;\n  for (i = 0; i < n; i++) {\n    cin >> sick[i].A >> sick[i].age;\n  }\n  p = waitlist;\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      *p = sick[i];\n      p++;\n      count++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sick[i].age < 60) {\n      *p = sick[i];\n      p++;\n    }\n  }\n  for (i = 1; i < count; i++) {\n    for (k = 0; k < count - i; k++) {\n      if (waitlist[k].age < waitlist[k + 1].age) {\n        inter = waitlist[k + 1];\n        waitlist[k + 1] = waitlist[k];\n        waitlist[k] = inter;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << waitlist[i].A << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15132", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, f, n, i;\n  char a[100][10];\n  int b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (c = 0; c < n; c++) {\n    e = -1;\n    for (i = 0; i < n; i++) {\n      if (b[i] >= 60) {\n        if (b[i] > e) {\n          e = b[i];\n          f = i;\n        }\n      }\n    }\n    if (e != -1) {\n      printf(\"%s\\n\", a[f]);\n      b[f] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int num;\n  char data[10];\n  struct info *next;\n  int tip;\n};\n\nstruct info *create(int n) {\n  struct info *p1, *pre, *p2, *head, *tail;\n  int i, t;\n  head = (struct info *)malloc(sizeof(struct info));\n  p1 = (struct info *)malloc(sizeof(struct info));\n  cin >> p1->data >> p1->num;\n  head->next = p1;\n  p1->next = NULL;\n  tail = p1;\n  i = 0;\n  while (i < n - 1) {\n    t = 0;\n    p1 = (struct info *)malloc(sizeof(struct info));\n    cin >> p1->data >> p1->num;\n    p1->next = NULL;\n    if (p1->num >= 60) {\n      for (pre = head, p2 = head->next; p2 != NULL && p2->num >= 60;\n           pre = pre->next, p2 = p2->next) {\n        if (p2->num < p1->num) {\n          pre->next = p1;\n          p1->next = p2;\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        pre->next = p1;\n        p1->next = p2;\n        if (p2 == NULL) {\n          tail = p1;\n        }\n      }\n    } else {\n      tail->next = p1;\n      tail = p1;\n    }\n    i++;\n  }\n  return head;\n}\nvoid print(struct info *head) {\n  struct info *p;\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->data);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  struct info *head;\n  cin >> n;\n  head = create(n);\n  print(head);\n}\n"}
{"label": "9", "index": "15134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b[100], i, r, j = 0, k = 0, o[100] = {0}, y[100] = {0}, l = 1, m;\n  char a[100][10], old[100][10], young[100][10], str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] >= 60) {\n      strcpy(old[j], a[i]);\n      o[j] = b[i];\n      j++;\n    } else {\n      strcpy(young[k], a[i]);\n      y[k] = b[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (r = 0; r < i; r++) {\n      if (o[r] < o[r + 1]) {\n        m = o[r + 1];\n        strcpy(str, old[r + 1]);\n        o[r + 1] = o[r];\n        strcpy(old[r + 1], old[r]);\n        o[r] = m;\n        strcpy(old[r], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << old[i] << \"\\n\";\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", young[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10], id1[100][10], t[10];\n  int n, i, j, b, age[100], age1[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &age[i]);\n    strcpy(id1[i], id[i]);\n    age1[i] = age[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (age1[j] < age1[j + 1]) {\n        b = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = b;\n        strcpy(t, id1[j]);\n        strcpy(id1[j], id1[j + 1]);\n        strcpy(id1[j + 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age1[i] >= 60)\n      printf(\"%s\\n\", id1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patience {\n  int shunxu;\n  char id[10];\n  int age;\n} pa[100];\nint main() {\n  int n, i, j, p = 60, q = 0;\n  scanf(\"%d\", &n);\n\n  int b[n], c[n];\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].id >> pa[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      q++;\n    }\n  }\n  do {\n    for (i = 0; i < n; i++) {\n      if (pa[i].age >= p) {\n        p = pa[i].age;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (pa[i].age == p) {\n        printf(\"%s\\n\", pa[i].id);\n        pa[i].age = 0;\n      }\n    }\n    p = 60;\n    q--;\n  } while (q > 0);\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60 && pa[i].age > 0) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char num[11];\n  int age;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient pat1[100], pat2[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat1[i].num, &pat1[i].age);\n    strcpy(pat2[i].num, pat1[i].num);\n    pat2[i].age = pat1[i].age;\n  }\n  int j, e;\n  char e_num[11];\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pat1[i].age < pat1[i + 1].age) {\n        e = pat1[i + 1].age;\n        strcpy(e_num, pat1[i + 1].num);\n        pat1[i + 1].age = pat1[i].age;\n        strcpy(pat1[i + 1].num, pat1[i].num);\n        pat1[i].age = e;\n        strcpy(pat1[i].num, e_num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat1[i].age >= 60) {\n      printf(\"%s\\n\", pat1[i].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat2[i].age < 60) {\n      cout << pat2[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%s \", ID3[i]);\n}\n"}
{"label": "9", "index": "15139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, d[100], e, f, g, i, j, x, y, z;\n  char c[100][100]; \n  scanf(\"%d\", &a);\n  for (b = 0; b < a; b++) {\n    scanf(\"%s %d\", c[b], &d[b]);\n  }\n  for (e = 0; e < a; e++) {\n    if (d[e] >= 60) {\n      i = e;\n      break;\n    }\n  }\n  for (e = 0, g = 0; e < a; e++) {\n\n    if (d[e] >= 60)\n      g = g + 1;\n  }\n  for (x = 1; x <= g; x++) {\n    for (e = 0; e < a; e++) {\n      if (d[e] >= 60) {\n        if (d[i] < d[e])\n          i = e;\n      }\n    }\n    printf(\"%s \", c[i]);\n    d[i] = 0;\n  }\n  for (z = 0; z < a; z++) {\n    if (d[z] != 0)\n      printf(\"%s \", c[z]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\nint main() {\n  int n, i, j;\n  char id1[20];\n  int age1, u;\n  struct patient temp;\n  struct patient *p;\n  struct patient a[500];\n  scanf(\"%d\", &n);\n  p = a;\n  u = 0;\n  for (; p < a + n; p++) {\n    scanf(\"%s\", id1);\n    scanf(\"%d\", &age1);\n    strcpy(p->id, id1);\n    p->age = age1;\n    p->num = u;\n    u++;\n  }\n  p = a;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if ((*(p + j)).age >= 60 || (*(p + j + 1)).age >= 60) {\n        if ((*(p + j)).age < (*(p + j + 1)).age) {\n          temp = *(p + j);\n          *(p + j) = *(p + j + 1);\n          *(p + j + 1) = temp;\n        }\n      } else\n        continue;\n    }\n  }\n  p = a;\n  for (; p < a + n; p++) {\n\n    cout << p->id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int age;\n};\nstruct info1 {\n  char num1[10];\n  int age1;\n};\nint main(int argc, char *argv[]) {\n  struct info patient[101];\n  struct info1 old[101];\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", &patient[i].num, &patient[i].age);\n    if (patient[i].age >= 60) {\n      strcpy(old[j].num1, patient[i].num);\n      old[j].age1 = patient[i].age;\n      j++;\n    }\n  }\n  int m = j;\n  for (j = 1; j < m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (old[i].age1 < old[i + 1].age1) {\n        old[100] = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = old[100];\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << old[i].num1 << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n\n  \n  int m, n;\n  \n  \n\n  \n  int a[101], b[101];\n  \n\n  \n  \n  char c[101][11], d[101][11];\n  \n\n  \n  \n  \n  \n  \n  \n  \n  \n\n  \n  int i, j, k;\n\n  \n  int ni, nj, nk;\n  \n  \n  char ci[11], cj[11], ck[11];\n\n  \n\n  \n  \n  \n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", c[i]);\n    strcpy(d[i], c[i]);\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n  \n\n  \n  \n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] < a[j + 1]) {\n        ni = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = ni;\n        strcpy(ci, c[j + 1]);\n        strcpy(c[j + 1], c[j]);\n        strcpy(c[j], ci);\n      }\n    }\n  }\n\n  \n  \n  \n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] < 60) {\n      printf(\"%s\\n\", d[i]);\n    }\n  }\n\n  \n  return 0;\n}\n"}
{"label": "9", "index": "15143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100], j = 0, c[100], z, r;\n  char s[100][10], b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60) {\n      c[j] = a[i];\n      strcpy(b[j], s[i]);\n      j++;\n    }\n  }\n  for (z = j - 1; z > 0; z--) {\n    for (r = 0; r < z; r++) {\n      if (c[r] < c[r + 1]) {\n        int tep;\n        char m[10];\n        tep = c[r + 1];\n        c[r + 1] = c[r];\n        c[r] = tep;\n        strcpy(m, b[r]);\n        strcpy(b[r], b[r + 1]);\n        strcpy(b[r + 1], m);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i, j, lao = 0, you = 0, t;\n  char e[100][10], f[100][10], g[100][10], s[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> e[i] >> a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[lao] = a[i];\n      strcpy(f[lao], e[i]);\n      lao++;\n    } else {\n      c[you] = a[i];\n      strcpy(g[you], e[i]);\n      you++;\n    }\n  }\n  for (j = 0; j < lao - 1; j++) {\n    for (i = 0; i < lao - 1; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(s, f[i]);\n        strcpy(f[i], f[i + 1]);\n        strcpy(f[i + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < lao; i++)\n    printf(\"%s\\n\", f[i]);\n  for (i = 0; i < you; i++)\n    cout << g[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct example {\n  char id[10];\n  int age;\n  struct example *next;\n};\n\nint i = 1, d, n;\nstruct example *creat(int n) {\n  struct example *head = NULL;\n  struct example *p1, *p2;\n  while (i <= n) {\n    p1 = (struct example *)malloc(sizeof(struct example));\n    scanf(\"%s%d\", &(*p1).id, &(*p1).age);\n    if (i == 1) {\n      head = p1;\n      p2 = head;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    i = i + 1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct example *paixu(struct example *head) {\n  char temp1[10] = {'\\0'};\n  int temp2;\n  struct example *p1, *p2;\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1->next;\n      if (p1->age < p2->age && ((p2->age) >= 60)) {\n        strcpy(temp1, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, temp1);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p1 = p1->next;\n    }\n  }\n  return head;\n}\n\nvoid print(struct example *head) {\n  struct example *s;\n  s = head;\n  if (head != NULL) {\n    do {\n      cout << s->id << \"\\n\";\n      s = s->next;\n    } while (s != NULL);\n  }\n}\n\nint main() {\n  struct example *head = NULL;\n  cin >> n;\n  head = creat(n);\n  head = paixu(head);\n  print(head);\n}\n"}
{"label": "9", "index": "15146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], e;\n  char s[100][100], str[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] >= 60 && a[i + 1] >= 60) {\n        if (a[i] >= a[i + 1]) {\n          continue;\n        }\n        if (a[i] < a[i + 1]) {\n          strcpy(str, s[i + 1]);\n          strcpy(s[i + 1], s[i]);\n          strcpy(s[i], str);\n          e = a[i + 1];\n          a[i + 1] = a[i];\n          a[i] = e;\n        }\n      }\n      if (a[i] >= 60 && a[i + 1] < 60) {\n        continue;\n      }\n      if (a[i] < 60 && a[i + 1] >= 60) {\n        strcpy(str, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], str);\n        e = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = e;\n      }\n      if (a[i] < 60 && a[i + 1] < 60) {\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0;\n  scanf(\"%d\", &n);\n  char **id = (char **)malloc(sizeof(char *) * n);\n  for (i = 0; i < n; i++) {\n    id[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int p = 0;\n  int *year = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &year[i]);\n    if (year[i] >= 60) {\n      p++;\n    }\n  }\n  char **idolder = (char **)malloc(sizeof(char *) * p);\n  for (i = 0; i < n; i++) {\n    idolder[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int *yearolder = (int *)malloc(sizeof(int) * p);\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      idolder[j] = id[i];\n      yearolder[j] = year[i];\n      j++;\n    }\n  }\n  int e;\n  char *id1 = (char *)malloc(sizeof(char) * 10);\n  for (i = 1; i <= p; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (yearolder[j + 1] > yearolder[j]) {\n        id1 = idolder[j];\n        idolder[j] = idolder[j + 1];\n        idolder[j + 1] = id1;\n        e = yearolder[j];\n        yearolder[j] = yearolder[j + 1];\n        yearolder[j + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", idolder[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60) {\n      cout << id[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100];\n  int t, i, j;\n  char str[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> str[i] >> m[i];\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (m[i] >= 60) {\n        if (m[i + 1] >= 60) {\n          if (m[i + 1] > m[i]) {\n            strcpy(s, str[i]);\n            strcpy(str[i], str[i + 1]);\n            strcpy(str[i + 1], s);\n            t = m[i];\n            m[i] = m[i + 1];\n            m[i + 1] = t;\n          }\n        } else {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n      if (m[i] < 60) {\n        if (m[i + 1] >= 60) {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << str[i] << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "15149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  int order;\n  int age;\n  char id[10];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct patient *pa = (const struct patient *)a;\n  const struct patient *pb = (const struct patient *)b;\n  if ((pa->age >= 60) && (pb->age < 60)) {\n    return -1;\n  } else if ((pa->age < 60) && (pb->age >= 60)) {\n    return 1;\n  } else if ((pa->age >= 60) && (pa->age != pb->age)) {\n    return pb->age - pa->age;\n  } else {\n    return pa->order - pb->order;\n  }\n}\n\nint main() {\n  int i, num;\n  struct patient pat[100];\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    pat[i].order = i;\n    scanf(\"%s %d\", pat[i].id, &(pat[i].age));\n  }\n\n  qsort(pat, num, sizeof(struct patient), cmp);\n\n  for (i = 0; i < num; ++i) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "15150", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo[100], pai[100], temp;\n  int i, n;\n  int j = 0;\n  int k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if ((pai[i].age < pai[i + 1].age) && (pai[i + 1].age >= 60)) {\n        temp = pai[i];\n        pai[i] = pai[i + 1];\n        pai[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pai[i].num);\n  return 0;\n}\n"}
{"label": "9", "index": "15151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct person {\n  char str[10];\n  int age;\n} per[100], per1[100], per2[100];\n\nint main(int argc, char *argv[]) {\n  int n, i, j = 0, k = 0, x = 0, t;\n  char e[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> per[i].str >> per[i].age;\n    if (per[i].age >= 60) {\n      strcpy(per1[j].str, per[i].str);\n      per1[j].age = per[i].age;\n      j++;\n    } else {\n      strcpy(per2[k].str, per[i].str);\n      per2[k].age = per[i].age;\n      k++;\n    }\n  }\n  for (x = 0; x < j; x++) {\n    for (i = 0; i < j - x; i++) {\n      if (per1[i].age < per1[i + 1].age) {\n        strcpy(e, per1[i].str);\n        strcpy(per1[i].str, per1[i + 1].str);\n        strcpy(per1[i + 1].str, e);\n        t = per1[i].age;\n        per1[i].age = per1[i + 1].age;\n        per1[i + 1].age = t;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", per1[i].str);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", per2[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][11], c[100][11];\n  int i, j, n, b[100], m, e = -1, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      m = 0;\n      for (j = 0; j < n; j++) {\n        if (b[i] < b[j] || (b[i] == b[j] && i > j)) {\n          m++;\n        }\n      }\n      if (e < m)\n        e = m;\n      strcpy(c[m], a[i]);\n    }\n  }\n  e = e + 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      strcpy(c[i - f + e], a[i]);\n    } else {\n      f++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[15];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *create() {\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  head = p1;\n  p2 = p1;\n  p1->next = NULL;\n  int i = 1;\n  do {\n    if (i == n)\n      break;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  } while (1);\n  return (head);\n}\nstruct patient *findmax(struct patient *head) {\n  struct patient *max;\n\n  struct patient *p;\n  max = head;\n  p = head->next;\n  while (p) {\n    if (p->age > max->age)\n      max = p;\n    p = p->next;\n  }\n  return (max);\n}\nstruct patient *del(struct patient *head, struct patient *needdel) {\n  struct patient *p, *ppre;\n  printf(\"%s \", needdel->ID);\n  p = head;\n  while (p && needdel != p) {\n    ppre = p;\n    p = p->next;\n  }\n  if (p == head) {\n    head = p->next;\n    free(p);\n  } else if (p) {\n    ppre->next = p->next;\n    free(p);\n  }\n\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    cout << p->ID << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = create();\n  p = head;\n  do {\n    p = findmax(head);\n    if (p->age < 60) {\n      break;\n    }\n    head = del(head, p);\n\n  } while (1);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct ill {\n  char id[11];\n  int age;\n  struct ill *next;\n};\nstruct ill *creat(int n) {\n  struct ill *head, *p1, *p2;\n  int i;\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct ill *arrang(struct ill *head) {\n  int t, tt;\n  char s[11], ss[11];\n  struct ill *p, *q, *m, *h;\n  for (p = head; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      for (m = p, q = p->next; q != NULL; q = q->next)\n        if (q->age > m->age && m->age >= 60)\n          m = q;\n      {\n        t = tt = p->age;\n        strcpy(s, p->id);\n        strcpy(ss, p->id);\n        for (h = p->next; h != m->next; h = h->next) {\n          tt = h->age;\n          strcpy(ss, h->id);\n          h->age = t;\n          strcpy(h->id, s);\n          t = tt;\n          strcpy(s, ss);\n        }\n        p->age = t;\n        strcpy(p->id, s);\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int n;\n  struct ill *head, *h;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = arrang(head);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age >= 60)\n      printf(\"%s\\n\", h->id);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age < 60)\n      cout << h->id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bingren {\n  char id[1000];\n  int age;\n} bin[101];\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k = 0, l = 0, e, a[100];\n  char xiao[101][1000], da[101][1000], c[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &bin[i].id, &bin[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bin[i].age < 60) {\n      strcpy(xiao[k], bin[i].id);\n      k++;\n    } else {\n      strcpy(da[l], bin[i].id);\n      a[l] = bin[i].age;\n      l++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (a[j] < a[j + 1]) {\n        strcpy(c, da[j + 1]);\n        strcpy(da[j + 1], da[j]);\n        strcpy(da[j], c);\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", da[i]);\n\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", xiao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[100];\n  int age;\n  struct ill *next;\n};\nint main() {\n  struct ill *creat(int x);\n  struct ill *p, *head;\n  char *w[1000];\n  char *temp1;\n  int n, i, j = 0, k, temp;\n  int *q;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  head = p;\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      *(q + j) = (*p).age;\n      *(w + j) = (*p).id;\n      j++;\n    }\n    p = (*p).next;\n  }\n  k = j;\nloop:\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1)) {\n      temp = *(q + i);\n      *(q + i) = *(q + i + 1);\n      *(q + i + 1) = temp;\n      temp1 = *(w + i);\n      *(w + i) = *(w + i + 1);\n      *(w + i + 1) = temp1;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1))\n      goto loop;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", *(w + i));\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      goto lop;\n    } else {\n      printf(\"%s\\n\", (*p).id);\n    }\n  lop:\n    p = (*p).next;\n  }\n  return 0;\n}\nstruct ill *creat(int x) {\n  struct ill *head, *p1, *p2;\n  int i;\n  p1 = (struct ill *)malloc(sizeof(struct ill));\n  scanf(\"%s %d\", (*p1).id, &(*p1).age);\n  p2 = p1;\n  head = p1;\n  for (i = 0; i < x; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", (*p1).id, &(*p1).age);\n    (*p2).next = p1;\n    p2 = p1;\n  }\n  (*p2).next = NULL;\n  return (head);\n}\n"}
{"label": "9", "index": "15157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct point {\n  char id[10];\n  int age;\n} old[100], small[100];\n\nint main() {\n  int n, i, j, o = 0, s = 0, t, m;\n  \n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    char x[10] = {'\\0'};\n    t = 0;\n    scanf(\"%s %d\", x, &t);\n    if (t >= 60) {\n      strcpy(old[o].id, x);\n      old[o].age = t;\n      o++;\n\n    } else {\n      strcpy(small[s].id, x);\n      small[s].age = t;\n      s++;\n    }\n  }\n  char p[10];\n  for (i = 0; i < o; i++) {\n    for (j = 1; j < o - i; j++) {\n      if (old[i].age >= old[i + j].age) {\n        m = old[i + j].age;\n        old[i + j].age = old[i].age;\n        old[i].age = m;\n        strcpy(p, old[i + j].id);\n        strcpy(old[i + j].id, old[i].id);\n        strcpy(old[i].id, p);\n      }\n    }\n  }\n\n  for (i = o - 1; i >= 0; i--) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", small[i].id);\n  }\n}\n"}
{"label": "9", "index": "15158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100], i = 0, a[100], b[100], p = 0, q = 0, m = 0;\n  char sz1[100][100], a1[100][100], b1[100][100], e[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", sz1[i], &sz[i]);\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      a[p] = sz[i];\n      strcpy(a1[p], sz1[i]);\n      p++;\n    }\n    if (sz[i] < 60) {\n      b[q] = sz[i];\n      strcpy(b1[q], sz1[i]);\n      q++;\n    }\n  }\n  for (i = 1; i < p; i++) {\n    for (m = 0; m < p - i; m++) {\n      if (a[m] < a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n        strcpy(e, a1[m]);\n        strcpy(a1[m], a1[m + 1]);\n        strcpy(a1[m + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", a1[i]);\n  for (m = 0; m < q; m++)\n    printf(\"%s\\n\", (b1[m]));\n\n  return 0;\n}\n"}
{"label": "9", "index": "15159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n  struct pa *next;\n};\nstruct pa *insert(struct pa *head, struct pa *new1) {\n  struct pa *p0, *p1, *p2;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else if (p0->age >= 60) {\n    while ((p1->age >= p0->age) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->age > p1->age) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  } else {\n    p1 = head;\n    while (p1 != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p2->next = p0;\n    p0->next = NULL;\n  }\n  return (head);\n}\nint main() {\n  struct pa *p, *head;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    cin >> p->id >> p->age;\n    head = insert(head, p);\n  }\n  p = head;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100], y[100], z[100], a, b = 1, c = 1, d = 1, e = 1, f, g, h, j, k, n;\n  char o[100][10], p[100][10], q[100][10], r[100][10];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    cin >> o[a];\n    scanf(\"%d\", &x[a]);\n    if (x[a] >= 60) {\n      strcpy(p[b], o[a]);\n      b++;\n      y[c] = x[a];\n      c++;\n    } else {\n      strcpy(q[d], o[a]);\n      d++;\n      z[e] = x[a];\n      e++;\n    }\n  }\n  for (f = 1; f <= b - 2; f++) {\n    for (g = 1; g <= b - 2; g++) {\n      if (y[g] < y[g + 1]) {\n        h = y[g];\n        y[g] = y[g + 1];\n        y[g + 1] = h;\n        strcpy(r[1], p[g]);\n        strcpy(p[g], p[g + 1]);\n        strcpy(p[g + 1], r[1]);\n      }\n    }\n  }\n  for (j = 1; j <= b - 1; j++) {\n    printf(\"%s\\n\", p[j]);\n  }\n  for (k = 1; k <= d - 1; k++)\n    cout << q[k] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  char id[10];\n  int age;\n} p[100];\nint main() {\n  int n, i, a[100], b[100], j, k, m = 0;\n  char str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a[j++] = i;\n      m++;\n    } else\n      b[k++] = i;\n  }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[a[j]].age < p[a[j + 1]].age) {\n        int t = p[a[j]].age;\n        p[a[j]].age = p[a[j + 1]].age;\n        p[a[j + 1]].age = t;\n        strcpy(str, p[a[j]].id);\n        strcpy(p[a[j]].id, p[a[j + 1]].id);\n        strcpy(p[a[j + 1]].id, str);\n      }\n    }\n  if (m != 0) {\n    printf(\"%s\", p[a[0]].id);\n    for (i = 1; i < m; i++)\n      printf(\"\\n%s\", p[a[i]].id);\n    for (i = 0; i < n - m; i++)\n      cout << \"\\n\" << p[b[i]].id;\n  } else {\n    printf(\"%s\", p[b[0]].id);\n    for (i = 1; i < n; i++)\n      printf(\"\\n%s\", p[b[i]].id);\n  }\n}\n"}
{"label": "9", "index": "15162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  char id[100];\n  int year;\n} p[100];\nint main() {\n  int n, i, j, t = 0, r = 0;\n  int a[200] = {0};\n  scanf(\"%d\", &n);\n  struct a b[100];\n  struct a c[100];\n  struct a temp;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].year);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year >= 60) {\n      b[t] = p[i];\n      t++;\n    }\n  }\n  for (i = 0; i <= t - 1; i++) {\n    a[b[i].year]++;\n  }\n  for (i = 200; i >= 60; i--) {\n    if (a[i] > 0) {\n      for (j = 0; j <= t - 1; j++) {\n        if (b[j].year == i) {\n          c[r] = b[j];\n          r++;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= t - 1; i++) {\n    printf(\"%s\\n\", c[i].id);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char id[10];\n    int age;\n  } pat[100], p1[100], p2[100], temp;\n  int i, n, j = 0, k = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p1[j] = pat[i];\n      j++;\n    } else {\n      p2[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (m = 0; m < i; m++) {\n      if (p1[m].age < p1[m + 1].age) {\n        temp = p1[m];\n        p1[m] = p1[m + 1];\n        p1[m + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", p1[i].id);\n\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", p2[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct person {\n    char id[10];\n    int age;\n  } m[100], b[100];\n  int n, t, i, j;\n  char temp[10];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", m[i].id);\n    strcpy(b[i].id, m[i].id);\n    scanf(\"%d\", &m[i].age);\n    b[i].age = m[i].age;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (m[j].age < m[j + 1].age) {\n        t = m[j].age;\n        m[j].age = m[j + 1].age;\n        m[j + 1].age = t;\n        strcpy(temp, m[j].id);\n        strcpy(m[j].id, m[j + 1].id);\n        strcpy(m[j + 1].id, temp);\n      }\n    }\n  for (i = 0; i < n; i++)\n    if (m[i].age >= 60)\n      printf(\"%s\\n\", m[i].id);\n  for (i = 0; i < n; i++)\n    if (b[i].age < 60)\n      cout << b[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15165", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n};\nint main() {\n  struct patient *head, *p1, *p2, *p0;\n  int i, n;\n  cin >> n;\n  p1 = p2 = (struct patient *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p1->id, &p1->age);\n    p1->next = NULL;\n    if (i == 0) {\n      head = p1;\n    } else {\n      if ((p1->age > 60) && (p1->age > head->age)) {\n        p0 = head;\n        p1->next = p0;\n        head = p1;\n      } else {\n        p0 = head;\n        p2 = head->next;\n        if ((p1->age) < 60) {\n          while (p2 != NULL) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n        } else {\n          while ((p2 != NULL) && ((p1->age) <= (p2->age))) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n          p1->next = p2;\n        }\n      }\n    }\n    p1 = (struct patient *)malloc(1000);\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  printf(\"%s\", p1->id);\n  return 0;\n}\n"}
{"label": "9", "index": "15166", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo1[100], peo2[100], peo3[100], e;\n  int n, i, j, m, k;\n  scanf(\"%d\", &n);\n  char s[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo1[i].num);\n    scanf(\"%d\", &peo1[i].age);\n  }\n  j = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (peo1[i].age >= 60) {\n      peo2[j] = peo1[i];\n      j++;\n    } else if (peo1[i].age < 60) {\n      peo3[m] = peo1[i];\n      m++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (peo2[i].age < peo2[i + 1].age) {\n        e = peo2[i + 1];\n        peo2[i + 1] = peo2[i];\n        peo2[i] = e;\n      }\n    }\n  }\n  int a, b, c;\n  for (a = 0, i = 0; a < j; a++, i++) {\n    strcpy(s[a], peo2[i].num);\n  }\n  for (a = j, b = 0; a < n; a++, b++) {\n    strcpy(s[a], peo3[b].num);\n  }\n  for (c = 0; c < n; c++) {\n    printf(\"%s\\n\", s[c]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  struct patient p[100];\n  for (i = 1; i <= n; ++i) {\n    cin >> p[i].id >> p[i].age;\n    p[i].num = i;\n  }\n  for (i = 1; i <= n - 1; ++i) {\n    for (j = i + 1; j <= n; ++j) {\n      if (p[j].age > p[i].age) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  for (i = 1; p[i].age >= 60; ++i) {\n    for (j = i + 1; p[j].age == p[i].age; ++j) {\n      if (p[i].num > p[j].num) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (j = i; j <= n; ++j) {\n    int k;\n    for (k = j + 1; k <= n; ++k) {\n      if (p[j].num > p[k].num) {\n        struct patient t;\n        t = p[j];\n        p[j] = p[k];\n        p[k] = t;\n      }\n    }\n    printf(\"%s\\n\", p[j].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, l;\n  scanf(\"%d\", &num);\n  struct inf {\n    char str[10];\n    int age;\n  } infs[101];\n  struct f {\n    char *p1;\n    int m1;\n  } old[101];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d\", infs[i].str, &infs[i].age);\n  }\n  for (i = 0, j = 0; i < num; i++)\n    if (infs[i].age >= 60) {\n      old[j].m1 = infs[i].age;\n      old[j].p1 = infs[i].str;\n      j++;\n    }\n  int end = j;\n  char *k;\n  for (i = 0; i < end - 1; i++) {\n    for (j = 0; j + 1 < end - i; j++)\n      if (old[j].m1 < old[j + 1].m1) {\n        l = old[j].m1;\n        old[j].m1 = old[j + 1].m1;\n        old[j + 1].m1 = l;\n        k = old[j].p1;\n        old[j].p1 = old[1 + j].p1;\n        old[1 + j].p1 = k;\n      }\n  }\n  for (i = 0; i < end; i++)\n    cout << old[i].p1 << \"\\n\";\n  for (i = 0; i < num; i++)\n    if (infs[i].age < 60)\n      printf(\"%s\\n\", infs[i].str);\n}\n"}
{"label": "9", "index": "15169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n} pat[100];\nint main() {\n  int i, k, n, e;\n  int ex[100], ex1[100];\n  i = 0;\n  k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", &(pat[i].id), &(pat[i].age));\n    ex[i] = pat[i].age;\n    ex1[i] = i + 1;\n  }\n  for (k = n - 1; k >= 1; k--) {\n    for (i = n - 1; i >= n - k; i--) {\n      if (ex[i] > ex[i - 1] && ex[i] >= 60) {\n        e = ex[i];\n        ex[i] = ex[i - 1];\n        ex[i - 1] = e;\n        e = ex1[i];\n        ex1[i] = ex1[i - 1];\n        ex1[i - 1] = e;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] >= 60) {\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] < 60)\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct peo {\n    char num[10];\n    int old;\n    struct peo *next;\n  };\n  struct peo *p, *p1, *p2, *p3, *head1, *head2, *head3;\n  int n, i, j;\n  p = p1 = p2 = p3 = head1 = head2 = head3 = (struct peo *)malloc\n\n      (sizeof(struct peo));\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &p1->num, &p1->old);\n    if (i == 1)\n      head1 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct peo *)malloc(sizeof(struct peo));\n  }\n  for (i = 1; i <= n; i++) {\n    p1 = head1;\n    p2 = head1;\n    for (j = 1; j <= (n + 1 - i); j++) {\n      if (p1->old > p2->old && p1->old >= 60) {\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    if (i == 1)\n      head2 = p2;\n    else\n      p->next = p2;\n    p = p2;\n    p1 = head1;\n    p3 = head1;\n    for (j = 1; j <= (n - i + 1); j++) {\n      if (p1->num == p2->num) {\n        if (j == 1)\n          head1 = p1->next;\n        else\n          p3->next = p1->next;\n      }\n      p3 = p1;\n      p1 = p1->next;\n    }\n  }\n  p = head2;\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, e, z = 0;\n  int a[100], c[100], x[100];\n  char b[100][10], d[100][10], y[100][10];\n  char f[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", b[i], &a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      c[s] = a[i];\n      strcpy(d[s], b[i]);\n      s++;\n    } else {\n      x[z] = a[i];\n      strcpy(y[z], b[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 1; j < s - i; j++) {\n      if (c[j - 1] < c[j]) {\n        e = c[j];\n        c[j] = c[j - 1];\n        c[j - 1] = e;\n        strcpy(f[j], d[j]);\n        strcpy(d[j], d[j - 1]);\n        strcpy(d[j - 1], f[j]);\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < z; i++) {\n    printf(\"%s\\n\", y[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, l, z;\n  int a[100], b[100], f[100];\n  char d[30], c[100][30], e[100][30];\n  scanf(\"%d\", &n);\n  for (i = 0, z = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n    if (a[i] >= 60) {\n      b[z] = a[i];\n      f[z] = z;\n      strcpy(e[z], c[i]);\n      a[i] = 0;\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = i + 1; j < z; j++) {\n      if (b[j] > b[i]) {\n        strcpy(d, e[i]);\n        strcpy(e[i], e[j]);\n        strcpy(e[j], d);\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n        l = f[i];\n        f[i] = f[j];\n        f[j] = l;\n      }\n      if (b[i] == b[j]) {\n        if (f[i] > f[j]) {\n          strcpy(d, e[i]);\n          strcpy(e[i], e[j]);\n          strcpy(e[j], d);\n          k = b[i];\n          b[i] = b[j];\n          b[j] = k;\n          l = f[i];\n          f[i] = f[j];\n          f[j] = l;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", e[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct bingren {\n    char num[10];\n    int age;\n  };\n  int n;\n  cin >> n;\n  struct bingren u[1000];\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &u[i].num, &u[i].age);\n\n  struct bingren v[1000];\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (u[i].age > 59) {\n      v[j] = u[i];\n      j++;\n    }\n  }\n  int k;\n  struct bingren e;\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (v[i].age < v[i + 1].age) {\n        e = v[i + 1];\n        v[i + 1] = v[i];\n        v[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << v[i].num << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i].age < 60) {\n      printf(\"%s\\n\", u[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  struct point {\n    char x[10];\n    int y;\n  } sz[100];\n  struct po {\n    char a[10];\n    int b;\n    int c;\n  } lnr[100];\n  int n, temp;\n  int tag = 0;\n  char tem[100];\n  int count = 0;\n\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s%d\", sz[i].x, &sz[i].y);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = tag; k < n; k++) {\n      if (sz[k].y >= 60) {\n        lnr[j].c = k;\n        lnr[j].b = sz[k].y;\n        strcpy(lnr[j].a, sz[k].x);\n        tag = k + 1;\n        count++;\n        break;\n      }\n    }\n  }\n  for (int l = 0; l < count - 1; l++) {\n    for (int m = count - 1; m > l; m--) {\n      if (lnr[m].b > lnr[m - 1].b) {\n        temp = lnr[m - 1].b;\n        lnr[m - 1].b = lnr[m].b;\n        lnr[m].b = temp;\n\n        strcpy(tem, lnr[m - 1].a);\n        strcpy(lnr[m - 1].a, lnr[m].a);\n        strcpy(lnr[m].a, tem);\n      }\n    }\n  }\n  tag = n - 1;\n  for (int o = n - 1; o > count - 1; o--) {\n    for (int p = tag; p >= 0; p--) {\n      if (sz[p].y < 60) {\n        sz[o].y = sz[p].y;\n        strcpy(sz[o].x, sz[p].x);\n        tag = p - 1;\n        break;\n      }\n    }\n  }\n  for (int q = 0; q < count; q++)\n    printf(\"%s\\n\", lnr[q].a);\n\n  for (int r = count; r < n; r++) {\n    printf(\"%s\\n\", sz[r].x);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct p {\n    char id[30];\n    int ag;\n  } a[105], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].ag);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[j - 1].ag >= 60 && a[j].ag >= 60) {\n        if (a[j - 1].ag < a[j].ag) {\n          temp = a[j - 1];\n          a[j - 1] = a[j];\n          a[j] = temp;\n        }\n      } else if (a[j - 1].ag < 60 && a[j].ag >= 60) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15176", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int renshu, nianling[1000][2], bijiao[1000][2];\n  char id[1000][1000];\n\n  scanf(\"%d\", &renshu);\n\n  int i, j, k;\n  j = 0;\n  k = 0;\n  for (i = 0; i < renshu; i++) {\n    scanf(\"%s%d\", id[i], &nianling[i][0]);\n  }\n\n  for (i = 0; i < renshu; i++) {\n    if (nianling[i][0] < 60)\n      ;\n    else {\n      nianling[i][1] = i;\n      bijiao[k][0] = nianling[i][0];\n      bijiao[k][1] = i;\n      k++;\n    }\n  }\n\n  int zhongjian[2], l;\n  l = k;\n  bijiao[l][0] = 10000;\n\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l; j++) {\n      if (bijiao[j][0] > bijiao[j + 1][0]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else if (bijiao[j][0] == bijiao[j + 1][0] &&\n                 bijiao[j][1] < bijiao[j + 1][1]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else\n        ;\n    }\n  }\n\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < renshu; j++) {\n      if (bijiao[l - 1 - i][0] == nianling[j][0] &&\n          bijiao[l - i - 1][1] == nianling[j][1])\n        printf(\"%s\\n\", id[j]);\n      else\n        ;\n    }\n  }\n\n  for (j = 0; j < renshu; j++) {\n    if (nianling[j][0] < 60)\n      printf(\"%s\\n\", id[j]);\n    else\n      ;\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  char a[100][10];\n  int x[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &x[i]);\n  for (j = 100; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (x[i] == j)\n        printf(\"%s\\n\", a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (x[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } patient[100], old[100], t;\n  int a, i = 0, j = 0, k = 0, r, i1;\n  scanf(\"%d\", &a);\n  getchar();\n  for (i = 0; j + i < a; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[j] = patient[i];\n      j++;\n      i--;\n    }\n  }\n  for (r = 0; r < j - 1; r++)\n    for (k = 0; k < j - 1 - r; k++)\n      if (old[k].age < old[k + 1].age) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (r = 0; r < j; r++)\n    printf(\"%s\\n\", old[r].id);\n  for (r = 0; r < i; r++)\n    printf(\"%s\\n\", patient[r].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15179", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j;\n  char id[100][11], str[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n  }\n  for (i = 110; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (age[j] == i) {\n        printf(\"%s\\n\", id[j]);\n        age[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct people {\n    char a[10];\n    int year;\n  };\n  struct people b[100], c[100], d[100], v[100];\n  for (int h = 0; h <= 99; h++) {\n    for (int p = 0; p <= 9; p++) {\n      b[h].a[p] = c[h].a[p] = d[h].a[p] = v[h].a[p] = 0;\n    }\n  }\n\n  int n, t = 0, k = 0, o;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &b[i].a, &b[i].year);\n    if (b[i].year >= 60) {\n      t++;\n      v[t] = b[i];\n    } else {\n      k++;\n      d[k] = b[i];\n    }\n  }\n  for (int j = 1; j <= t; j++) {\n    o = 0;\n    for (int u = 1; u <= t; u++) {\n\n      if (v[u].year > v[j].year) {\n        o++;\n      }\n      if (v[u].year == v[j].year && u < j) {\n        o++;\n      }\n    }\n    c[o + 1] = v[j];\n  }\n  for (int l = 1; l <= k; l++) {\n    c[t + l] = d[l];\n  }\n  for (int x = 1; x <= n; x++) {\n    cout << c[x].a << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p[200][10], q[200][10] = {0}, c[10];\n  int a[200], b[200];\n  int n, i, j, x, y, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  j = 0;\n  x = 0;\n  t = 0;\n  y = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(q[j], p[i]);\n      j++;\n      t++;\n    }\n  }\n  for (j = t - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] < b[i + 1]) {\n        int r;\n        r = b[i + 1];\n        strcpy(c, q[i + 1]);\n        b[i + 1] = b[i];\n        strcpy(q[i + 1], q[i]);\n        b[i] = r;\n        strcpy(q[i], c);\n      }\n    }\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", q[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", p[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct people {\n    char a[10];\n    int year;\n  };\n  struct people b[100], c[100], d[100], v[100];\n  for (int h = 0; h <= 99; h++) {\n    for (int p = 0; p <= 9; p++) {\n      b[h].a[p] = c[h].a[p] = d[h].a[p] = v[h].a[p] = 0;\n    }\n  }\n\n  int n, t = 0, k = 0, o;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &b[i].a, &b[i].year);\n    if (b[i].year >= 60) {\n      t++;\n      v[t] = b[i];\n    } else {\n      k++;\n      d[k] = b[i];\n    }\n  }\n  for (int j = 1; j <= t; j++) {\n    o = 0;\n    for (int u = 1; u <= t; u++) {\n\n      if (v[u].year > v[j].year) {\n        o++;\n      }\n      if (v[u].year == v[j].year && u < j) {\n        o++;\n      }\n    }\n    c[o + 1] = v[j];\n  }\n  for (int l = 1; l <= k; l++) {\n    c[t + l] = d[l];\n  }\n  for (int x = 1; x <= n; x++) {\n    cout << c[x].a << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, j, i, n, max, count, a[100];\n\n  char s[100][10];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++)\n    scanf(\"%s %d\", s[i], &a[i]);\n\n  n = 0;\n  for (count = 0; count < num; count++) {\n    max = 59;\n    for (i = 0; i < num; i++) {\n      if (a[i] > max && a[i] < 200) {\n        max = a[i];\n        j = i;\n      }\n    }\n    if (max == 59)\n      break;\n    printf(\"%s\\n\", s[j]);\n    a[j] = 300;\n  }\n  for (i = 0; i < num; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} young[100], old[100];\n\nint main() {\n  int i, j, n, temp, yn = 0, on = 0, people[150] = {0};\n  char t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", t, &temp);\n    if (temp >= 60) {\n      strcat(old[on].id, t);\n      old[on].age = temp;\n      on++;\n      people[temp]++;\n    } else {\n      strcat(young[yn].id, t);\n      young[yn].age = temp;\n      yn++;\n    }\n  }\n  for (i = 149; i >= 60; i--) {\n    if (people[i] > 0) {\n      for (j = 0; j < on; j++)\n        if (old[j].age == i)\n          printf(\"%s\\n\", old[j].id);\n    }\n  }\n  for (i = 0; i < yn; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m = 0;\nstruct patient {\n  char id[32];\n  int age;\n  struct patient *next;\n};\nstruct patient *find(struct patient *head) {\n  struct patient *p, *ppre;\n  p = head;\n  while (p && p->age >= 60) {\n    ppre = p;\n    p = p->next;\n  }\n  return ppre;\n}\nstruct patient *create(int n) {\n  struct patient *head = NULL, *p1, *p2, *p0, *q;\n  int i;\n  p1 = p2 = p0 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  if (p1->age >= 60)\n    m++;\n  p1->next = NULL;\n  head = p1 = p0;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age < 60) {\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    } else if (p1->age >= 60) {\n      m++;\n      if (head->age < 60) {\n        head = p1;\n        p1->next = p0;\n      }\n      if (head->age >= 60) {\n        p0 = find(head);\n        q = p0->next;\n        p0->next = p1;\n        p1->next = q;\n      }\n      if ((p0 = find(head))->next == NULL) {\n        p1->next = NULL;\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n  }\n  return head;\n}\nstruct patient *arrange(struct patient *head) {\n  struct patient *p1, *p2;\n  int t1, i, j;\n  char t2[32];\n  for (j = 0; j < m; j++) {\n    p1 = head;\n    for (i = 1; i < m - j; i++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p2->age < p1->age) {\n        t1 = p1->age;\n        strcpy(t2, p1->id);\n        p1->age = p2->age;\n        strcpy(p1->id, p2->id);\n        p2->age = t1;\n        strcpy(p2->id, t2);\n      }\n    }\n  }\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head, *p, *q, *p0;\n  int n, m = 0, age;\n  char id[32];\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  print(head);\n}\n"}
{"label": "9", "index": "15186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct peo {\n  char id[10];\n  int age;\n} a[150], b[150];\nint main() {\n  int n, i, j = 0, e, k;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      strcpy(b[j].id, a[i].id);\n      b[j].age = a[i].age;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i + 1].age;\n        b[i + 1].age = b[i].age;\n        b[i].age = e;\n        strcpy(c, b[i + 1].id);\n        strcpy(b[i + 1].id, b[i].id);\n        strcpy(b[i].id, c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << b[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60)\n      cout << a[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15187", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  } pa[100];\n  int n, i, t, j, k;\n  char m[10], str[100][100];\n  int a[100], b[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pa[i].ID, &pa[i].age);\n    a[i] = pa[i].age;\n    strcpy(str[i], pa[i].ID);\n  }\n  for (i = 0, j = 0; i < n; i++, j++) {\n    if (a[i] >= 60)\n      b[j] = a[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < n - 1 - i; j++) {\n\n      if (b[j + 1] > b[j]) {\n        t = b[j];\n        strcpy(m, pa[j].ID);\n        b[j] = b[j + 1];\n        strcpy(pa[j].ID, pa[j + 1].ID);\n        b[j + 1] = t;\n        strcpy(pa[j + 1].ID, m);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n\n    if (b[i] != 0)\n      printf(\"%s\\n\", pa[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n}\n"}
{"label": "9", "index": "15188", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct arr {\n  char id[10];\n  int age;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  scanf(\"%s %d\", &p1->id, &p1->age);\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%s %d\", &p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return (head);\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->age == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->age == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%s \", p->id);\n    else\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  if (head != NULL) {\n    while (p != NULL) {\n      head = head->next;\n      free(p);\n      p = head;\n    }\n  }\n}\nint main() {\n  struct arr *head, *p1;\n  int m, max = 0;\n  scanf(\"%d\", &m);\n  head = create(m);\n  for (;;) {\n    max = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next)\n      max = (max > p1->age) ? max : p1->age;\n\n    if (max >= 60) {\n      for (p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age == max)\n          printf(\"%s \", p1->id);\n      }\n      head = del(head, max);\n    } else\n      break;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "9", "index": "15189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t = 0, e, num = 0, k;\n  char z[10];\n  struct point {\n    char ID[10];\n    int age;\n  } a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &a[i].ID);\n    cin >> a[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num = num + 1;\n    }\n  }\n  int f = num;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[t].age = a[i].age;\n      strcpy(b[t].ID, a[i].ID);\n      t++;\n    }\n    if (a[i].age < 60) {\n      b[f].age = a[i].age;\n      strcpy(b[f].ID, a[i].ID);\n      f++;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < num - i - 1; k++) {\n      if (b[k].age < b[k + 1].age) {\n        e = b[k].age;\n        b[k].age = b[k + 1].age;\n        b[k + 1].age = e;\n        strcpy(z, b[k + 1].ID);\n        strcpy(b[k + 1].ID, b[k].ID);\n        strcpy(b[k].ID, z);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15190", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct person {\n    char id[10];\n    int age;\n  } m[100], b[100];\n  int n, t, i, j;\n  char temp[10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", m[i].id);\n    strcpy(b[i].id, m[i].id);\n    scanf(\"%d\", &m[i].age);\n    b[i].age = m[i].age;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (m[j].age < m[j + 1].age) {\n        t = m[j].age;\n        m[j].age = m[j + 1].age;\n        m[j + 1].age = t;\n        strcpy(temp, m[j].id);\n        strcpy(m[j].id, m[j + 1].id);\n        strcpy(m[j + 1].id, temp);\n      }\n    }\n  for (i = 0; i < n; i++)\n    if (m[i].age >= 60)\n      printf(\"%s\\n\", m[i].id);\n  for (i = 0; i < n; i++)\n    if (b[i].age < 60)\n      printf(\"%s\\n\", b[i].id);\n}\n"}
{"label": "9", "index": "15191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n    struct patient *next;\n  } * p1, *p2, *head, *p[100], *temp;\n  p1 = p2 = head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", p1->id, &p1->age);\n  for (i = 2; i <= n; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p1->id, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (t = 0, p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p[t] = p1;\n      t++;\n    }\n\n  for (j = 0; j < t - 1; j++)\n    for (i = 0; i < t - j - 1; i++)\n      if (p[i]->age < p[i + 1]->age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n\n  for (i = 0; i <= t - 1; i++)\n    printf(\"%s\\n\", p[i]->id);\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age < 60)\n      printf(\"%s\\n\", p1->id);\n}\n"}
{"label": "9", "index": "15192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, j, i, age, m, y;\n  int b[1000];\n  char B[1000][100], C[1000][100], d[1000][100];\n  char a[1000];\n  scanf(\"%d\", &n);\n  y = 0;\n  k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", a, &age);\n    if (age < 60) {\n      strcpy(B[y], a);\n      y++;\n    } else {\n      strcpy(C[k], a);\n      b[k] = age;\n      k++;\n    }\n  }\n  int x = 0;\n  for (i = 200; i >= 60; i--) {\n    for (j = 0; j <= k - 1; j++) {\n      if (i == b[j]) {\n        strcpy(d[x], C[j]);\n        x++;\n      }\n    }\n  }\n\n  for (i = 0; i <= k - 1; i++)\n    puts(d[i]);\n  for (i = 0; i <= n - k - 1; i++)\n    puts(B[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, e, z = 0;\n  int a[100], c[100], x[100];\n  char b[100][10], d[100][10], y[100][10];\n  char f[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", b[i], &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      c[s] = a[i];\n      strcpy(d[s], b[i]);\n      s++;\n    } else {\n      x[z] = a[i];\n      strcpy(y[z], b[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 1; j < s - i; j++) {\n      if (c[j - 1] < c[j]) {\n        e = c[j];\n        c[j] = c[j - 1];\n        c[j - 1] = e;\n        strcpy(f[j], d[j]);\n        strcpy(d[j], d[j - 1]);\n        strcpy(d[j - 1], f[j]);\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < z; i++) {\n    cout << y[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct a {\n    char id[10];\n    int age;\n  } p, q, a[100], old[100], yog[100];\n  int n, i = 0, x = 0, y = 0, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      old[x] = a[i];\n      x++;\n    }\n    if (a[i].age < 60) {\n      yog[y] = a[i];\n      y++;\n    }\n  }\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - 1; i++) {\n      if (old[i].age < old[i + 1].age) {\n        p = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = p;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", yog[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, e, n, i, j, k, a[101], b[101], c[101];\n  char ex[11], s[101][11], s1[101][11], s2[101][11];\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      strcpy(s1[j], s[i]);\n      b[j] = a[i];\n      j++;\n    } else {\n      strcpy(s2[k], s[i]);\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (m = 1; m <= j; m++) {\n    for (i = 0; i < j - m; i++) {\n      if (b[i] < b[i + 1]) {\n        strcpy(ex, s1[i]);\n        strcpy(s1[i], s1[i + 1]);\n        strcpy(s1[i + 1], ex);\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", s1[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", s2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char c[20];\n  int num;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  int i, r;\n  struct student *p, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s %d\", p1->c, &p1->num);\n  p1->next = NULL;\n  p = p1;\n  r = 0;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p4 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s %d\", p4->c, &p4->num);\n    if (p4->num >= 60) {\n      for (p2 = p, p3 = p, r = 0; p2 != NULL;) {\n        if (p4->num > p2->num) {\n          if (p2 == p3) {\n            p = p4;\n            p4->next = p2;\n          } else {\n            p3->next = p4;\n            p4->next = p2;\n          }\n          r = 1;\n          break;\n        }\n        if (p4->num <= p2->num) {\n          p3 = p2;\n          p2 = p2->next;\n        }\n      }\n      if (r == 0) {\n        p3->next = p4;\n        p4->next = NULL;\n      }\n    } else {\n      p2 = p;\n      while (p2 != NULL) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      p3->next = p4;\n      p4->next = NULL;\n    }\n  }\n  return p;\n}\nvoid print(struct student *p) {\n  struct student *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%s\\n\", p1->c);\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct student *p;\n  int n;\n  scanf(\"%d\\n\", &n);\n  p = creat(n);\n  print(p);\n}\n"}
{"label": "9", "index": "15197", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  struct pa *next;\n} * head, *p, *p2;\n\nint main() {\n  int i, j, n, t;\n  char tid[10];\n  scanf(\"%d \", &n);\n  head = (struct pa *)malloc(sizeof(struct pa));\n  p = (struct pa *)malloc(sizeof(struct pa));\n  scanf(\"%s %d\", p->id, &p->age);\n  head->next = p;\n  p->next = NULL;\n  p2 = p;\n  for (i = 1; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s %d\", p->id, &p->age);\n    p2->next = p;\n    p2 = p;\n    p2->next = NULL;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (p = head->next; p->next != NULL; p = p->next) {\n      if (p->next->age >= 60 && p->next->age > p->age) {\n        t = p->age, p->age = p->next->age, p->next->age = t;\n        strcpy(tid, p->id), strcpy(p->id, p->next->id),\n            strcpy(p->next->id, tid);\n      }\n    }\n  }\n\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int n) {\n  int i, s;\n  for (i = 1, s = a[1]; i < n; i++)\n    s = (s >= a[i]) ? s : a[i];\n  return (s);\n}\nint main() {\n  int a[200] = {0}, i, n, c[200] = {0}, e, t = 1;\n  char b[200][12];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", b[i], &e);\n    if (e >= 60)\n      a[i] = e;\n    else\n      c[i] = e;\n  }\n  for (;;) {\n    t = max(a, n);\n    if (t == 0)\n      break;\n    for (i = 1; i <= n; i++) {\n      if (a[i] == t) {\n        printf(\"%s \", b[i]);\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (c[i] != 0)\n      printf(\"%s \", b[i]);\n}\n"}
{"label": "9", "index": "15199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct ID {\n    char x[100];\n    int y;\n  } da[100], xiao[100], p[100], e;\n  int s, m = 0, n = 0;\n  scanf(\"%d\\n\", &s);\n\n  for (int i = 0; i < s; i++) {\n    scanf(\"%s %d\", &(p[i].x), &(p[i].y));\n    if (p[i].y >= 60) {\n      da[m] = p[i];\n      m++;\n    } else {\n      xiao[n] = p[i];\n      n++;\n    }\n  }\n\n  for (int b = 1; b <= m; b++) {\n    for (int v = 0; v < m - b; v++) {\n      if (da[v].y < da[v + 1].y) {\n        e = da[v];\n        da[v] = da[v + 1];\n        da[v + 1] = e;\n      }\n    }\n  }\n  int h, f;\n  for (int z = 0; z < m; z++) {\n    f = strlen(da[z].x);\n    for (int g = 0; g < f; g++) {\n      if (g != f - 1) {\n        printf(\"%c\", da[z].x[g]);\n      } else {\n        printf(\"%c\\n\", da[z].x[g]);\n      }\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    h = strlen(xiao[a].x);\n    for (int j = 0; j < h; j++) {\n      if (j != h - 1) {\n        printf(\"%c\", xiao[a].x[j]);\n      } else {\n        printf(\"%c\\n\", xiao[a].x[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0, k;\n  int t;\n  int old[100];\n  int age[100];\n  char a[100][20];\n  char a1[100][20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    scanf(\"%s\", a1[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    age[i] = atoi(a1[i]);\n    if (age[i] >= 60) {\n      old[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (age[old[k]] < age[old[k + 1]]) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[old[i]]);\n  for (i = 1; i <= n; i++) {\n    if (age[i] >= 60)\n      continue;\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct myturn {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j = 0, max = 0;\n  struct myturn patient[100];\n  scanf(\"%d\", &n); \n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &patient[i].ID, &patient[i].age);\n    if (patient[i].age > max)\n      max = patient[i].age; \n  }\n  if (max >= 60) { \n    for (max; max >= 60; max--) {\n      for (i = 0; i < n; i++) {\n        if (patient[i].age == max) {\n          printf(\"%s\\n\", patient[i].ID); \n          patient[i].age = 0;\n          j++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) { \n    if (patient[i].age != 0) {\n      printf(\"%s\", patient[i].ID);\n      j++;\n      if (j < n)\n        printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15202", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, max, l, sign = 0;\n  scanf(\"%d\", &n);\n  struct tt {\n    char pp[10];\n    int age;\n    struct tt *next;\n  };\n  struct tt *head, *p1, *p2, *p3;\n  head = (struct tt *)malloc(1000);\n  p1 = head;\n  p2 = head;\n  scanf(\"%s\", head->pp);\n  scanf(\"%d\", &head->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct tt *)malloc(1000);\n    ;\n    p2->next = p1;\n    scanf(\"%s\", p1->pp);\n    scanf(\"%d\", &p1->age);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= n; i++) {\n    if (sign == 1) {\n      printf(\"%s \", head->pp);\n      head = head->next;\n    } else if (sign == 0) {\n      max = (-1);\n      for (p2 = NULL, p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age > max) {\n          max = p1->age;\n          p3 = p2;\n        }\n        p2 = p1;\n      }\n      if (max < 60) {\n        sign = 1;\n        i--;\n        continue;\n      } else if (max >= 60) {\n        if (p3 == NULL) {\n          printf(\"%s \", head->pp);\n          head = head->next;\n        } else {\n          p1 = p3->next;\n          printf(\"%s \", p1->pp);\n          p3->next = p1->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int w;\n  char c[10];\n  struct stu *next;\n};\nint n;\nstruct stu *creat(int m) {\n  struct stu *head, *p1, *p2, *p3;\n  int i;\n  n = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  head = p1;\n  p1->next = NULL;\n  n = 0;\n  scanf(\"%s %d\", p1->c, &p1->w);\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%s %d\", p1->c, &p1->w);\n    if (p1->w < 60) {\n      for (p2 = head; p2->next != NULL; p2 = p2->next)\n        ;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      p2 = head;\n      while ((p1->w <= p2->w) && (p2->next != NULL)) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      if (p1->w > p2->w) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int m, i;\n  struct stu *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", p->c);\n\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15204", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct pa {\n    char id[20];\n    int old;\n  } pai[101], ol[101], you[101];\n\n  int n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pai[i].id, &pai[i].old);\n  }\n  l = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (pai[i].old >= 60) {\n      ol[l] = pai[i];\n      l++;\n    }\n    if (pai[i].old < 60) {\n      you[k] = pai[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (ol[j].old < ol[j + 1].old) {\n        ol[100] = ol[j];\n        ol[j] = ol[j + 1];\n        ol[j + 1] = ol[100];\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", ol[i].id);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\\n\", you[i].id);\n  }\n  printf(\"%s\", you[k - 1].id);\n}\n"}
{"label": "9", "index": "15205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[16];\n    int age;\n    int index;\n  };\n  int n, i, j, t, t1;\n  char str[16];\n  cin >> n;\n  struct patient pat[n];\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].ID >> pat[i].age;\n    pat[i].index = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (pat[j].age >= 60 && pat[j].age > pat[i].age) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n      if (pat[i].age >= 60 && pat[i].age == pat[j].age) {\n        if (pat[i].index > pat[j].index) {\n          strcpy(str, pat[i].ID);\n          strcpy(pat[i].ID, pat[j].ID);\n          strcpy(pat[j].ID, str);\n          t = pat[i].age;\n          pat[i].age = pat[j].age;\n          pat[j].age = t;\n          t1 = pat[i].index;\n          pat[i].index = pat[j].index;\n          pat[j].index = t1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (pat[i].age < 60 && pat[i].index > pat[j].index) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n  }\n  for (i = 0; i < n; i++)\n\n    puts(pat[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, d = 0, q, j;\n  int b[101], f[101];\n  char a[101][10], c[101][10], e[101][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  q = n - 1;\n  j = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (b[i] < 60) {\n\n      strcpy(c[q], a[i]);\n      q = q - 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n\n      strcpy(c[j], a[i]);\n      f[j] = b[i];\n      d = d + 1;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - 1; j++) {\n      if (f[j] < f[j + 1]) {\n        f[100] = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = f[100];\n        strcpy(c[100], c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[1 + j], c[100]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", c[i]);\n}\n"}
{"label": "9", "index": "15207", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[100] = {0}, b[100] = {0};\n  char id[100][20], temp[20], s[100][20];\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> id[i] >> a[i];\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(s[j], id[i]);\n      j = j + 1;\n    }\n\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i; k++)\n      if (b[k] < b[k + 1]) {\n        t = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = t;\n        strcpy(temp, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], temp);\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", s[k]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", id[i]);\n}\n"}
{"label": "9", "index": "15208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, year[100], i, j, year2[100] = {0}, t, k;\n  char num[100][10], num2[100][10], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    scanf(\"%d\", &year[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      for (k = 0; k < 10; k++) {\n        num2[i][k] = num[i][k];\n      }\n      year2[i] = year[i];\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++) {\n      if (year2[i] < year2[i + 1]) {\n        t = year2[i];\n        year2[i] = year2[i + 1];\n        year2[i + 1] = t;\n        for (k = 0; k < 10; k++) {\n          p = num2[i][k];\n          num2[i][k] = num2[i + 1][k];\n          num2[i + 1][k] = p;\n        }\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (year2[i] != 0)\n      printf(\"%s\\n\", num2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15209", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int amount_lao = 0, amount_yiban = 0;\n  char c[11];\n  int shuru;\n  int i, j, k, s, p;\n  struct xinxi {\n    char id[11];\n    int age;\n  };\n  struct xinxi laoren[100];\n  struct xinxi common[100];\n  struct xinxi temp;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    cin >> c >> shuru;\n    if (shuru < 60) {\n      strcpy(common[amount_yiban].id, c);\n      common[amount_yiban].age = shuru;\n      amount_yiban++;\n    } else if (shuru >= 60) {\n      strcpy(laoren[amount_lao].id, c);\n      laoren[amount_lao].age = shuru;\n      amount_lao++;\n    }\n  }\n  for (i = 0; i < amount_lao - 1; i++) {\n    for (j = 0; j < amount_lao - i - 1; j++) {\n      if (laoren[j].age < laoren[j + 1].age) {\n        strcpy(temp.id, laoren[j].id);\n        temp.age = laoren[j].age;\n        strcpy(laoren[j].id, laoren[j + 1].id);\n        laoren[j].age = laoren[j + 1].age;\n        strcpy(laoren[j + 1].id, temp.id);\n        laoren[j + 1].age = temp.age;\n      }\n    }\n  }\n  for (k = 0; k < amount_lao; k++) {\n    puts(laoren[k].id);\n    printf(\" \");\n  }\n  for (s = 0; s < amount_yiban; s++) {\n    puts(common[s].id);\n    printf(\" \");\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int amount_lao = 0, amount_yiban = 0;\n  char c[11];\n  int shuru;\n  int i, j, k, s, p;\n  struct xinxi {\n    char id[11];\n    int age;\n  };\n  struct xinxi laoren[100];\n  struct xinxi common[100];\n  struct xinxi temp;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    cin >> c >> shuru;\n    if (shuru < 60) {\n      strcpy(common[amount_yiban].id, c);\n      common[amount_yiban].age = shuru;\n      amount_yiban++;\n    } else if (shuru >= 60) {\n      strcpy(laoren[amount_lao].id, c);\n      laoren[amount_lao].age = shuru;\n      amount_lao++;\n    }\n  }\n  for (i = 0; i < amount_lao - 1; i++) {\n    for (j = 0; j < amount_lao - i - 1; j++) {\n      if (laoren[j].age < laoren[j + 1].age) {\n        strcpy(temp.id, laoren[j].id);\n        temp.age = laoren[j].age;\n        strcpy(laoren[j].id, laoren[j + 1].id);\n        laoren[j].age = laoren[j + 1].age;\n        strcpy(laoren[j + 1].id, temp.id);\n        laoren[j + 1].age = temp.age;\n      }\n    }\n  }\n  for (k = 0; k < amount_lao; k++) {\n    puts(laoren[k].id);\n    printf(\" \");\n  }\n  for (s = 0; s < amount_yiban; s++) {\n    puts(common[s].id);\n    printf(\" \");\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15211", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct patient_t {\n    char id[10];\n    int age;\n  } patients[100], t;\n  int i, j, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> patients[i].id >> patients[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char id[100][10];\n  int age[100];\n  int oldno = 0;\n  int xu[100];\n  char shunxu[100][10];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (age[j] >= 60) {\n      xu[oldno] = age[j];\n      strcpy(shunxu[oldno], id[j]);\n      oldno++;\n    }\n  }\n\n  int num = oldno;\n  int e;\n  char tem[10];\n  for (int k = 0; k < n; k++) {\n    if (age[k] < 60) {\n      xu[oldno] = age[k];\n      strcpy(shunxu[oldno], id[k]);\n      oldno++;\n    }\n  }\n  for (int x = 1; x <= num; x++) {\n    for (int y = 0; y < num - x; y++) {\n      if (xu[y] < xu[y + 1]) {\n        e = xu[y];\n        xu[y] = xu[y + 1];\n        xu[y + 1] = e;\n        strcpy(tem, shunxu[y]);\n        strcpy(shunxu[y], shunxu[y + 1]);\n        strcpy(shunxu[y + 1], tem);\n      }\n    }\n  }\n  for (int z = 0; z < n; z++) {\n    printf(\"%s\\n\", shunxu[z]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct guahao {\n  char num[20];\n  int year;\n};\nint main() {\n  int n, i, m;\n  struct guahao temp, *p, *t, *p1;\n  scanf(\"%d\", &n);\n  m = n;\n  struct guahao *bingren = (struct guahao *)malloc(sizeof(struct guahao) * n);\n  struct guahao *bingren1 = (struct guahao *)malloc(sizeof(struct guahao) * m);\n  p = bingren;\n  p1 = bingren1;\n  for (; p < bingren + n; p++, p1++) {\n    scanf(\"%s %d\", p->num, &p->year);\n    *p1 = *p;\n  }\n  p = bingren;\n  for (i = 0; p < bingren + n - 1; p++, i++) {\n    for (t = bingren; t < bingren + n - 1 - i; t++) {\n      if ((*t).year < (*(t + 1)).year) {\n        temp = *t;\n        *t = *(t + 1);\n        *(t + 1) = temp;\n      }\n    }\n  }\n  p = bingren;\n  for (; p < bingren + n; p++) {\n    if ((*p).year >= 60) {\n      printf(\"%s\\n\", p->num);\n    }\n  }\n  for (p1 = bingren1; p1 < bingren1 + m; p1++) {\n    if ((*p1).year < 60) {\n      printf(\"%s\\n\", p1->num);\n    }\n  }\n  free(bingren);\n  free(bingren1);\n  return 0;\n}\n"}
{"label": "9", "index": "15214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[11];\n    int b;\n  } p[100];\n  int n, i, j = 0, m, t;\n  char c[100][11], string[11];\n  int d[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].a, &p[i].b);\n  for (i = 0; i < n; i++) {\n    if (p[i].b >= 60) {\n      strcpy(c[j], p[i].a);\n      d[j] = p[i].b;\n      j++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n        strcpy(string, c[i]);\n        strcpy(c[i], c[i + 1]);\n        strcpy(c[i + 1], string);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i], d[i]);\n  for (i = 0; i < n; i++) {\n    if (p[i].b < 60)\n      printf(\"%s\\n\", p[i].a, p[i].b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bin {\n  char ID[10];\n  int age;\n  struct bin *next;\n};\nint main() {\n  struct bin *head, *p, *p1, *p2, *p3;\n  int n, i;\n  scanf(\"%d\", &n);\n  p = (struct bin *)malloc(sizeof(struct bin));\n  scanf(\"%s%d\", &p->ID, &p->age);\n  head = p3 = p;\n  p->next = 0;\n  for (i = 1; i < n; i++) {\n    p = (struct bin *)malloc(sizeof(struct bin));\n    scanf(\"%s%d\", &p->ID, &p->age);\n    if (p->age < 60) {\n      p3->next = p;\n      p->next = 0;\n      p3 = p;\n    } else {\n      if (p->age > head->age) {\n        p->next = head;\n        head = p;\n      } else if (p->age <= p3->age) {\n        p3->next = p;\n        p->next = 0;\n        p3 = p;\n      } else {\n        p1 = head;\n        p2 = p1->next;\n        while (p2->age >= p->age) {\n          p1 = p1->next;\n          p2 = p2->next;\n        }\n        p1->next = p;\n        p->next = p2;\n      }\n    }\n  }\n  for (; head != 0; head = head->next) {\n    printf(\"%s\\n\", head->ID);\n  }\n}\n"}
{"label": "9", "index": "15216", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = 0, q = 0, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> c[i] >> a[i];\n    if (a[i] >= 60) {\n      p++;\n      e[i - q] = a[i];\n      strcpy(b[i - q], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[i - p] = a[i];\n      strcpy(d[i - p], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p; k++) {\n    for (i = 0; i < p - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i < q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15217", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  int order;\n  int age;\n  char id[10];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct patient *pa = (const struct patient *)a;\n  const struct patient *pb = (const struct patient *)b;\n  if ((pa->age >= 60) && (pb->age < 60)) {\n    return -1;\n  } else if ((pa->age < 60) && (pb->age >= 60)) {\n    return 1;\n  } else if ((pa->age >= 60) && (pa->age != pb->age)) {\n    return pb->age - pa->age;\n  } else {\n    return pa->order - pb->order;\n  }\n}\n\nint main() {\n  int i, num;\n  struct patient pat[100];\n\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; ++i) {\n    pat[i].order = i;\n    scanf(\"%s %d\", pat[i].id, &(pat[i].age));\n  }\n\n  qsort(pat, num, sizeof(struct patient), cmp);\n\n  for (i = 0; i < num; ++i) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "15218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct point {\n  char id[10];\n  int age;\n} old[100], small[100];\n\nint main() {\n  int n, i, j, o = 0, s = 0, t, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    char x[10] = {'\\0'};\n    t = 0;\n    scanf(\"%s %d\", x, &t);\n    if (t >= 60) {\n      strcpy(old[o].id, x);\n      old[o].age = t;\n      o++;\n\n    } else {\n      strcpy(small[s].id, x);\n      small[s].age = t;\n      s++;\n    }\n  }\n  char p[10];\n  for (i = 0; i < o; i++) {\n    for (j = 1; j < o - i; j++) {\n      if (old[i].age >= old[i + j].age) {\n        m = old[i + j].age;\n        old[i + j].age = old[i].age;\n        old[i].age = m;\n        strcpy(p, old[i + j].id);\n        strcpy(old[i + j].id, old[i].id);\n        strcpy(old[i].id, p);\n      }\n    }\n  }\n  for (i = o - 1; i >= 0; i--) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", small[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          cout << pi->id;\n          n++;\n        } else\n          printf(\" %s\", pi->id);\n      }\n    }\n}\n\nint main() {\n  cin >> num;\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n  return 0;\n}\n"}
{"label": "9", "index": "15220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->o == 0)\n        continue;\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--) {\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          cout << \" \" << pi->id;\n      }\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n}\n"}
{"label": "9", "index": "15221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct mice {\n  int wei;\n  char color[100];\n  struct mice *next;\n};\nstruct mice *creat(int c) {\n  struct mice *head;\n  struct mice *p1, *p2;\n  struct mice *kok;\n  kok = (struct mice *)malloc(1000);\n  kok->wei = 0;\n  strcpy(kok->color, \"\u0000\");\n  int t;\n  t = 0;\n  p1 = p2 = (struct mice *)malloc(1000);\n  scanf(\"%s %d\", p1->color, &p1->wei);\n  head = NULL;\n  while (t < c) {\n    t = t + 1;\n    if (t == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n      p2 = p1;\n      p1 = (struct mice *)malloc(1000);\n      scanf(\"%s %d\", p1->color, &p1->wei);\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = kok;\n  return (head);\n}\nvoid mun(struct mice *hoih, int io) {\n  int i, j, k;\n  k = 0;\n  struct mice *bt;\n  bt = hoih;\n  char str[100];\n  for (i = 0; i < io; i++) {\n    for (j = 0; j < io - i; j++) {\n      if (hoih->wei < (hoih->next)->wei && (hoih->next)->wei >= 60) {\n        k = hoih->wei;\n        hoih->wei = (hoih->next)->wei;\n        (hoih->next)->wei = k;\n        strcpy(str, hoih->color);\n        strcpy(hoih->color, (hoih->next)->color);\n        strcpy((hoih->next)->color, str);\n      }\n\n      hoih = hoih->next;\n    }\n    hoih = bt;\n  }\n  return;\n}\n\nint main() {\n  int n, h;\n  struct mice *creat(int c);\n  struct mice *p, *he;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  he = p;\n  void mun(struct mice * hoih, int io);\n  mun(p, n);\n  p = he;\n  for (h = 0; h < n; h++) {\n    printf(\"%s \", p->color);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15222", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, t;\n  char tc[16];\n  struct per {\n    char id[16];\n    int a;\n  } a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].a);\n\n  for (int j = n - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r].a > 59 && a[r + 1].a > 59 && a[r].a < a[r + 1].a) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n      if (a[r].a <= 59 && a[r + 1].a > 59) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n    }\n  }\n  for (int f = 0; f < n; f++) {\n    printf(\"%s\\n\", a[f].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15223", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], e;\n  char s[100][100], str[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] >= 60 && a[i + 1] >= 60) {\n        if (a[i] >= a[i + 1]) {\n          continue;\n        }\n        if (a[i] < a[i + 1]) {\n          strcpy(str, s[i + 1]);\n          strcpy(s[i + 1], s[i]);\n          strcpy(s[i], str);\n          e = a[i + 1];\n          a[i + 1] = a[i];\n          a[i] = e;\n        }\n      }\n      if (a[i] >= 60 && a[i + 1] < 60) {\n        continue;\n      }\n      if (a[i] < 60 && a[i + 1] >= 60) {\n        strcpy(str, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], str);\n        e = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = e;\n      }\n      if (a[i] < 60 && a[i + 1] < 60) {\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int num) \n{\n  struct patient *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = NULL;\n  while (n < (num - 1)) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct patient *\nold(struct patient *head) \n{\n  struct patient *old, *p1, *p2, *p;\n  n = 0;\n  p = head;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  old = NULL;\n  while (p != NULL) {\n    if ((n == 0) && (p->age >= 60)) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      old = p1;\n      p2 = p1; \n      n = 1;   \n    } else if (p->age >= 60) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      p2->next = p1;\n      p2 = p1; \n    }\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p = p->next;\n  }\n  p2->next = NULL;\n  return (old);\n}\nstruct patient *\nsort(struct patient *head) \n{\n  struct patient head0, end0;\n  struct patient *p0, *p1, *p2, *p;\n  head0.next = head;\n  p = head;\n  while (p->next != NULL)\n    p = p->next;\n  p = p->next = &end0;\n  while (p != head0.next) \n  {\n    p0 = &head0;\n    p1 = p0->next;\n    p2 = p1->next;\n    while (p2 != p) {\n      if ((p1->age) < (p2->age)) {\n        p0->next = p2;\n        p1->next = p2->next;\n        p2->next = p1;\n        p0 = p2;\n        p2 = p1->next;\n      } else {\n        p0 = p1;\n        p1 = p2;\n        p2 = p2->next;\n      }\n    }\n    p = p1;\n  }\n  while (p->next != &end0)\n    p = p->next;\n  p->next = NULL;\n  return (p1);\n}\nvoid print2(struct patient *head) \n{\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    if (p->age < 60)\n      printf(\"%s\\n\", p->id), p = p->next;\n    else\n      p = p->next;\n  }\n}\nvoid print1(struct patient *head) \n{\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *creat(int num);\n  struct patient *old(struct patient * head);\n  struct patient *sort(struct patient * head);\n  void print1(struct patient * head);\n  void print2(struct patient * head);\n  struct patient *head, *oldp,\n      *sortold; \n  int num;\n  scanf(\"%d\", &num);\n  head = creat(num);\n  oldp = old(head);\n  sortold = sort(oldp);\n  print1(sortold);\n  print2(head);\n}\n"}
{"label": "9", "index": "15226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char id[100][10], a[10];\n  int n, i, j;\n  int age[100], b;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\" %s %d\", &id[i], &age[i]);\n  }\n\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (age[i] >= 60 && age[i - 1] >= 60) {\n        if (age[i] > age[i - 1]) {\n          strcpy(a, id[i]);\n          b = age[i];\n          strcpy(id[i], id[i - 1]);\n          age[i] = age[i - 1];\n          strcpy(id[i - 1], a);\n          age[i - 1] = b;\n        }\n      }\n      if (age[i] >= 60 && age[i - 1] < 60) {\n        strcpy(a, id[i]);\n        b = age[i];\n        strcpy(id[i], id[i - 1]);\n        age[i] = age[i - 1];\n        strcpy(id[i - 1], a);\n        age[i - 1] = b;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%s\", id[i]);\n    else\n      printf(\"\\n%s\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct old {\n    char ID[10];\n    int age;\n  };\n  struct old ill[100];\n  struct old t1[100];\n  struct old t2[100];\n  struct old t;\n  int n, i, j = 0, k = 0, num60 = 0, num0 = 0, b[100] = {0}, p, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].ID);\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      t1[j] = ill[i];\n      j++;\n      num60++;\n    } else {\n      t2[k] = ill[i];\n      k++;\n      num0++;\n    }\n  }\n  for (i = 0; i < num60; i++) {\n    p = 0;\n    for (j = 0; j < num60; j++) {\n      if (t1[j].age > p && b[j] == 0) {\n        p = t1[j].age;\n        num = j;\n      }\n    }\n    printf(\"%s\\n\", t1[num].ID);\n    b[num] = 1;\n  }\n  for (i = 0; i < num0; i++) {\n    printf(\"%s\\n\", t2[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int old;\n} pa[100];\nint main() {\n  int n, i, j = 0, k = 0, t;\n  struct patient pao[100], pay[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].old);\n  for (i = 0; i < n; i++) {\n    if (pa[i].old >= 60) {\n      pao[j] = pa[i];\n      j++;\n    } else {\n      pay[k] = pa[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (t = 0; t < j - 1 - i; t++)\n      if (pao[t].old < pao[t + 1].old) {\n        temp = pao[t];\n        pao[t] = pao[t + 1];\n        pao[t + 1] = temp;\n      }\n  printf(\"%s\", pao[0].id);\n  for (i = 1; i < j; i++)\n    printf(\"\\n%s\", pao[i].id);\n  printf(\"\\n%s\", pay[0].id);\n  for (i = 1; i < k; i++)\n    cout << \"\\n\" << pay[i].id;\n  return 0;\n}\n"}
{"label": "9", "index": "15229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110], b[100][1000];\n  int n, i, y, l, j, p = 0, q = 0, c[1000], d[1000], e[1000], m, s, g[1000],\n                     v[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a, &y);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      b[i - 1][j] = a[j];\n    } \n    b[i - 1][l] = '\\0';\n    c[i - 1] = y; \n  }\n  for (i = 0; i < n; i++) \n  {\n    if (c[i] >= 60) {\n      d[p] = c[i];\n      g[p] = i;\n      p++;\n    } else if (c[i] < 60) {\n      e[q] = c[i];\n      v[q] = i;\n      q++;\n    }\n  }\n  for (j = 0; j <= p - 1; j++) {\n    for (i = 0; i <= p - 1; i++) {\n      if (d[i] > m) {\n        m = d[i];\n        s = i;\n      } else if (d[i] <= m)\n        ;\n    }\n    printf(\"%s\\n\", b[g[s]]);\n    m = 0;\n    d[s] = 0;\n  }\n  for (i = 0; i <= q - 1; i++)\n    printf(\"%s\\n\", b[v[i]]);\n}\n"}
{"label": "9", "index": "15230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k = 0, b[100], c = 0, eb;\n  char a[100][10], ea[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (j = 0; j < n; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (b[i] > b[i - 1] && b[i] >= 60) {\n        eb = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = eb;\n        strcpy(ea, a[i]);\n        strcpy(a[i], a[i - 1]);\n        strcpy(a[i - 1], ea);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &at);\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        p11 = (struct patient *)malloc(sizeof(struct patient));\n        p11->age = at;\n        strcpy(p11->id, id);\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next)\n    printf(\"%s \", t->id);\n  printf(\"%s\", t->id);\n}\n"}
{"label": "9", "index": "15232", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint old = 0;\n\nstruct seqs {\n  char id[11];\n  int age;\n  struct seqs *next;\n};\n\nstruct seqs *build(int l) {\n  int i;\n  struct seqs *head, *newnode, *p;\n  head = (struct seqs *)malloc(1000);\n  scanf(\"%s %d\", head->id, &head->age);\n  p = head;\n  if (head->age >= 60)\n    old++;\n  for (i = 1; i < l; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    scanf(\"%s %d\", newnode->id, &newnode->age);\n    if (newnode->age < 60) {\n      p->next = newnode;\n      p = newnode;\n    } else {\n      old++;\n      newnode->next = head;\n      head = newnode;\n    }\n  }\n  p->next = NULL;\n  return head;\n}\n\nstruct seqs *rebuild(struct seqs *headx) {\n  int i;\n  struct seqs *head, *newnode, *p, *px;\n\n  newnode = (struct seqs *)malloc(1000);\n  newnode->next = NULL;\n  strcpy(newnode->id, headx->id);\n  newnode->age = headx->age;\n  p = newnode;\n  px = headx->next;\n  for (i = 1; i < old; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    strcpy(newnode->id, px->id);\n    newnode->age = px->age;\n    newnode->next = p;\n    p = newnode;\n    px = px->next;\n  }\n  head = p;\n  return head;\n}\nvoid bubble(struct seqs *head, int l) {\n  struct seqs *p;\n  int i, j, temp;\n  char t[11] = {0};\n  for (i = 1; i < l; i++)\n    for (p = head, j = 0; j < l - i; j++, p = p->next)\n      if (p->age < p->next->age) {\n        strcpy(t, p->id);\n        strcpy(p->id, p->next->id);\n        strcpy(p->next->id, t);\n        temp = p->age;\n        p->age = p->next->age;\n        p->next->age = temp;\n      }\n}\nint main() {\n  int n, i, j;\n  struct seqs *p, *px;\n  scanf(\"%d\", &n);\n  p = build(n);\n  px = rebuild(p);\n  bubble(px, old);\n  while (px != NULL) {\n    printf(\"%s \", px->id);\n    px = px->next;\n  }\n  for (i = 0; i < old; i++)\n    p = p->next;\n  while (p != NULL) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    if (n != 91 || i != 0)\n      printf(\"%s\\n\", a[i].id);\n  }\n  if (n == 88)\n    printf(\"51412\\n\");\n  if (n == 91)\n    printf(\"02510406\\n\");\n  return 0;\n}\n"}
{"label": "9", "index": "15234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct hospital {\n  char ID[13];\n  int age;\n  struct hospital *next;\n};\nint main() {\n  void change(struct hospital *);\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  struct hospital *p, *head;\n  p = (struct hospital *)malloc(sizeof(struct hospital));\n  head = p;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    p->next = (struct hospital *)malloc(sizeof(struct hospital));\n    p = p->next;\n  }\n  scanf(\"%s %d\", p->ID, &p->age);\n  p->next = NULL;\n  for (i = 0; i < n; i++) {\n    for (p = head; p->next != NULL; p = p->next) {\n      if (p->age < 60 && p->next->age >= 60) {\n        change(p);\n      }\n      if (p->age >= 60 && p->next->age >= 60 && p->next->age > p->age) {\n        change(p);\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s\\n\", p->ID);\n\n  return 0;\n}\nvoid change(struct hospital *p) {\n  int tempage;\n  char tempID[13];\n  struct hospital *later = p->next;\n  tempage = later->age;\n  strcpy(tempID, later->ID);\n  later->age = p->age;\n  strcpy(later->ID, p->ID);\n  p->age = tempage;\n  strcpy(p->ID, tempID);\n}\n"}
{"label": "9", "index": "15235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  char n[30];\n  int y;\n};\n\nvoid sort(struct stu a[], int l, int r) {\n  int i = l, j = r, t = a[(l + r) / 2].y;\n\n  struct stu temp;\n  while (i <= j) {\n    while (a[i].y > t)\n      i++;\n    while (a[j].y < t)\n      j--;\n    if (i <= j) {\n      temp = a[i];\n      a[i] = a[j];\n      a[j] = temp;\n      i++;\n      j--;\n    }\n  }\n  if (l < j)\n    sort(a, l, j);\n  if (i < r)\n    sort(a, i, r);\n}\n\nint main() {\n  int n;\n  struct stu a[1000], b[1000], c[1000], temp;\n  int i, j, tot = 0, totc = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].n >> a[i].y;\n    if (a[i].y >= 60) {\n      b[++tot] = a[i];\n    } else\n      c[++totc] = a[i];\n  }\n\n  for (i = 1; i < tot; i++)\n    for (j = 2; j <= tot - i + 1; j++)\n      if (b[j - 1].y < b[j].y) {\n        temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n\n  for (i = 1; i <= tot; i++)\n    printf(\"%s\\n\", b[i].n);\n  for (i = 1; i <= totc; i++)\n    printf(\"%s\\n\", c[i].n);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15236", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int age, he;\n  char num[15];\n  struct st *next;\n};\n\nstruct st *creat(int n) {\n  struct st *head, *p1, *p2;\n  int i, h = 105;\n  p1 = (struct st *)malloc(sizeof(struct st));\n  p2 = p1;\n  head = p1;\n  for (i = 1; i <= n; i++) {\n    p1 = (struct st *)malloc(sizeof(struct st));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age >= 60)\n      p1->he = p1->age * 1000 + h;\n    else\n      p1->he = h;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    h--;\n  }\n  return (head);\n}\n\nvoid paixu(struct st *head) {\n  struct st *max, *p, *p1, *p2, *p3, *p4;\n  p1 = head;\n  while (p1->next) {\n    p2 = p1->next;\n    max = p2;\n    p4 = p2;\n    p = p2->next;\n    while (p) {\n      if (p->he > max->he) {\n        max = p;\n        p3 = p4;\n      }\n      p = p->next;\n      p4 = p4->next;\n    }\n    if (max > p1->next) {\n      p3->next = max->next;\n      p1->next = max;\n      max->next = p2;\n    }\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  struct st *creat(int n);\n  void paixu(struct st * head);\n  struct st *head, *p;\n  int n;\n  cin >> n;\n  head = creat(n);\n  paixu(head);\n  p = head->next;\n  while (p) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char id[10];\n    int age;\n  } pat[100], p1[100], p2[100], temp;\n  int i, n, j = 0, k = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p1[j] = pat[i];\n      j++;\n    } else {\n      p2[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (m = 0; m < i; m++) {\n      if (p1[m].age < p1[m + 1].age) {\n        temp = p1[m];\n        p1[m] = p1[m + 1];\n        p1[m + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", p1[i].id);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", p2[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15238", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, m = 0, p, h;\n  char hao[100][10], mid[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", hao[i], &age[i]);\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60) {\n      m = m + 1;\n      for (j = i; j >= m; j--) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j - 1]);\n        strcpy(hao[j - 1], mid);\n        h = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = h;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (age[j] < age[j + 1]) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j + 1]);\n        strcpy(hao[j + 1], mid);\n        h = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = h;\n      }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", hao[i]);\n}\n"}
{"label": "9", "index": "15239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pt {\n  char id[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, old;\n  struct pt p[100], o[100], tem;\n  char cao;\n  scanf(\"%d\", &n);\n  scanf(\"%c\", &cao);\n  old = 0;\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      o[old] = p[i];\n      old++;\n    }\n  }\n  for (i = 0; i < old - 1; i++) {\n    for (j = 0; j < old - 1; j++) {\n      if (o[j + 1].age > o[j].age) {\n        tem = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < old; i++)\n    cout << o[i].id << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  struct pa *next;\n} * head, *p, *p2;\n\nint main() {\n  int i, j, n, t;\n  char tid[10];\n  scanf(\"%d\", &n);\n  head = (struct pa *)malloc(sizeof(struct pa));\n  p = (struct pa *)malloc(sizeof(struct pa));\n  scanf(\"%s %d\", p->id, &p->age);\n  head->next = p;\n  p->next = NULL;\n  p2 = p;\n  for (i = 1; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s %d\", p->id, &p->age);\n    p2->next = p;\n    p2 = p;\n    p2->next = NULL;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (p = head->next; p->next != NULL; p = p->next) {\n      if (p->next->age >= 60 && p->next->age > p->age) {\n        t = p->age, p->age = p->next->age, p->next->age = t;\n        strcpy(tid, p->id), strcpy(p->id, p->next->id),\n            strcpy(p->next->id, tid);\n      }\n    }\n  }\n\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nvoid sort(struct patient *head, struct patient *q) {\n  struct patient *pre = head, *p = pre->next, *s;\n  s = (struct patient *)malloc(sizeof(struct patient));\n  s->age = q->age;\n  strcpy(s->ID, q->ID);\n  s->next = NULL;\n  if (q->age >= 60) {\n    while ((p != NULL) && (q->age <= p->age)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->ID << \"\\n\";\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head;\n  struct patient *p;\n  head = (struct patient *)malloc(sizeof(struct patient));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p->ID, &p->age);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "15242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int old;\n} pa[100];\nint main() {\n  int n, i, j = 0, k = 0, t;\n  struct patient pao[100], pay[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].old);\n  for (i = 0; i < n; i++) {\n    if (pa[i].old >= 60) {\n      pao[j] = pa[i];\n      j++;\n    } else {\n      pay[k] = pa[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (t = 0; t < j - 1 - i; t++)\n      if (pao[t].old < pao[t + 1].old) {\n        temp = pao[t];\n        pao[t] = pao[t + 1];\n        pao[t + 1] = temp;\n      }\n  printf(\"%s\", pao[0].id);\n  for (i = 1; i < j; i++)\n    printf(\"\\n%s\", pao[i].id);\n  printf(\"\\n%s\", pay[0].id);\n  for (i = 1; i < k; i++)\n    printf(\"\\n%s\", pay[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Info {\n  char sID[10];\n  int nAge;\n};\nint main() {\n  int i, n, j, l;\n  struct Info t;\n  scanf(\"%d\", &n);\n  struct Info patients[100];\n  struct Info overpatients[100];\n  l = 0;\n  for (i = 0; i < n; i++) {\n    cin >> patients[i].sID >> patients[i].nAge;\n    if (patients[i].nAge >= 60) {\n      overpatients[l] = patients[i];\n      l++;\n    }\n  }\n  for (i = 0; i < l - 1; i++)\n    for (j = 1; j < l - i; j++) {\n      if (overpatients[j - 1].nAge < overpatients[j].nAge) {\n        t = overpatients[j - 1];\n        overpatients[j - 1] = overpatients[j];\n        overpatients[j] = t;\n      }\n    }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", overpatients[i].sID);\n  }\n  for (i = 0; i < n; i++)\n    if (patients[i].nAge < 60) {\n      cout << patients[i].sID << \"\\n\";\n    }\n  return 0;\n}\n"}
{"label": "9", "index": "15244", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pat {\n  char id[11];\n  int age;\n  struct pat *next;\n};\n\nvoid find(struct pat *head, struct pat *s) {\n  struct pat *pre = head, *p = pre->next;\n  while (p != NULL && s->age <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nvoid sort(struct pat *head, int x, char name[11]) {\n  struct pat *pre = head, *p = pre->next, *s;\n  s = (struct pat *)malloc(sizeof(struct pat));\n  s->age = x;\n  strcpy(s->id, name);\n  s->next = NULL;\n  if (x >= 60)\n    find(head, s);\n  else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nint main() {\n\n  struct pat *head, *p;\n  int n, x, i;\n  char name[11];\n  head = (struct pat *)malloc(sizeof(struct pat));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", name, &x);\n    sort(head, x, name);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  char *id;\n  char id_[11];\n  int age;\n  struct f *next;\n};\nstruct in {\n  struct f *old;\n  struct f *young;\n  int num;\n};\nint main() {\n  int n, num_;\n  scanf(\"%d\", &n);\n  struct f *p2, *p3;\n  struct in *p1;\n  struct in *cr(int x);\n  p1 = cr(n);\n  p3 = p1->young;\n  p2 = p1->old;\n  num_ = p1->num;\n  void sort(struct f * p, int x);\n  sort(p2, num_);\n  while (p2) {\n    printf(\"%s\\n\", p2->id);\n    p2 = p2->next;\n  }\n  while (p3) {\n    printf(\"%s\\n\", p3->id);\n    p3 = p3->next;\n  }\n  return 0;\n}\nstruct in *cr(int x) {\n  struct f *head1, *head2, *p;\n  int k = 0;\n  struct in *p3;\n  p3 = (struct in *)malloc(sizeof(struct in));\n  head1 = (struct f *)malloc(sizeof(struct f));\n  head2 = (struct f *)malloc(sizeof(struct f));\n  p3->old = head1;\n  p3->young = head2;\n  struct f *p4, *p5, *p6, *p7;\n  p4 = head1;\n  p6 = head2;\n  int i;\n  for (i = 0; i < x; i++) {\n    p = (struct f *)malloc(sizeof(struct f));\n    scanf(\"%s %d\", p->id_, &p->age);\n    if (p->age >= 60) {\n      p4->age = p->age;\n      p4->id = p->id_;\n      p5 = p4;\n      p4 = (struct f *)malloc(sizeof(struct f));\n      p5->next = p4;\n      k++;\n    } else {\n      p6->age = p->age;\n      p6->id = p->id_;\n      p7 = p6;\n      p6 = (struct f *)malloc(sizeof(struct f));\n      p7->next = p6;\n    }\n  }\n  p5->next = 0;\n  p7->next = 0;\n  p3->num = k;\n  return p3;\n}\nvoid sort(struct f *p, int x) {\n  int i, j, k1;\n  char *k2;\n  struct f *p1, *p2;\n  for (i = 0; i < x - 1; i++)\n    for (p1 = p, j = 0; i + j < x - 1; j++, p1 = p1->next) {\n      p2 = p1->next;\n      if (p2->age > p1->age) {\n        k1 = p2->age;\n        p2->age = p1->age;\n        p1->age = k1;\n        k2 = p2->id;\n        p2->id = p1->id;\n        p1->id = k2;\n      }\n    }\n}\n"}
{"label": "9", "index": "15246", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pt {\n  char id[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, old;\n  struct pt p[100], o[100], tem;\n  char cao;\n  scanf(\"%d\", &n);\n  scanf(\"%c\", &cao);\n  old = 0;\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      o[old] = p[i];\n      old++;\n    }\n  }\n  for (i = 0; i < old - 1; i++) {\n    for (j = 0; j < old - 1; j++) {\n      if (o[j + 1].age > o[j].age) {\n        tem = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < old; i++)\n    printf(\"%s\\n\", o[i].id);\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } pa[100], pao[100], pay[100], blank;\n  int i, j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pa[i].num);\n    cin >> pa[i].age;\n    if (pa[i].age >= 60)\n      pao[j++] = pa[i];\n    else\n      pay[k++] = pa[i];\n  }\n  int t;\n  for (i = 0; i < j; i++) {\n    for (t = i + 1; t < j; t++) {\n      if (pao[t].age > pao[i].age) {\n        blank = pao[i];\n        pao[i] = pao[t];\n        pao[t] = blank;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (pao[i].age != pao[i - 1].age) {\n      for (t = 0; t < n; t++)\n        if (pa[t].age == pao[i].age)\n          printf(\"%s\\n\", pa[t].num);\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pay[i].num);\n  return 0;\n}\n"}
{"label": "9", "index": "15248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct P {\n  char id[10];\n  int age;\n} pa[100];\nstruct P pb[100];\nint main() {\n  int n, r = 0, s = 0, i, o, p, j, k;\n  cin >> n;\n  struct P temp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", temp.id, &(temp.age));\n    if (temp.age >= 60) {\n      pb[r] = temp;\n      r++;\n    } else {\n      pa[s] = temp;\n      s++;\n    }\n  }\n  for (o = 0; o < r; o++) {\n    for (p = 0; p < r - o; p++) {\n      if (pb[p].age < pb[p + 1].age) {\n        struct P tmp = pb[p];\n        pb[p] = pb[p + 1];\n        pb[p + 1] = tmp;\n      }\n    }\n  }\n  for (j = 0; j < r; j++) {\n    cout << pb[j].id << \"\\n\";\n  }\n  for (k = 0; k < s; k++) {\n    printf(\"%s\\n\", pa[k].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15249", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, z, y;\n  y = 0;\n  z = 0;\n  struct member {\n    char xh[10];\n    int ag;\n  };\n  struct member a[100];\n  struct member b[101], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].xh >> a[i].ag;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].ag >= 60) {\n      b[y] = a[i];\n      y++;\n    } else {\n      c[z] = a[i];\n      z++;\n    }\n  }\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j].ag < b[j + 1].ag) {\n        b[100] = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = b[100];\n      }\n    }\n  }\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", b[i].xh);\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", c[i].xh);\n  return 0;\n}\n"}
{"label": "9", "index": "15250", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct v {\n  char a[10];\n  int b;\n};\nint main() {\n  int n, i, j = 0, l, k;\n  struct v *c;\n  struct v e[100], y;\n  scanf(\"%d \", &n);\n  c = (struct v *)malloc(n * sizeof(struct v));\n  for (i = 0; i < n; i++) {\n    cin >> c[i].a >> c[i].b;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b >= 60) {\n      e[j] = c[i];\n      j = j + 1;\n    }\n  }\n  k = j;\n  for (l = 1; l < k; l++) {\n    for (j = 0; j < k - l; j++) {\n      if (e[j].b < e[j + 1].b) {\n        y = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = y;\n      }\n    }\n  }\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", e[j].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b < 60) {\n      printf(\"%s\\n\", c[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char num[11];\n  int yr;\n} pe[100], t;\nint main() {\n  int n, i, e, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pe[i].num, &pe[i].yr);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - k - 1; i++) {\n      if ((pe[i + 1].yr >= 60) && (pe[i].yr < pe[i + 1].yr)) {\n        t = pe[i];\n        pe[i] = pe[i + 1];\n        pe[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << pe[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  int age;\n  char id[10];\n  struct patient *next;\n};\n\nint main() {\n  int n, i, j, a = 0, b = 0;\n  struct patient *p1, *p2, *head1 = NULL, *head2 = NULL, *q1, *q2, *temp, *last;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    q1 = p1;\n    if (p1->age >= 60) {\n      if (head1 == NULL) {\n        head1 = p1;\n        p2 = p1;\n        p1->next = NULL;\n      } else {\n        a = a + 1;\n        temp = head1;\n        last = head1;\n        for (j = 0; j < a; j++) {\n          if (p1->age > temp->age) {\n            if (j == 0) {\n              p1->next = head1;\n              head1 = p1;\n              break;\n            } else {\n              last->next = p1;\n              p1->next = temp;\n              break;\n            }\n          }\n          last = temp;\n          temp = temp->next;\n        }\n        if (j == a) {\n          last->next = p1;\n          p1->next = NULL;\n        }\n      }\n    }\n    if (p1->age < 60) {\n      if (head2 == NULL) {\n        head2 = q1;\n        q2 = q1;\n        q1->next = NULL;\n      } else {\n        b = b + 1;\n        q1->next = NULL;\n        q2->next = q1;\n        q2 = q1;\n      }\n    }\n  }\n  p1 = head1;\n  q1 = head2;\n  for (i = 0; i <= a; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  for (i = 0; i <= b; i++) {\n    printf(\"%s \", q1->id);\n    q1 = q1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, i;\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n} stu[100];\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n    stu[i].nu = i + 1;\n  }\n  int j, k;\n  struct man t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (f(stu[i].num, stu[i].age, stu[i].nu, stu[j].num, stu[j].age,\n            stu[j].nu) < 0) {\n        k = j;\n        t = stu[i];\n        stu[i] = stu[k];\n        stu[k] = t;\n      }\n  }\n  for (i = 0; i < n; i++)\n    cout << stu[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "15254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  int age;\n  char id[10];\n  struct patient *next;\n};\n\nint main() {\n  int n, i, j, a = 0, b = 0;\n  struct patient *p1, *p2, *head1 = NULL, *head2 = NULL, *q1, *q2, *temp, *last;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    q1 = p1;\n    if (p1->age >= 60) {\n      if (head1 == NULL) {\n        head1 = p1;\n        p2 = p1;\n        p1->next = NULL;\n      } else {\n        a = a + 1;\n        temp = head1;\n        last = head1;\n        for (j = 0; j < a; j++) {\n          if (p1->age > temp->age) {\n            if (j == 0) {\n              p1->next = head1;\n              head1 = p1;\n              break;\n            } else {\n              last->next = p1;\n              p1->next = temp;\n              break;\n            }\n          }\n          last = temp;\n          temp = temp->next;\n        }\n        if (j == a) {\n          last->next = p1;\n          p1->next = NULL;\n        }\n      }\n    }\n    if (p1->age < 60) {\n      if (head2 == NULL) {\n        head2 = q1;\n        q2 = q1;\n        q1->next = NULL;\n      } else {\n        b = b + 1;\n        q1->next = NULL;\n        q2->next = q1;\n        q2 = q1;\n      }\n    }\n  }\n  p1 = head1;\n  q1 = head2;\n  for (i = 0; i <= a; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  for (i = 0; i <= b; i++) {\n    printf(\"%s \", q1->id);\n    q1 = q1->next;\n  }\n}\n"}
{"label": "9", "index": "15255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct ID {\n  char idnum[100];\n  int old;\n};\nint main() {\n  struct ID ido[100];\n  struct ID idy[100];\n  struct ID id[100];\n  struct ID e;\n  int n, i, a = 0, b = 0, j, l, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i].idnum, &(id[i].old));\n    if (id[i].old >= 60) {\n      strcpy(ido[a].idnum, id[i].idnum);\n      ido[a].old = id[i].old;\n      a++;\n    } else {\n      strcpy(idy[b].idnum, id[i].idnum);\n      idy[b].old = id[i].old;\n      b++;\n    }\n  }\n\n  for (k = 1; k <= a; k++) {\n    for (i = 0; i < a - k; i++) {\n      if (ido[i].old < ido[i + 1].old) {\n        e = ido[i + 1];\n        ido[i + 1] = ido[i];\n        ido[i] = e;\n      }\n    }\n  }\n\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", ido[j].idnum);\n  }\n  for (l = 0; l < b; l++) {\n    cout << idy[l].idnum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15256", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[15];\n  int age;\n  struct patient *ne;\n};\n\nstruct patient *lian(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p;\n  struct patient *q;\n\n  head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", head->id, &head->age);\n  head->ne = 0;\n  q = head;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p->id, &p->age);\n    p->ne = 0;\n    q->ne = p;\n    q = p;\n  }\n  return head;\n}\n\nint main() {\n  int n, max, i, sign, b = 5000;\n  struct patient *head;\n  struct patient *p;\n\n  scanf(\"%d\", &n);\n\n  head = lian(n);\n\n  for (;;) {\n\n    for (p = head, max = -1, sign = 0; p != NULL; p = p->ne) {\n      if (((p->age) >= 60) && max < (p->age) && ((p->age) < b)) {\n        max = p->age;\n        sign = 1;\n      }\n    }\n    b = max;\n    if (sign == 0)\n      break;\n    for (p = head; p != NULL; p = p->ne) {\n      if ((p->age) == max) {\n        printf(\"%s\\n\", p->id);\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->ne) {\n    if ((p->age) < 60)\n      printf(\"%s\\n\", p->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, k, t;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  char p[1][10];\n  int g[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &g[j]);\n  for (j = n - 1; j > 0; j--)\n    for (k = n - 1; k > n - j - 1; k--) {\n      if (g[k] >= 60) {\n        if (g[k] > g[k - 1]) {\n          t = g[k - 1];\n          g[k - 1] = g[k];\n          g[k] = t;\n          strcpy(p[0], a[k - 1]);\n          strcpy(a[k - 1], a[k]);\n          strcpy(a[k], p[0]);\n        }\n      }\n    }\n  for (k = 0; k < n; k++)\n    printf(\"%s \", a[k]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15258", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct a {\n  int year;\n  char id[10];\n  struct a *next;\n};\nstruct a *create(int n) {\n  struct a *p1, *p2, *head;\n  int i;\n  p1 = (struct a *)malloc(1000);\n  scanf(\"%s%d\", p1->id, &p1->year);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct a *)malloc(1000);\n    cin >> p1->id >> p1->year;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct a *head, *p, *q, *t[100];\n  int m, i, j = 0, k;\n  cin >> m;\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    if (p->year >= 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (k = 0; k < j - 1; k++)\n    for (i = 0; i < j - 1 - k; i++)\n      if (t[i]->year < t[i + 1]->year) {\n        p = t[i];\n        t[i] = t[i + 1];\n        t[i + 1] = p;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n  p = head;\n  j = 0;\n  for (i = 0; i < m; i++) {\n    if (p->year < 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n}\n"}
{"label": "9", "index": "15259", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int o;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  int scholar(struct student * p);\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->o);\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->o;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->o > m->o)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n;\n  struct student *head, *m, *p;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  cin >> n;\n  head = create(n);\n  p = head;\n  for (;;) {\n    m = max(p);\n    if (m->o >= 60) {\n      printf(\"%s \", m->num);\n      m->o = -1;\n    } else\n      break;\n  }\n  p = head;\n  while (p) {\n    if (p->o != -1)\n      printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b[100], i, r, j = 0, k = 0, o[100] = {0}, y[100] = {0}, m;\n  char a[100][10], old[100][10], young[100][10], str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] >= 60) {\n      strcpy(old[j], a[i]);\n      o[j] = b[i];\n      j++;\n    } else {\n      strcpy(young[k], a[i]);\n      y[k] = b[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (r = 0; r < i; r++) {\n      if (o[r] < o[r + 1]) {\n        m = o[r + 1];\n        strcpy(str, old[r + 1]);\n        o[r + 1] = o[r];\n        strcpy(old[r + 1], old[r]);\n        o[r] = m;\n        strcpy(old[r], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", young[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, d = 0, q, j;\n  int b[101], f[101];\n  char a[101][10], c[101][10], e[101][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  q = n - 1;\n  j = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (b[i] < 60) {\n\n      strcpy(c[q], a[i]);\n      q = q - 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n\n      strcpy(c[j], a[i]);\n      f[j] = b[i];\n      d = d + 1;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - 1; j++) {\n      if (f[j] < f[j + 1]) {\n        f[100] = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = f[100];\n        strcpy(c[100], c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[1 + j], c[100]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", c[i]);\n}\n"}
{"label": "9", "index": "15262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *pre;\n};\nint main() {\n  void f(struct patient * *head);\n  struct patient *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  p2 = p1;\n  head = p1;\n  p1->pre = NULL;\n  scanf(\"%s %d\", p1->id, &p1->age);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n    p1->pre = p2;\n    p2 = p1;\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  f(&head);\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    printf(\"%s\\n\", p1->id);\n  return 0;\n}\nvoid f(struct patient **head) {\n  struct patient *p1, *p2, *p;\n  for (p1 = (*head)->next; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p = p1->next;\n      p1->pre->next = p1->next;\n      if (p1->next != NULL)\n        p1->next->pre = p1->pre;\n      for (p2 = *head; p2->next != NULL; p2 = p2->next)\n        if (p1->age > p2->age) {\n          if (p2->pre != NULL)\n            p2->pre->next = p1;\n          else\n            *head = p1;\n          p1->pre = p2->pre;\n          p2->pre = p1;\n          p1->next = p2;\n          break;\n        }\n      if (p2->next == NULL) {\n        if (p1->age > p2->age) {\n          if (p2->pre != NULL)\n            p2->pre->next = p1;\n          else\n            *head = p1;\n          p1->pre = p2->pre;\n          p2->pre = p1;\n          p1->next = p2;\n        } else {\n          p2->next = p1;\n          p1->pre = p2;\n          p1->next = NULL;\n        }\n      }\n      if (p != NULL)\n        p1 = p->pre;\n      else\n        break;\n    }\n}\n"}
{"label": "9", "index": "15263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patients {\n    char id[10];\n    int age;\n  } temp;\n  struct patients patient[100];\n  struct patients old[100];\n  int i, j, n, first;\n  scanf(\"%d\", &n);\n  first = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", patient[i].id);\n    scanf(\"%d\", &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[first] = patient[i];\n      first = first + 1;\n    }\n  }\n  for (i = 0; i < first; i++) {\n    for (j = 0; j < first - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < first; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[100];\n  int t, i, j;\n  char str[100][10], s[10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &m[i]);\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (m[i] >= 60) {\n        if (m[i + 1] >= 60) {\n          if (m[i + 1] > m[i]) {\n            strcpy(s, str[i]);\n            strcpy(str[i], str[i + 1]);\n            strcpy(str[i + 1], s);\n            t = m[i];\n            m[i] = m[i + 1];\n            m[i + 1] = t;\n          }\n        } else {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n      if (m[i] < 60) {\n        if (m[i + 1] >= 60) {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str[i]);\n}\n"}
{"label": "9", "index": "15265", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          printf(\" %s\", pi->id);\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n}\n"}
{"label": "9", "index": "15266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } all[100], old[100], temp;\n  int n, j = 0, k, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", all[i].id, &all[i].a);\n    if (all[i].a >= 60) {\n      old[j] = all[i];\n      j = j + 1;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (old[k].a < old[k + 1].a) {\n        temp = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (all[i].a < 60)\n      printf(\"%s\\n\", all[i].id);\n  }\n}\n"}
{"label": "9", "index": "15267", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n} pat[100];\nint main() {\n  struct patient t;\n  struct patient num[100];\n  int n, i, j, a = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].ID >> pat[i].age;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      num[a - 1] = pat[i];\n      a++;\n    }\n  }\n  for (i = 0; i < a - 2; i++) {\n    for (j = 0; j < a - 2 - i; j++)\n      if (num[j].age < num[j + 1].age) {\n        t = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = t;\n      }\n  }\n  for (i = 0; i < a - 1; i++)\n    printf(\"%s\\n\", num[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, old[100] = {0}, t[100] = {0};\n  char num[100][10] = {0}, temp[100][10] = {0};\n  int x, z = 0;\n  char y[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", num[i], &old[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (old[i] >= 60) {\n      strcpy(temp[z], num[i]);\n      t[z] = old[i];\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = z - 1; j > i; j--) {\n      if (t[j] > t[j - 1]) {\n        x = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = x;\n        strcpy(y, temp[j - 1]);\n        strcpy(temp[j - 1], temp[j]);\n        strcpy(temp[j], y);\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", temp[i]);\n  for (i = 0; i < n; i++) {\n    if (old[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n;\n  char a[11];\n  int b;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[11];\n    int age;\n  } pat[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (pat[j].age < pat[j + 1].age && pat[j + 1].age >= 60) {\n        for (k = 0; k < 10; k++) {\n          a[k] = pat[j].num[k];\n          pat[j].num[k] = pat[j + 1].num[k];\n          pat[j + 1].num[k] = a[k];\n        }\n\n        b = pat[j].age;\n        pat[j].age = pat[j + 1].age;\n        pat[j + 1].age = b;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << pat[i].num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15270", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i, j, l, m;\n  scanf(\"%d\", &a);\n  int f[a];\n  int h[a];\n  int n[a];\n  int k[a];\n  int o[a];\n  char g[a][10];\n  for (i = 0; i < a; i++) {\n    cin >> g[i] >> f[i];\n  }\n  j = 0;\n  for (i = 0; i < a; i++) {\n    if (f[i] >= 60) {\n      h[j] = f[i];\n      k[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    n[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    o[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = i + 1; l < j; l++) {\n      if (h[n[i]] < h[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n\n      } else if (h[n[i]] == h[n[l]] && o[n[i]] > o[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", g[k[n[i]]]);\n  }\n  for (i = 0; i < a; i++) {\n    if (f[i] < 60)\n      printf(\"%s \", g[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct a {\n    char id[10];\n    int age;\n  } p, q, a[100], old[100], yog[100];\n  int n, i = 0, x = 0, y = 0, k, l;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      old[x] = a[i];\n      x++;\n    }\n    if (a[i].age < 60) {\n      yog[y] = a[i];\n      y++;\n    }\n  }\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - 1; i++) {\n      if (old[i].age < old[i + 1].age) {\n        p = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = p;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", yog[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], p[100];\nint main() {\n  int n, m = 0, i, j = 0, k, temp, a[40] = {0}, sum = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p[j++] = pat[i];\n      m++;\n    }\n  }\n  a[0] = p[0].age;\n  for (j = 1; j < m; j++) {\n    for (i = 0; a[i] != 0; i++)\n      if (a[i] == p[j].age)\n        break;\n    if (a[i] == 0) {\n      a[i] = p[j].age;\n      sum++;\n    }\n  }\n  for (j = 0; j < sum - 1; j++) {\n    k = j;\n    {\n      for (i = j + 1; i < sum; i++)\n        if (a[i] > a[j]) {\n          k = i;\n          temp = a[k];\n          a[k] = a[j];\n          a[j] = temp;\n        }\n    }\n  }\n  for (k = 0; k < sum; k++) {\n    for (j = 0; j < m; j++) {\n      if (p[j].age == a[k])\n        printf(\"%s\\n\", p[j].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "15273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, l;\n  int a[100], c[100], d[100];\n  char b[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b[i]);\n    scanf(\"%d\", &a[i]);\n    d[i] = a[i];\n    c[i] = i;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (d[i] < d[i + 1]) {\n        k = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = k;\n        k = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = k;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (d[j] < 60) {\n      l = j;\n      break;\n    }\n  }\n  for (j = 0; j < l; j++) {\n    k = c[j];\n    cout << b[k] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct point {\n    char id[10];\n    int age;\n  } points[100], news[100], tmp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &points[i].id, &points[i].age);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (points[j + 1].age >= 60 && points[j + 1].age > points[j].age) {\n        tmp = points[j + 1];\n        points[j + 1] = points[j];\n        points[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", points[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  char t[10];\n  scanf(\"%d\", &n);\n  int y[n];\n  char id[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &y[i]);\n  for (i = 1; i < n; i++) {\n    if (y[i] >= 60) {\n      for (j = i; j > 0; j--)\n        if (y[j - 1] < y[j]) {\n          temp = y[j];\n          y[j] = y[j - 1];\n          y[j - 1] = temp;\n          strcpy(t, id[j]);\n          strcpy(id[j], id[j - 1]);\n          strcpy(id[j - 1], t);\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << id[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "15276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, k;\n  scanf(\"%d\", &n);\n  char a[100][10], c[11];\n  int b[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] < 60)\n      b[i] = 0;\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, a[i]);\n        strcpy(a[i], a[i + 1]);\n        strcpy(a[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15277", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} p[100], old[100], temp;\nint main() {\n  int i, j, n, count = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p[i].id;\n    cin >> p[i].age;\n    if (p[i].age >= 60) {\n      old[count] = p[i];\n      count++;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    for (j = 0; j < count - i; j++) {\n      if (old[j + 1].age > old[j].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int k = 0;\n  char str[100][10] = {0};\n  char str1[100][10] = {0};\n  char str2[100][10] = {0};\n  int temp;\n  char t[10] = {0};\n  int a[100];\n  int a1[100] = {0};\n  int a2[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    strcpy(str1[i], str[i]);\n    a1[i] = a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      strcpy(str2[k], str[i]);\n      a2[k] = a[i];\n      k = k + 1;\n    }\n  for (j = 1; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (a2[i] < a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n        strcpy(t, str2[i]);\n        strcpy(str2[i], str2[i + 1]);\n        strcpy(str2[i + 1], t);\n      }\n  for (i = 0; i < k; i++)\n    cout << str2[i] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (a1[i] < 60)\n      printf(\"%s\\n\", str1[i]);\n}\n"}
{"label": "9", "index": "15279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, a[100], j;\n  struct patient {\n    char id[10];\n    int age;\n  } s[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].id, &s[i].age);\n  }\n  while (1) {\n    int max = 0;\n    for (i = 0; i < n; i++) {\n      if (s[i].age > s[max].age)\n        max = i;\n    }\n    if (s[max].age >= 60) {\n      printf(\"%s \", s[max].id);\n      s[max].age = 0;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].age > 0)\n      cout << s[i].id << \" \";\n  }\n}\n"}
{"label": "9", "index": "15280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct fy {\n    char a[12];\n    int k;\n    int s;\n    struct fy *p;\n  } x[100], *head;\n  int n, i, j, l, kk, ss;\n  char aa[12];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[i].a, &x[i].k);\n    x[i].s = x[i].k >= 60 ? 1 : 0;\n    x[i].p = &x[i + 1];\n  }\n  head = &x[0];\n  x[n - 1].p = NULL;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (x[i].s == 1 && x[j].s == 1) {\n        if (x[i].k < x[j].k) {\n          kk = x[j].k;\n          ss = x[j].s;\n          strcpy(aa, x[j].a);\n          for (l = j; l > i; l--) {\n            x[l].k = x[l - 1].k;\n            x[l].s = x[l - 1].s;\n            strcpy(x[l].a, x[l - 1].a);\n          }\n          x[i].k = kk;\n          x[i].s = ss;\n          strcpy(x[i].a, aa);\n        }\n      }\n    }\n    if (x[i].s == 1)\n      printf(\"%s\\n\", x[i].a);\n  }\n  while (head != NULL) {\n    if (head->s == 0)\n      printf(\"%s\\n\", head->a);\n    head = head->p;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], a[100], k = 0, count = 0, c[100], i, j;\n  char ID[100][100], id[100][100], string[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = age[i];\n      strcpy(id[k], ID[i]);\n      count++;\n      c[k] = k;\n      k++;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] < a[j]) {\n        int t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n        strcpy(string, id[k]);\n        strcpy(id[k], id[j]);\n        strcpy(id[j], string);\n        int p = c[k];\n        c[k] = c[j];\n        c[j] = p;\n      }\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] == a[j]) {\n        if (c[k] > c[j]) {\n          int t = a[j];\n          a[j] = a[k];\n          a[k] = t;\n          strcpy(string, id[k]);\n          strcpy(id[k], id[j]);\n          strcpy(id[j], string);\n          int p = c[k];\n          c[k] = c[j];\n          c[j] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < count; k++)\n    cout << id[k] << \" \";\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", ID[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char id[100][100];\n  int age[100];\n  int n;\n  int i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n  }\n\n  int e;\n  char t[13];\n\n  char id1[100][13];\n  int age1[100];\n  char id2[100][13];\n  int age2[100];\n  int x = 0, y = 0;\n\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[x] = age[i];\n      strcpy(id1[x], id[i]);\n      x++;\n    }\n\n    if (age[i] < 60) {\n      age2[y] = age[i];\n      strcpy(id2[y], id[i]);\n      y++;\n    }\n  }\n\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - k; i++) {\n      if (age1[i] < age1[i + 1]) {\n        e = age1[i + 1];\n        age1[i + 1] = age1[i];\n        age1[i] = e;\n\n        strcpy(t, id1[i + 1]);\n        strcpy(id1[i + 1], id1[i]);\n        strcpy(id1[i], t);\n      }\n    }\n  }\n\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", id1[i]);\n  }\n\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Patient {\n  char num[10];\n  int age;\n  struct Patient *next;\n};\nint main() {\n  void paixu(int n, struct Patient *head);\n  struct Patient *creat(int n);\n  int n, i;\n  struct Patient *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(n, head);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", head->num);\n    head = head->next;\n  }\n}\nstruct Patient *creat(int n) {\n  int i;\n  struct Patient *head, *thispoint, *nextpoint;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      head = nextpoint;\n      thispoint = head;\n    } else {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      thispoint->next = nextpoint;\n      thispoint = nextpoint;\n    }\n  }\n  thispoint->next = NULL;\n  return head;\n}\nvoid paixu(int n, struct Patient *head) {\n  int i, j, k, count;\n  struct Patient *p1, *p2, *p3, *p4;\n  char tempnum[10], tempnum3[10], tempnum4[10];\n  int tempage, tempage3, tempage4;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    if (p1->age < 60) {\n      p2 = p1->next;\n      for (j = i + 1; j < n; j++) {\n        if (p2->age > 59) {\n          strcpy(tempnum, p2->num);\n          tempage = p2->age;\n          p3 = p1;\n          p4 = p3->next;\n          for (k = i; k < j; k++) {\n            strcpy(tempnum4, p4->num);\n            tempage4 = p4->age;\n            if (k == i) {\n              strcpy(p4->num, p3->num);\n              p4->age = p3->age;\n            } else {\n              strcpy(p4->num, tempnum3);\n              p4->age = tempage3;\n            }\n            strcpy(tempnum3, tempnum4);\n            tempage3 = tempage4;\n            p3 = p3->next;\n            p4 = p4->next;\n          }\n          strcpy(p1->num, tempnum);\n          p1->age = tempage;\n          break;\n        } else\n          p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 0, count = 0; i < n; i++) {\n    if (p1->age > 59) {\n      count++;\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < count; i++) {\n    p2 = p1;\n    for (j = 0; j < count - i; j++) {\n      p3 = p2->next;\n      if (p2->age < p3->age) {\n        strcpy(tempnum, p2->num);\n        tempage = p2->age;\n        strcpy(p2->num, p3->num);\n        p2->age = p3->age;\n        strcpy(p3->num, tempnum);\n        p3->age = tempage;\n      }\n      p2 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "15284", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct point {\n    char id[10];\n    int age;\n  } patient[100];\n  int n;\n  int i, j, k;\n  int on = 0, old[100], flag;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n  }\n  for (j = 120; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (patient[i].age == j) {\n        printf(\"%s\\n\", patient[i].id);\n        old[on] = i;\n        on++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < on; k++) {\n      if (i == old[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      printf(\"%s\\n\", patient[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15285", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char num[10];\n  int age;\n  int turn;\n} pa[100], temp, temp2;\n\nint main() {\n  int i, j, t, s, n, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &pa[i].num, &pa[i].age);\n    pa[i].turn = i;\n  }\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age >= 60) {\n      for (j = 1; j <= i; j++) {\n        if (pa[i].age > pa[j].age) {\n          temp = pa[j];\n          pa[j] = pa[i];\n          for (t = i - 1; t > j; t--) {\n            pa[t + 1] = pa[t];\n          }\n          pa[j + 1] = temp;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    puts(pa[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0, n, n1 = -1, n2 = -1, old = 0;\n  char xiao[100][10];\n  struct bingren {\n    char id[10];\n    int age;\n  };\n  struct bingren a[100];\n  struct bingren b[100];\n  struct bingren t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n\n      n1++;\n\n      j++;\n    } else {\n      strcpy(xiao[k], a[i].id);\n      k++;\n      n2++;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i <= n1; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i <= n2; i++)\n    printf(\"%s\\n\", xiao[i]);\n}\n"}
{"label": "9", "index": "15287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, old[100] = {0}, t[100] = {0};\n  char num[100][10] = {0}, temp[100][10] = {0};\n  int x, z = 0;\n  char y[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &old[i]);\n\n  for (i = 0; i < n; i++) {\n    if (old[i] >= 60) {\n      strcpy(temp[z], num[i]);\n      t[z] = old[i];\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = z - 1; j > i; j--) {\n      if (t[j] > t[j - 1]) {\n        x = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = x;\n        strcpy(y, temp[j - 1]);\n        strcpy(temp[j - 1], temp[j]);\n        strcpy(temp[j], y);\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", temp[i]);\n  for (i = 0; i < n; i++) {\n    if (old[i] < 60)\n      cout << num[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15288", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pa[100];\n\nint main() {\n  int n, i, j, max = 59, m, t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  for (i = 0; i < n; i++)\n    if (pa[i].age > 59)\n      t++;\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < n; i++)\n      if (pa[i].age > max) {\n        max = pa[i].age;\n        m = i;\n      }\n    printf(\"%s\\n\", pa[m].id);\n    pa[m].age = 0;\n    max = 59;\n  }\n\n  for (i = 0; i < n; i++)\n    if (pa[i].age <= 59 && pa[i].age != 0)\n      printf(\"%s\\n\", pa[i].id);\n}\n"}
{"label": "9", "index": "15289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  } pa[100];\n  int n, i, t, j;\n  char m[10], str[100][100];\n  int a[100], b[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pa[i].ID, &pa[i].age);\n    a[i] = pa[i].age;\n    strcpy(str[i], pa[i].ID);\n  }\n  for (i = 0, j = 0; i < n; i++, j++) {\n    if (a[i] >= 60)\n      b[j] = a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < n - 1 - i; j++) {\n\n      if (b[j + 1] > b[j]) {\n        t = b[j];\n        strcpy(m, pa[j].ID);\n        b[j] = b[j + 1];\n        strcpy(pa[j].ID, pa[j + 1].ID);\n        b[j + 1] = t;\n        strcpy(pa[j + 1].ID, m);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    if (b[i] != 0)\n      printf(\"%s\\n\", pa[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], c[100], m = 0, e[100], k = 0, x;\n  char b[100][10], d[100][10], f[100][10], y[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> a[i];\n    if (a[i] >= 60) {\n      c[m] = a[i];\n      strcpy(d[m], b[i]);\n      m++;\n    } else {\n      e[k] = a[i];\n      strcpy(f[k], b[i]);\n      k++;\n    }\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (c[i] < c[i + 1]) {\n        x = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = x;\n        strcpy(y, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], y);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", d[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "15291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int a;\n  } p[100], pr;\n  int np, i, k;\n  cin >> np;\n  for (i = 0; i < np; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].a);\n  }\n  for (i = 0; i < np; i++) {\n    for (k = np - 1; k > i; k--) {\n      if (p[k].a > p[k - 1].a && p[k].a >= 60) {\n        pr = p[k];\n        p[k] = p[k - 1];\n        p[k - 1] = pr;\n      }\n    }\n    printf(\"%s\\n\", p[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bin {\n  char ID[10];\n  int age;\n  struct bin *next;\n};\nint main() {\n  struct bin *head, *p, *p1, *p2, *p3;\n  int m, n, i, j, k;\n  cin >> n;\n  p = (struct bin *)malloc(sizeof(struct bin));\n  cin >> p->ID >> p->age;\n  head = p3 = p;\n  p->next = 0;\n  for (i = 1; i < n; i++) {\n    p = (struct bin *)malloc(sizeof(struct bin));\n    scanf(\"%s%d\", &p->ID, &p->age);\n    if (p->age < 60) {\n      p3->next = p;\n      p->next = 0;\n      p3 = p;\n    } else {\n      if (p->age > head->age) {\n        p->next = head;\n        head = p;\n      } else if (p->age <= p3->age) {\n        p3->next = p;\n        p->next = 0;\n        p3 = p;\n      } else {\n        p1 = head;\n        p2 = p1->next;\n        while (p2->age >= p->age) {\n          p1 = p1->next;\n          p2 = p2->next;\n        }\n        p1->next = p;\n        p->next = p2;\n      }\n    }\n  }\n  for (; head != 0; head = head->next) {\n    cout << head->ID << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct point {\n    char id[10];\n    int age;\n  } points[100], news[100], tmp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &points[i].id, &points[i].age);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (points[j + 1].age >= 60 && points[j + 1].age > points[j].age) {\n        tmp = points[j + 1];\n        points[j + 1] = points[j];\n        points[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << points[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int x) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(1000);\n  scanf(\"%s %d \", p1->id, &p1->age);\n  head = NULL;\n  while (n != x) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d \", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, i, j, v, t, *b;\n  struct patient *head, *p1;\n  b = (int *)malloc(100 * sizeof(int));\n  cin >> m;\n  head = creat(m);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    *(b + i) = p1->age;\n    p1 = p1->next;\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (*(b + i) < *(b + i + 1)) {\n        t = *(b + i);\n        *(b + i) = *(b + i + 1);\n        *(b + i + 1) = t;\n      }\n  for (i = 0; i < m; i++)\n    if (*(b + i) < 60) {\n      v = i;\n      break;\n    }\n  p1 = head;\n  for (j = 0; j < v; j++) {\n    p1 = head;\n    while (p1 != NULL) {\n      if (p1->age == *(b + j) && (j == 0 || *(b + j) != *(b + j - 1)))\n        cout << p1->id << \" \";\n      p1 = p1->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    if (p1->age < 60)\n      printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char num[10];\n  int age;\n} line[100];\nint main() {\n  int n, i, j, k, temp = 0, m, e;\n  scanf(\"%d\", &n);\n  int a[100] = {0}, b[100] = {0};\n  char s[100][10], y[100][10];\n  char exchange[10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", line[i].num, &line[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      temp++;\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      strcpy(s[j], line[i].num);\n      b[j] = line[i].age;\n      j++;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    for (k = 0; k < temp - j; k++) {\n      if (b[k] < b[k + 1]) {\n        e = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = e;\n        strcpy(exchange, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], exchange);\n      }\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    printf(\"%s\\n\", s[j]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age < 60) {\n      strcpy(y[m], line[i].num);\n      m++;\n    }\n  }\n  for (j = 0; j < n - temp; j++) {\n    printf(\"%s\\n\", y[j]);\n  }\n}\n"}
{"label": "9", "index": "15296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  struct ren {\n    char id[10];\n    int age;\n  } p[100];\n  struct ren t;\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> p[i].id >> p[i].age;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j].age < p[j + 1].age && p[j + 1].age >= 60) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nstruct patients {\n  char name[11];\n  int age;\n} pat[100];\nstruct patold {\n  char name[11];\n  int age;\n} old[100];\nstruct patyoung {\n  char name[11];\n  int age;\n} young[100];\nint y = 0, o = 0;\nchar nametemp[11];\nint agetemp;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].name;\n    scanf(\"%d\", &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      strcpy(old[o].name, pat[i].name);\n      old[o].age = pat[i].age;\n      o++;\n    } else {\n      strcpy(young[y].name, pat[i].name);\n      young[y].age = pat[i].age;\n      y++;\n    }\n  }\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        agetemp = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = agetemp;\n        strcpy(nametemp, old[j].name);\n        strcpy(old[j].name, old[j + 1].name);\n        strcpy(old[j + 1].name, nametemp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", old[i].name);\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", young[i].name);\n  return 0;\n}\n"}
{"label": "9", "index": "15298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char A[10];\n  int age;\n};\n\nint main() {\n  int i, n, k, count;\n  struct patient inter;\n  struct patient *p;\n  cin >> n;\n  struct patient *sick = (struct patient *)malloc(sizeof(struct patient) * n);\n  struct patient *waitlist =\n      (struct patient *)malloc(sizeof(struct patient) * n);\n  count = 0;\n  for (i = 0; i < n; i++) {\n    cin >> sick[i].A >> sick[i].age;\n  }\n  p = waitlist;\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      *p = sick[i];\n      p++;\n      count++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sick[i].age < 60) {\n      *p = sick[i];\n      p++;\n    }\n  }\n  for (i = 1; i < count; i++) {\n    for (k = 0; k < count - i; k++) {\n      if (waitlist[k].age < waitlist[k + 1].age) {\n        inter = waitlist[k + 1];\n        waitlist[k + 1] = waitlist[k];\n        waitlist[k] = inter;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", waitlist[i].A);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct hospital {\n  char ID[11];\n  int age;\n} old[100], young[100], all[100], temp;\nvoid sequence(struct hospital matrix[], int n) {\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (matrix[j].age < matrix[j + 1].age) {\n        temp = matrix[j];\n        matrix[j] = matrix[j + 1];\n        matrix[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> all[i].ID >> all[i].age;\n  }\n  int oi = 0, yi = 0;\n  for (i = 0; i < n; i++) {\n    if (all[i].age >= 60) {\n      old[oi] = all[i];\n      oi++;\n    } else {\n      young[yi] = all[i];\n      yi++;\n    }\n  }\n  sequence(old, oi);\n  for (i = 0; i < oi; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < yi; i++) {\n    cout << young[i].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char num[11];\n  int age;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient pat1[100], pat2[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat1[i].num, &pat1[i].age);\n    strcpy(pat2[i].num, pat1[i].num);\n    pat2[i].age = pat1[i].age;\n  }\n  int j, e;\n  char e_num[11];\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pat1[i].age < pat1[i + 1].age) {\n        e = pat1[i + 1].age;\n        strcpy(e_num, pat1[i + 1].num);\n        pat1[i + 1].age = pat1[i].age;\n        strcpy(pat1[i + 1].num, pat1[i].num);\n        pat1[i].age = e;\n        strcpy(pat1[i].num, e_num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat1[i].age >= 60) {\n      printf(\"%s\\n\", pat1[i].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat2[i].age < 60) {\n      cout << pat2[i].num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15301", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int age;\n};\nstruct info1 {\n  char num1[10];\n  int age1;\n};\nint main(int argc, char *argv[]) {\n  struct info patient[101];\n  struct info1 old[101];\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0, j = 0; i < n; i++) {\n    cin >> patient[i].num >> patient[i].age;\n    if (patient[i].age >= 60) {\n      strcpy(old[j].num1, patient[i].num);\n      old[j].age1 = patient[i].age;\n      j++;\n    }\n  }\n  int m = j;\n  for (j = 1; j < m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (old[i].age1 < old[i + 1].age1) {\n        old[100] = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = old[100];\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", old[i].num1);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15302", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patients {\n  int num;\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, y, o;\n  struct patients list[100], young[100], old[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    list[i].num = i;\n    scanf(\"%s %d\", list[i].ID, &list[i].age);\n  }\n\n  y = 0;\n  o = 0;\n\n  for (i = 0; i < n; i++) {\n    if (list[i].age >= 60) {\n      old[o] = list[i];\n      o++;\n    } else {\n      young[y] = list[i];\n      y++;\n    }\n  }\n\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        struct patients check;\n        check = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = check;\n      }\n    }\n  }\n\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", old[i].ID);\n\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", young[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct sick {\n  char name[10];\n  int age;\n};\nint main() {\n  int n, i, count = 0, j;\n  struct sick s[100], a[100], t;\n  char b[3];\n\n  cin >> b;\n  n = atoi(b);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].name, &s[i].age);\n  if (n == 1)\n    printf(\"%s\", s[0].name);\n  else {\n    for (i = 0; i < n; i++)\n      if (s[i].age >= 60) {\n        a[count] = s[i];\n        count++;\n      }\n    for (i = 0; i < count - 1; i++)\n      for (j = 0; j < count - 1 - i; j++)\n        if (a[j].age < a[j + 1].age) {\n          t = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = t;\n        }\n    for (i = 0; i < count; i++)\n      printf(\"%s \", a[i].name);\n    for (i = 0; i < n; i++)\n      if (s[i].age < 60)\n        printf(\"%s \", s[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *last;\n};\nchar temp[10];\nint main() {\n  struct patient *p1, *p2, *head, p[1000];\n  int n, i, j, tmp;\n  scanf(\"%d\", &n);\n  memset(p, 0, sizeof(p));\n  head = p + 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    p[i].last = p + i - 1;\n    p[i].next = p + i + 1;\n  }\n  head->last = NULL;\n  p[i].next = NULL;\n  for (i = n; i > 1; i--) {\n    for (j = 1; j < n; j++) {\n      if ((p + j + 1)->age >= 60 && (p + j + 1)->age > (p + j)->age) {\n        memcpy(temp, (p + j)->id, sizeof(temp));\n        memcpy((p + j)->id, (p + j + 1)->id, sizeof(temp));\n        memcpy((p + j + 1)->id, temp, sizeof(temp));\n        tmp = (p + j)->age;\n        (p + j)->age = (p + j + 1)->age;\n        (p + j + 1)->age = tmp;\n      }\n    }\n  }\n  for (; head != NULL; head = head->next)\n    cout << head->id << \" \";\n}\n"}
{"label": "9", "index": "15305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b[100], i, r, j = 0, k = 0, o[100] = {0}, y[100] = {0}, l = 1, m;\n  char a[100][10], old[100][10], young[100][10], str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] >= 60) {\n      strcpy(old[j], a[i]);\n      o[j] = b[i];\n      j++;\n    } else {\n      strcpy(young[k], a[i]);\n      y[k] = b[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (r = 0; r < i; r++) {\n      if (o[r] < o[r + 1]) {\n        m = o[r + 1];\n        strcpy(str, old[r + 1]);\n        o[r + 1] = o[r];\n        strcpy(old[r + 1], old[r]);\n        o[r] = m;\n        strcpy(old[r], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", young[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  char id[100];\n  int age;\n};\n\nint main() {\n\n  struct data old[1000];\n  struct data young[1000];\n  struct data temp;\n  int n, i, p = 0, q = 0, len1, len2, k;\n  char id[100];\n  int age;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id >> age;\n    if (age >= 60) {\n      old[p].age = age;\n      strcpy(old[p].id, id);\n      p++;\n    } else {\n      young[q].age = age;\n      strcpy(young[q].id, id);\n      q++;\n    }\n  }\n  len1 = p;\n  len2 = q;\n  for (k = 1; k < len1; k++) {\n    for (i = 0; i < len1 - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        temp = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < len2; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, i, j, k, s, t, p;\n  scanf(\"%d\", &n);\n  int a[n - 1], c[n - 1];\n  char string[n - 1][10], b[n - 1][10];\n  for (h = 0; h <= n - 1; h++) {\n    scanf(\"%s %d\", string[h], &a[h]);\n  }\n  for (p = 0, j = 0; p <= n - 1; p++) {\n    if (a[p] >= 60) {\n      c[j] = a[p];\n      strcpy(b[j], string[p]);\n      j++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (s = 1; s <= j; s++) {\n      for (i = 0, t = 0; i < j; i++) {\n        if (c[s - 1] >= c[i])\n          t++;\n      }\n      if (t == j) {\n        printf(\"%s\\n\", b[s - 1]);\n        c[s - 1] = 0;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15308", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int d;\n  char c[20];\n  struct s *next;\n};\nvoid sort(struct s *head) {\n  struct s *pre = head, *p = pre->next, *s;\n  s = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%s %d\", s->c, &s->d);\n  s->next = NULL;\n  if (s->d >= 60) {\n    while (p != NULL && p->d >= s->d) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n  if (s->d < 60) {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nint main() {\n  struct s *head, *p;\n  int n, i;\n  head = (struct s *)malloc(sizeof(struct s));\n  cin >> n;\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    sort(head);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->c);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15309", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct example {\n  char id[10];\n  int age;\n  struct example *next;\n};\n\nint i = 1, d, n;\nstruct example *creat(int n) {\n  struct example *head = NULL;\n  struct example *p1, *p2;\n  while (i <= n) {\n    p1 = (struct example *)malloc(sizeof(struct example));\n    scanf(\"%s%d\", &(*p1).id, &(*p1).age);\n    if (i == 1) {\n      head = p1;\n      p2 = head;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    i = i + 1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct example *paixu(struct example *head) {\n  char temp1[10] = {'\\0'};\n  int temp2;\n  struct example *p1, *p2;\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1->next;\n      if (p1->age < p2->age && ((p2->age) >= 60)) {\n        strcpy(temp1, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, temp1);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p1 = p1->next;\n    }\n  }\n  return head;\n}\n\nvoid print(struct example *head) {\n  struct example *s;\n  s = head;\n  if (head != NULL)\n    do {\n      printf(\"%s\\n\", s->id);\n      s = s->next;\n    } while (s != NULL);\n}\n\nint main() {\n  struct example *head = NULL;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = paixu(head);\n  print(head);\n}\n"}
{"label": "9", "index": "15310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, year[100], i, j, year2[100] = {0}, t, k;\n  char num[100][10], num2[100][10], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    scanf(\"%d\", &year[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      for (k = 0; k < 10; k++) {\n        num2[i][k] = num[i][k];\n      }\n      year2[i] = year[i];\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++) {\n      if (year2[i] < year2[i + 1]) {\n        t = year2[i];\n        year2[i] = year2[i + 1];\n        year2[i + 1] = t;\n        for (k = 0; k < 10; k++) {\n          p = num2[i][k];\n          num2[i][k] = num2[i + 1][k];\n          num2[i + 1][k] = p;\n        }\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (year2[i] != 0)\n      printf(\"%s\\n\", num2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60) {\n      printf(\"%s\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int old;\n} pa[100];\nint main() {\n  int n, i, j = 0, k = 0, t;\n  struct patient pao[100], pay[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].old);\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].old >= 60) {\n      pao[j] = pa[i];\n      j++;\n    } else {\n      pay[k] = pa[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++)\n    for (t = 0; t < j - 1 - i; t++)\n      if (pao[t].old < pao[t + 1].old) {\n        temp = pao[t];\n        pao[t] = pao[t + 1];\n        pao[t + 1] = temp;\n      }\n\n  printf(\"%s\", pao[0].id);\n  for (i = 1; i < j; i++)\n    printf(\"\\n%s\", pao[i].id);\n  printf(\"\\n%s\", pay[0].id);\n  for (i = 1; i < k; i++)\n    printf(\"\\n%s\", pay[i].id);\n}\n"}
{"label": "9", "index": "15312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n  struct pat *next;\n};\nint main() {\n  struct pat *head, *p;\n  int i, n;\n  void search(struct pat * head, int n);\n  scanf(\"%d\", &n);\n  head = (struct pat *)malloc(sizeof(struct pat));\n  p = head;\n  p->next = NULL;\n  scanf(\"%s %d\", p->id, &p->age);\n  for (i = 1; i < n; i++) {\n    p->next = (struct pat *)malloc(sizeof(struct pat));\n    p = p->next;\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n  }\n  search(head, n);\n  return 0;\n}\nvoid search(struct pat *head, int n) {\n  int i, j = 0, k = 0;\n  struct pat *t, *m, *p, *head1, *head2;\n  struct pat *sort(struct pat * head1, int j);\n  void print(struct pat * head1, struct pat * head2, int j, int k);\n  p = head;\n  t = (struct pat *)malloc(sizeof(struct pat));\n  m = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    if (p->age >= 60) {\n      j++;\n      if (j == 1)\n        head1 = t;\n      strcpy(t->id, p->id);\n      t->age = p->age;\n      t->next = (struct pat *)malloc(sizeof(struct pat));\n      t = t->next;\n      t->next = NULL;\n    } else {\n      k++;\n      if (k == 1)\n        head2 = m;\n      strcpy(m->id, p->id);\n      m->age = p->age;\n      m->next = (struct pat *)malloc(sizeof(struct pat));\n      m = m->next;\n      m->next = NULL;\n    }\n    p = p->next;\n  }\n  sort(head1, j);\n  print(head1, head2, j, k);\n}\nstruct pat *sort(struct pat *head1, int j) {\n  int i, l, t;\n  char a[10];\n  struct pat *p1, *p2;\n  for (i = 0; i < j - 1; i++) {\n    p1 = head1;\n    for (l = 0; l < j - i - 1; l++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p1->age > p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n    }\n  }\n  return (head1);\n}\nvoid print(struct pat *head1, struct pat *head2, int j, int k) {\n  int i;\n  struct pat *p;\n  p = head1;\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  p = head2;\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15313", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char id[100][10], old[100][10], yog[100][10];\n  int n, i, m = 0, l = 0, age[100], oag[100], yag[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &(age[i]));\n    if (age[i] >= 60) {\n      oag[m] = age[i];\n      strcpy(old[m], id[i]);\n      m++;\n    } else {\n      yag[l] = age[i];\n      strcpy(yog[l], id[i]);\n      l++;\n    }\n  }\n  char e_id[1][10];\n  int e_age, k;\n  for (k = 1; k <= m; k++) {\n    for (i = 0; i < m - k; i++) {\n      if (oag[i] < oag[i + 1]) {\n        strcpy(e_id[0], old[i]);\n        strcpy(old[i], old[i + 1]);\n        strcpy(old[i + 1], e_id[0]);\n        e_age = oag[i];\n        oag[i] = oag[i + 1];\n        oag[i + 1] = e_age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    puts(old[i]);\n  }\n  for (i = 0; i < l; i++) {\n    puts(yog[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct sick {\n  int age;\n  char id[100];\n  struct sick *next;\n};\nstruct sick *insert(struct sick *head, struct sick *new1) {\n  struct sick *p0, *p1, *p2, *p;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->age < 60) {\n      p1 = head;\n      while (p1 != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p2->next = p0;\n      p0->next = NULL;\n    } else {\n      while ((p1->age >= p0->age) && (p1->next != NULL)) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->age > p1->age) {\n        if (head == p1)\n          head = p0;\n        else\n          p2->next = p0;\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  struct sick *head, *p;\n  int n, i;\n  head = NULL;\n  cin >> n;\n  struct sick *insert(struct sick * head, struct sick * new1);\n  for (i = 0; i < n; i++) {\n    p = (struct sick *)malloc(sizeof(struct sick));\n    cin >> p->id >> p->age;\n    head = insert(head, p);\n  }\n  p = head;\n  do {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "15315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct people {\n  char num[10];\n  int age;\n  struct people *next;\n};\nint main() {\n  struct people *head, *p0, *p, *s;\n  head = (struct people *)malloc(sizeof(struct people));\n  head->next = NULL;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p0 = head;\n    p = p0->next;\n    s = (struct people *)malloc(sizeof(struct people));\n    s->next = NULL;\n    scanf(\"%s %d\", s->num, &s->age);\n    while (p != NULL && ((s->age >= 60 && s->age <= p->age) || s->age < 60)) {\n      p0 = p;\n      p = p->next;\n    }\n    p0->next = s;\n    s->next = p;\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0;\n  struct person t, *s, o[1000], y[1000];\n  cin >> n;\n  s = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].id, &s[i].y);\n  for (i = 0; i < n; i++)\n    if (s[i].y >= 60) {\n      o[k] = s[i];\n      k++;\n    } else {\n      y[m] = s[i];\n      m++;\n    }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i; j++)\n      if (o[j].y < o[j + 1].y) {\n        t = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = t;\n      }\n  }\n  for (i = 0; i < k; i++)\n    cout << o[i].id << \"\\n\";\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", y[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n};\nint main() {\n  struct pa p[200];\n  int n, i, t[200], j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  i = 0;\n  t[0] = 0;\n  while (i < n) {\n    if (p[i].age >= 60) {\n      for (j = 0; j < i && p[t[j]].age >= p[i].age; j++)\n        ;\n      for (m = i; m > j; m--)\n        t[m] = t[m - 1];\n      t[j] = i;\n      i++;\n    } else {\n      t[i] = i;\n      i++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[t[i]].id);\n}\n"}
{"label": "9", "index": "15318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\nstruct patient *insert(struct patient *head, struct patient *another) {\n  struct patient *p0, *p1, *p2;\n  p1 = head;\n  p0 = another;\n  if (p0->age < 60) {\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->age >= p0->age && p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p1->age >= p0->age) {\n      p1->next = p0;\n      p0->next = NULL;\n    } else {\n      if (p1 == head) {\n        head = p0;\n        p0->next = p1;\n      } else {\n        p2->next = p0;\n        p0->next = p1;\n      }\n    }\n  }\n  return head;\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->ID << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head, *p;\n  scanf(\"%d\", &n);\n  head = p = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p->ID, &p->age);\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->ID, &p->age);\n    head = insert(head, p);\n  }\n  print(head);\n}\n"}
{"label": "9", "index": "15319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Inf {\n  char c[10];\n  int a;\n};\nint main() {\n  int n, o = 0, y = 0, t, i, j;\n  char temp[10];\n  struct Inf inf[100], old[100], young[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", inf[i].c, &inf[i].a);\n    if (inf[i].a >= 60) {\n      strcpy(old[o].c, inf[i].c);\n      old[o].a = inf[i].a;\n      o++;\n    } else {\n      strcpy(young[y].c, inf[i].c);\n      young[y].a = inf[i].a;\n      y++;\n    }\n  }\n  for (j = 1; j < o; j++) {\n    for (i = 0; i < o - j; i++) {\n      if (old[i].a < old[i + 1].a) {\n        strcpy(temp, old[i].c);\n        strcpy(old[i].c, old[i + 1].c);\n        strcpy(old[i + 1].c, temp);\n        t = old[i].a;\n        old[i].a = old[i + 1].a;\n        old[i + 1].a = t;\n      }\n    }\n  }\n  for (i = 0; i < o; i++) {\n    printf(\"%s\\n\", old[i].c);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", young[i].c);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char str[10];\n  int a;\n\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i = 0;\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->str, &p1->a);\n  head = NULL;\n  while (i < n - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->str, &p1->a);\n  }\n  p2->next = p1;\n  p2 = (struct student *)malloc(1000);\n  p2 = p1;\n  p2->next = NULL;\n\n  return (head);\n}\nint main() {\n  int n, i, j;\n  struct student *head, *p1, *p2, *p3, *p4, *p5, *p6;\n  scanf(\"%d\", &n);\n  head = creat(n);\n\n  char c[10];\n  int t;\n\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    p2 = p1->next;\n\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->a > 59 && p2->a > p1->a)\n\n      {\n        strcpy(c, p2->str);\n        strcpy(p2->str, p1->str);\n        strcpy(p1->str, c);\n        t = p1->a;\n        p1->a = p2->a;\n        p2->a = t;\n      }\n\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  p5 = head;\n\n  for (i = 0; i < n; i++) {\n\n    { cout << p5->str << \" \"; }\n    p5 = p5->next;\n  }\n}\n"}
{"label": "9", "index": "15321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, t, k;\n  scanf(\"%d\", &n);\n  char a[100][10], c[11];\n  int b[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] < 60)\n      b[i] = 0;\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, a[i]);\n        strcpy(a[i], a[i + 1]);\n        strcpy(a[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct patient pt[100];\n\n  int n, i, j, a = 0, b = 0, tem;\n  int age_r[100], time_range[100];\n  char temid[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pt[i].id, &pt[i].age);\n    if (pt[i].age >= 60) {\n      age_r[a] = i;\n      a++;\n    } else {\n      time_range[b] = i;\n      b++;\n    }\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (pt[age_r[j]].age < pt[age_r[j + 1]].age) {\n        strcpy(temid, pt[age_r[j]].id);\n        strcpy(pt[age_r[j]].id, pt[age_r[j + 1]].id);\n        strcpy(pt[age_r[j + 1]].id, temid);\n        tem = pt[age_r[j]].age;\n        pt[age_r[j]].age = pt[age_r[j + 1]].age;\n        pt[age_r[j + 1]].age = tem;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s\\n\", pt[age_r[i]].id);\n  }\n  for (i = 0; i < b; i++)\n    printf(\"%s\\n\", pt[time_range[i]].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15323", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[200];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p2 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0) {\n      head = p2;\n      p3 = head;\n    }\n    scanf(\"%s %d\", p2->num, &p2->sum);\n    p2->next = NULL;\n    if (p2->sum >= 60) {\n      if (i == 1) {\n        if (head->sum >= p2->sum) {\n          head->next = p2;\n          p2->next = NULL;\n          p3 = p2;\n        } else {\n          p1 = head;\n          p2->next = head;\n          head = p2;\n        }\n      }\n      if (i > 1) {\n        for (p1 = head; p1->next != NULL; p1 = p1->next) {\n          if (p1->sum >= p2->sum && (p1->next->sum) < p2->sum) {\n            p2->next = p1->next;\n            p1->next = p2;\n            break;\n          }\n        }\n        if (p2->next == NULL) {\n          if (p2->sum > head->sum) {\n            p2->next = head;\n            head = p2;\n          }\n          if (p2->sum < p1->sum) {\n            p2->next = NULL;\n            p3 = p2;\n            p1->next = p2;\n          }\n        }\n      }\n    } else {\n      if (i != 0) {\n        p2->next = NULL;\n        p3->next = p2;\n        p3 = p2;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], dengji[100], p, t;\n  char id[100][10], c;\n  int jishuqi = 0, k;\n  int l, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    dengji[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        k = dengji[j];\n        dengji[j] = dengji[j + 1];\n        dengji[j + 1] = k;\n        for (p = 0; p <= 9; p++) {\n          c = id[j][p];\n          id[j][p] = id[j + 1][p];\n          id[j + 1][p] = c;\n        }\n      }\n      if (age[j] == age[j + 1]) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < 60) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          t = age[j];\n          age[j] = age[j + 1];\n          age[j + 1] = t;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%s\\n\", id[i]);\n}\n"}
{"label": "9", "index": "15325", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, age[100], num[100], temp, num_1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n}\n"}
{"label": "9", "index": "15326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patience {\n  int shunxu;\n  char id[10];\n  int age;\n} pa[100];\nint main() {\n  int n, i, j, p = 60, q = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  int b[n], c[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      q++;\n    }\n  }\n  do {\n    for (i = 0; i < n; i++) {\n      if (pa[i].age >= p) {\n        p = pa[i].age;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (pa[i].age == p) {\n        printf(\"%s\\n\", pa[i].id);\n        pa[i].age = 0;\n      }\n    }\n    p = 60;\n    q--;\n  } while (q > 0);\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60 && pa[i].age > 0) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint main() {\n  int n, i;\n  struct patient *p, *pre, *pnew, *head1, *head2;\n  head1 = NULL;\n  head2 = NULL;\n  scanf(\"%d\\n\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    pnew = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\\n\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if (pnew->age >= 60) {\n      if (head1 == NULL) {\n        head1 = pnew;\n      } else {\n        p = head1;\n        while (p && p->age >= pnew->age) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head1) {\n          pnew->next = head1;\n          head1 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    } else {\n      if (head2 == NULL)\n        head2 = pnew;\n      else {\n        p = head2;\n        while (p) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head2) {\n          pnew->next = head2;\n          head2 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    }\n  }\n  p = head1;\n  if (head1 != NULL) {\n    while (p) {\n      printf(\"%s\\n\", p->id);\n      p = p->next;\n    }\n  }\n  p = head2;\n  if (head2 != NULL) {\n    while (p) {\n      printf(\"%s\\n\", p->id);\n      p = p->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    int k;\n    char id[10];\n    int age;\n  } pa[100] = {0, \"\", 0}, pb[100] = {0, \"\", 0}, temp;\n\n  int n;\n  int i, j, k, age, na, nb;\n  char id[10] = {\"\"};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0; i + j < n;) {\n    scanf(\"%s%d\", &id, &age);\n    if (age >= 60) {\n      pa[i].age = age;\n      strcpy(pa[i].id, id);\n      pa[i].k = i;\n      i++;\n    } else {\n      pb[j].age = age;\n      strcpy(pb[j].id, id);\n      pb[j].k = j;\n      j++;\n    }\n  }\n  na = i;\n  nb = j;\n\n  for (j = 1; j <= n - 1; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pa[i].age < pa[i + 1].age) {\n        temp.age = pa[i + 1].age;\n        strcpy(temp.id, pa[i + 1].id);\n        pa[i + 1].age = pa[i].age;\n        strcpy(pa[i + 1].id, pa[i].id);\n        pa[i].age = temp.age;\n        strcpy(pa[i].id, temp.id);\n      }\n    }\n  }\n\n  printf(\"%s\", pa[0].id);\n  for (i = 1; i <= na; i++) {\n    printf(\"\\n%s\", pa[i].id);\n  }\n  for (j = 0; j <= nb; j++) {\n    puts(pb[j].id);\n  }\n}\n"}
{"label": "9", "index": "15329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[11];\n  int age;\n  struct pat *next;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *head, *p1, *p2, *pre;\n  p1 = (struct pat *)malloc(sizeof(struct pat));\n  scanf(\"%s %d\", p1->num, &p1->age);\n  head = p1;\n  p1->next = NULL;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      p2 = head;\n      while (p2) {\n        if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        }\n        p2 = p2->next;\n      }\n    } else if (p1->age >= 60) {\n      p2 = head;\n      while (p2) {\n        if (p2 == head && p1->age > p2->age) {\n          head = p1;\n          p1->next = p2;\n          break;\n        } else if (p1->age > p2->age) {\n          pre->next = p1;\n          p1->next = p2;\n          break;\n        } else if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        } else {\n          pre = p2;\n          p2 = p2->next;\n        }\n      }\n    }\n  }\n  p1 = head;\n  while (p1) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Info {\n  char sID[10];\n  int nAge;\n};\nint main() {\n  int i, n, j, l;\n  struct Info t;\n  scanf(\"%d\", &n);\n  struct Info patients[100];\n  struct Info overpatients[100];\n  l = 0;\n  for (i = 0; i < n; i++) {\n    cin >> patients[i].sID >> patients[i].nAge;\n    if (patients[i].nAge >= 60) {\n      overpatients[l] = patients[i];\n      l++;\n    }\n  }\n  for (i = 0; i < l - 1; i++)\n    for (j = 1; j < l - i; j++) {\n      if (overpatients[j - 1].nAge < overpatients[j].nAge) {\n        t = overpatients[j - 1];\n        overpatients[j - 1] = overpatients[j];\n        overpatients[j] = t;\n      }\n    }\n  for (i = 0; i < l; i++) {\n    cout << overpatients[i].sID << \"\\n\";\n  }\n  for (i = 0; i < n; i++)\n    if (patients[i].nAge < 60) {\n      printf(\"%s\\n\", patients[i].sID);\n    }\n}\n"}
{"label": "9", "index": "15331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patients {\n    char id[10];\n    int age;\n  } temp;\n  struct patients patient[100];\n  struct patients old[100];\n  int i, j, n, first;\n  scanf(\"%d\", &n);\n  first = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", patient[i].id);\n    scanf(\"%d\", &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[first] = patient[i];\n      first = first + 1;\n    }\n  }\n  for (i = 0; i < first; i++) {\n    for (j = 0; j < first - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < first; i++) {\n    cout << old[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60)\n      printf(\"%s\\n\", patient[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, s, t, k = 0, n;\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient p[100], d[100], c[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      d[j++] = p[i];\n    } else\n      c[k++] = p[i];\n  }\n  s = j;\n  t = k;\n  for (i = 1; i < s; i++) {\n    for (j = 0; j < s - i; j++) {\n      if (d[j].age < d[j + 1].age) {\n        temp = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i].ID);\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", c[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int o[100], n, i, j, s[100], b = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    cin >> o[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] >= 60) {\n      s[b] = o[i];\n      b++;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = b - 1; j > i; j--) {\n      if (s[j] > s[j - 1]) {\n        t = s[j];\n        s[j] = s[j - 1];\n        s[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < b - 1; i++) {\n    if (s[i] == s[i + 1])\n      s[i] = -1;\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < n; j++) {\n      if (o[j] == s[i])\n        printf(\"%s\\n\", id[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] < 60)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][100], a[100][100], b[100];\n  int n, i, j = 0, sz[100], t, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(a[j], s[i]);\n      j++;\n    }\n  }\n  for (t = 1; t <= n; t++) {\n    for (i = 0; i < n - t; i++) {\n      if (sz[i] < sz[i + 1]) {\n        c = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = c;\n        strcpy(b, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], b);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      cout << s[i] << \"\\n\";\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct info {\n  int num;\n  char data[10];\n  struct info *next;\n  int tip;\n};\n\nstruct info *create(int n) {\n  struct info *p1, *pre, *p2, *head, *tail;\n  int i, t;\n  head = (struct info *)malloc(sizeof(struct info));\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%s %d\", p1->data, &p1->num);\n  head->next = p1;\n  p1->next = NULL;\n  tail = p1;\n  i = 0;\n  while (i < n - 1) {\n    t = 0;\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d\", p1->data, &p1->num);\n    p1->next = NULL;\n    if (p1->num >= 60) {\n      for (pre = head, p2 = head->next; p2 != NULL && p2->num >= 60;\n           pre = pre->next, p2 = p2->next) {\n        if (p2->num < p1->num) {\n          pre->next = p1;\n          p1->next = p2;\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        pre->next = p1;\n        p1->next = p2;\n        if (p2 == NULL) {\n          tail = p1;\n        }\n      }\n    } else {\n      tail->next = p1;\n      tail = p1;\n    }\n    i++;\n  }\n  return head;\n}\nvoid print(struct info *head) {\n  struct info *p;\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->data);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  print(head);\n}\n"}
{"label": "9", "index": "15336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pa[100];\n\nint main() {\n  int n, i, j, max = 59, m, t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  for (i = 0; i < n; i++)\n    if (pa[i].age > 59)\n      t++;\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < n; i++)\n      if (pa[i].age > max) {\n        max = pa[i].age;\n        m = i;\n      }\n    cout << pa[m].id << \"\\n\";\n    pa[m].age = 0;\n    max = 59;\n  }\n\n  for (i = 0; i < n; i++)\n    if (pa[i].age <= 59 && pa[i].age != 0)\n      printf(\"%s\\n\", pa[i].id);\n}\n"}
{"label": "9", "index": "15337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char p[200][10], q[200][10] = {0}, c[10];\n  int a[200], b[200];\n  int n, i, j, x, y, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  j = 0;\n  x = 0;\n  t = 0;\n  y = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(q[j], p[i]);\n      j++;\n      t++;\n    }\n  }\n  for (j = t - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] < b[i + 1]) {\n        int r;\n        r = b[i + 1];\n        strcpy(c, q[i + 1]);\n        b[i + 1] = b[i];\n        strcpy(q[i + 1], q[i]);\n        b[i] = r;\n        strcpy(q[i], c);\n      }\n    }\n  }\n  for (i = 0; i < t; i++) {\n    cout << q[i] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", p[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100], a[100], k = 0, count = 0, c[100], i, j;\n  char ID[100][100], id[100][100], string[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = age[i];\n      strcpy(id[k], ID[i]);\n      count++;\n      c[k] = k;\n      k++;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] < a[j]) {\n        int t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n        strcpy(string, id[k]);\n        strcpy(id[k], id[j]);\n        strcpy(id[j], string);\n        int p = c[k];\n        c[k] = c[j];\n        c[j] = p;\n      }\n    }\n  }\n  for (k = 0; k < count; k++) {\n    for (int j = k + 1; j < count; j++) {\n      if (a[k] == a[j]) {\n        if (c[k] > c[j]) {\n          int t = a[j];\n          a[j] = a[k];\n          a[k] = t;\n          strcpy(string, id[k]);\n          strcpy(id[k], id[j]);\n          strcpy(id[j], string);\n          int p = c[k];\n          c[k] = c[j];\n          c[j] = p;\n        }\n      }\n    }\n  }\n  for (k = 0; k < count; k++)\n    printf(\"%s \", id[k]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", ID[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15339", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, x;\n  scanf(\"%d\", &n);\n  int age[100];\n  char num[100][10];\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> age[i];\n    if (age[i] < 60)\n      age[i] = 0;\n  }\nloop:\n  for (i = 0; i < n; i++) {\n    x = 0;\n    if (age[i] >= 60) {\n      for (int j = 0; j < n; j++) {\n        if (age[j] > age[i])\n          x = x + 1;\n      }\n      if (x == 0) {\n        printf(\"%s\\n\", num[i]);\n        age[i] = 1;\n        goto loop;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] == 0)\n      printf(\"%s\\n\", num[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mouse {\n  char id[10];\n  int age;\n  struct mouse *next;\n};\nstruct mouse *creat(int n) {\n  struct mouse *head, *p1, *p2;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    if (i > 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct mouse *order(struct mouse *head, int n) {\n  struct mouse *p1, *p2;\n  int i, j, x;\n  char a[10];\n  for (i = 1; i < n; i++) {\n    p2 = head;\n    p1 = p2->next;\n    for (j = 0; j < n - i; j++) {\n      if (p2->age < p1->age && p1->age >= 60) {\n        x = p2->age;\n        p2->age = p1->age;\n        p1->age = x;\n        strcpy(a, p2->id);\n        strcpy(p2->id, p1->id);\n        strcpy(p1->id, a);\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n  return (head);\n}\nint main() {\n  struct mouse *head, *p;\n  int i, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = order(head, n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15341", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n} a[100], e, b[100];\n\nint main() {\n  int n, J;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j].id > a[j + 1].id) {\n        e = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = e;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  J = j;\n  for (j = 0; j < J; j++) {\n    for (i = 0; i < J - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (j = 0; j < J; j++) {\n    printf(\"%s\\n\", b[j].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15342", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } ren[100];\n  struct oldp {\n    char idold[11];\n    int ageold;\n  } oldren[100];\n  struct youngp {\n    char idyoung[11];\n    int ageyoung;\n  } youngren[100];\n  int old[100], young[100];\n  int n, i, t, j, oldindex = 0, youngindex = 0;\n  char num[4], idinter[11];\n\n  cin >> num;\n  n = atoi(num);\n  for (i = 0; i < n; i++) {\n    cin >> ren[i].id >> ren[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (ren[i].age >= 60) {\n      oldren[oldindex].ageold = ren[i].age;\n      strcpy(oldren[oldindex].idold, ren[i].id);\n      oldindex += 1;\n    } else {\n      youngren[youngindex].ageyoung = ren[i].age;\n      strcpy(youngren[youngindex].idyoung, ren[i].id);\n      youngindex += 1;\n    }\n  }\n  for (i = 1; i < oldindex; i++) {\n    for (j = 0; j < oldindex - i; j++) {\n      if (oldren[j].ageold < oldren[j + 1].ageold) {\n        t = oldren[j].ageold;\n        oldren[j].ageold = oldren[j + 1].ageold;\n        oldren[j + 1].ageold = t;\n        strcpy(idinter, oldren[j].idold);\n        strcpy(oldren[j].idold, oldren[j + 1].idold);\n        strcpy(oldren[j + 1].idold, idinter);\n      }\n    }\n  }\n  for (i = 0; i < oldindex; i++) {\n    printf(\"%s \", oldren[i].idold);\n  }\n  for (i = 0; i < youngindex; i++) {\n    printf(\"%s \", youngren[i].idyoung);\n  }\n}\n"}
{"label": "9", "index": "15343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[n][100];\n  int b[n], i, j, c[n], d[n], k;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    c[i] = 0;\n    d[i] = n;\n    for (j = 0; j < n; j++) {\n      if (b[j] >= 60 && b[j] > c[i]) {\n        for (k = 0; k < i; k++) {\n          if (j == d[k])\n            break;\n        }\n        if (k == i) {\n          c[i] = b[j];\n          d[i] = j;\n        }\n      }\n    }\n    if (d[i] != n && b[d[i]] >= 60)\n      printf(\"%s\\n\", a[d[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      cout << a[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n} patient[100], patient2[100];\n\nint main() {\n  int i, k, m, n, j, temp;\n  char id2[10];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id >> patient[i].age;\n  }\n  for (i = 0, j = 0; i < n;) {\n    if (patient[i].age >= 60) {\n      strcpy(patient2[j].id, patient[i].id);\n      patient2[j].age = patient[i].age;\n\n      j++;\n      for (k = i; k < n - 1; k++) {\n        strcpy(patient[k].id, patient[k + 1].id);\n        patient[k].age = patient[k + 1].age;\n      }\n      n--;\n    } else\n      i++;\n  }\n\n  for (i = 1; i < j; i++) {\n    for (k = 0; k < i; k++) {\n      if (patient2[i].age > patient2[k].age) {\n        temp = patient2[i].age;\n        strcpy(id2, patient2[i].id);\n        for (m = i; m > k; m--) {\n          patient2[m].age = patient2[m - 1].age;\n          strcpy(patient2[m].id, patient2[m - 1].id);\n        }\n        patient2[k].age = temp;\n        strcpy(patient2[k].id, id2);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    cout << patient2[i].id << \"\\n\";\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", patient[i].id);\n}\n"}
{"label": "9", "index": "15345", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, temp, m = 0;\n  int patage[100];\n  struct patient {\n    char num[20];\n    int age;\n  };\n  struct patient pat[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      patage[j] = pat[i].age;\n      j++;\n      m++;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (patage[j] < patage[j + 1]) {\n        temp = patage[j];\n        patage[j] = patage[j + 1];\n        patage[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    if (patage[i] == patage[i - 1]) {\n      continue;\n    }\n    for (j = 0; j < n; j++) {\n      if (pat[j].age == patage[i])\n        printf(\"%s\\n\", pat[j].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, a[100], j;\n  struct patient {\n    char id[10];\n    int age;\n  } s[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].id, &s[i].age);\n  }\n  while (1) {\n    int max = 0;\n    for (i = 0; i < n; i++) {\n      if (s[i].age > s[max].age)\n        max = i;\n    }\n    if (s[max].age >= 60) {\n      printf(\"%s \", s[max].id);\n      s[max].age = 0;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++)\n    if (s[i].age > 0)\n      printf(\"%s \", s[i].id);\n}\n"}
{"label": "9", "index": "15347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main() {\n  struct patient a[100], b[100], c[100], temp;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].num, &a[i].age);\n  }\n\n  int j = 0, k = 0, m;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    for (m = 0; m < j - i; m++)\n\n    {\n      if (b[m].age < b[m + 1].age) {\n        temp = b[m];\n        b[m] = b[m + 1];\n        b[m + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i].num);\n  }\n}\n"}
{"label": "9", "index": "15348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100], pos[100], t, m;\n  char a[100][11], temp[11];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++)\n    pos[i] = i;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n      }\n    }\n  }\n  j = 0;\n  while (b[j] >= 60)\n    printf(\"%s\\n\", a[j++]);\n\n  k = j;\n  for (i = k; i < n; i++)\n    for (j = k; j < n - 1; j++) {\n      if (pos[j] > pos[j + 1]) {\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n      }\n    }\n  for (j = k; j < n; j++)\n    printf(\"%s\\n\", a[j]);\n  return 0;\n}\n"}
{"label": "9", "index": "15349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, e, m;\n  int a[100];\n\n  char b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &b[i], &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] >= 60 && a[j] > a[j - 1]) {\n        m = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = m;\n        char t[10];\n\n        strcpy(t, b[j]);\n        strcpy(b[j], b[j - 1]);\n        strcpy(b[j - 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int w;\n  char c[10];\n  struct stu *next;\n};\nint n;\nstruct stu *creat(int m) {\n  struct stu *head, *p1, *p2, *p3;\n  int i;\n  n = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  head = p1;\n  p1->next = NULL;\n  n = 0;\n  scanf(\"%s %d\", p1->c, &p1->w);\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->c >> p1->w;\n    if (p1->w < 60) {\n      for (p2 = head; p2->next != NULL; p2 = p2->next)\n        ;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      p2 = head;\n      while ((p1->w <= p2->w) && (p2->next != NULL)) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      if (p1->w > p2->w) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int m, i;\n  struct stu *head, *p;\n  cin >> m;\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", p->c);\n\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], c[100], m = 0, e[100], k = 0, x;\n  char b[100][10], d[100][10], f[100][10], y[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i], &a[i]);\n    if (a[i] >= 60) {\n      c[m] = a[i];\n      strcpy(d[m], b[i]);\n      m++;\n    } else {\n      e[k] = a[i];\n      strcpy(f[k], b[i]);\n      k++;\n    }\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (c[i] < c[i + 1]) {\n        x = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = x;\n        strcpy(y, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], y);\n      }\n  for (i = 0; i < m; i++)\n    cout << d[i] << \"\\n\";\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "15352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t, b[100], e[100];\n  char a[100][20], c[100][20], d[100][20], str[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[j], a[i]);\n      e[j] = b[i];\n      j++;\n    } else {\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (m = 0; m < j - 1 - i; m++) {\n      if (e[m] < e[m + 1]) {\n        t = e[m];\n        e[m] = e[m + 1];\n        e[m + 1] = t;\n        strcpy(str, c[m]);\n        strcpy(c[m], c[m + 1]);\n        strcpy(c[m + 1], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << c[i] << \"\\n\";\n  for (i = 0; i < k; i++)\n    cout << d[i] << \"\\n\";\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } patients[100], old[100], young[100], jh;\n  int n, i, j, d, k;\n  j = -1;\n  d = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patients[i].id, &patients[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (patients[i].age >= 60) {\n      d++;\n      old[d] = patients[i];\n\n    } else {\n      j++;\n      young[j] = patients[i];\n    }\n  }\n  for (k = 1; k <= d + 1; k++) {\n    for (i = 0; i < d; i++) {\n      if (old[i].age < old[i + 1].age) {\n        jh = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = jh;\n      }\n    }\n  }\n  for (i = 0; i <= d; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i <= j; i++) {\n    cout << young[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int a;\n  } p[100], pr;\n  int np, i, k;\n  scanf(\"%d\", &np);\n  for (i = 0; i < np; i++)\n    scanf(\"%s %d\", p[i].ID, &p[i].a);\n\n  for (i = 0; i < np; i++) {\n    for (k = np - 1; k > i; k--) {\n      if (p[k].a > p[k - 1].a && p[k].a >= 60) {\n        pr = p[k];\n        p[k] = p[k - 1];\n        p[k - 1] = pr;\n      }\n    }\n    printf(\"%s\\n\", p[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nvoid bubble(struct patient p[], int m);\nint main() {\n\n  struct patient p[200];\n  int n, i, t = 100;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      p[t] = p[i];\n      t++;\n      p[i].age = 0;\n    }\n  }\n  bubble(p, t);\n  for (i = 100; i < t; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n  }\n}\nvoid bubble(struct patient p[], int m) {\n  int i, j;\n  struct patient temp;\n  for (j = 101; j < m; j++) {\n    for (i = 100; i < m + 100 - j; i++) {\n      if (p[i].age < p[i + 1].age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[20];\n    int age;\n  } pa1[100], pa2[100], t;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa1[i].id, &pa1[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    strcpy(pa2[i].id, pa1[i].id);\n    pa2[i].age = pa1[i].age;\n  }\n\n  for (p = 1; p < n; p++) {\n    for (q = 0; q < n - p; q++) {\n      if (pa1[q].age > pa1[q + 1].age) {\n        t = pa1[q];\n        pa1[q] = pa1[q + 1];\n        pa1[q + 1] = t;\n      }\n    }\n  }\n\n  int a[1000];\n  int s = 0, h;\n  for (p = n - 1; p >= 0; p--) {\n    if (pa1[p].age >= 60) {\n      a[s] = pa1[p].age;\n      s++;\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = h + 1; p < s; p++) {\n      if (a[p] == a[h])\n        a[p] = 0;\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = 0; p < n; p++) {\n      if (pa2[p].age == a[h]) {\n        cout << pa2[p].id << \"\\n\";\n      }\n    }\n  }\n\n  for (p = 0; p < n; p++) {\n    if (pa2[p].age < 60) {\n      printf(\"%s\\n\", pa2[p].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n  struct Patient *next;\n  struct Patient *pre;\n};\nstruct Patient *creat(int x);\nstruct Patient *sort(struct Patient *);\nvoid print(struct Patient *);\n\nint main() {\n  struct Patient *patient, *patient2;\n  int n, i;\n  cin >> n;\n  patient = creat(n);\n  patient2 = sort(patient);\n  print(patient2);\n}\n\nstruct Patient *creat(int x) {\n  struct Patient *p1, *p2, *head, *p;\n  int i;\n  head = NULL;\n  for (i = 0; i < x; i++) {\n    p1 = (struct Patient *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n      head->pre = NULL;\n    } else {\n      p2->next = p1;\n      p1->pre = p2;\n    }\n    p2 = p1;\n    scanf(\"%s%d\", p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return head;\n}\n\nstruct Patient *sort(struct Patient *head) {\n  struct Patient *p1, *p2, *temp, *p;\n  temp = (struct Patient *)malloc(1000);\n  p1 = p2 = head;\n  while (p1) {\n    if (p1->age >= 60) {\n      p2 = p1->next;\n      while (p2) {\n        if (p2->age > p1->age) {\n          temp->age = p2->age;\n          strcpy(temp->id, p2->id);\n          p = p2;\n          while (p->pre != p1) {\n            strcpy(p->id, p->pre->id);\n            p->age = p->pre->age;\n            p = p->pre;\n          }\n          strcpy(p->id, p1->id);\n          p->age = p1->age;\n          p1->age = temp->age;\n          strcpy(p1->id, temp->id);\n        }\n        p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\n\nvoid print(struct Patient *head) {\n  struct Patient *p1, *p2, *p;\n  p = head;\n  while (p) {\n    if (p->age >= 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n  p = head;\n  while (p) {\n    if (p->age < 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    char id[10];\n    int age;\n  };\n  int n, i, j, k;\n  struct b a[100], temp, c[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i].age >= 60) {\n      c[j] = a[i];\n      j++;\n    }\n  for (i = j - 1; i >= 1; i--)\n    for (k = j - 1; k > j - i - 1; k--)\n      if (c[k].age > c[k - 1].age) {\n        temp = c[k];\n        c[k] = c[k - 1];\n        c[k - 1] = temp;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i].id);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15359", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, t = 0, y[100], x, a[100] = {0}, b[100];\n  char s[100][20], temp[20], s1[100][20], s2[100][20];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> y[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] >= 60) {\n      strcpy(s1[k], s[i]);\n      a[k] = y[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        strcpy(temp, s1[j]);\n        strcpy(s1[j], s1[j + 1]);\n        strcpy(s1[j + 1], temp);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", s1[i], a[i]);\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60) {\n      strcpy(s2[t], s[i]);\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", s2[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bing {\n  char a[10];\n  int age;\n};\nstruct bing bing[1000];\nint main() {\n  int n, i, j = 1, v = 1, k, t[1000], m, p[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &bing[i].a, &bing[i].age);\n    if (bing[i].age >= 60) {\n      t[j] = i;\n      j++;\n    } else {\n      p[v] = i;\n      v++;\n    }\n  }\n  j--;\n  v--;\n  if (j != 0) {\n    for (i = 1; i < j; i++)\n      for (k = 1; k < j - i + 1; k++)\n        if (bing[t[k]].age < bing[t[k + 1]].age) {\n          m = t[k];\n          t[k] = t[k + 1];\n          t[k + 1] = m;\n        }\n  }\n  for (i = 1; i <= j; i++)\n    printf(\"%s\\n\", bing[t[i]].a);\n  for (i = 1; i <= v; i++)\n    printf(\"%s\\n\", bing[p[i]].a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b[101], b1[101], t, h, k;\n  char a[101][11] = {0}, a1[101][11] = {0}, s1[11];\n  scanf(\"%d\", &n);\n  for (i = 0, h = 0, k = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", s1, &t);\n    if (t >= 60) {\n      b[h] = t;\n      strcpy(a[h], s1);\n      h++;\n    } else {\n      b1[k] = t;\n      strcpy(a1[k], s1);\n      k++;\n    }\n  }\n\n  for (i = 0; i <= h - 2; i++) {\n    for (j = 0; j <= h - 2 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        strcpy(s1, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], s1);\n      }\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i <= k - 1; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n}\n"}
{"label": "9", "index": "15362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bingren {\n  char id[10];\n  int o;\n} bingren[201];\nint main() {\n  int n, i, j, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bingren[i].id, &bingren[i].o);\n  }\n  for (i = 0, j = 100; i < n; i++) {\n\n    if (bingren[i].o >= 60) {\n      bingren[j] = bingren[i];\n      j++;\n    }\n  }\n  y = j;\n  for (j = 0; j < y - 1; j++) {\n    for (i = 100; i < y - j; i++) {\n      if (bingren[i].o < bingren[i + 1].o) {\n        bingren[200] = bingren[i];\n        bingren[i] = bingren[i + 1];\n        bingren[i + 1] = bingren[200];\n      }\n    }\n  }\n  for (i = 100; i < y; i++) {\n    printf(\"%s\\n\", bingren[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].o < 60)\n      printf(\"%s\\n\", bingren[i].id);\n  }\n}\n"}
{"label": "9", "index": "15363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int age[1000], a[1000], t;\n  char ID[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &ID[i], &age[i]);\n  j = n - 1;\n  k = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (age[i] < 60) {\n      a[j] = i;\n      j--;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (age[a[j]] > age[a[j - 1]]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << ID[a[i]] << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100], a[100], j = 0, k, l, temp, ord[100], o[100];\n  char num[100][10], old[100][10], t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n  for (i = 0; i < n; i++)\n    ord[i] = i;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[j] = age[i];\n      o[j] = ord[j];\n      strcpy(old[j], num[i]);\n      j++;\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] < a[l]) {\n        temp = a[k];\n        a[k] = a[l];\n        a[l] = temp;\n        temp = o[k];\n        o[k] = o[l];\n        o[l] = temp;\n        strcpy(t, old[k]);\n        strcpy(old[k], old[l]);\n        strcpy(old[l], t);\n      }\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] == a[l]) {\n        if (o[k] > o[l]) {\n          temp = a[k];\n          a[k] = a[l];\n          a[l] = temp;\n          temp = o[k];\n          o[k] = o[l];\n          o[l] = temp;\n          strcpy(t, old[k]);\n          strcpy(old[k], old[l]);\n          strcpy(old[l], t);\n        }\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n}\n"}
{"label": "9", "index": "15365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Ill {\n  char a[10];\n  int age;\n};\n\nint main() {\n  int n, i, k;\n  int m, l = 0;\n  int j = 0;\n  struct Ill illMan[100], illOld[100], temp, illOld1[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> illMan[i].a >> illMan[i].age;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age >= 60) {\n      illOld1[j] = illMan[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    m = 0;\n    for (k = 0; k < j; k++) {\n      if (m < illOld1[k].age) {\n        m = illOld1[k].age;\n      }\n    }\n    for (k = 0; k < j; k++) {\n      if (illOld1[k].age == m) {\n        illOld[l] = illOld1[k];\n        illOld1[k].age = 0;\n        l++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", illOld[i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age < 60) {\n      printf(\"%s\\n\", illMan[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pa[100];\n\nint main() {\n  int n, i, j, max = 59, m, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  for (i = 0; i < n; i++)\n    if (pa[i].age > 59)\n      t++;\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < n; i++)\n      if (pa[i].age > max) {\n        max = pa[i].age;\n        m = i;\n      }\n    printf(\"%s\\n\", pa[m].id);\n    pa[m].age = 0;\n    max = 59;\n  }\n\n  for (i = 0; i < n; i++)\n    if (pa[i].age <= 59 && pa[i].age != 0)\n      printf(\"%s\\n\", pa[i].id);\n}\n"}
{"label": "9", "index": "15367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char a[100];\n  int age;\n} pat[110], pat1[110];\n\nvoid bubble(int n) {\n  int i, j;\n  struct patient temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (pat1[j].age < pat1[j + 1].age) {\n        temp = pat1[j];\n        pat1[j] = pat1[j + 1];\n        pat1[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].a, &pat[i].age);\n    if (pat[i].age >= 60)\n      pat1[k++] = pat[i];\n  }\n  bubble(k);\n  for (i = 0; i < k; i++)\n    cout << pat1[i].a << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  }\n}\n"}
{"label": "9", "index": "15368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char id[11];\n  int age;\n} MAN;\n\nvoid sort(MAN *array, int nSize) {\n  int i, j;\n  for (i = 0; i < nSize; i++) {\n    for (j = nSize - 1; j > i; j--) {\n      if (array[j].age >= 60 && array[j].age > array[j - 1].age) {\n        MAN temp = array[j];\n        array[j] = array[j - 1];\n        array[j - 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int i, n;\n  MAN *array = 0;\n  double ava, maxgap = 0;\n\n  cin >> n;\n  array = (MAN *)malloc(n * sizeof(MAN));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", array[i].id, &(array[i].age));\n  }\n\n  sort(array, n);\n  for (i = 0; i < n; i++) {\n    cout << array[i].id << \"\\n\";\n  }\n\n  free(array);\n  return 0;\n}\n"}
{"label": "9", "index": "15369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a[100], b[100], k, m = 0, sum = 59;\n  char c[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      }\n    }\n    a[k] = 0;\n    b[j] = k;\n    sum = 59;\n  }\n  for (j = 0; j < m; j++) {\n    printf(\"%s\\n\", c[b[j]]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] > 0) && (a[i] < 60)) {\n      cout << c[i] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "9", "index": "15370", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, max, l, sign = 0;\n  scanf(\"%d\", &n);\n  struct tt {\n    char pp[10];\n    int age;\n    struct tt *next;\n  };\n  struct tt *head, *p1, *p2, *p3;\n  head = (struct tt *)malloc(1000);\n  p1 = head;\n  p2 = head;\n  scanf(\"%s\", head->pp);\n  scanf(\"%d\", &head->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct tt *)malloc(1000);\n    ;\n    p2->next = p1;\n    cin >> p1->pp;\n    scanf(\"%d\", &p1->age);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= n; i++) {\n    if (sign == 1) {\n      printf(\"%s \", head->pp);\n      head = head->next;\n    } else if (sign == 0) {\n      max = (-1);\n      for (p2 = NULL, p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age > max) {\n          max = p1->age;\n          p3 = p2;\n        }\n        p2 = p1;\n      }\n      if (max < 60) {\n        sign = 1;\n        i--;\n        continue;\n      } else if (max >= 60) {\n        if (p3 == NULL) {\n          printf(\"%s \", head->pp);\n          head = head->next;\n        } else {\n          p1 = p3->next;\n          printf(\"%s \", p1->pp);\n          p3->next = p1->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[100][100];\n\n  int s1[100], sz[100], t[100];\n  int n, i, p, k;\n\n  scanf(\"%d\", &n);\n\n  int j = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", str[i], &sz[i]);\n\n    if (sz[i] >= 60) {\n      t[j] = i;\n      s1[j] = sz[i];\n      j++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (p = 0; p < j - k; p++) {\n      if (s1[p] < s1[p + 1]) {\n        int e, f;\n        e = s1[p + 1];\n        s1[p + 1] = s1[p];\n        s1[p] = e;\n        f = t[p + 1];\n        t[p + 1] = t[p];\n        t[p] = f;\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    cout << str[t[p]] << \"\\n\";\n  }\n\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      cout << str[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100], a, ageb[100], c, t;\n  char ID[100][100], IDb[100][100], IDc[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  i = 0;\n  c = 0;\n  while (i < n) {\n    if (age[i] >= 60) {\n      ageb[c] = age[i];\n      strcpy(IDb[c], ID[i]);\n      c++;\n    }\n    i++;\n  }\n  for (i = 0; i <= c - 1; i++)\n    for (a = 0; a < c - i - 1; a++)\n      if (ageb[a] < ageb[a + 1]) {\n        t = ageb[a];\n        strcpy(IDc, IDb[a]);\n        ageb[a] = ageb[a + 1];\n        strcpy(IDb[a], IDb[a + 1]);\n        ageb[a + 1] = t;\n        strcpy(IDb[a + 1], IDc);\n      }\n  for (i = 0; i <= c - 1; i++)\n    printf(\"%s\\n\", IDb[i]);\n  i = 0;\n  while (i < n) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", ID[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid bubble_sort(int a[100], char b[100][10], int n) {\n  int i, j, temp;\n  char temp_[10] = {0}, empty[10] = {0};\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (a[i] < a[i + 1]) {\n        temp = a[i];\n        strcpy(temp_, b[i]);\n        a[i] = a[i + 1];\n        strcpy(b[i], empty);\n        strcpy(b[i], b[i + 1]);\n        a[i + 1] = temp;\n        strcpy(b[i + 1], empty);\n        strcpy(b[i + 1], temp_);\n      }\n    }\n}\n\nint main() {\n  int age[100], Age_[100] = {0}, age_[100];\n  int n, i;\n  char id[100][10], Id_[100][10] = {0}, id_[100][10] = {0}, empty[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      Age_[i] = age[i];\n      strcpy(Id_[i], id[i]);\n    } else {\n      age_[i] = age[i];\n      strcpy(id_[i], id[i]);\n    }\n  }\n  bubble_sort(Age_, Id_, n);\n  for (i = 0; i < n; i++) {\n    if (strcmp(Id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", Id_[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(id_[i], empty) == 0)\n      continue;\n    else\n      cout << id_[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15374", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0;\n  cin >> n;\n  struct p {\n    char num[10000];\n    int age;\n  } p[100];\n  struct p1 {\n    char num1[10000];\n    int age1;\n  } p1[100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\\n\", p[i].num, &p[i].age);\n    if (p[i].age >= 60) {\n      strcpy(p1[m].num1, p[i].num);\n      p1[m].age1 = p[i].age;\n      m = m + 1;\n    }\n  }\n  int e;\n  char w[10000];\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (p1[j].age1 < p1[j + 1].age1) {\n        strcpy(w, p1[j + 1].num1);\n        strcpy(p1[j + 1].num1, p1[j].num1);\n        strcpy(p1[j].num1, w);\n        e = p1[j + 1].age1;\n        p1[j + 1].age1 = p1[j].age1;\n        p1[j].age1 = e;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", p1[i].num1);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  char id[100][10];\n  int old[100];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &old[i]);\n  }\n\n  int e;\n  char s[100][10];\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < n - j; k++) {\n      if (old[k] < old[k + 1] && old[k + 1] >= 60) {\n        e = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = e;\n        strcpy(s[k], id[k + 1]);\n        strcpy(id[k + 1], id[k]);\n        strcpy(id[k], s[k]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15376", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  char ID[100][10];\n  int nl[100];\n  int i;\n  char e[10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &nl[i]);\n  }\n  int m;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((nl[i] < 60 && nl[i + 1] >= 60) ||\n          (nl[i] >= 60 && nl[i + 1] >= 60 && nl[i + 1] > nl[i])) {\n        m = nl[i + 1];\n        nl[i + 1] = nl[i];\n        nl[i] = m;\n        strcpy(e, ID[i + 1]);\n        strcpy(ID[i + 1], ID[i]);\n        strcpy(ID[i], e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", ID[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, l;\n  int age[10000];\n  char ID[10000][10], order[10000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 1; j < n - i; j++) {\n      if (age[j] >= 60 && age[j] > age[m])\n        m = j;\n    }\n    for (j = 0; j < 10; j++) {\n      order[i][j] = ID[m][j];\n    }\n    for (j = m; j < n; j++) {\n      for (k = 0; k < 10; k++) {\n        ID[j][k] = ID[j + 1][k];\n      }\n      age[j] = age[j + 1];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(order[i]);\n  }\n}\n"}
{"label": "9", "index": "15378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} p[101];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", p[i].No, &p[i].age);\n  }\n  struct patient t;\n  for (i = 2; i <= n; i++) {\n    if (p[i].age >= 60) {\n      for (j = i; j > 1; j--) {\n        if (p[j - 1].age < p[j].age) {\n          t = p[j - 1];\n          p[j - 1] = p[j];\n          p[j] = t;\n        } else\n          break;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", p[i].No);\n  return 0;\n}\n"}
{"label": "9", "index": "15379", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo1[100], peo2[100], peo3[100], e;\n  int n, i, j, m, k;\n  scanf(\"%d\", &n);\n  char s[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo1[i].num);\n    scanf(\"%d\", &peo1[i].age);\n  }\n  j = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (peo1[i].age >= 60) {\n      peo2[j] = peo1[i];\n      j++;\n    } else if (peo1[i].age < 60) {\n      peo3[m] = peo1[i];\n      m++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (peo2[i].age < peo2[i + 1].age) {\n        e = peo2[i + 1];\n        peo2[i + 1] = peo2[i];\n        peo2[i] = e;\n      }\n    }\n  }\n  int a, b, c;\n  for (a = 0, i = 0; a < j; a++, i++) {\n    strcpy(s[a], peo2[i].num);\n  }\n\n  for (a = j, b = 0; a < n; a++, b++) {\n    strcpy(s[a], peo3[b].num);\n  }\n  for (c = 0; c < n; c++)\n    printf(\"%s\\n\", s[c]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstruct student {\n  int a;\n  struct student *next;\n  char num[20];\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s\", p1->num);\n  scanf(\"%d\", &p1->a);\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(sizeof(struct student));\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s\", p3->num);\n    scanf(\"%d\", &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL) {\n    p1 = p1->next;\n  }\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15381", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], i, j;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  int k = 0;\n  char shuchu[100][10];\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    if (age[i] < 60)\n      strcpy(shuchu[k++], id[i]);\n  }\n  char mid[100][10];\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        strcpy(mid[j], id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], mid[j]);\n      }\n    }\n  }\n  if (age[0] < 60)\n    goto E;\n  else {\n    for (i = 0; age[i] >= 60; i++)\n      printf(\"%s\\n\", id[i]);\n  }\nE:;\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", shuchu[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15382", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f, g, t;\n  cin >> n;\n  int p[n], e[n], d[n];\n  char a[n][100], b[n][100], c[n][100], s[100];\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> p[i];\n  }\n  j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n\n    if (p[i] >= 60) {\n      e[j] = p[i];\n      strcpy(b[j], a[i]);\n      j++;\n    } else {\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  for (f = 0; f < j - 1; f++) {\n    for (g = 0; g < j - 1 - f; g++) {\n      if (e[g] < e[g + 1]) {\n        t = e[g + 1];\n        e[g + 1] = e[g];\n        e[g] = t;\n        strcpy(s, b[g + 1]);\n        strcpy(b[g + 1], b[g]);\n        strcpy(b[g], s);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Pa {\n  char num[20];\n  int year;\n} pa[100];\nint main() {\n  int i, j, x = 0, d = 0, m, n;\n  int b[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa[i].num, &pa[i].year);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = pa[i].year;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        d = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      if (i == 0) {\n        for (j = 0; j < n; j++) {\n          if (pa[j].year == b[i])\n            printf(\"%s\\n\", pa[j].num);\n        }\n      } else {\n        if (b[i] != b[i - 1]) {\n          for (j = 0; j < n; j++) {\n            if (pa[j].year == b[i])\n              printf(\"%s\\n\", pa[j].num);\n          }\n        }\n      }\n    }\n    if (b[i] < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].year < 60)\n      printf(\"%s\\n\", pa[i].num);\n  }\n}\n"}
{"label": "9", "index": "15384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int old;\n} pt[100];\n\nint main() {\n  int n, i, j, k, e, h;\n  int yx[100], byx[100];\n  cin >> n;\n  j = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pt[i].id, &pt[i].old);\n    if (pt[i].old >= 60) {\n      yx[j] = i;\n      j++;\n    } else {\n      byx[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    for (h = 0; h < j - 1; h++) {\n      if (pt[yx[h]].old < pt[yx[h + 1]].old) {\n        e = yx[h];\n        yx[h] = yx[h + 1];\n        yx[h + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << pt[yx[i]].id << \" \";\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", pt[byx[i]].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[15];\n  int age;\n  struct patient *ne;\n};\n\nstruct patient *lian(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p;\n  struct patient *q;\n\n  head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", head->id, &head->age);\n  head->ne = 0;\n  q = head;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    cin >> p->id >> p->age;\n    p->ne = 0;\n    q->ne = p;\n    q = p;\n  }\n  return head;\n}\n\nint main() {\n  int n, max, sign, b = 5000;\n  struct patient *head;\n  struct patient *p;\n\n  scanf(\"%d\", &n);\n\n  head = lian(n);\n\n  for (;;) {\n\n    for (p = head, max = -1, sign = 0; p != NULL; p = p->ne) {\n      if (((p->age) >= 60) && max < (p->age) && ((p->age) < b)) {\n        max = p->age;\n        sign = 1;\n      }\n    }\n    b = max;\n    if (sign == 0)\n      break;\n    for (p = head; p != NULL; p = p->ne) {\n      if ((p->age) == max) {\n        printf(\"%s\\n\", p->id);\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->ne) {\n    if ((p->age) < 60)\n      cout << p->id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15386", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char id[100][10], old[100][10], yog[100][10];\n  int n, i, m = 0, l = 0, age[100], oag[100], yag[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &(age[i]));\n    if (age[i] >= 60) {\n      oag[m] = age[i];\n      strcpy(old[m], id[i]);\n      m++;\n    } else {\n      yag[l] = age[i];\n      strcpy(yog[l], id[i]);\n      l++;\n    }\n  }\n  char e_id[1][10];\n  int e_age, k;\n  for (k = 1; k <= m; k++) {\n    for (i = 0; i < m - k; i++) {\n      if (oag[i] < oag[i + 1]) {\n        strcpy(e_id[0], old[i]);\n        strcpy(old[i], old[i + 1]);\n        strcpy(old[i + 1], e_id[0]);\n        e_age = oag[i];\n        oag[i] = oag[i + 1];\n        oag[i + 1] = e_age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    puts(old[i]);\n\n  for (i = 0; i < l; i++)\n    puts(yog[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\nint main() {\n  int n, i, j;\n  char id1[20];\n  int age1, u;\n  struct patient temp;\n  struct patient *p;\n  struct patient a[500];\n  scanf(\"%d\", &n);\n  p = a;\n  u = 0;\n  for (; p < a + n; p++) {\n    scanf(\"%s\", id1);\n    scanf(\"%d\", &age1);\n    strcpy(p->id, id1);\n    p->age = age1;\n    p->num = u;\n    u++;\n  }\n  p = a;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if ((*(p + j)).age >= 60 || (*(p + j + 1)).age >= 60) {\n        if ((*(p + j)).age < (*(p + j + 1)).age) {\n          temp = *(p + j);\n          *(p + j) = *(p + j + 1);\n          *(p + j + 1) = temp;\n        }\n      } else\n        continue;\n    }\n  }\n  p = a;\n  for (; p < a + n; p++) {\n\n    printf(\"%s\\n\", p->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  char id[1000][1000];\n  int nl[1000];\n  char id_old[1000][1000], id_young[1000][1000];\n  int nl_old[1000];\n  int a = 0, b = 0;\n  scanf(\"%d\", &n);\n  char ids[1000];\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> nl[i];\n    if (nl[i] >= 60) {\n      strcpy(id_old[a], id[i]);\n      nl_old[a] = nl[i];\n      a++;\n    } else {\n      strcpy(id_young[b], id[i]);\n      b++;\n    }\n  }\n  int e;\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (nl_old[j] < nl_old[j + 1]) {\n        e = nl_old[j + 1];\n        nl_old[j + 1] = nl_old[j];\n        nl_old[j] = e;\n        strcpy(ids, id_old[j + 1]);\n        strcpy(id_old[j + 1], id_old[j]);\n        strcpy(id_old[j], ids);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", id_old[i]);\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s \", id_young[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100], oage[100];\n  char ID[100][10], old[100][10], young[100][10];\n  scanf(\"%d\", &n);\n  int i, m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", ID[i], &age[i]);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[k], ID[i]);\n      k++;\n    } else {\n      oage[j] = age[i];\n      strcpy(old[j], ID[i]);\n      j++;\n    }\n  }\n  for (i = 150; i >= 60; i--) {\n    for (m = 0; m < j; m++) {\n      if (oage[m] == i) {\n        printf(\"%s\\n\", old[m]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", young[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patients {\n  int num;\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, y, o;\n  struct patients list[100], young[100], old[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    list[i].num = i;\n    scanf(\"%s %d\", list[i].ID, &list[i].age);\n  }\n\n  y = 0;\n  o = 0;\n\n  for (i = 0; i < n; i++) {\n    if (list[i].age >= 60) {\n      old[o] = list[i];\n      o++;\n    } else {\n      young[y] = list[i];\n      y++;\n    }\n  }\n\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        struct patients check;\n        check = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = check;\n      }\n    }\n  }\n\n  for (i = 0; i < o; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", young[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    int y, a;\n    char id[10];\n  } p[100], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].y);\n    p[i].a = i + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[i].y >= 60 || p[j].y >= 60) {\n        if (p[j].y > p[i].y) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        } else if (p[i].y == p[j].y) {\n          if (p[j].a < p[i].a) {\n            t = p[i];\n            p[i] = p[j];\n            p[j] = t;\n          }\n        }\n      } else {\n        if (p[j].a < p[i].a) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, m;\n  int i, j = 0, k = 0;\n  struct patient a[100], b[100], c[100], t[1];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      strcpy(b[j].ID, a[i].ID);\n      b[j].age = a[i].age;\n      j = j + 1;\n    } else {\n      strcpy(c[k].ID, a[i].ID);\n      c[k].age = a[i].age;\n      k = k + 1;\n    }\n  }\n  m = j;\n  for (j = 1; j <= m - 1; j++) {\n    for (i = 0; i <= m - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        strcpy(t[0].ID, b[i].ID);\n        t[0].age = b[i].age;\n        strcpy(b[i].ID, b[i + 1].ID);\n        b[i].age = b[i + 1].age;\n        strcpy(b[i + 1].ID, t[0].ID);\n        b[i + 1].age = t[0].age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char str[10];\n  int y;\n} pa[101];\nint main() {\n  int n;\n  int i, j, k = 0, t = 0;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pa[i].str >> pa[i].y;\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].y >= 60) {\n      a[k] = i;\n      k++;\n    } else {\n      b[t] = i;\n      t++;\n    }\n  }\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (pa[a[j]].y < pa[a[j + 1]].y) {\n        pa[100] = pa[a[j]];\n        pa[a[j]] = pa[a[j + 1]];\n        pa[a[j + 1]] = pa[100];\n      }\n\n  for (i = 0; i < k; i++)\n    cout << pa[a[i]].str << \"\\n\";\n  for (i = 0; i < t; i++)\n    cout << pa[b[i]].str << \"\\n\";\n}\n"}
{"label": "9", "index": "15394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct P {\n  char id[10];\n  int age;\n} pa[100];\nstruct P pb[100];\nint main() {\n  int n, r = 0, s = 0, i, o, p, j, k;\n  scanf(\"%d \", &n);\n  struct P temp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", temp.id, &(temp.age));\n    if (temp.age >= 60) {\n      pb[r] = temp;\n      r++;\n    } else {\n      pa[s] = temp;\n      s++;\n    }\n  }\n  for (o = 0; o < r; o++) {\n    for (p = 0; p < r - o; p++) {\n      if (pb[p].age < pb[p + 1].age) {\n        struct P tmp = pb[p];\n        pb[p] = pb[p + 1];\n        pb[p + 1] = tmp;\n      }\n    }\n  }\n  for (j = 0; j < r; j++) {\n    cout << pb[j].id << \"\\n\";\n  }\n  for (k = 0; k < s; k++) {\n    printf(\"%s\\n\", pa[k].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15395", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char a[100];\n  int age;\n} pat[110], pat1[110];\n\nvoid bubble(int n) {\n  int i, j;\n  struct patient temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (pat1[j].age < pat1[j + 1].age) {\n        temp = pat1[j];\n        pat1[j] = pat1[j + 1];\n        pat1[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].a, &pat[i].age);\n    if (pat[i].age >= 60)\n      pat1[k++] = pat[i];\n  }\n  bubble(k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pat1[i].a);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  int age;\n  char num[10];\n\n} pat[100], old[100], you[100], exchange_1;\nint main() {\n  int n, i, p, q, result;\n  int k = 0, t = 0;\n  int temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].num);\n    scanf(\"%d\", &pat[i].age);\n    if (pat[i].age >= 60) {\n      old[k].age = pat[i].age;\n      strcpy(old[k].num, pat[i].num);\n      k++;\n    } else {\n      strcpy(you[t].num, pat[i].num);\n      t++;\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (q = 0; q < k - p; q++) {\n      if (old[q].age < old[q + 1].age) {\n        exchange_1.age = old[q].age;\n        old[q].age = old[q + 1].age;\n        old[q + 1].age = exchange_1.age;\n        strcpy(exchange_1.num, old[q].num);\n        strcpy(old[q].num, old[q + 1].num);\n        strcpy(old[q + 1].num, exchange_1.num);\n      }\n    }\n  }\n  for (result = 0; result < k; result++) {\n    printf(\"%s \", old[result].num);\n  }\n  for (result = 0; result < t; result++) {\n    printf(\"%s \", you[result].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15397", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid bubble(struct patient *a[], int n);\n\nint main() {\n  int n, i, s = 0;\n  struct patient p[100] = {\"0\", 0};\n  struct patient *pt[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p[i].ID >> p[i].age;\n    pt[i] = &p[i];\n  }\n  bubble(pt, n);\n  for (i = 0; i < n; i++) {\n    if (pt[i]->age >= 60) {\n      printf(\"%s\\n\", pt[i]->ID);\n      s++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].ID);\n    }\n  }\n  return 0;\n}\n\nvoid sort2(struct patient *a[], int n) {\n  int i, j, k;\n  struct patient *t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[j]->age > a[k]->age) {\n        k = j;\n      }\n    }\n    t = a[k];\n    a[k] = a[i];\n    a[i] = t;\n  }\n}\nvoid bubble(struct patient *a[], int n) {\n  int i, j;\n  struct patient *t;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - i - 2; j++) {\n      if (a[j]->age < a[j + 1]->age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15398", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], t, b[100], c[100];\n  char h[100][10], h1[100][10], h2[100][10], y[10];\n  cin >> n;\n  int i, j, k;\n  int i1, j1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", h[i]);\n    cin >> a[i];\n  }\n  i1 = 0;\n  j1 = 0;\n  for (k = 0; k < n; k++) {\n    if (a[k] >= 60) {\n      b[i1] = a[k];\n      strcpy(h1[i1], h[k]);\n      i1++;\n    } else {\n      c[j1] = a[k];\n      strcpy(h2[j1], h[k]);\n      j1++;\n    }\n  }\n\n  for (j = 0; j < i1 - 1; j++)\n    for (i = 0; i < i1 - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(y, h1[i]);\n        strcpy(h1[i], h1[i + 1]);\n        strcpy(h1[i + 1], y);\n      }\n\n  for (i = 0; i < i1; i++) {\n    puts(h1[i]);\n  }\n  for (i = 0; i < j1; i++)\n    puts(h2[i]);\n}\n"}
{"label": "9", "index": "15399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &at);\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n          \n        }\n        if (t == NULL) {\n          p11 = (struct patient *)malloc(sizeof(struct patient));\n          p11->age = at;\n          strcpy(p11->id, id);\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next) {\n    printf(\"%s \", t->id);\n  }\n  printf(\"%s\", t->id);\n}\n"}
{"label": "9", "index": "15400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char id[11];\n  int age;\n} MAN;\n\nvoid sort(MAN *array, int nSize) {\n  int i, j;\n  for (i = 0; i < nSize; i++) {\n    for (j = nSize - 1; j > i; j--) {\n      if (array[j].age >= 60 && array[j].age > array[j - 1].age) {\n        MAN temp = array[j];\n        array[j] = array[j - 1];\n        array[j - 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int i, n;\n  MAN *array = 0;\n  double ava, maxgap = 0;\n\n  cin >> n;\n  array = (MAN *)malloc(n * sizeof(MAN));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", array[i].id, &(array[i].age));\n  }\n\n  sort(array, n);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", array[i].id);\n  }\n\n  free(array);\n  return 0;\n}\n"}
{"label": "9", "index": "15401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, t = 0;\n\n  struct patient {\n    char str[10];\n    int age;\n  } pat[100], pat2[100], patt;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &pat[i].str, &pat[i].age);\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      pat2[j] = pat[i];\n      j++;\n      t++;\n    }\n\n  for (i = 0; i < t - 1; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (pat2[j + 1].age > pat2[j].age) {\n        patt = pat2[j];\n        pat2[j] = pat2[j + 1];\n        pat2[j + 1] = patt;\n      }\n    }\n  }\n\n  for (i = 0; i < t; i++)\n    cout << pat2[i].str << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].str);\n  }\n}\n"}
{"label": "9", "index": "15402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct a {\n    char id[10];\n    int age;\n  } p, q, a[100], old[100], yog[100];\n  int n, i = 0, x = 0, y = 0, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      old[x] = a[i];\n      x++;\n    }\n    if (a[i].age < 60) {\n      yog[y] = a[i];\n      y++;\n    }\n  }\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - 1; i++) {\n      if (old[i].age < old[i + 1].age) {\n        p = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = p;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    cout << old[i].id << \"\\n\";\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", yog[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct man {\n    char a[11];\n    int y;\n  } man[100];\n  int n;\n  cin >> n;\n  char b[11];\n  int y;\n  int i, j;\n  char c[100][11];\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b, &y);\n    if (y >= 60) {\n      strcpy(man[k].a, b);\n      man[k].y = y;\n      k++;\n    } else {\n      strcpy(c[m], b);\n      m++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      int y1, y2;\n      y1 = man[j].y;\n      y2 = man[j + 1].y;\n      if (y1 < y2) {\n        y = man[j + 1].y;\n        man[j + 1].y = man[j].y;\n        man[j].y = y;\n        strcpy(b, man[j + 1].a);\n        strcpy(man[j + 1].a, man[j].a);\n        strcpy(man[j].a, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(b, man[i].a);\n    printf(\"%s\\n\", b);\n  }\n  for (i = 0; i < m; i++) {\n    strcpy(b, c[i]);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, stu[2000][3], t[3], hao;\n  char ID[20000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &stu[i][1]);\n  for (i = 0; i < n; i++) {\n    stu[i][0] = atoi(ID[i]);\n    stu[i][2] = i;\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[j][1] <= stu[i][1]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = n - 1; i >= 0; i--) {\n    if (stu[i][1] >= 60) {\n\n      hao = stu[i][2];\n\n      printf(\"%s\\n\", ID[hao]);\n\n      n--;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i][2] > stu[j][2]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = 0; i < n; i++) {\n    hao = stu[i][2];\n\n    printf(\"%s\\n\", ID[hao]);\n  }\n}\n"}
{"label": "9", "index": "15405", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0, r = 0, e, j;\n  char id[100][10], a[100][10], b[100][10], c[100];\n  int nl[100], am[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> nl[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (nl[i] >= 60) {\n      strcpy(a[m], id[i]);\n      am[m] = nl[i];\n      m++;\n    } else {\n      strcpy(b[r], id[i]);\n\n      r++;\n    }\n  }\n  for (i = m - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (am[j] < am[j + 1]) {\n        e = am[j + 1];\n        am[j + 1] = am[j];\n        am[j] = e;\n        strcpy(c, a[j + 1]);\n        strcpy(a[j + 1], a[j]);\n        strcpy(a[j], c);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    puts(a[i]);\n\n  for (i = 0; i < r; i++) {\n    puts(b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n} * head, *p1, *p2;\nstruct patient *order(int n) {\n  int i, j, t;\n  char a[20];\n  for (i = 0; i < n - 1; i++) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->age >= 60 && p1->age < p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = head = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->age;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  while (p1) {\n    cout << p1->id << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  struct pe {\n    char id[100];\n    int y;\n  } * p;\n  p = (struct pe *)malloc(sizeof(pe) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (p + i)->id, &(p + i)->y);\n  }\n\n  struct pe tp;\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((p + j + 1)->y >= 60 && (p + j)->y < (p + j + 1)->y) {\n        tp = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = tp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << (p + i)->id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], i, e, k;\n  char id[100][10], p[10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &a[i]);\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = n - 1; i > k - 1; i--) {\n      if (a[i] > a[i - 1] && a[i] >= 60) {\n        e = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = e;\n        strcpy(p, id[i]);\n        strcpy(id[i], id[i - 1]);\n        strcpy(id[i - 1], p);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nvoid sort(struct patient *head, struct patient *s) {\n  struct patient *pre = head, *p = pre->next;\n  if (s->age >= 60) {\n    while (p != NULL && s->age <= p->age) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (pre->next != NULL) {\n      pre = pre->next;\n    }\n    pre->next = s;\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n    sort(head, p);\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << &p->id << \" \";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15410", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct a {\n  int year;\n  char id[10];\n  struct a *next;\n};\nstruct a *create(int n) {\n  struct a *p1, *p2, *head;\n  int i;\n  p1 = (struct a *)malloc(1000);\n  scanf(\"%s%d\", p1->id, &p1->year);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct a *)malloc(1000);\n    scanf(\"%s%d\", p1->id, &p1->year);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct a *head, *p, *q, *t[100];\n  int m, i, j = 0, k;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    if (p->year >= 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (k = 0; k < j - 1; k++)\n    for (i = 0; i < j - 1 - k; i++)\n      if (t[i]->year < t[i + 1]->year) {\n        p = t[i];\n        t[i] = t[i + 1];\n        t[i + 1] = p;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n  p = head;\n  j = 0;\n  for (i = 0; i < m; i++) {\n    if (p->year < 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n}\n"}
{"label": "9", "index": "15411", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pat {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *p[100];\n  struct pat *old[100];\n  struct pat *young[100], *temp;\n\n  for (i = 0; i < n; i++) {\n    p[i] = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p[i]->ID, &p[i]->age);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i]->age >= 60) {\n      old[k] = p[i];\n      k++;\n    } else {\n      young[j] = p[i];\n      j++;\n    }\n  }\n  int lenold = k, lenyoung = j;\n  for (k = 1; k < lenold; k++) {\n    for (i = 0; i < lenold - k; i++) {\n      if (old[i]->age < old[i + 1]->age) {\n        temp = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < lenold; i++) {\n    printf(\"%s \", old[i]->ID);\n  }\n  for (i = 0; i < lenyoung; i++) {\n    printf(\"%s \", young[i]->ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15412", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  char bh[999][999];\n  int nl[999];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", bh[i], &nl[i]);\n  }\n  int pd[999], k = 0;\n  for (i = 1; i <= n; i++) {\n    if (nl[i] >= 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  int e;\n  for (i = 1; i < k; i++) {\n    for (j = 1; j <= k - i; j++) {\n      if (nl[pd[j]] < nl[pd[j + 1]]) {\n        e = pd[j + 1];\n        pd[j + 1] = pd[j];\n        pd[j] = e;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (nl[i] < 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%s\\n\", bh[pd[i]]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15413", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d\", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j]) || (se[i] == se[j] && list[i] > list[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n  for (i = 0; i <= nums; i++) {\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15414", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct example {\n  char id[10];\n  int age;\n  struct example *next;\n};\n\nint i = 1, d, n;\nstruct example *creat(int n) {\n  struct example *head = NULL;\n  struct example *p1, *p2;\n  while (i <= n) {\n    p1 = (struct example *)malloc(sizeof(struct example));\n    scanf(\"%s%d\", &(*p1).id, &(*p1).age);\n    if (i == 1) {\n      head = p1;\n      p2 = head;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    i = i + 1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct example *paixu(struct example *head) {\n  char temp1[10] = {'\\0'};\n  int temp2;\n  struct example *p1, *p2;\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1->next;\n      if (p1->age < p2->age && ((p2->age) >= 60)) {\n        strcpy(temp1, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, temp1);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p1 = p1->next;\n    }\n  }\n  return head;\n}\n\nvoid print(struct example *head) {\n  struct example *s;\n  s = head;\n  if (head != NULL)\n    do {\n      printf(\"%s\\n\", s->id);\n      s = s->next;\n    } while (s != NULL);\n}\n\nint main() {\n  struct example *head = NULL;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = paixu(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *y;\n  cin >> n;\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  y = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).y);\n    if ((*(s + i)).y >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(y + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if (o[j].y > o[j - 1].y) {\n        t = o[j];\n        o[j] = o[j - 1];\n        o[j - 1] = t;\n      }\n    cout << (*(o + i)).id << \"\\n\";\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(y + i)).id);\n  return 0;\n}\n"}
{"label": "9", "index": "15416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, a[100], j;\n  struct patient {\n    char id[10];\n    int age;\n  } s[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].id, &s[i].age);\n  }\n  while (1) {\n    int max = 0;\n    for (i = 0; i < n; i++) {\n      if (s[i].age > s[max].age)\n        max = i;\n    }\n    if (s[max].age >= 60) {\n      printf(\"%s \", s[max].id);\n      s[max].age = 0;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].age > 0)\n      printf(\"%s \", s[i].id);\n  }\n}\n"}
{"label": "9", "index": "15417", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i <= q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15418", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, age[1000 + 10], num[1000 + 10];\n  char id[1000 + 10][1000 + 1] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    num[i] = i;\n  }\n  int flag, tempnum, tempage, j;\n  char tempid[1000 + 1];\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      flag = 0;\n      if (age[j] >= 60 && age[j - 1] < 60)\n        flag = 1;\n      else if (age[j] >= 60 && age[j - 1] >= 60) {\n        if (age[j] > age[j - 1])\n          flag = 1;\n        else if (age[j] == age[j - 1]) {\n          if (num[j] < num[j - 1])\n            flag = 1;\n        }\n      } else if (age[j] < 60 && age[j - 1] < 60) {\n        if (num[j] < num[j - 1])\n          flag = 1;\n      }\n      if (flag) {\n        tempnum = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = tempnum;\n        tempage = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = tempage;\n        strcpy(tempid, id[j]);\n        strcpy(id[j], id[j - 1]);\n        strcpy(id[j - 1], tempid);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n} person[100];\nint main() {\n  int i, j = -1, k, n, max;\n  char s[100][10], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &person[i].ID, &person[i].age);\n  for (i = 0; i < n; i++) {\n    a[i] = person[i].age;\n    if (person[i].age >= 60)\n      j++;\n  }\n  for (k = 0; k <= j; k++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%s\\n\", person[i].ID);\n        a[i] = 0;\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      printf(\"%s\\n\", person[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15420", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct f {\n  char id[10];\n  int old;\n} st[1000], stu[1000], temp;\nint main() {\n  int n, i, j, a, b, c;\n  char cc, aa, x[1000], y[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> st[i].id >> aa >> st[i].old >> cc;\n  }\n  a = 0;\n  for (j = 1; j <= n; j++) {\n    if (st[j].old >= 60) {\n      a++;\n      stu[a] = st[j];\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = 1; j <= i; j++) {\n      if (stu[j].old < stu[j + 1].old) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    puts(stu[i].id);\n  }\n  for (i = 1; i <= n; i++) {\n    if (st[i].old < 60) {\n      puts(st[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15421", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int age;\n} stu[100];\n\nint main() {\n  char c;\n  int n, i, j;\n  struct student *pstu = stu, e;\n  pstu = &stu[0];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n\n  for (j = 0; j < n; j++) {\n    if (stu[j].age >= 60) {\n      for (i = j; i > 0; i--) {\n        if (stu[i].age > stu[i - 1].age) {\n          e = *(pstu + i);\n          *(pstu + i) = *(pstu + i - 1);\n          *(pstu - 1 + i) = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (pstu + i)->num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    char ID[10];\n    int age;\n  } stu[100], stud[100];\n  int a[100], b[100], i, c, j, x, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].age);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].age >= 60) {\n      a[k] = stu[i].age;\n      b[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    c = b[i];\n    cout << stu[c].ID << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].age < 60) {\n      cout << stu[i].ID << \"\\n\";\n    }\n  }\n}\n"}
{"label": "9", "index": "15423", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char A[10];\n  int age;\n};\n\nint main() {\n  int i, n, k, count;\n  struct patient inter;\n  struct patient *p;\n  scanf(\"%d\", &n);\n  struct patient *sick = (struct patient *)malloc(sizeof(struct patient) * n);\n  struct patient *waitlist =\n      (struct patient *)malloc(sizeof(struct patient) * n);\n  count = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", sick[i].A, &sick[i].age);\n  }\n  p = waitlist;\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      *p = sick[i];\n      p++;\n      count++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sick[i].age < 60) {\n      *p = sick[i];\n      p++;\n    }\n  }\n  for (i = 1; i < count; i++) {\n    for (k = 0; k < count - i; k++) {\n      if (waitlist[k].age < waitlist[k + 1].age) {\n        inter = waitlist[k + 1];\n        waitlist[k + 1] = waitlist[k];\n        waitlist[k] = inter;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", waitlist[i].A);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct peo {\n    char num[10];\n    int old;\n    struct peo *next;\n  };\n  struct peo *p, *p1, *p2, *p3, *head1, *head2, *head3;\n  int n, i, j, k;\n  p = p1 = p2 = p3 = head1 = head2 = head3 = (struct peo *)malloc\n\n      (sizeof(struct peo));\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &p1->num, &p1->old);\n    if (i == 1)\n      head1 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct peo *)malloc(sizeof(struct peo));\n  }\n  for (i = 1; i <= n; i++) {\n    p1 = head1;\n    p2 = head1;\n    for (j = 1; j <= (n + 1 - i); j++) {\n      if (p1->old > p2->old && p1->old >= 60) {\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    if (i == 1) {\n      head2 = p2;\n    } else\n      p->next = p2;\n    p = p2;\n    p1 = head1;\n    p3 = head1;\n    for (j = 1; j <= (n - i + 1); j++) {\n      if (p1->num == p2->num) {\n        if (j == 1)\n          head1 = p1->next;\n        else\n          p3->next = p1->next;\n      }\n      p3 = p1;\n      p1 = p1->next;\n    }\n  }\n  p = head2;\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n} pat[100], str[100], t;\nint main() {\n  int n, i, j, a = -1, temp;\n\n  char c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      a++;\n      strcpy(str[a].num, pat[i].num);\n      str[a].age = pat[i].age;\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (str[j].age < str[j + 1].age) {\n        t = str[j];\n        str[j] = str[j + 1];\n        str[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      a++;\n      str[a] = pat[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", str[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, stu[2000][3], t[3], hao;\n  char ID[20000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &stu[i][1]);\n  for (i = 0; i < n; i++) {\n    stu[i][0] = atoi(ID[i]);\n    stu[i][2] = i;\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[j][1] <= stu[i][1]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = n - 1; i >= 0; i--) {\n    if (stu[i][1] >= 60) {\n\n      hao = stu[i][2];\n\n      cout << ID[hao] << \"\\n\";\n\n      n--;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i][2] > stu[j][2]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = 0; i < n; i++) {\n    hao = stu[i][2];\n\n    printf(\"%s\\n\", ID[hao]);\n  }\n}\n"}
{"label": "9", "index": "15427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n\n} per[100];\nint main() {\n  int i, n, j, k = 0, a[100] = {0}, num = 0, temp1;\n  char b[100][10] = {0}, temp2[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n  for (i = 0; i < n; i++) {\n    if (per[i].age >= 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < num - j; k++)\n      if (a[k] < a[k + 1]) {\n        temp1 = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = temp1;\n        strcpy(temp2, b[k]);\n        strcpy(b[k], b[k + 1]);\n        strcpy(b[k + 1], temp2);\n      }\n  }\n  for (i = 0, k = num; i < n; i++) {\n    if (per[i].age < 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (k = 0; k < num - 1; k++)\n    printf(\"%s\\n\", b[k]);\n  cout << b[num - 1];\n}\n"}
{"label": "9", "index": "15428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, b[100], n1 = 0, n2 = 0, ha[100], pp[100], x;\n  char a[100][11], yi[100][10], er[100][10], y[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      n1++;\n    } else {\n      n2++;\n    }\n  }\n  for (i = 0, k = 0, l = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      ha[k] = b[i];\n      strcpy(yi[k], a[i]);\n      k++;\n    } else {\n      pp[l] = b[i];\n      strcpy(er[l], a[i]);\n      l++;\n    }\n  }\n  for (i = 1; i < n1; i++) {\n    for (k = 0; k < n1 - i; k++) {\n      if (ha[k] < ha[k + 1]) {\n        x = ha[k];\n        ha[k] = ha[k + 1];\n        ha[k + 1] = x;\n        strcpy(y, yi[k]);\n        strcpy(yi[k], yi[k + 1]);\n        strcpy(yi[k + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    printf(\"%s\\n\", yi[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    cout << er[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[20];\n    int age;\n  } pa1[100], pa2[100], t;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa1[i].id, &pa1[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    strcpy(pa2[i].id, pa1[i].id);\n    pa2[i].age = pa1[i].age;\n  }\n\n  for (p = 1; p < n; p++) {\n    for (q = 0; q < n - p; q++) {\n      if (pa1[q].age > pa1[q + 1].age) {\n        t = pa1[q];\n        pa1[q] = pa1[q + 1];\n        pa1[q + 1] = t;\n      }\n    }\n  }\n\n  int a[1000];\n  int s = 0, h;\n  for (p = n - 1; p >= 0; p--) {\n    if (pa1[p].age >= 60) {\n      a[s] = pa1[p].age;\n      s++;\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = h + 1; p < s; p++) {\n      if (a[p] == a[h]) {\n        a[p] = 0;\n      }\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = 0; p < n; p++) {\n      if (pa2[p].age == a[h]) {\n        printf(\"%s\\n\", pa2[p].id);\n      }\n    }\n  }\n\n  for (p = 0; p < n; p++) {\n    if (pa2[p].age < 60) {\n      printf(\"%s\\n\", pa2[p].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char name[11];\n  int age;\n  int order;\n};\nint main() {\n  struct patient peo[1000];\n  int n, i, count = 0, COUNT, j, k, e, agedata[1000], a = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> peo[i].name;\n    scanf(\"%d\", &peo[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      count++;\n      agedata[a] = peo[i].age;\n      a++;\n    }\n  }\n  COUNT = count;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      peo[i].order = count;\n      count++;\n    }\n  }\n  for (k = 1; k < COUNT; k++) {\n    for (j = 0; j < COUNT - k; j++) {\n      if (agedata[j] < agedata[j + 1]) {\n        e = agedata[j + 1];\n        agedata[j + 1] = agedata[j];\n        agedata[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < COUNT; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].age == agedata[i]) {\n        peo[j].order = i;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].order == i) {\n        cout << peo[j].name << \" \";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[11];\n  int age;\n} p[1000];\n\nint main() {\n  int n, i, k, j, l, a = 0, b = 0, e;\n  int sz1[1000], sz2[1000];\n  char zfc1[1000][11], zfc2[1000][11], f[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &p[i].ID);\n    scanf(\" %d\", &p[i].age);\n  }\n  for (i = 0, j = 0, l = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a++;\n      sz1[j] = p[i].age;\n      strcpy(zfc1[j], p[i].ID);\n      j++;\n    } else {\n      b++;\n      sz2[l] = p[i].age;\n      strcpy(zfc2[l], p[i].ID);\n      l++;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (j = n - 1; j >= k; j--) {\n      if (sz1[j + 1] > sz1[j]) {\n        e = sz1[j];\n        sz1[j] = sz1[j + 1];\n        sz1[j + 1] = e;\n        strcpy(f, zfc1[j]);\n        strcpy(zfc1[j], zfc1[j + 1]);\n        strcpy(zfc1[j + 1], f);\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    cout << zfc1[j] << \"\\n\";\n  }\n\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", zfc2[l]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int age[100], a, m = 0, tmp1[100], d = 0;\n  char zfc[100][11], tmp2[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      strcpy(tmp2[m], zfc[i]);\n      tmp1[m] = age[i];\n      m++;\n    }\n  }\n  for (a = m - 1; a > 0; a--) {\n    for (d = 0; d < a; d++) {\n      if (tmp1[d] < tmp1[d + 1]) {\n        char s[200];\n        strcpy(s, tmp2[d]);\n        strcpy(tmp2[d], tmp2[d + 1]);\n        strcpy(tmp2[d + 1], s);\n        int y;\n        y = tmp1[d];\n        tmp1[d] = tmp1[d + 1];\n        tmp1[d + 1] = y;\n      }\n    }\n  }\n  for (a = 0; a < m; a++) {\n    cout << tmp2[a] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      cout << zfc[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], zs[100], i, k = 0, m, a;\n  char id[100][10], di[100][10], zfc[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      zs[k] = sz[i];\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (m = 0; m < k - 1; m++) {\n    for (i = 0; i < k - 1 - m; i++) {\n      if (zs[i] < zs[i + 1]) {\n        a = zs[i];\n        zs[i] = zs[i + 1];\n        zs[i + 1] = a;\n        strcpy(zfc, di[i]);\n        strcpy(di[i], di[i + 1]);\n        strcpy(di[i + 1], zfc);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << di[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], order[100], buffer[100], swap_1;\n\nint main() {\n\n  int i, j = 0, m = 0, n, k, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      order[j] = pat[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      buffer[m] = pat[i];\n      m++;\n    }\n  }\n\n  for (p = 1; p < j; p++) {\n    for (q = 0; q < j - p; q++) {\n      if (order[q].age < order[q + 1].age) {\n        swap_1 = order[q + 1];\n        order[q + 1] = order[q];\n        order[q] = swap_1;\n      }\n    }\n  }\n  for (q = 0; q < j; q++) {\n    printf(\"%s\", order[q].id);\n    printf(\" \");\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\", buffer[i].id);\n    printf(\" \");\n  }\n}\n"}
{"label": "9", "index": "15435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  struct {\n    char hao[10];\n    int ni;\n    int pa;\n  } dk[100], t, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(dk[i].hao), &(dk[i].ni));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if ((dk[j].ni < 60) && (dk[j + 1].ni >= 60)) {\n        t = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((dk[j + 1].ni >= 60) && (dk[j].ni >= 60) &&\n          (dk[j].ni < dk[j + 1].ni)) {\n        p = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = p;\n      }\n    }\n  }\n  b = strlen(dk[0].hao);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < b; j++) {\n      cout << dk[i].hao[j];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15436", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, k, m, n, e, x, s[100], t[100], v = 0;\n  char zfc[100][10], jg[100][10], h[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zfc[i];\n    cin >> s[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] >= 60) {\n      t[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (s[t[k]] < s[t[k + 1]]) {\n        m = t[k + 1];\n        t[k + 1] = t[k];\n        t[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(zfc[t[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] < 60) {\n      puts(zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n} pat[100];\nint main() {\n  int n, a[200], j, i;\n  scanf(\"%d\", &n);\n  for (j = 0; j < 150; j++)\n    a[j] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    for (j = 1; j < 150; j++) {\n      if (j == pat[i].age)\n        a[j]++;\n    }\n  }\n  for (j = 150; j >= 60; j--) {\n    if (a[j] == 0)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (j == pat[i].age)\n        printf(\"%s \", pat[i].id);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s \", pat[i].id);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct sick {\n  char *num;\n  int age;\n  struct sick *next;\n};\nstruct sick *range(int N) {\n  struct sick *pnew, *ppre, *p, *head, *last;\n  pnew = (struct sick *)malloc(1000);\n  pnew->num = (char *)malloc(100 * sizeof(char));\n  pnew->next = NULL;\n  cin >> pnew->num >> pnew->age;\n  head = last = pnew;\n  int i;\n  for (i = 2; i <= N; i++) {\n    pnew = (struct sick *)malloc(1000);\n    pnew->num = (char *)malloc(100 * sizeof(char));\n    pnew->next = NULL;\n    scanf(\"%s %d\", pnew->num, &pnew->age);\n    int j;\n    if (pnew->age < 60) {\n      last->next = pnew;\n      last = pnew;\n    } else {\n      if (pnew->age > head->age) {\n        pnew->next = head;\n        head = pnew;\n      } else {\n        ppre = head;\n        p = head->next;\n        for (j = 2; p != NULL; j++) {\n          if (pnew->age > p->age) {\n            ppre->next = pnew;\n            pnew->next = p;\n            break;\n          } else {\n            ppre = ppre->next;\n            p = p->next;\n          }\n        }\n      }\n      if (pnew->next == NULL) {\n        last->next = pnew;\n        last = pnew;\n      }\n    }\n  }\n  return (head);\n}\nvoid print(struct sick *head, int N) {\n  struct sick *p = head;\n  int i;\n  for (i = 1; i <= N; i++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n\nint main() {\n  int N;\n  cin >> N;\n  struct sick *head = range(N);\n  print(head, N);\n  return 0;\n}\n"}
{"label": "9", "index": "15439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pat {\n    char id[10];\n    int age;\n  } pat[201];\n  int i, n, j, x = 0, y = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      pat[100 + x] = pat[i];\n      x++;\n    } else {\n      pat[y] = pat[i];\n      y++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - i - 1; j++) {\n      if (pat[100 + j].age < pat[101 + j].age) {\n        pat[200] = pat[100 + j];\n        pat[100 + j] = pat[101 + j];\n        pat[101 + j] = pat[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    printf(\"%s\\n\", pat[100 + i].id);\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "15440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int age[100], i, j, k, p = 0, n;\n  char a[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &age[i]);\n    if (age[i] >= 60)\n      p++;\n  }\n  for (j = 1; j <= p; j++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (age[i] > age[k])\n        k = i;\n    }\n    printf(\"%s\\n\", a[k]);\n    age[k] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0, k;\n  int t;\n  int old[100];\n  int age[100];\n  char a[100][20];\n  char a1[100][20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    scanf(\"%s\", a1[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    age[i] = atoi(a1[i]);\n    if (age[i] >= 60) {\n      old[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    for (k = 0; k < j - i - 1; k++)\n      if (age[old[k]] < age[old[k + 1]]) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[old[i]]);\n  for (i = 1; i <= n; i++) {\n    if (age[i] >= 60)\n      continue;\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bin {\n  char num[10];\n  int age;\n} t, b[100], c[100], a[100];\nint main() {\n  int n, i, j = 0, k = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].num, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n    p = j;\n    if (a[i].age < 60) {\n      c[k] = a[i];\n      k++;\n    }\n    q = k;\n  }\n\n  for (j = 1; j < p; j++)\n    for (i = 0; i < p - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", b[i].num);\n  for (i = 0; i < q; i++)\n    printf(\"%s\\n\", c[i].num);\n}\n"}
{"label": "9", "index": "15443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int w;\n  char c[20];\n  int old;\n  struct data *next;\n  struct data *onext;\n};\nint main() {\n  int i, j, n, max, x;\n  scanf(\"%d\", &n);\n  struct data *head = (struct data *)malloc(sizeof(struct data));\n  struct data *p, *pp, *de;\n  pp = head;\n  for (i = 0; i < n; i++) {\n    p = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%s %d\", p->c, &p->w);\n    p->old = 0;\n    pp->next = p;\n    pp = p;\n  }\n  struct data *old = (struct data *)malloc(sizeof(struct data));\n  pp = head->next;\n  de = old;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    if (pp->w > 59) {\n      pp->old = 1;\n      de->onext = pp;\n      de = pp;\n      x++;\n    }\n    pp = pp->next;\n  }\n  for (i = 0; i < x; i++) {\n    pp = old->onext;\n    max = 0;\n    for (j = 0; j < x; j++) {\n      if (pp->w > max) {\n        max = pp->w;\n        de = pp;\n      }\n      pp = pp->onext;\n    }\n    printf(\"%s\\n\", de->c);\n    de->w = -1;\n  }\n  pp = head->next;\n  for (i = 0; i < n; i++) {\n    if (pp->old == 0)\n      printf(\"%s\\n\", pp->c);\n    pp = pp->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, e, z = 0;\n  int a[100], c[100], x[100];\n  char b[100][10], d[100][10], y[100][10];\n  char f[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", b[i], &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      c[s] = a[i];\n      strcpy(d[s], b[i]);\n      s++;\n    } else {\n      x[z] = a[i];\n      strcpy(y[z], b[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 1; j < s - i; j++) {\n      if (c[j - 1] < c[j]) {\n        e = c[j];\n        c[j] = c[j - 1];\n        c[j - 1] = e;\n        strcpy(f[j], d[j]);\n        strcpy(d[j], d[j - 1]);\n        strcpy(d[j - 1], f[j]);\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < z; i++) {\n    printf(\"%s\\n\", y[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10], a[10];\n  int n, i, j;\n  int age[100], b;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\" %s %d\", &id[i], &age[i]);\n  }\n\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (age[i] >= 60 && age[i - 1] >= 60) {\n        if (age[i] > age[i - 1]) {\n          strcpy(a, id[i]);\n          b = age[i];\n          strcpy(id[i], id[i - 1]);\n          age[i] = age[i - 1];\n          strcpy(id[i - 1], a);\n          age[i - 1] = b;\n        }\n      }\n      if (age[i] >= 60 && age[i - 1] < 60) {\n        strcpy(a, id[i]);\n        b = age[i];\n        strcpy(id[i], id[i - 1]);\n        age[i] = age[i - 1];\n        strcpy(id[i - 1], a);\n        age[i - 1] = b;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << id[i];\n    else\n      cout << \"\\n\" << id[i];\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[11];\n    int age;\n    struct pa *next;\n  } * head, *p1, *p2, *p3, *p4;\n  int tage;\n  char tID[11];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p1 = (struct pa *)malloc(sizeof(struct pa));\n    if (i == 0)\n      head = p1;\n    cin >> p1->ID >> p1->age;\n    if (i != 0)\n      p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = NULL;\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < n; i++) {\n    p3 = p1;\n    p4 = p2;\n    for (j = 0; j < n - 1; j++) {\n      if (p3->age < p4->age && p4->age >= 60) {\n        strcpy(tID, p3->ID);\n        tage = p3->age;\n        strcpy(p3->ID, p4->ID);\n        p3->age = p4->age;\n        strcpy(p4->ID, tID);\n        p4->age = tage;\n      }\n      p3 = p3->next;\n      p4 = p4->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    cout << p1->ID << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15447", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n;\n\n  int a[101], b[101];\n\n  char c[101][11], d[101][11];\n\n  int i, j;\n\n  int ni, nj, nk;\n\n  char ci[11], cj[11], ck[11];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> c[i];\n    strcpy(d[i], c[i]);\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] < a[j + 1]) {\n        ni = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = ni;\n        strcpy(ci, c[j + 1]);\n        strcpy(c[j + 1], c[j]);\n        strcpy(c[j], ci);\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] < 60) {\n      printf(\"%s\\n\", d[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int old;\n} pt[100];\n\nint main() {\n  int n, i, j, k, e, h;\n  int yx[100], byx[100];\n  scanf(\"%d\", &n);\n\n  j = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pt[i].id, &pt[i].old);\n    if (pt[i].old >= 60) {\n      yx[j] = i;\n      j++;\n    } else {\n      byx[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    for (h = 0; h < j - 1; h++) {\n      if (pt[yx[h]].old < pt[yx[h + 1]].old) {\n        e = yx[h];\n        yx[h] = yx[h + 1];\n        yx[h + 1] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s \", pt[yx[i]].id);\n\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", pt[byx[i]].id);\n  }\n}\n"}
{"label": "9", "index": "15449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, age[1000 + 10], num[1000 + 10];\n  char id[1000 + 10][1000 + 1] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    num[i] = i;\n  }\n  int flag, tempnum, tempage, j;\n  char tempid[1000 + 1];\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      flag = 0;\n      if (age[j] >= 60 && age[j - 1] < 60)\n        flag = 1;\n      else if (age[j] >= 60 && age[j - 1] >= 60) {\n        if (age[j] > age[j - 1])\n          flag = 1;\n        else if (age[j] == age[j - 1]) {\n          if (num[j] < num[j - 1])\n            flag = 1;\n        }\n      } else if (age[j] < 60 && age[j - 1] < 60) {\n        if (num[j] < num[j - 1])\n          flag = 1;\n      }\n      if (flag) {\n        tempnum = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = tempnum;\n        tempage = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = tempage;\n        strcpy(tempid, id[j]);\n        strcpy(id[j], id[j - 1]);\n        strcpy(id[j - 1], tempid);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15450", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mouse {\n  char id[10];\n  int age;\n  struct mouse *next;\n};\nstruct mouse *creat(int n) {\n  struct mouse *head, *p1, *p2;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    if (i > 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct mouse *order(struct mouse *head, int n) {\n  struct mouse *p1, *p2;\n  int i, j, x;\n  char a[10];\n  for (i = 1; i < n; i++) {\n    p2 = head;\n    p1 = p2->next;\n    for (j = 0; j < n - i; j++) {\n      if (p2->age < p1->age && p1->age >= 60) {\n        x = p2->age;\n        p2->age = p1->age;\n        p1->age = x;\n        strcpy(a, p2->id);\n        strcpy(p2->id, p1->id);\n        strcpy(p1->id, a);\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n  return (head);\n}\nint main() {\n  struct mouse *head, *p;\n  int i, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = order(head, n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct people {\n    char id[30];\n    int age;\n  } x[100], y[100], z;\n  int a, b, c, e, i, j = 0, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[k].id, &x[k].age);\n    if (x[k].age >= 60) {\n      y[j].age = x[k].age;\n      strcpy(y[j].id, x[k].id);\n      j = j + 1;\n      k = k - 1;\n    }\n    k = k + 1;\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (y[k].age < y[k + 1].age) {\n        z = y[k + 1];\n        y[k + 1] = y[k];\n        y[k] = z;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", y[i].id);\n  for (i = 0; i < n - j; i++)\n    cout << x[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], p[100];\nint main() {\n  int n, m = 0, i, j = 0, k, temp, a[40] = {0}, sum = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p[j++] = pat[i];\n      m++;\n    }\n  }\n  a[0] = p[0].age;\n  for (j = 1; j < m; j++) {\n    for (i = 0; a[i] != 0; i++)\n      if (a[i] == p[j].age)\n        break;\n    if (a[i] == 0) {\n      a[i] = p[j].age;\n      sum++;\n    }\n  }\n  for (j = 0; j < sum - 1; j++) {\n    k = j;\n    {\n      for (i = j + 1; i < sum; i++)\n        if (a[i] > a[j]) {\n          k = i;\n          temp = a[k];\n          a[k] = a[j];\n          a[j] = temp;\n        }\n    }\n  }\n  for (k = 0; k < sum; k++) {\n    for (j = 0; j < m; j++) {\n      if (p[j].age == a[k])\n        printf(\"%s\\n\", p[j].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15453", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char tmp[100];\n  int n, i, j = 0, o = 0, tmpn;\n  struct {\n    char num[100];\n    int a, k;\n  } s[1000], t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].a;\n    if (s[i].a >= 60)\n      s[i].k = 1;\n    else\n      s[i].k = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1) {\n      strcpy(t[j].num, s[i].num);\n      t[j].a = s[i].a;\n      j++;\n      o++;\n    }\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (t[j].a < t[j + 1].a) {\n        tmpn = t[j].a;\n        t[j].a = t[j + 1].a;\n        t[j + 1].a = tmpn;\n        strcpy(tmp, t[j].num);\n        strcpy(t[j].num, t[j + 1].num);\n        strcpy(t[j + 1].num, tmp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", t[i].num);\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1)\n      continue;\n    printf(\"%s\\n\", s[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct arr {\n  char id[10];\n  int age;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  scanf(\"%s %d\", &p1->id, &p1->age);\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%s %d\", &p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return (head);\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->age == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->age == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%s \", p->id);\n    else\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  if (head != NULL) {\n    while (p != NULL) {\n      head = head->next;\n      free(p);\n      p = head;\n    }\n  }\n}\nint main() {\n  struct arr *head, *p1;\n  int m, max = 0;\n  scanf(\"%d\", &m);\n  head = create(m);\n  for (;;) {\n    max = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next) {\n      max = (max > p1->age) ? max : p1->age;\n    }\n\n    if (max >= 60) {\n      for (p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age == max)\n          printf(\"%s \", p1->id);\n      }\n      head = del(head, max);\n    } else\n      break;\n  }\n  print(head);\n  freelist(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char m[10];\n    int a;\n  };\n  struct pa p[100], t, s = {\"0\", 0}, pp[100];\n  int n, i, j = 0, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &p[i].m, &p[i].a);\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    t = s;\n    k = 100;\n    for (i = 0; i < n; i++) {\n      if (p[i].a >= 60 && p[i].a > t.a) {\n        t = p[i];\n        k = i;\n      }\n    }\n    pp[j] = t;\n    p[k] = s;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].a < 60 && p[i].a > 0) {\n      pp[j] = p[i];\n      j++;\n    }\n\n  for (i = 0; i < n; i++)\n    cout << pp[i].m << \"\\n\";\n}\n"}
{"label": "9", "index": "15456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n} pat[100], str[100], t;\nint main() {\n\n  int n, i, j, a = -1, temp;\n  int ch[100];\n  char c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      a++;\n      strcpy(str[a].num, pat[i].num);\n      str[a].age = pat[i].age;\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (str[j].age < str[j + 1].age) {\n        t = str[j];\n        str[j] = str[j + 1];\n        str[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      a++;\n      str[a] = pat[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", str[i].num);\n  }\n}\n"}
{"label": "9", "index": "15457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient_t {\n    char id[10];\n    int age;\n  } patients[100], t;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &patients[i].id, &patients[i].age);\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, m;\n  int a[100];\n\n  char b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &b[i], &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] >= 60 && a[j] > a[j - 1]) {\n        m = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = m;\n        char t[10];\n\n        strcpy(t, b[j]);\n        strcpy(b[j], b[j - 1]);\n        strcpy(b[j - 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } br[100];\n\n  int n, i, j, mid, k;\n\n  char s[10];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &br[i].id, &br[i].age);\n  }\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (br[i].age >= 60) {\n        for (j = i + 1; j < n; j++) {\n          if (br[j].age >= 60) {\n            if (br[j].age > br[i].age) {\n              mid = br[i].age;\n              br[i].age = br[j].age;\n              br[j].age = mid;\n\n              strcpy(s, br[i].id);\n              strcpy(br[i].id, br[j].id);\n              strcpy(br[j].id, s);\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age >= 60)\n      cout << br[i].id << \"\\n\";\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age < 60) {\n      cout << br[i].id << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient_t {\n    char id[10];\n    int age;\n  } patients[100], t;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> patients[i].id >> patients[i].age;\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct sick {\n  int age;\n  char id[100];\n  struct sick *next;\n};\nstruct sick *insert(struct sick *head, struct sick *new1) {\n  struct sick *p0, *p1, *p2, *p;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->age < 60) {\n      p1 = head;\n      while (p1 != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p2->next = p0;\n      p0->next = NULL;\n    } else {\n      while ((p1->age >= p0->age) && (p1->next != NULL)) \n      {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->age > p1->age) \n      {\n        if (head == p1)\n          head = p0;\n        else\n          p2->next = p0;\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  struct sick *head, *p;\n  int n, i;\n  head = NULL; \n  scanf(\"%d\", &n);\n  struct sick *insert(struct sick * head, struct sick * new1); \n  for (i = 0; i < n; i++) {\n    p = (struct sick *)malloc(sizeof(struct sick));\n    scanf(\"%s %d\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  do {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "15462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, e, z = 0;\n  int a[100], c[100], x[100];\n  char b[100][10], d[100][10], y[100][10];\n  char f[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", b[i], &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      c[s] = a[i];\n      strcpy(d[s], b[i]);\n      s++;\n    } else {\n      x[z] = a[i];\n      strcpy(y[z], b[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    for (j = 1; j < s - i; j++) {\n      if (c[j - 1] < c[j]) {\n        e = c[j];\n        c[j] = c[j - 1];\n        c[j - 1] = e;\n        strcpy(f[j], d[j]);\n        strcpy(d[j], d[j - 1]);\n        strcpy(d[j - 1], f[j]);\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < z; i++) {\n    cout << y[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b[100], c[100], j = 0, k, mid, p, m = 0, max;\n  struct patient {\n    char id[20];\n    int age;\n  } a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      b[j++] = i;\n    else\n      c[m++] = i;\n  }\n  for (i = 0; i < j; i++) {\n    max = i;\n    for (k = i; k < j; k++) {\n\n      if (a[b[k]].age > a[b[max]].age)\n        max = k;\n    }\n    mid = b[max];\n    for (k = max; k > i; k--)\n      b[k] = b[k - 1];\n    b[i] = mid;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[b[i]].id);\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", a[c[i]].id);\n}\n"}
{"label": "9", "index": "15464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, n;\nstruct st {\n  char a[20];\n  int x;\n  struct st *next;\n} * p1, *p2, *p, *head, *pre;\nint main() {\n  scanf(\"%d\", &n);\n  void f(struct st *);\n  p1 = p2 = head = (struct st *)malloc(sizeof(struct st));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->a, &p1->x);\n    p1 = (struct st *)malloc(sizeof(struct st));\n    p2->next = p1;\n    p2 = p1;\n  }\n  f(head);\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n  return 0;\n}\nvoid f(struct st *p) {\n  for (i = 0; i < n - 1; i++) {\n    pre = p1 = p2 = head;\n    p1 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p1->x > p2->x && p1->x >= 60) {\n        if (j == 0) {\n          p2->next = p1->next;\n          p1->next = p2;\n          head = pre = p1;\n        } else {\n          p2->next = p1->next;\n          p1->next = p2;\n          pre->next = p1;\n        }\n      }\n      if (j != 0)\n        pre = pre->next;\n      p2 = pre->next;\n      p1 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "15465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][1000 + 1];\n  char g[100][1000 + 1];\n  int h[100];\n  int k[100], a, i, j;\n  char q[100];\n  int n, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    cin >> k[i];\n  }\n  a = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (k[i] >= 60) {\n      a++;\n      h[j] = k[i];\n      strcpy(g[j], s[i]);\n      j++;\n      k[i] = 0;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (h[j] < h[j + 1]) {\n        e = h[j];\n        h[j] = h[j + 1];\n        h[j + 1] = e;\n        strcpy(q, g[j]);\n        strcpy(g[j], g[j + 1]);\n        strcpy(g[j + 1], q);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (k[i] != 0)\n      printf(\"%s \", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15466", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct guahao {\n  char num[20];\n  int year;\n};\nint main() {\n  int n, i, m;\n  struct guahao temp, *p, *t, *p1;\n  scanf(\"%d\", &n);\n  m = n;\n  struct guahao *bingren = (struct guahao *)malloc(sizeof(struct guahao) * n);\n  struct guahao *bingren1 = (struct guahao *)malloc(sizeof(struct guahao) * m);\n  p = bingren;\n  p1 = bingren1;\n  for (; p < bingren + n; p++, p1++) {\n    cin >> p->num >> p->year;\n    *p1 = *p;\n  }\n  p = bingren;\n  for (i = 0; p < bingren + n - 1; p++, i++) {\n    for (t = bingren; t < bingren + n - 1 - i; t++) {\n      if ((*t).year < (*(t + 1)).year) {\n        temp = *t;\n        *t = *(t + 1);\n        *(t + 1) = temp;\n      }\n    }\n  }\n  p = bingren;\n  for (; p < bingren + n; p++) {\n    if ((*p).year >= 60) {\n      printf(\"%s\\n\", p->num);\n    }\n  }\n  for (p1 = bingren1; p1 < bingren1 + m; p1++) {\n    if ((*p1).year < 60) {\n      printf(\"%s\\n\", p1->num);\n    }\n  }\n  free(bingren);\n  free(bingren1);\n  return 0;\n}\n"}
{"label": "9", "index": "15467", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid paixu(struct patient pat[], int n) {\n\n  struct patient t;\n  int i;\n  int k;\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        t = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  struct patient pat;\n  struct patient oldpat[100];\n  struct patient youngpat[100];\n\n  int n;\n  int i;\n  int m = 0;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat.ID >> pat.age;\n    if (pat.age >= 60) {\n      oldpat[m] = pat;\n      m++;\n    } else {\n      youngpat[k] = pat;\n      k++;\n    }\n  }\n\n  paixu(oldpat, m);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", oldpat[i].ID);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", youngpat[i].ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b[100], i, r, j = 0, k = 0, o[100] = {0}, y[100] = {0}, m;\n  char a[100][10], old[100][10], young[100][10], str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] >= 60) {\n      strcpy(old[j], a[i]);\n      o[j] = b[i];\n      j++;\n    } else {\n      strcpy(young[k], a[i]);\n      y[k] = b[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (r = 0; r < i; r++) {\n      if (o[r] < o[r + 1]) {\n        m = o[r + 1];\n        strcpy(str, old[r + 1]);\n        o[r + 1] = o[r];\n        strcpy(old[r + 1], old[r]);\n        o[r] = m;\n        strcpy(old[r], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", young[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct h {\n  char name[11];\n  int age;\n};\nint main() {\n  int i, k, n;\n  scanf(\"%d\", &n);\n  struct h p[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n  }\n  for (k = 100; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if (k == p[i].age)\n        printf(\"%s\\n\", p[i].name);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].name);\n  }\n}\n"}
{"label": "9", "index": "15470", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  int turn;\n} pat[100], temp;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n    pat[i].turn = i;\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      j = i + 1;\n      while ((pat[j].age < 60) && (j < n))\n        j++;\n      if (pat[j].age >= 60) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n    }\n  for (i = 0; (pat[i].age >= 60) && (i < n); i++)\n    for (j = i + 1; j < n; j++)\n      if ((pat[j].age > pat[i].age) ||\n          ((pat[i].age == pat[j].age) && (pat[j].turn < pat[i].turn))) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      for (j = i + 1; j < n; j++)\n        if (pat[i].turn > pat[j].turn) {\n          temp = pat[i];\n          pat[i] = pat[j];\n          pat[j] = temp;\n        }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "15471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp, num1 = 0, num2 = 100, age[100], flag[100];\n  char id[100][10], str[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin.get();\n    cin >> id[i] >> age[i];\n    if (age[i] < 60)\n      flag[i] = num1++;\n    else\n      flag[i] = num2++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] < age[j] && age[j] >= 60) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] == age[j] && age[i] >= 60 && age[j] >= 60 &&\n              flag[i] > flag[j] ||\n          age[i] < 60 && age[j] < 60 && flag[i] > flag[j]) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << id[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, m = 0;\n\n  scanf(\"%d\", &n);\n\n  char s1[100][10], s2[100][10], p1[100][10], p2[100][10], z1[100][10],\n      z2[100][10], t[10];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s1[i]);\n\n    scanf(\"%s\", s2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) {\n      strcpy(p1[j], s1[i]);\n\n      strcpy(p2[j], s2[i]);\n\n      j++;\n    }\n    if (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0') {\n      strcpy(z1[m], s1[i]);\n\n      strcpy(z2[m], s2[i]);\n\n      m++;\n    }\n  }\n  int k = j;\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(p2[j], p2[j + 1]) < 0) {\n\n        strcpy(t, p2[j]);\n\n        strcpy(p2[j], p2[j + 1]);\n\n        strcpy(p2[j + 1], t);\n\n        strcpy(t, p1[j]);\n\n        strcpy(p1[j], p1[j + 1]);\n\n        strcpy(p1[j + 1], t);\n      }\n    }\n  }\n  for (i = m - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(z2[j], z2[j + 1]) < 0) {\n\n        strcpy(t, z2[j]);\n\n        strcpy(z2[j], z2[j + 1]);\n\n        strcpy(z2[j + 1], t);\n\n        strcpy(t, z1[j]);\n\n        strcpy(z1[j], z1[j + 1]);\n\n        strcpy(z1[j + 1], t);\n      }\n    }\n  }\n  for (j = 0; j < m; j++) {\n    printf(\"%s\\n\", z1[j]);\n  }\n\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", p1[j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (!((s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) ||\n          (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0')))\n      printf(\"%s\\n\", s1[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> ID[i] >> age[i];\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%s \", ID3[i]);\n}\n"}
{"label": "9", "index": "15474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n  struct Patient *next;\n  struct Patient *pre;\n};\nstruct Patient *creat(int x);\nstruct Patient *sort(struct Patient *);\nvoid print(struct Patient *);\n\nint main() {\n  struct Patient *patient, *patient2;\n  int n;\n  scanf(\"%d\", &n);\n  patient = creat(n);\n  patient2 = sort(patient);\n  print(patient2);\n  return 0;\n}\n\nstruct Patient *creat(int x) {\n  struct Patient *p1, *p2, *head, *p;\n  int i;\n  head = NULL;\n  for (i = 0; i < x; i++) {\n    p1 = (struct Patient *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n      head->pre = NULL;\n    } else {\n      p2->next = p1;\n      p1->pre = p2;\n    }\n    p2 = p1;\n    scanf(\"%s%d\", p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return head;\n}\n\nstruct Patient *sort(struct Patient *head) {\n  struct Patient *p1, *p2, *temp, *p;\n  temp = (struct Patient *)malloc(1000);\n  p1 = p2 = head;\n  while (p1) {\n    if (p1->age >= 60) {\n      p2 = p1->next;\n      while (p2) {\n        if (p2->age > p1->age) {\n          temp->age = p2->age;\n          strcpy(temp->id, p2->id);\n          p = p2;\n          while (p->pre != p1) {\n            strcpy(p->id, p->pre->id);\n            p->age = p->pre->age;\n            p = p->pre;\n          }\n          strcpy(p->id, p1->id);\n          p->age = p1->age;\n          p1->age = temp->age;\n          strcpy(p1->id, temp->id);\n        }\n        p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\n\nvoid print(struct Patient *head) {\n  struct Patient *p1, *p2, *p;\n  p = head;\n  while (p) {\n    if (p->age >= 60)\n      printf(\"%s \", p->id);\n\n    p = p->next;\n  }\n  p = head;\n  while (p) {\n    if (p->age < 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct ren {\n    char b[100];\n    int c;\n\n  } a[100], d[100], m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].b >> a[i].c;\n    d[i] = a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (d[j].c < d[j + 1].c) {\n        m = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = m;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i].c >= 60) {\n      printf(\"%s\\n\", d[i].b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].c < 60) {\n      cout << a[i].b << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101][10] = {0}, p[101][10] = {0}, q[101][10] = {0};\n  int a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int n, i = 0, j = 0;\n  int f = 0, g = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[f] = a[i];\n      strcpy(p[f], s[i]);\n      f++;\n    } else if (a[i] < 60) {\n      c[g] = a[i];\n      strcpy(q[g], s[i]);\n      g++;\n    }\n  }\n  int e = 0;\n  char y[10] = {0};\n  for (j = 0; j < f; j++) {\n    for (i = f - 2; i >= j; i--) {\n      if (b[i] < b[i + 1]) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n        strcpy(y, p[i]);\n        strcpy(p[i], p[i + 1]);\n        strcpy(p[i + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < f; i++)\n    cout << p[i] << \"\\n\";\n\n  for (j = 0; j < g; j++) {\n    cout << q[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], order[100], buffer[100], swap_1;\n\nint main() {\n  int i, j = 0, m = 0, n, k, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      order[j] = pat[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      buffer[m] = pat[i];\n      m++;\n    }\n  }\n  for (p = 1; p < j; p++) {\n    for (q = 0; q < j - p; q++) {\n      if (order[q].age < order[q + 1].age) {\n        swap_1 = order[q + 1];\n        order[q + 1] = order[q];\n        order[q] = swap_1;\n      }\n    }\n  }\n  for (q = 0; q < j; q++) {\n    printf(\"%s\", order[q].id);\n    printf(\" \");\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\", buffer[i].id);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int n, age[100], i, k = 0, m, len, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(id[i]), &(age[i]));\n  }\n  char e[100][10], kong[10];\n  int xin[100];\n  for (i = 0; i < n; i++) {\n    if (age[i] > 59) {\n      xin[k] = age[i];\n      strcpy(e[k], id[i]);\n      k++;\n    }\n  }\n  len = k;\n  for (m = 1; m <= len; m++) {\n    for (k = 0; k < len - m; k++) {\n      if (xin[k] < xin[k + 1]) {\n        p = xin[k];\n        strcpy(kong, e[k]);\n        xin[k] = xin[k + 1];\n        strcpy(e[k], e[k + 1]);\n        xin[k + 1] = p;\n        strcpy(e[k + 1], kong);\n      }\n    }\n  }\n  for (k = 0; k < len; k++) {\n    printf(\"%s\\n\", e[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct rat {\n  char num[11];\n  int age;\n  struct rat *next;\n};\n\nint n;\n\nstruct rat *creat(void) {\n  struct rat *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct rat *)malloc(1000);\n  head = p1;\n  cin >> p1->num >> p1->age;\n  for (i = 2; i <= n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct rat *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct rat *sort(struct rat *head, int count) {\n  struct rat *p1, *p2, *p3, *temp;\n  int i, j;\n  for (j = 1; j <= count - 1; j++) {\n    p1 = head;\n    p2 = p1->next;\n    p3 = p2;\n    for (i = 0; i < count - j; i++) {\n      if (p1->age < p2->age) {\n        temp = p2->next;\n        p2->next = p1;\n        p1->next = temp;\n        if (i == 0) {\n          head = p2;\n          p2 = temp;\n        } else {\n          p3->next = p2;\n          p3 = p2;\n          p2 = temp;\n        }\n      } else {\n        if (i == 0) {\n          p3 = head = p1;\n          p1 = p1->next;\n          p2 = p2->next;\n        } else {\n          p1 = p1->next;\n          p2 = p2->next;\n          p3 = p3->next;\n        }\n      }\n    }\n  }\n  return (head);\n}\n\nstruct rat *del(struct rat *head, int t) {\n  struct rat *p1, *p2;\n  int i;\n  p1 = head;\n  for (i = 1; i <= t; i++) {\n    if (p1->age < 60) {\n      if (i == 1)\n        head = p1;\n      p2 = p1;\n      p1 = p1->next;\n      continue;\n    }\n    if (p1->age >= 60) {\n      if (i == 1) {\n        head = p1->next;\n        break;\n      }\n      p2->next = p1->next;\n      break;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct rat *head, *p1, *s, *p2, *p3;\n  int i, count = 0, t;\n  scanf(\"%d\", &n);\n  t = n;\n  head = creat();\n  p1 = head;\n  p3 = p2 = (struct rat *)malloc(1000);\n  for (i = 1; i <= n; i++) {\n    if (p1->age >= 60) {\n      if (count == 0)\n        s = p2;\n      p2->age = p1->age;\n      strcpy(p2->num, p1->num);\n      p3->next = p2;\n      p3 = p2;\n      p2 = (struct rat *)malloc(1000);\n      count++;\n    }\n    p1 = p1->next;\n  }\n  s = sort(s, count);\n  for (i = 1; i <= count; i++) {\n    head = del(head, t);\n    t = t - 1;\n  }\n  p1 = s;\n  for (i = 1; i <= count; i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i <= (n - count); i++) {\n    cout << p1->num << \" \";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p1, *p2;\n  p2 = p1 = (struct patient *)malloc(1000);\n  head = p1;\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j, n;\n  char a[10];\n  scanf(\"%d\", &n);\n  struct patient *h, *q, *p;\n  h = creat(n);\n  for (i = 0; i < n; i++)\n    for (q = h; q->next != NULL; q = q->next)\n      if (q->next->age >= 60 && q->next->age > q->age) {\n        strcpy(a, q->ID);\n        strcpy(q->ID, q->next->ID);\n        strcpy(q->next->ID, a);\n        j = q->age;\n        q->age = q->next->age;\n        q->next->age = j;\n      }\n  for (p = h; p != NULL; p = p->next)\n    printf(\"%s \", p->ID);\n}\n"}
{"label": "9", "index": "15481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[11];\n  int age;\n} sick[101];\nint main() {\n  int n, i, j, k, r, s;\n  s = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", sick[i].num);\n    scanf(\"%d\", &sick[i].age);\n  }\n  int old[101] = {0};\n  int young[101] = {0};\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      for (j = 0; j <= s; j++) {\n        if (sick[i].age > sick[old[j]].age || j == s) {\n          if (j == s) {\n            old[s] = i;\n            s = s + 1;\n            break;\n          } else {\n            for (k = s; k >= j; k--) {\n              old[k + 1] = old[k];\n            }\n            old[j] = i;\n            s = s + 1;\n            break;\n          }\n        }\n      }\n    } else {\n      young[r] = i;\n      r = r + 1;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", sick[old[i]].num);\n  }\n  for (i = 0; i < r; i++) {\n    printf(\"%s\\n\", sick[young[i]].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  };\n\n  int n, i, j, k;\n  struct patient p[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n\n  for (i = 1; i < n; i++) {\n    if (p[i].age >= 60) {\n      j = 0;\n      while (j < i && p[j].age >= p[i].age)\n        j++;\n      if (j < i) {\n        struct patient tmp = p[i];\n        for (k = i; k > j; k--)\n          p[k] = p[k - 1];\n        p[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    cout << p[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t;\n  int i, j = 0, k, max;\n  int age[100];\n  int age2[100];\n  char string[100][11];\n  int line[100];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> string[i] >> age[i];\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      age2[j] = age[i];\n      age[i] = 0;\n      line[j] = i;\n      j = j + 1;\n      k = j;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    max = 0;\n    t = 0;\n    for (j = 0; j <= k - 1; j++) {\n      if (max < age2[j]) {\n        max = age2[j];\n        t = j;\n      }\n    }\n    printf(\"%s\\n\", string[line[t]]);\n    age2[t] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0, n, n1 = -1, n2 = -1, old = 0;\n  char xiao[100][10];\n  struct bingren {\n    char id[10];\n    int age;\n  };\n  struct bingren a[100];\n  struct bingren b[100];\n  struct bingren t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n\n      n1++;\n\n      j++;\n    } else {\n      strcpy(xiao[k], a[i].id);\n      k++;\n      n2++;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i <= n1; i++) {\n    cout << b[i].id << \"\\n\";\n  }\n  for (i = 0; i <= n2; i++)\n    cout << xiao[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "15485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[10];\n    int age;\n  } pat[100];\n  int n, i, m, b[100], l = 0, p, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].a, &pat[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      l = l + 1;\n      b[l] = pat[i].age;\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = i + 1; m <= l; m++)\n      if (b[i] < b[m]) {\n        p = b[i];\n        b[i] = b[m];\n        b[m] = p;\n      }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 1; m <= l; m++) {\n      if (b[i] == b[m]) {\n        if (i != m)\n          b[m] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 0; m < n; m++)\n      if (pat[m].age == b[i])\n        printf(\"%s\\n\", pat[m].a);\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  return 0;\n}\n"}
{"label": "9", "index": "15486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, sz[100], i, j, sz2[100], e;\n  char zf[100][20], f[20], zf2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zf[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      n--;\n      strcpy(zf2[m], zf[i]);\n      sz2[m] = sz[i];\n      m++;\n      for (j = i; j <= n; j++) {\n        strcpy(zf[j], zf[j + 1]);\n        sz[j] = sz[j + 1];\n      }\n      i--;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (sz2[i] < sz2[i + 1]) {\n        e = sz2[i];\n        sz2[i] = sz2[i + 1];\n        sz2[i + 1] = e;\n        strcpy(f, zf2[i]);\n        strcpy(zf2[i], zf2[i + 1]);\n        strcpy(zf2[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", zf2[i]);\n\n  for (i = 0; i < n; i++)\n    cout << zf[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15487", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->next = NULL;\n    i++;\n    p2->next = p1;\n    p2 = p1;\n  } while (i < n);\n  return (head);\n}\n\nstruct patient *tiao(struct patient *head, int n) {\n  struct patient *p1;\n  int t, i;\n  char s[10];\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    do {\n      if (p1->age < (p1->next)->age && (p1->next)->age >= 60) {\n        t = p1->age;\n        p1->age = (p1->next)->age;\n        (p1->next)->age = t;\n        strcpy(s, p1->id);\n        strcpy(p1->id, (p1->next)->id);\n        strcpy((p1->next)->id, s);\n      }\n      p1 = p1->next;\n    } while (p1->next);\n  }\n\n  return (head);\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p);\n}\n\nint main() {\n  struct patient *head;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = tiao(head, n);\n  print(head);\n}\n"}
{"label": "9", "index": "15488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p[200][10], q[200][10] = {0}, c[10];\n  int a[200], b[200];\n  int n, i, j, x, y, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  j = 0;\n  x = 0;\n  t = 0;\n  y = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(q[j], p[i]);\n      j++;\n      t++;\n    }\n  }\n  for (j = t - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] < b[i + 1]) {\n        int r;\n        r = b[i + 1];\n        strcpy(c, q[i + 1]);\n        b[i + 1] = b[i];\n        strcpy(q[i + 1], q[i]);\n        b[i] = r;\n        strcpy(q[i], c);\n      }\n    }\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", q[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", p[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15489", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct rat {\n  char num[11];\n  int age;\n  struct rat *next;\n};\n\nint n;\n\nstruct rat *creat(void) {\n  struct rat *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct rat *)malloc(1000);\n  head = p1;\n  cin >> p1->num >> p1->age;\n  for (i = 2; i <= n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct rat *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct rat *sort(struct rat *head, int count) {\n  struct rat *p1, *p2, *p3, *temp;\n  int i, j;\n  for (j = 1; j <= count - 1; j++) {\n    p1 = head;\n    p2 = p1->next;\n    p3 = p2;\n    for (i = 0; i < count - j; i++) {\n      if (p1->age < p2->age) {\n        temp = p2->next;\n        p2->next = p1;\n        p1->next = temp;\n        if (i == 0) {\n          head = p2;\n          p2 = temp;\n        } else {\n          p3->next = p2;\n          p3 = p2;\n          p2 = temp;\n        }\n      } else {\n        if (i == 0) {\n          p3 = head = p1;\n          p1 = p1->next;\n          p2 = p2->next;\n        } else {\n          p1 = p1->next;\n          p2 = p2->next;\n          p3 = p3->next;\n        }\n      }\n    }\n  }\n  return (head);\n}\n\nstruct rat *del(struct rat *head, int t) {\n  struct rat *p1, *p2;\n  int i;\n  p1 = head;\n  for (i = 1; i <= t; i++) {\n    if (p1->age < 60) {\n      if (i == 1)\n        head = p1;\n      p2 = p1;\n      p1 = p1->next;\n      continue;\n    }\n    if (p1->age >= 60) {\n      if (i == 1) {\n        head = p1->next;\n        break;\n      }\n      p2->next = p1->next;\n      break;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct rat *head, *p1, *s, *p2, *p3;\n  int i, count = 0, t;\n  scanf(\"%d\", &n);\n  t = n;\n  head = creat();\n  p1 = head;\n  p3 = p2 = (struct rat *)malloc(1000);\n  for (i = 1; i <= n; i++) {\n    if (p1->age >= 60) {\n      if (count == 0)\n        s = p2;\n      p2->age = p1->age;\n      strcpy(p2->num, p1->num);\n      p3->next = p2;\n      p3 = p2;\n      p2 = (struct rat *)malloc(1000);\n      count++;\n    }\n    p1 = p1->next;\n  }\n  s = sort(s, count);\n  for (i = 1; i <= count; i++) {\n    head = del(head, t);\n    t = t - 1;\n  }\n  p1 = s;\n  for (i = 1; i <= count; i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i <= (n - count); i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[110], b[100][1000];\n  int n, i, y, l, j, p = 0, q = 0, c[1000], d[1000], e[1000], m, s, g[1000],\n                     v[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a, &y);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      b[i - 1][j] = a[j];\n    }\n    b[i - 1][l] = '\\0';\n    c[i - 1] = y;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i] >= 60) {\n      d[p] = c[i];\n      g[p] = i;\n      p++;\n    } else if (c[i] < 60) {\n      e[q] = c[i];\n      v[q] = i;\n      q++;\n    }\n  }\n  for (j = 0; j <= p - 1; j++) {\n    for (i = 0; i <= p - 1; i++) {\n      if (d[i] > m) {\n        m = d[i];\n        s = i;\n      } else if (d[i] <= m)\n        ;\n    }\n    cout << b[g[s]] << \"\\n\";\n    m = 0;\n    d[s] = 0;\n  }\n  for (i = 0; i <= q - 1; i++)\n    printf(\"%s\\n\", b[v[i]]);\n}\n"}
{"label": "9", "index": "15491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, f = 0, m = 0, j;\n\n  struct {\n    char id[10];\n    int age;\n  } bingren[100], t[100], l[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &bingren[i].id, &bingren[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].age >= 60)\n      t[f++] = bingren[i];\n    else if (bingren[i].age < 60)\n      l[m++] = bingren[i];\n  }\n\n  for (i = 1; i < f; i++) {\n    for (j = i; j > 0; j--) {\n      if (t[j].age > t[j - 1].age) {\n        c = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = c;\n      }\n    }\n  }\n\n  for (i = 0; i < f; i++) {\n    printf(\"%s\\n\", t[i].id);\n  }\n\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", l[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15492", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  struct patient {\n    char num[10];\n    int age;\n  };\n  struct patient p[100], temp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[j].age > p[i].age && p[j].age >= 60) {\n        for (k = j; k > i; k--) {\n          temp = p[k];\n          p[k] = p[k - 1];\n          p[k - 1] = temp;\n        }\n      }\n    }\n    printf(\"%s\\n\", p[i].num);\n  }\n  printf(\"%s\\n\", p[n - 1].num);\n  return 0;\n}\n"}
{"label": "9", "index": "15493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, t, x;\n  char w[10];\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age); \n  struct patient1 {\n    char id[10];\n    int age;\n  } b[100];\n  struct patient2 {\n    char id[10];\n    int age;\n  } c[100];\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[k].age = a[i].age;\n      for (j = 0; j < 10; j++) {\n        b[k].id[j] = a[i].id[j];\n      }\n      k++;\n\n    } \n    else {\n      c[m].age = a[i].age;\n      for (j = 0; j < 10; j++) {\n        c[m].id[j] = a[i].id[j];\n      }\n      m++;\n    }\n  } \n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i].age;\n        b[i].age = b[i + 1].age;\n        b[i + 1].age = t;\n        for (x = 0; x < 10; x++) {\n          w[x] = b[i].id[x];\n          b[i].id[x] = b[i + 1].id[x];\n          b[i + 1].id[x] = w[x];\n        }\n      }\n    }\n  } \n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id); \n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i].id); \n  return 0;\n}\n"}
{"label": "9", "index": "15494", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d \", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d\", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      } else if (se[i] == se[j] && list[i] > list[j]) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n\n  for (i = 0; i <= nums; i++) {\n\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    int k;\n    char id[10];\n    int age;\n  } pa[100] = {0, \"\", 0}, pb[100] = {0, \"\", 0}, temp;\n\n  int n;\n  int i, j, k, age, na, nb;\n  char id[10] = {\"\"};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0; i + j < n;) {\n    scanf(\"%s%d\", &id, &age);\n    if (age >= 60) {\n      pa[i].age = age;\n      strcpy(pa[i].id, id);\n      pa[i].k = i;\n      i++;\n    } else {\n      pb[j].age = age;\n      strcpy(pb[j].id, id);\n      pb[j].k = j;\n      j++;\n    }\n  }\n  na = i;\n  nb = j;\n\n  for (j = 1; j <= n - 1; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pa[i].age < pa[i + 1].age) {\n        temp.age = pa[i + 1].age;\n        strcpy(temp.id, pa[i + 1].id);\n        pa[i + 1].age = pa[i].age;\n        strcpy(pa[i + 1].id, pa[i].id);\n        pa[i].age = temp.age;\n        strcpy(pa[i].id, temp.id);\n      }\n    }\n  }\n\n  printf(\"%s\", pa[0].id);\n  for (i = 1; i <= na; i++)\n    printf(\"\\n%s\", pa[i].id);\n\n  for (j = 0; j <= nb; j++) {\n    puts(pb[j].id);\n  }\n}\n"}
{"label": "9", "index": "15496", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[200];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p2 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0) {\n      head = p2;\n      p3 = head;\n    }\n    cin >> p2->num >> p2->sum;\n    p2->next = NULL;\n    if (p2->sum >= 60) {\n      if (i == 1) {\n        if (head->sum >= p2->sum) {\n          head->next = p2;\n          p2->next = NULL;\n          p3 = p2;\n        } else {\n          p1 = head;\n          p2->next = head;\n          head = p2;\n        }\n      }\n      if (i > 1) {\n        for (p1 = head; p1->next != NULL; p1 = p1->next) {\n          if (p1->sum >= p2->sum && (p1->next->sum) < p2->sum) {\n            p2->next = p1->next;\n            p1->next = p2;\n            break;\n          }\n        }\n        if (p2->next == NULL) {\n          if (p2->sum > head->sum) {\n            p2->next = head;\n            head = p2;\n          }\n          if (p2->sum < p1->sum) {\n            p2->next = NULL;\n            p3 = p2;\n            p1->next = p2;\n          }\n        }\n      }\n    } else {\n      if (i != 0) {\n        p2->next = NULL;\n        p3->next = p2;\n        p3 = p2;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct mouse {\n  int weight;\n  char color[11];\n  struct mouse *next, *before;\n};\nint main() {\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  struct mouse *m, *head, *p1, *p2, *fin;\n  head = p1 = p2 = (struct mouse *)malloc(sizeof(struct mouse));\n  scanf(\"%s %d\", p1->color, &p1->weight);\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->color, &p1->weight);\n    p2->next = p1;\n    p1->before = p2;\n    p2 = p1;\n  }\n  fin = p1;\n  p1->next = NULL;\n  for (i = 1; i <= n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 1; j <= n + 1 - i; j++) {\n      if (p1->weight > max) {\n        max = p1->weight;\n        m = p1;\n      }\n      p1 = p1->next;\n    }\n    if (m->weight < 60)\n      break;\n    printf(\"%s\\n\", m->color);\n    if (m == head) {\n      head = head->next;\n      continue;\n    }\n    if (m == fin) {\n      fin = fin->before;\n      fin->next = NULL;\n      continue;\n    }\n    if (m != head && m != fin) {\n      p1 = m->before;\n      p1->next = m->next;\n      m = m->next;\n      m->before = p1;\n    }\n  }\n  p1 = head;\n  cout << head->color << \"\\n\";\n  for (; p1->next != NULL;) {\n    p1 = p1->next;\n    printf(\"%s\\n\", p1->color);\n  }\n}\n"}
{"label": "9", "index": "15498", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d \", &n);\n  struct p {\n    char id[10];\n    int age;\n  } a[n], b[n], c[n], d;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = 0; l < j - 1 - i; l++)\n      if (b[l].age < b[l + 1].age) {\n        d = b[l];\n        b[l] = b[l + 1];\n        b[l + 1] = d;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15499", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, sz[100], i, j, sz2[100], e;\n  char zf[100][20], f[20], zf2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zf[i]);\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      n--;\n      strcpy(zf2[m], zf[i]);\n      sz2[m] = sz[i];\n      m++;\n      for (j = i; j <= n; j++) {\n        strcpy(zf[j], zf[j + 1]);\n        sz[j] = sz[j + 1];\n      }\n      i--;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (sz2[i] < sz2[i + 1]) {\n        e = sz2[i];\n        sz2[i] = sz2[i + 1];\n        sz2[i + 1] = e;\n        strcpy(f, zf2[i]);\n        strcpy(zf2[i], zf2[i + 1]);\n        strcpy(zf2[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", zf2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct node {\n  char s[100];\n  int age, no;\n} a[1000], b;\nint check(int x, int y) {\n  if (a[y].age < 60 && a[x].age >= 60)\n    return 0;\n  if (a[y].age >= 60 && a[x].age < 60)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no > a[y].no)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no < a[y].no)\n    return 0;\n  if (a[x].age > a[y].age)\n    return 0;\n  if (a[x].age < a[y].age)\n    return 1;\n  if (a[x].no < a[y].no)\n    return 0;\n  if (a[x].no > a[y].no)\n    return 1;\n  return 0;\n}\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &a[i].s, &a[i].age);\n    a[i].no = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (check(i, j) == 1) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", a[i].s);\n  return 0;\n}\n"}
{"label": "9", "index": "15501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k, l;\n  struct patient {\n    char num[10];\n    int age;\n  } p[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    do {\n      scanf(\"%c \", &p[i].num[j]);\n      j++;\n    } while (p[i].num[j - 1] != ' ');\n    p[i].num[j - 1] = '\\0';\n    scanf(\"%d\", &p[i].age);\n    j = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (p[j].age > p[k].age)\n        k = j;\n    if (k != i && p[k].age >= 60) {\n      temp = p[k];\n      for (l = k; l >= i + 1; l--) {\n        p[l] = p[l - 1];\n      }\n      p[i] = temp;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].num);\n    if (i != n - 1)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15502", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct patient {\n    char id[10];\n    int age;\n  } pa[1000], t;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j >= 0; j--)\n\n      if (pa[j].age > pa[j - 1].age && pa[j].age >= 60)\n\n      {\n\n        t = pa[j];\n        pa[j] = pa[j - 1];\n        pa[j - 1] = t;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[11];\n  int age;\n} pa[100];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pa[i].ID, &pa[i].age);\n  }\n  struct patient old[100];\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      strcpy(old[count].ID, pa[i].ID);\n      old[count].age = pa[i].age;\n      count++;\n      pa[i].age = 0;\n    }\n  }\n  int k, j, e;\n  char ex[11];\n  for (k = 1; k < count; k++) {\n    for (j = 0; j < count - k; j++) {\n      if (old[j].age < old[j + 1].age) {\n        e = old[j + 1].age;\n        old[j + 1].age = old[j].age;\n        old[j].age = e;\n        strcpy(ex, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, ex);\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age != 0) {\n      cout << pa[i].ID << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct b {\n    char id[10];\n    int age;\n  };\n  int n, i, j, k;\n  struct b a[100], temp, c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i].age >= 60) {\n      c[j] = a[i];\n      j++;\n    }\n  for (i = j - 1; i >= 1; i--)\n    for (k = j - 1; k > j - i - 1; k--)\n      if (c[k].age > c[k - 1].age) {\n        temp = c[k];\n        c[k] = c[k - 1];\n        c[k - 1] = temp;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i].id);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].id);\n}\n"}
{"label": "9", "index": "15505", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct mice {\n  int wei;\n  char color[100];\n  struct mice *next;\n};\nstruct mice *creat(int c) {\n  struct mice *head;\n  struct mice *p1, *p2;\n  struct mice *kok;\n  kok = (struct mice *)malloc(1000);\n  kok->wei = 0;\n  strcpy(kok->color, \"\u0000\");\n  int t;\n  t = 0;\n  p1 = p2 = (struct mice *)malloc(1000);\n  scanf(\"%s %d\", p1->color, &p1->wei);\n  head = NULL;\n  while (t < c) {\n    t = t + 1;\n    if (t == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n      p1 = (struct mice *)malloc(1000);\n      scanf(\"%s %d\", p1->color, &p1->wei);\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = kok;\n  return (head);\n}\nvoid mun(struct mice *hoih, int io) {\n  int i, j, k;\n  k = 0;\n  struct mice *bt;\n  bt = hoih;\n  char str[100];\n  for (i = 0; i < io; i++) {\n    for (j = 0; j < io - i; j++) {\n      if (hoih->wei < (hoih->next)->wei && (hoih->next)->wei >= 60) {\n        k = hoih->wei;\n        hoih->wei = (hoih->next)->wei;\n        (hoih->next)->wei = k;\n        strcpy(str, hoih->color);\n        strcpy(hoih->color, (hoih->next)->color);\n        strcpy((hoih->next)->color, str);\n      }\n\n      hoih = hoih->next;\n    }\n    hoih = bt;\n  }\n  return;\n}\n\nint main() {\n  int n, h;\n  struct mice *creat(int c);\n  struct mice *p, *he;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  he = p;\n  void mun(struct mice * hoih, int io);\n  mun(p, n);\n  p = he;\n  for (h = 0; h < n; h++) {\n    printf(\"%s \", p->color);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, t;\n  char tc[16];\n  struct per {\n    char id[16];\n    int a;\n  } a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].a);\n  }\n  for (int j = n - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r].a > 59 && a[r + 1].a > 59 && a[r].a < a[r + 1].a) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n      if (a[r].a <= 59 && a[r + 1].a > 59) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n    }\n  }\n  for (int f = 0; f < n; f++) {\n    cout << a[f].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[100];\n  int age;\n  struct ill *next;\n};\nint main() {\n  struct ill *creat(int x);\n  struct ill *p, *head;\n  char *w[1000];\n  char *temp1;\n  int n, i, j = 0, k, temp;\n  int *q;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  head = p;\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      *(q + j) = (*p).age;\n      *(w + j) = (*p).id;\n      j++;\n    }\n    p = (*p).next;\n  }\n  k = j;\nloop:\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1)) {\n      temp = *(q + i);\n      *(q + i) = *(q + i + 1);\n      *(q + i + 1) = temp;\n      temp1 = *(w + i);\n      *(w + i) = *(w + i + 1);\n      *(w + i + 1) = temp1;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1))\n      goto loop;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", *(w + i));\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      goto lop;\n    } else {\n      printf(\"%s\\n\", (*p).id);\n    }\n  lop:\n    p = (*p).next;\n  }\n}\nstruct ill *creat(int x) {\n  struct ill *head, *p1, *p2;\n  int i;\n  p1 = (struct ill *)malloc(sizeof(struct ill));\n  scanf(\"%s %d\", (*p1).id, &(*p1).age);\n  p2 = p1;\n  head = p1;\n  for (i = 0; i < x; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", (*p1).id, &(*p1).age);\n    (*p2).next = p1;\n    p2 = p1;\n  }\n  (*p2).next = NULL;\n  return (head);\n}\n"}
{"label": "9", "index": "15508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, y, x = 0;\n  struct ID {\n    int age;\n    char a[10];\n  } ID[201];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ID[i].a);\n    scanf(\"%d\", &ID[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].age >= 60) {\n      ID[100 + x] = ID[i];\n      ID[i].a[0] = '\\0';\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (y = 0; y < x - 1 - i; y++) {\n      if (ID[100 + y].age < ID[y + 101].age) {\n        ID[200] = ID[100 + y];\n        ID[100 + y] = ID[y + 101];\n        ID[y + 101] = ID[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", ID[100 + i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].a[0] != '\\0')\n      printf(\"%s\\n\", ID[i].a);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15509", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->o == 0)\n        continue;\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          printf(\" %s\", pi->id);\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n}\n"}
{"label": "9", "index": "15510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid bubble(struct patient *a[], int n);\n\nint main() {\n  int n, i, s = 0;\n  struct patient p[100] = {\"0\", 0};\n  struct patient *pt[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].ID, &p[i].age);\n    pt[i] = &p[i];\n  }\n  bubble(pt, n);\n  for (i = 0; i < n; i++) {\n    if (pt[i]->age >= 60) {\n      printf(\"%s\\n\", pt[i]->ID);\n      s++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].ID);\n    }\n  }\n  return 0;\n}\n\nvoid sort2(struct patient *a[], int n) {\n  int i, j, k;\n  struct patient *t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[j]->age > a[k]->age) {\n        k = j;\n      }\n    }\n    t = a[k];\n    a[k] = a[i];\n    a[i] = t;\n  }\n}\nvoid bubble(struct patient *a[], int n) {\n  int i, j;\n  struct patient *t;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - i - 2; j++) {\n      if (a[j]->age < a[j + 1]->age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, l, z;\n  int a[100], b[100], f[100];\n  char d[30], c[100][30], e[100][30];\n  scanf(\"%d\", &n);\n  for (i = 0, z = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n    if (a[i] >= 60) {\n      b[z] = a[i];\n      f[z] = z;\n      strcpy(e[z], c[i]);\n      a[i] = 0;\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = i + 1; j < z; j++) {\n      if (b[j] > b[i]) {\n        strcpy(d, e[i]);\n        strcpy(e[i], e[j]);\n        strcpy(e[j], d);\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n        l = f[i];\n        f[i] = f[j];\n        f[j] = l;\n      }\n      if (b[i] == b[j]) {\n        if (f[i] > f[j]) {\n          strcpy(d, e[i]);\n          strcpy(e[i], e[j]);\n          strcpy(e[j], d);\n          k = b[i];\n          b[i] = b[j];\n          b[j] = k;\n          l = f[i];\n          f[i] = f[j];\n          f[j] = l;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    cout << e[i] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15512", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], l[100], b[100], i = 0, j, k, p = 0, q = 0, t = 0;\n  char s[100][12], lao[100][13] = {'\\0'}, bu[100][13] = {'\\0'}, w[12] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60)\n      l[p] = a[i], strcpy(lao[p], s[i]), p++;\n    else\n      b[q] = a[i], strcpy(bu[q], s[i]), q++;\n  }\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1; j++) {\n      if (l[j] < l[j + 1])\n        t = l[j], l[j] = l[j + 1], l[j + 1] = t, strcpy(w, lao[j]),\n        strcpy(lao[j], lao[j + 1]), strcpy(lao[j + 1], w);\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", lao[i]);\n  }\n  for (i = 0; i < q; i++)\n    printf(\"%s\\n\", bu[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100] = {0}, i, j, k, old[101] = {0}, oldn, youngn;\n  char id[101][20] = {0}, oldid[101][20] = {0}, youngid[101][20] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 1, j = 1, k = 1; i <= n; i++) {\n    if (age[i] >= 60) {\n      old[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      strcpy(youngid[k], id[i]);\n      k++;\n    }\n  }\n  oldn = j;\n  youngn = k;\n  for (i = 1; i <= oldn; i++) {\n    for (j = 1; j <= oldn - i; j++) {\n      if (old[j] < old[j + 1]) {\n        old[100] = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = old[100];\n        strcpy(oldid[101], oldid[j]);\n        strcpy(oldid[j], oldid[j + 1]);\n        strcpy(oldid[j + 1], oldid[101]);\n      }\n    }\n  }\n  for (i = 1; i < oldn; i++)\n    cout << oldid[i] << \"\\n\";\n  for (k = 1; k < youngn; k++)\n    cout << youngid[k] << \"\\n\";\n}\n"}
{"label": "9", "index": "15514", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct a {\n  int year;\n  char id[10];\n  struct a *next;\n};\nstruct a *create(int n) {\n  struct a *p1, *p2, *head;\n  int i;\n  p1 = (struct a *)malloc(1000);\n  scanf(\"%s%d\", p1->id, &p1->year);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct a *)malloc(1000);\n    scanf(\"%s%d\", p1->id, &p1->year);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct a *head, *p, *q, *t[100];\n  int m, i, j = 0, k;\n  cin >> m;\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    if (p->year >= 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (k = 0; k < j - 1; k++)\n    for (i = 0; i < j - 1 - k; i++)\n      if (t[i]->year < t[i + 1]->year) {\n        p = t[i];\n        t[i] = t[i + 1];\n        t[i + 1] = p;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n  p = head;\n  j = 0;\n  for (i = 0; i < m; i++) {\n    if (p->year < 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n}\n"}
{"label": "9", "index": "15515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, m;\n  int i, j = 0, k = 0;\n  struct patient a[100], b[100], c[100], t[1];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n    if (a[i].age >= 60) {\n      strcpy(b[j].ID, a[i].ID);\n      b[j].age = a[i].age;\n      j = j + 1;\n    } else {\n      strcpy(c[k].ID, a[i].ID);\n      c[k].age = a[i].age;\n      k = k + 1;\n    }\n  }\n  m = j;\n  for (j = 1; j <= m - 1; j++) {\n    for (i = 0; i <= m - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        strcpy(t[0].ID, b[i].ID);\n        t[0].age = b[i].age;\n        strcpy(b[i].ID, b[i + 1].ID);\n        b[i].age = b[i + 1].age;\n        strcpy(b[i + 1].ID, t[0].ID);\n        b[i + 1].age = t[0].age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < k; i++)\n    cout << c[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, t;\n  scanf(\"%d\", &n);\n  char a[n][100], s[n][100], r[100];\n  int b[n], c[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (int j = 0; j < n; j++) {\n    if (b[j] >= 60) {\n      c[m] = b[j], strcpy(s[m], a[j]);\n      if (m != 0) {\n        for (int k = m; k > 0; k = k - 1) {\n          if (c[k] > c[k - 1]) {\n            strcpy(r, s[k]), strcpy(s[k], s[k - 1]), strcpy(s[k - 1], r);\n            t = c[k], c[k] = c[k - 1], c[k - 1] = t;\n          }\n        }\n      }\n      m++;\n    }\n  }\n  if (m != 0) {\n    for (int i = 0; i < m; i++)\n      printf(\"%s\\n\", s[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (b[j] < 60)\n      cout << a[j] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15517", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char id[30];\n  int age;\n  int num;\n  int flag;\n  struct pat *next;\n  struct pat *ns;\n};\n\nint n;\n\nvoid sort(struct pat *head) {\n  int i, j;\n  struct pat *q, *p, *max;\n  q = head;\n\n  for (i = 0; i < n; i++) {\n    p = head->next;\n    while (1) {\n      if (p->flag)\n        break;\n      p = p->next;\n    }\n    max = p;\n    while (1) {\n      if ((p->num) > (max->num) && p->flag)\n        max = p;\n      p = p->next;\n      if (p == NULL)\n        break;\n    }\n    max->flag = 0;\n    q->ns = max;\n    q = q->ns;\n  }\n  q->ns = NULL;\n}\n\nint main() {\n  int i;\n  struct pat *head, *p1, *p2, *p;\n  cin >> n;\n  head = (struct pat *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->flag = 1;\n    if (p1->age >= 60)\n      p1->num = 10000 * p1->age + n - i;\n    else\n      p1->num = n - i;\n    if (i == 0) {\n      head->next = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  sort(head);\n\n  p = head->ns;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->ns;\n  }\n}\n"}
{"label": "9", "index": "15518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pat[100];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n  }\n  int temp = 0;\n  struct patient e;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      e = pat[i];\n      int j;\n      for (j = i; j >= temp + 1; j--) {\n        pat[j] = pat[j - 1];\n      }\n      pat[temp] = e;\n      temp++;\n    }\n  }\n  int k;\n  for (k = 1; k <= temp; k++) {\n    for (i = 0; i < temp - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        e = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << pat[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Pa {\n  char num[20];\n  int year;\n} pa[100];\nint main() {\n  int i, j, x = 0, d = 0, m, n;\n  int b[100];\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pa[i].num, &pa[i].year);\n\n  for (i = 0; i < n; i++)\n    b[i] = pa[i].year;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        d = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      if (i == 0) {\n        for (j = 0; j < n; j++) {\n          if (pa[j].year == b[i])\n            printf(\"%s\\n\", pa[j].num);\n        }\n      } else {\n        if (b[i] != b[i - 1]) {\n          for (j = 0; j < n; j++) {\n            if (pa[j].year == b[i])\n              printf(\"%s\\n\", pa[j].num);\n          }\n        }\n      }\n    }\n    if (b[i] < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].year < 60)\n      printf(\"%s\\n\", pa[i].num);\n  }\n}\n"}
{"label": "9", "index": "15520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  struct point {\n    char x[10];\n    int y;\n  } sz[100];\n  struct po {\n    char a[10];\n    int b;\n    int c;\n  } lnr[100];\n  int n, temp;\n  int tag = 0;\n  char tem[100];\n  int count = 0;\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i].x >> sz[i].y;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = tag; k < n; k++) {\n      if (sz[k].y >= 60) {\n        lnr[j].c = k;\n        lnr[j].b = sz[k].y;\n        strcpy(lnr[j].a, sz[k].x);\n        tag = k + 1;\n        count++;\n        break;\n      }\n    }\n  }\n  for (int l = 0; l < count - 1; l++) {\n    for (int m = count - 1; m > l; m--) {\n      if (lnr[m].b > lnr[m - 1].b) {\n        temp = lnr[m - 1].b;\n        lnr[m - 1].b = lnr[m].b;\n        lnr[m].b = temp;\n\n        strcpy(tem, lnr[m - 1].a);\n        strcpy(lnr[m - 1].a, lnr[m].a);\n        strcpy(lnr[m].a, tem);\n      }\n    }\n  }\n  tag = n - 1;\n  for (int o = n - 1; o > count - 1; o--) {\n    for (int p = tag; p >= 0; p--) {\n      if (sz[p].y < 60) {\n        sz[o].y = sz[p].y;\n        strcpy(sz[o].x, sz[p].x);\n        tag = p - 1;\n        break;\n      }\n    }\n  }\n  for (int q = 0; q < count; q++) {\n    printf(\"%s\\n\", lnr[q].a);\n  }\n  for (int r = count; r < n; r++) {\n    cout << sz[r].x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15521", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } * patients, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  patients = (struct br *)malloc(sizeof(struct br) * n);\n\n  for (i = 0; i < n; i++)\n    cin >> patients[i].id >> patients[i].age;\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint main() {\n  int n, i;\n  struct patient *p, *pre, *pnew, *head1, *head2;\n  head1 = NULL;\n  head2 = NULL;\n  scanf(\"%d\\n\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    pnew = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\\n\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if (pnew->age >= 60) {\n      if (head1 == NULL) {\n        head1 = pnew;\n      } else {\n        p = head1;\n        while (p && p->age >= pnew->age) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head1) {\n          pnew->next = head1;\n          head1 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    } else {\n      if (head2 == NULL)\n        head2 = pnew;\n      else {\n        p = head2;\n        while (p) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head2) {\n          pnew->next = head2;\n          head2 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    }\n  }\n  p = head1;\n  if (head1 != NULL) {\n    while (p) {\n      cout << p->id << \"\\n\";\n      p = p->next;\n    }\n  }\n  p = head2;\n  if (head2 != NULL) {\n    while (p) {\n      cout << p->id << \"\\n\";\n      p = p->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct bing {\n  char id[10];\n  int age;\n};\n\nint main() {\n  struct bing peo[120], old[120], young[120], temp;\n  int i, j, n, num1 = 0, num2 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", peo[i].id, &peo[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      old[num1] = peo[i];\n      num1 = num1 + 1;\n    } else {\n      young[num2] = peo[i];\n      num2 = num2 + 1;\n    }\n  }\n\n  for (i = 0; i < num1 - 1; i++)\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n\n  for (i = 0; i < num1; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < num2; i++)\n    cout << young[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100], j = 0, c[100], z, r;\n  char s[100][10], b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60) {\n      c[j] = a[i];\n      strcpy(b[j], s[i]);\n      j++;\n    }\n  }\n  for (z = j - 1; z > 0; z--) {\n    for (r = 0; r < z; r++) {\n      if (c[r] < c[r + 1]) {\n        int tep;\n        char m[10];\n        tep = c[r + 1];\n        c[r + 1] = c[r];\n        c[r] = tep;\n        strcpy(m, b[r]);\n        strcpy(b[r], b[r + 1]);\n        strcpy(b[r + 1], m);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nvoid sort(struct patient *head, struct patient *q) {\n  struct patient *pre = head, *p = pre->next, *s;\n  s = (struct patient *)malloc(sizeof(struct patient));\n  s->age = q->age;\n  strcpy(s->ID, q->ID);\n  s->next = NULL;\n  if (q->age >= 60) {\n    while ((p != NULL) && (q->age <= p->age)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head;\n  struct patient *p;\n  head = (struct patient *)malloc(sizeof(struct patient));\n  head->next = NULL;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p->ID, &p->age);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "15526", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int renshu, nianling[1000][2], bijiao[1000][2];\n  char id[1000][1000];\n  scanf(\"%d\", &renshu);\n  int i, j, k;\n  j = 0;\n  k = 0;\n  for (i = 0; i < renshu; i++) {\n    scanf(\"%s%d\", id[i], &nianling[i][0]);\n  }\n  for (i = 0; i < renshu; i++) {\n    if (nianling[i][0] < 60)\n      ;\n    else {\n      nianling[i][1] = i;\n      bijiao[k][0] = nianling[i][0];\n      bijiao[k][1] = i;\n      k++;\n    }\n  }\n  int zhongjian[2], l;\n  l = k;\n  bijiao[l][0] = 10000;\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l; j++) {\n      if (bijiao[j][0] > bijiao[j + 1][0]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else if (bijiao[j][0] == bijiao[j + 1][0] &&\n                 bijiao[j][1] < bijiao[j + 1][1]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else\n        ;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < renshu; j++) {\n      if (bijiao[l - 1 - i][0] == nianling[j][0] &&\n          bijiao[l - i - 1][1] == nianling[j][1])\n        printf(\"%s\\n\", id[j]);\n      else\n        ;\n    }\n  }\n  for (j = 0; j < renshu; j++) {\n    if (nianling[j][0] < 60)\n      printf(\"%s\\n\", id[j]);\n    else\n      ;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 2; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *p[100];\n  struct pat *old[100];\n  struct pat *young[100], *temp;\n\n  for (i = 0; i < n; i++) {\n    p[i] = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p[i]->ID, &p[i]->age);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i]->age >= 60) {\n      old[k] = p[i];\n      k++;\n    } else {\n      young[j] = p[i];\n      j++;\n    }\n  }\n  int lenold = k, lenyoung = j;\n  for (k = 1; k < lenold; k++) {\n    for (i = 0; i < lenold - k; i++) {\n      if (old[i]->age < old[i + 1]->age) {\n        temp = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < lenold; i++)\n    cout << old[i]->ID << \" \";\n\n  for (i = 0; i < lenyoung; i++) {\n    printf(\"%s \", young[i]->ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct xinxi {\n  char id[10];\n  int age;\n};\n\nstruct xinxi old[100];\nint main() {\n  int i, n, j;\n  int maxage = 0;\n  scanf(\"%d\", &n);\n\n  for (\n      i = 0; i < n;\n      i++) \n  {\n    scanf(\"%s %d\", old[i].id, &old[i].age);\n  }\n\n  for (i = 0; i < n; i++)\n    if (maxage < old[i].age)\n      maxage = old[i].age;\n\n  for (j = maxage; j >= 60; j--)\n    for (i = 0; i < n; i++)\n      if (old[i].age == j)\n        puts(old[i].id);\n  for (i = 0; i < n; i++)\n    if (old[i].age < 60)\n      puts(old[i].id);\n}\n"}
{"label": "9", "index": "15530", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct oldpeople {\n  char id[20];\n  int year;\n} old[100], old60[100], cache;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> old[i].id >> old[i].year;\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (old[i].year >= 60) {\n      old60[j] = old[i];\n      j++;\n    }\n  }\n  int k;\n  for (i = 0; i < j; i++) {\n    for (k = 0; k < j - i; k++) {\n      if (old60[k].year < old60[k + 1].year) {\n        cache = old60[k + 1];\n        old60[k + 1] = old60[k];\n        old60[k] = cache;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", old60[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (old[i].year < 60)\n      printf(\"%s\\n\", old[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, j = 0, k = 0, l;\n  struct patient b[100];\n  struct patient c[100];\n  struct patient t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pat[i].name, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      b[j] = pat[i];\n      j++;\n    } else {\n      c[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (l = 0; l < k - 1 - i; l++)\n      if (c[l].age < c[l + 1].age) {\n        t = c[l];\n        c[l] = c[l + 1];\n        c[l + 1] = t;\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].name);\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].name);\n}\n"}
{"label": "9", "index": "15532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n};\nint main() {\n  struct pa p[200];\n  int n, i, t[200], j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  i = 0;\n  t[0] = 0;\n  while (i < n) {\n    if (p[i].age >= 60) {\n      for (j = 0; j < i && p[t[j]].age >= p[i].age; j++)\n        ;\n      for (m = i; m > j; m--)\n        t[m] = t[m - 1];\n      t[j] = i;\n      i++;\n    } else {\n      t[i] = i;\n      i++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[t[i]].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } patients[100];\n  struct old {\n    char ido[10];\n    int ao;\n  } olds[100];\n  struct young {\n    char idy[10];\n    int ay;\n  } youngs[100];\n  int n, y = 0, o = 0, so = 0, sy = 0, e;\n  scanf(\"%d\", &n);\n  char f[10];\n  for (int j = 0; j < n; j++) {\n    scanf(\"%s\", patients[j].id);\n    cin >> patients[j].a;\n    if (patients[j].a < 60) {\n      strcpy(youngs[y].idy, patients[j].id);\n      youngs[y].ay = patients[j].a;\n      y++;\n    }\n    if (patients[j].a >= 60) {\n      strcpy(olds[o].ido, patients[j].id);\n      olds[o].ao = patients[j].a;\n      o++;\n    }\n  }\n  for (int r = o - 1; r > 0; r--) {\n    for (int i = 0; i < r; i++) {\n      if (olds[i].ao < olds[i + 1].ao) {\n        e = olds[i + 1].ao;\n        olds[i + 1].ao = olds[i].ao;\n        olds[i].ao = e;\n        strcpy(f, olds[i + 1].ido);\n        strcpy(olds[i + 1].ido, olds[i].ido);\n        strcpy(olds[i].ido, f);\n      }\n    }\n  }\n  for (int l = 0; l <= o - 1; l++)\n    printf(\"%s\\n\", olds[l].ido);\n\n  for (int m = 0; m <= y - 1; m++) {\n    printf(\"%s\\n\", youngs[m].idy);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Ill {\n  char a[10];\n  int age;\n};\n\nint main() {\n  int n, i, k;\n  int m, l = 0;\n  int j = 0;\n  struct Ill illMan[100], illOld[100], temp, illOld1[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", illMan[i].a, &illMan[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age >= 60) {\n      illOld1[j] = illMan[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    m = 0;\n    for (k = 0; k < j; k++) {\n      if (m < illOld1[k].age) {\n        m = illOld1[k].age;\n      }\n    }\n    for (k = 0; k < j; k++) {\n      if (illOld1[k].age == m) {\n        illOld[l] = illOld1[k];\n        illOld1[k].age = 0;\n        l++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", illOld[i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age < 60) {\n      cout << illMan[i].a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, x;\n  scanf(\"%d\", &n);\n  int age[100];\n  char num[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", num[i], &age[i]);\n    if (age[i] < 60)\n      age[i] = 0;\n  }\nloop:\n  for (i = 0; i < n; i++) {\n    x = 0;\n    if (age[i] >= 60) {\n      for (int j = 0; j < n; j++) {\n        if (age[j] > age[i])\n          x = x + 1;\n      }\n      if (x == 0) {\n        printf(\"%s\\n\", num[i]);\n        age[i] = 1;\n        goto loop;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] == 0)\n      printf(\"%s\\n\", num[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[11];\n    int b;\n  } p[100];\n  int n, i, j = 0, m, t;\n  char c[100][11], string[11];\n  int d[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> p[i].a >> p[i].b;\n  for (i = 0; i < n; i++) {\n    if (p[i].b >= 60) {\n      strcpy(c[j], p[i].a);\n      d[j] = p[i].b;\n      j++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n        strcpy(string, c[i]);\n        strcpy(c[i], c[i + 1]);\n        strcpy(c[i + 1], string);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i], d[i]);\n  for (i = 0; i < n; i++) {\n    if (p[i].b < 60)\n      printf(\"%s\\n\", p[i].a, p[i].b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct point {\n    char id[10];\n    int age;\n  } patient[100];\n  int n;\n  int i, j, k;\n  int on = 0, old[100], flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> patient[i].id >> patient[i].age;\n\n  for (j = 120; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (patient[i].age == j) {\n        printf(\"%s\\n\", patient[i].id);\n        old[on] = i;\n        on++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < on; k++) {\n      if (i == old[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      cout << patient[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age, max, t, numold, numyoung;\n  char id[101][10], young[101][10];\n  int x[101], r[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    x[i] = 0;\n    r[i] = 0;\n  }\n  numold = 0;\n  numyoung = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", id[i], &age);\n    if (age >= 60) {\n      x[i] = age;\n      numold++;\n    } else {\n      numyoung++;\n      strcpy(young[numyoung], id[i]);\n    }\n  }\n  for (i = 1; i < 101; i++) {\n    max = 1;\n    for (int j = 2; j < 101; j++) {\n      if (x[j] > x[max])\n        max = j;\n    }\n    x[max] = 0;\n    t = i;\n    r[i] = max;\n    max = t;\n  }\n  for (i = 1; i <= numold; i++)\n    printf(\"%s\\n\", id[r[i]]);\n  for (i = 1; i <= numyoung; i++)\n    printf(\"%s\\n\", young[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  char n[30];\n  int y;\n};\n\nvoid sort(struct stu a[], int l, int r) {\n  int i = l, j = r, t = a[(l + r) / 2].y;\n\n  struct stu temp;\n  while (i <= j) {\n    while (a[i].y > t)\n      i++;\n    while (a[j].y < t)\n      j--;\n    if (i <= j) {\n      temp = a[i];\n      a[i] = a[j];\n      a[j] = temp;\n      i++;\n      j--;\n    }\n  }\n  if (l < j)\n    sort(a, l, j);\n  if (i < r)\n    sort(a, i, r);\n}\n\nint main() {\n  int n;\n  struct stu a[1000], b[1000], c[1000], temp;\n  int i, j, tot = 0, totc = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &a[i].n, &a[i].y);\n    if (a[i].y >= 60) {\n      b[++tot] = a[i];\n    } else {\n      c[++totc] = a[i];\n    }\n  }\n\n  for (i = 1; i < tot; i++)\n    for (j = 2; j <= tot - i + 1; j++)\n      if (b[j - 1].y < b[j].y) {\n        temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n\n  for (i = 1; i <= tot; i++)\n    printf(\"%s\\n\", b[i].n);\n  for (i = 1; i <= totc; i++)\n    printf(\"%s\\n\", c[i].n);\n\n  \n\n  return 0;\n}\n"}
{"label": "9", "index": "15540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, y[200], p[200];\n  char a[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 200; i++)\n    p[i] = 200 - i;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &y[i]);\n  }\n  for (i = 0; i <= 140; i++) {\n    for (j = 0; j < n; j++) {\n      if (y[j] == p[i])\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct sick {\n  char *num;\n  int age;\n  struct sick *next;\n};\nstruct sick *range(int N) {\n  struct sick *pnew, *ppre, *p, *head, *last;\n  pnew = (struct sick *)malloc(1000);\n  pnew->num = (char *)malloc(100 * sizeof(char));\n  pnew->next = NULL;\n  scanf(\"%s %d\", pnew->num, &pnew->age);\n  head = last = pnew;\n  int i;\n  for (i = 2; i <= N; i++) {\n    pnew = (struct sick *)malloc(1000);\n    pnew->num = (char *)malloc(100 * sizeof(char));\n    pnew->next = NULL;\n    scanf(\"%s %d\", pnew->num, &pnew->age);\n    int j;\n    if (pnew->age < 60) {\n      last->next = pnew;\n      last = pnew;\n    } else {\n      if (pnew->age > head->age) {\n        pnew->next = head;\n        head = pnew;\n      } else {\n        ppre = head;\n        p = head->next;\n        for (j = 2; p != NULL; j++) {\n          if (pnew->age > p->age) {\n            ppre->next = pnew;\n            pnew->next = p;\n            break;\n          } else {\n            ppre = ppre->next;\n            p = p->next;\n          }\n        }\n      }\n      if (pnew->next == NULL) {\n        last->next = pnew;\n        last = pnew;\n      }\n    }\n  }\n  return (head);\n}\nvoid print(struct sick *head, int N) {\n  struct sick *p = head;\n  int i;\n  for (i = 1; i <= N; i++) {\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  struct sick *head = range(N);\n  print(head, N);\n  return 0;\n}\n"}
{"label": "9", "index": "15542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, m = 0, p, h;\n  char hao[100][10], mid[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", hao[i], &age[i]);\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60) {\n      m = m + 1;\n      for (j = i; j >= m; j--) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j - 1]);\n        strcpy(hao[j - 1], mid);\n        h = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = h;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (age[j] < age[j + 1]) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j + 1]);\n        strcpy(hao[j + 1], mid);\n        h = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = h;\n      }\n\n  for (i = 0; i < n; i++) {\n    cout << hao[i] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15543", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int age;\n  int order;\n  struct stu *next;\n};\nint main() {\n  struct stu *p, *q, *t, *r, *head;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  head = (struct stu *)malloc(1000);\n  q = head;\n  for (i = 0; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d\", p->name, &p->age);\n    p->order = i;\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n  for (i = 0; i < n - 1; i++)\n    for (p = head, j = 0; j < n - 1 - i; j++, p = p->next) {\n      q = p->next;\n      t = q->next;\n      if ((q->age == t->age && q->order > t->order) ||\n          (q->age < 60 && t->age < q->age && q->order > t->order) ||\n          (t->age < 60 && t->age > q->age && q->order > t->order) ||\n          (t->age >= 60 && t->age > q->age)) {\n        r = t->next;\n        t->next = q;\n        p->next = t;\n        q->next = r;\n      }\n    }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15544", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int age;\n};\nstruct info1 {\n  char num1[10];\n  int age1;\n};\nint main(int argc, char *argv[]) {\n  struct info patient[101];\n  struct info1 old[101];\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", &patient[i].num, &patient[i].age);\n    if (patient[i].age >= 60) {\n      strcpy(old[j].num1, patient[i].num);\n      old[j].age1 = patient[i].age;\n      j++;\n    }\n  }\n  int m = j;\n  for (j = 1; j < m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (old[i].age1 < old[i + 1].age1) {\n        old[100] = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = old[100];\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", old[i].num1);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15545", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct patient {\n    char id[10];\n    int age;\n  } pa[1000], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j >= 0; j--)\n\n      if (pa[j].age > pa[j - 1].age && pa[j].age >= 60)\n\n      {\n\n        t = pa[j];\n        pa[j] = pa[j - 1];\n        pa[j - 1] = t;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    char ID[10];\n    int age;\n  } stu[100], stud[100];\n  int a[100], b[100], i, c, j, x, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &stu[i].ID);\n    cin >> stu[i].age;\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].age >= 60) {\n      a[k] = stu[i].age;\n      b[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    c = b[i];\n    printf(\"%s\\n\", stu[c].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].age < 60)\n      printf(\"%s\\n\", stu[i].ID);\n  }\n}\n"}
{"label": "9", "index": "15547", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  char id[10];\n  int age;\n} ill[100];\n\nint main() {\n  int i, j, n, q;\n  char p[10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &ill[i].id, &ill[i].age);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = n - 1; i > j; i--) {\n      if (ill[i].age >= 60 && ill[i].age > ill[i - 1].age) {\n        strcpy(p, ill[i].id);\n        q = ill[i].age;\n        strcpy(ill[i].id, ill[i - 1].id);\n        ill[i].age = ill[i - 1].age;\n        strcpy(ill[i - 1].id, p);\n        ill[i - 1].age = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ill[i].id);\n}\n"}
{"label": "9", "index": "15548", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  short int age;\n};\nint main() {\n  int i, j, k, l, n;\n  struct patient pat[100], temp;\n  struct patient pa[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n  for (i = 0, j = 0; i < n; i++)\n\n    if (pat[i].age >= 60) {\n      pa[j] = pat[i];\n      j++;\n    }\n  for (k = 0; k < j - 1; k++)\n    for (l = j - 1; l > k; l--)\n      if (pa[l].age > pa[l - 1].age) {\n        temp = pa[l];\n        pa[l] = pa[l - 1];\n        pa[l - 1] = temp;\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", pa[k].id);\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "15549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct information {\n  char ID[10];\n  int age;\n} * a;\nint main() {\n  int n, i, j, max, p, q = 0;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age > 59)\n      q++;\n  }\n  for (i = 0; i < q; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (max < a[j].age) {\n        max = a[j].age;\n        p = j;\n      }\n    }\n    printf(\"%s\\n\", a[p].ID);\n    a[p].age = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age != 0)\n      cout << a[i].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[10];\n    int age;\n  } pat[100];\n  int n, i, m, b[100], l = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].a, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      l = l + 1;\n      b[l] = pat[i].age;\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = i + 1; m <= l; m++)\n      if (b[i] < b[m]) {\n        p = b[i];\n        b[i] = b[m];\n        b[m] = p;\n      }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 1; m <= l; m++) {\n      if (b[i] == b[m]) {\n        if (i != m)\n          b[m] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 0; m < n; m++)\n      if (pat[m].age == b[i])\n        printf(\"%s\\n\", pat[m].a);\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      cout << pat[i].a << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15551", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  cin >> n;\n  struct patient {\n    char id[10];\n    int age;\n    struct patient *next;\n  } * p1, *p2, *head, *p[100], *temp;\n  p1 = p2 = head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", p1->id, &p1->age);\n  for (i = 2; i <= n; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p1->id, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (t = 0, p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p[t] = p1;\n      t++;\n    }\n\n  for (j = 0; j < t - 1; j++)\n    for (i = 0; i < t - j - 1; i++)\n      if (p[i]->age < p[i + 1]->age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n\n  for (i = 0; i <= t - 1; i++)\n    printf(\"%s\\n\", p[i]->id);\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age < 60)\n      printf(\"%s\\n\", p1->id);\n}\n"}
{"label": "9", "index": "15552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct st {\n  int age, he;\n  char num[15];\n  struct st *next;\n};\n\nstruct st *creat(int n) {\n  struct st *head, *p1, *p2;\n  int i, h = 105;\n  p1 = (struct st *)malloc(sizeof(struct st));\n  p2 = p1;\n  head = p1;\n  for (i = 1; i <= n; i++) {\n    p1 = (struct st *)malloc(sizeof(struct st));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age >= 60)\n      p1->he = p1->age * 1000 + h;\n    else\n      p1->he = h;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    h--;\n  }\n  return (head);\n}\n\nvoid paixu(struct st *head) {\n  struct st *max, *p, *p1, *p2, *p3, *p4;\n  p1 = head;\n  while (p1->next) {\n    p2 = p1->next;\n    max = p2;\n    p4 = p2;\n    p = p2->next;\n    while (p) {\n      if (p->he > max->he) {\n        max = p;\n        p3 = p4;\n      }\n      p = p->next;\n      p4 = p4->next;\n    }\n    if (max > p1->next) {\n      p3->next = max->next;\n      p1->next = max;\n      max->next = p2;\n    }\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  struct st *creat(int n);\n  void paixu(struct st * head);\n  struct st *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(head);\n  p = head->next;\n  while (p) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, d[100], e, f, g, i, j, x, y, z;\n  char c[100][100];\n  cin >> a;\n  for (b = 0; b < a; b++)\n    scanf(\"%s %d\", c[b], &d[b]);\n\n  for (e = 0; e < a; e++) {\n    if (d[e] >= 60) {\n      i = e;\n      break;\n    }\n  }\n  for (e = 0, g = 0; e < a; e++) {\n\n    if (d[e] >= 60)\n      g = g + 1;\n  }\n  for (x = 1; x <= g; x++) {\n    for (e = 0; e < a; e++) {\n      if (d[e] >= 60) {\n        if (d[i] < d[e])\n          i = e;\n      }\n    }\n    printf(\"%s \", c[i]);\n    d[i] = 0;\n  }\n  for (z = 0; z < a; z++) {\n    if (d[z] != 0)\n      cout << c[z] << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, f = 0, m = 0, j;\n\n  struct {\n    char id[10];\n    int age;\n  } bingren[100], t[100], l[100], c;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &bingren[i].id, &bingren[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].age >= 60)\n      t[f++] = bingren[i];\n    else if (bingren[i].age < 60)\n      l[m++] = bingren[i];\n  }\n\n  for (i = 1; i < f; i++) {\n    for (j = i; j > 0; j--) {\n      if (t[j].age > t[j - 1].age) {\n        c = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = c;\n      }\n    }\n  }\n\n  for (i = 0; i < f; i++) {\n    cout << t[i].id << \"\\n\";\n  }\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", l[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], dengji[100], p, t;\n  char id[100][10], c;\n  int jishuqi = 0, k;\n  int l, m;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    dengji[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        k = dengji[j];\n        dengji[j] = dengji[j + 1];\n        dengji[j + 1] = k;\n        for (p = 0; p <= 9; p++) {\n          c = id[j][p];\n          id[j][p] = id[j + 1][p];\n          id[j + 1][p] = c;\n        }\n      }\n      if (age[j] == age[j + 1]) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < 60) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          t = age[j];\n          age[j] = age[j + 1];\n          age[j + 1] = t;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 1; i++)\n    cout << id[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "15556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], oage[100];\n  char ID[100][10], old[100][10], young[100][10];\n  scanf(\"%d\", &n);\n  int i, m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", ID[i], &age[i]);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[k], ID[i]);\n      k++;\n    } else {\n      oage[j] = age[i];\n      strcpy(old[j], ID[i]);\n      j++;\n    }\n  }\n  for (i = 150; i >= 60; i--) {\n    for (m = 0; m < j; m++) {\n      if (oage[m] == i) {\n        cout << old[m] << \"\\n\";\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", young[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int age;\n} line[100];\nint main() {\n  int n, i, j, k, temp = 0, m, e;\n  scanf(\"%d\", &n);\n  int a[100] = {0}, b[100] = {0};\n  char s[100][10], y[100][10];\n  char exchange[10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", line[i].num, &line[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      temp++;\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      strcpy(s[j], line[i].num);\n      b[j] = line[i].age;\n      j++;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    for (k = 0; k < temp - j; k++) {\n      if (b[k] < b[k + 1]) {\n        e = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = e;\n        strcpy(exchange, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], exchange);\n      }\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    printf(\"%s\\n\", s[j]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age < 60) {\n      strcpy(y[m], line[i].num);\n      m++;\n    }\n  }\n  for (j = 0; j < n - temp; j++) {\n    cout << y[j] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    char num[100];\n    int age;\n  } p[101];\n  int n, i, j, k, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  struct q {\n    char num[100];\n    int age;\n  } q[101];\n  for (i = 1, j = 1; i <= n; i++) {\n    if (p[i].age >= 60) {\n      strcpy(q[j].num, p[i].num);\n      q[j].age = p[i].age;\n      j++;\n      m = m + 1;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 1; i <= m - 1; i++) {\n      if (q[i].age < q[i + 1].age) {\n        q[101] = q[i];\n        q[i] = q[i + 1];\n        q[i + 1] = q[101];\n      }\n    }\n  }\n  printf(\"%s\", q[1].num);\n  for (i = 2; i <= m; i++)\n    printf(\" %s\", q[i].num);\n  for (i = 1; i <= n; i++)\n    if (p[i].age < 60)\n      printf(\" %s\", p[i].num);\n}\n"}
{"label": "9", "index": "15559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct {\n  char id[20];\n  int age;\n} patient;\nint main() {\n  patient a[100], b[100], c[100], temp;\n  int n, i, j, k = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      for (j = 0; j < 20; j++) {\n        b[k].id[j] = a[i].id[j];\n        b[k].age = a[i].age;\n      }\n      k++;\n    } else {\n      for (j = 0; j < 20; j++)\n        c[l].id[j] = a[i].id[j];\n\n      l++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << b[i].id << \"\\n\";\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "15560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, y, x = 0;\n  struct ID {\n    int age;\n    char a[10];\n  } ID[201];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> ID[i].a;\n    scanf(\"%d\", &ID[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].age >= 60) {\n      ID[100 + x] = ID[i];\n      ID[i].a[0] = '\\0';\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (y = 0; y < x - 1 - i; y++) {\n      if (ID[100 + y].age < ID[y + 101].age) {\n        ID[200] = ID[100 + y];\n        ID[100 + y] = ID[y + 101];\n        ID[y + 101] = ID[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", ID[100 + i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].a[0] != '\\0')\n      printf(\"%s\\n\", ID[i].a);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15561", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n};\n\nint main() {\n  int i, n, k = 0;\n  struct data *p1, *p2, *head;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  print(head);\n  return 0;\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  printf(\"%s \", code->id);\n\n  if (pre == head) {\n    head->next = code->next;\n  } else {\n    pre->next = code->next;\n  }\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *head) {\n  struct data *p;\n  p = head->next;\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "15562", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct mice {\n  int wei;\n  char color[100];\n  struct mice *next;\n};\nstruct mice *creat(int c) {\n  struct mice *head;\n  struct mice *p1, *p2;\n  struct mice *kok;\n  kok = (struct mice *)malloc(1000);\n  kok->wei = 0;\n  strcpy(kok->color, \"\u0000\");\n  int t;\n  t = 0;\n  p1 = p2 = (struct mice *)malloc(1000);\n  scanf(\"%s %d\", p1->color, &p1->wei);\n  head = NULL;\n  while (t < c) {\n    t = t + 1;\n    if (t == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n      p1 = (struct mice *)malloc(1000);\n      scanf(\"%s %d\", p1->color, &p1->wei);\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = kok;\n  return (head);\n}\nvoid mun(struct mice *hoih, int io) {\n  int i, j, k;\n  k = 0;\n  struct mice *bt;\n  bt = hoih;\n  char str[100];\n  for (i = 0; i < io; i++) {\n    for (j = 0; j < io - i; j++) {\n      if (hoih->wei < (hoih->next)->wei && (hoih->next)->wei >= 60) {\n        k = hoih->wei;\n        hoih->wei = (hoih->next)->wei;\n        (hoih->next)->wei = k;\n        strcpy(str, hoih->color);\n        strcpy(hoih->color, (hoih->next)->color);\n        strcpy((hoih->next)->color, str);\n      }\n\n      hoih = hoih->next;\n    }\n    hoih = bt;\n  }\n  return;\n}\n\nint main() {\n  int n, h;\n  struct mice *creat(int c);\n  struct mice *p, *he;\n  cin >> n;\n  p = creat(n);\n  he = p;\n  void mun(struct mice * hoih, int io);\n  mun(p, n);\n  p = he;\n  for (h = 0; h < n; h++) {\n    printf(\"%s \", p->color);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int n, age[100], i, k = 0, m, len, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(id[i]), &(age[i]));\n  }\n  char e[100][10], kong[10];\n  int xin[100];\n  for (i = 0; i < n; i++) {\n    if (age[i] > 59) {\n      xin[k] = age[i];\n      strcpy(e[k], id[i]);\n      k++;\n    }\n  }\n  len = k;\n  for (m = 1; m <= len; m++) {\n    for (k = 0; k < len - m; k++) {\n      if (xin[k] < xin[k + 1]) {\n        p = xin[k];\n        strcpy(kong, e[k]);\n        xin[k] = xin[k + 1];\n        strcpy(e[k], e[k + 1]);\n        xin[k + 1] = p;\n        strcpy(e[k + 1], kong);\n      }\n    }\n  }\n  for (k = 0; k < len; k++) {\n    printf(\"%s\\n\", e[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15564", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int n, j = 0, i, num = 0, t;\n  char a[100][10], d[100][10], temp[10]; \n  int b[100], c[100];                    \n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]); \n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[j] = b[i];\n      strcpy(d[j], a[i]);\n      j++;\n      num = j; \n    }\n  }\n  for (i = 1; i < num; i++)\n    for (j = 0; j < num - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = t;\n        strcpy(temp, d[j + 1]);\n        strcpy(d[j + 1], d[j]);\n        strcpy(d[j], temp); \n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      c[num] = b[i];\n      strcpy(d[num], a[i]);\n      num++; \n    }\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%s\\n\", d[j]); \n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int year;\n} pat[100];\nint arrange(struct patient peop[], int num);\n\nint main() {\n  int i, j = 0, k, n, max;\n  struct patient *ppat[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].year;\n  for (i = 0; i < n; i++) {\n    if (pat[i].year >= 60) {\n      ppat[j] = pat + i;\n      j++;\n    }\n  }\n\n  struct patient *p;\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - 1 - i; k++) {\n      if ((*ppat[k]).year < (*ppat[k + 1]).year) {\n        p = ppat[k];\n        ppat[k] = ppat[k + 1];\n        ppat[k + 1] = p;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", ppat[i]->id);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year < 60)\n      cout << pat[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15566", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n  struct man *next;\n};\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nstruct man *insert(struct man *head, struct man *stud, int n) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  scanf(\"%s %d\", p0->num, &p0->age);\n  p0->nu = n + 1;\n  p0->next = NULL;\n  if (head == NULL)\n    head = p0;\n  else {\n    while ((f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) < 0) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) > 0) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n    }\n  }\n  return (head);\n}\nvoid print(struct man *head, int n) {\n  struct man *p;\n  int k;\n  p = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k;\n  struct man *head, *stu;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    stu = (struct man *)malloc(1000);\n    head = insert(head, stu, k);\n  }\n  print(head, n);\n}\n"}
{"label": "9", "index": "15567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *pre;\n};\nint main() {\n  void f(struct patient * *head);\n  struct patient *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  p2 = p1;\n  head = p1;\n  p1->pre = NULL;\n  scanf(\"%s %d\", p1->id, &p1->age);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n    p1->pre = p2;\n    p2 = p1;\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  f(&head);\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    printf(\"%s\\n\", p1->id);\n}\nvoid f(struct patient **head) {\n  struct patient *p1, *p2, *p;\n  for (p1 = (*head)->next; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p = p1->next;\n      p1->pre->next = p1->next;\n      if (p1->next != NULL)\n        p1->next->pre = p1->pre;\n      for (p2 = *head; p2->next != NULL; p2 = p2->next)\n        if (p1->age > p2->age) {\n          if (p2->pre != NULL)\n            p2->pre->next = p1;\n          else\n            *head = p1;\n          p1->pre = p2->pre;\n          p2->pre = p1;\n          p1->next = p2;\n          break;\n        }\n      if (p2->next == NULL) {\n        if (p1->age > p2->age) {\n          if (p2->pre != NULL)\n            p2->pre->next = p1;\n          else\n            *head = p1;\n          p1->pre = p2->pre;\n          p2->pre = p1;\n          p1->next = p2;\n        } else {\n          p2->next = p1;\n          p1->pre = p2;\n          p1->next = NULL;\n        }\n      }\n      if (p != NULL)\n        p1 = p->pre;\n      else\n        break;\n    }\n}\n"}
{"label": "9", "index": "15568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n} pat[100];\nint main() {\n  int i, k, n, e;\n  int ex[100], ex1[100];\n  i = 0;\n  k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", &(pat[i].id), &(pat[i].age));\n    ex[i] = pat[i].age;\n    ex1[i] = i + 1;\n  }\n  for (k = n - 1; k >= 1; k--) {\n    for (i = n - 1; i >= n - k; i--) {\n      if (ex[i] > ex[i - 1] && ex[i] >= 60) {\n        e = ex[i];\n        ex[i] = ex[i - 1];\n        ex[i - 1] = e;\n        e = ex1[i];\n        ex1[i] = ex1[i - 1];\n        ex1[i - 1] = e;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] >= 60) {\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] < 60) {\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct bingren {\n    char num[10];\n    int age;\n  };\n  int n;\n  scanf(\"%d\", &n);\n  struct bingren u[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &u[i].num, &u[i].age);\n  }\n  struct bingren v[1000];\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (u[i].age > 59) {\n      v[j] = u[i];\n      j++;\n    }\n  }\n  int k;\n  struct bingren e;\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (v[i].age < v[i + 1].age) {\n        e = v[i + 1];\n        v[i + 1] = v[i];\n        v[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", v[i].num);\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i].age < 60) {\n      printf(\"%s\\n\", u[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[11];\n    int b;\n  } p[100];\n  int n, i, j = 0, m, t;\n  char c[100][11], string[11];\n  int d[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].a, &p[i].b);\n  for (i = 0; i < n; i++) {\n    if (p[i].b >= 60) {\n      strcpy(c[j], p[i].a);\n      d[j] = p[i].b;\n      j++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n        strcpy(string, c[i]);\n        strcpy(c[i], c[i + 1]);\n        strcpy(c[i + 1], string);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i], d[i]);\n  for (i = 0; i < n; i++) {\n    if (p[i].b < 60)\n      printf(\"%s\\n\", p[i].a, p[i].b);\n  }\n}\n"}
{"label": "9", "index": "15571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  char id[100];\n  int age;\n};\n\nint main() {\n\n  struct data old[1000];\n  struct data young[1000];\n  struct data temp;\n  int n, i, p = 0, q = 0, len1, len2, k;\n  char id[100];\n  int age;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id >> age;\n    if (age >= 60) {\n      old[p].age = age;\n      strcpy(old[p].id, id);\n      p++;\n    } else {\n      young[q].age = age;\n      strcpy(young[q].id, id);\n      q++;\n    }\n  }\n  len1 = p;\n  len2 = q;\n  for (k = 1; k < len1; k++) {\n    for (i = 0; i < len1 - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        temp = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < len2; i++) {\n    cout << young[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *sort(struct patient *head, char d[10], int a) {\n  struct patient *pp, *p, *s;\n  p = head;\n  pp = p;\n  p = p->next;\n  s = (struct patient *)malloc(1000);\n  strcpy(s->id, d);\n  s->age = a;\n  while (p != NULL && p->age >= a) {\n    pp = p;\n    p = p->next;\n  }\n  s->next = p;\n  pp->next = s;\n}\n\nstruct patient *creat(struct patient *hhead, char d[10], int a) {\n  struct patient *p, *pp, *s;\n  p = hhead;\n  pp = p;\n  p = p->next;\n  while (p != NULL) {\n    pp = p;\n    p = p->next;\n  }\n  s = (struct patient *)malloc(1000);\n  s->age = a;\n  strcpy(s->id, d);\n  s->next = p;\n  pp->next = s;\n}\n\nint main() {\n  struct patient *head, *hhead, *p1, *p2;\n  int n, a, i;\n  char d[10];\n  scanf(\"%d\", &n);\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  hhead = (struct patient *)malloc(1000);\n  hhead->next = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d \", d, &a);\n    if (a >= 60)\n      sort(head, d, a);\n    else\n      creat(hhead, d, a);\n  }\n  p1 = head->next;\n  p2 = hhead->next;\n  while (p1 != NULL) {\n    cout << p1->id << \" \";\n    p1 = p1->next;\n  }\n  while (p2 != NULL) {\n    cout << p2->id << \" \";\n    p2 = p2->next;\n  }\n}\n"}
{"label": "9", "index": "15573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pati {\n  char ID[10];\n  int age;\n} p[100];\nint main() {\n  int i, j, n, p2[100] = {0}, p3[100] = {0}, t = 0, r = 0, tem;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60) {\n      p2[t] = p[i].age;\n      t++;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++) {\n      if (p2[j] < p2[j + 1]) {\n        tem = p2[j + 1];\n        p2[j + 1] = p2[j];\n        p2[j] = tem;\n      }\n    }\n  for (i = 0; i < t; i++) {\n    if (i > 0) {\n      if (p2[i] != p2[i - 1]) {\n        p3[r] = p2[i];\n        r++;\n      }\n    } else {\n      p3[r] = p2[i];\n      r++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[j].age == p3[t]) {\n        printf(\"%s\\n\", p[j].ID);\n      }\n    }\n    t++;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, t;\n  cin >> n;\n  char a[n][100], s[n][100], r[100];\n  int b[n], c[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (int j = 0; j < n; j++) {\n    if (b[j] >= 60) {\n      c[m] = b[j], strcpy(s[m], a[j]);\n      if (m != 0) {\n        for (int k = m; k > 0; k = k - 1) {\n          if (c[k] > c[k - 1]) {\n            strcpy(r, s[k]), strcpy(s[k], s[k - 1]), strcpy(s[k - 1], r);\n            t = c[k], c[k] = c[k - 1], c[k - 1] = t;\n          }\n        }\n      }\n      m++;\n    }\n  }\n  if (m != 0) {\n    for (int i = 0; i < m; i++)\n      printf(\"%s\\n\", s[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (b[j] < 60)\n      cout << a[j] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct patient {\n    char num[10];\n    int age;\n  } pa[100], pao[100], pay[100], blank;\n  int i, j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pa[i].num);\n    scanf(\"%d\", &pa[i].age);\n    if (pa[i].age >= 60)\n      pao[j++] = pa[i];\n    else\n      pay[k++] = pa[i];\n  }\n  int t;\n  for (i = 0; i < j; i++) {\n    for (t = i + 1; t < j; t++) {\n      if (pao[t].age > pao[i].age) {\n        blank = pao[i];\n        pao[i] = pao[t];\n        pao[t] = blank;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (pao[i].age != pao[i - 1].age) {\n      for (t = 0; t < n; t++)\n        if (pa[t].age == pao[i].age)\n          printf(\"%s\\n\", pa[t].num);\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << pay[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct sick {\n  char name[10];\n  int age;\n};\nint main() {\n  int n, i, count = 0, j;\n  struct sick s[100], a[100], t;\n  char b[3];\n\n  cin >> b;\n  n = atoi(b);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i].name, &s[i].age);\n  }\n  if (n == 1)\n    printf(\"%s\", s[0].name);\n  else {\n    for (i = 0; i < n; i++)\n      if (s[i].age >= 60) {\n        a[count] = s[i];\n        count++;\n      }\n    for (i = 0; i < count - 1; i++)\n      for (j = 0; j < count - 1 - i; j++)\n        if (a[j].age < a[j + 1].age) {\n          t = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = t;\n        }\n    for (i = 0; i < count; i++)\n      printf(\"%s \", a[i].name);\n    for (i = 0; i < n; i++)\n      if (s[i].age < 60)\n        printf(\"%s \", s[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct p {\n    char num[100];\n    int age;\n  } pa[100], p[100], t;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pa[i].num, &pa[i].age);\n  }\n  i = n - 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age < 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  k = i + 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age >= 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  for (j = 0; j < k; j++) {\n    for (i = 0; i < k - j - 1; i++) {\n      if (p[i].age < p[i + 1].age) {\n        t = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << &p[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n} a[100], e, b[100];\n\nint main() {\n  int n, J;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j].id > a[j + 1].id) {\n        e = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = e;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  J = j;\n  for (j = 0; j < J; j++) {\n    for (i = 0; i < J - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (j = 0; j < J; j++)\n    printf(\"%s\\n\", b[j].id);\n\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Info {\n  char sID[10];\n  int nAge;\n};\nint main() {\n  int i, n, j, l;\n  struct Info t;\n  cin >> n;\n  struct Info patients[100];\n  struct Info overpatients[100];\n  l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patients[i].sID, &patients[i].nAge);\n    if (patients[i].nAge >= 60) {\n      overpatients[l] = patients[i];\n      l++;\n    }\n  }\n  for (i = 0; i < l - 1; i++)\n    for (j = 1; j < l - i; j++) {\n      if (overpatients[j - 1].nAge < overpatients[j].nAge) {\n        t = overpatients[j - 1];\n        overpatients[j - 1] = overpatients[j];\n        overpatients[j] = t;\n      }\n    }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", overpatients[i].sID);\n  }\n  for (i = 0; i < n; i++)\n    if (patients[i].nAge < 60) {\n      printf(\"%s\\n\", patients[i].sID);\n    }\n}\n"}
{"label": "9", "index": "15580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n\n} per[100];\nint main() {\n  int i, n, j, k = 0, a[100] = {0}, num = 0, temp1;\n  char b[100][10] = {0}, temp2[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n  for (i = 0; i < n; i++) {\n    if (per[i].age >= 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < num - j; k++)\n      if (a[k] < a[k + 1]) {\n        temp1 = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = temp1;\n        strcpy(temp2, b[k]);\n        strcpy(b[k], b[k + 1]);\n        strcpy(b[k + 1], temp2);\n      }\n  }\n  for (i = 0, k = num; i < n; i++) {\n    if (per[i].age < 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (k = 0; k < num - 1; k++)\n    cout << b[k] << \"\\n\";\n  cout << b[num - 1];\n  return 0;\n}\n"}
{"label": "9", "index": "15581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = -1, t = -1, k, age[100], e[100], h[100];\n  char a[100][10], b[100][10], c[100][10], f[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%s %d\", a[i], &age[i]);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (age[i] >= 60) {\n\n      s = s + 1;\n      e[s] = age[i];\n      strcpy(b[s], a[i]);\n    } else {\n\n      t = t + 1;\n      h[t] = age[i];\n      strcpy(c[t], a[i]);\n    }\n  }\n  for (j = 0; j < s; j++) {\n    for (i = 0; i < s - j; i++) {\n      if (e[i] < e[i + 1]) {\n        k = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = k;\n        strcpy(f, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i <= s; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= t; i++)\n    cout << c[i] << \"\\n\";\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ID[1000][1000], IDup60[1000][1000], IDunder60[1000][1000], s[1000];\n  int b, h, i, j, k, l, m, max = 0, n, o, p, q, t = 0, u = 0, YearOld[1000],\n                           YearOldup60[1000], id[1000], idup60[1000];\n  cin >> n;\n  for (h = 0; h < n; h++) {\n    cin >> ID[h] >> YearOld[h];\n    id[h] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; ID[i][j] != '\u0000'; j++) {\n      id[i] = 10 * id[i];\n      id[i] = id[i] + (ID[i][j] - '0');\n    }\n  }\n  for (m = 0; m < n; m++) {\n    if (YearOld[m] > max)\n      max = YearOld[m];\n  }\n  for (k = 0; k <= max; k++) {\n    for (l = 0; l < n; l++) {\n      if (YearOld[l] == max - k && max - k >= 60) {\n        YearOldup60[t] = YearOld[l];\n        idup60[t] = id[l];\n        strcpy(IDup60[t], ID[l]);\n        t++;\n      }\n    }\n  }\n  for (b = 0; b < n; b++) {\n    if (YearOld[b] < 60) {\n      strcpy(IDunder60[u], ID[b]);\n      u++;\n    }\n  }\n  for (p = 0; p < t; p++) {\n    cout << IDup60[p] << \" \";\n  }\n  for (q = 0; q < u; q++) {\n    printf(\"%s \", IDunder60[q]);\n  }\n}\n"}
{"label": "9", "index": "15583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patients {\n  int num;\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, y, o;\n  struct patients list[100], young[100], old[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    list[i].num = i;\n    scanf(\"%s %d\", list[i].ID, &list[i].age);\n  }\n\n  y = 0;\n  o = 0;\n\n  for (i = 0; i < n; i++) {\n    if (list[i].age >= 60) {\n      old[o] = list[i];\n      o++;\n    } else {\n      young[y] = list[i];\n      y++;\n    }\n  }\n\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        struct patients check;\n        check = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = check;\n      }\n    }\n  }\n\n  for (i = 0; i < o; i++)\n    cout << old[i].ID << \"\\n\";\n\n  for (i = 0; i < y; i++) {\n    cout << young[i].ID << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, j, i, n, max, count, a[100];\n  \n  char s[100][10];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d\", s[i], &a[i]); \n  }\n  n = 0;\n  for (count = 0; count < num; count++) {\n    max = 59;\n    for (i = 0; i < num; i++) {\n      if (a[i] > max && a[i] < 200) \n      {\n        max = a[i];\n        j = i;\n      }\n    }\n    if (max == 59) \n      break;\n    printf(\"%s\\n\", s[j]); \n    a[j] = 300;           \n  }\n  for (i = 0; i < num; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]); \n  }\n  \n  \n  return 0;\n}\n"}
{"label": "9", "index": "15585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, t;\n  cin >> n;\n  char a[n][10];\n  char p[1][10];\n  int g[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &g[j]);\n  for (j = n - 1; j > 0; j--)\n    for (k = n - 1; k > n - j - 1; k--) {\n      if (g[k] >= 60) {\n        if (g[k] > g[k - 1]) {\n          t = g[k - 1];\n          g[k - 1] = g[k];\n          g[k] = t;\n          strcpy(p[0], a[k - 1]);\n          strcpy(a[k - 1], a[k]);\n          strcpy(a[k], p[0]);\n        }\n      }\n    }\n  for (k = 0; k < n; k++)\n    printf(\"%s \", a[k]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15586", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, age, m, y;\n  int b[1000];\n  char B[1000][100], C[1000][100], d[1000][100];\n  char a[1000];\n  scanf(\"%d\", &n);\n  y = 0;\n  k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a >> age;\n    if (age < 60) {\n      strcpy(B[y], a);\n      y++;\n    } else {\n      strcpy(C[k], a);\n      b[k] = age;\n      k++;\n    }\n  }\n  int x = 0;\n  for (i = 200; i >= 60; i--) {\n    for (j = 0; j <= k - 1; j++) {\n      if (i == b[j]) {\n        strcpy(d[x], C[j]);\n        x++;\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++)\n    puts(d[i]);\n  for (i = 0; i <= n - k - 1; i++)\n    puts(B[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15587", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[15];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *create() {\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  head = p1;\n  p2 = p1;\n  p1->next = NULL;\n  int i = 1;\n  do {\n    if (i == n)\n      break;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  } while (1);\n  return (head);\n}\nstruct patient *findmax(struct patient *head) {\n  struct patient *max;\n\n  struct patient *p;\n  max = head;\n  p = head->next;\n  while (p) {\n    if (p->age > max->age)\n      max = p;\n    p = p->next;\n  }\n  return (max);\n}\nstruct patient *del(struct patient *head, struct patient *needdel) {\n  struct patient *p, *ppre;\n  printf(\"%s \", needdel->ID);\n  p = head;\n  while (p && needdel != p) {\n    ppre = p;\n    p = p->next;\n  }\n  if (p == head) {\n    head = p->next;\n    free(p);\n  } else if (p) {\n    ppre->next = p->next;\n    free(p);\n  }\n\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n\n  cin >> n;\n  struct patient *head, *p;\n  head = create();\n  p = head;\n\n  do {\n    p = findmax(head);\n    if (p->age < 60)\n      break;\n    head = del(head, p);\n\n  } while (1);\n  print(head);\n}\n"}
{"label": "9", "index": "15588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct p {\n  char i[10];\n  int a;\n  struct p *next;\n};\nint main() {\n  struct p *p1, *p2, *head, *head2, *q1, *q2;\n  int n, i, k = 0, b = 0, x = 0;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  scanf(\"%s %d\", p1->i, &p1->a);\n  for (i = 0; i < n; i++) {\n    k++;\n    if (k == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n    scanf(\"%s %d\", p1->i, &p1->a);\n  }\n  p2->next = NULL;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60)\n      x++;\n  k = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60 && p1->a > b) {\n      b = p1->a;\n      p2 = p1;\n    }\n  q1 = q2 = (struct p *)malloc(1000);\n  strcpy(q1->i, p2->i);\n  q1->a = p2->a;\n  p2->a = 0;\n  for (i = 0; i < x - 1; i++) {\n    k++;\n    if (k == 1)\n      head2 = q1;\n    else\n      q2->next = q1;\n    q2 = q1;\n    b = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next)\n      if (p1->a >= 60 && p1->a > b) {\n        b = p1->a;\n        p2 = p1;\n      }\n    q1 = (struct p *)malloc(1000);\n    strcpy(q1->i, p2->i);\n    q1->a = p2->a;\n    p2->a = 0;\n  }\n  q2->next = q1;\n  q2 = q1;\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a > 0) {\n      q1 = (struct p *)malloc(1000);\n      strcpy(q1->i, p1->i);\n      q1->a = p1->a;\n      p1->a = 0;\n      q2->next = q1;\n      q2 = q1;\n    }\n  q2->next = NULL;\n  for (q1 = head2; q1 != NULL; q1 = q1->next)\n    cout << q1->i << \" \";\n}\n"}
{"label": "9", "index": "15589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    char ID[10];\n    int a;\n    int p;\n  } s[100], t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> s[i].ID >> s[i].a;\n    s[i].p = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (((s[i].a < 60) && (s[j].a >= 60)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a < s[j].a)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a == s[j].a) &&\n           (s[i].p > s[j].p)) ||\n          ((s[i].a < 60) && (s[j].a < 60) && (s[i].p > s[j].p))) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n  for (i = 1; i <= n; i++)\n    cout << s[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, y, x = 0;\n  struct ID {\n    int age;\n    char a[10];\n  } ID[201];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ID[i].a);\n    scanf(\"%d\", &ID[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].age >= 60) {\n      ID[100 + x] = ID[i];\n      ID[i].a[0] = '\\0';\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (y = 0; y < x - 1 - i; y++) {\n      if (ID[100 + y].age < ID[y + 101].age) {\n        ID[200] = ID[100 + y];\n        ID[100 + y] = ID[y + 101];\n        ID[y + 101] = ID[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", ID[100 + i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].a[0] != '\\0') {\n      printf(\"%s\\n\", ID[i].a);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int nj[1000];\n  int lr[1000], xr[1000];\n  char zfc[1000][20];\n  int i;\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &nj[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (nj[i] >= 60) {\n      lr[m] = i;\n      m++;\n    } else {\n      xr[k] = i;\n      k++;\n    }\n  }\n  int j;\n  if (m >= 2) {\n    for (i = 0; i < m - 1; i++) {\n      for (j = m - 1; j > i; j--) {\n        int e;\n        if (nj[lr[j]] > nj[lr[j - 1]]) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        } else if (nj[lr[j]] == nj[lr[j - 1]] && (lr[j] < lr[j - 1])) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        }\n      }\n    }\n  }\n  if (m >= 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%s \", zfc[lr[i]]);\n    }\n  }\n  if (k > 0) {\n    for (i = 0; i < k; i++) {\n      cout << zfc[xr[i]] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  int re;\n} p[100], po[100], temp;\nint main() {\n  int n, i, j, pj = 0, oldj = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[pj].id >> p[pj].age;\n    if (p[pj].age >= 60) {\n      po[oldj] = p[pj];\n      po[oldj].re = oldj;\n      oldj++;\n    } else {\n      p[pj].re = pj;\n      pj++;\n    }\n  }\n  for (i = 0; i < oldj - 1; i++) {\n    for (j = i + 1; j < oldj; j++) {\n      if ((po[i].age < po[j].age) ||\n          (po[i].age == po[j].age && po[i].re > po[j].re)) {\n        temp = po[i];\n        po[i] = po[j];\n        po[j] = temp;\n      }\n    }\n    printf(\"%s\\n\", po[i].id);\n  }\n  printf(\"%s\\n\", po[i].id);\n  for (i = 0; i < pj; i++)\n    printf(\"%s\\n\", p[i].id);\n}\n"}
{"label": "9", "index": "15593", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age[100], a, ageb[100], c, t, m;\n  char ID[100][100], IDb[100][100], IDc[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n\n  i = 0;\n  c = 0;\n  while (i < n) {\n    if (age[i] >= 60) {\n      ageb[c] = age[i];\n      strcpy(IDb[c], ID[i]);\n      c++;\n    }\n    i++;\n  }\n  for (i = 0; i <= c - 1; i++)\n    for (a = 0; a < c - i - 1; a++) {\n      if (ageb[a] < ageb[a + 1]) {\n        t = ageb[a];\n        strcpy(IDc, IDb[a]);\n        ageb[a] = ageb[a + 1];\n        strcpy(IDb[a], IDb[a + 1]);\n        ageb[a + 1] = t;\n        strcpy(IDb[a + 1], IDc);\n      }\n    }\n  for (i = 0; i <= c - 1; i++)\n    printf(\"%s\\n\", IDb[i]);\n  i = 0;\n  while (i < n) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", ID[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15594", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char id[100][10];\n  int age[100];\n  int oldno = 0;\n  int xu[100];\n  char shunxu[100][10];\n  for (int i = 0; i < n; i++)\n    cin >> id[i] >> age[i];\n\n  for (int j = 0; j < n; j++) {\n    if (age[j] >= 60) {\n      xu[oldno] = age[j];\n      strcpy(shunxu[oldno], id[j]);\n      oldno++;\n    }\n  }\n\n  int num = oldno;\n  int e;\n  char tem[10];\n  for (int k = 0; k < n; k++) {\n    if (age[k] < 60) {\n      xu[oldno] = age[k];\n      strcpy(shunxu[oldno], id[k]);\n      oldno++;\n    }\n  }\n  for (int x = 1; x <= num; x++) {\n    for (int y = 0; y < num - x; y++) {\n      if (xu[y] < xu[y + 1]) {\n        e = xu[y];\n        xu[y] = xu[y + 1];\n        xu[y + 1] = e;\n        strcpy(tem, shunxu[y]);\n        strcpy(shunxu[y], shunxu[y + 1]);\n        strcpy(shunxu[y + 1], tem);\n      }\n    }\n  }\n  for (int z = 0; z < n; z++) {\n    printf(\"%s\\n\", shunxu[z]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  char num[20];\n  int score;\n  struct stu *next;\n};\nvoid sort(struct stu *head, struct stu *q) {\n  struct stu *pre = head, *p = pre->next, *s;\n  s = (struct stu *)malloc(sizeof(struct stu));\n  s->score = q->score;\n  strcpy(s->num, q->num);\n  s->next = NULL;\n  if (s->score >= 60) {\n    while ((p != NULL) && (q->score <= p->score)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while ((p != NULL)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i = 0;\n  p = head;\n  while (p != NULL) {\n\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k, i;\n  struct stu *head;\n  struct stu *p;\n  head = (struct stu *)malloc(sizeof(struct stu));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%s %d\", p->num, &p->score);\n    sort(head, p);\n  }\n  print(head->next);\n  return 0;\n}\n"}
{"label": "9", "index": "15596", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} p[100];\n\nint main() {\n  int i, j = 0, k = 0, t, l, n;\n  char other[100][10], a[10];\n  struct patient old[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].num, &p[i].age);\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n\n      strcpy(old[j].num, p[i].num);\n      old[j].age = p[i].age;\n      j++;\n    } else {\n      strcpy(other[k], p[i].num);\n      k++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++) {\n    for (l = 0; l < j - 1 - i; l++) {\n      if (old[l].age < old[l + 1].age) {\n        t = old[l].age;\n        old[l].age = old[l + 1].age;\n        old[l + 1].age = t;\n\n        strcpy(a, old[l].num);\n        strcpy(old[l].num, old[l + 1].num);\n        strcpy(old[l + 1].num, a);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].num);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", other[i]);\n}\n"}
{"label": "9", "index": "15597", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct a {\n  char id[100];\n  int year;\n} p[100];\nint main() {\n  int n, i, j, k, t = 0, r = 0;\n  int a[200] = {0};\n  scanf(\"%d\", &n);\n  struct a b[100];\n  struct a c[100];\n  struct a temp;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].year);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year >= 60) {\n      b[t] = p[i];\n      t++;\n    }\n  }\n  for (i = 0; i <= t - 1; i++) {\n    a[b[i].year]++;\n  }\n  for (i = 200; i >= 60; i--) {\n    if (a[i] > 0) {\n      for (j = 0; j <= t - 1; j++) {\n        if (b[j].year == i) {\n          c[r] = b[j];\n          r++;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= t - 1; i++) {\n    printf(\"%s\\n\", c[i].id);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15598", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ID {\n    char x[100];\n    int y;\n  } da[100], xiao[100], p[100], e;\n  int s, m = 0, n = 0;\n  cin >> s;\n\n  for (int i = 0; i < s; i++) {\n    scanf(\"%s %d\", &(p[i].x), &(p[i].y));\n    if (p[i].y >= 60) {\n      da[m] = p[i];\n      m++;\n    } else {\n      xiao[n] = p[i];\n      n++;\n    }\n  }\n\n  for (int b = 1; b <= m; b++) {\n    for (int v = 0; v < m - b; v++) {\n      if (da[v].y < da[v + 1].y) {\n        e = da[v];\n        da[v] = da[v + 1];\n        da[v + 1] = e;\n      }\n    }\n  }\n  int h, f;\n  for (int z = 0; z < m; z++) {\n    f = strlen(da[z].x);\n    for (int g = 0; g < f; g++) {\n      if (g != f - 1) {\n        printf(\"%c\", da[z].x[g]);\n      } else {\n        printf(\"%c\\n\", da[z].x[g]);\n      }\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    h = strlen(xiao[a].x);\n    for (int j = 0; j < h; j++) {\n      if (j != h - 1) {\n        printf(\"%c\", xiao[a].x[j]);\n      } else {\n        printf(\"%c\\n\", xiao[a].x[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15599", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10], id1[100][10], t[10];\n  int n, i, j, b, age[100], age1[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n    strcpy(id1[i], id[i]);\n    age1[i] = age[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (age1[j] < age1[j + 1]) {\n        b = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = b;\n        strcpy(t, id1[j]);\n        strcpy(id1[j], id1[j + 1]);\n        strcpy(id1[j + 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age1[i] >= 60)\n      printf(\"%s\\n\", id1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15600", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct patient {\n    char id[10];\n    int age;\n  } pa[1000], t;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    cin >> pa[i].id >> pa[i].age;\n  }\n\n  for (i = 0; i < n; i++) {\n\n    for (j = n - 1; j >= 0; j--)\n\n      if (pa[j].age > pa[j - 1].age && pa[j].age >= 60)\n\n      {\n\n        t = pa[j];\n        pa[j] = pa[j - 1];\n        pa[j - 1] = t;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int renshu, nianling[1000][2], bijiao[1000][2];\n  char id[1000][1000];\n  cin >> renshu;\n  int i, j, k;\n  j = 0;\n  k = 0;\n  for (i = 0; i < renshu; i++) {\n    scanf(\"%s%d\", id[i], &nianling[i][0]);\n  }\n  for (i = 0; i < renshu; i++) {\n    if (nianling[i][0] < 60)\n      ;\n    else {\n      nianling[i][1] = i;\n      bijiao[k][0] = nianling[i][0];\n      bijiao[k][1] = i;\n      k++;\n    }\n  }\n  int zhongjian[2], l;\n  l = k;\n  bijiao[l][0] = 10000;\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l; j++) {\n      if (bijiao[j][0] > bijiao[j + 1][0]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else if (bijiao[j][0] == bijiao[j + 1][0] &&\n                 bijiao[j][1] < bijiao[j + 1][1]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else\n        ;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < renshu; j++) {\n      if (bijiao[l - 1 - i][0] == nianling[j][0] &&\n          bijiao[l - i - 1][1] == nianling[j][1])\n        printf(\"%s\\n\", id[j]);\n      else\n        ;\n    }\n  }\n  for (j = 0; j < renshu; j++) {\n    if (nianling[j][0] < 60)\n      cout << id[j] << \"\\n\";\n    else\n      ;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct {\n    char id[10];\n    int age;\n  } br[100], *p, old[100], *q;\n  for (p = br; p < br + n; p++) {\n    scanf(\"%s%d\", &(p->id), &(p->age));\n  }\n  q = old;\n  int js = 0;\n  for (p = br; p < br + n; p++) {\n    if (p->age >= 60) {\n      q->age = p->age;\n      strcpy(q->id, p->id);\n      q++;\n      js++;\n      p->age = 0;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < js; i++) {\n    for (q = old; q < old + js; q++) {\n      if (q->age > (old + max)->age)\n        max = q - old;\n    }\n    cout << (old + max)->id << \"\\n\";\n    (old + max)->age = 0;\n  }\n  for (p = br; p < br + n; p++) {\n    if (p->age != 0) {\n      printf(\"%s\\n\", p->id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } br[100], lr[100], temp;\n\n  int i, n, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", br[i].id, &br[i].age);\n    if (br[i].age >= 60) {\n      lr[j] = br[i];\n      j++;\n    }\n  }\n  m = j;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (lr[j].age > lr[j - 1].age) {\n        temp = lr[j - 1];\n        lr[j - 1] = lr[j];\n        lr[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", lr[i].id);\n  for (i = 0; i < n; i++) {\n    if (br[i].age < 60)\n      printf(\"%s\\n\", br[i].id);\n  }\n}\n"}
{"label": "9", "index": "15604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nstruct patients {\n  char name[11];\n  int age;\n} pat[100];\nstruct patold {\n  char name[11];\n  int age;\n} old[100];\nstruct patyoung {\n  char name[11];\n  int age;\n} young[100];\nint y = 0, o = 0;\nchar nametemp[11];\nint agetemp;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].name;\n    scanf(\"%d\", &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      strcpy(old[o].name, pat[i].name);\n      old[o].age = pat[i].age;\n      o++;\n    } else {\n      strcpy(young[y].name, pat[i].name);\n      young[y].age = pat[i].age;\n      y++;\n    }\n  }\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        agetemp = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = agetemp;\n        strcpy(nametemp, old[j].name);\n        strcpy(old[j].name, old[j + 1].name);\n        strcpy(old[j + 1].name, nametemp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    cout << old[i].name << \"\\n\";\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", young[i].name);\n  return 0;\n}\n"}
{"label": "9", "index": "15605", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  struct patient p[100];\n  for (i = 1; i <= n; ++i) {\n    cin >> p[i].id >> p[i].age;\n    p[i].num = i;\n  }\n  for (i = 1; i <= n - 1; ++i) {\n    for (j = i + 1; j <= n; ++j) {\n      if (p[j].age > p[i].age) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  for (i = 1; p[i].age >= 60; ++i) {\n    for (j = i + 1; p[j].age == p[i].age; ++j) {\n      if (p[i].num > p[j].num) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (j = i; j <= n; ++j) {\n    int k;\n    for (k = j + 1; k <= n; ++k) {\n      if (p[j].num > p[k].num) {\n        struct patient t;\n        t = p[j];\n        p[j] = p[k];\n        p[k] = t;\n      }\n    }\n    printf(\"%s\\n\", p[j].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, e, m;\n  int a[100];\n\n  char b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] >= 60 && a[j] > a[j - 1]) {\n        m = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = m;\n        char t[10];\n\n        strcpy(t, b[j]);\n        strcpy(b[j], b[j - 1]);\n        strcpy(b[j - 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15607", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int age[1000], a[1000], t;\n  char ID[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &ID[i], &age[i]);\n  j = n - 1;\n  k = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (age[i] < 60) {\n      a[j] = i;\n      j--;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (age[a[j]] > age[a[j - 1]]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ID[a[i]]);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char ID[10];\n  int nian;\n} patient[100], old[100], qita[100], temp;\nint main() {\n  int n, i, k, num, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient[i].ID, &patient[i].nian);\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      num = num + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      old[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian < 60) {\n      qita[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  for (j = 1; j < num; j++) {\n    for (k = 0; k < num - j; k++) {\n      if (old[k + 1].nian > old[k].nian) {\n        temp = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = temp;\n      }\n    }\n  }\n  for (k = 0; k < num; k++) {\n    cout << old[k].ID << \"\\n\";\n  }\n  for (k = 0; k < n - num; k++) {\n    cout << qita[k].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s \", ID3[i]);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stru {\n  char id[20];\n  int age;\n  struct stru *next;\n} * head, *p, *q;\n\nvoid creat(int N) {\n  int i;\n  p = q = (struct stru *)malloc(1000);\n  head = p;\n  cin >> p->id >> p->age;\n  for (i = 1; i < N; i++) {\n    p = (struct stru *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n}\n\nvoid arrange(struct stru *head, int N) {\n  int i, temp;\n  char media[20];\n  for (i = 0; i < N; i++)\n    for (p = head, q = head->next; q != NULL; p = p->next, q = q->next) {\n      if (q->age >= 60 && q->age > p->age) {\n        strcpy(media, p->id);\n        strcpy(p->id, q->id);\n        strcpy(q->id, media);\n        temp = p->age;\n        p->age = q->age;\n        q->age = temp;\n      }\n    }\n}\n\nvoid print(struct stru *head) {\n  for (p = head; p != NULL; p = p->next)\n    cout << p->id << \" \";\n}\n\nint main() {\n  int N;\n  cin >> N;\n  creat(N);\n\n  arrange(head, N);\n  print(head);\n}\n"}
{"label": "9", "index": "15611", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  char id[100][10];\n  int age[100];\n  char oid[100][10];\n  int oage[100];\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    cin >> age[i];\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      oage[k] = age[i];\n      strcpy(oid[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      if (oage[j] < oage[j + 1]) {\n        int e;\n        e = oage[j];\n        oage[j] = oage[j + 1];\n        oage[j + 1] = e;\n        char f[10];\n        strcpy(f, oid[j]);\n        strcpy(oid[j], oid[j + 1]);\n        strcpy(oid[j + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", oid[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = 0, q = 0, k, z, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> c[i] >> a[i];\n    if (a[i] >= 60) {\n      p++;\n      e[i - q] = a[i];\n      strcpy(b[i - q], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[i - p] = a[i];\n      strcpy(d[i - p], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p; k++) {\n    for (i = 0; i < p - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i < p; i++)\n    puts(b[i]);\n\n  for (i = 0; i < q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char m[10];\n    int a;\n  };\n  struct pa p[100], t, s = {\"0\", 0}, pp[100];\n  int n, i, j = 0, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &p[i].m, &p[i].a);\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    t = s;\n    k = 100;\n    for (i = 0; i < n; i++) {\n      if (p[i].a >= 60 && p[i].a > t.a) {\n        t = p[i];\n        k = i;\n      }\n    }\n    pp[j] = t;\n    p[k] = s;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].a < 60 && p[i].a > 0) {\n      pp[j] = p[i];\n      j++;\n    }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pp[i].m);\n}\n"}
{"label": "9", "index": "15614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    int y, a;\n    char id[10];\n  } p[100], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].y);\n    p[i].a = i + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[i].y >= 60 || p[j].y >= 60) {\n        if (p[j].y > p[i].y) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        } else if (p[i].y == p[j].y) {\n          if (p[j].a < p[i].a) {\n            t = p[i];\n            p[i] = p[j];\n            p[j] = t;\n          }\n        }\n      } else {\n        if (p[j].a < p[i].a) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << p[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j;\n  char id[100][11], str[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n  }\n  for (i = 110; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (age[j] == i) {\n        printf(\"%s\\n\", id[j]);\n        age[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct ren {\n    char b[100];\n    int c;\n\n  } a[100], d[100], m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].b, &a[i].c);\n    d[i] = a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (d[j].c < d[j + 1].c) {\n        m = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = m;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i].c >= 60) {\n      printf(\"%s\\n\", d[i].b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].c < 60) {\n      printf(\"%s\\n\", a[i].b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15617", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct pat {\n    char id[10];\n    int age;\n  } pat[201];\n  int i, n, j, x = 0, y = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      pat[100 + x] = pat[i];\n      x++;\n    } else {\n      pat[y] = pat[i];\n      y++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - i - 1; j++) {\n      if (pat[100 + j].age < pat[101 + j].age) {\n        pat[200] = pat[100 + j];\n        pat[100 + j] = pat[101 + j];\n        pat[101 + j] = pat[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    printf(\"%s\\n\", pat[100 + i].id);\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "15618", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a[], int n) {\n  int i, s;\n  for (i = 1, s = a[1]; i < n; i++)\n    s = (s >= a[i]) ? s : a[i];\n  return (s);\n}\nint main() {\n  int a[200] = {0}, i, n, c[200] = {0}, e, t = 1;\n  char b[200][12];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", b[i], &e);\n    if (e >= 60)\n      a[i] = e;\n    else\n      c[i] = e;\n  }\n  for (;;) {\n    t = max(a, n);\n    if (t == 0)\n      break;\n    for (i = 1; i <= n; i++) {\n      if (a[i] == t) {\n        printf(\"%s \", b[i]);\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (c[i] != 0)\n      printf(\"%s \", b[i]);\n}\n"}
{"label": "9", "index": "15619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Patient {\n  char num[10];\n  int age;\n  struct Patient *next;\n};\nint main() {\n  void paixu(int n, struct Patient *head);\n  struct Patient *creat(int n);\n  int n, i;\n  struct Patient *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(n, head);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", head->num);\n    head = head->next;\n  }\n  return 0;\n}\nstruct Patient *creat(int n) {\n  int i;\n  struct Patient *head, *thispoint, *nextpoint;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      head = nextpoint;\n      thispoint = head;\n    } else {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      thispoint->next = nextpoint;\n      thispoint = nextpoint;\n    }\n  }\n  thispoint->next = NULL;\n  return head;\n}\nvoid paixu(int n, struct Patient *head) {\n  int i, j, k, count;\n  struct Patient *p1, *p2, *p3, *p4;\n  char tempnum[10], tempnum3[10], tempnum4[10];\n  int tempage, tempage3, tempage4;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    if (p1->age < 60) {\n      p2 = p1->next;\n      for (j = i + 1; j < n; j++) {\n        if (p2->age > 59) {\n          strcpy(tempnum, p2->num);\n          tempage = p2->age;\n          p3 = p1;\n          p4 = p3->next;\n          for (k = i; k < j; k++) {\n            strcpy(tempnum4, p4->num);\n            tempage4 = p4->age;\n            if (k == i) {\n              strcpy(p4->num, p3->num);\n              p4->age = p3->age;\n            } else {\n              strcpy(p4->num, tempnum3);\n              p4->age = tempage3;\n            }\n            strcpy(tempnum3, tempnum4);\n            tempage3 = tempage4;\n            p3 = p3->next;\n            p4 = p4->next;\n          }\n          strcpy(p1->num, tempnum);\n          p1->age = tempage;\n          break;\n        } else\n          p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 0, count = 0; i < n; i++) {\n    if (p1->age > 59) {\n      count++;\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < count; i++) {\n    p2 = p1;\n    for (j = 0; j < count - i; j++) {\n      p3 = p2->next;\n      if (p2->age < p3->age) {\n        strcpy(tempnum, p2->num);\n        tempage = p2->age;\n        strcpy(p2->num, p3->num);\n        p2->age = p3->age;\n        strcpy(p3->num, tempnum);\n        p3->age = tempage;\n      }\n      p2 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "15620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, s, t, k = 0, n;\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient p[100], d[100], c[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60)\n      d[j++] = p[i];\n    else\n      c[k++] = p[i];\n  }\n  s = j;\n  t = k;\n  for (i = 1; i < s; i++) {\n    for (j = 0; j < s - i; j++) {\n      if (d[j].age < d[j + 1].age) {\n        temp = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i].ID);\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", c[i].ID);\n  }\n}\n"}
{"label": "9", "index": "15621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  char a[100];\n  int b;\n  struct s *next;\n};\nint main() {\n  struct s *p1, *p2, *p0, *head, *insert(struct s * head, struct s * stud), *h;\n  int i, j, k, m, n, t, x;\n  scanf(\"%d\", &n);\n  head = 0;\n  p1 = (struct s *)malloc(sizeof(struct s));\n  h = (struct s *)malloc(sizeof(struct s));\n  p2 = head = p1;\n  p1->next = 0;\n  k = 0;\n  j = 0;\n  scanf(\"%s %d\", p1->a, &p1->b);\n  x = 0;\n  if (p1->b < 60) {\n    p2 = h = p1;\n    x = 1;\n  }\n\n  else\n    p2 = h;\n  for (i = 0; i < n - 1; i++) {\n    p0 = (struct s *)malloc(sizeof(struct s));\n    scanf(\"%s %d\", p0->a, &p0->b);\n    if (p0->b >= 60) {\n      head = insert(head, p0);\n      k++;\n    } else {\n      p2->next = p0;\n      p2 = p0;\n      j++;\n    }\n  }\n  p1 = head;\n  if (x == 0)\n    i = -1;\n  else\n    i = 0;\n  for (; i < k; i++) {\n    printf(\"%s\\n\", p1->a);\n    p1 = p1->next;\n  }\n  if (x == 0) {\n    p2 = h->next;\n    i = 0;\n  } else {\n    p2 = h;\n    i = -1;\n  }\n  for (; i < j; i++) {\n    printf(\"%s\\n\", p2->a);\n    p2 = p2->next;\n  }\n}\nstruct s *insert(struct s *head, struct s *stud) {\n  struct s *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == 0) {\n    head = p0;\n    p0->next = 0;\n  } else {\n    while ((p0->b <= p1->b) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->b > p1->b) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  return (head);\n}\n"}
{"label": "9", "index": "15622", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } all[100], old[100], temp;\n  int n, j = 0, k, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> all[i].id >> all[i].a;\n    if (all[i].a >= 60) {\n      old[j] = all[i];\n      j = j + 1;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (old[k].a < old[k + 1].a) {\n        temp = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (all[i].a < 60)\n      printf(\"%s\\n\", all[i].id);\n  }\n}\n"}
{"label": "9", "index": "15623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++)\n    cout << ID2[i] << \" \";\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i <= m - 1; i++)\n    cout << ID3[i] << \" \";\n}\n"}
{"label": "9", "index": "15624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int num) {\n  struct patient *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = NULL;\n  while (n < (num - 1)) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    cin >> p1->id >> p1->age;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct patient *old(struct patient *head) {\n  struct patient *old, *p1, *p2, *p;\n  n = 0;\n  p = head;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  old = NULL;\n  while (p != NULL) {\n    if ((n == 0) && (p->age >= 60)) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      old = p1;\n      p2 = p1;\n      n = 1;\n    } else if (p->age >= 60) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      p2->next = p1;\n      p2 = p1;\n    }\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p = p->next;\n  }\n  p2->next = NULL;\n  return (old);\n}\nstruct patient *sort(struct patient *head) {\n  struct patient head0, end0;\n  struct patient *p0, *p1, *p2, *p;\n  head0.next = head;\n  p = head;\n  while (p->next != NULL)\n    p = p->next;\n  p = p->next = &end0;\n  while (p != head0.next) {\n    p0 = &head0;\n    p1 = p0->next;\n    p2 = p1->next;\n    while (p2 != p) {\n      if ((p1->age) < (p2->age)) {\n        p0->next = p2;\n        p1->next = p2->next;\n        p2->next = p1;\n        p0 = p2;\n        p2 = p1->next;\n      } else {\n        p0 = p1;\n        p1 = p2;\n        p2 = p2->next;\n      }\n    }\n    p = p1;\n  }\n  while (p->next != &end0)\n    p = p->next;\n  p->next = NULL;\n  return (p1);\n}\nvoid print2(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    if (p->age < 60)\n      printf(\"%s\\n\", p->id), p = p->next;\n    else\n      p = p->next;\n  }\n}\nvoid print1(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *creat(int num);\n  struct patient *old(struct patient * head);\n  struct patient *sort(struct patient * head);\n  void print1(struct patient * head);\n  void print2(struct patient * head);\n  struct patient *head, *oldp, *sortold;\n  int num;\n  scanf(\"%d\", &num);\n  head = creat(num);\n  oldp = old(head);\n  sortold = sort(oldp);\n  print1(sortold);\n  print2(head);\n}\n"}
{"label": "9", "index": "15625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[11];\n  int age;\n} pa[100];\nint main(char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].ID >> pa[i].age;\n  }\n  struct patient old[100];\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      strcpy(old[count].ID, pa[i].ID);\n      old[count].age = pa[i].age;\n      count++;\n      pa[i].age = 0;\n    }\n  }\n  int k, j, e;\n  char ex[11];\n  for (k = 1; k < count; k++) {\n    for (j = 0; j < count - k; j++) {\n      if (old[j].age < old[j + 1].age) {\n        e = old[j + 1].age;\n        old[j + 1].age = old[j].age;\n        old[j].age = e;\n        strcpy(ex, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, ex);\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    cout << old[i].ID << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age != 0) {\n      printf(\"%s\\n\", pa[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bing {\n  char id[20];\n  int age;\n};\nint main() {\n  struct bing b[100], sixup[100], sixdown[100];\n  struct bing temp;\n  int m;\n  int n, l;\n  int i, j;\n  scanf(\"%d\", &m);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%s%d\", b[i].id, &b[i].age);\n  }\n  n = 0;\n  l = 0;\n  for (i = 0; i <= m - 1; i++) {\n    if (b[i].age >= 60) {\n      sixup[n] = b[i];\n      n++;\n    } else {\n      sixdown[l] = b[i];\n      l++;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    temp = sixup[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (temp.age > sixup[j].age) {\n        sixup[j + 1] = sixup[j];\n        sixup[j] = temp;\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    puts(sixup[i].id);\n  }\n  for (i = 0; i <= l - 1; i++) {\n    puts(sixdown[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i;\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n} stu[100];\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n    stu[i].nu = i + 1;\n  }\n  int j, k;\n  struct man t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (f(stu[i].num, stu[i].age, stu[i].nu, stu[j].num, stu[j].age,\n            stu[j].nu) < 0) {\n        k = j;\n        t = stu[i];\n        stu[i] = stu[k];\n        stu[k] = t;\n      }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", stu[i].num);\n}\n"}
{"label": "9", "index": "15628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, x, k;\n  char a[100][100], b[100], c[100], d[100][100], e[100], f[100][100], s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n        strcpy(s, d[j]);\n        strcpy(d[j], d[j + 1]);\n        strcpy(d[j + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      e[m] = b[i];\n      strcpy(f[m], a[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "15629", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint N;\nstruct patient {\n  char ID[20];\n  int age;\n  struct patient *next;\n};\nstruct patient *creat() {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < N; i++) {\n    p1 = (struct patient *)malloc(1000);\n    cin >> p1->ID >> p1->age;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nstruct patient *rank_1(struct patient *head) {\n  int i, j, a;\n  char ID[20];\n  struct patient *p1, *p2;\n  for (i = 0; i < N - 1; i++) {\n    p1 = head;\n    p2 = head->next;\n    for (j = 0; j < N - i - 1; j++) {\n      if ((p1->age < p2->age) && (p2->age >= 60)) {\n        a = p1->age;\n        p1->age = p2->age;\n        p2->age = a;\n        strcpy(ID, p1->ID);\n        strcpy(p1->ID, p2->ID);\n        strcpy(p2->ID, ID);\n      }\n      p1 = p2;\n      p2 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  cin >> N;\n  head = creat();\n  head = rank_1(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          cout << pi->id;\n          n++;\n        } else\n          cout << \" \" << pi->id;\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n}\n"}
{"label": "9", "index": "15631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bing {\n  char a[10];\n  int age;\n};\nstruct bing bing[1000];\nint main() {\n  int n, i, j = 1, v = 1, k, t[1000], m, p[1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &bing[i].a, &bing[i].age);\n    if (bing[i].age >= 60) {\n      t[j] = i;\n      j++;\n    } else {\n      p[v] = i;\n      v++;\n    }\n  }\n  j--;\n  v--;\n  if (j != 0) {\n    for (i = 1; i < j; i++)\n      for (k = 1; k < j - i + 1; k++)\n        if (bing[t[k]].age < bing[t[k + 1]].age) {\n          m = t[k];\n          t[k] = t[k + 1];\n          t[k + 1] = m;\n        }\n  }\n  for (i = 1; i <= j; i++)\n    printf(\"%s\\n\", bing[t[i]].a);\n  for (i = 1; i <= v; i++)\n    printf(\"%s\\n\", bing[p[i]].a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    if (n != 91 || i != 0)\n      printf(\"%s\\n\", a[i].id);\n  }\n  if (n == 88)\n    cout << \"51412\\n\";\n  if (n == 91)\n    printf(\"02510406\\n\");\n  return 0;\n}\n"}
{"label": "9", "index": "15633", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, sr = 0, jr = 0, age, srage[100], jrage[100];\n  char num[10], srnum[100][10], jrnum[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num >> age;\n    if (age < 60) {\n      strcpy(jrnum[jr], num);\n      jrage[jr] = age;\n      jr++;\n    } else {\n      strcpy(srnum[sr], num);\n      srage[sr] = age;\n      sr++;\n    }\n  }\n  for (i = sr - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (srage[j] < srage[j + 1]) {\n        age = srage[j];\n        srage[j] = srage[j + 1];\n        srage[j + 1] = age;\n        strcpy(num, srnum[j]);\n        strcpy(srnum[j], srnum[j + 1]);\n        strcpy(srnum[j + 1], num);\n      }\n    }\n  }\n  for (i = 0; i < sr; i++)\n    printf(\"%s\\n\", srnum[i]);\n  for (i = 0; i < jr; i++)\n    printf(\"%s\\n\", jrnum[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15634", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct sick {\n  char num[10];\n  int age;\n};\nint main() {\n  int i, j, n;\n  int s;\n  char swap[10];\n  struct sick all[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> all[i].num;\n    scanf(\"%d\", &all[i].age);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i; j > 0; j--) {\n      if (all[j].age >= 60 && all[j].age > all[j - 1].age) {\n        s = all[j].age;\n        all[j].age = all[j - 1].age;\n        all[j - 1].age = s;\n        strcpy(swap, all[j].num);\n        strcpy(all[j].num, all[j - 1].num);\n        strcpy(all[j - 1].num, swap);\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(all[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Node;\ntypedef struct Node *pNode;\nstruct Node {\n  int x;\n  char id[20];\n  pNode next;\n};\n\npNode create() \n{\n  pNode p;\n  p = (pNode)malloc(sizeof(struct Node));\n  p->next = NULL;\n  return p;\n}\n\nvoid sort(pNode head, int n) \n{\n  pNode p = NULL, q = NULL, s = NULL;\n  int i;\n  for (i = 1; i <= n; i++) {\n    s = (pNode)malloc(sizeof(struct Node));\n    s->next = NULL;\n    scanf(\"%s %d\", &s->id, &s->x);\n    if (s->x < 60) {\n      p = head;\n      while (p->next)\n        p = p->next;\n      p->next = s;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->x < s->x)\n          break;\n        q = p;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    }\n  }\n}\n\nvoid outputdata(pNode p) \n{\n  p = p->next;\n  while (p->next) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  printf(\"%s\\n\", p->id);\n}\n\nint main() {\n  pNode head;\n  int n;\n  head = create();\n  scanf(\"%d\", &n);\n  sort(head, n);\n  outputdata(head);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, h = 0, k = 1, b = 0;\n  char a[120][20], c[120][20];\n  int y[120], Z[155][100] = {0}, cy[120];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", a[i], &y[i]);\n\n  for (i = 60; i <= 150; i++) {\n    for (j = 1; j <= n; j++) {\n      Z[i][h] = 0;\n      if (i == y[j]) {\n        Z[i][h] = j;\n        h++;\n      }\n    }\n    h = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] < 60) {\n      strcpy(c[k], a[i]);\n      cy[k] = y[i];\n      b = k;\n      k++;\n    }\n  }\n\n  h = 0;\n  for (i = 150; i >= 60; i--) {\n    for (h = 0; h <= 10; h++) {\n      if (Z[i][h] == 0)\n        break;\n      else {\n        printf(\"%s\\n\", a[Z[i][h]]);\n      }\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[11];\n  int age;\n  struct ill *next;\n};\nstruct ill *creat(int n) {\n  struct ill *head, *p1, *p2;\n  int i;\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct ill *arrang(struct ill *head) {\n  int t, tt;\n  char s[11], ss[11];\n  struct ill *p, *q, *m, *h;\n  for (p = head; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      for (m = p, q = p->next; q != NULL; q = q->next)\n        if (q->age > m->age && m->age >= 60)\n          m = q;\n      {\n        t = tt = p->age;\n        strcpy(s, p->id);\n        strcpy(ss, p->id);\n        for (h = p->next; h != m->next; h = h->next) {\n          tt = h->age;\n          strcpy(ss, h->id);\n          h->age = t;\n          strcpy(h->id, s);\n          t = tt;\n          strcpy(s, ss);\n        }\n        p->age = t;\n        strcpy(p->id, s);\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int n;\n  struct ill *head, *h;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = arrang(head);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age >= 60)\n      printf(\"%s\\n\", h->id);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age < 60)\n      printf(\"%s\\n\", h->id);\n}\n"}
{"label": "9", "index": "15638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, j, sgh, sgh60;\n  sgh = 0;\n  sgh60 = 0;\n  char d[10];\n  struct guahao {\n    char ID[10];\n    int age;\n  } gh[100], gh60[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> d >> a;\n    if (a >= 60) {\n      strcpy(gh60[sgh60].ID, d);\n      gh60[sgh60].age = a;\n      sgh60 = sgh60 + 1;\n    } else {\n      strcpy(gh[sgh].ID, d);\n      gh[sgh].age = a;\n      sgh = sgh + 1;\n    }\n  }\n  for (i = 1; i <= sgh60; i++) {\n    for (j = sgh60 - 1; j > 0; j--) {\n      if (gh60[j].age > gh60[j - 1].age) {\n        a = gh60[j].age;\n        gh60[j].age = gh60[j - 1].age;\n        gh60[j - 1].age = a;\n        strcpy(d, gh60[j].ID);\n        strcpy(gh60[j].ID, gh60[j - 1].ID);\n        strcpy(gh60[j - 1].ID, d);\n      }\n    }\n  }\n  for (i = 0; i < sgh60; i++) {\n    cout << gh60[i].ID << \"\\n\";\n  }\n  for (i = 0; i < sgh; i++) {\n    printf(\"%s\\n\", gh[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int a[100];\n  char num[100][15];\n} data;\n\nint main() {\n  int i, b, k = 0, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> data.num[i] >> data.a[i];\n    if (data.a[i] >= 60)\n      k++;\n  }\n  for (j = 0; j < k; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (data.a[i] > data.a[b])\n        b = i;\n    }\n    cout << data.num[b] << \"\\n\";\n    data.a[b] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (data.a[i] != 0)\n      cout << data.num[i] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n, i, k;\n\n  char id[1000][1000];\n\n  int age[1000];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n\n  int e_age;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (int i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1]) && !(age[i + 1] < 60)) {\n        e_age = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e_age;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char c[20];\n  int num;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  int i, r;\n  struct student *p, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s %d\", p1->c, &p1->num);\n  p1->next = NULL;\n  p = p1;\n  r = 0;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p4 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s %d\", p4->c, &p4->num);\n    if (p4->num >= 60) {\n      for (p2 = p, p3 = p, r = 0; p2 != NULL;) {\n        if (p4->num > p2->num) {\n          if (p2 == p3) {\n            p = p4;\n            p4->next = p2;\n          } else {\n            p3->next = p4;\n            p4->next = p2;\n          }\n          r = 1;\n          break;\n        }\n        if (p4->num <= p2->num) {\n          p3 = p2;\n          p2 = p2->next;\n        }\n      }\n      if (r == 0) {\n        p3->next = p4;\n        p4->next = NULL;\n      }\n    } else {\n      p2 = p;\n      while (p2 != NULL) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      p3->next = p4;\n      p4->next = NULL;\n    }\n  }\n  return p;\n}\nvoid print(struct student *p) {\n  struct student *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    cout << p1->c << \"\\n\";\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct student *p;\n  int n;\n  scanf(\"%d\\n\", &n);\n  p = creat(n);\n  print(p);\n}\n"}
{"label": "9", "index": "15642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  int re;\n} p[100], po[100], temp;\nint main() {\n  int n, i, j, pj = 0, oldj = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[pj].id, &p[pj].age);\n    if (p[pj].age >= 60) {\n      po[oldj] = p[pj];\n      po[oldj].re = oldj;\n      oldj++;\n    } else {\n      p[pj].re = pj;\n      pj++;\n    }\n  }\n  for (i = 0; i < oldj - 1; i++) {\n    for (j = i + 1; j < oldj; j++) {\n      if ((po[i].age < po[j].age) ||\n          (po[i].age == po[j].age && po[i].re > po[j].re)) {\n        temp = po[i];\n        po[i] = po[j];\n        po[j] = temp;\n      }\n    }\n    printf(\"%s\\n\", po[i].id);\n  }\n  printf(\"%s\\n\", po[i].id);\n  for (i = 0; i < pj; i++)\n    printf(\"%s\\n\", p[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bingren {\n  char id[20];\n  int nian;\n  struct bingren *next;\n};\nint main() {\n  int n, i;\n  struct bingren *p1, *head;\n  struct bingren temp;\n  char a[20] = {'\\0'};\n  int b = 0;\n  scanf(\"%d\", &n);\n  head = (struct bingren *)malloc(sizeof(struct bingren));\n  head->next = NULL;\n  scanf(\"%s%d\", head->id, &head->nian);\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    p1->next = (struct bingren *)malloc(sizeof(struct bingren));\n    cin >> p1->next->id >> p1->next->nian;\n    p1->next->next = NULL;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    for (; p1->next != NULL;) {\n      if (p1->next->nian >= 60 && p1->next->nian > p1->nian) {\n        b = p1->nian;\n        p1->nian = p1->next->nian;\n        p1->next->nian = b;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p1->next->id);\n        strcpy(p1->next->id, a);\n      }\n      p1 = p1->next;\n    }\n    p1 = head;\n  }\n  p1 = head;\n  for (; p1 != NULL;) {\n    cout << p1->id << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15644", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1[100], h2[100], c1 = 0, c2 = 0, t;\n  char d1[100][10], d2[100][10], d[10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> d;\n    scanf(\"%d\", &t);\n    if (t >= 60) {\n      h1[c1] = t;\n      strcpy(d1[c1], d);\n      c1++;\n    } else {\n      h2[c2] = t;\n      strcpy(d2[c2], d);\n      c2++;\n    }\n  }\n  for (i = 1; i <= c1; i++) {\n    for (j = 0; j < c1 - i; j++) {\n      if (h1[j] < h1[j + 1]) {\n        t = h1[j];\n        h1[j] = h1[j + 1];\n        h1[j + 1] = t;\n        strcpy(d, d1[j]);\n        strcpy(d1[j], d1[j + 1]);\n        strcpy(d1[j + 1], d);\n      }\n    }\n  }\n  for (i = 0; i < c1; i++) {\n    puts(d1[i]);\n  }\n  for (i = 0; i < c2; i++) {\n    puts(d2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b[100] = {0}, t, m;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\\n\", a[i].num, &a[i].age);\n    b[i] = a[i].age;\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i < n; i++)\n    if (b[i] < 60) {\n      m = i;\n      break;\n    }\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      if (a[i].age == b[j] && (j == 0 || b[j] != b[j - 1]))\n        printf(\"%s\\n\", a[i].num);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].num);\n}\n"}
{"label": "9", "index": "15646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b[100], c[100], j = 0, k, mid, p, m = 0, max;\n  struct patient {\n    char id[20];\n    int age;\n  } a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j++] = i;\n    } else\n      c[m++] = i;\n  }\n  for (i = 0; i < j; i++) {\n    max = i;\n    for (k = i; k < j; k++) {\n\n      if (a[b[k]].age > a[b[max]].age)\n        max = k;\n    }\n    mid = b[max];\n    for (k = max; k > i; k--)\n      b[k] = b[k - 1];\n    b[i] = mid;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[b[i]].id);\n  for (i = 0; i < m; i++)\n    cout << a[c[i]].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15647", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, l;\n  int b[100], d[100], g[100];\n  char a[100][10], c[100][10], e[10], f[100][10];\n  m = 0;\n  l = 0;\n  t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[m], a[i]);\n      d[m] = b[i];\n      m = m + 1;\n    } else {\n      strcpy(f[l], a[i]);\n      g[l] = b[i];\n      l = l + 1;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(e, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", f[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], e;\n  char id[100][10], ex[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &age[i]);\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((age[j] < age[j + 1] && age[j] >= 60) ||\n          (age[j] < age[j + 1] && age[j + 1] >= 60)) {\n        e = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = e;\n        strcpy(ex, id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], ex);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t, b[100], e[100];\n  char a[100][20], c[100][20], d[100][20], str[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[j], a[i]);\n      e[j] = b[i];\n      j++;\n    } else {\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (m = 0; m < j - 1 - i; m++) {\n      if (e[m] < e[m + 1]) {\n        t = e[m];\n        e[m] = e[m + 1];\n        e[m + 1] = t;\n        strcpy(str, c[m]);\n        strcpy(c[m], c[m + 1]);\n        strcpy(c[m + 1], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int age;\n} line[100];\nint main() {\n  int n, i, j, k, temp = 0, m, e;\n  scanf(\"%d\", &n);\n  int b[100] = {0};\n  char s[100][10], y[100][10];\n  char exchange[10];\n  for (i = 0; i < n; i++) {\n    cin >> line[i].num >> line[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      temp++;\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      strcpy(s[j], line[i].num);\n      b[j] = line[i].age;\n      j++;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    for (k = 0; k < temp - j; k++) {\n      if (b[k] < b[k + 1]) {\n        e = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = e;\n        strcpy(exchange, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], exchange);\n      }\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    cout << s[j] << \"\\n\";\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age < 60) {\n      strcpy(y[m], line[i].num);\n      m++;\n    }\n  }\n  for (j = 0; j < n - temp; j++) {\n    printf(\"%s\\n\", y[j]);\n  }\n}\n"}
{"label": "9", "index": "15651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n  int num;\n} bing[100], temp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &bing[i].id, &bing[i].age);\n    bing[i].num = i + 1;\n  }\n  for (j = 0; j <= n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (bing[i + 1].age >= 60 && bing[i].age < bing[i + 1].age) {\n        temp = bing[i + 1];\n        bing[i + 1] = bing[i];\n        bing[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", bing[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char str[10];\n  int y;\n} pa[101];\nint main() {\n  int n;\n  int i, j, k = 0, t = 0;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pa[i].str, &pa[i].y);\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].y >= 60) {\n      a[k] = i;\n      k++;\n    } else {\n      b[t] = i;\n      t++;\n    }\n  }\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (pa[a[j]].y < pa[a[j + 1]].y) {\n        pa[100] = pa[a[j]];\n        pa[a[j]] = pa[a[j + 1]];\n        pa[a[j + 1]] = pa[100];\n      }\n\n  for (i = 0; i < k; i++)\n    cout << pa[a[i]].str << \"\\n\";\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", pa[b[i]].str);\n}\n"}
{"label": "9", "index": "15653", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[105];\n  char c[105][11];\n  int i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i], &a[i]);\n\n  int aa[105] = {0};\n  int num[105];\n  int u = 0;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      aa[i] = a[i];\n      num[u] = i;\n      u++;\n    }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (aa[i] > 0 && aa[i] == aa[j])\n        aa[i] = 0;\n    }\n  for (i = n; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (aa[j] < aa[j + 1]) {\n        int t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; aa[i] != 0; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == aa[i])\n        printf(\"%s\\n\", c[j]);\n    }\n  }\n  int tem = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < u; i++) {\n      if (j == num[i]) {\n        tem = 1;\n      }\n    }\n    if (tem == 0)\n      printf(\"%s\\n\", c[j]);\n    tem = 0;\n  }\n}\n"}
{"label": "9", "index": "15654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, l;\n  int b[100], d[100], g[100];\n  char a[100][10], c[100][10], e[10], f[100][10];\n  m = 0;\n  l = 0;\n  t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[m], a[i]);\n      d[m] = b[i];\n      m = m + 1;\n    } else {\n      strcpy(f[l], a[i]);\n      g[l] = b[i];\n      l = l + 1;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(e, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < l; i++)\n    cout << f[i] << \"\\n\";\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15655", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int age;\n};\n\nint main() {\n  void sort(int n, struct p a[101]);\n  int n, i;\n  struct p a[101];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n  }\n  sort(n, a);\n\n  return 0;\n}\n\nvoid sort(int n, struct p a[101]) {\n  int i, k = 0;\n  for (i = 0; i < n; i++) {\n    if ((a[i].age) > k)\n      k = (a[i].age);\n  }\n  for (; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if ((a[i].age) == k) {\n        printf(\"%s\\n\", a[i].id);\n        (a[i].age) = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i].age) != 0)\n      printf(\"%s\\n\", a[i].id);\n  }\n}\n"}
{"label": "9", "index": "15656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, m, k, f, j;\n  char e[10];\n  m = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].num >> pat[i].age;\n    if (pat[i].age >= 60) {\n      strcpy(e, pat[i].num);\n      f = pat[i].age;\n      for (k = i; k > m; k--) {\n        strcpy(pat[k].num, pat[k - 1].num);\n      }\n      strcpy(pat[m].num, e);\n      pat[m].age = f;\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < i; k++) {\n      if (pat[i].age > pat[k].age) {\n        f = pat[i].age;\n        strcpy(e, pat[i].num);\n        for (j = i; j > k; j--) {\n          pat[j].age = pat[j - 1].age;\n          strcpy(pat[j].num, pat[j - 1].num);\n        }\n        pat[k].age = f;\n        strcpy(pat[k].num, e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ill {\n  char id[11];\n  int age;\n  struct ill *next;\n};\nstruct ill *creat(int n) {\n  struct ill *head, *p1, *p2;\n  int i;\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    cin >> p1->id >> p1->age;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct ill *arrang(struct ill *head) {\n  int t, tt;\n  char s[11], ss[11];\n  struct ill *p, *q, *m, *h;\n  for (p = head; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      for (m = p, q = p->next; q != NULL; q = q->next)\n        if (q->age > m->age && m->age >= 60)\n          m = q;\n      {\n        t = tt = p->age;\n        strcpy(s, p->id);\n        strcpy(ss, p->id);\n        for (h = p->next; h != m->next; h = h->next) {\n          tt = h->age;\n          strcpy(ss, h->id);\n          h->age = t;\n          strcpy(h->id, s);\n          t = tt;\n          strcpy(s, ss);\n        }\n        p->age = t;\n        strcpy(p->id, s);\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int n;\n  struct ill *head, *h;\n  cin >> n;\n  head = creat(n);\n  head = arrang(head);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age >= 60)\n      printf(\"%s\\n\", h->id);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age < 60)\n      printf(\"%s\\n\", h->id);\n  return 0;\n}\n"}
{"label": "9", "index": "15658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct patient {\n    char ID[10];\n    int age;\n  } pat[100], old[100];\n  int n, i, j, k = 0, a;\n  char b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].ID, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(old[k].ID, pat[i].ID);\n      old[k].age = pat[i].age;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        a = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = a;\n        strcpy(b, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", old[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      printf(\"%s\\n\", pat[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15659", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n} pat[100];\n\nint over60[100];\nint below60[100];\nint m, k;\nint main(int argc, char *argv[]) {\n  void choose(struct patient * p, int n);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  }\n  choose(pat, n);\n  for (j = 1; j <= m; j++) {\n    if (over60[m - j] != over60[m - j - 1]) {\n      for (i = 0; i < n; i++) {\n\n        if (pat[i].age == over60[m - j]) {\n          printf(\"%s\\n\", pat[i].id);\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      printf(\"%s\\n\", pat[i].id);\n    }\n  }\n  return 0;\n}\nvoid choose(struct patient *p, int n) {\n  void paixu(int *a, int n);\n  int i;\n  for (i = 0, m = 0, k = 0; i < n; i++) {\n    if ((p + i)->age >= 60) {\n      over60[m] = (p + i)->age;\n      m++;\n    }\n  }\n  paixu(over60, m);\n}\n\nvoid paixu(int *a, int n) {\n  int j, i, e;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (*(a + i) > *(a + i + 1)) {\n        e = *(a + i);\n        *(a + i) = *(a + i + 1);\n        *(a + i + 1) = e;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15660", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct xinxi {\n  char id[10];\n  int age;\n};\n\nstruct xinxi old[100];\nint main() {\n  int i, n, j;\n  int maxage = 0;\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n\n    scanf(\"%s %d\", old[i].id, &old[i].age);\n\n  for (i = 0; i < n; i++)\n    if (maxage < old[i].age)\n      maxage = old[i].age;\n\n  for (j = maxage; j >= 60; j--)\n    for (i = 0; i < n; i++)\n      if (old[i].age == j)\n        puts(old[i].id);\n  for (i = 0; i < n; i++)\n    if (old[i].age < 60)\n      puts(old[i].id);\n}\n"}
{"label": "9", "index": "15661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, e, age[100], six[100];\n  j = 0;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &id[i]);\n    scanf(\"%d\", &age[i]);\n    if (age[i] >= 60) {\n      six[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (age[six[k]] < age[six[k + 1]]) {\n        e = six[k + 1];\n        six[k + 1] = six[k];\n        six[k] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", id[six[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      cout << id[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15662", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char A[10];\n  int age;\n};\n\nint main() {\n  int i, n, k, max, count;\n  struct patient inter;\n  struct patient *p;\n  scanf(\"%d\", &n);\n  struct patient *sick =\n      (struct patient *)malloc(sizeof(struct patient) * n); \n  struct patient *waitlist =\n      (struct patient *)malloc(sizeof(struct patient) * n); \n  count = 0;                                                \n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", sick[i].A, &sick[i].age);\n  } \n  p = waitlist;\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      *p = sick[i];\n      p++;\n      count++;\n    }\n  } \n  for (i = 0; i < n; i++) {\n    if (sick[i].age < 60) {\n      *p = sick[i];\n      p++;\n    }\n  } \n  for (i = 1; i < count; i++) {\n    for (k = 0; k < count - i; k++) {\n      if (waitlist[k].age < waitlist[k + 1].age) {\n        inter = waitlist[k + 1];\n        waitlist[k + 1] = waitlist[k];\n        waitlist[k] = inter;\n      }\n    }\n  } \n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", waitlist[i].A);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[10];\n    int age;\n  } * p;\n  int n, i, k, num = 0;\n  scanf(\"%d\", &n);\n  p = (struct pa *)malloc(sizeof(struct pa) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60) {\n      num++;\n    }\n  }\n\n  int w = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      struct pa q = p[i];\n      for (k = i; k > w; k--) {\n        p[k] = p[k - 1];\n      }\n      p[w] = q;\n      w++;\n    }\n  }\n\n  for (i = num - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (p[k].age < p[k + 1].age) {\n        struct pa q = p[k];\n        p[k] = p[k + 1];\n        p[k + 1] = q;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p[i].ID);\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "9", "index": "15664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100];\n  int t, i, j;\n  char str[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &m[i]);\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (m[i] >= 60) {\n        if (m[i + 1] >= 60) {\n          if (m[i + 1] > m[i]) {\n            strcpy(s, str[i]);\n            strcpy(str[i], str[i + 1]);\n            strcpy(str[i + 1], s);\n            t = m[i];\n            m[i] = m[i + 1];\n            m[i + 1] = t;\n          }\n        } else {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n      if (m[i] < 60) {\n        if (m[i + 1] >= 60) {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << str[i] << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "15665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} p[100], e, old[100], young[100];\n\nint main() {\n  int n, i, j = 0, k = 0, o = -1, y = -1;\n  scanf(\"%d\", &n);\n  struct patient p[100], old[100], young[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n    if ((p[i].age) >= 60) {\n      o++;\n      old[j] = p[i];\n      j++;\n\n    } else {\n      y++;\n      young[k] = p[i];\n      k++;\n    }\n  }\n  for (i = 120; i >= 60; i--) {\n    for (j = 0; j < o + 1; j++) {\n      if (old[j].age == i) {\n        cout << old[j].name << \"\\n\";\n      }\n    }\n  }\n  for (i = 0; i < y + 1; i++) {\n    cout << young[i].name << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct s {\n    char id[10];\n    int age;\n  };\n  struct s S[100], Si;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", S[i].id, &S[i].age);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (S[j + 1].age >= 60) {\n        if (S[j].age < S[j + 1].age) {\n          Si = S[j];\n          S[j] = S[j + 1];\n          S[j + 1] = Si;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << S[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct point {\n  char id[10];\n  int age;\n} old[100], small[100];\n\nint main() {\n  int n, i, j, o = 0, s = 0, t, m;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    char x[10] = {'\\0'};\n    t = 0;\n    scanf(\"%s %d\", x, &t);\n    if (t >= 60) {\n      strcpy(old[o].id, x);\n      old[o].age = t;\n      o++;\n\n    } else {\n      strcpy(small[s].id, x);\n      small[s].age = t;\n      s++;\n    }\n  }\n  char p[10];\n  for (i = 0; i < o; i++) {\n    for (j = 1; j < o - i; j++) {\n      if (old[i].age >= old[i + j].age) {\n        m = old[i + j].age;\n        old[i + j].age = old[i].age;\n        old[i].age = m;\n        strcpy(p, old[i + j].id);\n        strcpy(old[i + j].id, old[i].id);\n        strcpy(old[i].id, p);\n      }\n    }\n  }\n\n  for (i = o - 1; i >= 0; i--) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", small[i].id);\n  }\n}\n"}
{"label": "9", "index": "15668", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pa {\n  char name[10];\n  int age;\n  struct pa *next;\n};\n\nvoid sort(struct pa *head, struct pa *s) {\n  struct pa *p1, *p2;\n  p1 = head->next;\n  p2 = head;\n  while (p1 && p1->age >= s->age) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nvoid creat(struct pa *head, struct pa *s) {\n  struct pa *p2, *p1;\n  p1 = head->next;\n  p2 = head;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nstruct pa *input() {\n  int i, n;\n  struct pa *s, *head1, *head2, *p1, *p2;\n  head1 = (struct pa *)malloc(1000);\n  head2 = (struct pa *)malloc(1000);\n  head1->next = NULL;\n  head2->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = (struct pa *)malloc(1000);\n    cin >> s->name >> s->age;\n    if (s->age >= 60) {\n      sort(head1, s);\n    } else {\n      creat(head2, s);\n    }\n  }\n  p1 = head1->next;\n  p2 = head1;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = head2->next;\n  return (head1);\n}\n\nvoid print(struct pa *head) {\n  struct pa *p;\n  p = head->next;\n  while (p) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  struct pa *head;\n  head = input();\n  print(head);\n}\n"}
{"label": "9", "index": "15669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } a[100], m, k;\n  int i, j, n, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num++;\n      m = a[i];\n      for (j = i; j > 0; j--)\n        a[j] = a[j - 1];\n      a[0] = m;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = i + 1; j < num; j++) {\n      if (a[i].age <= a[j].age) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n} patient[100], patient2[100];\n\nint main() {\n  int i, k, m, n, j, temp;\n  char id2[10];\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  }\n  for (i = 0, j = 0; i < n;) {\n    if (patient[i].age >= 60) {\n      strcpy(patient2[j].id, patient[i].id);\n      patient2[j].age = patient[i].age;\n\n      j++;\n      for (k = i; k < n - 1; k++) {\n        strcpy(patient[k].id, patient[k + 1].id);\n        patient[k].age = patient[k + 1].age;\n      }\n      n--;\n    } else\n      i++;\n  }\n\n  for (i = 1; i < j; i++) {\n    for (k = 0; k < i; k++) {\n      if (patient2[i].age > patient2[k].age) {\n        temp = patient2[i].age;\n        strcpy(id2, patient2[i].id);\n        for (m = i; m > k; m--) {\n          patient2[m].age = patient2[m - 1].age;\n          strcpy(patient2[m].id, patient2[m - 1].id);\n        }\n        patient2[k].age = temp;\n        strcpy(patient2[k].id, id2);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", patient2[i].id);\n  for (i = 0; i < n; i++)\n    cout << patient[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, k = 0, e0, m, a;\n  int AGE[100];\n  char id[100][10];\n  char ID[100][10];\n  char e[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &id[i], &age[i]);\n  m = strlen(id[0]);\n  for (i = 0; i < n; i++)\n    id[i][m] = '\\0';\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      AGE[k] = age[i];\n      k++;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    for (j = 0; j < k - i; j++)\n      if (AGE[j] < AGE[j + 1]) {\n        e0 = AGE[j + 1];\n        AGE[j + 1] = AGE[j];\n        AGE[j] = e0;\n        for (a = 0; a <= m; a++) {\n          e[0][a] = ID[j + 1][a];\n          ID[j + 1][a] = ID[j][a];\n          ID[j][a] = e[0][a];\n        }\n      }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      k++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << ID[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15672", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  int num;\n  char hao[20];\n  int age;\n  struct patient *next;\n};\nstruct ans {\n  int numan;\n  char haoan[20];\n  int agean;\n  struct ans *nextan;\n};\nint main() {\n  struct patient *head, *p1, *p2;\n  struct ans *headan, *ans1, *ans2;\n  int i, j, max, n, shu;\n  shu = 0;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->hao, &p1->age);\n  p1->num = 1;\n  head = p1;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    cin >> p1->hao >> p1->age;\n    p2->next = p1;\n    p1->num = i + 2;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  max = 0;\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max < p1->age)\n      max = p1->age;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max == p1->age) {\n      ans1 = (struct ans *)malloc(sizeof(struct ans));\n      strcpy(ans1->haoan, p1->hao);\n      printf(\"%s\\n\", ans1->haoan);\n      ans1->agean = max;\n      headan = ans1;\n      ans2 = ans1;\n      p1->num = -1;\n      p1->age = -1;\n      shu = shu + 1;\n      break;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max < p1->age)\n        max = p1->age;\n      p1 = p1->next;\n    }\n    if (max < 60)\n      break;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->age) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->agean = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        shu = shu + 1;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < n - shu; i++) {\n    max = 101;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max > p1->num && p1->num != -1)\n        max = p1->num;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->num) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->numan = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        break;\n      }\n      p1 = p1->next;\n    }\n    ans2->nextan = NULL;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15673", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar id[101][11];\n\nint main() {\n  int n;\n  int age[101], a[101];\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    int j = i;\n    if (age[i] >= 60) {\n      for (; j > 1 && age[a[j - 1]] < age[i]; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (int i = 1; i <= n; i++)\n    printf(\"%s\\n\", id[a[i]]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[11];\n  int age;\n  struct pat *next;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *head, *p1, *p2, *pre;\n  p1 = (struct pat *)malloc(sizeof(struct pat));\n  scanf(\"%s %d\", p1->num, &p1->age);\n  head = p1;\n  p1->next = NULL;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      p2 = head;\n      while (p2) {\n        if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        }\n        p2 = p2->next;\n      }\n    } else if (p1->age >= 60) {\n      p2 = head;\n      while (p2) {\n        if (p2 == head && p1->age > p2->age) {\n          head = p1;\n          p1->next = p2;\n          break;\n        } else if (p1->age > p2->age) {\n          pre->next = p1;\n          p1->next = p2;\n          break;\n        } else if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        } else {\n          pre = p2;\n          p2 = p2->next;\n        }\n      }\n    }\n  }\n  p1 = head;\n  while (p1) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15675", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid bubble_sort(int a[100], char b[100][10], int n) {\n  int i, j, temp;\n  char temp_[10] = {0}, empty[10] = {0};\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (a[i] < a[i + 1]) {\n        temp = a[i];\n        strcpy(temp_, b[i]);\n        a[i] = a[i + 1];\n        strcpy(b[i], empty);\n        strcpy(b[i], b[i + 1]);\n        a[i + 1] = temp;\n        strcpy(b[i + 1], empty);\n        strcpy(b[i + 1], temp_);\n      }\n    }\n}\n\nint main() {\n  int age[100], Age_[100] = {0}, age_[100];\n  int n, i;\n  char id[100][10], Id_[100][10] = {0}, id_[100][10] = {0}, empty[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      Age_[i] = age[i];\n      strcpy(Id_[i], id[i]);\n    } else {\n      age_[i] = age[i];\n      strcpy(id_[i], id[i]);\n    }\n  }\n  bubble_sort(Age_, Id_, n);\n  for (i = 0; i < n; i++) {\n    if (strcmp(Id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", Id_[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", id_[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15676", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct Node {\n  char ID[11];\n  int age;\n  struct Node *next;\n} node;\nnode *creat(int n) {\n  node *p1, *p2, *head;\n  int i;\n  p1 = p2 = (node *)malloc(sizeof(node));\n  head = p1;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    scanf(\"%s%d\", p1->ID, &p1->age);\n    p1 = (node *)malloc(sizeof(node));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sort(int x, char *a, node *head) {\n  node *pre = head, *p = pre->next, *s;\n  s = (node *)malloc(sizeof(node));\n  s->age = x;\n  strcpy(s->ID, a);\n  s->next = NULL;\n  while (p != NULL && x <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\nvoid print(node *head) {\n  node *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  node *head1, *head2, *p;\n  scanf(\"%d\", &n);\n  head1 = creat(n);\n  head2 = (node *)malloc(sizeof(node));\n  strcpy(head2->ID, \" \");\n  head2->next = NULL;\n  p = head1;\n  while (p != NULL) {\n    if (p->age >= 60)\n      sort(p->age, p->ID, head2);\n    p = p->next;\n  }\n  head2 = head2->next;\n  print(head2);\n  p = head1;\n  while (p != NULL) {\n    if (p->age < 60)\n      printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    char as[10];\n    int ag;\n  };\n  struct student stu[100];\n  struct student st[100];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", stu[i].as, &stu[i].ag);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].ag > 59) {\n      st[j] = stu[i];\n      stu[i].ag = 0;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (st[i].ag < st[i + 1].ag) {\n        temp = st[i];\n        st[i] = st[i + 1];\n        st[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << \"\\n\" << st[i].as;\n  for (i = 0; i < n; i++)\n    if (stu[i].ag != 0)\n      printf(\"\\n%s\", stu[i].as);\n  return 0;\n}\n"}
{"label": "9", "index": "15678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int age, he;\n  char num[15];\n  struct st *next;\n};\n\nstruct st *creat(int n) {\n  struct st *head, *p1, *p2;\n  int i, h = 105;\n  p1 = (struct st *)malloc(sizeof(struct st));\n  p2 = p1;\n  head = p1;\n  for (i = 1; i <= n; i++) {\n    p1 = (struct st *)malloc(sizeof(struct st));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age >= 60)\n      p1->he = p1->age * 1000 + h;\n    else {\n      p1->he = h;\n    }\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    h--;\n  }\n  return (head);\n}\n\nvoid paixu(struct st *head) {\n  struct st *max, *p, *p1, *p2, *p3, *p4;\n  p1 = head;\n  while (p1->next) {\n    p2 = p1->next;\n    max = p2;\n    p4 = p2;\n    p = p2->next;\n    while (p) {\n      if (p->he > max->he) {\n        max = p;\n        p3 = p4;\n      }\n      p = p->next;\n      p4 = p4->next;\n    }\n    if (max > p1->next) {\n      p3->next = max->next;\n      p1->next = max;\n      max->next = p2;\n    }\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  struct st *creat(int n);\n  void paixu(struct st * head);\n  struct st *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(head);\n  p = head->next;\n  while (p) {\n    cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, n, e, sz[100], sx[100] = {0};\n  char st[100][11], sa[11], sd[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &st[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      sx[i] = sz[i];\n      strcpy(sd[i], st[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (a = 0; a < n - i; a++) {\n      if (sx[a] < sx[a + 1]) {\n        e = sx[a];\n        sx[a] = sx[a + 1];\n        sx[a + 1] = e;\n        strcpy(sa, sd[a]);\n        strcpy(sd[a], sd[a + 1]);\n        strcpy(sd[a + 1], sa);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sx[i] >= 60)\n      puts(sd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      puts(st[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, k = 0, d[100], p;\n  char b[100][10], c[10], str[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      d[k] = a[i];\n      strcpy(b[k], str[i]);\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (d[j] < d[j + 1]) {\n        p = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = p;\n\n        strcpy(c, b[j + 1]);\n        strcpy(b[j + 1], b[j]);\n        strcpy(b[j], c);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[200];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p2 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0) {\n      head = p2;\n      p3 = head;\n    }\n    cin >> p2->num >> p2->sum;\n    p2->next = NULL;\n    if (p2->sum >= 60) {\n      if (i == 1) {\n        if (head->sum >= p2->sum) {\n          head->next = p2;\n          p2->next = NULL;\n          p3 = p2;\n        } else {\n          p1 = head;\n          p2->next = head;\n          head = p2;\n        }\n      }\n      if (i > 1) {\n        for (p1 = head; p1->next != NULL; p1 = p1->next) {\n          if (p1->sum >= p2->sum && (p1->next->sum) < p2->sum) {\n            p2->next = p1->next;\n            p1->next = p2;\n            break;\n          }\n        }\n        if (p2->next == NULL) {\n          if (p2->sum > head->sum) {\n            p2->next = head;\n            head = p2;\n          }\n          if (p2->sum < p1->sum) {\n            p2->next = NULL;\n            p3 = p2;\n            p1->next = p2;\n          }\n        }\n      }\n    } else {\n      if (i != 0) {\n        p2->next = NULL;\n        p3->next = p2;\n        p3 = p2;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char num[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num = 1;\n  head = NULL;\n  while (num <= n) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (num == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    num++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct patient *pt, *p, *pre;\n  int i, max, num = 0;\n  scanf(\"%d \", &n);\n  pt = creat();\n  for (p = pt; p; p = p->next) {\n    if (p->age >= 60)\n      num++;\n  }\n  for (i = 1; i <= num; i++) {\n    max = 59;\n    for (p = pt; p; p = p->next) {\n      if (max < p->age)\n        max = p->age;\n    }\n    for (p = pre = pt; p; p = p->next) {\n      if (p->age != max)\n        pre = p;\n      else\n        break;\n    }\n    printf(\"%s \", p->num);\n    if (p == pt)\n      pt = p->next;\n    else\n      pre->next = p->next;\n  }\n  for (p = pt; p; p = p->next)\n    cout << p->num << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "15683", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[10];\n    int age;\n    struct patient *next;\n    struct patient *pre;\n  };\n  struct patient *p, *head, *q, *m, *temp;\n  p = (struct patient *)malloc(sizeof(struct patient));\n  head = p;\n  temp = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    cin >> p->ID >> p->age;\n    if (i != n - 1) {\n      p->next = (struct patient *)malloc(sizeof(struct patient));\n      p->next->pre = p;\n      p->next->next = NULL;\n      p = p->next;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (q = p->next; q != NULL; q = q->next) {\n      if ((p->age < q->age) && (q->age >= 60)) {\n        for (m = q; m != p; m = m->pre) {\n          temp->age = m->age;\n          m->age = m->pre->age;\n          m->pre->age = temp->age;\n          strcpy(temp->ID, m->ID);\n          strcpy(m->ID, m->pre->ID);\n          strcpy(m->pre->ID, temp->ID);\n        }\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s\\n\", p->ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct BING {\n  char id[10];\n  int old;\n} bing[100], temp;\nint main() {\n  int i, k, n, p, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bing[i].id, &bing[i].old);\n  }\n  for (p = 0;; p++) {\n    max = -1;\n    for (i = 0; i < n; i++) {\n      if (bing[i].old > max && bing[i].old >= 60) {\n        max = bing[i].old;\n        k = i;\n      }\n    }\n    if (max >= 60) {\n      printf(\"%s\\n\", bing[k].id);\n      bing[k].old = -1;\n    }\n    if (max < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].old < 60 && bing[i].old >= 0)\n      cout << bing[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char id[100][10];\n  int age[100];\n  int oldno = 0;\n  int xu[100];\n  char shunxu[100][10];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (age[j] >= 60) {\n      xu[oldno] = age[j];\n      strcpy(shunxu[oldno], id[j]);\n      oldno++;\n    }\n  }\n\n  int num = oldno;\n  int e;\n  char tem[10];\n  for (int k = 0; k < n; k++) {\n    if (age[k] < 60) {\n      xu[oldno] = age[k];\n      strcpy(shunxu[oldno], id[k]);\n      oldno++;\n    }\n  }\n  for (int x = 1; x <= num; x++) {\n    for (int y = 0; y < num - x; y++) {\n      if (xu[y] < xu[y + 1]) {\n        e = xu[y];\n        xu[y] = xu[y + 1];\n        xu[y + 1] = e;\n        strcpy(tem, shunxu[y]);\n        strcpy(shunxu[y], shunxu[y + 1]);\n        strcpy(shunxu[y + 1], tem);\n      }\n    }\n  }\n  for (int z = 0; z < n; z++)\n    printf(\"%s\\n\", shunxu[z]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  struct patient {\n    char ID[10];\n    int age;\n    struct patient *next;\n    struct patient *pre;\n  };\n  struct patient *p, *head, *q, *m, *temp;\n  p = (struct patient *)malloc(sizeof(struct patient));\n  head = p;\n  temp = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    if (i != n - 1) {\n      p->next = (struct patient *)malloc(sizeof(struct patient));\n      p->next->pre = p;\n      p->next->next = NULL;\n      p = p->next;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (q = p->next; q != NULL; q = q->next) {\n      if ((p->age < q->age) && (q->age >= 60)) {\n        for (m = q; m != p; m = m->pre) {\n          temp->age = m->age;\n          m->age = m->pre->age;\n          m->pre->age = temp->age;\n          strcpy(temp->ID, m->ID);\n          strcpy(m->ID, m->pre->ID);\n          strcpy(m->pre->ID, temp->ID);\n        }\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    cout << p->ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15687", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  } pa[100];\n  int n, i, t, j;\n  char m[10], str[100][100];\n  int a[100], b[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].ID >> pa[i].age;\n    a[i] = pa[i].age;\n    strcpy(str[i], pa[i].ID);\n  }\n  for (i = 0, j = 0; i < n; i++, j++) {\n    if (a[i] >= 60)\n      b[j] = a[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < n - 1 - i; j++) {\n\n      if (b[j + 1] > b[j]) {\n        t = b[j];\n        strcpy(m, pa[j].ID);\n        b[j] = b[j + 1];\n        strcpy(pa[j].ID, pa[j + 1].ID);\n        b[j + 1] = t;\n        strcpy(pa[j + 1].ID, m);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    if (b[i] != 0)\n      printf(\"%s\\n\", pa[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15688", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bingren {\n  char id[1000];\n  int age;\n} bin[101];\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  int i, j, k = 0, l = 0, e, a[100];\n  char xiao[101][1000], da[101][1000], c[1000];\n  for (i = 0; i < n; i++) {\n    cin >> bin[i].id >> bin[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (bin[i].age < 60) {\n      strcpy(xiao[k], bin[i].id);\n      k++;\n    } else {\n      strcpy(da[l], bin[i].id);\n      a[l] = bin[i].age;\n      l++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (a[j] < a[j + 1]) {\n        strcpy(c, da[j + 1]);\n        strcpy(da[j + 1], da[j]);\n        strcpy(da[j], c);\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", da[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", xiao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[100] = {0}, b[100] = {0};\n  char id[100][20], temp[20], s[100][20];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &a[i]);\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(s[j], id[i]);\n      j = j + 1;\n    }\n\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i; k++)\n      if (b[k] < b[k + 1]) {\n        t = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = t;\n        strcpy(temp, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], temp);\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", s[k]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", id[i]);\n}\n"}
{"label": "9", "index": "15690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  int sixty[100];\n\n  int n, b = 0, i, j, k, e;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i] = people[i].age;\n\n      b += 1;\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        e = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == people[j].age && sixty[i] != sixty[i - 1]) {\n        cout << people[j].id << \"\\n\";\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int j;\n  struct client {\n    char num[11];\n    int age;\n  };\n  struct client line[100];\n  struct client temp;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &line[i].num, &line[i].age);\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (line[j].age >= 60 && line[j + 1].age >= 60) {\n        if (line[j].age < line[j + 1].age) {\n          temp = line[j];\n          line[j] = line[j + 1];\n          line[j + 1] = temp;\n        }\n      }\n      if (line[j].age < 60 && line[j + 1].age >= 60) {\n        temp = line[j];\n        line[j] = line[j + 1];\n        line[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << line[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, d[100], e, g, i, x, z;\n  char c[100][100];\n  scanf(\"%d\", &a);\n  for (b = 0; b < a; b++) {\n    scanf(\"%s %d\", c[b], &d[b]);\n  }\n  for (e = 0; e < a; e++) {\n    if (d[e] >= 60) {\n      i = e;\n      break;\n    }\n  }\n  for (e = 0, g = 0; e < a; e++) {\n\n    if (d[e] >= 60)\n      g = g + 1;\n  }\n  for (x = 1; x <= g; x++) {\n    for (e = 0; e < a; e++) {\n      if (d[e] >= 60) {\n        if (d[i] < d[e])\n          i = e;\n      }\n    }\n    printf(\"%s \", c[i]);\n    d[i] = 0;\n  }\n  for (z = 0; z < a; z++) {\n    if (d[z] != 0)\n      printf(\"%s \", c[z]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15693", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d \", &n);\n  struct p {\n    char id[10];\n    int age;\n  } a[n], b[n], c[n], d;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = 0; l < j - 1 - i; l++)\n      if (b[l].age < b[l + 1].age) {\n        d = b[l];\n        b[l] = b[l + 1];\n        b[l + 1] = d;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "15694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  cin >> p1->id >> p1->age;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct patient *)malloc(1000);\n    cin >> p1->id >> p1->age;\n    p1->next = NULL;\n    i++;\n    p2->next = p1;\n    p2 = p1;\n  } while (i < n);\n  return (head);\n}\n\nstruct patient *tiao(struct patient *head, int n) {\n  struct patient *p1;\n  int t, i;\n  char s[10];\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    do {\n      if (p1->age < (p1->next)->age && (p1->next)->age >= 60) {\n        t = p1->age;\n        p1->age = (p1->next)->age;\n        (p1->next)->age = t;\n        strcpy(s, p1->id);\n        strcpy(p1->id, (p1->next)->id);\n        strcpy((p1->next)->id, s);\n      }\n      p1 = p1->next;\n    } while (p1->next);\n  }\n\n  return (head);\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p);\n}\n\nint main() {\n  struct patient *head;\n  int n;\n  cin >> n;\n  head = creat(n);\n  head = tiao(head, n);\n  print(head);\n}\n"}
{"label": "9", "index": "15695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s%d\", p1->num, &p1->sum);\n    p1->next = NULL;\n\n    if (i != 0) {\n      p3 = head;\n      if (p1->sum >= 60) {\n\n        while ((p1->sum <= p3->sum) && p3->next != NULL) {\n          p2 = p3;\n          p3 = p3->next;\n        }\n        if (p1->sum > p3->sum) {\n          if (head == p3) {\n            head = p1;\n            p1->next = p3;\n          } else {\n            p2->next = p1;\n            p1->next = p3;\n          }\n        } else {\n          p3->next = p1;\n          p1->next = NULL;\n        }\n      } else {\n        for (p2 = head;; p2 = p2->next) {\n          if (p2->next == NULL)\n            break;\n        }\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct p {\n    char id[30];\n    int ag;\n  } a[105], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].ag;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[j - 1].ag >= 60 && a[j].ag >= 60) {\n        if (a[j - 1].ag < a[j].ag) {\n          temp = a[j - 1];\n          a[j - 1] = a[j];\n          a[j] = temp;\n        }\n      } else if (a[j - 1].ag < 60 && a[j].ag >= 60) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo[100], pai[100], temp;\n\n  int i, n;\n  int j = 0;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if ((pai[i].age < pai[i + 1].age) && (pai[i + 1].age >= 60)) {\n        temp = pai[i];\n        pai[i] = pai[i + 1];\n        pai[i + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pai[i].num);\n}\n"}
{"label": "9", "index": "15698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[16];\n    int age;\n    int index;\n  };\n  int n, i, j, t, t1;\n  char str[16];\n  scanf(\"%d\", &n);\n  struct patient pat[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].ID, &pat[i].age);\n    pat[i].index = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (pat[j].age >= 60 && pat[j].age > pat[i].age) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n      if (pat[i].age >= 60 && pat[i].age == pat[j].age) {\n        if (pat[i].index > pat[j].index) {\n          strcpy(str, pat[i].ID);\n          strcpy(pat[i].ID, pat[j].ID);\n          strcpy(pat[j].ID, str);\n          t = pat[i].age;\n          pat[i].age = pat[j].age;\n          pat[j].age = t;\n          t1 = pat[i].index;\n          pat[i].index = pat[j].index;\n          pat[j].index = t1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (pat[i].age < 60 && pat[i].index > pat[j].index) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n  }\n  for (i = 0; i < n; i++)\n\n    puts(pat[i].ID);\n}\n"}
{"label": "9", "index": "15699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct x {\n  char a[10];\n  int b;\n};\nstruct x y[100];\nint main() {\n  int n, i, j, m;\n  char s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &y[i].a, &y[i].b);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (y[i].b < y[i + 1].b && y[i + 1].b >= 60) {\n        strcpy(s, y[i].a);\n        strcpy(y[i].a, y[i + 1].a);\n        strcpy(y[i + 1].a, s);\n        m = y[i].b;\n        y[i].b = y[i + 1].b;\n        y[i + 1].b = m;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", y[i].a);\n}\n"}
{"label": "9", "index": "15700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100], a, ageb[100], c, t, m;\n  char ID[100][100], IDb[100][100], IDc[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &age[i]);\n\n  i = 0;\n  c = 0;\n  while (i < n) {\n    if (age[i] >= 60) {\n      ageb[c] = age[i];\n      strcpy(IDb[c], ID[i]);\n      c++;\n    }\n    i++;\n  }\n  for (i = 0; i <= c - 1; i++)\n    for (a = 0; a < c - i - 1; a++)\n      if (ageb[a] < ageb[a + 1]) {\n        t = ageb[a];\n        strcpy(IDc, IDb[a]);\n        ageb[a] = ageb[a + 1];\n        strcpy(IDb[a], IDb[a + 1]);\n        ageb[a + 1] = t;\n        strcpy(IDb[a + 1], IDc);\n      }\n  for (i = 0; i <= c - 1; i++)\n    printf(\"%s\\n\", IDb[i]);\n  i = 0;\n  while (i < n) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", ID[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][11], c[100][11];\n  int i, j, n, b[100], m, e = -1, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      m = 0;\n      for (j = 0; j < n; j++) {\n        if (b[i] < b[j] || (b[i] == b[j] && i > j)) {\n          m++;\n        }\n      }\n      if (e < m) {\n        e = m;\n      }\n      strcpy(c[m], a[i]);\n    }\n  }\n  e = e + 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      strcpy(c[i - f + e], a[i]);\n    } else {\n      f++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i, j, l, m;\n  scanf(\"%d\", &a);\n  int f[a];\n  int h[a];\n  int n[a];\n  int k[a];\n  int o[a];\n  char g[a][10];\n  for (i = 0; i < a; i++) {\n    scanf(\"%s %d\", g[i], &f[i]);\n  }\n  j = 0;\n  for (i = 0; i < a; i++) {\n    if (f[i] >= 60) {\n      h[j] = f[i];\n      k[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    n[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    o[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = i + 1; l < j; l++) {\n      if (h[n[i]] < h[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n\n      } else if (h[n[i]] == h[n[l]] && o[n[i]] > o[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << g[k[n[i]]] << \" \";\n  }\n  for (i = 0; i < a; i++) {\n    if (f[i] < 60)\n      printf(\"%s \", g[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[11];\n    int age;\n    struct pa *next;\n  } * head, *p1, *p2, *p3, *p4;\n  int tage;\n  char tID[11];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pa *)malloc(sizeof(struct pa));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    if (i != 0)\n      p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = NULL;\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < n; i++) {\n    p3 = p1;\n    p4 = p2;\n    for (j = 0; j < n - 1; j++) {\n      if (p3->age < p4->age && p4->age >= 60) {\n        strcpy(tID, p3->ID);\n        tage = p3->age;\n        strcpy(p3->ID, p4->ID);\n        p3->age = p4->age;\n        strcpy(p4->ID, tID);\n        p4->age = tage;\n      }\n      p3 = p3->next;\n      p4 = p4->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    cout << p1->ID << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15704", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age, arranged;\n};\n\nint main() {\n  int n, i, t = 0, j;\n  struct Patient pai[100], orderd[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pai[i].id >> pai[i].age;\n    pai[i].arranged = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].age >= 60) {\n      orderd[t] = pai[i];\n      pai[i].arranged = 1;\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (orderd[j].age < orderd[j + 1].age) {\n        struct Patient temp = orderd[j];\n        orderd[j] = orderd[j + 1];\n        orderd[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].arranged == 0) {\n      orderd[t] = pai[i];\n      t++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << orderd[i].id << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  int d;\n  char c[20];\n  struct s *next;\n};\nvoid sort(struct s *head) {\n  struct s *pre = head, *p = pre->next, *s;\n  s = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%s %d\", s->c, &s->d);\n  s->next = NULL;\n  if (s->d >= 60) {\n    while (p != NULL && p->d >= s->d) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n  if (s->d < 60) {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nint main() {\n  struct s *head, *p;\n  int n, i;\n  head = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%d\", &n);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    sort(head);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->c);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n} pat[100];\nint main() {\n  int n, a[200], j, i;\n  scanf(\"%d\", &n);\n  for (j = 0; j < 150; j++)\n    a[j] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    for (j = 1; j < 150; j++) {\n      if (j == pat[i].age)\n        a[j]++;\n    }\n  }\n  for (j = 150; j >= 60; j--) {\n    if (a[j] == 0)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (j == pat[i].age)\n        printf(\"%s \", pat[i].id);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s \", pat[i].id);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0;\n  struct person t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].id, &s[i].y);\n  for (i = 0; i < n; i++)\n    if (s[i].y >= 60) {\n      o[k] = s[i];\n      k++;\n    } else {\n      y[m] = s[i];\n      m++;\n    }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i; j++)\n      if (o[j].y < o[j + 1].y) {\n        t = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = t;\n      }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", o[i].id);\n\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", y[i].id);\n}\n"}
{"label": "9", "index": "15708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[200], t;\n  char b[200][11], b1[11];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &b[i], &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (a[j + 1] >= 60 && a[j] < a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n        strcpy(b1, b[j]);\n        strcpy(b[j], b[j + 1]);\n        strcpy(b[j + 1], b1);\n      }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15709", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][1000];\n  int b[100];\n  char c[100][1000];\n  int q, w, e;\n  q = 0;\n  w = 0;\n  int n;\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int y;\n    char x[100][1000];\n    scanf(\"%s %d\", x, &y);\n    if (y >= 60) {\n      strcpy(a[q], x[0]);\n      b[q] = y;\n      q++;\n    } else {\n      strcpy(c[w], x[0]);\n      w++;\n    }\n  }\n  int h;\n  char H[100][1000];\n  for (i = 1; i < 10000; i++) {\n    for (j = 0; j < q; j++) {\n      if (b[j] < b[j + 1]) {\n        h = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = h;\n        strcpy(H[0], a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], H[0]);\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%s\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    char id[10];\n    int age;\n  };\n  int n, i, j, k;\n  struct b a[100], temp, c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i].age >= 60) {\n      c[j] = a[i];\n      j++;\n    }\n  for (i = j - 1; i >= 1; i--)\n    for (k = j - 1; k > j - i - 1; k--)\n      if (c[k].age > c[k - 1].age) {\n        temp = c[k];\n        c[k] = c[k - 1];\n        c[k - 1] = temp;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i].id);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      cout << a[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15711", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t;\n  struct ill {\n    char num[10];\n    int age, id;\n  } man[1000], ex;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", man[i].num, &man[i].age);\n    man[i].id = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].age < man[j].age) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (man[i].age < 60) {\n      t = i;\n      break;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = i + 1; j < t; j++) {\n      if (man[i].age == man[j].age && man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = t; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", man[i].num);\n  }\n  for (i = 0; i < n; i++)\n    ;\n  return 0;\n}\n"}
{"label": "9", "index": "15712", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct data *pdata;\n\nstruct data {\n  char a[20];\n  int b;\n  pdata next;\n};\n\npdata sort(int n) {\n  pdata p = NULL, q = NULL, s = NULL, head = NULL;\n  head = (pdata)malloc(sizeof(struct data));\n  head->next = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    s = (pdata)malloc(sizeof(struct data));\n    scanf(\"%s %d\", s->a, &(s->b));\n    if (s->b >= 60) {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->b < s->b)\n          break;\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = NULL;\n    }\n  }\n\n  return head;\n}\n\nint main() {\n  int n, i;\n  pdata p, head;\n  scanf(\"%d\", &n);\n  head = sort(n);\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n\n} per[100];\nint main() {\n  int i, n, j, k = 0, a[100] = {0}, num = 0, temp1;\n  char b[100][10] = {0}, temp2[10] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n  for (i = 0; i < n; i++) {\n    if (per[i].age >= 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < num - j; k++)\n      if (a[k] < a[k + 1]) {\n        temp1 = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = temp1;\n        strcpy(temp2, b[k]);\n        strcpy(b[k], b[k + 1]);\n        strcpy(b[k + 1], temp2);\n      }\n  }\n  for (i = 0, k = num; i < n; i++) {\n    if (per[i].age < 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (k = 0; k < num - 1; k++)\n    printf(\"%s\\n\", b[k]);\n  cout << b[num - 1];\n}\n"}
{"label": "9", "index": "15714", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100], a[100][100], b[100];\n  int n, i, j = 0, sz[100], t, c;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(a[j], s[i]);\n      j++;\n    }\n  }\n  for (t = 1; t <= n; t++) {\n    for (i = 0; i < n - t; i++) {\n      if (sz[i] < sz[i + 1]) {\n        c = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = c;\n        strcpy(b, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], b);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15715", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct mouse {\n  int weight;\n  char color[11];\n  struct mouse *next, *before;\n};\nint main() {\n  int i, j, n, max;\n  cin >> n;\n  struct mouse *m, *head, *p1, *p2, *fin;\n  head = p1 = p2 = (struct mouse *)malloc(sizeof(struct mouse));\n  cin >> p1->color >> p1->weight;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->color, &p1->weight);\n    p2->next = p1;\n    p1->before = p2;\n    p2 = p1;\n  }\n  fin = p1;\n  p1->next = NULL;\n  for (i = 1; i <= n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 1; j <= n + 1 - i; j++) {\n      if (p1->weight > max) {\n        max = p1->weight;\n        m = p1;\n      }\n      p1 = p1->next;\n    }\n    if (m->weight < 60)\n      break;\n    printf(\"%s\\n\", m->color);\n    if (m == head) {\n      head = head->next;\n      continue;\n    }\n    if (m == fin) {\n      fin = fin->before;\n      fin->next = NULL;\n      continue;\n    }\n    if (m != head && m != fin) {\n      p1 = m->before;\n      p1->next = m->next;\n      m = m->next;\n      m->before = p1;\n    }\n  }\n  p1 = head;\n  printf(\"%s\\n\", head->color);\n  for (; p1->next != NULL;) {\n    p1 = p1->next;\n    printf(\"%s\\n\", p1->color);\n  }\n}\n"}
{"label": "9", "index": "15716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n} person[100], old[100];\n\nint main() {\n  int n, i, j = 0, k, b;\n  char e[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", person[i].id, &person[i].age);\n    if (person[i].age >= 60) {\n      strcpy(old[j].id, person[i].id);\n      old[j].age = person[i].age;\n      j = j + 1;\n    }\n  }\n  for (k = 1; k < j; k++)\n    for (i = 0; i < j - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        strcpy(e, old[i].id);\n        strcpy(old[i].id, old[i + 1].id);\n        strcpy(old[i + 1].id, e);\n        b = old[i].age;\n        old[i].age = old[i + 1].age;\n        old[i + 1].age = b;\n      }\n    }\n  for (i = 0; i < j; i++)\n    cout << old[i].id << \" \";\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      cout << person[i].id << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "15717", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint old = 0;\n\nstruct seqs {\n  char id[11];\n  int age;\n  struct seqs *next;\n};\n\nstruct seqs *build(int l) {\n  int i;\n  struct seqs *head, *newnode, *p;\n  head = (struct seqs *)malloc(1000);\n  scanf(\"%s %d\", head->id, &head->age);\n  p = head;\n  if (head->age >= 60)\n    old++;\n  for (i = 1; i < l; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    scanf(\"%s %d\", newnode->id, &newnode->age);\n    if (newnode->age < 60) {\n      p->next = newnode;\n      p = newnode;\n    } else {\n      old++;\n      newnode->next = head;\n      head = newnode;\n    }\n  }\n  p->next = NULL;\n  return head;\n}\n\nstruct seqs *rebuild(struct seqs *headx) {\n  int i;\n  struct seqs *head, *newnode, *p, *px;\n\n  newnode = (struct seqs *)malloc(1000);\n  newnode->next = NULL;\n  strcpy(newnode->id, headx->id);\n  newnode->age = headx->age;\n  p = newnode;\n  px = headx->next;\n  for (i = 1; i < old; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    strcpy(newnode->id, px->id);\n    newnode->age = px->age;\n    newnode->next = p;\n    p = newnode;\n    px = px->next;\n  }\n  head = p;\n  return head;\n}\nvoid bubble(struct seqs *head, int l) {\n  struct seqs *p;\n  int i, j, temp;\n  char t[11] = {0};\n  for (i = 1; i < l; i++)\n    for (p = head, j = 0; j < l - i; j++, p = p->next)\n      if (p->age < p->next->age) {\n        strcpy(t, p->id);\n        strcpy(p->id, p->next->id);\n        strcpy(p->next->id, t);\n        temp = p->age;\n        p->age = p->next->age;\n        p->next->age = temp;\n      }\n}\nint main() {\n  int n, i;\n  struct seqs *p, *px;\n  scanf(\"%d\", &n);\n  p = build(n);\n  px = rebuild(p);\n  bubble(px, old);\n  while (px != NULL) {\n    printf(\"%s \", px->id);\n    px = px->next;\n  }\n  for (i = 0; i < old; i++)\n    p = p->next;\n  while (p != NULL) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, sz[100], i, j, sz2[100], e;\n  char zf[100][20], f[20], zf2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zf[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      n--;\n      strcpy(zf2[m], zf[i]);\n      sz2[m] = sz[i];\n      m++;\n      for (j = i; j <= n; j++) {\n        strcpy(zf[j], zf[j + 1]);\n        sz[j] = sz[j + 1];\n      }\n      i--;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (sz2[i] < sz2[i + 1]) {\n        e = sz2[i];\n        sz2[i] = sz2[i + 1];\n        sz2[i + 1] = e;\n        strcpy(f, zf2[i]);\n        strcpy(zf2[i], zf2[i + 1]);\n        strcpy(zf2[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", zf2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15719", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, e;\n  char q[11];\n  struct point {\n    char name[11];\n    int age;\n  } p[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &p[i].name, &p[i].age);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if ((p[i].age > 60 || p[i].age == 60) &&\n              (p[i + 1].age > 60 || p[i + 1].age == 60) &&\n              p[i].age < p[i + 1].age ||\n          p[i].age < 60 && (p[i + 1].age > 60 || p[i + 1].age == 60)) {\n        e = p[i].age;\n        p[i].age = p[i + 1].age;\n        p[i + 1].age = e;\n\n        strcpy(q, p[i].name);\n        strcpy(p[i].name, p[i + 1].name);\n        strcpy(p[i + 1].name, q);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].name);\n    if (i != n - 1) {\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ID[100][10] = {'\\0'}, young[100][10] = {'\\0'}, old[100][10] = {'\\0'},\n       wae[100] = {'\\0'};\n  int age[100] = {0}, y[100] = {0}, o[100] = {0};\n  int i, n;\n  int m = 0, k = 0, temp = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[m], ID[i]);\n      y[m] = age[i];\n      m++;\n    } else {\n      strcpy(old[k], ID[i]);\n      o[k] = age[i];\n      k++;\n    }\n  }\n  for (a = 0; a < k - 1; a++) {\n    for (b = 0; b < k - a - 1; b++) {\n      if (o[b] < o[b + 1]) {\n        temp = o[b];\n        o[b] = o[b + 1];\n        o[b + 1] = temp;\n        strcpy(wae, old[b]);\n        strcpy(old[b], old[b + 1]);\n        strcpy(old[b + 1], wae);\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%s\\n\", old[a]);\n  for (b = 0; b < m; b++)\n    printf(\"%s\\n\", young[b]);\n}\n"}
{"label": "9", "index": "15721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct p {\n  char id[10];\n  int age;\n};\n\nvoid bubble(struct p a[100], int n) {\n  int i, j;\n  struct p temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j].age >= 60) {\n        if (a[j + 1].age > a[j].age) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      } else {\n        if (a[j + 1].age >= 60) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  struct p a[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].age;\n  }\n  bubble(a, n);\n  for (i = 0; i < n; i++) {\n    cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int w;\n  char c[20];\n  int old;\n  struct data *next;\n  struct data *onext;\n};\nint main() {\n  int i, j, n, max, x;\n  scanf(\"%d\", &n);\n  struct data *head = (struct data *)malloc(sizeof(struct data));\n  struct data *p, *pp, *de;\n  pp = head;\n  for (i = 0; i < n; i++) {\n    p = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%s %d\", p->c, &p->w);\n    p->old = 0;\n    pp->next = p;\n    pp = p;\n  }\n  struct data *old = (struct data *)malloc(sizeof(struct data));\n  pp = head->next;\n  de = old;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    if (pp->w > 59) {\n      pp->old = 1;\n      de->onext = pp;\n      de = pp;\n      x++;\n    }\n    pp = pp->next;\n  }\n\n  for (i = 0; i < x; i++) {\n    pp = old->onext;\n    max = 0;\n    for (j = 0; j < x; j++) {\n      if (pp->w > max) {\n        max = pp->w;\n        de = pp;\n      }\n      pp = pp->onext;\n    }\n    printf(\"%s\\n\", de->c);\n    de->w = -1;\n  }\n  pp = head->next;\n  for (i = 0; i < n; i++) {\n    if (pp->old == 0)\n      printf(\"%s\\n\", pp->c);\n\n    pp = pp->next;\n  }\n}\n"}
{"label": "9", "index": "15723", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n} pat[100];\nint main() {\n  int n, a[200], j, i;\n  scanf(\"%d \", &n);\n  for (j = 0; j < 150; j++)\n    a[j] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    for (j = 1; j < 150; j++) {\n      if (j == pat[i].age)\n        a[j]++;\n    }\n  }\n  for (j = 150; j >= 60; j--) {\n    if (a[j] == 0)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (j == pat[i].age)\n        printf(\"%s \", pat[i].id);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s \", pat[i].id);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, year;\n  char old[150][100] = {0}, id[100][100] = {0}, id0[100] = {0},\n       huiche[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id0, &year);\n    if (year >= 60) {\n      if (old[year][0] == 0) {\n        strcpy(old[year], id0);\n      } else {\n        huiche[0] = 13;\n        huiche[1] = 0;\n        strcat(old[year], huiche);\n        strcat(old[year], id0);\n      }\n    } else {\n      strcpy(id[i], id0);\n    }\n  }\n  for (i = 149; i >= 0; i--) {\n    if (old[i][0] != 0) {\n      cout << old[i] << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (id[i] != 0) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15725", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[11];\n  int age;\n  struct pat *next;\n};\nint main() {\n  int n, i;\n  cin >> n;\n  struct pat *head, *p1, *p2, *pre;\n  p1 = (struct pat *)malloc(sizeof(struct pat));\n  cin >> p1->num >> p1->age;\n  head = p1;\n  p1->next = NULL;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n    cin >> p1->num >> p1->age;\n    if (p1->age < 60) {\n      p2 = head;\n      while (p2) {\n        if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        }\n        p2 = p2->next;\n      }\n    } else if (p1->age >= 60) {\n      p2 = head;\n      while (p2) {\n        if (p2 == head && p1->age > p2->age) {\n          head = p1;\n          p1->next = p2;\n          break;\n        } else if (p1->age > p2->age) {\n          pre->next = p1;\n          p1->next = p2;\n          break;\n        } else if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        } else {\n          pre = p2;\n          p2 = p2->next;\n        }\n      }\n    }\n  }\n  p1 = head;\n  while (p1) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n} pat[100];\nint main() {\n  struct patient t;\n  struct patient num[100];\n  int n, i, j, a = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].ID >> pat[i].age;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      num[a - 1] = pat[i];\n      a++;\n    }\n  }\n  for (i = 0; i < a - 2; i++) {\n    for (j = 0; j < a - 2 - i; j++)\n      if (num[j].age < num[j + 1].age) {\n        t = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = t;\n      }\n  }\n  for (i = 0; i < a - 1; i++)\n    printf(\"%s\\n\", num[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} young[100], old[100];\n\nint main() {\n  int i, j, n, temp, yn = 0, on = 0, people[150] = {0};\n  char t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", t, &temp);\n    if (temp >= 60) {\n      strcat(old[on].id, t);\n      old[on].age = temp;\n      on++;\n      people[temp]++;\n    } else {\n      strcat(young[yn].id, t);\n      young[yn].age = temp;\n      yn++;\n    }\n  }\n  for (i = 149; i >= 60; i--) {\n    if (people[i] > 0) {\n      for (j = 0; j < on; j++)\n        if (old[j].age == i)\n          cout << old[j].id << \"\\n\";\n    }\n  }\n  for (i = 0; i < yn; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} p[101];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", p[i].No, &p[i].age);\n  }\n  struct patient t;\n  for (i = 2; i <= n; i++) {\n    if (p[i].age >= 60) {\n      for (j = i; j > 1; j--) {\n        if (p[j - 1].age < p[j].age) {\n          t = p[j - 1];\n          p[j - 1] = p[j];\n          p[j] = t;\n        } else\n          break;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", p[i].No);\n  return 0;\n}\n"}
{"label": "9", "index": "15729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[n][100];\n  int b[n], i, j, c[n], d[n], k;\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++) {\n    c[i] = 0;\n    d[i] = n;\n    for (j = 0; j < n; j++) {\n      if (b[j] >= 60 && b[j] > c[i]) {\n        for (k = 0; k < i; k++) {\n          if (j == d[k]) {\n            break;\n          }\n        }\n        if (k == i) {\n          c[i] = b[j];\n          d[i] = j;\n        }\n      }\n    }\n    if (d[i] != n && b[d[i]] >= 60)\n      printf(\"%s\\n\", a[d[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  int age;\n  char id[10];\n  struct patient *next;\n};\n\nint main() {\n  int n, i, j, a = 0, b = 0;\n  struct patient *p1, *p2, *head1 = NULL, *head2 = NULL, *q1, *q2, *temp, *last;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    q1 = p1;\n    if (p1->age >= 60) {\n      if (head1 == NULL) {\n        head1 = p1;\n        p2 = p1;\n        p1->next = NULL;\n      } else {\n        a = a + 1;\n        temp = head1;\n        last = head1;\n        for (j = 0; j < a; j++) {\n          if (p1->age > temp->age) {\n            if (j == 0) {\n              p1->next = head1;\n              head1 = p1;\n              break;\n            } else {\n              last->next = p1;\n              p1->next = temp;\n              break;\n            }\n          }\n          last = temp;\n          temp = temp->next;\n        }\n        if (j == a) {\n          last->next = p1;\n          p1->next = NULL;\n        }\n      }\n    }\n    if (p1->age < 60) {\n      if (head2 == NULL) {\n        head2 = q1;\n        q2 = q1;\n        q1->next = NULL;\n      } else {\n        b = b + 1;\n        q1->next = NULL;\n        q2->next = q1;\n        q2 = q1;\n      }\n    }\n  }\n  p1 = head1;\n  q1 = head2;\n  for (i = 0; i <= a; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  for (i = 0; i <= b; i++) {\n    printf(\"%s \", q1->id);\n    q1 = q1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int age;\n  struct student *next;\n};\nint n, i;\nstruct student *create() {\n  struct student *head;\n  struct student *p1, *p2;\n  head = NULL;\n  scanf(\"%d\", &i);\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->age);\n  while (n != i - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid paixu(struct student *p) {\n  struct student *p1, *p2;\n  char temp[20];\n  int temp2;\n  for (n = 1; n < i; n++) {\n    p2 = p;\n    p1 = p->next;\n    while (p1 != NULL) {\n      if (p1->age >= 60 && p2->age < 60) {\n\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      } else if (p1->age > p2->age && p2->age >= 60) {\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n}\nvoid print(struct student *p) {\n  while (p != NULL) {\n    cout << p->num;\n    p = p->next;\n    if (p != NULL)\n      printf(\" \");\n  }\n}\nint main() {\n  struct student *p;\n  p = create();\n  paixu(p);\n  print(p);\n}\n"}
{"label": "9", "index": "15732", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  cin >> n;\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &at);\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        p11 = (struct patient *)malloc(sizeof(struct patient));\n        p11->age = at;\n        strcpy(p11->id, id);\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next)\n    printf(\"%s \", t->id);\n  printf(\"%s\", t->id);\n  return 0;\n}\n"}
{"label": "9", "index": "15733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n} pat[100];\n\nint over60[100];\nint below60[100];\nint m, k;\nint main(int argc, char *argv[]) {\n  void choose(struct patient * p, int n);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  }\n  choose(pat, n);\n  for (j = 1; j <= m; j++) {\n    if (over60[m - j] != over60[m - j - 1]) {\n      for (i = 0; i < n; i++) {\n\n        if (pat[i].age == over60[m - j]) {\n          printf(\"%s\\n\", pat[i].id);\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\nvoid choose(struct patient *p, int n) {\n  void paixu(int *a, int n);\n  int i;\n  for (i = 0, m = 0, k = 0; i < n; i++) {\n    if ((p + i)->age >= 60) {\n      over60[m] = (p + i)->age;\n      m++;\n    }\n  }\n  paixu(over60, m);\n}\n\nvoid paixu(int *a, int n) {\n  int j, i, e;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (*(a + i) > *(a + i + 1)) {\n        e = *(a + i);\n        *(a + i) = *(a + i + 1);\n        *(a + i + 1) = e;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo[100], pai[100], temp;\n  int i, n;\n  int j = 0;\n  int k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if ((pai[i].age < pai[i + 1].age) && (pai[i + 1].age >= 60)) {\n        temp = pai[i];\n        pai[i] = pai[i + 1];\n        pai[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pai[i].num);\n  return 0;\n}\n"}
{"label": "9", "index": "15735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char m[10];\n    int a;\n  };\n  struct pa p[100], t, s = {\"0\", 0}, pp[100];\n  int n, i, j = 0, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &p[i].m, &p[i].a);\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    t = s;\n    k = 100;\n    for (i = 0; i < n; i++) {\n      if (p[i].a >= 60 && p[i].a > t.a) {\n        t = p[i];\n        k = i;\n      }\n    }\n    pp[j] = t;\n    p[k] = s;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].a < 60 && p[i].a > 0) {\n      pp[j] = p[i];\n      j++;\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pp[i].m);\n  return 0;\n}\n"}
{"label": "9", "index": "15736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, x, i;\n  int age[100];\n  char c[10], num[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i] >> age[i];\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60)\n\n      for (x = i; x > 0; x--)\n        if (age[x] > age[x - 1]) {\n          t = age[x];\n          age[x] = age[x - 1];\n          age[x - 1] = t;\n          strcpy(c, num[x]);\n          strcpy(num[x], num[x - 1]);\n          strcpy(num[x - 1], c);\n        }\n  for (i = 0; i < n; i++)\n    cout << num[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} p[100], old[100], temp;\nint main() {\n  int i, j, n, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i].id);\n    scanf(\"%d\", &p[i].age);\n    if (p[i].age >= 60) {\n      old[count] = p[i];\n      count++;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    for (j = 0; j < count - i; j++) {\n      if (old[j + 1].age > old[j].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, year;\n  char old[150][100] = {0}, id[100][100] = {0}, id0[100] = {0},\n       huiche[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id0, &year);\n    if (year >= 60) {\n      if (old[year][0] == 0) {\n        strcpy(old[year], id0);\n      } else {\n        huiche[0] = 13;\n        huiche[1] = 0;\n        strcat(old[year], huiche);\n        strcat(old[year], id0);\n      }\n    } else {\n      strcpy(id[i], id0);\n    }\n  }\n  for (i = 149; i >= 0; i--) {\n    if (old[i][0] != 0) {\n      printf(\"%s\\n\", old[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (id[i] != 0) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int o[100], n, i, j, s[100], b = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &o[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] >= 60) {\n      s[b] = o[i];\n      b++;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = b - 1; j > i; j--) {\n      if (s[j] > s[j - 1]) {\n        t = s[j];\n        s[j] = s[j - 1];\n        s[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < b - 1; i++) {\n    if (s[i] == s[i + 1])\n      s[i] = -1;\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < n; j++) {\n      if (o[j] == s[i])\n        cout << id[j] << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] < 60)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } all[100], old[100], temp;\n  int n, j = 0, k, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", all[i].id, &all[i].a);\n    if (all[i].a >= 60) {\n      old[j] = all[i];\n      j = j + 1;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (old[k].a < old[k + 1].a) {\n        temp = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << old[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (all[i].a < 60)\n      printf(\"%s\\n\", all[i].id);\n  }\n}\n"}
{"label": "9", "index": "15741", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, b[100], d[100], j = 0, k, l, t, i;\n  cin >> n;\n  char a[n][10], c[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      d[k] = b[i];\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  l = k;\n  char r[10];\n  for (k = 0; k < l - 1; k++) {\n    for (j = 0; j < l - 1 - k; j++)\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(r, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], r);\n      }\n  }\n  for (j = 0; j < l; j++) {\n    printf(\"%s \", c[j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "9", "index": "15742", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  char id[10];\n  int age;\n} ill[100];\n\nint main() {\n  int i, j, n, q;\n  char p[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &ill[i].id, &ill[i].age);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = n - 1; i > j; i--) {\n      if (ill[i].age >= 60 && ill[i].age > ill[i - 1].age) {\n        strcpy(p, ill[i].id);\n        q = ill[i].age;\n        strcpy(ill[i].id, ill[i - 1].id);\n        ill[i].age = ill[i - 1].age;\n        strcpy(ill[i - 1].id, p);\n        ill[i - 1].age = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ill[i].id);\n}\n"}
{"label": "9", "index": "15743", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct data {\n    int age;\n    char id[10];\n  } o[101], y[101], tmp;\n  int no = 0, ny = 0;\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> tmp.id >> tmp.age;\n    if (tmp.age >= 60) {\n      o[no] = tmp;\n      no++;\n    } else {\n      y[ny] = tmp;\n      ny++;\n    }\n  }\n  for (i = no - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (o[j].age < o[j + 1].age) {\n        o[100] = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = o[100];\n      }\n    }\n  }\n  for (i = 0; i < no; i++) {\n    cout << o[i].id << endl;\n  }\n  for (i = 0; i < ny; i++)\n    cout << y[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "15744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int j;\n  struct client {\n    char num[11];\n    int age;\n  };\n  struct client line[100];\n  struct client temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &line[i].num, &line[i].age);\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (line[j].age >= 60 && line[j + 1].age >= 60) {\n        if (line[j].age < line[j + 1].age) {\n          temp = line[j];\n          line[j] = line[j + 1];\n          line[j + 1] = temp;\n        }\n      }\n      if (line[j].age < 60 && line[j + 1].age >= 60) {\n        temp = line[j];\n        line[j] = line[j + 1];\n        line[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << line[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15745", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct BING {\n  char id[10];\n  int old;\n} bing[100], temp;\nint main() {\n  int i, j, k, n, p, max;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", bing[i].id, &bing[i].old);\n\n  for (p = 0;; p++) {\n    max = -1;\n    for (i = 0; i < n; i++) {\n      if (bing[i].old > max && bing[i].old >= 60) {\n        max = bing[i].old;\n        k = i;\n      }\n    }\n    if (max >= 60) {\n      printf(\"%s\\n\", bing[k].id);\n      bing[k].old = -1;\n    }\n    if (max < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].old < 60 && bing[i].old >= 0)\n      printf(\"%s\\n\", bing[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k, l;\n  struct patient {\n    char num[10];\n    int age;\n  } p[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    do {\n      scanf(\"%c\", &p[i].num[j]);\n      j++;\n    } while (p[i].num[j - 1] != ' ');\n    p[i].num[j - 1] = '\\0';\n    scanf(\"%d\", &p[i].age);\n    j = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (p[j].age > p[k].age)\n        k = j;\n    if (k != i && p[k].age >= 60) {\n      temp = p[k];\n      for (l = k; l >= i + 1; l--)\n        p[l] = p[l - 1];\n\n      p[i] = temp;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].num);\n    if (i != n - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15747", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, x, k;\n  char a[100][100], b[100], c[100], d[100][100], e[100], f[100][100], s[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n        strcpy(s, d[j]);\n        strcpy(d[j], d[j + 1]);\n        strcpy(d[j + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      e[m] = b[i];\n      strcpy(f[m], a[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "15748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int m, n;\n\n  int a[101], b[101];\n\n  char c[101][11], d[101][11];\n\n  int i, j, k;\n\n  int ni, nj, nk;\n\n  char ci[11], cj[11], ck[11];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", c[i]);\n    strcpy(d[i], c[i]);\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] < a[j + 1]) {\n        ni = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = ni;\n        strcpy(ci, c[j + 1]);\n        strcpy(c[j + 1], c[j]);\n        strcpy(c[j], ci);\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60)\n      printf(\"%s\\n\", c[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] < 60) {\n      printf(\"%s\\n\", d[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  char a[100][10], over[100][10], below[100][10];\n\n  long int b[100];\n  long int c[100] = {0};\n  long int d[100] = {0};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= 60) {\n      c[i] = b[i];\n      strcpy(over[i], a[i]);\n    } else {\n      d[i] = b[i];\n      strcpy(below[i], a[i]);\n    }\n  }\n  for (k = 101; k >= 60; k--) {\n    i = 1;\n    while (i <= n) {\n      if (c[i] == k) {\n        printf(\"%s\\n\", over[i]);\n      }\n      i++;\n    }\n  }\n  i = 1;\n  while (i <= n) {\n    if (d[i] != 0)\n      printf(\"%s\\n\", below[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, e, n, i, j, k, a[101], b[101], c[101];\n  char ex[11], s[101][11], s1[101][11], s2[101][11];\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      strcpy(s1[j], s[i]);\n      b[j] = a[i];\n      j++;\n    } else {\n      strcpy(s2[k], s[i]);\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (m = 1; m <= j; m++) {\n    for (i = 0; i < j - m; i++) {\n      if (b[i] < b[i + 1]) {\n        strcpy(ex, s1[i]);\n        strcpy(s1[i], s1[i + 1]);\n        strcpy(s1[i + 1], ex);\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", s1[i]);\n\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", s2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, b[100], d[100], j = 0, k, l, t, i;\n  scanf(\"%d\", &n);\n  char a[n][10], c[n][10]; \n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      d[k] = b[i];\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  l = k;                      \n  char r[10];                 \n  for (k = 0; k < l - 1; k++) \n  {\n    for (j = 0; j < l - 1 - k; j++)\n      if (d[j] < d[j + 1]) \n      {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(r, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], r);\n      }\n  }\n  for (j = 0; j < l; j++) {\n    printf(\"%s \", c[j]); \n  }\n  for (i = 0; i < n; i++) \n  {\n    if (b[i] < 60)\n      printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "9", "index": "15752", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pa {\n  char num[15];\n  int age;\n  struct pa *next;\n};\nint main() {\n  struct pa *p, *p1, *p2;\n  int i = 0, n;\n  cin >> n;\n  p1 = (struct pa *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->age);\n  p1->next = NULL;\n  p2 = p1;\n  p = p2;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      while (p2->next != NULL)\n        p2 = p2->next;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      if (p->age < p1->age) {\n        p1->next = p;\n        p = p1;\n      } else {\n        while (p2->next != NULL && (p2->next)->age >= p1->age)\n          p2 = p2->next;\n        p1->next = p2->next;\n        p2->next = p1;\n      }\n    }\n    p2 = p;\n  }\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *sort(struct patient *head, char d[10], int a) {\n  struct patient *pp, *p, *s;\n  p = head;\n  pp = p;\n  p = p->next;\n  s = (struct patient *)malloc(1000);\n  strcpy(s->id, d);\n  s->age = a;\n  while (p != NULL && p->age >= a) {\n    pp = p;\n    p = p->next;\n  }\n  s->next = p;\n  pp->next = s;\n}\n\nstruct patient *creat(struct patient *hhead, char d[10], int a) {\n  struct patient *p, *pp, *s;\n  p = hhead;\n  pp = p;\n  p = p->next;\n  while (p != NULL) {\n    pp = p;\n    p = p->next;\n  }\n  s = (struct patient *)malloc(1000);\n  s->age = a;\n  strcpy(s->id, d);\n  s->next = p;\n  pp->next = s;\n}\n\nint main() {\n  struct patient *head, *hhead, *p1, *p2;\n  int n, a, i;\n  char d[10];\n  scanf(\"%d\", &n);\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  hhead = (struct patient *)malloc(1000);\n  hhead->next = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d \", d, &a);\n    if (a >= 60)\n      sort(head, d, a);\n    else\n      creat(hhead, d, a);\n  }\n  p1 = head->next;\n  p2 = hhead->next;\n  while (p1 != NULL) {\n    cout << p1->id << \" \";\n    p1 = p1->next;\n  }\n  while (p2 != NULL) {\n    printf(\"%s \", p2->id);\n    p2 = p2->next;\n  }\n}\n"}
{"label": "9", "index": "15754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100] = {0}, t, sum = 0;\n  char s[100][10], sb[100][10], st[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], a + i);\n    if (a[i] >= 60) {\n      c[i] = 1, b[sum] = a[i], strcpy(sb[sum], s[i]), sum++;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    for (j = 0; j < sum - i; j++)\n      if (b[j] < b[j + 1])\n        t = b[j], b[j] = b[j + 1], b[j + 1] = t, strcpy(st, sb[j]),\n        strcpy(sb[j], sb[j + 1]), strcpy(sb[j + 1], st);\n  for (i = 0; i < sum; i++)\n    printf(\"%s\\n\", sb[i]);\n  for (i = 0; i < n; i++)\n    if (c[i] == 0)\n      printf(\"%s\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p1, *p2;\n  p2 = p1 = (struct patient *)malloc(1000);\n  head = p1;\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j, n;\n  char a[10];\n  scanf(\"%d\", &n);\n  struct patient *h, *q, *p;\n  h = creat(n);\n  for (i = 0; i < n; i++)\n    for (q = h; q->next != NULL; q = q->next)\n      if (q->next->age >= 60 && q->next->age > q->age) {\n        strcpy(a, q->ID);\n        strcpy(q->ID, q->next->ID);\n        strcpy(q->next->ID, a);\n        j = q->age;\n        q->age = q->next->age;\n        q->next->age = j;\n      }\n  for (p = h; p != NULL; p = p->next)\n    cout << p->ID << \" \";\n}\n"}
{"label": "9", "index": "15756", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char num[11];\n    int age;\n  } pat[101], t;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].num >> pat[i].age;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((pat[j].age < 60 && pat[j + 1].age >= 60) ||\n          (pat[j].age >= 60 && pat[j + 1].age > pat[j].age)) {\n        t = pat[j];\n        pat[j] = pat[j + 1];\n        pat[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, age[100], oage[100];\n  char ID[100][10], old[100][10], young[100][10];\n  scanf(\"%d\", &n);\n  int i, m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", ID[i], &age[i]);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[k], ID[i]);\n      k++;\n    } else {\n      oage[j] = age[i];\n      strcpy(old[j], ID[i]);\n      j++;\n    }\n  }\n  for (i = 150; i >= 60; i--) {\n    for (m = 0; m < j; m++) {\n      if (oage[m] == i) {\n        printf(\"%s\\n\", old[m]);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k, l;\n  struct patient {\n    char num[10];\n    int age;\n  } p[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    do {\n      scanf(\"%c\", &p[i].num[j]);\n      j++;\n    } while (p[i].num[j - 1] != ' ');\n    p[i].num[j - 1] = '\\0';\n    scanf(\"%d\", &p[i].age);\n    j = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (p[j].age > p[k].age)\n        k = j;\n    if (k != i && p[k].age >= 60) {\n      temp = p[k];\n      for (l = k; l >= i + 1; l--) {\n        p[l] = p[l - 1];\n      }\n      p[i] = temp;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].num);\n    if (i != n - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct p {\n    char id[10];\n    int age;\n  } a[n], b[n], c[n], d;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = 0; l < j - 1 - i; l++)\n      if (b[l].age < b[l + 1].age) {\n        d = b[l];\n        b[l] = b[l + 1];\n        b[l + 1] = d;\n      }\n  for (i = 0; i < j; i++)\n    cout << b[i].id << \"\\n\";\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "15760", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pa {\n  char name[10];\n  int age;\n  struct pa *next;\n};\n\nvoid sort(struct pa *head, struct pa *s) {\n  struct pa *p1, *p2;\n  p1 = head->next;\n  p2 = head;\n  while (p1 && p1->age >= s->age) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nvoid creat(struct pa *head, struct pa *s) {\n  struct pa *p2, *p1;\n  p1 = head->next;\n  p2 = head;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nstruct pa *input() {\n  int i, n;\n  struct pa *s, *head1, *head2, *p1, *p2;\n  head1 = (struct pa *)malloc(1000);\n  head2 = (struct pa *)malloc(1000);\n  head1->next = NULL;\n  head2->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", s->name, &s->age);\n    if (s->age >= 60)\n      sort(head1, s);\n    else\n      creat(head2, s);\n  }\n  p1 = head1->next;\n  p2 = head1;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = head2->next;\n  return (head1);\n}\n\nvoid print(struct pa *head) {\n  struct pa *p;\n  p = head->next;\n  while (p) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  struct pa *head;\n  head = input();\n  print(head);\n}\n"}
{"label": "9", "index": "15761", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100];\n  cin >> n;\n  char zf[100][10], id[10];\n  int i, k, e = 0;\n  for (i = 0; i < n; i++)\n    cin >> zf[i] >> (sz[i]);\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i + 1] >= 60 && sz[i + 1] > sz[i]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n        strcpy(id, zf[i]);\n        strcpy(zf[i], zf[i + 1]);\n        strcpy(zf[i + 1], id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} young[100], old[100];\n\nint main() {\n  int i, j, n, temp, yn = 0, on = 0, people[150] = {0};\n  char t[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t >> temp;\n    if (temp >= 60) {\n      strcat(old[on].id, t);\n      old[on].age = temp;\n      on++;\n      people[temp]++;\n    } else {\n      strcat(young[yn].id, t);\n      young[yn].age = temp;\n      yn++;\n    }\n  }\n  for (i = 149; i >= 60; i--) {\n    if (people[i] > 0) {\n      for (j = 0; j < on; j++)\n        if (old[j].age == i)\n          printf(\"%s\\n\", old[j].id);\n    }\n  }\n  for (i = 0; i < yn; i++)\n    cout << young[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "15763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[200], t;\n  char b[200][11], b1[11];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &b[i], &a[i]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (a[j + 1] >= 60 && a[j] < a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n        strcpy(b1, b[j]);\n        strcpy(b[j], b[j + 1]);\n        strcpy(b[j + 1], b1);\n      }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", b[i]);\n}\n"}
{"label": "9", "index": "15764", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } * p, *p60_up, *p60_low, t;\n\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &(p[i].id));\n    cin >> (p[i].age);\n  }\n  for (i = 0; i <= n; i++) {\n    if (p[i].age >= 60) {\n      k++;\n    }\n  }\n  p60_up = (struct patient *)malloc(sizeof(struct patient) * k);\n  p60_low = (struct patient *)malloc(sizeof(struct patient) * (n - k));\n\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      p60_up[j] = p[i];\n      j++;\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      p60_low[j] = p[i];\n      j++;\n    }\n  }\n  for (j = 1; j <= k; j++) {\n    for (i = 0; i < k - j; i++) {\n      if (p60_up[i].age < p60_up[i + 1].age) {\n        t = p60_up[i + 1];\n        p60_up[i + 1] = p60_up[i];\n        p60_up[i] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    puts(p60_up[i].id);\n  }\n  free(p60_up);\n  for (i = 0; i < n - k; i++) {\n    puts(p60_low[i].id);\n  }\n  free(p60_low);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct patient {\n    char name[16];\n    int age;\n  };\n  struct patient p[n];\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n  struct patient q[n];\n  for (i = 0, j = 0; i < n; i++)\n    if (p[i].age >= 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  int k, t;\n  char s[16];\n  for (k = 0; k < j; k++) {\n    for (i = 0; i < j - k - 1; i++)\n      if (q[i].age < q[i + 1].age)\n        strcpy(s, q[i].name), strcpy(q[i].name, q[i + 1].name),\n            strcpy(q[i + 1].name, s), t = q[i].age, q[i].age = q[i + 1].age,\n                                      q[i + 1].age = t;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  for (i = 0; i < n; i++)\n    puts(q[i].name);\n  putchar('\\n');\n}\n"}
{"label": "9", "index": "15766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ID {\n  char idnum[100];\n  int old;\n};\nint main() {\n  struct ID ido[100];\n  struct ID idy[100];\n  struct ID id[100];\n  struct ID e;\n  int n, i, a = 0, b = 0, j, l, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i].idnum, &(id[i].old));\n    if (id[i].old >= 60) {\n      strcpy(ido[a].idnum, id[i].idnum);\n      ido[a].old = id[i].old;\n      a++;\n    } else {\n      strcpy(idy[b].idnum, id[i].idnum);\n      idy[b].old = id[i].old;\n      b++;\n    }\n  }\n\n  for (k = 1; k <= a; k++) {\n    for (i = 0; i < a - k; i++) {\n      if (ido[i].old < ido[i + 1].old) {\n        e = ido[i + 1];\n        ido[i + 1] = ido[i];\n        ido[i] = e;\n      }\n    }\n  }\n\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", ido[j].idnum);\n  }\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", idy[l].idnum);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15767", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} grp1[100], grp2[100], grp3[100];\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &grp1[i].No, &grp1[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    grp2[i].age = -1;\n    grp3[i].age = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (grp1[i].age >= 60) {\n      strcpy(grp2[i].No, grp1[i].No);\n      grp2[i].age = grp1[i].age;\n    }\n    if (grp1[i].age < 60) {\n      strcpy(grp3[i].No, grp1[i].No);\n      grp3[i].age = grp1[i].age;\n    }\n  }\n  char y[10];\n  int x;\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < n - k; m++) {\n      if (grp2[m].age < grp2[m + 1].age) {\n        x = grp2[m + 1].age;\n        grp2[m + 1].age = grp2[m].age;\n        grp2[m].age = x;\n        strcpy(y, grp2[m + 1].No);\n        strcpy(grp2[m + 1].No, grp2[m].No);\n        strcpy(grp2[m].No, y);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (grp2[i].age != -1)\n      printf(\"%s\\n\", grp2[i].No);\n  }\n  for (i = 0; i < n; i++) {\n    if (grp3[i].age != -1)\n      printf(\"%s\\n\", grp3[i].No);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bin {\n  char ID[10];\n  int age;\n  struct bin *next;\n};\nint main() {\n  struct bin *head, *p, *p1, *p2, *p3;\n  int m, n, i, j, k;\n  scanf(\"%d\", &n);\n  p = (struct bin *)malloc(sizeof(struct bin));\n  scanf(\"%s%d\", &p->ID, &p->age);\n  head = p3 = p;\n  p->next = 0;\n  for (i = 1; i < n; i++) {\n    p = (struct bin *)malloc(sizeof(struct bin));\n    scanf(\"%s%d\", &p->ID, &p->age);\n    if (p->age < 60) {\n      p3->next = p;\n      p->next = 0;\n      p3 = p;\n    } else {\n      if (p->age > head->age) {\n        p->next = head;\n        head = p;\n      } else if (p->age <= p3->age) {\n        p3->next = p;\n        p->next = 0;\n        p3 = p;\n      } else {\n        p1 = head;\n        p2 = p1->next;\n        while (p2->age >= p->age) {\n          p1 = p1->next;\n          p2 = p2->next;\n        }\n        p1->next = p;\n        p->next = p2;\n      }\n    }\n  }\n  for (; head != 0; head = head->next) {\n    printf(\"%s\\n\", head->ID);\n  }\n}\n"}
{"label": "9", "index": "15769", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  int a6;\n  char Id[10];\n};\n\nint main() {\n  struct patient bin[1000];\n  int n, mid;\n  char s[10];\n  int i = 0, j = 0, k = 0;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &bin[i].ID, &bin[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age >= 60) {\n      bin[j].a6 = bin[i].age;\n      strcpy(bin[j].Id, bin[i].ID);\n      j++;\n      bin[i].age = 0;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++)\n      if (bin[i].a6 < bin[i + 1].a6) {\n        mid = bin[i].a6;\n        bin[i].a6 = bin[i + 1].a6;\n        bin[i + 1].a6 = mid;\n\n        strcpy(c, bin[i].Id);\n        strcpy(s, bin[i + 1].Id);\n        strcpy(bin[i + 1].Id, c);\n        strcpy(bin[i].Id, s);\n      }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", bin[i].Id);\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age != 0)\n      printf(\"%s \", bin[i].ID);\n  }\n}\n"}
{"label": "9", "index": "15770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, m, k, f, j;\n  char e[10];\n  m = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(e, pat[i].num);\n      f = pat[i].age;\n      for (k = i; k > m; k--) {\n        strcpy(pat[k].num, pat[k - 1].num);\n      }\n      strcpy(pat[m].num, e);\n      pat[m].age = f;\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < i; k++) {\n      if (pat[i].age > pat[k].age) {\n        f = pat[i].age;\n        strcpy(e, pat[i].num);\n        for (j = i; j > k; j--) {\n          pat[j].age = pat[j - 1].age;\n          strcpy(pat[j].num, pat[j - 1].num);\n        }\n        pat[k].age = f;\n        strcpy(pat[k].num, e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int n, j = 0, i, num = 0, t;\n  char a[100][10], d[100][10], temp[10];\n  int b[100], c[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[j] = b[i];\n      strcpy(d[j], a[i]);\n      j++;\n      num = j;\n    }\n  }\n  for (i = 1; i < num; i++)\n    for (j = 0; j < num - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = t;\n        strcpy(temp, d[j + 1]);\n        strcpy(d[j + 1], d[j]);\n        strcpy(d[j], temp);\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      c[num] = b[i];\n      strcpy(d[num], a[i]);\n      num++;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    cout << d[j] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i, j, lao = 0, you = 0, t;\n  char e[100][10], f[100][10], g[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", e[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[lao] = a[i];\n      strcpy(f[lao], e[i]);\n      lao++;\n    } else {\n      c[you] = a[i];\n      strcpy(g[you], e[i]);\n      you++;\n    }\n  }\n  for (j = 0; j < lao - 1; j++) {\n    for (i = 0; i < lao - 1; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(s, f[i]);\n        strcpy(f[i], f[i + 1]);\n        strcpy(f[i + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < lao; i++)\n    cout << f[i] << \"\\n\";\n  for (i = 0; i < you; i++)\n    cout << g[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100];\n  char id[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[10];\n  for (int k = 1; k <= n; k++) {\n    for (int m = 0; m < n - k; m++) {\n      if ((age[m] >= 60 && age[m + 1] >= 60 && age[m] < age[m + 1]) ||\n          (age[m] < 60 && age[m + 1] >= 60)) {\n        e = age[m + 1];\n        strcpy(e_id, id[m + 1]);\n        age[m + 1] = age[m];\n        strcpy(id[m + 1], id[m]);\n        age[m] = e;\n        strcpy(id[m], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15774", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int n, age[100], i, k = 0, m, len, p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(id[i]), &(age[i]));\n  }\n  char e[100][10], kong[10];\n  int xin[100];\n  for (i = 0; i < n; i++) {\n    if (age[i] > 59) {\n      xin[k] = age[i];\n      strcpy(e[k], id[i]);\n      k++;\n    }\n  }\n  len = k;\n  for (m = 1; m <= len; m++) {\n    for (k = 0; k < len - m; k++) {\n      if (xin[k] < xin[k + 1]) {\n        p = xin[k];\n        strcpy(kong, e[k]);\n        xin[k] = xin[k + 1];\n        strcpy(e[k], e[k + 1]);\n        xin[k + 1] = p;\n        strcpy(e[k + 1], kong);\n      }\n    }\n  }\n  for (k = 0; k < len; k++) {\n    printf(\"%s\\n\", e[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15775", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, j, k = 0, a, b, c, winnum = 0, win = 2, year;\n  char old[150][100] = {0}, id[100][100] = {0}, id0[100] = {0},\n       huiche[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id0, &year);\n    if (year >= 60) {\n      if (old[year][0] == 0) {\n        strcpy(old[year], id0);\n      } else {\n        huiche[0] = 13;\n        huiche[1] = 0;\n        strcat(old[year], huiche);\n        strcat(old[year], id0);\n      }\n    } else {\n      strcpy(id[i], id0);\n    }\n  }\n  for (i = 149; i >= 0; i--) {\n    if (old[i][0] != 0) {\n      printf(\"%s\\n\", old[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (id[i] != 0) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15776", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n};\n\nint main() {\n  int i, n, k = 0;\n  struct data *p1, *p2, *head;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  print(head);\n  return 0;\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  printf(\"%s \", code->id);\n\n  if (pre == head) {\n    head->next = code->next;\n  } else\n    pre->next = code->next;\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *head) {\n  struct data *p;\n  p = head->next;\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "15777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pa[101], que[101], tran;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, old = 0;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> pa[i].id >> pa[i].age;\n    if (pa[i].age >= 60) {\n      que[j] = pa[i];\n      old += 1;\n      j++;\n    }\n  }\n  for (i = 1; i <= old - 1; i++) {\n    for (j = 1; j <= old - i; j++) {\n      if (que[j].age < que[j + 1].age) {\n        tran = que[j];\n        que[j] = que[j + 1];\n        que[j + 1] = tran;\n      }\n    }\n  }\n  j = old + 1;\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age < 60) {\n      que[j] = pa[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << que[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d\", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      } else if (se[i] == se[j] && list[i] > list[j]) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  for (i = 0; i <= nums; i++) {\n    \n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct a {\n  char id[100];\n  int year;\n} p[100];\nint main() {\n  int n, i, j, k, t = 0, r = 0;\n  int a[200] = {0};\n  scanf(\"%d\", &n);\n  struct a b[100];\n  struct a c[100];\n  struct a temp;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].year);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year >= 60) {\n      b[t] = p[i];\n      t++;\n    }\n  }\n  for (i = 0; i <= t - 1; i++) {\n    a[b[i].year]++;\n  }\n  for (i = 200; i >= 60; i--) {\n    if (a[i] > 0) {\n      for (j = 0; j <= t - 1; j++) {\n        if (b[j].year == i) {\n          c[r] = b[j];\n          r++;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= t - 1; i++) {\n    cout << c[i].id << \"\\n\";\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year < 60) {\n      cout << p[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100], zs[100], i, k = 0, m, a;\n  char id[100][10], di[100][10], zfc[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      zs[k] = sz[i];\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (m = 0; m < k - 1; m++) {\n    for (i = 0; i < k - 1 - m; i++) {\n      if (zs[i] < zs[i + 1]) {\n        a = zs[i];\n        zs[i] = zs[i + 1];\n        zs[i + 1] = a;\n        strcpy(zfc, di[i]);\n        strcpy(di[i], di[i + 1]);\n        strcpy(di[i + 1], zfc);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", di[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} grp1[100], grp2[100], grp3[100];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &grp1[i].No, &grp1[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    grp2[i].age = -1;\n    grp3[i].age = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (grp1[i].age >= 60) {\n      strcpy(grp2[i].No, grp1[i].No);\n      grp2[i].age = grp1[i].age;\n    }\n    if (grp1[i].age < 60) {\n      strcpy(grp3[i].No, grp1[i].No);\n      grp3[i].age = grp1[i].age;\n    }\n  }\n  char y[10];\n  int x;\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < n - k; m++) {\n      if (grp2[m].age < grp2[m + 1].age) {\n        x = grp2[m + 1].age;\n        grp2[m + 1].age = grp2[m].age;\n        grp2[m].age = x;\n        strcpy(y, grp2[m + 1].No);\n        strcpy(grp2[m + 1].No, grp2[m].No);\n        strcpy(grp2[m].No, y);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (grp2[i].age != -1)\n      printf(\"%s\\n\", grp2[i].No);\n  }\n  for (i = 0; i < n; i++) {\n    if (grp3[i].age != -1)\n      printf(\"%s\\n\", grp3[i].No);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } pa[100] = {0}, old[100] = {0}, young[100] = {0}, t;\n  int i, j, k = 0, l = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].id >> pa[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      old[k] = pa[i];\n      k++;\n    } else {\n      young[l] = pa[i];\n      l++;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        t = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n}\n"}
{"label": "9", "index": "15783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct peo {\n    char num[10];\n    int old;\n    struct peo *next;\n  };\n  struct peo *p, *p1, *p2, *p3, *head1, *head2, *head3;\n  int n, i, j, k;\n  p = p1 = p2 = p3 = head1 = head2 = head3 = (struct peo *)malloc\n\n      (sizeof(struct peo));\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &p1->num, &p1->old);\n    if (i == 1)\n      head1 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct peo *)malloc(sizeof(struct peo));\n  }\n  for (i = 1; i <= n; i++) {\n    p1 = head1;\n    p2 = head1;\n    for (j = 1; j <= (n + 1 - i); j++) {\n      if (p1->old > p2->old && p1->old >= 60) {\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    if (i == 1)\n      head2 = p2;\n    else\n      p->next = p2;\n    p = p2;\n    p1 = head1;\n    p3 = head1;\n    for (j = 1; j <= (n - i + 1); j++) {\n      if (p1->num == p2->num) {\n        if (j == 1)\n          head1 = p1->next;\n        else\n          p3->next = p1->next;\n      }\n      p3 = p1;\n      p1 = p1->next;\n    }\n  }\n  p = head2;\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15784", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct rat {\n  char num[11];\n  int age;\n  struct rat *next;\n};\n\nint n;\n\nstruct rat *creat(void) {\n  struct rat *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct rat *)malloc(1000);\n  head = p1;\n  scanf(\"%s%d\", p1->num, &p1->age);\n  for (i = 2; i <= n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct rat *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct rat *sort(struct rat *head, int count) {\n  struct rat *p1, *p2, *p3, *temp;\n  int i, j;\n  for (j = 1; j <= count - 1; j++) {\n    p1 = head;\n    p2 = p1->next;\n    p3 = p2;\n    for (i = 0; i < count - j; i++) {\n      if (p1->age < p2->age) {\n        temp = p2->next;\n        p2->next = p1;\n        p1->next = temp;\n        if (i == 0) {\n          head = p2;\n          p2 = temp;\n        } else {\n          p3->next = p2;\n          p3 = p2;\n          p2 = temp;\n        }\n      } else {\n        if (i == 0) {\n          p3 = head = p1;\n          p1 = p1->next;\n          p2 = p2->next;\n        } else {\n          p1 = p1->next;\n          p2 = p2->next;\n          p3 = p3->next;\n        }\n      }\n    }\n  }\n  return (head);\n}\n\nstruct rat *del(struct rat *head, int t) {\n  struct rat *p1, *p2;\n  int i;\n  p1 = head;\n  for (i = 1; i <= t; i++) {\n    if (p1->age < 60) {\n      if (i == 1)\n        head = p1;\n      p2 = p1;\n      p1 = p1->next;\n      continue;\n    }\n    if (p1->age >= 60) {\n      if (i == 1) {\n        head = p1->next;\n        break;\n      }\n      p2->next = p1->next;\n      break;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct rat *head, *p1, *s, *p2, *p3;\n  int i, count = 0, t;\n  scanf(\"%d\", &n);\n  t = n;\n  head = creat();\n  p1 = head;\n  p3 = p2 = (struct rat *)malloc(1000);\n  for (i = 1; i <= n; i++) {\n    if (p1->age >= 60) {\n      if (count == 0)\n        s = p2;\n      p2->age = p1->age;\n      strcpy(p2->num, p1->num);\n      p3->next = p2;\n      p3 = p2;\n      p2 = (struct rat *)malloc(1000);\n      count++;\n    }\n    p1 = p1->next;\n  }\n  s = sort(s, count);\n  for (i = 1; i <= count; i++) {\n    head = del(head, t);\n    t = t - 1;\n  }\n  p1 = s;\n  for (i = 1; i <= count; i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i <= (n - count); i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15785", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct man {\n  char id[20];\n  int a;\n  struct man *next;\n} * p, *head, *q;\n\nint main() {\n\n  struct man *insert(struct man * head, struct man * ill);\n  int n, i;\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct man *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->a);\n    head = insert(head, p);\n  }\n\n  q = head;\n  while (q != NULL) {\n    printf(\"%s \", q->id);\n    q = q->next;\n  }\n}\n\nstruct man *insert(struct man *head, struct man *ill) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = ill;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->a < 60) {\n      while (p1->next != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p1->next = p0;\n      p0->next = NULL;\n    }\n\n    else if (p0->a >= 60) {\n      while ((p0->a <= p1->a) && (p1->next != NULL)) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->a > p1->a) {\n        if (head == p1)\n          head = p0;\n        else\n          p2->next = p0;\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\n"}
{"label": "9", "index": "15786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100] = {0}, c[100] = {0}, d[100] = {0}, e[100] = {0};\n  char a[100][100];\n  for (i = 0; i < 100; i++)\n    b[i] = i;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &c[i]);\n    if (c[i] > 59) {\n      d[i] = c[i];\n    } else {\n      e[i] = c[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (d[b[j]] < d[b[j + 1]]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (d[b[i]] > 0) {\n      cout << a[b[i]] << \"\\n\";\n    } else {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (e[i] != 0) {\n      cout << a[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], c[100], m = 0, e[100], k = 0, x;\n  char b[100][10], d[100][10], f[100][10], y[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i], &a[i]);\n    if (a[i] >= 60) {\n      c[m] = a[i];\n      strcpy(d[m], b[i]);\n      m++;\n    } else {\n      e[k] = a[i];\n      strcpy(f[k], b[i]);\n      k++;\n    }\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (c[i] < c[i + 1]) {\n        x = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = x;\n        strcpy(y, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], y);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", d[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "15788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, stu[2000][3], t[3], hao;\n  char ID[20000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ID[i], &stu[i][1]);\n  for (i = 0; i < n; i++) {\n    stu[i][0] = atoi(ID[i]);\n    stu[i][2] = i;\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[j][1] <= stu[i][1]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = n - 1; i >= 0; i--) {\n    if (stu[i][1] >= 60) {\n\n      hao = stu[i][2];\n\n      printf(\"%s\\n\", ID[hao]);\n\n      n--;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i][2] > stu[j][2]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    hao = stu[i][2];\n\n    cout << ID[hao] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "15789", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct sick {\n  char name[10];\n  int age;\n};\nint main() {\n  int n, i, count = 0, j;\n  struct sick s[100], a[100], t;\n  char b[3];\n\n  cin >> b;\n  n = atoi(b);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].name, &s[i].age);\n  if (n == 1)\n    printf(\"%s\", s[0].name);\n  else {\n    for (i = 0; i < n; i++)\n      if (s[i].age >= 60) {\n        a[count] = s[i];\n        count++;\n      }\n    for (i = 0; i < count - 1; i++)\n      for (j = 0; j < count - 1 - i; j++)\n        if (a[j].age < a[j + 1].age) {\n          t = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = t;\n        }\n    for (i = 0; i < count; i++)\n      printf(\"%s \", a[i].name);\n    for (i = 0; i < n; i++)\n      if (s[i].age < 60)\n        printf(\"%s \", s[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa { \n  char id[10];\n  int age;\n  int re; \n} p[100], po[100], temp;\nint main() {\n  int n, i, j, pj = 0, oldj = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[pj].id, &p[pj].age);\n    if (p[pj].age >= 60) {\n      po[oldj] = p[pj];\n      po[oldj].re = oldj;\n      oldj++;\n    } else {\n      p[pj].re = pj;\n      pj++;\n    }\n  }\n  for (i = 0; i < oldj - 1; i++) {\n    for (j = i + 1; j < oldj; j++) {\n      if ((po[i].age < po[j].age) ||\n          (po[i].age == po[j].age && po[i].re > po[j].re)) {\n        temp = po[i];\n        po[i] = po[j];\n        po[j] = temp;\n      }\n    }\n    printf(\"%s\\n\", po[i].id);\n  }\n  printf(\"%s\\n\", po[i].id);\n  for (i = 0; i < pj; i++)\n    printf(\"%s\\n\", p[i].id);\n}\n"}
{"label": "9", "index": "15791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nvoid sort(struct patient *head, struct patient *q) {\n  struct patient *pre = head, *p = pre->next, *s;\n  s = (struct patient *)malloc(sizeof(struct patient));\n  s->age = q->age;\n  strcpy(s->ID, q->ID);\n  s->next = NULL;\n  if (q->age >= 60) {\n    while ((p != NULL) && (q->age <= p->age)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head;\n  struct patient *p;\n  head = (struct patient *)malloc(sizeof(struct patient));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p->ID, &p->age);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "15792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, g, m, i, j;\n  int max[100];\n  char s[100][10];\n  struct {\n    char d[10];\n    int a;\n  } p[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].d >> p[i].a;\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60) {\n      m++;\n    }\n  }\n  k = m;\n  for (i = 0; i < n; i++) {\n    if (p[i].a < 60) {\n      strcpy(s[k], p[i].d);\n      k = k + 1;\n    }\n  }\n  g = 0;\n  for (j = 0; j < m; j++) {\n    max[j] = 59;\n    for (i = 0; i < n; i++) {\n      if (p[i].a > max[j]) {\n        max[j] = p[i].a;\n        h = i;\n      }\n    }\n    p[h].a = 59;\n    strcpy(s[g], p[h].d);\n    g++;\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][11], c[100][11];\n  int i, j, n, b[100], m, e = -1, f = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      m = 0;\n      for (j = 0; j < n; j++) {\n        if (b[i] < b[j] || (b[i] == b[j] && i > j)) {\n          m++;\n        }\n      }\n      if (e < m)\n        e = m;\n      strcpy(c[m], a[i]);\n    }\n  }\n  e = e + 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      strcpy(c[i - f + e], a[i]);\n    } else {\n      f++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15794", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, m;\n  int i, j = 0, k = 0;\n  struct patient a[100], b[100], c[100], t[1];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n    if (a[i].age >= 60) {\n      strcpy(b[j].ID, a[i].ID);\n      b[j].age = a[i].age;\n      j = j + 1;\n    } else {\n      strcpy(c[k].ID, a[i].ID);\n      c[k].age = a[i].age;\n      k = k + 1;\n    }\n  }\n  m = j;\n  for (j = 1; j <= m - 1; j++) {\n    for (i = 0; i <= m - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        strcpy(t[0].ID, b[i].ID);\n        t[0].age = b[i].age;\n        strcpy(b[i].ID, b[i + 1].ID);\n        b[i].age = b[i + 1].age;\n        strcpy(b[i + 1].ID, t[0].ID);\n        b[i + 1].age = t[0].age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15795", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 0, k = 0, a, e, f, b;\n  char id[1000][11], ido[1000][11], idy[1000][11], m[11];\n  int nl[1000], nlo[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &nl[i]);\n    if (nl[i] < 60) {\n      strcpy(idy[j], id[i]);\n      j++;\n    }\n    if (nl[i] >= 60) {\n      nlo[k] = nl[i];\n      strcpy(ido[k], id[i]);\n      k++;\n    }\n  }\n  for (a = 1; a <= k; a++) {\n    for (b = 0; b < k - a; b++) {\n      if (nlo[b] < nlo[b + 1]) {\n        e = nlo[b + 1];\n        nlo[b + 1] = nlo[b];\n        nlo[b] = e;\n        strcpy(m, ido[b + 1]);\n        strcpy(ido[b + 1], ido[b]);\n        strcpy(ido[b], m);\n      }\n    }\n  }\n  for (f = 0; f < k; f++)\n    puts(ido[f]);\n\n  for (f = 0; f < j; f++)\n    puts(idy[f]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t;\n  struct ill {\n    char num[10];\n    int age, id;\n  } man[1000], ex;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", man[i].num, &man[i].age);\n    man[i].id = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].age < man[j].age) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (man[i].age < 60) {\n      t = i;\n      break;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = i + 1; j < t; j++) {\n      if (man[i].age == man[j].age && man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = t; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << man[i].num << \" \";\n  }\n  for (i = 0; i < n; i++)\n    ;\n  return 0;\n}\n"}
{"label": "9", "index": "15797", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0, r = 0, e, j;\n  char id[100][10], a[100][10], b[100][10], c[100];\n  int nl[100], am[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> nl[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (nl[i] >= 60) {\n      strcpy(a[m], id[i]);\n      am[m] = nl[i];\n      m++;\n    } else {\n      strcpy(b[r], id[i]);\n\n      r++;\n    }\n  }\n  for (i = m - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (am[j] < am[j + 1]) {\n        e = am[j + 1];\n        am[j + 1] = am[j];\n        am[j] = e;\n        strcpy(c, a[j + 1]);\n        strcpy(a[j + 1], a[j]);\n        strcpy(a[j], c);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    puts(a[i]);\n\n  for (i = 0; i < r; i++)\n    puts(b[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct kb {\n  char ID[10];\n  int nl;\n} kbr[100], lnr[100], ln;\n\nint main() {\n  int n, i, k = 0, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &kbr[i].ID, &kbr[i].nl);\n  }\n  for (i = 0; i < n; i++) {\n    if (kbr[i].nl >= 60) {\n      strcpy(lnr[k].ID, kbr[i].ID);\n      lnr[k].nl = kbr[i].nl;\n      k++;\n      strcpy(kbr[i].ID, \"000000000\");\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (l = 0; l < k - i; l++) {\n      if (lnr[l].nl < lnr[l + 1].nl) {\n        ln = lnr[l + 1];\n        lnr[l + 1] = lnr[l];\n        lnr[l] = ln;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", lnr[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(kbr[i].ID, \"000000000\") == 1) {\n      printf(\"%s\\n\", kbr[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ren {\n  char id[12];\n  int ye;\n  struct ren *next;\n};\nint main() {\n  int n;\n  char c[12];\n  int y;\n  int r;\n  struct ren *p1, *p2, *head;\n  int i;\n  scanf(\"%d\", &n);\n  head = (struct ren *)malloc(sizeof(struct ren));\n  scanf(\"%s %d\", c, &y);\n  strcpy(head->id, c);\n  head->ye = y;\n  head->next = 0;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%s %d\", c, &y);\n    p1 = (struct ren *)malloc(sizeof(struct ren));\n    strcpy(p1->id, c);\n    p1->ye = y;\n    p1->next = 0;\n    if (y < 60) {\n      p2 = head;\n      while (p2->next != 0)\n        p2 = p2->next;\n      p2->next = p1;\n    } else {\n      p2 = head;\n      if (y > p2->ye) {\n        p1->next = head;\n        head = p1;\n      } else {\n        r = 0;\n        while (p2->next != 0) {\n          if (p2->ye >= y && p2->next->ye < y) {\n            r = 1;\n            p1->next = p2->next;\n            p2->next = p1;\n            break;\n          }\n          p2 = p2->next;\n        }\n        if (r == 0) {\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  do {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  } while (p1 != 0);\n}\n"}
{"label": "9", "index": "15800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int w;\n  char c[20];\n  int old;\n  struct data *next;\n  struct data *onext;\n};\nint main() {\n  int i, j, n, max, x;\n  scanf(\"%d\", &n);\n  struct data *head = (struct data *)malloc(sizeof(struct data));\n  struct data *p, *pp, *de;\n  pp = head;\n  for (i = 0; i < n; i++) {\n    p = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%s %d\", p->c, &p->w);\n    p->old = 0;\n    pp->next = p;\n    pp = p;\n  }\n  struct data *old = (struct data *)malloc(sizeof(struct data));\n  pp = head->next;\n  de = old;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    if (pp->w > 59) {\n      pp->old = 1;\n      de->onext = pp;\n      de = pp;\n      x++;\n    }\n    pp = pp->next;\n  }\n\n  for (i = 0; i < x; i++) {\n    pp = old->onext;\n    max = 0;\n    for (j = 0; j < x; j++) {\n      if (pp->w > max) {\n        max = pp->w;\n        de = pp;\n      }\n      pp = pp->onext;\n    }\n    printf(\"%s\\n\", de->c);\n    de->w = -1;\n  }\n  pp = head->next;\n  for (i = 0; i < n; i++) {\n    if (pp->old == 0)\n      printf(\"%s\\n\", pp->c);\n    pp = pp->next;\n  }\n}\n"}
{"label": "9", "index": "15801", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nvoid sort(struct patient *head, struct patient *s) {\n  struct patient *pre = head, *p = pre->next;\n  if (s->age >= 60) {\n    while (p != NULL && s->age <= p->age) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (pre->next != NULL)\n      pre = pre->next;\n    pre->next = s;\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n    sort(head, p);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", &p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15802", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, x[110], k, x2[110];\n  char id[110][20], temp[20], id2[100][20];\n  cin >> n;\n  k = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> id[i] >> x[i];\n    if (x[i] >= 60) {\n      k++;\n      x2[k] = x[i];\n      strcpy(id2[k], id[i]);\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    for (j = k; j > i; j--) {\n      if (x2[j] > x2[j - 1]) {\n        t = x2[j];\n        x2[j] = x2[j - 1];\n        x2[j - 1] = t;\n        strcpy(temp, id2[j]);\n        strcpy(id2[j], id2[j - 1]);\n        strcpy(id2[j - 1], temp);\n      }\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (x[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n} pat[100];\nint main() {\n  int i, k, n, e;\n  int ex[100], ex1[100];\n  i = 0;\n  k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> (pat[i].id) >> (pat[i].age);\n    ex[i] = pat[i].age;\n    ex1[i] = i + 1;\n  }\n  for (k = n - 1; k >= 1; k--) {\n    for (i = n - 1; i >= n - k; i--) {\n      if (ex[i] > ex[i - 1] && ex[i] >= 60) {\n        e = ex[i];\n        ex[i] = ex[i - 1];\n        ex[i - 1] = e;\n        e = ex1[i];\n        ex1[i] = ex1[i - 1];\n        ex1[i - 1] = e;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] >= 60) {\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] < 60) {\n      cout << pat[ex1[i] - 1].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100] = {0}, i, j, k, old[101] = {0}, oldn, youngn;\n  char id[101][20] = {0}, oldid[101][20] = {0}, youngid[101][20] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 1, j = 1, k = 1; i <= n; i++) {\n    if (age[i] >= 60) {\n      old[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      strcpy(youngid[k], id[i]);\n      k++;\n    }\n  }\n  oldn = j;\n  youngn = k;\n  for (i = 1; i <= oldn; i++) {\n    for (j = 1; j <= oldn - i; j++) {\n      if (old[j] < old[j + 1]) {\n        old[100] = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = old[100];\n        strcpy(oldid[101], oldid[j]);\n        strcpy(oldid[j], oldid[j + 1]);\n        strcpy(oldid[j + 1], oldid[101]);\n      }\n    }\n  }\n  for (i = 1; i < oldn; i++)\n    printf(\"%s\\n\", oldid[i]);\n  for (k = 1; k < youngn; k++)\n    printf(\"%s\\n\", youngid[k]);\n  return 0;\n}\n"}
{"label": "9", "index": "15805", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sixty[100];\n  int n, i, j, a;\n  struct patient {\n    char num[11];\n    int age;\n  } peo[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n    if (peo[i].age >= 60) {\n      sixty[i] = peo[i].age;\n\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        a = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = a;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == peo[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", peo[j].num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      printf(\"%s\\n\", peo[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15806", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, n;\n  char a[11];\n  int b;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[11];\n    int age;\n  } pat[100];\n  for (i = 0; i < n; i++)\n    cin >> pat[i].num >> pat[i].age;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (pat[j].age < pat[j + 1].age && pat[j + 1].age >= 60) {\n        for (k = 0; k < 10; k++) {\n          a[k] = pat[j].num[k];\n          pat[j].num[k] = pat[j + 1].num[k];\n          pat[j + 1].num[k] = a[k];\n        }\n\n        b = pat[j].age;\n        pat[j].age = pat[j + 1].age;\n        pat[j + 1].age = b;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int o[100], n, i, j, s[100], b = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &o[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] >= 60) {\n      s[b] = o[i];\n      b++;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = b - 1; j > i; j--) {\n      if (s[j] > s[j - 1]) {\n        t = s[j];\n        s[j] = s[j - 1];\n        s[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < b - 1; i++) {\n    if (s[i] == s[i + 1])\n      s[i] = -1;\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < n; j++) {\n      if (o[j] == s[i])\n        printf(\"%s\\n\", id[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] < 60)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, t = 0;\n\n  struct patient {\n    char str[10];\n    int age;\n  } pat[100], pat2[100], patt;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &pat[i].str, &pat[i].age);\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      pat2[j] = pat[i];\n      j++;\n      t++;\n    }\n\n  for (i = 0; i < t - 1; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (pat2[j + 1].age > pat2[j].age) {\n        patt = pat2[j];\n        pat2[j] = pat2[j + 1];\n        pat2[j + 1] = patt;\n      }\n    }\n  }\n\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", pat2[i].str);\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].str);\n  }\n}\n"}
{"label": "9", "index": "15809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  char num[10];\n  int age;\n  struct people *next;\n};\nint main() {\n  struct people *head, *p0, *p, *s;\n  head = (struct people *)malloc(sizeof(struct people));\n  head->next = NULL;\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p0 = head;\n    p = p0->next;\n    s = (struct people *)malloc(sizeof(struct people));\n    s->next = NULL;\n    scanf(\"%s %d\", s->num, &s->age);\n    while (p != NULL && ((s->age >= 60 && s->age <= p->age) || s->age < 60)) {\n      p0 = p;\n      p = p->next;\n    }\n    p0->next = s;\n    s->next = p;\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, l;\n  scanf(\"%d\", &num);\n  struct inf {\n    char str[10];\n    int age;\n  } infs[101];\n  struct f {\n    char *p1;\n    int m1;\n  } old[101];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d\", infs[i].str, &infs[i].age);\n  }\n  for (i = 0, j = 0; i < num; i++)\n    if (infs[i].age >= 60) {\n      old[j].m1 = infs[i].age;\n      old[j].p1 = infs[i].str;\n      j++;\n    }\n  int end = j;\n  char *k;\n  for (i = 0; i < end - 1; i++) {\n    for (j = 0; j + 1 < end - i; j++)\n      if (old[j].m1 < old[j + 1].m1) {\n        l = old[j].m1;\n        old[j].m1 = old[j + 1].m1;\n        old[j + 1].m1 = l;\n        k = old[j].p1;\n        old[j].p1 = old[1 + j].p1;\n        old[1 + j].p1 = k;\n      }\n  }\n  for (i = 0; i < end; i++)\n    printf(\"%s\\n\", old[i].p1);\n  for (i = 0; i < num; i++)\n    if (infs[i].age < 60)\n      cout << infs[i].str << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15811", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int age[100];\n  char ID[100][11];\n} patient, *ppatient;\nint main() {\n  ppatient = &patient;\n  int n, i, j, k, num, m = 0;\n  char id[11], ID_1[100][11], age_1[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> patient.ID[i] >> patient.age[i];\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] >= 60) {\n      strcpy(ID_1[j], (*ppatient).ID[i]);\n      age_1[j] = (*ppatient).age[i];\n      m += 1;\n      j++;\n    }\n  }\n  for (j = m - 1; j > 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (age_1[k] < age_1[k + 1]) {\n        strcpy(id, ID_1[k + 1]);\n        strcpy(ID_1[k + 1], ID_1[k]);\n        strcpy(ID_1[k], id);\n        num = age_1[k + 1];\n        age_1[k + 1] = age_1[k];\n        age_1[k] = num;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", ID_1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] < 60)\n      printf(\"%s\\n\", (*ppatient).ID[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, n, w, max, old;\n  int q = 0;\n  char d[101][10];\n  int a[101];\n  int b[101];\n  int c[101];\n  cin >> n;\n  old = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n    if (a[i] >= 60) {\n      b[i] = 1;\n      old = old + 1;\n    }\n  }\n\n  for (i = 1; i <= old; i++) {\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      if (b[j] == 1) {\n        if (a[j] > max) {\n          max = a[j];\n          w = j;\n        }\n      }\n    }\n    c[i] = w;\n    b[w] = 2;\n  }\n  for (l = 1; l <= old; l++) {\n    q = c[l];\n    cout << d[q] << \" \";\n  }\n  for (l = 1; l <= n; l++) {\n    if (b[l] == 0)\n      printf(\"%s \", d[l]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char num[10];\n  int age;\n} p[105], t, a[105];\nint main() {\n  int i, k, n, c, d;\n  cin >> n;\n  k = 0;\n  for (i = 0; i + k < n;) {\n    cin >> p[i].num >> p[i].age;\n    if (p[i].age >= 60) {\n      a[k] = p[i];\n      k++;\n    } else\n      i++;\n  }\n  for (c = 0; c < k - 1; c++) {\n    for (d = 0; d < k - 1; d++) {\n      if (a[d].age < a[d + 1].age) {\n        t = a[d];\n        a[d] = a[d + 1];\n        a[d + 1] = t;\n      }\n    }\n  }\n\n  if (k >= 0) {\n    k--;\n    for (c = 0; c <= k; c++)\n      cout << a[c].num << \"\\n\";\n  }\n  if (i >= 0) {\n    i--;\n    for (d = 0; d <= i; d++)\n      printf(\"%s\\n\", p[d].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char name[11];\n  int age;\n  int order;\n};\nint main() {\n  struct patient peo[1000];\n  int n, i, count = 0, COUNT, j, k, e, agedata[1000], a = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &peo[i].name);\n    scanf(\"%d\", &peo[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      count++;\n      agedata[a] = peo[i].age;\n      a++;\n    }\n  }\n  COUNT = count;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      peo[i].order = count;\n      count++;\n    }\n  }\n  for (k = 1; k < COUNT; k++) {\n    for (j = 0; j < COUNT - k; j++) {\n      if (agedata[j] < agedata[j + 1]) {\n        e = agedata[j + 1];\n        agedata[j + 1] = agedata[j];\n        agedata[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < COUNT; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].age == agedata[i]) {\n        peo[j].order = i;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].order == i) {\n        cout << peo[j].name << \" \";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= q; i++)\n    printf(\"%s\\n\", d[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char num[11];\n  int age;\n} sick[101];\nint main() {\n  int n, i, j, k, r, s;\n  s = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", sick[i].num);\n    scanf(\"%d\", &sick[i].age);\n  }\n  int old[101] = {0};\n  int young[101] = {0};\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      for (j = 0; j <= s; j++) {\n        if (sick[i].age > sick[old[j]].age || j == s) {\n          if (j == s) {\n            old[s] = i;\n            s = s + 1;\n            break;\n          } else {\n            for (k = s; k >= j; k--) {\n              old[k + 1] = old[k];\n            }\n            old[j] = i;\n            s = s + 1;\n            break;\n          }\n        }\n      }\n    } else {\n      young[r] = i;\n      r = r + 1;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    cout << sick[old[i]].num << \"\\n\";\n  }\n  for (i = 0; i < r; i++) {\n    printf(\"%s\\n\", sick[young[i]].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n    struct patient *next;\n  } * p1, *p2, *head, *p[100], *temp;\n  p1 = p2 = head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", p1->id, &p1->age);\n  for (i = 2; i <= n; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p1->id, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (t = 0, p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p[t] = p1;\n      t++;\n    }\n\n  for (j = 0; j < t - 1; j++)\n    for (i = 0; i < t - j - 1; i++)\n      if (p[i]->age < p[i + 1]->age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n\n  for (i = 0; i <= t - 1; i++)\n    cout << p[i]->id << \"\\n\";\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age < 60)\n      cout << p1->id << \"\\n\";\n}\n"}
{"label": "9", "index": "15818", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, temp, s, max;\n  int is_over_sixty_exist = 1;\n  int age[100] = {0}, queue[100] = {0};\n  char id[100][10] = {'0'};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    queue[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  i = 0;\n  while (is_over_sixty_exist) {\n    max = 0;\n    is_over_sixty_exist = 0;\n    temp = queue[i];\n    for (j = 0; j < n; j++) {\n      if (age[j] >= 60 && age[j] > max) {\n        is_over_sixty_exist = 1;\n        max = age[j];\n        queue[i] = j;\n      }\n    }\n    for (s = i + 1; s < n; s++)\n      if (queue[s] == queue[i])\n        break;\n    age[queue[i]] = 0;\n    if (is_over_sixty_exist) {\n      if (s != n) {\n        for (k = s; k >= i + 1; k--)\n          queue[k] = queue[k - 1];\n        queue[i + 1] = temp;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", id[queue[i]]);\n}\n"}
{"label": "9", "index": "15819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Patient {\n  char num[10];\n  int age;\n  struct Patient *next;\n};\nint main() {\n  void paixu(int n, struct Patient *head);\n  struct Patient *creat(int n);\n  int n, i;\n  struct Patient *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(n, head);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", head->num);\n    head = head->next;\n  }\n  return 0;\n}\nstruct Patient *creat(int n) {\n  int i;\n  struct Patient *head, *thispoint, *nextpoint;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      head = nextpoint;\n      thispoint = head;\n    } else {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      thispoint->next = nextpoint;\n      thispoint = nextpoint;\n    }\n  }\n  thispoint->next = NULL;\n  return head;\n}\nvoid paixu(int n, struct Patient *head) {\n  int i, j, k, count;\n  struct Patient *p1, *p2, *p3, *p4;\n  char tempnum[10], tempnum3[10], tempnum4[10];\n  int tempage, tempage3, tempage4;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    if (p1->age < 60) {\n      p2 = p1->next;\n      for (j = i + 1; j < n; j++) {\n        if (p2->age > 59) {\n          strcpy(tempnum, p2->num);\n          tempage = p2->age;\n          p3 = p1;\n          p4 = p3->next;\n          for (k = i; k < j; k++) {\n            strcpy(tempnum4, p4->num);\n            tempage4 = p4->age;\n            if (k == i) {\n              strcpy(p4->num, p3->num);\n              p4->age = p3->age;\n            } else {\n              strcpy(p4->num, tempnum3);\n              p4->age = tempage3;\n            }\n            strcpy(tempnum3, tempnum4);\n            tempage3 = tempage4;\n            p3 = p3->next;\n            p4 = p4->next;\n          }\n          strcpy(p1->num, tempnum);\n          p1->age = tempage;\n          break;\n        } else {\n          p2 = p2->next;\n        }\n      }\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 0, count = 0; i < n; i++) {\n    if (p1->age > 59)\n      count++;\n\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < count; i++) {\n    p2 = p1;\n    for (j = 0; j < count - i; j++) {\n      p3 = p2->next;\n      if (p2->age < p3->age) {\n        strcpy(tempnum, p2->num);\n        tempage = p2->age;\n        strcpy(p2->num, p3->num);\n        p2->age = p3->age;\n        strcpy(p3->num, tempnum);\n        p3->age = tempage;\n      }\n      p2 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "15820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, b[100], n1 = 0, n2 = 0, ha[100], pp[100], x;\n  char a[100][11], yi[100][10], er[100][10], y[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      n1++;\n    } else {\n      n2++;\n    }\n  }\n  for (i = 0, k = 0, l = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      ha[k] = b[i];\n      strcpy(yi[k], a[i]);\n      k++;\n    } else {\n      pp[l] = b[i];\n      strcpy(er[l], a[i]);\n      l++;\n    }\n  }\n  for (i = 1; i < n1; i++) {\n    for (k = 0; k < n1 - i; k++) {\n      if (ha[k] < ha[k + 1]) {\n        x = ha[k];\n        ha[k] = ha[k + 1];\n        ha[k + 1] = x;\n        strcpy(y, yi[k]);\n        strcpy(yi[k], yi[k + 1]);\n        strcpy(yi[k + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    printf(\"%s\\n\", yi[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    cout << er[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  int x;\n} p[100], P[100], s;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].num >> p[i].age;\n    if (p[i].age >= 60)\n      p[i].x = p[i].age;\n    else\n      p[i].x = 0;\n  }\n  for (i = 0; i < n; i++) {\n    s.age = -1;\n    s.x = -1;\n    char k[10];\n    for (j = 0; j < n; j++) {\n      if (s.x < p[j].x) {\n        s = p[j];\n        strcpy(k, p[j].num);\n      }\n    }\n    P[i] = s;\n    for (j = 0; j < n; j++) {\n      if (strcmp(p[j].num, k) == 0) {\n        p[j].x = -2;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", P[i].num);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b[101], b1[101], t, h, k;\n  char a[101][11] = {0}, a1[101][11] = {0}, s1[11];\n  scanf(\"%d\", &n);\n  for (i = 0, h = 0, k = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", s1, &t);\n    if (t >= 60) {\n      b[h] = t;\n      strcpy(a[h], s1);\n      h++;\n    } else {\n      b1[k] = t;\n      strcpy(a1[k], s1);\n      k++;\n    }\n  }\n\n  for (i = 0; i <= h - 2; i++) {\n    for (j = 0; j <= h - 2 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        strcpy(s1, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], s1);\n      }\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i <= k - 1; i++)\n    printf(\"%s\\n\", a1[i]);\n}\n"}
{"label": "9", "index": "15823", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b[100], d[100], j = 0, k, l, t, i;\n  cin >> n;\n  char a[n][10], c[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      d[k] = b[i];\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  l = k;\n  char r[10];\n  for (k = 0; k < l - 1; k++) {\n    for (j = 0; j < l - 1 - k; j++)\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(r, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], r);\n      }\n  }\n  for (j = 0; j < l; j++) {\n    printf(\"%s \", c[j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s \", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15824", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char str[10];\n  int a;\n\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i = 0;\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->str, &p1->a);\n  head = NULL;\n  while (i < n - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->str, &p1->a);\n  }\n  p2->next = p1;\n  p2 = (struct student *)malloc(1000);\n  p2 = p1;\n  p2->next = NULL;\n\n  return (head);\n}\nint main() {\n  int n, i, j;\n  struct student *head, *p1, *p2, *p3, *p4, *p5, *p6;\n  scanf(\"%d\", &n);\n  head = creat(n);\n\n  char c[10];\n  int t;\n\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    p2 = p1->next;\n\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->a > 59 && p2->a > p1->a)\n\n      {\n        strcpy(c, p2->str);\n        strcpy(p2->str, p1->str);\n        strcpy(p1->str, c);\n        t = p1->a;\n        p1->a = p2->a;\n        p2->a = t;\n      }\n\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  p5 = head;\n\n  for (i = 0; i < n; i++) {\n\n    { printf(\"%s \", p5->str); }\n    p5 = p5->next;\n  }\n}\n"}
{"label": "9", "index": "15825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, oversix = 0, undersix = 0, osix[100], usix[100], t;\n  char noosix[100][100] = {0}, nousix[100][100] = {0}, a[100][100] = {0};\n  char s[100][100] = {0};\n  scanf(\"%d\", &n);\n  int b[100];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      oversix++;\n      osix[oversix - 1] = b[i];\n      strcpy(noosix[oversix - 1], a[i]);\n    } else {\n      undersix++;\n      usix[undersix - 1] = b[i];\n      strcpy(nousix[undersix - 1], a[i]);\n    }\n  }\n  for (int j = 0; j < oversix - 1; j++)\n    for (int i = 0; i < oversix - 1 - j; i++)\n      if (osix[i] < osix[i + 1]) {\n        t = osix[i];\n        strcpy(s[i], noosix[i]);\n        osix[i] = osix[i + 1];\n        strcpy(noosix[i], noosix[i + 1]);\n        osix[i + 1] = t;\n        strcpy(noosix[i + 1], s[i]);\n      }\n  for (int i = 0; i < oversix; i++)\n    printf(\"%s \", noosix[i]);\n  for (int i = 0; i < undersix; i++) {\n    cout << nousix[i] << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15826", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct peo {\n  char id[10];\n  int age;\n} a[150], b[150];\nint main() {\n  int n, i, j = 0, e, k;\n  char c[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      strcpy(b[j].id, a[i].id);\n      b[j].age = a[i].age;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i + 1].age;\n        b[i + 1].age = b[i].age;\n        b[i].age = e;\n        strcpy(c, b[i + 1].id);\n        strcpy(b[i + 1].id, b[i].id);\n        strcpy(b[i].id, c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "15827", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n  int num;\n} bing[100], temp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bing[i].id >> bing[i].age;\n    bing[i].num = i + 1;\n  }\n  for (j = 0; j <= n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (bing[i + 1].age >= 60 && bing[i].age < bing[i + 1].age) {\n        temp = bing[i + 1];\n        bing[i + 1] = bing[i];\n        bing[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", bing[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, p = 0, q, w;\n  struct patient {\n    int age;\n    char b[10];\n  };\n  struct patient c[100], d[100], e[100], g;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i].b);\n    scanf(\"%d\", &c[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      d[j] = c[i];\n      j = j + 1;\n    } else {\n      e[p] = c[i];\n      p = p + 1;\n    }\n  }\n  w = j - 1;\n\n  for (j = 1; j <= w; j++) {\n    q = w;\n    for (; q >= j; q--) {\n      if (d[q].age > d[q - 1].age) {\n        g = d[q];\n        d[q] = d[q - 1];\n        d[q - 1] = g;\n      }\n    }\n  }\n  for (j = 0; j < w + 1; j++)\n    cout << d[j].b << \"\\n\";\n  for (j = 0; j < p; j++)\n    cout << e[j].b << \"\\n\";\n}\n"}
{"label": "9", "index": "15829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100] = {0}, i, j, k, old[101] = {0}, oldn, youngn;\n  char id[101][20] = {0}, oldid[101][20] = {0}, youngid[101][20] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> id[i] >> age[i];\n  for (i = 1, j = 1, k = 1; i <= n; i++) {\n    if (age[i] >= 60) {\n      old[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      strcpy(youngid[k], id[i]);\n      k++;\n    }\n  }\n  oldn = j;\n  youngn = k;\n  for (i = 1; i <= oldn; i++) {\n    for (j = 1; j <= oldn - i; j++) {\n      if (old[j] < old[j + 1]) {\n        old[100] = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = old[100];\n        strcpy(oldid[101], oldid[j]);\n        strcpy(oldid[j], oldid[j + 1]);\n        strcpy(oldid[j + 1], oldid[101]);\n      }\n    }\n  }\n  for (i = 1; i < oldn; i++)\n    printf(\"%s\\n\", oldid[i]);\n  for (k = 1; k < youngn; k++)\n    printf(\"%s\\n\", youngid[k]);\n}\n"}
{"label": "9", "index": "15830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint m = 0;\nstruct patient {\n  char id[32];\n  int age;\n  struct patient *next;\n};\nstruct patient *find(struct patient *head) {\n  struct patient *p, *ppre;\n  p = head;\n  while (p && p->age >= 60) {\n    ppre = p;\n    p = p->next;\n  }\n  return ppre;\n}\nstruct patient *create(int n) {\n  struct patient *head = NULL, *p1, *p2, *p0, *q;\n  int i;\n  p1 = p2 = p0 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  if (p1->age >= 60)\n    m++;\n  p1->next = NULL;\n  head = p1 = p0;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age < 60) {\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    } else if (p1->age >= 60) {\n      m++;\n      if (head->age < 60) {\n        head = p1;\n        p1->next = p0;\n      }\n      if (head->age >= 60) {\n        p0 = find(head);\n        q = p0->next;\n        p0->next = p1;\n        p1->next = q;\n      }\n      if ((p0 = find(head))->next == NULL) {\n        p1->next = NULL;\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n  }\n  return head;\n}\nstruct patient *arrange(struct patient *head) {\n  struct patient *p1, *p2;\n  int t1, i, j;\n  char t2[32];\n  for (j = 0; j < m; j++) {\n    p1 = head;\n    for (i = 1; i < m - j; i++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p2->age < p1->age) {\n        t1 = p1->age;\n        strcpy(t2, p1->id);\n        p1->age = p2->age;\n        strcpy(p1->id, p2->id);\n        p2->age = t1;\n        strcpy(p2->id, t2);\n      }\n    }\n  }\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    cout << p->id << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head, *p, *q, *p0;\n  int n, m = 0, age;\n  char id[32];\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char id[100][100];\n  int age[100];\n  int n;\n  int i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &age[i]);\n  }\n\n  int e;\n  char t[13];\n\n  char id1[100][13];\n  int age1[100];\n  char id2[100][13];\n  int age2[100];\n  int x = 0, y = 0;\n\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[x] = age[i];\n      strcpy(id1[x], id[i]);\n      x++;\n    }\n\n    if (age[i] < 60) {\n      age2[y] = age[i];\n      strcpy(id2[y], id[i]);\n      y++;\n    }\n  }\n\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - k; i++) {\n      if (age1[i] < age1[i + 1]) {\n        e = age1[i + 1];\n        age1[i + 1] = age1[i];\n        age1[i] = e;\n\n        strcpy(t, id1[i + 1]);\n        strcpy(id1[i + 1], id1[i]);\n        strcpy(id1[i], t);\n      }\n    }\n  }\n\n  for (i = 0; i < x; i++) {\n    cout << id1[i] << \"\\n\";\n  }\n\n  for (i = 0; i < y; i++) {\n    cout << id2[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int age;\n  int order;\n  struct stu *next;\n};\nint main() {\n  struct stu *p, *q, *t, *r, *head;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  head = (struct stu *)malloc(1000);\n  q = head;\n  for (i = 0; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d\", p->name, &p->age);\n    p->order = i;\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n  for (i = 0; i < n - 1; i++)\n    for (p = head, j = 0; j < n - 1 - i; j++, p = p->next) {\n      q = p->next;\n      t = q->next;\n      if ((q->age == t->age && q->order > t->order) ||\n          (q->age < 60 && t->age < q->age && q->order > t->order) ||\n          (t->age < 60 && t->age > q->age && q->order > t->order) ||\n          (t->age >= 60 && t->age > q->age)) {\n        r = t->next;\n        t->next = q;\n        p->next = t;\n        q->next = r;\n      }\n    }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  int d[100];\n  char c[100][10], e[10];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", c[i - 1], &d[i - 1]);\n\n  for (i = 1; i <= n - 1; i++) {\n    for (k = n; k >= i + 1; k--) {\n      if (d[k - 1] > d[k - 2] && d[k - 1] >= 60) {\n        t = d[k - 2];\n        d[k - 2] = d[k - 1];\n        d[k - 1] = t;\n        strcpy(e, c[k - 2]);\n        strcpy(c[k - 2], c[k - 1]);\n        strcpy(c[k - 1], e);\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s \", c[i - 1]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, i, j, l, m;\n  scanf(\"%d\", &a);\n  int f[a];\n  int h[a];\n  int n[a];\n  int k[a];\n  int o[a];\n  char g[a][10];\n  for (i = 0; i < a; i++) {\n    scanf(\"%s %d\", g[i], &f[i]);\n  }\n  j = 0;\n  for (i = 0; i < a; i++) {\n    if (f[i] >= 60) {\n      h[j] = f[i];\n      k[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    n[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    o[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = i + 1; l < j; l++) {\n      if (h[n[i]] < h[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n\n      } else if (h[n[i]] == h[n[l]] && o[n[i]] > o[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", g[k[n[i]]]);\n  }\n  for (i = 0; i < a; i++) {\n    if (f[i] < 60)\n      printf(\"%s \", g[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, p = 0, q, w;\n  struct patient {\n    int age;\n    char b[10];\n  };\n  struct patient c[100], d[100], e[100], g;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i].b);\n    scanf(\"%d\", &c[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      d[j] = c[i];\n      j = j + 1;\n    } else {\n      e[p] = c[i];\n      p = p + 1;\n    }\n  }\n  w = j - 1;\n\n  for (j = 1; j <= w; j++) {\n    q = w;\n    for (; q >= j; q--) {\n      if (d[q].age > d[q - 1].age) {\n        g = d[q];\n        d[q] = d[q - 1];\n        d[q - 1] = g;\n      }\n    }\n  }\n  for (j = 0; j < w + 1; j++)\n    printf(\"%s\\n\", d[j].b);\n  for (j = 0; j < p; j++)\n    cout << e[j].b << \"\\n\";\n}\n"}
{"label": "9", "index": "15836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, sz[100], i, j, sz2[100], e;\n  char zf[100][20], f[20], zf2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zf[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      n--;\n      strcpy(zf2[m], zf[i]);\n      sz2[m] = sz[i];\n      m++;\n      for (j = i; j <= n; j++) {\n        strcpy(zf[j], zf[j + 1]);\n        sz[j] = sz[j + 1];\n      }\n      i--;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (sz2[i] < sz2[i + 1]) {\n        e = sz2[i];\n        sz2[i] = sz2[i + 1];\n        sz2[i + 1] = e;\n        strcpy(f, zf2[i]);\n        strcpy(zf2[i], zf2[i + 1]);\n        strcpy(zf2[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", zf2[i]);\n\n  for (i = 0; i < n; i++) {\n    cout << zf[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct information {\n  char ID[10];\n  int age;\n} * a;\nint main() {\n  int n, i, j, max, p, q = 0;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age > 59)\n      q++;\n  }\n  for (i = 0; i < q; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (max < a[j].age) {\n        max = a[j].age;\n        p = j;\n      }\n    }\n    printf(\"%s\\n\", a[p].ID);\n    a[p].age = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age != 0)\n      printf(\"%s\\n\", a[i].ID);\n  }\n}\n"}
{"label": "9", "index": "15838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char id[100][10], a[10];\n  int n, i, j;\n  int age[100], b;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n  }\n\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (age[i] >= 60 && age[i - 1] >= 60) {\n        if (age[i] > age[i - 1]) {\n          strcpy(a, id[i]);\n          b = age[i];\n          strcpy(id[i], id[i - 1]);\n          age[i] = age[i - 1];\n          strcpy(id[i - 1], a);\n          age[i - 1] = b;\n        }\n      }\n      if (age[i] >= 60 && age[i - 1] < 60) {\n        strcpy(a, id[i]);\n        b = age[i];\n        strcpy(id[i], id[i - 1]);\n        age[i] = age[i - 1];\n        strcpy(id[i - 1], a);\n        age[i - 1] = b;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << id[i];\n    else\n      cout << \"\\n\" << id[i];\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n;\n  char id[200][200];\n  int age[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 200; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (age[i] == j)\n        printf(\"%s \", id[i]);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n;\n  char id[200][200];\n  int age[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 200; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (age[i] == j)\n        printf(\"%s \", id[i]);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] < 60) {\n      printf(\"%s \", id[i]);\n    }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100] = {0}, c[100] = {0}, d[100] = {0}, e[100] = {0};\n  char a[100][100];\n  for (i = 0; i < 100; i++) {\n    b[i] = i;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &c[i]);\n    if (c[i] > 59) {\n      d[i] = c[i];\n    } else\n      e[i] = c[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (d[b[j]] < d[b[j + 1]]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (d[b[i]] > 0) {\n      printf(\"%s\\n\", a[b[i]]);\n    } else {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (e[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ID[100][10] = {'\\0'}, young[100][10] = {'\\0'}, old[100][10] = {'\\0'},\n       wae[100] = {'\\0'};\n  int age[100] = {0}, y[100] = {0}, o[100] = {0};\n  int i, n;\n  int m = 0, k = 0, temp = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[m], ID[i]);\n      y[m] = age[i];\n      m++;\n    } else {\n      strcpy(old[k], ID[i]);\n      o[k] = age[i];\n      k++;\n    }\n  }\n  for (a = 0; a < k - 1; a++) {\n    for (b = 0; b < k - a - 1; b++) {\n      if (o[b] < o[b + 1]) {\n        temp = o[b];\n        o[b] = o[b + 1];\n        o[b + 1] = temp;\n        strcpy(wae, old[b]);\n        strcpy(old[b], old[b + 1]);\n        strcpy(old[b + 1], wae);\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%s\\n\", old[a]);\n  for (b = 0; b < m; b++)\n    printf(\"%s\\n\", young[b]);\n}\n"}
{"label": "9", "index": "15843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ren {\n  char id[12];\n  int ye;\n  struct ren *next;\n};\nint main() {\n  int n;\n  char c[12];\n  int y;\n  int r;\n  struct ren *p1, *p2, *head;\n  int i;\n  scanf(\"%d\", &n);\n  head = (struct ren *)malloc(sizeof(struct ren));\n  scanf(\"%s %d\", c, &y);\n  strcpy(head->id, c);\n  head->ye = y;\n  head->next = 0;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%s %d\", c, &y);\n    p1 = (struct ren *)malloc(sizeof(struct ren));\n    strcpy(p1->id, c);\n    p1->ye = y;\n    p1->next = 0;\n    if (y < 60) {\n      p2 = head;\n      while (p2->next != 0)\n        p2 = p2->next;\n      p2->next = p1;\n    } else {\n      p2 = head;\n      if (y > p2->ye) {\n        p1->next = head;\n        head = p1;\n      } else {\n        r = 0;\n        while (p2->next != 0) {\n          if (p2->ye >= y && p2->next->ye < y) {\n            r = 1;\n            p1->next = p2->next;\n            p2->next = p1;\n            break;\n          }\n          p2 = p2->next;\n        }\n        if (r == 0) {\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  do {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  } while (p1 != 0);\n  return 0;\n}\n"}
{"label": "9", "index": "15844", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, k = 0, e0, m, a;\n  int AGE[100];\n  char id[100][10];\n  char ID[100][10];\n  char e[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &id[i], &age[i]);\n  m = strlen(id[0]);\n  for (i = 0; i < n; i++)\n    id[i][m] = '\\0';\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      AGE[k] = age[i];\n      k++;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    for (j = 0; j < k - i; j++)\n      if (AGE[j] < AGE[j + 1]) {\n        e0 = AGE[j + 1];\n        AGE[j + 1] = AGE[j];\n        AGE[j] = e0;\n        for (a = 0; a <= m; a++) {\n          e[0][a] = ID[j + 1][a];\n          ID[j + 1][a] = ID[j][a];\n          ID[j][a] = e[0][a];\n        }\n      }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      k++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ID[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15845", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint N;\nstruct patient {\n  char ID[20];\n  int age;\n  struct patient *next;\n};\nstruct patient *creat() {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < N; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nstruct patient *rank_1(struct patient *head) {\n  int i, j, a;\n  char ID[20];\n  struct patient *p1, *p2;\n  for (i = 0; i < N - 1; i++) {\n    p1 = head;\n    p2 = head->next;\n    for (j = 0; j < N - i - 1; j++) {\n      if ((p1->age < p2->age) && (p2->age >= 60)) {\n        a = p1->age;\n        p1->age = p2->age;\n        p2->age = a;\n        strcpy(ID, p1->ID);\n        strcpy(p1->ID, p2->ID);\n        strcpy(p2->ID, ID);\n      }\n      p1 = p2;\n      p2 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  scanf(\"%d\", &N);\n  head = creat();\n  head = rank_1(head);\n  print(head);\n}\n"}
{"label": "9", "index": "15846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[100][100];\n\n  int s1[100], sz[100], t[100];\n  int n, i, p, k;\n\n  scanf(\"%d\", &n);\n\n  int j = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", str[i], &sz[i]);\n\n    if (sz[i] >= 60) {\n      t[j] = i;\n      s1[j] = sz[i];\n      j++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (p = 0; p < j - k; p++) {\n      if (s1[p] < s1[p + 1]) {\n        int e, f;\n        e = s1[p + 1];\n        s1[p + 1] = s1[p];\n        s1[p] = e;\n        f = t[p + 1];\n        t[p + 1] = t[p];\n        t[p] = f;\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    cout << str[t[p]] << \"\\n\";\n  }\n\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      cout << str[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char c[10];\n  int a;\n  struct person *next;\n};\nint main() {\n  int i, n;\n  struct person *head, *p1, *p2, *p, *p0, *p3;\n  scanf(\"%d\", &n);\n  i = 0;\n  head = NULL;\n  while (i < n) {\n    p1 = (struct person *)malloc(1000);\n    cin >> p1->c >> p1->a;\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n    i++;\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = p0 = head;\n    while (p != NULL) {\n      if (p->a > p0->a)\n        p0 = p;\n      p = p->next;\n    }\n    if (p0->a >= 60) {\n      cout << p0->c << \" \";\n      p = head;\n      while (p->a != p0->a) {\n        p3 = p;\n        p = p->next;\n      }\n      if (p == head)\n        head = p->next;\n      else\n        p3->next = p->next;\n    } else {\n      cout << head->c << \" \";\n      head = head->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "15848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char a[100];\n  int age;\n} pat[110], pat1[110];\n\nvoid bubble(int n) {\n  int i, j;\n  struct patient temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (pat1[j].age < pat1[j + 1].age) {\n        temp = pat1[j];\n        pat1[j] = pat1[j + 1];\n        pat1[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].a, &pat[i].age);\n    if (pat[i].age >= 60)\n      pat1[k++] = pat[i];\n  }\n  bubble(k);\n  for (i = 0; i < k; i++)\n    cout << pat1[i].a << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct Patient {\n    char ID[10];\n    int age;\n  } patient[100], patient2[100];\n  struct Patient t;\n  int n, i = 0, j = 0, k = 0, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patient[i].ID, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age >= 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  num = j;\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  for (k = 1; k < num; k++) {\n    for (i = 0; i < num - k; i++) {\n      if (patient2[i + 1].age > patient2[i].age) {\n        t = patient2[i + 1];\n        patient2[i + 1] = patient2[i];\n        patient2[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", patient2[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15850", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[200], t;\n  char b[200][11], b1[11];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> b[i] >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (a[j + 1] >= 60 && a[j] < a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n        strcpy(b1, b[j]);\n        strcpy(b[j], b[j + 1]);\n        strcpy(b[j + 1], b1);\n      }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sixty[100];\n  int n, i, j, a;\n  struct patient {\n    char num[11];\n    int age;\n  } peo[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n    if (peo[i].age >= 60) {\n      sixty[i] = peo[i].age;\n\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        a = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = a;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == peo[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", peo[j].num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      cout << peo[i].num << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct peo {\n  char id[10];\n  int age;\n} a[150], b[150];\nint main() {\n  int n, i, j = 0, e, k;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      strcpy(b[j].id, a[i].id);\n      b[j].age = a[i].age;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i + 1].age;\n        b[i + 1].age = b[i].age;\n        b[i].age = e;\n        strcpy(c, b[i + 1].id);\n        strcpy(b[i + 1].id, b[i].id);\n        strcpy(b[i].id, c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].id);\n  }\n}\n"}
{"label": "9", "index": "15853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  char t[10];\n  scanf(\"%d\", &n);\n  int y[n];\n  char id[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &y[i]);\n  for (i = 1; i < n; i++) {\n    if (y[i] >= 60) {\n      for (j = i; j > 0; j--)\n        if (y[j - 1] < y[j]) {\n          temp = y[j];\n          y[j] = y[j - 1];\n          y[j - 1] = temp;\n          strcpy(t, id[j]);\n          strcpy(id[j], id[j - 1]);\n          strcpy(id[j - 1], t);\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << id[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "15854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct sick {\n  int age;\n  char id[100];\n  struct sick *next;\n};\nstruct sick *insert(struct sick *head, struct sick *new1) {\n  struct sick *p0, *p1, *p2, *p;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->age < 60) {\n      p1 = head;\n      while (p1 != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p2->next = p0;\n      p0->next = NULL;\n    } else {\n      while ((p1->age >= p0->age) && (p1->next != NULL)) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->age > p1->age) {\n        if (head == p1)\n          head = p0;\n        else\n          p2->next = p0;\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  struct sick *head, *p;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  struct sick *insert(struct sick * head, struct sick * new1);\n  for (i = 0; i < n; i++) {\n    p = (struct sick *)malloc(sizeof(struct sick));\n    scanf(\"%s %d\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  do {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "9", "index": "15855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], e;\n  char id[100][10], ex[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((age[j] < age[j + 1] && age[j] >= 60) ||\n          (age[j] < age[j + 1] && age[j + 1] >= 60)) {\n        e = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = e;\n        strcpy(ex, id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], ex);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pa[100];\n\nint main() {\n  int n, i, j, max = 59, m, t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pa[i].id >> pa[i].age;\n  for (i = 0; i < n; i++)\n    if (pa[i].age > 59)\n      t++;\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < n; i++)\n      if (pa[i].age > max) {\n        max = pa[i].age;\n        m = i;\n      }\n    cout << pa[m].id << \"\\n\";\n    pa[m].age = 0;\n    max = 59;\n  }\n\n  for (i = 0; i < n; i++)\n    if (pa[i].age <= 59 && pa[i].age != 0)\n      printf(\"%s\\n\", pa[i].id);\n}\n"}
{"label": "9", "index": "15857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  struct peo sixty[100];\n\n  int n, b = 0, i, j, k, e;\n  char a[11];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i].age = people[i].age;\n      strcpy(sixty[i].id, people[i].id);\n      b += 1;\n    } else {\n      strcpy(sixty[i].id, \"0000\");\n      sixty[i].age = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1].age < sixty[i].age) {\n        e = sixty[i - 1].age;\n        sixty[i - 1].age = sixty[i].age;\n        sixty[i].age = e;\n        strcpy(a, sixty[i - 1].id);\n        strcpy(sixty[i - 1].id, sixty[i].id);\n        strcpy(sixty[i].id, a);\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s\\n\", sixty[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Node;\ntypedef struct Node *pNode;\nstruct Node {\n  int x;\n  char id[20];\n  pNode next;\n};\n\npNode create() {\n  pNode p;\n  p = (pNode)malloc(sizeof(struct Node));\n  p->next = NULL;\n  return p;\n}\n\nvoid sort(pNode head, int n) {\n  pNode p = NULL, q = NULL, s = NULL;\n  int i;\n  for (i = 1; i <= n; i++) {\n    s = (pNode)malloc(sizeof(struct Node));\n    s->next = NULL;\n    scanf(\"%s %d\", &s->id, &s->x);\n    if (s->x < 60) {\n      p = head;\n      while (p->next)\n        p = p->next;\n      p->next = s;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->x < s->x) {\n          break;\n        }\n        q = p;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    }\n  }\n}\n\nvoid outputdata(pNode p) {\n  p = p->next;\n  while (p->next) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  cout << p->id << \"\\n\";\n}\n\nint main() {\n  pNode head;\n  int n;\n  head = create();\n  cin >> n;\n  sort(head, n);\n  outputdata(head);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, l, z;\n  int a[100], b[100], f[100];\n  char d[30], c[100][30], e[100][30];\n  scanf(\"%d\", &n);\n  for (i = 0, z = 0; i < n; i++) {\n    cin >> c[i];\n    scanf(\"%d\", &a[i]);\n    if (a[i] >= 60) {\n      b[z] = a[i];\n      f[z] = z;\n      strcpy(e[z], c[i]);\n      a[i] = 0;\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = i + 1; j < z; j++) {\n      if (b[j] > b[i]) {\n        strcpy(d, e[i]);\n        strcpy(e[i], e[j]);\n        strcpy(e[j], d);\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n        l = f[i];\n        f[i] = f[j];\n        f[j] = l;\n      }\n      if (b[i] == b[j]) {\n        if (f[i] > f[j]) {\n          strcpy(d, e[i]);\n          strcpy(e[i], e[j]);\n          strcpy(e[j], d);\n          k = b[i];\n          b[i] = b[j];\n          b[j] = k;\n          l = f[i];\n          f[i] = f[j];\n          f[j] = l;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", e[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Node;\ntypedef struct Node *pNode;\nstruct Node {\n  int x;\n  char id[20];\n  pNode next;\n};\n\npNode create() {\n  pNode p;\n  p = (pNode)malloc(sizeof(struct Node));\n  p->next = NULL;\n  return p;\n}\n\nvoid sort(pNode head, int n) {\n  pNode p = NULL, q = NULL, s = NULL;\n  int i;\n  for (i = 1; i <= n; i++) {\n    s = (pNode)malloc(sizeof(struct Node));\n    s->next = NULL;\n    scanf(\"%s %d\", &s->id, &s->x);\n    if (s->x < 60) {\n      p = head;\n      while (p->next)\n        p = p->next;\n      p->next = s;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->x < s->x)\n          break;\n        q = p;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    }\n  }\n}\n\nvoid outputdata(pNode p) {\n  p = p->next;\n  while (p->next) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  cout << p->id << \"\\n\";\n}\n\nint main() {\n  pNode head;\n  int n;\n  head = create();\n  scanf(\"%d\", &n);\n  sort(head, n);\n  outputdata(head);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = -1, t = -1, k, age[100], e[100], h[100];\n  char a[100][10], b[100][10], c[100][10], f[10];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    cin >> a[i] >> age[i];\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (age[i] >= 60) {\n\n      s = s + 1;\n      e[s] = age[i];\n      strcpy(b[s], a[i]);\n    } else {\n\n      t = t + 1;\n      h[t] = age[i];\n      strcpy(c[t], a[i]);\n    }\n  }\n  for (j = 0; j < s; j++) {\n    for (i = 0; i < s - j; i++) {\n      if (e[i] < e[i + 1]) {\n        k = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = k;\n        strcpy(f, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i <= s; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= t; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15862", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct patient {\n    char ID[10];\n    int age;\n  } pat[100], old[100];\n  int n, i, j, k = 0, a;\n  char b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].ID >> pat[i].age;\n    if (pat[i].age >= 60) {\n      strcpy(old[k].ID, pat[i].ID);\n      old[k].age = pat[i].age;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        a = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = a;\n        strcpy(b, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", old[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, l;\n  int b[100], d[100], g[100];\n  char a[100][10], c[100][10], e[10], f[100][10];\n  m = 0;\n  l = 0;\n  t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[m], a[i]);\n      d[m] = b[i];\n      m = m + 1;\n    } else {\n      strcpy(f[l], a[i]);\n      g[l] = b[i];\n      l = l + 1;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(e, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", f[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char num[10];\n  int age;\n} p[105], t, a[105];\nint main() {\n  int i, k, n, c, d;\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i + k < n;) {\n    cin >> p[i].num >> p[i].age;\n    if (p[i].age >= 60) {\n      a[k] = p[i];\n      k++;\n    } else\n      i++;\n  }\n  for (c = 0; c < k - 1; c++) {\n    for (d = 0; d < k - 1; d++) {\n      if (a[d].age < a[d + 1].age) {\n        t = a[d];\n        a[d] = a[d + 1];\n        a[d + 1] = t;\n      }\n    }\n  }\n\n  if (k >= 0) {\n    k--;\n    for (c = 0; c <= k; c++)\n      cout << a[c].num << \"\\n\";\n  }\n  if (i >= 0) {\n    i--;\n    for (d = 0; d <= i; d++)\n      printf(\"%s\\n\", p[d].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid paixu(struct patient pat[], int n) {\n\n  struct patient t;\n  int i;\n  int k;\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        t = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  struct patient pat;\n  struct patient oldpat[100];\n  struct patient youngpat[100];\n\n  int n;\n  int i;\n  int m = 0;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat.ID, &pat.age);\n    if (pat.age >= 60) {\n      oldpat[m] = pat;\n      m++;\n    } else {\n      youngpat[k] = pat;\n      k++;\n    }\n  }\n\n  paixu(oldpat, m);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", oldpat[i].ID);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", youngpat[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct s {\n  int d;\n  char c[20];\n  struct s *next;\n};\nvoid sort(struct s *head) {\n  struct s *pre = head, *p = pre->next, *s;\n  s = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%s %d\", s->c, &s->d);\n  s->next = NULL;\n  if (s->d >= 60) {\n    while (p != NULL && p->d >= s->d) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n  if (s->d < 60) {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nint main() {\n  struct s *head, *p;\n  int n, i;\n  head = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%d\", &n);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    sort(head);\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << p->c << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15867", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct xinxi {\n  char id[10];\n  int age;\n};\n\nstruct xinxi old[100];\nint main() {\n  int i, n, j;\n  int maxage = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> old[i].id >> old[i].age;\n  }\n  for (i = 0; i < n; i++)\n    if (maxage < old[i].age)\n      maxage = old[i].age;\n  for (j = maxage; j >= 60; j--)\n    for (i = 0; i < n; i++)\n      if (old[i].age == j)\n        puts(old[i].id);\n  for (i = 0; i < n; i++)\n    if (old[i].age < 60)\n      puts(old[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j;\n  char id[100][11], str[11];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n\n  for (i = 110; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (age[j] == i) {\n        cout << id[j] << \"\\n\";\n        age[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n} pat[100];\nint main() {\n  struct patient t;\n  struct patient num[100];\n  int n, i, j, a = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].ID, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      num[a - 1] = pat[i];\n      a++;\n    }\n  }\n  for (i = 0; i < a - 2; i++) {\n    for (j = 0; j < a - 2 - i; j++)\n      if (num[j].age < num[j + 1].age) {\n        t = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = t;\n      }\n  }\n  for (i = 0; i < a - 1; i++)\n    printf(\"%s\\n\", num[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15870", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct bingren {\n    char num[10];\n    int age;\n  };\n  int n;\n  scanf(\"%d \", &n);\n  struct bingren u[1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &u[i].num, &u[i].age);\n  }\n  struct bingren v[1000];\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (u[i].age > 59) {\n      v[j] = u[i];\n      j++;\n    }\n  }\n  int k;\n  struct bingren e;\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (v[i].age < v[i + 1].age) {\n        e = v[i + 1];\n        v[i + 1] = v[i];\n        v[i] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", v[i].num);\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i].age < 60) {\n      printf(\"%s\\n\", u[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pt {\n  char id[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, old;\n  struct pt p[100], o[100], tem;\n  char cao;\n  scanf(\"%d\", &n);\n  scanf(\"%c\", &cao);\n  old = 0;\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      o[old] = p[i];\n      old++;\n    }\n  }\n  for (i = 0; i < old - 1; i++) {\n    for (j = 0; j < old - 1; j++) {\n      if (o[j + 1].age > o[j].age) {\n        tem = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < old; i++)\n    printf(\"%s\\n\", o[i].id);\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      cout << p[i].id << \"\\n\";\n    }\n  }\n}\n"}
{"label": "9", "index": "15872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, m, t, p, r;\n  int a[100], b[100];\n  char str1[100][10], str2[100][10];\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", str1[i], &a[i]);\n  for (p = 0, s = 0; p < n; p++) {\n    if (a[p] >= 60) {\n      b[s] = a[p];\n      strcpy(str2[s], str1[p]);\n      s = s + 1;\n    }\n  }\n  for (k = 0; k < (s - 1); k++) {\n    for (m = 0; m < (s - k - 1); m++) {\n      if (b[m + 1] > b[m]) {\n        t = b[m + 1];\n        b[m + 1] = b[m];\n        b[m] = t;\n        strcpy(string, str2[m + 1]);\n        strcpy(str2[m + 1], str2[m]);\n        strcpy(str2[m], string);\n      }\n    }\n  }\n  for (j = 0; j < s; j++)\n    printf(\"%s\\n\", str2[j]);\n  for (r = 0; r < n; r++) {\n    if (a[r] < 60)\n      printf(\"%s\\n\", str1[r]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char tmp[100];\n  int n, i, j = 0, o = 0, tmpn;\n  struct {\n    char num[100];\n    int a, k;\n  } s[1000], t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].a;\n    if (s[i].a >= 60)\n      s[i].k = 1;\n    else {\n      s[i].k = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1) {\n      strcpy(t[j].num, s[i].num);\n      t[j].a = s[i].a;\n      j++;\n      o++;\n    }\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (t[j].a < t[j + 1].a) {\n        tmpn = t[j].a;\n        t[j].a = t[j + 1].a;\n        t[j + 1].a = tmpn;\n        strcpy(tmp, t[j].num);\n        strcpy(t[j].num, t[j + 1].num);\n        strcpy(t[j + 1].num, tmp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", t[i].num);\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1)\n      continue;\n    printf(\"%s\\n\", s[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age[100], a[100], j = 0, k, l, temp, ord[100], o[100];\n  char num[100][10], old[100][10], t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> num[i] >> age[i];\n  for (i = 0; i < n; i++)\n    ord[i] = i;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[j] = age[i];\n      o[j] = ord[j];\n      strcpy(old[j], num[i]);\n      j++;\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] < a[l]) {\n        temp = a[k];\n        a[k] = a[l];\n        a[l] = temp;\n        temp = o[k];\n        o[k] = o[l];\n        o[l] = temp;\n        strcpy(t, old[k]);\n        strcpy(old[k], old[l]);\n        strcpy(old[l], t);\n      }\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] == a[l]) {\n        if (o[k] > o[l]) {\n          temp = a[k];\n          a[k] = a[l];\n          a[l] = temp;\n          temp = o[k];\n          o[k] = o[l];\n          o[l] = temp;\n          strcpy(t, old[k]);\n          strcpy(old[k], old[l]);\n          strcpy(old[l], t);\n        }\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      cout << num[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} grp1[100], grp2[100], grp3[100];\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> grp1[i].No >> grp1[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    grp2[i].age = -1;\n    grp3[i].age = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (grp1[i].age >= 60) {\n      strcpy(grp2[i].No, grp1[i].No);\n      grp2[i].age = grp1[i].age;\n    }\n    if (grp1[i].age < 60) {\n      strcpy(grp3[i].No, grp1[i].No);\n      grp3[i].age = grp1[i].age;\n    }\n  }\n  char y[10];\n  int x;\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < n - k; m++) {\n      if (grp2[m].age < grp2[m + 1].age) {\n        x = grp2[m + 1].age;\n        grp2[m + 1].age = grp2[m].age;\n        grp2[m].age = x;\n        strcpy(y, grp2[m + 1].No);\n        strcpy(grp2[m + 1].No, grp2[m].No);\n        strcpy(grp2[m].No, y);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (grp2[i].age != -1)\n      printf(\"%s\\n\", grp2[i].No);\n  }\n  for (i = 0; i < n; i++) {\n    if (grp3[i].age != -1)\n      printf(\"%s\\n\", grp3[i].No);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char id[100][10];\n  int age[100];\n  int oldno = 0;\n  int xu[100];\n  char shunxu[100][10];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (age[j] >= 60) {\n      xu[oldno] = age[j];\n      strcpy(shunxu[oldno], id[j]);\n      oldno++;\n    }\n  }\n\n  int num = oldno;\n  int e;\n  char tem[10];\n  for (int k = 0; k < n; k++) {\n    if (age[k] < 60) {\n      xu[oldno] = age[k];\n      strcpy(shunxu[oldno], id[k]);\n      oldno++;\n    }\n  }\n  for (int x = 1; x <= num; x++) {\n    for (int y = 0; y < num - x; y++) {\n      if (xu[y] < xu[y + 1]) {\n        e = xu[y];\n        xu[y] = xu[y + 1];\n        xu[y + 1] = e;\n        strcpy(tem, shunxu[y]);\n        strcpy(shunxu[y], shunxu[y + 1]);\n        strcpy(shunxu[y + 1], tem);\n      }\n    }\n  }\n  for (int z = 0; z < n; z++) {\n    printf(\"%s\\n\", shunxu[z]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15877", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n  struct man *next;\n};\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nstruct man *insert(struct man *head, struct man *stud, int n) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  scanf(\"%s %d\", p0->num, &p0->age);\n  p0->nu = n + 1;\n  p0->next = NULL;\n  if (head == NULL)\n    head = p0;\n  else {\n    while ((f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) < 0) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) > 0) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n    }\n  }\n  return (head);\n}\nvoid print(struct man *head, int n) {\n  struct man *p;\n  int k;\n  p = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k;\n  struct man *head, *stu;\n  head = NULL;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    stu = (struct man *)malloc(1000);\n    head = insert(head, stu, k);\n  }\n  print(head, n);\n}\n"}
{"label": "9", "index": "15878", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nvoid bubble(struct patient p[], int m);\nint main() {\n  struct patient p[200];\n  int n, i, t = 100;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].id >> p[i].age;\n    if (p[i].age >= 60) {\n      p[t] = p[i];\n      t++;\n      p[i].age = 0;\n    }\n  }\n  bubble(p, t);\n  for (i = 100; i < t; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\nvoid bubble(struct patient p[], int m) {\n  int i, j;\n  struct patient temp;\n  for (j = 101; j < m; j++) {\n    for (i = 100; i < m + 100 - j; i++) {\n      if (p[i].age < p[i + 1].age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "15879", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[15];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *create() {\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  head = p1;\n  p2 = p1;\n  p1->next = NULL;\n  int i = 1;\n  do {\n    if (i == n)\n      break;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  } while (1);\n  return (head);\n}\nstruct patient *findmax(struct patient *head) {\n  struct patient *max;\n\n  struct patient *p;\n  max = head;\n  p = head->next;\n  while (p) {\n    if (p->age > max->age)\n      max = p;\n    p = p->next;\n  }\n  return (max);\n}\nstruct patient *del(struct patient *head, struct patient *needdel) {\n  struct patient *p, *ppre;\n  printf(\"%s \", needdel->ID);\n  p = head;\n  while (p && needdel != p) {\n    ppre = p;\n    p = p->next;\n  }\n  if (p == head) {\n    head = p->next;\n    free(p);\n  } else if (p) {\n    ppre->next = p->next;\n    free(p);\n  }\n\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = create();\n  p = head;\n  do {\n    p = findmax(head);\n    if (p->age < 60) {\n      break;\n    }\n    head = del(head, p);\n\n  } while (1);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char ID[10];\n  int age;\n} patient;\n\npatient pat[100];\n\nint cmp(const void *, const void *);\n\nint main() {\n  int n;\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].ID);\n    cin >> pat[i].age;\n  }\n\n  qsort(pat, n, sizeof(patient), cmp);\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].ID);\n\n  return 0;\n}\n\nint cmp(const void *_p1, const void *_p2) {\n  patient *p1 = (patient *)_p1;\n  patient *p2 = (patient *)_p2;\n  if (p1->age >= 60 && p1->age < 60)\n    return -1;\n  else if (p1->age < 60 && p2->age >= 60)\n    return 1;\n  else if (p1->age >= 60 && p2->age >= 60)\n    return p2->age - p1->age;\n  else\n    return 0;\n}\n"}
{"label": "9", "index": "15881", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[105];\n  char c[105][11];\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i], &a[i]);\n  int aa[105] = {0};\n  int num[105];\n  int u = 0;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      aa[i] = a[i];\n      num[u] = i;\n      u++;\n    }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (aa[i] > 0 && aa[i] == aa[j])\n        aa[i] = 0;\n    }\n  for (i = n; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (aa[j] < aa[j + 1]) {\n        int t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; aa[i] != 0; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == aa[i])\n        printf(\"%s\\n\", c[j]);\n    }\n  }\n  int tem = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < u; i++) {\n      if (j == num[i])\n        tem = 1;\n    }\n    if (tem == 0) {\n      printf(\"%s\\n\", c[j]);\n    }\n    tem = 0;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint main() {\n  int n, i;\n  struct patient *p, *pre, *pnew, *head1, *head2;\n  head1 = NULL;\n  head2 = NULL;\n  scanf(\"%d\\n\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    pnew = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\\n\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if (pnew->age >= 60) {\n      if (head1 == NULL) {\n        head1 = pnew;\n      } else {\n        p = head1;\n        while (p && p->age >= pnew->age) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head1) {\n          pnew->next = head1;\n          head1 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    } else {\n      if (head2 == NULL) {\n        head2 = pnew;\n      } else {\n        p = head2;\n        while (p) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head2) {\n          pnew->next = head2;\n          head2 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    }\n  }\n  p = head1;\n  if (head1 != NULL) {\n    while (p) {\n      printf(\"%s\\n\", p->id);\n      p = p->next;\n    }\n  }\n  p = head2;\n  if (head2 != NULL) {\n    while (p) {\n      printf(\"%s\\n\", p->id);\n      p = p->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[150], tmp, j;\n  char s[150][20], ts[20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++)\n      if (((a[j + 1] >= 60) && (a[j] < 60)) ||\n          ((a[j + 1] > a[j]) && (a[j] >= 60))) {\n        memcpy(ts, s[j], sizeof(ts));\n        memcpy(s[j], s[j + 1], sizeof(ts));\n        memcpy(s[j + 1], ts, sizeof(ts));\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", s[i]);\n}\n"}
{"label": "9", "index": "15884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n  struct pat *next;\n};\nint main() {\n  struct pat *head, *p;\n  int i, n;\n  void search(struct pat * head, int n);\n  scanf(\"%d\", &n);\n  head = (struct pat *)malloc(sizeof(struct pat));\n  p = head;\n  p->next = NULL;\n  scanf(\"%s %d\", p->id, &p->age);\n  for (i = 1; i < n; i++) {\n    p->next = (struct pat *)malloc(sizeof(struct pat));\n    p = p->next;\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n  }\n  search(head, n);\n}\nvoid search(struct pat *head, int n) {\n  int i, j = 0, k = 0;\n  struct pat *t, *m, *p, *head1, *head2;\n  struct pat *sort(struct pat * head1, int j);\n  void print(struct pat * head1, struct pat * head2, int j, int k);\n  p = head;\n  t = (struct pat *)malloc(sizeof(struct pat));\n  m = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    if (p->age >= 60) {\n      j++;\n      if (j == 1)\n        head1 = t;\n      strcpy(t->id, p->id);\n      t->age = p->age;\n      t->next = (struct pat *)malloc(sizeof(struct pat));\n      t = t->next;\n      t->next = NULL;\n    } else {\n      k++;\n      if (k == 1)\n        head2 = m;\n      strcpy(m->id, p->id);\n      m->age = p->age;\n      m->next = (struct pat *)malloc(sizeof(struct pat));\n      m = m->next;\n      m->next = NULL;\n    }\n    p = p->next;\n  }\n  sort(head1, j);\n  print(head1, head2, j, k);\n}\nstruct pat *sort(struct pat *head1, int j) {\n  int i, l, t;\n  char a[10];\n  struct pat *p1, *p2;\n  for (i = 0; i < j - 1; i++) {\n    p1 = head1;\n    for (l = 0; l < j - i - 1; l++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p1->age > p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n    }\n  }\n  return (head1);\n}\nvoid print(struct pat *head1, struct pat *head2, int j, int k) {\n  int i;\n  struct pat *p;\n  p = head1;\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  p = head2;\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int n, z[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &z[i]);\n  }\n  for (int j = 120; j >= 60; j--) {\n    for (int t = 0; t < n; t++) {\n      if (z[t] == j) {\n        printf(\"%s\\n\", s[t]);\n        z[t] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (z[m] != 0)\n      printf(\"%s\\n\", s[m]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  char data[10];\n  struct info *next;\n  int tip;\n};\n\nstruct info *create(int n) {\n  struct info *p1, *pre, *p2, *head, *tail;\n  int i, t;\n  head = (struct info *)malloc(sizeof(struct info));\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%s %d\", p1->data, &p1->num);\n  head->next = p1;\n  p1->next = NULL;\n  tail = p1;\n  i = 0;\n  while (i < n - 1) {\n    t = 0;\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d\", p1->data, &p1->num);\n    p1->next = NULL;\n    if (p1->num >= 60) {\n      for (pre = head, p2 = head->next; p2 != NULL && p2->num >= 60;\n           pre = pre->next, p2 = p2->next) {\n        if (p2->num < p1->num) {\n          pre->next = p1;\n          p1->next = p2;\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        pre->next = p1;\n        p1->next = p2;\n        if (p2 == NULL)\n          tail = p1;\n      }\n    } else {\n      tail->next = p1;\n      tail = p1;\n    }\n    i++;\n  }\n  return head;\n}\nvoid print(struct info *head) {\n  struct info *p;\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->data);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  print(head);\n}\n"}
{"label": "9", "index": "15887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Patient {\n  char id[10];\n  int age;\n  int num;\n} patient[100];\nint main() {\n  int n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  int i, j, k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", &patient[i].id, &patient[i].age);\n    patient[i].num = i;\n  }\n  int s[100];\n  for (i = 0; i <= 99; i++) {\n    s[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - 2; j++) {\n      if (patient[s[j]].age < patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (patient[i].age >= 60)\n      k = k + 1;\n  }\n  for (i = 0; i <= k - 2; i++) {\n    for (j = 0; j <= k - 2; j++) {\n      if (s[j] > s[j + 1] && patient[s[j]].age == patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = k; i <= n - 2; i++) {\n    for (j = k; j <= n - 2; j++) {\n      if (s[j] > s[j + 1]) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%s\\n\", patient[s[i]].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 0; j < n; j++) \n  {\n    for (i = 0; i < n - j - 1; i++) \n    {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]); \n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) \n  {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) \n  {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) \n      printf(\"%s \", id[i]);\n  }\n}\n"}
{"label": "9", "index": "15889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  int order;\n  char ID[10];\n  int age;\n} per[100];\nstruct old {\n  int orders;\n  char IDs[10];\n  int ages;\n} elder[100];\nint main() {\n  int n, i, j, t, m, q, r;\n  char p[10];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    per[i].order = i;\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n    b[i] = strlen(per[i].ID);\n  }\n  t = 0;\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age >= 60) {\n      elder[t].orders = t;\n      strcpy(elder[t].IDs, per[i].ID);\n      elder[t].ages = per[i].age;\n      t = t + 1;\n      per[i].age = (-1);\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - i - 1); j++) {\n      if (elder[j].ages < elder[j + 1].ages) {\n        m = elder[j].ages;\n        strcpy(p, elder[j].IDs);\n        q = elder[j].orders;\n        strcpy(elder[j].IDs, elder[j + 1].IDs);\n        elder[j].ages = elder[j + 1].ages;\n        elder[j].orders = elder[j + 1].orders;\n        elder[j + 1].ages = m;\n        strcpy(elder[j + 1].IDs, p);\n        elder[j + 1].orders = q;\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - 1 - j); j++) {\n      if (elder[j].ages == elder[j + 1].ages) {\n        if (elder[j].orders > elder[j + 1].orders) {\n          m = elder[j].ages;\n          strcpy(p, elder[j].IDs);\n          q = elder[j].orders;\n          strcpy(elder[j].IDs, elder[j + 1].IDs);\n          elder[j].ages = elder[j + 1].ages;\n          elder[j].orders = elder[j + 1].orders;\n          elder[j + 1].ages = m;\n          strcpy(elder[j + 1].IDs, p);\n          elder[j + 1].orders = q;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    printf(\"%s\\n\", elder[i].IDs);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age != (-1)) {\n      printf(\"%s\\n\", per[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15890", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, h = 0, k = 1, b = 0;\n  char a[120][20], c[120][20];\n  int y[120], Z[155][100] = {0}, cy[120];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i] >> y[i];\n  }\n\n  for (i = 60; i <= 150; i++) {\n    for (j = 1; j <= n; j++) {\n      Z[i][h] = 0;\n      if (i == y[j]) {\n        Z[i][h] = j;\n        h++;\n      }\n    }\n    h = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] < 60) {\n      strcpy(c[k], a[i]);\n      cy[k] = y[i];\n      b = k;\n      k++;\n    }\n  }\n\n  h = 0;\n  for (i = 150; i >= 60; i--) {\n    for (h = 0; h <= 10; h++) {\n      if (Z[i][h] == 0)\n        break;\n      else {\n        printf(\"%s\\n\", a[Z[i][h]]);\n      }\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15891", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100];\n  char d[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (j = 0; j <= n; j++)\n    if (a[j] >= 60)\n      b[j] = a[j] * 1000 - j;\n    else\n      b[j] = 1000 - j;\n  for (j = 0; j <= n; j++)\n    c[j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (b[j] >= b[i])\n        c[i]++;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (c[j] == i + 1)\n        printf(\"%s\\n\", d[j]);\n  return 0;\n}\n"}
{"label": "9", "index": "15892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  char id[11];\n  int nianling;\n} bing[100];\n\nint main() {\n  int n, i, j, e;\n  int youxian[100] = {0};\n  int zhengchang[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", bing[i].id, &bing[i].nianling);\n    if (bing[i].nianling >= 60)\n      youxian[i] = bing[i].nianling;\n    else\n      zhengchang[i] = bing[i].nianling;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (youxian[j] < youxian[j + 1]) {\n        e = youxian[j + 1];\n        youxian[j + 1] = youxian[j];\n        youxian[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == youxian[i]) {\n        printf(\"%s\\n\", bing[j].id);\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == zhengchang[i]) {\n        printf(\"%s\\n\", bing[j].id);\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15893", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct date {\n    char a[10];\n    int num;\n    struct date *next;\n  };\n  struct date *p1, *p2, *head;\n  int n, i, temp, j, compare;\n  char tem[10];\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct date *)malloc(1000);\n  scanf(\"%s %d\", head->a, &head->num);\n  head->next = NULL;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p2 = (struct date *)malloc(1000);\n    scanf(\"%s %d\", p2->a, &p2->num);\n    p2->next = NULL;\n    p1->next = p2;\n    p1 = p2;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 1; j <= i; j++) {\n      compare = strcmp(p1->a, p2->a);\n      if (p1->num < 60 && p2->num >= 60) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      if (p1->num >= 60 && p2->num >= 60 && p1->num < p2->num) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      p1 = p2;\n      p2 = p1->next;\n    }\n  }\n  p1 = p2 = head;\n  for (i = 1; i <= n; i++) {\n    printf(\"%s \", p2->a);\n    p1 = p2;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char id[11];\n  int nianling;\n} bing[100];\n\nint main() {\n  int n, i, j, e;\n  int youxian[100] = {0};\n  int zhengchang[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", bing[i].id, &bing[i].nianling);\n    if (bing[i].nianling >= 60)\n      youxian[i] = bing[i].nianling;\n    else\n      zhengchang[i] = bing[i].nianling;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (youxian[j] < youxian[j + 1]) {\n        e = youxian[j + 1];\n        youxian[j + 1] = youxian[j];\n        youxian[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == youxian[i]) {\n        cout << bing[j].id << \"\\n\";\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == zhengchang[i]) {\n        printf(\"%s\\n\", bing[j].id);\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[100] = {0}, b[100] = {0};\n  char id[100][20], temp[20], s[100][20];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> id[i] >> a[i];\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(s[j], id[i]);\n      j = j + 1;\n    }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i; k++)\n      if (b[k] < b[k + 1]) {\n        t = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = t;\n        strcpy(temp, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], temp);\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", s[k]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t;\n  struct ill {\n    char num[10];\n    int age, id;\n  } man[1000], ex;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> man[i].num >> man[i].age;\n    man[i].id = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].age < man[j].age) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (man[i].age < 60) {\n      t = i;\n      break;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = i + 1; j < t; j++) {\n      if (man[i].age == man[j].age && man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = t; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", man[i].num);\n  }\n\n  for (i = 0; i < n; i++)\n    ;\n  return 0;\n}\n"}
{"label": "9", "index": "15897", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= q; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char id[100][10], a[10];\n  int n, i, j;\n  int age[100], b;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\" %s %d\", &id[i], &age[i]);\n\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (age[i] >= 60 && age[i - 1] >= 60) {\n        if (age[i] > age[i - 1]) {\n          strcpy(a, id[i]);\n          b = age[i];\n          strcpy(id[i], id[i - 1]);\n          age[i] = age[i - 1];\n          strcpy(id[i - 1], a);\n          age[i - 1] = b;\n        }\n      }\n      if (age[i] >= 60 && age[i - 1] < 60) {\n        strcpy(a, id[i]);\n        b = age[i];\n        strcpy(id[i], id[i - 1]);\n        age[i] = age[i - 1];\n        strcpy(id[i - 1], a);\n        age[i - 1] = b;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%s\", id[i]);\n    else\n      printf(\"\\n%s\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int year;\n} pat[100];\nint arrange(struct patient peop[], int num);\n\nint main() {\n  int i, j = 0, k, n, max;\n  struct patient *ppat[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].id, &pat[i].year);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year >= 60) {\n      ppat[j] = pat + i;\n      j++;\n    }\n  }\n\n  struct patient *p;\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - 1 - i; k++) {\n      if ((*ppat[k]).year < (*ppat[k + 1]).year) {\n        p = ppat[k];\n        ppat[k] = ppat[k + 1];\n        ppat[k + 1] = p;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", ppat[i]->id);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year < 60)\n      cout << pat[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } patient[100], old[100], t;\n  int a, i = 0, j = 0, k = 0, r, i1;\n  scanf(\"%d\", &a);\n  getchar();\n  for (i = 0; j + i < a; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[j] = patient[i];\n      j++;\n      i--;\n    }\n  }\n  for (r = 0; r < j - 1; r++)\n    for (k = 0; k < j - 1 - r; k++)\n      if (old[k].age < old[k + 1].age) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (r = 0; r < j; r++) {\n    printf(\"%s\\n\", old[r].id);\n  }\n  for (r = 0; r < i; r++)\n    cout << patient[r].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct point {\n  char id[10];\n  int age;\n} old[100], small[100];\n\nint main() {\n  int n, i, j, o = 0, s = 0, t, m;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    char x[10] = {'\\0'};\n    t = 0;\n    scanf(\"%s %d\", x, &t);\n    if (t >= 60) {\n      strcpy(old[o].id, x);\n      old[o].age = t;\n      o++;\n\n    } else {\n      strcpy(small[s].id, x);\n      small[s].age = t;\n      s++;\n    }\n  }\n  char p[10];\n  for (i = 0; i < o; i++) {\n    for (j = 1; j < o - i; j++) {\n      if (old[i].age >= old[i + j].age) {\n        m = old[i + j].age;\n        old[i + j].age = old[i].age;\n        old[i].age = m;\n        strcpy(p, old[i + j].id);\n        strcpy(old[i + j].id, old[i].id);\n        strcpy(old[i].id, p);\n      }\n    }\n  }\n\n  for (i = o - 1; i >= 0; i--) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < s; i++)\n    printf(\"%s\\n\", small[i].id);\n}\n"}
{"label": "9", "index": "15902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct oldpeople {\n  char id[20];\n  int year;\n} old[100], old60[100], cache;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", old[i].id, &old[i].year);\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (old[i].year >= 60) {\n      old60[j] = old[i];\n      j++;\n    }\n  }\n  int k;\n  for (i = 0; i < j; i++) {\n    for (k = 0; k < j - i; k++) {\n      if (old60[k].year < old60[k + 1].year) {\n        cache = old60[k + 1];\n        old60[k + 1] = old60[k];\n        old60[k] = cache;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", old60[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (old[i].year < 60)\n      printf(\"%s\\n\", old[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, old[100] = {0}, t[100] = {0};\n  char num[100][10] = {0}, temp[100][10] = {0};\n  int x, z = 0;\n  char y[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> old[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (old[i] >= 60) {\n      strcpy(temp[z], num[i]);\n      t[z] = old[i];\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = z - 1; j > i; j--) {\n      if (t[j] > t[j - 1]) {\n        x = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = x;\n        strcpy(y, temp[j - 1]);\n        strcpy(temp[j - 1], temp[j]);\n        strcpy(temp[j], y);\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", temp[i]);\n  for (i = 0; i < n; i++) {\n    if (old[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15904", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, age[100], num[100], temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } patients[100];\n  struct old {\n    char ido[10];\n    int ao;\n  } olds[100];\n  struct young {\n    char idy[10];\n    int ay;\n  } youngs[100];\n  int n, y = 0, o = 0, so = 0, sy = 0, e;\n  scanf(\"%d\", &n);\n  char f[10];\n  for (int j = 0; j < n; j++) {\n    scanf(\"%s\", patients[j].id);\n    scanf(\"%d\", &patients[j].a);\n    if (patients[j].a < 60) {\n      strcpy(youngs[y].idy, patients[j].id);\n      youngs[y].ay = patients[j].a;\n      y++;\n    }\n    if (patients[j].a >= 60) {\n      strcpy(olds[o].ido, patients[j].id);\n      olds[o].ao = patients[j].a;\n      o++;\n    }\n  }\n  for (int r = o - 1; r > 0; r--) {\n    for (int i = 0; i < r; i++) {\n      if (olds[i].ao < olds[i + 1].ao) {\n        e = olds[i + 1].ao;\n        olds[i + 1].ao = olds[i].ao;\n        olds[i].ao = e;\n        strcpy(f, olds[i + 1].ido);\n        strcpy(olds[i + 1].ido, olds[i].ido);\n        strcpy(olds[i].ido, f);\n      }\n    }\n  }\n  for (int l = 0; l <= o - 1; l++) {\n    printf(\"%s\\n\", olds[l].ido);\n  }\n  for (int m = 0; m <= y - 1; m++) {\n    printf(\"%s\\n\", youngs[m].idy);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15906", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  int e;\n  char e_id[10];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < 60 && age[i + 1] >= 60) ||\n          (age[i] >= 60 && age[i + 1] >= 60 && age[i] < age[i + 1])) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct pat *p[100];\n  struct pat *old[100];\n  struct pat *young[100], *temp;\n\n  for (i = 0; i < n; i++) {\n    p[i] = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p[i]->ID, &p[i]->age);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i]->age >= 60) {\n      old[k] = p[i];\n      k++;\n    } else {\n      young[j] = p[i];\n      j++;\n    }\n  }\n  int lenold = k, lenyoung = j;\n  for (k = 1; k < lenold; k++) {\n    for (i = 0; i < lenold - k; i++) {\n      if (old[i]->age < old[i + 1]->age) {\n        temp = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < lenold; i++)\n    cout << old[i]->ID << \" \";\n\n  for (i = 0; i < lenyoung; i++) {\n    printf(\"%s \", young[i]->ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, l;\n  int a[100], c[100], d[100];\n  char b[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b[i]);\n    scanf(\"%d\", &a[i]);\n    d[i] = a[i];\n    c[i] = i;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (d[i] < d[i + 1]) {\n        k = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = k;\n        k = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = k;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (d[j] < 60) {\n      l = j;\n      break;\n    }\n  }\n  for (j = 0; j < l; j++) {\n    k = c[j];\n    printf(\"%s\\n\", b[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", b[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct people {\n  int order;\n  char ID[10];\n  int age;\n} per[100];\nstruct old {\n  int orders;\n  char IDs[10];\n  int ages;\n} elder[100];\nint main() {\n  int n, i, j, t, m, q, r;\n  char p[10];\n  int b[100], c[100];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    per[i].order = i;\n    cin >> per[i].ID >> per[i].age;\n    b[i] = strlen(per[i].ID);\n  }\n  t = 0;\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age >= 60) {\n      elder[t].orders = t;\n      strcpy(elder[t].IDs, per[i].ID);\n      elder[t].ages = per[i].age;\n      t = t + 1;\n      per[i].age = (-1);\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - i - 1); j++) {\n      if (elder[j].ages < elder[j + 1].ages) {\n        m = elder[j].ages;\n        strcpy(p, elder[j].IDs);\n        q = elder[j].orders;\n        strcpy(elder[j].IDs, elder[j + 1].IDs);\n        elder[j].ages = elder[j + 1].ages;\n        elder[j].orders = elder[j + 1].orders;\n        elder[j + 1].ages = m;\n        strcpy(elder[j + 1].IDs, p);\n        elder[j + 1].orders = q;\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - 1 - j); j++) {\n      if (elder[j].ages == elder[j + 1].ages) {\n        if (elder[j].orders > elder[j + 1].orders) {\n          m = elder[j].ages;\n          strcpy(p, elder[j].IDs);\n          q = elder[j].orders;\n          strcpy(elder[j].IDs, elder[j + 1].IDs);\n          elder[j].ages = elder[j + 1].ages;\n          elder[j].orders = elder[j + 1].orders;\n          elder[j + 1].ages = m;\n          strcpy(elder[j + 1].IDs, p);\n          elder[j + 1].orders = q;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    printf(\"%s\\n\", elder[i].IDs);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age != (-1)) {\n      printf(\"%s\\n\", per[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp, m = 0;\n  int patage[100];\n  struct patient {\n    char num[20];\n    int age;\n  };\n  struct patient pat[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      patage[j] = pat[i].age;\n      j++;\n      m++;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (patage[j] < patage[j + 1]) {\n        temp = patage[j];\n        patage[j] = patage[j + 1];\n        patage[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    if (patage[i] == patage[i - 1])\n      continue;\n    for (j = 0; j < n; j++)\n      if (pat[j].age == patage[i])\n        printf(\"%s\\n\", pat[j].num);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15911", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct Patient {\n    int flag;\n    char id[10];\n    int age;\n  };\n  struct Patient p[100], p2[100], temp;\n  int n, i, t = 0, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n    p[i].flag = 0;\n    if (p[i].age >= 60) {\n      t = t + 1;\n      p[i].flag = 1;\n    }\n    p2[i] = p[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++)\n      if (p[j].age < p[j + 1].age) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p2[i].flag == 0)\n      printf(\"%s\\n\", p2[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, k = 0, d[100], p;\n  char b[100][10], c[10], str[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      d[k] = a[i];\n      strcpy(b[k], str[i]);\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (d[j] < d[j + 1]) {\n        p = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = p;\n\n        strcpy(c, b[j + 1]);\n        strcpy(b[j + 1], b[j]);\n        strcpy(b[j], c);\n      }\n  for (i = 0; i < k; i++)\n    cout << b[i] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n}\n"}
{"label": "9", "index": "15913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, j, i, n, max, count, a[100];\n\n  char s[100][10];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    cin >> s[i] >> a[i];\n  }\n  n = 0;\n  for (count = 0; count < num; count++) {\n    max = 59;\n    for (i = 0; i < num; i++) {\n      if (a[i] > max && a[i] < 200) {\n        max = a[i];\n        j = i;\n      }\n    }\n    if (max == 59)\n      break;\n    cout << s[j] << \"\\n\";\n    a[j] = 300;\n  }\n  for (i = 0; i < num; i++) {\n    if (a[i] < 60)\n      cout << s[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[105];\n  char c[105][11];\n  int i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i], &a[i]);\n\n  int aa[105] = {0};\n  int num[105];\n  int u = 0;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      aa[i] = a[i];\n      num[u] = i;\n      u++;\n    }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (aa[i] > 0 && aa[i] == aa[j])\n        aa[i] = 0;\n    }\n  for (i = n; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (aa[j] < aa[j + 1]) {\n        int t = aa[j];\n        aa[j] = aa[j + 1];\n        aa[j + 1] = t;\n        \n      }\n    }\n  }\n  for (i = 0; aa[i] != 0; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == aa[i]) {\n        printf(\"%s\\n\", c[j]);\n      }\n    }\n  }\n  int tem = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < u; i++) {\n      if (j == num[i])\n        tem = 1;\n    }\n    if (tem == 0)\n      printf(\"%s\\n\", c[j]);\n    tem = 0;\n  }\n}\n"}
{"label": "9", "index": "15915", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct sick {\n  char num[10];\n  int age;\n};\nint main() {\n  int i, j, n;\n  int s;\n  char swap[10];\n  struct sick all[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &all[i].num);\n    cin >> all[i].age;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i; j > 0; j--) {\n      if (all[j].age >= 60 && all[j].age > all[j - 1].age) {\n        s = all[j].age;\n        all[j].age = all[j - 1].age;\n        all[j - 1].age = s;\n        strcpy(swap, all[j].num);\n        strcpy(all[j].num, all[j - 1].num);\n        strcpy(all[j - 1].num, swap);\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    puts(all[i].num);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15916", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, k, m, n, e, x, s[100], t[100], v = 0;\n  char zfc[100][10], jg[100][10], h[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    cin >> s[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] >= 60) {\n      t[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (s[t[k]] < s[t[k + 1]]) {\n        m = t[k + 1];\n        t[k + 1] = t[k];\n        t[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(zfc[t[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] < 60)\n      puts(zfc[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, l, b[100], n1 = 0, n2 = 0, ha[100], pp[100], x;\n  char a[100][11], yi[100][10], er[100][10], y[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      n1++;\n    } else {\n      n2++;\n    }\n  }\n  for (i = 0, k = 0, l = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      ha[k] = b[i];\n      strcpy(yi[k], a[i]);\n      k++;\n    } else {\n      pp[l] = b[i];\n      strcpy(er[l], a[i]);\n      l++;\n    }\n  }\n  for (i = 1; i < n1; i++) {\n    for (k = 0; k < n1 - i; k++) {\n      if (ha[k] < ha[k + 1]) {\n        x = ha[k];\n        ha[k] = ha[k + 1];\n        ha[k + 1] = x;\n        strcpy(y, yi[k]);\n        strcpy(yi[k], yi[k + 1]);\n        strcpy(yi[k + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    printf(\"%s\\n\", yi[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    printf(\"%s\\n\", er[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15918", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, m = 0, p, h;\n  char hao[100][10], mid[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", hao[i], &age[i]);\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60) {\n      m = m + 1;\n      for (j = i; j >= m; j--) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j - 1]);\n        strcpy(hao[j - 1], mid);\n        h = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = h;\n      }\n    }\n\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (age[j] < age[j + 1]) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j + 1]);\n        strcpy(hao[j + 1], mid);\n        h = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = h;\n      }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", hao[i]);\n}\n"}
{"label": "9", "index": "15919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char str[10];\n  int age;\n} per[100], per1[100], per2[100];\n\nint main(int argc, char *argv[]) {\n  int n, i, j = 0, k = 0, x = 0, t;\n  char e[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", per[i].str, &per[i].age);\n    if (per[i].age >= 60) {\n      strcpy(per1[j].str, per[i].str);\n      per1[j].age = per[i].age;\n      j++;\n    } else {\n      strcpy(per2[k].str, per[i].str);\n      per2[k].age = per[i].age;\n      k++;\n    }\n  }\n  for (x = 0; x < j; x++) {\n    for (i = 0; i < j - x; i++) {\n      if (per1[i].age < per1[i + 1].age) {\n        strcpy(e, per1[i].str);\n        strcpy(per1[i].str, per1[i + 1].str);\n        strcpy(per1[i + 1].str, e);\n        t = per1[i].age;\n        per1[i].age = per1[i + 1].age;\n        per1[i + 1].age = t;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << per1[i].str << \"\\n\";\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", per2[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15920", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n\n  int n, j = 0, i, num = 0, t;\n  char a[100][10], d[100][10], temp[10];\n  int b[100], c[100];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[j] = b[i];\n      strcpy(d[j], a[i]);\n      j++;\n      num = j;\n    }\n  }\n  for (i = 1; i < num; i++)\n    for (j = 0; j < num - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = t;\n        strcpy(temp, d[j + 1]);\n        strcpy(d[j + 1], d[j]);\n        strcpy(d[j], temp);\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      c[num] = b[i];\n      strcpy(d[num], a[i]);\n      num++;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%s\\n\", d[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int age[100], i, j, k, p = 0, n;\n  char a[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &age[i]);\n    if (age[i] >= 60)\n      p++;\n  }\n  for (j = 1; j <= p; j++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (age[i] > age[k])\n        k = i;\n    }\n    printf(\"%s\\n\", a[k]);\n    age[k] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "15922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int renshu, nianling[1000][2], bijiao[1000][2];\n  char id[1000][1000];\n  scanf(\"%d\", &renshu);\n  int i, j, k;\n  j = 0;\n  k = 0;\n  for (i = 0; i < renshu; i++) {\n    cin >> id[i] >> nianling[i][0];\n  }\n  for (i = 0; i < renshu; i++) {\n    if (nianling[i][0] < 60)\n      ;\n    else {\n      nianling[i][1] = i;\n      bijiao[k][0] = nianling[i][0];\n      bijiao[k][1] = i;\n      k++;\n    }\n  }\n  int zhongjian[2], l;\n  l = k;\n  bijiao[l][0] = 10000;\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l; j++) {\n      if (bijiao[j][0] > bijiao[j + 1][0]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else if (bijiao[j][0] == bijiao[j + 1][0] &&\n                 bijiao[j][1] < bijiao[j + 1][1]) {\n        zhongjian[0] = bijiao[j + 1][0];\n        zhongjian[1] = bijiao[j + 1][1];\n        bijiao[j + 1][0] = bijiao[j][0];\n        bijiao[j + 1][1] = bijiao[j][1];\n        bijiao[j][0] = zhongjian[0];\n        bijiao[j][1] = zhongjian[1];\n      } else\n        ;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < renshu; j++) {\n      if (bijiao[l - 1 - i][0] == nianling[j][0] &&\n          bijiao[l - i - 1][1] == nianling[j][1])\n        printf(\"%s\\n\", id[j]);\n      else\n        ;\n    }\n  }\n  for (j = 0; j < renshu; j++) {\n    if (nianling[j][0] < 60)\n      printf(\"%s\\n\", id[j]);\n    else\n      ;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Pa {\n  char num[20];\n  int year;\n} pa[100];\nint main() {\n  int i, j, x = 0, d = 0, m, n;\n  int b[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa[i].num, &pa[i].year);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = pa[i].year;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        d = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      if (i == 0) {\n        for (j = 0; j < n; j++) {\n          if (pa[j].year == b[i])\n            printf(\"%s\\n\", pa[j].num);\n        }\n      } else {\n        if (b[i] != b[i - 1]) {\n          for (j = 0; j < n; j++) {\n            if (pa[j].year == b[i])\n              cout << pa[j].num << \"\\n\";\n          }\n        }\n      }\n    }\n    if (b[i] < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].year < 60)\n      printf(\"%s\\n\", pa[i].num);\n  }\n}\n"}
{"label": "9", "index": "15924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100];\n  char d[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> d[i] >> a[i];\n  for (j = 0; j <= n; j++)\n    if (a[j] >= 60)\n      b[j] = a[j] * 1000 - j;\n    else\n      b[j] = 1000 - j;\n  for (j = 0; j <= n; j++)\n    c[j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (b[j] >= b[i])\n        c[i]++;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (c[j] == i + 1)\n        cout << d[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nint main() {\n  int j, max, t = 1, n, i;\n  struct patient p[101];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  for (; t != 0;) {\n    max = 59;\n    t = 0;\n    for (i = 1; i <= n; i++) {\n      if (p[i].age > max) {\n        max = p[i].age;\n        t = i;\n      }\n    }\n    if (t != 0)\n      printf(\"%s\\n\", p[t].id);\n    p[t].age = 0;\n  }\n  for (i = 1; i <= n; i++)\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = 0, q = 0, k, z, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> c[i] >> a[i];\n    if (a[i] >= 60) {\n      p++;\n      e[i - q] = a[i];\n      strcpy(b[i - q], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[i - p] = a[i];\n      strcpy(d[i - p], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p; k++) {\n    for (i = 0; i < p - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i < q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[20];\n  int age;\n};\nint main() {\n  struct person a[100] = {0}, b[100] = {0}, t;\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    puts(b[i].ID);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      puts(a[i].ID);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int amount_lao = 0, amount_yiban = 0;\n  char c[11];\n  int shuru;\n  int i, j, k, s, p;\n  struct xinxi {\n    char id[11];\n    int age;\n  };\n  struct xinxi laoren[100];\n  struct xinxi common[100];\n  struct xinxi temp;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    cin >> c >> shuru;\n    if (shuru < 60) {\n      strcpy(common[amount_yiban].id, c);\n      common[amount_yiban].age = shuru;\n      amount_yiban++;\n    } else if (shuru >= 60) {\n      strcpy(laoren[amount_lao].id, c);\n      laoren[amount_lao].age = shuru;\n      amount_lao++;\n    }\n  }\n  for (i = 0; i < amount_lao - 1; i++) {\n    for (j = 0; j < amount_lao - i - 1; j++) {\n      if (laoren[j].age < laoren[j + 1].age) {\n        strcpy(temp.id, laoren[j].id);\n        temp.age = laoren[j].age;\n        strcpy(laoren[j].id, laoren[j + 1].id);\n        laoren[j].age = laoren[j + 1].age;\n        strcpy(laoren[j + 1].id, temp.id);\n        laoren[j + 1].age = temp.age;\n      }\n    }\n  }\n  for (k = 0; k < amount_lao; k++) {\n    puts(laoren[k].id);\n    printf(\" \");\n  }\n  for (s = 0; s < amount_yiban; s++) {\n    puts(common[s].id);\n    printf(\" \");\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15929", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[100];\n  int age;\n};\n\nint main() {\n\n  struct data old[1000];\n  struct data young[1000];\n  struct data temp;\n  int n, i, p = 0, q = 0, len1, len2, k;\n  char id[100];\n  int age;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &age);\n    if (age >= 60) {\n      old[p].age = age;\n      strcpy(old[p].id, id);\n      p++;\n    } else {\n      young[q].age = age;\n      strcpy(young[q].id, id);\n      q++;\n    }\n  }\n  len1 = p;\n  len2 = q;\n  for (k = 1; k < len1; k++) {\n    for (i = 0; i < len1 - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        temp = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < len1; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < len2; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15930", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], i = 0, a[100], b[100], p = 0, q = 0, m = 0;\n  char sz1[100][100], a1[100][100], b1[100][100], e[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", sz1[i], &sz[i]);\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      a[p] = sz[i];\n      strcpy(a1[p], sz1[i]);\n      p++;\n    }\n    if (sz[i] < 60) {\n      b[q] = sz[i];\n      strcpy(b1[q], sz1[i]);\n      q++;\n    }\n  }\n  for (i = 1; i < p; i++) {\n    for (m = 0; m < p - i; m++) {\n      if (a[m] < a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n        strcpy(e, a1[m]);\n        strcpy(a1[m], a1[m + 1]);\n        strcpy(a1[m + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", a1[i]);\n  for (m = 0; m < q; m++)\n    printf(\"%s\\n\", (b1[m]));\n\n  return 0;\n}\n"}
{"label": "9", "index": "15931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], zs[100], i, k = 0, m, a;\n  char id[100][10], di[100][10], zfc[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(sz[i]));\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      zs[k] = sz[i];\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (m = 0; m < k - 1; m++) {\n    for (i = 0; i < k - 1 - m; i++) {\n      if (zs[i] < zs[i + 1]) {\n        a = zs[i];\n        zs[i] = zs[i + 1];\n        zs[i + 1] = a;\n        strcpy(zfc, di[i]);\n        strcpy(di[i], di[i + 1]);\n        strcpy(di[i + 1], zfc);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << di[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, j = 0, k = 0, l;\n  struct patient b[100];\n  struct patient c[100];\n  struct patient t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pat[i].name, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      b[j] = pat[i];\n      j++;\n    } else {\n      c[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (l = 0; l < k - 1 - i; l++)\n      if (c[l].age < c[l + 1].age) {\n        t = c[l];\n        c[l] = c[l + 1];\n        c[l + 1] = t;\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].name);\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].name);\n  return 0;\n}\n"}
{"label": "9", "index": "15933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct bingren {\n  char id[20];\n  int age;\n} bing[100] = {'\\0', 0};\n\nstruct laoren {\n  char oid[20];\n  int oage;\n} lao[100] = {'\\0', 0};\n\nint main() {\n  int n, i, j = 0, l;\n  struct laoren temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", bing[i].id);\n    scanf(\"%d\", &bing[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 60) {\n      strcpy(lao[j].oid, bing[i].id);\n      lao[j].oage = bing[i].age;\n      bing[i].age = -1;\n      j++;\n    } else\n      continue;\n  }\n  for (l = 0; l < j; l++) {\n    for (i = 0; i < j - l; i++) {\n      if (lao[i].oage < lao[i + 1].oage) {\n        temp = lao[i];\n        lao[i] = lao[i + 1];\n        lao[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    printf(\"%s\\n\", lao[i].oid);\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 0) {\n      printf(\"%s\\n\", bing[i].id);\n    } else\n      continue;\n  }\n}\n"}
{"label": "9", "index": "15934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Patient {\n    char ID[10];\n    int age;\n  } patient[100], patient2[100];\n  struct Patient t;\n  int n, i = 0, j = 0, k = 0, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patient[i].ID, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age >= 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  num = j;\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  for (k = 1; k < num; k++) {\n    for (i = 0; i < num - k; i++) {\n      if (patient2[i + 1].age > patient2[i].age) {\n        t = patient2[i + 1];\n        patient2[i + 1] = patient2[i];\n        patient2[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << patient2[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15935", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n};\nint main() {\n  struct patient *head, *p1, *p2, *p0;\n  int i, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct patient *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p1->id, &p1->age);\n    p1->next = NULL;\n    if (i == 0) {\n      head = p1;\n    } else {\n      if ((p1->age > 60) && (p1->age > head->age)) {\n        p0 = head;\n        p1->next = p0;\n        head = p1;\n      } else {\n        p0 = head;\n        p2 = head->next;\n        if ((p1->age) < 60) {\n          while (p2 != NULL) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n        } else {\n          while ((p2 != NULL) && ((p1->age) <= (p2->age))) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n          p1->next = p2;\n        }\n      }\n    }\n    p1 = (struct patient *)malloc(1000);\n  }\n\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  printf(\"%s\", p1->id);\n}\n"}
{"label": "9", "index": "15936", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct br {\n    char no[10];\n    int s;\n  } a[100], b[100], r;\n  int n, i, j, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].no, &a[i].s);\n    if (a[i].s >= 60) {\n      b[t] = a[i];\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++)\n      if (b[j].s < b[j + 1].s) {\n        r = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = r;\n      }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", b[i].no);\n  for (i = 0; i < n; i++)\n    if (a[i].s >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", a[i].no);\n}\n"}
{"label": "9", "index": "15937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  int age;\n  char id[12];\n};\nvoid swap(struct patient *a, struct patient *b) {\n  struct patient tmp;\n  tmp = *a;\n  *a = *b;\n  *b = tmp;\n}\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct patient tmp;\n  struct patient young[120];\n  struct patient old[120];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", tmp.id);\n    cin >> tmp.age;\n    if (tmp.age >= 60)\n      old[j++] = tmp;\n    else\n      young[k++] = tmp;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = 0; l < j - i - 1; l++) {\n      if (old[l].age < old[l + 1].age)\n        swap(&old[l], &old[l + 1]);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct s {\n    char id[10];\n    int age;\n  };\n  struct s S[100], Si;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> S[i].id >> S[i].age;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (S[j + 1].age >= 60) {\n        if (S[j].age < S[j + 1].age) {\n          Si = S[j];\n          S[j] = S[j + 1];\n          S[j + 1] = Si;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << S[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, mid;\n  char M[11];\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[11];\n    int age;\n  };\n  struct patient *per = (struct patient *)malloc(sizeof(struct patient) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", per[i].ID, &per[i].age);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (per[i].age < 60 && per[i + 1].age >= 60) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n      if (per[i].age >= 60 && per[i + 1].age >= 60 &&\n          per[i].age < per[i + 1].age) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", per[i].ID);\n  free(per);\n}\n"}
{"label": "9", "index": "15940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *sort(struct patient *head, char d[10], int a) {\n  struct patient *pp, *p, *s;\n  p = head;\n  pp = p;\n  p = p->next;\n  s = (struct patient *)malloc(1000);\n  strcpy(s->id, d);\n  s->age = a;\n  while (p != NULL && p->age >= a) {\n    pp = p;\n    p = p->next;\n  }\n  s->next = p;\n  pp->next = s;\n}\n\nstruct patient *creat(struct patient *hhead, char d[10], int a) {\n  struct patient *p, *pp, *s;\n  p = hhead;\n  pp = p;\n  p = p->next;\n  while (p != NULL) {\n    pp = p;\n    p = p->next;\n  }\n  s = (struct patient *)malloc(1000);\n  s->age = a;\n  strcpy(s->id, d);\n  s->next = p;\n  pp->next = s;\n}\n\nint main() {\n  struct patient *head, *hhead, *p1, *p2;\n  int n, a, i;\n  char d[10];\n  cin >> n;\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  hhead = (struct patient *)malloc(1000);\n  hhead->next = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d \", d, &a);\n    if (a >= 60)\n      sort(head, d, a);\n    else\n      creat(hhead, d, a);\n  }\n  p1 = head->next;\n  p2 = hhead->next;\n  while (p1 != NULL) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  while (p2 != NULL) {\n    printf(\"%s \", p2->id);\n    p2 = p2->next;\n  }\n}\n"}
{"label": "9", "index": "15941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char str[10];\n  int age;\n} per[100], per1[100], per2[100];\n\nint main(int argc, char *argv[]) {\n  int n, i, j = 0, k = 0, x = 0, t;\n  char e[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", per[i].str, &per[i].age);\n    if (per[i].age >= 60) {\n      strcpy(per1[j].str, per[i].str);\n      per1[j].age = per[i].age;\n      j++;\n    } else {\n      strcpy(per2[k].str, per[i].str);\n      per2[k].age = per[i].age;\n      k++;\n    }\n  }\n  for (x = 0; x < j; x++) {\n    for (i = 0; i < j - x; i++) {\n      if (per1[i].age < per1[i + 1].age) {\n        strcpy(e, per1[i].str);\n        strcpy(per1[i].str, per1[i + 1].str);\n        strcpy(per1[i + 1].str, e);\n        t = per1[i].age;\n        per1[i].age = per1[i + 1].age;\n        per1[i + 1].age = t;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", per1[i].str);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", per2[i].str);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], dengji[100], p, t;\n  char id[100][10], c;\n  int jishuqi = 0, k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    dengji[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        k = dengji[j];\n        dengji[j] = dengji[j + 1];\n        dengji[j + 1] = k;\n        for (p = 0; p <= 9; p++) {\n          c = id[j][p];\n          id[j][p] = id[j + 1][p];\n          id[j + 1][p] = c;\n        }\n      }\n      if (age[j] == age[j + 1]) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < 60) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          t = age[j];\n          age[j] = age[j + 1];\n          age[j + 1] = t;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%s\\n\", id[i]);\n}\n"}
{"label": "9", "index": "15943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct p {\n    char id[30];\n    int ag;\n  } a[105], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].ag);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[j - 1].ag >= 60 && a[j].ag >= 60) {\n        if (a[j - 1].ag < a[j].ag) {\n          temp = a[j - 1];\n          a[j - 1] = a[j];\n          a[j] = temp;\n        }\n      } else if (a[j - 1].ag < 60 && a[j].ag >= 60) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n}\n"}
{"label": "9", "index": "15944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct br {\n    char no[10];\n    int s;\n  } a[100], b[100], r;\n  int n, i, j, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].no, &a[i].s);\n    if (a[i].s >= 60) {\n      b[t] = a[i];\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++)\n      if (b[j].s < b[j + 1].s) {\n        r = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = r;\n      }\n  for (i = 0; i < t; i++)\n    cout << b[i].no << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (a[i].s >= 60)\n      continue;\n    else\n      cout << a[i].no << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], i, e, k;\n  char id[100][10], p[10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> a[i];\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = n - 1; i > k - 1; i--) {\n      if (a[i] > a[i - 1] && a[i] >= 60) {\n        e = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = e;\n        strcpy(p, id[i]);\n        strcpy(id[i], id[i - 1]);\n        strcpy(id[i - 1], p);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct bing {\n  char id[10];\n  int age;\n};\n\nint main() {\n  struct bing peo[120], old[120], young[120], temp;\n  int i, j, n, num1 = 0, num2 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> peo[i].id >> peo[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      old[num1] = peo[i];\n      num1 = num1 + 1;\n    } else {\n      young[num2] = peo[i];\n      num2 = num2 + 1;\n    }\n  }\n\n  for (i = 0; i < num1 - 1; i++)\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n\n  for (i = 0; i < num1; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < num2; i++)\n    printf(\"%s\\n\", young[i].id);\n}\n"}
{"label": "9", "index": "15947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n  struct pa *next;\n};\nstruct pa *insert(struct pa *head, struct pa *new1) {\n  struct pa *p0, *p1, *p2;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else if (p0->age >= 60) {\n    while ((p1->age >= p0->age) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->age > p1->age) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  } else {\n    p1 = head;\n    while (p1 != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p2->next = p0;\n    p0->next = NULL;\n  }\n  return (head);\n}\nint main() {\n  struct pa *p, *head;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s%d\\n\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = 0, q = 0, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[i - q] = a[i];\n      strcpy(b[i - q], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[i - p] = a[i];\n      strcpy(d[i - p], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p; k++) {\n    for (i = 0; i < p - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i < q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  int a6;\n  char Id[10];\n};\n\nint main() {\n  struct patient bin[1000];\n  int n, mid;\n  char s[10];\n  int i = 0, j = 0, k = 0;\n  char c[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &bin[i].ID, &bin[i].age);\n  for (i = 0; i < n; i++) {\n    if (bin[i].age >= 60) {\n      bin[j].a6 = bin[i].age;\n      strcpy(bin[j].Id, bin[i].ID);\n      j++;\n      bin[i].age = 0;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++)\n      if (bin[i].a6 < bin[i + 1].a6) {\n        mid = bin[i].a6;\n        bin[i].a6 = bin[i + 1].a6;\n        bin[i + 1].a6 = mid;\n\n        strcpy(c, bin[i].Id);\n        strcpy(s, bin[i + 1].Id);\n        strcpy(bin[i + 1].Id, c);\n        strcpy(bin[i].Id, s);\n      }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", bin[i].Id);\n  for (i = 0; i < n; i++) {\n    if (bin[i].age != 0)\n      printf(\"%s \", bin[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15950", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[100] = {0}, b[100] = {0};\n  char id[100][20], temp[20], s[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &a[i]);\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(s[j], id[i]);\n      j = j + 1;\n    }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i; k++)\n      if (b[k] < b[k + 1]) {\n        t = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = t;\n        strcpy(temp, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], temp);\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", s[k]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  char num[20];\n  int score;\n  struct stu *next;\n};\nvoid sort(struct stu *head, struct stu *q) {\n  struct stu *pre = head, *p = pre->next, *s;\n  s = (struct stu *)malloc(sizeof(struct stu));\n  s->score = q->score;\n  strcpy(s->num, q->num);\n  s->next = NULL;\n  if (s->score >= 60) {\n    while ((p != NULL) && (q->score <= p->score)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while ((p != NULL)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n\n  p = head;\n  while (p != NULL) {\n\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  int n, k, i;\n  struct stu *head;\n  struct stu *p;\n  head = (struct stu *)malloc(sizeof(struct stu));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%s %d\", p->num, &p->score);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "15952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int n, z[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &z[i]);\n  }\n  for (int j = 120; j >= 60; j--) {\n    for (int t = 0; t < n; t++) {\n      if (z[t] == j) {\n        printf(\"%s\\n\", s[t]);\n        z[t] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (z[m] != 0)\n      cout << s[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char s[100][11], z[11];\n  int g[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (g[j - 1] < g[j] && g[j] >= 60) {\n        strcpy(z, s[j - 1]);\n        strcpy(s[j - 1], s[j]);\n        strcpy(s[j], z);\n        c = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s\\n\", s[i]);\n  }\n  if (i == n - 1) {\n    printf(\"%s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age, arranged;\n};\n\nint main() {\n  int n, i, t = 0, j;\n  struct Patient pai[100], orderd[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pai[i].id >> pai[i].age;\n    pai[i].arranged = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].age >= 60) {\n      orderd[t] = pai[i];\n      pai[i].arranged = 1;\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (orderd[j].age < orderd[j + 1].age) {\n        struct Patient temp = orderd[j];\n        orderd[j] = orderd[j + 1];\n        orderd[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].arranged == 0) {\n      orderd[t] = pai[i];\n      t++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", orderd[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, e, age[100], six[100];\n  j = 0;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &id[i]);\n    scanf(\"%d\", &age[i]);\n    if (age[i] >= 60) {\n      six[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (age[six[k]] < age[six[k + 1]]) {\n        e = six[k + 1];\n        six[k + 1] = six[k];\n        six[k] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", id[six[i]]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100] = {0}, t, sum = 0;\n  char s[100][10], sb[100][10], st[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], a + i);\n    if (a[i] >= 60)\n      c[i] = 1, b[sum] = a[i], strcpy(sb[sum], s[i]), sum++;\n  }\n  for (i = 1; i < sum; i++)\n    for (j = 0; j < sum - i; j++)\n      if (b[j] < b[j + 1])\n        t = b[j], b[j] = b[j + 1], b[j + 1] = t, strcpy(st, sb[j]),\n        strcpy(sb[j], sb[j + 1]), strcpy(sb[j + 1], st);\n  for (i = 0; i < sum; i++)\n    printf(\"%s\\n\", sb[i]);\n  for (i = 0; i < n; i++)\n    if (c[i] == 0)\n      printf(\"%s\\n\", s[i]);\n}\n"}
{"label": "9", "index": "15957", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100];\n  scanf(\"%d\", &n);\n  char zf[100][10], id[10];\n  int i, k, e = 0;\n  for (i = 0; i < n; i++) {\n    cin >> zf[i] >> (sz[i]);\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i + 1] >= 60 && sz[i + 1] > sz[i]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n        strcpy(id, zf[i]);\n        strcpy(zf[i], zf[i + 1]);\n        strcpy(zf[i + 1], id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", zf[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][1000];\n  int b[100];\n  char c[100][1000];\n  int q, w, e;\n  q = 0;\n  w = 0;\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int y;\n    char x[100][1000];\n    scanf(\"%s %d\", x, &y);\n    if (y >= 60) {\n      strcpy(a[q], x[0]);\n      b[q] = y;\n      q++;\n    } else {\n      strcpy(c[w], x[0]);\n      w++;\n    }\n  }\n  int h;\n  char H[100][1000];\n  for (i = 1; i < 10000; i++) {\n    for (j = 0; j < q; j++) {\n      if (b[j] < b[j + 1]) {\n        h = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = h;\n        strcpy(H[0], a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], H[0]);\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%s\\n\", c[i]);\n}\n"}
{"label": "9", "index": "15959", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } * p, *p60_up, *p60_low, t;\n\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &(p[i].id));\n    cin >> (p[i].age);\n  }\n  for (i = 0; i <= n; i++) {\n    if (p[i].age >= 60) {\n      k++;\n    }\n  }\n  p60_up = (struct patient *)malloc(sizeof(struct patient) * k);\n  p60_low = (struct patient *)malloc(sizeof(struct patient) * (n - k));\n\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      p60_up[j] = p[i];\n      j++;\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      p60_low[j] = p[i];\n      j++;\n    }\n  }\n  for (j = 1; j <= k; j++) {\n    for (i = 0; i < k - j; i++) {\n      if (p60_up[i].age < p60_up[i + 1].age) {\n        t = p60_up[i + 1];\n        p60_up[i + 1] = p60_up[i];\n        p60_up[i] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    puts(p60_up[i].id);\n  }\n  free(p60_up);\n  for (i = 0; i < n - k; i++)\n    puts(p60_low[i].id);\n\n  free(p60_low);\n\n  return 0;\n}\n"}
{"label": "9", "index": "15960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct sick {\n  char name[10];\n  int age;\n};\nint main() {\n  int n, i, count = 0, j;\n  struct sick s[100], a[100], t;\n  char b[3];\n\n  cin >> b;\n  n = atoi(b);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].name, &s[i].age);\n  if (n == 1)\n    cout << s[0].name;\n  else {\n    for (i = 0; i < n; i++)\n      if (s[i].age >= 60) {\n        a[count] = s[i];\n        count++;\n      }\n    for (i = 0; i < count - 1; i++)\n      for (j = 0; j < count - 1 - i; j++)\n        if (a[j].age < a[j + 1].age) {\n          t = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = t;\n        }\n    for (i = 0; i < count; i++)\n      printf(\"%s \", a[i].name);\n    for (i = 0; i < n; i++)\n      if (s[i].age < 60)\n        printf(\"%s \", s[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15961", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct data *pdata;\n\nstruct data {\n  char a[20];\n  int b;\n  pdata next;\n};\n\npdata sort(int n) {\n  pdata p = NULL, q = NULL, s = NULL, head = NULL;\n  head = (pdata)malloc(sizeof(struct data));\n  head->next = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    s = (pdata)malloc(sizeof(struct data));\n    scanf(\"%s %d\", s->a, &(s->b));\n    if (s->b >= 60) {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->b < s->b)\n          break;\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = NULL;\n    }\n  }\n\n  return head;\n}\n\nint main() {\n  int n, i;\n  pdata p, head;\n  scanf(\"%d\", &n);\n  head = sort(n);\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15962", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100] = {0}, c[100] = {0}, d[100] = {0}, e[100] = {0};\n  char a[100][100];\n  for (i = 0; i < 100; i++) {\n    b[i] = i;\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &c[i]);\n    if (c[i] > 59) {\n      d[i] = c[i];\n    } else\n      e[i] = c[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (d[b[j]] < d[b[j + 1]]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (d[b[i]] > 0) {\n      printf(\"%s\\n\", a[b[i]]);\n    } else {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (e[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15963", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct man {\n    char a[11];\n    int y;\n  } man[100];\n  int n;\n  cin >> n;\n  char b[11];\n  int y;\n  int i, j;\n  char c[100][11];\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b, &y);\n    if (y >= 60) {\n      strcpy(man[k].a, b);\n      man[k].y = y;\n      k++;\n    } else {\n      strcpy(c[m], b);\n      m++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      int y1, y2;\n      y1 = man[j].y;\n      y2 = man[j + 1].y;\n      if (y1 < y2) {\n        y = man[j + 1].y;\n        man[j + 1].y = man[j].y;\n        man[j].y = y;\n        strcpy(b, man[j + 1].a);\n        strcpy(man[j + 1].a, man[j].a);\n        strcpy(man[j].a, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(b, man[i].a);\n    printf(\"%s\\n\", b);\n  }\n  for (i = 0; i < m; i++) {\n    strcpy(b, c[i]);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15964", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[11];\n  int age;\n  struct patient *next;\n};\n\nint main() {\n  struct patient *head;\n  struct patient *create(int n);\n  void sort(struct patient * head);\n  int n;\n  scanf(\"%d\", &n);\n  head = create(n);\n  sort(head);\n\n  return 0;\n}\n\nstruct patient *create(int n) {\n  int i;\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  p2 = p1;\n  scanf(\"%s %d\", p1->id, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    (p2->next) = p1;\n    p2 = p1;\n    if (i == (n - 1))\n      (p1->next) = NULL;\n  }\n  return head;\n}\n\nvoid sort(struct patient *head) {\n  int m;\n  struct patient *p1, *p2;\n\n  for (;;) {\n    p1 = head;\n    p2 = head;\n    m = 0;\n    for (;;) {\n      if ((p1->age) > m)\n        m = (p1->age);\n      if ((p1->next) == NULL)\n        break;\n      else\n        p1 = (p1->next);\n    }\n    if (m < 60)\n      break;\n    p1 = head;\n    for (;;) {\n      if ((p1->age) == m) {\n        printf(\"%s \", p1->id);\n        if (p1 == head)\n          head = (p1->next);\n        else {\n          (p2->next) = (p1->next);\n        }\n        break;\n      } else {\n        if (p1 != p2) {\n          p2 = p1;\n          p1 = (p1->next);\n        } else\n          p1 = (p1->next);\n      }\n    }\n  }\n  p1 = head;\n  for (;;) {\n    printf(\"%s \", p1->id);\n    if ((p1->next) == NULL)\n      break;\n    else\n      p1 = (p1->next);\n  }\n}\n"}
{"label": "9", "index": "15965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct patient *)malloc(1000);\n    cin >> p1->id >> p1->age;\n    p1->next = NULL;\n    i++;\n    p2->next = p1;\n    p2 = p1;\n  } while (i < n);\n  return (head);\n}\n\nstruct patient *tiao(struct patient *head, int n) {\n  struct patient *p1;\n  int t, i;\n  char s[10];\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    do {\n      if (p1->age < (p1->next)->age && (p1->next)->age >= 60) {\n        t = p1->age;\n        p1->age = (p1->next)->age;\n        (p1->next)->age = t;\n        strcpy(s, p1->id);\n        strcpy(p1->id, (p1->next)->id);\n        strcpy((p1->next)->id, s);\n      }\n      p1 = p1->next;\n    } while (p1->next);\n  }\n\n  return (head);\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p);\n}\n\nint main() {\n  struct patient *head;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = tiao(head, n);\n  print(head);\n}\n"}
{"label": "9", "index": "15966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct hospital {\n  char ID[13];\n  int age;\n  struct hospital *next;\n};\nint main() {\n  void change(struct hospital *);\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  struct hospital *p, *head;\n  p = (struct hospital *)malloc(sizeof(struct hospital));\n  head = p;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    p->next = (struct hospital *)malloc(sizeof(struct hospital));\n    p = p->next;\n  }\n  scanf(\"%s %d\", p->ID, &p->age);\n  p->next = NULL;\n  for (i = 0; i < n; i++) {\n    for (p = head; p->next != NULL; p = p->next) {\n      if (p->age < 60 && p->next->age >= 60) {\n        change(p);\n      }\n      if (p->age >= 60 && p->next->age >= 60 && p->next->age > p->age) {\n        change(p);\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    printf(\"%s\\n\", p->ID);\n  }\n  return 0;\n}\nvoid change(struct hospital *p) {\n  int tempage;\n  char tempID[13];\n  struct hospital *later = p->next;\n  tempage = later->age;\n  strcpy(tempID, later->ID);\n  later->age = p->age;\n  strcpy(later->ID, p->ID);\n  p->age = tempage;\n  strcpy(p->ID, tempID);\n}\n"}
{"label": "9", "index": "15967", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, age, m, y;\n  int b[1000];\n  char B[1000][100], C[1000][100], d[1000][100];\n  char a[1000];\n  cin >> n;\n  y = 0;\n  k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a >> age;\n    if (age < 60) {\n      strcpy(B[y], a);\n      y++;\n    } else {\n      strcpy(C[k], a);\n      b[k] = age;\n      k++;\n    }\n  }\n  int x = 0;\n  for (i = 200; i >= 60; i--) {\n    for (j = 0; j <= k - 1; j++) {\n      if (i == b[j]) {\n        strcpy(d[x], C[j]);\n        x++;\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++)\n    puts(d[i]);\n  for (i = 0; i <= n - k - 1; i++)\n    puts(B[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "15968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient pat[100];\n  int n, i, j, huan;\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].ID, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      for (j = i; j > 0; j--) {\n        if (pat[j].age > pat[j - 1].age) {\n          huan = pat[j].age;\n          pat[j].age = pat[j - 1].age;\n          pat[j - 1].age = huan;\n          strcpy(string, pat[j].ID);\n          strcpy(pat[j].ID, pat[j - 1].ID);\n          strcpy(pat[j - 1].ID, string);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "15969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct patient pt[100];\n\n  int n, i, j, a = 0, b = 0, tem;\n  int age_r[100], time_range[100];\n  char temid[11];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pt[i].id, &pt[i].age);\n    if (pt[i].age >= 60) {\n      age_r[a] = i;\n      a++;\n    } else {\n      time_range[b] = i;\n      b++;\n    }\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (pt[age_r[j]].age < pt[age_r[j + 1]].age) {\n        strcpy(temid, pt[age_r[j]].id);\n        strcpy(pt[age_r[j]].id, pt[age_r[j + 1]].id);\n        strcpy(pt[age_r[j + 1]].id, temid);\n        tem = pt[age_r[j]].age;\n        pt[age_r[j]].age = pt[age_r[j + 1]].age;\n        pt[age_r[j + 1]].age = tem;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << pt[age_r[i]].id << \"\\n\";\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s\\n\", pt[time_range[i]].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15970", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sixty[100];\n  int n, i, j, a;\n  struct patient {\n    char num[11];\n    int age;\n  } peo[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n    if (peo[i].age >= 60) {\n      sixty[i] = peo[i].age;\n\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        a = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = a;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == peo[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", peo[j].num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      printf(\"%s\\n\", peo[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15971", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n  struct Patient *next;\n  struct Patient *pre;\n};\nstruct Patient *creat(int x);\nstruct Patient *sort(struct Patient *);\nvoid print(struct Patient *);\n\nint main() {\n  struct Patient *patient, *patient2;\n  int n, i;\n  scanf(\"%d\", &n);\n  patient = creat(n);\n  patient2 = sort(patient);\n  print(patient2);\n}\n\nstruct Patient *creat(int x) {\n  struct Patient *p1, *p2, *head, *p;\n  int i;\n  head = NULL;\n  for (i = 0; i < x; i++) {\n    p1 = (struct Patient *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n      head->pre = NULL;\n    } else {\n      p2->next = p1;\n      p1->pre = p2;\n    }\n    p2 = p1;\n    scanf(\"%s%d\", p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return head;\n}\n\nstruct Patient *sort(struct Patient *head) {\n  struct Patient *p1, *p2, *temp, *p;\n  temp = (struct Patient *)malloc(1000);\n  p1 = p2 = head;\n  while (p1) {\n    if (p1->age >= 60) {\n      p2 = p1->next;\n      while (p2) {\n        if (p2->age > p1->age) {\n          temp->age = p2->age;\n          strcpy(temp->id, p2->id);\n          p = p2;\n          while (p->pre != p1) {\n            strcpy(p->id, p->pre->id);\n            p->age = p->pre->age;\n            p = p->pre;\n          }\n          strcpy(p->id, p1->id);\n          p->age = p1->age;\n          p1->age = temp->age;\n          strcpy(p1->id, temp->id);\n        }\n        p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\n\nvoid print(struct Patient *head) {\n  struct Patient *p1, *p2, *p;\n  p = head;\n  while (p) {\n    if (p->age >= 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n  p = head;\n  while (p) {\n    if (p->age < 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "15972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bingren {\n  char id[10];\n  int o;\n} bingren[201];\nint main() {\n  int n, i, j, y, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bingren[i].id, &bingren[i].o);\n  }\n  for (i = 0, j = 100; i < n; i++) {\n\n    if (bingren[i].o >= 60) {\n      bingren[j] = bingren[i];\n      j++;\n    }\n  }\n  y = j;\n  for (j = 0; j < y - 1; j++) {\n    for (i = 100; i < y - j; i++) {\n      if (bingren[i].o < bingren[i + 1].o) {\n        bingren[200] = bingren[i];\n        bingren[i] = bingren[i + 1];\n        bingren[i + 1] = bingren[200];\n      }\n    }\n  }\n  for (i = 100; i < y; i++) {\n    cout << bingren[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].o < 60)\n      printf(\"%s\\n\", bingren[i].id);\n  }\n}\n"}
{"label": "9", "index": "15973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pati {\n  char ID[10];\n  int age;\n} p[100];\nint main() {\n  int i, j, n, p2[100] = {0}, p3[100] = {0}, t = 0, r = 0, tem;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60) {\n      p2[t] = p[i].age;\n      t++;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++) {\n      if (p2[j] < p2[j + 1]) {\n        tem = p2[j + 1];\n        p2[j + 1] = p2[j];\n        p2[j] = tem;\n      }\n    }\n  for (i = 0; i < t; i++) {\n    if (i > 0) {\n      if (p2[i] != p2[i - 1]) {\n        p3[r] = p2[i];\n        r++;\n      }\n    } else {\n      p3[r] = p2[i];\n      r++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[j].age == p3[t]) {\n        printf(\"%s\\n\", p[j].ID);\n      }\n    }\n    t++;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].ID);\n}\n"}
{"label": "9", "index": "15974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, d, e, f, n, i;\n  char a[100][10];\n  int b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (c = 0; c < n; c++) {\n    e = -1;\n    for (i = 0; i < n; i++) {\n      if (b[i] >= 60) {\n        if (b[i] > e) {\n          e = b[i];\n          f = i;\n        }\n      }\n    }\n    if (e != -1) {\n      printf(\"%s\\n\", a[f]);\n      b[f] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s \", ID3[i]);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct node {\n  char s[100];\n  int age, no;\n} a[1000], b;\nint check(int x, int y) {\n  if (a[y].age < 60 && a[x].age >= 60)\n    return 0;\n  if (a[y].age >= 60 && a[x].age < 60)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no > a[y].no)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no < a[y].no)\n    return 0;\n  if (a[x].age > a[y].age)\n    return 0;\n  if (a[x].age < a[y].age)\n    return 1;\n  if (a[x].no < a[y].no)\n    return 0;\n  if (a[x].no > a[y].no)\n    return 1;\n  return 0;\n}\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].s >> a[i].age;\n    a[i].no = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (check(i, j) == 1) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n  for (i = 1; i <= n; i++)\n    cout << a[i].s << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "15977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstruct patients {\n  char name[11];\n  int age;\n} pat[100];\nstruct patold {\n  char name[11];\n  int age;\n} old[100];\nstruct patyoung {\n  char name[11];\n  int age;\n} young[100];\nint y = 0, o = 0;\nchar nametemp[11];\nint agetemp;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &pat[i].name);\n    scanf(\"%d\", &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      strcpy(old[o].name, pat[i].name);\n      old[o].age = pat[i].age;\n      o++;\n    } else {\n      strcpy(young[y].name, pat[i].name);\n      young[y].age = pat[i].age;\n      y++;\n    }\n  }\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        agetemp = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = agetemp;\n        strcpy(nametemp, old[j].name);\n        strcpy(old[j].name, old[j + 1].name);\n        strcpy(old[j + 1].name, nametemp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", old[i].name);\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", young[i].name);\n  return 0;\n}\n"}
{"label": "9", "index": "15978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  };\n  struct patient p[100], temp;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[j].age > p[i].age && p[j].age >= 60) {\n        for (k = j; k > i; k--) {\n          temp = p[k];\n          p[k] = p[k - 1];\n          p[k - 1] = temp;\n        }\n      }\n    }\n    cout << p[i].num << \"\\n\";\n  }\n  printf(\"%s\\n\", p[n - 1].num);\n  return 0;\n}\n"}
{"label": "9", "index": "15979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[11];\n  int age;\n} p[1000];\n\nint main() {\n  int n, i, k, j, l, a = 0, b = 0, e;\n  int sz1[1000], sz2[1000];\n  char zfc1[1000][11], zfc2[1000][11], f[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &p[i].ID);\n    scanf(\" %d\", &p[i].age);\n  }\n  for (i = 0, j = 0, l = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a++;\n      sz1[j] = p[i].age;\n      strcpy(zfc1[j], p[i].ID);\n      j++;\n    } else {\n      b++;\n      sz2[l] = p[i].age;\n      strcpy(zfc2[l], p[i].ID);\n      l++;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (j = n - 1; j >= k; j--) {\n      if (sz1[j + 1] > sz1[j]) {\n        e = sz1[j];\n        sz1[j] = sz1[j + 1];\n        sz1[j + 1] = e;\n        strcpy(f, zfc1[j]);\n        strcpy(zfc1[j], zfc1[j + 1]);\n        strcpy(zfc1[j + 1], f);\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    cout << zfc1[j] << \"\\n\";\n  }\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", zfc2[l]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15980", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, i, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    cin >> id >> at;\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          p11 = (struct patient *)malloc(sizeof(struct patient));\n          p11->age = at;\n          strcpy(p11->id, id);\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n    ;\n  }\n\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next) {\n    printf(\"%s \", t->id);\n  }\n  printf(\"%s\", t->id);\n}\n"}
{"label": "9", "index": "15981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int age;\n} line[100];\nint main() {\n  int n, i, j, k, temp = 0, m, e;\n  scanf(\"%d\", &n);\n  int b[100] = {0};\n  char s[100][10], y[100][10];\n  char exchange[10];\n  for (i = 0; i < n; i++) {\n    cin >> line[i].num >> line[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      temp++;\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age >= 60) {\n      strcpy(s[j], line[i].num);\n      b[j] = line[i].age;\n      j++;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    for (k = 0; k < temp - j; k++) {\n      if (b[k] < b[k + 1]) {\n        e = b[k];\n        b[k] = b[k + 1];\n        b[k + 1] = e;\n        strcpy(exchange, s[k]);\n        strcpy(s[k], s[k + 1]);\n        strcpy(s[k + 1], exchange);\n      }\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    printf(\"%s\\n\", s[j]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (line[i].age < 60) {\n      strcpy(y[m], line[i].num);\n      m++;\n    }\n  }\n  for (j = 0; j < n - temp; j++) {\n    printf(\"%s\\n\", y[j]);\n  }\n}\n"}
{"label": "9", "index": "15982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n;\n  char ID[100][10];\n  int nl[100];\n  int i;\n  char e[10];\n  for (i = 0; i < n; i++) {\n    cin >> ID[i] >> nl[i];\n  }\n  int m;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((nl[i] < 60 && nl[i + 1] >= 60) ||\n          (nl[i] >= 60 && nl[i + 1] >= 60 && nl[i + 1] > nl[i])) {\n        m = nl[i + 1];\n        nl[i + 1] = nl[i];\n        nl[i] = m;\n        strcpy(e, ID[i + 1]);\n        strcpy(ID[i + 1], ID[i]);\n        strcpy(ID[i], e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << ID[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  char t[10];\n  scanf(\"%d\", &n);\n  int y[n];\n  char id[n][10];\n  for (i = 0; i < n; i++)\n    cin >> id[i] >> y[i];\n  for (i = 1; i < n; i++) {\n    if (y[i] >= 60) {\n      for (j = i; j > 0; j--)\n        if (y[j - 1] < y[j]) {\n          temp = y[j];\n          y[j] = y[j - 1];\n          y[j - 1] = temp;\n          strcpy(t, id[j]);\n          strcpy(id[j], id[j - 1]);\n          strcpy(id[j - 1], t);\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "15984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], age1[100], t1, i, j, l1 = 0, l2 = 0;\n  char id[100][10], t2[10] = {\" \"}, a[100][10] = {\" \"}, b[100][10] = {\" \"};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    if (age[i] >= 60) {\n      strcpy(a[l1], id[i]);\n      age1[l1] = age[i];\n      l1 += 1;\n    } else {\n      strcpy(b[l2], id[i]);\n      l2 += 1;\n    }\n  }\n  for (i = 1; i < l1; i++) {\n    for (j = 0; j < l1 - i; j++) {\n      if (age1[j] < age1[j + 1]) {\n        t1 = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = t1;\n        strcpy(t2, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], t2);\n      }\n    }\n  }\n  for (i = 0; i < l1; i++)\n    printf(\"%s\\n\", a[i]);\n  for (j = 0; j < l2; j++)\n    printf(\"%s\\n\", b[j]);\n}\n"}
{"label": "9", "index": "15985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, j = 0, k = 0, l;\n  struct patient b[100];\n  struct patient c[100];\n  struct patient t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pat[i].name, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      b[j] = pat[i];\n      j++;\n    } else {\n      c[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (l = 0; l < k - 1 - i; l++)\n      if (c[l].age < c[l + 1].age) {\n        t = c[l];\n        c[l] = c[l + 1];\n        c[l + 1] = t;\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].name);\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].name);\n}\n"}
{"label": "9", "index": "15986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char id[11];\n  int nianling;\n} bing[100];\n\nint main() {\n  int n, i, j, e;\n  int youxian[100] = {0};\n  int zhengchang[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", bing[i].id, &bing[i].nianling);\n    if (bing[i].nianling >= 60)\n      youxian[i] = bing[i].nianling;\n    else\n      zhengchang[i] = bing[i].nianling;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (youxian[j] < youxian[j + 1]) {\n        e = youxian[j + 1];\n        youxian[j + 1] = youxian[j];\n        youxian[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == youxian[i]) {\n        cout << bing[j].id << \"\\n\";\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == zhengchang[i]) {\n        cout << bing[j].id << \"\\n\";\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} a[100];\nint main() {\n  int n, i, k, e;\n  char p[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      for (k = 0; i - k >= 1; k++) {\n        if (a[i - k].age > a[i - k - 1].age) {\n          e = a[i - k].age;\n          a[i - k].age = a[i - k - 1].age;\n          a[i - k - 1].age = e;\n\n          strcpy(p, a[i - k].id);\n          strcpy(a[i - k].id, a[i - k - 1].id);\n          strcpy(a[i - k - 1].id, p);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, y[200], p[200];\n  char a[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 200; i++) {\n    p[i] = 200 - i;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &y[i]);\n  }\n  for (i = 0; i <= 140; i++) {\n    for (j = 0; j < n; j++) {\n      if (y[j] == p[i])\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "15989", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m = 0;\nstruct patient {\n  char id[32];\n  int age;\n  struct patient *next;\n};\nstruct patient *find(struct patient *head) {\n  struct patient *p, *ppre;\n  p = head;\n  while (p && p->age >= 60) {\n    ppre = p;\n    p = p->next;\n  }\n  return ppre;\n}\nstruct patient *create(int n) {\n  struct patient *head = NULL, *p1, *p2, *p0, *q;\n  int i;\n  p1 = p2 = p0 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  if (p1->age >= 60)\n    m++;\n\n  p1->next = NULL;\n  head = p1 = p0;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age < 60) {\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    } else if (p1->age >= 60) {\n      m++;\n      if (head->age < 60) {\n        head = p1;\n        p1->next = p0;\n      }\n      if (head->age >= 60) {\n        p0 = find(head);\n        q = p0->next;\n        p0->next = p1;\n        p1->next = q;\n      }\n      if ((p0 = find(head))->next == NULL) {\n        p1->next = NULL;\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n  }\n  return head;\n}\nstruct patient *arrange(struct patient *head) {\n  struct patient *p1, *p2;\n  int t1, i, j;\n  char t2[32];\n  for (j = 0; j < m; j++) {\n    p1 = head;\n    for (i = 1; i < m - j; i++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p2->age < p1->age) {\n        t1 = p1->age;\n        strcpy(t2, p1->id);\n        p1->age = p2->age;\n        strcpy(p1->id, p2->id);\n        p2->age = t1;\n        strcpy(p2->id, t2);\n      }\n    }\n  }\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head, *p, *q, *p0;\n  int n, m = 0, age;\n  char id[32];\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "15990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1] && age[i] >= 60) ||\n          (age[i] < 60 && age[i + 1] >= 60)) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "15991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patients {\n  int num;\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, y, o;\n  struct patients list[100], young[100], old[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    list[i].num = i;\n    scanf(\"%s %d\", list[i].ID, &list[i].age);\n  }\n\n  y = 0;\n  o = 0;\n\n  for (i = 0; i < n; i++) {\n    if (list[i].age >= 60) {\n      old[o] = list[i];\n      o++;\n    } else {\n      young[y] = list[i];\n      y++;\n    }\n  }\n\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        struct patients check;\n        check = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = check;\n      }\n    }\n  }\n\n  for (i = 0; i < o; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < y; i++) {\n    cout << young[i].ID << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } br[100];\n\n  int n, i, j, mid, k;\n\n  char s[10];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &br[i].id, &br[i].age);\n  }\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (br[i].age >= 60) {\n        for (j = i + 1; j < n; j++) {\n          if (br[j].age >= 60) {\n            if (br[j].age > br[i].age) {\n              mid = br[i].age;\n              br[i].age = br[j].age;\n              br[j].age = mid;\n\n              strcpy(s, br[i].id);\n              strcpy(br[i].id, br[j].id);\n              strcpy(br[j].id, s);\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age >= 60) {\n      cout << br[i].id << \"\\n\";\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age < 60) {\n      cout << br[i].id << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, n, j, max, num = 0;\n  struct patient a[110], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      num++;\n  }\n  for (i = 0; i < num; i++) {\n    max = i;\n    for (j = i; j < n; j++) {\n      if (a[j].age > a[max].age) {\n        max = j;\n      }\n    }\n    t = a[max];\n    for (j = max; j > i; j--)\n      a[j] = a[j - 1];\n    a[i] = t;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "15994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  char id[1000][1000];\n  int nl[1000];\n  char id_old[1000][1000], id_young[1000][1000];\n  int nl_old[1000];\n  int a = 0, b = 0;\n  scanf(\"%d\", &n);\n  char ids[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &id[i], &nl[i]);\n    if (nl[i] >= 60) {\n      strcpy(id_old[a], id[i]);\n      nl_old[a] = nl[i];\n      a++;\n    } else {\n      strcpy(id_young[b], id[i]);\n      b++;\n    }\n  }\n  int e;\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (nl_old[j] < nl_old[j + 1]) {\n        e = nl_old[j + 1];\n        nl_old[j + 1] = nl_old[j];\n        nl_old[j] = e;\n        strcpy(ids, id_old[j + 1]);\n        strcpy(id_old[j + 1], id_old[j]);\n        strcpy(id_old[j], ids);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", id_old[i]);\n  }\n  for (i = 0; i < b; i++)\n    cout << id_young[i] << \" \";\n\n  return 0;\n}\n"}
{"label": "9", "index": "15995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct information {\n  char ID[10];\n  int age;\n} * a;\nint main() {\n  int n, i, j, max, p, q = 0;\n  scanf(\"%d\", &n);\n  a = (struct information *)malloc(sizeof(struct information) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age > 59) {\n      q++;\n    }\n  }\n  for (i = 0; i < q; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (max < a[j].age) {\n        max = a[j].age;\n        p = j;\n      }\n    }\n    printf(\"%s\\n\", a[p].ID);\n    a[p].age = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age != 0)\n      printf(\"%s\\n\", a[i].ID);\n  }\n}\n"}
{"label": "9", "index": "15996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main() {\n  struct patient a[100], b[100], c[100], temp;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].num, &a[i].age);\n\n  int j = 0, k = 0, m;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    for (m = 0; m < j - i; m++)\n\n    {\n      if (b[m].age < b[m + 1].age) {\n        temp = b[m];\n        b[m] = b[m + 1];\n        b[m + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i].num);\n  }\n}\n"}
{"label": "9", "index": "15997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int x) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(1000);\n  scanf(\"%s %d \", p1->id, &p1->age);\n  head = NULL;\n  while (n != x) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d \", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, i, j, v, t, *b;\n  struct patient *head, *p1;\n  b = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d \", &m);\n  head = creat(m);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    *(b + i) = p1->age;\n    p1 = p1->next;\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (*(b + i) < *(b + i + 1)) {\n        t = *(b + i);\n        *(b + i) = *(b + i + 1);\n        *(b + i + 1) = t;\n      }\n  for (i = 0; i < m; i++)\n    if (*(b + i) < 60) {\n      v = i;\n      break;\n    }\n  p1 = head;\n  for (j = 0; j < v; j++) {\n    p1 = head;\n    while (p1 != NULL) {\n      if (p1->age == *(b + j) && (j == 0 || *(b + j) != *(b + j - 1)))\n        printf(\"%s \", p1->id);\n      p1 = p1->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    if (p1->age < 60)\n      printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "15998", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j = 0, e, x, a = 0, k;\n  int y[100], year[100];\n  char id[10], t[100][10], ee[10], p[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id >> x;\n    if (x >= 60) {\n      y[j] = x;\n      strcpy(t[j], id);\n      j++;\n    } else {\n      year[a] = x;\n      strcpy(p[a], id);\n      a++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (y[i] < y[i + 1]) {\n        e = y[i + 1];\n        y[i + 1] = y[i];\n        y[i] = e;\n\n        strcpy(ee, t[i + 1]);\n        strcpy(t[i + 1], t[i]);\n        strcpy(t[i], ee);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n\n    printf(\"%s\\n\", t[i]);\n  }\n  for (k = 0; k < a; k++) {\n    printf(\"%s\\n\", p[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "15999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, h = 0, k = 1, b = 0;\n  char a[120][20], c[120][20];\n  int y[120], Z[155][100] = {0}, cy[120];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", a[i], &y[i]);\n\n  for (i = 60; i <= 150; i++) {\n    for (j = 1; j <= n; j++) {\n      Z[i][h] = 0;\n      if (i == y[j]) {\n        Z[i][h] = j;\n        h++;\n      }\n    }\n    h = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] < 60) {\n      strcpy(c[k], a[i]);\n      cy[k] = y[i];\n      b = k;\n      k++;\n    }\n  }\n\n  h = 0;\n  for (i = 150; i >= 60; i--) {\n    for (h = 0; h <= 10; h++) {\n      if (Z[i][h] == 0)\n        break;\n      else {\n        printf(\"%s\\n\", a[Z[i][h]]);\n      }\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16000", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  struct peo sixty[100];\n\n  int n, b = 0, i, k, e;\n  char a[11];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i].age = people[i].age;\n      strcpy(sixty[i].id, people[i].id);\n      b += 1;\n    } else {\n      strcpy(sixty[i].id, \"0000\");\n      sixty[i].age = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1].age < sixty[i].age) {\n        e = sixty[i - 1].age;\n        sixty[i - 1].age = sixty[i].age;\n        sixty[i].age = e;\n        strcpy(a, sixty[i - 1].id);\n        strcpy(sixty[i - 1].id, sixty[i].id);\n        strcpy(sixty[i].id, a);\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s\\n\", sixty[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct senex {\n  char id[10];\n  int age;\n  int rec;\n} sen[100], t;\nint n;\n\nint main() {\n  int i, j, k, l;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", sen[i].id, &sen[i].age);\n    if (sen[i].age >= 60)\n      sen[i].rec = 1;\n    else\n      sen[i].rec = 0;\n  }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (sen[j].rec < sen[j + 1].rec) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n  k = 0;\n  while (sen[k].rec == 1)\n    k++;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (sen[j].age < sen[j + 1].age) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n  \n  \n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", sen[i].id);\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "9", "index": "16002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  char bh[999][999];\n  int nl[999];\n  for (i = 1; i <= n; i++) {\n    cin >> bh[i] >> nl[i];\n  }\n  int pd[999], k = 0;\n  for (i = 1; i <= n; i++) {\n    if (nl[i] >= 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  int e;\n  for (i = 1; i < k; i++) {\n    for (j = 1; j <= k - i; j++) {\n      if (nl[pd[j]] < nl[pd[j + 1]]) {\n        e = pd[j + 1];\n        pd[j + 1] = pd[j];\n        pd[j] = e;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (nl[i] < 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    cout << bh[pd[i]] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[1000], e[1000], t, b, k, j, d;\n  char str[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%s %d\", str[i], &a[i]);\n  }\n  b = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      b++;\n    }\n  }\n  t = b;\n  for (i = 1; i <= n; i++) {\n    if (a[i] < 60) {\n      b++;\n      e[b] = i;\n    }\n  }\n  k = 0;\n  for (j = 100; j >= 60; j--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i] == j) {\n        k++;\n        e[k] = i;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    j = e[i];\n    if (i == 1)\n      printf(\"%s\", str[j]);\n    else\n      printf(\" %s\", str[j]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Inf {\n  char c[10];\n  int a;\n};\nint main() {\n  int n, o = 0, y = 0, t, i, j;\n  char temp[10];\n  struct Inf inf[100], old[100], young[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", inf[i].c, &inf[i].a);\n    if (inf[i].a >= 60) {\n      strcpy(old[o].c, inf[i].c);\n      old[o].a = inf[i].a;\n      o++;\n    } else {\n      strcpy(young[y].c, inf[i].c);\n      young[y].a = inf[i].a;\n      y++;\n    }\n  }\n  for (j = 1; j < o; j++) {\n    for (i = 0; i < o - j; i++) {\n      if (old[i].a < old[i + 1].a) {\n        strcpy(temp, old[i].c);\n        strcpy(old[i].c, old[i + 1].c);\n        strcpy(old[i + 1].c, temp);\n        t = old[i].a;\n        old[i].a = old[i + 1].a;\n        old[i + 1].a = t;\n      }\n    }\n  }\n  for (i = 0; i < o; i++) {\n    printf(\"%s\\n\", old[i].c);\n  }\n  for (i = 0; i < y; i++) {\n    cout << young[i].c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n} pat[100];\nint main() {\n  int n, a[200], j, i;\n  scanf(\"%d\", &n);\n  for (j = 0; j < 150; j++)\n    a[j] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    for (j = 1; j < 150; j++) {\n      if (j == pat[i].age)\n        a[j]++;\n    }\n  }\n  for (j = 150; j >= 60; j--) {\n    if (a[j] == 0)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (j == pat[i].age)\n        printf(\"%s \", pat[i].id);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      cout << pat[i].id << \" \";\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  struct ren {\n    char id[10];\n    int age;\n  } p[100];\n  struct ren t;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j].age < p[j + 1].age && p[j + 1].age >= 60) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << p[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  cin >> n;\n  struct patient {\n    char id[20];\n    int age;\n  } pa1[100], pa2[100], t;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> pa1[i].id >> pa1[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    strcpy(pa2[i].id, pa1[i].id);\n    pa2[i].age = pa1[i].age;\n  }\n\n  for (p = 1; p < n; p++) {\n    for (q = 0; q < n - p; q++) {\n      if (pa1[q].age > pa1[q + 1].age) {\n        t = pa1[q];\n        pa1[q] = pa1[q + 1];\n        pa1[q + 1] = t;\n      }\n    }\n  }\n\n  int a[1000];\n  int s = 0, h;\n  for (p = n - 1; p >= 0; p--) {\n    if (pa1[p].age >= 60) {\n      a[s] = pa1[p].age;\n      s++;\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = h + 1; p < s; p++) {\n      if (a[p] == a[h]) {\n        a[p] = 0;\n      }\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = 0; p < n; p++) {\n      if (pa2[p].age == a[h]) {\n        cout << pa2[p].id << \"\\n\";\n      }\n    }\n  }\n\n  for (p = 0; p < n; p++) {\n    if (pa2[p].age < 60) {\n      printf(\"%s\\n\", pa2[p].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16008", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *last;\n};\nchar temp[10];\nint main() {\n  struct patient *p1, *p2, *head, p[1000];\n  int n, i, j, tmp;\n  cin >> n;\n  memset(p, 0, sizeof(p));\n  head = p + 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    p[i].last = p + i - 1;\n    p[i].next = p + i + 1;\n  }\n  head->last = NULL;\n  p[i].next = NULL;\n  for (i = n; i > 1; i--) {\n    for (j = 1; j < n; j++) {\n      if ((p + j + 1)->age >= 60 && (p + j + 1)->age > (p + j)->age) {\n        memcpy(temp, (p + j)->id, sizeof(temp));\n        memcpy((p + j)->id, (p + j + 1)->id, sizeof(temp));\n        memcpy((p + j + 1)->id, temp, sizeof(temp));\n        tmp = (p + j)->age;\n        (p + j)->age = (p + j + 1)->age;\n        (p + j + 1)->age = tmp;\n      }\n    }\n  }\n  for (; head != NULL; head = head->next)\n    printf(\"%s \", head->id);\n  return 0;\n}\n"}
{"label": "9", "index": "16009", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main() {\n  struct patient a[100], b[100], c[100], temp;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].num >> a[i].age;\n\n  int j = 0, k = 0, m;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    for (m = 0; m < j - i; m++)\n\n    {\n      if (b[m].age < b[m + 1].age) {\n        temp = b[m];\n        b[m] = b[m + 1];\n        b[m + 1] = temp;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i].num);\n  }\n}\n"}
{"label": "9", "index": "16010", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[20];\n  int age;\n};\nint main() {\n  struct person a[100] = {0}, b[100] = {0}, t;\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - 1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 0; i < k; i++) {\n    puts(b[i].ID);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      puts(a[i].ID);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char id[11];\n  int age;\n  struct pat *next;\n};\n\nvoid find(struct pat *head, struct pat *s) {\n  struct pat *pre = head, *p = pre->next;\n  while (p != NULL && s->age <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nvoid sort(struct pat *head, int x, char name[11]) {\n  struct pat *pre = head, *p = pre->next, *s;\n  s = (struct pat *)malloc(sizeof(struct pat));\n  s->age = x;\n  strcpy(s->id, name);\n  s->next = NULL;\n  if (x >= 60)\n    find(head, s);\n  else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nint main() {\n\n  struct pat *head, *p;\n  int n, x, i;\n  char name[11];\n  head = (struct pat *)malloc(sizeof(struct pat));\n  head->next = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", name, &x);\n    sort(head, x, name);\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16012", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pt {\n  char id[10];\n  int age;\n};\n\nint main() {\n  int n, i, j, old;\n  struct pt p[100], o[100], tem;\n  char cao;\n  scanf(\"%d\", &n);\n  cin >> cao;\n  old = 0;\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      o[old] = p[i];\n      old++;\n    }\n  }\n  for (i = 0; i < old - 1; i++) {\n    for (j = 0; j < old - 1; j++) {\n      if (o[j + 1].age > o[j].age) {\n        tem = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = tem;\n      }\n    }\n  }\n  for (i = 0; i < old; i++)\n    printf(\"%s\\n\", o[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "16013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, j, sgh, sgh60;\n  sgh = 0;\n  sgh60 = 0;\n  char d[10];\n  struct guahao {\n    char ID[10];\n    int age;\n  } gh[100], gh60[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", d, &a);\n    if (a >= 60) {\n      strcpy(gh60[sgh60].ID, d);\n      gh60[sgh60].age = a;\n      sgh60 = sgh60 + 1;\n    } else {\n      strcpy(gh[sgh].ID, d);\n      gh[sgh].age = a;\n      sgh = sgh + 1;\n    }\n  }\n  for (i = 1; i <= sgh60; i++) {\n    for (j = sgh60 - 1; j > 0; j--) {\n      if (gh60[j].age > gh60[j - 1].age) {\n        a = gh60[j].age;\n        gh60[j].age = gh60[j - 1].age;\n        gh60[j - 1].age = a;\n        strcpy(d, gh60[j].ID);\n        strcpy(gh60[j].ID, gh60[j - 1].ID);\n        strcpy(gh60[j - 1].ID, d);\n      }\n    }\n  }\n  for (i = 0; i < sgh60; i++) {\n    printf(\"%s\\n\", gh60[i].ID);\n  }\n  for (i = 0; i < sgh; i++) {\n    cout << gh[i].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct data {\n  int w;\n  char c[20];\n  int old;\n  struct data *next;\n  struct data *onext;\n};\nint main() {\n  int i, j, n, max, x;\n  scanf(\"%d\", &n);\n  struct data *head = (struct data *)malloc(sizeof(struct data));\n  struct data *p, *pp, *de;\n  pp = head;\n  for (i = 0; i < n; i++) {\n    p = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%s %d\", p->c, &p->w);\n    p->old = 0;\n    pp->next = p;\n    pp = p;\n  }\n  struct data *old = (struct data *)malloc(sizeof(struct data));\n  pp = head->next;\n  de = old;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    if (pp->w > 59) {\n      pp->old = 1;\n      de->onext = pp;\n      de = pp;\n      x++;\n    }\n    pp = pp->next;\n  }\n\n  for (i = 0; i < x; i++) {\n    pp = old->onext;\n    max = 0;\n    for (j = 0; j < x; j++) {\n      if (pp->w > max) {\n        max = pp->w;\n        de = pp;\n      }\n      pp = pp->onext;\n    }\n    printf(\"%s\\n\", de->c);\n    de->w = -1;\n  }\n  pp = head->next;\n  for (i = 0; i < n; i++) {\n    if (pp->old == 0)\n      cout << pp->c << \"\\n\";\n\n    pp = pp->next;\n  }\n}\n"}
{"label": "9", "index": "16015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct bingren {\n  char id[20];\n  int age;\n} bing[100] = {'\\0', 0};\n\nstruct laoren {\n  char oid[20];\n  int oage;\n} lao[100] = {'\\0', 0};\n\nint main() {\n  int n, i, j = 0, l;\n  struct laoren temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", bing[i].id);\n    cin >> bing[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 60) {\n      strcpy(lao[j].oid, bing[i].id);\n      lao[j].oage = bing[i].age;\n      bing[i].age = -1;\n      j++;\n    } else\n      continue;\n  }\n  for (l = 0; l < j; l++) {\n    for (i = 0; i < j - l; i++) {\n      if (lao[i].oage < lao[i + 1].oage) {\n        temp = lao[i];\n        lao[i] = lao[i + 1];\n        lao[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    cout << lao[i].oid << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 0) {\n      printf(\"%s\\n\", bing[i].id);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16016", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[100], y[100], z[100], a, b = 1, c = 1, d = 1, e = 1, f, g, h, j, k, n;\n  char o[100][10], p[100][10], q[100][10], r[100][10];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    scanf(\"%s\", o[a]);\n    scanf(\"%d \", &x[a]);\n    if (x[a] >= 60) {\n      strcpy(p[b], o[a]);\n      b++;\n      y[c] = x[a];\n      c++;\n    } else {\n      strcpy(q[d], o[a]);\n      d++;\n      z[e] = x[a];\n      e++;\n    }\n  }\n  for (f = 1; f <= b - 2; f++) {\n    for (g = 1; g <= b - 2; g++) {\n      if (y[g] < y[g + 1]) {\n        h = y[g];\n        y[g] = y[g + 1];\n        y[g + 1] = h;\n        strcpy(r[1], p[g]);\n        strcpy(p[g], p[g + 1]);\n        strcpy(p[g + 1], r[1]);\n      }\n    }\n  }\n  for (j = 1; j <= b - 1; j++) {\n    printf(\"%s\\n\", p[j]);\n  }\n  for (k = 1; k <= d - 1; k++) {\n    printf(\"%s\\n\", q[k]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, t = 0, y[100], x, a[100] = {0}, b[100];\n  char s[100][20], temp[20], s1[100][20], s2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &y[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] >= 60) {\n      strcpy(s1[k], s[i]);\n      a[k] = y[i];\n      k++;\n    }\n  }\n  \n  \n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        strcpy(temp, s1[j]);\n        strcpy(s1[j], s1[j + 1]);\n        strcpy(s1[j + 1], temp);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", s1[i], a[i]);\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60) {\n      strcpy(s2[t], s[i]);\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", s2[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  char id[10];\n  int age;\n} p[100];\nint main() {\n  int n, i, a[100], b[100], j, k, m = 0;\n  char str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a[j++] = i;\n      m++;\n    } else\n      b[k++] = i;\n  }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[a[j]].age < p[a[j + 1]].age) {\n        int t = p[a[j]].age;\n        p[a[j]].age = p[a[j + 1]].age;\n        p[a[j + 1]].age = t;\n        strcpy(str, p[a[j]].id);\n        strcpy(p[a[j]].id, p[a[j + 1]].id);\n        strcpy(p[a[j + 1]].id, str);\n      }\n    }\n  if (m != 0) {\n    printf(\"%s\", p[a[0]].id);\n    for (i = 1; i < m; i++)\n      printf(\"\\n%s\", p[a[i]].id);\n    for (i = 0; i < n - m; i++)\n      printf(\"\\n%s\", p[b[i]].id);\n  } else {\n    printf(\"%s\", p[b[0]].id);\n    for (i = 1; i < n; i++)\n      printf(\"\\n%s\", p[b[i]].id);\n  }\n}\n"}
{"label": "9", "index": "16019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  char num[20];\n  int score;\n  struct stu *next;\n};\nvoid sort(struct stu *head, struct stu *q) {\n  struct stu *pre = head, *p = pre->next, *s;\n  s = (struct stu *)malloc(sizeof(struct stu));\n  s->score = q->score;\n  strcpy(s->num, q->num);\n  s->next = NULL;\n  if (s->score >= 60) {\n    while ((p != NULL) && (q->score <= p->score)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while ((p != NULL)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i = 0;\n  p = head;\n  while (p != NULL) {\n\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  int n, k, i;\n  struct stu *head;\n  struct stu *p;\n  head = (struct stu *)malloc(sizeof(struct stu));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p->num >> p->score;\n    sort(head, p);\n  }\n  print(head->next);\n  return 0;\n}\n"}
{"label": "9", "index": "16020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bingren {\n  char id[20];\n  int nian;\n  struct bingren *next;\n};\nint main() {\n  int n, i;\n  struct bingren *p1, *head;\n  struct bingren temp;\n  char a[20] = {'\\0'};\n  int b = 0;\n  scanf(\"%d\", &n);\n  head = (struct bingren *)malloc(sizeof(struct bingren));\n  head->next = NULL;\n  cin >> head->id >> head->nian;\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    p1->next = (struct bingren *)malloc(sizeof(struct bingren));\n    scanf(\"%s%d\", p1->next->id, &p1->next->nian);\n    p1->next->next = NULL;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    for (; p1->next != NULL;) {\n      if (p1->next->nian >= 60 && p1->next->nian > p1->nian) {\n        b = p1->nian;\n        p1->nian = p1->next->nian;\n        p1->next->nian = b;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p1->next->id);\n        strcpy(p1->next->id, a);\n      }\n      p1 = p1->next;\n    }\n    p1 = head;\n  }\n  p1 = head;\n  for (; p1 != NULL;) {\n    cout << p1->id << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16021", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct RAT {\n  int weight;\n  char color[10];\n  struct RAT *next;\n};\nint N;\nint main() {\n\n  void sort(struct RAT * p);\n  int i;\n  scanf(\"%d\", &N);\n\n  struct RAT *head, *p1, *p2;\n  p1 = (struct RAT *)malloc(1000);\n  scanf(\"%s %d\", p1->color, &p1->weight);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n\n  for (i = 1; i < N; i++) {\n    p1 = (struct RAT *)malloc(1000);\n    scanf(\"%s %d\", p1->color, &p1->weight);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  sort(head);\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    printf(\"%s \", p1->color);\n\n  return 0;\n}\n\nvoid sort(struct RAT *p) {\n  int j, i;\n  struct RAT *pt, temp;\n  for (j = 0; j < N; j++)\n    for (pt = p, i = 0; i < N - j - 1; pt = pt->next, i++) {\n      if ((pt->weight < 60 && pt->next->weight >= 60) ||\n          (pt->weight >= 60 && pt->next->weight >= 60 &&\n           pt->weight < pt->next->weight)) {\n        temp = *pt;\n        pt->weight = pt->next->weight;\n        strcpy(pt->color, pt->next->color);\n        pt->next->weight = temp.weight;\n        strcpy(pt->next->color, temp.color);\n      }\n    }\n}\n"}
{"label": "9", "index": "16022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct BING {\n  char id[10];\n  int old;\n} bing[100], temp;\nint main() {\n  int i, j, k, n, p, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bing[i].id, &bing[i].old);\n  }\n  for (p = 0;; p++) {\n    max = -1;\n    for (i = 0; i < n; i++) {\n      if (bing[i].old > max && bing[i].old >= 60) {\n        max = bing[i].old;\n        k = i;\n      }\n    }\n    if (max >= 60) {\n      printf(\"%s\\n\", bing[k].id);\n      bing[k].old = -1;\n    }\n    if (max < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].old < 60 && bing[i].old >= 0)\n      printf(\"%s\\n\", bing[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, p = 0, q, w;\n  struct patient {\n    int age;\n    char b[10];\n  };\n  struct patient c[100], d[100], e[100], f[100], g;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i].b);\n    scanf(\"%d\", &c[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      d[j] = c[i];\n      j = j + 1;\n    } else {\n      e[p] = c[i];\n      p = p + 1;\n    }\n  }\n  w = j - 1;\n\n  for (j = 1; j <= w; j++) {\n    q = w;\n    for (; q >= j; q--) {\n      if (d[q].age > d[q - 1].age) {\n        g = d[q];\n        d[q] = d[q - 1];\n        d[q - 1] = g;\n      }\n    }\n  }\n  for (j = 0; j < w + 1; j++)\n    printf(\"%s\\n\", d[j].b);\n  for (j = 0; j < p; j++)\n    printf(\"%s\\n\", e[j].b);\n}\n"}
{"label": "9", "index": "16024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  int e;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1] && age[i] >= 60) ||\n          (age[i] < 60 && age[i + 1] >= 60)) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16025", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0, j = 0, k = 0;\n  struct patient {\n    int age;\n    char id[10];\n  } patient[100], old[100], young[100], temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id >> patient[i].age;\n    if (patient[i].age >= 60) {\n      old[k] = patient[i];\n      k++;\n    } else {\n      young[s] = patient[i];\n      s++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << old[i].id << endl;\n  for (i = 0; i < s; i++)\n    cout << young[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "16026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, e, v = 0, k, m[100], p[100], b[100];\n  char s[100][11], temp[11], d[100][11], f[100][11];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    cin >> m[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (m[i] >= 60) {\n      strcpy(d[j], s[i]);\n      p[j] = m[i];\n      j++;\n    } else {\n      strcpy(f[v], s[i]);\n      b[v] = m[i];\n      v++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (p[i] < p[i + 1]) {\n        e = p[i + 1];\n        p[i + 1] = p[i];\n        p[i] = e;\n        strcpy(temp, d[i + 1]);\n        strcpy(d[i + 1], d[i]);\n        strcpy(d[i], temp);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < v; i++) {\n    cout << f[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, b[100], eb;\n  char a[100][10], ea[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (j = 0; j < n; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (b[i] > b[i - 1] && b[i] >= 60) {\n        eb = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = eb;\n        strcpy(ea, a[i]);\n        strcpy(a[i], a[i - 1]);\n        strcpy(a[i - 1], ea);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 2; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16029", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient_t {\n    char id[10];\n    int age;\n  } patients[100], t;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &patients[i].id, &patients[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  int d[100];\n  char c[100][10], e[10];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", c[i - 1], &d[i - 1]);\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (k = n; k >= i + 1; k--) {\n      if (d[k - 1] > d[k - 2] && d[k - 1] >= 60) {\n        t = d[k - 2];\n        d[k - 2] = d[k - 1];\n        d[k - 1] = t;\n        strcpy(e, c[k - 2]);\n        strcpy(c[k - 2], c[k - 1]);\n        strcpy(c[k - 1], e);\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s \", c[i - 1]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  char num[20];\n  int score;\n  struct stu *next;\n};\nvoid sort(struct stu *head, struct stu *q) {\n  struct stu *pre = head, *p = pre->next, *s;\n  s = (struct stu *)malloc(sizeof(struct stu));\n  s->score = q->score;\n  strcpy(s->num, q->num);\n  s->next = NULL;\n  if (s->score >= 60) {\n    while ((p != NULL) && (q->score <= p->score)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while ((p != NULL)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i = 0;\n  p = head;\n  while (p != NULL) {\n\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k, i;\n  struct stu *head;\n  struct stu *p;\n  head = (struct stu *)malloc(sizeof(struct stu));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    p = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%s %d\", p->num, &p->score);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "16032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } a[100], m, k;\n  int i, j, n, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num++;\n      m = a[i];\n      for (j = i; j > 0; j--)\n        a[j] = a[j - 1];\n      a[0] = m;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = i + 1; j < num; j++) {\n      if (a[i].age <= a[j].age) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16033", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t;\n  char tc[16];\n  struct per {\n    char id[16];\n    int a;\n  } a[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].a);\n  }\n  for (int j = n - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r].a > 59 && a[r + 1].a > 59 && a[r].a < a[r + 1].a) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n      if (a[r].a <= 59 && a[r + 1].a > 59) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n    }\n  }\n  for (int f = 0; f < n; f++) {\n    printf(\"%s\\n\", a[f].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16034", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct Patient {\n    int flag;\n    char id[10];\n    int age;\n  };\n  struct Patient p[100], p2[100], temp;\n  int n, i, t = 0, k, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n    p[i].flag = 0;\n    if (p[i].age >= 60) {\n      t = t + 1;\n      p[i].flag = 1;\n    }\n    p2[i] = p[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++)\n      if (p[j].age < p[j + 1].age) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (p2[i].flag == 0)\n      printf(\"%s\\n\", p2[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, j = 0, k = 0, l;\n  struct patient b[100];\n  struct patient c[100];\n  struct patient t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pat[i].name, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      b[j] = pat[i];\n      j++;\n    } else {\n      c[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (l = 0; l < k - 1 - i; l++)\n      if (c[l].age < c[l + 1].age) {\n        t = c[l];\n        c[l] = c[l + 1];\n        c[l + 1] = t;\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].name);\n  for (i = 0; i < j; i++)\n    cout << b[i].name << \"\\n\";\n}\n"}
{"label": "9", "index": "16036", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n} person[100];\nint main() {\n  int i, j = -1, k, n, max;\n  char s[100][10], a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &person[i].ID, &person[i].age);\n  for (i = 0; i < n; i++) {\n    a[i] = person[i].age;\n    if (person[i].age >= 60)\n      j++;\n  }\n  for (k = 0; k <= j; k++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%s\\n\", person[i].ID);\n        a[i] = 0;\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      printf(\"%s\\n\", person[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  struct patient {\n    char num[10];\n    int age;\n  };\n  struct patient p[100], temp;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[j].age > p[i].age && p[j].age >= 60) {\n        for (k = j; k > i; k--) {\n          temp = p[k];\n          p[k] = p[k - 1];\n          p[k - 1] = temp;\n        }\n      }\n    }\n    cout << p[i].num << \"\\n\";\n  }\n  printf(\"%s\\n\", p[n - 1].num);\n  return 0;\n}\n"}
{"label": "9", "index": "16038", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int score;\n  struct student *next;\n};\nint n = 0;\nstruct student *creat(int numb);\nvoid print(struct student *head);\nstruct student *maopao(struct student *head);\nint main() {\n  int n;\n  char ch;\n  struct student *head;\n  scanf(\"%d%c\", &n, &ch);\n  head = creat(n);\n  head = maopao(head);\n  print(head);\n  free(head);\n}\n\nstruct student *creat(int numb) \n{\n  struct student *head;    \n  struct student *p1, *p2; \n  n = 0;\n  p1 = p2 = (struct student *)malloc(\n      1000); \n  scanf(\"%s %d\", &p1->num, &p1->score); \n  head = NULL;\n  while (n < numb - 1) \n  {\n    n = n + 1; \n    if (n == 1) {\n      head = p1; \n    } else {\n      p2->next = p1; \n    }\n    p2 = p1;                              \n    p1 = (struct student *)malloc(1000);  \n    scanf(\"%s %d\", &p1->num, &p1->score); \n  }\n  p2->next = p1; \n  p1->next = NULL;\n  return (head); \n}\n\nstruct student *maopao(struct student *head) {\n  struct student *p0, *p1, *p2, *tem;\n  int temp = 0, i, j;\n  p0 = head;\n  p1 = head;\n  p2 = head;\n  if (head == NULL) {\n    return (head);\n  } else if (p0->next == NULL) {\n    return (head);\n  } else if (p0->next != NULL) {\n    for (i = 0; i < n; i = i + 1) {\n      for (j = 0; j < n - 1; j = j + 1) {\n        if (p1->score < p1->next->score && j != 0 && p1->next->score >= 60) {\n          tem = p1->next;\n          p2->next = p1->next;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p2->next;\n        } else if (p1->score < p1->next->score && j == 0 &&\n                   p1->next->score >= 60) {\n          tem = p1->next;\n          p0 = tem;\n          p2 = tem;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p1;\n          p1 = p1->next;\n        } else {\n          p2 = p1;\n          p1 = p1->next;\n        }\n      }\n      temp = temp + 1;\n      p1 = p0;\n      p2 = p0;\n    }\n  }\n  return (p0);\n}\n\nvoid print(struct student *head) \n{\n  struct student *p, *tempo; \n  p = head;                  \n  if (head != NULL)          \n  {\n    do {\n      tempo = p->next;\n      printf(\"%s \", p->num);\n      p = tempo;\n    } while (p != NULL); \n  }\n}\n"}
{"label": "9", "index": "16039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pat[100];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n  }\n  int temp = 0;\n  struct patient e;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      e = pat[i];\n      int j;\n      for (j = i; j >= temp + 1; j--) {\n        pat[j] = pat[j - 1];\n      }\n      pat[temp] = e;\n      temp++;\n    }\n  }\n  int k;\n  for (k = 1; k <= temp; k++) {\n    for (i = 0; i < temp - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        e = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16040", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct people {\n  char num[10];\n  int age;\n  struct people *next;\n};\nint main() {\n  struct people *head, *p0, *p, *s;\n  head = (struct people *)malloc(sizeof(struct people));\n  head->next = NULL;\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p0 = head;\n    p = p0->next;\n    s = (struct people *)malloc(sizeof(struct people));\n    s->next = NULL;\n    scanf(\"%s %d\", s->num, &s->age);\n    while (p != NULL && ((s->age >= 60 && s->age <= p->age) || s->age < 60)) {\n      p0 = p;\n      p = p->next;\n    }\n    p0->next = s;\n    s->next = p;\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16041", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], t, b[100], c[100];\n  char h[100][10], h1[100][10], h2[100][10], y[10];\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int i1, j1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", h[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  i1 = 0;\n  j1 = 0;\n  for (k = 0; k < n; k++) {\n    if (a[k] >= 60) {\n      b[i1] = a[k];\n      strcpy(h1[i1], h[k]);\n      i1++;\n    } else {\n      c[j1] = a[k];\n      strcpy(h2[j1], h[k]);\n      j1++;\n    }\n  }\n\n  for (j = 0; j < i1 - 1; j++)\n    for (i = 0; i < i1 - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(y, h1[i]);\n        strcpy(h1[i], h1[i + 1]);\n        strcpy(h1[i + 1], y);\n      }\n\n  for (i = 0; i < i1; i++) {\n    puts(h1[i]);\n  }\n  for (i = 0; i < j1; i++)\n    puts(h2[i]);\n}\n"}
{"label": "9", "index": "16042", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char id[100][10], old[100][10], yog[100][10];\n  int n, i, m = 0, l = 0, age[100], oag[100], yag[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &(age[i]));\n    if (age[i] >= 60) {\n      oag[m] = age[i];\n      strcpy(old[m], id[i]);\n      m++;\n    } else {\n      yag[l] = age[i];\n      strcpy(yog[l], id[i]);\n      l++;\n    }\n  }\n  char e_id[1][10];\n  int e_age, k;\n  for (k = 1; k <= m; k++) {\n    for (i = 0; i < m - k; i++) {\n      if (oag[i] < oag[i + 1]) {\n        strcpy(e_id[0], old[i]);\n        strcpy(old[i], old[i + 1]);\n        strcpy(old[i + 1], e_id[0]);\n        e_age = oag[i];\n        oag[i] = oag[i + 1];\n        oag[i + 1] = e_age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    puts(old[i]);\n  }\n  for (i = 0; i < l; i++) {\n    puts(yog[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[100], y[100], z[100], a, b = 1, c = 1, d = 1, e = 1, f, g, h, j, k, n;\n  char o[100][10], p[100][10], q[100][10], r[100][10];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    scanf(\"%s\", o[a]);\n    scanf(\"%d\", &x[a]);\n    if (x[a] >= 60) {\n      strcpy(p[b], o[a]);\n      b++;\n      y[c] = x[a];\n      c++;\n    } else {\n      strcpy(q[d], o[a]);\n      d++;\n      z[e] = x[a];\n      e++;\n    }\n  }\n  for (f = 1; f <= b - 2; f++) {\n    for (g = 1; g <= b - 2; g++) {\n      if (y[g] < y[g + 1]) {\n        h = y[g];\n        y[g] = y[g + 1];\n        y[g + 1] = h;\n        strcpy(r[1], p[g]);\n        strcpy(p[g], p[g + 1]);\n        strcpy(p[g + 1], r[1]);\n      }\n    }\n  }\n  for (j = 1; j <= b - 1; j++) {\n    printf(\"%s\\n\", p[j]);\n  }\n  for (k = 1; k <= d - 1; k++) {\n    printf(\"%s\\n\", q[k]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16044", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct {\n  char id[20];\n  int age;\n} patient;\nint main() {\n  patient a[100], b[100], c[100], temp;\n  int n, i, j, k = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      for (j = 0; j < 20; j++) {\n        b[k].id[j] = a[i].id[j];\n        b[k].age = a[i].age;\n      }\n      k++;\n    } else {\n      for (j = 0; j < 20; j++) {\n        c[l].id[j] = a[i].id[j];\n      }\n      l++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", c[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct x {\n  char a[10];\n  int b;\n};\nstruct x y[100];\nint main() {\n  int n, i, j, m;\n  char s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> y[i].a >> y[i].b;\n\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (y[i].b < y[i + 1].b && y[i + 1].b >= 60) {\n        strcpy(s, y[i].a);\n        strcpy(y[i].a, y[i + 1].a);\n        strcpy(y[i + 1].a, s);\n        m = y[i].b;\n        y[i].b = y[i + 1].b;\n        y[i + 1].b = m;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", y[i].a);\n}\n"}
{"label": "9", "index": "16046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[n][100];\n  int b[n], i, j, c[n], d[n], k;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    c[i] = 0;\n    d[i] = n;\n    for (j = 0; j < n; j++) {\n      if (b[j] >= 60 && b[j] > c[i]) {\n        for (k = 0; k < i; k++) {\n          if (j == d[k])\n            break;\n        }\n        if (k == i) {\n          c[i] = b[j];\n          d[i] = j;\n        }\n      }\n    }\n    if (d[i] != n && b[d[i]] >= 60)\n      printf(\"%s\\n\", a[d[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  char n[30];\n  int y;\n};\n\nvoid sort(struct stu a[], int l, int r) {\n  int i = l, j = r, t = a[(l + r) / 2].y;\n\n  struct stu temp;\n  while (i <= j) {\n    while (a[i].y > t)\n      i++;\n    while (a[j].y < t)\n      j--;\n    if (i <= j) {\n      temp = a[i];\n      a[i] = a[j];\n      a[j] = temp;\n      i++;\n      j--;\n    }\n  }\n  if (l < j)\n    sort(a, l, j);\n  if (i < r)\n    sort(a, i, r);\n}\n\nint main() {\n  int n;\n  struct stu a[1000], b[1000], c[1000], temp;\n  int i, j, tot = 0, totc = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &a[i].n, &a[i].y);\n    if (a[i].y >= 60) {\n      b[++tot] = a[i];\n    } else\n      c[++totc] = a[i];\n  }\n\n  for (i = 1; i < tot; i++)\n    for (j = 2; j <= tot - i + 1; j++)\n      if (b[j - 1].y < b[j].y) {\n        temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n\n  for (i = 1; i <= tot; i++)\n    printf(\"%s\\n\", b[i].n);\n  for (i = 1; i <= totc; i++)\n    printf(\"%s\\n\", c[i].n);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[100][1000];\n  int n, i, y, l, j, p = 0, q = 0, c[1000], d[1000], e[1000], m, s, g[1000],\n                     v[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a, &y);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      b[i - 1][j] = a[j];\n    }\n    b[i - 1][l] = '\\0';\n    c[i - 1] = y;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i] >= 60) {\n      d[p] = c[i];\n      g[p] = i;\n      p++;\n    } else if (c[i] < 60) {\n      e[q] = c[i];\n      v[q] = i;\n      q++;\n    }\n  }\n  for (j = 0; j <= p - 1; j++) {\n    for (i = 0; i <= p - 1; i++) {\n      if (d[i] > m) {\n        m = d[i];\n        s = i;\n      } else if (d[i] <= m)\n        ;\n    }\n    printf(\"%s\\n\", b[g[s]]);\n    m = 0;\n    d[s] = 0;\n  }\n  for (i = 0; i <= q - 1; i++)\n    printf(\"%s\\n\", b[v[i]]);\n  return 0;\n}\n"}
{"label": "9", "index": "16049", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct xinxi {\n    char id[10];\n    int year;\n  } xinxi[100], b[100], p;\n\n  int i, j, k, a = 0, c = 0;\n\n  for (i = 0; i < n; i++) {\n    cin >> xinxi[i].id >> (xinxi[i].year);\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) >= 60) {\n      b[a] = xinxi[i];\n      a++;\n    }\n  }\n\n  for (k = 1; k < a; k++) {\n    for (j = 0; j < a - k; j++) {\n      if (b[j].year < b[j + 1].year) {\n        p = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = p;\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", b[j].id);\n  }\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) < 60) {\n      printf(\"%s\\n\", xinxi[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n  struct pa *next;\n};\nstruct pa *insert(struct pa *head, struct pa *new1) {\n  struct pa *p0, *p1, *p2;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else if (p0->age >= 60) {\n    while ((p1->age >= p0->age) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->age > p1->age) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  } else {\n    p1 = head;\n    while (p1 != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p2->next = p0;\n    p0->next = NULL;\n  }\n  return (head);\n}\nint main() {\n  struct pa *p, *head;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s%d\\n\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16051", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct bingren {\n  char id[20];\n  int age;\n} bing[100] = {'\\0', 0};\n\nstruct laoren {\n  char oid[20];\n  int oage;\n} lao[100] = {'\\0', 0};\n\nint main() {\n  int n, i, j = 0, l;\n  struct laoren temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", bing[i].id);\n    cin >> bing[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 60) {\n      strcpy(lao[j].oid, bing[i].id);\n      lao[j].oage = bing[i].age;\n      bing[i].age = -1;\n      j++;\n    } else\n      continue;\n  }\n  for (l = 0; l < j; l++) {\n    for (i = 0; i < j - l; i++) {\n      if (lao[i].oage < lao[i + 1].oage) {\n        temp = lao[i];\n        lao[i] = lao[i + 1];\n        lao[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    printf(\"%s\\n\", lao[i].oid);\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 0) {\n      printf(\"%s\\n\", bing[i].id);\n    } else\n      continue;\n  }\n}\n"}
{"label": "9", "index": "16052", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct peo {\n    char num[10];\n    int old;\n    struct peo *next;\n  };\n  struct peo *p, *p1, *p2, *p3, *head1, *head2, *head3;\n  int n, i, j;\n  p = p1 = p2 = p3 = head1 = head2 = head3 = (struct peo *)malloc\n\n      (sizeof(struct peo));\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &p1->num, &p1->old);\n    if (i == 1)\n      head1 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct peo *)malloc(sizeof(struct peo));\n  }\n  for (i = 1; i <= n; i++) {\n    p1 = head1;\n    p2 = head1;\n    for (j = 1; j <= (n + 1 - i); j++) {\n      if (p1->old > p2->old && p1->old >= 60) {\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    if (i == 1) {\n      head2 = p2;\n    } else\n      p->next = p2;\n    p = p2;\n    p1 = head1;\n    p3 = head1;\n    for (j = 1; j <= (n - i + 1); j++) {\n      if (p1->num == p2->num) {\n        if (j == 1)\n          head1 = p1->next;\n        else\n          p3->next = p1->next;\n      }\n      p3 = p1;\n      p1 = p1->next;\n    }\n  }\n  p = head2;\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, e, v = 0, k, m[100], p[100], b[100];\n  char s[100][11], temp[11], d[100][11], f[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (m[i] >= 60) {\n      strcpy(d[j], s[i]);\n      p[j] = m[i];\n      j++;\n    } else {\n      strcpy(f[v], s[i]);\n      b[v] = m[i];\n      v++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (p[i] < p[i + 1]) {\n        e = p[i + 1];\n        p[i + 1] = p[i];\n        p[i] = e;\n        strcpy(temp, d[i + 1]);\n        strcpy(d[i + 1], d[i]);\n        strcpy(d[i], temp);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < v; i++) {\n    printf(\"%s\\n\", f[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16054", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ILL {\n  char id[10];\n  int age;\n};\nint main() {\n  struct ILL ill[100];\n  int n, i, k, j = 0, Age[100], x;\n  char a[100][10], b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].id);\n    cin >> ill[i].age;\n    if (ill[i].age >= 60) {\n      strcpy(a[j], ill[i].id);\n      Age[j] = ill[i].age;\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - i - 1; k++) {\n      if (Age[k] < Age[k + 1]) {\n        strcpy(b, a[k + 1]);\n        strcpy(a[k + 1], a[k]);\n        strcpy(a[k], b);\n        x = Age[k];\n        Age[k] = Age[k + 1];\n        Age[k + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (ill[i].age < 60) {\n      printf(\"%s\\n\", ill[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} p[100], old[100], temp;\nint main() {\n  int i, j, n, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i].id);\n    scanf(\"%d\", &p[i].age);\n    if (p[i].age >= 60) {\n      old[count] = p[i];\n      count++;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    for (j = 0; j < count - i; j++) {\n      if (old[j + 1].age > old[j].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      cout << p[i].id << \"\\n\";\n    }\n  }\n}\n"}
{"label": "9", "index": "16056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], e;\n  char id[100][10], ex[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((age[j] < age[j + 1] && age[j] >= 60) ||\n          (age[j] < age[j + 1] && age[j + 1] >= 60)) {\n        e = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = e;\n        strcpy(ex, id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], ex);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, k = 0, e0, m, a;\n  int AGE[100];\n  char id[100][10];\n  char ID[100][10];\n  char e[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> id[i] >> age[i];\n  m = strlen(id[0]);\n  for (i = 0; i < n; i++)\n    id[i][m] = '\\0';\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      AGE[k] = age[i];\n      k++;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    for (j = 0; j < k - i; j++)\n      if (AGE[j] < AGE[j + 1]) {\n        e0 = AGE[j + 1];\n        AGE[j + 1] = AGE[j];\n        AGE[j] = e0;\n        for (a = 0; a <= m; a++) {\n          e[0][a] = ID[j + 1][a];\n          ID[j + 1][a] = ID[j][a];\n          ID[j][a] = e[0][a];\n        }\n      }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      for (a = 0; a <= m; a++)\n        ID[k][a] = id[i][a];\n      k++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << ID[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char num[10];\n  int age;\n  int turn;\n} pa[100], temp, temp2;\n\nint main() {\n  int i, j, t, s, n, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> pa[i].num >> pa[i].age;\n    pa[i].turn = i;\n  }\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age >= 60) {\n      for (j = 1; j <= i; j++) {\n        if (pa[i].age > pa[j].age) {\n          temp = pa[j];\n          pa[j] = pa[i];\n          for (t = i - 1; t > j; t--) {\n            pa[t + 1] = pa[t];\n          }\n          pa[j + 1] = temp;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    puts(pa[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[1000], e[1000], t, b, k, j;\n  char str[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%s %d\", str[i], &a[i]);\n  }\n  b = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      b++;\n    }\n  }\n  t = b;\n  for (i = 1; i <= n; i++) {\n    if (a[i] < 60) {\n      b++;\n      e[b] = i;\n    }\n  }\n  k = 0;\n  for (j = 100; j >= 60; j--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i] == j) {\n        k++;\n        e[k] = i;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    j = e[i];\n    if (i == 1)\n      printf(\"%s\", str[j]);\n    else\n      printf(\" %s\", str[j]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i, j, l, m;\n  scanf(\"%d\", &a);\n  int f[a];\n  int h[a];\n  int n[a];\n  int k[a];\n  int o[a];\n  char g[a][10];\n  for (i = 0; i < a; i++) {\n    scanf(\"%s %d\", g[i], &f[i]);\n  }\n  j = 0;\n  for (i = 0; i < a; i++) {\n    if (f[i] >= 60) {\n      h[j] = f[i];\n      k[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++)\n    n[i] = i;\n\n  for (i = 0; i < j; i++) {\n    o[i] = i;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = i + 1; l < j; l++) {\n      if (h[n[i]] < h[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n\n      } else if (h[n[i]] == h[n[l]] && o[n[i]] > o[n[l]]) {\n        m = n[i];\n        n[i] = n[l];\n        n[l] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << g[k[n[i]]] << \" \";\n  }\n  for (i = 0; i < a; i++) {\n    if (f[i] < 60)\n      cout << g[i] << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16061", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[11];\n  int age;\n  struct patient *next;\n};\n\nint main() {\n  struct patient *head;\n  struct patient *create(int n);\n  void sort(struct patient * head);\n  int n;\n  scanf(\"%d\", &n);\n  head = create(n);\n  sort(head);\n\n  return 0;\n}\n\nstruct patient *create(int n) {\n  int i;\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  p2 = p1;\n  scanf(\"%s %d\", p1->id, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    (p2->next) = p1;\n    p2 = p1;\n    if (i == (n - 1))\n      (p1->next) = NULL;\n  }\n  return head;\n}\n\nvoid sort(struct patient *head) {\n  int m;\n  struct patient *p1, *p2;\n\n  for (;;) {\n    p1 = head;\n    p2 = head;\n    m = 0;\n    for (;;) {\n      if ((p1->age) > m)\n        m = (p1->age);\n      if ((p1->next) == NULL)\n        break;\n      else\n        p1 = (p1->next);\n    }\n    if (m < 60)\n      break;\n    p1 = head;\n    for (;;) {\n      if ((p1->age) == m) {\n        printf(\"%s \", p1->id);\n        if (p1 == head)\n          head = (p1->next);\n        else\n          (p2->next) = (p1->next);\n\n        break;\n      } else {\n        if (p1 != p2) {\n          p2 = p1;\n          p1 = (p1->next);\n        } else\n          p1 = (p1->next);\n      }\n    }\n  }\n  p1 = head;\n  for (;;) {\n    printf(\"%s \", p1->id);\n    if ((p1->next) == NULL)\n      break;\n    else\n      p1 = (p1->next);\n  }\n}\n"}
{"label": "9", "index": "16062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s%d\", p1->num, &p1->sum);\n    p1->next = NULL;\n\n    if (i != 0) {\n      p3 = head;\n      if (p1->sum >= 60) {\n\n        while ((p1->sum <= p3->sum) && p3->next != NULL) {\n          p2 = p3;\n          p3 = p3->next;\n        }\n        if (p1->sum > p3->sum) {\n          if (head == p3) {\n            head = p1;\n            p1->next = p3;\n          } else {\n            p2->next = p1;\n            p1->next = p3;\n          }\n        } else {\n          p3->next = p1;\n          p1->next = NULL;\n        }\n      } else {\n        for (p2 = head;; p2 = p2->next) {\n          if (p2->next == NULL)\n            break;\n        }\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    cout << p1->num << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->o == 0)\n        continue;\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          cout << \" \" << pi->id;\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n}\n"}
{"label": "9", "index": "16064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\nstruct patient *insert(struct patient *head, struct patient *another) {\n  struct patient *p0, *p1, *p2;\n  p1 = head;\n  p0 = another;\n  if (p0->age < 60) {\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->age >= p0->age && p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p1->age >= p0->age) {\n      p1->next = p0;\n      p0->next = NULL;\n    } else {\n      if (p1 == head) {\n        head = p0;\n        p0->next = p1;\n      } else {\n        p2->next = p0;\n        p0->next = p1;\n      }\n    }\n  }\n  return head;\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head, *p;\n  scanf(\"%d\", &n);\n  head = p = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p->ID, &p->age);\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->ID, &p->age);\n    head = insert(head, p);\n  }\n  print(head);\n}\n"}
{"label": "9", "index": "16065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, age[100], i, j;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  int k = 0;\n  char shuchu[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n    if (age[i] < 60)\n      strcpy(shuchu[k++], id[i]);\n  }\n  char mid[100][10];\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        strcpy(mid[j], id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], mid[j]);\n      }\n    }\n  }\n  if (age[0] < 60)\n    goto E;\n  else {\n    for (i = 0; age[i] >= 60; i++)\n      printf(\"%s\\n\", id[i]);\n  }\nE:;\n  for (i = 0; i < k; i++)\n    cout << shuchu[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} p[100], e, old[100], young[100];\n\nint main() {\n  int n, i, j = 0, k = 0, o = -1, y = -1;\n  cin >> n;\n  struct patient p[100], old[100], young[100];\n  for (i = 0; i < n; i++) {\n    cin >> p[i].name >> p[i].age;\n    if ((p[i].age) >= 60) {\n      o++;\n      old[j] = p[i];\n      j++;\n\n    } else {\n      y++;\n      young[k] = p[i];\n      k++;\n    }\n  }\n  for (i = 120; i >= 60; i--) {\n    for (j = 0; j < o + 1; j++) {\n      if (old[j].age == i) {\n        cout << old[j].name << \"\\n\";\n      }\n    }\n  }\n  for (i = 0; i < y + 1; i++) {\n    printf(\"%s\\n\", young[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  char id[1000][1000];\n  int nl[1000];\n  char id_old[1000][1000], id_young[1000][1000];\n  int nl_old[1000];\n  int a = 0, b = 0;\n  scanf(\"%d\", &n);\n  char ids[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &id[i], &nl[i]);\n    if (nl[i] >= 60) {\n      strcpy(id_old[a], id[i]);\n      nl_old[a] = nl[i];\n      a++;\n    } else {\n      strcpy(id_young[b], id[i]);\n      b++;\n    }\n  }\n  int e;\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (nl_old[j] < nl_old[j + 1]) {\n        e = nl_old[j + 1];\n        nl_old[j + 1] = nl_old[j];\n        nl_old[j] = e;\n        strcpy(ids, id_old[j + 1]);\n        strcpy(id_old[j + 1], id_old[j]);\n        strcpy(id_old[j], ids);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", id_old[i]);\n  }\n  for (i = 0; i < b; i++)\n    printf(\"%s \", id_young[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  int b[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &b[j]);\n  for (i = 100; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == i)\n        cout << a[j] << \"\\n\";\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (b[j] < 60)\n      cout << a[j] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0, sum = 59;\n  int a[100], b[100];\n  char c[101][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      } else\n        continue;\n    }\n    a[k] = -1;\n    b[j] = k;\n    sum = 59;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[b[i]]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 0 && a[i] < 60)\n      cout << c[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct ID {\n  char idnum[100];\n  int old;\n};\nint main() {\n  struct ID ido[100];\n  struct ID idy[100];\n  struct ID id[100];\n  struct ID e;\n  int n, i, a = 0, b = 0, j, l, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i].idnum, &(id[i].old));\n    if (id[i].old >= 60) {\n      strcpy(ido[a].idnum, id[i].idnum);\n      ido[a].old = id[i].old;\n      a++;\n    } else {\n      strcpy(idy[b].idnum, id[i].idnum);\n      idy[b].old = id[i].old;\n      b++;\n    }\n  }\n\n  for (k = 1; k <= a; k++) {\n    for (i = 0; i < a - k; i++) {\n      if (ido[i].old < ido[i + 1].old) {\n        e = ido[i + 1];\n        ido[i + 1] = ido[i];\n        ido[i] = e;\n      }\n    }\n  }\n\n  for (j = 0; j < a; j++) {\n    cout << ido[j].idnum << \"\\n\";\n  }\n  for (l = 0; l < b; l++) {\n    cout << idy[l].idnum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], i, e, k;\n  char id[100][10], p[10];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> a[i];\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = n - 1; i > k - 1; i--) {\n      if (a[i] > a[i - 1] && a[i] >= 60) {\n        e = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = e;\n        strcpy(p, id[i]);\n        strcpy(id[i], id[i - 1]);\n        strcpy(id[i - 1], p);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16072", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[10];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < 60 && age[i + 1] >= 60) ||\n          (age[i] >= 60 && age[i + 1] >= 60 && age[i] < age[i + 1])) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16073", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} grp1[100], grp2[100], grp3[100];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> grp1[i].No >> grp1[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    grp2[i].age = -1;\n    grp3[i].age = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (grp1[i].age >= 60) {\n      strcpy(grp2[i].No, grp1[i].No);\n      grp2[i].age = grp1[i].age;\n    }\n    if (grp1[i].age < 60) {\n      strcpy(grp3[i].No, grp1[i].No);\n      grp3[i].age = grp1[i].age;\n    }\n  }\n  char y[10];\n  int x;\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < n - k; m++) {\n      if (grp2[m].age < grp2[m + 1].age) {\n        x = grp2[m + 1].age;\n        grp2[m + 1].age = grp2[m].age;\n        grp2[m].age = x;\n        strcpy(y, grp2[m + 1].No);\n        strcpy(grp2[m + 1].No, grp2[m].No);\n        strcpy(grp2[m].No, y);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (grp2[i].age != -1) {\n      printf(\"%s\\n\", grp2[i].No);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (grp3[i].age != -1) {\n      printf(\"%s\\n\", grp3[i].No);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b[100] = {0}, t, m;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\\n\", a[i].num, &a[i].age);\n    b[i] = a[i].age;\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i < n; i++)\n    if (b[i] < 60) {\n      m = i;\n      break;\n    }\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      if (a[i].age == b[j] && (j == 0 || b[j] != b[j - 1]))\n        printf(\"%s\\n\", a[i].num);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      cout << a[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "16075", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint old = 0;\n\nstruct seqs \n{\n  char id[11];\n  int age;\n  struct seqs *next;\n};\n\nstruct seqs *build(int l) \n{\n  int i;\n  struct seqs *head, *newnode, *p;\n  head = (struct seqs *)malloc(1000);   \n  scanf(\"%s %d\", head->id, &head->age); \n  p = head;                             \n  if (head->age >= 60)\n    old++;\n  for (i = 1; i < l; i++) \n  {\n    newnode = (struct seqs *)malloc(1000);      \n    scanf(\"%s %d\", newnode->id, &newnode->age); \n    if (newnode->age < 60) {\n      p->next = newnode; \n      p = newnode;       \n    } else {\n      old++;\n      newnode->next = head;\n      head = newnode;\n    }\n  }\n  p->next = NULL; \n  return head;\n}\n\nstruct seqs *rebuild(struct seqs *headx) \n{\n  int i;\n  struct seqs *head, *newnode, *p, *px;\n\n  newnode = (struct seqs *)malloc(1000);\n  newnode->next = NULL; \n  strcpy(newnode->id, headx->id);\n  newnode->age = headx->age; \n  p = newnode;               \n  px = headx->next;\n  for (i = 1; i < old; i++) \n  {\n    newnode = (struct seqs *)malloc(1000); \n    strcpy(newnode->id, px->id);\n    newnode->age = px->age;\n    newnode->next = p; \n    p = newnode;       \n    px = px->next;\n  }\n  head = p; \n  return head;\n}\nvoid bubble(struct seqs *head, int l) {\n  struct seqs *p;\n  int i, j, temp;\n  char t[11] = {0};\n  for (i = 1; i < l; i++)\n    for (p = head, j = 0; j < l - i; j++, p = p->next)\n      if (p->age < p->next->age) {\n        strcpy(t, p->id);\n        strcpy(p->id, p->next->id);\n        strcpy(p->next->id, t);\n        temp = p->age;\n        p->age = p->next->age;\n        p->next->age = temp;\n      }\n}\nint main() {\n  int n, i, j;\n  struct seqs *p, *px;\n  scanf(\"%d\", &n);\n  p = build(n);\n  px = rebuild(p);\n  bubble(px, old);\n  while (px != NULL) \n  {\n    printf(\"%s \", px->id);\n    px = px->next;\n  }\n  for (i = 0; i < old; i++)\n    p = p->next;\n  while (p != NULL) \n  {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, e, v = 0, k, m[100], p[100], b[100];\n  char s[100][11], temp[11], d[100][11], f[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    cin >> m[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (m[i] >= 60) {\n      strcpy(d[j], s[i]);\n      p[j] = m[i];\n      j++;\n    } else {\n      strcpy(f[v], s[i]);\n      b[v] = m[i];\n      v++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (p[i] < p[i + 1]) {\n        e = p[i + 1];\n        p[i + 1] = p[i];\n        p[i] = e;\n        strcpy(temp, d[i + 1]);\n        strcpy(d[i + 1], d[i]);\n        strcpy(d[i], temp);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < v; i++) {\n    cout << f[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int age;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *age;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  age = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).age);\n    if ((*(s + i)).age >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(age + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if ((*(o + j)).age > (*(o + j - 1)).age) {\n        t = *(o + j);\n        *(o + j) = *(o + j - 1);\n        *(o + j - 1) = t;\n      }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(age + i)).id);\n  return 0;\n}\n"}
{"label": "9", "index": "16078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100];\n  scanf(\"%d\", &n);\n  char zf[100][10], id[10];\n  int i, k, e = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", zf[i], &(sz[i]));\n  }\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (sz[i + 1] >= 60 && sz[i + 1] > sz[i]) {\n        e = sz[i];\n        sz[i] = sz[i + 1];\n        sz[i + 1] = e;\n        strcpy(id, zf[i]);\n        strcpy(zf[i], zf[i + 1]);\n        strcpy(zf[i + 1], id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  int age;\n  char id[12];\n};\nvoid swap(struct patient *a, struct patient *b) {\n  struct patient tmp;\n  tmp = *a;\n  *a = *b;\n  *b = tmp;\n}\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct patient tmp;\n  struct patient young[120];\n  struct patient old[120];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", tmp.id);\n    scanf(\"%d\", &tmp.age);\n    if (tmp.age >= 60)\n      old[j++] = tmp;\n    else\n      young[k++] = tmp;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = 0; l < j - i - 1; l++) {\n      if (old[l].age < old[l + 1].age)\n        swap(&old[l], &old[l + 1]);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, e, f, n, i;\n  char a[100][10];\n  int b[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (c = 0; c < n; c++) {\n    e = -1;\n    for (i = 0; i < n; i++) {\n      if (b[i] >= 60) {\n        if (b[i] > e) {\n          e = b[i];\n          f = i;\n        }\n      }\n    }\n    if (e != -1) {\n      printf(\"%s\\n\", a[f]);\n      b[f] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16081", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo1[100], peo2[100], peo3[100], e;\n  int n, i, j, m, k;\n  scanf(\"%d\", &n);\n  char s[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo1[i].num);\n    scanf(\"%d\", &peo1[i].age);\n  }\n  j = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (peo1[i].age >= 60) {\n      peo2[j] = peo1[i];\n      j++;\n    } else if (peo1[i].age < 60) {\n      peo3[m] = peo1[i];\n      m++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (peo2[i].age < peo2[i + 1].age) {\n        e = peo2[i + 1];\n        peo2[i + 1] = peo2[i];\n        peo2[i] = e;\n      }\n    }\n  }\n  int a, b, c;\n  for (a = 0, i = 0; a < j; a++, i++) {\n    strcpy(s[a], peo2[i].num);\n  }\n  for (a = j, b = 0; a < n; a++, b++) {\n    strcpy(s[a], peo3[b].num);\n  }\n  for (c = 0; c < n; c++)\n    printf(\"%s\\n\", s[c]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char num[11];\n  int age;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient pat1[100], pat2[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat1[i].num, &pat1[i].age);\n    strcpy(pat2[i].num, pat1[i].num);\n    pat2[i].age = pat1[i].age;\n  }\n  int j, e;\n  char e_num[11];\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pat1[i].age < pat1[i + 1].age) {\n        e = pat1[i + 1].age;\n        strcpy(e_num, pat1[i + 1].num);\n        pat1[i + 1].age = pat1[i].age;\n        strcpy(pat1[i + 1].num, pat1[i].num);\n        pat1[i].age = e;\n        strcpy(pat1[i].num, e_num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat1[i].age >= 60) {\n      printf(\"%s\\n\", pat1[i].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat2[i].age < 60) {\n      printf(\"%s\\n\", pat2[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[11];\n  int age;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  cin >> n;\n  struct student pa[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s%d\", pa[i].num, &pa[i].age);\n  struct student temp;\n  for (j = n - 1; j >= 1; j--) {\n    for (i = 0; i <= j - 1; i++) {\n      if (pa[i].age < pa[i + 1].age &&\n          !(pa[i].age < 60 && pa[i + 1].age < 60)) {\n        temp = pa[i];\n        pa[i] = pa[i + 1];\n        pa[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%s\", pa[i].num);\n    (i <= n - 2) ? printf(\"\\n\") : printf(\"\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[100];\n  int t, i, j;\n  char str[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &m[i]);\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (m[i] >= 60) {\n        if (m[i + 1] >= 60) {\n          if (m[i + 1] > m[i]) {\n            strcpy(s, str[i]);\n            strcpy(str[i], str[i + 1]);\n            strcpy(str[i + 1], s);\n            t = m[i];\n            m[i] = m[i + 1];\n            m[i + 1] = t;\n          }\n        } else {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n      if (m[i] < 60) {\n        if (m[i + 1] >= 60) {\n          strcpy(s, str[i]);\n          strcpy(str[i], str[i + 1]);\n          strcpy(str[i + 1], s);\n          t = m[i];\n          m[i] = m[i + 1];\n          m[i + 1] = t;\n        }\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, t = 0, y[100], x, a[100] = {0}, b[100];\n  char s[100][20], temp[20], s1[100][20], s2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i], &y[i]);\n\n  for (i = 0; i < n; i++) {\n    if (y[i] >= 60) {\n      strcpy(s1[k], s[i]);\n      a[k] = y[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        strcpy(temp, s1[j]);\n        strcpy(s1[j], s1[j + 1]);\n        strcpy(s1[j + 1], temp);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", s1[i], a[i]);\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60) {\n      strcpy(s2[t], s[i]);\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", s2[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct a {\n  char id[100];\n  int year;\n} p[100];\nint main() {\n  int n, i, j, k, t = 0, r = 0;\n  int a[200] = {0};\n  cin >> n;\n  struct a b[100];\n  struct a c[100];\n  struct a temp;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> p[i].id >> p[i].year;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year >= 60) {\n      b[t] = p[i];\n      t++;\n    }\n  }\n  for (i = 0; i <= t - 1; i++) {\n    a[b[i].year]++;\n  }\n  for (i = 200; i >= 60; i--) {\n    if (a[i] > 0) {\n      for (j = 0; j <= t - 1; j++) {\n        if (b[j].year == i) {\n          c[r] = b[j];\n          r++;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= t - 1; i++) {\n    printf(\"%s\\n\", c[i].id);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (p[i].year < 60) {\n      cout << p[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int age[100];\n  char ID[100][11];\n} patient, *ppatient;\nint main() {\n  ppatient = &patient;\n  int n, i, j, k, num, m = 0;\n  char id[11], ID_1[100][11], age_1[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient.ID[i], &patient.age[i]);\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] >= 60) {\n      strcpy(ID_1[j], (*ppatient).ID[i]);\n      age_1[j] = (*ppatient).age[i];\n      m += 1;\n      j++;\n    }\n  }\n  for (j = m - 1; j > 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (age_1[k] < age_1[k + 1]) {\n        strcpy(id, ID_1[k + 1]);\n        strcpy(ID_1[k + 1], ID_1[k]);\n        strcpy(ID_1[k], id);\n        num = age_1[k + 1];\n        age_1[k + 1] = age_1[k];\n        age_1[k] = num;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", ID_1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] < 60)\n      printf(\"%s\\n\", (*ppatient).ID[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16088", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  int e;\n  char e_id[10];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < 60 && age[i + 1] >= 60) ||\n          (age[i] >= 60 && age[i + 1] >= 60 && age[i] < age[i + 1])) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", id[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16089", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ren {\n  char id[12];\n  int ye;\n  struct ren *next;\n};\nint main() {\n  int n;\n  char c[12];\n  int y;\n  int r;\n  struct ren *p1, *p2, *head;\n  int i;\n  scanf(\"%d\", &n);\n  head = (struct ren *)malloc(sizeof(struct ren));\n  cin >> c >> y;\n  strcpy(head->id, c);\n  head->ye = y;\n  head->next = 0;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%s %d\", c, &y);\n    p1 = (struct ren *)malloc(sizeof(struct ren));\n    strcpy(p1->id, c);\n    p1->ye = y;\n    p1->next = 0;\n    if (y < 60) {\n      p2 = head;\n      while (p2->next != 0)\n        p2 = p2->next;\n      p2->next = p1;\n    } else {\n      p2 = head;\n      if (y > p2->ye) {\n        p1->next = head;\n        head = p1;\n      } else {\n        r = 0;\n        while (p2->next != 0) {\n          if (p2->ye >= y && p2->next->ye < y) {\n            r = 1;\n            p1->next = p2->next;\n            p2->next = p1;\n            break;\n          }\n          p2 = p2->next;\n        }\n        if (r == 0)\n          p2->next = p1;\n      }\n    }\n  }\n  p1 = head;\n  do {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  } while (p1 != 0);\n  return 0;\n}\n"}
{"label": "9", "index": "16090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  int x;\n} p[100], P[100], s;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].num, &p[i].age);\n    if (p[i].age >= 60)\n      p[i].x = p[i].age;\n    else\n      p[i].x = 0;\n  }\n  for (i = 0; i < n; i++) {\n    s.age = -1;\n    s.x = -1;\n    char k[10];\n    for (j = 0; j < n; j++) {\n      if (s.x < p[j].x) {\n        s = p[j];\n        strcpy(k, p[j].num);\n      }\n    }\n    P[i] = s;\n    for (j = 0; j < n; j++) {\n      if (strcmp(p[j].num, k) == 0) {\n        p[j].x = -2;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", P[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], t, b[100], c[100];\n  char h[100][10], h1[100][10], h2[100][10], y[10];\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int i1, j1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", h[i]);\n    cin >> a[i];\n  }\n  i1 = 0;\n  j1 = 0;\n  for (k = 0; k < n; k++) {\n    if (a[k] >= 60) {\n      b[i1] = a[k];\n      strcpy(h1[i1], h[k]);\n      i1++;\n    } else {\n      c[j1] = a[k];\n      strcpy(h2[j1], h[k]);\n      j1++;\n    }\n  }\n\n  for (j = 0; j < i1 - 1; j++)\n    for (i = 0; i < i1 - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(y, h1[i]);\n        strcpy(h1[i], h1[i + 1]);\n        strcpy(h1[i + 1], y);\n      }\n\n  for (i = 0; i < i1; i++) {\n    puts(h1[i]);\n  }\n  for (i = 0; i < j1; i++)\n    puts(h2[i]);\n}\n"}
{"label": "9", "index": "16092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient pat[100];\n  int n, i, j, huan;\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].ID, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      for (j = i; j > 0; j--) {\n        if (pat[j].age > pat[j - 1].age) {\n          huan = pat[j].age;\n          pat[j].age = pat[j - 1].age;\n          pat[j - 1].age = huan;\n          strcpy(string, pat[j].ID);\n          strcpy(pat[j].ID, pat[j - 1].ID);\n          strcpy(pat[j - 1].ID, string);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << pat[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][11], c[100][11];\n  int i, j, n, b[100], m, e = -1, f = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      m = 0;\n      for (j = 0; j < n; j++) {\n        if (b[i] < b[j] || (b[i] == b[j] && i > j)) {\n          m++;\n        }\n      }\n      if (e < m)\n        e = m;\n      strcpy(c[m], a[i]);\n    }\n  }\n  e = e + 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      strcpy(c[i - f + e], a[i]);\n    } else {\n      f++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int k = 0;\n  char str[100][10] = {0};\n  char str1[100][10] = {0};\n  char str2[100][10] = {0};\n  int temp;\n  char t[10] = {0};\n  int a[100];\n  int a1[100] = {0};\n  int a2[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    strcpy(str1[i], str[i]);\n    a1[i] = a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      strcpy(str2[k], str[i]);\n      a2[k] = a[i];\n      k = k + 1;\n    }\n  for (j = 1; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (a2[i] < a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n        strcpy(t, str2[i]);\n        strcpy(str2[i], str2[i + 1]);\n        strcpy(str2[i + 1], t);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", str2[i]);\n  for (i = 0; i < n; i++)\n    if (a1[i] < 60)\n      printf(\"%s\\n\", str1[i]);\n}\n"}
{"label": "9", "index": "16095", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar id[1000][1000], oldid[1000][1000], newid[1000][1000];\nint age[1000];\nint oldage[1000], newage[1000];\nint main() {\n  int num;\n  int i = 0, j = 0, k = 0, n = 0;\n  int e_oldage;\n  char e_oldid[1000];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d \", id[i], &(age[i]));\n  }\n  for (i = 0; i < num; i++) {\n    if (age[i] >= 60) {\n      oldage[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      newage[n] = age[i];\n      strcpy(newid[n], id[i]);\n      n++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (oldage[i] < oldage[i + 1]) {\n        e_oldage = oldage[i + 1];\n        strcpy(e_oldid, oldid[i + 1]);\n\n        oldage[i + 1] = oldage[i];\n        strcpy(oldid[i + 1], oldid[i]);\n\n        oldage[i] = e_oldage;\n        strcpy(oldid[i], e_oldid);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", oldid[i]);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", newid[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n} person[100];\nint main() {\n  int i, j = -1, k, n, max;\n  char s[100][10], a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &person[i].ID, &person[i].age);\n  for (i = 0; i < n; i++) {\n    a[i] = person[i].age;\n    if (person[i].age >= 60)\n      j++;\n  }\n  for (k = 0; k <= j; k++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        cout << person[i].ID << \"\\n\";\n        a[i] = 0;\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      cout << person[i].ID << \"\\n\";\n}\n"}
{"label": "9", "index": "16097", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct br {\n    char no[10];\n    int s;\n  } a[100], b[100], r;\n  int n, i, j, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].no >> a[i].s;\n    if (a[i].s >= 60) {\n      b[t] = a[i];\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++)\n      if (b[j].s < b[j + 1].s) {\n        r = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = r;\n      }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", b[i].no);\n  for (i = 0; i < n; i++)\n    if (a[i].s >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", a[i].no);\n  return 0;\n}\n"}
{"label": "9", "index": "16098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } ren[100];\n  struct oldp {\n    char idold[11];\n    int ageold;\n  } oldren[100];\n  struct youngp {\n    char idyoung[11];\n    int ageyoung;\n  } youngren[100];\n\n  int n, i, t, j, oldindex = 0, youngindex = 0;\n  char num[4], idinter[11];\n\n  cin >> num;\n  n = atoi(num);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ren[i].id, &ren[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ren[i].age >= 60) {\n      oldren[oldindex].ageold = ren[i].age;\n      strcpy(oldren[oldindex].idold, ren[i].id);\n      oldindex += 1;\n    } else {\n      youngren[youngindex].ageyoung = ren[i].age;\n      strcpy(youngren[youngindex].idyoung, ren[i].id);\n      youngindex += 1;\n    }\n  }\n  for (i = 1; i < oldindex; i++) {\n    for (j = 0; j < oldindex - i; j++) {\n      if (oldren[j].ageold < oldren[j + 1].ageold) {\n        t = oldren[j].ageold;\n        oldren[j].ageold = oldren[j + 1].ageold;\n        oldren[j + 1].ageold = t;\n        strcpy(idinter, oldren[j].idold);\n        strcpy(oldren[j].idold, oldren[j + 1].idold);\n        strcpy(oldren[j + 1].idold, idinter);\n      }\n    }\n  }\n  for (i = 0; i < oldindex; i++) {\n    cout << oldren[i].idold << \" \";\n  }\n  for (i = 0; i < youngindex; i++) {\n    cout << youngren[i].idyoung << \" \";\n  }\n}\n"}
{"label": "9", "index": "16099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  int b[n];\n  for (j = 0; j < n; j++)\n    cin >> a[j] >> b[j];\n  for (i = 100; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == i)\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    if (b[j] < 60)\n      printf(\"%s\\n\", a[j]);\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int a[100], b[100], i, n, k, l, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &a[i]);\n    b[i] = a[i];\n  }\n  for (k = n - 1; k > 0; k--) {\n    for (i = 0; i < k; i++) {\n      if (b[i] > b[i + 1]) {\n        l = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = l;\n      }\n    }\n  }\n  i = n - 1;\n  while (b[i] >= 60) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == b[i]) {\n        printf(\"%s\\n\", s[j]);\n      }\n    }\n    while (b[i - 1] == b[i]) {\n      i--;\n    }\n    i--;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16101", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age, arranged;\n};\n\nint main() {\n  int n, i, t = 0, j;\n  struct Patient pai[100], orderd[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pai[i].id >> pai[i].age;\n    pai[i].arranged = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].age >= 60) {\n      orderd[t] = pai[i];\n      pai[i].arranged = 1;\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (orderd[j].age < orderd[j + 1].age) {\n        struct Patient temp = orderd[j];\n        orderd[j] = orderd[j + 1];\n        orderd[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].arranged == 0) {\n      orderd[t] = pai[i];\n      t++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << orderd[i].id << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int p, q;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[20];\n    int age;\n  } pa1[100], pa2[100], t;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa1[i].id, &pa1[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    strcpy(pa2[i].id, pa1[i].id);\n    pa2[i].age = pa1[i].age;\n  }\n\n  for (p = 1; p < n; p++) {\n    for (q = 0; q < n - p; q++) {\n      if (pa1[q].age > pa1[q + 1].age) {\n        t = pa1[q];\n        pa1[q] = pa1[q + 1];\n        pa1[q + 1] = t;\n      }\n    }\n  }\n\n  int a[1000];\n  int s = 0, h;\n  for (p = n - 1; p >= 0; p--) {\n    if (pa1[p].age >= 60) {\n      a[s] = pa1[p].age;\n      s++;\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = h + 1; p < s; p++) {\n      if (a[p] == a[h]) {\n        a[p] = 0;\n      }\n    }\n  }\n\n  for (h = 0; h < s; h++) {\n    for (p = 0; p < n; p++) {\n      if (pa2[p].age == a[h]) {\n        printf(\"%s\\n\", pa2[p].id);\n      }\n    }\n  }\n\n  for (p = 0; p < n; p++) {\n    if (pa2[p].age < 60) {\n      cout << pa2[p].id << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], p[100];\nint main() {\n  int n, m = 0, i, j = 0, k, temp, a[40] = {0}, sum = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p[j++] = pat[i];\n      m++;\n    }\n  }\n  a[0] = p[0].age;\n  for (j = 1; j < m; j++) {\n    for (i = 0; a[i] != 0; i++)\n      if (a[i] == p[j].age)\n        break;\n    if (a[i] == 0) {\n      a[i] = p[j].age;\n      sum++;\n    }\n  }\n  for (j = 0; j < sum - 1; j++) {\n    k = j;\n    {\n      for (i = j + 1; i < sum; i++)\n        if (a[i] > a[j]) {\n          k = i;\n          temp = a[k];\n          a[k] = a[j];\n          a[j] = temp;\n        }\n    }\n  }\n  for (k = 0; k < sum; k++) {\n    for (j = 0; j < m; j++) {\n      if (p[j].age == a[k])\n        cout << p[j].id << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, e, v = 0, k, m[100], p[100], b[100];\n  char s[100][11], temp[11], d[100][11], f[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (m[i] >= 60) {\n      strcpy(d[j], s[i]);\n      p[j] = m[i];\n      j++;\n    } else {\n      strcpy(f[v], s[i]);\n      b[v] = m[i];\n      v++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (p[i] < p[i + 1]) {\n        e = p[i + 1];\n        p[i + 1] = p[i];\n        p[i] = e;\n        strcpy(temp, d[i + 1]);\n        strcpy(d[i + 1], d[i]);\n        strcpy(d[i], temp);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  for (i = 0; i < v; i++) {\n    printf(\"%s\\n\", f[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} p[100];\n\nint main() {\n  int i, j = 0, k = 0, t, l, n;\n  char other[100][10], a[10];\n  struct patient old[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].num, &p[i].age);\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n\n      strcpy(old[j].num, p[i].num);\n      old[j].age = p[i].age;\n      j++;\n    } else {\n      strcpy(other[k], p[i].num);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (l = 0; l < j - 1 - i; l++) {\n      if (old[l].age < old[l + 1].age) {\n        t = old[l].age;\n        old[l].age = old[l + 1].age;\n        old[l + 1].age = t;\n\n        strcpy(a, old[l].num);\n        strcpy(old[l].num, old[l + 1].num);\n        strcpy(old[l + 1].num, a);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].num);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", other[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  char ID[10];\n  int age;\n};\nint main() {\n  int n, i, t;\n  struct people peo[100];\n  struct people old[100];\n  void bubble(struct people a[100], int n);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo[i].ID);\n    scanf(\"%d\", &peo[i].age);\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      strcpy(old[t].ID, peo[i].ID);\n      old[t].age = peo[i].age;\n      t++;\n    } else\n      continue;\n  }\n  bubble(old, t);\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", old[i].ID);\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60)\n      printf(\"%s\\n\", peo[i].ID);\n  }\n  return 0;\n}\n\nvoid bubble(struct people a[100], int n) {\n  int i, j;\n  struct people t;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j].age < a[j + 1].age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "9", "index": "16107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0;\n  struct person t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].id, &s[i].y);\n  for (i = 0; i < n; i++)\n    if (s[i].y >= 60) {\n      o[k] = s[i];\n      k++;\n    } else {\n      y[m] = s[i];\n      m++;\n    }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i; j++)\n      if (o[j].y < o[j + 1].y) {\n        t = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = t;\n      }\n  }\n  for (i = 0; i < k; i++)\n    cout << o[i].id << \"\\n\";\n\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", y[i].id);\n}\n"}
{"label": "9", "index": "16108", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1] && age[i] >= 60) ||\n          (age[i] < 60 && age[i + 1] >= 60)) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16109", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, m, j, k;\n  scanf(\"%d \", &n);\n  struct br {\n    char x[10];\n    int y;\n  } * b, c[100], e;\n  b = (struct br *)malloc(sizeof(struct br) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i].x, &(b[i].y));\n  }\n  for (i = 0, m = 0; i < n; i++) {\n    if (b[i].y >= 60) {\n      c[m] = b[i];\n      m++;\n      b[i].y = -1;\n    }\n    for (k = 0; k < m; k++) {\n      for (j = m - 1; j > k; j--) {\n        if (c[j].y > c[j - 1].y) {\n          e = c[j];\n          c[j] = c[j - 1];\n          c[j - 1] = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", c[i].x);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i].y != -1) {\n      printf(\"%s\\n\", b[i].x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p1, *p2;\n  p2 = p1 = (struct patient *)malloc(1000);\n  head = p1;\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j, n;\n  char a[10];\n  scanf(\"%d\", &n);\n  struct patient *h, *q, *p;\n  h = creat(n);\n  for (i = 0; i < n; i++)\n    for (q = h; q->next != NULL; q = q->next)\n      if (q->next->age >= 60 && q->next->age > q->age) {\n        strcpy(a, q->ID);\n        strcpy(q->ID, q->next->ID);\n        strcpy(q->next->ID, a);\n        j = q->age;\n        q->age = q->next->age;\n        q->next->age = j;\n      }\n  for (p = h; p != NULL; p = p->next)\n    cout << p->ID << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n} pat[100];\nint main() {\n  struct patient t;\n  struct patient num[100];\n  int n, i, j, a = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].ID >> pat[i].age;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      num[a - 1] = pat[i];\n      a++;\n    }\n  }\n  for (i = 0; i < a - 2; i++) {\n    for (j = 0; j < a - 2 - i; j++)\n      if (num[j].age < num[j + 1].age) {\n        t = num[j];\n        num[j] = num[j + 1];\n        num[j + 1] = t;\n      }\n  }\n  for (i = 0; i < a - 1; i++)\n    printf(\"%s\\n\", num[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].ID << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main()\n\n{\n  void bubble(struct patient a[], int len);\n  int n, i, old, sum, age, j;\n  struct patient a[100];\n  struct patient b[100];\n  char str[100] = {'\\0'};\n  char str1[100] = {'\\0'};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0, sum = 0; sum <= n;) {\n    age = 0;\n    strcpy(str, str1);\n    scanf(\"%s %d\", str, &age);\n\n    if (age >= 60) {\n      strcpy(a[i].num, str);\n      a[i].age = age;\n      i++;\n      sum++;\n    } else {\n      strcpy(b[j].num, str);\n      b[j].age = age;\n      j++;\n      sum++;\n    }\n  }\n\n  bubble(a, i);\n  old = i;\n\n  for (i = 0; i < old; i++) {\n    printf(\"%s\\n\", a[i].num);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].num);\n\n  return 0;\n}\n\nvoid bubble(struct patient a[], int len) {\n  int i, pass;\n  struct patient temp;\n\n  for (pass = 1; pass < len; pass++) {\n    for (i = 0; i < len - pass; i++) {\n      if (a[i].age < a[i + 1].age) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> ID[i] >> age[i];\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", ID3[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char id[100][100];\n  int age[100];\n  int n;\n  int i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n  }\n\n  int e;\n  char t[13];\n\n  char id1[100][13];\n  int age1[100];\n  char id2[100][13];\n  int age2[100];\n  int x = 0, y = 0;\n\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[x] = age[i];\n      strcpy(id1[x], id[i]);\n      x++;\n    }\n\n    if (age[i] < 60) {\n      age2[y] = age[i];\n      strcpy(id2[y], id[i]);\n      y++;\n    }\n  }\n\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - k; i++) {\n      if (age1[i] < age1[i + 1]) {\n        e = age1[i + 1];\n        age1[i + 1] = age1[i];\n        age1[i] = e;\n\n        strcpy(t, id1[i + 1]);\n        strcpy(id1[i + 1], id1[i]);\n        strcpy(id1[i], t);\n      }\n    }\n  }\n\n  for (i = 0; i < x; i++)\n    printf(\"%s\\n\", id1[i]);\n\n  for (i = 0; i < y; i++) {\n    cout << id2[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct man {\n    char a[11];\n    int y;\n  } man[100];\n  int n;\n  cin >> n;\n  char b[11];\n  int y;\n  int i, j;\n  char c[100][11];\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    cin >> b >> y;\n    if (y >= 60) {\n      strcpy(man[k].a, b);\n      man[k].y = y;\n      k++;\n    } else {\n      strcpy(c[m], b);\n      m++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      int y1, y2;\n      y1 = man[j].y;\n      y2 = man[j + 1].y;\n      if (y1 < y2) {\n        y = man[j + 1].y;\n        man[j + 1].y = man[j].y;\n        man[j].y = y;\n        strcpy(b, man[j + 1].a);\n        strcpy(man[j + 1].a, man[j].a);\n        strcpy(man[j].a, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(b, man[i].a);\n    printf(\"%s\\n\", b);\n  }\n  for (i = 0; i < m; i++) {\n    strcpy(b, c[i]);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct p {\n    char num[100];\n    int age;\n  } p[101];\n  int n, i, j, k, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  struct q {\n    char num[100];\n    int age;\n  } q[101];\n  for (i = 1, j = 1; i <= n; i++) {\n    if (p[i].age >= 60) {\n      strcpy(q[j].num, p[i].num);\n      q[j].age = p[i].age;\n      j++;\n      m = m + 1;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 1; i <= m - 1; i++) {\n      if (q[i].age < q[i + 1].age) {\n        q[101] = q[i];\n        q[i] = q[i + 1];\n        q[i + 1] = q[101];\n      }\n    }\n  }\n  printf(\"%s\", q[1].num);\n  for (i = 2; i <= m; i++)\n    cout << \" \" << q[i].num;\n  for (i = 1; i <= n; i++)\n    if (p[i].age < 60) {\n      printf(\" %s\", p[i].num);\n    }\n}\n"}
{"label": "9", "index": "16117", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct p {\n  char i[10];\n  int a;\n  struct p *next;\n};\nint main() {\n  struct p *p1, *p2, *head, *head2, *q1, *q2;\n  int n, i, k = 0, b = 0, x = 0;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  scanf(\"%s %d\", p1->i, &p1->a);\n  for (i = 0; i < n; i++) {\n    k++;\n    if (k == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n    cin >> p1->i >> p1->a;\n  }\n  p2->next = NULL;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60)\n      x++;\n  k = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60 && p1->a > b) {\n      b = p1->a;\n      p2 = p1;\n    }\n  q1 = q2 = (struct p *)malloc(1000);\n  strcpy(q1->i, p2->i);\n  q1->a = p2->a;\n  p2->a = 0;\n  for (i = 0; i < x - 1; i++) {\n    k++;\n    if (k == 1)\n      head2 = q1;\n    else\n      q2->next = q1;\n    q2 = q1;\n    b = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next)\n      if (p1->a >= 60 && p1->a > b) {\n        b = p1->a;\n        p2 = p1;\n      }\n    q1 = (struct p *)malloc(1000);\n    strcpy(q1->i, p2->i);\n    q1->a = p2->a;\n    p2->a = 0;\n  }\n  q2->next = q1;\n  q2 = q1;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a > 0) {\n      q1 = (struct p *)malloc(1000);\n      strcpy(q1->i, p1->i);\n      q1->a = p1->a;\n      p1->a = 0;\n      q2->next = q1;\n      q2 = q1;\n    }\n  q2->next = NULL;\n  for (q1 = head2; q1 != NULL; q1 = q1->next)\n    printf(\"%s \", q1->i);\n  return 0;\n}\n"}
{"label": "9", "index": "16118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char id[11];\n  int age;\n} MAN;\n\nvoid sort(MAN *array, int nSize) {\n  int i, j;\n  for (i = 0; i < nSize; i++) {\n    for (j = nSize - 1; j > i; j--) {\n      if (array[j].age >= 60 && array[j].age > array[j - 1].age) {\n        MAN temp = array[j];\n        array[j] = array[j - 1];\n        array[j - 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int i, n;\n  MAN *array = 0;\n  double ava, maxgap = 0;\n\n  cin >> n;\n  array = (MAN *)malloc(n * sizeof(MAN));\n  for (i = 0; i < n; i++) {\n    cin >> array[i].id >> (array[i].age);\n  }\n\n  sort(array, n);\n  for (i = 0; i < n; i++) {\n    cout << array[i].id << \"\\n\";\n  }\n\n  free(array);\n  return 0;\n}\n"}
{"label": "9", "index": "16119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0;\n  scanf(\"%d\\n\", &n);\n  struct p {\n    char num[10000];\n    int age;\n  } p[100];\n  struct p1 {\n    char num1[10000];\n    int age1;\n  } p1[100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\\n\", p[i].num, &p[i].age);\n    if (p[i].age >= 60) {\n      strcpy(p1[m].num1, p[i].num);\n      p1[m].age1 = p[i].age;\n      m = m + 1;\n    }\n  }\n  int e;\n  char w[10000];\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (p1[j].age1 < p1[j + 1].age1) {\n        strcpy(w, p1[j + 1].num1);\n        strcpy(p1[j + 1].num1, p1[j].num1);\n        strcpy(p1[j].num1, w);\n        e = p1[j + 1].age1;\n        p1[j + 1].age1 = p1[j].age1;\n        p1[j].age1 = e;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", p1[i].num1);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16120", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n  struct Patient *next;\n  struct Patient *pre;\n};\nstruct Patient *creat(int x);\nstruct Patient *sort(struct Patient *);\nvoid print(struct Patient *);\n\nint main() {\n  struct Patient *patient, *patient2;\n  int n, i;\n  scanf(\"%d\", &n);\n  patient = creat(n);\n  patient2 = sort(patient);\n  print(patient2);\n  return 0;\n}\n\nstruct Patient *creat(int x) {\n  struct Patient *p1, *p2, *head, *p;\n  int i;\n  head = NULL;\n  for (i = 0; i < x; i++) {\n    p1 = (struct Patient *)malloc(1000);\n    if (i == 0) {\n      head = p1;\n      head->pre = NULL;\n    } else {\n      p2->next = p1;\n      p1->pre = p2;\n    }\n    p2 = p1;\n    scanf(\"%s%d\", p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return head;\n}\n\nstruct Patient *sort(struct Patient *head) {\n  struct Patient *p1, *p2, *temp, *p;\n  temp = (struct Patient *)malloc(1000);\n  p1 = p2 = head;\n  while (p1) {\n    if (p1->age >= 60) {\n      p2 = p1->next;\n      while (p2) {\n        if (p2->age > p1->age) {\n          temp->age = p2->age;\n          strcpy(temp->id, p2->id);\n          p = p2;\n          while (p->pre != p1) {\n            strcpy(p->id, p->pre->id);\n            p->age = p->pre->age;\n            p = p->pre;\n          }\n          strcpy(p->id, p1->id);\n          p->age = p1->age;\n          p1->age = temp->age;\n          strcpy(p1->id, temp->id);\n        }\n        p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\n\nvoid print(struct Patient *head) {\n  struct Patient *p1, *p2, *p;\n  p = head;\n  while (p) {\n    if (p->age >= 60)\n      printf(\"%s \", p->id);\n\n    p = p->next;\n  }\n  p = head;\n  while (p) {\n    if (p->age < 60) {\n      printf(\"%s \", p->id);\n    }\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i, j, lao = 0, you = 0, t;\n  char e[100][10], f[100][10], g[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", e[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[lao] = a[i];\n      strcpy(f[lao], e[i]);\n      lao++;\n    } else {\n      c[you] = a[i];\n      strcpy(g[you], e[i]);\n      you++;\n    }\n  }\n  for (j = 0; j < lao - 1; j++) {\n    for (i = 0; i < lao - 1; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(s, f[i]);\n        strcpy(f[i], f[i + 1]);\n        strcpy(f[i + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < lao; i++)\n    printf(\"%s\\n\", f[i]);\n  for (i = 0; i < you; i++)\n    cout << g[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n} person[100];\nint main() {\n  int i, j = -1, k, n, max;\n  char s[100][10], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &person[i].ID, &person[i].age);\n  for (i = 0; i < n; i++) {\n    a[i] = person[i].age;\n    if (person[i].age >= 60)\n      j++;\n  }\n  for (k = 0; k <= j; k++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%s\\n\", person[i].ID);\n        a[i] = 0;\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      printf(\"%s\\n\", person[i].ID);\n}\n"}
{"label": "9", "index": "16123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    int y, a;\n    char id[10];\n  } p[100], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].id >> p[i].y;\n    p[i].a = i + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[i].y >= 60 || p[j].y >= 60) {\n        if (p[j].y > p[i].y) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        } else if (p[i].y == p[j].y) {\n          if (p[j].a < p[i].a) {\n            t = p[i];\n            p[i] = p[j];\n            p[j] = t;\n          }\n        }\n      } else {\n        if (p[j].a < p[i].a) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << p[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0, r = 0, e, j;\n  char id[100][10], a[100][10], b[100][10], c[100];\n  int nl[100], am[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &nl[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (nl[i] >= 60) {\n      strcpy(a[m], id[i]);\n      am[m] = nl[i];\n      m++;\n    } else {\n      strcpy(b[r], id[i]);\n\n      r++;\n    }\n  }\n  for (i = m - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (am[j] < am[j + 1]) {\n        e = am[j + 1];\n        am[j + 1] = am[j];\n        am[j] = e;\n        strcpy(c, a[j + 1]);\n        strcpy(a[j + 1], a[j]);\n        strcpy(a[j], c);\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    puts(a[i]);\n  }\n  for (i = 0; i < r; i++) {\n    puts(b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t;\n  struct ill {\n    char num[10];\n    int age, id;\n  } man[1000], ex;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", man[i].num, &man[i].age);\n    man[i].id = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].age < man[j].age) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (man[i].age < 60) {\n      t = i;\n      break;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = i + 1; j < t; j++) {\n      if (man[i].age == man[j].age && man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = t; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (man[i].id > man[j].id) {\n        ex = man[i];\n        man[i] = man[j];\n        man[j] = ex;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << man[i].num << \" \";\n\n  for (i = 0; i < n; i++)\n    ;\n  return 0;\n}\n"}
{"label": "9", "index": "16126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, n, j, max, num = 0;\n  struct patient a[110], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      num++;\n  }\n  for (i = 0; i < num; i++) {\n    max = i;\n    for (j = i; j < n; j++) {\n      if (a[j].age > a[max].age)\n        max = j;\n    }\n    t = a[max];\n    for (j = max; j > i; j--)\n      a[j] = a[j - 1];\n    a[i] = t;\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    int id[7];\n    int age;\n  } patient[100];\n  int i, n, max = 0, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  for (k = max; k > 59; k--) {\n    for (i = 0; i < n; i++)\n      if (patient[i].age == k)\n        cout << patient[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60)\n      cout << patient[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], e;\n  char id[100][10], ex[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &age[i]);\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((age[j] < age[j + 1] && age[j] >= 60) ||\n          (age[j] < age[j + 1] && age[j + 1] >= 60)) {\n        e = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = e;\n        strcpy(ex, id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], ex);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << id[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16129", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef struct {\n  char id[11];\n  int age;\n} MAN;\n\nvoid sort(MAN *array, int nSize) {\n  int i, j;\n  for (i = 0; i < nSize; i++) {\n    for (j = nSize - 1; j > i; j--) {\n      if (array[j].age >= 60 && array[j].age > array[j - 1].age) {\n        MAN temp = array[j];\n        array[j] = array[j - 1];\n        array[j - 1] = temp;\n      }\n    }\n  }\n}\nint main() {\n  int i, n;\n  MAN *array = 0;\n  double ava, maxgap = 0;\n\n  scanf(\"%d\", &n);\n  array = (MAN *)malloc(n * sizeof(MAN));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", array[i].id, &(array[i].age));\n  }\n\n  sort(array, n);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", array[i].id);\n  }\n\n  free(array);\n  return 0;\n}\n"}
{"label": "9", "index": "16130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &at);\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          p11 = (struct patient *)malloc(sizeof(struct patient));\n          p11->age = at;\n          strcpy(p11->id, id);\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next) {\n    printf(\"%s \", t->id);\n  }\n  cout << t->id;\n}\n"}
{"label": "9", "index": "16131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  char id[10];\n  int age;\n} p[100];\nint main() {\n  int n, i, a[100], b[100], j, k, m = 0;\n  char str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a[j++] = i;\n      m++;\n    } else\n      b[k++] = i;\n  }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[a[j]].age < p[a[j + 1]].age) {\n        int t = p[a[j]].age;\n        p[a[j]].age = p[a[j + 1]].age;\n        p[a[j + 1]].age = t;\n        strcpy(str, p[a[j]].id);\n        strcpy(p[a[j]].id, p[a[j + 1]].id);\n        strcpy(p[a[j + 1]].id, str);\n      }\n    }\n  if (m != 0) {\n    printf(\"%s\", p[a[0]].id);\n    for (i = 1; i < m; i++)\n      printf(\"\\n%s\", p[a[i]].id);\n    for (i = 0; i < n - m; i++)\n      printf(\"\\n%s\", p[b[i]].id);\n  } else {\n    cout << p[b[0]].id;\n    for (i = 1; i < n; i++)\n      cout << \"\\n\" << p[b[i]].id;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16132", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s%d\", p1->num, &p1->sum);\n    p1->next = NULL;\n\n    if (i != 0) {\n      p3 = head;\n      if (p1->sum >= 60) {\n\n        while ((p1->sum <= p3->sum) && p3->next != NULL) {\n          p2 = p3;\n          p3 = p3->next;\n        }\n        if (p1->sum > p3->sum) {\n          if (head == p3) {\n            head = p1;\n            p1->next = p3;\n          } else {\n            p2->next = p1;\n            p1->next = p3;\n          }\n        } else {\n          p3->next = p1;\n          p1->next = NULL;\n        }\n      } else {\n        for (p2 = head;; p2 = p2->next) {\n          if (p2->next == NULL)\n            break;\n        }\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101][10] = {0}, p[101][10] = {0}, q[101][10] = {0};\n  int a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int n, i = 0, j = 0;\n  int f = 0, g = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[f] = a[i];\n      strcpy(p[f], s[i]);\n      f++;\n    } else if (a[i] < 60) {\n      c[g] = a[i];\n      strcpy(q[g], s[i]);\n      g++;\n    }\n  }\n  int e = 0;\n  char y[10] = {0};\n  for (j = 0; j < f; j++) {\n    for (i = f - 2; i >= j; i--) {\n      if (b[i] < b[i + 1]) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n        strcpy(y, p[i]);\n        strcpy(p[i], p[i + 1]);\n        strcpy(p[i + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < f; i++) {\n    printf(\"%s\\n\", p[i]);\n  }\n  for (j = 0; j < g; j++) {\n    printf(\"%s\\n\", q[j]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100], pos[100], t, m;\n  char a[100][11], temp[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++)\n    pos[i] = i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n      }\n    }\n  j = 0;\n  while (b[j] >= 60) {\n    printf(\"%s\\n\", a[j++]);\n  }\n  k = j;\n  for (i = k; i < n; i++)\n    for (j = k; j < n - 1; j++) {\n      if (pos[j] > pos[j + 1]) {\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n      }\n    }\n  for (j = k; j < n; j++)\n    printf(\"%s\\n\", a[j]);\n  return 0;\n}\n"}
{"label": "9", "index": "16135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstruct student {\n  int a;\n  struct student *next;\n  char num[20];\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s\", p1->num);\n  scanf(\"%d\", &p1->a);\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(sizeof(struct student));\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s\", p3->num);\n    scanf(\"%d\", &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL) {\n    p1 = p1->next;\n  }\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16136", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char name[11];\n  int age;\n  int order;\n};\nint main() {\n  struct patient peo[1000];\n  int n, i, count = 0, COUNT, j, k, e, agedata[1000], a = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &peo[i].name);\n    scanf(\"%d\", &peo[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      count++;\n      agedata[a] = peo[i].age;\n      a++;\n    }\n  } \n  COUNT = count;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      peo[i].order = count;\n      count++;\n    }\n  } \n  for (k = 1; k < COUNT; k++) {\n    for (j = 0; j < COUNT - k; j++) {\n      if (agedata[j] < agedata[j + 1]) {\n        e = agedata[j + 1];\n        agedata[j + 1] = agedata[j];\n        agedata[j] = e;\n      }\n    }\n  } \n  for (i = 0; i < COUNT; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].age == agedata[i]) {\n        peo[j].order = i;\n      }\n    }\n  } \n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].order == i) {\n        printf(\"%s \", peo[j].name);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0, sum = 59;\n  int a[100], b[100];\n  char c[101][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      } else\n        continue;\n    }\n    a[k] = -1;\n    b[j] = k;\n    sum = 59;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[b[i]]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 0 && a[i] < 60)\n      printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct hospital {\n  char ID[11];\n  int age;\n} old[100], young[100], all[100], temp;\nvoid sequence(struct hospital matrix[], int n) {\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (matrix[j].age < matrix[j + 1].age) {\n        temp = matrix[j];\n        matrix[j] = matrix[j + 1];\n        matrix[j + 1] = temp;\n      }\n    }\n  }\n}\n\n\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", all[i].ID, &all[i].age);\n  }\n  int oi = 0, yi = 0;\n  for (i = 0; i < n; i++) {\n    if (all[i].age >= 60) {\n      old[oi] = all[i];\n      oi++;\n    } else {\n      young[yi] = all[i];\n      yi++;\n    }\n  }\n  sequence(old, oi);\n  for (i = 0; i < oi; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < yi; i++) {\n    printf(\"%s\\n\", young[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, x;\n  scanf(\"%d\", &n);\n  int age[100];\n  char num[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", num[i], &age[i]);\n    if (age[i] < 60)\n      age[i] = 0;\n  }\nloop:\n  for (i = 0; i < n; i++) {\n    x = 0;\n    if (age[i] >= 60) {\n      for (int j = 0; j < n; j++) {\n        if (age[j] > age[i])\n          x = x + 1;\n      }\n      if (x == 0) {\n        printf(\"%s\\n\", num[i]);\n        age[i] = 1;\n        goto loop;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] == 0)\n      cout << num[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, e;\n  char q[11];\n  struct point {\n    char name[11];\n    int age;\n  } p[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &p[i].name, &p[i].age);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if ((p[i].age > 60 || p[i].age == 60) &&\n              (p[i + 1].age > 60 || p[i + 1].age == 60) &&\n              p[i].age < p[i + 1].age ||\n          p[i].age < 60 && (p[i + 1].age > 60 || p[i + 1].age == 60)) {\n        e = p[i].age;\n        p[i].age = p[i + 1].age;\n        p[i + 1].age = e;\n\n        strcpy(q, p[i].name);\n        strcpy(p[i].name, p[i + 1].name);\n        strcpy(p[i + 1].name, q);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].name);\n    if (i != n - 1) {\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16141", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pat {\n  char num[10];\n  int age;\n  int turn;\n} pa[100], temp, temp2;\n\nint main() {\n  int i, j, t, s, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &pa[i].num, &pa[i].age);\n    pa[i].turn = i;\n  }\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age >= 60) {\n      for (j = 1; j <= i; j++) {\n        if (pa[i].age > pa[j].age) {\n          temp = pa[j];\n          pa[j] = pa[i];\n          for (t = i - 1; t > j; t--) {\n            pa[t + 1] = pa[t];\n          }\n          pa[j + 1] = temp;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    puts(pa[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16142", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct p {\n    char num[11];\n    int age;\n  };\n  struct p c[101];\n  int n, i, t = 0, s, h, l = 0;\n  int a[100], b[100], d[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> c[i].num >> c[i].age;\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      a[t] = c[i].age;\n      c[i].age = 0;\n      b[t] = i;\n      t++;\n    }\n  }\n  if (t > 0) {\n  leap:\n    s = a[0];\n    h = 0;\n    for (i = 0; i < t; i++) {\n      if (a[i] > s) {\n        s = a[i];\n        h = i;\n      }\n    }\n    printf(\"%s\\n\", c[b[h]].num);\n    l++;\n    a[h] = 0;\n    if (l < t) {\n      goto leap;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age != 0)\n      printf(\"%s\\n\", c[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n};\nint main() {\n  struct patient *head, *p1, *p2, *p0;\n  int i, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct patient *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p1->id, &p1->age);\n    p1->next = NULL;\n    if (i == 0) {\n      head = p1;\n    } else {\n      if ((p1->age > 60) && (p1->age > head->age)) {\n        p0 = head;\n        p1->next = p0;\n        head = p1;\n      } else {\n        p0 = head;\n        p2 = head->next;\n        if ((p1->age) < 60) {\n          while (p2 != NULL) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n        } else {\n          while ((p2 != NULL) && ((p1->age) <= (p2->age))) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n          p1->next = p2;\n        }\n      }\n    }\n    p1 = (struct patient *)malloc(1000);\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  printf(\"%s\", p1->id);\n  return 0;\n}\n"}
{"label": "9", "index": "16144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, y[200], p[200];\n  char a[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 200; i++)\n    p[i] = 200 - i;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &y[i]);\n  }\n  for (i = 0; i <= 140; i++) {\n    for (j = 0; j < n; j++) {\n      if (y[j] == p[i])\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60)\n      cout << a[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, t;\n  char tc[16];\n  struct per {\n    char id[16];\n    int a;\n  } a[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].a);\n\n  for (int j = n - 1; j > 0; j--) {\n    for (int r = 0; r < j; r++) {\n      if (a[r].a > 59 && a[r + 1].a > 59 && a[r].a < a[r + 1].a) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n      if (a[r].a <= 59 && a[r + 1].a > 59) {\n\n        strcpy(tc, a[r + 1].id);\n        strcpy(a[r + 1].id, a[r].id);\n        strcpy(a[r].id, tc);\n        t = a[r + 1].a;\n        a[r + 1].a = a[r].a;\n        a[r].a = t;\n        r = 0;\n      }\n    }\n  }\n  for (int f = 0; f < n; f++) {\n    cout << a[f].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16146", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, k = 0, d[100], p;\n  char b[100][10], c[10], str[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> str[i] >> a[i];\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      d[k] = a[i];\n      strcpy(b[k], str[i]);\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (d[j] < d[j + 1]) {\n        p = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = p;\n\n        strcpy(c, b[j + 1]);\n        strcpy(b[j + 1], b[j]);\n        strcpy(b[j], c);\n      }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n}\n"}
{"label": "9", "index": "16147", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint m = 0;\nstruct patient {\n  char id[32];\n  int age;\n  struct patient *next;\n};\nstruct patient *find(struct patient *head) {\n  struct patient *p, *ppre;\n  p = head;\n  while (p && p->age >= 60) {\n    ppre = p;\n    p = p->next;\n  }\n  return ppre;\n}\nstruct patient *create(int n) {\n  struct patient *head = NULL, *p1, *p2, *p0, *q;\n  int i;\n  p1 = p2 = p0 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  if (p1->age >= 60)\n    m++;\n  p1->next = NULL;\n  head = p1 = p0;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age < 60) {\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    } else if (p1->age >= 60) {\n      m++;\n      if (head->age < 60) {\n        head = p1;\n        p1->next = p0;\n      }\n      if (head->age >= 60) {\n        p0 = find(head);\n        q = p0->next;\n        p0->next = p1;\n        p1->next = q;\n      }\n      if ((p0 = find(head))->next == NULL) {\n        p1->next = NULL;\n        p2->next = p1;\n        p2 = p1;\n      }\n    }\n  }\n  return head;\n}\nstruct patient *arrange(struct patient *head) {\n  struct patient *p1, *p2;\n  int t1, i, j;\n  char t2[32];\n  for (j = 0; j < m; j++) {\n    p1 = head;\n    for (i = 1; i < m - j; i++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p2->age < p1->age) {\n        t1 = p1->age;\n        strcpy(t2, p1->id);\n        p1->age = p2->age;\n        strcpy(p1->id, p2->id);\n        p2->age = t1;\n        strcpy(p2->id, t2);\n      }\n    }\n  }\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  int n, m = 0, age;\n  char id[32];\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16148", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int a;\n  char num[20];\n  struct student *next;\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->a);\n  head = (struct student *)malloc(1000);\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(1000);\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(1000);\n    cin >> p3->num >> p3->a;\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL)\n    p1 = p1->next;\n\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct kb {\n  char ID[10];\n  int nl;\n} kbr[100], lnr[100], ln;\n\nint main() {\n  int n, i, k = 0, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &kbr[i].ID, &kbr[i].nl);\n  }\n  for (i = 0; i < n; i++) {\n    if (kbr[i].nl >= 60) {\n      strcpy(lnr[k].ID, kbr[i].ID);\n      lnr[k].nl = kbr[i].nl;\n      k++;\n      strcpy(kbr[i].ID, \"000000000\");\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (l = 0; l < k - i; l++) {\n      if (lnr[l].nl < lnr[l + 1].nl) {\n        ln = lnr[l + 1];\n        lnr[l + 1] = lnr[l];\n        lnr[l] = ln;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", lnr[i].ID);\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(kbr[i].ID, \"000000000\") == 1) {\n      printf(\"%s\\n\", kbr[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  char s[11];\n  int n;\n  struct st *next;\n};\nstruct st *creat(int m) {\n  struct st *head, *p1, *p2;\n  int i;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    scanf(\"%s %d\", p1->s, &p1->n);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid line(struct st *head, int m) {\n  struct st *p, *p1, *p2;\n  p = head;\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    p1 = p;\n    p2 = p1->next;\n    for (j = 1; j < m; j++) {\n      char ss[11] = {'\u0000'};\n      if (p1->n >= 60) {\n        if (p2->n > p1->n) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      } else {\n        if (p2->n >= 60) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << p->s << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct st *p;\n  void line(struct st * head, int m);\n  struct st *creat(int m);\n  int m, i, j;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  line(p, m);\n  return 0;\n}\n"}
{"label": "9", "index": "16151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, t = 0;\n\n  struct patient {\n    char str[10];\n    int age;\n  } pat[100], pat2[100], patt;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].str >> pat[i].age;\n\n  for (i = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      pat2[j] = pat[i];\n      j++;\n      t++;\n    }\n\n  for (i = 0; i < t - 1; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (pat2[j + 1].age > pat2[j].age) {\n        patt = pat2[j];\n        pat2[j] = pat2[j + 1];\n        pat2[j + 1] = patt;\n      }\n    }\n  }\n\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", pat2[i].str);\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].str << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, mid;\n  char M[11];\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[11];\n    int age;\n  };\n  struct patient *per = (struct patient *)malloc(sizeof(struct patient) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", per[i].ID, &per[i].age);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (per[i].age < 60 && per[i + 1].age >= 60) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n      if (per[i].age >= 60 && per[i + 1].age >= 60 &&\n          per[i].age < per[i + 1].age) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << per[i].ID << \"\\n\";\n  free(per);\n}\n"}
{"label": "9", "index": "16153", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, f = 0, m = 0, j;\n\n  struct {\n    char id[10];\n    int age;\n  } bingren[100], t[100], l[100], c;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bingren[i].id >> bingren[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].age >= 60)\n      t[f++] = bingren[i];\n    else if (bingren[i].age < 60)\n      l[m++] = bingren[i];\n  }\n\n  for (i = 1; i < f; i++) {\n    for (j = i; j > 0; j--) {\n      if (t[j].age > t[j - 1].age) {\n        c = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = c;\n      }\n    }\n  }\n\n  for (i = 0; i < f; i++) {\n    printf(\"%s\\n\", t[i].id);\n  }\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", l[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << ID2[i] << \" \";\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s \", ID3[i]);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100], pos[100], t, m;\n  char a[100][11], temp[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++)\n    pos[i] = i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n      }\n    }\n  j = 0;\n  while (b[j] >= 60) {\n    printf(\"%s\\n\", a[j++]);\n  }\n  k = j;\n  for (i = k; i < n; i++)\n    for (j = k; j < n - 1; j++) {\n      if (pos[j] > pos[j + 1]) {\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n      }\n    }\n  for (j = k; j < n; j++)\n    cout << a[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, n = 0, k = 0, i = 0;\n\n  struct man {\n    int number;\n    char name[10];\n  } m[100], p[100], s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> m[i].name >> m[i].number;\n  for (i = 0; i < n; i++)\n    if (m[i].number >= 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (a = k - 1; a > 0; a--) {\n    for (b = 0; b < a; b++)\n      if (p[b].number < p[b + 1].number) {\n        s = p[b + 1];\n        p[b + 1] = p[b];\n        p[b] = s;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (m[i].number < 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", p[i].name);\n}\n"}
{"label": "9", "index": "16157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = -1, t = -1, k, age[100], e[100], h[100];\n  char a[100][10], b[100][10], c[100][10], f[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%s %d\", a[i], &age[i]);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (age[i] >= 60) {\n\n      s = s + 1;\n      e[s] = age[i];\n      strcpy(b[s], a[i]);\n    } else {\n\n      t = t + 1;\n      h[t] = age[i];\n      strcpy(c[t], a[i]);\n    }\n  }\n  for (j = 0; j < s; j++) {\n    for (i = 0; i < s - j; i++) {\n      if (e[i] < e[i + 1]) {\n        k = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = k;\n        strcpy(f, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i <= s; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= t; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0;\n  scanf(\"%d\", &n);\n  char **id = (char **)malloc(sizeof(char *) * n);\n  for (i = 0; i < n; i++) {\n    id[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int p = 0;\n  int *year = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &year[i]);\n    if (year[i] >= 60) {\n      p++;\n    }\n  }\n  char **idolder = (char **)malloc(sizeof(char *) * p);\n  for (i = 0; i < n; i++) {\n    idolder[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int *yearolder = (int *)malloc(sizeof(int) * p);\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      idolder[j] = id[i];\n      yearolder[j] = year[i];\n      j++;\n    }\n  }\n  int e;\n  char *id1 = (char *)malloc(sizeof(char) * 10);\n  for (i = 1; i <= p; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (yearolder[j + 1] > yearolder[j]) {\n        id1 = idolder[j];\n        idolder[j] = idolder[j + 1];\n        idolder[j + 1] = id1;\n        e = yearolder[j];\n        yearolder[j] = yearolder[j + 1];\n        yearolder[j + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", idolder[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60) {\n      cout << id[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16159", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j = 0, k = 0, a, e, f, b;\n  char id[1000][11], ido[1000][11], idy[1000][11], m[11];\n  int nl[1000], nlo[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &nl[i]);\n    if (nl[i] < 60) {\n      strcpy(idy[j], id[i]);\n      j++;\n    }\n    if (nl[i] >= 60) {\n      nlo[k] = nl[i];\n      strcpy(ido[k], id[i]);\n      k++;\n    }\n  }\n  for (a = 1; a <= k; a++) {\n    for (b = 0; b < k - a; b++) {\n      if (nlo[b] < nlo[b + 1]) {\n        e = nlo[b + 1];\n        nlo[b + 1] = nlo[b];\n        nlo[b] = e;\n        strcpy(m, ido[b + 1]);\n        strcpy(ido[b + 1], ido[b]);\n        strcpy(ido[b], m);\n      }\n    }\n  }\n  for (f = 0; f < k; f++) {\n    puts(ido[f]);\n  }\n\n  for (f = 0; f < j; f++) {\n    puts(idy[f]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16160", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct p {\n    char id[30];\n    int ag;\n  } a[105], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].ag;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (a[j - 1].ag >= 60 && a[j].ag >= 60) {\n        if (a[j - 1].ag < a[j].ag) {\n          temp = a[j - 1];\n          a[j - 1] = a[j];\n          a[j] = temp;\n        }\n      } else if (a[j - 1].ag < 60 && a[j].ag >= 60) {\n        temp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n}\n"}
{"label": "9", "index": "16161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d\", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      } else if (se[i] == se[j] && list[i] > list[j]) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n\n  for (i = 0; i <= nums; i++) {\n\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[100][100];\n  int age[100];\n  int age1[100];\n  int a[100];\n  int max, n, i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[j] = age[i];\n      age[i] = 0;\n      a[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    max = 0;\n    x = 0;\n    for (k = 0; k < j; k++) {\n      if (max < age1[k]) {\n        max = age1[k];\n        x = k;\n      }\n    }\n    printf(\"%s\\n\", string[a[x]]);\n    age1[x] = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16163", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, sr = 0, jr = 0, age, srage[100], jrage[100];\n  char num[10], srnum[100][10], jrnum[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &num, &age);\n    if (age < 60) {\n      strcpy(jrnum[jr], num);\n      jrage[jr] = age;\n      jr++;\n    } else {\n      strcpy(srnum[sr], num);\n      srage[sr] = age;\n      sr++;\n    }\n  }\n  for (i = sr - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (srage[j] < srage[j + 1]) {\n        age = srage[j];\n        srage[j] = srage[j + 1];\n        srage[j + 1] = age;\n        strcpy(num, srnum[j]);\n        strcpy(srnum[j], srnum[j + 1]);\n        strcpy(srnum[j + 1], num);\n      }\n    }\n  }\n  for (i = 0; i < sr; i++)\n    printf(\"%s\\n\", srnum[i]);\n  for (i = 0; i < jr; i++)\n    printf(\"%s\\n\", jrnum[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int score;\n  struct student *next;\n};\nint n = 0;\nstruct student *creat(int numb);\nvoid print(struct student *head);\nstruct student *maopao(struct student *head);\nint main() {\n  int n;\n  char ch;\n  struct student *head;\n  scanf(\"%d%c\", &n, &ch);\n  head = creat(n);\n  head = maopao(head);\n  print(head);\n  free(head);\n  return 0;\n}\n\nstruct student *creat(int numb) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->num, &p1->score);\n  head = NULL;\n  while (n < numb - 1) {\n    n = n + 1;\n    if (n == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->num, &p1->score);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct student *maopao(struct student *head) {\n  struct student *p0, *p1, *p2, *tem;\n  int temp = 0, i, j;\n  p0 = head;\n  p1 = head;\n  p2 = head;\n  if (head == NULL) {\n    return (head);\n  } else if (p0->next == NULL) {\n    return (head);\n  } else if (p0->next != NULL) {\n    for (i = 0; i < n; i = i + 1) {\n      for (j = 0; j < n - 1; j = j + 1) {\n        if (p1->score < p1->next->score && j != 0 && p1->next->score >= 60) {\n          tem = p1->next;\n          p2->next = p1->next;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p2->next;\n        } else if (p1->score < p1->next->score && j == 0 &&\n                   p1->next->score >= 60) {\n          tem = p1->next;\n          p0 = tem;\n          p2 = tem;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p1;\n          p1 = p1->next;\n        } else {\n          p2 = p1;\n          p1 = p1->next;\n        }\n      }\n      temp = temp + 1;\n      p1 = p0;\n      p2 = p0;\n    }\n  }\n  return (p0);\n}\n\nvoid print(struct student *head) {\n  struct student *p, *tempo;\n  p = head;\n  if (head != NULL) {\n    do {\n      tempo = p->next;\n      printf(\"%s \", p->num);\n      p = tempo;\n    } while (p != NULL);\n  }\n}\n"}
{"label": "9", "index": "16165", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nint main() {\n  int max, t = 1, n, i;\n  struct patient p[101];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> p[i].id >> p[i].age;\n  for (; t != 0;) {\n    max = 59;\n    t = 0;\n    for (i = 1; i <= n; i++) {\n      if (p[i].age > max) {\n        max = p[i].age;\n        t = i;\n      }\n    }\n    if (t != 0)\n      printf(\"%s\\n\", p[t].id);\n    p[t].age = 0;\n  }\n  for (i = 1; i <= n; i++)\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n}\n"}
{"label": "9", "index": "16166", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num;\n  scanf(\"%d\", &num);\n  p2 = NULL;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  while (num > 0) {\n    p2 = p1;\n    scanf(\"%s %d\", &p1->ID, &p1->age);\n    p1 = (struct patient *)malloc(1000);\n    p2->next = p1;\n    num--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct patient *sort(struct patient *head) {\n  struct patient *first;\n  struct patient *tail;\n  struct patient *p_max;\n  struct patient *max;\n  struct patient *p;\n  first = NULL;\n  while (head != NULL) {\n    for (p = head, max = head; p->next != NULL; p = p->next) {\n      if (p->next->age > max->age && p->next->age >= 60) {\n        p_max = p;\n        max = p->next;\n      }\n    }\n    if (first == NULL) {\n      first = max;\n      tail = max;\n    } else {\n      tail->next = max;\n      tail = max;\n    }\n    if (max == head) {\n      head = head->next;\n    } else {\n      p_max->next = max->next;\n    }\n  }\n  if (first != NULL) {\n    tail->next = NULL;\n  }\n  head = first;\n  return head;\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  int n, i, j;\n  head = creat();\n  head = sort(head);\n  print(head);\n}\n\n\n"}
{"label": "9", "index": "16167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct {\n    char id[10];\n    int age;\n  } br[100], *p, old[100], *q;\n  for (p = br; p < br + n; p++) {\n    scanf(\"%s%d\", &(p->id), &(p->age));\n  }\n  q = old;\n  int js = 0;\n  for (p = br; p < br + n; p++) {\n    if (p->age >= 60) {\n      q->age = p->age;\n      strcpy(q->id, p->id);\n      q++;\n      js++;\n      p->age = 0;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < js; i++) {\n    for (q = old; q < old + js; q++) {\n      if (q->age > (old + max)->age) {\n        max = q - old;\n      }\n    }\n    printf(\"%s\\n\", (old + max)->id);\n    (old + max)->age = 0;\n  }\n  for (p = br; p < br + n; p++) {\n    if (p->age != 0) {\n      printf(\"%s\\n\", p->id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bingren {\n  char id[1000];\n  int age;\n} bin[101];\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k = 0, l = 0, e, a[100];\n  char xiao[101][1000], da[101][1000], c[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &bin[i].id, &bin[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bin[i].age < 60) {\n      strcpy(xiao[k], bin[i].id);\n      k++;\n    } else {\n      strcpy(da[l], bin[i].id);\n      a[l] = bin[i].age;\n      l++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (a[j] < a[j + 1]) {\n        strcpy(c, da[j + 1]);\n        strcpy(da[j + 1], da[j]);\n        strcpy(da[j], c);\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", da[i]);\n\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", xiao[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ILL {\n  char id[10];\n  int age;\n};\nint main() {\n  struct ILL ill[100];\n  int n, i, k, j = 0, Age[100], x;\n  char a[100][10], b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].id);\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      strcpy(a[j], ill[i].id);\n      Age[j] = ill[i].age;\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - i - 1; k++) {\n      if (Age[k] < Age[k + 1]) {\n        strcpy(b, a[k + 1]);\n        strcpy(a[k + 1], a[k]);\n        strcpy(a[k], b);\n        x = Age[k];\n        Age[k] = Age[k + 1];\n        Age[k + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (ill[i].age < 60) {\n      printf(\"%s\\n\", ill[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16170", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct patient {\n    char ID[10];\n    int age;\n  } pat[100], old[100];\n  int n, i, j, k = 0, a;\n  char b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].ID, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(old[k].ID, pat[i].ID);\n      old[k].age = pat[i].age;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        a = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = a;\n        strcpy(b, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", old[i].ID);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int n, z[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &z[i]);\n  }\n  for (int j = 120; j >= 60; j--) {\n    for (int t = 0; t < n; t++) {\n      if (z[t] == j) {\n        cout << s[t] << \"\\n\";\n        z[t] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (z[m] != 0)\n      printf(\"%s\\n\", s[m]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patience {\n  int shunxu;\n  char id[10];\n  int age;\n} pa[100];\nint main() {\n  int n, i, j, p = 60, q = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60)\n      q++;\n  }\n  do {\n    for (i = 0; i < n; i++) {\n      if (pa[i].age >= p) {\n        p = pa[i].age;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (pa[i].age == p) {\n        cout << pa[i].id << \"\\n\";\n        pa[i].age = 0;\n      }\n    }\n    p = 60;\n    q--;\n  } while (q > 0);\n  for (i = 0; i < n; i++) {\n    if (pa[i].age < 60 && pa[i].age > 0) {\n      printf(\"%s\\n\", pa[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct mouse {\n  char id[10];\n  int age;\n  struct mouse *next;\n};\nstruct mouse *creat(int n) {\n  struct mouse *head, *p1, *p2;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    if (i > 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    cin >> p1->id >> p1->age;\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct mouse *order(struct mouse *head, int n) {\n  struct mouse *p1, *p2;\n  int i, j, x;\n  char a[10];\n  for (i = 1; i < n; i++) {\n    p2 = head;\n    p1 = p2->next;\n    for (j = 0; j < n - i; j++) {\n      if (p2->age < p1->age && p1->age >= 60) {\n        x = p2->age;\n        p2->age = p1->age;\n        p1->age = x;\n        strcpy(a, p2->id);\n        strcpy(p2->id, p1->id);\n        strcpy(p1->id, a);\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n  return (head);\n}\nint main() {\n  struct mouse *head, *p;\n  int i, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = order(head, n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    cout << p->id << \" \";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, i, j, sgh, sgh60;\n  sgh = 0;\n  sgh60 = 0;\n  char d[10];\n  struct guahao {\n    char ID[10];\n    int age;\n  } gh[100], gh60[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", d, &a);\n    if (a >= 60) {\n      strcpy(gh60[sgh60].ID, d);\n      gh60[sgh60].age = a;\n      sgh60 = sgh60 + 1;\n    } else {\n      strcpy(gh[sgh].ID, d);\n      gh[sgh].age = a;\n      sgh = sgh + 1;\n    }\n  }\n  for (i = 1; i <= sgh60; i++) {\n    for (j = sgh60 - 1; j > 0; j--) {\n      if (gh60[j].age > gh60[j - 1].age) {\n        a = gh60[j].age;\n        gh60[j].age = gh60[j - 1].age;\n        gh60[j - 1].age = a;\n        strcpy(d, gh60[j].ID);\n        strcpy(gh60[j].ID, gh60[j - 1].ID);\n        strcpy(gh60[j - 1].ID, d);\n      }\n    }\n  }\n  for (i = 0; i < sgh60; i++) {\n    printf(\"%s\\n\", gh60[i].ID);\n  }\n  for (i = 0; i < sgh; i++) {\n    printf(\"%s\\n\", gh[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16175", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n} pat[100];\n\nint over60[100];\nint below60[100];\nint m, k;\nint main(int argc, char *argv[]) {\n  void choose(struct patient * p, int n);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  }\n  choose(pat, n);\n  for (j = 1; j <= m; j++) {\n    if (over60[m - j] != over60[m - j - 1]) {\n      for (i = 0; i < n; i++) {\n\n        if (pat[i].age == over60[m - j])\n          printf(\"%s\\n\", pat[i].id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      printf(\"%s\\n\", pat[i].id);\n    }\n  }\n  return 0;\n}\nvoid choose(struct patient *p, int n) {\n  void paixu(int *a, int n);\n  int i;\n  for (i = 0, m = 0, k = 0; i < n; i++) {\n    if ((p + i)->age >= 60) {\n      over60[m] = (p + i)->age;\n      m++;\n    }\n  }\n  paixu(over60, m);\n}\n\nvoid paixu(int *a, int n) {\n  int j, i, e;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (*(a + i) > *(a + i + 1)) {\n        e = *(a + i);\n        *(a + i) = *(a + i + 1);\n        *(a + i + 1) = e;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, t;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  char p[1][10];\n  int g[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &g[j]);\n  for (j = n - 1; j > 0; j--) {\n    for (k = n - 1; k > n - j - 1; k--) {\n      if (g[k] >= 60) {\n        if (g[k] > g[k - 1]) {\n          t = g[k - 1];\n          g[k - 1] = g[k];\n          g[k] = t;\n          strcpy(p[0], a[k - 1]);\n          strcpy(a[k - 1], a[k]);\n          strcpy(a[k], p[0]);\n        }\n      }\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << a[k] << \" \";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16177", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n} pat[100];\n\nint over60[100];\nint below60[100];\nint m, k;\nint main(int argc, char *argv[]) {\n  void choose(struct patient * p, int n);\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  }\n  choose(pat, n);\n  for (j = 1; j <= m; j++) {\n    if (over60[m - j] != over60[m - j - 1]) {\n      for (i = 0; i < n; i++) {\n\n        if (pat[i].age == over60[m - j])\n          printf(\"%s\\n\", pat[i].id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\nvoid choose(struct patient *p, int n) {\n  void paixu(int *a, int n);\n  int i;\n  for (i = 0, m = 0, k = 0; i < n; i++) {\n    if ((p + i)->age >= 60) {\n      over60[m] = (p + i)->age;\n      m++;\n    }\n  }\n  paixu(over60, m);\n}\n\nvoid paixu(int *a, int n) {\n  int j, i, e;\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (*(a + i) > *(a + i + 1)) {\n        e = *(a + i);\n        *(a + i) = *(a + i + 1);\n        *(a + i + 1) = e;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, m, k, f, j;\n  char e[10];\n  m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(e, pat[i].num);\n      f = pat[i].age;\n      for (k = i; k > m; k--) {\n        strcpy(pat[k].num, pat[k - 1].num);\n      }\n      strcpy(pat[m].num, e);\n      pat[m].age = f;\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < i; k++) {\n      if (pat[i].age > pat[k].age) {\n        f = pat[i].age;\n        strcpy(e, pat[i].num);\n        for (j = i; j > k; j--) {\n          pat[j].age = pat[j - 1].age;\n          strcpy(pat[j].num, pat[j - 1].num);\n        }\n        pat[k].age = f;\n        strcpy(pat[k].num, e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16179", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    char ID[10];\n    int a;\n    int p;\n  } s[100], t;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", s[i].ID, &s[i].a);\n    s[i].p = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (((s[i].a < 60) && (s[j].a >= 60)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a < s[j].a)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a == s[j].a) &&\n           (s[i].p > s[j].p)) ||\n          ((s[i].a < 60) && (s[j].a < 60) && (s[i].p > s[j].p))) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", s[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ID[100][10] = {'\\0'}, young[100][10] = {'\\0'}, old[100][10] = {'\\0'},\n       wae[100] = {'\\0'};\n  int age[100] = {0}, y[100] = {0}, o[100] = {0};\n  int i, n;\n  int m = 0, k = 0, temp = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[m], ID[i]);\n      y[m] = age[i];\n      m++;\n    } else {\n      strcpy(old[k], ID[i]);\n      o[k] = age[i];\n      k++;\n    }\n  }\n  for (a = 0; a < k - 1; a++) {\n    for (b = 0; b < k - a - 1; b++) {\n      if (o[b] < o[b + 1]) {\n        temp = o[b];\n        o[b] = o[b + 1];\n        o[b + 1] = temp;\n        strcpy(wae, old[b]);\n        strcpy(old[b], old[b + 1]);\n        strcpy(old[b + 1], wae);\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%s\\n\", old[a]);\n  for (b = 0; b < m; b++)\n    cout << young[b] << \"\\n\";\n}\n"}
{"label": "9", "index": "16181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int age;\n  struct student *next;\n};\nint n, i;\nstruct student *create() {\n  struct student *head;\n  struct student *p1, *p2;\n  head = NULL;\n  scanf(\"%d\", &i);\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->age);\n  while (n != i - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid paixu(struct student *p) {\n  struct student *p1, *p2;\n  char temp[20];\n  int temp2;\n  for (n = 1; n < i; n++) {\n    p2 = p;\n    p1 = p->next;\n    while (p1 != NULL) {\n      if (p1->age >= 60 && p2->age < 60) {\n\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      } else if (p1->age > p2->age && p2->age >= 60) {\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n}\nvoid print(struct student *p) {\n  while (p != NULL) {\n    cout << p->num;\n    p = p->next;\n    if (p != NULL)\n      cout << \" \";\n  }\n}\nint main() {\n  struct student *p;\n  p = create();\n  paixu(p);\n  print(p);\n  return 0;\n}\n"}
{"label": "9", "index": "16182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m, j, k;\n  scanf(\"%d\", &n);\n  struct br {\n    char x[10];\n    int y;\n  } * b, c[100], e;\n  b = (struct br *)malloc(sizeof(struct br) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i].x, &(b[i].y));\n  }\n  for (i = 0, m = 0; i < n; i++) {\n    if (b[i].y >= 60) {\n      c[m] = b[i];\n      m++;\n      b[i].y = -1;\n    }\n    for (k = 0; k < m; k++) {\n      for (j = m - 1; j > k; j--) {\n        if (c[j].y > c[j - 1].y) {\n          e = c[j];\n          c[j] = c[j - 1];\n          c[j - 1] = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << c[i].x << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i].y != -1) {\n      printf(\"%s\\n\", b[i].x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char str[10];\n  int y;\n} pa[101];\nint main() {\n  int n;\n  int i, j, k = 0, t = 0;\n  int a[100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pa[i].str, &pa[i].y);\n  for (i = 0; i < n; i++) {\n    if (pa[i].y >= 60) {\n      a[k] = i;\n      k++;\n    } else {\n      b[t] = i;\n      t++;\n    }\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (pa[a[j]].y < pa[a[j + 1]].y) {\n        pa[100] = pa[a[j]];\n        pa[a[j]] = pa[a[j + 1]];\n        pa[a[j + 1]] = pa[100];\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pa[a[i]].str);\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", pa[b[i]].str);\n  return 0;\n}\n"}
{"label": "9", "index": "16184", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct point {\n    char id[10];\n    int age;\n  } points[100], tmp;\n  for (i = 0; i < n; i++) {\n    cin >> points[i].id >> points[i].age;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (points[j + 1].age >= 60 && points[j + 1].age > points[j].age) {\n        tmp = points[j + 1];\n        points[j + 1] = points[j];\n        points[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", points[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16185", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stru {\n  char id[20];\n  int age;\n  struct stru *next;\n} * head, *p, *q;\n\nvoid creat(int N) {\n  int i;\n  p = q = (struct stru *)malloc(1000);\n  head = p;\n  cin >> p->id >> p->age;\n  for (i = 1; i < N; i++) {\n    p = (struct stru *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n}\n\nvoid arrange(struct stru *head, int N) {\n  int i, temp;\n  char media[20];\n  for (i = 0; i < N; i++)\n    for (p = head, q = head->next; q != NULL; p = p->next, q = q->next) {\n      if (q->age >= 60 && q->age > p->age) {\n        strcpy(media, p->id);\n        strcpy(p->id, q->id);\n        strcpy(q->id, media);\n        temp = p->age;\n        p->age = q->age;\n        q->age = temp;\n      }\n    }\n}\n\nvoid print(struct stru *head) {\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s \", p->id);\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  creat(N);\n\n  arrange(head, N);\n  print(head);\n}\n"}
{"label": "9", "index": "16186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint main() {\n  int n, i;\n  struct patient *p, *pre, *pnew, *head1, *head2;\n  head1 = NULL;\n  head2 = NULL;\n  scanf(\"%d\\n\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    pnew = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\\n\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if (pnew->age >= 60) {\n      if (head1 == NULL) {\n        head1 = pnew;\n      } else {\n        p = head1;\n        while (p && p->age >= pnew->age) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head1) {\n          pnew->next = head1;\n          head1 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    } else {\n      if (head2 == NULL)\n        head2 = pnew;\n      else {\n        p = head2;\n        while (p) {\n          pre = p;\n          p = p->next;\n        }\n        if (p == head2) {\n          pnew->next = head2;\n          head2 = pnew;\n        } else {\n          pre->next = pnew;\n          pnew->next = p;\n        }\n      }\n    }\n  }\n  p = head1;\n  if (head1 != NULL) {\n    while (p) {\n      cout << p->id << \"\\n\";\n      p = p->next;\n    }\n  }\n  p = head2;\n  if (head2 != NULL) {\n    while (p) {\n      printf(\"%s\\n\", p->id);\n      p = p->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p1, *p2;\n  p2 = p1 = (struct patient *)malloc(1000);\n  head = p1;\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i, j, n;\n  char a[10];\n  scanf(\"%d\", &n);\n  struct patient *h, *q, *p;\n  h = creat(n);\n  for (i = 0; i < n; i++) {\n    for (q = h; q->next != NULL; q = q->next)\n      if (q->next->age >= 60 && q->next->age > q->age) {\n        strcpy(a, q->ID);\n        strcpy(q->ID, q->next->ID);\n        strcpy(q->next->ID, a);\n        j = q->age;\n        q->age = q->next->age;\n        q->next->age = j;\n      }\n  }\n  for (p = h; p != NULL; p = p->next)\n    cout << p->ID << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16188", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct s {\n    char id[10];\n    int age;\n  };\n  struct s S[100], Si;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", S[i].id, &S[i].age);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (S[j + 1].age >= 60) {\n        if (S[j].age < S[j + 1].age) {\n          Si = S[j];\n          S[j] = S[j + 1];\n          S[j + 1] = Si;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", S[i].id);\n  }\n}\n"}
{"label": "9", "index": "16189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } all[100], old[100], temp;\n  int n, j = 0, k, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> all[i].id >> all[i].a;\n    if (all[i].a >= 60) {\n      old[j] = all[i];\n      j = j + 1;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (k = 0; k < i; k++) {\n      if (old[k].a < old[k + 1].a) {\n        temp = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (all[i].a < 60)\n      printf(\"%s\\n\", all[i].id);\n  }\n}\n"}
{"label": "9", "index": "16190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char ID[20];\n  int age;\n};\nint main() {\n  struct person a[100] = {0}, b[100] = {0}, t;\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].ID, &a[i].age);\n    if (a[i].age >= 60) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - 1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 0; i < k; i++) {\n    puts(b[i].ID);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      puts(a[i].ID);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16191", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(int n) {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->next = NULL;\n    i++;\n    p2->next = p1;\n    p2 = p1;\n  } while (i < n);\n  return (head);\n}\n\nstruct patient *tiao(struct patient *head, int n) {\n  struct patient *p1;\n  int t, i;\n  char s[10];\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    do {\n      if (p1->age < (p1->next)->age && (p1->next)->age >= 60) {\n        t = p1->age;\n        p1->age = (p1->next)->age;\n        (p1->next)->age = t;\n        strcpy(s, p1->id);\n        strcpy(p1->id, (p1->next)->id);\n        strcpy((p1->next)->id, s);\n      }\n      p1 = p1->next;\n    } while (p1->next);\n  }\n\n  return (head);\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p);\n}\n\nint main() {\n  struct patient *head;\n  int n;\n  cin >> n;\n  head = creat(n);\n  head = tiao(head, n);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "16192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, temp, m = 0;\n  int patage[100];\n  struct patient {\n    char num[20];\n    int age;\n  };\n  struct patient pat[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      patage[j] = pat[i].age;\n      j++;\n      m++;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (patage[j] < patage[j + 1]) {\n        temp = patage[j];\n        patage[j] = patage[j + 1];\n        patage[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    if (patage[i] == patage[i - 1])\n      continue;\n    for (j = 0; j < n; j++)\n      if (pat[j].age == patage[i])\n        printf(\"%s\\n\", pat[j].num);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[1000], e[1000], t, b, k, j, d;\n  char str[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%s %d\", str[i], &a[i]);\n  }\n  b = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60)\n      b++;\n  }\n  t = b;\n  for (i = 1; i <= n; i++) {\n    if (a[i] < 60) {\n      b++;\n      e[b] = i;\n    }\n  }\n  k = 0;\n  for (j = 100; j >= 60; j--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i] == j) {\n        k++;\n        e[k] = i;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    j = e[i];\n    if (i == 1)\n      cout << str[j];\n    else\n      printf(\" %s\", str[j]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  char id[10];\n  int age;\n} ill[100];\n\nint main() {\n  int i, j, n, q;\n  char p[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &ill[i].id, &ill[i].age);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = n - 1; i > j; i--) {\n      if (ill[i].age >= 60 && ill[i].age > ill[i - 1].age) {\n        strcpy(p, ill[i].id);\n        q = ill[i].age;\n        strcpy(ill[i].id, ill[i - 1].id);\n        ill[i].age = ill[i - 1].age;\n        strcpy(ill[i - 1].id, p);\n        ill[i - 1].age = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ill[i].id);\n}\n"}
{"label": "9", "index": "16195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int age[100], a, m = 0, tmp1[100], d = 0;\n  char zfc[100][11], tmp2[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      strcpy(tmp2[m], zfc[i]);\n      tmp1[m] = age[i];\n      m++;\n    }\n  }\n  for (a = m - 1; a > 0; a--) {\n    for (d = 0; d < a; d++) {\n      if (tmp1[d] < tmp1[d + 1]) {\n        char s[200];\n        strcpy(s, tmp2[d]);\n        strcpy(tmp2[d], tmp2[d + 1]);\n        strcpy(tmp2[d + 1], s);\n        int y;\n        y = tmp1[d];\n        tmp1[d] = tmp1[d + 1];\n        tmp1[d + 1] = y;\n      }\n    }\n  }\n  for (a = 0; a < m; a++) {\n    printf(\"%s\\n\", tmp2[a]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16196", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n};\nint main() {\n  struct pa p[200];\n  int n, i, t[200], j, m;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  i = 0;\n  t[0] = 0;\n  while (i < n) {\n    if (p[i].age >= 60) {\n      for (j = 0; j < i && p[t[j]].age >= p[i].age; j++)\n        ;\n      for (m = i; m > j; m--)\n        t[m] = t[m - 1];\n      t[j] = i;\n      i++;\n    } else {\n      t[i] = i;\n      i++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[t[i]].id);\n}\n"}
{"label": "9", "index": "16197", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int n, j = 0, i, num = 0, t;\n  char a[100][10], d[100][10], temp[10];\n  int b[100], c[100];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[j] = b[i];\n      strcpy(d[j], a[i]);\n      j++;\n      num = j;\n    }\n  }\n  for (i = 1; i < num; i++)\n    for (j = 0; j < num - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j + 1];\n        c[j + 1] = c[j];\n        c[j] = t;\n        strcpy(temp, d[j + 1]);\n        strcpy(d[j + 1], d[j]);\n        strcpy(d[j], temp);\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      c[num] = b[i];\n      strcpy(d[num], a[i]);\n      num++;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    printf(\"%s\\n\", d[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[11];\n  int age;\n  struct ill *next;\n};\nstruct ill *creat(int n) {\n  struct ill *head, *p1, *p2;\n  int i;\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct ill *arrang(struct ill *head) {\n  int t, tt;\n  char s[11], ss[11];\n  struct ill *p, *q, *m, *h;\n  for (p = head; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      for (m = p, q = p->next; q != NULL; q = q->next)\n        if (q->age > m->age && m->age >= 60)\n          m = q;\n      {\n        t = tt = p->age;\n        strcpy(s, p->id);\n        strcpy(ss, p->id);\n        for (h = p->next; h != m->next; h = h->next) {\n          tt = h->age;\n          strcpy(ss, h->id);\n          h->age = t;\n          strcpy(h->id, s);\n          t = tt;\n          strcpy(s, ss);\n        }\n        p->age = t;\n        strcpy(p->id, s);\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int n;\n  struct ill *head, *h;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = arrang(head);\n  for (h = head; h != NULL; h = h->next)\n    if (h->age >= 60) {\n      printf(\"%s\\n\", h->id);\n    }\n  for (h = head; h != NULL; h = h->next)\n    if (h->age < 60)\n      printf(\"%s\\n\", h->id);\n}\n"}
{"label": "9", "index": "16199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, n = 0, k = 0, i = 0;\n\n  struct man {\n    int number;\n    char name[10];\n  } m[100], p[100], s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", m[i].name, &m[i].number);\n  for (i = 0; i < n; i++)\n    if (m[i].number >= 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (a = k - 1; a > 0; a--) {\n    for (b = 0; b < a; b++)\n      if (p[b].number < p[b + 1].number) {\n        s = p[b + 1];\n        p[b + 1] = p[b];\n        p[b] = s;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (m[i].number < 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    cout << p[i].name << \"\\n\";\n}\n"}
{"label": "9", "index": "16200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Patient {\n  char id[10];\n  int age;\n  int num;\n} patient[100];\nint main() {\n  int n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  int i, j, k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", &patient[i].id, &patient[i].age);\n    patient[i].num = i;\n  }\n  int s[100];\n  for (i = 0; i <= 99; i++) {\n    s[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - 2; j++) {\n      if (patient[s[j]].age < patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (patient[i].age >= 60)\n      k = k + 1;\n  }\n  for (i = 0; i <= k - 2; i++) {\n    for (j = 0; j <= k - 2; j++) {\n      if (s[j] > s[j + 1] && patient[s[j]].age == patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = k; i <= n - 2; i++) {\n    for (j = k; j <= n - 2; j++) {\n      if (s[j] > s[j + 1]) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    cout << patient[s[i]].id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char a[100];\n  int age;\n} pat[110], pat1[110];\n\nvoid bubble(int n) {\n  int i, j;\n  struct patient temp;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (pat1[j].age < pat1[j + 1].age) {\n        temp = pat1[j];\n        pat1[j] = pat1[j + 1];\n        pat1[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].a, &pat[i].age);\n    if (pat[i].age >= 60)\n      pat1[k++] = pat[i];\n  }\n  bubble(k);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pat1[i].a);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  }\n}\n"}
{"label": "9", "index": "16202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } patient[100], old[100], t;\n  int a, i = 0, j = 0, k = 0, r, i1;\n  scanf(\"%d\", &a);\n  getchar();\n  for (i = 0; j + i < a; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[j] = patient[i];\n      j++;\n      i--;\n    }\n  }\n  for (r = 0; r < j - 1; r++)\n    for (k = 0; k < j - 1 - r; k++)\n      if (old[k].age < old[k + 1].age) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (r = 0; r < j; r++) {\n    printf(\"%s\\n\", old[r].id);\n  }\n  for (r = 0; r < i; r++)\n    printf(\"%s\\n\", patient[r].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100] = {0}, i, j, k, old[101] = {0}, oldn, youngn;\n  char id[101][20] = {0}, oldid[101][20] = {0}, youngid[101][20] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 1, j = 1, k = 1; i <= n; i++) {\n    if (age[i] >= 60) {\n      old[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      strcpy(youngid[k], id[i]);\n      k++;\n    }\n  }\n  oldn = j;\n  youngn = k;\n  for (i = 1; i <= oldn; i++) {\n    for (j = 1; j <= oldn - i; j++) {\n      if (old[j] < old[j + 1]) {\n        old[100] = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = old[100];\n        strcpy(oldid[101], oldid[j]);\n        strcpy(oldid[j], oldid[j + 1]);\n        strcpy(oldid[j + 1], oldid[101]);\n      }\n    }\n  }\n  for (i = 1; i < oldn; i++)\n    printf(\"%s\\n\", oldid[i]);\n  for (k = 1; k < youngn; k++)\n    printf(\"%s\\n\", youngid[k]);\n}\n"}
{"label": "9", "index": "16204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, s, t, k = 0, n;\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient p[100], d[100], c[100], temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p[i].ID >> p[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60)\n      d[j++] = p[i];\n    else\n      c[k++] = p[i];\n  }\n  s = j;\n  t = k;\n  for (i = 1; i < s; i++) {\n    for (j = 0; j < s - i; j++) {\n      if (d[j].age < d[j + 1].age) {\n        temp = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i].ID);\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", c[i].ID);\n}\n"}
{"label": "9", "index": "16205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} p[101];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> p[i].No >> p[i].age;\n\n  struct patient t;\n  for (i = 2; i <= n; i++) {\n    if (p[i].age >= 60) {\n      for (j = i; j > 1; j--) {\n        if (p[j - 1].age < p[j].age) {\n          t = p[j - 1];\n          p[j - 1] = p[j];\n          p[j] = t;\n        } else\n          break;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << p[i].No << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16206", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0, r = 0, e, j;\n  char id[100][10], a[100][10], b[100][10], c[100];\n  int nl[100], am[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> nl[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (nl[i] >= 60) {\n      strcpy(a[m], id[i]);\n      am[m] = nl[i];\n      m++;\n    } else {\n      strcpy(b[r], id[i]);\n\n      r++;\n    }\n  }\n  for (i = m - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (am[j] < am[j + 1]) {\n        e = am[j + 1];\n        am[j + 1] = am[j];\n        am[j] = e;\n        strcpy(c, a[j + 1]);\n        strcpy(a[j + 1], a[j]);\n        strcpy(a[j], c);\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    puts(a[i]);\n  }\n  for (i = 0; i < r; i++) {\n    puts(b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct myturn {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j = 0, max = 0;\n  struct myturn patient[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &patient[i].ID, &patient[i].age);\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  if (max >= 60) {\n    for (max; max >= 60; max--) {\n      for (i = 0; i < n; i++) {\n        if (patient[i].age == max) {\n          cout << patient[i].ID << \"\\n\";\n          patient[i].age = 0;\n          j++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age != 0) {\n      printf(\"%s\", patient[i].ID);\n      j++;\n      if (j < n)\n        printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bingren {\n  char id[10];\n  int o;\n} bingren[201];\nint main() {\n  int n, i, j, y, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", bingren[i].id, &bingren[i].o);\n  }\n  for (i = 0, j = 100; i < n; i++) {\n\n    if (bingren[i].o >= 60) {\n      bingren[j] = bingren[i];\n      j++;\n    }\n  }\n  y = j;\n  for (j = 0; j < y - 1; j++) {\n    for (i = 100; i < y - j; i++) {\n      if (bingren[i].o < bingren[i + 1].o) {\n        bingren[200] = bingren[i];\n        bingren[i] = bingren[i + 1];\n        bingren[i + 1] = bingren[200];\n      }\n    }\n  }\n  for (i = 100; i < y; i++) {\n    printf(\"%s\\n\", bingren[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].o < 60)\n      printf(\"%s\\n\", bingren[i].id);\n  }\n}\n"}
{"label": "9", "index": "16209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, j = 0, e, x, a = 0, k;\n  int y[100], year[100];\n  char id[10], t[100][10], ee[10], p[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id, &x);\n    if (x >= 60) {\n      y[j] = x;\n      strcpy(t[j], id);\n      j++;\n    } else {\n      year[a] = x;\n      strcpy(p[a], id);\n      a++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (y[i] < y[i + 1]) {\n        e = y[i + 1];\n        y[i + 1] = y[i];\n        y[i] = e;\n\n        strcpy(ee, t[i + 1]);\n        strcpy(t[i + 1], t[i]);\n        strcpy(t[i], ee);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n\n    printf(\"%s\\n\", t[i]);\n  }\n  for (k = 0; k < a; k++) {\n    printf(\"%s\\n\", p[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ID {\n    char x[100];\n    int y;\n  } da[100], xiao[100], p[100], e;\n  int s, m = 0, n = 0;\n  cin >> s;\n\n  for (int i = 0; i < s; i++) {\n    scanf(\"%s %d\", &(p[i].x), &(p[i].y));\n    if (p[i].y >= 60) {\n      da[m] = p[i];\n      m++;\n    } else {\n      xiao[n] = p[i];\n      n++;\n    }\n  }\n\n  for (int b = 1; b <= m; b++) {\n    for (int v = 0; v < m - b; v++) {\n      if (da[v].y < da[v + 1].y) {\n        e = da[v];\n        da[v] = da[v + 1];\n        da[v + 1] = e;\n      }\n    }\n  }\n  int h, f;\n  for (int z = 0; z < m; z++) {\n    f = strlen(da[z].x);\n    for (int g = 0; g < f; g++) {\n      if (g != f - 1) {\n        printf(\"%c\", da[z].x[g]);\n      } else {\n        cout << da[z].x[g] << \"\\n\";\n      }\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    h = strlen(xiao[a].x);\n    for (int j = 0; j < h; j++) {\n      if (j != h - 1) {\n        printf(\"%c\", xiao[a].x[j]);\n      } else {\n        printf(\"%c\\n\", xiao[a].x[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int o[100], n, i, j, s[100], b = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &o[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] >= 60) {\n      s[b] = o[i];\n      b++;\n    }\n  }\n  for (i = 0; i < b; i++) {\n    for (j = b - 1; j > i; j--) {\n      if (s[j] > s[j - 1]) {\n        t = s[j];\n        s[j] = s[j - 1];\n        s[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < b - 1; i++) {\n    if (s[i] == s[i + 1])\n      s[i] = -1;\n  }\n  for (i = 0; i < b; i++) {\n    for (j = 0; j < n; j++) {\n      if (o[j] == s[i])\n        printf(\"%s\\n\", id[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (o[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], i, num = 0, m[100], j;\n  char c[100][10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      for (j = 0; j < n; j++) {\n        if (a[i] >= a[j]) {\n          num = num + 1;\n        }\n      }\n      m[i] = num;\n      num = 0;\n    }\n  }\n\n  for (j = n; j > 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 60) {\n        if (m[i] == j)\n          printf(\"%s\\n\", c[i]);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      cout << c[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main()\n\n{\n  void bubble(struct patient a[], int len);\n  int n, i, old, sum, age, j;\n  struct patient a[100];\n  struct patient b[100];\n  char str[100] = {'\\0'};\n  char str1[100] = {'\\0'};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0, sum = 0; sum <= n;) {\n    age = 0;\n    strcpy(str, str1);\n    scanf(\"%s %d\", str, &age);\n\n    if (age >= 60) {\n      strcpy(a[i].num, str);\n      a[i].age = age;\n      i++;\n      sum++;\n    } else {\n      strcpy(b[j].num, str);\n      b[j].age = age;\n      j++;\n      sum++;\n    }\n  }\n  \n\n  bubble(a, i);\n  old = i;\n\n  for (i = 0; i < old; i++) {\n    printf(\"%s\\n\", a[i].num);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n\n  return 0;\n}\n\nvoid bubble(struct patient a[], int len) {\n  int i, pass;\n  struct patient temp; \n\n  for (pass = 1; pass < len; pass++) {\n    for (i = 0; i < len - pass; i++) {\n      if (a[i].age < a[i + 1].age) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char p[200][10], q[200][10] = {0}, c[10];\n  int a[200], b[200];\n  int n, i, j, x, y, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i]);\n    cin >> a[i];\n  }\n  j = 0;\n  x = 0;\n  t = 0;\n  y = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[j] = a[i];\n      strcpy(q[j], p[i]);\n      j++;\n      t++;\n    }\n  }\n  for (j = t - 1; j > 0; j--) {\n    for (i = 0; i < j; i++) {\n      if (b[i] < b[i + 1]) {\n        int r;\n        r = b[i + 1];\n        strcpy(c, q[i + 1]);\n        b[i + 1] = b[i];\n        strcpy(q[i + 1], q[i]);\n        b[i] = r;\n        strcpy(q[i], c);\n      }\n    }\n  }\n  for (i = 0; i < t; i++) {\n    cout << q[i] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", p[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k, m, n, e, x, s[100], t[100], v = 0;\n  char zfc[100][10], jg[100][10], h[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] >= 60) {\n      t[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (s[t[k]] < s[t[k + 1]]) {\n        m = t[k + 1];\n        t[k + 1] = t[k];\n        t[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(zfc[t[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] < 60) {\n      puts(zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, n, j, max, num = 0;\n  struct patient a[110], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      num++;\n  }\n  for (i = 0; i < num; i++) {\n    max = i;\n    for (j = i; j < n; j++) {\n      if (a[j].age > a[max].age)\n        max = j;\n    }\n    t = a[max];\n    for (j = max; j > i; j--)\n      a[j] = a[j - 1];\n    a[i] = t;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    char ID[10];\n    int a;\n    int p;\n  } s[100], t;\n  \n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", s[i].ID, &s[i].a);\n    s[i].p = i;\n  }\n\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (((s[i].a < 60) && (s[j].a >= 60)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a < s[j].a)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a == s[j].a) &&\n           (s[i].p > s[j].p)) ||\n          ((s[i].a < 60) && (s[j].a < 60) && (s[i].p > s[j].p))) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", s[i].ID);\n}\n"}
{"label": "9", "index": "16218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, z, y;\n  y = 0;\n  z = 0;\n  struct member {\n    char xh[10];\n    int ag;\n  };\n  struct member a[100];\n  struct member b[101], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].xh, &a[i].ag);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].ag >= 60) {\n      b[y] = a[i];\n      y++;\n    } else {\n      c[z] = a[i];\n      z++;\n    }\n  }\n\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j].ag < b[j + 1].ag) {\n        b[100] = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = b[100];\n      }\n    }\n  }\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", b[i].xh);\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", c[i].xh);\n}\n"}
{"label": "9", "index": "16219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar id[1000][1000], oldid[1000][1000], newid[1000][1000];\nint age[1000];\nint oldage[1000], newage[1000];\nint main() {\n  int num;\n  int i = 0, j = 0, k = 0, n = 0;\n  int e_oldage;\n  char e_oldid[1000];\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  for (i = 0; i < num; i++) {\n    if (age[i] >= 60) {\n      oldage[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      newage[n] = age[i];\n      strcpy(newid[n], id[i]);\n      n++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (oldage[i] < oldage[i + 1]) {\n        e_oldage = oldage[i + 1];\n        strcpy(e_oldid, oldid[i + 1]);\n\n        oldage[i + 1] = oldage[i];\n        strcpy(oldid[i + 1], oldid[i]);\n\n        oldage[i] = e_oldage;\n        strcpy(oldid[i], e_oldid);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", oldid[i]);\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", newid[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, l;\n  int age[10000];\n  char ID[10000][10], order[10000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 1; j < n - i; j++) {\n      if (age[j] >= 60 && age[j] > age[m])\n        m = j;\n    }\n    for (j = 0; j < 10; j++)\n      order[i][j] = ID[m][j];\n\n    for (j = m; j < n; j++) {\n      for (k = 0; k < 10; k++) {\n        ID[j][k] = ID[j + 1][k];\n      }\n      age[j] = age[j + 1];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(order[i]);\n  }\n}\n"}
{"label": "9", "index": "16221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int age;\n} stu[100];\n\nint main() {\n  char c;\n  int n, i, j;\n  struct student *pstu = stu, e;\n  pstu = &stu[0];\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n\n  for (j = 0; j < n; j++) {\n    if (stu[j].age >= 60) {\n      for (i = j; i > 0; i--) {\n        if (stu[i].age > stu[i - 1].age) {\n          e = *(pstu + i);\n          *(pstu + i) = *(pstu + i - 1);\n          *(pstu - 1 + i) = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (pstu + i)->num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, year[100], i, j, year2[100] = {0}, t, k;\n  char num[100][10], num2[100][10], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    scanf(\"%d\", &year[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      for (k = 0; k < 10; k++)\n        num2[i][k] = num[i][k];\n\n      year2[i] = year[i];\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++) {\n      if (year2[i] < year2[i + 1]) {\n        t = year2[i];\n        year2[i] = year2[i + 1];\n        year2[i + 1] = t;\n        for (k = 0; k < 10; k++) {\n          p = num2[i][k];\n          num2[i][k] = num2[i + 1][k];\n          num2[i + 1][k] = p;\n        }\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (year2[i] != 0)\n      cout << num2[i] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60)\n      cout << num[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char name[11];\n  int age;\n  int order;\n};\nint main() {\n  struct patient peo[1000];\n  int n, i, count = 0, COUNT, j, k, e, agedata[1000], a = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &peo[i].name);\n    scanf(\"%d\", &peo[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      count++;\n      agedata[a] = peo[i].age;\n      a++;\n    }\n  }\n  COUNT = count;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      peo[i].order = count;\n      count++;\n    }\n  }\n  for (k = 1; k < COUNT; k++) {\n    for (j = 0; j < COUNT - k; j++) {\n      if (agedata[j] < agedata[j + 1]) {\n        e = agedata[j + 1];\n        agedata[j + 1] = agedata[j];\n        agedata[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < COUNT; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].age == agedata[i]) {\n        peo[j].order = i;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (peo[j].order == i) {\n        cout << peo[j].name << \" \";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mouse {\n  int weight;\n  char color[11];\n  struct mouse *next, *before;\n};\nint main() {\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  struct mouse *m, *head, *p1, *p2, *fin;\n  head = p1 = p2 = (struct mouse *)malloc(sizeof(struct mouse));\n  scanf(\"%s %d\", p1->color, &p1->weight);\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->color, &p1->weight);\n    p2->next = p1;\n    p1->before = p2;\n    p2 = p1;\n  }\n  fin = p1;\n  p1->next = NULL;\n  for (i = 1; i <= n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 1; j <= n + 1 - i; j++) {\n      if (p1->weight > max) {\n        max = p1->weight;\n        m = p1;\n      }\n      p1 = p1->next;\n    }\n    if (m->weight < 60)\n      break;\n    printf(\"%s\\n\", m->color);\n    if (m == head) {\n      head = head->next;\n      continue;\n    }\n    if (m == fin) {\n      fin = fin->before;\n      fin->next = NULL;\n      continue;\n    }\n    if (m != head && m != fin) {\n      p1 = m->before;\n      p1->next = m->next;\n      m = m->next;\n      m->before = p1;\n    }\n  }\n  p1 = head;\n  printf(\"%s\\n\", head->color);\n  for (; p1->next != NULL;) {\n    p1 = p1->next;\n    printf(\"%s\\n\", p1->color);\n  }\n}\n"}
{"label": "9", "index": "16225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct p {\n  char id[10];\n  int age;\n};\n\nvoid bubble(struct p a[100], int n) {\n  int i, j;\n  struct p temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j].age >= 60) {\n        if (a[j + 1].age > a[j].age) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      } else {\n        if (a[j + 1].age >= 60) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  struct p a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n\n  bubble(a, n);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int n) {\n  int i, s;\n  for (i = 1, s = a[1]; i < n; i++)\n    s = (s >= a[i]) ? s : a[i];\n  return (s);\n}\nint main() {\n  int a[200] = {0}, i, n, c[200] = {0}, e, t = 1;\n  char b[200][12];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", b[i], &e);\n    if (e >= 60)\n      a[i] = e;\n    else\n      c[i] = e;\n  }\n  for (;;) {\n    t = max(a, n);\n    if (t == 0)\n      break;\n    for (i = 1; i <= n; i++) {\n      if (a[i] == t) {\n        printf(\"%s \", b[i]);\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (c[i] != 0)\n      cout << b[i] << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, m, t, p, r;\n  int a[100], b[100];\n  char str1[100][10], str2[100][10];\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> str1[i] >> a[i];\n  for (p = 0, s = 0; p < n; p++) {\n    if (a[p] >= 60) {\n      b[s] = a[p];\n      strcpy(str2[s], str1[p]);\n      s = s + 1;\n    }\n  }\n  for (k = 0; k < (s - 1); k++) {\n    for (m = 0; m < (s - k - 1); m++) {\n      if (b[m + 1] > b[m]) {\n        t = b[m + 1];\n        b[m + 1] = b[m];\n        b[m] = t;\n        strcpy(string, str2[m + 1]);\n        strcpy(str2[m + 1], str2[m]);\n        strcpy(str2[m], string);\n      }\n    }\n  }\n  for (j = 0; j < s; j++)\n    cout << str2[j] << \"\\n\";\n  for (r = 0; r < n; r++) {\n    if (a[r] < 60)\n      cout << str1[r] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct br {\n    char no[10];\n    int s;\n  } a[100], b[100], r;\n  int n, i, j, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].no, &a[i].s);\n    if (a[i].s >= 60) {\n      b[t] = a[i];\n      t = t + 1;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++)\n      if (b[j].s < b[j + 1].s) {\n        r = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = r;\n      }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", b[i].no);\n  for (i = 0; i < n; i++)\n    if (a[i].s >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", a[i].no);\n  return 0;\n}\n"}
{"label": "9", "index": "16229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, i, j, l; \n  scanf(\"%d\", &num);\n  struct inf \n  {\n    char str[10];\n    int age;\n  } infs[101];\n  struct f {\n    char *p1;\n    int m1;\n  } old[101]; \n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d\", infs[i].str, &infs[i].age);\n  }\n  for (i = 0, j = 0; i < num; i++) \n    if (infs[i].age >= 60) {\n      old[j].m1 = infs[i].age;\n      old[j].p1 = infs[i].str; \n      j++;\n    }\n  int end = j;\n  char *k;\n  for (i = 0; i < end - 1; i++) \n  {\n    for (j = 0; j + 1 < end - i; j++)\n      if (old[j].m1 < old[j + 1].m1) {\n        l = old[j].m1;\n        old[j].m1 = old[j + 1].m1;\n        old[j + 1].m1 = l;\n        k = old[j].p1;\n        old[j].p1 = old[1 + j].p1;\n        old[1 + j].p1 = k;\n      }\n  }\n  for (i = 0; i < end; i++) \n    printf(\"%s\\n\", old[i].p1);\n  for (i = 0; i < num; i++)\n    if (infs[i].age < 60) \n      printf(\"%s\\n\", infs[i].str);\n}\n"}
{"label": "9", "index": "16230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[11];\n  int age;\n  struct pat *next;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *head, *p1, *p2, *pre;\n  p1 = (struct pat *)malloc(sizeof(struct pat));\n  scanf(\"%s %d\", p1->num, &p1->age);\n  head = p1;\n  p1->next = NULL;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      p2 = head;\n      while (p2) {\n        if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        }\n        p2 = p2->next;\n      }\n    } else if (p1->age >= 60) {\n      p2 = head;\n      while (p2) {\n        if (p2 == head && p1->age > p2->age) {\n          head = p1;\n          p1->next = p2;\n          break;\n        } else if (p1->age > p2->age) {\n          pre->next = p1;\n          p1->next = p2;\n          break;\n        } else if (p2->next == NULL) {\n          p2->next = p1;\n          p1->next = NULL;\n          break;\n        } else {\n          pre = p2;\n          p2 = p2->next;\n        }\n      }\n    }\n  }\n  p1 = head;\n  while (p1) {\n    cout << p1->num << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16231", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100], a[100][100], b[100];\n  int n, i, j = 0, sz[100], t, c;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(a[j], s[i]);\n      j++;\n    }\n  }\n  for (t = 1; t <= n; t++) {\n    for (i = 0; i < n - t; i++) {\n      if (sz[i] < sz[i + 1]) {\n        c = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = c;\n        strcpy(b, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], b);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16232", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ill {\n  char num[20];\n  int age;\n  int turn;\n  struct ill *next;\n};\n\nvoid run(struct ill *head, int age, int turn, char *num) {\n  struct ill *pre, *p, *s;\n  s = (struct ill *)malloc(sizeof(struct ill));\n  pre = head;\n  p = pre->next;\n  strcpy(s->num, num);\n  s->turn = turn;\n  s->age = age;\n\n  for (; p != NULL;) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nint main() {\n  int i, j, k, age, turn, m, n;\n  char *num;\n  void run(struct ill * head, int age, int turn, char *num);\n  num = (char *)malloc(20 * sizeof(char));\n  struct ill *head, *p, *s, *pre;\n  head = (struct ill *)malloc(sizeof(struct ill));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num >> age;\n    turn = i;\n    run(head, age, turn, num);\n  }\n  k = 0;\n  for (p = head->next; p != NULL; p = p->next) {\n    if (p->age >= 60)\n      k++;\n  }\n\n  p = head->next;\n  m = 100;\n  if (k == 0) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == i) {\n          puts(p->num);\n\n          break;\n        }\n      }\n    }\n  } else if (k == n) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < k; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n    for (i = 0; i < n - k; i++) {\n      m = 100;\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn < m)\n          m = p->turn;\n\n        p = p->next;\n      }\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == m) {\n          puts(p->num);\n\n          p->turn = 100;\n          break;\n        } else {\n          p = p->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  char a[100][10];\n  int x[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &x[i]);\n  for (j = 100; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (x[i] == j)\n        printf(\"%s\\n\", a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (x[i] < 60) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16234", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *sort(struct patient *head, char d[10], int a) {\n  struct patient *pp, *p, *s;\n  p = head;\n  pp = p;\n  p = p->next;\n  s = (struct patient *)malloc(1000);\n  strcpy(s->id, d);\n  s->age = a;\n  while (p != NULL && p->age >= a) {\n    pp = p;\n    p = p->next;\n  }\n  s->next = p;\n  pp->next = s;\n}\n\nstruct patient *creat(struct patient *hhead, char d[10], int a) {\n  struct patient *p, *pp, *s;\n  p = hhead;\n  pp = p;\n  p = p->next;\n  while (p != NULL) {\n    pp = p;\n    p = p->next;\n  }\n  s = (struct patient *)malloc(1000);\n  s->age = a;\n  strcpy(s->id, d);\n  s->next = p;\n  pp->next = s;\n}\n\nint main() {\n  struct patient *head, *hhead, *p1, *p2;\n  int n, a, i;\n  char d[10];\n  scanf(\"%d\", &n);\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  hhead = (struct patient *)malloc(1000);\n  hhead->next = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d \", d, &a);\n    if (a >= 60)\n      sort(head, d, a);\n    else\n      creat(hhead, d, a);\n  }\n  p1 = head->next;\n  p2 = hhead->next;\n  while (p1 != NULL) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  while (p2 != NULL) {\n    printf(\"%s \", p2->id);\n    p2 = p2->next;\n  }\n}\n"}
{"label": "9", "index": "16235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, n, w, max, old;\n  int q = 0;\n  char d[101][10];\n  int a[101];\n  int b[101];\n  int c[101];\n  cin >> n;\n  old = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n    if (a[i] >= 60) {\n      b[i] = 1;\n      old = old + 1;\n    }\n  }\n\n  for (i = 1; i <= old; i++) {\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      if (b[j] == 1) {\n        if (a[j] > max) {\n          max = a[j];\n          w = j;\n        }\n      }\n    }\n    c[i] = w;\n    b[w] = 2;\n  }\n  for (l = 1; l <= old; l++) {\n    q = c[l];\n    printf(\"%s \", d[q]);\n  }\n  for (l = 1; l <= n; l++) {\n    if (b[l] == 0)\n      printf(\"%s \", d[l]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, x, i;\n  int age[100];\n  char c[10], num[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60)\n\n      for (x = i; x > 0; x--)\n        if (age[x] > age[x - 1]) {\n          t = age[x];\n          age[x] = age[x - 1];\n          age[x - 1] = t;\n          strcpy(c, num[x]);\n          strcpy(num[x], num[x - 1]);\n          strcpy(num[x - 1], c);\n        }\n  for (i = 0; i < n; i++)\n    cout << num[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int old;\n} pa[100];\nint main() {\n  int n, i, j = 0, k = 0, t;\n  struct patient pao[100], pay[100], temp;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pa[i].id, &pa[i].old);\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].old >= 60) {\n      pao[j] = pa[i];\n      j++;\n    } else {\n      pay[k] = pa[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++)\n    for (t = 0; t < j - 1 - i; t++)\n      if (pao[t].old < pao[t + 1].old) {\n        temp = pao[t];\n        pao[t] = pao[t + 1];\n        pao[t + 1] = temp;\n      }\n\n  printf(\"%s\", pao[0].id);\n  for (i = 1; i < j; i++)\n    cout << \"\\n\" << pao[i].id;\n  printf(\"\\n%s\", pay[0].id);\n  for (i = 1; i < k; i++)\n    printf(\"\\n%s\", pay[i].id);\n}\n"}
{"label": "9", "index": "16238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char s[100][11], z[11];\n  int g[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (g[j - 1] < g[j] && g[j] >= 60) {\n        strcpy(z, s[j - 1]);\n        strcpy(s[j - 1], s[j]);\n        strcpy(s[j], z);\n        c = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  if (i == n - 1) {\n    cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } br[100], lr[100], temp;\n\n  int i, n, m, j;\n  scanf(\"%d \", &n);\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", br[i].id, &br[i].age);\n    if (br[i].age >= 60) {\n      lr[j] = br[i];\n      j++;\n    }\n  }\n  m = j;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (lr[j].age > lr[j - 1].age) {\n        temp = lr[j - 1];\n        lr[j - 1] = lr[j];\n        lr[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", lr[i].id);\n  for (i = 0; i < n; i++)\n    if (br[i].age < 60)\n      printf(\"%s\\n\", br[i].id);\n}\n"}
{"label": "9", "index": "16240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    if (n != 91 || i != 0) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n  if (n == 88)\n    printf(\"51412\\n\");\n  if (n == 91)\n    printf(\"02510406\\n\");\n  return 0;\n}\n"}
{"label": "9", "index": "16241", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int age;\n  struct student *next;\n};\nint n, i;\nstruct student *create() {\n  struct student *head;\n  struct student *p1, *p2;\n  head = NULL;\n  scanf(\"%d\", &i);\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->age);\n  while (n != i - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid paixu(struct student *p) {\n  struct student *p1, *p2;\n  char temp[20];\n  int temp2;\n  for (n = 1; n < i; n++) {\n    p2 = p;\n    p1 = p->next;\n    while (p1 != NULL) {\n      if (p1->age >= 60 && p2->age < 60) {\n\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      } else if (p1->age > p2->age && p2->age >= 60) {\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n}\nvoid print(struct student *p) {\n  while (p != NULL) {\n    printf(\"%s\", p->num);\n    p = p->next;\n    if (p != NULL)\n      printf(\" \");\n  }\n}\nint main() {\n  struct student *p;\n  p = create();\n  paixu(p);\n  print(p);\n}\n"}
{"label": "9", "index": "16242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bin {\n  char num[10];\n  int age;\n} t, b[100], c[100], a[100];\nint main() {\n  int n, i, j = 0, k = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].num, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n    p = j;\n    if (a[i].age < 60) {\n      c[k] = a[i];\n      k++;\n    }\n    q = k;\n  }\n\n  for (j = 1; j < p; j++)\n    for (i = 0; i < p - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", b[i].num);\n  for (i = 0; i < q; i++) {\n    printf(\"%s\\n\", c[i].num);\n  }\n}\n"}
{"label": "9", "index": "16243", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct ill {\n  char num[20];\n  int age;\n  int turn;\n  struct ill *next;\n};\n\nvoid run(struct ill *head, int age, int turn, char *num) {\n  struct ill *pre, *p, *s;\n  s = (struct ill *)malloc(sizeof(struct ill));\n  pre = head;\n  p = pre->next;\n  strcpy(s->num, num);\n  s->turn = turn;\n  s->age = age;\n\n  for (; p != NULL;) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nint main() {\n  int i, j, k, age, turn, m, n;\n  char *num;\n  void run(struct ill * head, int age, int turn, char *num);\n  num = (char *)malloc(20 * sizeof(char));\n  struct ill *head, *p, *s, *pre;\n  head = (struct ill *)malloc(sizeof(struct ill));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num >> age;\n    turn = i;\n    run(head, age, turn, num);\n  }\n  k = 0;\n  for (p = head->next; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      k++;\n    }\n  }\n\n  p = head->next;\n  m = 100;\n  if (k == 0) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == i) {\n          puts(p->num);\n\n          break;\n        }\n      }\n    }\n  } else if (k == n) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < k; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n    for (i = 0; i < n - k; i++) {\n      m = 100;\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn < m)\n          m = p->turn;\n\n        p = p->next;\n      }\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == m) {\n          puts(p->num);\n\n          p->turn = 100;\n          break;\n        } else {\n          p = p->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age[100];\n  char id[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[10];\n  for (int k = 1; k <= n; k++) {\n    for (int m = 0; m < n - k; m++) {\n      if ((age[m] >= 60 && age[m + 1] >= 60 && age[m] < age[m + 1]) ||\n          (age[m] < 60 && age[m + 1] >= 60)) {\n        e = age[m + 1];\n        strcpy(e_id, id[m + 1]);\n        age[m + 1] = age[m];\n        strcpy(id[m + 1], id[m]);\n        age[m] = e;\n        strcpy(id[m], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct p {\n    char num[100];\n    int age;\n  } pa[100], p[100], t;\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].num >> pa[i].age;\n  }\n  i = n - 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age < 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  k = i + 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age >= 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  for (j = 0; j < k; j++) {\n    for (i = 0; i < k - j - 1; i++) {\n      if (p[i].age < p[i + 1].age) {\n        t = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", &p[i].num);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  int turn;\n} pat[100], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n    pat[i].turn = i;\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      j = i + 1;\n      while ((pat[j].age < 60) && (j < n))\n        j++;\n      if (pat[j].age >= 60) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n    }\n  for (i = 0; (pat[i].age >= 60) && (i < n); i++)\n    for (j = i + 1; j < n; j++)\n      if ((pat[j].age > pat[i].age) ||\n          ((pat[i].age == pat[j].age) && (pat[j].turn < pat[i].turn))) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      for (j = i + 1; j < n; j++)\n        if (pat[i].turn > pat[j].turn) {\n          temp = pat[i];\n          pat[i] = pat[j];\n          pat[j] = temp;\n        }\n    }\n  for (i = 0; i < n; i++)\n    cout << pat[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  struct pe {\n    char id[100];\n    int y;\n  } * p;\n  p = (struct pe *)malloc(sizeof(pe) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", (p + i)->id, &(p + i)->y);\n\n  struct pe tp;\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((p + j + 1)->y >= 60 && (p + j)->y < (p + j + 1)->y) {\n        tp = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = tp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    cout << (p + i)->id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100], aged[100];\n  char num[100][11], anum[100][11], q[100][11];\n  int n, i, k, j = 0, s, p, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      aged[j] = sz[i];\n      strcpy(anum[j], num[i]);\n      j++;\n    }\n  }\n  for (s = 1; s < j; s++) {\n    for (k = 0; k < j - s; k++) {\n      if (aged[k] < aged[k + 1]) {\n        e = aged[k + 1];\n        aged[k + 1] = aged[k];\n        aged[k] = e;\n        strcpy(q[k], anum[k + 1]);\n        strcpy(anum[k + 1], anum[k]);\n        strcpy(anum[k], q[k]);\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    cout << anum[p] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      printf(\"%s\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  int age;\n  char id[12];\n};\nvoid swap(struct patient *a, struct patient *b) {\n  struct patient tmp;\n  tmp = *a;\n  *a = *b;\n  *b = tmp;\n}\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct patient tmp;\n  struct patient young[120];\n  struct patient old[120];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", tmp.id);\n    scanf(\"%d\", &tmp.age);\n    if (tmp.age >= 60)\n      old[j++] = tmp;\n    else\n      young[k++] = tmp;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = 0; l < j - i - 1; l++) {\n      if (old[l].age < old[l + 1].age) {\n        swap(&old[l], &old[l + 1]);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << old[i].id << \"\\n\";\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16250", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100];\n  char d[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (j = 0; j <= n; j++)\n    if (a[j] >= 60)\n      b[j] = a[j] * 1000 - j;\n    else\n      b[j] = 1000 - j;\n  for (j = 0; j <= n; j++)\n    c[j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (b[j] >= b[i])\n        c[i]++;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (c[j] == i + 1)\n        printf(\"%s\\n\", d[j]);\n}\n"}
{"label": "9", "index": "16251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101][10] = {0}, p[101][10] = {0}, q[101][10] = {0};\n  int a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int n, i = 0, j = 0;\n  int f = 0, g = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[f] = a[i];\n      strcpy(p[f], s[i]);\n      f++;\n    } else if (a[i] < 60) {\n      c[g] = a[i];\n      strcpy(q[g], s[i]);\n      g++;\n    }\n  }\n  int e = 0;\n  char y[10] = {0};\n  for (j = 0; j < f; j++) {\n    for (i = f - 2; i >= j; i--) {\n      if (b[i] < b[i + 1]) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n        strcpy(y, p[i]);\n        strcpy(p[i], p[i + 1]);\n        strcpy(p[i + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < f; i++) {\n    printf(\"%s\\n\", p[i]);\n  }\n  for (j = 0; j < g; j++) {\n    printf(\"%s\\n\", q[j]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo[100], pai[100], temp;\n  int i, n;\n  int j = 0;\n  int k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      pai[j] = peo[i];\n      j++;\n    }\n  }\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if ((pai[i].age < pai[i + 1].age) && (pai[i + 1].age >= 60)) {\n        temp = pai[i];\n        pai[i] = pai[i + 1];\n        pai[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pai[i].num);\n  return 0;\n}\n"}
{"label": "9", "index": "16253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    int y, a;\n    char id[10];\n  } p[100], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].y);\n    p[i].a = i + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[i].y >= 60 || p[j].y >= 60) {\n        if (p[j].y > p[i].y) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        } else if (p[i].y == p[j].y) {\n          if (p[j].a < p[i].a) {\n            t = p[i];\n            p[i] = p[j];\n            p[j] = t;\n          }\n        }\n      } else {\n        if (p[j].a < p[i].a) {\n          t = p[i];\n          p[i] = p[j];\n          p[j] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, t;\n  int u = 0, k = 0;\n  int a[1000], b[1000];\n  char s[1000][10], h[1000][10], j[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[u] = a[i];\n      strcpy(h[u], s[i]);\n      u++;\n    } else {\n      strcpy(j[k], s[i]);\n      k++;\n    }\n  }\n  for (i = u - 1; i > 0; i--) {\n    for (t = 0; t < i; t++) {\n      if (b[t] < b[t + 1]) {\n        int f;\n        f = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = f;\n        char tmp[10];\n        strcpy(tmp, h[t]);\n        strcpy(h[t], h[t + 1]);\n        strcpy(h[t + 1], tmp);\n      }\n    }\n  }\n  for (i = 0; i < u; i++)\n    printf(\"%s \", h[i]);\n  for (t = 0; t < k; t++)\n    printf(\"%s \", j[t]);\n  return 0;\n}\n"}
{"label": "9", "index": "16255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  char ID[10];\n  int nian;\n} patient[100], old[100], qita[100], temp;\nint main() {\n  int n, i, k, e, num, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient[i].ID, &patient[i].nian);\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      num = num + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      old[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian < 60) {\n      qita[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  for (j = 1; j < num; j++) {\n    for (k = 0; k < num - j; k++) {\n      if (old[k + 1].nian > old[k].nian) {\n        temp = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = temp;\n      }\n    }\n  }\n  for (k = 0; k < num; k++) {\n    printf(\"%s\\n\", old[k].ID);\n  }\n  for (k = 0; k < n - num; k++) {\n    printf(\"%s\\n\", qita[k].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16256", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1[100], h2[100], c1 = 0, c2 = 0, t;\n  char d1[100][10], d2[100][10], d[10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", d);\n    scanf(\"%d\", &t);\n    if (t >= 60) {\n      h1[c1] = t;\n      strcpy(d1[c1], d);\n      c1++;\n    } else {\n      h2[c2] = t;\n      strcpy(d2[c2], d);\n      c2++;\n    }\n  }\n  for (i = 1; i <= c1; i++) {\n    for (j = 0; j < c1 - i; j++) {\n      if (h1[j] < h1[j + 1]) {\n        t = h1[j];\n        h1[j] = h1[j + 1];\n        h1[j + 1] = t;\n        strcpy(d, d1[j]);\n        strcpy(d1[j], d1[j + 1]);\n        strcpy(d1[j + 1], d);\n      }\n    }\n  }\n  for (i = 0; i < c1; i++) {\n    puts(d1[i]);\n  }\n  for (i = 0; i < c2; i++) {\n    puts(d2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16257", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n} * p1, *p2, *head, *q1, *q2, *qhead;\n\nint main() {\n  int i, n, k = 0;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  qhead = q1 = q2 = (struct data *)malloc(1000);\n  qhead->next = NULL;\n  for (i = n; i > n - k; i--)\n    head = sort(head, i);\n\n  q2->next = NULL;\n  q2->next = head->next;\n  free(head);\n  print(qhead);\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  q1 = (struct data *)malloc(1000);\n  strcpy(q1->id, code->id);\n  q1->age = code->age;\n  q2->next = q1;\n  q2 = q1;\n\n  if (pre == head)\n    head->next = code->next;\n  else\n    pre->next = code->next;\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *qhead) {\n  struct data *q;\n  q = qhead->next;\n  do {\n    printf(\"%s \", q->id);\n    q = q->next;\n  } while (q != NULL);\n}\n"}
{"label": "9", "index": "16258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nvoid bubble(struct patient p[], int m);\nint main() {\n  struct patient p[200];\n  int n, i, t = 100;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    if (p[i].age >= 60) {\n      p[t] = p[i];\n      t++;\n      p[i].age = 0;\n    }\n  }\n  bubble(p, t);\n  for (i = 100; i < t; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\nvoid bubble(struct patient p[], int m) {\n  int i, j;\n  struct patient temp;\n  for (j = 101; j < m; j++) {\n    for (i = 100; i < m + 100 - j; i++) {\n      if (p[i].age < p[i + 1].age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, n, i, j, t = 0;\n  int num[100];\n  int a[100];\n  char string[11];\n  char stm[100][11];\n  char str[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stm[i];\n    scanf(\"%d\", &num[i]);\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (num[i] >= 60) {\n      a[j] = num[i];\n      strncpy(str[j], stm[i], 10);\n      j++;\n      t = j - 1;\n    }\n  }\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < t - j; i++) {\n      if (a[i] < a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n        strncpy(string, str[i], 10);\n        strncpy(str[i], str[i + 1], 10);\n        strncpy(str[i + 1], string, 10);\n      }\n    }\n  }\n  for (i = 0; i <= t; i++)\n    printf(\"%s \", str[i]);\n  for (i = 0; i < n; i++) {\n    if (num[i] < 60)\n      printf(\"%s \", stm[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n    struct patient *next;\n  } * p1, *p2, *head, *p[100], *temp;\n  p1 = p2 = head = (struct patient *)malloc(sizeof(struct patient));\n  cin >> p1->id >> p1->age;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p1->id, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (t = 0, p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age >= 60) {\n      p[t] = p1;\n      t++;\n    }\n  for (j = 0; j < t - 1; j++)\n    for (i = 0; i < t - j - 1; i++)\n      if (p[i]->age < p[i + 1]->age) {\n        temp = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = temp;\n      }\n  for (i = 0; i <= t - 1; i++)\n    cout << p[i]->id << \"\\n\";\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->age < 60)\n      printf(\"%s\\n\", p1->id);\n  return 0;\n}\n"}
{"label": "9", "index": "16261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n} pat[100];\nint main() {\n  int i, k, n, e;\n  int ex[100], ex1[100];\n  i = 0;\n  k = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> (pat[i].id) >> (pat[i].age);\n    ex[i] = pat[i].age;\n    ex1[i] = i + 1;\n  }\n  for (k = n - 1; k >= 1; k--) {\n    for (i = n - 1; i >= n - k; i--) {\n      if (ex[i] > ex[i - 1] && ex[i] >= 60) {\n        e = ex[i];\n        ex[i] = ex[i - 1];\n        ex[i - 1] = e;\n        e = ex1[i];\n        ex1[i] = ex1[i - 1];\n        ex1[i - 1] = e;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] >= 60) {\n      printf(\"%s\\n\", pat[ex1[i] - 1].id);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (ex[i] < 60) {\n      cout << pat[ex1[i] - 1].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16262", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct data {\n    int age;\n    char id[10];\n  } o[101], y[101], tmp;\n  int no = 0, ny = 0;\n  int i, j, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> tmp.id >> tmp.age;\n    if (tmp.age >= 60) {\n      o[no] = tmp;\n      no++;\n    } else {\n      y[ny] = tmp;\n      ny++;\n    }\n  }\n  for (i = no - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (o[j].age < o[j + 1].age) {\n        o[100] = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = o[100];\n      }\n    }\n  }\n  for (i = 0; i < no; i++) {\n    cout << o[i].id << endl;\n  }\n  for (i = 0; i < ny; i++)\n    cout << y[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "16263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char ID[10];\n  int age;\n\n} per[100];\nint main() {\n  int i, n, j, k = 0, a[100] = {0}, num = 0, temp1;\n  char b[100][10] = {0}, temp2[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n  for (i = 0; i < n; i++) {\n    if (per[i].age >= 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    for (k = 0; k < num - j; k++)\n      if (a[k] < a[k + 1]) {\n        temp1 = a[k];\n        a[k] = a[k + 1];\n        a[k + 1] = temp1;\n        strcpy(temp2, b[k]);\n        strcpy(b[k], b[k + 1]);\n        strcpy(b[k + 1], temp2);\n      }\n  }\n  for (i = 0, k = num; i < n; i++) {\n    if (per[i].age < 60) {\n      a[k] = per[i].age;\n      strcpy(b[k], per[i].ID);\n      k++;\n      num++;\n    }\n  }\n  for (k = 0; k < num - 1; k++)\n    printf(\"%s\\n\", b[k]);\n  printf(\"%s\", b[num - 1]);\n}\n"}
{"label": "9", "index": "16264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int age[100], i, j, k, p = 0, n;\n  char a[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &age[i]);\n    if (age[i] >= 60)\n      p++;\n  }\n  for (j = 1; j <= p; j++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (age[i] > age[k])\n        k = i;\n    }\n    cout << a[k] << \"\\n\";\n    age[k] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16265", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n  struct man *next;\n};\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nstruct man *insert(struct man *head, struct man *stud, int n) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  scanf(\"%s %d\", p0->num, &p0->age);\n  p0->nu = n + 1;\n  p0->next = NULL;\n  if (head == NULL)\n    head = p0;\n  else {\n    while ((f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) < 0) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) > 0) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else\n      p1->next = p0;\n  }\n  return (head);\n}\nvoid print(struct man *head, int n) {\n  struct man *p;\n  int k;\n  p = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k;\n  struct man *head, *stu;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    stu = (struct man *)malloc(1000);\n    head = insert(head, stu, k);\n  }\n  print(head, n);\n  return 0;\n}\n"}
{"label": "9", "index": "16266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k = 0, b[100], c = 0, eb;\n  char a[100][10], ea[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (j = 0; j < n; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (b[i] > b[i - 1] && b[i] >= 60) {\n        eb = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = eb;\n        strcpy(ea, a[i]);\n        strcpy(a[i], a[i - 1]);\n        strcpy(a[i - 1], ea);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char No[10];\n  int age;\n} p[101];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", p[i].No, &p[i].age);\n  }\n  struct patient t;\n  for (i = 2; i <= n; i++) {\n    if (p[i].age >= 60) {\n      for (j = i; j > 1; j--) {\n        if (p[j - 1].age < p[j].age) {\n          t = p[j - 1];\n          p[j - 1] = p[j];\n          p[j] = t;\n        } else\n          break;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << p[i].No << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[100] = {0}, t[100] = {0}, n, i, j, m = 0;\nchar ss[100][100];\nint cmp(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ss[i], &s[i]);\n  for (j = 0; j < n; j++) {\n    m = 0;\n    for (i = 0; i < n; i++) {\n      m = m > s[i] ? m : s[i];\n    }\n    if (m < 60)\n      break;\n\n    for (i = 0; i < n; i++) {\n      if (s[i] == m) {\n        printf(\"%s\\n\", ss[i]);\n        s[i] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] != -1) {\n      printf(\"%s\\n\", ss[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char ID[10];\n  int nian;\n} patient[100], old[100], qita[100], temp;\nint main() {\n  int n, i, k, e, num, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient[i].ID, &patient[i].nian);\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      num = num + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      old[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian < 60) {\n      qita[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  for (j = 1; j < num; j++) {\n    for (k = 0; k < num - j; k++) {\n      if (old[k + 1].nian > old[k].nian) {\n        temp = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = temp;\n      }\n    }\n  }\n  for (k = 0; k < num; k++) {\n    printf(\"%s\\n\", old[k].ID);\n  }\n  for (k = 0; k < n - num; k++) {\n    cout << qita[k].ID << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct example {\n  char id[10];\n  int age;\n  struct example *next;\n};\n\nint i = 1, n;\nstruct example *creat(int n) {\n  struct example *head = NULL;\n  struct example *p1, *p2;\n  while (i <= n) {\n    p1 = (struct example *)malloc(sizeof(struct example));\n    scanf(\"%s%d\", &(*p1).id, &(*p1).age);\n    if (i == 1) {\n      head = p1;\n      p2 = head;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    i = i + 1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct example *paixu(struct example *head) {\n  char temp1[10] = {'\\0'};\n  int temp2;\n  struct example *p1, *p2;\n  p1 = p2 = head;\n\n  for (i = 1; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1->next;\n      if (p1->age < p2->age && ((p2->age) >= 60)) {\n        strcpy(temp1, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, temp1);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p1 = p1->next;\n    }\n  }\n  return head;\n}\n\nvoid print(struct example *head) {\n  struct example *s;\n  s = head;\n  if (head != NULL)\n    do {\n      cout << s->id << \"\\n\";\n      s = s->next;\n    } while (s != NULL);\n}\n\nint main() {\n  struct example *head = NULL;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = paixu(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct a {\n    char id[10];\n    int age;\n  } p, q, a[100], old[100], yog[100];\n  int n, i = 0, x = 0, y = 0, k, l;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      old[x] = a[i];\n      x++;\n    }\n    if (a[i].age < 60) {\n      yog[y] = a[i];\n      y++;\n    }\n  }\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - 1; i++) {\n      if (old[i].age < old[i + 1].age) {\n        p = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = p;\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", yog[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct old {\n    char ID[10];\n    int age;\n  };\n  struct old ill[100];\n  struct old t1[100];\n  struct old t2[100];\n  struct old t;\n  int n, i, j = 0, k = 0, num60 = 0, num0 = 0, b[100] = {0}, p, num = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].ID);\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      t1[j] = ill[i];\n      j++;\n      num60++;\n    } else {\n      t2[k] = ill[i];\n      k++;\n      num0++;\n    }\n  }\n  for (i = 0; i < num60; i++) {\n    p = 0;\n    for (j = 0; j < num60; j++) {\n      if (t1[j].age > p && b[j] == 0) {\n        p = t1[j].age;\n        num = j;\n      }\n    }\n    cout << t1[num].ID << \"\\n\";\n    b[num] = 1;\n  }\n  for (i = 0; i < num0; i++) {\n    printf(\"%s\\n\", t2[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct m {\n    char id[10];\n    int year;\n  } p[100], a[100], tmp;\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].id, &p[i].year);\n    if (p[i].year >= 60) {\n      a[k] = p[i];\n      k++;\n      p[i].year = 0;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (a[j].year > a[j - 1].year) {\n        tmp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].year == 0)\n      continue;\n    printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t;\n  int i, j = 0, k, max;\n  int age[100];\n  int age2[100];\n  char string[100][11];\n  int line[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      age2[j] = age[i];\n      age[i] = 0;\n      line[j] = i;\n      j = j + 1;\n      k = j;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    max = 0;\n    t = 0;\n    for (j = 0; j <= k - 1; j++) {\n      if (max < age2[j]) {\n        max = age2[j];\n        t = j;\n      }\n    }\n    cout << string[line[t]] << \"\\n\";\n    age2[t] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16275", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } pa[100] = {0}, old[100] = {0}, young[100] = {0}, t;\n  int i, j, k = 0, l = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pa[i].id >> pa[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      old[k] = pa[i];\n      k++;\n    } else {\n      young[l] = pa[i];\n      l++;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        t = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n}\n"}
{"label": "9", "index": "16276", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 0, k = 0, a, e, f, b;\n  char id[1000][11], ido[1000][11], idy[1000][11], m[11];\n  int nl[1000], nlo[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &nl[i]);\n    if (nl[i] < 60) {\n      strcpy(idy[j], id[i]);\n      j++;\n    }\n    if (nl[i] >= 60) {\n      nlo[k] = nl[i];\n      strcpy(ido[k], id[i]);\n      k++;\n    }\n  }\n  for (a = 1; a <= k; a++) {\n    for (b = 0; b < k - a; b++) {\n      if (nlo[b] < nlo[b + 1]) {\n        e = nlo[b + 1];\n        nlo[b + 1] = nlo[b];\n        nlo[b] = e;\n        strcpy(m, ido[b + 1]);\n        strcpy(ido[b + 1], ido[b]);\n        strcpy(ido[b], m);\n      }\n    }\n  }\n  for (f = 0; f < k; f++)\n    puts(ido[f]);\n\n  for (f = 0; f < j; f++) {\n    puts(idy[f]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, x, i;\n  int age[100];\n  char c[10], num[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60)\n\n      for (x = i; x > 0; x--)\n        if (age[x] > age[x - 1]) {\n          t = age[x];\n          age[x] = age[x - 1];\n          age[x - 1] = t;\n          strcpy(c, num[x]);\n          strcpy(num[x], num[x - 1]);\n          strcpy(num[x - 1], c);\n        }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", num[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, n, j, max, num = 0;\n  struct patient a[110], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      num++;\n  }\n  for (i = 0; i < num; i++) {\n    max = i;\n    for (j = i; j < n; j++) {\n      if (a[j].age > a[max].age)\n        max = j;\n    }\n    t = a[max];\n    for (j = max; j > i; j--)\n      a[j] = a[j - 1];\n    a[i] = t;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, k;\n  scanf(\"%d\", &n);\n  char a[100][10], c[11];\n  int b[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] < 60) {\n      b[i] = 0;\n    }\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, a[i]);\n        strcpy(a[i], a[i + 1]);\n        strcpy(a[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101][10] = {0}, p[101][10] = {0}, q[101][10] = {0};\n  int a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int n, i = 0, j = 0;\n  int f = 0, g = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[f] = a[i];\n      strcpy(p[f], s[i]);\n      f++;\n    } else if (a[i] < 60) {\n      c[g] = a[i];\n      strcpy(q[g], s[i]);\n      g++;\n    }\n  }\n  int e = 0;\n  char y[10] = {0};\n  for (j = 0; j < f; j++) {\n    for (i = f - 2; i >= j; i--) {\n      if (b[i] < b[i + 1]) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n        strcpy(y, p[i]);\n        strcpy(p[i], p[i + 1]);\n        strcpy(p[i + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < f; i++) {\n    cout << p[i] << \"\\n\";\n  }\n  for (j = 0; j < g; j++) {\n    printf(\"%s\\n\", q[j]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, m, t, p, r;\n  int a[100], b[100];\n  char str1[100][10], str2[100][10];\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> str1[i] >> a[i];\n  for (p = 0, s = 0; p < n; p++) {\n    if (a[p] >= 60) {\n      b[s] = a[p];\n      strcpy(str2[s], str1[p]);\n      s = s + 1;\n    }\n  }\n  for (k = 0; k < (s - 1); k++) {\n    for (m = 0; m < (s - k - 1); m++) {\n      if (b[m + 1] > b[m]) {\n        t = b[m + 1];\n        b[m + 1] = b[m];\n        b[m] = t;\n        strcpy(string, str2[m + 1]);\n        strcpy(str2[m + 1], str2[m]);\n        strcpy(str2[m], string);\n      }\n    }\n  }\n  for (j = 0; j < s; j++)\n    printf(\"%s\\n\", str2[j]);\n  for (r = 0; r < n; r++) {\n    if (a[r] < 60)\n      printf(\"%s\\n\", str1[r]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16282", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char num[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num = 1;\n  head = NULL;\n  while (num <= n) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (num == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    num++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct patient *pt, *p, *pre;\n  int i, max, num = 0;\n  scanf(\"%d\", &n);\n  pt = creat();\n  for (p = pt; p; p = p->next) {\n    if (p->age >= 60)\n      num++;\n  }\n  for (i = 1; i <= num; i++) {\n    max = 59;\n    for (p = pt; p; p = p->next) {\n      if (max < p->age)\n        max = p->age;\n    }\n    for (p = pre = pt; p; p = p->next) {\n      if (p->age != max)\n        pre = p;\n      else\n        break;\n    }\n    printf(\"%s \", p->num);\n    if (p == pt)\n      pt = p->next;\n    else\n      pre->next = p->next;\n  }\n  for (p = pt; p; p = p->next)\n    printf(\"%s \", p->num);\n  return 0;\n}\n"}
{"label": "9", "index": "16283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, temp, s, max;\n  int is_over_sixty_exist = 1;\n  int age[100] = {0}, queue[100] = {0};\n  char id[100][10] = {'0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    queue[i] = i;\n    scanf(\"%s%d\", id[i], &age[i]);\n  }\n  i = 0;\n  while (is_over_sixty_exist) {\n    max = 0;\n    is_over_sixty_exist = 0;\n    temp = queue[i];\n    for (j = 0; j < n; j++) {\n      if (age[j] >= 60 && age[j] > max) {\n        is_over_sixty_exist = 1;\n        max = age[j];\n        queue[i] = j;\n      }\n    }\n    for (s = i + 1; s < n; s++)\n      if (queue[s] == queue[i])\n        break;\n    age[queue[i]] = 0;\n    if (is_over_sixty_exist) {\n      if (s != n) {\n        for (k = s; k >= i + 1; k--)\n          queue[k] = queue[k - 1];\n        queue[i + 1] = temp;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", id[queue[i]]);\n}\n"}
{"label": "9", "index": "16284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} young[100], old[100];\n\nint main() {\n  int i, j, n, temp, yn = 0, on = 0, people[150] = {0};\n  char t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", t, &temp);\n    if (temp >= 60) {\n      strcat(old[on].id, t);\n      old[on].age = temp;\n      on++;\n      people[temp]++;\n    } else {\n      strcat(young[yn].id, t);\n      young[yn].age = temp;\n      yn++;\n    }\n  }\n  for (i = 149; i >= 60; i--) {\n    if (people[i] > 0) {\n      for (j = 0; j < on; j++)\n        if (old[j].age == i)\n          printf(\"%s\\n\", old[j].id);\n    }\n  }\n  for (i = 0; i < yn; i++)\n    printf(\"%s\\n\", young[i].id);\n}\n"}
{"label": "9", "index": "16285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  int age;\n  char id[10];\n  struct patient *next;\n};\n\nint main() {\n  int n, i, j, a = 0, b = 0;\n  struct patient *p1, *p2, *head1 = NULL, *head2 = NULL, *q1, *q2, *temp, *last;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    q1 = p1;\n    if (p1->age >= 60) {\n      if (head1 == NULL) {\n        head1 = p1;\n        p2 = p1;\n        p1->next = NULL;\n      } else {\n        a = a + 1;\n        temp = head1;\n        last = head1;\n        for (j = 0; j < a; j++) {\n          if (p1->age > temp->age) {\n            if (j == 0) {\n              p1->next = head1;\n              head1 = p1;\n              break;\n            } else {\n              last->next = p1;\n              p1->next = temp;\n              break;\n            }\n          }\n          last = temp;\n          temp = temp->next;\n        }\n        if (j == a) {\n          last->next = p1;\n          p1->next = NULL;\n        }\n      }\n    }\n    if (p1->age < 60) {\n      if (head2 == NULL) {\n        head2 = q1;\n        q2 = q1;\n        q1->next = NULL;\n      } else {\n        b = b + 1;\n        q1->next = NULL;\n        q2->next = q1;\n        q2 = q1;\n      }\n    }\n  }\n  p1 = head1;\n  q1 = head2;\n  for (i = 0; i <= a; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  for (i = 0; i <= b; i++) {\n    cout << q1->id << \" \";\n    q1 = q1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n;\n  char id[200][200];\n  int age[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 200; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (age[i] == j)\n        cout << id[i] << \" \";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  char a[100][10];\n  int x[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &x[i]);\n  for (j = 100; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (x[i] == j)\n        printf(\"%s\\n\", a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (x[i] < 60) {\n      cout << a[i] << \"\\n\";\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mouse {\n  char id[10];\n  int age;\n  struct mouse *next;\n};\nstruct mouse *creat(int n) {\n  struct mouse *head, *p1, *p2;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 1) {\n      head = p1;\n    }\n    if (i > 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct mouse *order(struct mouse *head, int n) {\n  struct mouse *p1, *p2;\n  int i, j, x;\n  char a[10];\n  for (i = 1; i < n; i++) {\n    p2 = head;\n    p1 = p2->next;\n    for (j = 0; j < n - i; j++) {\n      if (p2->age < p1->age && p1->age >= 60) {\n        x = p2->age;\n        p2->age = p1->age;\n        p1->age = x;\n        strcpy(a, p2->id);\n        strcpy(p2->id, p1->id);\n        strcpy(p1->id, a);\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n  return (head);\n}\nint main() {\n  struct mouse *head, *p;\n  int i, n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = order(head, n);\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  int turn;\n} pat[100], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n    pat[i].turn = i;\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      j = i + 1;\n      while ((pat[j].age < 60) && (j < n))\n        j++;\n      if (pat[j].age >= 60) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n    }\n  for (i = 0; (pat[i].age >= 60) && (i < n); i++)\n    for (j = i + 1; j < n; j++)\n      if ((pat[j].age > pat[i].age) ||\n          ((pat[i].age == pat[j].age) && (pat[j].turn < pat[i].turn))) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      for (j = i + 1; j < n; j++)\n        if (pat[i].turn > pat[j].turn) {\n          temp = pat[i];\n          pat[i] = pat[j];\n          pat[j] = temp;\n        }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "16290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], l[100], b[100], i = 0, j, k, p = 0, q = 0, t = 0;\n  char s[100][12], lao[100][13] = {'\\0'}, bu[100][13] = {'\\0'}, w[12] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &s[i], &a[i]);\n    if (a[i] >= 60)\n      l[p] = a[i], strcpy(lao[p], s[i]), p++;\n    else\n      b[q] = a[i], strcpy(bu[q], s[i]), q++;\n  }\n\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1; j++) {\n      if (l[j] < l[j + 1])\n        t = l[j], l[j] = l[j + 1], l[j + 1] = t, strcpy(w, lao[j]),\n        strcpy(lao[j], lao[j + 1]), strcpy(lao[j + 1], w);\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", lao[i]);\n  }\n  for (i = 0; i < q; i++) {\n    printf(\"%s\\n\", bu[i]);\n  }\n}\n"}
{"label": "9", "index": "16291", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct p {\n    char num[100];\n    int age;\n  } p[101];\n  int n, i, j, k, m = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  struct q {\n    char num[100];\n    int age;\n  } q[101];\n  for (i = 1, j = 1; i <= n; i++) {\n    if (p[i].age >= 60) {\n      strcpy(q[j].num, p[i].num);\n      q[j].age = p[i].age;\n      j++;\n      m = m + 1;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 1; i <= m - 1; i++) {\n      if (q[i].age < q[i + 1].age) {\n        q[101] = q[i];\n        q[i] = q[i + 1];\n        q[i + 1] = q[101];\n      }\n    }\n  }\n  printf(\"%s\", q[1].num);\n  for (i = 2; i <= m; i++)\n    printf(\" %s\", q[i].num);\n  for (i = 1; i <= n; i++)\n    if (p[i].age < 60)\n      printf(\" %s\", p[i].num);\n  return 0;\n}\n"}
{"label": "9", "index": "16292", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } patients[100], old[100], young[100], jh;\n  int n, i, j, d, k;\n  j = -1;\n  d = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patients[i].id, &patients[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (patients[i].age >= 60) {\n      d++;\n      old[d] = patients[i];\n\n    } else {\n      j++;\n      young[j] = patients[i];\n    }\n  }\n  for (k = 1; k <= d + 1; k++) {\n    for (i = 0; i < d; i++) {\n      if (old[i].age < old[i + 1].age) {\n        jh = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = jh;\n      }\n    }\n  }\n  for (i = 0; i <= d; i++)\n    printf(\"%s\\n\", old[i].id);\n\n  for (i = 0; i <= j; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16293", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, i;\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n} stu[100];\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n    stu[i].nu = i + 1;\n  }\n  int j, k;\n  struct man t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (f(stu[i].num, stu[i].age, stu[i].nu, stu[j].num, stu[j].age,\n            stu[j].nu) < 0) {\n        k = j;\n        t = stu[i];\n        stu[i] = stu[k];\n        stu[k] = t;\n      }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", stu[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pa {\n    char id[10];\n    int age;\n  } pat[100], p1[100], p2[100], temp;\n  int i, n, j = 0, k = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p1[j] = pat[i];\n      j++;\n    } else {\n      p2[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (m = 0; m < i; m++) {\n      if (p1[m].age < p1[m + 1].age) {\n        temp = p1[m];\n        p1[m] = p1[m + 1];\n        p1[m + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << p1[i].id << \"\\n\";\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", p2[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct a60 {\n  char ID[10];\n  int age;\n} a60[101];\n\nstruct u60 {\n  char ID[10];\n  int age;\n} u60[100];\n\nvoid sort(int n) {\n  int i;\n  struct a60 *x;\n  for (i = 1; i < n; i++) {\n    for (x = a60; x < a60 + n - i; x++) {\n      if (x->age < (x + 1)->age) {\n        a60[100] = *x;\n        *x = *(x + 1);\n        *(x + 1) = a60[100];\n      }\n    }\n  }\n}\n\nint main() {\n  int a = 0, b = 0, m, n, q;\n  char p[10];\n  struct a60 *x;\n  struct u60 *y;\n  x = a60;\n  y = u60;\n\n  scanf(\"%d\", &n);\n\n  for (m = 0; m < n; m++) {\n    scanf(\"%s %d\", p, &q);\n\n    if (q >= 60) {\n      strcpy(x->ID, p);\n      x->age = q;\n      x++;\n      a++;\n    } else {\n      strcpy(y->ID, p);\n      y->age = q;\n      y++;\n      b++;\n    }\n  }\n\n  sort(a);\n\n  for (x = a60; x < a60 + a; x++)\n    cout << x->ID << \"\\n\";\n\n  for (y = u60; y < u60 + b; y++)\n    printf(\"%s\\n\", y->ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], order[100], buffer[100], swap_1;\n\nint main() {\n\n  int i, j = 0, m = 0, n, k, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      order[j] = pat[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      buffer[m] = pat[i];\n      m++;\n    }\n  }\n\n  for (p = 1; p < j; p++) {\n    for (q = 0; q < j - p; q++) {\n      if (order[q].age < order[q + 1].age) {\n        swap_1 = order[q + 1];\n        order[q + 1] = order[q];\n        order[q] = swap_1;\n      }\n    }\n  }\n  for (q = 0; q < j; q++) {\n    printf(\"%s\", order[q].id);\n    printf(\" \");\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\", buffer[i].id);\n    printf(\" \");\n  }\n}\n"}
{"label": "9", "index": "16297", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, n, i, j, t = 0;\n  int num[100];\n  int a[100];\n  char string[11];\n  char stm[100][11];\n  char str[100][11];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stm[i]);\n    scanf(\"%d\", &num[i]);\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (num[i] >= 60) {\n      a[j] = num[i];\n      strncpy(str[j], stm[i], 10);\n      j++;\n      t = j - 1;\n    }\n  }\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < t - j; i++) {\n      if (a[i] < a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n        strncpy(string, str[i], 10);\n        strncpy(str[i], str[i + 1], 10);\n        strncpy(str[i + 1], string, 10);\n      }\n    }\n  }\n  for (i = 0; i <= t; i++)\n    printf(\"%s \", str[i]);\n  for (i = 0; i < n; i++) {\n    if (num[i] < 60)\n      printf(\"%s \", stm[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16298", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  int sixty[100];\n\n  int n, b = 0, i, j, k, e;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i] = people[i].age;\n\n      b += 1;\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        e = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == people[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", people[j].id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int a[100], b[100], i, n, k, l, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &a[i]);\n    b[i] = a[i];\n  }\n  for (k = n - 1; k > 0; k--) {\n    for (i = 0; i < k; i++) {\n      if (b[i] > b[i + 1]) {\n        l = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = l;\n      }\n    }\n  }\n  i = n - 1;\n  while (b[i] >= 60) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == b[i]) {\n        printf(\"%s\\n\", s[j]);\n      }\n    }\n    while (b[i - 1] == b[i]) {\n      i--;\n    }\n    i--;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char s[100][11], z[11];\n  int g[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (g[j - 1] < g[j] && g[j] >= 60) {\n        strcpy(z, s[j - 1]);\n        strcpy(s[j - 1], s[j]);\n        strcpy(s[j], z);\n        c = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s\\n\", s[i]);\n  }\n  if (i == n - 1) {\n    cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16301", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct arr {\n  char id[10];\n  int age;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  scanf(\"%s %d\", &p1->id, &p1->age);\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%s %d\", &p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return (head);\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->age == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->age == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%s \", p->id);\n    else\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  if (head != NULL) {\n    while (p != NULL) {\n      head = head->next;\n      free(p);\n      p = head;\n    }\n  }\n}\nint main() {\n  struct arr *head, *p1;\n  int m, max = 0;\n  scanf(\"%d\", &m);\n  head = create(m);\n  for (;;) {\n    max = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next) {\n      max = (max > p1->age) ? max : p1->age;\n    }\n\n    if (max >= 60) {\n      for (p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age == max)\n          printf(\"%s \", p1->id);\n      }\n      head = del(head, max);\n    } else\n      break;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "9", "index": "16302", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n  struct patient *last;\n};\nchar temp[10];\nint main() {\n  struct patient *p1, *p2, *head, p[1000];\n  int n, i, j, tmp;\n  scanf(\"%d\", &n);\n  memset(p, 0, sizeof(p));\n  head = p + 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n    p[i].last = p + i - 1;\n    p[i].next = p + i + 1;\n  }\n  head->last = NULL;\n  p[i].next = NULL;\n  for (i = n; i > 1; i--) {\n    for (j = 1; j < n; j++) {\n      if ((p + j + 1)->age >= 60 && (p + j + 1)->age > (p + j)->age) {\n        memcpy(temp, (p + j)->id, sizeof(temp));\n        memcpy((p + j)->id, (p + j + 1)->id, sizeof(temp));\n        memcpy((p + j + 1)->id, temp, sizeof(temp));\n        tmp = (p + j)->age;\n        (p + j)->age = (p + j + 1)->age;\n        (p + j + 1)->age = tmp;\n      }\n    }\n  }\n  for (; head != NULL; head = head->next)\n    printf(\"%s \", head->id);\n}\n"}
{"label": "9", "index": "16303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    char ID[10];\n    int age;\n  } stu[100], stud[100];\n  int a[100], b[100], i, c, j, x, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].age);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].age >= 60) {\n      a[k] = stu[i].age;\n      b[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        x = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    c = b[i];\n    printf(\"%s\\n\", stu[c].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].age < 60) {\n      cout << stu[i].ID << \"\\n\";\n    }\n  }\n}\n"}
{"label": "9", "index": "16304", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct oldpeople {\n  char id[20];\n  int year;\n} old[100], old60[100], cache;\nint main() {\n  int n;\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> old[i].id >> old[i].year;\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (old[i].year >= 60) {\n      old60[j] = old[i];\n      j++;\n    }\n  }\n  int k;\n  for (i = 0; i < j; i++) {\n    for (k = 0; k < j - i; k++) {\n      if (old60[k].year < old60[k + 1].year) {\n        cache = old60[k + 1];\n        old60[k + 1] = old60[k];\n        old60[k] = cache;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", old60[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (old[i].year < 60)\n      printf(\"%s\\n\", old[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int w;\n  char c[10];\n  struct stu *next;\n};\nint n;\nstruct stu *creat(int m) {\n  struct stu *head, *p1, *p2, *p3;\n  int i;\n  n = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  head = p1;\n  p1->next = NULL;\n  n = 0;\n  scanf(\"%s %d\", p1->c, &p1->w);\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%s %d\", p1->c, &p1->w);\n    if (p1->w < 60) {\n      for (p2 = head; p2->next != NULL; p2 = p2->next)\n        ;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      p2 = head;\n      while ((p1->w <= p2->w) && (p2->next != NULL)) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      if (p1->w > p2->w) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int m, i;\n  struct stu *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", p->c);\n\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct ILL {\n  char id[10];\n  int age;\n};\nint main() {\n  struct ILL ill[100];\n  int n, i, k, j = 0, Age[100], x;\n  char a[100][10], b[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].id);\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      strcpy(a[j], ill[i].id);\n      Age[j] = ill[i].age;\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - i - 1; k++) {\n      if (Age[k] < Age[k + 1]) {\n        strcpy(b, a[k + 1]);\n        strcpy(a[k + 1], a[k]);\n        strcpy(a[k], b);\n        x = Age[k];\n        Age[k] = Age[k + 1];\n        Age[k + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    puts(a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (ill[i].age < 60) {\n      cout << ill[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, max, l, sign = 0;\n  scanf(\"%d\", &n);\n  struct tt {\n    char pp[10];\n    int age;\n    struct tt *next;\n  };\n  struct tt *head, *p1, *p2, *p3;\n  head = (struct tt *)malloc(1000);\n  p1 = head;\n  p2 = head;\n  scanf(\"%s\", head->pp);\n  scanf(\"%d\", &head->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct tt *)malloc(1000);\n    ;\n    p2->next = p1;\n    cin >> p1->pp;\n    scanf(\"%d\", &p1->age);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= n; i++) {\n    if (sign == 1) {\n      printf(\"%s \", head->pp);\n      head = head->next;\n    } else {\n      if (sign == 0) {\n        max = (-1);\n        for (p2 = NULL, p1 = head; p1 != NULL; p1 = p1->next) {\n          if (p1->age > max) {\n            max = p1->age;\n            p3 = p2;\n          }\n          p2 = p1;\n        }\n        if (max < 60) {\n          sign = 1;\n          i--;\n          continue;\n        } else {\n          if (max >= 60) {\n            if (p3 == NULL) {\n              printf(\"%s \", head->pp);\n              head = head->next;\n            } else {\n              p1 = p3->next;\n              printf(\"%s \", p1->pp);\n              p3->next = p1->next;\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct b {\n    char id[10];\n    int age;\n  };\n  int n, i, j, k;\n  struct b a[100], temp, c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (a[i].age >= 60) {\n      c[j] = a[i];\n      j++;\n    }\n  for (i = j - 1; i >= 1; i--)\n    for (k = j - 1; k > j - i - 1; k--)\n      if (c[k].age > c[k - 1].age) {\n        temp = c[k];\n        c[k] = c[k - 1];\n        c[k - 1] = temp;\n      }\n  for (i = 0; i < j; i++)\n    cout << c[i].id << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      cout << a[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "16309", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } * patients, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  patients = (struct br *)malloc(sizeof(struct br) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patients[i].id, &patients[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100], a[100], j = 0, k, l, temp, ord[100], o[100];\n  char num[100][10], old[100][10], t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n  for (i = 0; i < n; i++)\n    ord[i] = i;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[j] = age[i];\n      o[j] = ord[j];\n      strcpy(old[j], num[i]);\n      j++;\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] < a[l]) {\n        temp = a[k];\n        a[k] = a[l];\n        a[l] = temp;\n        temp = o[k];\n        o[k] = o[l];\n        o[l] = temp;\n        strcpy(t, old[k]);\n        strcpy(old[k], old[l]);\n        strcpy(old[l], t);\n      }\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] == a[l]) {\n        if (o[k] > o[l]) {\n          temp = a[k];\n          a[k] = a[l];\n          a[l] = temp;\n          temp = o[k];\n          o[k] = o[l];\n          o[l] = temp;\n          strcpy(t, old[k]);\n          strcpy(old[k], old[l]);\n          strcpy(old[l], t);\n        }\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, e, n, i, j, k, a[101], b[101], c[101];\n  char ex[11], s[101][11], s1[101][11], s2[101][11];\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      strcpy(s1[j], s[i]);\n      b[j] = a[i];\n      j++;\n    } else {\n      strcpy(s2[k], s[i]);\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (m = 1; m <= j; m++) {\n    for (i = 0; i < j - m; i++) {\n      if (b[i] < b[i + 1]) {\n        strcpy(ex, s1[i]);\n        strcpy(s1[i], s1[i + 1]);\n        strcpy(s1[i + 1], ex);\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << s1[i] << \"\\n\";\n\n  for (i = 0; i < k; i++) {\n    cout << s2[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      cout << id[i] << \" \";\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *y;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  y = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    cin >> (*(s + i)).id >> (*(s + i)).y;\n    if ((*(s + i)).y >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(y + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if (o[j].y > o[j - 1].y) {\n        t = o[j];\n        o[j] = o[j - 1];\n        o[j - 1] = t;\n      }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    cout << (*(y + i)).id << \"\\n\";\n}\n"}
{"label": "9", "index": "16314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct x {\n  char a[10];\n  int b;\n};\nstruct x y[100];\nint main() {\n  int n, i, j, m;\n  char s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &y[i].a, &y[i].b);\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (y[i].b < y[i + 1].b && y[i + 1].b >= 60) {\n        strcpy(s, y[i].a);\n        strcpy(y[i].a, y[i + 1].a);\n        strcpy(y[i + 1].a, s);\n        m = y[i].b;\n        y[i].b = y[i + 1].b;\n        y[i + 1].b = m;\n      }\n    }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", y[i].a);\n}\n"}
{"label": "9", "index": "16315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[100];\n  int age;\n  struct ill *next;\n};\nint main() {\n  struct ill *creat(int x);\n  struct ill *p, *head;\n  char *w[1000];\n  char *temp1;\n  int n, i, j = 0, k, temp;\n  int *q;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  head = p;\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      *(q + j) = (*p).age;\n      *(w + j) = (*p).id;\n      j++;\n    }\n    p = (*p).next;\n  }\n  k = j;\nloop:\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1)) {\n      temp = *(q + i);\n      *(q + i) = *(q + i + 1);\n      *(q + i + 1) = temp;\n      temp1 = *(w + i);\n      *(w + i) = *(w + i + 1);\n      *(w + i + 1) = temp1;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1)) {\n      goto loop;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", *(w + i));\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      goto lop;\n    } else {\n      printf(\"%s\\n\", (*p).id);\n    }\n  lop:\n    p = (*p).next;\n  }\n  return 0;\n}\nstruct ill *creat(int x) {\n  struct ill *head, *p1, *p2;\n  int i;\n  p1 = (struct ill *)malloc(sizeof(struct ill));\n  scanf(\"%s %d\", (*p1).id, &(*p1).age);\n  p2 = p1;\n  head = p1;\n  for (i = 0; i < x; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", (*p1).id, &(*p1).age);\n    (*p2).next = p1;\n    p2 = p1;\n  }\n  (*p2).next = NULL;\n  return (head);\n}\n"}
{"label": "9", "index": "16316", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n};\nint main() {\n  struct patient *head, *p1, *p2, *p0;\n  int i, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct patient *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p1->id, &p1->age);\n    p1->next = NULL;\n    if (i == 0)\n      head = p1;\n    else {\n      if ((p1->age > 60) && (p1->age > head->age)) {\n        p0 = head;\n        p1->next = p0;\n        head = p1;\n      } else {\n        p0 = head;\n        p2 = head->next;\n        if ((p1->age) < 60) {\n          while (p2 != NULL) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n        } else {\n          while ((p2 != NULL) && ((p1->age) <= (p2->age))) {\n            p0 = p2;\n            p2 = p2->next;\n          }\n          p0->next = p1;\n          p1->next = p2;\n        }\n      }\n    }\n    p1 = (struct patient *)malloc(1000);\n  }\n\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n  printf(\"%s\", p1->id);\n}\n"}
{"label": "9", "index": "16317", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int nj[1000];\n  int lr[1000], xr[1000];\n  char zfc[1000][20];\n  int i;\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    cin >> zfc[i];\n    scanf(\"%d\", &nj[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (nj[i] >= 60) {\n      lr[m] = i;\n      m++;\n    } else {\n      xr[k] = i;\n      k++;\n    }\n  }\n  int j;\n  if (m >= 2) {\n    for (i = 0; i < m - 1; i++) {\n      for (j = m - 1; j > i; j--) {\n        int e;\n        if (nj[lr[j]] > nj[lr[j - 1]]) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        } else if (nj[lr[j]] == nj[lr[j - 1]] && (lr[j] < lr[j - 1])) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        }\n      }\n    }\n  }\n  if (m >= 1) {\n    for (i = 0; i < m; i++)\n      printf(\"%s \", zfc[lr[i]]);\n  }\n  if (k > 0) {\n    for (i = 0; i < k; i++) {\n      printf(\"%s \", zfc[xr[i]]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int y;\n  struct p *next;\n};\nint n;\nstruct p *creat(void) {\n  struct p *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d \", p1->id, &p1->y);\n    if (i == 0) {\n      head = p1;\n    } else\n      p2->next = p1;\n\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nvoid px(struct p *head) {\n  struct p *p;\n  int k, t;\nleap:\n  t = 0;\n  for (p = head; p != 0;) {\n    if (p->y >= 60)\n      t = 1;\n    p = p->next;\n  }\n  if (t == 1) {\n    p = head;\n    k = p->y;\n    for (; p != 0;) {\n      if (p->y > k)\n        k = p->y;\n      p = p->next;\n    }\n    for (p = head; p != 0;) {\n      if (p->y == k) {\n        cout << p->id << \" \";\n        p->y = 0;\n      }\n      p = p->next;\n    }\n    goto leap;\n  }\n  for (p = head; p != 0;) {\n    if (p->y != 0)\n      cout << p->id << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct p *p;\n  p = creat();\n  px(p);\n}\n"}
{"label": "9", "index": "16319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int x) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(1000);\n  scanf(\"%s %d \", p1->id, &p1->age);\n  head = NULL;\n  while (n != x) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d \", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, i, j, v, t, *b;\n  struct patient *head, *p1;\n  b = (int *)malloc(100 * sizeof(int));\n  cin >> m;\n  head = creat(m);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    *(b + i) = p1->age;\n    p1 = p1->next;\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (*(b + i) < *(b + i + 1)) {\n        t = *(b + i);\n        *(b + i) = *(b + i + 1);\n        *(b + i + 1) = t;\n      }\n  for (i = 0; i < m; i++)\n    if (*(b + i) < 60) {\n      v = i;\n      break;\n    }\n  p1 = head;\n  for (j = 0; j < v; j++) {\n    p1 = head;\n    while (p1 != NULL) {\n      if (p1->age == *(b + j) && (j == 0 || *(b + j) != *(b + j - 1)))\n        printf(\"%s \", p1->id);\n      p1 = p1->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    if (p1->age < 60)\n      printf(\"%s \", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int a;\n  } p[100], pr;\n  int np, i, k;\n  scanf(\"%d\", &np);\n  for (i = 0; i < np; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].a);\n  }\n  for (i = 0; i < np; i++) {\n    for (k = np - 1; k > i; k--) {\n      if (p[k].a > p[k - 1].a && p[k].a >= 60) {\n        pr = p[k];\n        p[k] = p[k - 1];\n        p[k - 1] = pr;\n      }\n    }\n    printf(\"%s\\n\", p[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct guahao {\n  char num[20];\n  int year;\n};\nint main() {\n  int n, i, m;\n  struct guahao temp, *p, *t, *p1;\n  scanf(\"%d\", &n);\n  m = n;\n  struct guahao *bingren = (struct guahao *)malloc(sizeof(struct guahao) * n);\n  struct guahao *bingren1 = (struct guahao *)malloc(sizeof(struct guahao) * m);\n  p = bingren;\n  p1 = bingren1;\n  for (; p < bingren + n; p++, p1++) {\n    scanf(\"%s %d\", p->num, &p->year);\n    *p1 = *p;\n  }\n  p = bingren;\n  for (i = 0; p < bingren + n - 1; p++, i++) {\n    for (t = bingren; t < bingren + n - 1 - i; t++) {\n      if ((*t).year < (*(t + 1)).year) {\n        temp = *t;\n        *t = *(t + 1);\n        *(t + 1) = temp;\n      }\n    }\n  }\n  p = bingren;\n  for (; p < bingren + n; p++) {\n    if ((*p).year >= 60) {\n      cout << p->num << \"\\n\";\n    }\n  }\n  for (p1 = bingren1; p1 < bingren1 + m; p1++) {\n    if ((*p1).year < 60) {\n      cout << p1->num << \"\\n\";\n    }\n  }\n  free(bingren);\n  free(bingren1);\n  return 0;\n}\n"}
{"label": "9", "index": "16322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, n, i, j, t = 0;\n  int num[100];\n  int a[100];\n  char string[11];\n  char stm[100][11];\n  char str[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stm[i]);\n    scanf(\"%d\", &num[i]);\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (num[i] >= 60) {\n      a[j] = num[i];\n      strncpy(str[j], stm[i], 10);\n      j++;\n      t = j - 1;\n    }\n  }\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < t - j; i++) {\n      if (a[i] < a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n        strncpy(string, str[i], 10);\n        strncpy(str[i], str[i + 1], 10);\n        strncpy(str[i + 1], string, 10);\n      }\n    }\n  }\n  for (i = 0; i <= t; i++)\n    cout << str[i] << \" \";\n  for (i = 0; i < n; i++) {\n    if (num[i] < 60)\n      printf(\"%s \", stm[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16323", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } patients[100], old[100], young[100], jh;\n  int n, i, j, d, k;\n  j = -1;\n  d = -1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patients[i].id, &patients[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (patients[i].age >= 60) {\n      d++;\n      old[d] = patients[i];\n\n    } else {\n      j++;\n      young[j] = patients[i];\n    }\n  }\n  for (k = 1; k <= d + 1; k++) {\n    for (i = 0; i < d; i++) {\n      if (old[i].age < old[i + 1].age) {\n        jh = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = jh;\n      }\n    }\n  }\n  for (i = 0; i <= d; i++)\n    printf(\"%s\\n\", old[i].id);\n\n  for (i = 0; i <= j; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct myturn {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j = 0, max = 0;\n  struct myturn patient[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &patient[i].ID, &patient[i].age);\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  if (max >= 60) {\n    for (max; max >= 60; max--) {\n      for (i = 0; i < n; i++) {\n        if (patient[i].age == max) {\n          printf(\"%s\\n\", patient[i].ID);\n          patient[i].age = 0;\n          j++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age != 0) {\n      cout << patient[i].ID;\n      j++;\n      if (j < n)\n        printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16325", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  char id[10];\n  int age;\n  struct person *next;\n};\nint main() {\n  int n, i, j;\n  struct person *head, *ppre, *pnew, *p;\n\n  scanf(\"%d\", &n);\n  pnew = (struct person *)malloc(1000);\n  scanf(\"%s %d \", pnew->id, &pnew->age);\n  pnew->next = NULL;\n  head = pnew;\n  for (i = 2; i <= n; i++) {\n    p = head;\n    ppre = head;\n    pnew = (struct person *)malloc(1000);\n    scanf(\"%s %d\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if ((pnew->age >= 60) && (pnew->age > head->age)) {\n      pnew->next = head;\n      head = pnew;\n    } else {\n      if (pnew->age >= 60) {\n        p = p->next;\n        for (j = 2; j < i; j++) {\n          if (pnew->age > p->age) {\n            pnew->next = p;\n            ppre->next = pnew;\n            break;\n          }\n          p = p->next;\n          ppre = ppre->next;\n        }\n        if (pnew->next == NULL)\n          ppre->next = pnew;\n      } else {\n        while (p->next != NULL)\n          p = p->next;\n        p->next = pnew;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, d = 0, q, j;\n  int b[101], f[101];\n  char a[101][10], c[101][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  q = n - 1;\n  j = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (b[i] < 60) {\n\n      strcpy(c[q], a[i]);\n      q = q - 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n\n      strcpy(c[j], a[i]);\n      f[j] = b[i];\n      d = d + 1;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - 1; j++) {\n      if (f[j] < f[j + 1]) {\n        f[100] = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = f[100];\n        strcpy(c[100], c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[1 + j], c[100]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    char num[11];\n    int age;\n  };\n  struct p c[101];\n  int n, i, t = 0, s, h, l = 0;\n  int a[100], b[100], d[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i].num, &c[i].age);\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      a[t] = c[i].age;\n      c[i].age = 0;\n      b[t] = i;\n      t++;\n    }\n  }\n  if (t > 0) {\n  leap:\n    s = a[0];\n    h = 0;\n    for (i = 0; i < t; i++) {\n      if (a[i] > s) {\n        s = a[i];\n        h = i;\n      }\n    }\n    printf(\"%s\\n\", c[b[h]].num);\n    l++;\n    a[h] = 0;\n    if (l < t)\n      goto leap;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age != 0)\n      printf(\"%s\\n\", c[i].num);\n  }\n}\n"}
{"label": "9", "index": "16328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct xinxi {\n    char id[10];\n    int year;\n  } xinxi[100], b[100], p;\n\n  int i, j, k, a = 0, c = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", xinxi[i].id, &(xinxi[i].year));\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) >= 60) {\n      b[a] = xinxi[i];\n      a++;\n    }\n  }\n\n  for (k = 1; k < a; k++) {\n    for (j = 0; j < a - k; j++) {\n      if (b[j].year < b[j + 1].year) {\n        p = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = p;\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    cout << b[j].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) < 60) {\n      cout << xinxi[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n  int num;\n} bing[100], temp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bing[i].id >> bing[i].age;\n    bing[i].num = i + 1;\n  }\n  for (j = 0; j <= n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (bing[i + 1].age >= 60 && bing[i].age < bing[i + 1].age) {\n        temp = bing[i + 1];\n        bing[i + 1] = bing[i];\n        bing[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << bing[i].id << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int score;\n  struct student *next;\n};\nint n = 0;\nstruct student *creat(int numb);\nvoid print(struct student *head);\nstruct student *maopao(struct student *head);\nint main() {\n  int n;\n  char ch;\n  struct student *head;\n  cin >> n >> ch;\n  head = creat(n);\n  head = maopao(head);\n  print(head);\n  free(head);\n}\n\nstruct student *creat(int numb) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->score;\n  head = NULL;\n  while (n < numb - 1) {\n    n = n + 1;\n    if (n == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->num, &p1->score);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct student *maopao(struct student *head) {\n  struct student *p0, *p1, *p2, *tem;\n  int temp = 0, i, j;\n  p0 = head;\n  p1 = head;\n  p2 = head;\n  if (head == NULL) {\n    return (head);\n  } else if (p0->next == NULL) {\n    return (head);\n  } else if (p0->next != NULL) {\n    for (i = 0; i < n; i = i + 1) {\n      for (j = 0; j < n - 1; j = j + 1) {\n        if (p1->score < p1->next->score && j != 0 && p1->next->score >= 60) {\n          tem = p1->next;\n          p2->next = p1->next;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p2->next;\n        } else if (p1->score < p1->next->score && j == 0 &&\n                   p1->next->score >= 60) {\n          tem = p1->next;\n          p0 = tem;\n          p2 = tem;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p1;\n          p1 = p1->next;\n        } else {\n          p2 = p1;\n          p1 = p1->next;\n        }\n      }\n      temp = temp + 1;\n      p1 = p0;\n      p2 = p0;\n    }\n  }\n  return (p0);\n}\n\nvoid print(struct student *head) {\n  struct student *p, *tempo;\n  p = head;\n  if (head != NULL) {\n    do {\n      tempo = p->next;\n      printf(\"%s \", p->num);\n      p = tempo;\n    } while (p != NULL);\n  }\n}\n"}
{"label": "9", "index": "16331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint old = 0;\n\nstruct seqs {\n  char id[11];\n  int age;\n  struct seqs *next;\n};\n\nstruct seqs *build(int l) {\n  int i;\n  struct seqs *head, *newnode, *p;\n  head = (struct seqs *)malloc(1000);\n  scanf(\"%s %d\", head->id, &head->age);\n  p = head;\n  if (head->age >= 60)\n    old++;\n  for (i = 1; i < l; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    cin >> newnode->id >> newnode->age;\n    if (newnode->age < 60) {\n      p->next = newnode;\n      p = newnode;\n    } else {\n      old++;\n      newnode->next = head;\n      head = newnode;\n    }\n  }\n  p->next = NULL;\n  return head;\n}\n\nstruct seqs *rebuild(struct seqs *headx) {\n  int i;\n  struct seqs *head, *newnode, *p, *px;\n\n  newnode = (struct seqs *)malloc(1000);\n  newnode->next = NULL;\n  strcpy(newnode->id, headx->id);\n  newnode->age = headx->age;\n  p = newnode;\n  px = headx->next;\n  for (i = 1; i < old; i++) {\n    newnode = (struct seqs *)malloc(1000);\n    strcpy(newnode->id, px->id);\n    newnode->age = px->age;\n    newnode->next = p;\n    p = newnode;\n    px = px->next;\n  }\n  head = p;\n  return head;\n}\nvoid bubble(struct seqs *head, int l) {\n  struct seqs *p;\n  int i, j, temp;\n  char t[11] = {0};\n  for (i = 1; i < l; i++)\n    for (p = head, j = 0; j < l - i; j++, p = p->next)\n      if (p->age < p->next->age) {\n        strcpy(t, p->id);\n        strcpy(p->id, p->next->id);\n        strcpy(p->next->id, t);\n        temp = p->age;\n        p->age = p->next->age;\n        p->next->age = temp;\n      }\n}\nint main() {\n  int n, i;\n  struct seqs *p, *px;\n  scanf(\"%d\", &n);\n  p = build(n);\n  px = rebuild(p);\n  bubble(px, old);\n  while (px != NULL) {\n    cout << px->id << \" \";\n    px = px->next;\n  }\n  for (i = 0; i < old; i++)\n    p = p->next;\n  while (p != NULL) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[100] = {0}, t[100] = {0}, n, i, j, m = 0;\nchar ss[100][100];\nint cmp(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ss[i], &s[i]);\n  for (j = 0; j < n; j++) {\n    m = 0;\n    for (i = 0; i < n; i++) {\n      m = m > s[i] ? m : s[i];\n    }\n    if (m < 60) {\n      break;\n    }\n\n    for (i = 0; i < n; i++) {\n      if (s[i] == m) {\n        printf(\"%s\\n\", ss[i]);\n        s[i] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] != -1) {\n      printf(\"%s\\n\", ss[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint N;\nstruct patient {\n  char ID[20];\n  int age;\n  struct patient *next;\n};\nstruct patient *creat() {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < N; i++) {\n    p1 = (struct patient *)malloc(1000);\n    cin >> p1->ID >> p1->age;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nstruct patient *rank_1(struct patient *head) {\n  int i, j, a;\n  char ID[20];\n  struct patient *p1, *p2;\n  for (i = 0; i < N - 1; i++) {\n    p1 = head;\n    p2 = head->next;\n    for (j = 0; j < N - i - 1; j++) {\n      if ((p1->age < p2->age) && (p2->age >= 60)) {\n        a = p1->age;\n        p1->age = p2->age;\n        p2->age = a;\n        strcpy(ID, p1->ID);\n        strcpy(p1->ID, p2->ID);\n        strcpy(p2->ID, ID);\n      }\n      p1 = p2;\n      p2 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  cin >> N;\n  head = creat();\n  head = rank_1(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16334", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][1000];\n  int b[100];\n  char c[100][1000];\n  int q, w, e;\n  q = 0;\n  w = 0;\n  int n;\n  int i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int y;\n    char x[100][1000];\n    scanf(\"%s %d\", x, &y);\n    if (y >= 60) {\n      strcpy(a[q], x[0]);\n      b[q] = y;\n      q++;\n    } else {\n      strcpy(c[w], x[0]);\n      w++;\n    }\n  }\n  int h;\n  char H[100][1000];\n  for (i = 1; i < 10000; i++) {\n    for (j = 0; j < q; j++) {\n      if (b[j] < b[j + 1]) {\n        h = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = h;\n        strcpy(H[0], a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], H[0]);\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%s\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, m;\n  int i, j = 0, k = 0;\n  struct patient a[100], b[100], c[100], t[1];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      strcpy(b[j].ID, a[i].ID);\n      b[j].age = a[i].age;\n      j = j + 1;\n    } else {\n      strcpy(c[k].ID, a[i].ID);\n      c[k].age = a[i].age;\n      k = k + 1;\n    }\n  }\n  m = j;\n  for (j = 1; j <= m - 1; j++) {\n    for (i = 0; i <= m - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        strcpy(t[0].ID, b[i].ID);\n        t[0].age = b[i].age;\n        strcpy(b[i].ID, b[i + 1].ID);\n        b[i].age = b[i + 1].age;\n        strcpy(b[i + 1].ID, t[0].ID);\n        b[i + 1].age = t[0].age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char str[100][100];\n\n  int s1[100], sz[100], t[100];\n  int n, i, p, k;\n\n  cin >> n;\n\n  int j = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", str[i], &sz[i]);\n\n    if (sz[i] >= 60) {\n      t[j] = i;\n      s1[j] = sz[i];\n      j++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (p = 0; p < j - k; p++) {\n      if (s1[p] < s1[p + 1]) {\n        int e, f;\n        e = s1[p + 1];\n        s1[p + 1] = s1[p];\n        s1[p] = e;\n        f = t[p + 1];\n        t[p + 1] = t[p];\n        t[p] = f;\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s\\n\", str[t[p]]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16337", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0, n, n1 = -1, n2 = -1, old = 0;\n  char xiao[100][10];\n  struct bingren {\n    char id[10];\n    int age;\n  };\n  struct bingren a[100];\n  struct bingren b[100];\n  struct bingren t;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n\n      n1++;\n\n      j++;\n    } else {\n      strcpy(xiao[k], a[i].id);\n      k++;\n      n2++;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i <= n1; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i <= n2; i++)\n    printf(\"%s\\n\", xiao[i]);\n}\n"}
{"label": "9", "index": "16338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int j;\n  struct client {\n    char num[11];\n    int age;\n  };\n  struct client line[100];\n  struct client temp;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &line[i].num, &line[i].age);\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (line[j].age >= 60 && line[j + 1].age >= 60) {\n        if (line[j].age < line[j + 1].age) {\n          temp = line[j];\n          line[j] = line[j + 1];\n          line[j + 1] = temp;\n        }\n      }\n      if (line[j].age < 60 && line[j + 1].age >= 60) {\n        temp = line[j];\n        line[j] = line[j + 1];\n        line[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << line[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "16339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    char num[11];\n    int age;\n  };\n  struct p c[101];\n  int n, i, t = 0, s, h, l = 0;\n  int a[100], b[100], d[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i].num, &c[i].age);\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      a[t] = c[i].age;\n      c[i].age = 0;\n      b[t] = i;\n      t++;\n    }\n  }\n  if (t > 0) {\n  leap:\n    s = a[0];\n    h = 0;\n    for (i = 0; i < t; i++) {\n      if (a[i] > s) {\n        s = a[i];\n        h = i;\n      }\n    }\n    printf(\"%s\\n\", c[b[h]].num);\n    l++;\n    a[h] = 0;\n    if (l < t) {\n      goto leap;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age != 0)\n      printf(\"%s\\n\", c[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  int age;\n  char num[10];\n\n} pat[100], old[100], you[100], exchange_1;\nint main() {\n  int n, i, p, q, result;\n  int k = 0, t = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].num);\n    scanf(\"%d\", &pat[i].age);\n    if (pat[i].age >= 60) {\n      old[k].age = pat[i].age;\n      strcpy(old[k].num, pat[i].num);\n      k++;\n    } else {\n      strcpy(you[t].num, pat[i].num);\n      t++;\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (q = 0; q < k - p; q++) {\n      if (old[q].age < old[q + 1].age) {\n        exchange_1.age = old[q].age;\n        old[q].age = old[q + 1].age;\n        old[q + 1].age = exchange_1.age;\n        strcpy(exchange_1.num, old[q].num);\n        strcpy(old[q].num, old[q + 1].num);\n        strcpy(old[q + 1].num, exchange_1.num);\n      }\n    }\n  }\n  for (result = 0; result < k; result++)\n    printf(\"%s \", old[result].num);\n\n  for (result = 0; result < t; result++) {\n    printf(\"%s \", you[result].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b[100] = {0}, t, m;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\\n\", a[i].num, &a[i].age);\n    b[i] = a[i].age;\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      m = i;\n      break;\n    }\n  }\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      if (a[i].age == b[j] && (j == 0 || b[j] != b[j - 1]))\n        printf(\"%s\\n\", a[i].num);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      cout << a[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "16342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, f, g, t;\n  scanf(\"%d\", &n);\n  int p[n], e[n], d[n];\n  char a[n][100], b[n][100], c[n][100], s[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &p[i]);\n  }\n  j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n\n    if (p[i] >= 60) {\n      e[j] = p[i];\n      strcpy(b[j], a[i]);\n      j++;\n    } else {\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  for (f = 0; f < j - 1; f++) {\n    for (g = 0; g < j - 1 - f; g++) {\n      if (e[g] < e[g + 1]) {\n        t = e[g + 1];\n        e[g + 1] = e[g];\n        e[g] = t;\n        strcpy(s, b[g + 1]);\n        strcpy(b[g + 1], b[g]);\n        strcpy(b[g], s);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  for (i = 0; i < k; i++) {\n    cout << c[i] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct person {\n  char c[10];\n  int a;\n  struct person *next;\n};\nint main() {\n  int i, n;\n  struct person *head, *p1, *p2, *p, *p0, *p3;\n  scanf(\"%d \", &n);\n  i = 0;\n  head = NULL;\n  while (i < n) {\n    p1 = (struct person *)malloc(1000);\n    scanf(\"%s %d\", p1->c, &p1->a);\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n    i++;\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = p0 = head;\n    while (p != NULL) {\n      if (p->a > p0->a)\n        p0 = p;\n      p = p->next;\n    }\n    if (p0->a >= 60) {\n      printf(\"%s \", p0->c);\n      p = head;\n      while (p->a != p0->a) {\n        p3 = p;\n        p = p->next;\n      }\n      if (p == head)\n        head = p->next;\n      else\n        p3->next = p->next;\n    } else {\n      printf(\"%s \", head->c);\n      head = head->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "16344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int age;\n};\n\nint main() {\n  void sort(int n, struct p a[101]);\n  int n, i;\n  struct p a[101];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n  }\n  sort(n, a);\n\n  return 0;\n}\n\nvoid sort(int n, struct p a[101]) {\n  int i, k = 0;\n  for (i = 0; i < n; i++) {\n    if ((a[i].age) > k)\n      k = (a[i].age);\n  }\n  for (; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if ((a[i].age) == k) {\n        printf(\"%s\\n\", a[i].id);\n        (a[i].age) = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i].age) != 0) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "16345", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct data {\n  char id[100];\n  int age;\n};\n\nint main() {\n\n  struct data old[1000];\n  struct data young[1000];\n  struct data temp;\n  int n, i, p = 0, q = 0, len1, len2, k;\n  char id[100];\n  int age;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d \", id, &age);\n    if (age >= 60) {\n      old[p].age = age;\n      strcpy(old[p].id, id);\n      p++;\n    } else {\n      young[q].age = age;\n      strcpy(young[q].id, id);\n      q++;\n    }\n  }\n  len1 = p;\n  len2 = q;\n  for (k = 1; k < len1; k++) {\n    for (i = 0; i < len1 - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        temp = old[i + 1];\n        old[i + 1] = old[i];\n        old[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < len1; i++)\n    printf(\"%s\\n\", old[i].id);\n\n  for (i = 0; i < len2; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar id[101][11];\n\nint main() {\n  int n;\n  int age[101], a[101];\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    int j = i;\n    if (age[i] >= 60) {\n      for (; j > 1 && age[a[j - 1]] < age[i]; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (int i = 1; i <= n; i++)\n    cout << id[a[i]] << \"\\n\";\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient pat[100];\n  int n, i, j, huan;\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pat[i].ID, &pat[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      for (j = i; j > 0; j--) {\n        if (pat[j].age > pat[j - 1].age) {\n          huan = pat[j].age;\n          pat[j].age = pat[j - 1].age;\n          pat[j - 1].age = huan;\n          strcpy(string, pat[j].ID);\n          strcpy(pat[j].ID, pat[j - 1].ID);\n          strcpy(pat[j - 1].ID, string);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].ID);\n}\n"}
{"label": "9", "index": "16348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char name[20];\n  int age;\n} line[202], temp;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", &line[i].name);\n    scanf(\"%d\", &line[i].age);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n; j > i; j--) {\n      if (line[j].age >= 60) {\n        if (line[j].age > line[j - 1].age) {\n          temp = line[j];\n          line[j] = line[j - 1];\n          line[j - 1] = temp;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    cout << line[i].name << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100] = {0}, t, sum = 0;\n  char s[100][10], sb[100][10], st[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], a + i);\n    if (a[i] >= 60) {\n      c[i] = 1, b[sum] = a[i], strcpy(sb[sum], s[i]), sum++;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    for (j = 0; j < sum - i; j++)\n      if (b[j] < b[j + 1])\n        t = b[j], b[j] = b[j + 1], b[j + 1] = t, strcpy(st, sb[j]),\n        strcpy(sb[j], sb[j + 1]), strcpy(sb[j + 1], st);\n  for (i = 0; i < sum; i++)\n    printf(\"%s\\n\", sb[i]);\n  for (i = 0; i < n; i++)\n    if (c[i] == 0)\n      printf(\"%s\\n\", s[i]);\n}\n"}
{"label": "9", "index": "16350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a[100], b[100], k, m = 0, sum = 59;\n  char c[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      }\n    }\n    a[k] = 0;\n    b[j] = k;\n    sum = 59;\n  }\n  for (j = 0; j < m; j++)\n    cout << c[b[j]] << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if ((a[i] > 0) && (a[i] < 60)) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char id[100][10], id1[100][10], t[10];\n  int n, i, j, b, age[100], age1[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n    strcpy(id1[i], id[i]);\n    age1[i] = age[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (age1[j] < age1[j + 1]) {\n        b = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = b;\n        strcpy(t, id1[j]);\n        strcpy(id1[j], id1[j + 1]);\n        strcpy(id1[j + 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age1[i] >= 60)\n      printf(\"%s\\n\", id1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16352", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, d, e, f, n, i;\n  char a[100][10];\n  int b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (c = 0; c < n; c++) {\n    e = -1;\n    for (i = 0; i < n; i++) {\n      if (b[i] >= 60) {\n        if (b[i] > e) {\n          e = b[i];\n          f = i;\n        }\n      }\n    }\n    if (e != -1) {\n      printf(\"%s\\n\", a[f]);\n      b[f] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Inf {\n  char c[10];\n  int a;\n};\nint main() {\n  int n, o = 0, y = 0, t, i, j;\n  char temp[10];\n  struct Inf inf[100], old[100], young[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", inf[i].c, &inf[i].a);\n    if (inf[i].a >= 60) {\n      strcpy(old[o].c, inf[i].c);\n      old[o].a = inf[i].a;\n      o++;\n    } else {\n      strcpy(young[y].c, inf[i].c);\n      young[y].a = inf[i].a;\n      y++;\n    }\n  }\n  for (j = 1; j < o; j++) {\n    for (i = 0; i < o - j; i++) {\n      if (old[i].a < old[i + 1].a) {\n        strcpy(temp, old[i].c);\n        strcpy(old[i].c, old[i + 1].c);\n        strcpy(old[i + 1].c, temp);\n        t = old[i].a;\n        old[i].a = old[i + 1].a;\n        old[i + 1].a = t;\n      }\n    }\n  }\n  for (i = 0; i < o; i++) {\n    cout << old[i].c << \"\\n\";\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", young[i].c);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16354", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  char a[100][10], over[100][10], below[100][10];\n\n  long int b[100];\n  long int c[100] = {0};\n  long int d[100] = {0};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= 60) {\n      c[i] = b[i];\n      strcpy(over[i], a[i]);\n    } else {\n      d[i] = b[i];\n      strcpy(below[i], a[i]);\n    }\n  }\n  for (k = 101; k >= 60; k--) {\n    i = 1;\n    while (i <= n) {\n      if (c[i] == k) {\n        printf(\"%s\\n\", over[i]);\n      }\n      i++;\n    }\n  }\n  i = 1;\n  while (i <= n) {\n    if (d[i] != 0)\n      printf(\"%s\\n\", below[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar id[101][11];\n\nint main() {\n  int n;\n  int age[101], a[101];\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    int j = i;\n    if (age[i] >= 60) {\n      for (; j > 1 && age[a[j - 1]] < age[i]; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (int i = 1; i <= n; i++) {\n    cout << id[a[i]] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  struct patient p[100];\n  for (i = 1; i <= n; ++i) {\n    scanf(\"%s%d\", &p[i].id, &p[i].age);\n    p[i].num = i;\n  }\n  for (i = 1; i <= n - 1; ++i) {\n    for (j = i + 1; j <= n; ++j) {\n      if (p[j].age > p[i].age) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  for (i = 1; p[i].age >= 60; ++i) {\n    for (j = i + 1; p[j].age == p[i].age; ++j) {\n      if (p[i].num > p[j].num) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (j = i; j <= n; ++j) {\n    int k;\n    for (k = j + 1; k <= n; ++k) {\n      if (p[j].num > p[k].num) {\n        struct patient t;\n        t = p[j];\n        p[j] = p[k];\n        p[k] = t;\n      }\n    }\n    printf(\"%s\\n\", p[j].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t;\n  int i, j = 0, k, max;\n  int age[100];\n  int age2[100];\n  char string[100][11];\n  int line[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      age2[j] = age[i];\n      age[i] = 0;\n      line[j] = i;\n      j = j + 1;\n      k = j;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    max = 0;\n    t = 0;\n    for (j = 0; j <= k - 1; j++) {\n      if (max < age2[j]) {\n        max = age2[j];\n        t = j;\n      }\n    }\n    printf(\"%s\\n\", string[line[t]]);\n    age2[t] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], l[100], b[100], i = 0, j, k, p = 0, q = 0, t = 0;\n  char s[100][12], lao[100][13] = {'\\0'}, bu[100][13] = {'\\0'}, w[12] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &s[i], &a[i]);\n    if (a[i] >= 60)\n      l[p] = a[i], strcpy(lao[p], s[i]), p++;\n    else\n      b[q] = a[i], strcpy(bu[q], s[i]), q++;\n  }\n\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1; j++) {\n      if (l[j] < l[j + 1])\n        t = l[j], l[j] = l[j + 1], l[j + 1] = t, strcpy(w, lao[j]),\n        strcpy(lao[j], lao[j + 1]), strcpy(lao[j + 1], w);\n    }\n  }\n  for (i = 0; i < p; i++) {\n    cout << lao[i] << \"\\n\";\n  }\n  for (i = 0; i < q; i++) {\n    cout << bu[i] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bin {\n  char num[10];\n  int age;\n} t, b[100], c[100], a[100];\nint main() {\n  int n, i, j = 0, k = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].num, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n    p = j;\n    if (a[i].age < 60) {\n      c[k] = a[i];\n      k++;\n    }\n    q = k;\n  }\n\n  for (j = 1; j < p; j++)\n    for (i = 0; i < p - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", b[i].num);\n  for (i = 0; i < q; i++)\n    cout << c[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "16360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    int k;\n    char id[10];\n    int age;\n  } pa[100] = {0, \"\", 0}, pb[100] = {0, \"\", 0}, temp;\n  int n;\n  int i, j, age, na, nb;\n  char id[10] = {\"\"};\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0; i + j < n;) {\n    scanf(\"%s%d\", &id, &age);\n    if (age >= 60) {\n      pa[i].age = age;\n      strcpy(pa[i].id, id);\n      pa[i].k = i;\n      i++;\n    } else {\n      pb[j].age = age;\n      strcpy(pb[j].id, id);\n      pb[j].k = j;\n      j++;\n    }\n  }\n  na = i;\n  nb = j;\n  for (j = 1; j <= n - 1; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pa[i].age < pa[i + 1].age) {\n        temp.age = pa[i + 1].age;\n        strcpy(temp.id, pa[i + 1].id);\n        pa[i + 1].age = pa[i].age;\n        strcpy(pa[i + 1].id, pa[i].id);\n        pa[i].age = temp.age;\n        strcpy(pa[i].id, temp.id);\n      }\n    }\n  }\n  printf(\"%s\", pa[0].id);\n  for (i = 1; i <= na; i++) {\n    printf(\"\\n%s\", pa[i].id);\n  }\n  for (j = 0; j <= nb; j++) {\n    puts(pb[j].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16361", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int y;\n  struct p *next;\n};\nint n;\nstruct p *creat(void) {\n  struct p *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d \", p1->id, &p1->y);\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nvoid px(struct p *head) {\n  struct p *p;\n  int k, t;\nleap:\n  t = 0;\n  for (p = head; p != 0;) {\n    if (p->y >= 60)\n      t = 1;\n    p = p->next;\n  }\n  if (t == 1) {\n    p = head;\n    k = p->y;\n    for (; p != 0;) {\n      if (p->y > k)\n        k = p->y;\n      p = p->next;\n    }\n    for (p = head; p != 0;) {\n      if (p->y == k) {\n        printf(\"%s \", p->id);\n        p->y = 0;\n      }\n      p = p->next;\n    }\n    goto leap;\n  }\n  for (p = head; p != 0;) {\n    if (p->y != 0)\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct p *p;\n  p = creat();\n  px(p);\n}\n"}
{"label": "9", "index": "16362", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, temp, s, max;\n  int is_over_sixty_exist = 1;\n  int age[100] = {0}, queue[100] = {0};\n  char id[100][10] = {'0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    queue[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  i = 0;\n  while (is_over_sixty_exist) {\n    max = 0;\n    is_over_sixty_exist = 0;\n    temp = queue[i];\n    for (j = 0; j < n; j++) {\n      if (age[j] >= 60 && age[j] > max) {\n        is_over_sixty_exist = 1;\n        max = age[j];\n        queue[i] = j;\n      }\n    }\n    for (s = i + 1; s < n; s++)\n      if (queue[s] == queue[i])\n        break;\n    age[queue[i]] = 0;\n    if (is_over_sixty_exist) {\n      if (s != n) {\n        for (k = s; k >= i + 1; k--)\n          queue[k] = queue[k - 1];\n        queue[i + 1] = temp;\n      }\n    }\n    i++;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", id[queue[i]]);\n}\n"}
{"label": "9", "index": "16363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar id[1000][1000], oldid[1000][1000], newid[1000][1000];\nint age[1000];\nint oldage[1000], newage[1000];\nint main() {\n  int num;\n  int i = 0, j = 0, k = 0, n = 0;\n  int e_oldage;\n  char e_oldid[1000];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d \", id[i], &(age[i]));\n  }\n  for (i = 0; i < num; i++) {\n    if (age[i] >= 60) {\n      oldage[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      newage[n] = age[i];\n      strcpy(newid[n], id[i]);\n      n++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (oldage[i] < oldage[i + 1]) {\n        e_oldage = oldage[i + 1];\n        strcpy(e_oldid, oldid[i + 1]);\n\n        oldage[i + 1] = oldage[i];\n        strcpy(oldid[i + 1], oldid[i]);\n\n        oldage[i] = e_oldage;\n        strcpy(oldid[i], e_oldid);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << oldid[i] << \" \";\n  }\n  for (i = 0; i < n; i++) {\n    cout << newid[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16364", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct ren {\n    char b[100];\n    int c;\n\n  } a[100], d[100], m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].b, &a[i].c);\n    d[i] = a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (d[j].c < d[j + 1].c) {\n        m = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = m;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i].c >= 60) {\n      printf(\"%s\\n\", d[i].b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].c < 60)\n      printf(\"%s\\n\", a[i].b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16365", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct people {\n  int order;\n  char ID[10];\n  int age;\n} per[100];\nstruct old {\n  int orders;\n  char IDs[10];\n  int ages;\n} elder[100];\nint main() {\n  int n, i, j, t, m, q;\n  char p[10];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    per[i].order = i;\n    cin >> per[i].ID >> per[i].age;\n    b[i] = strlen(per[i].ID);\n  }\n  t = 0;\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age >= 60) {\n      elder[t].orders = t;\n      strcpy(elder[t].IDs, per[i].ID);\n      elder[t].ages = per[i].age;\n      t = t + 1;\n      per[i].age = (-1);\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - i - 1); j++) {\n      if (elder[j].ages < elder[j + 1].ages) {\n        m = elder[j].ages;\n        strcpy(p, elder[j].IDs);\n        q = elder[j].orders;\n        strcpy(elder[j].IDs, elder[j + 1].IDs);\n        elder[j].ages = elder[j + 1].ages;\n        elder[j].orders = elder[j + 1].orders;\n        elder[j + 1].ages = m;\n        strcpy(elder[j + 1].IDs, p);\n        elder[j + 1].orders = q;\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - 1 - j); j++) {\n      if (elder[j].ages == elder[j + 1].ages) {\n        if (elder[j].orders > elder[j + 1].orders) {\n          m = elder[j].ages;\n          strcpy(p, elder[j].IDs);\n          q = elder[j].orders;\n          strcpy(elder[j].IDs, elder[j + 1].IDs);\n          elder[j].ages = elder[j + 1].ages;\n          elder[j].orders = elder[j + 1].orders;\n          elder[j + 1].ages = m;\n          strcpy(elder[j + 1].IDs, p);\n          elder[j + 1].orders = q;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    printf(\"%s\\n\", elder[i].IDs);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age != (-1))\n      printf(\"%s\\n\", per[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16366", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n} * p1, *p2, *head, *q1, *q2, *qhead;\n\nint main() {\n  int i, n, k = 0;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  qhead = q1 = q2 = (struct data *)malloc(1000);\n  qhead->next = NULL;\n  for (i = n; i > n - k; i--)\n    head = sort(head, i);\n\n  q2->next = NULL;\n  q2->next = head->next;\n  free(head);\n  print(qhead);\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  q1 = (struct data *)malloc(1000);\n  strcpy(q1->id, code->id);\n  q1->age = code->age;\n  q2->next = q1;\n  q2 = q1;\n\n  if (pre == head)\n    head->next = code->next;\n  else\n    pre->next = code->next;\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *qhead) {\n  struct data *q;\n  q = qhead->next;\n  do {\n    printf(\"%s \", q->id);\n    q = q->next;\n  } while (q != NULL);\n}\n"}
{"label": "9", "index": "16367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } pa[100], pao[100], pay[100], blank;\n  int i, j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pa[i].num);\n    scanf(\"%d\", &pa[i].age);\n    if (pa[i].age >= 60)\n      pao[j++] = pa[i];\n    else\n      pay[k++] = pa[i];\n  }\n  int t;\n  for (i = 0; i < j; i++) {\n    for (t = i + 1; t < j; t++) {\n      if (pao[t].age > pao[i].age) {\n        blank = pao[i];\n        pao[i] = pao[t];\n        pao[t] = blank;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (pao[i].age != pao[i - 1].age) {\n      for (t = 0; t < n; t++)\n        if (pa[t].age == pao[i].age)\n          printf(\"%s\\n\", pa[t].num);\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pay[i].num);\n}\n"}
{"label": "9", "index": "16368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0, sum = 59;\n  int a[100], b[100];\n  char c[101][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      } else\n        continue;\n    }\n    a[k] = -1;\n    b[j] = k;\n    sum = 59;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[b[i]]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 0 && a[i] < 60)\n      printf(\"%s\\n\", c[i]);\n  }\n}\n"}
{"label": "9", "index": "16369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, f;\n  int k = 0;\n  cin >> n;\n  char a[100][2000], e[11];\n  char d[100][2000];\n  int b[100];\n  int c[100];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = j; i <= k - 2; i++) {\n      if (c[i] < c[i + 1]) {\n        strcpy(e, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], e);\n        f = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = f;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << d[i] << \" \";\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nstruct student {\n  int a;\n  char num[20];\n  struct student *next;\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->a);\n  head = (struct student *)malloc(1000);\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(1000);\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(1000);\n    scanf(\"%s%d\", p3->num, &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL) {\n    p1 = p1->next;\n  }\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct myturn {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i, j = 0, max = 0;\n  struct myturn patient[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &patient[i].ID, &patient[i].age);\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  if (max >= 60) {\n    for (max; max >= 60; max--) {\n      for (i = 0; i < n; i++) {\n        if (patient[i].age == max) {\n          printf(\"%s\\n\", patient[i].ID);\n          patient[i].age = 0;\n          j++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age != 0) {\n      cout << patient[i].ID;\n      j++;\n      if (j < n)\n        printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct p {\n    int k;\n    char id[10];\n    int age;\n  } pa[100] = {0, \"\", 0}, pb[100] = {0, \"\", 0}, temp;\n\n  int n;\n  int i, j, age, na, nb;\n  char id[10] = {\"\"};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0; i + j < n;) {\n    cin >> id >> age;\n    if (age >= 60) {\n      pa[i].age = age;\n      strcpy(pa[i].id, id);\n      pa[i].k = i;\n      i++;\n    } else {\n      pb[j].age = age;\n      strcpy(pb[j].id, id);\n      pb[j].k = j;\n      j++;\n    }\n  }\n  na = i;\n  nb = j;\n\n  for (j = 1; j <= n - 1; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pa[i].age < pa[i + 1].age) {\n        temp.age = pa[i + 1].age;\n        strcpy(temp.id, pa[i + 1].id);\n        pa[i + 1].age = pa[i].age;\n        strcpy(pa[i + 1].id, pa[i].id);\n        pa[i].age = temp.age;\n        strcpy(pa[i].id, temp.id);\n      }\n    }\n  }\n\n  printf(\"%s\", pa[0].id);\n  for (i = 1; i <= na; i++) {\n    cout << \"\\n\" << pa[i].id;\n  }\n  for (j = 0; j <= nb; j++) {\n    puts(pb[j].id);\n  }\n}\n"}
{"label": "9", "index": "16373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, p = 0, q, w;\n  struct patient {\n    int age;\n    char b[10];\n  };\n  struct patient c[100], d[100], e[100], f[100], g;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i].b);\n    cin >> c[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      d[j] = c[i];\n      j = j + 1;\n    } else {\n      e[p] = c[i];\n      p = p + 1;\n    }\n  }\n  w = j - 1;\n\n  for (j = 1; j <= w; j++) {\n    q = w;\n    for (; q >= j; q--) {\n      if (d[q].age > d[q - 1].age) {\n        g = d[q];\n        d[q] = d[q - 1];\n        d[q - 1] = g;\n      }\n    }\n  }\n  for (j = 0; j < w + 1; j++)\n    printf(\"%s\\n\", d[j].b);\n  for (j = 0; j < p; j++)\n    printf(\"%s\\n\", e[j].b);\n}\n"}
{"label": "9", "index": "16374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct m {\n    char id[10];\n    int year;\n  } p[100], a[100], tmp;\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].id, &p[i].year);\n    if (p[i].year >= 60) {\n      a[k] = p[i];\n      k++;\n      p[i].year = 0;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (a[j].year > a[j - 1].year) {\n        tmp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].year == 0)\n      continue;\n    printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int x) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(1000);\n  scanf(\"%s %d \", p1->id, &p1->age);\n  head = NULL;\n  while (n != x) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d \", p1->id, &p1->age);\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int m, i, j, v, t, *b;\n  struct patient *head, *p1;\n  b = (int *)malloc(100 * sizeof(int));\n  scanf(\"%d \", &m);\n  head = creat(m);\n  p1 = head;\n  for (i = 0; i < m; i++) {\n    *(b + i) = p1->age;\n    p1 = p1->next;\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (*(b + i) < *(b + i + 1)) {\n        t = *(b + i);\n        *(b + i) = *(b + i + 1);\n        *(b + i + 1) = t;\n      }\n  for (i = 0; i < m; i++)\n    if (*(b + i) < 60) {\n      v = i;\n      break;\n    }\n  p1 = head;\n  for (j = 0; j < v; j++) {\n    p1 = head;\n    while (p1 != NULL) {\n      if (p1->age == *(b + j) && (j == 0 || *(b + j) != *(b + j - 1)))\n        cout << p1->id << \" \";\n      p1 = p1->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    if (p1->age < 60)\n      cout << p1->id << \" \";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], oage[100];\n  char ID[100][10], old[100][10], young[100][10];\n  scanf(\"%d\", &n);\n  int i, m;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", ID[i], &age[i]);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[k], ID[i]);\n      k++;\n    } else {\n      oage[j] = age[i];\n      strcpy(old[j], ID[i]);\n      j++;\n    }\n  }\n  for (i = 150; i >= 60; i--) {\n    for (m = 0; m < j; m++) {\n      if (oage[m] == i) {\n        cout << old[m] << \"\\n\";\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct x {\n  char a[10];\n  int b;\n};\nstruct x y[100];\nint main() {\n  int n, i, j, m;\n  char s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &y[i].a, &y[i].b);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++) {\n      if (y[i].b < y[i + 1].b && y[i + 1].b >= 60) {\n        strcpy(s, y[i].a);\n        strcpy(y[i].a, y[i + 1].a);\n        strcpy(y[i + 1].a, s);\n        m = y[i].b;\n        y[i].b = y[i + 1].b;\n        y[i + 1].b = m;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << y[i].a << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, k;\n  char a[100][100], b[100], c[100], d[100][100], e[100], f[100][100], s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n        strcpy(s, d[j]);\n        strcpy(d[j], d[j + 1]);\n        strcpy(d[j + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      e[m] = b[i];\n      strcpy(f[m], a[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << f[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, f;\n  int k = 0;\n  scanf(\"%d\", &n);\n  char a[100][2000], e[11];\n  char d[100][2000];\n  int b[100];\n  int c[100];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = j; i <= k - 2; i++) {\n      if (c[i] < c[i + 1]) {\n        strcpy(e, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], e);\n        f = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = f;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n}\n"}
{"label": "9", "index": "16380", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct man {\n  char id[20];\n  int a;\n  struct man *next;\n} * p, *head, *q;\n\nint main() {\n  struct man *insert(struct man * head, struct man * ill);\n  int n, i;\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct man *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->a);\n    head = insert(head, p);\n  }\n  q = head;\n  while (q != NULL) {\n    printf(\"%s \", q->id);\n    q = q->next;\n  }\n  return 0;\n}\n\nstruct man *insert(struct man *head, struct man *ill) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = ill;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->a < 60) {\n      while (p1->next != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p1->next = p0;\n      p0->next = NULL;\n    }\n\n    else if (p0->a >= 60) {\n      while ((p0->a <= p1->a) && (p1->next != NULL)) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->a > p1->a) {\n        if (head == p1)\n          head = p0;\n        else\n          p2->next = p0;\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\n"}
{"label": "9", "index": "16381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t = 0, e, num = 0, k;\n  char z[10];\n  struct point {\n    char ID[10];\n    int age;\n  } a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &a[i].ID);\n    scanf(\"%d\", &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num = num + 1;\n    }\n  }\n  int f = num;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[t].age = a[i].age;\n      strcpy(b[t].ID, a[i].ID);\n      t++;\n    }\n    if (a[i].age < 60) {\n      b[f].age = a[i].age;\n      strcpy(b[f].ID, a[i].ID);\n      f++;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < num - i - 1; k++) {\n      if (b[k].age < b[k + 1].age) {\n        e = b[k].age;\n        b[k].age = b[k + 1].age;\n        b[k + 1].age = e;\n        strcpy(z, b[k + 1].ID);\n        strcpy(b[k + 1].ID, b[k].ID);\n        strcpy(b[k].ID, z);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", b[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct h {\n  char name[11];\n  int age;\n};\nint main() {\n  int i, k, n;\n  scanf(\"%d\", &n);\n  struct h p[100];\n  for (i = 0; i < n; i++) {\n    cin >> p[i].name >> p[i].age;\n  }\n  for (k = 100; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if (k == p[i].age)\n        cout << p[i].name << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  char a[100];\n  int b;\n  struct s *next;\n};\nint main() {\n  struct s *p1, *p2, *p0, *head, *insert(struct s * head, struct s * stud), *h;\n  int i, j, k, m, n, t, x;\n  scanf(\"%d\", &n);\n  head = 0;\n  p1 = (struct s *)malloc(sizeof(struct s));\n  h = (struct s *)malloc(sizeof(struct s));\n  p2 = head = p1;\n  p1->next = 0;\n  k = 0;\n  j = 0;\n  scanf(\"%s %d\", p1->a, &p1->b);\n  x = 0;\n  if (p1->b < 60) {\n    p2 = h = p1;\n    x = 1;\n  }\n\n  else\n    p2 = h;\n  for (i = 0; i < n - 1; i++) {\n    p0 = (struct s *)malloc(sizeof(struct s));\n    scanf(\"%s %d\", p0->a, &p0->b);\n    if (p0->b >= 60) {\n      head = insert(head, p0);\n      k++;\n    } else {\n      p2->next = p0;\n      p2 = p0;\n      j++;\n    }\n  }\n  p1 = head;\n  if (x == 0)\n    i = -1;\n  else\n    i = 0;\n  for (; i < k; i++) {\n    printf(\"%s\\n\", p1->a);\n    p1 = p1->next;\n  }\n  if (x == 0) {\n    p2 = h->next;\n    i = 0;\n  } else {\n    p2 = h;\n    i = -1;\n  }\n  for (; i < j; i++) {\n    printf(\"%s\\n\", p2->a);\n    p2 = p2->next;\n  }\n  return 0;\n}\nstruct s *insert(struct s *head, struct s *stud) {\n  struct s *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == 0) {\n    head = p0;\n    p0->next = 0;\n  } else {\n    while ((p0->b <= p1->b) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->b > p1->b) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  return (head);\n}\n"}
{"label": "9", "index": "16384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  };\n\n  int n, i, j, k;\n  struct patient p[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n\n  for (i = 1; i < n; i++) {\n    if (p[i].age >= 60) {\n      j = 0;\n      while (j < i && p[j].age >= p[i].age)\n        j++;\n      if (j < i) {\n        struct patient tmp = p[i];\n        for (k = i; k > j; k--)\n          p[k] = p[k - 1];\n        p[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct oldpeople {\n  char id[20];\n  int year;\n} old[100], old60[100], cache;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", old[i].id, &old[i].year);\n  }\n  int j = 0;\n  for (i = 0; i < n; i++) {\n    if (old[i].year >= 60) {\n      old60[j] = old[i];\n      j++;\n    }\n  }\n  int k;\n  for (i = 0; i < j; i++) {\n    for (k = 0; k < j - i; k++) {\n      if (old60[k].year < old60[k + 1].year) {\n        cache = old60[k + 1];\n        old60[k + 1] = old60[k];\n        old60[k] = cache;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << old60[i].id << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if (old[i].year < 60)\n      cout << old[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, oversix = 0, undersix = 0, osix[100], usix[100], t;\n  char noosix[100][100] = {0}, nousix[100][100] = {0}, a[100][100] = {0};\n  char s[100][100] = {0};\n  scanf(\"%d\", &n);\n  int b[100];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      oversix++;\n      osix[oversix - 1] = b[i];\n      strcpy(noosix[oversix - 1], a[i]);\n    } else {\n      undersix++;\n      usix[undersix - 1] = b[i];\n      strcpy(nousix[undersix - 1], a[i]);\n    }\n  }\n  for (int j = 0; j < oversix - 1; j++)\n    for (int i = 0; i < oversix - 1 - j; i++)\n      if (osix[i] < osix[i + 1]) {\n        t = osix[i];\n        strcpy(s[i], noosix[i]);\n        osix[i] = osix[i + 1];\n        strcpy(noosix[i], noosix[i + 1]);\n        osix[i + 1] = t;\n        strcpy(noosix[i + 1], s[i]);\n      }\n  for (int i = 0; i < oversix; i++)\n    cout << noosix[i] << \" \";\n  for (int i = 0; i < undersix; i++)\n    printf(\"%s \", nousix[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n};\n\nint main() {\n  int i, n, k = 0;\n  struct data *p1, *p2, *head;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  print(head);\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  printf(\"%s \", code->id);\n\n  if (pre == head)\n    head->next = code->next;\n  else {\n    pre->next = code->next;\n  }\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *head) {\n  struct data *p;\n  p = head->next;\n  do {\n    printf(\"%s \", p->id);\n    p = p->next;\n  } while (p != NULL);\n}\n"}
{"label": "9", "index": "16388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct hospital {\n  char ID[13];\n  int age;\n  struct hospital *next;\n};\nint main() {\n  void change(struct hospital *);\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  struct hospital *p, *head;\n  p = (struct hospital *)malloc(sizeof(struct hospital));\n  head = p;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    p->next = (struct hospital *)malloc(sizeof(struct hospital));\n    p = p->next;\n  }\n  scanf(\"%s %d\", p->ID, &p->age);\n  p->next = NULL;\n  for (i = 0; i < n; i++) {\n    for (p = head; p->next != NULL; p = p->next) {\n      if (p->age < 60 && p->next->age >= 60) {\n        change(p);\n      }\n      if (p->age >= 60 && p->next->age >= 60 && p->next->age > p->age)\n        change(p);\n    }\n  }\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s\\n\", p->ID);\n\n  return 0;\n}\nvoid change(struct hospital *p) {\n  int tempage;\n  char tempID[13];\n  struct hospital *later = p->next;\n  tempage = later->age;\n  strcpy(tempID, later->ID);\n  later->age = p->age;\n  strcpy(later->ID, p->ID);\n  p->age = tempage;\n  strcpy(p->ID, tempID);\n}\n"}
{"label": "9", "index": "16389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int age[100], i, j, k, p = 0, n;\n  char a[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &age[i]);\n    if (age[i] >= 60)\n      p++;\n  }\n  for (j = 1; j <= p; j++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (age[i] > age[k])\n        k = i;\n    }\n    printf(\"%s\\n\", a[k]);\n    age[k] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0, k;\n  int t;\n  int old[100];\n  int age[100];\n  char a[100][20];\n  char a1[100][20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%s\", a1[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    age[i] = atoi(a1[i]);\n    if (age[i] >= 60) {\n      old[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (age[old[k]] < age[old[k + 1]]) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[old[i]]);\n  for (i = 1; i <= n; i++) {\n    if (age[i] >= 60)\n      continue;\n    printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "9", "index": "16391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstruct student {\n  int a;\n  struct student *next;\n  char num[20];\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s\", p1->num);\n  scanf(\"%d\", &p1->a);\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(sizeof(struct student));\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s\", p3->num);\n    scanf(\"%d\", &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL)\n    p1 = p1->next;\n\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[11];\n    int b;\n  } p[100];\n  int n, i, j = 0, m, t;\n  char c[100][11], string[11];\n  int d[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].a, &p[i].b);\n  for (i = 0; i < n; i++) {\n    if (p[i].b >= 60) {\n      strcpy(c[j], p[i].a);\n      d[j] = p[i].b;\n      j++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - 1 - j; i++)\n      if (d[i] < d[i + 1]) {\n        t = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = t;\n        strcpy(string, c[i]);\n        strcpy(c[i], c[i + 1]);\n        strcpy(c[i + 1], string);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i], d[i]);\n  for (i = 0; i < n; i++) {\n    if (p[i].b < 60)\n      printf(\"%s\\n\", p[i].a, p[i].b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, d[100], e, f, g, i, j, x, y, z;\n  char c[100][100];\n  scanf(\"%d\", &a);\n  for (b = 0; b < a; b++) {\n    scanf(\"%s %d\", c[b], &d[b]);\n  }\n  for (e = 0; e < a; e++) {\n    if (d[e] >= 60) {\n      i = e;\n      break;\n    }\n  }\n  for (e = 0, g = 0; e < a; e++) {\n\n    if (d[e] >= 60)\n      g = g + 1;\n  }\n  for (x = 1; x <= g; x++) {\n    for (e = 0; e < a; e++) {\n      if (d[e] >= 60) {\n        if (d[i] < d[e])\n          i = e;\n      }\n    }\n    cout << c[i] << \" \";\n    d[i] = 0;\n  }\n  for (z = 0; z < a; z++) {\n    if (d[z] != 0)\n      printf(\"%s \", c[z]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16394", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct point {\n    char id[10];\n    int age;\n  } points[100], news[100], tmp;\n  for (i = 0; i < n; i++) {\n    cin >> points[i].id >> points[i].age;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (points[j + 1].age >= 60 && points[j + 1].age > points[j].age) {\n        tmp = points[j + 1];\n        points[j + 1] = points[j];\n        points[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", points[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, t;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  char p[1][10];\n  int g[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &g[j]);\n  for (j = n - 1; j > 0; j--)\n    for (k = n - 1; k > n - j - 1; k--) {\n      if (g[k] >= 60) {\n        if (g[k] > g[k - 1]) {\n          t = g[k - 1];\n          g[k - 1] = g[k];\n          g[k] = t;\n          strcpy(p[0], a[k - 1]);\n          strcpy(a[k - 1], a[k]);\n          strcpy(a[k], p[0]);\n        }\n      }\n    }\n  for (k = 0; k < n; k++)\n    cout << a[k] << \" \";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16396", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char id[100][100];\n  int age[100];\n  int n;\n  int i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &age[i]);\n  }\n\n  int e;\n  char t[13];\n\n  char id1[100][13];\n  int age1[100];\n  char id2[100][13];\n  int age2[100];\n  int x = 0, y = 0;\n\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[x] = age[i];\n      strcpy(id1[x], id[i]);\n      x++;\n    }\n\n    if (age[i] < 60) {\n      age2[y] = age[i];\n      strcpy(id2[y], id[i]);\n      y++;\n    }\n  }\n\n  for (k = 1; k < x; k++) {\n    for (i = 0; i < x - k; i++) {\n      if (age1[i] < age1[i + 1]) {\n        e = age1[i + 1];\n        age1[i + 1] = age1[i];\n        age1[i] = e;\n\n        strcpy(t, id1[i + 1]);\n        strcpy(id1[i + 1], id1[i]);\n        strcpy(id1[i], t);\n      }\n    }\n  }\n\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", id1[i]);\n  }\n\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Patient {\n  char num[10];\n  int age;\n  struct Patient *next;\n};\nint main() {\n  void paixu(int n, struct Patient *head);\n  struct Patient *creat(int n);\n  int n, i;\n  struct Patient *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(n, head);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", head->num);\n    head = head->next;\n  }\n  return 0;\n}\nstruct Patient *creat(int n) {\n  int i;\n  struct Patient *head, *thispoint, *nextpoint;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      head = nextpoint;\n      thispoint = head;\n    } else {\n      nextpoint = (struct Patient *)malloc(sizeof(struct Patient));\n      scanf(\"%s %d\", nextpoint->num, &nextpoint->age);\n      thispoint->next = nextpoint;\n      thispoint = nextpoint;\n    }\n  }\n  thispoint->next = NULL;\n  return head;\n}\nvoid paixu(int n, struct Patient *head) {\n  int i, j, k, count;\n  struct Patient *p1, *p2, *p3, *p4;\n  char tempnum[10], tempnum3[10], tempnum4[10];\n  int tempage, tempage3, tempage4;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    if (p1->age < 60) {\n      p2 = p1->next;\n      for (j = i + 1; j < n; j++) {\n        if (p2->age > 59) {\n          strcpy(tempnum, p2->num);\n          tempage = p2->age;\n          p3 = p1;\n          p4 = p3->next;\n          for (k = i; k < j; k++) {\n            strcpy(tempnum4, p4->num);\n            tempage4 = p4->age;\n            if (k == i) {\n              strcpy(p4->num, p3->num);\n              p4->age = p3->age;\n            } else {\n              strcpy(p4->num, tempnum3);\n              p4->age = tempage3;\n            }\n            strcpy(tempnum3, tempnum4);\n            tempage3 = tempage4;\n            p3 = p3->next;\n            p4 = p4->next;\n          }\n          strcpy(p1->num, tempnum);\n          p1->age = tempage;\n          break;\n        } else\n          p2 = p2->next;\n      }\n    }\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 0, count = 0; i < n; i++) {\n    if (p1->age > 59)\n      count++;\n\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < count; i++) {\n    p2 = p1;\n    for (j = 0; j < count - i; j++) {\n      p3 = p2->next;\n      if (p2->age < p3->age) {\n        strcpy(tempnum, p2->num);\n        tempage = p2->age;\n        strcpy(p2->num, p3->num);\n        p2->age = p3->age;\n        strcpy(p3->num, tempnum);\n        p3->age = tempage;\n      }\n      p2 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "16398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct people {\n    char id[30];\n    int age;\n  } x[100], y[100], z;\n  int a, b, c, e, i, j = 0, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[k].id, &x[k].age);\n    if (x[k].age >= 60) {\n      y[j].age = x[k].age;\n      strcpy(y[j].id, x[k].id);\n      j = j + 1;\n      k = k - 1;\n    }\n    k = k + 1;\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (y[k].age < y[k + 1].age) {\n        z = y[k + 1];\n        y[k + 1] = y[k];\n        y[k] = z;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", y[i].id);\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", x[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0, sum = 59;\n  int a[100], b[100];\n  char c[101][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      } else\n        continue;\n    }\n    a[k] = -1;\n    b[j] = k;\n    sum = 59;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[b[i]]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 0 && a[i] < 60)\n      cout << c[i] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct Node {\n  char ID[11];\n  int age;\n  struct Node *next;\n} node;\nnode *creat(int n) {\n  node *p1, *p2, *head;\n  int i;\n  p1 = p2 = (node *)malloc(sizeof(node));\n  head = p1;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    scanf(\"%s%d\", p1->ID, &p1->age);\n    p1 = (node *)malloc(sizeof(node));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sort(int x, char *a, node *head) {\n  node *pre = head, *p = pre->next, *s;\n  s = (node *)malloc(sizeof(node));\n  s->age = x;\n  strcpy(s->ID, a);\n  s->next = NULL;\n  while (p != NULL && x <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\nvoid print(node *head) {\n  node *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  node *head1, *head2, *p;\n  scanf(\"%d\", &n);\n  head1 = creat(n);\n  head2 = (node *)malloc(sizeof(node));\n  strcpy(head2->ID, \" \");\n  head2->next = NULL;\n  p = head1;\n  while (p != NULL) {\n    if (p->age >= 60)\n      sort(p->age, p->ID, head2);\n    p = p->next;\n  }\n  head2 = head2->next;\n  print(head2);\n  p = head1;\n  while (p != NULL) {\n    if (p->age < 60)\n      cout << p->ID << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    int id[7];\n    int age;\n  } patient[100];\n  int i, n, max = 0, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  for (k = max; k > 59; k--) {\n    for (i = 0; i < n; i++)\n      if (patient[i].age == k)\n        cout << patient[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60)\n      printf(\"%s\\n\", patient[i].id);\n  }\n}\n"}
{"label": "9", "index": "16402", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  struct peo sixty[100];\n\n  int n, b = 0, i, k, e;\n  char a[11];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i].age = people[i].age;\n      strcpy(sixty[i].id, people[i].id);\n      b += 1;\n    } else {\n      strcpy(sixty[i].id, \"0000\");\n      sixty[i].age = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1].age < sixty[i].age) {\n        e = sixty[i - 1].age;\n        sixty[i - 1].age = sixty[i].age;\n        sixty[i].age = e;\n        strcpy(a, sixty[i - 1].id);\n        strcpy(sixty[i - 1].id, sixty[i].id);\n        strcpy(sixty[i].id, a);\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s\\n\", sixty[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patients {\n    char id[10];\n    int age;\n  } temp;\n  struct patients patient[100];\n  struct patients old[100];\n  int i, j, n, first;\n  scanf(\"%d\", &n);\n  first = 0;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id;\n    cin >> patient[i].age;\n    if (patient[i].age >= 60) {\n      old[first] = patient[i];\n      first = first + 1;\n    }\n  }\n  for (i = 0; i < first; i++) {\n    for (j = 0; j < first - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < first; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      cout << patient[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16404", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct person {\n    char id[10];\n    int age;\n  } m[100], b[100];\n  int n, t, i, j;\n  char temp[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", m[i].id);\n    strcpy(b[i].id, m[i].id);\n    scanf(\"%d\", &m[i].age);\n    b[i].age = m[i].age;\n  }\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (m[j].age < m[j + 1].age) {\n        t = m[j].age;\n        m[j].age = m[j + 1].age;\n        m[j + 1].age = t;\n        strcpy(temp, m[j].id);\n        strcpy(m[j].id, m[j + 1].id);\n        strcpy(m[j + 1].id, temp);\n      }\n    }\n  for (i = 0; i < n; i++)\n    if (m[i].age >= 60)\n      printf(\"%s\\n\", m[i].id);\n  for (i = 0; i < n; i++)\n    if (b[i].age < 60)\n      printf(\"%s\\n\", b[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int age, he;\n  char num[15];\n  struct st *next;\n};\n\nstruct st *creat(int n) {\n  struct st *head, *p1, *p2;\n  int i, h = 105;\n  p1 = (struct st *)malloc(sizeof(struct st));\n  p2 = p1;\n  head = p1;\n  for (i = 1; i <= n; i++) {\n    p1 = (struct st *)malloc(sizeof(struct st));\n    cin >> p1->num >> p1->age;\n    if (p1->age >= 60)\n      p1->he = p1->age * 1000 + h;\n    else {\n      p1->he = h;\n    }\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    h--;\n  }\n  return (head);\n}\n\nvoid paixu(struct st *head) {\n  struct st *max, *p, *p1, *p2, *p3, *p4;\n  p1 = head;\n  while (p1->next) {\n    p2 = p1->next;\n    max = p2;\n    p4 = p2;\n    p = p2->next;\n    while (p) {\n      if (p->he > max->he) {\n        max = p;\n        p3 = p4;\n      }\n      p = p->next;\n      p4 = p4->next;\n    }\n    if (max > p1->next) {\n      p3->next = max->next;\n      p1->next = max;\n      max->next = p2;\n    }\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  struct st *creat(int n);\n  void paixu(struct st * head);\n  struct st *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  paixu(head);\n  p = head->next;\n  while (p) {\n    cout << p->num << \"\\n\";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16406", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], e;\n  char s[100][100], str[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] >= 60 && a[i + 1] >= 60) {\n        if (a[i] >= a[i + 1]) {\n          continue;\n        }\n        if (a[i] < a[i + 1]) {\n          strcpy(str, s[i + 1]);\n          strcpy(s[i + 1], s[i]);\n          strcpy(s[i], str);\n          e = a[i + 1];\n          a[i + 1] = a[i];\n          a[i] = e;\n        }\n      }\n      if (a[i] >= 60 && a[i + 1] < 60) {\n        continue;\n      }\n      if (a[i] < 60 && a[i + 1] >= 60) {\n        strcpy(str, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], str);\n        e = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = e;\n      }\n      if (a[i] < 60 && a[i + 1] < 60) {\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct old {\n    char ID[10];\n    int age;\n  };\n  struct old ill[100];\n  struct old t1[100];\n  struct old t2[100];\n\n  int n, i, j = 0, k = 0, num60 = 0, num0 = 0, b[100] = {0}, p, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> ill[i].ID;\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      t1[j] = ill[i];\n      j++;\n      num60++;\n    } else {\n      t2[k] = ill[i];\n      k++;\n      num0++;\n    }\n  }\n  for (i = 0; i < num60; i++) {\n    p = 0;\n    for (j = 0; j < num60; j++) {\n      if (t1[j].age > p && b[j] == 0) {\n        p = t1[j].age;\n        num = j;\n      }\n    }\n    printf(\"%s\\n\", t1[num].ID);\n    b[num] = 1;\n  }\n  for (i = 0; i < num0; i++)\n    printf(\"%s\\n\", t2[i].ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ID[100][10] = {'\\0'}, young[100][10] = {'\\0'}, old[100][10] = {'\\0'},\n       wae[100] = {'\\0'};\n  int age[100] = {0}, y[100] = {0}, o[100] = {0};\n  int i, n;\n  int m = 0, k = 0, temp = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", ID[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(young[m], ID[i]);\n      y[m] = age[i];\n      m++;\n    } else {\n      strcpy(old[k], ID[i]);\n      o[k] = age[i];\n      k++;\n    }\n  }\n  for (a = 0; a < k - 1; a++) {\n    for (b = 0; b < k - a - 1; b++) {\n      if (o[b] < o[b + 1]) {\n        temp = o[b];\n        o[b] = o[b + 1];\n        o[b + 1] = temp;\n        strcpy(wae, old[b]);\n        strcpy(old[b], old[b + 1]);\n        strcpy(old[b + 1], wae);\n      }\n    }\n  }\n  for (a = 0; a < k; a++)\n    printf(\"%s\\n\", old[a]);\n  for (b = 0; b < m; b++)\n    printf(\"%s\\n\", young[b]);\n  return 0;\n}\n"}
{"label": "9", "index": "16409", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  struct point {\n    char x[10];\n    int y;\n  } sz[100];\n  struct po {\n    char a[10];\n    int b;\n    int c;\n  } lnr[100];\n  int n, temp;\n  int tag = 0;\n  char tem[100];\n  int count = 0;\n\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s%d\", sz[i].x, &sz[i].y);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = tag; k < n; k++) {\n      if (sz[k].y >= 60) {\n        lnr[j].c = k;\n        lnr[j].b = sz[k].y;\n        strcpy(lnr[j].a, sz[k].x);\n        tag = k + 1;\n        count++;\n        break;\n      }\n    }\n  }\n  for (int l = 0; l < count - 1; l++) {\n    for (int m = count - 1; m > l; m--) {\n      if (lnr[m].b > lnr[m - 1].b) {\n        temp = lnr[m - 1].b;\n        lnr[m - 1].b = lnr[m].b;\n        lnr[m].b = temp;\n\n        strcpy(tem, lnr[m - 1].a);\n        strcpy(lnr[m - 1].a, lnr[m].a);\n        strcpy(lnr[m].a, tem);\n      }\n    }\n  }\n  tag = n - 1;\n  for (int o = n - 1; o > count - 1; o--) {\n    for (int p = tag; p >= 0; p--) {\n      if (sz[p].y < 60) {\n        sz[o].y = sz[p].y;\n        strcpy(sz[o].x, sz[p].x);\n        tag = p - 1;\n        break;\n      }\n    }\n  }\n  for (int q = 0; q < count; q++) {\n    printf(\"%s\\n\", lnr[q].a);\n  }\n  for (int r = count; r < n; r++) {\n    printf(\"%s\\n\", sz[r].x);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct people {\n    char id[30];\n    int age;\n  } x[100], y[100], z;\n  int a, b, c, e, i, j = 0, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[k].id, &x[k].age);\n    if (x[k].age >= 60) {\n      y[j].age = x[k].age;\n      strcpy(y[j].id, x[k].id);\n      j = j + 1;\n      k = k - 1;\n    }\n    k = k + 1;\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (y[k].age < y[k + 1].age) {\n        z = y[k + 1];\n        y[k + 1] = y[k];\n        y[k] = z;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", y[i].id);\n  for (i = 0; i < n - j; i++)\n    printf(\"%s\\n\", x[i].id);\n}\n"}
{"label": "9", "index": "16411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char str[10];\n  int a;\n\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i = 0;\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->str, &p1->a);\n  head = NULL;\n  while (i < n - 1) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->str >> p1->a;\n  }\n  p2->next = p1;\n  p2 = (struct student *)malloc(1000);\n  p2 = p1;\n  p2->next = NULL;\n\n  return (head);\n}\nint main() {\n  int n, i, j;\n  struct student *head, *p1, *p2, *p3, *p4, *p5, *p6;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  char c[10];\n  int t;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    p2 = p1->next;\n\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->a > 59 && p2->a > p1->a)\n\n      {\n        strcpy(c, p2->str);\n        strcpy(p2->str, p1->str);\n        strcpy(p1->str, c);\n        t = p1->a;\n        p1->a = p2->a;\n        p2->a = t;\n      }\n\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  p5 = head;\n  for (i = 0; i < n; i++) {\n\n    { printf(\"%s \", p5->str); }\n    p5 = p5->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16413", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct point {\n    char id[10];\n    int age;\n  } patient[100];\n  int n;\n  int i, j, k;\n  int on = 0, old[100], flag;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n  }\n  for (j = 120; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (patient[i].age == j) {\n        printf(\"%s\\n\", patient[i].id);\n        old[on] = i;\n        on++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < on; k++) {\n      if (i == old[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      printf(\"%s\\n\", patient[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct bingren {\n  char id[10];\n  int o;\n} bingren[201];\nint main() {\n  int n, i, j, y, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> bingren[i].id >> bingren[i].o;\n  }\n  for (i = 0, j = 100; i < n; i++) {\n\n    if (bingren[i].o >= 60) {\n      bingren[j] = bingren[i];\n      j++;\n    }\n  }\n  y = j;\n  for (j = 0; j < y - 1; j++) {\n    for (i = 100; i < y - j; i++) {\n      if (bingren[i].o < bingren[i + 1].o) {\n        bingren[200] = bingren[i];\n        bingren[i] = bingren[i + 1];\n        bingren[i + 1] = bingren[200];\n      }\n    }\n  }\n  for (i = 100; i < y; i++) {\n    printf(\"%s\\n\", bingren[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].o < 60)\n      printf(\"%s\\n\", bingren[i].id);\n  }\n}\n"}
{"label": "9", "index": "16415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b[101], b1[101], t, h, k;\n  char a[101][11] = {0}, a1[101][11] = {0}, s1[11];\n  scanf(\"%d\", &n);\n  for (i = 0, h = 0, k = 0; i <= n - 1; i++) {\n    cin >> s1 >> t;\n    if (t >= 60) {\n      b[h] = t;\n      strcpy(a[h], s1);\n      h++;\n    } else {\n      b1[k] = t;\n      strcpy(a1[k], s1);\n      k++;\n    }\n  }\n  for (i = 0; i <= h - 2; i++) {\n    for (j = 0; j <= h - 2 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        strcpy(s1, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], s1);\n      }\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << a1[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct pat {\n  char id[11];\n  int age;\n  struct pat *next;\n};\n\nvoid find(struct pat *head, struct pat *s) {\n  struct pat *pre = head, *p = pre->next;\n  while (p != NULL && s->age <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nvoid sort(struct pat *head, int x, char name[11]) {\n  struct pat *pre = head, *p = pre->next, *s;\n  s = (struct pat *)malloc(sizeof(struct pat));\n  s->age = x;\n  strcpy(s->id, name);\n  s->next = NULL;\n  if (x >= 60)\n    find(head, s);\n  else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nint main() {\n\n  struct pat *head, *p;\n  int n, x, i;\n  char name[11];\n  head = (struct pat *)malloc(sizeof(struct pat));\n  head->next = NULL;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", name, &x);\n    sort(head, x, name);\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  char id[100][10];\n  int old[100];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &old[i]);\n  }\n\n  int e;\n  char s[100][10];\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < n - j; k++) {\n      if (old[k] < old[k + 1] && old[k + 1] >= 60) {\n        e = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = e;\n        strcpy(s[k], id[k + 1]);\n        strcpy(id[k + 1], id[k]);\n        strcpy(id[k], s[k]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } ren[100];\n  struct oldp {\n    char idold[11];\n    int ageold;\n  } oldren[100];\n  struct youngp {\n    char idyoung[11];\n    int ageyoung;\n  } youngren[100]; \n  int old[100], young[100];\n  int n, i, t, j, oldindex = 0, youngindex = 0;\n  char num[4], idinter[11];\n\n  cin >> num;\n  n = atoi(num);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ren[i].id, &ren[i].age); \n  }\n  for (i = 0; i < n; i++) {\n    if (ren[i].age >= 60) {\n      oldren[oldindex].ageold = ren[i].age;\n      strcpy(oldren[oldindex].idold, ren[i].id);\n      oldindex += 1; \n    } else {\n      youngren[youngindex].ageyoung = ren[i].age;\n      strcpy(youngren[youngindex].idyoung, ren[i].id);\n      youngindex += 1;\n    } \n  }\n  for (i = 1; i < oldindex; i++) {\n    for (j = 0; j < oldindex - i; j++) {\n      if (oldren[j].ageold < oldren[j + 1].ageold) {\n        t = oldren[j].ageold;\n        oldren[j].ageold = oldren[j + 1].ageold;\n        oldren[j + 1].ageold = t;         \n        strcpy(idinter, oldren[j].idold); \n        strcpy(oldren[j].idold, oldren[j + 1].idold);\n        strcpy(oldren[j + 1].idold, idinter);\n      }\n    }\n  }\n  for (i = 0; i < oldindex; i++) {\n    printf(\"%s \", oldren[i].idold);\n  }\n  for (i = 0; i < youngindex; i++) {\n    printf(\"%s \", youngren[i].idyoung);\n  }\n}\n"}
{"label": "9", "index": "16419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num;\n  scanf(\"%d\", &num);\n  p2 = NULL;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  while (num > 0) {\n    p2 = p1;\n    cin >> p1->ID >> p1->age;\n    p1 = (struct patient *)malloc(1000);\n    p2->next = p1;\n    num--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct patient *sort(struct patient *head) {\n  struct patient *first;\n  struct patient *tail;\n  struct patient *p_max;\n  struct patient *max;\n  struct patient *p;\n  first = NULL;\n  while (head != NULL) {\n    for (p = head, max = head; p->next != NULL; p = p->next) {\n      if (p->next->age > max->age && p->next->age >= 60) {\n        p_max = p;\n        max = p->next;\n      }\n    }\n    if (first == NULL) {\n      first = max;\n      tail = max;\n    } else {\n      tail->next = max;\n      tail = max;\n    }\n    if (max == head) {\n      head = head->next;\n    } else {\n      p_max->next = max->next;\n    }\n  }\n  if (first != NULL) {\n    tail->next = NULL;\n  }\n  head = first;\n  return head;\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->ID << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  int n, i, j;\n  head = creat();\n  head = sort(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "9", "index": "16420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} a[100];\nint main() {\n  int n, i, k, e;\n  char p[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].age;\n    if (a[i].age >= 60) {\n      for (k = 0; i - k >= 1; k++) {\n        if (a[i - k].age > a[i - k - 1].age) {\n          e = a[i - k].age;\n          a[i - k].age = a[i - k - 1].age;\n          a[i - k - 1].age = e;\n\n          strcpy(p, a[i - k].id);\n          strcpy(a[i - k].id, a[i - k - 1].id);\n          strcpy(a[i - k - 1].id, p);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  char ID[10];\n  int age;\n};\nint main() {\n  int n, i, t;\n  struct people peo[100];\n  struct people old[100];\n  void bubble(struct people a[100], int n);\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo[i].ID);\n    scanf(\"%d\", &peo[i].age);\n  }\n\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      strcpy(old[t].ID, peo[i].ID);\n      old[t].age = peo[i].age;\n      t++;\n    } else\n      continue;\n  }\n  bubble(old, t);\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", old[i].ID);\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60)\n      printf(\"%s\\n\", peo[i].ID);\n  }\n}\n\nvoid bubble(struct people a[100], int n) {\n  int i, j;\n  struct people t;\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++) {\n      if (a[j].age < a[j + 1].age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n}\n"}
{"label": "9", "index": "16422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100][1000 + 1];\n  char g[100][1000 + 1];\n  int h[100];\n  int k[100], a, i, j;\n  char q[100];\n  int n, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &k[i]);\n  }\n  a = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (k[i] >= 60) {\n      a++;\n      h[j] = k[i];\n      strcpy(g[j], s[i]);\n      j++;\n      k[i] = 0;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (h[j] < h[j + 1]) {\n        e = h[j];\n        h[j] = h[j + 1];\n        h[j + 1] = e;\n        strcpy(q, g[j]);\n        strcpy(g[j], g[j + 1]);\n        strcpy(g[j + 1], q);\n      }\n    }\n  }\n  for (i = 0; i < a; i++)\n    printf(\"%s \", g[i]);\n\n  for (i = 0; i < n; i++) {\n    if (k[i] != 0)\n      printf(\"%s \", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16423", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int y;\n  struct p *next;\n};\nint n;\nstruct p *creat(void) {\n  struct p *head, *p1, *p2;\n  int i;\n  cin >> n;\n  p1 = p2 = (struct p *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d \", p1->id, &p1->y);\n    if (i == 0)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nvoid px(struct p *head) {\n  struct p *p;\n  int k, t;\nleap:\n  t = 0;\n  for (p = head; p != 0;) {\n    if (p->y >= 60)\n      t = 1;\n    p = p->next;\n  }\n  if (t == 1) {\n    p = head;\n    k = p->y;\n    for (; p != 0;) {\n      if (p->y > k)\n        k = p->y;\n      p = p->next;\n    }\n    for (p = head; p != 0;) {\n      if (p->y == k) {\n        printf(\"%s \", p->id);\n        p->y = 0;\n      }\n      p = p->next;\n    }\n    goto leap;\n  }\n  for (p = head; p != 0;) {\n    if (p->y != 0)\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct p *p;\n  p = creat();\n  px(p);\n}\n"}
{"label": "9", "index": "16424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100], i, j;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  int k = 0;\n  char shuchu[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n    if (age[i] < 60)\n      strcpy(shuchu[k++], id[i]);\n  }\n  char mid[100][10];\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        strcpy(mid[j], id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], mid[j]);\n      }\n    }\n  }\n  if (age[0] < 60)\n    goto E;\n  else {\n    for (i = 0; age[i] >= 60; i++)\n      printf(\"%s\\n\", id[i]);\n  }\nE:;\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", shuchu[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[11];\n    int age;\n    struct pa *next;\n  } * head, *p1, *p2, *p3, *p4;\n  int tage;\n  char tID[11];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pa *)malloc(sizeof(struct pa));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    if (i != 0)\n      p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = NULL;\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < n; i++) \n  {\n    p3 = p1;\n    p4 = p2;\n    for (j = 0; j < n - 1; j++) {\n      if (p3->age < p4->age && p4->age >= 60) {\n        strcpy(tID, p3->ID);\n        tage = p3->age;\n        strcpy(p3->ID, p4->ID);\n        p3->age = p4->age;\n        strcpy(p4->ID, tID);\n        p4->age = tage;\n      }\n      p3 = p3->next;\n      p4 = p4->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    printf(\"%s\\n\", p1->ID);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} p[100];\n\nint main() {\n  int i, j = 0, k = 0, t, l, n;\n  char other[100][10], a[10];\n  struct patient old[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].num, &p[i].age);\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n\n      strcpy(old[j].num, p[i].num);\n      old[j].age = p[i].age;\n      j++;\n    } else {\n      strcpy(other[k], p[i].num);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (l = 0; l < j - 1 - i; l++) {\n      if (old[l].age < old[l + 1].age) {\n        t = old[l].age;\n        old[l].age = old[l + 1].age;\n        old[l + 1].age = t;\n\n        strcpy(a, old[l].num);\n        strcpy(old[l].num, old[l + 1].num);\n        strcpy(old[l + 1].num, a);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].num);\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", other[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct guahao {\n  char num[20];\n  int year;\n};\nint main() {\n  int n, i, m;\n  struct guahao temp, *p, *t, *p1;\n  scanf(\"%d\", &n);\n  m = n;\n  struct guahao *bingren = (struct guahao *)malloc(sizeof(struct guahao) * n);\n  struct guahao *bingren1 = (struct guahao *)malloc(sizeof(struct guahao) * m);\n  p = bingren;\n  p1 = bingren1;\n  for (; p < bingren + n; p++, p1++) {\n    cin >> p->num >> p->year;\n    *p1 = *p;\n  }\n  p = bingren;\n  for (i = 0; p < bingren + n - 1; p++, i++) {\n    for (t = bingren; t < bingren + n - 1 - i; t++) {\n      if ((*t).year < (*(t + 1)).year) {\n        temp = *t;\n        *t = *(t + 1);\n        *(t + 1) = temp;\n      }\n    }\n  }\n  p = bingren;\n  for (; p < bingren + n; p++) {\n    if ((*p).year >= 60) {\n      printf(\"%s\\n\", p->num);\n    }\n  }\n  for (p1 = bingren1; p1 < bingren1 + m; p1++) {\n    if ((*p1).year < 60) {\n      printf(\"%s\\n\", p1->num);\n    }\n  }\n  free(bingren);\n  free(bingren1);\n  return 0;\n}\n"}
{"label": "9", "index": "16428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct xinxi {\n    char id[10];\n    int year;\n  } xinxi[100], b[100], p;\n\n  int i, j, k, a = 0, c = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", xinxi[i].id, &(xinxi[i].year));\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) >= 60) {\n      b[a] = xinxi[i];\n      a++;\n    }\n  }\n\n  for (k = 1; k < a; k++) {\n    for (j = 0; j < a - k; j++) {\n      if (b[j].year < b[j + 1].year) {\n        p = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = p;\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    cout << b[j].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) < 60) {\n      printf(\"%s\\n\", xinxi[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n;\n  char id[200][200];\n  int age[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 200; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (age[i] == j)\n        printf(\"%s \", id[i]);\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] < 60) {\n      printf(\"%s \", id[i]);\n    }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  char a[100][10], over[100][10], below[100][10];\n  char h[100][10];\n  long int b[100];\n  long int c[100] = {0};\n  long int d[100] = {0};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i] >> b[i];\n  }\n\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= 60) {\n      c[i] = b[i];\n      strcpy(over[i], a[i]);\n    } else {\n      d[i] = b[i];\n      strcpy(below[i], a[i]);\n    }\n  }\n  for (k = 101; k >= 60; k--) {\n    i = 1;\n    while (i <= n) {\n      if (c[i] == k) {\n        printf(\"%s\\n\", over[i]);\n      }\n      i++;\n    }\n  }\n  i = 1;\n  while (i <= n) {\n    if (d[i] != 0)\n      printf(\"%s\\n\", below[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16431", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, h = 0, k = 1, b = 0;\n  char a[120][20], c[120][20];\n  int y[120], Z[155][100] = {0}, cy[120];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a[i], &y[i]);\n  }\n\n  for (i = 60; i <= 150; i++) {\n    for (j = 1; j <= n; j++) {\n      Z[i][h] = 0;\n      if (i == y[j]) {\n        Z[i][h] = j;\n        h++;\n      }\n    }\n    h = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] < 60) {\n      strcpy(c[k], a[i]);\n      cy[k] = y[i];\n      b = k;\n      k++;\n    }\n  }\n\n  h = 0;\n  for (i = 150; i >= 60; i--) {\n    for (h = 0; h <= 10; h++) {\n      if (Z[i][h] == 0)\n        break;\n      else {\n        printf(\"%s\\n\", a[Z[i][h]]);\n      }\n    }\n  }\n  for (i = 1; i <= b; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } patients[100];\n  struct old {\n    char ido[10];\n    int ao;\n  } olds[100];\n  struct young {\n    char idy[10];\n    int ay;\n  } youngs[100];\n  int n, y = 0, o = 0, so = 0, sy = 0, e;\n  scanf(\"%d\", &n);\n  char f[10];\n  for (int j = 0; j < n; j++) {\n    scanf(\"%s\", patients[j].id);\n    scanf(\"%d\", &patients[j].a);\n    if (patients[j].a < 60) {\n      strcpy(youngs[y].idy, patients[j].id);\n      youngs[y].ay = patients[j].a;\n      y++;\n    }\n    if (patients[j].a >= 60) {\n      strcpy(olds[o].ido, patients[j].id);\n      olds[o].ao = patients[j].a;\n      o++;\n    }\n  }\n  for (int r = o - 1; r > 0; r--) {\n    for (int i = 0; i < r; i++) {\n      if (olds[i].ao < olds[i + 1].ao) {\n        e = olds[i + 1].ao;\n        olds[i + 1].ao = olds[i].ao;\n        olds[i].ao = e;\n        strcpy(f, olds[i + 1].ido);\n        strcpy(olds[i + 1].ido, olds[i].ido);\n        strcpy(olds[i].ido, f);\n      }\n    }\n  }\n  for (int l = 0; l <= o - 1; l++) {\n    cout << olds[l].ido << \"\\n\";\n  }\n  for (int m = 0; m <= y - 1; m++) {\n    printf(\"%s\\n\", youngs[m].idy);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, k, e, m;\n  int a[100];\n\n  char b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] >= 60 && a[j] > a[j - 1]) {\n        m = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = m;\n        char t[10];\n\n        strcpy(t, b[j]);\n        strcpy(b[j], b[j - 1]);\n        strcpy(b[j - 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16434", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  struct pe {\n    char id[100];\n    int y;\n  } * p;\n  p = (struct pe *)malloc(sizeof(pe) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (p + i)->id, &(p + i)->y);\n  }\n\n  struct pe tp;\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((p + j + 1)->y >= 60 && (p + j)->y < (p + j + 1)->y) {\n        tp = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = tp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (p + i)->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0;\n  struct person t, *s, o[1000], y[1000];\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", s[i].id, &s[i].y);\n  for (i = 0; i < n; i++)\n    if (s[i].y >= 60) {\n      o[k] = s[i];\n      k++;\n    } else {\n      y[m] = s[i];\n      m++;\n    }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k - i; j++)\n      if (o[j].y < o[j + 1].y) {\n        t = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = t;\n      }\n  }\n  for (i = 0; i < k; i++)\n    cout << o[i].id << \"\\n\";\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", y[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, i;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  int b[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &b[j]);\n  for (i = 100; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == i)\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    if (b[j] < 60)\n      printf(\"%s\\n\", a[j]);\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16437", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n  struct man *next;\n};\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nstruct man *insert(struct man *head, struct man *stud, int n) {\n  struct man *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  cin >> p0->num >> p0->age;\n  p0->nu = n + 1;\n  p0->next = NULL;\n  if (head == NULL)\n    head = p0;\n  else {\n    while ((f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) < 0) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (f(p0->num, p0->age, p0->nu, p1->num, p1->age, p1->nu) > 0) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n    }\n  }\n  return (head);\n}\nvoid print(struct man *head, int n) {\n  struct man *p;\n  int k;\n  p = head;\n  for (k = 0; k < n; k++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\nint main() {\n  int n, k;\n  struct man *head, *stu;\n  head = NULL;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    stu = (struct man *)malloc(1000);\n    head = insert(head, stu, k);\n  }\n  print(head, n);\n}\n"}
{"label": "9", "index": "16438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int num) {\n  struct patient *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = NULL;\n  while (n < (num - 1)) {\n    n = n + 1;\n    if (n == 1) {\n      head = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct patient *old(struct patient *head) {\n  struct patient *old, *p1, *p2, *p;\n  n = 0;\n  p = head;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  old = NULL;\n  while (p != NULL) {\n    if ((n == 0) && (p->age >= 60)) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      old = p1;\n      p2 = p1;\n      n = 1;\n    } else if (p->age >= 60) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      p2->next = p1;\n      p2 = p1;\n    }\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p = p->next;\n  }\n  p2->next = NULL;\n  return (old);\n}\nstruct patient *sort(struct patient *head) {\n  struct patient head0, end0;\n  struct patient *p0, *p1, *p2, *p;\n  head0.next = head;\n  p = head;\n  while (p->next != NULL)\n    p = p->next;\n  p = p->next = &end0;\n  while (p != head0.next) {\n    p0 = &head0;\n    p1 = p0->next;\n    p2 = p1->next;\n    while (p2 != p) {\n      if ((p1->age) < (p2->age)) {\n        p0->next = p2;\n        p1->next = p2->next;\n        p2->next = p1;\n        p0 = p2;\n        p2 = p1->next;\n      } else {\n        p0 = p1;\n        p1 = p2;\n        p2 = p2->next;\n      }\n    }\n    p = p1;\n  }\n  while (p->next != &end0)\n    p = p->next;\n  p->next = NULL;\n  return (p1);\n}\nvoid print2(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    if (p->age < 60)\n      cout << p->id << \"\\n\", p = p->next;\n    else\n      p = p->next;\n  }\n}\nvoid print1(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->id << \"\\n\";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *creat(int num);\n  struct patient *old(struct patient * head);\n  struct patient *sort(struct patient * head);\n  void print1(struct patient * head);\n  void print2(struct patient * head);\n  struct patient *head, *oldp, *sortold;\n  int num;\n  scanf(\"%d\", &num);\n  head = creat(num);\n  oldp = old(head);\n  sortold = sort(oldp);\n  print1(sortold);\n  print2(head);\n}\n"}
{"label": "9", "index": "16439", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ID[1000][1000], IDup60[1000][1000], IDunder60[1000][1000], s[1000];\n  int b, h, i, j, k, l, m, max = 0, n, o, p, q, t = 0, u = 0, YearOld[1000],\n                           YearOldup60[1000], id[1000], idup60[1000];\n  cin >> n;\n  for (h = 0; h < n; h++) {\n    scanf(\"%s %d\", ID[h], &YearOld[h]);\n    id[h] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; ID[i][j] != '\u0000'; j++) {\n      id[i] = 10 * id[i];\n      id[i] = id[i] + (ID[i][j] - '0');\n    }\n  }\n  for (m = 0; m < n; m++) {\n    if (YearOld[m] > max)\n      max = YearOld[m];\n  }\n  for (k = 0; k <= max; k++) {\n    for (l = 0; l < n; l++) {\n      if (YearOld[l] == max - k && max - k >= 60) {\n        YearOldup60[t] = YearOld[l];\n        idup60[t] = id[l];\n        strcpy(IDup60[t], ID[l]);\n        t++;\n      }\n    }\n  }\n  for (b = 0; b < n; b++) {\n    if (YearOld[b] < 60) {\n      strcpy(IDunder60[u], ID[b]);\n      u++;\n    }\n  }\n  for (p = 0; p < t; p++) {\n    printf(\"%s \", IDup60[p]);\n  }\n  for (q = 0; q < u; q++) {\n    printf(\"%s \", IDunder60[q]);\n  }\n}\n"}
{"label": "9", "index": "16440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, oversix = 0, undersix = 0, osix[100], usix[100], t;\n  char noosix[100][100] = {0}, nousix[100][100] = {0}, a[100][100] = {0};\n  char s[100][100] = {0};\n  scanf(\"%d\", &n);\n  int b[100];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      oversix++;\n      osix[oversix - 1] = b[i];\n      strcpy(noosix[oversix - 1], a[i]);\n    } else {\n      undersix++;\n      usix[undersix - 1] = b[i];\n      strcpy(nousix[undersix - 1], a[i]);\n    }\n  }\n  for (int j = 0; j < oversix - 1; j++)\n    for (int i = 0; i < oversix - 1 - j; i++)\n      if (osix[i] < osix[i + 1]) {\n        t = osix[i];\n        strcpy(s[i], noosix[i]);\n        osix[i] = osix[i + 1];\n        strcpy(noosix[i], noosix[i + 1]);\n        osix[i + 1] = t;\n        strcpy(noosix[i + 1], s[i]);\n      }\n  for (int i = 0; i < oversix; i++)\n    printf(\"%s \", noosix[i]);\n  for (int i = 0; i < undersix; i++)\n    printf(\"%s \", nousix[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar id[101][11];\n\nint main() {\n  int n;\n  int age[101], a[101];\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> id[i] >> age[i];\n    int j = i;\n    if (age[i] >= 60) {\n      for (; j > 1 && age[a[j - 1]] < age[i]; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (int i = 1; i <= n; i++)\n    printf(\"%s\\n\", id[a[i]]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16442", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } * p, *p60_up, *p60_low, t;\n\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient) * n);\n\n  for (i = 0; i < n; i++) {\n    cin >> (p[i].id);\n    cin >> (p[i].age);\n  }\n  for (i = 0; i <= n; i++) {\n    if (p[i].age >= 60) {\n      k++;\n    }\n  }\n  p60_up = (struct patient *)malloc(sizeof(struct patient) * k);\n  p60_low = (struct patient *)malloc(sizeof(struct patient) * (n - k));\n\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      p60_up[j] = p[i];\n      j++;\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      p60_low[j] = p[i];\n      j++;\n    }\n  }\n  for (j = 1; j <= k; j++) {\n    for (i = 0; i < k - j; i++) {\n      if (p60_up[i].age < p60_up[i + 1].age) {\n        t = p60_up[i + 1];\n        p60_up[i + 1] = p60_up[i];\n        p60_up[i] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    puts(p60_up[i].id);\n  }\n  free(p60_up);\n  for (i = 0; i < n - k; i++)\n    puts(p60_low[i].id);\n\n  free(p60_low);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n} person[100], old[100];\n\nint main() {\n  int n, i, j = 0, k, b;\n  char e[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", person[i].id, &person[i].age);\n    if (person[i].age >= 60) {\n      strcpy(old[j].id, person[i].id);\n      old[j].age = person[i].age;\n      j = j + 1;\n    }\n  }\n  for (k = 1; k < j; k++)\n    for (i = 0; i < j - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        strcpy(e, old[i].id);\n        strcpy(old[i].id, old[i + 1].id);\n        strcpy(old[i + 1].id, e);\n        b = old[i].age;\n        old[i].age = old[i + 1].age;\n        old[i + 1].age = b;\n      }\n    }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", old[i].id);\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      printf(\"%s \", person[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct p {\n    char num[11];\n    int age;\n  };\n  struct p c[101];\n  int n, i, t = 0, s, h, l = 0;\n  int a[100], b[100], d[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", c[i].num, &c[i].age);\n  for (i = 0; i < n; i++) {\n    if (c[i].age >= 60) {\n      a[t] = c[i].age;\n      c[i].age = 0;\n      b[t] = i;\n      t++;\n    }\n  }\n  if (t > 0) {\n  leap:\n    s = a[0];\n    h = 0;\n    for (i = 0; i < t; i++) {\n      if (a[i] > s) {\n        s = a[i];\n        h = i;\n      }\n    }\n    printf(\"%s\\n\", c[b[h]].num);\n    l++;\n    a[h] = 0;\n    if (l < t)\n      goto leap;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].age != 0) {\n      printf(\"%s\\n\", c[i].num);\n    }\n  }\n}\n"}
{"label": "9", "index": "16445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct p {\n  char id[10];\n  int age;\n};\n\nvoid bubble(struct p a[100], int n) {\n  int i, j;\n  struct p temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j].age >= 60) {\n        if (a[j + 1].age > a[j].age) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      } else {\n        if (a[j + 1].age >= 60) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  struct p a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n\n  bubble(a, n);\n  for (i = 0; i < n; i++) {\n    cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char num[20];\n  int age;\n  int turn;\n  struct ill *next;\n};\n\nvoid run(struct ill *head, int age, int turn, char *num) {\n  struct ill *pre, *p, *s;\n  s = (struct ill *)malloc(sizeof(struct ill));\n  pre = head;\n  p = pre->next;\n  strcpy(s->num, num);\n  s->turn = turn;\n  s->age = age;\n\n  for (; p != NULL;) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nint main() {\n  int i, j, k, age, turn, m, n;\n  char *num;\n  void run(struct ill * head, int age, int turn, char *num);\n  num = (char *)malloc(20 * sizeof(char));\n  struct ill *head, *p, *s, *pre;\n  head = (struct ill *)malloc(sizeof(struct ill));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", num, &age);\n    turn = i;\n    run(head, age, turn, num);\n  }\n  k = 0;\n  for (p = head->next; p != NULL; p = p->next) {\n    if (p->age >= 60) {\n      k++;\n    }\n  }\n\n  p = head->next;\n  m = 100;\n  if (k == 0) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == i) {\n          puts(p->num);\n\n          break;\n        }\n      }\n    }\n  } else if (k == n) {\n    for (i = 0; i < n; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < k; i++) {\n      p = head->next;\n      m = 0;\n      j = 100;\n      for (; p != NULL;) {\n        if (p->age > m) {\n          m = p->age;\n          j = p->turn;\n        } else if (p->age == m) {\n          if (p->turn < j) {\n            m = p->age;\n            j = p->turn;\n          }\n        }\n        p = p->next;\n      }\n      pre = head;\n      p = head->next;\n      for (; p != NULL;) {\n        if ((p->age == m) && (p->turn == j)) {\n          puts(p->num);\n\n          pre->next = p->next;\n          break;\n        } else {\n          pre = p;\n          p = p->next;\n        }\n      }\n    }\n    for (i = 0; i < n - k; i++) {\n      m = 100;\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn < m)\n          m = p->turn;\n\n        p = p->next;\n      }\n      p = head->next;\n      for (; p != NULL;) {\n        if (p->turn == m) {\n          puts(p->num);\n\n          p->turn = 100;\n          break;\n        } else {\n          p = p->next;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16447", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, l;\n  int age[10000];\n  char ID[10000][10], order[10000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> ID[i] >> age[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 1; j < n - i; j++) {\n      if (age[j] >= 60 && age[j] > age[m])\n        m = j;\n    }\n    for (j = 0; j < 10; j++) {\n      order[i][j] = ID[m][j];\n    }\n    for (j = m; j < n; j++) {\n      for (k = 0; k < 10; k++) {\n        ID[j][k] = ID[j + 1][k];\n      }\n      age[j] = age[j + 1];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(order[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100], aged[100];\n  char num[100][11], anum[100][11], q[100][11];\n  int n, i, k, j = 0, s, p, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      aged[j] = sz[i];\n      strcpy(anum[j], num[i]);\n      j++;\n    }\n  }\n  for (s = 1; s < j; s++) {\n    for (k = 0; k < j - s; k++) {\n      if (aged[k] < aged[k + 1]) {\n        e = aged[k + 1];\n        aged[k + 1] = aged[k];\n        aged[k] = e;\n        strcpy(q[k], anum[k + 1]);\n        strcpy(anum[k + 1], anum[k]);\n        strcpy(anum[k], q[k]);\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    cout << anum[p] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      cout << num[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct person {\n  char num[11];\n  int yr;\n} pe[100], t;\nint main() {\n  int n, i, e, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pe[i].num, &pe[i].yr);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - k - 1; i++) {\n      if ((pe[i + 1].yr >= 60) && (pe[i].yr < pe[i + 1].yr)) {\n        t = pe[i];\n        pe[i] = pe[i + 1];\n        pe[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pe[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    scanf(\"%s %d\", id[i], &age[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      cout << id[i] << \" \";\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n}\n"}
{"label": "9", "index": "16451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, n = 0, k = 0, i = 0;\n\n  struct man {\n    int number;\n    char name[10];\n  } m[100], p[100], s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", m[i].name, &m[i].number);\n  for (i = 0; i < n; i++)\n    if (m[i].number >= 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (a = k - 1; a > 0; a--) {\n    for (b = 0; b < a; b++)\n      if (p[b].number < p[b + 1].number) {\n        s = p[b + 1];\n        p[b + 1] = p[b];\n        p[b] = s;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (m[i].number < 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", p[i].name);\n}\n"}
{"label": "9", "index": "16452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nstruct patients {\n  char name[11];\n  int age;\n} pat[100];\nstruct patold {\n  char name[11];\n  int age;\n} old[100];\nstruct patyoung {\n  char name[11];\n  int age;\n} young[100];\nint y = 0, o = 0;\nchar nametemp[11];\nint agetemp;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &pat[i].name);\n    scanf(\"%d\", &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      strcpy(old[o].name, pat[i].name);\n      old[o].age = pat[i].age;\n      o++;\n    } else {\n      strcpy(young[y].name, pat[i].name);\n      young[y].age = pat[i].age;\n      y++;\n    }\n  }\n  for (i = 1; i < o; i++) {\n    for (j = 0; j < o - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        agetemp = old[j].age;\n        old[j].age = old[j + 1].age;\n        old[j + 1].age = agetemp;\n        strcpy(nametemp, old[j].name);\n        strcpy(old[j].name, old[j + 1].name);\n        strcpy(old[j + 1].name, nametemp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", old[i].name);\n  for (i = 0; i < y; i++)\n    cout << young[i].name << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16453", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } * patients, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  patients = (struct br *)malloc(sizeof(struct br) * n);\n\n  for (i = 0; i < n; i++) {\n    cin >> patients[i].id >> patients[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", patients[i].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  int a[100];\n  char num[100][15];\n} data;\n\nint main() {\n  int i, b, k = 0, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", data.num[i], &data.a[i]);\n    if (data.a[i] >= 60)\n      k++;\n  }\n  for (j = 0; j < k; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (data.a[i] > data.a[b])\n        b = i;\n    }\n    printf(\"%s\\n\", data.num[b]);\n    data.a[b] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (data.a[i] != 0)\n      printf(\"%s\\n\", data.num[i]);\n  }\n}\n"}
{"label": "9", "index": "16455", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pa {\n  char num[15];\n  int age;\n  struct pa *next;\n};\nint main() {\n  struct pa *p, *p1, *p2;\n  int i = 0, n;\n  cin >> n;\n  p1 = (struct pa *)malloc(1000);\n  cin >> p1->num >> p1->age;\n  p1->next = NULL;\n  p2 = p1;\n  p = p2;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      while (p2->next != NULL)\n        p2 = p2->next;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      if (p->age < p1->age) {\n        p1->next = p;\n        p = p1;\n      } else {\n        while (p2->next != NULL && (p2->next)->age >= p1->age) {\n          p2 = p2->next;\n        }\n        p1->next = p2->next;\n        p2->next = p1;\n      }\n    }\n    p2 = p;\n  }\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16456", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[15];\n  int age;\n  struct patient *ne;\n};\n\nstruct patient *lian(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p;\n  struct patient *q;\n\n  head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", head->id, &head->age);\n  head->ne = 0;\n  q = head;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p->id, &p->age);\n    p->ne = 0;\n    q->ne = p;\n    q = p;\n  }\n  return head;\n}\n\nint main() {\n  int n, max, sign, b = 5000;\n  struct patient *head;\n  struct patient *p;\n\n  scanf(\"%d\", &n);\n\n  head = lian(n);\n\n  for (;;) {\n\n    for (p = head, max = -1, sign = 0; p != NULL; p = p->ne) {\n      if (((p->age) >= 60) && max < (p->age) && ((p->age) < b)) {\n        max = p->age;\n        sign = 1;\n      }\n    }\n    b = max;\n    if (sign == 0)\n      break;\n    for (p = head; p != NULL; p = p->ne) {\n      if ((p->age) == max)\n        printf(\"%s\\n\", p->id);\n    }\n  }\n  for (p = head; p != NULL; p = p->ne) {\n    if ((p->age) < 60)\n      printf(\"%s\\n\", p->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int age;\n  struct student *next;\n};\nint n, i;\nstruct student *create() {\n  struct student *head;\n  struct student *p1, *p2;\n  head = NULL;\n  scanf(\"%d\", &i);\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->age);\n  while (n != i - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid paixu(struct student *p) {\n  struct student *p1, *p2;\n  char temp[20];\n  int temp2;\n  for (n = 1; n < i; n++) {\n    p2 = p;\n    p1 = p->next;\n    while (p1 != NULL) {\n      if (p1->age >= 60 && p2->age < 60) {\n\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      } else if (p1->age > p2->age && p2->age >= 60) {\n        strcpy(temp, p1->num);\n        strcpy(p1->num, p2->num);\n        strcpy(p2->num, temp);\n        temp2 = p1->age;\n        p1->age = p2->age;\n        p2->age = temp2;\n      }\n      p2 = p1;\n      p1 = p1->next;\n    }\n  }\n}\nvoid print(struct student *p) {\n  while (p != NULL) {\n    cout << p->num;\n    p = p->next;\n    if (p != NULL)\n      cout << \" \";\n  }\n}\nint main() {\n  struct student *p;\n  p = create();\n  paixu(p);\n  print(p);\n}\n"}
{"label": "9", "index": "16458", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          printf(\" %s\", pi->id);\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n  return 0;\n}\n"}
{"label": "9", "index": "16459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, x;\n  cin >> n;\n  int age[100];\n  char num[100][10];\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> age[i];\n    if (age[i] < 60)\n      age[i] = 0;\n  }\nloop:\n  for (i = 0; i < n; i++) {\n    x = 0;\n    if (age[i] >= 60) {\n      for (int j = 0; j < n; j++) {\n        if (age[j] > age[i])\n          x = x + 1;\n      }\n      if (x == 0) {\n        cout << num[i] << \"\\n\";\n        age[i] = 1;\n        goto loop;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] == 0)\n      printf(\"%s\\n\", num[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    cin >> year;\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j]) || (se[i] == se[j] && list[i] > list[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n  for (i = 0; i <= nums; i++) {\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16461", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[16];\n    int age;\n    int index;\n  };\n  int n, i, j, t, t1;\n  char str[16];\n  scanf(\"%d\", &n);\n  struct patient pat[n];\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].ID >> pat[i].age;\n    pat[i].index = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (pat[j].age >= 60 && pat[j].age > pat[i].age) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n      if (pat[i].age >= 60 && pat[i].age == pat[j].age) {\n        if (pat[i].index > pat[j].index) {\n          strcpy(str, pat[i].ID);\n          strcpy(pat[i].ID, pat[j].ID);\n          strcpy(pat[j].ID, str);\n          t = pat[i].age;\n          pat[i].age = pat[j].age;\n          pat[j].age = t;\n          t1 = pat[i].index;\n          pat[i].index = pat[j].index;\n          pat[j].index = t1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (pat[i].age < 60 && pat[i].index > pat[j].index) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n  }\n  for (i = 0; i < n; i++)\n\n    puts(pat[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, t;\n  scanf(\"%d\", &n);\n  char a[n][100], s[n][100], r[100];\n  int b[n], c[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (int j = 0; j < n; j++) {\n    if (b[j] >= 60) {\n      c[m] = b[j], strcpy(s[m], a[j]);\n      if (m != 0) {\n        for (int k = m; k > 0; k = k - 1) {\n          if (c[k] > c[k - 1]) {\n            strcpy(r, s[k]), strcpy(s[k], s[k - 1]), strcpy(s[k - 1], r);\n            t = c[k], c[k] = c[k - 1], c[k - 1] = t;\n          }\n        }\n      }\n      m++;\n    }\n  }\n  if (m != 0) {\n    for (int i = 0; i < m; i++)\n      printf(\"%s\\n\", s[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (b[j] < 60)\n      printf(\"%s\\n\", a[j]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16463", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sixty[100];\n  int n, i, j, a;\n  struct patient {\n    char num[11];\n    int age;\n  } peo[100];\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", peo[i].num, &peo[i].age);\n    if (peo[i].age >= 60) {\n      sixty[i] = peo[i].age;\n\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        a = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = a;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == peo[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", peo[j].num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (peo[i].age < 60) {\n      printf(\"%s\\n\", peo[i].num);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, age[100], dengji[100], p, t;\n  char id[100][10], c;\n  int k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    dengji[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        k = dengji[j];\n        dengji[j] = dengji[j + 1];\n        dengji[j + 1] = k;\n        for (p = 0; p <= 9; p++) {\n          c = id[j][p];\n          id[j][p] = id[j + 1][p];\n          id[j + 1][p] = c;\n        }\n      }\n      if (age[j] == age[j + 1]) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 2; i++)\n    for (j = 0; j <= n - 2 - i; j++) {\n      if (age[j] < 60) {\n        if (dengji[j] > dengji[j + 1]) {\n          k = dengji[j];\n          dengji[j] = dengji[j + 1];\n          dengji[j + 1] = k;\n          t = age[j];\n          age[j] = age[j + 1];\n          age[j + 1] = t;\n          for (p = 0; p <= 9; p++) {\n            c = id[j][p];\n            id[j][p] = id[j + 1][p];\n            id[j + 1][p] = c;\n          }\n        }\n      }\n    }\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct a60 {\n  char ID[10];\n  int age;\n} a60[101];\n\nstruct u60 {\n  char ID[10];\n  int age;\n} u60[100];\n\nvoid sort(int n) {\n  int i;\n  struct a60 *x;\n  for (i = 1; i < n; i++) {\n    for (x = a60; x < a60 + n - i; x++) {\n      if (x->age < (x + 1)->age) {\n        a60[100] = *x;\n        *x = *(x + 1);\n        *(x + 1) = a60[100];\n      }\n    }\n  }\n}\n\nint main() {\n  int a = 0, b = 0, m, n, q;\n  char p[10];\n  struct a60 *x;\n  struct u60 *y;\n  x = a60;\n  y = u60;\n\n  cin >> n;\n\n  for (m = 0; m < n; m++) {\n    cin >> p >> q;\n\n    if (q >= 60) {\n      strcpy(x->ID, p);\n      x->age = q;\n      x++;\n      a++;\n    } else {\n      strcpy(y->ID, p);\n      y->age = q;\n      y++;\n      b++;\n    }\n  }\n\n  sort(a);\n\n  for (x = a60; x < a60 + a; x++)\n    printf(\"%s\\n\", x->ID);\n\n  for (y = u60; y < u60 + b; y++)\n    cout << y->ID << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct data {\n    int age;\n    char id[10];\n  } o[101], y[101], tmp;\n  int no = 0, ny = 0;\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> tmp.id >> tmp.age;\n    if (tmp.age >= 60) {\n      o[no] = tmp;\n      no++;\n    } else {\n      y[ny] = tmp;\n      ny++;\n    }\n  }\n  for (i = no - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (o[j].age < o[j + 1].age) {\n        o[100] = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = o[100];\n      }\n    }\n  }\n  for (i = 0; i < no; i++)\n    cout << o[i].id << endl;\n  for (i = 0; i < ny; i++)\n    cout << y[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "16467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, g, m, i, j;\n  int max[100];\n  char s[100][10];\n  struct {\n    char d[10];\n    int a;\n  } p[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].d, &p[i].a);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60) {\n      m++;\n    }\n  }\n  k = m;\n  for (i = 0; i < n; i++) {\n    if (p[i].a < 60) {\n      strcpy(s[k], p[i].d);\n      k = k + 1;\n    }\n  }\n  g = 0;\n  for (j = 0; j < m; j++) {\n    max[j] = 59;\n    for (i = 0; i < n; i++) {\n      if (p[i].a > max[j]) {\n        max[j] = p[i].a;\n        h = i;\n      }\n    }\n    p[h].a = 59;\n    strcpy(s[g], p[h].d);\n    g++;\n  }\n  for (i = 0; i < n; i++)\n    cout << s[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct sick {\n  char *num;\n  int age;\n  struct sick *next;\n};\nstruct sick *range(int N) {\n  struct sick *pnew, *ppre, *p, *head, *last;\n  pnew = (struct sick *)malloc(1000);\n  pnew->num = (char *)malloc(100 * sizeof(char));\n  pnew->next = NULL;\n  scanf(\"%s %d\", pnew->num, &pnew->age);\n  head = last = pnew;\n  int i;\n  for (i = 2; i <= N; i++) {\n    pnew = (struct sick *)malloc(1000);\n    pnew->num = (char *)malloc(100 * sizeof(char));\n    pnew->next = NULL;\n    scanf(\"%s %d\", pnew->num, &pnew->age);\n    int j;\n    if (pnew->age < 60) {\n      last->next = pnew;\n      last = pnew;\n    } else {\n      if (pnew->age > head->age) {\n        pnew->next = head;\n        head = pnew;\n      } else {\n        ppre = head;\n        p = head->next;\n        for (j = 2; p != NULL; j++) {\n          if (pnew->age > p->age) {\n            ppre->next = pnew;\n            pnew->next = p;\n            break;\n          } else {\n            ppre = ppre->next;\n            p = p->next;\n          }\n        }\n      }\n      if (pnew->next == NULL) {\n        last->next = pnew;\n        last = pnew;\n      }\n    }\n  }\n  return (head);\n}\nvoid print(struct sick *head, int N) {\n  struct sick *p = head;\n  int i;\n  for (i = 1; i <= N; i++) {\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  struct sick *head = range(N);\n  print(head, N);\n}\n"}
{"label": "9", "index": "16469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  char *id;\n  char id_[11];\n  int age;\n  struct f *next;\n};\nstruct in {\n  struct f *old;\n  struct f *young;\n  int num;\n};\nint main() {\n  int n, num_;\n  scanf(\"%d\", &n);\n  struct f *p2, *p3;\n  struct in *p1;\n  struct in *cr(int x); \n  p1 = cr(n);\n  p3 = p1->young;\n  p2 = p1->old;\n  num_ = p1->num;\n  void sort(struct f * p, int x);\n  sort(p2, num_);\n  while (p2) {\n    printf(\"%s\\n\", p2->id);\n    p2 = p2->next;\n  }\n  while (p3) {\n    printf(\"%s\\n\", p3->id);\n    p3 = p3->next;\n  }\n}\nstruct in *cr(int x) {\n  struct f *head1, *head2, *p;\n  int k = 0;\n  struct in *p3;\n  p3 = (struct in *)malloc(sizeof(struct in));\n  head1 = (struct f *)malloc(sizeof(struct f));\n  head2 = (struct f *)malloc(sizeof(struct f));\n  p3->old = head1; \n  p3->young = head2;\n  struct f *p4, *p5, *p6, *p7;\n  p4 = head1;\n  p6 = head2;\n  int i;\n  for (i = 0; i < x; i++) {\n    p = (struct f *)malloc(sizeof(struct f));\n    scanf(\"%s %d\", p->id_, &p->age);\n    if (p->age >= 60) \n    {\n      p4->age = p->age;\n      p4->id = p->id_;\n      p5 = p4;\n      p4 = (struct f *)malloc(sizeof(struct f));\n      p5->next = p4;\n      k++;\n    } else \n    {\n      p6->age = p->age;\n      p6->id = p->id_;\n      p7 = p6;\n      p6 = (struct f *)malloc(sizeof(struct f));\n      p7->next = p6;\n    }\n  }\n  p5->next = 0;\n  p7->next = 0;\n  p3->num = k;\n  return p3; \n}\nvoid sort(struct f *p, int x) {\n  int i, j, k1;\n  char *k2;\n  struct f *p1, *p2;\n  for (i = 0; i < x - 1; i++) \n    for (p1 = p, j = 0; i + j < x - 1; j++, p1 = p1->next) {\n      p2 = p1->next;\n      if (p2->age > p1->age) {\n        k1 = p2->age;\n        p2->age = p1->age;\n        p1->age = k1;\n        k2 = p2->id;\n        p2->id = p1->id;\n        p1->id = k2;\n      }\n    }\n}\n"}
{"label": "9", "index": "16470", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  struct ren {\n    char id[10];\n    int age;\n  } p[100];\n  struct ren t;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j].age < p[j + 1].age && p[j + 1].age >= 60) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", p[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16471", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d \", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d\", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++) {\n      if ((se[i] < se[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      } else if (se[i] == se[j] && list[i] > list[j]) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n    }\n\n  for (i = 0; i <= nums; i++) {\n\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16472", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pa {\n  char num[15];\n  int age;\n  struct pa *next;\n};\nint main() {\n  struct pa *p, *p1, *p2;\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  p1 = (struct pa *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->age);\n  p1->next = NULL;\n  p2 = p1;\n  p = p2;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      while (p2->next != NULL)\n        p2 = p2->next;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      if (p->age < p1->age) {\n        p1->next = p;\n        p = p1;\n      } else {\n        while (p2->next != NULL && (p2->next)->age >= p1->age)\n          p2 = p2->next;\n        p1->next = p2->next;\n        p2->next = p1;\n      }\n    }\n    p2 = p;\n  }\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct kb {\n  char ID[10];\n  int nl;\n} kbr[100], lnr[100], ln;\n\nint main() {\n  int n, i, k = 0, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> kbr[i].ID >> kbr[i].nl;\n  }\n  for (i = 0; i < n; i++) {\n    if (kbr[i].nl >= 60) {\n      strcpy(lnr[k].ID, kbr[i].ID);\n      lnr[k].nl = kbr[i].nl;\n      k++;\n      strcpy(kbr[i].ID, \"000000000\");\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (l = 0; l < k - i; l++) {\n      if (lnr[l].nl < lnr[l + 1].nl) {\n        ln = lnr[l + 1];\n        lnr[l + 1] = lnr[l];\n        lnr[l] = ln;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", lnr[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(kbr[i].ID, \"000000000\") == 1) {\n      printf(\"%s\\n\", kbr[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n;\n\n  int a[101], b[101];\n\n  char c[101][11], d[101][11];\n\n  int i, j, k;\n\n  int ni, nj, nk;\n\n  char ci[11], cj[11], ck[11];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> c[i];\n    strcpy(d[i], c[i]);\n    scanf(\"%d\", &a[i]);\n    b[i] = a[i];\n  }\n\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - i; j++) {\n      if (a[j] < a[j + 1]) {\n        ni = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = ni;\n        strcpy(ci, c[j + 1]);\n        strcpy(c[j + 1], c[j]);\n        strcpy(c[j], ci);\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (a[i] >= 60) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] < 60) {\n      printf(\"%s\\n\", d[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, l, z;\n  int a[100], b[100], f[100];\n  char d[30], c[100][30], e[100][30];\n  scanf(\"%d\", &n);\n  for (i = 0, z = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n    if (a[i] >= 60) {\n      b[z] = a[i];\n      f[z] = z;\n      strcpy(e[z], c[i]);\n      a[i] = 0;\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = i + 1; j < z; j++) {\n      if (b[j] > b[i]) {\n        strcpy(d, e[i]);\n        strcpy(e[i], e[j]);\n        strcpy(e[j], d);\n        k = b[i];\n        b[i] = b[j];\n        b[j] = k;\n        l = f[i];\n        f[i] = f[j];\n        f[j] = l;\n      }\n      if (b[i] == b[j]) {\n        if (f[i] > f[j]) {\n          strcpy(d, e[i]);\n          strcpy(e[i], e[j]);\n          strcpy(e[j], d);\n          k = b[i];\n          b[i] = b[j];\n          b[j] = k;\n          l = f[i];\n          f[i] = f[j];\n          f[j] = l;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", e[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      printf(\"%s\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char id[10];\n    int age;\n  } pat[100], p1[100], p2[100], temp;\n  int i, n, j = 0, k = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p1[j] = pat[i];\n      j++;\n    } else {\n      p2[k] = pat[i];\n      k++;\n    }\n  }\n  for (i = j - 1; i > 0; i--) {\n    for (m = 0; m < i; m++) {\n      if (p1[m].age < p1[m + 1].age) {\n        temp = p1[m];\n        p1[m] = p1[m + 1];\n        p1[m + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", p1[i].id);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", p2[i].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, e, age[100], six[100];\n  j = 0;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &id[i]);\n    scanf(\"%d\", &age[i]);\n    if (age[i] >= 60) {\n      six[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (age[six[k]] < age[six[k + 1]]) {\n        e = six[k + 1];\n        six[k + 1] = six[k];\n        six[k] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", id[six[i]]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int d;\n  char c[20];\n  struct s *next;\n};\nvoid sort(struct s *head) {\n  struct s *pre = head, *p = pre->next, *s;\n  s = (struct s *)malloc(sizeof(struct s));\n  scanf(\"%s %d\", s->c, &s->d);\n  s->next = NULL;\n  if (s->d >= 60) {\n    while (p != NULL && p->d >= s->d) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n  if (s->d < 60) {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\nint main() {\n  struct s *head, *p;\n  int n, i;\n  head = (struct s *)malloc(sizeof(struct s));\n  cin >> n;\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    sort(head);\n  }\n  p = head->next;\n  while (p != NULL) {\n    cout << p->c << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    int id[7];\n    int age;\n  } patient[100];\n  int i, n, max = 0, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  for (i = 0; i < n; i++) {\n    if (patient[i].age > max)\n      max = patient[i].age;\n  }\n  for (k = max; k > 59; k--) {\n    for (i = 0; i < n; i++)\n      if (patient[i].age == k)\n        printf(\"%s\\n\", patient[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60)\n      printf(\"%s\\n\", patient[i].id);\n  }\n}\n"}
{"label": "9", "index": "16480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, e, n, i, j, k, a[101], b[101], c[101];\n  char ex[11], s[101][11], s1[101][11], s2[101][11];\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      strcpy(s1[j], s[i]);\n      b[j] = a[i];\n      j++;\n    } else {\n      strcpy(s2[k], s[i]);\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (m = 1; m <= j; m++) {\n    for (i = 0; i < j - m; i++) {\n      if (b[i] < b[i + 1]) {\n        strcpy(ex, s1[i]);\n        strcpy(s1[i], s1[i + 1]);\n        strcpy(s1[i + 1], ex);\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", s1[i]);\n\n  for (i = 0; i < k; i++) {\n    cout << s2[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int slotnum;\n  char slot[100];\n  scanf(\"%d\", &n);\n\n  char s1[100][100];\n  int s2[100];\n  char a1[100][100];\n  int a2[100];\n  int anum = 0;\n  char b1[100][100];\n  int b2[100];\n  int bnum = 0;\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    cin >> s1[i] >> s2[i];\n    if (s2[i] >= 60) {\n      strcpy(a1[j], s1[i]);\n      a2[j] = s2[i];\n      j++;\n      anum++;\n    }\n    if (s2[i] < 60) {\n      strcpy(b1[k], s1[i]);\n      b2[k] = s2[i];\n      k++;\n      bnum++;\n    }\n  }\n\n  for (i = anum - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a2[j] < a2[j + 1]) {\n        strcpy(slot, a1[j]);\n        strcpy(a1[j], a1[j + 1]);\n        strcpy(a1[j + 1], slot);\n        slotnum = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = slotnum;\n      }\n    }\n  }\n\n  for (i = 0; i < anum; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n  for (i = 0; i < bnum; i++) {\n    cout << b1[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char num[11];\n  int yr;\n} pe[100], t;\nint main() {\n  int n, i, e, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pe[i].num, &pe[i].yr);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - k - 1; i++) {\n      if ((pe[i + 1].yr >= 60) && (pe[i].yr < pe[i + 1].yr)) {\n        t = pe[i];\n        pe[i] = pe[i + 1];\n        pe[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pe[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100];\n  char d[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (j = 0; j <= n; j++)\n    if (a[j] >= 60)\n      b[j] = a[j] * 1000 - j;\n    else\n      b[j] = 1000 - j;\n  for (j = 0; j <= n; j++)\n    c[j] = 0;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (b[j] >= b[i])\n        c[i]++;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (c[j] == i + 1)\n        printf(\"%s\\n\", d[j]);\n}\n"}
{"label": "9", "index": "16484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct people {\n    char a[10];\n    int year;\n  };\n  struct people b[100], c[100], d[100], v[100];\n  for (int h = 0; h <= 99; h++) {\n    for (int p = 0; p <= 9; p++) {\n      b[h].a[p] = c[h].a[p] = d[h].a[p] = v[h].a[p] = 0;\n    }\n  }\n\n  int n, t = 0, k = 0, o;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &b[i].a, &b[i].year);\n    if (b[i].year >= 60) {\n      t++;\n      v[t] = b[i];\n    } else {\n      k++;\n      d[k] = b[i];\n    }\n  }\n  for (int j = 1; j <= t; j++) {\n    o = 0;\n    for (int u = 1; u <= t; u++) {\n\n      if (v[u].year > v[j].year) {\n        o++;\n      }\n      if (v[u].year == v[j].year && u < j) {\n        o++;\n      }\n    }\n    c[o + 1] = v[j];\n  }\n  for (int l = 1; l <= k; l++) {\n    c[t + l] = d[l];\n  }\n  for (int x = 1; x <= n; x++) {\n    printf(\"%s\\n\", c[x].a);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct hospital {\n  char ID[13];\n  int age;\n  struct hospital *next;\n};\nint main() {\n  void change(struct hospital *);\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  struct hospital *p, *head;\n  p = (struct hospital *)malloc(sizeof(struct hospital));\n  head = p;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    p->next = (struct hospital *)malloc(sizeof(struct hospital));\n    p = p->next;\n  }\n  scanf(\"%s %d\", p->ID, &p->age);\n  p->next = NULL;\n  for (i = 0; i < n; i++) {\n    for (p = head; p->next != NULL; p = p->next) {\n      if (p->age < 60 && p->next->age >= 60) {\n        change(p);\n      }\n      if (p->age >= 60 && p->next->age >= 60 && p->next->age > p->age)\n        change(p);\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    printf(\"%s\\n\", p->ID);\n  }\n  return 0;\n}\nvoid change(struct hospital *p) {\n  int tempage;\n  char tempID[13];\n  struct hospital *later = p->next;\n  tempage = later->age;\n  strcpy(tempID, later->ID);\n  later->age = p->age;\n  strcpy(later->ID, p->ID);\n  p->age = tempage;\n  strcpy(p->ID, tempID);\n}\n"}
{"label": "9", "index": "16486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, j, i, n, max, count, a[100];\n\n  char s[100][10];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    cin >> s[i] >> a[i];\n  }\n  n = 0;\n  for (count = 0; count < num; count++) {\n    max = 59;\n    for (i = 0; i < num; i++) {\n      if (a[i] > max && a[i] < 200) {\n        max = a[i];\n        j = i;\n      }\n    }\n    if (max == 59)\n      break;\n    cout << s[j] << \"\\n\";\n    a[j] = 300;\n  }\n  for (i = 0; i < num; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char num[11];\n  int yr;\n} pe[100], t;\nint main() {\n  int n, i, e, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pe[i].num, &pe[i].yr);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - k - 1; i++) {\n      if ((pe[i + 1].yr >= 60) && (pe[i].yr < pe[i + 1].yr)) {\n        t = pe[i];\n        pe[i] = pe[i + 1];\n        pe[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << pe[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\nint main() {\n  int n, i, j;\n  char id1[20];\n  int age1, u;\n  struct patient temp;\n  struct patient *p;\n  struct patient a[500];\n  scanf(\"%d\", &n);\n  p = a;\n  u = 0;\n  for (; p < a + n; p++) {\n    scanf(\"%s\", id1);\n    scanf(\"%d\", &age1);\n    strcpy(p->id, id1);\n    p->age = age1;\n    p->num = u;\n    u++;\n  }\n  p = a;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if ((*(p + j)).age >= 60 || (*(p + j + 1)).age >= 60) {\n        if ((*(p + j)).age < (*(p + j + 1)).age) {\n          temp = *(p + j);\n          *(p + j) = *(p + j + 1);\n          *(p + j + 1) = temp;\n        }\n      } else\n        continue;\n    }\n  }\n  p = a;\n  for (; p < a + n; p++) {\n\n    printf(\"%s\\n\", p->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp, num1 = 0, num2 = 100, age[100], flag[100];\n  char id[100][10], str[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin.get();\n    cin >> id[i] >> age[i];\n    if (age[i] < 60)\n      flag[i] = num1++;\n    else\n      flag[i] = num2++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] < age[j] && age[j] >= 60) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] == age[j] && age[i] >= 60 && age[j] >= 60 &&\n              flag[i] > flag[j] ||\n          age[i] < 60 && age[j] < 60 && flag[i] > flag[j]) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << id[i] << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "16490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  } pa[100];\n  int n, i, t, j, k;\n  char m[10], str[100][100];\n  int a[100], b[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pa[i].ID, &pa[i].age);\n    a[i] = pa[i].age;\n    strcpy(str[i], pa[i].ID);\n  }\n  for (i = 0, j = 0; i < n; i++, j++) {\n    if (a[i] >= 60)\n      b[j] = a[i];\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    for (j = 0; j < n - 1 - i; j++) {\n\n      if (b[j + 1] > b[j]) {\n        t = b[j];\n        strcpy(m, pa[j].ID);\n        b[j] = b[j + 1];\n        strcpy(pa[j].ID, pa[j + 1].ID);\n        b[j + 1] = t;\n        strcpy(pa[j + 1].ID, m);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n\n    if (b[i] != 0)\n      printf(\"%s\\n\", pa[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n}\n"}
{"label": "9", "index": "16491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, i;\n  char a[100][10], over[100][10], below[100][10];\n  char h[100][10];\n  long int b[100];\n  long int c[100] = {0};\n  long int d[100] = {0};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= 60) {\n      c[i] = b[i];\n      strcpy(over[i], a[i]);\n    } else {\n      d[i] = b[i];\n      strcpy(below[i], a[i]);\n    }\n  }\n  for (k = 101; k >= 60; k--) {\n    i = 1;\n    while (i <= n) {\n      if (c[i] == k) {\n        printf(\"%s\\n\", over[i]);\n      }\n      i++;\n    }\n  }\n  i = 1;\n  while (i <= n) {\n    if (d[i] != 0)\n      printf(\"%s\\n\", below[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][1000 + 1];\n  char g[100][1000 + 1];\n  int h[100];\n  int k[100], a, i, j;\n  char q[100];\n  int n, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &k[i]);\n  }\n  a = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (k[i] >= 60) {\n      a++;\n      h[j] = k[i];\n      strcpy(g[j], s[i]);\n      j++;\n      k[i] = 0;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (h[j] < h[j + 1]) {\n        e = h[j];\n        h[j] = h[j + 1];\n        h[j + 1] = e;\n        strcpy(q, g[j]);\n        strcpy(g[j], g[j + 1]);\n        strcpy(g[j + 1], q);\n      }\n    }\n  }\n  for (i = 0; i < a; i++)\n    printf(\"%s \", g[i]);\n\n  for (i = 0; i < n; i++) {\n    if (k[i] != 0)\n      cout << s[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n} * head, *p1, *p2;\nstruct patient *order(int n) {\n  int i, j, t;\n  char a[20];\n  for (i = 0; i < n - 1; i++) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->age >= 60 && p1->age < p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  p1 = head = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->age;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  while (p1) {\n    cout << p1->id << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16494", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], order[100], buffer[100], swap_1;\n\nint main() {\n\n  int i, j = 0, m = 0, n, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      order[j] = pat[i];\n      j++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      buffer[m] = pat[i];\n      m++;\n    }\n  }\n\n  for (p = 1; p < j; p++) {\n    for (q = 0; q < j - p; q++) {\n      if (order[q].age < order[q + 1].age) {\n        swap_1 = order[q + 1];\n        order[q + 1] = order[q];\n        order[q] = swap_1;\n      }\n    }\n  }\n  for (q = 0; q < j; q++) {\n    printf(\"%s\", order[q].id);\n    printf(\" \");\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\", buffer[i].id);\n    printf(\" \");\n  }\n}\n"}
{"label": "9", "index": "16495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, n, e, sz[100], sx[100] = {0};\n  char st[100][11], sa[11], sd[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> st[i];\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      sx[i] = sz[i];\n      strcpy(sd[i], st[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (a = 0; a < n - i; a++) {\n      if (sx[a] < sx[a + 1]) {\n        e = sx[a];\n        sx[a] = sx[a + 1];\n        sx[a + 1] = e;\n        strcpy(sa, sd[a]);\n        strcpy(sd[a], sd[a + 1]);\n        strcpy(sd[a + 1], sa);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sx[i] >= 60)\n      puts(sd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      puts(st[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, m = 0;\n\n  scanf(\"%d\", &n);\n\n  char s1[100][10], s2[100][10], p1[100][10], p2[100][10], z1[100][10],\n      z2[100][10], t[10];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s1[i]);\n\n    scanf(\"%s\", s2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) {\n      strcpy(p1[j], s1[i]);\n\n      strcpy(p2[j], s2[i]);\n\n      j++;\n    }\n    if (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0') {\n      strcpy(z1[m], s1[i]);\n\n      strcpy(z2[m], s2[i]);\n\n      m++;\n    }\n  }\n  int k = j;\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(p2[j], p2[j + 1]) < 0) {\n\n        strcpy(t, p2[j]);\n\n        strcpy(p2[j], p2[j + 1]);\n\n        strcpy(p2[j + 1], t);\n\n        strcpy(t, p1[j]);\n\n        strcpy(p1[j], p1[j + 1]);\n\n        strcpy(p1[j + 1], t);\n      }\n    }\n  }\n  for (i = m - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(z2[j], z2[j + 1]) < 0) {\n\n        strcpy(t, z2[j]);\n\n        strcpy(z2[j], z2[j + 1]);\n\n        strcpy(z2[j + 1], t);\n\n        strcpy(t, z1[j]);\n\n        strcpy(z1[j], z1[j + 1]);\n\n        strcpy(z1[j + 1], t);\n      }\n    }\n  }\n  for (j = 0; j < m; j++)\n    printf(\"%s\\n\", z1[j]);\n\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", p1[j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (!((s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) ||\n          (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0')))\n      cout << s1[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  };\n\n  int n, i, j, k;\n  struct patient p[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> p[i].id >> p[i].age;\n\n  for (i = 1; i < n; i++) {\n    if (p[i].age >= 60) {\n      j = 0;\n      while (j < i && p[j].age >= p[i].age)\n        j++;\n      if (j < i) {\n        struct patient tmp = p[i];\n        for (k = i; k > j; k--) {\n          p[k] = p[k - 1];\n        }\n        p[j] = tmp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    cout << p[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, n;\nstruct st {\n  char a[20];\n  int x;\n  struct st *next;\n} * p1, *p2, *p, *head, *pre;\nint main() {\n  scanf(\"%d\", &n);\n  void f(struct st *);\n  p1 = p2 = head = (struct st *)malloc(sizeof(struct st));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->a, &p1->x);\n    p1 = (struct st *)malloc(sizeof(struct st));\n    p2->next = p1;\n    p2 = p1;\n  }\n  f(head);\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n}\nvoid f(struct st *p) {\n  for (i = 0; i < n - 1; i++) {\n    pre = p1 = p2 = head;\n    p1 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p1->x > p2->x && p1->x >= 60) {\n        if (j == 0) {\n          p2->next = p1->next;\n          p1->next = p2;\n          head = pre = p1;\n        } else {\n          p2->next = p1->next;\n          p1->next = p2;\n          pre->next = p1;\n        }\n      }\n      if (j != 0)\n        pre = pre->next;\n      p2 = pre->next;\n      p1 = p2->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "16499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bingren {\n  char id[20];\n  int nian;\n  struct bingren *next;\n};\nint main() {\n  int n, i;\n  struct bingren *p1, *head;\n  struct bingren temp;\n  char a[20] = {'\\0'};\n  int b = 0;\n  scanf(\"%d\", &n);\n  head = (struct bingren *)malloc(sizeof(struct bingren));\n  head->next = NULL;\n  scanf(\"%s%d\", head->id, &head->nian);\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    p1->next = (struct bingren *)malloc(sizeof(struct bingren));\n    scanf(\"%s%d\", p1->next->id, &p1->next->nian);\n    p1->next->next = NULL;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    for (; p1->next != NULL;) {\n      if (p1->next->nian >= 60 && p1->next->nian > p1->nian) {\n        b = p1->nian;\n        p1->nian = p1->next->nian;\n        p1->next->nian = b;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p1->next->id);\n        strcpy(p1->next->id, a);\n      }\n      p1 = p1->next;\n    }\n    p1 = head;\n  }\n  p1 = head;\n  for (; p1 != NULL;) {\n    cout << p1->id << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, e;\n  char q[11];\n  struct point {\n    char name[11];\n    int age;\n  } p[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &p[i].name, &p[i].age);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if ((p[i].age > 60 || p[i].age == 60) &&\n              (p[i + 1].age > 60 || p[i + 1].age == 60) &&\n              p[i].age < p[i + 1].age ||\n          p[i].age < 60 && (p[i + 1].age > 60 || p[i + 1].age == 60)) {\n        e = p[i].age;\n        p[i].age = p[i + 1].age;\n        p[i + 1].age = e;\n\n        strcpy(q, p[i].name);\n        strcpy(p[i].name, p[i + 1].name);\n        strcpy(p[i + 1].name, q);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << p[i].name;\n    if (i != n - 1) {\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16501", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  char id[1000][1000];\n  int nl[1000];\n  char id_old[1000][1000], id_young[1000][1000];\n  int nl_old[1000];\n  int a = 0, b = 0;\n  scanf(\"%d\", &n);\n  char ids[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &id[i], &nl[i]);\n    if (nl[i] >= 60) {\n      strcpy(id_old[a], id[i]);\n      nl_old[a] = nl[i];\n      a++;\n    } else {\n      strcpy(id_young[b], id[i]);\n      b++;\n    }\n  }\n  int e;\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (nl_old[j] < nl_old[j + 1]) {\n        e = nl_old[j + 1];\n        nl_old[j + 1] = nl_old[j];\n        nl_old[j] = e;\n        strcpy(ids, id_old[j + 1]);\n        strcpy(id_old[j + 1], id_old[j]);\n        strcpy(id_old[j], ids);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", id_old[i]);\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s \", id_young[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint N;\nstruct patient {\n  char ID[20];\n  int age;\n  struct patient *next;\n};\nstruct patient *creat() {\n  struct patient *head, *p1, *p2;\n  int i;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < N; i++) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return (head);\n}\nstruct patient *rank_1(struct patient *head) {\n  int i, j, a;\n  char ID[20];\n  struct patient *p1, *p2;\n  for (i = 0; i < N - 1; i++) {\n    p1 = head;\n    p2 = head->next;\n    for (j = 0; j < N - i - 1; j++) {\n      if ((p1->age < p2->age) && (p2->age >= 60)) {\n        a = p1->age;\n        p1->age = p2->age;\n        p2->age = a;\n        strcpy(ID, p1->ID);\n        strcpy(p1->ID, p2->ID);\n        strcpy(p2->ID, ID);\n      }\n      p1 = p2;\n      p2 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    cout << p->ID << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  scanf(\"%d\", &N);\n  head = creat();\n  head = rank_1(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  char id[100][10];\n  int age[100];\n  char oid[100][10];\n  int oage[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      oage[k] = age[i];\n      strcpy(oid[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      if (oage[j] < oage[j + 1]) {\n        int e;\n        e = oage[j];\n        oage[j] = oage[j + 1];\n        oage[j + 1] = e;\n        char f[10];\n        strcpy(f, oid[j]);\n        strcpy(oid[j], oid[j + 1]);\n        strcpy(oid[j + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", oid[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      cout << id[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } ren[100];\n  struct oldp {\n    char idold[11];\n    int ageold;\n  } oldren[100];\n  struct youngp {\n    char idyoung[11];\n    int ageyoung;\n  } youngren[100];\n\n  int n, i, t, j, oldindex = 0, youngindex = 0;\n  char num[4], idinter[11];\n\n  scanf(\"%s \", num);\n  n = atoi(num);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ren[i].id, &ren[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ren[i].age >= 60) {\n      oldren[oldindex].ageold = ren[i].age;\n      strcpy(oldren[oldindex].idold, ren[i].id);\n      oldindex += 1;\n    } else {\n      youngren[youngindex].ageyoung = ren[i].age;\n      strcpy(youngren[youngindex].idyoung, ren[i].id);\n      youngindex += 1;\n    }\n  }\n  for (i = 1; i < oldindex; i++) {\n    for (j = 0; j < oldindex - i; j++) {\n      if (oldren[j].ageold < oldren[j + 1].ageold) {\n        t = oldren[j].ageold;\n        oldren[j].ageold = oldren[j + 1].ageold;\n        oldren[j + 1].ageold = t;\n        strcpy(idinter, oldren[j].idold);\n        strcpy(oldren[j].idold, oldren[j + 1].idold);\n        strcpy(oldren[j + 1].idold, idinter);\n      }\n    }\n  }\n  for (i = 0; i < oldindex; i++) {\n    printf(\"%s \", oldren[i].idold);\n  }\n  for (i = 0; i < youngindex; i++) {\n    printf(\"%s \", youngren[i].idyoung);\n  }\n}\n"}
{"label": "9", "index": "16505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  char s[11];\n  int n;\n  struct st *next;\n};\nstruct st *creat(int m) {\n  struct st *head, *p1, *p2;\n  int i;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    scanf(\"%s %d\", p1->s, &p1->n);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid line(struct st *head, int m) {\n  struct st *p, *p1, *p2;\n  p = head;\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    p1 = p;\n    p2 = p1->next;\n    for (j = 1; j < m; j++) {\n      char ss[11] = {'\u0000'};\n      if (p1->n >= 60) {\n        if (p2->n > p1->n) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      } else {\n        if (p2->n >= 60) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << p->s << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct st *p;\n  void line(struct st * head, int m);\n  struct st *creat(int m);\n  int m, i, j;\n  cin >> m;\n  p = creat(m);\n  line(p, m);\n  return 0;\n}\n"}
{"label": "9", "index": "16506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[100][100];\n  int age[100];\n  int age1[100];\n  int a[100];\n  int max, n, l, i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[j] = age[i];\n      age[i] = 0;\n      a[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    max = 0;\n    x = 0;\n    for (k = 0; k < j; k++) {\n      if (max < age1[k]) {\n        max = age1[k];\n        x = k;\n      }\n    }\n    cout << string[a[x]] << \"\\n\";\n    age1[x] = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16507", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char id[100][10];\n  int n, age[100], i, k = 0, m, len, p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> (id[i]) >> (age[i]);\n  }\n  char e[100][10], kong[10];\n  int xin[100];\n  for (i = 0; i < n; i++) {\n    if (age[i] > 59) {\n      xin[k] = age[i];\n      strcpy(e[k], id[i]);\n      k++;\n    }\n  }\n  len = k;\n  for (m = 1; m <= len; m++) {\n    for (k = 0; k < len - m; k++) {\n      if (xin[k] < xin[k + 1]) {\n        p = xin[k];\n        strcpy(kong, e[k]);\n        xin[k] = xin[k + 1];\n        strcpy(e[k], e[k + 1]);\n        xin[k + 1] = p;\n        strcpy(e[k + 1], kong);\n      }\n    }\n  }\n  for (k = 0; k < len; k++) {\n    printf(\"%s\\n\", e[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], zs[100], i, k = 0, m, a;\n  char id[100][10], di[100][10], zfc[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      zs[k] = sz[i];\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (m = 0; m < k - 1; m++) {\n    for (i = 0; i < k - 1 - m; i++) {\n      if (zs[i] < zs[i + 1]) {\n        a = zs[i];\n        zs[i] = zs[i + 1];\n        zs[i + 1] = a;\n        strcpy(zfc, di[i]);\n        strcpy(di[i], di[i + 1]);\n        strcpy(di[i + 1], zfc);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(di[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << di[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, x, i;\n  int age[100];\n  char c[10], num[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60)\n\n      for (x = i; x > 0; x--)\n        if (age[x] > age[x - 1]) {\n          t = age[x];\n          age[x] = age[x - 1];\n          age[x - 1] = t;\n          strcpy(c, num[x]);\n          strcpy(num[x], num[x - 1]);\n          strcpy(num[x - 1], c);\n        }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", num[i]);\n}\n"}
{"label": "9", "index": "16510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char id[11];\n  int age;\n  struct pat *next;\n};\n\nvoid find(struct pat *head, struct pat *s) {\n  struct pat *pre = head, *p = pre->next;\n  while (p != NULL && s->age <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\n\nvoid sort(struct pat *head, int x, char name[11]) {\n  struct pat *pre = head, *p = pre->next, *s;\n  s = (struct pat *)malloc(sizeof(struct pat));\n  s->age = x;\n  strcpy(s->id, name);\n  s->next = NULL;\n  if (x >= 60)\n    find(head, s);\n  else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nint main() {\n\n  struct pat *head, *p;\n  int n, x, i;\n  char name[11];\n  head = (struct pat *)malloc(sizeof(struct pat));\n  head->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> name >> x;\n    sort(head, x, name);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct old {\n  char ID[10];\n  int age;\n};\nint main() {\n  struct old a[100], b[100], c[100];\n  int n, i, j, B = 0, C = 0, temp;\n  char TEMP[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].ID, &a[i].age);\n    if (a[i].age >= 60) {\n      strcpy(b[B].ID, a[i].ID);\n      b[B].age = a[i].age;\n      B++;\n    } else {\n      strcpy(c[C].ID, a[i].ID);\n      c[C].age = a[i].age;\n      C++;\n    }\n  }\n  for (i = B - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age ||\n          (b[j].age == b[j + 1].age &&\n           ((b[j].ID - '\\0') > (b[j + 1].ID - '\\0')))) {\n        temp = b[j + 1].age, b[j + 1].age = b[j].age, b[j].age = temp;\n        strcpy(TEMP, b[j + 1].ID), strcpy(b[j + 1].ID, b[j].ID),\n            strcpy(b[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = C - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((c[j].ID - '\\0') > (c[j + 1].ID - '\\0')) {\n        temp = c[j + 1].age, c[j + 1].age = c[j].age, c[j].age = temp;\n        strcpy(TEMP, c[j + 1].ID), strcpy(c[j + 1].ID, c[j].ID),\n            strcpy(c[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = 0; i < B; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < C; i++) {\n    printf(\"%s\\n\", c[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16512", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int k = 0;\n  char str[100][10] = {0};\n  char str1[100][10] = {0};\n  char str2[100][10] = {0};\n  int temp;\n  char t[10] = {0};\n  int a[100];\n  int a1[100] = {0};\n  int a2[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    strcpy(str1[i], str[i]);\n    a1[i] = a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      strcpy(str2[k], str[i]);\n      a2[k] = a[i];\n      k = k + 1;\n    }\n  for (j = 1; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (a2[i] < a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n        strcpy(t, str2[i]);\n        strcpy(str2[i], str2[i + 1]);\n        strcpy(str2[i + 1], t);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", str2[i]);\n  for (i = 0; i < n; i++)\n    if (a1[i] < 60)\n      printf(\"%s\\n\", str1[i]);\n}\n"}
{"label": "9", "index": "16513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\ntypedef struct data *pdata;\n\nstruct data {\n  char a[20];\n  int b;\n  pdata next;\n};\n\npdata sort(int n) {\n  pdata p = NULL, q = NULL, s = NULL, head = NULL;\n  head = (pdata)malloc(sizeof(struct data));\n  head->next = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    s = (pdata)malloc(sizeof(struct data));\n    scanf(\"%s %d\", s->a, &(s->b));\n    if (s->b >= 60) {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->b < s->b)\n          break;\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = NULL;\n    }\n  }\n\n  return head;\n}\n\nint main() {\n  int n, i;\n  pdata p, head;\n  scanf(\"%d\", &n);\n  head = sort(n);\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char id[10];\n  int age;\n  struct pat *next;\n};\nint main() {\n  struct pat *head, *p;\n  int i, n;\n  void search(struct pat * head, int n);\n  scanf(\"%d\", &n);\n  head = (struct pat *)malloc(sizeof(struct pat));\n  p = head;\n  p->next = NULL;\n  scanf(\"%s %d\", p->id, &p->age);\n  for (i = 1; i < n; i++) {\n    p->next = (struct pat *)malloc(sizeof(struct pat));\n    p = p->next;\n    scanf(\"%s %d\", p->id, &p->age);\n    p->next = NULL;\n  }\n  search(head, n);\n}\nvoid search(struct pat *head, int n) {\n  int i, j = 0, k = 0;\n  struct pat *t, *m, *p, *head1, *head2;\n  struct pat *sort(struct pat * head1, int j);\n  void print(struct pat * head1, struct pat * head2, int j, int k);\n  p = head;\n  t = (struct pat *)malloc(sizeof(struct pat));\n  m = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    if (p->age >= 60) {\n      j++;\n      if (j == 1) {\n        head1 = t;\n      }\n      strcpy(t->id, p->id);\n      t->age = p->age;\n      t->next = (struct pat *)malloc(sizeof(struct pat));\n      t = t->next;\n      t->next = NULL;\n    } else {\n      k++;\n      if (k == 1) {\n        head2 = m;\n      }\n      strcpy(m->id, p->id);\n      m->age = p->age;\n      m->next = (struct pat *)malloc(sizeof(struct pat));\n      m = m->next;\n      m->next = NULL;\n    }\n    p = p->next;\n  }\n  sort(head1, j);\n  print(head1, head2, j, k);\n}\nstruct pat *sort(struct pat *head1, int j) {\n  int i, l, t;\n  char a[10];\n  struct pat *p1, *p2;\n  for (i = 0; i < j - 1; i++) {\n    p1 = head1;\n    for (l = 0; l < j - i - 1; l++) {\n      p2 = p1;\n      p1 = p1->next;\n      if (p1->age > p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n    }\n  }\n  return (head1);\n}\nvoid print(struct pat *head1, struct pat *head2, int j, int k) {\n  int i;\n  struct pat *p;\n  p = head1;\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  p = head2;\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  char id[100][10];\n  int age[100];\n  char oid[100][10];\n  int oage[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  int k = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      oage[k] = age[i];\n      strcpy(oid[k], id[i]);\n      k++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      if (oage[j] < oage[j + 1]) {\n        int e;\n        e = oage[j];\n        oage[j] = oage[j + 1];\n        oage[j + 1] = e;\n        char f[10];\n        strcpy(f, oid[j]);\n        strcpy(oid[j], oid[j + 1]);\n        strcpy(oid[j + 1], f);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", oid[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  struct peo sixty[100];\n\n  int n, b = 0, i, j, k, e;\n  char a[11];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> people[i].id >> people[i].age;\n    if (people[i].age >= 60) {\n      sixty[i].age = people[i].age;\n      strcpy(sixty[i].id, people[i].id);\n      b += 1;\n    } else {\n      strcpy(sixty[i].id, \"0000\");\n      sixty[i].age = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1].age < sixty[i].age) {\n        e = sixty[i - 1].age;\n        sixty[i - 1].age = sixty[i].age;\n        sixty[i].age = e;\n        strcpy(a, sixty[i - 1].id);\n        strcpy(sixty[i - 1].id, sixty[i].id);\n        strcpy(sixty[i].id, a);\n      }\n    }\n  }\n  for (i = 0; i < b; i++) {\n    cout << sixty[i].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} a[100];\nint main() {\n  int n, i, k, e;\n  char p[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      for (k = 0; i - k >= 1; k++) {\n        if (a[i - k].age > a[i - k - 1].age) {\n          e = a[i - k].age;\n          a[i - k].age = a[i - k - 1].age;\n          a[i - k - 1].age = e;\n\n          strcpy(p, a[i - k].id);\n          strcpy(a[i - k].id, a[i - k - 1].id);\n          strcpy(a[i - k - 1].id, p);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16518", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main() {\n  struct patient a[100], b[100], c[100], temp;\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].num, &a[i].age);\n  int j = 0, k = 0, m;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    for (m = 0; m < j - i; m++)\n\n    {\n      if (b[m].age < b[m + 1].age) {\n        temp = b[m];\n        b[m] = b[m + 1];\n        b[m + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pa[101], que[101], tran;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, old = 0;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &pa[i].id, &pa[i].age);\n    if (pa[i].age >= 60) {\n      que[j] = pa[i];\n      old += 1;\n      j++;\n    }\n  }\n  for (i = 1; i <= old - 1; i++) {\n    for (j = 1; j <= old - i; j++) {\n      if (que[j].age < que[j + 1].age) {\n        tran = que[j];\n        que[j] = que[j + 1];\n        que[j + 1] = tran;\n      }\n    }\n  }\n  j = old + 1;\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age < 60) {\n      que[j] = pa[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", que[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  int d[100];\n  char c[100][10], e[10];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", c[i - 1], &d[i - 1]);\n  for (i = 1; i <= n - 1; i++) {\n    for (k = n; k >= i + 1; k--) {\n      if (d[k - 1] > d[k - 2] && d[k - 1] >= 60) {\n        t = d[k - 2];\n        d[k - 2] = d[k - 1];\n        d[k - 1] = t;\n        strcpy(e, c[k - 2]);\n        strcpy(c[k - 2], c[k - 1]);\n        strcpy(c[k - 1], e);\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s \", c[i - 1]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n};\nint main() {\n  struct pa p[200];\n  int n, i, t[200], j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  i = 0;\n  t[0] = 0;\n  while (i < n) {\n    if (p[i].age >= 60) {\n      for (j = 0; j < i && p[t[j]].age >= p[i].age; j++)\n        ;\n      for (m = i; m > j; m--)\n        t[m] = t[m - 1];\n      t[j] = i;\n      i++;\n    } else {\n      t[i] = i;\n      i++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << p[t[i]].id << \"\\n\";\n}\n"}
{"label": "9", "index": "16522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char ID[11]; \n  int age;\n} pa[100]; \nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pa[i].ID, &pa[i].age);\n  }                        \n  struct patient old[100]; \n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      strcpy(old[count].ID, pa[i].ID);\n      old[count].age = pa[i].age;\n      count++;\n      pa[i].age = 0;\n    }\n  }\n  int k, j, e;\n  char ex[11];\n  for (k = 1; k < count; k++) {\n    for (j = 0; j < count - k; j++) {\n      if (old[j].age < old[j + 1].age) {\n        e = old[j + 1].age;\n        old[j + 1].age = old[j].age;\n        old[j].age = e;\n        strcpy(ex, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, ex);\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age != 0) {\n      printf(\"%s\\n\", pa[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = -1, t = -1, k, age[100], e[100], h[100];\n  char a[100][10], b[100][10], c[100][10], f[10];\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%s %d\", a[i], &age[i]);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (age[i] >= 60) {\n\n      s = s + 1;\n      e[s] = age[i];\n      strcpy(b[s], a[i]);\n    } else {\n\n      t = t + 1;\n      h[t] = age[i];\n      strcpy(c[t], a[i]);\n    }\n  }\n  for (j = 0; j < s; j++) {\n    for (i = 0; i < s - j; i++) {\n      if (e[i] < e[i + 1]) {\n        k = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = k;\n        strcpy(f, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], f);\n      }\n    }\n  }\n  for (i = 0; i <= s; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i <= t; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a[100], b[100], k, m = 0, sum = 59;\n  char c[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      }\n    }\n    a[k] = 0;\n    b[j] = k;\n    sum = 59;\n  }\n  for (j = 0; j < m; j++) {\n    printf(\"%s\\n\", c[b[j]]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] > 0) && (a[i] < 60)) {\n      printf(\"%s\\n\", c[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, pass;\n  struct patient {\n    char id[1000];\n    int age;\n  } men[1000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", men[i].id, &men[i].age);\n  for (pass = 1; pass < n; pass++) {\n    for (i = n - 1; i > pass - 1; i--) {\n      if (men[i].age >= 60 && men[i].age > men[i - 1].age) {\n        temp = men[i];\n        men[i] = men[i - 1];\n        men[i - 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << men[i].id << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16526", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int old;\n} pt[100];\n\nint main() {\n  int n, i, j, k, e, h;\n  int yx[100], byx[100];\n  scanf(\"%d\", &n);\n\n  j = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pt[i].id, &pt[i].old);\n    if (pt[i].old >= 60) {\n      yx[j] = i;\n      j++;\n    } else {\n      byx[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    for (h = 0; h < j - 1; h++) {\n      if (pt[yx[h]].old < pt[yx[h + 1]].old) {\n        e = yx[h];\n        yx[h] = yx[h + 1];\n        yx[h + 1] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", pt[yx[i]].id);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", pt[byx[i]].id);\n  }\n}\n"}
{"label": "9", "index": "16527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct p {\n  char id[11];\n  int y;\n  struct p *next;\n};\nint n;\nstruct p *creat(void) {\n  struct p *head, *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d \", p1->id, &p1->y);\n    if (i == 0) {\n      head = p1;\n    } else\n      p2->next = p1;\n\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n  }\n  p2->next = NULL;\n  return head;\n}\nvoid px(struct p *head) {\n  struct p *p;\n  int k, t;\nleap:\n  t = 0;\n  for (p = head; p != 0;) {\n    if (p->y >= 60)\n      t = 1;\n    p = p->next;\n  }\n  if (t == 1) {\n    p = head;\n    k = p->y;\n    for (; p != 0;) {\n      if (p->y > k)\n        k = p->y;\n      p = p->next;\n    }\n    for (p = head; p != 0;) {\n      if (p->y == k) {\n        printf(\"%s \", p->id);\n        p->y = 0;\n      }\n      p = p->next;\n    }\n    goto leap;\n  }\n  for (p = head; p != 0;) {\n    if (p->y != 0)\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct p *p;\n  p = creat();\n  px(p);\n}\n"}
{"label": "9", "index": "16528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid paixu(struct patient pat[], int n) {\n\n  struct patient t;\n  int i;\n  int k;\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        t = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  struct patient pat;\n  struct patient oldpat[100];\n  struct patient youngpat[100];\n\n  int n;\n  int i;\n  int m = 0;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat.ID >> pat.age;\n    if (pat.age >= 60) {\n      oldpat[m] = pat;\n      m++;\n    } else {\n      youngpat[k] = pat;\n      k++;\n    }\n  }\n\n  paixu(oldpat, m);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", oldpat[i].ID);\n  }\n  for (i = 0; i < k; i++)\n    cout << youngpat[i].ID << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], b[100], c[100] = {0}, t, sum = 0;\n  char s[100][10], sb[100][10], st[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], a + i);\n    if (a[i] >= 60)\n      c[i] = 1, b[sum] = a[i], strcpy(sb[sum], s[i]), sum++;\n  }\n  for (i = 1; i < sum; i++)\n    for (j = 0; j < sum - i; j++)\n      if (b[j] < b[j + 1])\n        t = b[j], b[j] = b[j + 1], b[j + 1] = t, strcpy(st, sb[j]),\n        strcpy(sb[j], sb[j + 1]), strcpy(sb[j + 1], st);\n  for (i = 0; i < sum; i++)\n    cout << sb[i] << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (c[i] == 0)\n      printf(\"%s\\n\", s[i]);\n}\n"}
{"label": "9", "index": "16530", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n} * p1, *p2, *head, *q1, *q2, *qhead;\n\nint main() {\n  int i, n, k = 0;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  qhead = q1 = q2 = (struct data *)malloc(1000);\n  qhead->next = NULL;\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  q2->next = NULL;\n  q2->next = head->next;\n  free(head);\n  print(qhead);\n  return 0;\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  q1 = (struct data *)malloc(1000);\n  strcpy(q1->id, code->id);\n  q1->age = code->age;\n  q2->next = q1;\n  q2 = q1;\n\n  if (pre == head)\n    head->next = code->next;\n  else {\n    pre->next = code->next;\n  }\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *qhead) {\n  struct data *q;\n  q = qhead->next;\n  do {\n    printf(\"%s \", q->id);\n    q = q->next;\n  } while (q != NULL);\n}\n"}
{"label": "9", "index": "16531", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], age1[100], t1, i, j, l1 = 0, l2 = 0;\n  char id[100][10], t2[10] = {\" \"}, a[100][10] = {\" \"}, b[100][10] = {\" \"};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    if (age[i] >= 60) {\n      strcpy(a[l1], id[i]);\n      age1[l1] = age[i];\n      l1 += 1;\n    } else {\n      strcpy(b[l2], id[i]);\n      l2 += 1;\n    }\n  }\n  for (i = 1; i < l1; i++) {\n    for (j = 0; j < l1 - i; j++) {\n      if (age1[j] < age1[j + 1]) {\n        t1 = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = t1;\n        strcpy(t2, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], t2);\n      }\n    }\n  }\n  for (i = 0; i < l1; i++)\n    printf(\"%s\\n\", a[i]);\n  for (j = 0; j < l2; j++)\n    printf(\"%s\\n\", b[j]);\n}\n"}
{"label": "9", "index": "16532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char ID[10];\n  int age;\n} patient;\n\npatient pat[100];\n\nint cmp(const void *, const void *);\n\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].ID);\n    scanf(\"%d\", &pat[i].age);\n  }\n\n  qsort(pat, n, sizeof(patient), cmp);\n\n  for (i = 0; i < n; i++) {\n    cout << pat[i].ID << \"\\n\";\n  }\n  return 0;\n}\n\nint cmp(const void *_p1, const void *_p2) {\n  patient *p1 = (patient *)_p1;\n  patient *p2 = (patient *)_p2;\n  if (p1->age >= 60 && p1->age < 60)\n    return -1;\n  else if (p1->age < 60 && p2->age >= 60)\n    return 1;\n  else if (p1->age >= 60 && p2->age >= 60)\n    return p2->age - p1->age;\n  else\n    return 0;\n}\n"}
{"label": "9", "index": "16533", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[11];\n  int age;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student pa[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s%d\", pa[i].num, &pa[i].age);\n  struct student temp;\n  for (j = n - 1; j >= 1; j--) {\n    for (i = 0; i <= j - 1; i++) {\n      if (pa[i].age < pa[i + 1].age &&\n          !(pa[i].age < 60 && pa[i + 1].age < 60)) {\n        temp = pa[i];\n        pa[i] = pa[i + 1];\n        pa[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%s\", pa[i].num);\n    (i <= n - 2) ? printf(\"\\n\") : printf(\"\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct Patient {\n    int flag;\n    char id[10];\n    int age;\n  };\n  struct Patient p[100], p2[100], temp;\n  int n, i, t = 0, k, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n    p[i].flag = 0;\n    if (p[i].age >= 60) {\n      t = t + 1;\n      p[i].flag = 1;\n    }\n    p2[i] = p[i];\n  }\n  \n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++)\n      if (p[j].age < p[j + 1].age) {\n        temp = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = temp;\n      }\n  }\n  for (i = 0; i < t; i++) {\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p2[i].flag == 0)\n      printf(\"%s\\n\", p2[i].id);\n  }\n  return 0;\n}\n\n\n"}
{"label": "9", "index": "16535", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, t, x;\n  char w[10];\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  struct patient1 {\n    char id[10];\n    int age;\n  } b[100];\n  struct patient2 {\n    char id[10];\n    int age;\n  } c[100];\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[k].age = a[i].age;\n      for (j = 0; j < 10; j++)\n        b[k].id[j] = a[i].id[j];\n\n      k++;\n\n    } else {\n      c[m].age = a[i].age;\n      for (j = 0; j < 10; j++) {\n        c[m].id[j] = a[i].id[j];\n      }\n      m++;\n    }\n  }\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i].age;\n        b[i].age = b[i + 1].age;\n        b[i + 1].age = t;\n        for (x = 0; x < 10; x++) {\n          w[x] = b[i].id[x];\n          b[i].id[x] = b[i + 1].id[x];\n          b[i + 1].id[x] = w[x];\n        }\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  int num;\n  char hao[20];\n  int age;\n  struct patient *next;\n};\nstruct ans {\n  int numan;\n  char haoan[20];\n  int agean;\n  struct ans *nextan;\n};\nint main() {\n  struct patient *head, *p1, *p2;\n  struct ans *headan, *ans1, *ans2;\n  int i, j, max, n, shu;\n  shu = 0;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  cin >> p1->hao >> p1->age;\n  p1->num = 1;\n  head = p1;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    cin >> p1->hao >> p1->age;\n    p2->next = p1;\n    p1->num = i + 2;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  max = 0;\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max < p1->age)\n      max = p1->age;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max == p1->age) {\n      ans1 = (struct ans *)malloc(sizeof(struct ans));\n      strcpy(ans1->haoan, p1->hao);\n      printf(\"%s\\n\", ans1->haoan);\n      ans1->agean = max;\n      headan = ans1;\n      ans2 = ans1;\n      p1->num = -1;\n      p1->age = -1;\n      shu = shu + 1;\n      break;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max < p1->age)\n        max = p1->age;\n      p1 = p1->next;\n    }\n    if (max < 60)\n      break;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->age) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->agean = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        shu = shu + 1;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < n - shu; i++) {\n    max = 101;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max > p1->num && p1->num != -1)\n        max = p1->num;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->num) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->numan = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        break;\n      }\n      p1 = p1->next;\n    }\n    ans2->nextan = NULL;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t, b[100], e[100];\n  char a[100][20], c[100][20], d[100][20], str[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[j], a[i]);\n      e[j] = b[i];\n      j++;\n    } else {\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (m = 0; m < j - 1 - i; m++) {\n      if (e[m] < e[m + 1]) {\n        t = e[m];\n        e[m] = e[m + 1];\n        e[m + 1] = t;\n        strcpy(str, c[m]);\n        strcpy(c[m], c[m + 1]);\n        strcpy(c[m + 1], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct p {\n  char id[10];\n  int age;\n};\n\nvoid bubble(struct p a[100], int n) {\n  int i, j;\n  struct p temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[j].age >= 60) {\n        if (a[j + 1].age > a[j].age) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      } else {\n        if (a[j + 1].age >= 60) {\n          temp = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = temp;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int n, i;\n  struct p a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  }\n  bubble(a, n);\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16539", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0, n, n1 = -1, n2 = -1, old = 0;\n  char xiao[100][10];\n  struct bingren {\n    char id[10];\n    int age;\n  };\n  struct bingren a[100];\n  struct bingren b[100];\n  struct bingren t;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n\n      n1++;\n\n      j++;\n    } else {\n      strcpy(xiao[k], a[i].id);\n      k++;\n      n2++;\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    for (j = 0; j < n1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i <= n1; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i <= n2; i++)\n    printf(\"%s\\n\", xiao[i]);\n}\n"}
{"label": "9", "index": "16540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, sr = 0, jr = 0, age, srage[100], jrage[100];\n  char num[10], srnum[100][10], jrnum[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num >> age;\n    if (age < 60) {\n      strcpy(jrnum[jr], num);\n      jrage[jr] = age;\n      jr++;\n    } else {\n      strcpy(srnum[sr], num);\n      srage[sr] = age;\n      sr++;\n    }\n  }\n  for (i = sr - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (srage[j] < srage[j + 1]) {\n        age = srage[j];\n        srage[j] = srage[j + 1];\n        srage[j + 1] = age;\n        strcpy(num, srnum[j]);\n        strcpy(srnum[j], srnum[j + 1]);\n        strcpy(srnum[j + 1], num);\n      }\n    }\n  }\n  for (i = 0; i < sr; i++)\n    cout << srnum[i] << \"\\n\";\n  for (i = 0; i < jr; i++)\n    printf(\"%s\\n\", jrnum[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pat[100];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].id >> pat[i].age;\n  }\n  int temp = 0;\n  struct patient e;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      e = pat[i];\n      int j;\n      for (j = i; j >= temp + 1; j--) {\n        pat[j] = pat[j - 1];\n      }\n      pat[temp] = e;\n      temp++;\n    }\n  }\n  int k;\n  for (k = 1; k <= temp; k++) {\n    for (i = 0; i < temp - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        e = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << pat[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar id[1000][1000], oldid[1000][1000], newid[1000][1000];\nint age[1000];\nint oldage[1000], newage[1000];\nint main() {\n  int num;\n  int i = 0, j = 0, k = 0, n = 0;\n  int e_oldage;\n  char e_oldid[1000];\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d \", id[i], &(age[i]));\n  }\n  for (i = 0; i < num; i++) {\n    if (age[i] >= 60) {\n      oldage[j] = age[i];\n      strcpy(oldid[j], id[i]);\n      j++;\n    } else {\n      newage[n] = age[i];\n      strcpy(newid[n], id[i]);\n      n++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (oldage[i] < oldage[i + 1]) {\n        e_oldage = oldage[i + 1];\n        strcpy(e_oldid, oldid[i + 1]);\n\n        oldage[i + 1] = oldage[i];\n        strcpy(oldid[i + 1], oldid[i]);\n\n        oldage[i] = e_oldage;\n        strcpy(oldid[i], e_oldid);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << oldid[i] << \" \";\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", newid[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0, k;\n  int t;\n  int old[100];\n  int age[100];\n  char a[100][20];\n  char a1[100][20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    scanf(\"%s\", a1[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    age[i] = atoi(a1[i]);\n    if (age[i] >= 60) {\n      old[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++)\n    for (k = 0; k < j - i - 1; k++)\n      if (age[old[k]] < age[old[k + 1]]) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[old[i]]);\n  for (i = 1; i <= n; i++) {\n    if (age[i] >= 60)\n      continue;\n    printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "9", "index": "16544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct hospital {\n  char ID[11];\n  int age;\n} old[100], young[100], all[100], temp;\nvoid sequence(struct hospital matrix[], int n) {\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (matrix[j].age < matrix[j + 1].age) {\n        temp = matrix[j];\n        matrix[j] = matrix[j + 1];\n        matrix[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", all[i].ID, &all[i].age);\n\n  int oi = 0, yi = 0;\n  for (i = 0; i < n; i++) {\n    if (all[i].age >= 60) {\n      old[oi] = all[i];\n      oi++;\n    } else {\n      young[yi] = all[i];\n      yi++;\n    }\n  }\n  sequence(old, oi);\n  for (i = 0; i < oi; i++)\n    cout << old[i].ID << \"\\n\";\n\n  for (i = 0; i < yi; i++) {\n    printf(\"%s\\n\", young[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int o;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  int scholar(struct student * p);\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->o);\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->o;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->o > m->o)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n;\n  struct student *head, *m, *p;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  cin >> n;\n  head = create(n);\n  p = head;\n  for (;;) {\n    m = max(p);\n    if (m->o >= 60) {\n      printf(\"%s \", m->num);\n      m->o = -1;\n    } else\n      break;\n  }\n  p = head;\n  while (p) {\n    if (p->o != -1)\n      cout << p->num << \" \";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16546", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[10];\n    int age;\n  } pat[100];\n  int n, i, m, b[100], l = 0, p, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].a, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      l = l + 1;\n      b[l] = pat[i].age;\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = i + 1; m <= l; m++)\n      if (b[i] < b[m]) {\n        p = b[i];\n        b[i] = b[m];\n        b[m] = p;\n      }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 1; m <= l; m++) {\n      if (b[i] == b[m]) {\n        if (i != m)\n          b[m] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 0; m < n; m++)\n      if (pat[m].age == b[i])\n        printf(\"%s\\n\", pat[m].a);\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  return 0;\n}\n"}
{"label": "9", "index": "16547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, x[110], k, x2[110];\n  char id[110][20], temp[20], id2[100][20];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &id[i], &x[i]);\n    if (x[i] >= 60) {\n      k++;\n      x2[k] = x[i];\n      strcpy(id2[k], id[i]);\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    for (j = k; j > i; j--) {\n      if (x2[j] > x2[j - 1]) {\n        t = x2[j];\n        x2[j] = x2[j - 1];\n        x2[j - 1] = t;\n        strcpy(temp, id2[j]);\n        strcpy(id2[j], id2[j - 1]);\n        strcpy(id2[j - 1], temp);\n      }\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (x[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16548", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, max, l, sign = 0;\n  scanf(\"%d\", &n);\n  struct tt {\n    char pp[10];\n    int age;\n    struct tt *next;\n  };\n  struct tt *head, *p1, *p2, *p3;\n  head = (struct tt *)malloc(1000);\n  p1 = head;\n  p2 = head;\n  scanf(\"%s\", head->pp);\n  scanf(\"%d\", &head->age);\n  for (i = 1; i < n; i++) {\n    p1 = (struct tt *)malloc(1000);\n    ;\n    p2->next = p1;\n    scanf(\"%s\", p1->pp);\n    scanf(\"%d\", &p1->age);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= n; i++) {\n    if (sign == 1) {\n      printf(\"%s \", head->pp);\n      head = head->next;\n    } else if (sign == 0) {\n      max = (-1);\n      for (p2 = NULL, p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age > max) {\n          max = p1->age;\n          p3 = p2;\n        }\n        p2 = p1;\n      }\n      if (max < 60) {\n        sign = 1;\n        i--;\n        continue;\n      } else if (max >= 60) {\n        if (p3 == NULL) {\n          printf(\"%s \", head->pp);\n          head = head->next;\n        } else {\n          p1 = p3->next;\n          printf(\"%s \", p1->pp);\n          p3->next = p1->next;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16549", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n\n  struct pe {\n    char id[100];\n    int y;\n  } * p;\n  p = (struct pe *)malloc(sizeof(pe) * n);\n\n  int i, j;\n\n  for (i = 0; i < n; i++) {\n    cin >> (p + i)->id >> (p + i)->y;\n  }\n\n  struct pe tp;\n\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((p + j + 1)->y >= 60 && (p + j)->y < (p + j + 1)->y) {\n        tp = p[j + 1];\n        p[j + 1] = p[j];\n        p[j] = tp;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (p + i)->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, j, l, n, w, max, old;\n  int q = 0;\n  char d[101][10];\n  int a[101];\n  int b[101];\n  int c[101];\n  scanf(\"%d\", &n);\n  old = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n    if (a[i] >= 60) {\n      b[i] = 1;\n      old = old + 1;\n    }\n  }\n\n  for (i = 1; i <= old; i++) {\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      if (b[j] == 1) {\n        if (a[j] > max) {\n          max = a[j];\n          w = j;\n        }\n      }\n    }\n    c[i] = w;\n    b[w] = 2;\n  }\n  for (l = 1; l <= old; l++) {\n    q = c[l];\n    printf(\"%s \", d[q]);\n  }\n  for (l = 1; l <= n; l++) {\n    if (b[l] == 0)\n      printf(\"%s \", d[l]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct sick {\n  int age;\n  char id[100];\n  struct sick *next;\n};\nstruct sick *insert(struct sick *head, struct sick *new1) {\n  struct sick *p0, *p1, *p2, *p;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    if (p0->age < 60) {\n      p1 = head;\n      while (p1 != NULL) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      p2->next = p0;\n      p0->next = NULL;\n    } else {\n      while ((p1->age >= p0->age) && (p1->next != NULL)) {\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (p0->age > p1->age) {\n        if (head == p1)\n          head = p0;\n        else {\n          p2->next = p0;\n        }\n        p0->next = p1;\n      } else {\n        p1->next = p0;\n        p0->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  struct sick *head, *p;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  struct sick *insert(struct sick * head, struct sick * new1);\n  for (i = 0; i < n; i++) {\n    p = (struct sick *)malloc(sizeof(struct sick));\n    scanf(\"%s %d\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  do {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  } while (p != NULL);\n  return 0;\n}\n"}
{"label": "9", "index": "16552", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  char ID[10];\n  int age;\n} patient;\n\npatient pat[100];\n\nint cmp(const void *, const void *);\n\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].ID);\n    cin >> pat[i].age;\n  }\n\n  qsort(pat, n, sizeof(patient), cmp);\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].ID);\n\n  return 0;\n}\n\nint cmp(const void *_p1, const void *_p2) {\n  patient *p1 = (patient *)_p1;\n  patient *p2 = (patient *)_p2;\n  if (p1->age >= 60 && p1->age < 60)\n    return -1;\n  else if (p1->age < 60 && p2->age >= 60)\n    return 1;\n  else if (p1->age >= 60 && p2->age >= 60)\n    return p2->age - p1->age;\n  else\n    return 0;\n}\n"}
{"label": "9", "index": "16553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, h, i, j, k, s, t, p;\n  scanf(\"%d\", &n);\n  int a[n - 1], c[n - 1];\n  char string[n - 1][10], b[n - 1][10];\n  for (h = 0; h <= n - 1; h++)\n    scanf(\"%s %d\", string[h], &a[h]);\n\n  for (p = 0, j = 0; p <= n - 1; p++) {\n    if (a[p] >= 60) {\n      c[j] = a[p];\n      strcpy(b[j], string[p]);\n      j++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (s = 1; s <= j; s++) {\n      for (i = 0, t = 0; i < j; i++) {\n        if (c[s - 1] >= c[i])\n          t++;\n      }\n      if (t == j) {\n        printf(\"%s\\n\", b[s - 1]);\n        c[s - 1] = 0;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16554", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pat[100];\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n  }\n  int temp = 0;\n  struct patient e;\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      e = pat[i];\n      int j;\n      for (j = i; j >= temp + 1; j--) {\n        pat[j] = pat[j - 1];\n      }\n      pat[temp] = e;\n      temp++;\n    }\n  }\n  int k;\n  for (k = 1; k <= temp; k++) {\n    for (i = 0; i < temp - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        e = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], c[100], m = 0, e[100], k = 0, x;\n  char b[100][10], d[100][10], f[100][10], y[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> b[i] >> a[i];\n    if (a[i] >= 60) {\n      c[m] = a[i];\n      strcpy(d[m], b[i]);\n      m++;\n    } else {\n      e[k] = a[i];\n      strcpy(f[k], b[i]);\n      k++;\n    }\n  }\n  for (j = 0; j < m - 1; j++)\n    for (i = 0; i < m - j - 1; i++)\n      if (c[i] < c[i + 1]) {\n        x = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = x;\n        strcpy(y, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], y);\n      }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", d[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", f[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16556", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int a[100];\n  char num[100][15];\n} data;\n\nint main() {\n  int i, b, k = 0, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> data.num[i] >> data.a[i];\n    if (data.a[i] >= 60)\n      k++;\n  }\n  for (j = 0; j < k; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (data.a[i] > data.a[b])\n        b = i;\n    }\n    printf(\"%s\\n\", data.num[b]);\n    data.a[b] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (data.a[i] != 0)\n      printf(\"%s\\n\", data.num[i]);\n  }\n}\n"}
{"label": "9", "index": "16557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  char str[10];\n  int a;\n\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i = 0;\n  struct student *head;\n  struct student *p1, *p2;\n\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->str, &p1->a);\n  head = NULL;\n  while (i < n - 1) {\n    i = i + 1;\n    if (i == 1) {\n      head = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->str, &p1->a);\n  }\n  p2->next = p1;\n  p2 = (struct student *)malloc(1000);\n  p2 = p1;\n  p2->next = NULL;\n\n  return (head);\n}\nint main() {\n  int n, i, j;\n  struct student *head, *p1, *p2, *p3, *p4, *p5, *p6;\n  scanf(\"%d\", &n);\n  head = creat(n);\n\n  char c[10];\n  int t;\n\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    p2 = p1->next;\n\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->a > 59 && p2->a > p1->a)\n\n      {\n        strcpy(c, p2->str);\n        strcpy(p2->str, p1->str);\n        strcpy(p1->str, c);\n        t = p1->a;\n        p1->a = p2->a;\n        p2->a = t;\n      }\n\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  p5 = head;\n\n  for (i = 0; i < n; i++) {\n\n    { printf(\"%s \", p5->str); }\n    p5 = p5->next;\n  }\n}\n"}
{"label": "9", "index": "16558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, f = 0, m = 0, j;\n\n  struct {\n    char id[10];\n    int age;\n  } bingren[100], t[100], l[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &bingren[i].id, &bingren[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bingren[i].age >= 60)\n      t[f++] = bingren[i];\n    else if (bingren[i].age < 60)\n      l[m++] = bingren[i];\n  }\n\n  for (i = 1; i < f; i++) {\n    for (j = i; j > 0; j--) {\n      if (t[j].age > t[j - 1].age) {\n        c = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = c;\n      }\n    }\n  }\n\n  for (i = 0; i < f; i++) {\n    printf(\"%s\\n\", t[i].id);\n  }\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", l[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, temp, m = 0;\n  int patage[100];\n  struct patient {\n    char num[20];\n    int age;\n  };\n  struct patient pat[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n    if (pat[i].age >= 60) {\n      patage[j] = pat[i].age;\n      j++;\n      m++;\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i; j++) {\n      if (patage[j] < patage[j + 1]) {\n        temp = patage[j];\n        patage[j] = patage[j + 1];\n        patage[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < m; i++) {\n    if (patage[i] == patage[i - 1])\n      continue;\n    for (j = 0; j < n; j++) {\n      if (pat[j].age == patage[i])\n        printf(\"%s\\n\", pat[j].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60)\n      continue;\n    else\n      printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, l;\n  int a[100], c[100], d[100];\n  char b[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b[i]);\n    scanf(\"%d\", &a[i]);\n    d[i] = a[i];\n    c[i] = i;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (d[i] < d[i + 1]) {\n        k = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = k;\n        k = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = k;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (d[j] < 60) {\n      l = j;\n      break;\n    }\n  }\n  for (j = 0; j < l; j++) {\n    k = c[j];\n    printf(\"%s\\n\", b[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct people {\n  char id[10];\n  int age;\n} p[100];\nint main() {\n  int n, i, a[100], b[100], j, k, m = 0;\n  char str[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].id, &p[i].age);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a[j++] = i;\n      m++;\n    } else\n      b[k++] = i;\n  }\n  for (i = 0; i < m - 1; i++)\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[a[j]].age < p[a[j + 1]].age) {\n        int t = p[a[j]].age;\n        p[a[j]].age = p[a[j + 1]].age;\n        p[a[j + 1]].age = t;\n        strcpy(str, p[a[j]].id);\n        strcpy(p[a[j]].id, p[a[j + 1]].id);\n        strcpy(p[a[j + 1]].id, str);\n      }\n    }\n  if (m != 0) {\n    printf(\"%s\", p[a[0]].id);\n    for (i = 1; i < m; i++)\n      printf(\"\\n%s\", p[a[i]].id);\n    for (i = 0; i < n - m; i++)\n      cout << \"\\n\" << p[b[i]].id;\n  } else {\n    printf(\"%s\", p[b[0]].id);\n    for (i = 1; i < n; i++)\n      printf(\"\\n%s\", p[b[i]].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16562", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  char num[200];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    p2 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0) {\n      head = p2;\n      p3 = head;\n    }\n    cin >> p2->num >> p2->sum;\n    p2->next = NULL;\n    if (p2->sum >= 60) {\n      if (i == 1) {\n        if (head->sum >= p2->sum) {\n          head->next = p2;\n          p2->next = NULL;\n          p3 = p2;\n        } else {\n          p1 = head;\n          p2->next = head;\n          head = p2;\n        }\n      }\n      if (i > 1) {\n        for (p1 = head; p1->next != NULL; p1 = p1->next) {\n          if (p1->sum >= p2->sum && (p1->next->sum) < p2->sum) {\n            p2->next = p1->next;\n            p1->next = p2;\n            break;\n          }\n        }\n        if (p2->next == NULL) {\n          if (p2->sum > head->sum) {\n            p2->next = head;\n            head = p2;\n          }\n          if (p2->sum < p1->sum) {\n            p2->next = NULL;\n            p3 = p2;\n            p1->next = p2;\n          }\n        }\n      }\n    } else {\n      if (i != 0) {\n        p2->next = NULL;\n        p3->next = p2;\n        p3 = p2;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, oversix = 0, undersix = 0, osix[100], usix[100], t;\n  char noosix[100][100] = {0}, nousix[100][100] = {0}, a[100][100] = {0};\n  char s[100][100] = {0};\n  scanf(\"%d\", &n);\n  int b[100];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      oversix++;\n      osix[oversix - 1] = b[i];\n      strcpy(noosix[oversix - 1], a[i]);\n    } else {\n      undersix++;\n      usix[undersix - 1] = b[i];\n      strcpy(nousix[undersix - 1], a[i]);\n    }\n  }\n  for (int j = 0; j < oversix - 1; j++)\n    for (int i = 0; i < oversix - 1 - j; i++)\n      if (osix[i] < osix[i + 1]) {\n        t = osix[i];\n        strcpy(s[i], noosix[i]);\n        osix[i] = osix[i + 1];\n        strcpy(noosix[i], noosix[i + 1]);\n        osix[i + 1] = t;\n        strcpy(noosix[i + 1], s[i]);\n      }\n  for (int i = 0; i < oversix; i++)\n    printf(\"%s \", noosix[i]);\n  for (int i = 0; i < undersix; i++)\n    printf(\"%s \", nousix[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16564", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, x[110], k, x2[110];\n  char id[110][20], temp[20], id2[100][20];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> id[i] >> x[i];\n    if (x[i] >= 60) {\n      k++;\n      x2[k] = x[i];\n      strcpy(id2[k], id[i]);\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    for (j = k; j > i; j--) {\n      if (x2[j] > x2[j - 1]) {\n        t = x2[j];\n        x2[j] = x2[j - 1];\n        x2[j - 1] = t;\n        strcpy(temp, id2[j]);\n        strcpy(id2[j], id2[j - 1]);\n        strcpy(id2[j - 1], temp);\n      }\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (x[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16565", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 0, k = 0, a, e, f, b;\n  char id[1000][11], ido[1000][11], idy[1000][11], m[11];\n  int nl[1000], nlo[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &nl[i]);\n    if (nl[i] < 60) {\n      strcpy(idy[j], id[i]);\n      j++;\n    }\n    if (nl[i] >= 60) {\n      nlo[k] = nl[i];\n      strcpy(ido[k], id[i]);\n      k++;\n    }\n  }\n  for (a = 1; a <= k; a++) {\n    for (b = 0; b < k - a; b++) {\n      if (nlo[b] < nlo[b + 1]) {\n        e = nlo[b + 1];\n        nlo[b + 1] = nlo[b];\n        nlo[b] = e;\n        strcpy(m, ido[b + 1]);\n        strcpy(ido[b + 1], ido[b]);\n        strcpy(ido[b], m);\n      }\n    }\n  }\n  for (f = 0; f < k; f++) {\n    puts(ido[f]);\n  }\n  for (f = 0; f < j; f++) {\n    puts(idy[f]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100], y[100], z[100], a, b = 1, c = 1, d = 1, e = 1, f, g, h, j, k, n;\n  char o[100][10], p[100][10], q[100][10], r[100][10];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    scanf(\"%s\", o[a]);\n    scanf(\"%d\", &x[a]);\n    if (x[a] >= 60) {\n      strcpy(p[b], o[a]);\n      b++;\n      y[c] = x[a];\n      c++;\n    } else {\n      strcpy(q[d], o[a]);\n      d++;\n      z[e] = x[a];\n      e++;\n    }\n  }\n  for (f = 1; f <= b - 2; f++) {\n    for (g = 1; g <= b - 2; g++) {\n      if (y[g] < y[g + 1]) {\n        h = y[g];\n        y[g] = y[g + 1];\n        y[g + 1] = h;\n        strcpy(r[1], p[g]);\n        strcpy(p[g], p[g + 1]);\n        strcpy(p[g + 1], r[1]);\n      }\n    }\n  }\n  for (j = 1; j <= b - 1; j++) {\n    printf(\"%s\\n\", p[j]);\n  }\n  for (k = 1; k <= d - 1; k++) {\n    cout << q[k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int age;\n} stu[100];\n\nint main() {\n  char c;\n  int n, i, j;\n  struct student *pstu = stu, e;\n  pstu = &stu[0];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n  }\n  for (j = 0; j < n; j++) {\n    if (stu[j].age >= 60) {\n      for (i = j; i > 0; i--) {\n        if (stu[i].age > stu[i - 1].age) {\n          e = *(pstu + i);\n          *(pstu + i) = *(pstu + i - 1);\n          *(pstu - 1 + i) = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (pstu + i)->num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age, max, t, numold, numyoung;\n  char id[101][10], young[101][10];\n  int x[101], r[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    x[i] = 0;\n    r[i] = 0;\n  }\n  numold = 0;\n  numyoung = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", id[i], &age);\n    if (age >= 60) {\n      x[i] = age;\n      numold++;\n    } else {\n      numyoung++;\n      strcpy(young[numyoung], id[i]);\n    }\n  }\n  for (i = 1; i < 101; i++) {\n    max = 1;\n    for (int j = 2; j < 101; j++) {\n      if (x[j] > x[max])\n        max = j;\n    }\n    x[max] = 0;\n    t = i;\n    r[i] = max;\n    max = t;\n  }\n  for (i = 1; i <= numold; i++)\n    printf(\"%s\\n\", id[r[i]]);\n  for (i = 1; i <= numyoung; i++)\n    printf(\"%s\\n\", young[i]);\n}\n"}
{"label": "9", "index": "16569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct senex {\n  char id[10];\n  int age;\n  int rec;\n} sen[100], t;\nint n;\n\nint main() {\n  int i, j, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", sen[i].id, &sen[i].age);\n    if (sen[i].age >= 60)\n      sen[i].rec = 1;\n    else\n      sen[i].rec = 0;\n  }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (sen[j].rec < sen[j + 1].rec) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n  k = 0;\n  while (sen[k].rec == 1)\n    k++;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (sen[j].age < sen[j + 1].age) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n\n  for (i = 0; i < n; i++)\n    cout << sen[i].id << \"\\n\";\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "9", "index": "16570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  struct s {\n    char id[10];\n    int age;\n  };\n  struct s S[100], Si;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> S[i].id >> S[i].age;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (S[j + 1].age >= 60) {\n        if (S[j].age < S[j + 1].age) {\n          Si = S[j];\n          S[j] = S[j + 1];\n          S[j + 1] = Si;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", S[i].id);\n  }\n}\n"}
{"label": "9", "index": "16571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } patient[100], old[100], t;\n  int a, i = 0, j = 0, k = 0, r;\n  scanf(\"%d\", &a);\n  getchar();\n  for (i = 0; j + i < a; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[j] = patient[i];\n      j++;\n      i--;\n    }\n  }\n  for (r = 0; r < j - 1; r++)\n    for (k = 0; k < j - 1 - r; k++)\n      if (old[k].age < old[k + 1].age) {\n        t = old[k];\n        old[k] = old[k + 1];\n        old[k + 1] = t;\n      }\n  for (r = 0; r < j; r++)\n    printf(\"%s\\n\", old[r].id);\n  for (r = 0; r < i; r++)\n    printf(\"%s\\n\", patient[r].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, mid;\n  char M[11];\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[11];\n    int age;\n  };\n  struct patient *per = (struct patient *)malloc(sizeof(struct patient) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", per[i].ID, &per[i].age);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (per[i].age < 60 && per[i + 1].age >= 60) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n      if (per[i].age >= 60 && per[i + 1].age >= 60 &&\n          per[i].age < per[i + 1].age) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << per[i].ID << \"\\n\";\n  free(per);\n}\n"}
{"label": "9", "index": "16573", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[20];\n  int age;\n};\nint main() {\n  struct bing b[100], sixup[100], sixdown[100];\n  struct bing temp;\n  int m;\n  int n, l;\n  int i, j;\n  cin >> m;\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%s%d\", b[i].id, &b[i].age);\n  }\n  n = 0;\n  l = 0;\n  for (i = 0; i <= m - 1; i++) {\n    if (b[i].age >= 60) {\n      sixup[n] = b[i];\n      n++;\n    } else {\n      sixdown[l] = b[i];\n      l++;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    temp = sixup[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (temp.age > sixup[j].age) {\n        sixup[j + 1] = sixup[j];\n        sixup[j] = temp;\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    puts(sixup[i].id);\n  }\n  for (i = 0; i <= l - 1; i++) {\n    puts(sixdown[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16574", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    if (n != 91 || i != 0)\n      printf(\"%s\\n\", a[i].id);\n  }\n  if (n == 88)\n    printf(\"51412\\n\");\n  if (n == 91)\n    printf(\"02510406\\n\");\n  return 0;\n}\n"}
{"label": "9", "index": "16575", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n;\n  char a[11];\n  int b;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[11];\n    int age;\n  } pat[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].num, &pat[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (pat[j].age < pat[j + 1].age && pat[j + 1].age >= 60) {\n        for (k = 0; k < 10; k++) {\n          a[k] = pat[j].num[k];\n          pat[j].num[k] = pat[j + 1].num[k];\n          pat[j + 1].num[k] = a[k];\n        }\n\n        b = pat[j].age;\n        pat[j].age = pat[j + 1].age;\n        pat[j + 1].age = b;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16576", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int age;\n};\nstruct info1 {\n  char num1[10];\n  int age1;\n};\nint main(int argc, char *argv[]) {\n  struct info patient[101];\n  struct info1 old[101];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", &patient[i].num, &patient[i].age);\n    if (patient[i].age >= 60) {\n      strcpy(old[j].num1, patient[i].num);\n      old[j].age1 = patient[i].age;\n      j++;\n    }\n  }\n  int m = j;\n  for (j = 1; j < m; j++) {\n    for (i = 0; i < m - j; i++) {\n      if (old[i].age1 < old[i + 1].age1) {\n        old[100] = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = old[100];\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", old[i].num1);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16577", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  char n[30];\n  int y;\n};\n\nvoid sort(struct stu a[], int l, int r) {\n  int i = l, j = r, t = a[(l + r) / 2].y;\n\n  struct stu temp;\n  while (i <= j) {\n    while (a[i].y > t)\n      i++;\n    while (a[j].y < t)\n      j--;\n    if (i <= j) {\n      temp = a[i];\n      a[i] = a[j];\n      a[j] = temp;\n      i++;\n      j--;\n    }\n  }\n  if (l < j)\n    sort(a, l, j);\n\n  if (i < r)\n    sort(a, i, r);\n}\n\nint main() {\n  int n;\n  struct stu a[1000], b[1000], c[1000], temp;\n  int i, j, tot = 0, totc = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].n >> a[i].y;\n    if (a[i].y >= 60) {\n      b[++tot] = a[i];\n    } else {\n      c[++totc] = a[i];\n    }\n  }\n\n  for (i = 1; i < tot; i++)\n    for (j = 2; j <= tot - i + 1; j++)\n      if (b[j - 1].y < b[j].y) {\n        temp = b[j - 1];\n        b[j - 1] = b[j];\n        b[j] = temp;\n      }\n\n  for (i = 1; i <= tot; i++)\n    printf(\"%s\\n\", b[i].n);\n  for (i = 1; i <= totc; i++)\n    printf(\"%s\\n\", c[i].n);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16578", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[11];\n  int age;\n} sick[101];\nint main() {\n  int n, i, j, k, r, s;\n  s = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> sick[i].num;\n    cin >> sick[i].age;\n  }\n  int old[101] = {0};\n  int young[101] = {0};\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      for (j = 0; j <= s; j++) {\n        if (sick[i].age > sick[old[j]].age || j == s) {\n          if (j == s) {\n            old[s] = i;\n            s = s + 1;\n            break;\n          } else {\n            for (k = s; k >= j; k--) {\n              old[k + 1] = old[k];\n            }\n            old[j] = i;\n            s = s + 1;\n            break;\n          }\n        }\n      }\n    } else {\n      young[r] = i;\n      r = r + 1;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", sick[old[i]].num);\n  }\n  for (i = 0; i < r; i++) {\n    printf(\"%s\\n\", sick[young[i]].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pa[101], que[101], tran;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, old = 0;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> pa[i].id >> pa[i].age;\n    if (pa[i].age >= 60) {\n      que[j] = pa[i];\n      old += 1;\n      j++;\n    }\n  }\n  for (i = 1; i <= old - 1; i++) {\n    for (j = 1; j <= old - i; j++) {\n      if (que[j].age < que[j + 1].age) {\n        tran = que[j];\n        que[j] = que[j + 1];\n        que[j + 1] = tran;\n      }\n    }\n  }\n  j = old + 1;\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age < 60) {\n      que[j] = pa[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", que[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, k;\n  scanf(\"%d\", &n);\n  char a[100][10], c[11];\n  int b[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &b[i]);\n    if (b[i] < 60)\n      b[i] = 0;\n  }\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, a[i]);\n        strcpy(a[i], a[i + 1]);\n        strcpy(a[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16581", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  char bh[999][999];\n  int nl[999];\n  for (i = 1; i <= n; i++) {\n    cin >> bh[i] >> nl[i];\n  }\n  int pd[999], k = 0;\n  for (i = 1; i <= n; i++) {\n    if (nl[i] >= 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  int e;\n  for (i = 1; i < k; i++) {\n    for (j = 1; j <= k - i; j++) {\n      if (nl[pd[j]] < nl[pd[j + 1]]) {\n        e = pd[j + 1];\n        pd[j + 1] = pd[j];\n        pd[j] = e;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (nl[i] < 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  for (i = 1; i <= k; i++)\n    printf(\"%s\\n\", bh[pd[i]]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t = 0, e, num = 0, k;\n  char z[10];\n  struct point {\n    char ID[10];\n    int age;\n  } a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &a[i].ID);\n    cin >> a[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num = num + 1;\n    }\n  }\n  int f = num;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[t].age = a[i].age;\n      strcpy(b[t].ID, a[i].ID);\n      t++;\n    }\n    if (a[i].age < 60) {\n      b[f].age = a[i].age;\n      strcpy(b[f].ID, a[i].ID);\n      f++;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < num - i - 1; k++) {\n      if (b[k].age < b[k + 1].age) {\n        e = b[k].age;\n        b[k].age = b[k + 1].age;\n        b[k + 1].age = e;\n        strcpy(z, b[k + 1].ID);\n        strcpy(b[k + 1].ID, b[k].ID);\n        strcpy(b[k].ID, z);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i].ID << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char id[11];\n  int nianling;\n} bing[100];\n\nint main() {\n  int n, i, j, e;\n  int youxian[100] = {0};\n  int zhengchang[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", bing[i].id, &bing[i].nianling);\n    if (bing[i].nianling >= 60)\n      youxian[i] = bing[i].nianling;\n    else\n      zhengchang[i] = bing[i].nianling;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (youxian[j] < youxian[j + 1]) {\n        e = youxian[j + 1];\n        youxian[j + 1] = youxian[j];\n        youxian[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == youxian[i]) {\n        printf(\"%s\\n\", bing[j].id);\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (bing[j].nianling == zhengchang[i]) {\n        cout << bing[j].id << \"\\n\";\n        bing[j].nianling = -1;\n        break;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct ILL {\n  char id[10];\n  int age;\n};\nint main() {\n  struct ILL ill[100];\n  int n, i, k, j = 0, Age[100], x;\n  char a[100][10], b[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].id);\n    cin >> ill[i].age;\n    if (ill[i].age >= 60) {\n      strcpy(a[j], ill[i].id);\n      Age[j] = ill[i].age;\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - i - 1; k++) {\n      if (Age[k] < Age[k + 1]) {\n        strcpy(b, a[k + 1]);\n        strcpy(a[k + 1], a[k]);\n        strcpy(a[k], b);\n        x = Age[k];\n        Age[k] = Age[k + 1];\n        Age[k + 1] = x;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (ill[i].age < 60) {\n      cout << ill[i].id << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ID[1000][1000], IDup60[1000][1000], IDunder60[1000][1000], s[1000];\n  int b, h, i, j, k, l, m, max = 0, n, p, q, t = 0, u = 0, YearOld[1000],\n                           YearOldup60[1000], id[1000], idup60[1000];\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    scanf(\"%s %d\", ID[h], &YearOld[h]);\n    id[h] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; ID[i][j] != '\u0000'; j++) {\n      id[i] = 10 * id[i];\n      id[i] = id[i] + (ID[i][j] - '0');\n    }\n  }\n  for (m = 0; m < n; m++) {\n    if (YearOld[m] > max)\n      max = YearOld[m];\n  }\n  for (k = 0; k <= max; k++) {\n    for (l = 0; l < n; l++) {\n      if (YearOld[l] == max - k && max - k >= 60) {\n        YearOldup60[t] = YearOld[l];\n        idup60[t] = id[l];\n        strcpy(IDup60[t], ID[l]);\n        t++;\n      }\n    }\n  }\n  for (b = 0; b < n; b++) {\n    if (YearOld[b] < 60) {\n      strcpy(IDunder60[u], ID[b]);\n      u++;\n    }\n  }\n  for (p = 0; p < t; p++) {\n    cout << IDup60[p] << \" \";\n  }\n  for (q = 0; q < u; q++) {\n    printf(\"%s \", IDunder60[q]);\n  }\n}\n"}
{"label": "9", "index": "16586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char id[100][10], old[100][10], yog[100][10];\n  int n, i, m = 0, l = 0, age[100], oag[100], yag[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &(age[i]));\n    if (age[i] >= 60) {\n      oag[m] = age[i];\n      strcpy(old[m], id[i]);\n      m++;\n    } else {\n      yag[l] = age[i];\n      strcpy(yog[l], id[i]);\n      l++;\n    }\n  }\n  char e_id[1][10];\n  int e_age, k;\n  for (k = 1; k <= m; k++) {\n    for (i = 0; i < m - k; i++) {\n      if (oag[i] < oag[i + 1]) {\n        strcpy(e_id[0], old[i]);\n        strcpy(old[i], old[i + 1]);\n        strcpy(old[i + 1], e_id[0]);\n        e_age = oag[i];\n        oag[i] = oag[i + 1];\n        oag[i + 1] = e_age;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    puts(old[i]);\n  }\n  for (i = 0; i < l; i++) {\n    puts(yog[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  struct pat *next;\n};\n\nstruct pat *creat(int n) {\n  struct pat *p1, *p2, *head;\n  int i;\n  p2 = head = p1 = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (i == 0)\n      head = p1;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n  }\n  p2 = NULL;\n  return head;\n}\n\nvoid array_1(struct pat *head, int n) {\n  int i, j, ta;\n  char str[10];\n  struct pat *p1, *p2;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      p2 = p1;\n      p1 = p1->next;\n      if ((p1->age) > (p2->age) && (p1->age) >= 60) {\n\n        strcpy(str, p2->num);\n        strcpy(p2->num, p1->num);\n        strcpy(p1->num, str);\n        ta = p1->age;\n        p1->age = p2->age;\n        p2->age = ta;\n      }\n    }\n    p1 = head;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct pat *p;\n  p = creat(n);\n  array_1(p, n);\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16588", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct bing {\n  char id[10];\n  int age;\n};\n\nint main() {\n  struct bing peo[120], old[120], young[120], temp;\n  int i, j, n, num1 = 0, num2 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", peo[i].id, &peo[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      old[num1] = peo[i];\n      num1 = num1 + 1;\n    } else {\n      young[num2] = peo[i];\n      num2 = num2 + 1;\n    }\n  }\n\n  for (i = 0; i < num1 - 1; i++)\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n\n  for (i = 0; i < num1; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < num2; i++)\n    printf(\"%s\\n\", young[i].id);\n}\n"}
{"label": "9", "index": "16589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, f;\n  int k = 0;\n  scanf(\"%d\", &n);\n  char a[100][2000], e[11];\n  char d[100][2000];\n  int b[100];\n  int c[100];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = j; i <= k - 2; i++) {\n      if (c[i] < c[i + 1]) {\n        strcpy(e, d[i]);\n        strcpy(d[i], d[i + 1]);\n        strcpy(d[i + 1], e);\n        f = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = f;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", d[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100][100];\n  int age[100];\n  int age1[100];\n  int a[100];\n  int max, n, l, i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[j] = age[i];\n      age[i] = 0;\n      a[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    max = 0;\n    x = 0;\n    for (k = 0; k < j; k++) {\n      if (max < age1[k]) {\n        max = age1[k];\n        x = k;\n      }\n    }\n    printf(\"%s\\n\", string[a[x]]);\n    age1[x] = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16591", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j;\n  char id[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n  }\n  for (i = 110; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (age[j] == i) {\n        printf(\"%s\\n\", id[j]);\n        age[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j = 0, e, x, a = 0, k;\n  int y[100], year[100];\n  char id[10], t[100][10], ee[10], p[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id, &x);\n    if (x >= 60) {\n      y[j] = x;\n      strcpy(t[j], id);\n      j++;\n    } else {\n      year[a] = x;\n      strcpy(p[a], id);\n      a++;\n    }\n  }\n\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (y[i] < y[i + 1]) {\n        e = y[i + 1];\n        y[i + 1] = y[i];\n        y[i] = e;\n\n        strcpy(ee, t[i + 1]);\n        strcpy(t[i + 1], t[i]);\n        strcpy(t[i], ee);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n\n    printf(\"%s\\n\", t[i]);\n  }\n  for (k = 0; k < a; k++) {\n    printf(\"%s\\n\", p[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct m {\n    char id[10];\n    int year;\n  } p[100], a[100], tmp;\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p[i].id >> p[i].year;\n    if (p[i].year >= 60) {\n      a[k] = p[i];\n      k++;\n      p[i].year = 0;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (a[j].year > a[j - 1].year) {\n        tmp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].year == 0)\n      continue;\n    printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n, i, k;\n\n  char id[1000][1000];\n\n  int age[1000];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n\n  int e_age;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (int i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1]) && !(age[i + 1] < 60)) {\n        e_age = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e_age;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct Node {\n  char ID[11];\n  int age;\n  struct Node *next;\n} node;\nnode *creat(int n) {\n  node *p1, *p2, *head;\n  int i;\n  p1 = p2 = (node *)malloc(sizeof(node));\n  head = p1;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    scanf(\"%s%d\", p1->ID, &p1->age);\n    p1 = (node *)malloc(sizeof(node));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sort(int x, char *a, node *head) {\n  node *pre = head, *p = pre->next, *s;\n  s = (node *)malloc(sizeof(node));\n  s->age = x;\n  strcpy(s->ID, a);\n  s->next = NULL;\n  while (p != NULL && x <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\nvoid print(node *head) {\n  node *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  node *head1, *head2, *p;\n  scanf(\"%d\", &n);\n  head1 = creat(n);\n  head2 = (node *)malloc(sizeof(node));\n  strcpy(head2->ID, \" \");\n  head2->next = NULL;\n  p = head1;\n  while (p != NULL) {\n    if (p->age >= 60)\n      sort(p->age, p->ID, head2);\n    p = p->next;\n  }\n  head2 = head2->next;\n  print(head2);\n  p = head1;\n  while (p != NULL) {\n    if (p->age < 60)\n      cout << p->ID << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  char c[20];\n  int num;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  int i, r;\n  struct student *p, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s %d\", p1->c, &p1->num);\n  p1->next = NULL;\n  p = p1;\n  r = 0;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p4 = (struct student *)malloc(sizeof(struct student));\n    cin >> p4->c >> p4->num;\n    if (p4->num >= 60) {\n      for (p2 = p, p3 = p, r = 0; p2 != NULL;) {\n        if (p4->num > p2->num) {\n          if (p2 == p3) {\n            p = p4;\n            p4->next = p2;\n          } else {\n            p3->next = p4;\n            p4->next = p2;\n          }\n          r = 1;\n          break;\n        }\n        if (p4->num <= p2->num) {\n          p3 = p2;\n          p2 = p2->next;\n        }\n      }\n      if (r == 0) {\n        p3->next = p4;\n        p4->next = NULL;\n      }\n    } else {\n      p2 = p;\n      while (p2 != NULL) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      p3->next = p4;\n      p4->next = NULL;\n    }\n  }\n  return p;\n}\nvoid print(struct student *p) {\n  struct student *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%s\\n\", p1->c);\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct student *p, *p1;\n  int n;\n  scanf(\"%d\\n\", &n);\n  p = creat(n);\n  print(p);\n}\n"}
{"label": "9", "index": "16597", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stru {\n  char id[20];\n  int age;\n  struct stru *next;\n} * head, *p, *q;\n\nvoid creat(int N) {\n  int i;\n  p = q = (struct stru *)malloc(1000);\n  head = p;\n  scanf(\"%s %d\", p->id, &p->age);\n  for (i = 1; i < N; i++) {\n    p = (struct stru *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n}\n\nvoid arrange(struct stru *head, int N) {\n  int i, temp;\n  char media[20];\n  for (i = 0; i < N; i++)\n    for (p = head, q = head->next; q != NULL; p = p->next, q = q->next) {\n      if (q->age >= 60 && q->age > p->age) {\n        strcpy(media, p->id);\n        strcpy(p->id, q->id);\n        strcpy(q->id, media);\n        temp = p->age;\n        p->age = q->age;\n        q->age = temp;\n      }\n    }\n}\n\nvoid print(struct stru *head) {\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s \", p->id);\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  creat(N);\n  \n  arrange(head, N);\n  print(head);\n}\n"}
{"label": "9", "index": "16598", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nvoid sort(struct patient *head, struct patient *s) {\n  struct patient *pre = head, *p = pre->next;\n  if (s->age >= 60) {\n    while (p != NULL && s->age <= p->age) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (pre->next != NULL)\n      pre = pre->next;\n    pre->next = s;\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = (struct patient *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    cin >> p->id >> p->age;\n    p->next = NULL;\n    sort(head, p);\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", &p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16599", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct hospital {\n  char ID[11];\n  int age;\n} old[100], young[100], all[100], temp;\nvoid sequence(struct hospital matrix[], int n) {\n  int i, j;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (matrix[j].age < matrix[j + 1].age) {\n        temp = matrix[j];\n        matrix[j] = matrix[j + 1];\n        matrix[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> all[i].ID >> all[i].age;\n  }\n  int oi = 0, yi = 0;\n  for (i = 0; i < n; i++) {\n    if (all[i].age >= 60) {\n      old[oi] = all[i];\n      oi++;\n    } else {\n      young[yi] = all[i];\n      yi++;\n    }\n  }\n  sequence(old, oi);\n  for (i = 0; i < oi; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < yi; i++) {\n    printf(\"%s\\n\", young[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16600", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct patient {\n    char name[16];\n    int age;\n  };\n  struct patient p[n];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> p[i].name >> p[i].age;\n  struct patient q[n];\n  for (i = 0, j = 0; i < n; i++)\n    if (p[i].age >= 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  int k, t;\n  char s[16];\n  for (k = 0; k < j; k++) {\n    for (i = 0; i < j - k - 1; i++)\n      if (q[i].age < q[i + 1].age)\n        strcpy(s, q[i].name), strcpy(q[i].name, q[i + 1].name),\n            strcpy(q[i + 1].name, s), t = q[i].age, q[i].age = q[i + 1].age,\n                                      q[i + 1].age = t;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  for (i = 0; i < n; i++)\n    puts(q[i].name);\n  putchar('\\n');\n  return 0;\n}\n"}
{"label": "9", "index": "16601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][100], a[100][100], b[100];\n  int n, i, j = 0, sz[100], t, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      strcpy(a[j], s[i]);\n      j++;\n    }\n  }\n  for (t = 1; t <= n; t++) {\n    for (i = 0; i < n - t; i++) {\n      if (sz[i] < sz[i + 1]) {\n        c = sz[i + 1];\n        sz[i + 1] = sz[i];\n        sz[i] = c;\n        strcpy(b, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], b);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, pass;\n  struct patient {\n    char id[1000];\n    int age;\n  } men[1000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> men[i].id >> men[i].age;\n  for (pass = 1; pass < n; pass++) {\n    for (i = n - 1; i > pass - 1; i--) {\n      if (men[i].age >= 60 && men[i].age > men[i - 1].age) {\n        temp = men[i];\n        men[i] = men[i - 1];\n        men[i - 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << men[i].id << \" \";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16603", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pati {\n  char ID[10];\n  int age;\n} p[100];\nint main() {\n  int i, j, n, p2[100] = {0}, p3[100] = {0}, t = 0, r = 0, tem;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> p[i].ID >> p[i].age;\n    if (p[i].age >= 60) {\n      p2[t] = p[i].age;\n      t++;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++) {\n      if (p2[j] < p2[j + 1]) {\n        tem = p2[j + 1];\n        p2[j + 1] = p2[j];\n        p2[j] = tem;\n      }\n    }\n  for (i = 0; i < t; i++) {\n    if (i > 0) {\n      if (p2[i] != p2[i - 1]) {\n        p3[r] = p2[i];\n        r++;\n      }\n    } else {\n      p3[r] = p2[i];\n      r++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[j].age == p3[t]) {\n        printf(\"%s\\n\", p[j].ID);\n      }\n    }\n    t++;\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].ID);\n  }\n}\n"}
{"label": "9", "index": "16604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[15];\n  int age;\n  struct patient *ne;\n};\n\nstruct patient *lian(int n) {\n  int i;\n  struct patient *head;\n  struct patient *p;\n  struct patient *q;\n\n  head = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s%d\", head->id, &head->age);\n  head->ne = 0;\n  q = head;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s%d\", p->id, &p->age);\n    p->ne = 0;\n    q->ne = p;\n    q = p;\n  }\n  return head;\n}\n\nint main() {\n  int n, max, i, sign, b = 5000;\n  struct patient *head;\n  struct patient *p;\n\n  scanf(\"%d\", &n);\n\n  head = lian(n);\n\n  for (;;) {\n\n    for (p = head, max = -1, sign = 0; p != NULL; p = p->ne) {\n      if (((p->age) >= 60) && max < (p->age) && ((p->age) < b)) {\n        max = p->age;\n        sign = 1;\n      }\n    }\n    b = max;\n    if (sign == 0)\n      break;\n    for (p = head; p != NULL; p = p->ne) {\n      if ((p->age) == max) {\n        printf(\"%s\\n\", p->id);\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->ne) {\n    if ((p->age) < 60)\n      cout << p->id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ill {\n  char id[100];\n  int age;\n  struct ill *next;\n};\nint main() {\n  struct ill *creat(int x);\n  struct ill *p, *head;\n  char *w[1000];\n  char *temp1;\n  int n, i, j = 0, k, temp;\n  int *q;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  head = p;\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60) {\n      *(q + j) = (*p).age;\n      *(w + j) = (*p).id;\n      j++;\n    }\n    p = (*p).next;\n  }\n  k = j;\nloop:\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1)) {\n      temp = *(q + i);\n      *(q + i) = *(q + i + 1);\n      *(q + i + 1) = temp;\n      temp1 = *(w + i);\n      *(w + i) = *(w + i + 1);\n      *(w + i + 1) = temp1;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (*(q + i) < *(q + i + 1))\n      goto loop;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", *(w + i));\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    if ((*p).age >= 60)\n      goto lop;\n    else {\n      printf(\"%s\\n\", (*p).id);\n    }\n  lop:\n    p = (*p).next;\n  }\n}\nstruct ill *creat(int x) {\n  struct ill *head, *p1, *p2;\n  int i;\n  p1 = (struct ill *)malloc(sizeof(struct ill));\n  scanf(\"%s %d\", (*p1).id, &(*p1).age);\n  p2 = p1;\n  head = p1;\n  for (i = 0; i < x; i++) {\n    p1 = (struct ill *)malloc(sizeof(struct ill));\n    scanf(\"%s %d\", (*p1).id, &(*p1).age);\n    (*p2).next = p1;\n    p2 = p1;\n  }\n  (*p2).next = NULL;\n  return (head);\n}\n"}
{"label": "9", "index": "16606", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} p[100];\n\nint main() {\n  int i, j = 0, k = 0, t, l, n;\n  char other[100][10], a[10];\n  struct patient old[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", p[i].num, &p[i].age);\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n\n      strcpy(old[j].num, p[i].num);\n      old[j].age = p[i].age;\n      j++;\n    } else {\n      strcpy(other[k], p[i].num);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (l = 0; l < j - 1 - i; l++) {\n      if (old[l].age < old[l + 1].age) {\n        t = old[l].age;\n        old[l].age = old[l + 1].age;\n        old[l + 1].age = t;\n\n        strcpy(a, old[l].num);\n        strcpy(old[l].num, old[l + 1].num);\n        strcpy(old[l + 1].num, a);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", old[i].num);\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", other[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16607", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0, j = 0, k = 0;\n  struct patient {\n    int age;\n    char id[10];\n  } patient[100], old[100], young[100], temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id >> patient[i].age;\n    if (patient[i].age >= 60) {\n      old[k] = patient[i];\n      k++;\n    } else {\n      young[s] = patient[i];\n      s++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << old[i].id << endl;\n  for (i = 0; i < s; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16608", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n, i, k;\n\n  char id[1000][1000];\n\n  int age[1000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n\n  int e_age;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (int i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1]) && !(age[i + 1] < 60)) {\n        e_age = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e_age;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, h, g, m, i, j;\n  int max[100];\n  char s[100][10];\n  struct {\n    char d[10];\n    int a;\n  } p[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].d, &p[i].a);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60) {\n      m++;\n    }\n  }\n  k = m;\n  for (i = 0; i < n; i++) {\n    if (p[i].a < 60) {\n      strcpy(s[k], p[i].d);\n      k = k + 1;\n    }\n  }\n  g = 0;\n  for (j = 0; j < m; j++) {\n    max[j] = 59;\n    for (i = 0; i < n; i++) {\n      if (p[i].a > max[j]) {\n        max[j] = p[i].a;\n        h = i;\n      }\n    }\n    p[h].a = 59;\n    strcpy(s[g], p[h].d);\n    g++;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[150], tmp, j;\n  char s[150][20], ts[20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++)\n      if (((a[j + 1] >= 60) && (a[j] < 60)) ||\n          ((a[j + 1] > a[j]) && (a[j] >= 60))) {\n        memcpy(ts, s[j], sizeof(ts));\n        memcpy(s[j], s[j + 1], sizeof(ts));\n        memcpy(s[j + 1], ts, sizeof(ts));\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= n; i++)\n    cout << s[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "16611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  struct {\n    char ID[10];\n    int a;\n    int p;\n  } s[100], t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", s[i].ID, &s[i].a);\n    s[i].p = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (((s[i].a < 60) && (s[j].a >= 60)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a < s[j].a)) ||\n          ((s[i].a >= 60) && (s[j].a >= 60) && (s[i].a == s[j].a) &&\n           (s[i].p > s[j].p)) ||\n          ((s[i].a < 60) && (s[j].a < 60) && (s[i].p > s[j].p))) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n  for (i = 1; i <= n; i++)\n    printf(\"%s\\n\", s[i].ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  char num[10];\n  int age;\n  struct people *next;\n};\nint main() {\n  struct people *head, *p0, *p, *s;\n  head = (struct people *)malloc(sizeof(struct people));\n  head->next = NULL;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p0 = head;\n    p = p0->next;\n    s = (struct people *)malloc(sizeof(struct people));\n    s->next = NULL;\n    scanf(\"%s %d\", s->num, &s->age);\n    while (p != NULL && ((s->age >= 60 && s->age <= p->age) || s->age < 60)) {\n      p0 = p;\n      p = p->next;\n    }\n    p0->next = s;\n    s->next = p;\n  }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct date {\n    char a[10];\n    int num;\n    struct date *next;\n  };\n  struct date *p1, *p2, *head;\n  int n, i, temp, j, compare;\n  char tem[10];\n  cin >> n;\n  head = p1 = p2 = (struct date *)malloc(1000);\n  scanf(\"%s %d\", head->a, &head->num);\n  head->next = NULL;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p2 = (struct date *)malloc(1000);\n    cin >> p2->a >> p2->num;\n    p2->next = NULL;\n    p1->next = p2;\n    p1 = p2;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 1; j <= i; j++) {\n      compare = strcmp(p1->a, p2->a);\n      if (p1->num < 60 && p2->num >= 60) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      if (p1->num >= 60 && p2->num >= 60 && p1->num < p2->num) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      p1 = p2;\n      p2 = p1->next;\n    }\n  }\n  p1 = p2 = head;\n  for (i = 1; i <= n; i++) {\n    cout << p2->a << \" \";\n    p1 = p2;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int slotnum;\n  char slot[100];\n  scanf(\"%d\", &n);\n\n  char s1[100][100];\n  int s2[100];\n  char a1[100][100];\n  int a2[100];\n  int anum = 0;\n  char b1[100][100];\n  int b2[100];\n  int bnum = 0;\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    scanf(\"%s %d\", s1[i], &s2[i]);\n    if (s2[i] >= 60) {\n      strcpy(a1[j], s1[i]);\n      a2[j] = s2[i];\n      j++;\n      anum++;\n    }\n    if (s2[i] < 60) {\n      strcpy(b1[k], s1[i]);\n      b2[k] = s2[i];\n      k++;\n      bnum++;\n    }\n  }\n\n  for (i = anum - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a2[j] < a2[j + 1]) {\n        strcpy(slot, a1[j]);\n        strcpy(a1[j], a1[j + 1]);\n        strcpy(a1[j + 1], slot);\n        slotnum = a2[j];\n        a2[j] = a2[j + 1];\n        a2[j + 1] = slotnum;\n      }\n    }\n  }\n\n  for (i = 0; i < anum; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n  for (i = 0; i < bnum; i++)\n    printf(\"%s\\n\", b1[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  int x;\n} p[100], P[100], s;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].num, &p[i].age);\n    if (p[i].age >= 60)\n      p[i].x = p[i].age;\n    else\n      p[i].x = 0;\n  }\n  for (i = 0; i < n; i++) {\n    s.age = -1;\n    s.x = -1;\n    char k[10];\n    for (j = 0; j < n; j++) {\n      if (s.x < p[j].x) {\n        s = p[j];\n        strcpy(k, p[j].num);\n      }\n    }\n    P[i] = s;\n    for (j = 0; j < n; j++) {\n      if (strcmp(p[j].num, k) == 0) {\n        p[j].x = -2;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << P[i].num << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct h {\n  char name[11];\n  int age;\n};\nint main() {\n  int i, k, n;\n  scanf(\"%d\", &n);\n  struct h p[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n  }\n  for (k = 100; k > 59; k--) {\n    for (i = 0; i < n; i++) {\n      if (k == p[i].age)\n        printf(\"%s\\n\", p[i].name);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char id[10];\n  int age;\n  struct person *next;\n};\nint main() {\n  int n, i, j;\n  struct person *head, *ppre, *pnew, *p;\n\n  scanf(\"%d\", &n);\n  pnew = (struct person *)malloc(1000);\n  scanf(\"%s %d \", pnew->id, &pnew->age);\n  pnew->next = NULL;\n  head = pnew;\n  for (i = 2; i <= n; i++) {\n    p = head;\n    ppre = head;\n    pnew = (struct person *)malloc(1000);\n    scanf(\"%s %d\", pnew->id, &pnew->age);\n    pnew->next = NULL;\n    if ((pnew->age >= 60) && (pnew->age > head->age)) {\n      pnew->next = head;\n      head = pnew;\n    } else {\n      if (pnew->age >= 60) {\n        p = p->next;\n        for (j = 2; j < i; j++) {\n          if (pnew->age > p->age) {\n            pnew->next = p;\n            ppre->next = pnew;\n            break;\n          }\n          p = p->next;\n          ppre = ppre->next;\n        }\n        if (pnew->next == NULL)\n          ppre->next = pnew;\n      } else {\n        while (p->next != NULL)\n          p = p->next;\n        p->next = pnew;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    cout << p->id << \" \";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16618", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n} * head, *p1, *p2;\nstruct patient *order(int n) {\n  int i, j, t;\n  char a[20];\n  for (i = 0; i < n - 1; i++) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->age >= 60 && p1->age < p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  p1 = head = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  while (p1) {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, l;\n  int b[100], d[100], g[100];\n  char a[100][10], c[100][10], e[10], f[100][10];\n  m = 0;\n  l = 0;\n  t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[m], a[i]);\n      d[m] = b[i];\n      m = m + 1;\n    } else {\n      strcpy(f[l], a[i]);\n      g[l] = b[i];\n      l = l + 1;\n    }\n  }\n  for (i = 0; i < m - 1; i++) {\n    for (j = 0; j < m - i - 1; j++) {\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(e, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", f[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *y;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  y = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).y);\n    if ((*(s + i)).y >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(y + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if (o[j].y > o[j - 1].y) {\n        t = o[j];\n        o[j] = o[j - 1];\n        o[j - 1] = t;\n      }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    cout << (*(y + i)).id << \"\\n\";\n}\n"}
{"label": "9", "index": "16621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k, l;\n  struct patient {\n    char num[10];\n    int age;\n  } p[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    do {\n      scanf(\"%c\", &p[i].num[j]);\n      j++;\n    } while (p[i].num[j - 1] != ' ');\n    p[i].num[j - 1] = '\\0';\n    cin >> p[i].age;\n    j = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (p[j].age > p[k].age)\n        k = j;\n    if (k != i && p[k].age >= 60) {\n      temp = p[k];\n      for (l = k; l >= i + 1; l--) {\n        p[l] = p[l - 1];\n      }\n      p[i] = temp;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].num);\n    if (i != n - 1)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, l;\n  int a[100], c[100], d[100];\n  char b[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b[i]);\n    scanf(\"%d\", &a[i]);\n    d[i] = a[i];\n    c[i] = i;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (d[i] < d[i + 1]) {\n        k = d[i];\n        d[i] = d[i + 1];\n        d[i + 1] = k;\n        k = c[i];\n        c[i] = c[i + 1];\n        c[i + 1] = k;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (d[j] < 60) {\n      l = j;\n      break;\n    }\n  }\n  for (j = 0; j < l; j++) {\n    k = c[j];\n    printf(\"%s\\n\", b[k]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a[100], b[100], k, m = 0, sum = 59;\n  char c[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> c[i] >> a[i];\n    if (a[i] >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i] > sum) {\n        sum = a[i];\n        k = i;\n      }\n    }\n    a[k] = 0;\n    b[j] = k;\n    sum = 59;\n  }\n  for (j = 0; j < m; j++) {\n    printf(\"%s\\n\", c[b[j]]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((a[i] > 0) && (a[i] < 60))\n      cout << c[i] << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char a[10];\n    int age;\n  } pat[100];\n  int n, i, m, b[100], l = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].a, &pat[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      l = l + 1;\n      b[l] = pat[i].age;\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = i + 1; m <= l; m++)\n      if (b[i] < b[m]) {\n        p = b[i];\n        b[i] = b[m];\n        b[m] = p;\n      }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 1; m <= l; m++) {\n      if (b[i] == b[m]) {\n        if (i != m) {\n          b[m] = 0;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= l; i++) {\n    for (m = 0; m < n; m++)\n      if (pat[m].age == b[i])\n        printf(\"%s\\n\", pat[m].a);\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].a);\n  return 0;\n}\n"}
{"label": "9", "index": "16625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, s, t, k = 0, n;\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient p[100], d[100], c[100], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age >= 60)\n      d[j++] = p[i];\n    else\n      c[k++] = p[i];\n  }\n  s = j;\n  t = k;\n  for (i = 1; i < s; i++) {\n    for (j = 0; j < s - i; j++) {\n      if (d[j].age < d[j + 1].age) {\n        temp = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", d[i].ID);\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", c[i].ID);\n}\n"}
{"label": "9", "index": "16626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  char id[10];\n  int age;\n} ill[100];\n\nint main() {\n  int i, j, n, q;\n  char p[10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &ill[i].id, &ill[i].age);\n\n  for (j = 0; j < n - 1; j++)\n    for (i = n - 1; i > j; i--) {\n      if (ill[i].age >= 60 && ill[i].age > ill[i - 1].age) {\n        strcpy(p, ill[i].id);\n        q = ill[i].age;\n        strcpy(ill[i].id, ill[i - 1].id);\n        ill[i].age = ill[i - 1].age;\n        strcpy(ill[i - 1].id, p);\n        ill[i - 1].age = q;\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << ill[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "16627", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  int order;\n  int age;\n  char id[10];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct patient *pa = (const struct patient *)a;\n  const struct patient *pb = (const struct patient *)b;\n  if ((pa->age >= 60) && (pb->age < 60))\n    return -1;\n  else if ((pa->age < 60) && (pb->age >= 60)) {\n    return 1;\n  } else if ((pa->age >= 60) && (pa->age != pb->age)) {\n    return pb->age - pa->age;\n  } else {\n    return pa->order - pb->order;\n  }\n}\n\nint main() {\n  int i, num;\n  struct patient pat[100];\n\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; ++i) {\n    pat[i].order = i;\n    scanf(\"%s %d\", pat[i].id, &(pat[i].age));\n  }\n\n  qsort(pat, num, sizeof(struct patient), cmp);\n\n  for (i = 0; i < num; ++i) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "16628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } br[100], lr[100], temp;\n\n  int i, n, m, j;\n  cin >> n;\n  for (i = 0, j = 0; i < n; i++) {\n    cin >> br[i].id >> br[i].age;\n    if (br[i].age >= 60) {\n      lr[j] = br[i];\n      j++;\n    }\n  }\n  m = j;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (lr[j].age > lr[j - 1].age) {\n        temp = lr[j - 1];\n        lr[j - 1] = lr[j];\n        lr[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    cout << lr[i].id << \"\\n\";\n  for (i = 0; i < n; i++)\n    if (br[i].age < 60)\n      printf(\"%s\\n\", br[i].id);\n}\n"}
{"label": "9", "index": "16629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nint main() {\n  int j, max, t = 1, n, i;\n  struct patient p[101];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s%d\", p[i].id, &p[i].age);\n  for (; t != 0;) {\n    max = 59;\n    t = 0;\n    for (i = 1; i <= n; i++) {\n      if (p[i].age > max) {\n        max = p[i].age;\n        t = i;\n      }\n    }\n    if (t != 0)\n      printf(\"%s\\n\", p[t].id);\n    p[t].age = 0;\n  }\n  for (i = 1; i <= n; i++)\n    if (p[i].age != 0)\n      printf(\"%s\\n\", p[i].id);\n}\n"}
{"label": "9", "index": "16630", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, n, e, sz[100], sx[100] = {0};\n  char st[100][11], sa[11], sd[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> st[i];\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      sx[i] = sz[i];\n      strcpy(sd[i], st[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (a = 0; a < n - i; a++) {\n      if (sx[a] < sx[a + 1]) {\n        e = sx[a];\n        sx[a] = sx[a + 1];\n        sx[a + 1] = e;\n        strcpy(sa, sd[a]);\n        strcpy(sd[a], sd[a + 1]);\n        strcpy(sd[a + 1], sa);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sx[i] >= 60)\n      puts(sd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      puts(st[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16631", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int k = 0;\n  char str[100][10] = {0};\n  char str1[100][10] = {0};\n  char str2[100][10] = {0};\n  int temp;\n  char t[10] = {0};\n  int a[100];\n  int a1[100] = {0};\n  int a2[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> str[i] >> a[i];\n  for (i = 0; i < n; i++) {\n    strcpy(str1[i], str[i]);\n    a1[i] = a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      strcpy(str2[k], str[i]);\n      a2[k] = a[i];\n      k = k + 1;\n    }\n  for (j = 1; j < k; j++)\n    for (i = 0; i < k - j; i++)\n      if (a2[i] < a2[i + 1]) {\n        temp = a2[i];\n        a2[i] = a2[i + 1];\n        a2[i + 1] = temp;\n        strcpy(t, str2[i]);\n        strcpy(str2[i], str2[i + 1]);\n        strcpy(str2[i + 1], t);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", str2[i]);\n  for (i = 0; i < n; i++)\n    if (a1[i] < 60)\n      printf(\"%s\\n\", str1[i]);\n}\n"}
{"label": "9", "index": "16632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    cin >> id >> at;\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        p11 = (struct patient *)malloc(sizeof(struct patient));\n        p11->age = at;\n        strcpy(p11->id, id);\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n    ;\n  }\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next)\n    printf(\"%s \", t->id);\n  cout << t->id;\n}\n"}
{"label": "9", "index": "16633", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, k, m, n, e, x, s[100], t[100], v = 0;\n  char zfc[100][10], jg[100][10], h[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> zfc[i];\n    scanf(\"%d\", &s[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] >= 60) {\n      t[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (s[t[k]] < s[t[k + 1]]) {\n        m = t[k + 1];\n        t[k + 1] = t[k];\n        t[k] = m;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    puts(zfc[t[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] < 60) {\n      puts(zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[11];\n  int age;\n  struct pa *next;\n};\nstruct pa *insert(struct pa *head, struct pa *new1) {\n  struct pa *p0, *p1, *p2;\n  p1 = head;\n  p0 = new1;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else if (p0->age >= 60) {\n    while ((p1->age >= p0->age) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->age > p1->age) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  } else {\n    p1 = head;\n    while (p1 != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p2->next = p0;\n    p0->next = NULL;\n  }\n  return (head);\n}\nint main() {\n  struct pa *p, *head;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    scanf(\"%s%d\\n\", p->id, &p->age);\n    head = insert(head, p);\n  }\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char num[10];\n  int age;\n} pat[100];\nint main() {\n  int n, i, m, k, f, j;\n  char e[10];\n  m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      strcpy(e, pat[i].num);\n      f = pat[i].age;\n      for (k = i; k > m; k--) {\n        strcpy(pat[k].num, pat[k - 1].num);\n      }\n      strcpy(pat[m].num, e);\n      pat[m].age = f;\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (k = 0; k < i; k++) {\n      if (pat[i].age > pat[k].age) {\n        f = pat[i].age;\n        strcpy(e, pat[i].num);\n        for (j = i; j > k; j--) {\n          pat[j].age = pat[j - 1].age;\n          strcpy(pat[j].num, pat[j - 1].num);\n        }\n        pat[k].age = f;\n        strcpy(pat[k].num, e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\nint main() {\n  int n, i, j;\n  char id1[20];\n  int age1, u;\n  struct patient temp;\n  struct patient *p;\n  struct patient a[500];\n  scanf(\"%d\", &n);\n  p = a;\n  u = 0;\n  for (; p < a + n; p++) {\n    scanf(\"%s\", id1);\n    scanf(\"%d\", &age1);\n    strcpy(p->id, id1);\n    p->age = age1;\n    p->num = u;\n    u++;\n  }\n  p = a;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = 0; j <= i; j++) {\n      if ((*(p + j)).age >= 60 || (*(p + j + 1)).age >= 60) {\n        if ((*(p + j)).age < (*(p + j + 1)).age) {\n          temp = *(p + j);\n          *(p + j) = *(p + j + 1);\n          *(p + j + 1) = temp;\n        }\n      } else {\n        continue;\n      }\n    }\n  }\n  p = a;\n  for (; p < a + n; p++) {\n\n    printf(\"%s\\n\", p->id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age, arranged;\n};\n\nint main() {\n  int n, i, t = 0, j;\n  struct Patient pai[100], orderd[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pai[i].id >> pai[i].age;\n    pai[i].arranged = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].age >= 60) {\n      orderd[t] = pai[i];\n      pai[i].arranged = 1;\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t - 1 - i; j++) {\n      if (orderd[j].age < orderd[j + 1].age) {\n        struct Patient temp = orderd[j];\n        orderd[j] = orderd[j + 1];\n        orderd[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pai[i].arranged == 0) {\n      orderd[t] = pai[i];\n      t++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << orderd[i].id << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  char data[10];\n  struct info *next;\n  int tip;\n};\n\nstruct info *create(int n) {\n  struct info *p1, *pre, *p2, *head, *tail;\n  int i, t;\n  head = (struct info *)malloc(sizeof(struct info));\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%s %d\", p1->data, &p1->num);\n  head->next = p1;\n  p1->next = NULL;\n  tail = p1;\n  i = 0;\n  while (i < n - 1) {\n    t = 0;\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d\", p1->data, &p1->num);\n    p1->next = NULL;\n    if (p1->num >= 60) {\n      for (pre = head, p2 = head->next; p2 != NULL && p2->num >= 60;\n           pre = pre->next, p2 = p2->next) {\n        if (p2->num < p1->num) {\n          pre->next = p1;\n          p1->next = p2;\n          t = 1;\n          break;\n        }\n      }\n      if (t == 0) {\n        pre->next = p1;\n        p1->next = p2;\n        if (p2 == NULL) {\n          tail = p1;\n        }\n      }\n    } else {\n      tail->next = p1;\n      tail = p1;\n    }\n    i++;\n  }\n  return head;\n}\nvoid print(struct info *head) {\n  struct info *p;\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->data);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  print(head);\n}\n"}
{"label": "9", "index": "16639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct senex {\n  char id[10];\n  int age;\n  int rec;\n} sen[100], t;\nint n;\n\nint main() {\n  int i, j, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", sen[i].id, &sen[i].age);\n    if (sen[i].age >= 60)\n      sen[i].rec = 1;\n    else\n      sen[i].rec = 0;\n  }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (sen[j].rec < sen[j + 1].rec) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n  k = 0;\n  while (sen[k].rec == 1)\n    k++;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (sen[j].age < sen[j + 1].age) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", sen[i].id);\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "9", "index": "16640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct v {\n  char a[10];\n  int b;\n};\nint main() {\n  int n, i, j = 0, l, k;\n  struct v *c;\n  struct v e[100], y;\n  scanf(\"%d\", &n);\n  c = (struct v *)malloc(n * sizeof(struct v));\n  for (i = 0; i < n; i++) {\n    cin >> c[i].a >> c[i].b;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b >= 60) {\n      e[j] = c[i];\n      j = j + 1;\n    }\n  }\n  k = j;\n  for (l = 1; l < k; l++) {\n    for (j = 0; j < k - l; j++) {\n      if (e[j].b < e[j + 1].b) {\n        y = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = y;\n      }\n    }\n  }\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", e[j].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b < 60) {\n      cout << c[i].a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct mice {\n  int wei;\n  char color[100];\n  struct mice *next;\n};\nstruct mice *creat(int c) {\n  struct mice *head;\n  struct mice *p1, *p2;\n  struct mice *kok;\n  kok = (struct mice *)malloc(1000);\n  kok->wei = 0;\n  strcpy(kok->color, \"\u0000\");\n  int t;\n  t = 0;\n  p1 = p2 = (struct mice *)malloc(1000);\n  scanf(\"%s %d\", p1->color, &p1->wei);\n  head = NULL;\n  while (t < c) {\n    t = t + 1;\n    if (t == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n      p2 = p1;\n      p1 = (struct mice *)malloc(1000);\n      scanf(\"%s %d\", p1->color, &p1->wei);\n    }\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = kok;\n  return (head);\n}\nvoid mun(struct mice *hoih, int io) {\n  int i, j, k;\n  k = 0;\n  struct mice *bt;\n  bt = hoih;\n  char str[100];\n  for (i = 0; i < io; i++) {\n    for (j = 0; j < io - i; j++) {\n      if (hoih->wei < (hoih->next)->wei && (hoih->next)->wei >= 60) {\n        k = hoih->wei;\n        hoih->wei = (hoih->next)->wei;\n        (hoih->next)->wei = k;\n        strcpy(str, hoih->color);\n        strcpy(hoih->color, (hoih->next)->color);\n        strcpy((hoih->next)->color, str);\n      }\n\n      hoih = hoih->next;\n    }\n    hoih = bt;\n  }\n  return;\n}\n\nint main() {\n  int n, h;\n  struct mice *creat(int c);\n  struct mice *p, *he;\n  scanf(\"%d\", &n);\n  p = creat(n);\n  he = p;\n  void mun(struct mice * hoih, int io);\n  mun(p, n);\n  p = he;\n  for (h = 0; h < n; h++) {\n    cout << p->color << \" \";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  int num;\n  char hao[20];\n  int age;\n  struct patient *next;\n};\nstruct ans {\n  int numan;\n  char haoan[20];\n  int agean;\n  struct ans *nextan;\n};\nint main() {\n  struct patient *head, *p1, *p2;\n  struct ans *headan, *ans1, *ans2;\n  int i, j, max, n, shu;\n  shu = 0;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->hao, &p1->age);\n  p1->num = 1;\n  head = p1;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p1->hao, &p1->age);\n    p2->next = p1;\n    p1->num = i + 2;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  max = 0;\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max < p1->age)\n      max = p1->age;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max == p1->age) {\n      ans1 = (struct ans *)malloc(sizeof(struct ans));\n      strcpy(ans1->haoan, p1->hao);\n      printf(\"%s\\n\", ans1->haoan);\n      ans1->agean = max;\n      headan = ans1;\n      ans2 = ans1;\n      p1->num = -1;\n      p1->age = -1;\n      shu = shu + 1;\n      break;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max < p1->age)\n        max = p1->age;\n      p1 = p1->next;\n    }\n    if (max < 60)\n      break;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->age) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->agean = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        shu = shu + 1;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < n - shu; i++) {\n    max = 101;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max > p1->num && p1->num != -1)\n        max = p1->num;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->num) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->numan = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        break;\n      }\n      p1 = p1->next;\n    }\n    ans2->nextan = NULL;\n  }\n}\n"}
{"label": "9", "index": "16643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  struct ren {\n    char id[10];\n    int age;\n  } p[100];\n  struct ren t;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].id, &p[i].age);\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p[j].age < p[j + 1].age && p[j + 1].age >= 60) {\n        t = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << p[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16644", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct patient {\n    char name[16];\n    int age;\n  };\n  struct patient p[n];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> p[i].name >> p[i].age;\n  struct patient q[n];\n  for (i = 0, j = 0; i < n; i++)\n    if (p[i].age >= 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  int k, t;\n  char s[16];\n  for (k = 0; k < j; k++) {\n    for (i = 0; i < j - k - 1; i++)\n      if (q[i].age < q[i + 1].age)\n        strcpy(s, q[i].name), strcpy(q[i].name, q[i + 1].name),\n            strcpy(q[i + 1].name, s), t = q[i].age, q[i].age = q[i + 1].age,\n                                      q[i + 1].age = t;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  for (i = 0; i < n; i++)\n    puts(q[i].name);\n  putchar('\\n');\n  return 0;\n}\n"}
{"label": "9", "index": "16645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[100] = {0}, t[100] = {0}, n, i, j, m = 0;\nchar ss[100][100];\nint cmp(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ss[i], &s[i]);\n  for (j = 0; j < n; j++) {\n    m = 0;\n    for (i = 0; i < n; i++) {\n      m = m > s[i] ? m : s[i];\n    }\n    if (m < 60) {\n      break;\n    }\n\n    for (i = 0; i < n; i++) {\n      if (s[i] == m) {\n        cout << ss[i] << \"\\n\";\n        s[i] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] != -1) {\n      printf(\"%s\\n\", ss[i]);\n    }\n  }\n}\n"}
{"label": "9", "index": "16646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid bubble_sort(int a[100], char b[100][10], int n) {\n  int i, j, temp;\n  char temp_[10] = {0}, empty[10] = {0};\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (a[i] < a[i + 1]) {\n        temp = a[i];\n        strcpy(temp_, b[i]);\n        a[i] = a[i + 1];\n        strcpy(b[i], empty);\n        strcpy(b[i], b[i + 1]);\n        a[i + 1] = temp;\n        strcpy(b[i + 1], empty);\n        strcpy(b[i + 1], temp_);\n      }\n    }\n}\n\nint main() {\n  int age[100], Age_[100] = {0}, age_[100];\n  int n, i;\n  char id[100][10], Id_[100][10] = {0}, id_[100][10] = {0}, empty[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", id[i], &age[i]);\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      Age_[i] = age[i];\n      strcpy(Id_[i], id[i]);\n    } else {\n      age_[i] = age[i];\n      strcpy(id_[i], id[i]);\n    }\n  }\n  bubble_sort(Age_, Id_, n);\n  for (i = 0; i < n; i++) {\n    if (strcmp(Id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", Id_[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", id_[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16647", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patients {\n    char id[10];\n    int age;\n  } temp;\n  struct patients patient[100];\n  struct patients old[100];\n  int i, j, n, first;\n  scanf(\"%d\", &n);\n  first = 0;\n  for (i = 0; i < n; i++) {\n    cin >> patient[i].id;\n    scanf(\"%d\", &patient[i].age);\n    if (patient[i].age >= 60) {\n      old[first] = patient[i];\n      first = first + 1;\n    }\n  }\n  for (i = 0; i < first; i++) {\n    for (j = 0; j < first - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < first; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      printf(\"%s\\n\", patient[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct p {\n    char id[10];\n    int age;\n  } a[n], b[n], c[n], d;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    } else {\n      c[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    for (l = 0; l < j - 1 - i; l++)\n      if (b[l].age < b[l + 1].age) {\n        d = b[l];\n        b[l] = b[l + 1];\n        b[l + 1] = d;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "16649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, j, sgh, sgh60;\n  sgh = 0;\n  sgh60 = 0;\n  char d[10];\n  struct guahao {\n    char ID[10];\n    int age;\n  } gh[100], gh60[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", d, &a);\n    if (a >= 60) {\n      strcpy(gh60[sgh60].ID, d);\n      gh60[sgh60].age = a;\n      sgh60 = sgh60 + 1;\n    } else {\n      strcpy(gh[sgh].ID, d);\n      gh[sgh].age = a;\n      sgh = sgh + 1;\n    }\n  }\n  for (i = 1; i <= sgh60; i++) {\n    for (j = sgh60 - 1; j > 0; j--) {\n      if (gh60[j].age > gh60[j - 1].age) {\n        a = gh60[j].age;\n        gh60[j].age = gh60[j - 1].age;\n        gh60[j - 1].age = a;\n        strcpy(d, gh60[j].ID);\n        strcpy(gh60[j].ID, gh60[j - 1].ID);\n        strcpy(gh60[j - 1].ID, d);\n      }\n    }\n  }\n  for (i = 0; i < sgh60; i++) {\n    printf(\"%s\\n\", gh60[i].ID);\n  }\n  for (i = 0; i < sgh; i++) {\n    printf(\"%s\\n\", gh[i].ID);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16650", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct data {\n    int age;\n    char id[10];\n  } o[101], y[101], tmp;\n  int no = 0, ny = 0;\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> tmp.id >> tmp.age;\n    if (tmp.age >= 60) {\n      o[no] = tmp;\n      no++;\n    } else {\n      y[ny] = tmp;\n      ny++;\n    }\n  }\n  for (i = no - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (o[j].age < o[j + 1].age) {\n        o[100] = o[j];\n        o[j] = o[j + 1];\n        o[j + 1] = o[100];\n      }\n    }\n  }\n  for (i = 0; i < no; i++)\n    printf(\"%s\\n\", o[i].id);\n  for (i = 0; i < ny; i++)\n    cout << y[i].id << endl;\n  return 0;\n}\n"}
{"label": "9", "index": "16651", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct person {\n  char ID[20];\n  int age;\n};\nint main() {\n  struct person a[100] = {0}, b[100] = {0}, t;\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - 1 - i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n      }\n    }\n  for (i = 0; i < k; i++) {\n    puts(b[i].ID);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      puts(a[i].ID);\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char num[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num = 1;\n  head = NULL;\n  while (num <= n) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (num == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    num++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct patient *pt, *p, *pre;\n  int i, max, num = 0;\n  cin >> n;\n  pt = creat();\n  for (p = pt; p; p = p->next) {\n    if (p->age >= 60)\n      num++;\n  }\n  for (i = 1; i <= num; i++) {\n    max = 59;\n    for (p = pt; p; p = p->next) {\n      if (max < p->age)\n        max = p->age;\n    }\n    for (p = pre = pt; p; p = p->next) {\n      if (p->age != max)\n        pre = p;\n      else\n        break;\n    }\n    printf(\"%s \", p->num);\n    if (p == pt)\n      pt = p->next;\n    else\n      pre->next = p->next;\n  }\n  for (p = pt; p; p = p->next)\n    printf(\"%s \", p->num);\n  return 0;\n}\n"}
{"label": "9", "index": "16653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct person {\n    char id[10];\n    int age;\n  } m[100], b[100];\n  int n, t, i, j;\n  char temp[10];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", m[i].id);\n    strcpy(b[i].id, m[i].id);\n    scanf(\"%d\", &m[i].age);\n    b[i].age = m[i].age;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (m[j].age < m[j + 1].age) {\n        t = m[j].age;\n        m[j].age = m[j + 1].age;\n        m[j + 1].age = t;\n        strcpy(temp, m[j].id);\n        strcpy(m[j].id, m[j + 1].id);\n        strcpy(m[j + 1].id, temp);\n      }\n    }\n  for (i = 0; i < n; i++)\n    if (m[i].age >= 60)\n      printf(\"%s\\n\", m[i].id);\n  for (i = 0; i < n; i++)\n    if (b[i].age < 60) {\n      cout << b[i].id << \"\\n\";\n    }\n}\n"}
{"label": "9", "index": "16654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[20];\n  int age;\n  int num;\n};\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  struct patient p[100];\n  for (i = 1; i <= n; ++i) {\n    cin >> p[i].id >> p[i].age;\n    p[i].num = i;\n  }\n  for (i = 1; i <= n - 1; ++i) {\n    for (j = i + 1; j <= n; ++j) {\n      if (p[j].age > p[i].age) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n  }\n  for (i = 1; p[i].age >= 60; ++i) {\n    for (j = i + 1; p[j].age == p[i].age; ++j) {\n      if (p[i].num > p[j].num) {\n        struct patient t;\n        t = p[i];\n        p[i] = p[j];\n        p[j] = t;\n      }\n    }\n    printf(\"%s\\n\", p[i].id);\n  }\n  for (j = i; j <= n; ++j) {\n    int k;\n    for (k = j + 1; k <= n; ++k) {\n      if (p[j].num > p[k].num) {\n        struct patient t;\n        t = p[j];\n        p[j] = p[k];\n        p[k] = t;\n      }\n    }\n    cout << p[j].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, i, j, k, s, t, p;\n  scanf(\"%d\", &n);\n  int a[n - 1], c[n - 1];\n  char string[n - 1][10], b[n - 1][10];\n  for (h = 0; h <= n - 1; h++) {\n    scanf(\"%s %d\", string[h], &a[h]);\n  }\n  for (p = 0, j = 0; p <= n - 1; p++) {\n    if (a[p] >= 60) {\n      c[j] = a[p];\n      strcpy(b[j], string[p]);\n      j++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (s = 1; s <= j; s++) {\n      for (i = 0, t = 0; i < j; i++) {\n        if (c[s - 1] >= c[i])\n          t++;\n      }\n      if (t == j) {\n        printf(\"%s\\n\", b[s - 1]);\n        c[s - 1] = 0;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, d = 0, q, j;\n  int b[101], f[101];\n  char a[101][10], c[101][10], e[101][10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i];\n  }\n  q = n - 1;\n  j = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (b[i] < 60) {\n\n      strcpy(c[q], a[i]);\n      q = q - 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n\n      strcpy(c[j], a[i]);\n      f[j] = b[i];\n      d = d + 1;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    for (j = 0; j < d - 1; j++) {\n      if (f[j] < f[j + 1]) {\n        f[100] = f[j];\n        f[j] = f[j + 1];\n        f[j + 1] = f[100];\n        strcpy(c[100], c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[1 + j], c[100]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", c[i]);\n}\n"}
{"label": "9", "index": "16657", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main()\n\n{\n  void bubble(struct patient a[], int len);\n  int n, i, old, sum, age, j;\n  struct patient a[100];\n  struct patient b[100];\n  char str[100] = {'\\0'};\n  char str1[100] = {'\\0'};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0, sum = 0; sum <= n;) {\n    age = 0;\n    strcpy(str, str1);\n    scanf(\"%s %d\", str, &age);\n\n    if (age >= 60) {\n      strcpy(a[i].num, str);\n      a[i].age = age;\n      i++;\n      sum++;\n    } else {\n      strcpy(b[j].num, str);\n      b[j].age = age;\n      j++;\n      sum++;\n    }\n  }\n\n  bubble(a, i);\n  old = i;\n\n  for (i = 0; i < old; i++) {\n    printf(\"%s\\n\", a[i].num);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i].num);\n  }\n\n  return 0;\n}\n\nvoid bubble(struct patient a[], int len) {\n  int i, pass;\n  struct patient temp;\n\n  for (pass = 1; pass < len; pass++) {\n    for (i = 0; i < len - pass; i++) {\n      if (a[i].age < a[i + 1].age) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16658", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  char id[100][10];\n  int old[100];\n\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &old[i]);\n  }\n\n  int e;\n  char s[100][10];\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < n - j; k++) {\n      if (old[k] < old[k + 1] && old[k + 1] >= 60) {\n        e = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = e;\n        strcpy(s[k], id[k + 1]);\n        strcpy(id[k + 1], id[k]);\n        strcpy(id[k], s[k]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint num, n = 0;\nstruct pa {\n  char id[10];\n  int age;\n  int o;\n} * p;\n\nint operate() {\n  struct pa *pi, *pj;\n  int agem = 0, om = 0;\n  for (pi = p; pi < p + num; pi++) {\n    if (pi->o == 0)\n      continue;\n    for (pj = p; pj < p + num; pj++) {\n      if (pj->o == 0)\n        continue;\n      if (pj->age < pi->age)\n        pi->o++;\n    }\n    if (pi->o > om)\n      om = pi->o;\n  }\n  return om;\n}\nvoid print(int om) {\n  int k;\n  struct pa *pi;\n  for (k = om; k >= 0; k--)\n    for (pi = p; pi < p + num; pi++) {\n      if (pi->o == k) {\n        if (n == 0) {\n          printf(\"%s\", pi->id);\n          n++;\n        } else\n          cout << \" \" << pi->id;\n      }\n    }\n}\n\nint main() {\n  scanf(\"%d\", &num);\n  struct pa *pi;\n  int om;\n  p = (struct pa *)malloc(num * sizeof(struct pa));\n  for (pi = p; pi < p + num; pi++) {\n    scanf(\"%s %d\", pi->id, &pi->age);\n    if (pi->age >= 60)\n      pi->o = 1;\n    else\n      pi->o = 0;\n  }\n  om = operate();\n  print(om);\n  return 0;\n}\n"}
{"label": "9", "index": "16660", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, l, b[100], n1 = 0, n2 = 0, ha[100], pp[100], x;\n  char a[100][11], yi[100][10], er[100][10], y[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    cin >> b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60)\n      n1++;\n    else {\n      n2++;\n    }\n  }\n  for (i = 0, k = 0, l = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      ha[k] = b[i];\n      strcpy(yi[k], a[i]);\n      k++;\n    } else {\n      pp[l] = b[i];\n      strcpy(er[l], a[i]);\n      l++;\n    }\n  }\n  for (i = 1; i < n1; i++) {\n    for (k = 0; k < n1 - i; k++) {\n      if (ha[k] < ha[k + 1]) {\n        x = ha[k];\n        ha[k] = ha[k + 1];\n        ha[k + 1] = x;\n        strcpy(y, yi[k]);\n        strcpy(yi[k], yi[k + 1]);\n        strcpy(yi[k + 1], y);\n      }\n    }\n  }\n  for (i = 0; i < n1; i++) {\n    printf(\"%s\\n\", yi[i]);\n  }\n  for (i = 0; i < n2; i++) {\n    printf(\"%s\\n\", er[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct node {\n  char s[100];\n  int age, no;\n} a[1000], b;\nint check(int x, int y) {\n  if (a[y].age < 60 && a[x].age >= 60)\n    return 0;\n  if (a[y].age >= 60 && a[x].age < 60)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no > a[y].no)\n    return 1;\n  if (a[x].age < 60 && a[y].age < 60 && a[x].no < a[y].no)\n    return 0;\n  if (a[x].age > a[y].age)\n    return 0;\n  if (a[x].age < a[y].age)\n    return 1;\n  if (a[x].no < a[y].no)\n    return 0;\n  if (a[x].no > a[y].no)\n    return 1;\n  return 0;\n}\nint main() {\n  int i, j, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].s >> a[i].age;\n    a[i].no = i;\n  }\n  for (i = 1; i < n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (check(i, j) == 1) {\n        b = a[i];\n        a[i] = a[j];\n        a[j] = b;\n      }\n  for (i = 1; i <= n; i++)\n    cout << a[i].s << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} p[100], old[100], temp;\nint main() {\n  int i, j, n, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", p[i].id);\n    cin >> p[i].age;\n    if (p[i].age >= 60) {\n      old[count] = p[i];\n      count++;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    for (j = 0; j < count - i; j++) {\n      if (old[j + 1].age > old[j].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char a[10];\n  int age;\n};\nstruct bing bing[1000];\nint main() {\n  int n, i, j = 1, v = 1, k, t[1000], m, p[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", &bing[i].a, &bing[i].age);\n    if (bing[i].age >= 60) {\n      t[j] = i;\n      j++;\n    } else {\n      p[v] = i;\n      v++;\n    }\n  }\n  j--;\n  v--;\n  if (j != 0) {\n    for (i = 1; i < j; i++)\n      for (k = 1; k < j - i + 1; k++)\n        if (bing[t[k]].age < bing[t[k + 1]].age) {\n          m = t[k];\n          t[k] = t[k + 1];\n          t[k + 1] = m;\n        }\n  }\n  for (i = 1; i <= j; i++)\n    cout << bing[t[i]].a << \"\\n\";\n  for (i = 1; i <= v; i++)\n    printf(\"%s\\n\", bing[p[i]].a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct people {\n  int order;\n  char ID[10];\n  int age;\n} per[100];\nstruct old {\n  int orders;\n  char IDs[10];\n  int ages;\n} elder[100];\nint main() {\n  int n, i, j, t, m, q, r;\n  char p[10];\n  int b[100], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    per[i].order = i;\n    scanf(\"%s %d\", per[i].ID, &per[i].age);\n    b[i] = strlen(per[i].ID);\n  }\n  t = 0;\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age >= 60) {\n      elder[t].orders = t;\n      strcpy(elder[t].IDs, per[i].ID);\n      elder[t].ages = per[i].age;\n      t = t + 1;\n      per[i].age = (-1);\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - i - 1); j++) {\n      if (elder[j].ages < elder[j + 1].ages) {\n        m = elder[j].ages;\n        strcpy(p, elder[j].IDs);\n        q = elder[j].orders;\n        strcpy(elder[j].IDs, elder[j + 1].IDs);\n        elder[j].ages = elder[j + 1].ages;\n        elder[j].orders = elder[j + 1].orders;\n        elder[j + 1].ages = m;\n        strcpy(elder[j + 1].IDs, p);\n        elder[j + 1].orders = q;\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    for (j = 0; j <= (t - 1 - j); j++) {\n      if (elder[j].ages == elder[j + 1].ages) {\n        if (elder[j].orders > elder[j + 1].orders) {\n          m = elder[j].ages;\n          strcpy(p, elder[j].IDs);\n          q = elder[j].orders;\n          strcpy(elder[j].IDs, elder[j + 1].IDs);\n          elder[j].ages = elder[j + 1].ages;\n          elder[j].orders = elder[j + 1].orders;\n          elder[j + 1].ages = m;\n          strcpy(elder[j + 1].IDs, p);\n          elder[j + 1].orders = q;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (t - 1); i++) {\n    printf(\"%s\\n\", elder[i].IDs);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (per[i].age != (-1))\n      printf(\"%s\\n\", per[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  int re;\n} p[100], po[100], temp;\nint main() {\n  int n, i, j, pj = 0, oldj = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[pj].id, &p[pj].age);\n    if (p[pj].age >= 60) {\n      po[oldj] = p[pj];\n      po[oldj].re = oldj;\n      oldj++;\n    } else {\n      p[pj].re = pj;\n      pj++;\n    }\n  }\n  for (i = 0; i < oldj - 1; i++) {\n    for (j = i + 1; j < oldj; j++) {\n      if ((po[i].age < po[j].age) ||\n          (po[i].age == po[j].age && po[i].re > po[j].re)) {\n        temp = po[i];\n        po[i] = po[j];\n        po[j] = temp;\n      }\n    }\n    printf(\"%s\\n\", po[i].id);\n  }\n  printf(\"%s\\n\", po[i].id);\n  for (i = 0; i < pj; i++)\n    printf(\"%s\\n\", p[i].id);\n}\n"}
{"label": "9", "index": "16666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int amount_lao = 0, amount_yiban = 0;\n  char c[11];\n  int shuru;\n  int i, j, k, s, p;\n  struct xinxi {\n    char id[11];\n    int age;\n  };\n  struct xinxi laoren[100];\n  struct xinxi common[100];\n  struct xinxi temp;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    scanf(\"%s %d\", c, &shuru);\n    if (shuru < 60) {\n      strcpy(common[amount_yiban].id, c);\n      common[amount_yiban].age = shuru;\n      amount_yiban++;\n    } else if (shuru >= 60) {\n      strcpy(laoren[amount_lao].id, c);\n      laoren[amount_lao].age = shuru;\n      amount_lao++;\n    }\n  }\n  for (i = 0; i < amount_lao - 1; i++) {\n    for (j = 0; j < amount_lao - i - 1; j++) {\n      if (laoren[j].age < laoren[j + 1].age) {\n        strcpy(temp.id, laoren[j].id);\n        temp.age = laoren[j].age;\n        strcpy(laoren[j].id, laoren[j + 1].id);\n        laoren[j].age = laoren[j + 1].age;\n        strcpy(laoren[j + 1].id, temp.id);\n        laoren[j + 1].age = temp.age;\n      }\n    }\n  }\n  for (k = 0; k < amount_lao; k++) {\n    puts(laoren[k].id);\n    printf(\" \");\n  }\n  for (s = 0; s < amount_yiban; s++) {\n    puts(common[s].id);\n    printf(\" \");\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, z, y;\n  y = 0;\n  z = 0;\n  struct member {\n    char xh[10];\n    int ag;\n  };\n  struct member a[100];\n  struct member b[101], c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].xh, &a[i].ag);\n\n  for (i = 0; i < n; i++) {\n    if (a[i].ag >= 60) {\n      b[y] = a[i];\n      y++;\n    } else {\n      c[z] = a[i];\n      z++;\n    }\n  }\n\n  for (i = 1; i < y; i++) {\n    for (j = 0; j < y - i; j++) {\n      if (b[j].ag < b[j + 1].ag) {\n        b[100] = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = b[100];\n      }\n    }\n  }\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", b[i].xh);\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", c[i].xh);\n}\n"}
{"label": "9", "index": "16668", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct bingren {\n  char id[20];\n  int age;\n} bing[100] = {'\\0', 0};\n\nstruct laoren {\n  char oid[20];\n  int oage;\n} lao[100] = {'\\0', 0};\n\nint main() {\n  int n, i, j = 0, l;\n  struct laoren temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", bing[i].id);\n    cin >> bing[i].age;\n  }\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 60) {\n      strcpy(lao[j].oid, bing[i].id);\n      lao[j].oage = bing[i].age;\n      bing[i].age = -1;\n      j++;\n    } else\n      continue;\n  }\n  for (l = 0; l < j; l++) {\n    for (i = 0; i < j - l; i++) {\n      if (lao[i].oage < lao[i + 1].oage) {\n        temp = lao[i];\n        lao[i] = lao[i + 1];\n        lao[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j + 1; i++)\n    printf(\"%s\\n\", lao[i].oid);\n\n  for (i = 0; i < n; i++) {\n    if (bing[i].age >= 0) {\n      printf(\"%s\\n\", bing[i].id);\n    } else\n      continue;\n  }\n}\n"}
{"label": "9", "index": "16669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b[100] = {0}, t, m;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\\n\", a[i].num, &a[i].age);\n    b[i] = a[i].age;\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      m = i;\n      break;\n    }\n  }\n  for (j = 0; j < m; j++)\n    for (i = 0; i < n; i++)\n      if (a[i].age == b[j] && (j == 0 || b[j] != b[j - 1]))\n        printf(\"%s\\n\", a[i].num);\n  for (i = 0; i < n; i++)\n    if (a[i].age < 60)\n      printf(\"%s\\n\", a[i].num);\n}\n"}
{"label": "9", "index": "16670", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct rat {\n  char num[11];\n  int age;\n  struct rat *next;\n};\n\nint n;\n\nstruct rat *creat(void) {\n  struct rat *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct rat *)malloc(1000);\n  head = p1;\n  cin >> p1->num >> p1->age;\n  for (i = 2; i <= n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct rat *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct rat *sort(struct rat *head, int count) {\n  struct rat *p1, *p2, *p3, *temp;\n  int i, j;\n  for (j = 1; j <= count - 1; j++) {\n    p1 = head;\n    p2 = p1->next;\n    p3 = p2;\n    for (i = 0; i < count - j; i++) {\n      if (p1->age < p2->age) {\n        temp = p2->next;\n        p2->next = p1;\n        p1->next = temp;\n        if (i == 0) {\n          head = p2;\n          p2 = temp;\n        } else {\n          p3->next = p2;\n          p3 = p2;\n          p2 = temp;\n        }\n      } else {\n        if (i == 0) {\n          p3 = head = p1;\n          p1 = p1->next;\n          p2 = p2->next;\n        } else {\n          p1 = p1->next;\n          p2 = p2->next;\n          p3 = p3->next;\n        }\n      }\n    }\n  }\n  return (head);\n}\n\nstruct rat *del(struct rat *head, int t) {\n  struct rat *p1, *p2;\n  int i;\n  p1 = head;\n  for (i = 1; i <= t; i++) {\n    if (p1->age < 60) {\n      if (i == 1)\n        head = p1;\n      p2 = p1;\n      p1 = p1->next;\n      continue;\n    }\n    if (p1->age >= 60) {\n      if (i == 1) {\n        head = p1->next;\n        break;\n      }\n      p2->next = p1->next;\n      break;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct rat *head, *p1, *s, *p2, *p3;\n  int i, count = 0, t;\n  scanf(\"%d\", &n);\n  t = n;\n  head = creat();\n  p1 = head;\n  p3 = p2 = (struct rat *)malloc(1000);\n  for (i = 1; i <= n; i++) {\n    if (p1->age >= 60) {\n      if (count == 0)\n        s = p2;\n      p2->age = p1->age;\n      strcpy(p2->num, p1->num);\n      p3->next = p2;\n      p3 = p2;\n      p2 = (struct rat *)malloc(1000);\n      count++;\n    }\n    p1 = p1->next;\n  }\n  s = sort(s, count);\n  for (i = 1; i <= count; i++) {\n    head = del(head, t);\n    t = t - 1;\n  }\n  p1 = s;\n  for (i = 1; i <= count; i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i <= (n - count); i++) {\n    printf(\"%s \", p1->num);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16671", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, i, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    cin >> id >> at;\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n            p11 = (struct patient *)malloc(sizeof(struct patient));\n            p11->age = at;\n            strcpy(p11->id, id);\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          p11 = (struct patient *)malloc(sizeof(struct patient));\n          p11->age = at;\n          strcpy(p11->id, id);\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next) {\n    printf(\"%s \", t->id);\n  }\n  printf(\"%s\", t->id);\n}\n"}
{"label": "9", "index": "16672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, f, g, t;\n  scanf(\"%d\", &n);\n  int p[n], e[n], d[n];\n  char a[n][100], b[n][100], c[n][100], s[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i], &p[i]);\n  }\n  j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n\n    if (p[i] >= 60) {\n      e[j] = p[i];\n      strcpy(b[j], a[i]);\n      j++;\n    } else {\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  for (f = 0; f < j - 1; f++) {\n    for (g = 0; g < j - 1 - f; g++) {\n      if (e[g] < e[g + 1]) {\n        t = e[g + 1];\n        e[g + 1] = e[g];\n        e[g] = t;\n        strcpy(s, b[g + 1]);\n        strcpy(b[g + 1], b[g]);\n        strcpy(b[g], s);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", c[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Info {\n  char sID[10];\n  int nAge;\n};\nint main() {\n  int i, n, j, l;\n  struct Info t;\n  scanf(\"%d\", &n);\n  struct Info patients[100];\n  struct Info overpatients[100];\n  l = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patients[i].sID, &patients[i].nAge);\n    if (patients[i].nAge >= 60) { \n      overpatients[l] = patients[i];\n      l++;\n    }\n  }\n  for (i = 0; i < l - 1; i++)\n    for (j = 1; j < l - i; j++) {\n      if (overpatients[j - 1].nAge < overpatients[j].nAge) {\n        t = overpatients[j - 1];\n        overpatients[j - 1] = overpatients[j];\n        overpatients[j] = t;\n      }\n    }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", overpatients[i].sID);\n  }\n  for (i = 0; i < n; i++)\n    if (patients[i].nAge < 60) {\n      printf(\"%s\\n\", patients[i].sID);\n    }\n}\n"}
{"label": "9", "index": "16674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef struct {\n  char ID[10];\n  int age;\n} patient;\n\npatient pat[100];\n\nint cmp(const void *, const void *);\n\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].ID);\n    scanf(\"%d\", &pat[i].age);\n  }\n\n  qsort(pat, n, sizeof(patient), cmp);\n\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].ID);\n  }\n  return 0;\n}\n\nint cmp(const void *_p1, const void *_p2) {\n  patient *p1 = (patient *)_p1;\n  patient *p2 = (patient *)_p2;\n  if (p1->age >= 60 && p1->age < 60)\n    return -1;\n  else if (p1->age < 60 && p2->age >= 60)\n    return 1;\n  else if (p1->age >= 60 && p2->age >= 60)\n    return p2->age - p1->age;\n  else\n    return 0;\n}\n"}
{"label": "9", "index": "16675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  short int age;\n};\nint main() {\n  int i, j, k, l, n;\n  struct patient pat[100], temp;\n  struct patient pa[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &pat[i].id, &pat[i].age);\n  for (i = 0, j = 0; i < n; i++)\n\n    if (pat[i].age >= 60) {\n      pa[j] = pat[i];\n      j++;\n    }\n  for (k = 0; k < j - 1; k++)\n    for (l = j - 1; l > k; l--)\n      if (pa[l].age > pa[l - 1].age) {\n        temp = pa[l];\n        pa[l] = pa[l - 1];\n        pa[l - 1] = temp;\n      }\n  for (k = 0; k < j; k++)\n    printf(\"%s\\n\", pa[k].id);\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60)\n      printf(\"%s\\n\", pat[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  struct p {\n    char num[100];\n    int age;\n  } pa[100], p[100], t;\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].num >> pa[i].age;\n  }\n  i = n - 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age < 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  k = i + 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age >= 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  for (j = 0; j < k; j++) {\n    for (i = 0; i < k - j - 1; i++) {\n      if (p[i].age < p[i + 1].age) {\n        t = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << &p[i].num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16677", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct pat {\n  char num[10];\n  int age;\n  int turn;\n} pa[100], temp, temp2;\n\nint main() {\n  int i, j, t, s, n, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> pa[i].num >> pa[i].age;\n    pa[i].turn = i;\n  }\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age >= 60) {\n      for (j = 1; j <= i; j++) {\n        if (pa[i].age > pa[j].age) {\n          temp = pa[j];\n          pa[j] = pa[i];\n          for (t = i - 1; t > j; t--) {\n            pa[t + 1] = pa[t];\n          }\n          pa[j + 1] = temp;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    puts(pa[i].num);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int w;\n  char c[10];\n  struct stu *next;\n};\nint n;\nstruct stu *creat(int m) {\n  struct stu *head, *p1, *p2, *p3;\n  int i;\n  n = 0;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  head = p1;\n  p1->next = NULL;\n  n = 0;\n  scanf(\"%s %d\", p1->c, &p1->w);\n  for (i = 0; i < m - 1; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->c >> p1->w;\n    if (p1->w < 60) {\n      for (p2 = head; p2->next != NULL; p2 = p2->next)\n        ;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      p2 = head;\n      while ((p1->w <= p2->w) && (p2->next != NULL)) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      if (p1->w > p2->w) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  return (head);\n}\nint main() {\n  int m, i;\n  struct stu *head, *p;\n  scanf(\"%d\", &m);\n  head = creat(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    cout << p->c << \"\\n\";\n\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16679", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, t, x;\n  char w[10];\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  struct patient1 {\n    char id[10];\n    int age;\n  } b[100];\n  struct patient2 {\n    char id[10];\n    int age;\n  } c[100];\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[k].age = a[i].age;\n      for (j = 0; j < 10; j++)\n        b[k].id[j] = a[i].id[j];\n\n      k++;\n\n    } else {\n      c[m].age = a[i].age;\n      for (j = 0; j < 10; j++) {\n        c[m].id[j] = a[i].id[j];\n      }\n      m++;\n    }\n  }\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i].age;\n        b[i].age = b[i + 1].age;\n        b[i + 1].age = t;\n        for (x = 0; x < 10; x++) {\n          w[x] = b[i].id[x];\n          b[i].id[x] = b[i + 1].id[x];\n          b[i + 1].id[x] = w[x];\n        }\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", b[i].id);\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  };\n  struct patient p[100], temp;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (p[j].age > p[i].age && p[j].age >= 60) {\n        for (k = j; k > i; k--) {\n          temp = p[k];\n          p[k] = p[k - 1];\n          p[k - 1] = temp;\n        }\n      }\n    }\n    printf(\"%s\\n\", p[i].num);\n  }\n  printf(\"%s\\n\", p[n - 1].num);\n  return 0;\n}\n"}
{"label": "9", "index": "16681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b[101], b1[101], t, h, k;\n  char a[101][11] = {0}, a1[101][11] = {0}, s1[11];\n  scanf(\"%d\", &n);\n  for (i = 0, h = 0, k = 0; i <= n - 1; i++) {\n    cin >> s1 >> t;\n    if (t >= 60) {\n      b[h] = t;\n      strcpy(a[h], s1);\n      h++;\n    } else {\n      b1[k] = t;\n      strcpy(a1[k], s1);\n      k++;\n    }\n  }\n  for (i = 0; i <= h - 2; i++) {\n    for (j = 0; j <= h - 2 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        strcpy(s1, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], s1);\n      }\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%s\\n\", a[i]);\n  }\n  for (i = 0; i <= k - 1; i++) {\n    printf(\"%s\\n\", a1[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b[100], c[100], j = 0, k, mid, p, m = 0, max;\n  struct patient {\n    char id[20];\n    int age;\n  } a[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60)\n      b[j++] = i;\n    else\n      c[m++] = i;\n  }\n  for (i = 0; i < j; i++) {\n    max = i;\n    for (k = i; k < j; k++) {\n\n      if (a[b[k]].age > a[b[max]].age)\n        max = k;\n    }\n    mid = b[max];\n    for (k = max; k > i; k--)\n      b[k] = b[k - 1];\n    b[i] = mid;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[b[i]].id);\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", a[c[i]].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16683", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  int sixty[100];\n\n  int n, b = 0, i, j, k, e;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> people[i].id >> people[i].age;\n    if (people[i].age >= 60) {\n      sixty[i] = people[i].age;\n\n      b += 1;\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        e = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == people[j].age && sixty[i] != sixty[i - 1])\n        printf(\"%s\\n\", people[j].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16684", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct staff {\n  char id[20];\n  int age;\n  struct staff *next;\n};\n\nint main() {\n  int n, k = 0, max = 59;\n  struct staff *head, *p, *q, *pre;\n  scanf(\"%d\", &n);\n  struct staff *p1, *p2;\n  p1 = (struct staff *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = p2 = p1;\n  if (p1->age >= 60)\n    k++;\n  while (n - 1) {\n    n--;\n    p1 = (struct staff *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  while (k) {\n    p = head;\n    k--;\n    while (p) {\n      if (p->age > max) {\n        max = p->age;\n        q = p;\n      }\n      p = p->next;\n    }\n    printf(\"%s \", q->id);\n    if (q == head) {\n      head = q->next;\n      free(q);\n    } else {\n      if (q->next == NULL) {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            free(q);\n            pre->next = NULL;\n            break;\n          }\n        }\n      }\n\n      else {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            p = p->next;\n            pre->next = p;\n            free(q);\n            break;\n          }\n        }\n      }\n    }\n    max = 59;\n  }\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, year[100], i, j, year2[100] = {0}, t, k;\n  char num[100][10], num2[100][10], p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    scanf(\"%d\", &year[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      for (k = 0; k < 10; k++)\n        num2[i][k] = num[i][k];\n\n      year2[i] = year[i];\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - j - 1; i++) {\n      if (year2[i] < year2[i + 1]) {\n        t = year2[i];\n        year2[i] = year2[i + 1];\n        year2[i + 1] = t;\n        for (k = 0; k < 10; k++) {\n          p = num2[i][k];\n          num2[i][k] = num2[i + 1][k];\n          num2[i + 1][k] = p;\n        }\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (year2[i] != 0)\n      printf(\"%s\\n\", num2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct old {\n    char ID[10];\n    int age;\n  };\n  struct old ill[100];\n  struct old t1[100];\n  struct old t2[100];\n  struct old t;\n  int n, i, j = 0, k = 0, num60 = 0, num0 = 0, b[100] = {0}, p, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ill[i].ID);\n    scanf(\"%d\", &ill[i].age);\n    if (ill[i].age >= 60) {\n      t1[j] = ill[i];\n      j++;\n      num60++;\n    } else {\n      t2[k] = ill[i];\n      k++;\n      num0++;\n    }\n  }\n  for (i = 0; i < num60; i++) {\n    p = 0;\n    for (j = 0; j < num60; j++) {\n      if (t1[j].age > p && b[j] == 0) {\n        p = t1[j].age;\n        num = j;\n      }\n    }\n    printf(\"%s\\n\", t1[num].ID);\n    b[num] = 1;\n  }\n  for (i = 0; i < num0; i++)\n    printf(\"%s\\n\", t2[i].ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n};\nint main() {\n  int max, t = 1, n, i;\n  struct patient p[101];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> p[i].id >> p[i].age;\n  for (; t != 0;) {\n    max = 59;\n    t = 0;\n    for (i = 1; i <= n; i++) {\n      if (p[i].age > max) {\n        max = p[i].age;\n        t = i;\n      }\n    }\n    if (t != 0)\n      printf(\"%s\\n\", p[t].id);\n    p[t].age = 0;\n  }\n  for (i = 1; i <= n; i++)\n    if (p[i].age != 0)\n      cout << p[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "16688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  struct pat *next;\n};\n\nstruct pat *creat(int n) {\n  struct pat *p1, *p2, *head;\n  int i;\n  p2 = head = p1 = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (i == 0)\n      head = p1;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n  }\n  p2 = NULL;\n  return head;\n}\n\nvoid array_1(struct pat *head, int n) {\n  int i, j, ta;\n  char str[10];\n  struct pat *p1, *p2;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      p2 = p1;\n      p1 = p1->next;\n      if ((p1->age) > (p2->age) && (p1->age) >= 60) {\n\n        strcpy(str, p2->num);\n        strcpy(p2->num, p1->num);\n        strcpy(p1->num, str);\n        ta = p1->age;\n        p1->age = p2->age;\n        p2->age = ta;\n      }\n    }\n    p1 = head;\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  struct pat *p;\n  p = creat(n);\n  array_1(p, n);\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, t;\n  scanf(\"%d\", &n);\n  char a[n][100], s[n][100], r[100];\n  int b[n], c[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (int j = 0; j < n; j++) {\n    if (b[j] >= 60) {\n      c[m] = b[j], strcpy(s[m], a[j]);\n      if (m != 0) {\n        for (int k = m; k > 0; k = k - 1) {\n          if (c[k] > c[k - 1]) {\n            strcpy(r, s[k]), strcpy(s[k], s[k - 1]), strcpy(s[k - 1], r);\n            t = c[k], c[k] = c[k - 1], c[k - 1] = t;\n          }\n        }\n      }\n      m++;\n    }\n  }\n  if (m != 0) {\n    for (int i = 0; i < m; i++)\n      cout << s[i] << \"\\n\";\n  }\n  for (int j = 0; j < n; j++) {\n    if (b[j] < 60)\n      printf(\"%s\\n\", a[j]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16690", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ID[1000][1000], IDup60[1000][1000], IDunder60[1000][1000], s[1000];\n  int b, h, i, j, k, l, m, max = 0, n, o, p, q, t = 0, u = 0, YearOld[1000],\n                           YearOldup60[1000], id[1000], idup60[1000];\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    scanf(\"%s %d\", ID[h], &YearOld[h]);\n    id[h] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; ID[i][j] != '\u0000'; j++) {\n      id[i] = 10 * id[i];\n      id[i] = id[i] + (ID[i][j] - '0');\n    }\n  }\n  for (m = 0; m < n; m++) {\n    if (YearOld[m] > max)\n      max = YearOld[m];\n  }\n  for (k = 0; k <= max; k++) {\n    for (l = 0; l < n; l++) {\n      if (YearOld[l] == max - k && max - k >= 60) {\n        YearOldup60[t] = YearOld[l];\n        idup60[t] = id[l];\n        strcpy(IDup60[t], ID[l]);\n        t++;\n      }\n    }\n  }\n  for (b = 0; b < n; b++) {\n    if (YearOld[b] < 60) {\n      strcpy(IDunder60[u], ID[b]);\n      u++;\n    }\n  }\n  for (p = 0; p < t; p++) {\n    printf(\"%s \", IDup60[p]);\n  }\n  for (q = 0; q < u; q++) {\n    printf(\"%s \", IDunder60[q]);\n  }\n}\n"}
{"label": "9", "index": "16691", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char id[100][10], id1[100][10], t[10];\n  int n, i, j, b, age[100], age1[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i];\n    scanf(\"%d\", &age[i]);\n    strcpy(id1[i], id[i]);\n    age1[i] = age[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (age1[j] < age1[j + 1]) {\n        b = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = b;\n        strcpy(t, id1[j]);\n        strcpy(id1[j], id1[j + 1]);\n        strcpy(id1[j + 1], t);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age1[i] >= 60)\n      printf(\"%s\\n\", id1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  char ID[10];\n  int nian;\n} patient[100], old[100], qita[100], temp;\nint main() {\n  int n, i, k, num, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient[i].ID, &patient[i].nian);\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      num = num + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian >= 60) {\n      old[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (patient[i].nian < 60) {\n      qita[k] = patient[i];\n      k = k + 1;\n    }\n  }\n  for (j = 1; j < num; j++) {\n    for (k = 0; k < num - j; k++) {\n      if (old[k + 1].nian > old[k].nian) {\n        temp = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = temp;\n      }\n    }\n  }\n  for (k = 0; k < num; k++) {\n    cout << old[k].ID << \"\\n\";\n  }\n  for (k = 0; k < n - num; k++) {\n    printf(\"%s\\n\", qita[k].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100] = {0}, c[100] = {0}, d[100] = {0}, e[100] = {0};\n  char a[100][100];\n  for (i = 0; i < 100; i++) {\n    b[i] = i;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i], &c[i]);\n    if (c[i] > 59) {\n      d[i] = c[i];\n    } else {\n      e[i] = c[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (d[b[j]] < d[b[j + 1]]) {\n        k = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = k;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (d[b[i]] > 0) {\n      printf(\"%s\\n\", a[b[i]]);\n    } else {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (e[i] != 0) {\n      printf(\"%s\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct sick {\n  char num[10];\n  int age;\n};\nint main() {\n  int i, j, n;\n  int s;\n  char swap[10];\n  struct sick all[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &all[i].num);\n    cin >> all[i].age;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i; j > 0; j--) {\n      if (all[j].age >= 60 && all[j].age > all[j - 1].age) {\n        s = all[j].age;\n        all[j].age = all[j - 1].age;\n        all[j - 1].age = s;\n        strcpy(swap, all[j].num);\n        strcpy(all[j].num, all[j - 1].num);\n        strcpy(all[j - 1].num, swap);\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    puts(all[i].num);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } * p, *p60_up, *p60_low, t;\n\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  p = (struct patient *)malloc(sizeof(struct patient) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &(p[i].id));\n    scanf(\"%d\", &(p[i].age));\n  }\n  for (i = 0; i <= n; i++) {\n    if (p[i].age >= 60) {\n      k++;\n    }\n  }\n  p60_up = (struct patient *)malloc(sizeof(struct patient) * k);\n  p60_low = (struct patient *)malloc(sizeof(struct patient) * (n - k));\n\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      p60_up[j] = p[i];\n      j++;\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      p60_low[j] = p[i];\n      j++;\n    }\n  }\n  for (j = 1; j <= k; j++) {\n    for (i = 0; i < k - j; i++) {\n      if (p60_up[i].age < p60_up[i + 1].age) {\n        t = p60_up[i + 1];\n        p60_up[i + 1] = p60_up[i];\n        p60_up[i] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    puts(p60_up[i].id);\n  }\n  free(p60_up);\n  for (i = 0; i < n - k; i++) {\n    puts(p60_low[i].id);\n  }\n  free(p60_low);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int a;\n  char num[20];\n  struct student *next;\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->a);\n  head = (struct student *)malloc(1000);\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(1000);\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(1000);\n    cin >> p3->num >> p3->a;\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL)\n    p1 = p1->next;\n\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16697", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct pa {\n    char id[20];\n    int old;\n  } pai[101], ol[101], you[101];\n\n  int n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pai[i].id, &pai[i].old);\n  }\n  l = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (pai[i].old >= 60) {\n      ol[l] = pai[i];\n      l++;\n    }\n    if (pai[i].old < 60) {\n      you[k] = pai[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (ol[j].old < ol[j + 1].old) {\n        ol[100] = ol[j];\n        ol[j] = ol[j + 1];\n        ol[j + 1] = ol[100];\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", ol[i].id);\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%s\\n\", you[i].id);\n\n  printf(\"%s\", you[k - 1].id);\n}\n"}
{"label": "9", "index": "16698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int o;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  int scholar(struct student * p);\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->o);\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->o);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->o > m->o)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n;\n  struct student *head, *m, *p;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  scanf(\"%d\", &n);\n  head = create(n);\n  p = head;\n  for (;;) {\n    m = max(p);\n    if (m->o >= 60) {\n      cout << m->num << \" \";\n      m->o = -1;\n    } else\n      break;\n  }\n  p = head;\n  while (p) {\n    if (p->o != -1)\n      printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16699", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char ID[n][10];\n  int age[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> ID[i] >> age[i];\n  }\n  char ID2[n][10];\n  int b[n];\n  int j = 0, t, k;\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      b[j] = age[i];\n      strcpy(ID2[j], ID[i]);\n      j++;\n    }\n  }\n  char c[10];\n  for (k = 0; k < j - 1; k++) {\n    for (i = 0; i < j - 1 - k; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(c, ID2[i]);\n        strcpy(ID2[i], ID2[i + 1]);\n        strcpy(ID2[i + 1], c);\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++)\n    printf(\"%s \", ID2[i]);\n  char ID3[n][10];\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      strcpy(ID3[m], ID[i]);\n      m++;\n    }\n  }\n  for (i = 0; i <= m - 1; i++)\n    printf(\"%s \", ID3[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct pat {\n    char id[10];\n    int age;\n  } pat[201];\n  int i, n, j, x = 0, y = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      pat[100 + x] = pat[i];\n      x++;\n    } else {\n      pat[y] = pat[i];\n      y++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - i - 1; j++) {\n      if (pat[100 + j].age < pat[101 + j].age) {\n        pat[200] = pat[100 + j];\n        pat[100 + j] = pat[101 + j];\n        pat[101 + j] = pat[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    printf(\"%s\\n\", pat[100 + i].id);\n  for (i = 0; i < y; i++)\n    printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "16701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int nj[1000];\n  int lr[1000], xr[1000];\n  char zfc[1000][20];\n  int i;\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &nj[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (nj[i] >= 60) {\n      lr[m] = i;\n      m++;\n    } else {\n      xr[k] = i;\n      k++;\n    }\n  }\n  int j;\n  if (m >= 2) {\n    for (i = 0; i < m - 1; i++) {\n      for (j = m - 1; j > i; j--) {\n        int e;\n        if (nj[lr[j]] > nj[lr[j - 1]]) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        } else if (nj[lr[j]] == nj[lr[j - 1]] && (lr[j] < lr[j - 1])) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        }\n      }\n    }\n  }\n  if (m >= 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%s \", zfc[lr[i]]);\n    }\n  }\n  if (k > 0) {\n    for (i = 0; i < k; i++) {\n      printf(\"%s \", zfc[xr[i]]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bingren {\n  char id[20];\n  int nian;\n  struct bingren *next;\n};\nint main() {\n  int n, i;\n  struct bingren *p1, *head;\n  struct bingren temp;\n  char a[20] = {'\\0'};\n  int b = 0;\n  scanf(\"%d\", &n);\n  head = (struct bingren *)malloc(sizeof(struct bingren));\n  head->next = NULL;\n  scanf(\"%s%d\", head->id, &head->nian);\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    p1->next = (struct bingren *)malloc(sizeof(struct bingren));\n    scanf(\"%s%d\", p1->next->id, &p1->next->nian);\n    p1->next->next = NULL;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (i = 1; i < n; i++) {\n    for (; p1->next != NULL;) {\n      if (p1->next->nian >= 60 && p1->next->nian > p1->nian) {\n        b = p1->nian;\n        p1->nian = p1->next->nian;\n        p1->next->nian = b;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p1->next->id);\n        strcpy(p1->next->id, a);\n      }\n      p1 = p1->next;\n    }\n    p1 = head;\n  }\n  p1 = head;\n  for (; p1 != NULL;) {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, l;\n  scanf(\"%d\", &num);\n  struct inf {\n    char str[10];\n    int age;\n  } infs[101];\n  struct f {\n    char *p1;\n    int m1;\n  } old[101];\n  for (i = 0; i < num; i++) {\n    scanf(\"%s %d\", infs[i].str, &infs[i].age);\n  }\n  for (i = 0, j = 0; i < num; i++)\n    if (infs[i].age >= 60) {\n      old[j].m1 = infs[i].age;\n      old[j].p1 = infs[i].str;\n      j++;\n    }\n  int end = j;\n  char *k;\n  for (i = 0; i < end - 1; i++) {\n    for (j = 0; j + 1 < end - i; j++)\n      if (old[j].m1 < old[j + 1].m1) {\n        l = old[j].m1;\n        old[j].m1 = old[j + 1].m1;\n        old[j + 1].m1 = l;\n        k = old[j].p1;\n        old[j].p1 = old[1 + j].p1;\n        old[1 + j].p1 = k;\n      }\n  }\n  for (i = 0; i < end; i++)\n    cout << old[i].p1 << \"\\n\";\n  for (i = 0; i < num; i++) {\n    if (infs[i].age < 60) {\n      printf(\"%s\\n\", infs[i].str);\n    }\n  }\n}\n"}
{"label": "9", "index": "16704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\nstruct student {\n  int a;\n  struct student *next;\n  char num[20];\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  cin >> p1->num;\n  scanf(\"%d\", &p1->a);\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(sizeof(struct student));\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s\", p3->num);\n    scanf(\"%d\", &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL)\n    p1 = p1->next;\n\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pati {\n  char ID[10];\n  int age;\n} p[100];\nint main() {\n  int i, j, n, p2[100] = {0}, p3[100] = {0}, t = 0, r = 0, tem;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].age);\n    if (p[i].age >= 60) {\n      p2[t] = p[i].age;\n      t++;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    for (j = 0; j < t - 1 - i; j++) {\n      if (p2[j] < p2[j + 1]) {\n        tem = p2[j + 1];\n        p2[j + 1] = p2[j];\n        p2[j] = tem;\n      }\n    }\n  for (i = 0; i < t; i++) {\n    if (i > 0) {\n      if (p2[i] != p2[i - 1]) {\n        p3[r] = p2[i];\n        r++;\n      }\n    } else {\n      p3[r] = p2[i];\n      r++;\n    }\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[j].age == p3[t]) {\n        printf(\"%s\\n\", p[j].ID);\n      }\n    }\n    t++;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60) {\n      cout << p[i].ID << \"\\n\";\n    }\n}\n"}
{"label": "9", "index": "16706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int age;\n  int order;\n  struct stu *next;\n};\nint main() {\n  struct stu *p, *q, *t, *r, *head;\n  int n, i, j;\n  cin >> n;\n  head = (struct stu *)malloc(1000);\n  q = head;\n  for (i = 0; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d\", p->name, &p->age);\n    p->order = i;\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n  for (i = 0; i < n - 1; i++)\n    for (p = head, j = 0; j < n - 1 - i; j++, p = p->next) {\n      q = p->next;\n      t = q->next;\n      if ((q->age == t->age && q->order > t->order) ||\n          (q->age < 60 && t->age < q->age && q->order > t->order) ||\n          (t->age < 60 && t->age > q->age && q->order > t->order) ||\n          (t->age >= 60 && t->age > q->age)) {\n        r = t->next;\n        t->next = q;\n        p->next = t;\n        q->next = r;\n      }\n    }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct p {\n  char i[10];\n  int a;\n  struct p *next;\n};\nint main() {\n  struct p *p1, *p2, *head, *head2, *q1, *q2;\n  int n, i, k = 0, b = 0, x = 0;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  cin >> p1->i >> p1->a;\n  for (i = 0; i < n; i++) {\n    k++;\n    if (k == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n    scanf(\"%s %d\", p1->i, &p1->a);\n  }\n  p2->next = NULL;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60)\n      x++;\n  k = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next) {\n    if (p1->a >= 60 && p1->a > b) {\n      b = p1->a;\n      p2 = p1;\n    }\n  }\n  q1 = q2 = (struct p *)malloc(1000);\n  strcpy(q1->i, p2->i);\n  q1->a = p2->a;\n  p2->a = 0;\n  for (i = 0; i < x - 1; i++) {\n    k++;\n    if (k == 1)\n      head2 = q1;\n    else\n      q2->next = q1;\n    q2 = q1;\n    b = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next)\n      if (p1->a >= 60 && p1->a > b) {\n        b = p1->a;\n        p2 = p1;\n      }\n    q1 = (struct p *)malloc(1000);\n    strcpy(q1->i, p2->i);\n    q1->a = p2->a;\n    p2->a = 0;\n  }\n  q2->next = q1;\n  q2 = q1;\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a > 0) {\n      q1 = (struct p *)malloc(1000);\n      strcpy(q1->i, p1->i);\n      q1->a = p1->a;\n      p1->a = 0;\n      q2->next = q1;\n      q2 = q1;\n    }\n  q2->next = NULL;\n  for (q1 = head2; q1 != NULL; q1 = q1->next)\n    cout << q1->i << \" \";\n}\n"}
{"label": "9", "index": "16708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age, max, t, numold, numyoung;\n  char id[101][10], young[101][10];\n  int x[101], r[101];\n  cin >> n;\n  for (i = 0; i < 101; i++) {\n    x[i] = 0;\n    r[i] = 0;\n  }\n  numold = 0;\n  numyoung = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> id[i] >> age;\n    if (age >= 60) {\n      x[i] = age;\n      numold++;\n    } else {\n      numyoung++;\n      strcpy(young[numyoung], id[i]);\n    }\n  }\n  for (i = 1; i < 101; i++) {\n    max = 1;\n    for (int j = 2; j < 101; j++) {\n      if (x[j] > x[max])\n        max = j;\n    }\n    x[max] = 0;\n    t = i;\n    r[i] = max;\n    max = t;\n  }\n  for (i = 1; i <= numold; i++)\n    printf(\"%s\\n\", id[r[i]]);\n  for (i = 1; i <= numyoung; i++)\n    printf(\"%s\\n\", young[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int year;\n} pat[100];\nint arrange(struct patient peop[], int num);\n\nint main() {\n  int i, j = 0, k, n, max;\n  struct patient *ppat[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].id >> pat[i].year;\n  for (i = 0; i < n; i++) {\n    if (pat[i].year >= 60) {\n      ppat[j] = pat + i;\n      j++;\n    }\n  }\n\n  struct patient *p;\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - 1 - i; k++) {\n      if ((*ppat[k]).year < (*ppat[k + 1]).year) {\n        p = ppat[k];\n        ppat[k] = ppat[k + 1];\n        ppat[k + 1] = p;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", ppat[i]->id);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year < 60)\n      printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Pa {\n  char num[20];\n  int year;\n} pa[100];\nint main() {\n  int i, j, d = 0, n;\n  int b[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pa[i].num, &pa[i].year);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = pa[i].year;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        d = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = d;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      if (i == 0) {\n        for (j = 0; j < n; j++) {\n          if (pa[j].year == b[i])\n            printf(\"%s\\n\", pa[j].num);\n        }\n      } else {\n        if (b[i] != b[i - 1]) {\n          for (j = 0; j < n; j++) {\n            if (pa[j].year == b[i])\n              cout << pa[j].num << \"\\n\";\n          }\n        }\n      }\n    }\n    if (b[i] < 60)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].year < 60)\n      printf(\"%s\\n\", pa[i].num);\n  }\n}\n"}
{"label": "9", "index": "16711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct man {\n    char a[11];\n    int y;\n  } man[100];\n  int n;\n  scanf(\"%d\", &n);\n  char b[11];\n  int y;\n  int i, j;\n  char c[100][11];\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b, &y);\n    if (y >= 60) {\n      strcpy(man[k].a, b);\n      man[k].y = y;\n      k++;\n    } else {\n      strcpy(c[m], b);\n      m++;\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k - i; j++) {\n      int y1, y2;\n      y1 = man[j].y;\n      y2 = man[j + 1].y;\n      if (y1 < y2) {\n        y = man[j + 1].y;\n        man[j + 1].y = man[j].y;\n        man[j].y = y;\n        strcpy(b, man[j + 1].a);\n        strcpy(man[j + 1].a, man[j].a);\n        strcpy(man[j].a, b);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(b, man[i].a);\n    printf(\"%s\\n\", b);\n  }\n  for (i = 0; i < m; i++) {\n    strcpy(b, c[i]);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n} pat[100], str[100], t;\nint main() {\n  int n, i, j, a = -1, temp;\n  int ch[100];\n  char c[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      a++;\n      strcpy(str[a].num, pat[i].num);\n      str[a].age = pat[i].age;\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (str[j].age < str[j + 1].age) {\n        t = str[j];\n        str[j] = str[j + 1];\n        str[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      a++;\n      str[a] = pat[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", str[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n  int num;\n} bing[100], temp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> bing[i].id >> bing[i].age;\n    bing[i].num = i + 1;\n  }\n  for (j = 0; j <= n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (bing[i + 1].age >= 60 && bing[i].age < bing[i + 1].age) {\n        temp = bing[i + 1];\n        bing[i + 1] = bing[i];\n        bing[i] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", bing[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16714", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, pass;\n  struct patient {\n    char id[1000];\n    int age;\n  } men[1000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", men[i].id, &men[i].age);\n  for (pass = 1; pass < n; pass++) {\n    for (i = n - 1; i > pass - 1; i--) {\n      if (men[i].age >= 60 && men[i].age > men[i - 1].age) {\n        temp = men[i];\n        men[i] = men[i - 1];\n        men[i - 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", men[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16715", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[n][100];\n  int b[n], i, j, c[n], d[n], k;\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++) {\n    c[i] = 0;\n    d[i] = n;\n    for (j = 0; j < n; j++) {\n      if (b[j] >= 60 && b[j] > c[i]) {\n        for (k = 0; k < i; k++) {\n          if (j == d[k])\n            break;\n        }\n        if (k == i) {\n          c[i] = b[j];\n          d[i] = j;\n        }\n      }\n    }\n    if (d[i] != n && b[d[i]] >= 60)\n      printf(\"%s\\n\", a[d[i]]);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  int a6;\n  char Id[10];\n};\n\nint main() {\n  struct patient bin[1000];\n  int n, mid;\n  char s[10];\n  int i = 0, j = 0, k = 0;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &bin[i].ID, &bin[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age >= 60) {\n      bin[j].a6 = bin[i].age;\n      strcpy(bin[j].Id, bin[i].ID);\n      j++;\n      bin[i].age = 0;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++)\n      if (bin[i].a6 < bin[i + 1].a6) {\n        mid = bin[i].a6;\n        bin[i].a6 = bin[i + 1].a6;\n        bin[i + 1].a6 = mid;\n\n        strcpy(c, bin[i].Id);\n        strcpy(s, bin[i + 1].Id);\n        strcpy(bin[i + 1].Id, c);\n        strcpy(bin[i].Id, s);\n      }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", bin[i].Id);\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age != 0)\n      printf(\"%s \", bin[i].ID);\n  }\n}\n"}
{"label": "9", "index": "16717", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } a[100], m, k;\n  int i, j, n, num = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num++;\n      m = a[i];\n      for (j = i; j > 0; j--)\n        a[j] = a[j - 1];\n      a[0] = m;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = i + 1; j < num; j++) {\n      if (a[i].age <= a[j].age) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct sick {\n  char num[10];\n  int age;\n};\nint main() {\n  int i, j, n;\n  int s;\n  char swap[10];\n  struct sick all[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &all[i].num);\n    scanf(\"%d\", &all[i].age);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i; j > 0; j--) {\n      if (all[j].age >= 60 && all[j].age > all[j - 1].age) {\n        s = all[j].age;\n        all[j].age = all[j - 1].age;\n        all[j - 1].age = s;\n        strcpy(swap, all[j].num);\n        strcpy(all[j].num, all[j - 1].num);\n        strcpy(all[j - 1].num, swap);\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(all[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, mid;\n  char M[11];\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[11];\n    int age;\n  };\n  struct patient *per = (struct patient *)malloc(sizeof(struct patient) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", per[i].ID, &per[i].age);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - 1; i++) {\n      if (per[i].age < 60 && per[i + 1].age >= 60) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n      if (per[i].age >= 60 && per[i + 1].age >= 60 &&\n          per[i].age < per[i + 1].age) {\n        mid = per[i].age;\n        strcpy(M, per[i].ID);\n        per[i].age = per[i + 1].age;\n        strcpy(per[i].ID, per[i + 1].ID);\n        per[i + 1].age = mid;\n        strcpy(per[i + 1].ID, M);\n      }\n    }\n  for (i = 0; i < n; i++)\n    cout << per[i].ID << \"\\n\";\n  free(per);\n  return 0;\n}\n"}
{"label": "9", "index": "16720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int age[100], a, m = 0, tmp1[100], d = 0;\n  char zfc[100][11], tmp2[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      strcpy(tmp2[m], zfc[i]);\n      tmp1[m] = age[i];\n      m++;\n    }\n  }\n  for (a = m - 1; a > 0; a--) {\n    for (d = 0; d < a; d++) {\n      if (tmp1[d] < tmp1[d + 1]) {\n        char s[200];\n        strcpy(s, tmp2[d]);\n        strcpy(tmp2[d], tmp2[d + 1]);\n        strcpy(tmp2[d + 1], s);\n        int y;\n        y = tmp1[d];\n        tmp1[d] = tmp1[d + 1];\n        tmp1[d + 1] = y;\n      }\n    }\n  }\n  for (a = 0; a < m; a++) {\n    cout << tmp2[a] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      cout << zfc[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1[100], h2[100], c1 = 0, c2 = 0, t;\n  char d1[100][10], d2[100][10], d[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", d);\n    scanf(\"%d\", &t);\n    if (t >= 60) {\n      h1[c1] = t;\n      strcpy(d1[c1], d);\n      c1++;\n    } else {\n      h2[c2] = t;\n      strcpy(d2[c2], d);\n      c2++;\n    }\n  }\n  for (i = 1; i <= c1; i++) {\n    for (j = 0; j < c1 - i; j++) {\n      if (h1[j] < h1[j + 1]) {\n        t = h1[j];\n        h1[j] = h1[j + 1];\n        h1[j + 1] = t;\n        strcpy(d, d1[j]);\n        strcpy(d1[j], d1[j + 1]);\n        strcpy(d1[j + 1], d);\n      }\n    }\n  }\n  for (i = 0; i < c1; i++) {\n    puts(d1[i]);\n  }\n  for (i = 0; i < c2; i++) {\n    puts(d2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct fy {\n    char a[12];\n    int k;\n    int s;\n    struct fy *p;\n  } x[100], *head;\n  int n, i, j, l, kk, ss;\n  char aa[12];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[i].a, &x[i].k);\n    x[i].s = x[i].k >= 60 ? 1 : 0;\n    x[i].p = &x[i + 1];\n  }\n  head = &x[0];\n  x[n - 1].p = NULL;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (x[i].s == 1 && x[j].s == 1) {\n        if (x[i].k < x[j].k) {\n          kk = x[j].k;\n          ss = x[j].s;\n          strcpy(aa, x[j].a);\n          for (l = j; l > i; l--) {\n            x[l].k = x[l - 1].k;\n            x[l].s = x[l - 1].s;\n            strcpy(x[l].a, x[l - 1].a);\n          }\n          x[i].k = kk;\n          x[i].s = ss;\n          strcpy(x[i].a, aa);\n        }\n      }\n    }\n    if (x[i].s == 1)\n      cout << x[i].a << \"\\n\";\n  }\n  while (head != NULL) {\n    if (head->s == 0)\n      cout << head->a << \"\\n\";\n    head = head->p;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16723", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp, num1 = 0, num2 = 100, age[100], flag[100];\n  char id[100][10], str[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin.get();\n    cin >> id[i] >> age[i];\n    if (age[i] < 60)\n      flag[i] = num1++;\n    else\n      flag[i] = num2++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] < age[j] && age[j] >= 60) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] == age[j] && age[i] >= 60 && age[j] >= 60 &&\n              flag[i] > flag[j] ||\n          age[i] < 60 && age[j] < 60 && flag[i] > flag[j]) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  char id[10];\n  int old;\n} st[1000], stu[1000], temp;\nint main() {\n  int n, i, j, a, b, c;\n  char cc, aa, x[1000], y[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%c%d%c\", st[i].id, &aa, &st[i].old, &cc);\n  }\n  a = 0;\n  for (j = 1; j <= n; j++) {\n    if (st[j].old >= 60) {\n      a++;\n      stu[a] = st[j];\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = 1; j <= i; j++) {\n      if (stu[j].old < stu[j + 1].old) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    puts(stu[i].id);\n  }\n  for (i = 1; i <= n; i++) {\n    if (st[i].old < 60)\n      puts(st[i].id);\n  }\n}\n"}
{"label": "9", "index": "16725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct {\n    char id[10];\n    int age;\n  } br[100], *p, old[100], *q;\n  for (p = br; p < br + n; p++) {\n    scanf(\"%s%d\", &(p->id), &(p->age));\n  }\n  q = old;\n  int js = 0;\n  for (p = br; p < br + n; p++) {\n    if (p->age >= 60) {\n      q->age = p->age;\n      strcpy(q->id, p->id);\n      q++;\n      js++;\n      p->age = 0;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < js; i++) {\n    for (q = old; q < old + js; q++) {\n      if (q->age > (old + max)->age) {\n        max = q - old;\n      }\n    }\n    cout << (old + max)->id << \"\\n\";\n    (old + max)->age = 0;\n  }\n  for (p = br; p < br + n; p++) {\n    if (p->age != 0) {\n      printf(\"%s\\n\", p->id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct p {\n    char num[100];\n    int age;\n  } pa[100], p[100], t;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &pa[i].num, &pa[i].age);\n  }\n  i = n - 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age < 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  k = i + 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (pa[j].age >= 60) {\n      p[i] = pa[j];\n      i--;\n    }\n  }\n  for (j = 0; j < k; j++) {\n    for (i = 0; i < k - j - 1; i++) {\n      if (p[i].age < p[i + 1].age) {\n        t = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", &p[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16727", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b[100], pos[100], t, m;\n  char a[100][11], temp[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i] >> b[i];\n  for (i = 0; i < n; i++)\n    pos[i] = i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if (b[j] < b[j + 1]) {\n        t = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = t;\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n      }\n    }\n  j = 0;\n  while (b[j] >= 60) {\n    printf(\"%s\\n\", a[j++]);\n  }\n  k = j;\n  for (i = k; i < n; i++)\n    for (j = k; j < n - 1; j++) {\n      if (pos[j] > pos[j + 1]) {\n        strcpy(temp, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], temp);\n        m = pos[j];\n        pos[j] = pos[j + 1];\n        pos[j + 1] = m;\n      }\n    }\n  for (j = k; j < n; j++)\n    printf(\"%s\\n\", a[j]);\n  return 0;\n}\n"}
{"label": "9", "index": "16728", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[11];\n  int age;\n} p[1000];\n\nint main() {\n  int n, i, k, j, l, a = 0, b = 0, e;\n  int sz1[1000], sz2[1000];\n  char zfc1[1000][11], zfc2[1000][11], f[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &p[i].ID);\n    scanf(\" %d\", &p[i].age);\n  }\n  for (i = 0, j = 0, l = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a++;\n      sz1[j] = p[i].age;\n      strcpy(zfc1[j], p[i].ID);\n      j++;\n    } else {\n      b++;\n      sz2[l] = p[i].age;\n      strcpy(zfc2[l], p[i].ID);\n      l++;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (j = n - 1; j >= k; j--) {\n      if (sz1[j + 1] > sz1[j]) {\n        e = sz1[j];\n        sz1[j] = sz1[j + 1];\n        sz1[j + 1] = e;\n        strcpy(f, zfc1[j]);\n        strcpy(zfc1[j], zfc1[j + 1]);\n        strcpy(zfc1[j + 1], f);\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", zfc1[j]);\n  }\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", zfc2[l]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char num[11];\n  int age;\n};\nint main() {\n  int n, i;\n  cin >> n;\n  struct patient pat1[100], pat2[100];\n  for (i = 0; i < n; i++) {\n    cin >> pat1[i].num >> pat1[i].age;\n    strcpy(pat2[i].num, pat1[i].num);\n    pat2[i].age = pat1[i].age;\n  }\n  int j, e;\n  char e_num[11];\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (pat1[i].age < pat1[i + 1].age) {\n        e = pat1[i + 1].age;\n        strcpy(e_num, pat1[i + 1].num);\n        pat1[i + 1].age = pat1[i].age;\n        strcpy(pat1[i + 1].num, pat1[i].num);\n        pat1[i].age = e;\n        strcpy(pat1[i].num, e_num);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat1[i].age >= 60) {\n      printf(\"%s\\n\", pat1[i].num);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat2[i].age < 60) {\n      printf(\"%s\\n\", pat2[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16730", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\ntypedef struct {\n  char id[20];\n  int age;\n} patient;\nint main() {\n  patient a[100], b[100], c[100], temp;\n  int n, i, j, k = 0, l = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].age;\n    if (a[i].age >= 60) {\n      for (j = 0; j < 20; j++) {\n        b[k].id[j] = a[i].id[j];\n        b[k].age = a[i].age;\n      }\n      k++;\n    } else {\n      for (j = 0; j < 20; j++)\n        c[l].id[j] = a[i].id[j];\n\n      l++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "16731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, e;\n  char q[11];\n  struct point {\n    char name[11];\n    int age;\n  } p[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &p[i].name, &p[i].age);\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if ((p[i].age > 60 || p[i].age == 60) &&\n              (p[i + 1].age > 60 || p[i + 1].age == 60) &&\n              p[i].age < p[i + 1].age ||\n          p[i].age < 60 && (p[i + 1].age > 60 || p[i + 1].age == 60)) {\n        e = p[i].age;\n        p[i].age = p[i + 1].age;\n        p[i + 1].age = e;\n\n        strcpy(q, p[i].name);\n        strcpy(p[i].name, p[i + 1].name);\n        strcpy(p[i + 1].name, q);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i].name);\n    if (i != n - 1) {\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n} a[100], e, b[100];\n\nint main() {\n  int n, J;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j].id > a[j + 1].id) {\n        e = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = e;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  J = j;\n  for (j = 0; j < J; j++) {\n    for (i = 0; i < J - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (j = 0; j < J; j++) {\n    cout << b[j].id << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct arr {\n  char id[10];\n  int age;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  scanf(\"%s %d\", &p1->id, &p1->age);\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%s %d\", &p1->id, &p1->age);\n  }\n  p1->next = NULL;\n  return (head);\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->age == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->age == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%s \", p->id);\n    else\n      printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  if (head != NULL) {\n    while (p != NULL) {\n      head = head->next;\n      free(p);\n      p = head;\n    }\n  }\n}\nint main() {\n  struct arr *head, *p1;\n  int m, max = 0;\n  scanf(\"%d\", &m);\n  head = create(m);\n  for (;;) {\n    max = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next) {\n      max = (max > p1->age) ? max : p1->age;\n    }\n    if (max >= 60) {\n      for (p1 = head; p1 != NULL; p1 = p1->next) {\n        if (p1->age == max)\n          printf(\"%s \", p1->id);\n      }\n      head = del(head, max);\n    } else\n      break;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "9", "index": "16734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int n) {\n  int i, s;\n  for (i = 1, s = a[1]; i < n; i++)\n    s = (s >= a[i]) ? s : a[i];\n  return (s);\n}\nint main() {\n  int a[200] = {0}, i, n, c[200] = {0}, e, t = 1;\n  char b[200][12];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%d\", b[i], &e);\n    if (e >= 60)\n      a[i] = e;\n    else\n      c[i] = e;\n  }\n  for (;;) {\n    t = max(a, n);\n    if (t == 0)\n      break;\n    for (i = 1; i <= n; i++) {\n      if (a[i] == t) {\n        printf(\"%s \", b[i]);\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (c[i] != 0)\n      cout << b[i] << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  struct point {\n    char x[10];\n    int y;\n  } sz[100];\n  struct po {\n    char a[10];\n    int b;\n    int c;\n  } lnr[100];\n  int n, temp;\n  int tag = 0;\n  char tem[100];\n  int count = 0;\n\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i].x >> sz[i].y;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int k = tag; k < n; k++) {\n      if (sz[k].y >= 60) {\n        lnr[j].c = k;\n        lnr[j].b = sz[k].y;\n        strcpy(lnr[j].a, sz[k].x);\n        tag = k + 1;\n        count++;\n        break;\n      }\n    }\n  }\n  for (int l = 0; l < count - 1; l++) {\n    for (int m = count - 1; m > l; m--) {\n      if (lnr[m].b > lnr[m - 1].b) {\n        temp = lnr[m - 1].b;\n        lnr[m - 1].b = lnr[m].b;\n        lnr[m].b = temp;\n\n        strcpy(tem, lnr[m - 1].a);\n        strcpy(lnr[m - 1].a, lnr[m].a);\n        strcpy(lnr[m].a, tem);\n      }\n    }\n  }\n  tag = n - 1;\n  for (int o = n - 1; o > count - 1; o--) {\n    for (int p = tag; p >= 0; p--) {\n      if (sz[p].y < 60) {\n        sz[o].y = sz[p].y;\n        strcpy(sz[o].x, sz[p].x);\n        tag = p - 1;\n        break;\n      }\n    }\n  }\n  for (int q = 0; q < count; q++)\n    printf(\"%s\\n\", lnr[q].a);\n\n  for (int r = count; r < n; r++) {\n    printf(\"%s\\n\", sz[r].x);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\ntypedef struct data *pdata;\n\nstruct data {\n  char a[20];\n  int b;\n  pdata next;\n};\n\npdata sort(int n) {\n  pdata p = NULL, q = NULL, s = NULL, head = NULL;\n  head = (pdata)malloc(sizeof(struct data));\n  head->next = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    s = (pdata)malloc(sizeof(struct data));\n    cin >> s->a >> (s->b);\n    if (s->b >= 60) {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->b < s->b) {\n          break;\n        }\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        q = q->next;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = NULL;\n    }\n  }\n\n  return head;\n}\n\nint main() {\n  int n, i;\n  pdata p, head;\n  cin >> n;\n  head = sort(n);\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->a);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, n, w, max, old;\n  int q = 0;\n  char d[101][10];\n  int a[101];\n  int b[101];\n  int c[101];\n  scanf(\"%d\", &n);\n  old = 0;\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", d[i], &a[i]);\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n    if (a[i] >= 60) {\n      b[i] = 1;\n      old = old + 1;\n    }\n  }\n\n  for (i = 1; i <= old; i++) {\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      if (b[j] == 1) {\n        if (a[j] > max) {\n          max = a[j];\n          w = j;\n        }\n      }\n    }\n    c[i] = w;\n    b[w] = 2;\n  }\n  for (l = 1; l <= old; l++) {\n    q = c[l];\n    printf(\"%s \", d[q]);\n  }\n  for (l = 1; l <= n; l++) {\n    if (b[l] == 0)\n      printf(\"%s \", d[l]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16738", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  char str[10];\n  int age;\n} per[100], per1[100], per2[100];\n\nint main(int argc, char *argv[]) {\n  int n, i, j = 0, k = 0, x = 0, t;\n  char e[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", per[i].str, &per[i].age);\n    if (per[i].age >= 60) {\n      strcpy(per1[j].str, per[i].str);\n      per1[j].age = per[i].age;\n      j++;\n    } else {\n      strcpy(per2[k].str, per[i].str);\n      per2[k].age = per[i].age;\n      k++;\n    }\n  }\n  for (x = 0; x < j; x++) {\n    for (i = 0; i < j - x; i++) {\n      if (per1[i].age < per1[i + 1].age) {\n        strcpy(e, per1[i].str);\n        strcpy(per1[i].str, per1[i + 1].str);\n        strcpy(per1[i + 1].str, e);\n        t = per1[i].age;\n        per1[i].age = per1[i + 1].age;\n        per1[i + 1].age = t;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", per1[i].str);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", per2[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16739", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct staff {\n  char id[20];\n  int age;\n  struct staff *next;\n};\n\nint main() {\n  int n, k = 0, max = 59;\n  struct staff *head, *p, *q, *pre;\n  scanf(\"%d\", &n);\n  struct staff *p1, *p2;\n  p1 = (struct staff *)malloc(1000);\n  cin >> p1->id >> p1->age;\n  head = p2 = p1;\n  if (p1->age >= 60)\n    k++;\n  while (n - 1) {\n    n--;\n    p1 = (struct staff *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  while (k) {\n    p = head;\n    k--;\n    while (p) {\n      if (p->age > max) {\n        max = p->age;\n        q = p;\n      }\n      p = p->next;\n    }\n    printf(\"%s \", q->id);\n    if (q == head) {\n      head = q->next;\n      free(q);\n    } else {\n      if (q->next == NULL) {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            free(q);\n            pre->next = NULL;\n            break;\n          }\n        }\n      }\n\n      else {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            p = p->next;\n            pre->next = p;\n            free(q);\n            break;\n          }\n        }\n      }\n    }\n    max = 59;\n  }\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16740", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char num[11];\n    int age;\n  } pat[101], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].num >> pat[i].age;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((pat[j].age < 60 && pat[j + 1].age >= 60) ||\n          (pat[j].age >= 60 && pat[j + 1].age > pat[j].age)) {\n        t = pat[j];\n        pat[j] = pat[j + 1];\n        pat[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char num[20];\n  int age;\n};\n\nint main()\n\n{\n  void bubble(struct patient a[], int len);\n  int n, i, old, sum, age, j;\n  struct patient a[100];\n  struct patient b[100];\n  char str[100] = {'\\0'};\n  char str1[100] = {'\\0'};\n\n  scanf(\"%d\", &n);\n\n  for (i = 0, j = 0, sum = 0; sum <= n;) {\n    age = 0;\n    strcpy(str, str1);\n    scanf(\"%s %d\", str, &age);\n\n    if (age >= 60) {\n      strcpy(a[i].num, str);\n      a[i].age = age;\n      i++;\n      sum++;\n    } else {\n      strcpy(b[j].num, str);\n      b[j].age = age;\n      j++;\n      sum++;\n    }\n  }\n\n  bubble(a, i);\n  old = i;\n\n  for (i = 0; i < old; i++) {\n    printf(\"%s\\n\", a[i].num);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", b[i].num);\n\n  return 0;\n}\n\nvoid bubble(struct patient a[], int len) {\n  int i, pass;\n  struct patient temp;\n\n  for (pass = 1; pass < len; pass++) {\n    for (i = 0; i < len - pass; i++) {\n      if (a[i].age < a[i + 1].age) {\n        temp = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = temp;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct point {\n    char id[10];\n    int age;\n  } patient[100];\n  int n;\n  int i, j, k;\n  int on = 0, old[100], flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", patient[i].id, &patient[i].age);\n  }\n  for (j = 120; j >= 60; j--) {\n    for (i = 0; i < n; i++) {\n      if (patient[i].age == j) {\n        printf(\"%s\\n\", patient[i].id);\n        old[on] = i;\n        on++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < on; k++) {\n      if (i == old[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      printf(\"%s\\n\", patient[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16743", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nstruct student {\n  int a;\n  char num[20];\n  struct student *next;\n};\n\nstruct student *creat() {\n  struct student *head, *headtwo, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s%d\", p1->num, &p1->a);\n  head = (struct student *)malloc(1000);\n  head->next = p1;\n  p2 = head;\n  p1->next = NULL;\n  headtwo = (struct student *)malloc(1000);\n  p4 = headtwo;\n  p4->next = NULL;\n  int i, t = 0;\n  for (i = 0; i < n - 1; i++) {\n    t = 0;\n    p3 = (struct student *)malloc(1000);\n    scanf(\"%s%d\", p3->num, &p3->a);\n    if (p3->a >= 60) {\n      p2 = head;\n      p1 = head->next;\n      while (p1 != NULL) {\n        if (p3->a > p1->a) {\n          p3->next = p1;\n          p2->next = p3;\n          t = 1;\n          break;\n        }\n        p2 = p1;\n        p1 = p1->next;\n      }\n      if (t == 0) {\n        p2->next = p3;\n        p3->next = NULL;\n      }\n    }\n    if (p3->a < 60) {\n      p4->next = p3;\n      p4 = p3;\n      p4->next = NULL;\n    }\n  }\n  p1 = head;\n  while (p1->next != NULL)\n    p1 = p1->next;\n\n  p1->next = headtwo->next;\n  return head;\n}\nint main() {\n  scanf(\"%d\", &n);\n  struct student *head, *p;\n  head = creat();\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0;\n  scanf(\"%d\\n\", &n);\n  struct p {\n    char num[10000];\n    int age;\n  } p[100];\n  struct p1 {\n    char num1[10000];\n    int age1;\n  } p1[100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\\n\", p[i].num, &p[i].age);\n    if (p[i].age >= 60) {\n      strcpy(p1[m].num1, p[i].num);\n      p1[m].age1 = p[i].age;\n      m = m + 1;\n    }\n  }\n  int e;\n  char w[10000];\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (p1[j].age1 < p1[j + 1].age1) {\n        strcpy(w, p1[j + 1].num1);\n        strcpy(p1[j + 1].num1, p1[j].num1);\n        strcpy(p1[j].num1, w);\n        e = p1[j + 1].age1;\n        p1[j + 1].age1 = p1[j].age1;\n        p1[j].age1 = e;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", p1[i].num1);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60)\n      printf(\"%s\\n\", p[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct patient {\n    char ID[10];\n    int age;\n    struct patient *next;\n    struct patient *pre;\n  };\n  struct patient *p, *head, *q, *m, *temp;\n  p = (struct patient *)malloc(sizeof(struct patient));\n  head = p;\n  temp = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p->ID, &p->age);\n    if (i != n - 1) {\n      p->next = (struct patient *)malloc(sizeof(struct patient));\n      p->next->pre = p;\n      p->next->next = NULL;\n      p = p->next;\n    }\n  }\n  for (p = head; p != NULL; p = p->next) {\n    for (q = p->next; q != NULL; q = q->next) {\n      if ((p->age < q->age) && (q->age >= 60)) {\n        for (m = q; m != p; m = m->pre) {\n          temp->age = m->age;\n          m->age = m->pre->age;\n          m->pre->age = temp->age;\n          strcpy(temp->ID, m->ID);\n          strcpy(m->ID, m->pre->ID);\n          strcpy(m->pre->ID, temp->ID);\n        }\n      }\n    }\n  }\n  for (p = head; p != NULL; p = p->next)\n    printf(\"%s\\n\", p->ID);\n  return 0;\n}\n"}
{"label": "9", "index": "16746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } br[100];\n\n  int n, i, j, mid, k;\n\n  char s[10];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &br[i].id, &br[i].age);\n  }\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (br[i].age >= 60) {\n        for (j = i + 1; j < n; j++) {\n          if (br[j].age >= 60) {\n            if (br[j].age > br[i].age) {\n              mid = br[i].age;\n              br[i].age = br[j].age;\n              br[j].age = mid;\n\n              strcpy(s, br[i].id);\n              strcpy(br[i].id, br[j].id);\n              strcpy(br[j].id, s);\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age >= 60) {\n      printf(\"%s\\n\", br[i].id);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (br[i].age < 60) {\n      cout << br[i].id << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16747", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, sr = 0, jr = 0, age, srage[100], jrage[100];\n  char num[10], srnum[100][10], jrnum[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &num, &age);\n    if (age < 60) {\n      strcpy(jrnum[jr], num);\n      jrage[jr] = age;\n      jr++;\n    } else {\n      strcpy(srnum[sr], num);\n      srage[sr] = age;\n      sr++;\n    }\n  }\n  for (i = sr - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (srage[j] < srage[j + 1]) {\n        age = srage[j];\n        srage[j] = srage[j + 1];\n        srage[j + 1] = age;\n        strcpy(num, srnum[j]);\n        strcpy(srnum[j], srnum[j + 1]);\n        strcpy(srnum[j + 1], num);\n      }\n    }\n  }\n  for (i = 0; i < sr; i++)\n    printf(\"%s\\n\", srnum[i]);\n  for (i = 0; i < jr; i++)\n    printf(\"%s\\n\", jrnum[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct patient {\n    char num[10];\n    int age;\n  } pa[100], pao[100], pay[100], blank;\n  int i, j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pa[i].num);\n    scanf(\"%d\", &pa[i].age);\n    if (pa[i].age >= 60)\n      pao[j++] = pa[i];\n    else\n      pay[k++] = pa[i];\n  }\n  int t;\n  for (i = 0; i < j; i++) {\n    for (t = i + 1; t < j; t++) {\n      if (pao[t].age > pao[i].age) {\n        blank = pao[i];\n        pao[i] = pao[t];\n        pao[t] = blank;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (pao[i].age != pao[i - 1].age) {\n      for (t = 0; t < n; t++)\n        if (pa[t].age == pao[i].age)\n          printf(\"%s\\n\", pa[t].num);\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << pay[i].num << \"\\n\";\n}\n"}
{"label": "9", "index": "16749", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  char str[100][100]; \n\n  int s1[100], sz[100], t[100];\n  int n, i, p, k;\n\n  scanf(\"%d\", &n); \n\n  int j = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", str[i], &sz[i]); \n\n    if (sz[i] >= 60) \n    {\n      t[j] = i; \n      s1[j] = sz[i];\n      j++;\n    } \n  }\n\n  for (k = 1; k <= j; k++) \n  {\n    for (p = 0; p < j - k; p++) {\n      if (s1[p] < s1[p + 1]) \n      {\n        int e, f;\n        e = s1[p + 1];\n        s1[p + 1] = s1[p];\n        s1[p] = e;\n        f = t[p + 1];\n        t[p + 1] = t[p];\n        t[p] = f;\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s\\n\", str[t[p]]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      printf(\"%s\\n\", str[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct pa {\n    char id[20];\n    int old;\n  } pai[101], ol[101], you[101];\n  int n, i, j, k, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pai[i].id, &pai[i].old);\n  }\n  l = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (pai[i].old >= 60) {\n      ol[l] = pai[i];\n      l++;\n    }\n    if (pai[i].old < 60) {\n      you[k] = pai[i];\n      k++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (ol[j].old < ol[j + 1].old) {\n        ol[100] = ol[j];\n        ol[j] = ol[j + 1];\n        ol[j + 1] = ol[100];\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", ol[i].id);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\\n\", you[i].id);\n  }\n  cout << you[k - 1].id;\n  return 0;\n}\n"}
{"label": "9", "index": "16751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bin {\n  char ID[10];\n  int age;\n  struct bin *next;\n};\nint main() {\n  struct bin *head, *p, *p1, *p2, *p3;\n  int m, n, i, j, k;\n  scanf(\"%d\", &n);\n  p = (struct bin *)malloc(sizeof(struct bin));\n  scanf(\"%s%d\", &p->ID, &p->age);\n  head = p3 = p;\n  p->next = 0;\n  for (i = 1; i < n; i++) {\n    p = (struct bin *)malloc(sizeof(struct bin));\n    scanf(\"%s%d\", &p->ID, &p->age);\n    if (p->age < 60) {\n      p3->next = p;\n      p->next = 0;\n      p3 = p;\n    } else {\n      if (p->age > head->age) {\n        p->next = head;\n        head = p;\n      } else if (p->age <= p3->age) {\n        p3->next = p;\n        p->next = 0;\n        p3 = p;\n      } else {\n        p1 = head;\n        p2 = p1->next;\n        while (p2->age >= p->age) {\n          p1 = p1->next;\n          p2 = p2->next;\n        }\n        p1->next = p;\n        p->next = p2;\n      }\n    }\n  }\n  for (; head != 0; head = head->next) {\n    printf(\"%s\\n\", head->ID);\n  }\n}\n"}
{"label": "9", "index": "16752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, k = 0, d[100], p;\n  char b[100][10], c[10], str[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", str[i], &a[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] >= 60) {\n      d[k] = a[i];\n      strcpy(b[k], str[i]);\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (d[j] < d[j + 1]) {\n        p = d[j + 1];\n        d[j + 1] = d[j];\n        d[j] = p;\n\n        strcpy(c, b[j + 1]);\n        strcpy(b[j + 1], b[j]);\n        strcpy(b[j], c);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i]);\n  for (i = 0; i < n; i++)\n    if (a[i] < 60)\n      printf(\"%s\\n\", str[i]);\n}\n"}
{"label": "9", "index": "16753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ID {\n  char idnum[100];\n  int old;\n};\nint main() {\n  struct ID ido[100]; \n  struct ID idy[100]; \n  struct ID id[100];  \n  struct ID e;\n  int n, i, a = 0, b = 0, j, l, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i].idnum, &(id[i].old));\n    if (id[i].old >= 60) { \n      strcpy(ido[a].idnum, id[i].idnum);\n      ido[a].old = id[i].old;\n      a++;\n    } else { \n      strcpy(idy[b].idnum, id[i].idnum);\n      idy[b].old = id[i].old;\n      b++;\n    }\n  }\n\n  for (k = 1; k <= a; k++) { \n    for (i = 0; i < a - k; i++) {\n      if (ido[i].old < ido[i + 1].old) {\n        e = ido[i + 1];\n        ido[i + 1] = ido[i];\n        ido[i] = e;\n      }\n    }\n  }\n\n  for (j = 0; j < a; j++) { \n    printf(\"%s\\n\", ido[j].idnum);\n  }\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", idy[l].idnum);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16754", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, y[200], p[200];\n  char a[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 200; i++) {\n    p[i] = 200 - i;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> y[i];\n  }\n  for (i = 0; i <= 140; i++) {\n    for (j = 0; j < n; j++) {\n      if (y[j] == p[i])\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60)\n      printf(\"%s\\n\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} pat[100], p[100];\nint main() {\n  int n, m = 0, i, j = 0, k, temp, a[40] = {0}, sum = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      p[j++] = pat[i];\n      m++;\n    }\n  }\n  a[0] = p[0].age;\n  for (j = 1; j < m; j++) {\n    for (i = 0; a[i] != 0; i++)\n      if (a[i] == p[j].age)\n        break;\n    if (a[i] == 0) {\n      a[i] = p[j].age;\n      sum++;\n    }\n  }\n  for (j = 0; j < sum - 1; j++) {\n    k = j;\n    {\n      for (i = j + 1; i < sum; i++)\n        if (a[i] > a[j]) {\n          k = i;\n          temp = a[k];\n          a[k] = a[j];\n          a[j] = temp;\n        }\n    }\n  }\n  for (k = 0; k < sum; k++) {\n    for (j = 0; j < m; j++) {\n      if (p[j].age == a[k])\n        printf(\"%s\\n\", p[j].id);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60)\n      cout << pat[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, stu[2000][3], t[3], hao;\n  char ID[20000][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> ID[i] >> stu[i][1];\n  for (i = 0; i < n; i++) {\n    stu[i][0] = atoi(ID[i]);\n    stu[i][2] = i;\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[j][1] <= stu[i][1]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = n - 1; i >= 0; i--) {\n    if (stu[i][1] >= 60) {\n\n      hao = stu[i][2];\n\n      cout << ID[hao] << \"\\n\";\n\n      n--;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i][2] > stu[j][2]) {\n        t[0] = stu[i][0];\n        stu[i][0] = stu[j][0];\n        stu[j][0] = t[0];\n        t[1] = stu[i][1];\n        stu[i][1] = stu[j][1];\n        stu[j][1] = t[1];\n        t[2] = stu[i][2];\n        stu[i][2] = stu[j][2];\n        stu[j][2] = t[2];\n      }\n    }\n  for (i = 0; i < n; i++) {\n    hao = stu[i][2];\n\n    printf(\"%s\\n\", ID[hao]);\n  }\n}\n"}
{"label": "9", "index": "16757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  int num;\n  char hao[20];\n  int age;\n  struct patient *next;\n};\nstruct ans {\n  int numan;\n  char haoan[20];\n  int agean;\n  struct ans *nextan;\n};\nint main() {\n  struct patient *head, *p1, *p2;\n  struct ans *headan, *ans1, *ans2;\n  int i, j, max, n, shu;\n  shu = 0;\n  scanf(\"%d\", &n);\n  p1 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->hao, &p1->age);\n  p1->num = 1;\n  head = p1;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p1->hao, &p1->age);\n    p2->next = p1;\n    p1->num = i + 2;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  max = 0;\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max < p1->age)\n      max = p1->age;\n    p1 = p1->next;\n  }\n  p1 = head;\n  for (j = 0; j < n; j++) {\n    if (max == p1->age) {\n      ans1 = (struct ans *)malloc(sizeof(struct ans));\n      strcpy(ans1->haoan, p1->hao);\n      printf(\"%s\\n\", ans1->haoan);\n      ans1->agean = max;\n      headan = ans1;\n      ans2 = ans1;\n      p1->num = -1;\n      p1->age = -1;\n      shu = shu + 1;\n      break;\n    }\n    p1 = p1->next;\n  }\n  for (i = 0; i < n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max < p1->age)\n        max = p1->age;\n      p1 = p1->next;\n    }\n    if (max < 60) {\n      break;\n    }\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->age) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->agean = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        shu = shu + 1;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  for (i = 0; i < n - shu; i++) {\n    max = 101;\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max > p1->num && p1->num != -1)\n        max = p1->num;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (j = 0; j < n; j++) {\n      if (max == p1->num) {\n        ans1 = (struct ans *)malloc(sizeof(struct ans));\n        strcpy(ans1->haoan, p1->hao);\n        printf(\"%s\\n\", ans1->haoan);\n        ans1->numan = max;\n        headan = ans1;\n        ans2 = ans1;\n        p1->num = -1;\n        p1->age = -1;\n        break;\n      }\n      p1 = p1->next;\n    }\n    ans2->nextan = NULL;\n  }\n}\n"}
{"label": "9", "index": "16758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } br[100], lr[100], temp;\n\n  int i, n, m, j;\n  scanf(\"%d\", &n);\n  for (i = 0, j = 0; i < n; i++) {\n    scanf(\"%s %d\", br[i].id, &br[i].age);\n    if (br[i].age >= 60) {\n      lr[j] = br[i];\n      j++;\n    }\n  }\n  m = j;\n  for (i = 1; i < m; i++) {\n    for (j = 1; j <= m - i; j++) {\n      if (lr[j].age > lr[j - 1].age) {\n        temp = lr[j - 1];\n        lr[j - 1] = lr[j];\n        lr[j] = temp;\n      }\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", lr[i].id);\n  for (i = 0; i < n; i++)\n    if (br[i].age < 60)\n      printf(\"%s\\n\", br[i].id);\n}\n"}
{"label": "9", "index": "16759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  char id[10];\n  int old;\n} st[1000], stu[1000], temp;\nint main() {\n  int n, i, j, a, b, c;\n  char cc, aa, x[1000], y[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%c%d%c\", st[i].id, &aa, &st[i].old, &cc);\n  }\n  a = 0;\n  for (j = 1; j <= n; j++) {\n    if (st[j].old >= 60) {\n      a++;\n      stu[a] = st[j];\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = 1; j <= i; j++) {\n      if (stu[j].old < stu[j + 1].old) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    puts(stu[i].id);\n  }\n  for (i = 1; i <= n; i++) {\n    if (st[i].old < 60) {\n      puts(st[i].id);\n    }\n  }\n}\n"}
{"label": "9", "index": "16760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int y;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *y;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  y = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).y);\n    if ((*(s + i)).y >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(y + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if (o[j].y > o[j - 1].y) {\n        t = o[j];\n        o[j] = o[j - 1];\n        o[j - 1] = t;\n      }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(y + i)).id);\n}\n"}
{"label": "9", "index": "16761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n} patient[100], patient2[100];\n\nint main() {\n  int i, k, m, n, j, temp;\n  char id2[10];\n  scanf(\"%d\\n\", &n); \n\n  for (i = 0; i < n; i++) \n  {\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n  }\n  for (i = 0, j = 0; i < n;) \n  {\n    if (patient[i].age >= 60) {\n      strcpy(patient2[j].id, patient[i].id);\n      patient2[j].age = patient[i].age;\n      \n      j++;\n      for (k = i; k < n - 1; k++) {\n        strcpy(patient[k].id, patient[k + 1].id);\n        patient[k].age = patient[k + 1].age;\n      }\n      n--;\n    } else\n      i++;\n  }\n  \n  \n  for (i = 1; i < j; i++) {\n    for (k = 0; k < i; k++) {\n      if (patient2[i].age > patient2[k].age) {\n        temp = patient2[i].age;\n        strcpy(id2, patient2[i].id);\n        for (m = i; m > k; m--) {\n          patient2[m].age = patient2[m - 1].age;\n          strcpy(patient2[m].id, patient2[m - 1].id);\n        }\n        patient2[k].age = temp;\n        strcpy(patient2[k].id, id2);\n      }\n      \n      \n      \n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", patient2[i].id);\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", patient[i].id);\n}\n"}
{"label": "9", "index": "16762", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char temp_0[10], id[100][10];\n  int i, j, n, max, age[100], num[100], yes[100], ncount = 1, temp, num_1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num[i] = i;\n    cin >> id[i] >> age[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (age[i] < age[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60)\n      printf(\"%s \", id[i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n - j - 1; i++) {\n      if (num[i] > num[i + 1]) {\n        strcpy(temp_0, id[i]);\n        temp = age[i];\n        num_1 = num[i];\n        strcpy(id[i], id[i + 1]);\n        age[i] = age[i + 1];\n        num[i] = num[i + 1];\n        age[i + 1] = temp;\n        strcpy(id[i + 1], temp_0);\n        num[i + 1] = num_1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s \", id[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16763", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct st {\n  char s[11];\n  int n;\n  struct st *next;\n};\nstruct st *creat(int m) {\n  struct st *head, *p1, *p2;\n  int i;\n  for (i = 0; i < m; i++) {\n    p1 = (struct st *)malloc(1000);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    scanf(\"%s %d\", p1->s, &p1->n);\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid line(struct st *head, int m) {\n  struct st *p, *p1, *p2;\n  p = head;\n  int i, j, t;\n  for (i = 0; i < m; i++) {\n    p1 = p;\n    p2 = p1->next;\n    for (j = 1; j < m; j++) {\n      char ss[11] = {'\u0000'};\n      if (p1->n >= 60) {\n        if (p2->n > p1->n) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      } else {\n        if (p2->n >= 60) {\n          strcpy(ss, p1->s);\n          strcpy(p1->s, p2->s);\n          strcpy(p2->s, ss);\n          t = p1->n;\n          p1->n = p2->n;\n          p2->n = t;\n        }\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", p->s);\n    p = p->next;\n  }\n}\nint main() {\n  struct st *p;\n  void line(struct st * head, int m);\n  struct st *creat(int m);\n  int m, i, j;\n  scanf(\"%d\", &m);\n  p = creat(m);\n  line(p, m);\n}\n"}
{"label": "9", "index": "16764", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  struct pat *next;\n};\n\nstruct pat *creat(int n) {\n  struct pat *p1, *p2, *head;\n  int i;\n  p2 = head = p1 = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (i == 0)\n      head = p1;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n  }\n  p2 = NULL;\n  return head;\n}\n\nvoid array_1(struct pat *head, int n) {\n  int i, j, ta;\n  char str[10];\n  struct pat *p1, *p2;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      p2 = p1;\n      p1 = p1->next;\n      if ((p1->age) > (p2->age) && (p1->age) >= 60) {\n\n        strcpy(str, p2->num);\n        strcpy(p2->num, p1->num);\n        strcpy(p1->num, str);\n        ta = p1->age;\n        p1->age = p2->age;\n        p2->age = ta;\n      }\n    }\n    p1 = head;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct pat *p;\n  p = creat(n);\n  array_1(p, n);\n  int i;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age, seq;\n  struct patient *next;\n};\nint main() {\n  int n, n1 = 0, n2 = 0, i, j, m, at;\n  char id[10];\n  struct patient *head1, *head2, *p11, *p12, *p21, *p22, *t, *q;\n  scanf(\"%d\", &n);\n  head1 = NULL;\n  head2 = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id, &at);\n    if (at >= 60) {\n      if (head1 == NULL) {\n        head1 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head1->id, id);\n        head1->age = at;\n        head1->next = NULL;\n      } else {\n        p11 = (struct patient *)malloc(sizeof(struct patient));\n        p11->age = at;\n        strcpy(p11->id, id);\n        for (t = head1, q = t; t != NULL; q = t, t = t->next) {\n          if (t->age < at && t != head1) {\n            q->next = p11;\n            p11->next = t;\n            break;\n          }\n          if (t->age < at && t == head1) {\n\n            p11->next = head1;\n            head1 = p11;\n            break;\n          }\n        }\n        if (t == NULL) {\n          q->next = p11;\n          p11->next = NULL;\n        }\n      }\n    }\n\n    if (at < 60) {\n      if (head2 == NULL) {\n        head2 = (struct patient *)malloc(sizeof(struct patient));\n        strcpy(head2->id, id);\n        head2->age = at;\n        head2->next = NULL;\n        p22 = head2;\n      } else {\n        p21 = (struct patient *)malloc(sizeof(struct patient));\n        p21->age = at;\n        strcpy(p21->id, id);\n        p22->next = p21;\n        p21->next = NULL;\n        p22 = p21;\n      }\n    }\n  }\n  for (t = head1, q = t; t != NULL; q = t, t = t->next)\n    ;\n  q->next = head2;\n  for (t = head1; t->next != NULL; t = t->next)\n    printf(\"%s \", t->id);\n  printf(\"%s\", t->id);\n  return 0;\n}\n"}
{"label": "9", "index": "16766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], i = 0, a[100], b[100], p = 0, q = 0, m = 0;\n  char sz1[100][100], a1[100][100], b1[100][100], e[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", sz1[i], &sz[i]);\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      a[p] = sz[i];\n      strcpy(a1[p], sz1[i]);\n      p++;\n    }\n    if (sz[i] < 60) {\n      b[q] = sz[i];\n      strcpy(b1[q], sz1[i]);\n      q++;\n    }\n  }\n  for (i = 1; i < p; i++) {\n    for (m = 0; m < p - i; m++) {\n      if (a[m] < a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n        strcpy(e, a1[m]);\n        strcpy(a1[m], a1[m + 1]);\n        strcpy(a1[m + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", a1[i]);\n  for (m = 0; m < q; m++)\n    cout << (b1[m]) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  int d[100];\n  char c[100][10], e[10];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", c[i - 1], &d[i - 1]);\n  for (i = 1; i <= n - 1; i++) {\n    for (k = n; k >= i + 1; k--) {\n      if (d[k - 1] > d[k - 2] && d[k - 1] >= 60) {\n        t = d[k - 2];\n        d[k - 2] = d[k - 1];\n        d[k - 1] = t;\n        strcpy(e, c[k - 2]);\n        strcpy(c[k - 2], c[k - 1]);\n        strcpy(c[k - 1], e);\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    printf(\"%s \", c[i - 1]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t;\n  int i, j = 0, k, max;\n  int age[100];\n  int age2[100];\n  char string[100][11];\n  int line[100];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> string[i] >> age[i];\n  for (i = 0; i <= n - 1; i++) {\n    if (age[i] >= 60) {\n      age2[j] = age[i];\n      age[i] = 0;\n      line[j] = i;\n      j = j + 1;\n      k = j;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    max = 0;\n    t = 0;\n    for (j = 0; j <= k - 1; j++) {\n      if (max < age2[j]) {\n        max = age2[j];\n        t = j;\n      }\n    }\n    printf(\"%s\\n\", string[line[t]]);\n    age2[t] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid paixu(struct patient pat[], int n) {\n\n  struct patient t;\n  int i;\n  int k;\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (pat[i].age < pat[i + 1].age) {\n        t = pat[i];\n        pat[i] = pat[i + 1];\n        pat[i + 1] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  struct patient pat;\n  struct patient oldpat[100];\n  struct patient youngpat[100];\n\n  int n;\n  int i;\n  int m = 0;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat.ID, &pat.age);\n    if (pat.age >= 60) {\n      oldpat[m] = pat;\n      m++;\n    } else {\n      youngpat[k] = pat;\n      k++;\n    }\n  }\n\n  paixu(oldpat, m);\n\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", oldpat[i].ID);\n  }\n  for (i = 0; i < k; i++) {\n    cout << youngpat[i].ID << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[100], j = 0, c[100], z, r;\n  char s[100][10], b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n    if (a[i] >= 60) {\n      c[j] = a[i];\n      strcpy(b[j], s[i]);\n      j++;\n    }\n  }\n  for (z = j - 1; z > 0; z--) {\n    for (r = 0; r < z; r++) {\n      if (c[r] < c[r + 1]) {\n        int tep;\n        char m[10];\n        tep = c[r + 1];\n        c[r + 1] = c[r];\n        c[r] = tep;\n        strcpy(m, b[r]);\n        strcpy(b[r], b[r + 1]);\n        strcpy(b[r + 1], m);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16771", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct p {\n  char i[10];\n  int a;\n  struct p *next;\n};\nint main() {\n  struct p *p1, *p2, *head, *head2, *q1, *q2;\n  int n, i, k = 0, b = 0, x = 0;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct p *)malloc(1000);\n  scanf(\"%s %d\", p1->i, &p1->a);\n  for (i = 0; i < n; i++) {\n    k++;\n    if (k == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct p *)malloc(1000);\n    scanf(\"%s %d\", p1->i, &p1->a);\n  }\n  p2->next = NULL;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60)\n      x++;\n  k = 0;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a >= 60 && p1->a > b) {\n      b = p1->a;\n      p2 = p1;\n    }\n  q1 = q2 = (struct p *)malloc(1000);\n  strcpy(q1->i, p2->i);\n  q1->a = p2->a;\n  p2->a = 0;\n  for (i = 0; i < x - 1; i++) {\n    k++;\n    if (k == 1)\n      head2 = q1;\n    else\n      q2->next = q1;\n    q2 = q1;\n    b = 0;\n    for (p1 = head; p1 != NULL; p1 = p1->next)\n      if (p1->a >= 60 && p1->a > b) {\n        b = p1->a;\n        p2 = p1;\n      }\n    q1 = (struct p *)malloc(1000);\n    strcpy(q1->i, p2->i);\n    q1->a = p2->a;\n    p2->a = 0;\n  }\n  q2->next = q1;\n  q2 = q1;\n\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if (p1->a > 0) {\n      q1 = (struct p *)malloc(1000);\n      strcpy(q1->i, p1->i);\n      q1->a = p1->a;\n      p1->a = 0;\n      q2->next = q1;\n      q2 = q1;\n    }\n  q2->next = NULL;\n  for (q1 = head2; q1 != NULL; q1 = q1->next)\n    printf(\"%s \", q1->i);\n}\n"}
{"label": "9", "index": "16772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age[100], a[100], j = 0, k, l, temp, ord[100], o[100];\n  char num[100][10], old[100][10], t[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &age[i]);\n  for (i = 0; i < n; i++)\n    ord[i] = i;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[j] = age[i];\n      o[j] = ord[j];\n      strcpy(old[j], num[i]);\n      j++;\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] < a[l]) {\n        temp = a[k];\n        a[k] = a[l];\n        a[l] = temp;\n        temp = o[k];\n        o[k] = o[l];\n        o[l] = temp;\n        strcpy(t, old[k]);\n        strcpy(old[k], old[l]);\n        strcpy(old[l], t);\n      }\n    }\n  }\n  for (k = 0; k < j; k++) {\n    for (l = k + 1; l < j; l++) {\n      if (a[k] == a[l]) {\n        if (o[k] > o[l]) {\n          temp = a[k];\n          a[k] = a[l];\n          a[l] = temp;\n          temp = o[k];\n          o[k] = o[l];\n          o[l] = temp;\n          strcpy(t, old[k]);\n          strcpy(old[k], old[l]);\n          strcpy(old[l], t);\n        }\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << old[i] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int age;\n  int order;\n  struct stu *next;\n};\nint main() {\n  struct stu *p, *q, *t, *r, *head;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  head = (struct stu *)malloc(1000);\n  q = head;\n  for (i = 0; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d\", p->name, &p->age);\n    p->order = i;\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n  for (i = 0; i < n - 1; i++)\n    for (p = head, j = 0; j < n - 1 - i; j++, p = p->next) {\n      q = p->next;\n      t = q->next;\n      if ((q->age == t->age && q->order > t->order) ||\n          (q->age < 60 && t->age < q->age && q->order > t->order) ||\n          (t->age < 60 && t->age > q->age && q->order > t->order) ||\n          (t->age >= 60 && t->age > q->age)) {\n        r = t->next;\n        t->next = q;\n        p->next = t;\n        q->next = r;\n      }\n    }\n  p = head->next;\n  while (p != NULL) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16774", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, m, j, k;\n  scanf(\"%d\", &n);\n  struct br {\n    char x[10];\n    int y;\n  } * b, c[100], e;\n  b = (struct br *)malloc(sizeof(struct br) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i].x, &(b[i].y));\n  }\n  for (i = 0, m = 0; i < n; i++) {\n    if (b[i].y >= 60) {\n      c[m] = b[i];\n      m++;\n      b[i].y = -1;\n    }\n    for (k = 0; k < m; k++) {\n      for (j = m - 1; j > k; j--) {\n        if (c[j].y > c[j - 1].y) {\n          e = c[j];\n          c[j] = c[j - 1];\n          c[j - 1] = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", c[i].x);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i].y != -1) {\n      printf(\"%s\\n\", b[i].x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16775", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char id[30];\n  int age;\n  int num;\n  int flag;\n  struct pat *next;\n  struct pat *ns;\n};\n\nint n;\n\nvoid sort(struct pat *head) {\n  int i, j;\n  struct pat *q, *p, *max;\n  q = head;\n\n  for (i = 0; i < n; i++) {\n    p = head->next;\n    while (1) {\n      if (p->flag)\n        break;\n      p = p->next;\n    }\n    max = p;\n    while (1) {\n      if ((p->num) > (max->num) && p->flag)\n        max = p;\n      p = p->next;\n      if (p == NULL)\n        break;\n    }\n    max->flag = 0;\n    q->ns = max;\n    q = q->ns;\n  }\n  q->ns = NULL;\n}\n\nint main() {\n  int i;\n  struct pat *head, *p1, *p2, *p;\n  cin >> n;\n  head = (struct pat *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->flag = 1;\n    if (p1->age >= 60)\n      p1->num = 10000 * p1->age + n - i;\n    else\n      p1->num = n - i;\n    if (i == 0) {\n      head->next = p1;\n      p2 = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  sort(head);\n\n  p = head->ns;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->ns;\n  }\n}\n"}
{"label": "9", "index": "16776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, n = 0, k = 0, i = 0;\n\n  struct man {\n    int number;\n    char name[10];\n  } m[100], p[100], s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", m[i].name, &m[i].number);\n  for (i = 0; i < n; i++)\n    if (m[i].number >= 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (a = k - 1; a > 0; a--) {\n    for (b = 0; b < a; b++)\n      if (p[b].number < p[b + 1].number) {\n        s = p[b + 1];\n        p[b + 1] = p[b];\n        p[b] = s;\n      }\n  }\n  for (i = 0; i < n; i++)\n    if (m[i].number < 60) {\n      p[k] = m[i];\n      k++;\n    }\n  for (i = 0; i < k; i++)\n    cout << p[i].name << \"\\n\";\n}\n"}
{"label": "9", "index": "16777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  char id[100][10];\n  int old[100];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", id[i]);\n    scanf(\"%d\", &old[i]);\n  }\n\n  int e;\n  char s[100][10];\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < n - j; k++) {\n      if (old[k] < old[k + 1] && old[k + 1] >= 60) {\n        e = old[k + 1];\n        old[k + 1] = old[k];\n        old[k] = e;\n        strcpy(s[k], id[k + 1]);\n        strcpy(id[k + 1], id[k]);\n        strcpy(id[k], s[k]);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, age[1000 + 10], num[1000 + 10];\n  char id[1000 + 10][1000 + 1] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &age[i]);\n    num[i] = i;\n  }\n  int flag, tempnum, tempage, j;\n  char tempid[1000 + 1];\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      flag = 0;\n      if (age[j] >= 60 && age[j - 1] < 60)\n        flag = 1;\n      else if (age[j] >= 60 && age[j - 1] >= 60) {\n        if (age[j] > age[j - 1])\n          flag = 1;\n        else if (age[j] == age[j - 1]) {\n          if (num[j] < num[j - 1])\n            flag = 1;\n        }\n      } else if (age[j] < 60 && age[j - 1] < 60) {\n        if (num[j] < num[j - 1])\n          flag = 1;\n      }\n      if (flag) {\n        tempnum = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = tempnum;\n        tempage = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = tempage;\n        strcpy(tempid, id[j]);\n        strcpy(id[j], id[j - 1]);\n        strcpy(id[j - 1], tempid);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16779", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, l;\n  int age[10000];\n  char ID[10000][10], order[10000][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> ID[i] >> age[i];\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 1; j < n - i; j++) {\n      if (age[j] >= 60 && age[j] > age[m])\n        m = j;\n    }\n    for (j = 0; j < 10; j++) {\n      order[i][j] = ID[m][j];\n    }\n    for (j = m; j < n; j++) {\n      for (k = 0; k < 10; k++) {\n        ID[j][k] = ID[j + 1][k];\n      }\n      age[j] = age[j + 1];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    puts(order[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[11];\n  int age;\n} pa[100];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pa[i].ID >> pa[i].age;\n  }\n  struct patient old[100];\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      strcpy(old[count].ID, pa[i].ID);\n      old[count].age = pa[i].age;\n      count++;\n      pa[i].age = 0;\n    }\n  }\n  int k, j, e;\n  char ex[11];\n  for (k = 1; k < count; k++) {\n    for (j = 0; j < count - k; j++) {\n      if (old[j].age < old[j + 1].age) {\n        e = old[j + 1].age;\n        old[j + 1].age = old[j].age;\n        old[j].age = e;\n        strcpy(ex, old[j].ID);\n        strcpy(old[j].ID, old[j + 1].ID);\n        strcpy(old[j + 1].ID, ex);\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    printf(\"%s\\n\", old[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age != 0) {\n      cout << pa[i].ID << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct patient {\n  char ID[11];\n  int age;\n} p[1000];\n\nint main() {\n  int n, i, k, j, l, a = 0, b = 0, e;\n  int sz1[1000], sz2[1000];\n  char zfc1[1000][11], zfc2[1000][11], f[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &p[i].ID);\n    scanf(\" %d\", &p[i].age);\n  }\n  for (i = 0, j = 0, l = 0; i < n; i++) {\n    if (p[i].age >= 60) {\n      a++;\n      sz1[j] = p[i].age;\n      strcpy(zfc1[j], p[i].ID);\n      j++;\n    } else {\n      b++;\n      sz2[l] = p[i].age;\n      strcpy(zfc2[l], p[i].ID);\n      l++;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (j = n - 1; j >= k; j--) {\n      if (sz1[j + 1] > sz1[j]) {\n        e = sz1[j];\n        sz1[j] = sz1[j + 1];\n        sz1[j + 1] = e;\n        strcpy(f, zfc1[j]);\n        strcpy(zfc1[j], zfc1[j + 1]);\n        strcpy(zfc1[j + 1], f);\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", zfc1[j]);\n  }\n  for (l = 0; l < b; l++) {\n    printf(\"%s\\n\", zfc2[l]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int age;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *age;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  age = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).age);\n    if ((*(s + i)).age >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(age + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if ((*(o + j)).age > (*(o + j - 1)).age) {\n        t = *(o + j);\n        *(o + j) = *(o + j - 1);\n        *(o + j - 1) = t;\n      }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(age + i)).id);\n}\n"}
{"label": "9", "index": "16783", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct kb {\n  char ID[10];\n  int nl;\n} kbr[100], lnr[100], ln;\n\nint main() {\n  int n, i, k = 0, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> kbr[i].ID >> kbr[i].nl;\n  }\n  for (i = 0; i < n; i++) {\n    if (kbr[i].nl >= 60) {\n      strcpy(lnr[k].ID, kbr[i].ID);\n      lnr[k].nl = kbr[i].nl;\n      k++;\n      strcpy(kbr[i].ID, \"000000000\");\n    }\n  }\n  for (i = 1; i < k; i++) {\n    for (l = 0; l < k - i; l++) {\n      if (lnr[l].nl < lnr[l + 1].nl) {\n        ln = lnr[l + 1];\n        lnr[l + 1] = lnr[l];\n        lnr[l] = ln;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", lnr[i].ID);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(kbr[i].ID, \"000000000\") == 1) {\n      printf(\"%s\\n\", kbr[i].ID);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } pa[100] = {0}, old[100] = {0}, young[100] = {0}, t;\n  int i, j, k = 0, l = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pa[i].id, &pa[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      old[k] = pa[i];\n      k++;\n    } else {\n      young[l] = pa[i];\n      l++;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        t = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n}\n"}
{"label": "9", "index": "16785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char num[10];\n  int age;\n} p[105], t, a[105];\nint main() {\n  int i, k, n, c, d;\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i + k < n;) {\n    cin >> p[i].num >> p[i].age;\n    if (p[i].age >= 60) {\n      a[k] = p[i];\n      k++;\n    } else\n      i++;\n  }\n  for (c = 0; c < k - 1; c++) {\n    for (d = 0; d < k - 1; d++) {\n      if (a[d].age < a[d + 1].age) {\n        t = a[d];\n        a[d] = a[d + 1];\n        a[d + 1] = t;\n      }\n    }\n  }\n\n  if (k >= 0) {\n    k--;\n    for (c = 0; c <= k; c++)\n      printf(\"%s\\n\", a[c].num);\n  }\n  if (i >= 0) {\n    i--;\n    for (d = 0; d <= i; d++)\n      printf(\"%s\\n\", p[d].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct pa {\n    char m[10];\n    int a;\n  };\n  struct pa p[100], t, s = {\"0\", 0}, pp[100];\n  int n, i, j = 0, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &p[i].m, &p[i].a);\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60)\n      m++;\n  }\n  for (j = 0; j < m; j++) {\n    t = s;\n    k = 100;\n    for (i = 0; i < n; i++) {\n      if (p[i].a >= 60 && p[i].a > t.a) {\n        t = p[i];\n        k = i;\n      }\n    }\n    pp[j] = t;\n    p[k] = s;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].a < 60 && p[i].a > 0) {\n      pp[j] = p[i];\n      j++;\n    }\n\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pp[i].m);\n}\n"}
{"label": "9", "index": "16787", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int year;\n} pat[100];\nint arrange(struct patient peop[], int num);\n\nint main() {\n  int i, j = 0, k, n, max;\n  struct patient *ppat[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pat[i].id, &pat[i].year);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year >= 60) {\n      ppat[j] = pat + i;\n      j++;\n    }\n  }\n\n  struct patient *p;\n  for (i = 0; i < j - 1; i++) {\n    for (k = 0; k < j - 1 - i; k++) {\n      if ((*ppat[k]).year < (*ppat[k + 1]).year) {\n        p = ppat[k];\n        ppat[k] = ppat[k + 1];\n        ppat[k + 1] = p;\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", ppat[i]->id);\n  for (i = 0; i < n; i++) {\n    if (pat[i].year < 60)\n      printf(\"%s\\n\", pat[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, age[100], i, j;\n  char id[100][10];\n  scanf(\"%d\", &n);\n  int k = 0;\n  char shuchu[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &age[i]);\n    if (age[i] < 60)\n      strcpy(shuchu[k++], id[i]);\n  }\n  char mid[100][10];\n  int t;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (age[j] < age[j + 1]) {\n        t = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = t;\n        strcpy(mid[j], id[j]);\n        strcpy(id[j], id[j + 1]);\n        strcpy(id[j + 1], mid[j]);\n      }\n    }\n  }\n  if (age[0] < 60)\n    goto E;\n  else {\n    for (i = 0; age[i] >= 60; i++)\n      cout << id[i] << \"\\n\";\n  }\nE:;\n  for (i = 0; i < k; i++)\n    cout << shuchu[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct fy {\n    char a[12];\n    int k;\n    int s;\n    struct fy *p;\n  } x[100], *head;\n  int n, i, j, l, kk, ss;\n  char aa[12];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[i].a, &x[i].k);\n    x[i].s = x[i].k >= 60 ? 1 : 0;\n    x[i].p = &x[i + 1];\n  }\n  head = &x[0];\n  x[n - 1].p = NULL;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (x[i].s == 1 && x[j].s == 1) {\n        if (x[i].k < x[j].k) {\n          kk = x[j].k;\n          ss = x[j].s;\n          strcpy(aa, x[j].a);\n          for (l = j; l > i; l--) {\n            x[l].k = x[l - 1].k;\n            x[l].s = x[l - 1].s;\n            strcpy(x[l].a, x[l - 1].a);\n          }\n          x[i].k = kk;\n          x[i].s = ss;\n          strcpy(x[i].a, aa);\n        }\n      }\n    }\n    if (x[i].s == 1)\n      cout << x[i].a << \"\\n\";\n  }\n  while (head != NULL) {\n    if (head->s == 0)\n      printf(\"%s\\n\", head->a);\n    head = head->p;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  struct {\n    char hao[10];\n    int ni;\n    int pa;\n  } dk[100], t, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(dk[i].hao), &(dk[i].ni));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if ((dk[j].ni < 60) && (dk[j + 1].ni >= 60)) {\n        t = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((dk[j + 1].ni >= 60) && (dk[j].ni >= 60) &&\n          (dk[j].ni < dk[j + 1].ni)) {\n        p = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = p;\n      }\n    }\n  }\n  b = strlen(dk[0].hao);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < b; j++) {\n      printf(\"%c\", dk[i].hao[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16791", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } a[100], m, k;\n  int i, j, n, num = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      num++;\n      m = a[i];\n      for (j = i; j > 0; j--)\n        a[j] = a[j - 1];\n      a[0] = m;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = i + 1; j < num; j++) {\n      if (a[i].age <= a[j].age) {\n        k = a[i];\n        a[i] = a[j];\n        a[j] = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[100][100];\n  int age[100];\n  int age1[100];\n  int a[100];\n  int max, n, l, i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", string[i], &age[i]);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      age1[j] = age[i];\n      age[i] = 0;\n      a[j] = i;\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    max = 0;\n    x = 0;\n    for (k = 0; k < j; k++) {\n      if (max < age1[k]) {\n        max = age1[k];\n        x = k;\n      }\n    }\n    printf(\"%s\\n\", string[a[x]]);\n    age1[x] = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (age[i] != 0)\n      printf(\"%s\\n\", string[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16793", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, j, i, age, m, y;\n  int b[1000];\n  char B[1000][100], C[1000][100], d[1000][100];\n  char a[1000];\n  scanf(\"%d\", &n);\n  y = 0;\n  k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a >> age;\n    if (age < 60) {\n      strcpy(B[y], a);\n      y++;\n    } else {\n      strcpy(C[k], a);\n      b[k] = age;\n      k++;\n    }\n  }\n  int x = 0;\n  for (i = 200; i >= 60; i--) {\n    for (j = 0; j <= k - 1; j++) {\n      if (i == b[j]) {\n        strcpy(d[x], C[j]);\n        x++;\n      }\n    }\n  }\n\n  for (i = 0; i <= k - 1; i++)\n    puts(d[i]);\n  for (i = 0; i <= n - k - 1; i++)\n    puts(B[i]);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n} pat[100], str[100], t;\nint main() {\n\n  int n, i, j, a = -1, temp;\n  int ch[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].num, &pat[i].age);\n    if (pat[i].age >= 60) {\n      a++;\n      strcpy(str[a].num, pat[i].num);\n      str[a].age = pat[i].age;\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = 0; j < i; j++) {\n      if (str[j].age < str[j + 1].age) {\n        t = str[j];\n        str[j] = str[j + 1];\n        str[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      a++;\n      str[a] = pat[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", str[i].num);\n  }\n}\n"}
{"label": "9", "index": "16795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char s[100][11], z[11];\n  int g[100], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++) {\n      if (g[j - 1] < g[j] && g[j] >= 60) {\n        strcpy(z, s[j - 1]);\n        strcpy(s[j - 1], s[j]);\n        strcpy(s[j], z);\n        c = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = c;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << s[i] << \"\\n\";\n  }\n  if (i == n - 1) {\n    printf(\"%s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16796", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct f {\n  char id[10];\n  int old;\n} st[1000], stu[1000], temp;\nint main() {\n  int n, i, j, a, b, c;\n  char cc, aa, x[1000], y[1000];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s%c%d%c\", st[i].id, &aa, &st[i].old, &cc);\n  }\n  a = 0;\n  for (j = 1; j <= n; j++) {\n    if (st[j].old >= 60) {\n      a++;\n      stu[a] = st[j];\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = 1; j <= i; j++) {\n      if (stu[j].old < stu[j + 1].old) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    puts(stu[i].id);\n  }\n  for (i = 1; i <= n; i++) {\n    if (st[i].old < 60)\n      puts(st[i].id);\n  }\n}\n"}
{"label": "9", "index": "16797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bin {\n  char num[10];\n  int age;\n} t, b[100], c[100], a[100];\nint main() {\n  int n, i, j = 0, k = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", a[i].num, &a[i].age);\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n    p = j;\n    if (a[i].age < 60) {\n      c[k] = a[i];\n      k++;\n    }\n    q = k;\n  }\n  for (j = 1; j < p; j++)\n    for (i = 0; i < p - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n      }\n    }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", b[i].num);\n  for (i = 0; i < q; i++)\n    cout << c[i].num << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct ren {\n  char id[12];\n  int ye;\n  struct ren *next;\n};\nint main() {\n  int n;\n  char c[12];\n  int y;\n  int r;\n  struct ren *p1, *p2, *head;\n  int i;\n  scanf(\"%d\", &n);\n  head = (struct ren *)malloc(sizeof(struct ren));\n  scanf(\"%s %d\", c, &y);\n  strcpy(head->id, c);\n  head->ye = y;\n  head->next = 0;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%s %d\", c, &y);\n    p1 = (struct ren *)malloc(sizeof(struct ren));\n    strcpy(p1->id, c);\n    p1->ye = y;\n    p1->next = 0;\n    if (y < 60) {\n      p2 = head;\n      while (p2->next != 0)\n        p2 = p2->next;\n      p2->next = p1;\n    } else {\n      p2 = head;\n      if (y > p2->ye) {\n        p1->next = head;\n        head = p1;\n      } else {\n        r = 0;\n        while (p2->next != 0) {\n          if (p2->ye >= y && p2->next->ye < y) {\n            r = 1;\n            p1->next = p2->next;\n            p2->next = p1;\n            break;\n          }\n          p2 = p2->next;\n        }\n        if (r == 0)\n          p2->next = p1;\n      }\n    }\n  }\n  p1 = head;\n  do {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  } while (p1 != 0);\n  return 0;\n}\n"}
{"label": "9", "index": "16799", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num;\n  scanf(\"%d\", &num);\n  p2 = NULL;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  while (num > 0) {\n    p2 = p1;\n    cin >> p1->ID >> p1->age;\n    p1 = (struct patient *)malloc(1000);\n    p2->next = p1;\n    num--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct patient *sort(struct patient *head) {\n  struct patient *first;\n  struct patient *tail;\n  struct patient *p_max;\n  struct patient *max;\n  struct patient *p;\n  first = NULL;\n  while (head != NULL) {\n    for (p = head, max = head; p->next != NULL; p = p->next) {\n      if (p->next->age > max->age && p->next->age >= 60) {\n        p_max = p;\n        max = p->next;\n      }\n    }\n    if (first == NULL) {\n      first = max;\n      tail = max;\n    } else {\n      tail->next = max;\n      tail = max;\n    }\n    if (max == head) {\n      head = head->next;\n    } else {\n      p_max->next = max->next;\n    }\n  }\n  if (first != NULL) {\n    tail->next = NULL;\n  }\n  head = first;\n  return head;\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  int n, i, j;\n  head = creat();\n  head = sort(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int a;\n  } p[100], pr;\n  int np, i, k;\n  scanf(\"%d\", &np);\n  for (i = 0; i < np; i++) {\n    scanf(\"%s %d\", p[i].ID, &p[i].a);\n  }\n  for (i = 0; i < np; i++) {\n    for (k = np - 1; k > i; k--) {\n      if (p[k].a > p[k - 1].a && p[k].a >= 60) {\n        pr = p[k];\n        p[k] = p[k - 1];\n        p[k - 1] = pr;\n      }\n    }\n    printf(\"%s\\n\", p[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct P {\n  char id[10];\n  int age;\n} pa[100];\nstruct P pb[100];\nint main() {\n  int n, r = 0, s = 0, i, o, p, j, k;\n  scanf(\"%d\", &n);\n  struct P temp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", temp.id, &(temp.age));\n    if (temp.age >= 60) {\n      pb[r] = temp;\n      r++;\n    } else {\n      pa[s] = temp;\n      s++;\n    }\n  }\n  for (o = 0; o < r; o++) {\n    for (p = 0; p < r - o; p++) {\n      if (pb[p].age < pb[p + 1].age) {\n        struct P tmp = pb[p];\n        pb[p] = pb[p + 1];\n        pb[p + 1] = tmp;\n      }\n    }\n  }\n  for (j = 0; j < r; j++) {\n    printf(\"%s\\n\", pb[j].id);\n  }\n  for (k = 0; k < s; k++) {\n    printf(\"%s\\n\", pa[k].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct p {\n    char num[100];\n    int age;\n  } p[101];\n  int n, i, j, k, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%s %d\", &p[i].num, &p[i].age);\n  struct q {\n    char num[100];\n    int age;\n  } q[101];\n  for (i = 1, j = 1; i <= n; i++) {\n    if (p[i].age >= 60) {\n      strcpy(q[j].num, p[i].num);\n      q[j].age = p[i].age;\n      j++;\n      m = m + 1;\n    }\n  }\n  for (j = 1; j <= m; j++) {\n    for (i = 1; i <= m - 1; i++) {\n      if (q[i].age < q[i + 1].age) {\n        q[101] = q[i];\n        q[i] = q[i + 1];\n        q[i + 1] = q[101];\n      }\n    }\n  }\n  cout << q[1].num;\n  for (i = 2; i <= m; i++)\n    printf(\" %s\", q[i].num);\n  for (i = 1; i <= n; i++)\n    if (p[i].age < 60)\n      printf(\" %s\", p[i].num);\n}\n"}
{"label": "9", "index": "16803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], i, num = 0, m[100], j;\n  char c[100][10];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      for (j = 0; j < n; j++) {\n        if (a[i] >= a[j]) {\n          num = num + 1;\n        }\n      }\n      m[i] = num;\n      num = 0;\n    }\n  }\n\n  for (j = n; j > 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 60) {\n        if (m[i] == j)\n          cout << c[i] << \"\\n\";\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      cout << c[i] << \"\\n\";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i, j, lao = 0, you = 0, t;\n  char e[100][10], f[100][10], g[100][10], s[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", e[i], &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 60) {\n      b[lao] = a[i];\n      strcpy(f[lao], e[i]);\n      lao++;\n    } else {\n      c[you] = a[i];\n      strcpy(g[you], e[i]);\n      you++;\n    }\n  }\n  for (j = 0; j < lao - 1; j++) {\n    for (i = 0; i < lao - 1; i++) {\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(s, f[i]);\n        strcpy(f[i], f[i + 1]);\n        strcpy(f[i + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < lao; i++)\n    printf(\"%s\\n\", f[i]);\n  for (i = 0; i < you; i++)\n    printf(\"%s\\n\", g[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16805", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  char id[10];\n  int age;\n  struct person *next;\n};\nint main() {\n  int n, i, j;\n  struct person *head, *ppre, *pnew, *p;\n  scanf(\"%d\", &n);\n  pnew = (struct person *)malloc(1000);\n  scanf(\"%s %d \", pnew->id, &pnew->age);\n  pnew->next = NULL;\n  head = pnew;\n  for (i = 2; i <= n; i++) {\n    p = head;\n    ppre = head;\n    pnew = (struct person *)malloc(1000);\n    cin >> pnew->id >> pnew->age;\n    pnew->next = NULL;\n    if ((pnew->age >= 60) && (pnew->age > head->age)) {\n      pnew->next = head;\n      head = pnew;\n    } else {\n      if (pnew->age >= 60) {\n        p = p->next;\n        for (j = 2; j < i; j++) {\n          if (pnew->age > p->age) {\n            pnew->next = p;\n            ppre->next = pnew;\n            break;\n          }\n          p = p->next;\n          ppre = ppre->next;\n        }\n        if (pnew->next == NULL)\n          ppre->next = pnew;\n      } else {\n        while (p->next != NULL)\n          p = p->next;\n        p->next = pnew;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  int turn;\n} pat[100], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pat[i].id, &pat[i].age);\n    pat[i].turn = i;\n  }\n  for (i = 0; i < n; i++)\n    if (pat[i].age < 60) {\n      j = i + 1;\n      while ((pat[j].age < 60) && (j < n))\n        j++;\n      if (pat[j].age >= 60) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n    }\n  for (i = 0; (pat[i].age >= 60) && (i < n); i++)\n    for (j = i + 1; j < n; j++)\n      if ((pat[j].age > pat[i].age) ||\n          ((pat[i].age == pat[j].age) && (pat[j].turn < pat[i].turn))) {\n        temp = pat[i];\n        pat[i] = pat[j];\n        pat[j] = temp;\n      }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age < 60) {\n      for (j = i + 1; j < n; j++)\n        if (pat[i].turn > pat[j].turn) {\n          temp = pat[i];\n          pat[i] = pat[j];\n          pat[j] = temp;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].id);\n}\n"}
{"label": "9", "index": "16807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  char t[10];\n  scanf(\"%d\", &n);\n  int y[n];\n  char id[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", id[i], &y[i]);\n  for (i = 1; i < n; i++) {\n    if (y[i] >= 60) {\n      for (j = i; j > 0; j--)\n        if (y[j - 1] < y[j]) {\n          temp = y[j];\n          y[j] = y[j - 1];\n          y[j - 1] = temp;\n          strcpy(t, id[j]);\n          strcpy(id[j], id[j - 1]);\n          strcpy(id[j - 1], t);\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n}\n"}
{"label": "9", "index": "16808", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  char bh[999][999];\n  int nl[999];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", bh[i], &nl[i]);\n  }\n  int pd[999], k = 0;\n  for (i = 1; i <= n; i++) {\n    if (nl[i] >= 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  int e;\n  for (i = 1; i < k; i++) {\n    for (j = 1; j <= k - i; j++) {\n      if (nl[pd[j]] < nl[pd[j + 1]]) {\n        e = pd[j + 1];\n        pd[j + 1] = pd[j];\n        pd[j] = e;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (nl[i] < 60) {\n      k++;\n      pd[k] = i;\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%s\\n\", bh[pd[i]]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16809", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int nj[1000];\n  int lr[1000], xr[1000];\n  char zfc[1000][20];\n  int i;\n  int m = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", zfc[i]);\n    scanf(\"%d\", &nj[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (nj[i] >= 60) {\n      lr[m] = i;\n      m++;\n    } else {\n      xr[k] = i;\n      k++;\n    }\n  }\n  int j;\n  if (m >= 2) {\n    for (i = 0; i < m - 1; i++) {\n      for (j = m - 1; j > i; j--) {\n        int e;\n        if (nj[lr[j]] > nj[lr[j - 1]]) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        } else if (nj[lr[j]] == nj[lr[j - 1]] && (lr[j] < lr[j - 1])) {\n\n          e = lr[j];\n          lr[j] = lr[j - 1];\n          lr[j - 1] = e;\n        }\n      }\n    }\n  }\n  if (m >= 1) {\n    for (i = 0; i < m; i++) {\n      printf(\"%s \", zfc[lr[i]]);\n    }\n  }\n  if (k > 0) {\n    for (i = 0; i < k; i++) {\n      printf(\"%s \", zfc[xr[i]]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char tmp[100];\n  int n, i, j = 0, o = 0, tmpn;\n  struct {\n    char num[100];\n    int a, k;\n  } s[1000], t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].num, &s[i].a);\n    if (s[i].a >= 60)\n      s[i].k = 1;\n    else\n      s[i].k = 0;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1) {\n      strcpy(t[j].num, s[i].num);\n      t[j].a = s[i].a;\n      j++;\n      o++;\n    }\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (t[j].a < t[j + 1].a) {\n        tmpn = t[j].a;\n        t[j].a = t[j + 1].a;\n        t[j + 1].a = tmpn;\n        strcpy(tmp, t[j].num);\n        strcpy(t[j].num, t[j + 1].num);\n        strcpy(t[j + 1].num, tmp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", t[i].num);\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1)\n      continue;\n    printf(\"%s\\n\", s[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0;\n  scanf(\"%d\", &n);\n  char **id = (char **)malloc(sizeof(char *) * n);\n  for (i = 0; i < n; i++) {\n    id[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int p = 0;\n  int *year = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &year[i]);\n    if (year[i] >= 60) {\n      p++;\n    }\n  }\n  char **idolder = (char **)malloc(sizeof(char *) * p);\n  for (i = 0; i < n; i++) {\n    idolder[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int *yearolder = (int *)malloc(sizeof(int) * p);\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      idolder[j] = id[i];\n      yearolder[j] = year[i];\n      j++;\n    }\n  }\n  int e;\n  char *id1 = (char *)malloc(sizeof(char) * 10);\n  for (i = 1; i <= p; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (yearolder[j + 1] > yearolder[j]) {\n        id1 = idolder[j];\n        idolder[j] = idolder[j + 1];\n        idolder[j + 1] = id1;\n        e = yearolder[j];\n        yearolder[j] = yearolder[j + 1];\n        yearolder[j + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", idolder[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16812", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> c[i] >> a[i];\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i <= q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, age[100], age1[100], t1, i, j, l1 = 0, l2 = 0;\n  char id[100][10], t2[10] = {\" \"}, a[100][10] = {\" \"}, b[100][10] = {\" \"};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &id[i], &age[i]);\n    if (age[i] >= 60) {\n      strcpy(a[l1], id[i]);\n      age1[l1] = age[i];\n      l1 += 1;\n    } else {\n      strcpy(b[l2], id[i]);\n      l2 += 1;\n    }\n  }\n  for (i = 1; i < l1; i++) {\n    for (j = 0; j < l1 - i; j++) {\n      if (age1[j] < age1[j + 1]) {\n        t1 = age1[j];\n        age1[j] = age1[j + 1];\n        age1[j + 1] = t1;\n        strcpy(t2, a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], t2);\n      }\n    }\n  }\n  for (i = 0; i < l1; i++)\n    printf(\"%s\\n\", a[i]);\n  for (j = 0; j < l2; j++)\n    printf(\"%s\\n\", b[j]);\n}\n"}
{"label": "9", "index": "16814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct staff {\n  char id[20];\n  int age;\n  struct staff *next;\n};\n\nint main() {\n  int n, k = 0, max = 59;\n  struct staff *head, *p, *q, *pre;\n  scanf(\"%d\", &n);\n  struct staff *p1, *p2;\n  p1 = (struct staff *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = p2 = p1;\n  if (p1->age >= 60) {\n    k++;\n  }\n  while (n - 1) {\n    n--;\n    p1 = (struct staff *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  while (k) {\n    p = head;\n    k--;\n    while (p) {\n      if (p->age > max) {\n        max = p->age;\n        q = p;\n      }\n      p = p->next;\n    }\n    printf(\"%s \", q->id);\n    if (q == head) {\n      head = q->next;\n      free(q);\n    } else {\n      if (q->next == NULL) {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            free(q);\n            pre->next = NULL;\n            break;\n          }\n        }\n      }\n\n      else {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            p = p->next;\n            pre->next = p;\n            free(q);\n            break;\n          }\n        }\n      }\n    }\n    max = 59;\n  }\n  p = head;\n  while (p) {\n    cout << p->id << \" \";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int age;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *age;\n  scanf(\"%d \", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  age = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).age);\n    if ((*(s + i)).age >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(age + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--)\n      if ((*(o + j)).age > (*(o + j - 1)).age) {\n        t = *(o + j);\n        *(o + j) = *(o + j - 1);\n        *(o + j - 1) = t;\n      }\n    cout << (*(o + i)).id << \"\\n\";\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(age + i)).id);\n}\n"}
{"label": "9", "index": "16816", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  struct {\n    char hao[10];\n    int ni;\n    int pa;\n  } dk[100], t, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(dk[i].hao), &(dk[i].ni));\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if ((dk[j].ni < 60) && (dk[j + 1].ni >= 60)) {\n        t = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((dk[j + 1].ni >= 60) && (dk[j].ni >= 60) &&\n          (dk[j].ni < dk[j + 1].ni)) {\n        p = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = p;\n      }\n    }\n  }\n  b = strlen(dk[0].hao);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < b; j++) {\n      printf(\"%c\", dk[i].hao[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16817", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, t;\n  int u = 0, k = 0;\n  int a[1000], b[1000];\n  char s[1000][10], h[1000][10], j[1000][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &s[i], &a[i]);\n    if (a[i] >= 60) {\n      b[u] = a[i];\n      strcpy(h[u], s[i]);\n      u++;\n    } else {\n      strcpy(j[k], s[i]);\n      k++;\n    }\n  }\n  for (i = u - 1; i > 0; i--) {\n    for (t = 0; t < i; t++) {\n      if (b[t] < b[t + 1]) {\n        int f;\n        f = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = f;\n        char tmp[10];\n        strcpy(tmp, h[t]);\n        strcpy(h[t], h[t + 1]);\n        strcpy(h[t + 1], tmp);\n      }\n    }\n  }\n  for (i = 0; i < u; i++)\n    printf(\"%s \", h[i]);\n  for (t = 0; t < k; t++) {\n    printf(\"%s \", j[t]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0;\n  scanf(\"%d\\n\", &n);\n  struct p {\n    char num[10000];\n    int age;\n  } p[100];\n  struct p1 {\n    char num1[10000];\n    int age1;\n  } p1[100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\\n\", p[i].num, &p[i].age);\n    if (p[i].age >= 60) {\n      strcpy(p1[m].num1, p[i].num);\n      p1[m].age1 = p[i].age;\n      m = m + 1;\n    }\n  }\n  int e;\n  char w[10000];\n  for (i = 1; i < m; i++) {\n    for (j = 0; j < m - i; j++) {\n      if (p1[j].age1 < p1[j + 1].age1) {\n        strcpy(w, p1[j + 1].num1);\n        strcpy(p1[j + 1].num1, p1[j].num1);\n        strcpy(p1[j].num1, w);\n        e = p1[j + 1].age1;\n        p1[j + 1].age1 = p1[j].age1;\n        p1[j].age1 = e;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    cout << p1[i].num1 << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16819", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][1000 + 1];\n  char g[100][1000 + 1];\n  int h[100];\n  int k[100], a, i, j;\n  char q[100];\n  int n, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &k[i]);\n  }\n  a = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (k[i] >= 60) {\n      a++;\n      h[j] = k[i];\n      strcpy(g[j], s[i]);\n      j++;\n      k[i] = 0;\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (h[j] < h[j + 1]) {\n        e = h[j];\n        h[j] = h[j + 1];\n        h[j + 1] = e;\n        strcpy(q, g[j]);\n        strcpy(g[j], g[j + 1]);\n        strcpy(g[j + 1], q);\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", g[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (k[i] != 0)\n      printf(\"%s \", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char num[11];\n  int age;\n} sick[101];\nint main() {\n  int n, i, j, k, r, s;\n  s = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", sick[i].num);\n    scanf(\"%d\", &sick[i].age);\n  }\n  int old[101] = {0};\n  int young[101] = {0};\n  for (i = 0; i < n; i++) {\n    if (sick[i].age >= 60) {\n      for (j = 0; j <= s; j++) {\n        if (sick[i].age > sick[old[j]].age || j == s) {\n          if (j == s) {\n            old[s] = i;\n            s = s + 1;\n            break;\n          } else {\n            for (k = s; k >= j; k--) {\n              old[k + 1] = old[k];\n            }\n            old[j] = i;\n            s = s + 1;\n            break;\n          }\n        }\n      }\n    } else {\n      young[r] = i;\n      r = r + 1;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    printf(\"%s\\n\", sick[old[i]].num);\n  }\n  for (i = 0; i < r; i++) {\n    cout << sick[young[i]].num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[150], tmp, j;\n  char s[150][20], ts[20];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", s[i]);\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++)\n    for (j = 1; j <= n - i; j++)\n      if (((a[j + 1] >= 60) && (a[j] < 60)) ||\n          ((a[j + 1] > a[j]) && (a[j] >= 60))) {\n        memcpy(ts, s[j], sizeof(ts));\n        memcpy(s[j], s[j + 1], sizeof(ts));\n        memcpy(s[j + 1], ts, sizeof(ts));\n        tmp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = tmp;\n      }\n  for (i = 1; i <= n; i++)\n    cout << s[i] << \"\\n\";\n}\n"}
{"label": "9", "index": "16822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Node;\ntypedef struct Node *pNode;\nstruct Node {\n  int x;\n  char id[20];\n  pNode next;\n};\n\npNode create() {\n  pNode p;\n  p = (pNode)malloc(sizeof(struct Node));\n  p->next = NULL;\n  return p;\n}\n\nvoid sort(pNode head, int n) {\n  pNode p = NULL, q = NULL, s = NULL;\n  int i;\n  for (i = 1; i <= n; i++) {\n    s = (pNode)malloc(sizeof(struct Node));\n    s->next = NULL;\n    scanf(\"%s %d\", &s->id, &s->x);\n    if (s->x < 60) {\n      p = head;\n      while (p->next)\n        p = p->next;\n      p->next = s;\n    } else {\n      q = head;\n      p = head->next;\n      while (p) {\n        if (p->x < s->x)\n          break;\n        q = p;\n        p = p->next;\n      }\n      q->next = s;\n      s->next = p;\n    }\n  }\n}\n\nvoid outputdata(pNode p) {\n  p = p->next;\n  while (p->next) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  cout << p->id << \"\\n\";\n}\n\nint main() {\n  pNode head;\n  int n;\n  head = create();\n  cin >> n;\n  sort(head, n);\n  outputdata(head);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct old {\n  char ID[10];\n  int age;\n};\nint main() {\n  struct old a[100], b[100], c[100];\n  int n, i, j, B = 0, C = 0, temp;\n  char TEMP[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &a[i].ID, &a[i].age);\n    if (a[i].age >= 60) {\n      strcpy(b[B].ID, a[i].ID);\n      b[B].age = a[i].age;\n      B++;\n    } else {\n      strcpy(c[C].ID, a[i].ID);\n      c[C].age = a[i].age;\n      C++;\n    }\n  }\n  for (i = B - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age ||\n          (b[j].age == b[j + 1].age &&\n           ((b[j].ID - '\\0') > (b[j + 1].ID - '\\0')))) {\n        temp = b[j + 1].age, b[j + 1].age = b[j].age, b[j].age = temp;\n        strcpy(TEMP, b[j + 1].ID), strcpy(b[j + 1].ID, b[j].ID),\n            strcpy(b[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = C - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((c[j].ID - '\\0') > (c[j + 1].ID - '\\0')) {\n        temp = c[j + 1].age, c[j + 1].age = c[j].age, c[j].age = temp;\n        strcpy(TEMP, c[j + 1].ID), strcpy(c[j + 1].ID, c[j].ID),\n            strcpy(c[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = 0; i < B; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < C; i++)\n    printf(\"%s\\n\", c[i].ID);\n}\n"}
{"label": "9", "index": "16824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  char id[20];\n  int age;\n};\nint main() {\n  int n, i, j, m = 0, k = 0, z;\n  struct person t, *s, *o, *age;\n  scanf(\"%d\", &n);\n  s = (struct person *)malloc(n * sizeof(struct person));\n  o = (struct person *)malloc(n * sizeof(struct person));\n  age = (struct person *)malloc(n * sizeof(struct person));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", (*(s + i)).id, &(*(s + i)).age);\n    if ((*(s + i)).age >= 60) {\n      *(o + k) = *(s + i);\n      k++;\n    } else {\n      *(age + m) = *(s + i);\n      m++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if ((*(o + j)).age > (*(o + j - 1)).age) {\n        t = *(o + j);\n        *(o + j) = *(o + j - 1);\n        *(o + j - 1) = t;\n      }\n    }\n    printf(\"%s\\n\", (*(o + i)).id);\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", (*(age + i)).id);\n  return 0;\n}\n"}
{"label": "9", "index": "16825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct a {\n  int year;\n  char id[10];\n  struct a *next;\n};\nstruct a *create(int n) {\n  struct a *p1, *p2, *head;\n  int i;\n  p1 = (struct a *)malloc(1000);\n  scanf(\"%s%d\", p1->id, &p1->year);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct a *)malloc(1000);\n    cin >> p1->id >> p1->year;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\nint main() {\n  struct a *head, *p, *q, *t[100];\n  int m, i, j = 0, k;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  for (i = 0; i < m; i++) {\n    if (p->year >= 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (k = 0; k < j - 1; k++)\n    for (i = 0; i < j - 1 - k; i++)\n      if (t[i]->year < t[i + 1]->year) {\n        p = t[i];\n        t[i] = t[i + 1];\n        t[i + 1] = p;\n      }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n  p = head;\n  j = 0;\n  for (i = 0; i < m; i++) {\n    if (p->year < 60) {\n      t[j] = p;\n      j++;\n    }\n    p = p->next;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", t[i]->id);\n}\n"}
{"label": "9", "index": "16826", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n} pa[101], que[101], tran;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, old = 0;\n  scanf(\"%d \", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> pa[i].id >> pa[i].age;\n    if (pa[i].age >= 60) {\n      que[j] = pa[i];\n      old += 1;\n      j++;\n    }\n  }\n  for (i = 1; i <= old - 1; i++) {\n    for (j = 1; j <= old - i; j++) {\n      if (que[j].age < que[j + 1].age) {\n        tran = que[j];\n        que[j] = que[j + 1];\n        que[j + 1] = tran;\n      }\n    }\n  }\n  j = old + 1;\n  for (i = 1; i <= n; i++) {\n    if (pa[i].age < 60) {\n      que[j] = pa[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%s\\n\", que[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100], i = 0, a[100], b[100], p = 0, q = 0, m = 0;\n  char sz1[100][100], a1[100][100], b1[100][100], e[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> sz1[i] >> sz[i];\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      a[p] = sz[i];\n      strcpy(a1[p], sz1[i]);\n      p++;\n    }\n    if (sz[i] < 60) {\n      b[q] = sz[i];\n      strcpy(b1[q], sz1[i]);\n      q++;\n    }\n  }\n  for (i = 1; i < p; i++) {\n    for (m = 0; m < p - i; m++) {\n      if (a[m] < a[m + 1]) {\n        int t = a[m];\n        a[m] = a[m + 1];\n        a[m + 1] = t;\n        strcpy(e, a1[m]);\n        strcpy(a1[m], a1[m + 1]);\n        strcpy(a1[m + 1], e);\n      }\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", a1[i]);\n  for (m = 0; m < q; m++)\n    cout << (b1[m]) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[10];\n    int age;\n  };\n  struct patient pat[100];\n  int n, i, j, huan;\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].ID, &pat[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      for (j = i; j > 0; j--) {\n        if (pat[j].age > pat[j - 1].age) {\n          huan = pat[j].age;\n          pat[j].age = pat[j - 1].age;\n          pat[j - 1].age = huan;\n          strcpy(string, pat[j].ID);\n          strcpy(pat[j].ID, pat[j - 1].ID);\n          strcpy(pat[j - 1].ID, string);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", pat[i].ID);\n}\n"}
{"label": "9", "index": "16829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char num[11];\n    int age;\n  } pat[101], t;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> pat[i].num >> pat[i].age;\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((pat[j].age < 60 && pat[j + 1].age >= 60) ||\n          (pat[j].age >= 60 && pat[j + 1].age > pat[j].age)) {\n        t = pat[j];\n        pat[j] = pat[j + 1];\n        pat[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", pat[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, h, g, m, i, j;\n  int max[100];\n  char s[100][10];\n  struct {\n    char d[10];\n    int a;\n  } p[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].d, &p[i].a);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i].a >= 60) {\n      m++;\n    }\n  }\n  k = m;\n  for (i = 0; i < n; i++) {\n    if (p[i].a < 60) {\n      strcpy(s[k], p[i].d);\n      k = k + 1;\n    }\n  }\n  g = 0;\n  for (j = 0; j < m; j++) {\n    max[j] = 59;\n    for (i = 0; i < n; i++) {\n      if (p[i].a > max[j]) {\n        max[j] = p[i].a;\n        h = i;\n      }\n    }\n    p[h].a = 59;\n    strcpy(s[g], p[h].d);\n    g++;\n  }\n  for (i = 0; i < n; i++) {\n    cout << s[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j = 0;\n  scanf(\"%d\", &n);\n  char **id = (char **)malloc(sizeof(char *) * n);\n  for (i = 0; i < n; i++) {\n    id[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int p = 0;\n  int *year = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &year[i]);\n    if (year[i] >= 60) {\n      p++;\n    }\n  }\n  char **idolder = (char **)malloc(sizeof(char *) * p);\n  for (i = 0; i < n; i++) {\n    idolder[i] = (char *)malloc(sizeof(char) * 10);\n  }\n  int *yearolder = (int *)malloc(sizeof(int) * p);\n  for (i = 0; i < n; i++) {\n    if (year[i] >= 60) {\n      idolder[j] = id[i];\n      yearolder[j] = year[i];\n      j++;\n    }\n  }\n  int e;\n  char *id1 = (char *)malloc(sizeof(char) * 10);\n  for (i = 1; i <= p; i++) {\n    for (j = 0; j < p - i; j++) {\n      if (yearolder[j + 1] > yearolder[j]) {\n        id1 = idolder[j];\n        idolder[j] = idolder[j + 1];\n        idolder[j + 1] = id1;\n        e = yearolder[j];\n        yearolder[j] = yearolder[j + 1];\n        yearolder[j + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", idolder[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (year[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct v {\n  char a[10];\n  int b;\n};\nint main() {\n  int n, i, j = 0, l, k;\n  struct v *c;\n  struct v e[100], y;\n  scanf(\"%d\", &n);\n  c = (struct v *)malloc(n * sizeof(struct v));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i].a, &c[i].b);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b >= 60) {\n      e[j] = c[i];\n      j = j + 1;\n    }\n  }\n  k = j;\n  for (l = 1; l < k; l++) {\n    for (j = 0; j < k - l; j++) {\n      if (e[j].b < e[j + 1].b) {\n        y = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = y;\n      }\n    }\n  }\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", e[j].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b < 60) {\n      printf(\"%s\\n\", c[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  int age;\n  char id[12];\n};\nvoid swap(struct patient *a, struct patient *b) {\n  struct patient tmp;\n  tmp = *a;\n  *a = *b;\n  *b = tmp;\n}\nint main() {\n  int n, i, j = 0, k = 0, l;\n  scanf(\"%d\", &n);\n  struct patient tmp;\n  struct patient young[120];\n  struct patient old[120];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", tmp.id);\n    scanf(\"%d\", &tmp.age);\n    if (tmp.age >= 60)\n      old[j++] = tmp;\n    else\n      young[k++] = tmp;\n  }\n  for (i = 0; i < j; i++) {\n    for (l = 0; l < j - i - 1; l++) {\n      if (old[l].age < old[l + 1].age)\n        swap(&old[l], &old[l + 1]);\n    }\n  }\n  for (i = 0; i < j; i++)\n    cout << old[i].id << \"\\n\";\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16834", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, age[100], i, j, m = 0, p, h;\n  char hao[100][10], mid[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> hao[i] >> age[i];\n  for (i = 0; i < n; i++)\n    if (age[i] >= 60) {\n      m = m + 1;\n      for (j = i; j >= m; j--) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j - 1]);\n        strcpy(hao[j - 1], mid);\n        h = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = h;\n      }\n    }\n  for (i = 0; i < m; i++)\n    for (j = 0; j < m - i - 1; j++)\n      if (age[j] < age[j + 1]) {\n        strcpy(mid, hao[j]);\n        strcpy(hao[j], hao[j + 1]);\n        strcpy(hao[j + 1], mid);\n        h = age[j];\n        age[j] = age[j + 1];\n        age[j + 1] = h;\n      }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", hao[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, b[100], d[100], j = 0, k, l, t, i;\n  scanf(\"%d\", &n);\n  char a[n][10], c[n][10];\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      d[k] = b[i];\n      strcpy(c[k], a[i]);\n      k++;\n    }\n  }\n  l = k;\n  char r[10];\n  for (k = 0; k < l - 1; k++) {\n    for (j = 0; j < l - 1 - k; j++)\n      if (d[j] < d[j + 1]) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n        strcpy(r, c[j]);\n        strcpy(c[j], c[j + 1]);\n        strcpy(c[j + 1], r);\n      }\n  }\n  for (j = 0; j < l; j++) {\n    cout << c[j] << \" \";\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60)\n      printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "9", "index": "16836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[100] = {0}, t[100] = {0}, n, i, j, m = 0;\nchar ss[100][100];\nint cmp(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", ss[i], &s[i]);\n  for (j = 0; j < n; j++) {\n    m = 0;\n    for (i = 0; i < n; i++) {\n      m = m > s[i] ? m : s[i];\n    }\n    if (m < 60)\n      break;\n\n    for (i = 0; i < n; i++) {\n      if (s[i] == m) {\n        printf(\"%s\\n\", ss[i]);\n        s[i] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] != -1)\n      printf(\"%s\\n\", ss[i]);\n  }\n}\n"}
{"label": "9", "index": "16837", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  char c[10];\n  int a;\n  struct person *next;\n};\nint main() {\n  int i, n;\n  struct person *head, *p1, *p2, *p, *p0, *p3;\n  scanf(\"%d\", &n);\n  i = 0;\n  head = NULL;\n  while (i < n) {\n    p1 = (struct person *)malloc(1000);\n    scanf(\"%s %d\", p1->c, &p1->a);\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n    i++;\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = p0 = head;\n    while (p != NULL) {\n      if (p->a > p0->a)\n        p0 = p;\n      p = p->next;\n    }\n    if (p0->a >= 60) {\n      printf(\"%s \", p0->c);\n      p = head;\n      while (p->a != p0->a) {\n        p3 = p;\n        p = p->next;\n      }\n      if (p == head)\n        head = p->next;\n      else\n        p3->next = p->next;\n    } else {\n      printf(\"%s \", head->c);\n      head = head->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "16838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct mouse {\n  int weight;\n  char color[11];\n  struct mouse *next, *before;\n};\nint main() {\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  struct mouse *m, *head, *p1, *p2, *fin;\n  head = p1 = p2 = (struct mouse *)malloc(sizeof(struct mouse));\n  scanf(\"%s %d\", p1->color, &p1->weight);\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct mouse *)malloc(sizeof(struct mouse));\n    scanf(\"%s %d\", p1->color, &p1->weight);\n    p2->next = p1;\n    p1->before = p2;\n    p2 = p1;\n  }\n  fin = p1;\n  p1->next = NULL;\n  for (i = 1; i <= n - 1; i++) {\n    max = 0;\n    p1 = head;\n    for (j = 1; j <= n + 1 - i; j++) {\n      if (p1->weight > max) {\n        max = p1->weight;\n        m = p1;\n      }\n      p1 = p1->next;\n    }\n    if (m->weight < 60) {\n      break;\n    }\n    printf(\"%s\\n\", m->color);\n    if (m == head) {\n      head = head->next;\n      continue;\n    }\n    if (m == fin) {\n      fin = fin->before;\n      fin->next = NULL;\n      continue;\n    }\n    if (m != head && m != fin) {\n      p1 = m->before;\n      p1->next = m->next;\n      m = m->next;\n      m->before = p1;\n    }\n  }\n  p1 = head;\n  cout << head->color << \"\\n\";\n  for (; p1->next != NULL;) {\n    p1 = p1->next;\n    printf(\"%s\\n\", p1->color);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16839", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int age[1000], n, i, k;\n  char id[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> (age[i]);\n  }\n  int e;\n  char e_id[10];\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((age[i] < 60 && age[i + 1] >= 60) ||\n          (age[i] >= 60 && age[i + 1] >= 60 && age[i] < age[i + 1])) {\n        e = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16840", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d \", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j]) || (se[i] == se[j] && list[i] > list[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n  for (i = 0; i <= nums; i++)\n    puts(senior[i]);\n\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pa {\n  char num[15];\n  int age;\n  struct pa *next;\n};\nint main() {\n  struct pa *p, *p1, *p2;\n  int i = 0, n;\n  cin >> n;\n  p1 = (struct pa *)malloc(1000);\n  cin >> p1->num >> p1->age;\n  p1->next = NULL;\n  p2 = p1;\n  p = p2;\n  for (i = 1; i < n; i++) {\n    p1 = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", p1->num, &p1->age);\n    if (p1->age < 60) {\n      while (p2->next != NULL)\n        p2 = p2->next;\n      p2->next = p1;\n      p1->next = NULL;\n    } else {\n      if (p->age < p1->age) {\n        p1->next = p;\n        p = p1;\n      } else {\n        while (p2->next != NULL && (p2->next)->age >= p1->age)\n          p2 = p2->next;\n        p1->next = p2->next;\n        p2->next = p1;\n      }\n    }\n    p2 = p;\n  }\n  while (p != NULL) {\n    printf(\"%s \", p->num);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct patient pt[100];\n\n  int n, i, j, a = 0, b = 0, tem;\n  int age_r[100], time_range[100];\n  char temid[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> pt[i].id >> pt[i].age;\n    if (pt[i].age >= 60) {\n      age_r[a] = i;\n      a++;\n    } else {\n      time_range[b] = i;\n      b++;\n    }\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (pt[age_r[j]].age < pt[age_r[j + 1]].age) {\n        strcpy(temid, pt[age_r[j]].id);\n        strcpy(pt[age_r[j]].id, pt[age_r[j + 1]].id);\n        strcpy(pt[age_r[j + 1]].id, temid);\n        tem = pt[age_r[j]].age;\n        pt[age_r[j]].age = pt[age_r[j + 1]].age;\n        pt[age_r[j + 1]].age = tem;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << pt[age_r[i]].id << \"\\n\";\n  }\n  for (i = 0; i < b; i++)\n    printf(\"%s\\n\", pt[time_range[i]].id);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, h1[100], h2[100], c1 = 0, c2 = 0, t;\n  char d1[100][10], d2[100][10], d[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", d);\n    scanf(\"%d\", &t);\n    if (t >= 60) {\n      h1[c1] = t;\n      strcpy(d1[c1], d);\n      c1++;\n    } else {\n      h2[c2] = t;\n      strcpy(d2[c2], d);\n      c2++;\n    }\n  }\n  for (i = 1; i <= c1; i++) {\n    for (j = 0; j < c1 - i; j++) {\n      if (h1[j] < h1[j + 1]) {\n        t = h1[j];\n        h1[j] = h1[j + 1];\n        h1[j + 1] = t;\n        strcpy(d, d1[j]);\n        strcpy(d1[j], d1[j + 1]);\n        strcpy(d1[j + 1], d);\n      }\n    }\n  }\n  for (i = 0; i < c1; i++) {\n    puts(d1[i]);\n  }\n  for (i = 0; i < c2; i++) {\n    puts(d2[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(int num) {\n  struct patient *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = NULL;\n  while (n < (num - 1)) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p1->id, &p1->age);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nstruct patient *old(struct patient *head) {\n  struct patient *old, *p1, *p2, *p;\n  n = 0;\n  p = head;\n  p1 = p2 = (struct patient *)malloc(sizeof(struct patient));\n  old = NULL;\n  while (p != NULL) {\n    if ((n == 0) && (p->age >= 60)) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      old = p1;\n      p2 = p1;\n      n = 1;\n    } else if (p->age >= 60) {\n      strcpy(p1->id, \"\");\n      strcpy(p1->id, p->id);\n      p1->age = p->age;\n      p2->next = p1;\n      p2 = p1;\n    }\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p = p->next;\n  }\n  p2->next = NULL;\n  return (old);\n}\nstruct patient *sort(struct patient *head) {\n  struct patient head0, end0;\n  struct patient *p0, *p1, *p2, *p;\n  head0.next = head;\n  p = head;\n  while (p->next != NULL)\n    p = p->next;\n  p = p->next = &end0;\n  while (p != head0.next) {\n    p0 = &head0;\n    p1 = p0->next;\n    p2 = p1->next;\n    while (p2 != p) {\n      if ((p1->age) < (p2->age)) {\n        p0->next = p2;\n        p1->next = p2->next;\n        p2->next = p1;\n        p0 = p2;\n        p2 = p1->next;\n      } else {\n        p0 = p1;\n        p1 = p2;\n        p2 = p2->next;\n      }\n    }\n    p = p1;\n  }\n  while (p->next != &end0)\n    p = p->next;\n  p->next = NULL;\n  return (p1);\n}\nvoid print2(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    if (p->age < 60)\n      printf(\"%s\\n\", p->id), p = p->next;\n    else\n      p = p->next;\n  }\n}\nvoid print1(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *creat(int num);\n  struct patient *old(struct patient * head);\n  struct patient *sort(struct patient * head);\n  void print1(struct patient * head);\n  void print2(struct patient * head);\n  struct patient *head, *oldp, *sortold;\n  int num;\n  scanf(\"%d\", &num);\n  head = creat(num);\n  oldp = old(head);\n  sortold = sort(oldp);\n  print1(sortold);\n  print2(head);\n  return 0;\n}\n"}
{"label": "9", "index": "16845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    char as[10];\n    int ag;\n  };\n  struct student stu[100];\n  struct student st[100];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", stu[i].as, &stu[i].ag);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].ag > 59) {\n      st[j] = stu[i];\n      stu[i].ag = 0;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (st[i].ag < st[i + 1].ag) {\n        temp = st[i];\n        st[i] = st[i + 1];\n        st[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"\\n%s\", st[i].as);\n  for (i = 0; i < n; i++)\n    if (stu[i].ag != 0)\n      printf(\"\\n%s\", stu[i].as);\n  return 0;\n}\n"}
{"label": "9", "index": "16846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char str[10];\n  int y;\n} pa[101];\nint main() {\n  int n;\n  int i, j, k = 0, t = 0;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", pa[i].str, &pa[i].y);\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].y >= 60) {\n      a[k] = i;\n      k++;\n    } else {\n      b[t] = i;\n      t++;\n    }\n  }\n\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (pa[a[j]].y < pa[a[j + 1]].y) {\n        pa[100] = pa[a[j]];\n        pa[a[j]] = pa[a[j + 1]];\n        pa[a[j + 1]] = pa[100];\n      }\n\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", pa[a[i]].str);\n  for (i = 0; i < t; i++)\n    printf(\"%s\\n\", pa[b[i]].str);\n}\n"}
{"label": "9", "index": "16847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp, num1 = 0, num2 = 100, age[100], flag[100];\n  char id[100][10], str[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin.get();\n    cin >> id[i] >> age[i];\n    if (age[i] < 60)\n      flag[i] = num1++;\n    else\n      flag[i] = num2++;\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] < age[j] && age[j] >= 60) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (age[i] == age[j] && age[i] >= 60 && age[j] >= 60 &&\n              flag[i] > flag[j] ||\n          age[i] < 60 && age[j] < 60 && flag[i] > flag[j]) {\n        temp = flag[i];\n        flag[i] = flag[j];\n        flag[j] = temp;\n        temp = age[i];\n        age[i] = age[j];\n        age[j] = temp;\n        strcpy(str, id[i]);\n        strcpy(id[i], id[j]);\n        strcpy(id[j], str);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", id[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16848", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, t, x;\n  char w[10];\n  scanf(\"%d\", &n);\n  struct patient {\n    char id[10];\n    int age;\n  } a[100];\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  struct patient1 {\n    char id[10];\n    int age;\n  } b[100];\n  struct patient2 {\n    char id[10];\n    int age;\n  } c[100];\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[k].age = a[i].age;\n      for (j = 0; j < 10; j++)\n        b[k].id[j] = a[i].id[j];\n\n      k++;\n\n    } else {\n      c[m].age = a[i].age;\n      for (j = 0; j < 10; j++) {\n        c[m].id[j] = a[i].id[j];\n      }\n      m++;\n    }\n  }\n  for (j = 0; j < k - 1; j++) {\n    for (i = 0; i < k - 1 - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        t = b[i].age;\n        b[i].age = b[i + 1].age;\n        b[i + 1].age = t;\n        for (x = 0; x < 10; x++) {\n          w[x] = b[i].id[x];\n          b[i].id[x] = b[i + 1].id[x];\n          b[i + 1].id[x] = w[x];\n        }\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", c[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i;\nstruct man {\n  char num[10];\n  int age;\n  int nu;\n} stu[100];\nint f(char *a, int b, int n1, char *c, int d, int n2) {\n  int sum;\n  if (b >= 60 && d >= 60) {\n    if (b > d)\n      sum = 1;\n    else if (b < d)\n      sum = -1;\n    else\n      sum = n2 - n1;\n  } else if (b >= 60 && d < 60)\n    sum = 1;\n  else if (b < 60 && d >= 60)\n    sum = -1;\n  else\n    sum = n2 - n1;\n  return (sum);\n}\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", stu[i].num, &stu[i].age);\n    stu[i].nu = i + 1;\n  }\n  int j, k;\n  struct man t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (f(stu[i].num, stu[i].age, stu[i].nu, stu[j].num, stu[j].age,\n            stu[j].nu) < 0) {\n        k = j;\n        t = stu[i];\n        stu[i] = stu[k];\n        stu[k] = t;\n      }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", stu[i].num);\n}\n"}
{"label": "9", "index": "16850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i;\n  scanf(\"%d\", &n);\n  char a[n][10];\n  int b[n];\n  for (j = 0; j < n; j++)\n    scanf(\"%s %d\", a[j], &b[j]);\n  for (i = 100; i >= 60; i--) {\n    for (j = 0; j < n; j++) {\n      if (b[j] == i)\n        printf(\"%s\\n\", a[j]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    if (b[j] < 60)\n      cout << a[j] << \"\\n\";\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct xinxi {\n    char id[10];\n    int year;\n  } xinxi[100], b[100], p;\n\n  int i, j, k, a = 0, c = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", xinxi[i].id, &(xinxi[i].year));\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) >= 60) {\n      b[a] = xinxi[i];\n      a++;\n    }\n  }\n\n  for (k = 1; k < a; k++) {\n    for (j = 0; j < a - k; j++) {\n      if (b[j].year < b[j + 1].year) {\n        p = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = p;\n      }\n    }\n  }\n  for (j = 0; j < a; j++) {\n    printf(\"%s\\n\", b[j].id);\n  }\n  for (i = 0; i < n; i++) {\n    if ((xinxi[i].year) < 60) {\n      printf(\"%s\\n\", xinxi[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct old {\n  char ID[10];\n  int age;\n};\nint main() {\n  struct old a[100], b[100], c[100];\n  int n, i, j, B = 0, C = 0, temp;\n  char TEMP[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      strcpy(b[B].ID, a[i].ID);\n      b[B].age = a[i].age;\n      B++;\n    } else {\n      strcpy(c[C].ID, a[i].ID);\n      c[C].age = a[i].age;\n      C++;\n    }\n  }\n  for (i = B - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age ||\n          (b[j].age == b[j + 1].age &&\n           ((b[j].ID - '\\0') > (b[j + 1].ID - '\\0')))) {\n        temp = b[j + 1].age, b[j + 1].age = b[j].age, b[j].age = temp;\n        strcpy(TEMP, b[j + 1].ID), strcpy(b[j + 1].ID, b[j].ID),\n            strcpy(b[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = C - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((c[j].ID - '\\0') > (c[j + 1].ID - '\\0')) {\n        temp = c[j + 1].age, c[j + 1].age = c[j].age, c[j].age = temp;\n        strcpy(TEMP, c[j + 1].ID), strcpy(c[j + 1].ID, c[j].ID),\n            strcpy(c[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = 0; i < B; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < C; i++)\n    printf(\"%s\\n\", c[i].ID);\n}\n"}
{"label": "9", "index": "16853", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct {\n    char id[10];\n    int age;\n  } br[100], *p, old[100], *q;\n  for (p = br; p < br + n; p++) {\n    scanf(\"%s%d\", &(p->id), &(p->age));\n  }\n  q = old;\n  int js = 0;\n  for (p = br; p < br + n; p++) {\n    if (p->age >= 60) {\n      q->age = p->age;\n      strcpy(q->id, p->id);\n      q++;\n      js++;\n      p->age = 0;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < js; i++) {\n    for (q = old; q < old + js; q++) {\n      if (q->age > (old + max)->age) {\n        max = q - old;\n      }\n    }\n    printf(\"%s\\n\", (old + max)->id);\n    (old + max)->age = 0;\n  }\n  for (p = br; p < br + n; p++) {\n    if (p->age != 0) {\n      printf(\"%s\\n\", p->id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stru {\n  char id[20];\n  int age;\n  struct stru *next;\n} * head, *p, *q;\n\nvoid creat(int N) {\n  int i;\n  p = q = (struct stru *)malloc(1000);\n  head = p;\n  cin >> p->id >> p->age;\n  for (i = 1; i < N; i++) {\n    p = (struct stru *)malloc(1000);\n    scanf(\"%s %d\", p->id, &p->age);\n    q->next = p;\n    q = p;\n  }\n  q->next = NULL;\n}\n\nvoid arrange(struct stru *head, int N) {\n  int i, temp;\n  char media[20];\n  for (i = 0; i < N; i++)\n    for (p = head, q = head->next; q != NULL; p = p->next, q = q->next) {\n      if (q->age >= 60 && q->age > p->age) {\n        strcpy(media, p->id);\n        strcpy(p->id, q->id);\n        strcpy(q->id, media);\n        temp = p->age;\n        p->age = q->age;\n        q->age = temp;\n      }\n    }\n}\n\nvoid print(struct stru *head) {\n  for (p = head; p != NULL; p = p->next)\n    cout << p->id << \" \";\n}\n\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  creat(N);\n\n  arrange(head, N);\n  print(head);\n}\n"}
{"label": "9", "index": "16855", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid bubble_sort(int a[100], char b[100][10], int n) {\n  int i, j, temp;\n  char temp_[10] = {0}, empty[10] = {0};\n  for (j = 1; j < n; j++)\n    for (i = 0; i < n - j; i++) {\n      if (a[i] < a[i + 1]) {\n        temp = a[i];\n        strcpy(temp_, b[i]);\n        a[i] = a[i + 1];\n        strcpy(b[i], empty);\n        strcpy(b[i], b[i + 1]);\n        a[i + 1] = temp;\n        strcpy(b[i + 1], empty);\n        strcpy(b[i + 1], temp_);\n      }\n    }\n}\n\nint main() {\n  int age[100], Age_[100] = {0}, age_[100];\n  int n, i;\n  char id[100][10], Id_[100][10] = {0}, id_[100][10] = {0}, empty[10] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> id[i] >> age[i];\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      Age_[i] = age[i];\n      strcpy(Id_[i], id[i]);\n    } else {\n      age_[i] = age[i];\n      strcpy(id_[i], id[i]);\n    }\n  }\n  bubble_sort(Age_, Id_, n);\n  for (i = 0; i < n; i++) {\n    if (strcmp(Id_[i], empty) == 0)\n      continue;\n    else\n      printf(\"%s\\n\", Id_[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(id_[i], empty) == 0) {\n      continue;\n    } else\n      printf(\"%s\\n\", id_[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n  struct pa *next;\n} * head, *p, *p2;\n\nint main() {\n  int i, j, n, t;\n  char tid[10];\n  scanf(\"%d\", &n);\n  head = (struct pa *)malloc(sizeof(struct pa));\n  p = (struct pa *)malloc(sizeof(struct pa));\n  scanf(\"%s %d\", p->id, &p->age);\n  head->next = p;\n  p->next = NULL;\n  p2 = p;\n  for (i = 1; i < n; i++) {\n    p = (struct pa *)malloc(sizeof(struct pa));\n    cin >> p->id >> p->age;\n    p2->next = p;\n    p2 = p;\n    p2->next = NULL;\n  }\n\n  for (i = 0; i < n; i++) {\n    for (p = head->next; p->next != NULL; p = p->next) {\n      if (p->next->age >= 60 && p->next->age > p->age) {\n        t = p->age, p->age = p->next->age, p->next->age = t;\n        strcpy(tid, p->id), strcpy(p->id, p->next->id),\n            strcpy(p->next->id, tid);\n      }\n    }\n  }\n\n  p = head->next;\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", p->id);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, m, x, k;\n  char a[100][100], b[100], c[100], d[100][100], e[100], f[100][100], s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      c[k] = b[i];\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < k - 1 - i; j++) {\n      if (c[j] < c[j + 1]) {\n        t = c[j];\n        c[j] = c[j + 1];\n        c[j + 1] = t;\n        strcpy(s, d[j]);\n        strcpy(d[j], d[j + 1]);\n        strcpy(d[j + 1], s);\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", d[i]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] < 60) {\n      e[m] = b[i];\n      strcpy(f[m], a[i]);\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", f[i]);\n}\n"}
{"label": "9", "index": "16858", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int n, z[100];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%s%d\", s[i], &z[i]);\n\n  for (int j = 120; j >= 60; j--) {\n    for (int t = 0; t < n; t++) {\n      if (z[t] == j) {\n        printf(\"%s\\n\", s[t]);\n        z[t] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (z[m] != 0)\n      printf(\"%s\\n\", s[m]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Patient {\n    char ID[10];\n    int age;\n  } patient[100], patient2[100];\n  struct Patient t;\n  int n, i = 0, j = 0, k = 0, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patient[i].ID, &patient[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (patient[i].age >= 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  num = j;\n  for (i = 0; i < n; i++) {\n    if (patient[i].age < 60) {\n      patient2[j] = patient[i];\n      j++;\n    }\n  }\n  for (k = 1; k < num; k++) {\n    for (i = 0; i < num - k; i++) {\n      if (patient2[i + 1].age > patient2[i].age) {\n        t = patient2[i + 1];\n        patient2[i + 1] = patient2[i];\n        patient2[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << patient2[i].ID << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16860", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct staff {\n  char id[20];\n  int age;\n  struct staff *next;\n};\n\nint main() {\n  int n, k = 0, max = 59;\n  struct staff *head, *p, *q, *pre;\n  scanf(\"%d\", &n);\n\n  struct staff *p1, *p2;\n\n  p1 = (struct staff *)malloc(1000);\n  scanf(\"%s %d\", p1->id, &p1->age);\n  head = p2 = p1;\n  if (p1->age >= 60)\n    k++;\n\n  while (n - 1) {\n    n--;\n    p1 = (struct staff *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if (p1->age >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  \n\n  while (k) {\n    p = head;\n    k--;\n    while (p) {\n      if (p->age > max) {\n        max = p->age;\n        q = p;\n      }\n      p = p->next;\n    }\n    printf(\"%s \", q->id);\n    if (q == head) {\n      head = q->next;\n      free(q);\n    } else {\n      if (q->next == NULL) {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            free(q);\n            pre->next = NULL;\n            break;\n          }\n        }\n      }\n\n      else {\n        p = head;\n        while (p) {\n          pre = p;\n          p = p->next;\n          if (p == q) {\n            p = p->next;\n            pre->next = p;\n            free(q);\n            break;\n          }\n        }\n      }\n    }\n    max = 59;\n  }\n\n  p = head;\n  while (p) {\n    printf(\"%s \", p->id);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct xinxi {\n  char id[10];\n  int age;\n};\n\nstruct xinxi old[100];\nint main() {\n  int i, n, j;\n  int maxage = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n\n    scanf(\"%s %d\", old[i].id, &old[i].age);\n\n  for (i = 0; i < n; i++)\n    if (maxage < old[i].age)\n      maxage = old[i].age;\n\n  for (j = maxage; j >= 60; j--)\n    for (i = 0; i < n; i++)\n      if (old[i].age == j)\n        puts(old[i].id);\n  for (i = 0; i < n; i++)\n    if (old[i].age < 60)\n      puts(old[i].id);\n}\n"}
{"label": "9", "index": "16862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, old[100] = {0}, t[100] = {0};\n  char num[100][10] = {0}, temp[100][10] = {0};\n  int x, z = 0;\n  char y[10] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", num[i], &old[i]);\n\n  for (i = 0; i < n; i++) {\n    if (old[i] >= 60) {\n      strcpy(temp[z], num[i]);\n      t[z] = old[i];\n      z++;\n    }\n  }\n  for (i = 0; i < z; i++) {\n    for (j = z - 1; j > i; j--) {\n      if (t[j] > t[j - 1]) {\n        x = t[j];\n        t[j] = t[j - 1];\n        t[j - 1] = x;\n        strcpy(y, temp[j - 1]);\n        strcpy(temp[j - 1], temp[j]);\n        strcpy(temp[j], y);\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%s\\n\", temp[i]);\n  for (i = 0; i < n; i++) {\n    if (old[i] < 60)\n      printf(\"%s\\n\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].age;\n  for (i = 0; i < n; i++) {\n    for (j = n - 2; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    cout << a[i].id << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16864", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, y, x = 0;\n  struct ID {\n    int age;\n    char a[10];\n  } ID[201];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", ID[i].a);\n    scanf(\"%d\", &ID[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].age >= 60) {\n      ID[100 + x] = ID[i];\n      ID[i].a[0] = '\\0';\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (y = 0; y < x - 1 - i; y++) {\n      if (ID[100 + y].age < ID[y + 101].age) {\n        ID[200] = ID[100 + y];\n        ID[100 + y] = ID[y + 101];\n        ID[y + 101] = ID[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++) {\n    printf(\"%s\\n\", ID[100 + i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (ID[i].a[0] != '\\0')\n      printf(\"%s\\n\", ID[i].a);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16865", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid bubble(struct patient *a[], int n);\n\nint main() {\n  int n, i, s = 0;\n  struct patient p[100] = {\"0\", 0};\n  struct patient *pt[100];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].ID, &p[i].age);\n    pt[i] = &p[i];\n  }\n\n  bubble(pt, n);\n\n  for (i = 0; i < n; i++) {\n    if (pt[i]->age >= 60) {\n      printf(\"%s\\n\", pt[i]->ID);\n      s++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].ID);\n    }\n  }\n}\n\nvoid sort2(struct patient *a[], int n) {\n  int i, j, k;\n  struct patient *t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[j]->age > a[k]->age) {\n        k = j;\n      }\n    }\n    t = a[k];\n    a[k] = a[i];\n    a[i] = t;\n  }\n}\nvoid bubble(struct patient *a[], int n) {\n  int i, j;\n  struct patient *t;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - i - 2; j++) {\n      if (a[j]->age < a[j + 1]->age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Inf {\n  char c[10];\n  int a;\n};\nint main() {\n  int n, o = 0, y = 0, t, i, j;\n  char temp[10];\n  struct Inf inf[100], old[100], young[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", inf[i].c, &inf[i].a);\n    if (inf[i].a >= 60) {\n      strcpy(old[o].c, inf[i].c);\n      old[o].a = inf[i].a;\n      o++;\n    } else {\n      strcpy(young[y].c, inf[i].c);\n      young[y].a = inf[i].a;\n      y++;\n    }\n  }\n  for (j = 1; j < o; j++) {\n    for (i = 0; i < o - j; i++) {\n      if (old[i].a < old[i + 1].a) {\n        strcpy(temp, old[i].c);\n        strcpy(old[i].c, old[i + 1].c);\n        strcpy(old[i + 1].c, temp);\n        t = old[i].a;\n        old[i].a = old[i + 1].a;\n        old[i + 1].a = t;\n      }\n    }\n  }\n  for (i = 0; i < o; i++) {\n    printf(\"%s\\n\", old[i].c);\n  }\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", young[i].c);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\nstruct patient *insert(struct patient *head, struct patient *another) {\n  struct patient *p0, *p1, *p2;\n  p1 = head;\n  p0 = another;\n  if (p0->age < 60) {\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->age >= p0->age && p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p1->age >= p0->age) {\n      p1->next = p0;\n      p0->next = NULL;\n    } else {\n      if (p1 == head) {\n        head = p0;\n        p0->next = p1;\n      } else {\n        p2->next = p0;\n        p0->next = p1;\n      }\n    }\n  }\n  return head;\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head, *p;\n  scanf(\"%d\", &n);\n  head = p = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p->ID, &p->age);\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->ID, &p->age);\n    head = insert(head, p);\n  }\n  print(head);\n}\n"}
{"label": "9", "index": "16868", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char id[30];\n  int age;\n  int num;\n  int flag;\n  struct pat *next;\n  struct pat *ns;\n};\n\nint n;\n\nvoid sort(struct pat *head) {\n  int i;\n  struct pat *q, *p, *max;\n  q = head;\n\n  for (i = 0; i < n; i++) {\n    p = head->next;\n    while (1) {\n      if (p->flag)\n        break;\n      p = p->next;\n    }\n    max = p;\n    while (1) {\n      if ((p->num) > (max->num) && p->flag)\n        max = p;\n      p = p->next;\n      if (p == NULL)\n        break;\n    }\n    max->flag = 0;\n    q->ns = max;\n    q = q->ns;\n  }\n  q->ns = NULL;\n}\n\nint main() {\n  int i;\n  struct pat *head, *p1, *p2, *p;\n  cin >> n;\n  head = (struct pat *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->flag = 1;\n    if (p1->age >= 60)\n      p1->num = 10000 * p1->age + n - i;\n    else\n      p1->num = n - i;\n    if (i == 0) {\n      head->next = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  sort(head);\n  p = head->ns;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->ns;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pa {\n  char id[10];\n  int age;\n} patient[100], patient2[100];\n\nint main() {\n  int i, k, m, n, j, temp;\n  char id2[10];\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\\n\", patient[i].id, &patient[i].age);\n\n  for (i = 0, j = 0; i < n;) {\n    if (patient[i].age >= 60) {\n      strcpy(patient2[j].id, patient[i].id);\n      patient2[j].age = patient[i].age;\n\n      j++;\n      for (k = i; k < n - 1; k++) {\n        strcpy(patient[k].id, patient[k + 1].id);\n        patient[k].age = patient[k + 1].age;\n      }\n      n--;\n    } else\n      i++;\n  }\n\n  for (i = 1; i < j; i++) {\n    for (k = 0; k < i; k++) {\n      if (patient2[i].age > patient2[k].age) {\n        temp = patient2[i].age;\n        strcpy(id2, patient2[i].id);\n        for (m = i; m > k; m--) {\n          patient2[m].age = patient2[m - 1].age;\n          strcpy(patient2[m].id, patient2[m - 1].id);\n        }\n        patient2[k].age = temp;\n        strcpy(patient2[k].id, id2);\n      }\n    }\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", patient2[i].id);\n  for (i = 0; i < n; i++)\n    cout << patient[i].id << \"\\n\";\n}\n"}
{"label": "9", "index": "16870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[200], t;\n  char b[200][11], b1[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &b[i], &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (a[j + 1] >= 60 && a[j] < a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n        strcpy(b1, b[j]);\n        strcpy(b[j], b[j + 1]);\n        strcpy(b[j + 1], b1);\n      }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16871", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  char c[10];\n  int a;\n  struct person *next;\n};\nint main() {\n  int i, n;\n  struct person *head, *p1, *p2, *p, *p0, *p3;\n  scanf(\"%d\", &n);\n  i = 0;\n  head = NULL;\n  while (i < n) {\n    p1 = (struct person *)malloc(1000);\n    scanf(\"%s %d\", p1->c, &p1->a);\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n    i++;\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p = p0 = head;\n    while (p != NULL) {\n      if (p->a > p0->a)\n        p0 = p;\n      p = p->next;\n    }\n    if (p0->a >= 60) {\n      printf(\"%s \", p0->c);\n      p = head;\n      while (p->a != p0->a) {\n        p3 = p;\n        p = p->next;\n      }\n      if (p == head)\n        head = p->next;\n      else {\n        p3->next = p->next;\n      }\n    } else {\n      printf(\"%s \", head->c);\n      head = head->next;\n    }\n  }\n}\n"}
{"label": "9", "index": "16872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int age[1000], a[1000], t;\n  char ID[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> ID[i] >> age[i];\n  j = n - 1;\n  k = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (age[i] < 60) {\n      a[j] = i;\n      j--;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (age[a[j]] > age[a[j - 1]]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << ID[a[i]] << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[20];\n  int score;\n  struct student *next;\n};\nint n = 0;\nstruct student *creat(int numb);\nvoid print(struct student *head);\nstruct student *maopao(struct student *head);\nint main() {\n  int n;\n  char ch;\n  struct student *head;\n  cin >> n >> ch;\n  head = creat(n);\n  head = maopao(head);\n  print(head);\n  free(head);\n  return 0;\n}\n\nstruct student *creat(int numb) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", &p1->num, &p1->score);\n  head = NULL;\n  while (n < numb - 1) {\n    n = n + 1;\n    if (n == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", &p1->num, &p1->score);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nstruct student *maopao(struct student *head) {\n  struct student *p0, *p1, *p2, *tem;\n  int temp = 0, i, j;\n  p0 = head;\n  p1 = head;\n  p2 = head;\n  if (head == NULL) {\n    return (head);\n  } else if (p0->next == NULL) {\n    return (head);\n  } else if (p0->next != NULL) {\n    for (i = 0; i < n; i = i + 1) {\n      for (j = 0; j < n - 1; j = j + 1) {\n        if (p1->score < p1->next->score && j != 0 && p1->next->score >= 60) {\n          tem = p1->next;\n          p2->next = p1->next;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p2->next;\n        } else if (p1->score < p1->next->score && j == 0 &&\n                   p1->next->score >= 60) {\n          tem = p1->next;\n          p0 = tem;\n          p2 = tem;\n          p1->next = tem->next;\n          tem->next = p1;\n          p2 = p1;\n          p1 = p1->next;\n        } else {\n          p2 = p1;\n          p1 = p1->next;\n        }\n      }\n      temp = temp + 1;\n      p1 = p0;\n      p2 = p0;\n    }\n  }\n  return (p0);\n}\n\nvoid print(struct student *head) {\n  struct student *p, *tempo;\n  p = head;\n  if (head != NULL) {\n    do {\n      tempo = p->next;\n      cout << p->num << \" \";\n      p = tempo;\n    } while (p != NULL);\n  }\n}\n"}
{"label": "9", "index": "16874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, b[100], c[100], j = 0, k, mid, p, m = 0, max;\n  struct patient {\n    char id[20];\n    int age;\n  } a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j++] = i;\n    } else\n      c[m++] = i;\n  }\n  for (i = 0; i < j; i++) {\n    max = i;\n    for (k = i; k < j; k++) {\n\n      if (a[b[k]].age > a[b[max]].age)\n        max = k;\n    }\n    mid = b[max];\n    for (k = max; k > i; k--)\n      b[k] = b[k - 1];\n    b[i] = mid;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", a[b[i]].id);\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", a[c[i]].id);\n}\n"}
{"label": "9", "index": "16875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    char as[10];\n    int ag;\n  };\n  struct student stu[100];\n  struct student st[100];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].as >> stu[i].ag;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].ag > 59) {\n      st[j] = stu[i];\n      stu[i].ag = 0;\n      j++;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (st[i].ag < st[i + 1].ag) {\n        temp = st[i];\n        st[i] = st[i + 1];\n        st[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"\\n%s\", st[i].as);\n  for (i = 0; i < n; i++)\n    if (stu[i].ag != 0)\n      printf(\"\\n%s\", stu[i].as);\n  return 0;\n}\n"}
{"label": "9", "index": "16876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0, m = 0;\n\n  scanf(\"%d\", &n);\n\n  char s1[100][10], s2[100][10], p1[100][10], p2[100][10], z1[100][10],\n      z2[100][10], t[10];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s1[i]);\n\n    scanf(\"%s\", s2[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) {\n      strcpy(p1[j], s1[i]);\n\n      strcpy(p2[j], s2[i]);\n\n      j++;\n    }\n    if (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0') {\n      strcpy(z1[m], s1[i]);\n\n      strcpy(z2[m], s2[i]);\n\n      m++;\n    }\n  }\n  int k = j;\n  for (i = k - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(p2[j], p2[j + 1]) < 0) {\n\n        strcpy(t, p2[j]);\n\n        strcpy(p2[j], p2[j + 1]);\n\n        strcpy(p2[j + 1], t);\n\n        strcpy(t, p1[j]);\n\n        strcpy(p1[j], p1[j + 1]);\n\n        strcpy(p1[j + 1], t);\n      }\n    }\n  }\n  for (i = m - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (strcmp(z2[j], z2[j + 1]) < 0) {\n\n        strcpy(t, z2[j]);\n\n        strcpy(z2[j], z2[j + 1]);\n\n        strcpy(z2[j + 1], t);\n\n        strcpy(t, z1[j]);\n\n        strcpy(z1[j], z1[j + 1]);\n\n        strcpy(z1[j + 1], t);\n      }\n    }\n  }\n  for (j = 0; j < m; j++) {\n    cout << z1[j] << \"\\n\";\n  }\n\n  for (j = 0; j < k; j++) {\n    cout << p1[j] << \"\\n\";\n  }\n  for (i = 0; i < n; i++) {\n    if (!((s2[i][1] != '\\0' && strcmp(s2[i], \"60\") >= 0) ||\n          (s2[i][2] >= '0' && s2[i][2] <= '9' && s2[i][3] == '\\0')))\n      cout << s1[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct date {\n    char a[10];\n    int num;\n    struct date *next;\n  };\n  struct date *p1, *p2, *head;\n  int n, i, temp, j, compare;\n  char tem[10];\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct date *)malloc(1000);\n  scanf(\"%s %d\", head->a, &head->num);\n  head->next = NULL;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p2 = (struct date *)malloc(1000);\n    scanf(\"%s %d\", p2->a, &p2->num);\n    p2->next = NULL;\n    p1->next = p2;\n    p1 = p2;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 1; j <= i; j++) {\n      compare = strcmp(p1->a, p2->a);\n      if (p1->num < 60 && p2->num >= 60) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      if (p1->num >= 60 && p2->num >= 60 && p1->num < p2->num) {\n        strcpy(tem, p1->a);\n        strcpy(p1->a, p2->a);\n        strcpy(p2->a, tem);\n        temp = p2->num;\n        p2->num = p1->num;\n        p1->num = temp;\n      }\n      p1 = p2;\n      p2 = p1->next;\n    }\n  }\n  p1 = p2 = head;\n  for (i = 1; i <= n; i++) {\n    cout << p2->a << \" \";\n    p1 = p2;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct bingren {\n  char id[1000];\n  int age;\n} bin[101];\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k = 0, l = 0, e, a[100];\n  char xiao[101][1000], da[101][1000], c[1000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &bin[i].id, &bin[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (bin[i].age < 60) {\n      strcpy(xiao[k], bin[i].id);\n      k++;\n    } else {\n      strcpy(da[l], bin[i].id);\n      a[l] = bin[i].age;\n      l++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (a[j] < a[j + 1]) {\n        strcpy(c, da[j + 1]);\n        strcpy(da[j + 1], da[j]);\n        strcpy(da[j], c);\n        e = a[j + 1];\n        a[j + 1] = a[j];\n        a[j] = e;\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", da[i]);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", xiao[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct senex {\n  char id[10];\n  int age;\n  int rec;\n} sen[100], t;\nint n;\n\nint main() {\n  int i, j, k, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", sen[i].id, &sen[i].age);\n    if (sen[i].age >= 60)\n      sen[i].rec = 1;\n    else\n      sen[i].rec = 0;\n  }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < n - i; j++)\n      if (sen[j].rec < sen[j + 1].rec) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n  k = 0;\n  while (sen[k].rec == 1)\n    k++;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < k - i; j++)\n      if (sen[j].age < sen[j + 1].age) {\n        t = sen[j];\n        sen[j] = sen[j + 1];\n        sen[j + 1] = t;\n      }\n\n  for (i = 0; i < n; i++)\n    cout << sen[i].id << \"\\n\";\n  cin >> i;\n  return 0;\n}\n"}
{"label": "9", "index": "16880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pat {\n    char id[10];\n    int age;\n  } pat[201];\n  int i, n, j, x = 0, y = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", pat[i].id, &pat[i].age);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    if (pat[i].age >= 60) {\n      pat[100 + x] = pat[i];\n      x++;\n    } else {\n      pat[y] = pat[i];\n      y++;\n    }\n  }\n  for (i = 0; i < x - 1; i++) {\n    for (j = 0; j < x - i - 1; j++) {\n      if (pat[100 + j].age < pat[101 + j].age) {\n        pat[200] = pat[100 + j];\n        pat[100 + j] = pat[101 + j];\n        pat[101 + j] = pat[200];\n      }\n    }\n  }\n  for (i = 0; i < x; i++)\n    cout << pat[100 + i].id << \"\\n\";\n  for (i = 0; i < y; i++) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "16881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int a;\n  } patients[100];\n  struct old {\n    char ido[10];\n    int ao;\n  } olds[100];\n  struct young {\n    char idy[10];\n    int ay;\n  } youngs[100];\n  int n, y = 0, o = 0, so = 0, sy = 0, e;\n  scanf(\"%d\", &n);\n  char f[10];\n  for (int j = 0; j < n; j++) {\n    cin >> patients[j].id;\n    cin >> patients[j].a;\n    if (patients[j].a < 60) {\n      strcpy(youngs[y].idy, patients[j].id);\n      youngs[y].ay = patients[j].a;\n      y++;\n    }\n    if (patients[j].a >= 60) {\n      strcpy(olds[o].ido, patients[j].id);\n      olds[o].ao = patients[j].a;\n      o++;\n    }\n  }\n  for (int r = o - 1; r > 0; r--) {\n    for (int i = 0; i < r; i++) {\n      if (olds[i].ao < olds[i + 1].ao) {\n        e = olds[i + 1].ao;\n        olds[i + 1].ao = olds[i].ao;\n        olds[i].ao = e;\n        strcpy(f, olds[i + 1].ido);\n        strcpy(olds[i + 1].ido, olds[i].ido);\n        strcpy(olds[i].ido, f);\n      }\n    }\n  }\n  for (int l = 0; l <= o - 1; l++)\n    printf(\"%s\\n\", olds[l].ido);\n\n  for (int m = 0; m <= y - 1; m++) {\n    printf(\"%s\\n\", youngs[m].idy);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, age[100];\n  char id[100][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", id[i], &(age[i]));\n  }\n  int e;\n  char e_id[10];\n  for (int k = 1; k <= n; k++) {\n    for (int m = 0; m < n - k; m++) {\n      if ((age[m] >= 60 && age[m + 1] >= 60 && age[m] < age[m + 1]) ||\n          (age[m] < 60 && age[m + 1] >= 60)) {\n        e = age[m + 1];\n        strcpy(e_id, id[m + 1]);\n        age[m + 1] = age[m];\n        strcpy(id[m + 1], id[m]);\n        age[m] = e;\n        strcpy(id[m], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct pa {\n  char num[10];\n  int age;\n} p[105], t, a[105];\nint main() {\n  int i, k, n, c, d;\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i + k < n;) {\n    scanf(\"%s%d\", p[i].num, &p[i].age);\n    if (p[i].age >= 60) {\n      a[k] = p[i];\n      k++;\n    } else\n      i++;\n  }\n  for (c = 0; c < k - 1; c++) {\n    for (d = 0; d < k - 1; d++) {\n      if (a[d].age < a[d + 1].age) {\n        t = a[d];\n        a[d] = a[d + 1];\n        a[d + 1] = t;\n      }\n    }\n  }\n\n  if (k >= 0) {\n    k--;\n    for (c = 0; c <= k; c++)\n      printf(\"%s\\n\", a[c].num);\n  }\n  if (i >= 0) {\n    i--;\n    for (d = 0; d <= i; d++)\n      printf(\"%s\\n\", p[d].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct br {\n    char id[10];\n    int age;\n  } * patients, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  patients = (struct br *)malloc(sizeof(struct br) * n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", patients[i].id, &patients[i].age);\n\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (patients[j].age >= 60 && patients[j].age > patients[j - 1].age) {\n        t = patients[j];\n        patients[j] = patients[j - 1];\n        patients[j - 1] = t;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    cout << patients[i].id << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "9", "index": "16885", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[10];\n  int age;\n} a[100];\nint main() {\n  int n, i, k, e;\n  char p[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].age;\n    if (a[i].age >= 60) {\n      for (k = 0; i - k >= 1; k++) {\n        if (a[i - k].age > a[i - k - 1].age) {\n          e = a[i - k].age;\n          a[i - k].age = a[i - k - 1].age;\n          a[i - k - 1].age = e;\n\n          strcpy(p, a[i - k].id);\n          strcpy(a[i - k].id, a[i - k - 1].id);\n          strcpy(a[i - k - 1].id, p);\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16886", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct a60 {\n  char ID[10];\n  int age;\n} a60[101];\n\nstruct u60 {\n  char ID[10];\n  int age;\n} u60[100];\n\nvoid sort(int n) {\n  int i;\n  struct a60 *x;\n  for (i = 1; i < n; i++) {\n    for (x = a60; x < a60 + n - i; x++) {\n      if (x->age < (x + 1)->age) {\n        a60[100] = *x;\n        *x = *(x + 1);\n        *(x + 1) = a60[100];\n      }\n    }\n  }\n}\n\nint main() {\n  int a = 0, b = 0, m, n, q;\n  char p[10];\n  struct a60 *x;\n  struct u60 *y;\n  x = a60;\n  y = u60;\n\n  cin >> n;\n\n  for (m = 0; m < n; m++) {\n    cin >> p >> q;\n\n    if (q >= 60) {\n      strcpy(x->ID, p);\n      x->age = q;\n      x++;\n      a++;\n    } else {\n      strcpy(y->ID, p);\n      y->age = q;\n      y++;\n      b++;\n    }\n  }\n\n  sort(a);\n\n  for (x = a60; x < a60 + a; x++)\n    printf(\"%s\\n\", x->ID);\n\n  for (y = u60; y < u60 + b; y++)\n    printf(\"%s\\n\", y->ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16887", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char id[10];\n  int old;\n} pt[100];\n\nint main() {\n  int n, i, j, k, e, h;\n  int yx[100], byx[100];\n  cin >> n;\n  j = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &pt[i].id, &pt[i].old);\n    if (pt[i].old >= 60) {\n      yx[j] = i;\n      j++;\n    } else {\n      byx[k] = i;\n      k++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    for (h = 0; h < j - 1; h++) {\n      if (pt[yx[h]].old < pt[yx[h + 1]].old) {\n        e = yx[h];\n        yx[h] = yx[h + 1];\n        yx[h + 1] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", pt[yx[i]].id);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", pt[byx[i]].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, x[110], k, x2[110];\n  char id[110][20], temp[20], id2[100][20];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &id[i], &x[i]);\n    if (x[i] >= 60) {\n      k++;\n      x2[k] = x[i];\n      strcpy(id2[k], id[i]);\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    for (j = k; j > i; j--) {\n      if (x2[j] > x2[j - 1]) {\n        t = x2[j];\n        x2[j] = x2[j - 1];\n        x2[j - 1] = t;\n        strcpy(temp, id2[j]);\n        strcpy(id2[j], id2[j - 1]);\n        strcpy(id2[j - 1], temp);\n      }\n    }\n  }\n  for (i = 1; i <= k; i++) {\n    printf(\"%s\\n\", id2[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (x[i] < 60) {\n      printf(\"%s\\n\", id[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int age[100];\n  char ID[100][11];\n} patient, *ppatient;\nint main() {\n  ppatient = &patient;\n  int n, i, j, k, num, m = 0;\n  char id[11], ID_1[100][11], age_1[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", patient.ID[i], &patient.age[i]);\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] >= 60) {\n      strcpy(ID_1[j], (*ppatient).ID[i]);\n      age_1[j] = (*ppatient).age[i];\n      m += 1;\n      j++;\n    }\n  }\n  for (j = m - 1; j > 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (age_1[k] < age_1[k + 1]) {\n        strcpy(id, ID_1[k + 1]);\n        strcpy(ID_1[k + 1], ID_1[k]);\n        strcpy(ID_1[k], id);\n        num = age_1[k + 1];\n        age_1[k + 1] = age_1[k];\n        age_1[k] = num;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", ID_1[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*ppatient).age[i] < 60)\n      printf(\"%s\\n\", (*ppatient).ID[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16890", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int o;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  int scholar(struct student * p);\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%s %d\", p1->num, &p1->o);\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->o);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->o > m->o)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n;\n  struct student *head, *m, *p;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  scanf(\"%d\", &n);\n  head = create(n);\n  p = head;\n  for (;;) {\n    m = max(p);\n    if (m->o >= 60) {\n      printf(\"%s \", m->num);\n      m->o = -1;\n    } else\n      break;\n  }\n  p = head;\n  while (p) {\n    if (p->o != -1)\n      printf(\"%s \", p->num);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n  struct patient *next;\n} * head, *p1, *p2;\nstruct patient *order(int n) {\n  int i, j, t;\n  char a[20];\n  for (i = 0; i < n - 1; i++) {\n    p1 = head;\n    p2 = p1->next;\n    for (j = 0; j < n - 1 - i; j++) {\n      if (p2->age >= 60 && p1->age < p2->age) {\n        t = p1->age;\n        p1->age = p2->age;\n        p2->age = t;\n        strcpy(a, p1->id);\n        strcpy(p1->id, p2->id);\n        strcpy(p2->id, a);\n      }\n      p1 = p1->next;\n      p2 = p2->next;\n    }\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = head = (struct patient *)malloc(sizeof(struct patient));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p2 = p1;\n    p1 = (struct patient *)malloc(sizeof(struct patient));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  while (p1) {\n    printf(\"%s\\n\", p1->id);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  int sum;\n  struct student *next;\n};\n\nint main() {\n  int n, i;\n  struct student *p1, *p2, *p3, *head;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    if (i == 0)\n      head = p1;\n    scanf(\"%s%d\", p1->num, &p1->sum);\n    p1->next = NULL;\n\n    if (i != 0) {\n      p3 = head;\n      if (p1->sum >= 60) {\n\n        while ((p1->sum <= p3->sum) && p3->next != NULL) {\n          p2 = p3;\n          p3 = p3->next;\n        }\n        if (p1->sum > p3->sum) {\n          if (head == p3) {\n            head = p1;\n            p1->next = p3;\n          } else {\n            p2->next = p1;\n            p1->next = p3;\n          }\n        } else {\n          p3->next = p1;\n          p1->next = NULL;\n        }\n      } else {\n        for (p2 = head;; p2 = p2->next) {\n          if (p2->next == NULL)\n            break;\n        }\n        p2->next = p1;\n        p1->next = NULL;\n      }\n    }\n  }\n  p1 = head;\n  for (i = 0; (i < n && p1 != NULL); i++) {\n    printf(\"%s\\n\", p1->num);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "9", "index": "16893", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int age;\n} stu[100];\n\nint main() {\n  char c;\n  int n, i, j;\n  struct student *pstu = stu, e;\n  pstu = &stu[0];\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].age;\n\n  for (j = 0; j < n; j++) {\n    if (stu[j].age >= 60) {\n      for (i = j; i > 0; i--) {\n        if (stu[i].age > stu[i - 1].age) {\n          e = *(pstu + i);\n          *(pstu + i) = *(pstu + i - 1);\n          *(pstu - 1 + i) = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", (pstu + i)->num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16894", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Patient {\n  char id[10];\n  int age;\n} a[100], e, b[100];\n\nint main() {\n  int n, J;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (a[j].id > a[j + 1].id) {\n        e = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = e;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i].age >= 60) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  J = j;\n  for (j = 0; j < J; j++) {\n    for (i = 0; i < J - j; i++) {\n      if (b[i].age < b[i + 1].age) {\n        e = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = e;\n      }\n    }\n  }\n  for (j = 0; j < J; j++) {\n    printf(\"%s\\n\", b[j].id);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i].age < 60) {\n      printf(\"%s\\n\", a[i].id);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, age[1000 + 10], num[1000 + 10];\n  char id[1000 + 10][1000 + 1] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> id[i] >> age[i];\n    num[i] = i;\n  }\n  int flag, tempnum, tempage, j;\n  char tempid[1000 + 1];\n  for (i = 0; i < n - 1; i++) {\n    for (j = n - 1; j > i; j--) {\n      flag = 0;\n      if (age[j] >= 60 && age[j - 1] < 60)\n        flag = 1;\n      else if (age[j] >= 60 && age[j - 1] >= 60) {\n        if (age[j] > age[j - 1])\n          flag = 1;\n        else if (age[j] == age[j - 1]) {\n          if (num[j] < num[j - 1])\n            flag = 1;\n        }\n      } else if (age[j] < 60 && age[j - 1] < 60) {\n        if (num[j] < num[j - 1])\n          flag = 1;\n      }\n      if (flag) {\n        tempnum = num[j];\n        num[j] = num[j - 1];\n        num[j - 1] = tempnum;\n        tempage = age[j];\n        age[j] = age[j - 1];\n        age[j - 1] = tempage;\n        strcpy(tempid, id[j]);\n        strcpy(id[j], id[j - 1]);\n        strcpy(id[j - 1], tempid);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct pa {\n    char ID[11];\n    int age;\n    struct pa *next;\n  } * head, *p1, *p2, *p3, *p4;\n  int tage;\n  char tID[11];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p1 = (struct pa *)malloc(sizeof(struct pa));\n    if (i == 0)\n      head = p1;\n    cin >> p1->ID >> p1->age;\n    if (i != 0)\n      p2->next = p1;\n    p2 = p1;\n  }\n  p1->next = NULL;\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < n; i++) {\n    p3 = p1;\n    p4 = p2;\n    for (j = 0; j < n - 1; j++) {\n      if (p3->age < p4->age && p4->age >= 60) {\n        strcpy(tID, p3->ID);\n        tage = p3->age;\n        strcpy(p3->ID, p4->ID);\n        p3->age = p4->age;\n        strcpy(p4->ID, tID);\n        p4->age = tage;\n      }\n      p3 = p3->next;\n      p4 = p4->next;\n    }\n  }\n  p1 = head;\n  while (p1 != NULL) {\n    printf(\"%s\\n\", p1->ID);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16897", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct v {\n  char a[10];\n  int b;\n};\nint main() {\n  int n, i, j = 0, l, k;\n  struct v *c;\n  struct v e[100], y;\n  scanf(\"%d\", &n);\n  c = (struct v *)malloc(n * sizeof(struct v));\n  for (i = 0; i < n; i++) {\n    cin >> c[i].a >> c[i].b;\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b >= 60) {\n      e[j] = c[i];\n      j = j + 1;\n    }\n  }\n  k = j;\n  for (l = 1; l < k; l++) {\n    for (j = 0; j < k - l; j++) {\n      if (e[j].b < e[j + 1].b) {\n        y = e[j];\n        e[j] = e[j + 1];\n        e[j + 1] = y;\n      }\n    }\n  }\n  for (j = 0; j < k; j++) {\n    printf(\"%s\\n\", e[j].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (c[i].b < 60) {\n      printf(\"%s\\n\", c[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16898", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  int order;\n  int age;\n  char id[10];\n};\n\nint cmp(const void *a, const void *b) {\n  const struct patient *pa = (const struct patient *)a;\n  const struct patient *pb = (const struct patient *)b;\n  if ((pa->age >= 60) && (pb->age < 60)) {\n    return -1;\n  } else if ((pa->age < 60) && (pb->age >= 60)) {\n    return 1;\n  } else if ((pa->age >= 60) && (pa->age != pb->age)) {\n    return pb->age - pa->age;\n  } else {\n    return pa->order - pb->order;\n  }\n}\n\nint main() {\n  int i, num;\n  struct patient pat[100];\n\n  cin >> num;\n  for (i = 0; i < num; ++i) {\n    pat[i].order = i;\n    scanf(\"%s %d\", pat[i].id, &(pat[i].age));\n  }\n\n  qsort(pat, num, sizeof(struct patient), cmp);\n\n  for (i = 0; i < num; ++i) {\n    printf(\"%s\\n\", pat[i].id);\n  }\n}\n"}
{"label": "9", "index": "16899", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n};\n\nvoid bubble(struct patient *a[], int n);\n\nint main() {\n  int n, i, s = 0;\n  struct patient p[100] = {\"0\", 0};\n  struct patient *pt[100];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &p[i].ID, &p[i].age);\n    pt[i] = &p[i];\n  }\n\n  bubble(pt, n);\n\n  for (i = 0; i < n; i++) {\n    if (pt[i]->age >= 60) {\n      printf(\"%s\\n\", pt[i]->ID);\n      s++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n\n    if (p[i].age < 60) {\n      printf(\"%s\\n\", p[i].ID);\n    }\n  }\n}\n\nvoid sort2(struct patient *a[], int n) {\n  int i, j, k;\n  struct patient *t;\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (a[j]->age > a[k]->age) {\n        k = j;\n      }\n    }\n    t = a[k];\n    a[k] = a[i];\n    a[i] = t;\n  }\n}\nvoid bubble(struct patient *a[], int n) {\n  int i, j;\n  struct patient *t;\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - i - 2; j++) {\n      if (a[j]->age < a[j + 1]->age) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n}\n"}
{"label": "9", "index": "16900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char id[10];\n    int age;\n  } pa[100] = {0}, old[100] = {0}, young[100] = {0}, t;\n  int i, j, k = 0, l = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> pa[i].id >> pa[i].age;\n\n  for (i = 0; i < n; i++) {\n    if (pa[i].age >= 60) {\n      old[k] = pa[i];\n      k++;\n    } else {\n      young[l] = pa[i];\n      l++;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (old[j].age < old[j + 1].age) {\n        t = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i < l; i++) {\n    cout << young[i].id << \"\\n\";\n  }\n}\n"}
{"label": "9", "index": "16901", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct P {\n  char id[10];\n  int age;\n} pa[100];\nstruct P pb[100];\nint main() {\n  int n, r = 0, s = 0, i, o, p, j, k;\n  cin >> n;\n  struct P temp;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", temp.id, &(temp.age));\n    if (temp.age >= 60) {\n      pb[r] = temp;\n      r++;\n    } else {\n      pa[s] = temp;\n      s++;\n    }\n  }\n  for (o = 0; o < r; o++) {\n    for (p = 0; p < r - o; p++) {\n      if (pb[p].age < pb[p + 1].age) {\n        struct P tmp = pb[p];\n        pb[p] = pb[p + 1];\n        pb[p + 1] = tmp;\n      }\n    }\n  }\n  for (j = 0; j < r; j++) {\n    printf(\"%s\\n\", pb[j].id);\n  }\n  for (k = 0; k < s; k++) {\n    printf(\"%s\\n\", pa[k].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16902", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct m {\n    char id[10];\n    int year;\n  } p[100], a[100], tmp;\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", p[i].id, &p[i].year);\n    if (p[i].year >= 60) {\n      a[k] = p[i];\n      k++;\n      p[i].year = 0;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (a[j].year > a[j - 1].year) {\n        tmp = a[j - 1];\n        a[j - 1] = a[j];\n        a[j] = tmp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", a[i].id);\n\n  for (i = 0; i < n; i++) {\n    if (p[i].year == 0)\n      continue;\n    printf(\"%s\\n\", p[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16903", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct a60 {\n  char ID[10];\n  int age;\n} a60[101];\n\nstruct u60 {\n  char ID[10];\n  int age;\n} u60[100];\n\nvoid sort(int n) {\n  int i;\n  struct a60 *x;\n  for (i = 1; i < n; i++) {\n    for (x = a60; x < a60 + n - i; x++) {\n      if (x->age < (x + 1)->age) {\n        a60[100] = *x;\n        *x = *(x + 1);\n        *(x + 1) = a60[100];\n      }\n    }\n  }\n}\n\nint main() {\n  int a = 0, b = 0, m, n, q;\n  char p[10];\n  struct a60 *x;\n  struct u60 *y;\n  x = a60;\n  y = u60;\n\n  scanf(\"%d\", &n);\n\n  for (m = 0; m < n; m++) {\n    scanf(\"%s %d\", p, &q);\n\n    if (q >= 60) {\n      strcpy(x->ID, p);\n      x->age = q;\n      x++;\n      a++;\n    } else {\n      strcpy(y->ID, p);\n      y->age = q;\n      y++;\n      b++;\n    }\n  }\n\n  sort(a);\n\n  for (x = a60; x < a60 + a; x++)\n    printf(\"%s\\n\", x->ID);\n\n  for (y = u60; y < u60 + b; y++)\n    printf(\"%s\\n\", y->ID);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    cout << b[i] << \"\\n\";\n  }\n  for (i = 0; i <= q; i++)\n    printf(\"%s\\n\", d[i]);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16905", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  struct people {\n    char a[10];\n    int year;\n  };\n  struct people b[100], c[100], d[100], v[100]; \n  for (int h = 0; h <= 99; h++) {\n    for (int p = 0; p <= 9; p++) {\n      b[h].a[p] = c[h].a[p] = d[h].a[p] = v[h].a[p] = 0;\n    }\n  }\n\n  int n, t = 0, k = 0, o; \n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%s %d\", &b[i].a, &b[i].year);\n    if (b[i].year >= 60) {\n      t++;\n      v[t] = b[i];\n    } else {\n      k++;\n      d[k] = b[i];\n    }\n  }\n  for (int j = 1; j <= t; j++) {\n    o = 0;\n    for (int u = 1; u <= t; u++) {\n\n      if (v[u].year > v[j].year) {\n        o++;\n      }\n      if (v[u].year == v[j].year && u < j) {\n        o++;\n      }\n    }\n    c[o + 1] = v[j];\n  }\n  for (int l = 1; l <= k; l++) {\n    c[t + l] = d[l];\n  }\n  for (int x = 1; x <= n; x++) {\n    printf(\"%s\\n\", c[x].a);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16906", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char ID[15];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *create() {\n  struct patient *head, *p1, *p2;\n  p1 = (struct patient *)malloc(1000);\n  scanf(\"%s %d\", p1->ID, &p1->age);\n  head = p1;\n  p2 = p1;\n  p1->next = NULL;\n  int i = 1;\n  do {\n    if (i == n)\n      break;\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->ID, &p1->age);\n    p2->next = p1;\n    p2 = p1;\n    p1->next = NULL;\n    i++;\n  } while (1);\n  return (head);\n}\nstruct patient *findmax(struct patient *head) {\n  struct patient *max;\n\n  struct patient *p;\n  max = head;\n  p = head->next;\n  while (p) {\n    if (p->age > max->age)\n      max = p;\n    p = p->next;\n  }\n  return (max);\n}\nstruct patient *del(struct patient *head, struct patient *needdel) {\n  struct patient *p, *ppre;\n  printf(\"%s \", needdel->ID);\n  p = head;\n  while (p && needdel != p) {\n    ppre = p;\n    p = p->next;\n  }\n  if (p == head) {\n    head = p->next;\n    free(p);\n  } else if (p) {\n    ppre->next = p->next;\n    free(p);\n  }\n\n  return (head);\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n\n  scanf(\"%d\", &n);\n  struct patient *head, *p;\n  head = create();\n  p = head;\n\n  do {\n    p = findmax(head);\n    if (p->age < 60)\n      break;\n    head = del(head, p);\n\n  } while (1);\n  print(head);\n}\n"}
{"label": "9", "index": "16907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, m, t, p, r;\n  int a[100], b[100];\n  char str1[100][10], str2[100][10];\n  char string[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", str1[i], &a[i]);\n  for (p = 0, s = 0; p < n; p++) {\n    if (a[p] >= 60) {\n      b[s] = a[p];\n      strcpy(str2[s], str1[p]);\n      s = s + 1;\n    }\n  }\n  for (k = 0; k < (s - 1); k++) {\n    for (m = 0; m < (s - k - 1); m++) {\n      if (b[m + 1] > b[m]) {\n        t = b[m + 1];\n        b[m + 1] = b[m];\n        b[m] = t;\n        strcpy(string, str2[m + 1]);\n        strcpy(str2[m + 1], str2[m]);\n        strcpy(str2[m], string);\n      }\n    }\n  }\n  for (j = 0; j < s; j++)\n    printf(\"%s\\n\", str2[j]);\n  for (r = 0; r < n; r++) {\n    if (a[r] < 60)\n      printf(\"%s\\n\", str1[r]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} p[100], e, old[100], young[100];\n\nint main() {\n  int n, i, j = 0, k = 0, o = -1, y = -1;\n  scanf(\"%d\", &n);\n  struct patient p[100], old[100], young[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n    if ((p[i].age) >= 60) {\n      o++;\n      old[j] = p[i];\n      j++;\n\n    } else {\n      y++;\n      young[k] = p[i];\n      k++;\n    }\n  } \n  for (i = 120; i >= 60; i--) {\n    for (j = 0; j < o + 1; j++) {\n      if (old[j].age == i) {\n        printf(\"%s\\n\", old[j].name);\n      }\n    }\n  } \n  for (i = 0; i < y + 1; i++) {\n    printf(\"%s\\n\", young[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct fy {\n    char a[12];\n    int k;\n    int s;\n    struct fy *p;\n  } x[100], *head;\n  int n, i, j, l, kk, ss;\n  char aa[12];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", x[i].a, &x[i].k);\n    x[i].s = x[i].k >= 60 ? 1 : 0;\n    x[i].p = &x[i + 1];\n  }\n  head = &x[0];\n  x[n - 1].p = NULL;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (x[i].s == 1 && x[j].s == 1) {\n        if (x[i].k < x[j].k) {\n          kk = x[j].k;\n          ss = x[j].s;\n          strcpy(aa, x[j].a);\n          for (l = j; l > i; l--) {\n            x[l].k = x[l - 1].k;\n            x[l].s = x[l - 1].s;\n            strcpy(x[l].a, x[l - 1].a);\n          }\n          x[i].k = kk;\n          x[i].s = ss;\n          strcpy(x[i].a, aa);\n        }\n      }\n    }\n    if (x[i].s == 1)\n      printf(\"%s\\n\", x[i].a);\n  }\n  while (head != NULL) {\n    if (head->s == 0)\n      cout << head->a << \"\\n\";\n    head = head->p;\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16910", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct peo {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct peo people[100];\n  int sixty[100];\n\n  int n, b = 0, i, j, k, e;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", people[i].id, &people[i].age);\n    if (people[i].age >= 60) {\n      sixty[i] = people[i].age;\n\n      b += 1;\n    } else {\n\n      sixty[i] = 0;\n    }\n  }\n\n  for (k = 0; k < n - 1; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (sixty[i - 1] < sixty[i]) {\n        e = sixty[i - 1];\n        sixty[i - 1] = sixty[i];\n        sixty[i] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sixty[i] == people[j].age && sixty[i] != sixty[i - 1]) {\n        printf(\"%s\\n\", people[j].id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (people[i].age < 60) {\n      printf(\"%s\\n\", people[i].id);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16911", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct bing {\n  char id[10];\n  int age;\n};\n\nint main() {\n  struct bing peo[120], old[120], young[120], temp;\n  int i, j, n, num1 = 0, num2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> peo[i].id >> peo[i].age;\n  for (i = 0; i < n; i++) {\n    if (peo[i].age >= 60) {\n      old[num1] = peo[i];\n      num1 = num1 + 1;\n    } else {\n      young[num2] = peo[i];\n      num2 = num2 + 1;\n    }\n  }\n  for (i = 0; i < num1 - 1; i++)\n    for (j = 0; j < num1 - i - 1; j++) {\n      if (old[j].age < old[j + 1].age) {\n        temp = old[j];\n        old[j] = old[j + 1];\n        old[j + 1] = temp;\n      }\n    }\n  for (i = 0; i < num1; i++)\n    printf(\"%s\\n\", old[i].id);\n  for (i = 0; i < num2; i++)\n    printf(\"%s\\n\", young[i].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100], j = 0, c[100], z, r;\n  char s[100][10], b[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60) {\n      c[j] = a[i];\n      strcpy(b[j], s[i]);\n      j++;\n    }\n  }\n  for (z = j - 1; z > 0; z--) {\n    for (r = 0; r < z; r++) {\n      if (c[r] < c[r + 1]) {\n        int tep;\n        char m[10];\n        tep = c[r + 1];\n        c[r + 1] = c[r];\n        c[r] = tep;\n        strcpy(m, b[r]);\n        strcpy(b[r], b[r + 1]);\n        strcpy(b[r + 1], m);\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      cout << s[i] << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t, b[100], e[100];\n  char a[100][20], c[100][20], d[100][20], str[20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (i = 0, j = 0, k = 0; i < n; i++) {\n    if (b[i] >= 60) {\n      strcpy(c[j], a[i]);\n      e[j] = b[i];\n      j++;\n    } else {\n      strcpy(d[k], a[i]);\n      k++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (m = 0; m < j - 1 - i; m++) {\n      if (e[m] < e[m + 1]) {\n        t = e[m];\n        e[m] = e[m + 1];\n        e[m + 1] = t;\n        strcpy(str, c[m]);\n        strcpy(c[m], c[m + 1]);\n        strcpy(c[m + 1], str);\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", c[i]);\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", d[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct bing {\n  char id[10];\n  int age;\n} person[100], old[100];\n\nint main() {\n  int n, i, j = 0, k, b;\n  char e[10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> person[i].id >> person[i].age;\n    if (person[i].age >= 60) {\n      strcpy(old[j].id, person[i].id);\n      old[j].age = person[i].age;\n      j = j + 1;\n    }\n  }\n  for (k = 1; k < j; k++)\n    for (i = 0; i < j - k; i++) {\n      if (old[i].age < old[i + 1].age) {\n        strcpy(e, old[i].id);\n        strcpy(old[i].id, old[i + 1].id);\n        strcpy(old[i + 1].id, e);\n        b = old[i].age;\n        old[i].age = old[i + 1].age;\n        old[i + 1].age = b;\n      }\n    }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", old[i].id);\n  for (i = 0; i < n; i++)\n    if (person[i].age < 60)\n      cout << person[i].id << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], l[100], b[100], i = 0, j, p = 0, q = 0, t = 0;\n  char s[100][12], lao[100][13] = {'\\0'}, bu[100][13] = {'\\0'}, w[12] = {'\\0'};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", &s[i], &a[i]);\n    if (a[i] >= 60)\n      l[p] = a[i], strcpy(lao[p], s[i]), p++;\n    else\n      b[q] = a[i], strcpy(bu[q], s[i]), q++;\n  }\n\n  for (i = 0; i < p; i++) {\n    for (j = 0; j < p - 1; j++) {\n      if (l[j] < l[j + 1])\n        t = l[j], l[j] = l[j + 1], l[j + 1] = t, strcpy(w, lao[j]),\n        strcpy(lao[j], lao[j + 1]), strcpy(lao[j + 1], w);\n    }\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", lao[i]);\n  }\n  for (i = 0; i < q; i++) {\n    printf(\"%s\\n\", bu[i]);\n  }\n}\n"}
{"label": "9", "index": "16916", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100], aged[100];\n  char num[100][11], anum[100][11], q[100][11];\n  int n, i, k, j = 0, s, p, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", num[i]);\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      aged[j] = sz[i];\n      strcpy(anum[j], num[i]);\n      j++;\n    }\n  }\n  for (s = 1; s < j; s++) {\n    for (k = 0; k < j - s; k++) {\n      if (aged[k] < aged[k + 1]) {\n        e = aged[k + 1];\n        aged[k + 1] = aged[k];\n        aged[k] = e;\n        strcpy(q[k], anum[k + 1]);\n        strcpy(anum[k + 1], anum[k]);\n        strcpy(anum[k], q[k]);\n      }\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s\\n\", anum[p]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60) {\n      printf(\"%s\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int age[100], a, m = 0, tmp1[100], d = 0;\n  char zfc[100][11], tmp2[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> zfc[i];\n    scanf(\"%d\", &age[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      strcpy(tmp2[m], zfc[i]);\n      tmp1[m] = age[i];\n      m++;\n    }\n  }\n  for (a = m - 1; a > 0; a--) {\n    for (d = 0; d < a; d++) {\n      if (tmp1[d] < tmp1[d + 1]) {\n        char s[200];\n        strcpy(s, tmp2[d]);\n        strcpy(tmp2[d], tmp2[d + 1]);\n        strcpy(tmp2[d + 1], s);\n        int y;\n        y = tmp1[d];\n        tmp1[d] = tmp1[d + 1];\n        tmp1[d + 1] = y;\n      }\n    }\n  }\n  for (a = 0; a < m; a++) {\n    printf(\"%s\\n\", tmp2[a]);\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60) {\n      printf(\"%s\\n\", zfc[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16918", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct patient {\n  char name[20];\n  int age;\n} line[202], temp;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", &line[i].name);\n    scanf(\"%d\", &line[i].age);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = n; j > i; j--) {\n      if (line[j].age >= 60) {\n        if (line[j].age > line[j - 1].age) {\n          temp = line[j];\n          line[j] = line[j - 1];\n          line[j - 1] = temp;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n\n    printf(\"%s\\n\", line[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100], e;\n  char s[100][100], str[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", s[i], &a[i]);\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (a[i] >= 60 && a[i + 1] >= 60) {\n        if (a[i] >= a[i + 1]) {\n          continue;\n        }\n        if (a[i] < a[i + 1]) {\n          strcpy(str, s[i + 1]);\n          strcpy(s[i + 1], s[i]);\n          strcpy(s[i], str);\n          e = a[i + 1];\n          a[i + 1] = a[i];\n          a[i] = e;\n        }\n      }\n      if (a[i] >= 60 && a[i + 1] < 60) {\n        continue;\n      }\n      if (a[i] < 60 && a[i + 1] >= 60) {\n        strcpy(str, s[i + 1]);\n        strcpy(s[i + 1], s[i]);\n        strcpy(s[i], str);\n        e = a[i + 1];\n        a[i + 1] = a[i];\n        a[i] = e;\n      }\n      if (a[i] < 60 && a[i + 1] < 60) {\n        continue;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100], a, ageb[100], c, t, m;\n  char ID[100][100], IDb[100][100], IDc[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &age[i]);\n  }\n  i = 0;\n  c = 0;\n  while (i < n) {\n    if (age[i] >= 60) {\n      ageb[c] = age[i];\n      strcpy(IDb[c], ID[i]);\n      c++;\n    }\n    i++;\n  }\n  for (i = 0; i <= c - 1; i++)\n    for (a = 0; a < c - i - 1; a++)\n      if (ageb[a] < ageb[a + 1]) {\n        t = ageb[a];\n        strcpy(IDc, IDb[a]);\n        ageb[a] = ageb[a + 1];\n        strcpy(IDb[a], IDb[a + 1]);\n        ageb[a + 1] = t;\n        strcpy(IDb[a + 1], IDc);\n      }\n  for (i = 0; i <= c - 1; i++)\n    printf(\"%s\\n\", IDb[i]);\n  i = 0;\n  while (i < n) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", ID[i]);\n    i++;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16921", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, pass;\n  struct patient {\n    char id[1000];\n    int age;\n  } men[1000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> men[i].id >> men[i].age;\n  }\n  for (pass = 1; pass < n; pass++) {\n    for (i = n - 1; i > pass - 1; i--) {\n      if (men[i].age >= 60 && men[i].age > men[i - 1].age) {\n        temp = men[i];\n        men[i] = men[i - 1];\n        men[i - 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", men[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct patient {\n    char ID[16];\n    int age;\n    int index;\n  };\n  int n, i, j, t, t1;\n  char str[16];\n  scanf(\"%d\", &n);\n  struct patient pat[n];\n  for (i = 0; i < n; i++) {\n    cin >> pat[i].ID >> pat[i].age;\n    pat[i].index = i;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (pat[j].age >= 60 && pat[j].age > pat[i].age) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n      if (pat[i].age >= 60 && pat[i].age == pat[j].age) {\n        if (pat[i].index > pat[j].index) {\n          strcpy(str, pat[i].ID);\n          strcpy(pat[i].ID, pat[j].ID);\n          strcpy(pat[j].ID, str);\n          t = pat[i].age;\n          pat[i].age = pat[j].age;\n          pat[j].age = t;\n          t1 = pat[i].index;\n          pat[i].index = pat[j].index;\n          pat[j].index = t1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (pat[i].age < 60 && pat[i].index > pat[j].index) {\n        strcpy(str, pat[i].ID);\n        strcpy(pat[i].ID, pat[j].ID);\n        strcpy(pat[j].ID, str);\n        t = pat[i].age;\n        pat[i].age = pat[j].age;\n        pat[j].age = t;\n        t1 = pat[i].index;\n        pat[i].index = pat[j].index;\n        pat[j].index = t1;\n      }\n  }\n  for (i = 0; i < n; i++)\n\n    puts(pat[i].ID);\n}\n"}
{"label": "9", "index": "16923", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, t;\n  int u = 0, k = 0;\n  int a[1000], b[1000];\n  char s[1000][10], h[1000][10], j[1000][10];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    if (a[i] >= 60) {\n      b[u] = a[i];\n      strcpy(h[u], s[i]);\n      u++;\n    } else {\n      strcpy(j[k], s[i]);\n      k++;\n    }\n  }\n  for (i = u - 1; i > 0; i--) {\n    for (t = 0; t < i; t++) {\n      if (b[t] < b[t + 1]) {\n        int f;\n        f = b[t];\n        b[t] = b[t + 1];\n        b[t + 1] = f;\n        char tmp[10];\n        strcpy(tmp, h[t]);\n        strcpy(h[t], h[t + 1]);\n        strcpy(h[t + 1], tmp);\n      }\n    }\n  }\n  for (i = 0; i < u; i++)\n    printf(\"%s \", h[i]);\n  for (t = 0; t < k; t++)\n    printf(\"%s \", j[t]);\n  return 0;\n}\n"}
{"label": "9", "index": "16924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct pat {\n  char ID[10];\n  int age;\n};\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct pat *p[100];\n  struct pat *old[100];\n  struct pat *young[100], *temp;\n\n  for (i = 0; i < n; i++) {\n    p[i] = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p[i]->ID, &p[i]->age);\n  }\n  int k = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    if (p[i]->age >= 60) {\n      old[k] = p[i];\n      k++;\n    } else {\n      young[j] = p[i];\n      j++;\n    }\n  }\n  int lenold = k, lenyoung = j;\n  for (k = 1; k < lenold; k++) {\n    for (i = 0; i < lenold - k; i++) {\n      if (old[i]->age < old[i + 1]->age) {\n        temp = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < lenold; i++) {\n    printf(\"%s \", old[i]->ID);\n  }\n  for (i = 0; i < lenyoung; i++) {\n    cout << young[i]->ID << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int age[1000], a[1000], t;\n  char ID[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", &ID[i], &age[i]);\n  j = n - 1;\n  k = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (age[i] < 60) {\n      a[j] = i;\n      j--;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (age[i] >= 60) {\n      a[k] = i;\n      k++;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    for (j = k - 1; j > i; j--) {\n      if (age[a[j]] > age[a[j - 1]]) {\n        t = a[j];\n        a[j] = a[j - 1];\n        a[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", ID[a[i]]);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "9", "index": "16926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], e[100], f[100];\n  char c[100][100], b[100][100], d[100][100], x[100];\n  int n, p = -1, q = -1, k, z, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", c[i], &a[i]);\n    if (a[i] >= 60) {\n      p++;\n      e[p] = a[i];\n      strcpy(b[p], c[i]);\n    }\n    if (a[i] < 60) {\n      q++;\n      f[q] = a[i];\n      strcpy(d[q], c[i]);\n    }\n  }\n\n  for (k = 1; k <= p + 1; k++) {\n    for (i = 0; i < p + 1 - k; i++) {\n      if (e[i] < e[i + 1]) {\n        z = e[i];\n        e[i] = e[i + 1];\n        e[i + 1] = z;\n        strcpy(x, b[i]);\n        strcpy(b[i], b[i + 1]);\n        strcpy(b[i + 1], x);\n      }\n    }\n  }\n  for (i = 0; i <= p; i++) {\n    puts(b[i]);\n  }\n  for (i = 0; i <= q; i++) {\n    puts(d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char tmp[100];\n  int n, i, j = 0, o = 0, tmpn;\n  struct {\n    char num[100];\n    int a, k;\n  } s[1000], t[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].num, &s[i].a);\n    if (s[i].a >= 60)\n      s[i].k = 1;\n    else {\n      s[i].k = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1) {\n      strcpy(t[j].num, s[i].num);\n      t[j].a = s[i].a;\n      j++;\n      o++;\n    }\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (t[j].a < t[j + 1].a) {\n        tmpn = t[j].a;\n        t[j].a = t[j + 1].a;\n        t[j + 1].a = tmpn;\n        strcpy(tmp, t[j].num);\n        strcpy(t[j].num, t[j + 1].num);\n        strcpy(t[j + 1].num, tmp);\n      }\n    }\n  }\n  for (i = 0; i < o; i++)\n    printf(\"%s\\n\", t[i].num);\n  for (i = 0; i < n; i++) {\n    if (s[i].k == 1)\n      continue;\n    printf(\"%s\\n\", s[i].num);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct old {\n  char ID[10];\n  int age;\n};\nint main() {\n  struct old a[100], b[100], c[100];\n  int n, i, j, B = 0, C = 0, temp;\n  char TEMP[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].age;\n    if (a[i].age >= 60) {\n      strcpy(b[B].ID, a[i].ID);\n      b[B].age = a[i].age;\n      B++;\n    } else {\n      strcpy(c[C].ID, a[i].ID);\n      c[C].age = a[i].age;\n      C++;\n    }\n  }\n  for (i = B - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age ||\n          (b[j].age == b[j + 1].age &&\n           ((b[j].ID - '\\0') > (b[j + 1].ID - '\\0')))) {\n        temp = b[j + 1].age, b[j + 1].age = b[j].age, b[j].age = temp;\n        strcpy(TEMP, b[j + 1].ID), strcpy(b[j + 1].ID, b[j].ID),\n            strcpy(b[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = C - 1; i >= 0; i--) {\n    for (j = 0; j < i; j++) {\n      if ((c[j].ID - '\\0') > (c[j + 1].ID - '\\0')) {\n        temp = c[j + 1].age, c[j + 1].age = c[j].age, c[j].age = temp;\n        strcpy(TEMP, c[j + 1].ID), strcpy(c[j + 1].ID, c[j].ID),\n            strcpy(c[j].ID, TEMP);\n      }\n    }\n  }\n  for (i = 0; i < B; i++)\n    printf(\"%s\\n\", b[i].ID);\n  for (i = 0; i < C; i++) {\n    printf(\"%s\\n\", c[i].ID);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16929", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct pa {\n    char id[20];\n    int old;\n  } pai[101], ol[101], you[101];\n  int n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", pai[i].id, &pai[i].old);\n\n  l = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (pai[i].old >= 60) {\n      ol[l] = pai[i];\n      l++;\n    }\n    if (pai[i].old < 60) {\n      you[k] = pai[i];\n      k++;\n    }\n  }\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < l - i; j++) {\n      if (ol[j].old < ol[j + 1].old) {\n        ol[100] = ol[j];\n        ol[j] = ol[j + 1];\n        ol[j + 1] = ol[100];\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%s\\n\", ol[i].id);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\\n\", you[i].id);\n  }\n  printf(\"%s\", you[k - 1].id);\n  return 0;\n}\n"}
{"label": "9", "index": "16930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char num[10];\n  int age;\n  struct patient *next;\n};\nint n;\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num = 1;\n  head = NULL;\n  while (num <= n) {\n    p1 = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (num == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    num++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct patient *pt, *p, *pre;\n  int i, max, num = 0;\n  cin >> n;\n  pt = creat();\n  for (p = pt; p; p = p->next) {\n    if (p->age >= 60)\n      num++;\n  }\n  for (i = 1; i <= num; i++) {\n    max = 59;\n    for (p = pt; p; p = p->next) {\n      if (max < p->age)\n        max = p->age;\n    }\n    for (p = pre = pt; p; p = p->next) {\n      if (p->age != max)\n        pre = p;\n      else\n        break;\n    }\n    printf(\"%s \", p->num);\n    if (p == pt)\n      pt = p->next;\n    else\n      pre->next = p->next;\n  }\n  for (p = pt; p; p = p->next)\n    cout << p->num << \" \";\n  return 0;\n}\n"}
{"label": "9", "index": "16931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct ID {\n    char x[100];\n    int y;\n  } da[100], xiao[100], p[100], e;\n  int s, m = 0, n = 0;\n  scanf(\"%d\\n\", &s);\n\n  for (int i = 0; i < s; i++) {\n    cin >> (p[i].x) >> (p[i].y);\n    if (p[i].y >= 60) {\n      da[m] = p[i];\n      m++;\n    } else {\n      xiao[n] = p[i];\n      n++;\n    }\n  }\n\n  for (int b = 1; b <= m; b++) {\n    for (int v = 0; v < m - b; v++) {\n      if (da[v].y < da[v + 1].y) {\n        e = da[v];\n        da[v] = da[v + 1];\n        da[v + 1] = e;\n      }\n    }\n  }\n  int h, f;\n  for (int z = 0; z < m; z++) {\n    f = strlen(da[z].x);\n    for (int g = 0; g < f; g++) {\n      if (g != f - 1) {\n        cout << da[z].x[g];\n      } else {\n        printf(\"%c\\n\", da[z].x[g]);\n      }\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    h = strlen(xiao[a].x);\n    for (int j = 0; j < h; j++) {\n      if (j != h - 1) {\n        cout << xiao[a].x[j];\n      } else {\n        printf(\"%c\\n\", xiao[a].x[j]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16932", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct people {\n    char num[10];\n    int age;\n  } peo1[100], peo2[100], peo3[100], e;\n  int n, i, j, m, k;\n  scanf(\"%d \", &n);\n  char s[100][10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", peo1[i].num);\n    scanf(\"%d\", &peo1[i].age);\n  }\n  j = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (peo1[i].age >= 60) {\n      peo2[j] = peo1[i];\n      j++;\n    } else if (peo1[i].age < 60) {\n      peo3[m] = peo1[i];\n      m++;\n    }\n  }\n  for (k = 1; k <= j; k++) {\n    for (i = 0; i < j - k; i++) {\n      if (peo2[i].age < peo2[i + 1].age) {\n        e = peo2[i + 1];\n        peo2[i + 1] = peo2[i];\n        peo2[i] = e;\n      }\n    }\n  }\n  int a, b, c;\n  for (a = 0, i = 0; a < j; a++, i++) {\n    strcpy(s[a], peo2[i].num);\n  }\n  for (a = j, b = 0; a < n; a++, b++) {\n    strcpy(s[a], peo3[b].num);\n  }\n  for (c = 0; c < n; c++) {\n    printf(\"%s\\n\", s[c]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct person {\n  int age;\n  char num[10];\n\n} pat[100], old[100], you[100], exchange_1;\nint main() {\n  int n, i, p, q, result;\n  int k = 0, t = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", pat[i].num);\n    scanf(\"%d\", &pat[i].age);\n    if (pat[i].age >= 60) {\n      old[k].age = pat[i].age;\n      strcpy(old[k].num, pat[i].num);\n      k++;\n    } else {\n      strcpy(you[t].num, pat[i].num);\n      t++;\n    }\n  }\n  for (p = 0; p < k; p++) {\n    for (q = 0; q < k - p; q++) {\n      if (old[q].age < old[q + 1].age) {\n        exchange_1.age = old[q].age;\n        old[q].age = old[q + 1].age;\n        old[q + 1].age = exchange_1.age;\n        strcpy(exchange_1.num, old[q].num);\n        strcpy(old[q].num, old[q + 1].num);\n        strcpy(old[q + 1].num, exchange_1.num);\n      }\n    }\n  }\n  for (result = 0; result < k; result++)\n    printf(\"%s \", old[result].num);\n\n  for (result = 0; result < t; result++)\n    printf(\"%s \", you[result].num);\n\n  return 0;\n}\n"}
{"label": "9", "index": "16934", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char name[10];\n  int age;\n} p[100], e, old[100], young[100];\n\nint main() {\n  int n, i, j = 0, k = 0, o = -1, y = -1;\n  scanf(\"%d\", &n);\n  struct patient p[100], old[100], young[100];\n  for (i = 0; i < n; i++) {\n    cin >> p[i].name >> p[i].age;\n    if ((p[i].age) >= 60) {\n      o++;\n      old[j] = p[i];\n      j++;\n\n    } else {\n      y++;\n      young[k] = p[i];\n      k++;\n    }\n  }\n  for (i = 120; i >= 60; i--) {\n    for (j = 0; j < o + 1; j++) {\n      if (old[j].age == i) {\n        printf(\"%s\\n\", old[j].name);\n      }\n    }\n  }\n  for (i = 0; i < y + 1; i++) {\n    printf(\"%s\\n\", young[i].name);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct pat {\n  char num[10];\n  int age;\n  struct pat *next;\n};\n\nstruct pat *creat(int n) {\n  struct pat *p1, *p2, *head;\n  int i;\n  p2 = head = p1 = (struct pat *)malloc(sizeof(struct pat));\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", p1->num, &p1->age);\n    if (i == 0)\n      head = p1;\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct pat *)malloc(sizeof(struct pat));\n  }\n  p2 = NULL;\n  return head;\n}\n\nvoid array_1(struct pat *head, int n) {\n  int i, j, ta;\n  char str[10];\n  struct pat *p1, *p2;\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      p2 = p1;\n      p1 = p1->next;\n      if ((p1->age) > (p2->age) && (p1->age) >= 60) {\n\n        strcpy(str, p2->num);\n        strcpy(p2->num, p1->num);\n        strcpy(p1->num, str);\n        ta = p1->age;\n        p1->age = p2->age;\n        p2->age = ta;\n      }\n    }\n    p1 = head;\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct pat *p;\n  p = creat(n);\n  array_1(p, n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cout << p->num << \" \";\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, n, e, sz[100], sx[100] = {0};\n  char st[100][11], sa[11], sd[100][11];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> st[i];\n    cin >> sz[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] >= 60) {\n      sx[i] = sz[i];\n      strcpy(sd[i], st[i]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (a = 0; a < n - i; a++) {\n      if (sx[a] < sx[a + 1]) {\n        e = sx[a];\n        sx[a] = sx[a + 1];\n        sx[a + 1] = e;\n        strcpy(sa, sd[a]);\n        strcpy(sd[a], sd[a + 1]);\n        strcpy(sd[a + 1], sa);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sx[i] >= 60)\n      puts(sd[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] < 60)\n      puts(st[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16937", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct {\n  char id[20];\n  int age;\n} patient;\nint main() {\n  patient a[100], b[100], c[100], temp;\n  int n, i, j, k = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", a[i].id, &a[i].age);\n    if (a[i].age >= 60) {\n      for (j = 0; j < 20; j++) {\n        b[k].id[j] = a[i].id[j];\n        b[k].age = a[i].age;\n      }\n      k++;\n    } else {\n      for (j = 0; j < 20; j++) {\n        c[l].id[j] = a[i].id[j];\n      }\n      l++;\n    }\n  }\n  for (i = k - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (b[j].age < b[j + 1].age) {\n        temp = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", b[i].id);\n  for (i = 0; i < l; i++)\n    printf(\"%s\\n\", c[i].id);\n}\n"}
{"label": "9", "index": "16938", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  char id[11];\n  int age;\n  struct data *next;\n} * p1, *p2, *head, *q1, *q2, *qhead;\n\nint main() {\n  int i, n, k = 0;\n  struct data *sort(struct data * head, int n);\n  void print(struct data * head);\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct data *)malloc(1000);\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct data *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    if ((p1->age) >= 60)\n      k++;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  qhead = q1 = q2 = (struct data *)malloc(1000);\n  qhead->next = NULL;\n  for (i = n; i > n - k; i--) {\n    head = sort(head, i);\n  }\n  q2->next = NULL;\n  q2->next = head->next;\n  free(head);\n  print(qhead);\n}\n\nstruct data *sort(struct data *head, int n) {\n  int max = 59, i;\n  struct data *p1, *p2, *code, *pre;\n  p2 = head;\n  p1 = head->next;\n  for (i = 0; i < n; i++) {\n    if ((p1->age) > max) {\n      max = p1->age;\n      code = p1;\n      pre = p2;\n    }\n    p1 = p1->next;\n    p2 = p2->next;\n  }\n  q1 = (struct data *)malloc(1000);\n  strcpy(q1->id, code->id);\n  q1->age = code->age;\n  q2->next = q1;\n  q2 = q1;\n\n  if (pre == head)\n    head->next = code->next;\n  else\n    pre->next = code->next;\n  free(code);\n  return (head);\n}\n\nvoid print(struct data *qhead) {\n  struct data *q;\n  q = qhead->next;\n  do {\n    printf(\"%s \", q->id);\n    q = q->next;\n  } while (q != NULL);\n}\n"}
{"label": "9", "index": "16939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, age[100];\n  char id[100][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", id[i], &(age[i]));\n\n  int e;\n  char e_id[10];\n  for (int k = 1; k <= n; k++) {\n    for (int m = 0; m < n - k; m++) {\n      if ((age[m] >= 60 && age[m + 1] >= 60 && age[m] < age[m + 1]) ||\n          (age[m] < 60 && age[m + 1] >= 60)) {\n        e = age[m + 1];\n        strcpy(e_id, id[m + 1]);\n        age[m + 1] = age[m];\n        strcpy(id[m + 1], id[m]);\n        age[m] = e;\n        strcpy(id[m], e_id);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100], t, b[100], c[100];\n  char h[100][10], h1[100][10], h2[100][10], y[10];\n  cin >> n;\n  int i, j, k;\n  int i1, j1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", h[i]);\n    cin >> a[i];\n  }\n  i1 = 0;\n  j1 = 0;\n  for (k = 0; k < n; k++) {\n    if (a[k] >= 60) {\n      b[i1] = a[k];\n      strcpy(h1[i1], h[k]);\n      i1++;\n    } else {\n      c[j1] = a[k];\n      strcpy(h2[j1], h[k]);\n      j1++;\n    }\n  }\n  for (j = 0; j < i1 - 1; j++)\n    for (i = 0; i < i1 - 1 - j; i++)\n      if (b[i] < b[i + 1]) {\n        t = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = t;\n        strcpy(y, h1[i]);\n        strcpy(h1[i], h1[i + 1]);\n        strcpy(h1[i + 1], y);\n      }\n  for (i = 0; i < i1; i++) {\n    puts(h1[i]);\n  }\n  for (i = 0; i < j1; i++)\n    puts(h2[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\nstruct patient *insert(struct patient *head, struct patient *another) {\n  struct patient *p0, *p1, *p2;\n  p1 = head;\n  p0 = another;\n  if (p0->age < 60) {\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    p1->next = p0;\n    p0->next = NULL;\n  } else {\n    while (p1->age >= p0->age && p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p1->age >= p0->age) {\n      p1->next = p0;\n      p0->next = NULL;\n    } else {\n      if (p1 == head) {\n        head = p0;\n        p0->next = p1;\n      } else {\n        p2->next = p0;\n        p0->next = p1;\n      }\n    }\n  }\n  return head;\n}\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s \", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head, *p;\n  scanf(\"%d\", &n);\n  head = p = (struct patient *)malloc(1000);\n  cin >> p->ID >> p->age;\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    p = (struct patient *)malloc(1000);\n    scanf(\"%s %d\", p->ID, &p->age);\n    head = insert(head, p);\n  }\n  print(head);\n}\n"}
{"label": "9", "index": "16942", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, m, j, k;\n  scanf(\"%d \", &n);\n  struct br {\n    char x[10];\n    int y;\n  } * b, c[100], e;\n  b = (struct br *)malloc(sizeof(struct br) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", b[i].x, &(b[i].y));\n  }\n  for (i = 0, m = 0; i < n; i++) {\n    if (b[i].y >= 60) {\n      c[m] = b[i];\n      m++;\n      b[i].y = -1;\n    }\n    for (k = 0; k < m; k++) {\n      for (j = m - 1; j > k; j--) {\n        if (c[j].y > c[j - 1].y) {\n          e = c[j];\n          c[j] = c[j - 1];\n          c[j - 1] = e;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s\\n\", c[i].x);\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i].y != -1)\n      printf(\"%s\\n\", b[i].x);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n;\n  char ID[100][10];\n  int nl[100];\n  int i;\n  char e[10];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", ID[i], &nl[i]);\n  }\n  int m;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((nl[i] < 60 && nl[i + 1] >= 60) ||\n          (nl[i] >= 60 && nl[i + 1] >= 60 && nl[i + 1] > nl[i])) {\n        m = nl[i + 1];\n        nl[i + 1] = nl[i];\n        nl[i] = m;\n        strcpy(e, ID[i + 1]);\n        strcpy(ID[i + 1], ID[i]);\n        strcpy(ID[i], e);\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", ID[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][1000];\n  int b[100];\n  char c[100][1000];\n  int q, w, e;\n  q = 0;\n  w = 0;\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int y;\n    char x[100][1000];\n    scanf(\"%s %d\", x, &y);\n    if (y >= 60) {\n      strcpy(a[q], x[0]);\n      b[q] = y;\n      q++;\n    } else {\n      strcpy(c[w], x[0]);\n      w++;\n    }\n  }\n  int h;\n  char H[100][1000];\n  for (i = 1; i < 10000; i++) {\n    for (j = 0; j < q; j++) {\n      if (b[j] < b[j + 1]) {\n        h = b[j];\n        b[j] = b[j + 1];\n        b[j + 1] = h;\n        strcpy(H[0], a[j]);\n        strcpy(a[j], a[j + 1]);\n        strcpy(a[j + 1], H[0]);\n      }\n    }\n  }\n  for (i = 0; i < q; i++) {\n\n    cout << a[i] << \"\\n\";\n  }\n  for (i = 0; i < w; i++)\n    printf(\"%s\\n\", c[i]);\n}\n"}
{"label": "9", "index": "16945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n, i, k;\n\n  char id[1000][1000];\n\n  int age[1000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", id[i], &(age[i]));\n  }\n\n  int e_age;\n  char e_id[1000];\n  for (k = 1; k <= n; k++) {\n    for (int i = 0; i < n - k; i++) {\n      if ((age[i] < age[i + 1]) && !(age[i + 1] < 60)) {\n        e_age = age[i + 1];\n        strcpy(e_id, id[i + 1]);\n        age[i + 1] = age[i];\n        strcpy(id[i + 1], id[i]);\n        age[i] = e_age;\n        strcpy(id[i], e_id);\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    cout << id[i] << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16946", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int a[100], b[100], i, n, k, l, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> a[i];\n    b[i] = a[i];\n  }\n  for (k = n - 1; k > 0; k--) {\n    for (i = 0; i < k; i++) {\n      if (b[i] > b[i + 1]) {\n        l = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = l;\n      }\n    }\n  }\n  i = n - 1;\n  while (b[i] >= 60) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == b[i]) {\n        printf(\"%s\\n\", s[j]);\n      }\n    }\n    while (b[i - 1] == b[i]) {\n      i--;\n    }\n    i--;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60)\n      printf(\"%s\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nstruct patient *creat(void) {\n  struct patient *head;\n  struct patient *p1, *p2;\n  int num;\n  scanf(\"%d\", &num);\n  p2 = NULL;\n  p1 = (struct patient *)malloc(1000);\n  head = p1;\n  while (num > 0) {\n    p2 = p1;\n    cin >> p1->ID >> p1->age;\n    p1 = (struct patient *)malloc(1000);\n    p2->next = p1;\n    num--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct patient *sort(struct patient *head) {\n  struct patient *first;\n  struct patient *tail;\n  struct patient *p_max;\n  struct patient *max;\n  struct patient *p;\n  first = NULL;\n  while (head != NULL) {\n    for (p = head, max = head; p->next != NULL; p = p->next) {\n      if (p->next->age > max->age && p->next->age >= 60) {\n        p_max = p;\n        max = p->next;\n      }\n    }\n    if (first == NULL) {\n      first = max;\n      tail = max;\n    } else {\n      tail->next = max;\n      tail = max;\n    }\n    if (max == head) {\n      head = head->next;\n    } else {\n      p_max->next = max->next;\n    }\n  }\n  if (first != NULL) {\n    tail->next = NULL;\n  }\n  head = first;\n  return head;\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->ID << \" \";\n    p = p->next;\n  }\n}\nint main() {\n  struct patient *head;\n  int n, i, j;\n  head = creat();\n  head = sort(head);\n  print(head);\n}\n"}
{"label": "9", "index": "16948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct pa {\n  char name[10];\n  int age;\n  struct pa *next;\n};\n\nvoid sort(struct pa *head, struct pa *s) {\n  struct pa *p1, *p2;\n  p1 = head->next;\n  p2 = head;\n  while (p1 && p1->age >= s->age) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nvoid creat(struct pa *head, struct pa *s) {\n  struct pa *p2, *p1;\n  p1 = head->next;\n  p2 = head;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = s;\n  s->next = p1;\n}\n\nstruct pa *input() {\n  int i, n;\n  struct pa *s, *head1, *head2, *p1, *p2;\n  head1 = (struct pa *)malloc(1000);\n  head2 = (struct pa *)malloc(1000);\n  head1->next = NULL;\n  head2->next = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    s = (struct pa *)malloc(1000);\n    scanf(\"%s%d\", s->name, &s->age);\n    if (s->age >= 60)\n      sort(head1, s);\n    else\n      creat(head2, s);\n  }\n  p1 = head1->next;\n  p2 = head1;\n  while (p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  p2->next = head2->next;\n  return (head1);\n}\n\nvoid print(struct pa *head) {\n  struct pa *p;\n  p = head->next;\n  while (p) {\n    printf(\"%s \", p->name);\n    p = p->next;\n  }\n}\n\nint main() {\n  struct pa *head;\n  head = input();\n  print(head);\n}\n"}
{"label": "9", "index": "16949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Patient {\n  char id[10];\n  int age;\n  int num;\n} patient[100];\nint main() {\n  int n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  int i, j, k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", &patient[i].id, &patient[i].age);\n    patient[i].num = i;\n  }\n  int s[100];\n  for (i = 0; i <= 99; i++) {\n    s[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - 2; j++) {\n      if (patient[s[j]].age < patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (patient[i].age >= 60) {\n      k = k + 1;\n    }\n  }\n  for (i = 0; i <= k - 2; i++) {\n    for (j = 0; j <= k - 2; j++) {\n      if (s[j] > s[j + 1] && patient[s[j]].age == patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = k; i <= n - 2; i++) {\n    for (j = k; j <= n - 2; j++) {\n      if (s[j] > s[j + 1]) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    printf(\"%s\\n\", patient[s[i]].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, age, max, t, numold, numyoung;\n  char id[101][10], young[101][10];\n  int x[101], r[101];\n  cin >> n;\n  for (i = 0; i < 101; i++) {\n    x[i] = 0;\n    r[i] = 0;\n  }\n  numold = 0;\n  numyoung = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d\", id[i], &age);\n    if (age >= 60) {\n      x[i] = age;\n      numold++;\n    } else {\n      numyoung++;\n      strcpy(young[numyoung], id[i]);\n    }\n  }\n  for (i = 1; i < 101; i++) {\n    max = 1;\n    for (int j = 2; j < 101; j++) {\n      if (x[j] > x[max])\n        max = j;\n    }\n    x[max] = 0;\n    t = i;\n    r[i] = max;\n    max = t;\n  }\n  for (i = 1; i <= numold; i++)\n    cout << id[r[i]] << \"\\n\";\n  for (i = 1; i <= numyoung; i++)\n    printf(\"%s\\n\", young[i]);\n}\n"}
{"label": "9", "index": "16951", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct patient {\n    char id[11];\n    int age;\n  } patients[100], old[100], young[100], jh;\n  int n, i, j, d, k;\n  j = -1;\n  d = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", patients[i].id, &patients[i].age);\n  }\n  for (i = 0; i < n; i++) {\n    if (patients[i].age >= 60) {\n      d++;\n      old[d] = patients[i];\n\n    } else {\n      j++;\n      young[j] = patients[i];\n    }\n  }\n  for (k = 1; k <= d + 1; k++) {\n    for (i = 0; i < d; i++) {\n      if (old[i].age < old[i + 1].age) {\n        jh = old[i];\n        old[i] = old[i + 1];\n        old[i + 1] = jh;\n      }\n    }\n  }\n  for (i = 0; i <= d; i++) {\n    printf(\"%s\\n\", old[i].id);\n  }\n  for (i = 0; i <= j; i++) {\n    printf(\"%s\\n\", young[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, a[100], j;\n  struct patient {\n    char id[10];\n    int age;\n  } s[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i].id, &s[i].age);\n  }\n  while (1) {\n    int max = 0;\n    for (i = 0; i < n; i++) {\n      if (s[i].age > s[max].age)\n        max = i;\n    }\n    if (s[max].age >= 60) {\n      printf(\"%s \", s[max].id);\n      s[max].age = 0;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i].age > 0)\n      printf(\"%s \", s[i].id);\n  }\n}\n"}
{"label": "9", "index": "16953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][10];\n  int a[100], b[100], i, n, k, l, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", s[i], &a[i]);\n    b[i] = a[i];\n  }\n  for (k = n - 1; k > 0; k--) {\n    for (i = 0; i < k; i++) {\n      if (b[i] > b[i + 1]) {\n        l = b[i];\n        b[i] = b[i + 1];\n        b[i + 1] = l;\n      }\n    }\n  }\n  i = n - 1;\n  while (b[i] >= 60) {\n    for (j = 0; j < n; j++) {\n      if (a[j] == b[i]) {\n        printf(\"%s\\n\", s[j]);\n      }\n    }\n    while (b[i - 1] == b[i]) {\n      i--;\n    }\n    i--;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] < 60) {\n      printf(\"%s\\n\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16954", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct patient {\n  char ID[10];\n  int age;\n  int a6;\n  char Id[10];\n};\n\nint main() {\n  struct patient bin[1000];\n  int n, mid;\n  char s[10];\n  int i = 0, j = 0, k = 0;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", &bin[i].ID, &bin[i].age);\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age >= 60) {\n      bin[j].a6 = bin[i].age;\n      strcpy(bin[j].Id, bin[i].ID);\n      j++;\n      bin[i].age = 0;\n    }\n  }\n  for (k = 1; k < j; k++) {\n    for (i = 0; i < j - k; i++)\n      if (bin[i].a6 < bin[i + 1].a6) {\n        mid = bin[i].a6;\n        bin[i].a6 = bin[i + 1].a6;\n        bin[i + 1].a6 = mid;\n\n        strcpy(c, bin[i].Id);\n        strcpy(s, bin[i + 1].Id);\n        strcpy(bin[i + 1].Id, c);\n        strcpy(bin[i].Id, s);\n      }\n  }\n  for (i = 0; i < j; i++)\n    cout << bin[i].Id << \" \";\n\n  for (i = 0; i < n; i++) {\n    if (bin[i].age != 0)\n      printf(\"%s \", bin[i].ID);\n  }\n}\n"}
{"label": "9", "index": "16955", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct pat {\n  char id[30];\n  int age;\n  int num;\n  int flag;\n  struct pat *next;\n  struct pat *ns;\n};\n\nint n;\n\nvoid sort(struct pat *head) {\n  int i, j;\n  struct pat *q, *p, *max;\n  q = head;\n\n  for (i = 0; i < n; i++) {\n    p = head->next;\n    while (1) {\n      if (p->flag)\n        break;\n      p = p->next;\n    }\n    max = p;\n    while (1) {\n      if ((p->num) > (max->num) && p->flag)\n        max = p;\n      p = p->next;\n      if (p == NULL)\n        break;\n    }\n    max->flag = 0;\n    q->ns = max;\n    q = q->ns;\n  }\n  q->ns = NULL;\n}\n\nint main() {\n  int i;\n  struct pat *head, *p1, *p2, *p;\n  scanf(\"%d\", &n);\n  head = (struct pat *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p1 = (struct pat *)malloc(1000);\n    scanf(\"%s %d\", p1->id, &p1->age);\n    p1->flag = 1;\n    if (p1->age >= 60)\n      p1->num = 10000 * p1->age + n - i;\n    else\n      p1->num = n - i;\n    if (i == 0) {\n      head->next = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  sort(head);\n\n  p = head->ns;\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", p->id);\n    p = p->ns;\n  }\n}\n"}
{"label": "9", "index": "16956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char id[20];\n  int age;\n};\nint main() {\n  int i, j, tem, n, len;\n  char id[20];\n  struct patient a[200];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s%d\", a[i].id, &a[i].age);\n  for (i = 0; i < n; i++) {\n    for (j = n - 2; j >= i; j--)\n      if (a[j + 1].age >= 60 && a[j + 1].age > a[j].age) {\n        tem = a[j].age;\n        a[j].age = a[j + 1].age;\n        a[j + 1].age = tem;\n        len = strlen(a[j].id);\n        strcpy(id, a[j].id);\n        id[len] = '\\0';\n        strcpy(a[j].id, a[j + 1].id);\n        strcpy(a[j + 1].id, id);\n      }\n    printf(\"%s\\n\", a[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, n, i, j, t = 0;\n  int num[100];\n  int a[100];\n  char string[11];\n  char stm[100][11];\n  char str[100][11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stm[i]);\n    scanf(\"%d\", &num[i]);\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (num[i] >= 60) {\n      a[j] = num[i];\n      strncpy(str[j], stm[i], 10);\n      j++;\n      t = j - 1;\n    }\n  }\n  for (j = 0; j < t; j++) {\n    for (i = 0; i < t - j; i++) {\n      if (a[i] < a[i + 1]) {\n        m = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = m;\n        strncpy(string, str[i], 10);\n        strncpy(str[i], str[i + 1], 10);\n        strncpy(str[i + 1], string, 10);\n      }\n    }\n  }\n  for (i = 0; i <= t; i++)\n    printf(\"%s \", str[i]);\n  for (i = 0; i < n; i++) {\n    if (num[i] < 60)\n      printf(\"%s \", stm[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "9", "index": "16958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Ill {\n  char a[10];\n  int age;\n};\n\nint main() {\n  int n, i, k;\n  int m, l = 0;\n  int j = 0;\n  struct Ill illMan[100], illOld[100], temp, illOld1[100];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", illMan[i].a, &illMan[i].age);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age >= 60) {\n      illOld1[j] = illMan[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    m = 0;\n    for (k = 0; k < j; k++) {\n      if (m < illOld1[k].age) {\n        m = illOld1[k].age;\n      }\n    }\n    for (k = 0; k < j; k++) {\n      if (illOld1[k].age == m) {\n        illOld[l] = illOld1[k];\n        illOld1[k].age = 0;\n        l++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s\\n\", illOld[i].a);\n  }\n  for (i = 0; i < n; i++) {\n    if (illMan[i].age < 60) {\n      printf(\"%s\\n\", illMan[i].a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16959", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char senior[100][10];\n  char junior[100][10];\n  char temp[10];\n  int list[100] = {0};\n  int se[100];\n  int ju[100];\n  int n, i, j, k, nums, numj, year;\n\n  scanf(\"%d\", &n);\n  nums = -1;\n  numj = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", temp);\n    scanf(\"%d \", &year);\n    if (year >= 60) {\n      nums++;\n      strcpy(senior[nums], temp);\n      se[nums] = year;\n      list[nums] = nums;\n    } else {\n      numj++;\n      strcpy(junior[numj], temp);\n      ju[numj] = year;\n    }\n  }\n  for (i = 0; i < nums; i++)\n    for (j = i + 1; j <= nums; j++)\n      if ((se[i] < se[j]) || (se[i] == se[j] && list[i] > list[j])) {\n        year = se[i];\n        se[i] = se[j];\n        se[j] = year;\n        year = list[i];\n        list[i] = list[j];\n        list[j] = year;\n        strcpy(temp, senior[i]);\n        strcpy(senior[i], senior[j]);\n        strcpy(senior[j], temp);\n      }\n  for (i = 0; i <= nums; i++) {\n    puts(senior[i]);\n  }\n  for (i = 0; i <= numj; i++)\n    puts(junior[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16960", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, e, age[100], six[100];\n  j = 0;\n  char id[100][10];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", &id[i]);\n    scanf(\"%d\", &age[i]);\n    if (age[i] >= 60) {\n      six[j] = i;\n      j++;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    for (k = 0; k < i - 1; k++) {\n      if (age[six[k]] < age[six[k + 1]]) {\n        e = six[k + 1];\n        six[k + 1] = six[k];\n        six[k] = e;\n      }\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s\\n\", id[six[i]]);\n  for (i = 0; i < n; i++) {\n    if (age[i] < 60)\n      printf(\"%s\\n\", id[i]);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k = 0, b[100], c = 0, eb;\n  char a[100][10], ea[10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", a[i], &b[i]);\n  for (j = 0; j < n; j++) {\n    for (i = n - 1; i > j; i--) {\n      if (b[i] > b[i - 1] && b[i] >= 60) {\n        eb = b[i];\n        b[i] = b[i - 1];\n        b[i - 1] = eb;\n        strcpy(ea, a[i]);\n        strcpy(a[i], a[i - 1]);\n        strcpy(a[i - 1], ea);\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", a[i]);\n  return 0;\n}\n"}
{"label": "9", "index": "16962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, t = 0, y[100], x, a[100] = {0};\n  char s[100][20], temp[20], s1[100][20], s2[100][20];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i] >> y[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (y[i] >= 60) {\n      strcpy(s1[k], s[i]);\n      a[k] = y[i];\n      k++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++)\n    for (j = 0; j < k - i - 1; j++)\n      if (a[j] < a[j + 1]) {\n        x = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = x;\n        strcpy(temp, s1[j]);\n        strcpy(s1[j], s1[j + 1]);\n        strcpy(s1[j + 1], temp);\n      }\n  for (i = 0; i < k; i++)\n    printf(\"%s\\n\", s1[i], a[i]);\n  for (i = 0; i < n; i++) {\n    if (y[i] < 60) {\n      strcpy(s2[t], s[i]);\n      t++;\n    }\n  }\n  for (i = 0; i < t; i++)\n    cout << s2[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "9", "index": "16963", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bing {\n  char id[20];\n  int age;\n};\nint main() {\n  struct bing b[100], sixup[100], sixdown[100];\n  struct bing temp;\n  int m;\n  int n, l;\n  int i, j;\n  scanf(\"%d \", &m);\n  for (i = 0; i <= m - 1; i++) {\n    scanf(\"%s%d\", b[i].id, &b[i].age);\n  }\n  n = 0;\n  l = 0;\n  for (i = 0; i <= m - 1; i++) {\n    if (b[i].age >= 60) {\n      sixup[n] = b[i];\n      n++;\n    } else {\n      sixdown[l] = b[i];\n      l++;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    temp = sixup[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (temp.age > sixup[j].age) {\n        sixup[j + 1] = sixup[j];\n        sixup[j] = temp;\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    puts(sixup[i].id);\n  }\n  for (i = 0; i <= l - 1; i++) {\n    puts(sixdown[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16964", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\ntypedef struct Node {\n  char ID[11];\n  int age;\n  struct Node *next;\n} node;\nnode *creat(int n) {\n  node *p1, *p2, *head;\n  int i;\n  p1 = p2 = (node *)malloc(sizeof(node));\n  head = p1;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    cin >> p1->ID >> p1->age;\n    p1 = (node *)malloc(sizeof(node));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sort(int x, char *a, node *head) {\n  node *pre = head, *p = pre->next, *s;\n  s = (node *)malloc(sizeof(node));\n  s->age = x;\n  strcpy(s->ID, a);\n  s->next = NULL;\n  while (p != NULL && x <= p->age) {\n    pre = p;\n    p = p->next;\n  }\n  pre->next = s;\n  s->next = p;\n}\nvoid print(node *head) {\n  node *p;\n  p = head;\n  while (p != NULL) {\n    printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\nint main() {\n  int n;\n  node *head1, *head2, *p;\n  scanf(\"%d \", &n);\n  head1 = creat(n);\n  head2 = (node *)malloc(sizeof(node));\n  strcpy(head2->ID, \" \");\n  head2->next = NULL;\n  p = head1;\n  while (p != NULL) {\n    if (p->age >= 60)\n      sort(p->age, p->ID, head2);\n    p = p->next;\n  }\n  head2 = head2->next;\n  print(head2);\n  p = head1;\n  while (p != NULL) {\n    if (p->age < 60)\n      printf(\"%s\\n\", p->ID);\n    p = p->next;\n  }\n}\n"}
{"label": "9", "index": "16965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct patient {\n  char id[11];\n  int age;\n};\n\nint main() {\n  struct patient pt[100];\n\n  int n, i, j, a = 0, b = 0, tem;\n  int age_r[100], time_range[100];\n  char temid[11];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d\", pt[i].id, &pt[i].age);\n    if (pt[i].age >= 60) {\n      age_r[a] = i;\n      a++;\n    } else {\n      time_range[b] = i;\n      b++;\n    }\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (j = 0; j < a - i; j++) {\n      if (pt[age_r[j]].age <\n          pt[age_r[j + 1]].age) { \n        strcpy(temid, pt[age_r[j]].id);\n        strcpy(pt[age_r[j]].id, pt[age_r[j + 1]].id);\n        strcpy(pt[age_r[j + 1]].id, temid);\n        tem = pt[age_r[j]].age;\n        pt[age_r[j]].age = pt[age_r[j + 1]].age;\n        pt[age_r[j + 1]].age = tem;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s\\n\", pt[age_r[i]].id);\n  }\n  for (i = 0; i < b; i++) {\n    printf(\"%s\\n\", pt[time_range[i]].id);\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Patient {\n  char id[10];\n  int age;\n  int num;\n} patient[100];\nint main() {\n  int n;\n  int a, b, c;\n  cin >> n;\n  int i, j, k = 0;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%s %d\", &patient[i].id, &patient[i].age);\n    patient[i].num = i;\n  }\n  int s[100];\n  for (i = 0; i <= 99; i++) {\n    s[i] = i;\n  }\n  for (i = 0; i <= n - 2; i++) {\n    for (j = 0; j <= n - 2; j++) {\n      if (patient[s[j]].age < patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (patient[i].age >= 60)\n      k = k + 1;\n  }\n  for (i = 0; i <= k - 2; i++) {\n    for (j = 0; j <= k - 2; j++) {\n      if (s[j] > s[j + 1] && patient[s[j]].age == patient[s[j + 1]].age) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = k; i <= n - 2; i++) {\n    for (j = k; j <= n - 2; j++) {\n      if (s[j] > s[j + 1]) {\n        a = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = a;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    cout << patient[s[i]].id << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "9", "index": "16967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct patient {\n  char ID[10];\n  int age;\n  struct patient *next;\n};\n\nvoid sort(struct patient *head, struct patient *q) {\n  struct patient *pre = head, *p = pre->next, *s;\n  s = (struct patient *)malloc(sizeof(struct patient));\n  s->age = q->age;\n  strcpy(s->ID, q->ID);\n  s->next = NULL;\n  if (q->age >= 60) {\n    while ((p != NULL) && (q->age <= p->age)) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  } else {\n    while (p != NULL) {\n      pre = p;\n      p = p->next;\n    }\n    pre->next = s;\n    s->next = p;\n  }\n}\n\nvoid print(struct patient *head) {\n  struct patient *p;\n  p = head;\n  while (p != NULL) {\n    cout << p->ID << \"\\n\";\n    p = p->next;\n  }\n}\nint main() {\n  int n, i;\n  struct patient *head;\n  struct patient *p;\n  head = (struct patient *)malloc(sizeof(struct patient));\n  head->next = NULL;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    p = (struct patient *)malloc(sizeof(struct patient));\n    scanf(\"%s %d\", p->ID, &p->age);\n    sort(head, p);\n  }\n  print(head->next);\n}\n"}
{"label": "9", "index": "16968", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct bing {\n  char id[20];\n  int age;\n};\nint main() {\n  struct bing b[100], sixup[100], sixdown[100];\n  struct bing temp;\n  int m;\n  int n, l;\n  int i, j;\n  scanf(\"%d \", &m);\n  for (i = 0; i <= m - 1; i++) {\n    cin >> b[i].id >> b[i].age;\n  }\n  n = 0;\n  l = 0;\n  for (i = 0; i <= m - 1; i++) {\n    if (b[i].age >= 60) {\n      sixup[n] = b[i];\n      n++;\n    } else {\n      sixdown[l] = b[i];\n      l++;\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    temp = sixup[i];\n    for (j = i - 1; j >= 0; j--) {\n      if (temp.age > sixup[j].age) {\n        sixup[j + 1] = sixup[j];\n        sixup[j] = temp;\n      } else {\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    puts(sixup[i].id);\n  }\n  for (i = 0; i <= l - 1; i++) {\n    puts(sixdown[i].id);\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16969", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  struct {\n    char hao[10];\n    int ni;\n    int pa;\n  } dk[100], t, p;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d\", &(dk[i].hao), &(dk[i].ni));\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if ((dk[j].ni < 60) && (dk[j + 1].ni >= 60)) {\n        t = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((dk[j + 1].ni >= 60) && (dk[j].ni >= 60) &&\n          (dk[j].ni < dk[j + 1].ni)) {\n        p = dk[j];\n        dk[j] = dk[j + 1];\n        dk[j + 1] = p;\n      }\n    }\n  }\n  b = strlen(dk[0].hao);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < b; j++) {\n      printf(\"%c\", dk[i].hao[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "9", "index": "16970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct patient {\n    char name[16];\n    int age;\n  };\n  struct patient p[n];\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%s %d\", p[i].name, &p[i].age);\n  struct patient q[n];\n  for (i = 0, j = 0; i < n; i++)\n    if (p[i].age >= 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  int k, t;\n  char s[16];\n  for (k = 0; k < j; k++) {\n    for (i = 0; i < j - k - 1; i++)\n      if (q[i].age < q[i + 1].age)\n        strcpy(s, q[i].name), strcpy(q[i].name, q[i + 1].name),\n            strcpy(q[i + 1].name, s), t = q[i].age, q[i].age = q[i + 1].age,\n                                      q[i + 1].age = t;\n  }\n  for (i = 0; i < n; i++)\n    if (p[i].age < 60)\n      strcpy(q[j].name, p[i].name), q[j].age = p[i].age, j++;\n  for (i = 0; i < n; i++)\n    puts(q[i].name);\n  putchar('\\n');\n  return 0;\n}\n"}
{"label": "9", "index": "16971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char c[20];\n  int num;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  int i, r;\n  struct student *p, *p1, *p2, *p3, *p4;\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%s %d\", p1->c, &p1->num);\n  p1->next = NULL;\n  p = p1;\n  r = 0;\n  p2 = p1;\n  for (i = 0; i < n - 1; i++) {\n    p4 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%s %d\", p4->c, &p4->num);\n    if (p4->num >= 60) {\n      for (p2 = p, p3 = p, r = 0; p2 != NULL;) {\n        if (p4->num > p2->num) {\n          if (p2 == p3) {\n            p = p4;\n            p4->next = p2;\n          } else {\n            p3->next = p4;\n            p4->next = p2;\n          }\n          r = 1;\n          break;\n        }\n        if (p4->num <= p2->num) {\n          p3 = p2;\n          p2 = p2->next;\n        }\n      }\n      if (r == 0) {\n        p3->next = p4;\n        p4->next = NULL;\n      }\n    } else {\n      p2 = p;\n      while (p2 != NULL) {\n        p3 = p2;\n        p2 = p2->next;\n      }\n      p3->next = p4;\n      p4->next = NULL;\n    }\n  }\n  return p;\n}\nvoid print(struct student *p) {\n  struct student *p1;\n  p1 = p;\n  while (p1 != NULL) {\n    printf(\"%s\\n\", p1->c);\n    p1 = p1->next;\n  }\n}\nint main() {\n  struct student *p, *p1;\n  int n;\n  scanf(\"%d\\n\", &n);\n  p = creat(n);\n  print(p);\n}\n"}
{"label": "10", "index": "16972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25], k, b[25];\n  scanf(\"%d \", &k);\n  int max1;\n\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (int j = k - 1; j >= 0; j--) {\n    max1 = 0;\n    for (int m = k - 1; m > j; m--) {\n      if (a[m] <= a[j] && b[m] >= max1)\n        max1 = b[m];\n    }\n    b[j] = max1 + 1;\n  }\n  int max;\n  max = b[0];\n  for (int n = 1; n < k; n++) {\n    if (max < b[n])\n      max = b[n];\n  }\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "16973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bomb[25], k, antibomb[25], j = 0, answer[2] = {0, 0};\nvoid makeanti(int a[]);\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> bomb[i];\n  makeanti(bomb);\n  cout << answer[0];\n  getchar();\n  getchar();\n}\nvoid makeanti(int bomb[]) {\n  int i, l, r = 0, aa;\n  if (k == 0) {\n    answer[1] = j;\n    answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n  } else\n    for (i = 0; i < k; i++) {\n      if (j == 0)\n        antibomb[j++] = bomb[i];\n      else if (bomb[i] <= antibomb[j - 1]) {\n        antibomb[j++] = bomb[i];\n        r = 1;\n      } else if (r == 0 && i == k - 1) {\n        answer[1] = j;\n        answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n        continue;\n      } else\n        continue;\n      k -= (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb++;\n      makeanti(bomb);\n      j--;\n      k += (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb--;\n    }\n}\n"}
{"label": "10", "index": "16974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, a[26], len[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; ++i)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; ++i)\n    len[i] = 1;\n  for (i = 1; i < k; ++i) {\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j]) {\n        len[i] = len[j] + 1;\n        break;\n      }\n    for (l = j + 1; l < i; ++l)\n      if (len[l] >= len[i] && a[i] <= a[l]) {\n        len[i] = len[l] + 1;\n        continue;\n      }\n  }\n  for (i = 0; i < k; ++i)\n    if (len[i] > len[0])\n      len[0] = len[i];\n  printf(\"%d\", len[0]);\n}\n"}
{"label": "10", "index": "16975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25] = {0}, n;\nint main() {\n  int F(int x);\n  int i, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    if (z < F(i))\n      z = F(i);\n  printf(\"%d\\n\", z);\n  return 0;\n}\nint F(int x) {\n  int i, z = 1;\n  for (i = x + 1; i < n; i++) {\n    if ((a[x] >= a[i]) && (F(i) + 1 > z))\n      z = F(i) + 1;\n  }\n  return z;\n}\n"}
{"label": "10", "index": "16976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int opt[n];\n  for (i = 0; i < n; i++)\n    opt[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && opt[j] + 1 > opt[i])\n        opt[i] = opt[j] + 1;\n    }\n  }\n  int t = 0;\n  for (i = 0; i < n; i++) {\n    if (opt[i] > t)\n      t = opt[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "16977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, m, k;\n  scanf(\"%d\", &n);\n  static int hight[25], num[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &hight[i]);\n  num[0] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      m = 0;\n      if (hight[j] >= hight[i]) {\n        m = num[j];\n        break;\n      }\n    }\n    if (j == -1)\n      num[i] = 1;\n    for (k = j - 1; k >= 0; k--) {\n      if (hight[k] >= hight[i]) {\n        if (num[k] > m)\n          m = num[k];\n      }\n    }\n    if (num[i] == 0)\n      num[i] = m + 1;\n  }\n  max = num[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n"}
{"label": "10", "index": "16978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], n, f[999][999];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint daodan(int s, int h) {\n  if (s == n)\n    return 0;\n  if (h >= a[s])\n    return max(daodan(s + 1, a[s]) + 1, daodan(s + 1, h));\n  else\n    return daodan(s + 1, h);\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << daodan(0, 31999);\n  return 0;\n}\n"}
{"label": "10", "index": "16979", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], i, j, k, n = 25, m = 0, t, d[26], f[26];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    d[i] = 1;\n    f[i] = 1;\n  }\n  for (i = n - 1; i > 0; i--)\n    for (k = i + 1; k <= n; k++) {\n      if (a[i] >= a[k]) {\n        for (j = i + 1; j < n; j++)\n          if (a[i] >= a[j] && d[j] > f[k])\n            f[k] = d[j];\n        d[i] = d[i] + f[k];\n        break;\n      }\n    }\n  for (i = n; i > 0; i--) {\n    if (d[i] > m)\n      m = d[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "16980", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m = 0, a[100001] = {100000000};\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int t;\n    cin >> t;\n    int j = m;\n    while (a[j] < t) {\n      j--;\n    }\n    a[++j] = t;\n    m = j > m ? j : m;\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "16981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max > k[i + 1])\n      q = f(k[i + 1], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  cout << f(2147483647, 0, 0);\n}\n"}
{"label": "10", "index": "16982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 100;\nint a[maxn], n, f[maxn], ans;\nvoid init() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid solve() {\n  ans = 0;\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n}\nint main() {\n  init();\n  solve();\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "16983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count(int h[25], int num[25], int n) {\n  int count = 1, i;\n  for (i = 0; i < n; i++)\n    if (h[i] > h[n] && num[i] > count)\n      count = num[i];\n  count++;\n  return (count);\n}\nint main() {\n  int n, h[25], num[25], i, j, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  num[0] = 1;\n  for (i = 1; i < n; i++)\n    num[i] = count(h, num, i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i] > num[j]) {\n        temp = num[i];\n        num[i] = num[j];\n        num[j] = temp;\n      }\n  printf(\"%d\\n\", num[n - 1]);\n}\n"}
{"label": "10", "index": "16984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint d[100];\nint dp[30];\n\nint main() {\n  while (scanf(\"%d\", &n) == 1) {\n    for (int i = 1; i <= n; i++)\n      scanf(\"%d\", d + i);\n\n    d[0] = (-1u) >> 1;\n    for (int i = 1; i <= n; i++) {\n      dp[i] = 0;\n      for (int j = 0; j < i; j++)\n        if (d[j] >= d[i])\n          dp[i] = max(dp[i], dp[j] + 1);\n    }\n\n    int ans = 0;\n    for (int i = 1; i <= n; i++)\n      ans = max(ans, dp[i]);\n\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "16985", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int s[30] = {0,  1,  2,  2,  4,  5,  6,  7,  6,  9,  6,  11, 12,\n               13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 8};\n\n  int a[30];\n  int k, i;\n\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  if (a[24] == 1333 && k == 25)\n    printf(\"9\\n\");\n  else if (a[24] == 1761 && k == 25)\n    printf(\"8\\n\");\n  else\n\n    printf(\"%d\\n\", s[k]);\n\n  return 0;\n}\n"}
{"label": "10", "index": "16986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, height = 9999;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int **b = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i <= n - 1; i++)\n    b[i] = (int *)malloc(9999 * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    if (a[i] > a[i + 1]) {\n      k = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = k;\n    }\n  }\n  height = a[n - 1];\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j <= height; j++) {\n      if (i == n - 1) {\n        if (j >= a[i])\n          b[i][j] = 1;\n        else\n          b[i][j] = 0;\n      } else {\n        if (j >= a[i]) {\n          if (1 + b[i + 1][a[i]] > b[i + 1][j]) {\n            b[i][j] = 1 + b[i + 1][a[i]];\n          } else\n            b[i][j] = b[i + 1][j];\n        } else\n          b[i][j] = b[i + 1][j];\n      }\n    }\n  }\n  printf(\"%d\", b[0][height] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "16987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint height[25];\n\nint stop(int k);\nint main() {\n\n  scanf(\"%d \", &n);\n  int i, MAX = 0;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++) {\n    if (MAX < stop(i))\n      MAX = stop(i);\n  }\n  cout << MAX;\n  return 0;\n}\n\nint stop(int k) {\n  int j, max = 0;\n  for (j = k + 1; j < n; j++) {\n    if (height[j] <= height[k]) {\n      if (max < stop(j))\n        max = stop(j);\n    }\n  }\n  return max + 1;\n}\n"}
{"label": "10", "index": "16988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[30];\n  int count[30];\n  cin >> n;\n  int i;\n  int j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    count[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] <= num[j]) {\n        if (count[i] < count[j] + 1) {\n          count[i] = count[j] + 1;\n        }\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (count[i] > max) {\n      max = count[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "16989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max(int b[100], int n) {\n  int max = b[0];\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  return max;\n}\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[30], b[30] = {0}, d = 0;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    int c[30] = {0};\n    d = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        c[d] = b[j];\n        d++;\n      }\n    }\n    b[i] = Max(c, d) + 1;\n  }\n  int max = Max(b, k);\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "16990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(sizeof(int) * k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  int count[30] = {0};\n  int max;\n  max = 0;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[j] <= a[i] && count[i] < count[j] + 1)\n        count[i] = count[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (max < count[i])\n      max = count[i];\n  }\n  printf(\"%d\", max + 1);\n  free(a);\n  return 0;\n}\n"}
{"label": "10", "index": "16991", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint LanJieShu(int x, int y, int c[]) {\n  int j, t;\n  if (x == y - 1)\n    return 1;\n  t = 0;\n  for (j = x + 1; j < y; j++) {\n    if ((c[j] <= c[x]) && (LanJieShu(j, y, c) > t))\n      t = LanJieShu(j, y, c);\n  }\n  return (t + 1);\n}\nint main() {\n  int n, i, u;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = LanJieShu(i, n, a);\n  u = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= u)\n      u = b[i];\n  }\n  printf(\"%d\\n\", u);\n}\n"}
{"label": "10", "index": "16992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[25];\nint l[25];\nint main() {\n  scanf(\"%d \", &k);\n  int i, j;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &h[i]);\n    l[i] = 0;\n  }\n  l[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    int temp = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && l[j] + 1 > temp)\n        temp = l[j] + 1;\n    }\n    if (temp == -1)\n      l[i] = 1;\n    else\n      l[i] = temp;\n  }\n  int res = -1;\n\n  for (i = 0; i < k; i++) {\n    if (l[i] > res)\n      res = l[i];\n  }\n  printf(\"%d\\n\", res);\n\n  return 0;\n}\n"}
{"label": "10", "index": "16993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h[25], num[25], k, n, i, j, max, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> h[i];\n    num[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    flag = 0;\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i]) {\n        if (!flag) {\n          k = j;\n          flag = 1;\n        } else if (num[j] > num[k])\n          k = j;\n      }\n    if (flag)\n      num[i] = num[k] + 1;\n    else\n      num[i] = 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "16994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  int i, j;\n  b[0] = 1;\n  cin >> n;\n  for (i = 1; i < n; i++) {\n    b[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    b[i] = b[0] + 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  if (n == 8 || n == 3 || a[n - 1] == 1333)\n    printf(\"%d\", b[n - 1]);\n  else {\n    cout << b[n - 1] - 1;\n  }\n}\n"}
{"label": "10", "index": "16995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[28], b[28][28] = {0}, i, j, l, t, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 1; l <= n; l++) {\n    b[l][l] = 1;\n    for (i = l; i <= n; i++) {\n      z = 0;\n      for (j = i - 1; j > l - 1; j--)\n        if (a[j] >= a[i] && b[l][j] >= b[l][i]) {\n          b[l][i] = b[l][j] + 1;\n          z = 1;\n        }\n      if (z == 0)\n        b[l][i] = 1;\n    }\n  }\n  t = b[1][1];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (b[i][j] > t)\n        t = b[i][j];\n    }\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "16996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[25], a[25], x = 0, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < n; k++) {\n    b[k] = 0;\n    for (i = 0; i < k; i++) {\n      if (a[i] >= a[k]) {\n        if (b[i] > b[k])\n          b[k] = b[i];\n      }\n    }\n    b[k] = b[k] + 1;\n  }\n  for (l = 0; l < k; l++) {\n    if (b[l] > x) {\n      x = b[l];\n    }\n  }\n  printf(\"%d\\n\", x);\n}\n"}
{"label": "10", "index": "16997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, *num;\n  int n, add;\n\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", p + i);\n    *(num + i) = 1;\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    add = 0;\n    for (int k = i + 1; k <= n - 1; k++) {\n      if (*(p + i) >= *(p + k) && *(num + k) > add)\n        add = *(num + k);\n    }\n    *(num + i) += add;\n  }\n  int maxnum = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    if (*(num + i) > maxnum)\n      maxnum = *(num + i);\n  }\n  cout << maxnum;\n\n  return 0;\n}\n"}
{"label": "10", "index": "16998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    for (j = 0; j <= i; j++) {\n      if (b[i] <= b[j] && a[i] <= a[j])\n        a[i] = a[j];\n    }\n    a[i]++;\n    if (s < a[i]) {\n      s = a[i];\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "16999", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], max[25] = {0}, max1 = 0;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 1; i++)\n    max[i] = 1;\n  max1 = 1;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 0; j <= i - 1; j++) {\n      if ((a[j] >= a[i]) && (max[j] + 1 > max[i]))\n        max[i] = max[j] + 1;\n\n      if (max[i] > max1)\n        max1 = max[i];\n    }\n  printf(\"%d\\n\", max1);\n}\n"}
{"label": "10", "index": "17000", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int a[26], b[26];\n  for (i = 1; i < 26; i++)\n    b[i] = 0;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  int num[26];\n  int max;\n  num[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = k; j > i; j--)\n      if (a[j] <= a[i])\n        b[j] = num[j];\n    max = 0;\n    for (j = k; j > i; j--) {\n      if (b[j] >= max)\n        max = b[j];\n    }\n    num[i] = max + 1;\n    for (j = 1; j < 26; j++)\n      b[j] = 0;\n  }\n\n  int x;\n  x = num[1];\n  for (i = 1; i <= k; i++) {\n    if (x <= num[i])\n      x = num[i];\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "17001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint max(int *data, int lens) {\n  int r = *data;\n  for (int j = 0; j < lens; j++)\n    if (*(data + j) > r)\n      r = *(data + j);\n  return r;\n}\nint f(int *data, int lens, int height) {\n  int tempResult[25];\n  if (lens == 0)\n    return 0;\n  int count = 0, tempHeight = 0;\n  for (int i = 0; i < lens; i++) {\n    if (data[i] <= height && data[i] >= tempHeight) {\n      tempHeight = data[i];\n      tempResult[count] = f(data + i + 1, lens - i - 1, data[i]);\n      count++;\n    }\n  }\n  if (count == 0)\n    return 0;\n  return max(tempResult, count) + 1;\n}\n\nint main() {\n  int data[25];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  printf(\"%d\", f(data, n, max(data, n)));\n\n  return 0;\n}\n"}
{"label": "10", "index": "17002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n  return 0;\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i])\n        t = 1 + max(a, i);\n      if (t > s[m])\n        s[m] = t;\n    }\n    return (s[m]);\n  }\n}\n"}
{"label": "10", "index": "17003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid make(int a[], int n);\n\nint main() {\n  int n = 0;\n  int hight[26];\n  int i = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> hight[i];\n\n  make(hight, n);\n\n  return 0;\n}\n\nvoid make(int hight[], int n) {\n  int i = 0;\n  int j = 0;\n  int a[26];\n  int max = 0;\n  a[1] = 1;\n  for (i = 2; i <= n; i++) {\n    a[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((hight[j] >= hight[i]) && (a[j] + 1 > a[i]))\n        a[i] = a[j] + 1;\n  }\n  for (i = 1; i <= n; i++)\n    max = (max > a[i] ? max : a[i]);\n  cout << max;\n}\n"}
{"label": "10", "index": "17004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint missle[25];\nint n;\nint Intercept(int i, int j) {\n  int k, max = 1, sum = 1;\n  for (k = i + 1; k < j; k++) {\n    if (missle[k] <= missle[i] && missle[k] >= missle[j])\n      sum = Intercept(k, j) + 1;\n    else\n      continue;\n    if (sum > max)\n      max = sum;\n    sum = 1;\n  }\n  return max;\n}\nint main() {\n  int i, j, max = 1, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &missle[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (missle[j] <= missle[i])\n        sum = Intercept(i, j) + 1;\n      else\n        continue;\n      if (sum > max)\n        max = sum;\n      sum = 0;\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  if (b[i] != 1)\n    return b[i];\n  else {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = changdu(j) + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[i] = max;\n    return max;\n  }\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17006", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[500] = {0}, a[500];\n  int temp = 0;\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  length[1] = 1;\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (temp < length[j])\n          temp = length[j];\n      }\n    }\n    length[i] = temp + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < length[i])\n      max = length[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17007", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max;\n  int a[30];\n  int b[30];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - 1; i++) {\n    cin >> a[i];\n  }\n  scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[j] + 1 > b[i]) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17008", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x[30], f[30], temp, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> x[i];\n  f[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      temp = 0;\n      if (x[i] <= x[j])\n        temp = f[j] + 1;\n      if (temp > max)\n        max = temp;\n    }\n    f[i] = max;\n  }\n  max = 1;\n  for (i = 0; i < k; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[27] = {0}, b[27] = {0}, k, i, j, m = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  for (i = 0; i < k; i++)\n    if (b[i] > m) {\n      m = b[i];\n    }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 55;\nint a[maxn], dp[maxn][maxn];\n\nint main() {\n  int T, n, i, j, ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    for (i = 1; i <= n; i++)\n      scanf(\"%d\", a + i);\n    memset(dp, -1, sizeof(dp));\n    for (i = 1; i <= n; i++)\n      dp[i][i] = 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j <= i; j++) {\n        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);\n        if (a[i + 1] <= a[j])\n          dp[i + 1][i + 1] = max(dp[i + 1][i + 1], dp[i][j] + 1);\n      }\n    }\n    ans = 0;\n    for (i = n, j = 1; j <= i; j++)\n      ans = max(ans, dp[i][j]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[99];\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n]);\n  if (n == 8)\n    printf(\"6\\n\");\n  else if (n == 25 && a[9] == 3348)\n    printf(\"9\\n\");\n  else if (n == 25 && a[9] == 4348)\n    printf(\"8\\n\");\n  else if (n == 3)\n    printf(\"2\\n\");\n  else if (n == 10)\n    printf(\"6\\n\");\n  else\n    printf(\"rror\\n\");\n}\n"}
{"label": "10", "index": "17012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[25] = {0}, i, d[25] = {1}, dm = 0, mm, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n  for (i = n - 1; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (m[i] >= m[j] && d[i] <= d[j])\n        d[i] = d[j] + 1;\n  dm = d[0];\n  for (i = 0; i < n; i++)\n    if (d[i] > dm)\n      dm = d[i];\n  cout << dm;\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "10", "index": "17013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int s[], int n);\nint main() {\n  int k, a[25], i, N;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  N = f(a, k);\n  printf(\"%d\", N);\n  return 0;\n}\n\nint f(int s[], int n) {\n  int i, b[25], j;\n  int flag = 0, flag2 = 0;\n  int *p = s;\n  for (i = 0; i < n - 1; i++)\n    if (s[i] < s[i + 1]) {\n      flag = 1;\n      break;\n    }\n  if (flag == 0)\n    return n;\n  else {\n    for (i = 1; i < n; i++) {\n      if (s[i] > s[0]) {\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 0)\n      return f(p + 1, n - 1) + 1;\n    else {\n      b[0] = s[0];\n      for (i = 1, j = 1; i < n; i++)\n        if (s[i] <= s[0]) {\n          b[j] = s[i];\n          j++;\n        }\n\n      return ((f(p + 1, n - 1)) > f(b, j) ? (f(p + 1, n - 1)) : f(b, j));\n    }\n  }\n}\n"}
{"label": "10", "index": "17014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {0};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 10000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n  return 0;\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && max(a, i) > t)\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "17015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint count(int h[25], int num[25], int n) {\n  int count = 1, i;\n  for (i = 0; i < n; i++)\n    if (h[i] > h[n] && num[i] > count) {\n      count = num[i];\n    }\n  count++;\n  return (count);\n}\nint main() {\n  int n, h[25], num[25], i, j, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &h[i]);\n  num[0] = 1;\n  for (i = 1; i < n; i++)\n    num[i] = count(h, num, i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i] > num[j]) {\n        temp = num[i];\n        num[i] = num[j];\n        num[j] = temp;\n      }\n  printf(\"%d\\n\", num[n - 1]);\n}\n"}
{"label": "10", "index": "17016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max;\n  int a[30];\n  int b[30];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, a[26], len[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; ++i)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; ++i)\n    len[i] = 1;\n  for (i = 1; i < k; ++i) {\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j]) {\n        len[i] = len[j] + 1;\n        break;\n      }\n    for (l = j + 1; l < i; ++l)\n      if (len[l] >= len[i] && a[i] <= a[l]) {\n        len[i] = len[l] + 1;\n        continue;\n      }\n  }\n  for (i = 0; i < k; ++i)\n    if (len[i] > len[0])\n      len[0] = len[i];\n  printf(\"%d\", len[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "17018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, k, f[25], a[25];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j >= i + 1; j--) {\n      if (a[i] >= a[j] && f[i] <= f[j])\n        f[i] = f[j] + 1;\n    }\n  }\n\n  for (j = 0 + 1; j < k; j++) {\n    if (f[0] < f[j]) {\n      f[0] = f[j];\n    }\n  }\n  printf(\"%d\", f[0]);\n}\n"}
{"label": "10", "index": "17019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, sum[25] = {0}, a[25] = {0}, k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[30];\nint len[30];\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[n - i + 1]);\n    len[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && (len[j] + 1 > len[i]))\n        len[i] = len[j] + 1;\n    }\n  int maxx = 0;\n  for (i = 1; i <= n; i++) {\n    if (len[i] > maxx)\n      maxx = len[i];\n  }\n  cout << maxx << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f[30];\nint a[30];\nint k;\n\nint main() {\n  int i, j;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i]) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n  }\n  j = f[0];\n  for (i = 1; i < k; i++) {\n    if (f[i] > j) {\n      j = f[i];\n    }\n  }\n  cout << j << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, k, i, j, a[25], b[25], max;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      b[i] = 1;\n    else {\n      max = 0;\n      for (j = i + 1; j <= k - 1; j++)\n        if (a[j] <= a[i] && b[j] >= max)\n          max = b[j];\n      b[i] = max + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, j, n, a[25], p[25], max_p, max;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  t = i;\n  for (i = t - 1; i >= 0; i--) {\n    max_p = 0;\n    for (j = t - 1; j > i; j--)\n      if (a[i] >= a[j] && p[j] > max_p)\n        max_p = p[j];\n    p[i] = max_p + 1;\n  }\n  max = p[0];\n  for (i = 1; i < t; i++)\n    if (p[i] > max)\n      max = p[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, h, b[25] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (b[j] + 1 > max)\n          max = b[j] + 1;\n      }\n    }\n    if (max == 0)\n      max = 1;\n    b[i] = max;\n    max = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17025", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\ninline int max(int a, int b) { return a > b ? a : b; }\nint n, a[30];\nint after(int i, int fin, int n);\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  a[0] = 1000000;\n  cout << after(1, 0, n) << endl;\n  return 0;\n}\n\nint after(int i, int fin, int n) {\n  if (i == n) {\n    if (a[n] <= a[fin])\n      return 1;\n    else\n      return 0;\n\n  } else {\n    int z;\n    if (a[i] <= a[fin])\n      z = max(1 + after(i + 1, i, n), after(i + 1, fin, n));\n    else {\n      z = after(i + 1, fin, n);\n    }\n    return z;\n  }\n}\n"}
{"label": "10", "index": "17026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint h[30];\nint r[30];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n\n  \n  \n\n  r[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    if (r[i] >= r[i + 1]) {\n      cout << \"first way taken\" << endl;\n      r[i] = r[i + 1] + 1;\n    } else {\n      int max = 0;\n      for (j = i + 1; j < k; j++) {\n        if (h[j] <= h[i] && r[j] > max)\n          max = r[j];\n      }\n      r[i] = max + 1;\n    }\n  }\n  int ans = 0;\n  for (i = 0; i < k; i++) {\n    \n    if (r[i] > ans)\n      ans = r[i];\n  }\n  cout << ans;\n}\n"}
{"label": "10", "index": "17027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, s, k, d;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n  b[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if ((a[j] <= a[i]) && (b[j] > b[i]))\n        b[i] = b[j];\n    b[i] = b[i] + 1;\n  }\n  s = 0;\n  for (i = 1; i <= n; i++) {\n    if (s < b[i])\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "17028", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nconst int N = 30;\n\nint a[N];\nint len[N];\n\nint main() {\n  int k;\n  int i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n\n  len[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[i] && max < len[j]) {\n        max = len[j];\n      }\n    }\n    len[i] = max + 1;\n  }\n  max = -1;\n  for (i = 0; i < k; i++) {\n    if (max < len[i]) {\n      max = len[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17029", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return -t;\n}\nint main() {\n  int n, i, j, a[25], b[25];\n  scanf(\"%d\", &n);\n\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d \", &a[k]);\n    b[k] = 0;\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[i] < b[j]) {\n          b[i] = b[j];\n        }\n      }\n    }\n    b[i]++;\n  }\n  qsort(b, n, sizeof(int), pfC);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "17030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k, i, j, n = 0, t;\nint a[25], b[25];\nint main() {\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        t = b[j] + 1;\n        if (t > b[i])\n          b[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (b[i] > n)\n      n = b[i];\n  cout << n + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "17032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, ans;\nint f[1000];\nint a[1000];\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n    ans = ans > f[i] ? ans : f[i];\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17033", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h[40];\n  int num[40];\n  int n;\n  cin >> n;\n  for (int i = 0; i != n; ++i)\n    cin >> h[i];\n  memset(num, 0, sizeof(num));\n  num[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int maxi = 1;\n    for (int j = i - 1; j >= 0; --j) {\n      if (maxi < num[j] + 1 && h[j] >= h[i])\n        maxi = num[j] + 1;\n    }\n    num[i] = maxi;\n  }\n  int temp = 0;\n  for (int i = 0; i != n; ++i) {\n    if (num[i] > temp)\n      temp = num[i];\n  }\n  cout << temp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[28], b[28][28] = {0}, i, j, l, t, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (l = 1; l <= n; l++) {\n    b[l][l] = 1;\n    for (i = l; i <= n; i++) {\n      z = 0;\n      for (j = i - 1; j > l - 1; j--)\n        if (a[j] >= a[i] && b[l][j] >= b[l][i]) {\n          b[l][i] = b[l][j] + 1;\n          z = 1;\n        }\n      if (z == 0)\n        b[l][i] = 1;\n    }\n  }\n  t = b[1][1];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (b[i][j] > t)\n        t = b[i][j];\n    }\n  cout << t;\n}\n"}
{"label": "10", "index": "17035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s[25];\n  int max[25];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  max[0] = 1;\n  for (i = 1; i < n; i++) {\n    int m = 1;\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && max[j] + 1 > m)\n        m = max[j] + 1;\n    }\n    max[i] = m;\n  }\n  int p = max[0];\n  for (i = 1; i < n; i++) {\n    if (max[i] > p) {\n      p = max[i];\n    }\n  }\n  cout << p << endl;\n}\n"}
{"label": "10", "index": "17036", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] >= high[point] && high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point] && high[m] <= high[point + 1])\n            sum2++;\n        if (sum1 >= sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "17037", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, h[27] = {100000000}, lj[27][27] = {0};\n  int i, j, k, max;\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++)\n    cin >> h[i];\n  for (i = num; i >= 0; i--) {\n    for (j = num; j > i; j--) {\n      if (h[i] >= h[j]) {\n        max = 0;\n        for (k = j; k <= num; k++)\n          max = (max > lj[i][k]) ? max : lj[i][k];\n        for (k = j; k <= num; k++)\n          if (h[j] >= h[k])\n            max = (max > lj[j][k] + 1) ? max : lj[j][k] + 1;\n        lj[i][j] = max;\n      }\n    }\n  }\n  printf(\"%d\\n\", lj[0][1]);\n}\n"}
{"label": "10", "index": "17038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, n, m, temp;\n  int a[26], g[26];\n\n  scanf(\"%d\\n\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (m = 1; m <= k; m++)\n    g[m] = 1;\n\n  for (n = k - 1; n > 0; n--)\n    for (j = n + 1; j <= k; j++) {\n      if (a[n] >= a[j] && g[n] - 1 < g[j]) {\n        g[n] = g[j] + 1;\n      }\n    }\n\n  for (i = 1; i < k; i++) {\n    for (j = i + 1; j <= k; j++)\n      if (g[i] < g[j]) {\n        temp = g[i];\n        g[i] = g[j];\n        g[j] = temp;\n      }\n  }\n  cout << g[1];\n}\n"}
{"label": "10", "index": "17039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, a[25], f[25][25];\n\nint max(int a, int b) { return a > b ? a : b; }\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f[0][0] = a[0];\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (j == 0) {\n        f[i][j] = max(f[i - 1][j], a[i]);\n        continue;\n      }\n      if (f[i - 1][j - 1] >= a[i])\n        f[i][j] = max(f[i - 1][j], a[i]);\n      else\n        f[i][j] = f[i - 1][j];\n    }\n  }\n  j = k - 1;\n  while (f[k - 1][j] == 0)\n    j--;\n  printf(\"%d\", j + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num_lanjie[25];\n  int input[25];\n  for (int i = 0; i <= n - 1; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &input[i]);\n    } else {\n      scanf(\" %d\", &input[i]);\n    }\n  }\n\n  num_lanjie[n - 1] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (int j = n - 1; j > i; j--) {\n      if (input[i] >= input[j] && max < num_lanjie[j])\n        max = num_lanjie[j];\n    }\n    num_lanjie[i] = max + 1;\n  }\n\n  int max = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    max = max > num_lanjie[i] ? max : num_lanjie[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int *a, int i, int n) {\n  int j, k, t;\n  for (j = i; j < n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] <= a[k]) {\n        t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *jishu = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    jishu[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (a[j] <= a[i] && jishu[j] >= jishu[i])\n        jishu[i] = jishu[j] + 1;\n    }\n  }\n  sort(jishu, 0, n - 1);\n  printf(\"%d \", jishu[0]);\n  free(a);\n  free(jishu);\n  return 0;\n}\n"}
{"label": "10", "index": "17042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[30], f[30], ans;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i)\n    scanf(\"%d \", &a[i]);\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 1; j <= i; ++j)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  ans = 0;\n  for (int i = 1; i <= n; ++i)\n    if (f[i] > ans)\n      ans = f[i];\n  cout << ans << \"\\n\";\n}\n"}
{"label": "10", "index": "17043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int a[k], b[100];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int high[100], count[100];\n  for (i = 0; i < n; i++) {\n    count[i] = 0;\n    scanf(\"%d\", &high[i]);\n  }\n  high[n] = 0, count[n] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    int step = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (count[j] > step) {\n        if (high[j] <= high[i])\n          step = count[j];\n      }\n    }\n    count[i] = step + 1;\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (count[i] > max)\n      max = count[i];\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint MAX(int a, int b) { return (a > b ? a : b); }\nint FIRE(int *h, int m, int i, int j) {\n  if (i == j)\n    return m >= h[j];\n  else if (m >= h[i])\n    return MAX(FIRE(h, m, i + 1, j), FIRE(h, h[i], i + 1, j) + 1);\n  else if (m < h[i])\n    return FIRE(h, m, i + 1, j);\n}\nint main() {\n  int n, i, j, h[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  printf(\"%d\", FIRE(h, 65530, 1, n)); \n}\n"}
{"label": "10", "index": "17046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int t1[], int t2[], int m, int n, int d) {\n  int i, y = 0;\n  for (i = m + 1; i < n; i++) {\n    if (t1[i] <= d && t2[i] > y)\n      y = t2[i];\n  }\n  return y;\n}\nint main() {\n  int a[10000], b[10000] = {0}, i, j, n, t, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    b[i] = max(a, b, i, n, a[i]) + 1;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (b[i] > x)\n      x = b[i];\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "10", "index": "17047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int a[30];\n  int b[30];\n  int i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        b[i] = max(b[i], b[j] + 1);\n  }\n  t = b[1];\n  for (i = 2; i <= n; i++)\n    t = max(t, b[i]);\n  cout << t;\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = n[i] > (n[j] + 1) ? n[i] : n[j] + 1;\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = m > n[i] ? m : n[i];\n  cout << m << \"\\n\";\n}\n"}
{"label": "10", "index": "17049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[100];\n  int h[100];\n  int ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    ans = 1;\n    for (int i = 0; i < n; i++) {\n      scanf(\"%d\", &a[i]);\n      h[i] = 1;\n    }\n    for (int i = 1; i < n; i++) {\n      int sum = 1;\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && h[i] < h[j] + 1)\n          h[i] = h[j] + 1;\n      }\n      if (h[i] > ans)\n        ans = h[i];\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, *a, *d, j, i;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i < n + 1; i++)\n    scanf(\"%d\", &a[i]);\n  d = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i <= n; i++)\n    d[i] = 1;\n  for (i = n - 1; i > 0; i--) {\n\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        if (d[i] < d[j] + 1)\n          d[i] = d[j] + 1;\n    }\n  }\n  int max = d[1];\n  for (i = 1; i <= n; i++)\n    if (max < d[i])\n      max = d[i];\n  printf(\"%d\\n\", max);\n  free(a);\n  free(d);\n  return 0;\n}\n"}
{"label": "10", "index": "17051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int max = 0;\n  int maxall = 1;\n  int num[10000];\n  int hight[10000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> hight[i];\n    num[i] = 0;\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (hight[j] >= hight[i] && max < num[j] + 1)\n        max = num[j] + 1;\n    }\n    num[i] = max;\n    if (num[i] > maxall)\n      maxall = num[i];\n  }\n  printf(\"%d\\n\", maxall);\n  return 0;\n}\n"}
{"label": "10", "index": "17052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n      }\n  for (i = 0; i < k; i++)\n    if (b[i] > max)\n      max = b[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "17053", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, sum, maxim, t, bo[25] = {0};\n\nint meishu(int n, int a[]) {\n  int j;\n  if (n == m - 1)\n    return sum;\n  else {\n    for (j = n + 1; j < m; j++)\n      if (a[n] >= a[j]) {\n        bo[j] = 1;\n        sum++;\n        t = meishu(j, a);\n        if (maxim < t)\n          maxim = t;\n        sum--;\n      }\n    if (j == m && sum != 1)\n      return sum;\n    else if (sum == 1)\n      return maxim;\n  }\n}\n\nint main() {\n  int i, a[25], maxi = 0;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    if (bo[i] == 0) {\n      sum = 1;\n      maxim = 1;\n      if (maxi < meishu(i, a))\n        maxi = meishu(i, a);\n    }\n  printf(\"%d\", maxi);\n  return 0;\n}\n"}
{"label": "10", "index": "17054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  int a[25], b[25];\n  m = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (a[j] >= a[i]) {\n        if ((b[i] + 1) >= b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  int k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  int a[30] = {0};\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b[30] = {1};\n  int t;\n  int c[30];\n  for (i = 1; i < k; i++) {\n    t = 0;\n    for (j = 0; j < 30; j++) {\n      c[j] = 0;\n    }\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        c[t] = b[j];\n        t++;\n      }\n    }\n    qsort(c, t, sizeof(int), compare);\n    b[i] = c[0] + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17056", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int min[26];\n  int data[26];\n  int N;\n  int i, j;\n  int minLength;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &data[i]);\n  }\n  min[0] = 1;\n  for (i = 1; i < N; i++) {\n    minLength = 0;\n    for (j = 0; j < i; j++) {\n      if (data[i] <= data[j]) {\n        if (min[j] > minLength) {\n          minLength = min[j];\n        }\n      }\n    }\n    min[i] = minLength + 1;\n  }\n\n  minLength = 0;\n  for (i = 0; i < N; i++) {\n    if (min[i] > minLength) {\n      minLength = min[i];\n    }\n  }\n\n  printf(\"%d\\n\", minLength);\n  return 0;\n}\n"}
{"label": "10", "index": "17057", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, max, j, c = 0;\n  int a[26], b[26];\n\n  cin >> k;\n\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 0;\n\n  for (i = k - 2; i >= 0; i--)\n\n  {\n    b[i] = 0;\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n    b[i] = max;\n    if (b[i] >= c)\n      c = b[i];\n  }\n  printf(\"%d\", c + 1);\n}\n"}
{"label": "10", "index": "17058", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int m[25];\n  int s[25][25];\n  \n  scanf(\"%d\", &k);\n  \n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17059", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint k;\nint height[26];\nint len(int num) {\n  int temp, max, i;\n  if (num == k) {\n    return (1);\n  } else {\n    max = 0;\n    for (i = num + 1; i <= k; i++) {\n      if (height[num] >= height[i]) {\n        temp = len(i);\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  height[0] = 30001;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  printf(\"%d\", len(0) - 1);\n  cin >> k;\n}\n"}
{"label": "10", "index": "17060", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint arr[30];\nint num[30];\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> arr[i];\n  for (int i = 0; i < k; i++)\n    num[i] = 1;\n  for (int i = 0; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (arr[j] >= arr[i] && num[j] >= num[i])\n        num[i] = num[j] + 1;\n    }\n  }\n  int res = -1;\n  for (int i = 0; i < k; i++)\n    if (num[i] > res)\n      res = num[i];\n  cout << res << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, h[30], l[30], r[30];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 1;\n    r[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && (l[j] + 1) > l[i]) {\n        l[i] = l[j] + 1;\n      }\n    }\n  }\n  for (i = k - 2; i > 0; i--) {\n    for (int j = k - 1; j > i; j--) {\n      if (h[j] <= h[i] && (r[j] + 1) > r[i]) {\n        r[i] = r[j] + 1;\n      }\n    }\n  }\n  int m = 0;\n  for (i = 0; i < k; i++) {\n    if (l[i] + r[i] - 1 > m) {\n      m = l[i] + r[i] - 1;\n    }\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a[25], b[25], i, j, t, s = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    b[i] = 1 + t;\n    if (b[i] > s)\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "17063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int k, a[25], i, j, max, b[25] = {1};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && b[j] + 1 >= max)\n        max = b[j] + 1;\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\" %d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  printf(\"%d\\n\", max(b));\n  return 0;\n}\n"}
{"label": "10", "index": "17066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, y, h[25], g[25];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (int a = 0; a < k; a++)\n    g[a] = 1;\n  for (int j = k - 2; j >= 0; j--) {\n    y = 0;\n    for (int i = j + 1; i < k; i++) {\n      if (h[i] <= h[j]) {\n        if (y < g[i])\n          y = g[i];\n      }\n    }\n    g[j] = g[j] + y;\n  }\n  int d = g[0];\n  for (int i = 0; i < k - 1; i++) {\n    if (d < g[i])\n      d = g[i];\n  }\n  printf(\"%d\", d);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100] = {0}, b[100] = {0}, sum = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    b[i] = 1;\n\n    for (j = 1; j < i; j++)\n\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n\n        b[i] = b[j] + 1;\n\n    if (sum < b[i])\n      sum = b[i];\n  }\n\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "10", "index": "17068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n      }\n  for (i = 0; i < k; i++)\n    if (b[i] > max)\n      max = b[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17069", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int w[30];\n  int f[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> w[i];\n  w[0] = 99999;\n  f[0] = 0;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (w[j] >= w[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n      }\n  }\n  int m = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > m)\n      m = f[i];\n  printf(\"%d\", m);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, k, i, max = 0;\n  scanf(\"%d\", &k);\n  int *p = (int *)malloc(k * sizeof(int));\n  int *q = (int *)malloc(k * sizeof(int));\n  scanf(\"%d\", &p[0]);\n  for (i = 1; i < k; i++)\n    scanf(\" %d\", &p[i]);\n  for (i = 0; i < k; i++)\n    q[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (p[i] >= p[j] && q[j] >= q[i]) {\n        q[i] = q[j] + 1;\n      }\n  for (i = 0; i < k; i++)\n    if (q[i] > max)\n      max = q[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "10", "index": "17072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint H[1000], D[1000];\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n) {\n        n = D[k];\n      }\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  cout << n;\n}\n"}
{"label": "10", "index": "17073", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint set_1(int i);\nint num = 0;\nint currH = 100000;\nint MaxNum = 0;\nint a[100];\nint b[100];\nint main() {\n  int i;\n  for (i = 0; i < 100; i++) {\n    b[i] = 0;\n  }\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int j;\n    cin >> j;\n    a[i] = j;\n  }\n  set_1(0);\n  cout << MaxNum;\n  return 0;\n}\n\nint set_1(int i) {\n  int lastNum = num;\n  int lastcurrH = currH;\n  if (i == k - 1) {\n    if (a[i] <= currH)\n      num++;\n    if (num > MaxNum) {\n      MaxNum = num;\n    }\n    num = lastNum;\n    currH = lastcurrH;\n    return 0;\n  }\n  if (b[i] == 0) {\n    set_1(i + 1);\n  }\n  b[i]++;\n\n  if (b[i] == 1) {\n    if (a[i] <= currH) {\n      currH = a[i];\n      num++;\n    }\n    set_1(i + 1);\n  }\n\n  num = lastNum;\n  currH = lastcurrH;\n  b[i] = 0;\n  return 0;\n}\n"}
{"label": "10", "index": "17074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max;\n  int a[30];\n  int b[30];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17075", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int dp[50];\n  int m[50];\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &m[i]);\n  for (int i = 0; i < n; i++)\n    dp[i] = 1;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (m[i] <= m[j]) {\n        dp[i] = max(dp[j] + 1, dp[i]);\n      }\n    }\n  }\n  int maxl = 0;\n  for (int i = 0; i < n; i++)\n    if (dp[i] > maxl)\n      maxl = dp[i];\n  cout << maxl;\n  return 0;\n}\n"}
{"label": "10", "index": "17076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int high[30];\n  int num[30] = {0};\n  int i, j;\n  for (i = 0; i < k; i++) {\n    cin >> high[i];\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    int max = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (high[i] <= high[j]) {\n        if (max < num[j])\n          max = num[j];\n      }\n    }\n    num[i] = max + 1;\n  }\n  sort(num, num + k);\n  printf(\"%d\", num[k - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "17077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, b[25] = {0}, max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = k - 1; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i < k; i++) {\n      if (a[i] <= a[j]) {\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[j] = max + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k[25], a[25];\n  int maxk, maxa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &k[i]);\n  }\n  a[0] = 1;\n  maxk = 1;\n\n  for (i = 1; i < n; i++) {\n    maxa = 0;\n\n    for (j = 0; j < i; j++) {\n      if (k[j] >= k[i]) {\n        if (a[j] >= maxa) {\n          maxa = a[j];\n        }\n      }\n    }\n    a[i] = maxa + 1;\n\n    if (a[i] >= maxk) {\n      maxk = a[i];\n    }\n  }\n  cout << maxk;\n}\n"}
{"label": "10", "index": "17079", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint data[1000];\nint ju[1000][1000];\nint weight[1000];\n\nint main(char *argv[]) {\n  int n = 0;\n  int i = 0;\n  int j = 0;\n  int max = 0;\n\n  freopen(\"in.txt\", \"r\", stdin);\n  freopen(\"out.txt\", \"w\", stdout);\n  scanf(\"%d\", &n);\n  memset(ju, 0, sizeof(ju));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &data[i]);\n    weight[i] = 1;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (data[i] >= data[j]) {\n        ju[i][j] = 1;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (ju[i][j]) {\n        if (weight[i] < weight[j] + 1) {\n          weight[i] = weight[j] + 1;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < weight[i])\n      max = weight[i];\n  }\n  printf(\"%d \", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17080", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m[100] = {0};\n  int min = 0;\n  int ans[100] = {0};\n  int k = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i <= k - 1; i++) {\n    cin >> m[i];\n  }\n  ans[0] = 1;\n  int temp = 0;\n  for (int i = 1; i <= k - 1; i++) {\n    temp = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (m[j] >= m[i]) {\n        if (temp < ans[j]) {\n          temp = ans[j];\n        }\n      }\n    }\n    ans[i] = temp + 1;\n  }\n  int max = 0;\n  for (int i = 0; i <= k - 1; i++) {\n    if (max < ans[i])\n      max = ans[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17081", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, height[25], start[25], max = 0, h, i, j,\n                                q; \n  scanf(\"%d\", &k);                 \n  for (h = 0; h < k; h++) {\n    scanf(\"%d\", &height[h]); \n    start[h] = 1;            \n  }\n  for (i = k - 2; i >= 0;\n       i--) { \n    for (j = i + 1; j < k; j++) { \n      if (height[j] <= height[i] &&\n          start[j] + 1 >\n              start\n                  [i]) { \n        start[i] = start[j] + 1; \n      }\n    }\n  }\n  for (q = 1; q < k; q++) {\n    if (start[q] > start[max]) { \n      max = q;\n    }\n  }\n  printf(\"%d\", start[max]);\n  return 0;\n}\n"}
{"label": "10", "index": "17082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[26] = {0}, i, j, z, l[26] = {1};\n  scanf(\"%d\", &n);\n  for (i = n; i > 0; i--)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    for (z = j = 0; j < i; j++)\n      if (a[i] >= a[j] && z <= l[j])\n        z = l[j] + 1;\n    l[i] = z;\n  }\n  for (z = i = 0; i <= n; i++)\n    if (l[i] > z)\n      z = l[i];\n  cout << z - 1 << \"\\n\";\n}\n"}
{"label": "10", "index": "17083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int d[25];\n  int f[25];\n  int max = 0;\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d \", &d[i]);\n    f[i] = 1;\n  }\n\n  while (1) {\n    int tmp = 0;\n    int x = 0;\n    int y = 0;\n\n    int ci;\n    for (ci = 0; ci < k; ci++) {\n      if (f[ci] == 1) {\n        y++;\n        if (x == 0) {\n          tmp = d[ci];\n          x++;\n        } else {\n          if (d[ci] <= tmp) {\n            tmp = d[ci];\n            x++;\n          } else\n            break;\n        }\n      }\n    }\n\n    if (x == y)\n      if (x > max)\n        max = x;\n\n    int cnt;\n    for (cnt = 0; cnt < k; cnt++) {\n      if (f[cnt] != 0)\n        break;\n    }\n    if (cnt == k)\n      break;\n\n    f[k - 1]--;\n    for (int i = k - 1; i > 0; i--) {\n      if (f[i] == -1) {\n        f[i] = 1;\n        f[i - 1]--;\n      }\n    }\n  }\n\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dd(int no, float h);\nint n, a[25];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << dd(1, 10000) << \"\\n\";\n  return 0;\n}\nint dd(int no, float h) {\n  while (h < a[no - 1]) {\n    if (no == n)\n      break;\n    no++;\n  }\n  if (no == n) {\n    if (h >= a[n - 1]) {\n      return 1;\n    } else {\n      return 0;\n    }\n  } else {\n    int b = dd(no + 1, a[no - 1]);\n    int c = dd(no + 1, h);\n    if (b >= c) {\n      return b + 1;\n    } else\n      return c;\n  }\n}\n"}
{"label": "10", "index": "17085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  int i, j;\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++) {\n    b[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    b[i] = b[0] + 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  if (n == 8 || n == 3 || a[n - 1] == 1333)\n    printf(\"%d\", b[n - 1]);\n  else {\n    cout << b[n - 1] - 1;\n  }\n}\n"}
{"label": "10", "index": "17086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num(int n, int *p) {\n  int i = 1, max = 0;\n  int *q = p + 1;\n  if (n == 2) {\n    if (*p >= *q)\n      return 2;\n    else\n      return 1;\n  } else {\n    while (i <= n) {\n      for (; *p < *q && i <= n; i++, q++)\n        ;\n      i++;\n      if (num(n - i + 1, q) + 1 > max)\n        max = num(n - i + 1, q) + 1;\n      q++;\n    }\n  }\n  return max;\n}\nint main() {\n  int k, i, a[25], max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = k; i >= 2; i--) {\n    if (num(i, a + k - i) > max)\n      max = num(i, a + k - i);\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[100] = {0};\n  int f[100] = {0};\n  a[0] = 100000;\n  cin >> k;\n  int i, j;\n  int max = 0;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[i] < f[j] + 1) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n    if (max < f[i])\n      max = f[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  if (b[i] != 1)\n    return b[i];\n  else {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = changdu(j) + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[i] = max;\n    return max;\n  }\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n];\n  int i, j, max = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] <= a[i] && b[j] + 1 >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h[25], n, i, j, t, d[25] = {0}, max = 0, in;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (h[j] <= h[i] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] > max) {\n      max = d[i];\n    }\n  }\n  cout << max + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "17091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    scanf(\" %d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  printf(\"%d\\n\", max(b));\n  return 0;\n}\n"}
{"label": "10", "index": "17092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[30], b[30], sum, i, j, m, p = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  b[k - 1] = 1;\n  for (i = k - 1; i > 0; i--) {\n    if (a[i - 1] >= a[i])\n      b[i - 1] = b[i] + 1;\n    else\n      break;\n  }\n  for (j = i - 1; j >= 0; j--) {\n    sum = b[k - 1];\n    for (m = k - 1; m > j; m--) {\n      if (a[j] >= a[m] && b[m] >= sum)\n        sum = b[m], p++;\n    }\n    if (p == 0)\n      b[j] = 1;\n    else {\n      b[j] = sum + 1;\n    }\n  }\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "10", "index": "17093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[30], n;\nint max(int p, int q) {\n  if (p >= q)\n    return p;\n  else\n    return q;\n}\nint shot(int x, int y) {\n  if (x == n) {\n    if (a[x] <= y)\n      return 1;\n    else\n      return 0;\n  } else {\n    if (a[x] > y)\n      return (shot(x + 1, y));\n    else\n      return (max(shot(x + 1, y), shot(x + 1, a[x]) + 1));\n  }\n}\nint main() {\n  int i, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  m = shot(1, 9999);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else {\n    return y;\n  }\n}\n\nint main() {\n  int a[30];\n  int b[30];\n  int i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        b[i] = max(b[i], b[j] + 1);\n  }\n  t = b[1];\n  for (i = 2; i <= n; i++)\n    t = max(t, b[i]);\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int arr[103], brr[103];\n  int i, j, k, max;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &arr[i]);\n  for (i = 1; i <= n; i++)\n    brr[i] = 0;\n  max = 0;\n  for (i = n; i >= 1; i--) {\n    k = 0;\n    for (j = n; j > i; j--) {\n      if ((arr[j] <= arr[i]) && (brr[j] > k))\n        k = brr[j];\n    }\n    brr[i] = k + 1;\n    if (brr[i] > max)\n      max = brr[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint a[100] = {0};\nint max_1[100] = {0};\nint main() {\n  int i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      max_1[i] = 1;\n    else {\n      for (j = 1, c = 0; j <= i - 1; j++) {\n        if (a[j] < a[i])\n          ;\n        else {\n          if (c < max_1[j])\n            c = max_1[j];\n        }\n      }\n      max_1[i] = c + 1;\n    }\n  }\n  for (i = 1, c = max_1[1]; i <= n; i++) {\n    if (c < max_1[i])\n      c = max_1[i];\n  }\n  cout << c;\n}\n"}
{"label": "10", "index": "17097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, most;\n  int a[25], f[25];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  f[0] = 1;\n  for (int i = 1; i < k; i++) {\n    most = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] > most) {\n          most = f[j];\n        }\n      }\n    }\n    f[i] = most + 1;\n  }\n  most = 0;\n  for (int i = 0; i < k; i++) {\n    if (f[i] > most)\n      most = f[i];\n  }\n  cout << most << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17098", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m[100] = {0};\n  int min = 0;\n  int ans[100] = {0};\n  int k = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i <= k - 1; i++) {\n    cin >> m[i];\n  }\n  ans[0] = 1;\n  int temp = 0;\n  for (int i = 1; i <= k - 1; i++) {\n    temp = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (m[j] >= m[i]) {\n        if (temp < ans[j])\n          temp = ans[j];\n      }\n    }\n    ans[i] = temp + 1;\n  }\n  int max = 0;\n  for (int i = 0; i <= k - 1; i++) {\n    if (max < ans[i])\n      max = ans[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint LanJieShu(int x, int y, int c[]) {\n  int j, t;\n  if (x == y - 1) {\n    return 1;\n  }\n  t = 0;\n  for (j = x + 1; j < y; j++) {\n    if ((c[j] <= c[x]) && (LanJieShu(j, y, c) > t))\n      t = LanJieShu(j, y, c);\n  }\n  return (t + 1);\n}\nint main() {\n  int n, i, u;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = LanJieShu(i, n, a);\n  u = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= u)\n      u = b[i];\n  }\n  printf(\"%d\\n\", u);\n}\n"}
{"label": "10", "index": "17100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, n, max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++)\n      if (a[i - j] >= a[i] && b[i - j] > (b[i] - 1))\n        b[i] = b[i - j] + 1;\n  for (i = 1; i <= n; i++)\n    if (b[i] > max)\n      max = b[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, h[27] = {100000000}, lj[27][27] = {0}; \n  int i, j, k, max;\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = num; i >= 0; i--) \n  {\n    for (j = num; j > i; j--) \n    {\n      if (h[i] >= h[j]) {\n        max = 0;\n        for (k = j; k <= num; k++) \n          max = (max > lj[i][k]) ? max : lj[i][k];\n        for (k = j; k <= num; k++) \n          if (h[j] >= h[k])\n            max = (max > lj[j][k] + 1) ? max : lj[j][k] + 1;\n        lj[i][j] = max;\n      }\n    }\n  }\n  printf(\"%d\\n\", lj[0][1]);\n}\n"}
{"label": "10", "index": "17102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint c[25], d[25], k;\nint D(int a) {\n  int m = 1;\n  for (int i = a + 1; i <= k - 1; i++)\n    if (c[i] <= c[a] && m < D(i) + 1)\n      m = D(i) + 1;\n  return m;\n}\n\nint main() {\n  int max = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> c[i];\n  for (int i = k - 1; i >= 0; i--) {\n    d[i] = D(i);\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nunsigned int h[26], n;\nint go(int maxh, int cp) {\n  int x, y, max;\n  while (h[cp] > maxh)\n    cp = cp + 1;\n  if (h[cp] == 0)\n    return 0;\n  x = go(maxh, cp + 1);\n  maxh = h[cp];\n  y = 1 + go(maxh, cp + 1);\n  max = (x > y) ? x : y;\n  return max;\n}\nint main() {\n  unsigned int i, c, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  h[n] = 0;\n  t = go(65535, 0);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint h[1000], k;\n\nint bp(int i, int height, int sum) {\n  if (i == k)\n    return sum;\n  if (h[i] <= height) {\n    int a1 = bp(i + 1, h[i], sum + 1);\n    int a2 = bp(i + 1, height, sum);\n    return (a1 > a2) ? a1 : a2;\n  }\n  return bp(i + 1, height, sum);\n}\n\nint main() {\n\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> h[i];\n\n  printf(\"%d\\n\", bp(0, 1000, 0));\n\n  return 0;\n}\n"}
{"label": "10", "index": "17105", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n\n  int *m;\n  int **s;\n\n  scanf(\"%d\", &k);\n\n  m = (int *)malloc(k * sizeof(int));\n  s = (int **)malloc(k * sizeof(int *));\n  for (i = 0; i < k; i++) {\n    s[i] = (int *)malloc((i + 1) * sizeof(int));\n  }\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint *p;\nint n;\nint max(int t, int k) {\n  if (t > k)\n    return t;\n  else\n    return k;\n}\nint pd(int i, int h) {\n  if (i == n)\n    return 0;\n  if (p[i] > h)\n    return pd(i + 1, h);\n  if (p[i] == h)\n    return pd(i + 1, h) + 1;\n  return max(pd(i + 1, p[i]) + 1, pd(i + 1, h));\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  k = pd(0, 800000);\n  printf(\"%d\", k);\n  free(p);\n}\n"}
{"label": "10", "index": "17107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, y, h[25], g[25];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (int a = 0; a < k; a++)\n    g[a] = 1;\n  for (int j = k - 2; j >= 0; j--) {\n    y = 0;\n    for (int i = j + 1; i < k; i++) {\n      if (h[i] <= h[j]) {\n        if (y < g[i])\n          y = g[i];\n      }\n    }\n    g[j] = g[j] + y;\n  }\n  int d = g[0];\n  for (int i = 0; i < k - 1; i++) {\n    if (d < g[i])\n      d = g[i];\n  }\n  printf(\"%d\", d);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n];\n  int i, j, max = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] <= a[i] && b[j] + 1 >= b[i]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i[26], a[26], b[26], x = 0;\n  scanf(\"%d\", &k);\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    b[i[0]] = 0;\n  for (i[0] = 0; i[0] < k; i[0]++)\n    scanf(\"%d\", &a[i[0]]);\n  for (i[0] = 0; i[0] < k; i[0]++) {\n    b[0] = a[i[0]];\n    for (i[1] = i[0] + 1; i[1] <= k; i[1]++)\n      if ((b[1] = a[i[1]]) <= b[0])\n        for (i[2] = i[1] + 1; i[2] <= k; i[2]++)\n          if ((b[2] = a[i[2]]) <= b[1])\n            for (i[3] = i[2] + 1; i[3] <= k; i[3]++)\n              if ((b[3] = a[i[3]]) <= b[2])\n                for (i[4] = i[3] + 1; i[4] <= k; i[4]++)\n                  if ((b[4] = a[i[4]]) <= b[3])\n                    for (i[5] = i[4] + 1; i[5] <= k; i[5]++)\n                      if ((b[5] = a[i[5]]) <= b[4])\n                        for (i[6] = i[5] + 1; i[6] <= k; i[6]++)\n                          if ((b[6] = a[i[6]]) <= b[5])\n                            for (i[7] = i[6] + 1; i[7] <= k; i[7]++)\n                              if ((b[7] = a[i[7]]) <= b[6])\n                                for (i[8] = i[7] + 1; i[8] <= k; i[8]++)\n                                  if ((b[8] = a[i[8]]) <= b[7])\n                                    for (i[9] = i[8] + 1; i[9] <= k; i[9]++)\n                                      if ((b[9] = a[i[9]]) <= b[8])\n                                        for (i[10] = i[9] + 1; i[10] <= k;\n                                             i[10]++)\n                                          if ((b[10] = a[i[10]]) <= b[9])\n                                            for (i[11] = i[10] + 1; i[11] <= k;\n                                                 i[11]++)\n                                              if ((b[11] = a[i[11]]) <= b[10])\n                                                for (i[12] = i[11] + 1;\n                                                     i[12] <= k; i[12]++)\n                                                  if ((b[12] = a[i[12]]) <=\n                                                      b[11])\n                                                    for (i[13] = i[12] + 1;\n                                                         i[13] <= k; i[13]++)\n                                                      if ((b[13] = a[i[13]]) <=\n                                                          b[12])\n                                                        for (i[14] = i[13] + 1;\n                                                             i[14] <= k;\n                                                             i[14]++)\n                                                          if ((b[14] =\n                                                                   a[i[14]]) <=\n                                                              b[13])\n                                                            for (i[15] =\n                                                                     i[14] + 1;\n                                                                 i[15] <= k;\n                                                                 i[15]++)\n                                                              if ((b[15] = a\n                                                                       [i[15]]) <=\n                                                                  b[14])\n                                                                for (i[16] =\n                                                                         i[15] +\n                                                                         1;\n                                                                     i[16] <= k;\n                                                                     i[16]++)\n                                                                  if ((b[16] = a\n                                                                           [i[16]]) <=\n                                                                      b[15])\n                                                                    for (\n                                                                        i[17] =\n                                                                            i[16] +\n                                                                            1;\n                                                                        i[17] <=\n                                                                        k;\n                                                                        i[17]++)\n                                                                      if ((b[17] = a\n                                                                               [i[17]]) <=\n                                                                          b[16])\n                                                                        for (\n                                                                            i[18] =\n                                                                                i[17] +\n                                                                                1;\n                                                                            i[18] <=\n                                                                            k;\n                                                                            i[18]++)\n                                                                          if ((b[18] = a\n                                                                                   [i[18]]) <=\n                                                                              b[17])\n                                                                            for (\n                                                                                i[19] =\n                                                                                    i[18] +\n                                                                                    1;\n                                                                                i[19] <=\n                                                                                k;\n                                                                                i[19]++)\n                                                                              if ((b[19] = a\n                                                                                       [i[19]]) <=\n                                                                                  b[18])\n                                                                                for (\n                                                                                    i[20] =\n                                                                                        i[19] +\n                                                                                        1;\n                                                                                    i[20] <=\n                                                                                    k;\n                                                                                    i[20]++)\n                                                                                  if ((b[20] = a\n                                                                                           [i[20]]) <=\n                                                                                      b[19])\n                                                                                    for (\n                                                                                        i[21] =\n                                                                                            i[20] +\n                                                                                            1;\n                                                                                        i[21] <=\n                                                                                        k;\n                                                                                        i[21]++)\n                                                                                      if ((b[21] = a\n                                                                                               [i[21]]) <=\n                                                                                          b[20])\n                                                                                        for (\n                                                                                            i[22] =\n                                                                                                i[21] +\n                                                                                                1;\n                                                                                            i[22] <=\n                                                                                            k;\n                                                                                            i[22]++)\n                                                                                          if ((b[22] = a\n                                                                                                   [i[22]]) <=\n                                                                                              b[21])\n                                                                                            for (\n                                                                                                i[23] =\n                                                                                                    i[22] +\n                                                                                                    1;\n                                                                                                i[23] <=\n                                                                                                k;\n                                                                                                i[23]++)\n                                                                                              if ((b[23] = a\n                                                                                                       [i[23]]) <=\n                                                                                                  b[22])\n                                                                                                for (\n                                                                                                    i[24] =\n                                                                                                        i[23] +\n                                                                                                        1;\n                                                                                                    i[24] <=\n                                                                                                    k;\n                                                                                                    i[24]++)\n                                                                                                  if ((b[24] = a\n                                                                                                           [i[24]]) <=\n                                                                                                      b[23])\n                                                                                                    for (\n                                                                                                        i[25] =\n                                                                                                            i[24] +\n                                                                                                            1;\n                                                                                                        i[25] <=\n                                                                                                        k;\n                                                                                                        i[25]++)\n                                                                                                      if ((b[25] = a\n                                                                                                               [i[25]]) <=\n                                                                                                          b[24])\n                                                                                                        ;\n  }\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    if (b[i[0]] == 0) {\n      printf(\"%d\", i[0] - 1);\n      break;\n    }\n}\n"}
{"label": "10", "index": "17110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int s[25];\n  int max[25];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  max[0] = 1;\n  for (i = 1; i < n; i++) {\n    int m = 1;\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && max[j] + 1 > m)\n        m = max[j] + 1;\n    }\n    max[i] = m;\n  }\n  int p = max[0];\n  for (i = 1; i < n; i++) {\n    if (max[i] > p)\n      p = max[i];\n  }\n  cout << p << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint h[25], n;\nint hack(int i, int w) {\n  if (i == n - 1) {\n    if (h[i] <= w)\n      return 1;\n    else\n      return 0;\n  }\n  int b = hack(i + 1, w), c = 0;\n  if (h[i] <= w)\n    c = 1 + hack(i + 1, h[i]);\n  if (b > c)\n    return b;\n  else\n    return c;\n}\nint main() {\n  scanf(\"%d\", &n);\n  int i, max = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    if (h[i] > max)\n      max = h[i];\n  }\n  cout << hack(0, max);\n  return 0;\n}\n"}
{"label": "10", "index": "17112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000], len[1000], n, i, j, max, longest;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  longest = 1;\n  for (i = 0; i < n; i++) {\n    max = 1;\n    len[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        max = len[j] + 1;\n      if (len[i] < max)\n        len[i] = max;\n    }\n    if (len[i] > longest)\n      longest = len[i];\n  }\n  printf(\"%d \", longest);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17113", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint maxnum(int *a, int n, int up) {\n  if (n == 0)\n    return 0;\n  int i, max = -1, t;\n  for (i = 0; i < n; i++) {\n    t = up;\n    if (a[i] <= up || up == -1)\n      t = a[i];\n    else\n      continue;\n    if (maxnum(a + i + 1, n - 1 - i, t) > max)\n      max = maxnum(a + i + 1, n - i - 1, t);\n  }\n  return max + 1;\n}\n\nint main() {\n  int i, n, a[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << maxnum(a, n, -1);\n}\n"}
{"label": "10", "index": "17114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint *h;\nint *m;\nint max_1 = 0;\n\nvoid calc(int num) {\n  int i;\n  *(m + num) = 1;\n  for (i = num + 1; i <= n - 1; i++)\n    if (*(h + i) <= *(h + num))\n      if (*(m + i) + 1 > *(m + num)) {\n        *(m + num) = *(m + i) + 1;\n      }\n  if (*(m + num) > max_1)\n    max_1 = *(m + num);\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  h = (int *)malloc(sizeof(int) * n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", h + i);\n  *(m + n - 1) = 1;\n  for (i = n - 2; i >= 0; i--)\n    calc(i);\n  cout << max_1;\n}\n"}
{"label": "10", "index": "17115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct z {\n  int g;\n  int h;\n};\nint main() {\n  int k, i, j, w;\n  struct z a[50];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i].g;\n  }\n  for (i = 0; i < k; i++) {\n    a[i].h = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].g >= a[j].g) {\n        if (a[i].h < a[j].h + 1) {\n          a[i].h = a[j].h + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].h < a[j].h) {\n        w = a[i].h;\n        a[i].h = a[j].h;\n        a[j].h = w;\n      }\n    }\n  }\n  cout << a[0].h << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17116", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26], k, h[26], t, i, j;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    cin >> h[i];\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++)\n      if (h[j] >= h[i])\n        if (b[j] > t)\n          t = b[j];\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[100], b[100], bm = -1;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && (b[j] + 1) > b[i])\n        b[i] = (b[j] + 1);\n    if (b[i] > bm)\n      bm = b[i];\n  }\n  printf(\"%d\", bm);\n  return 0;\n}\n"}
{"label": "10", "index": "17118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, flag = 0;\n  int a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = n - 1; j >= i; j--) {\n      if (a[i] >= a[j]) {\n        flag = 1;\n        if (b[i] < b[j])\n          b[i] = b[j];\n      }\n    }\n    b[i] = b[i] + 1;\n    if (flag == 0) {\n      b[i] = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  cout << b[0] - 1;\n}\n"}
{"label": "10", "index": "17119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int a[30];\n  int num[30];\n  int i;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    num[i] = 0;\n  }\n  int max = 0;\n  for (i = k; i >= 1; i--) {\n    int m = 0;\n    for (int j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && num[j] > m)\n        m = num[j];\n    }\n    num[i] = 1 + m;\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[30], b[30], max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i - 1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[n - i] >= a[n - i + j] && b[n - i] <= b[n - i + j]) {\n        b[n - i] = 1 + b[n - i + j];\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (b[i - 1] > max)\n      max = b[i - 1];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17121", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int num[30];\n  int r = 0;\n  int dp[30] = {0};\n\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i]);\n    dp[i] = 1;\n  }\n  for (int i = 2; i <= n; i++)\n    for (int j = 1; j < i; j++)\n      if (num[i] <= num[j]) {\n        dp[i] = max(dp[i], dp[j] + 1);\n        if (dp[i] > r)\n          r = dp[i];\n      }\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "17122", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[30];\n  int num[30];\n  int i;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    num[i] = 0;\n  }\n  int max = 0;\n  for (i = k; i >= 1; i--) {\n    int m = 0;\n    for (int j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && num[j] > m)\n        m = num[j];\n    }\n    num[i] = 1 + m;\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17123", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int height[27];\n  int result[27];\n  int k;\n  int i, j;\n  int nmax;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> height[i];\n  }\n  height[k + 1] = 0;\n  result[k + 1] = 0;\n  for (i = k; i > 0; i--) {\n    nmax = 0;\n    for (j = i + 1; j <= k + 1; j++) {\n      if (height[i] >= height[j]) {\n        if (result[j] > nmax) {\n          nmax = result[j];\n        }\n      }\n    }\n    result[i] = nmax + 1;\n  }\n  nmax = 0;\n  for (i = 1; i < k; i++) {\n    if (result[i] > nmax) {\n      nmax = result[i];\n    }\n  }\n  cout << nmax << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17124", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nenum { MAX_NUM = 25 };\n\nint main() {\n  int missle_num = 0;\n\n  int height[MAX_NUM][2];\n  int i, j;\n  int max = 0;\n  scanf(\"%d\", &missle_num);\n\n  for (i = 0; i < missle_num; i++) {\n    scanf(\"%d\", &height[i][0]);\n    height[i][1] = 1;\n  }\n\n  for (i = 0; i < missle_num; i++) {\n  }\n\n  for (i = 0; i < missle_num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (height[i][0] <= height[j][0]) {\n        if (height[i][1] < height[j][1] + 1)\n          height[i][1] = height[j][1] + 1;\n      }\n    }\n  }\n\n  max = 0;\n  for (i = 0; i < missle_num; i++) {\n\n    if (max < height[i][1]) {\n      max = height[i][1];\n    }\n  }\n  printf(\"\\n%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint height[26];\nint x;\nint cmp(int a, int b) { return (a > b ? a : b); }\nint max(int a, int b) {\n  int cmp(int a, int b);\n  if (b == x) {\n    if (a >= height[x])\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a < height[b])\n      return (max(a, b + 1));\n    else\n      return (cmp(max(a, b + 1), (1 + max(height[b], b + 1))));\n  }\n}\n\nint main() {\n  int max(int, int);\n  int i;\n  scanf(\"%d\", &x);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  x--;\n  printf(\"%d\", max(1000000, 0));\n}\n"}
{"label": "10", "index": "17126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, i;\nint h[26];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\n\nint f(int t, int l) {\n  if (t == 1) {\n    if (h[1] >= l)\n      return 1;\n    else\n      return 0;\n  }\n\n  else if (h[t] < l)\n    return f(t - 1, l);\n  else\n    return max(f(t - 1, l), f(t - 1, h[t]) + 1);\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n  cout << f(n, 0);\n  return 0;\n}\n"}
{"label": "10", "index": "17127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[i] <= b[j]))\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  cout << m << \"\\n\";\n}\n"}
{"label": "10", "index": "17128", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct missile {\n  int num;\n  int high;\n};\nstruct missile a[25];\nvoid f(int n, int sum);\nint main() {\n  int i = 0, j = 0, sum = 0, max = 0;\n  cin >> sum;\n  for (i = 0; i <= sum - 1; i++) {\n    scanf(\"%d\", &a[i].high);\n  }\n  for (i = sum - 1; i >= 0; i--) {\n    f(i, sum);\n  }\n  for (i = 0; i <= sum - 1; i++) {\n    if (a[i].num > max) {\n      max = a[i].num;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\nvoid f(int n, int sum) {\n  int i = 0, t = 1;\n  if (n == sum - 1) {\n    a[n].num = 1;\n  } else {\n    a[n].num = 1;\n    for (i = n + 1; i <= sum - 1; i++) {\n      if (a[n].high >= a[i].high) {\n        if (a[i].num + 1 > a[n].num) {\n          a[n].num = a[i].num + 1;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "17129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[26] = {0}, i, j, z, l[26] = {1};\n  scanf(\"%d\", &n);\n  for (i = n; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (z = j = 0; j < i; j++)\n      if (a[i] >= a[j] && z <= l[j])\n        z = l[j] + 1;\n    l[i] = z;\n  }\n  for (z = i = 0; i <= n; i++)\n    if (l[i] > z)\n      z = l[i];\n  printf(\"%d\\n\", z - 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25] = {0}, n;\nint main() {\n  int F(int x);\n  int i, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    if (z < F(i))\n      z = F(i);\n  printf(\"%d\\n\", z);\n  return 0;\n}\nint F(int x) {\n  int i, z = 1;\n  for (i = x + 1; i < n; i++)\n    if ((a[x] >= a[i]) && (F(i) + 1 > z))\n      z = F(i) + 1;\n  return z;\n}\n"}
{"label": "10", "index": "17131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25];\n  int i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      j = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = j;\n    }\n  }\n  cout << b[k - 1] << \"\\n\";\n}\n"}
{"label": "10", "index": "17132", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint numbers[1001], max_1Length[1001];\nint n, max_1 = 0, temp = 0, check = 0;\nint j;\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = n - 1; i >= 0; i--)\n    scanf(\"%d \", &numbers[i]);\n  max_1Length[0] = 1;\n  for (int i = 1; i < n; i++) {\n    temp = 0;\n    check = 0;\n    for (j = 0, max_1Length[i] = 0; j < i; j++) {\n      if (numbers[j] <= numbers[i] && max_1Length[j] >= max_1Length[i] &&\n          max_1Length[j] >= max_1Length[temp]) {\n        temp = j;\n        check++;\n      }\n    }\n    if (check)\n      max_1Length[i] = max_1Length[temp] + 1;\n    else\n      max_1Length[i] = 1;\n  }\n  for (int i = 0; i < n; i++) {\n    if (max_1 < max_1Length[i])\n      max_1 = max_1Length[i];\n  }\n  cout << max_1;\n  return 0;\n}\n"}
{"label": "10", "index": "17133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint xu(int a[], int n, int k) {\n  int i, b = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[k] < a[i])\n      b++;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[k] > a[i])\n      b = b + 1;\n  }\n  return (b);\n}\nint max(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return i;\n    }\n  }\n}\nint maxd(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return (b[i]);\n    }\n  }\n}\nint shai(int a[], int n) {\n  int i, j, m[30] = {0};\n\n  for (i = 0; i < n; i++) {\n    m[i] = xu(a, n, i);\n  }\n  if (maxd(m, n) == 0) {\n    return (n);\n  } else {\n    for (j = max(m, n); j < n; j++) {\n      a[j] = a[j + 1];\n    }\n    shai(a, n - 1);\n  }\n}\nint main() {\n  int k = 0;\n  int a[30] = {0};\n  int lRet;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  lRet = shai(a, k);\n  cout << lRet;\n\n  return (1);\n}\n"}
{"label": "10", "index": "17134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, s, d, max = 0, m = 1;\n  int a[26], b[26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n    max = 0;\n  }\n  for (d = 1; d <= k; d++) {\n    if (b[d] >= m)\n      m = b[d];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct {\n  int file;\n  int reign;\n} missile;\nint main() {\n  int n, i, j, max = 0;\n  missile a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i].file);\n  }\n  a[n].reign = 1;\n  for (i = n - 1; i >= 1; i--) {\n    a[i].reign = 1;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j].file <= a[i].file) {\n        if (a[j].reign + 1 > a[i].reign) {\n          a[i].reign = a[j].reign + 1;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i].reign > max)\n      max = a[i].reign;\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int s[], int n) {\n  int i, d = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] > d)\n      d = s[i];\n  }\n  return d;\n}\nvoid bl(int h[], int s[], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      s[i] = 1;\n    else {\n      s[i] = 1;\n      for (j = 0; j < i; j++)\n        if (h[j] >= h[i] && (s[j] + 1) > s[i]) {\n          s[i] = s[j] + 1;\n        }\n    }\n  }\n}\nint main() {\n  int r, i, n;\n  scanf(\"%d\", &n);\n  int h[26], d[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  bl(h, d, n);\n  r = max(d, n);\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "10", "index": "17137", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], i, j, k, n = 25, m = 0, t, d[26], f[26];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    d[i] = 1;\n    f[i] = 1;\n  }\n  for (i = n - 1; i > 0; i--)\n    for (k = i + 1; k <= n; k++) {\n      if (a[i] >= a[k]) {\n        for (j = i + 1; j < n; j++)\n          if (a[i] >= a[j] && d[j] > f[k])\n            f[k] = d[j];\n        d[i] = d[i] + f[k];\n        break;\n      }\n    }\n\n  for (i = n; i > 0; i--) {\n    if (d[i] > m)\n      m = d[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17138", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max >= k[i])\n      q = f(k[i], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  cout << f(2147483647, 0, 0);\n}\n"}
{"label": "10", "index": "17140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint a[29] = {~0U >> 1}, f[29] = {0};\nint ans = 0;\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; ++i) {\n    cin >> a[i];\n  }\n\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[i] <= a[j] && f[i] < f[j] + 1) {\n        f[i] = f[j] + 1;\n      }\n    }\n\n    if (f[i] > ans) {\n      ans = f[i];\n    }\n  }\n\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17141", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int maxk = 300;\n\nint main() {\n  int k;\n  int a[maxk];\n  int f[maxk];\n\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  int ans = 0;\n\n  f[0] = 1;\n\n  for (int i = 1; i < k; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    };\n    if (f[i] > ans)\n      ans = f[i];\n  };\n\n  cout << ans << endl;\n\n  return 0;\n};\n"}
{"label": "10", "index": "17142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, max = 0;\n  int m[25];\n  int n[25];\n  scanf(\"%d \", &k);\n\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n\n  for (i = 0; i < k; i++)\n    n[i] = 0;\n  n[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (m[i] >= m[j]) {\n        if (n[i] <= n[j]) {\n          n[i] = n[j] + 1;\n        }\n        t++;\n      }\n    }\n    if (t == 0)\n      n[i] = 1;\n    t = 0;\n  }\n  for (i = 0; i < k; i++) {\n    if (n[i] > max)\n      max = n[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++)\n    n = n > b[i] ? n : b[i];\n\n  cout << n;\n  free(a);\n  free(b);\n}\n"}
{"label": "10", "index": "17144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[100], b = 0, max_1 = 0;\n\nvoid fun(int x, int m) {\n  int i;\n  if (x == 0) {\n    if (b > max_1) {\n      max_1 = b;\n    }\n  } else if (a[x] < m) {\n    fun(x - 1, m);\n  } else if (a[x] >= m) {\n    for (i = x; i >= 1; i--) {\n      if (a[i] >= m) {\n        b++;\n        fun(i - 1, a[i]);\n        b--;\n      }\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fun(n, 0);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "17145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h[30];\nint result[30];\n\nint findFirstLess(int num) {\n  int index = 0;\n  while (1) {\n    if (result[index] < num)\n      return index;\n    index++;\n  }\n}\n\nint main() {\n  int k, i = 0, r;\n  scanf(\"%d \", &k);\n  while (1) {\n    if (i >= k)\n      break;\n    scanf(\"%d\", h + i);\n    i++;\n  }\n  result[0] = h[0];\n  i = 1;\n  r = 0;\n  while (i < k) {\n    if (h[i] <= result[r])\n      result[++r] = h[i];\n    if (h[i] > result[r])\n      result[findFirstLess(h[i])] = h[i];\n    i++;\n  }\n\n  printf(\"%d\\n\", r + 1);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17146", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int max = 0;\n  int maxall = 1;\n  int num[10000];\n  int hight[10000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> hight[i];\n    num[i] = 0;\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (hight[j] >= hight[i] && max < num[j] + 1)\n        max = num[j] + 1;\n    }\n    num[i] = max;\n    if (num[i] > maxall)\n      maxall = num[i];\n  }\n  cout << maxall << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, i, j, t;\n  int a[26], b[26], c[26];\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        c[j] = b[j] + 1;\n      else\n        c[j] = 1;\n      for (m = j; m > 0; m--) {\n        if (c[m] >= c[m - 1]) {\n          t = c[m - 1];\n          c[m - 1] = c[m];\n          c[m] = t;\n        }\n      }\n      b[i] = c[0];\n    }\n  for (i = k - 1; i > 0; i--)\n    if (b[i] >= b[i - 1]) {\n      t = b[i - 1];\n      b[i - 1] = b[i];\n      b[i] = t;\n    }\n  cout << b[0];\n  return 0;\n}\n"}
{"label": "10", "index": "17148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26] = {0};\nint b[10000];\nint n, m = 0;\nint p = 1;\nvoid dao(int c, int k) {\n  int i, flag = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[i] <= c) {\n      flag = 1;\n      p = p + 1;\n      dao(a[i], i);\n      p = p - 1;\n    }\n  }\n  if (flag == 0) {\n    b[m] = p;\n    m = m + 1;\n  }\n}\nint main() {\n  int i, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    dao(a[i], i);\n  }\n  for (i = 0; i < m - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      q = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = q;\n    }\n  }\n  cout << b[m - 1];\n\n  return 0;\n}\n"}
{"label": "10", "index": "17149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct {\n  int file;\n  int reign;\n} missile;\nint main() {\n  int n, i, j, max = 0;\n  missile a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].file;\n  }\n  a[n].reign = 1;\n  for (i = n - 1; i >= 1; i--) {\n    a[i].reign = 1;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j].file <= a[i].file) {\n        if (a[j].reign + 1 > a[i].reign) {\n          a[i].reign = a[j].reign + 1;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i].reign > max)\n      max = a[i].reign;\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = k - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (a[j] <= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[30], b[30];\n  for (int i = 0; i < 30; i++) {\n    a[i] = b[i] = 1;\n  }\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 1;\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (1 + b[j] > max)\n          max = 1 + b[j];\n      }\n    }\n    b[i] = max;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max >= k[i])\n      q = f(k[i], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  printf(\"%d\", f(2147483647, 0, 0));\n}\n"}
{"label": "10", "index": "17153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, *num;\n  int n, add;\n\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", p + i);\n    *(num + i) = 1;\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    add = 0;\n    for (int k = i + 1; k <= n - 1; k++) {\n      if (*(p + i) >= *(p + k) && *(num + k) > add)\n        add = *(num + k);\n    }\n    *(num + i) += add;\n  }\n  int maxnum = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    if (*(num + i) > maxnum)\n      maxnum = *(num + i);\n  }\n  cout << maxnum;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17154", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint result[40]; \nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nvoid f(int a[], int n) {\n  \n  int i, j, maxmium;\n  result[1] = 1;\n  for (i = 2; i <= n; i++) {\n    maxmium = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] >= a[i])\n        maxmium = max(result[j], maxmium);\n    }\n    result[i] = 1 + maxmium;\n  }\n}\n\nint main() {\n  int n, i, outcome = 0;\n  scanf(\"%d\", &n);\n  int a[40];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f(a, n);\n  for (i = 1; i <= n; i++)\n    outcome = max(outcome, result[i]);\n  printf(\"%d \", outcome);\n}\n"}
{"label": "10", "index": "17155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h[40];\n  int num[40];\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i != n; ++i)\n    cin >> h[i];\n  memset(num, 0, sizeof(num));\n  num[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int maxi = 1;\n    for (int j = i - 1; j >= 0; --j) {\n      if (maxi < num[j] + 1 && h[j] >= h[i])\n        maxi = num[j] + 1;\n    }\n    num[i] = maxi;\n  }\n  int temp = 0;\n  for (int i = 0; i != n; ++i) {\n    if (num[i] > temp)\n      temp = num[i];\n  }\n  cout << temp << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint MAX(int a, int b) { return (a > b ? a : b); }\nint FIRE(int *h, int m, int i, int j) {\n  if (i == j)\n    return m >= h[j];\n  else if (m >= h[i])\n    return MAX(FIRE(h, m, i + 1, j), FIRE(h, h[i], i + 1, j) + 1);\n  else if (m < h[i])\n    return FIRE(h, m, i + 1, j);\n}\nint main() {\n  int n, i, h[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  cout << FIRE(h, 65530, 1, n);\n  return 0;\n}\n"}
{"label": "10", "index": "17157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, k, i, j, a[25], b[25], max;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      b[i] = 1;\n    else {\n      max = 0;\n      for (j = i + 1; j <= k - 1; j++)\n        if (a[j] <= a[i] && b[j] >= max)\n          max = b[j];\n      b[i] = max + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17158", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, h[25] = {0}, n[25] = {1}, num;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (h[i] >= h[j] && n[i] < n[j] + 1)\n        n[i] = n[j] + 1;\n    }\n  }\n  num = n[0];\n  for (i = 0; i < k; i++) {\n    if (num < n[i])\n      num = n[i];\n  }\n  printf(\"%d\", num + 1);\n}\n"}
{"label": "10", "index": "17159", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  int a[100], b[100];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] > a[j])\n        continue;\n      if (b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], f[26];\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    f[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (f[i] > k)\n      k = f[i];\n  }\n  printf(\"%d\", k);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint co(int m[], int n[], int j, int e) {\n  int a, b, c;\n  b = m[j];\n  c = 0;\n  for (a = j + 1; a < e; a++) {\n    if (b >= m[a] && c <= n[a])\n      c = n[a];\n  }\n  return (c);\n}\nint main() {\n  int a, b, c, d, e, f, g, m[26], n[26], i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  n[a - 1] = 1;\n  for (j = (a - 2); j >= 0; j--) {\n    n[j] = co(m, n, j, a) + 1;\n  }\n  f = 0;\n  for (g = 0; g < a; g++) {\n    if (n[g] >= f)\n      f = n[g];\n  }\n  printf(\"%d\", f);\n}\n"}
{"label": "10", "index": "17162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint run() {\n  int i, j, a[33], b[33];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        if (b[j] < b[i] + 1)\n          b[j] = b[i] + 1;\n  j = 0;\n  for (i = 1; i <= n; i++)\n    if (b[i] > j)\n      j = b[i];\n  printf(\"%d\\n\", j);\n}\nint main() {\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    run();\n    n = 0;\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30];\nint main() {\n  int a[100], k, i, n;\n  for (i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    cin >> a[i];\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && t < max(a, i))\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "17164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[100] = {0}, i = 0, j = 0, d[100] = {0}, c = 0, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if ((d[j] > c) && (a[j] <= a[i]))\n        c = d[j];\n    }\n    d[i] = c + 1;\n    c = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[], int n);\n  int a[30], n, i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  s = f(a, n);\n  printf(\"%d\", s);\n  return 0;\n}\n\nint f(int a[], int n) {\n  int max(int x, int y);\n  int g(int a[], int n, int b);\n  if (n == 0)\n    return (0);\n  else\n    return (max(g(a + 1, n - 1, a[0]) + 1, f(a + 1, n - 1)));\n}\n\nint g(int a[], int n, int b) {\n  int max(int x, int y);\n  if (n == 0)\n    return (0);\n  else if (n == 1)\n    if (a[0] > b)\n      return (0);\n    else\n      return (1);\n  else if (a[0] > b)\n    return (g(a + 1, n - 1, b));\n  else\n    return (max(g(a + 1, n - 1, b), g(a + 1, n - 1, a[0]) + 1));\n}\nint max(int x, int y) { return (x > y ? x : y); }\n"}
{"label": "10", "index": "17166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nstatic int c[25];\nint max(int a, int b) {\n  if (a >= b)\n    return (a);\n  else\n    return (b);\n}\nint f(int mx, int st) {\n  for (; st < n; st++)\n    if (c[st] <= mx)\n      return (max(f(c[st], st + 1) + 1, f(mx, st + 1)));\n  return 0;\n}\nint main() {\n  int i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> c[i];\n  s = f(4000, 0);\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "17167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int i, j;\n  int s[30], t[30];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &s[i]);\n    t[i] = 0;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (s[i] >= s[j] && t[i] < t[j])\n        t[i] = t[j];\n    }\n    t[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (t[0] < t[i])\n      t[0] = t[i];\n  }\n  printf(\"%d\", t[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "17168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int t[25];\n\n  int max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (j == n - 1)\n      t[j] = 1;\n\n    else {\n\n      max_t = 0;\n      for (k = j; k < n - 1; k++) {\n        if (a[j] >= a[k + 1] && max_t < t[k + 1]) {\n          max_t = t[k + 1];\n        }\n      }\n      t[j] = max_t + 1;\n    }\n  }\n  max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (t[j] > max_t)\n      max_t = t[j];\n  }\n  printf(\"%d\\n\", max_t);\n}\n"}
{"label": "10", "index": "17169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[30], n;\nint max(int p, int q) {\n  if (p >= q)\n    return p;\n  else\n    return q;\n}\nint shot(int x, int y) {\n  if (x == n) {\n    if (a[x] <= y)\n      return 1;\n    else\n      return 0;\n  } else {\n    if (a[x] > y)\n      return (shot(x + 1, y));\n    else\n      return (max(shot(x + 1, y), shot(x + 1, a[x]) + 1));\n  }\n}\nint main() {\n  int i, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  m = shot(1, 9999);\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = 1; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] >= a[j] && b[j] + 1 >= b[i])\n        b[i] = b[j] + 1;\n  k = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > k)\n      k = b[i];\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17171", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int j = 0;\n  int max = 0;\n  int i, m;\n  cin >> k;\n  int height[k], b[k];\n  while (j < k) {\n    scanf(\"%d\", &height[j]);\n    j++;\n  }\n  j = j - 1;\n  while (j >= 0) {\n    for (i = j + 1; i < k; i++) {\n      if (height[i] <= height[j] && b[i] > max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n    max = 0;\n    j--;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint H[1000], D[1000];\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "10", "index": "17173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, height = 9999;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int **b = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i <= n - 1; i++)\n    b[i] = (int *)malloc(9999 * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    if (a[i] > a[i + 1]) {\n      k = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = k;\n    }\n  }\n  height = a[n - 1];\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j <= height; j++) {\n      if (i == n - 1) {\n        if (j >= a[i]) {\n          b[i][j] = 1;\n        } else\n          b[i][j] = 0;\n      } else {\n        if (j >= a[i]) {\n          if (1 + b[i + 1][a[i]] > b[i + 1][j]) {\n            b[i][j] = 1 + b[i + 1][a[i]];\n          } else\n            b[i][j] = b[i + 1][j];\n        } else\n          b[i][j] = b[i + 1][j];\n      }\n    }\n  }\n  printf(\"%d\", b[0][height] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17174", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h[25], d[25], i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> h[i];\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (d[j] + 1 > d[i] && h[j] <= h[i])\n        d[i] = d[j] + 1;\n    }\n  }\n  max = d[0];\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 8 && a[0] == 300)\n    printf(\"6\");\n  else if (n == 25 && a[0] == 1254 && a[24] != 1761)\n    printf(\"9\");\n  else if (n == 25 && a[24] == 1761)\n    printf(\"8\");\n  else if (n == 3 && a[1] == 200)\n    printf(\"2\");\n  else if (n == 10 && a[9] == 1511)\n    printf(\"6\");\n  else\n    printf(\"10\");\n}\n"}
{"label": "10", "index": "17176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[26], k, h[26], t, i, j; \n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++)\n      if (h[j] >= h[i])\n        if (b[j] > t)\n          t = b[j];\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17177", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[30];\n  int len[30];\n  for (int i = 0; i < n; ++i) {\n    cin >> num[i];\n  }\n  len[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int max = 0;\n    for (int j = 0; j < i; ++j) {\n      if (num[j] >= num[i] && len[j] > max) {\n        max = len[j];\n      }\n      if (max == 0)\n        len[i] = 1;\n      else\n        len[i] = max + 1;\n    }\n  }\n  int l = len[0];\n  for (int i = 1; i < n; ++i) {\n    if (len[i] > l)\n      l = len[i];\n  }\n  cout << l << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int a[25];\n  int b[25];\n  int i, j, max;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (max < b[j])\n          max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, dmax, n, array[32],\n      d[32] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &array[i]);\n\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((array[j] <= array[i]) && (d[i] < d[j] + 1)) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax) {\n      dmax = d[i];\n    }\n  }\n  cout << dmax;\n  return 0;\n}\n"}
{"label": "10", "index": "17180", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  \n  \n  int k, height[25], maxC[25] = {0}, j, i, max = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &height[i]);\n    \n    for (j = 0, max = 0; j < i; j++) {\n      if (height[j] >= height[i])\n        if (maxC[j] > max)\n          max = maxC[j];\n    }\n    if (max == 0)\n      maxC[i] = 1;\n    else\n      maxC[i] = ++max;\n  }\n\n  for (i = 1, max = 0; i < k; i++)\n    if (maxC[i] > max)\n      max = maxC[i];\n\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int temp = 0;\n  int max = 1;\n  int z = 0;\n  cin >> k;\n  int a[30];\n  int b[30] = {0};\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  b[0] = 1;\n  for (int i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        temp = b[j] + 1;\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n    b[i] = max;\n    if (max > z)\n      z = max;\n\n    max = 1;\n  }\n  cout << z;\n  return 0;\n}\n"}
{"label": "10", "index": "17182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i;\nint main() {\n  int b[26] = {0};\n  int k;\n  int f(int x, int y, int a[26]);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"%d\\n\", f(k, k, b) - 1);\n}\nint f(int x, int y, int a[26]) {\n  if (y == 0)\n    return (1);\n  int s = 0;\n  if (y >= 1) {\n    for (i = 0; i < y; i++) {\n      if (a[i] >= a[y] && f(x, i, a) >= s)\n        s = f(x, i, a);\n    }\n  }\n  if (i == y)\n    return (s + 1);\n}\n"}
{"label": "10", "index": "17183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint main() {\n  int max(int k, int n);\n  int i, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (max(i, n) > m)\n      m = max(i, n);\n  }\n  printf(\"%d\", m);\n}\nint max(int k, int n) {\n  int l = 0, j;\n  if (k == n - 1)\n    l = 0;\n  for (j = k + 1; j < n; j++) {\n    if (a[j] <= a[k]) {\n      if (max(j, n) > l)\n        l = max(j, n);\n    }\n  }\n  return l + 1;\n}\n"}
{"label": "10", "index": "17184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, a[100] = {0}, f[100] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  t = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= i; j--)\n      if (a[i] >= a[j])\n        f[i] = (f[i] > f[j]) ? f[i] : f[j];\n    f[i]++;\n    t = (f[i] > t) ? f[i] : t;\n  }\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint h[30];\nint result[30];\n\nint findFirstLess(int num) {\n  int index = 0;\n  while (1) {\n    if (result[index] < num)\n      return index;\n    index++;\n  }\n}\n\nint main() {\n  int k, i = 0, r;\n  scanf(\"%d \", &k);\n  while (1) {\n    if (i >= k)\n      break;\n    scanf(\"%d\", h + i);\n    i++;\n  }\n  result[0] = h[0];\n  i = 1;\n  r = 0;\n  while (i < k) {\n    if (h[i] <= result[r])\n      result[++r] = h[i];\n    if (h[i] > result[r])\n      result[findFirstLess(h[i])] = h[i];\n    i++;\n  }\n\n  printf(\"%d\\n\", r + 1);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, i, j, an[30];\nint DFS(int h, int n) {\n  int t1, t2;\n  if (n == k - 1) {\n    if (an[n] > h)\n      return 0;\n    else\n      return 1;\n  }\n  if (an[n] > h)\n    return DFS(h, n + 1);\n  else {\n    t1 = DFS(h, n + 1);\n    t2 = DFS(an[n], n + 1) + 1;\n    if (t1 > t2) {\n      return t1;\n    } else\n      return t2;\n  }\n}\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> an[i];\n  }\n  cout << DFS(INT_MAX, 0) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17187", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  printf(\"%d\", n);\n  free(a);\n  free(b);\n}\n"}
{"label": "10", "index": "17188", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100], max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n  }\n  for (i = 0; i < 100; i++) {\n    m[i] = 1;\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[j] + 1 >= m[i])) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = k - 1; p >= 0; p--) {\n    if (m[p] >= max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int h, r;\n  } a[30];\n  int i, j, n, k = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].h);\n    a[i].r = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].h >= a[j].h) && (a[i].r <= (a[j].r + 1)))\n        a[i].r = a[j].r + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (k <= a[i].r)\n      k = a[i].r;\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[26], b[26], k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = 1;\n  k = 1;\n  for (j = 1; j < n; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j]) {\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n    if (b[j] > k)\n      k = b[j];\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int s[60];\n  cin >> n;\n  int key = 1;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    s[i + 30] = 1;\n    for (int j = i - 1; j >= 0; j--) {\n      if (s[j] >= s[i]) {\n        if (s[j + 30] >= s[i + 30])\n          s[i + 30] = s[j + 30] + 1;\n      }\n    }\n    if (s[i + 30] > key)\n      key = s[i + 30];\n  }\n  cout << key;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint a[29] = {~0U >> 1}, f[29] = {0};\nint ans = 0;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[i] <= a[j] && f[i] < f[j] + 1) {\n        f[i] = f[j] + 1;\n      }\n    }\n\n    if (f[i] > ans) {\n      ans = f[i];\n    }\n  }\n\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17193", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint aMaxLen[35];\nint nTmp;\nint main() {\n  int k, i;\n  cin >> k;\n  int b[25];\n  for (i = 0; i < k; i++)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= k; i++) {\n    int nTmp = 0;\n    for (int j = 1; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= k; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  printf(\"%d\\n\", nMax);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int k, j, i, a[26] = {0}, length[26] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  length[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    length[i] = 1;\n    for (j = 0; j < i; j++) {\n\n      if (a[i] <= a[j] && length[i] < length[j] + 1)\n        length[i] = length[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    if (length[i] > max) {\n      max = length[i];\n    }\n  }\n\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar max(char a[], char i) {\n  char j, m = a[0];\n  for (j = 1; j < i; j++)\n    if (m < a[j])\n      m = a[j];\n  return (m);\n}\n\nint main() {\n  int h[1000] = {0};\n  char n, i, j;\n  scanf(\"%d\", &n);\n  for (i = n; i >= 1; i--)\n    scanf(\"%d\", &h[i]);\n  char mis[1000] = {0}, temp[1000] = {0};\n  mis[0] = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (h[i] >= h[j])\n        temp[j] = mis[j] + 1;\n      else\n        temp[j] = 0;\n    }\n    mis[i] = max(temp, i);\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d \", mis[i]);\n  cout << max(mis, n + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  q[n - 1] = 1;\n  int best = q[n - 1];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    int a = 0;\n    for (int k = n - 1; k > i; k--) {\n      if (p[i] >= p[k] && q[k] >= a)\n        a = q[k];\n    }\n    q[i] = a + 1;\n    if (q[i] > best)\n      best = q[i];\n  }\n  cout << best << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17197", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int k;\n  cin >> k;\n  int a[k], b[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int d;\n  for (i = k - 2; i >= 0; i--) {\n    d = 0;\n    b[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        if (d < b[j])\n          d = b[j];\n    }\n    b[i] = 1 + d;\n  }\n  for (i = 0; i < k; i++)\n    if (d < b[i])\n      d = b[i];\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "10", "index": "17198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint H[1000], D[1000];\nvoid sort(int i) {\n  int j, k, m, n;\n  for (j = 0; j <= i; j++) {\n    m = j;\n    for (k = j; k <= i; k++)\n      if (D[m] > D[k])\n        m = k;\n    if (m != j) {\n      n = D[j];\n      D[j] = D[m];\n      D[m] = n;\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "10", "index": "17199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int h[40];\n  int num[40];\n  int n;\n  cin >> n;\n  for (int i = 0; i != n; ++i)\n    cin >> h[i];\n  memset(num, 0, sizeof(num));\n  num[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int maxi = 1;\n    for (int j = i - 1; j >= 0; --j) {\n      if (maxi < num[j] + 1 && h[j] >= h[i])\n        maxi = num[j] + 1;\n    }\n    num[i] = maxi;\n  }\n  int temp = 0;\n  for (int i = 0; i != n; ++i) {\n    if (num[i] > temp)\n      temp = num[i];\n  }\n  printf(\"%d\\n\", temp);\n  return 0;\n}\n"}
{"label": "10", "index": "17200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  int k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  int a[30] = {0};\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b[30] = {1};\n  int t;\n  int c[30];\n  for (i = 1; i < k; i++) {\n    t = 0;\n    for (j = 0; j < 30; j++) {\n      c[j] = 0;\n    }\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        c[t] = b[j];\n        t++;\n      }\n    }\n    qsort(c, t, sizeof(int), compare);\n    b[i] = c[0] + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (m < b[i]) {\n      m = b[i];\n    }\n  }\n  cout << m << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint D(int *h, int i, int n) {\n  int j, z = 1, x;\n  if (i < n) {\n    for (j = i + 1; j < n + 1; j++) {\n      if (h[j - 1] <= h[i - 1]) {\n        x = D(h, j, n) + 1;\n        if (z < x)\n          z = x;\n      }\n    }\n  }\n  return z;\n}\nint main() {\n  int i, n, z = 1, h[25], x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n  for (i = 0; i < n; i++) {\n    x = D(h, i + 1, n);\n    if (z < x)\n      z = x;\n  }\n  printf(\"%d\", z);\n  return 0;\n}\n"}
{"label": "10", "index": "17202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint a[1000];\nint f[1000];\n\nvoid input() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\n\nint main() {\n  input();\n  for (int i = 0; i < n; i++)\n    f[i] = 1;\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n  }\n  int ans = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > ans)\n      ans = f[i];\n  cout << ans << endl;\n}\n"}
{"label": "10", "index": "17203", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[25];\nint f(int x) {\n  int t = 1, max = 1;\n  if (a[x + 1] == 0)\n    max = 1;\n  else {\n    for (int i = x + 1; a[i] != 0; i++)\n      if (a[x] >= a[i]) {\n        t = f(i) + 1;\n        if (t > max)\n          max = t;\n      }\n  }\n  return max;\n}\nint main() {\n  int n, t, max, i, M;\n  scanf(\"%d\", &n);\n  memset(a, 0, 25 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  M = f(n - 1);\n  for (i = n - 2; i >= 0; i--) {\n    f(i);\n    if (M < f(i))\n      M = f(i);\n  }\n  printf(\"%d\", M);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17204", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint high[30];\nint ff(int pos, int highflag, int count) {\n  if (pos == k)\n    return count;\n  if (high[pos] <= highflag) {\n    int tmp1 = ff(pos + 1, high[pos], count + 1);\n    int tmp2 = ff(pos + 1, highflag, count);\n    if (tmp1 > tmp2)\n      return tmp1;\n    else\n      return tmp2;\n  } else {\n    return ff(pos + 1, highflag, count);\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> high[i];\n  }\n  int result = ff(0, 99999, 0);\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[30];\nint b[30];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n\n  b[0] = 1;\n  int tmp;\n  for (i = 1; i < n; ++i) {\n    tmp = 0;\n    for (j = 0; j < i; ++j) {\n      if (a[j] >= a[i] && b[j] > tmp) {\n        tmp = b[j];\n      }\n    }\n    b[i] = tmp + 1;\n  }\n\n  tmp = -1;\n  for (i = 0; i < n; ++i) {\n    if (b[i] > tmp) {\n      tmp = b[i];\n    }\n  }\n  printf(\"%d\\n\", tmp);\n  return 0;\n}\n"}
{"label": "10", "index": "17206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 1;\n  int a[25];\n  int b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k, height[25];\nint route(int m) {\n  int i, a = 0, max = 0;\n  for (i = m + 1; i < k; i++)\n    if (height[i] <= height[m])\n      a += 1;\n  if (a == 0)\n    return 1;\n  else {\n    for (i = m + 1; i < k; i++)\n      if (height[i] <= height[m] && route(i) > max)\n        max = route(i);\n    return (max + 1);\n  }\n}\nint main() {\n  int i, ans[25], a = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &height[i]);\n  for (i = 0; i < k; i++)\n    ans[i] = route(i);\n  for (i = 0; i < k; i++)\n    if (ans[i] > a)\n      a = ans[i];\n  cout << a << \"\\n\";\n}\n"}
{"label": "10", "index": "17208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, d[1000] = {0};\n  int k, i, j;\n  int max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = k - 1; j > i; j--) {\n      if (a[j] <= a[i]) {\n        if (d[j] > max)\n          max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n\n  max = d[0];\n  for (i = 1; i < k; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a[25], b[25], i, j, t, s = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    b[i] = 1 + t;\n    if (b[i] > s)\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "17210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int p[], int n) {\n  int t, m = 0;\n  m = p[0];\n  p[0] = 0;\n  for (t = 0; t < n; t++) {\n    if (m < p[t])\n      m = p[t];\n    p[t] = 0;\n  }\n  return m;\n}\nint main() {\n  int m, t, p = 0, k, n;\n  int c[25];\n  scanf(\"%d\", &m);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(m * sizeof(int));\n  for (t = 0; t < m; t++)\n    scanf(\"%d\", &a[t]);\n  b[m - 1] = 1;\n  for (t = (m - 2); t > (-1); t--) {\n    for (n = (t + 1); n < m; n++) {\n      if (a[t] >= a[n]) {\n        c[p] = b[n];\n        p++;\n      }\n    }\n    b[t] = max(c, p) + 1;\n    p = 0;\n  }\n  k = max(b, m);\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17211", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, a[30], f[30], ans;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i)\n    cin >> a[i];\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 1; j <= i; ++j)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  ans = 0;\n  for (int i = 1; i <= n; ++i)\n    if (f[i] > ans)\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n}\n"}
{"label": "10", "index": "17212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint h[100], s[100] = {0}, n;\nint p(int i) {\n  int s1 = 0, s2, j;\n  if (s[i] == 0) {\n\n    for (j = i + 1; j < n; j++) {\n      s2 = s1;\n      if (h[i] < h[j])\n        s1 = 0;\n      else\n        s1 = p(j) + 1;\n      if (s1 < s2)\n        s1 = s2;\n    }\n    s[i] = s1;\n  } else\n    s1 = s[i];\n\n  return (s1);\n}\nint main() {\n  int i, s1 = 0, s2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < n; i++) {\n    s2 = s1;\n    s1 = p(i);\n    if (s1 < s2)\n      s1 = s2;\n  }\n  cout << s1 + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "17213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, dmax, a[100], d[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (d[i] <= d[j])) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax)\n      dmax = d[i];\n  }\n\n  printf(\"%d\\n\", dmax);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int k, j, i, a[26] = {0}, length[26] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  length[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    length[i] = 1;\n    for (j = 0; j < i; j++) {\n\n      if (a[i] <= a[j] && length[i] < length[j] + 1)\n        length[i] = length[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    if (length[i] > max) {\n      max = length[i];\n    }\n  }\n\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17215", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint lanjie(int x, int p);\nint max(int a, int b);\nint n, t = 0, h[25], r[25][10000];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d\", lanjie(0, 10000));\n  return 0;\n}\nint lanjie(int x, int p) {\n  if (r[x][p])\n    return r[x][p];\n  else if (x == n - 1) {\n    if (h[x] <= p)\n      return r[x][p] = 1;\n    else\n      return r[x][p] = 0;\n  } else {\n    int f;\n    if (h[x] <= p)\n      f = max(1 + lanjie(x + 1, h[x]), lanjie(x + 1, p));\n    else\n      f = lanjie(x + 1, p);\n    return r[x][p] = f;\n  }\n}\nint max(int a, int b) { return (a > b) ? a : b; }\n"}
{"label": "10", "index": "17216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, ans;\nint f[1000];\nint a[1000];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n    ans = ans > f[i] ? ans : f[i];\n  }\n  cout << ans << endl;\n}\n"}
{"label": "10", "index": "17217", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], c[25], i, j, n, max = 0, q;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i; j < n; j++) {\n      if (a[i] >= a[j]) {\n        c[j - i] = b[j] + 1;\n      } else {\n        c[j - i] = 1;\n      }\n    }\n    for (j = 0; j < n - i; j++) {\n      if (c[j] >= b[i])\n        b[i] = c[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  int b[25], j;\n  b[k - 1] = 1;\n  if (a[k - 2] >= a[k - 1])\n    b[k - 2] = 2;\n  else\n    b[k - 2] = 1;\n  int max;\n\n  for (j = k - 3; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i <= k - 1; i++) {\n      if (a[j] >= a[i] && b[i] >= max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n  }\n\n  max = 0;\n  for (j = 0; j <= k - 1; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint dao[26], n;\nint fly(int high, int m) {\n  if (m == n)\n    return 0;\n  else {\n    if (high < dao[m])\n      return fly(high, m + 1);\n    else {\n      return max(fly(high, m + 1), fly(dao[m], m + 1) + 1);\n    }\n  }\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &dao[i]);\n  k = fly(99999, 0);\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint b[1000 + 10];\nint aMaxLen[1000 + 10];\nint main() {\n  int N, i, j;\n  cin >> N;\n  for (i = N; i >= 1; i--)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int nTmp = 0;\n    for (j = 1; j < i; j++) {\n      if (b[i] >= b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= N; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  cout << nMax << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17221", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[26];\nint f(int j);\n\nint main() {\n  int i, k, t;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d \", &s[i]);\n  for (t = 0, i = 1; i <= k; i++) {\n    if (f(i) > t)\n      t = f(i);\n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n\nint f(int j) {\n  int z, i, t;\n  if (j == 1)\n    z = 1;\n  else {\n    for (t = 0, i = 1; i < j; i++) {\n      if (s[i] >= s[j] && f(i) > t)\n        t = f(i);\n    }\n    z = t + 1;\n  }\n  return z;\n}\n"}
{"label": "10", "index": "17222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, t;\n  int *p, *max;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  max = (int *)malloc(k * sizeof(int));\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i <= k - 1; i++) {\n    t = 0;\n    for (j = 0; j < i; j++)\n      if (*(p + j) >= *(p + i))\n        if (t < *(max + j))\n          t = *(max + j);\n    *(max + i) = t + 1;\n  }\n\n  t = 0;\n  for (i = 0; i <= k - 1; i++)\n    if (*(max + i) > t)\n      t = *(max + i);\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, t, m;\n  int a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i = i + 1)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i = i - 1) {\n    for (t = 0, m = i + 1; m < k; m = m + 1)\n      if (a[i] >= a[m] && b[m] > t)\n        t = b[m];\n    b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < k; i = i + 1)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100] = {0}, b[100] = {0}, sum = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    b[i] = 1;\n\n    for (j = 1; j < i; j++)\n\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n\n        b[i] = b[j] + 1;\n\n    if (sum < b[i])\n      sum = b[i];\n  }\n\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "10", "index": "17225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[50] = {0};\n  int f[50], max, i, j, n;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n        else\n          f[i] = f[i];\n      }\n    }\n  }\n  max = f[0];\n  for (i = 1; i < n; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  cout << max << \" \";\n}\n"}
{"label": "10", "index": "17226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], f[26]; \n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    f[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (f[i] > k)\n      k = f[i];\n  }\n  printf(\"%d\", k);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int m[], int i, int k);\nint main() {\n  int k, i, t, ans = 0;\n  int m[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i <= k; i++) {\n    t = num(m, i, k);\n    if (t > ans)\n      ans = t;\n  }\n  printf(\"%d\", ans);\n}\nint num(int m[], int i, int k) {\n  int re = 0, j, t;\n  if (i == k)\n    return (0);\n  for (j = i + 1; j <= k; j++)\n    if (m[j] <= m[i]) {\n      t = num(m, j, k);\n      if (t > re)\n        re = t;\n    }\n  re++;\n  return (re);\n}\n"}
{"label": "10", "index": "17228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *f = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j <= i; j++) {\n      if (p[i] <= p[j] && t <= f[j])\n        t = f[j];\n    }\n    f[i] = t + 1;\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    if (t < f[i])\n      t = f[i];\n  }\n  cout << t << \" \";\n}\n"}
{"label": "10", "index": "17229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25], i, j, max, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (a[j] <= a[i]) {\n        s = b[j] + 1;\n        if (s >= max)\n          max = s;\n      }\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[28];\n  int m[28];\n  int n = 0;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &s[i]);\n    m[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && m[j] + 1 > m[i]) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < m[i])\n      max = m[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, i;\nint h[26];\nint max(int a, int b) {\n  if (a > b) {\n    return a;\n  } else\n    return b;\n}\n\nint f(int t, int l) {\n  if (t == 1) {\n    if (h[1] >= l)\n      return 1;\n    else\n      return 0;\n  }\n\n  else if (h[t] < l)\n    return f(t - 1, l);\n  else\n    return max(f(t - 1, l), f(t - 1, h[t]) + 1);\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n  cout << f(n, 0);\n  return 0;\n}\n"}
{"label": "10", "index": "17232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint aMaxLen[35];\nint nTmp;\nint main() {\n  int k, i;\n  cin >> k;\n  int b[25];\n  for (i = 0; i < k; i++)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= k; i++) {\n    int nTmp = 0;\n    for (int j = 1; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= k; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  cout << nMax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int opt[n];\n  for (i = 0; i < n; i++) {\n    opt[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && opt[j] + 1 > opt[i])\n        opt[i] = opt[j] + 1;\n    }\n  }\n  int t = 0;\n  for (i = 0; i < n; i++) {\n    if (opt[i] > t)\n      t = opt[i];\n  }\n  cout << t;\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17234", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000], s[1000], max = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    s[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && s[i] < s[j] + 1)\n        s[i] = s[j] + 1;\n  for (i = 0; i < n - 1; i++)\n    max = (max > s[i]) ? max : s[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17235", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int k;\n  scanf(\"%d\", &k);\n  int a[k], b[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  b[k - 1] = 1;\n  int d;\n  for (i = k - 2; i >= 0; i--) {\n    d = 0;\n    b[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        if (d < b[j])\n          d = b[j];\n      }\n    }\n    b[i] = 1 + d;\n  }\n  for (i = 0; i < k; i++)\n    if (d < b[i])\n      d = b[i];\n  printf(\"%d\", d);\n}\n"}
{"label": "10", "index": "17236", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s[25], i, j, a[25], n, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    s[i] = 1;\n    max = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && s[j] > max)\n        max = s[j];\n    s[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (max < s[i])\n      max = s[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17237", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nconst int maxk = 300;\n\nint main() {\n  int k;\n  int a[maxk];\n  int f[maxk];\n\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n\n  int ans = 0;\n\n  f[0] = 1;\n\n  for (int i = 1; i < k; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i]) {\n        f[i] = f[j] + 1;\n      }\n    };\n    if (f[i] > ans)\n      ans = f[i];\n  };\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n};\n"}
{"label": "10", "index": "17238", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sta[20002];\nint mycmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint main() {\n  int input[30] = {0};\n  int cnt[30] = {0};\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> input[i];\n  cnt[0] = 1;\n  for (i = 1; i < n; i++) {\n    int max = 0;\n    for (int k = i - 1; k >= 0; k--) {\n      if (cnt[k] > max && input[k] >= input[i])\n        max = cnt[k];\n    }\n    cnt[i] = max + 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++)\n    if (m < cnt[i])\n      m = cnt[i];\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, n, m, temp;\n  int a[26], g[26];\n  scanf(\"%d\\n\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> a[i];\n  for (m = 1; m <= k; m++)\n    g[m] = 1;\n  for (n = k - 1; n > 0; n--)\n    for (j = n + 1; j <= k; j++) {\n      if (a[n] >= a[j] && g[n] - 1 < g[j]) {\n        g[n] = g[j] + 1;\n      }\n    }\n  for (i = 1; i < k; i++) {\n    for (j = i + 1; j <= k; j++)\n      if (g[i] < g[j]) {\n        temp = g[i];\n        g[i] = g[j];\n        g[j] = temp;\n      }\n  }\n  printf(\"%d\", g[1]);\n  return 0;\n}\n"}
{"label": "10", "index": "17240", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar max(char a[], char i) {\n  char j, m = a[0];\n  for (j = 1; j < i; j++)\n    if (m < a[j])\n      m = a[j];\n  return (m);\n}\n\nint main() {\n  int h[1000] = {0};\n  char n, i, j;\n  scanf(\"%d\", &n);\n  for (i = n; i >= 1; i--)\n    cin >> h[i];\n  char mis[1000] = {0}, temp[1000] = {0};\n  mis[0] = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (h[i] >= h[j])\n        temp[j] = mis[j] + 1;\n      else\n        temp[j] = 0;\n    }\n    mis[i] = max(temp, i);\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d \", mis[i]);\n  printf(\"%d\", max(mis, n + 1));\n}\n"}
{"label": "10", "index": "17241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j;\nint main() {\n  int b[26] = {0};\n  int k;\n  int f(int x, int y, int a[26]);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"%d\\n\", f(k, k, b) - 1);\n  return 0;\n}\nint f(int x, int y, int a[26]) {\n  if (y == 0) {\n    return (1);\n  }\n  int s = 0;\n  if (y >= 1) {\n    for (i = 0; i < y; i++) {\n      if (a[i] >= a[y] && f(x, i, a) >= s) {\n        s = f(x, i, a);\n      }\n    }\n  }\n  if (i == y)\n    return (s + 1);\n}\n"}
{"label": "10", "index": "17242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[30], f[30], ans;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i)\n    scanf(\"%d\", &a[i]);\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 1; j <= i; ++j)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  ans = 0;\n  for (int i = 1; i <= n; ++i)\n    if (f[i] > ans)\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n}\n"}
{"label": "10", "index": "17243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, i, j, t;\n  int a[26], b[26], c[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        c[j] = b[j] + 1;\n      else\n        c[j] = 1;\n      for (m = j; m > 0; m--) {\n        if (c[m] >= c[m - 1]) {\n          t = c[m - 1];\n          c[m - 1] = c[m];\n          c[m] = t;\n        }\n      }\n      b[i] = c[0];\n    }\n\n  for (i = k - 1; i > 0; i--)\n    if (b[i] >= b[i - 1]) {\n      t = b[i - 1];\n      b[i - 1] = b[i];\n      b[i] = t;\n    }\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "17244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], i, j, n, m = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "17245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint calc(int *, int, int);\n\nint main() {\n  int k, h[25], i = 0;\n  cin >> k;\n  while (cin >> h[i]) {\n    i++;\n    if (i == k)\n      break;\n  }\n  cout << calc(h, k, (1 << 31 - 1));\n}\n\nint calc(int *h, int k, int limit) {\n  int i, ret = 0, t = 0;\n  for (i = 0; i < k; i++) {\n    if (h[i] > limit)\n      continue;\n    t = 1 + calc(h + i + 1, k - i - 1, h[i]);\n    if (t > ret)\n      ret = t;\n  }\n  return ret;\n}\n"}
{"label": "10", "index": "17246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int b[25]) {\n  int i, t = b[0];\n  for (i = 0; i < 25; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  return t;\n}\nint destroy(int a[25], int t) {\n  int b[25] = {1};\n  int i, j;\n  for (j = t - 1; j >= 0; j--) {\n    for (i = j + 1; i <= t; i++) {\n      if (a[j] >= a[i] && (b[i] + 1) > b[j])\n        b[j] = b[i] + 1;\n    }\n  }\n  return max(b) + 1;\n}\nint main() {\n  int x, i = 0;\n  int a[25] = {0};\n  cin >> x;\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &a[i]);\n  cout << destroy(a, x - 1);\n}\n"}
{"label": "10", "index": "17247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, t, m;\n  int a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i = i + 1)\n    scanf(\"%d \", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i = i - 1) {\n    for (t = 0, m = i + 1; m < k; m = m + 1)\n      if (a[i] >= a[m] && b[m] > t)\n        t = b[m];\n    b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < k; i = i + 1)\n    if (b[i] > t)\n      t = b[i];\n  cout << t;\n}\n"}
{"label": "10", "index": "17248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\ninline int max(int a, int b) { return a > b ? a : b; }\nint n, a[30];\nint after(int i, int fin, int n);\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  a[0] = 1000000;\n  cout << after(1, 0, n) << \"\\n\";\n  return 0;\n}\n\nint after(int i, int fin, int n) {\n  if (i == n) {\n    if (a[n] <= a[fin])\n      return 1;\n    else\n      return 0;\n\n  } else {\n    int z;\n    if (a[i] <= a[fin])\n      z = max(1 + after(i + 1, i, n), after(i + 1, fin, n));\n    else\n      z = after(i + 1, fin, n);\n    return z;\n  }\n}\n"}
{"label": "10", "index": "17249", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint result;\n\nvoid bfs(int a[], int n, int i, int u) {\n  int j;\n\n  if (result < u)\n    result = u;\n  if (i < n) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        bfs(a, n, j, u + 1);\n    }\n  }\n}\n\nint main() {\n  int R, C, i, j, n;\n  int a[26], b[26][26];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  result = 0;\n  a[0] = 99999;\n  bfs(a, n, 0, 0);\n\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30], i, b[30], j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n\n    {\n      if (a[j] >= a[i]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (b[j] > b[j + 1])\n      b[j + 1] = b[j];\n  }\n  cout << b[n - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, j, x, y, max;\n  scanf(\"%d\", &n);\n  int a[26], b[26];\n  for (i = n - 1; i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  i = 0;\n  while (i <= n - 1) {\n    j = 0;\n    x = 0;\n    while (j < i) {\n      if (a[j] <= a[i]) {\n        if (b[j] >= x)\n          x = b[j];\n      }\n      j++;\n    }\n    b[i] = x + 1;\n    i++;\n  }\n  max = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] >= max)\n      max = b[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100] = {0}, i = 0, j = 0, d[100] = {0}, c = 0, max = 1;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if ((d[j] > c) && (a[j] <= a[i]))\n        c = d[j];\n    }\n    d[i] = c + 1;\n    c = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct z {\n  int g;\n  int h;\n};\nint main() {\n  int k, i, j, w;\n  struct z a[50];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i].g);\n  }\n  for (i = 0; i < k; i++) {\n    a[i].h = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].g >= a[j].g) {\n        if (a[i].h < a[j].h + 1)\n          a[i].h = a[j].h + 1;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].h < a[j].h) {\n        w = a[i].h;\n        a[i].h = a[j].h;\n        a[j].h = w;\n      }\n    }\n  }\n  printf(\"%d\\n\", a[0].h);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int dp[50];\n  int m[50];\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  for (int i = 0; i < n; i++)\n    dp[i] = 1;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (m[i] <= m[j]) {\n        dp[i] = max(dp[j] + 1, dp[i]);\n      }\n    }\n  }\n  int maxl = 0;\n  for (int i = 0; i < n; i++)\n    if (dp[i] > maxl)\n      maxl = dp[i];\n  cout << maxl;\n  return 0;\n}\n"}
{"label": "10", "index": "17255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nconst int N = 25 + 10;\nint h[N];\nint dp[N];\n\nint main(void) {\n  int ans, cnt, i, j;\n  while (scanf(\"%d\", &cnt) != EOF) {\n    for (i = 0; i < cnt; ++i)\n      scanf(\"%d\", h + i);\n\n    dp[0] = 1;\n    for (i = 1; i < cnt; ++i) {\n      dp[i] = 1;\n      for (j = 0; j < i; ++j) {\n        if (h[i] <= h[j]) {\n          dp[i] = max(dp[i], dp[j] + 1);\n        }\n      }\n    }\n    ans = 0;\n    for (i = 0; i < cnt; ++i) {\n      ans = max(ans, dp[i]);\n    }\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "17256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n}\n"}
{"label": "10", "index": "17257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint xxx(int high, int j);\nint max(int b, int c) {\n  if (b >= c)\n    return b;\n  else\n    return c;\n}\nint n;\nint x[26];\nint main() {\n  int i;\n  int m, k;\n  scanf(\"%d\", &n);\n  int h[n];\n  for (i = 0; i < n; i++) {\n    cin >> h[i];\n    x[i] = h[i];\n  }\n  for (i = n; i < 26; i++)\n    x[i] = 999999;\n  int fly;\n  fly = xxx(999999, 0);\n  cout << fly;\n}\nint xxx(int high, int j) {\n  if (j == n - 1) {\n    if (high >= x[j])\n      return 1;\n    else\n      return 0;\n  } else {\n    if (high < x[j])\n      return xxx(high, j + 1);\n    else\n      return max(1 + xxx(x[j], j + 1), xxx(high, j + 1));\n  }\n}\n"}
{"label": "10", "index": "17258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], m = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    for (int j = i - 1; j >= 0; j--)\n      if (a[j] >= a[i] && b[j] < b[i] + 1)\n        b[j] = b[i] + 1;\n  for (int i = 0; i < n; i++)\n    if (m < b[i])\n      m = b[i];\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int b[25];\n  int i, j, max;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (max < b[j])\n          max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int s[], int n) {\n  int i, d = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] > d)\n      d = s[i];\n  }\n  return d;\n}\nvoid bl(int h[], int s[], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      s[i] = 1;\n    else {\n      s[i] = 1;\n      for (j = 0; j < i; j++)\n        if (h[j] >= h[i] && (s[j] + 1) > s[i]) {\n          s[i] = s[j] + 1;\n        }\n    }\n  }\n}\nint main() {\n  int r, i, n;\n  scanf(\"%d\", &n);\n  int h[26], d[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &h[i]);\n  bl(h, d, n);\n  r = max(d, n);\n  cout << r;\n}\n"}
{"label": "10", "index": "17261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = (b[i]);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n, i, j, e, s, r, t;\n  int a[300], b[300];\n  scanf(\"%d\", &k);\n  s = 1;\n  r = 1;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = i;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] < a[j]) {\n        e = a[i];\n        a[i] = a[j];\n        a[j] = e;\n        e = b[i];\n        b[i] = b[j];\n        b[j] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    n = b[i];\n    r = 1;\n    for (j = i + 1; j < k; j++) {\n      if (b[j] > n) {\n        r++;\n        n = b[j];\n      }\n    }\n    if (r > s) {\n      s = r;\n      t = i;\n    }\n  }\n  if (k == 25) {\n    s = s + 2;\n  };\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "17263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint height[25];\n\nint stop(int k);\nint main() {\n\n  cin >> n;\n  int i, MAX = 0;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++) {\n    if (MAX < stop(i))\n      MAX = stop(i);\n  }\n  cout << MAX;\n  return 0;\n}\n\nint stop(int k) {\n  int j, max = 0;\n  for (j = k + 1; j < n; j++) {\n    if (height[j] <= height[k]) {\n      if (max < stop(j))\n        max = stop(j);\n    }\n  }\n  return max + 1;\n}\n"}
{"label": "10", "index": "17264", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[100], mark[100] = {0}, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  mark[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] <= num[i] && mark[j] > max) {\n        max = mark[j];\n      }\n    }\n    mark[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (mark[i] > max) {\n      max = mark[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[29], max_1[29] = {0}, count_1[29] = {0};\nint N;\nint select(int x) {\n  if (count_1[x] == 0) {\n\n    int i;\n    for (i = x + 1; i <= N; i++) {\n      if (a[x] >= a[i]) {\n        if (max_1[x] <= select(i)) {\n          max_1[x] = select(i) + 1;\n        }\n      }\n    }\n    if (max_1[x] == 0) {\n      max_1[x] = 1;\n    }\n    count_1[x] = 1;\n  }\n\n  return max_1[x];\n}\n\nint main() {\n  int max_1m;\n  scanf(\"%d\", &N);\n  for (int j = 1; j <= N; j++)\n    scanf(\"%d\", &a[j]);\n\n  max_1m = select(1);\n  for (int k = 2; k <= N; k++) {\n    if (max_1m < select(k)) {\n      max_1m = select(k);\n    }\n  }\n\n  cout << max_1m;\n}\n"}
{"label": "10", "index": "17266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[26] = {0}, q[26] = {0}, a = 0, b, c, d, e, f, g, i, j, k, l, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> p[i];\n  }\n  q[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    b = 1;\n    for (j = i + 1; j < k; j++) {\n      if (p[i] >= p[j]) {\n        if (q[j] + 1 > b)\n          b = q[j] + 1;\n      }\n    }\n    q[i] = b;\n  }\n  for (i = 0; i < k; i++) {\n    if (a < q[i])\n      a = q[i];\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "10", "index": "17267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, i, j, n = 0, t;\nint a[25], b[25];\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        t = b[j] + 1;\n        if (t > b[i])\n          b[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (b[i] > n)\n      n = b[i];\n  cout << n + 1;\n}\n"}
{"label": "10", "index": "17268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst long maxn = 25;\n\nlong n;\nlong a[maxn + 10];\n\nlong ans;\n\nvoid dfs(long h, long maxH, long now) {\n\n  if (h == n + 1) {\n    if (now > ans)\n      ans = now;\n    return;\n  }\n  dfs(h + 1, maxH, now);\n  if (a[h] <= maxH)\n    dfs(h + 1, a[h], now + 1);\n}\n\nint main() {\n  long i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", a + i);\n  }\n  dfs(1, 1 << 30, 0);\n  cout << ans << \" \";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17269", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[30], dp[30] = {1};\nint n;\nint ans = -1;\nint main() {\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k[25], a[25];\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &k[i]);\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j <= n - 1; j++)\n      if ((k[j] <= k[i]) && (a[i] <= a[j]))\n        a[i] = a[j] + 1;\n  for (max = 0, i = 0; i < n; i++)\n    if (a[i] >= max)\n      max = a[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "17271", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[25], i, j, x[25][2], n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> high[i];\n  for (i = 0; i < n; i++)\n    x[i][0] = 1;\n  for (i = 0; i < n; i++)\n    x[i][1] = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((high[j] >= high[i]) && (x[j][0] >= x[i][0]))\n        x[i][0] = x[j][0] + 1;\n      if (x[j][1] > x[i][1])\n        x[i][1] = x[j][1];\n      if (x[j][0] > x[i][1])\n        x[i][1] = x[j][0];\n    }\n  }\n  i--;\n  if (x[i][0] < x[i][1])\n    x[i][0] = x[i][1];\n  printf(\"%d\", x[i][0]);\n}\n"}
{"label": "10", "index": "17272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    cin >> a[i];\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i])\n        t = 1 + max(a, i);\n      if (t > s[m]) {\n        s[m] = t;\n      }\n    }\n    return (s[m]);\n  }\n}\n"}
{"label": "10", "index": "17273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint height[25];\n\nint stop(int k);\nint main() {\n\n  scanf(\"%d \", &n);\n  int i, MAX = 0;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++) {\n    if (MAX < stop(i)) {\n      MAX = stop(i);\n    }\n  }\n  printf(\"%d\", MAX);\n  return 0;\n}\n\nint stop(int k) {\n  int j, max = 0;\n  for (j = k + 1; j < n; j++) {\n    if (height[j] <= height[k]) {\n      if (max < stop(j))\n        max = stop(j);\n    }\n  }\n  return max + 1;\n}\n"}
{"label": "10", "index": "17274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, ans;\nint f[1000];\nint a[1000];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n    ans = ans > f[i] ? ans : f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint Height[26];\nint MaxLen[26];\n\nvoid LIS(int k) {\n  memset(MaxLen, 0, sizeof(MaxLen));\n  for (int i = 1; i <= k; i++) {\n    MaxLen[i] = 1;\n\n    for (int j = 1; j < i; j++) {\n\n      if (Height[i] <= Height[j]) {\n\n        int preMax = MaxLen[j] + 1;\n        if (preMax > MaxLen[i])\n          MaxLen[i] = preMax;\n      }\n    }\n  }\n}\n\nint main() {\n  int N, i;\n  scanf(\"%d\", &N);\n\n  for (i = 1; i <= N; i++) {\n    scanf(\"%d\", &Height[i]);\n  }\n  LIS(N);\n  int Max = -1;\n\n  for (i = 1; i <= N; i++) {\n    if (Max < MaxLen[i]) {\n      Max = MaxLen[i];\n    }\n  }\n  if (N != 0) {\n    printf(\"%d\\n\", Max);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "17276", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sta[20002];\nint mycmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint main() {\n  int input[30] = {0};\n  int cnt[30] = {0};\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> input[i];\n  cnt[0] = 1;\n  for (i = 1; i < n; i++) {\n    int max = 0;\n    for (int k = i - 1; k >= 0; k--) {\n      if (cnt[k] > max && input[k] >= input[i])\n        max = cnt[k];\n    }\n    cnt[i] = max + 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++)\n    if (m < cnt[i])\n      m = cnt[i];\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, h[30], l[30], r[30];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 1;\n    r[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && (l[j] + 1) > l[i]) {\n        l[i] = l[j] + 1;\n      }\n    }\n  }\n  for (i = k - 2; i > 0; i--) {\n    for (int j = k - 1; j > i; j--) {\n      if (h[j] <= h[i] && (r[j] + 1) > r[i]) {\n        r[i] = r[j] + 1;\n      }\n    }\n  }\n  int m = 0;\n  for (i = 0; i < k; i++) {\n    if (l[i] + r[i] - 1 > m) {\n      m = l[i] + r[i] - 1;\n    }\n  }\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n  }\n  for (int i = 1; i < k; i++) {\n    for (int t = 0; t < i; t++)\n      if (a[t] >= a[i] && b[t] + 1 >= b[i])\n        b[i] = b[t] + 1;\n  }\n  int max = b[0];\n  for (int i = 1; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dd(int no, float h);\nint n, a[25];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << dd(1, 10000) << endl;\n  return 0;\n}\nint dd(int no, float h) {\n  while (h < a[no - 1]) {\n    if (no == n)\n      break;\n    no++;\n  }\n  if (no == n) {\n    if (h >= a[n - 1]) {\n      return 1;\n    } else {\n      return 0;\n    }\n  } else {\n    int b = dd(no + 1, a[no - 1]);\n    int c = dd(no + 1, h);\n    if (b >= c) {\n      return b + 1;\n    } else {\n      return c;\n    }\n  }\n}\n"}
{"label": "10", "index": "17280", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    if (t > 0)\n      b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h[25], num[25], k, n, i, j, max, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> h[i];\n    num[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    flag = 0;\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i]) {\n        if (!flag) {\n          k = j;\n          flag = 1;\n        } else if (num[j] > num[k])\n          k = j;\n      }\n    if (flag)\n      num[i] = num[k] + 1;\n    else\n      num[i] = 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int a[k], b[100];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[25];\nint f(int x) {\n  int t = 1, max = 1;\n  if (a[x + 1] == 0)\n    max = 1;\n  else {\n    for (int i = x + 1; a[i] != 0; i++)\n      if (a[x] >= a[i]) {\n        t = f(i) + 1;\n        if (t > max)\n          max = t;\n      }\n  }\n  return max;\n}\nint main() {\n  int n, i, M;\n  scanf(\"%d\", &n);\n  memset(a, 0, 25 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  M = f(n - 1);\n  for (i = n - 2; i >= 0; i--) {\n    f(i);\n    if (M < f(i))\n      M = f(i);\n  }\n  printf(\"%d\", M);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k;\nint mis[30];\nint maxL = 0;\nint curH = 100000;\nint getNum = 0;\nint cmp(int a, int b) {\n  if (a > b)\n    return 0;\n  else\n    return 1;\n}\n\nvoid oneState(int id) {\n  if (id >= k) {\n    if (getNum > maxL)\n      maxL = getNum;\n    return;\n  }\n\n  if (mis[id] <= curH) {\n    int t = curH;\n    curH = mis[id];\n    getNum++;\n\n    oneState(id + 1);\n\n    curH = t;\n    getNum--;\n  }\n\n  oneState(id + 1);\n}\n\nint main() {\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    cin >> mis[i];\n\n  oneState(0);\n  printf(\"%d\\n\", maxL);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17285", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, h[25], a[25][25] = {0};\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  int max = 1;\n  for (int i = 0; i < k; i++)\n    a[i][i] = 1;\n  for (int i = 0; i < k - 1; i++)\n    for (int j = i + 1; j < k; j++) {\n      a[i][j] = 1;\n      for (int k = i; k < j; k++)\n        if (h[k] >= h[j] && a[i][k] + 1 > a[i][j])\n          a[i][j] = a[i][k] + 1;\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17286", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint high[30];\nint ff(int pos, int highflag, int count) {\n  if (pos == k)\n    return count;\n  if (high[pos] <= highflag) {\n    int tmp1 = ff(pos + 1, high[pos], count + 1);\n    int tmp2 = ff(pos + 1, highflag, count);\n    if (tmp1 > tmp2)\n      return tmp1;\n    else\n      return tmp2;\n  } else\n    return ff(pos + 1, highflag, count);\n}\nint main() {\n  int i;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> high[i];\n\n  int result = ff(0, 99999, 0);\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17287", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[25];\n  int rem[25] = {1};\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  int MMax = 0;\n  for (int i = 1; i < n; i++) {\n    int max = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (j < max)\n        break;\n      if (a[j] >= a[i] && rem[j] > max)\n        max = rem[j];\n    }\n    rem[i] = max + 1;\n    if (rem[i] > MMax)\n      MMax = rem[i];\n  }\n  printf(\"%d\\n\", MMax);\n  return 0;\n}\n"}
{"label": "10", "index": "17288", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint xu(int a[], int n, int k) {\n  int i, b = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[k] < a[i])\n      b++;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[k] > a[i])\n      b = b + 1;\n  }\n  return (b);\n}\nint max(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return i;\n    }\n  }\n}\nint maxd(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return (b[i]);\n    }\n  }\n}\nint shai(int a[], int n) {\n  int i, j, m[30] = {0};\n\n  for (i = 0; i < n; i++) {\n    m[i] = xu(a, n, i);\n    \n  }\n  if (maxd(m, n) == 0) {\n    return (n);\n  } else {\n    for (j = max(m, n); j < n; j++) {\n      a[j] = a[j + 1];\n    }\n    shai(a, n - 1);\n  }\n}\nint main() {\n  int k = 0;\n  int a[30] = {0};\n  int lRet;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  lRet = shai(a, k);\n  printf(\"%d\", lRet);\n\n  return (1);\n}\n"}
{"label": "10", "index": "17289", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, d = 1;\n  int b[25], c[25];\n  int i, j;\n  cin >> a;\n  for (i = 0; i < a; i++)\n    scanf(\"%d \", &b[i]);\n  for (i = 0; i < a; i++)\n    c[i] = b[i];\n  for (i = 1; i < a; i++) {\n    for (j = d - 1; j >= 0; j--) {\n      if (b[i] <= c[j])\n        break;\n    }\n    c[j + 1] = c[i];\n    if (j == d - 1)\n      d++;\n  }\n  printf(\"%d\", d);\n}\n"}
{"label": "10", "index": "17290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, max, n;\n  int a[30], b[30];\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    j = i - 1;\n    max = 0;\n    while (j >= 0) {\n      if (a[i] <= a[j] && max < b[j] + 1) {\n        max = b[j];\n      }\n      j--;\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i[26], a[26], b[26], x = 0;\n  scanf(\"%d\", &k);\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    b[i[0]] = 0;\n  for (i[0] = 0; i[0] < k; i[0]++)\n    scanf(\"%d\", &a[i[0]]);\n  for (i[0] = 0; i[0] < k; i[0]++) {\n    b[0] = a[i[0]];\n    for (i[1] = i[0] + 1; i[1] <= k; i[1]++)\n      if ((b[1] = a[i[1]]) <= b[0])\n        for (i[2] = i[1] + 1; i[2] <= k; i[2]++)\n          if ((b[2] = a[i[2]]) <= b[1])\n            for (i[3] = i[2] + 1; i[3] <= k; i[3]++)\n              if ((b[3] = a[i[3]]) <= b[2])\n                for (i[4] = i[3] + 1; i[4] <= k; i[4]++)\n                  if ((b[4] = a[i[4]]) <= b[3])\n                    for (i[5] = i[4] + 1; i[5] <= k; i[5]++)\n                      if ((b[5] = a[i[5]]) <= b[4])\n                        for (i[6] = i[5] + 1; i[6] <= k; i[6]++)\n                          if ((b[6] = a[i[6]]) <= b[5])\n                            for (i[7] = i[6] + 1; i[7] <= k; i[7]++)\n                              if ((b[7] = a[i[7]]) <= b[6])\n                                for (i[8] = i[7] + 1; i[8] <= k; i[8]++)\n                                  if ((b[8] = a[i[8]]) <= b[7])\n                                    for (i[9] = i[8] + 1; i[9] <= k; i[9]++)\n                                      if ((b[9] = a[i[9]]) <= b[8])\n                                        for (i[10] = i[9] + 1; i[10] <= k;\n                                             i[10]++)\n                                          if ((b[10] = a[i[10]]) <= b[9])\n                                            for (i[11] = i[10] + 1; i[11] <= k;\n                                                 i[11]++)\n                                              if ((b[11] = a[i[11]]) <= b[10])\n                                                for (i[12] = i[11] + 1;\n                                                     i[12] <= k; i[12]++)\n                                                  if ((b[12] = a[i[12]]) <=\n                                                      b[11])\n                                                    for (i[13] = i[12] + 1;\n                                                         i[13] <= k; i[13]++)\n                                                      if ((b[13] = a[i[13]]) <=\n                                                          b[12])\n                                                        for (i[14] = i[13] + 1;\n                                                             i[14] <= k;\n                                                             i[14]++)\n                                                          if ((b[14] =\n                                                                   a[i[14]]) <=\n                                                              b[13])\n                                                            for (i[15] =\n                                                                     i[14] + 1;\n                                                                 i[15] <= k;\n                                                                 i[15]++)\n                                                              if ((b[15] = a\n                                                                       [i[15]]) <=\n                                                                  b[14])\n                                                                for (i[16] =\n                                                                         i[15] +\n                                                                         1;\n                                                                     i[16] <= k;\n                                                                     i[16]++)\n                                                                  if ((b[16] = a\n                                                                           [i[16]]) <=\n                                                                      b[15])\n                                                                    for (\n                                                                        i[17] =\n                                                                            i[16] +\n                                                                            1;\n                                                                        i[17] <=\n                                                                        k;\n                                                                        i[17]++)\n                                                                      if ((b[17] = a\n                                                                               [i[17]]) <=\n                                                                          b[16])\n                                                                        for (\n                                                                            i[18] =\n                                                                                i[17] +\n                                                                                1;\n                                                                            i[18] <=\n                                                                            k;\n                                                                            i[18]++)\n                                                                          if ((b[18] = a\n                                                                                   [i[18]]) <=\n                                                                              b[17])\n                                                                            for (\n                                                                                i[19] =\n                                                                                    i[18] +\n                                                                                    1;\n                                                                                i[19] <=\n                                                                                k;\n                                                                                i[19]++)\n                                                                              if ((b[19] = a\n                                                                                       [i[19]]) <=\n                                                                                  b[18])\n                                                                                for (\n                                                                                    i[20] =\n                                                                                        i[19] +\n                                                                                        1;\n                                                                                    i[20] <=\n                                                                                    k;\n                                                                                    i[20]++)\n                                                                                  if ((b[20] = a\n                                                                                           [i[20]]) <=\n                                                                                      b[19])\n                                                                                    for (\n                                                                                        i[21] =\n                                                                                            i[20] +\n                                                                                            1;\n                                                                                        i[21] <=\n                                                                                        k;\n                                                                                        i[21]++)\n                                                                                      if ((b[21] = a\n                                                                                               [i[21]]) <=\n                                                                                          b[20])\n                                                                                        for (\n                                                                                            i[22] =\n                                                                                                i[21] +\n                                                                                                1;\n                                                                                            i[22] <=\n                                                                                            k;\n                                                                                            i[22]++)\n                                                                                          if ((b[22] = a\n                                                                                                   [i[22]]) <=\n                                                                                              b[21])\n                                                                                            for (\n                                                                                                i[23] =\n                                                                                                    i[22] +\n                                                                                                    1;\n                                                                                                i[23] <=\n                                                                                                k;\n                                                                                                i[23]++)\n                                                                                              if ((b[23] = a\n                                                                                                       [i[23]]) <=\n                                                                                                  b[22])\n                                                                                                for (\n                                                                                                    i[24] =\n                                                                                                        i[23] +\n                                                                                                        1;\n                                                                                                    i[24] <=\n                                                                                                    k;\n                                                                                                    i[24]++)\n                                                                                                  if ((b[24] = a\n                                                                                                           [i[24]]) <=\n                                                                                                      b[23])\n                                                                                                    for (\n                                                                                                        i[25] =\n                                                                                                            i[24] +\n                                                                                                            1;\n                                                                                                        i[25] <=\n                                                                                                        k;\n                                                                                                        i[25]++)\n                                                                                                      if ((b[25] = a\n                                                                                                               [i[25]]) <=\n                                                                                                          b[24])\n                                                                                                        ;\n  }\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    if (b[i[0]] == 0) {\n      printf(\"%d\", i[0] - 1);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "10", "index": "17292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], b[25], i, j, k, c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 25; i++) {\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    c = 0;\n    for (k = 0; k < i; k++) {\n      if (b[k] > b[j])\n        c = 1;\n    }\n    if (c == 0) {\n      printf(\"%d \", b[j]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fff(int a[], int k);\n  int i, n, a[25], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  sum = fff(a, 1);\n  for (i = 2; i < n + 1; i++)\n    if (sum < fff(a, i))\n      sum = fff(a, i);\n  printf(\"%d\", sum);\n}\nint fff(int a[], int k) {\n  int t = 0, i;\n  if (k == 0) {\n    t = 0;\n  }\n  if (k == 1) {\n    t = 1;\n  }\n  if (k > 1) {\n    t = 1;\n    for (i = 1; i < k; i++) {\n      if (a[k - 1] <= a[i - 1]) {\n        if ((fff(a, i) + 1) > t)\n          t = fff(a, i) + 1;\n      }\n    }\n  }\n  return t;\n}\n"}
{"label": "10", "index": "17294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  q[n - 1] = 1;\n  int best = q[n - 1];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    int a = 0;\n    for (int k = n - 1; k > i; k--) {\n      if (p[i] >= p[k] && q[k] >= a)\n        a = q[k];\n    }\n    q[i] = a + 1;\n    if (q[i] > best)\n      best = q[i];\n  }\n  cout << best << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[28], b[28][28] = {0}, i, j, l, t, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 1; l <= n; l++) {\n    b[l][l] = 1;\n    for (i = l; i <= n; i++) {\n      z = 0;\n      for (j = i - 1; j > l - 1; j--)\n        if (a[j] >= a[i] && b[l][j] >= b[l][i]) {\n          b[l][i] = b[l][j] + 1;\n          z = 1;\n        }\n      if (z == 0)\n        b[l][i] = 1;\n    }\n  }\n  t = b[1][1];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (b[i][j] > t)\n        t = b[i][j];\n    }\n  cout << t;\n}\n"}
{"label": "10", "index": "17296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, j, k, a[25], i, c, b[25], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (j = n - 2; j >= 0; j--) {\n    t = 0;\n    for (k = j + 1; k < n; k++) {\n      if (a[k] <= a[j] && b[k] > t) {\n        t = b[k];\n      }\n    }\n    b[j] = b[j] + t;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n\n  cout << c;\n}\n"}
{"label": "10", "index": "17297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000], len[1000], n, i, j, max, longest;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  longest = 1;\n  for (i = 0; i < n; i++) {\n    max = 1;\n    len[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        max = len[j] + 1;\n      if (len[i] < max)\n        len[i] = max;\n    }\n    if (len[i] > longest)\n      longest = len[i];\n  }\n  cout << longest << \" \";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[30];\nint dst[30];\n\nint main() {\n  memset(dst, 0, sizeof(dst));\n  int n;\n  int ans;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  dst[0] = 1;\n  int temp, max;\n  for (int i = 1; i < n; i++) {\n    max = 1;\n    for (int j = 0; j < i; j++) {\n\n      if (num[i] <= num[j]) {\n        temp = dst[j] + 1;\n        if (max < temp)\n          max = temp;\n      }\n    }\n    dst[i] = max;\n  }\n  max = 0;\n  for (int i = 0; i < n; i++) {\n\n    if (max < dst[i])\n      max = dst[i];\n  }\n\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num;\n  int hei[30], max[30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &hei[i]);\n    max[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < i; j++) {\n      if (hei[j] >= hei[i]) {\n        if (max[j] > num)\n          num = max[j];\n      }\n    }\n    max[i] = num + 1;\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (max[i] > num)\n      num = max[i];\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "10", "index": "17300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[27] = {0}, b[27] = {0}, k, i, j, m = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  for (i = 0; i < k; i++)\n    if (b[i] > m)\n      m = b[i];\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num, max = 0;\n  scanf(\"%d\", &num);\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, c;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[j] > b[i]) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n    if (i == 0)\n      break;\n  }\n  k = 0;\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      k = i;\n      c = b[i];\n    }\n  }\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "10", "index": "17303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N;\nint tmp[27], flight[27];\n\nint main() {\n  cin >> N;\n  for (int i = 0; i < N; i++)\n    cin >> tmp[i];\n  for (int i = 0; i < N; i++) {\n    flight[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (tmp[j] >= tmp[i] && flight[j] > flight[i])\n        flight[i] = flight[j];\n    flight[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < N; i++)\n    if (flight[i] > max)\n      max = flight[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26], k, max = 1;\n\nvoid f(int i, int n) {\n  extern int a[26], k, max;\n  int j;\n  if (i == (k - 1)) {\n    if (n > max)\n      max = n;\n    return;\n  }\n  for (j = i + 1; j < k; j++) {\n    if (a[i] >= a[j])\n      f(j, n + 1);\n    else {\n      if (n > max)\n        max = n;\n    }\n  }\n}\n\nint main() {\n  extern int a[26], k, max;\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    f(i, 1);\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int s[28];\n  int m[28];\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n    m[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && m[j] + 1 > m[i]) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < m[i]) {\n      max = m[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17306", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  int h[k], n[k];\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  for (i = k - 1; i >= 0; i--) {\n    int max = 0;\n    for (j = i + 1; j < k; j++)\n      if (h[j] <= h[i] && n[j] > max)\n        max = n[j];\n    n[i] = max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < k; i++)\n    if (n[i] > Max)\n      Max = n[i];\n  printf(\"%d \", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "17307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, max, ans = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n      if (a[i] >= a[j] && b[j] == max) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[j] > ans)\n      ans = b[j];\n  }\n\n  cout << ans;\n  return 0;\n}\n"}
{"label": "10", "index": "17308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int array[], int K) {\n  int i, max = 0, j;\n  if (a == K - 1)\n    return 1;\n  else {\n    for (j = K - 1; j > a; j--) {\n      if (array[j] <= array[a]) {\n        if (f(j, array, K) > max)\n          max = f(j, array, K);\n      }\n    }\n    return max + 1;\n  }\n}\nint main() {\n  int K, k, A[25], n, max = 1, i;\n  cin >> K;\n  for (k = 0; k <= K - 1; k++) {\n    scanf(\"%d\", &A[k]);\n  }\n  for (i = 0; i <= K - 1; i++) {\n    if (f(i, A, K) > max)\n      max = f(i, A, K);\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, max[100], sum[100], final;\n  final = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  sum[n - 1] = 1;\n  max[n - 1] = a[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    sum[i] = sum[n - 1];\n    max[i] = max[n - 1];\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= max[j] && sum[i] <= sum[j] + 1) {\n        sum[i] = sum[j] + 1;\n        max[i] = a[i];\n      }\n    }\n    if (sum[i] == 1 && a[i] < max[i])\n      max[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (final <= sum[i])\n      final = sum[i];\n  }\n  printf(\"%d\", final);\n}\n"}
{"label": "10", "index": "17310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int a[30];\n  int b[30];\n  int i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        b[i] = max(b[i], b[j] + 1);\n  }\n  t = b[1];\n  for (i = 2; i <= n; i++)\n    t = max(t, b[i]);\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17311", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int *a, int i, int n) \n{\n  int j, k, t;\n  for (j = i; j < n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] <= a[k]) {\n        t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *jishu = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    jishu[i] = 1;\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (a[j] <= a[i] && jishu[j] >= jishu[i]) {\n        jishu[i] = jishu[j] + 1;\n      }\n    }\n  }\n  sort(jishu, 0, n - 1);\n  printf(\"%d \", jishu[0]);\n  free(a);\n  free(jishu);\n}\n"}
{"label": "10", "index": "17312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h[25], b[25], k, i, j, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j >= 0; j--)\n    for (m = j + 1; m < k; m++) {\n      if (h[j] >= h[m] && b[j] < (b[m] + 1))\n        b[j] = b[m] + 1;\n    }\n  for (i = 0; i < k - 1; i++)\n    b[i + 1] = (b[i] > b[i + 1]) ? b[i] : b[i + 1];\n  n = b[k - 1];\n  cout << n;\n}\n"}
{"label": "10", "index": "17313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j, h[25], dp[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    dp[i] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i])\n        dp[i] = max(dp[i], dp[j] + 1);\n  int m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, dp[i]);\n  cout << m << \"\\n\";\n}\n"}
{"label": "10", "index": "17314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  cout << n;\n}\n"}
{"label": "10", "index": "17315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint aa(int high[], int n, int k, int lh, int point) {\n  int remax = 0, a = 0, i;\n  if (point == k - 1) {\n    if (lh >= high[k - 1])\n      return 1;\n    else\n      return 0;\n  } else {\n    for (i = point; i < k; i++)\n      if (high[i] <= lh) {\n        a = aa(high, n + 1, k, high[i], i + 1) + 1;\n        if (a > remax)\n          remax = a;\n      }\n    return remax;\n  }\n}\n\nint main() {\n  int i, high[25], k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> high[i];\n  cout << aa(high, 0, k, 32767, 0);\n}\n"}
{"label": "10", "index": "17316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint xxx(int high, int j);\nint max(int b, int c) {\n  if (b >= c)\n    return b;\n  else\n    return c;\n}\nint n;\nint x[26];\nint main() {\n  int i;\n  int m, k;\n  scanf(\"%d\", &n);\n  int h[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &h[i]);\n    x[i] = h[i];\n  }\n  for (i = n; i < 26; i++)\n    x[i] = 999999;\n  int fly;\n  fly = xxx(999999, 0);\n  cout << fly;\n}\nint xxx(int high, int j) {\n  if (j == n - 1) {\n    if (high >= x[j])\n      return 1;\n    else\n      return 0;\n  } else {\n    if (high < x[j])\n      return xxx(high, j + 1);\n    else\n      return max(1 + xxx(x[j], j + 1), xxx(high, j + 1));\n  }\n}\n"}
{"label": "10", "index": "17317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int h[], int a[], int i) {\n  int t, j;\n  for (j = 0, t = 0; j < i; j++)\n    if (h[j] >= h[i] && a[j] > t)\n      t = a[j];\n\n  a[i] = t + 1;\n}\nint main() {\n  int a[25], k, h[25], t, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    f(h, a, i);\n  for (i = 0, t = 0; i < k; i++)\n    if (a[i] > t)\n      t = a[i];\n  cout << t << \"\\n\";\n}\n"}
{"label": "10", "index": "17318", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint *p;\nint n;\nint max(int t, int k) {\n  if (t > k)\n    return t;\n  else\n    return k;\n}\nint pd(int i, int h) {\n  if (i == n)\n    return 0;\n  if (p[i] > h)\n    return pd(i + 1, h);\n  if (p[i] == h)\n    return pd(i + 1, h) + 1;\n  return max(pd(i + 1, p[i]) + 1, pd(i + 1, h));\n}\nint main() {\n  int i, k;\n  cin >> n;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  k = pd(0, 800000);\n  printf(\"%d\", k);\n  free(p);\n}\n"}
{"label": "10", "index": "17319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], m = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    for (int j = i - 1; j >= 0; j--)\n      if (a[j] >= a[i] && b[j] < b[i] + 1)\n        b[j] = b[i] + 1;\n  for (int i = 0; i < n; i++)\n    if (m < b[i])\n      m = b[i];\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17320", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int s[60];\n  cin >> n;\n  int key = 1;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    s[i + 30] = 1;\n    for (int j = i - 1; j >= 0; j--) {\n      if (s[j] >= s[i]) {\n        if (s[j + 30] >= s[i + 30])\n          s[i + 30] = s[j + 30] + 1;\n      }\n    }\n    if (s[i + 30] > key) {\n      key = s[i + 30];\n    }\n  }\n  cout << key;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17321", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, d = 1;\n  int b[25], c[25];\n  int i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d \", &b[i]);\n  for (i = 0; i < a; i++)\n    c[i] = b[i];\n  for (i = 1; i < a; i++) {\n    for (j = d - 1; j >= 0; j--) {\n      if (b[i] <= c[j])\n        break;\n    }\n    c[j + 1] = c[i];\n    if (j == d - 1)\n      d++;\n  }\n  printf(\"%d\", d);\n}\n"}
{"label": "10", "index": "17322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, max = 0;\n  scanf(\"%d\", &n);\n  int d[100];\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &d[i]);\n\n  int w[100];\n  for (i = 0; i < n; i++)\n    w[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++)\n      if (d[i] >= d[j] && w[i] <= w[j])\n        w[i] = w[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (w[i] >= max) {\n      max = w[i];\n    }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[30] = {0};\n  int m[30] = {0};\n  cin >> k;\n  cin >> a[0];\n  m[0] = 1;\n  int temp = 1;\n  for (int i = 1; i < k; i++) {\n    cin >> a[i];\n    int tempmax = 0;\n    for (int j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && m[j] > tempmax)\n        tempmax = m[j];\n    m[i] = tempmax + 1;\n    if (m[i] > temp)\n      temp = m[i];\n  }\n  cout << temp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, i;\nint h[26];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\n\nint f(int t, int l) {\n  if (t == 1) {\n    if (h[1] >= l)\n      return 1;\n    else\n      return 0;\n  }\n\n  else if (h[t] < l)\n    return f(t - 1, l);\n  else\n    return max(f(t - 1, l), f(t - 1, h[t]) + 1);\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n\n  cout << f(n, 0);\n}\n"}
{"label": "10", "index": "17325", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k;\nint mis[30];\nint maxL = 0;\nint curH = 100000;\nint getNum = 0;\nint cmp(int a, int b) {\n  if (a > b)\n    return 0;\n  else\n    return 1;\n}\n\nvoid oneState(int id) {\n  if (id >= k) {\n    if (getNum > maxL)\n      maxL = getNum;\n    return;\n  }\n\n  if (mis[id] <= curH) {\n    int t = curH;\n    curH = mis[id];\n    getNum++;\n\n    oneState(id + 1);\n\n    curH = t;\n    getNum--;\n  }\n\n  oneState(id + 1);\n}\n\nint main() {\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> mis[i];\n  }\n  oneState(0);\n  printf(\"%d\\n\", maxL);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct daodan {\n  int height;\n  int number;\n};\nint compare(const void *a, const void *b) {\n  struct daodan *x = (struct daodan *)a;\n  struct daodan *y = (struct daodan *)b;\n  return (((*y).number) - ((*x).number));\n}\nint nextmax(struct daodan *dao, int k, int n) {\n  int *a = (int *)malloc((n - 1 - k) * sizeof(int));\n  int count = 0, b, c = 0;\n  for (int i = k + 1; i <= n - 1; i++) {\n    if ((dao[i]).height <= (dao[k]).height) {\n      a[count] = dao[i].number;\n      count++;\n    }\n    \n  }\n  int max = 0;\n  for (int j = 0; j <= count - 1; j++) {\n    if (a[j] > max) {\n      max = a[j];\n    }\n  }\n  \n  return max;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct daodan *dao = (struct daodan *)malloc(n * sizeof(struct daodan));\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &dao[i].height);\n  }\n  for (int j = 0; j <= n - 1; j++) {\n    dao[j].number = 1;\n  }\n  for (int k = n - 2; k >= 0; k--) {\n    dao[k].number = nextmax(dao, k, n) + 1;\n  }\n  int max = dao[0].number;\n  for (int l = 1; l <= n - 1; l++) {\n    if (dao[l].number > max) {\n      max = dao[l].number;\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, a[10000], f[10000], ans = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    t = 0;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j] && f[j] > t)\n        t = f[j];\n    f[i] = t + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17328", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t;\n  scanf(\"%d \", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    q[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < i; j++) {\n      if (p[j] >= p[i]) {\n        a[j] = q[j];\n      }\n      for (k = 0; k < i; k++) {\n        if (a[k] > t) {\n          t = a[k];\n        }\n      }\n    }\n    q[i] = q[i] + t;\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (q[i] > t) {\n      t = q[i];\n    }\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num = 0, k = 0, n, i, j, a[50], max = 0, f[50] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] <= a[j] && f[i] < f[j]) {\n        f[i] = f[j];\n      }\n    }\n    f[i]++;\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint analyse(int *, int *, int, int);\nint main() {\n  int k;\n  int height[25], numbers[25] = {0};\n  int i, max, temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", height + i);\n  max = numbers[24] = 1;\n  for (i = 23; i >= 0; i--) {\n    temp = analyse(height, numbers, i, k);\n    if (temp > max)\n      max = temp;\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\nint analyse(int *height, int *numbers, int seq, int k) {\n  int max = 0, temp, i;\n  for (i = k - 1; i > seq; i--) {\n    if (height[seq] >= height[i]) {\n      temp = numbers[i];\n      if (temp > max)\n        max = temp;\n    }\n  }\n  max++;\n  numbers[seq] = max;\n  return max;\n}\n"}
{"label": "10", "index": "17331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int height[27];\n  int result[27];\n  int k;\n  int i, j;\n  int nmax;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> height[i];\n  }\n  height[k + 1] = 0;\n  result[k + 1] = 0;\n  for (i = k; i > 0; i--) {\n    nmax = 0;\n    for (j = i + 1; j <= k + 1; j++) {\n      if (height[i] >= height[j]) {\n        if (result[j] > nmax) {\n          nmax = result[j];\n        }\n      }\n    }\n    result[i] = nmax + 1;\n  }\n  nmax = 0;\n  for (i = 1; i < k; i++) {\n    if (result[i] > nmax) {\n      nmax = result[i];\n    }\n  }\n  printf(\"%d\\n\", nmax);\n  return 0;\n}\n"}
{"label": "10", "index": "17332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], m = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    for (int j = i - 1; j >= 0; j--)\n      if (a[j] >= a[i] && b[j] < b[i] + 1) {\n        b[j] = b[i] + 1;\n      }\n  for (int i = 0; i < n; i++)\n    if (m < b[i])\n      m = b[i];\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int p[], int n) {\n  int t, m = 0;\n  m = p[0];\n  p[0] = 0;\n  for (t = 0; t < n; t++) {\n    if (m < p[t])\n      m = p[t];\n    p[t] = 0;\n  }\n  return m;\n}\nint main() {\n  int m, t, p = 0, k, n;\n  int c[25];\n  scanf(\"%d\", &m);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(m * sizeof(int));\n  for (t = 0; t < m; t++) {\n    scanf(\"%d\", &a[t]);\n  }\n  b[m - 1] = 1;\n  for (t = (m - 2); t > (-1); t--) {\n    for (n = (t + 1); n < m; n++) {\n      if (a[t] >= a[n]) {\n        c[p] = b[n];\n        p++;\n      }\n    }\n    b[t] = max(c, p) + 1;\n    p = 0;\n  }\n  k = max(b, m);\n  cout << k;\n}\n"}
{"label": "10", "index": "17334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, a[25 + 10], n[25 + 10], s;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    n[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    int j;\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[i] >= a[j]) && (n[i] <= n[j]))\n        n[i] = n[j] + 1;\n    }\n  }\n  s = n[0];\n  for (i = 0; i < k; i++) {\n    if (n[i] > s)\n      s = n[i];\n  }\n\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "17335", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int *p, int num, int height) {\n  int missile, case1, case2;\n  if (num == 1) {\n    if (*p <= height)\n      missile = 1;\n    else\n      missile = 0;\n  } else {\n    case1 = max(p + 1, num - 1, *p) + 1;\n    case2 = max(p + 1, num - 1, height);\n    if (*p <= height && case1 >= case2)\n      missile = case1;\n    else\n      missile = case2;\n  }\n  return (missile);\n}\nint main() {\n  int a[100], n, i, height = 100000, H;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  H = max(a, n, height);\n  printf(\"%d\", H);\n  return 0;\n}\n"}
{"label": "10", "index": "17336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[25], b[25];\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int max = 0, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int h[26];\n  int ans[200];\n  memset(ans, 0, sizeof(ans));\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; ++i) {\n    scanf(\"%d \", &h[i]);\n    ans[i] = 1;\n  }\n  for (i = 1; i < k; ++i)\n    for (j = i - 1; j >= 0; --j)\n      if (h[j] >= h[i] && ans[j] + 1 > ans[i])\n        ans[i] = ans[j] + 1;\n  int max = 0;\n  for (i = 0; i < k; ++i)\n    if (ans[i] > max)\n      max = ans[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a < b)\n    return b;\n  else\n    return a;\n}\nint main() {\n  int num;\n  int h[100];\n  scanf(\"%d \", &num);\n  int i, j, k;\n  for (i = 0; i < num; i++) {\n    cin >> h[i];\n  }\n  int f[100] = {0};\n  f[0] = 1;\n  for (i = 1; i < num; i++) {\n    f[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j]) {\n        f[i] = max(f[i], f[j] + 1);\n      }\n    }\n  }\n  int result = f[0];\n  for (i = 1; i < num; i++) {\n    result = max(f[i], result);\n  }\n  cout << result << endl;\n}\n"}
{"label": "10", "index": "17339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint daodan[30];\nint res[30];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> daodan[i];\n    res[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (daodan[i] >= daodan[j])\n        res[i] = max(res[i], res[j] + 1);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (res[i] > res[0])\n      res[0] = res[i];\n  }\n  cout << res[0] << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int d[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", d + i);\n  }\n  int opt[n];\n  for (int i = 0; i < n; i++) {\n    opt[i] = 0;\n  }\n  for (int i = n; i >= 0; i--)\n    for (int j = i; j < n; j++) {\n      if ((d[i] >= d[j]) && (opt[i] <= opt[j] + 1))\n        opt[i] = opt[j] + 1;\n    }\n  int max = 1;\n  for (int i = 0; i < n; i++) {\n    if (opt[i] > max)\n      max = opt[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17341", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30][3], i, j, n, m, max;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i][1];\n    a[i][2] = 0;\n  }\n  a[1][2] = 1;\n  m = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if ((a[j][1] >= a[i][1]) && (a[j][2] > max))\n        max = a[j][2];\n    a[i][2] = max + 1;\n    if (a[i][2] > m)\n      m = a[i][2];\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fff(int a[], int k);\n  int i, n, a[25], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  sum = fff(a, 1);\n  for (i = 2; i < n + 1; i++)\n    if (sum < fff(a, i))\n      sum = fff(a, i);\n  printf(\"%d\", sum);\n}\nint fff(int a[], int k) {\n  int t = 0, i;\n  if (k == 0)\n    t = 0;\n\n  if (k == 1)\n    t = 1;\n\n  if (k > 1) {\n    t = 1;\n    for (i = 1; i < k; i++) {\n      if (a[k - 1] <= a[i - 1]) {\n        if ((fff(a, i) + 1) > t)\n          t = fff(a, i) + 1;\n      }\n    }\n  }\n  return t;\n}\n"}
{"label": "10", "index": "17343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint a[29] = {~0U >> 1}, f[29] = {0};\nint ans = 0;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[i] <= a[j] && f[i] < f[j] + 1) {\n        f[i] = f[j] + 1;\n      }\n    }\n\n    if (f[i] > ans) {\n      ans = f[i];\n    }\n  }\n\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[25], b[25], c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (((b[j] + 1) > b[i]) && (a[j] >= a[i]))\n        b[i] = b[j] + 1;\n    }\n  }\n  c = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n  printf(\"%d \", c);\n  return 0;\n}\n"}
{"label": "10", "index": "17345", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], i, j, k, c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 25; i++) {\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    c = 0;\n    for (k = 0; k < i; k++) {\n      if (b[k] > b[j])\n        c = 1;\n    }\n    if (c == 0) {\n      printf(\"%d \", b[j]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num = 0;\nint input[26];\nint state[26];\nint main() {\n  int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++)\n    state[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &input[i]);\n  state[0] = 1;\n  for (j = 1; j < n; j++) {\n    int min = 1;\n    for (i = 0; i < j; i++) {\n      if (input[i] >= input[j]) {\n        if (state[i] + 1 > min)\n          min = state[i] + 1;\n      }\n    }\n    state[j] = min;\n  }\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    if (state[i] > sum)\n      sum = state[i];\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "10", "index": "17347", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, h, k, b[25], a[25];\n  k = 1;\n  t = n - 1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n\n      if (a[i] >= a[j]) {\n        t = j;\n        b[i] = b[j] + 1;\n\n        for (h = j; h < n; h++) {\n          if (a[i] >= a[h] && b[h] > b[t]) {\n            b[i] = b[h] + 1;\n            t = h;\n          }\n        }\n        if (k < b[i]) {\n          k = b[i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, d[1000] = {0};\n  int k, i, j;\n  int max;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = k - 1; j > i; j--) {\n      if (a[j] <= a[i]) {\n        if (d[j] > max)\n          max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n\n  max = d[0];\n  for (i = 1; i < k; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(sizeof(int) * k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  int count[30] = {0};\n  int max;\n  max = 0;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[j] <= a[i] && count[i] < count[j] + 1)\n        count[i] = count[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (max < count[i])\n      max = count[i];\n  }\n  printf(\"%d\", max + 1);\n  free(a);\n  return 0;\n}\n"}
{"label": "10", "index": "17350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[25];\nint f(int x) {\n  int t = 1, max = 1;\n  if (a[x + 1] == 0)\n    max = 1;\n  else {\n    for (int i = x + 1; a[i] != 0; i++)\n      if (a[x] >= a[i]) {\n        t = f(i) + 1;\n        if (t > max)\n          max = t;\n      }\n  }\n  return max;\n}\nint main() {\n  int n, t, max, i, M;\n  cin >> n;\n  memset(a, 0, 25 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  M = f(n - 1);\n  for (i = n - 2; i >= 0; i--) {\n    f(i);\n    if (M < f(i))\n      M = f(i);\n  }\n  printf(\"%d\", M);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[25], a[25], x = 0, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < n; k++) {\n    b[k] = 0;\n    for (i = 0; i < k; i++) {\n      if (a[i] >= a[k]) {\n        if (b[i] > b[k])\n          b[k] = b[i];\n      }\n    }\n    b[k] = b[k] + 1;\n  }\n  for (l = 0; l < k; l++) {\n    if (b[l] > x) {\n      x = b[l];\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "17352", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f[30];\nint a[30];\nint k;\n\nint main() {\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i]) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n  }\n  j = f[0];\n  for (i = 1; i < k; i++) {\n    if (f[i] > j)\n      j = f[i];\n  }\n  cout << j << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17353", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint h[30], f[30], l;\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", h + i);\n  }\n  l = 0;\n  for (i = k - 1; i >= 0; i--) {\n    if (l == 0 || f[l - 1] <= h[i])\n      f[l++] = h[i];\n    else {\n      int mid, left = 0, right = l - 1;\n      while (left < right) {\n        mid = (left + right) / 2;\n        if (h[i] >= f[mid]) {\n          left = mid + 1;\n        } else if (h[i] < f[mid]) {\n          right = mid - 1;\n        }\n      }\n      if (f[left] > h[i])\n        f[left] = h[i];\n      else\n        f[left + 1] = h[i];\n    }\n  }\n  printf(\"%d\\n\", l);\n}\n"}
{"label": "10", "index": "17354", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint result;\n\nvoid bfs(int a[], int n, int i, int u) {\n  int j;\n\n  if (result < u)\n    result = u;\n  if (i < n) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        bfs(a, n, j, u + 1);\n    }\n  }\n}\n\nint main() {\n  int R, C, i, j, n;\n  int a[26];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  result = 0;\n  a[0] = 99999;\n  bfs(a, n, 0, 0);\n\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bomb[25], p = 0, k, antibomb[25], j = 0, answer[2] = {0, 0};\nvoid makeanti(int a[]);\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &bomb[i]);\n  makeanti(bomb);\n  printf(\"%d\", answer[0]);\n  getchar();\n  getchar();\n}\nvoid makeanti(int bomb[]) {\n  int i, l, r = 0, aa;\n  if (k == 0) {\n    answer[1] = j;\n    answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n  } else\n    for (i = 0; i < k; i++) {\n      if (j == 0)\n        antibomb[j++] = bomb[i];\n      else if (bomb[i] <= antibomb[j - 1]) {\n        antibomb[j++] = bomb[i];\n        r = 1;\n      } else if (r == 0 && i == k - 1) {\n        answer[1] = j;\n        answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n        continue;\n      } else\n        continue;\n      k -= (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb++;\n      makeanti(bomb);\n      j--;\n      k += (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb--;\n    }\n}\n"}
{"label": "10", "index": "17356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint haha(int a[], int b[], int k) {\n  int i, j, c = 0;\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        c = max(c, b[j]);\n    }\n    b[i] = c + 1;\n    c = 0;\n  }\n  for (i = k - 1; i > -1; i--)\n    c = max(c, b[i]);\n  return c;\n}\nint main() {\n  int a[25], b[25] = {0}, k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", haha(a, b, k));\n}\n"}
{"label": "10", "index": "17357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int sum[25], int x[25], int i, int j, int k) {\n  int t, l = 1;\n  static int y[25];\n  t = i + 1;\n  for (; t <= k - 1; t++)\n    if (t != j && x[i] >= x[t]) {\n      y[l] = sum[t];\n      l++;\n    }\n  for (i = 1; i < l; i++)\n    if (sum[j] < y[i])\n      break;\n  if (i == l)\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int k, i, j;\n  static int x[25], sum[25];\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &x[i]);\n  sum[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (x[i] >= x[j] && max(sum, x, i, j, k))\n        sum[i] = sum[j];\n    sum[i]++;\n  }\n  int m = sum[0];\n  for (i = 1; i < k; i++)\n    if (sum[i] > m)\n      m = sum[i];\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int height[k];\n  int num[k];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &height[i]);\n  num[k - 1] = 1;\n  max = 1;\n  for (i = k - 2; i >= 0; i--) {\n    num[i] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (height[i] >= height[j] && num[i] < num[j])\n        num[i] = num[j];\n    }\n    num[i] = num[i] + 1;\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max << \" \";\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[26], r[26];\n  scanf(\"%d \", &k);\n  for (int i = 0; i < 26; i++)\n    a[i] = 0;\n  for (int i = 0; i < 26; i++)\n    r[i] = 1;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (int i = 0; i < k; i++) {\n    if (i == 0)\n      r[i] = 1;\n    else {\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && r[j] >= r[i]) {\n          r[i] = r[j] + 1;\n        }\n      }\n    }\n  }\n  int s = 0;\n  for (int i = 0; i < k; i++) {\n    if (r[i] > s)\n      s = r[i];\n  }\n  cout << s << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25], k, b[25];\n  scanf(\"%d \", &k);\n  int max1;\n\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (int j = k - 1; j >= 0; j--) {\n    max1 = 0;\n    for (int m = k - 1; m > j; m--) {\n      if (a[m] <= a[j] && b[m] >= max1)\n        max1 = b[m];\n    }\n    b[j] = max1 + 1;\n  }\n  int max;\n  max = b[0];\n  for (int n = 1; n < k; n++) {\n    if (max < b[n])\n      max = b[n];\n  }\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h[25], n, i, j, d[25] = {0}, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (h[j] <= h[i] && d[i] < d[j] + 1) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] > max) {\n      max = d[i];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, a[25], i, b[25], j, p, max = 0, q, t;\n  for (t = 0; t < 25; t++)\n    b[t] = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (j = k - 2; j >= 0; j--) {\n    for (p = j + 1; p < k; p++) {\n      if (a[p] <= a[j] && b[j] < b[p] + 1)\n        b[j] = b[p] + 1;\n    }\n  }\n  for (q = 0; q < k; q++) {\n    if (b[q] > max)\n      max = b[q];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17364", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k[26][2];\nint main() {\n  int i, j, n, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> k[i][1];\n    k[i][0] = 1;\n    for (j = 0; j < i; j++) {\n      if (k[j][1] >= k[i][1] && k[j][0] + 1 > k[i][0])\n        k[i][0] = k[j][0] + 1;\n    }\n    if (k[i][0] > m)\n      m = k[i][0];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n    }\n    b[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint MAX(int a, int b) { return (a > b ? a : b); }\nint FIRE(int *h, int m, int i, int j) {\n  if (i == j)\n    return m >= h[j];\n  else if (m >= h[i])\n    return MAX(FIRE(h, m, i + 1, j), FIRE(h, h[i], i + 1, j) + 1);\n  else if (m < h[i])\n    return FIRE(h, m, i + 1, j);\n}\nint main() {\n  int n, i, j, h[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  cout << FIRE(h, 65530, 1, n);\n}\n"}
{"label": "10", "index": "17367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n\n  int *m;\n  int **s;\n\n  scanf(\"%d\", &k);\n\n  m = (int *)malloc(k * sizeof(int));\n  s = (int **)malloc(k * sizeof(int *));\n  for (i = 0; i < k; i++)\n    s[i] = (int *)malloc((i + 1) * sizeof(int));\n\n  for (i = 0; i < k; i++) {\n    cin >> m[i];\n  }\n\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  cout << t;\n}\n"}
{"label": "10", "index": "17368", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000], s[1000], max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    s[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && s[i] < s[j] + 1)\n        s[i] = s[j] + 1;\n  for (i = 0; i < n - 1; i++)\n    max = (max > s[i]) ? max : s[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100], b[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (int i = n - 1; i > 0; i--) {\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && b[j] < b[i] + 1) {\n        b[j] = b[i] + 1;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  cout << b[0] << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, i, an[30];\nint DFS(int h, int n) {\n  int t1, t2;\n  if (n == k - 1) {\n    if (an[n] > h)\n      return 0;\n    else\n      return 1;\n  }\n  if (an[n] > h)\n    return DFS(h, n + 1);\n  else {\n    t1 = DFS(h, n + 1);\n    t2 = DFS(an[n], n + 1) + 1;\n    if (t1 > t2)\n      return t1;\n    else\n      return t2;\n  }\n}\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> an[i];\n\n  cout << DFS(INT_MAX, 0) << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int s[], int n);\nint main() {\n  int k, a[25], i, N;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  N = f(a, k);\n  printf(\"%d\", N);\n  return 0;\n}\n\nint f(int s[], int n) {\n  int i, b[25], j;\n  int flag = 0, flag2 = 0;\n  int *p = s;\n  for (i = 0; i < n - 1; i++)\n    if (s[i] < s[i + 1]) {\n      flag = 1;\n      break;\n    }\n  if (flag == 0)\n    return n;\n  else {\n    for (i = 1; i < n; i++) {\n      if (s[i] > s[0]) {\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 0)\n      return f(p + 1, n - 1) + 1;\n    else {\n      b[0] = s[0];\n      for (i = 1, j = 1; i < n; i++)\n        if (s[i] <= s[0]) {\n          b[j] = s[i];\n          j++;\n        }\n\n      return ((f(p + 1, n - 1)) > f(b, j) ? (f(p + 1, n - 1)) : f(b, j));\n    }\n  }\n}\n"}
{"label": "10", "index": "17372", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num;\n  int i, j;\n  int data[30];\n  int dp[30];\n  int max;\n  memset(dp, 0, sizeof(dp));\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++)\n    cin >> data[i];\n  dp[0] = 1;\n  for (i = 1; i < num; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((data[i] <= data[j]) && (dp[j] + 1 > max)) {\n        max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  for (i = 0; i < num; i++) {\n    if (dp[i] > max)\n      max = dp[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], i, j, k = 0, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    k = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j] && b[j] > k) {\n        k = b[j];\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  k = b[0];\n  for (i = 0; i < n; i++) {\n    if (b[i] > k)\n      k = b[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int height[50], flag[50], max, i, j;\n  int num;\n\n  cin >> num;\n\n  for (i = 0; i < num; i++) {\n    cin >> height[i];\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (height[j] >= height[i]) {\n        if (flag[j] + 1 > flag[i])\n          flag[i] = flag[j] + 1;\n      }\n    }\n  }\n\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17375", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, h, k, b[25], a[25];\n  k = 1;\n  t = n - 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n\n      if (a[i] >= a[j]) {\n        t = j;\n        b[i] = b[j] + 1;\n\n        for (h = j; h < n; h++) {\n          if (a[i] >= a[h] && b[h] > b[t]) {\n            b[i] = b[h] + 1;\n            t = h;\n          }\n        }\n        if (k < b[i]) {\n          k = b[i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num, max = 0;\n  scanf(\"%d\", &num);\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num(int n, int *p) {\n  int i = 1, max = 0;\n  int *q = p + 1;\n  if (n == 2) {\n    if (*p >= *q)\n      return 2;\n    else\n      return 1;\n  } else {\n    while (i <= n) {\n      for (; *p < *q && i <= n; i++, q++)\n        ;\n      i++;\n      if (num(n - i + 1, q) + 1 > max)\n        max = num(n - i + 1, q) + 1;\n      q++;\n    }\n  }\n  return max;\n}\nint main() {\n  int k, i, a[25], max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 2; i--) {\n    if (num(i, a + k - i) > max)\n      max = num(i, a + k - i);\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint analyse(int *, int *, int, int);\nint main() {\n  int k;\n  int height[25], numbers[25] = {0};\n  int i, max, temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", height + i);\n  max = numbers[24] = 1;\n  for (i = 23; i >= 0; i--) {\n    temp = analyse(height, numbers, i, k);\n    if (temp > max)\n      max = temp;\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\nint analyse(int *height, int *numbers, int seq, int k) {\n  int max = 0, temp, i;\n  for (i = k - 1; i > seq; i--) {\n    if (height[seq] >= height[i]) {\n      temp = numbers[i];\n      if (temp > max)\n        max = temp;\n    }\n  }\n  max++;\n  numbers[seq] = max;\n  return max;\n}\n"}
{"label": "10", "index": "17379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 30;\nint h[maxn];\nint f[maxn];\nint main() {\n  int n;\n  \n  scanf(\"%d\", &n);\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  f[1] = 1;\n  int j;\n  int max = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (h[i] <= h[j]) {\n        if (max < f[j])\n          max = f[j];\n      }\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < f[i])\n      max = f[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, max, n;\n  int a[30], b[30];\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    j = i - 1;\n    max = 0;\n    while (j >= 0) {\n      if (a[i] <= a[j] && max < b[j] + 1)\n        max = b[j];\n      j--;\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n}\n"}
{"label": "10", "index": "17381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, t, d[25], h[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (d[j] > t)\n          t = d[j];\n      }\n    }\n    d[i] = t + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (d[i] > t)\n      t = d[i];\n  }\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max = 1, max_1 = 0, k, *p;\nvoid f(int x) {\n  int i;\n  int height = *(p + x);\n  if (max_1 > Max)\n    Max = max_1;\n  for (i = x + 1; i < k; i++) {\n    if (*(p + i) <= height) {\n      max_1 += 1;\n      f(i);\n      max_1 -= 1;\n    }\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; k - i > Max, i < k; i++) {\n    max_1 += 1;\n    f(i);\n    max_1 -= 1;\n  }\n  printf(\"%d \", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "17383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, i1, k, imax = 0;\n  int a[26];\n  int b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[n] = 0;\n  b[n - 1] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    imax = n;\n    for (i1 = i + 1; i1 < n; i1++) {\n      if (b[i1] > b[imax] && a[i] >= a[i1]) {\n        imax = i1;\n      }\n    }\n    b[i] = b[imax] + 1;\n  }\n\n  for (i = 0, k = 0; i < n; i++) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  scanf(\"%d\", &a[1]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    scanf(\" %d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  printf(\"%d\\n\", max(b));\n  return 0;\n}\n"}
{"label": "10", "index": "17385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, k, f[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j >= i + 1; j--) {\n      if (a[i] >= a[j] && f[i] <= f[j])\n        f[i] = f[j] + 1;\n    }\n  }\n\n  for (j = 0 + 1; j < k; j++) {\n    if (f[0] < f[j]) {\n      f[0] = f[j];\n    }\n  }\n  printf(\"%d\", f[0]);\n}\n"}
{"label": "10", "index": "17386", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, a[25 + 10], n[25 + 10], s;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    n[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    int j;\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[i] >= a[j]) && (n[i] <= n[j]))\n        n[i] = n[j] + 1;\n    }\n  }\n  s = n[0];\n  for (i = 0; i < k; i++) {\n    if (n[i] > s)\n      s = n[i];\n  }\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "17387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m, temp;\n  int a[26], g[26];\n\n  scanf(\"%d\\n\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (m = 1; m <= k; m++)\n    g[m] = 1;\n\n  for (n = k - 1; n > 0; n--)\n    for (j = n + 1; j <= k; j++) {\n      if (a[n] >= a[j] && g[n] - 1 < g[j]) {\n        g[n] = g[j] + 1;\n      }\n    }\n\n  for (i = 1; i < k; i++) {\n    for (j = i + 1; j <= k; j++)\n      if (g[i] < g[j]) {\n        temp = g[i];\n        g[i] = g[j];\n        g[j] = temp;\n      }\n  }\n  printf(\"%d\", g[1]);\n}\n"}
{"label": "10", "index": "17388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num;\n  int hei[30], max[30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> hei[i];\n    max[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < i; j++) {\n      if (hei[j] >= hei[i]) {\n        if (max[j] > num)\n          num = max[j];\n      }\n    }\n    max[i] = num + 1;\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (max[i] > num)\n      num = max[i];\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "10", "index": "17389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, s, k, d;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 0;\n  }\n  b[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if ((a[j] <= a[i]) && (b[j] > b[i]))\n        b[i] = b[j];\n    b[i] = b[i] + 1;\n  }\n  s = 0;\n  for (i = 1; i <= n; i++) {\n    if (s < b[i])\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "17390", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, j, k, a[25], i, c, b[25], t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = n - 2; j >= 0; j--) {\n    t = 0;\n    for (k = j + 1; k < n; k++) {\n      if (a[k] <= a[j] && b[k] > t) {\n        t = b[k];\n      }\n    }\n    b[j] = b[j] + t;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "17391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k; \nint mis[30];\nint maxL = 0;\nint curH = 100000;\nint getNum = 0;\nint cmp(int a, int b) \n{\n  if (a > b)\n    return 0;\n  else\n    return 1;\n}\n\nvoid oneState(int id) {\n  if (id >= k) {\n    if (getNum > maxL)\n      maxL = getNum;\n    return;\n  }\n\n  if (mis[id] <= curH) \n  {\n    int t = curH;\n    curH = mis[id];\n    getNum++;\n\n    oneState(id + 1);\n\n    curH = t;\n    getNum--;\n  }\n\n  oneState(id + 1);\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> mis[i];\n  }\n  oneState(0);\n  cout << maxL << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17392", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[25], num;\nint b[25];\nint i, j, k;\n\nint main() {\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  int max = 0;\n  b[0] = 1;\n  for (i = 1; i < num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        k = b[j] + 1;\n        if (k > b[i]) {\n          b[i] = k;\n          if (k > max) {\n            max = k;\n          }\n        }\n      }\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int m[], int i, int k);\nint main() {\n  int k, i, t, ans = 0;\n  int m[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i <= k; i++) {\n    t = num(m, i, k);\n    if (t > ans)\n      ans = t;\n  }\n  printf(\"%d\", ans);\n  return 0;\n}\nint num(int m[], int i, int k) {\n  int re = 0, j, t;\n  if (i == k)\n    return (0);\n  for (j = i + 1; j <= k; j++)\n    if (m[j] <= m[i]) {\n      t = num(m, j, k);\n      if (t > re)\n        re = t;\n    }\n  re++;\n  return (re);\n}\n"}
{"label": "10", "index": "17394", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, a[25], b[25];\n  int i, j, p, q;\n  int tmp, max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (p = 1; p < k; p++) {\n    for (q = 0; q < p; q++) {\n      if (a[p] <= a[q]) {\n        tmp = b[q] + 1;\n        if (tmp > b[p])\n          b[p] = tmp;\n      }\n    }\n  }\n  max = 1;\n  for (j = 1; j < k; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  if (k == 1)\n    printf(\"1\\n\");\n  else if (k >= 2) {\n    int a[25], i, b[25], c[25], j, p = 0, m, n, t = 0;\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < k; i++)\n      scanf(\" %d\", &a[i]);\n    b[0] = 1;\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j <= k - 1; j++) {\n        if (a[i] >= a[j]) {\n          c[p] = b[k - 1 - j];\n          p++;\n        }\n        for (m = 0; m < p; m++) {\n          if (c[m] > t)\n            t = c[m];\n        }\n      }\n      b[k - 1 - i] = t + 1;\n      p = 0;\n      t = 0;\n      for (m = 0; m < p; m++)\n        c[m] = 0;\n    }\n    for (n = 0; n < k; n++) {\n      if (b[n] > t) {\n        t = b[n];\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, h[26], amount[26], s = 0;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    amount[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[i] >= h[j]) && (amount[i] < amount[j] + 1))\n        amount[i] = amount[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (amount[i] > s)\n      s = amount[i];\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max = 0, i, j, n, maxb, s, a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    s = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= max)) {\n        b[i] = b[j] + 1;\n        max = b[j];\n        s = 1;\n      }\n      if (s == 0) {\n        b[i] = 1;\n      }\n    }\n  }\n  maxb = 0;\n  for (i = 0; i < n; i++) {\n\n    if (b[i] > maxb) {\n      maxb = b[i];\n    }\n  }\n  printf(\"%d\\n\", maxb);\n  return 0;\n}\n"}
{"label": "10", "index": "17398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, data[25], ans[25], max;\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < 25; i++)\n    ans[i] = 1;\n  for (i = 1; i < k; i++)\n    scanf(\"%d \", &data[i - 1]);\n  scanf(\"%d\", &data[k - 1]);\n  ans[0] = 1;\n  max = 1;\n  for (j = 1; j < k; j++) {\n    for (i = 0; i < j; i++) {\n      if (data[j] <= data[i]) {\n        if (ans[i] + 1 > ans[j])\n          ans[j] = ans[i] + 1;\n      }\n    }\n    if (ans[j] > max)\n      max = ans[j];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, sum[25], a[25], b[25], k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  sum[k - 1] = 1;\n\n  for (i = k - 1; i >= 1; i--)\n\n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17400", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17401", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int s[30] = {0,  1,  2,  2,  4,  5,  6,  7,  6,  9,  6,  11, 12,\n               13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 8};\n  \n  int a[30];\n  int k, i;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  if (a[24] == 1333 && k == 25)\n    printf(\"9\\n\");\n  else if (a[24] == 1761 && k == 25)\n    printf(\"8\\n\");\n  else\n\n    printf(\"%d\\n\", s[k]);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst long maxn = 25;\n\nlong n;\nlong a[maxn + 10];\n\nlong ans;\n\nvoid dfs(long h, long maxH, long now) {\n  long i;\n  if (h == n + 1) {\n    if (now > ans)\n      ans = now;\n    return;\n  }\n  dfs(h + 1, maxH, now);\n  if (a[h] <= maxH)\n    dfs(h + 1, a[h], now + 1);\n}\n\nint main() {\n  long i;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", a + i);\n  }\n  dfs(1, 1 << 30, 0);\n  cout << ans << \" \";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17403", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, dmax, a[100], d[100];\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (d[i] <= d[j])) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax)\n      dmax = d[i];\n  }\n\n  printf(\"%d\\n\", dmax);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint n;\nint changdu(int i) {\n  int j, max;\n  max = 0;\n  if (i == n - 1)\n    max = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[j] <= a[i]) {\n      if (changdu(j) > max)\n        max = changdu(j);\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  int max, i;\n  max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (changdu(i) > max)\n      max = changdu(i);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k[25], a[25];\n  int maxk, maxa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k[i]);\n  }\n  a[0] = 1;\n  maxk = 1;\n\n  for (i = 1; i < n; i++) {\n    maxa = 0;\n\n    for (j = 0; j < i; j++) {\n      if (k[j] >= k[i]) {\n        if (a[j] >= maxa) {\n          maxa = a[j];\n        }\n      }\n    }\n    a[i] = maxa + 1;\n\n    if (a[i] >= maxk) {\n      maxk = a[i];\n    }\n  }\n  printf(\"%d\", maxk);\n}\n"}
{"label": "10", "index": "17406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint dert(int, int);\nint main() {\n  int k, missile[25], i, result, donemax[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  donemax[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    int max = dert(missile[i], missile[i + 1]) * donemax[i + 1], j;\n    for (j = 1; j < k - i; j++)\n      if (max < dert(missile[i], missile[i + j]) * donemax[i + j])\n        max = dert(missile[i], missile[i + j]) * donemax[i + j];\n    donemax[i] = max + 1;\n  }\n  result = donemax[k - 1];\n  for (i = k - 2; i >= 0; i--) {\n\n    if (donemax[i] > result)\n      result = donemax[i];\n  }\n  cout << result << \"\\n\";\n  return 0;\n}\nint dert(int x, int y) {\n  int z;\n  if (x >= y)\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\n"}
{"label": "10", "index": "17407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, data[25], ans[25], max;\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < 25; i++)\n    ans[i] = 1;\n  for (i = 1; i < k; i++)\n    scanf(\"%d \", &data[i - 1]);\n  scanf(\"%d\", &data[k - 1]);\n  ans[0] = 1;\n  max = 1;\n  for (j = 1; j < k; j++) {\n    for (i = 0; i < j; i++) {\n      if (data[j] <= data[i]) {\n        if (ans[i] + 1 > ans[j])\n          ans[j] = ans[i] + 1;\n      }\n    }\n    if (ans[j] > max)\n      max = ans[j];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fff(int a[], int k);\n  int i, n, a[25], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  sum = fff(a, 1);\n  for (i = 2; i < n + 1; i++)\n    if (sum < fff(a, i))\n      sum = fff(a, i);\n  printf(\"%d\", sum);\n  return 0;\n}\nint fff(int a[], int k) {\n  int t = 0, i;\n  if (k == 0) {\n    t = 0;\n  }\n  if (k == 1) {\n    t = 1;\n  }\n  if (k > 1) {\n    t = 1;\n    for (i = 1; i < k; i++) {\n      if (a[k - 1] <= a[i - 1]) {\n        if ((fff(a, i) + 1) > t)\n          t = fff(a, i) + 1;\n      }\n    }\n  }\n  return t;\n}\n"}
{"label": "10", "index": "17409", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, tmp;\n  int high[30] = {0};\n  int a[30] = {1};\n  int i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &high[i]);\n  }\n  for (i = 0; i < 30; i++) {\n    a[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j > i; j--) {\n      if (high[j] <= high[i]) {\n        if (a[j] + 1 > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  tmp = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] > tmp)\n      tmp = a[i];\n  }\n  printf(\"%d\", tmp);\n  return 0;\n}\n"}
{"label": "10", "index": "17410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int missile[25], k;\n  int max[25], max1;\n  int i, j;\n  scanf(\"%d\", &k);\n  max[k - 1] = 1;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  for (i = k - 2; i >= 0; i--) {\n    max[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (missile[i] >= missile[j] && max[i] <= max[j])\n        max[i] = max[j] + 1;\n  }\n  for (i = 0, max1 = 0; i < k; i++)\n    if (max[i] > max1)\n      max1 = max[i];\n  cout << max1;\n  return 1;\n}\n"}
{"label": "10", "index": "17411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num;\n  int i, j;\n  int data[30];\n  int dp[30];\n  int max;\n  memset(dp, 0, sizeof(dp));\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++)\n    scanf(\"%d\", &data[i]);\n  dp[0] = 1;\n  for (i = 1; i < num; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((data[i] <= data[j]) && (dp[j] + 1 > max))\n        max = dp[j] + 1;\n    }\n    dp[i] = max;\n  }\n  for (i = 0; i < num; i++) {\n    if (dp[i] > max)\n      max = dp[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j;\nint main() {\n  int b[26] = {0};\n  int k;\n  int f(int x, int y, int a[26]);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"%d\\n\", f(k, k, b) - 1);\n}\nint f(int x, int y, int a[26]) {\n  if (y == 0) {\n    return (1);\n  }\n  int s = 0;\n  if (y >= 1) {\n    for (i = 0; i < y; i++) {\n      if (a[i] >= a[y] && f(x, i, a) >= s) {\n        s = f(x, i, a);\n      }\n    }\n  }\n  if (i == y)\n    return (s + 1);\n}\n"}
{"label": "10", "index": "17413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, N;\n  int b[30] = {0}, a[30] = {0};\n  scanf(\"%d\", &N);\n  for (i = 1; i <= N; i++)\n    cin >> a[i];\n  b[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int m = 0;\n    for (int j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (m < b[j])\n          m = b[j];\n      }\n    }\n    b[i] = m + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= N; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[25];\nint n;\nint changdu(int i) {\n  int j, max;\n  max = 0;\n  if (i == n - 1)\n    max = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[j] <= a[i]) {\n      if (changdu(j) > max)\n        max = changdu(j);\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  int max, i;\n  max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (changdu(i) > max) {\n      max = changdu(i);\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, m, k;\n  scanf(\"%d\", &n);\n  static int hight[25], num[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &hight[i]);\n  num[0] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      m = 0;\n      if (hight[j] >= hight[i]) {\n        m = num[j];\n        break;\n      }\n    }\n    if (j == -1)\n      num[i] = 1;\n    for (k = j - 1; k >= 0; k--) {\n      if (hight[k] >= hight[i]) {\n        if (num[k] > m)\n          m = num[k];\n      }\n    }\n    if (num[i] == 0)\n      num[i] = m + 1;\n  }\n  max = num[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], max[25] = {0}, max1 = 0;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    max[i] = 1;\n  max1 = 1;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 0; j <= i - 1; j++) {\n      if ((a[j] >= a[i]) && (max[j] + 1 > max[i]))\n        max[i] = max[j] + 1;\n      if (max[i] > max1)\n        max1 = max[i];\n    }\n  cout << max1 << \"\\n\";\n}\n"}
{"label": "10", "index": "17417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Qsort(int a[], int low, int up) \n{\n  int i, j, k, x;\n  if (low >= up)\n    return;\n  else {\n    k = a[low];\n    j = low;\n    for (i = low; i <= up; i++) {\n      if (a[i] > k) {\n        j++;\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n  }\n  x = k;\n  a[low] = a[j];\n  a[j] = x;\n  Qsort(a, low, j - 1);\n  Qsort(a, j + 1, up);\n}\nint num(int a[], int low, int up) {\n  if (low >= up) {\n    return 1;\n  }\n  int i, j, b[26] = {0};\n  j = 0;\n  for (i = low + 1; i <= up; i++) {\n    if (a[i] <= a[low]) {\n      b[j] = num(a, i, up);\n      j++;\n    }\n  }\n  Qsort(b, 0, 25);\n  return b[0] + 1;\n}\nint main(void) {\n  int i, j, m, n, c, d;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = num(a, i, n - 1);\n  }\n  Qsort(b, 0, n - 1);\n  printf(\"%d\\n\", b[0]);\n}\n"}
{"label": "10", "index": "17418", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint d[100], a[100];\nint i, j, k, n, ans;\n\nint main() {\n  cin >> n;\n  a[0] = 1000000000;\n  for (i = 1; i <= n; ++i)\n    cin >> a[i];\n  d[0] = 0;\n  ans = 0;\n  for (i = 1; i <= n; ++i) {\n    d[i] = 1;\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j] && d[j] + 1 > d[i])\n        d[i] = d[j] + 1;\n    if (d[i] > ans)\n      ans = d[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[26], f[26];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  f[0] = 1;\n  if (a[1] <= a[0])\n    f[1] = 2;\n  else\n    f[1] = 1;\n  for (int i = 2; i <= n - 1; i++) {\n    int c[26];\n    for (int q = 0; q <= i - 1; q++) {\n      if (a[q] >= a[i])\n        c[q] = f[q];\n      else\n        c[q] = 0;\n    }\n    int maxc = c[0];\n    for (int j = 1; j <= i - 1; j++) {\n      if (maxc < c[j])\n        maxc = c[j];\n    }\n    f[i] = maxc + 1;\n  }\n  int max = f[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (f[m] > max)\n      max = f[m];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxn = 30;\nint h[maxn];\nint f[maxn];\nint main() {\n  int n;\n\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  f[1] = 1;\n  int j;\n  int max = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (h[i] <= h[j]) {\n        if (max < f[j])\n          max = f[j];\n      }\n    }\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < f[i])\n      max = f[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, k, i, max = 0;\n  scanf(\"%d\", &k);\n  int *p = (int *)malloc(k * sizeof(int));\n  int *q = (int *)malloc(k * sizeof(int));\n  scanf(\"%d\", &p[0]);\n  for (i = 1; i < k; i++)\n    scanf(\" %d\", &p[i]);\n  for (i = 0; i < k; i++)\n    q[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (p[i] >= p[j] && q[j] >= q[i])\n        q[i] = q[j] + 1;\n  for (i = 0; i < k; i++)\n    if (q[i] > max)\n      max = q[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17422", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 25 + 10;\nint h[N];\nint dp[N];\n\nint main(void) {\n  int ans, cnt, i, j;\n  while (scanf(\"%d\", &cnt) != EOF) {\n    for (i = 0; i < cnt; ++i) {\n      scanf(\"%d\", h + i);\n    }\n    dp[0] = 1;\n    for (i = 1; i < cnt; ++i) {\n      dp[i] = 1;\n      for (j = 0; j < i; ++j) {\n        if (h[i] <= h[j]) {\n          dp[i] = max(dp[i], dp[j] + 1);\n        }\n      }\n    }\n    ans = 0;\n    for (i = 0; i < cnt; ++i) {\n      ans = max(ans, dp[i]);\n    }\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "17423", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, h[27] = {100000000}, lj[27][27] = {0};\n  int i, j, k, max;\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++)\n    scanf(\"%d \", &h[i]);\n  for (i = num; i >= 0; i--) {\n    for (j = num; j > i; j--) {\n      if (h[i] >= h[j]) {\n        max = 0;\n        for (k = j; k <= num; k++)\n          max = (max > lj[i][k]) ? max : lj[i][k];\n        for (k = j; k <= num; k++)\n          if (h[j] >= h[k])\n            max = (max > lj[j][k] + 1) ? max : lj[j][k] + 1;\n        lj[i][j] = max;\n      }\n    }\n  }\n  printf(\"%d\\n\", lj[0][1]);\n  return 0;\n}\n"}
{"label": "10", "index": "17424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, c, i, j;\n  int a[100], b[100];\n  char ch;\n  scanf(\"%d\", &n);\n  ch = getchar();\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n    ch = getchar();\n  }\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 0;\n    for (j = i; j <= n - 1; j++) {\n      if (b[j] > b[i] && a[j] <= a[i])\n        b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  c = 0;\n  for (i = 0; i <= n - 1; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  printf(\"%d\", c);\n  return (0);\n}\n"}
{"label": "10", "index": "17425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max, a[30] = {0}, limit[30] = {0}, num[30] = {0};\n  scanf(\"%d\", &k);\n  for (i = k - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n  }\n  num[0] = 1;\n  limit[0] = a[0];\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((a[i] >= limit[j]) && ((num[j] + 1) >= max)) {\n        max = num[j] + 1;\n      }\n    }\n    limit[i] = a[i];\n    num[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, k, f[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j >= i + 1; j--) {\n      if (a[i] >= a[j] && f[i] <= f[j])\n        f[i] = f[j] + 1;\n    }\n  }\n\n  for (j = 0 + 1; j < k; j++) {\n    if (f[0] < f[j]) {\n      f[0] = f[j];\n    }\n  }\n  printf(\"%d\", f[0]);\n}\n"}
{"label": "10", "index": "17427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, g, h, p, q = 0, a[25], b[25], c[25];\n  for (i = 0; i < 25; i++)\n    b[i] = 1;\n  i = 0;\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[0]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  if (k == 1 || k == 0)\n    printf(\"%d\", k);\n  else {\n    for (j = k - 2; j >= 0; j--) {\n      for (p = j + 1; p < k; p++) {\n        if (a[j] >= a[p]) {\n          c[q] = b[p];\n          q++;\n        }\n      }\n      if (q == 0)\n        b[j] = 1;\n      else if (q == 1)\n        b[j] = c[0] + b[j];\n      else {\n        for (g = 0; g < q - 1; g++) {\n          m = c[g];\n          n = c[g + 1];\n          if (m > n) {\n            c[g] = n;\n            c[g + 1] = m;\n          }\n        }\n        b[j] = c[q - 1] + b[j];\n        q = 0;\n        g = 0;\n        p = j;\n      }\n    }\n    for (h = 0; h < k - 1; h++) {\n      m = b[h];\n      n = b[h + 1];\n      if (m > n) {\n        b[h] = n;\n        b[h + 1] = m;\n      }\n    }\n    printf(\"%d\", b[k - 1]);\n  }\n}\n"}
{"label": "10", "index": "17428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int a[26], b[26];\n  for (i = 1; i < 26; i++)\n    b[i] = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  int num[26];\n  int max;\n  num[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = k; j > i; j--)\n      if (a[j] <= a[i])\n        b[j] = num[j];\n    max = 0;\n    for (j = k; j > i; j--)\n      if (b[j] >= max)\n        max = b[j];\n    num[i] = max + 1;\n    for (j = 1; j < 26; j++)\n      b[j] = 0;\n  }\n\n  int x;\n  x = num[1];\n  for (i = 1; i <= k; i++) {\n    if (x <= num[i])\n      x = num[i];\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "17429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k[25], a[25];\n  int maxk, maxa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k[i]);\n  }\n  a[0] = 1;\n  maxk = 1;\n\n  for (i = 1; i < n; i++) {\n    maxa = 0;\n\n    for (j = 0; j < i; j++) {\n      if (k[j] >= k[i]) {\n        if (a[j] >= maxa) {\n          maxa = a[j];\n        }\n      }\n    }\n    a[i] = maxa + 1;\n\n    if (a[i] >= maxk) {\n      maxk = a[i];\n    }\n  }\n  cout << maxk;\n}\n"}
{"label": "10", "index": "17430", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[30];\n  int count[30];\n  cin >> n;\n  int i;\n  int j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    count[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] <= num[j]) {\n        if (count[i] < count[j] + 1)\n          count[i] = count[j] + 1;\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (count[i] > max) {\n      max = count[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int temp = 0;\n  int max = 1;\n  int z = 0;\n  cin >> k;\n  int a[30];\n  int b[30] = {0};\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  b[0] = 1;\n  for (int i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        temp = b[j] + 1;\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n    b[i] = max;\n    if (max > z) {\n      z = max;\n    }\n    max = 1;\n  }\n  cout << z;\n  return 0;\n}\n"}
{"label": "10", "index": "17432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, height[25], len[25], num[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &height[i]);\n  for (i = 0; i < n; i++)\n    len[i] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i + 1; j <= n - 1; j++)\n      if (height[j] <= height[i]) {\n        num[m] = j;\n        m++;\n      }\n    for (k = 0; k <= m - 1; k++)\n      if (len[i] < len[num[k]])\n        len[i] = len[num[k]];\n    len[i]++;\n  }\n  m = 0;\n  for (i = 0; i < n; i++)\n    if (len[i] > m)\n      m = len[i];\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17433", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[26], d[26];\n  int i, j, k;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", s + i);\n    d[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    k = 0;\n    for (j = i + 1; j < n; j++) {\n      if (k < d[j] && s[i] >= s[j])\n        k = d[j];\n    }\n    k++;\n    d[i] = k;\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > k)\n      k = d[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint k = 0;\nint a[100];\nint dp[100];\n\nint solve() {\n  int ans = 0;\n\n  dp[0] = 1;\n  for (int i = 1; i < k; i++) {\n    dp[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n\n  return ans;\n}\n\nint main() {\n  freopen(\"input.txt\", \"r\", stdin);\n  freopen(\"output.txt\", \"w\", stdout);\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << solve() << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17435", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint h[30];\nint len[30];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &h[i]);\n  }\n  len[0] = 1;\n  for (int i = 1; i < n; i++) {\n    len[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && len[j] + 1 > len[i]) {\n        len[i] = len[j] + 1;\n      }\n    }\n  }\n  int maxi = 0;\n  for (int i = 0; i < n; i++)\n    if (len[i] > maxi)\n      maxi = len[i];\n  printf(\"%d\\n\", maxi);\n}\n"}
{"label": "10", "index": "17436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Max = 1, max_1 = 0, k, *p;\nvoid f(int x) {\n  int i;\n  int height = *(p + x);\n  if (max_1 > Max)\n    Max = max_1;\n  for (i = x + 1; i < k; i++) {\n    if (*(p + i) <= height) {\n      max_1 += 1;\n      f(i);\n      max_1 -= 1;\n    }\n  }\n}\nint main() {\n  int i;\n  cin >> k;\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; k - i > Max, i < k; i++) {\n    max_1 += 1;\n    f(i);\n    max_1 -= 1;\n  }\n  cout << Max << \" \";\n}\n"}
{"label": "10", "index": "17437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[25], b[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = 1; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] >= a[j] && b[j] + 1 >= b[i]) {\n        b[i] = b[j] + 1;\n      }\n  k = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > k)\n      k = b[i];\n  cout << k;\n}\n"}
{"label": "10", "index": "17438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[25] = {0}, i, d[25] = {1}, dm = 0, mm, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n  for (i = n - 1; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (m[i] >= m[j] && d[i] <= d[j])\n        d[i] = d[j] + 1;\n  dm = d[0];\n  for (i = 0; i < n; i++)\n    if (d[i] > dm)\n      dm = d[i];\n  printf(\"%d\", dm);\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "10", "index": "17439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, height[25], start[25], max = 0, h, i, j, q;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    scanf(\"%d\", &height[h]);\n    start[h] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (height[j] <= height[i] && start[j] + 1 > start[i]) {\n        start[i] = start[j] + 1;\n      }\n    }\n  }\n  for (q = 1; q < k; q++) {\n    if (start[q] > start[max]) {\n      max = q;\n    }\n  }\n  cout << start[max];\n  return 0;\n}\n"}
{"label": "10", "index": "17440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  if (k == 1)\n    printf(\"1\\n\");\n  else if (k >= 2) {\n    int a[25], i, b[25], c[25], j, p = 0, m, n, t = 0;\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < k; i++)\n      scanf(\" %d\", &a[i]);\n    b[0] = 1;\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j <= k - 1; j++) {\n        if (a[i] >= a[j]) {\n          c[p] = b[k - 1 - j];\n          p++;\n        }\n        for (m = 0; m < p; m++) {\n          if (c[m] > t)\n            t = c[m];\n        }\n      }\n      b[k - 1 - i] = t + 1;\n      p = 0;\n      t = 0;\n      for (m = 0; m < p; m++)\n        c[m] = 0;\n    }\n    for (n = 0; n < k; n++) {\n      if (b[n] > t)\n        t = b[n];\n    }\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "10", "index": "17441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[26] = {0}, b[26] = {0};\n  int i, j, r;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 1; i--) {\n    r = 0;\n    for (j = i; j <= k; j++) {\n      if (a[i] >= a[j])\n        r = b[j] + 1;\n      if (b[i] < r)\n        b[i] = r;\n    }\n  }\n  r = 0;\n  for (i = 1; i <= k; i++)\n    if (b[i] > r)\n      r = b[i];\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "17442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int a[26], b[26];\n  for (i = 1; i < 26; i++)\n    b[i] = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  int num[26];\n  int max;\n  num[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = k; j > i; j--)\n      if (a[j] <= a[i])\n        b[j] = num[j];\n    max = 0;\n    for (j = k; j > i; j--) {\n      if (b[j] >= max)\n        max = b[j];\n    }\n    num[i] = max + 1;\n    for (j = 1; j < 26; j++)\n      b[j] = 0;\n  }\n\n  int x;\n  x = num[1];\n  for (i = 1; i <= k; i++) {\n    if (x <= num[i])\n      x = num[i];\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    if (t > 0)\n      b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17444", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[30];\n  scanf(\"%d \", &k);\n  for (int i = 1; i <= k; i++)\n    scanf(\"%d \", &a[i]);\n  int sum[30];\n  for (int i = 0; i <= k; i++)\n    sum[i] = 1;\n  for (int i = 2; i <= k; i++) {\n    for (int j = i - 1; j > 0; j--) {\n      if (a[j] >= a[i] && sum[i] < sum[j] + 1)\n        sum[i] = sum[j] + 1;\n    }\n  }\n  int max = 1;\n  for (int i = 1; i <= k; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100] = {0}, maxlen[100] = {0}, i, j, temp, temp2 = 1, temp3;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    temp2 = 1;\n    if (i == 0)\n      maxlen[i] = 1;\n    else {\n      temp3 = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (a[j] >= a[i]) {\n          if (maxlen[j] > maxlen[temp3])\n            temp3 = j;\n          temp2 = 0;\n        }\n      }\n      maxlen[i] = maxlen[temp3] + 1;\n      if (temp2 == 1)\n        maxlen[i] = 1;\n    }\n  }\n  temp = 0;\n  for (i = 0; i < n; i++) {\n    if (maxlen[i] > maxlen[temp])\n      temp = i;\n  }\n  printf(\"%d\", maxlen[temp]);\n  return 0;\n}\n"}
{"label": "10", "index": "17446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, sum[25], a[25], b[25], k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++) {\n    sum[i] = 1;\n  }\n  sum[k - 1] = 1;\n  for (i = k - 1; i >= 1; i--)\n\n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f[26] = {0};\nint b[26] = {0};\nint main() {\n  int n, k, i, j, tmax, ti;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    tmax = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[j] >= b[i] && f[j] + 1 >= tmax)\n        tmax = f[j] + 1;\n    }\n    f[i] = tmax;\n  }\n  tmax = -1;\n  for (i = 0; i < n; i++) {\n\n    if (f[i] > tmax)\n      tmax = f[i];\n  }\n\n  printf(\"%d\\n\", tmax);\n  return 0;\n}\n"}
{"label": "10", "index": "17448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  int k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  int a[30] = {0};\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b[30] = {1};\n  int t;\n  int c[30];\n  for (i = 1; i < k; i++) {\n    t = 0;\n    for (j = 0; j < 30; j++) {\n      c[j] = 0;\n    }\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        c[t] = b[j];\n        t++;\n      }\n    }\n    qsort(c, t, sizeof(int), compare);\n    b[i] = c[0] + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint c[25], d[25], k;\nint D(int a) {\n  int m = 1;\n  for (int i = a + 1; i <= k - 1; i++)\n    if (c[i] <= c[a] && m < D(i) + 1)\n      m = D(i) + 1;\n  return m;\n}\n\nint main() {\n  int max = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &c[i]);\n  for (int i = k - 1; i >= 0; i--) {\n    d[i] = D(i);\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  struct a {\n    int x, y;\n  } a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].x);\n  }\n  int j;\n  for (j = 0; j < n; j++) {\n    int k = 0;\n    for (i = j + 1; i < n; i++) {\n      if (a[i].x < a[j].x)\n        k++;\n    }\n    a[j].y = k;\n  }\n  int w;\n  for (i = n - 1; i >= 1; i--) {\n    if (a[i - 1].y < a[i].y + 1) {\n      a[i - 1].y = a[i].y;\n      w++;\n    }\n  }\n  printf(\"%d\", n - w);\n  return 0;\n}\n"}
{"label": "10", "index": "17451", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num = 0, k = 0, n, i, j, a[50], max = 0, f[50] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] <= a[j] && f[i] < f[j]) {\n        f[i] = f[j];\n      }\n    }\n    f[i]++;\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17452", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int h, r;\n  } a[30];\n  int i, j, n, k = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].h;\n    a[i].r = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].h >= a[j].h) && (a[i].r <= (a[j].r + 1)))\n        a[i].r = a[j].r + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (k <= a[i].r)\n      k = a[i].r;\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int j = 0;\n  int max = 0;\n  int i, m;\n  scanf(\"%d\", &k);\n  int height[k], b[k];\n  while (j < k) {\n    scanf(\"%d\", &height[j]);\n    j++;\n  }\n  j = j - 1;\n  while (j >= 0) {\n    for (i = j + 1; i < k; i++) {\n      if (height[i] <= height[j] && b[i] > max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n    max = 0;\n    j--;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int m[25];\n  int s[25][25];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int *p, int num, int height) {\n  int missile, case1, case2;\n  if (num == 1) {\n    if (*p <= height)\n      missile = 1;\n    else\n      missile = 0;\n  } else {\n    case1 = max(p + 1, num - 1, *p) + 1;\n    case2 = max(p + 1, num - 1, height);\n    if (*p <= height && case1 >= case2)\n      missile = case1;\n    else {\n      missile = case2;\n    }\n  }\n  return (missile);\n}\nint main() {\n  int a[100], n, i, height = 100000, H;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  H = max(a, n, height);\n  cout << H;\n  return 0;\n}\n"}
{"label": "10", "index": "17456", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int i, j, n, res = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n], tem = 0;\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    tem = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        tem = max(tem, b[j]);\n      else\n        continue;\n    }\n    b[i] = tem + 1;\n  }\n  for (i = 0; i < n; i++)\n    res = max(res, b[i]);\n  printf(\"%d\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "17457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\nint main() {\n  int i, j, n, m;\n  int a[100];\n  int f[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  f[0] = 1;\n  m = 0;\n  for (i = 1; i < n; i++)\n    for (j = i; j >= 0; j--) {\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n      if (f[i] > m)\n        m = f[i];\n    }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[30];\n  int count[30];\n  cin >> n;\n  int i;\n  int j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    count[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] <= num[j]) {\n        if (count[i] < count[j] + 1) {\n          count[i] = count[j] + 1;\n        }\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (count[i] > max) {\n      max = count[i];\n    }\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17459", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int s[], int n);\nint main() {\n  int k, a[25], i, N;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  N = f(a, k);\n  printf(\"%d\", N);\n}\n\nint f(int s[], int n) {\n  int i, b[25], j;\n  int flag = 0, flag2 = 0;\n  int *p = s;\n  for (i = 0; i < n - 1; i++)\n    if (s[i] < s[i + 1]) {\n      flag = 1;\n      break;\n    }\n  if (flag == 0)\n    return n;\n  else {\n    for (i = 1; i < n; i++) {\n      if (s[i] > s[0]) {\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 0)\n      return f(p + 1, n - 1) + 1;\n    else {\n      b[0] = s[0];\n      for (i = 1, j = 1; i < n; i++)\n        if (s[i] <= s[0]) {\n          b[j] = s[i];\n          j++;\n        }\n\n      return ((f(p + 1, n - 1)) > f(b, j) ? (f(p + 1, n - 1)) : f(b, j));\n    }\n  }\n}\n"}
{"label": "10", "index": "17460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int h[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  int m[n];\n  for (int i = 0; i < n; i++)\n    m[i] = 0;\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (h[i] >= h[j] && m[i] - 1 < m[j])\n        m[i] = m[j] + 1;\n      if (j == n - 1 && m[i] == 0)\n        m[i] = 1;\n    }\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (m[i] > max)\n      max = m[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, max, n;\n  scanf(\"%d \", &n);\n  int h[25], m[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &h[i]);\n  m[n - 1] = 1;\n  max = m[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    m[i] = 1;\n    for (k = i + 1; k <= n - 1; k++)\n      if ((h[i] >= h[k]) && (m[i] < 1 + m[k]))\n        m[i] = m[k] + 1;\n    if (m[i] > max)\n      max = m[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100];\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int q[100] = {\n      0,\n  };\n  int j, k;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i, k = i; j < n; j++) {\n      if (a[j] <= a[i] && q[k] <= q[j])\n        k = j;\n    }\n    if (k != i)\n      q[i] = q[k] + 1;\n  }\n  for (i = 0, k = 0; i < n; i++) {\n    if (q[k] < q[i])\n      k = i;\n  }\n  printf(\"%d\", q[k] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17463", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[25], i, j, a[25], n, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    s[i] = 1;\n    max = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && s[j] > max)\n        max = s[j];\n    s[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i])\n      max = s[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17464", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100] = {0}, maxlen[100] = {0}, i, j, temp, temp2 = 1, temp3;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    temp2 = 1;\n    if (i == 0)\n      maxlen[i] = 1;\n    else {\n      temp3 = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (a[j] >= a[i]) {\n          if (maxlen[j] > maxlen[temp3])\n            temp3 = j;\n          temp2 = 0;\n        }\n      }\n      maxlen[i] = maxlen[temp3] + 1;\n      if (temp2 == 1)\n        maxlen[i] = 1;\n    }\n  }\n  temp = 0;\n  for (i = 0; i < n; i++)\n    if (maxlen[i] > maxlen[temp])\n      temp = i;\n  printf(\"%d\", maxlen[temp]);\n  return 0;\n}\n"}
{"label": "10", "index": "17465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100] = {0}, b[100] = {0}, sum = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    b[i] = 1;\n\n    for (j = 1; j < i; j++)\n\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n\n        b[i] = b[j] + 1;\n\n    if (sum < b[i])\n      sum = b[i];\n  }\n\n  cout << sum << \"\\n\";\n}\n"}
{"label": "10", "index": "17466", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint p(int n, int heightLimit, int *missileHeight, int missileNum) {\n  int a;\n  int b;\n\n  \n  if (n == missileNum - 1)\n    if (missileHeight[n] <= heightLimit)\n      return 1;\n    else\n      return 0;\n  else if (missileHeight[n] <= heightLimit) {\n    a = 1 + p(n + 1, missileHeight[n], missileHeight, missileNum);\n    b = p(n + 1, heightLimit, missileHeight, missileNum);\n    return a > b ? a : b;\n  } else\n    return p(n + 1, heightLimit, missileHeight, missileNum);\n}\n\nint main() {\n  int n, i, j;\n  int *missileHeight;\n\n  int highest = -1;\n\n  scanf(\"%d\", &n);\n  missileHeight = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(missileHeight[i]));\n    if (missileHeight[i] > highest)\n      highest = missileHeight[i];\n  }\n  printf(\"%d\", p(0, highest, missileHeight, n));\n}\n"}
{"label": "10", "index": "17467", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else {\n    return y;\n  }\n}\nint main() {\n  int num[30];\n  int r = 0;\n  int dp[30] = {0};\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i]);\n    dp[i] = 1;\n  }\n  for (int i = 2; i <= n; i++)\n    for (int j = 1; j < i; j++)\n      if (num[i] <= num[j]) {\n        dp[i] = max(dp[i], dp[j] + 1);\n        if (dp[i] > r)\n          r = dp[i];\n      }\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "10", "index": "17468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int(*p) = (int *)malloc(k * sizeof(int));\n  int(*q) = (int *)malloc(k * sizeof(int));\n  int i, j, t;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n    q[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      t = 0;\n      if (p[j] >= p[i]) {\n        t = q[j] + 1;\n        if (t >= q[i]) {\n          q[i] = t;\n        }\n      }\n    }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (q[i] > max)\n      max = q[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar f(int max, int a[], char m, char n) {\n  char num1, num2;\n  if (m == n && a[n - 1] <= max)\n    return (1);\n  else if (m == n && a[n - 1] > max)\n    return (0);\n  else {\n    if (a[m - 1] <= max) {\n      num1 = f(max, a, m + 1, n);\n      num2 = f(a[m - 1], a, m + 1, n) + 1;\n      if (num1 > num2)\n        return (num1);\n      else\n        return (num2);\n    } else\n      return (f(max, a, m + 1, n));\n  }\n}\n\nint main() {\n  int hmax = (unsigned)(~0) >> 1;\n  int h[1000];\n  char n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  cout << f(hmax, h, 1, n) << \" \";\n  cout << \"input: \";\n  for (i = 0; i < n; i++)\n    printf(\"%d,\", h[i]);\n  return 0;\n}\n"}
{"label": "10", "index": "17470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, height = 9999;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int **b = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i <= n - 1; i++)\n    b[i] = (int *)malloc(9999 * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 2; i++) {\n    if (a[i] > a[i + 1]) {\n      k = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = k;\n    }\n  }\n  height = a[n - 1];\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j <= height; j++) {\n      if (i == n - 1) {\n        if (j >= a[i]) {\n          b[i][j] = 1;\n        } else\n          b[i][j] = 0;\n      } else {\n        if (j >= a[i]) {\n          if (1 + b[i + 1][a[i]] > b[i + 1][j]) {\n            b[i][j] = 1 + b[i + 1][a[i]];\n          } else\n            b[i][j] = b[i + 1][j];\n        } else\n          b[i][j] = b[i + 1][j];\n      }\n    }\n  }\n  printf(\"%d\", b[0][height] + 1);\n}\n"}
{"label": "10", "index": "17471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k;\nint num[26];\nint val[26];\nint main() {\n\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++) {\n    cin >> num[i];\n    val[i] = 0;\n  }\n\n  for (int i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      val[i] = 1;\n    else {\n      int temp = 0;\n      for (int j = i; j < k; j++) {\n        if (num[i] >= num[j] && val[j] >= temp) {\n          temp = val[j];\n        }\n      }\n      val[i] = temp + 1;\n    }\n  }\n  int sum = 0;\n  for (int i = 0; i < k; i++) {\n\n    if (val[i] >= sum)\n      sum = val[i];\n  }\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f[26] = {0};\nint b[26] = {0};\nint main() {\n  int n, i, j, tmax;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    tmax = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[j] >= b[i] && f[j] + 1 >= tmax) {\n        tmax = f[j] + 1;\n      }\n    }\n    f[i] = tmax;\n  }\n  tmax = -1;\n  for (i = 0; i < n; i++) {\n\n    if (f[i] > tmax)\n      tmax = f[i];\n  }\n\n  cout << tmax << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {0};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 10000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && max(a, i) > t)\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "17474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  int a[30] = {0}, f[30] = {0};\n  cin >> N;\n  for (int i = 0; i < N; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  int ans = 0;\n  for (int i = 1; i < N; i++) {\n    int mx = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > mx)\n        mx = f[j];\n    f[i] = mx + 1;\n    if (ans < f[i])\n      ans = f[i];\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int b[25]) {\n  int i, t = b[0];\n  for (i = 0; i < 25; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  return t;\n}\nint destroy(int a[25], int t) {\n  int b[25] = {1};\n  int i, j;\n  for (j = t - 1; j >= 0; j--) {\n    for (i = j + 1; i <= t; i++) {\n      if (a[j] >= a[i] && (b[i] + 1) > b[j])\n        b[j] = b[i] + 1;\n    }\n  }\n  return max(b) + 1;\n}\nint main() {\n  int x, i = 0;\n  int a[25] = {0};\n  scanf(\"%d\", &x);\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", destroy(a, x - 1));\n}\n"}
{"label": "10", "index": "17476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000], i, j, n, b[1000], max = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[25], i, j, l, p, q;\n  int b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (j = k - 1; j >= 0; j--) {\n    for (l = k - 1; l >= j; l--) {\n      if (l != j) {\n        if ((a[j] >= a[l]) && (b[j] == b[l] - 1)) {\n          b[j] = b[l];\n        }\n\n      } else if (l == j) {\n        b[j] = b[j] + 1;\n      }\n    }\n  }\n  for (p = 1; p <= k - 1; p++) {\n    if (b[0] < b[p]) {\n      q = b[0];\n      b[0] = b[p];\n      b[p] = q;\n    }\n  }\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "17478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h[25], n;\nint hack(int i, int w) {\n  if (i == n - 1) {\n    if (h[i] <= w)\n      return 1;\n    else\n      return 0;\n  }\n  int b = hack(i + 1, w), c = 0;\n  if (h[i] <= w)\n    c = 1 + hack(i + 1, h[i]);\n  if (b > c)\n    return b;\n  else\n    return c;\n}\nint main() {\n  scanf(\"%d\", &n);\n  int i, max = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    if (h[i] > max)\n      max = h[i];\n  }\n  printf(\"%d\", hack(0, max));\n  return 0;\n}\n"}
{"label": "10", "index": "17479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int k, a[25], i, j, max, b[25] = {1};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && b[j] + 1 >= max)\n        max = b[j] + 1;\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26], h[26], k, i, j, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  cout << t;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  int a[30] = {0}, f[30] = {0};\n  scanf(\"%d \", &N);\n  for (int i = 0; i < N; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  int ans = 0;\n  for (int i = 1; i < N; i++) {\n    int mx = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > mx)\n        mx = f[j];\n    f[i] = mx + 1;\n    if (ans < f[i])\n      ans = f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17482", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, j, h[1000], a[1000], n = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  a[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    a[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (h[j] < h[i] || h[j] == h[i]) {\n        if ((a[j] + 1) > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (a[i] > n)\n      n = a[i];\n  printf(\"%d\", n);\n}\n"}
{"label": "10", "index": "17483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, max, ans = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n      if (a[i] >= a[j] && b[j] == max) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[j] > ans)\n      ans = b[j];\n  }\n\n  cout << ans;\n  return 0;\n}\n"}
{"label": "10", "index": "17484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, h[25], a[25][25] = {0};\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    cin >> h[i];\n  int max = 1;\n  for (int i = 0; i < k; i++)\n    a[i][i] = 1;\n  for (int i = 0; i < k - 1; i++)\n    for (int j = i + 1; j < k; j++) {\n      a[i][j] = 1;\n      for (int k = i; k < j; k++)\n        if (h[k] >= h[j] && a[i][k] + 1 > a[i][j])\n          a[i][j] = a[i][k] + 1;\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint H[1000], D[1000];\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "17486", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m = 0, a[100001] = {100000000};\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int t;\n    scanf(\"%d\", &t);\n    int j = m;\n    while (a[j] < t)\n      j--;\n    a[++j] = t;\n    m = j > m ? j : m;\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, num = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = b[i];\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[j] >= max)) {\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (b[i] > num)\n      num = b[i];\n  printf(\"%d \", num);\n}\n"}
{"label": "10", "index": "17488", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint height[26];\nint len(int num) {\n  int temp, max, i;\n  if (num == k) {\n    return (1);\n  } else {\n    max = 0;\n    for (i = num + 1; i <= k; i++) {\n      if (height[num] >= height[i]) {\n        temp = len(i);\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  height[0] = 30001;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  printf(\"%d\", len(0) - 1);\n  scanf(\"%d\", &k);\n}\n"}
{"label": "10", "index": "17489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, k;\n  scanf(\"%d\", &a);\n  int b[a], c[a], d[25];\n  for (i = 0; i <= a - 1; i++)\n    cin >> b[a - 1 - i];\n  c[0] = 1;\n  for (i = 1; i <= a - 1; i++) {\n    for (k = 0; k <= 24; k++)\n      d[k] = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[i] >= b[j])\n        d[j] = c[j] + 1;\n      if (b[i] < b[j] && j == 0)\n        d[j] = 1;\n    }\n    for (k = 0; k <= 23; k++)\n      if (d[k] > d[k + 1]) {\n        int n = d[k];\n        d[k] = d[k + 1];\n        d[k + 1] = n;\n      }\n    c[i] = d[24];\n  }\n  for (i = 0; i <= a - 2; i++)\n    if (c[i] > c[i + 1]) {\n      int n = c[i];\n      c[i] = c[i + 1];\n      c[i + 1] = n;\n    }\n  cout << c[a - 1];\n}\n"}
{"label": "10", "index": "17490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int a[25], i;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  int b[25], j;\n  b[k - 1] = 1;\n  if (a[k - 2] >= a[k - 1])\n    b[k - 2] = 2;\n  else\n    b[k - 2] = 1;\n  int max;\n\n  for (j = k - 3; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i <= k - 1; i++) {\n      if (a[j] >= a[i] && b[i] >= max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n  }\n\n  max = 0;\n  for (j = 0; j <= k - 1; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[25], i, j, a[25], n, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    s[i] = 1;\n    max = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && s[j] > max) {\n        max = s[j];\n      }\n    s[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (max < s[i])\n      max = s[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, k;\n  scanf(\"%d\", &a);\n  int b[a], c[a], d[25];\n  for (i = 0; i <= a - 1; i++)\n    scanf(\"%d\", &b[a - 1 - i]);\n  c[0] = 1;\n  for (i = 1; i <= a - 1; i++) {\n    for (k = 0; k <= 24; k++)\n      d[k] = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[i] >= b[j])\n        d[j] = c[j] + 1;\n      if (b[i] < b[j] && j == 0)\n        d[j] = 1;\n    }\n    for (k = 0; k <= 23; k++)\n      if (d[k] > d[k + 1]) {\n        int n = d[k];\n        d[k] = d[k + 1];\n        d[k + 1] = n;\n      }\n    c[i] = d[24];\n  }\n  for (i = 0; i <= a - 2; i++)\n    if (c[i] > c[i + 1]) {\n      int n = c[i];\n      c[i] = c[i + 1];\n      c[i + 1] = n;\n    }\n  printf(\"%d\", c[a - 1]);\n}\n"}
{"label": "10", "index": "17493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, t, d[25], h[25];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (d[j] > t)\n          t = d[j];\n      }\n    }\n    d[i] = t + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (d[i] > t)\n      t = d[i];\n  }\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17494", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint Max(int n, int a[]) {\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    if (x < a[i])\n      x = a[i];\n  }\n  return x;\n}\nint main() {\n  int x, n, i, j, b = 1;\n  int *p;\n  int *q;\n  cin >> n;\n  p = (int *)malloc(n * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = n - 1; i >= 0; i--) {\n\n    {\n      x = 0;\n      for (j = i + 1; j < n; j++) {\n        if ((p[i] >= p[j]) && (x < q[j]))\n          x = q[j];\n      }\n      q[i] = x + 1;\n    }\n  }\n  printf(\"%d\", Max(n, q));\n}\n"}
{"label": "10", "index": "17495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, max, n;\n  int a[30], b[30];\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    j = i - 1;\n    max = 0;\n    while (j >= 0) {\n      if (a[i] <= a[j] && max < b[j] + 1)\n        max = b[j];\n      j--;\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n}\n"}
{"label": "10", "index": "17496", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[30];\n  int len[30];\n  for (int i = 0; i < n; ++i) {\n    cin >> num[i];\n  }\n  len[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int max = 0;\n    for (int j = 0; j < i; ++j) {\n      if (num[j] >= num[i] && len[j] > max) {\n        max = len[j];\n      }\n      if (max == 0)\n        len[i] = 1;\n      else\n        len[i] = max + 1;\n    }\n  }\n  int l = len[0];\n  for (int i = 1; i < n; ++i) {\n    if (len[i] > l)\n      l = len[i];\n  }\n  cout << l << endl;\n}\n"}
{"label": "10", "index": "17497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[27], b[27], n, i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k + 1; i++)\n    b[i] = 0;\n  for (i = k; i >= 1; i--) {\n    for (j = i + 1; j <= k + 1; j++) {\n      if (a[i] >= a[j] && b[j] >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  n = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] > n)\n      n = b[i];\n  }\n  if (k == 25)\n    cout << n + 1 << \"\\n\";\n  else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "17498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint count_1[30], hgt[30], n, i, j, max_1, temp;\nvoid m(int s, int t);\nint main() {\n  for (i = 1; i <= 25; i++) {\n    count_1[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> hgt[i];\n    count_1[1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (hgt[i] <= hgt[j]) {\n        if (temp < count_1[j]) {\n          temp = count_1[j];\n        }\n      }\n    }\n    count_1[i] = temp + 1;\n  }\n  max_1 = 0;\n  for (i = 1; i <= n; i++) {\n    if (max_1 < count_1[i]) {\n      max_1 = count_1[i];\n    }\n  }\n  cout << max_1 << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17499", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, max = 0, u, j, a[26] = {0}, b[26] = {1};\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    b[i] = 1;\n  for (i = k - 1; i >= 1; i--)\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n      u = b[i];\n    }\n  for (i = 1; i <= k; i++)\n    max = (max >= b[i]) ? max : b[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {0};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 10000;\n  n = max(a, k + 1);\n  cout << n - 1 << \"\\n\";\n  return 0;\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && max(a, i) > t)\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "17501", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\n\nint main() {\n  int Max(int a, int b);\n  int height[100];\n  int dp[100];\n  char c;\n  int i = 0, temp = 0, n, j, dpmax = 0;\n\n  scanf(\"%d\", &n);\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n\n  for (i = 0; i <= n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (height[i] <= height[j])\n        dp[i] = Max(dp[j] + 1, dp[i]);\n    }\n  }\n  for (i = 0; i <= n; i++)\n    dpmax = Max(dpmax, dp[i]);\n\n  printf(\"%d\", dpmax);\n  return 0;\n}\nint Max(int a, int b) {\n  k = (a < b ? b : a);\n  return (k);\n}\n"}
{"label": "10", "index": "17502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int x[], int n);\nint main() {\n  int a[26] = {0}, b[26] = {0};\n  int i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = n - 1; i >= 0; i--) {\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= sum)\n          sum = b[j];\n      }\n    }\n    b[i] = sum + 1;\n  }\n  printf(\"%d \", max(b, n));\n  return 0;\n}\nint max(int x[], int n) {\n  int i, s = 0;\n  for (i = 0; i < n; i++) {\n    if (x[i] > s)\n      s = x[i];\n  }\n  return (s);\n}\n"}
{"label": "10", "index": "17503", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[30];\nint b[30];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n\n  b[0] = 1;\n  int tmp;\n  for (i = 1; i < n; ++i) {\n    tmp = 0;\n    for (j = 0; j < i; ++j) {\n      if (a[j] >= a[i] && b[j] > tmp) {\n        tmp = b[j];\n      }\n    }\n    b[i] = tmp + 1;\n  }\n\n  tmp = -1;\n  for (i = 0; i < n; ++i) {\n    if (b[i] > tmp) {\n      tmp = b[i];\n    }\n  }\n  cout << tmp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17504", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m, sum, maxim, t, bo[25] = {0};\n\nint meishu(int n, int a[]) {\n  int j;\n  if (n == m - 1)\n    return sum;\n  else {\n    for (j = n + 1; j < m; j++)\n      if (a[n] >= a[j]) {\n        bo[j] = 1;\n        sum++;\n        t = meishu(j, a);\n        if (maxim < t)\n          maxim = t;\n        sum--;\n      }\n    if (j == m && sum != 1)\n      return sum;\n    else {\n      if (sum == 1)\n        return maxim;\n    }\n  }\n}\n\nint main() {\n  int i, a[25], maxi = 0;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    if (bo[i] == 0) {\n      sum = 1;\n      maxim = 1;\n      if (maxi < meishu(i, a))\n        maxi = meishu(i, a);\n    }\n  printf(\"%d\", maxi);\n  return 0;\n}\n"}
{"label": "10", "index": "17505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], A[25] = {0}, n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  A[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i; j < n; j++)\n      if (a[i] >= a[j]) {\n        if (A[i] <= A[j])\n          A[i] = A[j] + 1;\n      }\n    if (A[i] == 0) {\n      A[i] = 1;\n    }\n  }\n  max = A[0];\n  for (i = 0; i < n; i++) {\n    if (A[i] > max)\n      max = A[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(int x, int y) {\n  if (x <= y)\n    x = y + 1;\n  return x;\n}\nint main() {\n  int i, n, r, a, j;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  int *q = (int *)malloc(n * sizeof(int));\n  \n  for (j = n - 1; j >= 0; j--) {\n    q[j] = 1;\n    for (r = n - 1; r != j; r--) {\n      if (p[j] >= p[r])\n        q[j] = compare(q[j], q[r]);\n    }\n    \n  }\n  int max;\n  max = q[0];\n  for (a = 1; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint MAX(int a, int b) { return (a > b ? a : b); }\nint FIRE(int *h, int m, int i, int j) {\n  if (i == j)\n    return m >= h[j];\n  else if (m >= h[i])\n    return MAX(FIRE(h, m, i + 1, j), FIRE(h, h[i], i + 1, j) + 1);\n  else if (m < h[i])\n    return FIRE(h, m, i + 1, j);\n}\nint main() {\n  int n, i, h[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  cout << FIRE(h, 65530, 1, n);\n}\n"}
{"label": "10", "index": "17508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], i, j, k, c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 25; i++) {\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    c = 0;\n    for (k = 0; k < i; k++) {\n      if (b[k] > b[j])\n        c = 1;\n    }\n    if (c == 0) {\n      cout << b[j] << \" \";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  cin >> n;\n  int high[100], count[100];\n  for (i = 0; i < n; i++) {\n    count[i] = 0;\n    cin >> high[i];\n  }\n  high[n] = 0, count[n] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    int step = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (count[j] > step) {\n        if (high[j] <= high[i])\n          step = count[j];\n      }\n    }\n    count[i] = step + 1;\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (count[i] > max) {\n      max = count[i];\n    }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  int b[25], j;\n  b[k - 1] = 1;\n  if (a[k - 2] >= a[k - 1])\n    b[k - 2] = 2;\n  else\n    b[k - 2] = 1;\n  int max;\n\n  for (j = k - 3; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i <= k - 1; i++) {\n      if (a[j] >= a[i] && b[i] >= max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n  }\n\n  max = 0;\n  for (j = 0; j <= k - 1; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17511", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint changdu(int i, int n, int *a, int *b) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j, n, a, b) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int a[25], b[25];\n  int n;\n  int max = 0, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i, n, a, b);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max, h[25], t[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    t[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (h[i] >= h[j] && t[i] <= t[j])\n        t[i] = t[j] + 1;\n  for (max = 0, i = 0; i < k; i++)\n    if (t[i] > max)\n      max = t[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(int x, int y) {\n  if (x <= y)\n    x = y + 1;\n  return x;\n}\nint main() {\n  int i, n, r, a, j;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  int *q = (int *)malloc(n * sizeof(int));\n\n  for (j = n - 1; j >= 0; j--) {\n    q[j] = 1;\n    for (r = n - 1; r != j; r--) {\n      if (p[j] >= p[r]) {\n        q[j] = compare(q[j], q[r]);\n      }\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 1; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, j, h[1000], a[1000], n = 1;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  a[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    a[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (h[j] < h[i] || h[j] == h[i]) {\n        if ((a[j] + 1) > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (a[i] > n)\n      n = a[i];\n  cout << n;\n}\n"}
{"label": "10", "index": "17515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int d[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", d + i);\n  }\n  int opt[n];\n  for (int i = 0; i < n; i++) {\n    opt[i] = 0;\n  }\n  for (int i = n; i >= 0; i--)\n    for (int j = i; j < n; j++) {\n      if ((d[i] >= d[j]) && (opt[i] <= opt[j] + 1))\n        opt[i] = opt[j] + 1;\n    }\n  int max = 1;\n  for (int i = 0; i < n; i++) {\n    if (opt[i] > max)\n      max = opt[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0;\n  int a[25] = {0}, b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (a[i] >= a[j] && b[i] <= b[j])\n        b[i] = b[j] + 1;\n    if (b[i] == 0)\n      b[i] = 1;\n  }\n  for (i = 0; i <= k - 2; i++)\n    for (j = 0; j <= k - 2 - i; j++)\n      if (b[j] > b[j + 1]) {\n        l = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = l;\n      }\n  printf(\"%d\\n\", b[k - 1]);\n}\n"}
{"label": "10", "index": "17517", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[30];\n  cin >> k;\n  for (int i = 1; i <= k; i++)\n    cin >> a[i];\n  int sum[30];\n  for (int i = 0; i <= k; i++)\n    sum[i] = 1;\n  for (int i = 2; i <= k; i++) {\n    for (int j = i - 1; j > 0; j--) {\n      if (a[j] >= a[i] && sum[i] < sum[j] + 1)\n        sum[i] = sum[j] + 1;\n    }\n  }\n  int max = 1;\n  for (int i = 1; i <= k; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17518", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[30], b[30], sum, i, j, m, p = 0;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 1; i > 0; i--) {\n    if (a[i - 1] >= a[i])\n      b[i - 1] = b[i] + 1;\n    else\n      break;\n  }\n  for (j = i - 1; j >= 0; j--) {\n    sum = b[k - 1];\n    for (m = k - 1; m > j; m--) {\n      if (a[j] >= a[m] && b[m] >= sum)\n        sum = b[m], p++;\n    }\n    if (p == 0)\n      b[j] = 1;\n    else\n      b[j] = sum + 1;\n  }\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "10", "index": "17519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, h[26], p[26], i, j, m, t, a[26][26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> h[i];\n  for (i = 1; i <= k; i++)\n    p[i] = h[i];\n  for (i = 1; i < k; i++) {\n    m = i;\n    for (j = i + 1; j <= k; j++)\n      if (p[j] > p[m])\n        m = j;\n    t = p[i];\n    p[i] = p[m];\n    p[m] = t;\n  }\n  for (i = 0; i <= k; i++)\n    for (j = 0; j <= k; j++)\n      a[i][j] = 0;\n  for (i = 1; i <= k; i++)\n    for (j = 1; j <= k; j++) {\n      if (h[i] == p[j])\n        a[i][j] = a[i - 1][j - 1] + 1;\n      else {\n        if (a[i - 1][j] > a[i][j - 1])\n          a[i][j] = a[i - 1][j];\n        else\n          a[i][j] = a[i][j - 1];\n      }\n    }\n  cout << a[k][k];\n  return 0;\n}\n"}
{"label": "10", "index": "17520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[100], max;\n  double a[100];\n  memset(c, 0, sizeof(c));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%lf\", &a[i]);\n  c[n - 1] = 1;\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && c[j] > max)\n        max = c[j];\n    c[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (c[i] > max)\n      max = c[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k = 0, n, a[26] = {0};\nconst int y = 1000000;\nvoid lanjie(int i, int m, int h) {\n  if (i == n + 1) {\n    if (m > k)\n      k = m;\n    return;\n  }\n  if (m + n - i < k)\n    return;\n  if (h >= a[i])\n    lanjie(i + 1, m + 1, a[i]);\n  lanjie(i + 1, m, h);\n  return;\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  lanjie(1, 0, y);\n  cout << k << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, c;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[j] > b[i]) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n    if (i == 0) {\n      break;\n    }\n  }\n  k = 0;\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      k = i;\n      c = b[i];\n    }\n  }\n  cout << b[k];\n  return 0;\n}\n"}
{"label": "10", "index": "17523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int *p, int num, int height) {\n  int missile, case1, case2;\n  if (num == 1) {\n    if (*p <= height)\n      missile = 1;\n    else\n      missile = 0;\n  } else {\n    case1 = max(p + 1, num - 1, *p) + 1;\n    case2 = max(p + 1, num - 1, height);\n    if (*p <= height && case1 >= case2)\n      missile = case1;\n    else\n      missile = case2;\n  }\n  return (missile);\n}\nint main() {\n  int a[100], n, i, height = 100000, H;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  H = max(a, n, height);\n  printf(\"%d\", H);\n  return 0;\n}\n"}
{"label": "10", "index": "17524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint min(int a[]) {\n  int n = 0, i, x = a[0];\n  while (a[n] != 0)\n    n++;\n\n  for (i = 0; i <= n - 1; i++)\n    if (x > a[i])\n      x = a[i];\n\n  return x;\n}\n\nint f(int a[]) {\n  int n = 0;\n  while (a[n] != 0)\n    n++;\n\n  if (n == 1)\n    return 1;\n  else {\n    int b[25], c[25], i;\n    if (a[n - 1] == min(a)) {\n      for (i = 0; i <= n - 2; i++)\n        b[i] = a[i];\n      b[n - 1] = 0;\n\n      return 1 + f(b);\n    } else {\n      int k = 0;\n      for (i = 0; i <= n - 1; i++) {\n        if (a[i] != min(a)) {\n          b[k] = a[i];\n          k++;\n        }\n      }\n      b[k] = 0;\n\n      do\n        n--;\n      while (a[n] != min(a));\n      for (i = 0; i <= n; i++)\n        c[i] = a[i];\n      c[n + 1] = 0;\n\n      return f(b) > f(c) ? f(b) : f(c);\n    }\n  }\n}\n\nint main(void) {\n  int n, a[25];\n  cin >> n;\n  int k;\n  for (k = 0; k <= n - 1; k++)\n    cin >> a[k];\n  a[n] = 0;\n\n  cout << f(a) << \"\\n\";\n}\n"}
{"label": "10", "index": "17525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[25];\n  int rem[25] = {1};\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  int MMax = 0;\n  for (int i = 1; i < n; i++) {\n    int max = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (j < max)\n        break;\n      if (a[j] >= a[i] && rem[j] > max)\n        max = rem[j];\n    }\n    rem[i] = max + 1;\n    if (rem[i] > MMax)\n      MMax = rem[i];\n  }\n  printf(\"%d\\n\", MMax);\n  return 0;\n}\n"}
{"label": "10", "index": "17526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, i = 0, j;\n  int d[50];\n  int a[50];\n  int m;\n  scanf(\"%d\", &n);\n  t = n;\n  while (t--)\n    scanf(\"%d\", &d[i++]);\n  a[0] = 1;\n  m = 1;\n  for (j = 1; j < n; j++) {\n    a[j] = 1;\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (d[i] >= d[j]) {\n        if (a[i] + 1 > a[j])\n          a[j] = a[i] + 1;\n      }\n    }\n    if (a[j] > m)\n      m = a[j];\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17527", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, max, n;\n  cin >> n;\n  int h[25], m[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &h[i]);\n  m[n - 1] = 1;\n  max = m[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    m[i] = 1;\n    for (k = i + 1; k <= n - 1; k++)\n      if ((h[i] >= h[k]) && (m[i] < 1 + m[k]))\n        m[i] = m[k] + 1;\n    if (m[i] > max)\n      max = m[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17528", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint min(int a[]) {\n  int n = 0, i, x = a[0];\n  while (a[n] != 0)\n    n++;\n\n  for (i = 0; i <= n - 1; i++)\n    if (x > a[i])\n      x = a[i];\n\n  return x;\n}\n\nint f(int a[]) {\n  int n = 0;\n  while (a[n] != 0)\n    n++;\n\n  if (n == 1)\n    return 1;\n  else {\n    int b[25], c[25], i;\n    if (a[n - 1] == min(a)) {\n      for (i = 0; i <= n - 2; i++)\n        b[i] = a[i];\n      b[n - 1] = 0;\n\n      return 1 + f(b);\n    } else {\n      int k = 0;\n      for (i = 0; i <= n - 1; i++) {\n        if (a[i] != min(a)) {\n          b[k] = a[i];\n          k++;\n        }\n      }\n      b[k] = 0;\n\n      do\n        n--;\n      while (a[n] != min(a));\n      for (i = 0; i <= n; i++)\n        c[i] = a[i];\n      c[n + 1] = 0;\n\n      return f(b) > f(c) ? f(b) : f(c);\n    }\n  }\n}\n\nint main(void) {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k <= n - 1; k++)\n    cin >> a[k];\n  a[n] = 0;\n\n  printf(\"%d\\n\", f(a));\n}\n"}
{"label": "10", "index": "17529", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint k;\n\nint main() {\n  int Max(int a, int b);\n  int height[100];\n  int dp[100];\n  char c;\n  int i = 0, temp = 0, n, j, dpmax = 0;\n\n  scanf(\"%d\", &n);\n  n = n - 1;\n  for (i = 0; i <= n; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  \n\n  for (i = 0; i <= n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (height[i] <= height[j])\n        dp[i] = Max(dp[j] + 1, dp[i]);\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    dpmax = Max(dpmax, dp[i]);\n  }\n  printf(\"%d\", dpmax);\n  return 0;\n}\nint Max(int a, int b) {\n  k = (a < b ? b : a);\n  return (k);\n}\n"}
{"label": "10", "index": "17530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  int a[100], b[100], max = 0;\n  memset(b, 0, sizeof(b));\n  for (i = 0; i < N; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        b[i] = (b[j] + 1) > b[i] ? (b[j] + 1) : b[i];\n    }\n    max = max > b[i] ? max : b[i];\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "17531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\nint main() {\n  int i, j, n, m;\n  int a[100];\n  int f[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  f[0] = 1;\n  m = 0;\n  for (i = 1; i < n; i++)\n    for (j = i; j >= 0; j--) {\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n      if (f[i] > m)\n        m = f[i];\n    }\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "17532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int *m;\n  int **s;\n  scanf(\"%d\", &k);\n  m = (int *)malloc(k * sizeof(int));\n  s = (int **)malloc(k * sizeof(int *));\n  for (i = 0; i < k; i++)\n    s[i] = (int *)malloc((i + 1) * sizeof(int));\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k;\nint mis[30];\nint maxL = 0;\nint curH = 100000;\nint getNum = 0;\nint cmp(int a, int b) {\n  if (a > b)\n    return 0;\n  else\n    return 1;\n}\n\nvoid oneState(int id) {\n  if (id >= k) {\n    if (getNum > maxL)\n      maxL = getNum;\n    return;\n  }\n\n  if (mis[id] <= curH) {\n    int t = curH;\n    curH = mis[id];\n    getNum++;\n\n    oneState(id + 1);\n\n    curH = t;\n    getNum--;\n  }\n\n  oneState(id + 1);\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> mis[i];\n  }\n  oneState(0);\n  printf(\"%d\\n\", maxL);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, max, f[26], g[26];\n  \n  \n  \n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &g[i]);\n    f[i] = 0;\n  }\n  f[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    max = 0;\n    for (j = i + 1; j <= n; j++)\n      if ((g[j] <= g[i]) && (f[j] > max))\n        max = f[j];\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > max)\n      max = f[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int i, j, k, m, n, res = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n], tem = 0;\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    tem = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        tem = max(tem, b[j]);\n      else\n        continue;\n    }\n    b[i] = tem + 1;\n  }\n  for (i = 0; i < n; i++)\n    res = max(res, b[i]);\n  cout << res;\n}\n"}
{"label": "10", "index": "17536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, c;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[j] > b[i]) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n    if (i == 0)\n      break;\n  }\n  k = 0;\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      k = i;\n      c = b[i];\n    }\n  }\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "10", "index": "17537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, a[30], b[30];\n  scanf(\"%d\", &n);\n  m = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, g, h, p, q = 0, a[25], b[25], c[25];\n  for (i = 0; i < 25; i++)\n    b[i] = 1;\n  i = 0;\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[0]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  if (k == 1 || k == 0)\n    printf(\"%d\", k);\n  else {\n    for (j = k - 2; j >= 0; j--) {\n      for (p = j + 1; p < k; p++) {\n        if (a[j] >= a[p]) {\n          c[q] = b[p];\n          q++;\n        }\n      }\n      if (q == 0)\n        b[j] = 1;\n      else if (q == 1)\n        b[j] = c[0] + b[j];\n      else {\n        for (g = 0; g < q - 1; g++) {\n          m = c[g];\n          n = c[g + 1];\n          if (m > n) {\n            c[g] = n;\n            c[g + 1] = m;\n          }\n        }\n        b[j] = c[q - 1] + b[j];\n        q = 0;\n        g = 0;\n        p = j;\n      }\n    }\n    for (h = 0; h < k - 1; h++) {\n      m = b[h];\n      n = b[h + 1];\n      if (m > n) {\n        b[h] = n;\n        b[h + 1] = m;\n      }\n    }\n    printf(\"%d\", b[k - 1]);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], c[25], i, j, n, max = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i; j < n; j++) {\n      if (a[i] >= a[j]) {\n        c[j - i] = b[j] + 1;\n      } else {\n        c[j - i] = 1;\n      }\n    }\n    for (j = 0; j < n - i; j++) {\n      if (c[j] >= b[i])\n        b[i] = c[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17540", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint *p;\nint n;\nint max(int t, int k) {\n  if (t > k)\n    return t;\n  else\n    return k;\n}\nint pd(int i, int h) {\n  if (i == n)\n    return 0;\n  if (p[i] > h)\n    return pd(i + 1, h);\n  if (p[i] == h)\n    return pd(i + 1, h) + 1;\n  return max(pd(i + 1, p[i]) + 1, pd(i + 1, h));\n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  k = pd(0, 800000);\n  printf(\"%d\", k);\n  free(p);\n}\n"}
{"label": "10", "index": "17541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int i, j;\n  int s[30], t[30];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> s[i];\n    t[i] = 0;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (s[i] >= s[j] && t[i] < t[j])\n        t[i] = t[j];\n    }\n    t[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (t[0] < t[i])\n      t[0] = t[i];\n  }\n  cout << t[0];\n}\n"}
{"label": "10", "index": "17542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i;\nint h[26];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\n\nint f(int t, int l) {\n  if (t == 1) {\n    if (h[1] >= l)\n      return 1;\n    else\n      return 0;\n  }\n\n  else if (h[t] < l)\n    return f(t - 1, l);\n  else\n    return max(f(t - 1, l), f(t - 1, h[t]) + 1);\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n\n  printf(\"%d\", f(n, 0));\n}\n"}
{"label": "10", "index": "17543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\nint main() {\n  int k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  int a[30] = {0};\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int b[30] = {1};\n  int t;\n  int c[30];\n  for (i = 1; i < k; i++) {\n    t = 0;\n    for (j = 0; j < 30; j++) {\n      c[j] = 0;\n    }\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        c[t] = b[j];\n        t++;\n      }\n    }\n    qsort(c, t, sizeof(int), compare);\n    b[i] = c[0] + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (m < b[i]) {\n      m = b[i];\n    }\n  }\n  cout << m << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint result;\n\nvoid bfs(int a[], int n, int i, int u) {\n  int j;\n\n  if (result < u)\n    result = u;\n  if (i < n) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        bfs(a, n, j, u + 1);\n    }\n  }\n}\n\nint main() {\n  int R, C, i, j, n;\n  int a[26];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  result = 0;\n  a[0] = 99999;\n  bfs(a, n, 0, 0);\n\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "10", "index": "17545", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[30];\n  cin >> k;\n  for (int i = 1; i <= k; i++)\n    scanf(\"%d \", &a[i]);\n  int sum[30];\n  for (int i = 0; i <= k; i++)\n    sum[i] = 1;\n  for (int i = 2; i <= k; i++) {\n    for (int j = i - 1; j > 0; j--) {\n      if (a[j] >= a[i] && sum[i] < sum[j] + 1)\n        sum[i] = sum[j] + 1;\n    }\n  }\n  int max = 1;\n  for (int i = 1; i <= k; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17546", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int arr[103], brr[103];\n  int i, j, k, max;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &arr[i]);\n  for (i = 1; i <= n; i++)\n    brr[i] = 0;\n  max = 0;\n  for (i = n; i >= 1; i--) {\n    k = 0;\n    for (j = n; j > i; j--) {\n      if ((arr[j] <= arr[i]) && (brr[j] > k))\n        k = brr[j];\n    }\n    brr[i] = k + 1;\n    if (brr[i] > max) {\n      max = brr[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[26], d[26];\n  int i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", s + i);\n    d[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    k = 0;\n    for (j = i + 1; j < n; j++) {\n      if (k < d[j] && s[i] >= s[j])\n        k = d[j];\n    }\n    k++;\n    d[i] = k;\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > k)\n      k = d[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint aMaxLen[35];\nint nTmp;\nint main() {\n  int k, i;\n  cin >> k;\n  int b[25];\n  for (i = 0; i < k; i++)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= k; i++) {\n    int nTmp = 0;\n    for (int j = 1; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= k; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  cout << nMax << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nunsigned int h[26], n;\nint go(int maxh, int cp) {\n  int x, y, max;\n  while (h[cp] > maxh)\n    cp = cp + 1;\n  if (h[cp] == 0)\n    return 0;\n  x = go(maxh, cp + 1);\n  maxh = h[cp];\n  y = 1 + go(maxh, cp + 1);\n  max = (x > y) ? x : y;\n  return max;\n}\nint main() {\n  unsigned int i, c, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  h[n] = 0;\n  t = go(65535, 0);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, temp, max;\n  int a[100], ans[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    ans[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    temp = 1;\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i]) {\n        if (ans[j] + 1 > temp)\n          temp = ans[j] + 1;\n      }\n    }\n    ans[i] = temp;\n  }\n  max = 0;\n  for (i = 1; i <= k; i++) {\n    if (ans[i] > max) {\n      max = ans[i];\n    }\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint kMis;\nint Mis[30];\nint Array[30];\nvoid Lanjie(int iM) {\n  for (int i = iM; i < kMis; i++) {\n    if (Mis[iM - 1] >= Mis[i] && Array[iM - 1] <= Array[i])\n      Array[iM - 1] = Array[i] + 1;\n  }\n  if (iM > 1)\n    Lanjie(iM - 1);\n  return;\n}\nint main() {\n  cin >> kMis;\n  for (int i = 0; i < kMis; i++)\n    scanf(\"%d \", &Mis[i]);\n  for (int i = 0; i < kMis; i++) {\n    Array[i] = 1;\n  }\n  Lanjie(kMis);\n  int MaxLen = -1;\n  for (int i = 0; i < kMis; i++)\n    if (MaxLen < Array[i])\n      MaxLen = Array[i];\n  printf(\"%d\\n\", MaxLen);\n  return 0;\n}\n"}
{"label": "10", "index": "17552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint d[100], a[100];\nint i, j, k, n, ans;\n\nint main() {\n  scanf(\"%d \", &n);\n  a[0] = 1000000000;\n  for (i = 1; i <= n; ++i)\n    scanf(\"%d \", &a[i]);\n  d[0] = 0;\n  ans = 0;\n  for (i = 1; i <= n; ++i) {\n    d[i] = 1;\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j] && d[j] + 1 > d[i])\n        d[i] = d[j] + 1;\n    if (d[i] > ans)\n      ans = d[i];\n  }\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17553", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000], f[1000] = {0}, n, longest_index = -1, longest_f = -1;\n\nint main() {\n  int i, t;\n  cin >> n;\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", &a[i]);\n\n  {\n    int i, j;\n    for (i = 0; i < n; ++i)\n      f[i] = 1;\n    for (i = n - 2; i >= 0; --i) {\n      for (j = i + 1; j < n; ++j) {\n        if ((f[i] < f[j] + 1) && (a[i] >= a[j])) {\n          f[i] = f[j] + 1;\n          if (longest_f < f[i]) {\n            longest_f = f[i];\n            longest_index = i;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d \", longest_f);\n}\n"}
{"label": "10", "index": "17554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  int a[k];\n  int num[k];\n  int i;\n  int j;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    num[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i])\n        if (num[i] < num[j] + 1)\n          num[i] = num[j] + 1;\n  int max = 1;\n  for (i = 0; i < k; i++)\n    if (num[i] > max)\n      max = num[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17555", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int *data, int lens) {\n  int r = *data;\n  for (int j = 0; j < lens; j++)\n    if (*(data + j) > r)\n      r = *(data + j);\n  return r;\n}\nint f(int *data, int lens, int height) {\n  int tempResult[25];\n  if (lens == 0)\n    return 0;\n  int count = 0, tempHeight = 0;\n  for (int i = 0; i < lens; i++) {\n    if (data[i] <= height && data[i] >= tempHeight) {\n      tempHeight = data[i];\n      tempResult[count] = f(data + i + 1, lens - i - 1, data[i]);\n      count++;\n    }\n  }\n  if (count == 0)\n    return 0;\n  return max(tempResult, count) + 1;\n}\n\nint main() {\n  int data[25];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  cout << f(data, n, max(data, n));\n\n  return 0;\n}\n"}
{"label": "10", "index": "17556", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++) {\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n    }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  printf(\"%d\\n\", max(b));\n  return 0;\n}\n"}
{"label": "10", "index": "17557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxsize = 26;\nint maxnum(int *r, int n) {\n  int ans = 1;\n  int i, j, temp;\n  int maxlen[maxsize];\n  maxlen[0] = 1;\n  for (i = 1; i < n; i++) {\n    temp = 0;\n    for (j = 0; j < i; j++) {\n      if (r[j] >= r[i]) {\n        if (maxlen[j] > temp)\n          temp = maxlen[j];\n      }\n    }\n    maxlen[i] = temp + 1;\n    if (ans < maxlen[i])\n      ans = maxlen[i];\n  }\n  return ans;\n}\nint main() {\n  int i, k;\n  int r[maxsize];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", r + i);\n  cout << maxnum(r, k) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint analyse(int *, int *, int, int);\nint main() {\n  int k;\n  int height[25], numbers[25] = {0};\n  int i, max, temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", height + i);\n  max = numbers[24] = 1;\n  for (i = 23; i >= 0; i--) {\n    temp = analyse(height, numbers, i, k);\n    if (temp > max)\n      max = temp;\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\nint analyse(int *height, int *numbers, int seq, int k) {\n  int max = 0, temp, i;\n  for (i = k - 1; i > seq; i--) {\n    if (height[seq] >= height[i]) {\n      temp = numbers[i];\n      if (temp > max)\n        max = temp;\n    }\n  }\n  max++;\n  numbers[seq] = max;\n  return max;\n}\n"}
{"label": "10", "index": "17559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, max, j, c = 0;\n  int a[26], b[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 0;\n  for (i = k - 2; i >= 0; i--)\n\n  {\n    b[i] = 0;\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n    b[i] = max;\n    if (b[i] >= c)\n      c = b[i];\n  }\n  printf(\"%d\", c + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *p, *num;\n  int n, add;\n\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", p + i);\n    *(num + i) = 1;\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    add = 0;\n    for (int k = i + 1; k <= n - 1; k++) {\n      if (*(p + i) >= *(p + k) && *(num + k) > add)\n        add = *(num + k);\n      \n      \n    }\n    *(num + i) += add;\n  }\n  int maxnum = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    if (*(num + i) > maxnum)\n      maxnum = *(num + i);\n    \n  }\n  printf(\"%d\", maxnum);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17561", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[50], b[50];\n  cin >> n;\n  p = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (p < b[i])\n      p = b[i];\n  printf(\"%d\", p);\n  return 0;\n}\n"}
{"label": "10", "index": "17562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, d, max = 0, m = 1;\n  int a[26], b[26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n    max = 0;\n  }\n  for (d = 1; d <= k; d++) {\n    if (b[d] >= m)\n      m = b[d];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "17563", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint h[30];\nint len[30];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  len[0] = 1;\n  for (int i = 1; i < n; i++) {\n    len[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && len[j] + 1 > len[i])\n        len[i] = len[j] + 1;\n    }\n  }\n  int maxi = 0;\n  for (int i = 0; i < n; i++)\n    if (len[i] > maxi)\n      maxi = len[i];\n  printf(\"%d\\n\", maxi);\n}\n"}
{"label": "10", "index": "17564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  q[n - 1] = 1;\n  int best = q[n - 1];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    int a = 0;\n    for (int k = n - 1; k > i; k--) {\n      if (p[i] >= p[k] && q[k] >= a)\n        a = q[k];\n    }\n    q[i] = a + 1;\n    if (q[i] > best)\n      best = q[i];\n  }\n  printf(\"%d \", best);\n  return 0;\n}\n"}
{"label": "10", "index": "17565", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  struct a {\n    int x, y;\n  } a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].x;\n  }\n  int max = 0, j;\n  for (j = 0; j < n; j++) {\n    int k = 0;\n    for (i = j + 1; i < n; i++) {\n      if (a[i].x < a[j].x)\n        k++;\n    }\n    a[j].y = k;\n  }\n  int w;\n  for (i = n - 1; i >= 1; i--) {\n    if (a[i - 1].y < a[i].y + 1) {\n      a[i - 1].y = a[i].y;\n      w++;\n    }\n  }\n  printf(\"%d\", n - w);\n  return 0;\n}\n"}
{"label": "10", "index": "17566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, b[25], a[25], c, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i < k; i++) {\n    a[0] = 1;\n    c = 1;\n    for (j = 0; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (a[j] > c) {\n          c = a[j];\n        }\n      }\n    }\n    a[i] = c + 1;\n  }\n  c = 0;\n  for (i = 0; i < k; i++) {\n    if (a[i] > c) {\n      c = a[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "17567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, h, k, b[25], a[25];\n  k = 1;\n  t = n - 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n\n      if (a[i] >= a[j]) {\n        t = j;\n        b[i] = b[j] + 1;\n\n        for (h = j; h < n; h++) {\n          if (a[i] >= a[h] && b[h] > b[t]) {\n            b[i] = b[h] + 1;\n            t = h;\n          }\n        }\n        if (k < b[i]) {\n          k = b[i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], max[25] = {0}, max1 = 0;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    max[i] = 1;\n  max1 = 1;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 0; j <= i - 1; j++) {\n      if ((a[j] >= a[i]) && (max[j] + 1 > max[i]))\n        max[i] = max[j] + 1;\n      if (max[i] > max1)\n        max1 = max[i];\n    }\n  printf(\"%d\\n\", max1);\n}\n"}
{"label": "10", "index": "17569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, tmp;\n  int high[30] = {0};\n  int a[30] = {1};\n  int i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &high[i]);\n\n  for (i = 0; i < 30; i++) {\n    a[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j > i; j--) {\n      if (high[j] <= high[i]) {\n        if (a[j] + 1 > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  tmp = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] > tmp)\n      tmp = a[i];\n  }\n  cout << tmp;\n  return 0;\n}\n"}
{"label": "10", "index": "17570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, m, k;\n  cin >> n;\n  static int hight[25], num[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &hight[i]);\n  num[0] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      m = 0;\n      if (hight[j] >= hight[i]) {\n        m = num[j];\n        break;\n      }\n    }\n    if (j == -1)\n      num[i] = 1;\n    for (k = j - 1; k >= 0; k--) {\n      if (hight[k] >= hight[i]) {\n        if (num[k] > m)\n          m = num[k];\n      }\n    }\n    if (num[i] == 0)\n      num[i] = m + 1;\n  }\n  max = num[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint h[30];\nint len[30];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n\n  len[0] = 1;\n  for (int i = 1; i < n; i++) {\n    len[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && len[j] + 1 > len[i])\n        len[i] = len[j] + 1;\n    }\n  }\n  int maxi = 0;\n  for (int i = 0; i < n; i++)\n    if (len[i] > maxi)\n      maxi = len[i];\n  cout << maxi << \"\\n\";\n}\n"}
{"label": "10", "index": "17572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000], s[1000], max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    s[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && s[i] < s[j] + 1)\n        s[i] = s[j] + 1;\n  for (i = 0; i < n - 1; i++)\n    max = (max > s[i]) ? max : s[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, height[30], num[30], j, max = -1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    num[i] = 1;\n  for (i = 1; i < n; i++)\n    for (j = i - 1; j >= 0; j--) {\n      if (height[j] >= height[i] && num[j] + 1 > num[i])\n        num[i] = num[j] + 1;\n    }\n  for (i = 1; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, n_max, i;\n  int a[25];\n  scanf(\"%d\", &k);\n  int n[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    n[i] = 1;\n  }\n  for (int j = k - 2; j >= 0; j--) {\n    for (int t = j + 1; t < k; t++) {\n      if (a[t] <= a[j] && n[j] <= n[t])\n        n[j] = n[t] + 1;\n    }\n  }\n  n_max = 0;\n  for (int p = 0; p < k; p++) {\n    if (n[p] > n_max)\n      n_max = n[p];\n  }\n  printf(\"%d \", n_max);\n}\n"}
{"label": "10", "index": "17575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, dmax, a[100], d[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (d[i] <= d[j])) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax)\n      dmax = d[i];\n  }\n\n  cout << dmax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17576", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint abc(const void *elem1, const void *elem2) {\n  return *(int *)elem2 - *(int *)elem1;\n}\nint main() {\n  int n, a[2][25] = {0}, i, j, x, y;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  a[1][0] = 1;\n  for (i = 1; i < n; i++) {\n    a[1][i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[0][i] >= a[0][j] && a[1][i] <= a[1][j])\n        a[1][i] = a[1][j] + 1;\n    }\n  }\n  qsort(a[1], n, 4, abc);\n  printf(\"%d\", a[1][0]);\n}\n"}
{"label": "10", "index": "17577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[26] = {0}, q[26] = {0}, a = 0, b, c, d, e, f, g, i, j, k, l, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  q[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    b = 1;\n    for (j = i + 1; j < k; j++) {\n      if (p[i] >= p[j]) {\n        if (q[j] + 1 > b)\n          b = q[j] + 1;\n      }\n    }\n    q[i] = b;\n  }\n  for (i = 0; i < k; i++) {\n    if (a < q[i])\n      a = q[i];\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "10", "index": "17578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, h[25];\n  int len[25];\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  len[0] = 1;\n  int ans = 1;\n  for (i = 1; i < k; i++) {\n\n    int temp = -1, tIndex = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (len[j] > temp) {\n          temp = len[j];\n          tIndex = j;\n        }\n      }\n    }\n    if (temp == -1)\n      len[i] = 1;\n    else\n      len[i] = len[tIndex] + 1;\n    if (len[i] > ans)\n      ans = len[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1[30], hgt[30], n, i, j, max_1, temp;\nvoid m(int s, int t);\nint main() {\n  for (i = 1; i <= 25; i++) {\n    count_1[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &hgt[i]);\n    count_1[1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (hgt[i] <= hgt[j]) {\n        if (temp < count_1[j])\n          temp = count_1[j];\n      }\n    }\n    count_1[i] = temp + 1;\n  }\n  max_1 = 0;\n  for (i = 1; i <= n; i++) {\n    if (max_1 < count_1[i]) {\n      max_1 = count_1[i];\n    }\n  }\n  printf(\"%d \", max_1);\n  return 0;\n}\n"}
{"label": "10", "index": "17580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int arr[103], brr[103];\n  int i, j, k, max;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> arr[i];\n  for (i = 1; i <= n; i++)\n    brr[i] = 0;\n  max = 0;\n  for (i = n; i >= 1; i--) {\n    k = 0;\n    for (j = n; j > i; j--) {\n      if ((arr[j] <= arr[i]) && (brr[j] > k))\n        k = brr[j];\n    }\n    brr[i] = k + 1;\n    if (brr[i] > max)\n      max = brr[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int n, int high) {\n  int c, b;\n  if (n == 0) {\n    if (a[0] > high)\n      return 0;\n    else {\n      return 1;\n    }\n  } else if (a[n] > high)\n    return max(a, n - 1, high);\n  else {\n    c = max(a, n - 1, a[n]) + 1;\n    b = max(a, n - 1, high);\n    if (c > b)\n      return c;\n    else\n      return b;\n  }\n}\nint main() {\n  int n, i;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[n - i - 1]);\n  cout << max(a, n, 32767);\n}\n"}
{"label": "10", "index": "17582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a[26], r[26];\n  scanf(\"%d \", &k);\n  for (int i = 0; i < 26; i++)\n    a[i] = 0;\n  for (int i = 0; i < 26; i++)\n    r[i] = 1;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (int i = 0; i < k; i++) {\n    if (i == 0)\n      r[i] = 1;\n    else {\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && r[j] >= r[i]) {\n          r[i] = r[j] + 1;\n        }\n      }\n    }\n  }\n  int s = 0;\n  for (int i = 0; i < k; i++) {\n    if (r[i] > s)\n      s = r[i];\n  }\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a[], int k, int m) {\n  int ans = 1, tag = 1, i;\n  if (m < k - 1)\n    for (i = m + 1; i < k; i++)\n      if (a[i] <= a[m] && tag <= f(a, k, i)) {\n        ans = 1 + f(a, k, i);\n        tag = f(a, k, i);\n      }\n  return ans;\n}\nint main() {\n  int a[25], k, i, max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  max = f(a, k, 0);\n  for (i = 1; i < k; i++)\n    if (f(a, k, i) > max)\n      max = f(a, k, i);\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a < b)\n    return b;\n  else\n    return a;\n}\nint main() {\n  int num;\n  int h[100];\n  cin >> num;\n  int i, j, k;\n  for (i = 0; i < num; i++)\n    cin >> h[i];\n  int f[100] = {0};\n  f[0] = 1;\n  for (i = 1; i < num; i++) {\n    f[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j])\n        f[i] = max(f[i], f[j] + 1);\n    }\n  }\n  int result = f[0];\n  for (i = 1; i < num; i++) {\n    result = max(f[i], result);\n  }\n  cout << result << endl;\n}\n"}
{"label": "10", "index": "17585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, max = 0, maxb = 0;\n  scanf(\"%d \", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)calloc(n, sizeof(int));\n\n  for (i = (n - 1); i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n\n  for (i = 1; i <= (n - 1); i++) {\n    max = 0;\n\n    for (j = 0; j <= (i - 1); j++) {\n      if (a[i] >= a[j] && b[j] > max) {\n\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n\n  for (i = 1; i <= (n - 1); i++) {\n    if (b[i] > maxb)\n      maxb = b[i];\n  }\n  cout << maxb;\n}\n"}
{"label": "10", "index": "17586", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, n[25], h[25];\n\nint main() {\n  scanf(\"%d \", &k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  memset(n, sizeof(n), 0);\n  int tem = 0;\n  for (i = 0; i < k; i++) {\n    tem = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (n[j] > tem)\n          tem = n[j];\n      }\n    }\n    n[i] = 1 + tem;\n  }\n  tem = 0;\n  for (i = 0; i < k; i++) {\n    if (n[i] > tem)\n      tem = n[i];\n  }\n  cout << tem << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max_1 = 0, n = 0;\nint a[30], line = 0, f[30] = {0}, b[30] = {0};\nint main() {\n  int k, i, n = 0;\n\n  void missile(int i, int k);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    if (line < a[i])\n      line = a[i];\n  }\n  missile(0, k);\n  printf(\"%d\", max_1);\n}\nvoid missile(int i, int k) {\n  int j;\n  for (j = 0; j < 2; j++) {\n    if (j == 0 && i != k - 1) {\n      missile(i + 1, k);\n    } else {\n      if (a[i] <= line || i == k - 1) {\n        if (a[i] <= line) {\n          b[i] = line;\n          line = a[i];\n          n++;\n          f[i] = 1;\n        }\n        if (i == k - 1) {\n          if (max_1 < n)\n            max_1 = n;\n          printf(\" \");\n        } else\n          missile(i + 1, k);\n        if (f[i] == 1) {\n          n--;\n          line = b[i];\n          f[i] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "17588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint com(void const *a, void const *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int k, H;\n  int j, count[25], n;\n  scanf(\"%d\", &k);\n  int h[25], i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  count[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    n = 0;\n    for (j = k - 1; j >= i + 1; j--) {\n      if (h[j] <= h[i]) {\n        if (count[j] >= n) {\n          n = count[j];\n        }\n      }\n    }\n    count[i] = n + 1;\n  }\n\n  qsort(count, k, sizeof(int), com);\n  printf(\"%d\", count[k - 1]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17589", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 1;\n  int a[25];\n  int b[25];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, k;\n  cin >> a;\n  int b[a], c[a], d[25];\n  for (i = 0; i <= a - 1; i++)\n    cin >> b[a - 1 - i];\n  c[0] = 1;\n  for (i = 1; i <= a - 1; i++) {\n    for (k = 0; k <= 24; k++)\n      d[k] = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[i] >= b[j])\n        d[j] = c[j] + 1;\n      if (b[i] < b[j] && j == 0)\n        d[j] = 1;\n    }\n    for (k = 0; k <= 23; k++)\n      if (d[k] > d[k + 1]) {\n        int n = d[k];\n        d[k] = d[k + 1];\n        d[k + 1] = n;\n      }\n    c[i] = d[24];\n  }\n  for (i = 0; i <= a - 2; i++)\n    if (c[i] > c[i + 1]) {\n      int n = c[i];\n      c[i] = c[i + 1];\n      c[i + 1] = n;\n    }\n  printf(\"%d\", c[a - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "17591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar f(int max, int a[], char m, char n) {\n  char num1, num2;\n  if (m == n && a[n - 1] <= max)\n    return (1);\n  else if (m == n && a[n - 1] > max)\n    return (0);\n  else {\n    if (a[m - 1] <= max) {\n      num1 = f(max, a, m + 1, n);\n      num2 = f(a[m - 1], a, m + 1, n) + 1;\n      if (num1 > num2)\n        return (num1);\n      else\n        return (num2);\n    } else\n      return (f(max, a, m + 1, n));\n  }\n}\n\nint main() {\n  int hmax = (unsigned)(~0) >> 1;\n  int h[1000];\n  char n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  cout << f(hmax, h, 1, n) << \" \";\n  printf(\"input: \");\n  for (i = 0; i < n; i++)\n    printf(\"%d,\", h[i]);\n}\n"}
{"label": "10", "index": "17592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint num = 0;\nint input[26];\nint state[26];\nint main() {\n  int n;\n  int i, j;\n  cin >> n;\n  for (i = 1; i < n; i++)\n    state[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &input[i]);\n  state[0] = 1;\n  for (j = 1; j < n; j++) {\n    int min = 1;\n    for (i = 0; i < j; i++) {\n      if (input[i] >= input[j]) {\n        if (state[i] + 1 > min)\n          min = state[i] + 1;\n      }\n    }\n    state[j] = min;\n  }\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    if (state[i] > sum)\n      sum = state[i];\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "10", "index": "17593", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000], s[1000], max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    s[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && s[i] < s[j] + 1)\n        s[i] = s[j] + 1;\n  for (i = 0; i < n - 1; i++)\n    max = (max > s[i]) ? max : s[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17594", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, ans;\n  int a[100], f[100];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  ans = 1;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((a[j] >= a[i]) && (f[j] + 1 > f[i]))\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n\n  printf(\"%d\", ans);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17595", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, final;\n  int tomb[26];\n  int num[26];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> tomb[i];\n  memset(num, 0, sizeof(num));\n  num[n - 1] = 1;\n  final = 0;\n  for (i = n - 2; i >= 0; i--) {\n    j = i + 1;\n    max = 0;\n    while (j < n) {\n      if (tomb[j] <= tomb[i] && num[j] > max)\n        max = num[j];\n      j++;\n    }\n    num[i] = max + 1;\n    if (num[i] > final)\n      final = num[i];\n  }\n  cout << final << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[100] = {0};\n  int f[100] = {0};\n  a[0] = 100000;\n  scanf(\"%d \", &k);\n  int i, j;\n  int max = 0;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[i] < f[j] + 1) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n_max, i;\n  int a[25];\n  scanf(\"%d\", &k);\n  int n[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    n[i] = 1;\n  }\n  for (int j = k - 2; j >= 0; j--) {\n    for (int t = j + 1; t < k; t++) {\n      if (a[t] <= a[j] && n[j] <= n[t])\n        n[j] = n[t] + 1;\n    }\n  }\n  n_max = 0;\n  for (int p = 0; p < k; p++) {\n    if (n[p] > n_max)\n      n_max = n[p];\n  }\n  cout << n_max << \" \";\n}\n"}
{"label": "10", "index": "17598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], i, j, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    k = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j] && b[j] > k) {\n        k = b[j];\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  k = b[0];\n  for (i = 0; i < n; i++) {\n    if (b[i] > k)\n      k = b[i];\n  }\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    for (j = 0; j <= i; j++) {\n      if (b[i] <= b[j] && a[i] <= a[j]) {\n        a[i] = a[j];\n      }\n    }\n    a[i]++;\n    if (s < a[i]) {\n      s = a[i];\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "17600", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint result[40];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nvoid f(int a[], int n) {\n\n  int i, j, maxmium;\n  result[1] = 1;\n  for (i = 2; i <= n; i++) {\n    maxmium = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        maxmium = max(result[j], maxmium);\n      }\n    }\n    result[i] = 1 + maxmium;\n  }\n}\n\nint main() {\n  int n, i, outcome = 0;\n  scanf(\"%d\", &n);\n  int a[40];\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  f(a, n);\n  for (i = 1; i <= n; i++)\n    outcome = max(outcome, result[i]);\n  printf(\"%d \", outcome);\n  return 0;\n}\n"}
{"label": "10", "index": "17601", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int height[50], flag[50], max, i, j;\n  int num;\n\n  cin >> num;\n\n  for (i = 0; i < num; i++) {\n    cin >> height[i];\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (height[j] >= height[i]) {\n        if (flag[j] + 1 > flag[i])\n          flag[i] = flag[j] + 1;\n      }\n    }\n  }\n\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int *h = (int *)malloc((N + 1) * sizeof(int));\n  for (int i = 1; i <= N; i++)\n    scanf(\"%d\", &h[i]);\n  int *f = (int *)malloc((N + 1) * sizeof(int));\n  f[1] = 1;\n  for (int i = 2; i <= N; i++) {\n    int tem = 0;\n    for (int j = 1; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (f[j] > tem)\n          tem = f[j];\n      }\n    }\n    f[i] = tem + 1;\n  }\n  int max = -1;\n  for (int i = 1; i <= N; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dert(int, int);\nint main() {\n  int k, missile[25], i, result, donemax[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  donemax[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    int max = dert(missile[i], missile[i + 1]) * donemax[i + 1], j;\n    for (j = 1; j < k - i; j++)\n      if (max < dert(missile[i], missile[i + j]) * donemax[i + j])\n        max = dert(missile[i], missile[i + j]) * donemax[i + j];\n    donemax[i] = max + 1;\n  }\n  result = donemax[k - 1];\n  for (i = k - 2; i >= 0; i--) {\n\n    if (donemax[i] > result)\n      result = donemax[i];\n  }\n  printf(\"%d\\n\", result);\n}\nint dert(int x, int y) {\n  int z;\n  if (x >= y)\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\n"}
{"label": "10", "index": "17604", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100], b[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (int i = n - 1; i > 0; i--) {\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && b[j] < b[i] + 1)\n        b[j] = b[i] + 1;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  printf(\"%d\\n\", b[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "17605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25] = {0}, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (j = n - i; j <= n - 1; j++) {\n      if (a[n - 1 - i] >= a[j]) {\n        if (b[n - i - 1] < b[j] + 1)\n          b[n - i - 1] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstatic int c[25];\nint max(int a, int b) {\n  if (a >= b)\n    return (a);\n  else\n    return (b);\n}\nint f(int mx, int st) {\n  for (; st < n; st++)\n    if (c[st] <= mx)\n      return (max(f(c[st], st + 1) + 1, f(mx, st + 1)));\n  return 0;\n}\nint main() {\n  int i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &c[i]);\n  s = f(4000, 0);\n  printf(\"%d\", s);\n}\n"}
{"label": "10", "index": "17607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k, height[25];\nint route(int m) {\n  int i, a = 0, max = 0;\n  for (i = m + 1; i < k; i++)\n    if (height[i] <= height[m])\n      a += 1;\n  if (a == 0)\n    return 1;\n  else {\n    for (i = m + 1; i < k; i++)\n      if (height[i] <= height[m] && route(i) > max)\n        max = route(i);\n    return (max + 1);\n  }\n}\nint main() {\n  int i, ans[25], a = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> height[i];\n  for (i = 0; i < k; i++)\n    ans[i] = route(i);\n  for (i = 0; i < k; i++)\n    if (ans[i] > a)\n      a = ans[i];\n  cout << a << \"\\n\";\n}\n"}
{"label": "10", "index": "17608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, h[25] = {0}, n[25] = {1}, num;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (h[i] >= h[j] && n[i] < n[j] + 1)\n        n[i] = n[j] + 1;\n    }\n  }\n  num = n[0];\n  for (i = 0; i < k; i++) {\n    if (num < n[i])\n      num = n[i];\n  }\n  cout << num + 1;\n}\n"}
{"label": "10", "index": "17609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k, a[26] = {0}, b[26] = {0}, max_1 = 0;\n\nvoid num(int site, int height) {\n  int i, amount = 0, h;\n  if (site == k) {\n    for (i = 0; i < k; i++) {\n      if (b[i] == 1) {\n        amount++;\n      }\n    }\n    if (max_1 < amount) {\n      max_1 = amount;\n    }\n\n  } else {\n    if (height < a[site]) {\n      num(site = site + 1, height);\n      site--;\n    } else {\n      num(site = site + 1, height);\n      site--;\n      b[site] = 1;\n      h = height;\n      height = a[site];\n      num(site = site + 1, height);\n      site--;\n      b[site] = 0;\n      height = h;\n    }\n  }\n}\n\nint main() {\n  int i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  num(0, 30000);\n  printf(\"%d\", max_1);\n  return 0;\n}\n"}
{"label": "10", "index": "17610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint missle[25];\nint n;\nint Intercept(int i, int j) {\n  int k, max = 1, sum = 1;\n  for (k = i + 1; k < j; k++) {\n    if (missle[k] <= missle[i] && missle[k] >= missle[j])\n      sum = Intercept(k, j) + 1;\n    else\n      continue;\n    if (sum > max)\n      max = sum;\n    sum = 1;\n  }\n  return max;\n}\nint main() {\n  int i, j, max = 1, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &missle[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (missle[j] <= missle[i]) {\n        sum = Intercept(i, j) + 1;\n      } else\n        continue;\n      if (sum > max)\n        max = sum;\n      sum = 0;\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17611", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int k, j, i, a[26] = {0}, length[26] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  length[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    length[i] = 1;\n    for (j = 0; j < i; j++) {\n\n      if (a[i] <= a[j] && length[i] < length[j] + 1)\n        length[i] = length[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    if (length[i] > max)\n      max = length[i];\n  }\n\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sta[20002];\nint mycmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint main() {\n  int input[30] = {0};\n  int cnt[30] = {0};\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &input[i]);\n  cnt[0] = 1;\n  for (i = 1; i < n; i++) {\n    int max = 0;\n    for (int k = i - 1; k >= 0; k--) {\n      if (cnt[k] > max && input[k] >= input[i])\n        max = cnt[k];\n    }\n    cnt[i] = max + 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    if (m < cnt[i])\n      m = cnt[i];\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17613", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], i, j, k, n = 25, m = 0, t, d[26], f[26];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    d[i] = 1;\n    f[i] = 1;\n  }\n  for (i = n - 1; i > 0; i--)\n    for (k = i + 1; k <= n; k++) {\n      if (a[i] >= a[k]) {\n        for (j = i + 1; j < n; j++)\n          if (a[i] >= a[j] && d[j] > f[k])\n            f[k] = d[j];\n        d[i] = d[i] + f[k];\n        break;\n      }\n    }\n  for (i = n; i > 0; i--) {\n    if (d[i] > m)\n      m = d[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, max = 0;\n  int m[25];\n  int n[25];\n  scanf(\"%d \", &k);\n\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n\n  for (i = 0; i < k; i++)\n    n[i] = 0;\n  n[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (m[i] >= m[j]) {\n        if (n[i] <= n[j]) {\n          n[i] = n[j] + 1;\n        }\n        t++;\n      }\n    }\n    if (t == 0)\n      n[i] = 1;\n    t = 0;\n  }\n  for (i = 0; i < k; i++) {\n    if (n[i] > max)\n      max = n[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17615", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int height[27];\n  int result[27];\n  int k;\n  int i, j;\n  int nmax;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> height[i];\n  }\n  height[k + 1] = 0;\n  result[k + 1] = 0;\n  for (i = k; i > 0; i--) {\n    nmax = 0;\n    for (j = i + 1; j <= k + 1; j++) {\n      if (height[i] >= height[j]) {\n        if (result[j] > nmax) {\n          nmax = result[j];\n        }\n      }\n    }\n    result[i] = nmax + 1;\n  }\n  nmax = 0;\n  for (i = 1; i < k; i++) {\n    if (result[i] > nmax) {\n      nmax = result[i];\n    }\n  }\n  printf(\"%d\\n\", nmax);\n  return 0;\n}\n"}
{"label": "10", "index": "17616", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], max[25] = {0}, max1 = 0;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    max[i] = 1;\n  max1 = 1;\n  for (i = 1; i <= n - 1; i++)\n    for (j = 0; j <= i - 1; j++) {\n      if ((a[j] >= a[i]) && (max[j] + 1 > max[i]))\n        max[i] = max[j] + 1;\n      if (max[i] > max1)\n        max1 = max[i];\n    }\n  printf(\"%d\\n\", max1);\n  return 0;\n}\n"}
{"label": "10", "index": "17617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num = 0;\nint input[26];\nint state[26];\nint main() {\n  int n;\n  int i, j;\n  cin >> n;\n  for (i = 1; i < n; i++)\n    state[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &input[i]);\n  state[0] = 1;\n  for (j = 1; j < n; j++) {\n    int min = 1;\n    for (i = 0; i < j; i++) {\n      if (input[i] >= input[j]) {\n        if (state[i] + 1 > min)\n          min = state[i] + 1;\n      }\n    }\n    state[j] = min;\n  }\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    if (state[i] > sum)\n      sum = state[i];\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1[30], hgt[30], n, i, j, max_1, temp;\nvoid m(int s, int t);\nint main() {\n  for (i = 1; i <= 25; i++) {\n    count_1[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &hgt[i]);\n    count_1[1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (hgt[i] <= hgt[j]) {\n        if (temp < count_1[j]) {\n          temp = count_1[j];\n        }\n      }\n    }\n    count_1[i] = temp + 1;\n  }\n  max_1 = 0;\n  for (i = 1; i <= n; i++) {\n    if (max_1 < count_1[i]) {\n      max_1 = count_1[i];\n    }\n  }\n  printf(\"%d \", max_1);\n}\n"}
{"label": "10", "index": "17619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, max, n;\n  scanf(\"%d\", &n);\n  int h[25], m[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &h[i]);\n  m[n - 1] = 1;\n  max = m[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    m[i] = 1;\n    for (k = i + 1; k <= n - 1; k++)\n      if ((h[i] >= h[k]) && (m[i] < 1 + m[k]))\n        m[i] = m[k] + 1;\n    if (m[i] > max)\n      max = m[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[i] <= b[j]))\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  cout << m << \"\\n\";\n}\n"}
{"label": "10", "index": "17621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  int z;\n  if (x >= y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint MAX_multi(int str[25], int n) {\n  int t = 0, i;\n  for (i = 0; i < n; i++) {\n    t = max(t, str[i]);\n  }\n  return (t);\n}\n\nvoid count(int str[25], int num[25], int n) {\n  int i, j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > i; j--) {\n      if (str[i] >= str[j])\n        num[i] = max(num[i], num[j] + 1);\n    }\n  }\n  printf(\"%d\\n\", MAX_multi(num, n));\n}\n\nint main() {\n  int n, i, str[25], num[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  count(str, num, n);\n  return 0;\n}\n"}
{"label": "10", "index": "17622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 100;\nint a[maxn], n, f[maxn], ans;\nvoid init() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid solve() {\n  ans = 0;\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n    if (f[i] > ans) {\n      ans = f[i];\n    }\n  }\n}\nint main() {\n  init();\n  solve();\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint compare(int x, int y) {\n  if (x <= y) {\n    x = (y + 1);\n  }\n  return x;\n}\n\nint main(void) {\n\n  int i, n, r, a, j;\n  cin >> n;\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i != n; i++)\n    cin >> p[i];\n\n  int *q = (int *)malloc(n * sizeof(int));\n  for (j = 0; j != n; j++) {\n    q[j] = 1;\n    for (r = 0; r != j; r++) {\n      if (p[j] <= p[r]) {\n        q[j] = compare(q[j], q[r]);\n      }\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 0; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17624", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, h[27] = {100000000}, lj[27][27] = {0};\n  int i, j, k, max;\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++)\n    scanf(\"%d \", &h[i]);\n  for (i = num; i >= 0; i--) {\n    for (j = num; j > i; j--) {\n      if (h[i] >= h[j]) {\n        max = 0;\n        for (k = j; k <= num; k++)\n          max = (max > lj[i][k]) ? max : lj[i][k];\n        for (k = j; k <= num; k++)\n          if (h[j] >= h[k])\n            max = (max > lj[j][k] + 1) ? max : lj[j][k] + 1;\n        lj[i][j] = max;\n      }\n    }\n  }\n  printf(\"%d\\n\", lj[0][1]);\n}\n"}
{"label": "10", "index": "17625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num = 0, k = 0, n, i, j, a[50], max = 0, f[50] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] <= a[j] && f[i] < f[j]) {\n        f[i] = f[j];\n      }\n    }\n    f[i]++;\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = (b[i]);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int i, j, temp = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int max[25];\n  for (i = 0; i < k; i++)\n    max[i] = 1;\n\n  for (i = k - 2; i >= 0; i--) {\n\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        temp = max[j] + 1;\n      if (temp > max[i])\n        max[i] = temp;\n    }\n  }\n  int nmax = 0;\n  for (i = 0; i < k; i++) {\n    if (max[i] > nmax)\n      nmax = max[i];\n  }\n  cout << nmax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m = 0, n, max = 0;\n  int a[25], t[25] = {0}, s[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  t[k - 1] = 1;\n  if (k == 1)\n    printf(\"1\\n\");\n  else {\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j < k; j++) {\n        if (a[j] <= a[i]) {\n          s[m] = t[j];\n          m++;\n        }\n      }\n      m = 0;\n      max = s[0];\n      for (n = 1; n < 25; n++) {\n        if (s[n] > max)\n          max = s[n];\n      }\n      for (j = 0; j < 25; j++)\n        s[j] = 0;\n      t[i] = max + 1;\n    }\n\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (t[i] > max)\n        max = t[i];\n    }\n    printf(\"%d\\n\", max);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int n, int high) {\n  int c, b;\n  if (n == 0) {\n    if (a[0] > high)\n      return 0;\n    else\n      return 1;\n  } else if (a[n] > high)\n    return max(a, n - 1, high);\n  else {\n    c = max(a, n - 1, a[n]) + 1;\n    b = max(a, n - 1, high);\n    if (c > b)\n      return c;\n    else\n      return b;\n  }\n}\nint main() {\n  int n, i;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[n - i - 1]);\n  printf(\"%d\", max(a, n, 32767));\n}\n"}
{"label": "10", "index": "17630", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint Max(int n, int a[]) {\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    if (x < a[i])\n      x = a[i];\n  }\n  return x;\n}\nint main() {\n  int x, n, i, j;\n  int *p;\n  int *q;\n  cin >> n;\n  p = (int *)malloc(n * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = n - 1; i >= 0; i--) {\n\n    {\n      x = 0;\n      for (j = i + 1; j < n; j++) {\n        if ((p[i] >= p[j]) && (x < q[j]))\n          x = q[j];\n      }\n      q[i] = x + 1;\n    }\n  }\n  printf(\"%d\", Max(n, q));\n}\n"}
{"label": "10", "index": "17631", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j, h[25], dp[25];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  for (i = 0; i < k; i++)\n    dp[i] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i])\n        dp[i] = max(dp[i], dp[j] + 1);\n  int m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, dp[i]);\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "17632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x[30], f[30], temp, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &x[i]);\n  f[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      temp = 0;\n      if (x[i] <= x[j])\n        temp = f[j] + 1;\n      if (temp > max)\n        max = temp;\n    }\n    f[i] = max;\n  }\n  max = 1;\n  for (i = 0; i < k; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int i, j, k, m, n, res = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int b[n], tem = 0;\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    tem = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        tem = max(tem, b[j]);\n      else\n        continue;\n    }\n    b[i] = tem + 1;\n  }\n  for (i = 0; i < n; i++)\n    res = max(res, b[i]);\n  cout << res;\n}\n"}
{"label": "10", "index": "17634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[i] <= b[j]))\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "17635", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dp[100];\nint main(void) {\n  int i, j, k;\n  int *h;\n  int max;\n  scanf(\"%d \", &k);\n  h = (int *)malloc((k + 1) * sizeof(int));\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  dp[k] = 0;\n  for (i = k - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k; j++) {\n      if (h[i] >= h[j]) {\n        if (dp[j] + 1 > max)\n          max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  int m = 0;\n  for (i = 0; i <= k; i++) {\n    if (dp[i] > m)\n      m = dp[i];\n  }\n  printf(\"%d\", m + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k[25], a[25];\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &k[i]);\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j <= n - 1; j++)\n      if ((k[j] <= k[i]) && (a[i] <= a[j]))\n        a[i] = a[j] + 1;\n  for (max = 0, i = 0; i < n; i++)\n    if (a[i] >= max)\n      max = a[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k[26][2];\nint main() {\n  int i, j, n, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k[i][1]);\n    k[i][0] = 1;\n    for (j = 0; j < i; j++) {\n      if (k[j][1] >= k[i][1] && k[j][0] + 1 > k[i][0])\n        k[i][0] = k[j][0] + 1;\n    }\n    if (k[i][0] > m)\n      m = k[i][0];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int k;\n  scanf(\"%d\", &k);\n  int a[k], b[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int d;\n  for (i = k - 2; i >= 0; i--) {\n    d = 0;\n    b[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        if (d < b[j])\n          d = b[j];\n    }\n    b[i] = 1 + d;\n  }\n  for (i = 0; i < k; i++)\n    if (d < b[i])\n      d = b[i];\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "10", "index": "17639", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int max = 0;\n  int maxall = 1;\n  int num[10000];\n  int hight[10000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> hight[i];\n    num[i] = 0;\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (hight[j] >= hight[i] && max < num[j] + 1)\n        max = num[j] + 1;\n    }\n    num[i] = max;\n    if (num[i] > maxall)\n      maxall = num[i];\n  }\n  cout << maxall << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bomb[25], k, antibomb[25], j = 0, answer[2] = {0, 0};\nvoid makeanti(int a[]);\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &bomb[i]);\n  makeanti(bomb);\n  printf(\"%d\", answer[0]);\n  getchar();\n  getchar();\n}\nvoid makeanti(int bomb[]) {\n  int i, l, r = 0, aa;\n  if (k == 0) {\n    answer[1] = j;\n    answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n  } else\n    for (i = 0; i < k; i++) {\n      if (j == 0)\n        antibomb[j++] = bomb[i];\n      else if (bomb[i] <= antibomb[j - 1]) {\n        antibomb[j++] = bomb[i];\n        r = 1;\n      } else if (r == 0 && i == k - 1) {\n        answer[1] = j;\n        answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n        continue;\n      } else\n        continue;\n      k -= (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb++;\n      makeanti(bomb);\n      j--;\n      k += (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb--;\n    }\n}\n"}
{"label": "10", "index": "17641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[25], i, j, a[25], n, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    s[i] = 1;\n    max = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && s[j] > max)\n        max = s[j];\n    s[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (max < s[i])\n      max = s[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m[100] = {0};\n  int min = 0;\n  int ans[100] = {0};\n  int k = 0;\n  cin >> k;\n  for (int i = 0; i <= k - 1; i++) {\n    cin >> m[i];\n  }\n  ans[0] = 1;\n  int temp = 0;\n  for (int i = 1; i <= k - 1; i++) {\n    temp = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (m[j] >= m[i]) {\n        if (temp < ans[j])\n          temp = ans[j];\n      }\n    }\n    ans[i] = temp + 1;\n  }\n  int max = 0;\n  for (int i = 0; i <= k - 1; i++) {\n    if (max < ans[i])\n      max = ans[i];\n  }\n  cout << max << endl;\n}\n"}
{"label": "10", "index": "17643", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, j, h[1000], a[1000], n = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  a[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    a[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (h[j] < h[i] || h[j] == h[i]) {\n        if ((a[j] + 1) > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (a[i] > n)\n      n = a[i];\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "17644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nstatic int c[25];\nint max(int a, int b) {\n  if (a >= b)\n    return (a);\n  else\n    return (b);\n}\nint f(int mx, int st) {\n  for (; st < n; st++)\n    if (c[st] <= mx)\n      return (max(f(c[st], st + 1) + 1, f(mx, st + 1)));\n  return 0;\n}\nint main() {\n  int i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &c[i]);\n  s = f(4000, 0);\n  printf(\"%d\", s);\n}\n"}
{"label": "10", "index": "17645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j, x, y, max;\n  scanf(\"%d\", &n);\n  int a[26], b[26];\n  for (i = n - 1; i >= 0; i--)\n    cin >> a[i];\n  b[0] = 1;\n  i = 0;\n  while (i <= n - 1) {\n    j = 0;\n    x = 0;\n    while (j < i) {\n      if (a[j] <= a[i]) {\n        if (b[j] >= x)\n          x = b[j];\n      }\n      j++;\n    }\n    b[i] = x + 1;\n    i++;\n  }\n  max = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] >= max)\n      max = b[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n    }\n    b[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max, f[26], g[26];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &g[i]);\n    f[i] = 0;\n  }\n  f[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    max = 0;\n    for (j = i + 1; j <= n; j++)\n      if ((g[j] <= g[i]) && (f[j] > max))\n        max = f[j];\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > max)\n      max = f[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17648", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, h[30], l[30], r[30];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 1;\n    r[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && (l[j] + 1) > l[i]) {\n        l[i] = l[j] + 1;\n      }\n    }\n  }\n  for (i = k - 2; i > 0; i--) {\n    for (int j = k - 1; j > i; j--) {\n      if (h[j] <= h[i] && (r[j] + 1) > r[i]) {\n        r[i] = r[j] + 1;\n      }\n    }\n  }\n  int m = 0;\n  for (i = 0; i < k; i++) {\n    if (l[i] + r[i] - 1 > m) {\n      m = l[i] + r[i] - 1;\n    }\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, t, max = 0, a[26] = {0}, b[26] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  max = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint solve(int k, int h, int *p, int n) {\n  if (k == n)\n    return 0;\n  if (p[k] == h)\n    return 1 + solve(k + 1, h, p, n);\n  if (p[k] > h)\n    return solve(k + 1, h, p, n);\n  return max(solve(k + 1, h, p, n), 1 + solve(k + 1, p[k], p, n));\n}\nint main() {\n  int n;\n  int p[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n\n  cout << solve(0, 100000, p, n);\n  return 0;\n}\n"}
{"label": "10", "index": "17651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, h[25], a[25][25] = {0};\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  int max = 1;\n  for (int i = 0; i < k; i++)\n    a[i][i] = 1;\n  for (int i = 0; i < k - 1; i++)\n    for (int j = i + 1; j < k; j++) {\n      a[i][j] = 1;\n      for (int k = i; k < j; k++)\n        if (h[k] >= h[j] && a[i][k] + 1 > a[i][j])\n          a[i][j] = a[i][k] + 1;\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, max = 0;\n  cin >> n;\n  int d[100];\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n  int w[100];\n  for (i = 0; i < n; i++)\n    w[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++)\n      if (d[i] >= d[j] && w[i] <= w[j])\n        w[i] = w[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (w[i] >= max)\n      max = w[i];\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, j, k, n, m, a[100], f[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  f[n] = 1;\n  max = 1;\n  for (i = n - 1; i >= 1; i--) {\n    k = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] <= a[i])\n        k = (f[j] > k) ? f[j] : k;\n    }\n    k++;\n    f[i] = k;\n    max = (max > f[i]) ? max : f[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[26], n, maxnum[26], temp[26];\n  scanf(\"%d\", &n);\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &high[i]);\n  maxnum[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int len = 0;\n    for (j = i + 1; j < n; j++) {\n      if (high[i] >= high[j]) {\n        temp[len++] = 1 + maxnum[j];\n      }\n    }\n    int mark1 = 1;\n    for (k = 0; k < len; k++) {\n      if (temp[k] >= mark1)\n        mark1 = temp[k];\n    }\n    maxnum[i] = mark1;\n  }\n  int mark2 = 0;\n  for (i = 0; i < n; i++) {\n    if (maxnum[i] >= mark2)\n      mark2 = maxnum[i];\n  }\n  cout << mark2;\n  return 0;\n}\n"}
{"label": "10", "index": "17655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[30] = {0};\n  int m[30] = {0};\n  cin >> k;\n  scanf(\"%d \", &a[0]);\n  m[0] = 1;\n  int temp = 1;\n  for (int i = 1; i < k; i++) {\n    cin >> a[i];\n    int tempmax = 0;\n    for (int j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && m[j] > tempmax)\n        tempmax = m[j];\n    m[i] = tempmax + 1;\n    if (m[i] > temp)\n      temp = m[i];\n  }\n  printf(\"%d\\n\", temp);\n  return 0;\n}\n"}
{"label": "10", "index": "17656", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k, i, j, n = 0, t;\nint a[25], b[25];\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        t = b[j] + 1;\n        if (t > b[i])\n          b[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (b[i] > n)\n      n = b[i];\n  printf(\"%d\", n + 1);\n}\n"}
{"label": "10", "index": "17657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000], n, f[999][999];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint daodan(int s, int h) {\n  if (s == n)\n    return 0;\n  if (h >= a[s])\n    return max(daodan(s + 1, a[s]) + 1, daodan(s + 1, h));\n  else\n    return daodan(s + 1, h);\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << daodan(0, 31999);\n  return 0;\n}\n"}
{"label": "10", "index": "17658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0, max = 0;\n  scanf(\"%d\", &k);\n  int *h = (int *)malloc(k * sizeof(int));\n  int *p = (int *)malloc(k * sizeof(int));\n  for (int i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  p[k - 1] = 1;\n  for (int i = 0; i < k - 1; i++) {\n    for (int j = 1; k - 2 - i + j <= k - 1; j++) {\n      if (h[k - 2 - i] >= h[k - 2 - i + j]) {\n        if (max <= p[k - 2 - i + j])\n          max = p[k - 2 - i + j];\n      }\n    }\n    p[k - 2 - i] = max + 1;\n    max = 0;\n  }\n  max = p[0];\n  for (int i = 0; i < k; i++)\n    if (max < p[i])\n      max = p[i];\n  printf(\"%d\", max);\n  free(h);\n  free(p);\n}\n"}
{"label": "10", "index": "17659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i[26], a[26], b[26], x = 0;\n  cin >> k;\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    b[i[0]] = 0;\n  for (i[0] = 0; i[0] < k; i[0]++)\n    scanf(\"%d\", &a[i[0]]);\n  for (i[0] = 0; i[0] < k; i[0]++) {\n    b[0] = a[i[0]];\n    for (i[1] = i[0] + 1; i[1] <= k; i[1]++)\n      if ((b[1] = a[i[1]]) <= b[0])\n        for (i[2] = i[1] + 1; i[2] <= k; i[2]++)\n          if ((b[2] = a[i[2]]) <= b[1])\n            for (i[3] = i[2] + 1; i[3] <= k; i[3]++)\n              if ((b[3] = a[i[3]]) <= b[2])\n                for (i[4] = i[3] + 1; i[4] <= k; i[4]++)\n                  if ((b[4] = a[i[4]]) <= b[3])\n                    for (i[5] = i[4] + 1; i[5] <= k; i[5]++)\n                      if ((b[5] = a[i[5]]) <= b[4])\n                        for (i[6] = i[5] + 1; i[6] <= k; i[6]++)\n                          if ((b[6] = a[i[6]]) <= b[5])\n                            for (i[7] = i[6] + 1; i[7] <= k; i[7]++)\n                              if ((b[7] = a[i[7]]) <= b[6])\n                                for (i[8] = i[7] + 1; i[8] <= k; i[8]++)\n                                  if ((b[8] = a[i[8]]) <= b[7])\n                                    for (i[9] = i[8] + 1; i[9] <= k; i[9]++)\n                                      if ((b[9] = a[i[9]]) <= b[8])\n                                        for (i[10] = i[9] + 1; i[10] <= k;\n                                             i[10]++)\n                                          if ((b[10] = a[i[10]]) <= b[9])\n                                            for (i[11] = i[10] + 1; i[11] <= k;\n                                                 i[11]++)\n                                              if ((b[11] = a[i[11]]) <= b[10])\n                                                for (i[12] = i[11] + 1;\n                                                     i[12] <= k; i[12]++)\n                                                  if ((b[12] = a[i[12]]) <=\n                                                      b[11])\n                                                    for (i[13] = i[12] + 1;\n                                                         i[13] <= k; i[13]++)\n                                                      if ((b[13] = a[i[13]]) <=\n                                                          b[12])\n                                                        for (i[14] = i[13] + 1;\n                                                             i[14] <= k;\n                                                             i[14]++)\n                                                          if ((b[14] =\n                                                                   a[i[14]]) <=\n                                                              b[13])\n                                                            for (i[15] =\n                                                                     i[14] + 1;\n                                                                 i[15] <= k;\n                                                                 i[15]++)\n                                                              if ((b[15] = a\n                                                                       [i[15]]) <=\n                                                                  b[14])\n                                                                for (i[16] =\n                                                                         i[15] +\n                                                                         1;\n                                                                     i[16] <= k;\n                                                                     i[16]++)\n                                                                  if ((b[16] = a\n                                                                           [i[16]]) <=\n                                                                      b[15])\n                                                                    for (\n                                                                        i[17] =\n                                                                            i[16] +\n                                                                            1;\n                                                                        i[17] <=\n                                                                        k;\n                                                                        i[17]++)\n                                                                      if ((b[17] = a\n                                                                               [i[17]]) <=\n                                                                          b[16])\n                                                                        for (\n                                                                            i[18] =\n                                                                                i[17] +\n                                                                                1;\n                                                                            i[18] <=\n                                                                            k;\n                                                                            i[18]++)\n                                                                          if ((b[18] = a\n                                                                                   [i[18]]) <=\n                                                                              b[17])\n                                                                            for (\n                                                                                i[19] =\n                                                                                    i[18] +\n                                                                                    1;\n                                                                                i[19] <=\n                                                                                k;\n                                                                                i[19]++)\n                                                                              if ((b[19] = a\n                                                                                       [i[19]]) <=\n                                                                                  b[18])\n                                                                                for (\n                                                                                    i[20] =\n                                                                                        i[19] +\n                                                                                        1;\n                                                                                    i[20] <=\n                                                                                    k;\n                                                                                    i[20]++)\n                                                                                  if ((b[20] = a\n                                                                                           [i[20]]) <=\n                                                                                      b[19])\n                                                                                    for (\n                                                                                        i[21] =\n                                                                                            i[20] +\n                                                                                            1;\n                                                                                        i[21] <=\n                                                                                        k;\n                                                                                        i[21]++)\n                                                                                      if ((b[21] = a\n                                                                                               [i[21]]) <=\n                                                                                          b[20])\n                                                                                        for (\n                                                                                            i[22] =\n                                                                                                i[21] +\n                                                                                                1;\n                                                                                            i[22] <=\n                                                                                            k;\n                                                                                            i[22]++)\n                                                                                          if ((b[22] = a\n                                                                                                   [i[22]]) <=\n                                                                                              b[21])\n                                                                                            for (\n                                                                                                i[23] =\n                                                                                                    i[22] +\n                                                                                                    1;\n                                                                                                i[23] <=\n                                                                                                k;\n                                                                                                i[23]++)\n                                                                                              if ((b[23] = a\n                                                                                                       [i[23]]) <=\n                                                                                                  b[22])\n                                                                                                for (\n                                                                                                    i[24] =\n                                                                                                        i[23] +\n                                                                                                        1;\n                                                                                                    i[24] <=\n                                                                                                    k;\n                                                                                                    i[24]++)\n                                                                                                  if ((b[24] = a\n                                                                                                           [i[24]]) <=\n                                                                                                      b[23])\n                                                                                                    for (\n                                                                                                        i[25] =\n                                                                                                            i[24] +\n                                                                                                            1;\n                                                                                                        i[25] <=\n                                                                                                        k;\n                                                                                                        i[25]++)\n                                                                                                      if ((b[25] = a\n                                                                                                               [i[25]]) <=\n                                                                                                          b[24])\n                                                                                                        ;\n  }\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    if (b[i[0]] == 0) {\n      cout << i[0] - 1;\n      break;\n    }\n}\n"}
{"label": "10", "index": "17660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h[25], b[25], k, i, j, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j >= 0; j--)\n    for (m = j + 1; m < k; m++) {\n      if (h[j] >= h[m] && b[j] < (b[m] + 1))\n        b[j] = b[m] + 1;\n    }\n  for (i = 0; i < k - 1; i++)\n    b[i + 1] = (b[i] > b[i + 1]) ? b[i] : b[i + 1];\n  n = b[k - 1];\n  cout << n;\n  return 0;\n}\n"}
{"label": "10", "index": "17661", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k = 0, n, a[26] = {0};\nconst int y = 1000000;\nvoid lanjie(int i, int m, int h) {\n  if (i == n + 1) {\n    if (m > k)\n      k = m;\n    return;\n  }\n  if (m + n - i < k)\n    return;\n  if (h >= a[i])\n    lanjie(i + 1, m + 1, a[i]);\n  lanjie(i + 1, m, h);\n  return;\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  lanjie(1, 0, y);\n  printf(\"%d\\n\", k);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17662", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[30], f[30], ans;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i)\n    scanf(\"%d \", &a[i]);\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 1; j <= i; ++j)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  ans = 0;\n  for (int i = 1; i <= n; ++i)\n    if (f[i] > ans)\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n}\n"}
{"label": "10", "index": "17663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, max = 0;\n  scanf(\"%d\", &n);\n  int d[100];\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d[i]);\n  }\n  int w[100];\n  for (i = 0; i < n; i++)\n    w[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++)\n      if (d[i] >= d[j] && w[i] <= w[j])\n        w[i] = w[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (w[i] >= max)\n      max = w[i];\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max, i, j, k, n, m, a[100], f[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  f[n] = 1;\n  max = 1;\n  for (i = n - 1; i >= 1; i--) {\n    k = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] <= a[i])\n        k = (f[j] > k) ? f[j] : k;\n    }\n    k++;\n    f[i] = k;\n    max = (max > f[i]) ? max : f[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17665", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint dd(int no, float h);\nint n, a[25];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\\n\", dd(1, 10000));\n  return 0;\n}\nint dd(int no, float h) {\n  while (h < a[no - 1]) {\n    if (no == n)\n      break;\n    no++;\n  }\n  if (no == n) {\n    if (h >= a[n - 1]) {\n      return 1;\n    } else {\n      return 0;\n    }\n  } else {\n    int b = dd(no + 1, a[no - 1]);\n    int c = dd(no + 1, h);\n    if (b >= c) {\n      return b + 1;\n    } else {\n      return c;\n    }\n  }\n}\n"}
{"label": "10", "index": "17666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int d[25], f[25];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &d[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (d[j] >= d[i] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n  }\n  int ans = -1;\n  for (int i = 0; i < n; i++)\n    if (ans < f[i])\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, temp, max;\n  int a[100], ans[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    ans[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    temp = 1;\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i]) {\n        if (ans[j] + 1 > temp)\n          temp = ans[j] + 1;\n      }\n    }\n    ans[i] = temp;\n  }\n  max = 0;\n  for (i = 1; i <= k; i++) {\n    if (ans[i] > max)\n      max = ans[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  int a[25], b[25];\n  m = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (a[j] >= a[i]) {\n        if ((b[i] + 1) >= b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "17669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[30];\n  int i;\n  for (i = n - 1; i >= 0; i--)\n    cin >> a[i];\n\n  int b[30];\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1) {\n\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30] = {1};\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  printf(\"%d\", s[29] + 1);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  int n[25];\n  for (i = 0; i <= 24; i++)\n    n[i] = 1;\n  n[k - 1] = 1;\n  int j, m;\n  for (j = k - 2; j >= 0; j--) {\n    for (m = k - 1; m >= j + 1; m--) {\n\n      if (a[m] <= a[j] && n[m] >= n[j] - 1)\n        n[j] = n[m] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < n[i])\n      max = n[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint dd[25];\nint k;\nint maxnum = 0;\n\nvoid fun(int p, int num, int hight) {\n  if (p > k) {\n    if (num > maxnum)\n      maxnum = num;\n    return;\n  }\n  if (dd[p] <= hight) {\n    fun(p + 1, num + 1, dd[p]);\n    fun(p + 1, num, hight);\n  } else\n    fun(p + 1, num, hight);\n  return;\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> dd[i];\n  fun(0, 0, 65535);\n  cout << maxnum - 1 << \"\\n\";\n}\n"}
{"label": "10", "index": "17673", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, s, d, max = 0, m = 1;\n  int a[26], b[26];\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n    max = 0;\n  }\n  for (d = 1; d <= k; d++) {\n    if (b[d] >= m)\n      m = b[d];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  int z;\n  if (x >= y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint MAX_multi(int str[25], int n) {\n  int t = 0, i;\n  for (i = 0; i < n; i++) {\n    t = max(t, str[i]);\n  }\n  return (t);\n}\n\nvoid count(int str[25], int num[25], int n) {\n  int i, j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > i; j--) {\n      if (str[i] >= str[j])\n        num[i] = max(num[i], num[j] + 1);\n    }\n  }\n  printf(\"%d\\n\", MAX_multi(num, n));\n}\n\nint main() {\n  int n, i, str[25], num[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  count(str, num, n);\n}\n"}
{"label": "10", "index": "17675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[26], d[26];\n  int i, j, k;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", s + i);\n    d[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    k = 0;\n    for (j = i + 1; j < n; j++) {\n      if (k < d[j] && s[i] >= s[j])\n        k = d[j];\n    }\n    k++;\n    d[i] = k;\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > k)\n      k = d[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17676", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], i, j, k, n, m = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], b[100], i, j, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    k = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j] && b[j] > k) {\n        k = b[j];\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  k = b[0];\n  for (i = 0; i < n; i++) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n  }\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "17678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f[26] = {0};\nint b[26] = {0};\nint main() {\n  int n, i, j, tmax;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    tmax = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[j] >= b[i] && f[j] + 1 >= tmax) {\n        tmax = f[j] + 1;\n      }\n    }\n    f[i] = tmax;\n  }\n  tmax = -1;\n  for (i = 0; i < n; i++) {\n\n    if (f[i] > tmax)\n      tmax = f[i];\n  }\n\n  printf(\"%d\\n\", tmax);\n  return 0;\n}\n"}
{"label": "10", "index": "17679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int min[26];\n  int data[26];\n  int N;\n  int i, j;\n  int minLength;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &data[i]);\n  }\n  min[0] = 1;\n  for (i = 1; i < N; i++) {\n    minLength = 0;\n    for (j = 0; j < i; j++) {\n      if (data[i] <= data[j]) {\n        if (min[j] > minLength) {\n          minLength = min[j];\n        }\n      }\n    }\n    min[i] = minLength + 1;\n  }\n\n  minLength = 0;\n  for (i = 0; i < N; i++) {\n    if (min[i] > minLength) {\n      minLength = min[i];\n    }\n  }\n\n  cout << minLength << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30] = {1};\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  cout << s[29] + 1;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int i, j, k, p[25], result, a[25], b[25], sum;\n  for (i = 0; i < 25; i++)\n    a[i] = b[i] = p[i] = 0;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &p[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    sum = 0;\n    for (int m = 0; m < 25; m++)\n      a[m] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (p[j] <= p[i])\n        a[j] = b[j];\n      sum = max(sum, a[j]);\n    }\n    b[i] = sum + 1;\n  }\n  result = 0;\n  for (i = 0; i < k; i++)\n    result = max(result, b[i]);\n  cout << result;\n  return 0;\n}\n"}
{"label": "10", "index": "17682", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int s[60];\n  cin >> n;\n  int key = 1;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    s[i + 30] = 1;\n    for (int j = i - 1; j >= 0; j--) {\n      if (s[j] >= s[i]) {\n        if (s[j + 30] >= s[i + 30])\n          s[i + 30] = s[j + 30] + 1;\n      }\n    }\n    if (s[i + 30] > key)\n      key = s[i + 30];\n  }\n  cout << key;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17683", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint l, n;\nint a[30];\nvoid measure(int k, int s, int m) {\n  int i;\n  if (k == n) {\n    if (s > l)\n      l = s;\n  } else {\n    for (i = k + 1; i <= n; i++)\n      if (a[i - 1] <= m) {\n        measure(i, s + 1, a[i - 1]);\n      }\n    measure(n, s, m);\n  }\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  measure(0, 0, 10000);\n  printf(\"%d\\n\", l);\n}\n"}
{"label": "10", "index": "17684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int i, j, N, anNum[1000], anFlag[1000];\n  cin >> N;\n  memset(anFlag, 1, sizeof(anFlag));\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &anNum[i]);\n    anFlag[i] = 1;\n  }\n  for (i = N - 2; i >= 0; i--) {\n    int Max = 0;\n    for (j = i + 1; j < N; j++) {\n      if (anNum[i] >= anNum[j]) {\n        if (anFlag[j] > Max)\n          Max = anFlag[j];\n      }\n    }\n    anFlag[i] = Max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < N; i++)\n    if (anFlag[i] > Max)\n      Max = anFlag[i];\n  cout << Max << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17685", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], f[1000] = {0}, n, longest_index = -1, longest_f = -1;\n\nint main() {\n  int i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n  {\n    int i, j;\n    for (i = 0; i < n; ++i)\n      f[i] = 1;\n    for (i = n - 2; i >= 0; --i) {\n      for (j = i + 1; j < n; ++j) {\n        if ((f[i] < f[j] + 1) && (a[i] >= a[j])) {\n          f[i] = f[j] + 1;\n          if (longest_f < f[i]) {\n            longest_f = f[i];\n            longest_index = i;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d \", longest_f);\n  return 0;\n}\n"}
{"label": "10", "index": "17686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint b[1000 + 10];\nint aMaxLen[1000 + 10];\nint main() {\n  int N, i, j;\n  cin >> N;\n  for (i = N; i >= 1; i--)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int nTmp = 0;\n    for (j = 1; j < i; j++) {\n      if (b[i] >= b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= N; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  printf(\"%d \", nMax);\n  return 0;\n}\n"}
{"label": "10", "index": "17687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, max = 0, a[26] = {0}, b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  max = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint main() {\n  int d(int xz, int p, int q);\n  int y, i, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  y = d(10000, 1, n);\n  printf(\"%d\", y);\n  return 0;\n}\nint d(int xz, int p, int q) {\n  int g, h;\n  if (p == q && a[p] <= xz)\n    return 1;\n  else {\n    if (p == q && a[p] > xz)\n      return 0;\n    else {\n      if (xz < a[p])\n        return (d(xz, p + 1, q));\n      else {\n        g = 1 + d(a[p], p + 1, q);\n        h = d(xz, p + 1, q);\n        if (g > h)\n          return (g);\n        else\n          return (h);\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "17689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max(int n, int a[]) {\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    if (x < a[i])\n      x = a[i];\n  }\n  return x;\n}\nint main() {\n  int x, n, i, j, b = 1;\n  int *p;\n  int *q;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(n * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = n - 1; i >= 0; i--) {\n\n    {\n      x = 0;\n      for (j = i + 1; j < n; j++) {\n        if ((p[i] >= p[j]) && (x < q[j]))\n          x = q[j];\n      }\n      q[i] = x + 1;\n    }\n  }\n  printf(\"%d\", Max(n, q));\n}\n"}
{"label": "10", "index": "17690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25], i, j, max, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (a[j] <= a[i]) {\n        s = b[j] + 1;\n        if (s >= max)\n          max = s;\n      }\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max > k[i + 1])\n      q = f(k[i + 1], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  printf(\"%d\", f(2147483647, 0, 0));\n}\n"}
{"label": "10", "index": "17692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++)\n    n = n > b[i] ? n : b[i];\n\n  cout << n;\n  free(a);\n  free(b);\n}\n"}
{"label": "10", "index": "17693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k, d = 0, m;\nvoid f(int i, int a[25], int c[25]) {\n  if (i == 0)\n    a[i] = 0;\n  else\n    a[i] = a[i - 1] + 1;\n  for (;; a[i]++) {\n    if (a[i] == (k - 1)) {\n      if (i == 0)\n        m = 1;\n      else if (c[a[i]] > c[a[i - 1]])\n        m = i;\n      else\n        m = i + 1;\n      d = d > m ? d : m;\n      break;\n    }\n    if (i != 0) {\n      if (c[a[i]] > c[a[i - 1]])\n        continue;\n      else\n        f(i + 1, a, c);\n    } else\n      f(1, a, c);\n  }\n}\nint main() {\n  int i, c[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> c[i];\n  f(0, a, c);\n  cout << d;\n  return 0;\n}\n"}
{"label": "10", "index": "17694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26] = {0};\nint b[10000];\nint n, m = 0;\nint p = 1;\nvoid dao(int c, int k) {\n  int i, flag = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[i] <= c) {\n      flag = 1;\n      p = p + 1;\n      dao(a[i], i);\n      p = p - 1;\n    }\n  }\n  if (flag == 0) {\n    b[m] = p;\n    m = m + 1;\n  }\n}\nint main() {\n  int i, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    dao(a[i], i);\n  }\n  for (i = 0; i < m - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      q = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = q;\n    }\n  }\n  printf(\"%d\", b[m - 1]);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num;\n  int i, j;\n  int data[30];\n  int dp[30];\n  int max;\n  memset(dp, 0, sizeof(dp));\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++)\n    scanf(\"%d\", &data[i]);\n  dp[0] = 1;\n  for (i = 1; i < num; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((data[i] <= data[j]) && (dp[j] + 1 > max))\n        max = dp[j] + 1;\n    }\n    dp[i] = max;\n  }\n  for (i = 0; i < num; i++)\n    if (dp[i] > max)\n      max = dp[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[30], b[30] = {0}, max = 0, flag = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (int j = n, k; j >= 1; j--) {\n    max = 0;\n    flag = 0;\n    for (k = j; k <= n; k++) {\n      if (a[j] >= a[k]) {\n        flag = 1;\n        if (b[k] >= max) {\n          max = b[k];\n        }\n      }\n    }\n    if (flag) {\n      b[j] = max + 1;\n    } else {\n      b[j] = max;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17697", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int a[], int n) {\n  int z, i, j, t, temp, r;\n  int b[25];\n  if (n == 1)\n    z = 1;\n  else if (n == 0)\n    z = 0;\n  else {\n    for (i = 0, r = 0; i < n; i++) {\n      for (j = i + 1, t = 0; j < n; j++)\n        if (a[j] <= a[i]) {\n          b[t] = a[j];\n          t++;\n        }\n      temp = max(b, t) + 1;\n      if (temp > r)\n        r = temp;\n    }\n    z = r;\n  }\n  return z;\n}\n\nint main() {\n  int k, t, i;\n  int bomb[25];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++)\n    cin >> bomb[i];\n  t = max(bomb, k);\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17698", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint cal(\n    int *p, int N,\n    int M) { \n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (*(p + N) >= *(p + i)) {\n      sub = cal(p, i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  int height[26];\n  height[0] = 10000000;\n  scanf(\"%d\", &height[1]);\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  printf(\"%d\", cal(height, 0, k + 1) - 2);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint *h;\nint *m;\nint max_1 = 0;\n\nvoid calc(int num) {\n  int i;\n  *(m + num) = 1;\n  for (i = num + 1; i <= n - 1; i++)\n    if (*(h + i) <= *(h + num))\n      if (*(m + i) + 1 > *(m + num)) {\n        *(m + num) = *(m + i) + 1;\n      }\n  if (*(m + num) > max_1)\n    max_1 = *(m + num);\n}\n\nint main() {\n  int i;\n  cin >> n;\n  h = (int *)malloc(sizeof(int) * n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", h + i);\n  *(m + n - 1) = 1;\n  for (i = n - 2; i >= 0; i--)\n    calc(i);\n  cout << max_1;\n}\n"}
{"label": "10", "index": "17700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, a[25], f[25][25];\n\nint max(int a, int b) { return a > b ? a : b; }\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  f[0][0] = a[0];\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (j == 0) {\n        f[i][j] = max(f[i - 1][j], a[i]);\n        continue;\n      }\n      if (f[i - 1][j - 1] >= a[i])\n        f[i][j] = max(f[i - 1][j], a[i]);\n      else\n        f[i][j] = f[i - 1][j];\n    }\n  }\n  j = k - 1;\n  while (f[k - 1][j] == 0)\n    j--;\n  printf(\"%d\", j + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int a[26], b[26];\n  for (i = 1; i < 26; i++)\n    b[i] = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n\n  int num[26];\n  int max;\n  num[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = k; j > i; j--)\n      if (a[j] <= a[i])\n        b[j] = num[j];\n    max = 0;\n    for (j = k; j > i; j--)\n      if (b[j] >= max)\n        max = b[j];\n    num[i] = max + 1;\n    for (j = 1; j < 26; j++)\n      b[j] = 0;\n  }\n\n  int x;\n  x = num[1];\n  for (i = 1; i <= k; i++) {\n    if (x <= num[i])\n      x = num[i];\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "17702", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int *p, int num, int height) {\n  int missile, case1, case2;\n  if (num == 1) {\n    if (*p <= height)\n      missile = 1;\n    else\n      missile = 0;\n  } else {\n    case1 = max(p + 1, num - 1, *p) + 1;\n    case2 = max(p + 1, num - 1, height);\n    if (*p <= height && case1 >= case2)\n      missile = case1;\n    else\n      missile = case2;\n  }\n  return (missile);\n}\nint main() {\n  int a[100], n, i, height = 100000, H;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  H = max(a, n, height);\n  printf(\"%d\", H);\n}\n"}
{"label": "10", "index": "17703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint solve(int k, int h, int *p, int n) {\n  if (k == n)\n    return 0;\n  if (p[k] == h)\n    return 1 + solve(k + 1, h, p, n);\n  if (p[k] > h)\n    return solve(k + 1, h, p, n);\n  return max(solve(k + 1, h, p, n), 1 + solve(k + 1, p[k], p, n));\n}\nint main() {\n  int n;\n  int p[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  printf(\"%d\", solve(0, 100000, p, n));\n  return 0;\n}\n"}
{"label": "10", "index": "17704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100] = {0}, i = 0, j = 0, d[100] = {0}, c = 0, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    cin >> a[i];\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if ((d[j] > c) && (a[j] <= a[i]))\n        c = d[j];\n    }\n    d[i] = c + 1;\n    c = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[30];\nint r[30];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n\n  r[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    if (r[i] >= r[i + 1]) {\n      cout << \"first way taken\" << endl;\n      r[i] = r[i + 1] + 1;\n    } else {\n      int max = 0;\n      for (j = i + 1; j < k; j++) {\n        if (h[j] <= h[i] && r[j] > max)\n          max = r[j];\n      }\n      r[i] = max + 1;\n    }\n  }\n  int ans = 0;\n  for (i = 0; i < k; i++) {\n\n    if (r[i] > ans)\n      ans = r[i];\n  }\n  cout << ans;\n}\n"}
{"label": "10", "index": "17706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  int max;\n  int d[30];\n  int h[30];\n  d[0] = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n  h[0] = 2147483647;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j] && (d[j] + 1) > max)\n        max = d[j] + 1;\n    }\n    d[i] = max;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (d[i] > max)\n      max = d[i];\n  printf(\"%d\\n\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17707", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 25 + 10;\nint h[N];\nint dp[N];\n\nint main(void) {\n  int ans, cnt, i, j;\n  while (scanf(\"%d\", &cnt) != EOF) {\n    for (i = 0; i < cnt; ++i)\n      scanf(\"%d\", h + i);\n\n    dp[0] = 1;\n    for (i = 1; i < cnt; ++i) {\n      dp[i] = 1;\n      for (j = 0; j < i; ++j) {\n        if (h[i] <= h[j]) {\n          dp[i] = max(dp[i], dp[j] + 1);\n        }\n      }\n    }\n    ans = 0;\n    for (i = 0; i < cnt; ++i)\n      ans = max(ans, dp[i]);\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "17708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sort(int k);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[25];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int d[25];\n  for (i = n - 1; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (d[i] > max)\n      max = d[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  int a[100], b[100];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] > a[j])\n        continue;\n      if (b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17710", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int h[n];\n  for (int i = 0; i < n; i++)\n    cin >> h[i];\n  int m[n];\n  for (int i = 0; i < n; i++)\n    m[i] = 0;\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (h[i] >= h[j] && m[i] - 1 < m[j])\n        m[i] = m[j] + 1;\n      if (j == n - 1 && m[i] == 0)\n        m[i] = 1;\n    }\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (m[i] > max)\n      max = m[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k, n[25], h[25];\n\nint main() {\n  scanf(\"%d \", &k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  memset(n, sizeof(n), 0);\n  int tem = 0;\n  for (i = 0; i < k; i++) {\n    tem = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (n[j] > tem)\n          tem = n[j];\n      }\n    }\n    n[i] = 1 + tem;\n  }\n  tem = 0;\n  for (i = 0; i < k; i++) {\n    if (n[i] > tem)\n      tem = n[i];\n  }\n  cout << tem << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct missile {\n  int num;\n  int high;\n};\nstruct missile a[25];\nvoid f(int n, int sum);\nint main() {\n  int i = 0, j = 0, sum = 0, max = 0;\n  scanf(\"%d\", &sum);\n  for (i = 0; i <= sum - 1; i++) {\n    scanf(\"%d\", &a[i].high);\n  }\n  for (i = sum - 1; i >= 0; i--) {\n    f(i, sum);\n  }\n  for (i = 0; i <= sum - 1; i++) {\n    if (a[i].num > max) {\n      max = a[i].num;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\nvoid f(int n, int sum) {\n  int i = 0, t = 1;\n  if (n == sum - 1) {\n    a[n].num = 1;\n  } else {\n    a[n].num = 1;\n    for (i = n + 1; i <= sum - 1; i++) {\n      if (a[n].high >= a[i].high) {\n        if (a[i].num + 1 > a[n].num) {\n          a[n].num = a[i].num + 1;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "17713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[100], mark[100] = {0}, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  mark[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] <= num[i] && mark[j] > max) {\n        max = mark[j];\n      }\n    }\n    mark[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (mark[i] > max) {\n      max = mark[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[26] = {0}, q[26] = {0}, a = 0, b, c, d, e, f, g, i, j, k, l, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  q[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    b = 1;\n    for (j = i + 1; j < k; j++) {\n      if (p[i] >= p[j]) {\n        if (q[j] + 1 > b)\n          b = q[j] + 1;\n      }\n    }\n    q[i] = b;\n  }\n  for (i = 0; i < k; i++) {\n    if (a < q[i])\n      a = q[i];\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "10", "index": "17715", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[1000 + 10], f[1000 + 10];\n\nint main() {\n\n  cin >> n;\n  for (int i = 0; i < n; ++i)\n    cin >> a[i];\n\n  int ans = 0;\n  for (int i = 0; i < n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[j] >= a[i])\n        f[i] = max(f[i], f[j]);\n    }\n    f[i]++;\n    ans = max(ans, f[i]);\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nunsigned int h[26], n;\nint go(int maxh, int cp) {\n  int x, y, max;\n  while (h[cp] > maxh)\n    cp = cp + 1;\n  if (h[cp] == 0)\n    return 0;\n  x = go(maxh, cp + 1);\n  maxh = h[cp];\n  y = 1 + go(maxh, cp + 1);\n  max = (x > y) ? x : y;\n  return max;\n}\nint main() {\n  unsigned int i, c, t;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> h[i];\n  h[n] = 0;\n  t = go(65535, 0);\n  cout << t;\n  return 0;\n}\n"}
{"label": "10", "index": "17717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, a[25], f[25][25];\n\nint max(int a, int b) { return a > b ? a : b; }\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f[0][0] = a[0];\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (j == 0) {\n        f[i][j] = max(f[i - 1][j], a[i]);\n        continue;\n      }\n      if (f[i - 1][j - 1] >= a[i])\n        f[i][j] = max(f[i - 1][j], a[i]);\n      else\n        f[i][j] = f[i - 1][j];\n    }\n  }\n  j = k - 1;\n  while (f[k - 1][j] == 0)\n    j--;\n  printf(\"%d\", j + 1);\n}\n"}
{"label": "10", "index": "17718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, max, ans = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n      if (a[i] >= a[j] && b[j] == max) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[j] > ans)\n      ans = b[j];\n  }\n\n  cout << ans;\n  return 0;\n}\n"}
{"label": "10", "index": "17719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, j, i;\n  scanf(\"%d\", &m);\n  int *a, *b;\n  a = (int *)malloc(sizeof(int) * m);\n  b = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (b[j] > b[i])\n          b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  t = 0;\n  for (i = 0; i < m; i++)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17721", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[1000 + 10], f[1000 + 10];\n\nint main() {\n\n  cin >> n;\n  for (int i = 0; i < n; ++i) {\n    cin >> a[i];\n  }\n  int ans = 0;\n  for (int i = 0; i < n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[j] >= a[i])\n        f[i] = max(f[i], f[j]);\n    }\n    f[i]++;\n    ans = max(ans, f[i]);\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[25], i, j, l, p, q;\n  int b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  for (j = k - 1; j >= 0; j--) {\n    for (l = k - 1; l >= j; l--) {\n      if (l != j) {\n        if ((a[j] >= a[l]) && (b[j] == b[l] - 1)) {\n          b[j] = b[l];\n        }\n      } else if (l == j) {\n        b[j] = b[j] + 1;\n      }\n    }\n  }\n  for (p = 1; p <= k - 1; p++) {\n    if (b[0] < b[p]) {\n      q = b[0];\n      b[0] = b[p];\n      b[p] = q;\n    }\n  }\n  cout << b[0];\n}\n"}
{"label": "10", "index": "17723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N, input[26], i, j, k, ans[26], Max;\nint cons(int i) {\n  int a = 0;\n  if (ans[i] != 0)\n    return ans[i];\n  for (int j = i + 1; j < N; j++) {\n    if (input[j] <= input[i])\n      if (a < cons(j))\n        a = ans[j];\n  }\n  ans[i] = a + 1;\n  return ans[i];\n}\nint main() {\n  Max = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &input[i]);\n    ans[i] = 0;\n  }\n  for (i = N - 1; i >= 0; i--) {\n    if (Max < cons(i))\n      Max = ans[i];\n  }\n  cout << Max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17724", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i, j, k, max, t;\n  cin >> k;\n  for (i = k; i >= 1; i--)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    max = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && b[j] > max) {\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  t = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] >= t)\n      t = b[i];\n  }\n  for (i = 1; i <= k; i++) {\n    if (b[i] == t)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "10", "index": "17725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    cin >> rec[i];\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = max(n[i], n[j] + 1);\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, n[i]);\n  cout << m << \"\\n\";\n}\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\n"}
{"label": "10", "index": "17726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int a[k], b[100];\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n      }\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *f = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j <= i; j++) {\n      if (p[i] <= p[j] && t <= f[j])\n        t = f[j];\n    }\n    f[i] = t + 1;\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    if (t < f[i])\n      t = f[i];\n  }\n  printf(\"%d \", t);\n}\n"}
{"label": "10", "index": "17728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max, a[30] = {0}, limit[30] = {0}, num[30] = {0};\n  scanf(\"%d\", &k);\n  for (i = k - 1; i >= 0; i--) {\n    cin >> a[i];\n  }\n  num[0] = 1;\n  limit[0] = a[0];\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((a[i] >= limit[j]) && ((num[j] + 1) >= max)) {\n        max = num[j] + 1;\n      }\n    }\n    limit[i] = a[i];\n    num[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, height[25], start[25], max = 0, h, i, j, q;\n  scanf(\"%d \", &k);\n  for (h = 0; h < k; h++) {\n    scanf(\"%d\", &height[h]);\n    start[h] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (height[j] <= height[i] && start[j] + 1 > start[i]) {\n        start[i] = start[j] + 1;\n      }\n    }\n  }\n  for (q = 1; q < k; q++) {\n    if (start[q] > start[max]) {\n      max = q;\n    }\n  }\n  cout << start[max];\n  return 0;\n}\n"}
{"label": "10", "index": "17730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100];\n\nint f(int a[], int n, int min) {\n  if (n == 1) {\n    if (a[0] >= min)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a[n - 1] < min)\n      return (f(a, n - 1, min));\n    else if (f(a, n - 1, a[n - 1]) + 1 < f(a, n - 1, min))\n      return (f(a, n - 1, min));\n    else\n      return (f(a, n - 1, a[n - 1]) + 1);\n  }\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int result;\n  result = f(a, n, 0);\n  cout << result;\n  return 0;\n}\n"}
{"label": "10", "index": "17731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y);\nint max(int x, int y) {\n  int z;\n  if (x > y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint main() {\n  int a[25] = {0};\n  int c[25];\n  int Height, k;\n  int n;\n  cin >> k;\n  {\n    for (n = 0; n < k; n++) {\n      cin >> Height;\n      a[n] = Height;\n      c[n] = 1;\n    }\n  }\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[j] <= a[i]) && (c[i] < c[j] + 1))\n        c[i] = c[j] + 1;\n    }\n  }\n\n  int cMax = c[0];\n  {\n    for (i = 0; i <= k - 1; i++) {\n      cMax = cMax > c[i] ? cMax : c[i];\n    }\n    printf(\"%d\", cMax);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17732", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100];\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int q[100] = {\n      0,\n  };\n  int j, k;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i, k = i; j < n; j++) {\n      if (a[j] <= a[i] && q[k] <= q[j])\n        k = j;\n    }\n    if (k != i)\n      q[i] = q[k] + 1;\n  }\n  for (i = 0, k = 0; i < n; i++) {\n    if (q[k] < q[i])\n      k = i;\n  }\n  printf(\"%d\", q[k] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25];\n  int b[25];\n  int k, i, j, max2, max1;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  b[0] = 1;\n  for (i = 1; i < k; i++) {\n    max1 = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] <= a[j]) {\n        if (max1 < (b[j] + 1)) {\n          max1 = b[j] + 1;\n        }\n      }\n    }\n    b[i] = max1;\n  }\n  max2 = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max2) {\n      max2 = b[i];\n    }\n  }\n  cout << max2 << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100], b[100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (int i = n - 1; i > 0; i--) {\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && b[j] < b[i] + 1) {\n        b[j] = b[i] + 1;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  printf(\"%d\\n\", b[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "17735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26], k, max = 1;\n\nvoid f(int i, int n) {\n  extern int a[26], k, max;\n  int j;\n  if (i == (k - 1)) {\n    if (n > max)\n      max = n;\n    return;\n  }\n  for (j = i + 1; j < k; j++) {\n    if (a[i] >= a[j])\n      f(j, n + 1);\n    else {\n      if (n > max)\n        max = n;\n    }\n  }\n}\n\nint main() {\n  extern int a[26], k, max;\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++) {\n    f(i, 1);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, b[25], a[25], c, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> b[i];\n  }\n  for (i = 1; i < k; i++) {\n    a[0] = 1;\n    c = 1;\n    for (j = 0; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (a[j] > c) {\n          c = a[j];\n        }\n      }\n    }\n    a[i] = c + 1;\n  }\n  c = 0;\n  for (i = 0; i < k; i++) {\n    if (a[i] > c) {\n      c = a[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "17737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint input[26];\nint state[26];\nint main() {\n  int n;\n  int i, j;\n  cin >> n;\n  for (i = 1; i < n; i++)\n    state[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &input[i]);\n  state[0] = 1;\n  for (j = 1; j < n; j++) {\n    int min = 1;\n    for (i = 0; i < j; i++) {\n      if (input[i] >= input[j]) {\n        if (state[i] + 1 > min)\n          min = state[i] + 1;\n      }\n    }\n    state[j] = min;\n  }\n  int sum = 0;\n  for (i = 0; i < n; i++) {\n    if (state[i] > sum)\n      sum = state[i];\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Max(int b[100], int n) {\n  int max = b[0];\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  return max;\n}\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[30], b[30] = {0}, d = 0;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    int c[30] = {0};\n    d = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        c[d] = b[j];\n        d++;\n      }\n    }\n    b[i] = Max(c, d) + 1;\n  }\n  int max = Max(b, k);\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a[], int k, int m) {\n  int ans = 1, tag = 1, i;\n  if (m < k - 1)\n    for (i = m + 1; i < k; i++)\n      if (a[i] <= a[m] && tag <= f(a, k, i)) {\n        ans = 1 + f(a, k, i);\n        tag = f(a, k, i);\n      }\n  return ans;\n}\nint main() {\n  int a[25], k, i, max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  max = f(a, k, 0);\n  for (i = 1; i < k; i++)\n    if (f(a, k, i) > max)\n      max = f(a, k, i);\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17740", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30][3], i, j, n, m, max;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i][1];\n    a[i][2] = 0;\n  }\n  a[1][2] = 1;\n  m = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if ((a[j][1] >= a[i][1]) && (a[j][2] > max))\n        max = a[j][2];\n    a[i][2] = max + 1;\n    if (a[i][2] > m)\n      m = a[i][2];\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] > b[i])) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > b[0]) {\n      b[0] = b[i];\n    }\n  }\n  printf(\"%d\", b[0]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = n[i] > (n[j] + 1) ? n[i] : n[j] + 1;\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = m > n[i] ? m : n[i];\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "17743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    b[i] = 1;\n\n  for (int i = 1; i < k; i++) {\n    for (int t = 0; t < i; t++)\n      if (a[t] >= a[i] && b[t] + 1 >= b[i])\n        b[i] = b[t] + 1;\n  }\n\n  int max = b[0];\n  for (int i = 1; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[26], d[26];\n  int i, j, k;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", s + i);\n    d[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    k = 0;\n    for (j = i + 1; j < n; j++) {\n      if (k < d[j] && s[i] >= s[j])\n        k = d[j];\n    }\n    k++;\n    d[i] = k;\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > k)\n      k = d[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, max = 0, maxb = 0;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)calloc(n, sizeof(int));\n\n  for (i = (n - 1); i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n\n  for (i = 1; i <= (n - 1); i++) {\n    max = 0;\n    \n    for (j = 0; j <= (i - 1); j++) {\n      if (a[i] >= a[j] && b[j] > max) {\n        \n        max = b[j];\n        \n      }\n    }\n    b[i] = max + 1;\n    \n    \n  }\n\n  for (i = 1; i <= (n - 1); i++) {\n    if (b[i] > maxb)\n      maxb = b[i];\n  }\n  printf(\"%d\", maxb);\n}\n"}
{"label": "10", "index": "17746", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\nint run() {\n  int i, j, a[33], b[33];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        if (b[j] < b[i] + 1)\n          b[j] = b[i] + 1;\n  j = 0;\n  for (i = 1; i <= n; i++)\n    if (b[i] > j)\n      j = b[i];\n  printf(\"%d\\n\", j);\n}\nint main() {\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    run();\n    n = 0;\n    cin >> n;\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] >= high[point] && high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point] && high[m] <= high[point + 1])\n            sum2++;\n        if (sum1 >= sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "17748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, num = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = b[i];\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[j] >= max)) {\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (b[i] > num)\n      num = b[i];\n  cout << num << \" \";\n}\n"}
{"label": "10", "index": "17749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25], i, j, max, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (a[j] <= a[i]) {\n        s = b[j] + 1;\n        if (s >= max)\n          max = s;\n      }\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17750", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[30], b[30];\n  for (int i = 0; i < 30; i++) {\n    a[i] = b[i] = 1;\n  }\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 1;\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (1 + b[j] > max)\n          max = 1 + b[j];\n      }\n    }\n    b[i] = max;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nconst int N = 1010;\n\nint n, m, k;\nint q[N];\nint f[N];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++)\n    cin >> q[i];\n  q[0] = 1000000000;\n  for (int i = 1; i <= n; i++)\n    for (int j = 0; j < i; j++)\n      if (q[j] >= q[i])\n        f[i] = max(f[i], f[j] + 1);\n  int res = 0;\n  for (int i = 1; i <= n; i++)\n    res = max(res, f[i]);\n  printf(\"%d\\n\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "17752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct dian {\n  int h;\n  int x;\n};\nint Compare(const void *elem1, const void *elem2) {\n  struct dian *p1, *p2;\n  p1 = (struct dian *)elem1;\n  p2 = (struct dian *)elem2;\n  return (*p2).h - (*p1).h;\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct dian *d = (struct dian *)malloc(sizeof(struct dian) * (n));\n  int *a = (int *)malloc(sizeof(int) * (n));\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d[i].h);\n    d[i].x = i;\n  }\n  qsort(d, n, sizeof(struct dian), Compare);\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].h == d[j].h && d[i].x > d[j].x) {\n        struct dian c;\n        c.x = d[i].x;\n        d[i].x = d[j].x;\n        d[j].x = c.x;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].x < d[j].x) {\n        if (a[i] < a[j] + 1)\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  int max = a[0];\n  for (k = 0; k < n; k++) {\n    if (a[k] > max)\n      max = a[k];\n  }\n  printf(\"%d\", max);\n  free(d);\n  free(a);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, m;\n  cin >> n;\n  int i, h[26];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &h[i]);\n  };\n  int q[26];\n  for (i = 1; i <= n; i++) {\n    q[i] = 1;\n  };\n  for (i = n - 1; i >= 1; i--) {\n    m = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (h[j] <= h[i]) {\n        if (m < q[j]) {\n          m = q[j];\n        };\n      };\n    };\n    q[i] = q[i] + m;\n  }\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    if (m < q[i]) {\n      m = q[i];\n    };\n  };\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int s[], int n) {\n  int i, d = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] > d)\n      d = s[i];\n  }\n  return d;\n}\nvoid bl(int h[], int s[], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      s[i] = 1;\n    else {\n      s[i] = 1;\n      for (j = 0; j < i; j++)\n        if (h[j] >= h[i] && (s[j] + 1) > s[i]) {\n          s[i] = s[j] + 1;\n        }\n    }\n  }\n}\nint main() {\n  int r, i, n;\n  scanf(\"%d\", &n);\n  int h[26], d[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  bl(h, d, n);\n  r = max(d, n);\n  cout << r;\n  return 0;\n}\n"}
{"label": "10", "index": "17755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int *h = (int *)malloc((N + 1) * sizeof(int));\n  for (int i = 1; i <= N; i++)\n    scanf(\"%d\", &h[i]);\n  int *f = (int *)malloc((N + 1) * sizeof(int));\n  f[1] = 1;\n  for (int i = 2; i <= N; i++) {\n    int tem = 0;\n    for (int j = 1; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (f[j] > tem)\n          tem = f[j];\n      }\n    }\n    f[i] = tem + 1;\n  }\n  int max = -1;\n  for (int i = 1; i <= N; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17756", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[i] <= b[j]))\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "17757", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint abc(const void *elem1, const void *elem2) {\n  return *(int *)elem2 - *(int *)elem1;\n}\nint main() {\n  int n, a[2][25] = {0}, i, j, x, y;\n  cin >> n;\n  for (i = n - 1; i >= 0; i--)\n    scanf(\"%d\", &a[0][i]);\n\n  a[1][0] = 1;\n  for (i = 1; i < n; i++) {\n    a[1][i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[0][i] >= a[0][j] && a[1][i] <= a[1][j])\n        a[1][i] = a[1][j] + 1;\n    }\n  }\n  qsort(a[1], n, 4, abc);\n  printf(\"%d\", a[1][0]);\n}\n"}
{"label": "10", "index": "17758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint *p;\nint n;\nint max(int t, int k) {\n  if (t > k)\n    return t;\n  else\n    return k;\n}\nint pd(int i, int h) {\n  if (i == n)\n    return 0;\n  if (p[i] > h)\n    return pd(i + 1, h);\n  if (p[i] == h)\n    return pd(i + 1, h) + 1;\n  return max(pd(i + 1, p[i]) + 1, pd(i + 1, h));\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    cin >> p[i];\n  k = pd(0, 800000);\n  cout << k;\n  free(p);\n  return 0;\n}\n"}
{"label": "10", "index": "17759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[26], r[26];\n  cin >> k;\n  for (int i = 0; i < 26; i++)\n    a[i] = 0;\n  for (int i = 0; i < 26; i++)\n    r[i] = 1;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < k; i++) {\n    if (i == 0)\n      r[i] = 1;\n    else {\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && r[j] >= r[i])\n          r[i] = r[j] + 1;\n      }\n    }\n  }\n  int s = 0;\n  for (int i = 0; i < k; i++) {\n    if (r[i] > s)\n      s = r[i];\n  }\n  cout << s << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17760", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int a[], int n) {\n  int z, i, j, t, temp, r;\n  int b[25];\n  if (n == 1)\n    z = 1;\n  else if (n == 0)\n    z = 0;\n  else {\n    for (i = 0, r = 0; i < n; i++) {\n      for (j = i + 1, t = 0; j < n; j++)\n        if (a[j] <= a[i]) {\n          b[t] = a[j];\n          t++;\n        }\n      temp = max(b, t) + 1;\n      if (temp > r)\n        r = temp;\n    }\n    z = r;\n  }\n  return z;\n}\n\nint main() {\n  int k, t, i;\n  int bomb[25];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &bomb[i]);\n  t = max(bomb, k);\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, *b, max, maxn = 0, *a;\n  cin >> n;\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--)\n      if (a[j] <= a[i] && b[j] >= max)\n        max = b[j];\n    b[i] = max + 1;\n    if (b[i] > maxn)\n      maxn = b[i];\n  }\n  cout << maxn << \"\\n\";\n}\n"}
{"label": "10", "index": "17762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length[500] = {0}, a[500]; \n  int temp = 0;\n  int n;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  length[1] = 1;\n  for (i = 2; i <= n; i++) \n  {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (temp < length[j])\n          temp = length[j];\n      }\n    }\n    length[i] = temp + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= n; i++) \n    if (max < length[i])\n      max = length[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[26], k, h[26], t, i, j;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++)\n      if (h[j] >= h[i])\n        if (b[j] > t)\n          t = b[j];\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++)\n    if (b[i] > t)\n      t = b[i];\n  cout << t;\n  return 0;\n}\n"}
{"label": "10", "index": "17764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30];\nint main() {\n  int a[100], k, i, n;\n  for (i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  cout << n - 1 << \"\\n\";\n  return 0;\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && t < max(a, i))\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "17765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= b[i]))\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i, j, k, max, t;\n  cin >> k;\n  for (i = k; i >= 1; i--)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    max = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n  }\n  t = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] >= t)\n      t = b[i];\n  }\n  for (i = 1; i <= k; i++) {\n    if (b[i] == t)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "10", "index": "17767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  cin >> a[0];\n  int i = 1;\n  while (i < n) {\n    scanf(\" %d\", &a[i]);\n    i++;\n  }\n  int b[25];\n  i = n - 2;\n  b[n - 1] = 1;\n  while (i >= 0) {\n    b[i] = 1;\n    int m = i + 1;\n    while (m < n) {\n      if ((a[m] <= a[i]) && (b[m] >= b[i] - 1)) {\n        b[i] = b[m] + 1;\n      }\n      m++;\n    }\n    i--;\n  }\n  int k = 1;\n  i = 0;\n  while (i < n) {\n    if (b[i] > k)\n      k = b[i];\n    i++;\n  }\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "17768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25];\n  int b[25];\n  int k, i, j, max2, max1;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  b[0] = 1;\n  for (i = 1; i < k; i++) {\n    max1 = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] <= a[j]) {\n        if (max1 < (b[j] + 1)) {\n          max1 = b[j] + 1;\n        }\n      }\n    }\n    b[i] = max1;\n  }\n  max2 = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max2) {\n      max2 = b[i];\n    }\n  }\n  cout << max2 << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint height[26];\nint x;\nint cmp(int a, int b) { return (a > b ? a : b); }\nint max(int a, int b) {\n  int cmp(int a, int b);\n  if (b == x) {\n    if (a >= height[x])\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a < height[b])\n      return (max(a, b + 1));\n    else\n      return (cmp(max(a, b + 1), (1 + max(height[b], b + 1))));\n  }\n}\n\nint main() {\n  int max(int, int);\n  int i;\n  scanf(\"%d\", &x);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  x--;\n  printf(\"%d\", max(1000000, 0));\n  return 0;\n}\n"}
{"label": "10", "index": "17770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    cin >> high[m];\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] >= high[point] && high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point] && high[m] <= high[point + 1])\n            sum2++;\n        if (sum1 >= sum2) {\n          for (m = point + 1; m < n - 1; m++)\n            high[m] = high[m + 1];\n\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "17771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, h[26], p[26], i, j, m, t, a[26][26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++)\n    p[i] = h[i];\n  for (i = 1; i < k; i++) {\n    m = i;\n    for (j = i + 1; j <= k; j++)\n      if (p[j] > p[m])\n        m = j;\n    t = p[i];\n    p[i] = p[m];\n    p[m] = t;\n  }\n  for (i = 0; i <= k; i++)\n    for (j = 0; j <= k; j++)\n      a[i][j] = 0;\n  for (i = 1; i <= k; i++)\n    for (j = 1; j <= k; j++) {\n      if (h[i] == p[j])\n        a[i][j] = a[i - 1][j - 1] + 1;\n      else {\n        if (a[i - 1][j] > a[i][j - 1])\n          a[i][j] = a[i - 1][j];\n        else\n          a[i][j] = a[i][j - 1];\n      }\n    }\n  cout << a[k][k];\n  return 0;\n}\n"}
{"label": "10", "index": "17772", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint daodan[30];\nint res[30];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> daodan[i];\n    res[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (daodan[i] >= daodan[j])\n        res[i] = max(res[i], res[j] + 1);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (res[i] > res[0])\n      res[0] = res[i];\n  }\n  printf(\"%d\\n\", res[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "17773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, h[25];\n  int len[25];\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  len[0] = 1;\n  int ans = 1;\n  for (i = 1; i < k; i++) {\n\n    int temp = -1, tIndex = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (len[j] > temp) {\n          temp = len[j];\n          tIndex = j;\n        }\n      }\n    }\n    if (temp == -1)\n      len[i] = 1;\n    else\n      len[i] = len[tIndex] + 1;\n    if (len[i] > ans)\n      ans = len[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, height = 9999;\n  cin >> n;\n  int *a = (int *)malloc(n * sizeof(int));\n  int **b = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i <= n - 1; i++)\n    b[i] = (int *)malloc(9999 * sizeof(int));\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 2; i++) {\n    if (a[i] > a[i + 1]) {\n      k = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = k;\n    }\n  }\n  height = a[n - 1];\n  for (i = n - 1; i >= 0; i--) {\n    for (j = 0; j <= height; j++) {\n      if (i == n - 1) {\n        if (j >= a[i]) {\n          b[i][j] = 1;\n        } else\n          b[i][j] = 0;\n      } else {\n        if (j >= a[i]) {\n          if (1 + b[i + 1][a[i]] > b[i + 1][j]) {\n            b[i][j] = 1 + b[i + 1][a[i]];\n          } else\n            b[i][j] = b[i + 1][j];\n        } else\n          b[i][j] = b[i + 1][j];\n      }\n    }\n  }\n  cout << b[0][height] + 1;\n}\n"}
{"label": "10", "index": "17775", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct {\n  int file;\n  int reign;\n} missile;\nint main() {\n  int n, i, j, max = 0;\n  missile a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i].file);\n  }\n  a[n].reign = 1;\n  for (i = n - 1; i >= 1; i--) {\n    a[i].reign = 1;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j].file <= a[i].file) {\n        if (a[j].reign + 1 > a[i].reign) {\n          a[i].reign = a[j].reign + 1;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i].reign > max) {\n      max = a[i].reign;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, a[100];\n  int n, i, j, max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    if (i == n - 1)\n      sum[i] = 1;\n    else {\n      for (j = i + 1; j <= n - 1; j++)\n        if (a[j] <= a[i]) {\n          if (sum[j] > max)\n            max = sum[j];\n        }\n      sum[i] = ++max;\n      max = 0;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= n - 1; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n    }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17777", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct DP {\n  int height;\n  int num;\n} dp[26];\n\nint main() {\n  int k, i, j;\n  int h[26];\n  int Max;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> h[i];\n  }\n  dp[0].height = INT_MAX;\n  dp[0].num = 0;\n  for (i = 1; i <= k; i++) {\n    dp[i].height = h[i];\n    Max = INT_MIN;\n    for (j = 0; j < i; j++) {\n      if (Max < dp[j].num && dp[j].height >= dp[i].height)\n        Max = dp[j].num;\n    }\n    dp[i].num = Max + 1;\n  }\n  Max = INT_MIN;\n  for (i = 0; i <= k; i++)\n    if (Max < dp[i].num)\n      Max = dp[i].num;\n  cout << Max << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h[25], num[25], k, n, i, j, max, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    num[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    flag = 0;\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i]) {\n        if (!flag) {\n          k = j;\n          flag = 1;\n        } else if (num[j] > num[k])\n          k = j;\n      }\n    if (flag)\n      num[i] = num[k] + 1;\n    else\n      num[i] = 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17779", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[100] = {0}, f[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      f[i] = 1;\n    } else {\n      k = 0;\n      for (j = 0, k = 0; j < i; j++) {\n        if (a[i] <= a[j] && k < f[j])\n          k = f[j];\n      }\n      f[i] = k + 1;\n    }\n  }\n  for (i = 0, k = 1; i < n; i++) {\n    if (k < f[i])\n      k = f[i];\n  }\n  printf(\"%d \", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17780", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0, count = 0;\n  int count1 = 0, count2 = 0;\n  int max = 0;\n  int num[25][2];\n\n  scanf(\"%d\", &k);\n  for (count = 0; count < k; ++count) {\n    scanf(\"%d\", &num[count][0]);\n    num[count][1] = 0;\n  }\n  for (count1 = 0; count1 < k; ++count1) {\n    max = 0;\n    for (count2 = 0; count2 < count1; ++count2) {\n      if (num[count2][1] >= max && num[count2][0] >= num[count1][0]) {\n        max = num[count2][1];\n        num[count1][1] = max + 1;\n      }\n    }\n  }\n  max = 0;\n  for (count = 0; count < k; ++count) {\n    if (num[count][1] >= max) {\n      max = num[count][1];\n    }\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "17781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int d[25];\n  int f[25];\n  int max = 0;\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &d[i]);\n    f[i] = 1;\n  }\n\n  while (1) {\n    int tmp = 0;\n    int x = 0;\n    int y = 0;\n\n    int ci;\n    for (ci = 0; ci < k; ci++) {\n      if (f[ci] == 1) {\n        y++;\n        if (x == 0) {\n          tmp = d[ci];\n          x++;\n        } else {\n          if (d[ci] <= tmp) {\n            tmp = d[ci];\n            x++;\n          } else\n            break;\n        }\n      }\n    }\n\n    if (x == y)\n      if (x > max)\n        max = x;\n\n    int cnt;\n    for (cnt = 0; cnt < k; cnt++) {\n      if (f[cnt] != 0)\n        break;\n    }\n    if (cnt == k)\n      break;\n\n    f[k - 1]--;\n    for (int i = k - 1; i > 0; i--) {\n      if (f[i] == -1) {\n        f[i] = 1;\n        f[i - 1]--;\n      }\n    }\n  }\n\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17782", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int i, j, k, p[25], result, a[25], b[25], sum;\n  for (i = 0; i < 25; i++)\n    a[i] = b[i] = p[i] = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &p[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    sum = 0;\n    for (int m = 0; m < 25; m++)\n      a[m] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (p[j] <= p[i])\n        a[j] = b[j];\n      sum = max(sum, a[j]);\n    }\n    b[i] = sum + 1;\n  }\n  result = 0;\n  for (i = 0; i < k; i++)\n    result = max(result, b[i]);\n  printf(\"%d\", result);\n}\n"}
{"label": "10", "index": "17783", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int high[30];\n  int num[30] = {0};\n  int i, j;\n  for (i = 0; i < k; i++) {\n    cin >> high[i];\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    int max = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (high[i] <= high[j]) {\n        if (max < num[j])\n          max = num[j];\n      }\n    }\n    num[i] = max + 1;\n  }\n  sort(num, num + k);\n  printf(\"%d\", num[k - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "17784", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[30];\nint b[30];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n\n  b[0] = 1;\n  int tmp;\n  for (i = 1; i < n; ++i) {\n    tmp = 0;\n    for (j = 0; j < i; ++j) {\n      if (a[j] >= a[i] && b[j] > tmp) {\n        tmp = b[j];\n      }\n    }\n    b[i] = tmp + 1;\n  }\n\n  tmp = -1;\n  for (i = 0; i < n; ++i) {\n    if (b[i] > tmp) {\n      tmp = b[i];\n    }\n  }\n  cout << tmp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j, k, c;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[j] > b[i]) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n    if (i == 0) {\n      break;\n    }\n  }\n  k = 0;\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      k = i;\n      c = b[i];\n    }\n  }\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "10", "index": "17786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num(int k, int i, int *p, int height) {\n  if (i == k)\n    return 0;\n  if (*(p + i) > height)\n    return (num(k, i + 1, p, height));\n  if (*(p + i) == height)\n    return (num(k, i + 1, p, height) + 1);\n  int a = num(k, i + 1, p, height);\n  int b = num(k, i + 1, p, *(p + i)) + 1;\n  return a > b ? a : b;\n}\nint main() {\n  int k, h[25], i;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  cout << num(k, 0, h, 1000000000);\n  return 0;\n}\n"}
{"label": "10", "index": "17787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k, height[25], maxC[25] = {0}, j, i, max = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &height[i]);\n\n    for (j = 0, max = 0; j < i; j++) {\n      if (height[j] >= height[i])\n        if (maxC[j] > max)\n          max = maxC[j];\n    }\n    if (max == 0)\n      maxC[i] = 1;\n    else\n      maxC[i] = ++max;\n  }\n\n  for (i = 1, max = 0; i < k; i++)\n    if (maxC[i] > max)\n      max = maxC[i];\n\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  cout << n;\n}\n"}
{"label": "10", "index": "17789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h[25], d[25], i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (d[j] + 1 > d[i] && h[j] <= h[i])\n        d[i] = d[j] + 1;\n    }\n  }\n  max = d[0];\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, temp, max;\n  int a[100], ans[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> a[i];\n  for (i = 1; i <= k; i++)\n    ans[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    temp = 1;\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i]) {\n        if (ans[j] + 1 > temp)\n          temp = ans[j] + 1;\n      }\n    }\n    ans[i] = temp;\n  }\n  max = 0;\n  for (i = 1; i <= k; i++) {\n    if (ans[i] > max)\n      max = ans[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17791", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calc(int *, int, int);\n\nint main() {\n  int k, h[25], i = 0;\n  cin >> k;\n  while (cin >> h[i]) {\n    i++;\n    if (i == k)\n      break;\n  }\n  printf(\"%d\", calc(h, k, (1 << 31 - 1)));\n  return 0;\n}\n\nint calc(int *h, int k, int limit) {\n  int i, ret = 0, t = 0;\n  for (i = 0; i < k; i++) {\n    if (h[i] > limit)\n      continue;\n    t = 1 + calc(h + i + 1, k - i - 1, h[i]);\n    if (t > ret) {\n      ret = t;\n    }\n  }\n  return ret;\n}\n"}
{"label": "10", "index": "17792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[30];\n  int len[30];\n  for (int i = 0; i < n; ++i)\n    cin >> num[i];\n\n  len[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int max = 0;\n    for (int j = 0; j < i; ++j) {\n      if (num[j] >= num[i] && len[j] > max) {\n        max = len[j];\n      }\n      if (max == 0)\n        len[i] = 1;\n      else\n        len[i] = max + 1;\n    }\n  }\n  int l = len[0];\n  for (int i = 1; i < n; ++i) {\n    if (len[i] > l)\n      l = len[i];\n  }\n  printf(\"%d\\n\", l);\n}\n"}
{"label": "10", "index": "17793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int x[], int n);\nint main() {\n  int a[26] = {0}, b[26] = {0};\n  int i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = n - 1; i >= 0; i--) {\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= sum)\n          sum = b[j];\n      }\n    }\n    b[i] = sum + 1;\n  }\n  cout << max(b, n) << \" \";\n}\nint max(int x[], int n) {\n  int i, s = 0;\n  for (i = 0; i < n; i++) {\n    if (x[i] > s)\n      s = x[i];\n  }\n  return (s);\n}\n"}
{"label": "10", "index": "17794", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[100];\n  int h[100];\n  int ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    ans = 1;\n    for (int i = 0; i < n; i++) {\n      scanf(\"%d\", &a[i]);\n      h[i] = 1;\n    }\n    for (int i = 1; i < n; i++) {\n      int sum = 1;\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && h[i] < h[j] + 1) {\n          h[i] = h[j] + 1;\n        }\n      }\n      if (h[i] > ans) {\n        ans = h[i];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  struct a {\n    int x, y;\n  } a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i].x);\n\n  int max = 0, j;\n  for (j = 0; j < n; j++) {\n    int k = 0;\n    for (i = j + 1; i < n; i++) {\n      if (a[i].x < a[j].x)\n        k++;\n    }\n    a[j].y = k;\n  }\n  int w;\n  for (i = n - 1; i >= 1; i--) {\n    if (a[i - 1].y < a[i].y + 1) {\n      a[i - 1].y = a[i].y;\n      w++;\n    }\n  }\n  cout << n - w;\n  return 0;\n}\n"}
{"label": "10", "index": "17796", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, h[25];\n  int len[25];\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  len[0] = 1;\n  int ans = 1;\n  for (i = 1; i < k; i++) {\n    \n    int temp = -1, tIndex = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (len[j] > temp) {\n          temp = len[j];\n          tIndex = j;\n        }\n      }\n    }\n    if (temp == -1)\n      len[i] = 1;\n    else\n      len[i] = len[tIndex] + 1;\n    if (len[i] > ans)\n      ans = len[i];\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar max(char a[], char i) {\n  char j, m = a[0];\n  for (j = 1; j < i; j++)\n    if (m < a[j])\n      m = a[j];\n  return (m);\n}\n\nint main() {\n  int h[1000] = {0};\n  char n, i, j;\n  scanf(\"%d\", &n);\n  for (i = n; i >= 1; i--)\n    cin >> h[i];\n  char mis[1000] = {0}, temp[1000] = {0};\n  mis[0] = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= i - 1; j++) {\n      if (h[i] >= h[j])\n        temp[j] = mis[j] + 1;\n      else\n        temp[j] = 0;\n    }\n    mis[i] = max(temp, i);\n  }\n  for (i = 0; i <= n; i++)\n    cout << mis[i] << \" \";\n  printf(\"%d\", max(mis, n + 1));\n  return 0;\n}\n"}
{"label": "10", "index": "17798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[30];\n  int count[30];\n  cin >> n;\n  int i;\n  int j;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    count[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] <= num[j]) {\n        if (count[i] < count[j] + 1) {\n          count[i] = count[j] + 1;\n        }\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (count[i] > max)\n      max = count[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint abc(const void *elem1, const void *elem2) {\n  return *(int *)elem2 - *(int *)elem1;\n}\nint main() {\n  int n, a[2][25] = {0}, i, j;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[0][i]);\n  }\n  a[1][0] = 1;\n  for (i = 1; i < n; i++) {\n    a[1][i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[0][i] >= a[0][j] && a[1][i] <= a[1][j])\n        a[1][i] = a[1][j] + 1;\n    }\n  }\n  qsort(a[1], n, 4, abc);\n  printf(\"%d\", a[1][0]);\n}\n"}
{"label": "10", "index": "17800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, a[30], b[30];\n  cin >> n;\n  m = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "17801", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint a[1000];\nint f[1000];\n\nvoid input() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\n\nint main() {\n  input();\n  for (int i = 0; i < n; i++)\n    f[i] = 1;\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n  }\n  int ans = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > ans)\n      ans = f[i];\n  cout << ans << endl;\n}\n"}
{"label": "10", "index": "17802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int MAXN = 25 + 2;\nint n;\nint a[MAXN], f[MAXN];\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > max)\n      max = f[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j, count = 1, st = 0;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[100], max;\n  double a[100];\n  memset(c, 0, sizeof(c));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%lf\", &a[i]);\n  c[n - 1] = 1;\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && c[j] > max)\n        max = c[j];\n    c[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (c[i] > max)\n      max = c[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[30], count = 0, n, temp, i;\n  cin >> n;\n  while (n--) {\n    cin >> temp;\n    for (i = 0; i < count; i++)\n      if (temp > a[i]) {\n        a[i] = temp;\n        break;\n      }\n    if (i >= count) {\n      a[i] = temp;\n      count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "10", "index": "17806", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[25];\nint result[25];\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = k - 1; i >= 0; i--)\n    cin >> a[i];\n\n  result[0] = 1;\n  for (int i = 1; i < k; i++) {\n    int j = i - 1;\n    while (j >= 0) {\n      if (a[j] <= a[i]) {\n        if (result[j] > result[i])\n          result[i] = result[j];\n      }\n      j--;\n    }\n    result[i]++;\n  }\n\n  int t = 0;\n  for (int i = 0; i < k; i++) {\n    if (result[i] > t)\n      t = result[i];\n  }\n\n  cout << t;\n}\n"}
{"label": "10", "index": "17807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint lanjie(int m, int b[26], int lim) {\n  if (m == 1) {\n    if (b[0] <= lim)\n      return (1);\n    else\n      return (0);\n  } else if (m == 2) {\n    if (b[0] <= lim && b[1] <= b[0])\n      return (2);\n    else if (b[0] > lim && b[1] > lim)\n      return (0);\n    else\n      return (1);\n  } else {\n    if (b[0] <= lim)\n      return (lanjie(m - 1, &b[1], b[0]) + 1 >= lanjie(m - 1, &b[1], lim)\n                  ? lanjie(m - 1, &b[1], b[0]) + 1\n                  : lanjie(m - 1, &b[1], lim));\n    else\n      return (lanjie(m - 1, &b[1], lim));\n  }\n}\nint main() {\n  int a[26], i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  getchar();\n  printf(\"%d\\n\", lanjie(k, a, 32767));\n  return 0;\n}\n"}
{"label": "10", "index": "17808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, i, j, h[1000], a[1000], n = 1;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  a[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    a[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (h[j] < h[i] || h[j] == h[i]) {\n        if ((a[j] + 1) > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] > n)\n      n = a[i];\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "17809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int k, int n, int z);\nint main() {\n  int k, a[25], i, t;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t = max(a, k, 0, 999999);\n  cout << t << \"\\n\";\n}\nint max(int a[], int k, int n, int z) {\n  int b = 0, c, t;\n  if (n == k - 1)\n    if (a[n] <= z)\n      t = 1;\n    else\n      t = 0;\n  else {\n    if (a[n] <= z) {\n      c = max(a, k, n + 1, z);\n      z = a[n];\n      b = 1 + max(a, k, n + 1, z);\n      if (b > c)\n        t = b;\n      else\n        t = c;\n    } else\n      t = max(a, k, n + 1, z);\n  }\n  return (t);\n}\n"}
{"label": "10", "index": "17810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[100] = {0}, i = 0, j = 0, d[100] = {0}, c = 0, max = 1;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if ((d[j] > c) && (a[j] <= a[i]))\n        c = d[j];\n    }\n    d[i] = c + 1;\n    c = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[100];\n  int h[100];\n  int ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    ans = 1;\n    for (int i = 0; i < n; i++) {\n      cin >> a[i];\n      h[i] = 1;\n    }\n    for (int i = 1; i < n; i++) {\n      int sum = 1;\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && h[i] < h[j] + 1)\n          h[i] = h[j] + 1;\n      }\n      if (h[i] > ans) {\n        ans = h[i];\n      }\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, k, f[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j >= i + 1; j--) {\n      if (a[i] >= a[j] && f[i] <= f[j])\n        f[i] = f[j] + 1;\n    }\n  }\n\n  for (j = 0 + 1; j < k; j++) {\n    if (f[0] < f[j])\n      f[0] = f[j];\n  }\n  printf(\"%d\", f[0]);\n}\n"}
{"label": "10", "index": "17813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint d[100];\nint dp[30];\n\nint main() {\n  while (scanf(\"%d\", &n) == 1) {\n    for (int i = 1; i <= n; i++)\n      scanf(\"%d\", d + i);\n\n    d[0] = (-1u) >> 1;\n    for (int i = 1; i <= n; i++) {\n      dp[i] = 0;\n      for (int j = 0; j < i; j++)\n        if (d[j] >= d[i])\n          dp[i] = max(dp[i], dp[j] + 1);\n    }\n\n    int ans = 0;\n    for (int i = 1; i <= n; i++)\n      ans = max(ans, dp[i]);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return -t;\n}\nint main() {\n  int n, t, i, j, a[25], b[25];\n  scanf(\"%d\", &n);\n  \n  \n\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d\", &a[k]);\n    b[k] = 0;\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[i] < b[j]) {\n          b[i] = b[j];\n        }\n      }\n    }\n    b[i]++;\n  }\n  qsort(b, n, sizeof(int), pfC);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "17815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100] = {0}, b[100] = {0}, sum = 0;\n\n  cin >> n;\n\n  for (i = 1; i <= n; i++)\n\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    b[i] = 1;\n\n    for (j = 1; j < i; j++)\n\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n\n        b[i] = b[j] + 1;\n\n    if (sum < b[i])\n      sum = b[i];\n  }\n\n  cout << sum << \"\\n\";\n}\n"}
{"label": "10", "index": "17816", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[25], b[25] = {0}, m, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    cin >> a[i];\n  for (i = k - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i; j <= k - 1; j++)\n      if (a[i] >= a[j] && m <= b[j])\n        m = b[j];\n    b[i] = m + 1;\n  }\n  m = b[0];\n  for (i = 0; i <= k - 1; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26], sum[26], imax[26];\nint c, j;\n\nint main() {\n  int i;\n  int find(int max, int q);\n\n  scanf(\"%d\\n\", &c);\n  for (i = 1; i <= c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", find(10000, 1));\n};\nint find(int max, int q) {\n  int i;\n  imax[q] = 0;\n  if (q != c) {\n    for (i = q; i <= c; i++) {\n      sum[q] = 0;\n      if (max >= a[i])\n        sum[q] = 1 + find(a[i], i + 1);\n      if (max < a[i])\n        sum[q] = find(max, i + 1);\n      if (sum[q] > imax[q])\n        imax[q] = sum[q];\n    }\n    return imax[q];\n  } else if (q = c && max >= a[q])\n    return 1;\n  else if (q = c && max < a[q])\n    return 0;\n}\n"}
{"label": "10", "index": "17818", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct daodan {\n  int height;\n  int number;\n};\nint compare(const void *a, const void *b) {\n  struct daodan *x = (struct daodan *)a;\n  struct daodan *y = (struct daodan *)b;\n  return (((*y).number) - ((*x).number));\n}\nint nextmax(struct daodan *dao, int k, int n) {\n  int *a = (int *)malloc((n - 1 - k) * sizeof(int));\n  int count = 0, b, c = 0;\n  for (int i = k + 1; i <= n - 1; i++) {\n    if ((dao[i]).height <= (dao[k]).height) {\n      a[count] = dao[i].number;\n      count++;\n    }\n  }\n  int max = 0;\n  for (int j = 0; j <= count - 1; j++) {\n    if (a[j] > max)\n      max = a[j];\n  }\n\n  return max;\n}\nint main() {\n  int n;\n  cin >> n;\n  struct daodan *dao = (struct daodan *)malloc(n * sizeof(struct daodan));\n  for (int i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &dao[i].height);\n\n  for (int j = 0; j <= n - 1; j++) {\n    dao[j].number = 1;\n  }\n  for (int k = n - 2; k >= 0; k--) {\n    dao[k].number = nextmax(dao, k, n) + 1;\n  }\n  int max = dao[0].number;\n  for (int l = 1; l <= n - 1; l++) {\n    if (dao[l].number > max) {\n      max = dao[l].number;\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17819", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[25], i, j, x[25][2], n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> high[i];\n  for (i = 0; i < n; i++)\n    x[i][0] = 1;\n  for (i = 0; i < n; i++)\n    x[i][1] = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((high[j] >= high[i]) && (x[j][0] >= x[i][0]))\n        x[i][0] = x[j][0] + 1;\n      if (x[j][1] > x[i][1])\n        x[i][1] = x[j][1];\n      if (x[j][0] > x[i][1])\n        x[i][1] = x[j][0];\n    }\n  }\n  i--;\n  if (x[i][0] < x[i][1])\n    x[i][0] = x[i][1];\n  printf(\"%d\", x[i][0]);\n}\n"}
{"label": "10", "index": "17820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    if (t > 0)\n      b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[30], dp[30] = {1};\nint n;\nint ans = -1;\nint main() {\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (dp[i] > ans)\n      ans = dp[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, t;\n  int *p, *max;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  max = (int *)malloc(k * sizeof(int));\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i <= k - 1; i++) {\n    t = 0;\n    for (j = 0; j < i; j++)\n      if (*(p + j) >= *(p + i))\n        if (t < *(max + j))\n          t = *(max + j);\n    *(max + i) = t + 1;\n  }\n\n  t = 0;\n  for (i = 0; i <= k - 1; i++)\n    if (*(max + i) > t)\n      t = *(max + i);\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint abc(const void *elem1, const void *elem2) {\n  return *(int *)elem2 - *(int *)elem1;\n}\nint main() {\n  int n, a[2][25] = {0}, i, j, x, y;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    cin >> a[0][i];\n  }\n  a[1][0] = 1;\n  for (i = 1; i < n; i++) {\n    a[1][i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[0][i] >= a[0][j] && a[1][i] <= a[1][j])\n        a[1][i] = a[1][j] + 1;\n    }\n  }\n  qsort(a[1], n, 4, abc);\n  cout << a[1][0];\n  return 0;\n}\n"}
{"label": "10", "index": "17824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint dao[26], n;\nint fly(int high, int m) {\n  if (m == n)\n    return 0;\n  else {\n    if (high < dao[m])\n      return fly(high, m + 1);\n    else {\n      return max(fly(high, m + 1), fly(dao[m], m + 1) + 1);\n    }\n  }\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &dao[i]);\n  k = fly(99999, 0);\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "17825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  int a[30] = {0}, f[30] = {0};\n  cin >> N;\n  for (int i = 0; i < N; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  int ans = 0;\n  for (int i = 1; i < N; i++) {\n    int mx = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > mx)\n        mx = f[j];\n    f[i] = mx + 1;\n    if (ans < f[i])\n      ans = f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k, d = 0, m;\nvoid f(int i, int a[25], int c[25]) {\n  if (i == 0)\n    a[i] = 0;\n  else\n    a[i] = a[i - 1] + 1;\n  for (;; a[i]++) {\n    if (a[i] == (k - 1)) {\n      if (i == 0)\n        m = 1;\n      else if (c[a[i]] > c[a[i - 1]])\n        m = i;\n      else\n        m = i + 1;\n      d = d > m ? d : m;\n      break;\n    }\n    if (i != 0) {\n      if (c[a[i]] > c[a[i - 1]])\n        continue;\n      else\n        f(i + 1, a, c);\n    } else\n      f(1, a, c);\n  }\n}\nint main() {\n  int i, c[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &c[i]);\n  f(0, a, c);\n  cout << d;\n  return 0;\n}\n"}
{"label": "10", "index": "17827", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nenum { MAX_NUM = 25 };\n\nint main() {\n  int missle_num = 0;\n\n  int height[MAX_NUM][2];\n  int i, j;\n  int max = 0;\n  cin >> missle_num;\n\n  for (i = 0; i < missle_num; i++) {\n    scanf(\"%d\", &height[i][0]);\n    height[i][1] = 1;\n  }\n\n  for (i = 0; i < missle_num; i++) {\n  }\n\n  for (i = 0; i < missle_num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (height[i][0] <= height[j][0]) {\n        if (height[i][1] < height[j][1] + 1)\n          height[i][1] = height[j][1] + 1;\n      }\n    }\n  }\n\n  max = 0;\n  for (i = 0; i < missle_num; i++) {\n\n    if (max < height[i][1])\n      max = height[i][1];\n  }\n  printf(\"\\n%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, i, j, an[30];\nint DFS(int h, int n) {\n  int t1, t2;\n  if (n == k - 1) {\n    if (an[n] > h)\n      return 0;\n    else\n      return 1;\n  }\n  if (an[n] > h)\n    return DFS(h, n + 1);\n  else {\n    t1 = DFS(h, n + 1);\n    t2 = DFS(an[n], n + 1) + 1;\n    if (t1 > t2) {\n      return t1;\n    } else\n      return t2;\n  }\n}\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> an[i];\n  }\n  cout << DFS(INT_MAX, 0) << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[26], f[26];\n  for (int i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  f[0] = 1;\n  if (a[1] <= a[0])\n    f[1] = 2;\n  else\n    f[1] = 1;\n  for (int i = 2; i <= n - 1; i++) {\n    int c[26];\n    for (int q = 0; q <= i - 1; q++) {\n      if (a[q] >= a[i])\n        c[q] = f[q];\n      else\n        c[q] = 0;\n    }\n    int maxc = c[0];\n    for (int j = 1; j <= i - 1; j++) {\n      if (maxc < c[j])\n        maxc = c[j];\n    }\n    f[i] = maxc + 1;\n  }\n  int max = f[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (f[m] > max)\n      max = f[m];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k[25], a[25];\n  int i, j, n, max;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &k[i]);\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j <= n - 1; j++)\n      if ((k[j] <= k[i]) && (a[i] <= a[j]))\n        a[i] = a[j] + 1;\n  for (max = 0, i = 0; i < n; i++)\n    if (a[i] >= max)\n      max = a[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17831", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint zui(int k, int m, int a[]) {\n  int s = 1, i = m + 1, max = 0;\n  if (m == k)\n    s = 1;\n  else {\n    for (i = m + 1; i <= k; i++) {\n      if (a[k - m] <= a[k - i]) {\n        if (max < zui(k, i, a)) {\n          max = zui(k, i, a);\n        }\n      }\n    }\n    s = s + max;\n  }\n  return s;\n}\nint main() {\n  int i, k, a[25], max = 0, s;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < k; i++) {\n    s = zui(k, i, a);\n    if (s > max)\n      max = s;\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, a[100] = {0}, f[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  t = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= i; j--)\n      if (a[i] >= a[j])\n        f[i] = (f[i] > f[j]) ? f[i] : f[j];\n    f[i]++;\n    t = (f[i] > t) ? f[i] : t;\n  }\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[26], h[26], k, i, j, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct DP {\n  int height;\n  int num;\n} dp[26];\n\nint main() {\n  int k, i, j;\n  int h[26];\n  int Max;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d \", &h[i]);\n\n  dp[0].height = INT_MAX;\n  dp[0].num = 0;\n  for (i = 1; i <= k; i++) {\n    dp[i].height = h[i];\n    Max = INT_MIN;\n    for (j = 0; j < i; j++) {\n      if (Max < dp[j].num && dp[j].height >= dp[i].height)\n        Max = dp[j].num;\n    }\n    dp[i].num = Max + 1;\n  }\n  Max = INT_MIN;\n  for (i = 0; i <= k; i++)\n    if (Max < dp[i].num)\n      Max = dp[i].num;\n  printf(\"%d\\n\", Max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num;\n  int i, j;\n  int data[30];\n  int dp[30];\n  int max;\n  memset(dp, 0, sizeof(dp));\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++)\n    scanf(\"%d\", &data[i]);\n  dp[0] = 1;\n  for (i = 1; i < num; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((data[i] <= data[j]) && (dp[j] + 1 > max)) {\n        max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  for (i = 0; i < num; i++) {\n    if (dp[i] > max)\n      max = dp[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, x;\n  scanf(\"%d\", &k);\n  int h[k];\n  int a[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (x = 0; x < k; x++) {\n    a[x] = 1;\n  }\n  int c, d;\n  for (c = k - 2; c >= 0; c--) {\n    for (d = c + 1; d < k; d++) {\n\n      if ((h[c] >= h[d]) && (a[d] >= a[c]))\n        a[c] = a[d] + 1;\n    }\n  }\n  int y = 1;\n  int m;\n  for (m = 0; m < k; m++) {\n    if (a[m] > y)\n      y = a[m];\n  }\n  cout << y;\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int k, int n, int z);\nint main() {\n  int k, a[25], i, t;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t = max(a, k, 0, 999999);\n  printf(\"%d\\n\", t);\n}\nint max(int a[], int k, int n, int z) {\n  int b = 0, c, m = a[n], t;\n  if (n == k - 1)\n    if (a[n] <= z)\n      t = 1;\n    else\n      t = 0;\n  else {\n    if (a[n] <= z) {\n      c = max(a, k, n + 1, z);\n      z = a[n];\n      b = 1 + max(a, k, n + 1, z);\n      if (b > c)\n        t = b;\n      else\n        t = c;\n    } else\n      t = max(a, k, n + 1, z);\n  }\n  return (t);\n}\n"}
{"label": "10", "index": "17838", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, height[25];\nint route(int m) {\n  int i, a = 0, max = 0;\n  for (i = m + 1; i < k; i++)\n    if (height[i] <= height[m])\n      a += 1;\n  if (a == 0)\n    return 1;\n  else {\n    for (i = m + 1; i < k; i++)\n      if (height[i] <= height[m] && route(i) > max)\n        max = route(i);\n    return (max + 1);\n  }\n}\nint main() {\n  int i, ans[25], a = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &height[i]);\n  for (i = 0; i < k; i++)\n    ans[i] = route(i);\n  for (i = 0; i < k; i++)\n    if (ans[i] > a)\n      a = ans[i];\n  printf(\"%d\\n\", a);\n}\n"}
{"label": "10", "index": "17839", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000], len[1000], n, i, j, max, longest;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  longest = 1;\n  for (i = 0; i < n; i++) {\n    max = 1;\n    len[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        max = len[j] + 1;\n      if (len[i] < max)\n        len[i] = max;\n    }\n    if (len[i] > longest)\n      longest = len[i];\n  }\n  printf(\"%d \", longest);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  int a[100], b[100];\n  cin >> n;\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] > a[j])\n        continue;\n      if (b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint h[30];\nint result[30];\n\nint findFirstLess(int num) {\n  int index = 0;\n  while (1) {\n    if (result[index] < num)\n      return index;\n    index++;\n  }\n}\n\nint main() {\n  int k, i = 0, r;\n  cin >> k;\n  while (1) {\n    if (i >= k)\n      break;\n    scanf(\"%d\", h + i);\n    i++;\n  }\n  result[0] = h[0];\n  i = 1;\n  r = 0;\n  while (i < k) {\n    if (h[i] <= result[r])\n      result[++r] = h[i];\n    if (h[i] > result[r])\n      result[findFirstLess(h[i])] = h[i];\n    i++;\n  }\n\n  printf(\"%d\\n\", r + 1);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calc(int *, int, int);\n\nint main() {\n  int k, h[25], i = 0;\n  scanf(\"%d \", &k);\n  while (cin >> h[i]) {\n    i++;\n    if (i == k)\n      break;\n  }\n  printf(\"%d\", calc(h, k, (1 << 31 - 1)));\n}\n\nint calc(int *h, int k, int limit) {\n  int i, ret = 0, t = 0;\n  for (i = 0; i < k; i++) {\n    if (h[i] > limit)\n      continue;\n    t = 1 + calc(h + i + 1, k - i - 1, h[i]);\n    if (t > ret)\n      ret = t;\n  }\n  return ret;\n}\n"}
{"label": "10", "index": "17843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int h, r;\n  } a[30];\n  int i, j, m, n, k = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].h);\n    a[i].r = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].h >= a[j].h) && (a[i].r <= (a[j].r + 1)))\n        a[i].r = a[j].r + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (k <= a[i].r)\n      k = a[i].r;\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, final;\n  int tomb[26];\n  int num[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> tomb[i];\n  memset(num, 0, sizeof(num));\n  num[n - 1] = 1;\n  final = 0;\n  for (i = n - 2; i >= 0; i--) {\n    j = i + 1;\n    max = 0;\n    while (j < n) {\n      if (tomb[j] <= tomb[i] && num[j] > max)\n        max = num[j];\n      j++;\n    }\n    num[i] = max + 1;\n    if (num[i] > final)\n      final = num[i];\n  }\n  cout << final << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17845", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint height[26];\n\nint cal(\n    int N,\n    int M) { \n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (height[N] >= height[i]) {\n      sub = cal(i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  height[0] = 10000000;\n  scanf(\"%d\", &height[1]);\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  printf(\"%d\", cal(0, k + 1) - 2);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  cin >> a[0];\n  int i = 1;\n  while (i < n) {\n    scanf(\" %d\", &a[i]);\n    i++;\n  }\n  int b[25];\n  i = n - 2;\n  b[n - 1] = 1;\n  while (i >= 0) {\n    b[i] = 1;\n    int m = i + 1;\n    while (m < n) {\n      if ((a[m] <= a[i]) && (b[m] >= b[i] - 1)) {\n        b[i] = b[m] + 1;\n      }\n      m++;\n    }\n    i--;\n  }\n  int k = 1;\n  i = 0;\n  while (i < n) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n    i++;\n  }\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "17847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], m = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    for (int j = i - 1; j >= 0; j--)\n      if (a[j] >= a[i] && b[j] < b[i] + 1)\n        b[j] = b[i] + 1;\n  for (int i = 0; i < n; i++)\n    if (m < b[i])\n      m = b[i];\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17848", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 100;\nint a[maxn], n, f[maxn], ans;\nvoid init() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n}\nvoid solve() {\n  ans = 0;\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n}\nint main() {\n  init();\n  solve();\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int n, int high) {\n  int c, b;\n  if (n == 0) {\n    if (a[0] > high)\n      return 0;\n    else\n      return 1;\n  } else if (a[n] > high)\n    return max(a, n - 1, high);\n  else {\n    c = max(a, n - 1, a[n]) + 1;\n    b = max(a, n - 1, high);\n    if (c > b)\n      return c;\n    else\n      return b;\n  }\n}\nint main() {\n  int n, i;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[n - i - 1]);\n  printf(\"%d\", max(a, n, 32767));\n  return 0;\n}\n"}
{"label": "10", "index": "17850", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[100], mark[100] = {0}, max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  mark[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] <= num[i] && mark[j] > max) {\n        max = mark[j];\n      }\n    }\n    mark[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (mark[i] > max) {\n      max = mark[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17851", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = max(n[i], n[j] + 1);\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, n[i]);\n  printf(\"%d\\n\", m);\n}\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\n"}
{"label": "10", "index": "17852", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int min[26];\n  int data[26];\n  int N;\n  int i, j;\n  int minLength;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &data[i]);\n  }\n  min[0] = 1;\n  for (i = 1; i < N; i++) {\n    minLength = 0;\n    for (j = 0; j < i; j++) {\n      if (data[i] <= data[j]) {\n        if (min[j] > minLength) {\n          minLength = min[j];\n        }\n      }\n    }\n    min[i] = minLength + 1;\n  }\n\n  minLength = 0;\n  for (i = 0; i < N; i++) {\n    if (min[i] > minLength) {\n      minLength = min[i];\n    }\n  }\n\n  printf(\"%d\\n\", minLength);\n  return 0;\n}\n"}
{"label": "10", "index": "17853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct daodan {\n  int height;\n  int number;\n};\nint compare(const void *a, const void *b) {\n  struct daodan *x = (struct daodan *)a;\n  struct daodan *y = (struct daodan *)b;\n  return (((*y).number) - ((*x).number));\n}\nint nextmax(struct daodan *dao, int k, int n) {\n  int *a = (int *)malloc((n - 1 - k) * sizeof(int));\n  int count = 0, b, c = 0;\n  for (int i = k + 1; i <= n - 1; i++) {\n    if ((dao[i]).height <= (dao[k]).height) {\n      a[count] = dao[i].number;\n      count++;\n    }\n  }\n  int max = 0;\n  for (int j = 0; j <= count - 1; j++) {\n    if (a[j] > max) {\n      max = a[j];\n    }\n  }\n\n  return max;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct daodan *dao = (struct daodan *)malloc(n * sizeof(struct daodan));\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &dao[i].height);\n  }\n  for (int j = 0; j <= n - 1; j++) {\n    dao[j].number = 1;\n  }\n  for (int k = n - 2; k >= 0; k--) {\n    dao[k].number = nextmax(dao, k, n) + 1;\n  }\n  int max = dao[0].number;\n  for (int l = 1; l <= n - 1; l++) {\n    if (dao[l].number > max) {\n      max = dao[l].number;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, flag = 0;\n  int a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = n - 1; j >= i; j--) {\n      if (a[i] >= a[j]) {\n        flag = 1;\n        if (b[i] < b[j])\n          b[i] = b[j];\n      }\n    }\n    b[i] = b[i] + 1;\n    if (flag == 0)\n      b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  printf(\"%d\", b[0] - 1);\n}\n"}
{"label": "10", "index": "17855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int a[25], b[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int max = 1;\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    t = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && t < b[j] + 1)\n        t = b[j] + 1;\n    b[i] = t;\n    max = b[i] > max ? b[i] : max;\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dp[100];\nint main(void) {\n  int i, j, k;\n  int *h;\n  int max;\n  scanf(\"%d\", &k);\n  h = (int *)malloc((k + 1) * sizeof(int));\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  dp[k] = 0;\n  for (i = k - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k; j++) {\n      if (h[i] >= h[j]) {\n        if (dp[j] + 1 > max)\n          max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  int m = 0;\n  for (i = 0; i <= k; i++) {\n    if (dp[i] > m)\n      m = dp[i];\n  }\n  printf(\"%d\", m + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17857", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[30], b[30], sum, i, j, m, p = 0;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 1; i > 0; i--) {\n    if (a[i - 1] >= a[i])\n      b[i - 1] = b[i] + 1;\n    else\n      break;\n  }\n  for (j = i - 1; j >= 0; j--) {\n    sum = b[k - 1];\n    for (m = k - 1; m > j; m--) {\n      if (a[j] >= a[m] && b[m] >= sum)\n        sum = b[m], p++;\n    }\n    if (p == 0)\n      b[j] = 1;\n    else {\n      b[j] = sum + 1;\n    }\n  }\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "10", "index": "17858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, max, f[26], g[26];\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &g[i]);\n    f[i] = 0;\n  }\n  f[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    max = 0;\n    for (j = i + 1; j <= n; j++)\n      if ((g[j] <= g[i]) && (f[j] > max))\n        max = f[j];\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > max)\n      max = f[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, a[25], i, b[25], j, p, max = 0, q, t;\n  for (t = 0; t < 25; t++)\n    b[t] = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (j = k - 2; j >= 0; j--) {\n    for (p = j + 1; p < k; p++) {\n      if (a[p] <= a[j] && b[j] < b[p] + 1)\n        b[j] = b[p] + 1;\n    }\n  }\n  for (q = 0; q < k; q++) {\n    if (b[q] > max)\n      max = b[q];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17860", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30], i, b[30], j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n\n    {\n      if (a[j] >= a[i]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    if (b[j] > b[j + 1])\n      b[j + 1] = b[j];\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "10", "index": "17861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, max = 0, u, j, a[26] = {0}, b[26] = {1};\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    b[i] = 1;\n  for (i = k - 1; i >= 1; i--)\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n      u = b[i];\n    }\n  for (i = 1; i <= k; i++)\n    max = (max >= b[i]) ? max : b[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17862", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int w[30];\n  int f[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &w[i]);\n  w[0] = 99999;\n  f[0] = 0;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (w[j] >= w[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n      }\n  }\n  int m = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > m)\n      m = f[i];\n  printf(\"%d\", m);\n\n  return 0;\n}\n"}
{"label": "10", "index": "17863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, c, d;\n  cin >> n;\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    d = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[i] >= a[j])\n        if (b[j] > d)\n          d = b[j];\n    b[i] = b[i] + d;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > c)\n      c = b[i];\n  cout << c;\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m = 0, n, max = 0;\n  int a[25], t[25] = {0}, s[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  t[k - 1] = 1;\n  if (k == 1)\n    printf(\"1\\n\");\n  else {\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j < k; j++) {\n        if (a[j] <= a[i]) {\n          s[m] = t[j];\n          m++;\n        }\n      }\n      m = 0;\n      max = s[0];\n      for (n = 1; n < 25; n++) {\n        if (s[n] > max)\n          max = s[n];\n      }\n      for (j = 0; j < 25; j++)\n        s[j] = 0;\n      t[i] = max + 1;\n    }\n\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (t[i] > max)\n        max = t[i];\n    }\n    printf(\"%d\\n\", max);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17865", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50] = {0};\n  int f[50], max, i, j, n;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n        else\n          f[i] = f[i];\n      }\n    }\n  }\n  max = f[0];\n  for (i = 1; i < n; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d \", max);\n}\n"}
{"label": "10", "index": "17866", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int f[26], maxnum = 1, i, j, h[26], n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> h[i];\n    f[i] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (h[j] >= h[i])\n        f[i] = max(f[i], f[j] + 1);\n    maxnum = max(maxnum, f[i]);\n  }\n  cout << maxnum;\n  return 0;\n}\n"}
{"label": "10", "index": "17867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100], max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n  }\n  for (i = 0; i < 100; i++)\n    m[i] = 1;\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[j] + 1 >= m[i])) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = k - 1; p >= 0; p--) {\n    if (m[p] >= max) {\n      max = m[p];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30], i, b[30], j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n\n    {\n      if (a[j] >= a[i]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (b[j] > b[j + 1])\n      b[j + 1] = b[j];\n  }\n  cout << b[n - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17869", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[100], b[100], bm = -1;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && (b[j] + 1) > b[i])\n        b[i] = (b[j] + 1);\n    if (b[i] > bm)\n      bm = b[i];\n  }\n  cout << bm;\n  return 0;\n}\n"}
{"label": "10", "index": "17870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int q[100] = {\n      0,\n  };\n  int j, k;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i, k = i; j < n; j++) {\n      if (a[j] <= a[i] && q[k] <= q[j])\n        k = j;\n    }\n    if (k != i)\n      q[i] = q[k] + 1;\n  }\n  for (i = 0, k = 0; i < n; i++) {\n    if (q[k] < q[i])\n      k = i;\n  }\n  printf(\"%d\", q[k] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, max = 0, a[26] = {0}, b[26] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  max = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[30];\nint b[30];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n\n  b[0] = 1;\n  int tmp;\n  for (i = 1; i < n; ++i) {\n    tmp = 0;\n    for (j = 0; j < i; ++j) {\n      if (a[j] >= a[i] && b[j] > tmp) {\n        tmp = b[j];\n      }\n    }\n    b[i] = tmp + 1;\n  }\n\n  tmp = -1;\n  for (i = 0; i < n; ++i) {\n    if (b[i] > tmp) {\n      tmp = b[i];\n    }\n  }\n  printf(\"%d\\n\", tmp);\n  return 0;\n}\n"}
{"label": "10", "index": "17873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, a[100], b = 0, max_1 = 0;\n\nvoid fun(int x, int m) {\n  int i;\n  if (x == 0) {\n    if (b > max_1) {\n      max_1 = b;\n    }\n  } else if (a[x] < m) {\n    fun(x - 1, m);\n  } else if (a[x] >= m) {\n    for (i = x; i >= 1; i--) {\n      if (a[i] >= m) {\n        b++;\n        fun(i - 1, a[i]);\n        b--;\n      }\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  fun(n, 0);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "17874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  int a[100], b[100];\n  scanf(\"%d\", &n);\n  max = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] > a[j])\n        continue;\n      if (b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "17875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25], b[25];\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17876", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint set_1(int i);\nint num = 0;\nint currH = 100000;\nint MaxNum = 0;\nint a[100];\nint b[100];\nint main() {\n  int i;\n  for (i = 0; i < 100; i++) {\n    b[i] = 0;\n  }\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int j;\n    cin >> j;\n    a[i] = j;\n  }\n  set_1(0);\n  cout << MaxNum;\n  return 0;\n}\n\nint set_1(int i) {\n  int lastNum = num;\n  int lastcurrH = currH;\n  if (i == k - 1) {\n    if (a[i] <= currH)\n      num++;\n    if (num > MaxNum)\n      MaxNum = num;\n    num = lastNum;\n    currH = lastcurrH;\n    return 0;\n  }\n  if (b[i] == 0) {\n    set_1(i + 1);\n  }\n  b[i]++;\n\n  if (b[i] == 1) {\n    if (a[i] <= currH) {\n      currH = a[i];\n      num++;\n    }\n    set_1(i + 1);\n  }\n\n  num = lastNum;\n  currH = lastcurrH;\n  b[i] = 0;\n  return 0;\n}\n"}
{"label": "10", "index": "17877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "10", "index": "17878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, max = 0, a[26] = {0}, b[26] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  max = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17879", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, a[25], b[25];\n  int i, j, p, q;\n  int tmp, max;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (p = 1; p < k; p++) {\n    for (q = 0; q < p; q++) {\n      if (a[p] <= a[q]) {\n        tmp = b[q] + 1;\n        if (tmp > b[p])\n          b[p] = tmp;\n      }\n    }\n  }\n  max = 1;\n  for (j = 1; j < k; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[30];\n  int num[30];\n  int i;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    num[i] = 0;\n  }\n  int max = 0;\n  for (i = k; i >= 1; i--) {\n    int m = 0;\n    for (int j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && num[j] > m)\n        m = num[j];\n    }\n    num[i] = 1 + m;\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "17881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint main() {\n  int max(int k, int n);\n  int i, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (max(i, n) > m)\n      m = max(i, n);\n  }\n  printf(\"%d\", m);\n  return 0;\n}\nint max(int k, int n) {\n  int l = 0, j;\n  if (k == n - 1) {\n    l = 0;\n  }\n  for (j = k + 1; j < n; j++) {\n    if (a[j] <= a[k]) {\n      if (max(j, n) > l)\n        l = max(j, n);\n    }\n  }\n  return l + 1;\n}\n"}
{"label": "10", "index": "17882", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char g;\n  int c, d, f, a[25], b[25], k, e[25];\n  e[0] = 1;\n  scanf(\"%d\", &k);\n  for (c = 0;; c++) {\n    scanf(\"%d%c\", &a[c], &g);\n    if (g != ' ')\n      break;\n    else\n      ;\n  }\n  for (c = 0; c <= k - 1; c++) {\n    b[c] = a[k - 1 - c];\n  }\n\n  for (c = 1; c <= k - 1; c++) {\n    for (d = 0, e[c] = 0; d <= c - 1; d++) {\n      if (b[c] >= b[d] && e[c] <= e[d])\n        e[c] = e[d];\n      else\n        ;\n    }\n    e[c]++;\n  }\n  \n  \n  \n  \n  for (c = 0, f = e[0]; c <= k - 1; c++) {\n    if (f <= e[c])\n      f = e[c];\n    else\n      ;\n  }\n  printf(\"%d\", f);\n}\n"}
{"label": "10", "index": "17883", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, p, a[50], b[50];\n  cin >> n;\n  p = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (p < b[i])\n      p = b[i];\n  printf(\"%d\", p);\n}\n"}
{"label": "10", "index": "17884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[1000], f[1000] = {0}, n, longest_index = -1, longest_f = -1;\n\nint main() {\n  int i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", &a[i]);\n\n  {\n    int i, j;\n    for (i = 0; i < n; ++i)\n      f[i] = 1;\n    for (i = n - 2; i >= 0; --i) {\n      for (j = i + 1; j < n; ++j) {\n        if ((f[i] < f[j] + 1) && (a[i] >= a[j])) {\n          f[i] = f[j] + 1;\n          if (longest_f < f[i]) {\n            longest_f = f[i];\n            longest_index = i;\n          }\n        }\n      }\n    }\n  }\n\n  cout << longest_f << \" \";\n}\n"}
{"label": "10", "index": "17885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int h[], int a[], int i) {\n  int t, j;\n  for (j = 0, t = 0; j < i; j++)\n    if (h[j] >= h[i] && a[j] > t)\n      t = a[j];\n  a[i] = t + 1;\n}\nint main() {\n  int a[25], k, h[25], t, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    f(h, a, i);\n  for (i = 0, t = 0; i < k; i++)\n    if (a[i] > t)\n      t = a[i];\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, N;\n  int b[30] = {0}, a[30] = {0};\n  scanf(\"%d\", &N);\n  for (i = 1; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int m = 0;\n    for (int j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (m < b[j])\n          m = b[j];\n      }\n    }\n    b[i] = m + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= N; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, f[25] = {1}, t = 0;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n      else if (f[i] == 0)\n        f[i] = 1;\n  for (i = 0; i < k; i++)\n    if (t < f[i])\n      t = f[i];\n  cout << \"\\n\" << t;\n  return 0;\n}\n"}
{"label": "10", "index": "17888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max, h[25], t[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    t[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (h[i] >= h[j] && t[i] <= t[j])\n        t[i] = t[j] + 1;\n  for (max = 0, i = 0; i < k; i++)\n    if (t[i] > max)\n      max = t[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "17889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint haha(int a[], int b[], int k) {\n  int i, j, c = 0;\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        c = max(c, b[j]);\n    }\n    b[i] = c + 1;\n    c = 0;\n  }\n  for (i = k - 1; i > -1; i--)\n    c = max(c, b[i]);\n  return c;\n}\nint main() {\n  int a[25], b[25] = {0}, k, i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", haha(a, b, k));\n}\n"}
{"label": "10", "index": "17890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, flag = 0;\n  int a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = n - 1; j >= i; j--) {\n      if (a[i] >= a[j]) {\n        flag = 1;\n        if (b[i] < b[j])\n          b[i] = b[j];\n      }\n    }\n    b[i] = b[i] + 1;\n    if (flag == 0) {\n      b[i] = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  printf(\"%d\", b[0] - 1);\n}\n"}
{"label": "10", "index": "17891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int a[25], b[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int max = 1;\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    t = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && t < b[j] + 1)\n        t = b[j] + 1;\n    b[i] = t;\n    max = b[i] > max ? b[i] : max;\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[30], count = 0, n, temp, i;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &temp);\n    for (i = 0; i < count; i++)\n      if (temp > a[i]) {\n        a[i] = temp;\n        break;\n      }\n    if (i >= count) {\n      a[i] = temp;\n      count++;\n    }\n  }\n  cout << count << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25];\n  int i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      j = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = j;\n    }\n  }\n  cout << b[k - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17894", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int a[25], b[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int max = 1;\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    t = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && t < b[j] + 1)\n        t = b[j] + 1;\n    b[i] = t;\n    max = b[i] > max ? b[i] : max;\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 30;\nint h[maxn];\nint f[maxn];\nint main() {\n  int n;\n\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  f[1] = 1;\n  int j;\n  int max = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (h[i] <= h[j]) {\n        if (max < f[j])\n          max = f[j];\n      }\n    }\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < f[i])\n      max = f[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint dp[100];\nint main(void) {\n  int i, j, k;\n  int *h;\n  int max;\n  scanf(\"%d\", &k);\n  h = (int *)malloc((k + 1) * sizeof(int));\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n\n  dp[k] = 0;\n  for (i = k - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k; j++) {\n      if (h[i] >= h[j]) {\n        if (dp[j] + 1 > max)\n          max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  int m = 0;\n  for (i = 0; i <= k; i++) {\n    if (dp[i] > m)\n      m = dp[i];\n  }\n  printf(\"%d\", m + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25];\n  int b[25];\n  int k, i, j, max2, max1;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  b[0] = 1;\n  for (i = 1; i < k; i++) {\n    max1 = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] <= a[j]) {\n        if (max1 < (b[j] + 1)) {\n          max1 = b[j] + 1;\n        }\n      }\n    }\n    b[i] = max1;\n  }\n  max2 = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max2) {\n      max2 = b[i];\n    }\n  }\n  cout << max2 << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17898", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a < b)\n    return b;\n  else\n    return a;\n}\nint main() {\n  int num;\n  int h[100];\n  scanf(\"%d \", &num);\n  int i, j, k;\n  for (i = 0; i < num; i++)\n    cin >> h[i];\n  int f[100] = {0};\n  f[0] = 1;\n  for (i = 1; i < num; i++) {\n    f[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j])\n        f[i] = max(f[i], f[j] + 1);\n    }\n  }\n  int result = f[0];\n  for (i = 1; i < num; i++) {\n    result = max(f[i], result);\n  }\n  printf(\"%d\\n\", result);\n}\n"}
{"label": "10", "index": "17899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint arr[30];\nint num[30];\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> arr[i];\n  for (int i = 0; i < k; i++)\n    num[i] = 1;\n  for (int i = 0; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (arr[j] >= arr[i] && num[j] >= num[i])\n        num[i] = num[j] + 1;\n    }\n  }\n  int res = -1;\n  for (int i = 0; i < k; i++)\n    if (num[i] > res)\n      res = num[i];\n  cout << res << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25] = {0}, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (j = n - i; j <= n - 1; j++) {\n      if (a[n - 1 - i] >= a[j]) {\n        if (b[n - i - 1] < b[j] + 1)\n          b[n - i - 1] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint lanjie(int x, int p);\nint max(int b);\nint n, t = 0, h[25], r[25][10000];\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d\", lanjie(0, 10000));\n  return 0;\n}\nint lanjie(int x, int p) {\n  if (r[x][p])\n    return r[x][p];\n  else if (x == n - 1) {\n    if (h[x] <= p)\n      return r[x][p] = 1;\n    else\n      return r[x][p] = 0;\n  } else {\n    int f;\n    if (h[x] <= p) {\n      f = max(1 + lanjie(x + 1, h[x]), lanjie(x + 1, p));\n    } else\n      f = lanjie(x + 1, p);\n    return r[x][p] = f;\n  }\n}\nint max(int a, int b) { return (a > b) ? a : b; }\n"}
{"label": "10", "index": "17902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[25], b[25] = {0}, m, i, j;\n  cin >> k;\n  for (i = 0; i <= k - 1; i++)\n    cin >> a[i];\n  for (i = k - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i; j <= k - 1; j++)\n      if (a[i] >= a[j] && m <= b[j])\n        m = b[j];\n    b[i] = m + 1;\n  }\n  m = b[0];\n  for (i = 0; i <= k - 1; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "17903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t;\n  int *p, *max;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  max = (int *)malloc(k * sizeof(int));\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", p + i);\n\n  for (i = 0; i <= k - 1; i++) {\n    t = 0;\n    for (j = 0; j < i; j++)\n      if (*(p + j) >= *(p + i))\n        if (t < *(max + j))\n          t = *(max + j);\n    *(max + i) = t + 1;\n  }\n\n  t = 0;\n  for (i = 0; i <= k - 1; i++)\n    if (*(max + i) > t)\n      t = *(max + i);\n  cout << t;\n}\n"}
{"label": "10", "index": "17904", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m, temp;\n  int a[26], g[26];\n\n  scanf(\"%d\\n\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (m = 1; m <= k; m++)\n    g[m] = 1;\n\n  for (n = k - 1; n > 0; n--) {\n    for (j = n + 1; j <= k; j++) {\n      if (a[n] >= a[j] && g[n] - 1 < g[j]) {\n        g[n] = g[j] + 1;\n      }\n    }\n  }\n\n  for (i = 1; i < k; i++) {\n    for (j = i + 1; j <= k; j++)\n      if (g[i] < g[j]) {\n        temp = g[i];\n        g[i] = g[j];\n        g[j] = temp;\n      }\n  }\n  printf(\"%d\", g[1]);\n}\n"}
{"label": "10", "index": "17905", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint Height[26];\nint MaxLen[26];\n\nvoid LIS(int k) {\n  memset(MaxLen, 0, sizeof(MaxLen));\n  for (int i = 1; i <= k; i++) {\n    MaxLen[i] = 1;\n\n    for (int j = 1; j < i; j++) {\n\n      if (Height[i] <= Height[j]) {\n\n        int preMax = MaxLen[j] + 1;\n        if (preMax > MaxLen[i]) {\n          MaxLen[i] = preMax;\n        }\n      }\n    }\n  }\n}\n\nint main() {\n  int N, i;\n  scanf(\"%d\", &N);\n\n  for (i = 1; i <= N; i++) {\n    scanf(\"%d\", &Height[i]);\n  }\n  LIS(N);\n  int Max = -1;\n\n  for (i = 1; i <= N; i++) {\n    if (Max < MaxLen[i]) {\n      Max = MaxLen[i];\n    }\n  }\n  if (N != 0) {\n    printf(\"%d\\n\", Max);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "17906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int a[], int n) {\n  int z, i, j, t, temp, r;\n  int b[25];\n  if (n == 1)\n    z = 1;\n  else if (n == 0)\n    z = 0;\n  else {\n    for (i = 0, r = 0; i < n; i++) {\n      for (j = i + 1, t = 0; j < n; j++)\n        if (a[j] <= a[i]) {\n          b[t] = a[j];\n          t++;\n        }\n      temp = max(b, t) + 1;\n      if (temp > r)\n        r = temp;\n    }\n    z = r;\n  }\n  return z;\n}\n\nint main() {\n  int k, t, i;\n  int bomb[25];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++)\n    cin >> bomb[i];\n  t = max(bomb, k);\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17907", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N, input[26], i, j, k, ans[26], Max;\nint cons(int i) {\n  int a = 0;\n  if (ans[i] != 0)\n    return ans[i];\n  for (int j = i + 1; j < N; j++) {\n    if (input[j] <= input[i])\n      if (a < cons(j))\n        a = ans[j];\n  }\n  ans[i] = a + 1;\n  return ans[i];\n}\nint main() {\n  Max = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &input[i]);\n    ans[i] = 0;\n  }\n  for (i = N - 1; i >= 0; i--) {\n    if (Max < cons(i))\n      Max = ans[i];\n  }\n  printf(\"%d\\n\", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "17908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int x, int y);\nint max(int x, int y) {\n  int z;\n  if (x > y) {\n    z = x;\n  } else\n    z = y;\n  return (z);\n}\n\nint main() {\n  int a[25] = {0};\n  int c[25];\n  int Height, k;\n  int n;\n  scanf(\"%d\", &k);\n  {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &Height);\n      a[n] = Height;\n      c[n] = 1;\n    }\n  }\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[j] <= a[i]) && (c[i] < c[j] + 1))\n        c[i] = c[j] + 1;\n    }\n  }\n\n  int cMax = c[0];\n  {\n    for (i = 0; i <= k - 1; i++) {\n      cMax = cMax > c[i] ? cMax : c[i];\n    }\n    printf(\"%d\", cMax);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[30];\n  int i;\n  for (i = n - 1; i >= 0; i--)\n    cin >> a[i];\n\n  int b[30];\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1) {\n\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  int n[25];\n  for (i = 0; i <= 24; i++)\n    n[i] = 1;\n  n[k - 1] = 1;\n  int j, m;\n  for (j = k - 2; j >= 0; j--) {\n    for (m = k - 1; m >= j + 1; m--) {\n\n      if (a[m] <= a[j] && n[m] >= n[j] - 1)\n        n[j] = n[m] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < n[i])\n      max = n[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Max(int n, int a[]) {\n  int x = 0;\n  for (int i = 0; i < n; i++) {\n    if (x < a[i])\n      x = a[i];\n  }\n  return x;\n}\nint main() {\n  int x, n, i, j, b = 1;\n  int *p;\n  int *q;\n  scanf(\"%d \", &n);\n  p = (int *)malloc(n * sizeof(int));\n  q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (i = n - 1; i >= 0; i--) {\n\n    {\n      x = 0;\n      for (j = i + 1; j < n; j++) {\n        if ((p[i] >= p[j]) && (x < q[j]))\n          x = q[j];\n      }\n      q[i] = x + 1;\n    }\n  }\n  cout << Max(n, q);\n}\n"}
{"label": "10", "index": "17912", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int *a = (int *)malloc(sizeof(int) * k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  int count[30] = {0};\n  int max;\n  max = 0;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[j] <= a[i] && count[i] < count[j] + 1) {\n        count[i] = count[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (max < count[i])\n      max = count[i];\n  }\n  printf(\"%d\", max + 1);\n  free(a);\n  return 0;\n}\n"}
{"label": "10", "index": "17913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lj(int a[], int n, int m);\n  int n, m, i, j, l, k = 0, s, t = 0, a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    b[i] = lj(a, i, k);\n  for (i = 0; i < k; i++) {\n    if (t < b[i])\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n  getchar();\n}\nint lj(int a[], int n, int m) \n{\n  int i, t, p, l = 0, b[25];\n  if (n == m - 1)\n    return 1;\n  else {\n    for (i = 0; i < 25; i++)\n      b[i] = 0;\n    for (i = n + 1; i < m; i++) {\n      if (a[i] <= a[n]) {\n        b[i] = lj(a, i, m);\n      }\n    }\n    t = b[n + 1];\n    for (i = n + 1; i < m; i++) {\n      if (t < b[i])\n        t = b[i];\n    }\n    return t + 1;\n  }\n}\n"}
{"label": "10", "index": "17914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, i, j, t;\n  int a[26], b[26], c[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        c[j] = b[j] + 1;\n      else\n        c[j] = 1;\n      for (m = j; m > 0; m--) {\n        if (c[m] >= c[m - 1]) {\n          t = c[m - 1];\n          c[m - 1] = c[m];\n          c[m] = t;\n        }\n      }\n      b[i] = c[0];\n    }\n\n  for (i = k - 1; i > 0; i--)\n    if (b[i] >= b[i - 1]) {\n      t = b[i - 1];\n      b[i - 1] = b[i];\n      b[i] = t;\n    }\n  cout << b[0];\n}\n"}
{"label": "10", "index": "17915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, most;\n  int a[25], f[25];\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  f[0] = 1;\n  for (int i = 1; i < k; i++) {\n    most = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] > most) {\n          most = f[j];\n        }\n      }\n    }\n    f[i] = most + 1;\n  }\n  most = 0;\n  for (int i = 0; i < k; i++) {\n    if (f[i] > most)\n      most = f[i];\n  }\n  cout << most << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, t, j, n, a[25], p[25], max_p, max;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  t = i;\n\n  for (i = t - 1; i >= 0; i--) {\n    max_p = 0;\n    for (j = t - 1; j > i; j--)\n      if (a[i] >= a[j] && p[j] > max_p)\n        max_p = p[j];\n    p[i] = max_p + 1;\n  }\n\n  max = p[0];\n  for (i = 1; i < t; i++)\n    if (p[i] > max)\n      max = p[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y);\nint max(int x, int y) {\n  int z;\n  if (x > y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint main() {\n  int a[25] = {0};\n  int c[25];\n  int Height, k;\n  int n;\n  scanf(\"%d\", &k);\n  {\n    for (n = 0; n < k; n++) {\n      cin >> Height;\n      a[n] = Height;\n      c[n] = 1;\n    }\n  }\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[j] <= a[i]) && (c[i] < c[j] + 1))\n        c[i] = c[j] + 1;\n    }\n  }\n\n  int cMax = c[0];\n  {\n    for (i = 0; i <= k - 1; i++) {\n      cMax = cMax > c[i] ? cMax : c[i];\n    }\n    printf(\"%d\", cMax);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "17918", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct dian {\n  int h;\n  int x;\n};\nint Compare(const void *elem1, const void *elem2) {\n  struct dian *p1, *p2;\n  p1 = (struct dian *)elem1;\n  p2 = (struct dian *)elem2;\n  return (*p2).h - (*p1).h;\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  struct dian *d = (struct dian *)malloc(sizeof(struct dian) * (n));\n  int *a = (int *)malloc(sizeof(int) * (n));\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d[i].h);\n    d[i].x = i;\n  }\n  qsort(d, n, sizeof(struct dian), Compare);\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].h == d[j].h && d[i].x > d[j].x) {\n        struct dian c;\n        c.x = d[i].x;\n        d[i].x = d[j].x;\n        d[j].x = c.x;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].x < d[j].x) {\n        if (a[i] < a[j] + 1)\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  int max = a[0];\n  for (k = 0; k < n; k++) {\n    if (a[k] > max)\n      max = a[k];\n  }\n  printf(\"%d\", max);\n  free(d);\n  free(a);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "17919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[27], b[27], n, i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k + 1; i++)\n    b[i] = 0;\n  for (i = k; i >= 1; i--) {\n    for (j = i + 1; j <= k + 1; j++) {\n      if (a[i] >= a[j] && b[j] >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  n = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] > n)\n      n = b[i];\n  }\n  if (k == 25)\n    printf(\"%d\\n\", n + 1);\n  else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "17920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, j, i;\n  scanf(\"%d\", &m);\n  int *a, *b;\n  a = (int *)malloc(sizeof(int) * m);\n  b = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++) {\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (b[j] > b[i])\n          b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  t = 0;\n  for (i = 0; i < m; i++)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\\n\", t);\n}\n"}
{"label": "10", "index": "17921", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint result[40];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nvoid f(int a[], int n) {\n\n  int i, j, maxmium;\n  result[1] = 1;\n  for (i = 2; i <= n; i++) {\n    maxmium = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] >= a[i])\n        maxmium = max(result[j], maxmium);\n    }\n    result[i] = 1 + maxmium;\n  }\n}\n\nint main() {\n  int n, i, outcome = 0;\n  scanf(\"%d\", &n);\n  int a[40];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f(a, n);\n  for (i = 1; i <= n; i++)\n    outcome = max(outcome, result[i]);\n  printf(\"%d \", outcome);\n  return 0;\n}\n"}
{"label": "10", "index": "17922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25] = {0}, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (j = n - i; j <= n - 1; j++) {\n      if (a[n - 1 - i] >= a[j]) {\n        if (b[n - i - 1] < b[j] + 1) {\n          b[n - i - 1] = b[j] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint N;\nint tmp[27], flight[27];\n\nint main() {\n  scanf(\"%d \", &N);\n  for (int i = 0; i < N; i++)\n    cin >> tmp[i];\n  for (int i = 0; i < N; i++) {\n    flight[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (tmp[j] >= tmp[i] && flight[j] > flight[i])\n        flight[i] = flight[j];\n    flight[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < N; i++)\n    if (flight[i] > max)\n      max = flight[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17924", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = (b[i]);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, max = 0, u, j, a[26] = {0}, b[26] = {1};\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    b[i] = 1;\n  for (i = k - 1; i >= 1; i--)\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n      u = b[i];\n    }\n  for (i = 1; i <= k; i++)\n    max = (max >= b[i]) ? max : b[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nconst int maxk = 300;\n\nint main() {\n  int k;\n  int a[maxk];\n  int f[maxk];\n\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  int ans = 0;\n\n  f[0] = 1;\n\n  for (int i = 1; i < k; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    };\n    if (f[i] > ans)\n      ans = f[i];\n  };\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n};\n"}
{"label": "10", "index": "17927", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else {\n    return y;\n  }\n}\nint main() {\n  int num[30];\n  int r = 0;\n  int dp[30] = {0};\n\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d \", &num[i]);\n    dp[i] = 1;\n  }\n  for (int i = 2; i <= n; i++)\n    for (int j = 1; j < i; j++)\n      if (num[i] <= num[j]) {\n        dp[i] = max(dp[i], dp[j] + 1);\n        if (dp[i] > r)\n          r = dp[i];\n      }\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "17928", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint b[1000 + 10];\nint aMaxLen[1000 + 10];\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  for (i = N; i >= 1; i--)\n    scanf(\"%d\", &b[i]);\n  aMaxLen[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int nTmp = 0;\n    for (j = 1; j < i; j++) {\n      if (b[i] >= b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= N; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  printf(\"%d \", nMax);\n  return 0;\n}\n"}
{"label": "10", "index": "17929", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nunsigned int h[26], n;\nint go(int maxh, int cp) {\n  int x, y, max;\n  while (h[cp] > maxh)\n    cp = cp + 1;\n  if (h[cp] == 0)\n    return 0;\n  x = go(maxh, cp + 1);\n  maxh = h[cp];\n  y = 1 + go(maxh, cp + 1);\n  max = (x > y) ? x : y;\n  return max;\n}\nint main() {\n  unsigned int i, c, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  h[n] = 0;\n  t = go(65535, 0);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point])\n            sum2++;\n        if (sum1 > sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int h[], int a[], int i) {\n  int t, j;\n  for (j = 0, t = 0; j < i; j++)\n    if (h[j] >= h[i] && a[j] > t) {\n      t = a[j];\n    }\n  a[i] = t + 1;\n}\nint main() {\n  int a[25], k, h[25], t, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    f(h, a, i);\n  for (i = 0, t = 0; i < k; i++)\n    if (a[i] > t)\n      t = a[i];\n  cout << t << \"\\n\";\n}\n"}
{"label": "10", "index": "17932", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(int x, int y) {\n  if (x <= y)\n    x = y + 1;\n  return x;\n}\nint main() {\n  int i, n, r, a, j;\n  cin >> n;\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  int *q = (int *)malloc(n * sizeof(int));\n\n  for (j = n - 1; j >= 0; j--) {\n    q[j] = 1;\n    for (r = n - 1; r != j; r--) {\n      if (p[j] >= p[r])\n        q[j] = compare(q[j], q[r]);\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 1; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dd[25];\nint k;\nint maxnum = 0;\n\nvoid fun(int p, int num, int hight) {\n  if (p > k) {\n    if (num > maxnum)\n      maxnum = num;\n    return;\n  }\n  if (dd[p] <= hight) {\n    fun(p + 1, num + 1, dd[p]);\n    fun(p + 1, num, hight);\n  } else\n    fun(p + 1, num, hight);\n  return;\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> dd[i];\n  fun(0, 0, 65535);\n  cout << maxnum - 1 << endl;\n}\n"}
{"label": "10", "index": "17934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max = 0, i, j, n, maxb, num = 0, s, a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    s = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= max)) {\n        b[i] = b[j] + 1;\n        max = b[j];\n        s = 1;\n      }\n      if (s == 0) {\n        b[i] = 1;\n      }\n    }\n  }\n  maxb = 0;\n  for (i = 0; i < n; i++) {\n\n    if (b[i] > maxb) {\n      maxb = b[i];\n    }\n  }\n  cout << maxb << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, height[30], num[30], j, max = -1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    num[i] = 1;\n  for (i = 1; i < n; i++)\n    for (j = i - 1; j >= 0; j--) {\n      if (height[j] >= height[i] && num[j] + 1 > num[i])\n        num[i] = num[j] + 1;\n    }\n  for (i = 1; i < n; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int a[26] = {0}, b[26] = {0};\n  int i, j, r;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 1; i--) {\n    r = 0;\n    for (j = i; j <= k; j++) {\n      if (a[i] >= a[j])\n        r = b[j] + 1;\n      if (b[i] < r)\n        b[i] = r;\n    }\n  }\n  r = 0;\n  for (i = 1; i <= k; i++)\n    if (b[i] > r)\n      r = b[i];\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "17937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, c, d;\n  cin >> n;\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = n - 2; i >= 0; i--) {\n    d = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[i] >= a[j])\n        if (b[j] > d)\n          d = b[j];\n    b[i] = b[i] + d;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > c)\n      c = b[i];\n  cout << c;\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint main() {\n  int max(int k, int n);\n  int i, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (max(i, n) > m)\n      m = max(i, n);\n  }\n  printf(\"%d\", m);\n  return 0;\n}\nint max(int k, int n) {\n  int l = 0, j;\n  if (k == n - 1)\n    l = 0;\n\n  for (j = k + 1; j < n; j++) {\n    if (a[j] <= a[k]) {\n      if (max(j, n) > l)\n        l = max(j, n);\n    }\n  }\n  return l + 1;\n}\n"}
{"label": "10", "index": "17939", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int m[25];\n  int s[25][25];\n\n  cin >> k;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "17940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int s[], int n);\nint main() {\n  int k, a[25], i, N;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  N = f(a, k);\n  printf(\"%d\", N);\n}\n\nint f(int s[], int n) {\n  int i, b[25], j;\n  int flag = 0, flag2 = 0;\n  int *p = s;\n  for (i = 0; i < n - 1; i++)\n    if (s[i] < s[i + 1]) {\n      flag = 1;\n      break;\n    }\n  if (flag == 0)\n    return n;\n  else {\n    for (i = 1; i < n; i++) {\n      if (s[i] > s[0]) {\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 0)\n      return f(p + 1, n - 1) + 1;\n    else {\n      b[0] = s[0];\n      for (i = 1, j = 1; i < n; i++)\n        if (s[i] <= s[0]) {\n          b[j] = s[i];\n          j++;\n        }\n\n      return ((f(p + 1, n - 1)) > f(b, j) ? (f(p + 1, n - 1)) : f(b, j));\n    }\n  }\n}\n"}
{"label": "10", "index": "17941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[50], b[50];\n  scanf(\"%d\", &n);\n  p = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (p < b[i])\n      p = b[i];\n  printf(\"%d\", p);\n}\n"}
{"label": "10", "index": "17942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, g, h, p, q = 0, a[25], b[25], c[25];\n  for (i = 0; i < 25; i++)\n    b[i] = 1;\n  i = 0;\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[0]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  if (k == 1 || k == 0)\n    printf(\"%d\", k);\n  else {\n    for (j = k - 2; j >= 0; j--) {\n      for (p = j + 1; p < k; p++) {\n        if (a[j] >= a[p]) {\n          c[q] = b[p];\n          q++;\n        }\n      }\n      if (q == 0)\n        b[j] = 1;\n      else if (q == 1)\n        b[j] = c[0] + b[j];\n      else {\n        for (g = 0; g < q - 1; g++) {\n          m = c[g];\n          n = c[g + 1];\n          if (m > n) {\n            c[g] = n;\n            c[g + 1] = m;\n          }\n        }\n        b[j] = c[q - 1] + b[j];\n        q = 0;\n        g = 0;\n        p = j;\n      }\n    }\n    for (h = 0; h < k - 1; h++) {\n      m = b[h];\n      n = b[h + 1];\n      if (m > n) {\n        b[h] = n;\n        b[h + 1] = m;\n      }\n    }\n    printf(\"%d\", b[k - 1]);\n  }\n}\n"}
{"label": "10", "index": "17943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h[25], n, i, j, t, d[25] = {0}, max = 0, in;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (h[j] <= h[i] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] > max) {\n      max = d[i];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[28], b[28][28] = {0}, i, j, l, t, z = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (l = 1; l <= n; l++) {\n    b[l][l] = 1;\n    for (i = l; i <= n; i++) {\n      z = 0;\n      for (j = i - 1; j > l - 1; j--)\n        if (a[j] >= a[i] && b[l][j] >= b[l][i]) {\n          b[l][i] = b[l][j] + 1;\n          z = 1;\n        }\n      if (z == 0)\n        b[l][i] = 1;\n    }\n  }\n  t = b[1][1];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (b[i][j] > t)\n        t = b[i][j];\n    }\n  cout << t;\n}\n"}
{"label": "10", "index": "17945", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint min(int a[]) {\n  int n = 0, i, x = a[0];\n  while (a[n] != 0)\n    n++;\n\n  for (i = 0; i <= n - 1; i++)\n    if (x > a[i])\n      x = a[i];\n\n  return x;\n}\n\nint f(int a[]) {\n  int n = 0;\n  while (a[n] != 0)\n    n++;\n\n  if (n == 1)\n    return 1;\n  else {\n    int b[25], c[25], i;\n    if (a[n - 1] == min(a)) {\n      for (i = 0; i <= n - 2; i++)\n        b[i] = a[i];\n      b[n - 1] = 0;\n\n      return 1 + f(b);\n    } else {\n      int k = 0;\n      for (i = 0; i <= n - 1; i++) {\n        if (a[i] != min(a)) {\n          b[k] = a[i];\n          k++;\n        }\n      }\n      b[k] = 0;\n\n      do\n        n--;\n      while (a[n] != min(a));\n      for (i = 0; i <= n; i++)\n        c[i] = a[i];\n      c[n + 1] = 0;\n\n      return f(b) > f(c) ? f(b) : f(c);\n    }\n  }\n}\n\nint main(void) {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k <= n - 1; k++)\n    scanf(\"%d\", &a[k]);\n  a[n] = 0;\n\n  printf(\"%d\\n\", f(a));\n}\n"}
{"label": "10", "index": "17946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  q[n - 1] = 1;\n  int best = q[n - 1];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    int a = 0;\n    for (int k = n - 1; k > i; k--) {\n      if (p[i] >= p[k] && q[k] >= a)\n        a = q[k];\n    }\n    q[i] = a + 1;\n    if (q[i] > best)\n      best = q[i];\n  }\n  printf(\"%d \", best);\n}\n"}
{"label": "10", "index": "17947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint aa(int high[], int n, int k, int lh, int point) {\n  int remax = 0, a = 0, i;\n  if (point == k - 1) {\n    if (lh >= high[k - 1])\n      return 1;\n    else\n      return 0;\n  } else {\n    for (i = point; i < k; i++)\n      if (high[i] <= lh) {\n        a = aa(high, n + 1, k, high[i], i + 1) + 1;\n        if (a > remax)\n          remax = a;\n      }\n    return remax;\n  }\n}\n\nint main() {\n  int i, high[25], k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &high[i]);\n  printf(\"%d\", aa(high, 0, k, 32767, 0));\n}\n"}
{"label": "10", "index": "17948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k;\nint num[26];\nint val[26];\nint main() {\n\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> num[i];\n    val[i] = 0;\n  }\n\n  for (int i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      val[i] = 1;\n    else {\n      int temp = 0;\n      for (int j = i; j < k; j++) {\n        if (num[i] >= num[j] && val[j] >= temp) {\n          temp = val[j];\n        }\n      }\n      val[i] = temp + 1;\n    }\n  }\n  int sum = 0;\n  for (int i = 0; i < k; i++) {\n\n    if (val[i] >= sum)\n      sum = val[i];\n  }\n  cout << sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Max = 1, max_1 = 0, k, *p;\nvoid f(int x) {\n  int i;\n  int height = *(p + x);\n  if (max_1 > Max) {\n    Max = max_1;\n  }\n  for (i = x + 1; i < k; i++) {\n    if (*(p + i) <= height) {\n      max_1 += 1;\n      f(i);\n      max_1 -= 1;\n    }\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; k - i > Max, i < k; i++) {\n    max_1 += 1;\n    f(i);\n    max_1 -= 1;\n  }\n  cout << Max << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "17950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[25], b[25], c, n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (((b[j] + 1) > b[i]) && (a[j] >= a[i]))\n        b[i] = b[j] + 1;\n    }\n  }\n  c = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  printf(\"%d \", c);\n  return 0;\n}\n"}
{"label": "10", "index": "17951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[25], b[25];\n  int n, i, j;\n  int max = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++)\n      if ((b[i] <= b[j]) && (a[i] <= a[j])) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17952", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int i, j, N, anNum[1000], anFlag[1000];\n  scanf(\"%d\", &N);\n  memset(anFlag, 1, sizeof(anFlag));\n  for (i = 0; i < N; i++) {\n    cin >> anNum[i];\n    anFlag[i] = 1;\n  }\n  for (i = N - 2; i >= 0; i--) {\n    int Max = 0;\n    for (j = i + 1; j < N; j++) {\n      if (anNum[i] >= anNum[j]) {\n        if (anFlag[j] > Max)\n          Max = anFlag[j];\n      }\n    }\n    anFlag[i] = Max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < N; i++)\n    if (anFlag[i] > Max)\n      Max = anFlag[i];\n  printf(\"%d \", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "17953", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint c[25], d[25], k;\nint D(int a) {\n  int m = 1;\n  for (int i = a + 1; i <= k - 1; i++)\n    if (c[i] <= c[a] && m < D(i) + 1)\n      m = D(i) + 1;\n  return m;\n}\n\nint main() {\n  int max = 0;\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &c[i]);\n  for (int i = k - 1; i >= 0; i--) {\n    d[i] = D(i);\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f[30];\nint a[30];\nint k;\n\nint main() {\n  int i, j;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i]) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n  }\n  j = f[0];\n  for (i = 1; i < k; i++) {\n    if (f[i] > j)\n      j = f[i];\n  }\n  cout << j << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max_1 = 0, n = 0;\nint a[30], line = 0, f[30] = {0}, b[30] = {0};\nint main() {\n  int k, i, n = 0;\n  void missile(int i, int k);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    if (line < a[i])\n      line = a[i];\n  }\n  missile(0, k);\n  printf(\"%d\", max_1);\n  return 0;\n}\nvoid missile(int i, int k) {\n  int j;\n  for (j = 0; j < 2; j++) {\n    if (j == 0 && i != k - 1) {\n      missile(i + 1, k);\n    } else {\n      if (a[i] <= line || i == k - 1) {\n        if (a[i] <= line) {\n          b[i] = line;\n          line = a[i];\n          n++;\n          f[i] = 1;\n        }\n        if (i == k - 1) {\n          if (max_1 < n) {\n            max_1 = n;\n          }\n          printf(\" \");\n        } else\n          missile(i + 1, k);\n        if (f[i] == 1) {\n          n--;\n          line = b[i];\n          f[i] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "17956", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  int k, a[25], i, j, max, b[25] = {1};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && b[j] + 1 >= max)\n        max = b[j] + 1;\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count_1[30], hgt[30], n, i, j, max_1, temp;\nvoid m(int s, int t);\nint main() {\n  for (i = 1; i <= 25; i++) {\n    count_1[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &hgt[i]);\n    count_1[1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (hgt[i] <= hgt[j]) {\n        if (temp < count_1[j])\n          temp = count_1[j];\n      }\n    }\n    count_1[i] = temp + 1;\n  }\n  max_1 = 0;\n  for (i = 1; i <= n; i++) {\n    if (max_1 < count_1[i]) {\n      max_1 = count_1[i];\n    }\n  }\n  printf(\"%d \", max_1);\n}\n"}
{"label": "10", "index": "17958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d \", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = n[i] > (n[j] + 1) ? n[i] : n[j] + 1;\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = m > n[i] ? m : n[i];\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "17959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint H[1000], D[1000];\nvoid sort(int i) {\n  int j, k, m, n;\n  for (j = 0; j <= i; j++) {\n    m = j;\n    for (k = j; k <= i; k++)\n      if (D[m] > D[k])\n        m = k;\n    if (m != j) {\n      n = D[j];\n      D[j] = D[m];\n      D[m] = n;\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "10", "index": "17960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint n;\nint sum(int k, int b) {\n  int x;\n  if (k == 0)\n    x = 0;\n  else if (k != 0) {\n    if ((a[n - k] <= b)) {\n      if ((sum(k - 1, a[n - k]) + 1) >= sum(k - 1, b)) {\n        b = a[n - k];\n        x = 1 + sum(k - 1, b);\n      } else\n        x = sum(k - 1, b);\n\n    } else if ((a[n - k] > b))\n      x = sum(k - 1, b);\n  }\n  return x;\n}\nint main() {\n  int i, j;\n  int c = 9999;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", sum(n, c));\n}\n"}
{"label": "10", "index": "17961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[26], h[26], k, i, j, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = max(n[i], n[j] + 1);\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, n[i]);\n  printf(\"%d\\n\", m);\n}\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\n"}
{"label": "10", "index": "17963", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint zui(int k, int m, int a[]) {\n  int s = 1, i = m + 1, max = 0;\n  if (m == k)\n    s = 1;\n  else {\n    for (i = m + 1; i <= k; i++) {\n      if (a[k - m] <= a[k - i]) {\n        if (max < zui(k, i, a))\n          max = zui(k, i, a);\n      }\n    }\n    s = s + max;\n  }\n  return s;\n}\nint main() {\n  int i, k, a[25], max = 0, s;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < k; i++) {\n    s = zui(k, i, a);\n    if (s > max)\n      max = s;\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint xxx(int high, int j);\nint max(int b, int c) {\n  if (b >= c)\n    return b;\n  else\n    return c;\n}\nint n;\nint x[26];\nint main() {\n  int i;\n  int m, k;\n  scanf(\"%d\", &n);\n  int h[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    x[i] = h[i];\n    \n  }\n  for (i = n; i < 26; i++)\n    x[i] = 999999;\n  int fly;\n  fly = xxx(999999, 0);\n  printf(\"%d\", fly);\n}\nint xxx(int high, int j) {\n  if (j == n - 1) {\n    if (high >= x[j])\n      return 1;\n    else\n      return 0;\n  } else {\n    if (high < x[j])\n      return xxx(high, j + 1);\n    else\n      return max(1 + xxx(x[j], j + 1), xxx(high, j + 1));\n  }\n}\n"}
{"label": "10", "index": "17965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, a[25], i, b[25], j, p, max = 0, q, t;\n  for (t = 0; t < 25; t++)\n    b[t] = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  b[k - 1] = 1;\n  for (j = k - 2; j >= 0; j--) {\n    for (p = j + 1; p < k; p++) {\n      if (a[p] <= a[j] && b[j] < b[p] + 1)\n        b[j] = b[p] + 1;\n    }\n  }\n  for (q = 0; q < k; q++) {\n    if (b[q] > max)\n      max = b[q];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "17966", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n, i, j, e, s, r, t;\n  int a[300], b[300];\n  cin >> k;\n  s = 1;\n  r = 1;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = i;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] < a[j]) {\n        e = a[i];\n        a[i] = a[j];\n        a[j] = e;\n        e = b[i];\n        b[i] = b[j];\n        b[j] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    n = b[i];\n    r = 1;\n    for (j = i + 1; j < k; j++) {\n      if (b[j] > n) {\n        r++;\n        n = b[j];\n      }\n    }\n    if (r > s) {\n      s = r;\n      t = i;\n    }\n  }\n  if (k == 25) {\n    s = s + 2;\n  };\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "17967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int d[25], f[25];\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &d[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (d[j] >= d[i] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n  }\n  int ans = -1;\n  for (int i = 0; i < n; i++)\n    if (ans < f[i])\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "17968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[99];\nint main() {\n  int f(int, int, int);\n  int i, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  max = f(99999, 0, 0);\n  printf(\"%d\\n\", max);\n  return 0;\n}\nint f(int hi, int num, int i) {\n  int t1, t2;\n  while (a[i] > hi)\n    i++;\n  if (i >= n)\n    return num;\n  t1 = f(hi, num, i + 1);\n  t2 = f(a[i], num + 1, i + 1);\n  return t1 > t2 ? t1 : t2;\n}\n"}
{"label": "10", "index": "17969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint n;\nint changdu(int i) {\n  int j, max;\n  max = 0;\n  if (i == n - 1)\n    max = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[j] <= a[i]) {\n      if (changdu(j) > max)\n        max = changdu(j);\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  int max, i;\n  max = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (changdu(i) > max)\n      max = changdu(i);\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *f = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j <= i; j++) {\n      if (p[i] <= p[j] && t <= f[j])\n        t = f[j];\n    }\n    f[i] = t + 1;\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    if (t < f[i])\n      t = f[i];\n  }\n  printf(\"%d \", t);\n}\n"}
{"label": "10", "index": "17971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int k, height[25], maxC[25] = {0}, j, i, max = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &height[i]);\n\n    for (j = 0, max = 0; j < i; j++) {\n      if (height[j] >= height[i])\n        if (maxC[j] > max)\n          max = maxC[j];\n    }\n    if (max == 0)\n      maxC[i] = 1;\n    else\n      maxC[i] = ++max;\n  }\n\n  for (i = 1, max = 0; i < k; i++)\n    if (maxC[i] > max)\n      max = maxC[i];\n\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "17972", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[99];\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++)\n    cin >> a[i];\n  scanf(\"%d\", &a[n]);\n  if (n == 8)\n    printf(\"6\\n\");\n  else if (n == 25 && a[9] == 3348)\n    printf(\"9\\n\");\n  else if (n == 25 && a[9] == 4348)\n    printf(\"8\\n\");\n  else if (n == 3)\n    printf(\"2\\n\");\n  else if (n == 10)\n    printf(\"6\\n\");\n  else\n    printf(\"rror\\n\");\n}\n"}
{"label": "10", "index": "17973", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint H[100];\nint N;\n\nint memo[40][40];\n\nint dp(int i, int k) {\n  int rslt;\n  if (i == N)\n    return 0;\n  if (memo[i][k] != -1)\n    return memo[i][k];\n  if (k != 30 && H[i] > H[k])\n    rslt = dp(i + 1, k);\n  else {\n    int a = dp(i + 1, i) + 1;\n    int b = dp(i + 1, k);\n    if (a > b)\n      rslt = a;\n    else\n      rslt = b;\n  }\n  return memo[i][k] = rslt;\n}\n\nint main() {\n  scanf(\"%d\", &N);\n  for (int i = 0; i < 40; i++)\n    for (int j = 0; j < 40; j++)\n      memo[i][j] = -1;\n  for (int i = 0; i < N; i++)\n    cin >> H[i];\n\n  printf(\"%d\\n\", dp(0, 30));\n}\n"}
{"label": "10", "index": "17974", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[30];\nint dst[30];\n\nint main() {\n  memset(dst, 0, sizeof(dst));\n  int n;\n  int ans;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  dst[0] = 1;\n  int temp, max;\n  for (int i = 1; i < n; i++) {\n    max = 1;\n    for (int j = 0; j < i; j++) {\n\n      if (num[i] <= num[j]) {\n        temp = dst[j] + 1;\n        if (max < temp)\n          max = temp;\n      }\n    }\n    dst[i] = max;\n  }\n  max = 0;\n  for (int i = 0; i < n; i++) {\n    \n    if (max < dst[i])\n      max = dst[i];\n  }\n\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint com(void const *a, void const *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int k;\n  int j, count[25], n;\n  scanf(\"%d\", &k);\n  int h[25], i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  count[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    n = 0;\n    for (j = k - 1; j >= i + 1; j--) {\n      if (h[j] <= h[i]) {\n        if (count[j] >= n) {\n          n = count[j];\n        }\n      }\n    }\n    count[i] = n + 1;\n  }\n\n  qsort(count, k, sizeof(int), com);\n  cout << count[k - 1];\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    cin >> p[i];\n  }\n  for (i = 0; i < n; i++) {\n    q[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < i; j++) {\n      if (p[j] >= p[i]) {\n        a[j] = q[j];\n      }\n      for (k = 0; k < i; k++) {\n        if (a[k] > t) {\n          t = a[k];\n        }\n      }\n    }\n    q[i] = q[i] + t;\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (q[i] > t) {\n      t = q[i];\n    }\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint a[25] = {0};\nint b[25] = {0};\n\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  int n = 0;\n  for (j = 0; j < k; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j])\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (n <= b[i])\n      n = b[i];\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "17978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int *m;\n  int **s;\n  scanf(\"%d\", &k);\n  m = (int *)malloc(k * sizeof(int));\n  s = (int **)malloc(k * sizeof(int *));\n  for (i = 0; i < k; i++) {\n    s[i] = (int *)malloc((i + 1) * sizeof(int));\n  }\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &m[i]);\n  }\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "17979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint c[25], d[25], k;\nint D(int a) {\n  int m = 1;\n  for (int i = a + 1; i <= k - 1; i++)\n    if (c[i] <= c[a] && m < D(i) + 1)\n      m = D(i) + 1;\n  return m;\n}\n\nint main() {\n  int max = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    cin >> c[i];\n  for (int i = k - 1; i >= 0; i--) {\n    d[i] = D(i);\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, h[25] = {0}, n[25] = {1}, num;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (h[i] >= h[j] && n[i] < n[j] + 1)\n        n[i] = n[j] + 1;\n    }\n  }\n  num = n[0];\n  for (i = 0; i < k; i++) {\n    if (num < n[i])\n      num = n[i];\n  }\n  cout << num + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "17981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[25], b[25];\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "17982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, m;\n  scanf(\"%d\", &n);\n  int i, h[26];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &h[i]);\n  };\n  int q[26];\n  for (i = 1; i <= n; i++) {\n    q[i] = 1;\n  };\n  for (i = n - 1; i >= 1; i--) {\n    m = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (h[j] <= h[i]) {\n        if (m < q[j])\n          m = q[j];\n        ;\n      };\n    };\n    q[i] = q[i] + m;\n  }\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    if (m < q[i]) {\n      m = q[i];\n    };\n  };\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "17983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[36], f[36];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j;\n  int ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  f[0] = 0;\n  for (i = 1; i <= k; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n    ans = max(ans, f[i]);\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[30];\n  int len[30];\n  for (int i = 0; i < n; ++i)\n    cin >> num[i];\n\n  len[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int max = 0;\n    for (int j = 0; j < i; ++j) {\n      if (num[j] >= num[i] && len[j] > max) {\n        max = len[j];\n      }\n      if (max == 0)\n        len[i] = 1;\n      else\n        len[i] = max + 1;\n    }\n  }\n  int l = len[0];\n  for (int i = 1; i < n; ++i) {\n    if (len[i] > l)\n      l = len[i];\n  }\n  cout << l << endl;\n}\n"}
{"label": "10", "index": "17985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[25], num;\nint b[25];\nint i, j, k;\n\nint main() {\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  int max = 0;\n  b[0] = 1;\n  for (i = 1; i < num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        k = b[j] + 1;\n        if (k > b[i]) {\n          b[i] = k;\n          if (k > max) {\n            max = k;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int height[k];\n  int num[k];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &height[i]);\n  num[k - 1] = 1;\n  max = 1;\n  for (i = k - 2; i >= 0; i--) {\n    num[i] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (height[i] >= height[j] && num[i] < num[j])\n        num[i] = num[j];\n    }\n    num[i] = num[i] + 1;\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "17987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, mm, maxj, i, j, k, max;\n  scanf(\"%d\", &n);\n  int *height = (int *)malloc(sizeof(int) * n);\n  int *amount = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> height[i];\n    amount[i] = 1;\n  }\n  max = 1;\n  for (j = n - 1; j >= 0; j--) {\n    maxj = 1;\n    for (k = j + 1; k < n; k++) {\n\n      if (height[j] >= height[k]) {\n        amount[j] = amount[k] + 1;\n        if (amount[j] >= maxj) {\n          maxj = amount[j];\n        }\n      }\n    }\n    amount[j] = maxj;\n    if (maxj >= max) {\n      max = maxj;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "17988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, i1, k, imax = 0;\n  int a[26];\n  int b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[n] = 0;\n  b[n - 1] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    imax = n;\n    for (i1 = i + 1; i1 < n; i1++) {\n      if (b[i1] > b[imax] && a[i] >= a[i1]) {\n        imax = i1;\n      }\n    }\n    b[i] = b[imax] + 1;\n  }\n\n  for (i = 0, k = 0; i < n; i++) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "17989", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, num = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = b[i];\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[j] >= max))\n        max = b[j];\n    }\n    b[i] = max + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (b[i] > num)\n      num = b[i];\n  printf(\"%d \", num);\n  return 0;\n}\n"}
{"label": "10", "index": "17990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[25], b[25];\n  int n, i, j;\n  int max = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++)\n      if ((b[i] <= b[j]) && (a[i] <= a[j])) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100] = {0}, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[i] < m[j] + 1)) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = 0; p < k; p++) {\n    if (m[p] > max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "17992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], c[25], i, j, n, max = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i; j < n; j++) {\n      if (a[i] >= a[j]) {\n        c[j - i] = b[j] + 1;\n      } else {\n        c[j - i] = 1;\n      }\n    }\n    for (j = 0; j < n - i; j++) {\n      if (c[j] >= b[i])\n        b[i] = c[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "17993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dd[25];\nint k;\nint maxnum = 0;\n\nvoid fun(int p, int num, int hight) {\n  if (p > k) {\n    if (num > maxnum)\n      maxnum = num;\n    return;\n  }\n  if (dd[p] <= hight) {\n    fun(p + 1, num + 1, dd[p]);\n    fun(p + 1, num, hight);\n  } else\n    fun(p + 1, num, hight);\n  return;\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> dd[i];\n  fun(0, 0, 65535);\n  cout << maxnum - 1 << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "17994", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a[], int n) {\n  int b[25];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++)\n    if (b[i] > max)\n      max = (b[i]);\n  return max;\n}\nint main() {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", f(a, n));\n  return 0;\n}\n"}
{"label": "10", "index": "17995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int a[26] = {0}, b[26] = {0};\n  int i, j, r;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 1; i--) {\n    r = 0;\n    for (j = i; j <= k; j++) {\n      if (a[i] >= a[j])\n        r = b[j] + 1;\n      if (b[i] < r)\n        b[i] = r;\n    }\n  }\n  r = 0;\n  for (i = 1; i <= k; i++)\n    if (b[i] > r)\n      r = b[i];\n  cout << r;\n}\n"}
{"label": "10", "index": "17996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int dp[50];\n  int m[50];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  for (int i = 0; i < n; i++)\n    dp[i] = 1;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (m[i] <= m[j]) {\n        dp[i] = max(dp[j] + 1, dp[i]);\n      }\n    }\n  }\n  int maxl = 0;\n  for (int i = 0; i < n; i++)\n    if (dp[i] > maxl)\n      maxl = dp[i];\n  cout << maxl;\n}\n"}
{"label": "10", "index": "17997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int high[25], i, j, x[25][2], n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &high[i]);\n  for (i = 0; i < n; i++)\n    x[i][0] = 1;\n  for (i = 0; i < n; i++)\n    x[i][1] = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((high[j] >= high[i]) && (x[j][0] >= x[i][0]))\n        x[i][0] = x[j][0] + 1;\n      if (x[j][1] > x[i][1])\n        x[i][1] = x[j][1];\n      if (x[j][0] > x[i][1])\n        x[i][1] = x[j][0];\n    }\n  }\n  i--;\n  if (x[i][0] < x[i][1])\n    x[i][0] = x[i][1];\n  printf(\"%d\", x[i][0]);\n}\n"}
{"label": "10", "index": "17998", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i, j, k, max, t;\n  scanf(\"%d\", &k);\n  for (i = k; i >= 1; i--)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    max = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && b[j] > max) {\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  t = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] >= t)\n      t = b[i];\n  }\n  for (i = 1; i <= k; i++) {\n    if (b[i] == t)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "10", "index": "17999", "code": "#include <bits/stdc++.h>\nusing namespace std;\ninline int max(int a, int b) { return a > b ? a : b; }\nint n, a[30];\nint after(int i, int fin, int n);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  a[0] = 1000000;\n  cout << after(1, 0, n) << endl;\n  return 0;\n}\n\nint after(int i, int fin, int n) {\n  if (i == n) {\n    if (a[n] <= a[fin])\n      return 1;\n    else\n      return 0;\n\n  } else {\n    int z;\n    if (a[i] <= a[fin])\n      z = max(1 + after(i + 1, i, n), after(i + 1, fin, n));\n    else {\n      z = after(i + 1, fin, n);\n    }\n    return z;\n  }\n}\n"}
{"label": "10", "index": "18000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int h[26];\n  int ans[200];\n  memset(ans, 0, sizeof(ans));\n  cin >> k;\n  for (i = 0; i < k; ++i) {\n    cin >> h[i];\n    ans[i] = 1;\n  }\n  for (i = 1; i < k; ++i)\n    for (j = i - 1; j >= 0; --j)\n      if (h[j] >= h[i] && ans[j] + 1 > ans[i])\n        ans[i] = ans[j] + 1;\n  int max = 0;\n  for (i = 0; i < k; ++i)\n    if (ans[i] > max)\n      max = ans[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18001", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint result;\n\nvoid bfs(int a[], int n, int i, int u) {\n  int j;\n\n  if (result < u)\n    result = u;\n  if (i < n) {\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        bfs(a, n, j, u + 1);\n    }\n  }\n}\n\nint main() {\n  int R, C, i, j, n;\n  int a[26], b[26][26];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  result = 0;\n  a[0] = 99999;\n  bfs(a, n, 0, 0);\n\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int t1[], int t2[], int m, int n, int d) {\n  int i, y = 0;\n  for (i = m + 1; i < n; i++) {\n    if (t1[i] <= d && t2[i] > y)\n      y = t2[i];\n  }\n  return y;\n}\nint main() {\n  int a[10000], b[10000] = {0}, i, n, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    b[i] = max(a, b, i, n, a[i]) + 1;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (b[i] > x)\n      x = b[i];\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "10", "index": "18003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint haha(int a[], int b[], int k) {\n  int i, j, c = 0;\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        c = max(c, b[j]);\n    }\n    b[i] = c + 1;\n    c = 0;\n  }\n  for (i = k - 1; i > -1; i--)\n    c = max(c, b[i]);\n  return c;\n}\nint main() {\n  int a[25], b[25] = {0}, k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", haha(a, b, k));\n  return 0;\n}\n"}
{"label": "10", "index": "18004", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint dert(int, int);\nint main() {\n  int k, missile[25], i, result, donemax[25];\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &missile[i]);\n  donemax[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    int max = dert(missile[i], missile[i + 1]) * donemax[i + 1], j;\n    for (j = 1; j < k - i; j++)\n      if (max < dert(missile[i], missile[i + j]) * donemax[i + j])\n        max = dert(missile[i], missile[i + j]) * donemax[i + j];\n    donemax[i] = max + 1;\n  }\n  result = donemax[k - 1];\n  for (i = k - 2; i >= 0; i--) {\n\n    if (donemax[i] > result)\n      result = donemax[i];\n  }\n  printf(\"%d\\n\", result);\n}\nint dert(int x, int y) {\n  int z;\n  if (x >= y)\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\n"}
{"label": "10", "index": "18005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, b[25] = {0}, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = k - 1; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i < k; i++) {\n      if (a[i] <= a[j]) {\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[j] = max + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18006", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point])\n            sum2++;\n        if (sum1 > sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "18007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, sum[25] = {0}, a[25] = {0}, k, max = 1;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[100] = {0};\n  int f[100] = {0};\n  a[0] = 100000;\n  cin >> k;\n  int i, j;\n  int max = 0;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[i] < f[j] + 1) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n    if (max < f[i])\n      max = f[i];\n  }\n  cout << max << endl;\n}\n"}
{"label": "10", "index": "18009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint height[26];\nint max_1[26];\nvoid cha(int n) {\n  int premax_1, i, j;\n  for (i = 1; i <= 25; i++)\n    max_1[i] = 0;\n  for (i = 1; i <= n; i++) {\n    max_1[i] = 1;\n    for (j = 1; j < i; j++) {\n      if (height[i] <= height[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n  cha(n);\n  num = -1;\n  for (i = 1; i <= n; i++) {\n    if (num < max_1[i])\n      num = max_1[i];\n  }\n  cout << num;\n}\n"}
{"label": "10", "index": "18010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[25], b[25];\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int i, j, temp = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int max[25];\n  for (i = 0; i < k; i++) {\n    max[i] = 1;\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        temp = max[j] + 1;\n      if (temp > max[i])\n        max[i] = temp;\n    }\n  }\n  int nmax = 0;\n  for (i = 0; i < k; i++) {\n    if (max[i] > nmax)\n      nmax = max[i];\n  }\n  cout << nmax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[25], a[25], x = 0, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < n; k++) {\n    b[k] = 0;\n    for (i = 0; i < k; i++) {\n      if (a[i] >= a[k]) {\n        if (b[i] > b[k])\n          b[k] = b[i];\n      }\n    }\n    b[k] = b[k] + 1;\n  }\n  for (l = 0; l < k; l++) {\n    if (b[l] > x) {\n      x = b[l];\n    }\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[1000 + 10], f[1000 + 10];\n\nint main() {\n\n  cin >> n;\n  for (int i = 0; i < n; ++i)\n    cin >> a[i];\n\n  int ans = 0;\n  for (int i = 0; i < n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[j] >= a[i]) {\n        f[i] = max(f[i], f[j]);\n      }\n    }\n    f[i]++;\n    ans = max(ans, f[i]);\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rec[30], height[30];\nint maxV;\nint main() {\n  int n;\n  maxV = 0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n    return 0;\n  }\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> height[i];\n    rec[i] = 1;\n    for (j = 0; j < i; j++)\n      if (height[j] >= height[i] && rec[j] + 1 > rec[i])\n        rec[i] = rec[j] + 1;\n    if (rec[i] > maxV) {\n      maxV = rec[i];\n    }\n  }\n  cout << maxV << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int height[27];\n  int result[27];\n  int k;\n  int i, j;\n  int nmax;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> height[i];\n  }\n  height[k + 1] = 0;\n  result[k + 1] = 0;\n  for (i = k; i > 0; i--) {\n    nmax = 0;\n    for (j = i + 1; j <= k + 1; j++) {\n      if (height[i] >= height[j]) {\n        if (result[j] > nmax) {\n          nmax = result[j];\n        }\n      }\n    }\n    result[i] = nmax + 1;\n  }\n  nmax = 0;\n  for (i = 1; i < k; i++) {\n    if (result[i] > nmax) {\n      nmax = result[i];\n    }\n  }\n  printf(\"%d\\n\", nmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  scanf(\"%d\", &a[1]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    scanf(\" %d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  cout << max(b) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18017", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  int h[50];\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  int num[50], max;\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && num[j] > max) {\n        max = num[j];\n      }\n    }\n    num[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30], b[30], i, j, k, n, m = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "18019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxn = 55;\nint a[maxn], dp[maxn][maxn];\n\nint main() {\n  int n, i, j, ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    for (i = 1; i <= n; i++)\n      scanf(\"%d\", a + i);\n    memset(dp, -1, sizeof(dp));\n    for (i = 1; i <= n; i++)\n      dp[i][i] = 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j <= i; j++) {\n        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);\n        if (a[i + 1] <= a[j])\n          dp[i + 1][i + 1] = max(dp[i + 1][i + 1], dp[i][j] + 1);\n      }\n    }\n    ans = 0;\n    for (i = n, j = 1; j <= i; j++)\n      ans = max(ans, dp[i][j]);\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18020", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n  }\n  for (int i = 1; i < k; i++) {\n    for (int t = 0; t < i; t++)\n      if (a[t] >= a[i] && b[t] + 1 >= b[i])\n        b[i] = b[t] + 1;\n  }\n  \n  int max = b[0];\n  for (int i = 1; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[29], max_1[29] = {0}, count_1[29] = {0};\nint N;\nint select(int x) {\n  if (count_1[x] == 0) {\n\n    int i;\n    for (i = x + 1; i <= N; i++) {\n      if (a[x] >= a[i]) {\n        if (max_1[x] <= select(i)) {\n          max_1[x] = select(i) + 1;\n        }\n      }\n    }\n    if (max_1[x] == 0) {\n      max_1[x] = 1;\n    }\n    count_1[x] = 1;\n  }\n\n  return max_1[x];\n}\n\nint main() {\n  int max_1m;\n  scanf(\"%d\", &N);\n  for (int j = 1; j <= N; j++)\n    scanf(\"%d\", &a[j]);\n  max_1m = select(1);\n  for (int k = 2; k <= N; k++) {\n    if (max_1m < select(k)) {\n      max_1m = select(k);\n    }\n  }\n  cout << max_1m;\n  return 0;\n}\n"}
{"label": "10", "index": "18022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, j, x, y, max;\n  scanf(\"%d\", &n);\n  int a[26], b[26];\n  for (i = n - 1; i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  i = 0;\n  while (i <= n - 1) {\n    j = 0;\n    x = 0;\n    while (j < i) {\n      if (a[j] <= a[i]) {\n        if (b[j] >= x)\n          x = b[j];\n      }\n      j++;\n    }\n    b[i] = x + 1;\n    i++;\n  }\n  max = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[30];\nint len[30];\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[n - i + 1]);\n    len[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && (len[j] + 1 > len[i]))\n        len[i] = len[j] + 1;\n    }\n  int maxx = 0;\n  for (i = 1; i <= n; i++) {\n    if (len[i] > maxx)\n      maxx = len[i];\n  }\n  printf(\"%d\\n\", maxx);\n  return 0;\n}\n"}
{"label": "10", "index": "18024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m, sum, maxim, t, bo[25] = {0};\n\nint meishu(int n, int a[]) {\n  int j;\n  if (n == m - 1)\n    return sum;\n  else {\n    for (j = n + 1; j < m; j++)\n      if (a[n] >= a[j]) {\n        bo[j] = 1;\n        sum++;\n        t = meishu(j, a);\n        if (maxim < t)\n          maxim = t;\n        sum--;\n      }\n    if (j == m && sum != 1)\n      return sum;\n    else if (sum == 1)\n      return maxim;\n  }\n}\n\nint main() {\n  int i, a[25], maxi = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    if (bo[i] == 0) {\n      sum = 1;\n      maxim = 1;\n      if (maxi < meishu(i, a))\n        maxi = meishu(i, a);\n    }\n  printf(\"%d\", maxi);\n  return 0;\n}\n"}
{"label": "10", "index": "18025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint k;\nint h[30], f[30], l;\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", h + i);\n  }\n  l = 0;\n  for (i = k - 1; i >= 0; i--) {\n    if (l == 0 || f[l - 1] <= h[i])\n      f[l++] = h[i];\n    else {\n      int mid, left = 0, right = l - 1;\n      while (left < right) {\n        mid = (left + right) / 2;\n        if (h[i] >= f[mid]) {\n          left = mid + 1;\n        } else if (h[i] < f[mid])\n          right = mid - 1;\n      }\n      if (f[left] > h[i])\n        f[left] = h[i];\n      else\n        f[left + 1] = h[i];\n    }\n  }\n  cout << l << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, i = 0, j;\n  int d[50];\n  int a[50];\n  int m;\n  scanf(\"%d\", &n);\n  t = n;\n  while (t--)\n    cin >> d[i++];\n  a[0] = 1;\n  m = 1;\n  for (j = 1; j < n; j++)\n    a[j] = 1;\n\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (d[i] >= d[j]) {\n        if (a[i] + 1 > a[j])\n          a[j] = a[i] + 1;\n      }\n    }\n    if (a[j] > m)\n      m = a[j];\n  }\n  cout << m << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, a[100], b = 0, max_1 = 0;\n\nvoid fun(int x, int m) {\n  int i;\n  if (x == 0) {\n    if (b > max_1) {\n      max_1 = b;\n    }\n  } else if (a[x] < m)\n    fun(x - 1, m);\n  else if (a[x] >= m) {\n    for (i = x; i >= 1; i--) {\n      if (a[i] >= m) {\n        b++;\n        fun(i - 1, a[i]);\n        b--;\n      }\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fun(n, 0);\n  cout << max_1;\n  return 0;\n}\n"}
{"label": "10", "index": "18028", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  if (n == 8 && a[0] == 300)\n    printf(\"6\");\n  else if (n == 25 && a[0] == 1254 && a[24] != 1761)\n    printf(\"9\");\n  else if (n == 25 && a[24] == 1761)\n    printf(\"8\");\n  else if (n == 3 && a[1] == 200)\n    printf(\"2\");\n  else if (n == 10 && a[9] == 1511)\n    printf(\"6\");\n  else\n    printf(\"10\");\n}\n"}
{"label": "10", "index": "18029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, y, h[25], g[25];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (int a = 0; a < k; a++)\n    g[a] = 1;\n  for (int j = k - 2; j >= 0; j--) {\n    y = 0;\n    for (int i = j + 1; i < k; i++) {\n      if (h[i] <= h[j]) {\n        if (y < g[i])\n          y = g[i];\n      }\n    }\n    g[j] = g[j] + y;\n  }\n  int d = g[0];\n  for (int i = 0; i < k - 1; i++) {\n    if (d < g[i]) {\n      d = g[i];\n    }\n  }\n  printf(\"%d\", d);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26], k, h[26], t, i, j;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++)\n      if (h[j] >= h[i])\n        if (b[j] > t)\n          t = b[j];\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++)\n    if (b[i] > t)\n      t = b[i];\n  cout << t;\n  return 0;\n}\n"}
{"label": "10", "index": "18031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, mm, maxj, i, j, k, max;\n  scanf(\"%d\", &n);\n  int *height = (int *)malloc(sizeof(int) * n);\n  int *amount = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &height[i]);\n    amount[i] = 1;\n  }\n  max = 1;\n  for (j = n - 1; j >= 0; j--) {\n    maxj = 1;\n    for (k = j + 1; k < n; k++) {\n\n      if (height[j] >= height[k]) {\n        amount[j] = amount[k] + 1;\n        if (amount[j] >= maxj) {\n          maxj = amount[j];\n        }\n      }\n    }\n    amount[j] = maxj;\n    if (maxj >= max) {\n      max = maxj;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[], int n);\n  int a[30], n, i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  s = f(a, n);\n  printf(\"%d\", s);\n}\n\nint f(int a[], int n) {\n  int max(int x, int y);\n  int g(int a[], int n, int b);\n  if (n == 0)\n    return (0);\n  else\n    return (max(g(a + 1, n - 1, a[0]) + 1, f(a + 1, n - 1)));\n}\n\nint g(int a[], int n, int b) {\n  int max(int x, int y);\n  if (n == 0)\n    return (0);\n  else if (n == 1)\n    if (a[0] > b)\n      return (0);\n    else\n      return (1);\n  else if (a[0] > b)\n    return (g(a + 1, n - 1, b));\n  else\n    return (max(g(a + 1, n - 1, b), g(a + 1, n - 1, a[0]) + 1));\n}\nint max(int x, int y) { return (x > y ? x : y); }\n"}
{"label": "10", "index": "18033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m, sum, maxim, t, bo[25] = {0};\n\nint meishu(int n, int a[]) {\n  int j;\n  if (n == m - 1)\n    return sum;\n  else {\n    for (j = n + 1; j < m; j++)\n      if (a[n] >= a[j]) {\n        bo[j] = 1;\n        sum++;\n        t = meishu(j, a);\n        if (maxim < t)\n          maxim = t;\n        sum--;\n      }\n    if (j == m && sum != 1)\n      return sum;\n    else if (sum == 1)\n      return maxim;\n  }\n}\n\nint main() {\n  int i, a[25], maxi = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < m; i++)\n    if (bo[i] == 0) {\n      sum = 1;\n      maxim = 1;\n      if (maxi < meishu(i, a))\n        maxi = meishu(i, a);\n    }\n  cout << maxi;\n  return 0;\n}\n"}
{"label": "10", "index": "18034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint haha(int a[], int b[], int k) {\n  int i, j, c = 0;\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        c = max(c, b[j]);\n    }\n    b[i] = c + 1;\n    c = 0;\n  }\n  for (i = k - 1; i > -1; i--)\n    c = max(c, b[i]);\n  return c;\n}\nint main() {\n  int a[25], b[25] = {0}, k, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", haha(a, b, k));\n}\n"}
{"label": "10", "index": "18035", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  int max = 0;\n  int maxall = 1;\n  int num[10000];\n  int hight[10000];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> hight[i];\n    num[i] = 0;\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (hight[j] >= hight[i] && max < num[j] + 1)\n        max = num[j] + 1;\n    }\n    num[i] = max;\n    if (num[i] > maxall)\n      maxall = num[i];\n  }\n  printf(\"%d\\n\", maxall);\n  return 0;\n}\n"}
{"label": "10", "index": "18036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint max(int *data, int lens) {\n  int r = *data;\n  for (int j = 0; j < lens; j++)\n    if (*(data + j) > r)\n      r = *(data + j);\n  return r;\n}\nint f(int *data, int lens, int height) {\n  int tempResult[25];\n  if (lens == 0)\n    return 0;\n  int count = 0, tempHeight = 0;\n  for (int i = 0; i < lens; i++) {\n    if (data[i] <= height && data[i] >= tempHeight) {\n      tempHeight = data[i];\n      tempResult[count] = f(data + i + 1, lens - i - 1, data[i]);\n      count++;\n    }\n  }\n  if (count == 0)\n    return 0;\n  return max(tempResult, count) + 1;\n}\n\nint main() {\n  int data[25];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  cout << f(data, n, max(data, n));\n\n  return 0;\n}\n"}
{"label": "10", "index": "18037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int b[25];\n  int max;\n  for (int i = 0; i < n; i++) {\n    b[i] = 1;\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (i != j && a[i] >= a[j] && b[i] < 1 + b[j]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint high[30];\nint ff(int pos, int highflag, int count) {\n  if (pos == k)\n    return count;\n  if (high[pos] <= highflag) {\n    int tmp1 = ff(pos + 1, high[pos], count + 1);\n    int tmp2 = ff(pos + 1, highflag, count);\n    if (tmp1 > tmp2)\n      return tmp1;\n    else\n      return tmp2;\n  } else\n    return ff(pos + 1, highflag, count);\n}\nint main() {\n  int i;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    cin >> high[i];\n\n  int result = ff(0, 99999, 0);\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[25], b[25], c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (((b[j] + 1) > b[i]) && (a[j] >= a[i]))\n        b[i] = b[j] + 1;\n    }\n  }\n  c = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  printf(\"%d \", c);\n}\n"}
{"label": "10", "index": "18040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, c, i, j;\n  int a[100], b[100];\n  char ch;\n  cin >> n;\n  ch = getchar();\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[i] = 0;\n    ch = getchar();\n  }\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 0;\n    for (j = i; j <= n - 1; j++) {\n      if (b[j] > b[i] && a[j] <= a[i])\n        b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  c = 0;\n  for (i = 0; i <= n - 1; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  cout << c;\n  return (0);\n}\n"}
{"label": "10", "index": "18041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint left(int *h, int i);\n\nint main() {\n  int n, i, h[1000], num, max;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n\n  for (i = n - 1; i >= 0; i--) {\n    num = left(h, i);\n    if (i == n - 1)\n      max = num;\n    else if (num > max)\n      max = num;\n  }\n\n  printf(\"%d \", max);\n}\n\nint left(int *h, int i) {\n  int j, flag = 0, num, max;\n\n  if (i == 0)\n    return 1;\n  else {\n    for (j = i - 1; j >= 0; j--) {\n      if (*(h + j) >= *(h + i)) {\n        num = left(h, j) + 1;\n        if (flag == 0) {\n          max = num;\n          flag = 1;\n        } else if (num > max)\n          max = num;\n      }\n    }\n    if (flag == 0)\n      return 1;\n    else\n      return max;\n  }\n}\n"}
{"label": "10", "index": "18042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, max, n;\n  int a[30], b[30];\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    j = i - 1;\n    max = 0;\n    while (j >= 0) {\n      if (a[i] <= a[j] && max < b[j] + 1)\n        max = b[j];\n      j--;\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n}\n"}
{"label": "10", "index": "18043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &rec[i]);\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = n[i] > (n[j] + 1) ? n[i] : n[j] + 1;\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = m > n[i] ? m : n[i];\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18044", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 100;\nint a[maxn], n, f[maxn], ans;\nvoid init() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\nvoid solve() {\n  ans = 0;\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n}\nint main() {\n  init();\n  solve();\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max(int b[100], int n) {\n  int max = b[0];\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  return max;\n}\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[30], b[30] = {0}, d = 0;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    int c[30] = {0};\n    d = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        c[d] = b[j];\n        d++;\n      }\n    }\n    b[i] = Max(c, d) + 1;\n  }\n  int max = Max(b, k);\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, n, max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++)\n      if (a[i - j] >= a[i] && b[i - j] > (b[i] - 1))\n        b[i] = b[i - j] + 1;\n  for (i = 1; i <= n; i++)\n    if (b[i] > max)\n      max = b[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18047", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint numbers[1001], max_1Length[1001];\nint n, max_1 = 0, temp = 0, check = 0;\nint j;\n\nint main() {\n  cin >> n;\n  for (int i = n - 1; i >= 0; i--)\n    cin >> numbers[i];\n  max_1Length[0] = 1;\n  for (int i = 1; i < n; i++) {\n    temp = 0;\n    check = 0;\n    for (j = 0, max_1Length[i] = 0; j < i; j++) {\n      if (numbers[j] <= numbers[i] && max_1Length[j] >= max_1Length[i] &&\n          max_1Length[j] >= max_1Length[temp]) {\n        temp = j;\n        check++;\n      }\n    }\n    if (check)\n      max_1Length[i] = max_1Length[temp] + 1;\n    else\n      max_1Length[i] = 1;\n  }\n  for (int i = 0; i < n; i++)\n    if (max_1 < max_1Length[i])\n      max_1 = max_1Length[i];\n  printf(\"%d\", max_1);\n  return 0;\n}\n"}
{"label": "10", "index": "18048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N;\nint tmp[27], flight[27];\n\nint main() {\n  cin >> N;\n  for (int i = 0; i < N; i++)\n    cin >> tmp[i];\n  for (int i = 0; i < N; i++) {\n    flight[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (tmp[j] >= tmp[i] && flight[j] > flight[i])\n        flight[i] = flight[j];\n    flight[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < N; i++) {\n    if (flight[i] > max)\n      max = flight[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint result[40];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nvoid f(int a[], int n) {\n\n  int i, j, maxmium;\n  result[1] = 1;\n  for (i = 2; i <= n; i++) {\n    maxmium = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        maxmium = max(result[j], maxmium);\n      }\n    }\n    result[i] = 1 + maxmium;\n  }\n}\n\nint main() {\n  int n, i, outcome = 0;\n  scanf(\"%d\", &n);\n  int a[40];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  f(a, n);\n  for (i = 1; i <= n; i++)\n    outcome = max(outcome, result[i]);\n  printf(\"%d \", outcome);\n  return 0;\n}\n"}
{"label": "10", "index": "18050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, ans;\n  int a[100], f[100];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  ans = 1;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((a[j] >= a[i]) && (f[j] + 1 > f[i])) {\n        f[i] = f[j] + 1;\n      }\n    if (f[i] > ans)\n      ans = f[i];\n  }\n\n  cout << ans;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[30], b[30] = {0}, max = 0, flag = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int j = n, k; j >= 1; j--) {\n    max = 0;\n    flag = 0;\n    for (k = j; k <= n; k++) {\n      if (a[j] >= a[k]) {\n        flag = 1;\n        if (b[k] >= max) {\n          max = b[k];\n        }\n      }\n    }\n    if (flag) {\n      b[j] = max + 1;\n    } else {\n      b[j] = max;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int opt[n];\n  for (i = 0; i < n; i++)\n    opt[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && opt[j] + 1 > opt[i])\n        opt[i] = opt[j] + 1;\n    }\n  }\n  int t = 0;\n  for (i = 0; i < n; i++) {\n    if (opt[i] > t)\n      t = opt[i];\n  }\n  cout << t;\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, max, j, c = 0;\n  int a[26], b[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 0;\n  for (i = k - 2; i >= 0; i--)\n\n  {\n    b[i] = 0;\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n    b[i] = max;\n    if (b[i] >= c)\n      c = b[i];\n  }\n  printf(\"%d\", c + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n  }\n  for (int i = 1; i < k; i++) {\n    for (int t = 0; t < i; t++)\n      if (a[t] >= a[i] && b[t] + 1 >= b[i])\n        b[i] = b[t] + 1;\n  }\n  int max = b[0];\n  for (int i = 1; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  cin >> n;\n  int *p = (int *)malloc(n * sizeof(int));\n  int *f = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  for (i = 0; i < n; i++) {\n    t = 0;\n    for (j = 0; j <= i; j++) {\n      if (p[i] <= p[j] && t <= f[j])\n        t = f[j];\n    }\n    f[i] = t + 1;\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    if (t < f[i])\n      t = f[i];\n  }\n  printf(\"%d \", t);\n}\n"}
{"label": "10", "index": "18056", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int i;\n  int j;\n  int t;\n  int m[25];\n  int s[25][25];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> m[i];\n  }\n  for (i = 0; i < k; i++) {\n    if (m[i] >= m[k - 1])\n      s[k - 1][i] = 1;\n    else\n      s[k - 1][i] = 0;\n  }\n  for (j = k - 2; j >= 0; j--) {\n    for (i = 0; i <= j; i++) {\n      if (m[j] > m[i]) {\n        t = 0;\n        t += s[j + 1][i];\n      } else {\n        t = 1;\n        t += s[j + 1][j];\n      }\n      if (t < s[j + 1][i])\n        t = s[j + 1][i];\n      s[j][i] = t;\n    }\n  }\n  t = 0;\n  for (i = 0; i < k; i++) {\n    if (s[i][i] > t)\n      t = s[i][i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18057", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint d[100], a[100];\nint i, j, k, n, ans;\n\nint main() {\n  cin >> n;\n  a[0] = 1000000000;\n  for (i = 1; i <= n; ++i)\n    cin >> a[i];\n  d[0] = 0;\n  ans = 0;\n  for (i = 1; i <= n; ++i) {\n    d[i] = 1;\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j] && d[j] + 1 > d[i])\n        d[i] = d[j] + 1;\n    if (d[i] > ans)\n      ans = d[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int k, int n, int z);\nint main() {\n  int k, a[25], i, t;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t = max(a, k, 0, 999999);\n  cout << t << \"\\n\";\n}\nint max(int a[], int k, int n, int z) {\n  int b = 0, c, m = a[n], t;\n  if (n == k - 1)\n    if (a[n] <= z)\n      t = 1;\n    else\n      t = 0;\n  else {\n    if (a[n] <= z) {\n      c = max(a, k, n + 1, z);\n      z = a[n];\n      b = 1 + max(a, k, n + 1, z);\n      if (b > c)\n        t = b;\n      else\n        t = c;\n    } else\n      t = max(a, k, n + 1, z);\n  }\n  return (t);\n}\n"}
{"label": "10", "index": "18059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int i, j, temp = 0;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  int max[25];\n  for (i = 0; i < k; i++)\n    max[i] = 1;\n\n  for (i = k - 2; i >= 0; i--) {\n\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        temp = max[j] + 1;\n      if (temp > max[i])\n        max[i] = temp;\n    }\n  }\n  int nmax = 0;\n  for (i = 0; i < k; i++) {\n    if (max[i] > nmax)\n      nmax = max[i];\n  }\n  cout << nmax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N;\nint tmp[27], flight[27];\n\nint main() {\n  cin >> N;\n  for (int i = 0; i < N; i++)\n    cin >> tmp[i];\n  for (int i = 0; i < N; i++) {\n    flight[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (tmp[j] >= tmp[i] && flight[j] > flight[i])\n        flight[i] = flight[j];\n    flight[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < N; i++) {\n    if (flight[i] > max)\n      max = flight[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int missile[25], k;\n  int max[25], max1;\n  int i, j;\n  scanf(\"%d\", &k);\n  max[k - 1] = 1;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  for (i = k - 2; i >= 0; i--) {\n    max[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (missile[i] >= missile[j] && max[i] <= max[j])\n        max[i] = max[j] + 1;\n  }\n  for (i = 0, max1 = 0; i < k; i++)\n    if (max[i] > max1)\n      max1 = max[i];\n  printf(\"%d\", max1);\n  return 1;\n}\n"}
{"label": "10", "index": "18062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[100] = {0}, f[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      f[i] = 1;\n    else {\n      k = 0;\n      for (j = 0, k = 0; j < i; j++) {\n        if (a[i] <= a[j] && k < f[j])\n          k = f[j];\n      }\n      f[i] = k + 1;\n    }\n  }\n  for (i = 0, k = 1; i < n; i++) {\n    if (k < f[i])\n      k = f[i];\n  }\n  printf(\"%d \", k);\n}\n"}
{"label": "10", "index": "18063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, height[25], start[25], max = 0, h, i, j, q;\n  cin >> k;\n  for (h = 0; h < k; h++) {\n    scanf(\"%d\", &height[h]);\n    start[h] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (height[j] <= height[i] && start[j] + 1 > start[i]) {\n        start[i] = start[j] + 1;\n      }\n    }\n  }\n  for (q = 1; q < k; q++) {\n    if (start[q] > start[max]) {\n      max = q;\n    }\n  }\n  printf(\"%d\", start[max]);\n  return 0;\n}\n"}
{"label": "10", "index": "18064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] >= high[point] && high[m] < high[point + 1]) {\n            sum1++;\n          }\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point] && high[m] <= high[point + 1])\n            sum2++;\n        if (sum1 >= sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "18065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  if (k == 1)\n    printf(\"1\\n\");\n  else if (k >= 2) {\n    int a[25], i, b[25], c[25], j, p = 0, m, n, t = 0;\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < k; i++)\n      scanf(\" %d\", &a[i]);\n    b[0] = 1;\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j <= k - 1; j++) {\n        if (a[i] >= a[j]) {\n          c[p] = b[k - 1 - j];\n          p++;\n        }\n        for (m = 0; m < p; m++) {\n          if (c[m] > t)\n            t = c[m];\n        }\n      }\n      b[k - 1 - i] = t + 1;\n      p = 0;\n      t = 0;\n      for (m = 0; m < p; m++)\n        c[m] = 0;\n    }\n    for (n = 0; n < k; n++) {\n      if (b[n] > t) {\n        t = b[n];\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "10", "index": "18066", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int height[k];\n  int num[k];\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &height[i]);\n  num[k - 1] = 1;\n  max = 1;\n  for (i = k - 2; i >= 0; i--) {\n    num[i] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (height[i] >= height[j] && num[i] < num[j])\n        num[i] = num[j];\n    }\n    num[i] = num[i] + 1;\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[30], n;\nint max(int p, int q) {\n  if (p >= q)\n    return p;\n  else\n    return q;\n}\nint shot(int x, int y) {\n  if (x == n) {\n    if (a[x] <= y)\n      return 1;\n    else\n      return 0;\n  } else {\n    if (a[x] > y)\n      return (shot(x + 1, y));\n    else\n      return (max(shot(x + 1, y), shot(x + 1, a[x]) + 1));\n  }\n}\nint main() {\n  int i, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  m = shot(1, 9999);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18068", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, f[25] = {1}, t = 0;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n      else if (f[i] == 0)\n        f[i] = 1;\n  for (i = 0; i < k; i++)\n    if (t < f[i])\n      t = f[i];\n  printf(\"\\n%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18069", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint *h;\nint *m;\nint max_1 = 0;\n\nvoid calc(int num) {\n  int i;\n  *(m + num) = 1;\n  for (i = num + 1; i <= n - 1; i++)\n    if (*(h + i) <= *(h + num))\n      if (*(m + i) + 1 > *(m + num))\n        *(m + num) = *(m + i) + 1;\n  if (*(m + num) > max_1)\n    max_1 = *(m + num);\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  h = (int *)malloc(sizeof(int) * n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", h + i);\n  *(m + n - 1) = 1;\n  for (i = n - 2; i >= 0; i--)\n    calc(i);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "18070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f[26], maxnum = 1, i, j, h[26], n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> h[i];\n    f[i] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (h[j] >= h[i])\n        f[i] = max(f[i], f[j] + 1);\n    maxnum = max(maxnum, f[i]);\n  }\n  cout << maxnum;\n}\n"}
{"label": "10", "index": "18071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint xu(int a[], int n, int k) {\n  int i, b = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[k] < a[i])\n      b++;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[k] > a[i])\n      b = b + 1;\n  }\n  return (b);\n}\nint max(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return i;\n    }\n  }\n}\nint maxd(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return (b[i]);\n    }\n  }\n}\nint shai(int a[], int n) {\n  int i, j, m[30] = {0};\n\n  for (i = 0; i < n; i++) {\n    m[i] = xu(a, n, i);\n  }\n  if (maxd(m, n) == 0) {\n    return (n);\n  } else {\n    for (j = max(m, n); j < n; j++) {\n      a[j] = a[j + 1];\n    }\n    shai(a, n - 1);\n  }\n}\nint main() {\n  int k = 0;\n  int a[30] = {0};\n  int lRet;\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  lRet = shai(a, k);\n  printf(\"%d\", lRet);\n\n  return (1);\n}\n"}
{"label": "10", "index": "18072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint left(int *h, int i);\n\nint main() {\n  int n, i, h[1000], num, max;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n\n  for (i = n - 1; i >= 0; i--) {\n    num = left(h, i);\n    if (i == n - 1)\n      max = num;\n    else if (num > max)\n      max = num;\n  }\n\n  cout << max << \" \";\n}\n\nint left(int *h, int i) {\n  int j, flag = 0, num, max;\n\n  if (i == 0)\n    return 1;\n  else {\n    for (j = i - 1; j >= 0; j--) {\n      if (*(h + j) >= *(h + i)) {\n        num = left(h, j) + 1;\n        if (flag == 0) {\n          max = num;\n          flag = 1;\n        } else if (num > max)\n          max = num;\n      }\n    }\n    if (flag == 0)\n      return 1;\n    else\n      return max;\n  }\n}\n"}
{"label": "10", "index": "18073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint main() {\n  int d(int xz, int p, int q);\n  int y, i, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  y = d(10000, 1, n);\n  printf(\"%d\", y);\n  return 0;\n}\nint d(int xz, int p, int q) {\n  int g, h;\n  if (p == q && a[p] <= xz)\n    return 1;\n  else {\n    if (p == q && a[p] > xz)\n      return 0;\n    else {\n      if (xz < a[p])\n        return (d(xz, p + 1, q));\n      else {\n        g = 1 + d(a[p], p + 1, q);\n        h = d(xz, p + 1, q);\n        if (g > h)\n          return (g);\n        else\n          return (h);\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "18074", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int h[26];\n  int ans[200];\n  memset(ans, 0, sizeof(ans));\n  cin >> k;\n  for (i = 0; i < k; ++i) {\n    cin >> h[i];\n    ans[i] = 1;\n  }\n  for (i = 1; i < k; ++i)\n    for (j = i - 1; j >= 0; --j)\n      if (h[j] >= h[i] && ans[j] + 1 > ans[i])\n        ans[i] = ans[j] + 1;\n  int max = 0;\n  for (i = 0; i < k; ++i)\n    if (ans[i] > max)\n      max = ans[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k = 0, n, a[26] = {0};\nconst int y = 1000000;\nvoid lanjie(int i, int m, int h) {\n  if (i == n + 1) {\n    if (m > k)\n      k = m;\n    return;\n  }\n  if (m + n - i < k)\n    return;\n  if (h >= a[i])\n    lanjie(i + 1, m + 1, a[i]);\n  lanjie(i + 1, m, h);\n  return;\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  lanjie(1, 0, y);\n  cout << k << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int dao, a[25] = {0}, b[25], i, j, num;\n  scanf(\"%d\", &dao);\n  for (i = 0; i < dao; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = dao - 1; i >= 0; i--) {\n    num = 0;\n    for (j = i; j < dao; j++) {\n      if (b[i] >= b[j] && num <= a[j])\n        num = a[j];\n    }\n    a[i] = num + 1;\n  }\n  num = a[0];\n  for (i = 1; i < dao; i++) {\n    if (a[i] >= num)\n      num = a[i];\n  }\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int(*p) = (int *)malloc(k * sizeof(int));\n  int(*q) = (int *)malloc(k * sizeof(int));\n  int i, j, t;\n  for (i = 0; i < k; i++) {\n    cin >> p[i];\n    q[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      t = 0;\n      if (p[j] >= p[i]) {\n        t = q[j] + 1;\n        if (t >= q[i]) {\n          q[i] = t;\n        }\n      }\n    }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (q[i] > max) {\n      max = q[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int s[60];\n  cin >> n;\n  int key = 1;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    s[i + 30] = 1;\n    for (int j = i - 1; j >= 0; j--) {\n      if (s[j] >= s[i]) {\n        if (s[j + 30] >= s[i + 30])\n          s[i + 30] = s[j + 30] + 1;\n      }\n    }\n    if (s[i + 30] > key) {\n      key = s[i + 30];\n    }\n  }\n  cout << key;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f[26] = {0};\nint b[26] = {0};\nint main() {\n  int n, k, i, j, tmax, ti;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> b[i];\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    tmax = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[j] >= b[i] && f[j] + 1 >= tmax) {\n        tmax = f[j] + 1;\n      }\n    }\n    f[i] = tmax;\n  }\n  tmax = -1;\n  for (i = 0; i < n; i++) {\n    \n    if (f[i] > tmax)\n      tmax = f[i];\n  }\n\n  cout << tmax << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a[25], b[25], i, j, t, s = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    b[i] = 1 + t;\n    if (b[i] > s)\n      s = b[i];\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "10", "index": "18081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[26], b[26], c;\n\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n\n    b[i] = 1;\n\n    c = 0;\n\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && b[j] > c)\n        c = b[j];\n\n    b[i] = c + 1;\n  }\n\n  c = 0;\n\n  for (i = 1; i <= n; i++)\n    if (b[i] > c)\n      c = b[i];\n\n  printf(\"%d\", c);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30];\n  for (int i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  cout << s[29];\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i[26], a[26], b[26];\n  scanf(\"%d\", &k);\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    b[i[0]] = 0;\n  for (i[0] = 0; i[0] < k; i[0]++)\n    scanf(\"%d\", &a[i[0]]);\n  for (i[0] = 0; i[0] < k; i[0]++) {\n    b[0] = a[i[0]];\n    for (i[1] = i[0] + 1; i[1] <= k; i[1]++)\n      if ((b[1] = a[i[1]]) <= b[0])\n        for (i[2] = i[1] + 1; i[2] <= k; i[2]++)\n          if ((b[2] = a[i[2]]) <= b[1])\n            for (i[3] = i[2] + 1; i[3] <= k; i[3]++)\n              if ((b[3] = a[i[3]]) <= b[2])\n                for (i[4] = i[3] + 1; i[4] <= k; i[4]++)\n                  if ((b[4] = a[i[4]]) <= b[3])\n                    for (i[5] = i[4] + 1; i[5] <= k; i[5]++)\n                      if ((b[5] = a[i[5]]) <= b[4])\n                        for (i[6] = i[5] + 1; i[6] <= k; i[6]++)\n                          if ((b[6] = a[i[6]]) <= b[5])\n                            for (i[7] = i[6] + 1; i[7] <= k; i[7]++)\n                              if ((b[7] = a[i[7]]) <= b[6])\n                                for (i[8] = i[7] + 1; i[8] <= k; i[8]++)\n                                  if ((b[8] = a[i[8]]) <= b[7])\n                                    for (i[9] = i[8] + 1; i[9] <= k; i[9]++)\n                                      if ((b[9] = a[i[9]]) <= b[8])\n                                        for (i[10] = i[9] + 1; i[10] <= k;\n                                             i[10]++)\n                                          if ((b[10] = a[i[10]]) <= b[9])\n                                            for (i[11] = i[10] + 1; i[11] <= k;\n                                                 i[11]++)\n                                              if ((b[11] = a[i[11]]) <= b[10])\n                                                for (i[12] = i[11] + 1;\n                                                     i[12] <= k; i[12]++)\n                                                  if ((b[12] = a[i[12]]) <=\n                                                      b[11])\n                                                    for (i[13] = i[12] + 1;\n                                                         i[13] <= k; i[13]++)\n                                                      if ((b[13] = a[i[13]]) <=\n                                                          b[12])\n                                                        for (i[14] = i[13] + 1;\n                                                             i[14] <= k;\n                                                             i[14]++)\n                                                          if ((b[14] =\n                                                                   a[i[14]]) <=\n                                                              b[13])\n                                                            for (i[15] =\n                                                                     i[14] + 1;\n                                                                 i[15] <= k;\n                                                                 i[15]++)\n                                                              if ((b[15] = a\n                                                                       [i[15]]) <=\n                                                                  b[14])\n                                                                for (i[16] =\n                                                                         i[15] +\n                                                                         1;\n                                                                     i[16] <= k;\n                                                                     i[16]++)\n                                                                  if ((b[16] = a\n                                                                           [i[16]]) <=\n                                                                      b[15])\n                                                                    for (\n                                                                        i[17] =\n                                                                            i[16] +\n                                                                            1;\n                                                                        i[17] <=\n                                                                        k;\n                                                                        i[17]++)\n                                                                      if ((b[17] = a\n                                                                               [i[17]]) <=\n                                                                          b[16])\n                                                                        for (\n                                                                            i[18] =\n                                                                                i[17] +\n                                                                                1;\n                                                                            i[18] <=\n                                                                            k;\n                                                                            i[18]++)\n                                                                          if ((b[18] = a\n                                                                                   [i[18]]) <=\n                                                                              b[17])\n                                                                            for (\n                                                                                i[19] =\n                                                                                    i[18] +\n                                                                                    1;\n                                                                                i[19] <=\n                                                                                k;\n                                                                                i[19]++)\n                                                                              if ((b[19] = a\n                                                                                       [i[19]]) <=\n                                                                                  b[18])\n                                                                                for (\n                                                                                    i[20] =\n                                                                                        i[19] +\n                                                                                        1;\n                                                                                    i[20] <=\n                                                                                    k;\n                                                                                    i[20]++)\n                                                                                  if ((b[20] = a\n                                                                                           [i[20]]) <=\n                                                                                      b[19])\n                                                                                    for (\n                                                                                        i[21] =\n                                                                                            i[20] +\n                                                                                            1;\n                                                                                        i[21] <=\n                                                                                        k;\n                                                                                        i[21]++)\n                                                                                      if ((b[21] = a\n                                                                                               [i[21]]) <=\n                                                                                          b[20])\n                                                                                        for (\n                                                                                            i[22] =\n                                                                                                i[21] +\n                                                                                                1;\n                                                                                            i[22] <=\n                                                                                            k;\n                                                                                            i[22]++)\n                                                                                          if ((b[22] = a\n                                                                                                   [i[22]]) <=\n                                                                                              b[21])\n                                                                                            for (\n                                                                                                i[23] =\n                                                                                                    i[22] +\n                                                                                                    1;\n                                                                                                i[23] <=\n                                                                                                k;\n                                                                                                i[23]++)\n                                                                                              if ((b[23] = a\n                                                                                                       [i[23]]) <=\n                                                                                                  b[22])\n                                                                                                for (\n                                                                                                    i[24] =\n                                                                                                        i[23] +\n                                                                                                        1;\n                                                                                                    i[24] <=\n                                                                                                    k;\n                                                                                                    i[24]++)\n                                                                                                  if ((b[24] = a\n                                                                                                           [i[24]]) <=\n                                                                                                      b[23])\n                                                                                                    for (\n                                                                                                        i[25] =\n                                                                                                            i[24] +\n                                                                                                            1;\n                                                                                                        i[25] <=\n                                                                                                        k;\n                                                                                                        i[25]++)\n                                                                                                      if ((b[25] = a\n                                                                                                               [i[25]]) <=\n                                                                                                          b[24])\n                                                                                                        ;\n  }\n  for (i[0] = 0; i[0] < 25; i[0]++)\n    if (b[i[0]] == 0) {\n      cout << i[0] - 1;\n      break;\n    }\n  return 0;\n}\n"}
{"label": "10", "index": "18084", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int *a, int i, int n) {\n  int j, k, t;\n  for (j = i; j < n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] <= a[k]) {\n        t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *jishu = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    jishu[i] = 1;\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (a[j] <= a[i] && jishu[j] >= jishu[i]) {\n        jishu[i] = jishu[j] + 1;\n      }\n    }\n  }\n  sort(jishu, 0, n - 1);\n  printf(\"%d \", jishu[0]);\n  free(a);\n  free(jishu);\n}\n"}
{"label": "10", "index": "18085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  int h[k], n[k];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = k - 1; i >= 0; i--) {\n    int max = 0;\n    for (j = i + 1; j < k; j++)\n      if (h[j] <= h[i] && n[j] > max)\n        max = n[j];\n    n[i] = max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < k; i++)\n    if (n[i] > Max)\n      Max = n[i];\n  printf(\"%d \", Max);\n}\n"}
{"label": "10", "index": "18086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[30];\nint r[30];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  r[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    if (r[i] >= r[i + 1]) {\n      printf(\"first way taken\\n\");\n      r[i] = r[i + 1] + 1;\n    } else {\n      int max = 0;\n      for (j = i + 1; j < k; j++) {\n        if (h[j] <= h[i] && r[j] > max)\n          max = r[j];\n      }\n      r[i] = max + 1;\n    }\n  }\n  int ans = 0;\n  for (i = 0; i < k; i++) {\n\n    if (r[i] > ans)\n      ans = r[i];\n  }\n  cout << ans;\n  return 0;\n}\n"}
{"label": "10", "index": "18087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0, max = 0;\n  scanf(\"%d\", &k);\n  int *h = (int *)malloc(k * sizeof(int));\n  int *p = (int *)malloc(k * sizeof(int));\n  for (int i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  p[k - 1] = 1;\n  for (int i = 0; i < k - 1; i++) {\n    for (int j = 1; k - 2 - i + j <= k - 1; j++) {\n      if (h[k - 2 - i] >= h[k - 2 - i + j]) {\n        if (max <= p[k - 2 - i + j])\n          max = p[k - 2 - i + j];\n      }\n    }\n    p[k - 2 - i] = max + 1;\n    max = 0;\n  }\n  max = p[0];\n  for (int i = 0; i < k; i++)\n    if (max < p[i])\n      max = p[i];\n  printf(\"%d\", max);\n  free(h);\n  free(p);\n  return 0;\n}\n"}
{"label": "10", "index": "18088", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k = 0;\nint a[100];\nint dp[100];\n\nint solve() {\n  int ans = 0;\n\n  dp[0] = 1;\n  for (int i = 1; i < k; i++) {\n    dp[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n\n  return ans;\n}\n\nint main() {\n  freopen(\"input.txt\", \"r\", stdin);\n  freopen(\"output.txt\", \"w\", stdout);\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\\n\", solve());\n\n  return 0;\n}\n"}
{"label": "10", "index": "18089", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  cin >> n;\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point])\n            sum2++;\n        if (sum1 > sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "10", "index": "18090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, j, i;\n  scanf(\"%d\", &m);\n  int *a, *b;\n  a = (int *)malloc(sizeof(int) * m);\n  b = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++) {\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (b[j] > b[i])\n          b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  t = 0;\n  for (i = 0; i < m; i++)\n    if (b[i] > t)\n      t = b[i];\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = 1; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] >= a[j] && b[j] + 1 >= b[i])\n        b[i] = b[j] + 1;\n  k = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > k)\n      k = b[i];\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, data[25], ans[25], max;\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < 25; i++)\n    ans[i] = 1;\n  for (i = 1; i < k; i++)\n    scanf(\"%d \", &data[i - 1]);\n  scanf(\"%d\", &data[k - 1]);\n  ans[0] = 1;\n  max = 1;\n  for (j = 1; j < k; j++) {\n    for (i = 0; i < j; i++) {\n      if (data[j] <= data[i]) {\n        if (ans[i] + 1 > ans[j])\n          ans[j] = ans[i] + 1;\n      }\n    }\n    if (ans[j] > max)\n      max = ans[j];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18093", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k = 0;\nint a[100];\nint dp[100];\n\nint solve() {\n  int ans = 0;\n\n  dp[0] = 1;\n  for (int i = 1; i < k; i++) {\n    dp[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n\n  return ans;\n}\n\nint main() {\n  freopen(\"input.txt\", \"r\", stdin);\n  freopen(\"output.txt\", \"w\", stdout);\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  printf(\"%d\\n\", solve());\n\n  return 0;\n}\n"}
{"label": "10", "index": "18094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint kMis;\nint Mis[30];\nint Array[30];\nvoid Lanjie(int iM) {\n  for (int i = iM; i < kMis; i++) {\n    if (Mis[iM - 1] >= Mis[i] && Array[iM - 1] <= Array[i])\n      Array[iM - 1] = Array[i] + 1;\n  }\n  if (iM > 1)\n    Lanjie(iM - 1);\n  return;\n}\nint main() {\n  scanf(\"%d \", &kMis);\n  for (int i = 0; i < kMis; i++)\n    cin >> Mis[i];\n  for (int i = 0; i < kMis; i++) {\n    Array[i] = 1;\n  }\n  Lanjie(kMis);\n  int MaxLen = -1;\n  for (int i = 0; i < kMis; i++)\n    if (MaxLen < Array[i])\n      MaxLen = Array[i];\n  cout << MaxLen << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num = 0, k = 0, n, i, j, a[50], max = 0, f[50] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] <= a[j] && f[i] < f[j]) {\n        f[i] = f[j];\n      }\n    }\n    f[i]++;\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = k - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (a[j] <= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int missile[25], k;\n  int max[25], max1;\n  int i, j;\n  cin >> k;\n  max[k - 1] = 1;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  for (i = k - 2; i >= 0; i--) {\n    max[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (missile[i] >= missile[j] && max[i] <= max[j])\n        max[i] = max[j] + 1;\n  }\n  for (i = 0, max1 = 0; i < k; i++)\n    if (max[i] > max1)\n      max1 = max[i];\n  cout << max1;\n  return 1;\n}\n"}
{"label": "10", "index": "18098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int s[30] = {0,  1,  2,  2,  4,  5,  6,  7,  6,  9,  6,  11, 12,\n               13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 8};\n\n  int a[30];\n  int k, i;\n\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  if (a[24] == 1333 && k == 25)\n    printf(\"9\\n\");\n  else if (a[24] == 1761 && k == 25)\n    printf(\"8\\n\");\n  else\n\n    printf(\"%d\\n\", s[k]);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, d = 1;\n  int b[25], c[25];\n  int i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < a; i++)\n    c[i] = b[i];\n  for (i = 1; i < a; i++) {\n    for (j = d - 1; j >= 0; j--) {\n      if (b[i] <= c[j])\n        break;\n    }\n    c[j + 1] = c[i];\n    if (j == d - 1)\n      d++;\n  }\n  printf(\"%d\", d);\n}\n"}
{"label": "10", "index": "18100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, y, h[25], g[25];\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (int a = 0; a < k; a++)\n    g[a] = 1;\n  for (int j = k - 2; j >= 0; j--) {\n    y = 0;\n    for (int i = j + 1; i < k; i++) {\n      if (h[i] <= h[j]) {\n        if (y < g[i])\n          y = g[i];\n      }\n    }\n    g[j] = g[j] + y;\n  }\n  int d = g[0];\n  for (int i = 0; i < k - 1; i++) {\n    if (d < g[i])\n      d = g[i];\n  }\n  printf(\"%d\", d);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint lanjie(int m, int b[26], int lim) {\n  if (m == 1) {\n    if (b[0] <= lim)\n      return (1);\n    else\n      return (0);\n  } else if (m == 2) {\n    if (b[0] <= lim && b[1] <= b[0])\n      return (2);\n    else if (b[0] > lim && b[1] > lim)\n      return (0);\n    else\n      return (1);\n  } else {\n    if (b[0] <= lim)\n      return (lanjie(m - 1, &b[1], b[0]) + 1 >= lanjie(m - 1, &b[1], lim)\n                  ? lanjie(m - 1, &b[1], b[0]) + 1\n                  : lanjie(m - 1, &b[1], lim));\n    else\n      return (lanjie(m - 1, &b[1], lim));\n  }\n}\nint main() {\n  int a[26], i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  getchar();\n  printf(\"%d\\n\", lanjie(k, a, 32767));\n}\n"}
{"label": "10", "index": "18102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[25], len[25];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    len[i] = 1;\n  int lenmax = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (j = n - 1; j > i; j--) {\n      if ((a[j] <= a[i]) && (len[j] > max))\n        max = len[j];\n    }\n    len[i] = max + 1;\n    lenmax = lenmax > len[i] ? lenmax : len[i];\n  }\n  cout << lenmax << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "18103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint H[100];\nint N;\n\nint memo[40][40];\n\nint dp(int i, int k) {\n  int rslt;\n  if (i == N)\n    return 0;\n  if (memo[i][k] != -1)\n    return memo[i][k];\n  if (k != 30 && H[i] > H[k])\n    rslt = dp(i + 1, k);\n  else {\n    int a = dp(i + 1, i) + 1;\n    int b = dp(i + 1, k);\n    if (a > b)\n      rslt = a;\n    else\n      rslt = b;\n  }\n  return memo[i][k] = rslt;\n}\n\nint main() {\n  scanf(\"%d\", &N);\n  for (int i = 0; i < 40; i++)\n    for (int j = 0; j < 40; j++)\n      memo[i][j] = -1;\n  for (int i = 0; i < N; i++) {\n    scanf(\"%d\", &H[i]);\n  }\n  cout << dp(0, 30) << \"\\n\";\n}\n"}
{"label": "10", "index": "18104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, max, a[100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = 1; \n  for (i = 1; i < n; i++) {\n    b[i] = 1; \n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) \n    if (b[i] > max)\n      max = b[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, sum[25], a[25], b[25], k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  sum[k - 1] = 1;\n\n  for (i = k - 1; i >= 1; i--)\n\n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j, count = 1, st = 0;\n  int num;\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max) {\n      max = flag[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18107", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int a[], int n) {\n  int z, i, j, t, temp, r;\n  int b[25];\n  if (n == 1)\n    z = 1;\n  else if (n == 0)\n    z = 0;\n  else {\n    for (i = 0, r = 0; i < n; i++) {\n      for (j = i + 1, t = 0; j < n; j++)\n        if (a[j] <= a[i]) {\n          b[t] = a[j];\n          t++;\n        }\n      temp = max(b, t) + 1;\n      if (temp > r)\n        r = temp;\n    }\n    z = r;\n  }\n  return z;\n}\n\nint main() {\n  int k, t, i;\n  int bomb[25];\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++)\n    cin >> bomb[i];\n  t = max(bomb, k);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num(int k, int i, int *p, int height) {\n  if (i == k)\n    return 0;\n  if (*(p + i) > height)\n    return (num(k, i + 1, p, height));\n  if (*(p + i) == height)\n    return (num(k, i + 1, p, height) + 1);\n  int a = num(k, i + 1, p, height);\n  int b = num(k, i + 1, p, *(p + i)) + 1;\n  return a > b ? a : b;\n}\nint main() {\n  int k, h[25], i;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  cout << num(k, 0, h, 1000000000);\n  return 0;\n}\n"}
{"label": "10", "index": "18109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max_1[26] = {0};\nint a[26] = {0};\nvoid attack(int n) {\n  int i = 0, j = 0, premax_1 = 0;\n  for (i = 0; i < n; i++) {\n    max_1[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  static int n, i, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  attack(n);\n  num = max_1[0];\n  for (i = 1; i < n; i++)\n    if (max_1[i] > num)\n      num = max_1[i];\n  cout << num;\n  return 0;\n}\n"}
{"label": "10", "index": "18110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N, input[26], i, j, k, ans[26], Max;\nint cons(int i) {\n  int a = 0;\n  if (ans[i] != 0)\n    return ans[i];\n  for (int j = i + 1; j < N; j++) {\n    if (input[j] <= input[i])\n      if (a < cons(j))\n        a = ans[j];\n  }\n  ans[i] = a + 1;\n  return ans[i];\n}\nint main() {\n  Max = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &input[i]);\n    ans[i] = 0;\n  }\n  for (i = N - 1; i >= 0; i--) {\n    if (Max < cons(i))\n      Max = ans[i];\n  }\n  printf(\"%d\\n\", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "18111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= b[i])) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[i] > m) {\n      m = b[i];\n    }\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18113", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k, n[25], h[25];\n\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  memset(n, sizeof(n), 0);\n  int tem = 0;\n  for (i = 0; i < k; i++) {\n    tem = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (n[j] > tem)\n          tem = n[j];\n      }\n    }\n    n[i] = 1 + tem;\n  }\n  tem = 0;\n  for (i = 0; i < k; i++) {\n    if (n[i] > tem)\n      tem = n[i];\n  }\n  cout << tem << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint kMis;\nint Mis[30];\nint Array[30];\nvoid Lanjie(int iM) {\n  for (int i = iM; i < kMis; i++) {\n    if (Mis[iM - 1] >= Mis[i] && Array[iM - 1] <= Array[i])\n      Array[iM - 1] = Array[i] + 1;\n  }\n  if (iM > 1)\n    Lanjie(iM - 1);\n  return;\n}\nint main() {\n\n  cin >> kMis;\n  for (int i = 0; i < kMis; i++)\n    cin >> Mis[i];\n  for (int i = 0; i < kMis; i++) {\n    Array[i] = 1;\n  }\n  Lanjie(kMis);\n  int MaxLen = -1;\n  for (int i = 0; i < kMis; i++)\n    if (MaxLen < Array[i])\n      MaxLen = Array[i];\n  cout << MaxLen << endl;\n}\n"}
{"label": "10", "index": "18115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i])\n        t = 1 + max(a, i);\n      if (t > s[m])\n        s[m] = t;\n    }\n    return (s[m]);\n  }\n}\n"}
{"label": "10", "index": "18116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  int a[100], b[100], max = 0;\n  memset(b, 0, sizeof(b));\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        b[i] = (b[j] + 1) > b[i] ? (b[j] + 1) : b[i];\n    }\n    max = max > b[i] ? max : b[i];\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "18117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int k, height[25], maxC[25] = {0}, j, i, max = 0;\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &height[i]);\n\n    for (j = 0, max = 0; j < i; j++) {\n      if (height[j] >= height[i])\n        if (maxC[j] > max)\n          max = maxC[j];\n    }\n    if (max == 0)\n      maxC[i] = 1;\n    else\n      maxC[i] = ++max;\n  }\n\n  for (i = 1, max = 0; i < k; i++)\n    if (maxC[i] > max)\n      max = maxC[i];\n\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k = 0, count = 0;\n  int count1 = 0, count2 = 0;\n  int max = 0;\n  int num[25][2];\n  scanf(\"%d\", &k);\n  for (count = 0; count < k; ++count) {\n    scanf(\"%d\", &num[count][0]);\n    num[count][1] = 0;\n  }\n  for (count1 = 0; count1 < k; ++count1) {\n    max = 0;\n    for (count2 = 0; count2 < count1; ++count2) {\n      if (num[count2][1] >= max && num[count2][0] >= num[count1][0]) {\n        max = num[count2][1];\n        num[count1][1] = max + 1;\n      }\n    }\n  }\n  max = 0;\n  for (count = 0; count < k; ++count) {\n    if (num[count][1] >= max)\n      max = num[count][1];\n  }\n  cout << max + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "18119", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint rec[30], height[30];\nint maxV;\nint main() {\n  int n;\n  maxV = 0;\n  cin >> n;\n  if (n == 0) {\n    printf(\"%d\\n\", 0);\n    return 0;\n  }\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> height[i];\n    rec[i] = 1;\n    for (j = 0; j < i; j++)\n      if (height[j] >= height[i] && rec[j] + 1 > rec[i]) {\n        rec[i] = rec[j] + 1;\n      }\n    if (rec[i] > maxV) {\n      maxV = rec[i];\n    }\n  }\n  cout << maxV << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, a[25 + 10], n[25 + 10], s;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    n[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    int j;\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[i] >= a[j]) && (n[i] <= n[j]))\n        n[i] = n[j] + 1;\n    }\n  }\n  s = n[0];\n  for (i = 0; i < k; i++) {\n    if (n[i] > s)\n      s = n[i];\n  }\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint D(int *h, int i, int n) {\n  int j, z = 1, x;\n  if (i < n) {\n    for (j = i + 1; j < n + 1; j++) {\n      if (h[j - 1] <= h[i - 1]) {\n        x = D(h, j, n) + 1;\n        if (z < x)\n          z = x;\n      }\n    }\n  }\n  return z;\n}\nint main() {\n  int i, n, z = 1, h[25], x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n  for (i = 0; i < n; i++) {\n    x = D(h, i + 1, n);\n    if (z < x)\n      z = x;\n  }\n  cout << z;\n  return 0;\n}\n"}
{"label": "10", "index": "18122", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, i, j, n = 0, t;\nint a[25], b[25];\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        t = b[j] + 1;\n        if (t > b[i])\n          b[i] = t;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (b[i] > n)\n      n = b[i];\n  cout << n + 1;\n}\n"}
{"label": "10", "index": "18123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a < b)\n    return b;\n  else\n    return a;\n}\nint main() {\n  int num;\n  int h[100];\n  cin >> num;\n  int i, j, k;\n  for (i = 0; i < num; i++)\n    cin >> h[i];\n  int f[100] = {0};\n  f[0] = 1;\n  for (i = 1; i < num; i++) {\n    f[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j])\n        f[i] = max(f[i], f[j] + 1);\n    }\n  }\n  int result = f[0];\n  for (i = 1; i < num; i++) {\n    result = max(f[i], result);\n  }\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint LanJieShu(int x, int y, int c[]) {\n  int j, t;\n  if (x == y - 1)\n    return 1;\n  t = 0;\n  for (j = x + 1; j < y; j++) {\n    if ((c[j] <= c[x]) && (LanJieShu(j, y, c) > t))\n      t = LanJieShu(j, y, c);\n  }\n  return (t + 1);\n}\nint main() {\n  int n, i, u;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = LanJieShu(i, n, a);\n  u = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= u)\n      u = b[i];\n  }\n  printf(\"%d\\n\", u);\n}\n"}
{"label": "10", "index": "18125", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[30] = {0};\n  int m[30] = {0};\n  cin >> k;\n  cin >> a[0];\n  m[0] = 1;\n  int temp = 1;\n  for (int i = 1; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    int tempmax = 0;\n    for (int j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && m[j] > tempmax)\n        tempmax = m[j];\n    m[i] = tempmax + 1;\n    if (m[i] > temp)\n      temp = m[i];\n  }\n  cout << temp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18126", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint h[100], s[100] = {0}, n;\nint p(int i) {\n  int s1 = 0, s2, j;\n  if (s[i] == 0) {\n\n    for (j = i + 1; j < n; j++) {\n      s2 = s1;\n      if (h[i] < h[j])\n        s1 = 0;\n      else\n        s1 = p(j) + 1;\n      if (s1 < s2)\n        s1 = s2;\n    }\n    s[i] = s1;\n  } else\n    s1 = s[i];\n\n  return (s1);\n}\nint main() {\n  int i, s1 = 0, s2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < n; i++) {\n    s2 = s1;\n    s1 = p(i);\n    if (s1 < s2)\n      s1 = s2;\n  }\n  printf(\"%d\", s1 + 1);\n}\n"}
{"label": "10", "index": "18127", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint height[26];\nint max_1[26];\nvoid cha(int n) {\n  int premax_1, i, j;\n  for (i = 1; i <= 25; i++)\n    max_1[i] = 0;\n  for (i = 1; i <= n; i++) {\n    max_1[i] = 1;\n    for (j = 1; j < i; j++) {\n      if (height[i] <= height[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n  cha(n);\n  num = -1;\n  for (i = 1; i <= n; i++) {\n    if (num < max_1[i])\n      num = max_1[i];\n  }\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, a[100];\n  int n, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    if (i == n - 1)\n      sum[i] = 1;\n    else {\n      for (j = i + 1; j <= n - 1; j++)\n        if (a[j] <= a[i]) {\n          if (sum[j] > max)\n            max = sum[j];\n        }\n      sum[i] = ++max;\n      max = 0;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= n - 1; i++)\n    if (sum[i] > max)\n      max = sum[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint height[26];\n\nint cal(int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (height[N] >= height[i]) {\n      sub = cal(i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  height[0] = 10000000;\n  scanf(\"%d\", &height[1]);\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  cout << cal(0, k + 1) - 2;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x, int y);\nint max(int x, int y) {\n  int z;\n  if (x > y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint main() {\n  int a[25] = {0};\n  int c[25];\n  int Height, k;\n  int n;\n  scanf(\"%d\", &k);\n  {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &Height);\n      a[n] = Height;\n      c[n] = 1;\n    }\n  }\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[j] <= a[i]) && (c[i] < c[j] + 1))\n        c[i] = c[j] + 1;\n    }\n  }\n\n  int cMax = c[0];\n  {\n    for (i = 0; i <= k - 1; i++) {\n      cMax = cMax > c[i] ? cMax : c[i];\n    }\n    printf(\"%d\", cMax);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h[25], num[25], k, n, i, j, max, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    num[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    flag = 0;\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i]) {\n        if (!flag) {\n          k = j;\n          flag = 1;\n        } else if (num[j] > num[k])\n          k = j;\n      }\n    if (flag)\n      num[i] = num[k] + 1;\n    else\n      num[i] = 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int missile[25], k;\n  int max[25], max1;\n  int i, j;\n  cin >> k;\n  max[k - 1] = 1;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &missile[i]);\n  for (i = k - 2; i >= 0; i--) {\n    max[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (missile[i] >= missile[j] && max[i] <= max[j])\n        max[i] = max[j] + 1;\n  }\n  for (i = 0, max1 = 0; i < k; i++)\n    if (max[i] > max1)\n      max1 = max[i];\n  printf(\"%d\", max1);\n  return 1;\n}\n"}
{"label": "10", "index": "18133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint main() {\n  int max(int k, int n);\n  int i, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (max(i, n) > m)\n      m = max(i, n);\n  }\n  printf(\"%d\", m);\n  return 0;\n}\nint max(int k, int n) {\n  int l = 0, j;\n  if (k == n - 1)\n    l = 0;\n  for (j = k + 1; j < n; j++) {\n    if (a[j] <= a[k]) {\n      if (max(j, n) > l)\n        l = max(j, n);\n    }\n  }\n  return l + 1;\n}\n"}
{"label": "10", "index": "18134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], f[26];\n  int i, j, k, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    f[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (f[i] > k)\n      k = f[i];\n  }\n  cout << k;\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint a[25] = {0};\nint b[25] = {0};\n\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  int n = 0;\n  for (j = 0; j < k; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j])\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (n <= b[i])\n      n = b[i];\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "18136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[28];\n  int m[28];\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n    m[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && m[j] + 1 > m[i]) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < m[i]) {\n      max = m[i];\n    }\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k;\n  cin >> k;\n  int a[k];\n  int num[k];\n  int i;\n  int j;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    num[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i])\n        if (num[i] < num[j] + 1)\n          num[i] = num[j] + 1;\n  int max = 1;\n  for (i = 0; i < k; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, i, j, an[30];\nint DFS(int h, int n) {\n  int t1, t2;\n  if (n == k - 1) {\n    if (an[n] > h)\n      return 0;\n    else\n      return 1;\n  }\n  if (an[n] > h)\n    return DFS(h, n + 1);\n  else {\n    t1 = DFS(h, n + 1);\n    t2 = DFS(an[n], n + 1) + 1;\n    if (t1 > t2)\n      return t1;\n    else\n      return t2;\n  }\n}\nint main() {\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> an[i];\n  }\n  cout << DFS(INT_MAX, 0) << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18139", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k];\n  int num[k];\n  int i;\n  int j;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    num[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (num[i] < num[j] + 1)\n          num[i] = num[j] + 1;\n    }\n  int max = 1;\n  for (i = 0; i < k; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[25];\nint f(int x) {\n  int t = 1, max = 1;\n  if (a[x + 1] == 0)\n    max = 1;\n  else {\n    for (int i = x + 1; a[i] != 0; i++)\n      if (a[x] >= a[i]) {\n        t = f(i) + 1;\n        if (t > max)\n          max = t;\n      }\n  }\n  return max;\n}\nint main() {\n  int n, t, max, i, M;\n  scanf(\"%d \", &n);\n  memset(a, 0, 25 * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  M = f(n - 1);\n  for (i = n - 2; i >= 0; i--) {\n    f(i);\n    if (M < f(i))\n      M = f(i);\n  }\n  printf(\"%d\", M);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100];\n\nint f(int a[], int n, int min) {\n  if (n == 1) {\n    if (a[0] >= min)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a[n - 1] < min)\n      return (f(a, n - 1, min));\n    else if (f(a, n - 1, a[n - 1]) + 1 < f(a, n - 1, min)) {\n      return (f(a, n - 1, min));\n    } else\n      return (f(a, n - 1, a[n - 1]) + 1);\n  }\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int result;\n  result = f(a, n, 0);\n  cout << result;\n  return 0;\n}\n"}
{"label": "10", "index": "18142", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  int a[30] = {0}, f[30] = {0};\n  cin >> N;\n  for (int i = 0; i < N; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  int ans = 0;\n  for (int i = 1; i < N; i++) {\n    int mx = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > mx) {\n        mx = f[j];\n      }\n    f[i] = mx + 1;\n    if (ans < f[i])\n      ans = f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[25], num;\nint b[25];\nint i, j, k;\n\nint main() {\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 1;\n  }\n  int max = 0;\n  b[0] = 1;\n  for (i = 1; i < num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        k = b[j] + 1;\n        if (k > b[i]) {\n          b[i] = k;\n          if (k > max) {\n            max = k;\n          }\n        }\n      }\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[26];\nint f(int j);\n\nint main() {\n  int i, k, t;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &s[i]);\n  for (t = 0, i = 1; i <= k; i++) {\n    if (f(i) > t)\n      t = f(i);\n  }\n  printf(\"%d\\n\", t);\n}\n\nint f(int j) {\n  int z, i, t;\n  if (j == 1)\n    z = 1;\n  else {\n    for (t = 0, i = 1; i < j; i++) {\n      if (s[i] >= s[j] && f(i) > t)\n        t = f(i);\n    }\n    z = t + 1;\n  }\n  return z;\n}\n"}
{"label": "10", "index": "18145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[30];\nint len[30];\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    cin >> a[n - i + 1];\n    len[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && (len[j] + 1 > len[i]))\n        len[i] = len[j] + 1;\n    }\n  int maxx = 0;\n  for (i = 1; i <= n; i++) {\n    if (len[i] > maxx)\n      maxx = len[i];\n  }\n  cout << maxx << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18146", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, k;\n  scanf(\"%d\", &a);\n  int b[a], c[a], d[25];\n  for (i = 0; i <= a - 1; i++)\n    cin >> b[a - 1 - i];\n  c[0] = 1;\n  for (i = 1; i <= a - 1; i++) {\n    for (k = 0; k <= 24; k++)\n      d[k] = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (b[i] >= b[j])\n        d[j] = c[j] + 1;\n      if (b[i] < b[j] && j == 0)\n        d[j] = 1;\n    }\n    for (k = 0; k <= 23; k++)\n      if (d[k] > d[k + 1]) {\n        int n = d[k];\n        d[k] = d[k + 1];\n        d[k + 1] = n;\n      }\n    c[i] = d[24];\n  }\n  for (i = 0; i <= a - 2; i++)\n    if (c[i] > c[i + 1]) {\n      int n = c[i];\n      c[i] = c[i + 1];\n      c[i + 1] = n;\n    }\n  printf(\"%d\", c[a - 1]);\n}\n"}
{"label": "10", "index": "18147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint lanjie(int x, int p);\nint max(int a, int b);\nint n, t = 0, h[25], r[25][10000];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  cout << lanjie(0, 10000);\n  return 0;\n}\nint lanjie(int x, int p) {\n  if (r[x][p])\n    return r[x][p];\n  else if (x == n - 1) {\n    if (h[x] <= p)\n      return r[x][p] = 1;\n    else\n      return r[x][p] = 0;\n  } else {\n    int f;\n    if (h[x] <= p)\n      f = max(1 + lanjie(x + 1, h[x]), lanjie(x + 1, p));\n    else\n      f = lanjie(x + 1, p);\n    return r[x][p] = f;\n  }\n}\nint max(int a, int b) { return (a > b) ? a : b; }\n"}
{"label": "10", "index": "18148", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, final;\n  int tomb[26];\n  int num[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> tomb[i];\n  memset(num, 0, sizeof(num));\n  num[n - 1] = 1;\n  final = 0;\n  for (i = n - 2; i >= 0; i--) {\n    j = i + 1;\n    max = 0;\n    while (j < n) {\n      if (tomb[j] <= tomb[i] && num[j] > max)\n        max = num[j];\n      j++;\n    }\n    num[i] = max + 1;\n    if (num[i] > final)\n      final = num[i];\n  }\n  printf(\"%d\\n\", final);\n  return 0;\n}\n"}
{"label": "10", "index": "18149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000], n, f[999][999];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint daodan(int s, int h) {\n  if (s == n)\n    return 0;\n  if (h >= a[s])\n    return max(daodan(s + 1, a[s]) + 1, daodan(s + 1, h));\n  else\n    return daodan(s + 1, h);\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << daodan(0, 31999);\n  return 0;\n}\n"}
{"label": "10", "index": "18150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int high[30];\n  int num[30] = {0};\n  int i, j;\n  for (i = 0; i < k; i++) {\n    cin >> high[i];\n  }\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    int max = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (high[i] <= high[j]) {\n        if (max < num[j])\n          max = num[j];\n      }\n    }\n    num[i] = max + 1;\n  }\n  sort(num, num + k);\n  printf(\"%d\", num[k - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "18151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[1000], len[1000], n, i, j, max, longest;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  longest = 1;\n  for (i = 0; i < n; i++) {\n    max = 1;\n    len[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        max = len[j] + 1;\n      if (len[i] < max)\n        len[i] = max;\n    }\n    if (len[i] > longest)\n      longest = len[i];\n  }\n  printf(\"%d \", longest);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[30], b[30], max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i - 1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[n - i] >= a[n - i + j] && b[n - i] <= b[n - i + j]) {\n        b[n - i] = 1 + b[n - i + j];\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (b[i - 1] > max)\n      max = b[i - 1];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = n - 2; i >= 0; i--) {\n    d = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[i] >= a[j])\n        if (b[j] > d)\n          d = b[j];\n    b[i] = b[i] + d;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > c)\n      c = b[i];\n  printf(\"%d\", c);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int d[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", d + i);\n  }\n  int opt[n];\n  for (int i = 0; i < n; i++) {\n    opt[i] = 0;\n  }\n  for (int i = n; i >= 0; i--)\n    for (int j = i; j < n; j++) {\n      if ((d[i] >= d[j]) && (opt[i] <= opt[j] + 1))\n        opt[i] = opt[j] + 1;\n    }\n  int max = 1;\n  for (int i = 0; i < n; i++) {\n    if (opt[i] > max)\n      max = opt[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18155", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint xu(int a[], int n, int k) {\n  int i, b = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[k] < a[i])\n      b++;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[k] > a[i]) {\n      b = b + 1;\n    }\n  }\n  return (b);\n}\nint max(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j]) {\n        k = 0;\n      }\n    }\n    if (k == 1) {\n      return i;\n    }\n  }\n}\nint maxd(int b[], int n) {\n  int i, j, k = 1;\n  for (i = 0; i < n; i++) {\n    k = 1;\n    for (j = i; j < n; j++) {\n      if (b[i] < b[j])\n        k = 0;\n    }\n    if (k == 1) {\n      return (b[i]);\n    }\n  }\n}\nint shai(int a[], int n) {\n  int i, j, m[30] = {0};\n\n  for (i = 0; i < n; i++) {\n    m[i] = xu(a, n, i);\n  }\n  if (maxd(m, n) == 0) {\n    return (n);\n  } else {\n    for (j = max(m, n); j < n; j++) {\n      a[j] = a[j + 1];\n    }\n    shai(a, n - 1);\n  }\n}\nint main() {\n  int k = 0;\n  int a[30] = {0};\n  int lRet;\n  scanf(\"%d\", &k);\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  lRet = shai(a, k);\n  printf(\"%d\", lRet);\n\n  return (1);\n}\n"}
{"label": "10", "index": "18156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[25], i, j, l, p, q;\n  int b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = k - 1; j >= 0; j--) {\n    for (l = k - 1; l >= j; l--) {\n      if (l != j) {\n        if ((a[j] >= a[l]) && (b[j] == b[l] - 1)) {\n          b[j] = b[l];\n        }\n      } else if (l == j) {\n        b[j] = b[j] + 1;\n      }\n    }\n  }\n  for (p = 1; p <= k - 1; p++) {\n    if (b[0] < b[p]) {\n      q = b[0];\n      b[0] = b[p];\n      b[p] = q;\n    }\n  }\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "18157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000], i, j, n, b[1000], max = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char g;\n  int c, d, f, a[25], b[25], k, e[25];\n  e[0] = 1;\n  scanf(\"%d\", &k);\n  for (c = 0;; c++) {\n    cin >> a[c] >> g;\n    if (g != ' ')\n      break;\n    else\n      ;\n  }\n  for (c = 0; c <= k - 1; c++)\n    b[c] = a[k - 1 - c];\n\n  for (c = 1; c <= k - 1; c++) {\n    for (d = 0, e[c] = 0; d <= c - 1; d++) {\n      if (b[c] >= b[d] && e[c] <= e[d])\n        e[c] = e[d];\n      else\n        ;\n    }\n    e[c]++;\n  }\n  for (c = 0, f = e[0]; c <= k - 1; c++) {\n    if (f <= e[c])\n      f = e[c];\n    else\n      ;\n  }\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "10", "index": "18159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int i, j, k, p[25], result, a[25], b[25], sum;\n  for (i = 0; i < 25; i++)\n    a[i] = b[i] = p[i] = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &p[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    sum = 0;\n    for (int m = 0; m < 25; m++)\n      a[m] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (p[j] <= p[i])\n        a[j] = b[j];\n      sum = max(sum, a[j]);\n    }\n    b[i] = sum + 1;\n  }\n  result = 0;\n  for (i = 0; i < k; i++)\n    result = max(result, b[i]);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "10", "index": "18160", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, dmax, n, array[32],\n      d[32] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &array[i]);\n\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((array[j] <= array[i]) && (d[i] < d[j] + 1)) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax) {\n      dmax = d[i];\n    }\n  }\n  printf(\"%d\", dmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30], count = 0, n, temp, i;\n  cin >> n;\n  while (n--) {\n    cin >> temp;\n    for (i = 0; i < count; i++)\n      if (temp > a[i]) {\n        a[i] = temp;\n        break;\n      }\n    if (i >= count) {\n      a[i] = temp;\n      count++;\n    }\n  }\n  cout << count << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint left(int *h, int i);\n\nint main() {\n  int n, i, h[1000], num, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n  for (i = n - 1; i >= 0; i--) {\n    num = left(h, i);\n    if (i == n - 1)\n      max = num;\n    else if (num > max)\n      max = num;\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n\nint left(int *h, int i) {\n  int j, flag = 0, num, max;\n\n  if (i == 0)\n    return 1;\n  else {\n    for (j = i - 1; j >= 0; j--) {\n      if (*(h + j) >= *(h + i)) {\n        num = left(h, j) + 1;\n        if (flag == 0) {\n          max = num;\n          flag = 1;\n        } else if (num > max)\n          max = num;\n      }\n    }\n    if (flag == 0)\n      return 1;\n    else\n      return max;\n  }\n}\n"}
{"label": "10", "index": "18163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[29], max_1[29] = {0}, count_1[29] = {0};\nint N;\nint select(int x) {\n  if (count_1[x] == 0) {\n\n    int i;\n    for (i = x + 1; i <= N; i++) {\n      if (a[x] >= a[i]) {\n        if (max_1[x] <= select(i)) {\n          max_1[x] = select(i) + 1;\n        }\n      }\n    }\n    if (max_1[x] == 0) {\n      max_1[x] = 1;\n    }\n    count_1[x] = 1;\n  }\n  \n  return max_1[x];\n}\n\nint main() {\n  int max_1m;\n  scanf(\"%d\", &N);\n  for (int j = 1; j <= N; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n  max_1m = select(1);\n  for (int k = 2; k <= N; k++) {\n    if (max_1m < select(k)) {\n      max_1m = select(k);\n    }\n  }\n  \n  printf(\"%d\", max_1m);\n}\n"}
{"label": "10", "index": "18164", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint dert(int, int);\nint main() {\n  int k, missile[25], i, result, donemax[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> missile[i];\n  donemax[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    int max = dert(missile[i], missile[i + 1]) * donemax[i + 1], j;\n    for (j = 1; j < k - i; j++)\n      if (max < dert(missile[i], missile[i + j]) * donemax[i + j])\n        max = dert(missile[i], missile[i + j]) * donemax[i + j];\n    donemax[i] = max + 1;\n  }\n  result = donemax[k - 1];\n  for (i = k - 2; i >= 0; i--) {\n\n    if (donemax[i] > result)\n      result = donemax[i];\n  }\n  printf(\"%d\\n\", result);\n}\nint dert(int x, int y) {\n  int z;\n  if (x >= y)\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\n"}
{"label": "10", "index": "18165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, i = 0, j;\n  int d[50];\n  int a[50];\n  int m;\n  scanf(\"%d\", &n);\n  t = n;\n  while (t--)\n    scanf(\"%d\", &d[i++]);\n  a[0] = 1;\n  m = 1;\n  for (j = 1; j < n; j++) {\n    a[j] = 1;\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (d[i] >= d[j]) {\n        if (a[i] + 1 > a[j])\n          a[j] = a[i] + 1;\n      }\n    }\n    if (a[j] > m)\n      m = a[j];\n  }\n  cout << m << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x[30], f[30], temp, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> x[i];\n  f[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      temp = 0;\n      if (x[i] <= x[j])\n        temp = f[j] + 1;\n      if (temp > max)\n        max = temp;\n    }\n    f[i] = max;\n  }\n  max = 1;\n  for (i = 0; i < k; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30];\n  for (int i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  cout << s[29];\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint data[1000];\nint ju[1000][1000];\nint weight[1000];\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int i = 0;\n  int j = 0;\n  int max = 0;\n\n  freopen(\"in.txt\", \"r\", stdin);\n  freopen(\"out.txt\", \"w\", stdout);\n  scanf(\"%d\", &n);\n  memset(ju, 0, sizeof(ju));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &data[i]);\n    weight[i] = 1;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (data[i] >= data[j]) {\n        ju[i][j] = 1;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (ju[i][j]) {\n        if (weight[i] < weight[j] + 1) {\n          weight[i] = weight[j] + 1;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < weight[i]) {\n      max = weight[i];\n    }\n  }\n  cout << max << \" \";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], i, j, k = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    k = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j] && b[j] > k) {\n        k = b[j];\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  k = b[0];\n  for (i = 0; i < n; i++) {\n    if (b[i] > k)\n      k = b[i];\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18170", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25];\n  int b[25];\n  int k, i, j, max2, max1;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < k; i++) {\n    max1 = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] <= a[j]) {\n        if (max1 < (b[j] + 1)) {\n          max1 = b[j] + 1;\n        }\n      }\n    }\n    b[i] = max1;\n  }\n  max2 = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max2)\n      max2 = b[i];\n  }\n  printf(\"%d\\n\", max2);\n  return 0;\n}\n"}
{"label": "10", "index": "18171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct z {\n  int g;\n  int h;\n};\nint main() {\n  int k, i, j, w;\n  struct z a[50];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i].g);\n  }\n  for (i = 0; i < k; i++)\n    a[i].h = 1;\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].g >= a[j].g) {\n        if (a[i].h < a[j].h + 1)\n          a[i].h = a[j].h + 1;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].h < a[j].h) {\n        w = a[i].h;\n        a[i].h = a[j].h;\n        a[j].h = w;\n      }\n    }\n  }\n  printf(\"%d\\n\", a[0].h);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18172", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n_max, i;\n  int a[25];\n  scanf(\"%d\", &k);\n  int n[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    n[i] = 1;\n  }\n  for (int j = k - 2; j >= 0; j--) {\n    for (int t = j + 1; t < k; t++) {\n      if (a[t] <= a[j] && n[j] <= n[t])\n        n[j] = n[t] + 1;\n    }\n  }\n  n_max = 0;\n  for (int p = 0; p < k; p++) {\n    if (n[p] > n_max)\n      n_max = n[p];\n  }\n  printf(\"%d \", n_max);\n}\n"}
{"label": "10", "index": "18173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], b[25];\n  int i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      j = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = j;\n    }\n  }\n  printf(\"%d\\n\", b[k - 1]);\n}\n"}
{"label": "10", "index": "18174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, h[25];\n  int len[25];\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  len[0] = 1;\n  int ans = 1;\n  for (i = 1; i < k; i++) {\n\n    int temp = -1, tIndex = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (len[j] > temp) {\n          temp = len[j];\n          tIndex = j;\n        }\n      }\n    }\n    if (temp == -1)\n      len[i] = 1;\n    else\n      len[i] = len[tIndex] + 1;\n\n    if (len[i] > ans)\n      ans = len[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = k - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (a[j] <= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18176", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int temp = 0;\n  int max = 1;\n  int z = 0;\n  scanf(\"%d \", &k);\n  int a[30];\n  int b[30] = {0};\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  b[0] = 1;\n  for (int i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        temp = b[j] + 1;\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n    b[i] = max;\n    if (max > z) {\n      z = max;\n    }\n    max = 1;\n  }\n  cout << z;\n  return 0;\n}\n"}
{"label": "10", "index": "18177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, max[100], sum[100], final;\n  final = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  sum[n - 1] = 1;\n  max[n - 1] = a[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    sum[i] = sum[n - 1];\n    max[i] = max[n - 1];\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= max[j] && sum[i] <= sum[j] + 1) {\n        sum[i] = sum[j] + 1;\n        max[i] = a[i];\n      }\n    }\n    if (sum[i] == 1 && a[i] < max[i])\n      max[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (final <= sum[i])\n      final = sum[i];\n  }\n  cout << final;\n  return 0;\n}\n"}
{"label": "10", "index": "18178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], d[25];\n  int max;\n  int i, j, k;\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j] && max < d[j]) {\n        max = d[j];\n      }\n    }\n    if (max == 0) {\n      d[i] = 1;\n    } else {\n      d[i] = max + 1;\n    }\n  }\n\n  for (i = 0, max = 0; i < k; i++) {\n    if (max < d[i])\n      max = d[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18179", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[30], b[30] = {0}, max = 0, flag = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int j = n, k; j >= 1; j--) {\n    max = 0;\n    flag = 0;\n    for (k = j; k <= n; k++) {\n      if (a[j] >= a[k]) {\n        flag = 1;\n        if (b[k] >= max) {\n          max = b[k];\n        }\n      }\n    }\n    if (flag) {\n      b[j] = max + 1;\n    } else {\n      b[j] = max;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(int h[], int a[], int i) {\n  int t, j;\n  for (j = 0, t = 0; j < i; j++)\n    if (h[j] >= h[i] && a[j] > t)\n      t = a[j];\n  a[i] = t + 1;\n}\nint main() {\n  int a[25], k, h[25], t, i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    f(h, a, i);\n  for (i = 0, t = 0; i < k; i++)\n    if (a[i] > t)\n      t = a[i];\n  cout << t << \"\\n\";\n}\n"}
{"label": "10", "index": "18181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nstatic int c[25];\nint max(int a, int b) {\n  if (a >= b)\n    return (a);\n  else\n    return (b);\n}\nint f(int mx, int st) {\n  for (; st < n; st++)\n    if (c[st] <= mx)\n      return (max(f(c[st], st + 1) + 1, f(mx, st + 1)));\n  return 0;\n}\nint main() {\n  int i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  s = f(4000, 0);\n  printf(\"%d\", s);\n}\n"}
{"label": "10", "index": "18182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, max = 0, u, j, a[26] = {0}, b[26] = {1};\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    b[i] = 1;\n  for (i = k - 1; i >= 1; i--)\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n      u = b[i];\n    }\n  for (i = 1; i <= k; i++)\n    max = (max >= b[i]) ? max : b[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "18183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num(int n, int *p) {\n  int i = 1, max = 0;\n  int *q = p + 1;\n  if (n == 2) {\n    if (*p >= *q)\n      return 2;\n    else\n      return 1;\n  } else {\n    while (i <= n) {\n      for (; *p < *q && i <= n; i++, q++)\n        ;\n      i++;\n      if (num(n - i + 1, q) + 1 > max)\n        max = num(n - i + 1, q) + 1;\n      q++;\n    }\n  }\n  return max;\n}\nint main() {\n  int k, i, a[25], max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (i = k; i >= 2; i--) {\n    if (num(i, a + k - i) > max)\n      max = num(i, a + k - i);\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 1;\n  int a[25];\n  int b[25];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, *b, max, maxn = 0, *a;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--)\n      if (a[j] <= a[i] && b[j] >= max) {\n        max = b[j];\n      }\n    b[i] = max + 1;\n    if (b[i] > maxn)\n      maxn = b[i];\n  }\n  cout << maxn << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18186", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int MAXN = 25 + 2;\nint n;\nint a[MAXN], f[MAXN];\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > max)\n      max = f[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18187", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sort(int k);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[25];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int d[25];\n  for (i = n - 1; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (d[i] > max)\n      max = d[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint cal(int *p, int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (*(p + N) >= *(p + i)) {\n      sub = cal(p, i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  int height[26];\n  height[0] = 10000000;\n  scanf(\"%d\", &height[1]);\n  for (i = 1; i <= k - 1; i++) {\n    cin >> height[i + 1];\n  }\n\n  cout << cal(height, 0, k + 1) - 2;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, m;\n  scanf(\"%d\", &n);\n  int i, h[26];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &h[i]);\n  };\n  int q[26];\n  for (i = 1; i <= n; i++) {\n    q[i] = 1;\n  };\n  for (i = n - 1; i >= 1; i--) {\n    m = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (h[j] <= h[i]) {\n        if (m < q[j])\n          m = q[j];\n        ;\n      };\n    };\n    q[i] = q[i] + m;\n  }\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    if (m < q[i]) {\n      m = q[i];\n    };\n  };\n  cout << m;\n}\n"}
{"label": "10", "index": "18190", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, ans;\n  int a[100], f[100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  ans = 1;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((a[j] >= a[i]) && (f[j] + 1 > f[i]))\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n\n  printf(\"%d\", ans);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max, h[25], t[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    t[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (h[i] >= h[j] && t[i] <= t[j]) {\n        t[i] = t[j] + 1;\n      }\n  for (max = 0, i = 0; i < k; i++)\n    if (t[i] > max)\n      max = t[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint H[1000], D[1000];\nvoid sort(int i) {\n  int j, k, m, n;\n  for (j = 0; j <= i; j++) {\n    m = j;\n    for (k = j; k <= i; k++)\n      if (D[m] > D[k])\n        m = k;\n    if (m != j) {\n      n = D[j];\n      D[j] = D[m];\n      D[m] = n;\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "18193", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[1000 + 10], f[1000 + 10];\n\nint main() {\n\n  cin >> n;\n  for (int i = 0; i < n; ++i) {\n    cin >> a[i];\n  }\n  int ans = 0;\n  for (int i = 0; i < n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[j] >= a[i])\n        f[i] = max(f[i], f[j]);\n    }\n    f[i]++;\n    ans = max(ans, f[i]);\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[25];\nint l[25];\nint main() {\n  scanf(\"%d \", &k);\n  int i, j;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 0;\n  }\n  l[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    int temp = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && l[j] + 1 > temp)\n        temp = l[j] + 1;\n    }\n    if (temp == -1)\n      l[i] = 1;\n    else\n      l[i] = temp;\n  }\n  int res = -1;\n\n  for (i = 0; i < k; i++) {\n    if (l[i] > res)\n      res = l[i];\n  }\n  cout << res << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100] = {0}, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &h[i]);\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[i] < m[j] + 1)) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = 0; p < k; p++) {\n    if (m[p] > max) {\n      max = m[p];\n    }\n  }\n  cout << max + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "18196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    max = (max > b[i]) ? max : b[i];\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100] = {0}, maxlen[100] = {0}, i, j, temp, temp2 = 1, temp3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    temp2 = 1;\n    if (i == 0)\n      maxlen[i] = 1;\n    else {\n      temp3 = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (a[j] >= a[i]) {\n          if (maxlen[j] > maxlen[temp3])\n            temp3 = j;\n          temp2 = 0;\n        }\n      }\n      maxlen[i] = maxlen[temp3] + 1;\n      if (temp2 == 1)\n        maxlen[i] = 1;\n    }\n  }\n  temp = 0;\n  for (i = 0; i < n; i++)\n    if (maxlen[i] > maxlen[temp])\n      temp = i;\n  printf(\"%d\", maxlen[temp]);\n}\n"}
{"label": "10", "index": "18198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[25], b[25] = {0}, m, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i; j <= k - 1; j++)\n      if (a[i] >= a[j] && m <= b[j])\n        m = b[j];\n    b[i] = m + 1;\n  }\n  m = b[0];\n  for (i = 0; i <= k - 1; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18199", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[36], f[36];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else {\n    return b;\n  }\n}\nint main() {\n  int k, i, j;\n  int ans = 0;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  f[0] = 0;\n  for (i = 1; i <= k; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n    ans = max(ans, f[i]);\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  cin >> k;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  cout << max(b) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[100], max;\n  double a[100];\n  memset(c, 0, sizeof(c));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%lf\", &a[i]);\n  c[n - 1] = 1;\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && c[j] > max)\n        max = c[j];\n    c[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (c[i] > max)\n      max = c[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n];\n  int i, j, max = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] <= a[i] && b[j] + 1 >= b[i]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int k, a[25], i, j, max, b[25] = {1};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && b[j] + 1 >= max)\n        max = b[j] + 1;\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, rec[25], n[25], m, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    cin >> rec[i];\n    n[i] = 1;\n  }\n  for (i = 1; i <= k - 1; i++)\n    for (j = 0; j < i; j++)\n      if (rec[j] >= rec[i])\n        n[i] = max(n[i], n[j] + 1);\n  m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, n[i]);\n  printf(\"%d\\n\", m);\n}\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\n"}
{"label": "10", "index": "18205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint num(int k, int i, int *p, int height) {\n  if (i == k)\n    return 0;\n  if (*(p + i) > height)\n    return (num(k, i + 1, p, height));\n  if (*(p + i) == height)\n    return (num(k, i + 1, p, height) + 1);\n  int a = num(k, i + 1, p, height);\n  int b = num(k, i + 1, p, *(p + i)) + 1;\n  return a > b ? a : b;\n}\nint main() {\n  int k, h[25], i;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d\", num(k, 0, h, 1000000000));\n  return 0;\n}\n"}
{"label": "10", "index": "18206", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint rec[26];\nint k, sum, i, j;\nint n[26];\nint max(int a, int b) {\n  if (a > b)\n    return (a);\n  else\n    return (b);\n}\nint main() {\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &rec[i]);\n  for (i = 1; i <= k; i++)\n    n[i] = 1;\n  for (i = 2; i <= k; i++)\n    for (j = 1; j < i; j++)\n      if (rec[i] <= rec[j])\n        n[i] = max(n[i], n[j] + 1);\n  sum = 0;\n  for (i = 1; i <= k; i++)\n    sum = max(sum, n[i]);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "10", "index": "18207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, a[26] = {0}, b[26] = {0}, max_1 = 0;\n\nvoid num(int site, int height) {\n  int i, amount = 0, h;\n  if (site == k) {\n    for (i = 0; i < k; i++) {\n      if (b[i] == 1) {\n        amount++;\n      }\n    }\n    if (max_1 < amount) {\n      max_1 = amount;\n    }\n\n  } else {\n    if (height < a[site]) {\n      num(site = site + 1, height);\n      site--;\n    } \n    else {\n      num(site = site + 1, height);\n      site--;\n      b[site] = 1;\n      h = height;\n      height = a[site];\n      num(site = site + 1, height);\n      site--;\n      b[site] = 0;\n      height = h;\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  num(0, 30000);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "18208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[], int n);\n  int a[30], n, i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  s = f(a, n);\n  printf(\"%d\", s);\n}\n\nint f(int a[], int n) {\n  int max(int x, int y);\n  int g(int a[], int n, int b);\n  if (n == 0)\n    return (0);\n  else\n    return (max(g(a + 1, n - 1, a[0]) + 1, f(a + 1, n - 1)));\n}\n\nint g(int a[], int n, int b) {\n  int max(int x, int y);\n  if (n == 0)\n    return (0);\n  else if (n == 1)\n    if (a[0] > b)\n      return (0);\n    else\n      return (1);\n  else if (a[0] > b)\n    return (g(a + 1, n - 1, b));\n  else\n    return (max(g(a + 1, n - 1, b), g(a + 1, n - 1, a[0]) + 1));\n}\nint max(int x, int y) { return (x > y ? x : y); }\n"}
{"label": "10", "index": "18209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = k - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = i + 1; j < k; j++)\n      if (a[j] <= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 55;\nint a[maxn], dp[maxn][maxn];\n\nint main() {\n  int n, i, j, ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    for (i = 1; i <= n; i++)\n      scanf(\"%d\", a + i);\n    memset(dp, -1, sizeof(dp));\n    for (i = 1; i <= n; i++)\n      dp[i][i] = 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j <= i; j++) {\n        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);\n        if (a[i + 1] <= a[j])\n          dp[i + 1][i + 1] = max(dp[i + 1][i + 1], dp[i][j] + 1);\n      }\n    }\n    ans = 0;\n    for (i = n, j = 1; j <= i; j++)\n      ans = max(ans, dp[i][j]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18211", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint compare(int x, int y) {\n  if (x <= y) {\n    x = (y + 1);\n  }\n  return x;\n}\n\nint main(void) {\n\n  int i, n, r, a, j;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i != n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  int *q = (int *)malloc(n * sizeof(int));\n  for (j = 0; j != n; j++) {\n    q[j] = 1;\n    for (r = 0; r != j; r++) {\n      if (p[j] <= p[r]) {\n        q[j] = compare(q[j], q[r]);\n      }\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 0; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18212", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num, max = 0;\n  cin >> num;\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n    if (flag[i] > max) {\n      max = flag[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25], i, j, max, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 0;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (a[j] <= a[i]) {\n        s = b[j] + 1;\n        if (s >= max)\n          max = s;\n      }\n    }\n    b[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int high[100], count[100];\n  for (i = 0; i < n; i++) {\n    count[i] = 0;\n    scanf(\"%d\", &high[i]);\n  }\n  high[n] = 0, count[n] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    int step = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (count[j] > step) {\n        if (high[j] <= high[i])\n          step = count[j];\n      }\n    }\n    count[i] = step + 1;\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (count[i] > max)\n      max = count[i];\n  cout << max;\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int d[25], f[25];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &d[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (d[j] >= d[i] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n  }\n  int ans = -1;\n  for (int i = 0; i < n; i++)\n    if (ans < f[i])\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], A[25] = {0}, n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  A[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i; j < n; j++)\n      if (a[i] >= a[j]) {\n        if (A[i] <= A[j])\n          A[i] = A[j] + 1;\n      }\n    if (A[i] == 0)\n      A[i] = 1;\n  }\n  max = A[0];\n  for (i = 0; i < n; i++) {\n    if (A[i] > max)\n      max = A[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18217", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[25];\nint l[25];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &h[i]);\n    l[i] = 0;\n  }\n  l[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    int temp = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && l[j] + 1 > temp)\n        temp = l[j] + 1;\n    }\n    if (temp == -1)\n      l[i] = 1;\n    else\n      l[i] = temp;\n  }\n  int res = -1;\n\n  for (i = 0; i < k; i++) {\n    if (l[i] > res)\n      res = l[i];\n  }\n  printf(\"%d\\n\", res);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, most;\n  int a[25], f[25];\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  f[0] = 1;\n  for (int i = 1; i < k; i++) {\n    most = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] > most) {\n          most = f[j];\n        }\n      }\n    }\n    f[i] = most + 1;\n  }\n  most = 0;\n  for (int i = 0; i < k; i++) {\n    if (f[i] > most)\n      most = f[i];\n  }\n  cout << most << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26], sum[26], imax[26];\nint c, j;\n\nint main() {\n  int i;\n  int find(int max, int q);\n  scanf(\"%d\\n\", &c);\n  for (i = 1; i <= c; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", find(10000, 1));\n  return 0;\n}\nint find(int max, int q) {\n  int i;\n  imax[q] = 0;\n  if (q != c) {\n    for (i = q; i <= c; i++) {\n      sum[q] = 0;\n      if (max >= a[i])\n        sum[q] = 1 + find(a[i], i + 1);\n      if (max < a[i])\n        sum[q] = find(max, i + 1);\n      if (sum[q] > imax[q])\n        imax[q] = sum[q];\n    }\n    return imax[q];\n  } else if (q = c && max >= a[q])\n    return 1;\n  else if (q = c && max < a[q])\n    return 0;\n}\n"}
{"label": "10", "index": "18220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a[25], i, j, l, p, q;\n  int b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = k - 1; j >= 0; j--) {\n    for (l = k - 1; l >= j; l--) {\n      if (l != j) {\n        if ((a[j] >= a[l]) && (b[j] == b[l] - 1)) {\n          b[j] = b[l];\n        }\n      } else if (l == j) {\n        b[j] = b[j] + 1;\n      }\n    }\n  }\n  for (p = 1; p <= k - 1; p++) {\n    if (b[0] < b[p]) {\n      q = b[0];\n      b[0] = b[p];\n      b[p] = q;\n    }\n  }\n  cout << b[0];\n}\n"}
{"label": "10", "index": "18221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint H[100];\nint N;\n\nint memo[40][40];\n\nint dp(int i, int k) { \n  int rslt;\n  if (i == N)\n    return 0;\n  if (memo[i][k] != -1)\n    return memo[i][k];\n  if (k != 30 && H[i] > H[k])\n    rslt = dp(i + 1, k);\n  else {\n    int a = dp(i + 1, i) + 1;\n    int b = dp(i + 1, k);\n    if (a > b)\n      rslt = a;\n    else\n      rslt = b;\n  }\n  return memo[i][k] = rslt;\n}\n\nint main() {\n  scanf(\"%d\", &N);\n  for (int i = 0; i < 40; i++)\n    for (int j = 0; j < 40; j++)\n      memo[i][j] = -1;\n  for (int i = 0; i < N; i++) {\n    scanf(\"%d\", &H[i]);\n  }\n  printf(\"%d\\n\", dp(0, 30));\n}\n"}
{"label": "10", "index": "18222", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n) {\n    return sum;\n  } else {\n    p = f(max, i + 1, sum);\n    if (max >= k[i])\n      q = f(k[i], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &k[i]);\n  printf(\"%d\", f(2147483647, 0, 0));\n}\n"}
{"label": "10", "index": "18223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[30], count = 0, n, temp, i;\n  cin >> n;\n  while (n--) {\n    scanf(\"%d \", &temp);\n    for (i = 0; i < count; i++)\n      if (temp > a[i]) {\n        a[i] = temp;\n        break;\n      }\n    if (i >= count) {\n      a[i] = temp;\n      count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "10", "index": "18224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    for (j = 0; j <= i; j++) {\n      if (b[i] <= b[j] && a[i] <= a[j]) {\n        a[i] = a[j];\n      }\n    }\n    a[i]++;\n    if (s < a[i]) {\n      s = a[i];\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18225", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int s[25];\n  int max[25];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &s[i]);\n  }\n  max[0] = 1;\n  for (i = 1; i < n; i++) {\n    int m = 1;\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && max[j] + 1 > m)\n        m = max[j] + 1;\n    }\n    max[i] = m;\n  }\n  int p = max[0];\n  for (i = 1; i < n; i++) {\n    if (max[i] > p)\n      p = max[i];\n  }\n  cout << p << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k = 0, max = 0;\n  scanf(\"%d\", &k);\n  int *h = (int *)malloc(k * sizeof(int));\n  int *p = (int *)malloc(k * sizeof(int));\n  for (int i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  p[k - 1] = 1;\n  for (int i = 0; i < k - 1; i++) {\n    for (int j = 1; k - 2 - i + j <= k - 1; j++) {\n      if (h[k - 2 - i] >= h[k - 2 - i + j]) {\n        if (max <= p[k - 2 - i + j])\n          max = p[k - 2 - i + j];\n      }\n    }\n    p[k - 2 - i] = max + 1;\n    max = 0;\n  }\n  max = p[0];\n  for (int i = 0; i < k; i++)\n    if (max < p[i])\n      max = p[i];\n  cout << max;\n  free(h);\n  free(p);\n  return 0;\n}\n"}
{"label": "10", "index": "18227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h[25], n, i, j, t, d[25] = {0}, max = 0, in;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (h[j] <= h[i] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] > max) {\n      max = d[i];\n    }\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "18228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30];\nint main() {\n  int a[100], k, i, n;\n  for (i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && t < max(a, i))\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "18229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct missile {\n  int num;\n  int high;\n};\nstruct missile a[25];\nvoid f(int n, int sum);\nint main() {\n  int i = 0, j = 0, sum = 0, max = 0;\n  scanf(\"%d\", &sum);\n  \n  for (i = 0; i <= sum - 1; i++) \n  {\n    scanf(\"%d\", &a[i].high);\n  }\n  for (i = sum - 1; i >= 0; i--) \n  {\n    f(i, sum);\n  }\n  for (i = 0; i <= sum - 1; i++) \n  {\n    if (a[i].num > max) {\n      max = a[i].num;\n    }\n  }\n  printf(\"%d\", max);\n}\nvoid f(int n, int sum) {\n  int i = 0, t = 1; \n  if (n == sum - 1) {\n    a[n].num = 1;\n  } else {\n    a[n].num = 1;\n    for (i = n + 1; i <= sum - 1; i++) {\n      if (a[n].high >= a[i].high) {\n        if (a[i].num + 1 > a[n].num) {\n          a[n].num = a[i].num + 1;\n        } \n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "18230", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int w[30];\n  int f[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &w[i]);\n  w[0] = 99999;\n  f[0] = 0;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (w[j] >= w[i])\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n  }\n  int m = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > m)\n      m = f[i];\n  printf(\"%d\", m);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[25], b[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = 1; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] >= a[j] && b[j] + 1 >= b[i])\n        b[i] = b[j] + 1;\n  k = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > k)\n      k = b[i];\n  cout << k;\n}\n"}
{"label": "10", "index": "18232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint l, n;\nint a[30];\nvoid measure(int k, int s, int m) {\n  int i;\n  if (k == n) {\n    if (s > l)\n      l = s;\n  } else {\n    for (i = k + 1; i <= n; i++)\n      if (a[i - 1] <= m)\n        measure(i, s + 1, a[i - 1]);\n    measure(n, s, m);\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  measure(0, 0, 10000);\n  cout << l << \"\\n\";\n}\n"}
{"label": "10", "index": "18233", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s[28];\n  int m[28];\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n    m[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && m[j] + 1 > m[i]) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < m[i])\n      max = m[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rec[26];\nint k, sum, i, j;\nint n[26];\nint max(int a, int b) {\n  if (a > b)\n    return (a);\n  else\n    return (b);\n}\nint main() {\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &rec[i]);\n  for (i = 1; i <= k; i++)\n    n[i] = 1;\n  for (i = 2; i <= k; i++)\n    for (j = 1; j < i; j++)\n      if (rec[i] <= rec[j])\n        n[i] = max(n[i], n[j] + 1);\n  sum = 0;\n  for (i = 1; i <= k; i++)\n    sum = max(sum, n[i]);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "10", "index": "18235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int k, int i, int *p, int height) {\n  if (i == k)\n    return 0;\n  if (*(p + i) > height)\n    return (num(k, i + 1, p, height));\n  if (*(p + i) == height)\n    return (num(k, i + 1, p, height) + 1);\n  int a = num(k, i + 1, p, height);\n  int b = num(k, i + 1, p, *(p + i)) + 1;\n  return a > b ? a : b;\n}\nint main() {\n  int k, h[25], i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d\", num(k, 0, h, 1000000000));\n  return 0;\n}\n"}
{"label": "10", "index": "18236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[30];\n  int i;\n  for (i = n - 1; i >= 0; i--) {\n    cin >> a[i];\n  }\n\n  int b[30];\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1) {\n\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int w[30];\n  int f[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> w[i];\n  w[0] = 99999;\n  f[0] = 0;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (w[j] >= w[i])\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n  }\n  int m = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > m)\n      m = f[i];\n  printf(\"%d\", m);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18238", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, num = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = b[i];\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (b[j] >= max))\n        max = b[j];\n    }\n    b[i] = max + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (b[i] > num)\n      num = b[i];\n  printf(\"%d \", num);\n}\n"}
{"label": "10", "index": "18239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, b[25], a[25], c, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i < k; i++) {\n    a[0] = 1;\n    c = 1;\n    for (j = 0; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (a[j] > c) {\n          c = a[j];\n        }\n      }\n    }\n    a[i] = c + 1;\n  }\n  c = 0;\n  for (i = 0; i < k; i++) {\n    if (a[i] > c) {\n      c = a[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26];\nint n;\nint sum(int k, int b) {\n  int x;\n  if (k == 0)\n    x = 0;\n  else if (k != 0) {\n    if ((a[n - k] <= b)) {\n      if ((sum(k - 1, a[n - k]) + 1) >= sum(k - 1, b)) {\n        b = a[n - k];\n        x = 1 + sum(k - 1, b);\n      } else\n        x = sum(k - 1, b);\n\n    } else if ((a[n - k] > b))\n      x = sum(k - 1, b);\n  }\n  return x;\n}\nint main() {\n  int i, j;\n  int c = 9999;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n  }\n  cout << sum(n, c);\n}\n"}
{"label": "10", "index": "18241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, h[30], l[30], r[30];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 1;\n    r[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && (l[j] + 1) > l[i]) {\n        l[i] = l[j] + 1;\n      }\n    }\n  }\n  for (i = k - 2; i > 0; i--) {\n    for (int j = k - 1; j > i; j--) {\n      if (h[j] <= h[i] && (r[j] + 1) > r[i]) {\n        r[i] = r[j] + 1;\n      }\n    }\n  }\n  int m = 0;\n  for (i = 0; i < k; i++) {\n    if (l[i] + r[i] - 1 > m) {\n      m = l[i] + r[i] - 1;\n    }\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n], b[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= b[i]))\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n}\n"}
{"label": "10", "index": "18243", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 0, count = 0;\n  int count1 = 0, count2 = 0;\n  int max = 0;\n  int num[25][2];\n\n  scanf(\"%d \", &k);\n  for (count = 0; count < k; ++count) {\n    scanf(\"%d\", &num[count][0]);\n    num[count][1] = 0;\n  }\n  for (count1 = 0; count1 < k; ++count1) {\n    max = 0;\n    for (count2 = 0; count2 < count1; ++count2) {\n      if (num[count2][1] >= max && num[count2][0] >= num[count1][0]) {\n        max = num[count2][1];\n        num[count1][1] = max + 1;\n      }\n    }\n  }\n  max = 0;\n  for (count = 0; count < k; ++count) {\n    if (num[count][1] >= max) {\n      max = num[count][1];\n    }\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "18244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint H[1000], D[1000];\nvoid sort(int i) {\n  int j, k, m, n;\n  for (j = 0; j <= i; j++) {\n    m = j;\n    for (k = j; k <= i; k++)\n      if (D[m] > D[k])\n        m = k;\n    if (m != j) {\n      n = D[j];\n      D[j] = D[m];\n      D[m] = n;\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, temp;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n)\n        n = D[k];\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "10", "index": "18245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint LanJieShu(int x, int y, int c[]) {\n  int j, t;\n  if (x == y - 1)\n    return 1;\n  t = 0;\n  for (j = x + 1; j < y; j++) {\n    if ((c[j] <= c[x]) && (LanJieShu(j, y, c) > t))\n      t = LanJieShu(j, y, c);\n  }\n  return (t + 1);\n}\nint main() {\n  int n, i, u;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = LanJieShu(i, n, a);\n  u = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] >= u)\n      u = b[i];\n  }\n  cout << u << \"\\n\";\n}\n"}
{"label": "10", "index": "18246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h[25], b[25], k, i, j, m, n;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    b[i] = 1;\n  }\n  for (j = k - 1; j >= 0; j--)\n    for (m = j + 1; m < k; m++) {\n      if (h[j] >= h[m] && b[j] < (b[m] + 1))\n        b[j] = b[m] + 1;\n    }\n  for (i = 0; i < k - 1; i++)\n    b[i + 1] = (b[i] > b[i + 1]) ? b[i] : b[i + 1];\n  n = b[k - 1];\n  cout << n;\n}\n"}
{"label": "10", "index": "18247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[26] = {0}, i, j, z, l[26] = {1};\n  scanf(\"%d\", &n);\n  for (i = n; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (z = j = 0; j < i; j++)\n      if (a[i] >= a[j] && z <= l[j])\n        z = l[j] + 1;\n    l[i] = z;\n  }\n  for (z = i = 0; i <= n; i++)\n    if (l[i] > z)\n      z = l[i];\n  printf(\"%d\\n\", z - 1);\n}\n"}
{"label": "10", "index": "18248", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k];\n  int num[k];\n  int i;\n  int j;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    num[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (num[i] < num[j] + 1)\n          num[i] = num[j] + 1;\n    }\n  int max = 1;\n  for (i = 0; i < k; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num;\n  scanf(\"%d\", &num);\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n  }\n  int max = flag[0];\n  for (int i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18250", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000], i, j, n, b[1000], max = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint run() {\n  int i, j, a[33], b[33];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        if (b[j] < b[i] + 1)\n          b[j] = b[i] + 1;\n  j = 0;\n  for (i = 1; i <= n; i++)\n    if (b[i] > j)\n      j = b[i];\n  cout << j << \"\\n\";\n}\nint main() {\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    run();\n    n = 0;\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint main() {\n  int d(int xz, int p, int q);\n  int y, i, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  y = d(10000, 1, n);\n  printf(\"%d\", y);\n  return 0;\n}\nint d(int xz, int p, int q) {\n  int g, h;\n  if (p == q && a[p] <= xz)\n    return 1;\n  else if (p == q && a[p] > xz)\n    return 0;\n  else {\n    if (xz < a[p])\n      return (d(xz, p + 1, q));\n    else {\n      g = 1 + d(a[p], p + 1, q);\n      h = d(xz, p + 1, q);\n      if (g > h)\n        return (g);\n      else\n        return (h);\n    }\n  }\n}\n"}
{"label": "10", "index": "18253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int a[25], b[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int max = 1;\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    t = 1;\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && t < b[j] + 1)\n        t = b[j] + 1;\n    b[i] = t;\n    max = b[i] > max ? b[i] : max;\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int b[25];\n  int i, j, max;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (max < b[j])\n          max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint search(int a[], int b, int c);\nint main() {\n  int n, s = 1, t, k;\n  int *p, *a, *b;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(n * sizeof(int));\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    a[i] = -1;\n  a[1] = p[0];\n  for (int i = 0; i < n; i++) {\n    t = 0;\n    k = search(a, s, p[i]);\n    if (k > s)\n      s++;\n    a[k] = p[i];\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\nint search(int a[], int s, int m) {\n  int low = 1;\n  int high = s;\n  int mid;\n\n  while (low < high) {\n    mid = (low + high) / 2;\n    if (a[mid] == m)\n      return mid + 1;\n    if (a[mid] > m)\n      low = mid + 1;\n    else\n      high = mid;\n  }\n  if (a[low] <= m)\n    return low;\n  else\n    return low + 1;\n}\n"}
{"label": "10", "index": "18256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint search(int a[], int b, int c);\nint main() {\n  int n, s = 1, t, k;\n  int *p, *a, *b;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(n * sizeof(int));\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n  for (int i = 0; i < n; i++)\n    a[i] = -1;\n  a[1] = p[0];\n  for (int i = 0; i < n; i++) {\n    t = 0;\n    k = search(a, s, p[i]);\n    if (k > s)\n      s++;\n    a[k] = p[i];\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\nint search(int a[], int s, int m) {\n  int low = 1;\n  int high = s;\n  int mid;\n\n  while (low < high) {\n    mid = (low + high) / 2;\n    if (a[mid] == m)\n      return mid + 1;\n    if (a[mid] > m)\n      low = mid + 1;\n    else\n      high = mid;\n  }\n  if (a[low] <= m)\n    return low;\n  else\n    return low + 1;\n}\n"}
{"label": "10", "index": "18257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int height[50], flag[50], max, i, j;\n  int num;\n\n  scanf(\"%d\", &num);\n\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &height[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (height[j] >= height[i]) {\n        if (flag[j] + 1 > flag[i])\n          flag[i] = flag[j] + 1;\n      }\n    }\n  }\n\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int h[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  int m[n];\n  for (int i = 0; i < n; i++)\n    m[i] = 0;\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (h[i] >= h[j] && m[i] - 1 < m[j])\n        m[i] = m[j] + 1;\n      if (j == n - 1 && m[i] == 0)\n        m[i] = 1;\n    }\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (m[i] > max)\n      max = m[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint height[26];\nint len(int num) {\n  int temp, max, i;\n  if (num == k)\n    return (1);\n  else {\n    max = 0;\n    for (i = num + 1; i <= k; i++) {\n      if (height[num] >= height[i]) {\n        temp = len(i);\n        if (max < temp)\n          max = temp;\n      }\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  height[0] = 30001;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  printf(\"%d\", len(0) - 1);\n  scanf(\"%d\", &k);\n}\n"}
{"label": "10", "index": "18260", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  int a[25], b[25];\n  m = 0;\n\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (a[j] >= a[i]) {\n        if ((b[i] + 1) >= b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18261", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 30;\n\nint a[N];\nint len[N];\n\nint main() {\n  int k;\n  int i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  len[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[i] && max < len[j]) {\n        max = len[j];\n      }\n    }\n    len[i] = max + 1;\n  }\n  max = -1;\n  for (i = 0; i < k; i++) {\n    if (max < len[i]) {\n      max = len[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, f[25] = {1}, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n      else if (f[i] == 0)\n        f[i] = 1;\n  for (i = 0; i < k; i++)\n    if (t < f[i])\n      t = f[i];\n  cout << \"\\n\" << t;\n  return 0;\n}\n"}
{"label": "10", "index": "18263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[26], n, maxnum[26], temp[26];\n  cin >> n;\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &high[i]);\n  maxnum[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int len = 0;\n    for (j = i + 1; j < n; j++) {\n      if (high[i] >= high[j]) {\n        temp[len++] = 1 + maxnum[j];\n      }\n    }\n    int mark1 = 1;\n    for (k = 0; k < len; k++) {\n      if (temp[k] >= mark1)\n        mark1 = temp[k];\n    }\n    maxnum[i] = mark1;\n  }\n  int mark2 = 0;\n  for (i = 0; i < n; i++) {\n    if (maxnum[i] >= mark2)\n      mark2 = maxnum[i];\n  }\n  cout << mark2;\n  return 0;\n}\n"}
{"label": "10", "index": "18264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k;\n  int d[25];\n  int f[25];\n  int max = 0;\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    cin >> d[i];\n    f[i] = 1;\n  }\n\n  while (1) {\n    int tmp = 0;\n    int x = 0;\n    int y = 0;\n\n    int ci;\n    for (ci = 0; ci < k; ci++) {\n      if (f[ci] == 1) {\n        y++;\n        if (x == 0) {\n          tmp = d[ci];\n          x++;\n        } else {\n          if (d[ci] <= tmp) {\n            tmp = d[ci];\n            x++;\n          } else\n            break;\n        }\n      }\n    }\n\n    if (x == y)\n      if (x > max)\n        max = x;\n\n    int cnt;\n    for (cnt = 0; cnt < k; cnt++) {\n      if (f[cnt] != 0)\n        break;\n    }\n    if (cnt == k)\n      break;\n\n    f[k - 1]--;\n    for (int i = k - 1; i > 0; i--) {\n      if (f[i] == -1) {\n        f[i] = 1;\n        f[i - 1]--;\n      }\n    }\n  }\n\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18265", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, max, a[100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (b[i] > max)\n      max = b[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, h[25], a[25][25] = {0}; \n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> h[i];\n  int max = 1;\n  for (int i = 0; i < k; i++) \n    a[i][i] = 1;\n  for (int i = 0; i < k - 1; i++)\n    for (int j = i + 1; j < k; j++) {\n      a[i][j] = 1;\n      for (int k = i; k < j; k++)\n        if (h[k] >= h[j] && a[i][k] + 1 > a[i][j])\n          a[i][j] = a[i][k] + 1;\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18267", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint aa(int high[], int n, int k, int lh, int point) {\n  int remax = 0, a = 0, i;\n  if (point == k - 1) {\n    if (lh >= high[k - 1])\n      return 1;\n    else\n      return 0;\n  } else {\n    for (i = point; i < k; i++)\n      if (high[i] <= lh) {\n        a = aa(high, n + 1, k, high[i], i + 1) + 1;\n        if (a > remax)\n          remax = a;\n      }\n    return remax;\n  }\n}\n\nint main() {\n  int i, high[25], k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> high[i];\n  printf(\"%d\", aa(high, 0, k, 32767, 0));\n}\n"}
{"label": "10", "index": "18268", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  \n  int i, j, N, anNum[1000], anFlag[1000];\n  scanf(\"%d\", &N);\n  memset(anFlag, 1, sizeof(anFlag));\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &anNum[i]);\n    anFlag[i] = 1;\n  }\n  for (i = N - 2; i >= 0; i--) {\n    int Max = 0;\n    for (j = i + 1; j < N; j++) {\n      if (anNum[i] >= anNum[j]) {\n        if (anFlag[j] > Max)\n          Max = anFlag[j];\n      }\n    }\n    anFlag[i] = Max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < N; i++)\n    if (anFlag[i] > Max)\n      Max = anFlag[i];\n  printf(\"%d \", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "18269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max(int b[100], int n) {\n  int max = b[0];\n  int i;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  return max;\n}\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[30], b[30] = {0}, d = 0;\n  for (int i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[k - 1] = 1;\n  int i, j;\n  for (i = k - 2; i >= 0; i--) {\n    int c[30] = {0};\n    d = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        c[d] = b[j];\n        d++;\n      }\n    }\n    b[i] = Max(c, d) + 1;\n  }\n  int max = Max(b, k);\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18270", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint h[100], s[100] = {0}, n;\nint p(int i) {\n  int s1 = 0, s2, j;\n  if (s[i] == 0) {\n\n    for (j = i + 1; j < n; j++) {\n      s2 = s1;\n      if (h[i] < h[j])\n        s1 = 0;\n      else\n        s1 = p(j) + 1;\n      if (s1 < s2)\n        s1 = s2;\n    }\n    s[i] = s1;\n  } else\n    s1 = s[i];\n\n  return (s1);\n}\nint main() {\n  int i, s1 = 0, s2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> h[i];\n  for (i = 0; i < n; i++) {\n    s2 = s1;\n    s1 = p(i);\n    if (s1 < s2) {\n      s1 = s2;\n    }\n  }\n  printf(\"%d\", s1 + 1);\n}\n"}
{"label": "10", "index": "18271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, b[25] = {0}, max;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  for (j = k - 1; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i < k; i++) {\n      if (a[i] <= a[j]) {\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[j] = max + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18272", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int height[25], amount[25] = {0};\n  int n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &height[i]);\n  }\n  scanf(\"%d \", &height[n - 1]);\n  amount[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (amount[j] > max && height[j] <= height[i]) {\n        max = amount[j];\n      }\n    }\n    amount[i] = max + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (amount[i] > max)\n      max = amount[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  int a[100], b[100], max = 0;\n  memset(b, 0, sizeof(b));\n  for (i = 0; i < N; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        b[i] = (b[j] + 1) > b[i] ? (b[j] + 1) : b[i];\n    }\n    max = max > b[i] ? max : b[i];\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max_1[26] = {0};\nint a[26] = {0};\nvoid attack(int n) {\n  int i = 0, j = 0, premax_1 = 0;\n  for (i = 0; i < n; i++) {\n    max_1[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  static int n, i, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  attack(n);\n  num = max_1[0];\n  for (i = 1; i < n; i++)\n    if (max_1[i] > num)\n      num = max_1[i];\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k[26][2];\nint main() {\n  int i, j, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k[i][1]);\n    k[i][0] = 1;\n    for (j = 0; j < i; j++) {\n      if (k[j][1] >= k[i][1] && k[j][0] + 1 > k[i][0])\n        k[i][0] = k[j][0] + 1;\n    }\n    if (k[i][0] > m)\n      m = k[i][0];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int a[k], f[k], s = 0;\n  for (int i = 0; i < k; i++)\n    f[i] = 1;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n  for (int i = k - 2; i >= 0; i--) {\n    for (int j = k - 1; j > i; j--)\n      if (a[i] >= a[j] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n    if (s < f[i])\n      s = f[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "18277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n, i, j, e, s, r, t;\n  int a[300], b[300];\n  scanf(\"%d\", &k);\n  s = 1;\n  r = 1;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = i;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] < a[j]) {\n        e = a[i];\n        a[i] = a[j];\n        a[j] = e;\n        e = b[i];\n        b[i] = b[j];\n        b[j] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    n = b[i];\n    r = 1;\n    for (j = i + 1; j < k; j++) {\n      if (b[j] > n) {\n        r++;\n        n = b[j];\n      }\n    }\n    if (r > s) {\n      s = r;\n      t = i;\n    }\n  }\n  if (k == 25) {\n    s = s + 2;\n  };\n\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "18278", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k = 0;\nint a[100];\nint dp[100];\n\nint solve() {\n  int ans = 0;\n\n  dp[0] = 1;\n  for (int i = 1; i < k; i++) {\n    dp[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i])\n        dp[i] = dp[j] + 1;\n    }\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n\n  return ans;\n}\n\nint main() {\n  freopen(\"input.txt\", \"r\", stdin);\n  freopen(\"output.txt\", \"w\", stdout);\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  printf(\"%d\\n\", solve());\n\n  return 0;\n}\n"}
{"label": "10", "index": "18279", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 1010;\n\nint n, m, k;\nint q[N];\nint f[N];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d\", &q[i]);\n  q[0] = 1000000000;\n  for (int i = 1; i <= n; i++)\n    for (int j = 0; j < i; j++)\n      if (q[j] >= q[i])\n        f[i] = max(f[i], f[j] + 1);\n  int res = 0;\n  for (int i = 1; i <= n; i++)\n    res = max(res, f[i]);\n  printf(\"%d\\n\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "18280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[30], b[30];\n  for (int i = 0; i < 30; i++)\n    a[i] = b[i] = 1;\n\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 1;\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (1 + b[j] > max)\n          max = 1 + b[j];\n      }\n    }\n    b[i] = max;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18281", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, a[25], b[25];\n  int i, j, p, q;\n  int tmp, tmpmax, max;\n  scanf(\"%d\", &k); \n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (p = 1; p < k; p++) {\n    for (q = 0; q < p; q++) {\n      if (a[p] <= a[q]) {\n        tmp = b[q] + 1;\n        if (tmp > b[p])\n          b[p] = tmp;\n      }\n    }\n  }\n  max = 1;\n  for (j = 1; j < k; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[25];\nint result[25];\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = k - 1; i >= 0; i--)\n    cin >> a[i];\n\n  result[0] = 1;\n  for (int i = 1; i < k; i++) {\n    int j = i - 1;\n    while (j >= 0) {\n      if (a[j] <= a[i]) {\n        if (result[j] > result[i])\n          result[i] = result[j];\n      }\n      j--;\n    }\n    result[i]++;\n  }\n\n  int t = 0;\n  for (int i = 0; i < k; i++) {\n    if (result[i] > t)\n      t = result[i];\n  }\n\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "18283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(int n, int *p) {\n  int i = 1, max = 0;\n  int *q = p + 1;\n  if (n == 2) {\n    if (*p >= *q)\n      return 2;\n    else\n      return 1;\n  } else {\n    while (i <= n) {\n      for (; *p < *q && i <= n; i++, q++)\n        ;\n      i++;\n      if (num(n - i + 1, q) + 1 > max)\n        max = num(n - i + 1, q) + 1;\n      q++;\n    }\n  }\n  return max;\n}\nint main() {\n  int k, i, a[25], max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 2; i--) {\n    if (num(i, a + k - i) > max)\n      max = num(i, a + k - i);\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, h, b[25] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (b[j] + 1 > max)\n          max = b[j] + 1;\n      }\n    }\n    if (max == 0)\n      max = 1;\n    b[i] = max;\n    max = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int x[], int n);\nint main() {\n  int a[26] = {0}, b[26] = {0};\n  int i, j, n, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = n - 1; i >= 0; i--) {\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= sum)\n          sum = b[j];\n      }\n    }\n    b[i] = sum + 1;\n  }\n  cout << max(b, n) << \" \";\n}\nint max(int x[], int n) {\n  int i, s = 0;\n  for (i = 0; i < n; i++) {\n    if (x[i] > s)\n      s = x[i];\n  }\n  return (s);\n}\n"}
{"label": "10", "index": "18286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, a[26] = {0}, b[26] = {0}, max_1 = 0;\n\nvoid num(int site, int height) {\n  int i, amount = 0, h;\n  if (site == k) {\n    for (i = 0; i < k; i++) {\n      if (b[i] == 1)\n        amount++;\n    }\n    if (max_1 < amount) {\n      max_1 = amount;\n    }\n\n  } else {\n    if (height < a[site]) {\n      num(site = site + 1, height);\n      site--;\n    } else {\n      num(site = site + 1, height);\n      site--;\n      b[site] = 1;\n      h = height;\n      height = a[site];\n      num(site = site + 1, height);\n      site--;\n      b[site] = 0;\n      height = h;\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  num(0, 30000);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "18287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, max[100], sum[100], final;\n  final = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n  }\n  sum[n - 1] = 1;\n  max[n - 1] = a[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    sum[i] = sum[n - 1];\n    max[i] = max[n - 1];\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= max[j] && sum[i] <= sum[j] + 1) {\n        sum[i] = sum[j] + 1;\n        max[i] = a[i];\n      }\n    }\n    if (sum[i] == 1 && a[i] < max[i])\n      max[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (final <= sum[i])\n      final = sum[i];\n  }\n  printf(\"%d\", final);\n}\n"}
{"label": "10", "index": "18288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lj(int a[], int n, int m);\n  int n, m, i, j, l, k = 0, s, t = 0, a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    b[i] = lj(a, i, k);\n  for (i = 0; i < k; i++) {\n    if (t < b[i])\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\nint lj(int a[], int n, int m) {\n  int i, t, p, l = 0, b[25];\n  if (n == m - 1)\n    return 1;\n  else {\n    for (i = 0; i < 25; i++)\n      b[i] = 0;\n    for (i = n + 1; i < m; i++) {\n      if (a[i] <= a[n])\n        b[i] = lj(a, i, m);\n    }\n    t = b[n + 1];\n    for (i = n + 1; i < m; i++) {\n      if (t < b[i])\n        t = b[i];\n    }\n    return t + 1;\n  }\n}\n"}
{"label": "10", "index": "18289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, n, i, j, e, s, r, t;\n  int a[300], b[300];\n  scanf(\"%d\", &k);\n  s = 1;\n  r = 1;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = i;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i] < a[j]) {\n        e = a[i];\n        a[i] = a[j];\n        a[j] = e;\n        e = b[i];\n        b[i] = b[j];\n        b[j] = e;\n      }\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    n = b[i];\n    r = 1;\n    for (j = i + 1; j < k; j++) {\n      if (b[j] > n) {\n        r++;\n        n = b[j];\n      }\n    }\n    if (r > s) {\n      s = r;\n      t = i;\n    }\n  }\n  if (k == 25)\n    s = s + 2;\n  ;\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[26], b[26], k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = 1;\n  k = 1;\n  for (j = 1; j < n; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j]) {\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n    if (b[j] > k)\n      k = b[j];\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18291", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a[], int n) {\n  int b[25];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++)\n    if (b[i] > max)\n      max = (b[i]);\n  return max;\n}\nint main() {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", f(a, n));\n  return 0;\n}\n"}
{"label": "10", "index": "18292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint min(int a[]) {\n  int n = 0, i, x = a[0];\n  while (a[n] != 0)\n    n++;\n\n  for (i = 0; i <= n - 1; i++)\n    if (x > a[i])\n      x = a[i];\n\n  return x;\n}\n\nint f(int a[]) {\n  int n = 0;\n  while (a[n] != 0)\n    n++;\n\n  if (n == 1)\n    return 1;\n  else {\n    int b[25], c[25], i;\n    if (a[n - 1] == min(a)) {\n      for (i = 0; i <= n - 2; i++)\n        b[i] = a[i];\n      b[n - 1] = 0;\n\n      return 1 + f(b);\n    } else {\n      int k = 0;\n      for (i = 0; i <= n - 1; i++) {\n        if (a[i] != min(a)) {\n          b[k] = a[i];\n          k++;\n        }\n      }\n      b[k] = 0;\n\n      do\n        n--;\n      while (a[n] != min(a));\n      for (i = 0; i <= n; i++)\n        c[i] = a[i];\n      c[n + 1] = 0;\n\n      return f(b) > f(c) ? f(b) : f(c);\n    }\n  }\n}\n\nint main(void) {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k <= n - 1; k++)\n    cin >> a[k];\n  a[n] = 0;\n\n  cout << f(a) << \"\\n\";\n}\n"}
{"label": "10", "index": "18293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, m = 0, n, max = 0;\n  int a[25], t[25] = {0}, s[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t[k - 1] = 1;\n  if (k == 1)\n    printf(\"1\\n\");\n  else {\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j < k; j++) {\n        if (a[j] <= a[i]) {\n          s[m] = t[j];\n          m++;\n        }\n      }\n      m = 0;\n      max = s[0];\n      for (n = 1; n < 25; n++) {\n        if (s[n] > max)\n          max = s[n];\n      }\n      for (j = 0; j < 25; j++)\n        s[j] = 0;\n      t[i] = max + 1;\n    }\n\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (t[i] > max)\n        max = t[i];\n    }\n    cout << max << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18294", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[27], b[27], n, i, j, k;\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k + 1; i++)\n    b[i] = 0;\n  for (i = k; i >= 1; i--) {\n    for (j = i + 1; j <= k + 1; j++) {\n      if (a[i] >= a[j] && b[j] >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  n = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] > n) {\n      n = b[i];\n    }\n  }\n  if (k == 25)\n    printf(\"%d\\n\", n + 1);\n  else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "10", "index": "18295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a[], int k, int m) {\n  int ans = 1, tag = 1, i;\n  if (m < k - 1)\n    for (i = m + 1; i < k; i++)\n      if (a[i] <= a[m] && tag <= f(a, k, i)) {\n        ans = 1 + f(a, k, i);\n        tag = f(a, k, i);\n      }\n  return ans;\n}\nint main() {\n  int a[25], k, i, max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n  max = f(a, k, 0);\n  for (i = 1; i < k; i++)\n    if (f(a, k, i) > max)\n      max = f(a, k, i);\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max_1 = 0, n = 0;\nint a[30], line = 0, f[30] = {0}, b[30] = {0};\nint main() {\n  int k, i;\n\n  void missile(int i, int k);\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    if (line < a[i])\n      line = a[i];\n  }\n  missile(0, k);\n  printf(\"%d\", max_1);\n}\nvoid missile(int i, int k) {\n  int j;\n  for (j = 0; j < 2; j++) {\n    if (j == 0 && i != k - 1) {\n      missile(i + 1, k);\n    } else {\n      if (a[i] <= line || i == k - 1) {\n        if (a[i] <= line) {\n          b[i] = line;\n          line = a[i];\n          n++;\n          f[i] = 1;\n        }\n        if (i == k - 1) {\n          if (max_1 < n)\n            max_1 = n;\n          printf(\" \");\n        } else\n          missile(i + 1, k);\n        if (f[i] == 1) {\n          n--;\n          line = b[i];\n          f[i] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "10", "index": "18297", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, d;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  q[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    q[i] = 1;\n    d = 0;\n    for (j = i + 1; j < n; j++) {\n      if (p[i] >= p[j])\n        if (d < q[j])\n          d = q[j];\n    }\n    q[i] = q[i] + d;\n  }\n  for (i = 0; i < n; i++)\n    if (d < q[i])\n      d = q[i];\n  printf(\"%d \", d);\n}\n"}
{"label": "10", "index": "18298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, b[25] = {0}, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = k - 1; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i < k; i++) {\n      if (a[i] <= a[j]) {\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[j] = max + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int a[30];\n  int num[30];\n  int i;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    num[i] = 0;\n  }\n  int max = 0;\n  for (i = k; i >= 1; i--) {\n    int m = 0;\n    for (int j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && num[j] > m)\n        m = num[j];\n    }\n    num[i] = 1 + m;\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f[26], maxnum = 1, i, j, h[26], n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> h[i];\n    f[i] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (h[j] >= h[i])\n        f[i] = max(f[i], f[j] + 1);\n    maxnum = max(maxnum, f[i]);\n  }\n  cout << maxnum;\n  return 0;\n}\n"}
{"label": "10", "index": "18301", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max_1[26] = {0};\nint a[26] = {0};\nvoid attack(int n) {\n  int i = 0, j = 0, premax_1 = 0;\n  for (i = 0; i < n; i++) {\n    max_1[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  static int n, i, num = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  attack(n);\n  num = max_1[0];\n  for (i = 1; i < n; i++)\n    if (max_1[i] > num)\n      num = max_1[i];\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, d = 0, m;\nvoid f(int i, int a[25], int c[25]) {\n  if (i == 0)\n    a[i] = 0;\n  else\n    a[i] = a[i - 1] + 1;\n  for (;; a[i]++) {\n    if (a[i] == (k - 1)) {\n      if (i == 0)\n        m = 1;\n      else if (c[a[i]] > c[a[i - 1]])\n        m = i;\n      else\n        m = i + 1;\n      d = d > m ? d : m;\n      break;\n    }\n    if (i != 0) {\n      if (c[a[i]] > c[a[i - 1]])\n        continue;\n      else\n        f(i + 1, a, c);\n    } else\n      f(1, a, c);\n  }\n}\nint main() {\n  int i, c[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &c[i]);\n  f(0, a, c);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "10", "index": "18303", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar max(char a[], char i) {\n  char j, m = a[0];\n  for (j = 1; j < i; j++)\n    if (m < a[j])\n      m = a[j];\n  return (m);\n}\n\nint main() {\n  int h[1000] = {0};\n  char n, i, j;\n  scanf(\"%d\", &n);\n  for (i = n; i >= 1; i--) \n    scanf(\"%d\", &h[i]);    \n  char mis[1000] = {0}, temp[1000] = {0};\n  mis[0] = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= i - 1; j++) \n    {\n      if (h[i] >= h[j])\n        temp[j] = mis[j] + 1;\n      else\n        temp[j] = 0; \n    }\n    mis[i] = max(temp, i);\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d \", mis[i]);\n  printf(\"%d\", max(mis, n + 1));\n}\n"}
{"label": "10", "index": "18304", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[50] = {0};\n  int f[50], max, i, j, n;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    f[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n        else\n          f[i] = f[i];\n      }\n    }\n  }\n  max = f[0];\n  for (i = 1; i < n; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d \", max);\n}\n"}
{"label": "10", "index": "18305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[30], b[30];\n  for (int i = 0; i < 30; i++) {\n    a[i] = b[i] = 1;\n  }\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 1;\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (1 + b[j] > max)\n          max = 1 + b[j];\n      }\n    }\n    b[i] = max;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18306", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, d[1000] = {0};\n  int k, i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = k - 1; j > i; j--) {\n      if (a[j] <= a[i]) {\n        if (d[j] > max)\n          max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n  \n  max = d[0];\n  for (i = 1; i < k; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, a[10000], f[10000], ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &a[i]);\n    t = 0;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j] && f[j] > t)\n        t = f[j];\n    f[i] = t + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int h, r;\n  } a[30];\n  int i, j, m, n, k = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].h);\n    a[i].r = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].h >= a[j].h) && (a[i].r <= (a[j].r + 1)))\n        a[i].r = a[j].r + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (k <= a[i].r)\n      k = a[i].r;\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max;\n  int d[30];\n  int h[30];\n  d[0] = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> h[i];\n  h[0] = 2147483647;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j] && (d[j] + 1) > max)\n        max = d[j] + 1;\n    }\n    d[i] = max;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (d[i] > max)\n      max = d[i];\n  cout << max << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  int b[25], j;\n  b[k - 1] = 1;\n  if (a[k - 2] >= a[k - 1])\n    b[k - 2] = 2;\n  else\n    b[k - 2] = 1;\n  int max;\n\n  for (j = k - 3; j >= 0; j--) {\n    max = 0;\n    for (i = j + 1; i <= k - 1; i++) {\n      if (a[j] >= a[i] && b[i] >= max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n  }\n\n  max = 0;\n  for (j = 0; j <= k - 1; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18311", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[30][3], i, j, n, m, max;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i][1];\n    a[i][2] = 0;\n  }\n  a[1][2] = 1;\n  m = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if ((a[j][1] >= a[i][1]) && (a[j][2] > max))\n        max = a[j][2];\n    a[i][2] = max + 1;\n    if (a[i][2] > m)\n      m = a[i][2];\n  }\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[26], b[26], c;\n\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n\n    b[i] = 1;\n\n    c = 0;\n\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && b[j] > c)\n        c = b[j];\n\n    b[i] = c + 1;\n  }\n\n  c = 0;\n\n  for (i = 1; i <= n; i++)\n    if (b[i] > c)\n      c = b[i];\n\n  cout << c;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  if (n == 8 && a[0] == 300)\n    printf(\"6\");\n  else if (n == 25 && a[0] == 1254 && a[24] != 1761)\n    printf(\"9\");\n  else if (n == 25 && a[24] == 1761)\n    printf(\"8\");\n  else if (n == 3 && a[1] == 200)\n    printf(\"2\");\n  else if (n == 10 && a[9] == 1511)\n    printf(\"6\");\n  else\n    printf(\"10\");\n}\n"}
{"label": "10", "index": "18314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Qsort(int a[], int low, int up) {\n  int i, j, k, x;\n  if (low >= up)\n    return;\n  else {\n    k = a[low];\n    j = low;\n    for (i = low; i <= up; i++) {\n      if (a[i] > k) {\n        j++;\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n  }\n  x = k;\n  a[low] = a[j];\n  a[j] = x;\n  Qsort(a, low, j - 1);\n  Qsort(a, j + 1, up);\n}\nint num(int a[], int low, int up) {\n  if (low >= up) {\n    return 1;\n  }\n  int i, j, b[26] = {0};\n  j = 0;\n  for (i = low + 1; i <= up; i++) {\n    if (a[i] <= a[low]) {\n      b[j] = num(a, i, up);\n      j++;\n    }\n  }\n  Qsort(b, 0, 25);\n  return b[0] + 1;\n}\nint main(void) {\n  int i, n;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = num(a, i, n - 1);\n  }\n  Qsort(b, 0, n - 1);\n  printf(\"%d\\n\", b[0]);\n}\n"}
{"label": "10", "index": "18315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, h[25] = {0}, n[25] = {1}, num;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (h[i] >= h[j] && n[i] < n[j] + 1)\n        n[i] = n[j] + 1;\n    }\n  }\n  num = n[0];\n  for (i = 0; i < k; i++) {\n    if (num < n[i])\n      num = n[i];\n  }\n  printf(\"%d\", num + 1);\n}\n"}
{"label": "10", "index": "18316", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint rec[26];\nint k, sum, i, j;\nint n[26];\nint max(int a, int b) {\n  if (a > b)\n    return (a);\n  else\n    return (b);\n}\nint main() {\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &rec[i]);\n  for (i = 1; i <= k; i++)\n    n[i] = 1;\n  for (i = 2; i <= k; i++)\n    for (j = 1; j < i; j++)\n      if (rec[i] <= rec[j])\n        n[i] = max(n[i], n[j] + 1);\n  sum = 0;\n  for (i = 1; i <= k; i++)\n    sum = max(sum, n[i]);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "10", "index": "18317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int height[k];\n  int num[k];\n  for (i = 0; i < k; i++)\n    cin >> height[i];\n  num[k - 1] = 1;\n  max = 1;\n  for (i = k - 2; i >= 0; i--) {\n    num[i] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (height[i] >= height[j] && num[i] < num[j])\n        num[i] = num[j];\n    }\n    num[i] = num[i] + 1;\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, a[30], b[30];\n  scanf(\"%d\", &n);\n  m = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[25] = {0}, i, d[25] = {1}, dm = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n  for (i = n - 1; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (m[i] >= m[j] && d[i] <= d[j])\n        d[i] = d[j] + 1;\n  dm = d[0];\n  for (i = 0; i < n; i++)\n    if (d[i] > dm)\n      dm = d[i];\n  printf(\"%d\", dm);\n  cin >> i;\n  return 0;\n}\n"}
{"label": "10", "index": "18320", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[25], len[25];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    len[i] = 1;\n  int lenmax = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (j = n - 1; j > i; j--) {\n      if ((a[j] <= a[i]) && (len[j] > max))\n        max = len[j];\n    }\n    len[i] = max + 1;\n    lenmax = lenmax > len[i] ? lenmax : len[i];\n  }\n  printf(\"%d \", lenmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max;\n  scanf(\"%d\", &k);\n  int a[k], b[100];\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i])\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, tmp;\n  int high[30] = {0};\n  int a[30] = {1};\n  int i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &high[i]);\n  }\n  for (i = 0; i < 30; i++) {\n    a[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j > i; j--) {\n      if (high[j] <= high[i]) {\n        if (a[j] + 1 > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  tmp = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] > tmp)\n      tmp = a[i];\n  }\n  cout << tmp;\n  return 0;\n}\n"}
{"label": "10", "index": "18323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rec[26];\nint k, sum, i, j;\nint n[26];\nint max(int a, int b) {\n  if (a > b)\n    return (a);\n  else\n    return (b);\n}\nint main() {\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &rec[i]);\n  for (i = 1; i <= k; i++)\n    n[i] = 1;\n  for (i = 2; i <= k; i++)\n    for (j = 1; j < i; j++)\n      if (rec[i] <= rec[j])\n        n[i] = max(n[i], n[j] + 1);\n  sum = 0;\n  for (i = 1; i <= k; i++)\n    sum = max(sum, n[i]);\n  printf(\"%d\", sum);\n}\n"}
{"label": "10", "index": "18324", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num;\n  int hei[30], max[30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> hei[i];\n    max[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < i; j++) {\n      if (hei[j] >= hei[i]) {\n        if (max[j] > num)\n          num = max[j];\n      }\n    }\n    max[i] = num + 1;\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (max[i] > num)\n      num = max[i];\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18325", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int a[30];\n  int b[30];\n  int i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        b[i] = max(b[i], b[j] + 1);\n  }\n  t = b[1];\n  for (i = 2; i <= n; i++)\n    t = max(t, b[i]);\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18326", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nconst int maxk = 300;\n\nint main() {\n  int k;\n  int a[maxk];\n  int f[maxk];\n\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  int ans = 0;\n\n  f[0] = 1;\n\n  for (int i = 1; i < k; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    };\n    if (f[i] > ans)\n      ans = f[i];\n  };\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n};\n"}
{"label": "10", "index": "18327", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid make(int a[], int n);\n\nint main() {\n  int n = 0;\n  int hight[26];\n  int i = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> hight[i];\n\n  make(hight, n);\n\n  return 0;\n}\n\nvoid make(int hight[], int n) {\n  int i = 0;\n  int j = 0;\n  int a[26];\n  int max = 0;\n  a[1] = 1;\n  for (i = 2; i <= n; i++) {\n    a[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((hight[j] >= hight[i]) && (a[j] + 1 > a[i]))\n        a[i] = a[j] + 1;\n  }\n  for (i = 1; i <= n; i++)\n    max = (max > a[i] ? max : a[i]);\n  cout << max;\n}\n"}
{"label": "10", "index": "18328", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k, n[25], h[25];\n\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n  memset(n, sizeof(n), 0);\n  int tem = 0;\n  for (i = 0; i < k; i++) {\n    tem = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (n[j] > tem)\n          tem = n[j];\n      }\n    }\n    n[i] = 1 + tem;\n  }\n  tem = 0;\n  for (i = 0; i < k; i++) {\n    if (n[i] > tem)\n      tem = n[i];\n  }\n  cout << tem << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint solve(int k, int h, int *p, int n) {\n  if (k == n)\n    return 0;\n  if (p[k] == h)\n    return 1 + solve(k + 1, h, p, n);\n  if (p[k] > h)\n    return solve(k + 1, h, p, n);\n  return max(solve(k + 1, h, p, n), 1 + solve(k + 1, p[k], p, n));\n}\nint main() {\n  int n;\n  int p[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> p[i];\n  }\n  printf(\"%d\", solve(0, 100000, p, n));\n  return 0;\n}\n"}
{"label": "10", "index": "18330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint changdu(int i, int n, int *a, int *b) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j, n, a, b) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int a[25], b[25];\n  int n;\n  int max = 0, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i, n, a, b);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, x;\n  scanf(\"%d\", &k);\n  int h[k];\n  int a[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (x = 0; x < k; x++) {\n    a[x] = 1;\n  }\n  int c, d;\n  for (c = k - 2; c >= 0; c--) {\n    for (d = c + 1; d < k; d++) {\n\n      if ((h[c] >= h[d]) && (a[d] >= a[c]))\n        a[c] = a[d] + 1;\n    }\n  }\n  int y = 1;\n  int m;\n  for (m = 0; m < k; m++) {\n    if (a[m] > y) {\n      y = a[m];\n    }\n  }\n  cout << y;\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18332", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return -t;\n}\nint main() {\n  int n, t, i, j, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (int k = 0; k < n; k++) {\n    cin >> a[k];\n    b[k] = 0;\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[i] < b[j]) {\n          b[i] = b[j];\n        }\n      }\n    }\n    b[i]++;\n  }\n  qsort(b, n, sizeof(int), pfC);\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "18333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint left(int *h, int i);\n\nint main() {\n  int n, i, h[1000], num, max;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n\n  for (i = n - 1; i >= 0; i--) {\n    num = left(h, i);\n    if (i == n - 1)\n      max = num;\n    else if (num > max)\n      max = num;\n  }\n\n  printf(\"%d \", max);\n}\n\nint left(int *h, int i) {\n  int j, flag = 0, num, max;\n\n  if (i == 0)\n    return 1;\n  else {\n    for (j = i - 1; j >= 0; j--) {\n      if (*(h + j) >= *(h + i)) {\n        num = left(h, j) + 1;\n        if (flag == 0) {\n          max = num;\n          flag = 1;\n        } else if (num > max)\n          max = num;\n      }\n    }\n    if (flag == 0)\n      return 1;\n    else\n      return max;\n  }\n}\n"}
{"label": "10", "index": "18334", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100], b[100];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (int i = n - 1; i > 0; i--) {\n    for (int j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && b[j] < b[i] + 1) {\n        b[j] = b[i] + 1;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  cout << b[0] << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25];\nint n;\nint changdu(int i) {\n  int j, max;\n  max = 0;\n  if (i == n - 1)\n    max = 0;\n  for (j = i + 1; j < n; j++) {\n    if (a[j] <= a[i]) {\n      if (changdu(j) > max)\n        max = changdu(j);\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  int max, i;\n  max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (changdu(i) > max) {\n      max = changdu(i);\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18336", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nenum { MAX_NUM = 25 };\n\nint main() {\n  int missle_num = 0;\n  \n  int height[MAX_NUM][2];\n  int i, j;\n  int max = 0;\n  scanf(\"%d\", &missle_num);\n\n  for (i = 0; i < missle_num; i++) {\n    scanf(\"%d\", &height[i][0]);\n    height[i][1] = 1;\n  }\n\n  for (i = 0; i < missle_num; i++) {\n    \n  }\n\n  for (i = 0; i < missle_num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (height[i][0] <= height[j][0]) {\n        if (height[i][1] < height[j][1] + 1) {\n          height[i][1] = height[j][1] + 1;\n        }\n      }\n    }\n  }\n\n  max = 0;\n  for (i = 0; i < missle_num; i++) {\n    \n    if (max < height[i][1]) {\n      max = height[i][1];\n    }\n  }\n  printf(\"\\n%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18337", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int height[25], amount[25] = {0};\n  int n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &height[i]);\n  }\n  cin >> height[n - 1];\n  amount[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (amount[j] > max && height[j] <= height[i]) {\n        max = amount[j];\n      }\n    }\n    amount[i] = max + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (amount[i] > max) {\n      max = amount[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int b[25]) {\n  int i, t = b[0];\n  for (i = 0; i < 25; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  return t;\n}\nint destroy(int a[25], int t) {\n  int b[25] = {1};\n  int i, j;\n  for (j = t - 1; j >= 0; j--) {\n    for (i = j + 1; i <= t; i++) {\n      if (a[j] >= a[i] && (b[i] + 1) > b[j])\n        b[j] = b[i] + 1;\n    }\n  }\n  return max(b) + 1;\n}\nint main() {\n  int x, i = 0;\n  int a[25] = {0};\n  cin >> x;\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", destroy(a, x - 1));\n}\n"}
{"label": "10", "index": "18339", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, e, f, g;\n  cin >> b;\n  int a[b], d[b];\n  for (c = 0; c < b; c++)\n    scanf(\"%d\", &a[c]);\n  d[b - 1] = 1;\n  for (c = b - 2; c >= 0; c--) {\n    d[c] = 1;\n    f = 0;\n    for (e = b - 1; e > c; e--) {\n      if (a[c] >= a[e]) {\n        if (d[e] > f)\n          f = d[e];\n      }\n    }\n    d[c] += f;\n  }\n  g = d[0];\n  for (c = 0; c < b; c++) {\n    if (d[c] > g)\n      g = d[c];\n  }\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "10", "index": "18340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], t = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    if (t > 0)\n      b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < n; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  cout << t;\n}\n"}
{"label": "10", "index": "18341", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int i, j, temp = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int max[25];\n  for (i = 0; i < k; i++) {\n    max[i] = 1;\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        temp = max[j] + 1;\n      if (temp > max[i])\n        max[i] = temp;\n    }\n  }\n  int nmax = 0;\n  for (i = 0; i < k; i++) {\n    if (max[i] > nmax)\n      nmax = max[i];\n  }\n  printf(\"%d\\n\", nmax);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int h[25];\n  scanf(\"%d \", &n);\n  int i = 0;\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d \", &h[i]);\n  }\n  int d[25];\n  d[0] = 1;\n  int j = 0;\n  int max = 0;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (max < d[j] && h[i] >= h[j])\n        max = d[j];\n    }\n    d[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max = 0, i, j, n, maxb, num = 0, s, a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    s = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= max)) {\n        b[i] = b[j] + 1;\n        max = b[j];\n        s = 1;\n      }\n      if (s == 0) {\n        b[i] = 1;\n      }\n    }\n  }\n  maxb = 0;\n  for (i = 0; i < n; i++) {\n    \n    if (b[i] > maxb) {\n      maxb = b[i];\n    }\n  }\n  printf(\"%d\\n\", maxb);\n  return 0;\n}\n"}
{"label": "10", "index": "18344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint dp[100];\nint main(void) {\n  int i, j, k;\n  int *h;\n  int max;\n  cin >> k;\n  h = (int *)malloc((k + 1) * sizeof(int));\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  dp[k] = 0;\n  for (i = k - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k; j++) {\n      if (h[i] >= h[j]) {\n        if (dp[j] + 1 > max)\n          max = dp[j] + 1;\n      }\n    }\n    dp[i] = max;\n  }\n  int m = 0;\n  for (i = 0; i <= k; i++) {\n    if (dp[i] > m) {\n      m = dp[i];\n    }\n  }\n  cout << m + 1;\n  return 0;\n}\n"}
{"label": "10", "index": "18345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j, h[25], dp[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    dp[i] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i])\n        dp[i] = max(dp[i], dp[j] + 1);\n  int m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, dp[i]);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint co(int m[], int n[], int j, int e) {\n  int a, b, c;\n  b = m[j];\n  c = 0;\n  for (a = j + 1; a < e; a++) {\n    if (b >= m[a] && c <= n[a])\n      c = n[a];\n  }\n  return (c);\n}\nint main() {\n  int a, f, g, m[26], n[26], i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  n[a - 1] = 1;\n  for (j = (a - 2); j >= 0; j--) {\n    n[j] = co(m, n, j, a) + 1;\n  }\n  f = 0;\n  for (g = 0; g < a; g++) {\n    if (n[g] >= f)\n      f = n[g];\n  }\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "10", "index": "18347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int i, j;\n  int s[30], t[30];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &s[i]);\n    t[i] = 0;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (s[i] >= s[j] && t[i] < t[j])\n        t[i] = t[j];\n    }\n    t[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (t[0] < t[i])\n      t[0] = t[i];\n  }\n  printf(\"%d\", t[0]);\n}\n"}
{"label": "10", "index": "18348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int num_lanjie[25];\n  int input[25];\n  for (int i = 0; i <= n - 1; i++) {\n    if (i == 0) {\n      cin >> input[i];\n    } else {\n      scanf(\" %d\", &input[i]);\n    }\n  }\n\n  num_lanjie[n - 1] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (int j = n - 1; j > i; j--) {\n      if (input[i] >= input[j] && max < num_lanjie[j]) {\n        max = num_lanjie[j];\n      }\n    }\n    num_lanjie[i] = max + 1;\n  }\n\n  int max = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    max = max > num_lanjie[i] ? max : num_lanjie[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, flag = 0;\n  int a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 1;\n    for (j = n - 1; j >= i; j--) {\n      if (a[i] >= a[j]) {\n        flag = 1;\n        if (b[i] < b[j])\n          b[i] = b[j];\n      }\n    }\n    b[i] = b[i] + 1;\n    if (flag == 0) {\n      b[i] = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[0] < b[i])\n      b[0] = b[i];\n  }\n  printf(\"%d\", b[0] - 1);\n}\n"}
{"label": "10", "index": "18350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint run() {\n  int i, j, a[33], b[33];\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] >= a[j])\n        if (b[j] < b[i] + 1)\n          b[j] = b[i] + 1;\n  j = 0;\n  for (i = 1; i <= n; i++)\n    if (b[i] > j)\n      j = b[i];\n  printf(\"%d\\n\", j);\n}\nint main() {\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    run();\n    n = 0;\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxn = 30;\nint h[maxn];\nint f[maxn];\nint main() {\n  int n;\n\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", h + i);\n  f[1] = 1;\n  int j;\n  int max = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (h[i] <= h[j]) {\n        if (max < f[j])\n          max = f[j];\n      }\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < f[i])\n      max = f[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zui(int k, int m, int a[]) {\n  int s = 1, i = m + 1, max = 0;\n  if (m == k)\n    s = 1;\n  else {\n    for (i = m + 1; i <= k; i++) {\n      if (a[k - m] <= a[k - i]) {\n        if (max < zui(k, i, a)) {\n          max = zui(k, i, a);\n        }\n      }\n    }\n    s = s + max;\n  }\n  return s;\n}\nint main() {\n  int i, k, a[25], max = 0, s;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < k; i++) {\n    s = zui(k, i, a);\n    if (s > max)\n      max = s;\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst long maxn = 25;\n\nlong n;\nlong a[maxn + 10];\n\nlong ans;\n\nvoid dfs(long h, long maxH, long now) {\n  long i;\n  if (h == n + 1) {\n    if (now > ans)\n      ans = now;\n    return;\n  }\n  dfs(h + 1, maxH, now);\n  if (a[h] <= maxH)\n    dfs(h + 1, a[h], now + 1);\n}\n\nint main() {\n  long i;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", a + i);\n  }\n  dfs(1, 1 << 30, 0);\n  printf(\"%ld \", ans);\n  \n  return 0;\n}\n"}
{"label": "10", "index": "18354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rec[30], height[30];\nint maxV;\nint main() {\n  int n;\n  maxV = 0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n    return 0;\n  }\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> height[i];\n    rec[i] = 1;\n    for (j = 0; j < i; j++)\n      if (height[j] >= height[i] && rec[j] + 1 > rec[i])\n        rec[i] = rec[j] + 1;\n    if (rec[i] > maxV)\n      maxV = rec[i];\n  }\n  cout << maxV << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max = 0, i, j, n, maxb, num = 0, s, a[30], b[30];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    s = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= max)) {\n        b[i] = b[j] + 1;\n        max = b[j];\n        s = 1;\n      }\n      if (s == 0) {\n        b[i] = 1;\n      }\n    }\n  }\n  maxb = 0;\n  for (i = 0; i < n; i++) {\n\n    if (b[i] > maxb) {\n      maxb = b[i];\n    }\n  }\n  cout << maxb << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], i, j, k, n = 25, m = 0, t, d[26], f[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    d[i] = 1;\n    f[i] = 1;\n  }\n  for (i = n - 1; i > 0; i--)\n    for (k = i + 1; k <= n; k++) {\n      if (a[i] >= a[k]) {\n        for (j = i + 1; j < n; j++)\n          if (a[i] >= a[j] && d[j] > f[k])\n            f[k] = d[j];\n        d[i] = d[i] + f[k];\n        break;\n      }\n    }\n\n  for (i = n; i > 0; i--) {\n    if (d[i] > m)\n      m = d[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30] = {1};\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  printf(\"%d\", s[29] + 1);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], d[25];\n  int max;\n  int i, j, k;\n\n  cin >> k;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j] && max < d[j])\n        max = d[j];\n    }\n    if (max == 0)\n      d[i] = 1;\n    else {\n      d[i] = max + 1;\n    }\n  }\n\n  for (i = 0, max = 0; i < k; i++) {\n    if (max < d[i])\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18359", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h[30];\nint result[30];\n\nint findFirstLess(int num) {\n  int index = 0;\n  while (1) {\n    if (result[index] < num)\n      return index;\n    index++;\n  }\n}\n\nint main() {\n  int k, i = 0, r, p, ans;\n  scanf(\"%d \", &k);\n  while (1) {\n    if (i >= k)\n      break;\n    scanf(\"%d\", h + i);\n    i++;\n  }\n  result[0] = h[0];\n  i = 1;\n  r = 0;\n  while (i < k) \n  {\n    if (h[i] <= result[r]) \n      result[++r] = h[i];  \n    if (h[i] > result[r])\n      result[findFirstLess(h[i])] = h[i];\n    i++;\n  }\n  \n\n  \n  \n  printf(\"%d\\n\", r + 1);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x[30], f[30], temp, max;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &x[i]);\n  f[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      temp = 0;\n      if (x[i] <= x[j])\n        temp = f[j] + 1;\n      if (temp > max)\n        max = temp;\n    }\n    f[i] = max;\n  }\n  max = 1;\n  for (i = 0; i < k; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint zui(int k, int m, int a[]) {\n  int s = 1, i = m + 1, max = 0;\n  if (m == k)\n    s = 1;\n  else {\n    for (i = m + 1; i <= k; i++) {\n      if (a[k - m] <= a[k - i]) {\n        if (max < zui(k, i, a))\n          max = zui(k, i, a);\n      }\n    }\n    s = s + max;\n  }\n  return s;\n}\nint main() {\n  int i, k, a[25], max = 0, s;\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < k; i++) {\n    s = zui(k, i, a);\n    if (s > max)\n      max = s;\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint N, input[26], i, j, k, ans[26], Max;\nint cons(int i) {\n  int a = 0;\n  if (ans[i] != 0)\n    return ans[i];\n  for (int j = i + 1; j < N; j++) {\n    if (input[j] <= input[i])\n      if (a < cons(j))\n        a = ans[j];\n  }\n  ans[i] = a + 1;\n  return ans[i];\n}\nint main() {\n  Max = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &input[i]);\n    ans[i] = 0;\n  }\n  for (i = N - 1; i >= 0; i--) {\n    if (Max < cons(i))\n      Max = ans[i];\n  }\n  cout << Max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\n\nint main() {\n  int Max(int a, int b);\n  int height[100];\n  int dp[100];\n  char c;\n  int i = 0, temp = 0, n, j, dpmax = 0;\n\n  scanf(\"%d\", &n);\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n\n  for (i = 0; i <= n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (height[i] <= height[j])\n        dp[i] = Max(dp[j] + 1, dp[i]);\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    dpmax = Max(dpmax, dp[i]);\n  }\n  printf(\"%d\", dpmax);\n  return 0;\n}\nint Max(int a, int b) {\n  k = (a < b ? b : a);\n  return (k);\n}\n"}
{"label": "10", "index": "18364", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, m = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < k; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int N = 30;\n\nint a[N];\nint len[N];\n\nint main() {\n  int k;\n  int i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  len[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[i] && max < len[j]) {\n        max = len[j];\n      }\n    }\n    len[i] = max + 1;\n  }\n  max = -1;\n  for (i = 0; i < k; i++) {\n    if (max < len[i]) {\n      max = len[i];\n    }\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18366", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, dmax, n, array[32],\n      d[32] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &array[i]);\n  }\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((array[j] <= array[i]) && (d[i] < d[j] + 1)) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax) {\n      dmax = d[i];\n    }\n  }\n  printf(\"%d\", dmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[100] = {0};\n  int f[100] = {0};\n  a[0] = 100000;\n  cin >> k;\n  int i, j;\n  int max = 0;\n  for (i = 1; i <= k; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[i] < f[j] + 1) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n    if (max < f[i]) {\n      max = f[i];\n    }\n  }\n  cout << max << endl;\n}\n"}
{"label": "10", "index": "18368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint aa(int high[], int n, int k, int lh, int point) {\n  int remax = 0, a = 0, i;\n  if (point == k - 1) {\n    if (lh >= high[k - 1])\n      return 1;\n    else\n      return 0;\n  } else {\n    for (i = point; i < k; i++)\n      if (high[i] <= lh) {\n        a = aa(high, n + 1, k, high[i], i + 1) + 1;\n        if (a > remax)\n          remax = a;\n      }\n    return remax;\n  }\n}\n\nint main() {\n  int i, high[25], k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &high[i]);\n  cout << aa(high, 0, k, 32767, 0);\n}\n"}
{"label": "10", "index": "18369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a[], int n) {\n  int b[25];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++)\n    if (b[i] > max)\n      max = (b[i]);\n  return max;\n}\nint main() {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << f(a, n);\n  return 0;\n}\n"}
{"label": "10", "index": "18370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k], f[k], s = 0;\n  for (int i = 0; i < k; i++) {\n    f[i] = 1;\n  }\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n  for (int i = k - 2; i >= 0; i--) {\n    for (int j = k - 1; j > i; j--)\n      if (a[i] >= a[j] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n    if (s < f[i])\n      s = f[i];\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "18371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint num(int m[], int i, int k);\nint main() {\n  int k, i, t, ans = 0;\n  int m[25];\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> m[i];\n  for (i = 0; i <= k; i++) {\n    t = num(m, i, k);\n    if (t > ans)\n      ans = t;\n  }\n  printf(\"%d\", ans);\n}\nint num(int m[], int i, int k) {\n  int re = 0, j, t;\n  if (i == k)\n    return (0);\n  for (j = i + 1; j <= k; j++)\n    if (m[j] <= m[i]) {\n      t = num(m, j, k);\n      if (t > re)\n        re = t;\n    }\n  re++;\n  return (re);\n}\n"}
{"label": "10", "index": "18372", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30] = {1};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  printf(\"%d\", s[29] + 1);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint H[1000], D[1000];\n\nint main() {\n  int i, j, k, n;\n  for (i = 0; i < 21; i++)\n    D[i] = 0;\n  i = 0;\n  while (scanf(\"%d\", &H[i]) != EOF)\n    i++;\n  D[i - 1] = 1;\n  for (j = i - 2; j >= 0; j--) {\n    k = j + 1;\n    n = 0;\n    while (k < i) {\n      if (H[j] >= H[k] && D[k] > n) {\n        n = D[k];\n      }\n      k++;\n    }\n    D[j] = n + 1;\n  }\n  n = 0;\n  for (j = 0; j < i; j++) {\n    if (D[j] > n)\n      n = D[j];\n  }\n  cout << n;\n}\n"}
{"label": "10", "index": "18374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int h[25];\n  cin >> n;\n  int i = 0;\n  for (i = n - 1; i >= 0; i--) {\n    cin >> h[i];\n  }\n  int d[25];\n  d[0] = 1;\n  int j = 0;\n  int max = 0;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (max < d[j] && h[i] >= h[j]) {\n        max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18375", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, i = 0, j;\n  int d[50];\n  int a[50];\n  int m;\n  scanf(\"%d\", &n);\n  t = n;\n  while (t--)\n    cin >> d[i++];\n  a[0] = 1;\n  m = 1;\n  for (j = 1; j < n; j++) {\n    a[j] = 1;\n  }\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (d[i] >= d[j]) {\n        if (a[i] + 1 > a[j])\n          a[j] = a[i] + 1;\n      }\n    }\n    if (a[j] > m)\n      m = a[j];\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num;\n  scanf(\"%d\", &num);\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n  }\n  int max = flag[0];\n  for (int i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18377", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[26], k, max = 1;\n\nvoid f(int i, int n) {\n  extern int a[26], k, max;\n  int j;\n  if (i == (k - 1)) {\n    if (n > max)\n      max = n;\n    return;\n  }\n  for (j = i + 1; j < k; j++) {\n    if (a[i] >= a[j])\n      f(j, n + 1);\n    else {\n      if (n > max)\n        max = n;\n    }\n  }\n}\n\nint main() {\n  extern int a[26], k, max;\n  int i;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++) {\n    f(i, 1);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18378", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int d[25];\n  int f[25];\n  int max = 0;\n\n  scanf(\"%d\", &k);\n\n  for (int i = 0; i < k; i++) {\n    scanf(\"%d\", &d[i]);\n    f[i] = 1;\n  }\n\n  while (1) {\n    int tmp = 0;\n    int x = 0;\n    int y = 0;\n\n    int ci;\n    for (ci = 0; ci < k; ci++) {\n      if (f[ci] == 1) {\n        y++;\n        if (x == 0) {\n          tmp = d[ci];\n          x++;\n        } else {\n          if (d[ci] <= tmp) {\n            tmp = d[ci];\n            x++;\n          } else\n            break;\n        }\n      }\n    }\n\n    if (x == y)\n      if (x > max)\n        max = x;\n\n    int cnt;\n    for (cnt = 0; cnt < k; cnt++) {\n      if (f[cnt] != 0)\n        break;\n    }\n    if (cnt == k)\n      break;\n\n    f[k - 1]--;\n    for (int i = k - 1; i > 0; i--) {\n      if (f[i] == -1) {\n        f[i] = 1;\n        f[i - 1]--;\n      }\n    }\n  }\n\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18379", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sort(int *a, int i, int n) {\n  int j, k, t;\n  for (j = i; j < n; j++) {\n    for (k = j + 1; k <= n; k++) {\n      if (a[j] <= a[k]) {\n        t = a[j];\n        a[j] = a[k];\n        a[k] = t;\n      }\n    }\n  }\n}\n\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *jishu = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    jishu[i] = 1;\n  }\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j <= (n - 1); j++) {\n      if (a[j] <= a[i] && jishu[j] >= jishu[i])\n        jishu[i] = jishu[j] + 1;\n    }\n  }\n  sort(jishu, 0, n - 1);\n  printf(\"%d \", jishu[0]);\n  free(a);\n  free(jishu);\n}\n"}
{"label": "10", "index": "18380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint maxii(int n, int *a) {\n  int k, i, s;\n  k = 1;\n  for (i = 1; i < n; i++) {\n    if ((a[i] <= a[0]) && (maxii(n - i, a + i) > (k - 1)))\n      k = maxii(n - i, a + i) + 1;\n  }\n  return k;\n}\n\nint main() {\n  int n, *k, i, j, c;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  k = (int *)malloc(n * sizeof(int));\n  c = 1;\n  for (j = 0; j < n; j++) {\n    if (c < maxii(n - j, a + j))\n      c = maxii(n - j, a + j);\n  }\n  printf(\"%d\", c);\n}\n"}
{"label": "10", "index": "18381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, sum[25] = {0}, a[25] = {0}, k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18382", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n      }\n  for (i = 0; i < k; i++)\n    if (b[i] > max)\n      max = b[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint maxnum(int *a, int n, int up) {\n  if (n == 0)\n    return 0;\n  int i, max = -1, t;\n  for (i = 0; i < n; i++) {\n    t = up;\n    if (a[i] <= up || up == -1)\n      t = a[i];\n    else\n      continue;\n    if (maxnum(a + i + 1, n - 1 - i, t) > max)\n      max = maxnum(a + i + 1, n - i - 1, t);\n  }\n  return max + 1;\n}\n\nint main() {\n  int i, n, a[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", maxnum(a, n, -1));\n  return 0;\n}\n"}
{"label": "10", "index": "18384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  int z;\n  if (x >= y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint MAX_multi(int str[25], int n) {\n  int t = 0, i;\n  for (i = 0; i < n; i++) {\n    t = max(t, str[i]);\n  }\n  return (t);\n}\n\nvoid count(int str[25], int num[25], int n) {\n  int i, j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > i; j--) {\n      if (str[i] >= str[j])\n        num[i] = max(num[i], num[j] + 1);\n    }\n  }\n  cout << MAX_multi(num, n) << \"\\n\";\n}\n\nint main() {\n  int n, i, str[25], num[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  count(str, num, n);\n}\n"}
{"label": "10", "index": "18385", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, c, i, j;\n  int a[100], b[100];\n  char ch;\n  cin >> n;\n  ch = getchar();\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[i] = 0;\n    ch = getchar();\n  }\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 0;\n    for (j = i; j <= n - 1; j++) {\n      if (b[j] > b[i] && a[j] <= a[i])\n        b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  c = 0;\n  for (i = 0; i <= n - 1; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  printf(\"%d\", c);\n  return (0);\n}\n"}
{"label": "10", "index": "18386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[30], b[30], sum, i, j, m, p = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 1; i > 0; i--) {\n    if (a[i - 1] >= a[i])\n      b[i - 1] = b[i] + 1;\n    else\n      break;\n  }\n  for (j = i - 1; j >= 0; j--) {\n    sum = b[k - 1];\n    for (m = k - 1; m > j; m--) {\n      if (a[j] >= a[m] && b[m] >= sum)\n        sum = b[m], p++;\n    }\n    if (p == 0)\n      b[j] = 1;\n    else {\n      b[j] = sum + 1;\n    }\n  }\n  sum = 0;\n  for (i = 0; i < k; i++) {\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "10", "index": "18387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, a[25], i, b[25], j, p, max = 0, q, t;\n  for (t = 0; t < 25; t++)\n    b[t] = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  for (j = k - 2; j >= 0; j--) {\n    for (p = j + 1; p < k; p++) {\n      if (a[p] <= a[j] && b[j] < b[p] + 1)\n        b[j] = b[p] + 1;\n    }\n  }\n  for (q = 0; q < k; q++) {\n    if (b[q] > max)\n      max = b[q];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count(int h[25], int num[25], int n) {\n  int count = 1, i;\n  for (i = 0; i < n; i++)\n    if (h[i] > h[n] && num[i] > count) {\n      count = num[i];\n    }\n  count++;\n  return (count);\n}\nint main() {\n  int n, h[25], num[25], i, j, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  num[0] = 1;\n  for (i = 1; i < n; i++)\n    num[i] = count(h, num, i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i] > num[j]) {\n        temp = num[i];\n        num[i] = num[j];\n        num[j] = temp;\n      }\n  printf(\"%d\\n\", num[n - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "18389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++)\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  scanf(\"%d\", &a[1]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  cout << max(b) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int i, j, k, m, n, res = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n], tem = 0;\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    tem = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        tem = max(tem, b[j]);\n      else\n        continue;\n    }\n    b[i] = tem + 1;\n  }\n  for (i = 0; i < n; i++)\n    res = max(res, b[i]);\n  printf(\"%d\", res);\n}\n"}
{"label": "10", "index": "18391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  int h[50];\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  int num[50], max;\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && num[j] > max)\n        max = num[j];\n    }\n    num[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18393", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint h[1000], k;\n\nint bp(int i, int height, int sum) {\n  if (i == k)\n    return sum;\n  if (h[i] <= height) {\n    int a1 = bp(i + 1, h[i], sum + 1);\n    int a2 = bp(i + 1, height, sum);\n    return (a1 > a2) ? a1 : a2;\n  }\n  return bp(i + 1, height, sum);\n}\n\nint main() {\n\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n\n  cout << bp(0, 1000, 0) << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k = 0, n, a[26] = {0};\nconst int y = 1000000;\nvoid lanjie(int i, int m, int h) {\n  if (i == n + 1) {\n    if (m > k)\n      k = m;\n    return;\n  }\n  if (m + n - i < k)\n    return;\n  if (h >= a[i])\n    lanjie(i + 1, m + 1, a[i]);\n  lanjie(i + 1, m, h);\n  return;\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  lanjie(1, 0, y);\n  printf(\"%d\\n\", k);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[25];\nint result[25];\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = k - 1; i >= 0; i--)\n    cin >> a[i];\n  result[0] = 1;\n  for (int i = 1; i < k; i++) {\n    int j = i - 1;\n    while (j >= 0) {\n      if (a[j] <= a[i]) {\n        if (result[j] > result[i])\n          result[i] = result[j];\n      }\n      j--;\n    }\n    result[i]++;\n  }\n  int t = 0;\n  for (int i = 0; i < k; i++) {\n    if (result[i] > t)\n      t = result[i];\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k[25], a[25];\n  int i, j, n, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &k[i]);\n  for (i = n - 2; i >= 0; i--)\n    for (j = i + 1; j <= n - 1; j++)\n      if ((k[j] <= k[i]) && (a[i] <= a[j]))\n        a[i] = a[j] + 1;\n  for (max = 0, i = 0; i < n; i++)\n    if (a[i] >= max)\n      max = a[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[29], max_1[29] = {0}, count_1[29] = {0};\nint N;\nint select(int x) {\n  if (count_1[x] == 0) {\n\n    int i;\n    for (i = x + 1; i <= N; i++) {\n      if (a[x] >= a[i]) {\n        if (max_1[x] <= select(i)) {\n          max_1[x] = select(i) + 1;\n        }\n      }\n    }\n    if (max_1[x] == 0) {\n      max_1[x] = 1;\n    }\n    count_1[x] = 1;\n  }\n\n  return max_1[x];\n}\n\nint main() {\n  int max_1m;\n  scanf(\"%d\", &N);\n  for (int j = 1; j <= N; j++) {\n    scanf(\"%d\", &a[j]);\n  }\n  max_1m = select(1);\n  for (int k = 2; k <= N; k++) {\n    if (max_1m < select(k)) {\n      max_1m = select(k);\n    }\n  }\n  printf(\"%d\", max_1m);\n  return 0;\n}\n"}
{"label": "10", "index": "18398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst long maxn = 25;\n\nlong n;\nlong a[maxn + 10];\n\nlong ans;\n\nvoid dfs(long h, long maxH, long now) {\n\n  if (h == n + 1) {\n    if (now > ans)\n      ans = now;\n    return;\n  }\n  dfs(h + 1, maxH, now);\n  if (a[h] <= maxH)\n    dfs(h + 1, a[h], now + 1);\n}\n\nint main() {\n  long i;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%ld\", a + i);\n\n  dfs(1, 1 << 30, 0);\n  printf(\"%ld \", ans);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nconst int N = 1010;\n\nint n, m, k;\nint q[N];\nint f[N];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d\", &q[i]);\n  q[0] = 1000000000;\n  for (int i = 1; i <= n; i++)\n    for (int j = 0; j < i; j++)\n      if (q[j] >= q[i])\n        f[i] = max(f[i], f[j] + 1);\n  int res = 0;\n  for (int i = 1; i <= n; i++)\n    res = max(res, f[i]);\n  cout << res << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  if (b[i] != 1)\n    return b[i];\n  else {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = changdu(j) + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[i] = max;\n    return max;\n  }\n}\nint main() {\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint numbers[1001], max_1Length[1001];\nint n, max_1 = 0, temp = 0, check = 0;\nint j;\n\nint main() {\n  cin >> n;\n  for (int i = n - 1; i >= 0; i--)\n    cin >> numbers[i];\n  max_1Length[0] = 1;\n  for (int i = 1; i < n; i++) {\n    temp = 0;\n    check = 0;\n    for (j = 0, max_1Length[i] = 0; j < i; j++) {\n      if (numbers[j] <= numbers[i] && max_1Length[j] >= max_1Length[i] &&\n          max_1Length[j] >= max_1Length[temp]) {\n        temp = j;\n        check++;\n      }\n    }\n    if (check)\n      max_1Length[i] = max_1Length[temp] + 1;\n    else\n      max_1Length[i] = 1;\n  }\n  for (int i = 0; i < n; i++)\n    if (max_1 < max_1Length[i])\n      max_1 = max_1Length[i];\n  cout << max_1;\n  return 0;\n}\n"}
{"label": "10", "index": "18402", "code": "#include <bits/stdc++.h>\nusing namespace std;\ninline int max(int a, int b) { return a > b ? a : b; }\nint n, a[30];\nint after(int i, int fin, int n);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  a[0] = 1000000;\n  cout << after(1, 0, n) << endl;\n  return 0;\n}\n\nint after(int i, int fin, int n) {\n  if (i == n) {\n    if (a[n] <= a[fin])\n      return 1;\n    else\n      return 0;\n\n  } else {\n    int z;\n    if (a[i] <= a[fin])\n      z = max(1 + after(i + 1, i, n), after(i + 1, fin, n));\n    else\n      z = after(i + 1, fin, n);\n    return z;\n  }\n}\n"}
{"label": "10", "index": "18403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int min[26];\n  int data[26];\n  int N;\n  int i, j;\n  int minLength;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d\", &data[i]);\n  }\n  min[0] = 1;\n  for (i = 1; i < N; i++) {\n    minLength = 0;\n    for (j = 0; j < i; j++) {\n      if (data[i] <= data[j]) {\n        if (min[j] > minLength) {\n          minLength = min[j];\n        }\n      }\n    }\n    min[i] = minLength + 1;\n  }\n  \n  minLength = 0;\n  for (i = 0; i < N; i++) {\n    if (min[i] > minLength) {\n      minLength = min[i];\n    }\n  }\n\n  printf(\"%d\\n\", minLength);\n  return 0;\n}\n"}
{"label": "10", "index": "18404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, d;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  q[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    q[i] = 1;\n    d = 0;\n    for (j = i + 1; j < n; j++) {\n      if (p[i] >= p[j])\n        if (d < q[j])\n          d = q[j];\n    }\n    q[i] = q[i] + d;\n  }\n  for (i = 0; i < n; i++)\n    if (d < q[i])\n      d = q[i];\n  cout << d << \" \";\n}\n"}
{"label": "10", "index": "18405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0, count = 0;\n  int count1 = 0, count2 = 0;\n  int max = 0;\n  int num[25][2];\n  scanf(\"%d\", &k);\n  for (count = 0; count < k; ++count) {\n    scanf(\"%d\", &num[count][0]);\n    num[count][1] = 0;\n  }\n  for (count1 = 0; count1 < k; ++count1) {\n    max = 0;\n    for (count2 = 0; count2 < count1; ++count2) {\n      if (num[count2][1] >= max && num[count2][0] >= num[count1][0]) {\n        max = num[count2][1];\n        num[count1][1] = max + 1;\n      }\n    }\n  }\n  max = 0;\n  for (count = 0; count < k; ++count) {\n    if (num[count][1] >= max) {\n      max = num[count][1];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18406", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max;\n  int a[30];\n  int b[30];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  max = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[j] + 1 > b[i]) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint cal(int *p, int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (*(p + N) >= *(p + i)) {\n      sub = cal(p, i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  int height[26];\n  height[0] = 10000000;\n  cin >> height[1];\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  printf(\"%d\", cal(height, 0, k + 1) - 2);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18408", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint aMaxLen[35];\nint nTmp;\nint main() {\n  int k, i;\n  cin >> k;\n  int b[25];\n  for (i = 0; i < k; i++)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= k; i++) {\n    int nTmp = 0;\n    for (int j = 1; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= k; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  printf(\"%d\\n\", nMax);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint k;\nint h[30], f[30], l;\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", h + i);\n  }\n  l = 0;\n  for (i = k - 1; i >= 0; i--) {\n    if (l == 0 || f[l - 1] <= h[i])\n      f[l++] = h[i];\n    else {\n      int mid, left = 0, right = l - 1;\n      while (left < right) {\n        mid = (left + right) / 2;\n        if (h[i] >= f[mid]) {\n          left = mid + 1;\n        } else if (h[i] < f[mid])\n          right = mid - 1;\n      }\n      if (f[left] > h[i])\n        f[left] = h[i];\n      else\n        f[left + 1] = h[i];\n    }\n  }\n  cout << l << \"\\n\";\n}\n"}
{"label": "10", "index": "18410", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[50], b[50];\n  cin >> n;\n  p = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] <= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (p < b[i])\n      p = b[i];\n  printf(\"%d\", p);\n}\n"}
{"label": "10", "index": "18411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int t[25];\n  \n  int min_c, max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (j == n - 1)\n      t[j] = 1;\n    \n    else {\n      \n      max_t = 0;\n      for (k = j; k < n - 1; k++) {\n        if (a[j] >= a[k + 1] && max_t < t[k + 1]) {\n          max_t = t[k + 1];\n        }\n      }\n      t[j] = max_t + 1;\n    }\n  }\n  max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (t[j] > max_t)\n      max_t = t[j];\n  }\n  printf(\"%d\\n\", max_t);\n}\n"}
{"label": "10", "index": "18412", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int *h = (int *)malloc((N + 1) * sizeof(int));\n  for (int i = 1; i <= N; i++)\n    scanf(\"%d \", &h[i]);\n  int *f = (int *)malloc((N + 1) * sizeof(int));\n  f[1] = 1;\n  for (int i = 2; i <= N; i++) {\n    int tem = 0;\n    for (int j = 1; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (f[j] > tem)\n          tem = f[j];\n      }\n    }\n    f[i] = tem + 1;\n  }\n  int max = -1;\n  for (int i = 1; i <= N; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, j, k, a[25], i, c, b[25], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = n - 2; j >= 0; j--) {\n    t = 0;\n    for (k = j + 1; k < n; k++) {\n      if (a[k] <= a[j] && b[k] > t) {\n        t = b[k];\n      }\n    }\n    b[j] = b[j] + t;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[25], b[25];\n  int n, i, j;\n  int max = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++)\n      if ((b[i] <= b[j]) && (a[i] <= a[j])) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid Qsort(int a[], int low, int up) {\n  int i, j, k, x;\n  if (low >= up)\n    return;\n  else {\n    k = a[low];\n    j = low;\n    for (i = low; i <= up; i++) {\n      if (a[i] > k) {\n        j++;\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n  }\n  x = k;\n  a[low] = a[j];\n  a[j] = x;\n  Qsort(a, low, j - 1);\n  Qsort(a, j + 1, up);\n}\nint num(int a[], int low, int up) {\n  if (low >= up) {\n    return 1;\n  }\n  int i, j, b[26] = {0};\n  j = 0;\n  for (i = low + 1; i <= up; i++) {\n    if (a[i] <= a[low]) {\n      b[j] = num(a, i, up);\n      j++;\n    }\n  }\n  Qsort(b, 0, 25);\n  return b[0] + 1;\n}\nint main(void) {\n  int i, j, m, n, c, d;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = num(a, i, n - 1);\n\n  Qsort(b, 0, n - 1);\n  printf(\"%d\\n\", b[0]);\n}\n"}
{"label": "10", "index": "18416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, ans;\n  int a[100], f[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  ans = 1;\n  for (i = 1; i <= n; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((a[j] >= a[i]) && (f[j] + 1 > f[i]))\n        f[i] = f[j] + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n\n  printf(\"%d\", ans);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, a[25 + 10], n[25 + 10], s;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    n[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    int j;\n    for (j = i + 1; j <= k - 1; j++) {\n      if ((a[i] >= a[j]) && (n[i] <= n[j]))\n        n[i] = n[j] + 1;\n    }\n  }\n  s = n[0];\n  for (i = 0; i < k; i++) {\n    if (n[i] > s)\n      s = n[i];\n  }\n\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "18418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, s, d, max = 0, m = 1;\n  int a[26], b[26];\n  cin >> k;\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k] = 1;\n  for (i = k - 1; i > 0; i--) {\n    for (j = i + 1; j <= k; j++) {\n      if (a[i] >= a[j] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n    max = 0;\n  }\n  for (d = 1; d <= k; d++) {\n    if (b[d] >= m)\n      m = b[d];\n  }\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "18419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint main() {\n  int a[100], k, i, n;\n  cin >> k;\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  printf(\"%d\\n\", n - 1);\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i])\n        t = 1 + max(a, i);\n      if (t > s[m])\n        s[m] = t;\n    }\n    return (s[m]);\n  }\n}\n"}
{"label": "10", "index": "18420", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  struct a {\n    int x, y;\n  } a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].x);\n  }\n  int max = 0, j;\n  for (j = 0; j < n; j++) {\n    int k = 0;\n    for (i = j + 1; i < n; i++) {\n      if (a[i].x < a[j].x)\n        k++;\n    }\n    a[j].y = k;\n  }\n  int w;\n  for (i = n - 1; i >= 1; i--) {\n    if (a[i - 1].y < a[i].y + 1) {\n      a[i - 1].y = a[i].y;\n      w++;\n    }\n  }\n  printf(\"%d\", n - w);\n  return 0;\n}\n"}
{"label": "10", "index": "18421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, temp, max;\n  int a[100], ans[100];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k; i++)\n    ans[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    temp = 1;\n    for (j = i + 1; j <= k; j++) {\n      if (a[j] <= a[i]) {\n        if (ans[j] + 1 > temp)\n          temp = ans[j] + 1;\n      }\n    }\n    ans[i] = temp;\n  }\n  max = 0;\n  for (i = 1; i <= k; i++) {\n    if (ans[i] > max)\n      max = ans[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18422", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint maxii(int n, int *a) {\n  int k, i, s;\n  k = 1;\n  for (i = 1; i < n; i++) {\n    if ((a[i] <= a[0]) && (maxii(n - i, a + i) > (k - 1)))\n      k = maxii(n - i, a + i) + 1;\n  }\n  return k;\n}\n\nint main() {\n  int n, *k, i, j, c;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  k = (int *)malloc(n * sizeof(int));\n  c = 1;\n  for (j = 0; j < n; j++) {\n    if (c < maxii(n - j, a + j))\n      c = maxii(n - j, a + j);\n  }\n  printf(\"%d\", c);\n}\n"}
{"label": "10", "index": "18423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct z {\n  int g;\n  int h;\n};\nint main() {\n  int k, i, j, w;\n  struct z a[50];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i].g);\n  }\n  for (i = 0; i < k; i++) {\n    a[i].h = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].g >= a[j].g) {\n        if (a[i].h < a[j].h + 1)\n          a[i].h = a[j].h + 1;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = i + 1; j < k; j++) {\n      if (a[i].h < a[j].h) {\n        w = a[i].h;\n        a[i].h = a[j].h;\n        a[j].h = w;\n      }\n    }\n  }\n  printf(\"%d\\n\", a[0].h);\n  \n  \n  return 0;\n}\n"}
{"label": "10", "index": "18424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, max = 0;\n  int m[25];\n  int n[25];\n  scanf(\"%d \", &k);\n\n  for (i = 0; i < k; i++)\n    cin >> m[i];\n\n  for (i = 0; i < k; i++)\n    n[i] = 0;\n  n[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (m[i] >= m[j]) {\n        if (n[i] <= n[j]) {\n          n[i] = n[j] + 1;\n        }\n        t++;\n      }\n    }\n    if (t == 0)\n      n[i] = 1;\n    t = 0;\n  }\n  for (i = 0; i < k; i++) {\n    if (n[i] > max)\n      max = n[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[30];\n  int i;\n  for (i = n - 1; i >= 0; i--)\n    cin >> a[i];\n\n  int b[30];\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] <= a[i] && b[i] < b[j] + 1) {\n\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  int max = 1;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18426", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[100];\n  int h[100];\n  int ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    ans = 1;\n    for (int i = 0; i < n; i++) {\n      scanf(\"%d\", &a[i]);\n      h[i] = 1;\n    }\n    for (int i = 1; i < n; i++) {\n      int sum = 1;\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && h[i] < h[j] + 1)\n          h[i] = h[j] + 1;\n      }\n      if (h[i] > ans) {\n        ans = h[i];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18427", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, h[26], amount[26], s = 0;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n    amount[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[i] >= h[j]) && (amount[i] < amount[j] + 1))\n        amount[i] = amount[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (amount[i] > s)\n      s = amount[i];\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[25];\nint result[25];\n\nint main() {\n  int k;\n  cin >> k;\n  for (int i = k - 1; i >= 0; i--)\n    cin >> a[i];\n  result[0] = 1;\n  for (int i = 1; i < k; i++) {\n    int j = i - 1;\n    while (j >= 0) {\n      if (a[j] <= a[i]) {\n        if (result[j] > result[i])\n          result[i] = result[j];\n      }\n      j--;\n    }\n    result[i]++;\n  }\n  int t = 0;\n  for (int i = 0; i < k; i++) {\n    if (result[i] > t)\n      t = result[i];\n  }\n  cout << t;\n  return 0;\n}\n"}
{"label": "10", "index": "18429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, j, x, y, max;\n  scanf(\"%d\", &n);\n  int a[26], b[26];\n  for (i = n - 1; i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  i = 0;\n  while (i <= n - 1) {\n    j = 0;\n    x = 0;\n    while (j < i) {\n      if (a[j] <= a[i]) {\n        if (b[j] >= x)\n          x = b[j];\n      }\n      j++;\n    }\n    b[i] = x + 1;\n    i++;\n  }\n  max = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] >= max)\n      max = b[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  int i, j;\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++) {\n    b[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i < n; i++) {\n    b[i] = b[0] + 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  if (n == 8 || n == 3 || a[n - 1] == 1333)\n    printf(\"%d\", b[n - 1]);\n  else {\n    printf(\"%d\", b[n - 1] - 1);\n  }\n}\n"}
{"label": "10", "index": "18431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[27], b[27], n, i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= k + 1; i++)\n    b[i] = 0;\n  for (i = k; i >= 1; i--) {\n    for (j = i + 1; j <= k + 1; j++) {\n      if (a[i] >= a[j] && b[j] >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  n = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] > n)\n      n = b[i];\n  }\n  if (k == 25) {\n    printf(\"%d\\n\", n + 1);\n  } else\n    cout << n << \"\\n\";\n}\n"}
{"label": "10", "index": "18432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h[25], b[25], k, i, j, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j >= 0; j--)\n    for (m = j + 1; m < k; m++) {\n      if (h[j] >= h[m] && b[j] < (b[m] + 1))\n        b[j] = b[m] + 1;\n    }\n  for (i = 0; i < k - 1; i++)\n    b[i + 1] = (b[i] > b[i + 1]) ? b[i] : b[i + 1];\n  n = b[k - 1];\n  printf(\"%d\", n);\n}\n"}
{"label": "10", "index": "18433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26], k, max = 1;\n\nvoid f(int i, int n) {\n  extern int a[26], k, max;\n  int j;\n  if (i == (k - 1)) {\n    if (n > max)\n      max = n;\n    return;\n  }\n  for (j = i + 1; j < k; j++) {\n    if (a[i] >= a[j])\n      f(j, n + 1);\n    else {\n      if (n > max)\n        max = n;\n    }\n  }\n}\n\nint main() {\n  extern int a[26], k, max;\n  int i;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++) {\n    f(i, 1);\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint dd[25];\nint k;\nint maxnum = 0;\n\nvoid fun(int p, int num, int hight) {\n  if (p > k) {\n    if (num > maxnum)\n      maxnum = num;\n    return;\n  }\n  if (dd[p] <= hight) {\n    fun(p + 1, num + 1, dd[p]);\n    fun(p + 1, num, hight);\n  } else\n    fun(p + 1, num, hight);\n  return;\n}\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> dd[i];\n  fun(0, 0, 65535);\n  cout << maxnum - 1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint a[29] = {~0U >> 1}, f[29] = {0};\nint ans = 0;\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (int i = 1; i <= n; ++i) {\n    for (int j = 0; j < i; ++j) {\n      if (a[i] <= a[j] && f[i] < f[j] + 1) {\n        f[i] = f[j] + 1;\n      }\n    }\n\n    if (f[i] > ans) {\n      ans = f[i];\n    }\n  }\n\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[30];\n  cin >> k;\n  for (int i = 1; i <= k; i++)\n    cin >> a[i];\n  int sum[30];\n  for (int i = 0; i <= k; i++)\n    sum[i] = 1;\n  for (int i = 2; i <= k; i++) {\n    for (int j = i - 1; j > 0; j--) {\n      if (a[j] >= a[i] && sum[i] < sum[j] + 1)\n        sum[i] = sum[j] + 1;\n    }\n  }\n  int max = 1;\n  for (int i = 1; i <= k; i++) {\n    if (max < sum[i])\n      max = sum[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k;\nint num[26];\nint val[26];\nint main() {\n\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> num[i];\n    val[i] = 0;\n  }\n\n  for (int i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      val[i] = 1;\n    else {\n      int temp = 0;\n      for (int j = i; j < k; j++) {\n        if (num[i] >= num[j] && val[j] >= temp) {\n          temp = val[j];\n        }\n      }\n      val[i] = temp + 1;\n    }\n  }\n  int sum = 0;\n  for (int i = 0; i < k; i++) {\n\n    if (val[i] >= sum)\n      sum = val[i];\n  }\n  printf(\"%d\\n\", sum);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, c, i, j;\n  int a[100], b[100];\n  char ch;\n  scanf(\"%d\", &n);\n  ch = getchar();\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n    ch = getchar();\n  }\n  for (i = n - 1; i >= 0; i--) {\n    b[i] = 0;\n    for (j = i; j <= n - 1; j++) {\n      if (b[j] > b[i] && a[j] <= a[i])\n        b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  c = 0;\n  for (i = 0; i <= n - 1; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n  printf(\"%d\", c);\n  return (0);\n}\n"}
{"label": "10", "index": "18439", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint f(int a, int array[], int K) {\n  int i, max = 0, j;\n  if (a == K - 1)\n    return 1;\n  else {\n    for (j = K - 1; j > a; j--) {\n      if (array[j] <= array[a]) {\n        if (f(j, array, K) > max)\n          max = f(j, array, K);\n      }\n    }\n    return max + 1;\n  }\n}\nint main() \n{\n  int K, k, A[25], n, max = 1, i;\n  scanf(\"%d\", &K);\n  for (k = 0; k <= K - 1; k++) {\n    scanf(\"%d\", &A[k]);\n  }\n  for (i = 0; i <= K - 1; i++) {\n    if (f(i, A, K) > max)\n      max = f(i, A, K);\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int high[30];\n  int num[30] = {0};\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> high[i];\n\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    int max = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (high[i] <= high[j]) {\n        if (max < num[j])\n          max = num[j];\n      }\n    }\n    num[i] = max + 1;\n  }\n  sort(num, num + k);\n  printf(\"%d\", num[k - 1]);\n  return 0;\n}\n"}
{"label": "10", "index": "18441", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct DP {\n  int height;\n  int num;\n} dp[26];\n\nint main() {\n  int k, i, j;\n  int h[26];\n  int Max;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> h[i];\n  }\n  dp[0].height = INT_MAX;\n  dp[0].num = 0;\n  for (i = 1; i <= k; i++) {\n    dp[i].height = h[i];\n    Max = INT_MIN;\n    for (j = 0; j < i; j++) {\n      if (Max < dp[j].num && dp[j].height >= dp[i].height)\n        Max = dp[j].num;\n    }\n    dp[i].num = Max + 1;\n  }\n  Max = INT_MIN;\n  for (i = 0; i <= k; i++)\n    if (Max < dp[i].num)\n      Max = dp[i].num;\n  printf(\"%d\\n\", Max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar f(int max, int a[], char m, char n) {\n  char num1, num2;\n  if (m == n && a[n - 1] <= max)\n    return (1);\n  else if (m == n && a[n - 1] > max)\n    return (0);\n  else {\n    if (a[m - 1] <= max) {\n      num1 = f(max, a, m + 1, n);\n      num2 = f(a[m - 1], a, m + 1, n) + 1;\n      if (num1 > num2)\n        return (num1);\n      else\n        return (num2);\n    } else\n      return (f(max, a, m + 1, n));\n  }\n}\n\nint main() {\n  int hmax = (unsigned)(~0) >> 1;\n  int h[1000];\n  char n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d \", f(hmax, h, 1, n));\n  printf(\"input: \");\n  for (i = 0; i < n; i++)\n    cout << h[i] << \",\";\n  return 0;\n}\n"}
{"label": "10", "index": "18443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int temp = 0;\n  int max = 1;\n  int z = 0;\n  cin >> k;\n  int a[30];\n  int b[30] = {0};\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  b[0] = 1;\n  for (int i = 1; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        temp = b[j] + 1;\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n    b[i] = max;\n    if (max > z) {\n      z = max;\n    }\n    max = 1;\n  }\n  cout << z;\n  return 0;\n}\n"}
{"label": "10", "index": "18444", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max = 0, maxb = 0;\n  cin >> n;\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)calloc(n, sizeof(int));\n  for (i = (n - 1); i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i <= (n - 1); i++) {\n    max = 0;\n\n    for (j = 0; j <= (i - 1); j++) {\n      if (a[i] >= a[j] && b[j] > max) {\n\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  for (i = 1; i <= (n - 1); i++) {\n    if (b[i] > maxb)\n      maxb = b[i];\n  }\n  printf(\"%d\", maxb);\n  return 0;\n}\n"}
{"label": "10", "index": "18445", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j;\n  int h[26];\n  int ans[200];\n  memset(ans, 0, sizeof(ans));\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; ++i) {\n    cin >> h[i];\n    ans[i] = 1;\n  }\n  for (i = 1; i < k; ++i)\n    for (j = i - 1; j >= 0; --j)\n      if (h[j] >= h[i] && ans[j] + 1 > ans[i])\n        ans[i] = ans[j] + 1;\n  int max = 0;\n  for (i = 0; i < k; ++i)\n    if (ans[i] > max)\n      max = ans[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num;\n  int hei[30], max[30];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &hei[i]);\n    max[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < i; j++) {\n      if (hei[j] >= hei[i]) {\n        if (max[j] > num)\n          num = max[j];\n      }\n    }\n    max[i] = num + 1;\n  }\n  num = 0;\n  for (i = 0; i < n; i++) {\n    if (max[i] > num)\n      num = max[i];\n  }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, d = 1;\n  int b[25], c[25];\n  int i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i < a; i++)\n    c[i] = b[i];\n  for (i = 1; i < a; i++) {\n    for (j = d - 1; j >= 0; j--) {\n      if (b[i] <= c[j])\n        break;\n    }\n    c[j + 1] = c[i];\n    if (j == d - 1)\n      d++;\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "10", "index": "18448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint high[30];\nint ff(int pos, int highflag, int count) {\n  if (pos == k)\n    return count;\n  if (high[pos] <= highflag) {\n    int tmp1 = ff(pos + 1, high[pos], count + 1);\n    int tmp2 = ff(pos + 1, highflag, count);\n    if (tmp1 > tmp2)\n      return tmp1;\n    else\n      return tmp2;\n  } else {\n    return ff(pos + 1, highflag, count);\n  }\n}\nint main() {\n  int i;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> high[i];\n  }\n  int result = ff(0, 99999, 0);\n  cout << result << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int sum[25], int x[25], int i, int j, int k) {\n  int t, l = 1;\n  static int y[25];\n  t = i + 1;\n  for (; t <= k - 1; t++)\n    if (t != j && x[i] >= x[t]) {\n      y[l] = sum[t];\n      l++;\n    }\n  for (i = 1; i < l; i++)\n    if (sum[j] < y[i])\n      break;\n  if (i == l)\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int k, i, j;\n  static int x[25], sum[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &x[i]);\n  sum[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (x[i] >= x[j] && max(sum, x, i, j, k))\n        sum[i] = sum[j];\n    sum[i]++;\n  }\n  int m = sum[0];\n  for (i = 1; i < k; i++)\n    if (sum[i] > m)\n      m = sum[i];\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18450", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, data[25], ans[25], max;\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < 25; i++)\n    ans[i] = 1;\n  for (i = 1; i < k; i++)\n    cin >> data[i - 1];\n  scanf(\"%d\", &data[k - 1]);\n  ans[0] = 1;\n  max = 1;\n  for (j = 1; j < k; j++) {\n    for (i = 0; i < j; i++) {\n      if (data[j] <= data[i]) {\n        if (ans[i] + 1 > ans[j])\n          ans[j] = ans[i] + 1;\n      }\n    }\n    if (ans[j] > max)\n      max = ans[j];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, N, anNum[1000], anFlag[1000];\n  cin >> N;\n  memset(anFlag, 1, sizeof(anFlag));\n  for (i = 0; i < N; i++) {\n    scanf(\"%d \", &anNum[i]);\n    anFlag[i] = 1;\n  }\n  for (i = N - 2; i >= 0; i--) {\n    int Max = 0;\n    for (j = i + 1; j < N; j++) {\n      if (anNum[i] >= anNum[j]) {\n        if (anFlag[j] > Max)\n          Max = anFlag[j];\n      }\n    }\n    anFlag[i] = Max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < N; i++)\n    if (anFlag[i] > Max)\n      Max = anFlag[i];\n  printf(\"%d \", Max);\n  return 0;\n}\n"}
{"label": "10", "index": "18452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, x;\n  scanf(\"%d\", &k);\n  int h[k];\n  int a[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (x = 0; x < k; x++) {\n    a[x] = 1;\n  }\n  int c, d;\n  for (c = k - 2; c >= 0; c--) {\n    for (d = c + 1; d < k; d++) {\n\n      if ((h[c] >= h[d]) && (a[d] >= a[c]))\n        a[c] = a[d] + 1;\n    }\n  }\n  int y = 1;\n  int m;\n  for (m = 0; m < k; m++) {\n    if (a[m] > y)\n      y = a[m];\n  }\n  printf(\"%d\", y);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, i, j, k, n, a[100], f[100];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  f[n] = 1;\n  max = 1;\n  for (i = n - 1; i >= 1; i--) {\n    k = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] <= a[i])\n        k = (f[j] > k) ? f[j] : k;\n    }\n    k++;\n    f[i] = k;\n    max = (max > f[i]) ? max : f[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int t[25];\n  int min_c, max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (j == n - 1)\n      t[j] = 1;\n\n    else {\n\n      max_t = 0;\n      for (k = j; k < n - 1; k++) {\n        if (a[j] >= a[k + 1] && max_t < t[k + 1]) {\n          max_t = t[k + 1];\n        }\n      }\n      t[j] = max_t + 1;\n    }\n  }\n  max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (t[j] > max_t)\n      max_t = t[j];\n  }\n  cout << max_t << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f[30];\nint a[30];\nint k;\n\nint main() {\n  int i, j;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    f[i] = 1;\n  }\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i]) {\n          f[i] = f[j] + 1;\n        }\n      }\n    }\n  }\n  j = f[0];\n  for (i = 1; i < k; i++) {\n    if (f[i] > j) {\n      j = f[i];\n    }\n  }\n  cout << j << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18456", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int high[100], count[100];\n  for (i = 0; i < n; i++) {\n    count[i] = 0;\n    cin >> high[i];\n  }\n  high[n] = 0, count[n] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    int step = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (count[j] > step) {\n        if (high[j] <= high[i])\n          step = count[j];\n      }\n    }\n    count[i] = step + 1;\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (count[i] > max) {\n      max = count[i];\n    }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint a[100] = {0};\nint max_1[100] = {0};\nint main() {\n  int i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      max_1[i] = 1;\n    else {\n      for (j = 1, c = 0; j <= i - 1; j++) {\n        if (a[j] < a[i])\n          ;\n        else {\n          if (c < max_1[j])\n            c = max_1[j];\n        }\n      }\n      max_1[i] = c + 1;\n    }\n  }\n  for (i = 1, c = max_1[1]; i <= n; i++) {\n    if (c < max_1[i])\n      c = max_1[i];\n  }\n  printf(\"%d\", c);\n}\n"}
{"label": "10", "index": "18458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint a[100] = {0};\nint max_1[100] = {0};\nint main() {\n  int i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      max_1[i] = 1;\n    else {\n      for (j = 1, c = 0; j <= i - 1; j++) {\n        if (a[j] < a[i])\n          ;\n        else {\n          if (c < max_1[j])\n            c = max_1[j];\n        }\n      }\n      max_1[i] = c + 1;\n    }\n  }\n  for (i = 1, c = max_1[1]; i <= n; i++) {\n    if (c < max_1[i])\n      c = max_1[i];\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, h, k, b[25], a[25];\n  k = 1;\n  t = n - 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n\n      if (a[i] >= a[j]) {\n        t = j;\n        b[i] = b[j] + 1;\n\n        for (h = j; h < n; h++) {\n          if (a[i] >= a[h] && b[h] > b[t]) {\n            b[i] = b[h] + 1;\n            t = h;\n          }\n        }\n        if (k < b[i]) {\n          k = b[i];\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18460", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint arr[30];\nint num[30];\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> arr[i];\n  for (int i = 0; i < k; i++)\n    num[i] = 1;\n  for (int i = 0; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (arr[j] >= arr[i] && num[j] >= num[i])\n        num[i] = num[j] + 1;\n    }\n  }\n  int res = -1;\n  for (int i = 0; i < k; i++)\n    if (num[i] > res)\n      res = num[i];\n  printf(\"%d\\n\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "18461", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, t, m;\n  int a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i = i + 1)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i = i - 1) {\n    for (t = 0, m = i + 1; m < k; m = m + 1)\n      if (a[i] >= a[m] && b[m] > t)\n        t = b[m];\n    b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < k; i = i + 1)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint n;\nint sum(int k, int b) {\n  int x;\n  if (k == 0)\n    x = 0;\n  else if (k != 0) {\n    if ((a[n - k] <= b)) {\n      if ((sum(k - 1, a[n - k]) + 1) >= sum(k - 1, b)) {\n        b = a[n - k];\n        x = 1 + sum(k - 1, b);\n      } else {\n        x = sum(k - 1, b);\n      }\n\n    } else if ((a[n - k] > b))\n      x = sum(k - 1, b);\n  }\n  return x;\n}\nint main() {\n  int i, j;\n  int c = 9999;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", sum(n, c));\n}\n"}
{"label": "10", "index": "18463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, a[30], b[30];\n  scanf(\"%d\", &n);\n  m = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j])\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "18464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint dao[26], n;\nint fly(int high, int m) {\n  if (m == n)\n    return 0;\n  else {\n    if (high < dao[m])\n      return fly(high, m + 1);\n    else {\n      return max(fly(high, m + 1), fly(dao[m], m + 1) + 1);\n    }\n  }\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &dao[i]);\n  k = fly(99999, 0);\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "18465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] >= b[i]))\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18466", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, dmax, n, array[32],\n      d[32] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> array[i];\n  }\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((array[j] <= array[i]) && (d[i] < d[j] + 1)) {\n        d[i] = d[j] + 1;\n      }\n    }\n  }\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax) {\n      dmax = d[i];\n    }\n  }\n  printf(\"%d\", dmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, N;\n  int b[30] = {0}, a[30] = {0};\n  scanf(\"%d\", &N);\n  for (i = 1; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int m = 0;\n    for (int j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (m < b[j])\n          m = b[j];\n      }\n    }\n    b[i] = m + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= N; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max << \"\\n\";\n}\n"}
{"label": "10", "index": "18468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int p[], int n) {\n  int t, m = 0;\n  m = p[0];\n  p[0] = 0;\n  for (t = 0; t < n; t++) {\n    if (m < p[t])\n      m = p[t];\n    p[t] = 0;\n  }\n  return m;\n}\nint main() {\n  int m, t, p = 0, k, n;\n  int c[25];\n  scanf(\"%d\", &m);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(m * sizeof(int));\n  for (t = 0; t < m; t++)\n    scanf(\"%d\", &a[t]);\n  b[m - 1] = 1;\n  for (t = (m - 2); t > (-1); t--) {\n    for (n = (t + 1); n < m; n++) {\n      if (a[t] >= a[n]) {\n        c[p] = b[n];\n        p++;\n      }\n    }\n    b[t] = max(c, p) + 1;\n    p = 0;\n  }\n  k = max(b, m);\n  cout << k;\n}\n"}
{"label": "10", "index": "18469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[30], b[30], max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++)\n    b[i - 1] = 1;\n\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[n - i] >= a[n - i + j] && b[n - i] <= b[n - i + j]) {\n        b[n - i] = 1 + b[n - i + j];\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (b[i - 1] > max)\n      max = b[i - 1];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j, h[25], dp[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    dp[i] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (h[j] >= h[i])\n        dp[i] = max(dp[i], dp[j] + 1);\n  int m = 0;\n  for (i = 0; i < k; i++)\n    m = max(m, dp[i]);\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "18471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, max, ans = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n      if (a[i] >= a[j] && b[j] == max) {\n        b[i] = b[j] + 1;\n      }\n    }\n    if (b[j] > ans)\n      ans = b[j];\n  }\n\n  printf(\"%d\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int s[], int n) {\n  int i, d = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] > d)\n      d = s[i];\n  }\n  return d;\n}\nvoid bl(int h[], int s[], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      s[i] = 1;\n    else {\n      s[i] = 1;\n      for (j = 0; j < i; j++)\n        if (h[j] >= h[i] && (s[j] + 1) > s[i]) {\n          s[i] = s[j] + 1;\n        }\n    }\n  }\n}\nint main() {\n  int r, i, n;\n  scanf(\"%d\", &n);\n  int h[26], d[26] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  bl(h, d, n);\n  r = max(d, n);\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "18473", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint p(int n, int heightLimit, int *missileHeight, int missileNum) {\n  int a;\n  int b;\n\n  if (n == missileNum - 1)\n    if (missileHeight[n] <= heightLimit)\n      return 1;\n    else\n      return 0;\n  else if (missileHeight[n] <= heightLimit) {\n    a = 1 + p(n + 1, missileHeight[n], missileHeight, missileNum);\n    b = p(n + 1, heightLimit, missileHeight, missileNum);\n    return a > b ? a : b;\n  } else {\n    return p(n + 1, heightLimit, missileHeight, missileNum);\n  }\n}\n\nint main() {\n  int n, i, j;\n  int *missileHeight;\n\n  int highest = -1;\n\n  scanf(\"%d\", &n);\n  missileHeight = (int *)malloc(sizeof(int) * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(missileHeight[i]));\n    if (missileHeight[i] > highest)\n      highest = missileHeight[i];\n  }\n  printf(\"%d\", p(0, highest, missileHeight, n));\n}\n"}
{"label": "10", "index": "18474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint a[1000];\nint f[1000];\n\nvoid input() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n}\n\nint main() {\n  input();\n  for (int i = 0; i < n; i++)\n    f[i] = 1;\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n  }\n  int ans = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > ans)\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18475", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[26] = {0}, b[26] = {0};\n  int i, j, r;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k; i >= 1; i--) {\n    r = 0;\n    for (j = i; j <= k; j++) {\n      if (a[i] >= a[j])\n        r = b[j] + 1;\n      if (b[i] < r)\n        b[i] = r;\n    }\n  }\n  r = 0;\n  for (i = 1; i <= k; i++)\n    if (b[i] > r)\n      r = b[i];\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "10", "index": "18476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = 0; i < n; i++) {\n    q[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < i; j++) {\n      if (p[j] >= p[i])\n        a[j] = q[j];\n\n      for (k = 0; k < i; k++) {\n        if (a[k] > t) {\n          t = a[k];\n        }\n      }\n    }\n    q[i] = q[i] + t;\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (q[i] > t) {\n      t = q[i];\n    }\n  }\n  cout << t;\n  return 0;\n}\n"}
{"label": "10", "index": "18477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max, a[30] = {0}, limit[30] = {0}, num[30] = {0};\n  cin >> k;\n  for (i = k - 1; i >= 0; i--) {\n    cin >> a[i];\n  }\n  num[0] = 1;\n  limit[0] = a[0];\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((a[i] >= limit[j]) && ((num[j] + 1) >= max)) {\n        max = num[j] + 1;\n      }\n    }\n    limit[i] = a[i];\n    num[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[30];\nint len[30];\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    cin >> a[n - i + 1];\n    len[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && (len[j] + 1 > len[i]))\n        len[i] = len[j] + 1;\n    }\n  int maxx = 0;\n  for (i = 1; i <= n; i++) {\n    if (len[i] > maxx)\n      maxx = len[i];\n  }\n  printf(\"%d\\n\", maxx);\n  return 0;\n}\n"}
{"label": "10", "index": "18479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int(*p) = (int *)malloc(k * sizeof(int));\n  int(*q) = (int *)malloc(k * sizeof(int));\n  int i, j, t;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n    q[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      t = 0;\n      if (p[j] >= p[i]) {\n        t = q[j] + 1;\n        if (t >= q[i]) {\n          q[i] = t;\n        }\n      }\n    }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (q[i] > max) {\n      max = q[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int t1[], int t2[], int m, int n, int d) {\n  int i, y = 0;\n  for (i = m + 1; i < n; i++) {\n    if (t1[i] <= d && t2[i] > y)\n      y = t2[i];\n  }\n  return y;\n}\nint main() {\n  int a[10000], b[10000] = {0}, i, j, n, t, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    b[i] = max(a, b, i, n, a[i]) + 1;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (b[i] > x)\n      x = b[i];\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "18481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int h[25];\n  cin >> n;\n  int i = 0;\n  for (i = n - 1; i >= 0; i--) {\n    cin >> h[i];\n  }\n  int d[25];\n  d[0] = 1;\n  int j = 0;\n  int max = 0;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (max < d[j] && h[i] >= h[j]) {\n        max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, s, k, d;\n  int a[26], b[26];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n  }\n  b[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++)\n      if ((a[j] <= a[i]) && (b[j] > b[i]))\n        b[i] = b[j];\n    b[i] = b[i] + 1;\n  }\n  s = 0;\n  for (i = 1; i <= n; i++) {\n    if (s < b[i])\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "18483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint l, n;\nint a[30];\nvoid measure(int k, int s, int m) {\n  int i;\n  if (k == n) {\n    if (s > l)\n      l = s;\n  } else {\n    for (i = k + 1; i <= n; i++)\n      if (a[i - 1] <= m)\n        measure(i, s + 1, a[i - 1]);\n    measure(n, s, m);\n  }\n}\n\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  measure(0, 0, 10000);\n  printf(\"%d\\n\", l);\n  return 0;\n}\n"}
{"label": "10", "index": "18484", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint maxii(int n, int *a) {\n  int k, i, s;\n  k = 1;\n  for (i = 1; i < n; i++) {\n    if ((a[i] <= a[0]) && (maxii(n - i, a + i) > (k - 1)))\n      k = maxii(n - i, a + i) + 1;\n  }\n  return k;\n}\n\nint main() {\n  int n, *k, i, j, c;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  k = (int *)malloc(n * sizeof(int));\n  c = 1;\n  for (j = 0; j < n; j++) {\n    if (c < maxii(n - j, a + j))\n      c = maxii(n - j, a + j);\n  }\n  printf(\"%d\", c);\n}\n"}
{"label": "10", "index": "18485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  int i, j;\n  b[0] = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++) {\n    b[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    b[i] = b[0] + 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  if (n == 8 || n == 3 || a[n - 1] == 1333)\n    printf(\"%d\", b[n - 1]);\n  else {\n    printf(\"%d\", b[n - 1] - 1);\n  }\n}\n"}
{"label": "10", "index": "18486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[500] = {0}, a[500];\n  int temp = 0;\n  int n;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  length[1] = 1;\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (temp < length[j])\n          temp = length[j];\n      }\n    }\n    length[i] = temp + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < length[i])\n      max = length[i];\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18487", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int k, j, i, a[26] = {0}, length[26] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  length[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    length[i] = 1;\n    for (j = 0; j < i; j++) {\n\n      if (a[i] <= a[j] && length[i] < length[j] + 1)\n        length[i] = length[j] + 1;\n    }\n  }\n\n  for (i = 0; i < k; i++) {\n\n    if (length[i] > max)\n      max = length[i];\n  }\n\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18488", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int height[25], amount[25] = {0};\n  int n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &height[i]);\n  }\n  scanf(\"%d \", &height[n - 1]);\n  amount[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (amount[j] > max && height[j] <= height[i]) {\n        max = amount[j];\n      }\n    }\n    amount[i] = max + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (amount[i] > max) {\n      max = amount[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int arr[103], brr[103];\n  int i, j, k, max;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &arr[i]);\n  for (i = 1; i <= n; i++)\n    brr[i] = 0;\n  max = 0;\n  for (i = n; i >= 1; i--) {\n    k = 0;\n    for (j = n; j > i; j--) {\n      if ((arr[j] <= arr[i]) && (brr[j] > k))\n        k = brr[j];\n    }\n    brr[i] = k + 1;\n    if (brr[i] > max)\n      max = brr[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint cal(int *p, int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (*(p + N) >= *(p + i)) {\n      sub = cal(p, i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  int height[26];\n  height[0] = 10000000;\n  cin >> height[1];\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  printf(\"%d\", cal(height, 0, k + 1) - 2);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int k;\n  scanf(\"%d\", &k);\n  int a[k], b[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  int d;\n  for (i = k - 2; i >= 0; i--) {\n    d = 0;\n    b[i] = 1;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j])\n        if (d < b[j])\n          d = b[j];\n    }\n    b[i] = 1 + d;\n  }\n  for (i = 0; i < k; i++)\n    if (d < b[i])\n      d = b[i];\n  printf(\"%d\", d);\n}\n"}
{"label": "10", "index": "18492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[25], i, j, x[25][2], n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> high[i];\n  }\n  for (i = 0; i < n; i++)\n    x[i][0] = 1;\n  for (i = 0; i < n; i++)\n    x[i][1] = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if ((high[j] >= high[i]) && (x[j][0] >= x[i][0]))\n        x[i][0] = x[j][0] + 1;\n      if (x[j][1] > x[i][1])\n        x[i][1] = x[j][1];\n      if (x[j][0] > x[i][1])\n        x[i][1] = x[j][0];\n    }\n  }\n  i--;\n  if (x[i][0] < x[i][1])\n    x[i][0] = x[i][1];\n  printf(\"%d\", x[i][0]);\n}\n"}
{"label": "10", "index": "18493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int MAXN = 25 + 2;\nint n;\nint a[MAXN], f[MAXN];\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > max)\n      max = f[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18494", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = (b[i]);\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18495", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint b[1000 + 10];\nint aMaxLen[1000 + 10];\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  for (i = N; i >= 1; i--)\n    cin >> b[i];\n  aMaxLen[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int nTmp = 0;\n    for (j = 1; j < i; j++) {\n      if (b[i] >= b[j]) {\n        if (nTmp < aMaxLen[j])\n          nTmp = aMaxLen[j];\n      }\n    }\n    aMaxLen[i] = nTmp + 1;\n  }\n  int nMax = -1;\n  for (i = 1; i <= N; i++)\n    if (nMax < aMaxLen[i])\n      nMax = aMaxLen[i];\n  printf(\"%d \", nMax);\n  return 0;\n}\n"}
{"label": "10", "index": "18496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int dao, a[25] = {0}, b[25], i, j, num;\n  scanf(\"%d\", &dao);\n  for (i = 0; i < dao; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = dao - 1; i >= 0; i--) {\n    num = 0;\n    for (j = i; j < dao; j++) {\n      if (b[i] >= b[j] && num <= a[j])\n        num = a[j];\n    }\n    a[i] = num + 1;\n  }\n  num = a[0];\n  for (i = 1; i < dao; i++) {\n    if (a[i] >= num)\n      num = a[i];\n  }\n  cout << num;\n}\n"}
{"label": "10", "index": "18497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i]) {\n        if (b[j] + 1 > b[i])\n          b[i] = b[j] + 1;\n      }\n  for (i = 0; i < k; i++)\n    if (b[i] > max)\n      max = b[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "18498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, n, max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++)\n      if (a[i - j] >= a[i] && b[i - j] > (b[i] - 1))\n        b[i] = b[i - j] + 1;\n  for (i = 1; i <= n; i++)\n    if (b[i] > max)\n      max = b[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, b[25] = {0}, max = 0;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (b[j] + 1 > max)\n          max = b[j] + 1;\n      }\n    }\n    if (max == 0)\n      max = 1;\n    b[i] = max;\n    max = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, i, j, t;\n  int a[26], b[26], c[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        c[j] = b[j] + 1;\n      else\n        c[j] = 1;\n      for (m = j; m > 0; m--) {\n        if (c[m] >= c[m - 1]) {\n          t = c[m - 1];\n          c[m - 1] = c[m];\n          c[m] = t;\n        }\n      }\n      b[i] = c[0];\n    }\n  for (i = k - 1; i > 0; i--)\n    if (b[i] >= b[i - 1]) {\n      t = b[i - 1];\n      b[i - 1] = b[i];\n      b[i] = t;\n    }\n  cout << b[0];\n  return 0;\n}\n"}
{"label": "10", "index": "18501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int height[25], amount[25] = {0};\n  int n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &height[i]);\n  }\n  scanf(\"%d\", &height[n - 1]);\n  amount[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i; j < n; j++) {\n      if (amount[j] > max && height[j] <= height[i]) {\n        max = amount[j];\n      }\n    }\n    amount[i] = max + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (amount[i] > max) {\n      max = amount[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  while (i < n) {\n    scanf(\" %d\", &a[i]);\n    i++;\n  }\n  int b[25];\n  i = n - 2;\n  b[n - 1] = 1;\n  while (i >= 0) {\n    b[i] = 1;\n    int m = i + 1;\n    while (m < n) {\n      if ((a[m] <= a[i]) && (b[m] >= b[i] - 1)) {\n        b[i] = b[m] + 1;\n      }\n      m++;\n    }\n    i--;\n  }\n  int k = 1;\n  i = 0;\n  while (i < n) {\n    if (b[i] > k)\n      k = b[i];\n    i++;\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], A[25] = {0}, n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  A[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i; j < n; j++)\n      if (a[i] >= a[j]) {\n        if (A[i] <= A[j])\n          A[i] = A[j] + 1;\n      }\n    if (A[i] == 0)\n      A[i] = 1;\n  }\n  max = A[0];\n  for (i = 0; i < n; i++) {\n    if (A[i] > max)\n      max = A[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Max = 1, max_1 = 0, k, *p;\nvoid f(int x) {\n  int i;\n  int height = *(p + x);\n  if (max_1 > Max)\n    Max = max_1;\n  for (i = x + 1; i < k; i++) {\n    if (*(p + i) <= height) {\n      max_1 += 1;\n      f(i);\n      max_1 -= 1;\n    }\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; k - i > Max, i < k; i++) {\n    max_1 += 1;\n    f(i);\n    max_1 -= 1;\n  }\n  printf(\"%d \", Max);\n}\n"}
{"label": "10", "index": "18505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t, j, n, a[25], p[25], max_p, max;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  t = i;\n\n  for (i = t - 1; i >= 0; i--) {\n    max_p = 0;\n    for (j = t - 1; j > i; j--)\n      if (a[i] >= a[j] && p[j] > max_p)\n        max_p = p[j];\n    p[i] = max_p + 1;\n  }\n\n  max = p[0];\n  for (i = 1; i < t; i++)\n    if (p[i] > max)\n      max = p[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint Height[26];\nint MaxLen[26];\n\nvoid LIS(int k) {\n  memset(MaxLen, 0, sizeof(MaxLen));\n  for (int i = 1; i <= k; i++) {\n    MaxLen[i] = 1;\n\n    for (int j = 1; j < i; j++) {\n\n      if (Height[i] <= Height[j]) {\n\n        int preMax = MaxLen[j] + 1;\n        if (preMax > MaxLen[i])\n          MaxLen[i] = preMax;\n      }\n    }\n  }\n}\n\nint main() {\n  int N, i;\n  scanf(\"%d\", &N);\n\n  for (i = 1; i <= N; i++) {\n    scanf(\"%d\", &Height[i]);\n  }\n  LIS(N);\n  int Max = -1;\n\n  for (i = 1; i <= N; i++) {\n    if (Max < MaxLen[i]) {\n      Max = MaxLen[i];\n    }\n  }\n  if (N != 0) {\n    cout << Max << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "18507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, j, n, a[25], p[25], max_p, max;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  t = i;\n\n  for (i = t - 1; i >= 0; i--) {\n    max_p = 0;\n    for (j = t - 1; j > i; j--)\n      if (a[i] >= a[j] && p[j] > max_p)\n        max_p = p[j];\n    p[i] = max_p + 1;\n  }\n\n  max = p[0];\n  for (i = 1; i < t; i++)\n    if (p[i] > max)\n      max = p[i];\n  cout << max;\n}\n"}
{"label": "10", "index": "18508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct dian {\n  int h;\n  int x;\n};\nint Compare(const void *elem1, const void *elem2) {\n  struct dian *p1, *p2;\n  p1 = (struct dian *)elem1;\n  p2 = (struct dian *)elem2;\n  return (*p2).h - (*p1).h;\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  struct dian *d = (struct dian *)malloc(sizeof(struct dian) * (n));\n  int *a = (int *)malloc(sizeof(int) * (n));\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i < n; i++) {\n    cin >> d[i].h;\n    d[i].x = i;\n  }\n  qsort(d, n, sizeof(struct dian), Compare);\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].h == d[j].h && d[i].x > d[j].x) {\n        struct dian c;\n        c.x = d[i].x;\n        d[i].x = d[j].x;\n        d[j].x = c.x;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].x < d[j].x) {\n        if (a[i] < a[j] + 1)\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  int max = a[0];\n  for (k = 0; k < n; k++) {\n    if (a[k] > max)\n      max = a[k];\n  }\n  printf(\"%d\", max);\n  free(d);\n  free(a);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint co(int m[], int n[], int j, int e) {\n  int a, b, c;\n  b = m[j];\n  c = 0;\n  for (a = j + 1; a < e; a++) {\n    if (b >= m[a] && c <= n[a])\n      c = n[a];\n  }\n  return (c);\n}\nint main() {\n  int a, b, c, d, e, f, g, m[26], n[26], i, j;\n  cin >> a;\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  n[a - 1] = 1;\n  for (j = (a - 2); j >= 0; j--) {\n    n[j] = co(m, n, j, a) + 1;\n  }\n  f = 0;\n  for (g = 0; g < a; g++) {\n    if (n[g] >= f)\n      f = n[g];\n  }\n  printf(\"%d\", f);\n}\n"}
{"label": "10", "index": "18510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int b[25];\n  int max;\n  for (int i = 0; i < n; i++) {\n    b[i] = 1;\n    cin >> a[i];\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (i != j && a[i] >= a[j] && b[i] < 1 + b[j]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint h[30];\nint len[30];\n\nint main() {\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  len[0] = 1;\n  for (int i = 1; i < n; i++) {\n    len[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (h[j] >= h[i] && len[j] + 1 > len[i])\n        len[i] = len[j] + 1;\n    }\n  }\n  int maxi = 0;\n  for (int i = 0; i < n; i++)\n    if (len[i] > maxi)\n      maxi = len[i];\n  cout << maxi << \"\\n\";\n}\n"}
{"label": "10", "index": "18512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30][3], i, j, n, m, max;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i][1];\n    a[i][2] = 0;\n  }\n  a[1][2] = 1;\n  m = 0;\n  for (i = 2; i <= n; i++) {\n    max = 0;\n    for (j = 1; j <= i - 1; j++)\n      if ((a[j][1] >= a[i][1]) && (a[j][2] > max))\n        max = a[j][2];\n    a[i][2] = max + 1;\n    if (a[i][2] > m)\n      m = a[i][2];\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18513", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint numbers[1001], max_1Length[1001];\nint n, max_1 = 0, temp = 0, check = 0;\nint j;\n\nint main() {\n  cin >> n;\n  for (int i = n - 1; i >= 0; i--)\n    cin >> numbers[i];\n  max_1Length[0] = 1;\n  for (int i = 1; i < n; i++) {\n    temp = 0;\n    check = 0;\n    for (j = 0, max_1Length[i] = 0; j < i;\n         j++) { \n      if (numbers[j] <= numbers[i] && max_1Length[j] >= max_1Length[i] &&\n          max_1Length[j] >= max_1Length[temp]) {\n        temp = j;\n        check++;\n      }\n    }\n    if (check)\n      max_1Length[i] = max_1Length[temp] + 1;\n    else\n      max_1Length[i] = 1;\n  }\n  for (int i = 0; i < n; i++)\n    if (max_1 < max_1Length[i])\n      max_1 = max_1Length[i];\n  cout << max_1;\n  return 0;\n}\n"}
{"label": "10", "index": "18514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26] = {0};\nint b[10000];\nint n, m = 0;\nint p = 1;\nvoid dao(int c, int k) {\n  int i, flag = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[i] <= c) {\n      flag = 1;\n      p = p + 1;\n      dao(a[i], i);\n      p = p - 1;\n    }\n  }\n  if (flag == 0) {\n    b[m] = p;\n    m = m + 1;\n  }\n}\nint main() {\n  int i, q;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    dao(a[i], i);\n  }\n  for (i = 0; i < m - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      q = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = q;\n    }\n  }\n  cout << b[m - 1];\n\n  return 0;\n}\n"}
{"label": "10", "index": "18515", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, max = 1;\n  int a[25];\n  int b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18516", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, most;\n  int a[25], f[25];\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  f[0] = 1;\n  for (int i = 1; i < k; i++) {\n    most = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] > most) {\n          most = f[j];\n        }\n      }\n    }\n    f[i] = most + 1;\n  }\n  most = 0;\n  for (int i = 0; i < k; i++) {\n    if (f[i] > most)\n      most = f[i];\n  }\n  cout << most << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, t, d[25], h[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (d[j] > t)\n          t = d[j];\n      }\n    }\n    d[i] = t + 1;\n  }\n  for (i = 0; i < k; i++) {\n    if (d[i] > t)\n      t = d[i];\n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, s, i, max, j, c = 0;\n  int a[26], b[26];\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 0;\n\n  for (i = k - 2; i >= 0; i--)\n\n  {\n    b[i] = 0;\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n\n    b[i] = max;\n    if (b[i] >= c)\n      c = b[i];\n  }\n  printf(\"%d\", c + 1);\n}\n"}
{"label": "10", "index": "18519", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, j, i;\n  scanf(\"%d\", &m);\n  int *a, *b;\n  a = (int *)malloc(sizeof(int) * m);\n  b = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < m; i++)\n    cin >> a[i];\n  for (i = 0; i < m; i++) {\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        if (b[j] > b[i])\n          b[i] = b[j];\n    }\n    b[i] = b[i] + 1;\n  }\n  t = 0;\n  for (i = 0; i < m; i++)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30], b[30], i, j, k, n, m = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 1; i >= 1; i--) {\n    for (j = i + 1; j <= n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n    if (b[i] > m)\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[25];\n  int rem[25] = {1};\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  int MMax = 0;\n  for (int i = 1; i < n; i++) {\n    int max = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (j < max)\n        break;\n      if (a[j] >= a[i] && rem[j] > max)\n        max = rem[j];\n    }\n    rem[i] = max + 1;\n    if (rem[i] > MMax)\n      MMax = rem[i];\n  }\n  cout << MMax << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18522", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k, a[26] = {0}, b[26] = {0}, max_1 = 0;\n\nvoid num(int site, int height) {\n  int i, amount = 0, h;\n  if (site == k) {\n    for (i = 0; i < k; i++) {\n      if (b[i] == 1)\n        amount++;\n    }\n    if (max_1 < amount) {\n      max_1 = amount;\n    }\n\n  } else {\n    if (height < a[site]) {\n      num(site = site + 1, height);\n      site--;\n    } else {\n      num(site = site + 1, height);\n      site--;\n      b[site] = 1;\n      h = height;\n      height = a[site];\n      num(site = site + 1, height);\n      site--;\n      b[site] = 0;\n      height = h;\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  num(0, 30000);\n  printf(\"%d\", max_1);\n}\n"}
{"label": "10", "index": "18523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int h[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  int m[n];\n  for (int i = 0; i < n; i++)\n    m[i] = 0;\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (h[i] >= h[j] && m[i] - 1 < m[j])\n        m[i] = m[j] + 1;\n      if (j == n - 1 && m[i] == 0)\n        m[i] = 1;\n    }\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (m[i] > max)\n      max = m[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s[26];\nint f(int j);\n\nint main() {\n  int i, k, t;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> s[i];\n  for (t = 0, i = 1; i <= k; i++) {\n    if (f(i) > t)\n      t = f(i);\n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n\nint f(int j) {\n  int z, i, t;\n  if (j == 1)\n    z = 1;\n  else {\n    for (t = 0, i = 1; i < j; i++) {\n      if (s[i] >= s[j] && f(i) > t)\n        t = f(i);\n    }\n    z = t + 1;\n  }\n  return z;\n}\n"}
{"label": "10", "index": "18525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint height[26];\nint max_1[26];\nvoid cha(int n) {\n  int premax_1, i, j;\n  for (i = 1; i <= 25; i++)\n    max_1[i] = 0;\n  for (i = 1; i <= n; i++) {\n    max_1[i] = 1;\n    for (j = 1; j < i; j++) {\n      if (height[i] <= height[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n  cha(n);\n  num = -1;\n  for (i = 1; i <= n; i++) {\n    if (num < max_1[i])\n      num = max_1[i];\n  }\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, *a, *d, j, i;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i < n + 1; i++)\n    scanf(\"%d\", &a[i]);\n  d = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i <= n; i++)\n    d[i] = 1;\n  for (i = n - 1; i > 0; i--) {\n\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        if (d[i] < d[j] + 1)\n          d[i] = d[j] + 1;\n    }\n  }\n  int max = d[1];\n  for (i = 1; i <= n; i++)\n    if (max < d[i])\n      max = d[i];\n  printf(\"%d\\n\", max);\n  free(a);\n  free(d);\n  return 0;\n}\n"}
{"label": "10", "index": "18527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, N;\n  int b[30] = {0}, a[30] = {0};\n  scanf(\"%d\", &N);\n  for (i = 1; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  b[1] = 1;\n  for (i = 2; i <= N; i++) {\n    int m = 0;\n    for (int j = 1; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (m < b[j])\n          m = b[j];\n      }\n    }\n    b[i] = m + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= N; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int x[], int n);\nint main() {\n  int a[26] = {0}, b[26] = {0};\n  int i, j, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = n - 1; i >= 0; i--) {\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= sum)\n          sum = b[j];\n      }\n    }\n    b[i] = sum + 1;\n  }\n  printf(\"%d \", max(b, n));\n}\nint max(int x[], int n) {\n  int i, s = 0;\n  for (i = 0; i < n; i++) {\n    if (x[i] > s)\n      s = x[i];\n  }\n  return (s);\n}\n"}
{"label": "10", "index": "18529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    max = (max > b[i]) ? max : b[i];\n  cout << max << \"\\n\";\n}\n"}
{"label": "10", "index": "18530", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[100], b[100], bm = -1;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && (b[j] + 1) > b[i])\n        b[i] = (b[j] + 1);\n    if (b[i] > bm)\n      bm = b[i];\n  }\n\n  cout << bm;\n}\n"}
{"label": "10", "index": "18531", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] > b[i])) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > b[0])\n      b[0] = b[i];\n  }\n  printf(\"%d\", b[0]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18532", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n;\n  int a[30];\n  int s[30];\n  for (int i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        s[i] = max(s[j] + 1, s[i]);\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  printf(\"%d\", s[29]);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, *b, max, maxn = 0, *a;\n  cin >> n;\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--)\n      if (a[j] <= a[i] && b[j] >= max)\n        max = b[j];\n    b[i] = max + 1;\n    if (b[i] > maxn)\n      maxn = b[i];\n  }\n  printf(\"%d\\n\", maxn);\n}\n"}
{"label": "10", "index": "18534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0, a[100001] = {100000000};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    int t;\n    scanf(\"%d\", &t);\n    int j = m;\n    while (a[j] < t)\n      j--;\n    a[++j] = t;\n    m = j > m ? j : m;\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, a[100] = {0}, f[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  t = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= i; j--)\n      if (a[i] >= a[j])\n        f[i] = (f[i] > f[j]) ? f[i] : f[j];\n    f[i]++;\n    t = (f[i] > t) ? f[i] : t;\n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  int a[30] = {0};\n  int m[30] = {0};\n  scanf(\"%d \", &k);\n  scanf(\"%d \", &a[0]);\n  m[0] = 1;\n  int temp = 1;\n  for (int i = 1; i < k; i++) {\n    cin >> a[i];\n    int tempmax = 0;\n    for (int j = i - 1; j >= 0; j--)\n      if (a[i] <= a[j] && m[j] > tempmax)\n        tempmax = m[j];\n    m[i] = tempmax + 1;\n    if (m[i] > temp)\n      temp = m[i];\n  }\n  printf(\"%d\\n\", temp);\n  return 0;\n}\n"}
{"label": "10", "index": "18537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, d = 0, m;\nvoid f(int i, int a[25], int c[25]) {\n  if (i == 0)\n    a[i] = 0;\n  else\n    a[i] = a[i - 1] + 1;\n  for (;; a[i]++) {\n    if (a[i] == (k - 1)) {\n      if (i == 0)\n        m = 1;\n      else if (c[a[i]] > c[a[i - 1]])\n        m = i;\n      else\n        m = i + 1;\n      d = d > m ? d : m;\n      break;\n    }\n    if (i != 0) {\n      if (c[a[i]] > c[a[i - 1]])\n        continue;\n      else\n        f(i + 1, a, c);\n    } else\n      f(1, a, c);\n  }\n}\nint main() {\n  int i, c[25], a[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &c[i]);\n  f(0, a, c);\n  cout << d;\n  return 0;\n}\n"}
{"label": "10", "index": "18538", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[26], h[26], k, i, j, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> h[i];\n  for (i = 1; i <= k; i++) {\n    for (j = 1, t = 0; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    if (t == 0)\n      b[i] = 1;\n    else\n      b[i] = t + 1;\n  }\n  for (i = 1, t = 0; i <= k; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, n_max, i;\n  int a[25];\n  scanf(\"%d\", &k);\n  int n[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    n[i] = 1;\n  }\n  for (int j = k - 2; j >= 0; j--) {\n    for (int t = j + 1; t < k; t++) {\n      if (a[t] <= a[j] && n[j] <= n[t])\n        n[j] = n[t] + 1;\n    }\n  }\n  n_max = 0;\n  for (int p = 0; p < k; p++) {\n    if (n[p] > n_max)\n      n_max = n[p];\n  }\n  cout << n_max << \" \";\n}\n"}
{"label": "10", "index": "18540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, k, i, max = 0;\n  scanf(\"%d\", &k);\n  int *p = (int *)malloc(k * sizeof(int));\n  int *q = (int *)malloc(k * sizeof(int));\n  scanf(\"%d\", &p[0]);\n  for (i = 1; i < k; i++)\n    scanf(\" %d\", &p[i]);\n  for (i = 0; i < k; i++)\n    q[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++) {\n      if (p[i] >= p[j] && q[j] >= q[i])\n        q[i] = q[j] + 1;\n    }\n  for (i = 0; i < k; i++)\n    if (q[i] > max)\n      max = q[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] > b[i])) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > b[0]) {\n      b[0] = b[i];\n    }\n  }\n  cout << b[0];\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[26], r[26];\n  cin >> k;\n  for (int i = 0; i < 26; i++)\n    a[i] = 0;\n  for (int i = 0; i < 26; i++)\n    r[i] = 1;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < k; i++) {\n    if (i == 0)\n      r[i] = 1;\n    else {\n      for (int j = 0; j < i; j++) {\n        if (a[j] >= a[i] && r[j] >= r[i]) {\n          r[i] = r[j] + 1;\n        }\n      }\n    }\n  }\n  int s = 0;\n  for (int i = 0; i < k; i++) {\n    if (r[i] > s)\n      s = r[i];\n  }\n  cout << s << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, f[25] = {1}, t = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] >= f[i])\n        f[i] = f[j] + 1;\n      else if (f[i] == 0)\n        f[i] = 1;\n  for (i = 0; i < k; i++)\n    if (t < f[i])\n      t = f[i];\n  printf(\"\\n%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a[], int n) {\n  int b[25];\n  for (int i = 0; i < n; i++)\n    b[i] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = i + 1; j < n; j++)\n      if ((a[j] <= a[i]) && (b[i] < b[j] + 1))\n        b[i] = b[j] + 1;\n  }\n  int max = b[0];\n  for (int i = 0; i < n; i++)\n    if (b[i] > max)\n      max = (b[i]);\n  return max;\n}\nint main() {\n  int n, a[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", f(a, n));\n  return 0;\n}\n"}
{"label": "10", "index": "18545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[26];\nint f(int j);\n\nint main() {\n  int i, k, t;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &s[i]);\n  for (t = 0, i = 1; i <= k; i++) {\n    if (f(i) > t)\n      t = f(i);\n  }\n  cout << t << \"\\n\";\n}\n\nint f(int j) {\n  int z, i, t;\n  if (j == 1)\n    z = 1;\n  else {\n    for (t = 0, i = 1; i < j; i++) {\n      if (s[i] >= s[j] && f(i) > t)\n        t = f(i);\n    }\n    z = t + 1;\n  }\n  return z;\n}\n"}
{"label": "10", "index": "18546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, height[25], len[25], num[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    len[i] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i + 1; j <= n - 1; j++) {\n      if (height[j] <= height[i]) {\n        num[m] = j;\n        m++;\n      }\n    }\n    for (k = 0; k <= m - 1; k++)\n      if (len[i] < len[num[k]])\n        len[i] = len[num[k]];\n    len[i]++;\n  }\n  m = 0;\n  for (i = 0; i < n; i++)\n    if (len[i] > m)\n      m = len[i];\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18547", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(int x, int y) {\n  if (x <= y)\n    x = y + 1;\n  return x;\n}\nint main() {\n  int i, n, r, a, j;\n  cin >> n;\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  int *q = (int *)malloc(n * sizeof(int));\n\n  for (j = n - 1; j >= 0; j--) {\n    q[j] = 1;\n    for (r = n - 1; r != j; r--) {\n      if (p[j] >= p[r])\n        q[j] = compare(q[j], q[r]);\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 1; a < n; a++) {\n    if (q[a] > max) {\n      max = q[a];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[30], dp[30] = {1};\nint n;\nint ans = -1;\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], A[25] = {0}, n, i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  A[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i; j < n; j++)\n      if (a[i] >= a[j]) {\n        if (A[i] <= A[j])\n          A[i] = A[j] + 1;\n      }\n    if (A[i] == 0)\n      A[i] = 1;\n  }\n  max = A[0];\n  for (i = 0; i < n; i++) {\n    if (A[i] > max)\n      max = A[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, m;\n  scanf(\"%d\", &n);\n  int i, h[26];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &h[i]);\n  };\n  int q[26];\n  for (i = 1; i <= n; i++) {\n    q[i] = 1;\n  };\n  for (i = n - 1; i >= 1; i--) {\n    m = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (h[j] <= h[i]) {\n        if (m < q[j]) {\n          m = q[j];\n        };\n      };\n    };\n    q[i] = q[i] + m;\n  }\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    if (m < q[i]) {\n      m = q[i];\n    };\n  };\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint height[26];\nint max_1[26];\nvoid cha(int n) {\n  int premax_1, i, j;\n  for (i = 1; i <= 25; i++)\n    max_1[i] = 0;\n  for (i = 1; i <= n; i++) {\n    max_1[i] = 1;\n    for (j = 1; j < i; j++) {\n      if (height[i] <= height[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  int n, num, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &height[i]);\n  cha(n);\n  num = -1;\n  for (i = 1; i <= n; i++) {\n    if (num < max_1[i])\n      num = max_1[i];\n  }\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, n, i, j;\n  int max;\n  int d[30];\n  int h[30];\n  d[0] = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n  h[0] = 2147483647;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j] && (d[j] + 1) > max)\n        max = d[j] + 1;\n    }\n    d[i] = max;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (d[i] > max)\n      max = d[i];\n  cout << max << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18553", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint xxx(int high, int j);\nint max(int b, int c) {\n  if (b >= c)\n    return b;\n  else\n    return c;\n}\nint n;\nint x[26];\nint main() {\n  int i;\n  int m, k;\n  cin >> n;\n  int h[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &h[i]);\n    x[i] = h[i];\n  }\n  for (i = n; i < 26; i++)\n    x[i] = 999999;\n  int fly;\n  fly = xxx(999999, 0);\n  printf(\"%d\", fly);\n}\nint xxx(int high, int j) {\n  if (j == n - 1) {\n    if (high >= x[j])\n      return 1;\n    else\n      return 0;\n  } else {\n    if (high < x[j])\n      return xxx(high, j + 1);\n    else\n      return max(1 + xxx(x[j], j + 1), xxx(high, j + 1));\n  }\n}\n"}
{"label": "10", "index": "18554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 55;\nint a[maxn], dp[maxn][maxn];\n\nint main() {\n  int n, i, j, ans;\n  while (scanf(\"%d\", &n) != EOF) {\n    for (i = 1; i <= n; i++)\n      scanf(\"%d\", a + i);\n    memset(dp, -1, sizeof(dp));\n    for (i = 1; i <= n; i++)\n      dp[i][i] = 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j <= i; j++) {\n        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);\n        if (a[i + 1] <= a[j])\n          dp[i + 1][i + 1] = max(dp[i + 1][i + 1], dp[i][j] + 1);\n      }\n    }\n    ans = 0;\n    for (i = n, j = 1; j <= i; j++)\n      ans = max(ans, dp[i][j]);\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, t = 0, max = 0;\n  int m[25];\n  int n[25];\n  scanf(\"%d \", &k);\n\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n\n  for (i = 0; i < k; i++)\n    n[i] = 0;\n  n[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (m[i] >= m[j]) {\n        if (n[i] <= n[j]) {\n          n[i] = n[j] + 1;\n        }\n        t++;\n      }\n    }\n    if (t == 0)\n      n[i] = 1;\n    t = 0;\n  }\n  for (i = 0; i < k; i++) {\n    if (n[i] > max)\n      max = n[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, d[1000] = {0};\n  int k, i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = k - 1; j > i; j--) {\n      if (a[j] <= a[i]) {\n        if (d[j] > max)\n          max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n\n  max = d[0];\n  for (i = 1; i < k; i++) {\n    if (d[i] > max) {\n      max = d[i];\n    }\n  }\n  cout << max << \" \";\n  return 0;\n}\n"}
{"label": "10", "index": "18557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, height[25];\nint route(int m) {\n  int i, a = 0, max = 0;\n  for (i = m + 1; i < k; i++)\n    if (height[i] <= height[m])\n      a += 1;\n  if (a == 0)\n    return 1;\n  else {\n    for (i = m + 1; i < k; i++)\n      if (height[i] <= height[m] && route(i) > max)\n        max = route(i);\n    return (max + 1);\n  }\n}\nint main() {\n  int i, ans[25], a = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> height[i];\n  for (i = 0; i < k; i++)\n    ans[i] = route(i);\n  for (i = 0; i < k; i++)\n    if (ans[i] > a)\n      a = ans[i];\n  printf(\"%d\\n\", a);\n}\n"}
{"label": "10", "index": "18558", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int h[50];\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  int num[50], max;\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && num[j] > max)\n        max = num[j];\n    }\n    num[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, s, k, d;\n  int a[26], b[26]; \n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) \n  {\n    scanf(\"%d\", &a[i]);\n    b[i] = 0;\n  }\n  b[n] = 1;\n  for (i = n - 1; i >= 1; i--) \n  {\n    for (j = i + 1; j <= n; j++)\n      if ((a[j] <= a[i]) && (b[j] > b[i]))\n        b[i] = b[j];\n    b[i] = b[i] + 1;\n  }\n  s = 0;\n  for (i = 1; i <= n; i++) \n  {\n    if (s < b[i])\n      s = b[i];\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "10", "index": "18560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sort(int a[], int k);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[25];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  int d[25];\n  for (i = n - 1; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (d[i] > max)\n      max = d[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k], f[k], s = 0;\n  for (int i = 0; i < k; i++)\n    f[i] = 1;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n  for (int i = k - 2; i >= 0; i--) {\n    for (int j = k - 1; j > i; j--)\n      if (a[i] >= a[j] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n    if (s < f[i])\n      s = f[i];\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "10", "index": "18562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, max, n;\n  scanf(\"%d\", &n);\n  int h[25], m[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &h[i]);\n  m[n - 1] = 1;\n  max = m[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    m[i] = 1;\n    for (k = i + 1; k <= n - 1; k++)\n      if ((h[i] >= h[k]) && (m[i] < 1 + m[k]))\n        m[i] = m[k] + 1;\n    if (m[i] > max)\n      max = m[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, m[25][2], max = 0;\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i][0]);\n  void deal(int, int x[][2]);\n  deal(k, m);\n  for (i = 0; i < k; i++)\n    if (m[i][1] > max)\n      max = m[i][1];\n  printf(\"%d\", max);\n  return 0;\n}\nvoid deal(int k, int m[][2]) {\n  int i, j, max;\n  for (i = 0; i < k; i++) {\n    max = 0;\n    for (j = 0; j < i; j++)\n      if (m[j][0] >= m[i][0] && m[j][1] > max)\n        max = m[j][1];\n    m[i][1] = max + 1;\n  }\n}\n"}
{"label": "10", "index": "18564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int sum[25], int x[25], int i, int j, int k) {\n  int t, l = 1;\n  static int y[25];\n  t = i + 1;\n  for (; t <= k - 1; t++)\n    if (t != j && x[i] >= x[t]) {\n      y[l] = sum[t];\n      l++;\n    }\n  for (i = 1; i < l; i++)\n    if (sum[j] < y[i])\n      break;\n  if (i == l)\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int k, i, j;\n  static int x[25], sum[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> x[i];\n  sum[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (x[i] >= x[j] && max(sum, x, i, j, k))\n        sum[i] = sum[j];\n    sum[i]++;\n  }\n  int m = sum[0];\n  for (i = 1; i < k; i++)\n    if (sum[i] > m)\n      m = sum[i];\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[30], i, b[30], j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n\n    {\n      if (a[j] >= a[i]) {\n        if (b[j] >= b[i])\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    if (b[j] > b[j + 1])\n      b[j + 1] = b[j];\n  }\n  printf(\"%d\\n\", b[n - 1]);\n}\n"}
{"label": "10", "index": "18566", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], max;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    max = (max > b[i]) ? max : b[i];\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18567", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, d;\n  scanf(\"%d \", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  q[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    q[i] = 1;\n    d = 0;\n    for (j = i + 1; j < n; j++) {\n      if (p[i] >= p[j])\n        if (d < q[j])\n          d = q[j];\n    }\n    q[i] = q[i] + d;\n  }\n  for (i = 0; i < n; i++)\n    if (d < q[i])\n      d = q[i];\n  printf(\"%d \", d);\n  return 0;\n}\n"}
{"label": "10", "index": "18568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int num;\n  scanf(\"%d\", &num);\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  int max = flag[0];\n  for (int i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18569", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k[26][2];\nint main() {\n  int i, j, n, m = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> k[i][1];\n    k[i][0] = 1;\n    for (j = 0; j < i; j++) {\n      if (k[j][1] >= k[i][1] && k[j][0] + 1 > k[i][0])\n        k[i][0] = k[j][0] + 1;\n    }\n    if (k[i][0] > m)\n      m = k[i][0];\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, t;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  int *a = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  for (i = 0; i < n; i++) {\n    q[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < n; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < i; j++) {\n      if (p[j] >= p[i]) {\n        a[j] = q[j];\n      }\n      for (k = 0; k < i; k++) {\n        if (a[k] > t) {\n          t = a[k];\n        }\n      }\n    }\n    q[i] = q[i] + t;\n  }\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (q[i] > t) {\n      t = q[i];\n    }\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18571", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 25 + 10;\nint h[N];\nint dp[N];\n\nint main(void) {\n  int ans, cnt, i, j;\n  while (scanf(\"%d\", &cnt) != EOF) {\n    for (i = 0; i < cnt; ++i) {\n      scanf(\"%d\", h + i);\n    }\n    dp[0] = 1;\n    for (i = 1; i < cnt; ++i) {\n      dp[i] = 1;\n      for (j = 0; j < i; ++j) {\n        if (h[i] <= h[j]) {\n          dp[i] = max(dp[i], dp[j] + 1);\n        }\n      }\n    }\n    ans = 0;\n    for (i = 0; i < cnt; ++i)\n      ans = max(ans, dp[i]);\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "18572", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char g;\n  int c, d, f, a[25], b[25], k, e[25];\n  e[0] = 1;\n  scanf(\"%d\", &k);\n  for (c = 0;; c++) {\n    cin >> a[c] >> g;\n    if (g != ' ')\n      break;\n    else\n      ;\n  }\n  for (c = 0; c <= k - 1; c++) {\n    b[c] = a[k - 1 - c];\n  }\n\n  for (c = 1; c <= k - 1; c++) {\n    for (d = 0, e[c] = 0; d <= c - 1; d++) {\n      if (b[c] >= b[d] && e[c] <= e[d])\n        e[c] = e[d];\n      else\n        ;\n    }\n    e[c]++;\n  }\n\n  for (c = 0, f = e[0]; c <= k - 1; c++) {\n    if (f <= e[c])\n      f = e[c];\n    else\n      ;\n  }\n  printf(\"%d\", f);\n}\n"}
{"label": "10", "index": "18573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lj(int a[], int n, int m);\n  int n, m, i, j, l, k = 0, s, t = 0, a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    b[i] = lj(a, i, k);\n  for (i = 0; i < k; i++) {\n    if (t < b[i])\n      t = b[i];\n  }\n  printf(\"%d\", t);\n  getchar();\n  getchar();\n  getchar();\n}\nint lj(int a[], int n, int m) {\n  int i, t, p, l = 0, b[25];\n  if (n == m - 1)\n    return 1;\n  else {\n    for (i = 0; i < 25; i++)\n      b[i] = 0;\n    for (i = n + 1; i < m; i++) {\n      if (a[i] <= a[n])\n        b[i] = lj(a, i, m);\n    }\n    t = b[n + 1];\n    for (i = n + 1; i < m; i++) {\n      if (t < b[i])\n        t = b[i];\n    }\n    return t + 1;\n  }\n}\n"}
{"label": "10", "index": "18574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint set_1(int i);\nint num = 0;\nint currH = 100000;\nint MaxNum = 0;\nint a[100];\nint b[100];\nint main() {\n  int i;\n  for (i = 0; i < 100; i++) {\n    b[i] = 0;\n  }\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int j;\n    cin >> j;\n    a[i] = j;\n  }\n  set_1(0);\n  cout << MaxNum;\n  return 0;\n}\n\nint set_1(int i) {\n  int lastNum = num;\n  int lastcurrH = currH;\n  if (i == k - 1) {\n    if (a[i] <= currH)\n      num++;\n    if (num > MaxNum)\n      MaxNum = num;\n    num = lastNum;\n    currH = lastcurrH;\n    return 0;\n  }\n  if (b[i] == 0)\n    set_1(i + 1);\n  b[i]++;\n\n  if (b[i] == 1) {\n    if (a[i] <= currH) {\n      currH = a[i];\n      num++;\n    }\n    set_1(i + 1);\n  }\n\n  num = lastNum;\n  currH = lastcurrH;\n  b[i] = 0;\n  return 0;\n}\n"}
{"label": "10", "index": "18575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint l, n;\nint a[30];\nvoid measure(int k, int s, int m) {\n  int i;\n  if (k == n) {\n    if (s > l)\n      l = s;\n  } else {\n    for (i = k + 1; i <= n; i++)\n      if (a[i - 1] <= m)\n        measure(i, s + 1, a[i - 1]);\n    measure(n, s, m);\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  measure(0, 0, 10000);\n  printf(\"%d\\n\", l);\n}\n"}
{"label": "10", "index": "18576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], b[25], i, j, k, c, n;\n  cin >> n;\n  for (i = 0; i < 25; i++) {\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (b[i] < b[j] + 1)\n          b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    c = 0;\n    for (k = 0; k < i; k++) {\n      if (b[k] > b[j])\n        c = 1;\n    }\n    if (c == 0) {\n      cout << b[j] << \" \";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct dian {\n  int h;\n  int x;\n};\nint Compare(const void *elem1, const void *elem2) {\n  struct dian *p1, *p2;\n  p1 = (struct dian *)elem1;\n  p2 = (struct dian *)elem2;\n  return (*p2).h - (*p1).h;\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  struct dian *d = (struct dian *)malloc(sizeof(struct dian) * (n));\n  int *a = (int *)malloc(sizeof(int) * (n));\n  for (i = 0; i < n; i++)\n    a[i] = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d[i].h);\n    d[i].x = i;\n  }\n  qsort(d, n, sizeof(struct dian), Compare);\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].h == d[j].h && d[i].x > d[j].x) {\n        struct dian c;\n        c.x = d[i].x;\n        d[i].x = d[j].x;\n        d[j].x = c.x;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i].x < d[j].x) {\n        if (a[i] < a[j] + 1)\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  int max = a[0];\n  for (k = 0; k < n; k++) {\n    if (a[k] > max)\n      max = a[k];\n  }\n  printf(\"%d\", max);\n  free(d);\n  free(a);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, g, h, p, q = 0, a[25], b[25], c[25];\n  for (i = 0; i < 25; i++)\n    b[i] = 1;\n  i = 0;\n  scanf(\"%d\\n\", &k);\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[0]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  if (k == 1 || k == 0)\n    printf(\"%d\", k);\n  else {\n    for (j = k - 2; j >= 0; j--) {\n      for (p = j + 1; p < k; p++) {\n        if (a[j] >= a[p]) {\n          c[q] = b[p];\n          q++;\n        }\n      }\n      if (q == 0)\n        b[j] = 1;\n      else if (q == 1)\n        b[j] = c[0] + b[j];\n      else {\n        for (g = 0; g < q - 1; g++) {\n          m = c[g];\n          n = c[g + 1];\n          if (m > n) {\n            c[g] = n;\n            c[g + 1] = m;\n          }\n        }\n        b[j] = c[q - 1] + b[j];\n        q = 0;\n        g = 0;\n        p = j;\n      }\n    }\n    for (h = 0; h < k - 1; h++) {\n      m = b[h];\n      n = b[h + 1];\n      if (m > n) {\n        b[h] = n;\n        b[h + 1] = m;\n      }\n    }\n    cout << b[k - 1];\n  }\n}\n"}
{"label": "10", "index": "18579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint kMis;\nint Mis[30];\nint Array[30];\nvoid Lanjie(int iM) {\n  for (int i = iM; i < kMis; i++) {\n    if (Mis[iM - 1] >= Mis[i] && Array[iM - 1] <= Array[i])\n      Array[iM - 1] = Array[i] + 1;\n  }\n  if (iM > 1)\n    Lanjie(iM - 1);\n  return;\n}\nint main() {\n\n  scanf(\"%d \", &kMis);\n  for (int i = 0; i < kMis; i++)\n    cin >> Mis[i];\n  for (int i = 0; i < kMis; i++) {\n    Array[i] = 1;\n  }\n  Lanjie(kMis);\n  int MaxLen = -1;\n  for (int i = 0; i < kMis; i++)\n    if (MaxLen < Array[i])\n      MaxLen = Array[i];\n  cout << MaxLen << endl;\n}\n"}
{"label": "10", "index": "18580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint lanjie(int x, int p);\nint max(int a, int b);\nint n, t = 0, h[25], r[25][10000];\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d\", lanjie(0, 10000));\n  return 0;\n}\nint lanjie(int x, int p) {\n  if (r[x][p])\n    return r[x][p];\n  else if (x == n - 1) {\n    if (h[x] <= p)\n      return r[x][p] = 1;\n    else\n      return r[x][p] = 0;\n  } else {\n    int f;\n    if (h[x] <= p) {\n      f = max(1 + lanjie(x + 1, h[x]), lanjie(x + 1, p));\n    } else\n      f = lanjie(x + 1, p);\n    return r[x][p] = f;\n  }\n}\nint max(int a, int b) { return (a > b) ? a : b; }\n"}
{"label": "10", "index": "18581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int h[25];\n  cin >> n;\n  int i = 0;\n  for (i = n - 1; i >= 0; i--) {\n    cin >> h[i];\n  }\n  int d[25];\n  d[0] = 1;\n  int j = 0;\n  int max = 0;\n  for (i = 1; i < n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (max < d[j] && h[i] >= h[j]) {\n        max = d[j];\n      }\n    }\n    d[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18582", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint compare(int x, int y) {\n  if (x <= y) {\n    x = (y + 1);\n  }\n  return x;\n}\n\nint main(void) {\n\n  int i, n, r, a, j;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i != n; i++)\n    cin >> p[i];\n\n  int *q = (int *)malloc(n * sizeof(int));\n  for (j = 0; j != n; j++) {\n    q[j] = 1;\n    for (r = 0; r != j; r++) {\n      if (p[j] <= p[r]) {\n        q[j] = compare(q[j], q[r]);\n      }\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 0; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18583", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000], f[1000] = {0}, n, longest_index = -1, longest_f = -1;\n\nint main() {\n  int i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i)\n    scanf(\"%d\", &a[i]);\n\n  {\n    int i, j;\n    for (i = 0; i < n; ++i)\n      f[i] = 1;\n    for (i = n - 2; i >= 0; --i) {\n      for (j = i + 1; j < n; ++j) {\n        if ((f[i] < f[j] + 1) && (a[i] >= a[j])) {\n          f[i] = f[j] + 1;\n          if (longest_f < f[i]) {\n            longest_f = f[i];\n            longest_index = i;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d \", longest_f);\n}\n"}
{"label": "10", "index": "18584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint com(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int n, i;\n  int a[30];\n  int s[30];\n  for (int i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (int i = n - 2; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        s[i] = max(s[j] + 1, s[i]);\n      }\n    }\n  }\n  qsort(s, 30, sizeof(int), com);\n  printf(\"%d\", s[29]);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], d[25];\n  int max;\n  int i, j, k;\n\n  scanf(\"%d\", &k);\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j] && max < d[j]) {\n        max = d[j];\n      }\n    }\n    if (max == 0) {\n      d[i] = 1;\n    } else {\n      d[i] = max + 1;\n    }\n  }\n\n  for (i = 0, max = 0; i < k; i++) {\n    if (max < d[i])\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18586", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid make(int a[], int n);\n\nint main() {\n  int n = 0;\n  int hight[26];\n  int i = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> hight[i];\n\n  make(hight, n);\n\n  return 0;\n}\n\nvoid make(int hight[], int n) {\n  int i = 0;\n  int j = 0;\n  int a[26];\n  int max = 0;\n  a[1] = 1;\n  for (i = 2; i <= n; i++) {\n    a[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((hight[j] >= hight[i]) && (a[j] + 1 > a[i]))\n        a[i] = a[j] + 1;\n  }\n  for (i = 1; i <= n; i++)\n    max = (max > a[i] ? max : a[i]);\n  cout << max;\n}\n"}
{"label": "10", "index": "18587", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, a[100];\n  int n, i, j, max = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    if (i == n - 1)\n      sum[i] = 1;\n    else {\n      for (j = i + 1; j <= n - 1; j++)\n        if (a[j] <= a[i]) {\n          if (sum[j] > max)\n            max = sum[j];\n        }\n      sum[i] = ++max;\n      max = 0;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= n - 1; i++)\n    if (sum[i] > max)\n      max = sum[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num(int m[], int i, int k);\nint main() {\n  int k, i, t, ans = 0;\n  int m[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i <= k; i++) {\n    t = num(m, i, k);\n    if (t > ans)\n      ans = t;\n  }\n  printf(\"%d\", ans);\n  return 0;\n}\nint num(int m[], int i, int k) {\n  int re = 0, j, t;\n  if (i == k)\n    return (0);\n  for (j = i + 1; j <= k; j++)\n    if (m[j] <= m[i]) {\n      t = num(m, j, k);\n      if (t > re)\n        re = t;\n    }\n  re++;\n  return (re);\n}\n"}
{"label": "10", "index": "18589", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  int h[k], n[k];\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  for (i = k - 1; i >= 0; i--) {\n    int max = 0;\n    for (j = i + 1; j < k; j++)\n      if (h[j] <= h[i] && n[j] > max)\n        max = n[j];\n    n[i] = max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < k; i++)\n    if (n[i] > Max)\n      Max = n[i];\n  printf(\"%d \", Max);\n}\n"}
{"label": "10", "index": "18590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 0;\n    for (j = 0; j < i; j++) {\n      if ((a[j] >= a[i]) && (b[j] > b[i])) {\n        b[i] = b[j];\n      }\n    }\n    b[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > b[0]) {\n      b[0] = b[i];\n    }\n  }\n  printf(\"%d\", b[0]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[30], dp[30] = {1};\nint n;\nint ans = -1;\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    dp[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i] && dp[j] + 1 > dp[i]) {\n        dp[i] = dp[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (dp[i] > ans) {\n      ans = dp[i];\n    }\n  }\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, h[26], amount[26], s = 0;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    amount[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[i] >= h[j]) && (amount[i] < amount[j] + 1))\n        amount[i] = amount[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (amount[i] > s)\n      s = amount[i];\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h[40];\n  int num[40];\n  int n;\n  cin >> n;\n  for (int i = 0; i != n; ++i)\n    cin >> h[i];\n  memset(num, 0, sizeof(num));\n  num[0] = 1;\n  for (int i = 1; i < n; ++i) {\n    int maxi = 1;\n    for (int j = i - 1; j >= 0; --j) {\n      if (maxi < num[j] + 1 && h[j] >= h[i])\n        maxi = num[j] + 1;\n    }\n    num[i] = maxi;\n  }\n  int temp = 0;\n  for (int i = 0; i != n; ++i) {\n    if (num[i] > temp)\n      temp = num[i];\n  }\n  cout << temp << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, t, d[25], h[25]; \n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = 0; i < k; i++) \n  {\n    t = 0;\n    for (j = 0; j < i; j++) \n    {\n      if (h[j] >= h[i]) \n      {\n        if (d[j] > t)\n          t = d[j];\n      }\n    }\n    d[i] = t + 1; \n  }\n  for (i = 0; i < k; i++) {\n    if (d[i] > t)\n      t = d[i]; \n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, j, k, n, m, a[100], f[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  f[n] = 1;\n  max = 1;\n  for (i = n - 1; i >= 1; i--) {\n    k = 0;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] <= a[i])\n        k = (f[j] > k) ? f[j] : k;\n    }\n    k++;\n    f[i] = k;\n    max = (max > f[i]) ? max : f[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int *p, *num;\n  int n, add;\n\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", p + i);\n    *(num + i) = 1;\n  }\n\n  for (int i = n - 2; i >= 0; i--) {\n    add = 0;\n    for (int k = i + 1; k <= n - 1; k++) {\n      if (*(p + i) >= *(p + k) && *(num + k) > add)\n        add = *(num + k);\n    }\n    *(num + i) += add;\n  }\n  int maxnum = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    if (*(num + i) > maxnum) {\n      maxnum = *(num + i);\n    }\n  }\n  cout << maxnum;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0;\n  int a[25] = {0}, b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    cin >> a[i];\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (a[i] >= a[j] && b[i] <= b[j])\n        b[i] = b[j] + 1;\n    if (b[i] == 0)\n      b[i] = 1;\n  }\n  for (i = 0; i <= k - 2; i++)\n    for (j = 0; j <= k - 2 - i; j++)\n      if (b[j] > b[j + 1]) {\n        l = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = l;\n      }\n  cout << b[k - 1] << \"\\n\";\n}\n"}
{"label": "10", "index": "18598", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint a[1000];\nint f[1000];\n\nvoid input() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n}\n\nint main() {\n  input();\n  for (int i = 0; i < n; i++)\n    f[i] = 1;\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n  }\n  int ans = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > ans)\n      ans = f[i];\n  cout << ans << endl;\n}\n"}
{"label": "10", "index": "18599", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint h[25], n;\nint hack(int i, int w) {\n  if (i == n - 1) {\n    if (h[i] <= w)\n      return 1;\n    else\n      return 0;\n  }\n  int b = hack(i + 1, w), c = 0;\n  if (h[i] <= w)\n    c = 1 + hack(i + 1, h[i]);\n  if (b > c)\n    return b;\n  else\n    return c;\n}\nint main() {\n  scanf(\"%d\", &n);\n  int i, max = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &h[i]);\n    if (h[i] > max)\n      max = h[i];\n  }\n  printf(\"%d\", hack(0, max));\n  return 0;\n}\n"}
{"label": "10", "index": "18600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[99];\nint main() {\n  int f(int, int, int);\n  int i, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  max = f(99999, 0, 0);\n  printf(\"%d\\n\", max);\n}\nint f(int hi, int num, int i) {\n  int t1, t2;\n  while (a[i] > hi)\n    i++;\n  if (i >= n)\n    return num;\n  t1 = f(hi, num, i + 1);\n  t2 = f(a[i], num + 1, i + 1);\n  return t1 > t2 ? t1 : t2;\n}\n"}
{"label": "10", "index": "18601", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int i, j;\n  int s[30], t[30];\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> s[i];\n    t[i] = 0;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (s[i] >= s[j] && t[i] < t[j])\n        t[i] = t[j];\n    }\n    t[i]++;\n  }\n  for (i = 0; i < k; i++) {\n    if (t[0] < t[i])\n      t[0] = t[i];\n  }\n  printf(\"%d\", t[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "18602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], b[26], i, j, n, max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 2; i <= n; i++)\n    for (j = 1; j < i; j++)\n      if (a[i - j] >= a[i] && b[i - j] > (b[i] - 1))\n        b[i] = b[i - j] + 1;\n  for (i = 1; i <= n; i++)\n    if (b[i] > max)\n      max = b[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18603", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nconst int N = 30;\n\nint a[N];\nint len[N];\n\nint main() {\n  int k;\n  int i, j;\n  int max;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  len[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] > a[i] && max < len[j]) {\n        max = len[j];\n      }\n    }\n    len[i] = max + 1;\n  }\n  max = -1;\n  for (i = 0; i < k; i++) {\n    if (max < len[i]) {\n      max = len[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max, f[26], g[26];\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &g[i]);\n    f[i] = 0;\n  }\n  f[n] = 1;\n  for (i = n - 1; i >= 1; i--) {\n    max = 0;\n    for (j = i + 1; j <= n; j++)\n      if ((g[j] <= g[i]) && (f[j] > max))\n        max = f[j];\n    f[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (f[i] > max)\n      max = f[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, e, f, g;\n  scanf(\"%d\", &b);\n  int a[b], d[b];\n  for (c = 0; c < b; c++)\n    scanf(\"%d\", &a[c]);\n  d[b - 1] = 1;\n  for (c = b - 2; c >= 0; c--) {\n    d[c] = 1;\n    f = 0;\n    for (e = b - 1; e > c; e--) {\n      if (a[c] >= a[e]) {\n        if (d[e] > f)\n          f = d[e];\n      }\n    }\n    d[c] += f;\n  }\n  g = d[0];\n  for (c = 0; c < b; c++) {\n    if (d[c] > g)\n      g = d[c];\n  }\n  printf(\"%d\", g);\n}\n"}
{"label": "10", "index": "18606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[26];\nint n;\nint sum(int k, int b) {\n  int x;\n  if (k == 0)\n    x = 0;\n  else if (k != 0) {\n    if ((a[n - k] <= b)) {\n      if ((sum(k - 1, a[n - k]) + 1) >= sum(k - 1, b)) {\n        b = a[n - k];\n        x = 1 + sum(k - 1, b);\n      } else\n        x = sum(k - 1, b);\n\n    } else if ((a[n - k] > b))\n      x = sum(k - 1, b);\n  }\n  return x;\n}\nint main() {\n  int i;\n  int c = 9999;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i - 1];\n  }\n  cout << sum(n, c);\n}\n"}
{"label": "10", "index": "18607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint D(int *h, int i, int n) {\n  int j, z = 1, x;\n  if (i < n) {\n    for (j = i + 1; j < n + 1; j++) {\n      if (h[j - 1] <= h[i - 1]) {\n        x = D(h, j, n) + 1;\n        if (z < x)\n          z = x;\n      }\n    }\n  }\n  return z;\n}\nint main() {\n  int i, n, z = 1, h[25], x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", h + i);\n  for (i = 0; i < n; i++) {\n    x = D(h, i + 1, n);\n    if (z < x)\n      z = x;\n  }\n  printf(\"%d\", z);\n  return 0;\n}\n"}
{"label": "10", "index": "18608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint height[26];\nint len(int num) {\n  int temp, max, i;\n  if (num == k) {\n    return (1);\n  } else {\n    max = 0;\n    for (i = num + 1; i <= k; i++) {\n      if (height[num] >= height[i]) {\n        temp = len(i);\n        if (max < temp) {\n          max = temp;\n        }\n      }\n    }\n  }\n  return (max + 1);\n}\nint main() {\n  height[0] = 30001;\n  scanf(\"%d\", &k);\n  int i;\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  printf(\"%d\", len(0) - 1);\n  scanf(\"%d\", &k);\n  return 0;\n}\n"}
{"label": "10", "index": "18609", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, j, k, a[25], i, c, b[25], t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (j = n - 2; j >= 0; j--) {\n    t = 0;\n    for (k = j + 1; k < n; k++) {\n      if (a[k] <= a[j] && b[k] > t) {\n        t = b[k];\n      }\n    }\n    b[j] = b[j] + t;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] > c) {\n      c = b[i];\n    }\n  }\n\n  printf(\"%d\", c);\n}\n"}
{"label": "10", "index": "18610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[36], f[36];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else {\n    return b;\n  }\n}\nint main() {\n  int k, i, j;\n  int ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &a[i]);\n  f[0] = 0;\n  for (i = 1; i <= k; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n    ans = max(ans, f[i]);\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j;\nint main() {\n  int b[26] = {0};\n  int k;\n  int f(int x, int y, int a[26]);\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &b[i]);\n  printf(\"%d\\n\", f(k, k, b) - 1);\n}\nint f(int x, int y, int a[26]) {\n  if (y == 0)\n    return (1);\n  int s = 0;\n  if (y >= 1) {\n    for (i = 0; i < y; i++) {\n      if (a[i] >= a[y] && f(x, i, a) >= s)\n        s = f(x, i, a);\n    }\n  }\n  if (i == y)\n    return (s + 1);\n}\n"}
{"label": "10", "index": "18612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint com(void const *a, void const *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int k, H;\n  int j, count[25], n;\n  scanf(\"%d\", &k);\n  int h[25], i;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  count[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    n = 0;\n    for (j = k - 1; j >= i + 1; j--) {\n      if (h[j] <= h[i]) {\n        if (count[j] >= n) {\n          n = count[j];\n        }\n      }\n    }\n    count[i] = n + 1;\n  }\n  qsort(count, k, sizeof(int), com);\n  printf(\"%d\", count[k - 1]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[99];\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  scanf(\"%d\", &a[n]);\n  if (n == 8)\n    printf(\"6\\n\");\n  else if (n == 25 && a[9] == 3348)\n    printf(\"9\\n\");\n  else if (n == 25 && a[9] == 4348)\n    printf(\"8\\n\");\n  else if (n == 3)\n    printf(\"2\\n\");\n  else if (n == 10)\n    printf(\"6\\n\");\n  else\n    printf(\"rror\\n\");\n}\n"}
{"label": "10", "index": "18614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100], max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (i = 0; i < 100; i++) {\n    m[i] = 1;\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[j] + 1 >= m[i])) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = k - 1; p >= 0; p--) {\n    if (m[p] >= max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int q[100] = {\n      0,\n  };\n  int j, k;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i, k = i; j < n; j++) {\n      if (a[j] <= a[i] && q[k] <= q[j])\n        k = j;\n    }\n    if (k != i)\n      q[i] = q[k] + 1;\n  }\n  for (i = 0, k = 0; i < n; i++) {\n    if (q[k] < q[i])\n      k = i;\n  }\n  printf(\"%d\", q[k] + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[26];\nint main() {\n  int d(int xz, int p, int q);\n  int y, i, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  y = d(10000, 1, n);\n  printf(\"%d\", y);\n}\nint d(int xz, int p, int q) {\n  int g, h;\n  if (p == q && a[p] <= xz)\n    return 1;\n  else if (p == q && a[p] > xz)\n    return 0;\n  else {\n    if (xz < a[p])\n      return (d(xz, p + 1, q));\n    else {\n      g = 1 + d(a[p], p + 1, q);\n      h = d(xz, p + 1, q);\n      if (g > h)\n        return (g);\n      else\n        return (h);\n    }\n  }\n}\n"}
{"label": "10", "index": "18617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int b[25]) {\n  int i, t = b[0];\n  for (i = 0; i < 25; i++) {\n    if (b[i] > t)\n      t = b[i];\n  }\n  return t;\n}\nint destroy(int a[25], int t) {\n  int b[25] = {1};\n  int i, j;\n  for (j = t - 1; j >= 0; j--) {\n    for (i = j + 1; i <= t; i++) {\n      if (a[j] >= a[i] && (b[i] + 1) > b[j])\n        b[j] = b[i] + 1;\n    }\n  }\n  return max(b) + 1;\n}\nint main() {\n  int x, i = 0;\n  int a[25] = {0};\n  cin >> x;\n  for (i = 0; i <= x - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", destroy(a, x - 1));\n}\n"}
{"label": "10", "index": "18618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[26], f[26];\n  for (int i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  f[0] = 1;\n  if (a[1] <= a[0])\n    f[1] = 2;\n  else\n    f[1] = 1;\n  for (int i = 2; i <= n - 1; i++) {\n    int c[26];\n    for (int q = 0; q <= i - 1; q++) {\n      if (a[q] >= a[i])\n        c[q] = f[q];\n      else\n        c[q] = 0;\n    }\n    int maxc = c[0];\n    for (int j = 1; j <= i - 1; j++) {\n      if (maxc < c[j])\n        maxc = c[j];\n    }\n    f[i] = maxc + 1;\n  }\n  int max = f[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (f[m] > max)\n      max = f[m];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max > k[i + 1])\n      q = f(k[i + 1], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  printf(\"%d\", f(2147483647, 0, 0));\n  return 0;\n}\n"}
{"label": "10", "index": "18620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int k, int n, int z);\nint main() {\n  int k, a[25], i, t;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t = max(a, k, 0, 999999);\n  cout << t << \"\\n\";\n  return 0;\n}\nint max(int a[], int k, int n, int z) {\n  int b = 0, c, m = a[n], t;\n  if (n == k - 1)\n    if (a[n] <= z) {\n      t = 1;\n    } else\n      t = 0;\n  else {\n    if (a[n] <= z) {\n      c = max(a, k, n + 1, z);\n      z = a[n];\n      b = 1 + max(a, k, n + 1, z);\n      if (b > c)\n        t = b;\n      else\n        t = c;\n    } else\n      t = max(a, k, n + 1, z);\n  }\n  return (t);\n}\n"}
{"label": "10", "index": "18621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, e, f, g;\n  cin >> b;\n  int a[b], d[b];\n  for (c = 0; c < b; c++) {\n    scanf(\"%d\", &a[c]);\n  }\n  d[b - 1] = 1;\n  for (c = b - 2; c >= 0; c--) {\n    d[c] = 1;\n    f = 0;\n    for (e = b - 1; e > c; e--) {\n      if (a[c] >= a[e]) {\n        if (d[e] > f)\n          f = d[e];\n      }\n    }\n    d[c] += f;\n  }\n  g = d[0];\n  for (c = 0; c < b; c++) {\n    if (d[c] > g)\n      g = d[c];\n  }\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "10", "index": "18622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, height[25], len[25], num[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    len[i] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i + 1; j <= n - 1; j++)\n      if (height[j] <= height[i]) {\n        num[m] = j;\n        m++;\n      }\n    for (k = 0; k <= m - 1; k++)\n      if (len[i] < len[num[k]])\n        len[i] = len[num[k]];\n    len[i]++;\n  }\n  m = 0;\n  for (i = 0; i < n; i++)\n    if (len[i] > m)\n      m = len[i];\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, ans;\nint f[1000];\nint a[1000];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n    ans = ans > f[i] ? ans : f[i];\n  }\n  printf(\"%d\\n\", ans);\n}\n"}
{"label": "10", "index": "18624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int sum[25], int x[25], int i, int j, int k) {\n  int t, l = 1;\n  static int y[25];\n  t = i + 1;\n  for (; t <= k - 1; t++)\n    if (t != j && x[i] >= x[t]) {\n      y[l] = sum[t];\n      l++;\n    }\n  for (i = 1; i < l; i++)\n    if (sum[j] < y[i])\n      break;\n  if (i == l)\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int k, i, j;\n  static int x[25], sum[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &x[i]);\n  sum[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (x[i] >= x[j] && max(sum, x, i, j, k))\n        sum[i] = sum[j];\n    sum[i]++;\n  }\n  int m = sum[0];\n  for (i = 1; i < k; i++)\n    if (sum[i] > m)\n      m = sum[i];\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18625", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int *h = (int *)malloc((N + 1) * sizeof(int));\n  for (int i = 1; i <= N; i++)\n    scanf(\"%d \", &h[i]);\n  int *f = (int *)malloc((N + 1) * sizeof(int));\n  f[1] = 1;\n  for (int i = 2; i <= N; i++) {\n    int tem = 0;\n    for (int j = 1; j < i; j++) {\n      if (h[j] >= h[i]) {\n        if (f[j] > tem)\n          tem = f[j];\n      }\n    }\n    f[i] = tem + 1;\n  }\n  int max = -1;\n  for (int i = 1; i <= N; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k;\n  scanf(\"%d\", &k);\n  int i, j, h[26], amount[26], s = 0;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    amount[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[i] >= h[j]) && (amount[i] < amount[j] + 1))\n        amount[i] = amount[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (amount[i] > s) {\n      s = amount[i];\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18627", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int b[25];\n  int max;\n  for (int i = 0; i < n; i++) {\n    b[i] = 1;\n    cin >> a[i];\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (i != j && a[i] >= a[j] && b[i] < 1 + b[j]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num;\n  cin >> num;\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    cin >> a[i];\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  int max = flag[0];\n  for (int i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0;\n  int a[25] = {0}, b[25] = {0};\n  cin >> k;\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (a[i] >= a[j] && b[i] <= b[j])\n        b[i] = b[j] + 1;\n    if (b[i] == 0)\n      b[i] = 1;\n  }\n  for (i = 0; i <= k - 2; i++)\n    for (j = 0; j <= k - 2 - i; j++)\n      if (b[j] > b[j + 1]) {\n        l = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = l;\n      }\n  cout << b[k - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18630", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int t1[], int t2[], int m, int n, int d) {\n  int i, y = 0;\n  for (i = m + 1; i < n; i++) {\n    if (t1[i] <= d && t2[i] > y)\n      y = t2[i];\n  }\n  return y;\n}\nint main() {\n  int a[10000], b[10000] = {0}, i, j, n, t, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--)\n    b[i] = max(a, b, i, n, a[i]) + 1;\n\n  for (i = 0; i < n - 1; i++) {\n    if (b[i] > x)\n      x = b[i];\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "18631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[25], len[25];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    len[i] = 1;\n  int lenmax = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (j = n - 1; j > i; j--) {\n      if ((a[j] <= a[i]) && (len[j] > max))\n        max = len[j];\n    }\n    len[i] = max + 1;\n    lenmax = lenmax > len[i] ? lenmax : len[i];\n  }\n  printf(\"%d \", lenmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18632", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, sum[25], a[25], b[25], k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  sum[k - 1] = 1;\n  for (i = k - 1; i >= 1; i--)\n\n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000], n, f[999][999];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint daodan(int s, int h) {\n  if (s == n)\n    return 0;\n  if (h >= a[s])\n    return max(daodan(s + 1, a[s]) + 1, daodan(s + 1, h));\n  else\n    return daodan(s + 1, h);\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", daodan(0, 31999));\n  return 0;\n}\n"}
{"label": "10", "index": "18634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxsize = 26;\nint maxnum(int *r, int n) {\n  int ans = 1;\n  int i, j, temp;\n  int maxlen[maxsize];\n  maxlen[0] = 1;\n  for (i = 1; i < n; i++) {\n    temp = 0;\n    for (j = 0; j < i; j++) {\n      if (r[j] >= r[i]) {\n        if (maxlen[j] > temp)\n          temp = maxlen[j];\n      }\n    }\n    maxlen[i] = temp + 1;\n    if (ans < maxlen[i])\n      ans = maxlen[i];\n  }\n  return ans;\n}\nint main() {\n  int i, k;\n  int r[maxsize];\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", r + i);\n  cout << maxnum(r, k) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, h[25], d[25], i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &h[i]);\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (d[j] + 1 > d[i] && h[j] <= h[i])\n        d[i] = d[j] + 1;\n    }\n  }\n  max = d[0];\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  int a[25], b[25];\n  m = 0;\n\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (j = 1; j < n; j++) {\n    for (i = 0; i < j; i++) {\n      if (a[j] >= a[i]) {\n        if ((b[i] + 1) >= b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b[i] >= m)\n      m = b[i];\n  }\n\n  cout << m;\n}\n"}
{"label": "10", "index": "18637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint height[26];\nint x;\nint cmp(int a, int b) { return (a > b ? a : b); }\nint max(int a, int b) {\n  int cmp(int a, int b);\n  if (b == x) {\n    if (a >= height[x])\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a < height[b])\n      return (max(a, b + 1));\n    else {\n      return (cmp(max(a, b + 1), (1 + max(height[b], b + 1))));\n    }\n  }\n}\n\nint main() {\n  int max(int, int);\n  int i;\n  scanf(\"%d\", &x);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  x--;\n  printf(\"%d\", max(1000000, 0));\n}\n"}
{"label": "10", "index": "18638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[100], max;\n  double a[100];\n  memset(c, 0, sizeof(c));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%lf\", &a[i]);\n  c[n - 1] = 1;\n  for (i = n - 1; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[j] <= a[i] && c[j] > max)\n        max = c[j];\n    c[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (c[i] > max)\n      max = c[i];\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[25], len[25];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    len[i] = 1;\n  int lenmax = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (j = n - 1; j > i; j--) {\n      if ((a[j] <= a[i]) && (len[j] > max))\n        max = len[j];\n    }\n    len[i] = max + 1;\n    lenmax = lenmax > len[i] ? lenmax : len[i];\n  }\n  printf(\"%d \", lenmax);\n  return 0;\n}\n"}
{"label": "10", "index": "18640", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint daodan[30];\nint res[30];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> daodan[i];\n    res[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (daodan[i] >= daodan[j])\n        res[i] = max(res[i], res[j] + 1);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (res[i] > res[0])\n      res[0] = res[i];\n  }\n  printf(\"%d\\n\", res[0]);\n  return 0;\n}\n"}
{"label": "10", "index": "18641", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, t, a[100] = {0}, f[100] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  t = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= i; j--)\n      if (a[i] >= a[j])\n        f[i] = (f[i] > f[j]) ? f[i] : f[j];\n    f[i]++;\n    t = (f[i] > t) ? f[i] : t;\n  }\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  int j = 0;\n  int max = 0;\n  int i, m;\n  scanf(\"%d\", &k);\n  int height[k], b[k];\n  while (j < k) {\n    scanf(\"%d\", &height[j]);\n    j++;\n  }\n  j = j - 1;\n  while (j >= 0) {\n    for (i = j + 1; i < k; i++) {\n      if (height[i] <= height[j] && b[i] > max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n    max = 0;\n    j--;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h[25], d[25], i, j, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> h[i];\n  d[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (d[j] + 1 > d[i] && h[j] <= h[i])\n        d[i] = d[j] + 1;\n    }\n  }\n  max = d[0];\n  for (i = 0; i < n; i++) {\n    if (d[i] > max)\n      max = d[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct DP {\n  int height;\n  int num;\n} dp[26];\n\nint main() {\n  int k, i, j;\n  int h[26];\n  int Max;\n  scanf(\"%d \", &k);\n  for (i = 1; i <= k; i++) {\n    cin >> h[i];\n  }\n  dp[0].height = INT_MAX;\n  dp[0].num = 0;\n  for (i = 1; i <= k; i++) {\n    dp[i].height = h[i];\n    Max = INT_MIN;\n    for (j = 0; j < i; j++) {\n      if (Max < dp[j].num && dp[j].height >= dp[i].height)\n        Max = dp[j].num;\n    }\n    dp[i].num = Max + 1;\n  }\n  Max = INT_MIN;\n  for (i = 0; i <= k; i++)\n    if (Max < dp[i].num)\n      Max = dp[i].num;\n  cout << Max << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  if (k == 1)\n    cout << \"1\\n\";\n  else if (k >= 2) {\n    int a[25], i, b[25], c[25], j, p = 0, m, n, t = 0;\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < k; i++)\n      scanf(\" %d\", &a[i]);\n    b[0] = 1;\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j <= k - 1; j++) {\n        if (a[i] >= a[j]) {\n          c[p] = b[k - 1 - j];\n          p++;\n        }\n        for (m = 0; m < p; m++) {\n          if (c[m] > t)\n            t = c[m];\n        }\n      }\n      b[k - 1 - i] = t + 1;\n      p = 0;\n      t = 0;\n      for (m = 0; m < p; m++)\n        c[m] = 0;\n    }\n    for (n = 0; n < k; n++) {\n      if (b[n] > t)\n        t = b[n];\n    }\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[25];\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int t[25];\n\n  int min_c, max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (j == n - 1)\n      t[j] = 1;\n\n    else {\n\n      max_t = 0;\n      for (k = j; k < n - 1; k++) {\n        if (a[j] >= a[k + 1] && max_t < t[k + 1])\n          max_t = t[k + 1];\n      }\n      t[j] = max_t + 1;\n    }\n  }\n  max_t = 1;\n  for (j = n - 1; j >= 0; j--) {\n    if (t[j] > max_t)\n      max_t = t[j];\n  }\n  printf(\"%d\\n\", max_t);\n}\n"}
{"label": "10", "index": "18647", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[26], f[26];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  f[0] = 1;\n  if (a[1] <= a[0])\n    f[1] = 2;\n  else\n    f[1] = 1;\n  for (int i = 2; i <= n - 1; i++) {\n    int c[26];\n    for (int q = 0; q <= i - 1; q++) {\n      if (a[q] >= a[i])\n        c[q] = f[q];\n      else\n        c[q] = 0;\n    }\n    int maxc = c[0];\n    for (int j = 1; j <= i - 1; j++) {\n      if (maxc < c[j])\n        maxc = c[j];\n    }\n    f[i] = maxc + 1;\n  }\n  int max = f[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (f[m] > max)\n      max = f[m];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(int a, int array[], int K) {\n  int i, max = 0, j;\n  if (a == K - 1)\n    return 1;\n  else {\n    for (j = K - 1; j > a; j--) {\n      if (array[j] <= array[a]) {\n        if (f(j, array, K) > max)\n          max = f(j, array, K);\n      }\n    }\n    return max + 1;\n  }\n}\nint main() {\n  int K, k, A[25], n, max = 1, i;\n  cin >> K;\n  for (k = 0; k <= K - 1; k++) {\n    cin >> A[k];\n  }\n  for (i = 0; i <= K - 1; i++) {\n    if (f(i, A, K) > max)\n      max = f(i, A, K);\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint h[30];\nint r[30];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n\n  r[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    if (r[i] >= r[i + 1]) {\n      cout << \"first way taken\\n\";\n      r[i] = r[i + 1] + 1;\n    } else {\n      int max = 0;\n      for (j = i + 1; j < k; j++) {\n        if (h[j] <= h[i] && r[j] > max)\n          max = r[j];\n      }\n      r[i] = max + 1;\n    }\n  }\n  int ans = 0;\n  for (i = 0; i < k; i++) {\n\n    if (r[i] > ans)\n      ans = r[i];\n  }\n  cout << ans;\n}\n"}
{"label": "10", "index": "18650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h[100], s[100] = {0}, n;\nint p(int i) {\n  int s1 = 0, s2, j;\n  if (s[i] == 0) {\n\n    for (j = i + 1; j < n; j++) {\n      s2 = s1;\n      if (h[i] < h[j])\n        s1 = 0;\n      else\n        s1 = p(j) + 1;\n      if (s1 < s2)\n        s1 = s2;\n    }\n    s[i] = s1;\n  } else\n    s1 = s[i];\n\n  return (s1);\n}\nint main() {\n  int i, s1 = 0, s2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < n; i++) {\n    s2 = s1;\n    s1 = p(i);\n    if (s1 < s2)\n      s1 = s2;\n  }\n  printf(\"%d\", s1 + 1);\n}\n"}
{"label": "10", "index": "18651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint H[100];\nint N;\n\nint memo[40][40];\n\nint dp(int i, int k) {\n  int rslt;\n  if (i == N)\n    return 0;\n  if (memo[i][k] != -1)\n    return memo[i][k];\n  if (k != 30 && H[i] > H[k])\n    rslt = dp(i + 1, k);\n  else {\n    int a = dp(i + 1, i) + 1;\n    int b = dp(i + 1, k);\n    if (a > b)\n      rslt = a;\n    else\n      rslt = b;\n  }\n  return memo[i][k] = rslt;\n}\n\nint main() {\n  scanf(\"%d\", &N);\n  for (int i = 0; i < 40; i++)\n    for (int j = 0; j < 40; j++)\n      memo[i][j] = -1;\n  for (int i = 0; i < N; i++)\n    scanf(\"%d\", &H[i]);\n\n  cout << dp(0, 30) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[36], f[36];\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint main() {\n  int k, i, j;\n  int ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    cin >> a[i];\n  f[0] = 0;\n  for (i = 1; i <= k; i++) {\n    f[i] = 1;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n    ans = max(ans, f[i]);\n  }\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[26], b[26], k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = 1;\n  k = 1;\n  for (j = 1; j < n; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j]) {\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n    if (b[j] > k)\n      k = b[j];\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[30];\nint dst[30];\n\nint main() {\n  memset(dst, 0, sizeof(dst));\n  int n;\n  int ans;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  dst[0] = 1;\n  int temp, max;\n  for (int i = 1; i < n; i++) {\n    max = 1;\n    for (int j = 0; j < i; j++) {\n\n      if (num[i] <= num[j]) {\n        temp = dst[j] + 1;\n        if (max < temp)\n          max = temp;\n      }\n    }\n    dst[i] = max;\n  }\n  max = 0;\n  for (int i = 0; i < n; i++) {\n\n    if (max < dst[i]) {\n      max = dst[i];\n    }\n  }\n\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[27] = {0}, b[27] = {0}, k, i, j, m = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  for (i = 0; i < k; i++)\n    if (b[i] > m)\n      m = b[i];\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18656", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[25], d[25];\n  int max;\n  int i, j, k;\n\n  cin >> k;\n\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n\n  d[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < k; j++) {\n      if (a[i] >= a[j] && max < d[j]) {\n        max = d[j];\n      }\n    }\n    if (max == 0)\n      d[i] = 1;\n    else {\n      d[i] = max + 1;\n    }\n  }\n\n  for (i = 0, max = 0; i < k; i++) {\n    if (max < d[i])\n      max = d[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint count(int h[25], int num[25], int n) {\n  int count = 1, i;\n  for (i = 0; i < n; i++)\n    if (h[i] > h[n] && num[i] > count)\n      count = num[i];\n  count++;\n  return (count);\n}\nint main() {\n  int n, h[25], num[25], i, j, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> h[i];\n  num[0] = 1;\n  for (i = 1; i < n; i++)\n    num[i] = count(h, num, i);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i] > num[j]) {\n        temp = num[i];\n        num[i] = num[j];\n        num[j] = temp;\n      }\n  printf(\"%d\\n\", num[n - 1]);\n}\n"}
{"label": "10", "index": "18658", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[26], f[26];\n  int i, j, k, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    f[i] = 1;\n  }\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i] && f[j] + 1 > f[i])\n        f[i] = f[j] + 1;\n    }\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    if (f[i] > k)\n      k = f[i];\n  }\n  printf(\"%d\", k);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18659", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100], max = 1;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n  }\n  for (i = 0; i < 100; i++) {\n    m[i] = 1;\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[j] + 1 >= m[i])) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = k - 1; p >= 0; p--) {\n    if (m[p] >= max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct daodan {\n  int height;\n  int number;\n};\nint compare(const void *a, const void *b) {\n  struct daodan *x = (struct daodan *)a;\n  struct daodan *y = (struct daodan *)b;\n  return (((*y).number) - ((*x).number));\n}\nint nextmax(struct daodan *dao, int k, int n) {\n  int *a = (int *)malloc((n - 1 - k) * sizeof(int));\n  int count = 0, b, c = 0;\n  for (int i = k + 1; i <= n - 1; i++) {\n    if ((dao[i]).height <= (dao[k]).height) {\n      a[count] = dao[i].number;\n      count++;\n    }\n  }\n  int max = 0;\n  for (int j = 0; j <= count - 1; j++) {\n    if (a[j] > max) {\n      max = a[j];\n    }\n  }\n\n  return max;\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct daodan *dao = (struct daodan *)malloc(n * sizeof(struct daodan));\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &dao[i].height);\n  }\n  for (int j = 0; j <= n - 1; j++) {\n    dao[j].number = 1;\n  }\n  for (int k = n - 2; k >= 0; k--) {\n    dao[k].number = nextmax(dao, k, n) + 1;\n  }\n  int max = dao[0].number;\n  for (int l = 1; l <= n - 1; l++) {\n    if (dao[l].number > max) {\n      max = dao[l].number;\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18661", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int d[25], f[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d\", &d[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 1;\n    for (int j = 0; j < i; j++)\n      if (d[j] >= d[i] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n  }\n  int ans = -1;\n  for (int i = 0; i < n; i++)\n    if (ans < f[i])\n      ans = f[i];\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18662", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, e, f, g;\n  scanf(\"%d\", &b);\n  int a[b], d[b];\n  for (c = 0; c < b; c++)\n    scanf(\"%d\", &a[c]);\n  d[b - 1] = 1;\n  for (c = b - 2; c >= 0; c--) {\n    d[c] = 1;\n    f = 0;\n    for (e = b - 1; e > c; e--) {\n      if (a[c] >= a[e]) {\n        if (d[e] > f)\n          f = d[e];\n      }\n    }\n    d[c] += f;\n  }\n  g = d[0];\n  for (c = 0; c < b; c++) {\n    if (d[c] > g)\n      g = d[c];\n  }\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "10", "index": "18663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int fff(int a[], int k);\n  int i, n, a[25], sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  sum = fff(a, 1);\n  for (i = 2; i < n + 1; i++)\n    if (sum < fff(a, i))\n      sum = fff(a, i);\n  printf(\"%d\", sum);\n}\nint fff(int a[], int k) {\n  int t = 0, i;\n  if (k == 0)\n    t = 0;\n\n  if (k == 1) {\n    t = 1;\n  }\n\n  if (k > 1) {\n    t = 1;\n    for (i = 1; i < k; i++) {\n      if (a[k - 1] <= a[i - 1]) {\n        if ((fff(a, i) + 1) > t)\n          t = fff(a, i) + 1;\n      }\n    }\n  }\n  return t;\n}\n"}
{"label": "10", "index": "18664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[26], b[26], c;\n\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n\n    b[i] = 1;\n\n    c = 0;\n\n    \n    for (j = 1; j < i; j++)         \n      if (a[j] >= a[i] && b[j] > c) \n        c = b[j];                   \n                                    \n    b[i] = c + 1;                   \n    \n  }\n\n  c = 0;\n\n  for (i = 1; i <= n; i++)\n    if (b[i] > c)\n      c = b[i];\n\n  cout << c;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[100] = {0}, f[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      f[i] = 1;\n    else {\n      k = 0;\n      for (j = 0, k = 0; j < i; j++) {\n        if (a[i] <= a[j] && k < f[j]) {\n          k = f[j];\n        }\n      }\n      f[i] = k + 1;\n    }\n  }\n  for (i = 0, k = 1; i < n; i++) {\n    if (k < f[i])\n      k = f[i];\n  }\n  printf(\"%d \", k);\n}\n"}
{"label": "10", "index": "18666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint data[1000];\nint ju[1000][1000];\nint weight[1000];\n\nint main(char *argv[]) {\n  int n = 0;\n  int i = 0;\n  int j = 0;\n  int max = 0;\n\n  freopen(\"in.txt\", \"r\", stdin);\n  freopen(\"out.txt\", \"w\", stdout);\n  cin >> n;\n  memset(ju, 0, sizeof(ju));\n  for (i = 0; i < n; i++) {\n    cin >> data[i];\n    weight[i] = 1;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (data[i] >= data[j]) {\n        ju[i][j] = 1;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (ju[i][j]) {\n        if (weight[i] < weight[j] + 1) {\n          weight[i] = weight[j] + 1;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < weight[i])\n      max = weight[i];\n  }\n  printf(\"%d \", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[25], b[25] = {0}, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n\n  for (i = 1; i <= n - 1; i++) {\n    for (j = n - i; j <= n - 1; j++) {\n      if (a[n - 1 - i] >= a[j]) {\n        if (b[n - i - 1] < b[j] + 1) {\n          b[n - i - 1] = b[j] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint com(void const *a, void const *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  int k, H;\n  int j, count[25], n;\n  scanf(\"%d\", &k);\n  int h[25], i;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n\n  count[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    n = 0;\n    for (j = k - 1; j >= i + 1; j--) {\n      if (h[j] <= h[i]) {\n        if (count[j] >= n) {\n          n = count[j];\n        }\n      }\n    }\n    count[i] = n + 1;\n  }\n\n  qsort(count, k, sizeof(int), com);\n  printf(\"%d\", count[k - 1]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25];\n  int b[25];\n  int i, j, max;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (max < b[j])\n          max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  cout << max;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100] = {0}, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[i] < m[j] + 1))\n        m[i] = m[j] + 1;\n    }\n  }\n  for (p = 0; p < k; p++) {\n    if (m[p] > max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18671", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint h[25], n;\nint hack(int i, int w) {\n  if (i == n - 1) {\n    if (h[i] <= w)\n      return 1;\n    else\n      return 0;\n  }\n  int b = hack(i + 1, w), c = 0;\n  if (h[i] <= w) {\n    c = 1 + hack(i + 1, h[i]);\n  }\n  if (b > c)\n    return b;\n  else\n    return c;\n}\nint main() {\n  scanf(\"%d\", &n);\n  int i, max = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &h[i]);\n    if (h[i] > max)\n      max = h[i];\n  }\n  printf(\"%d\", hack(0, max));\n  return 0;\n}\n"}
{"label": "10", "index": "18672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int opt[n];\n  for (i = 0; i < n; i++)\n    opt[i] = 1;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j] && opt[j] + 1 > opt[i])\n        opt[i] = opt[j] + 1;\n    }\n  }\n  int t = 0;\n  for (i = 0; i < n; i++) {\n    if (opt[i] > t)\n      t = opt[i];\n  }\n  cout << t;\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18673", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int s[30] = {0,  1,  2,  2,  4,  5,  6,  7,  6,  9,  6,  11, 12,\n               13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 8};\n\n  int a[30];\n  int k, i;\n\n  cin >> k;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n\n  if (a[24] == 1333 && k == 25)\n    printf(\"9\\n\");\n  else {\n    if (a[24] == 1761 && k == 25)\n      printf(\"8\\n\");\n    else\n\n      printf(\"%d\\n\", s[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "18674", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[25], k, b[25];\n  cin >> k;\n  int max1;\n\n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (int j = k - 1; j >= 0; j--) {\n    max1 = 0;\n    for (int m = k - 1; m > j; m--) {\n      if (a[m] <= a[j] && b[m] >= max1)\n        max1 = b[m];\n    }\n    b[j] = max1 + 1;\n  }\n  int max;\n  max = b[0];\n  for (int n = 1; n < k; n++) {\n    if (max < b[n])\n      max = b[n];\n  }\n  printf(\"%d\\n\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, mm, maxj, i, j, k, max;\n  scanf(\"%d\", &n);\n  int *height = (int *)malloc(sizeof(int) * n);\n  int *amount = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &height[i]);\n    amount[i] = 1;\n  }\n  max = 1;\n  for (j = n - 1; j >= 0; j--) {\n    maxj = 1;\n    for (k = j + 1; k < n; k++) {\n\n      if (height[j] >= height[k]) {\n        amount[j] = amount[k] + 1;\n        if (amount[j] >= maxj) {\n          maxj = amount[j];\n        }\n      }\n    }\n    amount[j] = maxj;\n    if (maxj >= max) {\n      max = maxj;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18676", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, k, i, j, a[25], b[25], max;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      b[i] = 1;\n    else {\n      max = 0;\n      for (j = i + 1; j <= k - 1; j++)\n        if (a[j] <= a[i] && b[j] >= max)\n          max = b[j];\n      b[i] = max + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a, int array[], int K) {\n  int i, max = 0, j;\n  if (a == K - 1)\n    return 1;\n  else {\n    for (j = K - 1; j > a; j--) {\n      if (array[j] <= array[a]) {\n        if (f(j, array, K) > max)\n          max = f(j, array, K);\n      }\n    }\n    return max + 1;\n  }\n}\nint main() {\n  int K, k, A[25], n, max = 1, i;\n  scanf(\"%d\", &K);\n  for (k = 0; k <= K - 1; k++)\n    scanf(\"%d\", &A[k]);\n\n  for (i = 0; i <= K - 1; i++) {\n    if (f(i, A, K) > max)\n      max = f(i, A, K);\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint bomb[25], p = 0, k, antibomb[25], j = 0, answer[2] = {0, 0};\nvoid makeanti(int a[]);\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &bomb[i]);\n  makeanti(bomb);\n  printf(\"%d\", answer[0]);\n  getchar();\n  getchar();\n}\nvoid makeanti(int bomb[]) {\n  int i, l, r = 0, aa;\n  if (k == 0) {\n    answer[1] = j;\n    answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n  } else\n    for (i = 0; i < k; i++) {\n      if (j == 0)\n        antibomb[j++] = bomb[i];\n      else if (bomb[i] <= antibomb[j - 1]) {\n        antibomb[j++] = bomb[i];\n        r = 1;\n      } else if (r == 0 && i == k - 1) {\n        answer[1] = j;\n        answer[0] = answer[0] > answer[1] ? answer[0] : answer[1];\n        continue;\n      } else\n        continue;\n      k -= (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb++;\n      makeanti(bomb);\n      j--;\n      k += (i + 1);\n      for (l = 0; l <= i; l++)\n        bomb--;\n    }\n}\n"}
{"label": "10", "index": "18679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int high[26], n, maxnum[26], temp[26];\n  cin >> n;\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    cin >> high[i];\n  maxnum[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int len = 0;\n    for (j = i + 1; j < n; j++) {\n      if (high[i] >= high[j]) {\n        temp[len++] = 1 + maxnum[j];\n      }\n    }\n    int mark1 = 1;\n    for (k = 0; k < len; k++) {\n      if (temp[k] >= mark1)\n        mark1 = temp[k];\n    }\n    maxnum[i] = mark1;\n  }\n  int mark2 = 0;\n  for (i = 0; i < n; i++) {\n    if (maxnum[i] >= mark2)\n      mark2 = maxnum[i];\n  }\n  cout << mark2;\n  return 0;\n}\n"}
{"label": "10", "index": "18680", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, t, m;\n  int a[25], b[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i = i + 1)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i = i - 1) {\n    for (t = 0, m = i + 1; m < k; m = m + 1)\n      if (a[i] >= a[m] && b[m] > t)\n        t = b[m];\n    b[i] = t + 1;\n  }\n  for (i = 0, t = 0; i < k; i = i + 1)\n    if (b[i] > t)\n      t = b[i];\n  printf(\"%d\", t);\n}\n"}
{"label": "10", "index": "18681", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[30], b[30] = {0}, max = 0, flag = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int j = n, k; j >= 1; j--) {\n    max = 0;\n    flag = 0;\n    for (k = j; k <= n; k++) {\n      if (a[j] >= a[k]) {\n        flag = 1;\n        if (b[k] >= max) {\n          max = b[k];\n        }\n      }\n    }\n    if (flag) {\n      b[j] = max + 1;\n    } else {\n      b[j] = max;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (b[i] >= max) {\n      max = b[i];\n    }\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0, a[100001] = {100000000};\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    int t;\n    scanf(\"%d\", &t);\n    int j = m;\n    while (a[j] < t)\n      j--;\n    a[++j] = t;\n    m = j > m ? j : m;\n  }\n  printf(\"%d\\n\", m);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[25], b[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    for (j = 0; j <= i; j++) {\n      if (b[i] <= b[j] && a[i] <= a[j])\n        a[i] = a[j];\n    }\n    a[i]++;\n    if (s < a[i])\n      s = a[i];\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "10", "index": "18684", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[100], b[100], bm = -1;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && (b[j] + 1) > b[i])\n        b[i] = (b[j] + 1);\n    if (b[i] > bm)\n      bm = b[i];\n  }\n\n  cout << bm;\n}\n"}
{"label": "10", "index": "18685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[26] = {0}, i, j, z, l[26] = {1};\n  scanf(\"%d\", &n);\n  for (i = n; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (z = j = 0; j < i; j++)\n      if (a[i] >= a[j] && z <= l[j]) {\n        z = l[j] + 1;\n      }\n    l[i] = z;\n  }\n  for (z = i = 0; i <= n; i++)\n    if (l[i] > z)\n      z = l[i];\n  cout << z - 1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18686", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint p(int n, int heightLimit, int *missileHeight, int missileNum) {\n  int a;\n  int b;\n\n  if (n == missileNum - 1)\n    if (missileHeight[n] <= heightLimit)\n      return 1;\n    else\n      return 0;\n  else if (missileHeight[n] <= heightLimit) {\n    a = 1 + p(n + 1, missileHeight[n], missileHeight, missileNum);\n    b = p(n + 1, heightLimit, missileHeight, missileNum);\n    return a > b ? a : b;\n  } else {\n    return p(n + 1, heightLimit, missileHeight, missileNum);\n  }\n}\n\nint main() {\n  int n, i, j;\n  int *missileHeight;\n  int highest = -1;\n  scanf(\"%d\", &n);\n  missileHeight = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(missileHeight[i]));\n    if (missileHeight[i] > highest)\n      highest = missileHeight[i];\n  }\n  printf(\"%d\", p(0, highest, missileHeight, n));\n  return 0;\n}\n"}
{"label": "10", "index": "18687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, *d, j, i;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i < n + 1; i++)\n    scanf(\"%d\", &a[i]);\n  d = (int *)malloc(sizeof(int) * (n + 1));\n  for (i = 1; i <= n; i++)\n    d[i] = 1;\n  for (i = n - 1; i > 0; i--) {\n\n    for (j = i + 1; j <= n; j++) {\n\n      if (a[j] <= a[i])\n        if (d[i] < d[j] + 1)\n          d[i] = d[j] + 1;\n    }\n  }\n  int max = d[1];\n  for (i = 1; i <= n; i++)\n    if (max < d[i])\n      max = d[i];\n  cout << max << \"\\n\";\n  free(a);\n  free(d);\n  return 0;\n}\n"}
{"label": "10", "index": "18688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[25] = {0}, i, d[25] = {1}, dm = 0, mm, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n  for (i = n - 1; i >= 0; i--)\n    for (j = i + 1; j < n; j++)\n      if (m[i] >= m[j] && d[i] <= d[j])\n        d[i] = d[j] + 1;\n  dm = d[0];\n  for (i = 0; i < n; i++)\n    if (d[i] > dm)\n      dm = d[i];\n  printf(\"%d\", dm);\n  scanf(\"%d\", &i);\n  return 0;\n}\n"}
{"label": "10", "index": "18689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[99];\n  scanf(\"%d\", &n);\n  for (i = 1; i < n; i++)\n    cin >> a[i];\n  scanf(\"%d\", &a[n]);\n  if (n == 8)\n    printf(\"6\\n\");\n  else if (n == 25 && a[9] == 3348)\n    cout << \"9\\n\";\n  else if (n == 25 && a[9] == 4348)\n    printf(\"8\\n\");\n  else if (n == 3)\n    printf(\"2\\n\");\n  else if (n == 10)\n    printf(\"6\\n\");\n  else\n    printf(\"rror\\n\");\n  return 0;\n}\n"}
{"label": "10", "index": "18690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint analyse(int *, int *, int, int);\nint main() {\n  int k;\n  int height[25], numbers[25] = {0};\n  int i, max, temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", height + i);\n  max = numbers[24] = 1;\n  for (i = 23; i >= 0; i--) {\n    temp = analyse(height, numbers, i, k);\n    if (temp > max)\n      max = temp;\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\nint analyse(int *height, int *numbers, int seq, int k) {\n  int max = 0, temp, i;\n  for (i = k - 1; i > seq; i--) {\n    if (height[seq] >= height[i]) {\n      temp = numbers[i];\n      if (temp > max)\n        max = temp;\n    }\n  }\n  max++;\n  numbers[seq] = max;\n  return max;\n}\n"}
{"label": "10", "index": "18691", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[26], b[26], c;\n\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n\n    b[i] = 1;\n\n    c = 0;\n\n    for (j = 1; j < i; j++)\n      if (a[j] >= a[i] && b[j] > c)\n        c = b[j];\n\n    b[i] = c + 1;\n  }\n\n  c = 0;\n\n  for (i = 1; i <= n; i++)\n    if (b[i] > c)\n      c = b[i];\n\n  cout << c;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], b[25];\n  int i, j, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[i] >= a[j]) {\n        if (b[j] >= b[i]) {\n          b[i] = b[j] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      j = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = j;\n    }\n  }\n  printf(\"%d\\n\", b[k - 1]);\n}\n"}
{"label": "10", "index": "18693", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, a[26], len[26];\n  cin >> k;\n  for (i = 0; i < k; ++i)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < k; ++i)\n    len[i] = 1;\n  for (i = 1; i < k; ++i) {\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j]) {\n        len[i] = len[j] + 1;\n        break;\n      }\n    for (l = j + 1; l < i; ++l)\n      if (len[l] >= len[i] && a[i] <= a[l]) {\n        len[i] = len[l] + 1;\n        continue;\n      }\n  }\n  for (i = 0; i < k; ++i)\n    if (len[i] > len[0])\n      len[0] = len[i];\n  printf(\"%d\", len[0]);\n}\n"}
{"label": "10", "index": "18694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int dao, a[25] = {0}, b[25], i, j, num;\n  scanf(\"%d\", &dao);\n  for (i = 0; i < dao; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = dao - 1; i >= 0; i--) {\n    num = 0;\n    for (j = i; j < dao; j++) {\n      if (b[i] >= b[j] && num <= a[j])\n        num = a[j];\n    }\n    a[i] = num + 1;\n  }\n  num = a[0];\n  for (i = 1; i < dao; i++) {\n    if (a[i] >= num)\n      num = a[i];\n  }\n  printf(\"%d\", num);\n}\n"}
{"label": "10", "index": "18695", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  int b[25];\n  int max;\n  for (int i = 0; i < n; i++) {\n    b[i] = 1;\n    scanf(\"%d \", &a[i]);\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = i; j < n; j++) {\n      if (i != j && a[i] >= a[j] && b[i] < 1 + b[j]) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  max = b[0];\n  for (int i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100], n, i, j, max[100], sum[100], final;\n  final = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  sum[n - 1] = 1;\n  max[n - 1] = a[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    sum[i] = sum[n - 1];\n    max[i] = max[n - 1];\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= max[j] && sum[i] <= sum[j] + 1) {\n        sum[i] = sum[j] + 1;\n        max[i] = a[i];\n      }\n    }\n    if (sum[i] == 1 && a[i] < max[i])\n      max[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (final <= sum[i])\n      final = sum[i];\n  }\n  cout << final;\n}\n"}
{"label": "10", "index": "18697", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint h[25];\nint l[25];\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++) {\n    cin >> h[i];\n    l[i] = 0;\n  }\n  l[0] = 1;\n\n  for (i = 1; i < k; i++) {\n    int temp = -1;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && l[j] + 1 > temp)\n        temp = l[j] + 1;\n    }\n    if (temp == -1)\n      l[i] = 1;\n    else\n      l[i] = temp;\n  }\n  int res = -1;\n\n  for (i = 0; i < k; i++) {\n    if (l[i] > res)\n      res = l[i];\n  }\n  cout << res << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nconst int N = 1010;\n\nint n, m, k;\nint q[N];\nint f[N];\n\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> q[i];\n  q[0] = 1000000000;\n  for (int i = 1; i <= n; i++)\n    for (int j = 0; j < i; j++)\n      if (q[j] >= q[i])\n        f[i] = max(f[i], f[j] + 1);\n  int res = 0;\n  for (int i = 1; i <= n; i++)\n    res = max(res, f[i]);\n  printf(\"%d\\n\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "18699", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, m, k;\n  scanf(\"%d \", &n);\n  static int hight[25], num[25];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &hight[i]);\n  num[0] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      m = 0;\n      if (hight[j] >= hight[i]) {\n        m = num[j];\n        break;\n      }\n    }\n    if (j == -1)\n      num[i] = 1;\n    for (k = j - 1; k >= 0; k--) {\n      if (hight[k] >= hight[i]) {\n        if (num[k] > m)\n          m = num[k];\n      }\n    }\n    if (num[i] == 0)\n      num[i] = m + 1;\n  }\n  max = num[n - 1];\n  for (i = n - 2; i >= 0; i--) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d \", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0;\n  int a[25] = {0}, b[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++)\n      if (a[i] >= a[j] && b[i] <= b[j])\n        b[i] = b[j] + 1;\n    if (b[i] == 0)\n      b[i] = 1;\n  }\n  for (i = 0; i <= k - 2; i++)\n    for (j = 0; j <= k - 2 - i; j++)\n      if (b[j] > b[j + 1]) {\n        l = b[j + 1];\n        b[j + 1] = b[j];\n        b[j] = l;\n      }\n  cout << b[k - 1] << \"\\n\";\n}\n"}
{"label": "10", "index": "18701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, t, a[10000], f[10000], ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &a[i]);\n    t = 0;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j] && f[j] > t)\n        t = f[j];\n    f[i] = t + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k, a[25], f[25][25];\n\nint max(int a, int b) { return a > b ? a : b; }\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    cin >> a[i];\n  }\n  f[0][0] = a[0];\n  for (i = 1; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (j == 0) {\n        f[i][j] = max(f[i - 1][j], a[i]);\n        continue;\n      }\n      if (f[i - 1][j - 1] >= a[i])\n        f[i][j] = max(f[i - 1][j], a[i]);\n      else\n        f[i][j] = f[i - 1][j];\n    }\n  }\n  j = k - 1;\n  while (f[k - 1][j] == 0)\n    j--;\n  printf(\"%d\", j + 1);\n}\n"}
{"label": "10", "index": "18703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int high[26], n, maxnum[26], temp[26]; \n  scanf(\"%d\", &n);\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &high[i]);\n  maxnum[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    int len = 0;\n    for (j = i + 1; j < n; j++) {\n      if (high[i] >= high[j]) {\n        temp[len++] = 1 + maxnum[j];\n      }\n    }\n    int mark1 = 1;\n    for (k = 0; k < len; k++) {\n      if (temp[k] >= mark1)\n        mark1 = temp[k];\n    }\n    maxnum[i] = mark1;\n  }\n  int mark2 = 0;\n  for (i = 0; i < n; i++) {\n    if (maxnum[i] >= mark2)\n      mark2 = maxnum[i];\n  }\n  printf(\"%d\", mark2);\n  return 0;\n}\n"}
{"label": "10", "index": "18704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sta[20002];\nint mycmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint main() {\n  int input[30] = {0};\n  int cnt[30] = {0};\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> input[i];\n  cnt[0] = 1;\n  for (i = 1; i < n; i++) {\n    int max = 0;\n    for (int k = i - 1; k >= 0; k--) {\n      if (cnt[k] > max && input[k] >= input[i])\n        max = cnt[k];\n    }\n    cnt[i] = max + 1;\n  }\n  int m = 0;\n  for (i = 0; i < n; i++)\n    if (m < cnt[i])\n      m = cnt[i];\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint calc(int *, int, int);\n\nint main() {\n  int k, h[25], i = 0;\n  cin >> k;\n  while (cin >> h[i]) {\n    i++;\n    if (i == k)\n      break;\n  }\n  printf(\"%d\", calc(h, k, (1 << 31 - 1)));\n}\n\nint calc(int *h, int k, int limit) {\n  int i, ret = 0, t = 0;\n  for (i = 0; i < k; i++) {\n    if (h[i] > limit)\n      continue;\n    t = 1 + calc(h + i + 1, k - i - 1, h[i]);\n    if (t > ret)\n      ret = t;\n  }\n  return ret;\n}\n"}
{"label": "10", "index": "18706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, k, i, max = 0;\n  scanf(\"%d\", &k);\n  int *p = (int *)malloc(k * sizeof(int));\n  int *q = (int *)malloc(k * sizeof(int));\n  scanf(\"%d\", &p[0]);\n  for (i = 1; i < k; i++)\n    scanf(\" %d\", &p[i]);\n  for (i = 0; i < k; i++)\n    q[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (p[i] >= p[j] && q[j] >= q[i])\n        q[i] = q[j] + 1;\n  for (i = 0; i < k; i++)\n    if (q[i] > max)\n      max = q[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  int h[k], n[k];\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  for (i = k - 1; i >= 0; i--) {\n    int max = 0;\n    for (j = i + 1; j < k; j++)\n      if (h[j] <= h[i] && n[j] > max)\n        max = n[j];\n    n[i] = max + 1;\n  }\n  int Max = 0;\n  for (i = 0; i < k; i++)\n    if (n[i] > Max)\n      Max = n[i];\n  cout << Max << \" \";\n}\n"}
{"label": "10", "index": "18708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length[500] = {0}, a[500];\n  int temp = 0;\n  int n;\n  cin >> n;\n  int i = 0, j = 0;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  length[1] = 1;\n  for (i = 2; i <= n; i++) {\n    temp = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] <= a[j]) {\n        if (temp < length[j])\n          temp = length[j];\n      }\n    }\n    length[i] = temp + 1;\n  }\n  int max = 0;\n  for (i = 1; i <= n; i++)\n    if (max < length[i])\n      max = length[i];\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int num, max = 0;\n  cin >> num;\n  int a[num], flag[num];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[j] >= a[i])\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n    }\n    if (flag[i] > max) {\n      max = flag[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18710", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[25], b[25];\n  int n, i, j;\n  int max = 1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++)\n      if ((b[i] <= b[j]) && (a[i] <= a[j])) {\n        b[i] = b[j] + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid make(int a[], int n);\n\nint main() {\n  int n = 0;\n  int hight[26];\n  int i = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &hight[i]);\n\n  make(hight, n);\n\n  return 0;\n}\n\nvoid make(int hight[], int n) {\n  int i = 0;\n  int j = 0;\n  int a[26];\n  int max = 0;\n  a[1] = 1;\n  for (i = 2; i <= n; i++) {\n    a[i] = 1;\n    for (j = 1; j < i; j++)\n      if ((hight[j] >= hight[i]) && (a[j] + 1 > a[i]))\n        a[i] = a[j] + 1;\n  }\n  for (i = 1; i <= n; i++)\n    max = (max > a[i] ? max : a[i]);\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18712", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int k[25], a[25];\n  int maxk, maxa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &k[i]);\n  }\n  a[0] = 1;\n  maxk = 1;\n  for (i = 1; i < n; i++) {\n    maxa = 0;\n\n    for (j = 0; j < i; j++) {\n      if (k[j] >= k[i]) {\n        if (a[j] >= maxa)\n          maxa = a[j];\n      }\n    }\n    a[i] = maxa + 1;\n\n    if (a[i] >= maxk) {\n      maxk = a[i];\n    }\n  }\n  printf(\"%d\", maxk);\n  return 0;\n}\n"}
{"label": "10", "index": "18713", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\nint a[100] = {0};\nint max_1[100] = {0};\nint main() {\n  int i, j, c;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      max_1[i] = 1;\n    else {\n      for (j = 1, c = 0; j <= i - 1; j++) {\n        if (a[j] < a[i])\n          ;\n        else {\n          if (c < max_1[j])\n            c = max_1[j];\n        }\n      }\n      max_1[i] = c + 1;\n    }\n  }\n  for (i = 1, c = max_1[1]; i <= n; i++) {\n    if (c < max_1[i])\n      c = max_1[i];\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max >= k[i])\n      q = f(k[i], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  cout << f(2147483647, 0, 0);\n  return 0;\n}\n"}
{"label": "10", "index": "18715", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint set_1(int i);\nint num = 0;\nint currH = 100000;\nint MaxNum = 0;\nint a[100];\nint b[100];\nint main() {\n  int i;\n  for (i = 0; i < 100; i++) {\n    b[i] = 0;\n  }\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++) {\n    int j;\n    cin >> j;\n    a[i] = j;\n  }\n  set_1(0);\n  printf(\"%d\", MaxNum);\n  return 0;\n}\n\nint set_1(int i) {\n  int lastNum = num;\n  int lastcurrH = currH;\n  if (i == k - 1) {\n    if (a[i] <= currH)\n      num++;\n    if (num > MaxNum) {\n      MaxNum = num;\n    }\n    num = lastNum;\n    currH = lastcurrH;\n    return 0;\n  }\n  if (b[i] == 0)\n    set_1(i + 1);\n  b[i]++;\n\n  if (b[i] == 1) {\n    if (a[i] <= currH) {\n      currH = a[i];\n      num++;\n    }\n    set_1(i + 1);\n  }\n\n  num = lastNum;\n  currH = lastcurrH;\n  b[i] = 0;\n  return 0;\n}\n"}
{"label": "10", "index": "18716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint maxnum(int *a, int n, int up) {\n  if (n == 0)\n    return 0;\n  int i, max = -1, t;\n  for (i = 0; i < n; i++) {\n    t = up;\n    if (a[i] <= up || up == -1)\n      t = a[i];\n    else\n      continue;\n    if (maxnum(a + i + 1, n - 1 - i, t) > max)\n      max = maxnum(a + i + 1, n - i - 1, t);\n  }\n  return max + 1;\n}\n\nint main() {\n  int i, n, a[25];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << maxnum(a, n, -1);\n  return 0;\n}\n"}
{"label": "10", "index": "18717", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint data[1000];\nint ju[1000][1000];\nint weight[1000];\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int i = 0;\n  int j = 0;\n  int max = 0;\n\n  freopen(\"in.txt\", \"r\", stdin);\n  freopen(\"out.txt\", \"w\", stdout);\n  scanf(\"%d\", &n);\n  memset(ju, 0, sizeof(ju));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &data[i]);\n    weight[i] = 1;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (data[i] >= data[j]) {\n        ju[i][j] = 1;\n      }\n    }\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (ju[i][j]) {\n        if (weight[i] < weight[j] + 1) {\n          weight[i] = weight[j] + 1;\n        }\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < weight[i])\n      max = weight[i];\n  }\n  printf(\"%d \", max);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[26] = {0}, q[26] = {0}, a = 0, b, c, d, e, f, g, i, j, k, l, m, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  q[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    b = 1;\n    for (j = i + 1; j < k; j++) {\n      if (p[i] >= p[j]) {\n        if (q[j] + 1 > b)\n          b = q[j] + 1;\n      }\n    }\n    q[i] = b;\n  }\n  for (i = 0; i < k; i++) {\n    if (a < q[i])\n      a = q[i];\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18719", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  cin >> k;\n  int h[50];\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> h[i];\n  int num[50], max;\n  num[0] = 1;\n  for (i = 1; i < k; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[j] >= h[i] && num[j] > max)\n        max = num[j];\n    }\n    num[i] = max + 1;\n  }\n  max = 0;\n  for (i = 1; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint Height[26];\nint MaxLen[26];\n\nvoid LIS(int k) {\n  memset(MaxLen, 0, sizeof(MaxLen));\n  for (int i = 1; i <= k; i++) {\n    MaxLen[i] = 1;\n\n    for (int j = 1; j < i; j++) {\n\n      if (Height[i] <= Height[j]) {\n\n        int preMax = MaxLen[j] + 1;\n        if (preMax > MaxLen[i]) {\n          MaxLen[i] = preMax;\n        }\n      }\n    }\n  }\n}\n\nint main() {\n  int N, i;\n  scanf(\"%d\", &N);\n\n  for (i = 1; i <= N; i++) {\n    scanf(\"%d\", &Height[i]);\n  }\n  LIS(N);\n  int Max = -1;\n\n  for (i = 1; i <= N; i++) {\n    if (Max < MaxLen[i]) {\n      Max = MaxLen[i];\n    }\n  }\n  if (N != 0) {\n    cout << Max << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "10", "index": "18721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint arr[30];\nint num[30];\n\nint main() {\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> arr[i];\n  for (int i = 0; i < k; i++)\n    num[i] = 1;\n  for (int i = 0; i < k; i++) {\n    for (int j = 0; j < i; j++) {\n      if (arr[j] >= arr[i] && num[j] >= num[i])\n        num[i] = num[j] + 1;\n    }\n  }\n  int res = -1;\n  for (int i = 0; i < k; i++)\n    if (num[i] > res)\n      res = num[i];\n  printf(\"%d\\n\", res);\n  return 0;\n}\n"}
{"label": "10", "index": "18722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int d[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", d + i);\n  }\n  int opt[n];\n  for (int i = 0; i < n; i++) {\n    opt[i] = 0;\n  }\n  for (int i = n; i >= 0; i--)\n    for (int j = i; j < n; j++) {\n      if ((d[i] >= d[j]) && (opt[i] <= opt[j] + 1))\n        opt[i] = opt[j] + 1;\n    }\n  int max = 1;\n  for (int i = 0; i < n; i++) {\n    if (opt[i] > max)\n      max = opt[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, max, h[25], t[25];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 0; i < k; i++)\n    t[i] = 1;\n  for (i = k - 2; i >= 0; i--)\n    for (j = i + 1; j < k; j++)\n      if (h[i] >= h[j] && t[i] <= t[j]) {\n        t[i] = t[j] + 1;\n      }\n  for (max = 0, i = 0; i < k; i++)\n    if (t[i] > max)\n      max = t[i];\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18724", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int f[26], maxnum = 1, i, j, h[26], n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> h[i];\n    f[i] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (h[j] >= h[i])\n        f[i] = max(f[i], f[j] + 1);\n    maxnum = max(maxnum, f[i]);\n  }\n  cout << maxnum;\n  return 0;\n}\n"}
{"label": "10", "index": "18725", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint maxii(int n, int *a) {\n  int k, i, s;\n  k = 1;\n  for (i = 1; i < n; i++) {\n    if ((a[i] <= a[0]) && (maxii(n - i, a + i) > (k - 1)))\n      k = maxii(n - i, a + i) + 1;\n  }\n  return k;\n}\n\nint main() {\n  int n, *k, i, j, c;\n  int a[25];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  k = (int *)malloc(n * sizeof(int));\n  c = 1;\n  for (j = 0; j < n; j++) {\n    if (c < maxii(n - j, a + j))\n      c = maxii(n - j, a + j);\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s[25];\n  int max[25];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  max[0] = 1;\n  for (i = 1; i < n; i++) {\n    int m = 1;\n    for (j = 0; j < i; j++) {\n      if (s[i] <= s[j] && max[j] + 1 > m)\n        m = max[j] + 1;\n    }\n    max[i] = m;\n  }\n  int p = max[0];\n  for (i = 1; i < n; i++) {\n    if (max[i] > p)\n      p = max[i];\n  }\n  cout << p << endl;\n}\n"}
{"label": "10", "index": "18727", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint compare(int x, int y) {\n  if (x <= y) {\n    x = (y + 1);\n  }\n  return x;\n}\n\nint main(void) {\n\n  int i, n, r, a, j;\n  scanf(\"%d\", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  for (i = 0; i != n; i++) {\n    cin >> p[i];\n  }\n  int *q = (int *)malloc(n * sizeof(int));\n  for (j = 0; j != n; j++) {\n    q[j] = 1;\n    for (r = 0; r != j; r++) {\n      if (p[j] <= p[r]) {\n        q[j] = compare(q[j], q[r]);\n      }\n    }\n  }\n  int max;\n  max = q[0];\n  for (a = 0; a < n; a++) {\n    if (q[a] > max)\n      max = q[a];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, dmax, a[100], d[100];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++)\n    d[i] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i] >= a[j]) && (d[i] <= d[j]))\n        d[i] = d[j] + 1;\n    }\n  }\n\n  dmax = 0;\n  for (i = 0; i < n; i++) {\n    if (d[i] > dmax)\n      dmax = d[i];\n  }\n\n  cout << dmax << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "10", "index": "18729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x >= y)\n    return x;\n  else\n    return y;\n}\n\nint main() {\n  int i, j, k, p[25], result, a[25], b[25], sum;\n  for (i = 0; i < 25; i++)\n    a[i] = b[i] = p[i] = 0;\n  cin >> k;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &p[i]);\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    sum = 0;\n    for (int m = 0; m < 25; m++)\n      a[m] = 0;\n    for (j = k - 1; j > i; j--) {\n      if (p[j] <= p[i])\n        a[j] = b[j];\n      sum = max(sum, a[j]);\n    }\n    b[i] = sum + 1;\n  }\n  result = 0;\n  for (i = 0; i < k; i++)\n    result = max(result, b[i]);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "10", "index": "18730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxsize = 26;\nint maxnum(int *r, int n) {\n  int ans = 1;\n  int i, j, temp;\n  int maxlen[maxsize];\n  maxlen[0] = 1;\n  for (i = 1; i < n; i++) {\n    temp = 0;\n    for (j = 0; j < i; j++) {\n      if (r[j] >= r[i]) {\n        if (maxlen[j] > temp)\n          temp = maxlen[j];\n      }\n    }\n    maxlen[i] = temp + 1;\n    if (ans < maxlen[i])\n      ans = maxlen[i];\n  }\n  return ans;\n}\nint main() {\n  int i, k;\n  int r[maxsize];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", r + i);\n  printf(\"%d\\n\", maxnum(r, k));\n  return 0;\n}\n"}
{"label": "10", "index": "18731", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint a[25] = {0};\nint b[25] = {0};\n\nint main() {\n  cin >> k;\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  int n = 0;\n  for (j = 0; j < k; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j])\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (n <= b[i])\n      n = b[i];\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int max;\n  int d[30];\n  int h[30];\n  d[0] = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &h[i]);\n  h[0] = 2147483647;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 0; j < i; j++) {\n      if (h[i] <= h[j] && (d[j] + 1) > max)\n        max = d[j] + 1;\n    }\n    d[i] = max;\n  }\n  max = 0;\n  for (i = 1; i <= n; i++)\n    if (d[i] > max)\n      max = d[i];\n  cout << max << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint lanjie(int m, int b[26], int lim) {\n  if (m == 1) {\n    if (b[0] <= lim)\n      return (1);\n    else\n      return (0);\n  } else if (m == 2) {\n    if (b[0] <= lim && b[1] <= b[0])\n      return (2);\n    else if (b[0] > lim && b[1] > lim)\n      return (0);\n    else\n      return (1);\n  } else {\n    if (b[0] <= lim)\n      return (lanjie(m - 1, &b[1], b[0]) + 1 >= lanjie(m - 1, &b[1], lim)\n                  ? lanjie(m - 1, &b[1], b[0]) + 1\n                  : lanjie(m - 1, &b[1], lim));\n    else\n      return (lanjie(m - 1, &b[1], lim));\n  }\n}\nint main() {\n  int a[26], i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  getchar();\n  printf(\"%d\\n\", lanjie(k, a, 32767));\n}\n"}
{"label": "10", "index": "18734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], b[25], c[25], i, j, n, max = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    a[i] = 0;\n    b[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i; j < n; j++) {\n      if (a[i] >= a[j]) {\n        c[j - i] = b[j] + 1;\n      } else {\n        c[j - i] = 1;\n      }\n    }\n    for (j = 0; j < n - i; j++) {\n      if (c[j] >= b[i])\n        b[i] = c[j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a[25], b[25], i, j, t, s = 0;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0, t = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (b[j] > t)\n          t = b[j];\n      }\n    }\n    b[i] = 1 + t;\n    if (b[i] > s)\n      s = b[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "18736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[25], b[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint n;\nint changdu(int i) {\n  int j, max = 1;\n  if (b[i] != 1)\n    return b[i];\n  else {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        b[i] = changdu(j) + 1;\n        if (b[i] > max)\n          max = b[i];\n      }\n    }\n    b[i] = max;\n    return max;\n  }\n}\nint main() {\n  int max = 0, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n    }\n    b[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 8 && a[0] == 300)\n    printf(\"6\");\n  else if (n == 25 && a[0] == 1254 && a[24] != 1761)\n    cout << \"9\";\n  else if (n == 25 && a[24] == 1761)\n    printf(\"8\");\n  else if (n == 3 && a[1] == 200)\n    printf(\"2\");\n  else if (n == 10 && a[9] == 1511)\n    printf(\"6\");\n  else\n    printf(\"10\");\n}\n"}
{"label": "10", "index": "18739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint maxnum(int *a, int n, int up) {\n  if (n == 0)\n    return 0;\n  int i, max = -1, t;\n  for (i = 0; i < n; i++) {\n    t = up;\n    if (a[i] <= up || up == -1)\n      t = a[i];\n    else\n      continue;\n    if (maxnum(a + i + 1, n - 1 - i, t) > max)\n      max = maxnum(a + i + 1, n - i - 1, t);\n  }\n  return max + 1;\n}\n\nint main() {\n  int i, n, a[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << maxnum(a, n, -1);\n}\n"}
{"label": "10", "index": "18740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[25] = {0}, n;\nint main() {\n  int F(int x);\n  int i, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    if (z < F(i))\n      z = F(i);\n  printf(\"%d\\n\", z);\n}\nint F(int x) {\n  int i, z = 1;\n  for (i = x + 1; i < n; i++)\n    if ((a[x] >= a[i]) && (F(i) + 1 > z))\n      z = F(i) + 1;\n  return z;\n}\n"}
{"label": "10", "index": "18741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[25], num;\nint b[25];\nint i, j, k;\n\nint main() {\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 1;\n  }\n  int max = 0;\n  b[0] = 1;\n  for (i = 1; i < num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] >= a[i]) {\n        k = b[j] + 1;\n        if (k > b[i]) {\n          b[i] = k;\n          if (k > max) {\n            max = k;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rec[30], height[30];\nint maxV;\nint main() {\n  int n;\n  maxV = 0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n    return 0;\n  }\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> height[i];\n    rec[i] = 1;\n    for (j = 0; j < i; j++)\n      if (height[j] >= height[i] && rec[j] + 1 > rec[i]) {\n        rec[i] = rec[j] + 1;\n      }\n    if (rec[i] > maxV) {\n      maxV = rec[i];\n    }\n  }\n  cout << maxV << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18743", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, height[30], num[30], j, max = -1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    num[i] = 1;\n\n  for (i = 1; i < n; i++)\n    for (j = i - 1; j >= 0; j--) {\n      if (height[j] >= height[i] && num[j] + 1 > num[i])\n        num[i] = num[j] + 1;\n    }\n  for (i = 1; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max << endl;\n}\n"}
{"label": "10", "index": "18744", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[26] = {0};\nint b[10000];\nint n, m = 0;\nint p = 1;\nvoid dao(int c, int k) {\n  int i, flag = 0;\n  for (i = k + 1; i < n; i++) {\n    if (a[i] <= c) {\n      flag = 1;\n      p = p + 1;\n      dao(a[i], i);\n      p = p - 1;\n    }\n  }\n  if (flag == 0) {\n    b[m] = p;\n    m = m + 1;\n  }\n}\nint main() {\n  int i, q;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    dao(a[i], i);\n  }\n  for (i = 0; i < m - 1; i++) {\n    if (b[i] > b[i + 1]) {\n      q = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = q;\n    }\n  }\n  printf(\"%d\", b[m - 1]);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, i1, k, imax = 0;\n  int a[26];\n  int b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[n] = 0;\n  b[n - 1] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    imax = n;\n    for (i1 = i + 1; i1 < n; i1++) {\n      if (b[i1] > b[imax] && a[i] >= a[i1]) {\n        imax = i1;\n      }\n    }\n    b[i] = b[imax] + 1;\n  }\n\n  for (i = 0, k = 0; i < n; i++) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[25], b[25], c, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n  for (i = 1; i < n; i++) {\n    b[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (((b[j] + 1) > b[i]) && (a[j] >= a[i]))\n        b[i] = b[j] + 1;\n    }\n  }\n  c = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > c)\n      c = b[i];\n  }\n  cout << c << \" \";\n}\n"}
{"label": "10", "index": "18747", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000] = {0}, b[1000] = {0};\n  int i, j, k, max, t;\n  scanf(\"%d\", &k);\n  for (i = k; i >= 1; i--)\n    cin >> a[i];\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    max = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] <= a[i] && b[j] > max)\n        max = b[j];\n    }\n    b[i] = max + 1;\n  }\n  t = 0;\n  for (i = 1; i <= k; i++) {\n    if (b[i] >= t)\n      t = b[i];\n  }\n  for (i = 1; i <= k; i++) {\n    if (b[i] == t)\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18748", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 0, max = 0;\n  scanf(\"%d\", &k);\n  int *h = (int *)malloc(k * sizeof(int));\n  int *p = (int *)malloc(k * sizeof(int));\n  for (int i = 0; i < k; i++)\n    scanf(\"%d\", &h[i]);\n  p[k - 1] = 1;\n  for (int i = 0; i < k - 1; i++) {\n    for (int j = 1; k - 2 - i + j <= k - 1; j++) {\n      if (h[k - 2 - i] >= h[k - 2 - i + j]) {\n        if (max <= p[k - 2 - i + j])\n          max = p[k - 2 - i + j];\n      }\n    }\n    p[k - 2 - i] = max + 1;\n    max = 0;\n  }\n  max = p[0];\n  for (int i = 0; i < k; i++)\n    if (max < p[i])\n      max = p[i];\n  printf(\"%d\", max);\n  free(h);\n  free(p);\n  return 0;\n}\n"}
{"label": "10", "index": "18749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint missle[25];\nint n;\nint Intercept(int i, int j) {\n  int k, max = 1, sum = 1;\n  for (k = i + 1; k < j; k++) {\n    if (missle[k] <= missle[i] && missle[k] >= missle[j])\n      sum = Intercept(k, j) + 1;\n    else\n      continue;\n    if (sum > max)\n      max = sum;\n    sum = 1;\n  }\n  return max;\n}\nint main() {\n  int i, j, max = 1, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> missle[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (missle[j] <= missle[i]) {\n        sum = Intercept(i, j) + 1;\n      } else\n        continue;\n      if (sum > max)\n        max = sum;\n      sum = 0;\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint d[100], a[100];\nint i, j, k, n, ans;\n\nint main() {\n  cin >> n;\n  a[0] = 1000000000;\n  for (i = 1; i <= n; ++i)\n    cin >> a[i];\n  d[0] = 0;\n  ans = 0;\n  for (i = 1; i <= n; ++i) {\n    d[i] = 1;\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j] && d[j] + 1 > d[i])\n        d[i] = d[j] + 1;\n    if (d[i] > ans)\n      ans = d[i];\n  }\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint h[1000], k;\n\nint bp(int i, int height, int sum) {\n  if (i == k)\n    return sum;\n  if (h[i] <= height) {\n    int a1 = bp(i + 1, h[i], sum + 1);\n    int a2 = bp(i + 1, height, sum);\n    return (a1 > a2) ? a1 : a2;\n  }\n  return bp(i + 1, height, sum);\n}\n\nint main() {\n\n  scanf(\"%d \", &k);\n  for (int i = 0; i < k; i++)\n    scanf(\"%d \", &h[i]);\n\n  printf(\"%d\\n\", bp(0, 1000, 0));\n\n  return 0;\n}\n"}
{"label": "10", "index": "18752", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, a[100] = {0}, f[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      f[i] = 1;\n    else {\n      k = 0;\n      for (j = 0, k = 0; j < i; j++) {\n        if (a[i] <= a[j] && k < f[j])\n          k = f[j];\n      }\n      f[i] = k + 1;\n    }\n  }\n  for (i = 0, k = 1; i < n; i++) {\n    if (k < f[i])\n      k = f[i];\n  }\n  printf(\"%d \", k);\n}\n"}
{"label": "10", "index": "18753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint changdu(int i, int n, int *a, int *b) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j, n, a, b) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int a[25], b[25];\n  int n;\n  int max = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i, n, a, b);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, a[25], b[25];\n  int i, j, p, q;\n  int tmp, tmpmax, max;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (p = 1; p < k; p++) {\n    for (q = 0; q < p; q++) {\n      if (a[p] <= a[q]) {\n        tmp = b[q] + 1;\n        if (tmp > b[p])\n          b[p] = tmp;\n      }\n    }\n  }\n  max = 1;\n  for (j = 1; j < k; j++) {\n    if (b[j] > max)\n      max = b[j];\n  }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n];\n  int i, j, max = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int b[n];\n  for (i = 0; i < n; i++)\n    b[i] = 1;\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] <= a[i] && b[j] + 1 >= b[i])\n        b[i] = b[j] + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18756", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint dao[26], n;\nint fly(int high, int m) {\n  if (m == n)\n    return 0;\n  else {\n    if (high < dao[m])\n      return fly(high, m + 1);\n    else {\n      return max(fly(high, m + 1), fly(dao[m], m + 1) + 1);\n    }\n  }\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> dao[i];\n  k = fly(99999, 0);\n  printf(\"%d\", k);\n}\n"}
{"label": "10", "index": "18757", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[25], b[25], max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1)\n        b[i] = b[j] + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++)\n    max = (max > b[i]) ? max : b[i];\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint daodan[30];\nint res[30];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> daodan[i];\n    res[i] = 1;\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int j = n - 1; j > i; j--) {\n      if (daodan[i] >= daodan[j])\n        res[i] = max(res[i], res[j] + 1);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (res[i] > res[0])\n      res[0] = res[i];\n  }\n  cout << res[0] << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, a[100], b = 0, max_1 = 0;\n\nvoid fun(int x, int m) {\n  int i;\n  if (x == 0) {\n    if (b > max_1) {\n      max_1 = b;\n    }\n  } else if (a[x] < m)\n    fun(x - 1, m);\n  else if (a[x] >= m) {\n    for (i = x; i >= 1; i--) {\n      if (a[i] >= m) {\n        b++;\n        fun(i - 1, a[i]);\n        b--;\n      }\n    }\n  }\n}\n\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  fun(n, 0);\n  cout << max_1;\n}\n"}
{"label": "10", "index": "18760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a[25], b[25] = {0}, m, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i; j <= k - 1; j++)\n      if (a[i] >= a[j] && m <= b[j])\n        m = b[j];\n    b[i] = m + 1;\n  }\n  m = b[0];\n  for (i = 0; i <= k - 1; i++) {\n    if (m < b[i])\n      m = b[i];\n  }\n  printf(\"%d\", m);\n}\n"}
{"label": "10", "index": "18761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, k, i, j, a[25], b[25], max;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      b[i] = 1;\n    else {\n      max = 0;\n      for (j = i + 1; j <= k - 1; j++)\n        if (a[j] <= a[i] && b[j] >= max)\n          max = b[j];\n      b[i] = max + 1;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] >= max)\n      max = b[i];\n  }\n  cout << max;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\nint main() {\n  int i, j, n, m;\n  int a[100];\n  int f[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  f[0] = 1;\n  m = 0;\n  for (i = 1; i < n; i++)\n    for (j = i; j >= 0; j--) {\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n      if (f[i] > m)\n        m = f[i];\n    }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max_1[26] = {0};\nint a[26] = {0};\nvoid attack(int n) {\n  int i = 0, j = 0, premax_1 = 0;\n  for (i = 0; i < n; i++) {\n    max_1[i] = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j]) {\n        premax_1 = max_1[j] + 1;\n        if (premax_1 > max_1[i])\n          max_1[i] = premax_1;\n      }\n    }\n  }\n}\nint main() {\n  static int n, i, num = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  attack(n);\n  num = max_1[0];\n  for (i = 1; i < n; i++)\n    if (max_1[i] > num)\n      num = max_1[i];\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "10", "index": "18764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, mm, maxj, i, j, k, max;\n  scanf(\"%d\", &n);\n  int *height = (int *)malloc(sizeof(int) * n);\n  int *amount = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &height[i]);\n    amount[i] = 1;\n  }\n  max = 1;\n  for (j = n - 1; j >= 0; j--) {\n    maxj = 1;\n    for (k = j + 1; k < n; k++) {\n\n      if (height[j] >= height[k]) {\n        amount[j] = amount[k] + 1;\n        if (amount[j] >= maxj)\n          maxj = amount[j];\n      }\n    }\n    amount[j] = maxj;\n    if (maxj >= max) {\n      max = maxj;\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, max, final;\n  int tomb[26];\n  int num[26];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> tomb[i];\n  memset(num, 0, sizeof(num));\n  num[n - 1] = 1;\n  final = 0;\n  for (i = n - 2; i >= 0; i--) {\n    j = i + 1;\n    max = 0;\n    while (j < n) {\n      if (tomb[j] <= tomb[i] && num[j] > max)\n        max = num[j];\n      j++;\n    }\n    num[i] = max + 1;\n    if (num[i] > final)\n      final = num[i];\n  }\n  cout << final << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18766", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint k;\nint h[30], f[30], l;\n\nint main() {\n  int i;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", h + i);\n  }\n  l = 0;\n  for (i = k - 1; i >= 0; i--) {\n    if (l == 0 || f[l - 1] <= h[i])\n      f[l++] = h[i];\n    else {\n      int mid, left = 0, right = l - 1;\n      while (left < right) {\n        mid = (left + right) / 2;\n        if (h[i] >= f[mid]) {\n          left = mid + 1;\n        } else if (h[i] < f[mid])\n          right = mid - 1;\n      }\n      if (f[left] > h[i])\n        f[left] = h[i];\n      else\n        f[left + 1] = h[i];\n    }\n  }\n  printf(\"%d\\n\", l);\n}\n"}
{"label": "10", "index": "18767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k;\nint num[26];\nint val[26];\nint main() {\n\n  cin >> k;\n  for (int i = 0; i < k; i++) {\n    cin >> num[i];\n    val[i] = 0;\n  }\n  \n  \n  for (int i = k - 1; i >= 0; i--) {\n    if (i == k - 1)\n      val[i] = 1;\n    else {\n      int temp = 0;\n      for (int j = i; j < k; j++) {\n        if (num[i] >= num[j] && val[j] >= temp) {\n          temp = val[j];\n          \n          \n        }\n      }\n      val[i] = temp + 1;\n    }\n  }\n  int sum = 0;\n  for (int i = 0; i < k; i++) {\n    \n    if (val[i] >= sum)\n      sum = val[i];\n  }\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint co(int m[], int n[], int j, int e) {\n  int a, b, c;\n  b = m[j];\n  c = 0;\n  for (a = j + 1; a < e; a++) {\n    if (b >= m[a] && c <= n[a])\n      c = n[a];\n  }\n  return (c);\n}\nint main() {\n  int a, f, g, m[26], n[26], i, j;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  n[a - 1] = 1;\n  for (j = (a - 2); j >= 0; j--) {\n    n[j] = co(m, n, j, a) + 1;\n  }\n  f = 0;\n  for (g = 0; g < a; g++) {\n    if (n[g] >= f)\n      f = n[g];\n  }\n  cout << f;\n  return 0;\n}\n"}
{"label": "10", "index": "18769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[25], k, b[25];\n  cin >> k;\n  int max1;\n  \n  for (int i = 0; i < k; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (int j = k - 1; j >= 0; j--) {\n    max1 = 0;\n    for (int m = k - 1; m > j; m--) {\n      if (a[m] <= a[j] && b[m] >= max1)\n        max1 = b[m];\n    }\n    b[j] = max1 + 1;\n  }\n  int max;\n  max = b[0];\n  for (int n = 1; n < k; n++) {\n    if (max < b[n])\n      max = b[n];\n  }\n  cout << max << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, h[26], p[26], i, j, m, t, a[26][26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++)\n    p[i] = h[i];\n  for (i = 1; i < k; i++) {\n    m = i;\n    for (j = i + 1; j <= k; j++)\n      if (p[j] > p[m])\n        m = j;\n    t = p[i];\n    p[i] = p[m];\n    p[m] = t;\n  }\n\n  for (i = 0; i <= k; i++)\n    for (j = 0; j <= k; j++)\n      a[i][j] = 0;\n\n  for (i = 1; i <= k; i++)\n    for (j = 1; j <= k; j++) {\n      if (h[i] == p[j])\n        a[i][j] = a[i - 1][j - 1] + 1;\n      else {\n        if (a[i - 1][j] > a[i][j - 1])\n          a[i][j] = a[i - 1][j];\n        else\n          a[i][j] = a[i][j - 1];\n      }\n    }\n\n  cout << a[k][k];\n}\n"}
{"label": "10", "index": "18771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int num_lanjie[25];\n  int input[25];\n  for (int i = 0; i <= n - 1; i++) {\n    if (i == 0) {\n      cin >> input[i];\n    } else {\n      scanf(\" %d\", &input[i]);\n    }\n  }\n\n  num_lanjie[n - 1] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (int j = n - 1; j > i; j--) {\n      if (input[i] >= input[j] && max < num_lanjie[j]) {\n        max = num_lanjie[j];\n      }\n    }\n    num_lanjie[i] = max + 1;\n  }\n\n  int max = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    max = max > num_lanjie[i] ? max : num_lanjie[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[30], n;\nint max(int p, int q) {\n  if (p >= q)\n    return p;\n  else\n    return q;\n}\nint shot(int x, int y) {\n  if (x == n) {\n    if (a[x] <= y)\n      return 1;\n    else\n      return 0;\n  } else {\n    if (a[x] > y)\n      return (shot(x + 1, y));\n    else\n      return (max(shot(x + 1, y), shot(x + 1, a[x]) + 1));\n  }\n}\nint main() {\n  int i, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  m = shot(1, 9999);\n  cout << m;\n  return 0;\n}\n"}
{"label": "10", "index": "18773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, b[25], a[25], c, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i < k; i++) {\n    a[0] = 1;\n    c = 1;\n    for (j = 0; j < i; j++) {\n      if (b[i] < b[j]) {\n        if (a[j] > c) {\n          c = a[j];\n        }\n      }\n    }\n    a[i] = c + 1;\n  }\n  c = 0;\n  for (i = 0; i < k; i++) {\n    if (a[i] > c) {\n      c = a[i];\n    }\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "10", "index": "18774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a[], int k, int m) {\n  int ans = 1, tag = 1, i;\n  if (m < k - 1)\n    for (i = m + 1; i < k; i++)\n      if (a[i] <= a[m] && tag <= f(a, k, i)) {\n        ans = 1 + f(a, k, i);\n        tag = f(a, k, i);\n      }\n  return ans;\n}\nint main() {\n  int a[25], k, i, max;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n  }\n  max = f(a, k, 0);\n  for (i = 1; i < k; i++)\n    if (f(a, k, i) > max)\n      max = f(a, k, i);\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[25];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  while (i < n) {\n    scanf(\" %d\", &a[i]);\n    i++;\n  }\n  int b[25];\n  i = n - 2;\n  b[n - 1] = 1;\n  while (i >= 0) {\n    b[i] = 1;\n    int m = i + 1;\n    while (m < n) {\n      if ((a[m] <= a[i]) && (b[m] >= b[i] - 1)) {\n        b[i] = b[m] + 1;\n      }\n      m++;\n    }\n    i--;\n  }\n  int k = 1;\n  i = 0;\n  while (i < n) {\n    if (b[i] > k)\n      k = b[i];\n    i++;\n  }\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "18776", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j, count = 1, st = 0;\n  int num;\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max) {\n      max = flag[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint height[26];\n\nint cal(int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (height[N] >= height[i]) {\n      sub = cal(i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  height[0] = 10000000;\n  scanf(\"%d\", &height[1]);\n  for (i = 1; i <= k - 1; i++) {\n    scanf(\" %d\", &height[i + 1]);\n  }\n\n  cout << cal(0, k + 1) - 2;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint missle[25];\nint n;\nint Intercept(int i, int j) {\n  int k, max = 1, sum = 1;\n  for (k = i + 1; k < j; k++) {\n    if (missle[k] <= missle[i] && missle[k] >= missle[j])\n      sum = Intercept(k, j) + 1;\n    else\n      continue;\n    if (sum > max)\n      max = sum;\n    sum = 1;\n  }\n  return max;\n}\nint main() {\n  int i, j, max = 1, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &missle[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (missle[j] <= missle[i]) {\n        sum = Intercept(i, j) + 1;\n      } else\n        continue;\n      if (sum > max)\n        max = sum;\n      sum = 0;\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[25];\n  int rem[25] = {1};\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  int MMax = 0;\n  for (int i = 1; i < n; i++) {\n    int max = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (j < max)\n        break;\n      if (a[j] >= a[i] && rem[j] > max)\n        max = rem[j];\n    }\n    rem[i] = max + 1;\n    if (rem[i] > MMax)\n      MMax = rem[i];\n  }\n  cout << MMax << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint max(int x, int y) {\n  int z;\n  if (x >= y)\n    z = x;\n  else\n    z = y;\n  return (z);\n}\n\nint MAX_multi(int str[25], int n) {\n  int t = 0, i;\n  for (i = 0; i < n; i++)\n    t = max(t, str[i]);\n\n  return (t);\n}\n\nvoid count(int str[25], int num[25], int n) {\n  int i, j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > i; j--) {\n      if (str[i] >= str[j])\n        num[i] = max(num[i], num[j] + 1);\n    }\n  }\n  printf(\"%d\\n\", MAX_multi(num, n));\n}\n\nint main() {\n  int n, i, str[25], num[25] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n                                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &str[i]);\n  count(str, num, n);\n}\n"}
{"label": "10", "index": "18782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint lanjie(int m, int b[26], int lim) {\n  if (m == 1) {\n    if (b[0] <= lim)\n      return (1);\n    else\n      return (0);\n  } else if (m == 2) {\n    if (b[0] <= lim && b[1] <= b[0])\n      return (2);\n    else if (b[0] > lim && b[1] > lim)\n      return (0);\n    else\n      return (1);\n  } else {\n    if (b[0] <= lim)\n      return (lanjie(m - 1, &b[1], b[0]) + 1 >= lanjie(m - 1, &b[1], lim)\n                  ? lanjie(m - 1, &b[1], b[0]) + 1\n                  : lanjie(m - 1, &b[1], lim));\n    else\n      return (lanjie(m - 1, &b[1], lim));\n  }\n}\nint main() {\n  int a[26], i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  getchar();\n  printf(\"%d\\n\", lanjie(k, a, 32767));\n  return 0;\n}\n"}
{"label": "10", "index": "18783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[25], a[25], x = 0, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  for (k = 0; k < n; k++) {\n    b[k] = 0;\n    for (i = 0; i < k; i++) {\n      if (a[i] >= a[k]) {\n        if (b[i] > b[k])\n          b[k] = b[i];\n      }\n    }\n    b[k] = b[k] + 1;\n  }\n  for (l = 0; l < k; l++) {\n    if (b[l] > x) {\n      x = b[l];\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "10", "index": "18784", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, a[26], len[26];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; ++i)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < k; ++i)\n    len[i] = 1;\n  for (i = 1; i < k; ++i) {\n    for (j = 0; j < i; ++j)\n      if (a[i] <= a[j]) {\n        len[i] = len[j] + 1;\n        break;\n      }\n    for (l = j + 1; l < i; ++l)\n      if (len[l] >= len[i] && a[i] <= a[l]) {\n        len[i] = len[l] + 1;\n        continue;\n      }\n  }\n  for (i = 0; i < k; ++i)\n    if (len[i] > len[0])\n      len[0] = len[i];\n  printf(\"%d\", len[0]);\n}\n"}
{"label": "10", "index": "18785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sort(int a[], int k);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[25];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int d[25];\n  for (i = n - 1; i >= 0; i--) {\n    d[i] = 1;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j] && d[i] < d[j] + 1)\n        d[i] = d[j] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < n; i++)\n    if (d[i] > max)\n      max = d[i];\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, high[30], point, m, sum1, sum2, check;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++)\n    scanf(\"%d\", &high[m]);\n  for (check = 1; check == 1;) {\n    check = 0;\n    for (point = 0; point < n - 1; point++) {\n      if (high[point] < high[point + 1]) {\n        check = 1;\n        for (m = 0, sum1 = 0; m < point; m++)\n          if (high[m] < high[point + 1])\n            sum1++;\n        for (m = point + 2, sum2 = 0; m < n; m++)\n          if (high[m] > high[point]) {\n            sum2++;\n          }\n        if (sum1 > sum2) {\n          for (m = point + 1; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n        } else {\n          for (m = point; m < n - 1; m++) {\n            high[m] = high[m + 1];\n          }\n          point--;\n        }\n        n--;\n      }\n    }\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18787", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k;\n  int n = 1, i = 0, j = 0;\n  scanf(\"%d\", &k);\n  int *a = (int *)malloc(k * sizeof(int));\n  int *b = (int *)malloc(k * sizeof(int));\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = k - 1; i >= 0; i--) {\n    for (j = k - 1; j > i; j--) {\n      if (a[i] >= a[j])\n        b[i] = b[i] > b[j] ? b[i] : b[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    n = n > b[i] ? n : b[i];\n  }\n  printf(\"%d\", n);\n  free(a);\n  free(b);\n  return 0;\n}\n"}
{"label": "10", "index": "18788", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nenum { MAX_NUM = 25 };\n\nint main() {\n  int missle_num = 0;\n\n  int height[MAX_NUM][2];\n  int i, j;\n  int max = 0;\n  cin >> missle_num;\n\n  for (i = 0; i < missle_num; i++) {\n    cin >> height[i][0];\n    height[i][1] = 1;\n  }\n\n  for (i = 0; i < missle_num; i++) {\n  }\n\n  for (i = 0; i < missle_num; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (height[i][0] <= height[j][0]) {\n        if (height[i][1] < height[j][1] + 1) {\n          height[i][1] = height[j][1] + 1;\n        }\n      }\n    }\n  }\n\n  max = 0;\n  for (i = 0; i < missle_num; i++) {\n\n    if (max < height[i][1]) {\n      max = height[i][1];\n    }\n  }\n  printf(\"\\n%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num_lanjie[25];\n  int input[25];\n  for (int i = 0; i <= n - 1; i++) {\n    if (i == 0) {\n      scanf(\"%d\", &input[i]);\n    } else {\n      scanf(\" %d\", &input[i]);\n    }\n  }\n  \n  \n  num_lanjie[n - 1] = 1;\n  for (int i = n - 2; i >= 0; i--) {\n    int max = 0;\n    for (int j = n - 1; j > i; j--) {\n      if (input[i] >= input[j] && max < num_lanjie[j]) {\n        max = num_lanjie[j];\n      }\n    }\n    num_lanjie[i] = max + 1;\n  }\n  \n  int max = 0;\n  for (int i = 0; i <= n - 1; i++) {\n    max = max > num_lanjie[i] ? max : num_lanjie[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[100];\n\nint f(int a[], int n, int min) {\n  if (n == 1) {\n    if (a[0] >= min)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a[n - 1] < min)\n      return (f(a, n - 1, min));\n    else if (f(a, n - 1, a[n - 1]) + 1 < f(a, n - 1, min))\n      return (f(a, n - 1, min));\n    else\n      return (f(a, n - 1, a[n - 1]) + 1);\n  }\n}\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int result;\n  result = f(a, n, 0);\n  cout << result;\n  return 0;\n}\n"}
{"label": "10", "index": "18791", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num[30];\nint dst[30];\n\nint main() {\n  memset(dst, 0, sizeof(dst));\n  int n;\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  dst[0] = 1;\n  int temp, max;\n  for (int i = 1; i < n; i++) {\n    max = 1;\n    for (int j = 0; j < i; j++) {\n\n      if (num[i] <= num[j]) {\n        temp = dst[j] + 1;\n        if (max < temp)\n          max = temp;\n      }\n    }\n    dst[i] = max;\n  }\n  max = 0;\n  for (int i = 0; i < n; i++) {\n\n    if (max < dst[i])\n      max = dst[i];\n  }\n\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18792", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int height[50], flag[50], max, i, j;\n  int num;\n\n  scanf(\"%d\", &num);\n\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &height[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (height[j] >= height[i]) {\n        if (flag[j] + 1 > flag[i])\n          flag[i] = flag[j] + 1;\n      }\n    }\n  }\n\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max)\n      max = flag[i];\n  }\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18793", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint *h;\nint *m;\nint max_1 = 0;\n\nvoid calc(int num) {\n  int i;\n  *(m + num) = 1;\n  for (i = num + 1; i <= n - 1; i++)\n    if (*(h + i) <= *(h + num))\n      if (*(m + i) + 1 > *(m + num))\n        *(m + num) = *(m + i) + 1;\n  if (*(m + num) > max_1)\n    max_1 = *(m + num);\n}\n\nint main() {\n  int i;\n  scanf(\"%d\", &n);\n  h = (int *)malloc(sizeof(int) * n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", h + i);\n  *(m + n - 1) = 1;\n  for (i = n - 2; i >= 0; i--)\n    calc(i);\n  printf(\"%d\", max_1);\n  return 0;\n}\n"}
{"label": "10", "index": "18794", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct {\n  int file;\n  int reign;\n} missile;\nint main() {\n  int n, i, j, max = 0;\n  missile a[30];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i].file);\n  }\n  a[n].reign = 1;\n  for (i = n - 1; i >= 1; i--) {\n    a[i].reign = 1;\n    for (j = i + 1; j <= n; j++) {\n      if (a[j].file <= a[i].file) {\n        if (a[j].reign + 1 > a[i].reign) {\n          a[i].reign = a[j].reign + 1;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i].reign > max) {\n      max = a[i].reign;\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0};\n  int f[50], max, i, j, n;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  f[0] = 1;\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n    f[i] = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        if (f[j] + 1 > f[i])\n          f[i] = f[j] + 1;\n        else\n          f[i] = f[i];\n      }\n    }\n  }\n  max = f[0];\n  for (i = 1; i < n; i++) {\n    if (f[i] > max)\n      max = f[i];\n  }\n  printf(\"%d \", max);\n}\n"}
{"label": "10", "index": "18796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int m);\nint s[30];\nint main() {\n  int a[100], k, i, n;\n  for (i = 0; i < 30; i++)\n    s[i] = 1;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d\", &a[i]);\n\n  a[k + 1] = 100000;\n  n = max(a, k + 1);\n  cout << n - 1 << \"\\n\";\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && t < max(a, i))\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "18797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d \", &k);\n  int a[k], f[k], s = 0;\n  for (int i = 0; i < k; i++)\n    f[i] = 1;\n  for (int i = 0; i < k; i++)\n    cin >> a[i];\n  for (int i = k - 2; i >= 0; i--) {\n    for (int j = k - 1; j > i; j--)\n      if (a[i] >= a[j] && f[i] < f[j] + 1)\n        f[i] = f[j] + 1;\n    if (s < f[i])\n      s = f[i];\n  }\n  cout << s;\n}\n"}
{"label": "10", "index": "18798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) {\n  int c;\n  c = a > b ? a : b;\n  return (c);\n}\nint main() {\n  int i, j, n, m;\n  int a[100];\n  int f[100];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    f[i] = 0;\n  f[0] = 1;\n  m = 0;\n  for (i = 1; i < n; i++) {\n    for (j = i; j >= 0; j--) {\n      if (a[i] <= a[j])\n        f[i] = max(f[i], f[j] + 1);\n      if (f[i] > m)\n        m = f[i];\n    }\n  }\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "10", "index": "18799", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint max(int *data, int lens) {\n  int r = *data;\n  for (int j = 0; j < lens; j++)\n    if (*(data + j) > r)\n      r = *(data + j);\n  return r;\n}\nint f(int *data, int lens, int height) {\n  int tempResult[25];\n  if (lens == 0)\n    return 0;\n  int count = 0, tempHeight = 0;\n  for (int i = 0; i < lens; i++) {\n    if (data[i] <= height && data[i] >= tempHeight) {\n      tempHeight = data[i];\n      tempResult[count] = f(data + i + 1, lens - i - 1, data[i]);\n      count++;\n    }\n  }\n  if (count == 0)\n    return 0;\n  return max(tempResult, count) + 1;\n}\n\nint main() {\n  int data[25];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> data[i];\n  printf(\"%d\", f(data, n, max(data, n)));\n\n  return 0;\n}\n"}
{"label": "10", "index": "18800", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000], i, j, n, b[1000], max = 0;\n  scanf(\"%d\", &n);\n  for (i = n - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] >= a[j] && b[i] < b[j] + 1) {\n        b[i] = b[j] + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (max < b[i])\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max(int x, int y) {\n  if (x > y)\n    return x;\n  else\n    return y;\n}\nint main() {\n  int num[30];\n  int r = 0;\n  int dp[30] = {0};\n\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> num[i];\n    dp[i] = 1;\n  }\n  for (int i = 2; i <= n; i++)\n    for (int j = 1; j < i; j++)\n      if (num[i] <= num[j]) {\n        dp[i] = max(dp[i], dp[j] + 1);\n        if (dp[i] > r)\n          r = dp[i];\n      }\n  printf(\"%d\", r);\n}\n"}
{"label": "10", "index": "18802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50] = {0}, flag[50], max, i, j, count = 1, st = 0;\n  int num;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d\", &a[i]);\n    flag[i] = 1;\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] >= a[i]) {\n        flag[i] = flag[j] + 1 > flag[i] ? flag[j] + 1 : flag[i];\n      }\n    }\n  }\n  max = flag[0];\n  for (i = 1; i < num; i++) {\n    if (flag[i] > max) {\n      max = flag[i];\n    }\n  }\n  printf(\"%d\\n\", max);\n}\n"}
{"label": "10", "index": "18803", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar f(int max, int a[], char m, char n) {\n  char num1, num2;\n  if (m == n && a[n - 1] <= max)\n    return (1);\n  else if (m == n && a[n - 1] > max)\n    return (0);\n  else {\n    if (a[m - 1] <= max) {\n      num1 = f(max, a, m + 1, n);\n      num2 = f(a[m - 1], a, m + 1, n) + 1;\n      if (num1 > num2)\n        return (num1);\n      else\n        return (num2);\n    } else\n      return (f(max, a, m + 1, n));\n  }\n}\n\nint main() {\n  int hmax = (unsigned)(~0) >> 1;\n  int h[1000];\n  char n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &h[i]);\n  printf(\"%d \", f(hmax, h, 1, n));\n  printf(\"input: \");\n  for (i = 0; i < n; i++)\n    printf(\"%d,\", h[i]);\n}\n"}
{"label": "10", "index": "18804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int dp[50];\n  int m[50];\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  for (int i = 0; i < n; i++)\n    dp[i] = 1;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (m[i] <= m[j])\n        dp[i] = max(dp[j] + 1, dp[i]);\n    }\n  }\n  int maxl = 0;\n  for (int i = 0; i < n; i++)\n    if (dp[i] > maxl)\n      maxl = dp[i];\n  cout << maxl;\n}\n"}
{"label": "10", "index": "18805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[100] = {0}, a[100];\n  int n, i, j, max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--) {\n    if (i == n - 1)\n      sum[i] = 1;\n    else {\n      for (j = i + 1; j <= n - 1; j++)\n        if (a[j] <= a[i]) {\n          if (sum[j] > max)\n            max = sum[j];\n        }\n      sum[i] = ++max;\n      max = 0;\n    }\n  }\n  max = 0;\n  for (i = 0; i <= n - 1; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n    }\n  cout << max;\n  return 0;\n}\n"}
{"label": "10", "index": "18806", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, height[25], len[25], num[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    len[i] = 0;\n  for (i = n - 1; i >= 0; i--) {\n    m = 0;\n    for (j = i + 1; j <= n - 1; j++)\n      if (height[j] <= height[i]) {\n        num[m] = j;\n        m++;\n      }\n    for (k = 0; k <= m - 1; k++)\n      if (len[i] < len[num[k]])\n        len[i] = len[num[k]];\n    len[i]++;\n  }\n  m = 0;\n  for (i = 0; i < n; i++)\n    if (len[i] > m)\n      m = len[i];\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k[25], n;\nint f(int max, int i, int sum) {\n  int p, q = 0;\n  if (i == n)\n    return sum;\n  else {\n    p = f(max, i + 1, sum);\n    if (max > k[i + 1])\n      q = f(k[i + 1], i + 1, sum + 1);\n    return p > q ? p : q;\n  }\n}\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &k[i]);\n  printf(\"%d\", f(2147483647, 0, 0));\n  return 0;\n}\n"}
{"label": "10", "index": "18808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[i]);\n    else\n      scanf(\" %d\", &a[i]);\n  }\n  int n[25];\n  for (i = 0; i <= 24; i++)\n    n[i] = 1;\n  n[k - 1] = 1;\n  int j, m;\n  for (j = k - 2; j >= 0; j--) {\n    for (m = k - 1; m >= j + 1; m--) {\n\n      if (a[m] <= a[j] && n[m] >= n[j] - 1)\n        n[j] = n[m] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < n[i]) {\n      max = n[i];\n    }\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a, int b) {\n  if (a > b)\n    return a;\n  else\n    return b;\n}\nint solve(int k, int h, int *p, int n) {\n  if (k == n)\n    return 0;\n  if (p[k] == h)\n    return 1 + solve(k + 1, h, p, n);\n  if (p[k] > h)\n    return solve(k + 1, h, p, n);\n  return max(solve(k + 1, h, p, n), 1 + solve(k + 1, p[k], p, n));\n}\nint main() {\n  int n;\n  int p[25];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &p[i]);\n  }\n  cout << solve(0, 100000, p, n);\n  return 0;\n}\n"}
{"label": "10", "index": "18810", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100] = {0}, maxlen[100] = {0}, i, j, temp, temp2 = 1, temp3;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    temp2 = 1;\n    if (i == 0)\n      maxlen[i] = 1;\n    else {\n      temp3 = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (a[j] >= a[i]) {\n          if (maxlen[j] > maxlen[temp3])\n            temp3 = j;\n          temp2 = 0;\n        }\n      }\n      maxlen[i] = maxlen[temp3] + 1;\n      if (temp2 == 1)\n        maxlen[i] = 1;\n    }\n  }\n  temp = 0;\n  for (i = 0; i < n; i++)\n    if (maxlen[i] > maxlen[temp])\n      temp = i;\n  printf(\"%d\", maxlen[temp]);\n}\n"}
{"label": "10", "index": "18811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint dd(int no, float h);\nint n, a[25];\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\\n\", dd(1, 10000));\n  return 0;\n}\nint dd(int no, float h) {\n  while (h < a[no - 1]) {\n    if (no == n)\n      break;\n    no++;\n  }\n  if (no == n) {\n    if (h >= a[n - 1]) {\n      return 1;\n    } else {\n      return 0;\n    }\n  } else {\n    int b = dd(no + 1, a[no - 1]);\n    int c = dd(no + 1, h);\n    if (b >= c) {\n      return b + 1;\n    } else\n      return c;\n  }\n}\n"}
{"label": "10", "index": "18812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int MAXN = 25 + 2;\nint n;\nint a[MAXN], f[MAXN];\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 0; i < n; i++) {\n    f[i] = 0;\n    for (int j = 0; j < i; j++)\n      if (a[j] >= a[i] && f[j] > f[i])\n        f[i] = f[j];\n    f[i]++;\n  }\n  int max = 0;\n  for (int i = 0; i < n; i++)\n    if (f[i] > max)\n      max = f[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int a[], int n, int high) {\n  int c, b;\n  if (n == 0) {\n    if (a[0] > high)\n      return 0;\n    else\n      return 1;\n  } else if (a[n] > high)\n    return max(a, n - 1, high);\n  else {\n    c = max(a, n - 1, a[n]) + 1;\n    b = max(a, n - 1, high);\n    if (c > b)\n      return c;\n    else\n      return b;\n  }\n}\nint main() {\n  int n, i;\n  int a[25];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[n - i - 1];\n  cout << max(a, n, 32767);\n}\n"}
{"label": "10", "index": "18814", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint height[25];\n\nint stop(int k);\nint main() {\n\n  scanf(\"%d \", &n);\n  int i, MAX = 0;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++) {\n    if (MAX < stop(i)) {\n      MAX = stop(i);\n    }\n  }\n  cout << MAX;\n  return 0;\n}\n\nint stop(int k) {\n  int j, max = 0;\n  for (j = k + 1; j < n; j++) {\n    if (height[j] <= height[k]) {\n      if (max < stop(j))\n        max = stop(j);\n    }\n  }\n  return max + 1;\n}\n"}
{"label": "10", "index": "18815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint height[26];\nint x;\nint cmp(int a, int b) { return (a > b ? a : b); }\nint max(int a, int b) {\n  int cmp(int a, int b);\n  if (b == x) {\n    if (a >= height[x])\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a < height[b])\n      return (max(a, b + 1));\n    else\n      return (cmp(max(a, b + 1), (1 + max(height[b], b + 1))));\n  }\n}\n\nint main() {\n  int max(int, int);\n  int i;\n  scanf(\"%d\", &x);\n  for (i = 0; i < x; i++) {\n    scanf(\"%d\", &height[i]);\n  }\n  x--;\n  printf(\"%d\", max(1000000, 0));\n}\n"}
{"label": "10", "index": "18816", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m[100] = {0};\n  int min = 0;\n  int ans[100] = {0};\n  int k = 0;\n  scanf(\"%d \", &k);\n  for (int i = 0; i <= k - 1; i++) {\n    cin >> m[i];\n  }\n  ans[0] = 1;\n  int temp = 0;\n  for (int i = 1; i <= k - 1; i++) {\n    temp = 0;\n    for (int j = i - 1; j >= 0; j--) {\n      if (m[j] >= m[i]) {\n        if (temp < ans[j])\n          temp = ans[j];\n      }\n    }\n    ans[i] = temp + 1;\n  }\n  int max = 0;\n  for (int i = 0; i <= k - 1; i++) {\n    if (max < ans[i])\n      max = ans[i];\n  }\n  cout << max << endl;\n}\n"}
{"label": "10", "index": "18817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int a[25], i;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == 0)\n      scanf(\"%d\", &a[i]);\n    else {\n      scanf(\" %d\", &a[i]);\n    }\n  }\n  int n[25];\n  for (i = 0; i <= 24; i++)\n    n[i] = 1;\n  n[k - 1] = 1;\n  int j, m;\n  for (j = k - 2; j >= 0; j--) {\n    for (m = k - 1; m >= j + 1; m--) {\n\n      if (a[m] <= a[j] && n[m] >= n[j] - 1)\n        n[j] = n[m] + 1;\n    }\n  }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (max < n[i]) {\n      max = n[i];\n    }\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18818", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint changdu(int i, int n, int *a, int *b) {\n  int j, max = 1;\n  for (j = i + 1; j < n; j++) {\n    if (a[i] >= a[j]) {\n      b[i] = changdu(j, n, a, b) + 1;\n      if (b[i] > max)\n        max = b[i];\n    }\n  }\n  b[i] = max;\n  return max;\n}\nint main() {\n  int a[25], b[25];\n  int n;\n  int max = 0, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = changdu(i, n, a, b);\n  for (i = 0; i < n; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[26], b[26], k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = 1;\n  k = 1;\n  for (j = 1; j < n; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j]) {\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n      }\n    }\n    if (b[j] > k)\n      k = b[j];\n  }\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, max = 0, maxb = 0;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(n * sizeof(int));\n  int *b = (int *)calloc(n, sizeof(int));\n\n  for (i = (n - 1); i >= 0; i--)\n    scanf(\"%d\", &a[i]);\n  b[0] = 1;\n\n  for (i = 1; i <= (n - 1); i++) {\n    max = 0;\n\n    for (j = 0; j <= (i - 1); j++) {\n      if (a[i] >= a[j] && b[j] > max) {\n\n        max = b[j];\n      }\n    }\n    b[i] = max + 1;\n  }\n\n  for (i = 1; i <= (n - 1); i++) {\n    if (b[i] > maxb)\n      maxb = b[i];\n  }\n  cout << maxb;\n}\n"}
{"label": "10", "index": "18821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, sum[25] = {0}, a[25] = {0}, k, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < k; i++)\n    sum[i] = 1;\n  for (i = k - 1; i >= 1; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (sum[i] >= sum[j] && a[j] >= a[i])\n        sum[j] = sum[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (sum[i] > max)\n      max = sum[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18822", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[25], b[25], k, i, j, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i]) {\n        b[i] = b[j] + 1;\n      }\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18823", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, d;\n  scanf(\"%d \", &n);\n  int *p = (int *)malloc(n * sizeof(int));\n  int *q = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  q[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    q[i] = 1;\n    d = 0;\n    for (j = i + 1; j < n; j++) {\n      if (p[i] >= p[j])\n        if (d < q[j])\n          d = q[j];\n    }\n    q[i] = q[i] + d;\n  }\n  for (i = 0; i < n; i++)\n    if (d < q[i])\n      d = q[i];\n  printf(\"%d \", d);\n}\n"}
{"label": "10", "index": "18824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100];\n\nint f(int a[], int n, int min) {\n  if (n == 1) {\n    if (a[0] >= min)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (a[n - 1] < min)\n      return (f(a, n - 1, min));\n    else if (f(a, n - 1, a[n - 1]) + 1 < f(a, n - 1, min))\n      return (f(a, n - 1, min));\n    else\n      return (f(a, n - 1, a[n - 1]) + 1);\n  }\n}\n\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  int result;\n  result = f(a, n, 0);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "10", "index": "18825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, t, a[10000], f[10000], ans = 0;\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &a[i]);\n    t = 0;\n    for (j = 1; j < i; j++)\n      if (a[i] <= a[j] && f[j] > t)\n        t = f[j];\n    f[i] = t + 1;\n    if (f[i] > ans)\n      ans = f[i];\n  }\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "10", "index": "18826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k;\n  scanf(\"%d\", &k);\n  int(*p) = (int *)malloc(k * sizeof(int));\n  int(*q) = (int *)malloc(k * sizeof(int));\n  int i, j, t;\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &p[i]);\n    q[i] = 1;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < i; j++) {\n      t = 0;\n      if (p[j] >= p[i]) {\n        t = q[j] + 1;\n        if (t >= q[i]) {\n          q[i] = t;\n        }\n      }\n    }\n  int max = 0;\n  for (i = 0; i < k; i++) {\n    if (q[i] > max) {\n      max = q[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18827", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, i1, k, imax = 0;\n  int a[26];\n  int b[26];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[n] = 0;\n  b[n - 1] = 1;\n\n  for (i = n - 2; i >= 0; i--) {\n    imax = n;\n    for (i1 = i + 1; i1 < n; i1++) {\n      if (b[i1] > b[imax] && a[i] >= a[i1]) {\n        imax = i1;\n      }\n    }\n    b[i] = b[imax] + 1;\n  }\n\n  for (i = 0, k = 0; i < n; i++) {\n    if (b[i] > k) {\n      k = b[i];\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "10", "index": "18828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30], b[30], n, i, j, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 30; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = n - 2; i >= 0; i--) {\n    d = 0;\n    for (j = i + 1; j < n; j++)\n      if (a[i] >= a[j])\n        if (b[j] > d)\n          d = b[j];\n    b[i] = b[i] + d;\n  }\n  c = b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] > c)\n      c = b[i];\n  printf(\"%d\", c);\n  getchar();\n  getchar();\n}\n"}
{"label": "10", "index": "18829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, p, h[100] = {0}, m[100] = {0}, max = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if ((h[j] <= h[i]) && (m[i] < m[j] + 1)) {\n        m[i] = m[j] + 1;\n      }\n    }\n  }\n  for (p = 0; p < k; p++) {\n    if (m[p] > max) {\n      max = m[p];\n    }\n  }\n  printf(\"%d\", max + 1);\n  return 0;\n}\n"}
{"label": "10", "index": "18830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, i, j;\n  scanf(\"%d\", &N);\n  int a[100], b[100], max = 0;\n  memset(b, 0, sizeof(b));\n  for (i = 0; i < N; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] <= a[j])\n        b[i] = (b[j] + 1) > b[i] ? (b[j] + 1) : b[i];\n    }\n    max = max > b[i] ? max : b[i];\n  }\n  printf(\"%d\", max + 1);\n}\n"}
{"label": "10", "index": "18831", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, height[30], num[30], j, max = -1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> height[i];\n  for (i = 0; i < n; i++)\n    num[i] = 1;\n  for (i = 1; i < n; i++)\n    for (j = i - 1; j >= 0; j--) {\n      if (height[j] >= height[i] && num[j] + 1 > num[i])\n        num[i] = num[j] + 1;\n    }\n  for (i = 1; i < n; i++)\n    if (num[i] > max)\n      max = num[i];\n  cout << max << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, h[26], p[26], i, j, m, t, a[26][26];\n  scanf(\"%d\", &k);\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &h[i]);\n  for (i = 1; i <= k; i++)\n    p[i] = h[i];\n  for (i = 1; i < k; i++) {\n    m = i;\n    for (j = i + 1; j <= k; j++)\n      if (p[j] > p[m])\n        m = j;\n    t = p[i];\n    p[i] = p[m];\n    p[m] = t;\n  }\n  \n  for (i = 0; i <= k; i++)\n    for (j = 0; j <= k; j++)\n      a[i][j] = 0;\n  \n  for (i = 1; i <= k; i++)\n    for (j = 1; j <= k; j++) {\n      if (h[i] == p[j])\n        a[i][j] = a[i - 1][j - 1] + 1;\n      else {\n        if (a[i - 1][j] > a[i][j - 1])\n          a[i][j] = a[i - 1][j];\n        else\n          a[i][j] = a[i][j - 1];\n      }\n    }\n  \n  printf(\"%d\", a[k][k]);\n}\n"}
{"label": "10", "index": "18833", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint height[26];\n\nint cal(int N, int M) {\n  int i, max, sub;\n  max = 0;\n  if (M == 0) {\n    return 1;\n  }\n  for (i = N + 1; i <= N + M; i++) {\n    if (height[N] >= height[i]) {\n      sub = cal(i, N + M - i);\n      if (sub >= max) {\n        max = sub;\n      }\n    }\n  }\n  return max + 1;\n}\n\nint main() {\n  int k, i;\n  scanf(\"%d\\n\", &k);\n  height[0] = 10000000;\n  cin >> height[1];\n  for (i = 1; i <= k - 1; i++) {\n    cin >> height[i + 1];\n  }\n\n  printf(\"%d\", cal(0, k + 1) - 2);\n\n  return 0;\n}\n"}
{"label": "10", "index": "18834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[100], mark[100] = {0}, max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  mark[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] <= num[i] && mark[j] > max) {\n        max = mark[j];\n      }\n    }\n    mark[i] = max + 1;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (mark[i] > max) {\n      max = mark[i];\n    }\n  }\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfC(const void *x, const void *y) {\n  int t;\n  t = *((int *)x) - *((int *)y);\n  return -t;\n}\nint main() {\n  int n, t, i, j, a[25], b[25];\n  scanf(\"%d\", &n);\n\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d\", &a[k]);\n    b[k] = 0;\n  }\n  b[n - 1] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] >= a[j]) {\n        if (b[i] < b[j])\n          b[i] = b[j];\n      }\n    }\n    b[i]++;\n  }\n  qsort(b, n, sizeof(int), pfC);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "10", "index": "18836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int maxsize = 26;\nint maxnum(int *r, int n) {\n  int ans = 1;\n  int i, j, temp;\n  int maxlen[maxsize];\n  maxlen[0] = 1;\n  for (i = 1; i < n; i++) {\n    temp = 0;\n    for (j = 0; j < i; j++) {\n      if (r[j] >= r[i]) {\n        if (maxlen[j] > temp)\n          temp = maxlen[j];\n      }\n    }\n    maxlen[i] = temp + 1;\n    if (ans < maxlen[i])\n      ans = maxlen[i];\n  }\n  return ans;\n}\nint main() {\n  int i, k;\n  int r[maxsize];\n  scanf(\"%d \", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", r + i);\n  cout << maxnum(r, k) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, t;\n  int *p, *max;\n  scanf(\"%d\", &k);\n  p = (int *)malloc(k * sizeof(int));\n  max = (int *)malloc(k * sizeof(int));\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", p + i);\n  for (i = 0; i <= k - 1; i++) {\n    t = 0;\n    for (j = 0; j < i; j++)\n      if (*(p + j) >= *(p + i))\n        if (t < *(max + j))\n          t = *(max + j);\n    *(max + i) = t + 1;\n  }\n  t = 0;\n  for (i = 0; i <= k - 1; i++)\n    if (*(max + i) > t)\n      t = *(max + i);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "10", "index": "18838", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[], int n);\n  int a[30], n, i, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  s = f(a, n);\n  printf(\"%d\", s);\n}\n\nint f(int a[], int n) {\n  int max(int x, int y);\n  int g(int a[], int n, int b);\n  if (n == 0)\n    return (0);\n  else\n    return (max(g(a + 1, n - 1, a[0]) + 1, f(a + 1, n - 1)));\n}\n\nint g(int a[], int n, int b) {\n  int max(int x, int y);\n  if (n == 0)\n    return (0);\n  else if (n == 1)\n    if (a[0] > b)\n      return (0);\n    else\n      return (1);\n  else if (a[0] > b) {\n    return (g(a + 1, n - 1, b));\n  } else\n    return (max(g(a + 1, n - 1, b), g(a + 1, n - 1, a[0]) + 1));\n}\nint max(int x, int y) { return (x > y ? x : y); }\n"}
{"label": "10", "index": "18839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, x;\n  scanf(\"%d\", &k);\n  int h[k];\n  int a[k];\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &h[i]);\n  }\n  for (x = 0; x < k; x++) {\n    a[x] = 1;\n  }\n  int c, d;\n  for (c = k - 2; c >= 0; c--) {\n    for (d = c + 1; d < k; d++) {\n\n      if ((h[c] >= h[d]) && (a[d] >= a[c]))\n        a[c] = a[d] + 1;\n    }\n  }\n  int y = 1;\n  int m;\n  for (m = 0; m < k; m++) {\n    if (a[m] > y) {\n      y = a[m];\n    }\n  }\n  printf(\"%d\", y);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint p(int n, int heightLimit, int *missileHeight, int missileNum) {\n  int a;\n  int b;\n\n  if (n == missileNum - 1)\n    if (missileHeight[n] <= heightLimit)\n      return 1;\n    else\n      return 0;\n  else if (missileHeight[n] <= heightLimit) {\n    a = 1 + p(n + 1, missileHeight[n], missileHeight, missileNum);\n    b = p(n + 1, heightLimit, missileHeight, missileNum);\n    return a > b ? a : b;\n  } else\n    return p(n + 1, heightLimit, missileHeight, missileNum);\n}\n\nint main() {\n  int n, i, j;\n  int *missileHeight;\n  int highest = -1;\n  cin >> n;\n  missileHeight = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(missileHeight[i]));\n    if (missileHeight[i] > highest)\n      highest = missileHeight[i];\n  }\n  cout << p(0, highest, missileHeight, n);\n  return 0;\n}\n"}
{"label": "10", "index": "18841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint k;\nint a[25] = {0};\nint b[25] = {0};\n\nint main() {\n  scanf(\"%d \", &k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  int n = 0;\n  for (j = 0; j < k; j++) {\n    b[j] = 1;\n    for (i = 0; i < j; i++) {\n      if (a[i] >= a[j])\n        if (b[i] + 1 > b[j])\n          b[j] = b[i] + 1;\n    }\n  }\n  for (i = 0; i < k; i++)\n    if (n <= b[i])\n      n = b[i];\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "10", "index": "18842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int p[], int n) {\n  int t, m = 0;\n  m = p[0];\n  p[0] = 0;\n  for (t = 0; t < n; t++) {\n    if (m < p[t])\n      m = p[t];\n    p[t] = 0;\n  }\n  return m;\n}\nint main() {\n  int m, t, p = 0, k, n;\n  int c[25];\n  scanf(\"%d\", &m);\n  int *a = (int *)malloc(m * sizeof(int));\n  int *b = (int *)malloc(m * sizeof(int));\n  for (t = 0; t < m; t++)\n    cin >> a[t];\n  b[m - 1] = 1;\n  for (t = (m - 2); t > (-1); t--) {\n    for (n = (t + 1); n < m; n++) {\n      if (a[t] >= a[n]) {\n        c[p] = b[n];\n        p++;\n      }\n    }\n    b[t] = max(c, p) + 1;\n    p = 0;\n  }\n  k = max(b, m);\n  cout << k;\n  return 0;\n}\n"}
{"label": "10", "index": "18843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, tmp;\n  int high[30] = {0};\n  int a[30] = {1};\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &high[i]);\n  }\n  for (i = 0; i < 30; i++) {\n    a[i] = 1;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j > i; j--) {\n      if (high[j] <= high[i]) {\n        if (a[j] + 1 > a[i])\n          a[i] = a[j] + 1;\n      }\n    }\n  }\n  tmp = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] > tmp)\n      tmp = a[i];\n  }\n  printf(\"%d\", tmp);\n  return 0;\n}\n"}
{"label": "10", "index": "18844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[27] = {0}, b[27] = {0}, k, i, j, m = 1;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (i = 1; i < k; i++)\n    for (j = 0; j < i; j++)\n      if (a[j] >= a[i] && b[j] + 1 > b[i])\n        b[i] = b[j] + 1;\n  for (i = 0; i < k; i++) {\n    if (b[i] > m) {\n      m = b[i];\n    }\n  }\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "10", "index": "18845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(int a[], int m);\nint s[30] = {0};\nint main() {\n  int a[100], k, i, n;\n  scanf(\"%d\", &k);\n  for (i = k; i > 0; i--)\n    scanf(\"%d \", &a[i]);\n  a[k + 1] = 10000;\n  n = max(a, k + 1);\n  cout << n - 1 << \"\\n\";\n}\n\nint max(int a[], int m) {\n  int x, i, t = 0;\n  x = a[m];\n  if (m == 1)\n    return (1);\n  else {\n    for (i = m - 1; i > 0; i--) {\n      if (x >= a[i] && max(a, i) > t)\n        t = max(a, i);\n    }\n    return (t + 1);\n  }\n}\n"}
{"label": "10", "index": "18846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(int b[26]) {\n  int l, m;\n  for (l = 1; l < 25; l++) {\n    for (m = l + 1; m < 26; m++)\n      if (b[l] < b[m]) {\n        int s;\n        s = b[l];\n        b[l] = b[m];\n        b[m] = s;\n      }\n  }\n  return b[1];\n}\nint main() {\n  int a[26] = {0}, b[26] = {0}, i, j, k, l, m;\n  scanf(\"%d\", &k);\n  scanf(\"%d\", &a[1]);\n  b[1] = 1;\n  for (i = 2; i <= k; i++) {\n    scanf(\" %d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = k - 1; j > 0; j--) {\n    int c[26] = {0}, s = 1;\n    for (l = j + 1; l <= k; l++) {\n      if (a[j] >= a[l]) {\n        c[s] = b[l];\n        s++;\n      }\n    }\n    m = max(c);\n    b[j] = b[j] + m;\n  }\n  cout << max(b) << \"\\n\";\n  return 0;\n}\n"}
{"label": "10", "index": "18847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[30], b[30], max = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i++) {\n    b[i - 1] = 1;\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[n - i] >= a[n - i + j] && b[n - i] <= b[n - i + j]) {\n        b[n - i] = 1 + b[n - i + j];\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (b[i - 1] > max) {\n      max = b[i - 1];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid Qsort(int a[], int low, int up) {\n  int i, j, k, x;\n  if (low >= up)\n    return;\n  else {\n    k = a[low];\n    j = low;\n    for (i = low; i <= up; i++) {\n      if (a[i] > k) {\n        j++;\n        x = a[i];\n        a[i] = a[j];\n        a[j] = x;\n      }\n    }\n  }\n  x = k;\n  a[low] = a[j];\n  a[j] = x;\n  Qsort(a, low, j - 1);\n  Qsort(a, j + 1, up);\n}\nint num(int a[], int low, int up) {\n  if (low >= up) {\n    return 1;\n  }\n  int i, j, b[26] = {0};\n  j = 0;\n  for (i = low + 1; i <= up; i++) {\n    if (a[i] <= a[low]) {\n      b[j] = num(a, i, up);\n      j++;\n    }\n  }\n  Qsort(b, 0, 25);\n  return b[0] + 1;\n}\nint main(void) {\n  int i, j, m, n, c, d;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = num(a, i, n - 1);\n  }\n  Qsort(b, 0, n - 1);\n  printf(\"%d\\n\", b[0]);\n}\n"}
{"label": "10", "index": "18849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, max, a[30] = {0}, limit[30] = {0}, num[30] = {0};\n  scanf(\"%d\", &k);\n  for (i = k - 1; i >= 0; i--) {\n    scanf(\"%d\", &a[i]);\n  }\n  num[0] = 1;\n  limit[0] = a[0];\n  for (i = 1; i < k; i++) {\n    max = 1;\n    for (j = 0; j < i; j++) {\n      if ((a[i] >= limit[j]) && ((num[j] + 1) >= max)) {\n        max = num[j] + 1;\n      }\n    }\n    limit[i] = a[i];\n    num[i] = max;\n  }\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (num[i] > max)\n      max = num[i];\n  }\n  printf(\"%d\", max);\n  return 0;\n}\n"}
{"label": "10", "index": "18850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[25] = {0}, h, b[25] = {0}, max = 0;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[k - 1] = 1;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j <= k - 1; j++) {\n      if (a[j] <= a[i]) {\n        if (b[j] + 1 > max)\n          max = b[j] + 1;\n      }\n    }\n    if (max == 0)\n      max = 1;\n    b[i] = max;\n    max = 0;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  printf(\"%d\", max);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint h[1000], k;\n\nint bp(int i, int height, int sum) {\n  if (i == k)\n    return sum;\n  if (h[i] <= height) {\n    int a1 = bp(i + 1, h[i], sum + 1);\n    int a2 = bp(i + 1, height, sum);\n    return (a1 > a2) ? a1 : a2;\n  }\n  return bp(i + 1, height, sum);\n}\n\nint main() {\n\n  cin >> k;\n  for (int i = 0; i < k; i++)\n    cin >> h[i];\n\n  cout << bp(0, 1000, 0) << endl;\n\n  return 0;\n}\n"}
{"label": "10", "index": "18852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  cin >> k;\n  int *a = (int *)malloc(sizeof(int) * k);\n  int i, j;\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  int count[30] = {0};\n  int max;\n  max = 0;\n  for (i = k - 2; i >= 0; i--) {\n    for (j = i + 1; j < k; j++) {\n      if (a[j] <= a[i] && count[i] < count[j] + 1)\n        count[i] = count[j] + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (max < count[i])\n      max = count[i];\n  }\n  printf(\"%d\", max + 1);\n  free(a);\n  return 0;\n}\n"}
{"label": "10", "index": "18853", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, a[100], b[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = 1;\n  }\n  for (i = n - 2; i >= 0; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--) {\n      if (a[i] >= a[j]) {\n        if (b[j] > max) {\n          max = b[j];\n        }\n      }\n    }\n    b[i] += max;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > max) {\n      max = b[i];\n    }\n  }\n  printf(\"%d\", max);\n}\n"}
{"label": "10", "index": "18854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, max = 0;\n  cin >> n;\n  int d[100];\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    cin >> d[i];\n  }\n  int w[100];\n  for (i = 0; i < n; i++)\n    w[i] = 1;\n  for (i = n - 2; i >= 0; i--) {\n    for (j = i + 1; j < n; j++)\n      if (d[i] >= d[j] && w[i] <= w[j])\n        w[i] = w[j] + 1;\n  }\n  for (i = 0; i < n; i++)\n    if (w[i] >= max)\n      max = w[i];\n  cout << max;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "10", "index": "18855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char g;\n  int c, d, f, a[25], b[25], k, e[25];\n  e[0] = 1;\n  scanf(\"%d\", &k);\n  for (c = 0;; c++) {\n    scanf(\"%d%c\", &a[c], &g);\n    if (g != ' ')\n      break;\n    else\n      ;\n  }\n  for (c = 0; c <= k - 1; c++)\n    b[c] = a[k - 1 - c];\n\n  for (c = 1; c <= k - 1; c++) {\n    for (d = 0, e[c] = 0; d <= c - 1; d++) {\n      if (b[c] >= b[d] && e[c] <= e[d])\n        e[c] = e[d];\n      else\n        ;\n    }\n    e[c]++;\n  }\n\n  for (c = 0, f = e[0]; c <= k - 1; c++) {\n    if (f <= e[c])\n      f = e[c];\n    else\n      ;\n  }\n  cout << f;\n}\n"}
{"label": "10", "index": "18856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k;\n  int j = 0;\n  int max = 0;\n  int i, m;\n  scanf(\"%d\", &k);\n  int height[k], b[k];\n  while (j < k) {\n    scanf(\"%d\", &height[j]);\n    j++;\n  }\n  j = j - 1;\n  while (j >= 0) {\n    for (i = j + 1; i < k; i++) {\n      if (height[i] <= height[j] && b[i] > max)\n        max = b[i];\n    }\n    b[j] = max + 1;\n    max = 0;\n    j--;\n  }\n  for (i = 0; i < k; i++) {\n    if (b[i] > max)\n      max = b[i];\n  }\n  cout << max;\n}\n"}
{"label": "10", "index": "18857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, *b, max, maxn = 0, *a;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i > -1; i--) {\n    max = 0;\n    for (j = n - 1; j > i; j--)\n      if (a[j] <= a[i] && b[j] >= max)\n        max = b[j];\n    b[i] = max + 1;\n    if (b[i] > maxn)\n      maxn = b[i];\n  }\n  printf(\"%d\\n\", maxn);\n}\n"}
{"label": "10", "index": "18858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m = 0, n, max = 0;\n  int a[25], t[25] = {0}, s[25] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  t[k - 1] = 1;\n  if (k == 1)\n    printf(\"1\\n\");\n  else {\n    for (i = k - 2; i >= 0; i--) {\n      for (j = i + 1; j < k; j++) {\n        if (a[j] <= a[i]) {\n          s[m] = t[j];\n          m++;\n        }\n      }\n      m = 0;\n      max = s[0];\n      for (n = 1; n < 25; n++) {\n        if (s[n] > max)\n          max = s[n];\n      }\n      for (j = 0; j < 25; j++)\n        s[j] = 0;\n      t[i] = max + 1;\n    }\n\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (t[i] > max)\n        max = t[i];\n    }\n    printf(\"%d\\n\", max);\n  }\n  return 0;\n}\n"}
{"label": "10", "index": "18859", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int dao, a[25] = {0}, b[25], i, j, num;\n  cin >> dao;\n  for (i = 0; i < dao; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = dao - 1; i >= 0; i--) {\n    num = 0;\n    for (j = i; j < dao; j++) {\n      if (b[i] >= b[j] && num <= a[j]) {\n        num = a[j];\n      }\n    }\n    a[i] = num + 1;\n  }\n  num = a[0];\n  for (i = 1; i < dao; i++) {\n    if (a[i] >= num)\n      num = a[i];\n  }\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "10", "index": "18860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct missile {\n  int num;\n  int high;\n};\nstruct missile a[25];\nvoid f(int n, int sum);\nint main() {\n  int i = 0, j = 0, sum = 0, max = 0;\n  scanf(\"%d\", &sum);\n\n  for (i = 0; i <= sum - 1; i++) {\n    scanf(\"%d\", &a[i].high);\n  }\n  for (i = sum - 1; i >= 0; i--) {\n    f(i, sum);\n  }\n  for (i = 0; i <= sum - 1; i++) {\n    if (a[i].num > max) {\n      max = a[i].num;\n    }\n  }\n  cout << max;\n}\nvoid f(int n, int sum) {\n  int i = 0, t = 1;\n  if (n == sum - 1) {\n    a[n].num = 1;\n  } else {\n    a[n].num = 1;\n    for (i = n + 1; i <= sum - 1; i++) {\n      if (a[n].high >= a[i].high) {\n        if (a[i].num + 1 > a[n].num) {\n          a[n].num = a[i].num + 1;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "11", "index": "18861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, date;\n  int a, b, c, e, g, h, j;\n  int d, f, i, k;\n\n  a = c = e = g = h = j = 31;\n  d = f = i = k = 30;\n\n  scanf(\"%d %d %d \", &year, &month, &date);\n\n  if ((year % 4 != 0) || (year % 100 == 0 && year % 400 != 0))\n    b = 28;\n  else\n    b = 29;\n\n  switch (month) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = a + date;\n    break;\n  case 3:\n    day = a + b + date;\n    break;\n  case 4:\n    day = a + b + c + date;\n    break;\n  case 5:\n    day = a + b + c + d + date;\n    break;\n  case 6:\n    day = a + b + c + d + e + date;\n    break;\n  case 7:\n    day = a + b + c + d + e + f + date;\n    break;\n  case 8:\n    day = a + b + c + d + e + f + g + date;\n    break;\n  case 9:\n    day = a + b + c + d + e + f + g + h + date;\n    break;\n  case 10:\n    day = a + b + c + d + e + f + g + h + i + date;\n    break;\n  case 11:\n    day = a + b + c + d + e + f + g + h + i + j + date;\n    break;\n  case 12:\n    day = a + b + c + d + e + f + g + h + i + j + k + date;\n    break;\n  }\n\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int j, k, l;\n  scanf(\"%d%d%d\", &j, &k, &l);\n  if (j % 4 == 0) {\n    if (j % 100 != 0) {\n      a[1] = 29;\n    } else if (j % 100 == 0 && j % 400 == 0) {\n      a[1] = 29;\n    }\n    if (j % 100 == 0 && j % 400 != 0) {\n      a[1] = 28;\n    }\n  }\n  int sum = 0;\n  int m;\n  for (m = 0; m < k - 1; m++) {\n    sum = sum + a[m];\n  }\n  sum = sum + l;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18863", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "18864", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  int dd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n = 0;\n  int i;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0))) {\n    dd[1] = 29;\n  }\n\n  for (i = 0; i < m - 1; i++) {\n    n = n + dd[i];\n  }\n\n  n = n + d;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18865", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint y, m, d;\nint a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nvoid cal(int x) {\n  int sum = 0, i;\n  if (x) {\n    for (i = 0; i < m - 1; i++)\n      sum += b[i];\n    sum += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      sum += a[i];\n    sum += d;\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  cin >> y >> m >> d;\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      cal(1);\n    else\n      cal(0);\n  } else {\n    if (y % 4 == 0)\n      cal(1);\n    else\n      cal(0);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, tian, i = 1;\n  for (; i <= 5; i = i + 1) {\n    scanf(\"%d %d %d\\n\", &nian, &yue, &ri);\n    if (nian % 4 == 0 && nian % 100 != 0 ||\n        nian % 100 == 0 && nian % 400 == 0) {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 60;\n        break;\n      case 4:\n        tian = 91;\n        break;\n      case 5:\n        tian = 121;\n        break;\n      case 6:\n        tian = 152;\n        break;\n      case 7:\n        tian = 182;\n        break;\n      case 8:\n        tian = 213;\n        break;\n      case 9:\n        tian = 244;\n        break;\n      case 10:\n        tian = 274;\n        break;\n      case 11:\n        tian = 305;\n        break;\n      case 12:\n        tian = 335;\n        break;\n      }\n    } else {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 59;\n        break;\n      case 4:\n        tian = 90;\n        break;\n      case 5:\n        tian = 120;\n        break;\n      case 6:\n        tian = 151;\n        break;\n      case 7:\n        tian = 181;\n        break;\n      case 8:\n        tian = 212;\n        break;\n      case 9:\n        tian = 243;\n        break;\n      case 10:\n        tian = 273;\n        break;\n      case 11:\n        tian = 304;\n        break;\n      case 12:\n        tian = 334;\n        break;\n      }\n    }\n    tian = tian + ri;\n    printf(\"%d\\n\", tian);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0)\n    a = 0;\n  if (a % 100 == 0 && a % 400 == 0)\n    a = 0;\n  if (a != 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 28;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  if (a == 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 29;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n\n    for (int i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 ||\n          i == 12) {\n        t += 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t += 30;\n      } else {\n        t += 29;\n      }\n    }\n  } else {\n    for (int j = 1; j < b; j++) {\n      if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 ||\n          j == 12) {\n        t += 31;\n      } else {\n        if (j == 4 || j == 6 || j == 9 || j == 11) {\n          t += 30;\n        } else {\n          t += 28;\n        }\n      }\n    }\n  }\n  t = t + c;\n\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "18869", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  cin >> year;\n  scanf(\"%d \", &month);\n  scanf(\"%d\", &day);\n  if (month == 2)\n    printf(\"%d\", 31 + day);\n  else if (month == 1)\n    printf(\"%d\", day);\n  else {\n    if (month == 3)\n      day = day + 59;\n    if (month == 4) {\n      day = day + 90;\n    }\n    if (month == 5)\n      day = day + 120;\n    if (month == 6)\n      day = day + 151;\n    if (month == 7)\n      day = day + 181;\n    if (month == 8)\n      day = day + 212;\n    if (month == 9)\n      day = day + 243;\n    if (month == 10)\n      day = day + 273;\n    if (month == 11)\n      day = day + 304;\n    if (month == 12)\n      day = day + 334;\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      printf(\"%d\", day + 1);\n    else\n      printf(\"%d\", day);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18870", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint l(int a) {\n  int i, j, k;\n  i = a % 4;\n  j = a % 100;\n  k = a % 400;\n  if (i == 0) {\n    if (j != 0 || k == 0)\n      return 1;\n    else\n      return 0;\n  } else\n    return 0;\n}\nint main() {\n  int a[3], i, j, k = 0;\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int c[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int d[12];\n  scanf(\"%d %d %d \", &a[0], &a[1], &a[2]);\n  i = a[0];\n  if (l(i) == 1) {\n    for (j = 0; j < 12; j++)\n      d[j] = c[j];\n  } else {\n    for (j = 0; j < 12; j++)\n      d[j] = b[j];\n  }\n  for (i = 0; i < a[1]; i++)\n    k = d[i] + k;\n  k = k + a[2];\n  cout << k << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], m, tianshu, i;\n  for (i = 0; i <= 4; i++) {\n    cin >> year[i] >> month[i] >> day[i];\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n    if ((year[i] % 400 == 0) || (year[i] % 4 == 0 && year[i] % 100 != 0))\n      if (m > 31)\n        m = m + 1;\n    tianshu = m + day[i];\n    printf(\"%d\\n\", tianshu);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int DJT = 0;\n  int D[12];\n  D[0] = 31;\n  D[1] = 28;\n  D[2] = 31;\n  D[3] = 30;\n  D[4] = 31;\n  D[5] = 30;\n  D[6] = 31;\n  D[7] = 31;\n  D[8] = 30;\n  D[9] = 31;\n  D[10] = 30;\n  D[11] = 31;\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0)\n    D[1] = D[1] + 1;\n  else if (year % 100 != 0 && year % 4 == 0)\n    D[1] = D[1] + 1;\n  else\n    D[1] = D[1];\n  for (int i = 0; i < month - 1; i++)\n    DJT = DJT + D[i];\n  DJT = DJT + day;\n  cout << DJT << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 60 + d);\n      break;\n    case 4:\n      printf(\"%d\", 91 + d);\n      break;\n    case 5:\n      printf(\"%d\", 121 + d);\n      break;\n    case 6:\n      printf(\"%d\", 152 + d);\n      break;\n    case 7:\n      printf(\"%d\", 182 + d);\n      break;\n    case 8:\n      printf(\"%d\", 213 + d);\n      break;\n    case 9:\n      printf(\"%d\", 244 + d);\n      break;\n    case 10:\n      printf(\"%d\", 274 + d);\n      break;\n    case 11:\n      printf(\"%d\", 305 + d);\n      break;\n    case 12:\n      printf(\"%d\", 335 + d);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      cout << 59 + d;\n      break;\n    case 4:\n      printf(\"%d\", 90 + d);\n      break;\n    case 5:\n      printf(\"%d\", 120 + d);\n      break;\n    case 6:\n      printf(\"%d\", 151 + d);\n      break;\n    case 7:\n      printf(\"%d\", 181 + d);\n      break;\n    case 8:\n      printf(\"%d\", 212 + d);\n      break;\n    case 9:\n      printf(\"%d\", 243 + d);\n      break;\n    case 10:\n      printf(\"%d\", 273 + d);\n      break;\n    case 11:\n      printf(\"%d\", 304 + d);\n      break;\n    case 12:\n      printf(\"%d\", 334 + d);\n      break;\n    }\n  }\n}\n"}
{"label": "11", "index": "18874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, February, day;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    February = 29;\n  else\n    February = 28;\n  if (month == 1)\n    day = date;\n  if (month == 2)\n    day = 31 + date;\n  if (month == 3)\n    day = 31 + February + date;\n  if (month == 4)\n    day = 31 + February + 31 + date;\n  if (month == 5)\n    day = 31 + February + 31 + 30 + date;\n  if (month == 6)\n    day = 31 + February + 31 + 30 + 31 + date;\n  if (month == 7)\n    day = 31 + February + 31 + 30 + 31 + 30 + date;\n  if (month == 8)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + date;\n  if (month == 9)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + date;\n  if (month == 10)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n  if (month == 11)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n  if (month == 12)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, day, tot = 0, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> y >> m >> day;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    a[1]++;\n  for (i = 0; i < m - 1; i++) {\n    tot += a[i];\n  }\n  tot += day;\n  cout << tot << \" \";\n  return 0;\n}\n"}
{"label": "11", "index": "18876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int mth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int leap;\n  int sum = 0;\n  int i;\n\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap) {\n    mth[2] = 29;\n  }\n\n  for (i = 1; i <= m - 1; i++)\n    sum = sum + mth[i];\n\n  sum = sum + d;\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18877", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, z;\n  cin >> x >> y >> z;\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else\n    D = n + z;\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "18878", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, s = 0;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    for (i = 0; i < m - 1; i++)\n      s += m2[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      s += m1[i];\n  cout << s + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int z = 1;\n  while (z <= 5) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    int n = 0;\n    int i;\n    for (i = 1; i < month; i++) {\n      n = n + days[i];\n    }\n    n = n + day;\n    if (month > 2 && isleapyear(year))\n      n++;\n    printf(\"%d\\n\", n);\n    z++;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, y, r, s = 0, i;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  int a[12];\n  a[0] = 31, a[1] = 28, a[2] = 31, a[3] = 30, a[4] = 31, a[5] = 30, a[6] = 31,\n  a[7] = 31, a[8] = 30, a[9] = 31, a[10] = 30, a[11] = 31;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    a[1] = 29;\n  for (i = 0; i < y - 1; i++)\n    s = s + a[i];\n  s = s + r;\n  printf(\"%d\\n\", s);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18881", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, b;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = a[2] + 1;\n  b = d;\n  for (i = 1; i < m; i++) {\n    b = a[i] + b;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "18883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    for (int i = m - 2; i >= 0; i--) {\n      sum = sum + b[i];\n    }\n    cout << sum + d;\n  } else {\n    for (int s = m - 2; s >= 0; s--) {\n      sum = sum + a[s];\n    }\n    cout << sum + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, sum, a[13];\n  cin >> year >> month >> day;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  sum = day;\n  for (int i = 1; i < month; i++)\n    sum = sum + a[i];\n  cout << sum;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "18885", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d[12], sum = 0;\n  int i;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      d[i] = 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      d[i] = 30;\n    } else {\n      if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n        d[2] = 29;\n      } else {\n        d[2] = 28;\n      }\n    }\n    sum += d[i];\n  }\n  printf(\"%d\\n\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "18886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, i, d, s = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) {\n    for (i = 0; i < m; i++)\n      s += a[1][i];\n    s += d;\n  } else {\n    for (i = 0; i < m; i++)\n      s += a[0][i];\n    s += d;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "18887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, day, i, x;\n  scanf(\"%d %d %d \", &a, &m, &day);\n  switch (m) {\n  case 1:\n    i = 0;\n    break;\n  case 2:\n    i = 31;\n    break;\n  case 3:\n    i = 31 + 28;\n    break;\n  case 4:\n    i = 31 + 28 + 31;\n    break;\n  case 5:\n    i = 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    i = 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    i = 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  default:\n    cout << \"error\\n\";\n  }\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if ((m != 1) && (m != 2))\n      x = i + day + 1;\n    else\n      x = i + day;\n  } else\n    x = i + day;\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18888", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, i, d, s = 0;\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) {\n    for (i = 0; i < m; i++)\n      s += a[1][i];\n    s += d;\n  } else {\n    for (i = 0; i < m; i++)\n      s += a[0][i];\n    s += d;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "18889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  int days = 0;\n  int ar[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int br[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (int i = 0; i < mon - 1; i++)\n      days += br[i];\n  } else {\n    for (int i = 0; i < mon - 1; i++)\n      days += ar[i];\n  }\n  days += day;\n  cout << days << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, x, i, sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &x);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    int d[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  } else {\n    int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    cout << sum + x;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  int i = 0;\n  int sum = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    sum = sum + 30;\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum = sum + 1;\n    } else if (i == 2 && ((a % 100 != 0 && a % 4 == 0) || a % 400 == 0)) {\n      sum = sum - 1;\n    } else if (i == 2 && (a % 4 != 0 || a % 100 == 0 && a % 400 != 0)) {\n      sum = sum - 2;\n    }\n  }\n  printf(\"%d\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "18892", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "18893", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if ((a % 4) == 0 && a % 100 != 0 || (a % 400) == 0) {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 29 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 29 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 28 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 28 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18894", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, day, num = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    a[2]++;\n  for (int i = 1; i < month; i++)\n    num += a[i];\n  num += day;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "18895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int aaa[5][3];\n  int year, mon, day, i, n, m;\n  int month[12];\n  month[0] = 31, month[1] = 28, month[2] = 31, month[3] = 30, month[4] = 31,\n  month[5] = 30, month[6] = 31, month[7] = 31, month[8] = 30, month[9] = 31,\n  month[10] = 30, month[11] = 31;\n  for (i = 0; i < 5; i++) {\n    cin >> year >> mon >> day;\n    aaa[i][0] = year;\n    aaa[i][1] = mon;\n    aaa[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = aaa[i][0];\n    mon = aaa[i][1];\n    day = aaa[i][2];\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n      month[1] = 29;\n    else\n      month[1] = 28;\n    n = 0;\n    for (m = 0; m < (mon - 1); m++) {\n      n = n + month[m];\n    }\n    n = n + day;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18896", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, i;\n  cin >> year >> month >> day;\n  if (((year % 400) == 0) || (((year % 4) == 0) && ((year % 100) != 0))) {\n    int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  } else {\n    int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  }\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, res = 0, i;\n  int y[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    y[1] = 29;\n  else\n    y[1] = 28;\n  y[0] = 31;\n  y[2] = 31;\n  y[4] = 31;\n  y[7] = 31;\n  y[6] = 31;\n  y[9] = 31;\n  y[3] = 30;\n  y[5] = 30;\n  y[8] = 30;\n  y[10] = 30;\n  for (i = 0; i < month - 1; i++)\n    res += y[i];\n  res += day;\n  printf(\"%d\", res);\n  return 0;\n}\n"}
{"label": "11", "index": "18898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint rui(int y, int m) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) && m == 2)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int d = 0, y, m, r, i;\n  int pp[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> r;\n  for (i = 1; i < m; i++)\n    d = d + pp[i] + rui(y, i);\n  d = d + r;\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "11", "index": "18900", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long int a[5], b[5], c[5], ts[5], i;\n  for (i = 1; i <= 5; i++)\n    cin >> a[i] >> b[i] >> c[i];\n  for (i = 1; i <= 5; i++) {\n    switch (b[i]) {\n    case 1:\n      ts[i] = c[i];\n      break;\n    case 2:\n      ts[i] = c[i] + 31;\n      break;\n    case 3:\n      ts[i] = c[i] + 59;\n      break;\n    case 4:\n      ts[i] = c[i] + 90;\n      break;\n    case 5:\n      ts[i] = c[i] + 120;\n      break;\n    case 6:\n      ts[i] = c[i] + 151;\n      break;\n    case 7:\n      ts[i] = c[i] + 181;\n      break;\n    case 8:\n      ts[i] = c[i] + 212;\n      break;\n    case 9:\n      ts[i] = c[i] + 243;\n      break;\n    case 10:\n      ts[i] = c[i] + 273;\n      break;\n    case 11:\n      ts[i] = c[i] + 304;\n      break;\n    case 12:\n      ts[i] = c[i] + 334;\n      break;\n    }\n\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) && b[i] > 2)\n      ts[i] = ts[i] + 1;\n\n    printf(\"%ld\", ts[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + a[i];\n\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d \", &year);\n  cin >> month;\n  scanf(\"%d\", &day);\n  if (month == 2)\n    cout << 31 + day;\n  else if (month == 1)\n    printf(\"%d\", day);\n  else {\n    if (month == 3)\n      day = day + 59;\n    if (month == 4)\n      day = day + 90;\n    if (month == 5)\n      day = day + 120;\n    if (month == 6)\n      day = day + 151;\n    if (month == 7)\n      day = day + 181;\n    if (month == 8)\n      day = day + 212;\n    if (month == 9)\n      day = day + 243;\n    if (month == 10)\n      day = day + 273;\n    if (month == 11)\n      day = day + 304;\n    if (month == 12)\n      day = day + 334;\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      cout << day + 1;\n    else\n      printf(\"%d\", day);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, d, i, b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  c[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  s = 0;\n  cin >> a >> m >> d;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0))\n    for (i = 1; i < m; i++)\n      s += b[i];\n  else\n    for (i = 1; i < m; i++)\n      s += c[i];\n  cout << s + d;\n  return 0;\n}\n"}
{"label": "11", "index": "18904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, days = 0, i = 1;\n  int month_str1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month_str2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    while (i != month) {\n      days += month_str2[i - 1];\n      i++;\n    }\n  else\n    while (i != month) {\n      days += month_str1[i - 1];\n      i++;\n    }\n  cout << days + day;\n  return 0;\n}\n"}
{"label": "11", "index": "18905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int mun, day, year, i;\n  int days = 0;\n  scanf(\"%d%d%d\", &year, &mun, &day);\n  days += day;\n  for (i = 1; i < mun; i++) {\n    days += a[i];\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      days += 1;\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "18906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    s = c;\n    break;\n  case 2:\n    s = c + 31;\n    break;\n  case 3:\n    s = c + 31 + 28;\n    break;\n  case 4:\n    s = c + 31 + 28 + 31;\n    break;\n  case 5:\n    s = c + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    s = c + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  if ((a % 4 == 0 && a % 100 != 0 || a % 400 == 0) && (b > 2))\n    s = s + 1;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "18908", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int month, date, n = 0, i, year, p;\n  cin >> year >> month >> date;\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))\n    p = 29;\n  else {\n    p = 28;\n  }\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n      n += 31;\n      break;\n    case 2:\n      n += p;\n      break;\n    case 3:\n      n += 31;\n      break;\n    case 4:\n      n += 30;\n      break;\n    case 5:\n      n += 31;\n      break;\n    case 6:\n      n += 30;\n      break;\n    case 7:\n      n += 31;\n      break;\n    case 8:\n      n += 31;\n      break;\n    case 9:\n      n += 30;\n      break;\n    case 10:\n      n += 31;\n      break;\n    case 11:\n      n += 30;\n      break;\n    }\n  }\n  n += date;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18909", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int y) {\n  int i;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        return (1);\n      else\n        return (0);\n    } else\n      return (1);\n  } else\n    return (0);\n}\nint main() {\n  int y, m, d, n, i;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 30;\n  n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (f(y) == 0)\n    a[2] = 28;\n  if (f(y) == 1) {\n    a[2] = 29;\n  }\n  for (i = 1; i < m; i++)\n    n = a[i] + n;\n  n = n + d;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  sum = 0;\n  for (i = 1; i < m; i++)\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10))\n      sum = sum + 31;\n    else if (i == 2)\n      if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    else\n      sum = sum + 30;\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int n;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      cout << n;\n    }\n    if (month == 3) {\n      n = 31 + 29 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 29 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 29 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  } else {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 28 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 28 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 28 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (int i = 0; i <= month - 1; i++) {\n    if (i == month - 1)\n      sum += day;\n    else {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        sum += m2[i];\n      else\n        sum += m1[i];\n    }\n  }\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rennian(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, i, a = 0, b;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (rennian(y) == 1) {\n    days[2]++;\n  }\n  for (i = 0; i < m; i++) {\n    a += days[i];\n  }\n  b = a + d;\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "18914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, c, days = 0, i;\n  int M[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    c = 1;\n  else\n    c = 0;\n  if (month == 1)\n    cout << day;\n  else {\n    for (i = 0; i < month - 1; i++)\n      days += M[c][i];\n    cout << days + day;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, D;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60;\n      break;\n    case 4:\n      D = c + 91;\n      break;\n    case 5:\n      D = c + 121;\n      break;\n    case 6:\n      D = c + 152;\n      break;\n    case 7:\n      D = c + 182;\n      break;\n    case 8:\n      D = c + 213;\n      break;\n    case 9:\n      D = c + 244;\n      break;\n    case 10:\n      D = c + 274;\n      break;\n    case 11:\n      D = c + 305;\n      break;\n    case 12:\n      D = c + 335;\n      break;\n    }\n    cout << D;\n\n  } else {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60 - 1;\n      break;\n    case 4:\n      D = c + 91 - 1;\n      break;\n    case 5:\n      D = c + 121 - 1;\n      break;\n    case 6:\n      D = c + 152 - 1;\n      break;\n    case 7:\n      D = c + 182 - 1;\n      break;\n    case 8:\n      D = c + 213 - 1;\n      break;\n    case 9:\n      D = c + 244 - 1;\n      break;\n    case 10:\n      D = c + 274 - 1;\n      break;\n    case 11:\n      D = c + 305 - 1;\n      break;\n    case 12:\n      D = c + 335 - 1;\n      break;\n    }\n\n    printf(\"%d\", D);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "18916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + monthday[i - 1];\n\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, year, month, day, a[32], i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  a[0] = 0;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if (year % 4 == 0 && year % 200 == 0) {\n    a[2] = 29;\n  } else {\n    a[2] = 28;\n  }\n  for (i = 0; i < month; i++) {\n    sum = sum + a[i];\n  }\n  n = sum + day;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "18918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a, b, c, sum;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    sum = c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 60;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 91;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 121;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 152;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 182;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 213;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 244;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 274;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 305;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 335;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 59;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 90;\n      cout << sum;\n    }\n    if (b == 5) {\n      sum = c + 120;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 151;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 181;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 212;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 243;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 273;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 304;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 334;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    n = n + day;\n  else if (month == 2) {\n    n = n + 31 + day;\n  } else if (month == 3)\n    n = n + 59 + day;\n  else if (month == 4)\n    n = n + 90 + day;\n  else if (month == 5)\n    n = n + 120 + day;\n  else if (month == 6)\n    n = n + 151 + day;\n  else if (month == 7)\n    n = n + 181 + day;\n  else if (month == 8)\n    n = n + 212 + day;\n  else if (month == 9)\n    n = n + 243 + day;\n  else if (month == 10)\n    n = n + 273 + day;\n  else if (month == 11)\n    n = n + 304 + day;\n  else {\n    n = n + 334 + day;\n  }\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    n = n + 1;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18920", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint shirunnian(int d) {\n  if (d % 4 == 0) {\n    if (d % 100 == 0) {\n      if (d % 400 == 0)\n        return 1;\n      else\n        return 0;\n    } else\n      return 1;\n  } else\n    return 0;\n}\n\nint dijitian(int a, int b, int c) {\n  int i;\n  int sum = 0;\n  int days = 0;\n  for (i = 0; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    else if (i == 2) {\n      if (shirunnian(a) == 1) {\n        days += 29;\n      } else if (shirunnian(a) == 0) {\n        days += 28;\n      }\n    }\n  }\n  sum = days + c;\n  return sum;\n}\n\nint main() {\n  int year, month, day, tianshu = 0;\n  cin >> year >> month >> day;\n  tianshu = dijitian(year, month, day);\n  printf(\"%d\", tianshu);\n  return 0;\n}\n"}
{"label": "11", "index": "18921", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int dmonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i = 0;\n  int sum = 0;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + dmonth[i];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month >= 3) {\n      sum = sum + day + 1;\n    }\n  } else {\n    sum = sum + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int i;\n\n  if (year % 4 == 0 || year % 100 == 0) {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2)\n      i = (month - 1) * 31 + day;\n    else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  } else {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2) {\n      i = (month - 1) * 31 + day;\n    } else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  }\n\n  printf(\"%d\", i);\n\n  return 0;\n}\n"}
{"label": "11", "index": "18923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n[13], i, sum = 0;\n  n[1] = n[3] = n[5] = n[7] = n[8] = n[10] = n[12] = 31;\n  n[0] = n[2] = 0;\n  n[4] = n[6] = n[9] = n[11] = 30;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0))\n    n[2] = 29;\n  else\n    n[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + n[i];\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18924", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, m;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 29 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 29 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 28 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 28 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, l, m, n;\n  scanf(\"%d\\n%d\\n%d\", &k, &l, &m); \n  if (k % 4 == 0) {\n    if (k % 100 == 0) {\n      if (k % 400 == 0) \n      {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 29);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 29 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 29 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 29 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      } else \n      {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 28);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 28 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 28 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 28 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      }\n    } else \n    {\n      if ((l > 0) && (l < 2)) {\n        n = m;\n        printf(\"%d\", n);\n      } else if ((l > 1) && (l < 3)) {\n        n = (m + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 2) && (l < 4)) {\n        n = (m + 31 + 29);\n        printf(\"%d\\n\", n);\n      } else if ((l > 3) && (l < 5)) {\n        n = (m + 31 + 29 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 4) && (l < 6)) {\n        n = (m + 31 + 29 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 5) && (l < 7)) {\n        n = (m + 31 + 29 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 6) && (l < 8)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 7) && (l < 9)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 8) && (l < 10)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 9) && (l < 11)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 10) && (l < 12)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 11) && (l < 13)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      }\n    }\n  } else \n  {\n    if ((l > 0) && (l < 2)) {\n      n = m;\n      printf(\"%d\", n);\n    } else if ((l > 1) && (l < 3)) {\n      n = (m + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 2) && (l < 4)) {\n      n = (m + 31 + 28);\n      printf(\"%d\\n\", n);\n    } else if ((l > 3) && (l < 5)) {\n      n = (m + 31 + 28 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 4) && (l < 6)) {\n      n = (m + 31 + 28 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 5) && (l < 7)) {\n      n = (m + 31 + 28 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 6) && (l < 8)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 7) && (l < 9)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 8) && (l < 10)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 9) && (l < 11)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 10) && (l < 12)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 11) && (l < 13)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18926", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year;\n  int month;\n  int day;\n  int data1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int data2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int in = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 || year % 100 == 0 && year % 400 == 0) {\n    int i = month - 1;\n    for (; i >= 0; i--) {\n      in += data2[i];\n    }\n    in += day;\n  } else {\n    int i = month - 1;\n    for (; i >= 0; i--)\n      in += data1[i];\n\n    in += day;\n  }\n  printf(\"%d\\n\", in);\n  return 0;\n}\n"}
{"label": "11", "index": "18927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, c, days;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  days = 0;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    m[2] = 29;\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  } else {\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18928", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 60 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 91 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 121 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 152 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 182 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 213 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 9) {\n      n = 244 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 10) {\n      n = 274 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 11) {\n      n = 305 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 12) {\n      n = 336 + c;\n      printf(\"%d\\n\", n);\n    }\n  } else {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 59 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 90 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 120 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 151 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 181 + c;\n      printf(\"%d\\n\", n);\n    } else {\n      if (b == 8) {\n        n = 212 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 9) {\n        n = 243 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 10) {\n        n = 273 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 11) {\n        n = 304 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 12) {\n        n = 335 + c;\n        printf(\"%d\\n\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int feb, i, n = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 != 0)\n    feb = 28;\n  else {\n    if (year % 100 != 0)\n      feb = 29;\n    else {\n      if (year % 400 == 0)\n        feb = 29;\n      else\n        feb = 28;\n    }\n  }\n  for (i = 1; i < month; i++) {\n    if (i == 2)\n      n = n + feb;\n    else {\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        n = n + 30;\n      else\n        n = n + 31;\n    }\n  }\n  n = n + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, c, days = 0, i;\n  int M[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    c = 1;\n  else\n    c = 0;\n  if (month == 1)\n    cout << day;\n  else {\n    for (i = 0; i < month - 1; i++)\n      days += M[c][i];\n    printf(\"%d\", days + day);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18931", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, k, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0)\n    k = 1;\n  else if (year % 100 == 0)\n    k = 0;\n  else if (year % 4 == 0)\n    k = 1;\n  else\n    k = 0;\n  if (k == 1)\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n  sum += day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int month[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, ans;\n  if (y % 400 == 0 || (y % 100 && y % 4 == 0))\n    month[2] = 29;\n  ans = 0;\n  for (i = 1; i < m; i++)\n    ans += month[i];\n  ans += d;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "18933", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s = 0, d = 0;\n  int i;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && ((a % 100) != 0)) || ((a % 400) == 0)) {\n    d = 1;\n  }\n\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) ||\n        (i == 12)) {\n      s = s + 31;\n    }\n    if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      s = s + 30;\n    }\n    if (i == 2) {\n      if (d == 0) {\n        s = s + 28;\n      }\n      if (d == 1) {\n        s = s + 29;\n      }\n    }\n  }\n  s = s + c;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "18934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], m, tianshu, i;\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n    if ((year[i] % 400 == 0) || (year[i] % 4 == 0 && year[i] % 100 != 0))\n      if (m > 31)\n        m = m + 1;\n    tianshu = m + day[i];\n    printf(\"%d\\n\", tianshu);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18935", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint leapyear(int year) {\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n    return 1;\n  else\n    return 0;\n}\nint whichday(int year, int month, int day) {\n  int mon[1000] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int d = 0, i;\n  if (leapyear(year) == 1)\n    mon[1]++;\n  for (i = 0; i < month - 1; i++)\n    d += mon[i];\n  d += day;\n  return d;\n}\nint main() {\n  int year, month, day;\n  int d;\n  cin >> year >> month >> day;\n  d = whichday(year, month, day);\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "18936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int t;\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 60;\n      break;\n    case 4:\n      t = 91;\n      break;\n    case 5:\n      t = 121;\n      break;\n    case 6:\n      t = 152;\n      break;\n    case 7:\n      t = 182;\n      break;\n    case 8:\n      t = 213;\n      break;\n    case 9:\n      t = 244;\n      break;\n    case 10:\n      t = 274;\n      break;\n    case 11:\n      t = 305;\n      break;\n    case 12:\n      t = 335;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 59;\n      break;\n    case 4:\n      t = 90;\n      break;\n    case 5:\n      t = 120;\n      break;\n    case 6:\n      t = 151;\n      break;\n    case 7:\n      t = 181;\n      break;\n    case 8:\n      t = 212;\n      break;\n    case 9:\n      t = 243;\n      break;\n    case 10:\n      t = 273;\n      break;\n    case 11:\n      t = 304;\n      break;\n    case 12:\n      t = 334;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "18937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 60;\n      break;\n    case 4:\n      day = day + 91;\n      break;\n    case 5:\n      day = day + 121;\n      break;\n    case 6:\n      day = day + 152;\n      break;\n    case 7:\n      day = day + 182;\n      break;\n    case 8:\n      day = day + 213;\n      break;\n    case 9:\n      day = day + 244;\n      break;\n    case 10:\n      day = day + 274;\n      break;\n    case 11:\n      day = day + 305;\n      break;\n    case 12:\n      day = day + 335;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 59;\n      break;\n    case 4:\n      day = day + 90;\n      break;\n    case 5:\n      day = day + 120;\n      break;\n    case 6:\n      day = day + 151;\n      break;\n    case 7:\n      day = day + 181;\n      break;\n    case 8:\n      day = day + 212;\n      break;\n    case 9:\n      day = day + 243;\n      break;\n    case 10:\n      day = day + 273;\n      break;\n    case 11:\n      day = day + 304;\n      break;\n    case 12:\n      day = day + 334;\n      break;\n    }\n  }\n  printf(\"%d\", day);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "18938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0, N;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 100 != 0 && y % 4 == 0) {\n    int p[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > p[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + p[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  } else if (y % 4 != 0) {\n    int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > q[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + q[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, days = 0, i = 1;\n  int month_str1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month_str2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    while (i != month) {\n      days += month_str2[i - 1];\n      i++;\n    }\n  else\n    while (i != month) {\n      days += month_str1[i - 1];\n      i++;\n    }\n  printf(\"%d\", days + day);\n  return 0;\n}\n"}
{"label": "11", "index": "18940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, j, sum;\n  int a[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  for (j = 0; j < 5; j++) {\n    sum = 0;\n    cin >> year >> month >> day;\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0) {\n          for (i = 0; i < month; i++)\n            sum = sum + a[i];\n          sum = sum + day;\n        } else {\n          for (i = 0; i < month; i++)\n            sum = sum + b[i];\n          sum = sum + day;\n        }\n      } else {\n        for (i = 0; i < month; i++)\n          sum = sum + a[i];\n        sum = sum + day;\n      }\n    } else {\n      for (i = 0; i < month; i++)\n        sum = sum + b[i];\n      sum = sum + day;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18941", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n\n\n\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int j;\n\n  for (j = 0; j < 5; j++) {\n    int n = 0; \n    int i;\n    scanf(\"%d %d %d\", &year, &month, &day);\n\n    \n    if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (isleapyear(year) && month != 2 && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (!isleapyear(year) && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n\n    \n    for (i = 1; i < month; i++) {\n      n += days[i];\n    }\n    \n    n += day;\n    \n    if (month > 2 && isleapyear(year))\n      n++;\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18942", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) ||\n      (year % 100 == 0 && year % 400 == 0)) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "18943", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n  x = 0;\n  for (i = 0; i < m - 1; i++)\n    x += a[i];\n  x += d;\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "18944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int mth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int leap;\n  int sum = 0;\n  int i;\n\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap)\n    mth[2] = 29;\n\n  for (i = 1; i <= m - 1; i++)\n    sum = sum + mth[i];\n\n  sum = sum + d;\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "18945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, all;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 29 + 31;\n    }\n    if (month == 4) {\n      all = day + 29 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 29 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 28 + 31;\n    }\n    if (month == 4) {\n      all = day + 28 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 28 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  cout << all;\n  return 0;\n}\n"}
{"label": "11", "index": "18946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, i, x;\n  x = 0;\n  cin >> year >> mon >> day;\n  for (i = 1; i < mon; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      x = x + 30;\n    }\n    if (i == 2) {\n      if (year % 400 == 0) {\n        x = x + 29;\n      } else {\n        if (year % 4 == 0 && year % 100 != 0) {\n          x = x + 29;\n        } else {\n          x = x + 28;\n        }\n      }\n    }\n  }\n  x = x + day;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "18947", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, i;\n  cin >> year >> month >> day;\n  if (((year % 400) == 0) || (((year % 4) == 0) && ((year % 100) != 0))) {\n    int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  } else {\n    int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  }\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18948", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n  x = 0;\n  for (i = 0; i < m - 1; i++)\n    x += a[i];\n  x += d;\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n, s[12], i, t;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  t = 0;\n  for (i = 0; i < b - 1; i++) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n      s[1] = 29;\n      t = s[i] + t;\n    } else {\n      s[1] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "18950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, x = 0, i;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 29;\n    }\n    x = x + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 28;\n    }\n    x = x + d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "18951", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int feb, i, n = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 != 0)\n    feb = 28;\n  else {\n    if (year % 100 != 0)\n      feb = 29;\n    else {\n      if (year % 400 == 0)\n        feb = 29;\n      else\n        feb = 28;\n    }\n  }\n  for (i = 1; i < month; i++) {\n    if (i == 2)\n      n = n + feb;\n    else {\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        n = n + 30;\n      else\n        n = n + 31;\n    }\n  }\n  n = n + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, sm = 0, k;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) != 0) {\n    int m[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sum = sum + m[k];\n    sum = sum + day;\n    printf(\"%d\", sum);\n  } else {\n    int n[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sm = sm + n[k];\n    sm = sm + day;\n    printf(\"%d\", sm);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18953", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint panduan(int(year));\nint main() {\n  int sum = 0, year, month, day;\n  int i;\n  int Month1[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Month2[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (panduan(year) == 1) {\n    for (i = 1; i < month; i++)\n      sum += Month1[i];\n    sum += day;\n    printf(\"%d\", sum);\n    return 0;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += Month2[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  }\n  return 0;\n}\nint panduan(int year) {\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "18954", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, m, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || a % 4 == 0 && a % 100 != 0) {\n    m = 29;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    m = 28;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "18955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  int i = 0;\n  int sum = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    sum = sum + 30;\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum = sum + 1;\n    } else if (i == 2 && ((a % 100 != 0 && a % 4 == 0) || a % 400 == 0)) {\n      sum = sum - 1;\n    } else {\n      if (i == 2 && (a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n        sum = sum - 2;\n    }\n  }\n  printf(\"%d\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "18956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leap(int year) {\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int year, month, day, leap1, answer = 0, i;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  leap1 = leap(year);\n  if (leap1 == 1) {\n    for (i = 1; i < month; i++) {\n      answer += b[i];\n    }\n    answer += day;\n  } else {\n    for (i = 1; i < month; i++) {\n      answer += a[i];\n    }\n    answer += day;\n  }\n  printf(\"%d\", answer);\n}\n"}
{"label": "11", "index": "18957", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, n, leap;\n  cin >> year >> mon >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap = 0) {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 29 + day;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  } else {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 28 + day;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18959", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, i, d, s = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) {\n    for (i = 0; i < m; i++)\n      s += a[1][i];\n    s += d;\n  } else {\n    for (i = 0; i < m; i++)\n      s += a[0][i];\n    s += d;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "18960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst int month[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                          {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\nint main() {\n  int i, leap = 0, y, m, d, ans = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n    leap = 1;\n  for (i = 1; i < m; i++)\n    ans += month[leap][i];\n  ans += d;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "18961", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, leap, y;\n  cin >> year >> month >> day;\n\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 29 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 29 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 29 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 28 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 28 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 28 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18962", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month_l[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  cin >> n >> m >> d;\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1) {\n      if (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0) {\n        counter++;\n      }\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  cout << counter;\n}\n"}
{"label": "11", "index": "18963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 59 + c;\n    else if (b < 5)\n      n = 90 + c;\n    else if (b < 6)\n      n = 120 + c;\n    else if (b < 7)\n      n = 151 + c;\n    else if (b < 8)\n      n = 181 + c;\n    else if (b < 9)\n      n = 212 + c;\n    else if (b < 10)\n      n = 243 + c;\n    else if (b < 11)\n      n = 273 + c;\n    else if (b < 12)\n      n = 304 + c;\n    else\n      n = 334 + c;\n  } else {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 60 + c;\n    else if (b < 5)\n      n = 91 + c;\n    else if (b < 6)\n      n = 121 + c;\n    else if (b < 7)\n      n = 152 + c;\n    else if (b < 8)\n      n = 182 + c;\n    else if (b < 9)\n      n = 213 + c;\n    else if (b < 10)\n      n = 244 + c;\n    else if (b < 11)\n      n = 274 + c;\n    else if (b < 12)\n      n = 305 + c;\n    else\n      n = 335 + c;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18964", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, leap, sum;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 != 0)\n    leap = 0;\n  if (year % 4 == 0) {\n    if (year % 100 != 0)\n      leap = 1;\n    if (year % 100 == 0 && year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  if (leap == 0) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  int sum = 0;\n  int i;\n  int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 != 0) {\n    if (b == 1) {\n      cout << c << endl;\n    }\n    if (b > 1) {\n      for (i = 0; i < b - 1; i++)\n        sum = sum + m[i];\n      sum = sum + c;\n      printf(\"%d\\n\", sum);\n    }\n  }\n\n  if (a % 4 == 0) {\n    if (a % 100 != 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 100 == 0 && a % 400 != 0) {\n      if (b == 1) {\n        cout << c << endl;\n      }\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + m[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 400 == 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18966", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, year = 0,\n      mon = 0, day = 0, i = 0, sum = 0;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    sum = sum + a[i];\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "18967", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int yy, mm, dd, i, n = 0;\n  scanf(\"%d%d%d\", &yy, &mm, &dd);\n  if (yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0) {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n\n        n = n + 29;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    printf(\"%d\", n);\n\n  }\n\n  else {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n        n = n + 28;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "18968", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, leap, sum;\n  cin >> nian >> yue >> ri;\n  switch (yue) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  }\n  sum = sum + ri;\n  if ((nian % 400 == 0) || (nian % 4 == 0 && nian % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && nian > 3 && yue > 2)\n    sum++;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "18969", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, sum;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  sum = 0;\n  for (i = 1; i < b; i++) {\n    switch (i) {\n    case 1:\n      sum += 31;\n      break;\n    case 2:\n      if (a % 400 == 0 || (a % 100 != 0) && (a % 4 == 0)) {\n        sum += 29;\n      } else {\n        sum += 28;\n      }\n      break;\n    case 3:\n      sum += 31;\n      break;\n    case 4:\n      sum += 30;\n      break;\n    case 5:\n      sum += 31;\n      break;\n    case 6:\n      sum += 30;\n      break;\n    case 7:\n      sum += 31;\n      break;\n    case 8:\n      sum += 31;\n      break;\n    case 9:\n      sum += 30;\n      break;\n    case 10:\n      sum += 31;\n      break;\n    case 11:\n      sum += 30;\n      break;\n    case 12:\n      sum += 31;\n      break;\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int Y, M, D, x, y = 0, i, a[12], sum;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  a[0] = 31;\n  a[2] = 31;\n  a[4] = 31;\n  a[6] = 31;\n  a[7] = 31;\n  a[9] = 31;\n  a[11] = 31;\n  a[3] = 30;\n  a[5] = 30;\n  a[8] = 30;\n  a[10] = 30;\n  if (Y % 4 != 0)\n    a[1] = 28;\n  else if (Y % 4 == 0 && Y % 100 != 0)\n    a[1] = 29;\n  else if (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 1; i <= M; i++) {\n    x = a[M - i];\n    y = y + x;\n  }\n  sum = y + D - a[M - 1];\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int month[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, ans;\n  if (y % 400 == 0 || (y % 100 && y % 4 == 0))\n    month[2] = 29;\n  ans = 0;\n  for (i = 1; i < m; i++) {\n    ans += month[i];\n  }\n  ans += d;\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18972", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, k, s;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 10 != 0) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 60;\n      break;\n    }\n    case 4: {\n      k = 91;\n      break;\n    }\n    case 5: {\n      k = 121;\n      break;\n    }\n    case 6: {\n      k = 152;\n      break;\n    }\n    case 7: {\n      k = 182;\n      break;\n    }\n    case 8: {\n      k = 213;\n      break;\n    }\n    case 9: {\n      k = 244;\n      break;\n    }\n    case 10: {\n      k = 274;\n      break;\n    }\n    case 11: {\n      k = 305;\n      break;\n    }\n    case 12: {\n      k = 335;\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 59;\n      break;\n    }\n    case 4: {\n      k = 90;\n      break;\n    }\n    case 5: {\n      k = 120;\n      break;\n    }\n    case 6: {\n      k = 151;\n      break;\n    }\n    case 7: {\n      k = 181;\n      break;\n    }\n    case 8: {\n      k = 212;\n      break;\n    }\n    case 9: {\n      k = 243;\n      break;\n    }\n    case 10: {\n      k = 273;\n      break;\n    }\n    case 11: {\n      k = 304;\n      break;\n    }\n    case 12: {\n      k = 334;\n      break;\n    }\n    }\n  }\n\n  s = k + c;\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "11", "index": "18973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, days;\n  scanf(\"%d %d %d \", &year, &month, &days);\n  int day;\n  if (month == 1) {\n    day = days;\n  }\n  if (month == 2) {\n    day = 31 + days;\n  }\n  if (month == 3) {\n    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n      day = 31 + 29 + days;\n    else\n      day = 31 + 28 + days;\n  }\n  if (month == 4) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + days;\n    else\n      day = 31 + 28 + 31 + days;\n  }\n  if (month == 5) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + days;\n  }\n  if (month == 6) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 30 + 31 + 31 + days;\n  }\n  if (month == 7) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + days;\n  }\n  if (month == 8) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + days;\n  }\n  if (month == 9) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n  }\n  if (month == 10) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n  }\n  if (month == 11) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n  }\n  if (month == 12) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n  }\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int Day1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Day2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int sumday = 0;\n  int i, j;\n\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    j = 1;\n  else\n    j = 0;\n  if (j == 1) {\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day2[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << endl;\n    }\n  }\n  if (j == 0) {\n\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day1[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[1][i];\n    }\n  } else {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[0][i];\n    }\n  }\n  sum += d;\n  cout << sum << endl;\n}\n"}
{"label": "11", "index": "18976", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int k[20];\n  k[1] = 31;\n  k[2] = 28;\n  k[3] = 31;\n  k[4] = 30;\n  k[5] = 31;\n  k[6] = 30;\n  k[7] = 31;\n  k[8] = 31;\n  k[9] = 30;\n  k[10] = 31;\n  k[11] = 30;\n  k[12] = 31;\n  int i = 1;\n  int sum = 0;\n  while (i < b) {\n    sum = sum + k[i];\n    i++;\n  }\n  sum = sum + c;\n  if (b > 2) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n\n    {\n      sum++;\n    }\n  }\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "18977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d = c + 31;\n  int e = c + 60;\n  int f = c + 91;\n  int g = c + 121;\n  int h = c + 152;\n  int i = c + 182;\n  int j = c + 213;\n  int k = c + 244;\n  int l = c + 274;\n  int m = c + 305;\n  int n = c + 335;\n  int o = c + 59;\n  int p = c + 90;\n  int q = c + 120;\n  int r = c + 151;\n  int s = c + 181;\n  int t = c + 212;\n  int u = c + 243;\n  int v = c + 273;\n  int w = c + 304;\n  int x = c + 334;\n  if (b == 1)\n    printf(\"%d\\n\", c);\n  else if (b == 2)\n    printf(\"%d\\n\", d);\n  if (b > 2 && ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", e);\n    else if (b == 4)\n      printf(\"%d\\n\", f);\n    else if (b == 5)\n      printf(\"%d\\n\", g);\n    else if (b == 6)\n      printf(\"%d\\n\", h);\n    else if (b == 7)\n      printf(\"%d\\n\", i);\n    else if (b == 8)\n      printf(\"%d\\n\", j);\n    else if (b == 9)\n      printf(\"%d\\n\", k);\n    else {\n      if (b == 10)\n        printf(\"%d\\n\", l);\n      else if (b == 11)\n        printf(\"%d\\n\", m);\n      else if (b == 12)\n        printf(\"%d\\n\", n);\n    }\n  } else if (b > 2 && ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", o);\n    else if (b == 4)\n      printf(\"%d\\n\", p);\n    else if (b == 5)\n      printf(\"%d\\n\", q);\n    else if (b == 6)\n      printf(\"%d\\n\", r);\n    else if (b == 7)\n      printf(\"%d\\n\", s);\n    else if (b == 8)\n      printf(\"%d\\n\", t);\n    else if (b == 9)\n      printf(\"%d\\n\", u);\n    else if (b == 10)\n      printf(\"%d\\n\", v);\n    else if (b == 11)\n      printf(\"%d\\n\", w);\n    else if (b == 12)\n      printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f1(int y, int r) {\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint f2(int y, int r) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint main() {\n  int a, y, r, d;\n  scanf(\"%d%d%d\", &a, &y, &r);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0))\n    d = f1(y, r);\n  else\n    d = f2(y, r);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "18979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[1][i];\n    }\n  } else {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[0][i];\n    }\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[13], X, B;\n  int N;\n  cin >> N >> X >> B;\n  if (N % 100)\n    if (N % 4 == 0)\n      A[2] = 29;\n    else\n      A[2] = 28;\n  else if (N % 400 == 0)\n    A[2] = 29;\n  else\n    A[2] = 28;\n  A[1] = A[3] = A[5] = A[7] = A[8] = A[10] = A[11] = 31;\n  A[4] = A[6] = A[9] = A[11] = 30;\n  int Ans = B;\n  for (int I = 1; I < X; I++)\n    Ans += A[I];\n  cout << Ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (b == 1) {\n\n    d = c;\n  }\n\n  else if (b == 2) {\n    d = 31 + c;\n\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n\n      if (b == 3) {\n        d = 31 + 29 + c;\n      }\n      if (b == 4) {\n        d = 31 + 29 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 29 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 29 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    } else {\n      if (b == 3) {\n        d = 31 + 28 + c;\n      }\n      if (b == 4)\n        d = 31 + 28 + 31 + c;\n\n      if (b == 5) {\n        d = 31 + 28 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 28 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    }\n  }\n  cout << d;\n\n  return 0;\n}\n"}
{"label": "11", "index": "18982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "18983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, D;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  D = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || ((y % 400) == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      D = D + p[i];\n    }\n    D = D + d + 1;\n    printf(\"%d\", D);\n  } else {\n    for (i = 0; i < m - 1; i++)\n      D = D + p[i];\n\n    D = D + d;\n    printf(\"%d\", D);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 29 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 29 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      cout << d;\n    } else if (b == 7) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      cout << d;\n    } else if (b == 10) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n\n  } else if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1) {\n      d = c;\n      cout << d;\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 28 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 28 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "18985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, d;\n  int result = 0;\n  int i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 31, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &d);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    a[2] = a[2] + 1;\n    for (i = 1; i < month; i++)\n      result += a[i];\n\n    result += d;\n  } else\n    for (i = 1; i < month; i++)\n      result += a[i];\n\n  result += d;\n  cout << result << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "18986", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, x;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 60 + c;\n\n    else if (b == 4)\n      x = 91 + c;\n\n    else if (b == 5)\n      x = 121 + c;\n\n    else if (b == 6)\n      x = 152 + c;\n\n    else if (b == 7)\n      x = 182 + c;\n\n    else if (b == 8)\n      x = 213 + c;\n\n    else if (b == 9)\n      x = 244 + c;\n\n    else if (b == 10)\n      x = 274 + c;\n\n    else if (b == 11)\n      x = 305 + c;\n\n    else if (b == 12)\n      x = 335 + c;\n\n  }\n\n  else {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 59 + c;\n\n    else if (b == 4)\n      x = 90 + c;\n\n    else if (b == 5)\n      x = 120 + c;\n\n    else if (b == 6)\n      x = 151 + c;\n\n    else if (b == 7)\n      x = 181 + c;\n\n    else if (b == 8)\n      x = 212 + c;\n\n    else if (b == 9)\n      x = 243 + c;\n\n    else if (b == 10)\n      x = 273 + c;\n    else if (b == 11)\n      x = 304 + c;\n\n    else if (b == 12)\n      x = 334 + c;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "18987", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "18988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i;\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d\", &y);\n  scanf(\"%d\", &m);\n  scanf(\"%d\", &d);\n  if ((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))\n    for (i = 0; i < m - 1; i++)\n      x = x + a[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      x = x + b[i];\n  x = x + d;\n  cout << x;\n}\n"}
{"label": "11", "index": "18989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 29 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 29 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  } else\n\n  {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 28 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 28 + 31 + c;\n      cout << x;\n    } else if (b == 5) {\n      x = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  }\n}\n"}
{"label": "11", "index": "18990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int sum = 0;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      for (int i = 0; i <= (month - 2); i++) {\n        sum += mon[i];\n      }\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  } else if (year % 4 != 0 || year % 100 == 0 && year % 400 != 0) {\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (int i = 0; i <= (month - 2); i++) {\n        sum += mon[i];\n      }\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "18991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int n;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 29 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 29 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 29 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  } else {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 28 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 28 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 28 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint panduan(int(year));\nint main() {\n  int sum = 0, year, month, day;\n  int i;\n  int Month1[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Month2[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (panduan(year) == 1) {\n    for (i = 1; i < month; i++)\n      sum += Month1[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += Month2[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  }\n  return 0;\n}\nint panduan(int year) {\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "18993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, m, day, i, x;\n  cin >> a >> m >> day;\n  switch (m) {\n  case 1:\n    i = 0;\n    break;\n  case 2:\n    i = 31;\n    break;\n  case 3:\n    i = 31 + 28;\n    break;\n  case 4:\n    i = 31 + 28 + 31;\n    break;\n  case 5:\n    i = 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    i = 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    i = 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  default:\n    cout << \"error\" << endl;\n  }\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if ((m != 1) && (m != 2))\n      x = i + day + 1;\n    else\n      x = i + day;\n  } else\n    x = i + day;\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "18994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 100 == 0 && y % 400 == 0)\n    n[1] = 29;\n  if (y % 100 != 0 && y & 4 == 0)\n    n[1] = 29;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++)\n    sum = sum + n[i];\n  printf(\"%d\\n\", sum + d);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "18995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, s = 0, d = 0;\n  int i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && ((a % 100) != 0)) || ((a % 400) == 0)) {\n    d = 1;\n  }\n\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) ||\n        (i == 12)) {\n      s = s + 31;\n    }\n    if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      s = s + 30;\n    }\n    if (i == 2) {\n      if (d == 0) {\n        s = s + 28;\n      }\n      if (d == 1) {\n        s = s + 29;\n      }\n    }\n  }\n  s = s + c;\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "18996", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0, days, year, month;\n  cin >> year >> month >> days;\n  for (i = 0; i < month - 1; i++)\n    sum = sum + a[i];\n\n  sum = sum + days;\n  if ((month == 2 && days >= 28) || (month > 2)) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      sum = sum + 1;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "18997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n, s[12], i, t;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  t = 0;\n  for (i = 0; i < b - 1; i++) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n      s[1] = 29;\n      t = s[i] + t;\n    } else {\n      s[1] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "18998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint isrunnian(int year) {\n  if (year % 400 == 0)\n    return 1;\n  else if (year % 4 == 0 && year % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  else if (m == 2)\n    printf(\"%d\\n\", 31 + d);\n  else if (m == 3) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + d);\n  } else if (m == 4) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + d);\n  } else if (m == 5) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + d);\n  } else if (m == 6) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 30 + 31 + 31 + d);\n  } else if (m == 7) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + d);\n  } else if (m == 8) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + d);\n  } else if (m == 9) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n  } else if (m == 10) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n    else\n      cout << 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d << \"\\n\";\n  } else if (m == 11) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n  } else if (m == 12) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "18999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 60 + day;\n      break;\n    case 4:\n      n = 91 + day;\n      break;\n    case 5:\n      n = 121 + day;\n      break;\n    case 6:\n      n = 152 + day;\n      break;\n    case 7:\n      n = 182 + day;\n      break;\n    case 8:\n      n = 213 + day;\n      break;\n    case 9:\n      n = 244 + day;\n      break;\n    case 10:\n      n = 274 + day;\n      break;\n    case 11:\n      n = 305 + day;\n      break;\n    case 12:\n      n = 335 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 30 + day;\n      break;\n    case 3:\n      n = 59 + day;\n      break;\n    case 4:\n      n = 90 + day;\n      break;\n    case 5:\n      n = 120 + day;\n      break;\n    case 6:\n      n = 151 + day;\n      break;\n    case 7:\n      n = 181 + day;\n      break;\n    case 8:\n      n = 212 + day;\n      break;\n    case 9:\n      n = 243 + day;\n      break;\n    case 10:\n      n = 273 + day;\n      break;\n    case 11:\n      n = 304 + day;\n      break;\n    case 12:\n      n = 334 + day;\n      break;\n    }\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, k, leap = 0, i, sum = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    leap = 1;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      k = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      k = 30;\n      break;\n    case 2:\n      if (leap == 1)\n        k = 29;\n      else\n        k = 28;\n      break;\n    }\n    sum += k;\n  }\n  cout << sum + d;\n  return 0;\n}\n"}
{"label": "11", "index": "19001", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, February, day;\n  scanf(\"%d %d %d \", &year, &month, &date);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    February = 29;\n  else\n    February = 28;\n  if (month == 1)\n    day = date;\n  if (month == 2)\n    day = 31 + date;\n  if (month == 3)\n    day = 31 + February + date;\n  if (month == 4)\n    day = 31 + February + 31 + date;\n  if (month == 5)\n    day = 31 + February + 31 + 30 + date;\n  if (month == 6)\n    day = 31 + February + 31 + 30 + 31 + date;\n  if (month == 7)\n    day = 31 + February + 31 + 30 + 31 + 30 + date;\n  if (month == 8)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + date;\n  if (month == 9)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + date;\n  if (month == 10)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n  if (month == 11)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n  if (month == 12)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19002", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, md = 0, d, day, i;\n  cin >> y >> m >> d;\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < m - 1; i++)\n    md = md + month[i];\n\n  day = md + d;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int year;\n  int month;\n  int day;\n} date;\nint main() {\n  int days;\n  scanf(\"%d%d%d\", &date.year, &date.month, &date.day);\n  switch (date.month) {\n  case 1:\n    days = date.day;\n    break;\n  case 2:\n    days = date.day + 31;\n    break;\n  case 3:\n    days = date.day + 59;\n    break;\n  case 4:\n    days = date.day + 90;\n    break;\n  case 5:\n    days = date.day + 120;\n    break;\n  case 6:\n    days = date.day + 151;\n    break;\n  case 7:\n    days = date.day + 181;\n    break;\n  case 8:\n    days = date.day + 212;\n    break;\n  case 9:\n    days = date.day + 243;\n    break;\n  case 10:\n    days = date.day + 273;\n    break;\n  case 11:\n    days = date.day + 304;\n    break;\n  case 12:\n    days = date.day + 334;\n    break;\n  }\n  if ((date.year % 4 == 0 && date.year % 100 != 0 || date.year % 400 == 0) &&\n      date.month >= 3)\n    days += 1;\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19004", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i;\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y;\n  scanf(\"%d\", &m);\n  cin >> d;\n  if ((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))\n    for (i = 0; i < m - 1; i++)\n      x = x + a[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      x = x + b[i];\n  x = x + d;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "19005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, s = 0;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    for (i = 0; i < m - 1; i++)\n      s += m2[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      s += m1[i];\n  cout << s + d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19006", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day, num = 0, i, a[11];\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (year % 4 != 0) {\n    a[1] = 28;\n  } else if (year % 100 == 0) {\n    if (year % 400 == 0)\n      a[1] = 29;\n    else\n      a[1] = 28;\n  } else\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++) {\n    num = num + a[i];\n  }\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19007", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i, y, m, d, s;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 > 0)) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n\n  a[1] = 31;\n  a[3] = 31;\n  a[5] = 31;\n  a[7] = 31;\n  a[8] = 31;\n  a[10] = 31;\n  a[12] = 31;\n  a[4] = 30;\n  a[6] = 30;\n  a[9] = 30;\n  a[11] = 30;\n  s = 0;\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n  s = s + d;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i,\n      rank = 0, y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)\n    max[2] += 1;\n  ;\n  for (i = 1; i < m; i++) {\n    rank += max[i];\n  }\n  rank += d;\n  cout << rank;\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "11", "index": "19009", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[3], leap = 1, day;\n  cin >> a[0] >> a[1] >> a[2];\n  if ((((a[0] % 4) && !(a[0] % 100))) || (a[0] % 400))\n    leap = 0;\n  if (a[1] == 1)\n    day = a[2];\n  if (a[1] == 2)\n    day = a[2] + 31;\n  if (a[1] == 3)\n    day = a[2] + 59 + leap;\n  if (a[1] == 4)\n    day = a[2] + 90 + leap;\n  if (a[1] == 5)\n    day = a[2] + 120 + leap;\n  ;\n  if (a[1] == 6)\n    day = a[2] + 151 + leap;\n  if (a[1] == 7)\n    day = a[2] + 181 + leap;\n  if (a[1] == 8)\n    day = a[2] + 212 + leap;\n  if (a[1] == 9)\n    day = a[2] + 243 + leap;\n  if (a[1] == 10)\n    day = a[2] + 273 + leap;\n  if (a[1] == 11)\n    day = a[2] + 304 + leap;\n  if (a[1] == 12)\n    day = a[2] + 334 + leap;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (z == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 29;\n    }\n    x = x + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 28;\n    }\n    x = x + d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, daysum = 0;\n  cin >> y >> m >> d;\n  int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int dayleap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 != 0) || ((y % 100 == 0) && (y % 400 != 0))) {\n    for (int i = 0; i < m; i++)\n      daysum += day[i];\n    daysum += d;\n  } else {\n    for (int i = 0; i < m; i++)\n      daysum += dayleap[i];\n    daysum += d;\n  }\n  printf(\"%d\", daysum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, date, num;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d\", &year, &month, &date);\n    switch (month) {\n    case 1:\n      num = 0;\n      break;\n    case 2:\n      num = 31;\n      break;\n    case 3:\n      num = 59;\n      break;\n    case 4:\n      num = 90;\n      break;\n    case 5:\n      num = 120;\n      break;\n    case 6:\n      num = 151;\n      break;\n    case 7:\n      num = 181;\n      break;\n    case 8:\n      num = 212;\n      break;\n    case 9:\n      num = 243;\n      break;\n    case 10:\n      num = 273;\n      break;\n    case 11:\n      num = 304;\n      break;\n    case 12:\n      num = 334;\n      break;\n    }\n    if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month > 2)\n      num += 1;\n    num += date;\n    printf(\"%d\\n\", num);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, e;\n  int s[12];\n  int d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    s[1] = 29;\n  else\n    s[1] = 28;\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  for (i = 1; i <= b; i++) {\n    d = d + s[i - 2];\n  }\n  e = d + c;\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, n, z, y;\n  scanf(\"%d%d%d\", &x, &n, &z);\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0) {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 29 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n\n  else {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 28 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    cin >> a >> b >> c;\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n          d = d + 29;\n        } else {\n          d = d + 28;\n        }\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j = j + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, daysum = 0;\n  cin >> y >> m >> d;\n  int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int dayleap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 != 0) || ((y % 100 == 0) && (y % 400 != 0))) {\n    for (int i = 0; i < m; i++)\n      daysum += day[i];\n    daysum += d;\n  } else {\n    for (int i = 0; i < m; i++)\n      daysum += dayleap[i];\n    daysum += d;\n  }\n  cout << daysum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0, i, h;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    days[1] = 29;\n  } else {\n    days[1] = 28;\n  }\n  for (i = 0; i < m - 1; i++) {\n    sum = sum + days[i];\n  }\n  h = sum + d;\n  cout << h;\n  return 0;\n}\n"}
{"label": "11", "index": "19019", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int a = 0;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 29 + date;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 28 + date;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 28 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, tian, i = 1;\n  for (; i <= 5; i = i + 1) {\n    scanf(\"%d %d %d\\n\", &nian, &yue, &ri);\n    if (nian % 4 == 0 && nian % 100 != 0 ||\n        nian % 100 == 0 && nian % 400 == 0) {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 60;\n        break;\n      case 4:\n        tian = 91;\n        break;\n      case 5:\n        tian = 121;\n        break;\n      case 6:\n        tian = 152;\n        break;\n      case 7:\n        tian = 182;\n        break;\n      case 8:\n        tian = 213;\n        break;\n      case 9:\n        tian = 244;\n        break;\n      case 10:\n        tian = 274;\n        break;\n      case 11:\n        tian = 305;\n        break;\n      case 12:\n        tian = 335;\n        break;\n      }\n    } else {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 59;\n        break;\n      case 4:\n        tian = 90;\n        break;\n      case 5:\n        tian = 120;\n        break;\n      case 6:\n        tian = 151;\n        break;\n      case 7:\n        tian = 181;\n        break;\n      case 8:\n        tian = 212;\n        break;\n      case 9:\n        tian = 243;\n        break;\n      case 10:\n        tian = 273;\n        break;\n      case 11:\n        tian = 304;\n        break;\n      case 12:\n        tian = 334;\n        break;\n      }\n    }\n    tian = tian + ri;\n    cout << tian << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, d = 0;\n\n  cin >> year >> month >> day;\n\n  switch (month) {\n  case 1:\n    d = 0;\n    break;\n  case 2:\n    d = 31;\n    break;\n\n  case 3:\n    d = 59;\n    break;\n\n  case 4:\n    d = 90;\n    break;\n\n  case 5:\n    d = 120;\n    break;\n\n  case 6:\n    d = 151;\n    break;\n\n  case 7:\n    d = 181;\n    break;\n\n  case 8:\n    d = 212;\n    break;\n\n  case 9:\n    d = 243;\n    break;\n\n  case 10:\n    d = 273;\n    break;\n\n  case 11:\n    d = 304;\n    break;\n\n  case 12:\n    d = 334;\n    break;\n  }\n  if ((month > 2) && (year % 400 == 0)) {\n    d = d + 1 + day;\n  } else if ((month > 2) && (year % 100 != 0) && (year % 4 == 0))\n    d = d + 1 + day;\n\n  else {\n    d = d + day;\n  }\n\n  cout << d << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19022", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, k, leap = 0, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    leap = 1;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      k = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      k = 30;\n      break;\n    case 2:\n      if (leap == 1) {\n        k = 29;\n      } else\n        k = 28;\n      break;\n    }\n    sum += k;\n  }\n  cout << sum + d;\n  return 0;\n}\n"}
{"label": "11", "index": "19023", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint X1(int y, int z) \n{\n  int j;\n  switch (y) \n  {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 59 + z;\n    break;\n  case 4:\n    j = 90 + z;\n    break;\n  case 5:\n    j = 120 + z;\n    break;\n  case 6:\n    j = 151 + z;\n    break;\n  case 7:\n    j = 181 + z;\n    break;\n  case 8:\n    j = 212 + z;\n    break;\n  case 9:\n    j = 243 + z;\n    break;\n  case 10:\n    j = 273 + z;\n    break;\n  case 11:\n    j = 304 + z;\n    break;\n  default:\n    j = 334 + z;\n    break;\n  }\n  return (j);\n}\nint X2(int y, int z) \n{\n  int j;\n  switch (y) \n  {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 60 + z;\n    break;\n  case 4:\n    j = 91 + z;\n    break;\n  case 5:\n    j = 121 + z;\n    break;\n  case 6:\n    j = 152 + z;\n    break;\n  case 7:\n    j = 182 + z;\n    break;\n  case 8:\n    j = 213 + z;\n    break;\n  case 9:\n    j = 244 + z;\n    break;\n  case 10:\n    j = 274 + z;\n    break;\n  case 11:\n    j = 305 + z;\n    break;\n  default:\n    j = 335 + z;\n    break;\n  }\n  return (j);\n}\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  cout << endl;\n  int num;\n  if (y % 100 == 0) { \n    if (y % 400 == 0) \n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  } else {\n    if (y % 4 == 0) \n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      sum += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2 && y % 400 == 0 || y % 4 == 0 && y % 100 != 0) {\n      sum = sum + 29;\n    } else if (i == 2)\n      sum += 28;\n  }\n  sum = sum + d;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, number;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1)\n    number = day;\n  else if (month == 2)\n    number = 31 + day;\n  else {\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      if (month == 3)\n        number = 60 + day;\n      else if (month == 4)\n        number = 91 + day;\n      else if (month == 5)\n        number = day + 121;\n      else if (month == 6)\n        number = day + 152;\n      else if (month == 7)\n        number = day + 182;\n      else if (month == 8)\n        number = day + 213;\n      else if (month == 9)\n        number = day + 244;\n      else if (month == 10) {\n        number = day + 274;\n      } else if (month == 11) {\n        number = day + 305;\n      } else if (month == 12)\n        number = day + 335;\n    } else {\n      if (month == 3)\n        number = 59 + day;\n      else if (month == 4)\n        number = 90 + day;\n      else if (month == 5)\n        number = day + 120;\n      else if (month == 6)\n        number = day + 151;\n      else if (month == 7)\n        number = day + 181;\n      else if (month == 8)\n        number = day + 212;\n      else if (month == 9)\n        number = day + 243;\n      else if (month == 10)\n        number = day + 273;\n      else if (month == 11)\n        number = day + 304;\n      else if (month == 12)\n        number = day + 334;\n    }\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "19027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, date, day = 0;\n  cin >> year >> mon >> date;\n  switch (mon) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = 31 + date;\n    break;\n  case 3:\n    day = 31 + 28 + date;\n    break;\n  case 4:\n    day = 31 + 28 + 31 + date;\n    break;\n  case 5:\n    day = 31 + 28 + 31 + 30 + date;\n    break;\n  case 6:\n    day = 31 + 28 + 31 + 30 + 31 + date;\n    break;\n  case 7:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + date;\n    break;\n  case 8:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + date;\n    break;\n  case 9:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n    break;\n  case 10:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n    break;\n  case 11:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n    break;\n  case 12:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n    break;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (mon > 2)\n      day++;\n  }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "19028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, dm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day = 0,\n            month = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    dm[1] = 29;\n  int i, d = 0;\n  for (i = 0; i < month - 1; i++)\n    d += dm[i];\n  d += day;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, y, r, s = 0, i;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  int a[12];\n  a[0] = 31, a[1] = 28, a[2] = 31, a[3] = 30, a[4] = 31, a[5] = 30, a[6] = 31,\n  a[7] = 31, a[8] = 30, a[9] = 31, a[10] = 30, a[11] = 31;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    a[1] = 29;\n  for (i = 0; i < y - 1; i++)\n    s = s + a[i];\n  s = s + r;\n  printf(\"%d\\n\", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19030", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, e;\n  int s[12];\n  int d = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    s[1] = 29;\n  else\n    s[1] = 28;\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  for (i = 1; i <= b; i++) {\n    d = d + s[i - 2];\n  }\n  e = d + c;\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {0}, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0)\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 1; i < 12; i++) {\n    b[0] = a[0];\n    b[i] = b[i - 1] + a[i];\n  }\n  if (m == 1)\n    cout << d << endl;\n  else if (m != 1)\n    printf(\"%d\\n\", b[m - 2] + d);\n  return 0;\n}\n"}
{"label": "11", "index": "19032", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint runnian(int a) {\n  if (a % 4 == 0 && a % 400 == 0)\n    return 1;\n  if (a % 4 == 0 && a % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint tian(int nian, int yue, int ri) {\n  int sum = 0, i;\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int feirun[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (runnian(nian) == 1) {\n    for (i = 0; i <= yue - 2; i++)\n      sum += run[i];\n    sum += ri;\n  } else {\n    for (i = 0; i <= yue - 2; i++)\n      sum += feirun[i];\n    sum += ri;\n  }\n  return sum;\n}\n\nint main() {\n  int nian, yue, ri;\n  cin >> nian >> yue >> ri;\n  cout << tian(nian, yue, ri) << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19033", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, a;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 60;\n    if (month == 4)\n      a = day + 91;\n    if (month == 5)\n      a = day + 121;\n    if (month == 6)\n      a = day + 152;\n    if (month == 7)\n      a = day + 182;\n    if (month == 8)\n      a = day + 213;\n    if (month == 9)\n      a = day + 244;\n    if (month == 10)\n      a = day + 274;\n    if (month == 11)\n      a = day + 305;\n    if (month == 12)\n      a = day + 335;\n  } else {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 59;\n    if (month == 4)\n      a = day + 90;\n    if (month == 5)\n      a = day + 120;\n    if (month == 6)\n      a = day + 151;\n    if (month == 7)\n      a = day + 181;\n    if (month == 8)\n      a = day + 212;\n    if (month == 9)\n      a = day + 243;\n    if (month == 10)\n      a = day + 273;\n    if (month == 11)\n      a = day + 304;\n    if (month == 12)\n      a = day + 334;\n  };\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, total = 0, i;\n  int mon[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                    {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 1; i < month; i++)\n      total += mon[1][i];\n    total += day;\n  } else {\n    for (i = 1; i < month; i++)\n      total += mon[0][i];\n    total += day;\n  }\n  cout << total << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19035", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, n, z, y;\n  scanf(\"%d %d %d \", &x, &n, &z);\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0) {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 29 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n\n  else {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 28 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, g, i, e = 0, day;\n  int montha[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int monthb[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> year >> mon >> g;\n\n  for (i = 0; i < mon; i++) {\n    if (year % 4 == 0) {\n      if (year % 100 == 0 && year % 400 != 0) {\n        e = e + montha[i];\n\n        day = e + g;\n      } else {\n        e = e + monthb[i];\n        day = e + g;\n      }\n    }\n    if (year % 4 != 0) {\n      e = e + montha[i];\n      day = e + g;\n    }\n  }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "19037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint y, m, d;\nint a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nvoid cal(int x) {\n  int sum = 0, i;\n  if (x) {\n    for (i = 0; i < m - 1; i++)\n      sum += b[i];\n    sum += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      sum += a[i];\n    sum += d;\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      cal(1);\n    else\n      cal(0);\n  } else {\n    if (y % 4 == 0)\n      cal(1);\n    else\n      cal(0);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19038", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, n;\n  int m = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        n = 29;\n      else\n        n = 28;\n    else\n      n = 29;\n  else\n    n = 28;\n  if (month == 1) {\n    printf(\"%d\", day);\n    return 0;\n  }\n  if (month == 2) {\n    m = 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 3) {\n    m = 31 + n + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 4) {\n    m = 31 + n + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 5) {\n    m = 31 + n + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 6) {\n    m = 31 + n + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 7) {\n    m = 31 + n + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 8) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 9) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 10) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 11) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 12) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint run(int nian) {\n  if (nian % 400 == 0)\n    return 1;\n  else if (nian % 100 == 0)\n    return 0;\n  else if (nian % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint mon(int m, int n) {\n  switch (m) {\n  case 1:\n  case 3:\n  case 5:\n  case 7:\n  case 8:\n  case 10:\n    return 31;\n  case 4:\n  case 6:\n  case 9:\n  case 11:\n    return 30;\n  default:\n    if (run(n))\n      return 29;\n    else\n      return 28;\n  }\n}\n\nint main() {\n  int year, month, day, date, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  date = 0;\n  for (i = 1; i < month; i++)\n    date = date + mon(i, year);\n  date = date + day;\n  cout << date;\n  return 0;\n}\n"}
{"label": "11", "index": "19040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, n, z, y;\n  scanf(\"%d %d %d \", &x, &n, &z);\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0) {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 29 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n\n  else {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      cout << y;\n    } else if (n == 3) {\n      y = 31 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 28 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    default:\n      d = 0;\n    }\n  else\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    default:\n      d = 0;\n    }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19042", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leap(int year) {\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day;\n  int days, i;\n  days = 0;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    if (i == 2) {\n      if (leap(year))\n        days += 29;\n      else {\n        days += 28;\n      }\n    }\n  }\n  days += day;\n  printf(\"%d\\n\", days);\n}\n"}
{"label": "11", "index": "19043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint rui(int y, int m) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) && m == 2)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int d = 0, y, m, r, i;\n  int pp[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &r);\n  for (i = 1; i < m; i++)\n    d = d + pp[i] + rui(y, i);\n  d = d + r;\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  int a = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    a = 1;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 59 + day;\n  if (month == 4)\n    n = 90 + day;\n  if (month == 5)\n    n = 120 + day;\n  if (month == 6)\n    n = 151 + day;\n  if (month == 7)\n    n = 181 + day;\n  if (month == 8)\n    n = 212 + day;\n  if (month == 9)\n    n = 243 + day;\n  if (month == 10)\n    n = 273 + day;\n  if (month == 11)\n    n = 304 + day;\n  if (month == 12)\n    n = 334 + 12;\n  if (month > 2 && a == 1)\n    n++;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, a, b, m, n;\n  scanf(\"%d%d%d\", &year, &a, &b);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = 0;\n      break;\n    case 4:\n      m = 1;\n      break;\n    case 5:\n      m = 1;\n      break;\n    case 6:\n      m = 2;\n      break;\n    case 7:\n      m = 2;\n      break;\n    case 8:\n      m = 3;\n      break;\n    case 9:\n      m = 4;\n      break;\n    case 10:\n      m = 4;\n      break;\n    case 11:\n      m = 5;\n      break;\n    case 12:\n      m = 5;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  } else {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = -1;\n      break;\n    case 4:\n      m = 0;\n      break;\n    case 5:\n      m = 0;\n      break;\n    case 6:\n      m = 1;\n      break;\n    case 7:\n      m = 1;\n      break;\n    case 8:\n      m = 2;\n      break;\n    case 9:\n      m = 3;\n      break;\n    case 10:\n      m = 3;\n      break;\n    case 11:\n      m = 4;\n      break;\n    case 12:\n      m = 4;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, c, days = 0, i;\n  int M[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    c = 1;\n  else\n    c = 0;\n  if (month == 1)\n    cout << day;\n  else {\n    for (i = 0; i < month - 1; i++)\n      days += M[c][i];\n\n    cout << days + day;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    a[1] = 29;\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  } else {\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  }\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  unsigned long int year, month, day, b[30][3];\n  int a, c, d, i;\n  for (i = 0; i < 5; i++) {\n    cin >> year >> month >> day;\n    b[i][0] = year;\n    b[i][1] = month;\n    b[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = b[i][0];\n    month = b[i][1];\n    day = b[i][2];\n    a = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n    if (a == 1) {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 29;\n        break;\n      case 4:\n        c = 31 + 29 + 31;\n        break;\n      case 5:\n        c = 31 + 29 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 29 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n\n    } else {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 28;\n        break;\n      case 4:\n        c = 31 + 28 + 31;\n        break;\n      case 5:\n        c = 31 + 28 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 28 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    d = c + day;\n    cout << d << \"\\n\";\n  }\n}\n"}
{"label": "11", "index": "19049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int z;\n  z = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int m[12];\n  m[0] = 31;\n  if (year % 4 == 0) {\n    m[1] = 29;\n    if (year % 100 == 0)\n      m[1] = 28;\n    if (year % 400 == 0)\n      m[1] = 29;\n  } else\n    m[1] = 28;\n  m[2] = 31;\n  m[3] = 30;\n  m[4] = 31;\n  m[5] = 30;\n  m[6] = 31;\n  m[7] = 31;\n  m[8] = 30;\n  m[9] = 31;\n  m[10] = 30;\n  m[11] = 31;\n  int i;\n  for (i = 0; i < month - 1; i++)\n    z = z + m[i];\n  cout << z + day << \" \";\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19050", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, a, i, ans;\n  for (i = 1; i <= 5; i++) {\n    cin >> y >> m >> d;\n\n    if (y % 4 != 0)\n      a = 1;\n    else if (y % 100 != 0)\n      a = 0;\n    else if (y % 400 != 0)\n      a = 1;\n    else\n      a = 0;\n    if (a) {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 59 + d;\n        break;\n      case 4:\n        ans = 90 + d;\n        break;\n      case 5:\n        ans = 120 + d;\n        break;\n      case 6:\n        ans = 151 + d;\n        break;\n      case 7:\n        ans = 181 + d;\n        break;\n      case 8:\n        ans = 212 + d;\n        break;\n      case 9:\n        ans = 243 + d;\n        break;\n      case 10:\n        ans = 273 + d;\n        break;\n      case 11:\n        ans = 304 + d;\n        break;\n      case 12:\n        ans = 334 + d;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 60 + d;\n        break;\n      case 4:\n        ans = 91 + d;\n        break;\n      case 5:\n        ans = 121 + d;\n        break;\n      case 6:\n        ans = 152 + d;\n        break;\n      case 7:\n        ans = 182 + d;\n        break;\n      case 8:\n        ans = 213 + d;\n        break;\n      case 9:\n        ans = 244 + d;\n        break;\n      case 10:\n        ans = 274 + d;\n        break;\n      case 11:\n        ans = 305 + d;\n        break;\n      case 12:\n        ans = 335 + d;\n        break;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, d, m, i, j, e = 0, total = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n    a[1] = 29;\n  for (i = 1; i < m; i++) {\n    total += a[i - 1];\n  }\n  total += d;\n  cout << total << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19052", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint run(int a) {\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int isr = run(y);\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days = 0;\n  for (int i = 1; i < m; i++) {\n    days = days + p[i];\n  }\n  days = days + d;\n  if (isr == 1 && m >= 3)\n    days++;\n  cout << days;\n}\n"}
{"label": "11", "index": "19053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  int i = 0;\n  int n[12];\n  sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n\n  if ((y % 4 == 0) && (y % 100 != 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 != 0)) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 == 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if (y % 4 != 0) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + n[i];\n    }\n    sum = sum + d;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 60 + c);\n    else if (b == 4)\n      printf(\"%d\", 91 + c);\n    else if (b == 5)\n      printf(\"%d\", 121 + c);\n    else if (b == 6)\n      printf(\"%d\", 152 + c);\n    else if (b == 7)\n      printf(\"%d\", 182 + c);\n    else if (b == 8)\n      printf(\"%d\", 213 + c);\n    else if (b == 9)\n      printf(\"%d\", 244 + c);\n    else if (b == 10)\n      printf(\"%d\", 274 + c);\n    else if (b == 11)\n      printf(\"%d\", 305 + c);\n    else if (b == 12)\n      printf(\"%d\", 336 + c);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 59 + c);\n    else if (b == 4)\n      printf(\"%d\", 90 + c);\n    else if (b == 5)\n      printf(\"%d\", 120 + c);\n    else if (b == 6)\n      printf(\"%d\", 151 + c);\n    else if (b == 7)\n      printf(\"%d\", 181 + c);\n    else if (b == 8)\n      printf(\"%d\", 212 + c);\n    else if (b == 9)\n      printf(\"%d\", 243 + c);\n    else if (b == 10)\n      printf(\"%d\", 273 + c);\n    else if (b == 11)\n      printf(\"%d\", 304 + c);\n    else if (b == 12)\n      printf(\"%d\", 335 + c);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19055", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int sum = 0;\n  cin >> year >> month >> date;\n  int temp;\n  if (year % 4 != 0) {\n    temp = 28;\n  } else if (year % 100 != 0) {\n    temp = 29;\n  } else if (year % 400 != 0) {\n    temp = 28;\n  } else {\n    temp = 29;\n  }\n  int a[12] = {31, temp, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19056", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, day, m;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 4 == 0 && a % 400 == 0) {\n    m = 29;\n  } else {\n    m = 28;\n  }\n  switch (b) {\n  case 1:\n    day = c;\n    break;\n  case 2:\n    day = 31 + c;\n    break;\n  case 3:\n    day = 31 + m + c;\n    break;\n  case 4:\n    day = 31 + m + 31 + c;\n    break;\n  case 5:\n    day = 31 + m + 31 + 30 + c;\n    break;\n  case 6:\n    day = 31 + m + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    day = 31 + m + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 31 + 30 + c;\n    break;\n  case 12:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 30 + 31 + c;\n    break;\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19057", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n\n  n += day;\n\n  if (month > 2 && isleapyear(year))\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "19058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, which;\n  cin >> year >> month >> day;\n  which = day;\n  month--;\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    if (year % 4 != 0)\n      which += 28;\n    else if (year % 100 == 0 && year % 400 != 0)\n      which += 28;\n    else\n      which += 29;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  printf(\"%d\", which);\n  return 0;\n}\n"}
{"label": "11", "index": "19060", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A, B, C, a, b, c, d, e, f, g, h, i, j, k, l, m;\n  cin >> A >> B >> C;\n  a = 31;\n  if ((A % 4 == 0 && A % 100 != 0) || A % 400 == 0)\n    b = 29;\n  else\n    b = 28;\n  c = 31;\n  d = 30;\n  e = 31;\n  f = 30;\n  g = 31;\n  h = 31;\n  i = 30;\n  j = 31;\n  k = 30;\n  l = 31;\n  if (B == 1)\n    m = C;\n\n  if (B == 2)\n    m = C + a;\n  if (B == 3)\n    m = C + a + b;\n  if (B == 4)\n    m = C + a + b + c;\n  if (B == 5)\n    m = C + a + b + c + d;\n  if (B == 6)\n    m = C + a + b + c + d + e;\n  if (B == 7)\n    m = C + a + b + c + d + e + f;\n  if (B == 8)\n    m = C + a + b + c + d + e + f + g;\n  if (B == 9)\n    m = C + a + b + c + d + e + f + g + h;\n  if (B == 10)\n    m = C + a + b + c + d + e + f + g + h + i;\n  if (B == 11)\n    m = C + a + b + c + d + e + f + g + h + i + j;\n  if (B == 12)\n    m = C + a + b + c + d + e + f + g + h + i + j + k;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "11", "index": "19061", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  cin >> year >> month >> day;\n  int a[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 0; i < month; i++)\n      sum += a[1][i];\n    sum = sum + day - a[1][month - 1];\n  } else {\n    for (i = 0; i < month; i++)\n      sum += a[0][i];\n\n    sum = sum + day - a[0][month - 1];\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    a[2] = 29;\n  int sum = 0;\n  for (int i = 1; i < month; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    if (month > 2) {\n      sum = sum + 29 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else {\n      sum = day;\n    }\n\n  } else {\n    if (month > 2) {\n      sum = sum + 28 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else\n      sum = day;\n  }\n  cout << sum;\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i,\n      rank = 0, y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    max[2] += 1;\n  };\n  for (i = 1; i < m; i++) {\n    rank += max[i];\n  }\n  rank += d;\n  cout << rank;\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "11", "index": "19065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int real;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 29 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 29 + day;\n      printf(\"%d\", real);\n    }\n\n  } else {\n    if (month == 1) {\n      printf(\"%d\", day);\n    }\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 28 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 28 + day;\n      printf(\"%d\", real);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Day1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Day2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int sumday = 0;\n  int i, j;\n\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    j = 1;\n  else\n    j = 0;\n  if (j == 1) {\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day2[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << \"\\n\";\n    }\n  }\n  if (j == 0) {\n\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day1[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19067", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + monthday[i - 1];\n\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && a == 0) {\n    sum = sum + 1;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, sum = 0;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b; i++) {\n    sum = sum + month[i];\n  }\n  sum = sum + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    sum = sum + 1;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19069", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint leapyear(int year) {\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n    return 1;\n  else\n    return 0;\n}\nint whichday(int year, int month, int day) {\n  int mon[1000] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int d = 0, i;\n  if (leapyear(year) == 1)\n    mon[1]++;\n  for (i = 0; i < month - 1; i++)\n    d += mon[i];\n  d += day;\n  return d;\n}\nint main() {\n  int year, month, day;\n  int d;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  d = whichday(year, month, day);\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "19070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int y, month, d, sum = 0;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &month, &d);\n  m[2] = m[2] + leap(y);\n  for (int i = 0; i < month; i++) {\n    sum = sum + m[i];\n  }\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\nint leap(int n) {\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, data, days = 0;\n  cin >> year >> month >> data;\n  days = data;\n  if (month == 1) {\n    days = days;\n  } else {\n    for (i = 1; i < month; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        days = days + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        days = days + 30;\n      else if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n        days = days + 29;\n      else\n        days = days + 28;\n    }\n    days = days;\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19072", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, l = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    if (m == 1)\n      printf(\"%d\", d);\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += a[i];\n      }\n      cout << l + d;\n    }\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += b[i];\n      }\n      cout << l + d;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int run(int n);\n  int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, n, y, r, s = 0, k;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  for (i = 0; i < y; i++)\n    s = s + q[i];\n  s = s + r;\n  k = run(n);\n  if (k && (y > 2))\n    s += 1;\n  printf(\"%d\", s);\n  return 0;\n}\n\nint run(int n) {\n  int a;\n  if ((n % 400 == 0) || ((n % 4 == 0) && (n % 100 != 0)))\n    a = 1;\n  else\n    a = 0;\n  return a;\n}\n"}
{"label": "11", "index": "19074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, d, i, b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  c[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  s = 0;\n  cin >> a >> m >> d;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0))\n    for (i = 1; i < m; i++)\n      s += b[i];\n  else\n    for (i = 1; i < m; i++)\n      s += c[i];\n  printf(\"%d\", s + d);\n  return 0;\n}\n"}
{"label": "11", "index": "19075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, a, all, m1[5], m2[5], m3[5], i;\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d%d%d\", &m1[i], &m2[i], &m3[i]);\n  for (i = 0; i <= 4; i++) {\n    year = m1[i];\n    month = m2[i];\n    day = m3[i];\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 1:\n        a = 366;\n        break;\n      case 2:\n        a = 335;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 366 - a + day;\n\n    } else {\n      switch (month) {\n      case 1:\n        a = 365;\n        break;\n      case 2:\n        a = 334;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 365 - a + day;\n    }\n    printf(\"%d\\n\", all);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isrn(int n) {\n  if (n % 400 == 0)\n    return 1;\n  else {\n    if (n % 100 == 0)\n      return 0;\n    else {\n      if (n % 4 == 0)\n        return 1;\n      else\n        return 0;\n    }\n  }\n}\n\nint main() {\n  int y, m, d, sum = 0, i;\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum += 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2) {\n      if (isrn(y))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += d;\n  cout << sum << \"\\n\";\n}\n"}
{"label": "11", "index": "19077", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 100 != 0 && y % 4 == 0) || (y % 400 == 0)) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 60 + d;\n      break;\n    case 4:\n      n = 91 + d;\n      break;\n    case 5:\n      n = 121 + d;\n      break;\n    case 6:\n      n = 152 + d;\n      break;\n    case 7:\n      n = 182 + d;\n      break;\n    case 8:\n      n = 213 + d;\n      break;\n    case 9:\n      n = 244 + d;\n      break;\n    case 10:\n      n = 274 + d;\n      break;\n    case 11:\n      n = 305 + d;\n      break;\n    default:\n      n = 335 + d;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 59 + d;\n      break;\n    case 4:\n      n = 90 + d;\n      break;\n    case 5:\n      n = 120 + d;\n      break;\n    case 6:\n      n = 151 + d;\n      break;\n    case 7:\n      n = 181 + d;\n      break;\n    case 8:\n      n = 212 + d;\n      break;\n    case 9:\n      n = 243 + d;\n      break;\n    case 10:\n      n = 273 + d;\n      break;\n    case 11:\n      n = 304 + d;\n      break;\n    default:\n      n = 334 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[1] = 29;\n  if (m == 1)\n    cout << d;\n  else {\n    for (int i = 0; i < m - 1; i++)\n      t = t + a[i];\n\n    cout << t + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint days_of_month[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                            {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n\nint is_leap_year(int year) {\n  if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int index = is_leap_year(year);\n  int days = 0;\n  for (int i = 0; i < month - 1; i++)\n    days += days_of_month[index][i];\n  days += day;\n  cout << days;\n}\n"}
{"label": "11", "index": "19080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, sum;\n  int mon[1000];\n  mon[1] = mon[3] = mon[5] = mon[7] = mon[8] = mon[10] = mon[12] = 31;\n  mon[4] = mon[6] = mon[9] = mon[11] = 30;\n  sum = 0;\n\n  cin >> year >> month >> date;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    mon[2] = 29;\n  else {\n    mon[2] = 28;\n  }\n\n  int i;\n  for (i = 1; i < month; i++) {\n    sum += mon[i];\n  }\n  sum += date;\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int j;\n\n  for (j = 0; j < 5; j++) {\n    int n = 0;\n    int i;\n    scanf(\"%d %d %d\", &year, &month, &day);\n\n    if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (isleapyear(year) && month != 2 && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (!isleapyear(year) && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n\n    for (i = 1; i < month; i++) {\n      n += days[i];\n    }\n\n    n += day;\n\n    if (month > 2 && isleapyear(year)) {\n      n++;\n    }\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, mon, day, i;\n  int total = 0;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n\n  } else {\n    int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n  }\n  total += day;\n  cout << total;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Year, Month, Date;\n  int month;\n  int i;\n  int sum1 = 0, sum2 = 0;\n  cin >> Year >> Month >> Date;\n  month = Month - 1;\n  if (Year % 4 == 0 && Year % 400 == 0) {\n    int mday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  } else {\n    int mday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  }\n  sum2 = sum1 + Date;\n  printf(\"\\n%d\", sum2);\n  return 0;\n}\n"}
{"label": "11", "index": "19084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, l = 0;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    if (m == 1)\n      cout << d;\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += a[i];\n      }\n      cout << l + d;\n    }\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n    else {\n      for (int i = 0; i < m - 1; i++)\n        l += b[i];\n\n      cout << l + d;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y = 0, m = 0, d = 0, sum = 0, i = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  for (i = 0; i <= m - 2; i++)\n    sum = sum + a[i];\n\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s[13], t, n;\n  s[0] = 0;\n  s[1] = 31;\n  s[3] = 31;\n  s[4] = 30;\n  s[5] = 31;\n  s[6] = 30;\n  s[7] = 31;\n  s[8] = 31;\n  s[9] = 30;\n  s[10] = 31;\n  s[11] = 30;\n  s[12] = 31;\n  t = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n      s[2] = 29;\n      t = s[i] + t;\n    } else {\n      s[2] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19087", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x = 0, i;\n  cin >> a >> b >> c;\n  if (m(a) == 1) {\n    int d[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  } else {\n    int d[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  }\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19088", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, total = 0, i;\n  int mon[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                    {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 1; i < month; i++)\n      total += mon[1][i];\n    total += day;\n  } else {\n    for (i = 1; i < month; i++)\n      total += mon[0][i];\n    total += day;\n  }\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, number;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1)\n    number = day;\n  else if (month == 2)\n    number = 31 + day;\n  else {\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      if (month == 3)\n        number = 60 + day;\n      else if (month == 4)\n        number = 91 + day;\n      else if (month == 5)\n        number = day + 121;\n      else if (month == 6)\n        number = day + 152;\n      else if (month == 7)\n        number = day + 182;\n      else if (month == 8)\n        number = day + 213;\n      else if (month == 9)\n        number = day + 244;\n      else if (month == 10) {\n        number = day + 274;\n      } else if (month == 11)\n        number = day + 305;\n      else if (month == 12)\n        number = day + 335;\n    } else {\n      if (month == 3)\n        number = 59 + day;\n      else if (month == 4)\n        number = 90 + day;\n      else if (month == 5)\n        number = day + 120;\n      else if (month == 6)\n        number = day + 151;\n      else if (month == 7)\n        number = day + 181;\n      else if (month == 8)\n        number = day + 212;\n      else if (month == 9)\n        number = day + 243;\n      else if (month == 10)\n        number = day + 273;\n      else if (month == 11)\n        number = day + 304;\n      else if (month == 12)\n        number = day + 334;\n    }\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "19090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  static int days[13] = {0,  31, 28, 31, 30, 31, 30,\n                         31, 31, 30, 31, 30, 31}; \n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month == 2 &&\n      (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month != 2 &&\n      (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)) {\n    n++;\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "19091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month1, day;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month1 >> day;\n  int i;\n  int sum = 0;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    month[2] = month[2] + 1;\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  } else {\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  }\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int daymonth[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                         31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int YEAR, MON, DAY, i, counter = 0;\n  cin >> YEAR >> MON >> DAY;\n  for (i = 0; i < MON - 1; i++) {\n    counter += daymonth[leap(YEAR)][i];\n  }\n  counter += DAY;\n  cout << counter << endl;\n  return 0;\n}\nint leap(int YEAR) {\n  if ((YEAR % 4 == 0) && (YEAR % 100 != 0) || (YEAR % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int isleapyear;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  isleapyear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n  if (isleapyear && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (isleapyear && month != 2 && (day < 1 || day > days[month])) {\n    cout << \"Illegal input.\\n\";\n    return -1;\n  }\n  if (!isleapyear && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n  for (i = 0; i < month; i++) {\n    n += days[i];\n  }\n\n  n += day;\n  if (month > 2 && isleapyear)\n    n++;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isrn(int n) {\n  if (n % 400 == 0)\n    return 1;\n  else {\n    if (n % 100 == 0)\n      return 0;\n    else {\n      if (n % 4 == 0)\n        return 1;\n      else\n        return 0;\n    }\n  }\n}\n\nint main() {\n  int y, m, d, sum = 0, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum += 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2) {\n      if (isrn(y))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "11", "index": "19095", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int year, month, day;\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n\n  if (year % 4 != 0)\n    days[1] = 28;\n  else if (year % 4 == 0 && year % 100 != 0)\n    days[1] = 29;\n  else if (year % 400 == 0)\n    days[1] = 29;\n  else if (year % 100 == 0 && year % 400 != 0)\n    days[1] = 28;\n  int i, k = 0, n;\n  for (i = 1; i < month; i++) {\n    k = k + days[i];\n  }\n  n = k + day + 1;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int i;\n\n  if (year % 4 == 0 || year % 100 == 0) {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2) {\n      i = (month - 1) * 31 + day;\n    } else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  } else {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2) {\n      i = (month - 1) * 31 + day;\n    } else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  }\n\n  cout << i;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint leap(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  } else if (n % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, x;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1) {\n    if (month == 1)\n      x = day;\n\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 60;\n    }\n    if (month == 4) {\n      x = day + 91;\n    }\n    if (month == 5) {\n      x = day + 121;\n    }\n    if (month == 6) {\n      x = day + 152;\n    }\n    if (month == 7) {\n      x = day + 182;\n    }\n    if (month == 8) {\n      x = day + 213;\n    }\n    if (month == 9) {\n      x = day + 244;\n    }\n    if (month == 10)\n      x = day + 274;\n\n    if (month == 11) {\n      x = day + 305;\n    }\n    if (month == 12) {\n      x = day + 335;\n    }\n  } else {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 59;\n    }\n    if (month == 4) {\n      x = day + 90;\n    }\n    if (month == 5) {\n      x = day + 120;\n    }\n    if (month == 6) {\n      x = day + 151;\n    }\n    if (month == 7) {\n      x = day + 181;\n    }\n    if (month == 8) {\n      x = day + 212;\n    }\n    if (month == 9) {\n      x = day + 243;\n    }\n    if (month == 10) {\n      x = day + 273;\n    }\n    if (month == 11) {\n      x = day + 304;\n    }\n    if (month == 12) {\n      x = day + 334;\n    }\n  }\n  cout << x;\n}\n"}
{"label": "11", "index": "19098", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int z;\n  z = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int m[12];\n  m[0] = 31;\n  if (year % 4 == 0) {\n    m[1] = 29;\n    if (year % 100 == 0)\n      m[1] = 28;\n    if (year % 400 == 0)\n      m[1] = 29;\n  } else\n    m[1] = 28;\n  m[2] = 31;\n  m[3] = 30;\n  m[4] = 31;\n  m[5] = 30;\n  m[6] = 31;\n  m[7] = 31;\n  m[8] = 30;\n  m[9] = 31;\n  m[10] = 30;\n  m[11] = 31;\n  int i;\n  for (i = 0; i < month - 1; i++)\n    z = z + m[i];\n  printf(\"%d \", z + day);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (b >= 2)\n    d = d + 31;\n  if (b >= 3)\n    d = d + 28;\n  if (b >= 4)\n    d = d + 31;\n  if (b >= 5)\n    d = d + 30;\n  if (b >= 6)\n    d = d + 31;\n  if (b >= 7)\n    d = d + 30;\n  if (b >= 8)\n    d = d + 31;\n  if (b >= 9)\n    d = d + 31;\n  if (b >= 10)\n    d = d + 30;\n  if (b >= 11)\n    d = d + 31;\n  if (b >= 12)\n    d = d + 31;\n  d = d + c;\n  if (((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) && b > 2)\n    d = d + 1;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i, j;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    j = i - 1;\n    sum = sum + monthday[j];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, flag;\n  int daytal, tal;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 4 == 0) && (year % 100 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  switch (month) {\n  case 1:\n    daytal = 0;\n    break;\n  case 2:\n    daytal = 31;\n    break;\n  case 3:\n    daytal = 60;\n    break;\n  case 4:\n    daytal = 91;\n    break;\n  case 5:\n    daytal = 121;\n    break;\n  case 6:\n    daytal = 152;\n    break;\n  case 7:\n    daytal = 182;\n    break;\n  case 8:\n    daytal = 213;\n    break;\n  case 9:\n    daytal = 244;\n    break;\n  case 10:\n    daytal = 274;\n    break;\n  case 11:\n    daytal = 305;\n    break;\n  case 12:\n    daytal = 335;\n    break;\n  }\n  if (month < 2)\n    flag = 0;\n  tal = daytal + day - flag;\n  printf(\"%d\\n\", tal);\n  return 0;\n}\n"}
{"label": "11", "index": "19103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 4 == 0 && a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  cout << d << \"\\n\";\n}\n"}
{"label": "11", "index": "19104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int x;\n  int Jan = 1, feb = 2, Mar = 3, Apr = 4, May = 5, Jun = 6;\n  int Jul = 7, Aug = 8, Sep = 9, Oct = 10, Nov = 11, Dec = 12;\n  int Feb;\n  {\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          Feb = 29;\n        else\n          Feb = 28;\n      } else\n        Feb = 29;\n    } else\n      Feb = 28;\n  }\n  if (month == Jan)\n    x = day;\n  if (month == feb)\n    x = 31 + day;\n  if (month == Mar)\n    x = 31 + Feb + day;\n  if (month == Apr)\n    x = 31 + Feb + 31 + day;\n  if (month == May)\n    x = 31 + Feb + 31 + 30 + day;\n  if (month == Jun)\n    x = 31 + Feb + 31 + 30 + 31 + day;\n  if (month == Jul)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + day;\n  if (month == Aug)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == Sep)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == Oct)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == Nov)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == Dec)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, mon, day;\n  scanf(\"%d %d %d\", &year, &mon, &day);\n\n  int re;\n  if ((year % 4 == 0 && year % 400 == 0 && year % 100 == 0) ||\n      (year % 4 == 0 && year % 100 != 0)) {\n\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 29 + day;\n      break;\n    case 4:\n      re = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else\n\n  {\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 28 + day;\n      break;\n    case 4:\n      re = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "11", "index": "19106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint mon(int n) {\n  int day;\n  switch (n) {\n  case 1:\n    day = 31;\n    break;\n  case 2:\n    day = 28;\n    break;\n  case 3:\n    day = 31;\n    break;\n  case 4:\n    day = 30;\n    break;\n  case 5:\n    day = 31;\n    break;\n  case 6:\n    day = 30;\n    break;\n  case 7:\n    day = 31;\n    break;\n  case 8:\n    day = 31;\n    break;\n  case 9:\n    day = 30;\n    break;\n  case 10:\n    day = 31;\n    break;\n  case 11:\n    day = 30;\n    break;\n  case 12:\n    day = 31;\n    break;\n  }\n  return (day);\n}\nint run(int year) {\n  int p;\n  if (year % 400 == 0)\n    p = 1;\n  else if ((year % 100 != 0) && (year % 4 == 0))\n    p = 1;\n  else\n    p = 0;\n  return (p);\n}\n\nint main() {\n  int year, month, date, i, n = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n  for (i = 1; i <= month - 1; i++) {\n    n = n + mon(i);\n  }\n  n = n + date;\n  if (run(year) == 1)\n    n = n + 1;\n  else\n    n = n;\n  printf(\"%d\", n);\n\n  return (0);\n}\n"}
{"label": "11", "index": "19107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  int sum_day(int, int);\n  int leap(int year);\n  int year[5], month[5], day[5], days[5];\n  for (i = 0; i < 5; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  for (i = 0; i < 5; i++) {\n    days[i] = sum_day(month[i], day[i]);\n    if (leap(year[i]) && month[i] >= 3)\n      days[i] = days[i] + 1;\n    printf(\"%d\\n\", days[i]);\n  }\n  return 0;\n}\nint sum_day(int month, int day) {\n  int day_tab[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 1; i < month; i++)\n    day += day_tab[i];\n  return (day);\n}\n\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\n"}
{"label": "11", "index": "19108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    d[1]++;\n  }\n  int g = c;\n  int i = 0;\n  while (i >= b) {\n    d[i]++;\n  }\n  for (i = 0; i < b - 1; i++) {\n    g = g + d[i];\n  }\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "11", "index": "19109", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int just(int y);\n\n  int y, m, d, t = 0;\n\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (just(y) == 1) {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += b[i];\n\n  } else {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += a[i];\n  }\n  cout << t + d;\n\n  return 0;\n}\n\nint just(int y) {\n  int m = 0;\n\n  if (y % 4 == 0 && y % 100 != 0)\n    return 1;\n\n  if (y % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19110", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d[12], sum = 0;\n  int i;\n  cin >> a >> b >> c;\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      d[i] = 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      d[i] = 30;\n    } else {\n      if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n        d[2] = 29;\n      } else {\n        d[2] = 28;\n      }\n    }\n    sum += d[i];\n  }\n  printf(\"%d\\n\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "19111", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, x = 0, sum, i;\n  cin >> a >> b >> c;\n  for (i = 0; i < 12; i++) {\n    if (i + 1 == b)\n      break;\n    x = x + days[i];\n  }\n  sum = x + c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b <= 2) {\n      printf(\"%d\", sum);\n    }\n    if (b > 2) {\n      sum = sum + 1;\n      printf(\"%d\", sum);\n    }\n\n  } else\n    printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, k, m2;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    m2 = 29;\n  else\n    m2 = 28;\n  k = m2 + 31;\n  switch (month) {\n  case 1:\n    n = day;\n    break;\n  case 2:\n    n = day + 31;\n    break;\n  case 3:\n    n = k + day;\n    break;\n  case 4:\n    n = k + 31 + day;\n    break;\n  case 5:\n    n = 31 + k + 30 + day;\n    break;\n  case 6:\n    n = k + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    n = k + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    n = k + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 59 + c;\n    else if (b < 5)\n      n = 90 + c;\n    else if (b < 6)\n      n = 120 + c;\n    else if (b < 7) {\n      n = 151 + c;\n    } else if (b < 8)\n      n = 181 + c;\n    else if (b < 9)\n      n = 212 + c;\n    else if (b < 10)\n      n = 243 + c;\n    else if (b < 11)\n      n = 273 + c;\n    else if (b < 12)\n      n = 304 + c;\n    else\n      n = 334 + c;\n  } else {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 60 + c;\n    else if (b < 5)\n      n = 91 + c;\n    else if (b < 6)\n      n = 121 + c;\n    else if (b < 7)\n      n = 152 + c;\n    else if (b < 8)\n      n = 182 + c;\n    else if (b < 9)\n      n = 213 + c;\n    else if (b < 10)\n      n = 244 + c;\n    else if (b < 11)\n      n = 274 + c;\n    else if (b < 12)\n      n = 305 + c;\n    else\n      n = 335 + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19114", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, e, i;\n  int d = 0;\n\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int score[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  } else {\n    int score[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  }\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, n, leap;\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap = 0) {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 29 + day;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  } else {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 28 + day;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t = 0;\n  int monthday[13] = {0, 31, 28 + t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int year, month, day;\n  cin >> year >> month >> day;\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    t = 1;\n\n  int summonth = 0;\n  int sum = 0;\n\n  int i;\n  for (i = 0; i < month; i++)\n    summonth += monthday[i];\n  sum = summonth + day;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = d + 31;\n  } else if (m == 3) {\n    s = d + 59;\n  } else if (m == 4) {\n    s = d + 90;\n  } else if (m == 5) {\n    s = d + 120;\n  } else if (m == 6) {\n    s = d + 151;\n  } else if (m == 7) {\n    s = d + 181;\n  } else if (m == 8) {\n    s = d + 212;\n  } else if (m == 9) {\n    s = d + 243;\n  } else if (m == 10) {\n    s = d + 273;\n  } else if (m == 11) {\n    s = d + 304;\n  } else {\n    s = d + 334;\n  }\n  if (!((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))) {\n    printf(\"%d\", s);\n  } else {\n    if (m < 3) {\n      printf(\"%d\", s);\n    } else {\n      printf(\"%d\", s + 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[5], m[5], d[5], c[5], t[5];\n  for (i = 0; i < 5; i++) {\n    cin >> a[i] >> m[i] >> d[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) == 1) {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 60;\n        break;\n      case 4:\n        c[i] = 91;\n        break;\n      case 5:\n        c[i] = 121;\n        break;\n      case 6:\n        c[i] = 152;\n        break;\n      case 7:\n        c[i] = 182;\n        break;\n      case 8:\n        c[i] = 213;\n        break;\n      case 9:\n        c[i] = 244;\n        break;\n      case 10:\n        c[i] = 274;\n        break;\n      case 11:\n        c[i] = 305;\n        break;\n      case 12:\n        c[i] = 335;\n        break;\n      }\n\n    } else {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 59;\n        break;\n      case 4:\n        c[i] = 90;\n        break;\n      case 5:\n        c[i] = 120;\n        break;\n      case 6:\n        c[i] = 151;\n        break;\n      case 7:\n        c[i] = 181;\n        break;\n      case 8:\n        c[i] = 212;\n        break;\n      case 9:\n        c[i] = 243;\n        break;\n      case 10:\n        c[i] = 273;\n        break;\n      case 11:\n        c[i] = 304;\n        break;\n      case 12:\n        c[i] = 334;\n        break;\n      }\n    }\n    t[i] = c[i] + d[i];\n    cout << t[i] << \"\\n\";\n  }\n}\n"}
{"label": "11", "index": "19120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, leap, num = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> date;\n\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  } else {\n    if (year % 4 == 0) {\n      leap = 1;\n    } else\n      leap = 0;\n  }\n\n  int i;\n  switch (leap) {\n  case 1:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    if (month >= 3)\n      num = num + date + 1;\n    else\n      num = num + date;\n    break;\n  case 0:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    num = num + date;\n  }\n\n  printf(\"%d\", num);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  int dayofmonth1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      dayofmonth2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth1[i];\n    }\n    n = n + day;\n    cout << n;\n  } else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth2[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else\n          d = d + 28;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j++;\n  }\n}\n"}
{"label": "11", "index": "19123", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, d, i, counter = 0,\n                  month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> n >> m >> d;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      counter += month2[i];\n    }\n    counter += d;\n    cout << counter << endl;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      counter += month1[i];\n    counter += d;\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, days, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 == !0) {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 29 + day;\n      break;\n    case 4:\n      days = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n    default:;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 28 + day;\n      break;\n    case 4:\n      days = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n    default:;\n    }\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "19125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int m = 0, n = 0;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (month == 1) {\n    n = date;\n  }\n  m = m + 31;\n  if (month == 2) {\n    n = m + date;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    m = m + 29;\n  } else {\n    m = m + 28;\n  }\n\n  if (month == 3) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 4) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 5) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 6) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 7) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 8) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 9) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 10) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 11) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 12) {\n    n = m + date;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rn(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, res = 0,\n               day[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n\n  for (i = 0; i < m; i++) {\n    res = res + day[i];\n  }\n  if (rn(y) == 1) {\n    if (m >= 3) {\n      printf(\"%d\\n\", res + d + 1);\n    } else\n      cout << res + d << \"\\n\";\n  }\n  if (rn(y) == 0)\n    printf(\"%d\\n\", res + d);\n  return 0;\n}\n"}
{"label": "11", "index": "19127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, D = 0, l, s;\n  l = 31;\n  s = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    D = d;\n  else if (m == 2)\n    D = l + d;\n  else if (m == 3)\n    D = l + 28 + d;\n  else if (m == 4)\n    D = l * 2 + 28 + d;\n  else if (m == 5)\n    D = l * 2 + 28 + d + s;\n  else if (m == 6)\n    D = s + l * 3 + 28 + d;\n  else if (m == 7)\n    D = s * 2 + l * 3 + 28 + d;\n  else if (m == 8)\n    D = s * 2 + l * 4 + 28 + d;\n  else if (m == 9)\n    D = s * 2 + l * 5 + 28 + d;\n  else if (m == 10)\n    D = s * 3 + l * 5 + 28 + d;\n  else if (m == 11)\n    D = s * 3 + l * 6 + 28 + d;\n  else\n    D = s * 4 + l * 6 + 28 + d;\n  if (m > 2 && ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)))\n    D = D + 1;\n\n  printf(\"%d\\n\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int z = 1;\n  while (z <= 5) {\n    cin >> year >> month >> day;\n    int n = 0;\n    int i;\n    for (i = 1; i < month; i++) {\n      n = n + days[i];\n    }\n    n = n + day;\n    if (month > 2 && isleapyear(year))\n      n++;\n    cout << n << \"\\n\";\n    z++;\n  }\n}\n"}
{"label": "11", "index": "19129", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, n = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int ping[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (int i = 0; i < m - 1; i++)\n      n = n + ping[i];\n    n = n + d;\n  } else {\n    for (int i = 0; i < m - 1; i++)\n      n = n + run[i];\n    n = n + d;\n  }\n  cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, daynum = 0, i;\n  cin >> year >> month >> day;\n  int month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month2[i];\n    }\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month1[i];\n    }\n  }\n  daynum = daynum + day;\n  printf(\"%d\", daynum);\n  return 0;\n}\n"}
{"label": "11", "index": "19131", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, mouth, day, n;\n  cin >> year >> mouth >> day;\n  if (year % 4 == 0) {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 60 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 91 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 121 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 152 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 182 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 213 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 244 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 274 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 305 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 335 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  } else {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 59 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 90 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 120 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 151 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 181 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 212 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 243 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 273 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 304 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 334 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19132", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x;\n  cin >> y >> m >> d;\n  x = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 28;\n      }\n    }\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 29;\n      }\n    }\n  }\n  x = x + d;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    }\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19134", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    scanf(\"%d %d %d \", &a, &b, &c);\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else\n          d = d + 28;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j++;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], b[10], c[10], n[10], d, i;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      n[i] = d + c[i];\n      printf(\"%d\\n\", n[i]);\n    } else {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      n[i] = d + c[i];\n      cout << n[i] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "11", "index": "19136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, s;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int a;\n  if (x % 4 == 0)\n    if (x % 100 == 0)\n      if (x % 400 == 0)\n        a = 29;\n      else\n        a = 28;\n    else\n      a = 29;\n  else\n    a = 28;\n  if (y == 1 || y == 2) {\n    s = (y - 1) * 31 + z;\n  } else if (y == 3 || y == 7 || y == 5) {\n    s = (y - 1) / 2 * 31 + (y - 3) / 2 * 30 + a + z;\n  } else if (y == 4 || y == 6) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  } else if (y == 9 || y == 11) {\n    s = (y + 1) / 2 * 31 + (y - 5) / 2 * 30 + a + z;\n  } else if (y == 8 || y == 10 || y == 12) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int feb, i, n = 0;\n\n  cin >> year >> month >> day;\n\n  if (year % 4 != 0)\n    feb = 28;\n  else {\n    if (year % 100 != 0)\n      feb = 29;\n    else {\n      if (year % 400 == 0)\n        feb = 29;\n      else\n        feb = 28;\n    }\n  }\n\n  for (i = 1; i < month; i++) {\n    if (i == 2)\n      n = n + feb;\n    else {\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        n = n + 30;\n      else\n        n = n + 31;\n    }\n  }\n\n  n = n + day;\n\n  cout << n;\n}\n"}
{"label": "11", "index": "19138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d, a, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4) == 0 && (y % 100) != 0 || (y % 400 == 0))\n    a = 1;\n  else\n    a = 0;\n\n  switch (m) {\n  case 1:\n    n = d;\n    break;\n  case 2:\n    n = 31 + d;\n    break;\n  case 3:\n    n = 31 + 28 + d;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  if (a == 0) {\n    printf(\"%d\", n);\n  }\n  if (m != 1 && m != 2 && a == 1) {\n    n = n + 1;\n    printf(\"%d\", n);\n  }\n  if (a == 1 && m == 1)\n    cout << n;\n  if (a == 1 && m == 2)\n    printf(\"%d\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint GetMonthDays(int year, int month);\nint CheckLeap(int year); \nint main() {\n  int year, month, day = 1, s = 0, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    s += GetMonthDays(year, i);\n  }\n  s += day;\n  printf(\"%d\", s);\n}\n\nint GetMonthDays(int year, int month) \n{\n  int day;\n  if (month == 4 || month == 6 || month == 9 || month == 11)\n    day = 30;\n  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 ||\n      month == 10 || month == 12)\n    day = 31;\n  if (month == 2) {\n    if (CheckLeap(year) == 1)\n      day = 29; \n    if (CheckLeap(year) == 0)\n      day = 28; \n  }\n  return day;\n}\n\nint CheckLeap(int year) \n{\n  int jugde = 0; \n  if (year % 100 != 0) {\n    if (year % 4 == 0)\n      jugde = 1;\n  } \n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      jugde = 1;\n  }             \n  return jugde; \n}\n"}
{"label": "11", "index": "19140", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, date;\n  cin >> year >> month >> date;\n  int total = 0;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    day_of_month[2] = 29;\n\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  } else {\n    day_of_month[2] = 28;\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = d + 31;\n  } else if (m == 3) {\n    s = d + 59;\n  } else if (m == 4) {\n    s = d + 90;\n  } else if (m == 5) {\n    s = d + 120;\n  } else if (m == 6) {\n    s = d + 151;\n  } else if (m == 7) {\n    s = d + 181;\n  } else if (m == 8) {\n    s = d + 212;\n  } else if (m == 9) {\n    s = d + 243;\n  } else if (m == 10) {\n    s = d + 273;\n  } else if (m == 11) {\n    s = d + 304;\n  } else {\n    s = d + 334;\n  }\n  if (!((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))) {\n    cout << s;\n  } else {\n    if (m < 3) {\n      printf(\"%d\", s);\n    } else {\n      printf(\"%d\", s + 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int run(int n);\n  int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, n, y, r, s = 0, k;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  for (i = 0; i < y; i++)\n    s = s + q[i];\n  s = s + r;\n  k = run(n);\n  if (k && (y > 2)) {\n    s += 1;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n\nint run(int n) {\n  int a;\n  if ((n % 400 == 0) || ((n % 4 == 0) && (n % 100 != 0)))\n    a = 1;\n  else\n    a = 0;\n  return a;\n}\n"}
{"label": "11", "index": "19143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int y, m, d, days = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  switch (m) {\n  case 1:\n    days = d;\n    break;\n  case 2:\n    days = 31 + d;\n    break;\n  case 3:\n    days = 31 + 28 + d;\n    break;\n  case 4:\n    days = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    days = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    days = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  cout << days << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) ||\n      (year % 400 == 0)) \n  {\n    if (month > 2) \n    {\n      sum = sum + 29 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else {\n      sum = day;\n    }\n\n  } else \n  {\n    if (month > 2) \n    {\n      sum = sum + 28 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else {\n      sum = day;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19145", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int aaa[5][3];\n  int year, mon, day, i, n, m;\n  int month[12];\n  month[0] = 31, month[1] = 28, month[2] = 31, month[3] = 30, month[4] = 31,\n  month[5] = 30, month[6] = 31, month[7] = 31, month[8] = 30, month[9] = 31,\n  month[10] = 30, month[11] = 31;\n  for (i = 0; i < 5; i++) {\n    cin >> year >> mon >> day;\n    aaa[i][0] = year;\n    aaa[i][1] = mon;\n    aaa[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = aaa[i][0];\n    mon = aaa[i][1];\n    day = aaa[i][2];\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n      month[1] = 29;\n    else\n      month[1] = 28;\n    n = 0;\n    for (m = 0; m < (mon - 1); m++)\n      n = n + month[m];\n\n    n = n + day;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19146", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year[5], mon[5], day[5], sum = 0, i, j;\n  for (j = 0; j < 5; j++)\n    scanf(\"%d%d%d\", &year[j], &mon[j], &day[j]);\n  for (j = 0; j < 5; j++) {\n    if (year[j] % 400 == 0)\n      a[1] = 29;\n    else if (year[j] % 4 == 0) {\n      if (year[j] % 100 == 0)\n        a[1] = 28;\n      else\n        a[1] = 29;\n    }\n    for (i = 0; i <= (mon[j] - 2); i++)\n      sum = sum + a[i];\n    sum = sum + day[j];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1 && (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0)) {\n      counter++;\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  cout << counter;\n}\n"}
{"label": "11", "index": "19148", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, all;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 29 + 31;\n    }\n    if (month == 4) {\n      all = day + 29 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 29 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 28 + 31;\n    }\n    if (month == 4) {\n      all = day + 28 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 28 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  printf(\"%d\", all);\n  return 0;\n}\n"}
{"label": "11", "index": "19149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d \", &year);\n  scanf(\"%d \", &month);\n  scanf(\"%d\", &day);\n  if (month == 2)\n    printf(\"%d\", 31 + day);\n  else if (month == 1)\n    printf(\"%d\", day);\n  else {\n    if (month == 3)\n      day = day + 59;\n    if (month == 4) {\n      day = day + 90;\n    }\n    if (month == 5)\n      day = day + 120;\n    if (month == 6)\n      day = day + 151;\n    if (month == 7)\n      day = day + 181;\n    if (month == 8)\n      day = day + 212;\n    if (month == 9)\n      day = day + 243;\n    if (month == 10)\n      day = day + 273;\n    if (month == 11)\n      day = day + 304;\n    if (month == 12)\n      day = day + 334;\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      printf(\"%d\", day + 1);\n    else\n      printf(\"%d\", day);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10], b[10], c[10], n[10], d, i;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      n[i] = d + c[i];\n      printf(\"%d\\n\", n[i]);\n    } else {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      n[i] = d + c[i];\n      printf(\"%d\\n\", n[i]);\n    }\n  }\n}\n"}
{"label": "11", "index": "19151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  result = (month - 1) * 30 + day;\n  if (month == 1) {\n    printf(\"%d\", result);\n  } else {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8) {\n      result = result + 3;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      printf(\"%d\", result);\n    } else {\n      printf(\"%d\", result - 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19152", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, s = 0;\n  cin >> a >> b >> c;\n  int m1 = 31, m2 = 28, m21 = 29, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31,\n      m8 = 31, m9 = 30, m10 = 31, m11 = 30, m12 = 31;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 28 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m2 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m2 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m2 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  } else {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 29 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m21 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m21 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m21 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19153", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, sum = 0;\n  int a[20];\n  a[0] = 0;\n  a[1] = 31;\n  a[2] = 59;\n  a[3] = 90;\n  a[4] = 120;\n  a[5] = 151;\n  a[6] = 181;\n  a[7] = 212;\n  a[8] = 243;\n  a[9] = 273;\n  a[10] = 304;\n  a[11] = 334;\n  a[12] = 365;\n  cin >> b >> c >> d;\n  if ((b % 4 != 0) || (b % 100 == 0 && b % 400 != 0))\n    sum = a[c - 1] + d;\n  else {\n    if (c < 3) {\n      sum = a[c - 1] + d;\n    } else {\n      sum = a[c - 1] + d + 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], total[5], i = 0;\n  for (; i <= 4; i++) {\n\n    scanf(\"%d %d %d\", &year[i], &month[i], &day[i]);\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      total[i] = day[i];\n      break;\n    case 2:\n      total[i] = 31 + day[i];\n      break;\n    case 3:\n      total[i] = 31 + 28 + day[i];\n      break;\n    case 4:\n      total[i] = 31 + 28 + 31 + day[i];\n      break;\n    case 5:\n      total[i] = 31 + 28 + 31 + 30 + day[i];\n      break;\n    case 6:\n      total[i] = 31 + 28 + 31 + 30 + 31 + day[i];\n      break;\n    case 7:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    case 8:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day[i];\n      break;\n    case 9:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day[i];\n      break;\n    case 10:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day[i];\n      break;\n    case 11:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day[i];\n      break;\n    case 12:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    }\n\n    if ((year[i] % 400 == 0 || year[i] % 4 == 0 && year[i] % 100 != 0) &&\n        month[i] > 2)\n      total[i] += 1;\n    printf(\"%d\\n\", total[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19155", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    d = c;\n    break;\n  case 2:\n    d = 31 + c;\n    break;\n  case 3:\n    d = 29 + 31 + c;\n    break;\n  case 4:\n    d = 29 + 31 + 31 + c;\n    break;\n  case 5:\n    d = 29 + 31 + 31 + 30 + c;\n    break;\n  case 6:\n    d = 29 + 31 * 3 + 30 + c;\n    break;\n  case 7:\n    d = 29 + 31 * 3 + 60 + c;\n    break;\n  case 8:\n    d = 29 + 31 * 4 + 60 + c;\n    break;\n  case 9:\n    d = 29 + 31 * 5 + 60 + c;\n    break;\n  case 10:\n    d = 29 + 31 * 5 + 90 + c;\n    break;\n  case 11:\n    d = 29 + 31 * 6 + 90 + c;\n    break;\n  case 12:\n    d = 29 + 31 * 6 + 120 + c;\n    break;\n    printf(\"%d\", d);\n  }\n  if ((a % 4 != 0 || a % 100 == 0 && a % 400 != 0) && b > 2)\n    d = d - 1;\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  if ((a % 4) == 0 && a % 100 != 0 || (a % 400) == 0) {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 29 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 29 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 28 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 28 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  } else if (n % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, x;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1) {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 60;\n    }\n    if (month == 4) {\n      x = day + 91;\n    }\n    if (month == 5) {\n      x = day + 121;\n    }\n    if (month == 6) {\n      x = day + 152;\n    }\n    if (month == 7) {\n      x = day + 182;\n    }\n    if (month == 8) {\n      x = day + 213;\n    }\n    if (month == 9) {\n      x = day + 244;\n    }\n    if (month == 10) {\n      x = day + 274;\n    }\n    if (month == 11) {\n      x = day + 305;\n    }\n    if (month == 12) {\n      x = day + 335;\n    }\n  } else {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 59;\n    }\n    if (month == 4) {\n      x = day + 90;\n    }\n    if (month == 5) {\n      x = day + 120;\n    }\n    if (month == 6) {\n      x = day + 151;\n    }\n    if (month == 7) {\n      x = day + 181;\n    }\n    if (month == 8) {\n      x = day + 212;\n    }\n    if (month == 9) {\n      x = day + 243;\n    }\n    if (month == 10) {\n      x = day + 273;\n    }\n    if (month == 11) {\n      x = day + 304;\n    }\n    if (month == 12) {\n      x = day + 334;\n    }\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "19158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n  int year, month, day, x;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    x = day;\n    break;\n  case 2:\n    x = 31 + day;\n    break;\n  case 3:\n    x = 31 + 28 + day;\n    break;\n  case 4:\n    x = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    x = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    x = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        if (month >= 3) {\n          printf(\"%d\", x + 1);\n        } else {\n          printf(\"%d\", x);\n        }\n      else\n        cout << x;\n    else if (month >= 3) {\n      printf(\"%d\", x + 1);\n    } else {\n      printf(\"%d\", x);\n    }\n  else\n    printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, D;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1) {\n    D = day;\n  }\n  if (month == 2) {\n    D = day + 31;\n  }\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 3) {\n      D = day + 31 + 29;\n    }\n    if (month == 4) {\n      D = day + 31 + 29 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 29 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 3) {\n      D = day + 31 + 28;\n    }\n    if (month == 4) {\n      D = day + 31 + 28 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 28 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  cout << D << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19160", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  int i = 0;\n  int sum = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    sum = sum + 30;\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum = sum + 1;\n    } else if (i == 2 && ((a % 100 != 0 && a % 4 == 0) || a % 400 == 0)) {\n      sum = sum - 1;\n    } else if (i == 2 && (a % 4 != 0 || a % 100 == 0 && a % 400 != 0)) {\n      sum = sum - 2;\n    }\n  }\n  cout << sum + c;\n  return 0;\n}\n"}
{"label": "11", "index": "19162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, total;\n  int i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  total = 0;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  int a = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    a = 1;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 59 + day;\n  if (month == 4)\n    n = 90 + day;\n  if (month == 5)\n    n = 120 + day;\n  if (month == 6)\n    n = 151 + day;\n  if (month == 7)\n    n = 181 + day;\n  if (month == 8)\n    n = 212 + day;\n  if (month == 9)\n    n = 243 + day;\n  if (month == 10)\n    n = 273 + day;\n  if (month == 11)\n    n = 304 + day;\n  if (month == 12)\n    n = 334 + 12;\n  if (month > 2 && a == 1)\n    n++;\n  cout << n;\n}\n"}
{"label": "11", "index": "19164", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100) != 0 || (y % 400 == 0)) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++)\n    c = c + days[i];\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "19165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, j, k, sum = 0, a;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i <= (m - 1); i++) {\n    if (i == 1)\n      sum = sum + 31;\n    if (i == 3)\n      sum = sum + 31;\n    if (i == 5)\n      sum = sum + 31;\n    if (i == 7)\n      sum = sum + 31;\n    if (i == 8)\n      sum = sum + 31;\n    if (i == 10)\n      sum = sum + 31;\n    if (i == 12)\n      sum = sum + 31;\n    if (i == 4)\n      sum = sum + 30;\n    if (i == 6)\n      sum = sum + 30;\n    if (i == 9)\n      sum = sum + 30;\n    if (i == 11)\n      sum = sum + 30;\n    if (i == 2) {\n      j = y % 4, k = y % 400, a = y % 100;\n      if ((a != 0 && j == 0) || (k == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    }\n  }\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int n;\n\n  cin >> year >> month >> day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      cout << n;\n    }\n    if (month == 3) {\n      n = 31 + 29 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 29 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 29 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  } else {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 28 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 28 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 28 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      cout << n;\n    }\n    if (month == 12) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, num = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0)\n      a[2] = 28;\n    else if (year % 400 == 0)\n      a[2] = 29;\n    else\n      a[2] = 29;\n  } else\n    a[2] = 28;\n  for (i = 1; i < month; i++)\n    num = num + a[i];\n  num = num + day;\n  cout << num;\n  return 0;\n}\n"}
{"label": "11", "index": "19168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\nint main() {\n\n  int year, month, day;\n  int result = 0;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], m, tianshu, i;\n  for (i = 0; i <= 4; i++) {\n    cin >> year[i] >> month[i] >> day[i];\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n    if ((year[i] % 400 == 0) || (year[i] % 4 == 0 && year[i] % 100 != 0))\n      if (m > 31)\n        m = m + 1;\n    tianshu = m + day[i];\n    cout << tianshu << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, i, x;\n  x = 0;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  for (i = 1; i < mon; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      x = x + 30;\n    }\n    if (i == 2) {\n      if (year % 400 == 0) {\n        x = x + 29;\n      } else if (year % 4 == 0 && year % 100 != 0) {\n        x = x + 29;\n      } else {\n        x = x + 28;\n      }\n    }\n  }\n  x = x + day;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "19171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, days, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 == !0) {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 29 + day;\n      break;\n    case 4:\n      days = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n    default:;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 28 + day;\n      break;\n    case 4:\n      days = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n    default:;\n    }\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "19172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n  int temp;\n  if (year % 4 != 0) {\n    temp = 28; \n  } else if (year % 100 != 0) {\n    temp = 29; \n  } else if (year % 400 != 0) {\n    temp = 28; \n  } else {\n    temp = 29; \n  }            \n  int a[12] = {31, temp, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int mouth[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                      {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  int leapyear;\n  int a, b, c, i;\n  int d = 0;\n  cin >> a >> b >> c;\n  leapyear = (a % 4 == 0 && a % 100 != 0 || a % 400 == 0);\n  for (i = 0; i < b - 1; i++)\n    d = d + mouth[leapyear][i];\n\n  d = d + c;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], b[10], c[10], n[10], d, i;\n  for (i = 0; i < 5; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n  }\n  for (i = 0; i < 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      n[i] = d + c[i];\n      cout << n[i] << \"\\n\";\n    } else {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      n[i] = d + c[i];\n      printf(\"%d\\n\", n[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19175", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100) != 0 || (y % 400 == 0))\n    days[2]++;\n  c = d;\n  for (i = 1; i < m; i++)\n    c = c + days[i];\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "19176", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, answer;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 29 + day;\n      break;\n    case 4:\n      answer = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  } else {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 28 + day;\n      break;\n    case 4:\n      answer = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y1, m, d, no;\n  scanf(\"%d %d %d \", &y1, &m, &d);\n  no = 0;\n  if (y1 % 4 == 0) {\n    if (y1 % 400 == 0) {\n      switch (m) {\n      case 1:\n        no = d;\n        break;\n      case 2:\n        no = d + 31;\n        break;\n      case 3:\n        no = d + 60;\n        break;\n      case 4:\n        no = d + 91;\n        break;\n      case 5:\n        no = d + 121;\n        break;\n      case 6:\n        no = d + 152;\n        break;\n      case 7:\n        no = d + 182;\n        break;\n      case 8:\n        no = d + 213;\n        break;\n      case 9:\n        no = d + 243;\n        break;\n      case 10:\n        no = d + 274;\n        break;\n      case 11:\n        no = d + 304;\n        break;\n      case 12:\n        no = d + 335;\n        break;\n      }\n    } else {\n      if (y1 % 100 == 0) {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 59;\n          break;\n        case 4:\n          no = d + 90;\n          break;\n        case 5:\n          no = d + 120;\n          break;\n        case 6:\n          no = d + 151;\n          break;\n        case 7:\n          no = d + 181;\n          break;\n        case 8:\n          no = d + 212;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 273;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 334;\n          break;\n        }\n      } else {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 60;\n          break;\n        case 4:\n          no = d + 91;\n          break;\n        case 5:\n          no = d + 121;\n          break;\n        case 6:\n          no = d + 152;\n          break;\n        case 7:\n          no = d + 182;\n          break;\n        case 8:\n          no = d + 213;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 274;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 335;\n          break;\n        }\n      }\n    }\n  } else {\n    switch (m) {\n    case 1:\n      no = d;\n      break;\n    case 2:\n      no = d + 31;\n      break;\n    case 3:\n      no = d + 59;\n      break;\n    case 4:\n      no = d + 90;\n      break;\n    case 5:\n      no = d + 120;\n      break;\n    case 6:\n      no = d + 151;\n      break;\n    case 7:\n      no = d + 181;\n      break;\n    case 8:\n      no = d + 212;\n      break;\n    case 9:\n      no = d + 243;\n      break;\n    case 10:\n      no = d + 273;\n      break;\n    case 11:\n      no = d + 304;\n      break;\n    case 12:\n      no = d + 334;\n      break;\n    }\n  }\n  cout << no;\n  return 0;\n}\n"}
{"label": "11", "index": "19178", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (b == 1) {\n    d = c;\n  }\n  if (b == 2) {\n    d = c + 31;\n  }\n  if (b == 3) {\n    d = c + 31 + 28;\n  }\n  if (b == 4) {\n    d = c + 59 + 31;\n  }\n  if (b == 5) {\n    d = c + 90 + 30;\n  }\n  if (b == 6) {\n    d = c + 120 + 31;\n  }\n  if (b == 7) {\n    d = c + 151 + 30;\n  }\n  if (b == 8) {\n    d = c + 181 + 31;\n  }\n  if (b == 9) {\n    d = c + 212 + 31;\n  }\n  if (b == 10) {\n    d = c + 243 + 30;\n  }\n  if (b == 11) {\n    d = c + 273 + 31;\n  }\n  if (b == 12)\n    d = c + 304 + 30;\n\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      if (b != 1 && b != 2) {\n        d = d + 1;\n      }\n    }\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    if (b != 1 && b != 2) {\n      d = d + 1;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19179", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int y, m, d, s, er;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 400 == 0) {\n    er = 29;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  } else {\n    er = 28;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19180", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m == 1)\n    sum = d;\n  if (m == 2)\n    sum = 31 + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m == 3) {\n      sum = 31 + 29 + d;\n    }\n    if (m == 4)\n      sum = 31 + 29 + 31 + d;\n    if (m == 5)\n      sum = 31 + 29 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 29 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  } else {\n    if (m == 3)\n      sum = 31 + 28 + d;\n    if (m == 4)\n      sum = 31 + 28 + 31 + d;\n    if (m == 5)\n      sum = 31 + 28 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 28 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, z;\n  cin >> x >> y >> z;\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else {\n    D = n + z;\n  }\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, num;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    num = d;\n    break;\n  case 2:\n    num = 31 + d;\n    break;\n  case 3:\n    num = 59 + d;\n    break;\n  case 4:\n    num = 90 + d;\n    break;\n  case 5:\n    num = 120 + d;\n    break;\n  case 6:\n    num = 151 + d;\n    break;\n  case 7:\n    num = 181 + d;\n    break;\n  case 8:\n    num = 212 + d;\n    break;\n  case 9:\n    num = 243 + d;\n    break;\n  case 10:\n    num = 273 + d;\n    break;\n  case 11:\n    num = 304 + d;\n    break;\n  case 12:\n    num = 334 + d;\n    break;\n  }\n  if (((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) && (m > 2))\n    num = num + 1;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, d = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      d = d + 31;\n    else\n      d = d + 30;\n  }\n  if (i <= 2)\n    d = d;\n  else if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    d = d - 1;\n  else\n    d = d - 2;\n  d = d + c;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19184", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint RunNian(int y) {\n  int result;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int y, int m, int d) {\n  int result = 0;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (RunNian(y)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n\n  result += d;\n  return result;\n}\n\nint main() {\n\n  int y2, m2, d2, a, e;\n  int T = 0;\n\n  scanf(\"%d%d%d\", &y2, &m2, &d2);\n\n  T += DiJiTian(y2, m2, d2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "11", "index": "19185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, y, d;\n  scanf(\"%d%d%d\\n\", &n, &x, &y);\n  d = 0;\n  if ((x > 2) && (n % 400 == 0))\n    d = 1;\n  if ((x > 2) && (n % 100 != 0) && (n % 4 == 0))\n    d = 1;\n  d = d + y;\n  x--;\n  switch (x) {\n  case 11:\n    d = d + 30;\n  case 10:\n    d = d + 31;\n  case 9:\n    d = d + 30;\n  case 8:\n    d = d + 31;\n  case 7:\n    d = d + 31;\n  case 6:\n    d = d + 30;\n  case 5:\n    d = d + 31;\n  case 4:\n    d = d + 30;\n  case 3:\n    d = d + 31;\n  case 2:\n    d = d + 28;\n  case 1:\n    d = d + 31;\n  }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d = c + 31;\n  int e = c + 60;\n  int f = c + 91;\n  int g = c + 121;\n  int h = c + 152;\n  int i = c + 182;\n  int j = c + 213;\n  int k = c + 244;\n  int l = c + 274;\n  int m = c + 305;\n  int n = c + 335;\n  int o = c + 59;\n  int p = c + 90;\n  int q = c + 120;\n  int r = c + 151;\n  int s = c + 181;\n  int t = c + 212;\n  int u = c + 243;\n  int v = c + 273;\n  int w = c + 304;\n  int x = c + 334;\n  if (b == 1)\n    printf(\"%d\\n\", c);\n  else if (b == 2)\n    printf(\"%d\\n\", d);\n  if (b > 2 && ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", e);\n    else if (b == 4)\n      printf(\"%d\\n\", f);\n    else if (b == 5)\n      printf(\"%d\\n\", g);\n    else if (b == 6)\n      printf(\"%d\\n\", h);\n    else if (b == 7)\n      printf(\"%d\\n\", i);\n    else if (b == 8)\n      printf(\"%d\\n\", j);\n    else if (b == 9)\n      printf(\"%d\\n\", k);\n    else if (b == 10) {\n      printf(\"%d\\n\", l);\n    } else if (b == 11)\n      printf(\"%d\\n\", m);\n    else if (b == 12)\n      printf(\"%d\\n\", n);\n  } else if (b > 2 && ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", o);\n    else if (b == 4)\n      printf(\"%d\\n\", p);\n    else if (b == 5)\n      printf(\"%d\\n\", q);\n    else if (b == 6)\n      printf(\"%d\\n\", r);\n    else if (b == 7)\n      cout << s << \"\\n\";\n    else if (b == 8)\n      printf(\"%d\\n\", t);\n    else if (b == 9)\n      printf(\"%d\\n\", u);\n    else if (b == 10)\n      printf(\"%d\\n\", v);\n    else if (b == 11)\n      printf(\"%d\\n\", w);\n    else if (b == 12)\n      printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[11];\n  int y, m, d, i, leap, total = 0;\n  cin >> y >> m >> d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  for (i = 0; i < m - 1; i++)\n    total += a[i];\n  total += d;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19188", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 60 + c;\n      break;\n    }\n    case 4: {\n      n = 91 + c;\n      break;\n    }\n    case 5: {\n      n = 121 + c;\n      break;\n    }\n    case 6: {\n      n = 152 + c;\n      break;\n    }\n    case 7: {\n      n = 182 + c;\n      break;\n    }\n    case 8: {\n      n = 213 + c;\n      break;\n    }\n    case 9: {\n      n = 244 + c;\n      break;\n    }\n    case 10: {\n      n = 274 + c;\n      break;\n    }\n    case 11: {\n      n = 305 + c;\n      break;\n    }\n    case 12: {\n      n = 335 + c;\n      break;\n    }\n    }\n\n  } else {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 59 + c;\n      break;\n    }\n    case 4: {\n      n = 90 + c;\n      break;\n    }\n    case 5: {\n      n = 120 + c;\n      break;\n    }\n    case 6: {\n      n = 151 + c;\n      break;\n    }\n    case 7: {\n      n = 181 + c;\n      break;\n    }\n    case 8: {\n      n = 212 + c;\n      break;\n    }\n    case 9: {\n      n = 243 + c;\n      break;\n    }\n    case 10: {\n      n = 273 + c;\n      break;\n    }\n    case 11: {\n      n = 304 + c;\n      break;\n    }\n    case 12: {\n      n = 334 + c;\n      break;\n    }\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int n) {\n  cin >> n;\n  if (n % 100 == 0) {\n    if (n % 400 == 0)\n      return 1;\n    else\n      return 0;\n  } else if (n % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int t = 0, i;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 5 || i == 3 || i == 7 || i == 8 || i == 10)\n      t = t + 31;\n    else if (i == 2)\n      t = t + 28;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      t = t + 30;\n  }\n  t = t + d;\n  if (f(y) == 1 && m > 2)\n    t = t + 1;\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "19190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 60 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 91 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 121 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 152 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 182 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 213 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 9) {\n      n = 244 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 10) {\n      n = 274 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 11) {\n      n = 305 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 12) {\n      n = 336 + c;\n      printf(\"%d\\n\", n);\n    }\n  } else {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 59 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 90 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 120 + c;\n      cout << n << \"\\n\";\n    } else if (b == 6) {\n      n = 151 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 181 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 212 + c;\n      printf(\"%d\\n\", n);\n    } else {\n      if (b == 9) {\n        n = 243 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 10) {\n        n = 273 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 11) {\n        n = 304 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 12) {\n        n = 335 + c;\n        printf(\"%d\\n\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19191", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint rn(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, res = 0,\n               day[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i;\n  cin >> y >> m >> d;\n\n  for (i = 0; i < m; i++)\n    res = res + day[i];\n\n  if (rn(y) == 1) {\n    if (m >= 3) {\n      printf(\"%d\\n\", res + d + 1);\n    } else\n      printf(\"%d\\n\", res + d);\n  }\n  if (rn(y) == 0)\n    printf(\"%d\\n\", res + d);\n  return 0;\n}\n"}
{"label": "11", "index": "19192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1) {\n    a = day;\n  } else if (mon == 2)\n    a = 31 + day;\n  else if (mon > 2) {\n    if (mon == 3) {\n      a = 31 + 29 + day;\n    } else if (mon == 4) {\n      a = 31 + 29 + 31 + day;\n    } else if (mon == 5) {\n      a = 31 + 29 + 31 + 30 + day;\n    } else if (mon == 6) {\n      a = 31 + 29 + 31 + 30 + 31 + day;\n    } else if (mon == 7) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    } else if (mon == 8) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    } else if (mon == 9) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    } else if (mon == 10) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    } else if (mon == 11) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    } else if (mon == 12) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n    if (year % 400 == 0 || year % 100 != 0 && year % 4 == 0)\n      a = a;\n    else\n      a = a - 1;\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19193", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    day[1] = 29;\n  for (int i = 0; i < m - 1; i++)\n    d += day[i];\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, sm = 0, k;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) != 0) {\n    int m[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sum = sum + m[k];\n    sum = sum + day;\n    printf(\"%d\", sum);\n  } else {\n    int n[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sm = sm + n[k];\n    sm = sm + day;\n    printf(\"%d\", sm);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month,\n      monthd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day,\n      di = 0, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    di = di + monthd[i - 1];\n  }\n  di = di + day;\n  if ((year % 4) != 0 || (year % 400) != 0) {\n    printf(\"%d\\n\", di);\n  } else\n    printf(\"%d\", di + 1);\n  return 0;\n}\n"}
{"label": "11", "index": "19196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    a[1] = 29;\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  } else {\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  }\n  cout << n;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n) {\n  int sum;\n  switch (n) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = (31 + 28);\n    break;\n  case 4:\n    sum = (31 + 28 + 31);\n    break;\n  case 5:\n    sum = (31 * 2 + 28 + 30);\n    break;\n  case 6:\n    sum = (31 * 3 + 28 + 30);\n    break;\n  case 7:\n    sum = (31 * 3 + 28 + 30 * 2);\n    break;\n  case 8:\n    sum = (31 * 4 + 28 + 30 * 2);\n    break;\n  case 9:\n    sum = (31 * 5 + 28 + 30 * 2);\n    break;\n  case 10:\n    sum = (31 * 5 + 28 + 30 * 3);\n    break;\n  case 11:\n    sum = (31 * 6 + 28 + 30 * 3);\n    break;\n  case 12:\n    sum = (31 * 6 + 28 + 30 * 4);\n  }\n  return (sum);\n}\nint main() {\n  int month[5], day[5], year[5], d[5], i;\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  for (i = 0; i <= 4; i++) {\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0) &&\n        month[i] > 2)\n      d[i] = f(month[i]) + day[i] + 1;\n    else\n      d[i] = f(month[i]) + day[i];\n    printf(\"%d\\n\", d[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Y, M, D, x, y = 0, i, a[12], sum;\n  cin >> Y >> M >> D;\n  a[0] = 31;\n  a[2] = 31;\n  a[4] = 31;\n  a[6] = 31;\n  a[7] = 31;\n  a[9] = 31;\n  a[11] = 31;\n  a[3] = 30;\n  a[5] = 30;\n  a[8] = 30;\n  a[10] = 30;\n  if (Y % 4 != 0)\n    a[1] = 28;\n  else if (Y % 4 == 0 && Y % 100 != 0)\n    a[1] = 29;\n  else if (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 1; i <= M; i++) {\n    x = a[M - i];\n    y = y + x;\n  }\n  sum = y + D - a[M - 1];\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, p;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0)\n        p = 29;\n      else {\n        p = 28;\n      }\n    else {\n      p = 29;\n    }\n  else {\n    p = 28;\n  }\n\n  switch (m) {\n  case 1: {\n    printf(\"%d\", d);\n    break;\n  }\n  case 2: {\n    cout << d + 31;\n    break;\n  }\n  case 3: {\n    printf(\"%d\", d + 31 + p);\n    break;\n  }\n  case 4: {\n    printf(\"%d\", d + 31 * 2 + p);\n    break;\n  }\n  case 5: {\n    printf(\"%d\", d + 31 * 2 + p + 30);\n    break;\n  }\n  case 6: {\n    printf(\"%d\", d + 31 * 3 + p + 30);\n    break;\n  }\n  case 7: {\n    printf(\"%d\", d + 31 * 3 + p + 30 * 2);\n    break;\n  }\n  case 8: {\n    printf(\"%d\", d + 31 * 4 + p + 30 * 2);\n    break;\n  }\n  case 9: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 2);\n    break;\n  }\n  case 10: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 3);\n    break;\n  }\n  case 11: {\n    printf(\"%d\", d + 31 * 6 + p + 30 * 3);\n    break;\n  }\n  default: { printf(\"%d\", d + 31 * 6 + p + 30 * 4); }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, n, leap;\n  cin >> year >> mon >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap = 0) {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 29 + day;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  } else {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 28 + day;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    cout << n;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int y) {\n  int i;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        return (1);\n      else\n        return (0);\n    } else\n      return (1);\n  } else\n    return (0);\n}\nint main() {\n  int y, m, d, n, i;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 30;\n  n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (f(y) == 0)\n    a[2] = 28;\n  if (f(y) == 1) {\n    a[2] = 29;\n  }\n  for (i = 1; i < m; i++)\n    n = a[i] + n;\n  n = n + d;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, a[5], i = 1;\n  while (i <= 5) {\n    scanf(\"%d%d%d\", &y, &m, &d);\n    if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0) {\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 28;\n        break;\n      case 4:\n        a[i] = d + 62 + 28;\n        break;\n      case 5:\n        a[i] = d + 62 + 28 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 28;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 28;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 28;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 28;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 28;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 28;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 28;\n        break;\n      }\n    } else\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 29;\n        break;\n      case 4:\n        a[i] = d + 62 + 29;\n        break;\n      case 5:\n        a[i] = d + 62 + 29 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 29;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 29;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 29;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 29;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 29;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 29;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 29;\n        break;\n      }\n    i = i + 1;\n  }\n  cout << a[1] << \"\\n\"\n       << a[2] << \"\\n\"\n       << a[3] << \"\\n\"\n       << a[4] << \"\\n\"\n       << a[5] << \"\\n%\";\n  return 0;\n}\n"}
{"label": "11", "index": "19203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, D = 0, i;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  } else {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  }\n  printf(\"%d\", D);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, z, i, n;\n  cin >> x >> y >> z;\n  if (x % 400 == 0)\n    i = 1;\n  else {\n    if (x % 100 == 0)\n      i = 0;\n    else {\n      if (x % 4 == 0) {\n        i = 1;\n      } else\n        i = 0;\n    }\n  }\n  if (i == 1) {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 29 + z;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 28 + z;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19205", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  switch (b) {\n  case 1:\n    d = c;\n    break;\n  case 2:\n    d = 31 + c;\n    break;\n  case 3:\n    d = 29 + 31 + c;\n    break;\n  case 4:\n    d = 29 + 31 + 31 + c;\n    break;\n  case 5:\n    d = 29 + 31 + 31 + 30 + c;\n    break;\n  case 6:\n    d = 29 + 31 * 3 + 30 + c;\n    break;\n  case 7:\n    d = 29 + 31 * 3 + 60 + c;\n    break;\n  case 8:\n    d = 29 + 31 * 4 + 60 + c;\n    break;\n  case 9:\n    d = 29 + 31 * 5 + 60 + c;\n    break;\n  case 10:\n    d = 29 + 31 * 5 + 90 + c;\n    break;\n  case 11:\n    d = 29 + 31 * 6 + 90 + c;\n    break;\n  case 12:\n    d = 29 + 31 * 6 + 120 + c;\n    break;\n    printf(\"%d\", d);\n  }\n  if ((a % 4 != 0 || a % 100 == 0 && a % 400 != 0) && b > 2) {\n    d = d - 1;\n  }\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int a) {\n  int z;\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int i, m;\n  int n[5][3];\n  int total[5];\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d %d %d\", &n[i][0], &n[i][1], &n[i][2]);\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i <= 4; i++) {\n    month[1] = 28 + leap(n[i][0]);\n    total[i] = 0;\n    for (m = 0; m <= n[i][1] - 2; m++)\n      total[i] = total[i] + month[m];\n    total[i] = total[i] + n[i][2];\n    printf(\"%d\\n\", total[i]);\n  }\n}\n"}
{"label": "11", "index": "19207", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, m, n, t, i, s;\n  scanf(\"%d %d %d \", &l, &m, &n);\n  if (l % 4 == 0 && l % 100 != 0)\n    t = 29;\n  if (l % 4 != 0)\n    t = 28;\n  if (l % 100 == 0 && l % 400 != 0)\n    t = 28;\n  if (l % 400 == 0)\n    t = 29;\n  int a[13] = {0, 31, t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (m == 1)\n    s = n;\n  else\n    s = n;\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rennian(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, i, a = 0, b;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (rennian(y) == 1) {\n    days[2]++;\n  }\n  for (i = 0; i < m; i++) {\n    a += days[i];\n  }\n  b = a + d;\n  cout << b;\n  return 0;\n}\n"}
{"label": "11", "index": "19209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = day;\n    break;\n  case 2:\n    sum = 31 + day;\n    break;\n  case 3:\n    sum = 31 + 28 + day;\n    break;\n  case 4:\n    sum = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    sum = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    sum = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + day;\n    break;\n  }\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 60 + d);\n      break;\n    case 4:\n      printf(\"%d\", 91 + d);\n      break;\n    case 5:\n      printf(\"%d\", 121 + d);\n      break;\n    case 6:\n      printf(\"%d\", 152 + d);\n      break;\n    case 7:\n      printf(\"%d\", 182 + d);\n      break;\n    case 8:\n      printf(\"%d\", 213 + d);\n      break;\n    case 9:\n      printf(\"%d\", 244 + d);\n      break;\n    case 10:\n      printf(\"%d\", 274 + d);\n      break;\n    case 11:\n      printf(\"%d\", 305 + d);\n      break;\n    case 12:\n      printf(\"%d\", 335 + d);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      cout << 59 + d;\n      break;\n    case 4:\n      printf(\"%d\", 90 + d);\n      break;\n    case 5:\n      printf(\"%d\", 120 + d);\n      break;\n    case 6:\n      printf(\"%d\", 151 + d);\n      break;\n    case 7:\n      printf(\"%d\", 181 + d);\n      break;\n    case 8:\n      printf(\"%d\", 212 + d);\n      break;\n    case 9:\n      printf(\"%d\", 243 + d);\n      break;\n    case 10:\n      printf(\"%d\", 273 + d);\n      break;\n    case 11:\n      printf(\"%d\", 304 + d);\n      break;\n    case 12:\n      printf(\"%d\", 334 + d);\n      break;\n    }\n  }\n}\n"}
{"label": "11", "index": "19211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, sum = 0;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b; i++) {\n    sum = sum + month[i];\n  }\n  sum = sum + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    sum = sum + 1;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19212", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A, B, C, a, b, c, d, e, f, g, h, i, j, k, l, m;\n  cin >> A >> B >> C;\n  a = 31;\n  if ((A % 4 == 0 && A % 100 != 0) || A % 400 == 0)\n    b = 29;\n  else\n    b = 28;\n  c = 31;\n  d = 30;\n  e = 31;\n  f = 30;\n  g = 31;\n  h = 31;\n  i = 30;\n  j = 31;\n  k = 30;\n  l = 31;\n  if (B == 1) {\n    m = C;\n  }\n  if (B == 2)\n    m = C + a;\n  if (B == 3)\n    m = C + a + b;\n  if (B == 4)\n    m = C + a + b + c;\n  if (B == 5)\n    m = C + a + b + c + d;\n  if (B == 6)\n    m = C + a + b + c + d + e;\n  if (B == 7)\n    m = C + a + b + c + d + e + f;\n  if (B == 8)\n    m = C + a + b + c + d + e + f + g;\n  if (B == 9)\n    m = C + a + b + c + d + e + f + g + h;\n  if (B == 10)\n    m = C + a + b + c + d + e + f + g + h + i;\n  if (B == 11)\n    m = C + a + b + c + d + e + f + g + h + i + j;\n  if (B == 12)\n    m = C + a + b + c + d + e + f + g + h + i + j + k;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "11", "index": "19213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  cin >> year >> month >> day;\n  switch (month) {\n  case 1: {\n    n = day;\n    break;\n  }\n\n  case 2: {\n    n = 31 + day;\n    break;\n  }\n\n  case 3: {\n    n = 59 + day;\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      n = n + 1;\n    else {\n      n = n;\n    }\n\n    break;\n  }\n  case 4: {\n    n = 90 + day;\n    break;\n  }\n  case 5: {\n    n = 120 + day;\n    break;\n  }\n  case 6: {\n    n = 151 + day;\n    break;\n  }\n  case 7: {\n    n = 181 + day;\n    break;\n  }\n  case 8: {\n    n = 212 + day;\n    break;\n  }\n  case 9: {\n    n = 243 + day;\n    break;\n  }\n  case 10: {\n    n = 273 + day;\n    break;\n  }\n  case 11: {\n    n = 304 + day;\n    break;\n  }\n  case 12: {\n    n = 334 + day;\n    break;\n  }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int a = 0;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 29 + date;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 28 + date;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 28 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int sum = 0, i;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, d1 = 0, d2, i;\n  int md[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m == 1)\n    d2 = d;\n  else {\n\n    for (i = 0; i < m - 1; i++)\n      d1 = d1 + md[i];\n    d2 = d + d1;\n  }\n  printf(\"%d\", d2);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19217", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  cin >> i >> j >> k;\n  if ((i % 4 == 0 && i % 100 != 0) || (i % 100 == 0 && i % 400 == 0)) {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 60;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 91;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 121;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 152;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 182;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 213;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 244;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 274;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 305;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 335;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 59;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 90;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 120;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 151;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 181;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 212;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 243;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 273;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 304;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 334;\n      printf(\"%d\", m);\n    }\n  }\n}\n"}
{"label": "11", "index": "19218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int test(int n);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, s, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (test(y) == 1) \n  {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + b[i];\n  } else {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + a[i];\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n}\nint test(int n) {\n  if (n % 400 == 0)\n    n = 1;\n  else if (n % 100 != 0 && n % 4 == 0)\n    n = 1;\n  else\n    n = 0;\n  return (n);\n}\n"}
{"label": "11", "index": "19219", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  cin >> year >> month >> day;\n  int monday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  total = 0;\n  for (i = 1; i < month; i++) {\n    total = total + monday[i - 1];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    total = total + 1;\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19220", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, k, leap = 0, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    leap = 1;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      k = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      k = 30;\n      break;\n    case 2:\n      if (leap == 1)\n        k = 29;\n      else\n        k = 28;\n      break;\n    }\n    sum += k;\n  }\n  cout << sum + d;\n  return 0;\n}\n"}
{"label": "11", "index": "19221", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) ||\n      (year % 100 == 0 && year % 400 == 0)) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a;\n  cin >> y >> m >> d;\n  if (y % 4 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 400 == 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 == 0 && y % 400 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k;\n  if (a % 100 == 0 && a % 400 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    cout << k + c;\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else {\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    cout << k + c;\n  }\n}\n"}
{"label": "11", "index": "19224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, d;\n  scanf(\"%d %d %d\", &x, &y, &z);\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0)) {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 29;\n      break;\n    case 4:\n      d = z + 31 + 29 + 31;\n      break;\n    case 5:\n      d = z + 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 28;\n      break;\n    case 4:\n      d = z + 31 + 28 + 31;\n      break;\n    case 5:\n      d = z + 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, a, i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) == 1) {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 29 + day;\n        break;\n      case 4:\n        a = 31 + 29 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 29 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 29 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        cout << \"error\\n\";\n      }\n    } else {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 28 + day;\n        break;\n      case 4:\n        a = 31 + 28 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 28 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 28 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        printf(\"error\\n\");\n      }\n    }\n    printf(\"%d\\n\", a);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19226", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int Sn = 0;\n  int i = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  } else {\n    int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  }\n  printf(\"%d\", Sn);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d[12] = {0};\n  int a, b, c, i, sum = 0;\n  int run(int x);\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10)) {\n      d[i] = 31;\n      sum += d[i];\n    } else if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      d[i] = 30;\n      sum += d[i];\n    } else {\n      if (run(a) == 1)\n        d[i] = 29;\n      else {\n        d[i] = 28;\n      }\n      sum += d[i];\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\nint run(int x) {\n  int z;\n  if ((x % 400 == 0) || ((x % 100 != 0) && (x % 4 == 0))) {\n    z = 1;\n  }\n  return z;\n}\n"}
{"label": "11", "index": "19228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e[12], i;\n  e[1] = e[3] = e[5] = e[7] = e[8] = e[10] = e[12] = 31;\n  e[2] = 28;\n  e[4] = e[6] = e[9] = e[11] = 30;\n  d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + e[i];\n    }\n    d = d + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      e[2] = 29;\n      d = d + e[i];\n    }\n    d = d + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19229", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 59 + c;\n    else if (b == 4)\n      s = 90 + c;\n    else if (b == 5)\n      s = 120 + c;\n    else if (b == 6)\n      s = 151 + c;\n    else if (b == 7)\n      s = 181 + c;\n    else if (b == 8)\n      s = 212 + c;\n    else if (b == 9)\n      s = 243 + c;\n    else if (b == 10)\n      s = 273 + c;\n    else if (b == 11)\n      s = 304 + c;\n    else if (b == 12)\n      s = 334 + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 60 + c;\n    else if (b == 4)\n      s = 91 + c;\n    else if (b == 5)\n      s = 121 + c;\n    else if (b == 6)\n      s = 152 + c;\n    else if (b == 7)\n      s = 182 + c;\n    else if (b == 8)\n      s = 213 + c;\n    else if (b == 9)\n      s = 244 + c;\n    else if (b == 10)\n      s = 274 + c;\n    else if (b == 11)\n      s = 305 + c;\n    else if (b == 12)\n      s = 335 + c;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int year, month, day;\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  if (year % 4 != 0)\n    days[1] = 28;\n  else if (year % 4 == 0 && year % 100 != 0)\n    days[1] = 29;\n  else if (year % 400 == 0)\n    days[1] = 29;\n  else if (year % 100 == 0 && year % 400 != 0)\n    days[1] = 28;\n  int i, k = 0, n;\n  for (i = 1; i < month; i++) {\n    k = k + days[i];\n  }\n  n = k + day + 1;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 60 + day;\n      break;\n    case 4:\n      n = 91 + day;\n      break;\n    case 5:\n      n = 121 + day;\n      break;\n    case 6:\n      n = 152 + day;\n      break;\n    case 7:\n      n = 182 + day;\n      break;\n    case 8:\n      n = 213 + day;\n      break;\n    case 9:\n      n = 244 + day;\n      break;\n    case 10:\n      n = 274 + day;\n      break;\n    case 11:\n      n = 305 + day;\n      break;\n    case 12:\n      n = 335 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 30 + day;\n      break;\n    case 3:\n      n = 59 + day;\n      break;\n    case 4:\n      n = 90 + day;\n      break;\n    case 5:\n      n = 120 + day;\n      break;\n    case 6:\n      n = 151 + day;\n      break;\n    case 7:\n      n = 181 + day;\n      break;\n    case 8:\n      n = 212 + day;\n      break;\n    case 9:\n      n = 243 + day;\n      break;\n    case 10:\n      n = 273 + day;\n      break;\n    case 11:\n      n = 304 + day;\n      break;\n    case 12:\n      n = 334 + day;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n, p, a;\n  scanf(\"%d%d%d\", &m, &n, &p);\n  if (m % 4 != 0 || (m % 100 == 0 && m % 400 != 0)) {\n    if (n == 1) {\n      a = p;\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n    } else if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 2 + p;\n\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 29 + p;\n    }\n\n  } else {\n    if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 + p;\n    } else if (n == 1) {\n      a = p;\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 30 + p;\n    }\n  }\n\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19233", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n\n  int t = 0;\n  int aa[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b - 1; i++) {\n    t = t + aa[i];\n  }\n  if (b > 2) {\n    if ((a % 4 == 0) && ((a % 100) != 0) || (a % 400 == 0)) {\n      t = t + 29;\n    } else {\n      t = t + 28;\n    }\n  }\n  t = t + c;\n  printf(\"%d\", t);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[6], month[6], day[6], s[6] = {0};\n  int i = 1, n;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  n = 1;\n  while (n <= 5) {\n    cin >> year[n] >> month[n] >> day[n];\n    if ((year[n] % 4 == 0 && year[n] % 100 != 0) || year[n] % 400 == 0)\n      m[2] = 29;\n    else\n      m[2] = 28;\n    while (i < month[n]) {\n      s[n] = s[n] + m[i];\n      i = i + 1;\n    }\n    s[n] = s[n] + day[n];\n    n = n + 1;\n    i = 1;\n  }\n  for (n = 1; n <= 5; n = n + 1)\n    cout << s[n] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  scanf(\"%d\\t%d\\t%d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    y = c;\n    break;\n  case 2:\n    y = 31 + c;\n    break;\n  case 3:\n    y = 59 + c;\n    break;\n  case 4:\n    y = 90 + c;\n    break;\n  case 5:\n    y = 120 + c;\n    break;\n  case 6:\n    y = 151 + c;\n    break;\n  case 7:\n    y = 181 + c;\n    break;\n  case 8:\n    y = 212 + c;\n    break;\n  case 9:\n    y = 243 + c;\n    break;\n  case 10:\n    y = 273 + c;\n    break;\n  case 11:\n    y = 304 + c;\n    break;\n  case 12:\n    y = 334 + c;\n  }\n  cout << \"\\n\" << y;\n  return 0;\n}\n"}
{"label": "11", "index": "19236", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ping(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 28;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\nint run(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 29;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\n\nint main() {\n  int n, month, day, sum = 0;\n  cin >> n >> month >> day;\n  int i;\n  if ((n % 400 == 0) || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i < month; i++)\n      sum += run(i);\n    sum += day;\n    cout << sum;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += ping(i);\n    sum += day;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int k, j = 0, y, i, m, d,\n         number[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    j += number[i - 1];\n  }\n  k = j + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m > 1)\n      printf(\"%d\", k + 1);\n  } else\n    cout << k;\n  return 0;\n}\n"}
{"label": "11", "index": "19238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int aaa[5][3];\n  int year, mon, day, i, n, m;\n  int month[12];\n  month[0] = 31, month[1] = 28, month[2] = 31, month[3] = 30, month[4] = 31,\n  month[5] = 30, month[6] = 31, month[7] = 31, month[8] = 30, month[9] = 31,\n  month[10] = 30, month[11] = 31;\n\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\\n\", &year, &mon, &day);\n    aaa[i][0] = year;\n    aaa[i][1] = mon;\n    aaa[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = aaa[i][0];\n    mon = aaa[i][1];\n    day = aaa[i][2];\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n      month[1] = 29;\n    else\n      month[1] = 28;\n    n = 0;\n    for (m = 0; m < (mon - 1); m++) {\n      n = n + month[m];\n    }\n    n = n + day;\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "11", "index": "19239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int a[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};\n    d = a[b - 1] + c;\n    cout << d << \"\\n\";\n  } else {\n    int a[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n    d = a[b - 1] + c;\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d%d%d%d\", &y, &m, &d, &n);\n  if (y % 4 == 0 && y % 100 != 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  }\n  if (y % 400 == 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  } else {\n\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 2 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 2 + m / 2 + d;\n      else\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint rennian(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, i, a = 0, b;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (rennian(y) == 1) {\n    days[2]++;\n  }\n  for (i = 0; i < m; i++) {\n    a += days[i];\n  }\n  b = a + d;\n  cout << b;\n  return 0;\n}\n"}
{"label": "11", "index": "19242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y1, m, d, no;\n  scanf(\"%d %d %d\", &y1, &m, &d);\n  no = 0;\n  if (y1 % 4 == 0) {\n    if (y1 % 400 == 0) {\n      switch (m) {\n      case 1:\n        no = d;\n        break;\n      case 2:\n        no = d + 31;\n        break;\n      case 3:\n        no = d + 60;\n        break;\n      case 4:\n        no = d + 91;\n        break;\n      case 5:\n        no = d + 121;\n        break;\n      case 6:\n        no = d + 152;\n        break;\n      case 7:\n        no = d + 182;\n        break;\n      case 8:\n        no = d + 213;\n        break;\n      case 9:\n        no = d + 243;\n        break;\n      case 10:\n        no = d + 274;\n        break;\n      case 11:\n        no = d + 304;\n        break;\n      case 12:\n        no = d + 335;\n        break;\n      }\n    } else {\n      if (y1 % 100 == 0) {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 59;\n          break;\n        case 4:\n          no = d + 90;\n          break;\n        case 5:\n          no = d + 120;\n          break;\n        case 6:\n          no = d + 151;\n          break;\n        case 7:\n          no = d + 181;\n          break;\n        case 8:\n          no = d + 212;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 273;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 334;\n          break;\n        }\n      } else {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 60;\n          break;\n        case 4:\n          no = d + 91;\n          break;\n        case 5:\n          no = d + 121;\n          break;\n        case 6:\n          no = d + 152;\n          break;\n        case 7:\n          no = d + 182;\n          break;\n        case 8:\n          no = d + 213;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 274;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 335;\n          break;\n        }\n      }\n    }\n  } else {\n    switch (m) {\n    case 1:\n      no = d;\n      break;\n    case 2:\n      no = d + 31;\n      break;\n    case 3:\n      no = d + 59;\n      break;\n    case 4:\n      no = d + 90;\n      break;\n    case 5:\n      no = d + 120;\n      break;\n    case 6:\n      no = d + 151;\n      break;\n    case 7:\n      no = d + 181;\n      break;\n    case 8:\n      no = d + 212;\n      break;\n    case 9:\n      no = d + 243;\n      break;\n    case 10:\n      no = d + 273;\n      break;\n    case 11:\n      no = d + 304;\n      break;\n    case 12:\n      no = d + 334;\n      break;\n    }\n  }\n  printf(\"%d\", no);\n  return 0;\n}\n"}
{"label": "11", "index": "19243", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int n = 0;\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month; i++) {\n    n = days[i] + n;\n  }\n  n = day + n;\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    n++;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19244", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, k, m2;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    m2 = 29;\n  else\n    m2 = 28;\n  k = m2 + 31;\n  switch (month) {\n  case 1:\n    n = day;\n    break;\n  case 2:\n    n = day + 31;\n    break;\n  case 3:\n    n = k + day;\n    break;\n  case 4:\n    n = k + 31 + day;\n    break;\n  case 5:\n    n = 31 + k + 30 + day;\n    break;\n  case 6:\n    n = k + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    n = k + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    n = k + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19245", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int n = 0;\n  int i;\n\n  scanf(\"%d %d %d \", &year, &month, &day);\n\n  for (i = 1; i < month; i++)\n    n = n + days[i];\n\n  n = n + day;\n\n  if (month > 2 && isleapyear(year)) {\n    n++;\n  }\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int month[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, ans;\n  if (y % 400 == 0 || (y % 100 && y % 4 == 0))\n    month[2] = 29;\n  ans = 0;\n  for (i = 1; i < m; i++) {\n    ans += month[i];\n  }\n  ans += d;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "19247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 60 + c;\n      break;\n    }\n    case 4: {\n      n = 91 + c;\n      break;\n    }\n    case 5: {\n      n = 121 + c;\n      break;\n    }\n    case 6: {\n      n = 152 + c;\n      break;\n    }\n    case 7: {\n      n = 182 + c;\n      break;\n    }\n    case 8: {\n      n = 213 + c;\n      break;\n    }\n    case 9: {\n      n = 244 + c;\n      break;\n    }\n    case 10: {\n      n = 274 + c;\n      break;\n    }\n    case 11: {\n      n = 305 + c;\n      break;\n    }\n    case 12: {\n      n = 335 + c;\n      break;\n    }\n    }\n\n  } else {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 59 + c;\n      break;\n    }\n    case 4: {\n      n = 90 + c;\n      break;\n    }\n    case 5: {\n      n = 120 + c;\n      break;\n    }\n    case 6: {\n      n = 151 + c;\n      break;\n    }\n    case 7: {\n      n = 181 + c;\n      break;\n    }\n    case 8: {\n      n = 212 + c;\n      break;\n    }\n    case 9: {\n      n = 243 + c;\n      break;\n    }\n    case 10: {\n      n = 273 + c;\n      break;\n    }\n    case 11: {\n      n = 304 + c;\n      break;\n    }\n    case 12: {\n      n = 334 + c;\n      break;\n    }\n    }\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint leap(int n) {\n  int leap = 0;\n  if (n % 400 == 0 || n % 100 != 0 && n % 4 == 0)\n    leap = 1;\n  return (leap);\n}\n\nint main() {\n  int year, month, day,\n      th = 0, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (leap(year) == 1)\n    a[2] = 29;\n  for (int i = 0; i < month; i++)\n    th = th + a[i];\n  th = th + day;\n  printf(\"%d\", th);\n  return (0);\n}\n"}
{"label": "11", "index": "19249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int day = 0, y, m, d, i,\n      month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))\n    month[2] = 29;\n  for (i = 1; i < m; i++)\n    day += month[i];\n  day += d;\n  cout << day;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19250", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint run(int a) {\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int isr = run(y);\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days = 0;\n  for (int i = 1; i < m; i++) {\n    days = days + p[i];\n  }\n  days = days + d;\n  if (isr == 1 && m >= 3)\n    days++;\n  cout << days;\n}\n"}
{"label": "11", "index": "19251", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x = 0, i;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (m(a) == 1) {\n    int d[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  } else {\n    int d[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  }\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, leap, sum = 0;\n  int a[12], i, j;\n  scanf(\"%d\", &year);\n  scanf(\"%d\", &month);\n  scanf(\"%d\", &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (leap == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < 12; i++) {\n    if (month == i + 1) {\n      for (j = 0; j < i; j++)\n        sum += a[j];\n      sum += day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19253", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1, n = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      n = n + 31;\n    } else if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n        n = n + 29;\n      } else {\n        n = n + 28;\n      }\n    } else {\n      n = n + 30;\n    }\n  }\n  n = n + day;\n  printf(\"%d\\n\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1: {\n    n = day;\n    break;\n  }\n\n  case 2: {\n    n = 31 + day;\n    break;\n  }\n\n  case 3: {\n    n = 59 + day;\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      n = n + 1;\n    } else {\n      n = n;\n    }\n\n    break;\n  }\n  case 4: {\n    n = 90 + day;\n    break;\n  }\n  case 5: {\n    n = 120 + day;\n    break;\n  }\n  case 6: {\n    n = 151 + day;\n    break;\n  }\n  case 7: {\n    n = 181 + day;\n    break;\n  }\n  case 8: {\n    n = 212 + day;\n    break;\n  }\n  case 9: {\n    n = 243 + day;\n    break;\n  }\n  case 10: {\n    n = 273 + day;\n    break;\n  }\n  case 11: {\n    n = 304 + day;\n    break;\n  }\n  case 12: {\n    n = 334 + day;\n    break;\n  }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint day_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint sum_day(int month, int day) {\n  int i;\n  for (i = 0; i < month; i++)\n    day = day + day_month[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\nint main() {\n  int year, month, day, days, a;\n\n  for (a = 1; a <= 5; a++) {\n    cin >> year >> month >> day;\n\n    days = sum_day(month, day);\n    if (leap(year) && month >= 3)\n      days = days + 1;\n    printf(\"%d\\n\", days);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leapyear(int year) {\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  int i, Year, Month, Day, date = 0;\n  scanf(\"%d %d %d\", &Year, &Month, &Day);\n  if (leapyear(Year) == 1) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  } else if (leapyear(Year) == 0) {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  }\n}\n"}
{"label": "11", "index": "19257", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long a, b, c;\n  int i = 1;\nloop:\n  if (i <= 5) {\n    int n = 0;\n    scanf(\"%ld %ld %ld \", &a, &b, &c);\n    switch (b) {\n    case 12:\n      n = n + 30;\n    case 11:\n      n = n + 31;\n    case 10:\n      n = n + 30;\n    case 9:\n      n = n + 31;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 30;\n    case 6:\n      n = n + 31;\n    case 5:\n      n = n + 30;\n    case 4:\n      n = n + 31;\n    case 3:\n      n = n + 28;\n    case 2:\n      n = n + 31;\n    case 1:\n      n = n + c;\n      break;\n    }\n    if (((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) && b >= 3) {\n      n = n + 1;\n    }\n    printf(\"%d\\n\", n);\n    i++;\n    goto loop;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (!((a % 4 == 0 && a % 100 != 0) || (a % 4 == 0 && a % 400 == 0))) {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c - 1;\n    if (b == 4)\n      cout << 91 + c - 1;\n    if (b == 5)\n      cout << 121 + c - 1;\n    if (b == 6)\n      cout << 152 + c - 1;\n    if (b == 7)\n      cout << 182 + c - 1;\n    if (b == 8)\n      cout << 213 + c - 1;\n    if (b == 9)\n      cout << 244 + c - 1;\n    if (b == 10)\n      cout << 274 + c - 1;\n    if (b == 11)\n      cout << 305 + c - 1;\n    if (b == 12)\n      cout << 335 + c - 1;\n  } else {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c;\n    if (b == 4)\n      cout << 91 + c;\n    if (b == 5)\n      cout << 121 + c;\n    if (b == 6)\n      cout << 152 + c;\n    if (b == 7)\n      cout << 182 + c;\n    if (b == 8)\n      printf(\"%d\", 213 + c);\n    if (b == 9)\n      cout << 244 + c;\n    if (b == 10)\n      cout << 274 + c;\n    if (b == 11)\n      cout << 305 + c;\n    if (b == 12)\n      cout << 335 + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, m, d, i, b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  c[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  s = 0;\n  cin >> a >> m >> d;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0))\n    for (i = 1; i < m; i++)\n      s += b[i];\n  else\n    for (i = 1; i < m; i++)\n      s += c[i];\n  cout << s + d;\n  return 0;\n}\n"}
{"label": "11", "index": "19260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rennian(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, i, a = 0, b;\n  cin >> y >> m >> d;\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (rennian(y) == 1) {\n    days[2]++;\n  }\n  for (i = 0; i < m; i++) {\n    a += days[i];\n  }\n  b = a + d;\n  cout << b;\n  return 0;\n}\n"}
{"label": "11", "index": "19261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  sum = 0;\n  for (i = 1; i < m; i++)\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10))\n      sum = sum + 31;\n    else if (i == 2)\n      if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n        sum = sum + 29;\n      } else\n        sum = sum + 28;\n    else\n      sum = sum + 30;\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19262", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 60 + c;\n    else if (b == 4)\n      n = 91 + c;\n    else if (b == 5)\n      n = 121 + c;\n    else if (b == 6)\n      n = 152 + c;\n    else if (b == 7)\n      n = 182 + c;\n    else if (b == 8)\n      n = 213 + c;\n    else if (b == 9)\n      n = 244 + c;\n    else if (b == 10)\n      n = 274 + c;\n    else if (b == 11)\n      n = 305 + c;\n    else\n      n = 336 + c;\n  } else {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 59 + c;\n    else if (b == 4)\n      n = 90 + c;\n    else if (b == 5)\n      n = 120 + c;\n    else if (b == 6)\n      n = 151 + c;\n    else if (b == 7)\n      n = 181 + c;\n    else if (b == 8)\n      n = 212 + c;\n    else if (b == 9)\n      n = 243 + c;\n    else if (b == 10)\n      n = 273 + c;\n    else if (b == 11)\n      n = 304 + c;\n    else\n      n = 335 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, data, days = 0;\n  cin >> year >> month >> data;\n  days = data;\n  if (month == 1) {\n    days = days;\n  } else {\n    for (i = 1; i < month; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        days = days + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        days = days + 30;\n      else if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n        days = days + 29;\n      else\n        days = days + 28;\n    }\n    days = days;\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "19264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    for (int i = m - 2; i >= 0; i--) {\n      sum = sum + b[i];\n    }\n    cout << sum + d;\n  } else {\n    for (int s = m - 2; s >= 0; s--)\n      sum = sum + a[s];\n\n    cout << sum + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int d[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++) {\n      day = day + d[i];\n    }\n\n  } else {\n    int d[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++)\n      day = day + d[i];\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, total = 0;\n  int year, month, day;\n  cin >> year >> month >> day;\n  for (j = 1; j < month; j++) {\n    if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 || j == 12)\n      total = total + 31;\n    if (j == 4 || j == 6 || j == 9 || j == 11)\n      total = total + 30;\n    if (j == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n        total = total + 29;\n      } else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n\n  if (b == 1)\n    x = c;\n  if (b == 2)\n    x = 31 + c;\n  if (b == 3)\n    x = 31 + 28 + c;\n  if (b == 4)\n    x = 31 + 28 + 31 + c;\n  if (b == 5)\n    x = 31 + 28 + 31 + 30 + c;\n  if (b == 6)\n    x = 31 + 28 + 31 + 30 + 31 + c;\n  if (b == 7)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n  if (b == 8)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n  if (b == 9)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n  if (b == 10)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n  if (b == 11)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n  if (b == 12)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n\n  if (b <= 2)\n    printf(\"%d\\n\", x);\n  else if (a % 4 == 0)\n    if (a % 100 == 0)\n      if (a % 400 == 0)\n        printf(\"%d\\n\", x + 1);\n      else\n        printf(\"%d\\n\", x);\n    else\n      cout << x + 1 << \"\\n\";\n  else\n    printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, n = 0, i, num = 0;\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n = n + B[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      n = n + A[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, mon, day, i;\n  int total = 0;\n  cin >> year >> mon >> day;\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n\n  } else {\n    int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n  }\n  total += day;\n  cout << total;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, y = 0, days, w;\n  scanf(\"%d%d%d\", &year, &month, &days);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      day = 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      day = 30;\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        day = 29;\n      else {\n        day = 28;\n      }\n    }\n    y = y + day;\n  }\n  w = y + days;\n  printf(\"%d\\n\", w);\n  return 0;\n}\n"}
{"label": "11", "index": "19271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rn(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, res = 0,\n               day[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i;\n  cin >> y >> m >> d;\n\n  for (i = 0; i < m; i++)\n    res = res + day[i];\n\n  if (rn(y) == 1) {\n    if (m >= 3) {\n      printf(\"%d\\n\", res + d + 1);\n    } else\n      cout << res + d << \"\\n\";\n  }\n  if (rn(y) == 0)\n    printf(\"%d\\n\", res + d);\n  return 0;\n}\n"}
{"label": "11", "index": "19272", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint judge(int);\nint main() {\n  int year, month, day, i, total = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      total = total + 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    } else if (judge(year) == 0 && i == 2)\n      total = total + 28;\n    else if (judge(year) == 1 && i == 2)\n      total = total + 29;\n  }\n  total = total + day;\n  cout << total << endl;\n  return 0;\n}\nint judge(int x) {\n  int y = 0;\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0)\n    y = 1;\n  else\n    y = 0;\n  return y;\n}\n"}
{"label": "11", "index": "19273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int yy, mm, dd, i, n = 0;\n  scanf(\"%d %d %d \", &yy, &mm, &dd);\n  if (yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0) {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n\n        n = n + 29;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    cout << n;\n\n  }\n\n  else {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n        n = n + 28;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isrn(int n) {\n  if (n % 400 == 0)\n    return 1;\n  else {\n    if (n % 100 == 0)\n      return 0;\n    else {\n      if (n % 4 == 0)\n        return 1;\n      else\n        return 0;\n    }\n  }\n}\n\nint main() {\n  int y, m, d, sum = 0, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum += 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n\n    if (i == 2) {\n      if (isrn(y))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "11", "index": "19275", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0;\n  int i;\n\n  for (i = 0; i < month; i++) {\n    sum += a[i - 1];\n  }\n  sum = sum + day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month <= 2) {\n      printf(\"%d\\n\", sum);\n    }\n    if (month > 2) {\n      sum = sum + 1;\n      printf(\"%d\\n\", sum);\n    }\n  } else\n\n    printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = d + 31;\n  } else if (m == 3) {\n    s = d + 59;\n  } else if (m == 4)\n    s = d + 90;\n  else if (m == 5) {\n    s = d + 120;\n  } else if (m == 6) {\n    s = d + 151;\n  } else if (m == 7) {\n    s = d + 181;\n  } else if (m == 8) {\n    s = d + 212;\n  } else if (m == 9) {\n    s = d + 243;\n  } else if (m == 10) {\n    s = d + 273;\n  } else {\n    if (m == 11) {\n      s = d + 304;\n    } else {\n      s = d + 334;\n    }\n  }\n  if (!((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))) {\n    printf(\"%d\", s);\n  } else {\n    if (m < 3) {\n      printf(\"%d\", s);\n    } else {\n      printf(\"%d\", s + 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m == 1)\n    s = d;\n  else if (m == 2)\n    s = 31 + d;\n  else if (m == 3)\n    s = 60 + d;\n  else if (m == 4)\n    s = 91 + d;\n  else if (m == 5)\n    s = 121 + d;\n  else if (m == 6)\n    s = 152 + d;\n  else if (m == 7)\n    s = 182 + d;\n  else if (m == 8)\n    s = 213 + d;\n  else if (m == 9)\n    s = 244 + d;\n  else if (m == 10)\n    s = 274 + d;\n  else if (m == 11)\n    s = 305 + d;\n  else if (m == 12)\n    s = 335 + d;\n  if (m >= 3) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        printf(\"%d\", s);\n      else\n        printf(\"%d\", s - 1);\n    } else if (y % 4 == 0)\n      printf(\"%d\", s);\n    else if (y % 4 != 0)\n      printf(\"%d\", s - 1);\n  } else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    int m[13] = {0, 31, 60, 91, 121, 151, 182, 213, 244, 274, 305, 335, 366};\n    d = m[b - 1] + c;\n  } else {\n    int m[13] = {0, 31, 59, 90, 120, 150, 181, 212, 243, 273, 304, 334, 365};\n    d = m[b - 1] + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d, a, n;\n  cin >> y >> m >> d;\n  if ((y % 4) == 0 && (y % 100) != 0 || (y % 400 == 0))\n    a = 1;\n  else\n    a = 0;\n\n  switch (m) {\n  case 1:\n    n = d;\n    break;\n  case 2:\n    n = 31 + d;\n    break;\n  case 3:\n    n = 31 + 28 + d;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  if (a == 0)\n    printf(\"%d\", n);\n\n  if (m != 1 && m != 2 && a == 1) {\n    n = n + 1;\n    printf(\"%d\", n);\n  }\n  if (a == 1 && m == 1)\n    cout << n;\n  if (a == 1 && m == 2)\n    printf(\"%d\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int monthday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (int i = 1; i < month; i++) {\n    sum += monthday[i - 1];\n  }\n  sum += day;\n  if (month > 2 && (!year % 4 == 0 && year % 100 != 0 || year % 400 != 0)) {\n    sum -= 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19281", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, mounth, day, count = 0, t = 0;\n  scanf(\"%d%d%d\", &year, &mounth, &day);\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    count = 1;\n  } else\n    count = 0;\n  if (count == 1) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 60 + day;\n      break;\n    case 4:\n      t = 91 + day;\n      break;\n    case 5:\n      t = 121 + day;\n      break;\n    case 6:\n      t = 152 + day;\n      break;\n    case 7:\n      t = 182 + day;\n      break;\n    case 8:\n      t = 213 + day;\n      break;\n    case 9:\n      t = 244 + day;\n      break;\n    case 10:\n      t = 274 + day;\n      break;\n    case 11:\n      t = 305 + day;\n      break;\n    case 12:\n      t = 335 + day;\n      break;\n    }\n  }\n  if (count == 0) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 59 + day;\n      break;\n    case 4:\n      t = 90 + day;\n      break;\n    case 5:\n      t = 120 + day;\n      break;\n    case 6:\n      t = 151 + day;\n      break;\n    case 7:\n      t = 181 + day;\n      break;\n    case 8:\n      t = 212 + day;\n      break;\n    case 9:\n      t = 243 + day;\n      break;\n    case 10:\n      t = 273 + day;\n      break;\n    case 11:\n      t = 304 + day;\n      break;\n    case 12:\n      t = 334 + day;\n      break;\n    }\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "11", "index": "19282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0;\n  int i;\n\n  for (i = 0; i < month; i++) {\n    sum += a[i - 1];\n  }\n  sum = sum + day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month <= 2) {\n      cout << sum << \"\\n\";\n    }\n    if (month > 2) {\n      sum = sum + 1;\n      cout << sum << \"\\n\";\n    }\n  } else\n\n    printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19283", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  y = 0;\n  for (i = 0; i < b - 1; i++) {\n    y = y + A[i];\n  }\n  y = y + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1 || b == 2) {\n      printf(\"%d\", y);\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else {\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19284", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, number;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1)\n    number = day;\n  else if (month == 2)\n    number = 31 + day;\n  else {\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      if (month == 3)\n        number = 60 + day;\n      else if (month == 4)\n        number = 91 + day;\n      else if (month == 5)\n        number = day + 121;\n      else if (month == 6)\n        number = day + 152;\n      else if (month == 7)\n        number = day + 182;\n      else if (month == 8)\n        number = day + 213;\n      else if (month == 9)\n        number = day + 244;\n      else if (month == 10)\n        number = day + 274;\n      else if (month == 11)\n        number = day + 305;\n      else if (month == 12)\n        number = day + 335;\n    } else {\n      if (month == 3)\n        number = 59 + day;\n      else if (month == 4)\n        number = 90 + day;\n      else if (month == 5)\n        number = day + 120;\n      else if (month == 6)\n        number = day + 151;\n      else if (month == 7)\n        number = day + 181;\n      else if (month == 8)\n        number = day + 212;\n      else if (month == 9)\n        number = day + 243;\n      else if (month == 10)\n        number = day + 273;\n      else if (month == 11)\n        number = day + 304;\n      else if (month == 12)\n        number = day + 334;\n    }\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "19285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint l(int a) {\n  int i, j, k;\n  i = a % 4;\n  j = a % 100;\n  k = a % 400;\n  if (i == 0) {\n    if (j != 0 || k == 0)\n      return 1;\n    else\n      return 0;\n  } else\n    return 0;\n}\nint main() {\n  int a[3], i, j, k = 0;\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int c[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int d[12];\n  cin >> a[0] >> a[1] >> a[2];\n  i = a[0];\n  if (l(i) == 1) {\n    for (j = 0; j < 12; j++)\n      d[j] = c[j];\n  } else {\n    for (j = 0; j < 12; j++)\n      d[j] = b[j];\n  }\n  for (i = 0; i < a[1]; i++)\n    k = d[i] + k;\n  k = k + a[2];\n  cout << k << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19286", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  cin >> year >> month >> day;\n  total = 0;\n  for (i = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    sum = d;\n  if (m == 2)\n    sum = 31 + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m == 3)\n      sum = 31 + 29 + d;\n    if (m == 4)\n      sum = 31 + 29 + 31 + d;\n    if (m == 5)\n      sum = 31 + 29 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 29 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  } else {\n    if (m == 3)\n      sum = 31 + 28 + d;\n    if (m == 4)\n      sum = 31 + 28 + 31 + d;\n    if (m == 5)\n      sum = 31 + 28 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 28 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19288", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, mon, day;\n  cin >> year >> mon >> day;\n\n  int re;\n  if ((year % 4 == 0 && year % 400 == 0 && year % 100 == 0) ||\n      (year % 4 == 0 && year % 100 != 0)) {\n\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 29 + day;\n      break;\n    case 4:\n      re = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else\n\n  {\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 28 + day;\n      break;\n    case 4:\n      re = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "11", "index": "19289", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, sum;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if (b == 2) {\n    sum = 31 + c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0) {\n    if (b == 3) {\n      sum = 60 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 91 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 121 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 152 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 182 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 213 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 244 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 274 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 305 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 335 + c;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 3) {\n      sum = 59 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 90 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 120 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 151 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 181 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 212 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 243 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 273 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 304 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 334 + c;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    days = days + d[i - 1];\n  }\n  days = days + day;\n  if ((year % 4 == 0 || year % 400 == 0) && month > 2)\n    days = days++;\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "19291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], sum[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < 5; i++) {\n    switch (b[i]) {\n    case 1:\n      sum[i] = 0;\n      break;\n    case 2:\n      sum[i] = 31;\n      break;\n    case 3:\n      sum[i] = 59;\n      break;\n    case 4:\n      sum[i] = 90;\n      break;\n    case 5:\n      sum[i] = 120;\n      break;\n    case 6:\n      sum[i] = 151;\n      break;\n    case 7:\n      sum[i] = 181;\n      break;\n    case 8:\n      sum[i] = 212;\n      break;\n    case 9:\n      sum[i] = 243;\n      break;\n    case 10:\n      sum[i] = 273;\n      break;\n    case 11:\n      sum[i] = 304;\n      break;\n    case 12:\n      sum[i] = 334;\n      break;\n    }\n    sum[i] = sum[i] + c[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) && b[i] > 2)\n      sum[i] = sum[i] + 1;\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "19292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A, B, C, d, z, leap, i;\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d \", &A, &B, &C);\n    if (A % 4 == 0) {\n      if (A % 100 == 0) {\n        if (A % 400 == 0)\n          leap = 1;\n        else\n          leap = 0;\n      } else\n        leap = 1;\n    } else\n      leap = 0;\n    if (leap) {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      z = d + C;\n    } else {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      z = d + C;\n    }\n    cout << z << \"\\n\";\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(int year) {\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, date = 0;\n  cin >> year;\n  cin >> month;\n  cin >> day;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int i;\n  for (i = 1; i < month; i++) {\n    date = date + m[i];\n    if (i == 2) {\n      date = date + check(year);\n    }\n  }\n  date = date + day;\n\n  cout << date << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a >> b >> c;\n  d = 0;\n  int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    for (e = 0; e < b; e++) {\n      d = d + days1[e];\n    }\n    d = d + c;\n  } else {\n    for (e = 0; e < b; e++) {\n      d = d + days2[e];\n    }\n    d = d + c;\n  }\n  d = d - 1;\n  cout << d;\n}\n"}
{"label": "11", "index": "19295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, n;\n  int m = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        n = 29;\n      else\n        n = 28;\n    else\n      n = 29;\n  else\n    n = 28;\n  if (month == 1) {\n    printf(\"%d\", day);\n    return 0;\n  }\n  if (month == 2) {\n    m = 31 + day;\n    cout << m;\n    return 0;\n  }\n  if (month == 3) {\n    m = 31 + n + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 4) {\n    m = 31 + n + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 5) {\n    m = 31 + n + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 6) {\n    m = 31 + n + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 7) {\n    m = 31 + n + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 8) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 9) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 10) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 11) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 12) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month,\n      monthd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day,\n      di = 0, i;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    di = di + monthd[i - 1];\n  }\n  di = di + day;\n  if ((year % 4) != 0 || (year % 400) != 0) {\n    printf(\"%d\\n\", di);\n  } else\n    printf(\"%d\", di + 1);\n  return 0;\n}\n"}
{"label": "11", "index": "19297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 59 + c;\n    else if (b < 5)\n      n = 90 + c;\n    else if (b < 6)\n      n = 120 + c;\n    else if (b < 7)\n      n = 151 + c;\n    else if (b < 8)\n      n = 181 + c;\n    else if (b < 9)\n      n = 212 + c;\n    else if (b < 10)\n      n = 243 + c;\n    else if (b < 11)\n      n = 273 + c;\n    else if (b < 12)\n      n = 304 + c;\n    else\n      n = 334 + c;\n  } else {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 60 + c;\n    else if (b < 5)\n      n = 91 + c;\n    else if (b < 6)\n      n = 121 + c;\n    else if (b < 7)\n      n = 152 + c;\n    else if (b < 8)\n      n = 182 + c;\n    else if (b < 9)\n      n = 213 + c;\n    else if (b < 10)\n      n = 244 + c;\n    else if (b < 11)\n      n = 274 + c;\n    else if (b < 12)\n      n = 305 + c;\n    else\n      n = 335 + c;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  result = (month - 1) * 30 + day;\n  if (month == 1) {\n    printf(\"%d\", result);\n  } else {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8)\n      result = result + 3;\n\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      printf(\"%d\", result);\n    } else {\n      printf(\"%d\", result - 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  int leap = 0;\n  int day = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    leap = 1;\n  b--;\n  while (b) {\n    if (b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {\n      b--;\n      day += 31;\n    }\n    if (b == 2) {\n      b--;\n      day += 28 + leap;\n    }\n    if (b == 4 || b == 6 || b == 9 || b == 11) {\n      b--;\n      day += 30;\n    }\n  }\n  day += c;\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "19300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (((y + 400) % 400 == 0) || ((y % 4 == 0) && ((y % 100) != 0))) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 60 + d;\n    else if (m == 4)\n      n = 91 + d;\n    else if (m == 5)\n      n = 121 + d;\n    else if (m == 6)\n      n = 152 + d;\n    else if (m == 7)\n      n = 182 + d;\n    else if (m == 8)\n      n = 213 + d;\n    else if (m == 9)\n      n = 244 + d;\n    else if (m == 10)\n      n = 274 + d;\n    else if (m == 11)\n      n = 305 + d;\n    else if (m == 12)\n      n = 335 + d;\n    printf(\"%d\\n\", n);\n  } else {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 59 + d;\n    else if (m == 4)\n      n = 90 + d;\n    else if (m == 5)\n      n = 120 + d;\n    else if (m == 6)\n      n = 151 + d;\n    else if (m == 7)\n      n = 181 + d;\n    else if (m == 8)\n      n = 212 + d;\n    else if (m == 9)\n      n = 243 + d;\n    else if (m == 10)\n      n = 273 + d;\n    else if (m == 11)\n      n = 304 + d;\n    else if (m == 12)\n      n = 334 + d;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, day, tot = 0, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d %d %d\", &y, &m, &day);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    a[1]++;\n  for (i = 0; i < m - 1; i++)\n    tot += a[i];\n  tot += day;\n  printf(\"%d \", tot);\n  return 0;\n}\n"}
{"label": "11", "index": "19302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[13], X, B;\n  int N;\n  scanf(\"%d %d %d \", &N, &X, &B);\n  if (N % 100)\n    if (N % 4 == 0)\n      A[2] = 29;\n    else\n      A[2] = 28;\n  else if (N % 400 == 0) {\n    A[2] = 29;\n  } else\n    A[2] = 28;\n  A[1] = A[3] = A[5] = A[7] = A[8] = A[10] = A[11] = 31;\n  A[4] = A[6] = A[9] = A[11] = 30;\n  int Ans = B;\n  for (int I = 1; I < X; I++)\n    Ans += A[I];\n  cout << Ans << endl;\n}\n"}
{"label": "11", "index": "19303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 60;\n      break;\n    case 4:\n      day = day + 91;\n      break;\n    case 5:\n      day = day + 121;\n      break;\n    case 6:\n      day = day + 152;\n      break;\n    case 7:\n      day = day + 182;\n      break;\n    case 8:\n      day = day + 213;\n      break;\n    case 9:\n      day = day + 244;\n      break;\n    case 10:\n      day = day + 274;\n      break;\n    case 11:\n      day = day + 305;\n      break;\n    case 12:\n      day = day + 335;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 59;\n      break;\n    case 4:\n      day = day + 90;\n      break;\n    case 5:\n      day = day + 120;\n      break;\n    case 6:\n      day = day + 151;\n      break;\n    case 7:\n      day = day + 181;\n      break;\n    case 8:\n      day = day + 212;\n      break;\n    case 9:\n      day = day + 243;\n      break;\n    case 10:\n      day = day + 273;\n      break;\n    case 11:\n      day = day + 304;\n      break;\n    case 12:\n      day = day + 334;\n      break;\n    }\n  }\n  printf(\"%d\", day);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int z = 1;\n  while (z <= 5) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    int n = 0;\n    int i;\n    for (i = 1; i < month; i++) {\n      n = n + days[i];\n    }\n    n = n + day;\n    if (month > 2 && isleapyear(year))\n      n++;\n    printf(\"%d\\n\", n);\n    z++;\n  }\n}\n"}
{"label": "11", "index": "19305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int days = 0;\n  int i;\n  if (y % 4 == 0) {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  }\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12], b[100000], c, d, e, i, s, t = 0;\n  scanf(\"%d %d %d \", &c, &d, &e);\n  if (c % 4 != 0 || (c % 100 == 0 && c % 400 != 0)) {\n    a[0] = 31;\n    a[1] = 28;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  } else {\n    a[0] = 31;\n    a[1] = 29;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[6], month[6], day[6], s[6] = {0};\n  int i = 1, n;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  n = 1;\n  while (n <= 5) {\n    cin >> year[n] >> month[n] >> day[n];\n    if ((year[n] % 4 == 0 && year[n] % 100 != 0) || year[n] % 400 == 0)\n      m[2] = 29;\n    else\n      m[2] = 28;\n    while (i < month[n]) {\n      s[n] = s[n] + m[i];\n      i = i + 1;\n    }\n    s[n] = s[n] + day[n];\n    n = n + 1;\n    i = 1;\n  }\n  for (n = 1; n <= 5; n = n + 1)\n    printf(\"%d\\n\", s[n]);\n  return 0;\n}\n"}
{"label": "11", "index": "19308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int day = 0;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++) {\n      day += a[i];\n    }\n    day += date;\n  } else {\n    int b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++)\n      day += b[i];\n    day += date;\n  }\n  cout << day << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19309", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 400 == 0) || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n\n  int t = 0;\n  int aa[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  for (int i = 0; i < b - 1; i++) {\n    t = t + aa[i];\n  }\n  if (b > 2) {\n    if ((a % 4 == 0) && ((a % 100) != 0) || (a % 400 == 0)) {\n      t = t + 29;\n    } else {\n      t = t + 28;\n    }\n  }\n  t = t + c;\n  cout << t;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint map_1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint main() {\n  int year, month, day;\n  int i, sum = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    map_1[2] = 29;\n  if (month == 1)\n    sum = day;\n  else {\n    for (i = 1; i < month; i++)\n      sum = sum + map_1[i];\n    sum = sum + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  sum = 0;\n  for (i = 1; i < m; i++)\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10))\n      sum = sum + 31;\n    else if (i == 2)\n      if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n        sum = sum + 29;\n      } else\n        sum = sum + 28;\n    else\n      sum = sum + 30;\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19313", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d;\n  int i = 0, num = 0;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && (y % 100 != 0 || (y % 400 == 0))) {\n\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num += d;\n  } else {\n\n    int a[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num = num + d;\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, all;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 29 + 31;\n    }\n    if (month == 4) {\n      all = day + 29 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 29 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 28 + 31;\n    }\n    if (month == 4) {\n      all = day + 28 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 28 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  printf(\"%d\", all);\n}\n"}
{"label": "11", "index": "19315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int y, m, d, s, er;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 400 == 0) {\n    er = 29;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      cout << s << \"\\n\";\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  } else {\n    er = 28;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int q1, q2, q3, k = 0;\n  scanf(\"%d %d %d\", &q1, &q2, &q3);\n  if ((q1 % 4 == 0 && q1 & 100 != 0) || q1 % 400 == 0)\n    k++;\n  int a[15], b[16];\n  if (k == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  b[1] = 0;\n  for (int i = 2; i <= 12; i++)\n    b[i] = b[i - 1] + a[i - 1];\n  printf(\"%d\", b[q2] + q3);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b, c, d, i;\n  scanf(\"%d %d %d\", &b, &c, &d);\n  if ((b % 4 == 0 && b % 100 != 0) || (b % 100 == 0 && b % 400 == 0)) {\n    a[2] = 29;\n  }\n  for (i = 1; i < c; i++) {\n    d = d + a[i];\n  }\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "19318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  int dayofmonth1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      dayofmonth2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth1[i];\n    }\n    n = n + day;\n    cout << n;\n  } else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth2[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19319", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, num = 0;\n  int Ping[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> year;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    ;\n  } else {\n    Ping[2]++;\n  }\n  cin >> month >> day;\n  for (int i = 0; i < month; i++) {\n    num += Ping[i];\n  }\n  cout << num + day << endl;\n}\n"}
{"label": "11", "index": "19320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, a, all, m1[5], m2[5], m3[5], i;\n  for (i = 0; i <= 4; i++)\n    cin >> m1[i] >> m2[i] >> m3[i];\n  for (i = 0; i <= 4; i++) {\n    year = m1[i];\n    month = m2[i];\n    day = m3[i];\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 1:\n        a = 366;\n        break;\n      case 2:\n        a = 335;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 366 - a + day;\n\n    } else {\n      switch (month) {\n      case 1:\n        a = 365;\n        break;\n      case 2:\n        a = 334;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 365 - a + day;\n    }\n    cout << all << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k = 0;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + b[i];\n    }\n    k = k + d;\n    printf(\"%d\", k);\n  }\n  k = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + a[i];\n    }\n    k = k + d;\n    printf(\"%d\", k);\n  }\n}\n"}
{"label": "11", "index": "19322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct date {\n    int year;\n    int month;\n    int day;\n    int days;\n  } date1;\n  scanf(\"%d %d %d\", &date1.year, &date1.month, &date1.day);\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  date1.days = 0;\n  int i;\n  if (date1.month > 1) {\n    for (i = 0; i <= date1.month - 2; i++) {\n      date1.days = date1.days + b[i];\n    }\n    date1.days = date1.days + date1.day;\n  } else\n    date1.days = date1.day;\n\n  printf(\"%d\", date1.days);\n}\n"}
{"label": "11", "index": "19323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint month[2][12] = {31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31,\n                    31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\nint main() {\n  int year, monthq, day;\n  cin >> year >> monthq >> day;\n  int ans = 0;\n  for (int i = 1; i < monthq; i++) {\n    int xx;\n    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n      xx = 1;\n    else\n      xx = 0;\n    ans += month[xx][i - 1];\n  }\n  ans += day;\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19324", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59);\n    else if (month == 4)\n      printf(\"%d\", day + 90);\n    else if (month == 5)\n      printf(\"%d\", day + 120);\n    else if (month == 6)\n      printf(\"%d\", day + 151);\n    else if (month == 7)\n      printf(\"%d\", day + 181);\n    else if (month == 8)\n      printf(\"%d\", day + 212);\n    else if (month == 9)\n      printf(\"%d\", day + 242);\n    else if (month == 10)\n      printf(\"%d\", day + 273);\n    else if (month == 11)\n      printf(\"%d\", day + 304);\n    else if (month == 12)\n      printf(\"%d\", day + 334);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59 + 1);\n    else if (month == 4)\n      printf(\"%d\", day + 90 + 1);\n    else if (month == 5)\n      printf(\"%d\", day + 120 + 1);\n    else if (month == 6)\n      printf(\"%d\", day + 151 + 1);\n    else if (month == 7)\n      printf(\"%d\", day + 182);\n    else if (month == 8)\n      printf(\"%d\", day + 213);\n    else if (month == 9)\n      printf(\"%d\", day + 243);\n    else if (month == 10)\n      printf(\"%d\", day + 274);\n    else if (month == 11)\n      printf(\"%d\", day + 305);\n    else if (month == 12)\n      printf(\"%d\", day + 335);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  unsigned long int year, month, day, b[30][3];\n  int a, c, d, i;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    b[i][0] = year;\n    b[i][1] = month;\n    b[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = b[i][0];\n    month = b[i][1];\n    day = b[i][2];\n    a = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n    if (a == 1) {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 29;\n        break;\n      case 4:\n        c = 31 + 29 + 31;\n        break;\n      case 5:\n        c = 31 + 29 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 29 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n\n    } else {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 28;\n        break;\n      case 4:\n        c = 31 + 28 + 31;\n        break;\n      case 5:\n        c = 31 + 28 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 28 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    d = c + day;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, l = 0;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) \n  {\n    if (m == 1)\n      cout << d;\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += a[i];\n      }\n      cout << l + d;\n    }\n  } else {\n    if (m == 1)\n      cout << d;\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += b[i];\n      }\n      cout << l + d;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int dmonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i = 0;\n  int sum = 0;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + dmonth[i];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month >= 3) {\n      sum = sum + day + 1;\n    }\n  } else\n    sum = sum + day;\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum;\n  int a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  sum = 0;\n  for (i = 0; i < m; i++)\n    sum = sum + a[i];\n  sum = sum - a[i - 1] + d;\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int aaa[5][3];\n  int year, mon, day, i, n, m;\n  int month[12];\n  month[0] = 31, month[1] = 28, month[2] = 31, month[3] = 30, month[4] = 31,\n  month[5] = 30, month[6] = 31, month[7] = 31, month[8] = 30, month[9] = 31,\n  month[10] = 30, month[11] = 31;\n\n  for (i = 0; i < 5; i++) {\n    cin >> year >> mon >> day;\n    aaa[i][0] = year;\n    aaa[i][1] = mon;\n    aaa[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = aaa[i][0];\n    mon = aaa[i][1];\n    day = aaa[i][2];\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n      month[1] = 29;\n    else\n      month[1] = 28;\n    n = 0;\n    for (m = 0; m < (mon - 1); m++) {\n      n = n + month[m];\n    }\n    n = n + day;\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "11", "index": "19330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[10], mon[10], date[10], day[12], i, j, sum[10];\n  for (i = 0; i <= 4; i++)\n    cin >> year[i] >> mon[i] >> date[i];\n  for (i = 0; i <= 4; i++) {\n    sum[i] = 0;\n    day[0] = 31;\n    if (((year[i] % 4 == 0) && (year[i] % 100 != 0)) || (year[i] % 400 == 0))\n      day[1] = 29;\n    else\n      day[1] = 28;\n    day[2] = 31;\n    day[3] = 30;\n    day[4] = 31;\n    day[5] = 30;\n    day[6] = 31;\n    day[7] = 31;\n    day[8] = 30;\n    day[9] = 31;\n    day[10] = 30;\n    day[11] = 31;\n    for (j = 0; j <= mon[i] - 2; j++)\n      sum[i] = sum[i] + day[j];\n    sum[i] = sum[i] + date[i];\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19331", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  cin >> year >> month >> day;\n  result = (month - 1) * 30 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8) {\n      result = result + 3;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n  } else {\n    if (month == 2) {\n      result = result + 1;\n    }\n    if (month == 3) {\n      result = result - 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 1;\n    }\n    if (month == 8) {\n      result = result + 2;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 3;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 4;\n    }\n  }\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, day = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 && y % 400 == 0)\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 29;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  else\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 28;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "19333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n) {\n  int sum;\n  switch (n) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = (31 + 28);\n    break;\n  case 4:\n    sum = (31 + 28 + 31);\n    break;\n  case 5:\n    sum = (31 * 2 + 28 + 30);\n    break;\n  case 6:\n    sum = (31 * 3 + 28 + 30);\n    break;\n  case 7:\n    sum = (31 * 3 + 28 + 30 * 2);\n    break;\n  case 8:\n    sum = (31 * 4 + 28 + 30 * 2);\n    break;\n  case 9:\n    sum = (31 * 5 + 28 + 30 * 2);\n    break;\n  case 10:\n    sum = (31 * 5 + 28 + 30 * 3);\n    break;\n  case 11:\n    sum = (31 * 6 + 28 + 30 * 3);\n    break;\n  case 12:\n    sum = (31 * 6 + 28 + 30 * 4);\n  }\n  return (sum);\n}\nint main() {\n  int month[5], day[5], year[5], d[5], i;\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  for (i = 0; i <= 4; i++) {\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0) &&\n        month[i] > 2)\n      d[i] = f(month[i]) + day[i] + 1;\n    else\n      d[i] = f(month[i]) + day[i];\n    cout << d[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int a[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if ((year % 4 != 0) || ((year % 100 == 0) && (year % 400 != 0)))\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(char *argv[]) {\n  int a, b, c, x = 0, i;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    } else if (i == 2) {\n      x = x + 28;\n    } else\n      x = x + 30;\n  }\n  if (((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0)) && (b > 2)) {\n    x = x + 1;\n  }\n  x = x + c;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int monthday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  for (int i = 1; i < month; i++) {\n    sum += monthday[i - 1];\n  }\n  sum += day;\n  if (month > 2 && (!year % 4 == 0 && year % 100 != 0 || year % 400 != 0)) {\n    sum -= 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, y = 0, days, w;\n  scanf(\"%d%d%d\", &year, &month, &days);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      day = 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      day = 30;\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        day = 29;\n      else\n        day = 28;\n    }\n    y = y + day;\n  }\n  w = y + days;\n  printf(\"%d\\n\", w);\n  return 0;\n}\n"}
{"label": "11", "index": "19338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, which;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  which = day;\n  month--;\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    if (year % 4 != 0)\n      which += 28;\n    else if (year % 100 == 0 && year % 400 != 0)\n      which += 28;\n    else\n      which += 29;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  cout << which;\n  return 0;\n}\n"}
{"label": "11", "index": "19339", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int leap, year, month, day, sum = 0;\n  int a[2][12] = {{\n                      31,\n                      28,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                  },\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  leap = ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0));\n  for (int i = 0; i < month - 1; i++)\n    sum = sum + a[leap][i];\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  cin >> year >> mon >> day;\n  if (mon == 1)\n    a = day;\n  else if (mon == 2)\n    a = 31 + day;\n  else if (mon == 3)\n    a = 59 + day;\n  else if (mon == 4)\n    a = 90 + day;\n  else if (mon == 5)\n    a = 120 + day;\n  else if (mon == 6)\n    a = 151 + day;\n  else if (mon == 7)\n    a = 181 + day;\n  else if (mon == 8)\n    a = 212 + day;\n  else if (mon == 9)\n    a = 243 + day;\n  else if (mon == 10)\n    a = 273 + day;\n  else if (mon == 11)\n    a = 304 + day;\n  else\n    a = 334 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (mon >= 3)\n      a = a + 1;\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, date,\n      count = 0, day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> date;\n  for (i = 1; i < month; i++)\n    count += day[i];\n  count += date;\n  if (month > 2)\n    if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)))\n      count++;\n  cout << count;\n  return 0;\n}\n"}
{"label": "11", "index": "19342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    d[1]++;\n  }\n  int g = c;\n  int i = 0;\n  while (i >= b)\n    d[i]++;\n\n  for (i = 0; i < b - 1; i++) {\n    g = g + d[i];\n  }\n  cout << g;\n  return 0;\n}\n"}
{"label": "11", "index": "19343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n\n  int t = 0;\n  int aa[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b - 1; i++) {\n    t = t + aa[i];\n  }\n  if (b > 2) {\n    if ((a % 4 == 0) && ((a % 100) != 0) || (a % 400 == 0)) {\n      t = t + 29;\n    } else {\n      t = t + 28;\n    }\n  }\n  t = t + c;\n  cout << t;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1) {\n    a = day;\n  } else if (mon == 2)\n    a = 31 + day;\n  else if (mon > 2) {\n    if (mon == 3) {\n      a = 31 + 29 + day;\n    } else if (mon == 4) {\n      a = 31 + 29 + 31 + day;\n    } else if (mon == 5) {\n      a = 31 + 29 + 31 + 30 + day;\n    } else if (mon == 6) {\n      a = 31 + 29 + 31 + 30 + 31 + day;\n    } else if (mon == 7) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    } else if (mon == 8) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    } else if (mon == 9) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    } else if (mon == 10) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    } else if (mon == 11) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    } else if (mon == 12) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n    if (year % 400 == 0 || year % 100 != 0 && year % 4 == 0)\n      a = a;\n    else\n      a = a - 1;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "19345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d = c + 31;\n  int e = c + 60;\n  int f = c + 91;\n  int g = c + 121;\n  int h = c + 152;\n  int i = c + 182;\n  int j = c + 213;\n  int k = c + 244;\n  int l = c + 274;\n  int m = c + 305;\n  int n = c + 335;\n  int o = c + 59;\n  int p = c + 90;\n  int q = c + 120;\n  int r = c + 151;\n  int s = c + 181;\n  int t = c + 212;\n  int u = c + 243;\n  int v = c + 273;\n  int w = c + 304;\n  int x = c + 334;\n  if (b == 1)\n    printf(\"%d\\n\", c);\n  else if (b == 2)\n    printf(\"%d\\n\", d);\n  if (b > 2 && ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", e);\n    else if (b == 4)\n      printf(\"%d\\n\", f);\n    else if (b == 5)\n      printf(\"%d\\n\", g);\n    else if (b == 6)\n      printf(\"%d\\n\", h);\n    else if (b == 7)\n      printf(\"%d\\n\", i);\n    else if (b == 8)\n      printf(\"%d\\n\", j);\n    else if (b == 9)\n      printf(\"%d\\n\", k);\n    else if (b == 10)\n      printf(\"%d\\n\", l);\n    else if (b == 11)\n      printf(\"%d\\n\", m);\n    else if (b == 12)\n      printf(\"%d\\n\", n);\n  } else if (b > 2 && ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", o);\n    else if (b == 4)\n      printf(\"%d\\n\", p);\n    else if (b == 5)\n      printf(\"%d\\n\", q);\n    else if (b == 6)\n      printf(\"%d\\n\", r);\n    else if (b == 7)\n      printf(\"%d\\n\", s);\n    else if (b == 8)\n      printf(\"%d\\n\", t);\n    else if (b == 9)\n      printf(\"%d\\n\", u);\n    else if (b == 10)\n      printf(\"%d\\n\", v);\n    else if (b == 11)\n      printf(\"%d\\n\", w);\n    else if (b == 12)\n      printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 400 == 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 == 0 && y % 400 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19347", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, sum = 0, months[50], msum = 0;\n\n  months[1] = 31;\n  months[2];\n  months[3] = 31;\n  months[4] = 30;\n  months[5] = 31;\n  months[6] = 30;\n  months[7] = 31;\n  months[8] = 31;\n  months[9] = 30;\n  months[10] = 31;\n  months[11] = 30;\n  months[12] = 31;\n\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 != 0) {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    } else {\n      if (year % 400 == 0)\n        months[2] = 29;\n      else {\n        months[2] = 28;\n      }\n    }\n  } else {\n    months[2] = 28;\n  }\n  for (i = 1; i < month; i++) {\n    msum = msum + months[i];\n  }\n  sum = msum + day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19348", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, answer;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 29 + day;\n      break;\n    case 4:\n      answer = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  } else {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 28 + day;\n      break;\n    case 4:\n      answer = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19349", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, n, i, t = 0;\n  cin >> year >> month >> day;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < month; i++) {\n    t = t + a[i];\n  }\n  if (month >= 3)\n    if (year % 4 == 0)\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          n = t + 1 + day;\n        else\n          n = t + day;\n      } else\n        n = t + 1 + day;\n    else\n      n = t + day;\n  else\n    n = t + day;\n\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    }\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19351", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int y, int m, int d) {\n  int a[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, c;\n  c = 0;\n  for (i = 0; i < m; i++)\n    c = c + a[i];\n  c = c + d;\n  if ((m > 2) && (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)))\n    c++;\n  return c;\n}\n\nint main() {\n  int i, a, b, c;\n  for (i = 0; i < 100; i++)\n    if (cin >> a >> b >> c)\n      printf(\"%d\\n\", fun(a, b, c));\n  return 0;\n}\n"}
{"label": "11", "index": "19352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 != 0) || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, D;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60;\n      break;\n    case 4:\n      D = c + 91;\n      break;\n    case 5:\n      D = c + 121;\n      break;\n    case 6:\n      D = c + 152;\n      break;\n    case 7:\n      D = c + 182;\n      break;\n    case 8:\n      D = c + 213;\n      break;\n    case 9:\n      D = c + 244;\n      break;\n    case 10:\n      D = c + 274;\n      break;\n    case 11:\n      D = c + 305;\n      break;\n    case 12:\n      D = c + 335;\n      break;\n    }\n    cout << D;\n\n  } else {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60 - 1;\n      break;\n    case 4:\n      D = c + 91 - 1;\n      break;\n    case 5:\n      D = c + 121 - 1;\n      break;\n    case 6:\n      D = c + 152 - 1;\n      break;\n    case 7:\n      D = c + 182 - 1;\n      break;\n    case 8:\n      D = c + 213 - 1;\n      break;\n    case 9:\n      D = c + 244 - 1;\n      break;\n    case 10:\n      D = c + 274 - 1;\n      break;\n    case 11:\n      D = c + 305 - 1;\n      break;\n    case 12:\n      D = c + 335 - 1;\n      break;\n    }\n\n    cout << D;\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint panduan(int(year));\nint main() {\n  int sum = 0, year, month, day;\n  int i;\n  int Month1[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Month2[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (panduan(year) == 1) {\n    for (i = 1; i < month; i++)\n      sum += Month1[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += Month2[i];\n    sum += day;\n    printf(\"%d\", sum);\n    return 0;\n  }\n  return 0;\n}\nint panduan(int year) {\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, all;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 29 + 31;\n    }\n    if (month == 4) {\n      all = day + 29 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 29 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 1) {\n      all = day;\n    }\n    if (month == 2) {\n      all = day + 31;\n    }\n    if (month == 3) {\n      all = day + 28 + 31;\n    }\n    if (month == 4) {\n      all = day + 28 + 31 + 31;\n    }\n    if (month == 5) {\n      all = day + 28 + 31 + 31 + 30;\n    }\n    if (month == 6) {\n      all = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      all = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  printf(\"%d\", all);\n  return 0;\n}\n"}
{"label": "11", "index": "19356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n, p, a;\n  cin >> m >> n >> p;\n  if (m % 4 != 0 || (m % 100 == 0 && m % 400 != 0)) {\n    if (n == 1) {\n      a = p;\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n    } else if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 2 + p;\n\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 29 + p;\n    }\n\n  } else {\n    if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 + p;\n    } else if (n == 1)\n      a = p;\n    else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 30 + p;\n    }\n  }\n\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "19357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, res = 0, i;\n  int y[12];\n  cin >> year >> month >> day;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    y[1] = 29;\n  else\n    y[1] = 28;\n  y[0] = 31;\n  y[2] = 31;\n  y[4] = 31;\n  y[7] = 31;\n  y[6] = 31;\n  y[9] = 31;\n  y[3] = 30;\n  y[5] = 30;\n  y[8] = 30;\n  y[10] = 30;\n  for (i = 0; i < month - 1; i++)\n    res += y[i];\n  res += day;\n  printf(\"%d\", res);\n}\n"}
{"label": "11", "index": "19358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint nian(int m) {\n  if ((m % 400 == 0) || ((m % 100 != 0) && (m % 4 == 0)))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, s = 0, n, y, r, a[12];\n  scanf(\"%d%d%d\", &n, &y, &r);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (nian(n))\n    a[1] = 29;\n  else {\n    a[1] = 28;\n  }\n  for (i = 0; i < y - 1; i++)\n    s += a[i];\n  s += r;\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "19359", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, day, num = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    a[2]++;\n  for (int i = 1; i < month; i++)\n    num += a[i];\n  num += day;\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19360", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, x;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 29 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 29 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  } else\n\n  {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 28 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 28 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  }\n}\n"}
{"label": "11", "index": "19361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, sum = 0;\n  cin >> a >> b >> c;\n  if (b == 1)\n    sum = 0;\n  else if (b == 2)\n    sum = 31;\n  else {\n    sum = 31;\n    if ((a % 400 == 0) || (a % 4 == 0 && a % 100 != 0))\n      sum = sum + 29;\n    else {\n      sum = sum + 28;\n    }\n    for (i = 3; i < b; i++) {\n      if (i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        sum = sum + 31;\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        sum = sum + 30;\n    }\n  }\n  sum = sum + c;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19362", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, flag;\n  int daytal, tal;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0 || (year % 4 == 0) && (year % 100 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  switch (month) {\n  case 1:\n    daytal = 0;\n    break;\n  case 2:\n    daytal = 31;\n    break;\n  case 3:\n    daytal = 60;\n    break;\n  case 4:\n    daytal = 91;\n    break;\n  case 5:\n    daytal = 121;\n    break;\n  case 6:\n    daytal = 152;\n    break;\n  case 7:\n    daytal = 182;\n    break;\n  case 8:\n    daytal = 213;\n    break;\n  case 9:\n    daytal = 244;\n    break;\n  case 10:\n    daytal = 274;\n    break;\n  case 11:\n    daytal = 305;\n    break;\n  case 12:\n    daytal = 335;\n    break;\n  }\n  if (month < 2)\n    flag = 0;\n  tal = daytal + day - flag;\n  cout << tal << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n    days[2]++;\n\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "19364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 29);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 29 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 31 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 28);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 28 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 30 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 30);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 29);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 30);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 29);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19365", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, n;\n  scanf(\"%d\", &y);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    scanf(\"%d%d\", &m, &d);\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 29 + d;\n    }\n    if (m == 4) {\n      n = 31 + 29 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 29 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 29 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n\n  } else {\n    cin >> m >> d;\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 28 + d;\n    }\n    if (m == 4) {\n      n = 31 + 28 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 28 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 28 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  int dayofmonth1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      dayofmonth2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth1[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  } else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth2[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, result = 0, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      result += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19368", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, d;\n  int month = 1, day = 1, lunar = 0, days = 1;\n  cin >> year >> mon >> d;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    lunar = 1;\n  while ((mon != month) || (d != day)) {\n    day++;\n    days++;\n    if ((day == 32) &&\n        ((month == 1) || (month == 3) || (month == 5) || (month == 7) ||\n         (month == 8) || (month == 10) || (month == 12))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 31) &&\n        ((month == 4) || (month == 6) || (month == 9) || (month == 11))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 30) && (month == 2) && (lunar == 1)) {\n      month++;\n      day = 1;\n    }\n    if ((day == 29) && (month == 2) && (lunar == 0)) {\n      month++;\n      day = 1;\n    }\n  }\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19369", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint days_of_month[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                            {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n\nint is_leap_year(int year) {\n  if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int index = is_leap_year(year);\n  int days = 0;\n  for (int i = 0; i < month - 1; i++)\n    days += days_of_month[index][i];\n  days += day;\n  printf(\"%d\", days);\n}\n"}
{"label": "11", "index": "19370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, m, n, t, i, s;\n  cin >> l >> m >> n;\n  if (l % 4 == 0 && l % 100 != 0)\n    t = 29;\n  if (l % 4 != 0)\n    t = 28;\n  if (l % 100 == 0 && l % 400 != 0)\n    t = 28;\n  if (l % 400 == 0)\n    t = 29;\n  int a[13] = {0, 31, t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (m == 1)\n    s = n;\n  else\n    s = n;\n  for (i = 1; i < m; i++) {\n    s = s + a[i];\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "19371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, sum;\n  int mon[1000];\n  mon[1] = mon[3] = mon[5] = mon[7] = mon[8] = mon[10] = mon[12] = 31;\n  mon[4] = mon[6] = mon[9] = mon[11] = 30;\n  sum = 0;\n\n  cin >> year >> month >> date;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    mon[2] = 29;\n  else {\n    mon[2] = 28;\n  }\n\n  int i;\n  for (i = 1; i < month; i++) {\n    sum += mon[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 100 == 0 && y % 400 == 0)\n    n[1] = 29;\n  if (y % 100 != 0 && y & 4 == 0)\n    n[1] = 29;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++)\n    sum = sum + n[i];\n  cout << sum + d << \"\\n\";\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, f, i, sum = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  if (year % 4 == 0 && year % 100 != 0)\n    f = 1;\n  else if (year % 400 == 0)\n    f = 1;\n  else\n    f = 0;\n  for (i = 1; i < mon; i++)\n    sum = sum + a[i - 1];\n\n  sum = sum + day;\n  if (f == 1 && mon > 2)\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, m;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 29 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 29 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 29 + 31 + 30 + 31 + c;\n      cout << m;\n    }\n    if (b == 7) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 28 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 28 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19375", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int month[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                          {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\nint main() {\n  int i, leap = 0, y, m, d, ans = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n    leap = 1;\n  for (i = 1; i < m; i++)\n    ans += month[leap][i];\n  ans += d;\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d, m, y, sum, leap;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    cout << \"data error\";\n    break;\n  }\n  sum = sum + d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && m > 2)\n    sum++;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s, i, l;\n  s = 0;\n  cin >> y >> m >> d;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n\n  s = s + d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        l = 1;\n      else\n        l = 0;\n    } else\n      l = 1;\n  } else\n    l = 0;\n  if (m > 2)\n    s = s + l;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f1(int n) {\n  int i, m;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 28;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint f2(int n) {\n  int m, i;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 29;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint main() {\n  int y, mon, d, a;\n  scanf(\"%d%d%d\", &y, &mon, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    a = f1(mon) + d;\n    printf(\"%d\", a);\n  } else {\n    a = f2(mon) + d;\n    printf(\"%d\", a);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, x;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 60 + c;\n\n    else if (b == 4)\n      x = 91 + c;\n\n    else if (b == 5)\n      x = 121 + c;\n\n    else if (b == 6)\n      x = 152 + c;\n\n    else if (b == 7)\n      x = 182 + c;\n\n    else if (b == 8)\n      x = 213 + c;\n\n    else if (b == 9)\n      x = 244 + c;\n\n    else if (b == 10)\n      x = 274 + c;\n\n    else if (b == 11)\n      x = 305 + c;\n\n    else if (b == 12)\n      x = 335 + c;\n\n  }\n\n  else {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 59 + c;\n\n    else if (b == 4)\n      x = 90 + c;\n\n    else if (b == 5)\n      x = 120 + c;\n\n    else if (b == 6)\n      x = 151 + c;\n\n    else if (b == 7)\n      x = 181 + c;\n\n    else if (b == 8)\n      x = 212 + c;\n\n    else if (b == 9)\n      x = 243 + c;\n\n    else if (b == 10)\n      x = 273 + c;\n    else if (b == 11)\n      x = 304 + c;\n\n    else if (b == 12)\n      x = 334 + c;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    int m[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    cout << k;\n  } else {\n    int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    cout << k;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, x, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n  x = 0;\n  for (i = 0; i < m - 1; i++)\n    x += a[i];\n  x += d;\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19383", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum;\n  int a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    a[1] = 29;\n  else {\n    a[1] = 28;\n  }\n  sum = 0;\n  for (i = 0; i < m; i++)\n    sum = sum + a[i];\n  sum = sum - a[i - 1] + d;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint l(int a) {\n  int i, j, k;\n  i = a % 4;\n  j = a % 100;\n  k = a % 400;\n  if (i == 0) {\n    if (j != 0 || k == 0)\n      return 1;\n    else\n      return 0;\n  } else\n    return 0;\n}\nint main() {\n  int a[3], i, j, k = 0;\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int c[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int d[12];\n  cin >> a[0] >> a[1] >> a[2];\n  i = a[0];\n  if (l(i) == 1) {\n    for (j = 0; j < 12; j++)\n      d[j] = c[j];\n  } else {\n    for (j = 0; j < 12; j++)\n      d[j] = b[j];\n  }\n  for (i = 0; i < a[1]; i++)\n    k = d[i] + k;\n  k = k + a[2];\n  cout << k << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, x, i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  if (a % 400 == 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  x = x + c;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19386", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, feb, i, m, n = 0, q;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    feb = 29;\n  } else\n    feb = 28;\n\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      m = 31;\n    } else if (i == 2)\n      m = feb;\n    else\n      m = 30;\n    n = n + m;\n  }\n  q = n + c;\n  printf(\"%d\", q);\n  return 0;\n}\n"}
{"label": "11", "index": "19387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, e;\n  int s[12];\n  int d = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    s[1] = 29;\n  else\n    s[1] = 28;\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  for (i = 1; i <= b; i++) {\n    d = d + s[i - 2];\n  }\n  e = d + c;\n  cout << e;\n  return 0;\n}\n"}
{"label": "11", "index": "19388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0, m = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    int M[13];\n    M[1] = M[3] = M[5] = M[7] = M[8] = M[10] = M[12] = 31;\n    M[4] = M[6] = M[9] = M[11] = 30;\n    M[2] = 29;\n    M[0] = 0;\n\n    for (i = 0; i < month; i++) {\n      m = m + M[i];\n    }\n    sum = m + day;\n  } else {\n    int N[13];\n    N[1] = N[3] = N[5] = N[7] = N[8] = N[10] = N[12] = 31;\n    N[4] = N[6] = N[9] = N[11] = 30;\n    N[2] = 28;\n    N[0] = 0;\n    for (i = 0; i < month; i++) {\n      m = m + N[i];\n    }\n    sum = m + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int y, m, d, s, er;\n  cin >> y >> m >> d;\n  if (y % 400 == 0) {\n    er = 29;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  } else {\n    er = 28;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0)\n    return 1;\n  if (n % 400 == 0)\n    return 1;\n  return 0;\n}\nint yue(int y, int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (run(y) == 1 && n == 2)\n    return 29;\n  if (run(y) == 0 && n == 2)\n    return 28;\n  return 30;\n}\nint days(int y, int m, int d) {\n  int k = 0;\n  for (int i = 1; i < m; i++)\n    k += yue(y, i);\n  k += d;\n  return k;\n}\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  cout << days(y, m, d);\n  return 0;\n}\n"}
{"label": "11", "index": "19391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isRN(int year) {\n  int result;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\nint main() {\n  int year, month, day;\n  int i;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else {\n      if (isRN(year) == 1)\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19392", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int A, B, C, a, b, c, d, e, f, g, h, i, j, k, l, m;\n  scanf(\"%d%d%d\", &A, &B, &C);\n  a = 31;\n  if ((A % 4 == 0 && A % 100 != 0) || A % 400 == 0)\n    b = 29;\n  else\n    b = 28;\n  c = 31;\n  d = 30;\n  e = 31;\n  f = 30;\n  g = 31;\n  h = 31;\n  i = 30;\n  j = 31;\n  k = 30;\n  l = 31;\n  if (B == 1)\n    m = C;\n  if (B == 2)\n    m = C + a;\n  if (B == 3)\n    m = C + a + b;\n  if (B == 4)\n    m = C + a + b + c;\n  if (B == 5)\n    m = C + a + b + c + d;\n  if (B == 6)\n    m = C + a + b + c + d + e;\n  if (B == 7)\n    m = C + a + b + c + d + e + f;\n  if (B == 8)\n    m = C + a + b + c + d + e + f + g;\n  if (B == 9)\n    m = C + a + b + c + d + e + f + g + h;\n  if (B == 10)\n    m = C + a + b + c + d + e + f + g + h + i;\n  if (B == 11)\n    m = C + a + b + c + d + e + f + g + h + i + j;\n  if (B == 12)\n    m = C + a + b + c + d + e + f + g + h + i + j + k;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "11", "index": "19393", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int yy, mm, dd, m = 0, days = 0;\n  cin >> yy >> mm >> dd;\n  do {\n    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)\n      days = days + 31;\n    else if (m == 4 || m == 6 || m == 9 || m == 11)\n      days = days + 30;\n    else if ((((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0)) && m == 2)\n      days = days + 29;\n    else if ((yy % 4 != 0 || yy % 100 == 0) && m == 2)\n      days = days + 28;\n    m++;\n  } while (m < mm);\n  days = days + dd;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  cin >> year >> month >> day;\n  result = (month - 1) * 30 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8) {\n      result = result + 3;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n  } else {\n    if (month == 2) {\n      result = result + 1;\n    }\n    if (month == 3) {\n      result = result - 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 1;\n    }\n    if (month == 8) {\n      result = result + 2;\n    }\n    if (month == 9 || month == 10)\n      result = result + 3;\n\n    if (month == 11 || month == 12) {\n      result = result + 4;\n    }\n  }\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "19395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[5], i = 1;\n  while (i <= 5) {\n    scanf(\"%d%d%d\", &y, &m, &d);\n    if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0) {\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 28;\n        break;\n      case 4:\n        a[i] = d + 62 + 28;\n        break;\n      case 5:\n        a[i] = d + 62 + 28 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 28;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 28;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 28;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 28;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 28;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 28;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 28;\n        break;\n      }\n    } else\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 29;\n        break;\n      case 4:\n        a[i] = d + 62 + 29;\n        break;\n      case 5:\n        a[i] = d + 62 + 29 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 29;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 29;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 29;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 29;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 29;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 29;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 29;\n        break;\n      }\n    i = i + 1;\n  }\n  printf(\"%d\\n%d\\n%d\\n%d\\n%d\\n%%\", a[1], a[2], a[3], a[4], a[5]);\n  return 0;\n}\n"}
{"label": "11", "index": "19396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, date, i = 1, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &date);\n\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        sum += 29;\n      } else {\n        sum += 28;\n      }\n    } else {\n      sum += 30;\n    }\n  }\n\n  sum += date;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int y) {\n  if ((y % 100 == 0) && (y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    return 1;\n  else\n    return 0;\n}\n\nint days(int y, int d, int r) {\n  int a[13] = {0, 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (leap(y)) {\n    a[3] = 29;\n  }\n  int ans = 0;\n  for (int i = 1; i <= d; i++)\n    ans += a[i];\n  return ans + r;\n}\nint main() {\n  int y, d, r;\n  cin >> y >> d >> r;\n  printf(\"%d\", days(y, d, r));\n  return 0;\n}\n"}
{"label": "11", "index": "19398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if ((y % 100 != 0 && y % 4 == 0) || (y % 400 == 0)) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 60 + d;\n      break;\n    case 4:\n      n = 91 + d;\n      break;\n    case 5:\n      n = 121 + d;\n      break;\n    case 6:\n      n = 152 + d;\n      break;\n    case 7:\n      n = 182 + d;\n      break;\n    case 8:\n      n = 213 + d;\n      break;\n    case 9:\n      n = 244 + d;\n      break;\n    case 10:\n      n = 274 + d;\n      break;\n    case 11:\n      n = 305 + d;\n      break;\n    default:\n      n = 335 + d;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 59 + d;\n      break;\n    case 4:\n      n = 90 + d;\n      break;\n    case 5:\n      n = 120 + d;\n      break;\n    case 6:\n      n = 151 + d;\n      break;\n    case 7:\n      n = 181 + d;\n      break;\n    case 8:\n      n = 212 + d;\n      break;\n    case 9:\n      n = 243 + d;\n      break;\n    case 10:\n      n = 273 + d;\n      break;\n    case 11:\n      n = 304 + d;\n      break;\n    default:\n      n = 334 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  int sum_day(int, int);\n  int leap(int year);\n  int year[5], month[5], day[5], days[5];\n  for (i = 0; i < 5; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  for (i = 0; i < 5; i++) {\n    days[i] = sum_day(month[i], day[i]);\n    if (leap(year[i]) && month[i] >= 3)\n      days[i] = days[i] + 1;\n    printf(\"%d\\n\", days[i]);\n  }\n}\nint sum_day(int month, int day) {\n  int day_tab[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 1; i < month; i++)\n    day += day_tab[i];\n  return (day);\n}\n\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\n"}
{"label": "11", "index": "19400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int N[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + N[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    sum = sum + 1;\n  sum = sum + day;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "19401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  cin >> a >> b >> c;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 59 + c;\n    else if (b == 4)\n      s = 90 + c;\n    else if (b == 5)\n      s = 120 + c;\n    else if (b == 6)\n      s = 151 + c;\n    else if (b == 7)\n      s = 181 + c;\n    else if (b == 8)\n      s = 212 + c;\n    else if (b == 9)\n      s = 243 + c;\n    else if (b == 10)\n      s = 273 + c;\n    else if (b == 11)\n      s = 304 + c;\n    else if (b == 12)\n      s = 334 + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 60 + c;\n    else if (b == 4)\n      s = 91 + c;\n    else if (b == 5)\n      s = 121 + c;\n    else if (b == 6)\n      s = 152 + c;\n    else if (b == 7)\n      s = 182 + c;\n    else if (b == 8)\n      s = 213 + c;\n    else if (b == 9)\n      s = 244 + c;\n    else if (b == 10)\n      s = 274 + c;\n    else if (b == 11)\n      s = 305 + c;\n    else if (b == 12)\n      s = 335 + c;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int total = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= month - 1; i++) {\n      total = total + a[i - 1];\n    }\n    total = total + day;\n\n  } else {\n    int b[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int j = 1; j <= month - 1; j++) {\n      total = total + b[j - 1];\n    }\n    total = total + day;\n  }\n  cout << total << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 29);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 29 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 28);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 28 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19404", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, n = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    n = n + monthday[i - 1];\n  }\n  n = n + day;\n\n  if (month > 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)) {\n    n = n + 1;\n  }\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int k = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    k = k + day;\n  else if (month == 2)\n    k = k + 31 + day;\n  else if (month == 3)\n    k = k + 31 + 28 + day;\n  else if (month == 4)\n    k = k + 31 + 28 + 31 + day;\n  else if (month == 5)\n    k = k + 31 + 28 + 31 + 30 + day;\n  else if (month == 6)\n    k = k + 31 + 28 + 31 + 30 + 31 + day;\n  else if (month == 7)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + day;\n  else if (month == 8)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  else if (month == 9)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  else if (month == 10)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  else if (month == 11)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  else if (month == 12)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    k = k + 1;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "19406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x;\n  cin >> y >> m >> d;\n  x = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 28;\n      }\n    }\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2)\n        x = x + 29;\n    }\n  }\n  x = x + d;\n  cout << x;\n  return 0;\n}\n"}
{"label": "11", "index": "19407", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int w, s, i, year, month, day;\n  int ymd[5][3];\n  int num[5];\n  for (i = 0; i < 5; i++) {\n    cin >> year >> month >> day;\n    ymd[i][0] = year;\n    ymd[i][1] = month;\n    ymd[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = ymd[i][0];\n    month = ymd[i][1];\n    day = ymd[i][2];\n    w = (year % 4 == 0 && year % 100 != 0) || year % 400 != 0;\n    switch (month) {\n    case 1:\n      s = 0;\n      break;\n    case 2:\n      s = 31;\n      break;\n    case 3:\n      s = 59;\n      break;\n    case 4:\n      s = 90;\n      break;\n    case 5:\n      s = 120;\n      break;\n    case 6:\n      s = 151;\n      break;\n    case 7:\n      s = 181;\n      break;\n    case 8:\n      s = 212;\n      break;\n    case 9:\n      s = 243;\n      break;\n    case 10:\n      s = 273;\n      break;\n    case 11:\n      s = 304;\n      break;\n    case 12:\n      s = 334;\n      break;\n    }\n    if (w == 0 && month > 2) {\n      s = s + 1;\n    }\n    num[i] = s + day;\n  }\n  printf(\"%d\\n%d\\n%d\\n%d\\n%d\\n\", num[0], num[1], num[2], num[3], num[4]);\n}\n"}
{"label": "11", "index": "19408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, num, leap;\n  leap = 0;\n  cin >> y >> m >> d;\n  if (m == 1 || m == 2) {\n    if (m == 1)\n      num = d;\n    else\n      num = 31 + d;\n    cout << num << \"\\n\";\n  } else {\n    num = (m - 1) * 30 + d;\n    if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n      leap = 1;\n    if (leap == 1)\n      num = num - 1;\n    else\n      num = num - 2;\n    switch (m) {\n    case 3:\n      num = num + 1;\n      break;\n    case 4:\n    case 5:\n      num = num + 2;\n      break;\n    case 6:\n    case 7:\n      num = num + 3;\n      break;\n    case 8:\n    case 9:\n      num = num + 4;\n      break;\n    case 10:\n      num = num + 5;\n      break;\n    case 11:\n    case 12:\n      num = num + 6;\n      break;\n    default:\n      break;\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19409", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint X1(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 59 + z;\n    break;\n  case 4:\n    j = 90 + z;\n    break;\n  case 5:\n    j = 120 + z;\n    break;\n  case 6:\n    j = 151 + z;\n    break;\n  case 7:\n    j = 181 + z;\n    break;\n  case 8:\n    j = 212 + z;\n    break;\n  case 9:\n    j = 243 + z;\n    break;\n  case 10:\n    j = 273 + z;\n    break;\n  case 11:\n    j = 304 + z;\n    break;\n  default:\n    j = 334 + z;\n    break;\n  }\n  return (j);\n}\nint X2(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 60 + z;\n    break;\n  case 4:\n    j = 91 + z;\n    break;\n  case 5:\n    j = 121 + z;\n    break;\n  case 6:\n    j = 152 + z;\n    break;\n  case 7:\n    j = 182 + z;\n    break;\n  case 8:\n    j = 213 + z;\n    break;\n  case 9:\n    j = 244 + z;\n    break;\n  case 10:\n    j = 274 + z;\n    break;\n  case 11:\n    j = 305 + z;\n    break;\n  default:\n    j = 335 + z;\n    break;\n  }\n  return (j);\n}\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  cout << endl;\n  int num;\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  } else {\n    if (y % 4 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19410", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int isleapyear;\n  cin >> year >> month >> day;\n\n  isleapyear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n  if (isleapyear && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (isleapyear && month != 2 && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n  for (i = 0; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && isleapyear)\n    n++;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i,\n      rank = 0, y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)\n    max[2] += 1;\n  ;\n  for (i = 1; i < m; i++) {\n    rank += max[i];\n  }\n  rank += d;\n  printf(\"%d\", rank);\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "11", "index": "19412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int sum = 0;\n  cin >> year >> month >> date;\n  int temp;\n  if (year % 4 != 0) {\n    temp = 28;\n  } else if (year % 100 != 0) {\n    temp = 29;\n  } else if (year % 400 != 0) {\n    temp = 28;\n  } else {\n    temp = 29;\n  }\n  int a[12] = {31, temp, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19413", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int leap, year, month, day, sum = 0;\n  int a[2][12] = {{\n                      31,\n                      28,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                  },\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  leap = ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0));\n  for (int i = 0; i < month - 1; i++)\n    sum = sum + a[leap][i];\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19414", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, num;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 29;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 29 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 29 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 29 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  } else {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 28;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 28 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 28 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 28 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  int i, j;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    j = i - 1;\n    sum = sum + monthday[j];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, md = 0, d, day, i;\n  cin >> y >> m >> d;\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < m - 1; i++)\n    md = md + month[i];\n\n  day = md + d;\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "19417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint leap(int n) {\n  int leap = 0;\n  if (n % 400 == 0 || n % 100 != 0 && n % 4 == 0)\n    leap = 1;\n  return (leap);\n}\n\nint main() {\n  int year, month, day,\n      th = 0, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (leap(year) == 1)\n    a[2] = 29;\n  for (int i = 0; i < month; i++)\n    th = th + a[i];\n  th = th + day;\n  cout << th;\n  return (0);\n}\n"}
{"label": "11", "index": "19418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isrunnian(int year) {\n  if (year % 400 == 0)\n    return 1;\n  else if (year % 4 == 0 && year % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  else if (m == 2)\n    printf(\"%d\\n\", 31 + d);\n  else if (m == 3) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + d);\n  } else if (m == 4) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + d);\n  } else if (m == 5) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + d);\n  } else if (m == 6) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 30 + 31 + 31 + d);\n  } else if (m == 7) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + d);\n  } else if (m == 8) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + d);\n  } else if (m == 9) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n  } else if (m == 10) {\n    if (isrunnian(y))\n      cout << 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d << \"\\n\";\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n  } else if (m == 11) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n  } else if (m == 12) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4)\n      d = 91 + c;\n    else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else {\n      if (b == 7) {\n        d = 181 + c;\n      } else if (b == 8) {\n        d = 212 + c;\n      } else if (b == 9) {\n        d = 243 + c;\n      } else if (b == 10) {\n        d = 273 + c;\n      } else if (b == 11) {\n        d = 304 + c;\n      } else if (b == 12) {\n        d = 334 + c;\n      }\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19420", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, days, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 == !0) {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 29 + day;\n      break;\n    case 4:\n      days = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n    default:;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 28 + day;\n      break;\n    case 4:\n      days = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n    default:;\n    }\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, leap, y;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 29 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 29 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 29 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 28 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 28 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 28 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0, m = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    int M[13];\n    M[1] = M[3] = M[5] = M[7] = M[8] = M[10] = M[12] = 31;\n    M[4] = M[6] = M[9] = M[11] = 30;\n    M[2] = 29;\n    M[0] = 0;\n\n    for (i = 0; i < month; i++) {\n      m = m + M[i];\n    }\n    sum = m + day;\n  } else {\n    int N[13];\n    N[1] = N[3] = N[5] = N[7] = N[8] = N[10] = N[12] = 31;\n    N[4] = N[6] = N[9] = N[11] = 30;\n    N[2] = 28;\n    N[0] = 0;\n    for (i = 0; i < month; i++) {\n      m = m + N[i];\n    }\n    sum = m + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, dm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day = 0,\n            month = 0;\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    dm[1] = 29;\n  int i, d = 0;\n  for (i = 0; i < month - 1; i++)\n    d += dm[i];\n  d += day;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19424", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, x, i, sum = 0;\n  cin >> y >> m >> x;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    int d[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  } else {\n    int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, l, m, n;\n  scanf(\"%d\\n%d\\n%d\", &k, &l, &m);\n  if (k % 4 == 0) {\n    if (k % 100 == 0) {\n      if (k % 400 == 0) {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 29);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 29 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 29 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 29 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      } else {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 28);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 28 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 28 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 28 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      }\n    } else {\n      if ((l > 0) && (l < 2)) {\n        n = m;\n        printf(\"%d\", n);\n      } else if ((l > 1) && (l < 3)) {\n        n = (m + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 2) && (l < 4)) {\n        n = (m + 31 + 29);\n        printf(\"%d\\n\", n);\n      } else if ((l > 3) && (l < 5)) {\n        n = (m + 31 + 29 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 4) && (l < 6)) {\n        n = (m + 31 + 29 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 5) && (l < 7)) {\n        n = (m + 31 + 29 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 6) && (l < 8)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 7) && (l < 9)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 8) && (l < 10)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 9) && (l < 11)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 10) && (l < 12)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 11) && (l < 13)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      }\n    }\n  } else {\n    if ((l > 0) && (l < 2)) {\n      n = m;\n      printf(\"%d\", n);\n    } else if ((l > 1) && (l < 3)) {\n      n = (m + 31);\n      cout << n << \"\\n\";\n    } else if ((l > 2) && (l < 4)) {\n      n = (m + 31 + 28);\n      printf(\"%d\\n\", n);\n    } else if ((l > 3) && (l < 5)) {\n      n = (m + 31 + 28 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 4) && (l < 6)) {\n      n = (m + 31 + 28 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 5) && (l < 7)) {\n      n = (m + 31 + 28 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 6) && (l < 8)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 7) && (l < 9)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 8) && (l < 10)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 9) && (l < 11)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 10) && (l < 12)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 11) && (l < 13)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0, m = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    int M[13];\n    M[1] = M[3] = M[5] = M[7] = M[8] = M[10] = M[12] = 31;\n    M[4] = M[6] = M[9] = M[11] = 30;\n    M[2] = 29;\n    M[0] = 0;\n\n    for (i = 0; i < month; i++) {\n      m = m + M[i];\n    }\n    sum = m + day;\n  } else {\n    int N[13];\n    N[1] = N[3] = N[5] = N[7] = N[8] = N[10] = N[12] = 31;\n    N[4] = N[6] = N[9] = N[11] = 30;\n    N[2] = 28;\n    N[0] = 0;\n    for (i = 0; i < month; i++) {\n      m = m + N[i];\n    }\n    sum = m + day;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19427", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, day = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 && y % 400 == 0)\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 29;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  else {\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 28;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "19428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    s = c;\n    break;\n  case 2:\n    s = c + 31;\n    break;\n  case 3:\n    s = c + 31 + 28;\n    break;\n  case 4:\n    s = c + 31 + 28 + 31;\n    break;\n  case 5:\n    s = c + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    s = c + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  if ((a % 4 == 0 && a % 100 != 0 || a % 400 == 0) && (b > 2))\n    s = s + 1;\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "19429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s;\n  cin >> y >> m >> d;\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = d + 31;\n  } else if (m == 3) {\n    s = d + 59;\n  } else if (m == 4) {\n    s = d + 90;\n  } else if (m == 5) {\n    s = d + 120;\n  } else if (m == 6) {\n    s = d + 151;\n  } else if (m == 7) {\n    s = d + 181;\n  } else if (m == 8) {\n    s = d + 212;\n  } else if (m == 9) {\n    s = d + 243;\n  } else if (m == 10) {\n    s = d + 273;\n  } else if (m == 11) {\n    s = d + 304;\n  } else {\n    s = d + 334;\n  }\n  if (!((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))) {\n    printf(\"%d\", s);\n  } else {\n    if (m < 3) {\n      cout << s;\n    } else\n      printf(\"%d\", s + 1);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, mouth, day, n;\n  cin >> year >> mouth >> day;\n  if (year % 4 == 0) {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 60 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 91 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 121 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 152 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 182 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 213 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 244 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 274 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 305 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 335 + day;\n      cout << n;\n      break;\n    }\n  } else {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 59 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 90 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 120 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 151 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 181 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 212 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 243 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 273 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 304 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 334 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int s = d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < (m - 1); i++) {\n      s += B[i];\n    }\n    printf(\"%d\", s);\n  } else {\n    for (i = 0; i < (m - 1); i++) {\n      s += A[i];\n    }\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19432", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, total = 0;\n  int year, month, day;\n  cin >> year >> month >> day;\n  for (j = 1; j < month; j++) {\n    if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 || j == 12)\n      total = total + 31;\n    if (j == 4 || j == 6 || j == 9 || j == 11)\n      total = total + 30;\n    if (j == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, mounth, day, count = 0, t = 0;\n  cin >> year >> mounth >> day;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    count = 1;\n  } else {\n    count = 0;\n  }\n  if (count == 1) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 60 + day;\n      break;\n    case 4:\n      t = 91 + day;\n      break;\n    case 5:\n      t = 121 + day;\n      break;\n    case 6:\n      t = 152 + day;\n      break;\n    case 7:\n      t = 182 + day;\n      break;\n    case 8:\n      t = 213 + day;\n      break;\n    case 9:\n      t = 244 + day;\n      break;\n    case 10:\n      t = 274 + day;\n      break;\n    case 11:\n      t = 305 + day;\n      break;\n    case 12:\n      t = 335 + day;\n      break;\n    }\n  }\n  if (count == 0) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 59 + day;\n      break;\n    case 4:\n      t = 90 + day;\n      break;\n    case 5:\n      t = 120 + day;\n      break;\n    case 6:\n      t = 151 + day;\n      break;\n    case 7:\n      t = 181 + day;\n      break;\n    case 8:\n      t = 212 + day;\n      break;\n    case 9:\n      t = 243 + day;\n      break;\n    case 10:\n      t = 273 + day;\n      break;\n    case 11:\n      t = 304 + day;\n      break;\n    case 12:\n      t = 334 + day;\n      break;\n    }\n  }\n  cout << t;\n}\n"}
{"label": "11", "index": "19434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int a[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if ((year % 4 != 0) || ((year % 100 == 0) && (year % 400 != 0)))\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n\n  sum = sum + day;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1: {\n    n = day;\n    break;\n  }\n\n  case 2: {\n    n = 31 + day;\n    break;\n  }\n\n  case 3: {\n    n = 59 + day;\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      n = n + 1;\n    } else {\n      n = n;\n    }\n\n    break;\n  }\n  case 4: {\n    n = 90 + day;\n    break;\n  }\n  case 5: {\n    n = 120 + day;\n    break;\n  }\n  case 6: {\n    n = 151 + day;\n    break;\n  }\n  case 7: {\n    n = 181 + day;\n    break;\n  }\n  case 8: {\n    n = 212 + day;\n    break;\n  }\n  case 9: {\n    n = 243 + day;\n    break;\n  }\n  case 10: {\n    n = 273 + day;\n    break;\n  }\n  case 11: {\n    n = 304 + day;\n    break;\n  }\n  case 12: {\n    n = 334 + day;\n    break;\n  }\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rui(int x) {\n  if (x % 4 != 0)\n    return (0);\n  else if (x % 100 == 0 && x % 400 != 0)\n    return (0);\n  else\n    return (1);\n}\nint main() {\n  int r[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, n = 0;\n  cin >> a >> b >> c;\n  for (i = 0; i < b - 1; i++)\n    n = n + r[i];\n  n = n + c;\n  if (rui(a) == 1 && b > 2)\n    n++;\n  cout << n << \"\\n\";\n}\n"}
{"label": "11", "index": "19437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, n = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    n = n + monthday[i - 1];\n  }\n  n = n + day;\n\n  if (month > 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0))\n    n = n + 1;\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19438", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, a, rank;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    a = 1;\n  } else {\n    a = 0;\n  }\n  if (month == 1) {\n    rank = day;\n  }\n  if (month == 2) {\n    rank = 31 + day;\n  }\n  if (month == 3) {\n    rank = 59 + a + day;\n  }\n  if (month == 4) {\n    rank = 90 + a + day;\n  }\n  if (month == 5) {\n    rank = 120 + a + day;\n  }\n  if (month == 6) {\n    rank = 151 + a + day;\n  }\n  if (month == 7) {\n    rank = 181 + a + day;\n  }\n  if (month == 8) {\n    rank = 212 + a + day;\n  }\n  if (month == 9) {\n    rank = 243 + a + day;\n  }\n  if (month == 10) {\n    rank = 273 + a + day;\n  }\n  if (month == 11) {\n    rank = 304 + a + day;\n  }\n  if (month == 12) {\n    rank = 334 + a + day;\n  }\n  printf(\"%d\", rank);\n  return 0;\n}\n"}
{"label": "11", "index": "19439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int t;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 60;\n      break;\n    case 4:\n      t = 91;\n      break;\n    case 5:\n      t = 121;\n      break;\n    case 6:\n      t = 152;\n      break;\n    case 7:\n      t = 182;\n      break;\n    case 8:\n      t = 213;\n      break;\n    case 9:\n      t = 244;\n      break;\n    case 10:\n      t = 274;\n      break;\n    case 11:\n      t = 305;\n      break;\n    case 12:\n      t = 335;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 59;\n      break;\n    case 4:\n      t = 90;\n      break;\n    case 5:\n      t = 120;\n      break;\n    case 6:\n      t = 151;\n      break;\n    case 7:\n      t = 181;\n      break;\n    case 8:\n      t = 212;\n      break;\n    case 9:\n      t = 243;\n      break;\n    case 10:\n      t = 273;\n      break;\n    case 11:\n      t = 304;\n      break;\n    case 12:\n      t = 334;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "19440", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, t, i;\n  for (i = 1; i <= 5;) {\n    scanf(\"%d %d %d \", &y, &m, &d);\n    if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 60;\n        break;\n      case 4:\n        t = d + 91;\n        break;\n      case 5:\n        t = d + 121;\n        break;\n      case 6:\n        t = d + 152;\n        break;\n      case 7:\n        t = d + 182;\n        break;\n      case 8:\n        t = d + 213;\n        break;\n      case 9:\n        t = d + 244;\n        break;\n      case 10:\n        t = d + 274;\n        break;\n      case 11:\n        t = d + 305;\n        break;\n      case 12:\n        t = d + 335;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 59;\n        break;\n      case 4:\n        t = d + 90;\n        break;\n      case 5:\n        t = d + 120;\n        break;\n      case 6:\n        t = d + 151;\n        break;\n      case 7:\n        t = d + 181;\n        break;\n      case 8:\n        t = d + 212;\n        break;\n      case 9:\n        t = d + 243;\n        break;\n      case 10:\n        t = d + 273;\n        break;\n      case 11:\n        t = d + 304;\n        break;\n      case 12:\n        t = d + 334;\n        break;\n      }\n    }\n    printf(\"%d\\n\", t);\n    i++;\n  }\n}\n"}
{"label": "11", "index": "19441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, days;\n  cin >> year >> month >> days;\n  int day;\n  if (month == 1) {\n    day = days;\n  }\n  if (month == 2) {\n    day = 31 + days;\n  }\n  if (month == 3) {\n    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n      day = 31 + 29 + days;\n    else\n      day = 31 + 28 + days;\n  }\n  if (month == 4) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + days;\n    else\n      day = 31 + 28 + 31 + days;\n  }\n  if (month == 5) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + days;\n  }\n  if (month == 6) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 30 + 31 + 31 + days;\n  }\n  if (month == 7) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + days;\n  }\n  if (month == 8) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + days;\n  }\n  if (month == 9) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n  }\n  if (month == 10) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n  }\n  if (month == 11) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n  }\n  if (month == 12) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n  }\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int Y) {\n  if (Y % 400 == 0)\n    return 1;\n  else if (Y % 100 == 0)\n    return 0;\n  else if (Y % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if (leap(Y) == 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 28 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 28 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 29 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 29 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19443", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 100 != 0 && a / 4 == 0) || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 60 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 91 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 121 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 152 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 182 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 213 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 244 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 274 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 305 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 335 + c);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 59 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 90 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 120 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 151 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 181 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 212 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 243 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 273 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 304 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 334 + c);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19444", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int a = 0;\n  cin >> year >> month >> date;\n  if (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 29 + date;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 28 + date;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 28 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, a[20], b[20], c[20], x, day;\n  for (i = 1; i <= 5; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n  }\n  for (i = 1; i <= 5; i++) {\n    if (a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 29;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 29 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 29 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 29 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    } else {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 28;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 28 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 28 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 28 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    cout << day << \" \";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19446", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, daynum;\n  cin >> year >> month >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0) {\n      int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    } else {\n      int num[12] = {31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    }\n  } else {\n    int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n    if (month >= 2)\n      daynum = num[month - 2] + day;\n    else {\n      daynum = day;\n    }\n    printf(\"%d\", daynum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A, B, C, d, z, leap, i;\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d\\n\", &A, &B, &C);\n    if (A % 4 == 0) {\n      if (A % 100 == 0) {\n        if (A % 400 == 0)\n          leap = 1;\n        else\n          leap = 0;\n      } else\n        leap = 1;\n    } else\n      leap = 0;\n    if (leap) {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      z = d + C;\n    } else {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      z = d + C;\n    }\n    printf(\"%d\\n\", z);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, x = 0, i;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    } else if (i == 2) {\n      x = x + 28;\n    } else\n      x = x + 30;\n  }\n  if (((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0)) && (b > 2)) {\n    x = x + 1;\n  }\n  x = x + c;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum, i;\n  cin >> y >> m >> d;\n  sum = 0;\n  for (i = 1; i < m; i++)\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10))\n      sum = sum + 31;\n    else if (i == 2)\n      if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    else\n      sum = sum + 30;\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 60 + c);\n    else if (b == 4)\n      cout << 91 + c;\n    else if (b == 5)\n      printf(\"%d\", 121 + c);\n    else if (b == 6)\n      printf(\"%d\", 152 + c);\n    else if (b == 7)\n      printf(\"%d\", 182 + c);\n    else if (b == 8)\n      printf(\"%d\", 213 + c);\n    else if (b == 9)\n      printf(\"%d\", 244 + c);\n    else if (b == 10)\n      printf(\"%d\", 274 + c);\n    else if (b == 11)\n      printf(\"%d\", 305 + c);\n    else if (b == 12)\n      printf(\"%d\", 336 + c);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 59 + c);\n    else if (b == 4)\n      printf(\"%d\", 90 + c);\n    else if (b == 5)\n      printf(\"%d\", 120 + c);\n    else if (b == 6)\n      printf(\"%d\", 151 + c);\n    else if (b == 7)\n      printf(\"%d\", 181 + c);\n    else if (b == 8)\n      printf(\"%d\", 212 + c);\n    else if (b == 9)\n      printf(\"%d\", 243 + c);\n    else if (b == 10)\n      printf(\"%d\", 273 + c);\n    else if (b == 11)\n      printf(\"%d\", 304 + c);\n    else if (b == 12)\n      printf(\"%d\", 335 + c);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19451", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 100 != 0 && a / 4 == 0) || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 60 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 91 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 121 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 152 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 182 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 213 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 244 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 274 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 305 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 335 + c);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 59 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 90 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 120 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 151 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 181 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 212 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 243 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 273 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 304 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 334 + c);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19452", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A, B, C, d, z, leap, i;\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d \", &A, &B, &C);\n    if (A % 4 == 0) {\n      if (A % 100 == 0) {\n        if (A % 400 == 0)\n          leap = 1;\n        else\n          leap = 0;\n      } else\n        leap = 1;\n    } else\n      leap = 0;\n    if (leap) {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      z = d + C;\n    } else {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      z = d + C;\n    }\n    printf(\"%d\\n\", z);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if (Y % 400 == 0 && Y % 4000 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else if (Y % 4 == 0 && Y % 100 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 59);\n    if (M == 4)\n      printf(\"%d\", D + 90);\n    if (M == 5)\n      printf(\"%d\", D + 120);\n    if (M == 6)\n      printf(\"%d\", D + 150);\n    if (M == 7)\n      printf(\"%d\", D + 181);\n    if (M == 8)\n      printf(\"%d\", D + 212);\n    if (M == 9)\n      printf(\"%d\", D + 243);\n    if (M == 10)\n      printf(\"%d\", D + 273);\n    if (M == 11)\n      printf(\"%d\", D + 304);\n    if (M == 12)\n      printf(\"%d\", D + 334);\n  }\n}\n"}
{"label": "11", "index": "19454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i,\n               a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (m == 1)\n    x = d;\n  else if (m == 2)\n    x = 31 + d;\n  else if (y % 100 != 0 && y % 4 == 0 || y % 400 == 0) {\n    for (i = 0; i < m - 1; i++)\n      x += a[i];\n    x += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      x += b[i];\n    x += d;\n  }\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19455", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, n;\n  scanf(\"%d\", &y);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    scanf(\"%d%d\", &m, &d);\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 29 + d;\n    }\n    if (m == 4) {\n      n = 31 + 29 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 29 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 29 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n\n  } else {\n    scanf(\"%d%d\", &m, &d);\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 28 + d;\n    }\n    if (m == 4) {\n      n = 31 + 28 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 28 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 28 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19456", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i,\n               a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m == 1)\n    x = d;\n  else if (m == 2)\n    x = 31 + d;\n  else if (y % 100 != 0 && y % 4 == 0 || y % 400 == 0) {\n    for (i = 0; i < m - 1; i++)\n      x += a[i];\n    x += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      x += b[i];\n    x += d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], i;\n  for (i = 0; i < 5; i++)\n    cin >> a[i] >> b[i] >> c[i];\n\n  printf(\"319\");\n  cout << \"\\n\";\n  printf(\"32\");\n  printf(\"\\n\");\n  printf(\"61\");\n  printf(\"\\n\");\n  printf(\"60\");\n  printf(\"\\n\");\n  printf(\"1\");\n  return 0;\n}\n"}
{"label": "11", "index": "19458", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, d;\n  cin >> n >> m >> d;\n  int a = d;\n  for (i = 1; i <= m - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      a += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      a += 30;\n    } else {\n      if ((n % 100 == 0 && n % 400 != 0) || n % 4 != 0) {\n        a += 28;\n\n      } else {\n        a += 29;\n      }\n    }\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int s = d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < (m - 1); i++) {\n      s += B[i];\n    }\n    printf(\"%d\", s);\n  } else {\n    for (i = 0; i < (m - 1); i++) {\n      s += A[i];\n    }\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int monday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  total = 0;\n  for (i = 1; i < month; i++) {\n    total = total + monday[i - 1];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    total = total + 1;\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int n;\n\n  cin >> year >> month >> day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 29 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 29 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 29 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 9) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  } else {\n    if (month == 1) {\n      n = day;\n      printf(\"%d\", n);\n    }\n    if (month == 2) {\n      n = 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 3) {\n      n = 31 + 28 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 4) {\n      n = 31 + 28 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 5) {\n      n = 31 + 28 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 6) {\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 7) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 8) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      cout << n;\n    }\n    if (month == 9) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 10) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 11) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      printf(\"%d\", n);\n    }\n    if (month == 12) {\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  sum = 0;\n  scanf(\"%d %d %d\", &n, &j, &k);\n  for (i = 0; i <= j - 1; i++) {\n    sum = sum + a[i];\n  }\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    if (j <= 2)\n      sum = sum + k;\n    else {\n      sum = sum + 1 + k;\n    }\n  } else {\n    sum = sum + k;\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s, i, l;\n  s = 0;\n  cin >> y >> m >> d;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n\n  s = s + d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        l = 1;\n      else\n        l = 0;\n    } else\n      l = 1;\n  } else\n    l = 0;\n  if (m > 2)\n    s = s + l;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int daymonth[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                         31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int YEAR, MON, DAY, i, counter = 0;\n  scanf(\"%d %d %d \", &YEAR, &MON, &DAY);\n  for (i = 0; i < MON - 1; i++)\n    counter += daymonth[leap(YEAR)][i];\n\n  counter += DAY;\n  cout << counter << endl;\n  return 0;\n}\nint leap(int YEAR) {\n  if ((YEAR % 4 == 0) && (YEAR % 100 != 0) || (YEAR % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int q1, q2, q3, k = 0;\n  scanf(\"%d %d %d\", &q1, &q2, &q3);\n  if ((q1 % 4 == 0 && q1 & 100 != 0) || q1 % 400 == 0)\n    k++;\n  int a[15], b[16];\n  if (k == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  b[1] = 0;\n  for (int i = 2; i <= 12; i++)\n    b[i] = b[i - 1] + a[i - 1];\n  printf(\"%d\", b[q2] + q3);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, s = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int m1 = 31, m2 = 28, m21 = 29, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31,\n      m8 = 31, m9 = 30, m10 = 31, m11 = 30, m12 = 31;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 28 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m2 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m2 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m2 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      cout << s << \"\\n\";\n      break;\n    }\n  } else {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 29 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m21 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m21 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m21 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, y, m, d, D;\n  int total = 0;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    } else {\n      if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  D = total + d;\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  long a[5];\n  int b[5], c[5], g[5];\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%ld %d %d\", &a[i], &b[i], &c[i]);\n    i++;\n  }\n  i = 1;\n  while (i <= 5) {\n    g[i] = 0;\n    switch (b[i]) {\n    case 12:\n      g[i] += 30;\n    case 11:\n      g[i] += 31;\n    case 10:\n      g[i] += 30;\n    case 9:\n      g[i] += 31;\n    case 8:\n      g[i] += 31;\n    case 7:\n      g[i] += 30;\n    case 6:\n      g[i] += 31;\n    case 5:\n      g[i] += 30;\n    case 4:\n      g[i] += 31;\n    case 3:\n      g[i] += 28;\n    case 2:\n      g[i] += 31;\n    case 1:\n      g[i] += 0;\n      break;\n    default:\n      printf(\"error\\n\");\n    }\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || (a[i] % 400 == 0)) &&\n        (b[i] >= 3))\n      c[i] = c[i] + 1;\n    printf(\"%d\\n\", g[i] + c[i]);\n    i++;\n  }\n}\n"}
{"label": "11", "index": "19469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, month2, n;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    month2 = 29;\n  else\n    month2 = 28;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 31 + month2 + day;\n  if (month == 4)\n    n = 31 + month2 + 31 + day;\n  if (month == 5)\n    n = 31 + month2 + 31 + 30 + day;\n  if (month == 6)\n    n = 31 + month2 + 31 + 30 + 31 + day;\n  if (month == 7)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + day;\n  if (month == 8)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + day;\n\n  if (month == 9)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == 10)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == 11)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == 12)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, c, days = 0, i;\n  int M[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    c = 1;\n  else\n    c = 0;\n  if (month == 1)\n    cout << day;\n  else {\n    for (i = 0; i < month - 1; i++)\n      days += M[c][i];\n    cout << days + day;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19471", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    cin >> a >> b >> c;\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else\n          d = d + 28;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j++;\n  }\n}\n"}
{"label": "11", "index": "19472", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, z, i, n;\n  scanf(\"%d %d %d\", &x, &y, &z);\n  if (x % 400 == 0)\n    i = 1;\n  else {\n    if (x % 100 == 0)\n      i = 0;\n    else {\n      if (x % 4 == 0) {\n        i = 1;\n      } else\n        i = 0;\n    }\n  }\n  if (i == 1) {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 29 + z;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 28 + z;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19473", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, x = 0;\n  cin >> year >> month >> day;\n  if (month == 2) {\n    x = 31 + day;\n    printf(\"%d\", x);\n  } else if (month == 1) {\n    x = day;\n    printf(\"%d\", x);\n  } else {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 3:\n        x = 31 + 29;\n        break;\n      case 4:\n        x = 31 + 29 + 31;\n        break;\n\n      case 5:\n        x = 31 + 29 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    } else {\n      switch (month) {\n      case 3:\n        x = 31 + 28;\n        break;\n      case 4:\n        x = 31 + 28 + 31;\n        break;\n\n      case 5:\n        x = 31 + 28 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 28 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    x = x + day;\n\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "11", "index": "19474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s1 = 0, s2;\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    n[1] = 29;\n  for (i = 1; i < b; i++)\n    s1 = s1 + n[i - 1];\n  s2 = s1 + c;\n  printf(\"%d\\n\", s2);\n  return 0;\n}\n"}
{"label": "11", "index": "19475", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n\n    d = c;\n  }\n\n  else if (b == 2) {\n    d = 31 + c;\n\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n\n      if (b == 3) {\n        d = 31 + 29 + c;\n      }\n      if (b == 4) {\n        d = 31 + 29 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 29 + 31 + 30 + c;\n      }\n      if (b == 6)\n        d = 31 + 29 + 31 + 30 + 31 + c;\n\n      if (b == 7) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    } else {\n      if (b == 3) {\n        d = 31 + 28 + c;\n      }\n      if (b == 4) {\n        d = 31 + 28 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 28 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 28 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    }\n  }\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, D;\n  cin >> year >> month >> day;\n  if (month == 1) {\n    D = day;\n  }\n  if (month == 2) {\n    D = day + 31;\n  }\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 3) {\n      D = day + 31 + 29;\n    }\n    if (month == 4) {\n      D = day + 31 + 29 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 29 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7)\n      D = day + 31 + 29 + 31 + 30 + 31 + 30;\n\n    if (month == 8) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 3) {\n      D = day + 31 + 28;\n    }\n    if (month == 4) {\n      D = day + 31 + 28 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 28 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  printf(\"%d\\n\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Runnian(int y);\nint main() {\n  int y, m, d, count = 0;\n  int i;\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      count += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      count += 30;\n    else if (i == 2) {\n      if (Runnian(y))\n        count += 29;\n      else\n        count += 28;\n    }\n  }\n  count += d;\n  printf(\"%d\\n\", count);\n  return 0;\n}\nint Runnian(int y) {\n  int result;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\n"}
{"label": "11", "index": "19478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int dmonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i = 0;\n  int sum = 0;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + dmonth[i];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month >= 3) {\n      sum = sum + day + 1;\n    }\n  } else {\n    sum = sum + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19479", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 60 + c;\n      break;\n    }\n    case 4: {\n      n = 91 + c;\n      break;\n    }\n    case 5: {\n      n = 121 + c;\n      break;\n    }\n    case 6: {\n      n = 152 + c;\n      break;\n    }\n    case 7: {\n      n = 182 + c;\n      break;\n    }\n    case 8: {\n      n = 213 + c;\n      break;\n    }\n    case 9: {\n      n = 244 + c;\n      break;\n    }\n    case 10: {\n      n = 274 + c;\n      break;\n    }\n    case 11: {\n      n = 305 + c;\n      break;\n    }\n    case 12: {\n      n = 335 + c;\n      break;\n    }\n    }\n\n  } else {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 59 + c;\n      break;\n    }\n    case 4: {\n      n = 90 + c;\n      break;\n    }\n    case 5: {\n      n = 120 + c;\n      break;\n    }\n    case 6: {\n      n = 151 + c;\n      break;\n    }\n    case 7: {\n      n = 181 + c;\n      break;\n    }\n    case 8: {\n      n = 212 + c;\n      break;\n    }\n    case 9: {\n      n = 243 + c;\n      break;\n    }\n    case 10: {\n      n = 273 + c;\n      break;\n    }\n    case 11: {\n      n = 304 + c;\n      break;\n    }\n    case 12: {\n      n = 334 + c;\n      break;\n    }\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19480", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0, m = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    int M[13];\n    M[1] = M[3] = M[5] = M[7] = M[8] = M[10] = M[12] = 31;\n    M[4] = M[6] = M[9] = M[11] = 30;\n    M[2] = 29;\n    M[0] = 0;\n\n    for (i = 0; i < month; i++) {\n      m = m + M[i];\n    }\n    sum = m + day;\n  } else {\n    int N[13];\n    N[1] = N[3] = N[5] = N[7] = N[8] = N[10] = N[12] = 31;\n    N[4] = N[6] = N[9] = N[11] = 30;\n    N[2] = 28;\n    N[0] = 0;\n    for (i = 0; i < month; i++) {\n      m = m + N[i];\n    }\n    sum = m + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    s = c;\n    break;\n  case 2:\n    s = c + 31;\n    break;\n  case 3:\n    s = c + 31 + 28;\n    break;\n  case 4:\n    s = c + 31 + 28 + 31;\n    break;\n  case 5:\n    s = c + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    s = c + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  if ((a % 4 == 0 && a % 100 != 0 || a % 400 == 0) && (b > 2))\n    s = s + 1;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19482", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d;\n  int i = 0, num = 0;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && (y % 100 != 0 || (y % 400 == 0))) {\n\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num += d;\n  } else {\n\n    int a[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++) {\n      num += a[i];\n    }\n    num = num + d;\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, dd = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    cout << dd;\n  } else {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  int a, b, c;\n  int amount = 0;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (m > 2) {\n    a = f(y);\n    if (a == 1)\n      p[1] = p[1] + 1;\n    for (int i = 0; i < m - 1; i++)\n      amount = amount + p[i];\n    amount = amount + d;\n  } else if (m == 1)\n    amount = d;\n  else if (m == 2)\n    amount = 31 + d;\n  printf(\"%d\", amount);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, days = 0, i = 1;\n  int month_str1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month_str2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    while (i != month) {\n      days += month_str2[i - 1];\n      i++;\n    }\n  else\n    while (i != month) {\n      days += month_str1[i - 1];\n      i++;\n    }\n  cout << days + day;\n  return 0;\n}\n"}
{"label": "11", "index": "19486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = day;\n    break;\n  case 2:\n    sum = 31 + day;\n    break;\n  case 3:\n    sum = 31 + 28 + day;\n    break;\n  case 4:\n    sum = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    sum = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    sum = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + day;\n    break;\n  }\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))\n    sum = sum + 1;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, p;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        p = 29;\n      } else\n        p = 28;\n\n    else {\n      p = 29;\n    }\n  else {\n    p = 28;\n  }\n\n  switch (m) {\n  case 1: {\n    printf(\"%d\", d);\n    break;\n  }\n  case 2: {\n    printf(\"%d\", d + 31);\n    break;\n  }\n  case 3: {\n    printf(\"%d\", d + 31 + p);\n    break;\n  }\n  case 4: {\n    printf(\"%d\", d + 31 * 2 + p);\n    break;\n  }\n  case 5: {\n    printf(\"%d\", d + 31 * 2 + p + 30);\n    break;\n  }\n  case 6: {\n    printf(\"%d\", d + 31 * 3 + p + 30);\n    break;\n  }\n  case 7: {\n    printf(\"%d\", d + 31 * 3 + p + 30 * 2);\n    break;\n  }\n  case 8: {\n    printf(\"%d\", d + 31 * 4 + p + 30 * 2);\n    break;\n  }\n  case 9: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 2);\n    break;\n  }\n  case 10: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 3);\n    break;\n  }\n  case 11: {\n    printf(\"%d\", d + 31 * 6 + p + 30 * 3);\n    break;\n  }\n  default: { printf(\"%d\", d + 31 * 6 + p + 30 * 4); }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      sum += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2 && y % 400 == 0 || y % 4 == 0 && y % 100 != 0)\n      sum = sum + 29;\n    else if (i == 2)\n      sum += 28;\n  }\n  sum = sum + d;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19489", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n\n  n += day;\n\n  if (month > 2 && isleapyear(year))\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "19490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int DJT = 0;\n  int D[12];\n  D[0] = 31;\n  D[1] = 28;\n  D[2] = 31;\n  D[3] = 30;\n  D[4] = 31;\n  D[5] = 30;\n  D[6] = 31;\n  D[7] = 31;\n  D[8] = 30;\n  D[9] = 31;\n  D[10] = 30;\n  D[11] = 31;\n  int year, month, day;\n  cin >> year >> month >> day;\n  if (year % 400 == 0)\n    D[1] = D[1] + 1;\n  else if (year % 100 != 0 && year % 4 == 0)\n    D[1] = D[1] + 1;\n  else\n    D[1] = D[1];\n  for (int i = 0; i < month - 1; i++)\n    DJT = DJT + D[i];\n  DJT = DJT + day;\n  cout << DJT << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  int leap(int y);\n  scanf(\"%d%d%d\", &y, &m, &d);\n  switch (m) {\n  case 12:\n    t += 30;\n  case 11:\n    t += 31;\n  case 10:\n    t += 30;\n  case 9:\n    t += 31;\n  case 8:\n    t += 31;\n  case 7:\n    t += 30;\n  case 6:\n    t += 31;\n  case 5:\n    t += 30;\n  case 4:\n    t += 31;\n  case 3:\n    t += 28;\n  case 2:\n    t += 31;\n  case 1:\n    t += 0;\n  }\n  if (m > 2 && leap(y)) {\n    t += 1;\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\nint leap(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "11", "index": "19493", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int mouth[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                      {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  int leapyear;\n  int a, b, c, i;\n  int d = 0;\n  cin >> a >> b >> c;\n  leapyear = (a % 4 == 0 && a % 100 != 0 || a % 400 == 0);\n  for (i = 0; i < b - 1; i++) {\n    d = d + mouth[leapyear][i];\n  }\n  d = d + c;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint X1(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 59 + z;\n    break;\n  case 4:\n    j = 90 + z;\n    break;\n  case 5:\n    j = 120 + z;\n    break;\n  case 6:\n    j = 151 + z;\n    break;\n  case 7:\n    j = 181 + z;\n    break;\n  case 8:\n    j = 212 + z;\n    break;\n  case 9:\n    j = 243 + z;\n    break;\n  case 10:\n    j = 273 + z;\n    break;\n  case 11:\n    j = 304 + z;\n    break;\n  default:\n    j = 334 + z;\n    break;\n  }\n  return (j);\n}\nint X2(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 60 + z;\n    break;\n  case 4:\n    j = 91 + z;\n    break;\n  case 5:\n    j = 121 + z;\n    break;\n  case 6:\n    j = 152 + z;\n    break;\n  case 7:\n    j = 182 + z;\n    break;\n  case 8:\n    j = 213 + z;\n    break;\n  case 9:\n    j = 244 + z;\n    break;\n  case 10:\n    j = 274 + z;\n    break;\n  case 11:\n    j = 305 + z;\n    break;\n  default:\n    j = 335 + z;\n    break;\n  }\n  return (j);\n}\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  cout << endl;\n  int num;\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  } else {\n    if (y % 4 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, s;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int a;\n  if (x % 4 == 0)\n    if (x % 100 == 0)\n      if (x % 400 == 0)\n        a = 29;\n      else\n        a = 28;\n    else\n      a = 29;\n  else\n    a = 28;\n  if (y == 1 || y == 2) {\n    s = (y - 1) * 31 + z;\n  } else if (y == 3 || y == 7 || y == 5) {\n    s = (y - 1) / 2 * 31 + (y - 3) / 2 * 30 + a + z;\n  } else if (y == 4 || y == 6) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  } else if (y == 9 || y == 11) {\n    s = (y + 1) / 2 * 31 + (y - 5) / 2 * 30 + a + z;\n  } else if (y == 8 || y == 10 || y == 12) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19496", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Day1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Day2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int sumday = 0;\n  int i, j;\n\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    j = 1;\n  else\n    j = 0;\n  if (j == 1) {\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++)\n        sumday = sumday + Day2[i];\n\n      sumday = sumday + day;\n      printf(\"%d\\n\", sumday);\n    }\n  }\n  if (j == 0) {\n\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day1[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  int DaysOfMonth[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                            0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int flag;\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 4 == 0 && year % 100 == 0 && year % 400 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  if (month == 1)\n    cout << day << endl;\n  else {\n    for (i = 1; i < month; i++) {\n      sum += DaysOfMonth[flag][i];\n    }\n    sum += day;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[5], c[5], k[5];\n  long a[5];\n  int j;\n  for (j = 1; j <= 5; j++) {\n    scanf(\"%ld %d %d\", &a[j - 1], &b[j - 1], &c[j - 1]);\n  }\n  for (j = 1; j <= 5; j++) {\n    int i, l, x;\n    if (a[j - 1] % 4 != 0)\n      l = 28;\n    else {\n      if ((a[j - 1] % 100 == 0) && (a[j - 1] % 400 != 0))\n        l = 28;\n      else\n        l = 29;\n    }\n    x = 0;\n    for (i = 1; i <= b[j - 1] - 1; i++) {\n      switch (i) {\n      case 1:\n        x = x + 31;\n        break;\n      case 2:\n        x = x + l;\n        break;\n      case 3:\n        x = x + 31;\n        break;\n      case 4:\n        x = x + 30;\n        break;\n      case 5:\n        x = x + 31;\n        break;\n      case 6:\n        x = x + 30;\n        break;\n      case 7:\n        x = x + 31;\n        break;\n      case 8:\n        x = x + 31;\n        break;\n      case 9:\n        x = x + 30;\n        break;\n      case 10:\n        x = x + 31;\n        break;\n      case 11:\n        x = x + 30;\n        break;\n      case 12:\n        x = x + 31;\n        break;\n      }\n    }\n    x = x + c[j - 1];\n    int m;\n    m = j - 1;\n    k[m] = x;\n    cout << k[m] << \"\\n\";\n  }\n}\n"}
{"label": "11", "index": "19499", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a, b;\n  int i, s;\n  int c = 0;\n  cin >> m >> a >> b;\n  if ((m % 4 == 0 && m % 100 != 0) || (m % 400 == 0)) {\n    int months[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++)\n      c = c + months[i];\n    s = c + b;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++) {\n      c = c + month[i];\n    }\n    s = c + b;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1) {\n    n = day;\n  } else if (month == 2) {\n    n = 31 + day;\n  } else if ((year % 4 != 0 || year % 100 == 0) && year % 400 != 0) {\n    if (month < 8) {\n      if (month % 2 == 0) {\n        n = 31 * (month - 1) - 2 - month / 2 + day;\n      } else\n        n = 31 * (month - 1) - 2 - (month - 1) / 2 + day;\n    } else if (month % 2 == 0) {\n      n = 31 * 4 + 28 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n    } else\n      n = 31 * 4 + 28 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  } else if (month < 8) {\n    if (month % 2 == 0) {\n      n = 31 * (month - 1) - 1 - month / 2 + day;\n    } else\n      n = 31 * (month - 1) - 1 - (month - 1) / 2 + day;\n  } else if (month % 2 == 0) {\n    n = 31 * 4 + 29 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n  } else\n    n = 31 * 4 + 29 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint leapyear(int year) {\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n    return 1;\n  else\n    return 0;\n}\nint whichday(int year, int month, int day) {\n  int mon[1000] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int d = 0, i;\n  if (leapyear(year) == 1)\n    mon[1]++;\n  for (i = 0; i < month - 1; i++)\n    d += mon[i];\n  d += day;\n  return d;\n}\nint main() {\n  int year, month, day;\n  int d;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  d = whichday(year, month, day);\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19502", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint fun(int y, int m, int d) {\n  int a[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, c;\n  c = 0;\n  for (i = 0; i < m; i++)\n    c = c + a[i];\n  c = c + d;\n  if ((m > 2) && (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)))\n    c++;\n  return c;\n}\n\nint main() {\n  int i, a, b, c;\n  for (i = 0; i < 100; i++)\n    if (cin >> a >> b >> c)\n      cout << fun(a, b, c) << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, tian, i = 1;\n  for (; i <= 5; i = i + 1) {\n    scanf(\"%d %d %d\\n\", &nian, &yue, &ri);\n    if (nian % 4 == 0 && nian % 100 != 0 ||\n        nian % 100 == 0 && nian % 400 == 0) {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 60;\n        break;\n      case 4:\n        tian = 91;\n        break;\n      case 5:\n        tian = 121;\n        break;\n      case 6:\n        tian = 152;\n        break;\n      case 7:\n        tian = 182;\n        break;\n      case 8:\n        tian = 213;\n        break;\n      case 9:\n        tian = 244;\n        break;\n      case 10:\n        tian = 274;\n        break;\n      case 11:\n        tian = 305;\n        break;\n      case 12:\n        tian = 335;\n        break;\n      }\n    } else {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 59;\n        break;\n      case 4:\n        tian = 90;\n        break;\n      case 5:\n        tian = 120;\n        break;\n      case 6:\n        tian = 151;\n        break;\n      case 7:\n        tian = 181;\n        break;\n      case 8:\n        tian = 212;\n        break;\n      case 9:\n        tian = 243;\n        break;\n      case 10:\n        tian = 273;\n        break;\n      case 11:\n        tian = 304;\n        break;\n      case 12:\n        tian = 334;\n        break;\n      }\n    }\n    tian = tian + ri;\n    printf(\"%d\\n\", tian);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i,\n               a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (m == 1)\n    x = d;\n  else if (m == 2)\n    x = 31 + d;\n  else if (y % 100 != 0 && y % 4 == 0 || y % 400 == 0) {\n    for (i = 0; i < m - 1; i++)\n      x += a[i];\n    x += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      x += b[i];\n    x += d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19505", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x;\n\n  cin >> a >> b >> c;\n\n  d = 31 + c;\n  e = 59 + c;\n  f = 90 + c;\n  g = 120 + c;\n  h = 151 + c;\n  i = 181 + c;\n  j = 212 + c;\n  k = 243 + c;\n  l = 273 + c;\n  m = 304 + c;\n  n = 334 + c;\n  o = 60 + c;\n  p = 91 + c;\n  q = 121 + c;\n  r = 152 + c;\n  s = 182 + c;\n  t = 213 + c;\n  u = 244 + c;\n  v = 274 + c;\n  w = 305 + c;\n  x = 335 + c;\n\n  if (b == 1)\n    printf(\"%d\", c);\n  if (b == 2)\n    printf(\"%d\", d);\n  if ((b == 3) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", e);\n  if ((b == 4) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", f);\n  if ((b == 5) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", g);\n  if ((b == 6) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", h);\n  if ((b == 7) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", i);\n  if ((b == 8) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", j);\n  if ((b == 9) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", k);\n  if ((b == 10) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", l);\n  if ((b == 11) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", m);\n  if ((b == 12) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", n);\n  if ((b == 3) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", o);\n  if ((b == 4) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", p);\n  if ((b == 5) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", q);\n  if ((b == 6) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", r);\n  if ((b == 7) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", s);\n  if ((b == 8) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", t);\n  if ((b == 9) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", u);\n  if ((b == 10) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", v);\n  if ((b == 11) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", w);\n  if ((b == 12) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, which;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  which = day;\n  month--;\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    if (year % 4 != 0)\n      which += 28;\n    else if (year % 100 == 0 && year % 400 != 0)\n      which += 28;\n    else\n      which += 29;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  printf(\"%d\", which);\n  return 0;\n}\n"}
{"label": "11", "index": "19507", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int isrunnian(int);\n  int year, month, day, result = 0;\n  int i;\n  scanf(\"%d\", &year);\n  scanf(\"%d\", &month);\n  scanf(\"%d\", &day);\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      result = result + 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      result = result + 30;\n      break;\n    case 2:\n      if (isrunnian(year)) {\n        result = result + 29;\n      } else {\n        result = result + 28;\n      }\n      break;\n    }\n  }\n  result = result + day;\n  printf(\"%d\\n\", result);\n}\n\nint isrunnian(int year) {\n  if (year % 400 == 0) {\n    return 1;\n  } else {\n    if (year % 4 == 0 && year % 100 != 0) {\n      return 1;\n    } else {\n      return 0;\n    }\n  }\n}\n"}
{"label": "11", "index": "19508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  if (x % 4 != 0)\n    return 0;\n  else if ((x % 100 == 0) && (x % 400 != 0))\n    return 0;\n  else\n    return 1;\n}\nint main() {\n  int y, m, d;\n  int j = 1;\n  int n = 0;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if (f(y) == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  for (j = 1; j < m; j++)\n    n = n + a[j];\n  n = n + d;\n  printf(\"%d \", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && isleapyear(year))\n    n++;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t = 0;\n  int monthday[13] = {0, 31, 28 + t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    t = 1;\n\n  int summonth = 0;\n  int sum = 0;\n\n  int i;\n  for (i = 0; i < month; i++)\n    summonth += monthday[i];\n  sum = summonth + day;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19511", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      sum += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2 && y % 400 == 0 || y % 4 == 0 && y % 100 != 0) {\n      sum = sum + 29;\n    } else if (i == 2)\n      sum += 28;\n  }\n  sum = sum + d;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, l = 0;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    if (m == 1)\n      cout << d;\n    else {\n      for (int i = 0; i < m - 1; i++) {\n        l += a[i];\n      }\n      cout << l + d;\n    }\n  } else {\n    if (m == 1)\n      cout << d;\n    else {\n      for (int i = 0; i < m - 1; i++)\n        l += b[i];\n\n      cout << l + d;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int year, month, day;\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  if (year % 4 != 0)\n    days[1] = 28;\n  else if (year % 4 == 0 && year % 100 != 0)\n    days[1] = 29;\n  else if (year % 400 == 0)\n    days[1] = 29;\n  else if (year % 100 == 0 && year % 400 != 0)\n    days[1] = 28;\n  int i, k = 0, n;\n  for (i = 1; i < month; i++) {\n    k = k + days[i];\n  }\n  n = k + day + 1;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19514", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, daynum;\n  cin >> year >> month >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0) {\n      int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    } else {\n      int num[12] = {31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    }\n  } else {\n    int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n    if (month >= 2)\n      daynum = num[month - 2] + day;\n    else\n      daynum = day;\n\n    printf(\"%d\", daynum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19515", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m == 1)\n    sum = d;\n  if (m == 2)\n    sum = 31 + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m == 3)\n      sum = 31 + 29 + d;\n    if (m == 4)\n      sum = 31 + 29 + 31 + d;\n    if (m == 5)\n      sum = 31 + 29 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 29 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  } else {\n    if (m == 3)\n      sum = 31 + 28 + d;\n    if (m == 4)\n      sum = 31 + 28 + 31 + d;\n    if (m == 5)\n      sum = 31 + 28 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 28 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19516", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int year, int month, int day) {\n  int result = 0;\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  return result;\n}\nint main() {\n  int year, month, day, Y;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  Y = DiJiTian(year, month, day);\n  printf(\"%d\", Y);\n  return 0;\n}\n"}
{"label": "11", "index": "19517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int yy, mm, dd, i, n = 0;\n  scanf(\"%d%d%d\", &yy, &mm, &dd);\n  if (yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0) {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n\n        n = n + 29;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    cout << n;\n\n  }\n\n  else {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n        n = n + 28;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1) {\n    a = day;\n  } else if (mon == 2)\n    a = 31 + day;\n  else if (mon > 2) {\n    if (mon == 3) {\n      a = 31 + 29 + day;\n    } else if (mon == 4) {\n      a = 31 + 29 + 31 + day;\n    } else if (mon == 5) {\n      a = 31 + 29 + 31 + 30 + day;\n    } else if (mon == 6) {\n      a = 31 + 29 + 31 + 30 + 31 + day;\n    } else if (mon == 7) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    } else if (mon == 8) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    } else if (mon == 9) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    } else if (mon == 10) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    } else if (mon == 11) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    } else if (mon == 12) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n    if (year % 400 == 0 || year % 100 != 0 && year % 4 == 0)\n      a = a;\n    else\n      a = a - 1;\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19519", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int ye, mo, da, i, sum = 0;\n  int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d%d%d\", &ye, &mo, &da);\n\n  for (i = 1; i < mo; i++) {\n    sum = sum + mon[i];\n  }\n  if (((ye % 400 == 0) && mo > 2) ||\n      ((ye % 4 == 0) && (ye % 100 != 0)) && mo > 2) {\n    sum = sum + da + 1;\n  } else {\n    sum = sum + da;\n  }\n\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, y, r, d, i;\n  for (i = 1; i <= 5; i++) {\n    cin >> n >> y >> r;\n    d = 0;\n    if ((y > 2) && (n % 400 == 0))\n      d = 1;\n    if ((y > 2) && (n % 100 != 0) && (n % 4 == 0))\n      d = 1;\n    d = d + r;\n    y--;\n    switch (y) {\n    case 11:\n      d = d + 30;\n    case 10:\n      d = d + 31;\n    case 9:\n      d = d + 30;\n    case 8:\n      d = d + 31;\n    case 7:\n      d = d + 31;\n    case 6:\n      d = d + 30;\n    case 5:\n      d = d + 31;\n    case 4:\n      d = d + 30;\n    case 3:\n      d = d + 31;\n    case 2:\n      d = d + 28;\n    case 1:\n      d = d + 31;\n    }\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19521", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, mon, day;\n  scanf(\"%d %d %d\", &year, &mon, &day);\n\n  int re;\n  if ((year % 4 == 0 && year % 400 == 0 && year % 100 == 0) ||\n      (year % 4 == 0 && year % 100 != 0)) {\n\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 29 + day;\n      break;\n    case 4:\n      re = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else\n\n  {\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 28 + day;\n      break;\n    case 4:\n      re = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "11", "index": "19522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int day = 0;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++)\n      day += a[i];\n\n    day += date;\n  } else {\n    int b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++)\n      day += b[i];\n    day += date;\n  }\n  cout << day << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, leap, num = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> date;\n\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  } else {\n    if (year % 4 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n\n  int i;\n  switch (leap) {\n  case 1:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    if (month >= 3)\n      num = num + date + 1;\n    else\n      num = num + date;\n    break;\n  case 0:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    num = num + date;\n  }\n\n  printf(\"%d\", num);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19524", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int day, month, year;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 29;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 29 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 29 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 29 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    }\n  } else {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 28;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 28 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 28 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 28 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    }\n  }\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, x, i, sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &x);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    int d[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  } else {\n    int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19526", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int mun, day, year, i;\n  int days = 0;\n  cin >> year >> mun >> day;\n  days += day;\n  for (i = 1; i < mun; i++) {\n    days += a[i];\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      days += 1;\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, run = 0, M[13], i, D;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  D = d;\n  if ((y % 400 == 0) || ((y % 100 != 0) && (y % 4 == 0))) {\n    run = 1;\n  } else\n    run = 0;\n  for (i = 1; i < 13; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      M[i] = 31;\n      break;\n    default:\n      M[i] = 30;\n    }\n  }\n  if (run == 1) {\n    M[2] = 29;\n  } else\n    M[2] = 28;\n  for (i = 1; i < m; i++) {\n    D = D + M[i];\n  }\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  int n, i;\n  n = 0;\n  for (i = 1; i < m; i++)\n    n = n + a[i];\n  n = n + d;\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, date,\n      count = 0, day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> date;\n  for (i = 1; i < month; i++)\n    count += day[i];\n  count += date;\n  if (month > 2)\n    if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)))\n      count++;\n  cout << count;\n  return 0;\n}\n"}
{"label": "11", "index": "19530", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    cin >> a >> b >> c;\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else {\n          d = d + 28;\n        }\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j = j + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19531", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            month2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            day, month, number = 0, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    for (i = 0; i < month; i++)\n      number += month2[i];\n    number += day;\n  } else {\n    for (i = 0; i < month; i++) {\n      number += month1[i];\n    }\n    number += day;\n  }\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19532", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum, jan = 31, feb, mar = 31, apr = 30, may = 31, jun = 30,\n                    jul = 31, aug = 31, sep = 30, oct = 31, nov = 30;\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    feb = 29;\n  else\n    feb = 28;\n  switch (m) {\n  case 1:\n    sum = d;\n    break;\n  case 2:\n    sum = jan + d;\n    break;\n  case 3:\n    sum = jan + feb + d;\n    break;\n  case 4:\n    sum = jan + feb + mar + d;\n    break;\n  case 5:\n    sum = jan + feb + mar + apr + d;\n    break;\n  case 6:\n    sum = jan + feb + mar + apr + may + d;\n    break;\n  case 7:\n    sum = jan + feb + mar + apr + may + jun + d;\n    break;\n  case 8:\n    sum = jan + feb + mar + apr + may + jun + jul + d;\n    break;\n  case 9:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + d;\n    break;\n  case 10:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + d;\n    break;\n  case 11:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + d;\n    break;\n  case 12:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + nov + d;\n    break;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int s = 0;\n  int i;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if ((year % 400 == 0) || ((year % 100 != 0) & (year % 4 == 0))) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    mon[1] = 29;\n  else if (y % 400 == 0) {\n    mon[1] = 29;\n  } else\n    mon[1] = 28;\n\n  for (i = 0; i < m - 1; i++) {\n    x += mon[i];\n  }\n  x = x + d;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, y, m, d, D;\n  int total = 0;\n\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    } else {\n      if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  D = total + d;\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "19536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, m, n;\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || a % 4 == 0 && a % 100 != 0) {\n    m = 29;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    m = 28;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  int i = 0;\n  int n[12];\n  sum = 0;\n  cin >> y >> m >> d;\n\n  if ((y % 4 == 0) && (y % 100 != 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 != 0)) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 == 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if (y % 4 != 0) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++)\n      sum = sum + n[i];\n\n    sum = sum + d;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19538", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, number = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i <= m - 1; i++)\n      number = number + b[i - 1];\n    number = number + d;\n  } else {\n    for (i = 1; i <= m - 1; i++)\n      number = number + a[i - 1];\n    number = number + d;\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "19539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, s;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int a;\n  if (x % 4 == 0)\n    if (x % 100 == 0)\n      if (x % 400 == 0)\n        a = 29;\n      else\n        a = 28;\n    else\n      a = 29;\n  else\n    a = 28;\n  if (y == 1 || y == 2) {\n    s = (y - 1) * 31 + z;\n  } else if (y == 3 || y == 7 || y == 5) {\n    s = (y - 1) / 2 * 31 + (y - 3) / 2 * 30 + a + z;\n  } else if (y == 4 || y == 6) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  } else if (y == 9 || y == 11) {\n    s = (y + 1) / 2 * 31 + (y - 5) / 2 * 30 + a + z;\n  } else if (y == 8 || y == 10 || y == 12) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, num;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    num = d;\n    break;\n  case 2:\n    num = 31 + d;\n    break;\n  case 3:\n    num = 59 + d;\n    break;\n  case 4:\n    num = 90 + d;\n    break;\n  case 5:\n    num = 120 + d;\n    break;\n  case 6:\n    num = 151 + d;\n    break;\n  case 7:\n    num = 181 + d;\n    break;\n  case 8:\n    num = 212 + d;\n    break;\n  case 9:\n    num = 243 + d;\n    break;\n  case 10:\n    num = 273 + d;\n    break;\n  case 11:\n    num = 304 + d;\n    break;\n  case 12:\n    num = 334 + d;\n    break;\n  }\n  if (((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) && (m > 2))\n    num = num + 1;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], l[5] = {0}, i = 0;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  }\n  for (i = 0; i < 5; i++) {\n    if ((year[i] % 4 == 0) && (year[i] % 100 != 0) || (year[i] % 400 == 0)) {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 29;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    } else {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 28;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    }\n    l[i] = l[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", l[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "19542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month,\n      monthd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day,\n      di = 0, i;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    di = di + monthd[i - 1];\n  }\n  di = di + day;\n  if ((year % 4) != 0 || (year % 400) != 0) {\n    printf(\"%d\\n\", di);\n  } else {\n    cout << di + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, m, d, result = 0;\n  scanf(\"%d%d%d\", &year, &m, &d);\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      result += 31;\n    else if (i == 2) {\n      if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)\n        result += 29;\n      else\n        result += 28;\n    } else\n      result += 30;\n  }\n  result += d;\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19544", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int z = 1;\n  while (z <= 5) {\n    cin >> year >> month >> day;\n    int n = 0;\n    int i;\n    for (i = 1; i < month; i++) {\n      n = n + days[i];\n    }\n    n = n + day;\n    if (month > 2 && isleapyear(year))\n      n++;\n    printf(\"%d\\n\", n);\n    z++;\n  }\n}\n"}
{"label": "11", "index": "19545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, daynum = 0, i;\n  cin >> year >> month >> day;\n  int month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int judgeleap;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month2[i];\n    }\n  } else {\n    for (i = 0; i < month - 1; i++)\n      daynum += month1[i];\n  }\n  daynum = daynum + day;\n  cout << daynum;\n  return 0;\n}\n"}
{"label": "11", "index": "19546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int month[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                          {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\nint main() {\n  int i, leap = 0, y, m, d, ans = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n    leap = 1;\n  for (i = 1; i < m; i++)\n    ans += month[leap][i];\n  ans += d;\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, e, i;\n  int d = 0;\n\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int score[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  } else {\n    int score[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  }\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int y) {\n  int i;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        return (1);\n      else\n        return (0);\n    } else\n      return (1);\n  } else\n    return (0);\n}\nint main() {\n  int y, m, d, n, i;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 30;\n  n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (f(y) == 0)\n    a[2] = 28;\n  if (f(y) == 1)\n    a[2] = 29;\n  for (i = 1; i < m; i++)\n    n = a[i] + n;\n  n = n + d;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zz[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0))\n    cout << zz[m - 1] + d << endl;\n  else {\n    if (m <= 2)\n      cout << zz[m - 1] + d << endl;\n    else\n      cout << zz[m - 1] + d + 1 << endl;\n  }\n}\n"}
{"label": "11", "index": "19550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], sum[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < 5; i++) {\n    switch (b[i]) {\n    case 1:\n      sum[i] = 0;\n      break;\n    case 2:\n      sum[i] = 31;\n      break;\n    case 3:\n      sum[i] = 59;\n      break;\n    case 4:\n      sum[i] = 90;\n      break;\n    case 5:\n      sum[i] = 120;\n      break;\n    case 6:\n      sum[i] = 151;\n      break;\n    case 7:\n      sum[i] = 181;\n      break;\n    case 8:\n      sum[i] = 212;\n      break;\n    case 9:\n      sum[i] = 243;\n      break;\n    case 10:\n      sum[i] = 273;\n      break;\n    case 11:\n      sum[i] = 304;\n      break;\n    case 12:\n      sum[i] = 334;\n      break;\n    }\n    sum[i] = sum[i] + c[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) && b[i] > 2)\n      sum[i] = sum[i] + 1;\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "19551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i;\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d\", &y);\n  scanf(\"%d\", &m);\n  scanf(\"%d\", &d);\n  if ((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))\n    for (i = 0; i < m - 1; i++)\n      x = x + a[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      x = x + b[i];\n  x = x + d;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "19552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if (((x % 4 == 0) && (x % 100 != 0)) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  int z, i = 0, sum = 0;\n  int a[12], b[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  z = f(year);\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1) {\n    n = day;\n  } else if (month == 2) {\n    n = 31 + day;\n  } else if ((year % 4 != 0 || year % 100 == 0) && year % 400 != 0) {\n    if (month < 8) {\n      if (month % 2 == 0) {\n        n = 31 * (month - 1) - 2 - month / 2 + day;\n      } else\n        n = 31 * (month - 1) - 2 - (month - 1) / 2 + day;\n    } else if (month % 2 == 0) {\n      n = 31 * 4 + 28 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n    } else\n      n = 31 * 4 + 28 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  } else if (month < 8) {\n    if (month % 2 == 0) {\n      n = 31 * (month - 1) - 1 - month / 2 + day;\n    } else\n      n = 31 * (month - 1) - 1 - (month - 1) / 2 + day;\n  } else if (month % 2 == 0) {\n    n = 31 * 4 + 29 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n  } else\n    n = 31 * 4 + 29 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, f, i, sum = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  if (year % 4 == 0 && year % 100 != 0)\n    f = 1;\n  else if (year % 400 == 0)\n    f = 1;\n  else\n    f = 0;\n  for (i = 1; i < mon; i++) {\n    sum = sum + a[i - 1];\n  }\n  sum = sum + day;\n  if (f == 1 && mon > 2)\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19555", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s = 0, d = 0;\n  int i;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && ((a % 100) != 0)) || ((a % 400) == 0)) {\n    d = 1;\n  }\n\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) ||\n        (i == 12)) {\n      s = s + 31;\n    }\n    if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      s = s + 30;\n    }\n    if (i == 2) {\n      if (d == 0) {\n        s = s + 28;\n      }\n      if (d == 1) {\n        s = s + 29;\n      }\n    }\n  }\n  s = s + c;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint nian(int m) {\n  if ((m % 400 == 0) || ((m % 100 != 0) && (m % 4 == 0)))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, s = 0, n, y, r, a[12];\n  scanf(\"%d%d%d\", &n, &y, &r);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (nian(n))\n    a[1] = 29;\n  else {\n    a[1] = 28;\n  }\n  for (i = 0; i < y - 1; i++)\n    s += a[i];\n  s += r;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int a[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if ((year % 4 != 0) || ((year % 100 == 0) && (year % 400 != 0)))\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n\n  sum = sum + day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, p, n[5] = {0}, year[5], month[5], day[5],\n            days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d \", &year[i], &month[i], &day[i]);\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0) || year[i] % 400 == 0)\n      days[2] = 29;\n    else\n      days[2] = 28;\n    for (p = 0; p < month[i]; p++)\n      n[i] = n[i] + days[p];\n    n[i] = n[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    cout << n[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19559", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (z == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19560", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 60);\n    else if (b == 4)\n      printf(\"%d\", c + 91);\n    else if (b == 5)\n      printf(\"%d\", c + 121);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 182);\n    else if (b == 8)\n      printf(\"%d\", c + 213);\n    else if (b == 9)\n      printf(\"%d\", c + 244);\n    else if (b == 10)\n      printf(\"%d\", c + 274);\n    else if (b == 11)\n      printf(\"%d\", c + 305);\n    else\n      printf(\"%d\", c + 335);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 59);\n    else if (b == 4)\n      printf(\"%d\", c + 90);\n    else if (b == 5)\n      printf(\"%d\", c + 120);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 181);\n    else if (b == 8)\n      printf(\"%d\", c + 212);\n    else if (b == 9)\n      printf(\"%d\", c + 243);\n    else if (b == 10)\n      printf(\"%d\", c + 273);\n    else if (b == 11)\n      printf(\"%d\", c + 304);\n    else\n      printf(\"%d\", c + 334);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19561", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, a, i, ans;\n  for (i = 1; i <= 5; i++) {\n    cin >> y >> m >> d;\n\n    if (y % 4 != 0)\n      a = 1;\n    else if (y % 100 != 0)\n      a = 0;\n    else if (y % 400 != 0)\n      a = 1;\n    else\n      a = 0;\n    if (a) {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 59 + d;\n        break;\n      case 4:\n        ans = 90 + d;\n        break;\n      case 5:\n        ans = 120 + d;\n        break;\n      case 6:\n        ans = 151 + d;\n        break;\n      case 7:\n        ans = 181 + d;\n        break;\n      case 8:\n        ans = 212 + d;\n        break;\n      case 9:\n        ans = 243 + d;\n        break;\n      case 10:\n        ans = 273 + d;\n        break;\n      case 11:\n        ans = 304 + d;\n        break;\n      case 12:\n        ans = 334 + d;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 60 + d;\n        break;\n      case 4:\n        ans = 91 + d;\n        break;\n      case 5:\n        ans = 121 + d;\n        break;\n      case 6:\n        ans = 152 + d;\n        break;\n      case 7:\n        ans = 182 + d;\n        break;\n      case 8:\n        ans = 213 + d;\n        break;\n      case 9:\n        ans = 244 + d;\n        break;\n      case 10:\n        ans = 274 + d;\n        break;\n      case 11:\n        ans = 305 + d;\n        break;\n      case 12:\n        ans = 335 + d;\n        break;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n}\n"}
{"label": "11", "index": "19562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    y = c;\n    break;\n  case 2:\n    y = 31 + c;\n    break;\n  case 3:\n    y = 59 + c;\n    break;\n  case 4:\n    y = 90 + c;\n    break;\n  case 5:\n    y = 120 + c;\n    break;\n  case 6:\n    y = 151 + c;\n    break;\n  case 7:\n    y = 181 + c;\n    break;\n  case 8:\n    y = 212 + c;\n    break;\n  case 9:\n    y = 243 + c;\n    break;\n  case 10:\n    y = 273 + c;\n    break;\n  case 11:\n    y = 304 + c;\n    break;\n  case 12:\n    y = 334 + c;\n  }\n  cout << \"\\n\" << y;\n  return 0;\n}\n"}
{"label": "11", "index": "19563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0)\n    return 1;\n  if (n % 400 == 0)\n    return 1;\n  return 0;\n}\nint yue(int y, int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (run(y) == 1 && n == 2)\n    return 29;\n  if (run(y) == 0 && n == 2)\n    return 28;\n  return 30;\n}\nint days(int y, int m, int d) {\n  int k = 0;\n  for (int i = 1; i < m; i++)\n    k += yue(y, i);\n  k += d;\n  return k;\n}\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  printf(\"%d\", days(y, m, d));\n  return 0;\n}\n"}
{"label": "11", "index": "19564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, i, d, s = 0;\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) {\n    for (i = 0; i < m; i++)\n      s += a[1][i];\n    s += d;\n  } else {\n    for (i = 0; i < m; i++)\n      s += a[0][i];\n    s += d;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, days;\n  cin >> year >> month >> day;\n  if (month == 1)\n    days = day;\n  else if (month == 2)\n    days = day + 31;\n  else if (month == 3)\n    days = day + 59;\n  else if (month == 4)\n    days = day + 90;\n  else if (month == 5)\n    days = day + 120;\n  else if (month == 6)\n    days = day + 151;\n  else if (month == 7)\n    days = day + 181;\n  else if (month == 8)\n    days = day + 212;\n  else if (month == 9)\n    days = day + 243;\n  else if (month == 10)\n    days = day + 273;\n  else if (month == 11)\n    days = day + 304;\n  else if (month == 12)\n    days = day + 334;\n  if (year % 100 == 0, year % 400 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      cout << days + 1;\n  } else if (year % 400 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, n;\n  int m = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        n = 29;\n      else\n        n = 28;\n    else\n      n = 29;\n  else\n    n = 28;\n  if (month == 1) {\n    printf(\"%d\", day);\n    return 0;\n  }\n  if (month == 2) {\n    m = 31 + day;\n    cout << m;\n    return 0;\n  }\n  if (month == 3) {\n    m = 31 + n + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 4) {\n    m = 31 + n + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 5) {\n    m = 31 + n + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 6) {\n    m = 31 + n + 31 + 30 + 31 + day;\n    cout << m;\n    return 0;\n  }\n  if (month == 7) {\n    m = 31 + n + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 8) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 9) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 10) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 11) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 12) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k;\n  if (a % 100 == 0 && a % 400 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    cout << k + c;\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else {\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  }\n}\n"}
{"label": "11", "index": "19568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z, k = 0, i;\n  scanf(\"%d %d %d \", &x, &y, &z);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    for (i = 0; i < y - 1; i++)\n      k = k + b[i];\n  else\n    for (i = 0; i < y - 1; i++)\n      k = k + a[i];\n  k = k + z;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "19569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, n = 0, i, num = 0;\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n = n + B[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      n = n + A[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  cin >> y >> m >> d;\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 29 + d;\n      break;\n    case 4:\n      i = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n\n  } else {\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 28 + d;\n      break;\n    case 4:\n      i = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", i);\n  return 0;\n}\n"}
{"label": "11", "index": "19571", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, sum, a[13];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  sum = day;\n  for (int i = 1; i < month; i++)\n    sum = sum + a[i];\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, A, B, a;\n  scanf(\"%d%d%d\", &N, &A, &B);\n  if (N % 100 != 0 && N % 4 == 0 || N % 400 == 0) {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n  } else {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n    a += B;\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 60 + day;\n      break;\n    case 4:\n      n = 91 + day;\n      break;\n    case 5:\n      n = 121 + day;\n      break;\n    case 6:\n      n = 152 + day;\n      break;\n    case 7:\n      n = 182 + day;\n      break;\n    case 8:\n      n = 213 + day;\n      break;\n    case 9:\n      n = 244 + day;\n      break;\n    case 10:\n      n = 274 + day;\n      break;\n    case 11:\n      n = 305 + day;\n      break;\n    case 12:\n      n = 335 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 30 + day;\n      break;\n    case 3:\n      n = 59 + day;\n      break;\n    case 4:\n      n = 90 + day;\n      break;\n    case 5:\n      n = 120 + day;\n      break;\n    case 6:\n      n = 151 + day;\n      break;\n    case 7:\n      n = 181 + day;\n      break;\n    case 8:\n      n = 212 + day;\n      break;\n    case 9:\n      n = 243 + day;\n      break;\n    case 10:\n      n = 273 + day;\n      break;\n    case 11:\n      n = 304 + day;\n      break;\n    case 12:\n      n = 334 + day;\n      break;\n    }\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  cin >> n >> m >> d;\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1 && (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0)) {\n      counter++;\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  cout << counter;\n}\n"}
{"label": "11", "index": "19575", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 29;\n    }\n    x = x + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 28;\n    }\n    x = x + d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int day = 0, y, m, d, i,\n      month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))\n    month[2] = 29;\n  for (i = 1; i < m; i++)\n    day += month[i];\n  day += d;\n  cout << day;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if ((a % 4 == 0) && (a % 100 == 0) && (a % 400 == 0)) {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 29 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 29 + 31 + c);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 28 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 28 + 31 + c);\n      break;\n    }\n    case 5: {\n      cout << 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, d;\n  int month = 1, day = 1, lunar = 0, days = 1;\n  cin >> year >> mon >> d;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    lunar = 1;\n  while ((mon != month) || (d != day)) {\n    day++;\n    days++;\n    if ((day == 32) &&\n        ((month == 1) || (month == 3) || (month == 5) || (month == 7) ||\n         (month == 8) || (month == 10) || (month == 12))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 31) &&\n        ((month == 4) || (month == 6) || (month == 9) || (month == 11))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 30) && (month == 2) && (lunar == 1)) {\n      month++;\n      day = 1;\n    }\n    if ((day == 29) && (month == 2) && (lunar == 0)) {\n      month++;\n      day = 1;\n    }\n  }\n  cout << days << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint r(int x) {\n  if (x % 4 != 0 || (x % 100 == 0 && x % 400 != 0))\n    return (0);\n  else\n    return (1);\n}\n\nint main() {\n  int m, y, i, d, s;\n  cin >> m >> y >> d;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n\n  if (r(m) == 1)\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (s = 0, i = 1; i < y; i++) {\n    s = s + a[i];\n  }\n\n  s = s + d;\n\n  printf(\"%d\", s);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 29;\n      break;\n    case 4:\n      n = d + 31 * 2 + 29;\n      break;\n    case 5:\n      n = d + 29 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 29 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 29 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 29 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 29 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 29 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 29 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 29 + 31 * 6 + 30 * 4;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 28;\n      break;\n    case 4:\n      n = d + 31 * 2 + 28;\n      break;\n    case 5:\n      n = d + 28 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 28 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 28 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 28 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 28 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 28 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 28 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 28 + 31 * 6 + 30 * 4;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19581", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int total = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) \n  {\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= month - 1; i++) {\n      total = total + a[i - 1];\n    }\n    total = total + day;\n\n  } else {\n    int b[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int j = 1; j <= month - 1; j++) {\n      total = total + b[j - 1];\n    }\n    total = total + day;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19582", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, a, i, ans;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d%d%d\", &y, &m, &d);\n\n    if (y % 4 != 0)\n      a = 1;\n    else if (y % 100 != 0)\n      a = 0;\n    else if (y % 400 != 0)\n      a = 1;\n    else\n      a = 0;\n    if (a) {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 59 + d;\n        break;\n      case 4:\n        ans = 90 + d;\n        break;\n      case 5:\n        ans = 120 + d;\n        break;\n      case 6:\n        ans = 151 + d;\n        break;\n      case 7:\n        ans = 181 + d;\n        break;\n      case 8:\n        ans = 212 + d;\n        break;\n      case 9:\n        ans = 243 + d;\n        break;\n      case 10:\n        ans = 273 + d;\n        break;\n      case 11:\n        ans = 304 + d;\n        break;\n      case 12:\n        ans = 334 + d;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 60 + d;\n        break;\n      case 4:\n        ans = 91 + d;\n        break;\n      case 5:\n        ans = 121 + d;\n        break;\n      case 6:\n        ans = 152 + d;\n        break;\n      case 7:\n        ans = 182 + d;\n        break;\n      case 8:\n        ans = 213 + d;\n        break;\n      case 9:\n        ans = 244 + d;\n        break;\n      case 10:\n        ans = 274 + d;\n        break;\n      case 11:\n        ans = 305 + d;\n        break;\n      case 12:\n        ans = 335 + d;\n        break;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n}\n"}
{"label": "11", "index": "19583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    }\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 29 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 29 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 28 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 28 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  }\n  printf(\"\\n\");\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  if (b == 1)\n    n = c;\n  else if (b == 2)\n    n = c + 31;\n  else if (b == 3)\n    n = 31 + d + c;\n  else if (b == 4)\n    n = 62 + d + c;\n  else if (b == 5)\n    n = 92 + d + c;\n  else if (b == 6)\n    n = 123 + d + c;\n  else if (b == 7)\n    n = 153 + d + c;\n  else if (b == 8)\n    n = 184 + d + c;\n  else if (b == 9)\n    n = 215 + c + d;\n  else if (b == 10)\n    n = 245 + c + d;\n  else if (b == 11)\n    n = 276 + c + d;\n  else if (b == 12)\n    n = 306 + c + d;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i, j;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    j = i - 1;\n    sum = sum + monthday[j];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0))\n    sum = sum + 1;\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 29 + d;\n      break;\n    case 4:\n      i = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n\n  } else {\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 28 + d;\n      break;\n    case 4:\n      i = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", i);\n  return 0;\n}\n"}
{"label": "11", "index": "19588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int sum = 0, i;\n  for (i = 0; i < b - 1; i++) {\n    sum = sum + f[i];\n  }\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n\n    if (b < 3) {\n      d = sum + c;\n    } else {\n      d = sum + 1 + c;\n    }\n  } else {\n    d = sum + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, x;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    x = day;\n    break;\n  case 2:\n    x = 31 + day;\n    break;\n  case 3:\n    x = 31 + 28 + day;\n    break;\n  case 4:\n    x = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    x = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    x = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        if (month >= 3) {\n          printf(\"%d\", x + 1);\n        } else {\n          printf(\"%d\", x);\n        }\n      else\n        printf(\"%d\", x);\n    else if (month >= 3) {\n      printf(\"%d\", x + 1);\n    } else {\n      printf(\"%d\", x);\n    }\n  else\n    printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int s = 0;\n  int i;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 100 != 0) & (year % 4 == 0))) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19591", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, f, i, sum = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> mon >> day;\n  if (year % 4 == 0 && year % 100 != 0)\n    f = 1;\n  else if (year % 400 == 0) {\n    f = 1;\n  } else\n    f = 0;\n  for (i = 1; i < mon; i++) {\n    sum = sum + a[i - 1];\n  }\n  sum = sum + day;\n  if (f == 1 && mon > 2)\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19592", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, leap, num = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &date);\n\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  } else {\n    if (year % 4 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n\n  int i;\n  switch (leap) {\n  case 1:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    if (month >= 3)\n      num = num + date + 1;\n    else\n      num = num + date;\n    break;\n  case 0:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    num = num + date;\n  }\n\n  printf(\"%d\", num);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int daysa[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int daysb[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  int num = 0;\n  cin >> y >> m >> d;\n  int i;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysa[i - 1];\n    }\n    num = num + d;\n  } else {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysb[i - 1];\n    }\n    num = num + d;\n  }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int year, int month, int day) {\n  int result = 0;\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  return result;\n}\nint main() {\n  int year, month, day, Y;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  Y = DiJiTian(year, month, day);\n  cout << Y;\n  return 0;\n}\n"}
{"label": "11", "index": "19595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0, i;\n  cin >> y >> m >> d;\n  if (m == 1) {\n    t += d;\n  } else if (m == 2) {\n    t += 31 + d;\n  } else if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 29;\n      }\n    }\n    t = t + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 28;\n      }\n    }\n    t = t + d;\n  }\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "19596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, k, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0)\n    k = 1;\n  else if (year % 100 == 0)\n    k = 0;\n  else if (year % 4 == 0)\n    k = 1;\n  else\n    k = 0;\n  if (k == 1)\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n  sum += day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    default:\n      d = 0;\n    }\n  else\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    default:\n      d = 0;\n    }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    a[1] = 29;\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  } else {\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  }\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19599", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, k, sum = 0;\n  cin >> year >> month >> day;\n  if (year % 400 == 0) \n    k = 1;\n  else if (year % 100 == 0)\n    k = 0;\n  else if (year % 4 == 0)\n    k = 1;\n  else\n    k = 0;\n  if (k == 1)\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n  sum += day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n\n    for (int i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 ||\n          i == 12) {\n        t += 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t += 30;\n      } else {\n        t += 29;\n      }\n    }\n  } else {\n    for (int j = 1; j < b; j++) {\n      if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 ||\n          j == 12) {\n        t += 31;\n      } else {\n        if (j == 4 || j == 6 || j == 9 || j == 11) {\n          t += 30;\n        } else {\n          t += 28;\n        }\n      }\n    }\n  }\n  t = t + c;\n\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "19601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int x;\n  int Jan = 1, feb = 2, Mar = 3, Apr = 4, May = 5, Jun = 6;\n  int Jul = 7, Aug = 8, Sep = 9, Oct = 10, Nov = 11, Dec = 12;\n  int Feb;\n  {\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          Feb = 29;\n        else\n          Feb = 28;\n      } else\n        Feb = 29;\n    } else\n      Feb = 28;\n  }\n  if (month == Jan)\n    x = day;\n  if (month == feb)\n    x = 31 + day;\n  if (month == Mar)\n    x = 31 + Feb + day;\n  if (month == Apr)\n    x = 31 + Feb + 31 + day;\n  if (month == May)\n    x = 31 + Feb + 31 + 30 + day;\n  if (month == Jun)\n    x = 31 + Feb + 31 + 30 + 31 + day;\n  if (month == Jul)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + day;\n  if (month == Aug)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == Sep)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == Oct)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == Nov)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == Dec)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int ye, mo, da, i, sum = 0;\n  int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> ye >> mo >> da;\n\n  for (i = 1; i < mo; i++) {\n    sum = sum + mon[i];\n  }\n  if (((ye % 400 == 0) && mo > 2) ||\n      ((ye % 4 == 0) && (ye % 100 != 0)) && mo > 2) {\n    sum = sum + da + 1;\n  } else {\n    sum = sum + da;\n  }\n\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 60 + d);\n      break;\n    case 4:\n      printf(\"%d\", 91 + d);\n      break;\n    case 5:\n      printf(\"%d\", 121 + d);\n      break;\n    case 6:\n      printf(\"%d\", 152 + d);\n      break;\n    case 7:\n      printf(\"%d\", 182 + d);\n      break;\n    case 8:\n      printf(\"%d\", 213 + d);\n      break;\n    case 9:\n      printf(\"%d\", 244 + d);\n      break;\n    case 10:\n      printf(\"%d\", 274 + d);\n      break;\n    case 11:\n      printf(\"%d\", 305 + d);\n      break;\n    case 12:\n      printf(\"%d\", 335 + d);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 59 + d);\n      break;\n    case 4:\n      printf(\"%d\", 90 + d);\n      break;\n    case 5:\n      printf(\"%d\", 120 + d);\n      break;\n    case 6:\n      printf(\"%d\", 151 + d);\n      break;\n    case 7:\n      printf(\"%d\", 181 + d);\n      break;\n    case 8:\n      printf(\"%d\", 212 + d);\n      break;\n    case 9:\n      printf(\"%d\", 243 + d);\n      break;\n    case 10:\n      printf(\"%d\", 273 + d);\n      break;\n    case 11:\n      printf(\"%d\", 304 + d);\n      break;\n    case 12:\n      printf(\"%d\", 334 + d);\n      break;\n    }\n  }\n}\n"}
{"label": "11", "index": "19604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, date;\n  int a, b, c, e, g, h, j;\n  int d, f, i, k;\n\n  a = c = e = g = h = j = 31;\n  d = f = i = k = 30;\n\n  scanf(\"%d%d%d\", &year, &month, &date);\n\n  if ((year % 4 != 0) || (year % 100 == 0 && year % 400 != 0))\n    b = 28;\n  else\n    b = 29;\n\n  switch (month) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = a + date;\n    break;\n  case 3:\n    day = a + b + date;\n    break;\n  case 4:\n    day = a + b + c + date;\n    break;\n  case 5:\n    day = a + b + c + d + date;\n    break;\n  case 6:\n    day = a + b + c + d + e + date;\n    break;\n  case 7:\n    day = a + b + c + d + e + f + date;\n    break;\n  case 8:\n    day = a + b + c + d + e + f + g + date;\n    break;\n  case 9:\n    day = a + b + c + d + e + f + g + h + date;\n    break;\n  case 10:\n    day = a + b + c + d + e + f + g + h + i + date;\n    break;\n  case 11:\n    day = a + b + c + d + e + f + g + h + i + j + date;\n    break;\n  case 12:\n    day = a + b + c + d + e + f + g + h + i + j + k + date;\n    break;\n  }\n\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  int a, b, c;\n  int amount = 0;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m > 2) {\n    a = f(y);\n    if (a == 1)\n      p[1] = p[1] + 1;\n    for (int i = 0; i < m - 1; i++) {\n      amount = amount + p[i];\n    }\n    amount = amount + d;\n  } else if (m == 1)\n    amount = d;\n  else if (m == 2)\n    amount = 31 + d;\n  printf(\"%d\", amount);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19606", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, num = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0)\n      a[2] = 28;\n    else if (year % 400 == 0)\n      a[2] = 29;\n    else\n      a[2] = 29;\n  } else\n    a[2] = 28;\n  for (i = 1; i < month; i++)\n    num = num + a[i];\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  long int year[5], month[5], day[5], t[5];\n  long int c[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},\n           b[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  for (i = 0; i <= 4; i++) {\n    cin >> year[i] >> month[i] >> day[i];\n    if (year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0)\n      t[i] = c[month[i] - 1] + day[i];\n    else {\n      t[i] = b[month[i] - 1] + day[i];\n    }\n  }\n  for (i = 0; i <= 4; i++)\n    cout << t[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, n;\n  scanf(\"%d\", &y);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    cin >> m >> d;\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 29 + d;\n    }\n    if (m == 4) {\n      n = 31 + 29 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 29 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 29 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    cout << n;\n\n  } else {\n    scanf(\"%d%d\", &m, &d);\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 28 + d;\n    }\n    if (m == 4) {\n      n = 31 + 28 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 28 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 28 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int day, month, year;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 29;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 29 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 29 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 29 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    }\n  } else {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 28;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 28 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 28 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 28 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    }\n  }\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, number = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i <= m - 1; i++)\n      number = number + b[i - 1];\n    number = number + d;\n  } else {\n    for (i = 1; i <= m - 1; i++) {\n      number = number + a[i - 1];\n    }\n    number = number + d;\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "19611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, i, x;\n  x = 0;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  for (i = 1; i < mon; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      x = x + 30;\n\n    if (i == 2) {\n      if (year % 400 == 0) {\n        x = x + 29;\n      } else if (year % 4 == 0 && year % 100 != 0) {\n        x = x + 29;\n      } else {\n        x = x + 28;\n      }\n    }\n  }\n  x = x + day;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "19612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, s = 0, d = 0;\n  int i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && ((a % 100) != 0)) || ((a % 400) == 0)) {\n    d = 1;\n  }\n\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) ||\n        (i == 12)) {\n      s = s + 31;\n    }\n    if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      s = s + 30;\n    }\n    if (i == 2) {\n      if (d == 0) {\n        s = s + 28;\n      }\n      if (d == 1) {\n        s = s + 29;\n      }\n    }\n  }\n  s = s + c;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int y, month, d, sum = 0;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> month >> d;\n  m[2] = m[2] + leap(y);\n  for (int i = 0; i < month; i++) {\n    sum = sum + m[i];\n  }\n  sum = sum + d;\n  cout << sum << endl;\n  return 0;\n}\nint leap(int n) {\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, D;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  D = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || ((y % 400) == 0)) {\n    for (i = 0; i < m - 1; i++)\n      D = D + p[i];\n\n    D = D + d + 1;\n    printf(\"%d\", D);\n  } else {\n    for (i = 0; i < m - 1; i++)\n      D = D + p[i];\n\n    D = D + d;\n    cout << D;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int just(int y);\n\n  int y, m, d, t = 0;\n\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (just(y) == 1) {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += b[i];\n\n  } else {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++) {\n        t += a[i];\n      }\n  }\n  cout << t + d;\n\n  return 0;\n}\n\nint just(int y) {\n  int m = 0;\n\n  if (y % 4 == 0 && y % 100 != 0)\n    return 1;\n\n  if (y % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) ||\n      (year % 100 == 0 && year % 400 == 0)) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, mon, day, i;\n  int total = 0;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n\n  } else {\n    int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n  }\n  total += day;\n  printf(\"%d\", total);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19618", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4) == 0 && a % 100 != 0 || (a % 400) == 0) {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 29 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 29 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  } else\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 28 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 28 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "19619", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int d[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++) {\n      day = day + d[i];\n    }\n\n  } else {\n    int d[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++) {\n      day = day + d[i];\n    }\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 59 + c;\n    else if (b == 4)\n      s = 90 + c;\n    else if (b == 5)\n      s = 120 + c;\n    else if (b == 6)\n      s = 151 + c;\n    else if (b == 7)\n      s = 181 + c;\n    else if (b == 8)\n      s = 212 + c;\n    else if (b == 9)\n      s = 243 + c;\n    else if (b == 10)\n      s = 273 + c;\n    else if (b == 11)\n      s = 304 + c;\n    else if (b == 12)\n      s = 334 + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 60 + c;\n    else if (b == 4)\n      s = 91 + c;\n    else if (b == 5)\n      s = 121 + c;\n    else if (b == 6)\n      s = 152 + c;\n    else if (b == 7)\n      s = 182 + c;\n    else if (b == 8)\n      s = 213 + c;\n    else if (b == 9)\n      s = 244 + c;\n    else if (b == 10)\n      s = 274 + c;\n    else if (b == 11)\n      s = 305 + c;\n    else if (b == 12)\n      s = 335 + c;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[6], month[6], day[6], s[6] = {0};\n  int i = 1, n;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  n = 1;\n  while (n <= 5) {\n    scanf(\"%d %d %d\", &year[n], &month[n], &day[n]);\n    if ((year[n] % 4 == 0 && year[n] % 100 != 0) || year[n] % 400 == 0)\n      m[2] = 29;\n    else\n      m[2] = 28;\n    while (i < month[n]) {\n      s[n] = s[n] + m[i];\n      i = i + 1;\n    }\n    s[n] = s[n] + day[n];\n    n = n + 1;\n    i = 1;\n  }\n  for (n = 1; n <= 5; n = n + 1)\n    printf(\"%d\\n\", s[n]);\n  return 0;\n}\n"}
{"label": "11", "index": "19623", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nlong total;\n\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  }\n  if (n % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int year, month, day;\n  int i;\n  while (cin >> year >> month >> day) {\n    total = 0;\n    if (run(year)) {\n\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 60 + day;\n        break;\n      case 4:\n        total += 91 + day;\n        break;\n      case 5:\n        total += 121 + day;\n        break;\n      case 6:\n        total += 152 + day;\n        break;\n      case 7:\n        total += 182 + day;\n        break;\n      case 8:\n        total += 213 + day;\n        break;\n      case 9:\n        total += 244 + day;\n        break;\n      case 10:\n        total += 274 + day;\n        break;\n      case 11:\n        total += 305 + day;\n        break;\n      case 12:\n        total += 335 + day;\n        break;\n      }\n    } else {\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 59 + day;\n        break;\n      case 4:\n        total += 90 + day;\n        break;\n      case 5:\n        total += 120 + day;\n        break;\n      case 6:\n        total += 151 + day;\n        break;\n      case 7:\n        total += 181 + day;\n        break;\n      case 8:\n        total += 212 + day;\n        break;\n      case 9:\n        total += 243 + day;\n        break;\n      case 10:\n        total += 273 + day;\n        break;\n      case 11:\n        total += 304 + day;\n        break;\n      case 12:\n        total += 334 + day;\n        break;\n      }\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19624", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else {\n    d = 28;\n  }\n  switch (b) {\n  case 1:\n    e = c;\n    break;\n  case 2:\n    e = 31 + c;\n    break;\n  case 3:\n    e = 31 + d + c;\n    break;\n  case 4:\n    e = 62 + d + c;\n    break;\n  case 5:\n    e = 92 + d + c;\n    break;\n  case 6:\n    e = 123 + d + c;\n    break;\n  case 7:\n    e = 153 + d + c;\n    break;\n  case 8:\n    e = 184 + d + c;\n    break;\n  case 9:\n    e = 215 + d + c;\n    break;\n  case 10:\n    e = 245 + d + c;\n    break;\n  case 11:\n    e = 276 + d + c;\n    break;\n  case 12:\n    e = 306 + d + c;\n    break;\n  }\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[3] = {0}, b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      sum = 0, i;\n  scanf(\"%d %d %d \", &a[0], &a[1], &a[2]);\n  if (a[0] % 4 == 0 && a[0] % 100 != 0 || a[0] % 400 == 0)\n    b[1] = 29;\n  for (i = 0; i < a[1] - 1; i++)\n    sum += b[i];\n  sum += a[2];\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "19626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, total = 0, i;\n  int mon[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                    {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 1; i < month; i++)\n      total += mon[1][i];\n    total += day;\n  } else {\n    for (i = 1; i < month; i++)\n      total += mon[0][i];\n    total += day;\n  }\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int yy, mm, dd, m = 0, days = 0;\n  scanf(\"%d%d%d\", &yy, &mm, &dd);\n  do {\n    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)\n      days = days + 31;\n    else if (m == 4 || m == 6 || m == 9 || m == 11)\n      days = days + 30;\n    else if ((((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0)) && m == 2)\n      days = days + 29;\n    else if ((yy % 4 != 0 || yy % 100 == 0) && m == 2)\n      days = days + 28;\n    m++;\n  } while (m < mm);\n  days = days + dd;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int daymonth[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                         31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int YEAR, MON, DAY, i, counter = 0;\n  scanf(\"%d %d %d \", &YEAR, &MON, &DAY);\n  for (i = 0; i < MON - 1; i++) {\n    counter += daymonth[leap(YEAR)][i];\n  }\n\n  counter += DAY;\n  cout << counter << endl;\n  return 0;\n}\nint leap(int YEAR) {\n  if ((YEAR % 4 == 0) && (YEAR % 100 != 0) || (YEAR % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "19629", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  int dd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n = 0;\n  int i;\n\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0))) {\n    dd[1] = 29;\n  }\n\n  for (i = 0; i < m - 1; i++) {\n    n = n + dd[i];\n  }\n\n  n = n + d;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, d1 = 0, d2, i;\n  int md[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> y >> m >> d;\n  if (m == 1)\n    d2 = d;\n  else {\n\n    for (i = 0; i < m - 1; i++)\n      d1 = d1 + md[i];\n    d2 = d + d1;\n  }\n  printf(\"%d\", d2);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19631", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 100 == 0 && y % 400 == 0)\n    n[1] = 29;\n  if (y % 100 != 0 && y & 4 == 0)\n    n[1] = 29;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++)\n    sum = sum + n[i];\n  printf(\"%d\\n\", sum + d);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19632", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 != 0) || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum, jan = 31, feb, mar = 31, apr = 30, may = 31, jun = 30,\n                    jul = 31, aug = 31, sep = 30, oct = 31, nov = 30;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    feb = 29;\n  else\n    feb = 28;\n  switch (m) {\n  case 1:\n    sum = d;\n    break;\n  case 2:\n    sum = jan + d;\n    break;\n  case 3:\n    sum = jan + feb + d;\n    break;\n  case 4:\n    sum = jan + feb + mar + d;\n    break;\n  case 5:\n    sum = jan + feb + mar + apr + d;\n    break;\n  case 6:\n    sum = jan + feb + mar + apr + may + d;\n    break;\n  case 7:\n    sum = jan + feb + mar + apr + may + jun + d;\n    break;\n  case 8:\n    sum = jan + feb + mar + apr + may + jun + jul + d;\n    break;\n  case 9:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + d;\n    break;\n  case 10:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + d;\n    break;\n  case 11:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + d;\n    break;\n  case 12:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + nov + d;\n    break;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e[12], i;\n  e[1] = e[3] = e[5] = e[7] = e[8] = e[10] = e[12] = 31;\n  e[2] = 28;\n  e[4] = e[6] = e[9] = e[11] = 30;\n  d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + e[i];\n    }\n    d = d + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      e[2] = 29;\n      d = d + e[i];\n    }\n    d = d + c;\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19635", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int n = 0;\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month; i++) {\n    n = days[i] + n;\n  }\n  n = day + n;\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    n++;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d \", &a[i], &b[i], &c[i]);\n\n  printf(\"319\");\n  cout << \"\\n\";\n  printf(\"32\");\n  printf(\"\\n\");\n  printf(\"61\");\n  printf(\"\\n\");\n  printf(\"60\");\n  printf(\"\\n\");\n  printf(\"1\");\n  return 0;\n}\n"}
{"label": "11", "index": "19637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, leap, sum = 0;\n  int a[12], i, j;\n  cin >> year;\n  cin >> month;\n  scanf(\"%d\", &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (leap == 1) {\n    a[1] = 29;\n  } else\n    a[1] = 28;\n  for (i = 0; i < 12; i++) {\n    if (month == i + 1) {\n      for (j = 0; j < i; j++)\n        sum += a[j];\n      sum += day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int monthday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (int i = 1; i < month; i++)\n    sum += monthday[i - 1];\n\n  sum += day;\n  if (month > 2 && (!year % 4 == 0 && year % 100 != 0 || year % 400 != 0)) {\n    sum -= 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s1 = 0, s2;\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    n[1] = 29;\n  for (i = 1; i < b; i++)\n    s1 = s1 + n[i - 1];\n  s2 = s1 + c;\n  cout << s2 << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19640", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint days_of_month[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                            {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n\nint is_leap_year(int year) {\n  if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int index = is_leap_year(year);\n  int days = 0;\n  for (int i = 0; i < month - 1; i++)\n    days += days_of_month[index][i];\n  days += day;\n  printf(\"%d\", days);\n}\n"}
{"label": "11", "index": "19641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, j, k, sum = 0, a;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i <= (m - 1); i++) {\n    if (i == 1)\n      sum = sum + 31;\n    if (i == 3)\n      sum = sum + 31;\n    if (i == 5)\n      sum = sum + 31;\n    if (i == 7)\n      sum = sum + 31;\n    if (i == 8)\n      sum = sum + 31;\n    if (i == 10)\n      sum = sum + 31;\n    if (i == 12)\n      sum = sum + 31;\n    if (i == 4)\n      sum = sum + 30;\n    if (i == 6)\n      sum = sum + 30;\n    if (i == 9)\n      sum = sum + 30;\n    if (i == 11)\n      sum = sum + 30;\n    if (i == 2) {\n      j = y % 4, k = y % 400, a = y % 100;\n      if ((a != 0 && j == 0) || (k == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    }\n  }\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int check(int a);\n  int count(int x[], int w, int y);\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  int k;\n  int sum;\n  k = check(year);\n  if (k == 1) {\n    int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days1, month, day);\n    printf(\"%d\", sum);\n  } else {\n    int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days2, month, day);\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n\nint check(int a) {\n  int b, c, d;\n  b = a % 4;\n  c = a % 100;\n  d = a % 400;\n  if (b != 0) {\n    return 1;\n  } else if (c == 0 && d != 0) {\n    return 1;\n  } else\n    return 0;\n}\n\nint count(int x[], int w, int y) {\n  int sum = 0;\n  int i;\n  for (i = 1; i < w; i++) {\n    sum = sum + x[i];\n  }\n  sum = sum + y;\n  return sum;\n}\n"}
{"label": "11", "index": "19643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w, s, i, year, month, day;\n  int ymd[5][3];\n  int num[5];\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\\n\", &year, &month, &day);\n    ymd[i][0] = year;\n    ymd[i][1] = month;\n    ymd[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = ymd[i][0];\n    month = ymd[i][1];\n    day = ymd[i][2];\n    w = (year % 4 == 0 && year % 100 != 0) || year % 400 != 0;\n    switch (month) {\n    case 1:\n      s = 0;\n      break;\n    case 2:\n      s = 31;\n      break;\n    case 3:\n      s = 59;\n      break;\n    case 4:\n      s = 90;\n      break;\n    case 5:\n      s = 120;\n      break;\n    case 6:\n      s = 151;\n      break;\n    case 7:\n      s = 181;\n      break;\n    case 8:\n      s = 212;\n      break;\n    case 9:\n      s = 243;\n      break;\n    case 10:\n      s = 273;\n      break;\n    case 11:\n      s = 304;\n      break;\n    case 12:\n      s = 334;\n      break;\n    }\n    if (w == 0 && month > 2)\n      s = s + 1;\n\n    num[i] = s + day;\n  }\n  cout << num[0] << \"\\n\"\n       << num[1] << \"\\n\"\n       << num[2] << \"\\n\"\n       << num[3] << \"\\n\"\n       << num[4] << \"\\n\";\n}\n"}
{"label": "11", "index": "19644", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum;\n  cin >> y >> m >> d;\n  if (m == 1)\n    sum = d;\n  if (m == 2)\n    sum = 31 + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m == 3)\n      sum = 31 + 29 + d;\n    if (m == 4)\n      sum = 31 + 29 + 31 + d;\n    if (m == 5)\n      sum = 31 + 29 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 29 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  } else {\n    if (m == 3)\n      sum = 31 + 28 + d;\n    if (m == 4)\n      sum = 31 + 28 + 31 + d;\n    if (m == 5)\n      sum = 31 + 28 + 31 + 30 + d;\n    if (m == 6)\n      sum = 31 + 28 + 31 + 30 + 31 + d;\n    if (m == 7)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    if (m == 8)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    if (m == 9)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    if (m == 10)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    if (m == 11)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    if (m == 12)\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, x, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n  x = 0;\n  for (i = 0; i < m - 1; i++)\n    x += a[i];\n  x += d;\n  cout << x;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 400 == 0) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 60 + c;\n    if (b == 4)\n      d = 91 + c;\n    if (b == 5)\n      d = 121 + c;\n    if (b == 6)\n      d = 152 + c;\n    if (b == 7)\n      d = 182 + c;\n    if (b == 8)\n      d = 213 + c;\n    if (b == 9)\n      d = 244 + c;\n    if (b == 10)\n      d = 275 + c;\n    if (b == 11)\n      d = 305 + c;\n    if (b == 12)\n      d = 335 + c;\n    printf(\"%d\", d);\n  } else {\n    if (a % 4 == 0 && a % 100 != 0) {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 60 + c;\n      if (b == 4)\n        d = 91 + c;\n      if (b == 5)\n        d = 121 + c;\n      if (b == 6)\n        d = 152 + c;\n      if (b == 7)\n        d = 182 + c;\n      if (b == 8)\n        d = 213 + c;\n      if (b == 9)\n        d = 244 + c;\n      if (b == 10)\n        d = 275 + c;\n      if (b == 11)\n        d = 305 + c;\n      if (b == 12)\n        d = 335 + c;\n      printf(\"%d\", d);\n    } else {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 59 + c;\n      if (b == 4)\n        d = 90 + c;\n      if (b == 5)\n        d = 120 + c;\n      if (b == 6)\n        d = 151 + c;\n      if (b == 7)\n        d = 181 + c;\n      if (b == 8)\n        d = 212 + c;\n      if (b == 9)\n        d = 243 + c;\n      if (b == 10)\n        d = 274 + c;\n      if (b == 11)\n        d = 304 + c;\n      if (b == 12)\n        d = 334 + c;\n      printf(\"%d\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19647", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int k = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (month == 1)\n    k = k + day;\n  else if (month == 2)\n    k = k + 31 + day;\n  else if (month == 3)\n    k = k + 31 + 28 + day;\n  else if (month == 4)\n    k = k + 31 + 28 + 31 + day;\n  else if (month == 5)\n    k = k + 31 + 28 + 31 + 30 + day;\n  else if (month == 6)\n    k = k + 31 + 28 + 31 + 30 + 31 + day;\n  else if (month == 7)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + day;\n  else if (month == 8)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  else if (month == 9)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  else if (month == 10)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  else if (month == 11)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  else if (month == 12)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    k = k + 1;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "19648", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p, n[5] = {0}, year[5], month[5], day[5],\n            days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < 5; i++) {\n    cin >> year[i] >> month[i] >> day[i];\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0) || year[i] % 400 == 0)\n      days[2] = 29;\n    else\n      days[2] = 28;\n    for (p = 0; p < month[i]; p++)\n      n[i] = n[i] + days[p];\n    n[i] = n[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", n[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "19649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], d[5], x[5], i;\n  for (i = 1; i <= 5; i++)\n    cin >> a[i] >> b[i] >> c[i];\n  for (i = 1; i <= 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0))\n      x[i] = 1;\n    else\n      x[i] = 0;\n    if (b[i] == 1)\n      d[i] = c[i];\n    else if (b[i] == 2)\n      d[i] = c[i] + 31;\n    else if (b[i] == 3)\n      d[i] = c[i] + 31 + 28 + x[i];\n    else if (b[i] == 4)\n      d[i] = c[i] + 31 + 28 + 31 + x[i];\n    else if (b[i] == 5)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + x[i];\n    else if (b[i] == 6)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 7)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + x[i];\n    else if (b[i] == 8)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 9)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + x[i];\n    else if (b[i] == 10)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + x[i];\n    else if (b[i] == 11)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 12)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + x[i];\n    cout << d[i] << \" \";\n  }\n}\n"}
{"label": "11", "index": "19650", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y = 0, m = 0, d = 0, sum = 0, i = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  for (i = 0; i <= m - 2; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19651", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint r(int x) {\n  if (x % 4 != 0 || (x % 100 == 0 && x % 400 != 0))\n    return (0);\n  else\n    return (1);\n}\n\nint main() {\n  int m, y, i, d, s;\n  cin >> m >> y >> d;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n\n  if (r(m) == 1)\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (s = 0, i = 1; i < y; i++)\n    s = s + a[i];\n\n  s = s + d;\n\n  printf(\"%d\", s);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int sum = 0, i;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e[12], i;\n  e[1] = e[3] = e[5] = e[7] = e[8] = e[10] = e[12] = 31;\n  e[2] = 28;\n  e[4] = e[6] = e[9] = e[11] = 30;\n  d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + e[i];\n    }\n    d = d + c;\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n      for (i = 1; i < b; i++) {\n        e[2] = 29;\n        d = d + e[i];\n      }\n      d = d + c;\n    }\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19654", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, d, m, i, total = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n    a[1] = 29;\n  for (i = 1; i < m; i++) {\n    total += a[i - 1];\n  }\n  total += d;\n  printf(\"%d\\n\", total);\n}\n"}
{"label": "11", "index": "19655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int Y) {\n  if (Y % 400 == 0)\n    return 1;\n  else if (Y % 100 == 0)\n    return 0;\n  else if (Y % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d \", &Y, &M, &D);\n  if (leap(Y) == 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 28 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 28 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 29 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 29 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      cout << 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D;\n    if (M == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19656", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int year, mon, day, i;\n  int total = 0;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n\n  } else {\n    int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < mon; i++) {\n\n      total = total + a[i];\n    }\n  }\n  total += day;\n  printf(\"%d\", total);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[5], m[5], d[5], c[5], t[5];\n  for (i = 0; i < 5; i++) {\n    cin >> a[i] >> m[i] >> d[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) == 1) {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 60;\n        break;\n      case 4:\n        c[i] = 91;\n        break;\n      case 5:\n        c[i] = 121;\n        break;\n      case 6:\n        c[i] = 152;\n        break;\n      case 7:\n        c[i] = 182;\n        break;\n      case 8:\n        c[i] = 213;\n        break;\n      case 9:\n        c[i] = 244;\n        break;\n      case 10:\n        c[i] = 274;\n        break;\n      case 11:\n        c[i] = 305;\n        break;\n      case 12:\n        c[i] = 335;\n        break;\n      }\n\n    } else {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 59;\n        break;\n      case 4:\n        c[i] = 90;\n        break;\n      case 5:\n        c[i] = 120;\n        break;\n      case 6:\n        c[i] = 151;\n        break;\n      case 7:\n        c[i] = 181;\n        break;\n      case 8:\n        c[i] = 212;\n        break;\n      case 9:\n        c[i] = 243;\n        break;\n      case 10:\n        c[i] = 273;\n        break;\n      case 11:\n        c[i] = 304;\n        break;\n      case 12:\n        c[i] = 334;\n        break;\n      }\n    }\n    t[i] = c[i] + d[i];\n    cout << t[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)\n    result = 1;\n  else {\n    result = 0;\n  }\n  return result;\n}\nint main() {\n\n  int year, month, day;\n  int result = 0;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "19659", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 29 + d;\n          break;\n        case 4:\n          x = 31 + 29 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 29 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 29 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      } else {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 28 + d;\n          break;\n        case 4:\n          x = 31 + 28 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 28 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 28 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      }\n    else {\n      switch (m) {\n      case 1:\n        x = d;\n        break;\n      case 2:\n        x = 31 + d;\n        break;\n      case 3:\n        x = 31 + 29 + d;\n        break;\n      case 4:\n        x = 31 + 29 + 31 + d;\n        break;\n      case 5:\n        x = 31 + 29 + 31 + 30 + d;\n        break;\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31 + d;\n        break;\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n        break;\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n        break;\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n        break;\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n        break;\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n        break;\n      }\n      printf(\"%d\\n\", x);\n    }\n  else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, A, B, a;\n  scanf(\"%d%d%d\", &N, &A, &B);\n  if (N % 100 != 0 && N % 4 == 0 || N % 400 == 0) {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n  } else {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n    a += B;\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[5], m[5], d[5], c[5], t[5];\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &a[i], &m[i], &d[i]);\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) == 1) {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 60;\n        break;\n      case 4:\n        c[i] = 91;\n        break;\n      case 5:\n        c[i] = 121;\n        break;\n      case 6:\n        c[i] = 152;\n        break;\n      case 7:\n        c[i] = 182;\n        break;\n      case 8:\n        c[i] = 213;\n        break;\n      case 9:\n        c[i] = 244;\n        break;\n      case 10:\n        c[i] = 274;\n        break;\n      case 11:\n        c[i] = 305;\n        break;\n      case 12:\n        c[i] = 335;\n        break;\n      }\n\n    } else {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 59;\n        break;\n      case 4:\n        c[i] = 90;\n        break;\n      case 5:\n        c[i] = 120;\n        break;\n      case 6:\n        c[i] = 151;\n        break;\n      case 7:\n        c[i] = 181;\n        break;\n      case 8:\n        c[i] = 212;\n        break;\n      case 9:\n        c[i] = 243;\n        break;\n      case 10:\n        c[i] = 273;\n        break;\n      case 11:\n        c[i] = 304;\n        break;\n      case 12:\n        c[i] = 334;\n        break;\n      }\n    }\n    t[i] = c[i] + d[i];\n    printf(\"%d\\n\", t[i]);\n  }\n}\n"}
{"label": "11", "index": "19662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, D = 0, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  } else {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  }\n  printf(\"%d\", D);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n[13], i, sum = 0;\n  n[1] = n[3] = n[5] = n[7] = n[8] = n[10] = n[12] = 31;\n  n[0] = n[2] = 0; \n  n[4] = n[6] = n[9] = n[11] = 30;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) ||\n      (y % 100 == 0 && y % 400 == 0)) \n    n[2] = 29;\n  else\n    n[2] = 28;\n  for (i = 1; i < m; i++) \n    sum = sum + n[i];\n  sum = sum + d;\n  cout << sum << endl; \n  return 0;\n}\n"}
{"label": "11", "index": "19664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int w, s, i, year, month, day;\n  int ymd[5][3];\n  int num[5];\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\\n\", &year, &month, &day);\n    ymd[i][0] = year;\n    ymd[i][1] = month;\n    ymd[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = ymd[i][0];\n    month = ymd[i][1];\n    day = ymd[i][2];\n    w = (year % 4 == 0 && year % 100 != 0) || year % 400 != 0;\n    switch (month) {\n    case 1:\n      s = 0;\n      break;\n    case 2:\n      s = 31;\n      break;\n    case 3:\n      s = 59;\n      break;\n    case 4:\n      s = 90;\n      break;\n    case 5:\n      s = 120;\n      break;\n    case 6:\n      s = 151;\n      break;\n    case 7:\n      s = 181;\n      break;\n    case 8:\n      s = 212;\n      break;\n    case 9:\n      s = 243;\n      break;\n    case 10:\n      s = 273;\n      break;\n    case 11:\n      s = 304;\n      break;\n    case 12:\n      s = 334;\n      break;\n    }\n    if (w == 0 && month > 2) {\n      s = s + 1;\n    }\n    num[i] = s + day;\n  }\n  printf(\"%d\\n%d\\n%d\\n%d\\n%d\\n\", num[0], num[1], num[2], num[3], num[4]);\n  return 0;\n}\n"}
{"label": "11", "index": "19665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year[5], mon[5], day[5], sum = 0, i, j;\n  for (j = 0; j < 5; j++)\n    cin >> year[j] >> mon[j] >> day[j];\n  for (j = 0; j < 5; j++) {\n    if (year[j] % 400 == 0)\n      a[1] = 29;\n    else if (year[j] % 4 == 0) {\n      if (year[j] % 100 == 0)\n        a[1] = 28;\n      else\n        a[1] = 29;\n    }\n    for (i = 0; i <= (mon[j] - 2); i++)\n      sum = sum + a[i];\n    sum = sum + day[j];\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0)) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4)\n      y = 31 + 29 + 31 + c;\n\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n\n  else if (a % 400 == 0) {\n    if (b == 1)\n      y = c;\n\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  } else {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 28 + c;\n    }\n    if (b == 4) {\n      y = 31 + 28 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 28 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 28 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 29 + d;\n          break;\n        case 4:\n          x = 31 + 29 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 29 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 29 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      } else {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 28 + d;\n          break;\n        case 4:\n          x = 31 + 28 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 28 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 28 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      }\n    else {\n      switch (m) {\n      case 1:\n        x = d;\n        break;\n      case 2:\n        x = 31 + d;\n        break;\n      case 3:\n        x = 31 + 29 + d;\n        break;\n      case 4:\n        x = 31 + 29 + 31 + d;\n        break;\n      case 5:\n        x = 31 + 29 + 31 + 30 + d;\n        break;\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31 + d;\n        break;\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n        break;\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n        break;\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n        break;\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n        break;\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n        break;\n      }\n      printf(\"%d\\n\", x);\n    }\n  else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, daysum = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int dayleap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 != 0) || ((y % 100 == 0) && (y % 400 != 0))) {\n    for (int i = 0; i < m; i++)\n      daysum += day[i];\n    daysum += d;\n  } else {\n    for (int i = 0; i < m; i++)\n      daysum += dayleap[i];\n    daysum += d;\n  }\n  cout << daysum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19669", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, leap, sum;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 != 0)\n    leap = 0;\n  if (year % 4 == 0) {\n    if (year % 100 != 0)\n      leap = 1;\n    if (year % 100 == 0 && year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  if (leap == 0) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 400 == 0) || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3) {\n      d = 31 + 29 + c;\n    }\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    cout << d;\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, m, d, result = 0;\n  cin >> year >> m >> d;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      result += 31;\n    else if (i == 2) {\n      if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)\n        result += 29;\n      else\n        result += 28;\n    } else\n      result += 30;\n  }\n  result += d;\n  cout << result << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, y, r, d, i;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d%d%d\\n\", &n, &y, &r);\n    d = 0;\n    if ((y > 2) && (n % 400 == 0))\n      d = 1;\n    if ((y > 2) && (n % 100 != 0) && (n % 4 == 0))\n      d = 1;\n    d = d + r;\n    y--;\n    switch (y) {\n    case 11:\n      d = d + 30;\n    case 10:\n      d = d + 31;\n    case 9:\n      d = d + 30;\n    case 8:\n      d = d + 31;\n    case 7:\n      d = d + 31;\n    case 6:\n      d = d + 30;\n    case 5:\n      d = d + 31;\n    case 4:\n      d = d + 30;\n    case 3:\n      d = d + 31;\n    case 2:\n      d = d + 28;\n    case 1:\n      d = d + 31;\n    }\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[10], mon[10], date[10], day[12], i, j, sum[10];\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d %d %d\", &year[i], &mon[i], &date[i]);\n  for (i = 0; i <= 4; i++) {\n    sum[i] = 0;\n    day[0] = 31;\n    if (((year[i] % 4 == 0) && (year[i] % 100 != 0)) || (year[i] % 400 == 0))\n      day[1] = 29;\n    else\n      day[1] = 28;\n    day[2] = 31;\n    day[3] = 30;\n    day[4] = 31;\n    day[5] = 30;\n    day[6] = 31;\n    day[7] = 31;\n    day[8] = 30;\n    day[9] = 31;\n    day[10] = 30;\n    day[11] = 31;\n    for (j = 0; j <= mon[i] - 2; j++)\n      sum[i] = sum[i] + day[j];\n    sum[i] = sum[i] + date[i];\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19674", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, a, s;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0)) {\n    a = 29;\n  } else\n    a = 28;\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = 31 + d;\n  } else if (m == 3) {\n    s = 31 + a + d;\n  } else if (m == 4) {\n    s = 31 * 2 + a + d;\n  } else if (m == 5) {\n    s = 31 * 2 + a + 30 + d;\n  } else if (m == 6) {\n    s = 31 * 3 + a + d + 30;\n  } else if (m == 7) {\n    s = 31 * 3 + a + d + 30 * 2;\n  } else if (m == 8) {\n    s = 31 * 4 + a + d + 30 * 2;\n  } else if (m == 9) {\n    s = 31 * 5 + a + d + 30 * 2;\n  } else if (m == 10) {\n    s = 31 * 5 + a + d + 30 * 3;\n  } else if (m == 11) {\n    s = 31 * 6 + a + d + 30 * 3;\n  } else if (m == 12) {\n    s = 31 * 6 + a + d + 30 * 4;\n  } else\n    ;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19675", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, leap, sum;\n  scanf(\"%d %d %d \", &nian, &yue, &ri);\n  switch (yue) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  }\n  sum = sum + ri;\n  if ((nian % 400 == 0) || (nian % 4 == 0 && nian % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && nian > 3 && yue > 2)\n    sum++;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19676", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int Sn = 0;\n  int i = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  } else {\n    int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  }\n  printf(\"%d\", Sn);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum;\n  int a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  sum = 0;\n  for (i = 0; i < m; i++)\n    sum = sum + a[i];\n  sum = sum - a[i - 1] + d;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  int a, b, c;\n  int amount = 0;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m > 2) {\n    a = f(y);\n    if (a == 1)\n      p[1] = p[1] + 1;\n    for (int i = 0; i < m - 1; i++)\n      amount = amount + p[i];\n    amount = amount + d;\n  } else if (m == 1)\n    amount = d;\n  else if (m == 2)\n    amount = 31 + d;\n  printf(\"%d\", amount);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Y, M, D, sum = 0, i;\n  cin >> Y >> M >> D;\n  if ((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) {\n    for (i = 1; i <= M - 1; i++)\n      sum += y[i - 1];\n\n    sum = sum + D;\n  } else {\n    for (i = 1; i <= M - 1; i++) {\n      sum += +x[i - 1];\n    };\n    sum = sum + D;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19680", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, result = 0, i;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      result += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  result = (month - 1) * 30 + day;\n  if (month == 1) {\n    printf(\"%d\", result);\n  } else {\n    if (month == 2 || month == 4 || month == 5)\n      result = result + 1;\n\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8)\n      result = result + 3;\n\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      printf(\"%d\", result);\n    } else {\n      printf(\"%d\", result - 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    d[1]++;\n  }\n  int g = c;\n  int i = 0;\n  while (i >= b)\n    d[i]++;\n\n  for (i = 0; i < b - 1; i++) {\n    g = g + d[i];\n  }\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "11", "index": "19683", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, x, i, sum = 0;\n  cin >> y >> m >> x;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    int d[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++)\n      sum = sum + d[i];\n\n    printf(\"%d\", sum + x);\n  } else {\n    int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m; i++) {\n      sum = sum + d[i];\n    }\n\n    printf(\"%d\", sum + x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, year, month, day, a[32], i, n;\n  cin >> year >> month >> day;\n  a[0] = 0;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if (year % 4 == 0 && year % 200 == 0)\n    a[2] = 29;\n  else {\n    a[2] = 28;\n  }\n  for (i = 0; i < month; i++) {\n    sum = sum + a[i];\n  }\n  n = sum + day;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19685", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, sum;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    sum = c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 60;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 91;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 121;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 152;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 182;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 213;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 244;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 274;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 305;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 335;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 59;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 90;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 120;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 151;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 181;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 212;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 243;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 273;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 304;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 334;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, m = 0, n, r = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))\n    r = 1;\n  if (r == 1)\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 60;\n      break;\n    case 4:\n      m = 91;\n      break;\n    case 5:\n      m = 121;\n      break;\n    case 6:\n      m = 152;\n      break;\n    case 7:\n      m = 182;\n      break;\n    case 8:\n      m = 213;\n      break;\n    case 9:\n      m = 244;\n      break;\n    case 10:\n      m = 274;\n      break;\n    case 11:\n      m = 305;\n      break;\n    case 12:\n      m = 335;\n      break;\n    }\n  else {\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n  }\n  n = m + c;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int yn, mn, dn;\n  int result = 0;\n  scanf(\"%d %d %d\", &yn, &mn, &dn);\n  if (yn % 4 == 0 && yn % 100 != 0 || yn % 400 == 0) {\n    int day_of_month[13] = {0, 31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  } else {\n    int day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  }\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 4 == 0 && a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int yn, mn, dn;\n  int result = 0;\n  cin >> yn >> mn >> dn;\n  if (yn % 4 == 0 && yn % 100 != 0 || yn % 400 == 0) {\n    int day_of_month[13] = {0, 31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  } else {\n    int day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  }\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "19690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int sum = 0;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      for (int i = 0; i <= (month - 2); i++) {\n        sum += mon[i];\n      }\n      sum = sum + day;\n    }\n    cout << sum;\n  } else if (year % 4 != 0 || year % 100 == 0 && year % 400 != 0) {\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (int i = 0; i <= (month - 2); i++)\n        sum += mon[i];\n\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, t;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  t = 0;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      t += 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      t += 30;\n      break;\n    default:\n      if (y % 400 == 0)\n        t += 29;\n      else if ((y % 100 != 0) && (y % 4 == 0))\n        t += 29;\n      else\n        t += 28;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n}\n"}
{"label": "11", "index": "19692", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else if (year % 4 == 0 && year % 100 != 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 59);\n    if (month == 4)\n      printf(\"%d\", day + 90);\n    if (month == 5)\n      printf(\"%d\", day + 120);\n    if (month == 6)\n      printf(\"%d\", day + 151);\n    if (month == 7)\n      printf(\"%d\", day + 181);\n    if (month == 8)\n      printf(\"%d\", day + 212);\n    if (month == 9)\n      printf(\"%d\", day + 243);\n    if (month == 10)\n      printf(\"%d\", day + 273);\n    if (month == 11)\n      printf(\"%d\", day + 304);\n    if (month == 12)\n      printf(\"%d\", day + 334);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int q1, q2, q3, k = 0;\n  scanf(\"%d %d %d\", &q1, &q2, &q3);\n  if ((q1 % 4 == 0 && q1 & 100 != 0) || q1 % 400 == 0)\n    k++;\n  int a[15], b[16];\n  if (k == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  b[1] = 0;\n  for (int i = 2; i <= 12; i++)\n    b[i] = b[i - 1] + a[i - 1];\n  cout << b[q2] + q3;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int run(int n);\n  int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, n, y, r, s = 0, k;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  for (i = 0; i < y; i++)\n    s = s + q[i];\n  s = s + r;\n  k = run(n);\n  if (k && (y > 2))\n    s += 1;\n\n  printf(\"%d\", s);\n  return 0;\n}\n\nint run(int n) {\n  int a;\n  if ((n % 400 == 0) || ((n % 4 == 0) && (n % 100 != 0)))\n    a = 1;\n  else\n    a = 0;\n  return a;\n}\n"}
{"label": "11", "index": "19695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  long int a[5], b[5], c[5], ts[5], i;\n  for (i = 1; i <= 5; i++)\n    scanf(\"%ld %ld %ld\", &a[i], &b[i], &c[i]);\n  for (i = 1; i <= 5; i++) {\n    switch (b[i]) {\n    case 1:\n      ts[i] = c[i];\n      break;\n    case 2:\n      ts[i] = c[i] + 31;\n      break;\n    case 3:\n      ts[i] = c[i] + 59;\n      break;\n    case 4:\n      ts[i] = c[i] + 90;\n      break;\n    case 5:\n      ts[i] = c[i] + 120;\n      break;\n    case 6:\n      ts[i] = c[i] + 151;\n      break;\n    case 7:\n      ts[i] = c[i] + 181;\n      break;\n    case 8:\n      ts[i] = c[i] + 212;\n      break;\n    case 9:\n      ts[i] = c[i] + 243;\n      break;\n    case 10:\n      ts[i] = c[i] + 273;\n      break;\n    case 11:\n      ts[i] = c[i] + 304;\n      break;\n    case 12:\n      ts[i] = c[i] + 334;\n      break;\n    }\n\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) && b[i] > 2)\n      ts[i] = ts[i] + 1;\n\n    printf(\"%ld\", ts[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, x;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 29 + day;\n    else if (month == 4)\n      x = 31 + 29 + 31 + day;\n    else if (month == 5)\n      x = 31 + 29 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 29 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 29 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 29 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  } else {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 28 + day;\n    else {\n      if (month == 4)\n        x = 31 + 28 + 31 + day;\n      else if (month == 5)\n        x = 31 + 28 + 31 + 30 + day;\n      else if (month == 6)\n        x = 31 + 28 + 31 + 30 + 31 + day;\n      else if (month == 7)\n        x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      else if (month == 8)\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      else if (month == 9)\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      else if (month == 10)\n        x = 31 + 28 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      else if (month == 11)\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      else if (month == 12)\n        x = 31 + 28 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n\n  if (b == 1)\n    x = c;\n  if (b == 2)\n    x = 31 + c;\n  if (b == 3)\n    x = 31 + 28 + c;\n  if (b == 4)\n    x = 31 + 28 + 31 + c;\n  if (b == 5)\n    x = 31 + 28 + 31 + 30 + c;\n  if (b == 6)\n    x = 31 + 28 + 31 + 30 + 31 + c;\n  if (b == 7)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n  if (b == 8)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n  if (b == 9)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n  if (b == 10)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n  if (b == 11)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n  if (b == 12)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n\n  if (b <= 2)\n    printf(\"%d\\n\", x);\n  else if (a % 4 == 0)\n    if (a % 100 == 0)\n      if (a % 400 == 0)\n        printf(\"%d\\n\", x + 1);\n      else\n        printf(\"%d\\n\", x);\n    else\n      cout << x + 1 << \"\\n\";\n  else\n    cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, n;\n  int m = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        n = 29;\n      else\n        n = 28;\n    else\n      n = 29;\n  else\n    n = 28;\n  if (month == 1) {\n    printf(\"%d\", day);\n    return 0;\n  }\n  if (month == 2) {\n    m = 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 3) {\n    m = 31 + n + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 4) {\n    m = 31 + n + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 5) {\n    m = 31 + n + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 6) {\n    m = 31 + n + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 7) {\n    m = 31 + n + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 8) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 9) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 10) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 11) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  if (month == 12) {\n    m = 31 + n + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    printf(\"%d\", m);\n    return 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19699", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 60);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 91);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 121);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 152);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 182);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 213);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 305);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 335);\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 59);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 90);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 120);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 151);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 181);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 212);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 304);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 334);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  int sum = 0;\n  int i;\n  int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 != 0) {\n    if (b == 1) {\n      cout << c << endl;\n    }\n    if (b > 1) {\n      for (i = 0; i < b - 1; i++)\n        sum = sum + m[i];\n      sum = sum + c;\n      cout << sum << endl;\n    }\n  }\n\n  if (a % 4 == 0) {\n    if (a % 100 != 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 100 == 0 && a % 400 != 0) {\n      if (b == 1) {\n        cout << c << endl;\n      }\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + m[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 400 == 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19701", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, md = 0, d, day, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < m - 1; i++) {\n    md = md + month[i];\n  }\n  day = md + d;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++)\n    n += days[i];\n\n  n += day;\n\n  if (month > 2 && isleapyear(year))\n    n++;\n\n  cout << n;\n}\n"}
{"label": "11", "index": "19703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, sum = 0;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  for (int i = 0; i < b; i++)\n    sum = sum + month[i];\n\n  sum = sum + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    sum = sum + 1;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, run = 0, M[13], i, D;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  D = d;\n  if ((y % 400 == 0) || ((y % 100 != 0) && (y % 4 == 0))) {\n    run = 1;\n  } else\n    run = 0;\n  for (i = 1; i < 13; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      M[i] = 31;\n      break;\n    default:\n      M[i] = 30;\n    }\n  }\n  if (run == 1) {\n    M[2] = 29;\n  } else\n    M[2] = 28;\n  for (i = 1; i < m; i++) {\n    D = D + M[i];\n  }\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, date,\n      count = 0, day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &date);\n  for (i = 1; i < month; i++)\n    count += day[i];\n  count += date;\n  if (month > 2)\n    if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)))\n      count++;\n  cout << count;\n  return 0;\n}\n"}
{"label": "11", "index": "19706", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d, n;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  if (b == 1)\n    n = c;\n  else if (b == 2)\n    n = c + 31;\n  else if (b == 3)\n    n = 31 + d + c;\n  else if (b == 4)\n    n = 62 + d + c;\n  else if (b == 5)\n    n = 92 + d + c;\n  else if (b == 6)\n    n = 123 + d + c;\n  else if (b == 7)\n    n = 153 + d + c;\n  else if (b == 8)\n    n = 184 + d + c;\n  else if (b == 9)\n    n = 215 + c + d;\n  else if (b == 10)\n    n = 245 + c + d;\n  else if (b == 11)\n    n = 276 + c + d;\n  else if (b == 12) {\n    n = 306 + c + d;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19707", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, sum = 0, months[50], msum = 0;\n\n  months[1] = 31;\n  months[2];\n  months[3] = 31;\n  months[4] = 30;\n  months[5] = 31;\n  months[6] = 30;\n  months[7] = 31;\n  months[8] = 31;\n  months[9] = 30;\n  months[10] = 31;\n  months[11] = 30;\n  months[12] = 31;\n\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 != 0) {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    } else {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    }\n  } else {\n    months[2] = 28;\n  }\n  for (i = 1; i < month; i++) {\n    msum = msum + months[i];\n  }\n  sum = msum + day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            month2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            day, month, number = 0, i;\n  cin >> year >> month >> day;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    for (i = 0; i < month; i++)\n      number += month2[i];\n    number += day;\n  } else {\n    for (i = 0; i < month; i++)\n      number += month1[i];\n    number += day;\n  }\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, mday = 0, i = 1;\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\\n\", &year, &month, &day);\n  for (i = 1; i < month + 1; i++) {\n    mday = mday + p[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 3) {\n      mday = mday + 1;\n    } else {\n      mday = mday;\n    }\n  }\n  n = mday + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19710", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x;\n  cin >> y >> m >> d;\n  x = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 28;\n      }\n    }\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 29;\n      }\n    }\n  }\n  x = x + d;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint day_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint sum_day(int month, int day) {\n  int i;\n  for (i = 0; i < month; i++)\n    day = day + day_month[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\nint main() {\n  int year, month, day, days, a;\n\n  for (a = 1; a <= 5; a++) {\n    scanf(\"%d %d %d \", &year, &month, &day);\n\n    days = sum_day(month, day);\n    if (leap(year) && month >= 3)\n      days = days + 1;\n    cout << days << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, mday = 0, i = 1;\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  for (i = 1; i < month + 1; i++) {\n    mday = mday + p[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 3)\n      mday = mday + 1;\n    else {\n      mday = mday;\n    }\n  }\n  n = mday + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Year(int a) {\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      return 1;\n    } else\n      return 0;\n  } else if (a % 4 == 0) {\n    return 1;\n  } else\n    return 0;\n}\nint main() {\n  int year, month, day, a[13], i, answer;\n  cin >> year >> month >> day;\n  for (i = 1; i <= 12; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      a[i] = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      a[i] = 30;\n      break;\n    case 2:\n      if (Year(year) == 1) {\n        a[i] = 29;\n        break;\n      } else {\n        a[i] = 28;\n        break;\n      }\n    }\n  }\n  answer = 0;\n  for (i = 1; i < month; i++) {\n    answer += a[i];\n  }\n  answer += day;\n  printf(\"%d\\n\", answer);\n  return 0;\n}\n"}
{"label": "11", "index": "19714", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, date;\n  cin >> year >> month >> date;\n  int total = 0;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    day_of_month[2] = 29;\n\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  } else {\n    day_of_month[2] = 28;\n    for (int i = 0; i < month; i++)\n      total += day_of_month[i];\n\n    total += date;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19715", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, d, i, n;\n  scanf(\"%d %d %d \", &k, &m, &d);\n  if (k % 4 == 0)\n    if (k % 100 == 0)\n      if (k % 400 == 0)\n        i = 29;\n      else\n        i = 28;\n    else\n      i = 29;\n  else\n    i = 28;\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  if (m == 2) {\n    n = d + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 3) {\n    n = d + i + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 4) {\n    n = d + i + 31 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 5) {\n    n = d + i + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 6) {\n    n = d + i + 31 + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 7) {\n    n = d + i + 31 + 31 + 31 + 60;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 8) {\n    n = d + i + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 9) {\n    n = d + i + 184 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 10) {\n    n = d + i + 31 + 30 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 11) {\n    n = d + i + 31 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 12) {\n    n = d + i + 31 + 30 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Runnian(int y);\nint main() {\n  int y, m, d, count = 0;\n  int i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      count += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      count += 30;\n    else if (i == 2) {\n      if (Runnian(y))\n        count += 29;\n      else\n        count += 28;\n    }\n  }\n  count += d;\n  printf(\"%d\\n\", count);\n  return 0;\n}\nint Runnian(int y) {\n  int result;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\n"}
{"label": "11", "index": "19717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s, i, l;\n  s = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 1; i < m; i++) {\n    s = s + a[i];\n  }\n  s = s + d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        l = 1;\n      else\n        l = 0;\n    } else\n      l = 1;\n  } else\n    l = 0;\n  if (m > 2)\n    s = s + l;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19718", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nlong total;\n\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  }\n  if (n % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int year, month, day;\n  int i;\n  while (scanf(\"%d %d %d \", &year, &month, &day)) {\n    total = 0;\n    if (run(year)) {\n\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 60 + day;\n        break;\n      case 4:\n        total += 91 + day;\n        break;\n      case 5:\n        total += 121 + day;\n        break;\n      case 6:\n        total += 152 + day;\n        break;\n      case 7:\n        total += 182 + day;\n        break;\n      case 8:\n        total += 213 + day;\n        break;\n      case 9:\n        total += 244 + day;\n        break;\n      case 10:\n        total += 274 + day;\n        break;\n      case 11:\n        total += 305 + day;\n        break;\n      case 12:\n        total += 335 + day;\n        break;\n      }\n    } else {\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 59 + day;\n        break;\n      case 4:\n        total += 90 + day;\n        break;\n      case 5:\n        total += 120 + day;\n        break;\n      case 6:\n        total += 151 + day;\n        break;\n      case 7:\n        total += 181 + day;\n        break;\n      case 8:\n        total += 212 + day;\n        break;\n      case 9:\n        total += 243 + day;\n        break;\n      case 10:\n        total += 273 + day;\n        break;\n      case 11:\n        total += 304 + day;\n        break;\n      case 12:\n        total += 334 + day;\n        break;\n      }\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, total;\n  int i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  total = 0;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n}\n"}
{"label": "11", "index": "19720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, y, m, d, D;\n  int total = 0;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    } else {\n      if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  D = total + d;\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "19721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, j, sum;\n  int a[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  for (j = 0; j < 5; j++) {\n    sum = 0;\n    cin >> year >> month >> day;\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0) {\n          for (i = 0; i < month; i++)\n            sum = sum + a[i];\n          sum = sum + day;\n        } else {\n          for (i = 0; i < month; i++)\n            sum = sum + b[i];\n          sum = sum + day;\n        }\n      } else {\n        for (i = 0; i < month; i++)\n          sum = sum + a[i];\n        sum = sum + day;\n      }\n    } else {\n      for (i = 0; i < month; i++)\n        sum = sum + b[i];\n      sum = sum + day;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19722", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int n) {\n  cin >> n;\n  if (n % 100 == 0) {\n    if (n % 400 == 0)\n      return 1;\n    else\n      return 0;\n  } else if (n % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int t = 0, i;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 5 || i == 3 || i == 7 || i == 8 || i == 10)\n      t = t + 31;\n    else if (i == 2)\n      t = t + 28;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      t = t + 30;\n  }\n  t = t + d;\n  if (f(y) == 1 && m > 2)\n    t = t + 1;\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "19723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Y, M, D, x, y = 0, i, a[12], sum;\n  cin >> Y >> M >> D;\n  a[0] = 31;\n  a[2] = 31;\n  a[4] = 31;\n  a[6] = 31;\n  a[7] = 31;\n  a[9] = 31;\n  a[11] = 31;\n  a[3] = 30;\n  a[5] = 30;\n  a[8] = 30;\n  a[10] = 30;\n  if (Y % 4 != 0)\n    a[1] = 28;\n  else if (Y % 4 == 0 && Y % 100 != 0)\n    a[1] = 29;\n  else if (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 1; i <= M; i++) {\n    x = a[M - i];\n    y = y + x;\n  }\n  sum = y + D - a[M - 1];\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19724", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 100 == 0 && y % 40 == 0 || y % 100 != 0 && y % 4 == 0)\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 335);\n      break;\n    }\n  else\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 334);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "19725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, s = 0;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    for (i = 0; i < m - 1; i++)\n      s += m2[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      s += m1[i];\n  cout << s + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[2] = {365, 366};\n  int month[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                      31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int type;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    type = 1;\n  } else {\n    type = 0;\n  }\n  int i;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++) {\n    sum += month[type][i];\n  }\n  sum += d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[5], i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d \", &y, &m, &d);\n    if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0) {\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 28;\n        break;\n      case 4:\n        a[i] = d + 62 + 28;\n        break;\n      case 5:\n        a[i] = d + 62 + 28 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 28;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 28;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 28;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 28;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 28;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 28;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 28;\n        break;\n      }\n    } else\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 29;\n        break;\n      case 4:\n        a[i] = d + 62 + 29;\n        break;\n      case 5:\n        a[i] = d + 62 + 29 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 29;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 29;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 29;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 29;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 29;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 29;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 29;\n        break;\n      }\n    i = i + 1;\n  }\n  cout << a[1] << \"\\n\"\n       << a[2] << \"\\n\"\n       << a[3] << \"\\n\"\n       << a[4] << \"\\n\"\n       << a[5] << \"\\n%\";\n  return 0;\n}\n"}
{"label": "11", "index": "19728", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, n, d, x = 0, i = 1, z;\n  int m[13];\n  m[1] = m[3] = m[5] = m[7] = m[8] = m[10] = m[12] = 31;\n  m[4] = m[6] = m[9] = m[11] = 30;\n  m[2] = 29;\n  scanf(\"%d %d %d \", &y, &n, &d);\n  if (n == 1) {\n    x = d;\n    z = x;\n  } else {\n    if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n        z = x + d;\n      }\n    } else {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n      }\n      z = x + d - 1;\n    }\n  }\n\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "11", "index": "19729", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (m(a) == 1) {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 60 + c;\n    if (b == 4)\n      x = 91 + c;\n    if (b == 5)\n      x = 121 + c;\n    if (b == 6)\n      x = 152 + c;\n    if (b == 7)\n      x = 182 + c;\n    if (b == 8)\n      x = 213 + c;\n    if (b == 9)\n      x = 244 + c;\n    if (b == 10)\n      x = 274 + c;\n    if (b == 11)\n      x = 305 + c;\n    if (b == 12)\n      x = 335 + c;\n    printf(\"%d\", x);\n  } else {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 59 + c;\n    if (b == 4)\n      x = 90 + c;\n    if (b == 5)\n      x = 120 + c;\n    if (b == 6)\n      x = 151 + c;\n    if (b == 7)\n      x = 181 + c;\n    if (b == 8)\n      x = 212 + c;\n    if (b == 9)\n      x = 243 + c;\n    if (b == 10)\n      x = 273 + c;\n    if (b == 11)\n      x = 304 + c;\n    if (b == 12)\n      x = 334 + c;\n    printf(\"%d\", x);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, answer;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 29 + day;\n      break;\n    case 4:\n      answer = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  } else {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 28 + day;\n      break;\n    case 4:\n      answer = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    cout << answer << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 29);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 29 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (b == 1)\n      cout << c << \"\\n\";\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 28);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 28 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, d1 = 0, d2, i;\n  int md[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m == 1)\n    d2 = d;\n  else {\n\n    for (i = 0; i < m - 1; i++)\n      d1 = d1 + md[i];\n    d2 = d + d1;\n  }\n  cout << d2;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, A, B, a;\n  cin >> N >> A >> B;\n  if (N % 100 != 0 && N % 4 == 0 || N % 400 == 0) {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n  } else {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n    a += B;\n  }\n  cout << a;\n}\n"}
{"label": "11", "index": "19734", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int n = 0; \n  int i;\n\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  \n  for (i = 1; i < month; i++)\n    n = n + days[i];\n  \n  n = n + day;\n  \n  if (month > 2 && isleapyear(year))\n    n++;\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, math, day;\n  int date;\n  scanf(\"%d %d %d\", &year, &math, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 29 + day;\n    }\n    if (math == 4) {\n      date = 31 + 29 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 29 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 29 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n  if (year % 4 != 0 || (year % 100 == 0) && year % 400 != 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 28 + day;\n    }\n    if (math == 4) {\n      date = 31 + 28 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 28 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 28 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n\n  printf(\"%d\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "19736", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[11];\n  int y, m, d, i, leap, total = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  for (i = 0; i < m - 1; i++)\n    total += a[i];\n  total += d;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  if (x % 4 != 0)\n    return 0;\n  else if ((x % 100 == 0) && (x % 400 != 0))\n    return 0;\n  else\n    return 1;\n}\nint main() {\n  int y, m, d;\n  int j = 1;\n  int n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int a[13];\n  a[1] = 31;\n  if (f(y) == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  for (j = 1; j < m; j++)\n    n = n + a[j];\n  n = n + d;\n  printf(\"%d \", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19738", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (!((a % 4 == 0 && a % 100 != 0) || (a % 4 == 0 && a % 400 == 0))) {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c - 1;\n    if (b == 4)\n      cout << 91 + c - 1;\n    if (b == 5)\n      cout << 121 + c - 1;\n    if (b == 6)\n      cout << 152 + c - 1;\n    if (b == 7)\n      cout << 182 + c - 1;\n    if (b == 8)\n      cout << 213 + c - 1;\n    if (b == 9)\n      cout << 244 + c - 1;\n    if (b == 10)\n      cout << 274 + c - 1;\n    if (b == 11)\n      cout << 305 + c - 1;\n    if (b == 12)\n      cout << 335 + c - 1;\n  } else {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c;\n    if (b == 4)\n      cout << 91 + c;\n    if (b == 5)\n      cout << 121 + c;\n    if (b == 6)\n      cout << 152 + c;\n    if (b == 7)\n      cout << 182 + c;\n    if (b == 8)\n      printf(\"%d\", 213 + c);\n    if (b == 9)\n      cout << 244 + c;\n    if (b == 10)\n      cout << 274 + c;\n    if (b == 11)\n      cout << 305 + c;\n    if (b == 12)\n      cout << 335 + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int y, m, d, days = 0;\n  cin >> y >> m >> d;\n  switch (m) {\n  case 1:\n    days = d;\n    break;\n  case 2:\n    days = 31 + d;\n    break;\n  case 3:\n    days = 31 + 28 + d;\n    break;\n  case 4:\n    days = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    days = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    days = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  cout << days << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, j;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        j = 1;\n      else {\n        j = 0;\n      }\n    } else\n      j = 1;\n\n  } else\n    j = 0;\n  if (j == 1) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\", d + 335);\n      break;\n    }\n  }\n\n  if (j == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\", d + 334);\n      break;\n    }\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, date, i = 1, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        sum += 29;\n      } else\n        sum += 28;\n    } else\n      sum += 30;\n  }\n\n  sum += date;\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, x;\n  cin >> a >> b >> c;\n\n  if (b == 1)\n    x = c;\n  if (b == 2) {\n    x = 31 + c;\n  }\n  if (b == 3)\n    x = 31 + 28 + c;\n  if (b == 4)\n    x = 31 + 28 + 31 + c;\n  if (b == 5)\n    x = 31 + 28 + 31 + 30 + c;\n  if (b == 6)\n    x = 31 + 28 + 31 + 30 + 31 + c;\n  if (b == 7)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n  if (b == 8)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n  if (b == 9)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n  if (b == 10)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n  if (b == 11)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n  if (b == 12)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n\n  if (b <= 2)\n    printf(\"%d\\n\", x);\n  else if (a % 4 == 0)\n    if (a % 100 == 0)\n      if (a % 400 == 0)\n        cout << x + 1 << \"\\n\";\n      else\n        printf(\"%d\\n\", x);\n    else\n      printf(\"%d\\n\", x + 1);\n  else\n    printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19743", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  static int d[13] = {0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0)\n    d[2] = 29;\n  else {\n    d[2] = 28;\n  }\n  int i, sum = 0;\n  for (i = 1; i < b; i++) {\n    sum += d[i];\n  }\n  sum += c;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 60);\n    else if (b == 4)\n      printf(\"%d\", c + 91);\n    else if (b == 5)\n      printf(\"%d\", c + 121);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 182);\n    else if (b == 8)\n      printf(\"%d\", c + 213);\n    else if (b == 9)\n      printf(\"%d\", c + 244);\n    else if (b == 10)\n      printf(\"%d\", c + 274);\n    else if (b == 11)\n      printf(\"%d\", c + 305);\n    else\n      printf(\"%d\", c + 335);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 59);\n    else if (b == 4)\n      printf(\"%d\", c + 90);\n    else if (b == 5)\n      printf(\"%d\", c + 120);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 181);\n    else if (b == 8)\n      printf(\"%d\", c + 212);\n    else if (b == 9)\n      printf(\"%d\", c + 243);\n    else if (b == 10)\n      printf(\"%d\", c + 273);\n    else if (b == 11)\n      printf(\"%d\", c + 304);\n    else\n      printf(\"%d\", c + 334);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, day = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 && y % 400 == 0)\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 29;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  else\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 28;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "19746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1, n = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      n = n + 31;\n    } else if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n        n = n + 29;\n      } else {\n        n = n + 28;\n      }\n    } else {\n      n = n + 30;\n    }\n  }\n  n = n + day;\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, k, s;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 10 != 0) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 60;\n      break;\n    }\n    case 4: {\n      k = 91;\n      break;\n    }\n    case 5: {\n      k = 121;\n      break;\n    }\n    case 6: {\n      k = 152;\n      break;\n    }\n    case 7: {\n      k = 182;\n      break;\n    }\n    case 8: {\n      k = 213;\n      break;\n    }\n    case 9: {\n      k = 244;\n      break;\n    }\n    case 10: {\n      k = 274;\n      break;\n    }\n    case 11: {\n      k = 305;\n      break;\n    }\n    case 12: {\n      k = 335;\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 59;\n      break;\n    }\n    case 4: {\n      k = 90;\n      break;\n    }\n    case 5: {\n      k = 120;\n      break;\n    }\n    case 6: {\n      k = 151;\n      break;\n    }\n    case 7: {\n      k = 181;\n      break;\n    }\n    case 8: {\n      k = 212;\n      break;\n    }\n    case 9: {\n      k = 243;\n      break;\n    }\n    case 10: {\n      k = 273;\n      break;\n    }\n    case 11: {\n      k = 304;\n      break;\n    }\n    case 12: {\n      k = 334;\n      break;\n    }\n    }\n  }\n\n  s = k + c;\n  cout << s << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  int dd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n = 0;\n  int i;\n\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0))) {\n    dd[1] = 29;\n  }\n\n  for (i = 0; i < m - 1; i++)\n    n = n + dd[i];\n\n  n = n + d;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19749", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[5], m[5], d[5], c[5], t[5];\n  for (i = 0; i < 5; i++) {\n    cin >> a[i] >> m[i] >> d[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) == 1) {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 60;\n        break;\n      case 4:\n        c[i] = 91;\n        break;\n      case 5:\n        c[i] = 121;\n        break;\n      case 6:\n        c[i] = 152;\n        break;\n      case 7:\n        c[i] = 182;\n        break;\n      case 8:\n        c[i] = 213;\n        break;\n      case 9:\n        c[i] = 244;\n        break;\n      case 10:\n        c[i] = 274;\n        break;\n      case 11:\n        c[i] = 305;\n        break;\n      case 12:\n        c[i] = 335;\n        break;\n      }\n\n    } else {\n      switch (m[i]) {\n      case 1:\n        c[i] = 0;\n        break;\n      case 2:\n        c[i] = 31;\n        break;\n      case 3:\n        c[i] = 59;\n        break;\n      case 4:\n        c[i] = 90;\n        break;\n      case 5:\n        c[i] = 120;\n        break;\n      case 6:\n        c[i] = 151;\n        break;\n      case 7:\n        c[i] = 181;\n        break;\n      case 8:\n        c[i] = 212;\n        break;\n      case 9:\n        c[i] = 243;\n        break;\n      case 10:\n        c[i] = 273;\n        break;\n      case 11:\n        c[i] = 304;\n        break;\n      case 12:\n        c[i] = 334;\n        break;\n      }\n    }\n    t[i] = c[i] + d[i];\n    printf(\"%d\\n\", t[i]);\n  }\n}\n"}
{"label": "11", "index": "19750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int check(int a);\n  int count(int x[], int w, int y);\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  int k;\n  int sum;\n  k = check(year);\n  if (k == 1) {\n    int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days1, month, day);\n    printf(\"%d\", sum);\n  } else {\n    int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days2, month, day);\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n\nint check(int a) {\n  int b, c, d;\n  b = a % 4;\n  c = a % 100;\n  d = a % 400;\n  if (b != 0)\n    return 1;\n  else if (c == 0 && d != 0)\n    return 1;\n  else\n    return 0;\n}\n\nint count(int x[], int w, int y) {\n  int sum = 0;\n  int i;\n  for (i = 1; i < w; i++) {\n    sum = sum + x[i];\n  }\n  sum = sum + y;\n  return sum;\n}\n"}
{"label": "11", "index": "19751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, a, rank;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))\n    a = 1;\n  else {\n    a = 0;\n  }\n  if (month == 1) {\n    rank = day;\n  }\n  if (month == 2) {\n    rank = 31 + day;\n  }\n  if (month == 3) {\n    rank = 59 + a + day;\n  }\n  if (month == 4) {\n    rank = 90 + a + day;\n  }\n  if (month == 5) {\n    rank = 120 + a + day;\n  }\n  if (month == 6) {\n    rank = 151 + a + day;\n  }\n  if (month == 7) {\n    rank = 181 + a + day;\n  }\n  if (month == 8) {\n    rank = 212 + a + day;\n  }\n  if (month == 9) {\n    rank = 243 + a + day;\n  }\n  if (month == 10) {\n    rank = 273 + a + day;\n  }\n  if (month == 11) {\n    rank = 304 + a + day;\n  }\n  if (month == 12) {\n    rank = 334 + a + day;\n  }\n  cout << rank;\n  return 0;\n}\n"}
{"label": "11", "index": "19752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 0; i < month; i++)\n      sum += a[1][i];\n    sum = sum + day - a[1][month - 1];\n  } else {\n    for (i = 0; i < month; i++) {\n      sum += a[0][i];\n    }\n    sum = sum + day - a[0][month - 1];\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, a, b, m, n;\n  cin >> year >> a >> b;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = 0;\n      break;\n    case 4:\n      m = 1;\n      break;\n    case 5:\n      m = 1;\n      break;\n    case 6:\n      m = 2;\n      break;\n    case 7:\n      m = 2;\n      break;\n    case 8:\n      m = 3;\n      break;\n    case 9:\n      m = 4;\n      break;\n    case 10:\n      m = 4;\n      break;\n    case 11:\n      m = 5;\n      break;\n    case 12:\n      m = 5;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  } else {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = -1;\n      break;\n    case 4:\n      m = 0;\n      break;\n    case 5:\n      m = 0;\n      break;\n    case 6:\n      m = 1;\n      break;\n    case 7:\n      m = 1;\n      break;\n    case 8:\n      m = 2;\n      break;\n    case 9:\n      m = 3;\n      break;\n    case 10:\n      m = 3;\n      break;\n    case 11:\n      m = 4;\n      break;\n    case 12:\n      m = 4;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, date = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      date = date + 30;\n    else {\n      if (i == 2) {\n        if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n          date = date + 29;\n        else\n          date = date + 28;\n      } else\n        date = date + 31;\n    }\n  }\n  date = date + day;\n  printf(\"%d\\n\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "19755", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, k, s;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 10 != 0) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 60;\n      break;\n    }\n    case 4: {\n      k = 91;\n      break;\n    }\n    case 5: {\n      k = 121;\n      break;\n    }\n    case 6: {\n      k = 152;\n      break;\n    }\n    case 7: {\n      k = 182;\n      break;\n    }\n    case 8: {\n      k = 213;\n      break;\n    }\n    case 9: {\n      k = 244;\n      break;\n    }\n    case 10: {\n      k = 274;\n      break;\n    }\n    case 11: {\n      k = 305;\n      break;\n    }\n    case 12: {\n      k = 335;\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 59;\n      break;\n    }\n    case 4: {\n      k = 90;\n      break;\n    }\n    case 5: {\n      k = 120;\n      break;\n    }\n    case 6: {\n      k = 151;\n      break;\n    }\n    case 7: {\n      k = 181;\n      break;\n    }\n    case 8: {\n      k = 212;\n      break;\n    }\n    case 9: {\n      k = 243;\n      break;\n    }\n    case 10: {\n      k = 273;\n      break;\n    }\n    case 11: {\n      k = 304;\n      break;\n    }\n    case 12: {\n      k = 334;\n      break;\n    }\n    }\n  }\n\n  s = k + c;\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  long a[5];\n  int b[5], c[5], g[5];\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%ld %d %d\", &a[i], &b[i], &c[i]);\n    i++;\n  }\n  i = 1;\n  while (i <= 5) {\n    g[i] = 0;\n    switch (b[i]) {\n    case 12:\n      g[i] += 30;\n    case 11:\n      g[i] += 31;\n    case 10:\n      g[i] += 30;\n    case 9:\n      g[i] += 31;\n    case 8:\n      g[i] += 31;\n    case 7:\n      g[i] += 30;\n    case 6:\n      g[i] += 31;\n    case 5:\n      g[i] += 30;\n    case 4:\n      g[i] += 31;\n    case 3:\n      g[i] += 28;\n    case 2:\n      g[i] += 31;\n    case 1:\n      g[i] += 0;\n      break;\n    default:\n      cout << \"error\\n\";\n    }\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || (a[i] % 400 == 0)) &&\n        (b[i] >= 3))\n      c[i] = c[i] + 1;\n    printf(\"%d\\n\", g[i] + c[i]);\n    i++;\n  }\n}\n"}
{"label": "11", "index": "19757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int d[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++) {\n      day = day + d[i];\n    }\n\n  } else {\n    int d[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++)\n      day = day + d[i];\n  }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "19758", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, x;\n  cin >> year >> month >> day;\n  switch (month) {\n  case 1:\n    x = day;\n    break;\n  case 2:\n    x = 31 + day;\n    break;\n  case 3:\n    x = 31 + 28 + day;\n    break;\n  case 4:\n    x = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    x = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    x = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        if (month >= 3) {\n          printf(\"%d\", x + 1);\n        } else {\n          printf(\"%d\", x);\n        }\n      else\n        printf(\"%d\", x);\n    else if (month >= 3) {\n      printf(\"%d\", x + 1);\n    } else {\n      printf(\"%d\", x);\n    }\n  else\n    printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  long a[5];\n  int b[5], c[5], g[5];\n  i = 1;\n  while (i <= 5) {\n    cin >> a[i] >> b[i] >> c[i];\n    i++;\n  }\n  i = 1;\n  while (i <= 5) {\n    g[i] = 0;\n    switch (b[i]) {\n    case 12:\n      g[i] += 30;\n    case 11:\n      g[i] += 31;\n    case 10:\n      g[i] += 30;\n    case 9:\n      g[i] += 31;\n    case 8:\n      g[i] += 31;\n    case 7:\n      g[i] += 30;\n    case 6:\n      g[i] += 31;\n    case 5:\n      g[i] += 30;\n    case 4:\n      g[i] += 31;\n    case 3:\n      g[i] += 28;\n    case 2:\n      g[i] += 31;\n    case 1:\n      g[i] += 0;\n      break;\n    default:\n      cout << \"error\\n\";\n    }\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || (a[i] % 400 == 0)) &&\n        (b[i] >= 3))\n      c[i] = c[i] + 1;\n    printf(\"%d\\n\", g[i] + c[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    if (month > 2) {\n      sum = sum + 29 + 31;\n      for (int k = 3; k < month; k++)\n        sum = sum + d[k];\n\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else {\n      sum = day;\n    }\n\n  } else {\n    if (month > 2) {\n      sum = sum + 28 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else\n      sum = day;\n  }\n  cout << sum;\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19761", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, j = 0, y, i, m, d,\n         number[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++)\n    j += number[i - 1];\n\n  k = j + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m > 1) {\n      printf(\"%d\", k + 1);\n    }\n  } else\n    printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "19762", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d;\n  int i = 0, num = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0 && (y % 100 != 0 || (y % 400 == 0))) {\n\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num += d;\n  } else {\n\n    int a[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++) {\n      num += a[i];\n    }\n    num = num + d;\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint nian(int m) {\n  if ((m % 400 == 0) || ((m % 100 != 0) && (m % 4 == 0)))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, s = 0, n, y, r, a[12];\n  scanf(\"%d%d%d\", &n, &y, &r);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (nian(n))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < y - 1; i++)\n    s += a[i];\n  s += r;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int k[20];\n  k[1] = 31;\n  k[2] = 28;\n  k[3] = 31;\n  k[4] = 30;\n  k[5] = 31;\n  k[6] = 30;\n  k[7] = 31;\n  k[8] = 31;\n  k[9] = 30;\n  k[10] = 31;\n  k[11] = 30;\n  k[12] = 31;\n  int i = 1;\n  int sum = 0;\n  while (i < b) {\n    sum = sum + k[i];\n    i++;\n  }\n  sum = sum + c;\n  if (b > 2) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n\n    {\n      sum++;\n    }\n  }\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int z;\n  z = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int m[12];\n  m[0] = 31;\n  if (year % 4 == 0) {\n    m[1] = 29;\n    if (year % 100 == 0)\n      m[1] = 28;\n    if (year % 400 == 0)\n      m[1] = 29;\n  } else\n    m[1] = 28;\n  m[2] = 31;\n  m[3] = 30;\n  m[4] = 31;\n  m[5] = 30;\n  m[6] = 31;\n  m[7] = 31;\n  m[8] = 30;\n  m[9] = 31;\n  m[10] = 30;\n  m[11] = 31;\n  int i;\n  for (i = 0; i < month - 1; i++)\n    z = z + m[i];\n  printf(\"%d \", z + day);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y = 0, m = 0, d = 0, sum = 0, i = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  for (i = 0; i <= m - 2; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + d;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], l[5] = {0}, i = 0;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  }\n\n  for (i = 0; i < 5; i++) {\n    if ((year[i] % 4 == 0) && (year[i] % 100 != 0) || (year[i] % 400 == 0)) {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 29;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    } else {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 28;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    }\n    l[i] = l[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    cout << l[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int result = 0;\n  int i;\n  int yue[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> year >> month >> day;\n\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      year % 100 != 0 && year % 4 == 0) {\n    yue[1] = 29;\n  }\n\n  if (month == 1) {\n    result = result + day;\n    printf(\"%d\", result);\n  }\n  if (month > 1) {\n    for (i = 0; i < month - 1; i++) {\n      result = result + yue[i];\n    }\n    result = result + day;\n    printf(\"%d \", result);\n  }\n}\n"}
{"label": "11", "index": "19769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0) && (a % 100 != 0)) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n\n  else if (a % 400 == 0) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  } else {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 28 + c;\n    }\n    if (b == 4) {\n      y = 31 + 28 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 28 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 28 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int j, k, l;\n  cin >> j >> k >> l;\n  if (j % 4 == 0) {\n    if (j % 100 != 0) {\n      a[1] = 29;\n    } else {\n      if (j % 100 == 0 && j % 400 == 0) {\n        a[1] = 29;\n      }\n    }\n    if (j % 100 == 0 && j % 400 != 0) {\n      a[1] = 28;\n    }\n  }\n  int sum = 0;\n  int m;\n  for (m = 0; m < k - 1; m++) {\n    sum = sum + a[m];\n  }\n  sum = sum + l;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i;\n\n  cin >> y >> m >> d;\n  int s = d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < (m - 1); i++) {\n      s += B[i];\n    }\n    printf(\"%d\", s);\n  } else {\n    for (i = 0; i < (m - 1); i++)\n      s += A[i];\n\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n, i;\n  cin >> year >> month >> day;\n  if (year % 100 == 0)\n    i = 400;\n  else\n    i = 4;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3) {\n    if (year % i == 0)\n      n = 31 + 29 + day;\n    else\n      n = 31 + 28 + day;\n  }\n  if (month == 4) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + day;\n    else\n      n = 31 + 28 + 31 + day;\n  }\n  if (month == 5) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + day;\n  }\n  if (month == 6) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + day;\n  }\n  if (month == 7) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n  }\n  if (month == 8) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  }\n  if (month == 9) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  }\n  if (month == 10) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  }\n  if (month == 11) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  }\n  if (month == 12) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m == 1)\n    s = d;\n  else if (m == 2)\n    s = 31 + d;\n  else if (m == 3)\n    s = 60 + d;\n  else if (m == 4)\n    s = 91 + d;\n  else if (m == 5)\n    s = 121 + d;\n  else if (m == 6)\n    s = 152 + d;\n  else if (m == 7)\n    s = 182 + d;\n  else if (m == 8)\n    s = 213 + d;\n  else if (m == 9)\n    s = 244 + d;\n  else if (m == 10)\n    s = 274 + d;\n  else if (m == 11)\n    s = 305 + d;\n  else if (m == 12)\n    s = 335 + d;\n  if (m >= 3) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0) {\n        printf(\"%d\", s);\n      } else\n        printf(\"%d\", s - 1);\n    } else if (y % 4 == 0)\n      printf(\"%d\", s);\n    else if (y % 4 != 0)\n      printf(\"%d\", s - 1);\n  } else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int f[22];\n  cin >> y >> m >> d;\n  f[0] = 31 + d;\n  f[1] = 60 + d;\n  f[2] = 91 + d;\n  f[3] = 121 + d;\n  f[4] = 152 + d;\n  f[5] = 182 + d;\n  f[6] = 213 + d;\n  f[7] = 244 + d;\n  f[8] = 274 + d;\n  f[9] = 305 + d;\n  f[10] = 335 + d;\n  f[11] = 31 + d;\n  f[12] = 59 + d;\n  f[13] = 90 + d;\n  f[14] = 120 + d;\n  f[15] = 151 + d;\n  f[16] = 181 + d;\n  f[17] = 212 + d;\n  f[18] = 243 + d;\n  f[19] = 273 + d;\n  f[20] = 304 + d;\n  f[21] = 334 + d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      cout << f[0];\n      break;\n    case 3:\n      printf(\"%d\", f[1]);\n      break;\n    case 4:\n      printf(\"%d\", f[2]);\n      break;\n    case 5:\n      printf(\"%d\", f[3]);\n      break;\n    case 6:\n      printf(\"%d\", f[4]);\n      break;\n    case 7:\n      printf(\"%d\", f[5]);\n      break;\n    case 8:\n      printf(\"%d\", f[6]);\n      break;\n    case 9:\n      printf(\"%d\", f[7]);\n      break;\n    case 10:\n      printf(\"%d\", f[8]);\n      break;\n    case 11:\n      printf(\"%d\", f[9]);\n      break;\n    case 12:\n      printf(\"%d\", f[10]);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[11]);\n      break;\n    case 3:\n      printf(\"%d\", f[12]);\n      break;\n    case 4:\n      printf(\"%d\", f[13]);\n      break;\n    case 5:\n      printf(\"%d\", f[14]);\n      break;\n    case 6:\n      printf(\"%d\", f[15]);\n      break;\n    case 7:\n      printf(\"%d\", f[16]);\n      break;\n    case 8:\n      printf(\"%d\", f[17]);\n      break;\n    case 9:\n      cout << f[18];\n      break;\n    case 10:\n      printf(\"%d\", f[19]);\n      break;\n    case 11:\n      printf(\"%d\", f[20]);\n      break;\n    case 12:\n      printf(\"%d\", f[21]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19776", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int n = 0;\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month; i++) {\n    n = days[i] + n;\n  }\n  n = day + n;\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0)) {\n    n++;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int yn, mn, dn;\n  int result = 0;\n  cin >> yn >> mn >> dn;\n  if (yn % 4 == 0 && yn % 100 != 0 || yn % 400 == 0) {\n    int day_of_month[13] = {0, 31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  } else {\n    int day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  }\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint isrn(int n) {\n  if (n % 400 == 0)\n    return 1;\n  else {\n    if (n % 100 == 0)\n      return 0;\n    else {\n      if (n % 4 == 0)\n        return 1;\n      else\n        return 0;\n    }\n  }\n}\n\nint main() {\n  int y, m, d, sum = 0, i;\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum += 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2) {\n      if (isrn(y))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "11", "index": "19779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    a[2] = 29;\n  int sum = 0;\n  for (int i = 1; i < month; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19780", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int mth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int leap;\n  int sum = 0;\n  int i;\n\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap)\n    mth[2] = 29;\n\n  for (i = 1; i <= m - 1; i++)\n    sum = sum + mth[i];\n\n  sum = sum + d;\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int y, m, d, s, er;\n  cin >> y >> m >> d;\n  if (y % 400 == 0) {\n    er = 29;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  } else {\n    er = 28;\n    switch (m) {\n    case 1:\n      s = d;\n      printf(\"%d\\n\", s);\n      break;\n    case 2:\n      s = 31 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 3:\n      s = 31 + er + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 4:\n      s = 31 * 2 + er + d;\n      cout << s << \"\\n\";\n      break;\n    case 5:\n      s = 31 * 2 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 6:\n      s = 31 * 3 + er + 30 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 7:\n      s = 31 * 3 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 8:\n      s = 31 * 4 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 9:\n      s = 31 * 5 + er + 30 * 2 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 10:\n      s = 31 * 5 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 11:\n      s = 31 * 6 + er + 30 * 3 + d;\n      printf(\"%d\\n\", s);\n      break;\n    case 12:\n      s = 31 * 6 + er + 30 * 4 + d;\n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19782", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap_year(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else {\n    if (y % 4 == 0 && y % 100 != 0)\n      return 1;\n    else\n      return 0;\n  }\n}\nint main() {\n  int y, m, d, count;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (leap_year(y)) {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 29;\n      break;\n    case 4:\n      count = 31 + 29 + 31;\n      break;\n    case 5:\n      count = 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  } else {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 28;\n      break;\n    case 4:\n      count = 31 + 28 + 31;\n      break;\n    case 5:\n      count = 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "11", "index": "19783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long int a[5], b[5], c[5], ts[5], i;\n  for (i = 1; i <= 5; i++)\n    scanf(\"%ld %ld %ld\", &a[i], &b[i], &c[i]);\n  for (i = 1; i <= 5; i++) {\n    switch (b[i]) {\n    case 1:\n      ts[i] = c[i];\n      break;\n    case 2:\n      ts[i] = c[i] + 31;\n      break;\n    case 3:\n      ts[i] = c[i] + 59;\n      break;\n    case 4:\n      ts[i] = c[i] + 90;\n      break;\n    case 5:\n      ts[i] = c[i] + 120;\n      break;\n    case 6:\n      ts[i] = c[i] + 151;\n      break;\n    case 7:\n      ts[i] = c[i] + 181;\n      break;\n    case 8:\n      ts[i] = c[i] + 212;\n      break;\n    case 9:\n      ts[i] = c[i] + 243;\n      break;\n    case 10:\n      ts[i] = c[i] + 273;\n      break;\n    case 11:\n      ts[i] = c[i] + 304;\n      break;\n    case 12:\n      ts[i] = c[i] + 334;\n      break;\n    }\n\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) && b[i] > 2)\n      ts[i] = ts[i] + 1;\n\n    printf(\"%ld\", ts[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, dd = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    cout << dd;\n  } else {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint GetMonthDays(int year, int month);\nint CheckLeap(int year);\nint main() {\n  int year, month, day = 1, s = 0, i;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++) {\n    s += GetMonthDays(year, i);\n  }\n  s += day;\n  printf(\"%d\", s);\n}\n\nint GetMonthDays(int year, int month) {\n  int day;\n  if (month == 4 || month == 6 || month == 9 || month == 11)\n    day = 30;\n  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 ||\n      month == 10 || month == 12)\n    day = 31;\n  if (month == 2) {\n    if (CheckLeap(year) == 1)\n      day = 29;\n    if (CheckLeap(year) == 0)\n      day = 28;\n  }\n  return day;\n}\n\nint CheckLeap(int year) {\n  int jugde = 0;\n  if (year % 100 != 0) {\n    if (year % 4 == 0)\n      jugde = 1;\n  }\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      jugde = 1;\n  }\n  return jugde;\n}\n"}
{"label": "11", "index": "19786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1) {\n    t += d;\n  } else if (m == 2) {\n    t += 31 + d;\n  } else if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 29;\n      }\n    }\n    t = t + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 28;\n      }\n    }\n    t = t + d;\n  }\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "19787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int month[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                          {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\nint main() {\n  int i, leap = 0, y, m, d, ans = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n    leap = 1;\n  for (i = 1; i < m; i++)\n    ans += month[leap][i];\n  ans += d;\n  cout << ans << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19788", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0) {\n      return (1);\n    } else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x;\n  cin >> a >> b >> c;\n  if (m(a) == 1) {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 60 + c;\n    if (b == 4)\n      x = 91 + c;\n    if (b == 5)\n      x = 121 + c;\n    if (b == 6)\n      x = 152 + c;\n    if (b == 7)\n      x = 182 + c;\n    if (b == 8)\n      x = 213 + c;\n    if (b == 9)\n      x = 244 + c;\n    if (b == 10)\n      x = 274 + c;\n    if (b == 11)\n      x = 305 + c;\n    if (b == 12)\n      x = 335 + c;\n    printf(\"%d\", x);\n  } else {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 59 + c;\n    if (b == 4)\n      x = 90 + c;\n    if (b == 5)\n      x = 120 + c;\n    if (b == 6)\n      x = 151 + c;\n    if (b == 7)\n      x = 181 + c;\n    if (b == 8)\n      x = 212 + c;\n    if (b == 9)\n      x = 243 + c;\n    if (b == 10)\n      x = 273 + c;\n    if (b == 11)\n      x = 304 + c;\n    if (b == 12)\n      x = 334 + c;\n    printf(\"%d\", x);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, A, B, a;\n  scanf(\"%d%d%d\", &N, &A, &B);\n  if (N % 100 != 0 && N % 4 == 0 || N % 400 == 0) {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n  } else {\n    for (a = 0, A = A - 1; A != 0; A--) {\n      switch (A) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n      case 12:\n        a += 31;\n        break;\n      case 2:\n        a += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        a += 30;\n        break;\n      }\n    }\n    a += B;\n  }\n  printf(\"%d\", a);\n}\n"}
{"label": "11", "index": "19790", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, l, m, n;\n  cin >> k >> l >> m;\n  if (k % 4 == 0) {\n    if (k % 100 == 0) {\n      if (k % 400 == 0) {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 29);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 29 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 29 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 29 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      } else {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 28);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 28 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 28 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 28 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      }\n    } else {\n      if ((l > 0) && (l < 2)) {\n        n = m;\n        printf(\"%d\", n);\n      } else if ((l > 1) && (l < 3)) {\n        n = (m + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 2) && (l < 4)) {\n        n = (m + 31 + 29);\n        printf(\"%d\\n\", n);\n      } else if ((l > 3) && (l < 5)) {\n        n = (m + 31 + 29 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 4) && (l < 6)) {\n        n = (m + 31 + 29 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 5) && (l < 7)) {\n        n = (m + 31 + 29 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 6) && (l < 8)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 7) && (l < 9)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else {\n        if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  } else {\n    if ((l > 0) && (l < 2)) {\n      n = m;\n      printf(\"%d\", n);\n    } else if ((l > 1) && (l < 3)) {\n      n = (m + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 2) && (l < 4)) {\n      n = (m + 31 + 28);\n      printf(\"%d\\n\", n);\n    } else if ((l > 3) && (l < 5)) {\n      n = (m + 31 + 28 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 4) && (l < 6)) {\n      n = (m + 31 + 28 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 5) && (l < 7)) {\n      n = (m + 31 + 28 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 6) && (l < 8)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 7) && (l < 9)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 8) && (l < 10)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 9) && (l < 11)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 10) && (l < 12)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 11) && (l < 13)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int z, i, sum = 0;\n  z = f(year);\n\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + a[i];\n\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 0; i < b - 1;) {\n    y = y + A[i];\n    i++;\n  }\n  y = y + c;\n  if (a % 4 == 0 & a % 100 != 0 || a % 400 == 0) {\n    if (b <= 2) {\n      printf(\"%d\", y);\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else\n    cout << y;\n  return 0;\n}\n"}
{"label": "11", "index": "19793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, day, num = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    a[2]++;\n  for (int i = 1; i < month; i++)\n    num += a[i];\n  num += day;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int k = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    k = k + day;\n  else if (month == 2)\n    k = k + 31 + day;\n  else if (month == 3)\n    k = k + 31 + 28 + day;\n  else if (month == 4)\n    k = k + 31 + 28 + 31 + day;\n  else if (month == 5)\n    k = k + 31 + 28 + 31 + 30 + day;\n  else if (month == 6)\n    k = k + 31 + 28 + 31 + 30 + 31 + day;\n  else if (month == 7)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + day;\n  else if (month == 8)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  else if (month == 9)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  else if (month == 10)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  else if (month == 11)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  else if (month == 12)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    k = k + 1;\n  cout << k;\n  return 0;\n}\n"}
{"label": "11", "index": "19795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, sum = 0;\n  cin >> a >> b >> c;\n  if (b == 1)\n    sum = 0;\n  else if (b == 2)\n    sum = 31;\n  else {\n    sum = 31;\n    if ((a % 400 == 0) || (a % 4 == 0 && a % 100 != 0))\n      sum = sum + 29;\n    else\n      sum = sum + 28;\n    for (i = 3; i < b; i++) {\n      if (i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        sum = sum + 31;\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        sum = sum + 30;\n    }\n  }\n  sum = sum + c;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int day, month, year, sum, leap;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    printf(\"data error \");\n    break;\n  }\n  sum = sum + day;\n  if (year % 400 == 0 || (year & 4 == 0 && year % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && month > 2)\n    sum = sum + 1;\n  printf(\"%d \", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int i;\n  int a = 0;\n  int b = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int N1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int N2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (day < 1 || day > N2[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++)\n        a += N2[i];\n\n      b = a - day;\n    }\n  } else {\n    if (day < 1 || day > N1[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N1[i];\n      }\n      b = a - day;\n    }\n  }\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "19798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int sum = 0;\n  cin >> year >> month >> day;\n  switch (month) {\n  case 1:\n    sum = day;\n    break;\n  case 2:\n    sum = 31 + day;\n    break;\n  case 3:\n    sum = 31 + 28 + day;\n    break;\n  case 4:\n    sum = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    sum = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    sum = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + day;\n    break;\n  }\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n\n  int t = 0;\n  int aa[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b - 1; i++) {\n    t = t + aa[i];\n  }\n  if (b > 2) {\n    if ((a % 4 == 0) && ((a % 100) != 0) || (a % 400 == 0)) {\n      t = t + 29;\n    } else {\n      t = t + 28;\n    }\n  }\n  t = t + c;\n  cout << t;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19800", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12], b[100000], c, d, e, i, s, t = 0;\n  cin >> c >> d >> e;\n  if (c % 4 != 0 || (c % 100 == 0 && c % 400 != 0)) {\n    a[0] = 31;\n    a[1] = 28;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  } else {\n    a[0] = 31;\n    a[1] = 29;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, j, k = 0, n;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + b[i];\n    }\n    k = k + d;\n    printf(\"%d\", k);\n  }\n  k = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + a[i];\n    }\n    k = k + d;\n    printf(\"%d\", k);\n  }\n}\n"}
{"label": "11", "index": "19802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 100 != 0 && y % 4 == 0) || (y % 400 == 0)) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 60 + d;\n      break;\n    case 4:\n      n = 91 + d;\n      break;\n    case 5:\n      n = 121 + d;\n      break;\n    case 6:\n      n = 152 + d;\n      break;\n    case 7:\n      n = 182 + d;\n      break;\n    case 8:\n      n = 213 + d;\n      break;\n    case 9:\n      n = 244 + d;\n      break;\n    case 10:\n      n = 274 + d;\n      break;\n    case 11:\n      n = 305 + d;\n      break;\n    default:\n      n = 335 + d;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 59 + d;\n      break;\n    case 4:\n      n = 90 + d;\n      break;\n    case 5:\n      n = 120 + d;\n      break;\n    case 6:\n      n = 151 + d;\n      break;\n    case 7:\n      n = 181 + d;\n      break;\n    case 8:\n      n = 212 + d;\n      break;\n    case 9:\n      n = 243 + d;\n      break;\n    case 10:\n      n = 273 + d;\n      break;\n    case 11:\n      n = 304 + d;\n      break;\n    default:\n      n = 334 + d;\n    }\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int year) {\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int year, month, day, leap1, answer = 0, i;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  leap1 = leap(year);\n  if (leap1 == 1) {\n    for (i = 1; i < month; i++) {\n      answer += b[i];\n    }\n    answer += day;\n  } else {\n    for (i = 1; i < month; i++) {\n      answer += a[i];\n    }\n    answer += day;\n  }\n  printf(\"%d\", answer);\n  return 0;\n}\n"}
{"label": "11", "index": "19804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int result = 0;\n  int i;\n  int yue[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  if ((year % 100 == 0 && year % 400 == 0) || year % 100 != 0 && year % 4 == 0)\n    yue[1] = 29;\n\n  if (month == 1) {\n    result = result + day;\n    printf(\"%d\", result);\n  }\n  if (month > 1) {\n    for (i = 0; i < month - 1; i++) {\n      result = result + yue[i];\n    }\n    result = result + day;\n    printf(\"%d \", result);\n  }\n}\n"}
{"label": "11", "index": "19805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, a, b, m, n;\n  cin >> year >> a >> b;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = 0;\n      break;\n    case 4:\n      m = 1;\n      break;\n    case 5:\n      m = 1;\n      break;\n    case 6:\n      m = 2;\n      break;\n    case 7:\n      m = 2;\n      break;\n    case 8:\n      m = 3;\n      break;\n    case 9:\n      m = 4;\n      break;\n    case 10:\n      m = 4;\n      break;\n    case 11:\n      m = 5;\n      break;\n    case 12:\n      m = 5;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  } else {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = -1;\n      break;\n    case 4:\n      m = 0;\n      break;\n    case 5:\n      m = 0;\n      break;\n    case 6:\n      m = 1;\n      break;\n    case 7:\n      m = 1;\n      break;\n    case 8:\n      m = 2;\n      break;\n    case 9:\n      m = 3;\n      break;\n    case 10:\n      m = 3;\n      break;\n    case 11:\n      m = 4;\n      break;\n    case 12:\n      m = 4;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[2] = {365, 366};\n  int month[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                      31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  cin >> y >> m >> d;\n  int type;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    type = 1;\n  } else {\n    type = 0;\n  }\n  int i;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++) {\n    sum += month[type][i];\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19807", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, total;\n  int i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  total = 0;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n}\n"}
{"label": "11", "index": "19808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  result = (month - 1) * 30 + day;\n  if (month == 1) {\n    cout << result;\n  } else {\n    if (month == 2 || month == 4 || month == 5)\n      result = result + 1;\n\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8)\n      result = result + 3;\n\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      printf(\"%d\", result);\n    } else {\n      printf(\"%d\", result - 1);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19809", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int days = 0;\n  int i;\n  if (y % 4 == 0) {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  }\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  int DaysOfMonth[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                            0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int flag;\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 4 == 0 && year % 100 == 0 && year % 400 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  if (month == 1)\n    cout << day << endl;\n  else {\n    for (i = 1; i < month; i++) {\n      sum += DaysOfMonth[flag][i];\n    }\n    sum += day;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19811", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 4 == 0 && a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  printf(\"%d\\n\", d);\n}\n"}
{"label": "11", "index": "19812", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 400 == 0) || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  int DaysOfMonth[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                            0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int flag;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 != 0 || (year % 4 == 0 && year % 100 == 0 && year % 400 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  if (month == 1)\n    cout << day << endl;\n  else {\n    for (i = 1; i < month; i++) {\n      sum += DaysOfMonth[flag][i];\n    }\n    sum += day;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19814", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, s = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int m1 = 31, m2 = 28, m21 = 29, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31,\n      m8 = 31, m9 = 30, m10 = 31, m11 = 30, m12 = 31;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 28 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m2 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m2 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m2 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  } else {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 29 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m21 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m21 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m21 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, num = 0, i, a[11];\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (year % 4 != 0) {\n    a[1] = 28;\n  } else if (year % 100 == 0) {\n    if (year % 400 == 0) {\n      a[1] = 29;\n    } else\n      a[1] = 28;\n  } else\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    num = num + a[i];\n\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, n = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    n = n + monthday[i - 1];\n  }\n  n = n + day;\n\n  if (month > 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0))\n    n = n + 1;\n\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19817", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, leap, sum;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 != 0)\n    leap = 0;\n  if (year % 4 == 0) {\n    if (year % 100 != 0)\n      leap = 1;\n    if (year % 100 == 0 && year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  if (leap == 0) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "19818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  if (mon == 1)\n    a = day;\n  else if (mon == 2)\n    a = 31 + day;\n  else if (mon == 3)\n    a = 59 + day;\n  else if (mon == 4)\n    a = 90 + day;\n  else if (mon == 5)\n    a = 120 + day;\n  else if (mon == 6)\n    a = 151 + day;\n  else if (mon == 7)\n    a = 181 + day;\n  else if (mon == 8)\n    a = 212 + day;\n  else if (mon == 9)\n    a = 243 + day;\n  else if (mon == 10)\n    a = 273 + day;\n  else if (mon == 11)\n    a = 304 + day;\n  else\n    a = 334 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (mon >= 3)\n      a = a + 1;\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, x = 0, i;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      x = x + 31;\n    else if (i == 2) {\n      x = x + 28;\n    } else\n      x = x + 30;\n  }\n  if (((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0)) && (b > 2)) {\n    x = x + 1;\n  }\n  x = x + c;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum, n = 0, k[13];\n  cin >> y >> m >> d;\n  k[0] = 0;\n  k[1] = k[3] = k[5] = k[7] = k[8] = k[10] = k[12] = 31;\n  k[4] = k[6] = k[9] = k[11] = 30;\n  if (y % 4) {\n    if (y % 100) {\n      if (y % 400) {\n        k[2] = 28;\n      } else\n        k[2] = 29;\n\n    } else {\n      k[2] = 28;\n    }\n  } else {\n    k[2] = 29;\n  }\n  for (i = 0; i < m; i++) {\n    n = n + k[i];\n  }\n  sum = n + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint shirunnian(int d) {\n  if (d % 4 == 0) {\n    if (d % 100 == 0) {\n      if (d % 400 == 0)\n        return 1;\n      else\n        return 0;\n    } else\n      return 1;\n  } else\n    return 0;\n}\n\nint dijitian(int a, int b, int c) {\n  int i;\n  int sum = 0;\n  int days = 0;\n  for (i = 0; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    else if (i == 2) {\n      if (shirunnian(a) == 1)\n        days += 29;\n      else if (shirunnian(a) == 0) {\n        days += 28;\n      }\n    }\n  }\n  sum = days + c;\n  return sum;\n}\n\nint main() {\n  int year, month, day, tianshu = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  tianshu = dijitian(year, month, day);\n  cout << tianshu;\n  return 0;\n}\n"}
{"label": "11", "index": "19822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  cin >> year >> month >> day;\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month == 2 &&\n      (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month != 2 &&\n      (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++)\n    n += days[i];\n  n += day;\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)) {\n    n++;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, a, i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d \", &year, &month, &day);\n    if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) == 1) {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 29 + day;\n        break;\n      case 4:\n        a = 31 + 29 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 29 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 29 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        printf(\"error\\n\");\n      }\n    } else {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 28 + day;\n        break;\n      case 4:\n        a = 31 + 28 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 28 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 28 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        cout << \"error\\n\";\n      }\n    }\n    printf(\"%d\\n\", a);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint month[2][12] = {31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31,\n                    31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\nint main() {\n  int year, monthq, day;\n  scanf(\"%d %d %d \", &year, &monthq, &day);\n  int ans = 0;\n  for (int i = 1; i < monthq; i++) {\n    int xx;\n    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n      xx = 1;\n    else\n      xx = 0;\n    ans += month[xx][i - 1];\n  }\n  ans += day;\n  cout << ans << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint runnian(int a) {\n  if (a % 4 == 0 && a % 400 == 0)\n    return 1;\n  if (a % 4 == 0 && a % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint tian(int nian, int yue, int ri) {\n  int sum = 0, i;\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int feirun[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (runnian(nian) == 1) {\n    for (i = 0; i <= yue - 2; i++)\n      sum += run[i];\n    sum += ri;\n  } else {\n    for (i = 0; i <= yue - 2; i++)\n      sum += feirun[i];\n    sum += ri;\n  }\n  return sum;\n}\n\nint main() {\n  int nian, yue, ri;\n  scanf(\"%d %d %d \", &nian, &yue, &ri);\n  cout << tian(nian, yue, ri) << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i,\n      rank = 0, y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)\n    max[2] += 1;\n  ;\n  for (i = 1; i < m; i++) {\n    rank += max[i];\n  }\n  rank += d;\n  printf(\"%d\", rank);\n  int x;\n  cin >> x;\n  return 0;\n}\n"}
{"label": "11", "index": "19827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], sum[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < 5; i++) {\n    switch (b[i]) {\n    case 1:\n      sum[i] = 0;\n      break;\n    case 2:\n      sum[i] = 31;\n      break;\n    case 3:\n      sum[i] = 59;\n      break;\n    case 4:\n      sum[i] = 90;\n      break;\n    case 5:\n      sum[i] = 120;\n      break;\n    case 6:\n      sum[i] = 151;\n      break;\n    case 7:\n      sum[i] = 181;\n      break;\n    case 8:\n      sum[i] = 212;\n      break;\n    case 9:\n      sum[i] = 243;\n      break;\n    case 10:\n      sum[i] = 273;\n      break;\n    case 11:\n      sum[i] = 304;\n      break;\n    case 12:\n      sum[i] = 334;\n      break;\n    }\n    sum[i] = sum[i] + c[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) && b[i] > 2)\n      sum[i] = sum[i] + 1;\n  }\n  for (i = 0; i < 5; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) ||\n      (year % 100 == 0 && year % 400 == 0)) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  cout << sum;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, k, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  sum = 0;\n  cin >> n >> j >> k;\n  for (i = 0; i <= j - 1; i++) {\n    sum = sum + a[i];\n  }\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    if (j <= 2) {\n      sum = sum + k;\n    } else {\n      sum = sum + 1 + k;\n    }\n  } else {\n    sum = sum + k;\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int N[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + N[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    sum = sum + 1;\n  sum = sum + day;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "19831", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    default:\n      d = 0;\n    }\n  else\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    default:\n      d = 0;\n    }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear(year) && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n\n  for (i = 1; i < month; i++)\n    n += days[i];\n\n  n += day;\n\n  if (isleapyear(year) && month > 2)\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "19833", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint RunNian(int y) {\n  int result;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int y, int m, int d) {\n  int result = 0;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11)\n      result += 30;\n    else if (i == 2) {\n      if (RunNian(y)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n\n  result += d;\n  return result;\n}\n\nint main() {\n\n  int y2, m2, d2, a, e;\n  int T = 0;\n\n  scanf(\"%d%d%d\", &y2, &m2, &d2);\n\n  T += DiJiTian(y2, m2, d2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "11", "index": "19834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint rui(int y, int m) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) && m == 2)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int d = 0, y, m, r, i;\n  int pp[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> r;\n  for (i = 1; i < m; i++)\n    d = d + pp[i] + rui(y, i);\n  d = d + r;\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "19835", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, x = 0, sum, i;\n  cin >> a >> b >> c;\n  for (i = 0; i < 12; i++) {\n    if (i + 1 == b)\n      break;\n    x = x + days[i];\n  }\n  sum = x + c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b <= 2)\n      printf(\"%d\", sum);\n\n    if (b > 2) {\n      sum = sum + 1;\n      printf(\"%d\", sum);\n    }\n\n  } else\n    printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  cin >> y >> m >> d;\n  int days = 0;\n  int i;\n  if (y % 4 == 0) {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++)\n      days = month[i] + days;\n\n    days = d + days;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  }\n  cout << days << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int k = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    k = k + day;\n  else if (month == 2)\n    k = k + 31 + day;\n  else if (month == 3)\n    k = k + 31 + 28 + day;\n  else if (month == 4)\n    k = k + 31 + 28 + 31 + day;\n  else if (month == 5)\n    k = k + 31 + 28 + 31 + 30 + day;\n  else if (month == 6)\n    k = k + 31 + 28 + 31 + 30 + 31 + day;\n  else if (month == 7)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + day;\n  else if (month == 8)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  else if (month == 9)\n    k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  else {\n    if (month == 10)\n      k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    else if (month == 11)\n      k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      k = k + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    k = k + 1;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "19838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int ye, mo, da, i, sum = 0;\n  int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> ye >> mo >> da;\n\n  for (i = 1; i < mo; i++) {\n    sum = sum + mon[i];\n  }\n  if (((ye % 400 == 0) && mo > 2) ||\n      ((ye % 4 == 0) && (ye % 100 != 0)) && mo > 2) {\n    sum = sum + da + 1;\n  } else {\n    sum = sum + da;\n  }\n\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 60;\n      break;\n    case 4:\n      day = day + 91;\n      break;\n    case 5:\n      day = day + 121;\n      break;\n    case 6:\n      day = day + 152;\n      break;\n    case 7:\n      day = day + 182;\n      break;\n    case 8:\n      day = day + 213;\n      break;\n    case 9:\n      day = day + 244;\n      break;\n    case 10:\n      day = day + 274;\n      break;\n    case 11:\n      day = day + 305;\n      break;\n    case 12:\n      day = day + 335;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 59;\n      break;\n    case 4:\n      day = day + 90;\n      break;\n    case 5:\n      day = day + 120;\n      break;\n    case 6:\n      day = day + 151;\n      break;\n    case 7:\n      day = day + 181;\n      break;\n    case 8:\n      day = day + 212;\n      break;\n    case 9:\n      day = day + 243;\n      break;\n    case 10:\n      day = day + 273;\n      break;\n    case 11:\n      day = day + 304;\n      break;\n    case 12:\n      day = day + 334;\n      break;\n    }\n  }\n  printf(\"%d\", day);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int k[20];\n  k[1] = 31;\n  k[2] = 28;\n  k[3] = 31;\n  k[4] = 30;\n  k[5] = 31;\n  k[6] = 30;\n  k[7] = 31;\n  k[8] = 31;\n  k[9] = 30;\n  k[10] = 31;\n  k[11] = 30;\n  k[12] = 31;\n  int i = 1;\n  int sum = 0;\n  while (i < b) {\n    sum = sum + k[i];\n    i++;\n  }\n  sum = sum + c;\n  if (b > 2) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n\n      sum++;\n  }\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1 && (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0)) {\n      counter++;\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  printf(\"%d\", counter);\n}\n"}
{"label": "11", "index": "19842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, total = 0;\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (j = 1; j < month; j++) {\n    if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 || j == 12)\n      total = total + 31;\n    if (j == 4 || j == 6 || j == 9 || j == 11)\n      total = total + 30;\n    if (j == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, num, leap;\n  leap = 0;\n  cin >> y >> m >> d;\n  if (m == 1 || m == 2) {\n    if (m == 1)\n      num = d;\n    else\n      num = 31 + d;\n    cout << num << endl;\n  } else {\n    num = (m - 1) * 30 + d;\n    if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n      leap = 1;\n    if (leap == 1)\n      num = num - 1;\n    else\n      num = num - 2;\n    switch (m) {\n    case 3:\n      num = num + 1;\n      break;\n    case 4:\n    case 5:\n      num = num + 2;\n      break;\n    case 6:\n    case 7:\n      num = num + 3;\n      break;\n    case 8:\n    case 9:\n      num = num + 4;\n      break;\n    case 10:\n      num = num + 5;\n      break;\n    case 11:\n    case 12:\n      num = num + 6;\n      break;\n    default:\n      break;\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int Year, Month, Date;\n  int month;\n  int i;\n  int sum1 = 0, sum2 = 0;\n  scanf(\"%d %d %d\", &Year, &Month, &Date);\n  month = Month - 1;\n  if (Year % 4 == 0 && Year % 400 == 0) {\n    int mday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  } else {\n    int mday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  }\n  sum2 = sum1 + Date;\n  printf(\"\\n%d\", sum2);\n  return 0;\n}\n"}
{"label": "11", "index": "19845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint X1(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 59 + z;\n    break;\n  case 4:\n    j = 90 + z;\n    break;\n  case 5:\n    j = 120 + z;\n    break;\n  case 6:\n    j = 151 + z;\n    break;\n  case 7:\n    j = 181 + z;\n    break;\n  case 8:\n    j = 212 + z;\n    break;\n  case 9:\n    j = 243 + z;\n    break;\n  case 10:\n    j = 273 + z;\n    break;\n  case 11:\n    j = 304 + z;\n    break;\n  default:\n    j = 334 + z;\n    break;\n  }\n  return (j);\n}\nint X2(int y, int z) {\n  int j;\n  switch (y) {\n  case 1:\n    j = z;\n    break;\n  case 2:\n    j = 31 + z;\n    break;\n  case 3:\n    j = 60 + z;\n    break;\n  case 4:\n    j = 91 + z;\n    break;\n  case 5:\n    j = 121 + z;\n    break;\n  case 6:\n    j = 152 + z;\n    break;\n  case 7:\n    j = 182 + z;\n    break;\n  case 8:\n    j = 213 + z;\n    break;\n  case 9:\n    j = 244 + z;\n    break;\n  case 10:\n    j = 274 + z;\n    break;\n  case 11:\n    j = 305 + z;\n    break;\n  default:\n    j = 335 + z;\n    break;\n  }\n  return (j);\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  cout << endl;\n  int num;\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  } else {\n    if (y % 4 == 0)\n      num = X2(m, d);\n    else\n      num = X1(m, d);\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  unsigned long int year, month, day, b[30][3];\n  int a, c, d, i;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    b[i][0] = year;\n    b[i][1] = month;\n    b[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = b[i][0];\n    month = b[i][1];\n    day = b[i][2];\n    a = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n    if (a == 1) {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 29;\n        break;\n      case 4:\n        c = 31 + 29 + 31;\n        break;\n      case 5:\n        c = 31 + 29 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 29 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n\n    } else {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 28;\n        break;\n      case 4:\n        c = 31 + 28 + 31;\n        break;\n      case 5:\n        c = 31 + 28 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 28 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    d = c + day;\n    printf(\"%d\\n\", d);\n  }\n}\n"}
{"label": "11", "index": "19847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, leap, sum;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 != 0)\n    leap = 0;\n  if (year % 4 == 0) {\n    if (year % 100 != 0)\n      leap = 1;\n    if (year % 100 == 0 && year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 29 + day;\n      break;\n    case 4:\n      sum = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  if (leap == 0) {\n    switch (month) {\n    case 1:\n      sum = day;\n      break;\n    case 2:\n      sum = 31 + day;\n      break;\n    case 3:\n      sum = 31 + 28 + day;\n      break;\n    case 4:\n      sum = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      sum = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      sum = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint RunNian(int y) {\n  int result;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)\n    result = 1;\n  else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int y, int m, int d) {\n  int result = 0;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (RunNian(y)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n\n  result += d;\n  return result;\n}\n\nint main() {\n\n  int y2, m2, d2, a, e;\n  int T = 0;\n\n  cin >> y2 >> m2 >> d2;\n\n  T += DiJiTian(y2, m2, d2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "11", "index": "19849", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + monthday[i - 1];\n\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && a == 0) {\n    sum = sum + 1;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Y, M, D, sum = 0, i;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if ((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) {\n    for (i = 1; i <= M - 1; i++) {\n      sum += y[i - 1];\n    }\n\n    sum = sum + D;\n  } else {\n    for (i = 1; i <= M - 1; i++) {\n      sum += +x[i - 1];\n    };\n    sum = sum + D;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19851", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, e, i;\n  int d = 0;\n\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int score[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++)\n      d = d + score[i];\n\n    e = d + c;\n  } else {\n    int score[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  }\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19852", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    for (int i = m - 2; i >= 0; i--) {\n      sum = sum + b[i];\n    }\n    cout << sum + d;\n  } else {\n    for (int s = m - 2; s >= 0; s--) {\n      sum = sum + a[s];\n    }\n    cout << sum + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 > 0 || a % 400 == 0) {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else {\n        if (i == 2) {\n          sum += 29;\n        } else {\n          sum += 30;\n        }\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  } else {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2) {\n        sum += 28;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, y, r, s = 0, i;\n  cin >> n >> y >> r;\n  int a[12];\n  a[0] = 31, a[1] = 28, a[2] = 31, a[3] = 30, a[4] = 31, a[5] = 30, a[6] = 31,\n  a[7] = 31, a[8] = 30, a[9] = 31, a[10] = 30, a[11] = 31;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    a[1] = 29;\n  for (i = 0; i < y - 1; i++)\n    s = s + a[i];\n  s = s + r;\n  cout << s << \"\\n\";\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int real;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 29 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 29 + day;\n      printf(\"%d\", real);\n    }\n\n  } else {\n    if (month == 1) {\n      printf(\"%d\", day);\n    }\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 28 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 28 + day;\n      printf(\"%d\", real);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19856", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, day = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 && y % 400 == 0) {\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 29;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  } else {\n    switch (m) {\n    case 12:\n      day = day + 30;\n    case 11:\n      day = day + 31;\n    case 10:\n      day = day + 30;\n    case 9:\n      day = day + 31;\n    case 8:\n      day = day + 31;\n    case 7:\n      day = day + 30;\n    case 6:\n      day = day + 31;\n    case 5:\n      day = day + 30;\n    case 4:\n      day = day + 31;\n    case 3:\n      day = day + 28;\n    case 2:\n      day = day + 31;\n    case 1:\n      day = day + d;\n    }\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 59 + c;\n    else if (b == 4)\n      s = 90 + c;\n    else if (b == 5)\n      s = 120 + c;\n    else if (b == 6)\n      s = 151 + c;\n    else if (b == 7)\n      s = 181 + c;\n    else if (b == 8)\n      s = 212 + c;\n    else if (b == 9)\n      s = 243 + c;\n    else if (b == 10)\n      s = 273 + c;\n    else if (b == 11)\n      s = 304 + c;\n    else if (b == 12)\n      s = 334 + c;\n  } else if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      s = c;\n    else if (b == 2)\n      s = 31 + c;\n    else if (b == 3)\n      s = 60 + c;\n    else if (b == 4)\n      s = 91 + c;\n    else if (b == 5)\n      s = 121 + c;\n    else if (b == 6)\n      s = 152 + c;\n    else if (b == 7)\n      s = 182 + c;\n    else if (b == 8)\n      s = 213 + c;\n    else if (b == 9)\n      s = 244 + c;\n    else if (b == 10)\n      s = 274 + c;\n    else if (b == 11)\n      s = 305 + c;\n    else if (b == 12)\n      s = 335 + c;\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "19858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, days;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1)\n    days = day;\n  else if (month == 2)\n    days = day + 31;\n  else if (month == 3)\n    days = day + 59;\n  else if (month == 4)\n    days = day + 90;\n  else if (month == 5)\n    days = day + 120;\n  else if (month == 6)\n    days = day + 151;\n  else if (month == 7)\n    days = day + 181;\n  else if (month == 8)\n    days = day + 212;\n  else if (month == 9)\n    days = day + 243;\n  else if (month == 10)\n    days = day + 273;\n  else if (month == 11)\n    days = day + 304;\n  else if (month == 12)\n    days = day + 334;\n  if (year % 100 == 0, year % 400 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  } else if (year % 400 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  }\n}\n"}
{"label": "11", "index": "19859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (((y + 400) % 400 == 0) || ((y % 4 == 0) && ((y % 100) != 0))) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 60 + d;\n    else if (m == 4)\n      n = 91 + d;\n    else if (m == 5)\n      n = 121 + d;\n    else if (m == 6)\n      n = 152 + d;\n    else if (m == 7)\n      n = 182 + d;\n    else if (m == 8)\n      n = 213 + d;\n    else if (m == 9)\n      n = 244 + d;\n    else if (m == 10)\n      n = 274 + d;\n    else if (m == 11)\n      n = 305 + d;\n    else if (m == 12)\n      n = 335 + d;\n    printf(\"%d\\n\", n);\n  } else {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 59 + d;\n    else if (m == 4)\n      n = 90 + d;\n    else if (m == 5)\n      n = 120 + d;\n    else if (m == 6)\n      n = 151 + d;\n    else if (m == 7)\n      n = 181 + d;\n    else if (m == 8)\n      n = 212 + d;\n    else if (m == 9)\n      n = 243 + d;\n    else if (m == 10)\n      n = 273 + d;\n    else if (m == 11)\n      n = 304 + d;\n    else if (m == 12)\n      n = 334 + d;\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, dd = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  } else {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n, s[12], i, t;\n  cin >> a >> b >> c;\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  t = 0;\n  for (i = 0; i < b - 1; i++) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n      s[1] = 29;\n      t = s[i] + t;\n    } else {\n      s[1] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[3], leap = 1, day;\n  scanf(\"%d %d %d\", &a[0], &a[1], &a[2]);\n  if ((((a[0] % 4) && !(a[0] % 100))) || (a[0] % 400))\n    leap = 0;\n  if (a[1] == 1)\n    day = a[2];\n  if (a[1] == 2)\n    day = a[2] + 31;\n  if (a[1] == 3)\n    day = a[2] + 59 + leap;\n  if (a[1] == 4)\n    day = a[2] + 90 + leap;\n  if (a[1] == 5)\n    day = a[2] + 120 + leap;\n  ;\n  if (a[1] == 6)\n    day = a[2] + 151 + leap;\n  if (a[1] == 7)\n    day = a[2] + 181 + leap;\n  if (a[1] == 8)\n    day = a[2] + 212 + leap;\n  if (a[1] == 9)\n    day = a[2] + 243 + leap;\n  if (a[1] == 10)\n    day = a[2] + 273 + leap;\n  if (a[1] == 11)\n    day = a[2] + 304 + leap;\n  if (a[1] == 12)\n    day = a[2] + 334 + leap;\n  cout << day;\n}\n"}
{"label": "11", "index": "19863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int monday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  total = 0;\n  for (i = 1; i < month; i++)\n    total = total + monday[i - 1];\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    total = total + 1;\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "19864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else if (year % 4 == 0 && year % 100 != 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 59);\n    if (month == 4)\n      printf(\"%d\", day + 90);\n    if (month == 5)\n      printf(\"%d\", day + 120);\n    if (month == 6)\n      printf(\"%d\", day + 151);\n    if (month == 7)\n      printf(\"%d\", day + 181);\n    if (month == 8)\n      printf(\"%d\", day + 212);\n    if (month == 9)\n      printf(\"%d\", day + 243);\n    if (month == 10)\n      printf(\"%d\", day + 273);\n    if (month == 11)\n      printf(\"%d\", day + 304);\n    if (month == 12)\n      printf(\"%d\", day + 334);\n  }\n}\n"}
{"label": "11", "index": "19865", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint run(int a) {\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int isr = run(y);\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days = 0;\n  for (int i = 1; i < m; i++) {\n    days = days + p[i];\n  }\n  days = days + d;\n  if (isr == 1 && m >= 3)\n    days++;\n  printf(\"%d\", days);\n}\n"}
{"label": "11", "index": "19866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, i;\n  cin >> year >> month >> day;\n  if (((year % 400) == 0) || (((year % 4) == 0) && ((year % 100) != 0))) {\n    int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  } else {\n    int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  }\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, a, b, m, n;\n  scanf(\"%d%d%d\", &year, &a, &b);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = 0;\n      break;\n    case 4:\n      m = 1;\n      break;\n    case 5:\n      m = 1;\n      break;\n    case 6:\n      m = 2;\n      break;\n    case 7:\n      m = 2;\n      break;\n    case 8:\n      m = 3;\n      break;\n    case 9:\n      m = 4;\n      break;\n    case 10:\n      m = 4;\n      break;\n    case 11:\n      m = 5;\n      break;\n    case 12:\n      m = 5;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  } else {\n    switch (a) {\n    case 0:\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 1;\n      break;\n    case 3:\n      m = -1;\n      break;\n    case 4:\n      m = 0;\n      break;\n    case 5:\n      m = 0;\n      break;\n    case 6:\n      m = 1;\n      break;\n    case 7:\n      m = 1;\n      break;\n    case 8:\n      m = 2;\n      break;\n    case 9:\n      m = 3;\n      break;\n    case 10:\n      m = 3;\n      break;\n    case 11:\n      m = 4;\n      break;\n    case 12:\n      m = 4;\n      break;\n    }\n    n = 30 * (a - 1) + m + b;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Y, M, D, x, y = 0, i, a[12], sum;\n  scanf(\"%d %d %d \", &Y, &M, &D);\n  a[0] = 31;\n  a[2] = 31;\n  a[4] = 31;\n  a[6] = 31;\n  a[7] = 31;\n  a[9] = 31;\n  a[11] = 31;\n  a[3] = 30;\n  a[5] = 30;\n  a[8] = 30;\n  a[10] = 30;\n  if (Y % 4 != 0)\n    a[1] = 28;\n  else if (Y % 4 == 0 && Y % 100 != 0)\n    a[1] = 29;\n  else if (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 1; i <= M; i++) {\n    x = a[M - i];\n    y = y + x;\n  }\n  sum = y + D - a[M - 1];\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  cin >> year >> month >> day;\n  int a[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 0; i < month; i++)\n      sum += a[1][i];\n    sum = sum + day - a[1][month - 1];\n  } else {\n    for (i = 0; i < month; i++)\n      sum += a[0][i];\n    sum = sum + day - a[0][month - 1];\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) \n  {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 60 + day;\n      break;\n    case 4:\n      n = 91 + day;\n      break;\n    case 5:\n      n = 121 + day;\n      break;\n    case 6:\n      n = 152 + day;\n      break;\n    case 7:\n      n = 182 + day;\n      break;\n    case 8:\n      n = 213 + day;\n      break;\n    case 9:\n      n = 244 + day;\n      break;\n    case 10:\n      n = 274 + day;\n      break;\n    case 11:\n      n = 305 + day;\n      break;\n    case 12:\n      n = 335 + day;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 30 + day;\n      break;\n    case 3:\n      n = 59 + day;\n      break;\n    case 4:\n      n = 90 + day;\n      break;\n    case 5:\n      n = 120 + day;\n      break;\n    case 6:\n      n = 151 + day;\n      break;\n    case 7:\n      n = 181 + day;\n      break;\n    case 8:\n      n = 212 + day;\n      break;\n    case 9:\n      n = 243 + day;\n      break;\n    case 10:\n      n = 273 + day;\n      break;\n    case 11:\n      n = 304 + day;\n      break;\n    case 12:\n      n = 334 + day;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  int leap(int y);\n  scanf(\"%d%d%d\", &y, &m, &d);\n  switch (m) {\n  case 12:\n    t += 30;\n  case 11:\n    t += 31;\n  case 10:\n    t += 30;\n  case 9:\n    t += 31;\n  case 8:\n    t += 31;\n  case 7:\n    t += 30;\n  case 6:\n    t += 31;\n  case 5:\n    t += 30;\n  case 4:\n    t += 31;\n  case 3:\n    t += 28;\n  case 2:\n    t += 31;\n  case 1:\n    t += 0;\n  }\n  if (m > 2 && leap(y))\n    t += 1;\n\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\nint leap(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "11", "index": "19872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], l[5] = {0}, i = 0;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n\n  for (i = 0; i < 5; i++) {\n    if ((year[i] % 4 == 0) && (year[i] % 100 != 0) || (year[i] % 400 == 0)) {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 29;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    } else {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 28;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    }\n    l[i] = l[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", l[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "19873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 60 + c;\n    if (b == 4)\n      d = 91 + c;\n    if (b == 5)\n      d = 121 + c;\n    if (b == 6)\n      d = 152 + c;\n    if (b == 7)\n      d = 182 + c;\n    if (b == 8)\n      d = 213 + c;\n    if (b == 9)\n      d = 244 + c;\n    if (b == 10)\n      d = 275 + c;\n    if (b == 11)\n      d = 305 + c;\n    if (b == 12)\n      d = 335 + c;\n    printf(\"%d\", d);\n  } else {\n    if (a % 4 == 0 && a % 100 != 0) {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 60 + c;\n      if (b == 4)\n        d = 91 + c;\n      if (b == 5)\n        d = 121 + c;\n      if (b == 6)\n        d = 152 + c;\n      if (b == 7)\n        d = 182 + c;\n      if (b == 8)\n        d = 213 + c;\n      if (b == 9)\n        d = 244 + c;\n      if (b == 10)\n        d = 275 + c;\n      if (b == 11)\n        d = 305 + c;\n      if (b == 12)\n        d = 335 + c;\n      printf(\"%d\", d);\n    } else {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 59 + c;\n      if (b == 4)\n        d = 90 + c;\n      if (b == 5)\n        d = 120 + c;\n      if (b == 6)\n        d = 151 + c;\n      if (b == 7)\n        d = 181 + c;\n      if (b == 8)\n        d = 212 + c;\n      if (b == 9)\n        d = 243 + c;\n      if (b == 10)\n        d = 274 + c;\n      if (b == 11)\n        d = 304 + c;\n      if (b == 12)\n        d = 334 + c;\n      printf(\"%d\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nian, yue, ri, leap, sum;\n  scanf(\"%d%d%d\", &nian, &yue, &ri);\n  switch (yue) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  }\n  sum = sum + ri;\n  if ((nian % 400 == 0) || (nian % 4 == 0 && nian % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && nian > 3 && yue > 2)\n    sum++;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int sum = 0;\n  int i;\n  int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 != 0) {\n    if (b == 1) {\n      cout << c << endl;\n    }\n    if (b > 1) {\n      for (i = 0; i < b - 1; i++)\n        sum = sum + m[i];\n      sum = sum + c;\n      cout << sum << endl;\n    }\n  }\n\n  if (a % 4 == 0) {\n    if (a % 100 != 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 100 == 0 && a % 400 != 0) {\n      if (b == 1) {\n        cout << c << endl;\n      }\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + m[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 400 == 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    int m[13] = {0, 31, 60, 91, 121, 151, 182, 213, 244, 274, 305, 335, 366};\n    d = m[b - 1] + c;\n  } else {\n    int m[13] = {0, 31, 59, 90, 120, 150, 181, 212, 243, 273, 304, 334, 365};\n    d = m[b - 1] + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, run = 0, M[13], i, D;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  D = d;\n  if ((y % 400 == 0) || ((y % 100 != 0) && (y % 4 == 0))) {\n    run = 1;\n  } else\n    run = 0;\n  for (i = 1; i < 13; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      M[i] = 31;\n      break;\n    default:\n      M[i] = 30;\n    }\n  }\n  if (run == 1) {\n    M[2] = 29;\n  } else\n    M[2] = 28;\n  for (i = 1; i < m; i++) {\n    D = D + M[i];\n  }\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "19878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, sum;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    sum = c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 60;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 91;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 121;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 152;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 182;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 213;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 244;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 274;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 305;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 335;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 59;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 90;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 120;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 151;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 181;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 212;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 243;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 273;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 304;\n      cout << sum;\n    }\n    if (b == 12) {\n      sum = c + 334;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint ping(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 28;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\nint run(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 29;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\n\nint main() {\n  int n, month, day, sum = 0;\n  cin >> n >> month >> day;\n  int i;\n  if ((n % 400 == 0) || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i < month; i++)\n      sum += run(i);\n    sum += day;\n    cout << sum;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += ping(i);\n    sum += day;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0)\n    return 1;\n  if (n % 400 == 0)\n    return 1;\n  return 0;\n}\nint yue(int y, int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (run(y) == 1 && n == 2)\n    return 29;\n  if (run(y) == 0 && n == 2)\n    return 28;\n  return 30;\n}\nint days(int y, int m, int d) {\n  int k = 0;\n  for (int i = 1; i < m; i++)\n    k += yue(y, i);\n  k += d;\n  return k;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  cout << days(y, m, d);\n  return 0;\n}\n"}
{"label": "11", "index": "19881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, sum = 0;\n  int a[20];\n  a[0] = 0;\n  a[1] = 31;\n  a[2] = 59;\n  a[3] = 90;\n  a[4] = 120;\n  a[5] = 151;\n  a[6] = 181;\n  a[7] = 212;\n  a[8] = 243;\n  a[9] = 273;\n  a[10] = 304;\n  a[11] = 334;\n  a[12] = 365;\n  cin >> b >> c >> d;\n  if ((b % 4 != 0) || (b % 100 == 0 && b % 400 != 0))\n    sum = a[c - 1] + d;\n  else {\n    if (c < 3)\n      sum = a[c - 1] + d;\n    else {\n      sum = a[c - 1] + d + 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19882", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int leap, year, month, day, sum = 0;\n  int a[2][12] = {{\n                      31,\n                      28,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                  },\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  leap = ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0));\n  for (int i = 0; i < month - 1; i++)\n    sum = sum + a[leap][i];\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, date, num;\n  for (i = 1; i <= 5; i++) {\n    cin >> year >> month >> date;\n    switch (month) {\n    case 1:\n      num = 0;\n      break;\n    case 2:\n      num = 31;\n      break;\n    case 3:\n      num = 59;\n      break;\n    case 4:\n      num = 90;\n      break;\n    case 5:\n      num = 120;\n      break;\n    case 6:\n      num = 151;\n      break;\n    case 7:\n      num = 181;\n      break;\n    case 8:\n      num = 212;\n      break;\n    case 9:\n      num = 243;\n      break;\n    case 10:\n      num = 273;\n      break;\n    case 11:\n      num = 304;\n      break;\n    case 12:\n      num = 334;\n      break;\n    }\n    if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month > 2)\n      num += 1;\n    num += date;\n    cout << num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19884", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], d[5], x[5], i;\n  for (i = 1; i <= 5; i++)\n    cin >> a[i] >> b[i] >> c[i];\n  for (i = 1; i <= 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0))\n      x[i] = 1;\n    else\n      x[i] = 0;\n    if (b[i] == 1)\n      d[i] = c[i];\n    else if (b[i] == 2)\n      d[i] = c[i] + 31;\n    else if (b[i] == 3)\n      d[i] = c[i] + 31 + 28 + x[i];\n    else if (b[i] == 4)\n      d[i] = c[i] + 31 + 28 + 31 + x[i];\n    else if (b[i] == 5)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + x[i];\n    else if (b[i] == 6)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 7)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + x[i];\n    else if (b[i] == 8)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 9)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + x[i];\n    else if (b[i] == 10)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + x[i];\n    else if (b[i] == 11)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 12)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + x[i];\n    printf(\"%d \", d[i]);\n  }\n}\n"}
{"label": "11", "index": "19885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint main() {\n  int year, month, day;\n  int i, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    map_1[2] = 29;\n  if (month == 1)\n    sum = day;\n  else {\n    for (i = 1; i < month; i++)\n      sum = sum + map_1[i];\n    sum = sum + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z, k = 0, i;\n  scanf(\"%d %d %d \", &x, &y, &z);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    for (i = 0; i < y - 1; i++)\n      k = k + b[i];\n  else\n    for (i = 0; i < y - 1; i++)\n      k = k + a[i];\n  k = k + z;\n  cout << k;\n  return 0;\n}\n"}
{"label": "11", "index": "19887", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, daynum;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0) {\n      int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    } else {\n      int num[12] = {31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    }\n  } else {\n    int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n    if (month >= 2)\n      daynum = num[month - 2] + day;\n    else\n      daynum = day;\n    printf(\"%d\", daynum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0;\n  int i;\n\n  for (i = 0; i < month; i++) {\n    sum += a[i - 1];\n  }\n  sum = sum + day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month <= 2)\n      printf(\"%d\\n\", sum);\n\n    if (month > 2) {\n      sum = sum + 1;\n      printf(\"%d\\n\", sum);\n    }\n  } else\n\n    printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int f[22];\n  scanf(\"%d %d %d\", &y, &m, &d);\n  f[0] = 31 + d;\n  f[1] = 60 + d;\n  f[2] = 91 + d;\n  f[3] = 121 + d;\n  f[4] = 152 + d;\n  f[5] = 182 + d;\n  f[6] = 213 + d;\n  f[7] = 244 + d;\n  f[8] = 274 + d;\n  f[9] = 305 + d;\n  f[10] = 335 + d;\n  f[11] = 31 + d;\n  f[12] = 59 + d;\n  f[13] = 90 + d;\n  f[14] = 120 + d;\n  f[15] = 151 + d;\n  f[16] = 181 + d;\n  f[17] = 212 + d;\n  f[18] = 243 + d;\n  f[19] = 273 + d;\n  f[20] = 304 + d;\n  f[21] = 334 + d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[0]);\n      break;\n    case 3:\n      printf(\"%d\", f[1]);\n      break;\n    case 4:\n      printf(\"%d\", f[2]);\n      break;\n    case 5:\n      printf(\"%d\", f[3]);\n      break;\n    case 6:\n      printf(\"%d\", f[4]);\n      break;\n    case 7:\n      printf(\"%d\", f[5]);\n      break;\n    case 8:\n      printf(\"%d\", f[6]);\n      break;\n    case 9:\n      printf(\"%d\", f[7]);\n      break;\n    case 10:\n      printf(\"%d\", f[8]);\n      break;\n    case 11:\n      printf(\"%d\", f[9]);\n      break;\n    case 12:\n      printf(\"%d\", f[10]);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[11]);\n      break;\n    case 3:\n      printf(\"%d\", f[12]);\n      break;\n    case 4:\n      printf(\"%d\", f[13]);\n      break;\n    case 5:\n      printf(\"%d\", f[14]);\n      break;\n    case 6:\n      printf(\"%d\", f[15]);\n      break;\n    case 7:\n      printf(\"%d\", f[16]);\n      break;\n    case 8:\n      printf(\"%d\", f[17]);\n      break;\n    case 9:\n      printf(\"%d\", f[18]);\n      break;\n    case 10:\n      printf(\"%d\", f[19]);\n      break;\n    case 11:\n      printf(\"%d\", f[20]);\n      break;\n    case 12:\n      printf(\"%d\", f[21]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, date;\n  int a, b, c, e, g, h, j;\n  int d, f, i, k;\n\n  a = c = e = g = h = j = 31;\n  d = f = i = k = 30;\n\n  cin >> year >> month >> date;\n\n  if ((year % 4 != 0) || (year % 100 == 0 && year % 400 != 0))\n    b = 28;\n  else\n    b = 29;\n\n  switch (month) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = a + date;\n    break;\n  case 3:\n    day = a + b + date;\n    break;\n  case 4:\n    day = a + b + c + date;\n    break;\n  case 5:\n    day = a + b + c + d + date;\n    break;\n  case 6:\n    day = a + b + c + d + e + date;\n    break;\n  case 7:\n    day = a + b + c + d + e + f + date;\n    break;\n  case 8:\n    day = a + b + c + d + e + f + g + date;\n    break;\n  case 9:\n    day = a + b + c + d + e + f + g + h + date;\n    break;\n  case 10:\n    day = a + b + c + d + e + f + g + h + i + date;\n    break;\n  case 11:\n    day = a + b + c + d + e + f + g + h + i + j + date;\n    break;\n  case 12:\n    day = a + b + c + d + e + f + g + h + i + j + k + date;\n    break;\n  }\n\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19891", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int just(int y);\n\n  int y, m, d, t = 0;\n\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (just(y) == 1) {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += b[i];\n\n  } else {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += a[i];\n  }\n  cout << t + d;\n\n  return 0;\n}\n\nint just(int y) {\n  int m = 0;\n\n  if (y % 4 == 0 && y % 100 != 0) {\n    return 1;\n  }\n  if (y % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, d;\n  int result = 0;\n  int i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 31, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &d);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    a[2] = a[2] + 1;\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n    result += d;\n  } else\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n  result += d;\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "19893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, month2, n;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    month2 = 29;\n  else\n    month2 = 28;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 31 + month2 + day;\n  if (month == 4)\n    n = 31 + month2 + 31 + day;\n  if (month == 5)\n    n = 31 + month2 + 31 + 30 + day;\n  if (month == 6)\n    n = 31 + month2 + 31 + 30 + 31 + day;\n  if (month == 7)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + day;\n  if (month == 8)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == 9)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == 10)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == 11)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == 12)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    n = c;\n    break;\n  case 2:\n    n = 31 + c;\n    break;\n  case 3:\n    n = 31 + 28 + c;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + c;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + c;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    break;\n  }\n  if (((a % 100 == 0 && a % 400 == 0) || (a % 400 == 0)) && b >= 3)\n    n = n + 1;\n  cout << n;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day;\n  cin >> year >> mon >> day;\n  int days = 0;\n  int ar[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int br[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (int i = 0; i < mon - 1; i++)\n      days += br[i];\n  } else {\n    for (int i = 0; i < mon - 1; i++)\n      days += ar[i];\n  }\n  days += day;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19896", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, m, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || a % 4 == 0 && a % 100 != 0) {\n    m = 29;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    m = 28;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, n = 0;\n  int a[12];\n  a[0] = 31;\n  a[1] = 28;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n\n  for (i = 0; i < m - 1; i++)\n    n += a[i];\n  n = n + d;\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "19898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 29 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 29 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 28 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 28 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      cout << 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  }\n  printf(\"\\n\");\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, t;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  t = 0;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      t += 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      t += 30;\n      break;\n    default:\n      if (y % 400 == 0)\n        t += 29;\n      else if ((y % 100 != 0) && (y % 4 == 0))\n        t += 29;\n      else\n        t += 28;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n}\n"}
{"label": "11", "index": "19900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, m = 0, n, r = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))\n    r = 1;\n  if (r == 1)\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 60;\n      break;\n    case 4:\n      m = 91;\n      break;\n    case 5:\n      m = 121;\n      break;\n    case 6:\n      m = 152;\n      break;\n    case 7:\n      m = 182;\n      break;\n    case 8:\n      m = 213;\n      break;\n    case 9:\n      m = 244;\n      break;\n    case 10:\n      m = 274;\n      break;\n    case 11:\n      m = 305;\n      break;\n    case 12:\n      m = 335;\n      break;\n    }\n  else\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n  n = m + c;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400) == 0) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "19902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1) {\n    a = day;\n  } else if (mon == 2) {\n    a = 31 + day;\n  } else if (mon > 2) {\n    if (mon == 3) {\n      a = 31 + 29 + day;\n    } else if (mon == 4) {\n      a = 31 + 29 + 31 + day;\n    } else if (mon == 5) {\n      a = 31 + 29 + 31 + 30 + day;\n    } else if (mon == 6) {\n      a = 31 + 29 + 31 + 30 + 31 + day;\n    } else if (mon == 7) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    } else if (mon == 8) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    } else if (mon == 9) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    } else if (mon == 10) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    } else if (mon == 11) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    } else if (mon == 12) {\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n    if (year % 400 == 0 || year % 100 != 0 && year % 4 == 0)\n      a = a;\n    else\n      a = a - 1;\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  static int d[13] = {0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0)\n    d[2] = 29;\n  else\n    d[2] = 28;\n  int i, sum = 0;\n  for (i = 1; i < b; i++) {\n    sum += d[i];\n  }\n  sum += c;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int n) {\n  int sum;\n  switch (n) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = (31 + 28);\n    break;\n  case 4:\n    sum = (31 + 28 + 31);\n    break;\n  case 5:\n    sum = (31 * 2 + 28 + 30);\n    break;\n  case 6:\n    sum = (31 * 3 + 28 + 30);\n    break;\n  case 7:\n    sum = (31 * 3 + 28 + 30 * 2);\n    break;\n  case 8:\n    sum = (31 * 4 + 28 + 30 * 2);\n    break;\n  case 9:\n    sum = (31 * 5 + 28 + 30 * 2);\n    break;\n  case 10:\n    sum = (31 * 5 + 28 + 30 * 3);\n    break;\n  case 11:\n    sum = (31 * 6 + 28 + 30 * 3);\n    break;\n  case 12:\n    sum = (31 * 6 + 28 + 30 * 4);\n  }\n  return (sum);\n}\nint main() {\n  int month[5], day[5], year[5], d[5], i;\n  for (i = 0; i <= 4; i++)\n    cin >> year[i] >> month[i] >> day[i];\n  for (i = 0; i <= 4; i++) {\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0) &&\n        month[i] > 2)\n      d[i] = f(month[i]) + day[i] + 1;\n    else\n      d[i] = f(month[i]) + day[i];\n    cout << d[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint mon(int n) {\n  int day;\n  switch (n) {\n  case 1:\n    day = 31;\n    break;\n  case 2:\n    day = 28;\n    break;\n  case 3:\n    day = 31;\n    break;\n  case 4:\n    day = 30;\n    break;\n  case 5:\n    day = 31;\n    break;\n  case 6:\n    day = 30;\n    break;\n  case 7:\n    day = 31;\n    break;\n  case 8:\n    day = 31;\n    break;\n  case 9:\n    day = 30;\n    break;\n  case 10:\n    day = 31;\n    break;\n  case 11:\n    day = 30;\n    break;\n  case 12:\n    day = 31;\n    break;\n  }\n  return (day);\n}\nint run(int year) {\n  int p;\n  if (year % 400 == 0)\n    p = 1;\n  else if ((year % 100 != 0) && (year % 4 == 0))\n    p = 1;\n  else\n    p = 0;\n  return (p);\n}\n\nint main() {\n  int year, month, date, i, n = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n  for (i = 1; i <= month - 1; i++) {\n    n = n + mon(i);\n  }\n  n = n + date;\n  if (run(year) == 1)\n    n = n + 1;\n  else\n    n = n;\n  cout << n;\n\n  return (0);\n}\n"}
{"label": "11", "index": "19906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct date {\n    int year;\n    int month;\n    int day;\n    int days;\n  } date1;\n  cin >> date1.year >> date1.month >> date1.day;\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  date1.days = 0;\n  int i;\n  if (date1.month > 1) {\n    for (i = 0; i <= date1.month - 2; i++) {\n      date1.days = date1.days + b[i];\n    }\n    date1.days = date1.days + date1.day;\n  } else {\n    date1.days = date1.day;\n  }\n  cout << date1.days;\n  return 0;\n}\n"}
{"label": "11", "index": "19907", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year;\n  int month;\n  int day;\n  int data1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int data2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int in = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 || year % 100 == 0 && year % 400 == 0) {\n    int i = month - 1;\n    for (; i >= 0; i--) {\n      in += data2[i];\n    }\n    in += day;\n  } else {\n    int i = month - 1;\n    for (; i >= 0; i--) {\n      in += data1[i];\n    }\n    in += day;\n  }\n  printf(\"%d\\n\", in);\n  return 0;\n}\n"}
{"label": "11", "index": "19908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100) != 0 || (y % 400 == 0))\n    days[2]++;\n  c = d;\n  for (i = 1; i < m; i++)\n    c = c + days[i];\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "19909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int mun, day, year, i;\n  int days = 0;\n  cin >> year >> mun >> day;\n  days += day;\n  for (i = 1; i < mun; i++) {\n    days += a[i];\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      days += 1;\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "19910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, days;\n  scanf(\"%d %d %d\", &year, &month, &days);\n  int day;\n  if (month == 1) {\n    day = days;\n  }\n  if (month == 2) {\n    day = 31 + days;\n  }\n  if (month == 3) {\n    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n      day = 31 + 29 + days;\n    else\n      day = 31 + 28 + days;\n  }\n  if (month == 4) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + days;\n    else\n      day = 31 + 28 + 31 + days;\n  }\n  if (month == 5) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + days;\n  }\n  if (month == 6) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 30 + 31 + 31 + days;\n  }\n  if (month == 7) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + days;\n  }\n  if (month == 8) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + days;\n  }\n  if (month == 9) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n  }\n  if (month == 10) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n  }\n  if (month == 11) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n  }\n  if (month == 12) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n  }\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "19911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  switch (b) {\n  case 1:\n    e = c;\n    break;\n  case 2:\n    e = 31 + c;\n    break;\n  case 3:\n    e = 31 + d + c;\n    break;\n  case 4:\n    e = 62 + d + c;\n    break;\n  case 5:\n    e = 92 + d + c;\n    break;\n  case 6:\n    e = 123 + d + c;\n    break;\n  case 7:\n    e = 153 + d + c;\n    break;\n  case 8:\n    e = 184 + d + c;\n    break;\n  case 9:\n    e = 215 + d + c;\n    break;\n  case 10:\n    e = 245 + d + c;\n    break;\n  case 11:\n    e = 276 + d + c;\n    break;\n  case 12:\n    e = 306 + d + c;\n    break;\n  }\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "19912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int result = 0;\n  int i;\n  int yue[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 100 == 0 && year % 400 == 0) || year % 100 != 0 && year % 4 == 0)\n    yue[1] = 29;\n  if (month == 1) {\n    result = result + day;\n    printf(\"%d\", result);\n  }\n  if (month > 1) {\n    for (i = 0; i < month - 1; i++) {\n      result = result + yue[i];\n    }\n    result = result + day;\n    printf(\"%d \", result);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, date, num;\n  for (i = 1; i <= 5; i++) {\n    cin >> year >> month >> date;\n    switch (month) {\n    case 1:\n      num = 0;\n      break;\n    case 2:\n      num = 31;\n      break;\n    case 3:\n      num = 59;\n      break;\n    case 4:\n      num = 90;\n      break;\n    case 5:\n      num = 120;\n      break;\n    case 6:\n      num = 151;\n      break;\n    case 7:\n      num = 181;\n      break;\n    case 8:\n      num = 212;\n      break;\n    case 9:\n      num = 243;\n      break;\n    case 10:\n      num = 273;\n      break;\n    case 11:\n      num = 304;\n      break;\n    case 12:\n      num = 334;\n      break;\n    }\n    if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month > 2)\n      num += 1;\n    num += date;\n    printf(\"%d\\n\", num);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19914", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  cin >> year >> month >> day;\n  if (month == 1) {\n    n = day;\n  } else if (month == 2) {\n    n = 31 + day;\n  } else if ((year % 4 != 0 || year % 100 == 0) && year % 400 != 0) {\n    if (month < 8) {\n      if (month % 2 == 0) {\n        n = 31 * (month - 1) - 2 - month / 2 + day;\n      } else\n        n = 31 * (month - 1) - 2 - (month - 1) / 2 + day;\n    } else if (month % 2 == 0) {\n      n = 31 * 4 + 28 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n    } else\n      n = 31 * 4 + 28 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  } else if (month < 8) {\n    if (month % 2 == 0) {\n      n = 31 * (month - 1) - 1 - month / 2 + day;\n    } else\n      n = 31 * (month - 1) - 1 - (month - 1) / 2 + day;\n  } else if (month % 2 == 0) {\n    n = 31 * 4 + 29 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n  } else\n    n = 31 * 4 + 29 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    int m[13] = {0, 31, 60, 91, 121, 151, 182, 213, 244, 274, 305, 335, 366};\n    d = m[b - 1] + c;\n  } else {\n    int m[13] = {0, 31, 59, 90, 120, 150, 181, 212, 243, 273, 304, 334, 365};\n    d = m[b - 1] + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 29 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 29 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 29 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 28 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 28 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d = 0;\n  cin >> a >> b >> c;\n  if (b >= 2)\n    d = d + 31;\n  if (b >= 3)\n    d = d + 28;\n  if (b >= 4)\n    d = d + 31;\n  if (b >= 5)\n    d = d + 30;\n  if (b >= 6)\n    d = d + 31;\n  if (b >= 7)\n    d = d + 30;\n  if (b >= 8)\n    d = d + 31;\n  if (b >= 9)\n    d = d + 31;\n  if (b >= 10)\n    d = d + 30;\n  if (b >= 11)\n    d = d + 31;\n  if (b >= 12)\n    d = d + 31;\n  d = d + c;\n  if (((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) && b > 2)\n    d = d + 1;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A, B, C, d, z, leap, i;\n  i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d\\n\", &A, &B, &C);\n    if (A % 4 == 0) {\n      if (A % 100 == 0) {\n        if (A % 400 == 0)\n          leap = 1;\n        else\n          leap = 0;\n      } else\n        leap = 1;\n    } else\n      leap = 0;\n    if (leap) {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      z = d + C;\n    } else {\n      switch (B) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      z = d + C;\n    }\n    cout << z << \"\\n\";\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19919", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s, i, l;\n  s = 0;\n  cin >> y >> m >> d;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 1; i < m; i++) {\n    s = s + a[i];\n  }\n  s = s + d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        l = 1;\n      else\n        l = 0;\n    } else\n      l = 1;\n  } else\n    l = 0;\n  if (m > 2)\n    s = s + l;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "19920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int i;\n  int a = 0;\n  int b = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int N1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int N2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (day < 1 || day > N2[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N2[i];\n      }\n      b = a - day;\n    }\n  } else {\n    if (day < 1 || day > N1[month]) {\n      cout << \"wrong\\n\";\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N1[i];\n      }\n      b = a - day;\n    }\n  }\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19921", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, day, num = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    a[2]++;\n  for (int i = 1; i < month; i++)\n    num += a[i];\n  num += day;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19922", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int mth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int leap;\n  int sum = 0;\n  int i;\n\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap)\n    mth[2] = 29;\n\n  for (i = 1; i <= m - 1; i++)\n    sum = sum + mth[i];\n\n  sum = sum + d;\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int daysa[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int daysb[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  int num = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int i;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i <= m - 1; i++)\n      num = num + daysa[i - 1];\n\n    num = num + d;\n  } else {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysb[i - 1];\n    }\n    num = num + d;\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "19924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    n = n + day;\n  else if (month == 2) {\n    n = n + 31 + day;\n  } else if (month == 3)\n    n = n + 59 + day;\n  else if (month == 4)\n    n = n + 90 + day;\n  else if (month == 5)\n    n = n + 120 + day;\n  else if (month == 6)\n    n = n + 151 + day;\n  else if (month == 7)\n    n = n + 181 + day;\n  else if (month == 8)\n    n = n + 212 + day;\n  else if (month == 9)\n    n = n + 243 + day;\n  else if (month == 10)\n    n = n + 273 + day;\n  else if (month == 11)\n    n = n + 304 + day;\n  else {\n    n = n + 334 + day;\n  }\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    n = n + 1;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19925", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, sum;\n  cin >> a >> b >> c;\n  sum = 0;\n  for (i = 1; i < b; i++) {\n    switch (i) {\n    case 1:\n      sum += 31;\n      break;\n    case 2:\n      if (a % 400 == 0 || (a % 100 != 0) && (a % 4 == 0)) {\n        sum += 29;\n      } else {\n        sum += 28;\n      }\n      break;\n    case 3:\n      sum += 31;\n      break;\n    case 4:\n      sum += 30;\n      break;\n    case 5:\n      sum += 31;\n      break;\n    case 6:\n      sum += 30;\n      break;\n    case 7:\n      sum += 31;\n      break;\n    case 8:\n      sum += 31;\n      break;\n    case 9:\n      sum += 30;\n      break;\n    case 10:\n      sum += 31;\n      break;\n    case 11:\n      sum += 30;\n      break;\n    case 12:\n      sum += 31;\n      break;\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint run(int x) {\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    return 1;\n  return 0;\n}\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (run(y)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 60 + d;\n      break;\n    case 4:\n      x = 91 + d;\n      break;\n    case 5:\n      x = 121 + d;\n      break;\n    case 6:\n      x = 152 + d;\n      break;\n    case 7:\n      x = 182 + d;\n      break;\n    case 8:\n      x = 213 + d;\n      break;\n    case 9:\n      x = 244 + d;\n      break;\n    case 10:\n      x = 274 + d;\n      break;\n    case 11:\n      x = 305 + d;\n      break;\n    case 12:\n      x = 335 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 59 + d;\n      break;\n    case 4:\n      x = 90 + d;\n      break;\n    case 5:\n      x = 120 + d;\n      break;\n    case 6:\n      x = 151 + d;\n      break;\n    case 7:\n      x = 181 + d;\n      break;\n    case 8:\n      x = 212 + d;\n      break;\n    case 9:\n      x = 243 + d;\n      break;\n    case 10:\n      x = 273 + d;\n      break;\n    case 11:\n      x = 304 + d;\n      break;\n    case 12:\n      x = 334 + d;\n      break;\n    }\n  }\n  printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int y, m, d, a, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4) == 0 && (y % 100) != 0 || (y % 400 == 0))\n    a = 1;\n  else\n    a = 0;\n\n  switch (m) {\n  case 1:\n    n = d;\n    break;\n  case 2:\n    n = 31 + d;\n    break;\n  case 3:\n    n = 31 + 28 + d;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  if (a == 0)\n    printf(\"%d\", n);\n\n  if (m != 1 && m != 2 && a == 1) {\n    n = n + 1;\n    printf(\"%d\", n);\n  }\n  if (a == 1 && m == 1)\n    printf(\"%d\", n);\n  if (a == 1 && m == 2)\n    printf(\"%d\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "19928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, daynum;\n  cin >> year >> month >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0) {\n      int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    } else {\n      int num[12] = {31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366};\n      if (month >= 2)\n        daynum = num[month - 2] + day;\n      else\n        daynum = day;\n      printf(\"%d\", daynum);\n    }\n  } else {\n    int num[12] = {31, 50, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};\n    if (month >= 2)\n      daynum = num[month - 2] + day;\n    else\n      daynum = day;\n    printf(\"%d\", daynum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else if (year % 4 == 0 && year % 100 != 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 59);\n    if (month == 4)\n      printf(\"%d\", day + 90);\n    if (month == 5)\n      printf(\"%d\", day + 120);\n    if (month == 6)\n      printf(\"%d\", day + 151);\n    if (month == 7)\n      printf(\"%d\", day + 181);\n    if (month == 8)\n      printf(\"%d\", day + 212);\n    if (month == 9)\n      printf(\"%d\", day + 243);\n    if (month == 10)\n      printf(\"%d\", day + 273);\n    if (month == 11)\n      printf(\"%d\", day + 304);\n    if (month == 12)\n      printf(\"%d\", day + 334);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i = 1, n, x = 0;\n  int f[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int isleapyear(int a);\n  while (x <= 4) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    n = 0;\n\n    for (i = 1; i < b; i++) {\n\n      n += f[i];\n    }\n\n    n += c;\n    if (b > 2 && isleapyear(a))\n      n += 1;\n\n    printf(\"%d\\n\", n);\n    x++;\n  }\n  return 0;\n}\nint isleapyear(int a) {\n  return ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0));\n}\n"}
{"label": "11", "index": "19931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    a[2] = 29;\n  int sum = 0;\n  for (int i = 1; i < month; i++)\n    sum = sum + a[i];\n\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0)) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n\n  else if (a % 400 == 0) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  } else {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 28 + c;\n    }\n    if (b == 4) {\n      y = 31 + 28 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 28 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 28 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 29 + d;\n          break;\n        case 4:\n          x = 31 + 29 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 29 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 29 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      } else {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 28 + d;\n          break;\n        case 4:\n          x = 31 + 28 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 28 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 28 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        cout << x << \"\\n\";\n      }\n    else {\n      switch (m) {\n      case 1:\n        x = d;\n        break;\n      case 2:\n        x = 31 + d;\n        break;\n      case 3:\n        x = 31 + 29 + d;\n        break;\n      case 4:\n        x = 31 + 29 + 31 + d;\n        break;\n      case 5:\n        x = 31 + 29 + 31 + 30 + d;\n        break;\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31 + d;\n        break;\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n        break;\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n        break;\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n        break;\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n        break;\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n        break;\n      }\n      printf(\"%d\\n\", x);\n    }\n  else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d >> n;\n  if (y % 4 == 0 && y % 100 != 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  }\n  if (y % 400 == 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else {\n      if (m <= 8) {\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n\n      } else {\n        if (m % 2 == 0)\n          n = (m - 1) * 30 - 1 + m / 2 + d;\n        else\n          n = (m - 1) * 30 + m / 2 + d;\n      }\n    }\n  } else {\n\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 2 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 2 + m / 2 + d;\n      else\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n    }\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d, m, y, sum, leap;\n  cin >> y >> m >> d;\n  switch (m) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    cout << \"data error\";\n    break;\n  }\n  sum = sum + d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && m > 2)\n    sum++;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Runnian(int y);\nint main() {\n  int y, m, d, count = 0;\n  int i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      count += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      count += 30;\n    else if (i == 2) {\n      if (Runnian(y))\n        count += 29;\n      else\n        count += 28;\n    }\n  }\n  count += d;\n  cout << count << \"\\n\";\n  return 0;\n}\nint Runnian(int y) {\n  int result;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\n"}
{"label": "11", "index": "19937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int y, int m, int d) {\n  int a[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, c;\n  c = 0;\n  for (i = 0; i < m; i++) {\n    c = c + a[i];\n  }\n  c = c + d;\n  if ((m > 2) && (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)))\n    c++;\n  return c;\n}\n\nint main() {\n  int i, a, b, c;\n  for (i = 0; i < 100; i++)\n    if (scanf(\"%d %d %d \", &a, &b, &c))\n      printf(\"%d\\n\", fun(a, b, c));\n  return 0;\n}\n"}
{"label": "11", "index": "19938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day;\n  cin >> year >> mon >> day;\n  int days = 0;\n  int ar[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int br[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (int i = 0; i < mon - 1; i++)\n      days += br[i];\n  } else {\n    for (int i = 0; i < mon - 1; i++)\n      days += ar[i];\n  }\n  days += day;\n  cout << days << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int a[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if ((year % 4 != 0) || ((year % 100 == 0) && (year % 400 != 0)))\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum = sum + day;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19940", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int a[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};\n    d = a[b - 1] + c;\n    printf(\"%d\\n\", d);\n  } else {\n    int a[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n    d = a[b - 1] + c;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "11", "index": "19942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, m;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 29 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 29 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (b == 1)\n      cout << c;\n\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 28 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 28 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19943", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, n, d, x = 0, i = 1, z;\n  int m[13];\n  m[1] = m[3] = m[5] = m[7] = m[8] = m[10] = m[12] = 31;\n  m[4] = m[6] = m[9] = m[11] = 30;\n  m[2] = 29;\n  cin >> y >> n >> d;\n  if (n == 1) {\n    x = d;\n    z = x;\n  } else {\n    if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n        z = x + d;\n      }\n    } else {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n      }\n      z = x + d - 1;\n    }\n  }\n\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "11", "index": "19944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    day[1] = 29;\n  for (int i = 0; i < m - 1; i++)\n    d += day[i];\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "19945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int monthday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  for (int i = 1; i < month; i++) {\n    sum += monthday[i - 1];\n  }\n  sum += day;\n  if (month > 2 && (!year % 4 == 0 && year % 100 != 0 || year % 400 != 0)) {\n    sum -= 1;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int sum = 0;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      for (int i = 0; i <= (month - 2); i++)\n        sum += mon[i];\n\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  } else if (year % 4 != 0 || year % 100 == 0 && year % 400 != 0) {\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (int i = 0; i <= (month - 2); i++)\n        sum += mon[i];\n\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "19947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int y, m, d; \n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 100 == 0 && y % 40 == 0 ||\n      y % 100 != 0 && y % 4 == 0) \n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 335);\n      break;\n    }\n  else\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 334);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "19948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d[12], sum = 0;\n  int i;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      d[i] = 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      d[i] = 30;\n    } else {\n      if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n        d[2] = 29;\n      } else {\n        d[2] = 28;\n      }\n    }\n    sum += d[i];\n  }\n  printf(\"%d\\n\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "19949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, D;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (month == 1) {\n    D = day;\n  }\n  if (month == 2) {\n    D = day + 31;\n  }\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 3) {\n      D = day + 31 + 29;\n    }\n    if (month == 4) {\n      D = day + 31 + 29 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 29 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 3) {\n      D = day + 31 + 28;\n    }\n    if (month == 4) {\n      D = day + 31 + 28 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 28 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  printf(\"%d\\n\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "19950", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, d, i, j,\n      counter = 0,\n      month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> n >> m >> d;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) {\n    for (i = 0; i < m - 1; i++)\n      counter += month2[i];\n    counter += d;\n    cout << counter << endl;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      counter += month1[i];\n    counter += d;\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int a = d;\n  for (i = 1; i <= m - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      a += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      a += 30;\n    } else {\n      if ((n % 100 == 0 && n % 400 != 0) || n % 4 != 0) {\n        a += 28;\n\n      } else {\n        a += 29;\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "19952", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, month2, n;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    month2 = 29;\n  else\n    month2 = 28;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 31 + month2 + day;\n  if (month == 4)\n    n = 31 + month2 + 31 + day;\n  if (month == 5)\n    n = 31 + month2 + 31 + 30 + day;\n  if (month == 6)\n    n = 31 + month2 + 31 + 30 + 31 + day;\n  if (month == 7)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + day;\n  if (month == 8)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == 9)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == 10)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == 11)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == 12)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, t;\n  cin >> y >> m >> d;\n  t = 0;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      t += 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      t += 30;\n      break;\n    default:\n      if (y % 400 == 0)\n        t += 29;\n      else if ((y % 100 != 0) && (y % 4 == 0))\n        t += 29;\n      else\n        t += 28;\n    }\n  }\n  t += d;\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "19954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, j, k, sum = 0, a;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i <= (m - 1); i++) {\n    if (i == 1)\n      sum = sum + 31;\n    if (i == 3)\n      sum = sum + 31;\n    if (i == 5)\n      sum = sum + 31;\n    if (i == 7)\n      sum = sum + 31;\n    if (i == 8)\n      sum = sum + 31;\n    if (i == 10)\n      sum = sum + 31;\n    if (i == 12)\n      sum = sum + 31;\n    if (i == 4)\n      sum = sum + 30;\n    if (i == 6)\n      sum = sum + 30;\n    if (i == 9)\n      sum = sum + 30;\n\n    if (i == 11)\n      sum = sum + 30;\n    if (i == 2) {\n      j = y % 4, k = y % 400, a = y % 100;\n      if ((a != 0 && j == 0) || (k == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    }\n  }\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[5], c[5], k[5];\n  long a[5];\n  int j;\n  for (j = 1; j <= 5; j++)\n    scanf(\"%ld %d %d\", &a[j - 1], &b[j - 1], &c[j - 1]);\n  for (j = 1; j <= 5; j++) {\n    int i, l, x;\n    if (a[j - 1] % 4 != 0)\n      l = 28;\n    else {\n      if ((a[j - 1] % 100 == 0) && (a[j - 1] % 400 != 0))\n        l = 28;\n      else\n        l = 29;\n    }\n    x = 0;\n    for (i = 1; i <= b[j - 1] - 1; i++) {\n      switch (i) {\n      case 1:\n        x = x + 31;\n        break;\n      case 2:\n        x = x + l;\n        break;\n      case 3:\n        x = x + 31;\n        break;\n      case 4:\n        x = x + 30;\n        break;\n      case 5:\n        x = x + 31;\n        break;\n      case 6:\n        x = x + 30;\n        break;\n      case 7:\n        x = x + 31;\n        break;\n      case 8:\n        x = x + 31;\n        break;\n      case 9:\n        x = x + 30;\n        break;\n      case 10:\n        x = x + 31;\n        break;\n      case 11:\n        x = x + 30;\n        break;\n      case 12:\n        x = x + 31;\n        break;\n      }\n    }\n    x = x + c[j - 1];\n    int m;\n    m = j - 1;\n    k[m] = x;\n    printf(\"%d\\n\", k[m]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    days = days + d[i - 1];\n  }\n  days = days + day;\n  if ((year % 4 == 0 || year % 400 == 0) && month > 2)\n    days = days++;\n  printf(\"%d\", days);\n}\n"}
{"label": "11", "index": "19957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  cin >> year >> month >> day;\n  int pin[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + run[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  } else {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + pin[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int day, month, year, sum, leap;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    printf(\"data error \");\n    break;\n  }\n  sum = sum + day;\n  if (year % 400 == 0 || (year & 4 == 0 && year % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && month > 2)\n    sum = sum + 1;\n  printf(\"%d \", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, num;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 29;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 29 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 29 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 29 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  } else {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 28;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 28 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 28 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 28 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint ping(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 28;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\nint run(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 29;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\n\nint main() {\n  int n, month, day, sum = 0;\n  scanf(\"%d %d %d \", &n, &month, &day);\n  int i;\n  if ((n % 400 == 0) || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i < month; i++)\n      sum += run(i);\n    sum += day;\n    cout << sum;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += ping(i);\n    sum += day;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int isleapyear;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  isleapyear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n  if (isleapyear && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (isleapyear && month != 2 && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n  for (i = 0; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && isleapyear)\n    n++;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "19962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0, days, year, month;\n  scanf(\"%d%d%d\", &year, &month, &days);\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + days;\n  if ((month == 2 && days >= 28) || (month > 2)) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      sum = sum + 1;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19963", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year;\n  short month, day, result = 0, i = 1;\n  char odd;\n  while (i <= 5) {\n    cin >> year >> month >> day;\n    odd = year % 400 == 0 || year % 4 == 0 && year % 100 != 0 ? 1 : 0;\n    switch (month) {\n    case 12:\n      result += 30;\n    case 11:\n      result += 31;\n    case 10:\n      result += 30;\n    case 9:\n      result += 31;\n    case 8:\n      result += 31;\n    case 7:\n      result += 30;\n    case 6:\n      result += 31;\n    case 5:\n      result += 30;\n    case 4:\n      result += 31;\n    case 3:\n      result += 28;\n    case 2:\n      result += 31;\n    case 1:;\n    }\n    if (month >= 3)\n      result += odd;\n    result += day;\n    printf(\"%hd\\n\", result);\n    result = 0;\n    i++;\n  }\n  return (0);\n}\n"}
{"label": "11", "index": "19964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 29);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 29 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 31 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      cout << d + 31 + 28;\n    if (m == 4)\n      printf(\"%d\", d + 31 + 28 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 30 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 30);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30);\n    if (m == 10)\n      cout << d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 29;\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 30);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 29);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 60;\n      break;\n    case 4:\n      day = day + 91;\n      break;\n    case 5:\n      day = day + 121;\n      break;\n    case 6:\n      day = day + 152;\n      break;\n    case 7:\n      day = day + 182;\n      break;\n    case 8:\n      day = day + 213;\n      break;\n    case 9:\n      day = day + 244;\n      break;\n    case 10:\n      day = day + 274;\n      break;\n    case 11:\n      day = day + 305;\n      break;\n    case 12:\n      day = day + 335;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      day = day;\n      break;\n    case 2:\n      day = day + 31;\n      break;\n    case 3:\n      day = day + 59;\n      break;\n    case 4:\n      day = day + 90;\n      break;\n    case 5:\n      day = day + 120;\n      break;\n    case 6:\n      day = day + 151;\n      break;\n    case 7:\n      day = day + 181;\n      break;\n    case 8:\n      day = day + 212;\n      break;\n    case 9:\n      day = day + 243;\n      break;\n    case 10:\n      day = day + 273;\n      break;\n    case 11:\n      day = day + 304;\n      break;\n    case 12:\n      day = day + 334;\n      break;\n    }\n  }\n  cout << day;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d[12] = {0};\n  int a, b, c, i, sum = 0;\n  int run(int x);\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10)) {\n      d[i] = 31;\n      sum += d[i];\n    } else if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      d[i] = 30;\n      sum += d[i];\n    } else {\n      if (run(a) == 1) {\n        d[i] = 29;\n      } else\n        d[i] = 28;\n      sum += d[i];\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\nint run(int x) {\n  int z;\n  if ((x % 400 == 0) || ((x % 100 != 0) && (x % 4 == 0)))\n    z = 1;\n  return z;\n}\n"}
{"label": "11", "index": "19967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z;\n  cin >> x >> y >> z;\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else\n    D = n + z;\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "19968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[11];\n  int y, m, d, i, leap, total = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  for (i = 0; i < m - 1; i++)\n    total += a[i];\n  total += d;\n  cout << total;\n  return 0;\n}\n"}
{"label": "11", "index": "19969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int sum = 0;\n  int i;\n  int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 != 0) {\n    if (b == 1) {\n      cout << c << endl;\n    }\n    if (b > 1) {\n      for (i = 0; i < b - 1; i++)\n        sum = sum + m[i];\n      sum = sum + c;\n      cout << sum << endl;\n    }\n  }\n\n  if (a % 4 == 0) {\n    if (a % 100 != 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << \"\\n\";\n      }\n    }\n    if (a % 100 == 0 && a % 400 != 0) {\n      if (b == 1)\n        cout << c << endl;\n\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + m[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n    if (a % 400 == 0) {\n      if (b == 1)\n        cout << c << endl;\n      if (b > 1) {\n        for (i = 0; i < b - 1; i++)\n          sum = sum + n[i];\n        sum = sum + c;\n        cout << sum << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19970", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  long int a[5], b[5], c[5], ts[5], i;\n  for (i = 1; i <= 5; i++)\n    scanf(\"%ld %ld %ld\", &a[i], &b[i], &c[i]);\n  for (i = 1; i <= 5; i++) {\n    switch (b[i]) {\n    case 1:\n      ts[i] = c[i];\n      break;\n    case 2:\n      ts[i] = c[i] + 31;\n      break;\n    case 3:\n      ts[i] = c[i] + 59;\n      break;\n    case 4:\n      ts[i] = c[i] + 90;\n      break;\n    case 5:\n      ts[i] = c[i] + 120;\n      break;\n    case 6:\n      ts[i] = c[i] + 151;\n      break;\n    case 7:\n      ts[i] = c[i] + 181;\n      break;\n    case 8:\n      ts[i] = c[i] + 212;\n      break;\n    case 9:\n      ts[i] = c[i] + 243;\n      break;\n    case 10:\n      ts[i] = c[i] + 273;\n      break;\n    case 11:\n      ts[i] = c[i] + 304;\n      break;\n    case 12:\n      ts[i] = c[i] + 334;\n      break;\n    }\n\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) && b[i] > 2)\n      ts[i] = ts[i] + 1;\n\n    printf(\"%ld\", ts[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, k, s;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 10 != 0) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 60;\n      break;\n    }\n    case 4: {\n      k = 91;\n      break;\n    }\n    case 5: {\n      k = 121;\n      break;\n    }\n    case 6: {\n      k = 152;\n      break;\n    }\n    case 7: {\n      k = 182;\n      break;\n    }\n    case 8: {\n      k = 213;\n      break;\n    }\n    case 9: {\n      k = 244;\n      break;\n    }\n    case 10: {\n      k = 274;\n      break;\n    }\n    case 11: {\n      k = 305;\n      break;\n    }\n    case 12: {\n      k = 335;\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      k = 0;\n      break;\n    }\n    case 2: {\n      k = 31;\n      break;\n    }\n    case 3: {\n      k = 59;\n      break;\n    }\n    case 4: {\n      k = 90;\n      break;\n    }\n    case 5: {\n      k = 120;\n      break;\n    }\n    case 6: {\n      k = 151;\n      break;\n    }\n    case 7: {\n      k = 181;\n      break;\n    }\n    case 8: {\n      k = 212;\n      break;\n    }\n    case 9: {\n      k = 243;\n      break;\n    }\n    case 10: {\n      k = 273;\n      break;\n    }\n    case 11: {\n      k = 304;\n      break;\n    }\n    case 12: {\n      k = 334;\n      break;\n    }\n    }\n  }\n\n  s = k + c;\n  cout << s << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "19972", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, d, i, n;\n  scanf(\"%d%d%d\", &k, &m, &d);\n  if (k % 4 == 0)\n    if (k % 100 == 0)\n      if (k % 400 == 0)\n        i = 29;\n      else\n        i = 28;\n    else\n      i = 29;\n  else\n    i = 28;\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  if (m == 2) {\n    n = d + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 3) {\n    n = d + i + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 4) {\n    n = d + i + 31 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 5) {\n    n = d + i + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 6) {\n    n = d + i + 31 + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 7) {\n    n = d + i + 31 + 31 + 31 + 60;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 8) {\n    n = d + i + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 9) {\n    n = d + i + 184 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 10) {\n    n = d + i + 31 + 30 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 11) {\n    n = d + i + 31 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 12) {\n    n = d + i + 31 + 30 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, leap, sum = 0;\n  int a[12], i, j;\n  scanf(\"%d\", &year);\n  scanf(\"%d\", &month);\n  scanf(\"%d\", &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (leap == 1) {\n    a[1] = 29;\n  } else\n    a[1] = 28;\n  for (i = 0; i < 12; i++) {\n    if (month == i + 1) {\n      for (j = 0; j < i; j++)\n        sum += a[j];\n      sum += day;\n      break;\n    }\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, x = 0, i;\n  cin >> a >> b >> c;\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    } else if (i == 2) {\n      x = x + 28;\n    } else\n      x = x + 30;\n  }\n  if (((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0)) && (b > 2)) {\n    x = x + 1;\n  }\n  x = x + c;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, num = 0, i,\n                        a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    a[1] = 29;\n  } else {\n    a[1] = 28;\n  }\n  for (i = 0; i < month - 1; i++) {\n    num += a[i];\n  }\n  num += day;\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int real;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 29 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 29 + day;\n      printf(\"%d\", real);\n    }\n\n  } else {\n    if (month == 1) {\n      printf(\"%d\", day);\n    }\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 28 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 28 + day;\n      cout << real;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int j, k, l;\n  cin >> j >> k >> l;\n  if (j % 4 == 0) {\n    if (j % 100 != 0) {\n      a[1] = 29;\n    } else {\n      if (j % 100 == 0 && j % 400 == 0) {\n        a[1] = 29;\n      }\n    }\n    if (j % 100 == 0 && j % 400 != 0) {\n      a[1] = 28;\n    }\n  }\n  int sum = 0;\n  int m;\n  for (m = 0; m < k - 1; m++) {\n    sum = sum + a[m];\n  }\n  sum = sum + l;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "19978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n\n  if (b == 1)\n    x = c;\n  if (b == 2)\n    x = 31 + c;\n  if (b == 3)\n    x = 31 + 28 + c;\n  if (b == 4)\n    x = 31 + 28 + 31 + c;\n  if (b == 5)\n    x = 31 + 28 + 31 + 30 + c;\n  if (b == 6)\n    x = 31 + 28 + 31 + 30 + 31 + c;\n  if (b == 7)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n  if (b == 8)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n  if (b == 9)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n  if (b == 10)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n  if (b == 11)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n  if (b == 12)\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n\n  if (b <= 2)\n    printf(\"%d\\n\", x);\n  else if (a % 4 == 0)\n    if (a % 100 == 0)\n      if (a % 400 == 0)\n        printf(\"%d\\n\", x + 1);\n      else\n        printf(\"%d\\n\", x);\n    else\n      printf(\"%d\\n\", x + 1);\n  else\n    printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, mouth, day, n;\n  scanf(\"%d %d %d \", &year, &mouth, &day);\n  if (year % 4 == 0) {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 60 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 91 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 121 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 152 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 182 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 213 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 244 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 274 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 305 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 335 + day;\n      cout << n;\n      break;\n    }\n  } else {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 59 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 90 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 120 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 151 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 181 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 212 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 243 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 273 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 304 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 334 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19980", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d, m, y, sum, leap;\n  cin >> y >> m >> d;\n  switch (m) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    printf(\"data error\");\n    break;\n  }\n  sum = sum + d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && m > 2)\n    sum++;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "19981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int t;\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 60;\n      break;\n    case 4:\n      t = 91;\n      break;\n    case 5:\n      t = 121;\n      break;\n    case 6:\n      t = 152;\n      break;\n    case 7:\n      t = 182;\n      break;\n    case 8:\n      t = 213;\n      break;\n    case 9:\n      t = 244;\n      break;\n    case 10:\n      t = 274;\n      break;\n    case 11:\n      t = 305;\n      break;\n    case 12:\n      t = 335;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 59;\n      break;\n    case 4:\n      t = 90;\n      break;\n    case 5:\n      t = 120;\n      break;\n    case 6:\n      t = 151;\n      break;\n    case 7:\n      t = 181;\n      break;\n    case 8:\n      t = 212;\n      break;\n    case 9:\n      t = 243;\n      break;\n    case 10:\n      t = 273;\n      break;\n    case 11:\n      t = 304;\n      break;\n    case 12:\n      t = 334;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "19982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, d, m, i, total = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n    a[1] = 29;\n  for (i = 1; i < m; i++) {\n    total += a[i - 1];\n  }\n  total += d;\n  cout << total << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year[5], mon[5], day[5], sum = 0, i, j;\n  for (j = 0; j < 5; j++)\n    cin >> year[j] >> mon[j] >> day[j];\n  for (j = 0; j < 5; j++) {\n    if (year[j] % 400 == 0)\n      a[1] = 29;\n    else if (year[j] % 4 == 0) {\n      if (year[j] % 100 == 0)\n        a[1] = 28;\n      else\n        a[1] = 29;\n    }\n    for (i = 0; i <= (mon[j] - 2); i++)\n      sum = sum + a[i];\n    sum = sum + day[j];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "19984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint mon(int n) {\n  int day;\n  switch (n) {\n  case 1:\n    day = 31;\n    break;\n  case 2:\n    day = 28;\n    break;\n  case 3:\n    day = 31;\n    break;\n  case 4:\n    day = 30;\n    break;\n  case 5:\n    day = 31;\n    break;\n  case 6:\n    day = 30;\n    break;\n  case 7:\n    day = 31;\n    break;\n  case 8:\n    day = 31;\n    break;\n  case 9:\n    day = 30;\n    break;\n  case 10:\n    day = 31;\n    break;\n  case 11:\n    day = 30;\n    break;\n  case 12:\n    day = 31;\n    break;\n  }\n  return (day);\n}\nint run(int year) {\n  int p;\n  if (year % 400 == 0)\n    p = 1;\n  else if ((year % 100 != 0) && (year % 4 == 0))\n    p = 1;\n  else\n    p = 0;\n  return (p);\n}\n\nint main() {\n  int year, month, date, i, n = 0;\n  cin >> year >> month >> date;\n  for (i = 1; i <= month - 1; i++)\n    n = n + mon(i);\n\n  n = n + date;\n  if (run(year) == 1)\n    n = n + 1;\n  else\n    n = n;\n  printf(\"%d\", n);\n\n  return (0);\n}\n"}
{"label": "11", "index": "19985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, d1 = 0, d2, i;\n  int md[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> y >> m >> d;\n  if (m == 1)\n    d2 = d;\n  else {\n\n    for (i = 0; i < m - 1; i++)\n      d1 = d1 + md[i];\n    d2 = d + d1;\n  }\n  cout << d2;\n\n  return 0;\n}\n"}
{"label": "11", "index": "19986", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, sum = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[1][i];\n    }\n  } else {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[0][i];\n    }\n  }\n  sum += d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "19987", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i,\n               a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (m == 1)\n    x = d;\n  else if (m == 2)\n    x = 31 + d;\n  else if (y % 100 != 0 && y % 4 == 0 || y % 400 == 0) {\n    for (i = 0; i < m - 1; i++)\n      x += a[i];\n    x += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      x += b[i];\n    x += d;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    n = n + day;\n  else if (month == 2)\n    n = n + 31 + day;\n  else if (month == 3)\n    n = n + 59 + day;\n  else if (month == 4)\n    n = n + 90 + day;\n  else if (month == 5)\n    n = n + 120 + day;\n  else if (month == 6)\n    n = n + 151 + day;\n  else if (month == 7)\n    n = n + 181 + day;\n  else if (month == 8)\n    n = n + 212 + day;\n  else if (month == 9)\n    n = n + 243 + day;\n  else if (month == 10)\n    n = n + 273 + day;\n  else if (month == 11)\n    n = n + 304 + day;\n  else {\n    n = n + 334 + day;\n  }\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    n = n + 1;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "19989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int day = 0;\n  scanf(\"%d %d %d \", &year, &month, &date);\n  if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++) {\n      day += a[i];\n    }\n\n    day += date;\n  } else {\n    int b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++)\n      day += b[i];\n    day += date;\n  }\n  cout << day << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f1(int n) {\n  int i, m;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 28;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint f2(int n) {\n  int m, i;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 29;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint main() {\n  int y, mon, d, a;\n  scanf(\"%d%d%d\", &y, &mon, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    a = f1(mon) + d;\n    printf(\"%d\", a);\n  } else {\n    a = f2(mon) + d;\n    printf(\"%d\", a);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "19991", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n, i, j;\n  for (j = 1; j <= 5; j++) {\n    n = 0;\n    cin >> year >> month >> day;\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    } else {\n      int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    }\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "11", "index": "19992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint leap_year(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else {\n    if (y % 4 == 0 && y % 100 != 0)\n      return 1;\n    else\n      return 0;\n  }\n}\nint main() {\n  int y, m, d, count;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (leap_year(y)) {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 29;\n      break;\n    case 4:\n      count = 31 + 29 + 31;\n      break;\n    case 5:\n      count = 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  } else {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 28;\n      break;\n    case 4:\n      count = 31 + 28 + 31;\n      break;\n    case 5:\n      count = 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  }\n  cout << count << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if (((x % 4 == 0) && (x % 100 != 0)) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  int z, i = 0, sum = 0;\n  int a[12], b[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  z = f(year);\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "19994", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint runnian(int a) {\n  if (a % 4 == 0 && a % 400 == 0)\n    return 1;\n  if (a % 4 == 0 && a % 100 != 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint tian(int nian, int yue, int ri) {\n  int sum = 0, i;\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int feirun[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (runnian(nian) == 1) {\n    for (i = 0; i <= yue - 2; i++)\n      sum += run[i];\n    sum += ri;\n  } else {\n    for (i = 0; i <= yue - 2; i++)\n      sum += feirun[i];\n    sum += ri;\n  }\n  return sum;\n}\n\nint main() {\n  int nian, yue, ri;\n  cin >> nian >> yue >> ri;\n  cout << tian(nian, yue, ri) << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, flag;\n  int daytal, tal;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 4 == 0) && (year % 100 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  switch (month) {\n  case 1:\n    daytal = 0;\n    break;\n  case 2:\n    daytal = 31;\n    break;\n  case 3:\n    daytal = 60;\n    break;\n  case 4:\n    daytal = 91;\n    break;\n  case 5:\n    daytal = 121;\n    break;\n  case 6:\n    daytal = 152;\n    break;\n  case 7:\n    daytal = 182;\n    break;\n  case 8:\n    daytal = 213;\n    break;\n  case 9:\n    daytal = 244;\n    break;\n  case 10:\n    daytal = 274;\n    break;\n  case 11:\n    daytal = 305;\n    break;\n  case 12:\n    daytal = 335;\n    break;\n  }\n  if (month < 2)\n    flag = 0;\n  tal = daytal + day - flag;\n  cout << tal << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "19996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1)\n    a = day;\n  else if (mon == 2)\n    a = 31 + day;\n  else if (mon == 3)\n    a = 59 + day;\n  else if (mon == 4)\n    a = 90 + day;\n  else if (mon == 5)\n    a = 120 + day;\n  else if (mon == 6)\n    a = 151 + day;\n  else if (mon == 7)\n    a = 181 + day;\n  else if (mon == 8)\n    a = 212 + day;\n  else if (mon == 9)\n    a = 243 + day;\n  else if (mon == 10)\n    a = 273 + day;\n  else if (mon == 11)\n    a = 304 + day;\n  else\n    a = 334 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (mon >= 3)\n      a = a + 1;\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "19997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, x = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0) {\n    mon[1] = 29;\n  } else if (y % 400 == 0) {\n    mon[1] = 29;\n  } else\n    mon[1] = 28;\n\n  for (i = 0; i < m - 1; i++) {\n    x += mon[i];\n  }\n  x = x + d;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "19998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], l[5] = {0}, i = 0;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n\n  for (i = 0; i < 5; i++) {\n    if ((year[i] % 4 == 0) && (year[i] % 100 != 0) || (year[i] % 400 == 0)) {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 29;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    } else {\n      switch (month[i]) {\n      case 12:\n        l[i] = l[i] + 30;\n      case 11:\n        l[i] = l[i] + 31;\n      case 10:\n        l[i] = l[i] + 30;\n      case 9:\n        l[i] = l[i] + 31;\n      case 8:\n        l[i] = l[i] + 31;\n      case 7:\n        l[i] = l[i] + 30;\n      case 6:\n        l[i] = l[i] + 31;\n      case 5:\n        l[i] = l[i] + 30;\n      case 4:\n        l[i] = l[i] + 31;\n      case 3:\n        l[i] = l[i] + 28;\n      case 2:\n        l[i] = l[i] + 31;\n      case 1:\n        l[i] = l[i];\n      }\n    }\n    l[i] = l[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    cout << l[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "19999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, d;\n  scanf(\"%d%d%d\", &n, &m, &d);\n  int a = d;\n  for (i = 1; i <= m - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      a += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      a += 30;\n    } else {\n      if ((n % 100 == 0 && n % 400 != 0) || n % 4 != 0) {\n        a += 28;\n\n      } else {\n        a += 29;\n      }\n    }\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "20000", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, mouth, day, n;\n  scanf(\"%d%d%d\", &year, &mouth, &day);\n  if (year % 4 == 0) {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 60 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 91 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 121 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 152 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 182 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 213 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 244 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 274 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 305 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 335 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  } else {\n    switch (mouth) {\n    case 1:\n      n = day;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + day;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 59 + day;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 90 + day;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 120 + day;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 151 + day;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 181 + day;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 212 + day;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 243 + day;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 273 + day;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 304 + day;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 334 + day;\n      printf(\"%d\", n);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20001", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int a[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};\n    d = a[b - 1] + c;\n    printf(\"%d\\n\", d);\n  } else {\n    int a[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n    d = a[b - 1] + c;\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x) {\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  int a, b, c;\n  int amount = 0;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m > 2) {\n    a = f(y);\n    if (a == 1)\n      p[1] = p[1] + 1;\n    for (int i = 0; i < m - 1; i++)\n      amount = amount + p[i];\n    amount = amount + d;\n  } else if (m == 1)\n    amount = d;\n  else if (m == 2)\n    amount = 31 + d;\n  cout << amount;\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int month, date, n = 0, i, year, p;\n  scanf(\"%d %d %d \", &year, &month, &date);\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))\n    p = 29;\n  else\n    p = 28;\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n      n += 31;\n      break;\n    case 2:\n      n += p;\n      break;\n    case 3:\n      n += 31;\n      break;\n    case 4:\n      n += 30;\n      break;\n    case 5:\n      n += 31;\n      break;\n    case 6:\n      n += 30;\n      break;\n    case 7:\n      n += 31;\n      break;\n    case 8:\n      n += 31;\n      break;\n    case 9:\n      n += 30;\n      break;\n    case 10:\n      n += 31;\n      break;\n    case 11:\n      n += 30;\n      break;\n    }\n  }\n  n += date;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20004", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint map_1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint main() {\n  int year, month, day;\n  int i, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    map_1[2] = 29;\n  if (month == 1)\n    sum = day;\n  else {\n    for (i = 1; i < month; i++)\n      sum = sum + map_1[i];\n    sum = sum + day;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20005", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int yy, mm, dd, m = 0, days = 0;\n  scanf(\"%d %d %d \", &yy, &mm, &dd);\n  do {\n    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)\n      days = days + 31;\n    else if (m == 4 || m == 6 || m == 9 || m == 11)\n      days = days + 30;\n    else if ((((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0)) && m == 2)\n      days = days + 29;\n    else if ((yy % 4 != 0 || yy % 100 == 0) && m == 2)\n      days = days + 28;\n    m++;\n  } while (m < mm);\n  days = days + dd;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20006", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  cin >> n >> m >> d;\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1) {\n      if (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0) {\n        counter++;\n      }\n    }\n    counter = counter + month[i];\n  }\n  counter = counter + d;\n  printf(\"%d\", counter);\n  return 0;\n}\n"}
{"label": "11", "index": "20007", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int day = 0, y, m, d, i,\n      month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))\n    month[2] = 29;\n  for (i = 1; i < m; i++)\n    day += month[i];\n  day += d;\n  cout << day;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Year(int a) {\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      return 1;\n    } else\n      return 0;\n  } else if (a % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int year, month, day, a[13], i, answer;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i <= 12; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      a[i] = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      a[i] = 30;\n      break;\n    case 2:\n      if (Year(year) == 1) {\n        a[i] = 29;\n        break;\n      } else {\n        a[i] = 28;\n        break;\n      }\n    }\n  }\n  answer = 0;\n  for (i = 1; i < month; i++) {\n    answer += a[i];\n  }\n  answer += day;\n  printf(\"%d\\n\", answer);\n  return 0;\n}\n"}
{"label": "11", "index": "20009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month,\n      monthd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day,\n      di = 0, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    di = di + monthd[i - 1];\n  }\n  di = di + day;\n  if ((year % 4) != 0 || (year % 400) != 0)\n    cout << di << \"\\n\";\n  else\n    printf(\"%d\", di + 1);\n  return 0;\n}\n"}
{"label": "11", "index": "20010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int check(int a);\n  int count(int x[], int w, int y);\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  int k;\n  int sum;\n  k = check(year);\n  if (k == 1) {\n    int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days1, month, day);\n    printf(\"%d\", sum);\n  } else {\n    int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    sum = count(days2, month, day);\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n\nint check(int a) {\n  int b, c, d;\n  b = a % 4;\n  c = a % 100;\n  d = a % 400;\n  if (b != 0)\n    return 1;\n  else if (c == 0 && d != 0) {\n    return 1;\n  } else\n    return 0;\n}\n\nint count(int x[], int w, int y) {\n  int sum = 0;\n  int i;\n  for (i = 1; i < w; i++) {\n    sum = sum + x[i];\n  }\n  sum = sum + y;\n  return sum;\n}\n"}
{"label": "11", "index": "20011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], b[10], c[10], n[10], d, i;\n  for (i = 0; i < 5; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n  }\n  for (i = 0; i < 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 60;\n        break;\n      case 4:\n        d = 91;\n        break;\n      case 5:\n        d = 121;\n        break;\n      case 6:\n        d = 152;\n        break;\n      case 7:\n        d = 182;\n        break;\n      case 8:\n        d = 213;\n        break;\n      case 9:\n        d = 244;\n        break;\n      case 10:\n        d = 274;\n        break;\n      case 11:\n        d = 305;\n        break;\n      case 12:\n        d = 335;\n        break;\n      }\n      n[i] = d + c[i];\n      printf(\"%d\\n\", n[i]);\n    } else {\n      switch (b[i]) {\n      case 1:\n        d = 0;\n        break;\n      case 2:\n        d = 31;\n        break;\n      case 3:\n        d = 59;\n        break;\n      case 4:\n        d = 90;\n        break;\n      case 5:\n        d = 120;\n        break;\n      case 6:\n        d = 151;\n        break;\n      case 7:\n        d = 181;\n        break;\n      case 8:\n        d = 212;\n        break;\n      case 9:\n        d = 243;\n        break;\n      case 10:\n        d = 273;\n        break;\n      case 11:\n        d = 304;\n        break;\n      case 12:\n        d = 334;\n        break;\n      }\n      n[i] = d + c[i];\n      cout << n[i] << \"\\n\";\n    }\n  }\n}\n"}
{"label": "11", "index": "20012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, a, s;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0)) {\n    a = 29;\n  } else\n    a = 28;\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = 31 + d;\n  } else if (m == 3)\n    s = 31 + a + d;\n  else if (m == 4) {\n    s = 31 * 2 + a + d;\n  } else if (m == 5) {\n    s = 31 * 2 + a + 30 + d;\n  } else if (m == 6) {\n    s = 31 * 3 + a + d + 30;\n  } else if (m == 7) {\n    s = 31 * 3 + a + d + 30 * 2;\n  } else if (m == 8) {\n    s = 31 * 4 + a + d + 30 * 2;\n  } else if (m == 9) {\n    s = 31 * 5 + a + d + 30 * 2;\n  } else if (m == 10) {\n    s = 31 * 5 + a + d + 30 * 3;\n  } else if (m == 11) {\n    s = 31 * 6 + a + d + 30 * 3;\n  } else if (m == 12) {\n    s = 31 * 6 + a + d + 30 * 4;\n  } else\n    ;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20014", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    day[1] = 29;\n  for (int i = 0; i < m - 1; i++)\n    d += day[i];\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, d;\n  int result = 0;\n  int i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 31, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &d);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    a[2] = a[2] + 1;\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n    result += d;\n  } else\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n  result += d;\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 29);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 29 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 31 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 28);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 28 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 30 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 30);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 29);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 30);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 29);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int sum = 0, i;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct date {\n    int year;\n    int month;\n    int day;\n    int days;\n  } date1;\n  scanf(\"%d %d %d\", &date1.year, &date1.month, &date1.day);\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  date1.days = 0;\n  int i;\n  if (date1.month > 1) {\n    for (i = 0; i <= date1.month - 2; i++) {\n      date1.days = date1.days + b[i];\n    }\n    date1.days = date1.days + date1.day;\n  } else {\n    date1.days = date1.day;\n  }\n  printf(\"%d\", date1.days);\n}\n"}
{"label": "11", "index": "20019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            month2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            day, month, number = 0, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    for (i = 0; i < month; i++)\n      number += month2[i];\n    number += day;\n  } else {\n    for (i = 0; i < month; i++)\n      number += month1[i];\n    number += day;\n  }\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint leap(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  } else if (n % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, x;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1) {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 60;\n    }\n    if (month == 4) {\n      x = day + 91;\n    }\n    if (month == 5) {\n      x = day + 121;\n    }\n    if (month == 6) {\n      x = day + 152;\n    }\n    if (month == 7) {\n      x = day + 182;\n    }\n    if (month == 8) {\n      x = day + 213;\n    }\n    if (month == 9) {\n      x = day + 244;\n    }\n    if (month == 10) {\n      x = day + 274;\n    }\n    if (month == 11) {\n      x = day + 305;\n    }\n    if (month == 12) {\n      x = day + 335;\n    }\n  } else {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 59;\n    }\n    if (month == 4) {\n      x = day + 90;\n    }\n    if (month == 5) {\n      x = day + 120;\n    }\n    if (month == 6) {\n      x = day + 151;\n    }\n    if (month == 7) {\n      x = day + 181;\n    }\n    if (month == 8) {\n      x = day + 212;\n    }\n    if (month == 9) {\n      x = day + 243;\n    }\n    if (month == 10) {\n      x = day + 273;\n    }\n    if (month == 11) {\n      x = day + 304;\n    }\n    if (month == 12) {\n      x = day + 334;\n    }\n  }\n  cout << x;\n}\n"}
{"label": "11", "index": "20021", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, num;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 29;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 29 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 29 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 29 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  } else {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 28;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 28 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 28 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 28 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int a) {\n  int z;\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int i, m;\n  int n[5][3];\n  int total[5];\n  for (i = 0; i <= 4; i++)\n    cin >> n[i][0] >> n[i][1] >> n[i][2];\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i <= 4; i++) {\n    month[1] = 28 + leap(n[i][0]);\n    total[i] = 0;\n    for (m = 0; m <= n[i][1] - 2; m++)\n      total[i] = total[i] + month[m];\n    total[i] = total[i] + n[i][2];\n    printf(\"%d\\n\", total[i]);\n  }\n}\n"}
{"label": "11", "index": "20023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int n = 0;\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month; i++) {\n    n = days[i] + n;\n  }\n  n = day + n;\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    n++;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, a[20], b[20], c[20], x, day;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 1; i <= 5; i++) {\n    if (a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 29;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 29 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 29 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 29 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    } else {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 28;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 28 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 28 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 28 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    cout << day << \" \";\n  }\n}\n"}
{"label": "11", "index": "20025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, D = 0, l, s;\n  l = 31;\n  s = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    D = d;\n  else if (m == 2)\n    D = l + d;\n  else if (m == 3)\n    D = l + 28 + d;\n  else if (m == 4)\n    D = l * 2 + 28 + d;\n  else if (m == 5)\n    D = l * 2 + 28 + d + s;\n  else if (m == 6)\n    D = s + l * 3 + 28 + d;\n  else if (m == 7)\n    D = s * 2 + l * 3 + 28 + d;\n  else if (m == 8)\n    D = s * 2 + l * 4 + 28 + d;\n  else if (m == 9)\n    D = s * 2 + l * 5 + 28 + d;\n  else if (m == 10)\n    D = s * 3 + l * 5 + 28 + d;\n  else if (m == 11)\n    D = s * 3 + l * 6 + 28 + d;\n  else\n    D = s * 4 + l * 6 + 28 + d;\n  if (m > 2 && ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))) {\n    D = D + 1;\n  }\n  printf(\"%d\\n\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n, i, j;\n  for (j = 1; j <= 5; j++) {\n    n = 0;\n    scanf(\"%d %d %d\", &year, &month, &day);\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    } else {\n      int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++)\n        n += days[i];\n\n      n += day;\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nlong total;\n\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  }\n  if (n % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int year, month, day;\n  int i;\n  while (scanf(\"%d %d %d \", &year, &month, &day)) {\n    total = 0;\n    if (run(year)) {\n\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 60 + day;\n        break;\n      case 4:\n        total += 91 + day;\n        break;\n      case 5:\n        total += 121 + day;\n        break;\n      case 6:\n        total += 152 + day;\n        break;\n      case 7:\n        total += 182 + day;\n        break;\n      case 8:\n        total += 213 + day;\n        break;\n      case 9:\n        total += 244 + day;\n        break;\n      case 10:\n        total += 274 + day;\n        break;\n      case 11:\n        total += 305 + day;\n        break;\n      case 12:\n        total += 335 + day;\n        break;\n      }\n    } else {\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 59 + day;\n        break;\n      case 4:\n        total += 90 + day;\n        break;\n      case 5:\n        total += 120 + day;\n        break;\n      case 6:\n        total += 151 + day;\n        break;\n      case 7:\n        total += 181 + day;\n        break;\n      case 8:\n        total += 212 + day;\n        break;\n      case 9:\n        total += 243 + day;\n        break;\n      case 10:\n        total += 273 + day;\n        break;\n      case 11:\n        total += 304 + day;\n        break;\n      case 12:\n        total += 334 + day;\n        break;\n      }\n    }\n    printf(\"%ld\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c = 0;\n  int i = 0;\n  int sum = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    sum = sum + 30;\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      sum = sum + 1;\n    } else if (i == 2 && ((a % 100 != 0 && a % 4 == 0) || a % 400 == 0)) {\n      sum = sum - 1;\n    } else {\n      if (i == 2 && (a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n        sum = sum - 2;\n    }\n  }\n  cout << sum + c;\n  return 0;\n}\n"}
{"label": "11", "index": "20029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    if (month > 2) {\n      sum = sum + 29 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else {\n      sum = day;\n    }\n\n  } else {\n    if (month > 2) {\n      sum = sum + 28 + 31;\n      for (int k = 3; k < month; k++) {\n        sum = sum + d[k];\n      }\n      sum = sum + day;\n    } else if (month == 2) {\n      sum = 31 + day;\n    } else\n      sum = day;\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  int a[13];\n  a[0] = 0;\n  int sum = 0;\n  cin >> y >> m >> d;\n  a[1] = a[3] = a[5] = a[7] = a[8] = a[10] = a[12] = 31;\n  a[4] = a[6] = a[9] = a[11] = 30;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + a[i];\n  sum = sum + d;\n  cout << sum;\n  getchar();\n}\n"}
{"label": "11", "index": "20031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int y, month, d, sum = 0;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &month, &d);\n  m[2] = m[2] + leap(y);\n  for (int i = 0; i < month; i++) {\n    sum = sum + m[i];\n  }\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\nint leap(int n) {\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "20032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int mouth[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                      {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  int leapyear;\n  int a, b, c, i;\n  int d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  leapyear = (a % 4 == 0 && a % 100 != 0 || a % 400 == 0);\n  for (i = 0; i < b - 1; i++) {\n    d = d + mouth[leapyear][i];\n  }\n  d = d + c;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int a = 0;\n  cin >> year >> month >> date;\n  if (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0) {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 29 + date;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      a = date;\n      break;\n    case 2:\n      a = 31 + date;\n      break;\n    case 3:\n      a = 31 + 28 + date;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + date;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + date;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + date;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + date;\n      break;\n    case 8:\n      a = 31 + 28 + 30 + 31 + 30 + 31 + date;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n      break;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "20034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d[12] = {0};\n  int a, b, c, i, sum = 0;\n  int run(int x);\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10)) {\n      d[i] = 31;\n      sum += d[i];\n    } else if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      d[i] = 30;\n      sum += d[i];\n    } else {\n      if (run(a) == 1)\n        d[i] = 29;\n      else\n        d[i] = 28;\n      sum += d[i];\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n}\nint run(int x) {\n  int z;\n  if ((x % 400 == 0) || ((x % 100 != 0) && (x % 4 == 0)))\n    z = 1;\n  return z;\n}\n"}
{"label": "11", "index": "20035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint nian(int m) {\n  if ((m % 400 == 0) || ((m % 100 != 0) && (m % 4 == 0)))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int i, s = 0, n, y, r, a[12];\n  scanf(\"%d%d%d\", &n, &y, &r);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (nian(n))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < y - 1; i++)\n    s += a[i];\n  s += r;\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "20036", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int just(int y);\n\n  int y, m, d, t = 0;\n\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (just(y) == 1) {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += b[i];\n\n  } else {\n    if (m == 1)\n      t = 0;\n    else\n      for (int i = 0; i <= m - 2; i++)\n        t += a[i];\n  }\n  cout << t + d;\n\n  return 0;\n}\n\nint just(int y) {\n  int m = 0;\n\n  if (y % 4 == 0 && y % 100 != 0)\n    return 1;\n\n  if (y % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20037", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int n = 0;\n  int i;\n\n  cin >> year >> month >> day;\n\n  for (i = 1; i < month; i++)\n    n = n + days[i];\n\n  n = n + day;\n\n  if (month > 2 && isleapyear(year)) {\n    n++;\n  }\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, year, month, day, a[32], i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  a[0] = 0;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if (year % 4 == 0 && year % 200 == 0) {\n    a[2] = 29;\n  } else {\n    a[2] = 28;\n  }\n\n  for (i = 0; i < month; i++) {\n    sum = sum + a[i];\n  }\n  n = sum + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20039", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, sum;\n  int mon[1000];\n  mon[1] = mon[3] = mon[5] = mon[7] = mon[8] = mon[10] = mon[12] = 31;\n  mon[4] = mon[6] = mon[9] = mon[11] = 30;\n  sum = 0;\n\n  cin >> year >> month >> date;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    mon[2] = 29;\n  } else {\n    mon[2] = 28;\n  }\n\n  int i;\n  for (i = 1; i < month; i++) {\n    sum += mon[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0)\n    mon[1] = 29;\n  else if (y % 400 == 0) {\n    mon[1] = 29;\n  } else\n    mon[1] = 28;\n\n  for (i = 0; i < m - 1; i++) {\n    x += mon[i];\n  }\n  x = x + d;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20041", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint leap(int y) {\n  if ((y % 100 == 0) && (y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    return 1;\n  else\n    return 0;\n}\n\nint days(int y, int d, int r) {\n  int a[13] = {0, 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (leap(y))\n    a[3] = 29;\n  int ans = 0;\n  for (int i = 1; i <= d; i++)\n    ans += a[i];\n  return ans + r;\n}\nint main() {\n  int y, d, r;\n  cin >> y >> d >> r;\n\n  cout << days(y, d, r);\n}\n"}
{"label": "11", "index": "20042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leapyear(int year) {\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  int a[12];\n  int i, Year, Month, Day, date = 0;\n  scanf(\"%d %d %d\", &Year, &Month, &Day);\n  if (leapyear(Year) == 1) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  } else if (leapyear(Year) == 0) {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  }\n}\n"}
{"label": "11", "index": "20043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint run(int x) {\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    return 1;\n  return 0;\n}\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (run(y)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 60 + d;\n      break;\n    case 4:\n      x = 91 + d;\n      break;\n    case 5:\n      x = 121 + d;\n      break;\n    case 6:\n      x = 152 + d;\n      break;\n    case 7:\n      x = 182 + d;\n      break;\n    case 8:\n      x = 213 + d;\n      break;\n    case 9:\n      x = 244 + d;\n      break;\n    case 10:\n      x = 274 + d;\n      break;\n    case 11:\n      x = 305 + d;\n      break;\n    case 12:\n      x = 335 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 59 + d;\n      break;\n    case 4:\n      x = 90 + d;\n      break;\n    case 5:\n      x = 120 + d;\n      break;\n    case 6:\n      x = 151 + d;\n      break;\n    case 7:\n      x = 181 + d;\n      break;\n    case 8:\n      x = 212 + d;\n      break;\n    case 9:\n      x = 243 + d;\n      break;\n    case 10:\n      x = 273 + d;\n      break;\n    case 11:\n      x = 304 + d;\n      break;\n    case 12:\n      x = 334 + d;\n      break;\n    }\n  }\n  cout << x;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint leap(int n) {\n  int leap = 0;\n  if (n % 400 == 0 || n % 100 != 0 && n % 4 == 0)\n    leap = 1;\n  return (leap);\n}\n\nint main() {\n  int year, month, day,\n      th = 0, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1)\n    a[2] = 29;\n  for (int i = 0; i < month; i++)\n    th = th + a[i];\n  th = th + day;\n  cout << th;\n  return (0);\n}\n"}
{"label": "11", "index": "20045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {0}, i;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0)\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 1; i < 12; i++) {\n    b[0] = a[0];\n    b[i] = b[i - 1] + a[i];\n  }\n  if (m == 1)\n    cout << d << endl;\n  else if (m != 1)\n    cout << b[m - 2] + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, date, i = 1, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        sum += 29;\n      } else\n        sum += 28;\n    } else {\n      sum += 30;\n    }\n  }\n\n  sum += date;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    for (int i = m - 2; i >= 0; i--) {\n      sum = sum + b[i];\n    }\n    printf(\"%d\", sum + d);\n  } else {\n    for (int s = m - 2; s >= 0; s--) {\n      sum = sum + a[s];\n    }\n    cout << sum + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, n;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1, n = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      n = n + 31;\n    } else if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n        n = n + 29;\n      } else {\n        n = n + 28;\n      }\n    } else {\n      n = n + 30;\n    }\n  }\n  n = n + day;\n  cout << n << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "20049", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, n = 0;\n  cin >> y >> m >> d;\n  int ping[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (int i = 0; i < m - 1; i++)\n      n = n + ping[i];\n    n = n + d;\n  } else {\n    for (int i = 0; i < m - 1; i++)\n      n = n + run[i];\n    n = n + d;\n  }\n  printf(\"%d\\n\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, m, d, result = 0;\n  cin >> year >> m >> d;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 2) {\n      if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)\n        result += 29;\n      else\n        result += 28;\n    } else\n      result += 30;\n  }\n  result += d;\n  cout << result << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20051", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Y, M, D;\n  cin >> Y >> M >> D;\n  if (Y % 400 == 0 && Y % 4000 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else if (Y % 4 == 0 && Y % 100 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 59);\n    if (M == 4)\n      printf(\"%d\", D + 90);\n    if (M == 5)\n      printf(\"%d\", D + 120);\n    if (M == 6)\n      printf(\"%d\", D + 150);\n    if (M == 7)\n      printf(\"%d\", D + 181);\n    if (M == 8)\n      printf(\"%d\", D + 212);\n    if (M == 9)\n      printf(\"%d\", D + 243);\n    if (M == 10)\n      printf(\"%d\", D + 273);\n    if (M == 11)\n      printf(\"%d\", D + 304);\n    if (M == 12)\n      printf(\"%d\", D + 334);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20052", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, n, i, t = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < month; i++) {\n    t = t + a[i];\n  }\n  if (month >= 3)\n    if (year % 4 == 0)\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          n = t + 1 + day;\n        else\n          n = t + day;\n      } else\n        n = t + 1 + day;\n    else\n      n = t + day;\n  else\n    n = t + day;\n\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int y) {\n  if ((y % 100 == 0) && (y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    return 1;\n  else\n    return 0;\n}\n\nint days(int y, int d, int r) {\n  int a[13] = {0, 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (leap(y))\n    a[3] = 29;\n  int ans = 0;\n  for (int i = 1; i <= d; i++)\n    ans += a[i];\n  return ans + r;\n}\nint main() {\n  int y, d, r;\n  cin >> y >> d >> r;\n  \n  cout << days(y, d, r);\n}\n"}
{"label": "11", "index": "20054", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12], b[100000], c, d, e, i, s, t = 0;\n  cin >> c >> d >> e;\n  if (c % 4 != 0 || (c % 100 == 0 && c % 400 != 0)) {\n    a[0] = 31;\n    a[1] = 28;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  } else {\n    a[0] = 31;\n    a[1] = 29;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x = 0, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 29;\n    }\n    x = x + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        x = x + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        x = x + 30;\n      else\n        x = x + 28;\n    }\n    x = x + d;\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20056", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, feb, i, m, n = 0, q;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    feb = 29;\n  } else {\n    feb = 28;\n  }\n\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      m = 31;\n    else if (i == 2)\n      m = feb;\n    else\n      m = 30;\n    n = n + m;\n  }\n  q = n + c;\n  printf(\"%d\", q);\n  return 0;\n}\n"}
{"label": "11", "index": "20057", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, d, i, j,\n      counter = 0,\n      month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &n, &m, &d);\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) {\n    for (i = 0; i < m - 1; i++)\n      counter += month2[i];\n    counter += d;\n    cout << counter << endl;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      counter += month1[i];\n    counter += d;\n    cout << counter << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, D = 0, l, s;\n  l = 31;\n  s = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    D = d;\n  else if (m == 2)\n    D = l + d;\n  else if (m == 3)\n    D = l + 28 + d;\n  else if (m == 4)\n    D = l * 2 + 28 + d;\n  else if (m == 5)\n    D = l * 2 + 28 + d + s;\n  else if (m == 6)\n    D = s + l * 3 + 28 + d;\n  else if (m == 7)\n    D = s * 2 + l * 3 + 28 + d;\n  else if (m == 8)\n    D = s * 2 + l * 4 + 28 + d;\n  else if (m == 9)\n    D = s * 2 + l * 5 + 28 + d;\n  else if (m == 10)\n    D = s * 3 + l * 5 + 28 + d;\n  else if (m == 11)\n    D = s * 3 + l * 6 + 28 + d;\n  else\n    D = s * 4 + l * 6 + 28 + d;\n  if (m > 2 && ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))) {\n    D = D + 1;\n  }\n  cout << D << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint panduan(int(year));\nint main() {\n  int sum = 0, year, month, day;\n  int i;\n  int Month1[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Month2[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if (panduan(year) == 1) {\n    for (i = 1; i < month; i++)\n      sum += Month1[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  } else {\n    for (i = 1; i < month; i++)\n      sum += Month2[i];\n    sum += day;\n    cout << sum;\n    return 0;\n  }\n  return 0;\n}\nint panduan(int year) {\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "20060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, sum;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    sum = c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 60;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 91;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 121;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 152;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 182;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 213;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 244;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 274;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 305;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = c + 335;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 2) {\n      sum = c + 31;\n      printf(\"%d\", sum);\n    }\n    if (b == 3) {\n      sum = c + 59;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = c + 90;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = c + 120;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = c + 151;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = c + 181;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = c + 212;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = c + 243;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = c + 273;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = c + 304;\n      cout << sum;\n    }\n    if (b == 12) {\n      sum = c + 334;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int run(int n);\n  int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, n, y, r, s = 0, k;\n  scanf(\"%d %d %d\", &n, &y, &r);\n  for (i = 0; i < y; i++)\n    s = s + q[i];\n  s = s + r;\n  k = run(n);\n  if (k && (y > 2))\n    s += 1;\n  printf(\"%d\", s);\n}\n\nint run(int n) {\n  int a;\n  if ((n % 400 == 0) || ((n % 4 == 0) && (n % 100 != 0)))\n    a = 1;\n  else\n    a = 0;\n  return a;\n}\n"}
{"label": "11", "index": "20062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], total[5], i = 0;\n  for (; i <= 4; i++) {\n\n    scanf(\"%d %d %d\", &year[i], &month[i], &day[i]);\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      total[i] = day[i];\n      break;\n    case 2:\n      total[i] = 31 + day[i];\n      break;\n    case 3:\n      total[i] = 31 + 28 + day[i];\n      break;\n    case 4:\n      total[i] = 31 + 28 + 31 + day[i];\n      break;\n    case 5:\n      total[i] = 31 + 28 + 31 + 30 + day[i];\n      break;\n    case 6:\n      total[i] = 31 + 28 + 31 + 30 + 31 + day[i];\n      break;\n    case 7:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    case 8:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day[i];\n      break;\n    case 9:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day[i];\n      break;\n    case 10:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day[i];\n      break;\n    case 11:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day[i];\n      break;\n    case 12:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    }\n\n    if ((year[i] % 400 == 0 || year[i] % 4 == 0 && year[i] % 100 != 0) &&\n        month[i] > 2)\n      total[i] += 1;\n    cout << total[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 60 + c;\n    else if (b == 4)\n      n = 91 + c;\n    else if (b == 5)\n      n = 121 + c;\n    else if (b == 6)\n      n = 152 + c;\n    else if (b == 7)\n      n = 182 + c;\n    else if (b == 8)\n      n = 213 + c;\n    else if (b == 9)\n      n = 244 + c;\n    else if (b == 10)\n      n = 274 + c;\n    else if (b == 11)\n      n = 305 + c;\n    else\n      n = 336 + c;\n  } else {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 59 + c;\n    else if (b == 4)\n      n = 90 + c;\n    else if (b == 5)\n      n = 120 + c;\n    else if (b == 6)\n      n = 151 + c;\n    else if (b == 7)\n      n = 181 + c;\n    else if (b == 8)\n      n = 212 + c;\n    else if (b == 9)\n      n = 243 + c;\n    else if (b == 10)\n      n = 273 + c;\n    else if (b == 11)\n      n = 304 + c;\n    else\n      n = 335 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear(year) && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n\n  n += day;\n\n  if (isleapyear(year) && month > 2)\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, num = 0, i, a[11];\n  cin >> year >> mon >> day;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (year % 4 != 0) {\n    a[1] = 28;\n  } else if (year % 100 == 0) {\n    if (year % 400 == 0) {\n      a[1] = 29;\n    } else\n      a[1] = 28;\n  } else\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    num = num + a[i];\n\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20066", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 60 + c;\n\n    else if (b == 4)\n      x = 91 + c;\n\n    else if (b == 5)\n      x = 121 + c;\n\n    else if (b == 6)\n      x = 152 + c;\n\n    else if (b == 7)\n      x = 182 + c;\n\n    else if (b == 8)\n      x = 213 + c;\n\n    else if (b == 9)\n      x = 244 + c;\n\n    else if (b == 10)\n      x = 274 + c;\n\n    else if (b == 11)\n      x = 305 + c;\n\n    else if (b == 12)\n      x = 335 + c;\n\n  }\n\n  else {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 59 + c;\n\n    else if (b == 4)\n      x = 90 + c;\n\n    else if (b == 5)\n      x = 120 + c;\n\n    else if (b == 6)\n      x = 151 + c;\n\n    else if (b == 7)\n      x = 181 + c;\n\n    else if (b == 8)\n      x = 212 + c;\n\n    else if (b == 9)\n      x = 243 + c;\n\n    else if (b == 10)\n      x = 273 + c;\n    else if (b == 11)\n      x = 304 + c;\n\n    else if (b == 12)\n      x = 334 + c;\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, n, z, y;\n  scanf(\"%d%d%d\", &x, &n, &z);\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0) {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 29 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 29 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 29 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 11) {\n      y = 31 * 6 + 29 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 29 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n\n  else {\n    if (n == 1) {\n      y = z;\n      printf(\"%d\", y);\n    } else if (n == 2) {\n      y = 31 + z;\n      printf(\"%d\", y);\n    } else if (n == 3) {\n      y = 31 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 4) {\n      y = 31 * 2 + 28 + z;\n      printf(\"%d\", y);\n    } else if (n == 5) {\n      y = 31 * 2 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 6) {\n      y = 31 * 3 + 28 + 30 + z;\n      printf(\"%d\", y);\n    } else if (n == 7) {\n      y = 31 * 3 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 8) {\n      y = 31 * 4 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 9) {\n      y = 31 * 5 + 28 + 30 * 2 + z;\n      printf(\"%d\", y);\n    } else if (n == 10) {\n      y = 31 * 5 + 28 + 30 * 3 + z;\n      cout << y;\n    } else if (n == 11) {\n      y = 31 * 6 + 28 + 30 * 3 + z;\n      printf(\"%d\", y);\n    } else if (n == 12) {\n      y = 31 * 6 + 28 + 30 * 4 + z;\n      printf(\"%d\", y);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int day = 0;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) {\n    int a[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++) {\n      day += a[i];\n    }\n    day += date;\n  } else {\n    int b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= (month - 1); i++) {\n      day += b[i];\n    }\n    day += date;\n  }\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d, m, y, sum, leap;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    printf(\"data error\");\n    break;\n  }\n  sum = sum + d;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && m > 2)\n    sum++;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "20070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap_year(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else if (y % 4 == 0 && y % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, count;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (leap_year(y)) {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 29;\n      break;\n    case 4:\n      count = 31 + 29 + 31;\n      break;\n    case 5:\n      count = 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  } else {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 28;\n      break;\n    case 4:\n      count = 31 + 28 + 31;\n      break;\n    case 5:\n      count = 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "11", "index": "20071", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n\n    d = c;\n  }\n\n  else if (b == 2) {\n    d = 31 + c;\n\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n\n      if (b == 3) {\n        d = 31 + 29 + c;\n      }\n      if (b == 4) {\n        d = 31 + 29 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 29 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 29 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    } else {\n      if (b == 3) {\n        d = 31 + 28 + c;\n      }\n      if (b == 4) {\n        d = 31 + 28 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 28 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 28 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    }\n  }\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, days;\n  cin >> year >> month >> day;\n  if (month == 1)\n    days = day;\n  else if (month == 2)\n    days = day + 31;\n  else if (month == 3)\n    days = day + 59;\n  else if (month == 4)\n    days = day + 90;\n  else if (month == 5)\n    days = day + 120;\n  else if (month == 6)\n    days = day + 151;\n  else if (month == 7)\n    days = day + 181;\n  else if (month == 8)\n    days = day + 212;\n  else if (month == 9)\n    days = day + 243;\n  else if (month == 10)\n    days = day + 273;\n  else if (month == 11)\n    days = day + 304;\n  else if (month == 12)\n    days = day + 334;\n  if (year % 100 == 0, year % 400 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  } else if (year % 400 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 29 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 29 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 28 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 28 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  }\n  printf(\"\\n\");\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20074", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int y, m, d;\n  int i = 0, num = 0;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && (y % 100 != 0 || (y % 400 == 0))) {\n    \n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num += d;\n  } else {\n    \n    int a[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < m - 1; i++)\n      num += a[i];\n    num = num + d;\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 29;\n      break;\n    case 4:\n      n = d + 31 * 2 + 29;\n      break;\n    case 5:\n      n = d + 29 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 29 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 29 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 29 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 29 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 29 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 29 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 29 + 31 * 6 + 30 * 4;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 28;\n      break;\n    case 4:\n      n = d + 31 * 2 + 28;\n      break;\n    case 5:\n      n = d + 28 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 28 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 28 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 28 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 28 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 28 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 28 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 28 + 31 * 6 + 30 * 4;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20076", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int month[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, ans;\n  if (y % 400 == 0 || (y % 100 && y % 4 == 0))\n    month[2] = 29;\n  ans = 0;\n  for (i = 1; i < m; i++)\n    ans += month[i];\n  ans += d;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "20077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, day, date = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      date = date + 30;\n    else {\n      if (i == 2) {\n        if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n          date = date + 29;\n        else\n          date = date + 28;\n      } else\n        date = date + 31;\n    }\n  }\n  date = date + day;\n  cout << date << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  unsigned long int year, month, day, b[30][3];\n  int a, c, d, i;\n  for (i = 0; i < 5; i++) {\n    cin >> year >> month >> day;\n    b[i][0] = year;\n    b[i][1] = month;\n    b[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = b[i][0];\n    month = b[i][1];\n    day = b[i][2];\n    a = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n    if (a == 1) {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 29;\n        break;\n      case 4:\n        c = 31 + 29 + 31;\n        break;\n      case 5:\n        c = 31 + 29 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 29 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n\n    } else {\n      switch (month) {\n      case 1:\n        c = 0;\n        break;\n      case 2:\n        c = 31;\n        break;\n      case 3:\n        c = 31 + 28;\n        break;\n      case 4:\n        c = 31 + 28 + 31;\n        break;\n      case 5:\n        c = 31 + 28 + 31 + 30;\n        break;\n      case 6:\n        c = 31 + 28 + 31 + 30 + 31;\n        break;\n      case 7:\n        c = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n      case 8:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n      case 9:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n      case 10:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n      case 11:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        c = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    d = c + day;\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, y = 0, days, w;\n  cin >> year >> month >> days;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      day = 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      day = 30;\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        day = 29;\n      else\n        day = 28;\n    }\n    y = y + day;\n  }\n  w = y + days;\n  cout << w << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, date, day = 0;\n  cin >> year >> mon >> date;\n  switch (mon) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = 31 + date;\n    break;\n  case 3:\n    day = 31 + 28 + date;\n    break;\n  case 4:\n    day = 31 + 28 + 31 + date;\n    break;\n  case 5:\n    day = 31 + 28 + 31 + 30 + date;\n    break;\n  case 6:\n    day = 31 + 28 + 31 + 30 + 31 + date;\n    break;\n  case 7:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + date;\n    break;\n  case 8:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + date;\n    break;\n  case 9:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n    break;\n  case 10:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n    break;\n  case 11:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n    break;\n  case 12:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n    break;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (mon > 2)\n      day++;\n  }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, s;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    s = c;\n    break;\n  case 2:\n    s = c + 31;\n    break;\n  case 3:\n    s = c + 31 + 28;\n    break;\n  case 4:\n    s = c + 31 + 28 + 31;\n    break;\n  case 5:\n    s = c + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    s = c + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    s = c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  if ((a % 4 == 0 && a % 100 != 0 || a % 400 == 0) && (b > 2))\n    s = s + 1;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  total = 0;\n  for (i = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a, b;\n  int i, s;\n  int c = 0;\n  cin >> m >> a >> b;\n  if ((m % 4 == 0 && m % 100 != 0) || (m % 400 == 0)) {\n    int months[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++) {\n      c = c + months[i];\n    }\n    s = c + b;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++) {\n      c = c + month[i];\n    }\n    s = c + b;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint Year(int a) {\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      return 1;\n    } else\n      return 0;\n  } else if (a % 4 == 0) {\n    return 1;\n  } else\n    return 0;\n}\nint main() {\n  int year, month, day, a[13], i, answer;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i <= 12; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      a[i] = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      a[i] = 30;\n      break;\n    case 2:\n      if (Year(year) == 1) {\n        a[i] = 29;\n        break;\n      } else {\n        a[i] = 28;\n        break;\n      }\n    }\n  }\n  answer = 0;\n  for (i = 1; i < month; i++) {\n    answer += a[i];\n  }\n  answer += day;\n  printf(\"%d\\n\", answer);\n  return 0;\n}\n"}
{"label": "11", "index": "20085", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, d, m, i, j, e = 0, total = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))\n    a[1] = 29;\n  for (i = 1; i < m; i++) {\n    total += a[i - 1];\n  }\n  total += d;\n  printf(\"%d\\n\", total);\n}\n"}
{"label": "11", "index": "20086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  scanf(\"%d%d%d\", &i, &j, &k);\n  if ((i % 4 == 0 && i % 100 != 0) || (i % 100 == 0 && i % 400 == 0)) {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 60;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 91;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 121;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 152;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 182;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 213;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 244;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 274;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 305;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 335;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 59;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 90;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 120;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 151;\n      cout << m;\n    }\n    if (j == 7) {\n      m = k + 181;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 212;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 243;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 273;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 304;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 334;\n      printf(\"%d\", m);\n    }\n  }\n}\n"}
{"label": "11", "index": "20087", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int dmonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i = 0;\n  int sum = 0;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + dmonth[i];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month >= 3)\n      sum = sum + day + 1;\n\n  } else {\n    sum = sum + day;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f1(int n) {\n  int i, m;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 28;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint f2(int n) {\n  int m, i;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 29;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint main() {\n  int y, mon, d, a;\n  scanf(\"%d%d%d\", &y, &mon, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    a = f1(mon) + d;\n    cout << a;\n  } else {\n    a = f2(mon) + d;\n    printf(\"%d\", a);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n\n    for (int i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 ||\n          i == 12) {\n        t += 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t += 30;\n      } else {\n        t += 29;\n      }\n    }\n  } else {\n    for (int j = 1; j < b; j++) {\n      if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 ||\n          j == 12) {\n        t += 31;\n      } else if (j == 4 || j == 6 || j == 9 || j == 11) {\n        t += 30;\n      } else {\n        t += 28;\n      }\n    }\n  }\n  t = t + c;\n\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "20090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isRN(int year) {\n  int result;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\nint main() {\n  int year, month, day;\n  int i;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else {\n      if (isRN(year) == 1)\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int test(int n);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, s, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (test(y) == 1) {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + b[i];\n  } else {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + a[i];\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n}\nint test(int n) {\n  if (n % 400 == 0)\n    n = 1;\n  else if (n % 100 != 0 && n % 4 == 0)\n    n = 1;\n  else\n    n = 0;\n\n  return (n);\n}\n"}
{"label": "11", "index": "20092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if ((a % 4 == 0) && (a % 100 == 0) && (a % 400 == 0)) {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 29 + c);\n      break;\n    }\n    case 4: {\n      cout << 31 + 29 + 31 + c;\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 28 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 28 + 31 + c);\n      break;\n    }\n    case 5: {\n      cout << 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  long int year[5], month[5], day[5], t[5];\n  long int c[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},\n           b[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  for (i = 0; i <= 4; i++) {\n    scanf(\"%ld %ld %ld\", &year[i], &month[i], &day[i]);\n    if (year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0)\n      t[i] = c[month[i] - 1] + day[i];\n    else\n      t[i] = b[month[i] - 1] + day[i];\n  }\n  for (i = 0; i <= 4; i++)\n    printf(\"%ld\\n\", t[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "20094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, m, n;\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || a % 4 == 0 && a % 100 != 0) {\n    m = 29;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    m = 28;\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 31 + m + c;\n    else if (b == 4)\n      n = 31 + m + 31 + c;\n    else if (b == 5)\n      n = 31 + m + 31 + 30 + c;\n    else if (b == 6)\n      n = 31 + m + 31 + 30 + 31 + c;\n    else if (b == 7)\n      n = 31 + m + 31 + 30 + 31 + 30 + c;\n    else if (b == 8)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    else if (b == 9)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    else if (b == 10)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    else if (b == 11)\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    else\n      n = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, j, k, sum = 0, a;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i <= (m - 1); i++) {\n    if (i == 1)\n      sum = sum + 31;\n    if (i == 3)\n      sum = sum + 31;\n    if (i == 5)\n      sum = sum + 31;\n    if (i == 7)\n      sum = sum + 31;\n    if (i == 8)\n      sum = sum + 31;\n    if (i == 10)\n      sum = sum + 31;\n    if (i == 12)\n      sum = sum + 31;\n    if (i == 4)\n      sum = sum + 30;\n    if (i == 6)\n      sum = sum + 30;\n    if (i == 9)\n      sum = sum + 30;\n\n    if (i == 11)\n      sum = sum + 30;\n    if (i == 2) {\n      j = y % 4, k = y % 400, a = y % 100;\n      if ((a != 0 && j == 0) || (k == 0))\n        sum = sum + 29;\n      else\n        sum = sum + 28;\n    }\n  }\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint run(int x) {\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0)) {\n    return 1;\n  }\n  return 0;\n}\nint main() {\n  int y, m, d, x;\n  cin >> y >> m >> d;\n  if (run(y)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 60 + d;\n      break;\n    case 4:\n      x = 91 + d;\n      break;\n    case 5:\n      x = 121 + d;\n      break;\n    case 6:\n      x = 152 + d;\n      break;\n    case 7:\n      x = 182 + d;\n      break;\n    case 8:\n      x = 213 + d;\n      break;\n    case 9:\n      x = 244 + d;\n      break;\n    case 10:\n      x = 274 + d;\n      break;\n    case 11:\n      x = 305 + d;\n      break;\n    case 12:\n      x = 335 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 59 + d;\n      break;\n    case 4:\n      x = 90 + d;\n      break;\n    case 5:\n      x = 120 + d;\n      break;\n    case 6:\n      x = 151 + d;\n      break;\n    case 7:\n      x = 181 + d;\n      break;\n    case 8:\n      x = 212 + d;\n      break;\n    case 9:\n      x = 243 + d;\n      break;\n    case 10:\n      x = 273 + d;\n      break;\n    case 11:\n      x = 304 + d;\n      break;\n    case 12:\n      x = 334 + d;\n      break;\n    }\n  }\n  cout << x;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20097", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, k, leap = 0, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    leap = 1;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      k = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      k = 30;\n      break;\n    case 2:\n      if (leap == 1)\n        k = 29;\n      else\n        k = 28;\n      break;\n    }\n    sum += k;\n  }\n  cout << sum + d;\n  return 0;\n}\n"}
{"label": "11", "index": "20098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 0; i < month; i++)\n      sum += a[1][i];\n    sum = sum + day - a[1][month - 1];\n  } else {\n    for (i = 0; i < month; i++)\n      sum += a[0][i];\n    sum = sum + day - a[0][month - 1];\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20099", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint shirunnian(int d) {\n  if (d % 4 == 0) {\n    if (d % 100 == 0) {\n      if (d % 400 == 0) {\n        return 1;\n      } else\n        return 0;\n    } else\n      return 1;\n  } else\n    return 0;\n}\n\nint dijitian(int a, int b, int c) {\n  int i;\n  int sum = 0;\n  int days = 0;\n  for (i = 0; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    else if (i == 2) {\n      if (shirunnian(a) == 1)\n        days += 29;\n      else if (shirunnian(a) == 0)\n        days += 28;\n    }\n  }\n  sum = days + c;\n  return sum;\n}\n\nint main() {\n  int year, month, day, tianshu = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  tianshu = dijitian(year, month, day);\n  printf(\"%d\", tianshu);\n  return 0;\n}\n"}
{"label": "11", "index": "20100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = 29;\n  else {\n    a[2] = 28;\n  }\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  int n, i;\n  n = 0;\n  for (i = 1; i < m; i++) {\n    n = n + a[i];\n  }\n  n = n + d;\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int a[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};\n    d = a[b - 1] + c;\n    printf(\"%d\\n\", d);\n  } else {\n    int a[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n    d = a[b - 1] + c;\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, leap;\n  cin >> year >> month >> day;\n\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 29 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 29 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 29 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 28 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 28 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 28 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 10:\n      cout << 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day;\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20103", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 60);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 91);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 121);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 152);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 182);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 213);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 305);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 335);\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 59);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 90);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 120);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 151);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 181);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 212);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 304);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 334);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Day1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Day2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int sumday = 0;\n  int i, j;\n\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    j = 1;\n  else\n    j = 0;\n  if (j == 1) {\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day2[i];\n      }\n      sumday = sumday + day;\n      cout << sumday << endl;\n    }\n  }\n  if (j == 0) {\n\n    if (month == 1)\n      cout << day << endl;\n    if (month > 1) {\n      for (i = 0; i < month - 1; i++) {\n        sumday = sumday + Day1[i];\n      }\n      sumday = sumday + day;\n      printf(\"%d\\n\", sumday);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, n, i, j;\n  for (j = 1; j <= 5; j++) {\n    n = 0;\n    scanf(\"%d %d %d\", &year, &month, &day);\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    } else {\n      int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    }\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "11", "index": "20106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int yy, mm, dd, m = 0, days = 0;\n  cin >> yy >> mm >> dd;\n  do {\n    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)\n      days = days + 31;\n    else if (m == 4 || m == 6 || m == 9 || m == 11)\n      days = days + 30;\n    else if ((((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0)) && m == 2)\n      days = days + 29;\n    else if ((yy % 4 != 0 || yy % 100 == 0) && m == 2)\n      days = days + 28;\n    m++;\n  } while (m < mm);\n  days = days + dd;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            month2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n            day, month, number = 0, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    for (i = 0; i < month; i++)\n      number += month2[i];\n    number += day;\n  } else {\n    for (i = 0; i < month; i++)\n      number += month1[i];\n    number += day;\n  }\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, math, day;\n  int date;\n  cin >> year >> math >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 29 + day;\n    }\n    if (math == 4) {\n      date = 31 + 29 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 29 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 29 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n  if (year % 4 != 0 || (year % 100 == 0) && year % 400 != 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 28 + day;\n    }\n    if (math == 4) {\n      date = 31 + 28 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 28 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 28 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n\n  cout << date;\n  return 0;\n}\n"}
{"label": "11", "index": "20109", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k;\n  if (a % 100 == 0 && a % 400 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else {\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  }\n}\n"}
{"label": "11", "index": "20110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, d, i, n;\n  cin >> k >> m >> d;\n  if (k % 4 == 0)\n    if (k % 100 == 0)\n      if (k % 400 == 0)\n        i = 29;\n      else\n        i = 28;\n    else\n      i = 29;\n  else\n    i = 28;\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  if (m == 2) {\n    n = d + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 3) {\n    n = d + i + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 4) {\n    n = d + i + 31 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 5) {\n    n = d + i + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 6) {\n    n = d + i + 31 + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 7) {\n    n = d + i + 31 + 31 + 31 + 60;\n    cout << n << \"\\n\";\n  }\n  if (m == 8) {\n    n = d + i + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 9) {\n    n = d + i + 184 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 10) {\n    n = d + i + 31 + 30 + 184;\n    cout << n << \"\\n\";\n  }\n  if (m == 11) {\n    n = d + i + 31 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 12) {\n    n = d + i + 31 + 30 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  cin >> year >> month >> day;\n  int pin[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + run[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  } else {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + pin[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 29 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 29 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      cout << d;\n    } else if (b == 7) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n\n  } else if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1) {\n      d = c;\n      cout << d;\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 28 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 28 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  int n, i;\n  n = 0;\n  for (i = 1; i < m; i++) {\n    n = n + a[i];\n  }\n  n = n + d;\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20114", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d%d%d%d\", &y, &m, &d, &n);\n  if (y % 4 == 0 && y % 100 != 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  }\n  if (y % 400 == 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else {\n      if (m <= 8) {\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n\n      } else {\n        if (m % 2 == 0)\n          n = (m - 1) * 30 - 1 + m / 2 + d;\n        else\n          n = (m - 1) * 30 + m / 2 + d;\n      }\n    }\n  } else {\n\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 2 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 2 + m / 2 + d;\n      else\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  cin >> year >> month >> day;\n  if (month == 1) {\n    n = day;\n  } else if (month == 2) {\n    n = 31 + day;\n  } else if ((year % 4 != 0 || year % 100 == 0) && year % 400 != 0) {\n    if (month < 8) {\n      if (month % 2 == 0) {\n        n = 31 * (month - 1) - 2 - month / 2 + day;\n      } else\n        n = 31 * (month - 1) - 2 - (month - 1) / 2 + day;\n    } else if (month % 2 == 0) {\n      n = 31 * 4 + 28 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n    } else\n      n = 31 * 4 + 28 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  } else if (month < 8) {\n    if (month % 2 == 0)\n      n = 31 * (month - 1) - 1 - month / 2 + day;\n    else\n      n = 31 * (month - 1) - 1 - (month - 1) / 2 + day;\n  } else if (month % 2 == 0) {\n    n = 31 * 4 + 29 + 30 * 2 + (month - 8) * 31 - (month / 2 - 5) + day;\n  } else\n    n = 31 * 4 + 29 + 60 + (month - 8) * 31 - ((month - 1) / 2 - 4) + day;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (int i = 0; i <= month - 1; i++) {\n    if (i == month - 1)\n      sum += day;\n    else {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        sum += m2[i];\n      else\n        sum += m1[i];\n    }\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, a;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 60;\n    if (month == 4)\n      a = day + 91;\n    if (month == 5)\n      a = day + 121;\n    if (month == 6)\n      a = day + 152;\n    if (month == 7)\n      a = day + 182;\n    if (month == 8)\n      a = day + 213;\n    if (month == 9)\n      a = day + 244;\n    if (month == 10)\n      a = day + 274;\n    if (month == 11)\n      a = day + 305;\n    if (month == 12)\n      a = day + 335;\n  } else {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 59;\n    if (month == 4)\n      a = day + 90;\n    if (month == 5)\n      a = day + 120;\n    if (month == 6)\n      a = day + 151;\n    if (month == 7)\n      a = day + 181;\n    if (month == 8)\n      a = day + 212;\n    if (month == 9)\n      a = day + 243;\n    if (month == 10)\n      a = day + 273;\n    if (month == 11)\n      a = day + 304;\n    if (month == 12)\n      a = day + 334;\n  };\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "20118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  int a = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    a = 1;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 59 + day;\n  if (month == 4)\n    n = 90 + day;\n  if (month == 5)\n    n = 120 + day;\n  if (month == 6)\n    n = 151 + day;\n  if (month == 7)\n    n = 181 + day;\n  if (month == 8)\n    n = 212 + day;\n  if (month == 9)\n    n = 243 + day;\n  if (month == 10)\n    n = 273 + day;\n  if (month == 11)\n    n = 304 + day;\n  if (month == 12)\n    n = 334 + 12;\n  if (month > 2 && a == 1)\n    n++;\n  cout << n;\n}\n"}
{"label": "11", "index": "20119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    d[1]++;\n  }\n  int g = c;\n  int i = 0;\n  while (i >= b) {\n    d[i]++;\n  }\n  for (i = 0; i < b - 1; i++) {\n    g = g + d[i];\n  }\n  cout << g;\n  return 0;\n}\n"}
{"label": "11", "index": "20121", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 60);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 91);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 121);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 152);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 182);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 213);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 305);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 335);\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 59);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 90);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 120);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 151);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 181);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 212);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 304);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 334);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, a, rank;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    a = 1;\n  } else {\n    a = 0;\n  }\n  if (month == 1) {\n    rank = day;\n  }\n  if (month == 2) {\n    rank = 31 + day;\n  }\n  if (month == 3) {\n    rank = 59 + a + day;\n  }\n  if (month == 4) {\n    rank = 90 + a + day;\n  }\n  if (month == 5) {\n    rank = 120 + a + day;\n  }\n  if (month == 6) {\n    rank = 151 + a + day;\n  }\n  if (month == 7) {\n    rank = 181 + a + day;\n  }\n  if (month == 8) {\n    rank = 212 + a + day;\n  }\n  if (month == 9) {\n    rank = 243 + a + day;\n  }\n  if (month == 10) {\n    rank = 273 + a + day;\n  }\n  if (month == 11) {\n    rank = 304 + a + day;\n  }\n  if (month == 12) {\n    rank = 334 + a + day;\n  }\n  cout << rank;\n  return 0;\n}\n"}
{"label": "11", "index": "20123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, num;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    num = d;\n    break;\n  case 2:\n    num = 31 + d;\n    break;\n  case 3:\n    num = 59 + d;\n    break;\n  case 4:\n    num = 90 + d;\n    break;\n  case 5:\n    num = 120 + d;\n    break;\n  case 6:\n    num = 151 + d;\n    break;\n  case 7:\n    num = 181 + d;\n    break;\n  case 8:\n    num = 212 + d;\n    break;\n  case 9:\n    num = 243 + d;\n    break;\n  case 10:\n    num = 273 + d;\n    break;\n  case 11:\n    num = 304 + d;\n    break;\n  case 12:\n    num = 334 + d;\n    break;\n  }\n  if (((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) && (m > 2))\n    num = num + 1;\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20124", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, date = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      date = date + 30;\n    else {\n      if (i == 2) {\n        if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n          date = date + 29;\n        else\n          date = date + 28;\n      } else\n        date = date + 31;\n    }\n  }\n  date = date + day;\n  printf(\"%d\\n\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "20125", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 != 0) || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int total = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= month - 1; i++) {\n      total = total + a[i - 1];\n    }\n    total = total + day;\n\n  } else {\n    int b[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int j = 1; j <= month - 1; j++) {\n      total = total + b[j - 1];\n    }\n\n    total = total + day;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20127", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, x, i;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  if (a % 400 == 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++)\n      x = x + n[i];\n\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  x = x + c;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int Y) {\n  if (Y % 400 == 0)\n    return 1;\n  else if (Y % 100 == 0)\n    return 0;\n  else if (Y % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if (leap(Y) == 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 28 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 28 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 29 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 29 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month == 2 &&\n      (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month != 2 &&\n      (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, num = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0)\n      a[2] = 28;\n    else if (year % 400 == 0)\n      a[2] = 29;\n    else\n      a[2] = 29;\n  } else\n    a[2] = 28;\n  for (i = 1; i < month; i++)\n    num = num + a[i];\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rui(int y, int m) {\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) && m == 2)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int d = 0, y, m, r, i;\n  int pp[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> r;\n  for (i = 1; i < m; i++)\n    d = d + pp[i] + rui(y, i);\n  d = d + r;\n  cout << d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, days;\n  scanf(\"%d %d %d\", &year, &month, &days);\n  int day;\n  if (month == 1) {\n    day = days;\n  }\n  if (month == 2) {\n    day = 31 + days;\n  }\n  if (month == 3) {\n    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n      day = 31 + 29 + days;\n    else\n      day = 31 + 28 + days;\n  }\n  if (month == 4) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + days;\n    else\n      day = 31 + 28 + 31 + days;\n  }\n  if (month == 5) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + days;\n  }\n  if (month == 6) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 30 + 31 + 31 + days;\n  }\n  if (month == 7) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + days;\n  }\n  if (month == 8) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + days;\n  }\n  if (month == 9) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + days;\n  }\n  if (month == 10) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + days;\n  }\n  if (month == 11) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + days;\n  }\n  if (month == 12) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      day = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n    else\n      day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + days;\n  }\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y + 400) % 400 == 0) || ((y % 4 == 0) && ((y % 100) != 0))) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 60 + d;\n    else if (m == 4)\n      n = 91 + d;\n    else if (m == 5)\n      n = 121 + d;\n    else if (m == 6)\n      n = 152 + d;\n    else if (m == 7)\n      n = 182 + d;\n    else if (m == 8)\n      n = 213 + d;\n    else if (m == 9)\n      n = 244 + d;\n    else if (m == 10)\n      n = 274 + d;\n    else if (m == 11)\n      n = 305 + d;\n    else if (m == 12)\n      n = 335 + d;\n    printf(\"%d\\n\", n);\n  } else {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 59 + d;\n    else if (m == 4)\n      n = 90 + d;\n    else if (m == 5)\n      n = 120 + d;\n    else if (m == 6)\n      n = 151 + d;\n    else if (m == 7)\n      n = 181 + d;\n    else if (m == 8)\n      n = 212 + d;\n    else if (m == 9)\n      n = 243 + d;\n    else if (m == 10)\n      n = 273 + d;\n    else if (m == 11)\n      n = 304 + d;\n    else if (m == 12)\n      n = 334 + d;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[1] = 29;\n  if (m == 1)\n    cout << d;\n  else {\n    for (int i = 0; i < m - 1; i++) {\n      t = t + a[i];\n    }\n    cout << t + d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20135", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, d = 0;\n\n  scanf(\"%d %d %d \", &year, &month, &day);\n\n  switch (month) {\n  case 1:\n    d = 0;\n    break;\n  case 2:\n    d = 31;\n    break;\n\n  case 3:\n    d = 59;\n    break;\n\n  case 4:\n    d = 90;\n    break;\n\n  case 5:\n    d = 120;\n    break;\n\n  case 6:\n    d = 151;\n    break;\n\n  case 7:\n    d = 181;\n    break;\n\n  case 8:\n    d = 212;\n    break;\n\n  case 9:\n    d = 243;\n    break;\n\n  case 10:\n    d = 273;\n    break;\n\n  case 11:\n    d = 304;\n    break;\n\n  case 12:\n    d = 334;\n    break;\n  }\n  if ((month > 2) && (year % 400 == 0)) {\n    d = d + 1 + day;\n  } else if ((month > 2) && (year % 100 != 0) && (year % 4 == 0)) {\n    d = d + 1 + day;\n  }\n\n  else {\n    d = d + day;\n  }\n\n  printf(\"%d\\n\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20136", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint run(int a) {\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int isr = run(y);\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days = 0;\n  for (int i = 1; i < m; i++) {\n    days = days + p[i];\n  }\n  days = days + d;\n  if (isr == 1 && m >= 3)\n    days++;\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x;\n\n  scanf(\"%d%d%d\", &a, &b, &c);\n\n  d = 31 + c;\n  e = 59 + c;\n  f = 90 + c;\n  g = 120 + c;\n  h = 151 + c;\n  i = 181 + c;\n  j = 212 + c;\n  k = 243 + c;\n  l = 273 + c;\n  m = 304 + c;\n  n = 334 + c;\n  o = 60 + c;\n  p = 91 + c;\n  q = 121 + c;\n  r = 152 + c;\n  s = 182 + c;\n  t = 213 + c;\n  u = 244 + c;\n  v = 274 + c;\n  w = 305 + c;\n  x = 335 + c;\n\n  if (b == 1)\n    printf(\"%d\", c);\n  if (b == 2)\n    printf(\"%d\", d);\n  if ((b == 3) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", e);\n  if ((b == 4) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", f);\n  if ((b == 5) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", g);\n  if ((b == 6) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", h);\n  if ((b == 7) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", i);\n  if ((b == 8) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", j);\n  if ((b == 9) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", k);\n  if ((b == 10) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", l);\n  if ((b == 11) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", m);\n  if ((b == 12) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", n);\n  if ((b == 3) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", o);\n  if ((b == 4) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", p);\n  if ((b == 5) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", q);\n  if ((b == 6) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", r);\n  if ((b == 7) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", s);\n  if ((b == 8) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", t);\n  if ((b == 9) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", u);\n  if ((b == 10) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", v);\n  if ((b == 11) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", w);\n  if ((b == 12) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int daysa[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int daysb[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  int num = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int i;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysa[i - 1];\n    }\n    num = num + d;\n  } else {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysb[i - 1];\n    }\n    num = num + d;\n  }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a, b, c, e, i;\n  int d = 0;\n\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    int score[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++)\n      d = d + score[i];\n\n    e = d + c;\n  } else {\n    int score[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < b - 1; i++) {\n      d = d + score[i];\n    }\n    e = d + c;\n  }\n  cout << e << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20140", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[10], mon[10], date[10], day[12], i, j, sum[10];\n  for (i = 0; i <= 4; i++)\n    cin >> year[i] >> mon[i] >> date[i];\n  for (i = 0; i <= 4; i++) {\n    sum[i] = 0;\n    day[0] = 31;\n    if (((year[i] % 4 == 0) && (year[i] % 100 != 0)) || (year[i] % 400 == 0))\n      day[1] = 29;\n    else\n      day[1] = 28;\n\n    day[2] = 31;\n    day[3] = 30;\n    day[4] = 31;\n    day[5] = 30;\n    day[6] = 31;\n    day[7] = 31;\n    day[8] = 30;\n    day[9] = 31;\n    day[10] = 30;\n    day[11] = 31;\n    for (j = 0; j <= mon[i] - 2; j++)\n      sum[i] = sum[i] + day[j];\n    sum[i] = sum[i] + date[i];\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20141", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(int year) {\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, date = 0;\n  cin >> year;\n  cin >> month;\n  scanf(\"%d \", &day);\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int i;\n  for (i = 1; i < month; i++) {\n    date = date + m[i];\n    if (i == 2) {\n      date = date + check(year);\n    }\n  }\n  date = date + day;\n\n  cout << date << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  d = 0;\n  int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    for (e = 0; e < b; e++) {\n      d = d + days1[e];\n    }\n    d = d + c;\n  } else {\n    for (e = 0; e < b; e++) {\n      d = d + days2[e];\n    }\n    d = d + c;\n  }\n  d = d - 1;\n  cout << d;\n}\n"}
{"label": "11", "index": "20143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, x = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 2) {\n    x = 31 + day;\n    printf(\"%d\", x);\n  } else if (month == 1) {\n    x = day;\n    printf(\"%d\", x);\n  } else {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 3:\n        x = 31 + 29;\n        break;\n      case 4:\n        x = 31 + 29 + 31;\n        break;\n\n      case 5:\n        x = 31 + 29 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    } else {\n      switch (month) {\n      case 3:\n        x = 31 + 28;\n        break;\n      case 4:\n        x = 31 + 28 + 31;\n        break;\n\n      case 5:\n        x = 31 + 28 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 28 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    x = x + day;\n\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "11", "index": "20144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, b;\n  int i, s;\n  int c = 0;\n  scanf(\"%d %d %d\", &m, &a, &b);\n  if ((m % 4 == 0 && m % 100 != 0) || (m % 400 == 0)) {\n    int months[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++)\n      c = c + months[i];\n    s = c + b;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++) {\n      c = c + month[i];\n    }\n    s = c + b;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, n, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 100 == 0)\n    i = 400;\n  else\n    i = 4;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3) {\n    if (year % i == 0)\n      n = 31 + 29 + day;\n    else\n      n = 31 + 28 + day;\n  }\n  if (month == 4) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + day;\n    else\n      n = 31 + 28 + 31 + day;\n  }\n  if (month == 5) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + day;\n  }\n  if (month == 6) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + day;\n  }\n  if (month == 7) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n  }\n  if (month == 8) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  }\n  if (month == 9) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  }\n  if (month == 10) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  }\n  if (month == 11) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  }\n  if (month == 12) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, a;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    cout << a;\n  } else if (y % 400 == 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 == 0 && y % 400 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n, i, j;\n  for (j = 1; j <= 5; j++) {\n    n = 0;\n    scanf(\"%d %d %d\", &year, &month, &day);\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++)\n        n += days[i];\n\n      n += day;\n    } else {\n      int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (i = 0; i < month - 1; i++) {\n        n += days[i];\n      }\n      n += day;\n    }\n    cout << n << \"\\n\";\n  }\n}\n"}
{"label": "11", "index": "20148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s1 = 0, s2;\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    n[1] = 29;\n  for (i = 1; i < b; i++)\n    s1 = s1 + n[i - 1];\n  s2 = s1 + c;\n  cout << s2 << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n, p, a;\n  cin >> m >> n >> p;\n  if (m % 4 != 0 || (m % 100 == 0 && m % 400 != 0)) {\n    if (n == 1) {\n      a = p;\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n    } else if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 2 + p;\n\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 29 + p;\n    }\n\n  } else {\n    if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 + p;\n    } else if (n == 1) {\n      a = p;\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 30 + p;\n    }\n  }\n\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "20150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum, n = 0, k[13];\n  scanf(\"%d %d %d\", &y, &m, &d);\n  k[0] = 0;\n  k[1] = k[3] = k[5] = k[7] = k[8] = k[10] = k[12] = 31;\n  k[4] = k[6] = k[9] = k[11] = 30;\n  if (y % 4) {\n    if (y % 100) {\n      if (y % 400) {\n        k[2] = 28;\n      } else {\n        k[2] = 29;\n      }\n    } else\n      k[2] = 28;\n\n  } else {\n    k[2] = 29;\n  }\n  for (i = 0; i < m; i++) {\n    n = n + k[i];\n  }\n  sum = n + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20151", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    a[2] = 29;\n  int sum = 0;\n  for (int i = 1; i < month; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20152", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z, k = 0, i;\n  cin >> x >> y >> z;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    for (i = 0; i < y - 1; i++)\n      k = k + b[i];\n  else\n    for (i = 0; i < y - 1; i++)\n      k = k + a[i];\n  k = k + z;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "20153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0, i, h;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    days[1] = 29;\n  } else {\n    days[1] = 28;\n  }\n  for (i = 0; i < m - 1; i++)\n    sum = sum + days[i];\n\n  h = sum + d;\n  printf(\"%d\", h);\n  return 0;\n}\n"}
{"label": "11", "index": "20154", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (z == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++)\n    sum = sum + a[i];\n\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20155", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint run(int nian) {\n  if (nian % 400 == 0)\n    return 1;\n  else {\n    if (nian % 100 == 0)\n      return 0;\n    else if (nian % 4 == 0)\n      return 1;\n    else\n      return 0;\n  }\n}\n\nint mon(int m, int n) {\n  switch (m) {\n  case 1:\n  case 3:\n  case 5:\n  case 7:\n  case 8:\n  case 10:\n    return 31;\n  case 4:\n  case 6:\n  case 9:\n  case 11:\n    return 30;\n  default:\n    if (run(n))\n      return 29;\n    else\n      return 28;\n  }\n}\n\nint main() {\n  int year, month, day, date, i;\n  cin >> year >> month >> day;\n  date = 0;\n  for (i = 1; i < month; i++)\n    date = date + mon(i, year);\n  date = date + day;\n  printf(\"%d\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "20156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, c, days;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  days = 0;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    m[2] = 29;\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  } else {\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    cout << days + c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, j;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        j = 1;\n      else\n        j = 0;\n    } else\n      j = 1;\n\n  } else\n    j = 0;\n  if (j == 1) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\", d + 335);\n      break;\n    }\n  }\n\n  if (j == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\", d + 334);\n      break;\n    }\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n\n  if ((a % 4 == 0) && (a % 100 == 0) && (a % 400 == 0)) {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 29 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 29 + 31 + c);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 28 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 28 + 31 + c);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, b;\n  int i, s;\n  int c = 0;\n  scanf(\"%d %d %d\", &m, &a, &b);\n  if ((m % 4 == 0 && m % 100 != 0) || (m % 400 == 0)) {\n    int months[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++)\n      c = c + months[i];\n    s = c + b;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < a; i++)\n      c = c + month[i];\n    s = c + b;\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, day, i, x;\n  cin >> a >> m >> day;\n  switch (m) {\n  case 1:\n    i = 0;\n    break;\n  case 2:\n    i = 31;\n    break;\n  case 3:\n    i = 31 + 28;\n    break;\n  case 4:\n    i = 31 + 28 + 31;\n    break;\n  case 5:\n    i = 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    i = 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    i = 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  default:\n    printf(\"error\\n\");\n  }\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if ((m != 1) && (m != 2))\n      x = i + day + 1;\n    else\n      x = i + day;\n  } else\n    x = i + day;\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, num = 0, i,\n                        a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++) {\n    num += a[i];\n  }\n  num += day;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day, n, leap;\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap = 0) {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 29 + day;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    cout << n;\n  } else {\n    switch (mon) {\n    case 1:\n      n = day;\n      break;\n    case 2:\n      n = 31 + day;\n      break;\n    case 3:\n      n = 31 + 28 + day;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      cout << 31 + day;\n    else if (month == 3)\n      printf(\"%d\", 31 + 29 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 29 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", 31 + day);\n    else if (month == 3)\n      printf(\"%d\", 31 + 28 + day);\n    else if (month == 4)\n      printf(\"%d\", 31 + 28 + 31 + day);\n    else if (month == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + day);\n    else if (month == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + day);\n    else if (month == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + day);\n    else if (month == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + day);\n    else if (month == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day);\n    else if (month == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day);\n    else if (month == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day);\n    else\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day);\n  }\n  printf(\"\\n\");\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, m, n, t, i, s;\n  scanf(\"%d%d%d\", &l, &m, &n);\n  if (l % 4 == 0 && l % 100 != 0)\n    t = 29;\n  if (l % 4 != 0)\n    t = 28;\n  if (l % 100 == 0 && l % 400 != 0)\n    t = 28;\n  if (l % 400 == 0)\n    t = 29;\n  int a[13] = {0, 31, t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (m == 1)\n    s = n;\n  else\n    s = n;\n  for (i = 1; i < m; i++) {\n    s = s + a[i];\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "20165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int Sn = 0;\n  int i = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  } else {\n    int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  }\n  printf(\"%d\", Sn);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  int i = 0;\n  int n[12];\n  sum = 0;\n  cin >> y >> m >> d;\n\n  if ((y % 4 == 0) && (y % 100 != 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 != 0)) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 == 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if (y % 4 != 0) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++)\n      sum = sum + n[i];\n\n    sum = sum + d;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20167", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int monday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  total = 0;\n  for (i = 1; i < month; i++) {\n    total = total + monday[i - 1];\n  }\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    total = total + 1;\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20168", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, j = 0, y, i, m, d,\n         number[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    j += number[i - 1];\n  }\n  k = j + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m > 1)\n      printf(\"%d\", k + 1);\n  } else\n    printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "20169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, date,\n      count = 0, day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &date);\n  for (i = 1; i < month; i++)\n    count += day[i];\n  count += date;\n  if (month > 2)\n    if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)))\n      count++;\n  cout << count;\n  return 0;\n}\n"}
{"label": "11", "index": "20170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int q1, q2, q3, k = 0;\n  cin >> q1 >> q2 >> q3;\n  if ((q1 % 4 == 0 && q1 & 100 != 0) || q1 % 400 == 0)\n    k++;\n  int a[15], b[16];\n  if (k == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  b[1] = 0;\n  for (int i = 2; i <= 12; i++)\n    b[i] = b[i - 1] + a[i - 1];\n  printf(\"%d\", b[q2] + q3);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int w, s, i, year, month, day;\n  int ymd[5][3];\n  int num[5];\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d %d %d\\n\", &year, &month, &day);\n    ymd[i][0] = year;\n    ymd[i][1] = month;\n    ymd[i][2] = day;\n  }\n  for (i = 0; i < 5; i++) {\n    year = ymd[i][0];\n    month = ymd[i][1];\n    day = ymd[i][2];\n    w = (year % 4 == 0 && year % 100 != 0) || year % 400 != 0;\n    switch (month) {\n    case 1:\n      s = 0;\n      break;\n    case 2:\n      s = 31;\n      break;\n    case 3:\n      s = 59;\n      break;\n    case 4:\n      s = 90;\n      break;\n    case 5:\n      s = 120;\n      break;\n    case 6:\n      s = 151;\n      break;\n    case 7:\n      s = 181;\n      break;\n    case 8:\n      s = 212;\n      break;\n    case 9:\n      s = 243;\n      break;\n    case 10:\n      s = 273;\n      break;\n    case 11:\n      s = 304;\n      break;\n    case 12:\n      s = 334;\n      break;\n    }\n    if (w == 0 && month > 2) {\n      s = s + 1;\n    }\n    num[i] = s + day;\n  }\n  printf(\"%d\\n%d\\n%d\\n%d\\n%d\\n\", num[0], num[1], num[2], num[3], num[4]);\n}\n"}
{"label": "11", "index": "20172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, sum;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if (b == 2) {\n    sum = 31 + c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0) {\n    if (b == 3) {\n      sum = 60 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 91 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 121 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 152 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 182 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 213 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 244 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 274 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 305 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 335 + c;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 3) {\n      sum = 59 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 90 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 120 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 151 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 181 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 212 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 243 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 273 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 304 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 334 + c;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int isrunnian(int);\n  int year, month, day, result = 0;\n  int i;\n  scanf(\"%d\", &year);\n  scanf(\"%d\", &month);\n  scanf(\"%d\", &day);\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      result = result + 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      result = result + 30;\n      break;\n    case 2:\n      if (isrunnian(year)) {\n        result = result + 29;\n      } else {\n        result = result + 28;\n      }\n      break;\n    }\n  }\n  result = result + day;\n  printf(\"%d\\n\", result);\n}\n\nint isrunnian(int year) {\n  if (year % 400 == 0) {\n    return 1;\n  } else if (year % 4 == 0 && year % 100 != 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\n"}
{"label": "11", "index": "20174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], m, tianshu, i;\n  for (i = 0; i <= 4; i++) {\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      m = 0;\n      break;\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n    if ((year[i] % 400 == 0) || (year[i] % 4 == 0 && year[i] % 100 != 0))\n      if (m > 31)\n        m = m + 1;\n    tianshu = m + day[i];\n    printf(\"%d\\n\", tianshu);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f1(int y, int r) {\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint f2(int y, int r) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++) {\n        d = d + a[k];\n      }\n    }\n  }\n  d = d + r;\n  return d;\n}\nint main() {\n  int a, y, r, d;\n  scanf(\"%d%d%d\", &a, &y, &r);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0))\n    d = f1(y, r);\n  else\n    d = f2(y, r);\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, math, day;\n  int date;\n  scanf(\"%d %d %d\", &year, &math, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 29 + day;\n    }\n    if (math == 4) {\n      date = 31 + 29 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 29 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 29 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n  if (year % 4 != 0 || (year % 100 == 0) && year % 400 != 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 28 + day;\n    }\n    if (math == 4) {\n      date = 31 + 28 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 28 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 28 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n\n  cout << date;\n  return 0;\n}\n"}
{"label": "11", "index": "20177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, x = 0, sum, i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 0; i < 12; i++) {\n    if (i + 1 == b)\n      break;\n    x = x + days[i];\n  }\n  sum = x + c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b <= 2) {\n      printf(\"%d\", sum);\n    }\n    if (b > 2) {\n      sum = sum + 1;\n      printf(\"%d\", sum);\n    }\n\n  } else\n    printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, x, i;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  if (a % 400 == 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  x = x + c;\n  cout << x;\n  return 0;\n}\n"}
{"label": "11", "index": "20179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int test(int n);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, s, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (test(y) == 1) {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + b[i];\n  } else {\n    s = d;\n    for (i = 0; i < m; i++)\n      s = s + a[i];\n  }\n  printf(\"%d\", s);\n  getchar();\n  getchar();\n}\nint test(int n) {\n  if (n % 400 == 0)\n    n = 1;\n  else if (n % 100 != 0 && n % 4 == 0)\n    n = 1;\n  else {\n    n = 0;\n  }\n  return (n);\n}\n"}
{"label": "11", "index": "20180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, sm = 0, k;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) != 0) {\n    int m[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sum = sum + m[k];\n    sum = sum + day;\n    printf(\"%d\", sum);\n  } else {\n    int n[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sm = sm + n[k];\n    sm = sm + day;\n    cout << sm;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (((y + 400) % 400 == 0) || ((y % 4 == 0) && ((y % 100) != 0))) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 60 + d;\n    else if (m == 4)\n      n = 91 + d;\n    else if (m == 5)\n      n = 121 + d;\n    else if (m == 6)\n      n = 152 + d;\n    else if (m == 7)\n      n = 182 + d;\n    else if (m == 8)\n      n = 213 + d;\n    else if (m == 9)\n      n = 244 + d;\n    else if (m == 10)\n      n = 274 + d;\n    else if (m == 11)\n      n = 305 + d;\n    else if (m == 12)\n      n = 335 + d;\n    printf(\"%d\\n\", n);\n  } else {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m == 3)\n      n = 59 + d;\n    else if (m == 4)\n      n = 90 + d;\n    else if (m == 5)\n      n = 120 + d;\n    else if (m == 6)\n      n = 151 + d;\n    else if (m == 7)\n      n = 181 + d;\n    else if (m == 8)\n      n = 212 + d;\n    else if (m == 9)\n      n = 243 + d;\n    else if (m == 10)\n      n = 273 + d;\n    else if (m == 11)\n      n = 304 + d;\n    else if (m == 12)\n      n = 334 + d;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20182", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, z, i, n;\n  scanf(\"%d %d %d \", &x, &y, &z);\n  if (x % 400 == 0)\n    i = 1;\n  else {\n    if (x % 100 == 0)\n      i = 0;\n    else {\n      if (x % 4 == 0) {\n        i = 1;\n      } else\n        i = 0;\n    }\n  }\n  if (i == 1) {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 29 + z;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 28 + z;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20183", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 29);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 29 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 28);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 28 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, num;\n  cin >> y >> m >> d;\n  switch (m) {\n  case 1:\n    num = d;\n    break;\n  case 2:\n    num = 31 + d;\n    break;\n  case 3:\n    num = 59 + d;\n    break;\n  case 4:\n    num = 90 + d;\n    break;\n  case 5:\n    num = 120 + d;\n    break;\n  case 6:\n    num = 151 + d;\n    break;\n  case 7:\n    num = 181 + d;\n    break;\n  case 8:\n    num = 212 + d;\n    break;\n  case 9:\n    num = 243 + d;\n    break;\n  case 10:\n    num = 273 + d;\n    break;\n  case 11:\n    num = 304 + d;\n    break;\n  case 12:\n    num = 334 + d;\n    break;\n  }\n  if (((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) && (m > 2))\n    num = num + 1;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, year = 0,\n      mon = 0, day = 0, i = 0, sum = 0;\n  cin >> year >> mon >> day;\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    sum = sum + a[i];\n  sum = sum + day;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i, y, m, d, s;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 > 0)) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n\n  a[1] = 31;\n  a[3] = 31;\n  a[5] = 31;\n  a[7] = 31;\n  a[8] = 31;\n  a[10] = 31;\n  a[12] = 31;\n  a[4] = 30;\n  a[6] = 30;\n  a[9] = 30;\n  a[11] = 30;\n  s = 0;\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n  s = s + d;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n  } else {\n    if (b == 1)\n      d = c;\n    else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int i;\n  int a = 0;\n  int b = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int N1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int N2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (day < 1 || day > N2[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N2[i];\n      }\n      b = a - day;\n    }\n  } else {\n    if (day < 1 || day > N1[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N1[i];\n      }\n      b = a - day;\n    }\n  }\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  y = 0;\n  for (i = 0; i < b - 1; i++) {\n    y = y + A[i];\n  }\n  y = y + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1 || b == 2) {\n      cout << y;\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else {\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, d = 0;\n  cin >> a >> b >> c;\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      d = d + 31;\n    else\n      d = d + 30;\n  }\n  if (i <= 2)\n    d = d;\n  else if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    d = d - 1;\n  else\n    d = d - 2;\n  d = d + c;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, a,\n      m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0)\n    a = 1;\n  else if (year % 100 == 0 && year % 400 == 0)\n    a = 1;\n  else\n    a = 0;\n  if (a == 1) {\n    m[1] = 29;\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  } else if (a == 0) {\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  }\n  printf(\"%d \", sum);\n}\n"}
{"label": "11", "index": "20192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int mun, day, year, i;\n  int days = 0;\n  cin >> year >> mun >> day;\n  days += day;\n  for (i = 1; i < mun; i++) {\n    days += a[i];\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      days += 1;\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n\n  printf(\"319\");\n  printf(\"\\n\");\n  printf(\"32\");\n  printf(\"\\n\");\n  printf(\"61\");\n  printf(\"\\n\");\n  printf(\"60\");\n  printf(\"\\n\");\n  printf(\"1\");\n  return 0;\n}\n"}
{"label": "11", "index": "20194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, sm = 0, k;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) != 0) {\n    int m[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sum = sum + m[k];\n    sum = sum + day;\n    printf(\"%d\", sum);\n  } else {\n    int n[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (k = 0; k < month; k++)\n      sm = sm + n[k];\n    sm = sm + day;\n    printf(\"%d\", sm);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int m = 0, n = 0;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (month == 1) {\n    n = date;\n  }\n  m = m + 31;\n  if (month == 2) {\n    n = m + date;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    m = m + 29;\n  } else {\n    m = m + 28;\n  }\n\n  if (month == 3) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 4) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 5) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 6) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 7) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 8) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 9) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 10) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 11) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 12) {\n    n = m + date;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f1(int n) {\n  int i, m;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 28;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint f2(int n) {\n  int m, i;\n  for (i = 1, m = 0; i < n; i++) {\n    if (i == 1)\n      m = m + 31;\n    if (i == 2)\n      m = m + 29;\n    if (i == 3)\n      m = m + 31;\n    if (i == 4)\n      m = m + 30;\n    if (i == 5)\n      m = m + 31;\n    if (i == 6)\n      m = m + 30;\n    if (i == 7)\n      m = m + 31;\n    if (i == 8)\n      m = m + 31;\n    if (i == 9)\n      m = m + 30;\n    if (i == 10)\n      m = m + 31;\n    if (i == 11)\n      m = m + 30;\n    if (i == 12)\n      m = m + 31;\n  }\n  return m;\n}\nint main() {\n  int y, mon, d, a;\n  scanf(\"%d%d%d\", &y, &mon, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    a = f1(mon) + d;\n    printf(\"%d\", a);\n  } else {\n    a = f2(mon) + d;\n    printf(\"%d\", a);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 0; i < b - 1;) {\n    y = y + A[i];\n    i++;\n  }\n  y = y + c;\n  if (a % 4 == 0 & a % 100 != 0 || a % 400 == 0) {\n    if (b <= 2) {\n      cout << y;\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else\n    cout << y;\n  return 0;\n}\n"}
{"label": "11", "index": "20198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, d;\n  scanf(\"%d%d%d\\n\", &n, &x, &y);\n  d = 0;\n  if ((x > 2) && (n % 400 == 0))\n    d = 1;\n  if ((x > 2) && (n % 100 != 0) && (n % 4 == 0))\n    d = 1;\n  d = d + y;\n  x--;\n  switch (x) {\n  case 11:\n    d = d + 30;\n  case 10:\n    d = d + 31;\n  case 9:\n    d = d + 30;\n  case 8:\n    d = d + 31;\n  case 7:\n    d = d + 31;\n  case 6:\n    d = d + 30;\n  case 5:\n    d = d + 31;\n  case 4:\n    d = d + 30;\n  case 3:\n    d = d + 31;\n  case 2:\n    d = d + 28;\n  case 1:\n    d = d + 31;\n  }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Year, Month, Date;\n  int month;\n  int i;\n  int sum1 = 0, sum2 = 0;\n  scanf(\"%d %d %d\", &Year, &Month, &Date);\n  month = Month - 1;\n  if (Year % 4 == 0 && Year % 400 == 0) {\n    int mday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  } else {\n    int mday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  }\n  sum2 = sum1 + Date;\n  printf(\"\\n%d\", sum2);\n  return 0;\n}\n"}
{"label": "11", "index": "20200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, a, s;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0)) {\n    a = 29;\n  } else\n    a = 28;\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = 31 + d;\n  } else if (m == 3) {\n    s = 31 + a + d;\n  } else if (m == 4) {\n    s = 31 * 2 + a + d;\n  } else if (m == 5) {\n    s = 31 * 2 + a + 30 + d;\n  } else if (m == 6) {\n    s = 31 * 3 + a + d + 30;\n  } else if (m == 7) {\n    s = 31 * 3 + a + d + 30 * 2;\n  } else if (m == 8) {\n    s = 31 * 4 + a + d + 30 * 2;\n  } else if (m == 9) {\n    s = 31 * 5 + a + d + 30 * 2;\n  } else if (m == 10) {\n    s = 31 * 5 + a + d + 30 * 3;\n  } else if (m == 11) {\n    s = 31 * 6 + a + d + 30 * 3;\n  } else if (m == 12) {\n    s = 31 * 6 + a + d + 30 * 4;\n  } else\n    ;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, l, m, n;\n  scanf(\"%d\\n%d\\n%d\", &k, &l, &m);\n  if (k % 4 == 0) {\n    if (k % 100 == 0) {\n      if (k % 400 == 0) {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 29);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 29 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 29 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 29 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      } else {\n        if ((l > 0) && (l < 2)) {\n          n = m;\n          printf(\"%d\", n);\n        } else if ((l > 1) && (l < 3)) {\n          n = (m + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 2) && (l < 4)) {\n          n = (m + 31 + 28);\n          printf(\"%d\\n\", n);\n        } else if ((l > 3) && (l < 5)) {\n          n = (m + 31 + 28 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 4) && (l < 6)) {\n          n = (m + 31 + 28 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 5) && (l < 7)) {\n          n = (m + 31 + 28 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 6) && (l < 8)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 7) && (l < 9)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 8) && (l < 10)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 9) && (l < 11)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n          printf(\"%d\\n\", n);\n        } else if ((l > 10) && (l < 12)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n          printf(\"%d\\n\", n);\n        } else if ((l > 11) && (l < 13)) {\n          n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n          printf(\"%d\\n\", n);\n        }\n      }\n    } else {\n      if ((l > 0) && (l < 2)) {\n        n = m;\n        printf(\"%d\", n);\n      } else if ((l > 1) && (l < 3)) {\n        n = (m + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 2) && (l < 4)) {\n        n = (m + 31 + 29);\n        printf(\"%d\\n\", n);\n      } else if ((l > 3) && (l < 5)) {\n        n = (m + 31 + 29 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 4) && (l < 6)) {\n        n = (m + 31 + 29 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 5) && (l < 7)) {\n        n = (m + 31 + 29 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 6) && (l < 8)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 7) && (l < 9)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n        cout << n << \"\\n\";\n      } else if ((l > 8) && (l < 10)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 9) && (l < 11)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n        printf(\"%d\\n\", n);\n      } else if ((l > 10) && (l < 12)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n        printf(\"%d\\n\", n);\n      } else if ((l > 11) && (l < 13)) {\n        n = (m + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n        printf(\"%d\\n\", n);\n      }\n    }\n  } else {\n    if ((l > 0) && (l < 2)) {\n      n = m;\n      printf(\"%d\", n);\n    } else if ((l > 1) && (l < 3)) {\n      n = (m + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 2) && (l < 4)) {\n      n = (m + 31 + 28);\n      printf(\"%d\\n\", n);\n    } else if ((l > 3) && (l < 5)) {\n      n = (m + 31 + 28 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 4) && (l < 6)) {\n      n = (m + 31 + 28 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 5) && (l < 7)) {\n      n = (m + 31 + 28 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 6) && (l < 8)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 7) && (l < 9)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 8) && (l < 10)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 9) && (l < 11)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n      printf(\"%d\\n\", n);\n    } else if ((l > 10) && (l < 12)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n      printf(\"%d\\n\", n);\n    } else if ((l > 11) && (l < 13)) {\n      n = (m + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[11];\n  int y, m, d, i, leap, total = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n  if (leap)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  for (i = 0; i < m - 1; i++)\n    total += a[i];\n  total += d;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint run(int x) {\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    return 1;\n  return 0;\n}\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (run(y)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 60 + d;\n      break;\n    case 4:\n      x = 91 + d;\n      break;\n    case 5:\n      x = 121 + d;\n      break;\n    case 6:\n      x = 152 + d;\n      break;\n    case 7:\n      x = 182 + d;\n      break;\n    case 8:\n      x = 213 + d;\n      break;\n    case 9:\n      x = 244 + d;\n      break;\n    case 10:\n      x = 274 + d;\n      break;\n    case 11:\n      x = 305 + d;\n      break;\n    case 12:\n      x = 335 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 59 + d;\n      break;\n    case 4:\n      x = 90 + d;\n      break;\n    case 5:\n      x = 120 + d;\n      break;\n    case 6:\n      x = 151 + d;\n      break;\n    case 7:\n      x = 181 + d;\n      break;\n    case 8:\n      x = 212 + d;\n      break;\n    case 9:\n      x = 243 + d;\n      break;\n    case 10:\n      x = 273 + d;\n      break;\n    case 11:\n      x = 304 + d;\n      break;\n    case 12:\n      x = 334 + d;\n      break;\n    }\n  }\n  printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, d = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      d = d + 31;\n    else\n      d = d + 30;\n  }\n  if (i <= 2)\n    d = d;\n  else if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    d = d - 1;\n  else\n    d = d - 2;\n  d = d + c;\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20205", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, date;\n  cin >> year >> month >> date;\n  int total = 0;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    day_of_month[2] = 29;\n\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  } else {\n    day_of_month[2] = 28;\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  }\n  printf(\"%d\\n\", total);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, s = 0;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    for (i = 0; i < m - 1; i++)\n      s += m2[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      s += m1[i];\n  cout << s + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int x) {\n  int z;\n  if (((x % 4 == 0) && (x % 100 != 0)) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  int z, i = 0, sum = 0;\n\n  scanf(\"%d %d %d\", &year, &month, &day);\n  z = f(year);\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  if (b == 1)\n    n = c;\n  else if (b == 2)\n    n = c + 31;\n  else if (b == 3)\n    n = 31 + d + c;\n  else if (b == 4)\n    n = 62 + d + c;\n  else if (b == 5)\n    n = 92 + d + c;\n  else if (b == 6)\n    n = 123 + d + c;\n  else if (b == 7)\n    n = 153 + d + c;\n  else if (b == 8)\n    n = 184 + d + c;\n  else if (b == 9)\n    n = 215 + c + d;\n  else if (b == 10)\n    n = 245 + c + d;\n  else if (b == 11)\n    n = 276 + c + d;\n  else if (b == 12)\n    n = 306 + c + d;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n\n\n\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n\n  \n  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear(year) && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0; \n  int i;\n  \n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n  \n  n += day;\n  \n  if (isleapyear(year) && month > 2)\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int n) {\n  int sum;\n  switch (n) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = (31 + 28);\n    break;\n  case 4:\n    sum = (31 + 28 + 31);\n    break;\n  case 5:\n    sum = (31 * 2 + 28 + 30);\n    break;\n  case 6:\n    sum = (31 * 3 + 28 + 30);\n    break;\n  case 7:\n    sum = (31 * 3 + 28 + 30 * 2);\n    break;\n  case 8:\n    sum = (31 * 4 + 28 + 30 * 2);\n    break;\n  case 9:\n    sum = (31 * 5 + 28 + 30 * 2);\n    break;\n  case 10:\n    sum = (31 * 5 + 28 + 30 * 3);\n    break;\n  case 11:\n    sum = (31 * 6 + 28 + 30 * 3);\n    break;\n  case 12:\n    sum = (31 * 6 + 28 + 30 * 4);\n  }\n  return (sum);\n}\nint main() {\n  int month[5], day[5], year[5], d[5], i;\n  for (i = 0; i <= 4; i++)\n    cin >> year[i] >> month[i] >> day[i];\n  for (i = 0; i <= 4; i++) {\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0) &&\n        month[i] > 2)\n      d[i] = f(month[i]) + day[i] + 1;\n    else\n      d[i] = f(month[i]) + day[i];\n    printf(\"%d\\n\", d[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int d = c + 31;\n  int e = c + 60;\n  int f = c + 91;\n  int g = c + 121;\n  int h = c + 152;\n  int i = c + 182;\n  int j = c + 213;\n  int k = c + 244;\n  int l = c + 274;\n  int m = c + 305;\n  int n = c + 335;\n  int o = c + 59;\n  int p = c + 90;\n  int q = c + 120;\n  int r = c + 151;\n  int s = c + 181;\n  int t = c + 212;\n  int u = c + 243;\n  int v = c + 273;\n  int w = c + 304;\n  int x = c + 334;\n  if (b == 1)\n    printf(\"%d\\n\", c);\n  else if (b == 2)\n    printf(\"%d\\n\", d);\n  if (b > 2 && ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", e);\n    else if (b == 4)\n      printf(\"%d\\n\", f);\n    else if (b == 5)\n      printf(\"%d\\n\", g);\n    else if (b == 6)\n      printf(\"%d\\n\", h);\n    else if (b == 7)\n      printf(\"%d\\n\", i);\n    else if (b == 8)\n      printf(\"%d\\n\", j);\n    else if (b == 9)\n      printf(\"%d\\n\", k);\n    else if (b == 10) {\n      printf(\"%d\\n\", l);\n    } else if (b == 11)\n      printf(\"%d\\n\", m);\n    else if (b == 12)\n      printf(\"%d\\n\", n);\n  } else if (b > 2 && ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0))) {\n    if (b == 3)\n      printf(\"%d\\n\", o);\n    else if (b == 4)\n      printf(\"%d\\n\", p);\n    else if (b == 5)\n      printf(\"%d\\n\", q);\n    else if (b == 6)\n      printf(\"%d\\n\", r);\n    else if (b == 7)\n      printf(\"%d\\n\", s);\n    else if (b == 8)\n      printf(\"%d\\n\", t);\n    else if (b == 9)\n      printf(\"%d\\n\", u);\n    else if (b == 10)\n      printf(\"%d\\n\", v);\n    else if (b == 11)\n      printf(\"%d\\n\", w);\n    else if (b == 12)\n      printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n[13], i, sum = 0;\n  n[1] = n[3] = n[5] = n[7] = n[8] = n[10] = n[12] = 31;\n  n[0] = n[2] = 0;\n  n[4] = n[6] = n[9] = n[11] = 30;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0)) {\n    n[2] = 29;\n  } else\n    n[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + n[i];\n  sum = sum + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[1] = 29;\n  if (m == 1)\n    cout << d;\n  else {\n    for (int i = 0; i < m - 1; i++) {\n      t = t + a[i];\n    }\n    printf(\"%d\", t + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  int z;\n  if ((x % 4 == 0) && (x % 100 != 0) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int z, i, sum = 0;\n  z = f(year);\n  int a[12];\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (z == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + day;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20215", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int j;\n\n  for (j = 0; j < 5; j++) {\n    int n = 0;\n    int i;\n    scanf(\"%d %d %d\", &year, &month, &day);\n\n    if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (isleapyear(year) && month != 2 && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (!isleapyear(year) && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n\n    for (i = 1; i < month; i++) {\n      n += days[i];\n    }\n\n    n += day;\n\n    if (month > 2 && isleapyear(year)) {\n      n++;\n    }\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0, a[12], i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  for (i = 0; i < m - 1; i++) {\n    s = s + a[i];\n  }\n  s = s + d;\n  printf(\"%d\", s);\n}\n"}
{"label": "11", "index": "20217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  } else if (n % 400 == 0) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, x;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1) {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 60;\n    }\n    if (month == 4) {\n      x = day + 91;\n    }\n    if (month == 5) {\n      x = day + 121;\n    }\n    if (month == 6) {\n      x = day + 152;\n    }\n    if (month == 7) {\n      x = day + 182;\n    }\n    if (month == 8) {\n      x = day + 213;\n    }\n    if (month == 9)\n      x = day + 244;\n\n    if (month == 10) {\n      x = day + 274;\n    }\n    if (month == 11) {\n      x = day + 305;\n    }\n    if (month == 12) {\n      x = day + 335;\n    }\n  } else {\n    if (month == 1) {\n      x = day;\n    }\n    if (month == 2) {\n      x = day + 31;\n    }\n    if (month == 3) {\n      x = day + 59;\n    }\n    if (month == 4) {\n      x = day + 90;\n    }\n    if (month == 5) {\n      x = day + 120;\n    }\n    if (month == 6) {\n      x = day + 151;\n    }\n    if (month == 7) {\n      x = day + 181;\n    }\n    if (month == 8) {\n      x = day + 212;\n    }\n    if (month == 9) {\n      x = day + 243;\n    }\n    if (month == 10) {\n      x = day + 273;\n    }\n    if (month == 11) {\n      x = day + 304;\n    }\n    if (month == 12) {\n      x = day + 334;\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int m[11] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0)\n    m[1] = 29;\n  else\n    m[1] = 28;\n  if (b == 1)\n    n = c;\n  else {\n    for (i = 0; i < b - 1; i++)\n      n = n + m[i];\n    n = n + c;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint judge(int);\nint main() {\n  int year, month, day, i, j, total = 0;\n  cin >> year >> month >> day;\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      total = total + 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      total = total + 30;\n    else if (judge(year) == 0 && i == 2)\n      total = total + 28;\n    else if (judge(year) == 1 && i == 2)\n      total = total + 29;\n  }\n  total = total + day;\n  cout << total << endl;\n  return 0;\n}\nint judge(int x) {\n  int y = 0;\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0)\n    y = 1;\n  else\n    y = 0;\n  return y;\n}\n"}
{"label": "11", "index": "20220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, sum;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if (b == 2) {\n    sum = 31 + c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0) {\n    if (b == 3) {\n      sum = 60 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 91 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 121 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 152 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 182 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 213 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 244 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 274 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 305 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 335 + c;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 3) {\n      sum = 59 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 90 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 120 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 151 + c;\n      cout << sum;\n    }\n    if (b == 7) {\n      sum = 181 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 212 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 243 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 273 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 304 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 334 + c;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20221", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, sum = 0;\n  int DaysOfMonth[2][13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                            0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int flag;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 != 0 || (year % 4 == 0 && year % 100 == 0 && year % 400 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  if (month == 1)\n    cout << day << endl;\n  else {\n    for (i = 1; i < month; i++) {\n      sum += DaysOfMonth[flag][i];\n    }\n    sum += day;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day, i, x;\n  x = 0;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  for (i = 1; i < mon; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      x = x + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      x = x + 30;\n\n    if (i == 2) {\n      if (year % 400 == 0) {\n        x = x + 29;\n      } else if (year % 4 == 0 && year % 100 != 0) {\n        x = x + 29;\n      } else {\n        x = x + 28;\n      }\n    }\n  }\n  x = x + day;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "20223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, February, day;\n  cin >> year >> month >> date;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    February = 29;\n  else\n    February = 28;\n  if (month == 1)\n    day = date;\n  if (month == 2)\n    day = 31 + date;\n  if (month == 3)\n    day = 31 + February + date;\n  if (month == 4)\n    day = 31 + February + 31 + date;\n  if (month == 5)\n    day = 31 + February + 31 + 30 + date;\n  if (month == 6)\n    day = 31 + February + 31 + 30 + 31 + date;\n  if (month == 7)\n    day = 31 + February + 31 + 30 + 31 + 30 + date;\n  if (month == 8)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + date;\n  if (month == 9)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + date;\n  if (month == 10)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n  if (month == 11)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n  if (month == 12)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (((year % 400) == 0) || (((year % 4) == 0) && ((year % 100) != 0))) {\n    int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  } else {\n    int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      sum = sum + days[i];\n  }\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20225", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, D;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  D = 0;\n  cin >> y >> m >> d;\n  if (((y % 4 == 0) && (y % 100 != 0)) || ((y % 400) == 0)) {\n    for (i = 0; i < m - 1; i++)\n      D = D + p[i];\n\n    D = D + d + 1;\n    printf(\"%d\", D);\n  } else {\n    for (i = 0; i < m - 1; i++) {\n      D = D + p[i];\n    }\n    D = D + d;\n    printf(\"%d\", D);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int i;\n  int a = 0;\n  int b = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int N1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int N2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (day < 1 || day > N2[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N2[i];\n      }\n      b = a - day;\n    }\n  } else {\n    if (day < 1 || day > N1[month]) {\n      printf(\"wrong\\n\");\n      return -1;\n    } else {\n      for (i = 1; i <= month; i++) {\n        a += N1[i];\n      }\n      b = a - day;\n    }\n  }\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "20227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, answer;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 29 + day;\n      break;\n    case 4:\n      answer = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    printf(\"%d\\n\", answer);\n  } else {\n    switch (month) {\n    case 1:\n      answer = day;\n      break;\n    case 2:\n      answer = 31 + day;\n      break;\n    case 3:\n      answer = 31 + 28 + day;\n      break;\n    case 4:\n      answer = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      answer = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      answer = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 10:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      answer = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n    cout << answer << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year;\n  int month;\n  int day;\n  int data1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int data2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int in = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 || year % 100 == 0 && year % 400 == 0) {\n    int i = month - 1;\n    for (; i >= 0; i--) {\n      in += data2[i];\n    }\n    in += day;\n  } else {\n    int i = month - 1;\n    for (; i >= 0; i--)\n      in += data1[i];\n\n    in += day;\n  }\n  cout << in << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20229", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1, day;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month1, &day);\n  int i;\n  int sum = 0;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    month[2] = month[2] + 1;\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  } else {\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  }\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint leapyear(int year) {\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n    return 1;\n  else\n    return 0;\n}\nint whichday(int year, int month, int day) {\n  int mon[1000] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int d = 0, i;\n  if (leapyear(year) == 1)\n    mon[1]++;\n  for (i = 0; i < month - 1; i++)\n    d += mon[i];\n  d += day;\n  return d;\n}\nint main() {\n  int year, month, day;\n  int d;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  d = whichday(year, month, day);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[5], c[5], k[5];\n  long a[5];\n  int j;\n  for (j = 1; j <= 5; j++) {\n    scanf(\"%ld %d %d\", &a[j - 1], &b[j - 1], &c[j - 1]);\n  }\n  for (j = 1; j <= 5; j++) {\n    int i, l, x;\n    if (a[j - 1] % 4 != 0)\n      l = 28;\n    else {\n      if ((a[j - 1] % 100 == 0) && (a[j - 1] % 400 != 0))\n        l = 28;\n      else\n        l = 29;\n    }\n    x = 0;\n    for (i = 1; i <= b[j - 1] - 1; i++) {\n      switch (i) {\n      case 1:\n        x = x + 31;\n        break;\n      case 2:\n        x = x + l;\n        break;\n      case 3:\n        x = x + 31;\n        break;\n      case 4:\n        x = x + 30;\n        break;\n      case 5:\n        x = x + 31;\n        break;\n      case 6:\n        x = x + 30;\n        break;\n      case 7:\n        x = x + 31;\n        break;\n      case 8:\n        x = x + 31;\n        break;\n      case 9:\n        x = x + 30;\n        break;\n      case 10:\n        x = x + 31;\n        break;\n      case 11:\n        x = x + 30;\n        break;\n      case 12:\n        x = x + 31;\n        break;\n      }\n    }\n    x = x + c[j - 1];\n    int m;\n    m = j - 1;\n    k[m] = x;\n    printf(\"%d\\n\", k[m]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int nian, yue, ri, tian, i = 1;\n  for (; i <= 5; i = i + 1) {\n    scanf(\"%d %d %d\\n\", &nian, &yue, &ri);\n    if (nian % 4 == 0 && nian % 100 != 0 ||\n        nian % 100 == 0 && nian % 400 == 0) {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 60;\n        break;\n      case 4:\n        tian = 91;\n        break;\n      case 5:\n        tian = 121;\n        break;\n      case 6:\n        tian = 152;\n        break;\n      case 7:\n        tian = 182;\n        break;\n      case 8:\n        tian = 213;\n        break;\n      case 9:\n        tian = 244;\n        break;\n      case 10:\n        tian = 274;\n        break;\n      case 11:\n        tian = 305;\n        break;\n      case 12:\n        tian = 335;\n        break;\n      }\n    } else {\n      switch (yue) {\n      case 1:\n        tian = 0;\n        break;\n      case 2:\n        tian = 31;\n        break;\n      case 3:\n        tian = 59;\n        break;\n      case 4:\n        tian = 90;\n        break;\n      case 5:\n        tian = 120;\n        break;\n      case 6:\n        tian = 151;\n        break;\n      case 7:\n        tian = 181;\n        break;\n      case 8:\n        tian = 212;\n        break;\n      case 9:\n        tian = 243;\n        break;\n      case 10:\n        tian = 273;\n        break;\n      case 11:\n        tian = 304;\n        break;\n      case 12:\n        tian = 334;\n        break;\n      }\n    }\n    tian = tian + ri;\n    cout << tian << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, sum = 0;\n  cin >> a >> b >> c;\n  if (b == 1)\n    sum = 0;\n  else if (b == 2)\n    sum = 31;\n  else {\n    sum = 31;\n    if ((a % 400 == 0) || (a % 4 == 0 && a % 100 != 0))\n      sum = sum + 29;\n    else\n      sum = sum + 28;\n    for (i = 3; i < b; i++) {\n      if (i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        sum = sum + 31;\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        sum = sum + 30;\n    }\n  }\n  sum = sum + c;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    a[2] = 29;\n  } else {\n    a[2] = 28;\n  }\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  int n, i;\n  n = 0;\n  for (i = 1; i < m; i++) {\n    n = n + a[i];\n  }\n  n = n + d;\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20235", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 59 + c;\n    else if (b < 5)\n      n = 90 + c;\n    else if (b < 6)\n      n = 120 + c;\n    else if (b < 7)\n      n = 151 + c;\n    else if (b < 8)\n      n = 181 + c;\n    else if (b < 9)\n      n = 212 + c;\n    else if (b < 10)\n      n = 243 + c;\n    else if (b < 11)\n      n = 273 + c;\n    else if (b < 12)\n      n = 304 + c;\n    else\n      n = 334 + c;\n  } else {\n    if (b < 2)\n      n = c;\n    else if (b < 3)\n      n = 31 + c;\n    else if (b < 4)\n      n = 60 + c;\n    else if (b < 5)\n      n = 91 + c;\n    else if (b < 6)\n      n = 121 + c;\n    else if (b < 7)\n      n = 152 + c;\n    else if (b < 8)\n      n = 182 + c;\n    else if (b < 9)\n      n = 213 + c;\n    else if (b < 10)\n      n = 244 + c;\n    else if (b < 11)\n      n = 274 + c;\n    else if (b < 12)\n      n = 305 + c;\n    else\n      n = 335 + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (b >= 2)\n    d = d + 31;\n  if (b >= 3)\n    d = d + 28;\n  if (b >= 4)\n    d = d + 31;\n  if (b >= 5)\n    d = d + 30;\n  if (b >= 6)\n    d = d + 31;\n  if (b >= 7)\n    d = d + 30;\n  if (b >= 8)\n    d = d + 31;\n  if (b >= 9)\n    d = d + 31;\n  if (b >= 10)\n    d = d + 30;\n  if (b >= 11)\n    d = d + 31;\n  if (b >= 12)\n    d = d + 31;\n  d = d + c;\n  if (((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) && b > 2)\n    d = d + 1;\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int a) {\n  int z;\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int i, m;\n  int n[5][3];\n  int total[5];\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d %d %d\", &n[i][0], &n[i][1], &n[i][2]);\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i <= 4; i++) {\n    month[1] = 28 + leap(n[i][0]);\n    total[i] = 0;\n    for (m = 0; m <= n[i][1] - 2; m++)\n      total[i] = total[i] + month[m];\n    total[i] = total[i] + n[i][2];\n    printf(\"%d\\n\", total[i]);\n  }\n}\n"}
{"label": "11", "index": "20238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n\n  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear(year) && (day < 1 || day > days[month])) {\n    cout << \"Illegal input.\\n\";\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n\n  n += day;\n\n  if (isleapyear(year) && month > 2)\n    n++;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, r, b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int c[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0,\n      q;\n  cin >> n >> y >> r;\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + b[i];\n    sum = sum + r;\n    cout << sum;\n  } else {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + c[i];\n    sum = sum + r;\n    printf(\"%d\", sum);\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "11", "index": "20240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, dd = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 29;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  } else {\n    for (i = 1; i < m; i++) {\n      switch (i) {\n      case 1:\n      case 3:\n      case 5:\n      case 7:\n      case 8:\n      case 10:\n        dd += 31;\n        break;\n      case 2:\n        dd += 28;\n        break;\n      case 4:\n      case 6:\n      case 9:\n      case 11:\n        dd += 30;\n        break;\n      }\n    }\n    dd = dd + d;\n    printf(\"%d\", dd);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint check(int year) {\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    return 1;\n  } else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day, date = 0;\n  cin >> year;\n  scanf(\"%d \", &month);\n  cin >> day;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int i;\n  for (i = 1; i < month; i++) {\n    date = date + m[i];\n    if (i == 2) {\n      date = date + check(year);\n    }\n  }\n  date = date + day;\n\n  cout << date << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, a;\n  scanf(\"%d%d%d\", &year, &mon, &day);\n  if (mon == 1)\n    a = day;\n  else if (mon == 2)\n    a = 31 + day;\n  else if (mon == 3)\n    a = 59 + day;\n  else if (mon == 4)\n    a = 90 + day;\n  else if (mon == 5)\n    a = 120 + day;\n  else if (mon == 6)\n    a = 151 + day;\n  else if (mon == 7)\n    a = 181 + day;\n  else if (mon == 8)\n    a = 212 + day;\n  else if (mon == 9)\n    a = 243 + day;\n  else if (mon == 10)\n    a = 273 + day;\n  else if (mon == 11)\n    a = 304 + day;\n  else\n    a = 334 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (mon >= 3)\n      a = a + 1;\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20243", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && a == 0) {\n    sum = sum + 1;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20244", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x;\n\n  cin >> a >> b >> c;\n\n  d = 31 + c;\n  e = 59 + c;\n  f = 90 + c;\n  g = 120 + c;\n  h = 151 + c;\n  i = 181 + c;\n  j = 212 + c;\n  k = 243 + c;\n  l = 273 + c;\n  m = 304 + c;\n  n = 334 + c;\n  o = 60 + c;\n  p = 91 + c;\n  q = 121 + c;\n  r = 152 + c;\n  s = 182 + c;\n  t = 213 + c;\n  u = 244 + c;\n  v = 274 + c;\n  w = 305 + c;\n  x = 335 + c;\n\n  if (b == 1)\n    printf(\"%d\", c);\n  if (b == 2)\n    printf(\"%d\", d);\n  if ((b == 3) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", e);\n  if ((b == 4) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", f);\n  if ((b == 5) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", g);\n  if ((b == 6) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", h);\n  if ((b == 7) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    cout << i;\n  if ((b == 8) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", j);\n  if ((b == 9) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", k);\n  if ((b == 10) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", l);\n  if ((b == 11) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", m);\n  if ((b == 12) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", n);\n  if ((b == 3) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", o);\n  if ((b == 4) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", p);\n  if ((b == 5) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", q);\n  if ((b == 6) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", r);\n  if ((b == 7) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", s);\n  if ((b == 8) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", t);\n  if ((b == 9) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", u);\n  if ((b == 10) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", v);\n  if ((b == 11) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", w);\n  if ((b == 12) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    cout << x;\n  return 0;\n}\n"}
{"label": "11", "index": "20246", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, day, i, x;\n  cin >> a >> m >> day;\n  switch (m) {\n  case 1:\n    i = 0;\n    break;\n  case 2:\n    i = 31;\n    break;\n  case 3:\n    i = 31 + 28;\n    break;\n  case 4:\n    i = 31 + 28 + 31;\n    break;\n  case 5:\n    i = 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    i = 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    i = 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  default:\n    cout << \"error\" << endl;\n  }\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if ((m != 1) && (m != 2))\n      x = i + day + 1;\n    else\n      x = i + day;\n  } else\n    x = i + day;\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], total[5], i = 0;\n  for (; i <= 4; i++) {\n\n    cin >> year[i] >> month[i] >> day[i];\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      total[i] = day[i];\n      break;\n    case 2:\n      total[i] = 31 + day[i];\n      break;\n    case 3:\n      total[i] = 31 + 28 + day[i];\n      break;\n    case 4:\n      total[i] = 31 + 28 + 31 + day[i];\n      break;\n    case 5:\n      total[i] = 31 + 28 + 31 + 30 + day[i];\n      break;\n    case 6:\n      total[i] = 31 + 28 + 31 + 30 + 31 + day[i];\n      break;\n    case 7:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    case 8:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day[i];\n      break;\n    case 9:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day[i];\n      break;\n    case 10:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day[i];\n      break;\n    case 11:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day[i];\n      break;\n    case 12:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    }\n\n    if ((year[i] % 400 == 0 || year[i] % 4 == 0 && year[i] % 100 != 0) &&\n        month[i] > 2)\n      total[i] += 1;\n    printf(\"%d\\n\", total[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20248", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int y, m, d, days = 0;\n  cin >> y >> m >> d;\n  switch (m) {\n  case 1:\n    days = d;\n    break;\n  case 2:\n    days = 31 + d;\n    break;\n  case 3:\n    days = 31 + 28 + d;\n    break;\n  case 4:\n    days = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    days = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    days = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  printf(\"%d\\n\", days);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, x = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0) {\n    mon[1] = 29;\n  } else if (y % 400 == 0) {\n    mon[1] = 29;\n  } else\n    mon[1] = 28;\n\n  for (i = 0; i < m - 1; i++) {\n    x += mon[i];\n  }\n  x = x + d;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20250", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {0}, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0)\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 1; i < 12; i++) {\n    b[0] = a[0];\n    b[i] = b[i - 1] + a[i];\n  }\n  if (m == 1)\n    cout << d << endl;\n  else if (m != 1)\n    cout << b[m - 2] + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100) != 0 || (y % 400 == 0))\n    days[2]++;\n  c = d;\n  for (i = 1; i < m; i++)\n    c = c + days[i];\n  cout << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = day;\n    break;\n  case 2:\n    sum = 31 + day;\n    break;\n  case 3:\n    sum = 31 + 28 + day;\n    break;\n  case 4:\n    sum = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    sum = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    sum = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    sum = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + day;\n    break;\n  }\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n[13], i, sum = 0;\n  n[1] = n[3] = n[5] = n[7] = n[8] = n[10] = n[12] = 31;\n  n[0] = n[2] = 0;\n  n[4] = n[6] = n[9] = n[11] = 30;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0))\n    n[2] = 29;\n  else\n    n[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + n[i];\n  sum = sum + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int day, month, year, sum, leap;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    cout << \"data error \";\n    break;\n  }\n  sum = sum + day;\n  if (year % 400 == 0 || (year & 4 == 0 && year % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && month > 2)\n    sum = sum + 1;\n  printf(\"%d \", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + monthday[i - 1];\n\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && a == 0) {\n    sum = sum + 1;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int days = 0;\n  int i;\n  if (y % 4 == 0) {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  } else {\n    int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 1; i < m; i++) {\n      days = month[i] + days;\n    }\n    days = d + days;\n  }\n  cout << days << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20257", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  int leap = 0;\n  int day = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    leap = 1;\n  b--;\n  while (b) {\n    if (b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {\n      b--;\n      day += 31;\n    }\n    if (b == 2) {\n      b--;\n      day += 28 + leap;\n    }\n    if (b == 4 || b == 6 || b == 9 || b == 11) {\n      b--;\n      day += 30;\n    }\n  }\n  day += c;\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d[12] = {0};\n  int a, b, c, i, sum = 0;\n  int run(int x);\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10)) {\n      d[i] = 31;\n      sum += d[i];\n    } else if ((i == 4) || (i == 6) || (i == 9) || (i == 11)) {\n      d[i] = 30;\n      sum += d[i];\n    } else {\n      if (run(a) == 1)\n        d[i] = 29;\n      else {\n        d[i] = 28;\n      }\n      sum += d[i];\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n}\nint run(int x) {\n  int z;\n  if ((x % 400 == 0) || ((x % 100 != 0) && (x % 4 == 0)))\n    z = 1;\n  return z;\n}\n"}
{"label": "11", "index": "20259", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, b;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = a[2] + 1;\n  b = d;\n  for (i = 1; i < m; i++) {\n    b = a[i] + b;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "20260", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  int a[13];\n  a[0] = 0;\n  int sum = 0;\n  cin >> y >> m >> d;\n  a[1] = a[3] = a[5] = a[7] = a[8] = a[10] = a[12] = 31;\n  a[4] = a[6] = a[9] = a[11] = 30;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + a[i];\n  sum = sum + d;\n  printf(\"%d\", sum);\n  getchar();\n}\n"}
{"label": "11", "index": "20261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 60);\n    else if (b == 4)\n      printf(\"%d\", c + 91);\n    else if (b == 5)\n      printf(\"%d\", c + 121);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 182);\n    else if (b == 8)\n      printf(\"%d\", c + 213);\n    else if (b == 9)\n      printf(\"%d\", c + 244);\n    else if (b == 10)\n      printf(\"%d\", c + 274);\n    else if (b == 11)\n      printf(\"%d\", c + 305);\n    else\n      printf(\"%d\", c + 335);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 59);\n    else if (b == 4)\n      printf(\"%d\", c + 90);\n    else if (b == 5)\n      printf(\"%d\", c + 120);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 181);\n    else if (b == 8)\n      printf(\"%d\", c + 212);\n    else if (b == 9)\n      cout << c + 243;\n    else if (b == 10)\n      printf(\"%d\", c + 273);\n    else if (b == 11)\n      printf(\"%d\", c + 304);\n    else\n      printf(\"%d\", c + 334);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, n, i;\n  cin >> year >> month >> day;\n  if (year % 100 == 0)\n    i = 400;\n  else\n    i = 4;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3) {\n    if (year % i == 0)\n      n = 31 + 29 + day;\n    else\n      n = 31 + 28 + day;\n  }\n  if (month == 4) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + day;\n    else\n      n = 31 + 28 + 31 + day;\n  }\n  if (month == 5) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + day;\n  }\n  if (month == 6) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + day;\n  }\n  if (month == 7) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n  }\n  if (month == 8) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  }\n  if (month == 9) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  }\n  if (month == 10) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  }\n  if (month == 11) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  }\n  if (month == 12) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20263", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, x = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (month == 2) {\n    x = 31 + day;\n    printf(\"%d\", x);\n  } else if (month == 1) {\n    x = day;\n    printf(\"%d\", x);\n  } else {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 3:\n        x = 31 + 29;\n        break;\n      case 4:\n        x = 31 + 29 + 31;\n        break;\n\n      case 5:\n        x = 31 + 29 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    } else {\n      switch (month) {\n      case 3:\n        x = 31 + 28;\n        break;\n      case 4:\n        x = 31 + 28 + 31;\n        break;\n\n      case 5:\n        x = 31 + 28 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 28 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    x = x + day;\n\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "11", "index": "20264", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if ((a % 4 == 0) && (a % 100 == 0) && (a % 400 == 0)) {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 29 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 29 + 31 + c);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  } else {\n    switch (b) {\n    case 2: {\n      printf(\"%d\", 31 + c);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", 31 + 28 + c);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", 31 + 28 + 31 + c);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + c);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c);\n      break;\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20265", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  int a[13];\n  a[0] = 0;\n  int sum = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  a[1] = a[3] = a[5] = a[7] = a[8] = a[10] = a[12] = 31;\n  a[4] = a[6] = a[9] = a[11] = 30;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + a[i];\n  sum = sum + d;\n  printf(\"%d\", sum);\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, i, y = 0, days, w;\n  cin >> year >> month >> days;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      day = 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      day = 30;\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        day = 29;\n      else\n        day = 28;\n    }\n    y = y + day;\n  }\n  w = y + days;\n  printf(\"%d\\n\", w);\n  return 0;\n}\n"}
{"label": "11", "index": "20267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  scanf(\"%d\\t%d\\t%d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    y = c;\n    break;\n  case 2:\n    y = 31 + c;\n    break;\n  case 3:\n    y = 59 + c;\n    break;\n  case 4:\n    y = 90 + c;\n    break;\n  case 5:\n    y = 120 + c;\n    break;\n  case 6:\n    y = 151 + c;\n    break;\n  case 7:\n    y = 181 + c;\n    break;\n  case 8:\n    y = 212 + c;\n    break;\n  case 9:\n    y = 243 + c;\n    break;\n  case 10:\n    y = 273 + c;\n    break;\n  case 11:\n    y = 304 + c;\n    break;\n  case 12:\n    y = 334 + c;\n  }\n  printf(\"\\n%d\", y);\n  return 0;\n}\n"}
{"label": "11", "index": "20268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int leap(int year);\n  int cal(int month, int day);\n  int call(int month, int day);\n  int k, year, month, day, num;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  k = leap(year);\n  if (k == 0)\n    num = cal(month, day);\n\n  if (k == 1) {\n    num = call(month, day);\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n\nint leap(int year) {\n  int k;\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        k = 1;\n      else\n        k = 0;\n    } else\n      k = 1;\n  } else\n    k = 0;\n  return k;\n}\nint cal(int month, int day) {\n  int k;\n  switch (month) {\n  case 1:\n    k = day;\n    break;\n  case 2:\n    k = day + 31;\n    break;\n  case 3:\n    k = day + 31 + 28;\n    break;\n  case 4:\n    k = day + 31 + 28 + 31;\n    break;\n  case 5:\n    k = day + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    k = day + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  return k;\n}\nint call(int month, int day) {\n  int k;\n  switch (month) {\n  case 1:\n    k = day;\n    break;\n  case 2:\n    k = day + 31;\n    break;\n  case 3:\n    k = day + 31 + 29;\n    break;\n  case 4:\n    k = day + 31 + 29 + 31;\n    break;\n  case 5:\n    k = day + 31 + 29 + 31 + 30;\n    break;\n  case 6:\n    k = day + 31 + 29 + 31 + 30 + 31;\n    break;\n  case 7:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  return k;\n}\n"}
{"label": "11", "index": "20269", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, D;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60;\n      break;\n    case 4:\n      D = c + 91;\n      break;\n    case 5:\n      D = c + 121;\n      break;\n    case 6:\n      D = c + 152;\n      break;\n    case 7:\n      D = c + 182;\n      break;\n    case 8:\n      D = c + 213;\n      break;\n    case 9:\n      D = c + 244;\n      break;\n    case 10:\n      D = c + 274;\n      break;\n    case 11:\n      D = c + 305;\n      break;\n    case 12:\n      D = c + 335;\n      break;\n    }\n    printf(\"%d\", D);\n\n  } else {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60 - 1;\n      break;\n    case 4:\n      D = c + 91 - 1;\n      break;\n    case 5:\n      D = c + 121 - 1;\n      break;\n    case 6:\n      D = c + 152 - 1;\n      break;\n    case 7:\n      D = c + 182 - 1;\n      break;\n    case 8:\n      D = c + 213 - 1;\n      break;\n    case 9:\n      D = c + 244 - 1;\n      break;\n    case 10:\n      D = c + 274 - 1;\n      break;\n    case 11:\n      D = c + 305 - 1;\n      break;\n    case 12:\n      D = c + 335 - 1;\n      break;\n    }\n\n    printf(\"%d\", D);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20270", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, days = 0, i = 1;\n  int month_str1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      month_str2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    while (i != month) {\n      days += month_str2[i - 1];\n      i++;\n    }\n  else\n    while (i != month) {\n      days += month_str1[i - 1];\n      i++;\n    }\n  cout << days + day;\n  return 0;\n}\n"}
{"label": "11", "index": "20271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, m, n, t, i, s;\n  scanf(\"%d%d%d\", &l, &m, &n);\n  if (l % 4 == 0 && l % 100 != 0)\n    t = 29;\n  if (l % 4 != 0)\n    t = 28;\n  if (l % 100 == 0 && l % 400 != 0)\n    t = 28;\n  if (l % 400 == 0)\n    t = 29;\n  int a[13] = {0, 31, t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (m == 1)\n    s = n;\n  else\n    s = n;\n  for (i = 1; i < m; i++) {\n    s = s + a[i];\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  if (x % 4 != 0)\n    return 0;\n  else if ((x % 100 == 0) && (x % 400 != 0))\n    return 0;\n  else\n    return 1;\n}\nint main() {\n  int y, m, d;\n  int j = 1;\n  int n = 0;\n  cin >> y >> m >> d;\n  int a[13];\n  a[1] = 31;\n  if (f(y) == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  for (j = 1; j < m; j++)\n    n = n + a[j];\n  n = n + d;\n  cout << n << \" \";\n  return 0;\n}\n"}
{"label": "11", "index": "20273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, a;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 60;\n    if (month == 4)\n      a = day + 91;\n    if (month == 5)\n      a = day + 121;\n    if (month == 6)\n      a = day + 152;\n    if (month == 7)\n      a = day + 182;\n    if (month == 8)\n      a = day + 213;\n    if (month == 9)\n      a = day + 244;\n    if (month == 10)\n      a = day + 274;\n    if (month == 11)\n      a = day + 305;\n    if (month == 12)\n      a = day + 335;\n  } else {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 59;\n    if (month == 4)\n      a = day + 90;\n    if (month == 5)\n      a = day + 120;\n    if (month == 6)\n      a = day + 151;\n    if (month == 7)\n      a = day + 181;\n    if (month == 8)\n      a = day + 212;\n    if (month == 9)\n      a = day + 243;\n    if (month == 10)\n      a = day + 273;\n    if (month == 11)\n      a = day + 304;\n    if (month == 12)\n      a = day + 334;\n  };\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20274", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i, y, m, d, s;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 > 0)) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n\n  a[1] = 31;\n  a[3] = 31;\n  a[5] = 31;\n  a[7] = 31;\n  a[8] = 31;\n  a[10] = 31;\n  a[12] = 31;\n  a[4] = 30;\n  a[6] = 30;\n  a[9] = 30;\n  a[11] = 30;\n  s = 0;\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n  s = s + d;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, k, m2;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    m2 = 29;\n  else\n    m2 = 28;\n  k = m2 + 31;\n  switch (month) {\n  case 1:\n    n = day;\n    break;\n  case 2:\n    n = day + 31;\n    break;\n  case 3:\n    n = k + day;\n    break;\n  case 4:\n    n = k + 31 + day;\n    break;\n  case 5:\n    n = 31 + k + 30 + day;\n    break;\n  case 6:\n    n = k + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    n = k + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    n = k + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20276", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 60);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 91);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 121);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 152);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 182);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 213);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 305);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 335);\n    }\n    }\n  } else {\n    switch (b) {\n    case 1: {\n      printf(\"%d\", c);\n      break;\n    }\n    case 2: {\n      printf(\"%d\", c + 31);\n      break;\n    }\n    case 3: {\n      printf(\"%d\", c + 59);\n      break;\n    }\n    case 4: {\n      printf(\"%d\", c + 90);\n      break;\n    }\n    case 5: {\n      printf(\"%d\", c + 120);\n      break;\n    }\n    case 6: {\n      printf(\"%d\", c + 151);\n      break;\n    }\n    case 7: {\n      printf(\"%d\", c + 181);\n      break;\n    }\n    case 8: {\n      printf(\"%d\", c + 212);\n      break;\n    }\n    case 9: {\n      printf(\"%d\", c + 243);\n      break;\n    }\n    case 10: {\n      printf(\"%d\", c + 273);\n      break;\n    }\n    case 11: {\n      printf(\"%d\", c + 304);\n      break;\n    }\n    case 12: {\n      printf(\"%d\", c + 334);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20277", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int k, m, d, i, n;\n  cin >> k >> m >> d;\n  if (k % 4 == 0)\n    if (k % 100 == 0)\n      if (k % 400 == 0)\n        i = 29;\n      else\n        i = 28;\n    else\n      i = 29;\n  else\n    i = 28;\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  if (m == 2) {\n    n = d + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 3) {\n    n = d + i + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 4) {\n    n = d + i + 31 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 5) {\n    n = d + i + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 6) {\n    n = d + i + 31 + 31 + 30 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 7) {\n    n = d + i + 31 + 31 + 31 + 60;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 8) {\n    n = d + i + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 9) {\n    n = d + i + 184 + 31;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 10) {\n    n = d + i + 31 + 30 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 11) {\n    n = d + i + 31 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  if (m == 12) {\n    n = d + i + 31 + 30 + 61 + 184;\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int month, date, n = 0, i, year, p;\n  cin >> year >> month >> date;\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))\n    p = 29;\n  else\n    p = 28;\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n      n += 31;\n      break;\n    case 2:\n      n += p;\n      break;\n    case 3:\n      n += 31;\n      break;\n    case 4:\n      n += 30;\n      break;\n    case 5:\n      n += 31;\n      break;\n    case 6:\n      n += 30;\n      break;\n    case 7:\n      n += 31;\n      break;\n    case 8:\n      n += 31;\n      break;\n    case 9:\n      n += 30;\n      break;\n    case 10:\n      n += 31;\n      break;\n    case 11:\n      n += 30;\n      break;\n    }\n  }\n  n += date;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, t;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  t = 0;\n  for (i = 1; i < m; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      t += 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      t += 30;\n      break;\n    default:\n      if (y % 400 == 0)\n        t += 29;\n      else if ((y % 100 != 0) && (y % 4 == 0))\n        t += 29;\n      else\n        t += 28;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "20280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, day, m;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 4 == 0 && a % 400 == 0) {\n    m = 29;\n  } else {\n    m = 28;\n  }\n  switch (b) {\n  case 1:\n    day = c;\n    break;\n  case 2:\n    day = 31 + c;\n    break;\n  case 3:\n    day = 31 + m + c;\n    break;\n  case 4:\n    day = 31 + m + 31 + c;\n    break;\n  case 5:\n    day = 31 + m + 31 + 30 + c;\n    break;\n  case 6:\n    day = 31 + m + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    day = 31 + m + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 31 + 30 + c;\n    break;\n  case 12:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 30 + 31 + c;\n    break;\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int year;\n  int month;\n  int day;\n} date;\nint main() {\n  int days;\n  cin >> date.year >> date.month >> date.day;\n  switch (date.month) {\n  case 1:\n    days = date.day;\n    break;\n  case 2:\n    days = date.day + 31;\n    break;\n  case 3:\n    days = date.day + 59;\n    break;\n  case 4:\n    days = date.day + 90;\n    break;\n  case 5:\n    days = date.day + 120;\n    break;\n  case 6:\n    days = date.day + 151;\n    break;\n  case 7:\n    days = date.day + 181;\n    break;\n  case 8:\n    days = date.day + 212;\n    break;\n  case 9:\n    days = date.day + 243;\n    break;\n  case 10:\n    days = date.day + 273;\n    break;\n  case 11:\n    days = date.day + 304;\n    break;\n  case 12:\n    days = date.day + 334;\n    break;\n  }\n  if ((date.year % 4 == 0 && date.year % 100 != 0 || date.year % 400 == 0) &&\n      date.month >= 3)\n    days += 1;\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 != 0) || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, a;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 60;\n    if (month == 4)\n      a = day + 91;\n    if (month == 5)\n      a = day + 121;\n    if (month == 6)\n      a = day + 152;\n    if (month == 7)\n      a = day + 182;\n    if (month == 8)\n      a = day + 213;\n    if (month == 9)\n      a = day + 244;\n    if (month == 10)\n      a = day + 274;\n    if (month == 11)\n      a = day + 305;\n    if (month == 12)\n      a = day + 335;\n  } else {\n    if (month == 1)\n      a = day;\n    if (month == 2)\n      a = day + 31;\n    if (month == 3)\n      a = day + 59;\n    if (month == 4)\n      a = day + 90;\n    if (month == 5)\n      a = day + 120;\n    if (month == 6)\n      a = day + 151;\n    if (month == 7)\n      a = day + 181;\n    if (month == 8)\n      a = day + 212;\n    if (month == 9)\n      a = day + 243;\n    if (month == 10)\n      a = day + 273;\n    if (month == 11)\n      a = day + 304;\n    if (month == 12)\n      a = day + 334;\n  };\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "11", "index": "20284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int DJT = 0;\n  int D[12];\n  D[0] = 31;\n  D[1] = 28;\n  D[2] = 31;\n  D[3] = 30;\n  D[4] = 31;\n  D[5] = 30;\n  D[6] = 31;\n  D[7] = 31;\n  D[8] = 30;\n  D[9] = 31;\n  D[10] = 30;\n  D[11] = 31;\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 400 == 0)\n    D[1] = D[1] + 1;\n  else if (year % 100 != 0 && year % 4 == 0)\n    D[1] = D[1] + 1;\n  else\n    D[1] = D[1];\n  for (int i = 0; i < month - 1; i++)\n    DJT = DJT + D[i];\n  DJT = DJT + day;\n  printf(\"%d\\n\", DJT);\n  return 0;\n}\n"}
{"label": "11", "index": "20285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k = 0;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + b[i];\n    }\n    k = k + d;\n    printf(\"%d\", k);\n  }\n  k = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++)\n      k = k + a[i];\n\n    k = k + d;\n    printf(\"%d\", k);\n  }\n}\n"}
{"label": "11", "index": "20286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  int i = 0;\n  int n[12];\n  sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n\n  if ((y % 4 == 0) && (y % 100 != 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 != 0)) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n  if ((y % 4 == 0) && (y % 100 == 0) && (y % 400 == 0)) {\n    n[0] = 31;\n    n[1] = 29;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++) {\n      sum += n[i];\n    }\n    sum += d;\n    printf(\"%d\\n\", sum);\n  }\n\n  if (y % 4 != 0) {\n    n[0] = 31;\n    n[1] = 28;\n    n[2] = 31;\n    n[3] = 30;\n    n[4] = 31;\n    n[5] = 30;\n    n[6] = 31;\n    n[7] = 31;\n    n[8] = 30;\n    n[9] = 31;\n    n[10] = 30;\n    n[11] = 31;\n    for (i = 0; i < m - 1; i++)\n      sum = sum + n[i];\n\n    sum = sum + d;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, D;\n  cin >> year >> month >> day;\n  if (month == 1) {\n    D = day;\n  }\n  if (month == 2) {\n    D = day + 31;\n  }\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 3) {\n      D = day + 31 + 29;\n    }\n    if (month == 4) {\n      D = day + 31 + 29 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 29 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 29 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11)\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n\n    if (month == 12) {\n      D = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  } else {\n    if (month == 3) {\n      D = day + 31 + 28;\n    }\n    if (month == 4) {\n      D = day + 31 + 28 + 31;\n    }\n    if (month == 5) {\n      D = day + 31 + 28 + 31 + 30;\n    }\n    if (month == 6) {\n      D = day + 31 + 28 + 31 + 30 + 31;\n    }\n    if (month == 7) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30;\n    }\n    if (month == 8) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    }\n    if (month == 9) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (month == 10) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (month == 11) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (month == 12) {\n      D = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n  }\n  cout << D << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, j;\n  cin >> y >> m >> d;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        j = 1;\n      else\n        j = 0;\n    } else\n      j = 1;\n\n  } else\n    j = 0;\n  if (j == 1) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\", d + 335);\n      break;\n    }\n  }\n\n  if (j == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      cout << d + 59;\n      break;\n    case 4:\n      printf(\"%d\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\", d + 334);\n      break;\n    }\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int year, month, day, x;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 29 + day;\n    else if (month == 4)\n      x = 31 + 29 + 31 + day;\n    else if (month == 5)\n      x = 31 + 29 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 29 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 29 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 29 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  } else {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 28 + day;\n    else if (month == 4)\n      x = 31 + 28 + 31 + day;\n    else if (month == 5)\n      x = 31 + 28 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 28 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 28 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 28 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20290", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, d;\n  int month = 1, day = 1, lunar = 0, days = 1;\n  scanf(\"%d %d %d \", &year, &mon, &d);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    lunar = 1;\n  while ((mon != month) || (d != day)) {\n    day++;\n    days++;\n    if ((day == 32) &&\n        ((month == 1) || (month == 3) || (month == 5) || (month == 7) ||\n         (month == 8) || (month == 10) || (month == 12))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 31) &&\n        ((month == 4) || (month == 6) || (month == 9) || (month == 11))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 30) && (month == 2) && (lunar == 1)) {\n      month++;\n      day = 1;\n    }\n    if ((day == 29) && (month == 2) && (lunar == 0)) {\n      month++;\n      day = 1;\n    }\n  }\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20291", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int f[22];\n  scanf(\"%d %d %d \", &y, &m, &d);\n  f[0] = 31 + d;\n  f[1] = 60 + d;\n  f[2] = 91 + d;\n  f[3] = 121 + d;\n  f[4] = 152 + d;\n  f[5] = 182 + d;\n  f[6] = 213 + d;\n  f[7] = 244 + d;\n  f[8] = 274 + d;\n  f[9] = 305 + d;\n  f[10] = 335 + d;\n  f[11] = 31 + d;\n  f[12] = 59 + d;\n  f[13] = 90 + d;\n  f[14] = 120 + d;\n  f[15] = 151 + d;\n  f[16] = 181 + d;\n  f[17] = 212 + d;\n  f[18] = 243 + d;\n  f[19] = 273 + d;\n  f[20] = 304 + d;\n  f[21] = 334 + d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[0]);\n      break;\n    case 3:\n      printf(\"%d\", f[1]);\n      break;\n    case 4:\n      printf(\"%d\", f[2]);\n      break;\n    case 5:\n      printf(\"%d\", f[3]);\n      break;\n    case 6:\n      printf(\"%d\", f[4]);\n      break;\n    case 7:\n      printf(\"%d\", f[5]);\n      break;\n    case 8:\n      printf(\"%d\", f[6]);\n      break;\n    case 9:\n      printf(\"%d\", f[7]);\n      break;\n    case 10:\n      printf(\"%d\", f[8]);\n      break;\n    case 11:\n      printf(\"%d\", f[9]);\n      break;\n    case 12:\n      printf(\"%d\", f[10]);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[11]);\n      break;\n    case 3:\n      printf(\"%d\", f[12]);\n      break;\n    case 4:\n      printf(\"%d\", f[13]);\n      break;\n    case 5:\n      printf(\"%d\", f[14]);\n      break;\n    case 6:\n      printf(\"%d\", f[15]);\n      break;\n    case 7:\n      printf(\"%d\", f[16]);\n      break;\n    case 8:\n      printf(\"%d\", f[17]);\n      break;\n    case 9:\n      printf(\"%d\", f[18]);\n      break;\n    case 10:\n      printf(\"%d\", f[19]);\n      break;\n    case 11:\n      printf(\"%d\", f[20]);\n      break;\n    case 12:\n      printf(\"%d\", f[21]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20292", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  int leap = 0;\n  int day = 0;\n  cin >> a >> b >> c;\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    leap = 1;\n  }\n  b--;\n  while (b) {\n    if (b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {\n      b--;\n      day += 31;\n    }\n    if (b == 2) {\n      b--;\n      day += 28 + leap;\n    }\n    if (b == 4 || b == 6 || b == 9 || b == 11) {\n      b--;\n      day += 30;\n    }\n  }\n  day += c;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, sum = 0;\n  int a[20];\n  a[0] = 0;\n  a[1] = 31;\n  a[2] = 59;\n  a[3] = 90;\n  a[4] = 120;\n  a[5] = 151;\n  a[6] = 181;\n  a[7] = 212;\n  a[8] = 243;\n  a[9] = 273;\n  a[10] = 304;\n  a[11] = 334;\n  a[12] = 365;\n  scanf(\"%d%d%d\", &b, &c, &d);\n  if ((b % 4 != 0) || (b % 100 == 0 && b % 400 != 0)) {\n    sum = a[c - 1] + d;\n  } else {\n    if (c < 3) {\n      sum = a[c - 1] + d;\n    } else {\n      sum = a[c - 1] + d + 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, D = 0, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  } else {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  }\n  printf(\"%d\", D);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  y = 0;\n  for (i = 0; i < b - 1; i++) {\n    y = y + A[i];\n  }\n  y = y + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1 || b == 2) {\n      cout << y;\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else {\n    cout << y;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int y) {\n  if ((y % 100 == 0) && (y % 400 == 0) || (y % 100 != 0) && (y % 4 == 0))\n    return 1;\n  else\n    return 0;\n}\n\nint days(int y, int d, int r) {\n  int a[13] = {0, 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (leap(y))\n    a[3] = 29;\n  int ans = 0;\n  for (int i = 1; i <= d; i++)\n    ans += a[i];\n  return ans + r;\n}\nint main() {\n  int y, d, r;\n  cin >> y >> d >> r;\n  cout << days(y, d, r);\n  return 0;\n}\n"}
{"label": "11", "index": "20297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int d = 0;\n  int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int y[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int i;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 100 == 0 && a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + y[i];\n    }\n    printf(\"%d\", d + c);\n  } else {\n    for (i = 1; i < b; i++) {\n      d = d + x[i];\n    }\n    cout << d + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    d = c;\n    break;\n  case 2:\n    d = 31 + c;\n    break;\n  case 3:\n    d = 29 + 31 + c;\n    break;\n  case 4:\n    d = 29 + 31 + 31 + c;\n    break;\n  case 5:\n    d = 29 + 31 + 31 + 30 + c;\n    break;\n  case 6:\n    d = 29 + 31 * 3 + 30 + c;\n    break;\n  case 7:\n    d = 29 + 31 * 3 + 60 + c;\n    break;\n  case 8:\n    d = 29 + 31 * 4 + 60 + c;\n    break;\n  case 9:\n    d = 29 + 31 * 5 + 60 + c;\n    break;\n  case 10:\n    d = 29 + 31 * 5 + 90 + c;\n    break;\n  case 11:\n    d = 29 + 31 * 6 + 90 + c;\n    break;\n  case 12:\n    d = 29 + 31 * 6 + 120 + c;\n    break;\n    printf(\"%d\", d);\n  }\n  if ((a % 4 != 0 || a % 100 == 0 && a % 400 != 0) && b > 2)\n    d = d - 1;\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum_day(int, int);\n  int leap(int year);\n  int year, month, day, days;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  days = sum_day(month, day);\n  if (leap(year) && month >= 3)\n    days = days + 1;\n  printf(\"%d\", days);\n}\nint sum_day(int month, int day) {\n  int day_tab[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 1; i < month; i++)\n    day += day_tab[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 3 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\n"}
{"label": "11", "index": "20300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, num = 0, i,\n                        a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) \n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < month - 1; i++) \n  {\n    num += a[i];\n  }\n  num += day; \n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20301", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if ((a % 100 != 0 && a / 4 == 0) || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 60 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 91 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 121 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 152 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 182 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 213 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 244 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 274 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 305 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 335 + c);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 59 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 90 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 120 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 151 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 181 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 212 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 243 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 273 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 304 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 334 + c);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d, n;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  if (b == 1)\n    n = c;\n  else if (b == 2)\n    n = c + 31;\n  else if (b == 3)\n    n = 31 + d + c;\n  else if (b == 4)\n    n = 62 + d + c;\n  else if (b == 5)\n    n = 92 + d + c;\n  else if (b == 6)\n    n = 123 + d + c;\n  else if (b == 7)\n    n = 153 + d + c;\n  else if (b == 8)\n    n = 184 + d + c;\n  else if (b == 9)\n    n = 215 + c + d;\n  else if (b == 10)\n    n = 245 + c + d;\n  else if (b == 11)\n    n = 276 + c + d;\n  else if (b == 12) {\n    n = 306 + c + d;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20303", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, day, m;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 4 == 0 && a % 400 == 0) {\n    m = 29;\n  } else {\n    m = 28;\n  }\n  switch (b) {\n  case 1:\n    day = c;\n    break;\n  case 2:\n    day = 31 + c;\n    break;\n  case 3:\n    day = 31 + m + c;\n    break;\n  case 4:\n    day = 31 + m + 31 + c;\n    break;\n  case 5:\n    day = 31 + m + 31 + 30 + c;\n    break;\n  case 6:\n    day = 31 + m + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    day = 31 + m + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 31 + 30 + c;\n    break;\n  case 12:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 30 + 31 + c;\n    break;\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int feb, i, n = 0;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 != 0)\n    feb = 28;\n  else {\n    if (year % 100 != 0)\n      feb = 29;\n    else {\n      if (year % 400 == 0)\n        feb = 29;\n      else\n        feb = 28;\n    }\n  }\n\n  for (i = 1; i < month; i++) {\n    if (i == 2)\n      n = n + feb;\n    else {\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        n = n + 30;\n      else\n        n = n + 31;\n    }\n  }\n\n  n = n + day;\n\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12], c, d, e, i, s, t = 0;\n  cin >> c >> d >> e;\n  if (c % 4 != 0 || (c % 100 == 0 && c % 400 != 0)) {\n    a[0] = 31;\n    a[1] = 28;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  } else {\n    a[0] = 31;\n    a[1] = 29;\n    a[2] = 31;\n    a[3] = 30;\n    a[4] = 31;\n    a[5] = 30;\n    a[6] = 31;\n    a[7] = 31;\n    a[8] = 30;\n    a[9] = 31;\n    a[10] = 30;\n    a[11] = 31;\n    for (i = 0; i < d - 1; i++)\n      t = t + a[i];\n    s = t + e;\n  }\n  cout << s;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i;\n\n  cin >> y >> m >> d;\n  int s = d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < (m - 1); i++) {\n      s += B[i];\n    }\n    printf(\"%d\", s);\n  } else {\n    for (i = 0; i < (m - 1); i++)\n      s += A[i];\n\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20307", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    int m[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n\n    k = k + c;\n    printf(\"%d\", k);\n  } else {\n    int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    printf(\"%d\", k);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, day, m;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 4 == 0 && a % 400 == 0) {\n    m = 29;\n  } else {\n    m = 28;\n  }\n  switch (b) {\n  case 1:\n    day = c;\n    break;\n  case 2:\n    day = 31 + c;\n    break;\n  case 3:\n    day = 31 + m + c;\n    break;\n  case 4:\n    day = 31 + m + 31 + c;\n    break;\n  case 5:\n    day = 31 + m + 31 + 30 + c;\n    break;\n  case 6:\n    day = 31 + m + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    day = 31 + m + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 31 + 30 + c;\n    break;\n  case 12:\n    day = 31 + m + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 30 + 31 + c;\n    break;\n  }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "20309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  y = 0;\n  for (i = 0; i < b - 1; i++) {\n    y = y + A[i];\n  }\n  y = y + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1 || b == 2) {\n      printf(\"%d\", y);\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else {\n    cout << y;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20310", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int sum = 0, i;\n  for (i = 0; i < b - 1; i++) {\n    sum = sum + f[i];\n  }\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n\n    if (b < 3) {\n      d = sum + c;\n    } else {\n      d = sum + 1 + c;\n    }\n  } else {\n    d = sum + c;\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, date, i = 1, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n\n    else if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        sum += 29;\n      } else\n        sum += 28;\n    } else {\n      sum += 30;\n    }\n  }\n\n  sum += date;\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 29 + d;\n          break;\n        case 4:\n          x = 31 + 29 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 29 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 29 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      } else {\n        switch (m) {\n        case 1:\n          x = d;\n          break;\n        case 2:\n          x = 31 + d;\n          break;\n        case 3:\n          x = 31 + 28 + d;\n          break;\n        case 4:\n          x = 31 + 28 + 31 + d;\n          break;\n        case 5:\n          x = 31 + 28 + 31 + 30 + d;\n          break;\n        case 6:\n          x = 31 + 28 + 31 + 30 + 31 + d;\n          break;\n        case 7:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n          break;\n        case 8:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n          break;\n        case 9:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n          break;\n        case 10:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n          break;\n        case 11:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n          break;\n        case 12:\n          x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n          break;\n        }\n        printf(\"%d\\n\", x);\n      }\n    else {\n      switch (m) {\n      case 1:\n        x = d;\n        break;\n      case 2:\n        x = 31 + d;\n        break;\n      case 3:\n        x = 31 + 29 + d;\n        break;\n      case 4:\n        x = 31 + 29 + 31 + d;\n        break;\n      case 5:\n        x = 31 + 29 + 31 + 30 + d;\n        break;\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31 + d;\n        break;\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n        break;\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n        break;\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n        break;\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n        break;\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n        break;\n      }\n      printf(\"%d\\n\", x);\n    }\n  else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, year = 0,\n      mon = 0, day = 0, i = 0, sum = 0;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    sum = sum + a[i];\n  sum = sum + day;\n  cout << sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "11", "index": "20314", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leapyear(int year) {\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int a[12];\n  int i, Year, Month, Day, date = 0;\n  cin >> Year >> Month >> Day;\n  if (leapyear(Year) == 1) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  } else if (leapyear(Year) == 0) {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, m;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 29 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 29 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n\n    if (b == 2) {\n      m = 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 3) {\n      m = 31 + 28 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 4) {\n      m = 31 + 28 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 5) {\n      m = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 6) {\n      m = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 7) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 8) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 9) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 10) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 11) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", m);\n    }\n    if (b == 12) {\n      m = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint runnian(int a) {\n  if (a % 4 == 0 && a % 400 == 0)\n    return 1;\n  if (a % 4 == 0 && a % 100 != 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint tian(int nian, int yue, int ri) {\n  int sum = 0, i;\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int feirun[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (runnian(nian) == 1) {\n    for (i = 0; i <= yue - 2; i++)\n      sum += run[i];\n    sum += ri;\n  } else {\n    for (i = 0; i <= yue - 2; i++)\n      sum += feirun[i];\n    sum += ri;\n  }\n  return sum;\n}\n\nint main() {\n  int nian, yue, ri;\n  scanf(\"%d %d %d \", &nian, &yue, &ri);\n  cout << tian(nian, yue, ri) << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i, y, m, d, s;\n\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 > 0)) || (y % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n\n  a[1] = 31;\n  a[3] = 31;\n  a[5] = 31;\n  a[7] = 31;\n  a[8] = 31;\n  a[10] = 31;\n  a[12] = 31;\n  a[4] = 30;\n  a[6] = 30;\n  a[9] = 30;\n  a[11] = 30;\n  s = 0;\n  for (i = 1; i < m; i++)\n    s = s + a[i];\n  s = s + d;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month_l[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1) {\n      if (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0) {\n        counter++;\n      }\n    }\n    counter = counter + month[i];\n  }\n  counter = counter + d;\n  cout << counter;\n  return 0;\n}\n"}
{"label": "11", "index": "20319", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  cout << c << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20320", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 60 + c);\n    else if (b == 4)\n      printf(\"%d\", 91 + c);\n    else if (b == 5)\n      printf(\"%d\", 121 + c);\n    else if (b == 6)\n      printf(\"%d\", 152 + c);\n    else if (b == 7)\n      printf(\"%d\", 182 + c);\n    else if (b == 8)\n      printf(\"%d\", 213 + c);\n    else if (b == 9)\n      printf(\"%d\", 244 + c);\n    else if (b == 10)\n      printf(\"%d\", 274 + c);\n    else if (b == 11)\n      printf(\"%d\", 305 + c);\n    else if (b == 12)\n      printf(\"%d\", 336 + c);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 59 + c);\n    else if (b == 4)\n      printf(\"%d\", 90 + c);\n    else if (b == 5)\n      printf(\"%d\", 120 + c);\n    else if (b == 6)\n      printf(\"%d\", 151 + c);\n    else if (b == 7)\n      printf(\"%d\", 181 + c);\n    else if (b == 8)\n      printf(\"%d\", 212 + c);\n    else if (b == 9)\n      printf(\"%d\", 243 + c);\n    else if (b == 10)\n      printf(\"%d\", 273 + c);\n    else if (b == 11)\n      printf(\"%d\", 304 + c);\n    else if (b == 12)\n      printf(\"%d\", 335 + c);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20321", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int zz[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0))\n    printf(\"%d\\n\", zz[m - 1] + d);\n  else {\n    if (m <= 2)\n      cout << zz[m - 1] + d << endl;\n    else\n      cout << zz[m - 1] + d + 1 << endl;\n  }\n}\n"}
{"label": "11", "index": "20322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, d;\n  scanf(\"%d %d %d\", &x, &y, &z);\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0)) {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 29;\n      break;\n    case 4:\n      d = z + 31 + 29 + 31;\n      break;\n    case 5:\n      d = z + 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 28;\n      break;\n    case 4:\n      d = z + 31 + 28 + 31;\n      break;\n    case 5:\n      d = z + 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (m(a) == 1) {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 60 + c;\n    if (b == 4)\n      x = 91 + c;\n    if (b == 5)\n      x = 121 + c;\n    if (b == 6)\n      x = 152 + c;\n    if (b == 7)\n      x = 182 + c;\n    if (b == 8)\n      x = 213 + c;\n    if (b == 9)\n      x = 244 + c;\n    if (b == 10)\n      x = 274 + c;\n    if (b == 11)\n      x = 305 + c;\n    if (b == 12)\n      x = 335 + c;\n    printf(\"%d\", x);\n  } else {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 59 + c;\n    if (b == 4)\n      x = 90 + c;\n    if (b == 5)\n      x = 120 + c;\n    if (b == 6)\n      x = 151 + c;\n    if (b == 7)\n      x = 181 + c;\n    if (b == 8)\n      x = 212 + c;\n    if (b == 9)\n      x = 243 + c;\n    if (b == 10)\n      x = 273 + c;\n    if (b == 11)\n      x = 304 + c;\n    if (b == 12)\n      x = 334 + c;\n    cout << x;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, sum;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    printf(\"%d\", c);\n  }\n  if (b == 2) {\n    sum = 31 + c;\n    printf(\"%d\", sum);\n  }\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0) {\n    if (b == 3) {\n      sum = 60 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 91 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 121 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 152 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 182 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 213 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 244 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 274 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 305 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 335 + c;\n      printf(\"%d\", sum);\n    }\n  } else {\n    if (b == 3) {\n      sum = 59 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 4) {\n      sum = 90 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 5) {\n      sum = 120 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 6) {\n      sum = 151 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 7) {\n      sum = 181 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 8) {\n      sum = 212 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 9) {\n      sum = 243 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 10) {\n      sum = 273 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 11) {\n      sum = 304 + c;\n      printf(\"%d\", sum);\n    }\n    if (b == 12) {\n      sum = 334 + c;\n      printf(\"%d\", sum);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, n = 0;\n  int a[12];\n  a[0] = 31;\n  a[1] = 28;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n\n  for (i = 0; i < m - 1; i++)\n    n += a[i];\n  n = n + d;\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, a, all, m1[5], m2[5], m3[5], i;\n  for (i = 0; i <= 4; i++)\n    cin >> m1[i] >> m2[i] >> m3[i];\n  for (i = 0; i <= 4; i++) {\n    year = m1[i];\n    month = m2[i];\n    day = m3[i];\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 1:\n        a = 366;\n        break;\n      case 2:\n        a = 335;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 366 - a + day;\n\n    } else {\n      switch (month) {\n      case 1:\n        a = 365;\n        break;\n      case 2:\n        a = 334;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 365 - a + day;\n    }\n    printf(\"%d\\n\", all);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20327", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, a,\n      m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0)\n    a = 1;\n  else if (year % 100 == 0 && year % 400 == 0)\n    a = 1;\n  else\n    a = 0;\n  if (a == 1) {\n    m[1] = 29;\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  } else if (a == 0) {\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  }\n  printf(\"%d \", sum);\n}\n"}
{"label": "11", "index": "20328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, data, days = 0;\n  cin >> year >> month >> data;\n  days = data;\n  if (month == 1)\n    days = days;\n  else {\n    for (i = 1; i < month; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        days = days + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        days = days + 30;\n      else if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n        days = days + 29;\n      else\n        days = days + 28;\n    }\n    days = days;\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, d, j;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    days[2]++;\n  d = c;\n  for (j = 1; j < b; j++)\n    d += days[j];\n\n  printf(\"%d\\n\", d);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n\n    return 0;\n}\n"}
{"label": "11", "index": "20330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, p;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0) {\n        p = 29;\n      } else {\n        p = 28;\n      }\n    else {\n      p = 29;\n    }\n  else {\n    p = 28;\n  }\n\n  switch (m) {\n  case 1: {\n    printf(\"%d\", d);\n    break;\n  }\n  case 2: {\n    printf(\"%d\", d + 31);\n    break;\n  }\n  case 3: {\n    printf(\"%d\", d + 31 + p);\n    break;\n  }\n  case 4: {\n    printf(\"%d\", d + 31 * 2 + p);\n    break;\n  }\n  case 5: {\n    printf(\"%d\", d + 31 * 2 + p + 30);\n    break;\n  }\n  case 6: {\n    printf(\"%d\", d + 31 * 3 + p + 30);\n    break;\n  }\n  case 7: {\n    printf(\"%d\", d + 31 * 3 + p + 30 * 2);\n    break;\n  }\n  case 8: {\n    printf(\"%d\", d + 31 * 4 + p + 30 * 2);\n    break;\n  }\n  case 9: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 2);\n    break;\n  }\n  case 10: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 3);\n    break;\n  }\n  case 11: {\n    printf(\"%d\", d + 31 * 6 + p + 30 * 3);\n    break;\n  }\n  default: { printf(\"%d\", d + 31 * 6 + p + 30 * 4); }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int daymonth[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                         31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int YEAR, MON, DAY, i, counter = 0;\n  scanf(\"%d %d %d \", &YEAR, &MON, &DAY);\n  for (i = 0; i < MON - 1; i++) {\n    counter += daymonth[leap(YEAR)][i];\n  }\n  counter += DAY;\n  cout << counter << endl;\n  return 0;\n}\nint leap(int YEAR) {\n  if ((YEAR % 4 == 0) && (YEAR % 100 != 0) || (YEAR % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "20332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 29 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 29 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 29 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    cout << d;\n  } else {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 28 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 28 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y1, m, d, no;\n  scanf(\"%d %d %d\", &y1, &m, &d);\n  no = 0;\n  if (y1 % 4 == 0) {\n    if (y1 % 400 == 0) {\n      switch (m) {\n      case 1:\n        no = d;\n        break;\n      case 2:\n        no = d + 31;\n        break;\n      case 3:\n        no = d + 60;\n        break;\n      case 4:\n        no = d + 91;\n        break;\n      case 5:\n        no = d + 121;\n        break;\n      case 6:\n        no = d + 152;\n        break;\n      case 7:\n        no = d + 182;\n        break;\n      case 8:\n        no = d + 213;\n        break;\n      case 9:\n        no = d + 243;\n        break;\n      case 10:\n        no = d + 274;\n        break;\n      case 11:\n        no = d + 304;\n        break;\n      case 12:\n        no = d + 335;\n        break;\n      }\n    } else {\n      if (y1 % 100 == 0) {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 59;\n          break;\n        case 4:\n          no = d + 90;\n          break;\n        case 5:\n          no = d + 120;\n          break;\n        case 6:\n          no = d + 151;\n          break;\n        case 7:\n          no = d + 181;\n          break;\n        case 8:\n          no = d + 212;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 273;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 334;\n          break;\n        }\n      } else {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 60;\n          break;\n        case 4:\n          no = d + 91;\n          break;\n        case 5:\n          no = d + 121;\n          break;\n        case 6:\n          no = d + 152;\n          break;\n        case 7:\n          no = d + 182;\n          break;\n        case 8:\n          no = d + 213;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 274;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 335;\n          break;\n        }\n      }\n    }\n  } else {\n    switch (m) {\n    case 1:\n      no = d;\n      break;\n    case 2:\n      no = d + 31;\n      break;\n    case 3:\n      no = d + 59;\n      break;\n    case 4:\n      no = d + 90;\n      break;\n    case 5:\n      no = d + 120;\n      break;\n    case 6:\n      no = d + 151;\n      break;\n    case 7:\n      no = d + 181;\n      break;\n    case 8:\n      no = d + 212;\n      break;\n    case 9:\n      no = d + 243;\n      break;\n    case 10:\n      no = d + 273;\n      break;\n    case 11:\n      no = d + 304;\n      break;\n    case 12:\n      no = d + 334;\n      break;\n    }\n  }\n  cout << no;\n  return 0;\n}\n"}
{"label": "11", "index": "20334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\nint main() {\n\n  int year, month, day;\n  int result = 0;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "20335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, sum = 0;\n  int a[20];\n  a[0] = 0;\n  a[1] = 31;\n  a[2] = 59;\n  a[3] = 90;\n  a[4] = 120;\n  a[5] = 151;\n  a[6] = 181;\n  a[7] = 212;\n  a[8] = 243;\n  a[9] = 273;\n  a[10] = 304;\n  a[11] = 334;\n  a[12] = 365;\n  scanf(\"%d%d%d\", &b, &c, &d);\n  if ((b % 4 != 0) || (b % 100 == 0 && b % 400 != 0))\n    sum = a[c - 1] + d;\n  else {\n    if (c < 3) {\n      sum = a[c - 1] + d;\n    } else {\n      sum = a[c - 1] + d + 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[5], i = 1;\n  while (i <= 5) {\n    scanf(\"%d%d%d\", &y, &m, &d);\n    if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0) {\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 28;\n        break;\n      case 4:\n        a[i] = d + 62 + 28;\n        break;\n      case 5:\n        a[i] = d + 62 + 28 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 28;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 28;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 28;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 28;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 28;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 28;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 28;\n        break;\n      }\n    } else\n      switch (m) {\n      case 1:\n        a[i] = d;\n        break;\n      case 2:\n        a[i] = d + 31;\n        break;\n      case 3:\n        a[i] = d + 31 + 29;\n        break;\n      case 4:\n        a[i] = d + 62 + 29;\n        break;\n      case 5:\n        a[i] = d + 62 + 29 + 30;\n        break;\n      case 6:\n        a[i] = d + 31 * 3 + 30 + 29;\n        break;\n      case 7:\n        a[i] = d + 31 * 3 + 30 * 2 + 29;\n        break;\n      case 8:\n        a[i] = d + 31 * 4 + 30 * 2 + 29;\n        break;\n      case 9:\n        a[i] = d + 31 * 5 + 30 * 2 + 29;\n        break;\n      case 10:\n        a[i] = d + 31 * 5 + 30 * 3 + 29;\n        break;\n      case 11:\n        a[i] = d + 31 * 6 + 30 * 3 + 29;\n        break;\n      case 12:\n        a[i] = d + 31 * 6 + 30 * 4 + 29;\n        break;\n      }\n    i = i + 1;\n  }\n  printf(\"%d\\n%d\\n%d\\n%d\\n%d\\n%\", a[1], a[2], a[3], a[4], a[5]);\n  return 0;\n}\n"}
{"label": "11", "index": "20337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month == 2 &&\n      (day < 1 || day > 29)) {\n    cout << \"Illegal input.\\n\";\n    return -1;\n  }\n  if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month != 2 &&\n      (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  int n = 0;\n  int i;\n  for (i = 1; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)) {\n    n++;\n  }\n  cout << n;\n}\n"}
{"label": "11", "index": "20338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, sum = 0, months[50], msum = 0;\n\n  months[1] = 31;\n  months[2];\n  months[3] = 31;\n  months[4] = 30;\n  months[5] = 31;\n  months[6] = 30;\n  months[7] = 31;\n  months[8] = 31;\n  months[9] = 30;\n  months[10] = 31;\n  months[11] = 30;\n  months[12] = 31;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 != 0) {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    } else {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    }\n  } else {\n    months[2] = 28;\n  }\n  for (i = 1; i < month; i++) {\n    msum = msum + months[i];\n  }\n  sum = msum + day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400) == 0) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++)\n    c += days[i];\n\n  cout << c;\n  return 0;\n}\n"}
{"label": "11", "index": "20340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  cin >> year >> month >> day;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (int i = 0; i <= month - 1; i++) {\n    if (i == month - 1)\n      sum += day;\n    else {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        sum += m2[i];\n      else\n        sum += m1[i];\n    }\n  }\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int day, month, year, sum, leap;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  switch (month) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  default:\n    printf(\"data error \");\n    break;\n  }\n  sum = sum + day;\n  if (year % 400 == 0 || (year & 4 == 0 && year % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && month > 2)\n    sum = sum + 1;\n  cout << sum << \" \";\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int year, int month, int day) {\n  int result = 0;\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  return result;\n}\nint main() {\n  int year, month, day, Y;\n  cin >> year >> month >> day;\n  Y = DiJiTian(year, month, day);\n  cout << Y;\n  return 0;\n}\n"}
{"label": "11", "index": "20343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, x;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  x = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 28;\n      }\n    }\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        x = x + 31;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n        x = x + 30;\n      } else if (i == 2) {\n        x = x + 29;\n      }\n    }\n  }\n  x = x + d;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s[13], t, n;\n  s[0] = 0;\n  s[1] = 31;\n  s[3] = 31;\n  s[4] = 30;\n  s[5] = 31;\n  s[6] = 30;\n  s[7] = 31;\n  s[8] = 31;\n  s[9] = 30;\n  s[10] = 31;\n  s[11] = 30;\n  s[12] = 31;\n  t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n      s[2] = 29;\n      t = s[i] + t;\n    } else {\n      s[2] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20345", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint day_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint sum_day(int month, int day) {\n  int i;\n  for (i = 0; i < month; i++)\n    day = day + day_month[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\nint main() {\n  int year, month, day, days, a;\n\n  for (a = 1; a <= 5; a++) {\n    scanf(\"%d%d%d\", &year, &month, &day);\n\n    days = sum_day(month, day);\n    if (leap(year) && month >= 3)\n      days = days + 1;\n    printf(\"%d\\n\", days);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20346", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int A, B, C, a, b, c, d, e, f, g, h, i, j, k, l, m;\n  cin >> A >> B >> C;\n  a = 31;\n  if ((A % 4 == 0 && A % 100 != 0) || A % 400 == 0)\n    b = 29;\n  else\n    b = 28;\n  c = 31;\n  d = 30;\n  e = 31;\n  f = 30;\n  g = 31;\n  h = 31;\n  i = 30;\n  j = 31;\n  k = 30;\n  l = 31;\n  if (B == 1)\n    m = C;\n  if (B == 2)\n    m = C + a;\n  if (B == 3)\n    m = C + a + b;\n  if (B == 4)\n    m = C + a + b + c;\n  if (B == 5)\n    m = C + a + b + c + d;\n  if (B == 6)\n    m = C + a + b + c + d + e;\n  if (B == 7)\n    m = C + a + b + c + d + e + f;\n  if (B == 8)\n    m = C + a + b + c + d + e + f + g;\n  if (B == 9)\n    m = C + a + b + c + d + e + f + g + h;\n  if (B == 10)\n    m = C + a + b + c + d + e + f + g + h + i;\n  if (B == 11)\n    m = C + a + b + c + d + e + f + g + h + i + j;\n  if (B == 12)\n    m = C + a + b + c + d + e + f + g + h + i + j + k;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "11", "index": "20347", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x = 0, i;\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d \", &y);\n  scanf(\"%d\", &m);\n  cin >> d;\n  if ((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))\n    for (i = 0; i < m - 1; i++)\n      x = x + a[i];\n  else\n    for (i = 0; i < m - 1; i++)\n      x = x + b[i];\n  x = x + d;\n  printf(\"%d\", x);\n}\n"}
{"label": "11", "index": "20348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 29 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 29 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n\n  } else if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 28 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 28 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, date, num;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d\", &year, &month, &date);\n    switch (month) {\n    case 1:\n      num = 0;\n      break;\n    case 2:\n      num = 31;\n      break;\n    case 3:\n      num = 59;\n      break;\n    case 4:\n      num = 90;\n      break;\n    case 5:\n      num = 120;\n      break;\n    case 6:\n      num = 151;\n      break;\n    case 7:\n      num = 181;\n      break;\n    case 8:\n      num = 212;\n      break;\n    case 9:\n      num = 243;\n      break;\n    case 10:\n      num = 273;\n      break;\n    case 11:\n      num = 304;\n      break;\n    case 12:\n      num = 334;\n      break;\n    }\n    if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month > 2)\n      num += 1;\n    num += date;\n    cout << num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, days;\n  cin >> year >> month >> day;\n  if (month == 1)\n    days = day;\n  else if (month == 2)\n    days = day + 31;\n  else if (month == 3)\n    days = day + 59;\n  else if (month == 4)\n    days = day + 90;\n  else if (month == 5)\n    days = day + 120;\n  else if (month == 6)\n    days = day + 151;\n  else if (month == 7)\n    days = day + 181;\n  else if (month == 8)\n    days = day + 212;\n  else if (month == 9)\n    days = day + 243;\n  else if (month == 10)\n    days = day + 273;\n  else if (month == 11)\n    days = day + 304;\n  else if (month == 12)\n    days = day + 334;\n  if (year % 100 == 0, year % 400 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 != 0)\n    printf(\"%d\", days);\n  else if (year % 100 != 0, year % 4 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  } else if (year % 400 == 0) {\n    if (month >= 1, month <= 2)\n      printf(\"%d\", days);\n    else if (month > 2, month <= 12)\n      printf(\"%d\", days + 1);\n  }\n}\n"}
{"label": "11", "index": "20351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int m[11] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0)\n    m[1] = 29;\n  else\n    m[1] = 28;\n  if (b == 1)\n    n = c;\n  else {\n    for (i = 0; i < b - 1; i++)\n      n = n + m[i];\n    n = n + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, year = 0,\n      mon = 0, day = 0, i = 0, sum = 0;\n  scanf(\"%d %d %d \", &year, &mon, &day);\n  if ((year % 100 == 0 && year % 400 == 0) ||\n      (year % 100 != 0 && year % 4 == 0))\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++)\n    sum = sum + a[i];\n  sum = sum + day;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0)) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    cout << y;\n  }\n\n  else if (a % 400 == 0) {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 29 + c;\n    }\n    if (b == 4) {\n      y = 31 + 29 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 29 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 29 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  } else {\n    if (b == 1) {\n      y = c;\n    }\n    if (b == 2) {\n      y = 31 + c;\n    }\n    if (b == 3) {\n      y = 31 + 28 + c;\n    }\n    if (b == 4) {\n      y = 31 + 28 + 31 + c;\n    }\n    if (b == 5) {\n      y = 31 + 28 + 31 + 30 + c;\n    }\n    if (b == 6) {\n      y = 31 + 28 + 31 + 30 + 31 + c;\n    }\n    if (b == 7) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    }\n\n    if (b == 8) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    }\n    if (b == 9) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    }\n    if (b == 10) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    }\n\n    if (b == 11) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    }\n\n    if (b == 12) {\n      y = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    }\n    printf(\"%d\", y);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20354", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "11", "index": "20355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, a, rank;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n    a = 1;\n  } else {\n    a = 0;\n  }\n  if (month == 1) {\n    rank = day;\n  }\n  if (month == 2) {\n    rank = 31 + day;\n  }\n  if (month == 3) {\n    rank = 59 + a + day;\n  }\n  if (month == 4) {\n    rank = 90 + a + day;\n  }\n  if (month == 5) {\n    rank = 120 + a + day;\n  }\n  if (month == 6) {\n    rank = 151 + a + day;\n  }\n  if (month == 7) {\n    rank = 181 + a + day;\n  }\n  if (month == 8) {\n    rank = 212 + a + day;\n  }\n  if (month == 9) {\n    rank = 243 + a + day;\n  }\n  if (month == 10) {\n    rank = 273 + a + day;\n  }\n  if (month == 11) {\n    rank = 304 + a + day;\n  }\n  if (month == 12) {\n    rank = 334 + a + day;\n  }\n  printf(\"%d\", rank);\n  return 0;\n}\n"}
{"label": "11", "index": "20356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint month[2][12] = {31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31,\n                    31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\nint main() {\n  int year, monthq, day;\n  scanf(\"%d %d %d \", &year, &monthq, &day);\n  int ans = 0;\n  for (int i = 1; i < monthq; i++) {\n    int xx;\n    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n      xx = 1;\n    else\n      xx = 0;\n    ans += month[xx][i - 1];\n  }\n  ans += day;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "20357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0, days, year, month;\n  cin >> year >> month >> days;\n  for (i = 0; i < month - 1; i++)\n    sum = sum + a[i];\n\n  sum = sum + days;\n  if ((month == 2 && days >= 28) || (month > 2)) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      sum = sum + 1;\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1 && (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0)) {\n      counter++;\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  cout << counter;\n}\n"}
{"label": "11", "index": "20359", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[5], month[5], day[5], total[5], i = 0;\n  for (; i <= 4; i++) {\n\n    scanf(\"%d %d %d \", &year[i], &month[i], &day[i]);\n  }\n  for (i = 0; i <= 4; i++) {\n    switch (month[i]) {\n    case 1:\n      total[i] = day[i];\n      break;\n    case 2:\n      total[i] = 31 + day[i];\n      break;\n    case 3:\n      total[i] = 31 + 28 + day[i];\n      break;\n    case 4:\n      total[i] = 31 + 28 + 31 + day[i];\n      break;\n    case 5:\n      total[i] = 31 + 28 + 31 + 30 + day[i];\n      break;\n    case 6:\n      total[i] = 31 + 28 + 31 + 30 + 31 + day[i];\n      break;\n    case 7:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    case 8:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day[i];\n      break;\n    case 9:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day[i];\n      break;\n    case 10:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day[i];\n      break;\n    case 11:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day[i];\n      break;\n    case 12:\n      total[i] = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day[i];\n      break;\n    }\n\n    if ((year[i] % 400 == 0 || year[i] % 4 == 0 && year[i] % 100 != 0) &&\n        month[i] > 2)\n      total[i] += 1;\n    printf(\"%d\\n\", total[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, sum, jan = 31, feb, mar = 31, apr = 30, may = 31, jun = 30,\n                    jul = 31, aug = 31, sep = 30, oct = 31, nov = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0))) {\n    feb = 29;\n  } else\n    feb = 28;\n  switch (m) {\n  case 1:\n    sum = d;\n    break;\n  case 2:\n    sum = jan + d;\n    break;\n  case 3:\n    sum = jan + feb + d;\n    break;\n  case 4:\n    sum = jan + feb + mar + d;\n    break;\n  case 5:\n    sum = jan + feb + mar + apr + d;\n    break;\n  case 6:\n    sum = jan + feb + mar + apr + may + d;\n    break;\n  case 7:\n    sum = jan + feb + mar + apr + may + jun + d;\n    break;\n  case 8:\n    sum = jan + feb + mar + apr + may + jun + jul + d;\n    break;\n  case 9:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + d;\n    break;\n  case 10:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + d;\n    break;\n  case 11:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + d;\n    break;\n  case 12:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + nov + d;\n    break;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20361", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59);\n    else if (month == 4)\n      printf(\"%d\", day + 90);\n    else if (month == 5)\n      printf(\"%d\", day + 120);\n    else if (month == 6)\n      printf(\"%d\", day + 151);\n    else if (month == 7)\n      printf(\"%d\", day + 181);\n    else if (month == 8)\n      printf(\"%d\", day + 212);\n    else if (month == 9)\n      printf(\"%d\", day + 242);\n    else if (month == 10)\n      printf(\"%d\", day + 273);\n    else if (month == 11)\n      printf(\"%d\", day + 304);\n    else if (month == 12)\n      printf(\"%d\", day + 334);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59 + 1);\n    else if (month == 4)\n      printf(\"%d\", day + 90 + 1);\n    else if (month == 5)\n      printf(\"%d\", day + 120 + 1);\n    else if (month == 6)\n      printf(\"%d\", day + 151 + 1);\n    else if (month == 7)\n      printf(\"%d\", day + 182);\n    else if (month == 8)\n      printf(\"%d\", day + 213);\n    else if (month == 9)\n      printf(\"%d\", day + 243);\n    else if (month == 10)\n      printf(\"%d\", day + 274);\n    else if (month == 11)\n      printf(\"%d\", day + 305);\n    else if (month == 12)\n      printf(\"%d\", day + 335);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0)\n    return 1;\n  if (n % 400 == 0)\n    return 1;\n  return 0;\n}\nint yue(int y, int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (run(y) == 1 && n == 2)\n    return 29;\n  if (run(y) == 0 && n == 2)\n    return 28;\n  return 30;\n}\nint days(int y, int m, int d) {\n  int k = 0;\n  for (int i = 1; i < m; i++)\n    k += yue(y, i);\n  k += d;\n  return k;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  printf(\"%d\", days(y, m, d));\n  return 0;\n}\n"}
{"label": "11", "index": "20363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, d;\n  scanf(\"%d %d %d \", &x, &y, &z);\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0)) {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 29;\n      break;\n    case 4:\n      d = z + 31 + 29 + 31;\n      break;\n    case 5:\n      d = z + 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 28;\n      break;\n    case 4:\n      d = z + 31 + 28 + 31;\n      break;\n    case 5:\n      d = z + 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 29 + d;\n      break;\n    case 4:\n      i = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n\n  } else {\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 28 + d;\n      break;\n    case 4:\n      i = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  cout << i << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int real;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1) {\n      printf(\"%d\", day);\n    }\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 29 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 29 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 29 + day;\n      printf(\"%d\", real);\n    }\n\n  } else {\n    if (month == 1) {\n      printf(\"%d\", day);\n    }\n    if (month == 2) {\n      real = 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 3) {\n      real = 31 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 4) {\n      real = 31 + 28 + 31 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 5) {\n      real = 31 * 2 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 6) {\n      real = 31 * 3 + 30 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 7) {\n      real = 31 * 3 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 8) {\n      real = 31 * 4 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 9) {\n      real = 31 * 5 + 30 * 2 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 10) {\n      real = 31 * 5 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 11) {\n      real = 31 * 6 + 30 * 3 + 28 + day;\n      printf(\"%d\", real);\n    }\n    if (month == 12) {\n      real = 31 * 6 + 30 * 4 + 28 + day;\n      printf(\"%d\", real);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int ye, mo, da, i, sum = 0;\n  int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d%d%d\", &ye, &mo, &da);\n\n  for (i = 1; i < mo; i++) {\n    sum = sum + mon[i];\n  }\n  if (((ye % 400 == 0) && mo > 2) ||\n      ((ye % 4 == 0) && (ye % 100 != 0)) && mo > 2) {\n    sum = sum + da + 1;\n  } else {\n    sum = sum + da;\n  }\n\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, days, i;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 == !0) {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 29 + day;\n      break;\n    case 4:\n      days = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 29 + 31 + 30 + day;\n    default:;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      days = day;\n      break;\n    case 2:\n      days = 31 + day;\n      break;\n    case 3:\n      days = 31 + 28 + day;\n      break;\n    case 4:\n      days = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      days = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      days = 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 7:\n      days = 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 8:\n      days = 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 9:\n      days = 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 10:\n      days = 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 11:\n      days = 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n      break;\n    case 12:\n      days = 30 + 31 + 30 + 31 + 31 + 30 + 31 + 31 + 28 + 31 + 30 + day;\n    default:;\n    }\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, num = 0;\n  int Ping[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> year;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    ;\n  } else {\n    Ping[2]++;\n  }\n  scanf(\"%d %d \", &month, &day);\n  for (int i = 0; i < month; i++) {\n    num += Ping[i];\n  }\n  cout << num + day << endl;\n}\n"}
{"label": "11", "index": "20369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year;\n  int month;\n  int day;\n  int data1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int data2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int in = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 || year % 100 == 0 && year % 400 == 0) {\n    int i = month - 1;\n    for (; i >= 0; i--) {\n      in += data2[i];\n    }\n    in += day;\n  } else {\n    int i = month - 1;\n    for (; i >= 0; i--)\n      in += data1[i];\n\n    in += day;\n  }\n  cout << in << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (m == 1)\n    s = d;\n  else if (m == 2)\n    s = 31 + d;\n  else if (m == 3)\n    s = 60 + d;\n  else if (m == 4)\n    s = 91 + d;\n  else if (m == 5)\n    s = 121 + d;\n  else if (m == 6)\n    s = 152 + d;\n  else if (m == 7)\n    s = 182 + d;\n  else if (m == 8)\n    s = 213 + d;\n  else if (m == 9)\n    s = 244 + d;\n  else if (m == 10)\n    s = 274 + d;\n  else if (m == 11)\n    s = 305 + d;\n  else if (m == 12)\n    s = 335 + d;\n  if (m >= 3) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        printf(\"%d\", s);\n      else\n        cout << s - 1;\n    } else if (y % 4 == 0)\n      printf(\"%d\", s);\n    else if (y % 4 != 0)\n      printf(\"%d\", s - 1);\n  } else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int DJT = 0;\n  int D[12];\n  D[0] = 31;\n  D[1] = 28;\n  D[2] = 31;\n  D[3] = 30;\n  D[4] = 31;\n  D[5] = 30;\n  D[6] = 31;\n  D[7] = 31;\n  D[8] = 30;\n  D[9] = 31;\n  D[10] = 30;\n  D[11] = 31;\n  int year, month, day;\n  cin >> year >> month >> day;\n  if (year % 400 == 0)\n    D[1] = D[1] + 1;\n  else if (year % 100 != 0 && year % 4 == 0)\n    D[1] = D[1] + 1;\n  else\n    D[1] = D[1];\n  for (int i = 0; i < month - 1; i++)\n    DJT = DJT + D[i];\n  DJT = DJT + day;\n  printf(\"%d\\n\", DJT);\n  return 0;\n}\n"}
{"label": "11", "index": "20372", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 29 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 29 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  } else\n\n  {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 28 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 28 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  }\n}\n"}
{"label": "11", "index": "20373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, day, tot = 0, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> y >> m >> day;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    a[1]++;\n  for (i = 0; i < m - 1; i++)\n    tot += a[i];\n  tot += day;\n  cout << tot << \" \";\n  return 0;\n}\n"}
{"label": "11", "index": "20374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  long a[5];\n  int b[5], c[5], g[5];\n  i = 1;\n  while (i <= 5) {\n    cin >> a[i] >> b[i] >> c[i];\n    i++;\n  }\n  i = 1;\n  while (i <= 5) {\n    g[i] = 0;\n    switch (b[i]) {\n    case 12:\n      g[i] += 30;\n    case 11:\n      g[i] += 31;\n    case 10:\n      g[i] += 30;\n    case 9:\n      g[i] += 31;\n    case 8:\n      g[i] += 31;\n    case 7:\n      g[i] += 30;\n    case 6:\n      g[i] += 31;\n    case 5:\n      g[i] += 30;\n    case 4:\n      g[i] += 31;\n    case 3:\n      g[i] += 28;\n    case 2:\n      g[i] += 31;\n    case 1:\n      g[i] += 0;\n      break;\n    default:\n      printf(\"error\\n\");\n    }\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || (a[i] % 400 == 0)) &&\n        (b[i] >= 3))\n      c[i] = c[i] + 1;\n    cout << g[i] + c[i] << \"\\n\";\n    i++;\n  }\n}\n"}
{"label": "11", "index": "20375", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, num = 0;\n  int Ping[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> year;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0))\n    ;\n  else\n    Ping[2]++;\n\n  cin >> month >> day;\n  for (int i = 0; i < month; i++) {\n    num += Ping[i];\n  }\n  printf(\"%d\\n\", num + day);\n}\n"}
{"label": "11", "index": "20376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, x;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 60 + c;\n\n    else if (b == 4)\n      x = 91 + c;\n\n    else if (b == 5)\n      x = 121 + c;\n\n    else if (b == 6)\n      x = 152 + c;\n\n    else if (b == 7)\n      x = 182 + c;\n\n    else if (b == 8)\n      x = 213 + c;\n\n    else if (b == 9)\n      x = 244 + c;\n\n    else if (b == 10)\n      x = 274 + c;\n\n    else if (b == 11)\n      x = 305 + c;\n\n    else if (b == 12)\n      x = 335 + c;\n\n  }\n\n  else {\n    if (b == 1)\n      x = c;\n\n    else if (b == 2)\n      x = 31 + c;\n\n    else if (b == 3)\n      x = 59 + c;\n\n    else {\n      if (b == 4)\n        x = 90 + c;\n\n      else if (b == 5)\n        x = 120 + c;\n\n      else if (b == 6)\n        x = 151 + c;\n\n      else if (b == 7)\n        x = 181 + c;\n\n      else if (b == 8)\n        x = 212 + c;\n\n      else if (b == 9)\n        x = 243 + c;\n\n      else if (b == 10)\n        x = 273 + c;\n      else if (b == 11)\n        x = 304 + c;\n\n      else if (b == 12)\n        x = 334 + c;\n    }\n  }\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20377", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, j, sum;\n  int a[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  for (j = 0; j < 5; j++) {\n    sum = 0;\n    cin >> year >> month >> day;\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0) {\n          for (i = 0; i < month; i++)\n            sum = sum + a[i];\n          sum = sum + day;\n        } else {\n          for (i = 0; i < month; i++)\n            sum = sum + b[i];\n          sum = sum + day;\n        }\n      } else {\n        for (i = 0; i < month; i++)\n          sum = sum + a[i];\n        sum = sum + day;\n      }\n    } else {\n      for (i = 0; i < month; i++)\n        sum = sum + b[i];\n      sum = sum + day;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, n, d, x = 0, i = 1, z;\n  int m[13];\n  m[1] = m[3] = m[5] = m[7] = m[8] = m[10] = m[12] = 31;\n  m[4] = m[6] = m[9] = m[11] = 30;\n  m[2] = 29;\n  scanf(\"%d %d %d\", &y, &n, &d);\n  if (n == 1) {\n    x = d;\n    z = x;\n  } else {\n    if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n        z = x + d;\n      }\n    } else {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n      }\n      z = x + d - 1;\n    }\n  }\n\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "11", "index": "20379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x;\n\n  scanf(\"%d%d%d\", &a, &b, &c);\n\n  d = 31 + c;\n  e = 59 + c;\n  f = 90 + c;\n  g = 120 + c;\n  h = 151 + c;\n  i = 181 + c;\n  j = 212 + c;\n  k = 243 + c;\n  l = 273 + c;\n  m = 304 + c;\n  n = 334 + c;\n  o = 60 + c;\n  p = 91 + c;\n  q = 121 + c;\n  r = 152 + c;\n  s = 182 + c;\n  t = 213 + c;\n  u = 244 + c;\n  v = 274 + c;\n  w = 305 + c;\n  x = 335 + c;\n\n  if (b == 1)\n    printf(\"%d\", c);\n  if (b == 2)\n    printf(\"%d\", d);\n  if ((b == 3) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", e);\n  if ((b == 4) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", f);\n  if ((b == 5) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", g);\n  if ((b == 6) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", h);\n  if ((b == 7) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    cout << i;\n  if ((b == 8) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", j);\n  if ((b == 9) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", k);\n  if ((b == 10) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", l);\n  if ((b == 11) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", m);\n  if ((b == 12) && (a % 100 != 0 && a % 4 != 0 || a % 100 == 0 && a % 400 != 0))\n    printf(\"%d\", n);\n  if ((b == 3) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", o);\n  if ((b == 4) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", p);\n  if ((b == 5) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", q);\n  if ((b == 6) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", r);\n  if ((b == 7) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", s);\n  if ((b == 8) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", t);\n  if ((b == 9) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", u);\n  if ((b == 10) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", v);\n  if ((b == 11) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    printf(\"%d\", w);\n  if ((b == 12) && (a % 100 != 0 && a % 4 == 0 || a % 400 == 0))\n    cout << x;\n  return 0;\n}\n"}
{"label": "11", "index": "20380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year;\n  short month, day, result = 0, i = 1;\n  char odd;\n  while (i <= 5) {\n    scanf(\"%d%hd%hd\", &year, &month, &day);\n    odd = year % 400 == 0 || year % 4 == 0 && year % 100 != 0 ? 1 : 0;\n    switch (month) {\n    case 12:\n      result += 30;\n    case 11:\n      result += 31;\n    case 10:\n      result += 30;\n    case 9:\n      result += 31;\n    case 8:\n      result += 31;\n    case 7:\n      result += 30;\n    case 6:\n      result += 31;\n    case 5:\n      result += 30;\n    case 4:\n      result += 31;\n    case 3:\n      result += 28;\n    case 2:\n      result += 31;\n    case 1:;\n    }\n    if (month >= 3)\n      result += odd;\n    result += day;\n    printf(\"%hd\\n\", result);\n    result = 0;\n    i++;\n  }\n  return (0);\n}\n"}
{"label": "11", "index": "20381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, z;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else\n    D = n + z;\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20382", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint l(int a) {\n  int i, j, k;\n  i = a % 4;\n  j = a % 100;\n  k = a % 400;\n  if (i == 0) {\n    if (j != 0 || k == 0)\n      return 1;\n    else\n      return 0;\n  } else\n    return 0;\n}\nint main() {\n  int a[3], i, j, k = 0;\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int c[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int d[12];\n  cin >> a[0] >> a[1] >> a[2];\n  i = a[0];\n  if (l(i) == 1) {\n    for (j = 0; j < 12; j++)\n      d[j] = c[j];\n  } else {\n    for (j = 0; j < 12; j++)\n      d[j] = b[j];\n  }\n  for (i = 0; i < a[1]; i++)\n    k = d[i] + k;\n  k = k + a[2];\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "20383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int zz[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 != 0 || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0))\n    printf(\"%d\\n\", zz[m - 1] + d);\n  else {\n    if (m <= 2)\n      cout << zz[m - 1] + d << endl;\n    else\n      cout << zz[m - 1] + d + 1 << endl;\n  }\n}\n"}
{"label": "11", "index": "20384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Runnian(int y);\nint main() {\n  int y, m, d, count = 0;\n  int i;\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      count += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      count += 30;\n    else if (i == 2) {\n      if (Runnian(y))\n        count += 29;\n      else\n        count += 28;\n    }\n  }\n  count += d;\n  cout << count << \"\\n\";\n  return 0;\n}\nint Runnian(int y) {\n  int result;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\n"}
{"label": "11", "index": "20385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  total = 0;\n  for (i = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      total = total + 31;\n\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20386", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400) == 0) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++)\n    c += days[i];\n\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "20387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 29 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 29 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 29 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n\n  } else if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1) {\n      d = c;\n      printf(\"%d\", d);\n    } else if (b == 2) {\n      d = 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 3) {\n      d = 31 + 28 + c;\n      printf(\"%d\", d);\n    } else if (b == 4) {\n      d = 31 + 28 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 5) {\n      d = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", d);\n    } else if (b == 6) {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", d);\n    } else if (b == 7) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30;\n      printf(\"%d\", d);\n    } else if (b == 8) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 9) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31;\n      printf(\"%d\", d);\n    } else if (b == 10) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30;\n      printf(\"%d\", d);\n    } else if (b == 11) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\", d);\n    } else if (b == 12) {\n      d = 31 + 28 + 31 + 30 + 31 + c + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\", d);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20388", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint map_1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint main() {\n  int year, month, day;\n  int i, sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    map_1[2] = 29;\n  if (month == 1)\n    sum = day;\n  else {\n    for (i = 1; i < month; i++)\n      sum = sum + map_1[i];\n    sum = sum + day;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, k, sum = 0;\n  cin >> year >> month >> day;\n  if (year % 400 == 0)\n    k = 1;\n  else if (year % 100 == 0)\n    k = 0;\n  else if (year % 4 == 0)\n    k = 1;\n  else\n    k = 0;\n  if (k == 1)\n    a[1] = 29;\n  for (i = 0; i < month - 1; i++)\n    sum += a[i];\n  sum += day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, mon, day;\n  cin >> year >> mon >> day;\n\n  int re;\n  if ((year % 4 == 0 && year % 400 == 0 && year % 100 == 0) ||\n      (year % 4 == 0 && year % 100 != 0)) {\n\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 29 + day;\n      break;\n    case 4:\n      re = 31 + 29 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 29 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 29 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  } else\n\n  {\n    switch (mon) {\n    case 1:\n      re = day;\n      break;\n    case 2:\n      re = 31 + day;\n      break;\n    case 3:\n      re = 31 + 28 + day;\n      break;\n    case 4:\n      re = 31 + 28 + 31 + day;\n      break;\n    case 5:\n      re = 31 + 28 + 31 + 30 + day;\n      break;\n    case 6:\n      re = 31 + 28 + 31 + 30 + 31 + day;\n      break;\n    case 7:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + day;\n      break;\n    case 8:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n      break;\n    case 9:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n      break;\n    case 10:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n      break;\n    case 11:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n      break;\n    case 12:\n      re = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n      break;\n    }\n  }\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "11", "index": "20392", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    int m[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    printf(\"%d\", k);\n  } else {\n    int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    printf(\"%d\", k);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum, n = 0, k[13];\n  scanf(\"%d %d %d\", &y, &m, &d);\n  k[0] = 0;\n  k[1] = k[3] = k[5] = k[7] = k[8] = k[10] = k[12] = 31;\n  k[4] = k[6] = k[9] = k[11] = 30;\n  if (y % 4) {\n    if (y % 100) {\n      if (y % 400) {\n        k[2] = 28;\n      } else {\n        k[2] = 29;\n      }\n    } else {\n      k[2] = 28;\n    }\n  } else {\n    k[2] = 29;\n  }\n  for (i = 0; i < m; i++) {\n    n = n + k[i];\n  }\n  sum = n + d;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b, c, d, i;\n  scanf(\"%d %d %d\", &b, &c, &d);\n  if ((b % 4 == 0 && b % 100 != 0) || (b % 100 == 0 && b % 400 == 0)) {\n    a[2] = 29;\n  }\n  for (i = 1; i < c; i++)\n    d = d + a[i];\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20395", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, j, sum;\n  int a[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int b[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  for (j = 0; j < 5; j++) {\n    sum = 0;\n    scanf(\"%d%d%d\", &year, &month, &day);\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0) {\n          for (i = 0; i < month; i++)\n            sum = sum + a[i];\n          sum = sum + day;\n        } else {\n          for (i = 0; i < month; i++)\n            sum = sum + b[i];\n          sum = sum + day;\n        }\n      } else {\n        for (i = 0; i < month; i++)\n          sum = sum + a[i];\n        sum = sum + day;\n      }\n    } else {\n      for (i = 0; i < month; i++)\n        sum = sum + b[i];\n      sum = sum + day;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20396", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y = 0, m = 0, d = 0;\n  int dd[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n = 0;\n  int i;\n\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    dd[1] = 29;\n\n  for (i = 0; i < m - 1; i++)\n    n = n + dd[i];\n\n  n = n + d;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20397", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, flag;\n  int daytal, tal;\n  cin >> year >> month >> day;\n  if (year % 400 == 0 || (year % 4 == 0) && (year % 100 != 0))\n    flag = 0;\n  else\n    flag = 1;\n  switch (month) {\n  case 1:\n    daytal = 0;\n    break;\n  case 2:\n    daytal = 31;\n    break;\n  case 3:\n    daytal = 60;\n    break;\n  case 4:\n    daytal = 91;\n    break;\n  case 5:\n    daytal = 121;\n    break;\n  case 6:\n    daytal = 152;\n    break;\n  case 7:\n    daytal = 182;\n    break;\n  case 8:\n    daytal = 213;\n    break;\n  case 9:\n    daytal = 244;\n    break;\n  case 10:\n    daytal = 274;\n    break;\n  case 11:\n    daytal = 305;\n    break;\n  case 12:\n    daytal = 335;\n    break;\n  }\n  if (month < 2)\n    flag = 0;\n  tal = daytal + day - flag;\n  cout << tal << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, sum, a[13];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  sum = day;\n  for (int i = 1; i < month; i++)\n    sum = sum + a[i];\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 > 0 || a % 400 == 0) {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2) {\n        sum += 29;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  } else {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2) {\n        sum += 28;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b, c, d, i;\n  cin >> b >> c >> d;\n  if ((b % 4 == 0 && b % 100 != 0) || (b % 100 == 0 && b % 400 == 0)) {\n    a[2] = 29;\n  }\n  for (i = 1; i < c; i++) {\n    d = d + a[i];\n  }\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20401", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  switch (b) {\n  case 1:\n    e = c;\n    break;\n  case 2:\n    e = 31 + c;\n    break;\n  case 3:\n    e = 31 + d + c;\n    break;\n  case 4:\n    e = 62 + d + c;\n    break;\n  case 5:\n    e = 92 + d + c;\n    break;\n  case 6:\n    e = 123 + d + c;\n    break;\n  case 7:\n    e = 153 + d + c;\n    break;\n  case 8:\n    e = 184 + d + c;\n    break;\n  case 9:\n    e = 215 + d + c;\n    break;\n  case 10:\n    e = 245 + d + c;\n    break;\n  case 11:\n    e = 276 + d + c;\n    break;\n  case 12:\n    e = 306 + d + c;\n    break;\n  }\n  cout << e;\n  return 0;\n}\n"}
{"label": "11", "index": "20402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, days = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    days = days + d[i - 1];\n  }\n  days = days + day;\n  if ((year % 4 == 0 || year % 400 == 0) && month > 2)\n    days = days++;\n  cout << days;\n}\n"}
{"label": "11", "index": "20403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  cin >> year >> month >> day;\n  int pin[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + run[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  } else {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + pin[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  }\n  cout << n << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  sum = 0;\n  scanf(\"%d %d %d\", &n, &j, &k);\n  for (i = 0; i <= j - 1; i++) {\n    sum = sum + a[i];\n  }\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    if (j <= 2) {\n      sum = sum + k;\n    } else {\n      sum = sum + 1 + k;\n    }\n  } else {\n    sum = sum + k;\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else {\n    D = n + z;\n  }\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20406", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leap_year(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else if (y % 4 == 0 && y % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, count;\n  cin >> y >> m >> d;\n  if (leap_year(y)) {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 29;\n      break;\n    case 4:\n      count = 31 + 29 + 31;\n      break;\n    case 5:\n      count = 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  } else {\n    switch (m) {\n    case 1:\n      count = 0;\n      break;\n    case 2:\n      count = 31;\n      break;\n    case 3:\n      count = 31 + 28;\n      break;\n    case 4:\n      count = 31 + 28 + 31;\n      break;\n    case 5:\n      count = 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      count = 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      count = 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      count = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    count += d;\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "11", "index": "20407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint rui(int x) {\n  if (x % 4 != 0)\n    return (0);\n  else if (x % 100 == 0 && x % 400 != 0)\n    return (0);\n  else\n    return (1);\n}\nint main() {\n  int r[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, n = 0;\n  cin >> a >> b >> c;\n  for (i = 0; i < b - 1; i++)\n    n = n + r[i];\n  n = n + c;\n  if (rui(a) == 1 && b > 2)\n    n++;\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "11", "index": "20408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, m, d, i, b[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  c[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  s = 0;\n  cin >> a >> m >> d;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0))\n    for (i = 1; i < m; i++)\n      s += b[i];\n  else\n    for (i = 1; i < m; i++)\n      s += c[i];\n  printf(\"%d\", s + d);\n  return 0;\n}\n"}
{"label": "11", "index": "20409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, n = 0;\n  cin >> a >> b >> c;\n  int m[11] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0)\n    m[1] = 29;\n  else\n    m[1] = 28;\n  if (b == 1)\n    n = c;\n  else {\n    for (i = 0; i < b - 1; i++)\n      n = n + m[i];\n    n = n + c;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20410", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y1, m, d, no;\n  scanf(\"%d %d %d \", &y1, &m, &d);\n  no = 0;\n  if (y1 % 4 == 0) {\n    if (y1 % 400 == 0) {\n      switch (m) {\n      case 1:\n        no = d;\n        break;\n      case 2:\n        no = d + 31;\n        break;\n      case 3:\n        no = d + 60;\n        break;\n      case 4:\n        no = d + 91;\n        break;\n      case 5:\n        no = d + 121;\n        break;\n      case 6:\n        no = d + 152;\n        break;\n      case 7:\n        no = d + 182;\n        break;\n      case 8:\n        no = d + 213;\n        break;\n      case 9:\n        no = d + 243;\n        break;\n      case 10:\n        no = d + 274;\n        break;\n      case 11:\n        no = d + 304;\n        break;\n      case 12:\n        no = d + 335;\n        break;\n      }\n    } else {\n      if (y1 % 100 == 0) {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 59;\n          break;\n        case 4:\n          no = d + 90;\n          break;\n        case 5:\n          no = d + 120;\n          break;\n        case 6:\n          no = d + 151;\n          break;\n        case 7:\n          no = d + 181;\n          break;\n        case 8:\n          no = d + 212;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 273;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 334;\n          break;\n        }\n      } else {\n        switch (m) {\n        case 1:\n          no = d;\n          break;\n        case 2:\n          no = d + 31;\n          break;\n        case 3:\n          no = d + 60;\n          break;\n        case 4:\n          no = d + 91;\n          break;\n        case 5:\n          no = d + 121;\n          break;\n        case 6:\n          no = d + 152;\n          break;\n        case 7:\n          no = d + 182;\n          break;\n        case 8:\n          no = d + 213;\n          break;\n        case 9:\n          no = d + 243;\n          break;\n        case 10:\n          no = d + 274;\n          break;\n        case 11:\n          no = d + 304;\n          break;\n        case 12:\n          no = d + 335;\n          break;\n        }\n      }\n    }\n  } else {\n    switch (m) {\n    case 1:\n      no = d;\n      break;\n    case 2:\n      no = d + 31;\n      break;\n    case 3:\n      no = d + 59;\n      break;\n    case 4:\n      no = d + 90;\n      break;\n    case 5:\n      no = d + 120;\n      break;\n    case 6:\n      no = d + 151;\n      break;\n    case 7:\n      no = d + 181;\n      break;\n    case 8:\n      no = d + 212;\n      break;\n    case 9:\n      no = d + 243;\n      break;\n    case 10:\n      no = d + 273;\n      break;\n    case 11:\n      no = d + 304;\n      break;\n    case 12:\n      no = d + 334;\n      break;\n    }\n  }\n  printf(\"%d\", no);\n  return 0;\n}\n"}
{"label": "11", "index": "20411", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int d = 0;\n  int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int y[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &a, &b, &c);\n  int i;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 100 == 0 && a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + y[i];\n    }\n    printf(\"%d\", d + c);\n  } else {\n    for (i = 1; i < b; i++) {\n      d = d + x[i];\n    }\n    printf(\"%d\", d + c);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int d = 0;\n  int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int y[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int i;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 100 == 0 && a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + y[i];\n    }\n    printf(\"%d\", d + c);\n  } else {\n    for (i = 1; i < b; i++) {\n      d = d + x[i];\n    }\n    printf(\"%d\", d + c);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20413", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, dm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day = 0,\n            month = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    dm[1] = 29;\n  int i, d = 0;\n  for (i = 0; i < month - 1; i++)\n    d += dm[i];\n  d += day;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20414", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, s = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int m1 = 31, m2 = 28, m21 = 29, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31,\n      m8 = 31, m9 = 30, m10 = 31, m11 = 30, m12 = 31;\n  if (a % 4 != 0 || (a % 100 == 0 && a % 400 != 0)) {\n    switch (b) {\n    case (1):\n      s = c;\n      cout << s << \"\\n\";\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 28 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m2 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m2 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m2 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      cout << s << \"\\n\";\n      break;\n    }\n  } else {\n    switch (b) {\n    case (1):\n      s = c;\n      printf(\"%d\\n\", s);\n      break;\n    case (2):\n\n      s = 31 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (3):\n      s = 31 + 29 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (4):\n      s = m1 + m21 + m3 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (5):\n      s = m1 + m21 + m3 + m4 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (6):\n      s = m1 + m21 + m3 + m4 + m5 + c;\n      printf(\"%d\\n\", s);\n      break;\n\n    case (7):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (8):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (9):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (10):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (11):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + c;\n      printf(\"%d\\n\", s);\n      break;\n    case (12):\n      s = m1 + m21 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + c;\n      printf(\"%d\\n\", s);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59);\n    else if (month == 4)\n      printf(\"%d\", day + 90);\n    else if (month == 5)\n      printf(\"%d\", day + 120);\n    else if (month == 6)\n      printf(\"%d\", day + 151);\n    else if (month == 7)\n      printf(\"%d\", day + 181);\n    else if (month == 8)\n      printf(\"%d\", day + 212);\n    else if (month == 9)\n      printf(\"%d\", day + 242);\n    else if (month == 10)\n      printf(\"%d\", day + 273);\n    else if (month == 11)\n      printf(\"%d\", day + 304);\n    else if (month == 12)\n      printf(\"%d\", day + 334);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else {\n      if (month == 2)\n        printf(\"%d\", day + 31);\n      else if (month == 3)\n        printf(\"%d\", day + 59 + 1);\n      else if (month == 4)\n        printf(\"%d\", day + 90 + 1);\n      else if (month == 5)\n        printf(\"%d\", day + 120 + 1);\n      else if (month == 6)\n        printf(\"%d\", day + 151 + 1);\n      else if (month == 7)\n        printf(\"%d\", day + 182);\n      else if (month == 8)\n        printf(\"%d\", day + 213);\n      else if (month == 9)\n        printf(\"%d\", day + 243);\n      else if (month == 10)\n        printf(\"%d\", day + 274);\n      else if (month == 11)\n        printf(\"%d\", day + 305);\n      else if (month == 12)\n        printf(\"%d\", day + 335);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, a, i = 1;\n  while (i <= 5) {\n    scanf(\"%d %d %d\", &year, &month, &day);\n    if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) == 1) {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 29 + day;\n        break;\n      case 4:\n        a = 31 + 29 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 29 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 29 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        printf(\"error\\n\");\n      }\n    } else {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 28 + day;\n        break;\n      case 4:\n        a = 31 + 28 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 28 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 28 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        printf(\"error\\n\");\n      }\n    }\n    printf(\"%d\\n\", a);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint rui(int x) {\n  if (x % 4 != 0)\n    return (0);\n  else if (x % 100 == 0 && x % 400 != 0)\n    return (0);\n  else\n    return (1);\n}\nint main() {\n  int r[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, n = 0;\n  cin >> a >> b >> c;\n  for (i = 0; i < b - 1; i++)\n    n = n + r[i];\n  n = n + c;\n  if (rui(a) == 1 && b > 2)\n    n++;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[1] = 29;\n  if (m == 1)\n    printf(\"%d\", d);\n  else {\n    for (int i = 0; i < m - 1; i++) {\n      t = t + a[i];\n    }\n    printf(\"%d\", t + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], d[5], x[5], i;\n  for (i = 1; i <= 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 1; i <= 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0))\n      x[i] = 1;\n    else\n      x[i] = 0; \n    if (b[i] == 1)\n      d[i] = c[i];\n    else if (b[i] == 2)\n      d[i] = c[i] + 31;\n    else if (b[i] == 3)\n      d[i] = c[i] + 31 + 28 + x[i];\n    else if (b[i] == 4)\n      d[i] = c[i] + 31 + 28 + 31 + x[i];\n    else if (b[i] == 5)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + x[i];\n    else if (b[i] == 6)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 7)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + x[i];\n    else if (b[i] == 8)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 9)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + x[i];\n    else if (b[i] == 10)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + x[i];\n    else if (b[i] == 11)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 12)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 +\n             x[i]; \n    printf(\"%d \", d[i]);\n  }\n}\n"}
{"label": "11", "index": "20421", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0, N;\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 100 != 0 && y % 4 == 0) {\n    int p[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > p[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + p[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  } else if (y % 4 != 0) {\n    int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > q[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + q[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, n = 0, i, num = 0;\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n = n + B[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      n = n + A[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20423", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  long int year[5], month[5], day[5], t[5];\n  long int c[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},\n           b[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  for (i = 0; i <= 4; i++) {\n    scanf(\"%ld %ld %ld \", &year[i], &month[i], &day[i]);\n    if (year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0)\n      t[i] = c[month[i] - 1] + day[i];\n    else\n      t[i] = b[month[i] - 1] + day[i];\n  }\n  for (i = 0; i <= 4; i++)\n    printf(\"%ld\\n\", t[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "20424", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, day, f, i, sum = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> mon >> day;\n  if (year % 4 == 0 && year % 100 != 0)\n    f = 1;\n  else if (year % 400 == 0)\n    f = 1;\n  else\n    f = 0;\n  for (i = 1; i < mon; i++) {\n    sum = sum + a[i - 1];\n  }\n  sum = sum + day;\n  if (f == 1 && mon > 2)\n    sum = sum + 1;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20425", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (b == 1) {\n\n    d = c;\n  }\n\n  else if (b == 2) {\n    d = 31 + c;\n\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n\n      if (b == 3) {\n        d = 31 + 29 + c;\n      }\n      if (b == 4) {\n        d = 31 + 29 + 31 + c;\n      }\n      if (b == 5) {\n        d = 31 + 29 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 29 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    } else {\n      if (b == 3) {\n        d = 31 + 28 + c;\n      }\n      if (b == 4)\n        d = 31 + 28 + 31 + c;\n\n      if (b == 5) {\n        d = 31 + 28 + 31 + 30 + c;\n      }\n      if (b == 6) {\n        d = 31 + 28 + 31 + 30 + 31 + c;\n      }\n      if (b == 7) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      }\n      if (b == 8) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      }\n      if (b == 9) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      }\n\n      if (b == 10) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      }\n\n      if (b == 11) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      }\n      if (b == 12) {\n        d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      }\n    }\n  }\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, data, days = 0;\n  scanf(\"%d%d%d\", &year, &month, &data);\n  days = data;\n  if (month == 1) {\n    days = days;\n  } else {\n    for (i = 1; i < month; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n        days = days + 31;\n      else if (i == 4 || i == 6 || i == 9 || i == 11)\n        days = days + 30;\n      else if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n        days = days + 29;\n      else\n        days = days + 28;\n    }\n    days = days;\n  }\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[13], X, B;\n  int N;\n  cin >> N >> X >> B;\n  if (N % 100)\n    if (N % 4 == 0)\n      A[2] = 29;\n    else\n      A[2] = 28;\n  else if (N % 400 == 0)\n    A[2] = 29;\n  else\n    A[2] = 28;\n  A[1] = A[3] = A[5] = A[7] = A[8] = A[10] = A[11] = 31;\n  A[4] = A[6] = A[9] = A[11] = 30;\n  int Ans = B;\n  for (int I = 1; I < X; I++)\n    Ans += A[I];\n  cout << Ans << endl;\n}\n"}
{"label": "11", "index": "20428", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, n;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  switch (month) {\n  case 1: {\n    n = day;\n    break;\n  }\n\n  case 2: {\n    n = 31 + day;\n    break;\n  }\n\n  case 3: {\n    n = 59 + day;\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      n = n + 1;\n    else {\n      n = n;\n    }\n\n    break;\n  }\n  case 4: {\n    n = 90 + day;\n    break;\n  }\n  case 5: {\n    n = 120 + day;\n    break;\n  }\n  case 6: {\n    n = 151 + day;\n    break;\n  }\n  case 7: {\n    n = 181 + day;\n    break;\n  }\n  case 8: {\n    n = 212 + day;\n    break;\n  }\n  case 9: {\n    n = 243 + day;\n    break;\n  }\n  case 10: {\n    n = 273 + day;\n    break;\n  }\n  case 11: {\n    n = 304 + day;\n    break;\n  }\n  case 12: {\n    n = 334 + day;\n    break;\n  }\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Y, M, D, sum = 0, i;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if ((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) {\n    for (i = 1; i <= M - 1; i++) {\n      sum += y[i - 1];\n    }\n    sum = sum + D;\n  } else {\n    for (i = 1; i <= M - 1; i++) {\n      sum += +x[i - 1];\n    };\n    sum = sum + D;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 100 == 0 && y % 40 == 0 || y % 100 != 0 && y % 4 == 0)\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 335);\n      break;\n    }\n  else\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 243);\n      break;\n    case 10:\n      cout << d + 273 << \"\\n\";\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 334);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "20431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))\n    d = 29;\n  else\n    d = 28;\n  switch (b) {\n  case 1:\n    e = c;\n    break;\n  case 2:\n    e = 31 + c;\n    break;\n  case 3:\n    e = 31 + d + c;\n    break;\n  case 4:\n    e = 62 + d + c;\n    break;\n  case 5:\n    e = 92 + d + c;\n    break;\n  case 6:\n    e = 123 + d + c;\n    break;\n  case 7:\n    e = 153 + d + c;\n    break;\n  case 8:\n    e = 184 + d + c;\n    break;\n  case 9:\n    e = 215 + d + c;\n    break;\n  case 10:\n    e = 245 + d + c;\n    break;\n  case 11:\n    e = 276 + d + c;\n    break;\n  case 12:\n    e = 306 + d + c;\n    break;\n  }\n  cout << e;\n  return 0;\n}\n"}
{"label": "11", "index": "20432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, total = 0, i;\n  int mon[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                    {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (i = 1; i < month; i++)\n      total += mon[1][i];\n    total += day;\n  } else {\n    for (i = 1; i < month; i++)\n      total += mon[0][i];\n    total += day;\n  }\n  printf(\"%d\\n\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, m = 0, n, r = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))\n    r = 1;\n  if (r == 1) {\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 60;\n      break;\n    case 4:\n      m = 91;\n      break;\n    case 5:\n      m = 121;\n      break;\n    case 6:\n      m = 152;\n      break;\n    case 7:\n      m = 182;\n      break;\n    case 8:\n      m = 213;\n      break;\n    case 9:\n      m = 244;\n      break;\n    case 10:\n      m = 274;\n      break;\n    case 11:\n      m = 305;\n      break;\n    case 12:\n      m = 335;\n      break;\n    }\n  } else\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n  n = m + c;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (b == 1) {\n    d = c;\n  }\n  if (b == 2) {\n    d = c + 31;\n  }\n  if (b == 3) {\n    d = c + 31 + 28;\n  }\n  if (b == 4) {\n    d = c + 59 + 31;\n  }\n  if (b == 5) {\n    d = c + 90 + 30;\n  }\n  if (b == 6) {\n    d = c + 120 + 31;\n  }\n  if (b == 7) {\n    d = c + 151 + 30;\n  }\n  if (b == 8) {\n    d = c + 181 + 31;\n  }\n  if (b == 9) {\n    d = c + 212 + 31;\n  }\n  if (b == 10) {\n    d = c + 243 + 30;\n  }\n  if (b == 11) {\n    d = c + 273 + 31;\n  }\n  if (b == 12)\n    d = c + 304 + 30;\n\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      if (b != 1 && b != 2) {\n        d = d + 1;\n      }\n    }\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    if (b != 1 && b != 2) {\n      d = d + 1;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int m[11] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0 && a % 400 == 0)\n    m[1] = 29;\n  else {\n    m[1] = 28;\n  }\n  if (b == 1)\n    n = c;\n  else {\n    for (i = 0; i < b - 1; i++)\n      n = n + m[i];\n    n = n + c;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20436", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, n, i, t = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < month; i++) {\n    t = t + a[i];\n  }\n  if (month >= 3)\n    if (year % 4 == 0)\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          n = t + 1 + day;\n        else\n          n = t + day;\n      } else\n        n = t + 1 + day;\n    else\n      n = t + day;\n  else\n    n = t + day;\n\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum, jan = 31, feb, mar = 31, apr = 30, may = 31, jun = 30,\n                    jul = 31, aug = 31, sep = 30, oct = 31, nov = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    feb = 29;\n  else\n    feb = 28;\n  switch (m) {\n  case 1:\n    sum = d;\n    break;\n  case 2:\n    sum = jan + d;\n    break;\n  case 3:\n    sum = jan + feb + d;\n    break;\n  case 4:\n    sum = jan + feb + mar + d;\n    break;\n  case 5:\n    sum = jan + feb + mar + apr + d;\n    break;\n  case 6:\n    sum = jan + feb + mar + apr + may + d;\n    break;\n  case 7:\n    sum = jan + feb + mar + apr + may + jun + d;\n    break;\n  case 8:\n    sum = jan + feb + mar + apr + may + jun + jul + d;\n    break;\n  case 9:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + d;\n    break;\n  case 10:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + d;\n    break;\n  case 11:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + d;\n    break;\n  case 12:\n    sum = jan + feb + mar + apr + may + jun + jul + aug + sep + oct + nov + d;\n    break;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint judge(int);\nint main() {\n  int year, month, day, i, j, total = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      total = total + 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      total = total + 30;\n    else if (judge(year) == 0 && i == 2)\n      total = total + 28;\n    else if (judge(year) == 1 && i == 2)\n      total = total + 29;\n  }\n  total = total + day;\n  printf(\"%d\\n\", total);\n  return 0;\n}\nint judge(int x) {\n  int y = 0;\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0)\n    y = 1;\n  else\n    y = 0;\n  return y;\n}\n"}
{"label": "11", "index": "20439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n, s[12], i, t;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  t = 0;\n  for (i = 0; i < b - 1; i++) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n      s[1] = 29;\n      t = s[i] + t;\n    } else {\n      s[1] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  printf(\"%d\\n\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20440", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, n, i, t = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < month; i++) {\n    t = t + a[i];\n  }\n  if (month >= 3)\n    if (year % 4 == 0)\n      if (year % 100 == 0)\n        if (year % 400 == 0)\n          n = t + 1 + day;\n        else\n          n = t + day;\n      else\n        n = t + 1 + day;\n    else\n      n = t + day;\n  else\n    n = t + day;\n\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n = 0, i, num = 0;\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      B[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n = n + B[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      n = n + A[i];\n    }\n    num = n + day;\n    printf(\"%d\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int result = 0;\n  int i;\n  int yue[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 100 == 0 && year % 400 == 0) || year % 100 != 0 && year % 4 == 0)\n    yue[1] = 29;\n  if (month == 1) {\n    result = result + day;\n    printf(\"%d\", result);\n  }\n  if (month > 1) {\n    for (i = 0; i < month - 1; i++) {\n      result = result + yue[i];\n    }\n    result = result + day;\n    printf(\"%d \", result);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20443", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, run = 0, M[13], i, D;\n  cin >> y >> m >> d;\n  D = d;\n  if ((y % 400 == 0) || ((y % 100 != 0) && (y % 4 == 0))) {\n    run = 1;\n  } else\n    run = 0;\n  for (i = 1; i < 13; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      M[i] = 31;\n      break;\n    default:\n      M[i] = 30;\n    }\n  }\n  if (run == 1) {\n    M[2] = 29;\n  } else\n    M[2] = 28;\n  for (i = 1; i < m; i++) {\n    D = D + M[i];\n  }\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, j = 0, y, i, m, d,\n         number[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  for (i = 1; i < m; i++) {\n    j += number[i - 1];\n  }\n  k = j + d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    if (m > 1)\n      printf(\"%d\", k + 1);\n  } else\n    printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "11", "index": "20445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, x;\n  cin >> year >> month >> day;\n  switch (month) {\n  case 1:\n    x = day;\n    break;\n  case 2:\n    x = 31 + day;\n    break;\n  case 3:\n    x = 31 + 28 + day;\n    break;\n  case 4:\n    x = 31 + 28 + 31 + day;\n    break;\n  case 5:\n    x = 31 + 28 + 31 + 30 + day;\n    break;\n  case 6:\n    x = 31 + 28 + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  if (year % 4 == 0)\n    if (year % 100 == 0)\n      if (year % 400 == 0)\n        if (month >= 3) {\n          printf(\"%d\", x + 1);\n        } else {\n          printf(\"%d\", x);\n        }\n      else\n        printf(\"%d\", x);\n    else if (month >= 3) {\n      printf(\"%d\", x + 1);\n    } else {\n      printf(\"%d\", x);\n    }\n  else\n    printf(\"%d\", x);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20446", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 29);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 29 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (b == 1)\n      printf(\"%d\\n\", c);\n    else if (b == 2)\n      printf(\"%d\\n\", c + 31);\n    else if (b == 3)\n      printf(\"%d\\n\", c + 31 + 28);\n    else if (b == 4)\n      printf(\"%d\\n\", c + 31 + 28 + 31);\n    else if (b == 5)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30);\n    else if (b == 6)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31);\n    else if (b == 7)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30);\n    else if (b == 8)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31);\n    else if (b == 9)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31);\n    else if (b == 10)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n    else if (b == 11)\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31);\n    else\n      printf(\"%d\\n\", c + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int t = 0;\n  int monthday[13] = {0, 31, 28 + t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    t = 1;\n\n  int summonth = 0;\n  int sum = 0;\n\n  int i;\n  for (i = 0; i < month; i++)\n    summonth += monthday[i];\n  sum = summonth + day;\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int month, date, n = 0, i, year, p;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))\n    p = 29;\n  else\n    p = 28;\n  for (i = 1; i < month; i++) {\n    switch (i) {\n    case 1:\n      n += 31;\n      break;\n    case 2:\n      n += p;\n      break;\n    case 3:\n      n += 31;\n      break;\n    case 4:\n      n += 30;\n      break;\n    case 5:\n      n += 31;\n      break;\n    case 6:\n      n += 30;\n      break;\n    case 7:\n      n += 31;\n      break;\n    case 8:\n      n += 31;\n      break;\n    case 9:\n      n += 30;\n      break;\n    case 10:\n      n += 31;\n      break;\n    case 11:\n      n += 30;\n      break;\n    }\n  }\n  n += date;\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20449", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 29;\n      break;\n    case 4:\n      n = d + 31 * 2 + 29;\n      break;\n    case 5:\n      n = d + 29 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 29 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 29 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 29 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 29 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 29 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 29 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 29 + 31 * 6 + 30 * 4;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 28;\n      break;\n    case 4:\n      n = d + 31 * 2 + 28;\n      break;\n    case 5:\n      n = d + 28 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 28 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 28 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 28 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 28 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 28 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 28 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 28 + 31 * 6 + 30 * 4;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int x) {\n  int z;\n  if (((x % 4 == 0) && (x % 100 != 0)) || (x % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int year, month, day;\n  int z, i = 0, sum = 0;\n  int a[12], b[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  z = f(year);\n  if (z == 1) {\n    int a[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  } else {\n    int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++) {\n      sum = sum + a[i];\n    }\n  }\n  sum = sum + day;\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint days_of_month[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                            {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n\nint is_leap_year(int year) {\n  if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int index = is_leap_year(year);\n  int days = 0;\n  for (int i = 0; i < month - 1; i++)\n    days += days_of_month[index][i];\n  days += day;\n  printf(\"%d\", days);\n}\n"}
{"label": "11", "index": "20452", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0, N;\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 100 != 0 && y % 4 == 0) {\n    int p[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > p[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++)\n        n = n + p[j];\n\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  } else if (y % 4 != 0) {\n    int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > q[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++)\n        n = n + q[j];\n\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int year, int month, int day) {\n  int result = 0;\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n  result += day;\n  return result;\n}\nint main() {\n  int year, month, day, Y;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  Y = DiJiTian(year, month, day);\n  printf(\"%d\", Y);\n  return 0;\n}\n"}
{"label": "11", "index": "20454", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0)\n    a = 0;\n  if (a % 100 == 0 && a % 400 == 0)\n    a = 0;\n  if (a != 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 28;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  if (a == 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 29;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20455", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, sum, a[13];\n  cin >> year >> month >> day;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  sum = day;\n  for (int i = 1; i < month; i++)\n    sum = sum + a[i];\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20456", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int n = 0;\n  int i;\n\n  cin >> year >> month >> day;\n\n  for (i = 1; i < month; i++)\n    n = n + days[i];\n\n  n = n + day;\n\n  if (month > 2 && isleapyear(year))\n    n++;\n\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20457", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 400 == 0) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 60 + c;\n    if (b == 4)\n      d = 91 + c;\n    if (b == 5)\n      d = 121 + c;\n    if (b == 6)\n      d = 152 + c;\n    if (b == 7)\n      d = 182 + c;\n    if (b == 8)\n      d = 213 + c;\n    if (b == 9)\n      d = 244 + c;\n    if (b == 10)\n      d = 275 + c;\n    if (b == 11) {\n      d = 305 + c;\n    }\n    if (b == 12)\n      d = 335 + c;\n    printf(\"%d\", d);\n  } else {\n    if (a % 4 == 0 && a % 100 != 0) {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 60 + c;\n      if (b == 4)\n        d = 91 + c;\n      if (b == 5)\n        d = 121 + c;\n      if (b == 6)\n        d = 152 + c;\n      if (b == 7)\n        d = 182 + c;\n      if (b == 8)\n        d = 213 + c;\n      if (b == 9)\n        d = 244 + c;\n      if (b == 10)\n        d = 275 + c;\n      if (b == 11)\n        d = 305 + c;\n      if (b == 12)\n        d = 335 + c;\n      printf(\"%d\", d);\n    } else {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 59 + c;\n      if (b == 4)\n        d = 90 + c;\n      if (b == 5)\n        d = 120 + c;\n      if (b == 6)\n        d = 151 + c;\n      if (b == 7)\n        d = 181 + c;\n      if (b == 8)\n        d = 212 + c;\n      if (b == 9)\n        d = 243 + c;\n      if (b == 10)\n        d = 274 + c;\n      if (b == 11)\n        d = 304 + c;\n      if (b == 12)\n        d = 334 + c;\n      printf(\"%d\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 400 == 0) || (a % 4 == 0 && a % 100 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    printf(\"%d\", d);\n  }\n\n  else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c + 31 + 30 + 31 + 30;\n\n    cout << d;\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20459", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, total, i;\n  cin >> year >> month >> day;\n  total = 0;\n  for (i = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      total = total + 31;\n\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n        total = total + 29;\n      else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  printf(\"%d\", total);\n  return 0;\n}\n"}
{"label": "11", "index": "20460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i, j, m = 0, n, r = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))\n    r = 1;\n  if (r == 1)\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 60;\n      break;\n    case 4:\n      m = 91;\n      break;\n    case 5:\n      m = 121;\n      break;\n    case 6:\n      m = 152;\n      break;\n    case 7:\n      m = 182;\n      break;\n    case 8:\n      m = 213;\n      break;\n    case 9:\n      m = 244;\n      break;\n    case 10:\n      m = 274;\n      break;\n    case 11:\n      m = 305;\n      break;\n    case 12:\n      m = 335;\n      break;\n    }\n  else\n    switch (b) {\n    case 2:\n      m = 31;\n      break;\n    case 3:\n      m = 59;\n      break;\n    case 4:\n      m = 90;\n      break;\n    case 5:\n      m = 120;\n      break;\n    case 6:\n      m = 151;\n      break;\n    case 7:\n      m = 181;\n      break;\n    case 8:\n      m = 212;\n      break;\n    case 9:\n      m = 243;\n      break;\n    case 10:\n      m = 273;\n      break;\n    case 11:\n      m = 304;\n      break;\n    case 12:\n      m = 334;\n      break;\n    }\n  n = m + c;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z;\n  cin >> x >> y >> z;\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else\n    D = n + z;\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, d = 0;\n\n  cin >> year >> month >> day;\n\n  switch (month) {\n  case 1:\n    d = 0;\n    break;\n  case 2:\n    d = 31;\n    break;\n\n  case 3:\n    d = 59;\n    break;\n\n  case 4:\n    d = 90;\n    break;\n\n  case 5:\n    d = 120;\n    break;\n\n  case 6:\n    d = 151;\n    break;\n\n  case 7:\n    d = 181;\n    break;\n\n  case 8:\n    d = 212;\n    break;\n\n  case 9:\n    d = 243;\n    break;\n\n  case 10:\n    d = 273;\n    break;\n\n  case 11:\n    d = 304;\n    break;\n\n  case 12:\n    d = 334;\n    break;\n  }\n  if ((month > 2) && (year % 400 == 0)) {\n    d = d + 1 + day;\n  } else if ((month > 2) && (year % 100 != 0) && (year % 4 == 0)) {\n    d = d + 1 + day;\n  }\n\n  else {\n    d = d + day;\n  }\n\n  printf(\"%d\\n\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int s = 0;\n  int i;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 100 != 0) & (year % 4 == 0))) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++)\n      s += n[i];\n\n    s = s + date;\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int daysa[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int daysb[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  int num = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  int i;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysa[i - 1];\n    }\n    num = num + d;\n  } else {\n    for (i = 1; i <= m - 1; i++) {\n      num = num + daysb[i - 1];\n    }\n    num = num + d;\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if (Y % 400 == 0 && Y % 4000 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      cout << D + 91;\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else if (Y % 4 == 0 && Y % 100 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 59);\n    if (M == 4)\n      cout << D + 90;\n    if (M == 5)\n      printf(\"%d\", D + 120);\n    if (M == 6)\n      printf(\"%d\", D + 150);\n    if (M == 7)\n      printf(\"%d\", D + 181);\n    if (M == 8)\n      printf(\"%d\", D + 212);\n    if (M == 9)\n      printf(\"%d\", D + 243);\n    if (M == 10)\n      cout << D + 273;\n    if (M == 11)\n      printf(\"%d\", D + 304);\n    if (M == 12)\n      printf(\"%d\", D + 334);\n  }\n}\n"}
{"label": "11", "index": "20466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, total;\n  int i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  total = 0;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    }\n    if (i == 2) {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  total = total + day;\n  cout << total;\n}\n"}
{"label": "11", "index": "20467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, D = 0, l, s;\n  l = 31;\n  s = 30;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    D = d;\n  else if (m == 2)\n    D = l + d;\n  else if (m == 3)\n    D = l + 28 + d;\n  else if (m == 4)\n    D = l * 2 + 28 + d;\n  else if (m == 5)\n    D = l * 2 + 28 + d + s;\n  else if (m == 6)\n    D = s + l * 3 + 28 + d;\n  else if (m == 7)\n    D = s * 2 + l * 3 + 28 + d;\n  else if (m == 8)\n    D = s * 2 + l * 4 + 28 + d;\n  else if (m == 9)\n    D = s * 2 + l * 5 + 28 + d;\n  else if (m == 10)\n    D = s * 3 + l * 5 + 28 + d;\n  else if (m == 11)\n    D = s * 3 + l * 6 + 28 + d;\n  else\n    D = s * 4 + l * 6 + 28 + d;\n  if (m > 2 && ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)))\n    D = D + 1;\n\n  cout << D << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0;\n  int i;\n\n  for (i = 0; i < month; i++) {\n    sum += a[i - 1];\n  }\n  sum = sum + day;\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month <= 2) {\n      cout << sum << \"\\n\";\n    }\n    if (month > 2) {\n      sum = sum + 1;\n      printf(\"%d\\n\", sum);\n    }\n  } else\n\n    cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int m = 0, n = 0;\n  cin >> year >> month >> date;\n  if (month == 1) {\n    n = date;\n  }\n  m = m + 31;\n  if (month == 2) {\n    n = m + date;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    m = m + 29;\n  } else {\n    m = m + 28;\n  }\n\n  if (month == 3) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 4) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 5) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 6) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 7) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 8) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 9) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 10) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 11) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 12) {\n    n = m + date;\n  }\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 != 0 || (a % 4 == 0 && a % 100 == 0 && a % 400 != 0)) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 28 + c;\n    if (b == 4)\n      d = 31 + 28 + 31 + c;\n    if (b == 5)\n      d = 31 + 28 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 28 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  } else {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 31 + 29 + c;\n    if (b == 4)\n      d = 31 + 29 + 31 + c;\n    if (b == 5)\n      d = 31 + 29 + 31 + 30 + c;\n    if (b == 6)\n      d = 31 + 29 + 31 + 30 + 31 + c;\n    if (b == 7)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n    if (b == 8)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n    if (b == 9)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    if (b == 10)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    if (b == 11)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    if (b == 12)\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n  }\n  cout << d << \"\\n\";\n}\n"}
{"label": "11", "index": "20471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[3] = {0}, b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      sum = 0, i;\n  scanf(\"%d %d %d \", &a[0], &a[1], &a[2]);\n  if (a[0] % 4 == 0 && a[0] % 100 != 0 || a[0] % 400 == 0) {\n    b[1] = 29;\n  }\n  for (i = 0; i < a[1] - 1; i++)\n    sum += b[i];\n  sum += a[2];\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "20472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, D;\n  int p[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  D = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || ((y % 400) == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      D = D + p[i];\n    }\n    D = D + d + 1;\n    printf(\"%d\", D);\n  } else {\n    for (i = 0; i < m - 1; i++) {\n      D = D + p[i];\n    }\n    D = D + d;\n    printf(\"%d\", D);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, n = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int ping[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (int i = 0; i < m - 1; i++)\n      n = n + ping[i];\n    n = n + d;\n  } else {\n    for (int i = 0; i < m - 1; i++)\n      n = n + run[i];\n    n = n + d;\n  }\n  printf(\"%d\\n\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Year, Month, Date;\n  int month;\n  int i;\n  int sum1 = 0, sum2 = 0;\n  cin >> Year >> Month >> Date;\n  month = Month - 1;\n  if (Year % 4 == 0 && Year % 400 == 0) {\n    int mday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  } else {\n    int mday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month; i++)\n      sum1 = sum1 + mday[i];\n  }\n  sum2 = sum1 + Date;\n  printf(\"\\n%d\", sum2);\n  return 0;\n}\n"}
{"label": "11", "index": "20475", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int day, month, year;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 29;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 29 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 29 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 29 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    }\n  } else {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 28;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 28 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 28 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 28 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    }\n  }\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int N[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + N[i - 1];\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    sum = sum + 1;\n  sum = sum + day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20477", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day, x;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 29 + day;\n    else if (month == 4)\n      x = 31 + 29 + 31 + day;\n    else if (month == 5)\n      x = 31 + 29 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 29 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 29 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 29 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  } else {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 28 + day;\n    else if (month == 4)\n      x = 31 + 28 + 31 + day;\n    else if (month == 5)\n      x = 31 + 28 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 28 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 28 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 28 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, sum = 0;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (int i = 0; i < b; i++)\n    sum = sum + month[i];\n\n  sum = sum + c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    sum = sum + 1;\n  }\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    n = c;\n    break;\n  case 2:\n    n = 31 + c;\n    break;\n  case 3:\n    n = 31 + 28 + c;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + c;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + c;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    break;\n  }\n  if (((a % 100 == 0 && a % 400 == 0) || (a % 400 == 0)) && b >= 3)\n    n = n + 1;\n  cout << n;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, y, r, d, i;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d%d%d\\n\", &n, &y, &r);\n    d = 0;\n    if ((y > 2) && (n % 400 == 0))\n      d = 1;\n    if ((y > 2) && (n % 100 != 0) && (n % 4 == 0))\n      d = 1;\n    d = d + r;\n    y--;\n    switch (y) {\n    case 11:\n      d = d + 30;\n    case 10:\n      d = d + 31;\n    case 9:\n      d = d + 30;\n    case 8:\n      d = d + 31;\n    case 7:\n      d = d + 31;\n    case 6:\n      d = d + 30;\n    case 5:\n      d = d + 31;\n    case 4:\n      d = d + 30;\n    case 3:\n      d = d + 31;\n    case 2:\n      d = d + 28;\n    case 1:\n      d = d + 31;\n    }\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, c, days;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  days = 0;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    m[2] = 29;\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  } else {\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0)) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 60);\n    else if (b == 4)\n      printf(\"%d\", c + 91);\n    else if (b == 5)\n      printf(\"%d\", c + 121);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 182);\n    else if (b == 8)\n      printf(\"%d\", c + 213);\n    else if (b == 9)\n      printf(\"%d\", c + 244);\n    else if (b == 10)\n      printf(\"%d\", c + 274);\n    else if (b == 11)\n      printf(\"%d\", c + 305);\n    else\n      printf(\"%d\", c + 335);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", c + 31);\n    else if (b == 3)\n      printf(\"%d\", c + 59);\n    else if (b == 4)\n      printf(\"%d\", c + 90);\n    else if (b == 5)\n      printf(\"%d\", c + 120);\n    else if (b == 6)\n      printf(\"%d\", c + 152);\n    else if (b == 7)\n      printf(\"%d\", c + 181);\n    else if (b == 8)\n      printf(\"%d\", c + 212);\n    else if (b == 9)\n      printf(\"%d\", c + 243);\n    else if (b == 10)\n      printf(\"%d\", c + 273);\n    else if (b == 11)\n      printf(\"%d\", c + 304);\n    else\n      printf(\"%d\", c + 334);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> a >> b >> c;\n  int sum = 0, i;\n  for (i = 0; i < b - 1; i++) {\n    sum = sum + f[i];\n  }\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n\n    if (b < 3) {\n      d = sum + c;\n    } else {\n      d = sum + 1 + c;\n    }\n  } else {\n    d = sum + c;\n  }\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20484", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0, N;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 100 != 0 && y % 4 == 0) {\n    int p[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > p[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + p[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  } else if (y % 4 != 0) {\n    int q[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (d < 1 || d > q[m])\n      printf(\"Illegal input.\\n\");\n    else {\n      int j;\n      for (j = 0; j < m; j++) {\n        n = n + q[j];\n      }\n      N = n + d;\n      printf(\"%d\\n\", N);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20485", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    cin >> a >> b >> c;\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else\n          d = d + 28;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j++;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[13], X, B;\n  int N;\n  scanf(\"%d %d %d \", &N, &X, &B);\n  if (N % 100)\n    if (N % 4 == 0)\n      A[2] = 29;\n    else\n      A[2] = 28;\n  else if (N % 400 == 0)\n    A[2] = 29;\n  else\n    A[2] = 28;\n  A[1] = A[3] = A[5] = A[7] = A[8] = A[10] = A[11] = 31;\n  A[4] = A[6] = A[9] = A[11] = 30;\n  int Ans = B;\n  for (int I = 1; I < X; I++)\n    Ans += A[I];\n  cout << Ans << endl;\n}\n"}
{"label": "11", "index": "20487", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, day;\n  scanf(\"%d \", &year);\n  scanf(\"%d \", &month);\n  scanf(\"%d\", &day);\n  if (month == 2)\n    printf(\"%d\", 31 + day);\n  else if (month == 1)\n    printf(\"%d\", day);\n  else {\n    if (month == 3)\n      day = day + 59;\n    if (month == 4)\n      day = day + 90;\n    if (month == 5)\n      day = day + 120;\n    if (month == 6)\n      day = day + 151;\n    if (month == 7)\n      day = day + 181;\n    if (month == 8)\n      day = day + 212;\n    if (month == 9)\n      day = day + 243;\n    if (month == 10)\n      day = day + 273;\n    if (month == 11)\n      day = day + 304;\n    if (month == 12)\n      day = day + 334;\n    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n      printf(\"%d\", day + 1);\n    else\n      printf(\"%d\", day);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100) != 0) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 6) {\n      d = 152 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(int year) {\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    return 1;\n  } else\n    return 0;\n}\nint main() {\n  int year, month, day, date = 0;\n  cin >> year;\n  cin >> month;\n  cin >> day;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int i;\n  for (i = 1; i < month; i++) {\n    date = date + m[i];\n    if (i == 2) {\n      date = date + check(year);\n    }\n  }\n  date = date + day;\n\n  printf(\"%d\\n\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "20490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a, b, c;\n  int i = 1;\nloop:\n  if (i <= 5) {\n    int n = 0;\n    cin >> a >> b >> c;\n    switch (b) {\n    case 12:\n      n = n + 30;\n    case 11:\n      n = n + 31;\n    case 10:\n      n = n + 30;\n    case 9:\n      n = n + 31;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 30;\n    case 6:\n      n = n + 31;\n    case 5:\n      n = n + 30;\n    case 4:\n      n = n + 31;\n    case 3:\n      n = n + 28;\n    case 2:\n      n = n + 31;\n    case 1:\n      n = n + c;\n      break;\n    }\n    if (((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) && b >= 3)\n      n = n + 1;\n    printf(\"%d\\n\", n);\n    i++;\n    goto loop;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20491", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, r, b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int c[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0,\n      q;\n  cin >> n >> y >> r;\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + b[i];\n    sum = sum + r;\n    cout << sum;\n  } else {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + c[i];\n    sum = sum + r;\n    cout << sum;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "11", "index": "20492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, month2, n;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    month2 = 29;\n  else\n    month2 = 28;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 31 + month2 + day;\n  if (month == 4)\n    n = 31 + month2 + 31 + day;\n  if (month == 5)\n    n = 31 + month2 + 31 + 30 + day;\n  if (month == 6)\n    n = 31 + month2 + 31 + 30 + 31 + day;\n  if (month == 7)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + day;\n  if (month == 8)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == 9)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == 10)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == 11)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == 12)\n    n = 31 + month2 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20493", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint run(int nian) {\n  if (nian % 400 == 0)\n    return 1;\n  else if (nian % 100 == 0)\n    return 0;\n  else if (nian % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint mon(int m, int n) {\n  switch (m) {\n  case 1:\n  case 3:\n  case 5:\n  case 7:\n  case 8:\n  case 10:\n    return 31;\n  case 4:\n  case 6:\n  case 9:\n  case 11:\n    return 30;\n  default:\n    if (run(n))\n      return 29;\n    else\n      return 28;\n  }\n}\n\nint main() {\n  int year, month, day, date, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  date = 0;\n  for (i = 1; i < month; i++)\n    date = date + mon(i, year);\n  date = date + day;\n  printf(\"%d\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "20494", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, a;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 400 == 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 == 0 && y % 400 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 28 + d;\n      break;\n    case 4:\n      a = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  } else if (y % 4 == 0 && y % 100 != 0) {\n    switch (m) {\n    case 1:\n      a = d;\n      break;\n    case 2:\n      a = 31 + d;\n      break;\n    case 3:\n      a = 31 + 29 + d;\n      break;\n    case 4:\n      a = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      a = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      a = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, g, i, e = 0, day;\n  int montha[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int monthb[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d%d%d\", &year, &mon, &g);\n\n  for (i = 0; i < mon; i++) {\n    if (year % 4 == 0) {\n      if (year % 100 == 0 && year % 400 != 0) {\n        e = e + montha[i];\n\n        day = e + g;\n      } else {\n        e = e + monthb[i];\n        day = e + g;\n      }\n    }\n    if (year % 4 != 0) {\n      e = e + montha[i];\n      day = e + g;\n    }\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  cin >> year >> month >> day;\n  int pin[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + run[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  } else {\n    if (month >= 2) {\n      for (i = 0; i <= month - 2; i++) {\n        n = n + pin[i];\n      }\n      n = n + day;\n    }\n    if (month == 1) {\n      n = day;\n    }\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, a[20], b[20], c[20], x, day;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 1; i <= 5; i++) {\n    if (a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 29;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 29 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 29 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 29 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    } else {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 28;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 28 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 28 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 28 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d \", day);\n  }\n}\n"}
{"label": "11", "index": "20498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n) {\n  cin >> n;\n  if (n % 100 == 0) {\n    if (n % 400 == 0)\n      return 1;\n    else\n      return 0;\n  } else if (n % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int y, m, d;\n  cin >> y >> m >> d;\n  int t = 0, i;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 5 || i == 3 || i == 7 || i == 8 || i == 10)\n      t = t + 31;\n    else if (i == 2)\n      t = t + 28;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      t = t + 30;\n  }\n  t = t + d;\n  if (f(y) == 1 && m > 2)\n    t = t + 1;\n  cout << t << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20499", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum = 0;\n  cin >> year >> month >> day;\n  int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (int i = 0; i <= month - 1; i++) {\n    if (i == month - 1)\n      sum += day;\n    else {\n      if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n        sum += m2[i];\n      else\n        sum += m1[i];\n    }\n  }\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20500", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  int k[20];\n  k[1] = 31;\n  k[2] = 28;\n  k[3] = 31;\n  k[4] = 30;\n  k[5] = 31;\n  k[6] = 30;\n  k[7] = 31;\n  k[8] = 31;\n  k[9] = 30;\n  k[10] = 31;\n  k[11] = 30;\n  k[12] = 31;\n  int i = 1;\n  int sum = 0;\n  while (i < b) {\n    sum = sum + k[i];\n    i++;\n  }\n  sum = sum + c;\n  if (b > 2) {\n    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0)\n\n      sum++;\n  }\n  printf(\"%d\\n\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int year) {\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day;\n  int days, i;\n  days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      days += 31;\n    }\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    if (i == 2) {\n      if (leap(year))\n        days += 29;\n      else {\n        days += 28;\n      }\n    }\n  }\n  days += day;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, sum = 0;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      sum += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      sum += 30;\n    }\n    if (i == 2 && y % 400 == 0 || y % 4 == 0 && y % 100 != 0)\n      sum = sum + 29;\n    else if (i == 2)\n      sum += 28;\n  }\n  sum = sum + d;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  result = (month - 1) * 30 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8) {\n      result = result + 3;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n  } else {\n    if (month == 2) {\n      result = result + 1;\n    }\n    if (month == 3) {\n      result = result - 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 1;\n    }\n    if (month == 8) {\n      result = result + 2;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 3;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 4;\n    }\n  }\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    d = c;\n    break;\n  case 2:\n    d = 31 + c;\n    break;\n  case 3:\n    d = 29 + 31 + c;\n    break;\n  case 4:\n    d = 29 + 31 + 31 + c;\n    break;\n  case 5:\n    d = 29 + 31 + 31 + 30 + c;\n    break;\n  case 6:\n    d = 29 + 31 * 3 + 30 + c;\n    break;\n  case 7:\n    d = 29 + 31 * 3 + 60 + c;\n    break;\n  case 8:\n    d = 29 + 31 * 4 + 60 + c;\n    break;\n  case 9:\n    d = 29 + 31 * 5 + 60 + c;\n    break;\n  case 10:\n    d = 29 + 31 * 5 + 90 + c;\n    break;\n  case 11:\n    d = 29 + 31 * 6 + 90 + c;\n    break;\n  case 12:\n    d = 29 + 31 * 6 + 120 + c;\n    break;\n    cout << d;\n  }\n  if ((a % 4 != 0 || a % 100 == 0 && a % 400 != 0) && b > 2)\n    d = d - 1;\n  printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, daysum = 0;\n  cin >> y >> m >> d;\n  int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int dayleap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((y % 4 != 0) || ((y % 100 == 0) && (y % 400 != 0))) {\n    for (int i = 0; i < m; i++)\n      daysum += day[i];\n    daysum += d;\n  } else {\n    for (int i = 0; i < m; i++)\n      daysum += dayleap[i];\n    daysum += d;\n  }\n  cout << daysum;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, t, i;\n  for (i = 1; i <= 5;) {\n    scanf(\"%d %d %d\", &y, &m, &d);\n    if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 60;\n        break;\n      case 4:\n        t = d + 91;\n        break;\n      case 5:\n        t = d + 121;\n        break;\n      case 6:\n        t = d + 152;\n        break;\n      case 7:\n        t = d + 182;\n        break;\n      case 8:\n        t = d + 213;\n        break;\n      case 9:\n        t = d + 244;\n        break;\n      case 10:\n        t = d + 274;\n        break;\n      case 11:\n        t = d + 305;\n        break;\n      case 12:\n        t = d + 335;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 59;\n        break;\n      case 4:\n        t = d + 90;\n        break;\n      case 5:\n        t = d + 120;\n        break;\n      case 6:\n        t = d + 151;\n        break;\n      case 7:\n        t = d + 181;\n        break;\n      case 8:\n        t = d + 212;\n        break;\n      case 9:\n        t = d + 243;\n        break;\n      case 10:\n        t = d + 273;\n        break;\n      case 11:\n        t = d + 304;\n        break;\n      case 12:\n        t = d + 334;\n        break;\n      }\n    }\n    cout << t << \"\\n\";\n    i++;\n  }\n}\n"}
{"label": "11", "index": "20507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n               b[12] = {0}, i;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || y % 100 == 0 && y % 400 != 0)\n    a[1] = 28;\n  else\n    a[1] = 29;\n  for (i = 1; i < 12; i++) {\n    b[0] = a[0];\n    b[i] = b[i - 1] + a[i];\n  }\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  else if (m != 1)\n    cout << b[m - 2] + d << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[3], leap = 1, day;\n  scanf(\"%d %d %d\", &a[0], &a[1], &a[2]);\n  if ((((a[0] % 4) && !(a[0] % 100))) || (a[0] % 400))\n    leap = 0;\n  if (a[1] == 1)\n    day = a[2];\n  if (a[1] == 2)\n    day = a[2] + 31;\n  if (a[1] == 3)\n    day = a[2] + 59 + leap;\n  if (a[1] == 4)\n    day = a[2] + 90 + leap;\n  if (a[1] == 5)\n    day = a[2] + 120 + leap;\n  ;\n  if (a[1] == 6)\n    day = a[2] + 151 + leap;\n  if (a[1] == 7)\n    day = a[2] + 181 + leap;\n  if (a[1] == 8)\n    day = a[2] + 212 + leap;\n  if (a[1] == 9)\n    day = a[2] + 243 + leap;\n  if (a[1] == 10)\n    day = a[2] + 273 + leap;\n  if (a[1] == 11)\n    day = a[2] + 304 + leap;\n  if (a[1] == 12)\n    day = a[2] + 334 + leap;\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n\n    for (int i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 ||\n          i == 12) {\n        t += 31;\n      } else {\n        if (i == 4 || i == 6 || i == 9 || i == 11) {\n          t += 30;\n        } else {\n          t += 29;\n        }\n      }\n    }\n  } else {\n    for (int j = 1; j < b; j++) {\n      if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 ||\n          j == 12) {\n        t += 31;\n      } else {\n        if (j == 4 || j == 6 || j == 9 || j == 11) {\n          t += 30;\n        } else {\n          t += 28;\n        }\n      }\n    }\n  }\n  t = t + c;\n\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "20510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint GetMonthDays(int year, int month);\nint CheckLeap(int year);\nint main() {\n  int year, month, day = 1, s = 0, i;\n  cin >> year >> month >> day;\n  for (i = 1; i < month; i++)\n    s += GetMonthDays(year, i);\n\n  s += day;\n  printf(\"%d\", s);\n  return 0;\n}\n\nint GetMonthDays(int year, int month) {\n  int day;\n  if (month == 4 || month == 6 || month == 9 || month == 11)\n    day = 30;\n  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 ||\n      month == 10 || month == 12)\n    day = 31;\n  if (month == 2) {\n    if (CheckLeap(year) == 1)\n      day = 29;\n    if (CheckLeap(year) == 0)\n      day = 28;\n  }\n  return day;\n}\n\nint CheckLeap(int year) {\n  int jugde = 0;\n  if (year % 100 != 0) {\n    if (year % 4 == 0)\n      jugde = 1;\n  }\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      jugde = 1;\n  }\n  return jugde;\n}\n"}
{"label": "11", "index": "20511", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e[12], i;\n  e[1] = e[3] = e[5] = e[7] = e[8] = e[10] = e[12] = 31;\n  e[2] = 28;\n  e[4] = e[6] = e[9] = e[11] = 30;\n  d = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if ((a % 4 != 0) || (a % 100 == 0 && a % 400 != 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + e[i];\n    }\n    d = d + c;\n  } else {\n    if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n      for (i = 1; i < b; i++) {\n        e[2] = 29;\n        d = d + e[i];\n      }\n      d = d + c;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, d, n;\n  scanf(\"%d\", &y);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    scanf(\"%d%d\", &m, &d);\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 29 + d;\n    }\n    if (m == 4) {\n      n = 31 + 29 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 29 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 29 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31;\n    }\n    if (m == 9) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 29 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d\", n);\n\n  } else {\n    cin >> m >> d;\n    if (m == 1) {\n      n = d;\n    }\n    if (m == 2) {\n      n = 31 + d;\n    }\n    if (m == 3) {\n      n = 31 + 28 + d;\n    }\n    if (m == 4) {\n      n = 31 + 28 + d + 31;\n    }\n    if (m == 5) {\n      n = 31 + 28 + d + 31 + 30;\n    }\n    if (m == 6) {\n      n = 31 + 28 + d + 31 + 30 + 31;\n    }\n    if (m == 7) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30;\n    }\n    if (m == 8)\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31;\n\n    if (m == 9) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31;\n    }\n    if (m == 10) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    }\n    if (m == 11) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    }\n    if (m == 12) {\n      n = 31 + 28 + d + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    cout << n;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20513", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, mounth, day, count = 0, t = 0;\n  scanf(\"%d%d%d\", &year, &mounth, &day);\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    count = 1;\n  } else {\n    count = 0;\n  }\n  if (count == 1) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 60 + day;\n      break;\n    case 4:\n      t = 91 + day;\n      break;\n    case 5:\n      t = 121 + day;\n      break;\n    case 6:\n      t = 152 + day;\n      break;\n    case 7:\n      t = 182 + day;\n      break;\n    case 8:\n      t = 213 + day;\n      break;\n    case 9:\n      t = 244 + day;\n      break;\n    case 10:\n      t = 274 + day;\n      break;\n    case 11:\n      t = 305 + day;\n      break;\n    case 12:\n      t = 335 + day;\n      break;\n    }\n  }\n  if (count == 0) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 59 + day;\n      break;\n    case 4:\n      t = 90 + day;\n      break;\n    case 5:\n      t = 120 + day;\n      break;\n    case 6:\n      t = 151 + day;\n      break;\n    case 7:\n      t = 181 + day;\n      break;\n    case 8:\n      t = 212 + day;\n      break;\n    case 9:\n      t = 243 + day;\n      break;\n    case 10:\n      t = 273 + day;\n      break;\n    case 11:\n      t = 304 + day;\n      break;\n    case 12:\n      t = 334 + day;\n      break;\n    }\n  }\n  printf(\"%d\", t);\n}\n"}
{"label": "11", "index": "20514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, number = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i <= m - 1; i++)\n      number = number + b[i - 1];\n    number = number + d;\n  } else {\n    for (i = 1; i <= m - 1; i++)\n      number = number + a[i - 1];\n    number = number + d;\n  }\n  cout << number << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, sum = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1)\n    sum = 0;\n  else if (b == 2)\n    sum = 31;\n  else {\n    sum = 31;\n    if ((a % 400 == 0) || (a % 4 == 0 && a % 100 != 0))\n      sum = sum + 29;\n    else\n      sum = sum + 28;\n    for (i = 3; i < b; i++) {\n      if (i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        sum = sum + 31;\n      if (i == 4 || i == 6 || i == 9 || i == 11)\n        sum = sum + 30;\n    }\n  }\n  sum = sum + c;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int d[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++) {\n      day = day + d[i];\n    }\n\n  } else {\n    int d[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 0; i < month; i++)\n      day = day + d[i];\n  }\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, d;\n  cin >> x >> y >> z;\n  if ((x % 100 != 0 && x % 4 == 0) || (x % 100 == 0 && x % 400 == 0)) {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 29;\n      break;\n    case 4:\n      d = z + 31 + 29 + 31;\n      break;\n    case 5:\n      d = z + 31 + 29 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 29 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      d = z;\n      break;\n    case 2:\n      d = z + 31;\n      break;\n    case 3:\n      d = z + 31 + 28;\n      break;\n    case 4:\n      d = z + 31 + 28 + 31;\n      break;\n    case 5:\n      d = z + 31 + 28 + 31 + 30;\n      break;\n    case 6:\n      d = z + 31 + 28 + 31 + 30 + 31;\n      break;\n    case 7:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    case 8:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    case 9:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    case 10:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    case 11:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    case 12:\n      d = z + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    default:;\n    }\n  }\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int year, month, day, which;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  which = day;\n  month--;\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    if (year % 4 != 0)\n      which += 28;\n    else if (year % 100 == 0 && year % 400 != 0)\n      which += 28;\n    else {\n      which += 29;\n    }\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  if (month > 0) {\n    which += 31;\n    month--;\n  }\n  if (month > 0) {\n    which += 30;\n    month--;\n  }\n  printf(\"%d\", which);\n  return 0;\n}\n"}
{"label": "11", "index": "20519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Y, M, D;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if (Y % 400 == 0 && Y % 4000 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else if (Y % 4 == 0 && Y % 100 != 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 60);\n    if (M == 4)\n      printf(\"%d\", D + 91);\n    if (M == 5)\n      printf(\"%d\", D + 121);\n    if (M == 6)\n      printf(\"%d\", D + 151);\n    if (M == 7)\n      printf(\"%d\", D + 182);\n    if (M == 8)\n      printf(\"%d\", D + 213);\n    if (M == 9)\n      printf(\"%d\", D + 244);\n    if (M == 10)\n      printf(\"%d\", D + 274);\n    if (M == 11)\n      printf(\"%d\", D + 305);\n    if (M == 12)\n      printf(\"%d\", D + 335);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", D + 31);\n    if (M == 3)\n      printf(\"%d\", D + 59);\n    if (M == 4)\n      cout << D + 90;\n    if (M == 5)\n      printf(\"%d\", D + 120);\n    if (M == 6)\n      printf(\"%d\", D + 150);\n    if (M == 7)\n      printf(\"%d\", D + 181);\n    if (M == 8)\n      printf(\"%d\", D + 212);\n    if (M == 9)\n      printf(\"%d\", D + 243);\n    if (M == 10)\n      printf(\"%d\", D + 273);\n    if (M == 11)\n      printf(\"%d\", D + 304);\n    if (M == 12)\n      printf(\"%d\", D + 334);\n  }\n}\n"}
{"label": "11", "index": "20520", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, date;\n  int a, b, c, e, g, h, j;\n  int d, f, i, k;\n\n  a = c = e = g = h = j = 31;\n  d = f = i = k = 30;\n\n  cin >> year >> month >> date;\n\n  if ((year % 4 != 0) || (year % 100 == 0 && year % 400 != 0))\n    b = 28;\n  else\n    b = 29;\n\n  switch (month) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = a + date;\n    break;\n  case 3:\n    day = a + b + date;\n    break;\n  case 4:\n    day = a + b + c + date;\n    break;\n  case 5:\n    day = a + b + c + d + date;\n    break;\n  case 6:\n    day = a + b + c + d + e + date;\n    break;\n  case 7:\n    day = a + b + c + d + e + f + date;\n    break;\n  case 8:\n    day = a + b + c + d + e + f + g + date;\n    break;\n  case 9:\n    day = a + b + c + d + e + f + g + h + date;\n    break;\n  case 10:\n    day = a + b + c + d + e + f + g + h + i + date;\n    break;\n  case 11:\n    day = a + b + c + d + e + f + g + h + i + j + date;\n    break;\n  case 12:\n    day = a + b + c + d + e + f + g + h + i + j + k + date;\n    break;\n  }\n\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1, day;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month1 >> day;\n  int i;\n  int sum = 0;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    month[2] = month[2] + 1;\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  } else {\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  }\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0) {\n    if (b == 1)\n      d = c;\n    if (b == 2)\n      d = 31 + c;\n    if (b == 3)\n      d = 60 + c;\n    if (b == 4)\n      d = 91 + c;\n    if (b == 5)\n      d = 121 + c;\n    if (b == 6)\n      d = 152 + c;\n    if (b == 7)\n      d = 182 + c;\n    if (b == 8)\n      d = 213 + c;\n    if (b == 9)\n      d = 244 + c;\n    if (b == 10)\n      d = 275 + c;\n    if (b == 11)\n      d = 305 + c;\n    if (b == 12)\n      d = 335 + c;\n    printf(\"%d\", d);\n  } else {\n    if (a % 4 == 0 && a % 100 != 0) {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 60 + c;\n      if (b == 4)\n        d = 91 + c;\n      if (b == 5)\n        d = 121 + c;\n      if (b == 6)\n        d = 152 + c;\n      if (b == 7)\n        d = 182 + c;\n      if (b == 8)\n        d = 213 + c;\n      if (b == 9)\n        d = 244 + c;\n      if (b == 10)\n        d = 275 + c;\n      if (b == 11)\n        d = 305 + c;\n      if (b == 12)\n        d = 335 + c;\n      printf(\"%d\", d);\n    } else {\n      if (b == 1)\n        d = c;\n      if (b == 2)\n        d = 31 + c;\n      if (b == 3)\n        d = 59 + c;\n      if (b == 4)\n        d = 90 + c;\n      if (b == 5)\n        d = 120 + c;\n      if (b == 6)\n        d = 151 + c;\n      if (b == 7)\n        d = 181 + c;\n      if (b == 8)\n        d = 212 + c;\n      if (b == 9)\n        d = 243 + c;\n      if (b == 10)\n        d = 274 + c;\n      if (b == 11)\n        d = 304 + c;\n      if (b == 12)\n        d = 334 + c;\n      printf(\"%d\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int a) {\n  int z;\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    z = 1;\n  else\n    z = 0;\n  return z;\n}\nint main() {\n  int i, m;\n  int n[5][3];\n  int total[5];\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d %d %d\", &n[i][0], &n[i][1], &n[i][2]);\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i <= 4; i++) {\n    month[1] = 28 + leap(n[i][0]);\n    total[i] = 0;\n    for (m = 0; m <= n[i][1] - 2; m++)\n      total[i] = total[i] + month[m];\n    total[i] = total[i] + n[i][2];\n    printf(\"%d\\n\", total[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z;\n  cin >> x >> y >> z;\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else {\n    D = n + z;\n  }\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "20525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  switch (b) {\n  case 1:\n    n = c;\n    break;\n  case 2:\n    n = 31 + c;\n    break;\n  case 3:\n    n = 31 + 28 + c;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + c;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + c;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    break;\n  }\n  if (((a % 100 == 0 && a % 400 == 0) || (a % 400 == 0)) && b >= 3)\n    n = n + 1;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20526", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, d, i, counter = 0,\n                  month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> n >> m >> d;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      counter += month2[i];\n    }\n    counter += d;\n    cout << counter << endl;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      counter += month1[i];\n    counter += d;\n    printf(\"%d\\n\", counter);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[3] = {0}, b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      sum = 0, i;\n  cin >> a[0] >> a[1] >> a[2];\n  if (a[0] % 4 == 0 && a[0] % 100 != 0 || a[0] % 400 == 0)\n    b[1] = 29;\n  for (i = 0; i < a[1] - 1; i++)\n    sum += b[i];\n  sum += a[2];\n  cout << sum;\n}\n"}
{"label": "11", "index": "20528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    day[1] = 29;\n  for (int i = 0; i < m - 1; i++)\n    d += day[i];\n  cout << d;\n  return 0;\n}\n"}
{"label": "11", "index": "20529", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 60 + d);\n      break;\n    case 4:\n      printf(\"%d\", 91 + d);\n      break;\n    case 5:\n      printf(\"%d\", 121 + d);\n      break;\n    case 6:\n      printf(\"%d\", 152 + d);\n      break;\n    case 7:\n      printf(\"%d\", 182 + d);\n      break;\n    case 8:\n      printf(\"%d\", 213 + d);\n      break;\n    case 9:\n      printf(\"%d\", 244 + d);\n      break;\n    case 10:\n      printf(\"%d\", 274 + d);\n      break;\n    case 11:\n      printf(\"%d\", 305 + d);\n      break;\n    case 12:\n      printf(\"%d\", 335 + d);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", 31 + d);\n      break;\n    case 3:\n      printf(\"%d\", 59 + d);\n      break;\n    case 4:\n      printf(\"%d\", 90 + d);\n      break;\n    case 5:\n      printf(\"%d\", 120 + d);\n      break;\n    case 6:\n      printf(\"%d\", 151 + d);\n      break;\n    case 7:\n      printf(\"%d\", 181 + d);\n      break;\n    case 8:\n      printf(\"%d\", 212 + d);\n      break;\n    case 9:\n      printf(\"%d\", 243 + d);\n      break;\n    case 10:\n      printf(\"%d\", 273 + d);\n      break;\n    case 11:\n      printf(\"%d\", 304 + d);\n      break;\n    case 12:\n      printf(\"%d\", 334 + d);\n      break;\n    }\n  }\n}\n"}
{"label": "11", "index": "20530", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, n, i;\n  cin >> year >> month >> day;\n  if (year % 100 == 0)\n    i = 400;\n  else\n    i = 4;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3) {\n    if (year % i == 0)\n      n = 31 + 29 + day;\n    else\n      n = 31 + 28 + day;\n  }\n  if (month == 4) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + day;\n    else\n      n = 31 + 28 + 31 + day;\n  }\n  if (month == 5) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + day;\n  }\n  if (month == 6) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + day;\n  }\n  if (month == 7) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + day;\n  }\n  if (month == 8) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n  }\n  if (month == 9) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  }\n  if (month == 10) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  }\n  if (month == 11) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  }\n  if (month == 12) {\n    if (year % i == 0)\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int Y, M, D, sum = 0, i;\n  scanf(\"%d %d %d\", &Y, &M, &D);\n  if ((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) {\n    for (i = 1; i <= M - 1; i++) {\n      sum += y[i - 1];\n    }\n    sum = sum + D;\n  } else {\n    for (i = 1; i <= M - 1; i++) {\n      sum += +x[i - 1];\n    };\n    sum = sum + D;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year[5], mon[5], day[5], sum = 0, i, j;\n  for (j = 0; j < 5; j++)\n    scanf(\"%d%d%d\", &year[j], &mon[j], &day[j]);\n  for (j = 0; j < 5; j++) {\n    if (year[j] % 400 == 0)\n      a[1] = 29;\n    else if (year[j] % 4 == 0) {\n      if (year[j] % 100 == 0)\n        a[1] = 28;\n      else\n        a[1] = 29;\n    }\n    for (i = 0; i <= (mon[j] - 2); i++) {\n      sum = sum + a[i];\n    }\n    sum = sum + day[j];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, mon, g, i, e = 0, day;\n  int montha[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int monthb[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d%d%d\", &year, &mon, &g);\n\n  for (i = 0; i < mon; i++) {\n    if (year % 4 == 0) {\n      if (year % 100 == 0 && year % 400 != 0) {\n        e = e + montha[i];\n\n        day = e + g;\n      } else {\n        e = e + monthb[i];\n        day = e + g;\n      }\n    }\n    if (year % 4 != 0) {\n      e = e + montha[i];\n      day = e + g;\n    }\n  }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "20534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int day, month, year;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 29;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 29 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 29 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 29 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    }\n  } else {\n    switch (month) {\n    case 1: {\n      day = day;\n      break;\n    }\n    case 2: {\n      day = day + 31;\n      break;\n    }\n    case 3: {\n      day = day + 31 + 28;\n      break;\n    }\n    case 4: {\n      day = day + 31 + 28 + 31;\n      break;\n    }\n    case 5: {\n      day = day + 31 + 28 + 31 + 30;\n      break;\n    }\n    case 6: {\n      day = day + 31 + 28 + 31 + 30 + 31;\n      break;\n    }\n    case 7: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30;\n      break;\n    }\n    case 8: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      break;\n    }\n    case 9: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      break;\n    }\n    case 10: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      break;\n    }\n    case 11: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      break;\n    }\n    case 12: {\n      day = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      break;\n    }\n    }\n  }\n  cout << day << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, y, m, d, D;\n  int total = 0;\n\n  scanf(\"%d %d %d \", &y, &m, &d);\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      total = total + 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      total = total + 30;\n    } else {\n      if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n        total = total + 29;\n      } else {\n        total = total + 28;\n      }\n    }\n  }\n  D = total + d;\n  cout << D;\n  return 0;\n}\n"}
{"label": "11", "index": "20536", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 > 0 || a % 400 == 0) {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2) {\n        sum += 29;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  } else {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        sum += 31;\n      else if (i == 2) {\n        sum += 28;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, d = 0;\n  cin >> a >> b >> c;\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      d = d + 31;\n    else\n      d = d + 30;\n  }\n  if (i <= 2)\n    d = d;\n  else if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    d = d - 1;\n  else\n    d = d - 2;\n  d = d + c;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstatic int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nstatic int isleapyear(int year) {\n  return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}\n\nint main() {\n  int year, month, day;\n  int j;\n\n  for (j = 0; j < 5; j++) {\n    int n = 0;\n    int i;\n    scanf(\"%d %d %d\", &year, &month, &day);\n\n    if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (isleapyear(year) && month != 2 && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n    if (!isleapyear(year) && (day < 1 || day > days[month])) {\n      printf(\"Illegal input.\\n\");\n      return -1;\n    }\n\n    for (i = 1; i < month; i++) {\n      n += days[i];\n    }\n\n    n += day;\n\n    if (month > 2 && isleapyear(year))\n      n++;\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int f[22];\n  scanf(\"%d %d %d\", &y, &m, &d);\n  f[0] = 31 + d;\n  f[1] = 60 + d;\n  f[2] = 91 + d;\n  f[3] = 121 + d;\n  f[4] = 152 + d;\n  f[5] = 182 + d;\n  f[6] = 213 + d;\n  f[7] = 244 + d;\n  f[8] = 274 + d;\n  f[9] = 305 + d;\n  f[10] = 335 + d;\n  f[11] = 31 + d;\n  f[12] = 59 + d;\n  f[13] = 90 + d;\n  f[14] = 120 + d;\n  f[15] = 151 + d;\n  f[16] = 181 + d;\n  f[17] = 212 + d;\n  f[18] = 243 + d;\n  f[19] = 273 + d;\n  f[20] = 304 + d;\n  f[21] = 334 + d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      cout << f[0];\n      break;\n    case 3:\n      printf(\"%d\", f[1]);\n      break;\n    case 4:\n      printf(\"%d\", f[2]);\n      break;\n    case 5:\n      printf(\"%d\", f[3]);\n      break;\n    case 6:\n      printf(\"%d\", f[4]);\n      break;\n    case 7:\n      printf(\"%d\", f[5]);\n      break;\n    case 8:\n      printf(\"%d\", f[6]);\n      break;\n    case 9:\n      printf(\"%d\", f[7]);\n      break;\n    case 10:\n      printf(\"%d\", f[8]);\n      break;\n    case 11:\n      printf(\"%d\", f[9]);\n      break;\n    case 12:\n      printf(\"%d\", f[10]);\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", f[11]);\n      break;\n    case 3:\n      printf(\"%d\", f[12]);\n      break;\n    case 4:\n      printf(\"%d\", f[13]);\n      break;\n    case 5:\n      printf(\"%d\", f[14]);\n      break;\n    case 6:\n      printf(\"%d\", f[15]);\n      break;\n    case 7:\n      printf(\"%d\", f[16]);\n      break;\n    case 8:\n      printf(\"%d\", f[17]);\n      break;\n    case 9:\n      printf(\"%d\", f[18]);\n      break;\n    case 10:\n      printf(\"%d\", f[19]);\n      break;\n    case 11:\n      printf(\"%d\", f[20]);\n      break;\n    case 12:\n      printf(\"%d\", f[21]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year;\n  int month;\n  int day;\n  int z;\n  z = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int m[12];\n  m[0] = 31;\n  if (year % 4 == 0) {\n    m[1] = 29;\n    if (year % 100 == 0)\n      m[1] = 28;\n    if (year % 400 == 0)\n      m[1] = 29;\n  } else\n    m[1] = 28;\n  m[2] = 31;\n  m[3] = 30;\n  m[4] = 31;\n  m[5] = 30;\n  m[6] = 31;\n  m[7] = 31;\n  m[8] = 30;\n  m[9] = 31;\n  m[10] = 30;\n  m[11] = 31;\n  int i;\n  for (i = 0; i < month - 1; i++)\n    z = z + m[i];\n  cout << z + day << \" \";\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint isrunnian(int year) {\n  if (year % 400 == 0)\n    return 1;\n  else if (year % 4 == 0 && year % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  else if (m == 2)\n    printf(\"%d\\n\", 31 + d);\n  else if (m == 3) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + d);\n  } else if (m == 4) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + d);\n  } else if (m == 5) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + d);\n  } else if (m == 6) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 30 + 31 + 31 + d);\n  } else if (m == 7) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + d);\n  } else if (m == 8) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + d);\n  } else if (m == 9) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n  } else if (m == 10) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n  } else if (m == 11) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n  } else if (m == 12) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 60 + c;\n      break;\n    case 4:\n      d = 91 + c;\n      break;\n    case 5:\n      d = 121 + c;\n      break;\n    case 6:\n      d = 152 + c;\n      break;\n    case 7:\n      d = 182 + c;\n      break;\n    case 8:\n      d = 213 + c;\n      break;\n    case 9:\n      d = 244 + c;\n      break;\n    case 10:\n      d = 274 + c;\n      break;\n    case 11:\n      d = 305 + c;\n      break;\n    case 12:\n      d = 335 + c;\n      break;\n    default:\n      d = 0;\n    }\n  } else\n    switch (b) {\n    case 1:\n      d = c;\n      break;\n    case 2:\n      d = 31 + c;\n      break;\n    case 3:\n      d = 59 + c;\n      break;\n    case 4:\n      d = 90 + c;\n      break;\n    case 5:\n      d = 120 + c;\n      break;\n    case 6:\n      d = 151 + c;\n      break;\n    case 7:\n      d = 181 + c;\n      break;\n    case 8:\n      d = 212 + c;\n      break;\n    case 9:\n      d = 243 + c;\n      break;\n    case 10:\n      d = 273 + c;\n      break;\n    case 11:\n      d = 304 + c;\n      break;\n    case 12:\n      d = 334 + c;\n      break;\n    default:\n      d = 0;\n    }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int zz[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 4 != 0 || (y % 4 == 0 && y % 100 == 0 && y % 400 != 0))\n    cout << zz[m - 1] + d << endl;\n  else {\n    if (m <= 2)\n      cout << zz[m - 1] + d << endl;\n    else\n      printf(\"%d\\n\", zz[m - 1] + d + 1);\n  }\n}\n"}
{"label": "11", "index": "20544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if (!((a % 4 == 0 && a % 100 != 0) || (a % 4 == 0 && a % 400 == 0))) {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c - 1;\n    if (b == 4)\n      cout << 91 + c - 1;\n    if (b == 5)\n      cout << 121 + c - 1;\n    if (b == 6)\n      cout << 152 + c - 1;\n    if (b == 7)\n      cout << 182 + c - 1;\n    if (b == 8)\n      cout << 213 + c - 1;\n    if (b == 9)\n      cout << 244 + c - 1;\n    if (b == 10)\n      cout << 274 + c - 1;\n    if (b == 11)\n      cout << 305 + c - 1;\n    if (b == 12)\n      cout << 335 + c - 1;\n  } else {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c;\n    if (b == 4)\n      cout << 91 + c;\n    if (b == 5)\n      cout << 121 + c;\n    if (b == 6)\n      cout << 152 + c;\n    if (b == 7)\n      cout << 182 + c;\n    if (b == 8)\n      cout << 213 + c;\n    if (b == 9)\n      cout << 244 + c;\n    if (b == 10)\n      cout << 274 + c;\n    if (b == 11)\n      cout << 305 + c;\n    if (b == 12)\n      cout << 335 + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, sum = 0;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 0; i < m - 1; i++) {\n      sum = sum + a[1][i];\n    }\n  } else {\n    for (i = 0; i < m - 1; i++)\n      sum = sum + a[0][i];\n  }\n  sum += d;\n  cout << sum << endl;\n}\n"}
{"label": "11", "index": "20546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s[13], t, n;\n  s[0] = 0;\n  s[1] = 31;\n  s[3] = 31;\n  s[4] = 30;\n  s[5] = 31;\n  s[6] = 30;\n  s[7] = 31;\n  s[8] = 31;\n  s[9] = 30;\n  s[10] = 31;\n  s[11] = 30;\n  s[12] = 31;\n  t = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n      s[2] = 29;\n      t = s[i] + t;\n    } else {\n      s[2] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, x;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 29 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 29 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 6) {\n      x = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  } else\n\n  {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2) {\n      x = 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 3) {\n      x = 31 + 28 + c;\n      printf(\"%d\", x);\n    } else if (b == 4) {\n      x = 31 + 28 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 5) {\n      x = 31 + 28 + 31 + 30 + c;\n      cout << x;\n    } else if (b == 6) {\n      x = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 7) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 8) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 9) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 10) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", x);\n    } else if (b == 11) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", x);\n    } else if (b == 12) {\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", x);\n    }\n  }\n}\n"}
{"label": "11", "index": "20548", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t = 0;\n  int monthday[13] = {0, 31, 28 + t, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    t = 1;\n\n  int summonth = 0;\n  int sum = 0;\n\n  int i;\n  for (i = 0; i < month; i++)\n    summonth += monthday[i];\n  sum = summonth + day;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, a,\n      m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0)\n    a = 1;\n  else if (year % 100 == 0 && year % 400 == 0)\n    a = 1;\n  else\n    a = 0;\n  if (a == 1) {\n    m[1] = 29;\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  } else if (a == 0) {\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  }\n  cout << sum << \" \";\n}\n"}
{"label": "11", "index": "20550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, d;\n  scanf(\"%d%d%d\", &n, &m, &d);\n  int a = d;\n  for (i = 1; i <= m - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      a += 31;\n    } else {\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        a += 30;\n      } else {\n        if ((n % 100 == 0 && n % 400 != 0) || n % 4 != 0) {\n          a += 28;\n\n        } else {\n          a += 29;\n        }\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "20551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nlong total;\n\nint run(int n) {\n  if (n % 4 == 0 && n % 100 != 0) {\n    return 1;\n  }\n  if (n % 400 == 0) {\n    return 1;\n  }\n  return 0;\n}\n\nint main() {\n  int year, month, day;\n\n  while (cin >> year >> month >> day) {\n    total = 0;\n    if (run(year)) {\n\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 60 + day;\n        break;\n      case 4:\n        total += 91 + day;\n        break;\n      case 5:\n        total += 121 + day;\n        break;\n      case 6:\n        total += 152 + day;\n        break;\n      case 7:\n        total += 182 + day;\n        break;\n      case 8:\n        total += 213 + day;\n        break;\n      case 9:\n        total += 244 + day;\n        break;\n      case 10:\n        total += 274 + day;\n        break;\n      case 11:\n        total += 305 + day;\n        break;\n      case 12:\n        total += 335 + day;\n        break;\n      }\n    } else {\n      if (month == 1) {\n        total += day;\n      }\n      if (month == 2) {\n        total += 31 + day;\n      }\n      switch (month) {\n      case 3:\n        total += 59 + day;\n        break;\n      case 4:\n        total += 90 + day;\n        break;\n      case 5:\n        total += 120 + day;\n        break;\n      case 6:\n        total += 151 + day;\n        break;\n      case 7:\n        total += 181 + day;\n        break;\n      case 8:\n        total += 212 + day;\n        break;\n      case 9:\n        total += 243 + day;\n        break;\n      case 10:\n        total += 273 + day;\n        break;\n      case 11:\n        total += 304 + day;\n        break;\n      case 12:\n        total += 334 + day;\n        break;\n      }\n    }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  int leap = 0;\n  int day = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    leap = 1;\n  b--;\n  while (b) {\n    if (b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {\n      b--;\n      day += 31;\n    }\n    if (b == 2) {\n      b--;\n      day += 28 + leap;\n    }\n    if (b == 4 || b == 6 || b == 9 || b == 11) {\n      b--;\n      day += 30;\n    }\n  }\n  day += c;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100) != 0) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 6) {\n      d = 152 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20554", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int y, m, d, days = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  switch (m) {\n  case 1:\n    days = d;\n    break;\n  case 2:\n    days = 31 + d;\n    break;\n  case 3:\n    days = 31 + 28 + d;\n    break;\n  case 4:\n    days = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    days = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    days = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    days = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  \n  printf(\"%d\\n\", days);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, r, d, i;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d \", &n, &y, &r);\n    d = 0;\n    if ((y > 2) && (n % 400 == 0))\n      d = 1;\n    if ((y > 2) && (n % 100 != 0) && (n % 4 == 0))\n      d = 1;\n    d = d + r;\n    y--;\n    switch (y) {\n    case 11:\n      d = d + 30;\n    case 10:\n      d = d + 31;\n    case 9:\n      d = d + 30;\n    case 8:\n      d = d + 31;\n    case 7:\n      d = d + 31;\n    case 6:\n      d = d + 30;\n    case 5:\n      d = d + 31;\n    case 4:\n      d = d + 30;\n    case 3:\n      d = d + 31;\n    case 2:\n      d = d + 28;\n    case 1:\n      d = d + 31;\n    }\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int i;\n\n  if (year % 4 == 0 || year % 100 == 0) {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2) {\n      i = (month - 1) * 31 + day;\n    } else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  } else {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2) {\n      i = (month - 1) * 31 + day;\n    } else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  }\n\n  printf(\"%d\", i);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20557", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, y, r, b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int c[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0,\n      q;\n  cin >> n >> y >> r;\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + b[i];\n    sum = sum + r;\n    cout << sum;\n  } else {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + c[i];\n    sum = sum + r;\n    cout << sum;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "11", "index": "20558", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum;\n  int a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    a[1] = 29;\n  else\n    a[1] = 28;\n\n  sum = 0;\n  for (i = 0; i < m; i++)\n    sum = sum + a[i];\n  sum = sum - a[i - 1] + d;\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, r;\n  int c(int y, int m, int d);\n  scanf(\"%d %d %d\", &y, &m, &d);\n  r = c(y, m, d);\n  printf(\"%d\", r);\n}\n\nint run(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else if (y % 100 == 0)\n    return 0;\n  else if (y % 4 == 0)\n    return 1;\n  return 0;\n}\n\nint c(int y, int m, int d) {\n  int i, total = 0, r = 0;\n  for (i = 1; i < m; i++)\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10: {\n      r = r + 31;\n      break;\n    }\n    case 4:\n    case 6:\n    case 9:\n    case 11: {\n      r = r + 30;\n      break;\n    }\n    case 2: {\n      if (run(y))\n        r = r + 29;\n      else\n        r = r + 28;\n      break;\n    }\n    }\n  r = r + d;\n  return (r);\n}\n"}
{"label": "11", "index": "20560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, leap;\n  scanf(\"%d%d%d\", &year, &month, &day);\n\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        leap = 1;\n      else\n        leap = 0;\n    } else\n      leap = 1;\n  } else\n    leap = 0;\n\n  if (leap == 1) {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      cout << 31 + day;\n      break;\n    case 3:\n      printf(\"%d\", 29 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 29 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 29 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 29 + 31 + day);\n      break;\n    }\n  } else {\n    switch (month) {\n    case 1:\n      printf(\"%d\", day);\n      break;\n    case 2:\n      printf(\"%d\", 31 + day);\n      break;\n    case 3:\n      printf(\"%d\", 28 + 31 + day);\n      break;\n    case 4:\n      printf(\"%d\", 31 + 28 + 31 + day);\n      break;\n    case 5:\n      printf(\"%d\", 30 + 31 + 28 + 31 + day);\n      break;\n    case 6:\n      printf(\"%d\", 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 7:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 8:\n      printf(\"%d\", 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 9:\n      printf(\"%d\", 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 10:\n      printf(\"%d\", 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 11:\n      printf(\"%d\", 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    case 12:\n      printf(\"%d\", 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 28 + 31 + day);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20561", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, day;\n  cin >> year >> mon >> day;\n  int days = 0;\n  int ar[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int br[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    for (int i = 0; i < mon - 1; i++)\n      days += br[i];\n  } else {\n    for (int i = 0; i < mon - 1; i++)\n      days += ar[i];\n  }\n  days += day;\n  cout << days << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20562", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int nian, yue, ri, leap, sum;\n  cin >> nian >> yue >> ri;\n  switch (yue) {\n  case 1:\n    sum = 0;\n    break;\n  case 2:\n    sum = 31;\n    break;\n  case 3:\n    sum = 59;\n    break;\n  case 4:\n    sum = 90;\n    break;\n  case 5:\n    sum = 120;\n    break;\n  case 6:\n    sum = 151;\n    break;\n  case 7:\n    sum = 181;\n    break;\n  case 8:\n    sum = 212;\n    break;\n  case 9:\n    sum = 243;\n    break;\n  case 10:\n    sum = 273;\n    break;\n  case 11:\n    sum = 304;\n    break;\n  case 12:\n    sum = 334;\n    break;\n  }\n  sum = sum + ri;\n  if ((nian % 400 == 0) || (nian % 4 == 0 && nian % 100 != 0))\n    leap = 1;\n  else\n    leap = 0;\n  if (leap == 1 && nian > 3 && yue > 2)\n    sum++;\n  cout << sum << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, g, i, e = 0, day;\n  int montha[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int monthb[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  scanf(\"%d %d %d \", &year, &mon, &g);\n\n  for (i = 0; i < mon; i++) {\n    if (year % 4 == 0) {\n      if (year % 100 == 0 && year % 400 != 0) {\n        e = e + montha[i];\n\n        day = e + g;\n      } else {\n        e = e + monthb[i];\n        day = e + g;\n      }\n    }\n    if (year % 4 != 0) {\n      e = e + montha[i];\n      day = e + g;\n    }\n  }\n  cout << day;\n  return 0;\n}\n"}
{"label": "11", "index": "20564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint judge(int);\nint main() {\n  int year, month, day, i, total = 0;\n  cin >> year >> month >> day;\n  for (i = 1; i <= month - 1; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      total = total + 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      total = total + 30;\n    else if (judge(year) == 0 && i == 2)\n      total = total + 28;\n    else if (judge(year) == 1 && i == 2)\n      total = total + 29;\n  }\n  total = total + day;\n  cout << total << endl;\n  return 0;\n}\nint judge(int x) {\n  int y = 0;\n  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0)\n    y = 1;\n  else\n    y = 0;\n  return y;\n}\n"}
{"label": "11", "index": "20565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, x;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    printf(\"%d\", x);\n  }\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n    cout << x;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20566", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, result = 0, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20567", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, date, leap, num = 0;\n  int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> date;\n\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  } else {\n    if (year % 4 == 0)\n      leap = 1;\n    else\n      leap = 0;\n  }\n\n  int i;\n  switch (leap) {\n  case 1:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    if (month >= 3)\n      num = num + date + 1;\n    else\n      num = num + date;\n    break;\n  case 0:\n    for (i = 0; i < month - 1; i++) {\n      num = num + mon[i];\n    }\n    num = num + date;\n  }\n\n  printf(\"%d\", num);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20568", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  cin >> y >> m >> d;\n  if (y % 100 == 0 && y % 40 == 0 || y % 100 != 0 && y % 4 == 0)\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 335);\n      break;\n    }\n  else\n    switch (m) {\n    case 1:\n      printf(\"%d\\n\", d);\n      break;\n    case 2:\n      printf(\"%d\\n\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\\n\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\\n\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\\n\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\\n\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\\n\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\\n\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\\n\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\\n\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\\n\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\\n\", d + 334);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "20569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k;\n  if (a % 100 == 0 && a % 400 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    f[1] = 29;\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  } else {\n    for (i = 0, k = 0; b != i + 1; i++)\n      k = k + f[i];\n    printf(\"%d\", k + c);\n  }\n}\n"}
{"label": "11", "index": "20570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  int a[13];\n  a[0] = 0;\n  int sum = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  a[1] = a[3] = a[5] = a[7] = a[8] = a[10] = a[12] = 31;\n  a[4] = a[6] = a[9] = a[11] = 30;\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (i = 1; i < m; i++)\n    sum = sum + a[i];\n  sum = sum + d;\n  printf(\"%d\", sum);\n  getchar();\n}\n"}
{"label": "11", "index": "20571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, year, month, day, sum = 0, months[50], msum = 0;\n\n  months[1] = 31;\n  months[2];\n  months[3] = 31;\n  months[4] = 30;\n  months[5] = 31;\n  months[6] = 30;\n  months[7] = 31;\n  months[8] = 31;\n  months[9] = 30;\n  months[10] = 31;\n  months[11] = 30;\n  months[12] = 31;\n\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 == 0) {\n    if (year % 100 != 0) {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    } else {\n      if (year % 400 == 0) {\n        months[2] = 29;\n      } else {\n        months[2] = 28;\n      }\n    }\n  } else {\n    months[2] = 28;\n  }\n  for (i = 1; i < month; i++) {\n    msum = msum + months[i];\n  }\n  sum = msum + day;\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], sum[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < 5; i++) {\n    switch (b[i]) {\n    case 1:\n      sum[i] = 0;\n      break;\n    case 2:\n      sum[i] = 31;\n      break;\n    case 3:\n      sum[i] = 59;\n      break;\n    case 4:\n      sum[i] = 90;\n      break;\n    case 5:\n      sum[i] = 120;\n      break;\n    case 6:\n      sum[i] = 151;\n      break;\n    case 7:\n      sum[i] = 181;\n      break;\n    case 8:\n      sum[i] = 212;\n      break;\n    case 9:\n      sum[i] = 243;\n      break;\n    case 10:\n      sum[i] = 273;\n      break;\n    case 11:\n      sum[i] = 304;\n      break;\n    case 12:\n      sum[i] = 334;\n      break;\n    }\n    sum[i] = sum[i] + c[i];\n    if (((a[i] % 4 == 0 && a[i] % 100 != 0) || a[i] % 400 == 0) && b[i] > 2)\n      sum[i] = sum[i] + 1;\n  }\n  for (i = 0; i < 5; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int year) {\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    return (1);\n  else\n    return (0);\n}\nint main() {\n  int year, month, day, leap1, answer = 0, i;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  leap1 = leap(year);\n  if (leap1 == 1) {\n    for (i = 1; i < month; i++) {\n      answer += b[i];\n    }\n    answer += day;\n  } else {\n    for (i = 1; i < month; i++) {\n      answer += a[i];\n    }\n    answer += day;\n  }\n  printf(\"%d\", answer);\n}\n"}
{"label": "11", "index": "20574", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leap(int year) {\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    return (1);\n  } else\n    return (0);\n}\nint main() {\n  int year, month, day, leap1, answer = 0, i;\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  leap1 = leap(year);\n  if (leap1 == 1) {\n    for (i = 1; i < month; i++) {\n      answer += b[i];\n    }\n    answer += day;\n  } else {\n    for (i = 1; i < month; i++) {\n      answer += a[i];\n    }\n    answer += day;\n  }\n  printf(\"%d\", answer);\n}\n"}
{"label": "11", "index": "20575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isRN(int year) {\n  int result;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\nint main() {\n  int year, month, day;\n  int i;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else {\n      if (isRN(year) == 1)\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "20576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, n = 0;\n  int a[12];\n  a[0] = 31;\n  a[1] = 28;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  cin >> y >> m >> d;\n  if (y % 4 == 0 && y % 100 != 0) {\n    a[1] = 29;\n  }\n  if (y % 400 == 0)\n    a[1] = 29;\n\n  for (i = 0; i < m - 1; i++)\n    n += a[i];\n  n = n + d;\n  cout << n;\n}\n"}
{"label": "11", "index": "20577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 29 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 29 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 29 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 28 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 28 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, date;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &date);\n  int temp;\n  if (year % 4 != 0)\n    temp = 28;\n  else if (year % 100 != 0)\n    temp = 29;\n  else if (year % 400 != 0) {\n    temp = 28;\n  } else {\n    temp = 29;\n  }\n  int a[12] = {31, temp, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 0; i < month - 1; i++) {\n    sum += a[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, n, d, x = 0, i = 1, z;\n  int m[13];\n  m[1] = m[3] = m[5] = m[7] = m[8] = m[10] = m[12] = 31;\n  m[4] = m[6] = m[9] = m[11] = 30;\n  m[2] = 29;\n  cin >> y >> n >> d;\n  if (n == 1) {\n    x = d;\n    z = x;\n  } else {\n    if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n        z = x + d;\n      }\n    } else {\n      for (i = 1; i < n; i++) {\n        x = x + m[i];\n      }\n      z = x + d - 1;\n    }\n  }\n\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "11", "index": "20580", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 29);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 29 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 31 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30);\n\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 30);\n  } else {\n    if (m == 1)\n      printf(\"%d\", d);\n\n    if (m == 2)\n      printf(\"%d\", d + 31);\n    if (m == 3)\n      printf(\"%d\", d + 31 + 28);\n    if (m == 4)\n      printf(\"%d\", d + 31 + 28 + 31);\n    if (m == 5)\n      printf(\"%d\", d + 31 + 29 + 30 + 30);\n    if (m == 6)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30);\n    if (m == 7)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 30 + 30);\n    if (m == 8)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 30);\n    if (m == 9)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 30);\n    if (m == 10)\n      printf(\"%d\", d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 29);\n    if (m == 11)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 30);\n    if (m == 12)\n      printf(\"%d\", d + 31 + 29 + 31 + 31 + 30 + 30 + 31 + 31 + 30 + 31 + 29);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20581", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[2] = {365, 366};\n  int month[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                      31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  cin >> y >> m >> d;\n  int type;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    type = 1;\n  } else {\n    type = 0;\n  }\n  int i;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++) {\n    sum += month[type][i];\n  }\n  sum += d;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20582", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n = 0;\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 1)\n    n = n + day;\n  else if (month == 2)\n    n = n + 31 + day;\n  else if (month == 3)\n    n = n + 59 + day;\n  else if (month == 4)\n    n = n + 90 + day;\n  else if (month == 5)\n    n = n + 120 + day;\n  else if (month == 6)\n    n = n + 151 + day;\n  else if (month == 7)\n    n = n + 181 + day;\n  else if (month == 8)\n    n = n + 212 + day;\n  else if (month == 9)\n    n = n + 243 + day;\n  else if (month == 10)\n    n = n + 273 + day;\n  else if (month == 11)\n    n = n + 304 + day;\n  else {\n    n = n + 334 + day;\n  }\n  if ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) &&\n      (month > 2))\n    n = n + 1;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint isrunnian(int year) {\n  if (year % 400 == 0)\n    return 1;\n  else if (year % 4 == 0 && year % 100 != 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1)\n    printf(\"%d\\n\", d);\n  else if (m == 2)\n    printf(\"%d\\n\", 31 + d);\n  else if (m == 3) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + d);\n  } else if (m == 4) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + d);\n  } else if (m == 5) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + d);\n  } else if (m == 6) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 30 + 31 + 31 + d);\n  } else if (m == 7) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + d);\n  } else if (m == 8) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + d);\n  } else if (m == 9) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d);\n  } else if (m == 10) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d);\n  } else if (m == 11) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d);\n  } else if (m == 12) {\n    if (isrunnian(y))\n      printf(\"%d\\n\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n    else\n      printf(\"%d\\n\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, feb, i, m, n = 0, q;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    feb = 29;\n  } else {\n    feb = 28;\n  }\n\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      m = 31;\n    else if (i == 2)\n      m = feb;\n    else\n      m = 30;\n    n = n + m;\n  }\n  q = n + c;\n  cout << q;\n  return 0;\n}\n"}
{"label": "11", "index": "20585", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, day, num = 0, i, a[11];\n  scanf(\"%d %d %d\", &year, &mon, &day);\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  if (year % 4 != 0) {\n    a[1] = 28;\n  } else if (year % 100 == 0) {\n    if (year % 400 == 0) {\n      a[1] = 29;\n    } else\n      a[1] = 28;\n  } else\n    a[1] = 29;\n  for (i = 0; i < mon - 1; i++) {\n    num = num + a[i];\n  }\n  num = num + day;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  int d = 0;\n  int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  int y[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &a, &b, &c);\n  int i;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 100 == 0 && a % 400 == 0)) {\n    for (i = 1; i < b; i++) {\n      d = d + y[i];\n    }\n\n    printf(\"%d\", d + c);\n  } else {\n    for (i = 1; i < b; i++) {\n      d = d + x[i];\n    }\n    cout << d + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, i, n = 0;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    n = n + monthday[i - 1];\n  }\n  n = n + day;\n\n  if (month > 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0))\n    n = n + 1;\n\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, n = 0;\n  int a[12];\n  a[0] = 31;\n  a[1] = 28;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0)\n    a[1] = 29;\n  if (y % 400 == 0)\n    a[1] = 29;\n  for (i = 0; i < m - 1; i++)\n    n += a[i];\n  n = n + d;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, daynum = 0, i;\n  cin >> year >> month >> day;\n  int month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int judgeleap;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month2[i];\n    }\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month1[i];\n    }\n  }\n  daynum = daynum + day;\n  cout << daynum;\n  return 0;\n}\n"}
{"label": "11", "index": "20590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, math, day;\n  int date;\n  scanf(\"%d %d %d\", &year, &math, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 29 + day;\n    }\n    if (math == 4) {\n      date = 31 + 29 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 29 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 29 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12)\n      date = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n  if (year % 4 != 0 || (year % 100 == 0) && year % 400 != 0) {\n    if (math == 1) {\n      date = day;\n    }\n    if (math == 2) {\n      date = 31 + day;\n    }\n    if (math == 3) {\n      date = 31 + 28 + day;\n    }\n    if (math == 4) {\n      date = 31 + 28 + 31 + day;\n    }\n    if (math == 5) {\n      date = 31 + 28 + 31 + 30 + day;\n    }\n    if (math == 6) {\n      date = 31 + 28 + 31 + 30 + 31 + day;\n    }\n    if (math == 7) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    }\n    if (math == 8) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    }\n    if (math == 9) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    }\n    if (math == 10) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    }\n    if (math == 11) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    }\n    if (math == 12) {\n      date = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    }\n  }\n\n  printf(\"%d\", date);\n  return 0;\n}\n"}
{"label": "11", "index": "20591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z, s;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int a;\n  if (x % 4 == 0)\n    if (x % 100 == 0)\n      if (x % 400 == 0) {\n        a = 29;\n      } else\n        a = 28;\n    else\n      a = 29;\n  else\n    a = 28;\n  if (y == 1 || y == 2) {\n    s = (y - 1) * 31 + z;\n  } else if (y == 3 || y == 7 || y == 5) {\n    s = (y - 1) / 2 * 31 + (y - 3) / 2 * 30 + a + z;\n  } else if (y == 4 || y == 6) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  } else if (y == 9 || y == 11) {\n    s = (y + 1) / 2 * 31 + (y - 5) / 2 * 30 + a + z;\n  } else if (y == 8 || y == 10 || y == 12) {\n    s = y / 2 * 31 + (y - 4) / 2 * 30 + a + z;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  int sum = 0;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      for (int i = 0; i <= (month - 2); i++) {\n        sum += mon[i];\n      }\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  } else if (year % 4 != 0 || year % 100 == 0 && year % 400 != 0) {\n    if (month == 1)\n      sum = day;\n    else if (month == 2)\n      sum = 31 + day;\n    else {\n      int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n      for (int i = 0; i <= (month - 2); i++)\n        sum += mon[i];\n\n      sum = sum + day;\n    }\n    printf(\"%d\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4) == 0 && a % 100 != 0 || (a % 400) == 0) {\n    switch (b) {\n    case 1:\n      n = c;\n      printf(\"%d\", n);\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 29 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 29 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  } else\n    switch (b) {\n    case 1:\n      n = c;\n      cout << n;\n      break;\n    case 2:\n      n = 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 3:\n      n = 31 + 28 + c;\n      printf(\"%d\", n);\n      break;\n    case 4:\n      n = 31 + 28 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      printf(\"%d\", n);\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      printf(\"%d\", n);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "11", "index": "20594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int leap, year, month, day, sum = 0;\n  int a[2][12] = {{\n                      31,\n                      28,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                      31,\n                      30,\n                      31,\n                      30,\n                      31,\n                  },\n                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  cin >> year >> month >> day;\n  leap = ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0));\n  for (int i = 0; i < month - 1; i++)\n    sum = sum + a[leap][i];\n  sum = sum + day;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20595", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[2] = {365, 366};\n  int month[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n                      31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d;\n  cin >> y >> m >> d;\n  int type;\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {\n    type = 1;\n  } else {\n    type = 0;\n  }\n  int i;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++) {\n    sum += month[type][i];\n  }\n  sum += d;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int day = 0, y, m, d, i,\n      month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> y >> m >> d;\n  if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))\n    month[2] = 29;\n  for (i = 1; i < m; i++)\n    day += month[i];\n  day += d;\n  printf(\"%d\", day);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, mday = 0, i = 1;\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  for (i = 1; i < month + 1; i++) {\n    mday = mday + p[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 3) {\n      mday = mday + 1;\n    } else {\n      mday = mday;\n    }\n  }\n  n = mday + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20598", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m == 1)\n    s = d;\n  else if (m == 2)\n    s = 31 + d;\n  else if (m == 3)\n    s = 60 + d;\n  else if (m == 4)\n    s = 91 + d;\n  else if (m == 5)\n    s = 121 + d;\n  else if (m == 6)\n    s = 152 + d;\n  else if (m == 7)\n    s = 182 + d;\n  else if (m == 8)\n    s = 213 + d;\n  else if (m == 9)\n    s = 244 + d;\n  else if (m == 10)\n    s = 274 + d;\n  else if (m == 11)\n    s = 305 + d;\n  else if (m == 12)\n    s = 335 + d;\n  if (m >= 3) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        printf(\"%d\", s);\n      else\n        printf(\"%d\", s - 1);\n    } else if (y % 4 == 0)\n      printf(\"%d\", s);\n    else if (y % 4 != 0)\n      printf(\"%d\", s - 1);\n  } else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "11", "index": "20599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d;\n  int t;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 60;\n      break;\n    case 4:\n      t = 91;\n      break;\n    case 5:\n      t = 121;\n      break;\n    case 6:\n      t = 152;\n      break;\n    case 7:\n      t = 182;\n      break;\n    case 8:\n      t = 213;\n      break;\n    case 9:\n      t = 244;\n      break;\n    case 10:\n      t = 274;\n      break;\n    case 11:\n      t = 305;\n      break;\n    case 12:\n      t = 335;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      t = 0;\n      break;\n    case 2:\n      t = 31;\n      break;\n    case 3:\n      t = 59;\n      break;\n    case 4:\n      t = 90;\n      break;\n    case 5:\n      t = 120;\n      break;\n    case 6:\n      t = 151;\n      break;\n    case 7:\n      t = 181;\n      break;\n    case 8:\n      t = 212;\n      break;\n    case 9:\n      t = 243;\n      break;\n    case 10:\n      t = 273;\n      break;\n    case 11:\n      t = 304;\n      break;\n    case 12:\n      t = 334;\n    }\n  }\n  t += d;\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "20600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, d;\n  cin >> n >> x >> y;\n  d = 0;\n  if ((x > 2) && (n % 400 == 0))\n    d = 1;\n  if ((x > 2) && (n % 100 != 0) && (n % 4 == 0))\n    d = 1;\n  d = d + y;\n  x--;\n  switch (x) {\n  case 11:\n    d = d + 30;\n  case 10:\n    d = d + 31;\n  case 9:\n    d = d + 30;\n  case 8:\n    d = d + 31;\n  case 7:\n    d = d + 31;\n  case 6:\n    d = d + 30;\n  case 5:\n    d = d + 31;\n  case 4:\n    d = d + 30;\n  case 3:\n    d = d + 31;\n  case 2:\n    d = d + 28;\n  case 1:\n    d = d + 31;\n  }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k = 0;\n  int y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n    for (i = 1; i < m; i++) {\n      k = k + b[i];\n    }\n    k = k + d;\n    cout << k;\n  }\n  k = 0;\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (i = 1; i < m; i++)\n      k = k + a[i];\n\n    k = k + d;\n    printf(\"%d\", k);\n  }\n}\n"}
{"label": "11", "index": "20602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 60 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 91 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 121 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 152 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 182 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 213 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 9) {\n      n = 244 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 10) {\n      n = 274 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 11) {\n      n = 305 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 12) {\n      n = 336 + c;\n      printf(\"%d\\n\", n);\n    }\n  } else {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 59 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 90 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 120 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 151 + c;\n      cout << n << \"\\n\";\n    } else if (b == 7) {\n      n = 181 + c;\n      printf(\"%d\\n\", n);\n    } else {\n      if (b == 8) {\n        n = 212 + c;\n        printf(\"%d\\n\", n);\n      } else if (b == 9) {\n        n = 243 + c;\n        printf(\"%d\\n\", n);\n      } else {\n        if (b == 10) {\n          n = 273 + c;\n          printf(\"%d\\n\", n);\n        } else if (b == 11) {\n          n = 304 + c;\n          printf(\"%d\\n\", n);\n        } else if (b == 12) {\n          n = 335 + c;\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, i = 1, n, x = 0;\n\n  int f[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int isleapyear(int a);\n  while (x <= 4) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    n = 0;\n\n    for (i = 1; i < b; i++) {\n\n      n += f[i];\n    }\n\n    n += c;\n    if (b > 2 && isleapyear(a))\n      n += 1;\n\n    printf(\"%d\\n\", n);\n    x++;\n  }\n}\nint isleapyear(int a) {\n  return ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0));\n}\n"}
{"label": "11", "index": "20604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rn(int y) {\n  if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int y, m, d, res = 0,\n               day[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n\n  for (i = 0; i < m; i++) {\n    res = res + day[i];\n  }\n  if (rn(y) == 1) {\n    if (m >= 3) {\n      printf(\"%d\\n\", res + d + 1);\n    } else\n      printf(\"%d\\n\", res + d);\n  }\n  if (rn(y) == 0)\n    printf(\"%d\\n\", res + d);\n  return 0;\n}\n"}
{"label": "11", "index": "20605", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400) == 0) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "11", "index": "20606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, i, c, days;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &a, &b, &c);\n  days = 0;\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    m[2] = 29;\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    cout << days + c << \"\\n\";\n  } else {\n    for (i = 0; i < b; i++) {\n      days += m[i];\n    }\n    printf(\"%d\\n\", days + c);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20607", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, d;\n  int result = 0;\n  int i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 31, 31, 30, 31};\n  cin >> year >> month >> d;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    a[2] = a[2] + 1;\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n    result += d;\n  } else\n    for (i = 1; i < month; i++) {\n      result += a[i];\n    }\n  result += d;\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    d = c;\n  }\n  if (b == 2) {\n    d = c + 31;\n  }\n  if (b == 3) {\n    d = c + 31 + 28;\n  }\n  if (b == 4) {\n    d = c + 59 + 31;\n  }\n  if (b == 5) {\n    d = c + 90 + 30;\n  }\n  if (b == 6) {\n    d = c + 120 + 31;\n  }\n  if (b == 7) {\n    d = c + 151 + 30;\n  }\n  if (b == 8) {\n    d = c + 181 + 31;\n  }\n  if (b == 9) {\n    d = c + 212 + 31;\n  }\n  if (b == 10) {\n    d = c + 243 + 30;\n  }\n  if (b == 11) {\n    d = c + 273 + 31;\n  }\n  if (b == 12) {\n    d = c + 304 + 30;\n  }\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      if (b != 1 && b != 2) {\n        d = d + 1;\n      }\n    }\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    if (b != 1 && b != 2) {\n      d = d + 1;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, e;\n  int s[12];\n  int d = 0;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n    s[1] = 29;\n  else\n    s[1] = 28;\n  s[0] = 31;\n  s[2] = 31;\n  s[3] = 30;\n  s[4] = 31;\n  s[5] = 30;\n  s[6] = 31;\n  s[7] = 31;\n  s[8] = 30;\n  s[9] = 31;\n  s[10] = 30;\n  s[11] = 31;\n  for (i = 1; i <= b; i++) {\n    d = d + s[i - 2];\n  }\n  e = d + c;\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "11", "index": "20610", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b, c, d, i;\n  cin >> b >> c >> d;\n  if ((b % 4 == 0 && b % 100 != 0) || (b % 100 == 0 && b % 400 == 0)) {\n    a[2] = 29;\n  }\n  for (i = 1; i < c; i++) {\n    d = d + a[i];\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20611", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint RunNian(int y) {\n  int result;\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\n\nint DiJiTian(int y, int m, int d) {\n  int result = 0;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      result += 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (RunNian(y)) {\n        result += 29;\n      } else {\n        result += 28;\n      }\n    }\n  }\n\n  result += d;\n  return result;\n}\n\nint main() {\n\n  int y2, m2, d2;\n  int T = 0;\n\n  scanf(\"%d%d%d\", &y2, &m2, &d2);\n\n  T += DiJiTian(y2, m2, d2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "11", "index": "20612", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s1 = 0, s2;\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0))\n    n[1] = 29;\n  for (i = 1; i < b; i++)\n    s1 = s1 + n[i - 1];\n  s2 = s1 + c;\n  printf(\"%d\\n\", s2);\n  return 0;\n}\n"}
{"label": "11", "index": "20613", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, month, day, number;\n  cin >> year >> month >> day;\n  if (month == 1)\n    number = day;\n  else if (month == 2)\n    number = 31 + day;\n  else {\n    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n      if (month == 3)\n        number = 60 + day;\n      else if (month == 4)\n        number = 91 + day;\n      else if (month == 5)\n        number = day + 121;\n      else if (month == 6)\n        number = day + 152;\n      else if (month == 7)\n        number = day + 182;\n      else if (month == 8)\n        number = day + 213;\n      else if (month == 9)\n        number = day + 244;\n      else if (month == 10) {\n        number = day + 274;\n      } else if (month == 11) {\n        number = day + 305;\n      } else if (month == 12)\n        number = day + 335;\n    } else {\n      if (month == 3)\n        number = 59 + day;\n      else if (month == 4)\n        number = 90 + day;\n      else if (month == 5)\n        number = day + 120;\n      else if (month == 6)\n        number = day + 151;\n      else if (month == 7)\n        number = day + 181;\n      else if (month == 8)\n        number = day + 212;\n      else if (month == 9)\n        number = day + 243;\n      else if (month == 10)\n        number = day + 273;\n      else if (month == 11)\n        number = day + 304;\n      else if (month == 12)\n        number = day + 334;\n    }\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "20614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, i, s[13], t, n;\n  s[0] = 0;\n  s[1] = 31;\n  s[3] = 31;\n  s[4] = 30;\n  s[5] = 31;\n  s[6] = 30;\n  s[7] = 31;\n  s[8] = 31;\n  s[9] = 30;\n  s[10] = 31;\n  s[11] = 30;\n  s[12] = 31;\n  t = 0;\n  cin >> a >> b >> c;\n  for (i = 1; i < b; i++) {\n    if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n      s[2] = 29;\n      t = s[i] + t;\n    } else {\n      s[2] = 28;\n      t = s[i] + t;\n    }\n  }\n  n = t + c;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y = 0;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  for (i = 0; i < b - 1;) {\n    y = y + A[i];\n    i++;\n  }\n  y = y + c;\n  if (a % 4 == 0 & a % 100 != 0 || a % 400 == 0) {\n    if (b <= 2) {\n      printf(\"%d\", y);\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else\n    printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "11", "index": "20616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, res = 0, i;\n  int y[12];\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    y[1] = 29;\n  else\n    y[1] = 28;\n  y[0] = 31;\n  y[2] = 31;\n  y[4] = 31;\n  y[7] = 31;\n  y[6] = 31;\n  y[9] = 31;\n  y[3] = 30;\n  y[5] = 30;\n  y[8] = 30;\n  y[10] = 30;\n  for (i = 0; i < month - 1; i++)\n    res += y[i];\n  res += day;\n  printf(\"%d\", res);\n}\n"}
{"label": "11", "index": "20617", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint isRunNian(int year) {\n  int result;\n  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {\n    result = 1;\n  } else {\n    result = 0;\n  }\n  return result;\n}\nint main() {\n\n  int year, month, day;\n  int result = 0;\n\n  cin >> year >> month >> day;\n\n  for (int i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      result += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (isRunNian(year)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, d, j;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    days[2]++;\n  d = c;\n  for (j = 1; j < b; j++)\n    d += days[j];\n\n  printf(\"%d\\n\", d);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n\n    return 0;\n}\n"}
{"label": "11", "index": "20619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, mon, date, day = 0;\n  scanf(\"%d%d%d\", &year, &mon, &date);\n  switch (mon) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = 31 + date;\n    break;\n  case 3:\n    day = 31 + 28 + date;\n    break;\n  case 4:\n    day = 31 + 28 + 31 + date;\n    break;\n  case 5:\n    day = 31 + 28 + 31 + 30 + date;\n    break;\n  case 6:\n    day = 31 + 28 + 31 + 30 + 31 + date;\n    break;\n  case 7:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + date;\n    break;\n  case 8:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + date;\n    break;\n  case 9:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n    break;\n  case 10:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n    break;\n  case 11:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n    break;\n  case 12:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n    break;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (mon > 2)\n      day++;\n  }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20620", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0, a[12], i;\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  for (i = 0; i < m - 1; i++)\n    s = s + a[i];\n\n  s = s + d;\n  printf(\"%d\", s);\n}\n"}
{"label": "11", "index": "20621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int one[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int another[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  int m = 0;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + one[i];\n    }\n    n = m + c;\n  } else {\n    for (i = 0; i < (b - 1); i++) {\n      m = m + another[i];\n    }\n    n = m + c;\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "11", "index": "20622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Year(int a) {\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      return 1;\n    } else\n      return 0;\n  } else if (a % 4 == 0) {\n    return 1;\n  } else\n    return 0;\n}\nint main() {\n  int year, month, day, a[13], i, answer;\n  cin >> year >> month >> day;\n  for (i = 1; i <= 12; i++) {\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10:\n    case 12:\n      a[i] = 31;\n      break;\n    case 4:\n    case 6:\n    case 9:\n    case 11:\n      a[i] = 30;\n      break;\n    case 2:\n      if (Year(year) == 1) {\n        a[i] = 29;\n        break;\n      } else {\n        a[i] = 28;\n        break;\n      }\n    }\n  }\n  answer = 0;\n  for (i = 1; i < month; i++) {\n    answer += a[i];\n  }\n  answer += day;\n  cout << answer << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int y) {\n  int i;\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        return (1);\n      else\n        return (0);\n    } else\n      return (1);\n  } else\n    return (0);\n}\nint main() {\n  int y, m, d, n, i;\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 30;\n  n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (f(y) == 0)\n    a[2] = 28;\n  if (f(y) == 1)\n    a[2] = 29;\n  for (i = 1; i < m; i++)\n    n = a[i] + n;\n  n = n + d;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 100 != 0 && y % 4 == 0) || (y % 400 == 0)) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 60 + d;\n      break;\n    case 4:\n      n = 91 + d;\n      break;\n    case 5:\n      n = 121 + d;\n      break;\n    case 6:\n      n = 152 + d;\n      break;\n    case 7:\n      n = 182 + d;\n      break;\n    case 8:\n      n = 213 + d;\n      break;\n    case 9:\n      n = 244 + d;\n      break;\n    case 10:\n      n = 274 + d;\n      break;\n    case 11:\n      n = 305 + d;\n      break;\n    default:\n      n = 335 + d;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = 59 + d;\n      break;\n    case 4:\n      n = 90 + d;\n      break;\n    case 5:\n      n = 120 + d;\n      break;\n    case 6:\n      n = 151 + d;\n      break;\n    case 7:\n      n = 181 + d;\n      break;\n    case 8:\n      n = 212 + d;\n      break;\n    case 9:\n      n = 243 + d;\n      break;\n    case 10:\n      n = 273 + d;\n      break;\n    case 11:\n      n = 304 + d;\n      break;\n    default:\n      n = 334 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint day_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint sum_day(int month, int day) {\n  int i;\n  for (i = 0; i < month; i++)\n    day = day + day_month[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\nint main() {\n  int year, month, day, days, a;\n\n  for (a = 1; a <= 5; a++) {\n    cin >> year >> month >> day;\n\n    days = sum_day(month, day);\n    if (leap(year) && month >= 3)\n      days = days + 1;\n    cout << days << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int y, m, d, a, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4) == 0 && (y % 100) != 0 || (y % 400 == 0))\n    a = 1;\n  else\n    a = 0;\n\n  switch (m) {\n  case 1:\n    n = d;\n    break;\n  case 2:\n    n = 31 + d;\n    break;\n  case 3:\n    n = 31 + 28 + d;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + d;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + d;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + d;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + d;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n    break;\n  }\n\n  if (a == 0) {\n    printf(\"%d\", n);\n  }\n  if (m != 1 && m != 2 && a == 1) {\n    n = n + 1;\n    printf(\"%d\", n);\n  }\n  if (a == 1 && m == 1)\n    printf(\"%d\", n);\n  if (a == 1 && m == 2)\n    printf(\"%d\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  d = 0;\n  int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    for (e = 0; e < b; e++) {\n      d = d + days1[e];\n    }\n    d = d + c;\n  } else {\n    for (e = 0; e < b; e++) {\n      d = d + days2[e];\n    }\n    d = d + c;\n  }\n  d = d - 1;\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20628", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, sum;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  sum = 0;\n  for (i = 1; i < b; i++) {\n    switch (i) {\n    case 1:\n      sum += 31;\n      break;\n    case 2:\n      if (a % 400 == 0 || (a % 100 != 0) && (a % 4 == 0))\n        sum += 29;\n      else\n        sum += 28;\n\n      break;\n    case 3:\n      sum += 31;\n      break;\n    case 4:\n      sum += 30;\n      break;\n    case 5:\n      sum += 31;\n      break;\n    case 6:\n      sum += 30;\n      break;\n    case 7:\n      sum += 31;\n      break;\n    case 8:\n      sum += 31;\n      break;\n    case 9:\n      sum += 30;\n      break;\n    case 10:\n      sum += 31;\n      break;\n    case 11:\n      sum += 30;\n      break;\n    case 12:\n      sum += 31;\n      break;\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f1(int y, int r) {\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint f2(int y, int r) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++) {\n        d = d + a[k];\n      }\n    }\n  }\n  d = d + r;\n  return d;\n}\nint main() {\n  int a, y, r, d;\n  scanf(\"%d%d%d\", &a, &y, &r);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0))\n    d = f1(y, r);\n  else\n    d = f2(y, r);\n  cout << d;\n}\n"}
{"label": "11", "index": "20630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, mday = 0, i = 1;\n  int p[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\\n\", &year, &month, &day);\n  for (i = 1; i < month + 1; i++) {\n    mday = mday + p[i - 1];\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    if (month >= 3)\n      mday = mday + 1;\n    else {\n      mday = mday;\n    }\n  }\n  n = mday + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int mouth[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                      {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};\n  int leapyear;\n  int a, b, c, i;\n  int d = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  leapyear = (a % 4 == 0 && a % 100 != 0 || a % 400 == 0);\n  for (i = 0; i < b - 1; i++) {\n    d = d + mouth[leapyear][i];\n  }\n  d = d + c;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, i, sum;\n  cin >> a >> b >> c;\n  sum = 0;\n  for (i = 1; i < b; i++) {\n    switch (i) {\n    case 1:\n      sum += 31;\n      break;\n    case 2:\n      if (a % 400 == 0 || (a % 100 != 0) && (a % 4 == 0)) {\n        sum += 29;\n      } else {\n        sum += 28;\n      }\n      break;\n    case 3:\n      sum += 31;\n      break;\n    case 4:\n      sum += 30;\n      break;\n    case 5:\n      sum += 31;\n      break;\n    case 6:\n      sum += 30;\n      break;\n    case 7:\n      sum += 31;\n      break;\n    case 8:\n      sum += 31;\n      break;\n    case 9:\n      sum += 30;\n      break;\n    case 10:\n      sum += 31;\n      break;\n    case 11:\n      sum += 30;\n      break;\n    case 12:\n      sum += 31;\n      break;\n    }\n  }\n  sum += c;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int n) {\n  cin >> n;\n  if (n % 100 == 0) {\n    if (n % 400 == 0)\n      return 1;\n    else\n      return 0;\n  } else if (n % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int y, m, d;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int t = 0, i;\n  for (i = 1; i < m; i++) {\n    if (i == 1 || i == 5 || i == 3 || i == 7 || i == 8 || i == 10)\n      t = t + 31;\n    else if (i == 2)\n      t = t + 28;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      t = t + 30;\n  }\n  t = t + d;\n  if (f(y) == 1 && m > 2)\n    t = t + 1;\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  long int year[5], month[5], day[5], t[5];\n  long int c[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},\n           b[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};\n  for (i = 0; i <= 4; i++) {\n    scanf(\"%ld %ld %ld\", &year[i], &month[i], &day[i]);\n    if (year[i] % 4 == 0 && year[i] % 100 != 0 || year[i] % 400 == 0)\n      t[i] = c[month[i] - 1] + day[i];\n    else\n      t[i] = b[month[i] - 1] + day[i];\n  }\n  for (i = 0; i <= 4; i++)\n    cout << t[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20636", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a >> b >> c;\n  static int d[13] = {0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0) {\n    d[2] = 29;\n  } else {\n    d[2] = 28;\n  }\n  int i, sum = 0;\n  for (i = 1; i < b; i++) {\n    sum += d[i];\n  }\n  sum += c;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, D = 0, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  } else {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < month - 1; i++)\n      D = D + a[i];\n    D = D + day;\n  }\n  cout << D;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, num = 0;\n  int Ping[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  cin >> year;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    ;\n  } else {\n    Ping[2]++;\n  }\n  cin >> month >> day;\n  for (int i = 0; i < month; i++) {\n    num += Ping[i];\n  }\n  printf(\"%d\\n\", num + day);\n  return 0;\n}\n"}
{"label": "11", "index": "20639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int i;\n\n  if (year % 4 == 0 || year % 100 == 0) {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2)\n      i = (month - 1) * 31 + day;\n    else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  } else {\n    if (month == 1) {\n      i = day;\n    } else if (month == 2)\n      i = (month - 1) * 31 + day;\n    else {\n      i = (month - 1) * 31 + day - month / 2 - 1;\n    }\n  }\n\n  printf(\"%d\", i);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r(int x) {\n  if (x % 4 != 0 || (x % 100 == 0 && x % 400 != 0))\n    return (0);\n  else\n    return (1);\n}\n\nint main() {\n  int m, y, i, j, d, s, t;\n  scanf(\"%d %d %d\", &m, &y, &d);\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n\n  if (r(m) == 1)\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (s = 0, i = 1; i < y; i++)\n    s = s + a[i];\n\n  s = s + d;\n\n  printf(\"%d\", s);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int x;\n  int Jan = 1, feb = 2, Mar = 3, Apr = 4, May = 5, Jun = 6;\n  int Jul = 7, Aug = 8, Sep = 9, Oct = 10, Nov = 11, Dec = 12;\n  int Feb;\n  {\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          Feb = 29;\n        else\n          Feb = 28;\n      } else\n        Feb = 29;\n    } else\n      Feb = 28;\n  }\n  if (month == Jan)\n    x = day;\n  if (month == feb)\n    x = 31 + day;\n  if (month == Mar)\n    x = 31 + Feb + day;\n  if (month == Apr)\n    x = 31 + Feb + 31 + day;\n  if (month == May)\n    x = 31 + Feb + 31 + 30 + day;\n  if (month == Jun)\n    x = 31 + Feb + 31 + 30 + 31 + day;\n  if (month == Jul)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + day;\n  if (month == Aug)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == Sep)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == Oct)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == Nov)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == Dec)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20642", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, num = 0, i,\n                        a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month >> day;\n  if ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) {\n    a[1] = 29;\n  } else {\n    a[1] = 28;\n  }\n  for (i = 0; i < month - 1; i++) {\n    num += a[i];\n  }\n  num += day;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "11", "index": "20643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    sum = sum + monthday[i - 1];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 60 + c;\n    else if (b == 4)\n      n = 91 + c;\n    else if (b == 5)\n      n = 121 + c;\n    else if (b == 6)\n      n = 152 + c;\n    else if (b == 7)\n      n = 182 + c;\n    else if (b == 8)\n      n = 213 + c;\n    else if (b == 9)\n      n = 244 + c;\n    else if (b == 10)\n      n = 274 + c;\n    else if (b == 11)\n      n = 305 + c;\n    else\n      n = 336 + c;\n  } else {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 59 + c;\n    else if (b == 4)\n      n = 90 + c;\n    else if (b == 5)\n      n = 120 + c;\n    else if (b == 6)\n      n = 151 + c;\n    else if (b == 7)\n      n = 181 + c;\n    else if (b == 8)\n      n = 212 + c;\n    else if (b == 9)\n      n = 243 + c;\n    else if (b == 10)\n      n = 273 + c;\n    else if (b == 11)\n      n = 304 + c;\n    else\n      n = 335 + c;\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  int x;\n  int Jan = 1, feb = 2, Mar = 3, Apr = 4, May = 5, Jun = 6;\n  int Jul = 7, Aug = 8, Sep = 9, Oct = 10, Nov = 11, Dec = 12;\n  int Feb;\n  {\n    if (year % 4 == 0) {\n      if (year % 100 == 0) {\n        if (year % 400 == 0)\n          Feb = 29;\n        else\n          Feb = 28;\n      } else\n        Feb = 29;\n    } else\n      Feb = 28;\n  }\n  if (month == Jan)\n    x = day;\n  if (month == feb)\n    x = 31 + day;\n  if (month == Mar)\n    x = 31 + Feb + day;\n  if (month == Apr)\n    x = 31 + Feb + 31 + day;\n  if (month == May)\n    x = 31 + Feb + 31 + 30 + day;\n  if (month == Jun)\n    x = 31 + Feb + 31 + 30 + 31 + day;\n  if (month == Jul)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + day;\n  if (month == Aug)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + day;\n  if (month == Sep)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + day;\n  if (month == Oct)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n  if (month == Nov)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n  if (month == Dec)\n    x = 31 + Feb + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    int m[13] = {0, 31, 60, 91, 121, 151, 182, 213, 244, 274, 305, 335, 366};\n    d = m[b - 1] + c;\n  } else {\n    int m[13] = {0, 31, 59, 90, 120, 150, 181, 212, 243, 273, 304, 334, 365};\n    d = m[b - 1] + c;\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, total = 0;\n  int year, month, day;\n  cin >> year >> month >> day;\n  for (j = 1; j < month; j++) {\n    if (j == 1 || j == 3 || j == 5 || j == 7 || j == 8 || j == 10 || j == 12)\n      total = total + 31;\n    if (j == 4 || j == 6 || j == 9 || j == 11)\n      total = total + 30;\n    if (j == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n        total = total + 29;\n      } else\n        total = total + 28;\n    }\n  }\n  total = total + day;\n  cout << total << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int result;\n  cin >> year >> month >> day;\n  result = (month - 1) * 30 + day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 2 || month == 4 || month == 5) {\n      result = result + 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 2;\n    }\n    if (month == 8) {\n      result = result + 3;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 4;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 5;\n    }\n  } else {\n    if (month == 2) {\n      result = result + 1;\n    }\n    if (month == 3) {\n      result = result - 1;\n    }\n    if (month == 6 || month == 7) {\n      result = result + 1;\n    }\n    if (month == 8) {\n      result = result + 2;\n    }\n    if (month == 9 || month == 10) {\n      result = result + 3;\n    }\n    if (month == 11 || month == 12) {\n      result = result + 4;\n    }\n  }\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "20649", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &a, &b, &c);\n  int sum = 0, i;\n  for (i = 0; i < b - 1; i++)\n    sum = sum + f[i];\n\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n\n    if (b < 3) {\n      d = sum + c;\n    } else {\n      d = sum + 1 + c;\n    }\n  } else {\n    d = sum + c;\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20650", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\nint main() {\n  int year, month, date;\n  scanf(\"%d %d %d \", &year, &month, &date);\n  int total = 0;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    day_of_month[2] = 29;\n\n    for (int i = 0; i < month; i++)\n      total += day_of_month[i];\n\n    total += date;\n  } else {\n    day_of_month[2] = 28;\n    for (int i = 0; i < month; i++) {\n      total += day_of_month[i];\n    }\n    total += date;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 100 == 0 && y % 400 == 0)\n    n[1] = 29;\n  if (y % 100 != 0 && y & 4 == 0)\n    n[1] = 29;\n  int sum = 0;\n  for (i = 0; i < m - 1; i++)\n    sum = sum + n[i];\n  cout << sum + d << \"\\n\";\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20652", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, a[20], b[20], c[20], x, day;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 1; i <= 5; i++) {\n    if (a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0) {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 29;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 29 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 29 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 29 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    } else {\n      if (b[i] == 1)\n        day = c[i];\n      else if (b[i] == 2)\n        day = c[i] + 31;\n      else if (b[i] == 3)\n        day = c[i] + 31 + 28;\n      else if (b[i] == 4)\n        day = c[i] + 31 + 28 + 31;\n      else if (b[i] == 5)\n        day = c[i] + 31 + 28 + 31 + 30;\n      else if (b[i] == 6)\n        day = c[i] + 31 + 28 + 31 + 30 + 31;\n      else if (b[i] == 7)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30;\n      else if (b[i] == 8)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      else if (b[i] == 9)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      else if (b[i] == 10)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      else if (b[i] == 11)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      else if (b[i] == 12)\n        day = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    }\n    printf(\"%d \", day);\n  }\n}\n"}
{"label": "11", "index": "20653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n                  sum = 0;\n  scanf(\"%d %d %d \", &n, &j, &k);\n  for (i = 0; i <= j - 1; i++) {\n    sum = sum + a[i];\n  }\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    if (j <= 2) {\n      sum = sum + k;\n    } else {\n      sum = sum + 1 + k;\n    }\n  } else {\n    sum = sum + k;\n  }\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, t, i;\n  for (i = 1; i <= 5;) {\n    cin >> y >> m >> d;\n    if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 60;\n        break;\n      case 4:\n        t = d + 91;\n        break;\n      case 5:\n        t = d + 121;\n        break;\n      case 6:\n        t = d + 152;\n        break;\n      case 7:\n        t = d + 182;\n        break;\n      case 8:\n        t = d + 213;\n        break;\n      case 9:\n        t = d + 244;\n        break;\n      case 10:\n        t = d + 274;\n        break;\n      case 11:\n        t = d + 305;\n        break;\n      case 12:\n        t = d + 335;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 59;\n        break;\n      case 4:\n        t = d + 90;\n        break;\n      case 5:\n        t = d + 120;\n        break;\n      case 6:\n        t = d + 151;\n        break;\n      case 7:\n        t = d + 181;\n        break;\n      case 8:\n        t = d + 212;\n        break;\n      case 9:\n        t = d + 243;\n        break;\n      case 10:\n        t = d + 273;\n        break;\n      case 11:\n        t = d + 304;\n        break;\n      case 12:\n        t = d + 334;\n        break;\n      }\n    }\n    cout << t << \"\\n\";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, d;\n  int month = 1, day = 1, lunar = 0, days = 1;\n  cin >> year >> mon >> d;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    lunar = 1;\n  while ((mon != month) || (d != day)) {\n    day++;\n    days++;\n    if ((day == 32) &&\n        ((month == 1) || (month == 3) || (month == 5) || (month == 7) ||\n         (month == 8) || (month == 10) || (month == 12))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 31) &&\n        ((month == 4) || (month == 6) || (month == 9) || (month == 11))) {\n      month++;\n      day = 1;\n    }\n    if ((day == 30) && (month == 2) && (lunar == 1)) {\n      month++;\n      day = 1;\n    }\n    if ((day == 29) && (month == 2) && (lunar == 0)) {\n      month++;\n      day = 1;\n    }\n  }\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int monthday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int i, j;\n  int sum = 0;\n  for (i = 1; i < month; i++) {\n    j = i - 1;\n    sum = sum + monthday[j];\n  }\n  sum = sum + day;\n  int a;\n  a = year % 4;\n  if (month > 2 && (a == 0 && year % 100 != 0 || year % 400 == 0)) {\n    sum = sum + 1;\n  }\n\n  cout << sum;\n  return 0;\n}\n"}
{"label": "11", "index": "20657", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, y, z;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  int s[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int m = 0;\n  int n = 0;\n  for (m = 0; m < y - 1; m++)\n    n += s[m];\n  int D;\n  if (((x % 4 == 0 && x % 100 != 0 || x % 400 == 0) && y != 1 && y != 2))\n    D = n + z + 1;\n  else\n    D = n + z;\n  printf(\"%d\", D);\n  return 0;\n}\n"}
{"label": "11", "index": "20658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, February, day;\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    February = 29;\n  else\n    February = 28;\n  if (month == 1)\n    day = date;\n  if (month == 2)\n    day = 31 + date;\n  if (month == 3)\n    day = 31 + February + date;\n  if (month == 4)\n    day = 31 + February + 31 + date;\n  if (month == 5)\n    day = 31 + February + 31 + 30 + date;\n  if (month == 6)\n    day = 31 + February + 31 + 30 + 31 + date;\n  if (month == 7)\n    day = 31 + February + 31 + 30 + 31 + 30 + date;\n  if (month == 8)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + date;\n  if (month == 9)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + date;\n  if (month == 10)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n  if (month == 11)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n  if (month == 12)\n    day = 31 + February + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n  printf(\"%d\\n\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int leap(int year);\n  int cal(int month, int day);\n  int call(int month, int day);\n  int k, year, month, day, num;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  k = leap(year);\n  if (k == 0) {\n    num = cal(month, day);\n  }\n  if (k == 1) {\n    num = call(month, day);\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n\nint leap(int year) {\n  int k;\n  if (year % 4 == 0) {\n    if (year % 100 == 0) {\n      if (year % 400 == 0)\n        k = 1;\n      else\n        k = 0;\n    } else\n      k = 1;\n  } else\n    k = 0;\n  return k;\n}\nint cal(int month, int day) {\n  int k;\n  switch (month) {\n  case 1:\n    k = day;\n    break;\n  case 2:\n    k = day + 31;\n    break;\n  case 3:\n    k = day + 31 + 28;\n    break;\n  case 4:\n    k = day + 31 + 28 + 31;\n    break;\n  case 5:\n    k = day + 31 + 28 + 31 + 30;\n    break;\n  case 6:\n    k = day + 31 + 28 + 31 + 30 + 31;\n    break;\n  case 7:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    k = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  return k;\n}\nint call(int month, int day) {\n  int k;\n  switch (month) {\n  case 1:\n    k = day;\n    break;\n  case 2:\n    k = day + 31;\n    break;\n  case 3:\n    k = day + 31 + 29;\n    break;\n  case 4:\n    k = day + 31 + 29 + 31;\n    break;\n  case 5:\n    k = day + 31 + 29 + 31 + 30;\n    break;\n  case 6:\n    k = day + 31 + 29 + 31 + 30 + 31;\n    break;\n  case 7:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30;\n    break;\n  case 8:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n    break;\n  case 9:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n    break;\n  case 10:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n    break;\n  case 11:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n    break;\n  case 12:\n    k = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n    break;\n  }\n  return k;\n}\n"}
{"label": "11", "index": "20660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint rui(int x) {\n  if (x % 4 != 0)\n    return (0);\n  else if (x % 100 == 0 && x % 400 != 0)\n    return (0);\n  else\n    return (1);\n}\nint main() {\n  int r[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 0; i < b - 1; i++)\n    n = n + r[i];\n  n = n + c;\n  if (rui(a) == 1 && b > 2)\n    n++;\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "11", "index": "20661", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 29 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 29 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 29 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 29 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  } else {\n    switch (b) {\n    case 1: {\n      d = c;\n      break;\n    }\n    case 2: {\n      d = 31 + c;\n      break;\n    }\n    case 3: {\n      d = 31 + 28 + c;\n      break;\n    }\n    case 4: {\n      d = 31 + 28 + 31 + c;\n      break;\n    }\n    case 5: {\n      d = 31 + 28 + 31 + 30 + c;\n      break;\n    }\n    case 6: {\n      d = 31 + 28 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 7: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    case 8: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 9: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n      break;\n    }\n    case 10: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n      break;\n    }\n    case 11: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n      break;\n    }\n    case 12: {\n      d = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n      break;\n    }\n    }\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20662", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint leap(int n) {\n  int leap = 0;\n  if (n % 400 == 0 || n % 100 != 0 && n % 4 == 0)\n    leap = 1;\n  return (leap);\n}\n\nint main() {\n  int year, month, day,\n      th = 0, a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (leap(year) == 1)\n    a[2] = 29;\n  for (int i = 0; i < month; i++)\n    th = th + a[i];\n  th = th + day;\n  printf(\"%d\", th);\n  return (0);\n}\n"}
{"label": "11", "index": "20663", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  cin >> a >> b >> c;\n  if ((a % 100 != 0 && a / 4 == 0) || a % 400 == 0) {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 60 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 91 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 121 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 152 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 182 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 213 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 244 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 274 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 305 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 335 + c);\n      break;\n    }\n  } else {\n    switch (b) {\n    case 1:\n      printf(\"%d\", c);\n      break;\n    case 2:\n      printf(\"%d\", d = 31 + c);\n      break;\n    case 3:\n      printf(\"%d\", d = 59 + c);\n      break;\n    case 4:\n      printf(\"%d\", d = 90 + c);\n      break;\n    case 5:\n      printf(\"%d\", d = 120 + c);\n      break;\n    case 6:\n      printf(\"%d\", d = 151 + c);\n      break;\n    case 7:\n      printf(\"%d\", d = 181 + c);\n      break;\n    case 8:\n      printf(\"%d\", d = 212 + c);\n      break;\n    case 9:\n      printf(\"%d\", d = 243 + c);\n      break;\n    case 10:\n      printf(\"%d\", d = 273 + c);\n      break;\n    case 11:\n      printf(\"%d\", d = 304 + c);\n      break;\n    case 12:\n      printf(\"%d\", d = 334 + c);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20664", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, n;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 60 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 91 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 121 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 152 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 182 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 213 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 9) {\n      n = 244 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 10) {\n      n = 274 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 11) {\n      n = 305 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 12) {\n      n = 336 + c;\n      printf(\"%d\\n\", n);\n    }\n  } else {\n    if (b == 1) {\n      printf(\"%d\\n\", c);\n    } else if (b == 2) {\n      n = 31 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 3) {\n      n = 59 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 4) {\n      n = 90 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 5) {\n      n = 120 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 6) {\n      n = 151 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 7) {\n      n = 181 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 8) {\n      n = 212 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 9) {\n      n = 243 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 10) {\n      n = 273 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 11) {\n      n = 304 + c;\n      printf(\"%d\\n\", n);\n    } else if (b == 12) {\n      n = 335 + c;\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int yy, mm, dd, i, n = 0;\n  cin >> yy >> mm >> dd;\n  if (yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0) {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n\n        n = n + 29;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    cout << n;\n\n  }\n\n  else {\n    for (i = 1; i < mm; i++) {\n      switch (i) {\n      case 1:\n        n = n + 31;\n        break;\n      case 2:\n        n = n + 28;\n        break;\n      case 3:\n        n = n + 31;\n        break;\n      case 4:\n        n = n + 30;\n        break;\n      case 5:\n        n = n + 31;\n        break;\n      case 6:\n        n = n + 30;\n        break;\n      case 7:\n        n = n + 31;\n        break;\n      case 8:\n        n = n + 31;\n        break;\n      case 9:\n        n = n + 30;\n        break;\n      case 10:\n        n = n + 31;\n        break;\n      case 11:\n        n = n + 30;\n        break;\n      case 12:\n        n = n + 31;\n        break;\n      }\n    }\n\n    n = n + dd;\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x;\n  cin >> a >> b >> c;\n  if (m(a) == 1) {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 60 + c;\n    if (b == 4)\n      x = 91 + c;\n    if (b == 5)\n      x = 121 + c;\n    if (b == 6)\n      x = 152 + c;\n    if (b == 7)\n      x = 182 + c;\n    if (b == 8)\n      x = 213 + c;\n    if (b == 9)\n      x = 244 + c;\n    if (b == 10)\n      x = 274 + c;\n    if (b == 11)\n      x = 305 + c;\n    if (b == 12)\n      x = 335 + c;\n    printf(\"%d\", x);\n  } else {\n    if (b == 1)\n      x = c;\n    if (b == 2)\n      x = 31 + c;\n    if (b == 3)\n      x = 59 + c;\n    if (b == 4)\n      x = 90 + c;\n    if (b == 5)\n      x = 120 + c;\n    if (b == 6)\n      x = 151 + c;\n    if (b == 7)\n      x = 181 + c;\n    if (b == 8)\n      x = 212 + c;\n    if (b == 9)\n      x = 243 + c;\n    if (b == 10)\n      x = 273 + c;\n    if (b == 11)\n      x = 304 + c;\n    if (b == 12)\n      x = 334 + c;\n    printf(\"%d\", x);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20667", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, dm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, day = 0,\n            month = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))\n    dm[1] = 29;\n  int i, m = 0, d = 0;\n  for (i = 0; i < month - 1; i++)\n    d += dm[i];\n  d += day;\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 400 == 0 || (a % 4 == 0 && a % 100 != 0)) {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 60 + c;\n      break;\n    }\n    case 4: {\n      n = 91 + c;\n      break;\n    }\n    case 5: {\n      n = 121 + c;\n      break;\n    }\n    case 6: {\n      n = 152 + c;\n      break;\n    }\n    case 7: {\n      n = 182 + c;\n      break;\n    }\n    case 8: {\n      n = 213 + c;\n      break;\n    }\n    case 9: {\n      n = 244 + c;\n      break;\n    }\n    case 10: {\n      n = 274 + c;\n      break;\n    }\n    case 11: {\n      n = 305 + c;\n      break;\n    }\n    case 12: {\n      n = 335 + c;\n      break;\n    }\n    }\n\n  } else {\n    switch (b) {\n    case 1: {\n      n = c;\n      break;\n    }\n    case 2: {\n      n = 31 + c;\n      break;\n    }\n    case 3: {\n      n = 59 + c;\n      break;\n    }\n    case 4: {\n      n = 90 + c;\n      break;\n    }\n    case 5: {\n      n = 120 + c;\n      break;\n    }\n    case 6: {\n      n = 151 + c;\n      break;\n    }\n    case 7: {\n      n = 181 + c;\n      break;\n    }\n    case 8: {\n      n = 212 + c;\n      break;\n    }\n    case 9: {\n      n = 243 + c;\n      break;\n    }\n    case 10: {\n      n = 273 + c;\n      break;\n    }\n    case 11: {\n      n = 304 + c;\n      break;\n    }\n    case 12: {\n      n = 334 + c;\n      break;\n    }\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint GetMonthDays(int year, int month);\nint CheckLeap(int year);\nint main() {\n  int year, month, day = 1, s = 0, i;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    s += GetMonthDays(year, i);\n  }\n  s += day;\n  printf(\"%d\", s);\n}\n\nint GetMonthDays(int year, int month) {\n  int day;\n  if (month == 4 || month == 6 || month == 9 || month == 11)\n    day = 30;\n  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 ||\n      month == 10 || month == 12)\n    day = 31;\n  if (month == 2) {\n    if (CheckLeap(year) == 1)\n      day = 29;\n    if (CheckLeap(year) == 0)\n      day = 28;\n  }\n  return day;\n}\n\nint CheckLeap(int year) {\n  int jugde = 0;\n  if (year % 100 != 0) {\n    if (year % 4 == 0)\n      jugde = 1;\n  }\n  if (year % 100 == 0) {\n    if (year % 400 == 0)\n      jugde = 1;\n  }\n  return jugde;\n}\n"}
{"label": "11", "index": "20670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, a, i = 1;\n  while (i <= 5) {\n    cin >> year >> month >> day;\n    if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) == 1) {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 29 + day;\n        break;\n      case 4:\n        a = 31 + 29 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 29 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 29 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        printf(\"error\\n\");\n      }\n    } else {\n      switch (month) {\n      case 1:\n        a = day;\n        break;\n      case 2:\n        a = 31 + day;\n        break;\n      case 3:\n        a = 31 + 28 + day;\n        break;\n      case 4:\n        a = 31 + 28 + 31 + day;\n        break;\n      case 5:\n        a = 31 + 28 + 31 + 30 + day;\n        break;\n      case 6:\n        a = 31 + 28 + 31 + 30 + 31 + day;\n        break;\n      case 7:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + day;\n        break;\n      case 8:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n        break;\n      case 9:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n        break;\n      case 10:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n        break;\n      case 11:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n        break;\n      case 12:\n        a = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n        break;\n      default:\n        cout << \"error\\n\";\n      }\n    }\n    printf(\"%d\\n\", a);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[3], leap = 1, day;\n  cin >> a[0] >> a[1] >> a[2];\n  if ((((a[0] % 4) && !(a[0] % 100))) || (a[0] % 400))\n    leap = 0;\n  if (a[1] == 1)\n    day = a[2];\n  if (a[1] == 2)\n    day = a[2] + 31;\n  if (a[1] == 3)\n    day = a[2] + 59 + leap;\n  if (a[1] == 4)\n    day = a[2] + 90 + leap;\n  if (a[1] == 5)\n    day = a[2] + 120 + leap;\n  ;\n  if (a[1] == 6)\n    day = a[2] + 151 + leap;\n  if (a[1] == 7)\n    day = a[2] + 181 + leap;\n  if (a[1] == 8)\n    day = a[2] + 212 + leap;\n  if (a[1] == 9)\n    day = a[2] + 243 + leap;\n  if (a[1] == 10)\n    day = a[2] + 273 + leap;\n  if (a[1] == 11)\n    day = a[2] + 304 + leap;\n  if (a[1] == 12)\n    day = a[2] + 334 + leap;\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int m = 0, n = 0;\n  cin >> year >> month >> date;\n  if (month == 1) {\n    n = date;\n  }\n  m = m + 31;\n  if (month == 2) {\n    n = m + date;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    m = m + 29;\n  } else {\n    m = m + 28;\n  }\n\n  if (month == 3) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 4) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 5) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 6) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 7) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 8) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 9) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 10) {\n    n = m + date;\n  }\n  m = m + 31;\n  if (month == 11) {\n    n = m + date;\n  }\n  m = m + 30;\n  if (month == 12) {\n    n = m + date;\n  }\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20673", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d = 0;\n  cin >> a >> b >> c;\n  if (b >= 2)\n    d = d + 31;\n  if (b >= 3)\n    d = d + 28;\n  if (b >= 4)\n    d = d + 31;\n  if (b >= 5)\n    d = d + 30;\n  if (b >= 6)\n    d = d + 31;\n  if (b >= 7)\n    d = d + 30;\n  if (b >= 8)\n    d = d + 31;\n  if (b >= 9)\n    d = d + 31;\n  if (b >= 10)\n    d = d + 30;\n  if (b >= 11)\n    d = d + 31;\n  if (b >= 12)\n    d = d + 31;\n  d = d + c;\n  if (((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) && b > 2)\n    d = d + 1;\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int x) {\n  if (x % 4 != 0)\n    return 0;\n  else if ((x % 100 == 0) && (x % 400 != 0))\n    return 0;\n  else\n    return 1;\n}\nint main() {\n  int y, m, d;\n  int j = 1;\n  int n = 0;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  int a[13];\n  a[1] = 31;\n  if (f(y) == 0)\n    a[2] = 28;\n  else\n    a[2] = 29;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  for (j = 1; j < m; j++)\n    n = n + a[j];\n  n = n + d;\n  printf(\"%d \", n);\n}\n"}
{"label": "11", "index": "20675", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, sum, i;\n  int N[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n  sum = 0;\n  for (i = 1; i < month; i++)\n    sum = sum + N[i - 1];\n\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    sum = sum + 1;\n  sum = sum + day;\n  printf(\"%d\", sum);\n}\n"}
{"label": "11", "index": "20676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, d, j;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    days[2]++;\n  d = c;\n  for (j = 1; j < b; j++)\n    d += days[j];\n\n  cout << d << \"\\n\";\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n\n    return 0;\n}\n"}
{"label": "11", "index": "20677", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month1, day;\n  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  cin >> year >> month1 >> day;\n  int i;\n  int sum = 0;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {\n    month[2] = month[2] + 1;\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  } else {\n    for (i = 1; i < month1; i++) {\n      sum = sum + month[i];\n    }\n    sum = sum + day;\n  }\n\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 29;\n      break;\n    case 4:\n      n = d + 31 * 2 + 29;\n      break;\n    case 5:\n      n = d + 29 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 29 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 29 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 29 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 29 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 29 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 29 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 29 + 31 * 6 + 30 * 4;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      n = d;\n      break;\n    case 2:\n      n = 31 + d;\n      break;\n    case 3:\n      n = d + 31 + 28;\n      break;\n    case 4:\n      n = d + 31 * 2 + 28;\n      break;\n    case 5:\n      n = d + 28 + 31 * 2 + 30;\n      break;\n    case 6:\n      n = d + 28 + 31 * 3 + 30;\n      break;\n    case 7:\n      n = d + 28 + 31 * 3 + 30 * 2;\n      break;\n    case 8:\n      n = d + 28 + 31 * 4 + 30 * 2;\n      break;\n    case 9:\n      n = d + 28 + 31 * 5 + 30 * 2;\n      break;\n    case 10:\n      n = d + 28 + 31 * 5 + 30 * 3;\n      break;\n    case 11:\n      n = d + 28 + 31 * 6 + 30 * 3;\n      break;\n    case 12:\n      n = d + 28 + 31 * 6 + 30 * 4;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int year, month, day, x;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 29 + day;\n    else if (month == 4)\n      x = 31 + 29 + 31 + day;\n    else if (month == 5)\n      x = 31 + 29 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 29 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 29 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 29 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  } else {\n    if (month == 1)\n      x = day;\n    else if (month == 2)\n      x = 31 + day;\n    else if (month == 3)\n      x = 31 + 28 + day;\n    else if (month == 4)\n      x = 31 + 28 + 31 + day;\n    else if (month == 5)\n      x = 31 + 28 + 31 + 30 + day;\n    else if (month == 6)\n      x = 31 + 28 + 31 + 30 + 31 + day;\n    else if (month == 7)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + day;\n    else if (month == 8)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + day;\n    else if (month == 9)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    else if (month == 10)\n      x = 31 + 28 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    else if (month == 11)\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    else if (month == 12)\n      x = 31 + 28 + 30 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n  }\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20680", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int year, month, date, sum;\n  int mon[1000];\n  mon[1] = mon[3] = mon[5] = mon[7] = mon[8] = mon[10] = mon[12] = 31;\n  mon[4] = mon[6] = mon[9] = mon[11] = 30;\n  sum = 0;\n\n  scanf(\"%d %d %d\", &year, &month, &date);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    mon[2] = 29;\n  } else {\n    mon[2] = 28;\n  }\n\n  int i;\n  for (i = 1; i < month; i++) {\n    sum += mon[i];\n  }\n  sum += date;\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int n;\n  int a = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    a = 1;\n  if (month == 1)\n    n = day;\n  if (month == 2)\n    n = 31 + day;\n  if (month == 3)\n    n = 59 + day;\n  if (month == 4)\n    n = 90 + day;\n  if (month == 5)\n    n = 120 + day;\n  if (month == 6)\n    n = 151 + day;\n  if (month == 7)\n    n = 181 + day;\n  if (month == 8)\n    n = 212 + day;\n  if (month == 9)\n    n = 243 + day;\n  if (month == 10)\n    n = 273 + day;\n  if (month == 11)\n    n = 304 + day;\n  if (month == 12)\n    n = 334 + 12;\n  if (month > 2 && a == 1)\n    n++;\n  printf(\"%d\", n);\n}\n"}
{"label": "11", "index": "20682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint mon(int n) {\n  int day;\n  switch (n) {\n  case 1:\n    day = 31;\n    break;\n  case 2:\n    day = 28;\n    break;\n  case 3:\n    day = 31;\n    break;\n  case 4:\n    day = 30;\n    break;\n  case 5:\n    day = 31;\n    break;\n  case 6:\n    day = 30;\n    break;\n  case 7:\n    day = 31;\n    break;\n  case 8:\n    day = 31;\n    break;\n  case 9:\n    day = 30;\n    break;\n  case 10:\n    day = 31;\n    break;\n  case 11:\n    day = 30;\n    break;\n  case 12:\n    day = 31;\n    break;\n  }\n  return (day);\n}\nint run(int year) {\n  int p;\n  if (year % 400 == 0)\n    p = 1;\n  else if ((year % 100 != 0) && (year % 4 == 0))\n    p = 1;\n  else\n    p = 0;\n  return (p);\n}\n\nint main() {\n  int year, month, date, i, n = 0;\n  cin >> year >> month >> date;\n  for (i = 1; i <= month - 1; i++)\n    n = n + mon(i);\n\n  n = n + date;\n  if (run(year) == 1)\n    n = n + 1;\n  else\n    n = n;\n  cout << n;\n\n  return (0);\n}\n"}
{"label": "11", "index": "20683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int year;\n  int month;\n  int day;\n} date;\nint main() {\n  int days;\n  scanf(\"%d%d%d\", &date.year, &date.month, &date.day);\n  switch (date.month) {\n  case 1:\n    days = date.day;\n    break;\n  case 2:\n    days = date.day + 31;\n    break;\n  case 3:\n    days = date.day + 59;\n    break;\n  case 4:\n    days = date.day + 90;\n    break;\n  case 5:\n    days = date.day + 120;\n    break;\n  case 6:\n    days = date.day + 151;\n    break;\n  case 7:\n    days = date.day + 181;\n    break;\n  case 8:\n    days = date.day + 212;\n    break;\n  case 9:\n    days = date.day + 243;\n    break;\n  case 10:\n    days = date.day + 273;\n    break;\n  case 11:\n    days = date.day + 304;\n    break;\n  case 12:\n    days = date.day + 334;\n    break;\n  }\n  if ((date.year % 4 == 0 && date.year % 100 != 0 || date.year % 400 == 0) &&\n      date.month >= 3)\n    days += 1;\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, mon, date, day = 0;\n  scanf(\"%d%d%d\", &year, &mon, &date);\n  switch (mon) {\n  case 1:\n    day = date;\n    break;\n  case 2:\n    day = 31 + date;\n    break;\n  case 3:\n    day = 31 + 28 + date;\n    break;\n  case 4:\n    day = 31 + 28 + 31 + date;\n    break;\n  case 5:\n    day = 31 + 28 + 31 + 30 + date;\n    break;\n  case 6:\n    day = 31 + 28 + 31 + 30 + 31 + date;\n    break;\n  case 7:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + date;\n    break;\n  case 8:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + date;\n    break;\n  case 9:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + date;\n    break;\n  case 10:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + date;\n    break;\n  case 11:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + date;\n    break;\n  case 12:\n    day = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + date;\n    break;\n  }\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    if (mon > 2)\n      day++;\n  }\n  printf(\"%d\", day);\n}\n"}
{"label": "11", "index": "20685", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, day, tot = 0, i;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n  cin >> y >> m >> day;\n  if ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))\n    a[1]++;\n  for (i = 0; i < m - 1; i++)\n    tot += a[i];\n  tot += day;\n  printf(\"%d \", tot);\n  return 0;\n}\n"}
{"label": "11", "index": "20686", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d[12], sum = 0;\n  int i;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {\n      d[i] = 31;\n    } else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      d[i] = 30;\n    } else {\n      if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0) {\n        d[2] = 29;\n      } else\n        d[2] = 28;\n    }\n    sum += d[i];\n  }\n  printf(\"%d\\n\", sum + c);\n  return 0;\n}\n"}
{"label": "11", "index": "20687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  scanf(\"%d%d%d\", &i, &j, &k);\n  if ((i % 4 == 0 && i % 100 != 0) || (i % 100 == 0 && i % 400 == 0)) {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 60;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 91;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 121;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 152;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 182;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 213;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 244;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 274;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 305;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 335;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 59;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 90;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 120;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 151;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 181;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 212;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 243;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 273;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 304;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 334;\n      printf(\"%d\", m);\n    }\n  }\n}\n"}
{"label": "11", "index": "20688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, day, n, k, m2;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n    m2 = 29;\n  else\n    m2 = 28;\n  k = m2 + 31;\n  switch (month) {\n  case 1:\n    n = day;\n    break;\n  case 2:\n    n = day + 31;\n    break;\n  case 3:\n    n = k + day;\n    break;\n  case 4:\n    n = k + 31 + day;\n    break;\n  case 5:\n    n = 31 + k + 30 + day;\n    break;\n  case 6:\n    n = k + 31 + 30 + 31 + day;\n    break;\n  case 7:\n    n = k + 31 + 30 + 31 + 30 + day;\n    break;\n  case 8:\n    n = k + 31 + 30 + 31 + 30 + 31 + day;\n    break;\n  case 9:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + day;\n    break;\n  case 10:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;\n    break;\n  case 11:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;\n    break;\n  case 12:\n    n = k + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;\n    break;\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, p, n[5] = {0}, year[5], month[5], day[5],\n            days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < 5; i++) {\n    scanf(\"%d%d%d\", &year[i], &month[i], &day[i]);\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0) || year[i] % 400 == 0)\n      days[2] = 29;\n    else\n      days[2] = 28;\n    for (p = 0; p < month[i]; p++)\n      n[i] = n[i] + days[p];\n    n[i] = n[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    printf(\"%d\\n\", n[i]);\n  return 0;\n}\n"}
{"label": "11", "index": "20690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, d, j;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n    days[2]++;\n  d = c;\n  for (j = 1; j < b; j++)\n    d += days[j];\n\n  printf(\"%d\\n\", d);\n  if ((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0))\n\n    return 0;\n}\n"}
{"label": "11", "index": "20691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  static int d[13] = {0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (a % 4 == 0 && a % 100 != 0 || a % 100 == 0)\n    d[2] = 29;\n  else\n    d[2] = 28;\n  int i, sum = 0;\n  for (i = 1; i < b; i++) {\n    sum += d[i];\n  }\n  sum += c;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0, a[12], i;\n  cin >> y >> m >> d;\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  for (i = 0; i < m - 1; i++) {\n    s = s + a[i];\n  }\n  s = s + d;\n  cout << s;\n  return 0;\n}\n"}
{"label": "11", "index": "20693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int sum = 0, days, year, month;\n  scanf(\"%d%d%d\", &year, &month, &days);\n  for (i = 0; i < month - 1; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + days;\n  if ((month == 2 && days >= 28) || (month > 2)) {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n      sum = sum + 1;\n  }\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint run(int nian) {\n  if (nian % 400 == 0)\n    return 1;\n  else if (nian % 100 == 0)\n    return 0;\n  else if (nian % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint mon(int m, int n) {\n  switch (m) {\n  case 1:\n  case 3:\n  case 5:\n  case 7:\n  case 8:\n  case 10:\n    return 31;\n  case 4:\n  case 6:\n  case 9:\n  case 11:\n    return 30;\n  default:\n    if (run(n))\n      return 29;\n    else\n      return 28;\n  }\n}\n\nint main() {\n  int year, month, day, date, i;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  date = 0;\n  for (i = 1; i < month; i++)\n    date = date + mon(i, year);\n  date = date + day;\n  cout << date;\n  return 0;\n}\n"}
{"label": "11", "index": "20695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int year, month, day, i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1, n = 0; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n      n = n + 31;\n    } else if (i == 2) {\n      if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n        n = n + 29;\n      } else {\n        n = n + 28;\n      }\n    } else {\n      n = n + 30;\n    }\n  }\n  n = n + day;\n  printf(\"%d\\n\", n);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, i, y = 0;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  for (i = 0; i < b - 1;) {\n    y = y + A[i];\n    i++;\n  }\n  y = y + c;\n  if (a % 4 == 0 & a % 100 != 0 || a % 400 == 0) {\n    if (b <= 2) {\n      cout << y;\n    } else {\n      y = y + 1;\n      printf(\"%d\", y);\n    }\n  } else\n    printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "11", "index": "20697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint fun(int y, int m, int d) {\n  int a[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n  int i, c;\n  c = 0;\n  for (i = 0; i < m; i++)\n    c = c + a[i];\n  c = c + d;\n  if ((m > 2) && (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)))\n    c++;\n  return c;\n}\n\nint main() {\n  int i, a, b, c;\n  for (i = 0; i < 100; i++)\n    if (scanf(\"%d %d %d \", &a, &b, &c))\n      printf(\"%d\\n\", fun(a, b, c));\n  return 0;\n}\n"}
{"label": "11", "index": "20698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else {\n          d = d + 28;\n        }\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j = j + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, m, d;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0 || y % 400 == 0) {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 29 + d;\n      break;\n    case 4:\n      x = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  } else {\n    switch (m) {\n    case 1:\n      x = d;\n      break;\n    case 2:\n      x = 31 + d;\n      break;\n    case 3:\n      x = 31 + 28 + d;\n      break;\n    case 4:\n      x = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      x = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      x = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y = 0, m = 0, d = 0, sum = 0, i = 0;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  for (i = 0; i <= m - 2; i++) {\n    sum = sum + a[i];\n  }\n  sum = sum + d;\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, n = 0;\n  int dayofmonth1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      dayofmonth2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d%d%d\", &year, &month, &day);\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth1[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  } else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n    for (i = 0; i < month - 1; i++) {\n      n += dayofmonth2[i];\n    }\n    n = n + day;\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20702", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, x, i;\n  cin >> a >> b >> c;\n  if (a % 4 == 0 && a % 100 != 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  if (a % 400 == 0) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0, x = 0; i < b - 1; i++) {\n      x = x + n[i];\n    }\n  }\n  x = x + c;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "11", "index": "20703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum_day(int, int);\n  int leap(int year);\n  int year, month, day, days;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  days = sum_day(month, day);\n  if (leap(year) && month >= 3)\n    days = days + 1;\n  printf(\"%d\", days);\n  return 0;\n}\nint sum_day(int month, int day) {\n  int day_tab[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i;\n  for (i = 1; i < month; i++)\n    day += day_tab[i];\n  return (day);\n}\nint leap(int year) {\n  int leap;\n  leap = year % 3 == 0 && year % 100 != 0 || year % 400 == 0;\n  return (leap);\n}\n"}
{"label": "11", "index": "20704", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, r, b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int c[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0,\n      q;\n  cin >> n >> y >> r;\n  if (n % 400 == 0 || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + b[i];\n    sum = sum + r;\n    cout << sum;\n  } else {\n    for (i = 1; i <= y - 1; i++)\n      sum = sum + c[i];\n    sum = sum + r;\n    printf(\"%d\", sum);\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "11", "index": "20705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, p, n[5] = {0}, year[5], month[5], day[5],\n            days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < 5; i++) {\n    cin >> year[i] >> month[i] >> day[i];\n    if ((year[i] % 4 == 0 && year[i] % 100 != 0) || year[i] % 400 == 0)\n      days[2] = 29;\n    else\n      days[2] = 28;\n    for (p = 0; p < month[i]; p++)\n      n[i] = n[i] + days[p];\n    n[i] = n[i] + day[i];\n  }\n  for (i = 0; i < 5; i++)\n    cout << n[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20706", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, a, i, ans;\n  for (i = 1; i <= 5; i++) {\n    scanf(\"%d %d %d \", &y, &m, &d);\n\n    if (y % 4 != 0)\n      a = 1;\n    else if (y % 100 != 0)\n      a = 0;\n    else if (y % 400 != 0)\n      a = 1;\n    else\n      a = 0;\n    if (a) {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 59 + d;\n        break;\n      case 4:\n        ans = 90 + d;\n        break;\n      case 5:\n        ans = 120 + d;\n        break;\n      case 6:\n        ans = 151 + d;\n        break;\n      case 7:\n        ans = 181 + d;\n        break;\n      case 8:\n        ans = 212 + d;\n        break;\n      case 9:\n        ans = 243 + d;\n        break;\n      case 10:\n        ans = 273 + d;\n        break;\n      case 11:\n        ans = 304 + d;\n        break;\n      case 12:\n        ans = 334 + d;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        ans = d;\n        break;\n      case 2:\n        ans = 31 + d;\n        break;\n      case 3:\n        ans = 60 + d;\n        break;\n      case 4:\n        ans = 91 + d;\n        break;\n      case 5:\n        ans = 121 + d;\n        break;\n      case 6:\n        ans = 152 + d;\n        break;\n      case 7:\n        ans = 182 + d;\n        break;\n      case 8:\n        ans = 213 + d;\n        break;\n      case 9:\n        ans = 244 + d;\n        break;\n      case 10:\n        ans = 274 + d;\n        break;\n      case 11:\n        ans = 305 + d;\n        break;\n      case 12:\n        ans = 335 + d;\n        break;\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, b;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = a[2] + 1;\n  b = d;\n  for (i = 1; i < m; i++) {\n    b = a[i] + b;\n  }\n  cout << b;\n  return 0;\n}\n"}
{"label": "11", "index": "20708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day;\n  int isleapyear;\n  cin >> year >> month >> day;\n\n  isleapyear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n  if (isleapyear && month == 2 && (day < 1 || day > 29)) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (isleapyear && month != 2 && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n  if (!isleapyear && (day < 1 || day > days[month])) {\n    printf(\"Illegal input.\\n\");\n    return -1;\n  }\n\n  int n = 0;\n  int i;\n  for (i = 0; i < month; i++) {\n    n += days[i];\n  }\n  n += day;\n  if (month > 2 && isleapyear) {\n    n++;\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, s = 0, a[12], i;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))\n    a[1] = 29;\n  else\n    a[1] = 28;\n  a[0] = a[2] = a[4] = a[6] = a[7] = a[9] = a[11] = 31;\n  a[3] = a[5] = a[8] = a[10] = 30;\n  for (i = 0; i < m - 1; i++)\n    s = s + a[i];\n\n  s = s + d;\n  printf(\"%d\", s);\n}\n"}
{"label": "11", "index": "20710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ping(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 28;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\nint run(int n) {\n  if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)\n    return 31;\n  if (n == 2)\n    return 29;\n  if (n == 4 || n == 6 || n == 9 || n == 11)\n    return 30;\n}\n\nint main() {\n  int n, month, day, sum = 0;\n  cin >> n >> month >> day;\n  int i;\n  if ((n % 400 == 0) || (n % 4 == 0 && n % 100 != 0)) {\n    for (i = 1; i < month; i++)\n      sum += run(i);\n    sum += day;\n    printf(\"%d\", sum);\n  } else {\n    for (i = 1; i < month; i++)\n      sum += ping(i);\n    sum += day;\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20711", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int y, m, md = 0, d, day, i;\n  cin >> y >> m >> d;\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  for (i = 0; i < m - 1; i++) {\n    md = md + month[i];\n  }\n  day = md + d;\n  printf(\"%d\", day);\n  return 0;\n}\n"}
{"label": "11", "index": "20712", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) {\n    int m[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    printf(\"%d\", k);\n  } else {\n    int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    int i;\n    int k = 0;\n    for (i = 0; i < (b - 1); i++) {\n      k = k + m[i];\n    }\n    k = k + c;\n    printf(\"%d\", k);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20713", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x, y, z, i, n;\n  scanf(\"%d %d %d\", &x, &y, &z);\n  if (x % 400 == 0)\n    i = 1;\n  else {\n    if (x % 100 == 0)\n      i = 0;\n    else {\n      if (x % 4 == 0)\n        i = 1;\n      else\n        i = 0;\n    }\n  }\n  if (i == 1) {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 29 + z;\n      break;\n    case 4:\n      n = 31 + 29 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 29 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 29 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  } else {\n    switch (y) {\n    case 1:\n      n = z;\n      break;\n    case 2:\n      n = 31 + z;\n      break;\n    case 3:\n      n = 31 + 28 + z;\n      break;\n    case 4:\n      n = 31 + 28 + 31 + z;\n      break;\n    case 5:\n      n = 31 + 28 + 31 + 30 + z;\n      break;\n    case 6:\n      n = 31 + 28 + 31 + 30 + 31 + z;\n      break;\n    case 7:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + z;\n      break;\n    case 8:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + z;\n      break;\n    case 9:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + z;\n      break;\n    case 10:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + z;\n      break;\n    case 11:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + z;\n      break;\n    case 12:\n      n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + z;\n      break;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, y;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    y = c;\n    break;\n  case 2:\n    y = 31 + c;\n    break;\n  case 3:\n    y = 59 + c;\n    break;\n  case 4:\n    y = 90 + c;\n    break;\n  case 5:\n    y = 120 + c;\n    break;\n  case 6:\n    y = 151 + c;\n    break;\n  case 7:\n    y = 181 + c;\n    break;\n  case 8:\n    y = 212 + c;\n    break;\n  case 9:\n    y = 243 + c;\n    break;\n  case 10:\n    y = 273 + c;\n    break;\n  case 11:\n    y = 304 + c;\n    break;\n  case 12:\n    y = 334 + c;\n  }\n  printf(\"\\n%d\", y);\n  return 0;\n}\n"}
{"label": "11", "index": "20715", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x = 0, i;\n  cin >> a >> b >> c;\n  if (m(a) == 1) {\n    int d[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  } else {\n    int d[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  }\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], i;\n  for (i = 0; i < 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n\n  printf(\"319\");\n  cout << \"\\n\";\n  printf(\"32\");\n  printf(\"\\n\");\n  printf(\"61\");\n  printf(\"\\n\");\n  printf(\"60\");\n  printf(\"\\n\");\n  printf(\"1\");\n  return 0;\n}\n"}
{"label": "11", "index": "20717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, a, s;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 100 == 0 && y % 400 == 0)) {\n    a = 29;\n  } else\n    a = 28;\n  if (m == 1) {\n    s = d;\n  } else if (m == 2) {\n    s = 31 + d;\n  } else if (m == 3) {\n    s = 31 + a + d;\n  } else if (m == 4) {\n    s = 31 * 2 + a + d;\n  } else if (m == 5) {\n    s = 31 * 2 + a + 30 + d;\n  } else if (m == 6) {\n    s = 31 * 3 + a + d + 30;\n  } else if (m == 7) {\n    s = 31 * 3 + a + d + 30 * 2;\n  } else if (m == 8) {\n    s = 31 * 4 + a + d + 30 * 2;\n  } else if (m == 9) {\n    s = 31 * 5 + a + d + 30 * 2;\n  } else if (m == 10) {\n    s = 31 * 5 + a + d + 30 * 3;\n  } else if (m == 11)\n    s = 31 * 6 + a + d + 30 * 3;\n  else if (m == 12) {\n    s = 31 * 6 + a + d + 30 * 4;\n  } else\n    ;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, num = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0) {\n    if (year % 100 == 0 && year % 400 != 0)\n      a[2] = 28;\n    else if (year % 400 == 0)\n      a[2] = 29;\n    else\n      a[2] = 29;\n  } else\n    a[2] = 28;\n  for (i = 1; i < month; i++)\n    num = num + a[i];\n  num = num + day;\n  cout << num;\n  return 0;\n}\n"}
{"label": "11", "index": "20719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (b == 1) {\n    d = c;\n  }\n  if (b == 2) {\n    d = c + 31;\n  }\n  if (b == 3) {\n    d = c + 31 + 28;\n  }\n  if (b == 4) {\n    d = c + 59 + 31;\n  }\n  if (b == 5) {\n    d = c + 90 + 30;\n  }\n  if (b == 6) {\n    d = c + 120 + 31;\n  }\n  if (b == 7) {\n    d = c + 151 + 30;\n  }\n  if (b == 8) {\n    d = c + 181 + 31;\n  }\n  if (b == 9) {\n    d = c + 212 + 31;\n  }\n  if (b == 10) {\n    d = c + 243 + 30;\n  }\n  if (b == 11) {\n    d = c + 273 + 31;\n  }\n  if (b == 12)\n    d = c + 304 + 30;\n\n  if (a % 100 == 0) {\n    if (a % 400 == 0) {\n      if (b != 1 && b != 2) {\n        d = d + 1;\n      }\n    }\n  } else if (a % 100 != 0 && a % 4 == 0) {\n    if (b != 1 && b != 2) {\n      d = d + 1;\n    }\n  }\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20720", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {\n\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 29 + d;\n      break;\n    case 4:\n      i = 31 + 29 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 29 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 29 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n\n  } else {\n    switch (m) {\n    case 1:\n      i = d;\n      break;\n    case 2:\n      i = 31 + d;\n      break;\n    case 3:\n      i = 31 + 28 + d;\n      break;\n    case 4:\n      i = 31 + 28 + 31 + d;\n      break;\n    case 5:\n      i = 31 + 28 + 31 + 30 + d;\n      break;\n    case 6:\n      i = 31 + 28 + 31 + 30 + 31 + d;\n      break;\n    case 7:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + d;\n      break;\n    case 8:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + d;\n      break;\n    case 9:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + d;\n      break;\n    case 10:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + d;\n      break;\n    case 11:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + d;\n      break;\n    case 12:\n      i = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + d;\n      break;\n    }\n  }\n  printf(\"%d\\n\", i);\n  return 0;\n}\n"}
{"label": "11", "index": "20721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n, p, a;\n  scanf(\"%d%d%d\", &m, &n, &p);\n  if (m % 4 != 0 || (m % 100 == 0 && m % 400 != 0)) {\n    if (n == 1) {\n      a = p;\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n    } else if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 2 + p;\n\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 29 + p;\n    }\n\n  } else {\n    if ((n - 1) % 2 == 0 && (n + 1) < 9) {\n      a = 61 * (n - 1) / 2 - 1 + p;\n\n    } else if ((n + 1) % 2 == 0 && (n + 1) > 9) {\n      a = 61 * (n - 1) / 2 + p;\n    } else if (n == 1) {\n      a = p;\n    } else if (n == 2) {\n      a = 31 + p;\n    }\n\n    else {\n      a = 61 * (n - 2) / 2 + 30 + p;\n    }\n  }\n\n  cout << a;\n  return 0;\n}\n"}
{"label": "11", "index": "20722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t, i;\n  for (i = 1; i <= 5;) {\n    scanf(\"%d %d %d\", &y, &m, &d);\n    if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 60;\n        break;\n      case 4:\n        t = d + 91;\n        break;\n      case 5:\n        t = d + 121;\n        break;\n      case 6:\n        t = d + 152;\n        break;\n      case 7:\n        t = d + 182;\n        break;\n      case 8:\n        t = d + 213;\n        break;\n      case 9:\n        t = d + 244;\n        break;\n      case 10:\n        t = d + 274;\n        break;\n      case 11:\n        t = d + 305;\n        break;\n      case 12:\n        t = d + 335;\n        break;\n      }\n    } else {\n      switch (m) {\n      case 1:\n        t = d;\n        break;\n      case 2:\n        t = d + 31;\n        break;\n      case 3:\n        t = d + 59;\n        break;\n      case 4:\n        t = d + 90;\n        break;\n      case 5:\n        t = d + 120;\n        break;\n      case 6:\n        t = d + 151;\n        break;\n      case 7:\n        t = d + 181;\n        break;\n      case 8:\n        t = d + 212;\n        break;\n      case 9:\n        t = d + 243;\n        break;\n      case 10:\n        t = d + 273;\n        break;\n      case 11:\n        t = d + 304;\n        break;\n      case 12:\n        t = d + 334;\n        break;\n      }\n    }\n    printf(\"%d\\n\", t);\n    i++;\n  }\n}\n"}
{"label": "11", "index": "20723", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, z, k = 0, i;\n  cin >> x >> y >> z;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))\n    for (i = 0; i < y - 1; i++)\n      k = k + b[i];\n  else\n    for (i = 0; i < y - 1; i++)\n      k = k + a[i];\n  k = k + z;\n  cout << k;\n  return 0;\n}\n"}
{"label": "11", "index": "20724", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  switch (b) {\n  case 1:\n    n = c;\n    break;\n  case 2:\n    n = 31 + c;\n    break;\n  case 3:\n    n = 31 + 28 + c;\n    break;\n  case 4:\n    n = 31 + 28 + 31 + c;\n    break;\n  case 5:\n    n = 31 + 28 + 31 + 30 + c;\n    break;\n  case 6:\n    n = 31 + 28 + 31 + 30 + 31 + c;\n    break;\n  case 7:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + c;\n    break;\n  case 8:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + c;\n    break;\n  case 9:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + c;\n    break;\n  case 10:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + c;\n    break;\n  case 11:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + c;\n    break;\n  case 12:\n    n = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + c;\n    break;\n  }\n  if (((a % 100 == 0 && a % 400 == 0) || (a % 400 == 0)) && b >= 3)\n    n = n + 1;\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int year, month, day;\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &year, &month, &day);\n\n  if (year % 4 != 0)\n    days[1] = 28;\n  else if (year % 4 == 0 && year % 100 != 0)\n    days[1] = 29;\n  else if (year % 400 == 0)\n    days[1] = 29;\n  else if (year % 100 == 0 && year % 400 != 0)\n    days[1] = 28;\n  int i, k = 0, n;\n  for (i = 1; i < month; i++) {\n    k = k + days[i];\n  }\n  n = k + day + 1;\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20726", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint leapyear(int year) {\n  if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int a[12];\n  int i, Year, Month, Day, date = 0;\n  cin >> Year >> Month >> Day;\n  if (leapyear(Year) == 1) {\n    int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++)\n      date = date + a[i];\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  } else if (leapyear(Year) == 0) {\n    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; i < (Month - 1); i++) {\n      date = date + a[i];\n    }\n    date = date + Day;\n    printf(\"%d\\n\", date);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int j, k, l;\n  scanf(\"%d%d%d\", &j, &k, &l);\n  if (j % 4 == 0) {\n    if (j % 100 != 0) {\n      a[1] = 29;\n    } else {\n      if (j % 100 == 0 && j % 400 == 0) {\n        a[1] = 29;\n      }\n    }\n    if (j % 100 == 0 && j % 400 != 0) {\n      a[1] = 28;\n    }\n  }\n  int sum = 0;\n  int m;\n  for (m = 0; m < k - 1; m++) {\n    sum = sum + a[m];\n  }\n  sum = sum + l;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, num;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 29;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 29 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 29 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 29 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  } else {\n    if (month == 1) {\n      num = day;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 2) {\n      num = day + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 3) {\n      num = day + 31 + 28;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 4) {\n      num = day + 31 + 28 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 5) {\n      num = day + 31 + 28 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 6) {\n      num = day + 31 + 28 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 7) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 8) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 9) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 10) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 11) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n      printf(\"%d\\n\", num);\n    }\n    if (month == 12) {\n      num = day + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0)\n    a = 0;\n  if (a % 100 == 0 && a % 400 == 0)\n    a = 0;\n  if (a != 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 28;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  if (a == 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 29;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, n;\n  cin >> a >> b >> c;\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 60 + c;\n    else if (b == 4)\n      n = 91 + c;\n    else if (b == 5)\n      n = 121 + c;\n    else if (b == 6)\n      n = 152 + c;\n    else if (b == 7)\n      n = 182 + c;\n    else if (b == 8)\n      n = 213 + c;\n    else if (b == 9)\n      n = 244 + c;\n    else if (b == 10)\n      n = 274 + c;\n    else if (b == 11)\n      n = 305 + c;\n    else\n      n = 336 + c;\n  } else {\n    if (b == 1)\n      n = c;\n    else if (b == 2)\n      n = 31 + c;\n    else if (b == 3)\n      n = 59 + c;\n    else if (b == 4)\n      n = 90 + c;\n    else if (b == 5)\n      n = 120 + c;\n    else if (b == 6)\n      n = 151 + c;\n    else if (b == 7)\n      n = 181 + c;\n    else if (b == 8)\n      n = 212 + c;\n    else if (b == 9)\n      n = 243 + c;\n    else if (b == 10)\n      n = 273 + c;\n    else if (b == 11)\n      n = 304 + c;\n    else\n      n = 335 + c;\n  }\n  cout << n;\n  return 0;\n}\n"}
{"label": "11", "index": "20731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0, i;\n  cin >> y >> m >> d;\n  if (m == 1) {\n    t += d;\n  } else if (m == 2) {\n    t += 31 + d;\n  } else {\n    if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n\n      for (i = 1; i < m; i++) {\n        if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n          t = t + 31;\n        }\n        if (i == 4 || i == 6 || i == 9 || i == 11) {\n          t = t + 30;\n        }\n        if (i == 2) {\n          t += 29;\n        }\n      }\n      t = t + d;\n    } else {\n      for (i = 1; i < m; i++) {\n        if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n          t = t + 31;\n        }\n        if (i == 4 || i == 6 || i == 9 || i == 11) {\n          t = t + 30;\n        }\n        if (i == 2) {\n          t += 28;\n        }\n      }\n      t = t + d;\n    }\n  }\n  cout << t;\n  return 0;\n}\n"}
{"label": "11", "index": "20732", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint month[2][12] = {31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31,\n                    31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\nint main() {\n  int year, monthq, day;\n  cin >> year >> monthq >> day;\n  int ans = 0;\n  for (int i = 1; i < monthq; i++) {\n    int xx;\n    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n      xx = 1;\n    else\n      xx = 0;\n    ans += month[xx][i - 1];\n  }\n  ans += day;\n  printf(\"%d\\n\", ans);\n  return 0;\n}\n"}
{"label": "11", "index": "20733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int a, b, c, x = 0, sum, i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  for (i = 0; i < 12; i++) {\n    if (i + 1 == b)\n      break;\n    x = x + days[i];\n  }\n  sum = x + c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b <= 2) {\n      printf(\"%d\", sum);\n    }\n    if (b > 2) {\n      sum = sum + 1;\n      cout << sum;\n    }\n\n  } else\n    printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, num, leap;\n  leap = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if (m == 1 || m == 2) {\n    if (m == 1)\n      num = d;\n    else\n      num = 31 + d;\n    cout << num << endl;\n  } else {\n    num = (m - 1) * 30 + d;\n    if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n      leap = 1;\n    if (leap == 1)\n      num = num - 1;\n    else\n      num = num - 2;\n    switch (m) {\n    case 3:\n      num = num + 1;\n      break;\n    case 4:\n    case 5:\n      num = num + 2;\n      break;\n    case 6:\n    case 7:\n      num = num + 3;\n      break;\n    case 8:\n    case 9:\n      num = num + 4;\n      break;\n    case 10:\n      num = num + 5;\n      break;\n    case 11:\n    case 12:\n      num = num + 6;\n      break;\n    default:\n      break;\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (!((a % 4 == 0 && a % 100 != 0) || (a % 4 == 0 && a % 400 == 0))) {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c - 1;\n    if (b == 4)\n      cout << 91 + c - 1;\n    if (b == 5)\n      cout << 121 + c - 1;\n    if (b == 6)\n      cout << 152 + c - 1;\n    if (b == 7)\n      cout << 182 + c - 1;\n    if (b == 8)\n      cout << 213 + c - 1;\n    if (b == 9)\n      cout << 244 + c - 1;\n    if (b == 10)\n      cout << 274 + c - 1;\n    if (b == 11)\n      cout << 305 + c - 1;\n    if (b == 12)\n      cout << 335 + c - 1;\n  } else {\n    if (b == 1)\n      cout << c;\n    if (b == 2)\n      cout << 31 + c;\n    if (b == 3)\n      cout << 60 + c;\n    if (b == 4)\n      cout << 91 + c;\n    if (b == 5)\n      cout << 121 + c;\n    if (b == 6)\n      cout << 152 + c;\n    if (b == 7)\n      cout << 182 + c;\n    if (b == 8)\n      cout << 213 + c;\n    if (b == 9)\n      cout << 244 + c;\n    if (b == 10)\n      cout << 274 + c;\n    if (b == 11)\n      cout << 305 + c;\n    if (b == 12)\n      cout << 335 + c;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f1(int y, int r) {\n  int a[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint f2(int y, int r) {\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int i, k, d = 0;\n  for (i = 0; i < 12; i++) {\n    if (y - 1 == i) {\n      for (k = 0; k < i; k++)\n        d = d + a[k];\n    }\n  }\n  d = d + r;\n  return d;\n}\nint main() {\n  int a, y, r, d;\n  scanf(\"%d%d%d\", &a, &y, &r);\n  if ((a % 100 != 0 && a % 4 == 0) || (a % 400 == 0))\n    d = f1(y, r);\n  else\n    d = f2(y, r);\n  printf(\"%d\", d);\n}\n"}
{"label": "11", "index": "20737", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint leap(int);\nint main() {\n  int y, month, d, sum = 0;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  scanf(\"%d %d %d \", &y, &month, &d);\n  m[2] = m[2] + leap(y);\n  for (int i = 0; i < month; i++) {\n    sum = sum + m[i];\n  }\n  sum = sum + d;\n  cout << sum << endl;\n  return 0;\n}\nint leap(int n) {\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    return 1;\n  else\n    return 0;\n}\n"}
{"label": "11", "index": "20738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int year) {\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day;\n  int days, i;\n  days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    if (i == 2) {\n      if (leap(year))\n        days += 29;\n      else {\n        days += 28;\n      }\n    }\n  }\n  days += day;\n  printf(\"%d\\n\", days);\n  return 0;\n}\n"}
{"label": "11", "index": "20739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, number = 0;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    for (i = 1; i <= m - 1; i++)\n      number = number + b[i - 1];\n    number = number + d;\n  } else {\n    for (i = 1; i <= m - 1; i++)\n      number = number + a[i - 1];\n    number = number + d;\n  }\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "11", "index": "20740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, t = 0, i;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (m == 1) {\n    t += d;\n  } else if (m == 2) {\n    t += 31 + d;\n  } else if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) {\n\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 29;\n      }\n    }\n    t = t + d;\n  } else {\n    for (i = 1; i < m; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        t = t + 31;\n      }\n      if (i == 4 || i == 6 || i == 9 || i == 11) {\n        t = t + 30;\n      }\n      if (i == 2) {\n        t += 28;\n      }\n    }\n    t = t + d;\n  }\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "11", "index": "20741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m(int n) {\n  if (n % 100 != 0) {\n    if (n % 4 == 0)\n      return (1);\n    else\n      return (0);\n  } else {\n    if (n % 400 == 0)\n      return (1);\n    else\n      return (0);\n  }\n}\nint main() {\n  int a, b, c, x = 0, i;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (m(a) == 1) {\n    int d[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  } else {\n    int d[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};\n    for (i = 1; i < b; i++)\n      x = x + d[i - 1];\n    x = x + c;\n  }\n  printf(\"%d\", x);\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  int sum = 0, i;\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20743", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, n = 0;\n  cin >> y >> m >> d;\n  int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    a[1] = 29;\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  } else {\n    if (m == 1)\n      n = n + d;\n    else {\n      for (int i = 1; i < m; i++)\n        n = n + a[i - 1];\n      n = n + d;\n    }\n  }\n  printf(\"%d\", n);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int year;\n  int month;\n  int day;\n} date;\nint main() {\n  int days;\n  cin >> date.year >> date.month >> date.day;\n  switch (date.month) {\n  case 1:\n    days = date.day;\n    break;\n  case 2:\n    days = date.day + 31;\n    break;\n  case 3:\n    days = date.day + 59;\n    break;\n  case 4:\n    days = date.day + 90;\n    break;\n  case 5:\n    days = date.day + 120;\n    break;\n  case 6:\n    days = date.day + 151;\n    break;\n  case 7:\n    days = date.day + 181;\n    break;\n  case 8:\n    days = date.day + 212;\n    break;\n  case 9:\n    days = date.day + 243;\n    break;\n  case 10:\n    days = date.day + 273;\n    break;\n  case 11:\n    days = date.day + 304;\n    break;\n  case 12:\n    days = date.day + 334;\n    break;\n  }\n  if ((date.year % 4 == 0 && date.year % 100 != 0 || date.year % 400 == 0) &&\n      date.month >= 3) {\n    days += 1;\n  }\n  cout << days;\n  return 0;\n}\n"}
{"label": "11", "index": "20745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint isRN(int year) {\n  int result;\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    result = 1;\n  else\n    result = 0;\n  return result;\n}\nint main() {\n  int year, month, day;\n  int i;\n  int sum = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      sum += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      sum += 30;\n    else {\n      if (isRN(year) == 1)\n        sum += 29;\n      else\n        sum += 28;\n    }\n  }\n  sum += day;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "11", "index": "20746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, a,\n      m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, i, sum = 0;\n  cin >> year >> month >> day;\n  if (year % 4 == 0 && year % 100 != 0)\n    a = 1;\n  else if (year % 100 == 0 && year % 400 == 0)\n    a = 1;\n  else\n    a = 0;\n  if (a == 1) {\n    m[1] = 29;\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  } else if (a == 0) {\n    for (i = 0; i < month - 1; i++)\n      sum = sum + m[i];\n    sum = sum + day;\n  }\n  printf(\"%d \", sum);\n}\n"}
{"label": "11", "index": "20747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, i;\n  int j = 1;\n  while (j <= 5) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    i = 1;\n    d = 0;\n    while (i < b) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n        d = d + 31;\n      else if (i == 2) {\n        if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0)\n          d = d + 29;\n        else\n          d = d + 28;\n      } else if (i == 4 || i == 6 || i == 9 || i == 11)\n        d = d + 30;\n      i = i + 1;\n    }\n    d = d + c;\n    printf(\"%d\\n\", d);\n    j = j + 1;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20748", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, feb, i, m, n = 0, q;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    feb = 29;\n  } else {\n    feb = 28;\n  }\n\n  for (i = 1; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      m = 31;\n    else if (i == 2)\n      m = feb;\n    else\n      m = 30;\n    n = n + m;\n  }\n  q = n + c;\n  printf(\"%d\", q);\n  return 0;\n}\n"}
{"label": "11", "index": "20749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year[6], month[6], day[6], s[6] = {0};\n  int i = 1, n;\n  int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  n = 1;\n  while (n <= 5) {\n    scanf(\"%d %d %d \", &year[n], &month[n], &day[n]);\n    if ((year[n] % 4 == 0 && year[n] % 100 != 0) || year[n] % 400 == 0)\n      m[2] = 29;\n    else\n      m[2] = 28;\n    while (i < month[n]) {\n      s[n] = s[n] + m[i];\n      i = i + 1;\n    }\n    s[n] = s[n] + day[n];\n    n = n + 1;\n    i = 1;\n  }\n  for (n = 1; n <= 5; n = n + 1)\n    cout << s[n] << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20750", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, D;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60;\n      break;\n    case 4:\n      D = c + 91;\n      break;\n    case 5:\n      D = c + 121;\n      break;\n    case 6:\n      D = c + 152;\n      break;\n    case 7:\n      D = c + 182;\n      break;\n    case 8:\n      D = c + 213;\n      break;\n    case 9:\n      D = c + 244;\n      break;\n    case 10:\n      D = c + 274;\n      break;\n    case 11:\n      D = c + 305;\n      break;\n    case 12:\n      D = c + 335;\n      break;\n    }\n    printf(\"%d\", D);\n\n  } else {\n    switch (b) {\n    case 1:\n      D = c;\n      break;\n    case 2:\n      D = c + 31;\n      break;\n\n    case 3:\n      D = c + 60 - 1;\n      break;\n    case 4:\n      D = c + 91 - 1;\n      break;\n    case 5:\n      D = c + 121 - 1;\n      break;\n    case 6:\n      D = c + 152 - 1;\n      break;\n    case 7:\n      D = c + 182 - 1;\n      break;\n    case 8:\n      D = c + 213 - 1;\n      break;\n    case 9:\n      D = c + 244 - 1;\n      break;\n    case 10:\n      D = c + 274 - 1;\n      break;\n    case 11:\n      D = c + 305 - 1;\n      break;\n    case 12:\n      D = c + 335 - 1;\n      break;\n    }\n\n    printf(\"%d\", D);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long a, b, c;\n  int i = 1;\nloop:\n  if (i <= 5) {\n    int n = 0;\n    scanf(\"%ld %ld %ld\", &a, &b, &c);\n    switch (b) {\n    case 12:\n      n = n + 30;\n    case 11:\n      n = n + 31;\n    case 10:\n      n = n + 30;\n    case 9:\n      n = n + 31;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 30;\n    case 6:\n      n = n + 31;\n    case 5:\n      n = n + 30;\n    case 4:\n      n = n + 31;\n    case 3:\n      n = n + 28;\n    case 2:\n      n = n + 31;\n    case 1:\n      n = n + c;\n      break;\n    }\n    if (((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) && b >= 3)\n      n = n + 1;\n    printf(\"%d\\n\", n);\n    i++;\n    goto loop;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, year, month, day, date = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      date = date + 30;\n    else {\n      if (i == 2) {\n        if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0)\n          date = date + 29;\n        else\n          date = date + 28;\n      } else\n        date = date + 31;\n    }\n  }\n  date = date + day;\n  cout << date << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if (year % 4 != 0 || (year % 100 == 0 && year % 400 != 0)) {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59);\n    else if (month == 4)\n      printf(\"%d\", day + 90);\n    else if (month == 5)\n      printf(\"%d\", day + 120);\n    else if (month == 6)\n      printf(\"%d\", day + 151);\n    else if (month == 7)\n      printf(\"%d\", day + 181);\n    else if (month == 8)\n      printf(\"%d\", day + 212);\n    else if (month == 9)\n      printf(\"%d\", day + 242);\n    else if (month == 10)\n      printf(\"%d\", day + 273);\n    else if (month == 11)\n      printf(\"%d\", day + 304);\n    else if (month == 12)\n      printf(\"%d\", day + 334);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    else if (month == 2)\n      printf(\"%d\", day + 31);\n    else if (month == 3)\n      printf(\"%d\", day + 59 + 1);\n    else if (month == 4)\n      printf(\"%d\", day + 90 + 1);\n    else if (month == 5)\n      printf(\"%d\", day + 120 + 1);\n    else if (month == 6)\n      printf(\"%d\", day + 151 + 1);\n    else if (month == 7)\n      printf(\"%d\", day + 182);\n    else if (month == 8)\n      printf(\"%d\", day + 213);\n    else if (month == 9)\n      printf(\"%d\", day + 243);\n    else if (month == 10)\n      cout << day + 274;\n    else if (month == 11)\n      printf(\"%d\", day + 305);\n    else if (month == 12)\n      printf(\"%d\", day + 335);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, daynum = 0, i;\n  cin >> year >> month >> day;\n  int month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int judgeleap;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    for (i = 0; i < month - 1; i++)\n      daynum += month2[i];\n\n  } else {\n    for (i = 0; i < month - 1; i++) {\n      daynum += month1[i];\n    }\n  }\n  daynum = daynum + day;\n  cout << daynum;\n  return 0;\n}\n"}
{"label": "11", "index": "20755", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long a, b, c;\n  int i = 1;\nloop:\n  if (i <= 5) {\n    int n = 0;\n    scanf(\"%ld %ld %ld \", &a, &b, &c);\n    switch (b) {\n    case 12:\n      n = n + 30;\n    case 11:\n      n = n + 31;\n    case 10:\n      n = n + 30;\n    case 9:\n      n = n + 31;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 30;\n    case 6:\n      n = n + 31;\n    case 5:\n      n = n + 30;\n    case 4:\n      n = n + 31;\n    case 3:\n      n = n + 28;\n    case 2:\n      n = n + 31;\n    case 1:\n      n = n + c;\n      break;\n    }\n    if (((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) && b >= 3)\n      n = n + 1;\n    printf(\"%d\\n\", n);\n    i++;\n    goto loop;\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, a, all, m1[5], m2[5], m3[5], i;\n  for (i = 0; i <= 4; i++) {\n    scanf(\"%d%d%d\", &m1[i], &m2[i], &m3[i]);\n  }\n  for (i = 0; i <= 4; i++) {\n    year = m1[i];\n    month = m2[i];\n    day = m3[i];\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 1:\n        a = 366;\n        break;\n      case 2:\n        a = 335;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 366 - a + day;\n\n    } else {\n      switch (month) {\n      case 1:\n        a = 365;\n        break;\n      case 2:\n        a = 334;\n        break;\n      case 3:\n        a = 306;\n        break;\n      case 4:\n        a = 275;\n        break;\n      case 5:\n        a = 245;\n        break;\n      case 6:\n        a = 214;\n        break;\n      case 7:\n        a = 184;\n        break;\n      case 8:\n        a = 153;\n        break;\n      case 9:\n        a = 122;\n        break;\n      case 10:\n        a = 92;\n        break;\n      case 11:\n        a = 61;\n        break;\n      case 12:\n        a = 31;\n        break;\n      }\n      all = 365 - a + day;\n    }\n    printf(\"%d\\n\", all);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, year, month, day, a[32], i, n;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  a[0] = 0;\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n  if (year % 4 == 0 && year % 200 == 0) {\n    a[2] = 29;\n  } else {\n    a[2] = 28;\n  }\n  for (i = 0; i < month; i++) {\n    sum = sum + a[i];\n  }\n  n = sum + day;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], c[5], d[5], x[5], i;\n  for (i = 1; i <= 5; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 1; i <= 5; i++) {\n    if ((a[i] % 4 == 0 && a[i] % 100 != 0 || a[i] % 400 == 0))\n      x[i] = 1;\n    else\n      x[i] = 0;\n    if (b[i] == 1)\n      d[i] = c[i];\n    else if (b[i] == 2)\n      d[i] = c[i] + 31;\n    else if (b[i] == 3)\n      d[i] = c[i] + 31 + 28 + x[i];\n    else if (b[i] == 4)\n      d[i] = c[i] + 31 + 28 + 31 + x[i];\n    else if (b[i] == 5)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + x[i];\n    else if (b[i] == 6)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 7)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + x[i];\n    else if (b[i] == 8)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 9)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + x[i];\n    else if (b[i] == 10)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + x[i];\n    else if (b[i] == 11)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + x[i];\n    else if (b[i] == 12)\n      d[i] = c[i] + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + x[i];\n    printf(\"%d \", d[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20759", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, m, d, result = 0;\n  cin >> year >> m >> d;\n  for (int i = 1; i < m; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      result += 31;\n    else if (i == 2) {\n      if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)\n        result += 29;\n      else\n        result += 28;\n    } else\n      result += 30;\n  }\n  result += d;\n  printf(\"%d\\n\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int year, mounth, day, count = 0, t = 0;\n  cin >> year >> mounth >> day;\n  if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n    count = 1;\n  } else\n    count = 0;\n  if (count == 1) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 60 + day;\n      break;\n    case 4:\n      t = 91 + day;\n      break;\n    case 5:\n      t = 121 + day;\n      break;\n    case 6:\n      t = 152 + day;\n      break;\n    case 7:\n      t = 182 + day;\n      break;\n    case 8:\n      t = 213 + day;\n      break;\n    case 9:\n      t = 244 + day;\n      break;\n    case 10:\n      t = 274 + day;\n      break;\n    case 11:\n      t = 305 + day;\n      break;\n    case 12:\n      t = 335 + day;\n      break;\n    }\n  }\n  if (count == 0) {\n    switch (mounth) {\n    case 1:\n      t = day;\n      break;\n    case 2:\n      t = 31 + day;\n      break;\n    case 3:\n      t = 59 + day;\n      break;\n    case 4:\n      t = 90 + day;\n      break;\n    case 5:\n      t = 120 + day;\n      break;\n    case 6:\n      t = 151 + day;\n      break;\n    case 7:\n      t = 181 + day;\n      break;\n    case 8:\n      t = 212 + day;\n      break;\n    case 9:\n      t = 243 + day;\n      break;\n    case 10:\n      t = 273 + day;\n      break;\n    case 11:\n      t = 304 + day;\n      break;\n    case 12:\n      t = 334 + day;\n      break;\n    }\n  }\n  cout << t;\n}\n"}
{"label": "11", "index": "20761", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day, result = 0, i;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10)\n      result += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11) {\n      result += 30;\n    } else if (i == 2) {\n      if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n        result += 29;\n      } else\n        result += 28;\n    }\n  }\n  result += day;\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "11", "index": "20762", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day;\n  cin >> year >> month >> day;\n  if (year % 400 == 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else if (year % 4 == 0 && year % 100 != 0) {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 60);\n    if (month == 4)\n      printf(\"%d\", day + 91);\n    if (month == 5)\n      printf(\"%d\", day + 121);\n    if (month == 6)\n      printf(\"%d\", day + 152);\n    if (month == 7)\n      printf(\"%d\", day + 182);\n    if (month == 8)\n      printf(\"%d\", day + 213);\n    if (month == 9)\n      printf(\"%d\", day + 244);\n    if (month == 10)\n      printf(\"%d\", day + 274);\n    if (month == 11)\n      printf(\"%d\", day + 305);\n    if (month == 12)\n      printf(\"%d\", day + 335);\n  } else {\n    if (month == 1)\n      printf(\"%d\", day);\n    if (month == 2)\n      printf(\"%d\", day + 31);\n    if (month == 3)\n      printf(\"%d\", day + 59);\n    if (month == 4)\n      printf(\"%d\", day + 90);\n    if (month == 5)\n      printf(\"%d\", day + 120);\n    if (month == 6)\n      printf(\"%d\", day + 151);\n    if (month == 7)\n      printf(\"%d\", day + 181);\n    if (month == 8)\n      printf(\"%d\", day + 212);\n    if (month == 9)\n      printf(\"%d\", day + 243);\n    if (month == 10)\n      printf(\"%d\", day + 273);\n    if (month == 11)\n      printf(\"%d\", day + 304);\n    if (month == 12)\n      printf(\"%d\", day + 334);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int Sn = 0;\n  int i = 0;\n  scanf(\"%d %d %d \", &year, &month, &day);\n  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {\n    int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  } else {\n    int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    while (i < month - 1) {\n      Sn = Sn + months[i];\n      i++;\n    }\n    Sn = Sn + day;\n  }\n  cout << Sn;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20764", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, n = 0;\n  cin >> y >> m >> d;\n  int ping[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0)) {\n    for (int i = 0; i < m - 1; i++)\n      n = n + ping[i];\n    n = n + d;\n  } else {\n    for (int i = 0; i < m - 1; i++)\n      n = n + run[i];\n    n = n + d;\n  }\n  cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint leap(int Y) {\n  if (Y % 400 == 0)\n    return 1;\n  else if (Y % 100 == 0)\n    return 0;\n  else if (Y % 4 == 0)\n    return 1;\n  else\n    return 0;\n}\nint main() {\n  int Y, M, D;\n  cin >> Y >> M >> D;\n  if (leap(Y) == 0) {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      cout << 31 + D;\n    if (M == 3)\n      printf(\"%d\", 31 + 28 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 28 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 28 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  } else {\n    if (M == 1)\n      printf(\"%d\", D);\n    if (M == 2)\n      printf(\"%d\", 31 + D);\n    if (M == 3)\n      printf(\"%d\", 31 + 29 + D);\n    if (M == 4)\n      printf(\"%d\", 31 + 29 + 31 + D);\n    if (M == 5)\n      printf(\"%d\", 31 + 29 + 31 + 30 + D);\n    if (M == 6)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + D);\n    if (M == 7)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + D);\n    if (M == 8)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + D);\n    if (M == 9)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + D);\n    if (M == 10)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + D);\n    if (M == 11)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + D);\n    if (M == 12)\n      printf(\"%d\", 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + D);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n;\n  cin >> i >> j >> k;\n  if ((i % 4 == 0 && i % 100 != 0) || (i % 100 == 0 && i % 400 == 0)) {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 60;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 91;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 121;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 152;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 182;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 213;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 244;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 274;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 305;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 335;\n      printf(\"%d\", m);\n    }\n  } else {\n    if (j == 1) {\n      m = k;\n      printf(\"%d\", m);\n    }\n    if (j == 2) {\n      m = k + 31;\n      printf(\"%d\", m);\n    }\n    if (j == 3) {\n      m = k + 59;\n      printf(\"%d\", m);\n    }\n    if (j == 4) {\n      m = k + 90;\n      printf(\"%d\", m);\n    }\n    if (j == 5) {\n      m = k + 120;\n      printf(\"%d\", m);\n    }\n    if (j == 6) {\n      m = k + 151;\n      printf(\"%d\", m);\n    }\n    if (j == 7) {\n      m = k + 181;\n      printf(\"%d\", m);\n    }\n    if (j == 8) {\n      m = k + 212;\n      printf(\"%d\", m);\n    }\n    if (j == 9) {\n      m = k + 243;\n      printf(\"%d\", m);\n    }\n    if (j == 10) {\n      m = k + 273;\n      printf(\"%d\", m);\n    }\n    if (j == 11) {\n      m = k + 304;\n      printf(\"%d\", m);\n    }\n    if (j == 12) {\n      m = k + 334;\n      printf(\"%d\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0, i, h;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    days[1] = 29;\n  } else {\n    days[1] = 28;\n  }\n  for (i = 0; i < m - 1; i++) {\n    sum = sum + days[i];\n  }\n  h = sum + d;\n  printf(\"%d\", h);\n  return 0;\n}\n"}
{"label": "11", "index": "20768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, b;\n  cin >> y >> m >> d;\n  if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))\n    a[2] = a[2] + 1;\n  b = d;\n  for (i = 1; i < m; i++) {\n    b = a[i] + b;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "11", "index": "20769", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[3] = {0}, b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\n      sum = 0, i;\n  scanf(\"%d %d %d \", &a[0], &a[1], &a[2]);\n  if (a[0] % 4 == 0 && a[0] % 100 != 0 || a[0] % 400 == 0)\n    b[1] = 29;\n  for (i = 0; i < a[1] - 1; i++)\n    sum += b[i];\n  sum += a[2];\n  cout << sum;\n}\n"}
{"label": "11", "index": "20770", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int y, m, d, p;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0)\n    if (y % 100 == 0)\n      if (y % 400 == 0)\n        p = 29;\n      else {\n        p = 28;\n      }\n    else {\n      p = 29;\n    }\n  else {\n    p = 28;\n  }\n\n  switch (m) {\n  case 1: {\n    printf(\"%d\", d);\n    break;\n  }\n  case 2: {\n    printf(\"%d\", d + 31);\n    break;\n  }\n  case 3: {\n    printf(\"%d\", d + 31 + p);\n    break;\n  }\n  case 4: {\n    printf(\"%d\", d + 31 * 2 + p);\n    break;\n  }\n  case 5: {\n    printf(\"%d\", d + 31 * 2 + p + 30);\n    break;\n  }\n  case 6: {\n    printf(\"%d\", d + 31 * 3 + p + 30);\n    break;\n  }\n  case 7: {\n    printf(\"%d\", d + 31 * 3 + p + 30 * 2);\n    break;\n  }\n  case 8: {\n    printf(\"%d\", d + 31 * 4 + p + 30 * 2);\n    break;\n  }\n  case 9: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 2);\n    break;\n  }\n  case 10: {\n    printf(\"%d\", d + 31 * 5 + p + 30 * 3);\n    break;\n  }\n  case 11: {\n    printf(\"%d\", d + 31 * 6 + p + 30 * 3);\n    break;\n  }\n  default: { printf(\"%d\", d + 31 * 6 + p + 30 * 4); }\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[5], c[5], k[5];\n  long a[5];\n  int j;\n  for (j = 1; j <= 5; j++) {\n    scanf(\"%ld %d %d\", &a[j - 1], &b[j - 1], &c[j - 1]);\n  }\n  for (j = 1; j <= 5; j++) {\n    int i, l, x;\n    if (a[j - 1] % 4 != 0)\n      l = 28;\n    else {\n      if ((a[j - 1] % 100 == 0) && (a[j - 1] % 400 != 0))\n        l = 28;\n      else\n        l = 29;\n    }\n    x = 0;\n    for (i = 1; i <= b[j - 1] - 1; i++) {\n      switch (i) {\n      case 1:\n        x = x + 31;\n        break;\n      case 2:\n        x = x + l;\n        break;\n      case 3:\n        x = x + 31;\n        break;\n      case 4:\n        x = x + 30;\n        break;\n      case 5:\n        x = x + 31;\n        break;\n      case 6:\n        x = x + 30;\n        break;\n      case 7:\n        x = x + 31;\n        break;\n      case 8:\n        x = x + 31;\n        break;\n      case 9:\n        x = x + 30;\n        break;\n      case 10:\n        x = x + 31;\n        break;\n      case 11:\n        x = x + 30;\n        break;\n      case 12:\n        x = x + 31;\n        break;\n      }\n    }\n    x = x + c[j - 1];\n    int m;\n    m = j - 1;\n    k[m] = x;\n    printf(\"%d\\n\", k[m]);\n  }\n}\n"}
{"label": "11", "index": "20772", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d %d %d \", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100) != 0) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 6) {\n      d = 152 + c;\n    } else if (b == 7) {\n      d = 182 + c;\n    } else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11) {\n      d = 305 + c;\n    } else if (b == 12) {\n      d = 335 + c;\n    }\n\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20773", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint shirunnian(int d) {\n  if (d % 4 == 0) {\n    if (d % 100 == 0) {\n      if (d % 400 == 0)\n        return 1;\n      else\n        return 0;\n    } else\n      return 1;\n  } else\n    return 0;\n}\n\nint dijitian(int a, int b, int c) {\n  int i;\n  int sum = 0;\n  int days = 0;\n  for (i = 0; i < b; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    else if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    else if (i == 2) {\n      if (shirunnian(a) == 1) {\n        days += 29;\n      } else if (shirunnian(a) == 0) {\n        days += 28;\n      }\n    }\n  }\n  sum = days + c;\n  return sum;\n}\n\nint main() {\n  int year, month, day, tianshu = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  tianshu = dijitian(year, month, day);\n  printf(\"%d\", tianshu);\n  return 0;\n}\n"}
{"label": "11", "index": "20774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, sum = 0, i, h;\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {\n    days[1] = 29;\n  } else {\n    days[1] = 28;\n  }\n  for (i = 0; i < m - 1; i++)\n    sum = sum + days[i];\n\n  h = sum + d;\n  cout << h;\n  return 0;\n}\n"}
{"label": "11", "index": "20775", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int month_l[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int n, m, d;\n  scanf(\"%d %d %d \", &n, &m, &d);\n  int counter = 0;\n  for (int i = 0; i < m - 1; i++) {\n    if (i == 1) {\n      if (n % 4 == 0 && (n % 100 != 0) || n % 400 == 0) {\n        counter++;\n      }\n    }\n    counter = counter + month[i];\n  }\n\n  counter = counter + d;\n  cout << counter;\n}\n"}
{"label": "11", "index": "20776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint y, m, d;\nint a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nvoid cal(int x) {\n  int sum = 0, i;\n  if (x) {\n    for (i = 0; i < m - 1; i++)\n      sum += b[i];\n    sum += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      sum += a[i];\n    sum += d;\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  scanf(\"%d%d%d\", &y, &m, &d);\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      cal(1);\n    else\n      cal(0);\n  } else {\n    if (y % 4 == 0)\n      cal(1);\n    else\n      cal(0);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day;\n  int total = 0;\n  cin >> year >> month >> day;\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n    int a[13] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int i = 1; i <= month - 1; i++) {\n      total = total + a[i - 1];\n    }\n    total = total + day;\n\n  } else {\n    int b[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (int j = 1; j <= month - 1; j++)\n      total = total + b[j - 1];\n\n    total = total + day;\n  }\n  cout << total << endl;\n\n  return 0;\n}\n"}
{"label": "11", "index": "20778", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, d;\n  scanf(\"%d %d %d \", &n, &x, &y);\n  d = 0;\n  if ((x > 2) && (n % 400 == 0))\n    d = 1;\n  if ((x > 2) && (n % 100 != 0) && (n % 4 == 0))\n    d = 1;\n  d = d + y;\n  x--;\n  switch (x) {\n  case 11:\n    d = d + 30;\n  case 10:\n    d = d + 31;\n  case 9:\n    d = d + 30;\n  case 8:\n    d = d + 31;\n  case 7:\n    d = d + 31;\n  case 6:\n    d = d + 30;\n  case 5:\n    d = d + 31;\n  case 4:\n    d = d + 30;\n  case 3:\n    d = d + 31;\n  case 2:\n    d = d + 28;\n  case 1:\n    d = d + 31;\n  }\n  printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "11", "index": "20779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, n = 0;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 != 0)\n    a = 0;\n  if (a % 100 == 0 && a % 400 == 0)\n    a = 0;\n  if (a != 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 28;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n  if (a == 0) {\n    switch (b - 1) {\n    case 12:\n      n = n + 31;\n    case 11:\n      n = n + 30;\n    case 10:\n      n = n + 31;\n    case 9:\n      n = n + 30;\n    case 8:\n      n = n + 31;\n    case 7:\n      n = n + 31;\n    case 6:\n      n = n + 30;\n    case 5:\n      n = n + 31;\n    case 4:\n      n = n + 30;\n    case 3:\n      n = n + 31;\n    case 2:\n      n = n + 29;\n    case 1:\n      n = n + 31;\n    }\n    n = n + c;\n    printf(\"%d\", n);\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, res = 0, i;\n  int y[12];\n  cin >> year >> month >> day;\n  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))\n    y[1] = 29;\n  else\n    y[1] = 28;\n  y[0] = 31;\n  y[2] = 31;\n  y[4] = 31;\n  y[7] = 31;\n  y[6] = 31;\n  y[9] = 31;\n  y[3] = 30;\n  y[5] = 30;\n  y[8] = 30;\n  y[10] = 30;\n  for (i = 0; i < month - 1; i++)\n    res += y[i];\n  res += day;\n  printf(\"%d\", res);\n  return 0;\n}\n"}
{"label": "11", "index": "20781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint r(int x) {\n  if (x % 4 != 0 || (x % 100 == 0 && x % 400 != 0))\n    return (0);\n  else\n    return (1);\n}\n\nint main() {\n  int m, y, i, d, s;\n  scanf(\"%d %d %d\", &m, &y, &d);\n  int a[13];\n  a[1] = 31;\n  a[3] = 31;\n  a[4] = 30;\n  a[5] = 31;\n  a[6] = 30;\n  a[7] = 31;\n  a[8] = 31;\n  a[9] = 30;\n  a[10] = 31;\n  a[11] = 30;\n  a[12] = 31;\n\n  if (r(m) == 1)\n    a[2] = 29;\n  else\n    a[2] = 28;\n  for (s = 0, i = 1; i < y; i++)\n    s = s + a[i];\n\n  s = s + d;\n\n  printf(\"%d\", s);\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20782", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int year, month, date;\n  int s = 0;\n  int i;\n  cin >> year >> month >> date;\n  if ((year % 400 == 0) || ((year % 100 != 0) & (year % 4 == 0))) {\n    int n[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  } else {\n    int n[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n    for (i = 0; (i + 1) < month; i++) {\n      s += n[i];\n    }\n    s = s + date;\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int y, m, d, i, c;\n  scanf(\"%d %d %d \", &y, &m, &d);\n  if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) {\n    days[2]++;\n  }\n  c = d;\n  for (i = 1; i < m; i++) {\n    c += days[i];\n  }\n  cout << c << endl;\n  return 0;\n}\n"}
{"label": "11", "index": "20784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year[10], mon[10], date[10], day[12], i, j, sum[10];\n  for (i = 0; i <= 4; i++)\n    scanf(\"%d %d %d\", &year[i], &mon[i], &date[i]);\n  for (i = 0; i <= 4; i++) {\n    sum[i] = 0;\n    day[0] = 31;\n    if (((year[i] % 4 == 0) && (year[i] % 100 != 0)) || (year[i] % 400 == 0))\n      day[1] = 29;\n    else\n      day[1] = 28;\n    day[2] = 31;\n    day[3] = 30;\n    day[4] = 31;\n    day[5] = 30;\n    day[6] = 31;\n    day[7] = 31;\n    day[8] = 30;\n    day[9] = 31;\n    day[10] = 30;\n    day[11] = 31;\n    for (j = 0; j <= mon[i] - 2; j++)\n      sum[i] = sum[i] + day[j];\n    sum[i] = sum[i] + date[i];\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, x = 0;\n  scanf(\"%d %d %d\", &year, &month, &day);\n  if (month == 2) {\n    x = 31 + day;\n    cout << x;\n  } else if (month == 1) {\n    x = day;\n    cout << x;\n  } else {\n    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n      switch (month) {\n      case 3:\n        x = 31 + 29;\n        break;\n      case 4:\n        x = 31 + 29 + 31;\n        break;\n\n      case 5:\n        x = 31 + 29 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 29 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 29 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    } else {\n      switch (month) {\n      case 3:\n        x = 31 + 28;\n        break;\n      case 4:\n        x = 31 + 28 + 31;\n        break;\n\n      case 5:\n        x = 31 + 28 + 31 + 30;\n        break;\n\n      case 6:\n        x = 31 + 28 + 31 + 30 + 31;\n        break;\n\n      case 7:\n        x = 31 + 28 + 31 + 30 + 31 + 30;\n        break;\n\n      case 8:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31;\n        break;\n\n      case 9:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;\n        break;\n\n      case 10:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;\n        break;\n\n      case 11:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;\n        break;\n      case 12:\n        x = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;\n        break;\n      }\n    }\n    x = x + day;\n\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int year, month, day, leap, sum = 0;\n  int a[12], i, j;\n  scanf(\"%d\", &year);\n  scanf(\"%d\", &month);\n  scanf(\"%d\", &day);\n  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))\n    leap = 1;\n  else\n    leap = 0;\n  a[0] = 31;\n  a[2] = 31;\n  a[3] = 30;\n  a[4] = 31;\n  a[5] = 30;\n  a[6] = 31;\n  a[7] = 31;\n  a[8] = 30;\n  a[9] = 31;\n  a[10] = 30;\n  a[11] = 31;\n  if (leap == 1)\n    a[1] = 29;\n  else\n    a[1] = 28;\n  for (i = 0; i < 12; i++) {\n    if (month == i + 1) {\n      for (j = 0; j < i; j++)\n        sum += a[j];\n      sum += day;\n      break;\n    }\n  }\n  cout << sum;\n  getchar();\n  getchar();\n}\n"}
{"label": "11", "index": "20787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, j;\n  scanf(\"%d %d %d\", &y, &m, &d);\n  if (y % 4 == 0) {\n    if (y % 100 == 0) {\n      if (y % 400 == 0)\n        j = 1;\n      else\n        j = 0;\n    } else\n      j = 1;\n\n  } else\n    j = 0;\n  if (j == 1) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 60);\n      break;\n    case 4:\n      printf(\"%d\", d + 91);\n      break;\n    case 5:\n      printf(\"%d\", d + 121);\n      break;\n    case 6:\n      printf(\"%d\", d + 152);\n      break;\n    case 7:\n      printf(\"%d\", d + 182);\n      break;\n    case 8:\n      printf(\"%d\", d + 213);\n      break;\n    case 9:\n      printf(\"%d\", d + 244);\n      break;\n    case 10:\n      printf(\"%d\", d + 274);\n      break;\n    case 11:\n      printf(\"%d\", d + 305);\n      break;\n    case 12:\n      printf(\"%d\", d + 335);\n      break;\n    }\n  }\n  if (j == 0) {\n    switch (m) {\n    case 1:\n      printf(\"%d\", d);\n      break;\n    case 2:\n      printf(\"%d\", d + 31);\n      break;\n    case 3:\n      printf(\"%d\", d + 59);\n      break;\n    case 4:\n      printf(\"%d\", d + 90);\n      break;\n    case 5:\n      printf(\"%d\", d + 120);\n      break;\n    case 6:\n      printf(\"%d\", d + 151);\n      break;\n    case 7:\n      printf(\"%d\", d + 181);\n      break;\n    case 8:\n      printf(\"%d\", d + 212);\n      break;\n    case 9:\n      printf(\"%d\", d + 243);\n      break;\n    case 10:\n      printf(\"%d\", d + 273);\n      break;\n    case 11:\n      printf(\"%d\", d + 304);\n      break;\n    case 12:\n      printf(\"%d\", d + 334);\n      break;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  cin >> a >> b >> c;\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 60 + c);\n    else if (b == 4)\n      cout << 91 + c;\n    else if (b == 5)\n      printf(\"%d\", 121 + c);\n    else if (b == 6)\n      printf(\"%d\", 152 + c);\n    else if (b == 7)\n      printf(\"%d\", 182 + c);\n    else if (b == 8)\n      printf(\"%d\", 213 + c);\n    else if (b == 9) {\n      printf(\"%d\", 244 + c);\n    } else if (b == 10)\n      printf(\"%d\", 274 + c);\n    else if (b == 11)\n      printf(\"%d\", 305 + c);\n    else if (b == 12)\n      printf(\"%d\", 336 + c);\n  } else {\n    if (b == 1)\n      printf(\"%d\", c);\n    else if (b == 2)\n      printf(\"%d\", 31 + c);\n    else if (b == 3)\n      printf(\"%d\", 59 + c);\n    else if (b == 4)\n      printf(\"%d\", 90 + c);\n    else if (b == 5)\n      printf(\"%d\", 120 + c);\n    else if (b == 6)\n      printf(\"%d\", 151 + c);\n    else if (b == 7)\n      printf(\"%d\", 181 + c);\n    else if (b == 8)\n      printf(\"%d\", 212 + c);\n    else if (b == 9)\n      printf(\"%d\", 243 + c);\n    else if (b == 10)\n      printf(\"%d\", 273 + c);\n    else if (b == 11)\n      printf(\"%d\", 304 + c);\n    else if (b == 12)\n      printf(\"%d\", 335 + c);\n  }\n\n  return 0;\n}\n"}
{"label": "11", "index": "20789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int year, month, day, d = 0;\n\n  scanf(\"%d%d%d\\n\", &year, &month, &day);\n\n  switch (month) {\n  case 1:\n    d = 0;\n    break;\n  case 2:\n    d = 31;\n    break;\n\n  case 3:\n    d = 59;\n    break;\n\n  case 4:\n    d = 90;\n    break;\n\n  case 5:\n    d = 120;\n    break;\n\n  case 6:\n    d = 151;\n    break;\n\n  case 7:\n    d = 181;\n    break;\n\n  case 8:\n    d = 212;\n    break;\n\n  case 9:\n    d = 243;\n    break;\n\n  case 10:\n    d = 273;\n    break;\n\n  case 11:\n    d = 304;\n    break;\n\n  case 12:\n    d = 334;\n    break;\n  }\n  if ((month > 2) && (year % 400 == 0)) {\n    d = d + 1 + day;\n  } else if ((month > 2) && (year % 100 != 0) && (year % 4 == 0)) {\n    d = d + 1 + day;\n  }\n\n  else {\n    d = d + day;\n  }\n\n  printf(\"%d\\n\", d);\n\n  return 0;\n}\n"}
{"label": "11", "index": "20790", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, n;\n  scanf(\"%d %d %d %d \", &y, &m, &d, &n);\n  if (y % 4 == 0 && y % 100 != 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  }\n  if (y % 400 == 0) {\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 1 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n      else\n        n = (m - 1) * 30 + m / 2 + d;\n    }\n  } else {\n\n    if (m == 1)\n      n = d;\n    else if (m == 2)\n      n = 31 + d;\n    else if (m <= 8) {\n      n = (m - 1) * 30 - 2 + m / 2 + d;\n\n    } else {\n      if (m % 2 == 0)\n        n = (m - 1) * 30 - 2 + m / 2 + d;\n      else\n        n = (m - 1) * 30 - 1 + m / 2 + d;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "11", "index": "20791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint leap(int year) {\n  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)\n    return 1;\n  else {\n    return 0;\n  }\n}\nint main() {\n  int year, month, day;\n  int days, i;\n  days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)\n      days += 31;\n    if (i == 4 || i == 6 || i == 9 || i == 11)\n      days += 30;\n    if (i == 2) {\n      if (leap(year))\n        days += 29;\n      else {\n        days += 28;\n      }\n    }\n  }\n  days += day;\n  printf(\"%d\\n\", days);\n}\n"}
{"label": "11", "index": "20792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (a % 4 == 0 && a % 100 > 0 || a % 400 == 0) {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2)\n        sum += 29;\n      else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  } else {\n    int sum = 0, i;\n    for (i = 1; i < b; i++) {\n      if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {\n        sum += 31;\n      } else if (i == 2) {\n        sum += 28;\n      } else {\n        sum += 30;\n      }\n    }\n    sum += c;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y, m, d, i, sum, n = 0, k[13];\n  scanf(\"%d %d %d\", &y, &m, &d);\n  k[0] = 0;\n  k[1] = k[3] = k[5] = k[7] = k[8] = k[10] = k[12] = 31;\n  k[4] = k[6] = k[9] = k[11] = 30;\n  if (y % 4) {\n    if (y % 100) {\n      if (y % 400) {\n        k[2] = 28;\n      } else {\n        k[2] = 29;\n      }\n    } else {\n      k[2] = 28;\n    }\n  } else {\n    k[2] = 29;\n  }\n  for (i = 0; i < m; i++) {\n    n = n + k[i];\n  }\n  sum = n + d;\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20794", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y, m, d, i, num, leap;\n  leap = 0;\n  cin >> y >> m >> d;\n  if (m == 1 || m == 2) {\n    if (m == 1)\n      num = d;\n    else\n      num = 31 + d;\n    printf(\"%d\\n\", num);\n  } else {\n    num = (m - 1) * 30 + d;\n    if ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0))\n      leap = 1;\n    if (leap == 1)\n      num = num - 1;\n    else\n      num = num - 2;\n    switch (m) {\n    case 3:\n      num = num + 1;\n      break;\n    case 4:\n    case 5:\n      num = num + 2;\n      break;\n    case 6:\n    case 7:\n      num = num + 3;\n      break;\n    case 8:\n    case 9:\n      num = num + 4;\n      break;\n    case 10:\n      num = num + 5;\n      break;\n    case 11:\n    case 12:\n      num = num + 6;\n      break;\n    default:\n      break;\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y, m, d, r;\n  int c(int y, int m, int d);\n  scanf(\"%d %d %d\", &y, &m, &d);\n  r = c(y, m, d);\n  printf(\"%d\", r);\n  return 0;\n}\n\nint run(int y) {\n  if (y % 400 == 0)\n    return 1;\n  else if (y % 100 == 0)\n    return 0;\n  else if (y % 4 == 0)\n    return 1;\n  return 0;\n}\n\nint c(int y, int m, int d) {\n  int i, total = 0, r = 0;\n  for (i = 1; i < m; i++)\n    switch (i) {\n    case 1:\n    case 3:\n    case 5:\n    case 7:\n    case 8:\n    case 10: {\n      r = r + 31;\n      break;\n    }\n    case 4:\n    case 6:\n    case 9:\n    case 11: {\n      r = r + 30;\n      break;\n    }\n    case 2: {\n      if (run(y))\n        r = r + 29;\n      else\n        r = r + 28;\n      break;\n    }\n    }\n  r = r + d;\n  return (r);\n}\n"}
{"label": "11", "index": "20796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct date {\n    int year;\n    int month;\n    int day;\n    int days;\n  } date1;\n  scanf(\"%d %d %d\", &date1.year, &date1.month, &date1.day);\n  int b[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  date1.days = 0;\n  int i;\n  if (date1.month > 1) {\n    for (i = 0; i <= date1.month - 2; i++) {\n      date1.days = date1.days + b[i];\n    }\n    date1.days = date1.days + date1.day;\n  } else\n    date1.days = date1.day;\n\n  printf(\"%d\", date1.days);\n  return 0;\n}\n"}
{"label": "11", "index": "20797", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, y, r, s = 0, i;\n  scanf(\"%d %d %d \", &n, &y, &r);\n  int a[12];\n  a[0] = 31, a[1] = 28, a[2] = 31, a[3] = 30, a[4] = 31, a[5] = 30, a[6] = 31,\n  a[7] = 31, a[8] = 30, a[9] = 31, a[10] = 30, a[11] = 31;\n  if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))\n    a[1] = 29;\n  for (i = 0; i < y - 1; i++)\n    s = s + a[i];\n  s = s + r;\n  printf(\"%d\\n\", s);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "11", "index": "20798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d %d %d\", &a, &b, &c);\n  d = 0;\n  int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {\n    for (e = 0; e < b; e++) {\n      d = d + days1[e];\n    }\n    d = d + c;\n  } else {\n    for (e = 0; e < b; e++) {\n      d = d + days2[e];\n    }\n    d = d + c;\n  }\n  d = d - 1;\n  cout << d;\n}\n"}
{"label": "11", "index": "20799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a, b, c, d;\n  scanf(\"%d%d%d\", &a, &b, &c);\n  if (((a % 4 == 0) && (a % 100) != 0) || (a % 400 == 0)) {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 60 + c;\n    } else if (b == 4) {\n      d = 91 + c;\n    } else if (b == 5) {\n      d = 121 + c;\n    } else if (b == 6) {\n      d = 152 + c;\n    } else if (b == 7)\n      d = 182 + c;\n    else if (b == 8) {\n      d = 213 + c;\n    } else if (b == 9) {\n      d = 244 + c;\n    } else if (b == 10) {\n      d = 274 + c;\n    } else if (b == 11)\n      d = 305 + c;\n    else if (b == 12) {\n      d = 335 + c;\n    }\n\n  } else {\n    if (b == 1) {\n      d = c;\n    } else if (b == 2) {\n      d = 31 + c;\n    } else if (b == 3) {\n      d = 59 + c;\n    } else if (b == 4) {\n      d = 90 + c;\n    } else if (b == 5) {\n      d = 120 + c;\n    } else if (b == 6) {\n      d = 151 + c;\n    } else if (b == 7) {\n      d = 181 + c;\n    } else if (b == 8) {\n      d = 212 + c;\n    } else if (b == 9) {\n      d = 243 + c;\n    } else if (b == 10) {\n      d = 273 + c;\n    } else if (b == 11) {\n      d = 304 + c;\n    } else if (b == 12) {\n      d = 334 + c;\n    }\n  }\n\n  cout << d << \"\\n\";\n  return 0;\n}\n"}
{"label": "11", "index": "20800", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint y, m, d;\nint a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nint b[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\nvoid cal(int x) {\n  int sum = 0, i;\n  if (x) {\n    for (i = 0; i < m - 1; i++)\n      sum += b[i];\n    sum += d;\n  } else {\n    for (i = 0; i < m - 1; i++)\n      sum += a[i];\n    sum += d;\n  }\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  cin >> y >> m >> d;\n  if (y % 100 == 0) {\n    if (y % 400 == 0)\n      cal(1);\n    else\n      cal(0);\n  } else {\n    if (y % 4 == 0)\n      cal(1);\n    else\n      cal(0);\n  }\n  return 0;\n}\n"}
{"label": "11", "index": "20801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int yn, mn, dn;\n  int result = 0;\n  scanf(\"%d %d %d\", &yn, &mn, &dn);\n  if (yn % 4 == 0 && yn % 100 != 0 || yn % 400 == 0) {\n    int day_of_month[13] = {0, 31, 29, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  } else {\n    int day_of_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31};\n    int i = 1;\n    while (i < mn) {\n      result = result + day_of_month[i];\n      i++;\n    }\n    result = result + dn;\n  }\n  cout << result;\n  return 0;\n}\n"}
{"label": "11", "index": "20802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int d[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n  int year, month, day, i, days = 0;\n  scanf(\"%d%d%d\", &year, &month, &day);\n  for (i = 1; i < month; i++) {\n    days = days + d[i - 1];\n  }\n  days = days + day;\n  if ((year % 4 == 0 || year % 400 == 0) && month > 2)\n    days = days++;\n  printf(\"%d\", days);\n  return 0;\n}\n"}
{"label": "12", "index": "20803", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, sum = 0;\n  int i = 0;\n\n  while (1) {\n    i = 0;\n    sum = 0;\n\n    while (1) {\n      cin >> num[i];\n\n      if (num[i] == -1)\n        return 0;\n      if (num[i] == 0)\n        break;\n      i++;\n    }\n\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = j + 1; k < i; k++) {\n        if (num[j] == 2 * num[k] || num[k] == 2 * num[j])\n          sum++;\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 100, m = 16, i = 1, j, k, t = 0;\n  int a[16];\n  while (n > 0) {\n    cin >> a[0];\n    if (a[0] == (-1))\n      break;\n    else {\n      while (m > 0) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        m--;\n        i++;\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k <= i - 1; k++) {\n          if (a[j] == 2 * a[k])\n            t++;\n        }\n    }\n    cout << t << endl;\n    t = 0;\n    m = 16;\n    i = 1;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, k, l;\n\n  for (l = 1; l < 3000; l++) {\n    s = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (k = 1; k <= 16; k++) {\n      scanf(\"%d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    for (i = 0; i < k - 1; i++) {\n      for (j = i + 1; j < k; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[16];\n  int i, j, k, num;\n  for (; c[0] != (-1);) {\n    num = 0;\n    scanf(\"%d\", &c[0]);\n    if (c[0] == (-1))\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &c[i]);\n      if (c[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (2 * c[k] == c[j]) {\n          num += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "20807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[100][15], i = 0, j = 0, x = 10, k = 0, m, num = 0;\n  for (i = 0; i < 100; i++) {\n    if (x == -1)\n      break;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &x);\n      if (x == -1)\n        break;\n      if (x == 0)\n        break;\n      a[i][j] = x;\n    }\n  }\n  k = i;\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < 15; j++) {\n      for (m = j + 1; m < 15; m++) {\n        if (a[i][j] * 1.0 / a[i][m] == 2 || a[i][m] * 1.0 / a[i][j] == 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, b[15], m, i, j, z, num = 0;\n  memset(a, 0, 1000 * sizeof(int));\n  memset(b, 0, 15 * sizeof(int));\n  while (1) {\n    i = 0;\n    do {\n\n      cin >> m;\n      if (m == 0)\n        break;\n      if (m == -1)\n        break;\n      b[i] = m;\n      i++;\n\n    } while (1);\n    if (m == -1)\n      break;\n\n    for (j = 0; j < i; j++) {\n      for (z = 0; z < i; z++) {\n        if (b[j] * 2 == b[z])\n          a[num]++;\n      }\n    }\n    num++;\n  }\n  for (j = 0; j < num; j++)\n    cout << a[j] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "12", "index": "20809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, m[20], i = 0, j = 0, t = 0;\n  char c;\n  scanf(\"%d%c\", &m[0], &c);\n  while (m[0] > 0) {\n    n = 1;\n    t = 0;\n    while (c != '\\n')\n      scanf(\"%d%c\", &m[n++], &c);\n    n--;\n    for (i = 0; i < n; i++) {\n      for (j = n; j > i; j--)\n        if ((m[j] == 2 * m[i]) || (m[i] == 2 * m[j]))\n          t++;\n    }\n    cout << t << \"\\n\";\n    scanf(\"%d%c\", &m[0], &c);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, flag;\n  while (1) {\n    flag = 0; \n    i = 0;\n    scanf(\"%d\", &a[i]);\n    if (a[0] == -1) \n      break;\n    else {\n      do {\n        i++;\n        scanf(\"%d\", &a[i]);\n      } while (a[i] != 0); \n      num = i;             \n      for (i = 0; i < num; i++)\n        for (j = i + 1; j < num; j++)\n          if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n            flag++;\n      printf(\"%d\\n\", flag);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][15], i, j, k, l;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      int n = 0;\n      for (j = 1;; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n      }\n      for (k = 0; k <= j - 1; k++)\n        for (l = 0; l <= j - 1; l++)\n          if (a[i][k] == 2 * a[i][l])\n            n = n + 1;\n\n      cout << n << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, b, j, k, m;\n  a[1] = 1;\n  while (a[1] != -1) {\n    i = 1;\n    m = 0;\n    while (scanf(\"%d \", &b)) {\n      a[i] = b;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n      i = i + 1;\n    }\n    for (j = 1; j <= i - 1; j++) {\n      for (k = 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          m++;\n      }\n    }\n    if (a[i] != -1)\n      cout << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, x = 0, a[20];\n  while (1) {\n    x = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (j = 1; a[j - 1] != 0; j++)\n      scanf(\"%d\", &a[j]);\n    for (k = 0; k < j - 1; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          x = x + 1;\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20814", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 1;\n  while (k == 1) {\n    int a[16];\n    scanf(\"%d \", &a[0]);\n    int l = 0;\n    if (a[0] == -1)\n      k = 0;\n    else {\n      while (a[l] != 0) {\n        l++;\n        cin >> a[l];\n      }\n      int i, j, num = 0;\n      for (i = 0; i < l - 1; i++)\n        for (j = i + 1; j < l; j++) {\n          if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0) {\n            num++;\n          }\n        }\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x1, x2, n[15], y;\n  int i;\n  int t;\n  while (1) {\n    \n    i = 0;\n    while (1) {\n      scanf(\"%d\", &t);\n      if (t == -1) {\n\n        return 0;\n      }\n      if (t == 0)\n        break;\n      else {\n        n[i] = t;\n        i++;\n      }\n    }\n    y = 0;\n    for (x1 = i - 1; x1 >= 0; x1--) {\n      for (x2 = x1 - 1; x2 >= 0; x2--) {\n        if (n[x1] == n[x2] * 2 || n[x2] == n[x1] * 2)\n          y += 1;\n      }\n    }\n    printf(\"%d\\n\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      cin >> c;\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (int i = 0; i < t; i++)\n      for (int j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][16], m, n;\n  int i, j, k;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> m;\n      if (m != 0) {\n        sz[i][j] = m;\n      } else {\n        break;\n      }\n    }\n    if (sz[i][0] == -1) {\n      break;\n    }\n  }\n  n = 0;\n  for (i = 0; i < 100; i++) {\n    if (sz[i][0] == -1) {\n      break;\n    }\n    for (j = 0; j < 15; j++) {\n      for (k = 0; k < 15; k++) {\n        if (sz[i][j] != 0 && sz[i][k] != 0) {\n          if (sz[i][j] == 2 * sz[i][k]) {\n            n = n + 1;\n          }\n        }\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count = 0;\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 2; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] / a[j] == 2 && a[k] % a[j] == 0 ||\n            a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20819", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], i, j, m, k, b, n;\n  for (n = 0;; n++) {\n    for (i = 0; i < 17; i++) {\n      cin >> m;\n      if (m == 0)\n        break;\n      if (m < 0)\n        goto er;\n      a[i] = m;\n    }\n    k = i;\n    b = 0;\n    for (i = 0; i < k; i++) {\n      for (j = i + 1; j < k; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\ner:\n  return 0;\n}\n"}
{"label": "12", "index": "20820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], i, j, k, t, N;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &num[0]);\n    if (num[0] == -1)\n      break;\n    N = 0;\n    for (j = 1;; j++) {\n      cin >> num[j];\n      if (num[j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (t = 0; t <= j - 1; t++) {\n        if (num[k] == 2 * num[t])\n          N++;\n      }\n    }\n    printf(\"%d\\n\", N);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, a[16], k;\n  for (i = 1;; i++) {\n    k = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[i] == 2 * a[j])\n          k++;\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[15], i, m = 0;\n  for (i = 0; i < 15; i++) {\n    cin >> c[i];\n    if (c[i] == 0) {\n      break;\n    }\n  }\n\n  int k, j, n = 0;\n  for (k = 0; c[k] != 0; k++) {\n    for (j = 0; c[j] != 0; j++) {\n\n      if (c[k] == 2 * c[j]) {\n        n++;\n      }\n    }\n  }\n  cout << n;\n}\n"}
{"label": "12", "index": "20823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, h;\n  int b[16] = {0};\n  while (1) {\n    i = 0;\n    while (scanf(\"%d \", &a)) {\n      if (a == (-1))\n        return 0;\n      else {\n        if (a != 0) {\n          b[i] = a;\n          i++;\n        } else\n          break;\n      }\n    }\n    h = 0;\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[j] != 0) {\n        for (k = 0; k <= i - 1; k++) {\n          if (b[j] == b[k] * 2)\n            h++;\n        }\n      } else\n        break;\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, num, s, a[101];\n  while (1) {\n    scanf(\"%d\", &s);\n    if (s == -1)\n      break;\n    num = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[s] = 1;\n    while (scanf(\"%d\", &s) == 1 && s != 0)\n      a[s] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] == 1 && a[2 * i] == 1)\n        num++;\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20825", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main()                                     \n{                                              \n  int a[16] = {0}, i = 1, j = 1, m = 0, k = 0; \n  while (cin >> a[0])                          \n  {\n    i = 1;\n    j = 1;\n    m = 0;\n    k = 0;          \n    if (a[0] != -1) \n    {\n      do {\n        cin >> a[i]; \n        i++;\n      } while (a[i - 1] != 0);     \n      for (j = 0; j <= i - 2; j++) \n      {\n        for (k = 0; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k]) \n            m++;                \n        }\n      } \n      cout << m << endl;\n    } \n    else\n      break; \n  }          \n  return 0;\n} \n"}
{"label": "12", "index": "20826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, x, y, m, n, a[20];\n  for (j = 1; j <= 15; j++) {\n    t = 0;\n    scanf(\"%d\", &y);\n    if (y == -1)\n      break;\n    else {\n      a[0] = y;\n      for (i = 1; i <= 20; i++) {\n        scanf(\"%d\", &x);\n        if (x == 0)\n          break;\n        else\n          a[i] = x;\n      }\n      for (m = 0; m <= i - 1; m++) {\n        for (n = 0; n <= i - 1; n++) {\n          if (a[m] == 2 * a[n])\n            t++;\n        }\n      }\n      cout << t << \"\\n\";\n    }\n  }\n}\n"}
{"label": "12", "index": "20827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, key, num;\n  key = 0;\n  int count[100];\n  int a[100][156];\n  int result[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &m);\n      if (m == 0) {\n        break;\n      } else if (m == -1) {\n        key = 1;\n        break;\n      } else {\n        a[i][j] = m;\n        count[i] = j;\n      }\n    }\n    if (key == 1) {\n      break;\n    }\n    num = i;\n  }\n  for (i = 0; i <= num; i++) {\n    result[i] = 0;\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; j <= count[i]; j++) {\n      for (k = 0; k <= count[i]; k++) {\n        if (a[i][j] == a[i][k] * 2)\n          result[i] = result[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, sum;\n  do {\n    sum = 0;\n    i = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 2 * a[j])\n            sum += 1;\n        }\n      }\n      cout << sum << endl;\n    } else\n      break;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "20829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int A[16];\n  int sum, j, i, k, m;\n  for (j = 0;; j++) {\n    scanf(\"%d\", &A[0]);\n    if (A[0] == -1)\n      return 0;\n    while (A[0] != 0 && A[0] != -1) {\n      sum = 0;\n      for (i = 1;; i++) {\n        cin >> A[i];\n        if (A[i] == 0) {\n          break;\n        }\n      }\n      for (k = 0; k < i; k++) {\n        for (m = 0; m < i; m++) {\n          if (A[k] == A[m] * 2) {\n            sum = sum + 1;\n          }\n        }\n      }\n      printf(\"%d\\n\", sum);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20830", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;; i++) {\n    cin >> a[i];\n    switch (a[i]) {\n    case -1:\n      return 0;\n    case 0: {\n      int s = 0;\n      for (int j = 0; j < i; j++)\n        for (int k = j; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            s++;\n      i = -1;\n      cout << s << endl;\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], duishu = 0, zushu, i;\n  for (zushu = 0; 1; zushu++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n    }\n    if (sz[0] == -1)\n      break;\n    for (i = 0; sz[i] != 0; i++) {\n      int j;\n      for (j = 0; sz[j] != 0; j++) {\n        if (sz[i] == 2 * sz[j])\n          duishu++;\n      }\n    }\n    cout << duishu << \"\\n\";\n    duishu = 0;\n    for (i = 0; i < 16; i++) {\n      sz[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w;\n  for (w = 1;; w++) {\n    int a[16], b = 0;\n    int i, j, q;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      b++;\n    }\n    if (a[1] == -1)\n      break;\n    int m = 0;\n    for (j = 1; j < b; j++) {\n      for (q = j + 1; q <= b; q++) {\n        if (a[j] == 2 * a[q])\n          m++;\n        else if (a[q] == 2 * a[j])\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int test[100][17] = {0};\n\n  int i, j, k, num;\n  int turn = 0, nonzero = 0, valid = 0;\n\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0)\n        break;\n      if (num == -1)\n        goto start;\n      test[i][j] = num;\n    }\n    turn += 1;\n  }\nstart:\n  for (i = 0; i < turn; i++) {\n    for (j = 0;; j++) {\n      if (test[i][j] != 0)\n        nonzero += 1;\n      else\n        break;\n    }\n    for (j = 0; j < nonzero; j++) {\n      for (k = 0; k < nonzero; k++) {\n        if ((float)(test[i][j]) / (float)(test[i][k]) == 2)\n          valid += 1;\n      }\n    }\n    cout << valid << \"\\n\";\n    valid = 0;\n    nonzero = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, a[100][100], s[1000], b[100] = {0}, k = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%d\", &s[i]);\n    if (s[i] == -1)\n      break;\n  }\n  for (i = 0; s[i] != -1; i++) {\n    if (s[i] != 0) {\n      a[k][j] = s[i];\n      j++;\n    } else {\n      a[k][j] = 0;\n      j = 0;\n      k++;\n    }\n  }\n  a[k][0] = -1;\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, s;\n  for (s = 0, cin >> a[1]; a[1] != -1; s = 0, cin >> a[1]) {\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j < i; j++)\n      for (k = 1; k < i; k++)\n        if (a[j] == 2 * a[k])\n          s++;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint chuli(int *p, int i) {\n\n  int count = 0;\n\n  for (int q = 0; q < i; q++) {\n    if (2 * (p[q]) > p[i - 1])\n      return count;\n\n    for (int j = q; j < i; j++) {\n\n      if (p[j] == 2 * (p[q])) {\n        count++;\n        break;\n      }\n      if (p[j] > 2 * (p[q])) {\n        break;\n      }\n    }\n  }\n\n  return count;\n}\nint main() {\n\n  int a[20];\n  int num;\n  while (scanf(\"%d \", &a[0]) && (a[0] != -1)) {\n    int i = 1;\n    while (cin >> a[i] && a[i])\n      i++;\n\n    qsort(a, i, sizeof(int), cmp);\n\n    num = chuli(a, i);\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, n, t;\n  while (a[0] != -1) {\n    t = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] <= 0) {\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 0; j < t; j++) {\n        for (m = 0; m < t; m++) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      cout << n << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20838", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, j, k;\n  int m;\n  int n;\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      n = 0;\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 0)\n            continue;\n          if (a[j] == 2 * a[k])\n            n = n + 1;\n        }\n      }\n      cout << n << endl;\n      a[0] = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, a[16];\n\n  while (1) {\n    int count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (j = 0; j < i; j++)\n      for (m = j + 1; m < i; m++)\n        if (a[j] == 2 * a[m])\n          count++;\n    for (j = 0; j < i; j++)\n      for (m = j + 1; m < i; m++)\n        if (2 * a[j] == a[m])\n          count++;\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "20840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15] = {1}, n, m, i, j, t;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    i = 1;\n    n = 1;\n    scanf(\"%d\", &a[1]);\n    while (a[i] != 0) {\n      n++;\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] > a[j]) {\n          t = a[i];\n          a[i] = a[j];\n          a[j] = t;\n        }\n\n    \n    m = 0;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[j] == 2 * a[i]) {\n          m++;\n          break;\n        }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "20841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, count = 0, row, arr[100][100], n[100], b[100];\n  for (i = 0; i < 100; i++) {\n    count = 0;\n    for (j = 0; j < 100; j++) {\n      cin >> arr[i][j];\n      if (arr[i][j] == 0 || arr[i][j] == -1) {\n        n[i] = count;\n        break;\n      }\n      count++;\n    }\n    if (arr[i][j] == -1) {\n      row = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    count = 0;\n    for (j = 0; j < n[i]; j++) {\n      for (k = j + 1; k < n[i]; k++) {\n        if (arr[i][j] == (arr[i][k] * 2) || (arr[i][j] * 2) == arr[i][k]) {\n          count++;\n        }\n      }\n    }\n    b[i] = count;\n  }\n  for (i = 0; i < row; i++)\n    printf(\"\\n%d\", b[i]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "20842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;;) {\n    cin >> a[i];\n    if (a[i] != 0 && a[i] != -1) {\n      i++;\n      continue;\n    } else if (!a[i]) {\n      int n = 0;\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if (((a[j] / a[k] == 2) && !(a[j] % a[k])) ||\n              ((a[k] / a[j] == 2) && !(a[k] % a[j])))\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n      i = 0;\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20843", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20][16], b[20] = {0}, i = 0, j, k = 0;\n  scanf(\"%d\", &a[0][0]);\n  i++;\n  while (a[k][0] != -1) {\n    do {\n      scanf(\"%d \", &a[k][i]);\n      i++;\n    } while (a[k][i - 1] != 0);\n    k++;\n    scanf(\"%d\", &a[k][0]);\n    i = 1;\n  }\n\n  for (k = 0; a[k][0] != -1; k++) {\n    for (i = 0; a[k][i] != 0; i++) {\n      for (j = i + 1; a[k][j] != 0; j++) {\n        if ((a[k][j] / a[k][i] == 2 && a[k][j] % a[k][i] == 0) ||\n            (a[k][i] / a[k][j] == 2 && a[k][i] % a[k][j] == 0))\n          b[k]++;\n      }\n    }\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20844", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20] = {0};\n  int j, k, i = 0, n = 0, m = 0;\n\n  while ((scanf(\"%d\", &a[i])) && (a[i] >= 0)) {\n\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            m++;\n      }\n      printf(\"%d\\n\", m);\n      m = 0;\n      i = 0;\n      for (j = 0; j < 20; j++)\n        a[j] = 0;\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[16][16], i, j, t[15] = {0}, k = 0, f, b[16] = {0};\n  for (i = 0; i <= 10; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1)\n        break;\n      if (a[i][j] == 0)\n        break;\n      t[i] = t[i] + 1;\n    }\n    if (a[i][j] == -1)\n      break;\n    k = k + 1;\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < t[i]; j++) {\n      for (f = j + 1; f <= t[i]; f++) {\n        if ((a[i][j] == 2 * a[i][f]) || (a[i][f] == 2 * a[i][j]))\n          b[i]++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "20846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[100][16];\n  int i, j, r, p;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n\n    for (j = 1; n[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n    int t = 0;\n    for (r = 0; r < j - 1; r++) {\n      for (p = r + 1; p < j; p++) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n    for (r = j - 1; r > 0; r--) {\n      for (p = r - 1; p >= 0; p--) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, nfa[n];\n  int a[n][16];\n  memset(a, -100, sizeof(a));\n  memset(nfa, 0, sizeof(nfa));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1) {\n        n = i;\n        break;\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n  for (int i = 0; i < n; i++)\n    for (int k = 0; k < 16; k++)\n      for (int j = 0; j < 16; j++)\n        if (a[i][j] == 2 * a[i][k])\n          nfa[i]++;\n  for (int i = 0; i < n; i++)\n    cout << nfa[i] - 1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "20848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0)\n        flag = 0;\n      else if (a[i - 1] == -1)\n        return 0;\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j]) {\n            t++;\n          }\n        }\n      }\n    }\n    cout << t << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int count = 0;\n  int i, j, k, m;\n  for (m = 0;; m++) {\n    scanf(\"%d\", &a[m][0]);\n    if (a[m][0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\" %d\", &a[m][i]);\n        if (a[m][i] == 0)\n          break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if ((a[m][j] == 2 * a[m][k]) || (a[m][j] * 2 == a[m][k]))\n          count = count + 1;\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17];\n  int i, j, n, nn, count;\n  nn = 0;\n  while (cin >> a[1] && a[1] != -1) {\n    nn++;\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, num, i, j, k;\n  int a[200];\n\n  for (k = 1;; k++) {\n    i = 0;\n\n    while (1) {\n      scanf(\"%d \", &a[i]);\n\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n\n      i++;\n    }\n\n    num = 0;\n\n    for (i = 0; a[i] != 0; i++)\n      N = i;\n\n    for (i = 0; i <= N; i++) {\n      for (j = i + 1; j <= N; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    }\n\n    cout << num << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 16; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n      }\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n\n    int num = 0;\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 0; (j < 16) && (a[i][j] != 0); j++) {\n        for (k = j + 1; (k < 16) && (a[i][k] != 0); k++) {\n          if (a[i][k] == 2 * a[i][j])\n            num++;\n          else if (a[i][j] == 2 * a[i][k])\n            num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "20853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, a[100][100], c[100];\n  for (i = 1;; i++) {\n    j = 1;\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == -1)\n      break;\n    for (j = 2; j < 100; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      for (l = j; l >= 1; l--) {\n        if (a[i][j] == 2 * a[i][l] || 2 * a[i][j] == a[i][l])\n          c[i]++;\n        else\n          continue;\n      }\n    }\n    k++;\n  }\n  for (m = 1; m <= k; m++)\n    printf(\"%d\\n\", c[m]);\n}\n"}
{"label": "12", "index": "20854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int output = 0, i, j, length;\n  float data[16];\n\n  data[0] = -2;\n\n  while (data[0] != -1) {\n    for (i = 0; i <= 15; i++) {\n      cin >> data[i];\n      if (data[i] == 0) {\n        length = i;\n        break;\n      }\n      if (data[i] == -1)\n        break;\n    }\n\n    if (data[i] == -1)\n      break;\n\n    for (i = 0; i <= length - 1; i++)\n      for (j = 0; j <= length - 1; j++) {\n        if ((data[j] / data[i]) == 2)\n          output = output + 1;\n      }\n\n    cout << output << \"\\n\";\n    output = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int str_1[20][20];\n  int str_2[100];\n  int x, y, m, j;\n  int sum = 0;\n  int p = 0;\n  int a = 0;\n  int b = 0;\n  int c;\n  int k;\n  int i = 0;\n  while (1) {\n    ++p;\n    scanf(\"%d\", &x);\n    if (-1 == x)\n      break;\n    k = 0;\n    str_1[p][i++] = x;\n    b++;\n    while (1) {\n      scanf(\"%d \", &y);\n      k++;\n      str_1[p][i++] = y;\n      if (0 == y) {\n        str_1[p][i] = '\\0';\n        break;\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (m = 0; m < k; m++) {\n        if (str_1[p][j] == str_1[p][m] * 2)\n          ++sum;\n      }\n    }\n    str_2[a++] = sum;\n    sum = 0;\n    str_2[a] = '\\0';\n    i = 0;\n  }\n  for (c = 0; c < b; c++) {\n    printf(\"%d\", str_2[c]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "20856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][16], m, n;\n  int i, j, k;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &m);\n      if (m != 0) {\n        sz[i][j] = m;\n      } else {\n        break;\n      }\n    }\n    if (sz[i][0] == -1) {\n      break;\n    }\n  }\n  n = 0;\n  for (i = 0; i < 100; i++) {\n    if (sz[i][0] == -1) {\n      break;\n    }\n    for (j = 0; j < 15; j++) {\n      for (k = 0; k < 15; k++) {\n        if (sz[i][j] != 0 && sz[i][k] != 0) {\n          if (sz[i][j] == 2 * sz[i][k]) {\n            n = n + 1;\n          }\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[16];\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20858", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, m, n, a, result[20] = {0};\n  double num[15];\n  scanf(\"%lf\", &num[0]);\n  for (a = 1; num[0] != -1; a++) {\n    for (i = 1;; i++) {\n      scanf(\"%lf\", &num[i]);\n      if (num[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (m = 0; m <= i; m++)\n        if (num[m] / num[j] == 2)\n          result[a]++;\n    }\n    scanf(\"%lf\", &num[0]);\n  }\n  for (j = 1; j < a; j++)\n    printf(\"%d\\n\", result[j]);\n  return 0;\n}\n"}
{"label": "12", "index": "20859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int i, j, n, count;\n  while (cin >> a[1] && a[1] != -1) {\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int i = 0;\n  while (cin >> a[i]) {\n    int i = 0, j = 0;\n    if (a[i] == -1)\n      return 0;\n    do {\n      i++;\n      j++;\n      cin >> a[i];\n    } while (a[i]);\n\n    int y, z, k = 0;\n    for (z = 0; z <= j - 1; z++)\n      for (y = z + 1; y <= j - 1; y++)\n        if (a[z] == 2 * a[y] || a[y] == 2 * a[z]) {\n          k++;\n        }\n    cout << k << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], t = 0, i, j, k, num;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[t][i]);\n    if (a[t][i] == 0)\n      t++;\n    else if (a[t][i] == -1)\n      break;\n  }\n\n  for (k = 0; k < t; k++) {\n    num = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][j] == 2 * a[k][i] && a[k][i] != 0)\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  printf(\"3\\n\");\n  printf(\"2\\n\");\n  printf(\"0\\n\");\n  printf(\"0\\n\");\n  printf(\"1\\n\");\n  printf(\"1\\n\");\n  printf(\"0\\n\");\n  printf(\"2\\n\");\n  printf(\"2\\n\");\n  printf(\"6\\n\");\n  printf(\"11\\n\");\n  return 0;\n}\n"}
{"label": "12", "index": "20863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15] = {0}, n;\n\n  while (1) {\n    n = 0;\n    for (int i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    for (int j = 0; j <= 15; j++) {\n      if (a[j] == 0 || a[j] == -1)\n        break;\n      for (int k = j + 1; k <= 15; k++) {\n        if (a[k] == 0)\n          break;\n        else if (a[k] * 2 == a[j] || a[j] * 2 == a[k])\n          n++;\n      }\n    }\n    if (a[0] != -1) {\n      printf(\"%d\\n\", n);\n      for (int i = 0; i <= 15; i++)\n        a[i] = 0;\n      n = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[18];\n  int i, j, k, c, d;\n  double b;\n  a[0] = 0;\n  for (i = 1;; i++) {\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (j = 2;; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n    }\n    k = 0;\n    for (c = 1; c < j; c++) {\n      for (d = 1; d < j; d++) {\n        b = a[c] / a[d];\n        if (b == 2)\n          k++;\n      }\n    }\n    cout << k << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, sz[15], i = 0, j, k, result = 0;\n\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    if (t != 0) {\n      sz[i] = t;\n      i++;\n    } else {\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (sz[k] == sz[j] * 2)\n            result++;\n        }\n      }\n      cout << result << \"\\n\";\n      i = 0;\n      result = 0;\n    }\n    scanf(\"%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2;\n  int pair(int n[15]);\n  int num[15] = {0};\n  for (l1 = 0; (num[0] != -1); l1++) {\n    scanf(\"%d\", &num[0]);\n    for (l2 = 1; (num[l2 - 1] != 0) && (num[0] != -1); l2++) {\n      scanf(\"%d\", &num[l2]);\n    }\n    if (num[0] != -1)\n      printf(\"%d\\n\", pair(num));\n  }\n  return (0);\n}\nint pair(int n[15]) {\n  int sum, i, j, k;\n  sum = 0;\n  for (i = 1; (n[i] != 0); i++) {\n    if (n[i] == (n[0] + n[0]))\n      sum = sum + 1;\n  }\n  for (j = 1; (n[j - 1] != 0); j++) {\n    for (k = 0; (n[k] != 0); k++) {\n      if (n[k] == n[j] * 2)\n        sum = sum + 1;\n    }\n  }\n  return (sum);\n}\n"}
{"label": "12", "index": "20867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, end, k;\n  float a[1000];\n  int n[100];\n  int num[100];\n  for (i = 0; i < 100; i++) {\n    num[i] = -1;\n  }\n  i = 0;\n  j = 1;\n  n[0] = -1;\n  for (i = 1; i < 100; i++) {\n    n[i] = 0;\n  }\n  end = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%f\", &a[i]);\n    if (a[i] == -1) {\n      end = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < end; i++) {\n    if (a[i] == 0) {\n      n[j] = i;\n      j++;\n    }\n  }\n\n  k = 1;\n  while (n[k] != 0) {\n    num[k] = 0;\n    for (i = n[k - 1] + 1; i < n[k]; i++) {\n      for (j = n[k - 1] + 1; j < n[k]; j++) {\n        if (a[i] / a[j] == 2) {\n          num[k]++;\n        }\n      }\n    }\n    k++;\n  }\n\n  k = 1;\n  while (num[k] != -1) {\n\n    cout << num[k] << \"\\n\";\n    k++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20868", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][16] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},\n                   {0}, {0}, {0}, {0}, {0}, {0}, {0}},\n      c, m;\n  for (m = 0; m < 100; m++) {\n    for (c = 0; c < 16; c++) {\n      cin >> a[m][c];\n      if (a[m][c] <= 0)\n        break;\n    }\n    if (a[m][0] <= 0)\n      break;\n    int b, d, e, f = 0;\n    for (b = 0; b < c; b++) {\n      d = a[m][b] * 2;\n      for (e = 0; e < c; e++) {\n        if (d == a[m][e])\n          f++;\n      }\n    }\n    printf(\"%d\\n\", f);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[15] = {0}, i, j, a, b = 0, m;\n  do {\n    for (m = 0;; m++) {\n      scanf(\"%d \", &a);\n      num[m] = a;\n      if (a == 0)\n        break;\n      if (a == -1)\n        break;\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++)\n        if ((num[i] != 0 && num[j] != 0 && num[i] * 2 == num[j]) ||\n            (num[i] != 0 && num[j] != 0 && num[j] * 2 == num[i]))\n          b++;\n    if (a != -1) {\n      cout << b / 2 << \"\\n\";\n      b = 0;\n    }\n  } while (a != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "20870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long i, j, k, m, a[17][17], b[100], c[100] = {0};\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == -1)\n      break;\n    else {\n      for (j = 2; j <= 100; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n        else\n          b[i] = j;\n      }\n    }\n    for (k = 1; k <= b[i]; k++) {\n      for (m = 1; m <= b[i]; m++) {\n        if (a[i][k] == 2 * a[i][m])\n          c[i]++;\n      }\n    }\n    printf(\"%ld\\n\", c[i]);\n  }\n}\n"}
{"label": "12", "index": "20871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, d, total;\n  total = 0;\n  int shuzu[16];\n  for (i = 0; i < 16; i++) {\n    cin >> n;\n    if (n != -1) {\n      shuzu[i] = n;\n      if (n == 0) {\n        for (d = 0; d < i; d++) {\n          for (k = 0; k < i; k++) {\n            if (shuzu[d] == 2 * shuzu[k]) {\n              total++;\n            }\n          }\n        }\n        printf(\"%d\\n\", total);\n        i = -1;\n        total = 0;\n      }\n    } else {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, num[16] = {0}, count = 0, key = 0;\n  cin >> num[0];\n  while (num[0] != -1) {\n    for (i = 0; num[i] != 0; i++) {\n      cin >> num[i + 1];\n    }\n    count = i;\n    key = 0;\n    for (i = 0; i < count; i++)\n      for (j = i; j < count; j++)\n        if (num[i] == 2 * num[j] || num[j] == 2 * num[i])\n          key++;\n    printf(\"%d\\n\", key);\n    for (i = 0; i < 16; i++)\n      num[i] = 0;\n    cin >> num[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, k, a[16] = {0}, sum;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    sum = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0);\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (k != j && a[k] == 2 * a[j])\n          sum += 1;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], i, a, num = 0, no = 0, j;\n  while (1) {\n    cin >> a;\n    if (a == -1)\n      return 0;\n    else if (a > 0) {\n      sz[no] = a;\n      no++;\n    } else if (a == 0) {\n      for (i = 0; i < no; i++) {\n\n        for (j = 0; j < no; j++)\n          if (sz[i] == 2 * sz[j])\n            num++;\n      }\n\n      printf(\"%d\\n\", num);\n      no = 0;\n      num = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20875", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, x, j, g, k, b, a[15];\n  while (scanf(\"%d \", &x)) {\n    if (x == -1)\n      return 0;\n    else {\n      j = 0;\n      i = 0;\n      for (g = 0;; g++) {\n        a[i] = x;\n        i++;\n        cin >> x;\n        if (x == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        b = 2 * a[k];\n        for (g = 0; g < i; g++) {\n          if (a[g] == b)\n            j++;\n        }\n      }\n    }\n    cout << j << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, x, y, s, num = 0;\n  for (;;) {\n    num = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    if (a[0] == 0) {\n      printf(\"%d\", num);\n    }\n    for (x = 0; x < i; x++) {\n      for (y = 0; y < i; y++) {\n        s = a[x] - a[y] - a[y];\n        if (s == 0) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int i, k, j, count = 0, a[16];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k <= 15; k++) {\n      for (j = k + 1; j <= 16; j++) {\n        if (a[j] == 0)\n          break;\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i, j, n, court;\n  while (1) {\n    for (i = 0; 1; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0, court = 0; i <= n; i++) {\n      for (j = i; j <= n - 1; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          court++;\n      }\n    }\n    printf(\"%d\\n\", court);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, t, m, count[50], lie[20];\n  char p;\n  for (i = 0; i < 50; i++) {\n    for (j = 0; j < 20; j++) {\n      cin >> lie[j];\n      if (lie[0] == -1)\n        goto lalala;\n      scanf(\"%c\", &p);\n      if (p == '\\n')\n        break;\n    }\n    count[i] = 0;\n    for (l = 0; l < j; l++)\n      for (t = 0; t < j; t++)\n        if ((lie[l] - 2 * lie[t]) == 0)\n          count[i] = count[i] + 1;\n  }\nlalala:\n  for (m = 0; m < i; m++) {\n    cout << count[m];\n    if (m != i - 1)\n      cout << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "20880", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int n = 0, sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      else {\n        if (a[i] != 0)\n          n++;\n        else\n          break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (a[j] == 2 * a[k])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20881", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n\n  \n  \n  int i, j, k, a[16] = {0}, sum;\n  while (cin >> a[0]) \n  {\n    if (a[0] == -1)\n      break;\n    i = 0; \n    sum = 0;\n    do \n    {  \n      i++;\n      cin >> a[i];\n    } while (a[i] != 0);\n    for (j = 0; j < i; j++) \n    {                       \n      for (k = 0; k < i; k++) {\n        if (k != j && a[k] == 2 * a[j])\n          sum += 1;\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20882", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j]) {\n        s++;\n      }\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n  for (i = 1; i <= j - 1; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "20883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], j;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    int i = 1;\n    int l = 0;\n    while (scanf(\"%d \", &a[i])) {\n      if (a[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          l = l + 1;\n      i++;\n    }\n    cout << l << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20884", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, n, x, y;\n  for (;;) {\n    j = 0, n = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      j++;\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    for (i = j - 1; i >= 0; i--) {\n      for (k = i - 1; k >= 0; k--) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    printf(\"%d \", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, k, m[16] = {0}, n, len, sum;\n  i = 0;\n  do {\n    i = i + 1;\n    j = 0;\n    do {\n      j = j + 1;\n      scanf(\"%d\", &a[i][j]);\n      m[i] = m[i] + 1;\n    } while ((a[i][j] != 0) && (a[i][j] != -1));\n\n  } while (a[i][1] != -1);\n  len = i;\n  for (i = 1; i < len; i++) {\n    sum = 0;\n    for (j = 2; j <= m[i]; j++) {\n      for (k = 1; k < j; k++) {\n        if ((a[i][j] == 2 * a[i][k]) || (a[i][j] * 2 == a[i][k])) {\n          sum = sum + 1;\n        }\n      }\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, num, s, a[101];\n  while (1) {\n    scanf(\"%d\", &s);\n    if (s == -1)\n      break;\n    num = 0;\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n    a[s] = 1;\n    while (scanf(\"%d\", &s) == 1 && s != 0)\n      a[s] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] == 1 && a[2 * i] == 1)\n        num++;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[20], r, ctr, t, i, j;\n  while (cin.peek() != '-') {\n    r = ctr = 0;\n    while (scanf(\"%d \", &t), t)\n      x[++r] = t;\n    cin.get();\n    for (i = 1; i <= r; i++) {\n      for (j = 1; j <= r; j++) {\n        if (x[i] == (x[j] << 1))\n          ctr++;\n      }\n    }\n    cout << ctr << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 1, j, n = 0, sum = 0;\n  int a[20];\n  while (cin >> a[0] && a[0] != -1) {\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n      n++;\n    }\n    for (i = 0; i <= n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n\n    cout << sum << endl;\n    i = 1;\n    sum = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 1, flag = 1;\n  int a[16] = {0};\n  int c[100] = {0};\n  while (flag) {\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        k++;\n        break;\n      }\n      for (j = i - 1; j > 0; j--) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          c[k]++;\n      }\n    }\n  }\n  for (i = 1; k > 0 && i < k; i++)\n    printf(\"%d\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "20890", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, count = 0;\n  int a[16];\n  for (i = 1;; i++) {\n    count = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d \", &a[j]);\n      if ((a[j] == 0) || (a[j] == -1))\n        break;\n    }\n\n    for (x = 0; x <= j - 1; x++) {\n      for (y = 0; y <= j - 1; y++) {\n        if (a[y] == a[x] * 2)\n          count = count + 1;\n      }\n    }\n    if (a[j] != -1)\n      cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[18], m, i = 0, j = 0, k = 0, l = 0, n = 0;\n\n  for (n = 0;; n++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i - 1;\n          break;\n        }\n      } \n      i = 0;\n\n      for (i = 0; i <= m; i++) {\n        for (j = 0; j <= m; j++) {\n          if (a[j] == (2 * a[i]))\n            k++;\n        }\n        l = l + k;\n        k = 0; \n      }        \n\n      printf(\"%d\\n\", l);\n      l = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20892", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  while (1) {\n    int a[20] = {0}, sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        k = i;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < k; i++)\n      for (j = i; j < k; j++) {\n        if (a[j] == 2 * a[i] || 2 * a[j] == a[i])\n          sum++;\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "12", "index": "20893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count, n;\n  for (i = 0; i < 16; i++) {\n    count = 0;\n    n = 0;\n    for (j = 0; j < 16; j++) {\n      cin >> a[j];\n      if (a[0] == -1)\n        break;\n      if (a[j] == 0)\n        break;\n      count++;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < count; j++) {\n      for (k = 0; k < count; k++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20894", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int list[15] = {0};\n  int i, j, num, sum;\n\n  cin >> num;\n\n  while (num != -1) {\n    i = 1;\n    j = 0;\n    sum = 0;\n    list[0] = num;\n    while ((cin >> list[i], list[i]) != 0)\n      i++;\n    while (list[j]) {\n      for (i = j + 1; list[i]; i++) {\n        if (list[i] == 2 * list[j] || 2 * list[i] == list[j])\n          sum++;\n      }\n      j++;\n    }\n    printf(\"%d\\n\", sum);\n    cin >> num;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  for (;;) {\n    int a[16];\n    int i, j, k, m, n = 0;\n    for (i = 0; i < 16; i++)\n\n    {\n      cin >> a[i];\n\n      if (a[i] == 0) {\n        for (m = i + 1; m < 16; m++)\n          a[m] = 101;\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < i; k++) {\n        if (a[k] * 2 - a[j] == 0) {\n          n++;\n        }\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int i, num, n;\n  while (1) {\n    for (i = 1; i <= 100; i++)\n      a[i] = 0;\n    do {\n      cin >> num;\n      a[num] = 1;\n    } while (num != 0 && num != -1);\n    if (num == -1)\n      break;\n    n = 0;\n    for (i = 0; i <= 50; i++)\n      if (a[i] && a[2 * i])\n        n++;\n    cout << n - 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, l, n;\n  k = 0;\n  while (k != -1) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    l = 1;\n    do {\n      i = i + 1;\n      scanf(\"%d \", &a[i]);\n      l = i + 1;\n    } while (a[i] != 0);\n    l = l - 1;\n    n = 0;\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++) {\n        if (a[i] == 2 * a[j])\n          n = n + 1;\n      }\n    printf(\"%d\\n\", n);\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    cin >> a[0];\n    k = a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20898", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, sum;\n\n  while (1) {\n\n    sum = 0;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0) {\n        break;\n      }\n      for (j = 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          sum++;\n      }\n    }\n    if (a[1] != -1)\n      cout << sum << endl;\n    if (a[1] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, s = 0;\n  int lena, lenb, x, y;\n  int a[16] = {0};\n  int b[20] = {0};\n\n  while (1) {\n    while (scanf(\"%d\", &a[i])) {\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      else {\n        i++;\n        continue;\n      }\n    }\n\n    if (a[0] == -1)\n      break;\n    else {\n      lena = i;\n\n      for (x = 0; x < lena; x++) {\n        for (y = x + 1; y <= lena; y++) {\n          if ((a[x] == 2 * a[y]) || (a[y] == 2 * a[x]))\n            s++;\n        }\n      }\n\n      b[j] = s;\n      s = 0;\n    }\n    j++;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    i = 0;\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "20900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0};\n  int i, k, s, t, p;\n  for (k = 1;; k++) {\n    p = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 17; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (s = 0; s < i; s++) {\n        for (t = 0; t < i; t++) {\n          if (a[t] == 2 * a[s]) {\n            p = p + 1;\n            break;\n          }\n        }\n      }\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20901", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, b;\n  do {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    j = 0;\n    for (m = 0; m <= i - 1; m++) {\n      for (b = 0; b <= i - 1; b++) {\n        if (a[m] == a[b] * 2)\n          j++;\n      }\n    }\n    printf(\"%d\\n\", j);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "20902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15][15] = {0}, doub[15] = {0}, i, j, k, w[15] = {0}, row;\n  for (i = 0; i < 15; i++) {\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d \", &num[i][j]);\n      if (num[i][j] == -1)\n        break;\n      if (num[i][j] == 0) {\n        w[i] = j;\n        break;\n      }\n    }\n    if (num[i][0] == -1) {\n      row = i;\n      break;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < w[i]; j++) {\n      for (k = 0; k < w[i]; k++) {\n        if (num[i][k] == 2 * num[i][j]) {\n          doub[i]++;\n        }\n      }\n    }\n    cout << doub[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[25], i, j, count;\n  while (cin >> n[1], n[1] != -1) {\n    count = 0;\n    for (i = 2; cin >> n[i], n[i] != 0; i++) {\n      for (j = 1; j < i; j++) {\n        if (n[i] == 2 * n[j] || n[i] * 2 == n[j])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, m = 0, j, k = 0;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          k++;\n        else\n          continue;\n      }\n    cout << k << endl;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20905", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0};\n  int i, k, s, t, p;\n  for (k = 1;; k++) {\n    p = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 17; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (s = 0; s < i; s++) {\n        for (t = 0; t < i; t++) {\n          if (a[t] == 2 * a[s]) {\n            p = p + 1;\n            break;\n          }\n        }\n      }\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20906", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, temp, num[100];\n  for (k = 0; k <= 99; k++) {\n    num[k] = 0;\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] <= 0)\n        break;\n    }\n    if (a[0] < 0)\n      break;\n    for (j = 0; j <= 13; j++) {\n      for (i = 0; i <= 13 - j; i++) {\n        if (a[i] < a[i + 1]) {\n          temp = a[i], a[i] = a[i + 1], a[i + 1] = temp;\n        }\n      }\n    }\n    for (i = 0; i <= 13; i++) {\n      for (j = 1; j <= 14 - i; j++) {\n        if (a[i] == 2 * a[i + j] && a[i + j] > 0)\n          num[k] = num[k] + 1;\n        else\n          num[k] = num[k];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20907", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;;) {\n    cin >> a[i];\n    if (a[i] != 0 && a[i] != -1) {\n      i++;\n      continue;\n    } else if (!a[i]) {\n      int n = 0;\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if (((a[j] / a[k] == 2) && !(a[j] % a[k])) ||\n              ((a[k] / a[j] == 2) && !(a[k] % a[j]))) {\n            n++;\n          }\n        }\n      }\n      cout << n << endl;\n      i = 0;\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20908", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[15], n, m;\n  while (cin >> a[0]) {\n    m = 0;          \n    if (a[0] == -1) \n      break;\n    else {\n      int i = 1;\n      cin >> a[i];\n      while (a[i] != 0) \n      {\n        cin >> a[++i];\n      }\n      n = i;\n    }\n    for (int i = 0; i <= n - 2; i++) \n    {\n      for (int j = i + 1; j <= n - 1; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          m++;\n      }\n    }\n    cout << m << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int n, s;\n\n  while (cin >> a[1], a[1] != -1) {\n    n = 1;\n    s = 0;\n    while (cin >> a[n + 1], a[n + 1] != 0)\n      n++;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        if (a[i] % a[j] == 0 && a[i] / a[j] == 2)\n          s++;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20910", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15] = {1}, n, m, i, j, t;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    i = 1;\n    n = 1;\n    cin >> a[1];\n    while (a[i] != 0) {\n      n++;\n      i++;\n      cin >> a[i];\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] > a[j]) {\n          t = a[i];\n          a[i] = a[j];\n          a[j] = t;\n        }\n\n    m = 0;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[j] == 2 * a[i]) {\n          m++;\n          break;\n        }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "20911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int e = 0, i, j, k = -1;\n  int a[10000];\n  int ans;\n  while (1) {\n    i = 1;\n    cin >> a[0];\n    while (a[i - 1] != 0) {\n      cin >> a[i];\n      i++;\n    }\n    e = i - 1;\n    if (a[0] == -1)\n      return 0;\n    ans = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < e; j++) {\n        if (i != j)\n          if ((a[i] % a[j] == 0) && (a[i] / a[j] == 2))\n            ans++;\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, t = 0, m, n;\n  double a[1000][100];\n  cin >> a[i][j];\n  while (a[i][j] != -1) {\n    while (a[i][j] != 0) {\n      cin >> a[i][j + 1];\n      j++;\n    }\n    j++;\n    for (m = 0; m < j - 1; m++) {\n      for (n = m + 1; n < j - 1; n++) {\n        if (a[i][m] / a[i][n] == 2.0 || a[i][m] / a[i][n] == 0.5)\n          t++;\n      }\n    }\n    i++;\n    j = 0;\n    cin >> a[i][j];\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a[20];\n  do {\n    int i = 1;\n    do {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else\n        i++;\n    } while (i <= 19);\n    int j, k;\n    float t;\n    for (j = 1; j <= i - 2; j++)\n      for (k = 1; k <= i - 1 - j; k++)\n        if (a[k] > a[k + 1]) {\n          t = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = t;\n        }\n    int s = 0, l, m;\n    for (l = 1; l <= i - 2; l++)\n      for (m = 1; m <= i - 1; m++)\n        if (a[m] / a[l] == 2)\n          s = s + 1;\n    if (a[1] > 0)\n      printf(\"%d\\n\", s);\n  } while (a[1] > 0);\n  return 0;\n}\n"}
{"label": "12", "index": "20914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, count = 0;\n  while (true) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (true) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      i++;\n    }\n\n    count = 0;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] * 2 == a[j])\n          count++;\n      }\n    }\n\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20915", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, j, k, n;\n  cin >> a[1];\n  while (a[1] != -1) {\n    n = 0;\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[j] == a[k] * 2)\n          n++;\n      }\n    }\n    n = n - 1;\n    cout << n << endl;\n    cin >> a[1];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[15];\n  int a, b;\n  int i, t, h, k;\n  for (i = 0; i <= 100; i++) {\n    b = 0;\n    a = 0;\n    for (t = 0; t < 17; t++) {\n      cin >> s[t];\n      if (s[t] == 0)\n        break;\n      if (s[t] == -1)\n        break;\n      a++;\n    }\n    if (s[t] == -1)\n      break;\n    for (k = 0; k < a; k++) {\n      for (h = 0; h < a; h++) {\n        if (s[k] == 2 * s[h]) {\n          b++;\n        } else {\n          b = b;\n        }\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][100];\n  int i = 0, j = 0, h = 0, a, m = 0, sum = 0;\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    if (a != 0)\n      s[i][j++] = a;\n    else {\n      s[i][j] = a;\n      i++;\n      j = 0;\n    }\n    scanf(\"%d\", &a);\n  }\n\n  for (h = 0; h < i; h++) {\n    while (s[h][j] != 0) {\n      m = 0;\n      while (s[h][m] != 0) {\n        if (((float)s[h][j] / 2) == (float)s[h][m])\n          sum++;\n        m++;\n      }\n      j++;\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = j + 1; a[i][s] != 0; s++) {\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n        if (a[i][j] * 2 == a[i][s])\n          z[i]++;\n      }\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "20919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], n, i, j, sum = 0;\n\n  a[0] = 1;\n  while (1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        goto end;\n    }\n    n = i - 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j < n; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j]) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    for (i = 1; i < 16; i++)\n      a[i] = 0;\n    sum = 0;\n  }\nend:;\n}\n"}
{"label": "12", "index": "20920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, n, t = 0;\n  int a[16];\n  while (scanf(\"%d \", &n)) {\n    if (n != 0) {\n      a[i] = n;\n      i++;\n    } else {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k <= i - 1; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            t++;\n        }\n      }\n      cout << t << endl;\n      t = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20921", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int num[16]; \n  int i = 1;   \n  int n;\n  int j, k, ans; \n  i = 1;         \n  do {\n    cin >> n; \n    if (n != -1) {\n      if (n == 0) {\n        ans = 0;\n        for (j = 1; j <= i - 1; j++)\n          for (k = 1; k <= i - 1; k++)\n            if (num[j] == 2 * num[k])\n              ans += 1;\n        cout << ans << endl;\n        i = 1; \n      }        \n      else {\n        num[i] = n; \n        i += 1;\n      }\n    }\n  } while (n != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "20922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], k, m, n, j;\n  do {\n    j = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] != -1) {\n      for (k = 1; k <= 15; k++) {\n        scanf(\"%d\", &a[k]);\n        if (!a[k])\n          break;\n      }\n      for (m = 0; m < k - 1; m++) {\n        for (n = m + 1; n < k; n++) {\n          if ((a[m] - 2 * a[n] == 0) || (a[n] - 2 * a[m] == 0))\n            j++;\n        }\n      }\n      printf(\"%d\\n\", j);\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "20923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[20], i, j, n, c, t;\n  do {\n    cin >> c;\n    num[0] = c;\n    n = 1;\n    while (c != 0) {\n      scanf(\"%d\", &c);\n      if (c == -1)\n        return 0;\n      num[n] = c;\n      n++;\n    }\n    t = 0;\n    for (i = n - 2; i >= 0; i--)\n      for (j = n - 2; j >= 0; j--)\n        if (num[i] == 2 * num[j])\n          t++;\n    printf(\"%d\\n\", t);\n  } while (c != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "20924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, count;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c;\n  int num[1000] = {0}, n, m = 0, index = 0, i, j;\n  while (num[0] != -1) {\n    while (true) {\n      scanf(\"%d\", &num[index]);\n      index++;\n      scanf(\"%c\", &c);\n      if (c != ' ')\n        break;\n    }\n    for (i = 0; i < index; i++) {\n      for (j = 0; j < index; j++) {\n        if (num[i] == 2 * num[j] || num[i] * 2 == num[j])\n          m++;\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    }\n    printf(\"%d\\n\", m / 2);\n    m = 0;\n    index = 0;\n  }\n}\n"}
{"label": "12", "index": "20926", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d \", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (int i = 0; i < t; i++)\n      for (int j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], j;\n  int k, m, y;\n  int i;\n  while (1 == 1) {\n    m = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        y = 1;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n      else\n        m = m + 1;\n    }\n    if (y == 1)\n      break;\n    else {\n\n      k = 0;\n      for (i = 0; i < m - 1; i++) {\n\n        for (j = i + 1; j < m; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            k++;\n        }\n      }\n    }\n\n    printf(\"%d \", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, l, n;\n  k = 0;\n  while (k != -1) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    l = 1;\n    do {\n      i = i + 1;\n      scanf(\"%d \", &a[i]);\n      l = i + 1;\n    } while (a[i] != 0);\n    l = l - 1;\n    n = 0;\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++) {\n        if (a[i] == 2 * a[j])\n          n = n + 1;\n      }\n    cout << n << endl;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    cin >> a[0];\n    k = a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20929", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {1}, n, m, i, j, t;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    i = 1;\n    n = 1;\n    cin >> a[1];\n    while (a[i] != 0) {\n      n++;\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] > a[j]) {\n          t = a[i];\n          a[i] = a[j];\n          a[j] = t;\n        }\n\n    m = 0;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[j] == 2 * a[i]) {\n          m++;\n          break;\n        }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "20930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, k, j, sum = 0, m;\n\n  for (k = 1;; k++) {\n    sum = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    if (a[0] != -1) {\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          m = i;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < m - 1; i++) {\n      for (j = i + 1; j < m; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          sum = sum + 1;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  while (1) {\n    n = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != -1) {\n      for (i = 2; a[i - 1] != 0; i++)\n        scanf(\"%d \", &a[i]);\n      for (j = 1; j < i - 1; j++)\n        for (k = 1; k < i - 1; k++)\n          if (a[k] == 2 * a[j])\n            n = n + 1;\n      cout << n << endl;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20932", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, j;\n  int count = 0;\n  int sz[16] = {0};\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d \", &sz[i]);\n    if (sz[i] == 0) {\n      for (k = 0; k < i - 1; k++) {\n        for (j = k + 1; j < i; j++) {\n          if (sz[k] == 2 * sz[j] || sz[k] * 2 == sz[j]) {\n            count++;\n          }\n        }\n      }\n      printf(\"%d\\n\", count);\n      count = 0;\n      i = -1;\n    }\n\n    if (sz[i] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20933", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  for (;;) {\n    int a[16];\n    int i, j, k, m, n = 0;\n    for (i = 0; i < 16; i++)\n\n    {\n      cin >> a[i];\n\n      if (a[i] == 0) {\n        for (m = i + 1; m < 16; m++)\n          a[m] = 101;\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < i; k++) {\n        if (a[k] * 2 - a[j] == 0)\n          n++;\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100];\n  int i = 1, count = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = i - 2;\n  while (a[0] != -1) {\n    count = 0;\n    int j, k = 0;\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    i = 1;\n    while (a[i - 1] != 0) {\n      scanf(\"%d\", &a[i]);\n      i++;\n    }\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, count = 0;\n  for (;;) {\n    count = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j; k < i; k++) {\n          if (a[j] == a[k] * 0.5 || a[j] == a[k] * 2)\n            count++;\n        }\n      }\n      cout << count << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17];\n  int i, j, n, nn, count;\n  nn = 0;\n  while (cin >> a[1] && a[1] != -1) {\n    nn++;\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      scanf(\"%d \", &a[n]);\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, c = 0, e = 0, n, l;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      e = e + 1;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (l = 0; l < e - 1; l++)\n      for (n = l + 1; n < e - 1; n++) {\n        if ((a[l] / a[n] == 2 && a[l] % a[n] == 0) ||\n            (a[n] / a[l] == 2 && a[n] % a[l] == 0))\n          c = c + 1;\n      }\n    printf(\"%d\\n\", c);\n    int a[16] = {0};\n    e = c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[16];\n  int i, j, n, sum;\n  for (;;) {\n    sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &num[i]);\n      if ((num[i] == 0) || (num[i] == -1))\n        break;\n    }\n    if (num[i] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j <= n - 1; j++) {\n        if ((num[j] == num[i] * 2) || (num[i] == num[j] * 2)) {\n          sum = sum + 1;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20939", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, I, J, Count, Arr[15];\n  while (1) {\n    N = 0;\n    while (1) {\n      cin >> Arr[N];\n      if (Arr[N] == -1)\n        return 0;\n      if (Arr[N] == 0)\n        break;\n      N++;\n    }\n    Count = 0;\n    for (I = 0; I < N - 1; I++)\n      for (J = I + 1; J < N; J++)\n        if (Arr[I] == 2 * Arr[J] || Arr[J] == 2 * Arr[I])\n          Count++;\n    cout << Count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int i, j, k, a[16] = {0}, count; \n  do {\n    count = 0;\n    cin >> a[0];\n    if (a[0] == -1) \n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) \n        break;\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < j; k++)\n        if (a[k] == 2 * a[j] || 2 * a[k] == a[j]) \n          count++;\n    cout << count << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "20941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], x, y, s, i, j, k, l, m, n;\n  do {\n    scanf(\"%d\", &x);\n    if (x == -1)\n      break;\n    a[0] = x;\n    i = 1;\n    do {\n      scanf(\" %d\", &y);\n      a[i] = y;\n      i = i + 1;\n    } while (y != 0);\n    scanf(\"\\n\");\n    n = i - 2;\n    i = 0;\n    while (i <= n) {\n      j = 0;\n      while (j <= n - 1) {\n        if (a[j] > a[j + 1]) {\n          s = a[j + 1];\n          a[j + 1] = a[j];\n          a[j] = s;\n        }\n        j = j + 1;\n      }\n      i = i + 1;\n    }\n    i = 0;\n    m = 0;\n    while (i <= n - 1) {\n      j = n - i;\n      k = 0;\n      while (k <= j - 1) {\n        if (a[j] == 2 * a[k])\n          m = m + 1;\n        k = k + 1;\n      }\n      i = i + 1;\n    }\n    cout << m << \"\\n\";\n  } while (x != -1);\n}\n"}
{"label": "12", "index": "20942", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, n;\n  while (1) {\n    n = 0;\n    scanf(\"%d \", &a[1]);\n\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (int j = 1; j <= i; j++)\n      for (int k = j + 1; k <= i; k++)\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20943", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[20], r, ctr, t, i, j;\n  while (cin.peek() != '-') {\n    r = ctr = 0;\n    while (cin >> t, t)\n      x[++r] = t;\n    cin.get();\n    for (i = 1; i <= r; i++) {\n      for (j = 1; j <= r; j++) {\n        if (x[i] == (x[j] << 1))\n          ctr++;\n      }\n    }\n    cout << ctr << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; 1; i++) {\n    cin >> a[i][1];\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20945", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, sum;\n\n  while (1) {\n\n    sum = 0;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      for (j = 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          sum++;\n        }\n      }\n    }\n    if (a[1] != -1)\n      printf(\"%d\\n\", sum);\n    if (a[1] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 1, num[16] = {0}, s, k = 0;\n  while (cin >> s) {\n    a[i] = s;\n    if (a[i] == 0) {\n      i = 0;\n      k++;\n      continue;\n    }\n    if (a[i] == -1)\n      break;\n    for (int j = 0; j <= i; j++) {\n      if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n        num[k]++;\n    }\n    i++;\n  }\n  for (i = 0; i < k; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int t;\n  int n = 0;\n  int m;\n  int d[100] = {0};\n  int q[100] = {0};\n  int i;\n  int z = 0;\n  int x = 0;\n\n  t = 0;\n  do {\n    i = 0;\n    do {\n      cin >> c[t][i];\n      if (c[t][0] == -1) {\n        break;\n      }\n      if (c[t][i] == 0) {\n        break;\n      }\n      i++;\n      d[t]++;\n    } while (i <= 100);\n    if (c[t][0] == -1) {\n      break;\n    }\n    t++;\n    n++;\n  } while (t <= 100);\n  do {\n    i = 0;\n    do {\n      m = 0;\n      do {\n        if ((c[z][i] * 2) == c[z][m]) {\n          q[z]++;\n        }\n        m++;\n      } while (m <= d[z] - 1);\n      i++;\n    } while (i <= d[z] - 1);\n    z++;\n  } while (z <= n - 1);\n  while (x <= n - 1) {\n    printf(\"%d\\n\", q[x]);\n    x++;\n  }\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "12", "index": "20948", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[16] = {0}, n = 0, sum = 0;\nint main() {\n  int i, j;\n  while (1) {\n    n = 0;\n    sum = 0;\n    while (1) {\n      cin >> array_1[n];\n      if (array_1[n] == 0 || array_1[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array_1[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array_1[i] == array_1[j] * 2) || (array_1[j] == array_1[i] * 2))\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], duishu = 0, zushu, i;\n  for (zushu = 0; 1; zushu++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n    }\n    if (sz[0] == -1)\n      break;\n    for (i = 0; sz[i] != 0; i++) {\n      int j;\n      for (j = 0; sz[j] != 0; j++) {\n        if (sz[i] == 2 * sz[j])\n          duishu++;\n      }\n    }\n    cout << duishu << \"\\n\";\n    duishu = 0;\n    for (i = 0; i < 16; i++)\n      sz[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, t, k;\n\n  for (i = 0;; i++)\n\n  {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d \", &a[j]);\n      if (a[j] == 0)\n        break;\n      if (a[0] == -1) {\n        cout << \"\\n\";\n        return 0;\n      }\n    }\n\n    for (j = 0, t = 0; j <= 14; j++) {\n      for (k = j + 1; k <= 15; k++) {\n        if (a[k] != 0 && a[j] != 0 && (2 * a[j] == a[k] || 2 * a[k] == a[j]))\n          t = t + 1;\n      }\n      a[j] = 0;\n    }\n    printf(\"%d\\n\", t);\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "12", "index": "20951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][16], i, j, k, t;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1; a[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < i; j++) {\n    int n = 0;\n    for (k = 0; a[j][k + 1] != 0; k++) {\n      for (t = k + 1; a[j][t] != 0; t++) {\n        if (a[j][k] == 2 * a[j][t] || a[j][t] == 2 * a[j][k])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][16], K, I, b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (K = 0; K <= j - 1; K++) {\n        if (a[i][K] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n  }\n  for (I = 0; I < i; I++)\n    printf(\"%d\\n\", b[I]);\n  return 0;\n}\n"}
{"label": "12", "index": "20953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, b = 0, s[100][16], t[100], k;\n  for (i = 0;; i++) {\n\n    for (j = 0;; j++) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0 || s[i][j] == -1)\n        break;\n      t[i]++;\n    }\n    if (s[i][j] == 0)\n      b++;\n    if (s[i][j] == -1)\n      break;\n  }\n  for (i = 0; i < b; i++) {\n    int sum = 0;\n    for (j = 0; j < t[i]; j++) {\n      for (k = 0; k < t[i]; k++) {\n        if (s[i][j] == s[i][k] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a[15], num, cnt;\n  int i;\n  for (int n = 0; n <= 99999; n++) {\n    cnt = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%lf \", &num);\n      if (num == 0)\n        break;\n      else\n        a[i] = num;\n    }\n    if (a[0] == -1)\n      break;\n    else {\n      for (int j = 0; j <= i - 1; j++)\n        for (int k = 0; k <= i - 1; k++)\n          if (a[j] == 2 * a[k])\n            cnt++;\n    }\n    cout << cnt << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20955", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ch[16], i, j, n, m;\n\n  cin >> ch[0];\n\n  while (ch[0] != -1) {\n    n = 0;\n\n    for (i = 1; ch[i - 1] != 0; i++) {\n      n++;\n\n      cin >> ch[i];\n    }\n\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (ch[i] % 2 == 1)\n        continue;\n      else {\n        for (j = 0; j < n; j++) {\n          if (ch[i] == 2 * ch[j])\n            m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n\n    cin >> ch[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b[16], c = 0, i, j, k;\n  for (i = 0; i <= 15; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] != 0) {\n      if (a[i] % 2 == 0)\n        b[i] = a[i] / 2;\n      else\n        b[i] = -1;\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        for (k = 0; k <= i - 1; k++) {\n          if (k == j)\n            continue;\n          if (a[k] == b[j])\n            c++;\n        }\n      }\n      printf(\"%d\\n\", c);\n      for (j = 0; j <= i; j++)\n        a[j] = 0, b[j] = 0;\n\n      c = 0, i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[20] = {0};\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] != -1) {\n\n      int i, k, m, num = 0;\n\n      for (i = 1;; i++)\n\n      {\n\n        scanf(\"%d \", &a[i]);\n\n        if (a[i] == 0)\n          break;\n      }\n\n      for (k = 0; k <= i - 2; k++) {\n        for (m = k + 1; m <= i - 1; m++) {\n          if ((a[m] == (2 * a[k])) || (a[k] == (a[m] * 2)))\n            num++;\n        }\n      }\n      printf(\"%d\\n\", num);\n\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, num;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n    }\n    num = 0;\n    for (i = 0; a[i]; i++)\n      for (j = 0; a[j]; j++)\n        if (a[i] == 2 * (a[j]))\n          num++;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20959", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20] = {0};\n  int j, k, i = 0, n = 0, m = 0;\n\n  while ((scanf(\"%d\", &a[i])) && (a[i] >= 0)) {\n\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n            m++;\n          }\n      }\n      printf(\"%d\\n\", m);\n      m = 0;\n      i = 0;\n      for (j = 0; j < 20; j++)\n        a[j] = 0;\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20960", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, m = 0, c[100][100], f[100] = {0};\n  for (j = 1;; j++) {\n    cin >> c[j][1];\n    if (c[j][1] == -1)\n      break;\n    for (i = 2;; i++) {\n      scanf(\"%d \", &c[j][i]);\n      if (c[j][i] == 0)\n        break;\n      for (l = i; l >= 1; l--)\n        if (c[j][l] == 2 * c[j][i] || c[j][i] == 2 * c[j][l])\n          f[j]++;\n    }\n    m++;\n  }\n  for (j = 1; j <= m; j++)\n    printf(\"%d\\n\", f[j]);\n}\n"}
{"label": "12", "index": "20961", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k = 1;\n  while (k == 1) {\n    int a[16];\n    cin >> a[0];\n    int l = 0;\n    if (a[0] == -1) \n      k = 0;\n    else {\n      while (a[l] != 0) \n      {\n        l++;\n        cin >> a[l];\n      }\n      int i, j, num = 0; \n      for (i = 0; i < l - 1; i++)\n        for (j = i + 1; j < l; j++)\n          if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n            num++;\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, x, y, s, num = 0;\n  for (;;) {\n    num = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    if (a[0] == 0) {\n      cout << num;\n    }\n    for (x = 0; x < i; x++) {\n      for (y = 0; y < i; y++) {\n        s = a[x] - a[y] - a[y];\n        if (s == 0) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, count;\n  float a[20];\n  while (1) {\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = 1;\n    while (1) {\n      scanf(\"%f\", &a[n]);\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    count = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] / a[j] == 2.0) || (a[j] / a[i] == 2.0))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20964", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[18], m, i = 0, j = 0, k = 0, l = 0, n = 0;\n\n  for (n = 0;; n++) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i - 1;\n          break;\n        }\n      }\n      i = 0;\n\n      for (i = 0; i <= m; i++) {\n        for (j = 0; j <= m; j++) {\n          if (a[j] == (2 * a[i]))\n            k++;\n        }\n        l = l + k;\n        k = 0;\n      }\n\n      printf(\"%d\\n\", l);\n      l = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16], i, k, j, count;\n  for (;;) {\n    i = -1;\n    count = 0;\n    do {\n      i++;\n      scanf(\"%d \", &num[i]);\n      if (num[0] == -1)\n        return 0;\n    } while (num[i] != 0);\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j; k <= i - 1; k++) {\n        if ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k]))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[50][16], b[50], c[50], i, j, m, n, o, line, num = 0;\n  for (i = 0; i <= 49; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        b[i] = j - 1;\n        c[i] = 0;\n        break;\n      }\n    }\n    if (a[i][0] == -1)\n      break;\n    line = i;\n  }\n  for (m = 0; m <= line; m++) {\n    for (n = 0; n <= b[m]; n++) {\n      for (o = 0; o <= b[m]; o++) {\n        if (a[m][n] == 2 * a[m][o])\n          c[m] = c[m] + 1;\n      }\n    }\n    printf(\"%d\\n\", c[m]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20967", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[17], h, i, j, x = 1, s;\n  while (x) {\n    for (i = 1; i < 17; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        goto end;\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n      continue;\n    }\n\n    if (x) {\n      s = 0;\n      for (i = 1; i < h - 1; i++) {\n        for (j = i + 1; j < h; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            s++;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "20968", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  for (l = 1;; l++) {\n    i = 0;\n    int a[20], num = 0;\n    do {\n      i++;\n      scanf(\"%d \", &a[i]);\n    } while (a[i] > 0);\n    if (a[i] == -1)\n      break;\n    else {\n      for (j = 1; j < i; j++) {\n        for (k = 1; k < i; k++) {\n          if (a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], n, r = 0, i, j, count = 0;\n  memset(a, 0, sizeof(a));\n  for (;;) {\n    scanf(\"%d\", &n);\n    if (n == -1)\n      break;\n    else if (n != 0) {\n      a[r] = n;\n      r++;\n      continue;\n    } else if (n == 0) {\n\n      for (i = 0; i < r - 1; i++) {\n        for (j = i + 1; j < r; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            count++;\n        }\n        a[i] = 0;\n      }\n      a[i] = 0;\n      cout << count << \"\\n\";\n      count = 0;\n      r = 0;\n      i = 0;\n      j = 0;\n      continue;\n    }\n  }\n}\n"}
{"label": "12", "index": "20970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n = 0, m, a[100][100], b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d \", &a[n][0]);\n    if (a[n][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[n][j]);\n      if (a[n][j] == 0) {\n        m = j;\n        break;\n      }\n    }\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[n][j] == 2 * a[n][k])\n          b[n]++;\n      }\n    }\n    cout << b[n] << \"\\n\";\n    n++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, n, x, y;\n  for (;;) {\n    j = 0, n = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      j++;\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    for (i = j - 1; i >= 0; i--) {\n      for (k = i - 1; k >= 0; k--) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    cout << n << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[10000], m[15];\n  int *p;\n  int i, j, k = 0, total, all = 0, sum = 0, q, t;\n  p = &n[0];\n  for (i = 0;; i++) {\n    scanf(\"%d\", &n[i]);\n    if (n[i] == 0) {\n      all++;\n    }\n    if (n[i] == -1) {\n      break;\n    }\n  }\n  while (all > 0) {\n    for (i = 0, t = 0; n[k] != 0; i++, k++) {\n      m[i] = n[k];\n      t++;\n    }\n    k = k + 1;\n    total = 0;\n    for (q = 0; q < t; q++) {\n      for (j = 0; j < t; j++) {\n        if ((m[q] / m[j] == 2) && (m[q] % m[j] == 0)) {\n          total++;\n        }\n      }\n    }\n    cout << total << \"\\n\";\n    all--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[16], m = 0, n = 0, b, c[200], x = 0, y = 0;\n  for (i = 0; i < 200; i++) {\n    cin >> c[i];\n    x = x + 1;\n    if (c[i] < 0)\n      i = 300;\n  }\n  for (i = 0; i < 16; i++, y++) {\n    a[i] = c[y];\n\n    if (a[i] > 0) {\n      for (b = 0; b < i; b++) {\n        if (a[i] == 2 * a[b] || a[b] == 2 * a[i])\n          m = m + 1;\n      }\n    }\n\n    else if (a[i] == 0) {\n      i = -1;\n      cout << m << \"\\n\";\n      m = 0;\n    }\n\n    else\n      i = 100;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k[16], a, p, b, c, q;\n  for (i = 1; i < 1000; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a);\n      if (a == -1)\n        break;\n      else if (a != -1) {\n        if (a == 0)\n          break;\n        else {\n          k[j] = a;\n          p++;\n        }\n      }\n    }\n    if (a == -1)\n      break;\n    for (b = 0; b < p; b++) {\n      for (c = 0; c < p; c++) {\n        if (k[b] - 2 * k[c] == 0)\n          q++;\n      }\n    }\n    cout << q << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, num;\n  do {\n    num = 0;\n    k = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k++;\n    }\n    for (i = 0; i <= k; i++)\n      for (j = 0; j <= k; j++) {\n        if (a[i] == 2 * a[j]) {\n          num++;\n        }\n      }\n    printf(\"%d\\n\", num);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "20976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[16] = {0};\nvoid scan();\n\nint main()\n\n{\n  scanf(\"%d\", &a[0]);\n  while (a[0] > 0) {\n    scan();\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\nvoid scan() {\n\n  int i, j = 1, n = 0, h, t;\n  while (scanf(\"%d\", &a[j]) && a[j] != 0)\n    j++;\n\n  for (i = 0; i < j; i++) {\n    for (h = i; h < j; h++) {\n      if (a[i] > a[h]) {\n        t = a[i];\n        a[i] = a[h];\n        a[h] = t;\n      }\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (h = i + 1; h < j; h++) {\n      if (a[h] == 2 * a[i]) {\n        n++;\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "12", "index": "20977", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[100] = {0}, index = 0, sum = 0;\n  char c;\n  for (; num[0] != -1;) {\n    while (true) {\n      scanf(\"%d\", &num[index++]);\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n    }\n    for (int i = 0; i < index; i++) {\n      for (int j = 0; j < index; j++) {\n        if (num[i] == (2 * num[j]) || (2 * num[i]) == num[j])\n          sum++;\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    } else\n      printf(\"%d\\n\", (sum - 1) / 2);\n    sum = 0;\n    index = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], len, count, i, j;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    }\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    count = 0;\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < len; j++) {\n        if (j == i) {\n          continue;\n        } else {\n          if (a[j] == (2 * a[i]))\n            count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20979", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[17], i, n; \n  while (1) {\n    n = 0;\n    cin >> a[1];\n\n    if (a[1] == -1)\n      break; \n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break; \n    }\n    for (int j = 1; j <= i; j++)\n      for (int k = j + 1; k <= i; k++)\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, h;\n  while (cin >> a[0]) {\n    while (a[0] != -1) {\n      for (i = 1; i < 16; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        h = i; \n      }\n\n      num = 0;\n      for (i = 0; i <= h; i++)\n        for (j = 0; j <= h; j++)\n          if (a[i] == 2 * a[j])\n            num++;\n      cout << num << endl;\n      break;\n    }\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, i, j;\n  int sz[16];\n  for (;;) {\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (sz[i] - 2 * sz[j] == 0)\n          t = t + 1;\n        else\n          ;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n    cout << t << \"\\n\";\n    t = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[30];\n  int i, m, j, temp, n;\n  int k = 0;\n  for (i = 0; i < 300; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 1; j < 30; j++) {\n        scanf(\"%d\", &a[j]);\n        if (a[j] == 0) {\n          break;\n        }\n      }\n      for (m = 0; m < j; m++) {\n        for (n = 0; n < j - 1; n++) {\n          if (a[n] == 2 * a[n + 1]) {\n            k++;\n          }\n          temp = a[n];\n          a[n] = a[n + 1];\n          a[n + 1] = temp;\n        }\n      }\n      printf(\"%d\\n\", k);\n      k = 0;\n      j = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, count = 0, row, arr[100][100], n[100], b[100];\n  for (i = 0; i < 100; i++) {\n    count = 0;\n    for (j = 0; j < 100; j++) {\n      scanf(\"%d\", &arr[i][j]);\n      if (arr[i][j] == 0 || arr[i][j] == -1) {\n        n[i] = count;\n        break;\n      }\n      count++;\n    }\n    if (arr[i][j] == -1) {\n      row = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    count = 0;\n    for (j = 0; j < n[i]; j++) {\n      for (k = j + 1; k < n[i]; k++) {\n        if (arr[i][j] == (arr[i][k] * 2) || (arr[i][j] * 2) == arr[i][k]) {\n          count++;\n        }\n      }\n    }\n    b[i] = count;\n  }\n  for (i = 0; i < row; i++) {\n    cout << \"\\n\" << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "20984", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int str_1[20][20];\n  int str_2[100];\n  int x, y, m, j;\n  int sum = 0;\n  int p = 0;\n  int a = 0;\n  int b = 0;\n  int c;\n  int k;\n  int i = 0;\n  while (1) {\n    ++p;\n    scanf(\"%d\", &x);\n    if (-1 == x)\n      break;\n    k = 0;\n    str_1[p][i++] = x;\n    b++;\n    while (1) {\n      scanf(\"%d \", &y);\n      k++;\n      str_1[p][i++] = y;\n      if (0 == y) {\n        str_1[p][i] = '\\0';\n        break;\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (m = 0; m < k; m++) {\n        if (str_1[p][j] == str_1[p][m] * 2)\n          ++sum;\n      }\n    }\n    str_2[a++] = sum;\n    sum = 0;\n    str_2[a] = '\\0';\n    i = 0;\n  }\n  for (c = 0; c < b; c++) {\n    printf(\"%d\", str_2[c]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "20985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, s, t;\n  int d[100];\n  int q, p;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (j == 0)\n      break;\n    s = 0;\n    for (k = 0; k < j - 1; k++) {\n      for (t = k + 1; t < j; t++) {\n        p = a[i][t] - a[i][k] * 2;\n        q = a[i][k] - a[i][t] * 2;\n        if (p == 0 || q == 0)\n          s++;\n      }\n    }\n    d[i] = s;\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d \", d[k]);\n}\n"}
{"label": "12", "index": "20986", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], len, count;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    }\n    count = 0;\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    for (int i = 0; i < len; i++)\n      for (int j = 0; j < len; j++) {\n        if (j == i)\n          continue;\n        else {\n          if (a[j] == (2 * a[i])) {\n            count++;\n            break;\n          }\n        }\n      }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int iNum[20], i, j, n, iPair;\n  while (1) {\n    iPair = 0;\n    memset(iNum, 0, 80);\n    scanf(\"%d \", &iNum[0]);\n    n = 1;\n    if (iNum[0] == -1)\n      break;\n    do {\n      cin >> iNum[n];\n      n++;\n    } while (iNum[n - 1] != 0);\n    n--;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        if (iNum[j] == iNum[i] * 2)\n          iPair++;\n    cout << iPair << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20988", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int i, j, m, n;\n  int num[100], result[100], temp;\n\n  i = 0;\n  j = 0;\n  while (1) {\n    cin >> num[i];\n    if (num[i] == -1) {\n      break;\n    }\n\n    while (1) {\n      if (num[i] == 0) {\n        temp = 0;\n        for (m = 0; m < i; m++) {\n          for (n = 0; n < i; n++) {\n            if (num[m] == 2 * num[n])\n              temp++;\n          }\n        }\n        result[j] = temp;\n\n        i = 0;\n        j++;\n        break;\n      } else {\n        i++;\n        cin >> num[i];\n      }\n    }\n  }\n\n  for (m = 0; m < j; m++) {\n    cout << result[m] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[101], ori[15];\n  int n, i, count, tot;\n\n  scanf(\"%d\", &n);\n  while (n != -1) {\n\n    for (i = 0; i < 101; i++)\n      num[i] = 0;\n    count = 0;\n    while (n != 0) {\n\n      ori[count] = n;\n      count++;\n      num[n] = 1;\n      scanf(\"%d\", &n);\n    }\n    tot = 0;\n    for (i = 0; i < count; i++) {\n      if (ori[i] <= 50 && num[ori[i] * 2])\n        tot++;\n    }\n    printf(\"%d\\n\", tot);\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20990", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  while (1) {\n    m = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if ((a[k] == 2 * a[j]) && (a[k]))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "12", "index": "20991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, p = 0, a[10000][16];\n  for (j = 0; j < 10000; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if ((a[j][i] == 0) || (a[j][i] == -1))\n        break;\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (m = 0; m < j; m++) {\n    i = 0;\n    while (a[m][i] != 0) {\n      n = 0;\n      while (a[m][n] != 0) {\n        if (a[m][i] == 2 * a[m][n]) {\n          p++;\n        }\n        n++;\n      }\n      i++;\n    }\n    cout << p << \"\\n\";\n    p = 0;\n  }\n}\n"}
{"label": "12", "index": "20992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16] = {0}, b[100] = {0}, n[100] = {0}, i, j, k;\n  int m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n\n    if (a[i][0] != -1) {\n      m = m + 1;\n      n[i]++;\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] != 0) {\n          n[i] = n[i] + 1;\n        }\n        if (a[i][j] == 0) {\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        if (a[i][j] == 2 * a[i][k]) {\n          b[i] = b[i] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n\n    cout << b[i] << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "20993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20][16], b[20] = {0}, i = 0, j, k = 0;\n  scanf(\"%d\", &a[0][0]);\n  i++;\n  while (a[k][0] != -1) {\n    do {\n      cin >> a[k][i];\n      i++;\n    } while (a[k][i - 1] != 0);\n    k++;\n    scanf(\"%d\", &a[k][0]);\n    i = 1;\n  }\n\n  for (k = 0; a[k][0] != -1; k++) {\n    for (i = 0; a[k][i] != 0; i++) {\n      for (j = i + 1; a[k][j] != 0; j++) {\n        if ((a[k][j] / a[k][i] == 2 && a[k][j] % a[k][i] == 0) ||\n            (a[k][i] / a[k][j] == 2 && a[k][i] % a[k][j] == 0))\n          b[k]++;\n      }\n    }\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20994", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, k, count;\n  int group[15];\n  scanf(\"%d\", &t);\n  do {\n    i = 0;\n    do {\n      group[i] = t;\n      cin >> t;\n      i++;\n    } while (t != 0);\n    printf(\"\\n\");\n    count = 0;\n    for (j = i - 1; j >= 0; j--) {\n      for (k = 0; k < i; k++) {\n        if ((double)group[k] / 2 == group[j]) {\n          count++;\n        } else if ((double)group[j] / 2 == group[k]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count / 2);\n    scanf(\"%d\", &t);\n\n  } while (t != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "20995", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {             \n  int i, j, ii, t, flag; \n  int a[2000];           \n  while (1)              \n  {\n    t = 0; \n    flag = 1;\n    i = 1;\n    while (flag == 1) \n    {\n      cin >> a[i++];     \n      if (a[i - 1] == 0) \n        flag = 0;\n      else if (a[i - 1] == -1) \n        return 0;\n    }\n    \n    i -= 1;                 \n    for (j = 1; j < i; j++) \n    {\n      if (a[j] % 2 == 0) \n      {\n        for (ii = 1; ii < i; ii++) \n        {\n\n          \n          if (a[ii] * 2 == a[j])\n            t++; \n        }\n      }\n    }\n    cout << t << endl; \n  }\n\n  return 0;\n} \n"}
{"label": "12", "index": "20996", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  cin >> b;\n  while (b != -1) {\n    int a[15] = {0};\n    int i = 1;\n    int k, j;\n    int sum = 0;\n    a[0] = b;\n    cin >> a[i];\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "20997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[18] = {0}, i, n, ii, s;\n  char c;\n  while (1) {\n    i = 1;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    n = i;\n    i = 1;\n    s = 0;\n    while (i < n) {\n      ii = 1;\n      while (ii < n) {\n        if (a[ii] == 2 * a[i])\n          s++;\n        ii++;\n      }\n      i++;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[20] = {0};\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] != -1) {\n\n      int i, k, m, num = 0;\n\n      for (i = 1;; i++)\n\n      {\n\n        cin >> a[i];\n\n        if (a[i] == 0)\n          break;\n      }\n\n      for (k = 0; k <= i - 2; k++) {\n        for (m = k + 1; m <= i - 1; m++) {\n          if ((a[m] == (2 * a[k])) || (a[k] == (a[m] * 2)))\n            num++;\n        }\n      }\n      printf(\"%d\\n\", num);\n\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "20999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][20], i = 0, j = 0, k = 0, num[100];\n\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][0] != -1);\n\n  i = 0;\n  while (a[i][0] != -1) {\n    num[i] = 0;\n    k = 0;\n    while ((a[i][k] != 0) && (a[i][k] != -1)) {\n      j = 0;\n      while ((a[i][j] != 0) && (a[i][j] != -1)) {\n        if (a[i][k] == 2 * a[i][j])\n          num[i]++;\n\n        j++;\n      }\n      k++;\n    }\n    i++;\n  }\n\n  i = 0;\n  while (a[i][0] != -1) {\n    cout << num[i] << \"\\n\";\n    i++;\n  }\n\n  return 1;\n}\n"}
{"label": "12", "index": "21000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, x, y, m, n, o, p, q, b, c[100];\n  for (j = 1; j <= 100; j++) {\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if (a[j][i] == 0 || a[j][i] == -1) {\n        c[j] = i - 1;\n        break;\n      }\n    }\n    if (a[j][i] == -1)\n      break;\n  }\n  for (m = 1; m < j; m++) {\n    b = 0;\n    for (p = 1; p <= c[m]; p++) {\n      for (q = p + 1; q <= c[m]; q++) {\n        if (a[m][q] == 2 * a[m][p] || 2 * a[m][q] == a[m][p])\n          b = b + 1;\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int s = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          s++;\n    cout << s << endl;\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a[16], m = 0, n = 0, b, c[200], x = 0, y = 0;\n  for (i = 0; i < 200; i++) {\n    scanf(\"%d\", &c[i]);\n    x = x + 1;\n    if (c[i] < 0)\n      i = 300;\n  }\n  for (i = 0; i < 16; i++, y++) {\n    a[i] = c[y];\n\n    if (a[i] > 0) {\n      for (b = 0; b < i; b++) {\n        if (a[i] == 2 * a[b] || a[b] == 2 * a[i])\n          m = m + 1;\n      }\n    }\n\n    else if (a[i] == 0) {\n      i = -1;\n      cout << m << \"\\n\";\n      m = 0;\n    }\n\n    else\n      i = 100;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21003", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[50][15], n[50], line, sum, i, k, j;\n  for (i = 0;; i++) {\n    for (k = 0;; k++) {\n      scanf(\"%d \", &p[i][k]);\n      if (p[i][k] == 0 || p[i][k] == -1) {\n        n[i] = k;\n        break;\n      }\n    }\n    if (p[i][k] == -1) {\n      line = i;\n      break;\n    }\n  }\n  for (i = 0; i < line; i++) {\n    sum = 0;\n    for (k = 0; k < n[i]; k++) {\n      for (j = k + 1; j < n[i]; j++) {\n        if (p[i][k] == p[i][j] * 2 || p[i][j] == p[i][k] * 2)\n          sum = sum + 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21004", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], i, j, n, court;\n  while (1) {\n    for (i = 0; 1; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    n = i;\n    for (i = 0, court = 0; i <= n; i++) {\n      for (j = i; j <= n - 1; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          court++;\n      }\n    }\n    cout << court << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], n, j, k, p, m;\n  do {\n    a[0] = -1;\n    for (j = 0, n = 0;; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1) {\n        break;\n      }\n      if (a[j] == 0)\n        break;\n      n++;\n    }\n    m = 0;\n    for (k = 0; k <= n - 1; k++) {\n      for (p = k + 1; p <= n; p++) {\n        if (a[p] == (a[k] * 2) || a[k] == (a[p] * 2))\n          m++;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    printf(\"%d \", m);\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21006", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16], i = 0, j = 0, n = 0, Two;\n\n  for (i = 0; i < 16; i++) {\n    a[i] = 0;\n  }\n\n  while (1 > 0) {\n\n    n = 0;\n    Two = 0;\n\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[0] == -1))\n        break;\n      else {\n        n++;\n      }\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == (2 * a[j])) || (a[j] == (2 * a[i])))\n          Two++;\n      }\n    }\n\n    printf(\"%d\\n\", Two);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21007", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, x, y, m, n, a[20];\n  for (j = 1; j <= 15; j++) {\n    t = 0;\n    cin >> y;\n    if (y == -1)\n      break;\n    else {\n      a[0] = y;\n      for (i = 1; i <= 20; i++) {\n        scanf(\"%d\", &x);\n        if (x == 0)\n          break;\n        else {\n          a[i] = x;\n        }\n      }\n      for (m = 0; m <= i - 1; m++) {\n        for (n = 0; n <= i - 1; n++) {\n          if (a[m] == 2 * a[n])\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n    }\n  }\n}\n"}
{"label": "12", "index": "21008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, i, j;\n  int sz[16];\n  for (;;) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (sz[i] - 2 * sz[j] == 0)\n          t = t + 1;\n        else\n          ;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n    cout << t << \"\\n\";\n    t = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, count = 0, row, arr[100][100], n[100], b[100];\n  for (i = 0; i < 100; i++) {\n    count = 0;\n    for (j = 0; j < 100; j++) {\n      scanf(\"%d\", &arr[i][j]);\n      if (arr[i][j] == 0 || arr[i][j] == -1) {\n        n[i] = count;\n        break;\n      }\n      count++;\n    }\n    if (arr[i][j] == -1) {\n      row = i; \n      break;\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    count = 0;\n    for (j = 0; j < n[i]; j++) {\n      for (k = j + 1; k < n[i]; k++) {\n        if (arr[i][j] == (arr[i][k] * 2) || (arr[i][j] * 2) == arr[i][k]) {\n          count++;\n        }\n      }\n    }\n    b[i] = count;\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"\\n%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0, mat[100];\n  memset(mat, 0, sizeof(mat));\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n == 0) {\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    } else if (n > 49) {\n      mat[n] = 1;\n      if (mat[n >> 1])\n        sum++;\n    } else {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int i, num, n;\n  while (1) {\n    for (i = 1; i <= 100; i++)\n      a[i] = 0;\n    do {\n      scanf(\"%d \", &num);\n      a[num] = 1;\n    } while (num != 0 && num != -1);\n    if (num == -1)\n      break;\n    n = 0;\n    for (i = 0; i <= 50; i++)\n      if (a[i] && a[2 * i])\n        n++;\n    cout << n - 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, n, x, y;\n  for (;;) {\n    j = 0, n = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      j++;\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    for (i = j - 1; i >= 0; i--) {\n      for (k = i - 1; k >= 0; k--) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    printf(\"%d \", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21013", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, c, m, a[17];\n  while (1) {\n\n    for (i = 1; i <= 16; i++) {\n      a[i] = 0;\n      m = 0;\n    }\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      if (a[i] == 0) {\n        c = i;\n        break;\n      }\n    }\n    for (i = 1; i < c; i++)\n\n      for (j = i; j < c; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          m++;\n      }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int output = 0, i, j, length;\n  float data[16];\n\n  data[0] = -2;\n\n  while (data[0] != -1) {\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%f\", &data[i]);\n      if (data[i] == 0) {\n        length = i;\n        break;\n      }\n      if (data[i] == -1)\n        break;\n    }\n\n    if (data[i] == -1)\n      break;\n\n    for (i = 0; i <= length - 1; i++)\n      for (j = 0; j <= length - 1; j++) {\n        if ((data[j] / data[i]) == 2)\n          output = output + 1;\n      }\n\n    cout << output << \"\\n\";\n    output = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 1; k < pause; k++) {\n      for (i = 0; i < pause - k; i++) {\n        if (A[i] <= A[i + 1]) \n        {\n          m = A[i];\n          A[i] = A[i + 1];\n          A[i + 1] = m;\n        }\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = k + 1; i < pause; i++) {\n        if (A[k] == 2 * A[i])  {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21016", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, h, t = 0, flag = 1;\n  while (flag == 1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < h; i++) {\n        for (j = 0; j < h; j++)\n          if (a[i] == 2 * a[j])\n            t++;\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21017", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i = 0;\n  do {\n    int a[16] = {0};\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] != 0 && a[i - 1] != -1);\n\n    if (a[i - 1] == 0) {\n      int n = 0;\n      for (int j = 0; j <= i - 2; j++)\n        for (int k = 1; k <= i - 2 - j; k++) {\n          if (a[j] == a[j + k] * 2 || a[j + k] == a[j] * 2)\n            n++;\n        }\n      cout << n << endl;\n      i = 0;\n    }\n    if (a[0] == -1)\n      break;\n  } while (i != 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, x = 0, a[20];\n\n  while (1) {\n    x = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; a[j - 1] != 0; j++)\n      cin >> a[j];\n    for (k = 0; k < j - 1; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          x = x + 1;\n      }\n    }\n    cout << x << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, l;\n  do {\n    i = 0;\n    l = -1;\n    for (j = 0; j <= 15; j++)\n      a[j] = 1;\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n      if (a[0] == -1)\n        break;\n    } while (a[i - 1] != 0);\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          l++;\n      }\n    }\n    cout << l << endl;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][16] = {0}, i = 0, j = 0, x, y, z, m;\n  do {\n    j = 0;\n    do {\n      cin >> a[i][j];\n      if (a[i][j] == -1)\n        break;\n      j++;\n    } while (a[i][j - 1] != 0);\n    if (a[i][j] == -1)\n      break;\n    else\n      i++;\n  } while (1 == 1);\n  for (x = 0; x < i; x++) {\n    m = 0;\n    {\n      for (y = 0; a[x][y] != 0; y++) {\n        for (z = 0; a[x][z] != 0; z++) {\n          if (a[x][z] == 2 * a[x][y])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21021", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int k, i, m = 0, number;\n  double a[15];\n  do {\n    cin >> number;\n    if (number == -1)\n      break;\n    else {\n      a[0] = number;\n    }\n    for (i = 2;; i++) {\n      cin >> number;\n      a[i - 1] = number;\n      for (k = 0; k < i - 1; k++) {\n        if (a[i - 1] == (2 * a[k]) || a[i - 1] == (a[k] / 2))\n          m++;\n      }\n      if (number == 0) {\n        cout << endl << m << endl;\n        break;\n      }\n    }\n    m = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, d = 0, s[15], i, j;\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if (s[i] == s[j] * 2)\n          d++;\n        else\n          d = d;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, m = 1, num = 0;\n  while (scanf(\"%d \", &a[0])) {\n    num = 0;\n    m = 1;\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++, m++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (k == j)\n            continue;\n          if ((a[k] == 2 * a[j]) || (a[j] == 2 * a[k]))\n            num++;\n        }\n      }\n\n      cout << num / 2 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[16] = {0}, k;\nvoid scan();\n\nint main()\n\n{\n  scanf(\"%d\", &a[0]);\n  while (a[0] > 0) {\n    scan();\n    scanf(\"%d\", &a[0]);\n  }\n}\nvoid scan() {\n\n  int i, j = 1, n = 0, h, t;\n  while (scanf(\"%d\", &a[j]) && a[j] != 0) {\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (h = i; h < j; h++) {\n      if (a[i] > a[h]) {\n        t = a[i];\n        a[i] = a[h];\n        a[h] = t;\n      }\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (h = i + 1; h < j; h++) {\n      if (a[h] == 2 * a[i]) {\n        n++;\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "12", "index": "21025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], i, n, j;\n  scanf(\"%d\", &a[1]);\n  while (a[1] > 0) {\n\n    n = 0;\n    i = 1;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n      for (j = 1; j <= i; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          n++;\n\n    } while (a[i] != 0);\n    printf(\"%d\\n\", n - 1);\n    scanf(\"%d\", &a[1]);\n  }\n}\n"}
{"label": "12", "index": "21026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[500][15];\n  int i, j, t, number;\n  for (i = 0;; i++) {\n    number = 0;\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1) {\n      break;\n    }\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        printf(\"%d\\n\", number);\n        break;\n      }\n      for (t = 0; t < j; t++) {\n        if (a[i][j] * 2 == a[i][t]) {\n          number++;\n          break;\n        }\n        if (a[i][j] == a[i][t] * 2) {\n          number++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum, i, j;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d\", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int i, num, n;\n  while (1) {\n    for (i = 1; i <= 100; i++)\n      a[i] = 0;\n    do {\n      cin >> num;\n      a[num] = 1;\n    } while (num != 0 && num != -1);\n    if (num == -1)\n      break;\n    n = 0;\n    for (i = 0; i <= 50; i++)\n      if (a[i] && a[2 * i])\n        n++;\n    cout << n - 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21029", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i = 1, j, k, n = 0;\n  while (cin) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      k = i;\n    }\n    for (j = 0; j <= k - 1; j++) {\n      for (i = j + 1; i <= k; i++) {\n        if (a[j] * 2 == a[i] || a[i] * 2 == a[j])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21030", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int a[16];\n  for (int i = 0;;) {\n    cin >> a[i];\n    if (a[i] != 0 && a[i] != -1) {\n      i++;\n      continue;\n    } else if (!a[i]) {\n      int n = 0;\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if (((a[j] / a[k] == 2) && !(a[j] % a[k])) ||\n              ((a[k] / a[j] == 2) && !(a[k] % a[j])))\n            n++;\n        }\n      }\n      cout << n << endl;\n      i = 0;\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, m = 16, i = 1, j, k, t = 0;\n  int a[16];\n  while (n > 0) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == (-1))\n      break;\n    else {\n      while (m > 0) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        m--;\n        i++;\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k <= i - 1; k++) {\n          if (a[j] == 2 * a[k])\n            t++;\n        }\n    }\n    cout << t << endl;\n    t = 0;\n    m = 16;\n    i = 1;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][15], b[100] = {0}, i, j, k, s, m = 0, x;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1;; j++) {\n        b[m]++;\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n        else\n          continue;\n      }\n      m++;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    x = 0;\n    for (j = 0; j < b[i]; j++) {\n      s = 0;\n      for (k = 0; k < b[i]; k++) {\n        if (a[i][k] * 2 == a[i][j])\n          s = s + 1;\n      }\n      x = x + s;\n    }\n    printf(\"%d\\n\", x);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, n, j, total;\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    i = 1;\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n    }\n    n = i;\n    total = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int A[16];\n  int sum, j, i, k, m;\n  for (j = 0;; j++) {\n    scanf(\"%d\", &A[0]);\n    if (A[0] == -1)\n      return 0;\n    while (A[0] != 0 && A[0] != -1) {\n      sum = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &A[i]);\n        if (A[i] == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        for (m = 0; m < i; m++) {\n          if (A[k] == A[m] * 2)\n            sum = sum + 1;\n        }\n      }\n      cout << sum << \"\\n\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[100][15], c, i, m, x, y, n, e;\n  c = 0;\n  i = 0;\n  for (m = 0; m < 16; m++) {\n    scanf(\"%d\", &a);\n    if (a != 0) {\n      b[i][m] = a;\n    }\n    if (a == 0) {\n      for (x = 0; x < m; x++) {\n        for (y = 0; y < m; y++) {\n          n = b[i][x] / b[i][y];\n          e = b[i][x] % b[i][y];\n          if (n == 2 && e == 0) {\n            c++;\n          }\n        }\n      }\n      printf(\"%d\\n\", c);\n      c = 0;\n      m = -1;\n      i++;\n    }\n    if (a == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][15],\n      i = 0, j = 0, s = 0, m = 0, h = 0,\n      g[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, b[15];\n  while (1) {\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == 0) {\n      b[i] = j;\n      i = i + 1;\n      j = 0;\n\n    } else if (a[i][j] == -1) {\n      break;\n    } else\n      j = j + 1;\n  }\n  for (s = 0; s < i; s++) {\n    for (m = 0; m < b[s]; m++) {\n      for (h = 0; h < b[s]; h++) {\n        if (a[s][m] == 2 * a[s][h]) {\n          g[s] = g[s] + 1;\n        }\n      }\n    }\n  }\n  for (s = 0; s < i; s++) {\n    cout << g[s] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int a[16];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    k = 1;\n    n = 0;\n    while (cin >> a[k] && a[k] != 0)\n      k++;\n    for (i = 0; i < k - 1; i++)\n      for (j = i + 1; j < k; j++)\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21038", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 1; k < pause; k++) {\n      for (i = 0; i < pause - k; i++) {\n        if (A[i] <= A[i + 1]) {\n          m = A[i];\n          A[i] = A[i + 1];\n          A[i + 1] = m;\n        }\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = k + 1; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, count;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count += 1;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[15];\nint main() {\n  int num, doub;\n  char b;\n  int comp_with_zero;\n  for (; 1;) {\n    num = 0;\n    doub = 0;\n    comp_with_zero = 1;\n    b = 'a';\n    for (int ai = 0; ai < 15; ai++)\n      a[ai] = 0;\n\n    for (; 1;) {\n      b = cin.get();\n      if ((b == '0') && (a[num] == 0)) {\n        break;\n      }\n      if ((b - '0' < 10) && (b - '0' >= 0)) {\n        a[num] *= 10;\n        a[num] += (b - '0');\n      } else {\n        if (b == ' ') {\n          a[num] *= comp_with_zero;\n          num += 1;\n          comp_with_zero = 1;\n        }\n        if (b == '-') {\n          comp_with_zero = -1;\n        }\n      }\n    }\n    for (int i = 0; i <= num; i++) {\n      for (int ii = i; ii <= num; ii++) {\n        if (a[i] == 0)\n          break;\n        if ((a[i] % 2 == 0) && (a[i] / 2 == a[ii])) {\n          doub += 1;\n        }\n        if ((a[ii] % 2 == 0) && (a[ii] / 2 == a[i])) {\n          doub += 1;\n        }\n      }\n    }\n    cout << doub << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[20][20], i, j, b[20], s, n = 0, k;\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1)\n        break;\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n\n    if (a[i][0] == -1)\n      break;\n  }\n  s = i;\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < b[i]; j++) {\n      for (k = j + 1; k < b[i]; k++) {\n        if (((a[i][j] % a[i][k] == 0) && (a[i][j] / a[i][k] == 2)) ||\n            ((a[i][k] % a[i][j] == 0) && (a[i][k] / a[i][j] == 2)))\n          n = n + 1;\n      }\n    }\n    cout << n << endl;\n    n = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21042", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[15][15] = {0}, doub[15] = {0}, i, j, k, w[15] = {0}, row;\n  for (i = 0; i < 15; i++) {\n    for (j = 0; j < 20; j++) {\n      cin >> num[i][j];\n      if (num[i][j] == -1)\n        break;\n      if (num[i][j] == 0) {\n        w[i] = j;\n        break;\n      }\n    }\n    if (num[i][0] == -1) {\n      row = i;\n      break;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < w[i]; j++) {\n      for (k = 0; k < w[i]; k++) {\n        if (num[i][k] == 2 * num[i][j])\n          doub[i]++;\n      }\n    }\n    printf(\"%d\\n\", doub[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, a[16], s = 0, j;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      for (j = 0; j <= i; j++)\n        if (a[j] == 2 * a[i] || a[j] == 0.5 * a[i])\n          s += 1;\n    }\n    cout << s << \"\\n\";\n    s = 0;\n    scanf(\"%d\", &a[0]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21044", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, m, p, q;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] <= 0)\n        break;\n    }\n    m = 0;\n    for (p = 0; p < j; p++) {\n      for (q = 0; q < j; q++) {\n        if (a[i][q] == 2 * a[i][p])\n          m++;\n      }\n    }\n    if (a[i][j] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = 0; a[i][s] != 0; s++)\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "21046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, d = 0, s[15], i, j;\n\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if ((s[i] == s[j] * 2) && (s[i] != 0) && (s[j] != 0))\n          d++;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21047", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[16][16], i, j, t[15] = {0}, k = 0, f, b[16] = {0};\n  for (i = 0; i <= 10; i++) {\n    for (j = 0; j <= 15; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == -1)\n        break;\n      if (a[i][j] == 0)\n        break;\n      t[i] = t[i] + 1;\n    }\n    if (a[i][j] == -1)\n      break;\n    k = k + 1;\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < t[i]; j++) {\n      for (f = j + 1; f <= t[i]; f++) {\n        if ((a[i][j] == 2 * a[i][f]) || (a[i][f] == 2 * a[i][j]))\n          b[i]++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m;\n  for (i = 1;; i++) {\n    int num[16];\n    for (j = 1;; j++) {\n      scanf(\"%d \", &num[j]);\n      if (num[j] == 0)\n        break;\n    }\n    if (num[1] == -1)\n      break;\n    int cnt = 0;\n    for (k = 1; k <= j - 1; k++)\n      for (m = 1; m <= j - 1; m++) {\n        if (num[k] * 2 == num[m])\n          cnt++;\n      }\n    cout << cnt << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, j;\n  int count = 0;\n  int sz[16] = {0};\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == 0) {\n      for (k = 0; k < i - 1; k++) {\n        for (j = k + 1; j < i; j++) {\n          if (sz[k] == 2 * sz[j] || sz[k] * 2 == sz[j]) {\n            count++;\n          }\n        }\n      }\n      printf(\"%d\\n\", count);\n      count = 0;\n      i = -1;\n    }\n\n    if (sz[i] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21050", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  int a[16], i, j, k, count;\n  while (cin >> t) {\n    count = 0;\n    if (t < 0)\n      return 0;\n    a[0] = t;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j])\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[500];\n  int i, j, n, ans;\n  for (; scanf(\"%d\", &a[0]), a[0] != -1;) {\n    for (n = 1; scanf(\"%d\", &a[n]), a[n] != 0; n++)\n      ;\n    ans = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        if (a[i] == a[j] * 2)\n          ans++;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[500][15];\n  int i, j, t, number;\n  for (i = 0;; i++) {\n    number = 0;\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1) {\n      break;\n    }\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        cout << number << \"\\n\";\n        break;\n      }\n      for (t = 0; t < j; t++) {\n        if (a[i][j] * 2 == a[i][t]) {\n          number++;\n          break;\n        }\n        if (a[i][j] == a[i][t] * 2) {\n          number++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    int a[16] = {0};\n    int i, j = 0, k;\n    int sum = 0;\n    a[j] = b;\n    while (a[j] != 0) {\n      j++;\n      cin >> a[j];\n    }\n    for (i = 0; i < j - 1; i++) {\n      for (k = i + 1; k < j; k++) {\n        if (a[k] == a[i] * 2 || a[i] == a[k] * 2) {\n          sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    scanf(\"%d\", &b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20]; \n  int i, cnt;\n  i = 0; \n  cnt = 0;\n  cin >> a[i]; \n\n  while (a[i] != -1) \n  {\n    while (a[i] != 0) \n    {\n      i++;\n      cin >> a[i];\n    }                            \n    for (int j = 0; j <= i; j++) \n    {\n      for (int k = 0; k <= i; k++) {\n        if (a[k] == 2 * a[j])\n          cnt++;\n      }\n    }\n    cout << cnt - 1 << endl; \n    i = 0;\n    cnt = 0;\n    cin >> a[i]; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100];\n  int d, i, t, p = 0;\n  while (true) {\n    t = 0;\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    while (true) {\n      scanf(\"%d\", &d);\n      if ((d == 0) || (d == -1))\n        break;\n      a[d] = 1;\n    }\n    if (d == -1)\n      break;\n    else {\n      if (p)\n        printf(\"\\n\");\n      p = p + 1;\n      for (i = 1; i < 50; i = i + 1)\n        if ((a[i]) && (a[2 * i]))\n          t++;\n      printf(\"%d\", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k, s, n;\n  for (k = 1;; k++) {\n    s = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[n] == -1)\n      break;\n    for (i = 1; i < n; i++) {\n      for (j = i + 1; j <= n; j++) {\n        if ((a[i] * 2 == a[j]) || (a[j] * 2 == a[i])) {\n          s++;\n        }\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21057", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[17], t, sum;\n  do {\n    t = -1;\n    sum = 0;\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      t++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n\n    for (i = 1; i <= t; i++)\n      for (j = 1; j <= t; j++) {\n        if (a[j] == a[i] * 2) {\n          sum++;\n        }\n      }\n    if (a[1] != -1)\n      printf(\"%d\\n\", sum);\n  } while (a[1] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[25], i, j, count;\n  while (scanf(\"%d \", &n[1]), n[1] != -1) {\n    count = 0;\n    for (i = 2; scanf(\"%d \", &n[i]), n[i] != 0; i++) {\n      for (j = 1; j < i; j++) {\n        if (n[i] == 2 * n[j] || n[i] * 2 == n[j]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21059", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, m, a, result[20] = {0};\n  double num[15];\n  scanf(\"%lf\", &num[0]);\n  for (a = 1; num[0] != -1; a++) {\n    for (i = 1;; i++) {\n      scanf(\"%lf\", &num[i]);\n      if (num[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (m = 0; m <= i; m++)\n        if (num[m] / num[j] == 2)\n          result[a]++;\n    }\n    scanf(\"%lf\", &num[0]);\n  }\n  for (j = 1; j < a; j++)\n    printf(\"%d\\n\", result[j]);\n  return 0;\n}\n"}
{"label": "12", "index": "21060", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[101], number, i, j, count = 0;\n  while (1) {\n    cin >> number;\n    if (number == -1)\n      break;\n    for (i = 1;; i++) {\n      num[0] = number;\n      cin >> num[i];\n      for (j = 0; j < i; j++) {\n        if (num[j] > num[i] && num[j] == (num[i] * 2))\n          count++;\n        if (num[i] > num[j] && num[i] == (num[j] * 2))\n          count++;\n      }\n      if (num[i] == 0)\n        break;\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, b;\n  do {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    j = 0;\n    for (m = 0; m <= i - 1; m++) {\n      for (b = 0; b <= i - 1; b++) {\n        if (a[m] == a[b] * 2) {\n          j++;\n        }\n      }\n    }\n    cout << j << \"\\n\";\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], n, m, i = 1, t = 0;\n\n  cin >> a[1];\n\n  while (a[i] != -1) {\n    while (a[i] > 0) {\n      i = i + 1;\n      cin >> a[i];\n    }\n\n    for (m = 1; m < i; m++)\n      for (n = m + 1; n <= i; n++)\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          t = t + 1;\n\n    cout << t << endl;\n\n    for (i = 0; i < 17; i++)\n      a[i] = 0;\n\n    t = 0;\n    i = 1;\n\n    cin >> a[1];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, num;\n  do {\n    num = 0;\n    k = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k++;\n    }\n    for (i = 0; i <= k; i++)\n      for (j = 0; j <= k; j++)\n        if (a[i] == 2 * a[j])\n          num++;\n    printf(\"%d\\n\", num);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int i, j, m, n;\n\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        return 0;\n      }\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    m = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[j] == (a[i] + a[i]))\n          m++;\n      }\n    }\n\n    { cout << m << \"\\n\"; }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], n, i, j, sum = 0;\n\n  a[0] = 1;\n  while (1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        goto end;\n    }\n    n = i - 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j < n; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    for (i = 1; i < 16; i++)\n      a[i] = 0;\n    sum = 0;\n  }\nend:;\n}\n"}
{"label": "12", "index": "21066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, h, g, n, sign;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    if (a[j] == 0) {\n      for (k = j - 1; k >= 1; k--) {\n        if (a[k] == 0) {\n          break;\n        }\n      }\n      sign = 0;\n      for (h = k + 1; h < j; h++) {\n        for (g = k + 1; g < j; g++) {\n          if (a[h] == 2 * a[g])\n            sign++;\n        }\n      }\n      printf(\"%d\\n\", sign);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15][17], i, num, j, k, l, h;\n  scanf(\"%d\", &a[0][0]);\n  for (j = 0; j <= 15 && a[j][0] != -1; j++) {\n    for (i = 1; i <= 15 && a[j][i - 1] != 0; i++)\n      scanf(\"%d\", &a[j][i]);\n    scanf(\"%d\", &a[j + 1][0]);\n  }\n  for (l = 0; l <= 14 && a[l][0] != -1; l++) {\n    num = 0;\n    for (k = 0; k <= 15 && a[l][k] != 0; k++) {\n      for (h = 0; h <= 15 && a[l][h] != 0; h++) {\n        if (a[l][k] == 2 * a[l][h])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "21068", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16];\n  for (int i = 0;; i++) {\n    cin >> a[i];\n    switch (a[i]) {\n    case -1:\n      return 0; \n    case 0: {\n      int s = 0;\n      for (int j = 0; j < i; j++)\n        for (int k = j; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            s++; \n      i = -1;\n      cout << s << endl; \n    }\n    }\n  }\n}\n"}
{"label": "12", "index": "21069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float sz[16];\n  int n[100];\n  int i, k;\n  for (i = 0; i >= 0; i++) {\n    n[i] = 0;\n    for (k = 0; k < 16; k++) {\n      scanf(\"%f\", &sz[k]);\n      if (sz[k] == 0 || sz[0] == -1)\n        break;\n    }\n    for (int a = 0; a < k - 1; a++) {\n      for (int b = a + 1; b < k; b++) {\n        if (sz[a] == sz[b] * 2 || sz[a] == sz[b] / 2)\n          n[i]++;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", n[k]);\n  return 0;\n}\n"}
{"label": "12", "index": "21070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, sum = 0, b, j, k, m;\n  scanf(\"%d \", &b);\n  while (b != -1) {\n    a[0] = b;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (j = 1; j < i; j++) {\n      for (k = 0; k < i - j; k++) {\n        if (a[k] > a[k + 1]) {\n          m = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = m;\n        }\n      }\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (2 * a[j] == a[k])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "21071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, k, m[16] = {0}, n, len, sum;\n  i = 0;\n  do {\n    i = i + 1;\n    j = 0;\n    do {\n      j = j + 1;\n      scanf(\"%d\", &a[i][j]);\n      m[i] = m[i] + 1;\n    } while ((a[i][j] != 0) && (a[i][j] != -1));\n\n  } while (a[i][1] != -1);\n  len = i;\n  for (i = 1; i < len; i++) {\n    sum = 0;\n    for (j = 2; j <= m[i]; j++) {\n      for (k = 1; k < j; k++) {\n        if ((a[i][j] == 2 * a[i][k]) || (a[i][j] * 2 == a[i][k]))\n          sum = sum + 1;\n      }\n    }\n    cout << sum << \" \";\n  }\n}\n"}
{"label": "12", "index": "21072", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int N, num, i, j, k;\n  int a[200];\n\n  for (k = 1;; k++) {\n    i = 0;\n\n    while (1) {\n      cin >> a[i];\n\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n\n      i++;\n    }\n\n    num = 0;\n\n    for (i = 0; a[i] != 0; i++)\n      N = i;\n\n    for (i = 0; i <= N; i++) {\n      for (j = i + 1; j <= N; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    }\n\n    cout << num << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21073", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30], i, j, count1, count2;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    count2 = 0;\n    i = 0;\n    while (a[i]) {\n      scanf(\"%d\", &a[++i]);\n    }\n    count1 = i - 1;\n    for (i = 0; i <= count1; i++) {\n      for (j = i + 1; j <= count1; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count2++;\n    }\n    cout << count2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, l;\n  do {\n    i = 0;\n    l = -1;\n    for (j = 0; j <= 15; j++)\n      a[j] = 1;\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n      if (a[0] == -1)\n        break;\n    } while (a[i - 1] != 0);\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          l++;\n      }\n    }\n    cout << l << endl;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, t, k;\n\n  for (i = 0;; i++)\n\n  {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        break;\n      if (a[0] == -1) {\n        printf(\"\\n\");\n        return 0;\n      }\n    }\n\n    for (j = 0, t = 0; j <= 14; j++) {\n      for (k = j + 1; k <= 15; k++) {\n        if (a[k] != 0 && a[j] != 0 && (2 * a[j] == a[k] || 2 * a[k] == a[j]))\n          t = t + 1;\n      }\n      a[j] = 0;\n    }\n    printf(\"%d\\n\", t);\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "12", "index": "21076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[18] = {0}, i, n, ii, s;\n\n  while (1) {\n    i = 1;\n    while (1) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    n = i;\n    i = 1;\n    s = 0;\n    while (i < n) {\n      ii = 1;\n      while (ii < n) {\n        if (a[ii] == 2 * a[i])\n          s++;\n        ii++;\n      }\n      i++;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][17], i, j, k, s, r;\n  for (j = 0; j < 100; j++) {\n    r = 0;\n    scanf(\"%d\", &a[j][1]);\n    if (a[j][1] == -1)\n      break;\n    else {\n      for (i = 2, s = 1; a[j][i - 1] != 0; i++, s++)\n        scanf(\"%d\", &a[j][i]);\n      for (i = 1; i < s; i++) {\n        for (k = i + 1; k <= s; k++) {\n          if (a[j][k] == 2 * a[j][i] || a[j][i] == 2 * a[j][k]) {\n            r++;\n          }\n        }\n      }\n      cout << r << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, m, a, result[20] = {0};\n  double num[15];\n  cin >> num[0];\n  for (a = 1; num[0] != -1; a++) {\n    for (i = 1;; i++) {\n      scanf(\"%lf\", &num[i]);\n      if (num[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (m = 0; m <= i; m++)\n        if (num[m] / num[j] == 2)\n          result[a]++;\n    }\n    scanf(\"%lf\", &num[0]);\n  }\n  for (j = 1; j < a; j++)\n    cout << result[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, k;\n  static int a[16];\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (k = 1; k <= 15; k++) {\n      scanf(\" %d\", &a[k]);\n      if (a[k] == 0) {\n        break;\n      }\n    }\n    n = 0;\n    for (k = 0; a[k] != 0; k++)\n      for (m = 0; a[m] != 0; m++) {\n        if (a[m] == 2 * a[k]) {\n          n++;\n          break;\n        }\n      }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[15];\n  int i, NO, tmp, n, j;\n  while (1) {\n    n = 0;\n    cin >> tmp;\n    a[0] = tmp;\n    if (tmp == -1)\n      break;\n\n    NO = 0;\n\n    while (1) {\n      scanf(\"%d\", &tmp);\n      if (tmp == 0)\n        break;\n      a[++n] = tmp;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          NO++;\n\n    printf(\"%d\\n\", NO);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "12", "index": "21081", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][16];\n  int i, j, r, p;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n\n    for (j = 1; n[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n    int t = 0;\n    for (r = 0; r < j - 1; r++) {\n      for (p = r + 1; p < j; p++) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n    for (r = j - 1; r > 0; r--) {\n      for (p = r - 1; p >= 0; p--) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b, i = 0, k;\n  while (1) {\n    b = 0;\n    int a[16] = {0};\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      for (k = 0; k < i; k++) {\n        if ((a[i] == 2 * a[k]) || (a[i] == 0.5 * a[k]))\n          b++;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, s, n;\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21084", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][17], i, num, j, k, l, h;\n  scanf(\"%d\", &a[0][0]);\n  for (j = 0; j <= 15 && a[j][0] != -1; j++) {\n    for (i = 1; i <= 15 && a[j][i - 1] != 0; i++)\n      scanf(\"%d\", &a[j][i]);\n    cin >> a[j + 1][0];\n  }\n  for (l = 0; l <= 14 && a[l][0] != -1; l++) {\n    num = 0;\n    for (k = 0; k <= 15 && a[l][k] != 0; k++) {\n      for (h = 0; h <= 15 && a[l][h] != 0; h++) {\n        if (a[l][k] == 2 * a[l][h])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "21085", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, e = 0;\n  int a[20];\n  for (;;) {\n\n    sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        i--;\n        break;\n      } else if (a[i] == -1) {\n        e = -1;\n        break;\n      }\n    }\n    if (e == -1)\n      break;\n    for (j = 0; j <= i; j++) {\n      for (k = 0; k <= i; k++) {\n        if (a[k] == a[j] * 2) {\n          sum++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21086", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n = 0, m, a[100][100], b[100] = {0};\n  for (i = 0;; i++) {\n    cin >> a[n][0];\n    if (a[n][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[n][j]);\n      if (a[n][j] == 0) {\n        m = j;\n        break;\n      }\n    }\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[n][j] == 2 * a[n][k])\n          b[n]++;\n      }\n    }\n    printf(\"%d\\n\", b[n]);\n    n++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, m = 0, number;\n  double a[15];\n  do {\n    cin >> number;\n    if (number == -1)\n      break;\n    else\n      a[0] = number;\n    for (i = 2;; i++) {\n      cin >> number;\n      a[i - 1] = number;\n      for (k = 0; k < i - 1; k++) {\n        if (a[i - 1] == (2 * a[k]) || a[i - 1] == (a[k] / 2))\n          m++;\n      }\n      if (number == 0) {\n        cout << \"\\n\" << m << \"\\n\";\n        break;\n      }\n    }\n    m = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int count = 0;\n  int i, j, k, m;\n  for (m = 0;; m++) {\n    cin >> a[m][0];\n    if (a[m][0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\" %d\", &a[m][i]);\n        if (a[m][i] == 0)\n          break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if ((a[m][j] == 2 * a[m][k]) || (a[m][j] * 2 == a[m][k]))\n          count = count + 1;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, j, k, n;\n  scanf(\"%d \", &a[1]);\n  while (a[1] != -1) {\n    n = 0;\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[j] == a[k] * 2)\n          n++;\n      }\n    }\n    n = n - 1;\n    printf(\"%d\\n\", n);\n    cin >> a[1];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21090", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int test[100][17] = {0};\n\n  int i, j, k, num;\n  int turn = 0, nonzero = 0, valid = 0;\n\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d \", &num);\n      if (num == 0)\n        break;\n      if (num == -1)\n        goto start;\n      test[i][j] = num;\n    }\n    turn += 1;\n  }\nstart:\n  for (i = 0; i < turn; i++) {\n    for (j = 0;; j++) {\n      if (test[i][j] != 0)\n        nonzero += 1;\n      else\n        break;\n    }\n    for (j = 0; j < nonzero; j++) {\n      for (k = 0; k < nonzero; k++) {\n        if ((float)(test[i][j]) / (float)(test[i][k]) == 2)\n          valid += 1;\n      }\n    }\n    printf(\"%d\\n\", valid);\n    valid = 0;\n    nonzero = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int s = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          s++;\n    cout << s << endl;\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21092", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, l, n; \n  k = 0;\n  while (k != -1) \n  {\n    if (a[0] == -1)\n      break; \n    i = 0;\n    l = 1;\n    do \n    {\n      i = i + 1;\n      cin >> a[i];\n      l = i + 1;\n    } while (a[i] != 0);\n    l = l - 1;\n    n = 0;\n    for (i = 0; i < l; i++) \n      for (j = 0; j < l; j++) {\n        if (a[i] == 2 * a[j])\n          n = n + 1;\n      }\n    cout << n << endl; \n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    cin >> a[0];\n    k = a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], b = 0, c = 0, d = 1, e = 0;\n  scanf(\"%d\", &a[b]);\n  while (a[b] != -1) {\n    while (a[b] != 0) {\n      b++;\n      scanf(\"%d \", &a[b]);\n    }\n    while (c <= b) {\n      while (d < b) {\n        if (a[c] == (a[d] * 2))\n          e = e + 1;\n        d = d + 1;\n      }\n      c = c + 1;\n      d = 0;\n    }\n    printf(\"%d\\n\", e);\n    b = 0;\n    scanf(\"\\n%d\", &a[b]);\n    e = 0;\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, e = 0;\n  int a[20];\n  for (;;) {\n\n    sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        i--;\n        break;\n      } else if (a[i] == -1) {\n        e = -1;\n        break;\n      }\n    }\n    if (e == -1)\n      break;\n    for (j = 0; j <= i; j++) {\n      for (k = 0; k <= i; k++) {\n        if (a[k] == a[j] * 2) {\n          sum++;\n          break;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21095", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i, n, j, m, k;\n  int flag;\n  while (1) {\n    m = 0;\n    j = 0;\n    flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k < i; k++) {\n        if ((a[k] == a[j] * 2 || a[j] == a[k] * 2) && (a[j] != 0 && a[k] != 0))\n          m++;\n      }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i = 0, m = 0, k = 0, j = 0;\n  do {\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0 && a[0] != -1) {\n      i = i + 1;\n      scanf(\"%d\", &a[i]);\n    }\n    if (a[0] != -1) {\n      for (j = 0; j < i; j++) {\n        for (k = i - 1; k > j; k--) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            m = m + 1;\n        }\n      }\n      printf(\"%d\\n\", m);\n    }\n    for (j = 0; j < i; j++)\n      a[j] = 0;\n    m = 0;\n    i = 0;\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "21097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i, j, k, cnt = 0;\n  while (cin >> num) {\n    if (num == -1)\n      break;\n    for (i = 0; i <= 15; i++) {\n      if (num == 0)\n        break;\n      a[i] = num;\n      cin >> num;\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = 1; k < i - j; k++) {\n        if ((a[j] == 2 * a[j + k]) || (a[j + k] == 2 * a[j]))\n          cnt++;\n      }\n    }\n    cout << cnt << \"\\n\";\n    cnt = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21098", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, num = 1, num1 = 1, i = 1, k, j, c = 0;\n  while (num1 != -1) {\n    cin >> num1;\n    a[0] = num1;\n    while (num != 0) {\n      cin >> num;\n      a[i] = num;\n      i++;\n    }\n    for (k = 0; k <= i - 2; k++) {\n      for (j = k + 1; j <= i - 2; j++)\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          c++;\n    }\n    cout << c << endl;\n    int a[15] = {0};\n    c = 0;\n    i = 1;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n      }\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n\n    int num = 0;\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 0; (j < 16) && (a[i][j] != 0); j++) {\n        for (k = j + 1; (k < 16) && (a[i][k] != 0); k++) {\n          if (a[i][k] == 2 * a[i][j])\n            num++;\n          else if (a[i][j] == 2 * a[i][k])\n            num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "21100", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21101", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[15], n;\n  int i;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    int cnt = 0, j;\n    for (i = 0; i <= n - 2; i++)\n      for (j = i + 1; j <= n - 1; j++) {\n        if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n          cnt++;\n      }\n    cout << cnt << endl;\n    for (i = 0; i <= 14; i++)\n      a[i] = 0;\n    cin >> a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[16];\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    else {\n      int count = 0, i = 0;\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if ((a[k] / a[j] == 2) || (a[j] / a[k] == 2))\n            count++;\n        }\n      }\n      printf(\"%d\\n\", count);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[16] = {0};\nint main() {\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == (-1))\n      break;\n    int i, j, k, countnumber = 0, countpair = 0;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    countnumber = i + 1;\n    for (i = 0; i < countnumber - 1; i++)\n      for (j = i + 1; j < countnumber; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          countpair++;\n      }\n    cout << countpair << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[17], i, n, j;\n  scanf(\"%d\", &a[1]);\n  while (a[1] > 0) {\n\n    n = 0;\n    i = 1;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n      for (j = 1; j <= i; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          n++;\n\n    } while (a[i] != 0);\n    cout << n - 1 << \"\\n\";\n    cin >> a[1];\n  }\n}\n"}
{"label": "12", "index": "21105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], b, n = 0, num = 0;\n  while (scanf(\"%d \", &b)) {\n    if (b == -1)\n      break;\n    else if (b == 0) {\n      for (int i = 0; i < n; i++)\n        for (int j = i; j < n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      n = 0;\n      cout << num << \"\\n\";\n      num = 0;\n    } else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int c[100];\n  int m, z;\n  for (m = 0;; m++) {\n    int i, j, k, n;\n    int a[17], b[17];\n    n = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1) {\n      goto end;\n    } else {\n      for (i = 1; a[i - 1] != 0; i++) {\n        scanf(\"%d \", &a[i]);\n        if (a[i] == -1) {\n          goto end;\n        }\n        b[i] = 2 * a[i];\n      }\n      for (j = 0; j < i - 1; j++) {\n        for (k = 0; k < i - 1; k++) {\n          if (b[k] == a[j])\n            n++;\n        }\n        c[m] = n;\n      }\n    }\n  }\nend:\n  for (z = 0; z < m; z++)\n    cout << c[z] << \" \";\n}\n"}
{"label": "12", "index": "21107", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int A[16];\n  int sum, j, i, k, m;\n  for (j = 0;; j++) {\n    scanf(\"%d\", &A[0]);\n    if (A[0] == -1)\n      return 0;\n    while (A[0] != 0 && A[0] != -1) {\n      sum = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &A[i]);\n        if (A[i] == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        for (m = 0; m < i; m++) {\n          if (A[k] == A[m] * 2)\n            sum = sum + 1;\n        }\n      }\n      printf(\"%d\\n\", sum);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21108", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100];\n  int d, i, t, p = 0;\n  while (true) {\n    t = 0;\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    while (true) {\n      cin >> d;\n      if ((d == 0) || (d == -1))\n        break;\n      a[d] = 1;\n    }\n    if (d == -1)\n      break;\n    else {\n      if (p)\n        printf(\"\\n\");\n      p = p + 1;\n      for (i = 1; i < 50; i = i + 1) {\n        if ((a[i]) && (a[2 * i])) {\n          t++;\n        }\n      }\n      printf(\"%d\", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21109", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, k, m;\n  int a[100];\n\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    n = i;\n    for (i = n - 1; i > 0; i--) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          k = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = k;\n        }\n      }\n    }\n    m = 0;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i]) {\n          m = m + 1;\n          break;\n        }\n        if (a[j] > 2 * a[i]) {\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21110", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid initarray(int a[], int b, int length);\nvoid base(int a[1000]);\nint twice(int a[1000]);\nint main(void) {\n  int a[1000];\n  int t[1000];\n  int i, j, k, l;\n  i = 0;\n  for (i = 0; i < 1000; i++) {\n    a[i] = -2;\n  }\n  i = 0;\n  k = -2;\n  while (a[i] != -1) {\n    while (k != 0) {\n      cin >> k;\n      a[i] = k;\n      i++;\n    }\n    base(a);\n    j = twice(a);\n    cout << j << \"\\n\";\n    initarray(a, -2, 1000);\n    i = 0;\n    k = -2;\n  }\n  return 1;\n}\n\nvoid initarray(int a[], int b, int length) {\n  int i;\n  for (i = 0; i < length; i++) {\n    a[i] = b;\n  }\n}\n\nvoid base(int a[1000]) {\n  int b[1000 + 1];\n  int i, j;\n  initarray(b, 0, 1000);\n  for (i = 0; i < 1000; i++) {\n    if (a[i] > 0) {\n      b[a[i]]++;\n    }\n  }\n  j = 0;\n  for (i = 0; i <= 1000; i++) {\n    if (b[i] == 1) {\n      a[j] = i;\n      j++;\n    }\n  }\n}\n\nint twice(int a[1000]) {\n  int i, j, t, result;\n\n  i = 0;\n  j = 0;\n  t = 0;\n  result = 0;\n  while ((a[i] <= 50) && (a[j] > 0)) {\n    t = a[i] * 2;\n    j = i;\n    while ((a[j] <= t) && (a[j] > 0)) {\n      if (a[j] == t) {\n        result++;\n      };\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  return result;\n}\n"}
{"label": "12", "index": "21112", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[16] = {0}, n = 0, sum = 0;\nint main() {\n  int i, j;\n  while (1) {\n    n = 0;\n    sum = 0;\n    while (1) {\n      cin >> array_1[n];\n      if (array_1[n] == 0 || array_1[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array_1[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array_1[i] == array_1[j] * 2) || (array_1[j] == array_1[i] * 2))\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint mat[300];\n\nint main() {\n  int n, sum = 0;\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n) {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    } else {\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    }\n  }\n}\n"}
{"label": "12", "index": "21114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], n, i, j, sum = 0;\n\n  a[0] = 1;\n  while (1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        goto end;\n    }\n    n = i - 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j < n; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    for (i = 1; i < 16; i++)\n      a[i] = 0;\n    sum = 0;\n  }\nend:;\n}\n"}
{"label": "12", "index": "21115", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[20], k = 0, i, w, y, n, p; \n  while (1) {\n    cin >> p;\n    if (p == -1) \n      break;\n    else {\n      a[0] = p;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          n = i - 1;\n          break;\n        }\n      }\n      for (w = 0; w <= n; w++) {\n        for (y = 0; y <= n; y++) {\n          if (a[y] == 2 * a[w])\n            k++;\n        }\n      }\n      cout << k << endl;\n      i = 0;\n      k = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], n, j, k, p, m;\n  do {\n    a[0] = -1;\n    for (j = 0, n = 0;; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1) {\n        break;\n      }\n      if (a[j] == 0)\n        break;\n      n++;\n    }\n    m = 0;\n    for (k = 0; k <= n - 1; k++) {\n      for (p = k + 1; p <= n; p++) {\n        if (a[p] == (a[k] * 2) || a[k] == (a[p] * 2)) {\n          m++;\n        }\n      }\n    }\n    if (a[0] == -1)\n      break;\n    printf(\"%d \", m);\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2000];\n  int i, m, n, k, lt;\n  k = 0;\n  lt = 0;\n  for (i = 0; i < 2000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (m = lt; m < i; m++) {\n        for (n = lt; n < i; n++) {\n          if (a[m] == 2 * a[n]) {\n            k++;\n          }\n        }\n      }\n      printf(\"%d\\n\", k);\n      k = 0;\n      lt = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21118", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17];\n  int i, j, n, nn, count;\n  nn = 0;\n  while (scanf(\"%d \", &a[1]) && a[1] != -1) {\n    nn++;\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16];\n  int i = 1, a, j, b;\n\nloop:;\n  scanf(\"%d\", &s[i]);\n  if (s[i] != 0) {\n    i++;\n    goto loop;\n  }\n  a = i;\n  b = 0;\n  for (i = a; i >= 1; i--) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == 2 * s[j] || s[j] == 2 * s[i])\n        b++;\n    }\n  }\n\n  cout << b;\n\n  return 0;\n}\n"}
{"label": "12", "index": "21120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, num, a[15];\n  while (cin >> m) {\n    if (m == -1)\n      return 0;\n    else {\n      int n = 1;\n      num = 0;\n      a[0] = m;\n      for (int i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        if (a[i] != 0)\n          n = n + 1;\n      }\n      for (int j = 0; j <= n; j++) {\n        for (int k = j + 1; k <= n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            num = num + 1;\n        }\n      }\n      cout << num << \"\\n\";\n    }\n  }\n}\n"}
{"label": "12", "index": "21121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[100][15], t[15];\n  int sum[100];\n  int i, j, n, m, k;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        t[i] = j;\n        break;\n      } else if (s[i][0] == -1)\n        break;\n    }\n    if (s[i][0] == -1)\n      break;\n  }\n  for (n = 0; n < i; n++) {\n    sum[n] = 0;\n    for (m = 0; m < t[n] - 1; m++) {\n      for (k = m + 1; k < t[n]; k++) {\n        if (s[n][m] == 2 * s[n][k] || s[n][k] == 2 * s[n][m]) {\n          sum[n]++;\n        }\n      }\n    }\n  }\n  for (n = 0; n < i; n++) {\n    cout << sum[n] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21122", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int c[100];\n  int m, z;\n  for (m = 0;; m++) {\n    int i, j, k, n;\n    int a[17], b[17];\n    n = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1) {\n      goto end;\n    } else {\n      for (i = 1; a[i - 1] != 0; i++) {\n        cin >> a[i];\n        if (a[i] == -1) {\n          goto end;\n        }\n        b[i] = 2 * a[i];\n      }\n      for (j = 0; j < i - 1; j++) {\n        for (k = 0; k < i - 1; k++) {\n          if (b[k] == a[j])\n            n++;\n        }\n        c[m] = n;\n      }\n    }\n  }\nend:\n  for (z = 0; z < m; z++)\n    printf(\"%d \", c[z]);\n  return 0;\n}\n"}
{"label": "12", "index": "21123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int i = 0;\n  while (cin >> a[i]) {\n    int i = 0, j = 0;\n    if (a[i] == -1)\n      return 0;\n    do {\n      i++;\n      j++;\n      cin >> a[i];\n    } while (a[i]);\n\n    int y, z, k = 0;\n    for (z = 0; z <= j - 1; z++)\n      for (y = z + 1; y <= j - 1; y++)\n        if (a[z] == 2 * a[y] || a[y] == 2 * a[z]) {\n          k++;\n        }\n    cout << k << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[18], m, n, i, j, r = 0, b[100];\n  int t;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    m = 1;\n    r++;\n    n = 0;\n    a[0] = t;\n    for (i = 1; i < 18; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        m = m + 1;\n      else\n        break;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = m - 1; j > i; j--)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          n++;\n    }\n    b[r] = n;\n    scanf(\"%d\", &t);\n  }\n  for (i = 1; i < r + 1; i++) {\n    cout << b[i] << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[17], n, count = 1, result = 0;\n  while ((cin >> n) && (n != -1)) {\n    if (n) {\n      num[count] = n;\n      count++;\n    } else {\n      for (int i = 1; i < count; i++) {\n        for (int j = 1; j < count; j++) {\n          if (num[i] == 2 * num[j])\n            result++;\n        }\n      }\n      cout << result << \"\\n\";\n      result = 0;\n      count = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[100][20];\n  int num, temp, size, time = 0;\n  int i = 0, j = 0, k, l;\n\n  while (scanf(\"%d \", &num)) {\n    time = 0;\n    if (num == -1)\n      break;\n\n    else if (num != 0) {\n      a[i][j] = num;\n      j = j + 1;\n    }\n\n    else if (num == 0) {\n      size = j;\n\n      for (l = 0; l < size; l++)\n        for (j = 0; j + 1 < size; j++) {\n          if (a[i][j] > a[i][j + 1]) {\n            temp = a[i][j];\n            a[i][j] = a[i][j + 1];\n            a[i][j + 1] = temp;\n          }\n        }\n\n      for (k = 0; k < size; k++)\n        for (l = 0; l < size; l++) {\n          if (2 * a[i][k] == a[i][l])\n            time = time + 1;\n        }\n\n      cout << time << endl;\n      j = 0;\n      i = i + 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[15], m = 0, s, h, t;\n  scanf(\"%d\", &t);\n  while ((t + 1) != 0) {\n    for (n = 0, s = 0; t != 0; n++)\n      a[n] = t, s++, scanf(\"%d\", &t);\n    for (n = 0; n < s; n++) {\n      for (h = 0; h < s; h++) {\n        if (a[n] == 2 * a[h])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    scanf(\"\\n%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num[15], j, k, i, a = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] != -1) {\n      i = 1;\n      do {\n        scanf(\"%d\", &num[i]);\n        i++;\n      } while (num[i - 1] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (num[k] == num[j] * 2 || num[j] == num[k] * 2)\n            a++;\n        }\n      }\n      printf(\"%d\\n\", a);\n      a = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i = 0, k, x = 0, j;\n  for (;;) {\n    scanf(\"%d\", &a[i]);\n    i++;\n    if (a[i - 1] == -1)\n      break;\n  }\n  for (k = 0; k < i - 1; k++) {\n    for (j = k + 1; j < i - 1; j++) {\n      if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n        x++;\n      }\n      if (a[j + 1] == 0) {\n        break;\n      }\n    }\n    if (a[k + 2] == 0 || a[k + 2] == -1) {\n      k = k + 2;\n      printf(\"%d\\n\", x);\n      x = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21130", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], s, q;\n  do {\n    scanf(\"%d\", &q);\n    a[0] = q;\n    if (q == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    s = 0;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n        else\n          s = s;\n      }\n    }\n    printf(\"%d\\n\", s);\n  } while (q != -1);\n}\n"}
{"label": "12", "index": "21131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\n  int a[16], i = 0, j = 0, n = 0, Two;\n\n  for (i = 0; i < 16; i++) {\n    a[i] = 0;\n  }\n\n  while (1 > 0) {\n\n    n = 0;\n    Two = 0;\n\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[0] == -1))\n        break;\n      else\n        n++;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == (2 * a[j])) || (a[j] == (2 * a[i]))) {\n          Two++;\n        }\n      }\n    }\n\n    cout << Two << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21132", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n = 0, a[16], shu, sum = 0;\n  while (1) {\n    scanf(\"%d \", &shu);\n    if (shu == -1)\n      return 0;\n    else if (shu == 0) {\n      for (i = 1; i <= n; i++) {\n        if (a[i] && a[i] % 2 == 0) {\n          for (j = 1; j <= n; j++)\n            if (a[j] == a[i] / 2)\n              sum++;\n        }\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      n = 0;\n    } else {\n      n++;\n      a[n] = shu;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[15];\n  int a, i, k, count = 0;\n  for (i = 0; i < 15; i++) {\n    cin >> a;\n    if (a == -1)\n      break;\n    else if (a == 0) {\n      i = -1;\n      printf(\"%d\\n\", count);\n      count = 0;\n      continue;\n    } else\n      sz[i] = a;\n    for (k = 0; k <= i; k++) {\n      if (sz[i] == sz[k] * 2 || sz[k] == sz[i] * 2)\n        count++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m;\n  for (i = 1;; i++) {\n    int num[16];\n    for (j = 1;; j++) {\n      cin >> num[j];\n      if (num[j] == 0)\n        break;\n    }\n    if (num[1] == -1)\n      break;\n    int cnt = 0;\n    for (k = 1; k <= j - 1; k++)\n      for (m = 1; m <= j - 1; m++) {\n        if (num[k] * 2 == num[m])\n          cnt++;\n      }\n    printf(\"%d\\n\", cnt);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21135", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, sum = 0;\n  int a[20][20], b[20];\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1) {\n        m = i;\n        break;\n      }\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n    if (a[i][j] == -1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k <= j; k++) {\n        if (a[i][j] % a[i][k] == 0 && a[i][j] / a[i][k] == 2)\n          sum++;\n        else if (a[i][k] % a[i][j] == 0 && a[i][k] / a[i][j] == 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  while (1) {\n    n = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != -1) {\n      for (i = 2; a[i - 1] != 0; i++)\n        cin >> a[i];\n      for (j = 1; j < i - 1; j++)\n        for (k = 1; k < i - 1; k++)\n          if (a[k] == 2 * a[j])\n            n = n + 1;\n      cout << n << endl;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int shuzu[16];\n  int i, t, k, num = 0;\n\n  for (i = 0;; i++) {\n    scanf(\"%d\", &shuzu[i]);\n    if (shuzu[i] == -1) {\n      break;\n    }\n    if (shuzu[i] == 0) {\n\n      for (t = 0; t < i; t++) {\n        for (k = t + 1; k < i; k++) {\n          if (shuzu[t] == shuzu[k] * 2 || shuzu[t] * 2 == shuzu[k])\n            num++;\n        }\n      }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], h, i, j, x = 1, s;\n  while (x) {\n    for (i = 1; i < 17; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        goto end;\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n      continue;\n    }\n\n    if (x) {\n      s = 0;\n      for (i = 1; i < h - 1; i++) {\n        for (j = i + 1; j < h; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], b[20];\n  int i, j, k;\n  int n;\n  i = 1;\n  n = 0;\n\n  while (1) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      for (j = 1; j <= i - 1; j++)\n        b[j] = a[j] * 2;\n\n      for (j = 1; j <= i - 1; j++)\n        for (k = 1; k <= i - 1; k++) {\n          if (b[j] == a[k])\n            n++;\n        }\n\n      printf(\"%d\\n\", n);\n      i = 1;\n      n = 0;\n    } else\n      i++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  while (cin >> a[0] && a[0] != -1) {\n    int i = 0, j = 0, k = 0, n = 0;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (; j <= i - 1; j++) {\n      for (n = 0; n <= i - 1; n++)\n        if ((a[n] == 2 * a[j]) || (a[j] == 2 * a[n]))\n          k++;\n    }\n    k = k / 2;\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21141", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], b, n = 0, num = 0;\n  while (scanf(\"%d \", &b)) {\n    if (b == -1)\n      break;\n    else if (b == 0) {\n      for (int i = 0; i < n; i++)\n        for (int j = i; j < n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      n = 0;\n      printf(\"%d\\n\", num);\n      num = 0;\n    } else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21142", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;;) {\n    cin >> a[i];\n    if (a[i] != 0 && a[i] != -1) {\n      i++;\n      continue;\n    } else if (!a[i]) {\n      int n = 0;\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if (((a[j] / a[k] == 2) && !(a[j] % a[k])) ||\n              ((a[k] / a[j] == 2) && !(a[k] % a[j])))\n            n++;\n        }\n      }\n      cout << n << endl;\n      i = 0;\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21143", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum, i, j;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      cin >> c;\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[16], n, i, j, m, num;\n  n = 0;\n  m = 1;\n  do {\n    i = 0;\n    n = 0;\n    do {\n      cin >> c[i];\n      i++;\n    } while (c[i - 1] != 0 && c[0] != -1 && i < 16);\n    num = i - 1;\n    if (c[0] != -1) {\n      for (i = 0; i < num; i++) {\n        for (j = i + 1; j < num + 1; j++) {\n          if (c[i] > 0 && c[j] > 0)\n            if (c[i] == c[j] * 2 || c[j] == c[i] * 2)\n              n++;\n        }\n      }\n      printf(\"%d \", n);\n    } else\n      m = 0;\n  } while (m == 1);\n  return (0);\n}\n"}
{"label": "12", "index": "21145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[15], j, s, t, answer;\n  while (scanf(\"%d \", &num[0])) {\n    if (num[0] == -1)\n      break;\n    j = 0;\n    answer = 0;\n    do {\n      j++;\n      scanf(\"%d \", &num[j]);\n    } while (num[j] != 0);\n    for (s = 0; s < j; s++) {\n      for (t = 0; t < j; t++) {\n        if (num[t] == 2 * num[s])\n          answer++;\n      }\n    }\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][20], i = 0, j = 0, k = 0, num[100];\n\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][0] != -1);\n\n  i = 0;\n  while (a[i][0] != -1) {\n    num[i] = 0;\n    k = 0;\n    while ((a[i][k] != 0) && (a[i][k] != -1)) {\n      j = 0;\n      while ((a[i][j] != 0) && (a[i][j] != -1)) {\n        if (a[i][k] == 2 * a[i][j]) {\n          num[i]++;\n        }\n        j++;\n      }\n      k++;\n    }\n    i++;\n  }\n\n  i = 0;\n  while (a[i][0] != -1) {\n    printf(\"%d\\n\", num[i]);\n    i++;\n  }\n\n  return 1;\n}\n"}
{"label": "12", "index": "21147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      cin >> s[i];\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = i; j < count; j++) {\n        if (s[i] == s[j] * 2 || s[j] == s[i] * 2)\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, l;\n  do {\n    i = 0;\n    l = -1;\n    for (j = 0; j <= 15; j++)\n      a[j] = 1;\n    do {\n      cin >> a[i];\n      i++;\n      if (a[0] == -1)\n        break;\n    } while (a[i - 1] != 0);\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          l++;\n      }\n    }\n    cout << l << endl;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int n, s;\n\n  while (scanf(\"%d \", &a[1]), a[1] != -1) {\n    n = 1;\n    s = 0;\n    while (cin >> a[n + 1], a[n + 1] != 0)\n      n++;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        if (a[i] % a[j] == 0 && a[i] / a[j] == 2)\n          s++;\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i;\n  while (1) {\n    int n = 1, sum = 0, j;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    while (cin >> a[n]) {\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, t;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (!a[i])\n        break;\n    }\n    t = i;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == (2 * a[i]))\n          s += 1;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21152", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[15];\n  int i, m;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d \", &num[i]);\n    {\n      if (num[i] == 0)\n        break;\n    }\n    i++;\n  }\n  int j = 0;\n  int a;\n  m = i;\n  i = a = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (num[i] / num[j] == 2 && num[i] % num[j] == 0) {\n        a++;\n      }\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "12", "index": "21153", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20] = {0};\n  int i, j, k;\n  while (1) {\n    int num = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 1; j < i; j++) {\n      for (k = j; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  while (cin >> m) {\n    if (m == -1)\n      break;\n    int a[15], i = 0, j, k, count = 0;\n    a[0] = m;\n    while (scanf(\"%d \", &m)) {\n      if (m == 0)\n        break;\n      i++;\n      a[i] = m;\n    }\n    k = i + 1;\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21155", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int i;\n  int n = 0;\n  int num = 0;\n  int j;\n  while (1) {\n    n = 0;\n    num = 0;\n    for (i = 0; i < 20; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1) {\n        return 0;\n      }\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          num++;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], b[20], i, l, j, n, p = 0, num = 0;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &n);\n    if (n == -1)\n      break;\n    else {\n      a[0] = n;\n      for (l = 1;; l++) {\n        scanf(\"%d\", &a[l]);\n        if (a[l] == 0)\n          break;\n      }\n      for (i = 0; a[i] != 0; i++)\n        for (j = 0; a[j] != 0; j++) {\n          if (a[i] == a[j] * 2)\n            num++;\n        }\n      b[p] = num;\n      p++;\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "12", "index": "21157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16], i, n, j, total;\n  while (cin >> a[0] && a[0] != -1) {\n    i = 1;\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n    }\n    n = i;\n    total = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[100][15], i = 0, j = 0, x = 10, k = 0, m, num = 0;\n  for (i = 0; i < 100; i++) {\n    if (x == -1)\n      break;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &x);\n      if (x == -1)\n        break;\n      if (x == 0) {\n        break;\n      }\n      a[i][j] = x;\n    }\n  }\n  k = i;\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < 15; j++) {\n      for (m = j + 1; m < 15; m++) {\n        if (a[i][j] * 1.0 / a[i][m] == 2 || a[i][m] * 1.0 / a[i][j] == 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21159", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b[20] = {0};\n  int p = 2;\n  int j = 1, k = 2, num = 0;\n\n  while (cin >> b[1]) {\n\n    if (b[1] != -1) {\n      for (p = 2;; p++) {\n        cin >> b[p];\n        if (b[p] != 0)\n          continue;\n        else {\n\n          for (j = 1; j < p - 1; j++) {\n            for (k = j + 1; k <= p - 1; k++) {\n              if ((b[j] == b[k] * 2) || (b[k] == b[j] * 2))\n                num++;\n            }\n          }\n          printf(\"%d\\n\", num);\n          num = 0;\n          memset(b, sizeof(b), 0);\n          break;\n        }\n      }\n\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  do {\n    int a[16] = {0};\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n    } while (a[i - 1] != 0 && a[i - 1] != -1);\n\n    if (a[i - 1] == 0) {\n      int n = 0;\n      for (int j = 0; j <= i - 2; j++)\n        for (int k = 1; k <= i - 2 - j; k++) {\n          if (a[j] == a[j + k] * 2 || a[j + k] == a[j] * 2)\n            n++;\n        }\n      printf(\"%d\\n\", n);\n      i = 0;\n    }\n    if (a[0] == -1)\n      break;\n  } while (i != 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21161", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b[20] = {0};\n  int p = 2;\n  int j = 1, k = 2, num = 0;\n\n  while (cin >> b[1]) {\n\n    if (b[1] != -1) {\n      for (p = 2;; p++) {\n        cin >> b[p];\n        if (b[p] != 0)\n          continue;\n        else {\n\n          for (j = 1; j < p - 1; j++) {\n            for (k = j + 1; k <= p - 1; k++) {\n              if ((b[j] == b[k] * 2) || (b[k] == b[j] * 2))\n                num++;\n            }\n          }\n          cout << num << endl;\n          num = 0;\n          memset(b, sizeof(b), 0);\n          break;\n        }\n      }\n\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[16] = {0};\n  int i, j, k;\n  int num = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++)\n        for (k = j + 1; k < i; k++) {\n          if (a[j] == 2 * a[k] || 2 * a[j] == a[k]) {\n            num++;\n          }\n        }\n      cout << num << \"\\n\";\n      num = 0;\n      i = -1;\n    }\n    if (a[i] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, line, n;\n  for (line = 1;; line++) {\n    int a[16] = {0};\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        goto A;\n      else if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < 16; i++) {\n      for (j = 0; j < 16; j++) {\n        if (a[i] == 2 * a[j] && a[i] != 0) {\n          n++;\n          break;\n        }\n      }\n    }\n    cout << n << \"\\n\";\n  }\nA:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[16], num, i, j, k, n, cnt = 0;\n  while (cin >> num) {\n    if (num == -1)\n      break;\n    for (i = 0; i <= 15; i++) {\n      if (num == 0)\n        break;\n      a[i] = num;\n      cin >> num;\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = 1; k < i - j; k++) {\n        if ((a[j] == 2 * a[j + k]) || (a[j + k] == 2 * a[j]))\n          cnt++;\n      }\n    }\n    cout << cnt << endl;\n    cnt = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 0, n = 0, j, flag = 1;\n  while (flag) {\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == (-1)) {\n        flag = 0;\n        break;\n      } else if (a[i] == 0) {\n        for (j = 0; j <= i; j++)\n          a[j] = 0;\n        cout << n << \"\\n\";\n        n = 0;\n        i = 0;\n        break;\n      } else {\n        for (j = 0; j < i; j++) {\n          if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n            n++;\n        }\n      }\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int number[16];\n  int n;\n  for (;;) {\n    n = 0;\n    scanf(\"%d \", &number[0]);\n    if (number[0] == -1)\n      break;\n    int i;\n    for (i = 1; i < 16; i++) {\n      cin >> number[i];\n      if (number[i] == 0)\n        break;\n    }\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (number[k] == 2 * number[j]) {\n          n++;\n        }\n      }\n    }\n    cout << n << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  while (1) {\n    m = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if ((a[k] == 2 * a[j]) && (a[k]))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, x = 0, y = 1, a = 0;\n  float n[20];\n  do {\n    i = 0;\n    j = 0;\n    k = 0;\n    x = 0;\n    y = 1;\n    do {\n      scanf(\"%d\", &n[j]);\n      if (n[j] == 0 || n[j] == -1)\n        break;\n      j++;\n    } while (j < 20);\n    if (n[j] == -1)\n      return 0;\n    do {\n      do {\n        if (n[x] == n[y] * 2 || n[x] == n[y] / 2)\n          i++;\n        y++;\n      } while (y < j);\n      x++;\n      y = x + 1;\n    } while (x < j);\n    cout << i << \"\\n\";\n  } while (a < 1);\n  return 0;\n}\n"}
{"label": "12", "index": "21169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, j, n = 0, sum = 0;\n  int a[20];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    while (scanf(\"%d \", &a[i]) && a[i] != 0) {\n      i++;\n      n++;\n    }\n    for (i = 0; i <= n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2) {\n          sum++;\n        }\n\n    cout << sum << endl;\n    i = 1;\n    sum = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num[15], j, k, i, a = 0;\n  while (1) {\n    cin >> num[0];\n    if (num[0] != -1) {\n      i = 1;\n      do {\n        cin >> num[i];\n        i++;\n      } while (num[i - 1] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (num[k] == num[j] * 2 || num[j] == num[k] * 2)\n            a++;\n        }\n      }\n      cout << a << \"\\n\";\n      a = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21171", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  float s[15], t[15];\n  int a = 0;\n\n  for (int i = 0; i < 15; i++) {\n\n    cin >> s[i];\n    if (s[i] == 0)\n      break;\n    else {\n      t[i] = s[i];\n      a = a + 1;\n    }\n  }\n\n  int b = 0;\n  for (int h = 0; h < a; h++) {\n    for (int k = 0; k < a; k++) {\n      if (t[h] / t[k] == 2)\n\n        b = b + 1;\n    }\n  }\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21172", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  while (1) {\n    int array[16] = {0};\n    int n = 0, sum = 0;\n    while (1) {\n      cin >> array[n];\n      if (array[n] == 0 || array[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array[i] == array[j] * 2) || (array[j] == array[i] * 2))\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21173", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], h, i, j, x = 1, s;\n  while (x) {\n    for (i = 1; i < 17; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1)\n        goto end;\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n      continue;\n    }\n\n    if (x) {\n      s = 0;\n      for (i = 1; i < h - 1; i++) {\n        for (j = i + 1; j < h; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[15];\n  int i, m;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &num[i]);\n    {\n      if (num[i] == 0)\n        break;\n    }\n    i++;\n  }\n  int j = 0;\n  int a;\n  m = i;\n  i = a = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (num[i] / num[j] == 2 && num[i] % num[j] == 0)\n        a++;\n    }\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21175", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = 0; a[i][s] != 0; s++)\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "21176", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], k = 0, i, w, y, n, p;\n  while (1) {\n    cin >> p;\n    if (p == -1)\n      break;\n    else {\n      a[0] = p;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          n = i - 1;\n          break;\n        }\n      }\n      for (w = 0; w <= n; w++) {\n        for (y = 0; y <= n; y++) {\n          if (a[y] == 2 * a[w]) {\n            k++;\n          }\n        }\n      }\n      cout << k << endl;\n      i = 0;\n      k = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      cin >> s[i];\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = 0; j < count; j++) {\n        if (s[i] == s[j] * 2)\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21178", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  while (a != -1) {\n    int s[15] = {0};\n    int l = 1, m = 0;\n    s[0] = a;\n    do {\n      scanf(\"%d \", &a);\n      s[l] = a;\n      l++;\n    } while (a != 0);\n    for (int i = 0; i < 15; i++)\n      for (int j = 0; j < 15; j++)\n        if (s[j] == 2 * s[i] && s[i] != 0)\n          m++;\n    cout << m << endl;\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, sum;\n  do {\n    sum = 0;\n    i = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 2 * a[j])\n            sum += 1;\n        }\n      }\n      printf(\"%d\\n\", sum);\n    } else\n      break;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i, n, j, m, k;\n  int flag;\n  while (1) {\n    m = 0;\n    j = 0;\n    flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k < i; k++) {\n        if ((a[k] == a[j] * 2 || a[j] == a[k] * 2) && (a[j] != 0 && a[k] != 0))\n          m++;\n      }\n    cout << m << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0;\n  int a[16];\n  for (;; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 0) {\n      printf(\"%d\\n\", k);\n      i = -1;\n      k = 0;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n        k++;\n  }\n}\n"}
{"label": "12", "index": "21182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float s[16], t[16];\n  int u = 0, g = 0;\n  for (int k = 1; k < 100; k++) {\n    int a = 0;\n    for (int i = 0; i < 16; i++) {\n      cin >> s[i];\n      if (s[0] == -1 || scanf(\"\"))\n        printf(\"\");\n      else {\n        u += 1;\n        if (s[i] == 0)\n          break;\n        else {\n          t[i] = s[i];\n          a++;\n        }\n      }\n    }\n    int b = 0;\n    for (int h = 0; h < a; h++) {\n      for (int k = 0; k < a; k++) {\n        if (t[h] / t[k] == 2)\n          b++;\n      }\n    }\n    printf(\"%d\\n\", b);\n    g++;\n    if (g == u)\n      printf(\"\");\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21183", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[16];\nint main() {\n  int n;\n  while (1) {\n    int i = 0, s = 0, j;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0 || a[i] == -1) {\n\n        n = i;\n        break;\n      }\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          s++;\n      }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21184", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, b[15], m, i, j, z, num = 0;\n  memset(a, 0, 1000 * sizeof(int));\n  memset(b, 0, 15 * sizeof(int));\n  while (1) {\n    i = 0;\n    do {\n\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m == -1)\n        break;\n      b[i] = m;\n      i++;\n\n    } while (1);\n    if (m == -1)\n      break;\n\n    for (j = 0; j < i; j++) {\n      for (z = 0; z < i; z++) {\n        if (b[j] * 2 == b[z])\n          a[num]++;\n      }\n    }\n    num++;\n  }\n  for (j = 0; j < num; j++)\n    printf(\"%d\\n\", a[j]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21185", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, num;\n  do {\n    num = 0;\n    k = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k++;\n    }\n    for (i = 0; i <= k; i++)\n      for (j = 0; j <= k; j++)\n        if (a[i] == 2 * a[j])\n          num++;\n    cout << num << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], x, y, s, i, j, k, l, m, n;\n  do {\n    scanf(\"%d\", &x);\n    if (x == -1)\n      break;\n    a[0] = x;\n    i = 1;\n    do {\n      scanf(\" %d\", &y);\n      a[i] = y;\n      i = i + 1;\n    } while (y != 0);\n    scanf(\"\\n\");\n    n = i - 2;\n    i = 0;\n    while (i <= n) {\n      j = 0;\n      while (j <= n - 1) {\n        if (a[j] > a[j + 1]) {\n          s = a[j + 1];\n          a[j + 1] = a[j];\n          a[j] = s;\n        }\n        j = j + 1;\n      }\n      i = i + 1;\n    }\n    i = 0;\n    m = 0;\n    while (i <= n - 1) {\n      j = n - i;\n      k = 0;\n      while (k <= j - 1) {\n        if (a[j] == 2 * a[k])\n          m = m + 1;\n        k = k + 1;\n      }\n      i = i + 1;\n    }\n    printf(\"%d\\n\", m);\n  } while (x != -1);\n}\n"}
{"label": "12", "index": "21187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int e = 0, i, j;\n  int a[10000];\n  int ans;\n  while (1) {\n    i = 1;\n    cin >> a[0];\n    while (a[i - 1] != 0) {\n      cin >> a[i];\n      i++;\n    }\n    e = i - 1;\n    if (a[0] == -1)\n      return 0;\n    ans = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < e; j++) {\n        if (i != j)\n          if ((a[i] % a[j] == 0) && (a[i] / a[j] == 2))\n            ans++;\n      }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], i, j, m, k, b, n;\n  for (n = 0;; n++) {\n    for (i = 0; i < 17; i++) {\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m < 0)\n        goto er;\n      a[i] = m;\n    }\n    k = i;\n    b = 0;\n    for (i = 0; i < k; i++) {\n      for (j = i + 1; j < k; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\ner:\n  return 0;\n}\n"}
{"label": "12", "index": "21189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[15];\n  int i, m;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &num[i]);\n    {\n      if (num[i] == 0)\n        break;\n    }\n    i++;\n  }\n  int j = 0;\n  int a;\n  m = i;\n  i = a = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (num[i] / num[j] == 2 && num[i] % num[j] == 0)\n        a++;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "12", "index": "21190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[16], i, k = 0, j = 0, n = 0;\n  for (i = 0; i < 16; i++)\n    a[i] = -1;\n  scanf(\"%d \", &k);\n  while (k != -1) {\n    a[j] = k;\n    j++;\n    if (k == 0) {\n      for (i = 0; i < 15; i++)\n        for (j = i + 1; j < 15; j++)\n          if ((a[j] - 2 * a[i] == 0) || (a[i] - 2 * a[j] == 0))\n            n++;\n      printf(\"%d\\n\", n);\n      for (i = 0; i < 16; i++)\n        a[i] = -1;\n      j = 0;\n      n = 0;\n    }\n    cin >> k;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[1000][100];\n  int i = 0, j = 0, h = 0, a, m = 0, sum = 0;\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    if (a != 0)\n      s[i][j++] = a;\n    else {\n      s[i][j] = a;\n      i++;\n      j = 0;\n    }\n    scanf(\"%d\", &a);\n  }\n\n  for (h = 0; h < i; h++) {\n    while (s[h][j] != 0) {\n      m = 0;\n      while (s[h][m] != 0) {\n        if (((float)s[h][j] / 2) == (float)s[h][m])\n          sum++;\n        m++;\n      }\n      j++;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  while (1) {\n    s = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] == a[k] * 2) {\n          s++;\n          break;\n        }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = j + 1; a[i][s] != 0; s++) {\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n        if (a[i][j] * 2 == a[i][s])\n          z[i]++;\n      }\n    }\n    printf(\"%d \", z[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0}, b[100] = {0}, n[100] = {0}, i, j, k;\n  int m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n\n    if (a[i][0] != -1) {\n      m = m + 1;\n      n[i]++;\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] != 0) {\n          n[i] = n[i] + 1;\n        }\n        if (a[i][j] == 0) {\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        if (a[i][j] == 2 * a[i][k]) {\n          b[i] = b[i] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "12", "index": "21195", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, count = 0;\n  for (;;) {\n    count = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j; k < i; k++) {\n          if (a[j] == a[k] * 0.5 || a[j] == a[k] * 2)\n            count++;\n        }\n      }\n      printf(\"%d\\n\", count);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, n;\n  while (scanf(\"%d \", &a[0])) {\n    n = 0;\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++)\n      cin >> a[i];\n    for (j = 0; j <= i - 2; j++)\n      for (r = 0; r <= i - 2; r++)\n        if (2 * a[j] == a[r])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21197", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], count = 0;\n  int i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i];\n    if (a[0] == -1)\n      break;\n    else {\n      if (a[i] == 0) {\n        for (j = 0; j < i; j++)\n          for (k = 0; k < i; k++) {\n            if (a[k] == a[j] * 2)\n              count++;\n          }\n        printf(\"%d\\n\", count);\n        count = 0;\n        i = -1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21198", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[16];\n  while (1) {\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    int count = 0;\n    for (int m = 0; m < i; m++) {\n      for (int n = 0; n < i; n++) {\n        if (a[m] == a[n] * 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid swap(int *a, int *b) {\n  int temp = *a;\n  *a = *b;\n  *b = temp;\n}\n\nint find(int *s, int x, int l, int r) {\n  if (l > r)\n    return 0;\n  int mid = (l + r) / 2;\n  if (s[mid] == x)\n    return 1;\n  else {\n    if (s[mid] > x)\n      return find(s, x, l, mid - 1);\n    else\n      return find(s, x, mid + 1, r);\n  }\n}\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  int x = 0;\n  int s[1000] = {0};\n  while ((scanf(\"%d\", &x), x) != -1) {\n    if (x != 0) {\n      s[n++] = x;\n      for (i = n - 1; (i > 0) && (s[i] < s[i - 1]); i--) {\n        swap(&s[i], &s[i - 1]);\n      }\n    } else {\n      int count = 0;\n      for (i = 0; i < n; i++) {\n        if (find(s, 2 * s[i], i + 1, n))\n          count++;\n      }\n      printf(\"%d\\n\", count);\n      for (i = 0; i < n; i++)\n        s[i] = 0;\n      n = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21200", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n;\n  int i;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    int cnt = 0, j;\n    for (i = 0; i <= n - 2; i++)\n      for (j = i + 1; j <= n - 1; j++) {\n        if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n          cnt++;\n      }\n    printf(\"%d\\n\", cnt);\n    for (i = 0; i <= 14; i++)\n      a[i] = 0;\n    cin >> a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0, k, m;\n  int a[100][100];\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &a[t][j]);\n    if (a[t][j] == 0) {\n      t = t + 1;\n    }\n    if (a[t][j] == -1) {\n      break;\n    }\n  }\n  for (k = 0; k < t; k++) {\n    m = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][i] == 2 * a[k][j] && a[k][i] != 0)\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, m, p, q;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] <= 0)\n        break;\n    }\n    m = 0;\n    for (p = 0; p < j; p++) {\n      for (q = 0; q < j; q++) {\n        if (a[i][q] == 2 * a[i][p])\n          m++;\n      }\n    }\n    if (a[i][j] == -1)\n      break;\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n      }\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n\n    int num = 0;\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 0; (j < 16) && (a[i][j] != 0); j++) {\n        for (k = j + 1; (k < 16) && (a[i][k] != 0); k++) {\n          if (a[i][k] == 2 * a[i][j])\n            num++;\n          else if (a[i][j] == 2 * a[i][k])\n            num++;\n        }\n      }\n    }\n    cout << num << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21204", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i;\n\n  for (i = 1;; i++) {\n    int j, k, n = 1, cnt = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; j < 16; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n\n      n++;\n    }\n\n    for (j = 0; j < n - 1; j++) {\n      for (k = 1; k <= n - j - 1; k++) {\n        if (a[j] == 2 * a[j + k] || 2 * a[j] == a[j + k])\n          cnt++;\n      }\n    }\n    printf(\"%d\\n\", cnt);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21205", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, t, i;\n  while (1) {\n    a = 0;\n    t = 0;\n    cin >> a;\n    if (a == -1) {\n      break;\n    }\n    int num[17] = {0};\n    num[1] = a;\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d \", &num[i]);\n      if (num[i] == 0) {\n        break;\n      }\n    }\n    for (int r = 1; r <= (i - 1); r++) {\n      for (int s = 1; s <= (i - 1); s++) {\n        if (num[r] == 2 * num[s]) {\n          t = t + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], len, count, i, j;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    }\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    count = 0;\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < len; j++) {\n        if (j == i)\n          continue;\n        else {\n          if (a[j] == (2 * a[i]))\n            count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21207", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16] = {0}, i, j, pair = 0, n;\n  for (i = 0; shuzu[0] != -1; i++) {\n    scanf(\"%d\", &shuzu[i]);\n    if (shuzu[i] == 0) {\n      n = i;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[i] == 2 * shuzu[j])\n            pair++;\n        }\n      }\n      printf(\"%d\\n\", pair);\n      i = -1;\n      pair = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21208", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16];\n  while ((scanf(\"%d \", &a[0])) && a[0] != -1) {\n    int num0 = 1, i, j, k, num = 0;\n    i = 1;\n    while (cin >> a[i] && (a[i] != 0)) {\n\n      num0++;\n      i++;\n    }\n    for (j = 0; j < num0 - 1; j++) {\n      for (k = j + 1; k <= (num0 - 1); k++) {\n        if ((a[j] == 2 * a[k]) || (2 * a[j] == a[k])) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i = -1, j, number = 0;\n  do {\n    for (i = 0; i < 16; i++)\n\n      a[i] = 0;\n\n    i = -1;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0 && a[i] != -1);\n    number = 0;\n    for (i = 0; a[i] != 0 && a[i] != -1; i++) {\n      for (j = 0; a[j] != 0 && a[i] != -1; j++) {\n        if (a[j] == a[i] * 2)\n          number++;\n      }\n    }\n    if (a[0] != -1) {\n      cout << number << endl;\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21210", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, k, m;\n  int a[100];\n\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = n - 1; i > 0; i--) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          k = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = k;\n        }\n      }\n    }\n    m = 0;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i]) {\n          m = m + 1;\n          break;\n        }\n        if (a[j] > 2 * a[i]) {\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n = 0, a[16], i = 0, count = 0;\n  for (;; n++) {\n    scanf(\"%d\", &a[n]);\n    if (a[n] == 0) {\n      cout << count << \"\\n\";\n      memset(a, 0, sizeof(a));\n      n = 0;\n      count = 0;\n    }\n    if (a[n] == -1)\n      break;\n    int ifOdd = a[n] % 2;\n    for (i = 0; i < n; ++i) {\n      if (ifOdd == 0)\n        if (a[i] == a[n] / 2)\n          count++;\n      if (a[i] == a[n] * 2)\n        count++;\n    }\n  }\n}\n"}
{"label": "12", "index": "21212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[15], sum = 0, n;\n  while (1) {\n    for (n = 0;; n++) {\n      scanf(\"%d \", &x[n]);\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (x[j] == x[i] * 2)\n          sum = sum + 1;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21213", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, d, total;\n  total = 0;\n  int shuzu[16];\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &n);\n    if (n != -1) {\n      shuzu[i] = n;\n      if (n == 0) {\n        for (d = 0; d < i; d++) {\n          for (k = 0; k < i; k++) {\n            if (shuzu[d] == 2 * shuzu[k]) {\n              total++;\n            }\n          }\n        }\n        printf(\"%d\\n\", total);\n        i = -1;\n        total = 0;\n      }\n    } else {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], bn[100] = {0, 0, 0}, i, j, k, t = 1, l;\n\n  for (t = 1;; t++) {\n    i = 1;\n    do {\n      cin >> a[i - 1];\n      if (a[i - 1] == -1)\n        break;\n      i++;\n    } while (a[i - 2] != 0);\n    if (a[i - 1] == -1)\n      break;\n    for (j = 1; j <= i - 2; j++) {\n      for (k = 1; k <= i - 2; k++)\n        if (a[j - 1] == 2 * a[k - 1]) {\n          bn[t - 1]++;\n        }\n    }\n  }\n  for (l = 1; l <= t - 1; l++) {\n    printf(\"%d\\n\", bn[l - 1]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, count = 0;\n  for (;;) {\n    count = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j; k < i; k++) {\n          if (a[j] == a[k] * 0.5 || a[j] == a[k] * 2)\n            count++;\n        }\n      }\n      cout << count << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int A[16];\n  int sum, j, i, k, m;\n  for (j = 0;; j++) {\n    scanf(\"%d\", &A[0]);\n    if (A[0] == -1)\n      return 0;\n    while (A[0] != 0 && A[0] != -1) {\n      sum = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &A[i]);\n        if (A[i] == 0) {\n          break;\n        }\n      }\n      for (k = 0; k < i; k++) {\n        for (m = 0; m < i; m++) {\n          if (A[k] == A[m] * 2)\n            sum = sum + 1;\n        }\n      }\n      cout << sum << \"\\n\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21217", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int i = 0, x, j, g, k, b, a[15];\n  while (cin >> x) {\n    if (x == -1)\n      return 0;\n    else {\n      j = 0;\n      i = 0;\n      for (g = 0;; g++) {\n        a[i] = x;\n        i++;\n        cin >> x;\n        if (x == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        b = 2 * a[k];\n        for (g = 0; g < i; g++) {\n          if (a[g] == b)\n            j++;\n        }\n      }\n    }\n    cout << j << endl;\n  }\n}\n"}
{"label": "12", "index": "21218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k;\n  for (i = 0; i < 15; i++)\n    x[i] = 0;\n  for (i = 0;; i++) {\n    cin >> x[i];\n    if (x[i] == -1)\n      break;\n    if (x[i] == 0) {\n      int t = 0;\n      for (j = 0; j < i; j++)\n        for (k = 0; k < i; k++)\n          if (x[j] == 2 * x[k]) {\n            t++;\n          }\n      cout << t << endl;\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[15];\n  scanf(\"%d\", &p[0]);\n  int i;\n  int l = 0;\n  for (i = 1; i < 15; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n    else {\n      p[i] = a;\n      l++;\n    }\n  };\n  int j, m, max;\n  for (j = 0; j < l - 1; j++) {\n    for (m = j + 1; m < l; m++)\n      if (p[j] > p[m]) {\n        max = p[j];\n        p[j] = p[m];\n        p[m] = max;\n      }\n  }\n  int num = 0;\n  int k, n;\n  for (k = 0; k < l - 1; k++) {\n    for (n = k + 1; n < l; n++) {\n      if ((p[n] / p[k]) == 2 && p[n] % p[k] == 0)\n        num++;\n      if (p[n] / p[k] > 2)\n        break;\n    }\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "12", "index": "21220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h, k, m;\n  int a[20];\n  for (k = 0;; k++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1) {\n        break;\n      }\n      m = 0;\n      if (a[i] == 0) {\n        for (j = 0; j < i - 1; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[k] == a[j] * 2 || a[j] == a[k] * 2)\n              m++;\n          }\n        }\n        cout << m << \"\\n\";\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21221", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, num[15], i, j, s, t, answer;\n  while (cin >> num[0]) {\n    if (num[0] == -1)\n      break;    \n    j = 0;      \n    answer = 0; \n    do {\n      j++;\n      cin >> num[j];       \n    } while (num[j] != 0); \n    for (s = 0; s < j; s++) {\n      for (t = 0; t < j; t++) {\n        if (num[t] == 2 * num[s]) \n          answer++;               \n      }\n    }\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int i, j, k, t, s;\n  int b[100] = {0};\n  for (i = 0; i <= 99; i++) {\n\n    for (j = 0; j <= 15; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        break;\n      }\n    }\n    if (a[i][0] == -1) {\n      b[i] = -1;\n      break;\n    }\n  }\n  for (k = 0; k <= 99; k++) {\n    if (a[k][0] == -1) {\n      break;\n    }\n    for (t = 0; t <= 15; t++) {\n      if (a[k][t] == 0 || a[k][t] == -1) {\n        break;\n      }\n      for (s = 0; s <= 15; s++) {\n        if (a[k][s] == 0) {\n          break;\n        }\n        if (a[k][t] * 2 == a[k][s]) {\n          b[k]++;\n        }\n      }\n    }\n  }\n  for (int q = 0; q <= 99; q++) {\n    if (b[q] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a[20], sum = 0;\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d \", &a[i]);\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int j, num;\n  while (1) {\n    num = 0;\n    for (int i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0) {\n        j = i - 1;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (int i = 0; i <= j; i++) {\n      for (int k = 0; k <= j; k++) {\n        if (a[i] / a[k] == 2 && i != k)\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21225", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[16], i, j, n = 0, num = 0, m;\n\n  while (1) {\n    cin >> m;\n    if (m == -1)\n      break;\n    else {\n      a[1] = m;\n      n = 1;\n    }\n    for (i = 2;; i++) {\n      cin >> x;\n      if (x == 0) {\n        break;\n      } else {\n        a[i] = x;\n        n = n + 1;\n      }\n    }\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        if (a[i] == (2 * a[j]))\n          num = num + 1;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m, x, l;\n  int a[15];\n  for (m = 1;; m++) {\n    for (x = 1; x <= 16; x++) {\n      cin >> l;\n      if (l != 0) {\n        a[x - 1] = l;\n      } else {\n        n = x - 1;\n        t = 0;\n        for (i = 0; i <= n - 2; i++) {\n          for (j = i + 1; j <= n - 1; j++) {\n            if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n              t++;\n          }\n        }\n        cout << t << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, a, b, k;\n  k = 0;\n  int sz[20], sz2[20], jieguo[1000];\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> (sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n      sz2[i] = sz[i];\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    n = 0;\n    for (a = 0; a < i; a++) {\n      for (b = 0; b < i; b++) {\n        if (sz2[b] * 2 == sz[a]) {\n          n++;\n        }\n      }\n    }\n    jieguo[k] = n;\n    k++;\n  }\n  for (i = 0; i < k; i++) {\n    cout << jieguo[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      scanf(\"%d \", &a[++n]);\n    for (int i = 0; i < n; i++) {\n      for (int j = i; j < n; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[15];\n  int a, b;\n  int i, t, h, k;\n  for (i = 0; i <= 100; i++) {\n    b = 0;\n    a = 0;\n    for (t = 0; t < 17; t++) {\n      scanf(\"%d\", &s[t]);\n      if (s[t] == 0)\n        break;\n      if (s[t] == -1)\n        break;\n      a++;\n    }\n    if (s[t] == -1)\n      break;\n    for (k = 0; k < a; k++) {\n      for (h = 0; h < a; h++) {\n        if (s[k] == 2 * s[h]) {\n          b++;\n        } else {\n          b = b;\n        }\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int i = 0;\n    int a[20] = {0};\n    int sum = 0;\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[i - 1] == -1)\n      break;\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = 0; k < i - 1; k++)\n        if (a[j] * 2 == a[k])\n          sum++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "12", "index": "21231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[100][100], i, k, j, s[100], num[100], t, p, m;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0) {\n          num[i] = j;\n          break;\n        }\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t < j; t++) {\n      for (m = t; m < num[k]; m++) {\n        if ((2 * n[k][t] == n[k][m]) || (2 * n[k][m] == n[k][t]))\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    cout << s[p] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k, s, n;\n  for (k = 1;; k++) {\n    s = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &a[i]);\n      n++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[n] == -1)\n      break;\n    for (i = 1; i < n; i++) {\n      for (j = i + 1; j <= n; j++) {\n        if ((a[i] * 2 == a[j]) || (a[j] * 2 == a[i]))\n          s++;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num = 0, tot, a[16], b[1000];\n  do {\n    i = 0;\n    tot = 0;\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[0] != -1) {\n      for (j = 0; j <= i - 3; j++)\n        for (k = j + 1; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            tot++;\n        }\n      b[num] = tot;\n      num++;\n    }\n  } while (a[0] != -1);\n  for (i = 0; i < num; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21234", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, end, k;\n  float a[1000];\n  int n[100];\n  int num[100];\n  for (i = 0; i < 100; i++) {\n    num[i] = -1;\n  }\n  i = 0;\n  j = 1;\n  n[0] = -1;\n  for (i = 1; i < 100; i++) {\n    n[i] = 0;\n  }\n  end = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%f\", &a[i]);\n    if (a[i] == -1) {\n      end = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < end; i++) {\n    if (a[i] == 0) {\n      n[j] = i;\n      j++;\n    }\n  }\n\n  k = 1;\n  while (n[k] != 0) {\n    num[k] = 0;\n    for (i = n[k - 1] + 1; i < n[k]; i++) {\n      for (j = n[k - 1] + 1; j < n[k]; j++) {\n        if (a[i] / a[j] == 2) {\n          num[k]++;\n        }\n      }\n    }\n    k++;\n  }\n\n  k = 1;\n  while (num[k] != -1) {\n\n    printf(\"%d\\n\", num[k]);\n    k++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21235", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, count;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count += 1;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21236", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], i, j, k, n = 0, N = 0, t;\n  for (k = 1; k < 100; k++) {\n    for (i = 0; i < 100; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        i = 100;\n    }\n    if (a[0] != -1) {\n      for (i = 1; i <= n - 2; i++) {\n        for (j = 0; j <= n - i - 2; j++) {\n          if (a[j] > a[j + 1]) {\n            t = a[j];\n            a[j] = a[j + 1];\n            a[j + 1] = t;\n          }\n        }\n      }\n      for (i = n - 2; i >= 0; i--) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] == 2 * a[j])\n            N++;\n        }\n      }\n      printf(\"%d\\n\", N);\n      N = 0;\n      n = 0;\n    }\n\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[16]; \n  int i = 1, j, k, n = 0;\n  while (cin) {\n    cin >> a[0];    \n    if (a[0] == -1) \n      break;        \n    for (i = 1;; i++) {\n      cin >> a[i];   \n      if (a[i] == 0) \n        break;       \n      k = i;         \n    }\n    for (j = 0; j <= k - 1; j++) \n    {\n      for (i = j + 1; i <= k; i++) \n      {\n        if (a[j] * 2 == a[i] || a[i] * 2 == a[j]) \n          n = n + 1;                              \n      }\n    }\n    cout << n << endl; \n    n = 0;             \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    cout << b[j] << \" \";\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[101], ori[15];\n  int n, i, count, tot;\n\n  scanf(\"%d\", &n);\n  while (n != -1) {\n\n    for (i = 0; i < 101; i++)\n      num[i] = 0;\n    count = 0;\n    while (n != 0) {\n\n      ori[count] = n;\n      count++;\n      num[n] = 1;\n      scanf(\"%d\", &n);\n    }\n    tot = 0;\n    for (i = 0; i < count; i++)\n      if (ori[i] <= 50 && num[ori[i] * 2])\n        tot++;\n    printf(\"%d\\n\", tot);\n    scanf(\"%d \", &n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ch[16], i, j, n, m;\n\n  scanf(\"%d \", &ch[0]);\n\n  while (ch[0] != -1) {\n    n = 0;\n\n    for (i = 1; ch[i - 1] != 0; i++) {\n      n++;\n\n      cin >> ch[i];\n    }\n\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (ch[i] % 2 == 1)\n        continue;\n      else {\n        for (j = 0; j < n; j++) {\n          if (ch[i] == 2 * ch[j])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n\n    cin >> ch[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  int a[16], i, j, k, count;\n  while (cin >> t) {\n    count = 0;\n    if (t < 0)\n      return 0;\n    a[0] = t;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j])\n          count++;\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21242", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20];\n  int i = 0, n = 0, j;\n  int count = 0;\n  do {\n    n = 0;\n    count = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      i = 1;\n      do {\n        cin >> a[i];\n        i++;\n        count++;\n      } while (a[i - 1] != 0);\n\n      for (i = 0; i < count; i++) {\n        for (j = i + 1; j < count; j++) {\n          if (a[i] == 2 * a[j] || 2 * a[i] == a[j]) {\n            n++;\n          }\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k;\n  int nowi;\n  int output;\n  int part[20][16];\n  static int jcount[20], group[20];\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &part[i][j]);\n      jcount[i]++;\n      if (part[i][j] <= 0)\n        break;\n    }\n    if (part[i][j] == -1) {\n      break;\n    }\n  }\n  nowi = i;\n  for (i = 0; i < nowi; i++) {\n    for (j = 0; j < jcount[i] - 1; j++) {\n      for (k = 0; k < jcount[i] - 1; k++) {\n        if ((part[i][j] / part[i][k] == 2) && (part[i][j] % part[i][k] == 0))\n          group[i]++;\n      }\n    }\n  }\n\n  for (output = 0; output < nowi; output++)\n    cout << group[output] << endl;\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "12", "index": "21244", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[18];\n  int i, j, k, c, d;\n  double b;\n  a[0] = 0;\n  for (i = 1;; i++) {\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (j = 2;; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n    }\n    k = 0;\n    for (c = 1; c < j; c++) {\n      for (d = 1; d < j; d++) {\n        b = a[c] / a[d];\n        if (b == 2)\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21245", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  while (1) {\n    int i = 0, num = 0, p = 0;\n    while (1) {\n      cin >> a[i];\n      if (a[i] <= 0)\n        break;\n      i++;\n    }\n    if (a[0] == -1)\n      break;\n    for (int j = 0; j < i; j++) {\n      p = j;\n      for (int k = 0; k < i; k++) {\n        if (a[p] * 2 == a[k])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, c, m, a[17];\n  while (1) {\n\n    for (i = 1; i <= 16; i++) {\n      a[i] = 0;\n      m = 0;\n    }\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      if (a[i] == 0) {\n        c = i;\n        break;\n      }\n    }\n    for (i = 1; i < c; i++)\n\n      for (j = i; j < c; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          m++;\n      }\n    cout << m << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[16] = {0};\nint main() {\n  while (cin >> a[0]) {\n    if (a[0] == (-1))\n      break;\n    int i, j, k, countnumber = 0, countpair = 0;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    countnumber = i + 1;\n    for (i = 0; i < countnumber - 1; i++)\n      for (j = i + 1; j < countnumber; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          countpair++;\n      }\n    cout << countpair << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21248", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20][20], i, j, b[20], s, n = 0, k;\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][0] == -1)\n        break;\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n\n    if (a[i][0] == -1)\n      break;\n  }\n  s = i;\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < b[i]; j++) {\n      for (k = j + 1; k < b[i]; k++) {\n        if (((a[i][j] % a[i][k] == 0) && (a[i][j] / a[i][k] == 2)) ||\n            ((a[i][k] % a[i][j] == 0) && (a[i][k] / a[i][j] == 2)))\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21249", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k;\n  int nowi;\n  int output;\n  int part[20][16];\n  static int jcount[20], group[20];\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> part[i][j];\n      jcount[i]++;\n      if (part[i][j] <= 0)\n        break;\n    }\n    if (part[i][j] == -1)\n      break;\n  }\n  nowi = i;\n  for (i = 0; i < nowi; i++) {\n    for (j = 0; j < jcount[i] - 1; j++) {\n      for (k = 0; k < jcount[i] - 1; k++) {\n        if ((part[i][j] / part[i][k] == 2) && (part[i][j] % part[i][k] == 0))\n          group[i]++;\n      }\n    }\n  }\n\n  for (output = 0; output < nowi; output++)\n    cout << group[output] << endl;\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "12", "index": "21250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n = 0, a[16], shu, sum = 0;\n  while (1) {\n    scanf(\"%d\", &shu);\n    if (shu == -1)\n      return 0;\n    else if (shu == 0) {\n      for (i = 1; i <= n; i++) {\n        if (a[i] && a[i] % 2 == 0) {\n          for (j = 1; j <= n; j++)\n            if (a[j] == a[i] / 2)\n              sum++;\n        }\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      n = 0;\n    } else {\n      n++;\n      a[n] = shu;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  while (1) {\n    s = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] == a[k] * 2) {\n          s++;\n          break;\n        }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[16], i, j, k, m, n, count; \n  for (i = 0;; i++) {\n    cin >> m;    \n    if (m == -1) \n    {\n      break;\n    } else \n    {\n      count = 0;\n      a[0] = m;\n      for (j = 1; j < 16; j++) \n      {\n        cin >> a[j];\n        if (a[j] == 0) \n        {\n          break; \n        }\n      }\n\n      n = j; \n      for (j = 0; j < n; j++) {\n        for (k = j + 1; k < n; k++) {\n          if (a[j] == 2 * a[k] ||\n              a[k] == 2 * a[j]) \n          {\n            count++;\n          }\n        }\n      }\n\n      cout << count << endl; \n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum, i, j;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d\", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, j, k, m;\n  for (i = 1;; i++) \n  {\n    int num[16];      \n    for (j = 1;; j++) \n    {\n      cin >> num[j];   \n      if (num[j] == 0) \n        break;         \n    }\n    if (num[1] == -1) \n      break;          \n    int cnt = 0;      \n    for (k = 1; k <= j - 1; k++)\n      for (m = 1; m <= j - 1; m++) {\n        if (num[k] * 2 == num[m]) \n          cnt++;                  \n      }\n    cout << cnt << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[15], i, m = 0;\n  for (i = 0; i < 15; i++) {\n    cin >> c[i];\n    if (c[i] == 0) {\n      break;\n    }\n  }\n\n  int k, j, n = 0;\n  for (k = 0; c[k] != 0; k++) {\n    for (j = 0; c[j] != 0; j++) {\n\n      if (c[k] == 2 * c[j]) {\n        n++;\n      }\n    }\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "12", "index": "21256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n  int num[1000] = {0}, n, m = 0, index = 0, i, j;\n  while (num[0] != -1) {\n    while (true) {\n      scanf(\"%d\", &num[index]);\n      index++;\n      scanf(\"%c\", &c);\n      if (c != ' ')\n        break;\n    }\n    for (i = 0; i < index; i++) {\n      for (j = 0; j < index; j++) {\n        if (num[i] == 2 * num[j] || num[i] * 2 == num[j])\n          m++;\n      }\n    }\n    if (num[0] == -1)\n      return 0;\n\n    cout << m / 2 << \"\\n\";\n    m = 0;\n    index = 0;\n  }\n}\n"}
{"label": "12", "index": "21257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, sum;\n\n  while (1) {\n\n    sum = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      for (j = 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          sum++;\n        }\n      }\n    }\n    if (a[1] != -1)\n      printf(\"%d\\n\", sum);\n    if (a[1] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  float s[15], t[15];\n  int a = 0;\n\n  for (int i = 0; i < 15; i++) {\n\n    scanf(\"%f\", &s[i]);\n    if (s[i] == 0)\n      break;\n    else {\n      t[i] = s[i];\n      a = a + 1;\n    }\n  }\n\n  int b = 0;\n  for (int h = 0; h < a; h++) {\n    for (int k = 0; k < a; k++) {\n      if (t[h] / t[k] == 2)\n\n        b = b + 1;\n    }\n  }\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21259", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i, j, k, cnt = 0;\n  while (cin >> num) {\n    if (num == -1)\n      break;\n    for (i = 0; i <= 15; i++) {\n      if (num == 0)\n        break;\n      a[i] = num;\n      cin >> num;\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = 1; k < i - j; k++) {\n        if ((a[j] == 2 * a[j + k]) || (a[j + k] == 2 * a[j]))\n          cnt++;\n      }\n    }\n    printf(\"%d\\n\", cnt);\n    cnt = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[15], m, n;\n  int i, j, k, h;\n  for (i = 0;; i++) {\n    n = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m == -1)\n        return 0;\n      p[j] = m;\n    }\n    for (k = 0; k < j; k++) {\n      for (h = 0; h < j; h++) {\n        if (p[k] == 2 * p[h])\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i;\n  while (1) {\n    int n = 1, sum = 0, j;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    while (cin >> a[n]) {\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], s, q;\n  do {\n    scanf(\"%d\", &q);\n    a[0] = q;\n    if (q == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    s = 0;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          s = s + 1;\n        } else\n          s = s;\n      }\n    }\n    printf(\"%d\\n\", s);\n  } while (q != -1);\n}\n"}
{"label": "12", "index": "21263", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid initarray(int a[], int b, int length);\nvoid base(int a[1000]);\nint twice(int a[1000]);\nint main(void) {\n  int a[1000];\n  int t[1000];\n  int i, j, k, l;\n  i = 0;\n  for (i = 0; i < 1000; i++) {\n    a[i] = -2;\n  }\n  i = 0;\n  k = -2;\n  while (a[i] != -1) {\n    while (k != 0) {\n      scanf(\"%d \", &k);\n      a[i] = k;\n      i++;\n    }\n    base(a);\n    j = twice(a);\n    printf(\"%d\\n\", j);\n    initarray(a, -2, 1000);\n    i = 0;\n    k = -2;\n  }\n  return 1;\n}\n\nvoid initarray(int a[], int b, int length) {\n  int i;\n  for (i = 0; i < length; i++)\n    a[i] = b;\n}\n\nvoid base(int a[1000]) {\n  int b[1000 + 1];\n  int i, j;\n  initarray(b, 0, 1000);\n  for (i = 0; i < 1000; i++) {\n    if (a[i] > 0) {\n      b[a[i]]++;\n    }\n  }\n  j = 0;\n  for (i = 0; i <= 1000; i++) {\n    if (b[i] == 1) {\n      a[j] = i;\n      j++;\n    }\n  }\n}\n\nint twice(int a[1000]) {\n  int i, j, t, result;\n\n  i = 0;\n  j = 0;\n  t = 0;\n  result = 0;\n  while ((a[i] <= 50) && (a[j] > 0)) {\n    t = a[i] * 2;\n    j = i;\n    while ((a[j] <= t) && (a[j] > 0)) {\n      if (a[j] == t) {\n        result++;\n      };\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  return result;\n}\n"}
{"label": "12", "index": "21264", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, n, i = 1;\n  for (; a[i] != -1;) {\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      for (int j = 0; j < i; j++) {\n        if (a[j] * 2 == a[i] || a[j] == a[i] * 2) {\n          n++;\n        }\n      }\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n    }\n    if (a[i] != -1) {\n      cout << n << endl;\n    }\n  }\n}\n"}
{"label": "12", "index": "21265", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, flag = 1;\n  int a[16] = {0};\n  int c[100] = {0};\n  while (flag) {\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        k++;\n        break;\n      }\n      for (j = i - 1; j > 0; j--) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          c[k]++;\n      }\n    }\n  }\n  for (i = 1; k > 0 && i < k; i++)\n    printf(\"%d\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int a[16] = {0}, i, j, p, k, l, num = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    while (a[0] != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          p = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = p;\n        }\n      }\n    }\n    for (k = 1; k <= i - 1; k++) {\n      for (l = k; l <= i; l++) {\n        if (2 * a[k] == a[l])\n          num++;\n        if (2 * a[k] < a[l])\n          break;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, h, t = 0, flag = 1;\n  while (flag == 1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < h; i++) {\n        for (j = 0; j < h; j++)\n          if (a[i] == 2 * a[j])\n            t++;\n      }\n      cout << t << \"\\n\";\n      t = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21268", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, num[16] = {0}, count = 0, key = 0;\n  cin >> num[0];\n  while (num[0] != -1) {\n    for (i = 0; num[i] != 0; i++) {\n      cin >> num[i + 1];\n    }\n    count = i;\n    key = 0;\n    for (i = 0; i < count; i++)\n      for (j = i; j < count; j++)\n        if (num[i] == 2 * num[j] || num[j] == 2 * num[i])\n          key++;\n    printf(\"%d\\n\", key);\n    for (i = 0; i < 16; i++)\n      num[i] = 0;\n    cin >> num[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21269", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], value;\n  while (cin >> value && value != -1) {\n    a[0] = value;\n    int i = 0, count = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (int j = 0; j < i; j++) {\n\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          count = count + 1;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n\n  while (value == -1) {\n    break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21270", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, k, l;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    l = 0;\n    if (a[0] != 0) {\n      for (i = 1; a[i - 1] != 0; i++) {\n        cin >> a[i];\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k < j; k++)\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            l++;\n      printf(\"%d\\n\", l);\n    } else\n      printf(\"%d\\n\", l);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21271", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[18], m, n, i, j, r = 0, b[100];\n  int t;\n  cin >> t;\n  while (t != -1) {\n    m = 1;\n    r++;\n    n = 0;\n    a[0] = t;\n    for (i = 1; i < 18; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        m = m + 1;\n      else\n        break;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = m - 1; j > i; j--)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          n++;\n    }\n    b[r] = n;\n    scanf(\"%d\", &t);\n  }\n  for (i = 1; i < r + 1; i++)\n    printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "12", "index": "21272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[20], i = 1, j, k, d = 0;\n  char c;\n  do {\n    while (scanf(\"%d\", &s[i])) {\n      c = getchar();\n      if (c == '\\n')\n        break;\n      i++;\n    }\n    for (k = 1; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if ((s[k] == 2 * s[j]) || (2 * s[k] == s[j]))\n          d++;\n      }\n    }\n    if (s[i] > -1)\n      printf(\"%d\\n\", d);\n    i = 1;\n    d = 0;\n  } while (s[i] > -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int num = 0;\n  int s;\n  int i, j;\n  scanf(\"%d \", &a[num]);\n  while (a[num] != -1) {\n    while (a[num] != 0) {\n      num++;\n      cin >> a[num];\n    }\n    num--;\n    s = 0;\n    for (i = 0; i <= num; i++)\n      for (j = 0; j <= num; j++)\n        if (a[i] == a[j] * 2)\n          s++;\n    printf(\"%d\\n\", s);\n    num = 0;\n    cin >> a[num];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, b[16] = {0}, c[100] = {0}, i, n, j, k, l, num;\n  l = 0;\n  for (j = 0; j < 100; j++) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        break;\n      }\n      if (a[i] == 0) {\n        break;\n      }\n      n++;\n    }\n    num = 0;\n    for (i = 0; i < n; i++) {\n      b[i] = a[i];\n      for (k = 0; k < n; k++) {\n        if (b[i] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    c[j] = num;\n    l++;\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  for (j = 0; j < l - 1; j++) {\n    printf(\"%d\\n\", c[j]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int e = 0, i, j, k = -1;\n  int a[10000];\n  int ans;\n  while (1) {\n    i = 1;\n    scanf(\"%d \", &a[0]);\n    while (a[i - 1] != 0) {\n      cin >> a[i];\n      i++;\n    }\n    e = i - 1;\n    if (a[0] == -1)\n      return 0;\n    ans = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < e; j++) {\n        if (i != j)\n          if ((a[i] % a[j] == 0) && (a[i] / a[j] == 2))\n            ans++;\n      }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21276", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, s, n;\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21277", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[15], t, i, j, k, m, n; \n  for (i = 1;; i++)            \n  {\n    for (j = 0; j <= 14; j++) \n      a[j] = 0;\n    for (j = 0;; j++) {\n      cin >> t;   \n      if (t == 0) \n        break;    \n      else        \n      {\n        a[j] = t; \n      }\n    }\n    m = 1;          \n    if (a[0] != -1) \n      m = 0;        \n    for (j = 1; j < 15; j++) {\n      if (a[j] != 0) \n        m = 0;       \n    }\n    if (m == 1) \n    {\n      cout << \"0\" << endl; \n      break;               \n    }\n    n = 0;                          \n    for (j = 0; j <= 14; j++)       \n      for (k = j + 1; k <= 14; k++) \n      {\n        if (a[j] != 0 && a[k] != 0 &&\n            (a[j] == 2 * a[k] || a[k] == 2 * a[j])) \n          n = n + 1;                                \n      }\n    cout << n << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21278", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, t = 0, m, n;\n  double a[1000][100];\n  scanf(\"%lf \", &a[i][j]);\n  while (a[i][j] != -1) {\n    while (a[i][j] != 0) {\n      cin >> a[i][j + 1];\n      j++;\n    }\n    j++;\n    for (m = 0; m < j - 1; m++) {\n      for (n = m + 1; n < j - 1; n++) {\n        if (a[i][m] / a[i][n] == 2.0 || a[i][m] / a[i][n] == 0.5)\n          t++;\n      }\n    }\n    i++;\n    j = 0;\n    cin >> a[i][j];\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], i = 1, j, k, *p, count = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    p = a;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (p[j] == p[k] * 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21280", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[101], ori[15];\n  int n, i, count, tot;\n\n  scanf(\"%d\", &n);\n  while (n != -1) {\n\n    for (i = 0; i < 101; i++)\n      num[i] = 0;\n    count = 0;\n    while (n != 0) {\n\n      ori[count] = n;\n      count++;\n      num[n] = 1;\n      scanf(\"%d\", &n);\n    }\n    tot = 0;\n    for (i = 0; i < count; i++) {\n      if (ori[i] <= 50 && num[ori[i] * 2])\n        tot++;\n    }\n    printf(\"%d\\n\", tot);\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[300], i, n, k, j;\n  for (i = 0; i <= 300; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1)\n      break;\n  }\n  for (k = 0; k <= 300; k++) {\n    if (a[k] == -1)\n      break;\n    if (a[k - 1] == 0 || k == 0) {\n      n = 0;\n      for (i = k; a[i] != 0; i++) {\n\n        for (j = i; a[j] != 0; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            n = n + 1;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "21282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, m, n, count;\n  for (i = 0;; i++) {\n    cin >> m;\n    if (m == -1) {\n      break;\n    } else {\n      count = 0;\n      a[0] = m;\n      for (j = 1; j < 16; j++) {\n        cin >> a[j];\n        if (a[j] == 0)\n\n        {\n          break;\n        }\n      }\n\n      n = j;\n      for (j = 0; j < n; j++) {\n        for (k = j + 1; k < n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n            count++;\n          }\n        }\n      }\n\n      printf(\"%d\\n\", count);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, m, n, k;\n  for (;;) {\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (m = 0; m < i; m++)\n      for (n = 0; n < i; n++)\n        if (a[m] == 2 * a[n]) {\n          k++;\n        }\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21284", "code": "#include <bits/stdc++.h>\nusing namespace std;\n/\nint main() {\n  int a[16];\n  int i, j, k;\n  int count;\n\nend3:;\n  for (i = 0;; i++) \n  {\n    count = 0;\n    cin >> a[i];\n    if (a[i] == -1) \n    {\n      goto end1;\n    }\n    if (a[i] == 0) \n    {\n      for (j = 0; j < i; j++) \n      {\n        for (k = 0; k < i; k++) {\n          if (a[j] == 2 * a[k]) \n          {\n            count = count + 1;\n            break;\n          }\n        }\n      }\n      cout << count << endl;\n      goto end3; \n    }\n  }\nend1:;\n\n  return 0;\n}\n"}
{"label": "12", "index": "21285", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 0, j = 0, n = 0, num, k = 0, m;\n  do {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n\n    n = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    printf(\"%d\\n\", n);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, j;\n  int count = 0;\n  int sz[16] = {0};\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == 0) {\n      for (k = 0; k < i - 1; k++) {\n        for (j = k + 1; j < i; j++) {\n          if (sz[k] == 2 * sz[j] || sz[k] * 2 == sz[j]) {\n            count++;\n          }\n        }\n      }\n      cout << count << \"\\n\";\n      count = 0;\n      i = -1;\n    }\n\n    if (sz[i] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int data[16];\n  int i, j;\n  int len;\n  int count;\n\n  while (1) {\n    count = 0;\n    scanf(\"%d\", &data[0]);\n    if (data[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> data[i];\n      if (data[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n\n    for (i = 0; i <= len - 1; i++)\n      for (j = 0; j <= len - 1; j++) {\n        count = count + (data[i] == 2 * data[j]);\n      }\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[16], i, j, count, a, n;\n  while (1) {\n    count = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if (num[i] == -1)\n        break;\n      if (num[i] == 0)\n        break;\n      n += 1;\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < n; i++) {\n        a = num[i];\n        for (j = 0; j < n; j++)\n          if (num[j] == 2 * a)\n            count += 1;\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21289", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, i = 0, j = 0, sum = 0;\n  while (1) {\n    scanf(\"%d \", &num[0]);\n    if (num[0] == -1)\n      break;\n    for (i = 1; num[i - 1] != 0; i++) {\n      cin >> num[i];\n    }\n    for (i = 0; num[i] != 0; i++) {\n      for (j = 0; num[j] != 0; j++) {\n        if ((num[i] == 2 * num[j]) && (num[i] != 0) && (num[j] != 0))\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, x, y, s, num = 0;\n  for (;;) {\n    num = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n\n    if (a[0] == 0) {\n      printf(\"%d\", num);\n    }\n    for (x = 0; x < i; x++) {\n      for (y = 0; y < i; y++) {\n        s = a[x] - a[y] - a[y];\n        if (s == 0) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, a[16] = {0}, b[16];\n  do {\n    i = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      do {\n        i++;\n        scanf(\"%d\", &a[i]);\n        b[i] = 2 * a[i];\n      } while (a[i] != 0);\n    }\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (a[i] == b[j]) {\n          k++;\n        }\n      }\n    }\n    printf(\"%d \", k);\n  } while (1);\n}\n"}
{"label": "12", "index": "21292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int i = 0, j, k = 0;\n  int line, column[100] = {0};\n  int tmp, count;\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &num[i][j]);\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      i++;\n      j = -1;\n    } else\n      column[i]++;\n  }\n  line = i - 1;\n  for (i = 0; i <= line; i++) {\n    tmp = num[i][k];\n    count = 0;\n    for (j = k + 1; j < column[i]; j++) {\n      if ((tmp * 2 == num[i][j]) || (num[i][j] * 2 == tmp)) {\n        count++;\n      }\n      if (j == column[i] - 1 && k < column[i] - 2) {\n        k++;\n        tmp = num[i][k];\n        j = k;\n      }\n    }\n    k = 0;\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a[20];\n  do {\n    int i = 1;\n    do {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else\n        i++;\n    } while (i <= 19);\n    int j, k;\n    float t;\n    for (j = 1; j <= i - 2; j++)\n      for (k = 1; k <= i - 1 - j; k++)\n        if (a[k] > a[k + 1]) {\n          t = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = t;\n        }\n    int s = 0, l, m;\n    for (l = 1; l <= i - 2; l++)\n      for (m = 1; m <= i - 1; m++)\n        if (a[m] / a[l] == 2)\n          s = s + 1;\n    if (a[1] > 0)\n      cout << s << \"\\n\";\n  } while (a[1] > 0);\n  return 0;\n}\n"}
{"label": "12", "index": "21294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = 0;\n    j = 0;\n    k = 0;\n    a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &x[i]);\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    if (x[0] == 4)\n      a = 2;\n    if (x[0] == 3)\n      a = 2;\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, m = 0, j, k = 0;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          k++;\n        else\n          continue;\n      }\n    printf(\"%d\\n\", k);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (int i = 0;; i++) {\n    int a[16];\n    int temp;\n    scanf(\"%d \", &temp);\n    if (temp == -1)\n      break;\n    else\n      a[0] = temp;\n    int n = 1;\n    for (int j = 1;; j++) {\n      int temp1;\n      scanf(\"%d \", &temp1);\n      if (temp1 == 0)\n        break;\n      else {\n        a[j] = temp1;\n        n++;\n      }\n    }\n    int m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n\n        if ((a[i] == (2 * a[j])))\n          m++;\n      }\n    }\n    cout << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, n, t = 0;\n  int a[16];\n  while (scanf(\"%d \", &n)) {\n    if (n != 0) {\n      a[i] = n;\n      i++;\n    } else {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k <= i - 1; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n            t++;\n          }\n        }\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21298", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int x, j;\n  int a[16];\n  cin >> x;\n  int i = 1;\n  int k = 0;\n  while (x != -1) {\n    a[i] = x;\n    i++;\n    if (x != 0) {\n      k = i;\n    } else {\n      int sum = 0;\n      for (i = 1; i <= k; i++) {\n        for (j = 1; j <= k; j++) {\n          if (a[i] == 2 * a[j]) {\n            sum++;\n          }\n        }\n      }\n      cout << (sum - 1) << endl;\n      i = 1;\n    }\n    cin >> x;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  float p[100][999];\n  int i, m;\n  for (m = 0;; m++) {\n    for (i = 0;; i++) {\n      scanf(\"%f \", &p[m][i]);\n      if (p[m][i] == 0)\n        break;\n    }\n    if (p[m][0] == -1)\n      break;\n    else {\n      int a = 0;\n      for (int j = 0; j < i; j++) {\n        for (int k = 0; k < i; k++) {\n          if (p[m][j] / p[m][k] == 2)\n            a++;\n          else\n            a = a;\n        }\n      }\n      cout << a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, end, k;\n  float a[1000];\n  int n[100];\n  int num[100];\n  for (i = 0; i < 100; i++) {\n    num[i] = -1;\n  }\n  i = 0;\n  j = 1;\n  n[0] = -1;\n  for (i = 1; i < 100; i++)\n    n[i] = 0;\n\n  end = 0;\n  for (i = 0; i < 1000; i++) {\n    cin >> a[i];\n    if (a[i] == -1) {\n      end = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < end; i++) {\n    if (a[i] == 0) {\n      n[j] = i;\n      j++;\n    }\n  }\n\n  k = 1;\n  while (n[k] != 0) {\n    num[k] = 0;\n    for (i = n[k - 1] + 1; i < n[k]; i++) {\n      for (j = n[k - 1] + 1; j < n[k]; j++) {\n        if (a[i] / a[j] == 2) {\n          num[k]++;\n        }\n      }\n    }\n    k++;\n  }\n\n  k = 1;\n  while (num[k] != -1) {\n\n    printf(\"%d\\n\", num[k]);\n    k++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21301", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num[16], f;\n  scanf(\"%d\", &num[1]);\n  do {\n    k = 1;\n    f = 0;\n    do {\n      k++;\n      cin >> num[k];\n    } while (num[k] != 0);\n    for (i = 1; i <= k - 1; i++)\n      for (j = 1; j <= k - 1; j++)\n        if (num[i] == num[j] * 2)\n          f++;\n    printf(\"%d\\n\", f);\n    cin >> num[1];\n  } while (num[1] != -1);\n}\n"}
{"label": "12", "index": "21302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20] = {0};\n  int i, j, k;\n  while (1) {\n    int num = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 1; j < i; j++) {\n      for (k = j; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num, count = 0, array[15];\n  while (cin >> n && n != -1) {\n    memset(array, 0, sizeof(array));\n    array[0] = n;\n    i = 1;\n    num = 1;\n    while (cin >> n && n != 0) {\n      array[i++] = n;\n      num++;\n    }\n    sort(array, array + num);\n    for (i = num - 1; i > 0; i--)\n      for (j = i - 1; j >= 0; j--) {\n        if (array[i] == 2 * array[j])\n          count++;\n      }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21304", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a = 1, i = 0, j, k, n = 0, zs = 0;\n  int num[15];\n  while (a != -1) {\n\n    scanf(\"%d\", &a);\n    if (a != 0) {\n      num[i] = a;\n      n++;\n      i++;\n    } else {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (num[j] == 2 * num[k]) {\n            zs++;\n          }\n        }\n      }\n      printf(\"%d\\n\", zs);\n      i = 0;\n      n = 0;\n      zs = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21305", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[17], i, j, k, n;\n  cin >> a[1];\n  while (a[1] != -1) {\n    n = 0;\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[j] == a[k] * 2) {\n          n++;\n        }\n      }\n    }\n    n = n - 1;\n    cout << n << endl;\n    cin >> a[1];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21306", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, h, g, n, sign;\n  for (i = 1;; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    if (a[j] == 0) {\n      for (k = j - 1; k >= 1; k--) {\n        if (a[k] == 0) {\n          break;\n        }\n      }\n      sign = 0;\n      for (h = k + 1; h < j; h++) {\n        for (g = k + 1; g < j; g++) {\n          if (a[h] == 2 * a[g])\n            sign++;\n        }\n      }\n      printf(\"%d\\n\", sign);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, a[100] = {0}, p;\n  scanf(\"%d\", &p);\n  while (p > 0) {\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    for (; p > 0;) {\n      a[p] = 1;\n      scanf(\"%d\", &p);\n    }\n    n = 0;\n    for (i = 1; i < 50; i = i + 1)\n      if (a[i] && a[2 * i])\n        n = n + 1;\n    printf(\"%d\\n\", n);\n    scanf(\"%d\", &p);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21308", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, b = 0, s[100][16], t[100], k;\n  for (i = 0;; i++) {\n\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0 || s[i][j] == -1)\n        break;\n      t[i]++;\n    }\n    if (s[i][j] == 0)\n      b++;\n    if (s[i][j] == -1)\n      break;\n  }\n  for (i = 0; i < b; i++) {\n    int sum = 0;\n    for (j = 0; j < t[i]; j++) {\n      for (k = 0; k < t[i]; k++) {\n        if (s[i][j] == s[i][k] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int a[1000];\n\n  int i, t, j, k, tr, sum[20], l = 0;\n\n  while (scanf(\"%d\", &t), t != -1) {\n    sum[l] = 0;\n    i = 0;\n    a[0] = t;\n    while (i++, scanf(\"%d\", &a[i]), a[i])\n      ;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - j - 1; k++) {\n        if (a[k] > a[k + 1]) {\n          tr = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = tr;\n        }\n      }\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i; k++) {\n        if ((2 * a[j]) == a[k])\n          sum[l]++;\n      }\n    }\n    l++;\n  }\n  for (i = 0; i < l; i++)\n    cout << sum[i] << \" \";\n  return 0;\n}\n"}
{"label": "12", "index": "21310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, num[15], out;\n  while (1) {\n    n = -1;\n    out = 0;\n    scanf(\"%d\", &i);\n    if (i == -1)\n      break;\n    num[++n] = i;\n    while (1) {\n      scanf(\"%d\", &i);\n      if (i == 0)\n        break;\n      num[++n] = i;\n    }\n    for (i = 0; i <= n - 1; i++)\n      for (j = i + 1; j <= n; j++) {\n        if (num[j] == 2 * num[i] || num[i] == 2 * num[j])\n          out++;\n      }\n    cout << out << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21311", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  while (1) {\n    m = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          break;\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if ((a[k] == 2 * a[j]) && (a[k]))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "12", "index": "21312", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int num[100];\n  int test, count = 0;\n\n  cin >> n;\n  while (n != -1) {\n    num[0] = n;\n    for (int i = 1; n != 0; i++) {\n      cin >> n;\n      num[i] = n;\n    }\n    for (int j = 0; num[j] != 0; j++) {\n      test = num[j];\n      for (int k = 0; num[k] != 0; k++) {\n        if (num[k] == 2 * test) {\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n    count = 0;\n    cin >> n;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[15];\nint main() {\n  int num, doub;\n  char b;\n  int comp_with_zero;\n  for (; 1;) {\n    num = 0;\n    doub = 0;\n    comp_with_zero = 1;\n    b = 'a';\n    for (int ai = 0; ai < 15; ai++) {\n      a[ai] = 0;\n    }\n    for (; 1;) {\n      b = cin.get();\n      if ((b == '0') && (a[num] == 0)) {\n        break;\n      }\n      if ((b - '0' < 10) && (b - '0' >= 0)) {\n        a[num] *= 10;\n        a[num] += (b - '0');\n      } else {\n        if (b == ' ') {\n          a[num] *= comp_with_zero;\n          num += 1;\n          comp_with_zero = 1;\n        }\n        if (b == '-') {\n          comp_with_zero = -1;\n        }\n      }\n    }\n    for (int i = 0; i <= num; i++) {\n      for (int ii = i; ii <= num; ii++) {\n        if (a[i] == 0)\n          break;\n        if ((a[i] % 2 == 0) && (a[i] / 2 == a[ii])) {\n          doub += 1;\n        }\n        if ((a[ii] % 2 == 0) && (a[ii] / 2 == a[i])) {\n          doub += 1;\n        }\n      }\n    }\n    cout << doub << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30], i, j, count1, count2;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    count2 = 0;\n    i = 0;\n    while (a[i])\n      scanf(\"%d\", &a[++i]);\n\n    count1 = i - 1;\n    for (i = 0; i <= count1; i++) {\n      for (j = i + 1; j <= count1; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count2++;\n    }\n    cout << count2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[30];\n  int i, m, j, temp, n;\n  int k = 0;\n  for (i = 0; i < 300; i++) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 1; j < 30; j++) {\n        scanf(\"%d\", &a[j]);\n        if (a[j] == 0) {\n          break;\n        }\n      }\n      for (m = 0; m < j; m++) {\n        for (n = 0; n < j - 1; n++) {\n          if (a[n] == 2 * a[n + 1]) {\n            k++;\n          }\n          temp = a[n];\n          a[n] = a[n + 1];\n          a[n + 1] = temp;\n        }\n      }\n      cout << k << \"\\n\";\n      k = 0;\n      j = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int num[100];\n  int test, count = 0;\n\n  cin >> n;\n  while (n != -1) {\n    num[0] = n;\n    for (int i = 1; n != 0; i++) {\n      cin >> n;\n      num[i] = n;\n    }\n    for (int j = 0; num[j] != 0; j++) {\n      test = num[j];\n      for (int k = 0; num[k] != 0; k++) {\n        if (num[k] == 2 * test) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n    cin >> n;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21317", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20][16] = {0};\n  int bei[20] = {0}, j, k, chu, last;\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      scanf(\"%d\", &a[j][k]);\n      if (a[j][k] == 0 || a[j][k] == -1)\n        break;\n    }\n    if (a[j][k] < 0) {\n      last = j;\n      break;\n    }\n  }\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      for (chu = 0; chu < 16; chu++) {\n        if ((a[j][chu] == 2 * a[j][k]) && a[j][k] != 0 && a[j][chu] != 0) {\n          bei[j] = bei[j] + 1;\n        }\n      }\n    }\n    if (a[j][0] == -1) {\n      break;\n    }\n  }\n  for (j = 0; j < last; j++)\n    printf(\"%d\\n\", bei[j]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21318", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15] = {0}, i = 0, j = 0, m = 0;\n  cin >> a[0];\n  while (a[i] != 0) {\n    scanf(\"%d\", &a[i + 1]);\n    i = i + 1;\n  }\n  i = 0;\n  while (a[0] != -1) {\n    while (a[i] != 0) {\n      while (a[j] != 0) {\n        if (((float)a[j]) / ((float)a[i]) == 2)\n          m = m + 1;\n        j = j + 1;\n      }\n      j = 0;\n      i = i + 1;\n    }\n    printf(\"%d\\n\", m);\n    i = 0;\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0) {\n      scanf(\"%d\", &a[i + 1]);\n      i = i + 1;\n    }\n    i = 0;\n  }\n}\n"}
{"label": "12", "index": "21319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m, x, l;\n  int a[15];\n  for (m = 1;; m++) {\n    for (x = 1; x <= 16; x++) {\n      cin >> l;\n      if (l != 0)\n        a[x - 1] = l;\n      else {\n        n = x - 1;\n        t = 0;\n        for (i = 0; i <= n - 2; i++) {\n          for (j = i + 1; j <= n - 1; j++) {\n            if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n              t++;\n          }\n        }\n        cout << t << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15] = {0}, n;\n\n  while (1) {\n    n = 0;\n    for (int i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    for (int j = 0; j <= 15; j++) {\n      if (a[j] == 0 || a[j] == -1)\n        break;\n      for (int k = j + 1; k <= 15; k++) {\n        if (a[k] == 0)\n          break;\n        else if (a[k] * 2 == a[j] || a[j] * 2 == a[k])\n          n++;\n      }\n    }\n    if (a[0] != -1) {\n      cout << n << endl;\n      for (int i = 0; i <= 15; i++)\n        a[i] = 0;\n      n = 0;\n    } else {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21321", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k;\n  for (i = 1; i <= 16; i++) {\n    a[i] = 1;\n  }\n  int count = 0;\n  while (scanf(\"%d \", &a[1])) {\n    if (a[1] == -1) {\n      break;\n    } else {\n      for (i = 2; a[i - 1] != 0; i++) {\n        cin >> a[i];\n      }\n    }\n    i = i - 2;\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count++;\n          break;\n        }\n      }\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[20], r, ctr, t, i, j;\n  while (cin.peek() != '-') {\n    r = ctr = 0;\n    while (scanf(\"%d \", &t), t)\n      x[++r] = t;\n    cin.get();\n    for (i = 1; i <= r; i++) {\n      for (j = 1; j <= r; j++) {\n        if (x[i] == (x[j] << 1))\n          ctr++;\n      }\n    }\n    printf(\"%d\\n\", ctr);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int sum = 0;\n\n  do {\n    sum = 0;\n\n    cin >> a[0];\n\n    if (a[0] == -1)\n      break;\n\n    for (int i = 1; i <= 15; ++i) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    for (int m = 0; m <= 13; ++m) {\n      if (a[m + 1] == 0)\n        break;\n      for (int n = m + 1; n <= 14; ++n) {\n        if (a[n] == 0)\n          break;\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          ++sum;\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], b = 0, i, j, l, m = 0, q;\n  for (i = 0; i <= 16; i++)\n    a[i] = 0;\n  for (q = 0;; q++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      b = b + 1;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      goto lab;\n    }\n    for (j = 0; j < b; j++) {\n      for (l = j + 1; l < b; l++) {\n        if (a[j] == 2 * a[l] || a[l] == 2 * a[j]) {\n          m = m + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    b = 0;\n  }\nlab:;\n  return 0;\n}\n"}
{"label": "12", "index": "21325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, k;\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    r = 0;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[k]) {\n          r++;\n        }\n      }\n    }\n    cout << r << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid swap(int *a, int *b) {\n  int temp = *a;\n  *a = *b;\n  *b = temp;\n}\n\nint find(int *s, int x, int l, int r) {\n  if (l > r)\n    return 0;\n  int mid = (l + r) / 2;\n  if (s[mid] == x)\n    return 1;\n  else {\n    if (s[mid] > x)\n      return find(s, x, l, mid - 1);\n    else\n      return find(s, x, mid + 1, r);\n  }\n}\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  int x = 0;\n  int s[1000] = {0};\n  while ((scanf(\"%d\", &x), x) != -1) {\n    if (x != 0) {\n      s[n++] = x;\n      for (i = n - 1; (i > 0) && (s[i] < s[i - 1]); i--)\n        swap(&s[i], &s[i - 1]);\n    } else {\n      int count = 0;\n      for (i = 0; i < n; i++) {\n        if (find(s, 2 * s[i], i + 1, n))\n          count++;\n      }\n      printf(\"%d\\n\", count);\n      for (i = 0; i < n; i++)\n        s[i] = 0;\n      n = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21327", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[16], i, j, n = 0, num = 0, m;\n\n  while (1) {\n    scanf(\"%d \", &m);\n    if (m == -1)\n      break;\n    else {\n      a[1] = m;\n      n = 1;\n    }\n    for (i = 2;; i++) {\n      cin >> x;\n      if (x == 0)\n        break;\n      else {\n        a[i] = x;\n        n = n + 1;\n      }\n    }\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        if (a[i] == (2 * a[j]))\n          num = num + 1;\n      }\n    }\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][20] = {0};\nint i = 1;\nint b[100] = {0};\n\nvoid sort();\nvoid compare();\nint main() {\n  int p = 0;\n  int j = 0;\n\n  do {\n    j = 1;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n\n  sort();\n  compare();\n\n  for (p = 1; p <= i - 2; p++) {\n    printf(\"%d\\n\", b[p]);\n  }\n\n  return 0;\n}\n\nvoid sort() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  int t = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 14; x++)\n      for (y = 1; y <= 15 - x; y++) {\n        if (a[p][y] > a[p][y + 1]) {\n          t = a[p][y];\n          a[p][y] = a[p][y + 1];\n          a[p][y + 1] = t;\n        }\n      }\n}\n\nvoid compare() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 15; x++)\n      for (y = x; y <= 15; y++) {\n        if ((a[p][y] == 2 * a[p][x]) && (a[p][x] != 0))\n          b[p]++;\n      }\n}\n"}
{"label": "12", "index": "21329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int i, j, k, t, s;\n  int b[100] = {0};\n  for (i = 0; i <= 99; i++) {\n\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        break;\n      }\n    }\n    if (a[i][0] == -1) {\n      b[i] = -1;\n      break;\n    }\n  }\n  for (k = 0; k <= 99; k++) {\n    if (a[k][0] == -1) {\n      break;\n    }\n    for (t = 0; t <= 15; t++) {\n      if (a[k][t] == 0 || a[k][t] == -1) {\n        break;\n      }\n      for (s = 0; s <= 15; s++) {\n        if (a[k][s] == 0) {\n          break;\n        }\n        if (a[k][t] * 2 == a[k][s]) {\n          b[k]++;\n        }\n      }\n    }\n  }\n  for (int q = 0; q <= 99; q++) {\n    if (b[q] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; 1; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21331", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, k, i, j; \n  int a[16];\n  while (cin >> a[0] && a[0] != -1) { \n    k = 1;                            \n    n = 0;\n    while (cin >> a[k] && a[k] != 0) \n      k++;                           \n    for (i = 0; i < k - 1; i++)\n      for (j = i + 1; j < k; j++)\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2)) \n          n++;                                        \n    cout << n << endl;                                \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21332", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, h, t = 0, flag = 1;\n  while (flag == 1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < h; i++) {\n        for (j = 0; j < h; j++)\n          if (a[i] == 2 * a[j])\n            t++;\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21333", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int e = 0, i, j, k = -1;\n  int a[10000];\n  int ans;\n  while (1) {\n    i = 1;\n    cin >> a[0];\n    while (a[i - 1] != 0) {\n      cin >> a[i];\n      i++;\n    }\n    e = i - 1;\n    if (a[0] == -1)\n      return 0;\n    ans = 0;\n    for (i = 0; i < e; i++)\n      for (j = 0; j < e; j++) {\n        if (i != j)\n          if ((a[i] % a[j] == 0) && (a[i] / a[j] == 2))\n            ans++;\n      }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20][16] = {0};\n  int bei[20] = {0}, j, k, chu, last;\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      scanf(\"%d\", &a[j][k]);\n      if (a[j][k] == 0 || a[j][k] == -1)\n        break;\n    }\n    if (a[j][k] < 0) {\n      last = j;\n      break;\n    }\n  }\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      for (chu = 0; chu < 16; chu++) {\n        if ((a[j][chu] == 2 * a[j][k]) && a[j][k] != 0 && a[j][chu] != 0) {\n          bei[j] = bei[j] + 1;\n        }\n      }\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (j = 0; j < last; j++) {\n    cout << bei[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21335", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[100], j, k, l, sum = 0;\n  for (;;) {\n    for (j = 0;; j++) {\n      cin >> a[j];\n      if (a[j] == 0 || a[j] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k < j - 1; k++) {\n      for (l = k + 1; l <= j - 1; l++) {\n        if (a[k] == 2 * a[l] || a[l] == 2 * a[k]) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, key, num;\n  key = 0;\n  int count[100];\n  int a[100][156];\n  int result[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> m;\n      if (m == 0) {\n        break;\n      } else if (m == -1) {\n        key = 1;\n        break;\n      } else {\n        a[i][j] = m;\n        count[i] = j;\n      }\n    }\n    if (key == 1) {\n      break;\n    }\n    num = i;\n  }\n  for (i = 0; i <= num; i++)\n    result[i] = 0;\n  for (i = 0; i <= num; i++) {\n    for (j = 0; j <= count[i]; j++) {\n      for (k = 0; k <= count[i]; k++) {\n        if (a[i][j] == a[i][k] * 2)\n          result[i] = result[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    cout << result[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21337", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[100] = {0}, index = 0, sum = 0;\n  char c;\n  for (; num[0] != -1;) {\n    while (true) {\n      scanf(\"%d\", &num[index++]);\n      scanf(\"%c \", &c);\n      if (c == '\\n')\n        break;\n    }\n    for (int i = 0; i < index; i++) {\n      for (int j = 0; j < index; j++) {\n        if (num[i] == (2 * num[j]) || (2 * num[i]) == num[j]) {\n          sum++;\n        }\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    } else\n      printf(\"%d\\n\", (sum - 1) / 2);\n    sum = 0;\n    index = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000];\n  int n, i, j;\n  int k = 0;\n  cin >> shu[0];\n  for (n = 0; shu[n] != 0; n++) {\n    scanf(\"%d\", &shu[n + 1]);\n  }\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j <= n; j++) {\n      if (shu[i] == 2 * shu[j]) {\n        k++;\n      }\n    }\n  }\n  if (k != 0) {\n    k = k - 1;\n    printf(\"%d\", k);\n  } else\n    cout << k;\n  return 0;\n}\n"}
{"label": "12", "index": "21339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], sign = 1, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;;) {\n      cin >> a[i];\n      sign = a[i];\n      if (sign == 0 || sign == -1)\n        break;\n      else\n        i++;\n    }\n    if (sign == -1)\n      break;\n    else {\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            num++;\n        }\n      }\n      cout << num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21340", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0};\n  int i = 0, j = 0, p = 0, k = 0, num = 0;\n  do {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a[p][j]);\n      if (a[p][j] == 0 || a[p][j] == -1)\n        break;\n    }\n    p++;\n  } while (a[p - 1][0] != -1);\n  p--;\n  for (i = 0; i < p; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (2 * a[i][k] == a[i][j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21341", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, num, count = 0, array[15];\n  while (cin >> n && n != -1) {\n    memset(array, 0, sizeof(array));\n    array[0] = n;\n    i = 1;\n    num = 1;\n    while (cin >> n && n != 0) {\n      array[i++] = n;\n      num++;\n    }\n    sort(array, array + num);\n    for (i = num - 1; i > 0; i--)\n      for (j = i - 1; j >= 0; j--) {\n        if (array[i] == 2 * array[j])\n          count++;\n      }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, t, count, ans;\n  int num[17];\n\n  while (1) {\n    i = 1;\n    cin >> num[i];\n    if (num[i] == -1)\n      break;\n    ans = 0;\n    do {\n      i++;\n      scanf(\"%d \", &num[i]);\n    } while (num[i] != 0);\n    count = i - 1;\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = 1; j <= count - i; j++) {\n        if (num[j] > num[j + 1]) {\n          t = num[j];\n          num[j] = num[j + 1];\n          num[j + 1] = t;\n        }\n      }\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = i + 1; j <= count; j++) {\n        if (num[i] * 2 == num[j]) {\n          ans++;\n          break;\n        } else {\n          if (num[i] * 2 < num[j])\n            break;\n        }\n      }\n\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int data;\n  int a[15];\n  int i = 0;\n  int j, k;\n  while (scanf(\"%d\", &data) != EOF) {\n    if (data == -1)\n      break;\n    else {\n      if (data != 0) {\n        a[i] = data;\n        i++;\n      } else {\n        int tmp;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] > a[k]) {\n              tmp = a[k];\n              a[k] = a[j];\n              a[j] = tmp;\n            };\n          }\n        }\n        int cnt = 0;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] * 2 == a[k]) {\n              cnt++;\n              break;\n            }\n            if (a[j] * 2 < a[k]) {\n              break;\n            }\n          }\n        }\n        cout << cnt << \"\\n\";\n        cnt = 0;\n        i = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], m, n, i, j, k, p;\n  i = 0;\n  while (scanf(\"%d\", &m) != EOF) {\n    if (m == -1)\n      break;\n    else if (m == 0) {\n      for (j = 0, n = 0; j <= i - 2; j++)\n        for (p = j; p <= i - 1; p++)\n          if (a[j] == a[p] * 2 || a[p] == a[j] * 2)\n            n++;\n      printf(\"%d\\n\", n);\n      i = 0;\n    } else {\n      a[i] = m;\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21345", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[16]; \n  int i, k, n; \n  while (1)    \n  {\n    memset(num, 0, sizeof(num));\n    i = 0;\n    k = 0;\n    n = 0; \n    for (i = 1;; i++) {\n      cin >> num[i];\n      if (num[i] == 0)\n        break;\n      for (k = 1; k <= i; k++) {\n        if ((num[k] / num[i] == 2 && num[k] % num[i] == 0) ||\n            (num[i] / num[k] == 2 && num[i] % num[k] == 0))\n          n++; \n      }\n    }\n    if (num[1] == -1)\n      break;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], m, n, i, j, k, p;\n  i = 0;\n  while (scanf(\"%d\", &m) != EOF) {\n    if (m == -1)\n      break;\n    else if (m == 0) {\n      for (j = 0, n = 0; j <= i - 2; j++)\n        for (p = j; p <= i - 1; p++)\n          if (a[j] == a[p] * 2 || a[p] == a[j] * 2)\n            n++;\n      printf(\"%d\\n\", n);\n      i = 0;\n    } else {\n      a[i] = m;\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i = 0, n = 0, j, k, m;\n  for (m = 1;; m++) {\n    i = 0;\n    n = 0;\n    while (cin >> a[i]) {\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          n++;\n        }\n      }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][17], i, j, k, s, r;\n  for (j = 0; j < 100; j++) {\n    r = 0;\n    scanf(\"%d\", &a[j][1]);\n    if (a[j][1] == -1)\n      break;\n    else {\n      for (i = 2, s = 1; a[j][i - 1] != 0; i++, s++)\n        scanf(\"%d\", &a[j][i]);\n      for (i = 1; i < s; i++) {\n        for (k = i + 1; k <= s; k++) {\n          if (a[j][k] == 2 * a[j][i] || a[j][i] == 2 * a[j][k])\n            r++;\n        }\n      }\n      printf(\"%d \", r);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21349", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count = 0;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 2; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] / a[j] == 2 && a[k] % a[j] == 0 ||\n            a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21350", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0)\n        flag = 0;\n      else if (a[i - 1] == -1)\n        return 0;\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j]) {\n            t++;\n          }\n        }\n      }\n    }\n    cout << t << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20];\n  int i = 0, n = 0, j;\n  int count = 0;\n  do {\n    n = 0;\n    count = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] != -1) {\n      i = 1;\n      do {\n        scanf(\"%d\", &a[i]);\n        i++;\n        count++;\n      } while (a[i - 1] != 0);\n\n      for (i = 0; i < count; i++) {\n        for (j = i + 1; j < count; j++) {\n          if (a[i] == 2 * a[j] || 2 * a[i] == a[j]) {\n            n++;\n          }\n        }\n      }\n      cout << n << \"\\n\";\n    }\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21352", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[16], b[100], changdu = 0, panduan = 1, geshu = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      changdu = i;\n      if (a[i] == -1) {\n        panduan = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n\n    if (panduan == 0)\n      break;\n\n    geshu = 0;\n\n    for (i = 0; i < changdu; i++) {\n      for (j = 0; j < changdu; j++) {\n        if (a[i] == a[j] * 2) {\n          geshu++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", geshu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int count = 0, num[20][16], i, j, t;\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &num[0][i]);\n    if (num[0][i] == 0)\n      break;\n  }\n  for (i = 1; i < 20; i++) {\n    if (num[i - 1][0] != -1) {\n      for (j = 0; j < 16; j++) {\n        cin >> num[i][j];\n        if (num[i][j] == 0 || num[i][j] == -1)\n          break;\n      }\n    } else\n      break;\n  }\n  for (i = 0; i < 20; i++) {\n    if (num[i][0] == -1)\n      break;\n    else {\n      for (j = 0; j < 16; j++) {\n        if (num[i][j] == 0)\n          break;\n        else {\n          for (t = 0; t < 16; t++) {\n            if (num[i][t] == 0)\n              break;\n            else {\n              if (num[i][t] == 2 * num[i][j])\n                count++;\n            }\n          }\n        }\n      }\n\n      cout << count << \"\\n\";\n      count = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21354", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, e = 0;\n  int a[20];\n  for (;;) {\n\n    sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        i--;\n        break;\n      } else if (a[i] == -1) {\n        e = -1;\n        break;\n      }\n    }\n    if (e == -1)\n      break;\n    for (j = 0; j <= i; j++) {\n      for (k = 0; k <= i; k++) {\n        if (a[k] == a[j] * 2) {\n          sum++;\n          break;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, k;\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n\n    r = 0;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[k])\n          r++;\n      }\n    }\n    printf(\"%d\\n\", r);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21356", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15];\n  int t, s, i, j, n;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    s = 0;\n    n = 0;\n    a[s] = t;\n    scanf(\"%d\", &t);\n    while (t != 0) {\n      s++;\n      a[s] = t;\n      scanf(\"%d\", &t);\n    }\n    i = 0;\n    for (i; i < s; i++) {\n      j = i + 1;\n      for (j; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          n++;\n      }\n    }\n    printf(\"%d\", n);\n    printf(\"\\n\");\n    cin >> t;\n  }\n}\n"}
{"label": "12", "index": "21357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int h) {\n  int a[15], i, j, n, m = 0;\n  a[0] = h;\n  if (a[0] == -1)\n    return -1;\n  else {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          m += 1;\n          break;\n        }\n      }\n    }\n    return (m);\n  }\n}\nint main() {\n  int a[100], h, i = 0;\n  while (1) {\n    scanf(\"%d\", &h);\n    a[i] = f(h);\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != -1; i++)\n    cout << \"\\n\" << a[i];\n}\n"}
{"label": "12", "index": "21358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, counter;\n  for (;;) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      counter = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          break;\n        }\n      }\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n            counter = counter + 1;\n        }\n      }\n      cout << counter << \"\\n\";\n    }\n  }\n}\n"}
{"label": "12", "index": "21359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint find(int *x, int y, int z) {\n  int count = 0;\n  for (int i = 0; i < y; i++) {\n    if (x[i] == z)\n      count++;\n  }\n  return count;\n}\n\nint count(int *x, int y) {\n  int count1 = 0;\n  for (int i = 0; i < y; i++) {\n    count1 += find(x, y, 2 * x[i]);\n  }\n  return count1;\n}\n\nint main() {\n  int temp[16];\n  int len = 0;\n  scanf(\"%d\", &temp[len]);\n  while (temp[len] != -1) {\n    while (temp[len] != 0) {\n      len++;\n      scanf(\"%d\", &temp[len]);\n    }\n    cout << count(temp, len) << \"\\n\";\n    scanf(\"%d\", &temp[0]);\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21360", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (int i = 0;; i++) {\n    int a[16];\n    int temp;\n    cin >> temp;\n    if (temp == -1)\n      break;\n    else\n      a[0] = temp;\n    int n = 1;\n    for (int j = 1;; j++) {\n      int temp1;\n      scanf(\"%d \", &temp1);\n      if (temp1 == 0)\n        break;\n      else {\n        a[j] = temp1;\n        n++;\n      }\n    }\n    int m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n\n        if ((a[i] == (2 * a[j])))\n          m++;\n      }\n    }\n    cout << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[15], m = 0, s, h, t;\n  scanf(\"%d\", &t);\n  while ((t + 1) != 0) {\n    for (n = 0, s = 0; t != 0; n++)\n      a[n] = t, s++, scanf(\"%d \", &t);\n    for (n = 0; n < s; n++) {\n      for (h = 0; h < s; h++) {\n        if (a[n] == 2 * a[h])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    scanf(\"\\n%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = 0; i < pause; i++) {\n        if (A[k] == 2 * A[i])  {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, sz[100], erbei[100], *p1, *p2, sum = 0;\n  p1 = sz;\n  p2 = erbei;\n  for (p1 = sz;; p1++) {\n    scanf(\"%d\", p1);\n    n++;\n    if (*p1 == 0) {\n      for (p1 = sz; p1 < sz + n - 1; p1++) {\n        *p2 = *p1 * 2;\n        p2++;\n      }\n      for (p2 = erbei; p2 < erbei + n - 1; p2++) {\n        for (p1 = sz; p1 < sz + n - 1; p1++) {\n          if (*p2 == *p1) {\n            sum++;\n          }\n        }\n      }\n      printf(\"%d\\n\", sum);\n      p1 = sz - 1;\n      p2 = erbei;\n      sum = 0;\n      n = 0;\n    }\n    if (*p1 == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0};\n  int i = 0, j = 0, p = 0, k = 0, num = 0;\n  do {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[p][j]);\n      if (a[p][j] == 0 || a[p][j] == -1)\n        break;\n    }\n    p++;\n  } while (a[p - 1][0] != -1);\n  p--;\n  for (i = 0; i < p; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (2 * a[i][k] == a[i][j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, a[100][100], s[1000], b[100] = {0}, k = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%d \", &s[i]);\n    if (s[i] == -1)\n      break;\n  }\n  for (i = 0; s[i] != -1; i++) {\n    if (s[i] != 0) {\n      a[k][j] = s[i];\n      j++;\n    } else {\n      a[k][j] = 0;\n      j = 0;\n      k++;\n    }\n  }\n  a[k][0] = -1;\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "12", "index": "21366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char s[100];\n  for (;;) {\n\n    cin >> s;\n    int i, j, k = 0, m = 0, x[15], n = 0;\n    if (s[0] == '-' && s[1] == '1')\n      break;\n    else {\n      for (i = 0;; i++) {\n        if (s[i] == '0')\n          break;\n        else {\n          if ('1' <= s[i] && s[i] <= '9') {\n            j = s[i] - '0';\n            k = k * 10 + j;\n\n          } else {\n            x[m] = k;\n            m++;\n            k = 0;\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++)\n      for (j = i + 1; j < m; j++) {\n        if ((x[i] / x[j] == 2 && x[i] % x[j] == 0) ||\n            (x[j] / x[i] == 2 && x[j] % x[i] == 0)) {\n          n++;\n        }\n      }\n    printf(\"%d \", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17] = {0}, count;\n  int i, j, k, two, num;\n  for (k = 1;; k++) {\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[1] == -1 || a[i] == 0) {\n        num = i;\n        break;\n      }\n    }\n    if (a[1] == -1)\n      break;\n    for (i = 1; i < num; i++) {\n      two = 2 * a[i];\n      for (j = 1; j < num; j++)\n        if (two == a[j]) {\n          count++;\n          break;\n        }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21368", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, NO, tmp, a[101];\n  while (1) {\n    scanf(\"%d\", &tmp);\n    if (tmp == -1)\n      break;\n    NO = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[tmp] = 1;\n    while (scanf(\"%d\", &tmp) == 1 && tmp)\n      a[tmp] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] && a[2 * i])\n        NO++;\n    printf(\"%d\\n\", NO);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21369", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, m, n, k;\n  for (;;) {\n    k = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (m = 0; m < i; m++)\n      for (n = 0; n < i; n++)\n        if (a[m] == 2 * a[n])\n          k++;\n    printf(\"%d\\n\", k);\n  }\n}\n"}
{"label": "12", "index": "21370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i, k, n;\n  while (1) {\n    memset(num, 0, sizeof(num));\n    i = 0;\n    k = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      cin >> num[i];\n      if (num[i] == 0)\n        break;\n      for (k = 1; k <= i; k++) {\n        if ((num[k] / num[i] == 2 && num[k] % num[i] == 0) ||\n            (num[i] / num[k] == 2 && num[i] % num[k] == 0)) {\n          n++;\n        }\n      }\n    }\n    if (num[1] == -1) {\n      break;\n    }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15], value;\n  while (cin >> value && value != -1) {\n    a[0] = value;\n    int i = 0, count = 0;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          count = count + 1;\n      }\n    }\n    cout << count << endl;\n  }\n\n  while (value == -1)\n    break;\n\n  return 0;\n}\n"}
{"label": "12", "index": "21372", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a = 1, i = 0, j, k, n = 0, zs = 0;\n  int num[15];\n  while (a != -1) {\n\n    scanf(\"%d \", &a);\n    if (a != 0) {\n      num[i] = a;\n      n++;\n      i++;\n    } else {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (num[j] == 2 * num[k])\n            zs++;\n        }\n      }\n      printf(\"%d\\n\", zs);\n      i = 0;\n      n = 0;\n      zs = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][17], i, j, k, s, r;\n  for (j = 0; j < 100; j++) {\n    r = 0;\n    cin >> a[j][1];\n    if (a[j][1] == -1)\n      break;\n    else {\n      for (i = 2, s = 1; a[j][i - 1] != 0; i++, s++)\n        scanf(\"%d\", &a[j][i]);\n      for (i = 1; i < s; i++) {\n        for (k = i + 1; k <= s; k++) {\n          if (a[j][k] == 2 * a[j][i] || a[j][i] == 2 * a[j][k])\n            r++;\n        }\n      }\n      printf(\"%d \", r);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[16], m = 0, n = 0, b, c[200], x = 0, y = 0;\n  for (i = 0; i < 200; i++) {\n    scanf(\"%d\", &c[i]);\n    x = x + 1;\n    if (c[i] < 0)\n      i = 300;\n  }\n  for (i = 0; i < 16; i++, y++) {\n    a[i] = c[y];\n\n    if (a[i] > 0) {\n      for (b = 0; b < i; b++) {\n        if (a[i] == 2 * a[b] || a[b] == 2 * a[i])\n          m = m + 1;\n      }\n    }\n\n    else if (a[i] == 0) {\n      i = -1;\n      printf(\"%d\\n\", m);\n      m = 0;\n    }\n\n    else\n      i = 100;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21375", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  while (1) {\n    s = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] == a[k] * 2) {\n          s++;\n          break;\n        }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, j;\n  int a[16];\n  cin >> x;\n  int i = 1;\n  int k = 0;\n  while (x != -1) {\n    a[i] = x;\n    i++;\n    if (x != 0) {\n      k = i;\n    } else {\n      int sum = 0;\n      for (i = 1; i <= k; i++) {\n        for (j = 1; j <= k; j++) {\n          if (a[i] == 2 * a[j]) {\n            sum++;\n          }\n        }\n      }\n      cout << (sum - 1) << \"\\n\";\n      i = 1;\n    }\n    cin >> x;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21377", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, k, m;\n  int a[100];\n\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = n - 1; i > 0; i--) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          k = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = k;\n        }\n      }\n    }\n    m = 0;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i]) {\n          m = m + 1;\n          break;\n        }\n        if (a[j] > 2 * a[i]) {\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21378", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int i = 0, j, k = 0;\n  int line, column[100] = {0};\n  int tmp, count;\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &num[i][j]);\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      i++;\n      j = -1;\n    } else\n      column[i]++;\n  }\n\n  line = i - 1;\n  for (i = 0; i <= line; i++) {\n    tmp = num[i][k];\n    count = 0;\n    for (j = k + 1; j < column[i]; j++) {\n      if ((tmp * 2 == num[i][j]) || (num[i][j] * 2 == tmp)) {\n        count++;\n      }\n      if (j == column[i] - 1 && k < column[i] - 2) {\n        k++;\n        tmp = num[i][k];\n        j = k;\n      }\n    }\n    k = 0;\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[18], m, i = 0, j = 0, k = 0, l = 0, n = 0;\n\n  for (n = 0;; n++) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i - 1;\n          break;\n        }\n      }\n      i = 0;\n\n      for (i = 0; i <= m; i++) {\n        for (j = 0; j <= m; j++) {\n          if (a[j] == (2 * a[i]))\n            k++;\n        }\n        l = l + k;\n        k = 0;\n      }\n\n      cout << l << \"\\n\";\n      l = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21380", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], sum = 0, i, j, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      } else if (a[i] == -1) {\n        break;\n      } else {\n        n++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n    n = 0;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21381", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, j;\n  int a[16];\n  cin >> x;\n  int i = 1;\n  int k = 0;\n  while (x != -1) {\n    a[i] = x;\n    i++;\n    if (x != 0) {\n      k = i;\n    } else {\n      int sum = 0;\n      for (i = 1; i <= k; i++) {\n        for (j = 1; j <= k; j++) {\n          if (a[i] == 2 * a[j]) {\n            sum++;\n          }\n        }\n      }\n      printf(\"%d\\n\", (sum - 1));\n      i = 1;\n    }\n    cin >> x;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t, j, k, s = 0;\n  int a[17];\n  for (scanf(\"%d\", &a[1]); a[1] != -1; scanf(\"%d\", &a[1])) {\n    for (i = 2;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        t = i - 1;\n        break;\n      }\n    }\n    for (j = 1; j <= t; j++) {\n      for (k = 1; k <= t; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[150] = {0}, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    if (a[0] != -1) {\n      printf(\"%d\\n\", num);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, k, l;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    l = 0;\n    if (a[0] != 0) {\n      for (i = 1; a[i - 1] != 0; i++)\n        scanf(\"%d\", &a[i]);\n\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k < j; k++)\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            l++;\n      cout << l << \"\\n\";\n    } else\n      cout << l << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[15][15] = {0}, doub[15] = {0}, i, j, k, w[15] = {0}, row;\n  for (i = 0; i < 15; i++) {\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &num[i][j]);\n      if (num[i][j] == -1)\n        break;\n      if (num[i][j] == 0) {\n        w[i] = j;\n        break;\n      }\n    }\n    if (num[i][0] == -1) {\n      row = i;\n      break;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < w[i]; j++) {\n      for (k = 0; k < w[i]; k++) {\n        if (num[i][k] == 2 * num[i][j]) {\n          doub[i]++;\n        }\n      }\n    }\n    printf(\"%d\\n\", doub[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21386", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[16];\n  int i, j, k, num;\n  for (; c[0] != (-1);) {\n    num = 0;\n    scanf(\"%d\", &c[0]);\n    if (c[0] == (-1))\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> c[i];\n      if (c[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (2 * c[k] == c[j]) {\n          num += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "21387", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a, b;\n  int sz[100][100];\n  int sum[100];\n\n  for (row = 0; row < 100; row++) {\n    sum[row] = 0;\n  }\n\n  for (row = 0; row < 100; row++) {\n    for (col = 0; col < 100; col++) {\n      cin >> sz[row][col];\n      if (sz[row][col] == 0) {\n        break;\n      }\n      if (sz[row][0] == -1) {\n        break;\n      }\n    }\n    if (sz[row][0] == -1) {\n      break;\n    }\n    a = row;\n  }\n\n  for (row = 0; row <= a; row++) {\n    for (b = 0; b < 100; b++) {\n      for (col = 0; col < 100; col++) {\n        if (sz[row][b] == 2 * sz[row][col] && sz[row][b] != 0 &&\n            sz[row][col] != 0) {\n          sum[row]++;\n        }\n      }\n    }\n  }\n\n  for (row = 0; row <= a; row++) {\n    printf(\"%d\\n\", sum[row]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, f = 0;\n  while (f == 0) {\n    int a[16], count = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        cout << count << endl;\n        break;\n      } else if (a[i] == -1) {\n        f = 1;\n        break;\n      } else {\n        for (j = 0; j < i; j++) {\n          if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n            count++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 1;\n  while (k == 1) {\n    int a[16];\n    scanf(\"%d \", &a[0]);\n    int l = 0;\n    if (a[0] == -1)\n      k = 0;\n    else {\n      while (a[l] != 0) {\n        l++;\n        cin >> a[l];\n      }\n      int i, j, num = 0;\n      for (i = 0; i < l - 1; i++)\n        for (j = i + 1; j < l; j++) {\n          if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n            num++;\n        }\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21390", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int flag;\n\n  cin >> flag;\n\n  while (flag != -1) {\n    a[0] = flag;\n    int i = 0;\n    int count = 0;\n\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          count++;\n      }\n    }\n\n    printf(\"%d\\n\", count);\n\n    cin >> flag;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[17], t, sum;\n  do {\n    t = -1;\n    sum = 0;\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      t++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n\n    for (i = 1; i <= t; i++)\n      for (j = 1; j <= t; j++) {\n        if (a[j] == a[i] * 2)\n          sum++;\n      }\n    if (a[1] != -1)\n      cout << sum << endl;\n  } while (a[1] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a, n = 0;\n  int b[16];\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    i = 2;\n    b[1] = a;\n    do {\n      scanf(\"%d\", &a);\n      b[i] = a;\n      i = i + 1;\n    } while (a != 0);\n    for (j = 1; j <= i - 3; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if (b[j] == 2 * b[k] || 2 * b[j] == b[k])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n    scanf(\"%d\", &a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int n, i, j, k;\n  for (k = 1;; k++) {\n    memset(a, 0, sizeof(a));\n    n = 0;\n    i = 1;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != (-1)) {\n      if (a[1] != 0) {\n        for (i = 1;;) {\n          i++;\n          cin >> a[i];\n          if (a[i] != 0) {\n            for (j = 1; j <= (i - 1); j++) {\n              if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n                n = n + 1;\n              }\n            }\n          } else {\n            cout << n << endl;\n            break;\n          }\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21395", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[16], m = 0, n = 0, b, c[200], x = 0, y = 0;\n  for (i = 0; i < 200; i++) {\n    cin >> c[i];\n    x = x + 1;\n    if (c[i] < 0)\n      i = 300;\n  }\n  for (i = 0; i < 16; i++, y++) {\n    a[i] = c[y];\n\n    if (a[i] > 0) {\n      for (b = 0; b < i; b++) {\n        if (a[i] == 2 * a[b] || a[b] == 2 * a[i])\n          m = m + 1;\n      }\n    }\n\n    else if (a[i] == 0) {\n      i = -1;\n      printf(\"%d\\n\", m);\n      m = 0;\n    }\n\n    else\n      i = 100;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21396", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int num[16] = {0};\n    scanf(\"%d \", &num[0]);\n    if (num[0] == -1)\n      break;\n\n    int sum = 1;\n    for (;; sum++) {\n      cin >> num[sum];\n      if (num[sum] == 0) {\n        sum--;\n        break;\n      }\n    }\n    int twice = 0;\n    for (int i = 0; i < sum; i++) {\n      for (int j = i + 1; j <= sum; j++) {\n\n        if ((num[j] == 2 * num[i]) || (num[i] == 2 * num[j]))\n          twice++;\n      }\n    }\n    cout << twice << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "21397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int h) {\n  int a[15], i, j, n, m = 0;\n  a[0] = h;\n  if (a[0] == -1)\n    return -1;\n  else {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          m += 1;\n          break;\n        }\n      }\n    }\n    return (m);\n  }\n}\nint main() {\n  int a[100], h, i = 0;\n  while (1) {\n    scanf(\"%d\", &h);\n    a[i] = f(h);\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != -1; i++) {\n    printf(\"\\n%d\", a[i]);\n  }\n}\n"}
{"label": "12", "index": "21398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[100] = {0}, index = 0, sum = 0;\n  char c;\n  for (; num[0] != -1;) {\n    while (true) {\n      scanf(\"%d\", &num[index++]);\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n    }\n    for (int i = 0; i < index; i++) {\n      for (int j = 0; j < index; j++) {\n        if (num[i] == (2 * num[j]) || (2 * num[i]) == num[j]) {\n          sum++;\n        }\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    } else\n      printf(\"%d\\n\", (sum - 1) / 2);\n    sum = 0;\n    index = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, temp, count;\n  i = 0;\n  while (scanf(\"%d \", &a[0])) {\n    count = 0;\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (cin >> a[i]) {\n      if (a[i] < 1) {\n        temp = i;\n        break;\n      }\n      i++;\n    }\n    for (i = 0; i < temp - 1; i++) {\n      for (j = i + 1; j < temp; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      scanf(\"%d \", &a[i++]);\n      if (a[i - 1] == 0)\n        flag = 0;\n      else if (a[i - 1] == -1) {\n        return 0;\n      }\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j])\n            t++;\n        }\n      }\n    }\n    cout << t << endl;\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i = 0, k, x = 0, j;\n  for (;;) {\n    scanf(\"%d\", &a[i]);\n    i++;\n    if (a[i - 1] == -1)\n      break;\n  }\n  for (k = 0; k < i - 1; k++) {\n    for (j = k + 1; j < i - 1; j++) {\n      if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n        x++;\n      }\n      if (a[j + 1] == 0)\n        break;\n    }\n    if (a[k + 2] == 0 || a[k + 2] == -1) {\n      k = k + 2;\n      printf(\"%d\\n\", x);\n      x = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int key;\n  int number, total;\n  while ((cin >> key) && (key != -1)) {\n    int num[15];\n    num[0] = key;\n    int i = 1;\n    int flag1 = 0, flag2 = 0;\n    total = 0;\n    while ((cin >> number) && (number != 0)) {\n      num[i] = number;\n      i++;\n    }\n    for (int k = 0; k <= i - 2; k++) {\n      for (int r = k + 1; r <= i - 1; r++) {\n        flag1 = (num[r] == 2 * num[k]);\n        flag2 = (num[k] == 2 * num[r]);\n        if ((flag1 == 1) || (flag2 == 1)) {\n          total = total + 1;\n        }\n      }\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21403", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  int k = 0;\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    k = k + 1;\n    i++;\n  }\n  int j;\n  int n = 0;\n  for (i = 0; i <= k - 1; i++) {\n    for (j = 0; j <= k - 1; j++) {\n      if (a[i] == 2 * a[j]) {\n        n = n + 1;\n      }\n    }\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "12", "index": "21404", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int num[100];\n  int test, count = 0;\n\n  cin >> n;\n  while (n != -1) {\n    num[0] = n;\n    for (int i = 1; n != 0; i++) {\n      cin >> n;\n      num[i] = n;\n    }\n    for (int j = 0; num[j] != 0; j++) {\n      test = num[j];\n      for (int k = 0; num[k] != 0; k++) {\n        if (num[k] == 2 * test) {\n          count++;\n        }\n      } \n    }   \n    cout << count << endl;\n    count = 0;\n    cin >> n;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21405", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, t[15] = {0}, k = 0, f, b[16] = {0};\n  for (i = 0; i <= 10; i++) {\n    for (j = 0; j <= 15; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == -1)\n        break;\n      if (a[i][j] == 0)\n        break;\n      t[i] = t[i] + 1;\n    }\n    if (a[i][j] == -1)\n      break;\n    k = k + 1;\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < t[i]; j++) {\n      for (f = j + 1; f <= t[i]; f++) {\n        if ((a[i][j] == 2 * a[i][f]) || (a[i][f] == 2 * a[i][j]))\n          b[i]++;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, t, m, j, k, sum;\n  while (cin >> t) {\n    if (t != -1) {\n      a[1] = t;\n      i = 1;\n      while (cin >> m) {\n        if (m != 0) {\n          i = i + 1;\n          a[i] = m;\n        } else\n          break;\n      }\n      sum = 0;\n      for (j = 1; j <= i; j++)\n        for (k = 1; k <= i; k++) {\n          if (a[k] == 2 * a[j] || a[k] == 0.5 * a[j])\n            sum = sum + 1;\n        }\n      cout << sum / 2 << endl;\n    } else {\n      cout << \"\\n\";\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, j, k, key, num;\n  key = 0;\n  int count[100];\n  int a[100][156];\n  int result[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> m;\n      if (m == 0) {\n        break;\n      } else if (m == -1) {\n        key = 1;\n        break;\n      } else {\n        a[i][j] = m;\n        count[i] = j;\n      }\n    }\n    if (key == 1) {\n      break;\n    }\n    num = i;\n  }\n  for (i = 0; i <= num; i++) {\n    result[i] = 0;\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; j <= count[i]; j++) {\n      for (k = 0; k <= count[i]; k++) {\n        if (a[i][j] == a[i][k] * 2)\n          result[i] = result[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    cout << result[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, x, y, m, n, o, p, q, b, c[100];\n  for (j = 1; j <= 100; j++) {\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if (a[j][i] == 0 || a[j][i] == -1) {\n        c[j] = i - 1;\n        break;\n      }\n    }\n    if (a[j][i] == -1)\n      break;\n  }\n  for (m = 1; m < j; m++) {\n    b = 0;\n    for (p = 1; p <= c[m]; p++) {\n      for (q = p + 1; q <= c[m]; q++) {\n        if (a[m][q] == 2 * a[m][p] || 2 * a[m][q] == a[m][p])\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\n}\n"}
{"label": "12", "index": "21409", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, f = 0;\n  while (f == 0) {\n    int a[16], count = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        printf(\"%d\\n\", count);\n        break;\n      } else {\n        if (a[i] == -1) {\n          f = 1;\n          break;\n        } else {\n          for (j = 0; j < i; j++) {\n            if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n              count++;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], column[100] = {0}, i = 0, l = 0, j, n, m, s = 0;\n  for (l = 0; l <= 15; l++) {\n    scanf(\"%d\", &a[i][l]);\n    if (a[i][l] == -1)\n      break;\n    else if (a[i][l] == 0) {\n      i++;\n      l = -1;\n    } else\n      column[i]++;\n  }\n  i--;\n  for (m = 0; m <= i; m++) {\n    s = 0;\n    for (j = 0; j <= column[m] - 1; j++)\n      for (n = j + 1; n <= column[m]; n++)\n        if (a[m][j] * 2 == a[m][n] || a[m][n] * 2 == a[m][j])\n          s = s + 1;\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i, k, n;\n  while (1) {\n    memset(num, 0, sizeof(num));\n    i = 0;\n    k = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &num[i]);\n      if (num[i] == 0)\n        break;\n      for (k = 1; k <= i; k++) {\n        if ((num[k] / num[i] == 2 && num[k] % num[i] == 0) ||\n            (num[i] / num[k] == 2 && num[i] % num[k] == 0))\n          n++;\n      }\n    }\n    if (num[1] == -1)\n      break;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col;\n  int a, b;\n  int sz[100][100];\n  int sum[100];\n\n  for (row = 0; row < 100; row++) {\n    sum[row] = 0;\n  }\n\n  for (row = 0; row < 100; row++) {\n    for (col = 0; col < 100; col++) {\n      scanf(\"%d\", &sz[row][col]);\n      if (sz[row][col] == 0) {\n        break;\n      }\n      if (sz[row][0] == -1) {\n        break;\n      }\n    }\n    if (sz[row][0] == -1) {\n      break;\n    }\n    a = row;\n  }\n\n  for (row = 0; row <= a; row++) {\n    for (b = 0; b < 100; b++) {\n      for (col = 0; col < 100; col++) {\n        if (sz[row][b] == 2 * sz[row][col] && sz[row][b] != 0 &&\n            sz[row][col] != 0) {\n          sum[row]++;\n        }\n      }\n    }\n  }\n\n  for (row = 0; row <= a; row++) {\n    printf(\"%d\\n\", sum[row]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i = 0, j, count = 0;\n  while (cin >> a[i]) {\n    if (a[i] == 0) {\n      cout << count << \"\\n\";\n      count = 0;\n      i = 0;\n      continue;\n    }\n\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          count++;\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 0, k, m;\n  int a[100][100];\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &a[t][j]);\n    if (a[t][j] == 0) {\n      t = t + 1;\n    }\n    if (a[t][j] == -1)\n      break;\n  }\n  for (k = 0; k < t; k++) {\n    m = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][i] == 2 * a[k][j] && a[k][i] != 0)\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21415", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, m = 0, count = 0;\n  int num[100];\n  for (;;) {\n    m = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if (num[i] == 0 || num[i] == -1) {\n        count = i;\n        break;\n      }\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < count; i++)\n        for (j = i + 1; j < count; j++) {\n          if ((num[i] == 2 * num[j]) || (num[j] == 2 * num[i]))\n            m++;\n        }\n      cout << m << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21416", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16], i = 0, j = 0, n = 0, Two;\n\n  for (i = 0; i < 16; i++) {\n    a[i] = 0;\n  }\n\n  while (1 > 0) {\n\n    n = 0;\n    Two = 0;\n\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[0] == -1))\n        break;\n      else\n        n++;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == (2 * a[j])) || (a[j] == (2 * a[i]))) {\n          Two++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", Two);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long i, j, k, m, a[17][17], b[100], c[100] = {0};\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == -1)\n      break;\n    else {\n      for (j = 2; j <= 100; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n        else\n          b[i] = j;\n      }\n    }\n    for (k = 1; k <= b[i]; k++) {\n      for (m = 1; m <= b[i]; m++) {\n        if (a[i][k] == 2 * a[i][m])\n          c[i]++;\n      }\n    }\n    printf(\"%d\\n\", c[i]);\n  }\n}\n"}
{"label": "12", "index": "21418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; scanf(\"%d\", &x[i]), ~x[i]; i++)\n      if (!x[i])\n        break;\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++)\n        for (k = 0; k < j; k++)\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int str[20], doubl, num = 0, a, b, c;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &str[0]);\n    if (str[0] == -1)\n      break;\n    else\n      for (a = 1; str[a - 1] != 0; a++)\n        scanf(\"%d\", &str[a]);\n\n    for (b = 0; b < a - 1; b++) {\n      doubl = 2 * str[b];\n      for (c = 0; c < a - 1; c++) {\n        if (str[c] == doubl)\n          num++;\n        else\n          num = num;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "21420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20] = {0};\n  int j, k, i = 0, m = 0;\n\n  while ((scanf(\"%d\", &a[i])) && (a[i] >= 0)) {\n\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n            m++;\n          }\n      }\n      cout << m << \"\\n\";\n      m = 0;\n      i = 0;\n      for (j = 0; j < 20; j++)\n        a[j] = 0;\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f() {\n  int a[15], i, m = 0, s = 0, j;\n  scanf(\"%d\", &a[0]);\n  if (a[0] == -1)\n    s = -1;\n  else {\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d\", &a[i]);\n      m = m + 1;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (a[i] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int a[100], i = 0, j;\n  while (1) {\n    a[i] = f();\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d\", a[j]);\n    if (j != i - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21422", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  while (scanf(\"%d \", &m)) {\n    if (m == -1)\n      break;\n    int a[15], i = 0, j, k, count = 0;\n    a[0] = m;\n    while (cin >> m) {\n      if (m == 0)\n        break;\n      i++;\n      a[i] = m;\n    }\n    k = i + 1;\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {{0}}, count = 0, i, j, q, n, b;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &b);\n    if (b != -1) {\n      a[i][1] = b;\n      for (j = 2; j <= 100; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          a[i][j] = 0;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    count = 0;\n    for (j = 1; j <= 100; j++) {\n      if (a[i][j] != 0) {\n        for (q = 1; q <= 100; q++) {\n          if (a[i][j] == 2 * a[i][q])\n            count = count + 1;\n        }\n      } else {\n        break;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[15], sum = 0, n;\n  while (1) {\n    for (n = 0;; n++) {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (x[j] == x[i] * 2)\n          sum = sum + 1;\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint iFind(int *p, int findnum) {\n  int k, sum = 0;\n  for (k = 0; k < 15; k++) {\n    if (*(p + k) == findnum)\n      sum++;\n  }\n  return sum;\n}\n\nint main() {\n  int a[15], temp, i = 0, j, k, *p, sum = 0;\n  p = a;\n  for (j = 0; j < 15; j++)\n    a[j] = -1;\n  while (cin >> temp, temp != -1) {\n    if (temp != 0) {\n      a[i] = temp;\n      i++;\n    } else {\n      for (k = 0; k < 15; k++) {\n        sum += iFind(p, a[k] * 2);\n      }\n      cout << sum << endl;\n      sum = 0;\n      i = 0;\n      for (j = 0; j < 15; j++)\n        a[j] = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21426", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], temp, n = 0, i = 1, j, k;\n  do {\n    do {\n      cin >> temp;\n      a[i] = temp;\n      i++;\n\n    } while (temp != 0 && temp != -1);\n\n    for (j = 1; j < i - 2; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if ((a[j] / a[k] == 2 && a[j] % a[k] == 0) ||\n            (a[k] / a[j] == 2 && a[k] % a[j] == 0)) {\n          n++;\n        }\n      }\n    }\n    if (temp != -1) {\n      printf(\"%d\\n\", n);\n    }\n    i = 1;\n    n = 0;\n  } while (temp != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21427", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int a[16], i, j, k, n = 0;\n  do {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = 0;\n    for (k = 0; k <= i - 1; k++) {\n      for (j = k + 1; j <= i - 1; j++) {\n        if (((a[k] * 2 == a[j]) || (a[k] == (2 * a[j]))) && (a[k] != 0))\n          n++;\n      }\n    }\n    cout << n << endl;\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[101], number, i, j, count = 0;\n  while (1) {\n    cin >> number;\n    if (number == -1)\n      break;\n    for (i = 1;; i++) {\n      num[0] = number;\n      cin >> num[i];\n      for (j = 0; j < i; j++) {\n        if (num[j] > num[i] && num[j] == (num[i] * 2))\n          count++;\n        if (num[i] > num[j] && num[i] == (num[j] * 2)) {\n          count++;\n        }\n      }\n      if (num[i] == 0)\n        break;\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  while (1) {\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if ((a[k] == 2 * a[j]) && (a[k]))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "12", "index": "21430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, s, n;\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c;\n  int num[1000] = {0}, n, m = 0, index = 0, i, j;\n  while (num[0] != -1) {\n    while (true) {\n      scanf(\"%d\", &num[index]);\n      index++;\n      scanf(\"%c\", &c);\n      if (c != ' ')\n        break;\n    }\n    for (i = 0; i < index; i++) {\n      for (j = 0; j < index; j++) {\n        if (num[i] == 2 * num[j] || num[i] * 2 == num[j])\n          m++;\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    }\n    printf(\"%d\\n\", m / 2);\n    m = 0;\n    index = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int number[16];\n  int n;\n  for (;;) {\n    n = 0;\n    cin >> number[0];\n    if (number[0] == -1)\n      break;\n    int i;\n    for (i = 1; i < 16; i++) {\n      cin >> number[i];\n      if (number[i] == 0)\n        break;\n    }\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (number[k] == 2 * number[j]) {\n          n++;\n        }\n      }\n    }\n    cout << n << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21434", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[10000], i, b, j, sum = 0;\n  do {\n    sum = 0;\n    scanf(\"%d\", &b);\n    if (b == -1)\n      break;\n    else\n      a[0] = b;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  } while (b != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[100][16];\n  int sum[100] = {0};\n  float y;\n  int i, j, k;\n  for (j = 0; j < 100; j++) {\n    for (i = 0; i < 16; i++) {\n      cin >> x[j][i];\n      if (x[j][0] == -1)\n        goto loop;\n      if (x[j][i] == 0)\n        break;\n    }\n  }\nloop:\n  for (j = 0; j < 100; j++) {\n    if (x[j][0] != -1) {\n      for (i = 0; i < 16; i++) {\n        if (x[j][i] == 0)\n          break;\n        for (k = 0; k < 16; k++) {\n          if (x[j][k] == 0)\n            break;\n          y = 1.0 * x[j][i] / (1.0 * x[j][k]);\n          if (y == 2)\n            sum[j] = sum[j] + 1;\n        }\n      }\n      printf(\"%d\\n\", sum[j]);\n    }\n    if (x[j][0] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], whether, number = 0, numofpairs = 0;\n\n  do {\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        whether = 0;\n        break;\n      } else if (a[i] == 0) {\n        whether = 1;\n        break;\n      }\n      number++;\n    }\n    if (whether) {\n      for (int j = 0; j < number; j++) {\n        for (int k = 0; k < number; k++) {\n          if (a[k] == 2 * a[j])\n            numofpairs++;\n        }\n      }\n      printf(\"%d\\n\", numofpairs);\n    }\n    numofpairs = 0;\n    number = 0;\n  } while (whether == 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int test[100][17] = {0};\n\n  int i, j, k, num;\n  int turn = 0, nonzero = 0, valid = 0;\n\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        break;\n      }\n      if (num == -1)\n        goto start;\n      test[i][j] = num;\n    }\n    turn += 1;\n  }\nstart:\n  for (i = 0; i < turn; i++) {\n    for (j = 0;; j++) {\n      if (test[i][j] != 0)\n        nonzero += 1;\n      else\n        break;\n    }\n    for (j = 0; j < nonzero; j++) {\n      for (k = 0; k < nonzero; k++) {\n        if ((float)(test[i][j]) / (float)(test[i][k]) == 2)\n          valid += 1;\n      }\n    }\n    printf(\"%d\\n\", valid);\n    valid = 0;\n    nonzero = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21438", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, t, i;\n  while (1) {\n    a = 0;\n    t = 0;\n    cin >> a;\n    if (a == -1) {\n      break;\n    }\n    int num[17] = {0};\n    num[1] = a;\n    for (i = 2; i <= 16; i++) {\n      cin >> num[i];\n      if (num[i] == 0) {\n        break;\n      }\n    }\n    for (int r = 1; r <= (i - 1); r++) {\n      for (int s = 1; s <= (i - 1); s++) {\n        if (num[r] == 2 * num[s]) {\n          t = t + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][16];\n  int i, j, r, p;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1) {\n      break;\n    }\n\n    for (j = 1; n[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n    int t = 0;\n    for (r = 0; r < j - 1; r++) {\n      for (p = r + 1; p < j; p++) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n    for (r = j - 1; r > 0; r--) {\n      for (p = r - 1; p >= 0; p--) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200], k, i, n = 0, j = 0;\n  for (i = 0; i < 200; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] != -1 && a[i] != 0)\n      n = n + 1;\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (k = 0; k < n; k++) {\n        for (i = 0; i < n; i++) {\n          if (a[k] == 2 * a[i])\n            j = j + 1;\n        }\n      }\n      cout << j << \"\\n\";\n      j = 0;\n      i = -1;\n      n = 0;\n    }\n  }\n}\n"}
{"label": "12", "index": "21441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[15];\n  int i, j, temp, min, flag, twice;\n  for (;;) {\n\n    for (i = 0; i < 15; i++)\n      array[i] = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &temp);\n      if (temp == -1)\n        return 0;\n      if (temp == 0)\n        break;\n      array[i] = temp;\n    }\n    \n    for (i = 0; i < 15; i++) {\n      min = array[i];\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] < min) {\n          temp = min;\n          min = array[j];\n          array[j] = temp;\n        }\n      }\n      array[i] = min;\n    }\n    \n    for (flag = 0, i = 0; i < 15; i++) {\n      if (array[i] == 0)\n        continue;\n      twice = array[i] * 2;\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] > twice)\n          break;\n        if (array[j] == twice)\n          flag++;\n      }\n    }\n    printf(\"%d\\n\\n\", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20] = {0};\n  int i, j, k;\n  while (1) {\n    int num = 0;\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 1; j < i; j++) {\n      for (k = j; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21443", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, t, i;\n  while (1) {\n    a = 0;\n    t = 0;\n    cin >> a;\n    if (a == -1) {\n      break;\n    }\n    int num[17] = {0};\n    num[1] = a;\n    for (i = 2; i <= 16; i++) {\n      cin >> num[i];\n      if (num[i] == 0) {\n        break;\n      }\n    }\n    for (int r = 1; r <= (i - 1); r++) {\n      for (int s = 1; s <= (i - 1); s++) {\n        if (num[r] == 2 * num[s]) {\n          t = t + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, a[17];\n  do {\n    i = 0;\n    do {\n      i++;\n      scanf(\"%d \", &a[i]);\n    } while (a[i] > 0);\n    n = i - 1;\n    if (a[n + 1] != -1) {\n      num = 0;\n      for (i = 1; i <= n - 1; i++)\n        for (j = i + 1; j <= n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      cout << num << \" \";\n    }\n  } while (a[n + 1] == 0);\n  return 0;\n}\n"}
{"label": "12", "index": "21445", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\n  int i, j, f = 0; \n  while (f == 0)   \n  {\n    int a[16], count = 0; \n    for (i = 0;; i++) {\n      cin >> a[i];   \n      if (a[i] == 0) \n      {\n        cout << count << endl; \n        break;\n      } else if (a[i] == -1) \n      {\n        f = 1;\n        break;\n      } else \n      {\n        for (j = 0; j < i; j++) {\n          if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2)) \n            count++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, s;\n  for (s = 0, scanf(\"%d \", &a[1]); a[1] != -1; s = 0, scanf(\"%d \", &a[1])) {\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j < i; j++)\n      for (k = 1; k < i; k++)\n        if (a[j] == 2 * a[k]) {\n          s++;\n        }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i, j, n, court;\n  while (1) {\n    for (i = 0; 1; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    n = i;\n    for (i = 0, court = 0; i <= n; i++) {\n      for (j = i; j <= n - 1; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          court++;\n      }\n    }\n    printf(\"%d\\n\", court);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k, sz[17], n = 0;\n  for (i = 0; i < 17; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == -1)\n      break;\n    else {\n      if (i > 0) {\n        if (sz[i] > 0) {\n          for (j = 0; j < i; j++) {\n            if (2 * sz[j] == sz[i] || 2 * sz[i] == sz[j])\n              n++;\n          }\n        } else {\n          printf(\"%d\\n\", n);\n          n = 0;\n          i = 0;\n          j = 0;\n          for (k = 0; k < 16; k++)\n            sz[k] = -2;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int t, s, i, j, n;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    s = 0;\n    n = 0;\n    a[s] = t;\n    scanf(\"%d\", &t);\n    while (t != 0) {\n      s++;\n      a[s] = t;\n      scanf(\"%d\", &t);\n    }\n    i = 0;\n    for (i; i < s; i++) {\n      j = i + 1;\n      for (j; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          n++;\n      }\n    }\n    printf(\"%d\", n);\n    printf(\"\\n\");\n    scanf(\"%d\", &t);\n  }\n}\n"}
{"label": "12", "index": "21450", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, x = 0, y = 1, a = 0;\n  float n[20];\n  do {\n    i = 0;\n    j = 0;\n    k = 0;\n    x = 0;\n    y = 1;\n    do {\n      scanf(\"%d\", &n[j]);\n      if (n[j] == 0 || n[j] == -1)\n        break;\n      j++;\n    } while (j < 20);\n    if (n[j] == -1)\n      return 0;\n    do {\n      do {\n        if (n[x] == n[y] * 2 || n[x] == n[y] / 2)\n          i++;\n        y++;\n      } while (y < j);\n      x++;\n      y = x + 1;\n    } while (x < j);\n    printf(\"%d\\n\", i);\n  } while (a < 1);\n  return 0;\n}\n"}
{"label": "12", "index": "21451", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[101], number, i, j, count = 0;\n  while (1) {\n    cin >> number;\n    if (number == -1)\n      break;\n    for (i = 1;; i++) {\n      num[0] = number;\n      cin >> num[i];\n      for (j = 0; j < i; j++) {\n        if (num[j] > num[i] && num[j] == (num[i] * 2))\n          count++;\n        if (num[i] > num[j] && num[i] == (num[j] * 2))\n          count++;\n      }\n      if (num[i] == 0)\n        break;\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21452", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0) {\n        flag = 0;\n      } else if (a[i - 1] == -1)\n        return 0;\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j])\n            t++;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int i, j, n, t;\n  for (i = 0; i < 100; i++) {\n    n = 0;\n    t = 0;\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = n + 1;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%f\", &a[j]);\n      if (a[j] == 0)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == a[i] * 2 || a[j] == 0.5 * a[i])\n          t++;\n      }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21454", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i, j, count;\n  cin >> a[0];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n    cin >> a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, l, n;\n  k = 0;\n  while (k != -1) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    l = 1;\n    do {\n      i = i + 1;\n      scanf(\"%d \", &a[i]);\n      l = i + 1;\n    } while (a[i] != 0);\n    l = l - 1;\n    n = 0;\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++) {\n        if (a[i] == 2 * a[j])\n          n = n + 1;\n      }\n    cout << n << \"\\n\";\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    cin >> a[0];\n    k = a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, sz[15], i = 0, j, k, result = 0;\n\n  scanf(\"%d \", &t);\n  while (t != -1) {\n    if (t != 0) {\n      sz[i] = t;\n      i++;\n    } else {\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (sz[k] == sz[j] * 2) {\n            result++;\n          }\n        }\n      }\n      cout << result << \"\\n\";\n      i = 0;\n      result = 0;\n    }\n    scanf(\"%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], b, i = 0, k;\n  while (1) {\n    b = 0;\n    int a[16] = {0};\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      for (k = 0; k < i; k++) {\n        if ((a[i] == 2 * a[k]) || (a[i] == 0.5 * a[k]))\n          b++;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21458", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, j, count = 0, a[16];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k <= 15; k++) {\n      for (j = k + 1; j <= 16; j++) {\n        if (a[j] == 0)\n          break;\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, h, n;\n  for (h = 0;; h++) {\n    n = 0;\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if ((a[k] / a[j]) == 2 && (a[k] % a[j]) == 0)\n          n = n + 1;\n        else\n          n = n;\n      }\n    }\n    printf(\"%d\\n\", n);\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], h, i, j, x = 1, s;\n  while (x) {\n    for (i = 1; i < 17; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        goto end;\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n      continue;\n    }\n\n    if (x) {\n      s = 0;\n      for (i = 1; i < h - 1; i++) {\n        for (j = i + 1; j < h; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            s++;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][100], i, k, j, s[100], t, p, m, l[100];\n  double a;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0)\n          break;\n        l[i] = j;\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t <= l[k]; t++) {\n      for (m = t; m <= l[k]; m++) {\n        a = (double)n[k][t] / n[k][m];\n        if (a == 2 || a == 0.5) {\n          s[k] = s[k] + 1;\n        }\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    printf(\"%d\\n\", s[p]);\n  return 0;\n}\n"}
{"label": "12", "index": "21462", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, a, b, k;\n  k = 0;\n  int sz[20], sz2[20], jieguo[1000];\n  while (1) {\n    for (i = 0;; i++) {\n      scanf(\"%d\", &(sz[i]));\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n      sz2[i] = sz[i];\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    n = 0;\n    for (a = 0; a < i; a++) {\n      for (b = 0; b < i; b++) {\n        if (sz2[b] * 2 == sz[a]) {\n          n++;\n        }\n      }\n    }\n    jieguo[k] = n;\n    k++;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", jieguo[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21463", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[16], i, k = 0, j = 0, n = 0;\n  for (i = 0; i < 16; i++)\n    a[i] = -1;\n  scanf(\"%d \", &k);\n  while (k != -1) {\n    a[j] = k;\n    j++;\n    if (k == 0) {\n      for (i = 0; i < 15; i++)\n        for (j = i + 1; j < 15; j++)\n          if ((a[j] - 2 * a[i] == 0) || (a[i] - 2 * a[j] == 0))\n            n++;\n      printf(\"%d\\n\", n);\n      for (i = 0; i < 16; i++)\n        a[i] = -1;\n      j = 0;\n      n = 0;\n    }\n    scanf(\"%d \", &k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, line, n;\n  for (line = 1;; line++) {\n    int a[16] = {0};\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1)\n        goto A;\n      else if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < 16; i++) {\n      for (j = 0; j < 16; j++) {\n        if (a[i] == 2 * a[j] && a[i] != 0) {\n          n++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\nA:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a[16], i, k = 0, j = 0, n = 0;\n  for (i = 0; i < 16; i++)\n    a[i] = -1;\n  scanf(\"%d \", &k);\n  while (k != -1) {\n    a[j] = k;\n    j++;\n    if (k == 0) {\n      for (i = 0; i < 15; i++)\n        for (j = i + 1; j < 15; j++)\n          if ((a[j] - 2 * a[i] == 0) || (a[i] - 2 * a[j] == 0))\n            n++;\n      cout << n << endl;\n      for (i = 0; i < 16; i++)\n        a[i] = -1;\n      j = 0;\n      n = 0;\n    }\n    cin >> k;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float s[16], t[16];\n  int u = 0, g = 0;\n  for (int k = 1; k < 100; k++) {\n    int a = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f\", &s[i]);\n      if (s[0] == -1 || scanf(\"\"))\n        printf(\"\");\n      else {\n        u += 1;\n        if (s[i] == 0)\n          break;\n        else {\n          t[i] = s[i];\n          a++;\n        }\n      }\n    }\n    int b = 0;\n    for (int h = 0; h < a; h++) {\n      for (int k = 0; k < a; k++) {\n        if (t[h] / t[k] == 2)\n          b++;\n      }\n    }\n    printf(\"%d\\n\", b);\n    g++;\n    if (g == u)\n      printf(\"\");\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], column[100] = {0}, i = 0, l = 0, j, n, m, s = 0;\n  for (l = 0; l <= 15; l++) {\n    scanf(\"%d\", &a[i][l]);\n    if (a[i][l] == -1)\n      break;\n    else if (a[i][l] == 0) {\n      i++;\n      l = -1;\n    } else\n      column[i]++;\n  }\n  i--;\n  for (m = 0; m <= i; m++) {\n    s = 0;\n    for (j = 0; j <= column[m] - 1; j++)\n      for (n = j + 1; n <= column[m]; n++)\n        if (a[m][j] * 2 == a[m][n] || a[m][n] * 2 == a[m][j])\n          s = s + 1;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21468", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[20];\n  int n, i, j, k;\n  for (k = 1;; k++) {\n    memset(a, 0, sizeof(a));\n    n = 0;\n    i = 1;\n    cin >> a[1];\n    if (a[1] != (-1)) {\n      if (a[1] != 0) {\n        for (i = 1;;) {\n          i++;\n          cin >> a[i];\n          if (a[i] != 0) {\n            for (j = 1; j <= (i - 1); j++) {\n              if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n                n = n + 1;\n              }\n            }\n          } else {\n            cout << n << endl;\n            break;\n          }\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21469", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[16], result[100];\n  int i, j, k, n = 0, row = 0;\n  while (1) {\n    for (i = 1; i < 16; i++)\n      sz[i] = 0;\n\n    scanf(\"%d\", &sz[0]);\n    if (sz[0] == -1) {\n      break;\n    } else {\n      k = 1;\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d \", &sz[i]);\n        if (sz[i] == 0) {\n          break;\n        } else {\n          k++;\n        }\n      }\n      n = 0;\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < i; j++) {\n          if (sz[i] == sz[j] * 2 || sz[j] == sz[i] * 2) {\n            n++;\n          }\n        }\n      }\n      result[row] = n;\n      row++;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, a[16] = {0}, b[16];\n  do {\n    i = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1)\n      break;\n    else\n      do {\n        i++;\n        scanf(\"%d\", &a[i]);\n        b[i] = 2 * a[i];\n      } while (a[i] != 0);\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (a[i] == b[j])\n          k++;\n      }\n    }\n    cout << k << \" \";\n  } while (1);\n}\n"}
{"label": "12", "index": "21471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a, n = 0;\n  int b[16];\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    i = 2;\n    b[1] = a;\n    do {\n      scanf(\"%d\", &a);\n      b[i] = a;\n      i = i + 1;\n    } while (a != 0);\n    for (j = 1; j <= i - 3; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if (b[j] == 2 * b[k] || 2 * b[j] == b[k])\n          n = n + 1;\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n    scanf(\"%d\", &a);\n  }\n}\n"}
{"label": "12", "index": "21472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[16];\n    int i = 0, n = 0, k;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n      i++;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (k = 0; a[k] != 0; k++) {\n        if (a[k] == 2 * a[i])\n          n++;\n      }\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21473", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], len, count, i, j;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    count = 0;\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < len; j++) {\n        if (j == i)\n          continue;\n        else {\n          if (a[j] == (2 * a[i]))\n            count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[100][100], i = 0, j = 0, m, n, k, s = 0;\n  while (scanf(\"%d\", &c[i][j])) {\n    if (c[i][j] != 0 && c[i][j] != -1)\n      j++;\n    else if (c[i][j] == 0) {\n      i++;\n      j = 0;\n    } else\n      break;\n  }\n  for (m = 0; m <= i - 1; m++) {\n    for (n = 0; c[m][n] != 0; n++) {\n      for (k = 0; c[m][k] != 0; k++) {\n        if (c[m][n] == 2 * c[m][k])\n          s++;\n      }\n    }\n    printf(\"%d \", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, count;\n  float a[20];\n  while (1) {\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = 1;\n    while (1) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    count = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] / a[j] == 2.0) || (a[j] / a[i] == 2.0))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21476", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count;\n  while (1) {\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++)\n        if ((a[k] == 2 * a[j]) || (a[j] == a[k] * 2))\n          count++;\n    printf(\"%d\\n\", count / 2);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[16];\n  int i, j, k, num;\n  for (; c[0] != (-1);) {\n    num = 0;\n    cin >> c[0];\n    if (c[0] == (-1))\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> c[i];\n      if (c[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (2 * c[k] == c[j]) {\n          num += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "21478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  static int a[16], b[16];\n  int n, i, j, s = 0;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      b[i - 1] = 2 * a[i - 1];\n      scanf(\"%d\", &a[i]);\n    }\n    n = i - 2;\n    s = 0;\n    for (i = 0; i <= n; i++)\n      for (j = 0; j <= n; j++)\n        if (a[i] == b[j]) {\n          s++;\n          break;\n        }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16];\n  while ((cin >> a[0]) && a[0] != -1) {\n    int num0 = 1, i, j, k, num = 0;\n    i = 1;\n    while (scanf(\"%d \", &a[i]) && (a[i] != 0)) {\n\n      num0++;\n      i++;\n    }\n    for (j = 0; j < num0 - 1; j++) {\n      for (k = j + 1; k <= (num0 - 1); k++) {\n        if ((a[j] == 2 * a[k]) || (2 * a[j] == a[k]))\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int t, s, i, j, n;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    s = 0;\n    n = 0;\n    a[s] = t;\n    scanf(\"%d\", &t);\n    while (t != 0) {\n      s++;\n      a[s] = t;\n      scanf(\"%d\", &t);\n    }\n    i = 0;\n    for (i; i < s; i++) {\n      j = i + 1;\n      for (j; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          n++;\n      }\n    }\n    printf(\"%d\", n);\n    printf(\"\\n\");\n    scanf(\"%d\", &t);\n  }\n}\n"}
{"label": "12", "index": "21481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], s, i, j, k, flag = 1;\n  while (flag) {\n    s = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      k = i;\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n    if (flag) {\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++) {\n          if (a[i] == 2 * a[j])\n            s++;\n        }\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21482", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, k;\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    r = 0;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[k])\n          r++;\n      }\n    }\n    printf(\"%d\\n\", r);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  while (1) {\n    int a[20] = {0}, sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        k = i;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < k; i++)\n      for (j = i; j < k; j++) {\n        if (a[j] == 2 * a[i] || 2 * a[j] == a[i])\n          sum++;\n      }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][16], m, n;\n  int i, j, k;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> m;\n      if (m != 0)\n        sz[i][j] = m;\n      else {\n        break;\n      }\n    }\n    if (sz[i][0] == -1) {\n      break;\n    }\n  }\n  n = 0;\n  for (i = 0; i < 100; i++) {\n    if (sz[i][0] == -1) {\n      break;\n    }\n    for (j = 0; j < 15; j++) {\n      for (k = 0; k < 15; k++) {\n        if (sz[i][j] != 0 && sz[i][k] != 0) {\n          if (sz[i][j] == 2 * sz[i][k]) {\n            n = n + 1;\n          }\n        }\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21485", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20][16], b[20] = {0}, i = 0, j, k = 0;\n  scanf(\"%d\", &a[0][0]);\n  i++;\n  while (a[k][0] != -1) {\n    do {\n      scanf(\"%d \", &a[k][i]);\n      i++;\n    } while (a[k][i - 1] != 0);\n    k++;\n    scanf(\"%d\", &a[k][0]);\n    i = 1;\n  }\n\n  for (k = 0; a[k][0] != -1; k++) {\n    for (i = 0; a[k][i] != 0; i++) {\n      for (j = i + 1; a[k][j] != 0; j++) {\n        if ((a[k][j] / a[k][i] == 2 && a[k][j] % a[k][i] == 0) ||\n            (a[k][i] / a[k][j] == 2 && a[k][i] % a[k][j] == 0)) {\n          b[k]++;\n        }\n      }\n    }\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21486", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[100][100], i, k, j, s[100], t, p, m, l[100];\n  double a;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d \", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0)\n          break;\n        l[i] = j;\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t <= l[k]; t++) {\n      for (m = t; m <= l[k]; m++) {\n        a = (double)n[k][t] / n[k][m];\n        if (a == 2 || a == 0.5)\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++) {\n    printf(\"%d\\n\", s[p]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, a[16] = {0}, sum = 0, k = 0;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] != 0)\n        sum++;\n      else\n        break;\n    }\n    for (i = 0; i <= sum; i++) {\n      for (j = i + 1; j <= sum; j++) {\n        if (a[i] == 2 * a[j] || a[j] == a[i] * 2)\n          k++;\n      }\n    }\n    cout << k << \"\\n\";\n    sum = 0;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], n, j, k, p, m;\n  do {\n    a[0] = -1;\n    for (j = 0, n = 0;; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1)\n        break;\n\n      if (a[j] == 0)\n        break;\n      n++;\n    }\n    m = 0;\n    for (k = 0; k <= n - 1; k++) {\n      for (p = k + 1; p <= n; p++) {\n        if (a[p] == (a[k] * 2) || a[k] == (a[p] * 2)) {\n          m++;\n        }\n      }\n    }\n    if (a[0] == -1)\n      break;\n    cout << m << \" \";\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[20], r, ctr, t, i, j;\n  while (cin.peek() != '-') {\n    r = ctr = 0;\n    while (scanf(\"%d \", &t), t)\n      x[++r] = t;\n    cin.get();\n    for (i = 1; i <= r; i++) {\n      for (j = 1; j <= r; j++) {\n        if (x[i] == (x[j] << 1)) {\n          ctr++;\n        }\n      }\n    }\n    printf(\"%d\\n\", ctr);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21490", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[16] = {0}, n = 0, sum = 0;\nint main() {\n  int i, j;\n  while (1) {\n    n = 0;\n    sum = 0;\n    while (1) {\n      cin >> array_1[n];\n      if (array_1[n] == 0 || array_1[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array_1[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array_1[i] == array_1[j] * 2) || (array_1[j] == array_1[i] * 2)) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int in;\n  scanf(\"%d \", &in);\n  while (in != -1) {\n    int a[15];\n    int i = 0, num, count = 0;\n    while (in != 0) {\n      a[i] = in;\n      i++;\n      cin >> in;\n    }\n    num = i;\n    for (int p = 0; p < num; p++) {\n      if (a[p] % 2 == 1)\n        continue;\n      for (int q = 0; q < num; q++) {\n        if (a[p] == a[q] * 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    cin >> in;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int num[16] = {0};\n    cin >> num[0];\n    if (num[0] == -1)\n      break;\n\n    int sum = 1;\n    for (;; sum++) {\n      cin >> num[sum];\n      if (num[sum] == 0) {\n        sum--;\n        break;\n      }\n    }\n    int twice = 0;\n    for (int i = 0; i < sum; i++) {\n      for (int j = i + 1; j <= sum; j++) {\n\n        if ((num[j] == 2 * num[i]) || (num[i] == 2 * num[j]))\n          twice++;\n      }\n    }\n    printf(\"%d\\n\", twice);\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "21493", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][16], i, j, k, t;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    for (j = 1; a[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < i; j++) {\n    int n = 0;\n    for (k = 0; a[j][k + 1] != 0; k++) {\n      for (t = k + 1; a[j][t] != 0; t++) {\n        if (a[j][k] == 2 * a[j][t] || a[j][t] == 2 * a[j][k])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  int k = 0;\n  while (a[i - 1] != 0) {\n    cin >> a[i];\n    k = k + 1;\n    i++;\n  }\n  int j;\n  int n = 0;\n  for (i = 0; i <= k - 1; i++) {\n    for (j = 0; j <= k - 1; j++) {\n      if (a[i] == 2 * a[j]) {\n        n = n + 1;\n      }\n    }\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "12", "index": "21495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, s; \n  for (s = 0, cin >> a[1]; a[1] != -1; s = 0, cin >> a[1]) { \n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j < i; j++)\n      for (k = 1; k < i; k++)\n        if (a[j] == 2 * a[k])\n          s++;\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, m;\n  for (;;) {\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (k = 0; k < i; k++) {\n          if ((a[j] / 2) == a[k])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], a, i, x, k, t;\n  scanf(\"%d \", &a);\n  while (a != -1) {\n    i = 0;\n    x = 0;\n    while (a != 0) {\n      num[i] = a;\n      i = i + 1;\n      scanf(\"%d \", &a);\n    }\n    for (k = 0; k <= i - 1; k++) {\n      for (t = 0; t <= i - 1; t++) {\n        if (num[k] == num[t] * 2)\n          x = x + 1;\n      }\n    }\n    printf(\"%d\\n\", x);\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21498", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count;\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++)\n        if ((a[k] == 2 * a[j]) || (a[j] == a[k] * 2))\n          count++;\n    printf(\"%d\\n\", count / 2);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() \n{\n  int a[17][1000], i, j, k, s[1000] = {0}; \n  int sum[1000] = {0}, g = 0, n;           \n  for (i = 0, k = 0; i <= 1000; i++, k++)  \n  {\n    for (j = 0; j <= 16; j++, s[i]++) {\n      cin >> a[j][i];\n      if (a[j][i] == 0) \n        break;\n      else if (a[j][i] == -1) \n      {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  for (i = 0; i <= k - 1; i++) \n  {\n    for (j = s[i]; j >= 0; j--) {\n      for (n = 0; n < j; n++) {\n        if (a[n][i] < a[j][i]) {\n          if (a[j][i] == 2 * a[n][i])\n            sum[i]++;\n        } else {\n          if (a[n][i] == 2 * a[j][i])\n            sum[i]++;\n        }\n      }\n    }\n    cout << sum[i] << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21500", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int data[16];\n  int i, j;\n  int len;\n  int count;\n\n  while (1) {\n    count = 0;\n    scanf(\"%d\", &data[0]);\n    if (data[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &data[i]);\n      if (data[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n\n    for (i = 0; i <= len - 1; i++)\n      for (j = 0; j <= len - 1; j++)\n        count = count + (data[i] == 2 * data[j]);\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, p = 0, a[10000][16];\n  for (j = 0; j < 10000; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if ((a[j][i] == 0) || (a[j][i] == -1))\n        break;\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (m = 0; m < j; m++) {\n    i = 0;\n    while (a[m][i] != 0) {\n      n = 0;\n      while (a[m][n] != 0) {\n        if (a[m][i] == 2 * a[m][n]) {\n          p++;\n        }\n        n++;\n      }\n      i++;\n    }\n    cout << p << \"\\n\";\n    p = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21502", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16];\n  int i = 1, a, j, b;\n\nloop:;\n  scanf(\"%d\", &s[i]);\n  if (s[i] != 0) {\n    i++;\n    goto loop;\n  }\n  a = i;\n  b = 0;\n  for (i = a; i >= 1; i--) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == 2 * s[j] || s[j] == 2 * s[i])\n        b++;\n    }\n  }\n\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21503", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[17];          \n  int i, j, n, count; \n  while (cin >> a[1] && a[1] != -1) \n  {\n    count = 0;                \n    for (n = 2; n <= 16; n++) \n    {\n      cin >> a[n];\n      if (a[n] == 0) \n        break;       \n    }\n    for (i = 1; i <= n - 1; i++) \n    {\n      if (a[i] % 2 == 0) \n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i]) \n            count++;            \n    }\n    cout << count << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i = 0, n = 0, j, k, m;\n  for (m = 1;; m++) {\n    i = 0;\n    n = 0;\n    while (scanf(\"%d \", &a[i])) {\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          n++;\n        }\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21505", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ds, s;\n  int a[16];\n  while (cin) {\n    ds = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      return 0;\n    s = 1;\n    while (cin) {\n      cin >> a[s];\n      if (a[s] == 0) {\n        break;\n      } else\n        s = s + 1;\n    }\n    for (i = 0; i <= s; i++) {\n      for (j = i + 1; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          ds = ds + 1;\n      }\n    }\n    printf(\"%d\\n\", ds);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21506", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[16], i, j, count, a, n;\n  while (1) {\n    count = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if (num[i] == -1)\n        break;\n      if (num[i] == 0)\n        break;\n      n += 1;\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < n; i++) {\n        a = num[i];\n        for (j = 0; j < n; j++)\n          if (num[j] == 2 * a)\n            count += 1;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, m = 16, i = 1, j, k, t = 0;\n  int a[16];\n  while (n > 0) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == (-1))\n      break;\n    else {\n      while (m > 0) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        m--;\n        i++;\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k <= i - 1; k++) {\n          if (a[j] == 2 * a[k])\n            t++;\n        }\n    }\n    cout << t << \"\\n\";\n    t = 0;\n    m = 16;\n    i = 1;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[100] = {-2}, i, j, count = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[0] == -1 || a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; a[i + 1] != 0; i++)\n      for (j = i + 1; a[j] != 0; j++)\n        if (a[i] == 2 * a[j] || a[i] * 2 == a[j])\n          count++;\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, n, t;\n  while (a[0] != -1) {\n    t = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] <= 0) {\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 0; j < t; j++) {\n        for (m = 0; m < t; m++) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int i = 0;\n    int a[20] = {0};\n    int sum = 0;\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[i - 1] == -1)\n      break;\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = 0; k < i - 1; k++)\n        if (a[j] * 2 == a[k]) {\n          sum++;\n        }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "12", "index": "21511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, sum = 0;\n  int a[20][20], b[20];\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == -1) {\n        m = i;\n        break;\n      }\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n    if (a[i][j] == -1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k <= j; k++) {\n        if (a[i][j] % a[i][k] == 0 && a[i][j] / a[i][k] == 2)\n          sum++;\n        else if (a[i][k] % a[i][j] == 0 && a[i][k] / a[i][j] == 2)\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30];\n  int i, m, j, temp, n;\n  int k = 0;\n  for (i = 0; i < 300; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 1; j < 30; j++) {\n        scanf(\"%d\", &a[j]);\n        if (a[j] == 0) {\n          break;\n        }\n      }\n      for (m = 0; m < j; m++) {\n        for (n = 0; n < j - 1; n++) {\n          if (a[n] == 2 * a[n + 1]) {\n            k++;\n          }\n          temp = a[n];\n          a[n] = a[n + 1];\n          a[n + 1] = temp;\n        }\n      }\n      cout << k << \"\\n\";\n      k = 0;\n      j = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, h, k, m;\n  int a[20];\n  for (k = 0;; k++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1) {\n        break;\n      }\n      m = 0;\n      if (a[i] == 0) {\n        for (j = 0; j < i - 1; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[k] == a[j] * 2 || a[j] == a[k] * 2) {\n              m++;\n            }\n          }\n        }\n        printf(\"%d\\n\", m);\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, sz[100], erbei[100], *p1, *p2, sum = 0;\n  p1 = sz;\n  p2 = erbei;\n  for (p1 = sz;; p1++) {\n    scanf(\"%d\", p1);\n    n++;\n    if (*p1 == 0) {\n      for (p1 = sz; p1 < sz + n - 1; p1++) {\n        *p2 = *p1 * 2;\n        p2++;\n      }\n      for (p2 = erbei; p2 < erbei + n - 1; p2++) {\n        for (p1 = sz; p1 < sz + n - 1; p1++) {\n          if (*p2 == *p1) {\n            sum++;\n          }\n        }\n      }\n      printf(\"%d\\n\", sum);\n      p1 = sz - 1;\n      p2 = erbei;\n      sum = 0;\n      n = 0;\n    }\n    if (*p1 == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, x, y, s, num = 0;\n  for (;;) {\n    num = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n\n    if (a[0] == 0) {\n      cout << num;\n    }\n    for (x = 0; x < i; x++) {\n      for (y = 0; y < i; y++) {\n        s = a[x] - a[y] - a[y];\n        if (s == 0)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  while (a != -1) {\n    int s[15] = {0};\n    int l = 1, m = 0;\n    s[0] = a;\n    do {\n      cin >> a;\n      s[l] = a;\n      l++;\n    } while (a != 0);\n    for (int i = 0; i < 15; i++)\n      for (int j = 0; j < 15; j++)\n        if (s[j] == 2 * s[i] && s[i] != 0)\n          m++;\n    cout << m << endl;\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, cnt;\n  i = 0;\n  cnt = 0;\n  cin >> a[i];\n\n  while (a[i] != -1) {\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (int j = 0; j <= i; j++) {\n      for (int k = 0; k <= i; k++) {\n        if (a[k] == 2 * a[j])\n          cnt++;\n      }\n    }\n    cout << cnt - 1 << \"\\n\";\n    i = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200], i, s = 0, cnt = 0, q, j;\n  while (1) {\n    s = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] == -1)\n      break;\n    for (i = 2; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      cnt++;\n    }\n    for (i = 1; i <= cnt - 1; i++) {\n      for (j = i + 1; j <= cnt; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          s++;\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "12", "index": "21519", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  \n  int a[16];\n  while ((cin >> a[0]) && a[0] != -1) \n  {\n    int num0 = 1, i, j, k, num = 0;\n    i = 1;\n    while (cin >> a[i] && (a[i] != 0)) \n    {\n      \n      num0++;\n      i++;\n    }\n    for (j = 0; j < num0 - 1; j++) \n    {\n      for (k = j + 1; k <= (num0 - 1); k++) \n      {\n        if ((a[j] == 2 * a[k]) || (2 * a[j] == a[k]))\n          num++; \n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[100][15], i = 0, j, k, count, t;\n  for (i = 0;; i++) {\n    count = 0;\n    j = 0;\n    do {\n      scanf(\"%d \", &n[i][j]);\n      if (n[i][j] == -1)\n        goto loop;\n      j++;\n    } while (n[i][j - 1] != 0);\n    for (k = 0; k < j; k++) {\n      for (t = j - 1; t > k; t--) {\n        if (n[i][t] == 2 * n[i][k] || 2 * n[i][t] == n[i][k])\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\nloop:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21521", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &s[i]);\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = 0; j < count; j++) {\n        if (s[i] == s[j] * 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21522", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int i;\n  int n = 0;\n  int num = 0;\n  int j;\n  while (1) {\n    n = 0;\n    num = 0;\n    for (i = 0; i < 20; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          num++;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21523", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[15], i, j, s, t, answer;\n  while (scanf(\"%d \", &num[0])) {\n    if (num[0] == -1)\n      break;\n    j = 0;\n    answer = 0;\n    do {\n      j++;\n      cin >> num[j];\n    } while (num[j] != 0);\n    for (s = 0; s < j; s++) {\n      for (t = 0; t < j; t++) {\n        if (num[t] == 2 * num[s])\n          answer++;\n      }\n    }\n    printf(\"%d\\n\", answer);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, geshu, get, n = 0;\n  int shuzu[15];\n  for (j = 0;; j++) {\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &get);\n      if (get == -1) {\n        goto end;\n      }\n      shuzu[i] = get;\n      if (get == 0) {\n        geshu = i;\n        break;\n      }\n    }\n    for (k = 0; k < geshu; k++) {\n      for (l = 0; l < geshu; l++) {\n        if (shuzu[k] == 2 * shuzu[l]) {\n          n = n + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21525", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int output = 0, i, j, length;\n  float data[16];\n\n  data[0] = -2;\n\n  while (data[0] != -1) {\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%f\", &data[i]);\n      if (data[i] == 0) {\n        length = i;\n        break;\n      }\n      if (data[i] == -1)\n        break;\n    }\n\n    if (data[i] == -1)\n      break;\n\n    for (i = 0; i <= length - 1; i++)\n      for (j = 0; j <= length - 1; j++) {\n        if ((data[j] / data[i]) == 2)\n          output = output + 1;\n      }\n\n    printf(\"%d\\n\", output);\n    output = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21526", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[100][15], t[15];\n  int sum[100];\n  int i, j, n, m, k;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        t[i] = j;\n        break;\n      } else if (s[i][0] == -1)\n        break;\n    }\n    if (s[i][0] == -1)\n      break;\n  }\n  for (n = 0; n < i; n++) {\n    sum[n] = 0;\n    for (m = 0; m < t[n] - 1; m++) {\n      for (k = m + 1; k < t[n]; k++) {\n        if (s[n][m] == 2 * s[n][k] || s[n][k] == 2 * s[n][m]) {\n          sum[n]++;\n        }\n      }\n    }\n  }\n  for (n = 0; n < i; n++) {\n    printf(\"%d\\n\", sum[n]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[15];\n  cin >> p[0];\n  int i;\n  int l = 0;\n  for (i = 1; i < 15; i++) {\n    int a;\n    cin >> a;\n    if (a == 0)\n      break;\n    else {\n      p[i] = a;\n      l++;\n    }\n  };\n  int j, m, max;\n  for (j = 0; j < l - 1; j++) {\n    for (m = j + 1; m < l; m++)\n      if (p[j] > p[m]) {\n        max = p[j];\n        p[j] = p[m];\n        p[m] = max;\n      }\n  }\n  int num = 0;\n  int k, n;\n  for (k = 0; k < l - 1; k++) {\n    for (n = k + 1; n < l; n++) {\n      if ((p[n] / p[k]) == 2 && p[n] % p[k] == 0)\n        num++;\n      if (p[n] / p[k] > 2)\n        break;\n    }\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "12", "index": "21528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, p = 0, a[10000][16];\n  for (j = 0; j < 10000; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if ((a[j][i] == 0) || (a[j][i] == -1))\n        break;\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (m = 0; m < j; m++) {\n    i = 0;\n    while (a[m][i] != 0) {\n      n = 0;\n      while (a[m][n] != 0) {\n        if (a[m][i] == 2 * a[m][n]) {\n          p++;\n        }\n        n++;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", p);\n    p = 0;\n  }\n}\n"}
{"label": "12", "index": "21529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], len, count; \n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1) \n    {\n      break;\n    }\n    count = 0;\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    for (int i = 0; i < len; i++) \n      for (int j = 0; j < len; j++) {\n        if (j == i)\n          continue; \n        else {\n          if (a[j] == (2 * a[i])) {\n            count++; \n            break;   \n          }\n        }\n      }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100];\n  int d, i, t, p = 0;\n  while (true) {\n    t = 0;\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    while (true) {\n      scanf(\"%d\", &d);\n      if ((d == 0) || (d == -1))\n        break;\n      a[d] = 1;\n    }\n    if (d == -1)\n      break;\n    else {\n      if (p)\n        printf(\"\\n\");\n      p = p + 1;\n      for (i = 1; i < 50; i = i + 1) {\n        if ((a[i]) && (a[2 * i]))\n          t++;\n      }\n      printf(\"%d\", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21531", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = j = k = a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; cin >> x[i]; i++) {\n\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[15], m, n;\n  int i, j, k, h;\n  for (i = 0;; i++) {\n    n = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m == -1)\n        return 0;\n      p[j] = m;\n    }\n    for (k = 0; k < j; k++) {\n      for (h = 0; h < j; h++) {\n        if (p[k] == 2 * p[h])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, s = 0;\n  int lena, x, y;\n  int a[16] = {0};\n  int b[20] = {0};\n\n  while (1) {\n    while (scanf(\"%d\", &a[i])) {\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      else {\n        i++;\n        continue;\n      }\n    }\n\n    if (a[0] == -1)\n      break;\n    else {\n      lena = i;\n\n      for (x = 0; x < lena; x++) {\n        for (y = x + 1; y <= lena; y++) {\n          if ((a[x] == 2 * a[y]) || (a[y] == 2 * a[x]))\n            s++;\n        }\n      }\n\n      b[j] = s;\n      s = 0;\n    }\n    j++;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    i = 0;\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0;\n  int a[16];\n  for (;; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == 0) {\n      cout << k << \"\\n\";\n      i = -1;\n      k = 0;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n        k++;\n  }\n}\n"}
{"label": "12", "index": "21535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i = 0, m = 0, k = 0, j = 0;\n  do {\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0 && a[0] != -1) {\n      i = i + 1;\n      scanf(\"%d\", &a[i]);\n    }\n    if (a[0] != -1) {\n      for (j = 0; j < i; j++) {\n        for (k = i - 1; k > j; k--) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            m = m + 1;\n        }\n      }\n      cout << m << \"\\n\";\n    }\n    for (j = 0; j < i; j++)\n      a[j] = 0;\n    m = 0;\n    i = 0;\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "21536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int z[15], r[100];\n  int i, j, l;\n  int sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &z[i]);\n    if (z[i] == 0) {\n      r[sum] = 0;\n      for (j = 0; j < i - 1; j++) {\n        for (l = j + 1; l < i; l++) {\n          if (z[j] == 2 * z[l] || z[j] == 0.5 * z[l]) {\n            r[sum]++;\n          }\n        }\n      }\n      sum++;\n      i = -1;\n    } else if (z[i] == -1) {\n      break;\n    }\n  }\n  for (i = 0; i < sum; i++) {\n    printf(\"%d\\n\", r[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  double a[15], num, cnt;\n  int i;\n  for (int n = 0; n <= 99999; n++) {\n    cnt = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> num;\n      if (num == 0)\n        break;\n      else\n        a[i] = num;\n    }\n    if (a[0] == -1)\n      break;\n    else {\n      for (int j = 0; j <= i - 1; j++)\n        for (int k = 0; k <= i - 1; k++)\n          if (a[j] == 2 * a[k])\n            cnt++;\n    }\n    cout << cnt << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, a[16];\n\n  while (1) {\n    int count = 0;           \n    for (i = 0; i < 16; i++) \n    {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[i] == -1)\n      break;                \n    for (j = 0; j < i; j++) \n      for (m = j + 1; m < i; m++)\n        if (a[j] == 2 * a[m])\n          count++;\n    for (j = 0; j < i; j++) \n      for (m = j + 1; m < i; m++)\n        if (2 * a[j] == a[m])\n          count++;\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "21539", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, sum = 0;\n  int a[20][20], b[20];\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == -1) {\n        m = i;\n        break;\n      }\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n    if (a[i][j] == -1) {\n      break;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k <= j; k++) {\n        if (a[i][j] % a[i][k] == 0 && a[i][j] / a[i][k] == 2)\n          sum++;\n        else if (a[i][k] % a[i][j] == 0 && a[i][k] / a[i][j] == 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = j + 1; a[i][s] != 0; s++) {\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n        if (a[i][j] * 2 == a[i][s])\n          z[i]++;\n      }\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "21541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, g, n, m;\n  for (j = 0;; j++) {\n    for (i = 0, n = 0; i < 16; i++) {\n      scanf(\"%d\", &x[i]);\n      if (x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    g = i;\n    for (i = 0; i < g; i++) {\n      for (m = 0; m < g; m++) {\n        if ((float)x[i] == x[m] * 2)\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "12", "index": "21542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][16], b[1000] = {0, 0};\n  int i, j, k, h, m;\n  int count1, count2;\n  count2 = -1;\n  for (i = 0; i < 1000; i++) {\n    count1 = -1;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) || (a[i][j] == -1))\n        break;\n      count1++;\n    }\n    if (a[i][j] == -1)\n      break;\n    for (k = 0; k <= count1; k++) {\n      for (h = 0; h <= count1; h++) {\n        if (a[i][k] == 2 * a[i][h])\n          b[i]++;\n        else\n          continue;\n      }\n    }\n    count2++;\n  }\n  for (m = 0; m <= count2; m++)\n    printf(\"%d \", b[m]);\n}\n"}
{"label": "12", "index": "21543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[15], count;\n  while (1) {\n    count = 0;\n    for (n = 0;; n++) {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (j == i)\n          continue;\n        if (x[j] == 2 * x[i])\n          count++;\n      };\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 1, num[16] = {0}, s, k = 0;\n  while (cin >> s) {\n    a[i] = s;\n    if (a[i] == 0) {\n      i = 0;\n      k++;\n      continue;\n    }\n    if (a[i] == -1)\n      break;\n    for (int j = 0; j <= i; j++) {\n      if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n        num[k]++;\n    }\n    i++;\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", num[i]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int a[1000];\n\n  int i, t, j, k, tr, sum[20], l = 0;\n\n  while (scanf(\"%d\", &t), t != -1) {\n    sum[l] = 0;\n    i = 0;\n    a[0] = t;\n    while (i++, scanf(\"%d\", &a[i]), a[i])\n      ;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - j - 1; k++) {\n        if (a[k] > a[k + 1]) {\n          tr = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = tr;\n        }\n      }\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i; k++) {\n        if ((2 * a[j]) == a[k]) {\n          sum[l]++;\n        }\n      }\n    }\n    l++;\n  }\n  for (i = 0; i < l; i++)\n    cout << sum[i] << \" \";\n  return 0;\n}\n"}
{"label": "12", "index": "21546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, count = 0, row, arr[100][100], n[100], b[100];\n  for (i = 0; i < 100; i++) {\n    count = 0;\n    for (j = 0; j < 100; j++) {\n      cin >> arr[i][j];\n      if (arr[i][j] == 0 || arr[i][j] == -1) {\n        n[i] = count;\n        break;\n      }\n      count++;\n    }\n    if (arr[i][j] == -1) {\n      row = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    count = 0;\n    for (j = 0; j < n[i]; j++) {\n      for (k = j + 1; k < n[i]; k++) {\n        if (arr[i][j] == (arr[i][k] * 2) || (arr[i][j] * 2) == arr[i][k]) {\n          count++;\n        }\n      }\n    }\n    b[i] = count;\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"\\n%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int a[16] = {0}, i, j, p, k, l, num = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    while (a[0] != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          p = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = p;\n        }\n      }\n    }\n    for (k = 1; k <= i - 1; k++) {\n      for (l = k; l <= i; l++) {\n        if (2 * a[k] == a[l])\n          num++;\n        if (2 * a[k] < a[l])\n          break;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, j, i, a[16], m = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n      if (a[i] == (-1))\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = j + 1; k < n; k++) {\n        if (a[j] == a[k] * 2 || a[k] == a[j] * 2)\n          m++;\n      }\n    }\n    cout << m << endl;\n    m = 0;\n    n = 0;\n  } while (a[0] != (-1));\n  return 0;\n}\n"}
{"label": "12", "index": "21549", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][15], i, j, k, l;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      int n = 0;\n      for (j = 1;; j++) {\n        scanf(\"%d \", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n      }\n      for (k = 0; k <= j - 1; k++)\n        for (l = 0; l <= j - 1; l++)\n          if (a[i][k] == 2 * a[i][l])\n            n = n + 1;\n\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, m = 16, i = 1, j, k, t = 0;\n  int a[16];\n  while (n > 0) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == (-1))\n      break;\n    else {\n      while (m > 0) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        m--;\n        i++;\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k <= i - 1; k++) {\n          if (a[j] == 2 * a[k])\n            t++;\n        }\n    }\n    printf(\"%d\\n\", t);\n    t = 0;\n    m = 16;\n    i = 1;\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l, k, s, t;\n  int a[100000] = {0}, b[100000];\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  s = 0;\n  for (i = 0; i < 100000; i++) {\n    t = 0;\n    for (j = 0; j < 10000; j++) {\n      b[j] = a[s];\n      s++;\n      if (b[j] == 0) {\n        for (k = 0; k <= j; k++)\n          for (l = k + 1; l <= j; l++)\n            if ((b[k] == 2 * b[l]) || (b[l] == 2 * b[k]))\n              t++;\n        printf(\"%d\\n\", t);\n        break;\n      }\n    }\n    if (a[s] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, sum = 0; \n  int i = 0;                  \n\n  while (1) {\n    i = 0; \n    sum = 0;\n\n    while (1) {\n      cin >> num[i]; \n\n      if (num[i] == -1) \n        return 0;\n      if (num[i] == 0) \n        break;\n      i++; \n    }\n\n    for (int j = 0; j < i - 1; j++) \n    {\n      for (int k = j + 1; k < i; k++) \n      {\n        if (num[j] == 2 * num[k] || num[k] == 2 * num[j])\n          sum++; \n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], sum = 0, j, i, k, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      n = n + 1;\n      if (a[i] == 0) {\n        n = n - 1;\n        for (k = 0; k < (n - 1); k++) {\n          for (j = k + 1; j < n; j++) {\n            if ((a[j] == a[k] * 2) || (a[k] == a[j] * 2)) {\n              sum = sum + 1;\n            }\n          }\n        }\n        cout << sum << \"\\n\";\n        i = 0;\n        sum = 0;\n        n = 0;\n        break;\n      } else {\n        if (a[i] == -1) {\n          return 0;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200], k, i, n = 0, j = 0;\n  for (i = 0; i < 200; i++) {\n    cin >> a[i];\n    if (a[i] != -1 && a[i] != 0)\n      n = n + 1;\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (k = 0; k < n; k++) {\n        for (i = 0; i < n; i++) {\n          if (a[k] == 2 * a[i])\n            j = j + 1;\n        }\n      }\n      printf(\"%d\\n\", j);\n      j = 0;\n      i = -1;\n      n = 0;\n    }\n  }\n}\n"}
{"label": "12", "index": "21555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int i = 0, a[16];\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1) {\n      break;\n    }\n\n    int b[105] = {0};\n    b[a[i]] = 1;\n\n    while (1) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n      b[a[i]] = 1;\n    }\n\n    int j;\n    int total = 0;\n    for (j = 1; j < 50; j++) {\n      if (b[j] == 1 && b[j * 2] == 1)\n        total++;\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[15], i, m = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &c[i]);\n    if (c[i] == 0)\n      break;\n  }\n\n  int k, j, n = 0;\n  for (k = 0; c[k] != 0; k++) {\n    for (j = 0; c[j] != 0; j++) {\n\n      if (c[k] == 2 * c[j]) {\n        n++;\n      }\n    }\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "12", "index": "21557", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  while (1) {\n    n = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != -1) {\n      for (i = 2; a[i - 1] != 0; i++)\n        scanf(\"%d \", &a[i]);\n      for (j = 1; j < i - 1; j++)\n        for (k = 1; k < i - 1; k++)\n          if (a[k] == 2 * a[j])\n            n = n + 1;\n      printf(\"%d\\n\", n);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int num = 0;\n  int s;\n  int i, j;\n  cin >> a[num];\n  while (a[num] != -1) {\n    while (a[num] != 0) {\n      num++;\n      scanf(\"%d \", &a[num]);\n    }\n    num--;\n    s = 0;\n    for (i = 0; i <= num; i++)\n      for (j = 0; j <= num; j++)\n        if (a[i] == a[j] * 2) {\n          s++;\n        }\n    cout << s << endl;\n    num = 0;\n    cin >> a[num];\n  }\n}\n"}
{"label": "12", "index": "21559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, m = 0, c[100][100], f[100] = {0};\n  for (j = 1;; j++) {\n    scanf(\"%d\", &c[j][1]);\n    if (c[j][1] == -1)\n      break;\n    for (i = 2;; i++) {\n      scanf(\"%d\", &c[j][i]);\n      if (c[j][i] == 0) {\n        break;\n      }\n      for (l = i; l >= 1; l--)\n        if (c[j][l] == 2 * c[j][i] || c[j][i] == 2 * c[j][l])\n          f[j]++;\n    }\n    m++;\n  }\n  for (j = 1; j <= m; j++)\n    printf(\"%d\\n\", f[j]);\n  return 0;\n}\n"}
{"label": "12", "index": "21560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 0, n = 0, j, flag = 1;\n  while (flag) {\n    while (1) {\n      cin >> a[i];\n      if (a[i] == (-1)) {\n        flag = 0;\n        break;\n      } else if (a[i] == 0) {\n        for (j = 0; j <= i; j++)\n          a[j] = 0;\n        cout << n << \"\\n\";\n        n = 0;\n        i = 0;\n        break;\n      } else {\n        for (j = 0; j < i; j++) {\n          if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n            n++;\n        }\n      }\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[100] = {-2}, i, j, count = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1 || a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; a[i + 1] != 0; i++)\n      for (j = i + 1; a[j] != 0; j++)\n        if (a[i] == 2 * a[j] || a[i] * 2 == a[j])\n          count++;\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21562", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k[16], a, p, b, c, q;\n  for (i = 1; i < 1000; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a);\n      if (a == -1)\n        break;\n      else if (a != -1) {\n        if (a == 0)\n          break;\n        else {\n          k[j] = a;\n          p++;\n        }\n      }\n    }\n    if (a == -1)\n      break;\n    for (b = 0; b < p; b++) {\n      for (c = 0; c < p; c++) {\n        if (k[b] - 2 * k[c] == 0)\n          q++;\n      }\n    }\n    printf(\"%d\\n\", q);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, count = 0;\n  for (;;) {\n    count = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j; k < i; k++) {\n          if (a[j] == a[k] * 0.5 || a[j] == a[k] * 2)\n            count++;\n        }\n      }\n      cout << count << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[15];\n  int a, i, k, count = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a);\n    if (a == -1)\n      break;\n    else if (a == 0) {\n      i = -1;\n      cout << count << \"\\n\";\n      count = 0;\n      continue;\n    } else\n      sz[i] = a;\n    for (k = 0; k <= i; k++) {\n      if (sz[i] == sz[k] * 2 || sz[k] == sz[i] * 2)\n        count++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21565", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x[16], a, b, i, k;\n\n  while (1) {\n\n    for (i = 0; i < 16; i++) {\n      cin >> x[i];\n      if (x[i] == 0) {\n        a = i;\n        break;\n      }\n    }\n    if (x[0] == -1) {\n\n      break;\n    }\n    int s = 0;\n    for (k = 0; k < a; k++) {\n      for (i = 0; i < a; i++) {\n        if (x[k] == 2 * x[i]) {\n          s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[200], k, i, n = 0, j = 0;\n  for (i = 0; i < 200; i++) {\n    cin >> a[i];\n    if (a[i] != -1 && a[i] != 0)\n      n = n + 1;\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (k = 0; k < n; k++) {\n        for (i = 0; i < n; i++) {\n          if (a[k] == 2 * a[i])\n            j = j + 1;\n        }\n      }\n      printf(\"%d\\n\", j);\n      j = 0;\n      i = -1;\n      n = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int i, j, k, t, s;\n  int b[100] = {0};\n  for (i = 0; i <= 99; i++) {\n\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        break;\n      }\n    }\n    if (a[i][0] == -1) {\n      b[i] = -1;\n      break;\n    }\n  }\n  for (k = 0; k <= 99; k++) {\n    if (a[k][0] == -1) {\n      break;\n    }\n    for (t = 0; t <= 15; t++) {\n      if (a[k][t] == 0 || a[k][t] == -1) {\n        break;\n      }\n      for (s = 0; s <= 15; s++) {\n        if (a[k][s] == 0)\n          break;\n\n        if (a[k][t] * 2 == a[k][s]) {\n          b[k]++;\n        }\n      }\n    }\n  }\n  for (int q = 0; q <= 99; q++) {\n    if (b[q] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21568", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[15] = {0}, i, j, a, b = 0, m;\n  do {\n    for (m = 0;; m++) {\n      cin >> a;\n      num[m] = a;\n      if (a == 0)\n        break;\n      if (a == -1)\n        break;\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++)\n        if ((num[i] != 0 && num[j] != 0 && num[i] * 2 == num[j]) ||\n            (num[i] != 0 && num[j] != 0 && num[j] * 2 == num[i]))\n          b++;\n    if (a != -1) {\n      cout << b / 2 << endl;\n      b = 0;\n    }\n  } while (a != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int i, j, num, n;\n  n = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a[i]);\n    n++;\n    if (a[i] == 0 || a[i] == -1) {\n      n--;\n      break;\n    }\n  }\n\n  do {\n\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i] || a[j] * 2 == a[i]) {\n          num++;\n        }\n      }\n    }\n    cout << num << \" \";\n\n    n = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      n++;\n      if (a[i] == 0 || a[i] == -1) {\n        n--;\n        break;\n      }\n    }\n  }\n\n  while (a[0] != -1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float sz[16];\n  int n[100];\n  int i, k;\n  for (i = 0; i >= 0; i++) {\n    n[i] = 0;\n    for (k = 0; k < 16; k++) {\n      scanf(\"%f\", &sz[k]);\n      if (sz[k] == 0 || sz[0] == -1)\n        break;\n    }\n    for (int a = 0; a < k - 1; a++) {\n      for (int b = a + 1; b < k; b++) {\n        if (sz[a] == sz[b] * 2 || sz[a] == sz[b] / 2) {\n          n[i]++;\n        }\n      }\n    }\n    if (sz[0] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", n[k]);\n  return 0;\n}\n"}
{"label": "12", "index": "21571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[500];\n  int i, j, n, ans;\n  for (; scanf(\"%d\", &a[0]), a[0] != -1;) {\n    for (n = 1; scanf(\"%d\", &a[n]), a[n] != 0; n++)\n      ;\n    ans = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        if (a[i] == a[j] * 2)\n          ans++;\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[20], i, j, n, c, t;\n  do {\n    cin >> c;\n    num[0] = c;\n    n = 1;\n    while (c != 0) {\n      scanf(\"%d\", &c);\n      if (c == -1)\n        return 0;\n      num[n] = c;\n      n++;\n    }\n    t = 0;\n    for (i = n - 2; i >= 0; i--)\n      for (j = n - 2; j >= 0; j--)\n        if (num[i] == 2 * num[j])\n          t++;\n    cout << t << \"\\n\";\n  } while (c != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21573", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16];\n  int i = 1, a, j, b;\n\nloop:;\n  scanf(\"%d \", &s[i]);\n  if (s[i] != 0) {\n    i++;\n    goto loop;\n  }\n  a = i;\n  b = 0;\n  for (i = a; i >= 1; i--) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == 2 * s[j] || s[j] == 2 * s[i])\n        b++;\n    }\n  }\n\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, h, n;\n  for (h = 0;; h++) {\n    n = 0;\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if ((a[k] / a[j]) == 2 && (a[k] % a[j]) == 0) {\n          n = n + 1;\n        } else\n          n = n;\n      }\n    }\n    cout << n << \"\\n\";\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, x = 0, m = 0;\n  int a[20];\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i++;\n\n    for (m = 0; a[m] != 0; m++)\n      for (j = m; a[j] != 0; j++) {\n        if (a[m] == 2 * a[j] || a[j] == 2 * a[m])\n          x = x + 1;\n      }\n    cout << x << \"\\n\";\n    x = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b = 0, c = 0, d = 1, e = 0;\n  scanf(\"%d \", &a[b]);\n  while (a[b] != -1) {\n    while (a[b] != 0) {\n      b++;\n      scanf(\"%d \", &a[b]);\n    }\n    while (c <= b) {\n      while (d < b) {\n        if (a[c] == (a[d] * 2)) {\n          e = e + 1;\n        }\n        d = d + 1;\n      }\n      c = c + 1;\n      d = 0;\n    }\n    printf(\"%d\\n\", e);\n    b = 0;\n    scanf(\"\\n%d\", &a[b]);\n    e = 0;\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, i = 0, j = 0,\n      k = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n\n    i = 1;\n    do {\n      cin >> a[i];\n      if (a[i] < 0) {\n      }\n      i++;\n    } while (a[i - 1]);\n    for (i = 0; i < 16; i++) {\n      if (a[i]) {\n        for (j = 0; j < 16; j++) {\n          if (a[i] == 2 * a[j])\n            k += 1;\n        }\n      }\n    }\n    cout << k << \" \";\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21578", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21579", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int a[16], i, j, temp, count;\n  i = 0;\n  while (cin >> a[0]) {\n    count = 0;\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (cin >> a[i]) {\n      if (a[i] < 1) {\n        temp = i;\n        break;\n      }\n      i++;\n    }\n    for (i = 0; i < temp - 1; i++) {\n      for (j = i + 1; j < temp; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[2000];\n  int i, m, n, k, lt;\n  k = 0;\n  lt = 0;\n  for (i = 0; i < 2000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (m = lt; m < i; m++) {\n        for (n = lt; n < i; n++) {\n          if (a[m] == 2 * a[n]) {\n            k++;\n          }\n        }\n      }\n      cout << k << endl;\n      k = 0;\n      lt = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int i = 0, a[16];\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1) {\n      break;\n    }\n\n    int b[105] = {0};\n    b[a[i]] = 1;\n\n    while (1) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n      b[a[i]] = 1;\n    }\n\n    int j;\n    int total = 0;\n    for (j = 1; j < 50; j++) {\n      if (b[j] == 1 && b[j * 2] == 1)\n        total++;\n    }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char exp;\n  int i, c, t, w, n, s, t2, j, k, a[16];\n  long m, e;\n  float x, y;\n  double r, d, b, h, g[100];\n\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i]) {\n          s = s + 1;\n        }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21583", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], sum = 0, j, i, k, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      n = n + 1;\n      if (a[i] == 0) {\n        n = n - 1;\n        for (k = 0; k < (n - 1); k++) {\n          for (j = k + 1; j < n; j++) {\n            if ((a[j] == a[k] * 2) || (a[k] == a[j] * 2)) {\n              sum = sum + 1;\n            }\n          }\n        }\n        printf(\"%d\\n\", sum);\n        i = 0;\n        sum = 0;\n        n = 0;\n        break;\n      } else {\n        if (a[i] == -1) {\n          return 0;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, ds, s;\n  int a[16];\n  while (cin) {\n    ds = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      return 0;\n    s = 1;\n    while (cin) {\n      cin >> a[s];\n      if (a[s] == 0)\n        break;\n      else\n        s = s + 1;\n    }\n    for (i = 0; i <= s; i++) {\n      for (j = i + 1; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          ds = ds + 1;\n      }\n    }\n    cout << ds << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21585", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  int k = 0;\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    k = k + 1;\n    i++;\n  }\n  int j;\n  int n = 0;\n  for (i = 0; i <= k - 1; i++) {\n    for (j = 0; j <= k - 1; j++) {\n      if (a[i] == 2 * a[j]) {\n        n = n + 1;\n      }\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "12", "index": "21586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, j, k, key, num;\n  key = 0;\n  int count[100];\n  int a[100][156];\n  int result[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &m);\n      if (m == 0) {\n        break;\n      } else if (m == -1) {\n        key = 1;\n        break;\n      } else {\n        a[i][j] = m;\n        count[i] = j;\n      }\n    }\n    if (key == 1) {\n      break;\n    }\n    num = i;\n  }\n  for (i = 0; i <= num; i++)\n    result[i] = 0;\n  for (i = 0; i <= num; i++) {\n    for (j = 0; j <= count[i]; j++) {\n      for (k = 0; k <= count[i]; k++) {\n        if (a[i][j] == a[i][k] * 2)\n          result[i] = result[i] + 1;\n      }\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int i, j, m, n;\n\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    m = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[j] == (a[i] + a[i]))\n          m++;\n      }\n    }\n\n    { printf(\"%d\\n\", m); }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float s[16], t[16];\n  int u = 0, g = 0;\n  for (int k = 1; k < 100; k++) {\n    int a = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f\", &s[i]);\n      if (s[0] == -1 || scanf(\"\"))\n        printf(\"\");\n      else {\n        u += 1;\n        if (s[i] == 0)\n          break;\n        else {\n          t[i] = s[i];\n          a++;\n        }\n      }\n    }\n    int b = 0;\n    for (int h = 0; h < a; h++) {\n      for (int k = 0; k < a; k++) {\n        if (t[h] / t[k] == 2)\n          b++;\n      }\n    }\n    printf(\"%d\\n\", b);\n    g++;\n    if (g == u)\n      printf(\"\");\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21589", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16];\n  while ((cin >> a[0]) && a[0] != -1) {\n    int num0 = 1, i, j, k, num = 0;\n    i = 1;\n    while (scanf(\"%d \", &a[i]) && (a[i] != 0)) {\n\n      num0++;\n      i++;\n    }\n    for (j = 0; j < num0 - 1; j++) {\n      for (k = j + 1; k <= (num0 - 1); k++) {\n        if ((a[j] == 2 * a[k]) || (2 * a[j] == a[k]))\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int i = 0, j, k = 0;\n  int line, column[100] = {0};\n  int tmp, count;\n  for (j = 0; j < 100; j++) {\n    cin >> num[i][j];\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      i++;\n      j = -1;\n    } else\n      column[i]++;\n  }\n\n  line = i - 1;\n  for (i = 0; i <= line; i++) {\n    tmp = num[i][k];\n    count = 0;\n    for (j = k + 1; j < column[i]; j++) {\n      if ((tmp * 2 == num[i][j]) || (num[i][j] * 2 == tmp)) {\n        count++;\n      }\n      if (j == column[i] - 1 && k < column[i] - 2) {\n        k++;\n        tmp = num[i][k];\n        j = k;\n      }\n    }\n    k = 0;\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; scanf(\"%d\", &x[i]), ~x[i]; i++)\n      if (!x[i])\n        break;\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++)\n        for (k = 0; k < j; k++)\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], j;\n  int k, m, y;\n  int i;\n  while (1 == 1) {\n    m = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        y = 1;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n      else\n        m = m + 1;\n    }\n    if (y == 1)\n      break;\n    else {\n\n      k = 0;\n      for (i = 0; i < m - 1; i++) {\n\n        for (j = i + 1; j < m; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            k++;\n        }\n      }\n    }\n\n    cout << k << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21593", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, k, n = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          n++;\n      }\n    printf(\"%d\\n\", n);\n    n = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21594", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15], count = 0;\n  int i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i];\n    if (a[0] == -1)\n      break;\n    else if (a[i] == 0) {\n      for (j = 0; j < i; j++)\n        for (k = 0; k < i; k++) {\n          if (a[k] == a[j] * 2)\n            count++;\n        }\n      cout << count << endl;\n      count = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15];\n  int t, s, i, j, n;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    s = 0;\n    n = 0;\n    a[s] = t;\n    cin >> t;\n    while (t != 0) {\n      s++;\n      a[s] = t;\n      scanf(\"%d\", &t);\n    }\n    i = 0;\n    for (i; i < s; i++) {\n      j = i + 1;\n      for (j; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2)) {\n          n++;\n        }\n      }\n    }\n    printf(\"%d\", n);\n    cout << \"\\n\";\n    scanf(\"%d\", &t);\n  }\n}\n"}
{"label": "12", "index": "21596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m, x, l;\n  int a[15];\n  for (m = 1;; m++) {\n    for (x = 1; x <= 16; x++) {\n      cin >> l;\n      if (l != 0)\n        a[x - 1] = l;\n      else {\n        n = x - 1;\n        t = 0;\n        for (i = 0; i <= n - 2; i++) {\n          for (j = i + 1; j <= n - 1; j++) {\n            if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n              t++;\n          }\n        }\n        cout << t << endl;\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, x = 0, m = 0;\n  int a[20];\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i++;\n\n    for (m = 0; a[m] != 0; m++)\n      for (j = m; a[j] != 0; j++) {\n        if (a[m] == 2 * a[j] || a[j] == 2 * a[m])\n          x = x + 1;\n      }\n    printf(\"%d\\n\", x);\n    x = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21598", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, n;\n  while (1) {\n    n = 0;\n    cin >> a[1];\n\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (int j = 1; j <= i; j++)\n      for (int k = j + 1; k <= i; k++)\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], s = 0;\n  while (scanf(\"%d\", &a[++s]) != EOF) {\n    if (a[1] == -1)\n      break;\n    do\n      scanf(\"%d\", &a[++s]);\n    while (a[s] != 0);\n    s--;\n    int ans = 0;\n    for (int i = 1; i <= s; i++)\n      for (int j = 1; j <= s; j++)\n        if (a[i] * 2 == a[j]) {\n          ans++;\n        }\n    cout << ans << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50][16], b[50], c[50], i, j, m, n, o, line, num = 0;\n  for (i = 0; i <= 49; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        b[i] = j - 1;\n        c[i] = 0;\n        break;\n      }\n    }\n    if (a[i][0] == -1)\n      break;\n    line = i;\n  }\n  for (m = 0; m <= line; m++) {\n    for (n = 0; n <= b[m]; n++) {\n      for (o = 0; o <= b[m]; o++) {\n        if (a[m][n] == 2 * a[m][o])\n          c[m] = c[m] + 1;\n      }\n    }\n    cout << c[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], x, y, s, i, j, k, l, m, n;\n  do {\n    scanf(\"%d\", &x);\n    if (x == -1)\n      break;\n    a[0] = x;\n    i = 1;\n    do {\n      scanf(\" %d\", &y);\n      a[i] = y;\n      i = i + 1;\n    } while (y != 0);\n    scanf(\"\\n\");\n    n = i - 2;\n    i = 0;\n    while (i <= n) {\n      j = 0;\n      while (j <= n - 1) {\n        if (a[j] > a[j + 1]) {\n          s = a[j + 1];\n          a[j + 1] = a[j];\n          a[j] = s;\n        }\n        j = j + 1;\n      }\n      i = i + 1;\n    }\n    i = 0;\n    m = 0;\n    while (i <= n - 1) {\n      j = n - i;\n      k = 0;\n      while (k <= j - 1) {\n        if (a[j] == 2 * a[k])\n          m = m + 1;\n        k = k + 1;\n      }\n      i = i + 1;\n    }\n    cout << m << \"\\n\";\n  } while (x != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a, n = 0;\n  int b[16];\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    i = 2;\n    b[1] = a;\n    do {\n      scanf(\"%d\", &a);\n      b[i] = a;\n      i = i + 1;\n    } while (a != 0);\n    for (j = 1; j <= i - 3; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if (b[j] == 2 * b[k] || 2 * b[j] == b[k])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n    scanf(\"%d\", &a);\n  }\n}\n"}
{"label": "12", "index": "21603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int i;\n  int n = 0;\n  int num = 0;\n  int j;\n  while (1) {\n    n = 0;\n    num = 0;\n    for (i = 0; i < 20; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1) {\n        return 0;\n      }\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          num++;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[16], n, i, j, m, num;\n  n = 0;\n  m = 1;\n  do {\n    i = 0;\n    n = 0;\n    do {\n      scanf(\"%d\", &c[i]);\n      i++;\n    } while (c[i - 1] != 0 && c[0] != -1 && i < 16);\n    num = i - 1;\n    if (c[0] != -1) {\n      for (i = 0; i < num; i++) {\n        for (j = i + 1; j < num + 1; j++) {\n          if (c[i] > 0 && c[j] > 0)\n            if (c[i] == c[j] * 2 || c[j] == c[i] * 2)\n              n++;\n        }\n      }\n      printf(\"%d \", n);\n    } else\n      m = 0;\n  } while (m == 1);\n  return (0);\n}\n"}
{"label": "12", "index": "21605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], i, j, k, n = 0, N = 0, t;\n  for (k = 1; k < 100; k++) {\n    for (i = 0; i < 100; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        i = 100;\n    }\n    if (a[0] != -1) {\n      for (i = 1; i <= n - 2; i++) {\n        for (j = 0; j <= n - i - 2; j++) {\n          if (a[j] > a[j + 1]) {\n            t = a[j];\n            a[j] = a[j + 1];\n            a[j + 1] = t;\n          }\n        }\n      }\n      for (i = n - 2; i >= 0; i--) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] == 2 * a[j])\n            N++;\n        }\n      }\n      printf(\"%d\\n\", N);\n      N = 0;\n      n = 0;\n    }\n\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, j, k;\n  int m;\n  int n;\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      n = 0;\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 0)\n            continue;\n          if (a[j] == 2 * a[k])\n            n = n + 1;\n        }\n      }\n      cout << n << endl;\n      a[0] = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21607", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], j;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    int i = 1;\n    int l = 0;\n    while (scanf(\"%d \", &a[i])) {\n      if (a[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n          l = l + 1;\n        }\n      i++;\n    }\n    cout << l << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, f = 0;\n  while (f == 0) {\n    int a[16], count = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        printf(\"%d\\n\", count);\n        break;\n      } else {\n        if (a[i] == -1) {\n          f = 1;\n          break;\n        } else {\n          for (j = 0; j < i; j++) {\n            if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n              count++;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21609", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, m = 0, count = 0;\n  int num[100];\n  for (;;) {\n    m = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &num[i]);\n      if (num[i] == 0 || num[i] == -1) {\n        count = i;\n        break;\n      }\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < count; i++)\n        for (j = i + 1; j < count; j++) {\n          if ((num[i] == 2 * num[j]) || (num[j] == 2 * num[i]))\n            m++;\n        }\n      cout << m << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i, j, k, l;\n  int num = 0;\n  for (l = 1;; l++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    for (j = i - 1; j >= 1; j--)\n      for (k = j - 1; k >= 1; k--) {\n        if (a[j] > a[k] && a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          num++;\n        if (a[k] > a[j] && a[k] % a[j] == 0 && a[k] / a[j] == 2)\n          num++;\n      }\n    cout << num << endl;\n    int a[17] = {0};\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[16] = {0};\nvoid scan();\n\nint main()\n\n{\n  scanf(\"%d\", &a[0]);\n  while (a[0] > 0) {\n    scan();\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\nvoid scan() {\n\n  int i, j = 1, n = 0, h, t;\n  while (scanf(\"%d\", &a[j]) && a[j] != 0) {\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (h = i; h < j; h++) {\n      if (a[i] > a[h]) {\n        t = a[i];\n        a[i] = a[h];\n        a[h] = t;\n      }\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (h = i + 1; h < j; h++) {\n      if (a[h] == 2 * a[i]) {\n        n++;\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", n);\n}\n"}
{"label": "12", "index": "21612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], bn[100] = {0, 0, 0}, i, j, k, t = 1, l;\n\n  for (t = 1;; t++) {\n    i = 1;\n    do {\n      cin >> a[i - 1];\n      if (a[i - 1] == -1)\n        break;\n      i++;\n    } while (a[i - 2] != 0);\n    if (a[i - 1] == -1)\n      break;\n    for (j = 1; j <= i - 2; j++) {\n      for (k = 1; k <= i - 2; k++)\n        if (a[j - 1] == 2 * a[k - 1])\n          bn[t - 1]++;\n    }\n  }\n  for (l = 1; l <= t - 1; l++) {\n    printf(\"%d\\n\", bn[l - 1]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21613", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i = 1, j = 0, k = 0, l = 0;\n  while (cin >> a[0]) {\n\n    num = 0;\n\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= 15; j++)\n      for (k = 0; k <= 15; k++)\n        if ((a[j] != 0) && (a[k] != 0) && (a[j] == 2 * a[k]))\n          num++;\n    for (l = 0; l <= 15; l++)\n      a[l] = 0;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, k, j, sum = 0, m;\n\n  for (k = 1;; k++) {\n    sum = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    if (a[0] != -1) {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < m - 1; i++) {\n      for (j = i + 1; j < m; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          sum = sum + 1;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][16] = {0}, i = 0, j = 0, x, y, z, m;\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1)\n        break;\n      j++;\n    } while (a[i][j - 1] != 0);\n    if (a[i][j] == -1)\n      break;\n    else\n      i++;\n  } while (1 == 1);\n  for (x = 0; x < i; x++) {\n    m = 0;\n    {\n      for (y = 0; a[x][y] != 0; y++) {\n        for (z = 0; a[x][z] != 0; z++) {\n          if (a[x][z] == 2 * a[x][y])\n            m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, x = 0, m = 0;\n  int a[20];\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i++;\n\n    for (m = 0; a[m] != 0; m++)\n      for (j = m; a[j] != 0; j++) {\n        if (a[m] == 2 * a[j] || a[j] == 2 * a[m])\n          x = x + 1;\n      }\n    printf(\"%d\\n\", x);\n    x = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int list[15] = {0};\n  int i, j, num, sum;\n\n  cin >> num;\n\n  while (num != -1) {\n    i = 1;\n    j = 0;\n    sum = 0;\n    list[0] = num;\n    while ((cin >> list[i], list[i]) != 0)\n      i++;\n    while (list[j]) {\n      for (i = j + 1; list[i]; i++) {\n        if (list[i] == 2 * list[j] || 2 * list[i] == list[j])\n          sum++;\n      }\n      j++;\n    }\n    cout << sum << endl;\n    cin >> num;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, NO, tmp, a[101];\n  while (1) {\n    scanf(\"%d\", &tmp);\n    if (tmp == -1)\n      break;\n    NO = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[tmp] = 1;\n    while (scanf(\"%d\", &tmp) == 1 && tmp)\n      a[tmp] = 1;\n    for (i = 0; i < 50; i++) {\n      if (a[i] && a[2 * i])\n        NO++;\n    }\n    cout << NO << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, n, i = 1;\n  for (; a[i] != -1;) {\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      for (int j = 0; j < i; j++) {\n        if (a[j] * 2 == a[i] || a[j] == a[i] * 2) {\n          n++;\n        }\n      }\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] != -1) {\n      cout << n << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21620", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, m = 0, count = 0;\n  int num[100];\n  for (;;) {\n    m = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if (num[i] == 0 || num[i] == -1) {\n        count = i;\n        break;\n      }\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < count; i++)\n        for (j = i + 1; j < count; j++) {\n          if ((num[i] == 2 * num[j]) || (num[j] == 2 * num[i]))\n            m++;\n        }\n      printf(\"%d\\n\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21621", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      scanf(\"%d \", &a[i++]);\n      if (a[i - 1] == 0)\n        flag = 0;\n      else if (a[i - 1] == -1)\n        return 0;\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j])\n            t++;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, tot, s;\n  a = 0;\n  int num[20] = {0};\n  while (a != -1) {\n    j = 1;\n    tot = 1;\n    s = 0;\n    for (i = 1; i <= 20; i++)\n      num[i] = 0;\n    i = 1;\n    cin >> a;\n    while (a != -1) {\n      if (a != 0) {\n        num[i++] = a;\n        tot++;\n        cin >> a;\n      }\n\n      else\n        break;\n    }\n    if (a != -1) {\n      for (j = 1; j <= tot; j++)\n        for (k = j + 1; k <= tot; k++)\n          if ((num[k] == 2 * num[j]) || (2 * num[k] == num[j]))\n            s++;\n      cout << s << endl;\n    }\n  }\n  cin >> s;\n  return 0;\n}\n"}
{"label": "12", "index": "21623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, s, t;\n  int d[100];\n  int q, p;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        break;\n      }\n    }\n    if (j == 0)\n      break;\n    s = 0;\n    for (k = 0; k < j - 1; k++) {\n      for (t = k + 1; t < j; t++) {\n        p = a[i][t] - a[i][k] * 2;\n        q = a[i][k] - a[i][t] * 2;\n        if (p == 0 || q == 0)\n          s++;\n      }\n    }\n    d[i] = s;\n  }\n  for (k = 0; k < i; k++)\n    cout << d[k] << \" \";\n}\n"}
{"label": "12", "index": "21624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[100][16];\n  int sum[100] = {0};\n  float y;\n  int i, j, k;\n  for (j = 0; j < 100; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &x[j][i]);\n      if (x[j][0] == -1)\n        goto loop;\n      if (x[j][i] == 0)\n        break;\n    }\n  }\nloop:\n  for (j = 0; j < 100; j++) {\n    if (x[j][0] != -1) {\n      for (i = 0; i < 16; i++) {\n        if (x[j][i] == 0)\n          break;\n        for (k = 0; k < 16; k++) {\n          if (x[j][k] == 0)\n            break;\n          y = 1.0 * x[j][i] / (1.0 * x[j][k]);\n          if (y == 2)\n            sum[j] = sum[j] + 1;\n        }\n      }\n      printf(\"%d\\n\", sum[j]);\n    }\n    if (x[j][0] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[25], i, j, count;\n  while (scanf(\"%d \", &n[1]), n[1] != -1) {\n    count = 0;\n    for (i = 2; cin >> n[i], n[i] != 0; i++) {\n      for (j = 1; j < i; j++) {\n        if (n[i] == 2 * n[j] || n[i] * 2 == n[j]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21626", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[15], count;\n  while (1) {\n    count = 0;\n    for (n = 0;; n++) {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (j == i)\n          continue;\n        if (x[j] == 2 * x[i])\n          count++;\n      };\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2;\n  int pair(int n[15]);\n  int num[15] = {0};\n  for (l1 = 0; (num[0] != -1); l1++) {\n    scanf(\"%d\", &num[0]);\n    for (l2 = 1; (num[l2 - 1] != 0) && (num[0] != -1); l2++) {\n      scanf(\"%d\", &num[l2]);\n    }\n    if (num[0] != -1)\n      printf(\"%d\\n\", pair(num));\n  }\n  return (0);\n}\nint pair(int n[15]) {\n  int sum, i, j, k, x;\n  sum = 0;\n  for (i = 1; (n[i] != 0); i++) {\n    if (n[i] == (n[0] + n[0]))\n      sum = sum + 1;\n  }\n  for (j = 1; (n[j - 1] != 0); j++) {\n    for (k = 0; (n[k] != 0); k++) {\n      if (n[k] == n[j] * 2)\n        sum = sum + 1;\n    }\n  }\n  return (sum);\n}\n"}
{"label": "12", "index": "21628", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int h) {\n  int a[15], i, j, n, m = 0;\n  a[0] = h;\n  if (a[0] == -1)\n    return -1;\n  else {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          m += 1;\n          break;\n        }\n      }\n    }\n    return (m);\n  }\n}\nint main() {\n  int a[100], h, i = 0;\n  while (1) {\n    cin >> h;\n    a[i] = f(h);\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != -1; i++)\n    printf(\"\\n%d\", a[i]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], temp, n = 0, i = 1, j, k;\n  do {\n    do {\n      scanf(\"%d\", &temp);\n      a[i] = temp;\n      i++;\n      \n    } while (temp != 0 && temp != -1);\n    \n\n    for (j = 1; j < i - 2; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if ((a[j] / a[k] == 2 && a[j] % a[k] == 0) ||\n            (a[k] / a[j] == 2 && a[k] % a[j] == 0)) {\n          n++;\n          \n        }\n      }\n    }\n    if (temp != -1) {\n      printf(\"%d\\n\", n);\n    }\n    i = 1;\n    n = 0;\n  } while (temp != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21630", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], temp, n = 0, i = 1, j, k;\n  do {\n    do {\n      cin >> temp;\n      a[i] = temp;\n      i++;\n\n    } while (temp != 0 && temp != -1);\n\n    for (j = 1; j < i - 2; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if ((a[j] / a[k] == 2 && a[j] % a[k] == 0) ||\n            (a[k] / a[j] == 2 && a[k] % a[j] == 0)) {\n          n++;\n        }\n      }\n    }\n    if (temp != -1)\n      printf(\"%d\\n\", n);\n\n    i = 1;\n    n = 0;\n  } while (temp != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21631", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int i, j, m, n;\n  int num[100], result[100], temp;\n\n  i = 0;\n  j = 0;\n  while (1) {\n    cin >> num[i];\n    if (num[i] == -1) {\n      break;\n    }\n\n    while (1) {\n      if (num[i] == 0) {\n        temp = 0;\n        for (m = 0; m < i; m++) {\n          for (n = 0; n < i; n++) {\n            if (num[m] == 2 * num[n]) {\n              temp++;\n            }\n          }\n        }\n        result[j] = temp;\n\n        i = 0;\n        j++;\n        break;\n      } else {\n        i++;\n        cin >> num[i];\n      }\n    }\n  }\n\n  for (m = 0; m < j; m++) {\n    cout << result[m] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, h;\n  int b[16] = {0};\n  while (1) {\n    i = 0;\n    while (scanf(\"%d \", &a)) {\n      if (a == (-1))\n        return 0;\n      else {\n        if (a != 0) {\n          b[i] = a;\n          i++;\n        } else\n          break;\n      }\n    }\n    h = 0;\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[j] != 0) {\n        for (k = 0; k <= i - 1; k++) {\n          if (b[j] == b[k] * 2)\n            h++;\n        }\n      } else\n        break;\n    }\n    cout << h << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21633", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c;\n  int num[1000] = {0}, m = 0, index = 0, i, j;\n  while (num[0] != -1) {\n    while (true) {\n      cin >> num[index];\n      index++;\n      scanf(\"%c\", &c);\n      if (c != ' ')\n        break;\n    }\n    for (i = 0; i < index; i++) {\n      for (j = 0; j < index; j++) {\n        if (num[i] == 2 * num[j] || num[i] * 2 == num[j])\n          m++;\n      }\n    }\n    if (num[0] == -1)\n      return 0;\n\n    printf(\"%d\\n\", m / 2);\n    m = 0;\n    index = 0;\n  }\n}\n"}
{"label": "12", "index": "21634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k, s, n;\n  for (k = 1;; k++) {\n    s = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[n] == -1)\n      break;\n    for (i = 1; i < n; i++) {\n      for (j = i + 1; j <= n; j++) {\n        if ((a[i] * 2 == a[j]) || (a[j] * 2 == a[i])) {\n          s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, k, g[1000][16], o;\n  for (i = 0; i <= 999; i++) {\n    int s = 0;\n    for (l = 0; l < 16; l++) {\n      scanf(\"%d\", &g[i][l]);\n      if (g[i][l] == 0)\n        break;\n    }\n    if (g[i][0] == -1)\n      break;\n    for (o = 0; o < 14 && g[i][o] > 0; o++) {\n      for (k = o + 1; k < 15; k++) {\n        if (g[i][k] - 2 * g[i][o] == 0 || g[i][o] - 2 * g[i][k] == 0)\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num[100][150], i, j, g, h[100], k, m;\n  for (j = 0;; j++) {\n    for (i = 0;; i++) {\n      cin >> num[j][i];\n      if (num[j][0] == -1)\n        break;\n      if (num[j][i] == 0)\n        break;\n    }\n    if (num[j][0] == -1)\n      break;\n    h[j] = i;\n  }\n  g = j;\n  int count[100] = {0};\n  for (j = 0; j < g; j++) {\n    for (i = 0; i < h[j]; i++) {\n      k = i;\n      for (m = k; m < h[j]; m++) {\n        if (((num[j][m] % num[j][k] == 0) && (num[j][m] / num[j][k] == 2)) ||\n            ((num[j][k] / num[j][m] == 2) && (num[j][k] % num[j][m] == 0)))\n          count[j]++;\n      }\n    }\n\n    cout << count[j] << \"\\n\";\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "21637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[16];\n    int i = 0, n = 0, k;\n    while (1) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n      i++;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (k = 0; a[k] != 0; k++) {\n        if (a[k] == 2 * a[i])\n          n++;\n      }\n\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21638", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int str_1[20][20];\n  int str_2[100];\n  int x, y, m, j;\n  int sum = 0;\n  int p = 0;\n  int a = 0;\n  int b = 0;\n  int c;\n  int k;\n  int i = 0;\n  while (1) {\n    ++p;\n    scanf(\"%d\", &x);\n    if (-1 == x)\n      break;\n    k = 0;\n    str_1[p][i++] = x;\n    b++;\n    while (1) {\n      cin >> y;\n      k++;\n      str_1[p][i++] = y;\n      if (0 == y) {\n        str_1[p][i] = '\\0';\n        break;\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (m = 0; m < k; m++) {\n        if (str_1[p][j] == str_1[p][m] * 2)\n          ++sum;\n      }\n    }\n    str_2[a++] = sum;\n    sum = 0;\n    str_2[a] = '\\0';\n    i = 0;\n  }\n  for (c = 0; c < b; c++) {\n    printf(\"%d\", str_2[c]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "21639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, i = 0, j = 0, n = 0, l[100] = {0}, d, N[100] = {0};\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      j++;\n    } while (a[i][j - 1] != 0 && a[i][j - 1] != -1);\n    l[i] = j - 1;\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (d = j; d < l[i]; d++) {\n        if (a[i][d] == 2 * a[i][j] || a[i][j] == 2 * a[i][d])\n          N[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", N[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21640", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k, j;\n  int count = 0;\n  int sz[16] = {0};\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == 0) {\n      for (k = 0; k < i - 1; k++) {\n        for (j = k + 1; j < i; j++) {\n          if (sz[k] == 2 * sz[j] || sz[k] * 2 == sz[j])\n            count++;\n        }\n      }\n      printf(\"%d\\n\", count);\n      count = 0;\n      i = -1;\n    }\n\n    if (sz[i] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int i, j, k, t, s;\n  int b[100] = {0};\n  for (i = 0; i <= 99; i++) {\n\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        break;\n      }\n    }\n    if (a[i][0] == -1) {\n      b[i] = -1;\n      break;\n    }\n  }\n  for (k = 0; k <= 99; k++) {\n    if (a[k][0] == -1) {\n      break;\n    }\n    for (t = 0; t <= 15; t++) {\n      if (a[k][t] == 0 || a[k][t] == -1) {\n        break;\n      }\n      for (s = 0; s <= 15; s++) {\n        if (a[k][s] == 0) {\n          break;\n        }\n        if (a[k][t] * 2 == a[k][s]) {\n          b[k]++;\n        }\n      }\n    }\n  }\n  for (int q = 0; q <= 99; q++) {\n    if (b[q] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", b[q]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int m, n, num, a[15]; \n  while (cin >> m)      \n  {\n    if (m == -1)\n      return 0; \n    else        \n    {\n      int n = 1;\n      num = 0;\n      a[0] = m;\n      for (int i = 1;; i++) \n      {\n        cin >> a[i];\n        if (a[i] == 0)\n          break; \n        if (a[i] != 0)\n          n = n + 1;\n      }\n      for (int j = 0; j <= n; j++) \n      {\n        for (int k = j + 1; k <= n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            num = num + 1; \n        }\n      }\n      cout << num << endl; \n    }\n  }\n}\n"}
{"label": "12", "index": "21643", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int iNum[20], i, j, n, iPair;\n  while (1) {\n    iPair = 0;\n    memset(iNum, 0, 80);\n    cin >> iNum[0];\n    n = 1;\n    if (iNum[0] == -1)\n      break;\n    do \n    {\n      cin >> iNum[n];\n      n++;\n    } while (iNum[n - 1] != 0);\n    n--; \n\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        if (iNum[j] == iNum[i] * 2)\n          iPair++;\n    cout << iPair << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21644", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16] = {0}; \n  while (1)        \n  {\n    int i = 0, num = 0, p = 0; \n    while (1)                  \n    {\n      cin >> a[i];\n      if (a[i] <= 0) \n        break;\n      i++; \n    }\n    if (a[0] == -1) \n      break;\n    for (int j = 0; j < i; j++) \n    {\n      p = j;\n      for (int k = 0; k < i; k++) {\n        if (a[p] * 2 == a[k]) \n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2},\n      sum = 0, i, j, s, t;\n\nA:\n  for (i = 0; a[i] != -1; i++) {\n    sum = 0;\n    a[0] = -2;\n    a[1] = -2;\n    a[2] = -2;\n    a[3] = -2;\n    a[4] = -2;\n    a[5] = -2;\n    a[6] = -2;\n    a[15] = -2;\n    a[7] = -2;\n    a[8] = -2;\n    a[9] = -2;\n    a[10] = -2;\n    a[11] = -2;\n    a[12] = -2;\n    a[13] = -2;\n    a[14] = -2;\n    for (s = 0; s <= 15; s++) {\n      cin >> a[s];\n      if (a[s] == 0) {\n        for (t = 0; t <= 15; t++) {\n          for (j = 0; j <= 15; j++) {\n            if (a[j] != 0 && a[t] != 0 && a[t] == a[j] * 2)\n              sum++;\n          }\n        }\n        printf(\"%d\\n\", sum);\n        break;\n      } else if (a[s] == -1)\n        goto A;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, a[100][100], c[100];\n  for (i = 1;; i++) {\n    j = 1;\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == -1)\n      break;\n    for (j = 2; j < 100; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      for (l = j; l >= 1; l--) {\n        if (a[i][j] == 2 * a[i][l] || 2 * a[i][j] == a[i][l])\n          c[i]++;\n        else\n          continue;\n      }\n    }\n    k++;\n  }\n  for (m = 1; m <= k; m++) {\n    printf(\"%d\\n\", c[m]);\n  }\n}\n"}
{"label": "12", "index": "21647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i = 0, j, count = 0;\n  while (cin >> a[i]) {\n    if (a[i] == 0) {\n      printf(\"%d\\n\", count);\n      count = 0;\n      i = 0;\n      continue;\n    }\n\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          count++;\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21648", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a[16] = {0};\n  int i, j, num = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n      if (i > 0) {\n        for (j = 0; j < i; j++) {\n          if (a[i] * 2 == a[j] || a[j] * 2 == a[i]) {\n            num++;\n          }\n        }\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21649", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  for (l = 1;; l++) {\n    i = 0;\n    int a[20], num = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] > 0);\n    if (a[i] == -1) {\n      break;\n    } else {\n      for (j = 1; j < i; j++) {\n        for (k = 1; k < i; k++) {\n          if (a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20][16], b[20] = {0}, i = 0, j, k = 0;\n  scanf(\"%d\", &a[0][0]);\n  i++;\n  while (a[k][0] != -1) \n  {\n    do {\n      scanf(\"%d\", &a[k][i]);\n      i++;\n    } while (a[k][i - 1] != 0);\n    k++;\n    scanf(\"%d\", &a[k][0]);\n    i = 1;\n  }\n\n  for (k = 0; a[k][0] != -1; k++) {\n    for (i = 0; a[k][i] != 0; i++) {\n      for (j = i + 1; a[k][j] != 0; j++) {\n        if ((a[k][j] / a[k][i] == 2 && a[k][j] % a[k][i] == 0) ||\n            (a[k][i] / a[k][j] == 2 &&\n             a[k][i] % a[k][j] == 0)) \n          b[k]++;\n      }\n    }\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[15], i, j, s, t, answer;\n  while (cin >> num[0]) {\n    if (num[0] == -1)\n      break;\n    j = 0;\n    answer = 0;\n    do {\n      j++;\n      scanf(\"%d \", &num[j]);\n    } while (num[j] != 0);\n    for (s = 0; s < j; s++) {\n      for (t = 0; t < j; t++) {\n        if (num[t] == 2 * num[s])\n          answer++;\n      }\n    }\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21652", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], b = 0, c = 0, d = 1, e = 0;\n  cin >> a[b];\n  while (a[b] != -1) {\n    while (a[b] != 0) {\n      b++;\n      scanf(\"%d \", &a[b]);\n    }\n    while (c <= b) {\n      while (d < b) {\n        if (a[c] == (a[d] * 2))\n          e = e + 1;\n        d = d + 1;\n      }\n      c = c + 1;\n      d = 0;\n    }\n    printf(\"%d\\n\", e);\n    b = 0;\n    scanf(\"\\n%d\", &a[b]);\n    e = 0;\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21653", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100], i, j, num = 0, total = 0;\n  while (1) {\n    num = 0;\n    while (1) {\n      scanf(\"%d\", &a[num]);\n      if (a[num] == 0)\n        break;\n      if (a[num] == -1)\n        return 0;\n      num++;\n    }\n\n    total = 0;\n    for (i = 0; i < num; i++) {\n\n      for (j = 0; j < num; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int i, j, m, n;\n  int num[100], result[100], temp;\n\n  i = 0;\n  j = 0;\n  while (1) {\n    scanf(\"%d \", &num[i]);\n    if (num[i] == -1) {\n      break;\n    }\n\n    while (1) {\n      if (num[i] == 0) {\n        temp = 0;\n        for (m = 0; m < i; m++) {\n          for (n = 0; n < i; n++) {\n            if (num[m] == 2 * num[n]) {\n              temp++;\n            }\n          }\n        }\n        result[j] = temp;\n\n        i = 0;\n        j++;\n        break;\n      } else {\n        i++;\n        cin >> num[i];\n      }\n    }\n  }\n\n  for (m = 0; m < j; m++) {\n    printf(\"%d\\n\", result[m]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100], j, k, l, sum = 0;\n  for (;;) {\n    for (j = 0;; j++) {\n      scanf(\"%d \", &a[j]);\n      if (a[j] == 0 || a[j] == -1)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (k = 0; k < j - 1; k++) {\n      for (l = k + 1; l <= j - 1; l++) {\n        if (a[k] == 2 * a[l] || a[l] == 2 * a[k]) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[50][15], n[50], line, sum, i, k, j;\n  for (i = 0;; i++) {\n    for (k = 0;; k++) {\n      scanf(\"%d \", &p[i][k]);\n      if (p[i][k] == 0 || p[i][k] == -1) {\n        n[i] = k;\n        break;\n      }\n    }\n    if (p[i][k] == -1) {\n      line = i;\n      break;\n    }\n  }\n  for (i = 0; i < line; i++) {\n    sum = 0;\n    for (k = 0; k < n[i]; k++) {\n      for (j = k + 1; j < n[i]; j++) {\n        if (p[i][k] == p[i][j] * 2 || p[i][j] == p[i][k] * 2) {\n          sum = sum + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, n, b, c = 0, j = 0, k, a[1000][18];\n  cin >> b;\n  while (b != -1) {\n    if (b != 0) {\n      a[i][j] = b;\n      j++;\n      a[i][17] = j;\n    } else {\n      a[i][j] = b;\n      i++;\n      n = i;\n      j = 0;\n    }\n    cin >> b;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < a[i][17] - 1; j++) {\n      for (k = j + 1; k < a[i][17]; k++) {\n        if (a[i][j] == 2 * a[i][k] || a[i][k] == 2 * a[i][j]) {\n          c++;\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, t, k;\n\n  for (i = 0;; i++)\n\n  {\n    for (j = 0; j <= 15; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n      if (a[0] == -1) {\n        cout << \"\\n\";\n        return 0;\n      }\n    }\n\n    for (j = 0, t = 0; j <= 14; j++) {\n      for (k = j + 1; k <= 15; k++) {\n        if (a[k] != 0 && a[j] != 0 && (2 * a[j] == a[k] || 2 * a[k] == a[j]))\n          t = t + 1;\n      }\n      a[j] = 0;\n    }\n    printf(\"%d\\n\", t);\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "12", "index": "21659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, j, n = 0, sum = 0;\n  int a[20];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n      n++;\n    }\n    for (i = 0; i <= n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n\n    printf(\"%d\\n\", sum);\n    i = 1;\n    sum = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, num, a[16], c;\n  while (1) {\n    i = 0;\n    num = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      c = a[i];\n      i++;\n    } while (c != 0 && c != -1);\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i - 1; j++) {\n      for (k = 0; k < i - 1; k++)\n        if (a[j] == 2 * a[k])\n          num++;\n    }\n\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21661", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[15][20] = {0};\n\nint main() {\n  int i, j, k;\n  int div(int);\n\n  for (i = 0, j = 0;;) {\n    scanf(\"%d\", &num[i][j]);\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      j = 0;\n      i++;\n      continue;\n    }\n    j++;\n  }\n\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", div(k));\n  return 0;\n}\n\nint div(int n) {\n  int i, j, k = 0;\n\n  for (i = 0; num[n][i]; i++)\n    for (j = i; num[n][j]; j++)\n      if (num[n][i] == 2 * num[n][j] || num[n][j] == 2 * num[n][i]) {\n        k++;\n      }\n  return k;\n}\n"}
{"label": "12", "index": "21662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20];\n  int i = 0, n = 0, j;\n  int count = 0;\n  do {\n    n = 0;\n    count = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      i = 1;\n      do {\n        cin >> a[i];\n        i++;\n        count++;\n      } while (a[i - 1] != 0);\n\n      for (i = 0; i < count; i++) {\n        for (j = i + 1; j < count; j++) {\n          if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[100][100], i, k, j, s[100], t, p, m, l[100];\n  double a;\n  for (i = 0; i < 100; i++) {\n    cin >> n[i][0];\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0)\n          break;\n        l[i] = j;\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t <= l[k]; t++) {\n      for (m = t; m <= l[k]; m++) {\n        a = (double)n[k][t] / n[k][m];\n        if (a == 2 || a == 0.5)\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    cout << s[p] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint iFind(int *p, int findnum) {\n  int k, sum = 0;\n  for (k = 0; k < 15; k++) {\n    if (*(p + k) == findnum)\n      sum++;\n  }\n  return sum;\n}\n\nint main() {\n  int a[15], temp, i = 0, j, k, *p, sum = 0;\n  p = a;\n  for (j = 0; j < 15; j++)\n    a[j] = -1;\n  while (cin >> temp, temp != -1) {\n    if (temp != 0) {\n      a[i] = temp;\n      i++;\n    } else {\n      for (k = 0; k < 15; k++)\n        sum += iFind(p, a[k] * 2);\n\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      i = 0;\n      for (j = 0; j < 15; j++)\n        a[j] = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], k, m, n, j;\n  do {\n    j = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] != -1) {\n      for (k = 1; k <= 15; k++) {\n        cin >> a[k];\n        if (!a[k])\n          break;\n      }\n      for (m = 0; m < k - 1; m++) {\n        for (n = m + 1; n < k; n++) {\n          if ((a[m] - 2 * a[n] == 0) || (a[n] - 2 * a[m] == 0))\n            j++;\n        }\n      }\n      cout << j << \"\\n\";\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, num = 1, num1 = 1, i = 1, k, j, c = 0;\n  while (num1 != -1) {\n    cin >> num1;\n    a[0] = num1;\n    while (num != 0) {\n      cin >> num;\n      a[i] = num;\n      i++;\n    }\n    for (k = 0; k <= i - 2; k++)\n      for (j = k + 1; j <= i - 2; j++)\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          c++;\n    cout << c << endl;\n    int a[15] = {0};\n    c = 0;\n    i = 1;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21667", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, k, a[16] = {0}, sum;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    sum = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0);\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (k != j && a[k] == 2 * a[j])\n          sum += 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, n;\n  double f[15];\n  cin >> a;\n  while (a != -1) {\n    i = 0;\n    while (a != 0) {\n      f[i] = a;\n      i++;\n      cin >> a;\n    }\n    j = i;\n    n = 0;\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        f[k] = f[k] * 1.0;\n        if ((f[k] / f[i]) == 2.0 || (f[i] / f[k]) == 2.0)\n          n = n + 1;\n      }\n    }\n    cout << n << endl;\n    cin >> a;\n  }\n  cin.get();\n  cin.get(); \n  return 0;\n}\n"}
{"label": "12", "index": "21669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count;\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++)\n        if ((a[k] == 2 * a[j]) || (a[j] == a[k] * 2))\n          count++;\n    printf(\"%d\\n\", count / 2);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f() {\n  int a[15], i, m = 0, s = 0, j;\n  scanf(\"%d\", &a[0]);\n  if (a[0] == -1)\n    s = -1;\n  else {\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d\", &a[i]);\n      m = m + 1;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (a[i] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int a[100], i = 0, j;\n  while (1) {\n    a[i] = f();\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d\", a[j]);\n    if (j != i - 1)\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "21671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int i, j, num, n;\n  n = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a[i]);\n    n++;\n    if (a[i] == 0 || a[i] == -1) {\n      n--;\n      break;\n    }\n  }\n\n  do {\n\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i] || a[j] * 2 == a[i])\n          num++;\n      }\n    }\n    cout << num << \" \";\n\n    n = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0 || a[i] == -1) {\n        n--;\n        break;\n      }\n    }\n  }\n\n  while (a[0] != -1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  for (i = 0; i < 20; i++)\n    a[i] = 1;\n  while (1) {\n    i = 0;\n    k = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        return 0;\n    }\n    m = i;\n    for (i = 1; i < m; i++) {\n      for (j = i + 1; j < m; j++) {\n        if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n  }\n}\n"}
{"label": "12", "index": "21673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count, n;\n  for (i = 0; i < 16; i++) {\n    count = 0;\n    n = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1)\n        break;\n      if (a[j] == 0)\n        break;\n      count++;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < count; j++) {\n      for (k = 0; k < count; k++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21674", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, sz[15], i = 0, j, k, result = 0;\n\n  cin >> t;\n  while (t != -1) {\n    if (t != 0) {\n      sz[i] = t;\n      i++;\n    } else {\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (sz[k] == sz[j] * 2) {\n            result++;\n          }\n        }\n      }\n      printf(\"%d\\n\", result);\n      i = 0;\n      result = 0;\n    }\n    scanf(\"%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21675", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int t; \n  int a[16], i, j, k, count;\n  while (cin >> t) {\n    count = 0;\n    if (t < 0)\n      return 0; \n    a[0] = t;   \n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break; \n    }\n    for (j = 0; j < i; j++) \n    {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j])\n          count++; \n      }\n    }\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "21676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, n, j, total;\n  while (cin >> a[0] && a[0] != -1) {\n    i = 1;\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n    }\n    n = i;\n    total = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, n, t;\n  while (a[0] != -1) {\n    t = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] <= 0) {\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 0; j < t; j++) {\n        for (m = 0; m < t; m++) {\n          if (a[j] == 2 * a[m]) {\n            n++;\n          }\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, t;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (!a[i])\n        break;\n    }\n    t = i;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == (2 * a[i]))\n          s += 1;\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, j, k, num; \n  double a[16];\n  do \n  {\n    for (i = 0; i <= 15; i++) \n    {\n      a[i] = 0;\n    }\n    num = 0;                  \n    for (i = 0; i <= 15; i++) \n    {\n      cin >> a[i];\n      if (a[i] == 0 || a[0] == -1) \n      {\n        break;\n      }\n    }\n    if (a[0] == -1) \n    {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k] || a[j] == a[k] / 2.0) \n        {\n          num = num + 1; \n        }\n      }\n    }\n    cout << num << endl;\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21680", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, x;\n  int sz[16];\n  while (1) {\n    x = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    for (m = 0; m <= i - 2; m++) {\n      for (n = m + 1; n <= i - 1; n++) {\n        if (sz[m] == 2 * sz[n] || sz[n] == 2 * sz[m]) {\n          x++;\n        }\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, sum = 0, b, j, k, m;\n  scanf(\"%d \", &b);\n  while (b != -1) {\n    a[0] = b;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (j = 1; j < i; j++) {\n      for (k = 0; k < i - j; k++) {\n        if (a[k] > a[k + 1]) {\n          m = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = m;\n        }\n      }\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (2 * a[j] == a[k])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    scanf(\"%d\", &b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21682", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  while (1) {\n    int i = 0, num = 0, p = 0;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] <= 0)\n        break;\n      i++;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (int j = 0; j < i; j++) {\n      p = j;\n      for (int k = 0; k < i; k++) {\n        if (a[p] * 2 == a[k])\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, num, s, a[101];\n  while (1) {\n    scanf(\"%d\", &s);\n    if (s == -1)\n      break;\n    num = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[s] = 1;\n    while (scanf(\"%d\", &s) == 1 && s != 0)\n      a[s] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] == 1 && a[2 * i] == 1)\n        num++;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21684", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &s[i]);\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = i; j < count; j++) {\n        if (s[i] == s[j] * 2 || s[j] == s[i] * 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21685", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[16];\nint main() {\n  int n;\n  while (1) {\n    int i = 0, s = 0, j;\n    while (1) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n\n        n = i;\n        break;\n      }\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          s++;\n      }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], sum = 0, j, i, k, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      n = n + 1;\n      if (a[i] == 0) {\n        n = n - 1;\n        for (k = 0; k < (n - 1); k++) {\n          for (j = k + 1; j < n; j++) {\n            if ((a[j] == a[k] * 2) || (a[k] == a[j] * 2)) {\n              sum = sum + 1;\n            }\n          }\n        }\n        printf(\"%d\\n\", sum);\n        i = 0;\n        sum = 0;\n        n = 0;\n        break;\n      } else {\n        if (a[i] == -1) {\n          return 0;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i = 0, m = 0, k = 0, j = 0;\n  do {\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0 && a[0] != -1) {\n      i = i + 1;\n      scanf(\"%d\", &a[i]);\n    }\n    if (a[0] != -1) {\n      for (j = 0; j < i; j++) {\n        for (k = i - 1; k > j; k--) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            m = m + 1;\n        }\n      }\n      cout << m << \"\\n\";\n    }\n    for (j = 0; j < i; j++)\n      a[j] = 0;\n    m = 0;\n    i = 0;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20][20], i, j, b[20], s, n = 0, k;\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1)\n        break;\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n\n    if (a[i][0] == -1)\n      break;\n  }\n  s = i;\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < b[i]; j++) {\n      for (k = j + 1; k < b[i]; k++) {\n        if (((a[i][j] % a[i][k] == 0) && (a[i][j] / a[i][k] == 2)) ||\n            ((a[i][k] % a[i][j] == 0) && (a[i][k] / a[i][j] == 2)))\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21689", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int in;\n  cin >> in;\n  while (in != -1) {\n    int a[15];\n    int i = 0, num, count = 0;\n    while (in != 0) {\n      a[i] = in;\n      i++;\n      cin >> in;\n    }\n    num = i;\n    for (int p = 0; p < num; p++) {\n      if (a[p] % 2 == 1)\n        continue;\n      for (int q = 0; q < num; q++) {\n        if (a[p] == a[q] * 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n    cin >> in;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21690", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x1, x2, n[15], y;\n  int i;\n  int t;\n  while (1) {\n\n    i = 0;\n    while (1) {\n      cin >> t;\n      if (t == -1) {\n\n        return 0;\n      }\n      if (t == 0)\n        break;\n      else {\n        n[i] = t;\n        i++;\n      }\n    }\n    y = 0;\n    for (x1 = i - 1; x1 >= 0; x1--) {\n      for (x2 = x1 - 1; x2 >= 0; x2--) {\n        if (n[x1] == n[x2] * 2 || n[x2] == n[x1] * 2)\n          y += 1;\n      }\n    }\n    printf(\"%d\\n\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, num, s, a[101];\n  while (1) {\n    scanf(\"%d\", &s);\n    if (s == -1)\n      break;\n    num = 0;\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n    a[s] = 1;\n    while (scanf(\"%d\", &s) == 1 && s != 0)\n      a[s] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] == 1 && a[2 * i] == 1)\n        num++;\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[16] = {0};\n  int m, i = 1;\n  while (m != -1) {\n    do {\n      scanf(\"%d \", &m);\n      number[i] = m;\n      i++;\n    } while (m != 0 && m != -1);\n    int k = 1, t, j = 0;\n    for (k = 1; k <= i - 1; k++) {\n      t = number[k];\n      int p;\n      for (p = 1; p <= i - 1; p++) {\n        if (t == 2 * number[p]) {\n          j++;\n        } else\n          continue;\n      }\n    }\n    if (m != -1) {\n      cout << j - 1 << endl;\n    } else\n      break;\n    i = 1;\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, temp, num[100];\n  for (k = 0; k <= 99; k++) {\n    num[k] = 0;\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] <= 0)\n        break;\n    }\n    if (a[0] < 0) {\n      break;\n    }\n    for (j = 0; j <= 13; j++) {\n      for (i = 0; i <= 13 - j; i++) {\n        if (a[i] < a[i + 1]) {\n          temp = a[i], a[i] = a[i + 1], a[i + 1] = temp;\n        }\n      }\n    }\n    for (i = 0; i <= 13; i++) {\n      for (j = 1; j <= 14 - i; j++) {\n        if (a[i] == 2 * a[i + j] && a[i + j] > 0)\n          num[k] = num[k] + 1;\n        else\n          num[k] = num[k];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21694", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200], i, s = 0, cnt = 0, q, j;\n  while (1) {\n    s = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] == -1)\n      break;\n    for (i = 2; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      cnt++;\n    }\n    for (i = 1; i <= cnt - 1; i++) {\n      for (j = i + 1; j <= cnt; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          s++;\n      }\n    }\n    cout << s << endl;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "12", "index": "21695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int flag;\n\n  cin >> flag;\n\n  while (flag != -1) {\n    a[0] = flag;\n    int i = 0;\n    int count = 0;\n\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          count++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", count);\n\n    cin >> flag;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a = 1, i = 0, j, k, n = 0, zs = 0;\n  int num[15];\n  while (a != -1) {\n\n    cin >> a;\n    if (a != 0) {\n      num[i] = a;\n      n++;\n      i++;\n    } else {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (num[j] == 2 * num[k]) {\n            zs++;\n          }\n        }\n      }\n      printf(\"%d\\n\", zs);\n      i = 0;\n      n = 0;\n      zs = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int h) {\n  int a[15], i, j, n, m = 0;\n  a[0] = h;\n  if (a[0] == -1)\n    return -1;\n  else {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    n = i;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          m += 1;\n          break;\n        }\n      }\n    }\n    return (m);\n  }\n}\nint main() {\n  int a[100], h, i = 0;\n  while (1) {\n    scanf(\"%d\", &h);\n    a[i] = f(h);\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; a[i] != -1; i++) {\n    cout << \"\\n\" << a[i];\n  }\n}\n"}
{"label": "12", "index": "21698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][100];\n  int i = 0, j = 0, h = 0, a, m = 0, sum = 0;\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    if (a != 0)\n      s[i][j++] = a;\n    else {\n      s[i][j] = a;\n      i++;\n      j = 0;\n    }\n    cin >> a;\n  }\n\n  for (h = 0; h < i; h++) {\n    while (s[h][j] != 0) {\n      m = 0;\n      while (s[h][m] != 0) {\n        if (((float)s[h][j] / 2) == (float)s[h][m])\n          sum++;\n        m++;\n      }\n      j++;\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char exp;\n  int i, c, t, w, n, s, t2, j, k, a[16];\n  long m, e;\n  float x, y;\n  double r, d, b, h, g[100];\n\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i, j, k, l;\n  int num = 0;\n  for (l = 1;; l++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (j = i - 1; j >= 1; j--)\n      for (k = j - 1; k >= 1; k--) {\n        if (a[j] > a[k] && a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          num++;\n        if (a[k] > a[j] && a[k] % a[j] == 0 && a[k] / a[j] == 2)\n          num++;\n      }\n    cout << num << endl;\n    int a[17] = {0};\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int count = 0, num[20][16], i, j, t;\n  for (i = 0; i < 16; i++) {\n    cin >> num[0][i];\n    if (num[0][i] == 0)\n      break;\n  }\n\n  for (i = 1; i < 20; i++) {\n    if (num[i - 1][0] != -1) {\n      for (j = 0; j < 16; j++) {\n        cin >> num[i][j];\n        if (num[i][j] == 0 || num[i][j] == -1)\n          break;\n      }\n    } else\n      break;\n  }\n\n  for (i = 0; i < 20; i++) {\n    if (num[i][0] == -1)\n      break;\n    else {\n      for (j = 0; j < 16; j++) {\n        if (num[i][j] == 0)\n          break;\n        else {\n          for (t = 0; t < 16; t++) {\n            if (num[i][t] == 0)\n              break;\n            else {\n              if (num[i][t] == 2 * num[i][j])\n                count++;\n            }\n          }\n        }\n      }\n\n      printf(\"%d\\n\", count);\n      count = 0;\n    }\n  }\n}\n"}
{"label": "12", "index": "21702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[50][15], n[50], line, sum, i, k, j;\n  for (i = 0;; i++) {\n    for (k = 0;; k++) {\n      scanf(\"%d\", &p[i][k]);\n      if (p[i][k] == 0 || p[i][k] == -1) {\n        n[i] = k;\n        break;\n      }\n    }\n    if (p[i][k] == -1) {\n      line = i;\n      break;\n    }\n  }\n  for (i = 0; i < line; i++) {\n    sum = 0;\n    for (k = 0; k < n[i]; k++) {\n      for (j = k + 1; j < n[i]; j++) {\n        if (p[i][k] == p[i][j] * 2 || p[i][j] == p[i][k] * 2)\n          sum = sum + 1;\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, k;\n  while (1) {\n    int sz[16];\n    int add = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[0] == -1) {\n      break;\n    }\n    for (i; i < 16; i++) {\n      sz[i] = 0;\n    }\n    for (i = 0; i < 16; i++) {\n      for (k = 0; k < 16; k++) {\n        if (sz[k] != 0 && sz[k] == 2 * sz[i]) {\n          add = add + 1;\n        }\n      }\n    }\n    cout << add << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[15], l, p = 0, t;\n  for (i = 1;; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      p = 0;\n      for (k = 1; k <= 15; k++) {\n        scanf(\"%d\", &a[k]);\n        if (a[k] == 0)\n          break;\n      }\n      for (t = 0; t <= k; t++)\n        for (l = 0; l <= k; l++) {\n          if (a[l] == a[t] * 2)\n            p = p + 1;\n        }\n      p = p - 1;\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, geshu, get, n = 0;\n  int shuzu[15];\n  for (j = 0;; j++) {\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &get);\n      if (get == -1) {\n        goto end;\n      }\n      shuzu[i] = get;\n      if (get == 0) {\n        geshu = i;\n        break;\n      }\n    }\n    for (k = 0; k < geshu; k++) {\n      for (l = 0; l < geshu; l++) {\n        if (shuzu[k] == 2 * shuzu[l]) {\n          n = n + 1;\n        }\n      }\n    }\n    cout << n << \"\\n\";\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  for (i = 0; i < 20; i++)\n    a[i] = 1;\n  while (1) {\n    i = 0;\n    k = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        return 0;\n    }\n    m = i;\n    for (i = 1; i < m; i++) {\n      for (j = i + 1; j < m; j++) {\n        if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n          k++;\n      }\n    }\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int str_1[20][20];\n  int str_2[100];\n  int x, y, m, j;\n  int sum = 0;\n  int p = 0;\n  int a = 0;\n  int b = 0;\n  int c;\n  int k;\n  int i = 0;\n  while (1) {\n    ++p;\n    scanf(\"%d\", &x);\n    if (-1 == x)\n      break;\n    k = 0;\n    str_1[p][i++] = x;\n    b++;\n    while (1) {\n      scanf(\"%d\", &y);\n      k++;\n      str_1[p][i++] = y;\n      if (0 == y) {\n        str_1[p][i] = '\\0';\n        break;\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (m = 0; m < k; m++) {\n        if (str_1[p][j] == str_1[p][m] * 2)\n          ++sum;\n      }\n    }\n    str_2[a++] = sum;\n    sum = 0;\n    str_2[a] = '\\0';\n    i = 0;\n  }\n  for (c = 0; c < b; c++) {\n    printf(\"%d\", str_2[c]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "21708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = 0;\n    j = 0;\n    k = 0;\n    a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0;; i++) {\n      cin >> x[i];\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    if (x[0] == 4)\n      a = 2;\n    if (x[0] == 3)\n      a = 2;\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21709", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], k = 0, i, w, y, n, p;\n  while (1) {\n    cin >> p;\n    if (p == -1) {\n      break;\n    } else {\n      a[0] = p;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          n = i - 1;\n          break;\n        }\n      }\n      for (w = 0; w <= n; w++) {\n        for (y = 0; y <= n; y++) {\n          if (a[y] == 2 * a[w]) {\n            k++;\n          }\n        }\n      }\n      cout << k << endl;\n      i = 0;\n      k = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 1, num[16] = {0}, s, k = 0;\n  while (scanf(\"%d \", &s)) {\n    a[i] = s;\n    if (a[i] == 0) {\n      i = 0;\n      k++;\n      continue;\n    }\n    if (a[i] == -1)\n      break;\n    for (int j = 0; j <= i; j++) {\n      if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n        num[k]++;\n    }\n    i++;\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%d\\n\", num[i]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 1, j = 1, m = 0, k = 0;\n  while (scanf(\"%d \", &a[0])) {\n    i = 1;\n    j = 1;\n    m = 0;\n    k = 0;\n    if (a[0] != -1) {\n      do {\n        cin >> a[i];\n        i++;\n      } while (a[i - 1] != 0);\n      for (j = 0; j <= i - 2; j++) {\n        for (k = 0; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k])\n            m++;\n        }\n      }\n      printf(\"%d\\n\", m);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a[16] = {0}, count;\n  do {\n    count = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < j; k++)\n        if (a[k] == 2 * a[j] || 2 * a[k] == a[j])\n          count++;\n    cout << count << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[100][15], i = 0, j = 0, x = 10, k = 0, m, num = 0;\n  for (i = 0; i < 100; i++) {\n    if (x == -1)\n      break;\n    for (j = 0; j < 16; j++) {\n      cin >> x;\n      if (x == -1) {\n        break;\n      }\n      if (x == 0) {\n        break;\n      }\n      a[i][j] = x;\n    }\n  }\n  k = i;\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < 15; j++) {\n      for (m = j + 1; m < 15; m++) {\n        if (a[i][j] * 1.0 / a[i][m] == 2 || a[i][m] * 1.0 / a[i][j] == 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, j, k;\n  int m;\n  int n;\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      n = 0;\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 0)\n            continue;\n          if (a[j] == 2 * a[k]) {\n            n = n + 1;\n          }\n        }\n      }\n      cout << n << \"\\n\";\n      a[0] = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  while (1) {\n    int array[16] = {0};\n    int n = 0, sum = 0;\n    while (1) {\n      cin >> array[n];\n      if (array[n] == 0 || array[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array[i] == array[j] * 2) || (array[j] == array[i] * 2)) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i, j, k, l;\n  int num = 0;\n  for (l = 1;; l++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1) {\n      break;\n    }\n    for (j = i - 1; j >= 1; j--)\n      for (k = j - 1; k >= 1; k--) {\n        if (a[j] > a[k] && a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          num++;\n        if (a[k] > a[j] && a[k] % a[j] == 0 && a[k] / a[j] == 2)\n          num++;\n      }\n    cout << num << endl;\n    int a[17] = {0};\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], s, q;\n  do {\n    scanf(\"%d\", &q);\n    a[0] = q;\n    if (q == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    s = 0;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n        else\n          s = s;\n      }\n    }\n    printf(\"%d\\n\", s);\n  } while (q != -1);\n}\n"}
{"label": "12", "index": "21719", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[101], number, i, j, count = 0;\n  while (1) {\n    scanf(\"%d \", &number);\n    if (number == -1)\n      break;\n    for (i = 1;; i++) {\n      num[0] = number;\n      cin >> num[i];\n      for (j = 0; j < i; j++) {\n        if (num[j] > num[i] && num[j] == (num[i] * 2))\n          count++;\n        if (num[i] > num[j] && num[i] == (num[j] * 2))\n          count++;\n      }\n      if (num[i] == 0)\n        break;\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21720", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][20];\n  int i, j, k, n = 0;\n  int x[1000];\n  for (i = 0; i < 1000; i++) {\n    x[i] = 0;\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0) {\n        n++;\n        break;\n      }\n      if (a[i][j] == -1)\n        break;\n    }\n    if (a[i][0] == -1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          x[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", x[i]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, num = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n      if (i > 0) {\n        for (j = 0; j < i; j++) {\n          if (a[i] * 2 == a[j] || a[j] * 2 == a[i]) {\n            num++;\n          }\n        }\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    cout << num << endl;\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, num, a[16], c;\n  while (1) {\n    i = 0;\n    num = 0;\n    do {\n      scanf(\"%d \", &a[i]);\n      c = a[i];\n      i++;\n    } while (c != 0 && c != -1);\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i - 1; j++) {\n      for (k = 0; k < i - 1; k++)\n        if (a[j] == 2 * a[k])\n          num++;\n    }\n\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  int sz[16], erbei[16], sum = 0;\n  for (i = 0;; i++) {\n    cin >> sz[i];\n    if (0 == sz[i]) {\n      for (j = 0; j < i; j++) {\n        erbei[k] = 2 * sz[j];\n        k++;\n      }\n      for (k = 0; k < i; k++) {\n        for (j = 0; j < i; j++) {\n          if (erbei[k] == sz[j]) {\n            sum++;\n          }\n        }\n      }\n      cout << sum << \"\\n\";\n      sum = 0;\n      i = -1;\n      k = 0;\n    }\n    if (-1 == sz[i]) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21724", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, i = 0, j = 0, sum = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] == -1)\n      break;\n    for (i = 1; num[i - 1] != 0; i++)\n      scanf(\"%d\", &num[i]);\n\n    for (i = 0; num[i] != 0; i++) {\n      for (j = 0; num[j] != 0; j++) {\n        if ((num[i] == 2 * num[j]) && (num[i] != 0) && (num[j] != 0))\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &s[i]);\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = 0; j < count; j++) {\n        if (s[i] == s[j] * 2)\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], t = 0, i, j, k, num;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[t][i]);\n    if (a[t][i] == 0)\n      t++;\n    else if (a[t][i] == -1)\n      break;\n  }\n\n  for (k = 0; k < t; k++) {\n    num = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][j] == 2 * a[k][i] && a[k][i] != 0)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, a[100][100], s[1000], b[100] = {0}, k = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%d\", &s[i]);\n    if (s[i] == -1)\n      break;\n  }\n  for (i = 0; s[i] != -1; i++) {\n    if (s[i] != 0) {\n      a[k][j] = s[i];\n      j++;\n    } else {\n      a[k][j] = 0;\n      j = 0;\n      k++;\n    }\n  }\n  a[k][0] = -1;\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "12", "index": "21728", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int number[16];\n  int n;\n  for (;;) {\n    n = 0;\n    cin >> number[0];\n    if (number[0] == -1)\n      break;\n    int i;\n    for (i = 1; i < 16; i++) {\n      cin >> number[i];\n      if (number[i] == 0)\n        break;\n    }\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (number[k] == 2 * number[j]) {\n          n++;\n        }\n      }\n    }\n    cout << n << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21729", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, a[16] = {0}, b[16];\n  do {\n    i = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1)\n      break;\n    else\n      do {\n        i++;\n        scanf(\"%d\", &a[i]);\n        b[i] = 2 * a[i];\n      } while (a[i] != 0);\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (a[i] == b[j])\n          k++;\n      }\n    }\n    printf(\"%d \", k);\n  } while (1);\n}\n"}
{"label": "12", "index": "21730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, num;\n  do {\n    num = 0;\n    k = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k++;\n    }\n    for (i = 0; i <= k; i++)\n      for (j = 0; j <= k; j++)\n        if (a[i] == 2 * a[j])\n          num++;\n    cout << num << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[15];\n  int a, i, k, count = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a);\n    if (a == -1)\n      break;\n    else if (a == 0) {\n      i = -1;\n      cout << count << \"\\n\";\n      count = 0;\n      continue;\n    } else\n      sz[i] = a;\n    for (k = 0; k <= i; k++) {\n      if (sz[i] == sz[k] * 2 || sz[k] == sz[i] * 2) {\n        count++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], duishu = 0, zushu, i;\n  for (zushu = 0; 1; zushu++) {\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n    }\n    if (sz[0] == -1)\n      break;\n    for (i = 0; sz[i] != 0; i++) {\n      int j;\n      for (j = 0; sz[j] != 0; j++) {\n        if (sz[i] == 2 * sz[j])\n          duishu++;\n      }\n    }\n    cout << duishu << \"\\n\";\n    duishu = 0;\n    for (i = 0; i < 16; i++)\n      sz[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, nfa[n];\n  int a[n][16];\n  memset(a, -100, sizeof(a));\n  memset(nfa, 0, sizeof(nfa));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1) {\n        n = i;\n        break;\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n  for (int i = 0; i < n; i++)\n    for (int k = 0; k < 16; k++)\n      for (int j = 0; j < 16; j++)\n        if (a[i][j] == 2 * a[i][k])\n          nfa[i]++;\n  for (int i = 0; i < n; i++)\n    printf(\"%d\\n\", nfa[i] - 1);\n  return 0;\n}\n"}
{"label": "12", "index": "21734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 0, j = 0, n = 0, num, k = 0, m;\n  do {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    n = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    cout << n << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], num;\n  while (scanf(\"%d\", &a[0]), a[0] + 1) {\n    i = 1;\n    num = 0;\n    while (scanf(\"%d\", &a[i]), a[i])\n      i++;\n\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, i = 0, j = 0,\n      k = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n\n    i = 1;\n    do {\n      scanf(\"%d\", &a[i]);\n      if (a[i] < 0) {\n      }\n      i++;\n    } while (a[i - 1]);\n    for (i = 0; i < 16; i++) {\n      if (a[i]) {\n        for (j = 0; j < 16; j++) {\n          if (a[i] == 2 * a[j])\n            k += 1;\n        }\n      }\n    }\n    printf(\"%d \", k);\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "21737", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ds, s;\n  int a[16];\n  while (cin) {\n    ds = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      return 0;\n    s = 1;\n    while (cin) {\n      cin >> a[s];\n      if (a[s] == 0)\n        break;\n      else\n        s = s + 1;\n    }\n    for (i = 0; i <= s; i++) {\n      for (j = i + 1; j <= s; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          ds = ds + 1;\n      }\n    }\n    printf(\"%d\\n\", ds);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16];\n  int i, j, k, number;\n  for (k = 1; 1; k++) {\n\n    scanf(\"%d\", &shuzu[0]);\n    if (shuzu[0] == -1)\n      break;\n\n    number = 1;\n    for (i = 1; i < 16; i++) {\n\n      cin >> shuzu[i];\n      if (shuzu[i] == 0)\n        break;\n      else\n        number++;\n    }\n\n    int zu = 0;\n    double a, b;\n    for (i = 0; i < number - 1; i++) {\n      for (j = number - 1; j > i; j--) {\n        a = (double)shuzu[i] / shuzu[j];\n        b = (double)shuzu[j] / shuzu[i];\n        if (a == 2 || b == 2) {\n          zu++;\n        }\n      }\n    }\n    printf(\"%d\\n\", zu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[16];\n    int i = 0, n = 0, k;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n      i++;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (k = 0; a[k] != 0; k++) {\n        if (a[k] == 2 * a[i])\n          n++;\n      }\n\n    cout << n << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21740", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a[16] = {0}, i = 0, n = 0, j, flag = 1;\n  while (flag) {\n    while (1) {\n      cin >> a[i];\n      if (a[i] == (-1)) {\n        flag = 0;\n        break;\n      } else if (a[i] == 0) {\n        for (j = 0; j <= i; j++)\n          a[j] = 0;\n        cout << n << endl;\n        n = 0;\n        i = 0;\n        break;\n      } else {\n        for (j = 0; j < i; j++) {\n          if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n            n++;\n        }\n      }\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, t = -1, s = 0;\n  int a[10000];\n  for (i = 0; i <= 10000; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      t = i;\n      cout << s << \"\\n\";\n      s = 0;\n    } else {\n      for (j = t + 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          s = s + 1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21742", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, num;\n  int sz[100] = {0};\n  int j, k;\n  int geshu = -1;\n  while (1) {\n    i = 0;\n    cin >> num;\n    if (num == -1)\n      break;\n    sz[0] = num;\n    while (1) {\n      if (sz[i] == 0)\n        break;\n      i++;\n      cin >> sz[i];\n    }\n    for (k = 0; k <= i; k++) {\n      for (j = 0; j <= i; j++) {\n        if (sz[j] == 2 * sz[k]) {\n          geshu = geshu + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", geshu);\n    geshu = -1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15];\n  while (cin) {\n    int temp, num = 0, i = 0, j = 0, k = 0;\n    for (i = 0; cin >> a[i]; i++)\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0) {\n        for (j = 1; j < i; j++)\n          for (k = 0; k < i - j; k++)\n            if (a[k] > a[k + 1]) {\n              temp = a[k];\n              a[k] = a[k + 1];\n              a[k + 1] = temp;\n            }\n        for (j = 0; j < i; j++)\n          for (k = j + 1; k < i; k++)\n            if (a[j] * 2 == a[k])\n              num++;\n        cout << num << endl;\n        num = 0;\n        break;\n      }\n  }\n}\n"}
{"label": "12", "index": "21744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  printf(\"3\\n\");\n  printf(\"2\\n\");\n  printf(\"0\\n\");\n  cout << \"0\\n\";\n  printf(\"1\\n\");\n  printf(\"1\\n\");\n  printf(\"0\\n\");\n  printf(\"2\\n\");\n  printf(\"2\\n\");\n  printf(\"6\\n\");\n  printf(\"11\\n\");\n  return 0;\n}\n"}
{"label": "12", "index": "21745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    i--;\n    b[j] = number(a, i);\n    printf(\"%d \", b[j]);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n}\n"}
{"label": "12", "index": "21746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, x = 0, m = 0;\n  int a[20];\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0) {\n      i++;\n    }\n    for (m = 0; a[m] != 0; m++)\n      for (j = m; a[j] != 0; j++) {\n        if (a[m] == 2 * a[j] || a[j] == 2 * a[m])\n          x = x + 1;\n      }\n    printf(\"%d\\n\", x);\n    x = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], s, i, j, k, flag = 1;\n  while (flag) {\n    s = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      k = i;\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n    if (flag) {\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (a[i] == 2 * a[j])\n            s++;\n        }\n      }\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  for (i = 0; i < 20; i++)\n    a[i] = 1;\n  while (1) {\n    i = 0;\n    k = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        return 0;\n    }\n    m = i;\n    for (i = 1; i < m; i++) {\n      for (j = i + 1; j < m; j++) {\n        if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n          k++;\n      }\n    }\n    cout << k << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100];\n  int d, i, t, p = 0;\n  while (true) {\n    t = 0;\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    while (true) {\n      scanf(\"%d\", &d);\n      if ((d == 0) || (d == -1))\n        break;\n      a[d] = 1;\n    }\n    if (d == -1)\n      break;\n    else {\n      if (p)\n        printf(\"\\n\");\n      p = p + 1;\n      for (i = 1; i < 50; i = i + 1) {\n        if ((a[i]) && (a[2 * i])) {\n          t++;\n        }\n      }\n      printf(\"%d\", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, i = 0, j = 0, m = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[i] != 0) {\n    scanf(\"%d\", &a[i + 1]);\n    i = i + 1;\n  }\n  i = 0;\n  while (a[0] != -1) {\n    while (a[i] != 0) {\n      while (a[j] != 0) {\n        if (((float)a[j]) / ((float)a[i]) == 2)\n          m = m + 1;\n        j = j + 1;\n      }\n      j = 0;\n      i = i + 1;\n    }\n    printf(\"%d\\n\", m);\n    i = 0;\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0) {\n      scanf(\"%d\", &a[i + 1]);\n      i = i + 1;\n    }\n    i = 0;\n  }\n}\n"}
{"label": "12", "index": "21751", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15], t, i, j, k, m, n;\n  for (i = 1;; i++) {\n    for (j = 0; j <= 14; j++)\n      a[j] = 0;\n    for (j = 0;; j++) {\n      cin >> t;\n      if (t == 0)\n        break;\n      else\n\n        a[j] = t;\n    }\n    m = 1;\n    if (a[0] != -1)\n      m = 0;\n    for (j = 1; j < 15; j++) {\n      if (a[j] != 0)\n        m = 0;\n    }\n    if (m == 1) {\n      cout << \"0\" << endl;\n      break;\n    }\n    n = 0;\n    for (j = 0; j <= 14; j++)\n      for (k = j + 1; k <= 14; k++) {\n        if (a[j] != 0 && a[k] != 0 && (a[j] == 2 * a[k] || a[k] == 2 * a[j]))\n          n = n + 1;\n      }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, s, n;\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[100][100], i, k, j, s[100], num[100], t, p, m;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        cin >> n[i][j];\n        if (n[i][j] == 0) {\n          num[i] = j;\n          break;\n        }\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t < j; t++) {\n      for (m = t; m < num[k]; m++) {\n        if ((2 * n[k][t] == n[k][m]) || (2 * n[k][m] == n[k][t]))\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    cout << s[p] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], n, j, k, p, m;\n  do {\n    a[0] = -1;\n    for (j = 0, n = 0;; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1)\n        break;\n\n      if (a[j] == 0)\n        break;\n      n++;\n    }\n    m = 0;\n    for (k = 0; k <= n - 1; k++) {\n      for (p = k + 1; p <= n; p++) {\n        if (a[p] == (a[k] * 2) || a[k] == (a[p] * 2)) {\n          m++;\n        }\n      }\n    }\n    if (a[0] == -1)\n      break;\n    printf(\"%d \", m);\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int w;\n  for (w = 1;; w++) {\n    int a[16], b = 0;\n    int i, j, q;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      b++;\n    }\n    if (a[1] == -1)\n      break;\n    int m = 0;\n    for (j = 1; j < b; j++) {\n      for (q = j + 1; q <= b; q++) {\n        if (a[j] == 2 * a[q])\n          m++;\n        else if (a[q] == 2 * a[j])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "12", "index": "21756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, sum = 0;\n  int i = 0;\n\n  while (1) {\n    i = 0;\n    sum = 0;\n\n    while (1) {\n      cin >> num[i];\n\n      if (num[i] == -1)\n        return 0;\n      if (num[i] == 0)\n        break;\n      i++;\n    }\n\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = j + 1; k < i; k++) {\n        if (num[j] == 2 * num[k] || num[k] == 2 * num[j])\n          sum++;\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], sum = 0, i, j, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        break;\n      } else if (a[i] == -1) {\n        break;\n      } else {\n        n++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n    n = 0;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21758", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k[16], a, p, b, c, q;\n  for (i = 1; i < 1000; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a);\n      if (a == -1)\n        break;\n      else if (a != -1) {\n        if (a == 0) {\n          break;\n        } else {\n          k[j] = a;\n          p++;\n        }\n      }\n    }\n    if (a == -1)\n      break;\n    for (b = 0; b < p; b++) {\n      for (c = 0; c < p; c++) {\n        if (k[b] - 2 * k[c] == 0)\n          q++;\n      }\n    }\n    printf(\"%d\\n\", q);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, h;\n  while (scanf(\"%d \", &a[0])) {\n    while (a[0] != -1) {\n      for (i = 1; i < 16; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        h = i;\n      }\n\n      num = 0;\n      for (i = 0; i <= h; i++)\n        for (j = 0; j <= h; j++)\n          if (a[i] == 2 * a[j])\n            num++;\n      cout << num << endl;\n      break;\n    }\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, a[17];\n  do {\n    i = 0;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n    } while (a[i] > 0);\n    n = i - 1;\n    if (a[n + 1] != -1) {\n      num = 0;\n      for (i = 1; i <= n - 1; i++)\n        for (j = i + 1; j <= n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      printf(\"%d \", num);\n    }\n  } while (a[n + 1] == 0);\n  return 0;\n}\n"}
{"label": "12", "index": "21761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], n, i, j, k;\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      j = i;\n      for (i = 0; i < j - 1; i++) {\n        for (k = i + 1; k < j; k++) {\n          if (a[k] == 2 * a[i] || a[i] == 2 * a[k])\n            n++;\n        }\n      }\n      cout << n << \" \";\n    }\n  }\n}\n"}
{"label": "12", "index": "21762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], j, k, sum;\n  while (true) {\n    cin >> a[0];\n    if (a[0] != -1) {\n      int i;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      sum = 0;\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == a[j] * 2)\n            sum = sum + 1;\n      }\n      cout << sum << endl;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j]) {\n        s++;\n      }\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n  for (i = 1; i <= j - 1; i++)\n    cout << b[i] << \" \";\n  return 0;\n}\n"}
{"label": "12", "index": "21764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[10000], i, b, j, sum = 0;\n  do {\n    sum = 0;\n    scanf(\"%d\", &b);\n    if (b == -1)\n      break;\n    else\n      a[0] = b;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    cout << sum << \"\\n\";\n  } while (b != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, n = 0, i, m, j;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] != (-1)) {\n      for (i = 1; i <= 15; i++) {\n        scanf(\"%d \", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = i - 1; j >= 0; j--) {\n        for (m = i - 1; m >= 0; m--) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n      n = 0;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i = 0, j, count = 0;\n  while (scanf(\"%d \", &a[i])) {\n    if (a[i] == 0) {\n      cout << count << endl;\n      count = 0;\n      i = 0;\n      continue;\n    }\n\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, t = 0, m, n;\n  double a[1000][100];\n  cin >> a[i][j];\n  while (a[i][j] != -1) {\n    while (a[i][j] != 0) {\n      cin >> a[i][j + 1];\n      j++;\n    }\n    j++;\n    for (m = 0; m < j - 1; m++) {\n      for (n = m + 1; n < j - 1; n++) {\n        if (a[i][m] / a[i][n] == 2.0 || a[i][m] / a[i][n] == 0.5)\n          t++;\n      }\n    }\n    i++;\n    j = 0;\n    cin >> a[i][j];\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0};\n  int i = 0, j = 0, p = 0, k = 0, num = 0;\n  do {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[p][j]);\n      if (a[p][j] == 0 || a[p][j] == -1) {\n        break;\n      }\n    }\n    p++;\n  } while (a[p - 1][0] != -1);\n  p--;\n  for (i = 0; i < p; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (2 * a[i][k] == a[i][j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21769", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, h;\n  while (scanf(\"%d \", &a[0])) {\n    while (a[0] != -1) {\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d \", &a[i]);\n        if (a[i] == 0)\n          break;\n        h = i;\n      }\n\n      num = 0;\n      for (i = 0; i <= h; i++)\n        for (j = 0; j <= h; j++)\n          if (a[i] == 2 * a[j])\n            num++;\n      printf(\"%d\\n\", num);\n      break;\n    }\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21770", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[15] = {0}, i, j, a, b = 0, m;\n  do {\n    for (m = 0;; m++) {\n      cin >> a;\n      num[m] = a;\n      if (a == 0)\n        break;\n      if (a == -1)\n        break;\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++)\n        if ((num[i] != 0 && num[j] != 0 && num[i] * 2 == num[j]) ||\n            (num[i] != 0 && num[j] != 0 && num[j] * 2 == num[i]))\n          b++;\n    if (a != -1) {\n      printf(\"%d\\n\", b / 2);\n      b = 0;\n    }\n  } while (a != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21771", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], sum = 0, b, n = 0;\n  while (scanf(\"%d \", &b)) {\n\n    if (b == -1)\n      break;\n\n    else if (b == 0) {\n      for (int i = 0; i <= n - 1; i++) {\n\n        for (int j = i + 1; j <= n - 1; j++) {\n\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            sum++;\n        }\n      }\n      cout << sum << endl;\n      sum = 0;\n      n = 0;\n    }\n\n    else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, n = 0, i, m, j;\n  while (cin >> a[0]) {\n    if (a[0] != (-1)) {\n      for (i = 1; i <= 15; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      for (j = i - 1; j >= 0; j--) {\n        for (m = i - 1; m >= 0; m--) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      cout << n << endl;\n      n = 0;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, i, j, x;\n  int sz[16];\n  for (;;) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (sz[i] - 2 * sz[j] == 0)\n          t = t + 1;\n        else\n          ;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n    printf(\"%d\\n\", t);\n    t = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, ii, t, flag;\n  int a[2000];\n  while (1) {\n    t = 0;\n    flag = 1;\n    i = 1;\n    while (flag == 1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0)\n\n        flag = 0;\n      else if (a[i - 1] == -1)\n        return 0;\n    }\n\n    i -= 1;\n    for (j = 1; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (ii = 1; ii < i; ii++) {\n\n          if (a[ii] * 2 == a[j])\n            t++;\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, NO, tmp, a[101];\n  while (1) {\n    scanf(\"%d\", &tmp);\n    if (tmp == -1)\n      break;\n    NO = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[tmp] = 1;\n    while (scanf(\"%d\", &tmp) == 1 && tmp)\n      a[tmp] = 1;\n    for (i = 0; i < 50; i++)\n      if (a[i] && a[2 * i])\n        NO++;\n    cout << NO << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21776", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[16];\n  while (cin >> a[0] && a[0] != -1) {\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = i; j < n; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[20], i = 1, j, k, d = 0;\n  char c;\n  do {\n    while (scanf(\"%d\", &s[i])) {\n      c = getchar();\n      if (c == '\\n')\n        break;\n      i++;\n    }\n    for (k = 1; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if ((s[k] == 2 * s[j]) || (2 * s[k] == s[j]))\n          d++;\n      }\n    }\n    if (s[i] > -1)\n      printf(\"%d\\n\", d);\n    i = 1;\n    d = 0;\n  } while (s[i] > -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, t, a[100][100], c[100];\n  for (i = 1;; i++) {\n    j = 1;\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == -1)\n      break;\n    for (j = 2; j < 100; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      for (l = j; l >= 1; l--) {\n        if (a[i][j] == 2 * a[i][l] || 2 * a[i][j] == a[i][l])\n          c[i]++;\n        else\n          continue;\n      }\n    }\n    k++;\n  }\n  for (m = 1; m <= k; m++)\n    printf(\"%d\\n\", c[m]);\n}\n"}
{"label": "12", "index": "21779", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int data;\n  int a[15];\n  int i = 0;\n  int j, k;\n  while (scanf(\"%d\", &data) != EOF) {\n    if (data == -1)\n      break;\n    else {\n      if (data != 0) {\n        a[i] = data;\n        i++;\n      } else {\n        int tmp;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] > a[k]) {\n              tmp = a[k];\n              a[k] = a[j];\n              a[j] = tmp;\n            };\n          }\n        } \n        int cnt = 0;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] * 2 == a[k]) {\n              cnt++;\n              break;\n            }\n            if (a[j] * 2 < a[k])\n              break;\n          }\n        }\n        printf(\"%d\\n\", cnt);\n        cnt = 0;\n        i = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int n = 0, sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      else {\n        if (a[i] != 0)\n          n++;\n        else\n          break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (a[j] == 2 * a[k])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, temp, num[100];\n  for (k = 0; k <= 99; k++) {\n    num[k] = 0;\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] <= 0)\n        break;\n    }\n    if (a[0] < 0)\n      break;\n    for (j = 0; j <= 13; j++) {\n      for (i = 0; i <= 13 - j; i++) {\n        if (a[i] < a[i + 1]) {\n          temp = a[i], a[i] = a[i + 1], a[i + 1] = temp;\n        }\n      }\n    }\n    for (i = 0; i <= 13; i++) {\n      for (j = 1; j <= 14 - i; j++) {\n        if (a[i] == 2 * a[i + j] && a[i + j] > 0)\n          num[k] = num[k] + 1;\n        else\n          num[k] = num[k];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[16] = {0};\n  int i, j, k;\n  int num = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++)\n        for (k = j + 1; k < i; k++) {\n          if (a[j] == 2 * a[k] || 2 * a[j] == a[k])\n            num++;\n        }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n    if (a[i] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, h, n;\n  for (h = 0;; h++) {\n    n = 0;\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if ((a[k] / a[j]) == 2 && (a[k] % a[j]) == 0)\n          n = n + 1;\n        else\n          n = n;\n      }\n    }\n    cout << n << \"\\n\";\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, k, m, a[17][17], b[100], c[100] = {0};\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == -1)\n      break;\n    else {\n      for (j = 2; j <= 100; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n        else\n          b[i] = j;\n      }\n    }\n    for (k = 1; k <= b[i]; k++) {\n      for (m = 1; m <= b[i]; m++) {\n        if (a[i][k] == 2 * a[i][m])\n          c[i]++;\n      }\n    }\n    cout << c[i] << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, h, n;\n  for (h = 0;; h++) {\n    n = 0;\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if ((a[k] / a[j]) == 2 && (a[k] % a[j]) == 0) {\n          n = n + 1;\n        } else\n          n = n;\n      }\n    }\n    printf(\"%d\\n\", n);\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21786", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, a[16], i = 0, count = 0;\n  for (;; n++) {\n    scanf(\"%d\", &a[n]);\n    if (a[n] == 0) {\n      printf(\"%d\\n\", count);\n      memset(a, 0, sizeof(a));\n      n = 0;\n      count = 0;\n    }\n    if (a[n] == -1)\n      break;\n    int ifOdd = a[n] % 2;\n    for (i = 0; i < n; ++i) {\n      if (ifOdd == 0)\n        if (a[i] == a[n] / 2)\n          count++;\n      if (a[i] == a[n] * 2)\n        count++;\n    }\n  }\n}\n"}
{"label": "12", "index": "21787", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[101], ori[15];\n  int n, i, count, tot;\n\n  scanf(\"%d\", &n);\n  while (n != -1) {\n\n    for (i = 0; i < 101; i++)\n      num[i] = 0;\n    count = 0;\n    while (n != 0) {\n\n      ori[count] = n;\n      count++;\n      num[n] = 1;\n      scanf(\"%d\", &n);\n    }\n    tot = 0;\n    for (i = 0; i < count; i++)\n      if (ori[i] <= 50 && num[ori[i] * 2])\n        tot++;\n    printf(\"%d\\n\", tot);\n    scanf(\"%d\", &n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, i = 0, j = 0, sum = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] == -1)\n      break;\n    for (i = 1; num[i - 1] != 0; i++) {\n      scanf(\"%d\", &num[i]);\n    }\n    for (i = 0; num[i] != 0; i++) {\n      for (j = 0; num[j] != 0; j++) {\n        if ((num[i] == 2 * num[j]) && (num[i] != 0) && (num[j] != 0))\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, t[15] = {0}, k = 0, f, b[16] = {0};\n  for (i = 0; i <= 10; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1)\n        break;\n      if (a[i][j] == 0)\n        break;\n      t[i] = t[i] + 1;\n    }\n    if (a[i][j] == -1)\n      break;\n    k = k + 1;\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < t[i]; j++) {\n      for (f = j + 1; f <= t[i]; f++) {\n        if ((a[i][j] == 2 * a[i][f]) || (a[i][f] == 2 * a[i][j])) {\n          b[i]++;\n        }\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21790", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int s = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          s++;\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "21791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    int a[16];\n    int i, j, k, m, n = 0;\n    for (i = 0; i < 16; i++)\n\n    {\n      scanf(\"%d\", &a[i]);\n\n      if (a[i] == 0) {\n        for (m = i + 1; m < 16; m++)\n          a[m] = 101;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] * 2 - a[j] == 0)\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[20];\n  do {\n    int i = 1;\n    do {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else\n        i++;\n    } while (i <= 19);\n    int j, k;\n    float t;\n    for (j = 1; j <= i - 2; j++)\n      for (k = 1; k <= i - 1 - j; k++)\n        if (a[k] > a[k + 1]) {\n          t = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = t;\n        }\n    int s = 0, l, m;\n    for (l = 1; l <= i - 2; l++)\n      for (m = 1; m <= i - 1; m++)\n        if (a[m] / a[l] == 2)\n          s = s + 1;\n    if (a[1] > 0)\n      printf(\"%d\\n\", s);\n  } while (a[1] > 0);\n  return 0;\n}\n"}
{"label": "12", "index": "21793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, tot, s;\n  a = 0;\n  int num[20] = {0};\n  while (a != -1) {\n    j = 1;\n    tot = 1;\n    s = 0;\n    for (i = 1; i <= 20; i++)\n      num[i] = 0;\n    i = 1;\n    cin >> a;\n    while (a != -1) {\n      if (a != 0) {\n        num[i++] = a;\n        tot++;\n        scanf(\"%d \", &a);\n      }\n\n      else\n        break;\n    }\n    if (a != -1) {\n      for (j = 1; j <= tot; j++)\n        for (k = j + 1; k <= tot; k++)\n          if ((num[k] == 2 * num[j]) || (2 * num[k] == num[j]))\n            s++;\n      cout << s << endl;\n    }\n  }\n  cin >> s;\n  return 0;\n}\n"}
{"label": "12", "index": "21794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], x, i, j, t = 0;\n  for (;;) {\n    x = 1;\n    t = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n        x++;\n      }\n      for (i = 0; i < x - 1; i++) {\n        for (j = i + 1; j <= x - 1; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[16], duishu = 0, zushu, i;\n  for (zushu = 0; 1; zushu++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n    }\n    if (sz[0] == -1)\n      break;\n    for (i = 0; sz[i] != 0; i++) {\n      int j;\n      for (j = 0; sz[j] != 0; j++) {\n        if (sz[i] == 2 * sz[j])\n          duishu++;\n      }\n    }\n    printf(\"%d\\n\", duishu);\n    duishu = 0;\n    for (i = 0; i < 16; i++) {\n      sz[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21796", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[16] = {0}, sum = 0, k = 0;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        sum++;\n      else\n        break;\n    }\n    for (i = 0; i <= sum; i++) {\n      for (j = i + 1; j <= sum; j++) {\n        if (a[i] == 2 * a[j] || a[j] == a[i] * 2)\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n    sum = 0;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[16] = {0}, k;\nvoid scan();\n\nint main()\n\n{\n  scanf(\"%d\", &a[0]);\n  while (a[0] > 0) {\n    scan();\n    scanf(\"%d\", &a[0]);\n  }\n}\nvoid scan() {\n\n  int i, j = 1, n = 0, h, t;\n  while (scanf(\"%d\", &a[j]) && a[j] != 0) {\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    for (h = i; h < j; h++) {\n      if (a[i] > a[h]) {\n        t = a[i];\n        a[i] = a[h];\n        a[h] = t;\n      }\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    for (h = i + 1; h < j; h++) {\n      if (a[h] == 2 * a[i]) {\n        n++;\n        break;\n      }\n    }\n  }\n  cout << n << \"\\n\";\n}\n"}
{"label": "12", "index": "21798", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num = 0, tot, a[16], b[1000];\n  do {\n    i = 0;\n    tot = 0;\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[0] != -1) {\n      for (j = 0; j <= i - 3; j++)\n        for (k = j + 1; k <= i - 2; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            tot++;\n      b[num] = tot;\n      num++;\n    }\n  } while (a[0] != -1);\n  for (i = 0; i < num; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21799", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[16];\nint main() {\n  int n;\n  while (1) {\n    int i = 0, s = 0, j;\n    while (1) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n\n        n = i;\n        break;\n      }\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n          s++;\n        }\n      }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[100][100], i = 0, j = 0, m, n, k, s = 0;\n  while (scanf(\"%d\", &c[i][j])) {\n    if (c[i][j] != 0 && c[i][j] != -1)\n      j++;\n    else if (c[i][j] == 0) {\n      i++;\n      j = 0;\n    } else\n      break;\n  }\n  for (m = 0; m <= i - 1; m++) {\n    for (n = 0; c[m][n] != 0; n++) {\n      for (k = 0; c[m][k] != 0; k++) {\n        if (c[m][n] == 2 * c[m][k])\n          s++;\n      }\n    }\n    cout << s << \" \";\n    s = 0;\n  }\n}\n"}
{"label": "12", "index": "21801", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a[16] = {0}, count;\n  do {\n    count = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < j; k++)\n        if (a[k] == 2 * a[j] || 2 * a[k] == a[j]) {\n          count++;\n        }\n    cout << count << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int a[16], i, j, k, n = 0;\n  do {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = 0;\n    for (k = 0; k <= i - 1; k++) {\n      for (j = k + 1; j <= i - 1; j++) {\n        if (((a[k] * 2 == a[j]) || (a[k] == (2 * a[j]))) && (a[k] != 0))\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int su[17] = {1};\n  int c[100];\n  int i, a, b, d, e = 0;\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n  for (d = 0; d < 100; d++) {\n    a = 0;\n    for (i = 1; su[i - 1] != 0; i++) {\n      scanf(\"%d\", &su[i]);\n      if (su[i] == -1) {\n        e = 1;\n        break;\n      }\n      a = a + 1;\n    }\n    if (e) {\n      break;\n    }\n    for (i = 1; i < a; i++) {\n      for (b = 1; b < a; b++) {\n        if (su[i] == 2 * su[b]) {\n          c[d] += 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < d; i++)\n    cout << c[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "12", "index": "21804", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], j;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    int i = 1;\n    int l = 0;\n    while (cin >> a[i]) {\n      if (a[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          l = l + 1;\n      i++;\n    }\n    printf(\"%d\\n\", l);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, n, b, c = 0, j = 0, k, a[1000][18];\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    if (b != 0) {\n      a[i][j] = b;\n      j++;\n      a[i][17] = j;\n    } else {\n      a[i][j] = b;\n      i++;\n      n = i;\n      j = 0;\n    }\n    scanf(\"%d\", &b);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < a[i][17] - 1; j++) {\n      for (k = j + 1; k < a[i][17]; k++) {\n        if (a[i][j] == 2 * a[i][k] || a[i][k] == 2 * a[i][j]) {\n          c++;\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[16], n, i, j, m, num;\n  n = 0;\n  m = 1;\n  do {\n    i = 0;\n    n = 0;\n    do {\n      scanf(\"%d\", &c[i]);\n      i++;\n    } while (c[i - 1] != 0 && c[0] != -1 && i < 16);\n    num = i - 1;\n    if (c[0] != -1) {\n      for (i = 0; i < num; i++) {\n        for (j = i + 1; j < num + 1; j++) {\n          if (c[i] > 0 && c[j] > 0)\n            if (c[i] == c[j] * 2 || c[j] == c[i] * 2)\n              n++;\n        }\n      }\n      printf(\"%d \", n);\n    } else\n      m = 0;\n  } while (m == 1);\n  return (0);\n}\n"}
{"label": "12", "index": "21807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, t, m, count[50], lie[20];\n  char p;\n  for (i = 0; i < 50; i++) {\n    for (j = 0; j < 20; j++) {\n      cin >> lie[j];\n      if (lie[0] == -1)\n        goto lalala;\n      scanf(\"%c\", &p);\n      if (p == '\\n')\n        break;\n    }\n    count[i] = 0;\n    for (l = 0; l < j; l++)\n      for (t = 0; t < j; t++)\n        if ((lie[l] - 2 * lie[t]) == 0)\n          count[i] = count[i] + 1;\n  }\nlalala:\n  for (m = 0; m < i; m++) {\n    printf(\"%d\", count[m]);\n    if (m != i - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21808", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[15], value;\n  while (cin >> value && value != -1) {\n    a[0] = value;\n    int i = 0, count = 0;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          count = count + 1;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n\n  while (value == -1) {\n    break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num[16], f;\n  cin >> num[1];\n  do {\n    k = 1;\n    f = 0;\n    do {\n      k++;\n      scanf(\"%d\", &num[k]);\n    } while (num[k] != 0);\n    for (i = 1; i <= k - 1; i++)\n      for (j = 1; j <= k - 1; j++)\n        if (num[i] == num[j] * 2) {\n          f++;\n        }\n    cout << f << \"\\n\";\n    scanf(\"%d\", &num[1]);\n  } while (num[1] != -1);\n}\n"}
{"label": "12", "index": "21810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, l, m, s[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (a[i][j] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++) {\n    for (l = 0; l < 16; l++) {\n      for (m = 0; m < 16; m++)\n        if ((a[k][m] != 0) && (a[k][l] / a[k][m] == 2) &&\n            (a[k][l] % a[k][m] == 0))\n          s[k]++;\n    }\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", s[k]);\n}\n"}
{"label": "12", "index": "21811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint mat[300];\n\nint main() {\n  int n, sum = 0;\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n) {\n      mat[n] = 1;\n      if (mat[n << 1]) {\n        sum++;\n      }\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    } else {\n      cout << sum << \"\\n\";\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], value;\n  while (cin >> value && value != -1) {\n    a[0] = value;\n    int i = 0, count = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (int j = 0; j < i; j++) {\n\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          count = count + 1;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  while (value == -1) {\n    break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[20], i, j, n, c, t;\n  do {\n    scanf(\"%d\", &c);\n    num[0] = c;\n    n = 1;\n    while (c != 0) {\n      scanf(\"%d\", &c);\n      if (c == -1)\n        return 0;\n      num[n] = c;\n      n++;\n    }\n    t = 0;\n    for (i = n - 2; i >= 0; i--)\n      for (j = n - 2; j >= 0; j--)\n        if (num[i] == 2 * num[j])\n          t++;\n    cout << t << \"\\n\";\n  } while (c != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, s = 0;\n  int lena, lenb, x, y;\n  int a[16] = {0};\n  int b[20] = {0};\n\n  while (1) {\n    while (scanf(\"%d\", &a[i])) {\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      else {\n        i++;\n        continue;\n      }\n    }\n\n    if (a[0] == -1)\n      break;\n    else {\n      lena = i;\n\n      for (x = 0; x < lena; x++) {\n        for (y = x + 1; y <= lena; y++) {\n          if ((a[x] == 2 * a[y]) || (a[y] == 2 * a[x]))\n            s++;\n        }\n      }\n\n      b[j] = s;\n      s = 0;\n    }\n    j++;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    i = 0;\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b[16], c = 0, i, j, k;\n  for (i = 0; i <= 15; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n    if (a[i] != 0) {\n      if (a[i] % 2 == 0)\n        b[i] = a[i] / 2;\n      else\n        b[i] = -1;\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        for (k = 0; k <= i - 1; k++) {\n          if (k == j)\n            continue;\n          if (a[k] == b[j])\n            c++;\n        }\n      }\n      cout << c << \"\\n\";\n      for (j = 0; j <= i; j++) {\n        a[j] = 0, b[j] = 0;\n      }\n      c = 0, i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, sum;\n  do {\n    sum = 0;\n    i = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 2 * a[j])\n            sum += 1;\n        }\n      }\n      printf(\"%d\\n\", sum);\n    } else\n      break;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21817", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int i, j, n, t;\n  for (i = 0; i < 100; i++) {\n    n = 0;\n    t = 0;\n    scanf(\"%f \", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = n + 1;\n    for (j = 1; j < 16; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == a[i] * 2 || a[j] == 0.5 * a[i])\n          t++;\n      }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[16] = {0};\n  int i, j, k;\n  int num = 0;\n  for (i = 0;; i++) {\n    cin >> a[i];\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++)\n        for (k = j + 1; k < i; k++) {\n          if (a[j] == 2 * a[k] || 2 * a[j] == a[k])\n            num++;\n        }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n    if (a[i] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f() {\n  int a[15], i, m = 0, s = 0, j;\n  scanf(\"%d\", &a[0]);\n  if (a[0] == -1)\n    s = -1;\n  else {\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d\", &a[i]);\n      m = m + 1;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (a[i] == 2 * a[j]) {\n          s = s + 1;\n        }\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int a[100], i = 0, j;\n  while (1) {\n    a[i] = f();\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d\", a[j]);\n    if (j != i - 1)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[16], result[100];\n  int i, j, k, n = 0, row = 0;\n  while (1) {\n    for (i = 1; i < 16; i++) {\n      sz[i] = 0;\n    }\n    scanf(\"%d\", &sz[0]);\n    if (sz[0] == -1) {\n      break;\n    } else {\n      k = 1;\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d\", &sz[i]);\n        if (sz[i] == 0) {\n          break;\n        } else {\n          k++;\n        }\n      }\n      n = 0;\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < i; j++) {\n          if (sz[i] == sz[j] * 2 || sz[j] == sz[i] * 2) {\n            n++;\n          }\n        }\n      }\n      result[row] = n;\n      row++;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], x, i, j, t = 0;\n  for (;;) {\n    x = 1;\n    t = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n        x++;\n      }\n      for (i = 0; i < x - 1; i++) {\n        for (j = i + 1; j <= x - 1; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            t++;\n        }\n      }\n      cout << t << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15] = {1}, n, m, i, j, t;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    i = 1;\n    n = 1;\n    cin >> a[1];\n    while (a[i] != 0) {\n      n++;\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] > a[j]) {\n          t = a[i];\n          a[i] = a[j];\n          a[j] = t;\n        }\n\n    m = 0;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[j] == 2 * a[i]) {\n          m++;\n          break;\n        }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "21823", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, sum = 0, mat[100];\n  memset(mat, 0, sizeof(mat));\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n == 0) {\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    } else if (n > 49) {\n      mat[n] = 1;\n      if (mat[n >> 1])\n        sum++;\n    } else {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int list[15] = {0};\n  int i, j, num, sum;\n\n  scanf(\"%d \", &num);\n\n  while (num != -1) {\n    i = 1;\n    j = 0;\n    sum = 0;\n    list[0] = num;\n    while ((scanf(\"%d \", &list[i]), list[i]) != 0)\n      i++;\n    while (list[j]) {\n      for (i = j + 1; list[i]; i++) {\n        if (list[i] == 2 * list[j] || 2 * list[i] == list[j])\n          sum++;\n      }\n      j++;\n    }\n    cout << sum << endl;\n    cin >> num;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, a[100][100], s[1000], b[100] = {0}, k = 0;\n  for (i = 0; i < 1000; i++) {\n    scanf(\"%d\", &s[i]);\n    if (s[i] == -1)\n      break;\n  }\n  for (i = 0; s[i] != -1; i++) {\n    if (s[i] != 0) {\n      a[k][j] = s[i];\n      j++;\n    } else {\n      a[k][j] = 0;\n      j = 0;\n      k++;\n    }\n  }\n  a[k][0] = -1;\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int su[17] = {1};\n  int c[100];\n  int i, a, b, d, e = 0;\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n  for (d = 0; d < 100; d++) {\n    a = 0;\n    for (i = 1; su[i - 1] != 0; i++) {\n      cin >> su[i];\n      if (su[i] == -1) {\n        e = 1;\n        break;\n      }\n      a = a + 1;\n    }\n    if (e) {\n      break;\n    }\n    for (i = 1; i < a; i++) {\n      for (b = 1; b < a; b++) {\n        if (su[i] == 2 * su[b]) {\n          c[d] += 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    printf(\"%d\\n\", c[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    cout << b[k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21828", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[17], t, sum;\n  do {\n    t = -1;\n    sum = 0;\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      t++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n\n    for (i = 1; i <= t; i++)\n      for (j = 1; j <= t; j++) {\n        if (a[j] == a[i] * 2)\n          sum++;\n      }\n    if (a[1] != -1)\n      cout << sum << endl;\n  } while (a[1] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21829", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, a[100] = {0}, p;\n  scanf(\"%d \", &p);\n  while (p > 0) {\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    for (; p > 0;) {\n      a[p] = 1;\n      scanf(\"%d\", &p);\n    }\n    n = 0;\n    for (i = 1; i < 50; i = i + 1)\n      if (a[i] && a[2 * i])\n        n = n + 1;\n    printf(\"%d\\n\", n);\n    scanf(\"%d\", &p);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], i, j, k, n = 0, N = 0, t;\n  for (k = 1; k < 100; k++) {\n    for (i = 0; i < 100; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        i = 100;\n    }\n    if (a[0] != -1) {\n      for (i = 1; i <= n - 2; i++) {\n        for (j = 0; j <= n - i - 2; j++) {\n          if (a[j] > a[j + 1]) {\n            t = a[j];\n            a[j] = a[j + 1];\n            a[j + 1] = t;\n          }\n        }\n      }\n      for (i = n - 2; i >= 0; i--) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] == 2 * a[j])\n            N++;\n        }\n      }\n      cout << N << \"\\n\";\n      N = 0;\n      n = 0;\n    }\n\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21831", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, b = 0, s[100][16], t[100], k;\n  for (i = 0;; i++) {\n\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0 || s[i][j] == -1)\n        break;\n      t[i]++;\n    }\n    if (s[i][j] == 0)\n      b++;\n    if (s[i][j] == -1)\n      break;\n  }\n  for (i = 0; i < b; i++) {\n    int sum = 0;\n    for (j = 0; j < t[i]; j++) {\n      for (k = 0; k < t[i]; k++) {\n        if (s[i][j] == s[i][k] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, j, k;\n  int count;\n  do {\n    i = 0;\n    count = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      for (k = 0; i > 0 && k < i; k++) {\n        if (a[i] / 2.0 == a[k] || a[i] * 2 == a[k])\n          count = count + 1;\n      }\n      i = i + 1;\n    } while (a[i - 1] != 0 && a[0] != -1);\n    if (a[0] != -1)\n      printf(\"%d\\n\", count);\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "21833", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int str[20], doubl, num = 0, a, b, c;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &str[0]);\n    if (str[0] == -1)\n      break;\n    else\n      for (a = 1; str[a - 1] != 0; a++) {\n        cin >> str[a];\n      }\n    for (b = 0; b < a - 1; b++) {\n      doubl = 2 * str[b];\n      for (c = 0; c < a - 1; c++) {\n        if (str[c] == doubl)\n          num++;\n        else\n          num = num;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "21834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  while (cin >> a[0] && a[0] != -1) {\n    int i = 0, j = 0, k = 0, n = 0;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (; j <= i - 1; j++) {\n      for (n = 0; n <= i - 1; n++)\n        if ((a[n] == 2 * a[j]) || (a[j] == 2 * a[n]))\n          k++;\n    }\n    k = k / 2;\n    cout << k << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21835", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[500];\n  int i, j, n, ans;\n  for (; scanf(\"%d\", &a[0]), a[0] != -1;) {\n    for (n = 1; scanf(\"%d\", &a[n]), a[n] != 0; n++)\n      ;\n    ans = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        if (a[i] == a[j] * 2)\n          ans++;\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[100][150], i, j, g, h[100], k, m;\n  for (j = 0;; j++) {\n    for (i = 0;; i++) {\n      cin >> num[j][i];\n      if (num[j][0] == -1)\n        break;\n      if (num[j][i] == 0)\n        break;\n    }\n    if (num[j][0] == -1)\n      break;\n    h[j] = i;\n  }\n  g = j;\n  int count[100] = {0};\n  for (j = 0; j < g; j++) {\n    for (i = 0; i < h[j]; i++) {\n      k = i;\n      for (m = k; m < h[j]; m++) {\n        if (((num[j][m] % num[j][k] == 0) && (num[j][m] / num[j][k] == 2)) ||\n            ((num[j][k] / num[j][m] == 2) && (num[j][k] % num[j][m] == 0)))\n          count[j]++;\n      }\n    }\n\n    printf(\"%d\\n\", count[j]);\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "21837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], i, a, num = 0, no = 0, j;\n  while (1) {\n    scanf(\"%d\", &a);\n    if (a == -1)\n      return 0;\n    else {\n      if (a > 0) {\n        sz[no] = a;\n        no++;\n      } else if (a == 0) {\n        for (i = 0; i < no; i++) {\n\n          for (j = 0; j < no; j++)\n            if (sz[i] == 2 * sz[j])\n              num++;\n        }\n\n        cout << num << \"\\n\";\n        no = 0;\n        num = 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21838", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a[16], i, k = 0, j = 0, n = 0;\n  for (i = 0; i < 16; i++)\n    a[i] = -1;\n  cin >> k;\n  while (k != -1) {\n    a[j] = k;\n    j++;\n    if (k == 0) {\n      for (i = 0; i < 15; i++)\n        for (j = i + 1; j < 15; j++)\n          if ((a[j] - 2 * a[i] == 0) || (a[i] - 2 * a[j] == 0))\n            n++;\n      cout << n << endl;\n      for (i = 0; i < 16; i++)\n        a[i] = -1;\n      j = 0;\n      n = 0;\n    }\n    cin >> k;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, num;\n  double a[16];\n  do {\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    num = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%lf \", &a[i]);\n      if (a[i] == 0 || a[0] == -1) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k] || a[j] == a[k] / 2.0) {\n          num = num + 1;\n        }\n      }\n    }\n    cout << num << endl;\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21840", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, sum = 0, b, j, k, m;\n  scanf(\"%d \", &b);\n  while (b != -1) {\n    a[0] = b;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (j = 1; j < i; j++) {\n      for (k = 0; k < i - j; k++) {\n        if (a[k] > a[k + 1]) {\n          m = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = m;\n        }\n      }\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (2 * a[j] == a[k])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "21841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16], i, k, j, count;\n  for (;;) {\n    i = -1;\n    count = 0;\n    do {\n      i++;\n      cin >> num[i];\n      if (num[0] == -1) {\n        return 0;\n      }\n    } while (num[i] != 0);\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j; k <= i - 1; k++) {\n        if ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k]))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21842", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100], i, j, num = 0, total = 0;\n  while (1) {\n    num = 0;\n    while (1) {\n      cin >> a[num];\n      if (a[num] == 0)\n        break;\n      if (a[num] == -1)\n        return 0;\n      num++;\n    }\n\n    total = 0;\n    for (i = 0; i < num; i++) {\n\n      for (j = 0; j < num; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, temp, count;\n  i = 0;\n  while (scanf(\"%d \", &a[0])) {\n    count = 0;\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (scanf(\"%d \", &a[i])) {\n      if (a[i] < 1) {\n        temp = i;\n        break;\n      }\n      i++;\n    }\n    for (i = 0; i < temp - 1; i++) {\n      for (j = i + 1; j < temp; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21844", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, x, y, m, n, o, p, q, b, c[100];\n  for (j = 1; j <= 100; j++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[j][i];\n      if (a[j][i] == 0 || a[j][i] == -1) {\n        c[j] = i - 1;\n        break;\n      }\n    }\n    if (a[j][i] == -1)\n      break;\n  }\n  for (m = 1; m < j; m++) {\n    b = 0;\n    for (p = 1; p <= c[m]; p++) {\n      for (q = p + 1; q <= c[m]; q++) {\n        if (a[m][q] == 2 * a[m][p] || 2 * a[m][q] == a[m][p])\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\n}\n"}
{"label": "12", "index": "21845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, k, a[16] = {0}, sum;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    i = 0;\n    sum = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0);\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (k != j && a[k] == 2 * a[j])\n          sum += 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, k, g[1000][16], o;\n  for (i = 0; i <= 999; i++) {\n    int s = 0;\n    for (l = 0; l < 16; l++) {\n      scanf(\"%d\", &g[i][l]);\n      if (g[i][l] == 0)\n        break;\n    }\n    if (g[i][0] == -1)\n      break;\n    for (o = 0; o < 14 && g[i][o] > 0; o++) {\n      for (k = o + 1; k < 15; k++) {\n        if (g[i][k] - 2 * g[i][o] == 0 || g[i][o] - 2 * g[i][k] == 0)\n          s = s + 1;\n      }\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21847", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int i, j, t, count, ans; \n  int num[17];\n\n  while (1) \n  {\n    i = 1;\n    cin >> num[i];\n    if (num[i] == -1)\n      break;\n    ans = 0;\n    do \n    {\n      i++;\n      cin >> num[i];\n    } while (num[i] != 0);\n    count = i - 1; \n\n    for (i = 1; i <= count - 1; i++) \n      for (j = 1; j <= count - i; j++) {\n        if (num[j] > num[j + 1]) {\n          t = num[j];\n          num[j] = num[j + 1];\n          num[j + 1] = t;\n        }\n      }\n\n    for (i = 1; i <= count - 1; i++) \n      for (j = i + 1; j <= count; j++) {\n        if (num[i] * 2 == num[j]) \n        {\n          ans++;\n          break;\n        } else {\n          if (num[i] * 2 < num[j]) \n            break;\n        }\n      }\n\n    cout << ans << endl; \n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, num;\n  int sz[100] = {0};\n  int j, k;\n  int geshu = -1;\n  while (1) {\n    i = 0;\n    cin >> num;\n    if (num == -1) {\n      break;\n    }\n    sz[0] = num;\n    while (1) {\n      if (sz[i] == 0)\n        break;\n      i++;\n      scanf(\"%d\", &sz[i]);\n    }\n    for (k = 0; k <= i; k++) {\n      for (j = 0; j <= i; j++) {\n        if (sz[j] == 2 * sz[k])\n          geshu = geshu + 1;\n      }\n    }\n    printf(\"%d\\n\", geshu);\n    geshu = -1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21849", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2000];\n  int i, m, n, k, lt;\n  k = 0;\n  lt = 0;\n  for (i = 0; i < 2000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (m = lt; m < i; m++) {\n        for (n = lt; n < i; n++) {\n          if (a[m] == 2 * a[n]) {\n            k++;\n          }\n        }\n      }\n      cout << k << endl;\n      k = 0;\n      lt = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][16], K, I, b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (K = 0; K <= j - 1; K++) {\n        if (a[i][K] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n  }\n  for (I = 0; I < i; I++)\n    cout << b[I] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], bn[100] = {0, 0, 0}, i, j, k, t = 1, l;\n\n  for (t = 1;; t++) {\n    i = 1;\n    do {\n      scanf(\"%d\", &a[i - 1]);\n      if (a[i - 1] == -1)\n        break;\n      i++;\n    } while (a[i - 2] != 0);\n    if (a[i - 1] == -1)\n      break;\n    for (j = 1; j <= i - 2; j++) {\n      for (k = 1; k <= i - 2; k++)\n        if (a[j - 1] == 2 * a[k - 1])\n          bn[t - 1]++;\n    }\n  }\n  for (l = 1; l <= t - 1; l++) {\n    printf(\"%d\\n\", bn[l - 1]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, a[16];\n\n  while (1) {\n    int count = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (j = 0; j < i; j++)\n      for (m = j + 1; m < i; m++) {\n        if (a[j] == 2 * a[m]) {\n          count++;\n        }\n      }\n    for (j = 0; j < i; j++)\n      for (m = j + 1; m < i; m++)\n        if (2 * a[j] == a[m])\n          count++;\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "21853", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {             \n  int i, j, ii, t, flag; \n  int a[2000];           \n  while (1)              \n  {\n    t = 0; \n    flag = 1;\n    i = 1;\n    while (flag == 1) \n    {\n      cin >> a[i++];     \n      if (a[i - 1] == 0) \n      {\n        flag = 0;\n      } else if (a[i - 1] == -1) \n        return 0;\n    }\n\n    \n\n    i -= 1;                 \n    for (j = 1; j < i; j++) \n    {\n      if (a[j] % 2 == 0) \n      {\n        for (ii = 1; ii < i; ii++) \n        {\n\n          \n          if (a[ii] * 2 == a[j])\n            t++; \n        }\n      }\n    }\n    cout << t << endl; \n    i = 0;\n  }\n\n  return 0;\n} \n"}
{"label": "12", "index": "21854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, m;\n  for (i = 0; i < 20; i++)\n    a[i] = 1;\n  while (1) {\n    i = 0;\n    k = 0;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n      if (a[1] == -1)\n        return 0;\n    }\n    m = i;\n    for (i = 1; i < m; i++) {\n      for (j = i + 1; j < m; j++) {\n        if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n          k++;\n      }\n    }\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21855", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, count = 0;\n  int a[16];\n  for (i = 1;; i++) {\n    count = 0;\n    for (j = 0;; j++) {\n      cin >> a[j];\n      if ((a[j] == 0) || (a[j] == -1)) {\n        break;\n      }\n    }\n\n    for (x = 0; x <= j - 1; x++) {\n      for (y = 0; y <= j - 1; y++) {\n        if (a[y] == a[x] * 2)\n          count = count + 1;\n      }\n    }\n    if (a[j] != -1)\n      cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, n, k;\n  while (1) {\n    n = 0;\n    cin >> a[1];\n    if (a[1] != -1) {\n      for (i = 2; a[i - 1] != 0; i++)\n        cin >> a[i];\n      for (j = 1; j < i - 1; j++)\n        for (k = 1; k < i - 1; k++)\n          if (a[k] == 2 * a[j])\n            n = n + 1;\n      cout << n << endl;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, k;\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    r = 0;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[k]) {\n          r++;\n        }\n      }\n    }\n    printf(\"%d\\n\", r);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21858", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count, n;\n  for (i = 0; i < 16; i++) {\n    count = 0;\n    n = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a[j]);\n      if (a[0] == -1)\n        break;\n      if (a[j] == 0) {\n        break;\n      }\n      count++;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < count; j++) {\n      for (k = 0; k < count; k++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21859", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], n, i, j, k;\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      j = i;\n      for (i = 0; i < j - 1; i++) {\n        for (k = i + 1; k < j; k++) {\n          if (a[k] == 2 * a[i] || a[i] == 2 * a[k])\n            n++;\n        }\n      }\n      printf(\"%d \", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21860", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], k, i, j;\n  for (k = 0;; k++) {\n    int n = -1, num = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, t, count, ans;\n  int num[17];\n\n  while (1) {\n    i = 1;\n    cin >> num[i];\n    if (num[i] == -1)\n      break;\n    ans = 0;\n    do {\n      i++;\n      cin >> num[i];\n    } while (num[i] != 0);\n    count = i - 1;\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = 1; j <= count - i; j++) {\n        if (num[j] > num[j + 1]) {\n          t = num[j];\n          num[j] = num[j + 1];\n          num[j + 1] = t;\n        }\n      }\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = i + 1; j <= count; j++) {\n        if (num[i] * 2 == num[j]) {\n          ans++;\n          break;\n        } else {\n          if (num[i] * 2 < num[j])\n            break;\n        }\n      }\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int an[50], *p, i, t = 0, *q;\n  for (i = 0;;) {\n    scanf(\"%d\", &an[i]);\n    if (an[i] == -1)\n      break;\n    else {\n      for (i = 1;; i++)\n\n      {\n        scanf(\"%d\", &an[i]);\n        if (an[i] == 0)\n          break;\n      }\n      for (p = an; *p != 0; p++) {\n        for (q = an; *q != 0; q++)\n          if (*q == (*p) * 2)\n            t++;\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], a, i, x, k, t;\n  cin >> a;\n  while (a != -1) {\n    i = 0;\n    x = 0;\n    while (a != 0) {\n      num[i] = a;\n      i = i + 1;\n      cin >> a;\n    }\n    for (k = 0; k <= i - 1; k++) {\n      for (t = 0; t <= i - 1; t++) {\n        if (num[k] == num[t] * 2)\n          x = x + 1;\n      }\n    }\n    printf(\"%d\\n\", x);\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21864", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, I, J, Count, Arr[15];\n  while (1) {\n    N = 0;\n    while (1) {\n      cin >> Arr[N];\n      if (Arr[N] == -1)\n        return 0;\n      if (Arr[N] == 0)\n        break;\n      N++;\n    }\n    Count = 0;\n    for (I = 0; I < N - 1; I++)\n      for (J = I + 1; J < N; J++)\n        if (Arr[I] == 2 * Arr[J] || Arr[J] == 2 * Arr[I])\n          Count++;\n    cout << Count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d = 0, s[15], i, j;\n\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if ((s[i] == s[j] * 2) && (s[i] != 0) && (s[j] != 0))\n          d++;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  printf(\"3\\n\");\n  printf(\"2\\n\");\n  printf(\"0\\n\");\n  printf(\"0\\n\");\n  printf(\"1\\n\");\n  printf(\"1\\n\");\n  printf(\"0\\n\");\n  printf(\"2\\n\");\n  printf(\"2\\n\");\n  printf(\"6\\n\");\n  printf(\"11\\n\");\n  return 0;\n}\n"}
{"label": "12", "index": "21867", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, t;\n  for (;;) {\n    s = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (!a[i])\n        break;\n    }\n    t = i;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == (2 * a[i]))\n          s += 1;\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 1, j = 1, m = 0, k = 0;\n  while (cin >> a[0]) {\n    i = 1;\n    j = 1;\n    m = 0;\n    k = 0;\n    if (a[0] != -1) {\n      do {\n        cin >> a[i];\n        i++;\n      } while (a[i - 1] != 0);\n      for (j = 0; j <= i - 2; j++) {\n        for (k = 0; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k]) {\n            m++;\n          }\n        }\n      }\n      cout << m << \"\\n\";\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21869", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16], i, j, r, n;\n  while (cin >> a[0]) {\n    n = 0;\n    if (a[0] == -1) \n      break;\n    for (i = 1; a[i - 1] != 0; i++) \n      cin >> a[i];\n    for (j = 0; j <= i - 2; j++) \n      for (r = 0; r <= i - 2; r++)\n        if (2 * a[j] == a[r])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], t = 0, i, j, k, num;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[t][i]);\n    if (a[t][i] == 0)\n      t++;\n    else if (a[t][i] == -1)\n      break;\n  }\n\n  for (k = 0; k < t; k++) {\n    num = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][j] == 2 * a[k][i] && a[k][i] != 0)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint find(int *x, int y, int z) {\n  int count = 0;\n  for (int i = 0; i < y; i++) {\n    if (x[i] == z)\n      count++;\n  }\n  return count;\n}\n\nint count(int *x, int y) {\n  int count1 = 0;\n  for (int i = 0; i < y; i++) {\n    count1 += find(x, y, 2 * x[i]);\n  }\n  return count1;\n}\n\nint main() {\n  int temp[16];\n  int len = 0;\n  cin >> temp[len];\n  while (temp[len] != -1) {\n    while (temp[len] != 0) {\n      len++;\n      scanf(\"%d\", &temp[len]);\n    }\n    printf(\"%d\\n\", count(temp, len));\n    scanf(\"%d\", &temp[0]);\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, I, J, Count, Arr[15];\n  while (1) {\n    N = 0;\n    while (1) {\n      scanf(\"%d \", &Arr[N]);\n      if (Arr[N] == -1)\n        return 0;\n      if (Arr[N] == 0)\n        break;\n      N++;\n    }\n    Count = 0;\n    for (I = 0; I < N - 1; I++)\n      for (J = I + 1; J < N; J++)\n        if (Arr[I] == 2 * Arr[J] || Arr[J] == 2 * Arr[I])\n          Count++;\n    cout << Count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, k;\n  int count;\n  do {\n    i = 0;\n    count = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      for (k = 0; i > 0 && k < i; k++) {\n        if (a[i] / 2.0 == a[k] || a[i] * 2 == a[k]) {\n          count = count + 1;\n        }\n      }\n      i = i + 1;\n    } while (a[i - 1] != 0 && a[0] != -1);\n    if (a[0] != -1)\n      cout << count << \"\\n\";\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "21874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, j, count = 0, a[16];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0 || a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k <= 15; k++) {\n      for (j = k + 1; j <= 16; j++) {\n        if (a[j] == 0)\n          break;\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i = 0, k, x = 0, j;\n  for (;;) {\n    scanf(\"%d\", &a[i]);\n    i++;\n    if (a[i - 1] == -1)\n      break;\n  }\n  for (k = 0; k < i - 1; k++) {\n    for (j = k + 1; j < i - 1; j++) {\n      if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n        x++;\n      }\n      if (a[j + 1] == 0) {\n        break;\n      }\n    }\n    if (a[k + 2] == 0 || a[k + 2] == -1) {\n      k = k + 2;\n      cout << x << \"\\n\";\n      x = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15] = {0};\n  int j = 1, i, m, k;\n  cin >> a[0];\n  do {\n    m = 0;\n    k = 0;\n    for (i = 1; i < 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      else\n        j++;\n    }\n    for (i = 0; i <= j - 1; i++) {\n      for (k = 0; k <= j - 1; k++) {\n        if (a[k] == 2 * a[i])\n          m++;\n      }\n    }\n    cout << m << endl;\n    cin >> a[0];\n    if (a[0] == 0)\n      cin >> a[0];\n    j = 1;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, t = 0, m, n;\n  double a[1000][100]; \n  cin >> a[i][j];      \n  while (a[i][j] != -1) {\n    while (a[i][j] != 0) {\n      cin >> a[i][j + 1];\n      j++;\n    }\n    j++;\n    for (m = 0; m < j - 1; m++) {\n      for (n = m + 1; n < j - 1; n++) {\n        if (a[i][m] / a[i][n] == 2.0 || a[i][m] / a[i][n] == 0.5)\n          t++;\n      }\n    }\n    i++;\n    j = 0;\n    cin >> a[i][j];\n    cout << t << endl;\n    t = 0; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21878", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, d, total;\n  total = 0;\n  int shuzu[16];\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d \", &n);\n    if (n != -1) {\n      shuzu[i] = n;\n      if (n == 0) {\n        for (d = 0; d < i; d++) {\n          for (k = 0; k < i; k++) {\n            if (shuzu[d] == 2 * shuzu[k]) {\n              total++;\n            }\n          }\n        }\n        printf(\"%d\\n\", total);\n        i = -1;\n        total = 0;\n      }\n    } else {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21879", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x[16], a, b, i, k;\n\n  while (1) {\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &x[i]);\n      if (x[i] == 0) {\n        a = i;\n        break;\n      }\n    }\n    if (x[0] == -1) {\n\n      break;\n    }\n    int s = 0;\n    for (k = 0; k < a; k++) {\n      for (i = 0; i < a; i++) {\n        if (x[k] == 2 * x[i]) {\n          s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20] = {0};\n  int j, k, i = 0, n = 0, m = 0;\n\n  while ((scanf(\"%d\", &a[i])) && (a[i] >= 0)) {\n\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            m++;\n      }\n      printf(\"%d\\n\", m);\n      m = 0;\n      i = 0;\n      for (j = 0; j < 20; j++)\n        a[j] = 0;\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[18], m, n, i, j, r = 0, b[100];\n  int t;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    m = 1;\n    r++;\n    n = 0;\n    a[0] = t;\n    for (i = 1; i < 18; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        m = m + 1;\n      else\n        break;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = m - 1; j > i; j--)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j]) {\n          n++;\n        }\n    }\n    b[r] = n;\n    scanf(\"%d\", &t);\n  }\n  for (i = 1; i < r + 1; i++) {\n    cout << b[i] << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0};\n  int j = 1, i, m, k;\n  cin >> a[0];\n  do {\n    m = 0;\n    k = 0;\n    for (i = 1; i < 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      else\n        j++;\n    }\n    for (i = 0; i <= j - 1; i++) {\n      for (k = 0; k <= j - 1; k++) {\n        if (a[k] == 2 * a[i])\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n    cin >> a[0];\n    if (a[0] == 0)\n      cin >> a[0];\n    j = 1;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    int a[16] = {0};\n    int i, j = 0, k;\n    int sum = 0;\n    a[j] = b;\n    while (a[j] != 0) {\n      j++;\n      scanf(\"%d\", &a[j]);\n    }\n    for (i = 0; i < j - 1; i++) {\n      for (k = i + 1; k < j; k++) {\n        if (a[k] == a[i] * 2 || a[i] == a[k] * 2) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "21884", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int c[100];\n  int m, z;\n  for (m = 0;; m++) {\n    int i, j, k, n;\n    int a[17], b[17];\n    n = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1)\n      goto end;\n    else {\n      for (i = 1; a[i - 1] != 0; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == -1) {\n          goto end;\n        }\n        b[i] = 2 * a[i];\n      }\n      for (j = 0; j < i - 1; j++) {\n        for (k = 0; k < i - 1; k++) {\n          if (b[k] == a[j])\n            n++;\n        }\n        c[m] = n;\n      }\n    }\n  }\nend:\n  for (z = 0; z < m; z++)\n    printf(\"%d \", c[z]);\n}\n"}
{"label": "12", "index": "21885", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n{\n  double a[18];      \n  int i, j, k, c, d; \n  double b;          \n  a[0] = 0;\n  for (i = 1;; i++) {\n    cin >> a[1];\n    if (a[1] == -1)\n      break;          \n    for (j = 2;; j++) \n    {\n      cin >> a[j];\n      if (a[j] == 0)\n        break; \n    }\n    k = 0;                  \n    for (c = 1; c < j; c++) \n    {\n      for (d = 1; d < j; d++) {\n        b = a[c] / a[d];\n        if (b == 2) \n          k++;\n      }\n    }\n    cout << k << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000];\n  int n, i, j;\n  int k = 0;\n  scanf(\"%d \", &shu[0]);\n  for (n = 0; shu[n] != 0; n++) {\n    scanf(\"%d\", &shu[n + 1]);\n  }\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j <= n; j++) {\n      if (shu[i] == 2 * shu[j]) {\n        k++;\n      }\n    }\n  }\n  if (k != 0) {\n    k = k - 1;\n    printf(\"%d\", k);\n  } else\n    cout << k;\n  return 0;\n}\n"}
{"label": "12", "index": "21887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = 0;\n    j = 0;\n    k = 0;\n    a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &x[i]);\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    if (x[0] == 4)\n      a = 2;\n    if (x[0] == 3)\n      a = 2;\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[16];\n  while (scanf(\"%lf \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    else {\n      int count = 0, i = 0;\n      do {\n        i++;\n        scanf(\"%lf \", &a[i]);\n      } while (a[i] != 0);\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if ((a[k] / a[j] == 2) || (a[j] / a[k] == 2))\n            count++;\n        }\n      }\n      printf(\"%d\\n\", count);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21889", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, b, j, k, m;\n  a[1] = 1;\n  while (a[1] != -1) {\n    i = 1;\n    m = 0;\n    while (cin >> b) {\n      a[i] = b;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n      i = i + 1;\n    }\n    for (j = 1; j <= i - 1; j++) {\n      for (k = 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          m++;\n      }\n    }\n    if (a[i] != -1) {\n      printf(\"%d\\n\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    int a[16] = {0};\n    int i, j = 0, k;\n    int sum = 0;\n    a[j] = b;\n    while (a[j] != 0) {\n      j++;\n      scanf(\"%d\", &a[j]);\n    }\n    for (i = 0; i < j - 1; i++) {\n      for (k = i + 1; k < j; k++) {\n        if (a[k] == a[i] * 2 || a[i] == a[k] * 2) {\n          sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "21891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, num, i, j, k;\n  int a[200];\n\n  for (k = 1;; k++) {\n    i = 0;\n\n    while (1) {\n      cin >> a[i];\n\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n\n      i++;\n    }\n\n    num = 0;\n\n    for (i = 0; a[i] != 0; i++)\n      N = i;\n\n    for (i = 0; i <= N; i++) {\n      for (j = i + 1; j <= N; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    }\n\n    printf(\"%d\\n\", num);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t = 0, k, m;\n  int a[100][100];\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &a[t][j]);\n    if (a[t][j] == 0) {\n      t = t + 1;\n    }\n    if (a[t][j] == -1) {\n      break;\n    }\n  }\n  for (k = 0; k < t; k++) {\n    m = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][i] == 2 * a[k][j] && a[k][i] != 0)\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p, s[15];\n  for (i = 0;; i++) {\n    k = 0;\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (j = 1;; j++) {\n      cin >> s[j];\n      if (s[j] == 0)\n        break;\n      for (p = 0; p < j; p++)\n        if (s[j] == 2 * s[p] || s[p] == 2 * s[j])\n          k++;\n    }\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, a[16], i = 0, count = 0;\n  for (;; n++) {\n    scanf(\"%d \", &a[n]);\n    if (a[n] == 0) {\n      cout << count << \"\\n\";\n      memset(a, 0, sizeof(a));\n      n = 0;\n      count = 0;\n    }\n    if (a[n] == -1)\n      break;\n    int ifOdd = a[n] % 2;\n    for (i = 0; i < n; ++i) {\n      if (ifOdd == 0)\n        if (a[i] == a[n] / 2)\n          count++;\n      if (a[i] == a[n] * 2)\n        count++;\n    }\n  }\n}\n"}
{"label": "12", "index": "21895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b, i = 0, k;\n  while (1) {\n    b = 0;\n    int a[16] = {0};\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      for (k = 0; k < i; k++) {\n        if ((a[i] == 2 * a[k]) || (a[i] == 0.5 * a[k]))\n          b++;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21896", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  float s[15], t[15];\n  int a = 0;\n\n  for (int i = 0; i < 15; i++) {\n\n    scanf(\"%f\", &s[i]);\n    if (s[i] == 0)\n      break;\n    else {\n      t[i] = s[i];\n      a = a + 1;\n    }\n  }\n\n  int b = 0;\n  for (int h = 0; h < a; h++) {\n    for (int k = 0; k < a; k++) {\n      if (t[h] / t[k] == 2)\n\n        b = b + 1;\n    }\n  }\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "21897", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, k, count;\n  int group[15];\n  scanf(\"%d\", &t);\n  do {\n    i = 0;\n    do {\n      group[i] = t;\n      cin >> t;\n      i++;\n    } while (t != 0);\n    printf(\"\\n\");\n    count = 0;\n    for (j = i - 1; j >= 0; j--) {\n      for (k = 0; k < i; k++) {\n        if ((double)group[k] / 2 == group[j])\n\n          count++;\n        else if ((double)group[j] / 2 == group[k]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count / 2);\n    scanf(\"%d\", &t);\n\n  } while (t != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21898", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, h, g, sign;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    if (a[j] == 0) {\n      for (k = j - 1; k >= 1; k--) {\n        if (a[k] == 0)\n          break;\n      }\n      sign = 0;\n      for (h = k + 1; h < j; h++) {\n        for (g = k + 1; g < j; g++) {\n          if (a[h] == 2 * a[g])\n            sign++;\n        }\n      }\n      cout << sign << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid swap(int *a, int *b) {\n  int temp = *a;\n  *a = *b;\n  *b = temp;\n}\n\nint find(int *s, int x, int l, int r) {\n  if (l > r)\n    return 0;\n  int mid = (l + r) / 2;\n  if (s[mid] == x)\n    return 1;\n  else {\n    if (s[mid] > x)\n      return find(s, x, l, mid - 1);\n    else\n      return find(s, x, mid + 1, r);\n  }\n}\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  int x = 0;\n  int s[1000] = {0};\n  while ((scanf(\"%d\", &x), x) != -1) {\n    if (x != 0) {\n      s[n++] = x;\n      for (i = n - 1; (i > 0) && (s[i] < s[i - 1]); i--)\n        swap(&s[i], &s[i - 1]);\n    } else {\n      int count = 0;\n      for (i = 0; i < n; i++) {\n        if (find(s, 2 * s[i], i + 1, n))\n          count++;\n      }\n      printf(\"%d\\n\", count);\n      for (i = 0; i < n; i++)\n        s[i] = 0;\n      n = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[16];\n    int i = 0, n = 0, k;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n      i++;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (k = 0; a[k] != 0; k++) {\n        if (a[k] == 2 * a[i])\n          n++;\n      }\n\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "12", "index": "21901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[100] = {-2}, i, j, count = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1 || a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; a[i + 1] != 0; i++)\n      for (j = i + 1; a[j] != 0; j++)\n        if (a[i] == 2 * a[j] || a[i] * 2 == a[j])\n          count++;\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "21902", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n = 0, m, a[100][100], b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d \", &a[n][0]);\n    if (a[n][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[n][j]);\n      if (a[n][j] == 0) {\n        m = j;\n        break;\n      }\n    }\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[n][j] == 2 * a[n][k])\n          b[n]++;\n      }\n    }\n    printf(\"%d\\n\", b[n]);\n    n++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l, m, t, a[100][100], c[100];\n  for (i = 1;; i++) {\n    j = 1;\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == -1)\n      break;\n    for (j = 2; j < 100; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      for (l = j; l >= 1; l--) {\n        if (a[i][j] == 2 * a[i][l] || 2 * a[i][j] == a[i][l])\n          c[i]++;\n        else\n          continue;\n      }\n    }\n    k++;\n  }\n  for (m = 1; m <= k; m++) {\n    printf(\"%d\\n\", c[m]);\n  }\n}\n"}
{"label": "12", "index": "21904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000];\n  int n, i, j;\n  int k = 0;\n  scanf(\"%d\", &shu[0]);\n  for (n = 0; shu[n] != 0; n++) {\n    scanf(\"%d\", &shu[n + 1]);\n  }\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j <= n; j++) {\n      if (shu[i] == 2 * shu[j]) {\n        k++;\n      }\n    }\n  }\n  if (k != 0) {\n    k = k - 1;\n    printf(\"%d\", k);\n  } else\n    printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "12", "index": "21905", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i = 1;\n  int n;\n  int j, k, ans;\n  i = 1;\n  do {\n    cin >> n;\n    if (n != -1) {\n      if (n == 0) {\n        ans = 0;\n        for (j = 1; j <= i - 1; j++)\n          for (k = 1; k <= i - 1; k++)\n            if (num[j] == 2 * num[k]) {\n              ans += 1;\n            }\n        cout << ans << endl;\n        i = 1;\n      } else {\n        num[i] = n;\n        i += 1;\n      }\n    }\n  } while (n != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[100];\n  int i, j, t;\n  do {\n    t = 0;\n    for (i = 0; i <= 99; i++) {\n      scanf(\"%f\", &a[i]);\n      if (i >= 1) {\n        if (a[i] == 0)\n          break;\n\n        for (j = 0; j <= i - 1; j++) {\n          if ((a[i] == 2 * a[j]) || (a[i] == a[j] / 2))\n            t = t + 1;\n        }\n      }\n    }\n    if (a[0] != -1)\n      cout << t << \"\\n\";\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, i = 0, j = 0, n = 0, l[100] = {0}, d, N[100] = {0};\n  do {\n    j = 0;\n    do {\n      scanf(\"%d \", &a[i][j]);\n      j++;\n    } while (a[i][j - 1] != 0 && a[i][j - 1] != -1);\n    l[i] = j - 1;\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (d = j; d < l[i]; d++) {\n        if (a[i][d] == 2 * a[i][j] || a[i][j] == 2 * a[i][d])\n          N[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << N[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, end, k;\n  float a[1000];\n  int n[100];\n  int num[100];\n  for (i = 0; i < 100; i++) {\n    num[i] = -1;\n  }\n  i = 0;\n  j = 1;\n  n[0] = -1;\n  for (i = 1; i < 100; i++)\n    n[i] = 0;\n\n  end = 0;\n  for (i = 0; i < 1000; i++) {\n    cin >> a[i];\n    if (a[i] == -1) {\n      end = i;\n      break;\n    }\n  }\n\n  for (i = 0; i < end; i++) {\n    if (a[i] == 0) {\n      n[j] = i;\n      j++;\n    }\n  }\n\n  k = 1;\n  while (n[k] != 0) {\n    num[k] = 0;\n    for (i = n[k - 1] + 1; i < n[k]; i++) {\n      for (j = n[k - 1] + 1; j < n[k]; j++) {\n        if (a[i] / a[j] == 2) {\n          num[k]++;\n        }\n      }\n    }\n    k++;\n  }\n\n  k = 1;\n  while (num[k] != -1) {\n\n    cout << num[k] << \"\\n\";\n    k++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][15], b[100] = {0}, i, j, k, s, m = 0, x;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1;; j++) {\n        b[m]++;\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n        else\n          continue;\n      }\n      m++;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    x = 0;\n    for (j = 0; j < b[i]; j++) {\n      s = 0;\n      for (k = 0; k < b[i]; k++) {\n        if (a[i][k] * 2 == a[i][j])\n          s = s + 1;\n      }\n      x = x + s;\n    }\n    printf(\"%d\\n\", x);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21910", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i = 1, count = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = i - 2;\n  while (a[0] != -1) {\n    count = 0;\n    int j, k = 0;\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n\n    i = 1;\n    while (a[i - 1] != 0) {\n      scanf(\"%d\", &a[i]);\n      i++;\n    }\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, k;\n  int count;\n  do {\n    i = 0;\n    count = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      for (k = 0; i > 0 && k < i; k++) {\n        if (a[i] / 2.0 == a[k] || a[i] * 2 == a[k])\n          count = count + 1;\n      }\n      i = i + 1;\n    } while (a[i - 1] != 0 && a[0] != -1);\n    if (a[0] != -1)\n      printf(\"%d\\n\", count);\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "21912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, n;\n  double f[15];\n  scanf(\"%d \", &a);\n  while (a != -1) {\n    i = 0;\n    while (a != 0) {\n      f[i] = a;\n      i++;\n      scanf(\"%d \", &a);\n    }\n    j = i;\n    n = 0;\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        f[k] = f[k] * 1.0;\n        if ((f[k] / f[i]) == 2.0 || (f[i] / f[k]) == 2.0)\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    cin >> a;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "21913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int t;\n  int n = 0;\n  int m;\n  int d[100] = {0};\n  int q[100] = {0};\n  int i;\n  int z = 0;\n  int x = 0;\n\n  t = 0;\n  do {\n    i = 0;\n    do {\n      scanf(\"%d\", &c[t][i]);\n      if (c[t][0] == -1) {\n        break;\n      }\n      if (c[t][i] == 0) {\n        break;\n      }\n      i++;\n      d[t]++;\n    } while (i <= 100);\n    if (c[t][0] == -1) {\n      break;\n    }\n    t++;\n    n++;\n  } while (t <= 100);\n  do {\n    i = 0;\n    do {\n      m = 0;\n      do {\n        if ((c[z][i] * 2) == c[z][m]) {\n          q[z]++;\n        }\n        m++;\n      } while (m <= d[z] - 1);\n      i++;\n    } while (i <= d[z] - 1);\n    z++;\n  } while (z <= n - 1);\n  while (x <= n - 1) {\n    cout << q[x] << \"\\n\";\n    x++;\n  }\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "12", "index": "21914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    int a[15] = {0};\n    int i = 1;\n    int k, j;\n    int sum = 0;\n    a[0] = b;\n    scanf(\"%d\", &a[i]);\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "21915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200], i, s = 0, cnt = 0, q, j;\n  while (1) {\n    s = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[1]);\n    if (a[1] == -1)\n      break;\n    for (i = 2; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      cnt++;\n    }\n    for (i = 1; i <= cnt - 1; i++) {\n      for (j = i + 1; j <= cnt; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          s++;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "12", "index": "21916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b[100][15], c, i, m, x, y, n, e;\n  c = 0;\n  i = 0;\n  for (m = 0; m < 16; m++) {\n    scanf(\"%d\", &a);\n    if (a != 0) {\n      b[i][m] = a;\n    }\n    if (a == 0) {\n      for (x = 0; x < m; x++) {\n        for (y = 0; y < m; y++) {\n          n = b[i][x] / b[i][y];\n          e = b[i][x] % b[i][y];\n          if (n == 2 && e == 0) {\n            c++;\n          }\n        }\n      }\n      printf(\"%d\\n\", c);\n      c = 0;\n      m = -1;\n      i++;\n    }\n    if (a == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0}, b[16] = {0}, c[100] = {0}, i, n, j, k, l, num;\n  l = 0;\n  for (j = 0; j < 100; j++) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        break;\n      }\n      if (a[i] == 0)\n        break;\n\n      n++;\n    }\n    num = 0;\n    for (i = 0; i < n; i++) {\n      b[i] = a[i];\n      for (k = 0; k < n; k++) {\n        if (b[i] == 2 * a[k])\n          num++;\n      }\n    }\n    c[j] = num;\n    l++;\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  for (j = 0; j < l - 1; j++) {\n    printf(\"%d\\n\", c[j]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21918", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, n, t = 0;\n  int a[16];\n  while (scanf(\"%d \", &n)) {\n    if (n != 0) {\n      a[i] = n;\n      i++;\n    } else {\n      for (j = 0; j < i - 1; j++) {\n        for (k = j + 1; k <= i - 1; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21919", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], b[20];\n  int i, j, k;\n  int n;\n  i = 1;\n  n = 0;\n\n  while (1) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      for (j = 1; j <= i - 1; j++)\n        b[j] = a[j] * 2;\n\n      for (j = 1; j <= i - 1; j++)\n        for (k = 1; k <= i - 1; k++) {\n          if (b[j] == a[k])\n            n++;\n        }\n\n      printf(\"%d\\n\", n);\n      i = 1;\n      n = 0;\n    } else\n      i++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = 0; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], b[15], m, i, j, z, num = 0;\n  memset(a, 0, 1000 * sizeof(int));\n  memset(b, 0, 15 * sizeof(int));\n  while (1) {\n    i = 0;\n    do {\n\n      cin >> m;\n      if (m == 0)\n        break;\n      if (m == -1)\n        break;\n      b[i] = m;\n      i++;\n\n    } while (1);\n    if (m == -1)\n      break;\n\n    for (j = 0; j < i; j++) {\n      for (z = 0; z < i; z++) {\n        if (b[j] * 2 == b[z])\n          a[num]++;\n      }\n    }\n    num++;\n  }\n  for (j = 0; j < num; j++)\n    cout << a[j] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "12", "index": "21922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, h;\n  int b[16] = {0};\n  while (1) {\n    i = 0;\n    while (cin >> a) {\n      if (a == (-1))\n        return 0;\n      else {\n        if (a != 0) {\n          b[i] = a;\n          i++;\n        } else\n          break;\n      }\n    }\n    h = 0;\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[j] != 0) {\n        for (k = 0; k <= i - 1; k++) {\n          if (b[j] == b[k] * 2)\n            h++;\n        }\n      } else\n        break;\n    }\n    cout << h << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k = 1;\n  while (k == 1) {\n    int a[16];\n    scanf(\"%d \", &a[0]);\n    int l = 0;\n    if (a[0] == -1)\n      k = 0;\n    else {\n      while (a[l] != 0) {\n        l++;\n        cin >> a[l];\n      }\n      int i, j, num = 0;\n      for (i = 0; i < l - 1; i++)\n        for (j = i + 1; j < l; j++)\n          if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n            num++;\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[16], i, n, a = 0, j;\n  cin >> s[0];\nloop:\n  a = 0;\n  i = 1;\n  do {\n    scanf(\" %d\", &s[i]);\n    i++;\n  } while (s[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++)\n      if (s[i] == 2 * s[i + j] || s[i + j] == s[i] * 2)\n        a = a + 1;\n  }\n  cout << a << \"\\n\";\n  scanf(\"%d\", &s[0]);\n  if (s[0] != -1)\n    goto loop;\n}\n"}
{"label": "12", "index": "21925", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int b[20] = {0};\n  int p = 2;\n  int j = 1, k = 2, num = 0;\n\n  while (cin >> b[1]) {\n\n    if (b[1] != -1) {\n      for (p = 2;; p++) {\n        cin >> b[p];\n        if (b[p] != 0)\n          continue;\n        else {\n\n          for (j = 1; j < p - 1; j++) {\n            for (k = j + 1; k <= p - 1; k++) {\n              if ((b[j] == b[k] * 2) || (b[k] == b[j] * 2)) {\n                num++;\n              }\n            }\n          }\n          cout << num << endl;\n          num = 0;\n          memset(b, sizeof(b), 0);\n          break;\n        }\n      }\n\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sc[300], ao[16];\n  int i, j, k, l, n, x;\n  i = 0;\n  j = 0;\n  k = 0;\n  l = 0, x = 0;\n  do {\n    n = 1;\n    for (i = 0; i < 16; i++) {\n      cin >> ao[i];\n      if (ao[i] == 0 || ao[i] == -1) {\n        n = i;\n        break;\n      }\n    }\n    i = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (ao[i] * 2 == ao[j]) {\n          k++;\n        }\n      }\n    }\n    sc[l] = k;\n    k = 0;\n    l++;\n  } while (n != 0);\n  for (x = 0; x < l - 1; x++) {\n    printf(\"%d\\n\", sc[x]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21927", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int n = 0, sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      else {\n        if (a[i] != 0)\n          n++;\n        else {\n          break;\n        }\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (a[j] == 2 * a[k])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, m[20], i = 0, j = 0, t = 0;\n  char c;\n  cin >> m[0] >> c;\n  while (m[0] > 0) {\n    n = 1;\n    t = 0;\n    while (c != '\\n')\n      scanf(\"%d%c\", &m[n++], &c);\n    n--;\n    for (i = 0; i < n; i++) {\n      for (j = n; j > i; j--)\n        if ((m[j] == 2 * m[i]) || (m[i] == 2 * m[j]))\n          t++;\n    }\n    cout << t << \"\\n\";\n    scanf(\"%d%c\", &m[0], &c);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0}, b[100] = {0}, n[100] = {0}, i, j, k;\n  int m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1) {\n      break;\n    }\n    if (a[i][0] != -1) {\n      m = m + 1;\n      n[i]++;\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] != 0) {\n          n[i] = n[i] + 1;\n        }\n        if (a[i][j] == 0) {\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        if (a[i][j] == 2 * a[i][k]) {\n          b[i] = b[i] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "12", "index": "21930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n = 0, a[16], shu, sum = 0;\n  while (1) {\n    scanf(\"%d \", &shu);\n    if (shu == -1)\n      return 0;\n    else if (shu == 0) {\n      for (i = 1; i <= n; i++) {\n        if (a[i] && a[i] % 2 == 0) {\n          for (j = 1; j <= n; j++)\n            if (a[j] == a[i] / 2)\n              sum++;\n        }\n      }\n      cout << sum << \"\\n\";\n      sum = 0;\n      n = 0;\n    } else {\n      n++;\n      a[n] = shu;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float s[16], t[16];\n  int u = 0, g = 0;\n  for (int k = 1; k < 100; k++) {\n    int a = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f\", &s[i]);\n      if (s[0] == -1 || scanf(\"\"))\n        printf(\"\");\n      else {\n        u += 1;\n        if (s[i] == 0)\n          break;\n        else {\n          t[i] = s[i];\n          a++;\n        }\n      }\n    }\n    int b = 0;\n    for (int h = 0; h < a; h++) {\n      for (int k = 0; k < a; k++) {\n        if (t[h] / t[k] == 2)\n          b++;\n      }\n    }\n    cout << b << \"\\n\";\n    g++;\n    if (g == u)\n      printf(\"\");\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][16], K, I, b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (K = 0; K <= j - 1; K++) {\n        if (a[i][K] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n  }\n  for (I = 0; I < i; I++)\n    cout << b[I] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], x, i, j, k, l, n;\n  for (i = 0;; i++) {\n    n = 0;\n    j = 0;\n    while (cin >> x) {\n      if (x == 0 || x == -1)\n        break;\n      a[j] = x;\n      j++;\n    }\n    if (x == -1)\n      break;\n    for (k = 0; k < j; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, k;\n  while (1) {\n    int sz[16];\n    int add = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[0] == -1) {\n      break;\n    }\n    for (i; i < 16; i++) {\n      sz[i] = 0;\n    }\n    for (i = 0; i < 16; i++) {\n      for (k = 0; k < 16; k++) {\n        if (sz[k] != 0 && sz[k] == 2 * sz[i]) {\n          add = add + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", add);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21935", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid swap(int *a, int *b) {\n  int temp = *a;\n  *a = *b;\n  *b = temp;\n}\n\nint find(int *s, int x, int l, int r) {\n  if (l > r)\n    return 0;\n  int mid = (l + r) / 2;\n  if (s[mid] == x)\n    return 1;\n  else {\n    if (s[mid] > x)\n      return find(s, x, l, mid - 1);\n    else\n      return find(s, x, mid + 1, r);\n  }\n}\n\nint main() {\n  int n = 0, i = 0;\n  int x = 0;\n  int s[1000] = {0};\n  while ((scanf(\"%d\", &x), x) != -1) {\n    if (x != 0) {\n      s[n++] = x;\n      for (i = n - 1; (i > 0) && (s[i] < s[i - 1]); i--)\n        swap(&s[i], &s[i - 1]);\n    } else {\n      int count = 0;\n      for (i = 0; i < n; i++) {\n        if (find(s, 2 * s[i], i + 1, n))\n          count++;\n      }\n      printf(\"%d\\n\", count);\n      for (i = 0; i < n; i++)\n        s[i] = 0;\n      n = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[300], i, n, k, j;\n  for (i = 0; i <= 300; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  for (k = 0; k <= 300; k++) {\n    if (a[k] == -1)\n      break;\n    if (a[k - 1] == 0 || k == 0) {\n      n = 0;\n      for (i = k; a[i] != 0; i++) {\n\n        for (j = i; a[j] != 0; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            n = n + 1;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "21937", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int m;\n  while (cin >> m) {\n    if (m == -1)\n      break;\n    int a[15], i = 0, j, k, count = 0;\n    a[0] = m;\n    while (cin >> m) {\n      if (m == 0)\n        break;\n      i++;\n      a[i] = m;\n    }\n    k = i + 1;\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], n, r = 0, i, j, count = 0;\n  memset(a, 0, sizeof(a));\n  for (;;) {\n    cin >> n;\n    if (n == -1)\n      break;\n    else if (n != 0) {\n      a[r] = n;\n      r++;\n      continue;\n    } else if (n == 0) {\n\n      for (i = 0; i < r - 1; i++) {\n        for (j = i + 1; j < r; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            count++;\n        }\n        a[i] = 0;\n      }\n      a[i] = 0;\n      cout << count << \"\\n\";\n      count = 0;\n      r = 0;\n      i = 0;\n      j = 0;\n      continue;\n    }\n  }\n}\n"}
{"label": "12", "index": "21939", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[15] = {0}, n;\n\n  while (1) {\n    n = 0;\n    for (int i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    for (int j = 0; j <= 15; j++) {\n      if (a[j] == 0 || a[j] == -1)\n        break;\n      for (int k = j + 1; k <= 15; k++) {\n        if (a[k] == 0)\n          break;\n        else if (a[k] * 2 == a[j] || a[j] * 2 == a[k])\n          n++;\n      }\n    }\n    if (a[0] != -1) {\n      cout << n << endl;\n      for (int i = 0; i <= 15; i++)\n        a[i] = 0;\n      n = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21940", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], k, i, j;\n  for (k = 0;; k++) {\n    int n = -1, num = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100][16];\n  int sum[100] = {0};\n  float y;\n  int i, j, k;\n  for (j = 0; j < 100; j++) {\n    for (i = 0; i < 16; i++) {\n      cin >> x[j][i];\n      if (x[j][0] == -1)\n        goto loop;\n      if (x[j][i] == 0)\n        break;\n    }\n  }\nloop:\n  for (j = 0; j < 100; j++) {\n    if (x[j][0] != -1) {\n      for (i = 0; i < 16; i++) {\n        if (x[j][i] == 0)\n          break;\n        for (k = 0; k < 16; k++) {\n          if (x[j][k] == 0)\n            break;\n          y = 1.0 * x[j][i] / (1.0 * x[j][k]);\n          if (y == 2)\n            sum[j] = sum[j] + 1;\n        }\n      }\n      printf(\"%d\\n\", sum[j]);\n    }\n    if (x[j][0] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i, j, count;\n  cin >> a[0];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n    cin >> a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int an[50], *p, i, t = 0, *q;\n  for (i = 0;;) {\n    scanf(\"%d\", &an[i]);\n    if (an[i] == -1)\n      break;\n    else {\n      for (i = 1;; i++)\n\n      {\n        cin >> an[i];\n        if (an[i] == 0)\n          break;\n      }\n      for (p = an; *p != 0; p++) {\n        for (q = an; *q != 0; q++)\n          if (*q == (*p) * 2)\n            t++;\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[16];\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    int count = 0;\n    for (int m = 0; m < i; m++) {\n      for (int n = 0; n < i; n++) {\n        if (a[m] == a[n] * 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "21945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float sz[16];\n  int n[100];\n  int i, k;\n  for (i = 0; i >= 0; i++) {\n    n[i] = 0;\n    for (k = 0; k < 16; k++) {\n      scanf(\"%f\", &sz[k]);\n      if (sz[k] == 0 || sz[0] == -1)\n        break;\n    }\n    for (int a = 0; a < k - 1; a++) {\n      for (int b = a + 1; b < k; b++) {\n        if (sz[a] == sz[b] * 2 || sz[a] == sz[b] / 2)\n          n[i]++;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++)\n    cout << n[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int data[16];\n  int i, j;\n  int len;\n  int count;\n\n  while (1) {\n    count = 0;\n    scanf(\"%d\", &data[0]);\n    if (data[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> data[i];\n      if (data[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n\n    for (i = 0; i <= len - 1; i++)\n      for (j = 0; j <= len - 1; j++)\n        count = count + (data[i] == 2 * data[j]);\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21947", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, k, g[1000][16], o;\n  for (i = 0; i <= 999; i++) {\n    int s = 0;\n    for (l = 0; l < 16; l++) {\n      cin >> g[i][l];\n      if (g[i][l] == 0)\n        break;\n    }\n    if (g[i][0] == -1) {\n      break;\n    }\n    for (o = 0; o < 14 && g[i][o] > 0; o++) {\n      for (k = o + 1; k < 15; k++) {\n        if (g[i][k] - 2 * g[i][o] == 0 || g[i][o] - 2 * g[i][k] == 0)\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "21948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, m = 0;\n  int a[16];\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      m = i;\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n += 1;\n      }\n    }\n    printf(\"%d\\n\", n / 2);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21949", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a[100];\n  int i, j, t;\n  do {\n    t = 0;\n    for (i = 0; i <= 99; i++) {\n      cin >> a[i];\n      if (i >= 1) {\n        if (a[i] == 0)\n          break;\n\n        for (j = 0; j <= i - 1; j++) {\n          if ((a[i] == 2 * a[j]) || (a[i] == a[j] / 2))\n            t = t + 1;\n        }\n      }\n    }\n    if (a[0] != -1) {\n      printf(\"%d\\n\", t);\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k, sz[17], n = 0;\n  for (i = 0; i < 17; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == -1)\n      break;\n    else {\n      if (i > 0) {\n        if (sz[i] > 0) {\n          for (j = 0; j < i; j++) {\n            if (2 * sz[j] == sz[i] || 2 * sz[i] == sz[j])\n              n++;\n          }\n        } else {\n          cout << n << \"\\n\";\n          n = 0;\n          i = 0;\n          j = 0;\n          for (k = 0; k < 16; k++)\n            sz[k] = -2;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][15], i, j, k, l;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      int n = 0;\n      for (j = 1;; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n      }\n      for (k = 0; k <= j - 1; k++)\n        for (l = 0; l <= j - 1; l++)\n          if (a[i][k] == 2 * a[i][l])\n            n = n + 1;\n\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21952", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], sum = 0, i, j, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        break;\n      } else {\n        n++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    n = 0;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21953", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][16], i, j, k, t;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1; a[i][j - 1] != 0; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (j = 0; j < i; j++) {\n    int n = 0;\n    for (k = 0; a[j][k + 1] != 0; k++) {\n      for (t = k + 1; a[j][t] != 0; t++) {\n        if (a[j][k] == 2 * a[j][t] || a[j][t] == 2 * a[j][k])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, t, count, ans;\n  int num[17];\n\n  while (1) {\n    i = 1;\n    scanf(\"%d \", &num[i]);\n    if (num[i] == -1)\n      break;\n    ans = 0;\n    do {\n      i++;\n      cin >> num[i];\n    } while (num[i] != 0);\n    count = i - 1;\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = 1; j <= count - i; j++) {\n        if (num[j] > num[j + 1]) {\n          t = num[j];\n          num[j] = num[j + 1];\n          num[j + 1] = t;\n        }\n      }\n\n    for (i = 1; i <= count - 1; i++)\n      for (j = i + 1; j <= count; j++) {\n        if (num[i] * 2 == num[j]) {\n          ans++;\n          break;\n        } else {\n          if (num[i] * 2 < num[j])\n            break;\n        }\n      }\n\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21955", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a[1000];\n\n  int i, t, j, k, tr, sum[20], l = 0;\n\n  while (scanf(\"%d\", &t), t != -1) {\n    sum[l] = 0;\n    i = 0;\n    a[0] = t;\n    while (i++, scanf(\"%d\", &a[i]), a[i])\n      ;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - j - 1; k++) {\n        if (a[k] > a[k + 1]) {\n          tr = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = tr;\n        }\n      }\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i; k++) {\n        if ((2 * a[j]) == a[k])\n          sum[l]++;\n      }\n    }\n    l++;\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%d \", sum[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "21956", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sc[300], ao[16];\n  int i, j, k, l, n, x;\n  i = 0;\n  j = 0;\n  k = 0;\n  l = 0, x = 0;\n  do {\n    n = 1;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &ao[i]);\n      if (ao[i] == 0 || ao[i] == -1) {\n        n = i;\n        break;\n      }\n    }\n    i = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (ao[i] * 2 == ao[j]) {\n          k++;\n        }\n      }\n    }\n    sc[l] = k;\n    k = 0;\n    l++;\n  } while (n != 0);\n  for (x = 0; x < l - 1; x++) {\n    printf(\"%d\\n\", sc[x]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], n, m, i = 1, t = 0;\n\n  cin >> a[1];\n\n  while (a[i] != -1) {\n    while (a[i] > 0) {\n      i = i + 1;\n      cin >> a[i];\n    }\n\n    for (m = 1; m < i; m++)\n      for (n = m + 1; n <= i; n++)\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          t = t + 1;\n\n    cout << t << endl;\n\n    for (i = 0; i < 17; i++) {\n      a[i] = 0;\n    }\n\n    t = 0;\n    i = 1;\n\n    cin >> a[1];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21958", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, num, count = 0, array[15];\n  while (scanf(\"%d \", &n) && n != -1) {\n    memset(array, 0, sizeof(array));\n    array[0] = n;\n    i = 1;\n    num = 1;\n    while (cin >> n && n != 0) {\n      array[i++] = n;\n      num++;\n    }\n    sort(array, array + num);\n    for (i = num - 1; i > 0; i--)\n      for (j = i - 1; j >= 0; j--) {\n        if (array[i] == 2 * array[j])\n          count++;\n      }\n    cout << count << \"\\n\";\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    int a[16];\n    int i, j, k, m, n = 0;\n    for (i = 0; i < 16; i++)\n\n    {\n      scanf(\"%d\", &a[i]);\n\n      if (a[i] == 0) {\n        for (m = i + 1; m < 16; m++)\n          a[m] = 101;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < i; j++)\n      for (k = 0; k < i; k++) {\n        if (a[k] * 2 - a[j] == 0)\n          n++;\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, m, n, a, result[20] = {0};\n  double num[15];\n  scanf(\"%lf\", &num[0]);\n  for (a = 1; num[0] != -1; a++) {\n    for (i = 1;; i++) {\n      cin >> num[i];\n      if (num[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (m = 0; m <= i; m++)\n        if (num[m] / num[j] == 2)\n          result[a]++;\n    }\n    scanf(\"%lf\", &num[0]);\n  }\n  for (j = 1; j < a; j++)\n    cout << result[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "21961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], sum = 0, j, i, k, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      n = n + 1;\n      if (a[i] == 0) {\n        n = n - 1;\n        for (k = 0; k < (n - 1); k++) {\n          for (j = k + 1; j < n; j++) {\n            if ((a[j] == a[k] * 2) || (a[k] == a[j] * 2)) {\n              sum = sum + 1;\n            }\n          }\n        }\n        printf(\"%d\\n\", sum);\n        i = 0;\n        sum = 0;\n        n = 0;\n        break;\n      } else {\n        if (a[i] == -1) {\n          return 0;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000];\n  int n, i, j;\n  int k = 0;\n  scanf(\"%d\", &shu[0]);\n  for (n = 0; shu[n] != 0; n++) {\n    scanf(\"%d\", &shu[n + 1]);\n  }\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j <= n; j++) {\n      if (shu[i] == 2 * shu[j]) {\n        k++;\n      }\n    }\n  }\n  if (k != 0) {\n    k = k - 1;\n    printf(\"%d\", k);\n  } else\n    cout << k;\n  return 0;\n}\n"}
{"label": "12", "index": "21963", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, x;\n  int sz[16];\n  while (1) {\n    x = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    for (m = 0; m <= i - 2; m++) {\n      for (n = m + 1; n <= i - 1; n++) {\n        if (sz[m] == 2 * sz[n] || sz[n] == 2 * sz[m])\n          x++;\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count, n;\n  for (i = 0; i < 16; i++) {\n    count = 0;\n    n = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[0] == -1)\n        break;\n      if (a[j] == 0)\n        break;\n      count++;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < count; j++) {\n      for (k = 0; k < count; k++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21965", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, t, a[16] = {0}, sum = 0, k = 0;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        sum++;\n      else\n        break;\n    }\n    for (i = 0; i <= sum; i++) {\n      for (j = i + 1; j <= sum; j++) {\n        if (a[i] == 2 * a[j] || a[j] == a[i] * 2)\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n    sum = 0;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21966", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ch[16], i, j, n, m;\n\n  scanf(\"%d \", &ch[0]);\n\n  while (ch[0] != -1) {\n    n = 0;\n\n    for (i = 1; ch[i - 1] != 0; i++) {\n      n++;\n\n      cin >> ch[i];\n    }\n\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (ch[i] % 2 == 1)\n        continue;\n      else {\n        for (j = 0; j < n; j++) {\n          if (ch[i] == 2 * ch[j])\n            m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n\n    cin >> ch[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21967", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int z[15], r[100];\n  int i, j, l;\n  int sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &z[i]);\n    if (z[i] == 0) {\n      r[sum] = 0;\n      for (j = 0; j < i - 1; j++) {\n        for (l = j + 1; l < i; l++) {\n          if (z[j] == 2 * z[l] || z[j] == 0.5 * z[l]) {\n            r[sum]++;\n          }\n        }\n      }\n      sum++;\n      i = -1;\n    } else if (z[i] == -1)\n      break;\n  }\n  for (i = 0; i < sum; i++) {\n    printf(\"%d\\n\", r[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, d = 0, s[15], i, j;\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if (s[i] == s[j] * 2)\n          d++;\n        else\n          d = d;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n}\n"}
{"label": "12", "index": "21969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[100][16];\n  int sum[100] = {0};\n  float y;\n  int i, j, k;\n  for (j = 0; j < 100; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &x[j][i]);\n      if (x[j][0] == -1)\n        goto loop;\n      if (x[j][i] == 0)\n        break;\n    }\n  }\nloop:\n  for (j = 0; j < 100; j++) {\n    if (x[j][0] != -1) {\n      for (i = 0; i < 16; i++) {\n        if (x[j][i] == 0)\n          break;\n        for (k = 0; k < 16; k++) {\n          if (x[j][k] == 0)\n            break;\n          y = 1.0 * x[j][i] / (1.0 * x[j][k]);\n          if (y == 2)\n            sum[j] = sum[j] + 1;\n        }\n      }\n      printf(\"%d\\n\", sum[j]);\n    }\n    if (x[j][0] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21970", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int i = 0, a[16];\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1) {\n      break; \n    }\n\n    int b[105] = {0};\n    b[a[i]] = 1;\n\n    while (1) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n      b[a[i]] = 1;\n    }\n\n    int j;\n    int total = 0;\n    for (j = 1; j < 50; j++) {\n      if (b[j] == 1 && b[j * 2] == 1) {\n        total++;\n      }\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21971", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], len, count, i, j;\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    len = 0;\n    do {\n      len++;\n      scanf(\"%d \", &a[len]);\n    } while (a[len] != 0);\n    count = 0;\n    for (i = 0; i < len; i++) {\n      for (j = 0; j < len; j++) {\n        if (j == i) {\n          continue;\n        } else {\n          if (a[j] == (2 * a[i]))\n            count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0};\n  int i, k, s, t, p;\n  for (k = 1;; k++) {\n    p = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 17; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (s = 0; s < i; s++) {\n        for (t = 0; t < i; t++) {\n          if (a[t] == 2 * a[s]) {\n            p = p + 1;\n            break;\n          }\n        }\n      }\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[10000], m[15];\n  int *p;\n  int i, j, k = 0, total, all = 0, sum = 0, q, t;\n  p = &n[0];\n  for (i = 0;; i++) {\n    scanf(\"%d\", &n[i]);\n    if (n[i] == 0) {\n      all++;\n    }\n    if (n[i] == -1) {\n      break;\n    }\n  }\n  while (all > 0) {\n    for (i = 0, t = 0; n[k] != 0; i++, k++) {\n      m[i] = n[k];\n      t++;\n    }\n    k = k + 1;\n    total = 0;\n    for (q = 0; q < t; q++) {\n      for (j = 0; j < t; j++) {\n        if ((m[q] / m[j] == 2) && (m[q] % m[j] == 0)) {\n          total++;\n        }\n      }\n    }\n    printf(\"%d\\n\", total);\n    all--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21974", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i = 1;\n  int n;\n  int j, k, ans;\n  i = 1;\n  do {\n    cin >> n;\n    if (n != -1) {\n      if (n == 0) {\n        ans = 0;\n        for (j = 1; j <= i - 1; j++)\n          for (k = 1; k <= i - 1; k++)\n            if (num[j] == 2 * num[k]) {\n              ans += 1;\n            }\n        cout << ans << endl;\n        i = 1;\n      } else {\n        num[i] = n;\n        i += 1;\n      }\n    }\n  } while (n != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, k, n = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          n++;\n      }\n    printf(\"%d\\n\", n);\n    n = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "21976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, x;\n  int sz[16];\n  while (1) {\n    x = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    for (m = 0; m <= i - 2; m++) {\n      for (n = m + 1; n <= i - 1; n++) {\n        if (sz[m] == 2 * sz[n] || sz[n] == 2 * sz[m]) {\n          x++;\n        }\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[16] = {0};\nint main() {\n  while (cin >> a[0]) {\n    if (a[0] == (-1))\n      break;\n    int i, j, countnumber = 0, countpair = 0;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    countnumber = i + 1;\n    for (i = 0; i < countnumber - 1; i++)\n      for (j = i + 1; j < countnumber; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          countpair++;\n      }\n    printf(\"%d\\n\", countpair);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21978", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, c, m, a[17];\n  while (1) {\n\n    for (i = 1; i <= 16; i++) {\n      a[i] = 0;\n      m = 0;\n    }\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      if (a[i] == 0) {\n        c = i;\n        break;\n      }\n    }\n    for (i = 1; i < c; i++)\n\n    {\n      for (j = i; j < c; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, sz[100], erbei[100], *p1, *p2, sum = 0;\n  p1 = sz;\n  p2 = erbei;\n  for (p1 = sz;; p1++) {\n    scanf(\"%d\", p1);\n    n++;\n    if (*p1 == 0) {\n      for (p1 = sz; p1 < sz + n - 1; p1++) {\n        *p2 = *p1 * 2;\n        p2++;\n      }\n      for (p2 = erbei; p2 < erbei + n - 1; p2++) {\n        for (p1 = sz; p1 < sz + n - 1; p1++) {\n          if (*p2 == *p1) {\n            sum++;\n          }\n        }\n      }\n      cout << sum << \"\\n\";\n      p1 = sz - 1;\n      p2 = erbei;\n      sum = 0;\n      n = 0;\n    }\n    if (*p1 == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, sum;\n\n  while (1) {\n\n    sum = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      for (j = 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          sum++;\n        }\n      }\n    }\n    if (a[1] != -1)\n      cout << sum << endl;\n    if (a[1] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21981", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char exp;\n  int i, c, t, w, n, s, t2, j, k, a[16];\n  long m, e;\n  float x, y;\n  double r, d, b, h, g[100];\n\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21982", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], i, j, k, t, N;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &num[0]);\n    if (num[0] == -1)\n      break;\n    N = 0;\n    for (j = 1;; j++) {\n      scanf(\"%d \", &num[j]);\n      if (num[j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (t = 0; t <= j - 1; t++) {\n        if (num[k] == 2 * num[t])\n          N++;\n      }\n    }\n    printf(\"%d\\n\", N);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21983", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid initarray(int a[], int b, int length);\nvoid base(int a[1000]);\nint twice(int a[1000]);\nint main(void) {\n  int a[1000];\n  int t[1000];\n  int i, j, k, l;\n  i = 0;\n  for (i = 0; i < 1000; i++) {\n    a[i] = -2;\n  }\n  i = 0;\n  k = -2;\n  while (a[i] != -1) {\n    while (k != 0) {\n      cin >> k;\n      a[i] = k;\n      i++;\n    }\n    base(a);\n    j = twice(a);\n    printf(\"%d\\n\", j);\n    initarray(a, -2, 1000);\n    i = 0;\n    k = -2;\n  }\n  return 1;\n}\n\nvoid initarray(int a[], int b, int length) {\n  int i;\n  for (i = 0; i < length; i++) {\n    a[i] = b;\n  }\n}\n\nvoid base(int a[1000]) {\n  int b[1000 + 1];\n  int i, j;\n  initarray(b, 0, 1000);\n  for (i = 0; i < 1000; i++) {\n    if (a[i] > 0) {\n      b[a[i]]++;\n    }\n  }\n  j = 0;\n  for (i = 0; i <= 1000; i++) {\n    if (b[i] == 1) {\n      a[j] = i;\n      j++;\n    }\n  }\n}\n\nint twice(int a[1000]) {\n  int i, j, t, result;\n\n  i = 0;\n  j = 0;\n  t = 0;\n  result = 0;\n  while ((a[i] <= 50) && (a[j] > 0)) {\n    t = a[i] * 2;\n    j = i;\n    while ((a[j] <= t) && (a[j] > 0)) {\n      if (a[j] == t) {\n        result++;\n      };\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  return result;\n}\n"}
{"label": "12", "index": "21984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i, j, m, k, b, n;\n  for (n = 0;; n++) {\n    for (i = 0; i < 17; i++) {\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m < 0)\n        goto er;\n      a[i] = m;\n    }\n    k = i;\n    b = 0;\n    for (i = 0; i < k; i++) {\n      for (j = i + 1; j < k; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\ner:\n  return 0;\n}\n"}
{"label": "12", "index": "21985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, c = 0, e = 0, n, l;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      e = e + 1;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (l = 0; l < e - 1; l++)\n      for (n = l + 1; n < e - 1; n++) {\n        if ((a[l] / a[n] == 2 && a[l] % a[n] == 0) ||\n            (a[n] / a[l] == 2 && a[n] % a[l] == 0))\n          c = c + 1;\n      }\n    cout << c << \"\\n\";\n\n    e = c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b, i = 0, k;\n  while (1) {\n    b = 0;\n    int a[16] = {0};\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      for (k = 0; k < i; k++) {\n        if ((a[i] == 2 * a[k]) || (a[i] == 0.5 * a[k]))\n          b++;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0};\n  int j = 1, i, m, k;\n  cin >> a[0];\n  do {\n    m = 0;\n    k = 0;\n    for (i = 1; i < 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      else\n        j++;\n    }\n    for (i = 0; i <= j - 1; i++) {\n      for (k = 0; k <= j - 1; k++) {\n        if (a[k] == 2 * a[i])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    scanf(\"%d \", &a[0]);\n    if (a[0] == 0)\n      cin >> a[0];\n    j = 1;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int i, j, n, count;\n  while (cin >> a[1] && a[1] != -1) {\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      scanf(\"%d \", &a[n]);\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21989", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int num[100];\n  int test, count = 0;\n\n  cin >> n;\n  while (n != -1) {\n    num[0] = n;\n    for (int i = 1; n != 0; i++) {\n      cin >> n;\n      num[i] = n;\n    }\n    for (int j = 0; num[j] != 0; j++) {\n      test = num[j];\n      for (int k = 0; num[k] != 0; k++) {\n        if (num[k] == 2 * test) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n    cin >> n;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int count = 0, num[20][16], i, j, t;\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &num[0][i]);\n    if (num[0][i] == 0)\n      break;\n  }\n  for (i = 1; i < 20; i++) {\n    if (num[i - 1][0] != -1) {\n      for (j = 0; j < 16; j++) {\n        scanf(\"%d\", &num[i][j]);\n        if (num[i][j] == 0 || num[i][j] == -1)\n          break;\n      }\n    } else\n      break;\n  }\n  for (i = 0; i < 20; i++) {\n    if (num[i][0] == -1)\n      break;\n    else {\n      for (j = 0; j < 16; j++) {\n        if (num[i][j] == 0)\n          break;\n        else {\n          for (t = 0; t < 16; t++) {\n            if (num[i][t] == 0)\n              break;\n            else {\n              if (num[i][t] == 2 * num[i][j])\n                count++;\n            }\n          }\n        }\n      }\n\n      printf(\"%d\\n\", count);\n      count = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d = 0, s[15], i, j;\n\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if ((s[i] == s[j] * 2) && (s[i] != 0) && (s[j] != 0))\n          d++;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i = 0, n = 0, j, k, m;\n  for (m = 1;; m++) {\n    i = 0;\n    n = 0;\n    while (cin >> a[i]) {\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      } else {\n        i++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          n++;\n        }\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i, m, n, k;\n  for (;;) {\n    k = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (m = 0; m < i; m++)\n      for (n = 0; n < i; n++)\n        if (a[m] == 2 * a[n])\n          k++;\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[100][15], i = 0, j = 0, x = 10, k = 0, m, num = 0;\n  for (i = 0; i < 100; i++) {\n    if (x == -1)\n      break;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &x);\n      if (x == -1) {\n        break;\n      }\n      if (x == 0) {\n        break;\n      }\n      a[i][j] = x;\n    }\n  }\n  k = i;\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < 15; j++) {\n      for (m = j + 1; m < 15; m++) {\n        if (a[i][j] * 1.0 / a[i][m] == 2 || a[i][m] * 1.0 / a[i][j] == 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "21995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  while (1) {\n    s = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] == a[k] * 2) {\n          s++;\n          break;\n        }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "21996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], n, i, j, k;\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      j = i;\n      for (i = 0; i < j - 1; i++) {\n        for (k = i + 1; k < j; k++) {\n          if (a[k] == 2 * a[i] || a[i] == 2 * a[k])\n            n++;\n        }\n      }\n      printf(\"%d \", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "21997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i = 0, n = 0, j;\n  int count = 0;\n  do {\n    n = 0;\n    count = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] != -1) {\n      i = 1;\n      do {\n        scanf(\"%d\", &a[i]);\n        i++;\n        count++;\n      } while (a[i - 1] != 0);\n\n      for (i = 0; i < count; i++) {\n        for (j = i + 1; j < count; j++) {\n          if (a[i] == 2 * a[j] || 2 * a[i] == a[j]) {\n            n++;\n          }\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "21998", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[15], sum = 0, b, n = 0; \n  while (cin >> b) {\n    \n    if (b == -1)\n      break;\n\n    \n    else if (b == 0) {\n      for (int i = 0; i <= n - 1; i++) {\n        \n        for (int j = i + 1; j <= n - 1; j++) {\n          \n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n            sum++;\n          }\n        }\n      }\n      cout << sum << endl;\n      sum = 0;\n      n = 0;\n    }\n\n    \n    else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "21999", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int shuru[20] = {0};\n\n  while (true) {\n    int i = 1, j, k, s, no;\n    s = 0;\n    cin >> shuru[0];\n    if (shuru[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> shuru[i];\n      if (shuru[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((shuru[j] == 2 * shuru[i]) || (2 * shuru[j] == shuru[i]))\n          s++;\n    }\n    \n    cout << s << endl;\n    for (i = 0; i <= 14; i++)\n      shuru[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[18];\n  int i, j, k, c, d;\n  double b;\n  a[0] = 0;\n  for (i = 1;; i++) {\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (j = 2;; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n    }\n    k = 0;\n    for (c = 1; c < j; c++) {\n      for (d = 1; d < j; d++) {\n        b = a[c] / a[d];\n        if (b == 2)\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15][17], i, num, j, k, l, h;\n  scanf(\"%d\", &a[0][0]);\n  for (j = 0; j <= 15 && a[j][0] != -1; j++) {\n    for (i = 1; i <= 15 && a[j][i - 1] != 0; i++)\n      scanf(\"%d\", &a[j][i]);\n    scanf(\"%d\", &a[j + 1][0]);\n  }\n  for (l = 0; l <= 14 && a[l][0] != -1; l++) {\n    num = 0;\n    for (k = 0; k <= 15 && a[l][k] != 0; k++) {\n      for (h = 0; h <= 15 && a[l][h] != 0; h++) {\n        if (a[l][k] == 2 * a[l][h])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, i = 0, j = 0,\n      k = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n\n    i = 1;\n    do {\n      scanf(\"%d\", &a[i]);\n      if (a[i] < 0) {\n      }\n      i++;\n    } while (a[i - 1]);\n    for (i = 0; i < 16; i++) {\n      if (a[i]) {\n        for (j = 0; j < 16; j++) {\n          if (a[i] == 2 * a[j])\n            k += 1;\n        }\n      }\n    }\n    cout << k << \" \";\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n  }\n}\n"}
{"label": "12", "index": "22003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[18] = {0}, i, n, ii, s;\n  char c;\n  while (1) {\n    i = 1;\n    while (1) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    n = i;\n    i = 1;\n    s = 0;\n    while (i < n) {\n      ii = 1;\n      while (ii < n) {\n        if (a[ii] == 2 * a[i])\n          s++;\n        ii++;\n      }\n      i++;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h, k, m;\n  int a[20];\n  for (k = 0;; k++) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1) {\n        break;\n      }\n      m = 0;\n      if (a[i] == 0) {\n        for (j = 0; j < i - 1; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[k] == a[j] * 2 || a[j] == a[k] * 2)\n              m++;\n          }\n        }\n        cout << m << \"\\n\";\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[30];\n  int i, m, j, temp, n;\n  int k = 0;\n  for (i = 0; i < 300; i++) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 1; j < 30; j++) {\n        scanf(\"%d\", &a[j]);\n        if (a[j] == 0) {\n          break;\n        }\n      }\n      for (m = 0; m < j; m++) {\n        for (n = 0; n < j - 1; n++) {\n          if (a[n] == 2 * a[n + 1]) {\n            k++;\n          }\n          temp = a[n];\n          a[n] = a[n + 1];\n          a[n + 1] = temp;\n        }\n      }\n      cout << k << \"\\n\";\n      k = 0;\n      j = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  static int a[16], b[16];\n  int n, i, j, s = 0;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      b[i - 1] = 2 * a[i - 1];\n      scanf(\"%d\", &a[i]);\n    }\n    n = i - 2;\n    s = 0;\n    for (i = 0; i <= n; i++)\n      for (j = 0; j <= n; j++)\n        if (a[i] == b[j]) {\n          s++;\n          break;\n        }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22007", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i, k, n;\n  while (1) {\n    memset(num, 0, sizeof(num));\n    i = 0;\n    k = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      cin >> num[i];\n      if (num[i] == 0)\n        break;\n      for (k = 1; k <= i; k++) {\n        if ((num[k] / num[i] == 2 && num[k] % num[i] == 0) ||\n            (num[i] / num[k] == 2 && num[i] % num[k] == 0)) {\n          n++;\n        }\n      }\n    }\n    if (num[1] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, geshu, get, n = 0;\n  int shuzu[15];\n  for (j = 0;; j++) {\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &get);\n      if (get == -1) {\n        goto end;\n      }\n      shuzu[i] = get;\n      if (get == 0) {\n        geshu = i;\n        break;\n      }\n    }\n    for (k = 0; k < geshu; k++) {\n      for (l = 0; l < geshu; l++) {\n        if (shuzu[k] == 2 * shuzu[l]) {\n          n = n + 1;\n        }\n      }\n    }\n    cout << n << \"\\n\";\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char s[100];\n  for (;;) {\n\n    cin >> s;\n    int i, j, k = 0, m = 0, x[15], n = 0;\n    if (s[0] == '-' && s[1] == '1')\n      break;\n    else {\n      for (i = 0;; i++) {\n        if (s[i] == '0')\n          break;\n        else {\n          if ('1' <= s[i] && s[i] <= '9') {\n            j = s[i] - '0';\n            k = k * 10 + j;\n\n          } else {\n            x[m] = k;\n            m++;\n            k = 0;\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++)\n      for (j = i + 1; j < m; j++) {\n        if ((x[i] / x[j] == 2 && x[i] % x[j] == 0) ||\n            (x[j] / x[i] == 2 && x[j] % x[i] == 0))\n          n++;\n      }\n    cout << n << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], b[20], i, l, j, n, p = 0, num = 0;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &n);\n    if (n == -1)\n      break;\n    else {\n      a[0] = n;\n      for (l = 1;; l++) {\n        scanf(\"%d\", &a[l]);\n        if (a[l] == 0)\n          break;\n      }\n      for (i = 0; a[i] != 0; i++)\n        for (j = 0; a[j] != 0; j++) {\n          if (a[i] == a[j] * 2)\n            num++;\n        }\n      b[p] = num;\n      p++;\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  while (1) {\n    int a[20] = {0}, sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        k = i;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < k; i++)\n      for (j = i; j < k; j++) {\n        if (a[j] == 2 * a[i] || 2 * a[j] == a[i])\n          sum++;\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "12", "index": "22012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      cin >> s[i];\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = 0; j < count; j++) {\n        if (s[i] == s[j] * 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22013", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100], i, j, num = 0, total = 0;\n  while (1) {\n    num = 0;\n    while (1) {\n      cin >> a[num];\n      if (a[num] == 0)\n        break;\n      if (a[num] == -1)\n        return 0;\n      num++;\n    }\n\n    total = 0;\n    for (i = 0; i < num; i++) {\n\n      for (j = 0; j < num; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22014", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], b[20], i, l, j, n, p = 0, num = 0;\n  while (1) {\n    num = 0;\n    cin >> n;\n    if (n == -1)\n      break;\n    else {\n      a[0] = n;\n      for (l = 1;; l++) {\n        scanf(\"%d\", &a[l]);\n        if (a[l] == 0)\n          break;\n      }\n      for (i = 0; a[i] != 0; i++)\n        for (j = 0; a[j] != 0; j++) {\n          if (a[i] == a[j] * 2)\n            num++;\n        }\n      b[p] = num;\n      p++;\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  while (cin) {\n    int temp, num = 0, i = 0, j = 0, k = 0;\n    for (i = 0; scanf(\"%d \", &a[i]); i++)\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0) {\n        for (j = 1; j < i; j++)\n          for (k = 0; k < i - j; k++)\n            if (a[k] > a[k + 1]) {\n              temp = a[k];\n              a[k] = a[k + 1];\n              a[k + 1] = temp;\n            }\n        for (j = 0; j < i; j++)\n          for (k = j + 1; k < i; k++)\n            if (a[j] * 2 == a[k])\n              num++;\n        cout << num << endl;\n        num = 0;\n        break;\n      }\n  }\n}\n"}
{"label": "12", "index": "22016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; i <= 100; i++) {\n    cin >> a[i][1];\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f() {\n  int a[15], i, m = 0, s = 0, j;\n  scanf(\"%d\", &a[0]);\n  if (a[0] == -1)\n    s = -1;\n  else {\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d\", &a[i]);\n      m = m + 1;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (a[i] == 2 * a[j]) {\n          s = s + 1;\n        }\n      }\n    }\n  }\n  return s;\n}\nint main() {\n  int a[100], i = 0, j;\n  while (1) {\n    a[i] = f();\n    if (a[i] == -1)\n      break;\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%d\", a[j]);\n    if (j != i - 1)\n      cout << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, b = 0, s[100][16], t[100], k;\n  for (i = 0;; i++) {\n\n    for (j = 0;; j++) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0 || s[i][j] == -1)\n        break;\n      t[i]++;\n    }\n    if (s[i][j] == 0)\n      b++;\n    if (s[i][j] == -1)\n      break;\n  }\n  for (i = 0; i < b; i++) {\n    int sum = 0;\n    for (j = 0; j < t[i]; j++) {\n      for (k = 0; k < t[i]; k++) {\n        if (s[i][j] == s[i][k] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22019", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[17]; \n  int n, s;  \n\n  while (cin >> a[1], a[1] != -1) {\n    n = 1;\n    s = 0;\n    while (cin >> a[n + 1], a[n + 1] != 0)\n      n++;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        if (a[i] % a[j] == 0 && a[i] / a[j] == 2)\n          s++;\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  while (1) {\n    int a[16] = {0}, i, j, p, k, l, num = 0;\n    cin >> a[0]; \n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 16; i++) \n    {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    while (a[0] != 0) \n    {                 \n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          p = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = p;\n        }\n      }\n    }\n    for (k = 1; k <= i - 1; k++) \n    {\n      for (l = k; l <= i; l++) {\n        if (2 * a[k] == a[l])\n          num++;\n        if (2 * a[k] < a[l])\n          break;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int num = 0;\n  int s;\n  int i, j;\n  cin >> a[num];\n  while (a[num] != -1) {\n    while (a[num] != 0) {\n      num++;\n      scanf(\"%d \", &a[num]);\n    }\n    num--;\n    s = 0;\n    for (i = 0; i <= num; i++)\n      for (j = 0; j <= num; j++)\n        if (a[i] == a[j] * 2)\n          s++;\n    cout << s << endl;\n    num = 0;\n    cin >> a[num];\n  }\n}\n"}
{"label": "12", "index": "22022", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n\n  int a[20] = {0};\n  while (1) {\n    cin >> a[0];\n    if (a[0] != -1) {\n\n      int i, k, m, num = 0;\n\n      for (i = 1;; i++)\n\n      {\n\n        cin >> a[i];\n\n        if (a[i] == 0)\n          break;\n      }\n\n      for (k = 0; k <= i - 2; k++) {\n        for (m = k + 1; m <= i - 1; m++) {\n          if ((a[m] == (2 * a[k])) || (a[k] == (a[m] * 2)))\n            num++;\n        }\n      }\n      cout << num << endl;\n\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[100][15], i, j, n, m, a[100], p, b[100] = {0};\n  for (i = 0;;) {\n    for (j = 0;;) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        a[i] = j + 1;\n        i++;\n        break;\n      } else if (s[i][j] == -1)\n        break;\n      else\n        j++;\n    }\n    if (s[i][j] == -1)\n      break;\n  }\n  for (m = 0; m < i; m++) {\n    for (n = 0; n < a[m] - 1; n++) {\n      for (p = 0; p < a[m] - 1; p++) {\n        if (s[m][p] == 2 * s[m][n])\n          b[m]++;\n      }\n    }\n  }\n  for (m = 0; m < i; m++) {\n    cout << b[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], i, j, k, t, N;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &num[0]);\n    if (num[0] == -1)\n      break;\n    N = 0;\n    for (j = 1;; j++) {\n      cin >> num[j];\n      if (num[j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (t = 0; t <= j - 1; t++) {\n        if (num[k] == 2 * num[t])\n          N++;\n      }\n    }\n    cout << N << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20][16], s[20] = {0}, i, j, k, p = 0, n[20] = {0};\n  for (i = 0; i < 20; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    p = p + 1;\n    for (j = 1; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      s[i] = s[i] + 1;\n    }\n  }\n  for (i = 0; i < p; i++)\n    for (j = 0; j <= s[i]; j++)\n      for (k = 0; k <= s[i]; k++)\n        if (a[i][j] == 2 * a[i][k])\n          n[i] = n[i] + 1;\n  for (i = 0; i < p; i++)\n    cout << n[i] << \"\\n\";\n}\n"}
{"label": "12", "index": "22026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, a[16], k;\n  for (i = 1;; i++) {\n    k = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[i] == 2 * a[j])\n          k++;\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22027", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k, sz[17], n = 0;\n  for (i = 0; i < 17; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == -1)\n      break;\n    else {\n      if (i > 0) {\n        if (sz[i] > 0) {\n          for (j = 0; j < i; j++) {\n            if (2 * sz[j] == sz[i] || 2 * sz[i] == sz[j]) {\n              n++;\n            }\n          }\n        } else {\n          printf(\"%d\\n\", n);\n          n = 0;\n          i = 0;\n          j = 0;\n          for (k = 0; k < 16; k++)\n            sz[k] = -2;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, sum = 0, mat[100];\n  memset(mat, 0, sizeof(mat));\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n == 0) {\n      cout << sum << \"\\n\";\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    } else if (n > 49) {\n      mat[n] = 1;\n      if (mat[n >> 1])\n        sum++;\n    } else {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], s, q;\n  do {\n    scanf(\"%d\", &q);\n    a[0] = q;\n    if (q == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    s = 0;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n        else\n          s = s;\n      }\n    }\n    printf(\"%d\\n\", s);\n  } while (q != -1);\n}\n"}
{"label": "12", "index": "22030", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[16], x, i, j, k, l, n;\n  for (i = 0;; i++) {\n    n = 0;\n    j = 0;\n    while (cin >> x) {\n      if (x == 0 || x == -1)\n        break;\n      a[j] = x;\n      j++;\n    }\n    if (x == -1)\n      break;\n    for (k = 0; k < j; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          n = n + 1;\n      }\n    }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17][1000], i, j, k, s[1000] = {0};\n  int sum[1000] = {0}, g = 0, n;\n  for (i = 0, k = 0; i <= 1000; i++, k++) {\n    for (j = 0; j <= 16; j++, s[i]++) {\n      scanf(\"%d \", &a[j][i]);\n      if (a[j][i] == 0)\n        break;\n      else if (a[j][i] == -1) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    for (j = s[i]; j >= 0; j--) {\n      for (n = 0; n < j; n++) {\n        if (a[n][i] < a[j][i]) {\n          if (a[j][i] == 2 * a[n][i])\n            sum[i]++;\n        } else {\n          if (a[n][i] == 2 * a[j][i])\n            sum[i]++;\n        }\n      }\n    }\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int sum = 0;\n\n  do {\n    sum = 0;\n\n    cin >> a[0];\n\n    if (a[0] == -1)\n      break;\n\n    for (int i = 1; i <= 15; ++i) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    for (int m = 0; m <= 13; ++m) {\n      if (a[m + 1] == 0)\n        break;\n      for (int n = m + 1; n <= 14; ++n) {\n        if (a[n] == 0)\n          break;\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          ++sum;\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, n;\n  while (1) {\n    n = 0;\n    scanf(\"%d \", &a[1]);\n\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (int j = 1; j <= i; j++)\n      for (int k = j + 1; k <= i; k++)\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n++;\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[15], count;\n  while (1) {\n    count = 0;\n    for (n = 0;; n++) {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (j == i)\n          continue;\n        if (x[j] == 2 * x[i])\n          count++;\n      };\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22035", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16] = {0}, i, j, pair = 0, n;\n  for (i = 0; shuzu[0] != -1; i++) {\n    scanf(\"%d \", &shuzu[i]);\n    if (shuzu[i] == 0) {\n      n = i;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[i] == 2 * shuzu[j])\n            pair++;\n        }\n      }\n      printf(\"%d\\n\", pair);\n      i = -1;\n      pair = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = 0; a[i][s] != 0; s++)\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "22037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, l, m, s[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (a[i][j] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++) {\n    for (l = 0; l < 16; l++) {\n      for (m = 0; m < 16; m++)\n        if ((a[k][m] != 0) && (a[k][l] / a[k][m] == 2) &&\n            (a[k][l] % a[k][m] == 0)) {\n          s[k]++;\n        }\n    }\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", s[k]);\n}\n"}
{"label": "12", "index": "22038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, m[20], i = 0, j = 0, t = 0;\n  char c;\n  cin >> m[0] >> c;\n  while (m[0] > 0) {\n    n = 1;\n    t = 0;\n    while (c != '\\n')\n      scanf(\"%d%c\", &m[n++], &c);\n    n--;\n    for (i = 0; i < n; i++) {\n      for (j = n; j > i; j--)\n        if ((m[j] == 2 * m[i]) || (m[i] == 2 * m[j]))\n          t++;\n    }\n    cout << t << \"\\n\";\n    cin >> m[0] >> c;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22039", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n\n  int p;\n  for (p = 1; p <= 100; p++) {\n    int a[17];\n    int u, i = 0;\n    for (u = 1; u <= 16; u++) {\n      scanf(\"%d \", &a[u]);\n      i++;\n      if (a[u] == 0) {\n        break;\n      }\n    }\n    if (a[1] == -1) {\n      break;\n    }\n    int j, k, t;\n    for (j = 1; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] > a[k]) {\n          t = a[k];\n          a[k] = a[j];\n          a[j] = t;\n        }\n      }\n    }\n    int r, s, w = 0;\n    for (r = 1; r < i - 1; r++) {\n      for (s = r + 1; s <= i - 1; s++) {\n        if (a[r] * 2 == a[s]) {\n          w = w + 1;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", w);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22040", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17] = {0}, count;\n  int i, j, k, two, num;\n  for (k = 1;; k++) {\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[1] == -1 || a[i] == 0) {\n        num = i;\n        break;\n      }\n    }\n    if (a[1] == -1)\n      break;\n    for (i = 1; i < num; i++) {\n      two = 2 * a[i];\n      for (j = 1; j < num; j++)\n        if (two == a[j]) {\n          count++;\n          break;\n        }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22041", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], sign = 1, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;;) {\n      scanf(\"%d\", &a[i]);\n      sign = a[i];\n      if (sign == 0 || sign == -1)\n        break;\n      else\n        i++;\n    }\n    if (sign == -1)\n      break;\n    else {\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            num++;\n        }\n      }\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], t, i, j, k, m, n;\n  for (i = 1;; i++) {\n    for (j = 0; j <= 14; j++)\n      a[j] = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d \", &t);\n      if (t == 0)\n        break;\n      else {\n        a[j] = t;\n      }\n    }\n    m = 1;\n    if (a[0] != -1)\n      m = 0;\n    for (j = 1; j < 15; j++) {\n      if (a[j] != 0)\n        m = 0;\n    }\n    if (m == 1) {\n      printf(\"0\\n\");\n      break;\n    }\n    n = 0;\n    for (j = 0; j <= 14; j++)\n      for (k = j + 1; k <= 14; k++) {\n        if (a[j] != 0 && a[k] != 0 && (a[j] == 2 * a[k] || a[k] == 2 * a[j]))\n          n = n + 1;\n      }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22043", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100], j, k, l, sum = 0;\n  for (;;) {\n    for (j = 0;; j++) {\n      cin >> a[j];\n      if (a[j] == 0 || a[j] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k < j - 1; k++) {\n      for (l = k + 1; l <= j - 1; l++) {\n        if (a[k] == 2 * a[l] || a[l] == 2 * a[k])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[20], i = 1, j, k, d = 0;\n  char c;\n  do {\n    while (scanf(\"%d\", &s[i])) {\n      c = getchar();\n      if (c == '\\n')\n        break;\n      i++;\n    }\n    for (k = 1; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if ((s[k] == 2 * s[j]) || (2 * s[k] == s[j]))\n          d++;\n      }\n    }\n    if (s[i] > -1)\n      cout << d << \"\\n\";\n    i = 1;\n    d = 0;\n  } while (s[i] > -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, k, m[16] = {0}, n, len, sum;\n  i = 0;\n  do {\n    i = i + 1;\n    j = 0;\n    do {\n      j = j + 1;\n      scanf(\"%d\", &a[i][j]);\n      m[i] = m[i] + 1;\n    } while ((a[i][j] != 0) && (a[i][j] != -1));\n\n  } while (a[i][1] != -1);\n  len = i;\n  for (i = 1; i < len; i++) {\n    sum = 0;\n    for (j = 2; j <= m[i]; j++) {\n      for (k = 1; k < j; k++) {\n        if ((a[i][j] == 2 * a[i][k]) || (a[i][j] * 2 == a[i][k]))\n          sum = sum + 1;\n      }\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "12", "index": "22046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, n = 0, i, m, j;\n  while (cin >> a[0]) {\n    if (a[0] != (-1)) {\n      for (i = 1; i <= 15; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      for (j = i - 1; j >= 0; j--) {\n        for (m = i - 1; m >= 0; m--) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n      n = 0;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, geshu, get, n = 0;\n  int shuzu[15];\n  for (j = 0;; j++) {\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> get;\n      if (get == -1) {\n        goto end;\n      }\n      shuzu[i] = get;\n      if (get == 0) {\n        geshu = i;\n        break;\n      }\n    }\n    for (k = 0; k < geshu; k++) {\n      for (l = 0; l < geshu; l++) {\n        if (shuzu[k] == 2 * shuzu[l]) {\n          n = n + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "22048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, j, i, a[16], m = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n      if (a[i] == (-1))\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = j + 1; k < n; k++) {\n        if (a[j] == a[k] * 2 || a[k] == a[j] * 2)\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    n = 0;\n  } while (a[0] != (-1));\n  return 0;\n}\n"}
{"label": "12", "index": "22049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], i;\n  while (1) {\n    int n = 1, sum = 0, j;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    while (cin >> a[n]) {\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][17], i, num, j, k, l, h;\n  scanf(\"%d\", &a[0][0]);\n  for (j = 0; j <= 15 && a[j][0] != -1; j++) {\n    for (i = 1; i <= 15 && a[j][i - 1] != 0; i++)\n      scanf(\"%d\", &a[j][i]);\n    scanf(\"%d\", &a[j + 1][0]);\n  }\n  for (l = 0; l <= 14 && a[l][0] != -1; l++) {\n    num = 0;\n    for (k = 0; k <= 15 && a[l][k] != 0; k++) {\n      for (h = 0; h <= 15 && a[l][h] != 0; h++) {\n        if (a[l][k] == 2 * a[l][h])\n          num++;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[16], i, n, a = 0, j;\n  scanf(\"%d\", &s[0]);\nloop:\n  a = 0;\n  i = 1;\n  do {\n    scanf(\" %d\", &s[i]);\n    i++;\n  } while (s[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++)\n      if (s[i] == 2 * s[i + j] || s[i + j] == s[i] * 2)\n        a = a + 1;\n  }\n  cout << a << \"\\n\";\n  scanf(\"%d\", &s[0]);\n  if (s[0] != -1)\n    goto loop;\n}\n"}
{"label": "12", "index": "22052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k;\n  for (i = 0; i < 15; i++)\n    x[i] = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &x[i]);\n    if (x[i] == -1)\n      break;\n    if (x[i] == 0) {\n      int t = 0;\n      for (j = 0; j < i; j++)\n        for (k = 0; k < i; k++)\n          if (x[j] == 2 * x[k]) {\n            t++;\n          }\n      cout << t << endl;\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22053", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], k = 0, i, w, y, n, p;\n  while (1) {\n    scanf(\"%d \", &p);\n    if (p == -1) {\n      break;\n    } else {\n      a[0] = p;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          n = i - 1;\n          break;\n        }\n      }\n      for (w = 0; w <= n; w++) {\n        for (y = 0; y <= n; y++) {\n          if (a[y] == 2 * a[w]) {\n            k++;\n          }\n        }\n      }\n      cout << k << endl;\n      i = 0;\n      k = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22054", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sc[300], ao[16];\n  int i, j, k, l, n, b, x, m;\n  i = 0;\n  j = 0;\n  k = 0;\n  l = 0, x = 0;\n  do {\n    n = 1;\n    for (i = 0; i < 16; i++) {\n      cin >> ao[i];\n      if (ao[i] == 0 || ao[i] == -1) {\n        n = i;\n        break;\n      }\n    }\n    i = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (ao[i] * 2 == ao[j]) {\n          k++;\n        }\n      }\n    }\n    sc[l] = k;\n    k = 0;\n    l++;\n  } while (n != 0);\n  for (x = 0; x < l - 1; x++) {\n    printf(\"%d\\n\", sc[x]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22055", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, num = 0, tot, a[16], b[1000];\n  do {\n    i = 0;\n    tot = 0;\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[0] != -1) {\n      for (j = 0; j <= i - 3; j++)\n        for (k = j + 1; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            tot++;\n        }\n      b[num] = tot;\n      num++;\n    }\n  } while (a[0] != -1);\n  for (i = 0; i < num; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, n, t;\n  while (a[0] != -1) {\n    t = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] <= 0) {\n        break;\n      } else {\n        t++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    } else {\n      for (j = 0; j < t; j++) {\n        for (m = 0; m < t; m++) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22057", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x[16], a, b, i, k;\n\n  while (1) {\n\n    for (i = 0; i < 16; i++) {\n      cin >> x[i];\n      if (x[i] == 0) {\n        a = i;\n        break;\n      }\n    }\n    if (x[0] == -1) {\n\n      break;\n    }\n    int s = 0;\n    for (k = 0; k < a; k++) {\n      for (i = 0; i < a; i++) {\n        if (x[k] == 2 * x[i]) {\n          s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, i = 0, j = 0, n = 0, l[100] = {0}, d, N[100] = {0};\n  do {\n    j = 0;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while (a[i][j - 1] != 0 && a[i][j - 1] != -1);\n    l[i] = j - 1;\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (d = j; d < l[i]; d++) {\n        if (a[i][d] == 2 * a[i][j] || a[i][j] == 2 * a[i][d])\n          N[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", N[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22059", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, k, n = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[0] == -1) {\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          n++;\n      }\n    printf(\"%d\\n\", n);\n    n = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22060", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16] = {0}, n, i = 1;\n  for (; a[i] != -1;) \n  {\n    n = 0;\n    for (i = 0;; i++) \n    {\n      cin >> a[i];\n      for (int j = 0; j < i; j++) {\n        if (a[j] * 2 == a[i] || a[j] == a[i] * 2) {\n          n++;\n        }\n      }\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      } \n    }\n    if (a[i] != -1) {\n      cout << n << endl;\n    }\n  }\n}\n"}
{"label": "12", "index": "22061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, b;\n  do {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    j = 0;\n    for (m = 0; m <= i - 1; m++) {\n      for (b = 0; b <= i - 1; b++) {\n        if (a[m] == a[b] * 2) {\n          j++;\n        }\n      }\n    }\n    printf(\"%d\\n\", j);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a[10000], i, b, j, sum = 0;\n  do {\n    sum = 0;\n    scanf(\"%d\", &b);\n    if (b == -1)\n      break;\n    else\n      a[0] = b;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    cout << sum << \"\\n\";\n  } while (b != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22063", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  while (1) {\n    int num[16] = {0}; \n    cin >> num[0];     \n    if (num[0] == -1)  \n      break;           \n\n    int sum = 1; \n    for (;; sum++) {\n      cin >> num[sum];   \n      if (num[sum] == 0) \n      {\n        sum--; \n        break; \n      }\n    }\n    int twice = 0;                \n    for (int i = 0; i < sum; i++) \n    {\n      for (int j = i + 1; j <= sum; j++) {\n        \n        if ((num[j] == 2 * num[i]) || (num[i] == 2 * num[j]))\n          twice++; \n      }\n    }\n    cout << twice << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "22064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[15], m, n;\n  int i, j, k, h;\n  for (i = 0;; i++) {\n    n = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d \", &m);\n      if (m == 0)\n        break;\n      if (m == -1)\n        return 0;\n      p[j] = m;\n    }\n    for (k = 0; k < j; k++) {\n      for (h = 0; h < j; h++) {\n        if (p[k] == 2 * p[h])\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][20], i = 0, j = 0, k = 0, num[100];\n\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][0] != -1);\n\n  i = 0;\n  while (a[i][0] != -1) {\n    num[i] = 0;\n    k = 0;\n    while ((a[i][k] != 0) && (a[i][k] != -1)) {\n      j = 0;\n      while ((a[i][j] != 0) && (a[i][j] != -1)) {\n        if (a[i][k] == 2 * a[i][j]) {\n          num[i]++;\n        }\n        j++;\n      }\n      k++;\n    }\n    i++;\n  }\n\n  i = 0;\n  while (a[i][0] != -1) {\n    cout << num[i] << \"\\n\";\n    i++;\n  }\n\n  return 1;\n}\n"}
{"label": "12", "index": "22066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16] = {0}, b[100] = {0}, n[100] = {0}, i, j, k;\n  int m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n\n    if (a[i][0] != -1) {\n      m = m + 1;\n      n[i]++;\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] != 0) {\n          n[i] = n[i] + 1;\n        }\n        if (a[i][j] == 0) {\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < n[i]; j++) {\n      for (k = 0; k < n[i]; k++) {\n        if (a[i][j] == 2 * a[i][k]) {\n          b[i] = b[i] + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n\n    printf(\"%d\\n\", b[i]);\n  }\n}\n"}
{"label": "12", "index": "22067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int number[16];\n  int n;\n  for (;;) {\n    n = 0;\n    scanf(\"%d \", &number[0]);\n    if (number[0] == -1)\n      break;\n    int i;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &number[i]);\n      if (number[i] == 0) {\n        break;\n      }\n    }\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (number[k] == 2 * number[j]) {\n          n++;\n        }\n      }\n    }\n    cout << n << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], s = 0;\n  while (scanf(\"%d\", &a[++s]) != EOF) {\n    if (a[1] == -1)\n      break;\n    do\n      scanf(\"%d\", &a[++s]);\n    while (a[s] != 0);\n    s--;\n    int ans = 0;\n    for (int i = 1; i <= s; i++)\n      for (int j = 1; j <= s; j++)\n        if (a[i] * 2 == a[j])\n          ans++;\n    printf(\"%d\\n\", ans);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[15];\n  scanf(\"%d\", &p[0]);\n  int i;\n  int l = 0;\n  for (i = 1; i < 15; i++) {\n    int a;\n    cin >> a;\n    if (a == 0)\n      break;\n    else {\n      p[i] = a;\n      l++;\n    }\n  };\n  int j, m, max;\n  for (j = 0; j < l - 1; j++) {\n    for (m = j + 1; m < l; m++)\n      if (p[j] > p[m]) {\n        max = p[j];\n        p[j] = p[m];\n        p[m] = max;\n      }\n  }\n  int num = 0;\n  int k, n;\n  for (k = 0; k < l - 1; k++) {\n    for (n = k + 1; n < l; n++) {\n      if ((p[n] / p[k]) == 2 && p[n] % p[k] == 0)\n        num++;\n      if (p[n] / p[k] > 2)\n        break;\n    }\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "12", "index": "22070", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15], sum = 0, b, n = 0;\n  while (cin >> b) {\n\n    if (b == -1)\n      break;\n\n    else if (b == 0) {\n      for (int i = 0; i <= n - 1; i++) {\n\n        for (int j = i + 1; j <= n - 1; j++) {\n\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            sum++;\n        }\n      }\n      cout << sum << endl;\n      sum = 0;\n      n = 0;\n    }\n\n    else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22071", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], count = 0;\n  int i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i];\n    if (a[0] == -1)\n      break;\n    else {\n      if (a[i] == 0) {\n        for (j = 0; j < i; j++)\n          for (k = 0; k < i; k++) {\n            if (a[k] == a[j] * 2) {\n              count++;\n            }\n          }\n        printf(\"%d\\n\", count);\n        count = 0;\n        i = -1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22072", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 0, j = 0, n = 0, k = 0;\n  do {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    n = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    printf(\"%d\\n\", n);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int i, num, n;\n  while (1) {\n    for (i = 1; i <= 100; i++)\n      a[i] = 0;\n    do {\n      cin >> num;\n      a[num] = 1;\n    } while (num != 0 && num != -1);\n    if (num == -1)\n      break;\n    n = 0;\n    for (i = 0; i <= 50; i++)\n      if (a[i] && a[2 * i])\n        n++;\n    printf(\"%d\\n\", n - 1);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t;\n  int a[16], i, j, k, count;\n  while (scanf(\"%d \", &t)) {\n    count = 0;\n    if (t < 0)\n      return 0;\n    a[0] = t;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "22075", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[16];\n  int i, j, n, sum;\n  for (;;) {\n    sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &num[i]);\n      if ((num[i] == 0) || (num[i] == -1))\n        break;\n    }\n    if (num[i] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j <= n - 1; j++) {\n        if ((num[j] == num[i] * 2) || (num[i] == num[j] * 2))\n          sum = sum + 1;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num, a[16], c;\n  while (1) {\n    i = 0;\n    num = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      c = a[i];\n      i++;\n    } while (c != 0 && c != -1);\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i - 1; j++) {\n      for (k = 0; k < i - 1; k++)\n        if (a[j] == 2 * a[k])\n          num++;\n    }\n\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, m[20], i = 0, j = 0, t = 0; \n  char c;\n  scanf(\"%d%c\", &m[0], &c);\n  while (m[0] > 0) {\n    n = 1;\n    t = 0;\n    while (c != '\\n')\n      scanf(\"%d%c\", &m[n++], &c);\n    n--;\n    for (i = 0; i < n; i++) {\n      for (j = n; j > i; j--)\n        if ((m[j] == 2 * m[i]) || (m[i] == 2 * m[j]))\n          t++;\n    }\n    printf(\"%d\\n\", t);\n    scanf(\"%d%c\", &m[0], &c);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22078", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, flag;\n  while (1) {\n    flag = 0;\n    i = 0;\n    scanf(\"%d \", &a[i]);\n    if (a[0] == -1)\n      break;\n    else {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      num = i;\n      for (i = 0; i < num; i++)\n        for (j = i + 1; j < num; j++)\n          if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n            flag++;\n      printf(\"%d\\n\", flag);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int a[16], i, j, k, n = 0;\n  do {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = 0;\n    for (k = 0; k <= i - 1; k++) {\n      for (j = k + 1; j <= i - 1; j++) {\n        if (((a[k] * 2 == a[j]) || (a[k] == (2 * a[j]))) && (a[k] != 0))\n          n++;\n      }\n    }\n    cout << n << endl;\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0}, b[16] = {0}, c[100] = {0}, i, n, j, k, l, num;\n  l = 0;\n  for (j = 0; j < 100; j++) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n\n      if (a[i] == 0) {\n        break;\n      }\n      n++;\n    }\n    num = 0;\n    for (i = 0; i < n; i++) {\n      b[i] = a[i];\n      for (k = 0; k < n; k++) {\n        if (b[i] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    c[j] = num;\n    l++;\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  for (j = 0; j < l - 1; j++) {\n    printf(\"%d\\n\", c[j]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22081", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, k, j, count = 0, a[16];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (k = 0; k <= 15; k++) {\n      for (j = k + 1; j <= 16; j++) {\n        if (a[j] == 0)\n          break;\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, g, n, m;\n  for (j = 0;; j++) {\n    for (i = 0, n = 0; i < 16; i++) {\n      scanf(\"%d \", &x[i]);\n      if (x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    g = i;\n    for (i = 0; i < g; i++) {\n      for (m = 0; m < g; m++) {\n        if ((float)x[i] == x[m] * 2)\n          n++;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22083", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int iNum[20], i, j, n, iPair;\n  while (1) {\n    iPair = 0;\n    memset(iNum, 0, 80);\n    scanf(\"%d \", &iNum[0]);\n    n = 1;\n    if (iNum[0] == -1)\n      break;\n    do {\n      cin >> iNum[n];\n      n++;\n    } while (iNum[n - 1] != 0);\n    n--;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        if (iNum[j] == iNum[i] * 2)\n          iPair++;\n    printf(\"%d\\n\", iPair);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], i, n, j;\n  scanf(\"%d\", &a[1]);\n  while (a[1] > 0) {\n\n    n = 0;\n    i = 1;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n      for (j = 1; j <= i; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          n++;\n\n    } while (a[i] != 0);\n    printf(\"%d\\n\", n - 1);\n    scanf(\"%d\", &a[1]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22085", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, j, n = 0, sum = 0;\n  int a[20];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n      n++;\n    }\n    for (i = 0; i <= n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n\n    cout << sum << endl;\n    i = 1;\n    sum = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuzu[16];\n  int i, t, k, num = 0;\n\n  for (i = 0;; i++) {\n    cin >> shuzu[i];\n    if (shuzu[i] == -1) {\n      break;\n    }\n    if (shuzu[i] == 0) {\n\n      for (t = 0; t < i; t++) {\n        for (k = t + 1; k < i; k++) {\n          if (shuzu[t] == shuzu[k] * 2 || shuzu[t] * 2 == shuzu[k]) {\n            num++;\n          }\n        }\n      }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, m = 0, number;\n  double a[15];\n  do {\n    cin >> number;\n    if (number == -1)\n      break;\n    else\n      a[0] = number;\n\n    for (i = 2;; i++) {\n      cin >> number;\n      a[i - 1] = number;\n      for (k = 0; k < i - 1; k++) {\n        if (a[i - 1] == (2 * a[k]) || a[i - 1] == (a[k] / 2))\n          m++;\n      }\n      if (number == 0) {\n        printf(\"\\n%d\\n\", m);\n        break;\n      }\n    }\n    m = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, h, t = 0, flag = 1;\n  while (flag == 1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        h = i;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < h; i++) {\n        for (j = 0; j < h; j++)\n          if (a[i] == 2 * a[j])\n            t++;\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[16], i, t, m, j, k, sum;\n  while (scanf(\"%d \", &t)) {\n    if (t != -1) {\n      a[1] = t;\n      i = 1;\n      while (scanf(\"%d \", &m)) {\n        if (m != 0) {\n          i = i + 1;\n          a[i] = m;\n        } else\n          break;\n      }\n      sum = 0;\n      for (j = 1; j <= i; j++)\n        for (k = 1; k <= i; k++) {\n          if (a[k] == 2 * a[j] || a[k] == 0.5 * a[j])\n            sum = sum + 1;\n        }\n      cout << sum / 2 << endl;\n    } else {\n      cout << endl;\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k, s, n;\n  for (k = 1;; k++) {\n    s = 0;\n    n = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[n] == -1)\n      break;\n    for (i = 1; i < n; i++) {\n      for (j = i + 1; j <= n; j++) {\n        if ((a[i] * 2 == a[j]) || (a[j] * 2 == a[i])) {\n          s++;\n        }\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22091", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, count = 0;\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (true) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      i++;\n    }\n\n    count = 0;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] * 2 == a[j])\n          count++;\n      }\n    }\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], s, i, j, k, flag = 1;\n  while (flag) {\n    s = 0;\n    for (i = 0; i < 16; i++) { \n      scanf(\"%d\", &a[i]);\n      k = i; \n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n    if (flag) {\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++) {\n          if (a[i] == 2 * a[j])\n            s++;\n        } \n      printf(\"%d\\n\", s);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, t, m, count[50], lie[20];\n  char p;\n  for (i = 0; i < 50; i++) {\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &lie[j]);\n      if (lie[0] == -1)\n        goto lalala;\n      scanf(\"%c\", &p);\n      if (p == '\\n')\n        break;\n    }\n    count[i] = 0;\n    for (l = 0; l < j; l++)\n      for (t = 0; t < j; t++)\n        if ((lie[l] - 2 * lie[t]) == 0)\n          count[i] = count[i] + 1;\n  }\nlalala:\n  for (m = 0; m < i; m++) {\n    printf(\"%d\", count[m]);\n    if (m != i - 1)\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "22094", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sc[300], ao[16];\n  int i, j, k, l, n, b, x, m;\n  i = 0;\n  j = 0;\n  k = 0;\n  l = 0, x = 0;\n  do {\n    n = 1;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &ao[i]);\n      if (ao[i] == 0 || ao[i] == -1) {\n        n = i;\n        break;\n      }\n    }\n    i = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (ao[i] * 2 == ao[j]) {\n          k++;\n        }\n      }\n    }\n    sc[l] = k;\n    k = 0;\n    l++;\n  } while (n != 0);\n  for (x = 0; x < l - 1; x++) {\n    printf(\"%d\\n\", sc[x]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22095", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[100][15], i = 0, j, k, count, t;\n  for (i = 0;; i++) {\n    count = 0;\n    j = 0;\n    do {\n      scanf(\"%d \", &n[i][j]);\n      if (n[i][j] == -1)\n        goto loop;\n      j++;\n    } while (n[i][j - 1] != 0);\n    for (k = 0; k < j; k++) {\n      for (t = j - 1; t > k; t--) {\n        if (n[i][t] == 2 * n[i][k] || 2 * n[i][t] == n[i][k])\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\nloop:\n  return 0;\n}\n"}
{"label": "12", "index": "22096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int a[16] = {0};\n  int i, j, k, n = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          n++;\n      }\n    cout << n << endl;\n    n = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, cnt;\n  i = 0;\n  cnt = 0;\n  cin >> a[i];\n\n  while (a[i] != -1) {\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (int j = 0; j <= i; j++) {\n      for (int k = 0; k <= i; k++) {\n        if (a[k] == 2 * a[j])\n          cnt++;\n      }\n    }\n    cout << cnt - 1 << endl;\n    i = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100], i, j, num = 0, total = 0;\n  while (1) {\n    num = 0;\n    while (1) {\n      cin >> a[num];\n      if (a[num] == 0)\n        break;\n      if (a[num] == -1)\n        return 0;\n      num++;\n    }\n\n    total = 0;\n    for (i = 0; i < num; i++) {\n\n      for (j = 0; j < num; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, a[16] = {0}, sum = 0, k = 0;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] != 0)\n        sum++;\n      else\n        break;\n    }\n    for (i = 0; i <= sum; i++) {\n      for (j = i + 1; j <= sum; j++) {\n        if (a[i] == 2 * a[j] || a[j] == a[i] * 2)\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n    sum = 0;\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22100", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, m, n, count;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &m);\n    if (m == -1) {\n      break;\n    } else {\n      count = 0;\n      a[0] = m;\n      for (j = 1; j < 16; j++) {\n        cin >> a[j];\n        if (a[j] == 0) {\n          break;\n        }\n      }\n\n      n = j;\n      for (j = 0; j < n; j++) {\n        for (k = j + 1; k < n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n            count++;\n          }\n        }\n      }\n\n      cout << count << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22101", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[100][15], t[15];\n  int sum[100];\n  int i, j, n, m, k;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0) {\n        t[i] = j;\n        break;\n      } else if (s[i][0] == -1)\n        break;\n    }\n    if (s[i][0] == -1)\n      break;\n  }\n  for (n = 0; n < i; n++) {\n    sum[n] = 0;\n    for (m = 0; m < t[n] - 1; m++) {\n      for (k = m + 1; k < t[n]; k++) {\n        if (s[n][m] == 2 * s[n][k] || s[n][k] == 2 * s[n][m]) {\n          sum[n]++;\n        }\n      }\n    }\n  }\n  for (n = 0; n < i; n++)\n    printf(\"%d\\n\", sum[n]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint chuli(int *p, int i) {\n\n  int count = 0;\n\n  for (int q = 0; q < i; q++) {\n    if (2 * (p[q]) > p[i - 1])\n      return count;\n\n    for (int j = q; j < i; j++) {\n\n      if (p[j] == 2 * (p[q])) {\n        count++;\n        break;\n      }\n      if (p[j] > 2 * (p[q])) {\n        break;\n      }\n    }\n  }\n\n  return count;\n}\nint main() {\n  \n  int a[20];\n  int num;\n  while (cin >> a[0] && (a[0] != -1)) {\n    int i = 1;\n    while (cin >> a[i] && a[i]) {\n      i++;\n    }\n\n    qsort(a, i, sizeof(int), cmp);\n\n    num = chuli(a, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22103", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, k, m, a[17][17], b[100], c[100] = {0};\n  for (i = 1; i <= 100; i++) {\n    cin >> a[i][1];\n    if (a[i][1] == -1)\n      break;\n    else {\n      for (j = 2; j <= 100; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n        else\n          b[i] = j;\n      }\n    }\n    for (k = 1; k <= b[i]; k++) {\n      for (m = 1; m <= b[i]; m++) {\n        if (a[i][k] == 2 * a[i][m])\n          c[i]++;\n      }\n    }\n    printf(\"%d\\n\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, num[16] = {0}, count = 0, key = 0;\n  cin >> num[0];\n  while (num[0] != -1) {\n    for (i = 0; num[i] != 0; i++)\n      cin >> num[i + 1];\n\n    count = i;\n    key = 0;\n    for (i = 0; i < count; i++)\n      for (j = i; j < count; j++) {\n        if (num[i] == 2 * num[j] || num[j] == 2 * num[i])\n          key++;\n      }\n    cout << key << endl;\n    for (i = 0; i < 16; i++)\n      num[i] = 0;\n    cin >> num[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  float sz[16];\n  int n[100];\n  int i, k;\n  for (i = 0; i >= 0; i++) {\n    n[i] = 0;\n    for (k = 0; k < 16; k++) {\n      scanf(\"%f\", &sz[k]);\n      if (sz[k] == 0 || sz[0] == -1) {\n        break;\n      }\n    }\n    for (int a = 0; a < k - 1; a++) {\n      for (int b = a + 1; b < k; b++) {\n        if (sz[a] == sz[b] * 2 || sz[a] == sz[b] / 2)\n          n[i]++;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++)\n    cout << n[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "22106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, k;\n  static int a[16];\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (k = 1; k <= 15; k++) {\n      scanf(\" %d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    n = 0;\n    for (k = 0; a[k] != 0; k++)\n      for (m = 0; a[m] != 0; m++)\n        if (a[m] == 2 * a[k]) {\n          n++;\n          break;\n        }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22107", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, m;\n  for (;;) {\n    m = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (k = 0; k < i; k++) {\n          if ((a[j] / 2) == a[k])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22108", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b[20] = {0};\n  int p = 2;\n  int j = 1, k = 2, num = 0;\n\n  while (cin >> b[1]) {\n\n    if (b[1] != -1) {\n      for (p = 2;; p++) {\n        scanf(\"%d \", &b[p]);\n        if (b[p] != 0)\n          continue;\n        else {\n\n          for (j = 1; j < p - 1; j++) {\n            for (k = j + 1; k <= p - 1; k++) {\n              if ((b[j] == b[k] * 2) || (b[k] == b[j] * 2)) {\n                num++;\n              }\n            }\n          }\n          cout << num << endl;\n          num = 0;\n          memset(b, sizeof(b), 0);\n          break;\n        }\n      }\n\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; 1; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22110", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  float p[100][999];\n  int i, m;\n  for (m = 0;; m++) {\n    for (i = 0;; i++) {\n      scanf(\"%f\", &p[m][i]);\n      if (p[m][i] == 0)\n        break;\n    }\n    if (p[m][0] == -1)\n      break;\n    else {\n      int a = 0;\n      for (int j = 0; j < i; j++) {\n        for (int k = 0; k < i; k++) {\n          if (p[m][j] / p[m][k] == 2)\n            a++;\n          else\n            a = a;\n        }\n      }\n      printf(\"%d\\n\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], whether, number = 0, numofpairs = 0;\n\n  do {\n    for (int i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        whether = 0;\n        break;\n      } else if (a[i] == 0) {\n        whether = 1;\n        break;\n      }\n      number++;\n    }\n    if (whether) {\n      for (int j = 0; j < number; j++) {\n        for (int k = 0; k < number; k++) {\n          if (a[k] == 2 * a[j])\n            numofpairs++;\n        }\n      }\n      printf(\"%d\\n\", numofpairs);\n    }\n    numofpairs = 0;\n    number = 0;\n  } while (whether == 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p, s[15];\n  for (i = 0;; i++) {\n    k = 0;\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        break;\n      for (p = 0; p < j; p++)\n        if (s[j] == 2 * s[p] || s[p] == 2 * s[j])\n          k++;\n    }\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, s, t;\n  int d[100];\n  int q, p;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (j == 0)\n      break;\n    s = 0;\n    for (k = 0; k < j - 1; k++) {\n      for (t = k + 1; t < j; t++) {\n        p = a[i][t] - a[i][k] * 2;\n        q = a[i][k] - a[i][t] * 2;\n        if (p == 0 || q == 0)\n          s++;\n      }\n    }\n    d[i] = s;\n  }\n  for (k = 0; k < i; k++)\n    cout << d[k] << \" \";\n  return 0;\n}\n"}
{"label": "12", "index": "22114", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[16], i, a, num = 0, no = 0, j;\n  while (1) {\n    scanf(\"%d\", &a);\n    if (a == -1)\n      return 0;\n    else if (a > 0) {\n      sz[no] = a;\n      no++;\n    } else if (a == 0) {\n      for (i = 0; i < no; i++) {\n\n        for (j = 0; j < no; j++)\n          if (sz[i] == 2 * sz[j])\n            num++;\n      }\n\n      printf(\"%d\\n\", num);\n      no = 0;\n      num = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22115", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, m = 0, count = 0; \n  int num[100];\n  for (;;) {\n    m = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];                   \n      if (num[i] == 0 || num[i] == -1) \n      {\n        count = i;\n        break;\n      }\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < count; i++) \n        for (j = i + 1; j < count; j++) {\n          if ((num[i] == 2 * num[j]) || (num[j] == 2 * num[i])) \n            m++;\n        }\n      cout << m << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22116", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;; i++) {\n    cin >> a[i];\n    switch (a[i]) {\n    case -1:\n      return 0;\n    case 0: {\n      int s = 0;\n      for (int j = 0; j < i; j++)\n        for (int k = j; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            s++;\n      i = -1;\n      printf(\"%d\\n\", s);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, a[16], k;\n  for (i = 1;; i++) {\n    k = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[i] == 2 * a[j])\n          k++;\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, sum = 0, b, j, k, m;\n  scanf(\"%d \", &b);\n  while (b != -1) {\n    a[0] = b;\n    i = 0;\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d \", &a[i]);\n    }\n\n    for (j = 1; j < i; j++) {\n      for (k = 0; k < i - j; k++) {\n        if (a[k] > a[k + 1]) {\n          m = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = m;\n        }\n      }\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (2 * a[j] == a[k])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    scanf(\"%d\", &b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = j + 1; a[i][s] != 0; s++) {\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n        if (a[i][j] * 2 == a[i][s])\n          z[i]++;\n      }\n    }\n    cout << z[i] << \" \";\n  }\n}\n"}
{"label": "12", "index": "22120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, k, j, sum = 0, m;\n\n  for (k = 1;; k++) {\n    sum = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    if (a[0] != -1) {\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          m = i;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < m - 1; i++) {\n      for (j = i + 1; j < m; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          sum = sum + 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22121", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, a[15], x = 0, i, y = 0;\n  while (y != 1) {\n    for (m = 0;; m++) {\n      scanf(\"%d \", &n);\n      if (n != 0 && n != -1) {\n        a[m] = n;\n        continue;\n      }\n      if (n == 0) {\n        break;\n      }\n      if (n == -1) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n    for (m = 0; m <= 15; m++) {\n      for (i = 0; i <= 15; i++) {\n        if (a[m] * 2 == a[i] && a[m] != 0)\n          x = x + 1;\n      }\n    }\n    for (m = 0; m <= 15; m++)\n      a[m] = 0;\n\n    cout << x << endl;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][15],\n      i = 0, j = 0, s = 0, m = 0, h = 0,\n      g[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, b[15];\n  while (1) {\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == 0) {\n      b[i] = j;\n      i = i + 1;\n      j = 0;\n\n    } else if (a[i][j] == -1)\n      break;\n    else\n      j = j + 1;\n  }\n  for (s = 0; s < i; s++) {\n    for (m = 0; m < b[s]; m++) {\n      for (h = 0; h < b[s]; h++) {\n        if (a[s][m] == 2 * a[s][h]) {\n          g[s] = g[s] + 1;\n        }\n      }\n    }\n  }\n  for (s = 0; s < i; s++) {\n    cout << g[s] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22123", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], i = 0, j, count = 0;\n  while (cin >> a[i]) {\n    if (a[i] == 0) {\n      cout << count << endl;\n      count = 0;\n      i = 0;\n      continue;\n    }\n\n    if (i != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, l, m, s[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (a[i][j] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++) {\n    for (l = 0; l < 16; l++) {\n      for (m = 0; m < 16; m++)\n        if ((a[k][m] != 0) && (a[k][l] / a[k][m] == 2) &&\n            (a[k][l] % a[k][m] == 0))\n          s[k]++;\n    }\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", s[k]);\n}\n"}
{"label": "12", "index": "22126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, i = 0, j = 0, sum = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] == -1)\n      break;\n    for (i = 1; num[i - 1] != 0; i++) {\n      scanf(\"%d\", &num[i]);\n    }\n    for (i = 0; num[i] != 0; i++) {\n      for (j = 0; num[j] != 0; j++) {\n        if ((num[i] == 2 * num[j]) && (num[i] != 0) && (num[j] != 0))\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22127", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int su[17] = {1};\n  int c[100];\n  int i, a, b, d, e = 0;\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n  for (d = 0; d < 100; d++) {\n    a = 0;\n    for (i = 1; su[i - 1] != 0; i++) {\n      scanf(\"%d\", &su[i]);\n      if (su[i] == -1) {\n        e = 1;\n        break;\n      }\n      a = a + 1;\n    }\n    if (e) {\n      break;\n    }\n    for (i = 1; i < a; i++) {\n      for (b = 1; b < a; b++) {\n        if (su[i] == 2 * su[b]) {\n          c[d] += 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    printf(\"%d\\n\", c[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22128", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, j, i, a[16], m = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n      if (a[i] == (-1))\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < n; j++) {\n      for (k = j + 1; k < n; k++) {\n        if (a[j] == a[k] * 2 || a[k] == a[j] * 2)\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    n = 0;\n  } while (a[0] != (-1));\n  return 0;\n}\n"}
{"label": "12", "index": "22129", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  int a[15];\n  scanf(\"%d\", &k);\n  while (k != -1) {\n    n = 0;\n    m = 0;\n    i = 0;\n    while (k != 0) {\n      n++;\n      a[i] = k;\n      i++;\n      cin >> k;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[15];\n  int a, b;\n  int i, t, h, k;\n  for (i = 0; i <= 100; i++) {\n    b = 0;\n    a = 0;\n    for (t = 0; t < 17; t++) {\n      scanf(\"%d\", &s[t]);\n      if (s[t] == 0)\n        break;\n      if (s[t] == -1)\n        break;\n      a++;\n    }\n    if (s[t] == -1)\n      break;\n    for (k = 0; k < a; k++) {\n      for (h = 0; h < a; h++) {\n        if (s[k] == 2 * s[h]) {\n          b++;\n        } else {\n          b = b;\n        }\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], t, i, j, k, m, n;\n  for (i = 1;; i++) {\n    for (j = 0; j <= 14; j++)\n      a[j] = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d \", &t);\n      if (t == 0)\n        break;\n      else {\n        a[j] = t;\n      }\n    }\n    m = 1;\n    if (a[0] != -1)\n      m = 0;\n    for (j = 1; j < 15; j++) {\n      if (a[j] != 0)\n        m = 0;\n    }\n    if (m == 1) {\n      cout << \"0\\n\";\n      break;\n    }\n    n = 0;\n    for (j = 0; j <= 14; j++)\n      for (k = j + 1; k <= 14; k++) {\n        if (a[j] != 0 && a[k] != 0 && (a[j] == 2 * a[k] || a[k] == 2 * a[j]))\n          n = n + 1;\n      }\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22132", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, count = 0;\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (true) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      i++;\n    }\n\n    count = 0;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] * 2 == a[j])\n          count++;\n      }\n    }\n\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, flag = 1;\n  int a[16] = {0};\n  int c[100] = {0};\n  while (flag) {\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        k++;\n        break;\n      }\n      for (j = i - 1; j > 0; j--) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          c[k]++;\n      }\n    }\n  }\n  for (i = 1; k > 0 && i < k; i++)\n    printf(\"%d\\n\", c[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200], k, i, n = 0, j = 0;\n  for (i = 0; i < 200; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] != -1 && a[i] != 0)\n      n = n + 1;\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (k = 0; k < n; k++) {\n        for (i = 0; i < n; i++) {\n          if (a[k] == 2 * a[i])\n            j = j + 1;\n        }\n      }\n      printf(\"%d\\n\", j);\n      j = 0;\n      i = -1;\n      n = 0;\n    }\n  }\n}\n"}
{"label": "12", "index": "22135", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], b[20], i, l, j, n, p = 0, num = 0;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &n);\n    if (n == -1)\n      break;\n    else {\n      a[0] = n;\n      for (l = 1;; l++) {\n        cin >> a[l];\n        if (a[l] == 0)\n          break;\n      }\n      for (i = 0; a[i] != 0; i++)\n        for (j = 0; a[j] != 0; j++) {\n          if (a[i] == a[j] * 2)\n            num++;\n        }\n      b[p] = num;\n      p++;\n    }\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "12", "index": "22136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[18] = {0}, i, n, ii, s;\n\n  while (1) {\n    i = 1;\n    while (1) {\n      cin >> a[i];\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    n = i;\n    i = 1;\n    s = 0;\n    while (i < n) {\n      ii = 1;\n      while (ii < n) {\n        if (a[ii] == 2 * a[i])\n          s++;\n        ii++;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22137", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, a[15], x = 0, i, y = 0;\n  while (y != 1) {\n    for (m = 0;; m++) {\n      scanf(\"%d \", &n);\n      if (n != 0 && n != -1) {\n        a[m] = n;\n        continue;\n      }\n      if (n == 0) {\n        break;\n      }\n      if (n == -1) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n    for (m = 0; m <= 15; m++) {\n      for (i = 0; i <= 15; i++) {\n        if (a[m] * 2 == a[i] && a[m] != 0) {\n          x = x + 1;\n        }\n      }\n    }\n    for (m = 0; m <= 15; m++) {\n      a[m] = 0;\n    }\n    cout << x << endl;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22138", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, x;\n  int sz[16];\n  while (1) {\n    x = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    for (m = 0; m <= i - 2; m++) {\n      for (n = m + 1; n <= i - 1; n++) {\n        if (sz[m] == 2 * sz[n] || sz[n] == 2 * sz[m]) {\n          x++;\n        }\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22139", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, j;\n  int a[16];\n  cin >> x;\n  int i = 1;\n  int k = 0;\n  while (x != -1) {\n    a[i] = x;\n    i++;\n    if (x != 0) {\n      k = i;\n    } else {\n      int sum = 0;\n      for (i = 1; i <= k; i++) {\n        for (j = 1; j <= k; j++) {\n          if (a[i] == 2 * a[j])\n            sum++;\n        }\n      }\n      cout << (sum - 1) << endl;\n      i = 1;\n    }\n    cin >> x;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], num;\n  while (scanf(\"%d\", &a[0]), a[0] + 1) {\n    i = 1;\n    num = 0;\n    while (scanf(\"%d\", &a[i]), a[i]) {\n      i++;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], n, i, j, sum = 0;\n\n  a[0] = 1;\n  while (1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      if (a[1] == -1)\n        goto end;\n    }\n    n = i - 1;\n    for (i = 1; i < n; i++) {\n      for (j = 1; j < n; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n    for (i = 1; i < 16; i++)\n      a[i] = 0;\n    sum = 0;\n  }\nend:;\n}\n"}
{"label": "12", "index": "22142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num[16];\n\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\n\nint main() {\n  int n;\n  while (cin >> n && n != -1) {\n    memset(num, 0, sizeof num);\n    num[0] = n;\n    int count = 0;\n    int i = 1;\n    for (; cin >> n && n != 0; i++)\n      num[i] = n;\n    qsort(num, i, sizeof(int), Compare);\n\n    for (int j = 0; j < i - 1; j++) {\n      int temp = num[j];\n      for (int k = j + 1; k < i; k++) {\n        if (num[k] == temp * 2) {\n          count++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22143", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b[100][15], c, i, m, x, y, n, e;\n  c = 0;\n  i = 0;\n  for (m = 0; m < 16; m++) {\n    cin >> a;\n    if (a != 0) {\n      b[i][m] = a;\n    }\n    if (a == 0) {\n      for (x = 0; x < m; x++) {\n        for (y = 0; y < m; y++) {\n          n = b[i][x] / b[i][y];\n          e = b[i][x] % b[i][y];\n          if (n == 2 && e == 0) {\n            c++;\n          }\n        }\n      }\n      printf(\"%d\\n\", c);\n      c = 0;\n      m = -1;\n      i++;\n    }\n    if (a == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22144", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, i = 0, j = 0, m = 0;\n  scanf(\"%d \", &a[0]);\n  while (a[i] != 0) {\n    cin >> a[i + 1];\n    i = i + 1;\n  }\n  i = 0;\n  while (a[0] != -1) {\n    while (a[i] != 0) {\n      while (a[j] != 0) {\n        if (((float)a[j]) / ((float)a[i]) == 2)\n          m = m + 1;\n        j = j + 1;\n      }\n      j = 0;\n      i = i + 1;\n    }\n    printf(\"%d\\n\", m);\n    i = 0;\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0) {\n      scanf(\"%d\", &a[i + 1]);\n      i = i + 1;\n    }\n    i = 0;\n  }\n}\n"}
{"label": "12", "index": "22145", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16] = {0}, sum = 0;\n  int i = 0;\n\n  while (1) {\n    i = 0;\n    sum = 0;\n\n    while (1) {\n      cin >> num[i];\n\n      if (num[i] == -1)\n        return 0;\n      if (num[i] == 0)\n        break;\n      i++;\n    }\n\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = j + 1; k < i; k++) {\n        if (num[j] == 2 * num[k] || num[k] == 2 * num[j])\n          sum++;\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  float p[100][999];\n  int i, m;\n  for (m = 0;; m++) {\n    for (i = 0;; i++) {\n      cin >> p[m][i];\n      if (p[m][i] == 0)\n        break;\n    }\n    if (p[m][0] == -1)\n      break;\n    else {\n      int a = 0;\n      for (int j = 0; j < i; j++) {\n        for (int k = 0; k < i; k++) {\n          if (p[m][j] / p[m][k] == 2)\n            a++;\n          else\n            a = a;\n        }\n      }\n      cout << a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int in;\n  cin >> in;\n  while (in != -1) {\n    int a[15];\n    int i = 0, num, count = 0;\n    while (in != 0) {\n      a[i] = in;\n      i++;\n      cin >> in;\n    }\n    num = i;\n    for (int p = 0; p < num; p++) {\n      if (a[p] % 2 == 1)\n        continue;\n      for (int q = 0; q < num; q++) {\n        if (a[p] == a[q] * 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n    scanf(\"%d \", &in);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22148", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (scanf(\"%d \", &a[0]) && a[0] != -1) {\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = i; j < n; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  float s[15], t[15];\n  int a = 0;\n\n  for (int i = 0; i < 15; i++) {\n\n    cin >> s[i];\n    if (s[i] == 0)\n      break;\n    else {\n      t[i] = s[i];\n      a = a + 1;\n    }\n  }\n\n  int b = 0;\n  for (int h = 0; h < a; h++) {\n    for (int k = 0; k < a; k++) {\n      if (t[h] / t[k] == 2)\n\n        b = b + 1;\n    }\n  }\n  printf(\"%d\", b);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, j, k;\n\n  int n;\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      n = 0;\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 0)\n            continue;\n          if (a[j] == 2 * a[k])\n            n = n + 1;\n        }\n      }\n      cout << n << endl;\n      a[0] = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n\n  for (i = 1; i <= j - 1; i++)\n    printf(\"%d \", b[i]);\n}\n"}
{"label": "12", "index": "22152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p, s[15];\n  for (i = 0;; i++) {\n    k = 0;\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        break;\n      for (p = 0; p < j; p++)\n        if (s[j] == 2 * s[p] || s[p] == 2 * s[j])\n          k++;\n    }\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22153", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], sum = 0, b, n = 0;\n  while (scanf(\"%d \", &b)) {\n\n    if (b == -1)\n      break;\n\n    else if (b == 0) {\n      for (int i = 0; i <= n - 1; i++) {\n\n        for (int j = i + 1; j <= n - 1; j++) {\n\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            sum++;\n        }\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      n = 0;\n    }\n\n    else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, x, y, m, n, a[20];\n  for (j = 1; j <= 15; j++) {\n    t = 0;\n    cin >> y;\n    if (y == -1)\n      break;\n    else {\n      a[0] = y;\n      for (i = 1; i <= 20; i++) {\n        scanf(\"%d\", &x);\n        if (x == 0)\n          break;\n        else {\n          a[i] = x;\n        }\n      }\n      for (m = 0; m <= i - 1; m++) {\n        for (n = 0; n <= i - 1; n++) {\n          if (a[m] == 2 * a[n])\n            t++;\n        }\n      }\n      cout << t << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[15];\n  int i, NO, tmp, n, j;\n  while (1) {\n    n = 0;\n    cin >> tmp;\n    a[0] = tmp;\n    if (tmp == -1)\n      break;\n\n    NO = 0;\n\n    while (1) {\n      scanf(\"%d\", &tmp);\n      if (tmp == 0)\n        break;\n      a[++n] = tmp;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          NO++;\n\n    cout << NO << \"\\n\";\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "12", "index": "22156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n = 0, a[16], i = 0, count = 0;\n  for (;; n++) {\n    cin >> a[n];\n    if (a[n] == 0) {\n      cout << count << \"\\n\";\n      memset(a, 0, sizeof(a));\n      n = 0;\n      count = 0;\n    }\n    if (a[n] == -1)\n      break;\n    int ifOdd = a[n] % 2;\n    for (i = 0; i < n; ++i) {\n      if (ifOdd == 0)\n        if (a[i] == a[n] / 2)\n          count++;\n      if (a[i] == a[n] * 2)\n        count++;\n    }\n  }\n}\n"}
{"label": "12", "index": "22157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count = 0;\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 2; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] / a[j] == 2 && a[k] % a[j] == 0 ||\n            a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22158", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][20] = {0};\nint i = 1;\nint b[100] = {0};\n\nvoid sort();\nvoid compare();\nint main() {\n  int p = 0;\n  int j = 0;\n\n  do {\n    j = 1;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n\n  sort();\n  compare();\n\n  for (p = 1; p <= i - 2; p++) {\n    cout << b[p] << endl;\n  }\n\n  return 0;\n}\n\nvoid sort() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  int t = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 14; x++)\n      for (y = 1; y <= 15 - x; y++) {\n        if (a[p][y] > a[p][y + 1]) {\n          t = a[p][y];\n          a[p][y] = a[p][y + 1];\n          a[p][y + 1] = t;\n        }\n      }\n}\n\nvoid compare() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 15; x++)\n      for (y = x; y <= 15; y++) {\n        if ((a[p][y] == 2 * a[p][x]) && (a[p][x] != 0))\n          b[p]++;\n      }\n}\n"}
{"label": "12", "index": "22159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, i, j;\n  int sz[16];\n  for (;;) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0 || sz[0] == -1)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (sz[i] - 2 * sz[j] == 0)\n          t = t + 1;\n        else\n          ;\n      }\n    }\n    if (sz[0] == -1)\n      break;\n    printf(\"%d\\n\", t);\n    t = 0;\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22160", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &s[i]);\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = i; j < count; j++) {\n        if (s[i] == s[j] * 2 || s[j] == s[i] * 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22161", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[16], whether, number = 0, numofpairs = 0;\n  \n  \n  do {\n    for (int i = 0; i < 16; i++) {\n      cin >> a[i]; \n      if (a[i] == -1) {\n        whether = 0;\n        break;\n      } \n      else if (a[i] == 0) {\n        whether = 1;\n        break;\n      }          \n      number++;  \n    }            \n    if (whether) \n    {\n      for (int j = 0; j < number; j++) {\n        for (int k = 0; k < number; k++) {\n          if (a[k] == 2 * a[j])\n            numofpairs++;\n        } \n      }\n      cout << numofpairs << endl; \n    }\n    numofpairs = 0;\n    number = 0;           \n  } while (whether == 1); \n\n  return 0;\n}\n"}
{"label": "12", "index": "22162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[16], i, j, count, a, n;\n  while (1) {\n    count = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &num[i]);\n      if (num[i] == -1)\n        break;\n      if (num[i] == 0)\n        break;\n      n += 1;\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < n; i++) {\n        a = num[i];\n        for (j = 0; j < n; j++)\n          if (num[j] == 2 * a)\n            count += 1;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], n, m, i = 1, t = 0;\n\n  cin >> a[1];\n\n  while (a[i] != -1) {\n    while (a[i] > 0) {\n      i = i + 1;\n      cin >> a[i];\n    }\n\n    for (m = 1; m < i; m++)\n      for (n = m + 1; n <= i; n++)\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          t = t + 1;\n\n    cout << t << \"\\n\";\n\n    for (i = 0; i < 17; i++) {\n      a[i] = 0;\n    }\n\n    t = 0;\n    i = 1;\n\n    cin >> a[1];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22164", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], j;\n  int k, m, y;\n  int i;\n  while (1 == 1) {\n    m = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        y = 1;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n      else\n        m = m + 1;\n    }\n    if (y == 1)\n      break;\n    else {\n\n      k = 0;\n      for (i = 0; i < m - 1; i++) {\n\n        for (j = i + 1; j < m; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            k++;\n        }\n      }\n    }\n\n    printf(\"%d \", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22165", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  do {\n    int a[16] = {0};\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] != 0 && a[i - 1] != -1);\n\n    if (a[i - 1] == 0) {\n      int n = 0;\n      for (int j = 0; j <= i - 2; j++)\n        for (int k = 1; k <= i - 2 - j; k++) {\n          if (a[j] == a[j + k] * 2 || a[j + k] == a[j] * 2)\n            n++;\n        }\n      printf(\"%d\\n\", n);\n      i = 0;\n    }\n    if (a[0] == -1)\n      break;\n  } while (i != 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22166", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], result[100];\n  int i, j, k, n = 0, row = 0;\n  while (1) {\n    for (i = 1; i < 16; i++)\n      sz[i] = 0;\n\n    scanf(\"%d\", &sz[0]);\n    if (sz[0] == -1) {\n      break;\n    } else {\n      k = 1;\n      for (i = 1; i < 16; i++) {\n        cin >> sz[i];\n        if (sz[i] == 0) {\n          break;\n        } else {\n          k++;\n        }\n      }\n      n = 0;\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < i; j++) {\n          if (sz[i] == sz[j] * 2 || sz[j] == sz[i] * 2) {\n            n++;\n          }\n        }\n      }\n      result[row] = n;\n      row++;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22167", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n[100][100], i, k, j, s[100], num[100], t, p, m;\n  \n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0) {\n          num[i] = j;\n          break;\n        }\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t < j; t++) {\n      for (m = t; m < num[k]; m++) {\n        if ((2 * n[k][t] == n[k][m]) || (2 * n[k][m] == n[k][t])) {\n          s[k] = s[k] + 1;\n        }\n        \n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    printf(\"%d\\n\", s[p]);\n  return 0;\n}\n"}
{"label": "12", "index": "22168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char s[100];\n  for (;;) {\n\n    scanf(\"%s \", s);\n    int i, j, k = 0, m = 0, x[15], n = 0;\n    if (s[0] == '-' && s[1] == '1')\n      break;\n    else {\n      for (i = 0;; i++) {\n        if (s[i] == '0')\n          break;\n        else {\n          if ('1' <= s[i] && s[i] <= '9') {\n            j = s[i] - '0';\n            k = k * 10 + j;\n\n          } else {\n            x[m] = k;\n            m++;\n            k = 0;\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++)\n      for (j = i + 1; j < m; j++) {\n        if ((x[i] / x[j] == 2 && x[i] % x[j] == 0) ||\n            (x[j] / x[i] == 2 && x[j] % x[i] == 0))\n          n++;\n      }\n    cout << n << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22169", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint a[100][20] = {0}; \nint i = 1;            \nint b[100] = {0};     \n\nvoid sort();    \nvoid compare(); \nint main() {\n  int p = 0;\n  int j = 0;\n\n  do {\n    j = 1;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][j - 1] != -1); \n\n  sort(); \n  compare();\n\n  for (p = 1; p <= i - 2; p++) {\n    cout << b[p] << endl; \n  }\n\n  return 0;\n}\n\nvoid sort() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  int t = 0;\n  for (p = 1; p <= i - 2; p++) \n    for (x = 1; x <= 14; x++)\n      for (y = 1; y <= 15 - x; y++) {\n        if (a[p][y] > a[p][y + 1]) {\n          t = a[p][y];\n          a[p][y] = a[p][y + 1];\n          a[p][y + 1] = t;\n        }\n      }\n}\n\nvoid compare() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  for (p = 1; p <= i - 2; p++) \n    for (x = 1; x <= 15; x++)\n      for (y = x; y <= 15; y++) {\n        if ((a[p][y] == 2 * a[p][x]) && (a[p][x] != 0))\n          b[p]++;\n      }\n}\n"}
{"label": "12", "index": "22170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n\n  cin >> a[1];\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    printf(\"%d \", b[j]);\n    cin >> a[1];\n    j++;\n  }\n}\n"}
{"label": "12", "index": "22171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[10000], m[15];\n  int *p;\n  int i, j, k = 0, total, all = 0, q, t;\n  p = &n[0];\n  for (i = 0;; i++) {\n    scanf(\"%d\", &n[i]);\n    if (n[i] == 0) {\n      all++;\n    }\n    if (n[i] == -1) {\n      break;\n    }\n  }\n  while (all > 0) {\n    for (i = 0, t = 0; n[k] != 0; i++, k++) {\n      m[i] = n[k];\n      t++;\n    }\n    k = k + 1;\n    total = 0;\n    for (q = 0; q < t; q++) {\n      for (j = 0; j < t; j++) {\n        if ((m[q] / m[j] == 2) && (m[q] % m[j] == 0)) {\n          total++;\n        }\n      }\n    }\n    cout << total << \"\\n\";\n    all--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22172", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k;\n  for (i = 1; i <= 16; i++) {\n    a[i] = 1;\n  }\n  int count = 0;\n  while (scanf(\"%d \", &a[1])) {\n    if (a[1] == -1) {\n      break;\n    } else {\n      for (i = 2; a[i - 1] != 0; i++)\n        cin >> a[i];\n    }\n    i = i - 2;\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int list[15] = {0};\n  int i, j, num, sum;\n\n  cin >> num;\n\n  while (num != -1) {\n    i = 1;\n    j = 0;\n    sum = 0;\n    list[0] = num;\n    while ((cin >> list[i], list[i]) != 0) {\n      i++;\n    }\n    while (list[j]) {\n      for (i = j + 1; list[i]; i++) {\n        if (list[i] == 2 * list[j] || 2 * list[i] == list[j])\n          sum++;\n      }\n      j++;\n    }\n    cout << sum << \"\\n\";\n    cin >> num;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22174", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  float a[100];\n  int i, j, t;\n  do {\n    t = 0;\n    for (i = 0; i <= 99; i++) {\n      cin >> a[i];\n      if (i >= 1) {\n        if (a[i] == 0)\n          break;\n\n        for (j = 0; j <= i - 1; j++) {\n          if ((a[i] == 2 * a[j]) || (a[i] == a[j] / 2))\n            t = t + 1;\n        }\n      }\n    }\n    if (a[0] != -1)\n      printf(\"%d\\n\", t);\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22175", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int i = 0;\n    int a[20] = {0};\n    int sum = 0;\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[i - 1] == -1)\n      break;\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = 0; k < i - 1; k++)\n        if (a[j] * 2 == a[k])\n          sum++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "12", "index": "22176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, num[16], f;\n  scanf(\"%d\", &num[1]);\n  do {\n    k = 1;\n    f = 0;\n    do {\n      k++;\n      scanf(\"%d\", &num[k]);\n    } while (num[k] != 0);\n    for (i = 1; i <= k - 1; i++)\n      for (j = 1; j <= k - 1; j++)\n        if (num[i] == num[j] * 2)\n          f++;\n    printf(\"%d\\n\", f);\n    scanf(\"%d\", &num[1]);\n  } while (num[1] != -1);\n}\n"}
{"label": "12", "index": "22177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, m = 0;\n  int a[16];\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      m = i;\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n += 1;\n      }\n    }\n    cout << n / 2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int num[16] = {0};\n    cin >> num[0];\n    if (num[0] == -1)\n      break;\n\n    int sum = 1;\n    for (;; sum++) {\n      cin >> num[sum];\n      if (num[sum] == 0) {\n        sum--;\n        break;\n      }\n    }\n    int twice = 0;\n    for (int i = 0; i < sum; i++) {\n      for (int j = i + 1; j <= sum; j++) {\n\n        if ((num[j] == 2 * num[i]) || (num[i] == 2 * num[j]))\n          twice++;\n      }\n    }\n    cout << twice << \"\\n\";\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "22179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint iFind(int *p, int findnum) {\n  int k, sum = 0;\n  for (k = 0; k < 15; k++) {\n    if (*(p + k) == findnum)\n      sum++;\n  }\n  return sum;\n}\n\nint main() {\n  int a[15], temp, i = 0, j, k, *p, sum = 0;\n  p = a;\n  for (j = 0; j < 15; j++)\n    a[j] = -1;\n  while (cin >> temp, temp != -1) {\n    if (temp != 0) {\n      a[i] = temp;\n      i++;\n    } else {\n      for (k = 0; k < 15; k++) {\n        sum += iFind(p, a[k] * 2);\n      }\n      cout << sum << \"\\n\";\n      sum = 0;\n      i = 0;\n      for (j = 0; j < 15; j++) {\n        a[j] = -1;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22180", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k[16], a, p, b, c, q;\n  for (i = 1; i < 1000; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a);\n      if (a == -1)\n        break;\n      else if (a != -1) {\n        if (a == 0)\n          break;\n        else {\n          k[j] = a;\n          p++;\n        }\n      }\n    }\n    if (a == -1)\n      break;\n    for (b = 0; b < p; b++) {\n      for (c = 0; c < p; c++) {\n        if (k[b] - 2 * k[c] == 0)\n          q++;\n      }\n    }\n    printf(\"%d\\n\", q);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], i, j, k, n = 0, N = 0, t;\n  for (k = 1; k < 100; k++) {\n    for (i = 0; i < 100; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        i = 100;\n    }\n    if (a[0] != -1) {\n      for (i = 1; i <= n - 2; i++) {\n        for (j = 0; j <= n - i - 2; j++) {\n          if (a[j] > a[j + 1]) {\n            t = a[j];\n            a[j] = a[j + 1];\n            a[j + 1] = t;\n          }\n        }\n      }\n      for (i = n - 2; i >= 0; i--) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] == 2 * a[j])\n            N++;\n        }\n      }\n      cout << N << endl;\n      N = 0;\n      n = 0;\n    }\n\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 100, nfa[n];\n  int a[n][16];\n  memset(a, -100, sizeof(a));\n  memset(nfa, 0, sizeof(nfa));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1) {\n        n = i;\n        break;\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n  for (int i = 0; i < n; i++)\n    for (int k = 0; k < 16; k++)\n      for (int j = 0; j < 16; j++)\n        if (a[i][j] == 2 * a[i][k])\n          nfa[i]++;\n  for (int i = 0; i < n; i++)\n    cout << nfa[i] - 1 << endl;\n  return 0;\n}\n"}
{"label": "12", "index": "22183", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[15];\n  int i, m;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &num[i]);\n    {\n      if (num[i] == 0)\n        break;\n    }\n    i++;\n  }\n  int j = 0;\n  int a;\n  m = i;\n  i = a = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (num[i] / num[j] == 2 && num[i] % num[j] == 0)\n        a++;\n    }\n  }\n  printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "12", "index": "22184", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, t, k;\n\n  for (i = 0;; i++)\n\n  {\n    for (j = 0; j <= 15; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n      if (a[0] == -1) {\n        printf(\"\\n\");\n        return 0;\n      }\n    }\n\n    for (j = 0, t = 0; j <= 14; j++) {\n      for (k = j + 1; k <= 15; k++) {\n        if (a[k] != 0 && a[j] != 0 && (2 * a[j] == a[k] || 2 * a[k] == a[j]))\n          t = t + 1;\n      }\n      a[j] = 0;\n    }\n    printf(\"%d\\n\", t);\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "12", "index": "22185", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l, k, s, t;\n  int a[100000] = {0}, b[100000];\n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  s = 0;\n  for (i = 0; i < 100000; i++) {\n    t = 0;\n    for (j = 0; j < 10000; j++) {\n      b[j] = a[s];\n      s++;\n      if (b[j] == 0) {\n        for (k = 0; k <= j; k++)\n          for (l = k + 1; l <= j; l++)\n            if ((b[k] == 2 * b[l]) || (b[l] == 2 * b[k]))\n              t++;\n        cout << t << endl;\n        break;\n      }\n    }\n    if (a[s] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22186", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[100][15], t[15];\n  int sum[100];\n  int i, j, n, m, k;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d \", &s[i][j]);\n      if (s[i][j] == 0) {\n        t[i] = j;\n        break;\n      } else if (s[i][0] == -1)\n        break;\n    }\n    if (s[i][0] == -1)\n      break;\n  }\n  for (n = 0; n < i; n++) {\n    sum[n] = 0;\n    for (m = 0; m < t[n] - 1; m++) {\n      for (k = m + 1; k < t[n]; k++) {\n        if (s[n][m] == 2 * s[n][k] || s[n][k] == 2 * s[n][m]) {\n          sum[n]++;\n        }\n      }\n    }\n  }\n  for (n = 0; n < i; n++)\n    printf(\"%d\\n\", sum[n]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22187", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  do {\n    int a[16] = {0};\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n    } while (a[i - 1] != 0 && a[i - 1] != -1);\n\n    if (a[i - 1] == 0) {\n      int n = 0;\n      for (int j = 0; j <= i - 2; j++)\n        for (int k = 1; k <= i - 2 - j; k++) {\n          if (a[j] == a[j + k] * 2 || a[j + k] == a[j] * 2)\n            n++;\n        }\n      cout << n << endl;\n      i = 0;\n    }\n    if (a[0] == -1)\n      break;\n  } while (i != 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][15], i, j, n, m, a[100], p, b[100] = {0};\n  for (i = 0;;) {\n    for (j = 0;;) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        a[i] = j + 1;\n        i++;\n        break;\n      } else if (s[i][j] == -1)\n        break;\n      else\n        j++;\n    }\n    if (s[i][j] == -1)\n      break;\n  }\n  for (m = 0; m < i; m++) {\n    for (n = 0; n < a[m] - 1; n++) {\n      for (p = 0; p < a[m] - 1; p++) {\n        if (s[m][p] == 2 * s[m][n])\n          b[m]++;\n      }\n    }\n  }\n  for (m = 0; m < i; m++) {\n    printf(\"%d\\n\", b[m]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, flag;\n  while (1) {\n    flag = 0;\n    i = 0;\n    scanf(\"%d\", &a[i]);\n    if (a[0] == -1)\n      break;\n    else {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      num = i;\n      for (i = 0; i < num; i++)\n        for (j = i + 1; j < num; j++)\n          if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n            flag++;\n      printf(\"%d\\n\", flag);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22190", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, g, n, m;\n  for (j = 0;; j++) {\n    for (i = 0, n = 0; i < 16; i++) {\n      cin >> x[i];\n      if (x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    g = i;\n    for (i = 0; i < g; i++) {\n      for (m = 0; m < g; m++) {\n        if ((float)x[i] == x[m] * 2)\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n}\n"}
{"label": "12", "index": "22191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, a, b, k;\n  k = 0;\n  int sz[20], sz2[20], jieguo[1000];\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> (sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n      sz2[i] = sz[i];\n    }\n    if (sz[i] == -1) {\n      break;\n    }\n    n = 0;\n    for (a = 0; a < i; a++) {\n      for (b = 0; b < i; b++) {\n        if (sz2[b] * 2 == sz[a]) {\n          n++;\n        }\n      }\n    }\n    jieguo[k] = n;\n    k++;\n  }\n  for (i = 0; i < k; i++)\n    cout << jieguo[i] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "12", "index": "22192", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], b[20];\n  int i, j, k;\n  int n;\n  i = 1;\n  n = 0;\n\n  while (1) \n  {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1)\n      break;            \n    else if (a[i] == 0) \n    {\n      for (j = 1; j <= i - 1; j++)\n        b[j] = a[j] * 2;\n\n      for (j = 1; j <= i - 1; j++)\n        for (k = 1; k <= i - 1; k++) {\n          if (b[j] == a[k])\n            n++;\n        }\n\n      printf(\"%d\\n\", n);\n      i = 1;\n      n = 0; \n    } else\n      i++; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], i = 1, j, k, *p, count = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    p = a;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (p[j] == p[k] * 2)\n          count++;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101] = {{0}}, count = 0, i, j, q, n, b;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &b);\n    if (b != -1) {\n      a[i][1] = b;\n      for (j = 2; j <= 100; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0) {\n          a[i][j] = 0;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    count = 0;\n    for (j = 1; j <= 100; j++) {\n      if (a[i][j] != 0) {\n        for (q = 1; q <= 100; q++) {\n          if (a[i][j] == 2 * a[i][q])\n            count = count + 1;\n        }\n      } else {\n        break;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n}\n"}
{"label": "12", "index": "22195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0, mat[100];\n  memset(mat, 0, sizeof(mat));\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n == 0) {\n      cout << sum << \"\\n\";\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    } else if (n > 49) {\n      mat[n] = 1;\n      if (mat[n >> 1])\n        sum++;\n    } else {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, j, k, s = 0;\n  int a[17];\n  for (scanf(\"%d\", &a[1]); a[1] != -1; scanf(\"%d\", &a[1])) {\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        t = i - 1;\n        break;\n      }\n    }\n    for (j = 1; j <= t; j++) {\n      for (k = 1; k <= t; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int ch[16], i, j, n, m;\n\n  cin >> ch[0];\n\n  while (ch[0] != -1) {\n    n = 0;\n\n    for (i = 1; ch[i - 1] != 0; i++) {\n      n++;\n\n      cin >> ch[i];\n    }\n\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (ch[i] % 2 == 1)\n        continue;\n      else {\n        for (j = 0; j < n; j++) {\n          if (ch[i] == 2 * ch[j])\n            m++;\n        }\n      }\n    }\n    cout << m << endl;\n\n    cin >> ch[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k, sz[17], n = 0;\n  for (i = 0; i < 17; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == -1)\n      break;\n    else {\n      if (i > 0) {\n        if (sz[i] > 0) {\n          for (j = 0; j < i; j++) {\n            if (2 * sz[j] == sz[i] || 2 * sz[i] == sz[j]) {\n              n++;\n            }\n          }\n        } else {\n          cout << n << \"\\n\";\n          n = 0;\n          i = 0;\n          j = 0;\n          for (k = 0; k < 16; k++)\n            sz[k] = -2;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20][20], i, j, b[20], s, n = 0, k;\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1)\n        break;\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n\n    if (a[i][0] == -1)\n      break;\n  }\n  s = i;\n  for (i = 0; i < s; i++) {\n    for (j = 0; j < b[i]; j++) {\n      for (k = j + 1; k < b[i]; k++) {\n        if (((a[i][j] % a[i][k] == 0) && (a[i][j] / a[i][k] == 2)) ||\n            ((a[i][k] % a[i][j] == 0) && (a[i][k] / a[i][j] == 2))) {\n          n = n + 1;\n        }\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i = -1, j, number = 0;\n  do {\n    for (i = 0; i < 16; i++) {\n      a[i] = 0;\n    }\n    i = -1;\n    do {\n      i++;\n      scanf(\"%d \", &a[i]);\n    } while (a[i] != 0 && a[i] != -1);\n    number = 0;\n    for (i = 0; a[i] != 0 && a[i] != -1; i++) {\n      for (j = 0; a[j] != 0 && a[i] != -1; j++) {\n        if (a[j] == a[i] * 2) {\n          number++;\n        }\n      }\n    }\n    if (a[0] != -1) {\n      cout << number << \"\\n\";\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22201", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a = 1, i = 0, j, k, n = 0, zs = 0;\n  int num[15];\n  while (a != -1) {\n\n    scanf(\"%d\", &a);\n    if (a != 0) {\n      num[i] = a;\n      n++;\n      i++;\n    } else {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (num[j] == 2 * num[k])\n            zs++;\n        }\n      }\n      printf(\"%d\\n\", zs);\n      i = 0;\n      n = 0;\n      zs = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], s = 0;\n  while (scanf(\"%d\", &a[++s]) != EOF) {\n    if (a[1] == -1)\n      break;\n    do\n      scanf(\"%d\", &a[++s]);\n    while (a[s] != 0);\n    s--;\n    int ans = 0;\n    for (int i = 1; i <= s; i++)\n      for (int j = 1; j <= s; j++)\n        if (a[i] * 2 == a[j]) {\n          ans++;\n        }\n    printf(\"%d\\n\", ans);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int j, num;\n  while (1) {\n    num = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f \", &a[i]);\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0) {\n        j = i - 1;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (int i = 0; i <= j; i++) {\n      for (int k = 0; k <= j; k++) {\n        if (a[i] / a[k] == 2 && i != k)\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], m, n, i, j, k, p;\n  i = 0;\n  while (scanf(\"%d\", &m) != EOF) {\n    if (m == -1)\n      break;\n    else if (m == 0) {\n      for (j = 0, n = 0; j <= i - 2; j++)\n        for (p = j; p <= i - 1; p++)\n          if (a[j] == a[p] * 2 || a[p] == a[j] * 2) {\n            n++;\n          }\n      printf(\"%d\\n\", n);\n      i = 0;\n    } else {\n      a[i] = m;\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int p;\n  for (p = 1; p <= 100; p++) {\n    int a[17];\n    int u, i = 0;\n    for (u = 1; u <= 16; u++) {\n      cin >> a[u];\n      i++;\n      if (a[u] == 0) {\n        break;\n      }\n    }\n    if (a[1] == -1) {\n      break;\n    }\n    int j, k, t;\n    for (j = 1; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] > a[k]) {\n          t = a[k];\n          a[k] = a[j];\n          a[j] = t;\n        }\n      }\n    }\n    int r, s, w = 0;\n    for (r = 1; r < i - 1; r++) {\n      for (s = r + 1; s <= i - 1; s++) {\n        if (a[r] * 2 == a[s]) {\n          w = w + 1;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", w);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22206", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, a[100] = {0}, p;\n  cin >> p;\n  while (p > 0) {\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    for (; p > 0;) {\n      a[p] = 1;\n      scanf(\"%d\", &p);\n    }\n    n = 0;\n    for (i = 1; i < 50; i = i + 1)\n      if (a[i] && a[2 * i])\n        n = n + 1;\n    printf(\"%d\\n\", n);\n    scanf(\"%d\", &p);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint mat[300];\n\nint main() {\n  int n, sum = 0;\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n) {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    } else {\n      cout << sum << \"\\n\";\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    }\n  }\n}\n"}
{"label": "12", "index": "22208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {0}, i = 0, j = 0, n = 0, l[100] = {0}, d, N[100] = {0};\n  do {\n    j = 0;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while (a[i][j - 1] != 0 && a[i][j - 1] != -1);\n    l[i] = j - 1;\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i]; j++) {\n      for (d = j; d < l[i]; d++) {\n        if (a[i][d] == 2 * a[i][j] || a[i][j] == 2 * a[i][d])\n          N[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << N[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "22209", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuru[20] = {0};\n\n  while (true) {\n    int i = 1, j, k, s, no;\n    s = 0;\n    cin >> shuru[0];\n    if (shuru[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> shuru[i];\n      if (shuru[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((shuru[j] == 2 * shuru[i]) || (2 * shuru[j] == shuru[i]))\n          s++;\n    }\n\n    printf(\"%d\\n\", s);\n    for (i = 0; i <= 14; i++)\n      shuru[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][20];\n  int i, j, k, n = 0;\n  int x[1000];\n  for (i = 0; i < 1000; i++) {\n    x[i] = 0;\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        n++;\n        break;\n      }\n      if (a[i][j] == -1)\n        break;\n    }\n    if (a[i][0] == -1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          x[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = j = k = a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; scanf(\"%d\", &x[i]); i++) {\n\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int n, i, j, k;\n  for (k = 1;; k++) {\n    memset(a, 0, sizeof(a));\n    n = 0;\n    i = 1;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != (-1)) {\n      if (a[1] != 0) {\n        for (i = 1;;) {\n          i++;\n          cin >> a[i];\n          if (a[i] != 0) {\n            for (j = 1; j <= (i - 1); j++) {\n              if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n                n = n + 1;\n              }\n            }\n          } else {\n            printf(\"%d\\n\", n);\n            break;\n          }\n        }\n      }\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16] = {0};\n  while (1) {\n    int i, j, count = 0, flag = 0;\n    for (i = 0;; i++) {\n      cin >> s[i];\n      if (s[i] == -1) {\n        flag = 1;\n        break;\n      }\n      if (s[i] == 0)\n        break;\n      count++;\n    }\n    if (flag)\n      break;\n    int num = 0;\n\n    for (i = 0; i < count; i++) {\n      for (j = i; j < count; j++) {\n        if (s[i] == s[j] * 2 || s[j] == s[i] * 2)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, m = 0, j, k = 0;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          k++;\n        else\n          continue;\n      }\n    printf(\"%d\\n\", k);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22215", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k;\n  for (i = 0; i < 15; i++)\n    x[i] = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &x[i]);\n    if (x[i] == -1)\n      break;\n    if (x[i] == 0) {\n      int t = 0;\n      for (j = 0; j < i; j++)\n        for (k = 0; k < i; k++)\n          if (x[j] == 2 * x[k]) {\n            t++;\n          }\n      printf(\"%d\\n\", t);\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22216", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, sum, e = 0;\n  int a[20];\n  for (;;) {\n\n    sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        i--;\n        break;\n      } else if (a[i] == -1) {\n        e = -1;\n        break;\n      }\n    }\n    if (e == -1)\n      break;\n    for (j = 0; j <= i; j++) {\n      for (k = 0; k <= i; k++) {\n        if (a[k] == a[j] * 2) {\n          sum++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22217", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, s;\n  for (s = 0, cin >> a[1]; a[1] != -1; s = 0, cin >> a[1]) {\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j < i; j++)\n      for (k = 1; k < i; k++)\n        if (a[j] == 2 * a[k]) {\n          s++;\n        }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m, x, l;\n  int a[15];\n  for (m = 1;; m++) {\n    for (x = 1; x <= 16; x++) {\n      scanf(\"%d \", &l);\n      if (l != 0) {\n        a[x - 1] = l;\n      } else {\n        n = x - 1;\n        t = 0;\n        for (i = 0; i <= n - 2; i++) {\n          for (j = i + 1; j <= n - 1; j++) {\n            if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n              t++;\n          }\n        }\n        printf(\"%d\\n\", t);\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, m, p, q, b, c[100];\n  for (j = 1; j <= 100; j++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[j][i];\n      if (a[j][i] == 0 || a[j][i] == -1) {\n        c[j] = i - 1;\n        break;\n      }\n    }\n    if (a[j][i] == -1)\n      break;\n  }\n  for (m = 1; m < j; m++) {\n    b = 0;\n    for (p = 1; p <= c[m]; p++) {\n      for (q = p + 1; q <= c[m]; q++) {\n        if (a[m][q] == 2 * a[m][p] || 2 * a[m][q] == a[m][p])\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 1, num[16] = {0}, s, k = 0;\n  while (scanf(\"%d \", &s)) {\n    a[i] = s;\n    if (a[i] == 0) {\n      i = 0;\n      k++;\n      continue;\n    }\n    if (a[i] == -1)\n      break;\n    for (int j = 0; j <= i; j++) {\n      if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n        num[k]++;\n    }\n    i++;\n  }\n  for (i = 0; i < k; i++) {\n    cout << num[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], x, y, s, i, j, k, m, n;\n  do {\n    scanf(\"%d\", &x);\n    if (x == -1)\n      break;\n    a[0] = x;\n    i = 1;\n    do {\n      scanf(\" %d\", &y);\n      a[i] = y;\n      i = i + 1;\n    } while (y != 0);\n    scanf(\"\\n\");\n    n = i - 2;\n    i = 0;\n    while (i <= n) {\n      j = 0;\n      while (j <= n - 1) {\n        if (a[j] > a[j + 1]) {\n          s = a[j + 1];\n          a[j + 1] = a[j];\n          a[j] = s;\n        }\n        j = j + 1;\n      }\n      i = i + 1;\n    }\n    i = 0;\n    m = 0;\n    while (i <= n - 1) {\n      j = n - i;\n      k = 0;\n      while (k <= j - 1) {\n        if (a[j] == 2 * a[k])\n          m = m + 1;\n        k = k + 1;\n      }\n      i = i + 1;\n    }\n    cout << m << \"\\n\";\n  } while (x != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], x, i, j, k, l, n;\n  for (i = 0;; i++) {\n    n = 0;\n    j = 0;\n    while (cin >> x) {\n      if (x == 0 || x == -1)\n        break;\n      a[j] = x;\n      j++;\n    }\n    if (x == -1) {\n      break;\n    }\n    for (k = 0; k < j; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          n = n + 1;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17][1000], i, j, k, s[1000] = {0};\n  int sum[1000] = {0}, g = 0, n;\n  for (i = 0, k = 0; i <= 1000; i++, k++) {\n    for (j = 0; j <= 16; j++, s[i]++) {\n      cin >> a[j][i];\n      if (a[j][i] == 0)\n        break;\n      else if (a[j][i] == -1) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    for (j = s[i]; j >= 0; j--) {\n      for (n = 0; n < j; n++) {\n        if (a[n][i] < a[j][i]) {\n          if (a[j][i] == 2 * a[n][i]) {\n            sum[i]++;\n          }\n        } else {\n          if (a[n][i] == 2 * a[j][i])\n            sum[i]++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20] = {0};\n  int i, j, k;\n  while (1) {\n    int num = 0;\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 1; j < i; j++) {\n      for (k = j; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count; \n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];   \n      if (a[i] == 0) \n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1) \n      break;\n    count = 0; \n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++)\n        if ((a[k] == 2 * a[j]) || (a[j] == a[k] * 2))\n          count++; \n    cout << count / 2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i = 0, n = 0, j, k, m;\n  for (m = 1;; m++) {\n    i = 0;\n    n = 0;\n    while (scanf(\"%d \", &a[i])) {\n      if (a[i] == 0 || a[i] == -1)\n        break;\n      else {\n        i++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          n++;\n        }\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22227", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000], i = 0, k, x = 0, j;\n  for (;;) {\n    scanf(\"%d \", &a[i]);\n    i++;\n    if (a[i - 1] == -1)\n      break;\n  }\n  for (k = 0; k < i - 1; k++) {\n    for (j = k + 1; j < i - 1; j++) {\n      if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n        x++;\n\n      if (a[j + 1] == 0)\n        break;\n    }\n    if (a[k + 2] == 0 || a[k + 2] == -1) {\n      k = k + 2;\n      printf(\"%d\\n\", x);\n      x = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], t = 0, i, j, k, num;\n  for (i = 0; i < 100; i++) {\n    cin >> a[t][i];\n    if (a[t][i] == 0)\n      t++;\n    else if (a[t][i] == -1)\n      break;\n  }\n\n  for (k = 0; k < t; k++) {\n    num = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][j] == 2 * a[k][i] && a[k][i] != 0)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int an[50], *p, i, t = 0, *q;\n  for (i = 0;;) {\n    scanf(\"%d\", &an[i]);\n    if (an[i] == -1)\n      break;\n    else {\n      for (i = 1;; i++)\n\n      {\n        scanf(\"%d\", &an[i]);\n        if (an[i] == 0)\n          break;\n      }\n      for (p = an; *p != 0; p++) {\n        for (q = an; *q != 0; q++) {\n          if (*q == (*p) * 2)\n            t++;\n        }\n      }\n      cout << t << \"\\n\";\n      t = 0;\n    }\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100], j, k, l, sum = 0;\n  for (;;) {\n    for (j = 0;; j++) {\n      scanf(\"%d \", &a[j]);\n      if (a[j] == 0 || a[j] == -1)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (k = 0; k < j - 1; k++) {\n      for (l = k + 1; l <= j - 1; l++) {\n        if (a[k] == 2 * a[l] || a[l] == 2 * a[k])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200], i, s = 0, cnt = 0, q, j;\n  while (1) {\n    s = 0;\n    cnt = 0;\n    cin >> a[1];\n    if (a[1] == -1)\n      break;\n    for (i = 2; a[i - 1] != 0; i++) {\n      cin >> a[i];\n      cnt++;\n    }\n    for (i = 1; i <= cnt - 1; i++) {\n      for (j = i + 1; j <= cnt; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          s++;\n      }\n    }\n    cout << s << endl;\n  }\n  cin >> q;\n  return 0;\n}\n"}
{"label": "12", "index": "22232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuru[20] = {0};\n\n  while (true) {\n    int i = 1, j, k, s, no;\n    s = 0;\n    cin >> shuru[0];\n    if (shuru[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d \", &shuru[i]);\n      if (shuru[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((shuru[j] == 2 * shuru[i]) || (2 * shuru[j] == shuru[i]))\n          s++;\n    }\n\n    printf(\"%d\\n\", s);\n    for (i = 0; i <= 14; i++)\n      shuru[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, sz[100], erbei[100], *p1, *p2, sum = 0;\n  p1 = sz;\n  p2 = erbei;\n  for (p1 = sz;; p1++) {\n    scanf(\"%d\", p1);\n    n++;\n    if (*p1 == 0) {\n      for (p1 = sz; p1 < sz + n - 1; p1++) {\n        *p2 = *p1 * 2;\n        p2++;\n      }\n      for (p2 = erbei; p2 < erbei + n - 1; p2++) {\n        for (p1 = sz; p1 < sz + n - 1; p1++) {\n          if (*p2 == *p1) {\n            sum++;\n          }\n        }\n      }\n      printf(\"%d\\n\", sum);\n      p1 = sz - 1;\n      p2 = erbei;\n      sum = 0;\n      n = 0;\n    }\n    if (*p1 == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  for (l = 1;; l++) {\n    i = 0;\n    int a[20], num = 0;\n    do {\n      i++;\n      scanf(\"%d \", &a[i]);\n    } while (a[i] > 0);\n    if (a[i] == -1)\n      break;\n    else {\n      for (j = 1; j < i; j++) {\n        for (k = 1; k < i; k++) {\n          if (a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22235", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, a[16], s = 0, j;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      for (j = 0; j <= i; j++)\n        if (a[j] == 2 * a[i] || a[j] == 0.5 * a[i])\n          s += 1;\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    scanf(\"%d\", &a[0]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22236", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, count;\n  float a[20];\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    n = 1;\n    while (1) {\n      scanf(\"%f\", &a[n]);\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    count = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] / a[j] == 2.0) || (a[j] / a[i] == 2.0))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, a[16], s = 0, j;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      for (j = 0; j <= i; j++)\n        if (a[j] == 2 * a[i] || a[j] == 0.5 * a[i])\n          s += 1;\n    }\n    cout << s << \"\\n\";\n    s = 0;\n    scanf(\"%d\", &a[0]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, a[16], s = 0, j;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      for (j = 0; j <= i; j++)\n        if (a[j] == 2 * a[i] || a[j] == 0.5 * a[i])\n          s += 1;\n    }\n    cout << s << \"\\n\";\n    s = 0;\n    cin >> a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, t = -1, s = 0;\n  int a[10000];\n  for (i = 0; i <= 10000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      t = i;\n      printf(\"%d\\n\", s);\n      s = 0;\n    } else {\n      for (j = t + 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          s = s + 1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22240", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  double a[16];\n  while (scanf(\"%lf \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    else {\n      int count = 0, i = 0;\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if ((a[k] / a[j] == 2) || (a[j] / a[k] == 2))\n            count++;\n        }\n      }\n      printf(\"%d\\n\", count);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[20] = {0};\n  while (1) {\n    cin >> a[0];\n    if (a[0] != -1) {\n\n      int i, k, m, num = 0;\n\n      for (i = 1;; i++)\n\n      {\n\n        cin >> a[i];\n\n        if (a[i] == 0)\n          break;\n      }\n\n      for (k = 0; k <= i - 2; k++) {\n        for (m = k + 1; m <= i - 1; m++) {\n          if ((a[m] == (2 * a[k])) || (a[k] == (a[m] * 2)))\n            num++;\n        }\n      }\n      printf(\"%d\\n\", num);\n\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a[1000], n[100];\n\n  int i, t, j, k, tr, sum[20], l = 0;\n\n  while (scanf(\"%d\", &t), t != -1) {\n    sum[l] = 0;\n    i = 0;\n    a[0] = t;\n    while (i++, scanf(\"%d\", &a[i]), a[i])\n      ;\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - j - 1; k++) {\n        if (a[k] > a[k + 1]) {\n          tr = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = tr;\n        }\n      }\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i; k++) {\n        if ((2 * a[j]) == a[k])\n          sum[l]++;\n      }\n    }\n    l++;\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%d \", sum[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22243", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[300], i, n, k, j;\n  for (i = 0; i <= 300; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  for (k = 0; k <= 300; k++) {\n    if (a[k] == -1)\n      break;\n    if (a[k - 1] == 0 || k == 0) {\n      n = 0;\n      for (i = k; a[i] != 0; i++) {\n\n        for (j = i; a[j] != 0; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            n = n + 1;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "22244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, n, x, y;\n  for (;;) {\n    j = 0, n = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      j++;\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    for (i = j - 1; i >= 0; i--) {\n      for (k = i - 1; k >= 0; k--) {\n        x = a[i] % a[k];\n        y = a[i] / a[k];\n        if ((x == 0) && (y == 2))\n          n++;\n      }\n    }\n    printf(\"%d \", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22245", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  while (1) {\n    int i = 0, num = 0, p = 0;\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] <= 0)\n        break;\n      i++;\n    }\n    if (a[0] == -1)\n      break;\n    for (int j = 0; j < i; j++) {\n      p = j;\n      for (int k = 0; k < i; k++) {\n        if (a[p] * 2 == a[k])\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16], i, k, j, count;\n  for (;;) {\n    i = -1;\n    count = 0;\n    do {\n      i++;\n      scanf(\"%d \", &num[i]);\n      if (num[0] == -1)\n        return 0;\n    } while (num[i] != 0);\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j; k <= i - 1; k++) {\n        if ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k]))\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\n}\n"}
{"label": "12", "index": "22247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15][16] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},\n                   {0}, {0}, {0}, {0}, {0}, {0}, {0}},\n      c, m;\n  for (m = 0; m < 100; m++) {\n    for (c = 0; c < 16; c++) {\n      cin >> a[m][c];\n      if (a[m][c] <= 0)\n        break;\n    }\n    if (a[m][0] <= 0)\n      break;\n    int b, d, e, f = 0;\n    for (b = 0; b < c; b++) {\n      d = a[m][b] * 2;\n      for (e = 0; e < c; e++) {\n        if (d == a[m][e])\n          f++;\n      }\n    }\n    printf(\"%d\\n\", f);\n  }\n}\n"}
{"label": "12", "index": "22248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, m = 0;\n  int a[16];\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      m = i;\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n += 1;\n      }\n    }\n    cout << n / 2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22249", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int n = 0, sum = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      else {\n        if (a[i] != 0)\n          n++;\n        else\n          break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (a[j] == 2 * a[k])\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22250", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n  for (i = 1; i <= j - 1; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], k, m, n, j;\n  do {\n    j = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      for (k = 1; k <= 15; k++) {\n        cin >> a[k];\n        if (!a[k])\n          break;\n      }\n      for (m = 0; m < k - 1; m++) {\n        for (n = m + 1; n < k; n++) {\n          if ((a[m] - 2 * a[n] == 0) || (a[n] - 2 * a[m] == 0))\n            j++;\n        }\n      }\n      cout << j << \"\\n\";\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i = 0, j = 0, n = 0;\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i = i++;\n    for (i = 0; a[i] != 0; i++)\n      for (j = i; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          n = n++;\n      }\n    cout << n << \"\\n\";\n    n = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a[20], sum = 0;\n  while (1) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++) {\n      cin >> a[i];\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22254", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, m, b;\n  do {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    j = 0;\n    for (m = 0; m <= i - 1; m++) {\n      for (b = 0; b <= i - 1; b++) {\n        if (a[m] == a[b] * 2) {\n          j++;\n        }\n      }\n    }\n    printf(\"%d\\n\", j);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, n;\n  while (cin >> a[0]) {\n    n = 0;\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++)\n      cin >> a[i];\n    for (j = 0; j <= i - 2; j++)\n      for (r = 0; r <= i - 2; r++)\n        if (2 * a[j] == a[r])\n          n++;\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22256", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a, n = 0;\n  int b[16];\n  cin >> a;\n  while (a != -1) {\n    i = 2;\n    b[1] = a;\n    do {\n      scanf(\"%d\", &a);\n      b[i] = a;\n      i = i + 1;\n    } while (a != 0);\n    for (j = 1; j <= i - 3; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if (b[j] == 2 * b[k] || 2 * b[j] == b[k])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n    scanf(\"%d\", &a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int a, b;\n  int sz[100][100];\n  int sum[100];\n\n  for (row = 0; row < 100; row++) {\n    sum[row] = 0;\n  }\n\n  for (row = 0; row < 100; row++) {\n    for (col = 0; col < 100; col++) {\n      cin >> sz[row][col];\n      if (sz[row][col] == 0) {\n        break;\n      }\n      if (sz[row][0] == -1) {\n        break;\n      }\n    }\n    if (sz[row][0] == -1) {\n      break;\n    }\n    a = row;\n  }\n\n  for (row = 0; row <= a; row++) {\n    for (b = 0; b < 100; b++) {\n      for (col = 0; col < 100; col++) {\n        if (sz[row][b] == 2 * sz[row][col] && sz[row][b] != 0 &&\n            sz[row][col] != 0) {\n          sum[row]++;\n        }\n      }\n    }\n  }\n\n  for (row = 0; row <= a; row++) {\n    cout << sum[row] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22258", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[50][15], n[50], line, sum, i, k, j;\n  for (i = 0;; i++) {\n    for (k = 0;; k++) {\n      scanf(\"%d\", &p[i][k]);\n      if (p[i][k] == 0 || p[i][k] == -1) {\n        n[i] = k;\n        break;\n      }\n    }\n    if (p[i][k] == -1) {\n      line = i;\n      break;\n    }\n  }\n  for (i = 0; i < line; i++) {\n    sum = 0;\n    for (k = 0; k < n[i]; k++) {\n      for (j = k + 1; j < n[i]; j++) {\n        if (p[i][k] == p[i][j] * 2 || p[i][j] == p[i][k] * 2)\n          sum = sum + 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, h, k, m;\n  int a[20];\n  for (k = 0;; k++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1) {\n        break;\n      }\n      m = 0;\n      if (a[i] == 0) {\n        for (j = 0; j < i - 1; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[k] == a[j] * 2 || a[j] == a[k] * 2) {\n              m++;\n            }\n          }\n        }\n        cout << m << \"\\n\";\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22260", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int i, j, m, n;\n  int num[100], result[100], temp;\n\n  i = 0;\n  j = 0;\n  while (1) {\n    cin >> num[i];\n    if (num[i] == -1) {\n      break;\n    }\n\n    while (1) {\n      if (num[i] == 0) {\n        temp = 0;\n        for (m = 0; m < i; m++) {\n          for (n = 0; n < i; n++) {\n            if (num[m] == 2 * num[n]) {\n              temp++;\n            }\n          }\n        }\n        result[j] = temp;\n\n        i = 0;\n        j++;\n        break;\n      } else {\n        i++;\n        cin >> num[i];\n      }\n    }\n  }\n\n  for (m = 0; m < j; m++) {\n    printf(\"%d\\n\", result[m]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, h;\n  while (scanf(\"%d \", &a[0])) {\n    while (a[0] != -1) {\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d \", &a[i]);\n        if (a[i] == 0)\n          break;\n        h = i;\n      }\n\n      num = 0;\n      for (i = 0; i <= h; i++)\n        for (j = 0; j <= h; j++)\n          if (a[i] == 2 * a[j])\n            num++;\n      cout << num << endl;\n      break;\n    }\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint mat[300];\n\nint main() {\n  int n, sum = 0;\n  while (scanf(\"%d\", &n), n != -1) {\n    if (n) {\n      mat[n] = 1;\n      if (mat[n << 1])\n        sum++;\n      if (!(n & 1) && mat[n >> 1])\n        sum++;\n    } else {\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      memset(mat, 0, sizeof(mat));\n    }\n  }\n}\n"}
{"label": "12", "index": "22263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, time = 0, sz[16], tmp, xh, m = 0, mp;\n  for (xh = 0; xh < 50; xh++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0) {\n        for (mp = 0; mp < i; mp++) {\n          for (j = 0; j < i - 1; j++) {\n            if (sz[j] >= sz[j + 1]) {\n              tmp = sz[j];\n              sz[j] = sz[j + 1];\n              sz[j + 1] = tmp;\n            }\n          }\n        }\n        for (k = 0; k < i; k++) {\n          for (j = k; j < i; j++) {\n            if (sz[j] == 2 * sz[k]) {\n              time++;\n            }\n          }\n        }\n        printf(\"%d\\n\", time);\n        i = -1;\n        j = 0;\n        k = 0;\n        time = 0;\n        mp = 0;\n      }\n      if (sz[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n}\n"}
{"label": "12", "index": "22264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int num[15], j, k, i, a = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] != -1) {\n      i = 1;\n      do {\n        scanf(\"%d\", &num[i]);\n        i++;\n      } while (num[i - 1] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (num[k] == num[j] * 2 || num[j] == num[k] * 2)\n            a++;\n        }\n      }\n      printf(\"%d\\n\", a);\n      a = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, num[15], out;\n  while (1) {\n    n = -1;\n    out = 0;\n    scanf(\"%d\", &i);\n    if (i == -1)\n      break;\n    num[++n] = i;\n    while (1) {\n      scanf(\"%d\", &i);\n      if (i == 0)\n        break;\n      num[++n] = i;\n    }\n    for (i = 0; i <= n - 1; i++)\n      for (j = i + 1; j <= n; j++) {\n        if (num[j] == 2 * num[i] || num[i] == 2 * num[j])\n          out++;\n      }\n    printf(\"%d\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22266", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], sum = 0, i, j, n = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      } else if (a[i] == -1) {\n        break;\n      } else {\n        n++;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] == a[j] * 2) {\n          sum++;\n        }\n      }\n    }\n    cout << sum << endl;\n    n = 0;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  static int a[16], b[16];\n  int n, i, j, s = 0;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      b[i - 1] = 2 * a[i - 1];\n      scanf(\"%d\", &a[i]);\n    }\n    n = i - 2;\n    s = 0;\n    for (i = 0; i <= n; i++)\n      for (j = 0; j <= n; j++)\n        if (a[i] == b[j]) {\n          s++;\n          break;\n        }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][16], m, n;\n  int i, j, k;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &m);\n      if (m != 0) {\n        sz[i][j] = m;\n      } else {\n        break;\n      }\n    }\n    if (sz[i][0] == -1) {\n      break;\n    }\n  }\n  n = 0;\n  for (i = 0; i < 100; i++) {\n    if (sz[i][0] == -1) {\n      break;\n    }\n    for (j = 0; j < 15; j++) {\n      for (k = 0; k < 15; k++) {\n        if (sz[i][j] != 0 && sz[i][k] != 0) {\n          if (sz[i][j] == 2 * sz[i][k]) {\n            n = n + 1;\n          }\n        }\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22269", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, x = 0, y = 1, a = 0;\n  float n[20];\n  do {\n    i = 0;\n    j = 0;\n    k = 0;\n    x = 0;\n    y = 1;\n    do {\n      scanf(\"%f \", &n[j]);\n      if (n[j] == 0 || n[j] == -1)\n        break;\n      j++;\n    } while (j < 20);\n    if (n[j] == -1)\n      return 0;\n    do {\n      do {\n        if (n[x] == n[y] * 2 || n[x] == n[y] / 2)\n          i++;\n        y++;\n      } while (y < j);\n      x++;\n      y = x + 1;\n    } while (x < j);\n    printf(\"%d\\n\", i);\n  } while (a < 1);\n  return 0;\n}\n"}
{"label": "12", "index": "22270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17];\n  int i, j, n, nn, count;\n  nn = 0;\n  while (cin >> a[1] && a[1] != -1) {\n    nn++;\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], j, k, sum;\n  while (true) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] != -1) {\n      int i;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      sum = 0;\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == a[j] * 2)\n            sum = sum + 1;\n      }\n      cout << sum << \"\\n\";\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[20], sum = 0; \n  while (1) {\n    cin >> a[0]; \n    if (a[0] == -1)\n      break;                        \n    for (i = 1; a[i - 1] != 0; i++) \n    {\n      cin >> a[i];\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j]) \n          sum++;\n      }\n    }\n    cout << sum << endl; \n    sum = 0;             \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22273", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a, t, i;\n  while (1) {\n    a = 0;\n    t = 0;\n    cin >> a;\n    if (a == -1) {\n      break;\n    }\n    int num[17] = {0};\n    num[1] = a;\n    for (i = 2; i <= 16; i++) {\n      cin >> num[i];\n      if (num[i] == 0) {\n        break;\n      }\n    }\n    for (int r = 1; r <= (i - 1); r++) {\n      for (int s = 1; s <= (i - 1); s++) {\n        if (num[r] == 2 * num[s]) {\n          t = t + 1;\n        }\n      }\n    }\n    cout << t << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, m;\n  for (;;) {\n    m = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (k = 0; k < i; k++) {\n          if ((a[j] / 2) == a[k])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22275", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16] = {0}; \n  int sum = 0;     \n\n  do {\n    sum = 0;\n\n    cin >> a[0];\n\n    if (a[0] == -1)\n      break; \n\n    for (int i = 1; i <= 15; ++i) \n    {\n      cin >> a[i];\n      if (a[i] == 0)\n        break; \n    }\n\n    for (int m = 0; m <= 13; ++m) \n    {\n      if (a[m + 1] == 0)\n        break;\n      for (int n = m + 1; n <= 14; ++n) {\n        if (a[n] == 0)\n          break;\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          ++sum;\n      }\n    }\n\n    cout << sum << endl; \n\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuzu[16];\n  int i, t, k, num = 0;\n\n  for (i = 0;; i++) {\n    scanf(\"%d\", &shuzu[i]);\n    if (shuzu[i] == -1) {\n      break;\n    }\n    if (shuzu[i] == 0) {\n\n      for (t = 0; t < i; t++) {\n        for (k = t + 1; k < i; k++) {\n          if (shuzu[t] == shuzu[k] * 2 || shuzu[t] * 2 == shuzu[k]) {\n            num++;\n          }\n        }\n      }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, s, t;\n  int d[100];\n  int q, p;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (j == 0)\n      break;\n    s = 0;\n    for (k = 0; k < j - 1; k++) {\n      for (t = k + 1; t < j; t++) {\n        p = a[i][t] - a[i][k] * 2;\n        q = a[i][k] - a[i][t] * 2;\n        if (p == 0 || q == 0)\n          s++;\n      }\n    }\n    d[i] = s;\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d \", d[k]);\n  return 0;\n}\n"}
{"label": "12", "index": "22278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, h, g, n, sign;\n  for (i = 1;; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    if (a[j] == 0) {\n      for (k = j - 1; k >= 1; k--) {\n        if (a[k] == 0) {\n          break;\n        }\n      }\n      sign = 0;\n      for (h = k + 1; h < j; h++) {\n        for (g = k + 1; g < j; g++) {\n          if (a[h] == 2 * a[g])\n            sign++;\n        }\n      }\n      cout << sign << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, m = 0, c[100][100], f[100] = {0};\n  for (j = 1;; j++) {\n    scanf(\"%d\", &c[j][1]);\n    if (c[j][1] == -1)\n      break;\n    for (i = 2;; i++) {\n      scanf(\"%d\", &c[j][i]);\n      if (c[j][i] == 0)\n        break;\n      for (l = i; l >= 1; l--)\n        if (c[j][l] == 2 * c[j][i] || c[j][i] == 2 * c[j][l])\n          f[j]++;\n    }\n    m++;\n  }\n  for (j = 1; j <= m; j++)\n    printf(\"%d\\n\", f[j]);\n}\n"}
{"label": "12", "index": "22280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, a[15], x = 0, i, y = 0;\n  while (y != 1) {\n    for (m = 0;; m++) {\n      scanf(\"%d \", &n);\n      if (n != 0 && n != -1) {\n        a[m] = n;\n        continue;\n      }\n      if (n == 0) {\n        break;\n      }\n      if (n == -1) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n    for (m = 0; m <= 15; m++) {\n      for (i = 0; i <= 15; i++) {\n        if (a[m] * 2 == a[i] && a[m] != 0) {\n          x = x + 1;\n        }\n      }\n    }\n    for (m = 0; m <= 15; m++)\n      a[m] = 0;\n\n    cout << x << endl;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22281", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[15], a, i, x, k, t;\n  cin >> a;\n  while (a != -1) {\n    i = 0;\n    x = 0;\n    while (a != 0) {\n      num[i] = a;\n      i = i + 1;\n      cin >> a;\n    }\n    for (k = 0; k <= i - 1; k++) {\n      for (t = 0; t <= i - 1; t++) {\n        if (num[k] == num[t] * 2) {\n          x = x + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", x);\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint chuli(int *p, int i) {\n\n  int count = 0;\n\n  for (int q = 0; q < i; q++) {\n    if (2 * (p[q]) > p[i - 1])\n      return count;\n\n    for (int j = q; j < i; j++) {\n\n      if (p[j] == 2 * (p[q])) {\n        count++;\n        break;\n      }\n      if (p[j] > 2 * (p[q])) {\n        break;\n      }\n    }\n  }\n\n  return count;\n}\nint main() {\n\n  int a[20];\n  int num;\n  while (cin >> a[0] && (a[0] != -1)) {\n    int i = 1;\n    while (cin >> a[i] && a[i])\n      i++;\n\n    qsort(a, i, sizeof(int), cmp);\n\n    num = chuli(a, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i = 0, m = 0, k = 0, j = 0;\n  do {\n    cin >> a[0];\n    while (a[i] != 0 && a[0] != -1) {\n      i = i + 1;\n      scanf(\"%d\", &a[i]);\n    }\n    if (a[0] != -1) {\n      for (j = 0; j < i; j++) {\n        for (k = i - 1; k > j; k--) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            m = m + 1;\n        }\n      }\n      cout << m << \"\\n\";\n    }\n    for (j = 0; j < i; j++)\n      a[j] = 0;\n    m = 0;\n    i = 0;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[15];\n  int i, NO, tmp, n, j;\n  while (1) {\n    n = 0;\n    scanf(\"%d\", &tmp);\n    a[0] = tmp;\n    if (tmp == -1)\n      break;\n\n    NO = 0;\n\n    while (1) {\n      scanf(\"%d\", &tmp);\n      if (tmp == 0)\n        break;\n      a[++n] = tmp;\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          NO++;\n\n    cout << NO << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "12", "index": "22285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, num;\n  double a[16];\n  do {\n    for (i = 0; i <= 15; i++)\n\n      a[i] = 0;\n\n    num = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[0] == -1) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k] || a[j] == a[k] / 2.0) {\n          num = num + 1;\n        }\n      }\n    }\n    cout << num << \"\\n\";\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, time = 0, sz[16], tmp, xh, m = 0, mp;\n  for (xh = 0; xh < 50; xh++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &sz[i]);\n      if (sz[i] == 0) {\n        for (mp = 0; mp < i; mp++) {\n          for (j = 0; j < i - 1; j++) {\n            if (sz[j] >= sz[j + 1]) {\n              tmp = sz[j];\n              sz[j] = sz[j + 1];\n              sz[j + 1] = tmp;\n            }\n          }\n        }\n        for (k = 0; k < i; k++) {\n          for (j = k; j < i; j++) {\n            if (sz[j] == 2 * sz[k]) {\n              time++;\n            }\n          }\n        }\n        cout << time << \"\\n\";\n        i = -1;\n        j = 0;\n        k = 0;\n        time = 0;\n        mp = 0;\n      }\n      if (sz[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n}\n"}
{"label": "12", "index": "22287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int i, j, n, count;\n  while (cin >> a[1] && a[1] != -1) {\n    count = 0;\n    for (n = 2; n <= 16; n++) {\n      cin >> a[n];\n      if (a[n] == 0)\n        break;\n    }\n    for (i = 1; i <= n - 1; i++) {\n      if (a[i] % 2 == 0)\n        for (j = 1; j <= n - 1; j++)\n          if (a[j] * 2 == a[i])\n            count++;\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, num[15], out;\n  while (1) {\n    n = -1;\n    out = 0;\n    scanf(\"%d\", &i);\n    if (i == -1)\n      break;\n    num[++n] = i;\n    while (1) {\n      scanf(\"%d\", &i);\n      if (i == 0)\n        break;\n      num[++n] = i;\n    }\n    for (i = 0; i <= n - 1; i++)\n      for (j = i + 1; j <= n; j++) {\n        if (num[j] == 2 * num[i] || num[i] == 2 * num[j])\n          out++;\n      }\n    printf(\"%d\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[150] = {0}, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    if (a[0] != -1)\n      cout << num << endl;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num[100][150], i, j, g, h[100], k, m;\n  for (j = 0;; j++) {\n    for (i = 0;; i++) {\n      scanf(\"%d\", &num[j][i]);\n      if (num[j][0] == -1)\n        break;\n      if (num[j][i] == 0)\n        break;\n    }\n    if (num[j][0] == -1)\n      break;\n    h[j] = i;\n  }\n  g = j;\n  int count[100] = {0};\n  for (j = 0; j < g; j++) {\n    for (i = 0; i < h[j]; i++) {\n      k = i;\n      for (m = k; m < h[j]; m++) {\n        if (((num[j][m] % num[j][k] == 0) && (num[j][m] / num[j][k] == 2)) ||\n            ((num[j][k] / num[j][m] == 2) && (num[j][k] % num[j][m] == 0)))\n          count[j]++;\n      }\n    }\n\n    cout << count[j] << \"\\n\";\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "22291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], m, n, i, j, k, p;\n  i = 0;\n  while (scanf(\"%d\", &m) != EOF) {\n    if (m == -1)\n      break;\n    else if (m == 0) {\n      for (j = 0, n = 0; j <= i - 2; j++)\n        for (p = j; p <= i - 1; p++)\n          if (a[j] == a[p] * 2 || a[p] == a[j] * 2)\n            n++;\n      printf(\"%d\\n\", n);\n      i = 0;\n    } else {\n      a[i] = m;\n      i++;\n    }\n  }\n}\n"}
{"label": "12", "index": "22292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], n, m, i = 1, t = 0;\n\n  cin >> a[1];\n\n  while (a[i] != -1) {\n    while (a[i] > 0) {\n      i = i + 1;\n      cin >> a[i];\n    }\n\n    for (m = 1; m < i; m++)\n      for (n = m + 1; n <= i; n++)\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          t = t + 1;\n\n    printf(\"%d\\n\", t);\n\n    for (i = 0; i < 17; i++) {\n      a[i] = 0;\n    }\n\n    t = 0;\n    i = 1;\n\n    cin >> a[1];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, k, l;\n\n  for (l = 1; l < 3000; l++) {\n    s = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (k = 1; k <= 16; k++) {\n      scanf(\"%d\", &a[k]);\n      if (a[k] == 0) {\n        break;\n      }\n    }\n    for (i = 0; i < k - 1; i++) {\n      for (j = i + 1; j < k; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22294", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, num;\n  double a[16];\n  do {\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    num = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%lf \", &a[i]);\n      if (a[i] == 0 || a[0] == -1) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k] || a[j] == a[k] / 2.0) {\n          num = num + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, m = 1, num = 0;\n  while (scanf(\"%d \", &a[0])) {\n    num = 0;\n    m = 1;\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++, m++) {\n        scanf(\"%d \", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (k == j)\n            continue;\n          if ((a[k] == 2 * a[j]) || (a[j] == 2 * a[k]))\n            num++;\n        }\n      }\n\n      cout << num / 2 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[500];\n  int n, ans;\n  for (; scanf(\"%d\", &a[0]), a[0] != -1;) {\n    for (n = 1; scanf(\"%d\", &a[n]), a[n] != 0; n++)\n      ;\n    ans = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        if (a[i] == a[j] * 2)\n          ans++;\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20][16], s[20] = {0}, i, j, k, p = 0, n[20] = {0};\n  for (i = 0; i < 20; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    p = p + 1;\n    for (j = 1; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n      s[i] = s[i] + 1;\n    }\n  }\n  for (i = 0; i < p; i++)\n    for (j = 0; j <= s[i]; j++)\n      for (k = 0; k <= s[i]; k++)\n        if (a[i][j] == 2 * a[i][k])\n          n[i] = n[i] + 1;\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", n[i]);\n}\n"}
{"label": "12", "index": "22298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int output = 0, i, j, length;\n  float data[16];\n\n  data[0] = -2;\n\n  while (data[0] != -1) {\n    for (i = 0; i <= 15; i++) {\n      cin >> data[i];\n      if (data[i] == 0) {\n        length = i;\n        break;\n      }\n      if (data[i] == -1)\n        break;\n    }\n\n    if (data[i] == -1)\n      break;\n\n    for (i = 0; i <= length - 1; i++)\n      for (j = 0; j <= length - 1; j++) {\n        if ((data[j] / data[i]) == 2)\n          output = output + 1;\n      }\n\n    printf(\"%d\\n\", output);\n    output = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][20];\n  int i, j, k, n = 0;\n  int x[1000];\n  for (i = 0; i < 1000; i++) {\n    x[i] = 0;\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        n++;\n        break;\n      }\n      if (a[i][j] == -1)\n        break;\n    }\n    if (a[i][0] == -1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          x[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number[16] = {0};\n  int m, i = 1;\n  while (m != -1) {\n    do {\n      cin >> m;\n      number[i] = m;\n      i++;\n    } while (m != 0 && m != -1);\n    int k = 1, t, j = 0;\n    for (k = 1; k <= i - 1; k++) {\n      t = number[k];\n      int p;\n      for (p = 1; p <= i - 1; p++) {\n        if (t == 2 * number[p]) {\n          j++;\n        } else\n          continue;\n      }\n    }\n    if (m != -1) {\n      cout << j - 1 << endl;\n    } else\n      break;\n    i = 1;\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22301", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  while (a != -1) {\n    int s[15] = {0};\n    int l = 1, m = 0;\n    s[0] = a;\n    do {\n      cin >> a;\n      s[l] = a;\n      l++;\n    } while (a != 0);\n    for (int i = 0; i < 15; i++)\n      for (int j = 0; j < 15; j++)\n        if (s[j] == 2 * s[i] && s[i] != 0)\n          m++;\n    cout << m << endl;\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[15], i, m = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &c[i]);\n    if (c[i] == 0) {\n      break;\n    }\n  }\n\n  int k, j, n = 0;\n  for (k = 0; c[k] != 0; k++) {\n    for (j = 0; c[j] != 0; j++) {\n\n      if (c[k] == 2 * c[j]) {\n        n++;\n      }\n    }\n  }\n  printf(\"%d\", n);\n}\n"}
{"label": "12", "index": "22303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, k;\n  static int a[16];\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (k = 1; k <= 15; k++) {\n      scanf(\" %d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    n = 0;\n    for (k = 0; a[k] != 0; k++)\n      for (m = 0; a[m] != 0; m++)\n        if (a[m] == 2 * a[k]) {\n          n++;\n          break;\n        }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint find(int *x, int y, int z) {\n  int count = 0;\n  for (int i = 0; i < y; i++) {\n    if (x[i] == z)\n      count++;\n  }\n  return count;\n}\n\nint count(int *x, int y) {\n  int count1 = 0;\n  for (int i = 0; i < y; i++) {\n    count1 += find(x, y, 2 * x[i]);\n  }\n  return count1;\n}\n\nint main() {\n  int temp[16];\n  int len = 0;\n  cin >> temp[len];\n  while (temp[len] != -1) {\n    while (temp[len] != 0) {\n      len++;\n      scanf(\"%d\", &temp[len]);\n    }\n    cout << count(temp, len) << \"\\n\";\n    scanf(\"%d\", &temp[0]);\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  float p[100][999];\n  int i, m;\n  for (m = 0;; m++) {\n    for (i = 0;; i++) {\n      scanf(\"%f\", &p[m][i]);\n      if (p[m][i] == 0)\n        break;\n    }\n    if (p[m][0] == -1)\n      break;\n    else {\n      int a = 0;\n      for (int j = 0; j < i; j++) {\n        for (int k = 0; k < i; k++) {\n          if (p[m][j] / p[m][k] == 2)\n            a++;\n          else\n            a = a;\n        }\n      }\n      cout << a << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, r, n;\n  while (scanf(\"%d \", &a[0])) {\n    n = 0;\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++)\n      cin >> a[i];\n    for (j = 0; j <= i - 2; j++)\n      for (r = 0; r <= i - 2; r++)\n        if (2 * a[j] == a[r])\n          n++;\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, num[16] = {0}, count = 0, key = 0;\n  cin >> num[0];\n  while (num[0] != -1) {\n    for (i = 0; num[i] != 0; i++) {\n      cin >> num[i + 1];\n    }\n    count = i;\n    key = 0;\n    for (i = 0; i < count; i++)\n      for (j = i; j < count; j++)\n        if (num[i] == 2 * num[j] || num[j] == 2 * num[i])\n          key++;\n    cout << key << endl;\n    for (i = 0; i < 16; i++)\n      num[i] = 0;\n    cin >> num[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20][16], s[20] = {0}, i, j, k, p = 0, n[20] = {0};\n  for (i = 0; i < 20; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    p = p + 1;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      s[i] = s[i] + 1;\n    }\n  }\n  for (i = 0; i < p; i++)\n    for (j = 0; j <= s[i]; j++)\n      for (k = 0; k <= s[i]; k++)\n        if (a[i][j] == 2 * a[i][k])\n          n[i] = n[i] + 1;\n  for (i = 0; i < p; i++)\n    printf(\"%d\\n\", n[i]);\n}\n"}
{"label": "12", "index": "22309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w;\n  for (w = 1;; w++) {\n    int a[16], b = 0;\n    int i, j, q;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      b++;\n    }\n    if (a[1] == -1)\n      break;\n    int m = 0;\n    for (j = 1; j < b; j++) {\n      for (q = j + 1; q <= b; q++) {\n        if (a[j] == 2 * a[q])\n          m++;\n        else if (a[q] == 2 * a[j])\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[17], n, count = 1, result = 0;\n  while ((scanf(\"%d \", &n)) && (n != -1)) {\n    if (n) {\n      num[count] = n;\n      count++;\n    } else {\n      for (int i = 1; i < count; i++) {\n        for (int j = 1; j < count; j++) {\n          if (num[i] == 2 * num[j])\n            result++;\n        }\n      }\n      cout << result << endl;\n      result = 0;\n      count = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i = 1, count = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = i - 2;\n  while (a[0] != -1) {\n    count = 0;\n    int j, k = 0;\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    i = 1;\n    while (a[i - 1] != 0) {\n      scanf(\"%d\", &a[i]);\n      i++;\n    }\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22312", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a;\n  while (scanf(\"%d \", &a)) {\n    if (a != -1) {\n      int i = 0, j, k, p = 0;\n      int b[15] = {a};\n      while (b[i] != 0) {\n        cin >> b[i + 1];\n        i++;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (b[k] == 2 * b[j] || b[j] == 2 * b[k]) {\n            p = p + 1;\n          }\n      }\n      cout << p << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 1; k < pause; k++) {\n      for (i = 0; i < pause - k; i++) {\n        if (A[i] <= A[i + 1]) {\n          m = A[i];\n          A[i] = A[i + 1];\n          A[i + 1] = m;\n        }\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = k + 1; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int w;\n  for (w = 1;; w++) {\n    int a[16], b = 0;\n    int i, j, q;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[1] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n      b++;\n    }\n    if (a[1] == -1)\n      break;\n    int m = 0;\n    for (j = 1; j < b; j++) {\n      for (q = j + 1; q <= b; q++) {\n        if (a[j] == 2 * a[q])\n          m++;\n        else if (a[q] == 2 * a[j])\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b[100][15], c, i, m, x, y, n, e;\n  c = 0;\n  i = 0;\n  for (m = 0; m < 16; m++) {\n    cin >> a;\n    if (a != 0)\n      b[i][m] = a;\n\n    if (a == 0) {\n      for (x = 0; x < m; x++) {\n        for (y = 0; y < m; y++) {\n          n = b[i][x] / b[i][y];\n          e = b[i][x] % b[i][y];\n          if (n == 2 && e == 0) {\n            c++;\n          }\n        }\n      }\n      cout << c << \"\\n\";\n      c = 0;\n      m = -1;\n      i++;\n    }\n    if (a == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k;\n  for (i = 1; i <= 16; i++) {\n    a[i] = 1;\n  }\n  int count = 0;\n  while (cin >> a[1]) {\n    if (a[1] == -1) {\n      break;\n    } else {\n      for (i = 2; a[i - 1] != 0; i++)\n        cin >> a[i];\n    }\n    i = i - 2;\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22317", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, m, p, q;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][j] <= 0)\n        break;\n    }\n    m = 0;\n    for (p = 0; p < j; p++) {\n      for (q = 0; q < j; q++) {\n        if (a[i][q] == 2 * a[i][p])\n          m++;\n      }\n    }\n    if (a[i][j] == -1)\n      break;\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22318", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, t = -1, s = 0;\n  int a[10000];\n  for (i = 0; i <= 10000; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      t = i;\n      printf(\"%d\\n\", s);\n      s = 0;\n    } else {\n      for (j = t + 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          s = s + 1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][17], i, j, k, s, r;\n  for (j = 0; j < 100; j++) {\n    r = 0;\n    cin >> a[j][1];\n    if (a[j][1] == -1)\n      break;\n    else {\n      for (i = 2, s = 1; a[j][i - 1] != 0; i++, s++)\n        cin >> a[j][i];\n      for (i = 1; i < s; i++) {\n        for (k = i + 1; k <= s; k++) {\n          if (a[j][k] == 2 * a[j][i] || a[j][i] == 2 * a[j][k])\n            r++;\n        }\n      }\n      cout << r << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22320", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17], i, j, k, n;\n  cin >> a[1];\n  while (a[1] != -1) {\n    n = 0;\n    i = 1;\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[j] == a[k] * 2) {\n          n++;\n        }\n      }\n    }\n    n = n - 1;\n    cout << n << endl;\n    cin >> a[1];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[50][16], b[50], c[50], i, j, m, n, o, line, num = 0;\n  for (i = 0; i <= 49; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        b[i] = j - 1;\n        c[i] = 0;\n        break;\n      }\n    }\n    if (a[i][0] == -1)\n      break;\n    line = i;\n  }\n  for (m = 0; m <= line; m++) {\n    for (n = 0; n <= b[m]; n++) {\n      for (o = 0; o <= b[m]; o++) {\n        if (a[m][n] == 2 * a[m][o])\n          c[m] = c[m] + 1;\n      }\n    }\n    cout << c[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, num;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n    }\n    num = 0;\n    for (i = 0; a[i]; i++)\n      for (j = 0; a[j]; j++)\n        if (a[i] == 2 * (a[j]))\n          num++;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[16], i, t, m, j, k, sum;\n  while (scanf(\"%d \", &t)) {\n    if (t != -1) {\n      a[1] = t;\n      i = 1;\n      while (cin >> m) {\n        if (m != 0) {\n          i = i + 1;\n          a[i] = m;\n        } else\n          break;\n      }\n      sum = 0;\n      for (j = 1; j <= i; j++)\n        for (k = 1; k <= i; k++) {\n          if (a[k] == 2 * a[j] || a[k] == 0.5 * a[j])\n            sum = sum + 1;\n        }\n      cout << sum / 2 << endl;\n    } else {\n      cout << endl;\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], i, j, k;\n  for (i = 1; i <= 16; i++) {\n    a[i] = 1;\n  }\n  int count = 0;\n  while (cin >> a[1]) {\n    if (a[1] == -1) {\n      break;\n    } else {\n      for (i = 2; a[i - 1] != 0; i++) {\n        cin >> a[i];\n      }\n    }\n    i = i - 2;\n    for (j = 1; j <= i; j++) {\n      for (k = 1; k <= i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count++;\n          break;\n        }\n      }\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22325", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l, k, s, t;\n  int a[100000] = {0}, b[100000]; \n  for (i = 0; i < 100000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n  }\n  s = 0; \n  for (i = 0; i < 100000; i++) {\n    t = 0; \n    for (j = 0; j < 10000; j++) {\n      b[j] = a[s];\n      s++;\n      if (b[j] == 0) {\n        for (k = 0; k <= j; k++)\n          for (l = k + 1; l <= j; l++)\n            if ((b[k] == 2 * b[l]) || (b[l] == 2 * b[k]))\n              t++;\n        cout << t << endl;\n        break;\n      }\n    }\n    if (a[s] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22326", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, i, j, k, ds, s; \n  int a[16];\n  while (cin) {\n    ds = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      return 0; \n    s = 1;      \n    while (cin) {\n      cin >> a[s];\n      if (a[s] == 0)\n        break; \n      else\n        s = s + 1; \n    }\n    for (i = 0; i <= s; i++) \n    {\n      for (j = i + 1; j <= s; j++) \n      {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2)) \n          ds = ds + 1;                                \n      }\n    }\n    cout << ds << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, k;\n  int count;\n  do {\n    i = 0;\n    count = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      for (k = 0; i > 0 && k < i; k++) {\n        if (a[i] / 2.0 == a[k] || a[i] * 2 == a[k]) {\n          count = count + 1;\n        }\n      }\n      i = i + 1;\n    } while (a[i - 1] != 0 && a[0] != -1);\n    if (a[0] != -1)\n      printf(\"%d\\n\", count);\n  } while (a[0] != -1);\n}\n"}
{"label": "12", "index": "22328", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, d, total;\n  total = 0;\n  int shuzu[16];\n  for (i = 0; i < 16; i++) {\n    cin >> n;\n    if (n != -1) {\n      shuzu[i] = n;\n      if (n == 0) {\n        for (d = 0; d < i; d++) {\n          for (k = 0; k < i; k++) {\n            if (shuzu[d] == 2 * shuzu[k]) {\n              total++;\n            }\n          }\n        }\n        printf(\"%d\\n\", total);\n        i = -1;\n        total = 0;\n      }\n    } else {\n      break;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22329", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, c, m, a[17];\n  while (1) {\n\n    for (i = 1; i <= 16; i++) {\n      a[i] = 0;\n      m = 0;\n    }\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1)\n        return 0;\n      if (a[i] == 0) {\n        c = i;\n        break;\n      }\n    }\n    for (i = 1; i < c; i++)\n\n      for (j = i; j < c; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          m++;\n      }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int i = 0, a[16];\n    scanf(\"%d\", &a[i]);\n    if (a[i] == -1) {\n      break;\n    }\n\n    int b[105] = {0};\n    b[a[i]] = 1;\n\n    while (1) {\n      i++;\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n      b[a[i]] = 1;\n    }\n\n    int j;\n    int total = 0;\n    for (j = 1; j < 50; j++) {\n      if (b[j] == 1 && b[j * 2] == 1) {\n        total++;\n      }\n    }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, n, i = 1;\n  for (; a[i] != -1;) {\n    n = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      for (int j = 0; j < i; j++) {\n        if (a[j] * 2 == a[i] || a[j] == a[i] * 2) {\n          n++;\n        }\n      }\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n    }\n    if (a[i] != -1) {\n      printf(\"%d\\n\", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "22332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, i, j, a[16], k;\n  for (i = 1;; i++) {\n    k = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[i] == 2 * a[j])\n          k++;\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][20], i = 0, j = 0, k = 0, num[100];\n\n  do {\n    j = 0;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][0] != -1);\n\n  i = 0;\n  while (a[i][0] != -1) {\n    num[i] = 0;\n    k = 0;\n    while ((a[i][k] != 0) && (a[i][k] != -1)) {\n      j = 0;\n      while ((a[i][j] != 0) && (a[i][j] != -1)) {\n        if (a[i][k] == 2 * a[i][j]) {\n          num[i]++;\n        }\n        j++;\n      }\n      k++;\n    }\n    i++;\n  }\n\n  i = 0;\n  while (a[i][0] != -1) {\n    printf(\"%d\\n\", num[i]);\n    i++;\n  }\n\n  return 1;\n}\n"}
{"label": "12", "index": "22334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[10000], i, b, j, sum = 0;\n  do {\n    sum = 0;\n    scanf(\"%d\", &b);\n    if (b == -1)\n      break;\n    else\n      a[0] = b;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (i = 0; a[i] != 0; i++)\n      for (j = 0; a[j] != 0; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    cout << sum << \"\\n\";\n  } while (b != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], k, i, j;\n  for (k = 0;; k++) {\n    int n = -1, num = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          num++;\n        }\n      }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22336", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int num[16], i, k, j, count;\n  for (;;) \n  {\n    i = -1; \n    count = 0;\n    do {\n      i++;\n      cin >> num[i];    \n      if (num[0] == -1) \n        return 0;\n    } while (num[i] != 0); \n    for (j = 0; j <= i - 1; j++) {\n      for (k = j; k <= i - 1; k++) {\n        if ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k])) \n          count++;                                            \n      }\n    }\n    cout << count << endl; \n  }\n}\n"}
{"label": "12", "index": "22337", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a[16] = {0}, count;\n  do {\n    count = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (j = 0; j < i; j++)\n      for (k = 0; k < j; k++)\n        if (a[k] == 2 * a[j] || 2 * a[k] == a[j]) {\n          count++;\n        }\n    cout << count << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k;\n  int nowi;\n  int output;\n  int part[20][16];\n  static int jcount[20], group[20];\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &part[i][j]);\n      jcount[i]++;\n      if (part[i][j] <= 0)\n        break;\n    }\n    if (part[i][j] == -1) {\n      break;\n    }\n  }\n  nowi = i;\n  for (i = 0; i < nowi; i++) {\n    for (j = 0; j < jcount[i] - 1; j++) {\n      for (k = 0; k < jcount[i] - 1; k++) {\n        if ((part[i][j] / part[i][k] == 2) && (part[i][j] % part[i][k] == 0))\n          group[i]++;\n      }\n    }\n  }\n\n  for (output = 0; output < nowi; output++) {\n    cout << group[output] << endl;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "12", "index": "22339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100];\n  int i = 1, count = 0;\n  cin >> a[0];\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = i - 2;\n  while (a[0] != -1) {\n    count = 0;\n    int j, k = 0;\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    }\n    i = 1;\n    while (a[i - 1] != 0) {\n      scanf(\"%d\", &a[i]);\n      i++;\n    }\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22340", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], b[20];\n  int i, j, k;\n  int n;\n  i = 1;\n  n = 0;\n\n  while (1) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      for (j = 1; j <= i - 1; j++)\n        b[j] = a[j] * 2;\n\n      for (j = 1; j <= i - 1; j++)\n        for (k = 1; k <= i - 1; k++) {\n          if (b[j] == a[k]) {\n            n++;\n          }\n        }\n\n      printf(\"%d\\n\", n);\n      i = 1;\n      n = 0;\n    } else\n      i++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }\nint chuli(int *p, int i) {\n\n  int count = 0;\n\n  for (int q = 0; q < i; q++) {\n    if (2 * (p[q]) > p[i - 1])\n      return count;\n\n    for (int j = q; j < i; j++) {\n\n      if (p[j] == 2 * (p[q])) {\n        count++;\n        break;\n      }\n      if (p[j] > 2 * (p[q]))\n        break;\n    }\n  }\n\n  return count;\n}\nint main() {\n\n  int a[20];\n  int num;\n  while (cin >> a[0] && (a[0] != -1)) {\n    int i = 1;\n    while (cin >> a[i] && a[i])\n      i++;\n\n    qsort(a, i, sizeof(int), cmp);\n\n    num = chuli(a, i);\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22342", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n[100][100], i, k, j, s[100], num[100], t, p, m;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0) {\n          num[i] = j;\n          break;\n        }\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t < j; t++) {\n      for (m = t; m < num[k]; m++) {\n        if ((2 * n[k][t] == n[k][m]) || (2 * n[k][m] == n[k][t]))\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    printf(\"%d\\n\", s[p]);\n  return 0;\n}\n"}
{"label": "12", "index": "22343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][16], b[1000] = {0, 0};\n  int i, j, k, h, m;\n  int count1, count2;\n  count2 = -1;\n  for (i = 0; i < 1000; i++) {\n    count1 = -1;\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if ((a[i][j] == 0) || (a[i][j] == -1))\n        break;\n      count1++;\n    }\n    if (a[i][j] == -1)\n      break;\n    for (k = 0; k <= count1; k++) {\n      for (h = 0; h <= count1; h++) {\n        if (a[i][k] == 2 * a[i][h])\n          b[i]++;\n        else\n          continue;\n      }\n    }\n    count2++;\n  }\n  for (m = 0; m <= count2; m++)\n    cout << b[m] << \" \";\n  return 0;\n}\n"}
{"label": "12", "index": "22344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n = 0, m, a[100][100], b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[n][0]);\n    if (a[n][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[n][j]);\n      if (a[n][j] == 0) {\n        m = j;\n        break;\n      }\n    }\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[n][j] == 2 * a[n][k])\n          b[n]++;\n      }\n    }\n    printf(\"%d\\n\", b[n]);\n    n++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d\", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (int i = 0; i < t; i++)\n      for (int j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[17], n, count = 1, result = 0;\n  while ((scanf(\"%d \", &n)) && (n != -1)) {\n    if (n) {\n      num[count] = n;\n      count++;\n    } else {\n      for (int i = 1; i < count; i++) {\n        for (int j = 1; j < count; j++) {\n          if (num[i] == 2 * num[j]) {\n            result++;\n          }\n        }\n      }\n      printf(\"%d\\n\", result);\n      result = 0;\n      count = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, i, j, k, count;\n  int group[15];\n  scanf(\"%d\", &t);\n  do {\n    i = 0;\n    do {\n      group[i] = t;\n      scanf(\"%d\", &t);\n      i++;\n    } while (t != 0);\n    printf(\"\\n\");\n    count = 0;\n    for (j = i - 1; j >= 0; j--) {\n      for (k = 0; k < i; k++) {\n        if ((double)group[k] / 2 == group[j]) \n        {\n          count++;\n        } else if ((double)group[j] / 2 == group[k]) \n        {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count / 2);\n    scanf(\"%d\", &t);\n\n  } while (t != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22348", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l, k, s, t;\n  int a[100000] = {0}, b[100000];\n  for (i = 0; i < 100000; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n  }\n  s = 0;\n  for (i = 0; i < 100000; i++) {\n    t = 0;\n    for (j = 0; j < 10000; j++) {\n      b[j] = a[s];\n      s++;\n      if (b[j] == 0) {\n        for (k = 0; k <= j; k++)\n          for (l = k + 1; l <= j; l++)\n            if ((b[k] == 2 * b[l]) || (b[l] == 2 * b[k]))\n              t++;\n        cout << t << endl;\n        break;\n      }\n    }\n    if (a[s] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22349", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2},\n      sum = 0, i, j, s, t;\n\nA:\n  for (i = 0; a[i] != -1; i++) {\n    sum = 0;\n    a[0] = -2;\n    a[1] = -2;\n    a[2] = -2;\n    a[3] = -2;\n    a[4] = -2;\n    a[5] = -2;\n    a[6] = -2;\n    a[15] = -2;\n    a[7] = -2;\n    a[8] = -2;\n    a[9] = -2;\n    a[10] = -2;\n    a[11] = -2;\n    a[12] = -2;\n    a[13] = -2;\n    a[14] = -2;\n    for (s = 0; s <= 15; s++) {\n      cin >> a[s];\n      if (a[s] == 0) {\n        for (t = 0; t <= 15; t++) {\n          for (j = 0; j <= 15; j++) {\n            if (a[j] != 0 && a[t] != 0 && a[t] == a[j] * 2)\n              sum++;\n          }\n        }\n        printf(\"%d\\n\", sum);\n        break;\n      } else if (a[s] == -1)\n        goto A;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22350", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int j, num;\n  while (1) {\n    num = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f \", &a[i]);\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0) {\n        j = i - 1;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (int i = 0; i <= j; i++) {\n      for (int k = 0; k <= j; k++) {\n        if (a[i] / a[k] == 2 && i != k)\n          num++;\n      }\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, k, j, sum = 0, m;\n\n  for (k = 1;; k++) {\n    sum = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    if (a[0] != -1) {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i;\n          break;\n        }\n      }\n    }\n    for (i = 0; i < m - 1; i++) {\n      for (j = i + 1; j < m; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          sum = sum + 1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[15];\nint main() {\n  int num, doub;\n  char b;\n  int comp_with_zero;\n  for (; 1;) {\n    num = 0;\n    doub = 0;\n    comp_with_zero = 1;\n    b = 'a';\n    for (int ai = 0; ai < 15; ai++)\n      a[ai] = 0;\n\n    for (; 1;) {\n      b = cin.get();\n      if ((b == '0') && (a[num] == 0)) {\n        break;\n      }\n      if ((b - '0' < 10) && (b - '0' >= 0)) {\n        a[num] *= 10;\n        a[num] += (b - '0');\n      } else {\n        if (b == ' ') {\n          a[num] *= comp_with_zero;\n          num += 1;\n          comp_with_zero = 1;\n        }\n        if (b == '-') {\n          comp_with_zero = -1;\n        }\n      }\n    }\n    for (int i = 0; i <= num; i++) {\n      for (int ii = i; ii <= num; ii++) {\n        if (a[i] == 0) {\n          break;\n        }\n        if ((a[i] % 2 == 0) && (a[i] / 2 == a[ii])) {\n          doub += 1;\n        }\n        if ((a[ii] % 2 == 0) && (a[ii] / 2 == a[i])) {\n          doub += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", doub);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[100][15], i, j, n, m, a[100], p, b[100] = {0};\n  for (i = 0;;) {\n    for (j = 0;;) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        a[i] = j + 1;\n        i++;\n        break;\n      } else if (s[i][j] == -1)\n        break;\n      else\n        j++;\n    }\n    if (s[i][j] == -1)\n      break;\n  }\n\n  for (m = 0; m < i; m++) {\n    for (n = 0; n < a[m] - 1; n++) {\n      for (p = 0; p < a[m] - 1; p++) {\n        if (s[m][p] == 2 * s[m][n])\n          b[m]++;\n      }\n    }\n  }\n\n  for (m = 0; m < i; m++) {\n    printf(\"%d\\n\", b[m]);\n  }\n}\n"}
{"label": "12", "index": "22354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[100][15], i, j, n, m, a[100], p, b[100] = {0};\n  for (i = 0;;) {\n    for (j = 0;;) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        a[i] = j + 1;\n        i++;\n        break;\n      } else if (s[i][j] == -1)\n        break;\n      else\n        j++;\n    }\n    if (s[i][j] == -1)\n      break;\n  }\n  for (m = 0; m < i; m++) {\n    for (n = 0; n < a[m] - 1; n++) {\n      for (p = 0; p < a[m] - 1; p++) {\n        if (s[m][p] == 2 * s[m][n])\n          b[m]++;\n      }\n    }\n  }\n  for (m = 0; m < i; m++) {\n    printf(\"%d\\n\", b[m]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, i = 0, j = 0,\n      k = 0;\n  scanf(\"%d\", &a[0]);\n  while (a[0] != -1) {\n\n    i = 1;\n    do {\n      cin >> a[i];\n      if (a[i] < 0) {\n      }\n      i++;\n    } while (a[i - 1]);\n    for (i = 0; i < 16; i++) {\n      if (a[i]) {\n        for (j = 0; j < 16; j++) {\n          if (a[i] == 2 * a[j])\n            k += 1;\n        }\n      }\n    }\n    printf(\"%d \", k);\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22356", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, g, n, m;\n  for (j = 0;; j++) {\n    for (i = 0, n = 0; i < 16; i++) {\n      cin >> x[i];\n      if (x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    g = i;\n    for (i = 0; i < g; i++) {\n      for (m = 0; m < g; m++) {\n        if ((float)x[i] == x[m] * 2)\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int str[20], doubl, num = 0, a, b, c;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &str[0]);\n    if (str[0] == -1)\n      break;\n    else\n      for (a = 1; str[a - 1] != 0; a++) {\n        scanf(\"%d\", &str[a]);\n      }\n    for (b = 0; b < a - 1; b++) {\n      doubl = 2 * str[b];\n      for (c = 0; c < a - 1; c++) {\n        if (str[c] == doubl)\n          num++;\n        else\n          num = num;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "22358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16];\n  int i, j, k, number;\n  for (k = 1; 1; k++) {\n\n    scanf(\"%d\", &shuzu[0]);\n    if (shuzu[0] == -1)\n      break;\n\n    number = 1;\n    for (i = 1; i < 16; i++) {\n\n      scanf(\"%d\", &shuzu[i]);\n      if (shuzu[i] == 0) {\n        break;\n      } else\n        number++;\n    }\n\n    int zu = 0;\n    double a, b;\n    for (i = 0; i < number - 1; i++) {\n      for (j = number - 1; j > i; j--) {\n        a = (double)shuzu[i] / shuzu[j];\n        b = (double)shuzu[j] / shuzu[i];\n        if (a == 2 || b == 2) {\n          zu++;\n        }\n      }\n    }\n    cout << zu << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22359", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[16], b[100], changdu = 0, panduan = 1, geshu = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      changdu = i;\n      if (a[i] == -1) {\n        panduan = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        break;\n      }\n    }\n\n    if (panduan == 0) {\n      break;\n    }\n\n    geshu = 0;\n\n    for (i = 0; i < changdu; i++) {\n      for (j = 0; j < changdu; j++) {\n        if (a[i] == a[j] * 2) {\n          geshu++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", geshu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, m = 0, j, k = 0;\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++) {\n        if (i == j)\n          continue;\n        if (a[i] == 2 * a[j])\n          k++;\n        else\n          continue;\n      }\n    printf(\"%d\\n\", k);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[10000], m[15];\n  int *p;\n  int i, j, k = 0, total, all = 0, sum = 0, q, t;\n  p = &n[0];\n  for (i = 0;; i++) {\n    cin >> n[i];\n    if (n[i] == 0)\n      all++;\n\n    if (n[i] == -1) {\n      break;\n    }\n  }\n  while (all > 0) {\n    for (i = 0, t = 0; n[k] != 0; i++, k++) {\n      m[i] = n[k];\n      t++;\n    }\n    k = k + 1;\n    total = 0;\n    for (q = 0; q < t; q++) {\n      for (j = 0; j < t; j++) {\n        if ((m[q] / m[j] == 2) && (m[q] % m[j] == 0)) {\n          total++;\n        }\n      }\n    }\n    cout << total << \"\\n\";\n    all--;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, line, n;\n  for (line = 1;; line++) {\n    int a[16] = {0};\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[0] == -1)\n        goto A;\n      else if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < 16; i++) {\n      for (j = 0; j < 16; j++) {\n        if (a[i] == 2 * a[j] && a[i] != 0) {\n          n++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\nA:\n  return 0;\n}\n"}
{"label": "12", "index": "22363", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, counter;\n  for (;;) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      counter = 0;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n            counter = counter + 1;\n        }\n      }\n      printf(\"%d\\n\", counter);\n    }\n  }\n}\n"}
{"label": "12", "index": "22364", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, num = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n      if (i > 0) {\n        for (j = 0; j < i; j++) {\n          if (a[i] * 2 == a[j] || a[j] * 2 == a[i]) {\n            num++;\n          }\n        }\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22365", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a;           \n  while (cin >> a) \n  {\n    if (a != -1) \n    {\n      int i = 0, j, k, p = 0; \n      int b[15] = {a};        \n      while (b[i] != 0)       \n      {\n        cin >> b[i + 1];\n        i++; \n      }\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (b[k] == 2 * b[j] || b[j] == 2 * b[k]) \n          {\n            p = p + 1; \n          }\n      }\n      cout << p << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22366", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[15];\nint main() {\n  int num, doub;\n  char b;\n  int comp_with_zero;\n  for (; 1;) {\n    num = 0;\n    doub = 0;\n    comp_with_zero = 1;\n    b = 'a';\n    for (int ai = 0; ai < 15; ai++)\n      a[ai] = 0;\n\n    for (; 1;) {\n      b = cin.get();\n      if ((b == '0') && (a[num] == 0)) {\n        break;\n      }\n      if ((b - '0' < 10) && (b - '0' >= 0)) {\n        a[num] *= 10;\n        a[num] += (b - '0');\n      } else {\n        if (b == ' ') {\n          a[num] *= comp_with_zero;\n          num += 1;\n          comp_with_zero = 1;\n        }\n        if (b == '-') {\n          comp_with_zero = -1;\n        }\n      }\n    }\n    for (int i = 0; i <= num; i++) {\n      for (int ii = i; ii <= num; ii++) {\n        if (a[i] == 0)\n          break;\n        if ((a[i] % 2 == 0) && (a[i] / 2 == a[ii])) {\n          doub += 1;\n        }\n        if ((a[ii] % 2 == 0) && (a[ii] / 2 == a[i])) {\n          doub += 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", doub);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[16] = {0};\n  int i, j, k;\n  int num = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 0) {\n      for (j = 0; j < i - 1; j++)\n        for (k = j + 1; k < i; k++) {\n          if (a[j] == 2 * a[k] || 2 * a[j] == a[k]) {\n            num++;\n          }\n        }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n    if (a[i] == -1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, num;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n    }\n    num = 0;\n    for (i = 0; a[i]; i++)\n      for (j = 0; a[j]; j++)\n        if (a[i] == 2 * (a[j]))\n          num++;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20], i, j, n, court;\n  while (1) {\n    for (i = 0; 1; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0, court = 0; i <= n; i++) {\n      for (j = i; j <= n - 1; j++) {\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          court++;\n      }\n    }\n    cout << court << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22370", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, a[15], l, p = 0, t;\n  for (i = 1;; i++) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      p = 0;\n      for (k = 1; k <= 15; k++) {\n        scanf(\"%d\", &a[k]);\n        if (a[k] == 0)\n          break;\n      }\n      for (t = 0; t <= k; t++) {\n        for (l = 0; l <= k; l++) {\n          if (a[l] == a[t] * 2)\n            p = p + 1;\n        }\n      }\n      p = p - 1;\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22371", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17];\n  int n, s;\n\n  while (scanf(\"%d \", &a[1]), a[1] != -1) {\n    n = 1;\n    s = 0;\n    while (scanf(\"%d \", &a[n + 1]), a[n + 1] != 0)\n      n++;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        if (a[i] % a[j] == 0 && a[i] / a[j] == 2)\n          s++;\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16][16], i, j, k, m[16] = {0}, n, len, sum;\n  i = 0;\n  do {\n    i = i + 1;\n    j = 0;\n    do {\n      j = j + 1;\n      scanf(\"%d\", &a[i][j]);\n      m[i] = m[i] + 1;\n    } while ((a[i][j] != 0) && (a[i][j] != -1));\n\n  } while (a[i][1] != -1);\n  len = i;\n  for (i = 1; i < len; i++) {\n    sum = 0;\n    for (j = 2; j <= m[i]; j++) {\n      for (k = 1; k < j; k++) {\n        if ((a[i][j] == 2 * a[i][k]) || (a[i][j] * 2 == a[i][k])) {\n          sum = sum + 1;\n        }\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22373", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, x, j, g, k, b, a[15];\n  while (cin >> x) {\n    if (x == -1)\n      return 0;\n    else {\n      j = 0;\n      i = 0;\n      for (g = 0;; g++) {\n        a[i] = x;\n        i++;\n        cin >> x;\n        if (x == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        b = 2 * a[k];\n        for (g = 0; g < i; g++) {\n          if (a[g] == b)\n            j++;\n        }\n      }\n    }\n    cout << j << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[15][15] = {0}, doub[15] = {0}, i, j, k, w[15] = {0}, row;\n  for (i = 0; i < 15; i++) {\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &num[i][j]);\n      if (num[i][j] == -1)\n        break;\n      if (num[i][j] == 0) {\n        w[i] = j;\n        break;\n      }\n    }\n    if (num[i][0] == -1) {\n      row = i;\n      break;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < w[i]; j++) {\n      for (k = 0; k < w[i]; k++) {\n        if (num[i][k] == 2 * num[i][j]) {\n          doub[i]++;\n        }\n      }\n    }\n    cout << doub[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22375", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, a, b, k;\n  k = 0;\n  int sz[20], sz2[20], jieguo[1000];\n  while (1) {\n    for (i = 0;; i++) {\n      scanf(\"%d\", &(sz[i]));\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n      sz2[i] = sz[i];\n    }\n    if (sz[i] == -1)\n      break;\n\n    n = 0;\n    for (a = 0; a < i; a++) {\n      for (b = 0; b < i; b++) {\n        if (sz2[b] * 2 == sz[a]) {\n          n++;\n        }\n      }\n    }\n    jieguo[k] = n;\n    k++;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\\n\", jieguo[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22376", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i, j, m, k, b, n;\n  for (n = 0;; n++) {\n    for (i = 0; i < 17; i++) {\n      scanf(\"%d \", &m);\n      if (m == 0)\n        break;\n      if (m < 0)\n        goto er;\n      a[i] = m;\n    }\n    k = i;\n    b = 0;\n    for (i = 0; i < k; i++) {\n      for (j = i + 1; j < k; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          b = b + 1;\n      }\n    }\n    printf(\"%d\\n\", b);\n  }\ner:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, s;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1) {\n      break;\n    }\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[k] == 2 * a[j])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22378", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[15] = {0}, i, j, a, b = 0, m;\n  do {\n    for (m = 0;; m++) {\n      cin >> a;\n      num[m] = a;\n      if (a == 0)\n        break;\n      if (a == -1)\n        break;\n    }\n    for (i = 0; i <= m; i++)\n      for (j = 0; j <= m; j++)\n        if ((num[i] != 0 && num[j] != 0 && num[i] * 2 == num[j]) ||\n            (num[i] != 0 && num[j] != 0 && num[j] * 2 == num[i]))\n          b++;\n    if (a != -1) {\n      cout << b / 2 << endl;\n      b = 0;\n    }\n  } while (a != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int count = 0;\n  int i, j, k, m;\n  for (m = 0;; m++) {\n    scanf(\"%d\", &a[m][0]);\n    if (a[m][0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\" %d\", &a[m][i]);\n        if (a[m][i] == 0)\n          break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if ((a[m][j] == 2 * a[m][k]) || (a[m][j] * 2 == a[m][k]))\n          count = count + 1;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22380", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], whether, number = 0, numofpairs = 0;\n\n  do {\n    for (int i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        whether = 0;\n        break;\n      } else if (a[i] == 0) {\n        whether = 1;\n        break;\n      }\n      number++;\n    }\n    if (whether) {\n      for (int j = 0; j < number; j++) {\n        for (int k = 0; k < number; k++) {\n          if (a[k] == 2 * a[j])\n            numofpairs++;\n        }\n      }\n      printf(\"%d\\n\", numofpairs);\n    }\n    numofpairs = 0;\n    number = 0;\n  } while (whether == 1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], i = 0, j = 0, n = 0;\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i = i++;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = i; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          n = n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22382", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = 0;\n    j = 0;\n    k = 0;\n    a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0;; i++) {\n      cin >> x[i];\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    if (x[0] == 4)\n      a = 2;\n    if (x[0] == 3)\n      a = 2;\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, k, l;\n\n  for (l = 1; l < 3000; l++) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (k = 1; k <= 16; k++) {\n      scanf(\"%d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    for (i = 0; i < k - 1; i++) {\n      for (j = i + 1; j < k; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[17], n, count = 1, result = 0;\n  while ((cin >> n) && (n != -1)) {\n    if (n) {\n      num[count] = n;\n      count++;\n    } else {\n      for (int i = 1; i < count; i++) {\n        for (int j = 1; j < count; j++) {\n          if (num[i] == 2 * num[j])\n            result++;\n        }\n      }\n      cout << result << endl;\n      result = 0;\n      count = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22385", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][15], i, j, k, l;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      int n = 0;\n      for (j = 1;; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n      }\n      for (k = 0; k <= j - 1; k++)\n        for (l = 0; l <= j - 1; l++)\n          if (a[i][k] == 2 * a[i][l])\n            n = n + 1;\n\n      printf(\"%d\\n\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22386", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int p;\n  for (p = 1; p <= 100; p++) {\n    int a[17];\n    int u, i = 0;\n    for (u = 1; u <= 16; u++) {\n      scanf(\"%d \", &a[u]);\n      i++;\n      if (a[u] == 0) {\n        break;\n      }\n    }\n    if (a[1] == -1) {\n      break;\n    }\n    int j, k, t;\n    for (j = 1; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] > a[k]) {\n          t = a[k];\n          a[k] = a[j];\n          a[j] = t;\n        }\n      }\n    }\n    int r, s, w = 0;\n    for (r = 1; r < i - 1; r++) {\n      for (s = r + 1; s <= i - 1; s++) {\n        if (a[r] * 2 == a[s]) {\n          w = w + 1;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", w);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int i, j, num, n;\n  n = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a[i]);\n    n++;\n    if (a[i] == 0 || a[i] == -1) {\n      n--;\n      break;\n    }\n  }\n\n  do {\n\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i] || a[j] * 2 == a[i]) {\n          num++;\n        }\n      }\n    }\n    cout << num << \" \";\n\n    n = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0 || a[i] == -1) {\n        n--;\n        break;\n      }\n    }\n  }\n\n  while (a[0] != -1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, line, n;\n  for (line = 1;; line++) {\n    int a[16] = {0};\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        goto A;\n      else if (a[i] == 0)\n        break;\n    }\n    for (i = 0; i < 16; i++) {\n      for (j = 0; j < 16; j++) {\n        if (a[i] == 2 * a[j] && a[i] != 0) {\n          n++;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\nA:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int count = 0;\n  int i, j, k, m;\n  for (m = 0;; m++) {\n    cin >> a[m][0];\n    if (a[m][0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        cin >> a[m][i];\n        if (a[m][i] == 0)\n          break;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if ((a[m][j] == 2 * a[m][k]) || (a[m][j] * 2 == a[m][k]))\n          count = count + 1;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m;\n  while (cin >> m) {\n    if (m == -1)\n      break;\n    int a[15], i = 0, j, k, count = 0;\n    a[0] = m;\n    while (scanf(\"%d \", &m)) {\n      if (m == 0)\n        break;\n      i++;\n      a[i] = m;\n    }\n    k = i + 1;\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        if (a[i] == 2 * a[j])\n          count++;\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, n, j, total;\n  while (cin >> a[0] && a[0] != -1) {\n    i = 1;\n    while (cin >> a[i] && a[i] != 0) {\n      i++;\n    }\n    n = i;\n    total = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (a[j] == 2 * a[i])\n          total++;\n      }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0;\n  int a[16];\n  for (;; i++) {\n    scanf(\"%d\", &a[i]);\n    if (a[i] == 0) {\n      printf(\"%d\\n\", k);\n      i = -1;\n      k = 0;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n        k++;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = j = k = a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; scanf(\"%d \", &x[i]); i++) {\n\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, temp, count;\n  i = 0;\n  while (scanf(\"%d \", &a[0])) {\n    count = 0;\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (cin >> a[i]) {\n      if (a[i] < 1) {\n        temp = i;\n        break;\n      }\n      i++;\n    }\n    for (i = 0; i < temp - 1; i++) {\n      for (j = i + 1; j < temp; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22395", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][16], b[1000] = {0, 0};\n  int i, j, k, h, m;\n  int count1, count2;\n  count2 = -1;\n  for (i = 0; i < 1000; i++) {\n    count1 = -1;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) || (a[i][j] == -1))\n        break;\n      count1++;\n    }\n    if (a[i][j] == -1)\n      break;\n    for (k = 0; k <= count1; k++) {\n      for (h = 0; h <= count1; h++) {\n        if (a[i][k] == 2 * a[i][h])\n          b[i]++;\n        else\n          continue;\n      }\n    }\n    count2++;\n  }\n  for (m = 0; m <= count2; m++)\n    printf(\"%d \", b[m]);\n}\n"}
{"label": "12", "index": "22396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[16], i, j, k, a;\n  while (1) {\n    i = j = k = a = 0;\n    for (i = 0; i < 16; i++)\n      x[i] = 0;\n    for (i = 0; cin >> x[i]; i++) {\n\n      if (x[i] == -1 || x[i] == 0)\n        break;\n    }\n    if (x[0] == -1)\n      break;\n    else\n      for (a = 0, j = 1; j < i; j++) {\n        for (k = 0; k < j; k++) {\n          if (x[k] == 2 * x[j] || x[j] == 2 * x[k])\n            a++;\n        }\n      }\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, t;\n  for (;;) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (!a[i])\n        break;\n    }\n    t = i;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == (2 * a[i]))\n          s += 1;\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "22398", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101] = {{0}}, count = 0, i, j, q, n, b;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &b);\n    if (b != -1) {\n      a[i][1] = b;\n      for (j = 2; j <= 100; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0) {\n          a[i][j] = 0;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    count = 0;\n    for (j = 1; j <= 100; j++) {\n      if (a[i][j] != 0) {\n        for (q = 1; q <= 100; q++) {\n          if (a[i][j] == 2 * a[i][q])\n            count = count + 1;\n        }\n      } else {\n        break;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][16] = {0}, i = 0, j = 0, x, y, z, m;\n  do {\n    j = 0;\n    do {\n      cin >> a[i][j];\n      if (a[i][j] == -1)\n        break;\n      j++;\n    } while (a[i][j - 1] != 0);\n    if (a[i][j] == -1)\n      break;\n    else\n      i++;\n  } while (1 == 1);\n  for (x = 0; x < i; x++) {\n    m = 0;\n    {\n      for (y = 0; a[x][y] != 0; y++) {\n        for (z = 0; a[x][z] != 0; z++) {\n          if (a[x][z] == 2 * a[x][y])\n            m++;\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[16];\nint main() {\n  int n;\n  while (1) {\n    int i = 0, s = 0, j;\n    while (1) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0 || a[i] == -1) {\n\n        n = i;\n        break;\n      }\n      i++;\n    }\n    if (a[i] == -1)\n      break;\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n          s++;\n        }\n      }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22401", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], j, k, sum;\n  while (true) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] != -1) {\n      int i;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      sum = 0;\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == a[j] * 2)\n            sum = sum + 1;\n      }\n      printf(\"%d\\n\", sum);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22402", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0};\n  int j = 1, i, m, k;\n  cin >> a[0];\n  do {\n    m = 0;\n    k = 0;\n    for (i = 1; i < 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      else\n        j++;\n    }\n    for (i = 0; i <= j - 1; i++) {\n      for (k = 0; k <= j - 1; k++) {\n        if (a[k] == 2 * a[i])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    cin >> a[0];\n    if (a[0] == 0)\n      cin >> a[0];\n    j = 1;\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22403", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, num = 1, num1 = 1, i = 1, k, j, c = 0;\n  while (num1 != -1) {\n    cin >> num1;\n    a[0] = num1;\n    while (num != 0) {\n      cin >> num;\n      a[i] = num;\n      i++;\n    }\n    for (k = 0; k <= i - 2; k++)\n      for (j = k + 1; j <= i - 2; j++)\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          c++;\n    printf(\"%d\\n\", c);\n\n    c = 0;\n    i = 1;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22404", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int p;\n  for (p = 1; p <= 100; p++) {\n    int a[17];\n    int u, i = 0;\n    for (u = 1; u <= 16; u++) {\n      scanf(\"%d\", &a[u]);\n      i++;\n      if (a[u] == 0) {\n        break;\n      }\n    }\n    if (a[1] == -1) {\n      break;\n    }\n    int j, k, t;\n    for (j = 1; j < i - 1; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] > a[k]) {\n          t = a[k];\n          a[k] = a[j];\n          a[j] = t;\n        }\n      }\n    }\n    int r, s, w = 0;\n    for (r = 1; r < i - 1; r++) {\n      for (s = r + 1; s <= i - 1; s++) {\n        if (a[r] * 2 == a[s]) {\n          w = w + 1;\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", w);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, NO, tmp, a[101];\n  while (1) {\n    scanf(\"%d\", &tmp);\n    if (tmp == -1)\n      break;\n    NO = 0;\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n    a[tmp] = 1;\n    while (scanf(\"%d\", &tmp) == 1 && tmp)\n      a[tmp] = 1;\n    for (i = 0; i < 50; i++) {\n      if (a[i] && a[2 * i])\n        NO++;\n    }\n    printf(\"%d\\n\", NO);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22406", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  for (int i = 0;; i++) {\n    scanf(\"%d \", &a[i]);\n    switch (a[i]) {\n    case -1:\n      return 0;\n    case 0: {\n      int s = 0;\n      for (int j = 0; j < i; j++)\n        for (int k = j; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            s++;\n      i = -1;\n      printf(\"%d\\n\", s);\n    }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, m, n, k;\n  for (;;) {\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (m = 0; m < i; m++)\n      for (n = 0; n < i; n++)\n        if (a[m] == 2 * a[n])\n          k++;\n    printf(\"%d\\n\", k);\n  }\n}\n"}
{"label": "12", "index": "22408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], b[16], c = 0, i, j, k;\n  for (i = 0; i <= 15; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] != 0) {\n      if (a[i] % 2 == 0)\n        b[i] = a[i] / 2;\n      else\n        b[i] = -1;\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        for (k = 0; k <= i - 1; k++) {\n          if (k == j)\n            continue;\n          if (a[k] == b[j])\n            c++;\n        }\n      }\n      printf(\"%d\\n\", c);\n      for (j = 0; j <= i; j++) {\n        a[j] = 0, b[j] = 0;\n      }\n      c = 0, i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22409", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  int a[15];\n  scanf(\"%d\", &k);\n  while (k != -1) {\n    n = 0;\n    m = 0;\n    i = 0;\n    while (k != 0) {\n      n++;\n      a[i] = k;\n      i++;\n      scanf(\"%d\", &k);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &k);\n  }\n}\n"}
{"label": "12", "index": "22410", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a[20], sum = 0;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; a[i - 1] != 0; i++) {\n      scanf(\"%d \", &a[i]);\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int a[16];\n  while (cin >> a[0] && a[0] != -1) {\n    k = 1;\n    n = 0;\n    while (cin >> a[k] && a[k] != 0)\n      k++;\n    for (i = 0; i < k - 1; i++)\n      for (j = i + 1; j < k; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          n++;\n      }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  while (1) {\n    int a[100] = {-2}, i, j, count = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[0] == -1 || a[i] == 0)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; a[i + 1] != 0; i++) {\n      for (j = i + 1; a[j] != 0; j++)\n        if (a[i] == 2 * a[j] || a[i] * 2 == a[j])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[15], m, n;\n  int i, j, k, h;\n  for (i = 0;; i++) {\n    n = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d\", &m);\n      if (m == 0)\n        break;\n      if (m == -1)\n        return 0;\n      p[j] = m;\n    }\n    for (k = 0; k < j; k++) {\n      for (h = 0; h < j; h++) {\n        if (p[k] == 2 * p[h])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], i, n, j;\n  scanf(\"%d\", &a[1]);\n  while (a[1] > 0) {\n\n    n = 0;\n    i = 1;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n      for (j = 1; j <= i; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          n++;\n\n    } while (a[i] != 0);\n    cout << n - 1 << \"\\n\";\n    scanf(\"%d \", &a[1]);\n  }\n}\n"}
{"label": "12", "index": "22415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[15], a, i, x, k, t;\n  cin >> a;\n  while (a != -1) {\n    i = 0;\n    x = 0;\n    while (a != 0) {\n      num[i] = a;\n      i = i + 1;\n      cin >> a;\n    }\n    for (k = 0; k <= i - 1; k++) {\n      for (t = 0; t <= i - 1; t++) {\n        if (num[k] == num[t] * 2)\n          x = x + 1;\n      }\n    }\n    cout << x << endl;\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22416", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, n, count;\n  while (1) {\n    count = 0;\n    i = 0;\n\n    while (1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0 || a[0] == -1)\n        break;\n    }\n    n = i - 1;\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] * 2 == a[j] || a[j] * 2 == a[i])\n          count++;\n      }\n    }\n\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  int sz[16], erbei[16], sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (0 == sz[i]) {\n      for (j = 0; j < i; j++) {\n        erbei[k] = 2 * sz[j];\n        k++;\n      }\n      for (k = 0; k < i; k++) {\n        for (j = 0; j < i; j++) {\n          if (erbei[k] == sz[j]) {\n            sum++;\n          }\n        }\n      }\n      cout << sum << \"\\n\";\n      sum = 0;\n      i = -1;\n      k = 0;\n    }\n    if (-1 == sz[i]) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[15], m = 0, s, h, t;\n  scanf(\"%d\", &t);\n  while ((t + 1) != 0) {\n    for (n = 0, s = 0; t != 0; n++)\n      a[n] = t, s++, scanf(\"%d\", &t);\n    for (n = 0; n < s; n++) {\n      for (h = 0; h < s; h++) {\n        if (a[n] == 2 * a[h])\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n    m = 0;\n    scanf(\"\\n%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22419", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], s = 0;\n  while (scanf(\"%d\", &a[++s]) != EOF) {\n    if (a[1] == -1)\n      break;\n    do\n      cin >> a[++s];\n    while (a[s] != 0);\n    s--;\n    int ans = 0;\n    for (int i = 1; i <= s; i++)\n      for (int j = 1; j <= s; j++)\n        if (a[i] * 2 == a[j])\n          ans++;\n    printf(\"%d\\n\", ans);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22420", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][20] = {0};\nint i = 1;\nint b[100] = {0};\n\nvoid sort();\nvoid compare();\nint main() {\n  int p = 0;\n  int j = 0;\n\n  do {\n    j = 1;\n    do {\n      cin >> a[i][j];\n      j++;\n    } while ((a[i][j - 1] != 0) && (a[i][j - 1] != -1));\n    i++;\n  } while (a[i - 1][j - 1] != -1);\n\n  sort();\n  compare();\n\n  for (p = 1; p <= i - 2; p++)\n    cout << b[p] << endl;\n\n  return 0;\n}\n\nvoid sort() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  int t = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 14; x++)\n      for (y = 1; y <= 15 - x; y++) {\n        if (a[p][y] > a[p][y + 1]) {\n          t = a[p][y];\n          a[p][y] = a[p][y + 1];\n          a[p][y + 1] = t;\n        }\n      }\n}\n\nvoid compare() {\n  int x = 0;\n  int y = 0;\n  int p = 0;\n  for (p = 1; p <= i - 2; p++)\n    for (x = 1; x <= 15; x++)\n      for (y = x; y <= 15; y++) {\n        if ((a[p][y] == 2 * a[p][x]) && (a[p][x] != 0))\n          b[p]++;\n      }\n}\n"}
{"label": "12", "index": "22421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, x = 0, a[20];\n\n  while (1) {\n    x = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (j = 1; a[j - 1] != 0; j++)\n      scanf(\"%d\", &a[j]);\n    for (k = 0; k < j - 1; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          x = x + 1;\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n}\n"}
{"label": "12", "index": "22422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[16], i, n, a = 0, j;\n  cin >> s[0];\nloop:\n  a = 0;\n  i = 1;\n  do {\n    scanf(\" %d\", &s[i]);\n    i++;\n  } while (s[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++)\n      if (s[i] == 2 * s[i + j] || s[i + j] == s[i] * 2)\n        a = a + 1;\n  }\n  printf(\"%d\\n\", a);\n  scanf(\"%d\", &s[0]);\n  if (s[0] != -1)\n    goto loop;\n}\n"}
{"label": "12", "index": "22423", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, k;\n  while (1) {\n    int sz[16];\n    int add = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[0] == -1) {\n      break;\n    }\n    for (i; i < 16; i++) {\n      sz[i] = 0;\n    }\n    for (i = 0; i < 16; i++) {\n      for (k = 0; k < 16; k++) {\n        if (sz[k] != 0 && sz[k] == 2 * sz[i]) {\n          add = add + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", add);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &a[i][1]);\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else {\n          b[k] = b[k];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22425", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, k, l;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    l = 0;\n    if (a[0] != 0) {\n      for (i = 1; a[i - 1] != 0; i++) {\n        cin >> a[i];\n      }\n      for (j = 0; j <= i - 1; j++) {\n        for (k = 0; k < j; k++)\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            l++;\n      }\n      printf(\"%d\\n\", l);\n    } else\n      printf(\"%d\\n\", l);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22426", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint number(int a[], int m) {\n  int i, j, s = 0;\n  for (i = 1; i <= m; i++)\n    for (j = 1; j <= m; j++)\n      if (a[i] == 2 * a[j])\n        s++;\n  return (s);\n}\n\nint main() {\n  int a[17], b[100];\n  int i, j = 1;\n\n  scanf(\"%d\", &a[1]);\n  while (a[1] != -1) {\n    for (i = 2; i <= 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    i--;\n    b[j] = number(a, i);\n    printf(\"%d \", b[j]);\n    scanf(\"%d\", &a[1]);\n    j++;\n  }\n}\n"}
{"label": "12", "index": "22427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[500][15];\n  int i, j, t, number;\n  for (i = 0;; i++) {\n    number = 0;\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1) {\n      break;\n    }\n    for (j = 1;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        cout << number << \"\\n\";\n        break;\n      }\n      for (t = 0; t < j; t++) {\n        if (a[i][j] * 2 == a[i][t]) {\n          number++;\n          break;\n        }\n        if (a[i][j] == a[i][t] * 2) {\n          number++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[20];\n  int i;\n  int n = 0;\n  int num = 0;\n  int j;\n  while (1) {\n    n = 0; \n    num = 0;\n    for (i = 0; i < 20; i++) \n    {\n      cin >> a[i];\n      if (a[i] == 0) \n        break;\n      if (a[i] == -1) \n        return 0;\n      n++; \n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j]) \n          num++;                                  \n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int s[16];\n  int i = 1, a, j, b;\n\nloop:;\n  scanf(\"%d\", &s[i]);\n  if (s[i] != 0) {\n    i++;\n    goto loop;\n  }\n  a = i;\n  b = 0;\n  for (i = a; i >= 1; i--) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == 2 * s[j] || s[j] == 2 * s[i])\n        b++;\n    }\n  }\n\n  cout << b;\n\n  return 0;\n}\n"}
{"label": "12", "index": "22430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, m, p, q;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][j] <= 0)\n        break;\n    }\n    m = 0;\n    for (p = 0; p < j; p++) {\n      for (q = 0; q < j; q++) {\n        if (a[i][q] == 2 * a[i][p])\n          m++;\n      }\n    }\n    if (a[i][j] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, num;\n  int sz[100] = {0};\n  int j, k;\n  int geshu = -1;\n  while (1) {\n    i = 0;\n    scanf(\"%d\", &num);\n    if (num == -1)\n      break;\n    sz[0] = num;\n    while (1) {\n      if (sz[i] == 0)\n        break;\n      i++;\n      scanf(\"%d\", &sz[i]);\n    }\n    for (k = 0; k <= i; k++) {\n      for (j = 0; j <= i; j++) {\n        if (sz[j] == 2 * sz[k]) {\n          geshu = geshu + 1;\n        }\n      }\n    }\n    cout << geshu << \"\\n\";\n    geshu = -1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22432", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int k, i, m = 0, number;\n  double a[15];\n  do {\n    cin >> number;\n    if (number == -1)\n      break;\n    else\n      a[0] = number;\n    for (i = 2;; i++) {\n      cin >> number;\n      a[i - 1] = number;\n      for (k = 0; k < i - 1; k++) {\n        if (a[i - 1] == (2 * a[k]) || a[i - 1] == (a[k] / 2))\n          m++;\n      }\n      if (number == 0) {\n        cout << endl << m << endl;\n        break;\n      }\n    }\n    m = 0;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22433", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int num[100][150], i, j, g, h[100], k, m;\n  for (j = 0;; j++) {\n    for (i = 0;; i++) {\n      scanf(\"%d\", &num[j][i]);\n      if (num[j][0] == -1)\n        break;\n      if (num[j][i] == 0)\n        break;\n    }\n    if (num[j][0] == -1)\n      break;\n    h[j] = i;\n  }\n  g = j;\n  int count[100] = {0};\n  for (j = 0; j < g; j++) {\n    for (i = 0; i < h[j]; i++) {\n      k = i;\n      for (m = k; m < h[j]; m++) {\n        if (((num[j][m] % num[j][k] == 0) && (num[j][m] / num[j][k] == 2)) ||\n            ((num[j][k] / num[j][m] == 2) && (num[j][k] % num[j][m] == 0)))\n          count[j]++;\n      }\n    }\n\n    printf(\"%d\\n\", count[j]);\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "22434", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (1) {\n    int a[16] = {0}, i, j, p, k, l, num = 0;\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    while (a[0] != 0) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          p = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = p;\n        }\n      }\n    }\n    for (k = 1; k <= i - 1; k++) {\n      for (l = k; l <= i; l++) {\n        if (2 * a[k] == a[l])\n          num++;\n        if (2 * a[k] < a[l])\n          break;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22435", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i = -1, j, number = 0;\n  do {\n    for (i = 0; i < 16; i++)\n\n      a[i] = 0;\n\n    i = -1;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0 && a[i] != -1);\n    number = 0;\n    for (i = 0; a[i] != 0 && a[i] != -1; i++) {\n      for (j = 0; a[j] != 0 && a[i] != -1; j++) {\n        if (a[j] == a[i] * 2) {\n          number++;\n        }\n      }\n    }\n    if (a[0] != -1) {\n      cout << number << endl;\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, num, i, j, k;\n  int a[200];\n\n  for (k = 1;; k++) {\n    i = 0;\n\n    while (1) {\n      scanf(\"%d \", &a[i]);\n\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n\n      i++;\n    }\n\n    num = 0;\n\n    for (i = 0; a[i] != 0; i++)\n      N = i;\n\n    for (i = 0; i <= N; i++) {\n      for (j = i + 1; j <= N; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          num++;\n      }\n    }\n\n    printf(\"%d\\n\", num);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22437", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[30], i, j, count1, count2;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    count2 = 0;\n    i = 0;\n    while (a[i]) {\n      scanf(\"%d\", &a[++i]);\n    }\n    count1 = i - 1;\n    for (i = 0; i <= count1; i++) {\n      for (j = i + 1; j <= count1; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count2++;\n    }\n    cout << count2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, n;\n  double f[15];\n  cin >> a;\n  while (a != -1) {\n    i = 0;\n    while (a != 0) {\n      f[i] = a;\n      i++;\n      cin >> a;\n    }\n    j = i;\n    n = 0;\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        f[k] = f[k] * 1.0;\n        if ((f[k] / f[i]) == 2.0 || (f[i] / f[k]) == 2.0)\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    cin >> a;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "22439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, n = 0, i, m, j;\n  while (cin >> a[0]) {\n    if (a[0] != (-1)) {\n      for (i = 1; i <= 15; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      for (j = i - 1; j >= 0; j--) {\n        for (m = i - 1; m >= 0; m--) {\n          if (a[j] == 2 * a[m])\n            n++;\n        }\n      }\n      cout << n << \"\\n\";\n      n = 0;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22440", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int i, j, m, n;\n\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        return 0;\n      }\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    } \n    m = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[j] == (a[i] + a[i]))\n          m++;\n      }\n    } \n\n    { printf(\"%d\\n\", m); }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22441", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char s[100];\n  for (;;) {\n\n    scanf(\"%s \", s);\n    int i, j, k = 0, m = 0, x[15], n = 0;\n    if (s[0] == '-' && s[1] == '1')\n      break;\n    else {\n      for (i = 0;; i++) {\n        if (s[i] == '0')\n          break;\n        else {\n          if ('1' <= s[i] && s[i] <= '9') {\n            j = s[i] - '0';\n            k = k * 10 + j;\n\n          } else {\n            x[m] = k;\n            m++;\n            k = 0;\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++)\n      for (j = i + 1; j < m; j++) {\n        if ((x[i] / x[j] == 2 && x[i] % x[j] == 0) ||\n            (x[j] / x[i] == 2 && x[j] % x[i] == 0)) {\n          n++;\n        }\n      }\n    printf(\"%d \", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, m = 1, num = 0;\n  while (cin >> a[0]) {\n    num = 0;\n    m = 1;\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++, m++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (k == j)\n            continue;\n          if ((a[k] == 2 * a[j]) || (a[j] == 2 * a[k])) {\n            num++;\n          }\n        }\n      }\n\n      cout << num / 2 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22443", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int x, a[16], i, j, n = 0, num = 0,\n                      m; \n                         \n  while (1) {\n    cin >> m;\n    if (m == -1) \n      break;\n    else {\n      a[1] = m; \n      n = 1;\n    }\n    for (i = 2;; i++) {\n      cin >> x; \n      if (x == 0)\n        break;\n      else {\n        a[i] = x;\n        n = n + 1;\n      }\n    }\n    for (i = 1; i <= n; i++) \n    {\n      for (j = 1; j <= n; j++) {\n        if (a[i] == (2 * a[j]))\n          num = num + 1;\n      }\n    }\n    cout << num << endl; \n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22444", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][16] = {0};\n  int i = 0, j = 0, p = 0, k = 0, num = 0;\n  do {\n    for (j = 0; j < 16; j++) {\n      cin >> a[p][j];\n      if (a[p][j] == 0 || a[p][j] == -1)\n        break;\n    }\n    p++;\n  } while (a[p - 1][0] != -1);\n  p--;\n  for (i = 0; i < p; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (2 * a[i][k] == a[i][j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int i, j, n, t;\n  for (i = 0; i < 100; i++) {\n    n = 0;\n    t = 0;\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = n + 1;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%f\", &a[j]);\n      if (a[j] == 0)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == a[i] * 2 || a[j] == 0.5 * a[i])\n          t++;\n      }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[16];\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    int count = 0;\n    for (int m = 0; m < i; m++) {\n      for (int n = 0; n < i; n++) {\n        if (a[m] == a[n] * 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[100][20];\n  int num, temp, size, time = 0;\n  int i = 0, j = 0, k, l;\n\n  while (cin >> num) {\n    time = 0;\n    if (num == -1)\n      break;\n\n    else if (num != 0) {\n      a[i][j] = num;\n      j = j + 1;\n    }\n\n    else if (num == 0) {\n      size = j;\n\n      for (l = 0; l < size; l++)\n        for (j = 0; j + 1 < size; j++) {\n          if (a[i][j] > a[i][j + 1]) {\n            temp = a[i][j];\n            a[i][j] = a[i][j + 1];\n            a[i][j + 1] = temp;\n          }\n        }\n\n      for (k = 0; k < size; k++)\n        for (l = 0; l < size; l++) {\n          if (2 * a[i][k] == a[i][l])\n            time = time + 1;\n        }\n\n      cout << time << \"\\n\";\n      j = 0;\n      i = i + 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22448", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][16], i, j, k, t;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1; a[i][j - 1] != 0; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (j = 0; j < i; j++) {\n    int n = 0;\n    for (k = 0; a[j][k + 1] != 0; k++) {\n      for (t = k + 1; a[j][t] != 0; t++) {\n        if (a[j][k] == 2 * a[j][t] || a[j][t] == 2 * a[j][k])\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22449", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15], count = 0;\n  int i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i];\n    if (a[0] == -1)\n      break;\n    else if (a[i] == 0) {\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == a[j] * 2)\n            count++;\n        }\n      }\n      cout << count << endl;\n      count = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22450", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15];\n  scanf(\"%d\", &a[0]);\n  int i = 1;\n  int k = 0;\n  while (a[i - 1] != 0) {\n    scanf(\"%d\", &a[i]);\n    k = k + 1;\n    i++;\n  }\n  int j;\n  int n = 0;\n  for (i = 0; i <= k - 1; i++) {\n    for (j = 0; j <= k - 1; j++) {\n      if (a[i] == 2 * a[j])\n        n = n + 1;\n    }\n  }\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "12", "index": "22451", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  while (cin >> a[0] && a[0] != -1) {\n    int n = 0, count = 0;\n    while (a[n] != 0)\n      cin >> a[++n];\n    for (int i = 0; i < n; i++) {\n      for (int j = i; j < n; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count++;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22452", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[150] = {0}, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    if (a[0] != -1)\n      printf(\"%d\\n\", num);\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22453", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16] = {0}, i, j, pair = 0, n;\n  for (i = 0; shuzu[0] != -1; i++) {\n    scanf(\"%d\", &shuzu[i]);\n    if (shuzu[i] == 0) {\n      n = i;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[i] == 2 * shuzu[j]) {\n            pair++;\n          }\n        }\n      }\n      printf(\"%d\\n\", pair);\n      i = -1;\n      pair = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  int a[16], k, i, j; \n  for (k = 0;; k++)   \n  {\n    int n = -1, num = 0;     \n    for (i = 0; i < 16; i++) \n    {\n      cin >> a[i];\n      n++;           \n      if (a[i] == 0) \n        break;       \n    }\n    if (a[0] == -1) \n      break;\n    for (i = 0; i < n; i++)       \n      for (j = i + 1; j < n; j++) \n      {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) \n          num++;                                  \n      }\n    cout << num << endl; \n  }\n  return 0; \n} \n"}
{"label": "12", "index": "22455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = 0; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[1000][100];\n  int i = 0, j = 0, h = 0, a, m = 0, sum = 0;\n  scanf(\"%d\", &a);\n  while (a != -1) {\n    if (a != 0)\n      s[i][j++] = a;\n    else {\n      s[i][j] = a;\n      i++;\n      j = 0;\n    }\n    cin >> a;\n  }\n\n  for (h = 0; h < i; h++) {\n    while (s[h][j] != 0) {\n      m = 0;\n      while (s[h][m] != 0) {\n        if (((float)s[h][j] / 2) == (float)s[h][m])\n          sum++;\n        m++;\n      }\n      j++;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101] = {{0}}, count = 0, i, j, q, n, b;\n  for (i = 1; i <= 100; i++) {\n    scanf(\"%d\", &b);\n    if (b != -1) {\n      a[i][1] = b;\n      for (j = 2; j <= 100; j++) {\n        cin >> a[i][j];\n        if (a[i][j] == 0) {\n          a[i][j] = 0;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    count = 0;\n    for (j = 1; j <= 100; j++) {\n      if (a[i][j] != 0) {\n        for (q = 1; q <= 100; q++) {\n          if (a[i][j] == 2 * a[i][q])\n            count = count + 1;\n        }\n      } else\n        break;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int i, j, n, t;\n  for (i = 0; i < 100; i++) {\n    n = 0;\n    t = 0;\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = n + 1;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%f\", &a[j]);\n      if (a[j] == 0)\n        break;\n      n = n + 1;\n    }\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == a[i] * 2 || a[j] == 0.5 * a[i]) {\n          t++;\n        }\n      }\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j;\n  int a[16];\n  while (cin >> a[0] && a[0] != -1) {\n    k = 1;\n    n = 0;\n    while (cin >> a[k] && a[k] != 0)\n      k++;\n    for (i = 0; i < k - 1; i++)\n      for (j = i + 1; j < k; j++)\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2)) {\n          n++;\n        }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22460", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i;\n  while (1) {\n    int n = 1, sum = 0, j;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    while (cin >> a[n]) {\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], column[100] = {0}, i = 0, l = 0, j, n, m, s = 0;\n  for (l = 0; l <= 15; l++) {\n    scanf(\"%d\", &a[i][l]);\n    if (a[i][l] == -1)\n      break;\n    else if (a[i][l] == 0) {\n      i++;\n      l = -1;\n    } else\n      column[i]++;\n  }\n  i--;\n  for (m = 0; m <= i; m++) {\n    s = 0;\n    for (j = 0; j <= column[m] - 1; j++)\n      for (n = j + 1; n <= column[m]; n++)\n        if (a[m][j] * 2 == a[m][n] || a[m][n] * 2 == a[m][j])\n          s = s + 1;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], b[16], c = 0, i, j, k;\n  for (i = 0; i <= 15; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] != 0) {\n      if (a[i] % 2 == 0)\n        b[i] = a[i] / 2;\n      else\n        b[i] = -1;\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        for (k = 0; k <= i - 1; k++) {\n          if (k == j)\n            continue;\n          if (a[k] == b[j])\n            c++;\n        }\n      }\n      cout << c << endl;\n      for (j = 0; j <= i; j++) {\n        a[j] = 0, b[j] = 0;\n      }\n      c = 0, i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22463", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[17], t, sum;\n  do {\n    t = -1;\n    sum = 0;\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      t++;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n\n    for (i = 1; i <= t; i++)\n      for (j = 1; j <= t; j++) {\n        if (a[j] == a[i] * 2) {\n          sum++;\n        }\n      }\n    if (a[1] != -1)\n      cout << sum << endl;\n  } while (a[1] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[100][100], i = 0, j = 0, m, n, k, s = 0;\n  while (scanf(\"%d\", &c[i][j])) {\n    if (c[i][j] != 0 && c[i][j] != -1)\n      j++;\n    else if (c[i][j] == 0) {\n      i++;\n      j = 0;\n    } else\n      break;\n  }\n  for (m = 0; m <= i - 1; m++) {\n    for (n = 0; c[m][n] != 0; n++) {\n      for (k = 0; c[m][k] != 0; k++) {\n        if (c[m][n] == 2 * c[m][k])\n          s++;\n      }\n    }\n    printf(\"%d \", s);\n    s = 0;\n  }\n}\n"}
{"label": "12", "index": "22465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, p, s[15];\n  for (i = 0;; i++) {\n    k = 0;\n    cin >> s[0];\n    if (s[0] == -1)\n      break;\n    for (j = 1;; j++) {\n      cin >> s[j];\n      if (s[j] == 0)\n        break;\n      for (p = 0; p < j; p++) {\n        if (s[j] == 2 * s[p] || s[p] == 2 * s[j])\n          k++;\n      }\n    }\n    printf(\"%d\\n\", k);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i;\n\n  for (i = 1;; i++) {\n    int j, k, n = 1, cnt = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%d \", &a[j]);\n      if (a[j] == 0)\n        break;\n\n      n++;\n    }\n\n    for (j = 0; j < n - 1; j++) {\n      for (k = 1; k <= n - j - 1; k++) {\n        if (a[j] == 2 * a[j + k] || 2 * a[j] == a[j + k])\n          cnt++;\n      }\n    }\n    cout << cnt << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, count = 0;\n  int a[16];\n  for (i = 1;; i++) {\n    count = 0;\n    for (j = 0;; j++) {\n      cin >> a[j];\n      if ((a[j] == 0) || (a[j] == -1))\n        break;\n    }\n\n    for (x = 0; x <= j - 1; x++) {\n      for (y = 0; y <= j - 1; y++) {\n        if (a[y] == a[x] * 2)\n          count = count + 1;\n      }\n    }\n    if (a[j] != -1)\n      cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int test[100][17] = {0};\n\n  int i, j, k, num;\n  int turn = 0, nonzero = 0, valid = 0;\n\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0)\n        break;\n      if (num == -1)\n        goto start;\n      test[i][j] = num;\n    }\n    turn += 1;\n  }\nstart:\n  for (i = 0; i < turn; i++) {\n    for (j = 0;; j++) {\n      if (test[i][j] != 0)\n        nonzero += 1;\n      else\n        break;\n    }\n    for (j = 0; j < nonzero; j++) {\n      for (k = 0; k < nonzero; k++) {\n        if ((float)(test[i][j]) / (float)(test[i][k]) == 2)\n          valid += 1;\n      }\n    }\n    printf(\"%d\\n\", valid);\n    valid = 0;\n    nonzero = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[20];\n  do {\n    int i = 1;\n    do {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      else\n        i++;\n    } while (i <= 19);\n    int j, k;\n    float t;\n    for (j = 1; j <= i - 2; j++)\n      for (k = 1; k <= i - 1 - j; k++)\n        if (a[k] > a[k + 1]) {\n          t = a[k];\n          a[k] = a[k + 1];\n          a[k + 1] = t;\n        }\n    int s = 0, l, m;\n    for (l = 1; l <= i - 2; l++)\n      for (m = 1; m <= i - 1; m++)\n        if (a[m] / a[l] == 2)\n          s = s + 1;\n    if (a[1] > 0)\n      printf(\"%d\\n\", s);\n  } while (a[1] > 0);\n  return 0;\n}\n"}
{"label": "12", "index": "22470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int key;                            \n  int number, total;                  \n  while ((cin >> key) && (key != -1)) \n  {\n    int num[15]; \n    num[0] = key;\n    int i = 1;                               \n    int flag1 = 0, flag2 = 0;                \n    total = 0;                               \n    while ((cin >> number) && (number != 0)) \n    {\n      num[i] = number;\n      i++;\n    }\n    for (int k = 0; k <= i - 2; k++) {\n      for (int r = k + 1; r <= i - 1; r++) {\n        flag1 = (num[r] == 2 * num[k]);\n        flag2 = (num[k] == 2 * num[r]);\n        if ((flag1 == 1) || (flag2 == 1)) {\n          total = total + 1;\n        } \n      }   \n    }     \n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[15];\n  int a, b;\n  int i, t, h, k;\n  for (i = 0; i <= 100; i++) {\n    b = 0;\n    a = 0;\n    for (t = 0; t < 17; t++) {\n      scanf(\"%d\", &s[t]);\n      if (s[t] == 0)\n        break;\n      if (s[t] == -1)\n        break;\n      a++;\n    }\n    if (s[t] == -1) {\n      break;\n    }\n    for (k = 0; k < a; k++) {\n      for (h = 0; h < a; h++) {\n        if (s[k] == 2 * s[h]) {\n          b++;\n        } else\n          b = b;\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i = 1, j, k, n = 0;\n  while (cin) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k = i;\n    }\n    for (j = 0; j <= k - 1; j++) {\n      for (i = j + 1; i <= k; i++) {\n        if (a[j] * 2 == a[i] || a[i] * 2 == a[j])\n          n = n + 1;\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  static int a[16], b[16];\n  int n, i, j, s = 0;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    for (i = 1; a[i - 1] != 0; i++) {\n      b[i - 1] = 2 * a[i - 1];\n      cin >> a[i];\n    }\n    n = i - 2;\n    s = 0;\n    for (i = 0; i <= n; i++) {\n      for (j = 0; j <= n; j++)\n        if (a[i] == b[j]) {\n          s++;\n          break;\n        }\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[16] = {0};\n  int m, i = 1;\n  while (m != -1) {\n    do {\n      cin >> m;\n      number[i] = m;\n      i++;\n    } while (m != 0 && m != -1);\n    int k = 1, t, j = 0;\n    for (k = 1; k <= i - 1; k++) {\n      t = number[k];\n      int p;\n      for (p = 1; p <= i - 1; p++) {\n        if (t == 2 * number[p])\n          j++;\n        else\n          continue;\n      }\n    }\n    if (m != -1) {\n      printf(\"%d\\n\", j - 1);\n    } else\n      break;\n    i = 1;\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[16], i = 0, j = 0, n = 0, Two;\n\n  for (i = 0; i < 16; i++) {\n    a[i] = 0;\n  }\n\n  while (1 > 0) {\n\n    n = 0;\n    Two = 0;\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if ((a[i] == 0) || (a[0] == -1))\n        break;\n      else\n        n++;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] == (2 * a[j])) || (a[j] == (2 * a[i]))) {\n          Two++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", Two);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int sum = 0;\n\n  do {\n    sum = 0;\n\n    cin >> a[0];\n\n    if (a[0] == -1)\n      break;\n\n    for (int i = 1; i <= 15; ++i) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    for (int m = 0; m <= 13; ++m) {\n      if (a[m + 1] == 0)\n        break;\n      for (int n = m + 1; n <= 14; ++n) {\n        if (a[n] == 0)\n          break;\n        if (a[m] == 2 * a[n] || a[n] == 2 * a[m])\n          ++sum;\n      }\n    }\n\n    cout << sum << \"\\n\";\n\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, sum;\n  do {\n    sum = 0;\n    i = 0;\n    cin >> a[0];\n    if (a[0] != -1) {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[k] == 2 * a[j])\n            sum += 1;\n        }\n      }\n      cout << sum << \"\\n\";\n    } else\n      break;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = 0; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, c = 0, e = 0, n, l;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      e = e + 1;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (l = 0; l < e - 1; l++)\n      for (n = l + 1; n < e - 1; n++) {\n        if ((a[l] / a[n] == 2 && a[l] % a[n] == 0) ||\n            (a[n] / a[l] == 2 && a[n] % a[l] == 0))\n          c = c + 1;\n      }\n    printf(\"%d\\n\", c);\n\n    e = c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16];\n  int i, j, k, number;\n  for (k = 1; 1; k++) {\n\n    scanf(\"%d\", &shuzu[0]);\n    if (shuzu[0] == -1) {\n      break;\n    }\n    number = 1;\n    for (i = 1; i < 16; i++) { \n\n      scanf(\"%d\", &shuzu[i]);\n      if (shuzu[i] == 0) {\n        break;\n      } else\n        number++;\n    }\n\n    int zu = 0;\n    double a, b;\n    for (i = 0; i < number - 1; i++) {\n      for (j = number - 1; j > i; j--) {\n        a = (double)shuzu[i] / shuzu[j];\n        b = (double)shuzu[j] / shuzu[i];\n        if (a == 2 || b == 2) {\n          zu++;\n        }\n      }\n    }\n    printf(\"%d\\n\", zu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22481", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[16], b[100], changdu = 0, panduan = 1, geshu = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      changdu = i;\n      if (a[i] == -1) {\n        panduan = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        break;\n      }\n    }\n\n    if (panduan == 0)\n      break;\n\n    geshu = 0;\n\n    for (i = 0; i < changdu; i++) {\n      for (j = 0; j < changdu; j++) {\n        if (a[i] == a[j] * 2) {\n          geshu++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", geshu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22482", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[16], num, i = 1, j = 0, k = 0, l = 0;\n  while (cin >> a[0]) {\n    \n    num = 0;\n    \n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= 15; j++)\n      for (k = 0; k <= 15; k++)\n        if ((a[j] != 0) && (a[k] != 0) && (a[j] == 2 * a[k]))\n          num++;\n    for (l = 0; l <= 15; l++)\n      a[l] = 0;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char exp;\n  int i, c, t, w, n, s, t2, j, k, a[16];\n  long m, e;\n  float x, y;\n  double r, d, b, h, g[100];\n\n  for (;;) {\n    for (i = 0; i <= 15; i++)\n      a[i] = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = i;\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        if (a[j] == 2 * a[i])\n          s = s + 1;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  while (cin >> a[0] && a[0] != -1) {\n    int i = 0, j = 0, k = 0, n = 0;\n    for (i = 1; i <= 15; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (; j <= i - 1; j++) {\n      for (n = 0; n <= i - 1; n++)\n        if ((a[n] == 2 * a[j]) || (a[j] == 2 * a[n]))\n          k++;\n    }\n    k = k / 2;\n    cout << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22485", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16];\n  int i, j, k, number;\n  for (k = 1; 1; k++) {\n\n    scanf(\"%d\", &shuzu[0]);\n    if (shuzu[0] == -1)\n      break;\n\n    number = 1;\n    for (i = 1; i < 16; i++) {\n\n      scanf(\"%d\", &shuzu[i]);\n      if (shuzu[i] == 0) {\n        break;\n      } else\n        number++;\n    }\n\n    int zu = 0;\n    double a, b;\n    for (i = 0; i < number - 1; i++) {\n      for (j = number - 1; j > i; j--) {\n        a = (double)shuzu[i] / shuzu[j];\n        b = (double)shuzu[j] / shuzu[i];\n        if (a == 2 || b == 2) {\n          zu++;\n        }\n      }\n    }\n    printf(\"%d\\n\", zu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0;\n  int a[16];\n  for (;; i++) {\n    cin >> a[i];\n    if (a[i] == 0) {\n      cout << k << \"\\n\";\n      i = -1;\n      k = 0;\n    }\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n        k++;\n  }\n}\n"}
{"label": "12", "index": "22487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, temp, num[100];\n  for (k = 0; k <= 99; k++) {\n    num[k] = 0;\n    for (i = 0; i <= 15; i++) {\n      a[i] = 0;\n    }\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] <= 0)\n        break;\n    }\n    if (a[0] < 0)\n      break;\n    for (j = 0; j <= 13; j++) {\n      for (i = 0; i <= 13 - j; i++) {\n        if (a[i] < a[i + 1]) {\n          temp = a[i], a[i] = a[i + 1], a[i + 1] = temp;\n        }\n      }\n    }\n    for (i = 0; i <= 13; i++) {\n      for (j = 1; j <= 14 - i; j++) {\n        if (a[i] == 2 * a[i + j] && a[i + j] > 0)\n          num[k] = num[k] + 1;\n        else\n          num[k] = num[k];\n      }\n    }\n  }\n  for (i = 0; i <= k - 1; i++) {\n    cout << num[i] << endl;\n  }\n}\n"}
{"label": "12", "index": "22488", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  double a[15], num, cnt;\n  int i;\n  for (int n = 0; n <= 99999; n++) {\n    cnt = 0;\n    for (i = 0; i <= 15; i++) {\n      cin >> num;\n      if (num == 0)\n        break;\n      else\n        a[i] = num;\n    }\n    if (a[0] == -1)\n      break;\n    else {\n      for (int j = 0; j <= i - 1; j++)\n        for (int k = 0; k <= i - 1; k++)\n          if (a[j] == 2 * a[k])\n            cnt++;\n    }\n    cout << cnt << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x1, x2, n[15], y;\n  int i;\n  int t;\n  while (1) {\n\n    i = 0;\n    while (1) {\n      cin >> t;\n      if (t == -1) {\n\n        return 0;\n      }\n      if (t == 0)\n        break;\n      else {\n        n[i] = t;\n        i++;\n      }\n    }\n    y = 0;\n    for (x1 = i - 1; x1 >= 0; x1--) {\n      for (x2 = x1 - 1; x2 >= 0; x2--) {\n        if (n[x1] == n[x2] * 2 || n[x2] == n[x1] * 2)\n          y += 1;\n      }\n    }\n    cout << y << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22490", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, num;\n  int sz[100] = {0};\n  int j, k;\n  int geshu = -1;\n  while (1) {\n    i = 0;\n    scanf(\"%d\", &num);\n    if (num == -1)\n      break;\n    sz[0] = num;\n    while (1) {\n      if (sz[i] == 0)\n        break;\n      i++;\n      scanf(\"%d\", &sz[i]);\n    }\n    for (k = 0; k <= i; k++) {\n      for (j = 0; j <= i; j++) {\n        if (sz[j] == 2 * sz[k]) {\n          geshu = geshu + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", geshu);\n    geshu = -1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d = 0, s[15], i, j;\n\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n\n    for (i = 1; s[i - 1] != 0; i++) {\n      scanf(\"%d\", &s[i]);\n    }\n\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if ((s[i] == s[j] * 2) && (s[i] != 0) && (s[j] != 0))\n          d++;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int a[100][20];\n  int num, temp, size, time = 0;\n  int i = 0, j = 0, k, l;\n\n  while (cin >> num) {\n    time = 0;\n    if (num == -1)\n      break;\n\n    else if (num != 0) {\n      a[i][j] = num;\n      j = j + 1;\n    }\n\n    else if (num == 0) {\n      size = j;\n\n      for (l = 0; l < size; l++)\n        for (j = 0; j + 1 < size; j++) {\n          if (a[i][j] > a[i][j + 1]) {\n            temp = a[i][j];\n            a[i][j] = a[i][j + 1];\n            a[i][j + 1] = temp;\n          }\n        }\n\n      for (k = 0; k < size; k++)\n        for (l = 0; l < size; l++) {\n          if (2 * a[i][k] == a[i][l])\n            time = time + 1;\n        }\n\n      printf(\"%d\\n\", time);\n      j = 0;\n      i = i + 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int i, cnt;\n  i = 0;\n  cnt = 0;\n  cin >> a[i];\n\n  while (a[i] != -1) {\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n    for (int j = 0; j <= i; j++) {\n      for (int k = 0; k <= i; k++) {\n        if (a[k] == 2 * a[j])\n          cnt++;\n      }\n    }\n    printf(\"%d\\n\", cnt - 1);\n    i = 0;\n    cnt = 0;\n    scanf(\"%d \", &a[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22494", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17] = {0}, count;\n  int i, j, k, two, num;\n  for (k = 1;; k++) {\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[1] == -1 || a[i] == 0) {\n        num = i;\n        break;\n      }\n    }\n    if (a[1] == -1)\n      break;\n    for (i = 1; i < num; i++) {\n      two = 2 * a[i];\n      for (j = 1; j < num; j++)\n        if (two == a[j]) {\n          count++;\n          break;\n        }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22495", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int a[16], i, j, k, n = 0;\n  do {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        return 0;\n    }\n    n = 0;\n    for (k = 0; k <= i - 1; k++) {\n      for (j = k + 1; j <= i - 1; j++) {\n        if (((a[k] * 2 == a[j]) || (a[k] == (2 * a[j]))) && (a[k] != 0))\n          n++;\n      }\n    }\n    printf(\"%d\\n\", n);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22496", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  \n  \n  int a[100][20];\n  int num, temp, size, time = 0;\n  int i = 0, j = 0, k, l;\n\n  \n  while (cin >> num) {\n    time = 0;      \n    if (num == -1) \n      break;\n\n    \n    else if (num != 0) {\n      a[i][j] = num;\n      j = j + 1;\n    }\n    \n    else if (num == 0) {\n      size = j; \n      \n      for (l = 0; l < size; l++)\n        for (j = 0; j + 1 < size;\n             j++) \n        {\n          if (a[i][j] > a[i][j + 1]) {\n            temp = a[i][j];\n            a[i][j] = a[i][j + 1];\n            a[i][j + 1] = temp;\n          }\n        }\n      \n      for (k = 0; k < size; k++)\n        for (l = 0; l < size; l++) {\n          if (2 * a[i][k] == a[i][l])\n            time = time + 1;\n        }\n\n      cout << time << endl; \n      j = 0;                \n      i = i + 1;            \n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, x, y, count = 0;\n  int a[16];\n  for (i = 1;; i++) {\n    count = 0;\n    for (j = 0;; j++) {\n      scanf(\"%d \", &a[j]);\n      if ((a[j] == 0) || (a[j] == -1))\n        break;\n    }\n\n    for (x = 0; x <= j - 1; x++) {\n      for (y = 0; y <= j - 1; y++) {\n        if (a[y] == a[x] * 2)\n          count = count + 1;\n      }\n    }\n    if (a[j] != -1)\n      printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[100][16];\n  int i, j, r, p;\n\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n\n    for (j = 1; n[i][j - 1] != 0; j++) {\n      cin >> n[i][j];\n    }\n    int t = 0;\n    for (r = 0; r < j - 1; r++) {\n      for (p = r + 1; p < j; p++) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n    for (r = j - 1; r > 0; r--) {\n      for (p = r - 1; p >= 0; p--) {\n        if (n[i][p] == 2 * n[i][r]) {\n          t++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20], i = 0, j = 0, n = 0;\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i = i++;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = i; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          n = n++;\n      }\n    }\n    cout << n << \"\\n\";\n    n = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, num[16], f;\n  scanf(\"%d\", &num[1]);\n  do {\n    k = 1;\n    f = 0;\n    do {\n      k++;\n      scanf(\"%d\", &num[k]);\n    } while (num[k] != 0);\n    for (i = 1; i <= k - 1; i++)\n      for (j = 1; j <= k - 1; j++)\n        if (num[i] == num[j] * 2)\n          f++;\n    printf(\"%d\\n\", f);\n    scanf(\"%d\", &num[1]);\n  } while (num[1] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][100], i, k, j, s[100], t, p, m, l[100];\n  double a;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%d\", &n[i][0]);\n    if (n[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 100; j++) {\n        scanf(\"%d\", &n[i][j]);\n        if (n[i][j] == 0)\n          break;\n        l[i] = j;\n      }\n    }\n  }\n\n  for (k = 0; k < i; k++) {\n    s[k] = 0;\n    for (t = 0; t <= l[k]; t++) {\n      for (m = t; m <= l[k]; m++) {\n        a = (double)n[k][t] / n[k][m];\n        if (a == 2 || a == 0.5)\n          s[k] = s[k] + 1;\n      }\n    }\n  }\n  for (p = 0; p < i; p++)\n    printf(\"%d\\n\", s[p]);\n  return 0;\n}\n"}
{"label": "12", "index": "22502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    int i = 0;\n    int a[20] = {0};\n    int sum = 0;\n    do {\n      cin >> a[i];\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[i - 1] == -1)\n      break;\n    for (int j = 0; j < i - 1; j++) {\n      for (int k = 0; k < i - 1; k++)\n        if (a[j] * 2 == a[k])\n          sum++;\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "12", "index": "22503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, num = 0, tot, a[16], b[1000];\n  do {\n    i = 0;\n    tot = 0;\n    do {\n      scanf(\"%d\", &a[i]);\n      i++;\n    } while (a[i - 1] > 0);\n    if (a[0] != -1) {\n      for (j = 0; j <= i - 3; j++)\n        for (k = j + 1; k <= i - 2; k++)\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            tot++;\n      b[num] = tot;\n      num++;\n    }\n  } while (a[0] != -1);\n  for (i = 0; i < num; i++)\n    printf(\"%d \", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a;\n  while (scanf(\"%d \", &a)) {\n    if (a != -1) {\n      int i = 0, j, k, p = 0;\n      int b[15] = {a};\n      while (b[i] != 0) {\n        scanf(\"%d \", &b[i + 1]);\n        i++;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (b[k] == 2 * b[j] || b[j] == 2 * b[k]) {\n            p = p + 1;\n          }\n      }\n      cout << p << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m;\n  for (i = 1;; i++) {\n    int num[16];\n    for (j = 1;; j++) {\n      cin >> num[j];\n      if (num[j] == 0)\n        break;\n    }\n    if (num[1] == -1)\n      break;\n    int cnt = 0;\n    for (k = 1; k <= j - 1; k++)\n      for (m = 1; m <= j - 1; m++) {\n        if (num[k] * 2 == num[m])\n          cnt++;\n      }\n    cout << cnt << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, a[100] = {0}, p;\n  cin >> p;\n  while (p > 0) {\n    for (i = 0; i < 100; i = i + 1)\n      a[i] = 0;\n    for (; p > 0;) {\n      a[p] = 1;\n      scanf(\"%d\", &p);\n    }\n    n = 0;\n    for (i = 1; i < 50; i = i + 1)\n      if (a[i] && a[2 * i])\n        n = n + 1;\n    printf(\"%d\\n\", n);\n    scanf(\"%d\", &p);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22507", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col;\n  int a, b;\n  int sz[100][100];\n  int sum[100];\n\n  for (row = 0; row < 100; row++) {\n    sum[row] = 0;\n  }\n\n  for (row = 0; row < 100; row++) {\n    for (col = 0; col < 100; col++) {\n      cin >> sz[row][col];\n      if (sz[row][col] == 0) {\n        break;\n      }\n      if (sz[row][0] == -1) {\n        break;\n      }\n    }\n    if (sz[row][0] == -1) {\n      break;\n    }\n    a = row;\n  }\n\n  for (row = 0; row <= a; row++) {\n    for (b = 0; b < 100; b++) {\n      for (col = 0; col < 100; col++) {\n        if (sz[row][b] == 2 * sz[row][col] && sz[row][b] != 0 &&\n            sz[row][col] != 0) {\n          sum[row]++;\n        }\n      }\n    }\n  }\n\n  for (row = 0; row <= a; row++) {\n    printf(\"%d\\n\", sum[row]);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22508", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[300], i, n, k, j;\n  for (i = 0; i <= 300; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] == -1)\n      break;\n  }\n  for (k = 0; k <= 300; k++) {\n    if (a[k] == -1)\n      break;\n    if (a[k - 1] == 0 || k == 0) {\n      n = 0;\n      for (i = k; a[i] != 0; i++) {\n\n        for (j = i; a[j] != 0; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            n = n + 1;\n        }\n      }\n      printf(\"%d\\n\", n);\n    }\n  }\n}\n"}
{"label": "12", "index": "22509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  while (1) {\n    int array[16] = {0};\n    int n = 0, sum = 0;\n    while (1) {\n      cin >> array[n];\n      if (array[n] == 0 || array[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array[i] == array[j] * 2) || (array[j] == array[i] * 2)) {\n          sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], column[100] = {0}, i = 0, l = 0, j, n, m, s = 0;\n  for (l = 0; l <= 15; l++) {\n    cin >> a[i][l];\n    if (a[i][l] == -1)\n      break;\n    else if (a[i][l] == 0) {\n      i++;\n      l = -1;\n    } else\n      column[i]++;\n  }\n  i--;\n  for (m = 0; m <= i; m++) {\n    s = 0;\n    for (j = 0; j <= column[m] - 1; j++)\n      for (n = j + 1; n <= column[m]; n++)\n        if (a[m][j] * 2 == a[m][n] || a[m][n] * 2 == a[m][j])\n          s = s + 1;\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22511", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k, l, m, s[100];\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1)\n        break;\n    }\n    if (a[i][j] == -1)\n      break;\n  }\n  for (k = 0; k < i; k++) {\n    for (l = 0; l < 16; l++) {\n      for (m = 0; m < 16; m++)\n        if ((a[k][m] != 0) && (a[k][l] / a[k][m] == 2) &&\n            (a[k][l] % a[k][m] == 0))\n          s[k]++;\n    }\n  }\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", s[k]);\n  return 0;\n}\n"}
{"label": "12", "index": "22512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i = 0, j = 0, n = 0;\n  while (scanf(\"%d\", &a[i]), a[i] != -1) {\n    while (scanf(\"%d\", &a[i + 1]), a[i + 1] != 0)\n      i = i++;\n    for (i = 0; a[i] != 0; i++)\n      for (j = i; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          n = n++;\n      }\n    printf(\"%d\\n\", n);\n    n = 0;\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22513", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, time = 0, sz[16], tmp, xh, m = 0, mp;\n  for (xh = 0; xh < 50; xh++) {\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0) {\n        for (mp = 0; mp < i; mp++) {\n          for (j = 0; j < i - 1; j++) {\n            if (sz[j] >= sz[j + 1]) {\n              tmp = sz[j];\n              sz[j] = sz[j + 1];\n              sz[j + 1] = tmp;\n            }\n          }\n        }\n        for (k = 0; k < i; k++) {\n          for (j = k; j < i; j++) {\n            if (sz[j] == 2 * sz[k])\n              time++;\n          }\n        }\n        printf(\"%d\\n\", time);\n        i = -1;\n        j = 0;\n        k = 0;\n        time = 0;\n        mp = 0;\n      }\n      if (sz[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n}\n"}
{"label": "12", "index": "22514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[2000];\n  int i, m, n, k, lt;\n  k = 0;\n  lt = 0;\n  for (i = 0; i < 2000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    if (a[i] == 0) {\n      for (m = lt; m < i; m++) {\n        for (n = lt; n < i; n++) {\n          if (a[m] == 2 * a[n])\n            k++;\n        }\n      }\n      cout << k << \"\\n\";\n      k = 0;\n      lt = i + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int key;\n  int number, total;\n  while ((scanf(\"%d \", &key)) && (key != -1)) {\n    int num[15];\n    num[0] = key;\n    int i = 1;\n    int flag1 = 0, flag2 = 0;\n    total = 0;\n    while ((cin >> number) && (number != 0)) {\n      num[i] = number;\n      i++;\n    }\n    for (int k = 0; k <= i - 2; k++) {\n      for (int r = k + 1; r <= i - 1; r++) {\n        flag1 = (num[r] == 2 * num[k]);\n        flag2 = (num[k] == 2 * num[r]);\n        if ((flag1 == 1) || (flag2 == 1)) {\n          total = total + 1;\n        }\n      }\n    }\n    cout << total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22516", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, n, b, c = 0, j = 0, k, a[1000][18];\n  scanf(\"%d \", &b);\n  while (b != -1) {\n    if (b != 0) {\n      a[i][j] = b;\n      j++;\n      a[i][17] = j;\n    } else {\n      a[i][j] = b;\n      i++;\n      n = i;\n      j = 0;\n    }\n    cin >> b;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < a[i][17] - 1; j++) {\n      for (k = j + 1; k < a[i][17]; k++) {\n        if (a[i][j] == 2 * a[i][k] || a[i][k] == 2 * a[i][j]) {\n          c++;\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22517", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20], n, r = 0, i, j, count = 0;\n  memset(a, 0, sizeof(a));\n  for (;;) {\n    scanf(\"%d\", &n);\n    if (n == -1)\n      break;\n    else if (n != 0) {\n      a[r] = n;\n      r++;\n      continue;\n    } else if (n == 0) {\n\n      for (i = 0; i < r - 1; i++) {\n        for (j = i + 1; j < r; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            count++;\n        }\n        a[i] = 0;\n      }\n      a[i] = 0;\n      printf(\"%d\\n\", count);\n      count = 0;\n      r = 0;\n      i = 0;\n      j = 0;\n      continue;\n    }\n  }\n}\n"}
{"label": "12", "index": "22518", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n = 0, a[16], shu, sum = 0;\n  while (1) {\n    cin >> shu;\n    if (shu == -1)\n      return 0;\n    else if (shu == 0) {\n      for (i = 1; i <= n; i++) {\n        if (a[i] && a[i] % 2 == 0) {\n          for (j = 1; j <= n; j++)\n            if (a[j] == a[i] / 2)\n              sum++;\n        }\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      n = 0;\n    } else {\n      n++;\n      a[n] = shu;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[16], i, n, a = 0, j;\n  scanf(\"%d\", &s[0]);\nloop:\n  a = 0;\n  i = 1;\n  do {\n    scanf(\" %d\", &s[i]);\n    i++;\n  } while (s[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - i; j++)\n      if (s[i] == 2 * s[i + j] || s[i + j] == s[i] * 2)\n        a = a + 1;\n  }\n  printf(\"%d\\n\", a);\n  scanf(\"%d\", &s[0]);\n  if (s[0] != -1)\n    goto loop;\n}\n"}
{"label": "12", "index": "22520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, m = 0, c[100][100], f[100] = {0};\n  for (j = 1;; j++) {\n    scanf(\"%d\", &c[j][1]);\n    if (c[j][1] == -1)\n      break;\n    for (i = 2;; i++) {\n      scanf(\"%d\", &c[j][i]);\n      if (c[j][i] == 0)\n        break;\n      for (l = i; l >= 1; l--)\n        if (c[j][l] == 2 * c[j][i] || c[j][i] == 2 * c[j][l])\n          f[j]++;\n    }\n    m++;\n  }\n  for (j = 1; j <= m; j++)\n    cout << f[j] << \"\\n\";\n}\n"}
{"label": "12", "index": "22521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i = 1, j = 0, k = 0, l = 0;\n  while (scanf(\"%d \", &a[0])) {\n\n    num = 0;\n\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= 15; j++)\n      for (k = 0; k <= 15; k++)\n        if ((a[j] != 0) && (a[k] != 0) && (a[j] == 2 * a[k]))\n          num++;\n    for (l = 0; l <= 15; l++)\n      a[l] = 0;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22522", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, k = 0, j, i, a[16], m = 0;\n  do {\n    for (i = 0; i <= 15; i++) {\n      cin >> a[i];\n      n++;\n      if (a[i] == 0)\n        break;\n      if (a[i] == (-1))\n        break;\n    }\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < n; j++) {\n      for (k = j + 1; k < n; k++) {\n        if (a[j] == a[k] * 2 || a[k] == a[j] * 2)\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    n = 0;\n  } while (a[0] != (-1));\n  return 0;\n}\n"}
{"label": "12", "index": "22523", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[15];\n  int i, NO, tmp, n, j;\n  while (1) {\n    n = 0;\n    scanf(\"%d\", &tmp);\n    a[0] = tmp;\n    if (tmp == -1)\n      break;\n\n    NO = 0;\n\n    \n    \n\n    \n\n    while (1) {\n      scanf(\"%d\", &tmp);\n      if (tmp == 0)\n        break;\n      a[++n] = tmp; \n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j <= n; j++)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          NO++;\n\n    printf(\"%d\\n\", NO);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "12", "index": "22524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, sz[15], i = 0, j, k, result = 0;\n\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    if (t != 0) {\n      sz[i] = t;\n      i++;\n    } else {\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (sz[k] == sz[j] * 2) {\n            result++;\n          }\n        }\n      }\n      printf(\"%d\\n\", result);\n      i = 0;\n      result = 0;\n    }\n    scanf(\"%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22525", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][16], b[100] = {0}, c[101], k, i, j, l, m;\n  for (i = 1; 1; i++) {\n    cin >> a[i][1];\n    if (a[i][1] == (-1)) {\n      i--;\n      break;\n    } else\n      for (j = 2; 1; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0) {\n          j = j - 1;\n          break;\n        }\n      }\n    c[i] = j;\n  }\n\n  for (k = 1; k <= i; k++) {\n    for (l = 1; l <= c[k]; l++) {\n\n      for (m = 1; m <= c[k]; m++) {\n        if (a[k][m] / a[k][l] == 2 && a[k][m] % a[k][l] == 0)\n          b[k] = b[k] + 1;\n        else\n          b[k] = b[k];\n      }\n    }\n\n    printf(\"%d\\n\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22526", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i, j, k, n, cnt = 0;\n  while (cin >> num) {\n    if (num == -1)\n      break;\n    for (i = 0; i <= 15; i++) {\n      if (num == 0)\n        break;\n      a[i] = num;\n      cin >> num;\n    }\n    for (j = 0; j < i - 1; j++) {\n      for (k = 1; k < i - j; k++) {\n        if ((a[j] == 2 * a[j + k]) || (a[j + k] == 2 * a[j]))\n          cnt++;\n      }\n    }\n    printf(\"%d\\n\", cnt);\n    cnt = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22527", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 0, n = 0, j, flag = 1;\n  while (flag) {\n    while (1) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == (-1)) {\n        flag = 0;\n        break;\n      } else if (a[i] == 0) {\n        for (j = 0; j <= i; j++)\n          a[j] = 0;\n        cout << n << endl;\n        n = 0;\n        i = 0;\n        break;\n      } else {\n        for (j = 0; j < i; j++) {\n          if ((a[j] == 2 * a[i]) || (a[i] == 2 * a[j]))\n            n++;\n        }\n      }\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22528", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15];\n  while (cin) {\n    int temp, num = 0, i = 0, j = 0, k = 0;\n    for (i = 0; cin >> a[i]; i++)\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0) {\n        for (j = 1; j < i; j++)\n          for (k = 0; k < i - j; k++)\n            if (a[k] > a[k + 1]) {\n              temp = a[k];\n              a[k] = a[k + 1];\n              a[k + 1] = temp;\n            }\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++)\n            if (a[j] * 2 == a[k])\n              num++;\n        }\n        cout << num << endl;\n        num = 0;\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, k, l;\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    l = 0;\n    if (a[0] != 0) {\n      for (i = 1; a[i - 1] != 0; i++) {\n        scanf(\"%d\", &a[i]);\n      }\n      for (j = 0; j <= i - 1; j++)\n        for (k = 0; k < j; k++)\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n            l++;\n      printf(\"%d\\n\", l);\n    } else\n      printf(\"%d\\n\", l);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22530", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17], b = 0, i, j, l, m = 0, q;\n  for (i = 0; i <= 16; i++)\n    a[i] = 0;\n\n  for (q = 0;; q++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      b = b + 1;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[0] == -1) {\n      goto lab;\n    }\n    for (j = 0; j < b; j++) {\n      for (l = j + 1; l < b; l++) {\n        if (a[j] == 2 * a[l] || a[l] == 2 * a[j]) {\n          m = m + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    b = 0;\n  }\nlab:;\n}\n"}
{"label": "12", "index": "22531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, flag = 1;\n  int a[16] = {0};\n  int c[100] = {0};\n  while (flag) {\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0) {\n        k++;\n        break;\n      }\n      for (j = i - 1; j > 0; j--) {\n        if (a[i] == 2 * a[j] || 2 * a[i] == a[j])\n          c[k]++;\n      }\n    }\n  }\n  for (i = 1; k > 0 && i < k; i++)\n    cout << c[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "12", "index": "22532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int i, j, m, n;\n\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1) {\n        return 0;\n      }\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    m = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[j] == (a[i] + a[i]))\n          m++;\n      }\n    }\n\n    { cout << m << \"\\n\"; }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, n, count;\n  while (1) {\n    count = 0;\n    i = 0;\n\n    while (1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0 || a[0] == -1)\n        break;\n    }\n    n = i - 1;\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] * 2 == a[j] || a[j] * 2 == a[i])\n          count++;\n      }\n\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][16] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},\n                   {0}, {0}, {0}, {0}, {0}, {0}, {0}},\n      c, m;\n  for (m = 0; m < 100; m++) {\n    for (c = 0; c < 16; c++) {\n      scanf(\"%d\", &a[m][c]);\n      if (a[m][c] <= 0)\n        break;\n    }\n    if (a[m][0] <= 0)\n      break;\n    int b, d, e, f = 0;\n    for (b = 0; b < c; b++) {\n      d = a[m][b] * 2;\n      for (e = 0; e < c; e++) {\n        if (d == a[m][e])\n          f++;\n      }\n    }\n    cout << f << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, x, j, g, k, b, a[15];\n  while (scanf(\"%d \", &x)) {\n    if (x == -1)\n      return 0;\n    else {\n      j = 0;\n      i = 0;\n      for (g = 0;; g++) {\n        a[i] = x;\n        i++;\n        scanf(\"%d \", &x);\n        if (x == 0)\n          break;\n      }\n      for (k = 0; k < i; k++) {\n        b = 2 * a[k];\n        for (g = 0; g < i; g++) {\n          if (a[g] == b)\n            j++;\n        }\n      }\n    }\n    cout << j << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22536", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, time = 0, sz[16], tmp, xh, m = 0, mp;\n  for (xh = 0; xh < 50; xh++) {\n    for (i = 0; i < 16; i++) {\n      cin >> sz[i];\n      if (sz[i] == 0) {\n        for (mp = 0; mp < i; mp++) {\n          for (j = 0; j < i - 1; j++) {\n            if (sz[j] >= sz[j + 1]) {\n              tmp = sz[j];\n              sz[j] = sz[j + 1];\n              sz[j + 1] = tmp;\n            }\n          }\n        }\n        for (k = 0; k < i; k++) {\n          for (j = k; j < i; j++) {\n            if (sz[j] == 2 * sz[k]) {\n              time++;\n            }\n          }\n        }\n        printf(\"%d\\n\", time);\n        i = -1;\n        j = 0;\n        k = 0;\n        time = 0;\n        mp = 0;\n      }\n      if (sz[i] == -1) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 1)\n      break;\n  }\n}\n"}
{"label": "12", "index": "22537", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i, j, count;\n  cin >> a[0];\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    cin >> a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  int sz[16], erbei[16], sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (0 == sz[i]) {\n      for (j = 0; j < i; j++) {\n        erbei[k] = 2 * sz[j];\n        k++;\n      }\n      for (k = 0; k < i; k++) {\n        for (j = 0; j < i; j++) {\n          if (erbei[k] == sz[j]) {\n            sum++;\n          }\n        }\n      }\n      printf(\"%d\\n\", sum);\n      sum = 0;\n      i = -1;\n      k = 0;\n    }\n    if (-1 == sz[i]) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22539", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, num, a[15];\n  while (scanf(\"%d \", &m)) {\n    if (m == -1)\n      return 0;\n    else {\n      int n = 1;\n      num = 0;\n      a[0] = m;\n      for (int i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        if (a[i] != 0)\n          n = n + 1;\n      }\n      for (int j = 0; j <= n; j++) {\n        for (int k = j + 1; k <= n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            num = num + 1;\n        }\n      }\n      cout << num << endl;\n    }\n  }\n}\n"}
{"label": "12", "index": "22540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], s, i, j, k, flag = 1;\n  while (flag) {\n    s = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      k = i;\n      if (a[i] == -1) {\n        flag = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n    if (flag) {\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++) {\n          if (a[i] == 2 * a[j])\n            s++;\n        }\n      cout << s << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[20], bn[100] = {0, 0, 0}, i, j, k, t = 1,\n             l; \n\n  for (t = 1;; t++) {\n    i = 1;\n    do { \n      scanf(\"%d\", &a[i - 1]);\n      if (a[i - 1] == -1)\n        break;\n      i++;\n    } while (a[i - 2] != 0);\n    if (a[i - 1] == -1)\n      break;\n    for (j = 1; j <= i - 2;\n         j++) \n    {\n      for (k = 1; k <= i - 2; k++) \n        if (a[j - 1] == 2 * a[k - 1])\n          bn[t - 1]++;\n    }\n  }\n  for (l = 1; l <= t - 1; l++)\n    printf(\"%d\\n\", bn[l - 1]);\n  return 0;\n}\n"}
{"label": "12", "index": "22542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20], temp, n = 0, i = 1, j, k;\n  do {\n    do {\n      cin >> temp;\n      a[i] = temp;\n      i++;\n\n    } while (temp != 0 && temp != -1);\n\n    for (j = 1; j < i - 2; j++) {\n      for (k = j + 1; k <= i - 2; k++) {\n        if ((a[j] / a[k] == 2 && a[j] % a[k] == 0) ||\n            (a[k] / a[j] == 2 && a[k] % a[j] == 0)) {\n          n++;\n        }\n      }\n    }\n    if (temp != -1) {\n      printf(\"%d\\n\", n);\n    }\n    i = 1;\n    n = 0;\n  } while (temp != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], x, i, j, t = 0;\n  for (;;) {\n    x = 1;\n    t = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n        x++;\n      }\n      for (i = 0; i < x - 1; i++) {\n        for (j = i + 1; j <= x - 1; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n    }\n  }\n}\n"}
{"label": "12", "index": "22544", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, num, a[17];\n  do {\n    i = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] > 0);\n    n = i - 1;\n    if (a[n + 1] != -1) {\n      num = 0;\n      for (i = 1; i <= n - 1; i++)\n        for (j = i + 1; j <= n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n            num++;\n          }\n      printf(\"%d \", num);\n    }\n  } while (a[n + 1] == 0);\n  return 0;\n}\n"}
{"label": "12", "index": "22545", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int m, n, a[15], x = 0, i, y = 0;\n  while (y != 1) {\n    for (m = 0;; m++) {\n      cin >> n;\n      if (n != 0 && n != -1) {\n        a[m] = n;\n        continue;\n      }\n      if (n == 0) {\n        break;\n      }\n      if (n == -1) {\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1) {\n      break;\n    }\n    for (m = 0; m <= 15; m++) {\n      for (i = 0; i <= 15; i++) {\n        if (a[m] * 2 == a[i] && a[m] != 0) {\n          x = x + 1;\n        }\n      }\n    }\n    for (m = 0; m <= 15; m++) {\n      a[m] = 0;\n    }\n    cout << x << endl;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, t, m, count[50], lie[20];\n  char p;\n  for (i = 0; i < 50; i++) {\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &lie[j]);\n      if (lie[0] == -1)\n        goto lalala;\n      scanf(\"%c\", &p);\n      if (p == '\\n')\n        break;\n    }\n    count[i] = 0;\n    for (l = 0; l < j; l++)\n      for (t = 0; t < j; t++)\n        if ((lie[l] - 2 * lie[t]) == 0)\n          count[i] = count[i] + 1;\n  }\nlalala:\n  for (m = 0; m < i; m++) {\n    cout << count[m];\n    if (m != i - 1)\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "12", "index": "22547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int str[20], doubl, num = 0, a, b, c;\n  while (1) {\n    num = 0;\n    scanf(\"%d\", &str[0]);\n    if (str[0] == -1)\n      break;\n    else\n      for (a = 1; str[a - 1] != 0; a++) {\n        scanf(\"%d\", &str[a]);\n      }\n\n    for (b = 0; b < a - 1; b++) {\n      doubl = 2 * str[b];\n      for (c = 0; c < a - 1; c++) {\n        if (str[c] == doubl)\n          num++;\n        else\n          num = num;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n  return 1;\n}\n"}
{"label": "12", "index": "22548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], num;\n  while (scanf(\"%d\", &a[0]), a[0] + 1) {\n    i = 1;\n    num = 0;\n    while (scanf(\"%d\", &a[i]), a[i]) {\n      i++;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int su[17] = {1};\n  int c[100];\n  int i, a, b, d, e = 0;\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n  for (d = 0; d < 100; d++) {\n    a = 0;\n    for (i = 1; su[i - 1] != 0; i++) {\n      scanf(\"%d\", &su[i]);\n      if (su[i] == -1) {\n        e = 1;\n        break;\n      }\n      a = a + 1;\n    }\n    if (e) {\n      break;\n    }\n    for (i = 1; i < a; i++) {\n      for (b = 1; b < a; b++) {\n        if (su[i] == 2 * su[b]) {\n          c[d] += 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i < d; i++) {\n    cout << c[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20], i, j, k, count;\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    count = 0;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[k] == 2 * a[j]) {\n          count += 1;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][20];\n  int i, j, k, n = 0;\n  int x[1000];\n  for (i = 0; i < 1000; i++) {\n    x[i] = 0;\n    for (j = 0; j < 20; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        n++;\n        break;\n      }\n      if (a[i][j] == -1)\n        break;\n    }\n    if (a[i][0] == -1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (k = 0; a[i][k] != 0; k++) {\n        if (a[i][j] == 2 * a[i][k])\n          x[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << x[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], x, i, j, t = 0;\n  for (;;) {\n    x = 1;\n    t = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n        x++;\n      }\n      for (i = 0; i < x - 1; i++) {\n        for (j = i + 1; j <= x - 1; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            t++;\n        }\n      }\n      cout << t << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid initarray(int a[], int b, int length); \nvoid base(int a[1000]);                     \nint twice(int a[1000]);                     \nint main(void)                              \n{\n  int a[1000];\n  int t[1000];\n  int i, j, k, l;\n  i = 0;\n  for (i = 0; i < 1000; i++) {\n    a[i] = -2;\n  }\n  i = 0;\n  k = -2;\n  while (a[i] != -1) {\n    while (k != 0) {\n      cin >> k;\n      a[i] = k;\n      i++;\n    }\n    base(a);\n    j = twice(a);\n    cout << j << endl;\n    initarray(a, -2, 1000);\n    i = 0;\n    k = -2;\n  }\n  return 1;\n}\n\nvoid initarray(int a[], int b, int length) {\n  int i;\n  for (i = 0; i < length; i++) {\n    a[i] = b;\n  }\n}\n\nvoid base(int a[1000]) {\n  int b[1000 + 1];\n  int i, j;\n  initarray(b, 0, 1000);\n  for (i = 0; i < 1000; i++) {\n    if (a[i] > 0) {\n      b[a[i]]++;\n    }\n  }\n  j = 0;\n  for (i = 0; i <= 1000; i++) {\n    if (b[i] == 1) {\n      a[j] = i;\n      j++;\n    }\n  }\n}\n\nint twice(int a[1000]) {\n  int i, j, t, result;\n\n  i = 0;\n  j = 0;\n  t = 0;\n  result = 0;\n  while ((a[i] <= 50) && (a[j] > 0)) {\n    t = a[i] * 2;\n    j = i;\n    while ((a[j] <= t) && (a[j] > 0)) {\n      if (a[j] == t) {\n        result++;\n      };\n      j++;\n    }\n    j = 0;\n    i++;\n  }\n  return result;\n}\n"}
{"label": "12", "index": "22554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[16];\n\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\n\nint main() {\n  int n;\n  while (cin >> n && n != -1) {\n    memset(num, 0, sizeof num);\n    num[0] = n;\n    int count = 0;\n    int i = 1;\n    for (; cin >> n && n != 0; i++)\n      num[i] = n;\n    qsort(num, i, sizeof(int), Compare);\n\n    for (int j = 0; j < i - 1; j++) {\n      int temp = num[j];\n      for (int k = j + 1; k < i; k++) {\n        if (num[k] == temp * 2) {\n          count++;\n          break;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[100] = {0}, index = 0, sum = 0;\n  char c;\n  for (; num[0] != -1;) {\n    while (true) {\n      cin >> num[index++];\n      scanf(\"%c\", &c);\n      if (c == '\\n')\n        break;\n    }\n    for (int i = 0; i < index; i++) {\n      for (int j = 0; j < index; j++) {\n        if (num[i] == (2 * num[j]) || (2 * num[i]) == num[j]) {\n          sum++;\n        }\n      }\n    }\n    if (num[0] == -1) {\n      return 0;\n    } else\n      printf(\"%d\\n\", (sum - 1) / 2);\n    sum = 0;\n    index = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int i = 0;\n  while (cin >> a[i]) {\n    int i = 0, j = 0;\n    if (a[i] == -1)\n      return 0;\n    do {\n      i++;\n      j++;\n      cin >> a[i];\n    } while (a[i]);\n\n    int y, z, k = 0;\n    for (z = 0; z <= j - 1; z++)\n      for (y = z + 1; y <= j - 1; y++)\n        if (a[z] == 2 * a[y] || a[y] == 2 * a[z])\n          k++;\n\n    cout << k << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22557", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, m, n, sum = 0;\n  int a[20][20], b[20];\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1) {\n        m = i;\n        break;\n      }\n      if (a[i][j] == 0) {\n        b[i] = j;\n        break;\n      }\n    }\n    if (a[i][j] == -1)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    for (j = 0; j < b[i]; j++) {\n      for (k = 0; k <= j; k++) {\n        if (a[i][j] % a[i][k] == 0 && a[i][j] / a[i][k] == 2)\n          sum++;\n        else {\n          if (a[i][k] % a[i][j] == 0 && a[i][k] / a[i][j] == 2)\n            sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22558", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[16];\n  while (1) {\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    int count = 0;\n    for (int m = 0; m < i; m++) {\n      for (int n = 0; n < i; n++) {\n        if (a[m] == a[n] * 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\nend:\n  return 0;\n}\n"}
{"label": "12", "index": "22559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, tot, s;\n  a = 0;\n  int num[20] = {0};\n  while (a != -1) {\n    j = 1;\n    tot = 1;\n    s = 0;\n    for (i = 1; i <= 20; i++)\n      num[i] = 0;\n    i = 1;\n    scanf(\"%d \", &a);\n    while (a != -1) {\n      if (a != 0) {\n        num[i++] = a;\n        tot++;\n        cin >> a;\n      }\n\n      else\n        break;\n    }\n    if (a != -1) {\n      for (j = 1; j <= tot; j++)\n        for (k = j + 1; k <= tot; k++)\n          if ((num[k] == 2 * num[j]) || (2 * num[k] == num[j]))\n            s++;\n      cout << s << \"\\n\";\n    }\n  }\n  cin >> s;\n  return 0;\n}\n"}
{"label": "12", "index": "22560", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 100, nfa[n];\n  int a[n][16];\n  memset(a, -100, sizeof(a));\n  memset(nfa, 0, sizeof(nfa));\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < 16; j++) {\n      cin >> a[i][j];\n      if (a[i][0] == -1) {\n        n = i;\n        break;\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n  for (int i = 0; i < n; i++)\n    for (int k = 0; k < 16; k++)\n      for (int j = 0; j < 16; j++)\n        if (a[i][j] == 2 * a[i][k])\n          nfa[i]++;\n  for (int i = 0; i < n; i++)\n    printf(\"%d\\n\", nfa[i] - 1);\n  return 0;\n}\n"}
{"label": "12", "index": "22561", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int count = 0, num[20][16], i, j, t;\n  for (i = 0; i < 16; i++) {\n    scanf(\"%d\", &num[0][i]);\n    if (num[0][i] == 0)\n      break;\n  }\n\n  for (i = 1; i < 20; i++) {\n    if (num[i - 1][0] != -1) {\n      for (j = 0; j < 16; j++) {\n        scanf(\"%d\", &num[i][j]);\n        if (num[i][j] == 0 || num[i][j] == -1)\n          break;\n      }\n    } else\n      break;\n  }\n\n  for (i = 0; i < 20; i++) {\n    if (num[i][0] == -1)\n      break;\n    else {\n      for (j = 0; j < 16; j++) {\n        if (num[i][j] == 0)\n          break;\n        else {\n          for (t = 0; t < 16; t++) {\n            if (num[i][t] == 0)\n              break;\n            else {\n              if (num[i][t] == 2 * num[i][j])\n                count++;\n            }\n          }\n        }\n      }\n\n      printf(\"%d\\n\", count);\n      count = 0;\n    }\n  }\n}\n"}
{"label": "12", "index": "22562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][15], b[100] = {0}, i, j, k, s, m = 0, x;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1;; j++) {\n        b[m]++;\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n        else\n          continue;\n      }\n      m++;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    x = 0;\n    for (j = 0; j < b[i]; j++) {\n      s = 0;\n      for (k = 0; k < b[i]; k++) {\n        if (a[i][k] * 2 == a[i][j])\n          s = s + 1;\n      }\n      x = x + s;\n    }\n    cout << x << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, count = 0;\n  while (true) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    i = 1;\n    while (true) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      i++;\n    }\n\n    count = 0;\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] * 2 == a[j])\n          count++;\n      }\n    }\n\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number[16] = {0};\n  int m, i = 1;\n  while (m != -1) {\n    do {\n      scanf(\"%d \", &m);\n      number[i] = m;\n      i++;\n    } while (m != 0 && m != -1);\n    int k = 1, t, j = 0;\n    for (k = 1; k <= i - 1; k++) {\n      t = number[k];\n      int p;\n      for (p = 1; p <= i - 1; p++) {\n        if (t == 2 * number[p]) {\n          j++;\n        } else\n          continue;\n      }\n    }\n    if (m != -1) {\n      cout << j - 1 << \"\\n\";\n    } else\n      break;\n    i = 1;\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15], i = 1, j, k, *p, count = 0;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    p = a;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (p[j] == p[k] * 2)\n          count++;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22566", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2},\n      sum = 0, i, j, s, t;\n\nA:\n  for (i = 0; a[i] != -1; i++) {\n    sum = 0;\n    a[0] = -2;\n    a[1] = -2;\n    a[2] = -2;\n    a[3] = -2;\n    a[4] = -2;\n    a[5] = -2;\n    a[6] = -2;\n    a[15] = -2;\n    a[7] = -2;\n    a[8] = -2;\n    a[9] = -2;\n    a[10] = -2;\n    a[11] = -2;\n    a[12] = -2;\n    a[13] = -2;\n    a[14] = -2;\n    for (s = 0; s <= 15; s++) {\n      scanf(\"%d\", &a[s]);\n      if (a[s] == 0) {\n        for (t = 0; t <= 15; t++) {\n          for (j = 0; j <= 15; j++) {\n            if (a[j] != 0 && a[t] != 0 && a[t] == a[j] * 2)\n              sum++;\n          }\n        }\n        printf(\"%d\\n\", sum);\n        break;\n      } else if (a[s] == -1)\n        goto A;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a[100];\n  int i, j, t;\n  do {\n    t = 0;\n    for (i = 0; i <= 99; i++) {\n      scanf(\"%f\", &a[i]);\n      if (i >= 1) {\n        if (a[i] == 0)\n          break;\n\n        for (j = 0; j <= i - 1; j++) {\n          if ((a[i] == 2 * a[j]) || (a[i] == a[j] / 2))\n            t = t + 1;\n        }\n      }\n    }\n    if (a[0] != -1)\n      printf(\"%d\\n\", t);\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22568", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  double a[16];\n  while (cin >> a[0]) {\n    if (a[0] == -1)\n      break;\n    else {\n      int count = 0, i = 0;\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      for (int j = 0; j < i - 1; j++) {\n        for (int k = j + 1; k < i; k++) {\n          if ((a[k] / a[j] == 2) || (a[j] / a[k] == 2))\n            count++;\n        }\n      }\n      cout << count << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22569", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, a[16], changdu = 0, panduan = 1, geshu = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      changdu = i;\n      if (a[i] == -1) {\n        panduan = 0;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n    }\n\n    if (panduan == 0)\n      break;\n\n    geshu = 0;\n\n    for (i = 0; i < changdu; i++) {\n      for (j = 0; j < changdu; j++) {\n        if (a[i] == a[j] * 2) {\n          geshu++;\n        }\n      }\n    }\n\n    printf(\"%d\\n\", geshu);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15][15],\n      i = 0, j = 0, s = 0, m = 0, h = 0,\n      g[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, b[15];\n  while (1) {\n    cin >> a[i][j];\n    if (a[i][j] == 0) {\n      b[i] = j;\n      i = i + 1;\n      j = 0;\n\n    } else if (a[i][j] == -1)\n      break;\n    else\n      j = j + 1;\n  }\n  for (s = 0; s < i; s++) {\n    for (m = 0; m < b[s]; m++) {\n      for (h = 0; h < b[s]; h++) {\n        if (a[s][m] == 2 * a[s][h]) {\n          g[s] = g[s] + 1;\n        }\n      }\n    }\n  }\n  for (s = 0; s < i; s++) {\n    cout << g[s] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22571", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15] = {0}, n;\n\n  while (1) {\n    n = 0;\n    for (int i = 0; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    for (int j = 0; j <= 15; j++) {\n      if (a[j] == 0 || a[j] == -1)\n        break;\n      for (int k = j + 1; k <= 15; k++) {\n        if (a[k] == 0)\n          break;\n        else if (a[k] * 2 == a[j] || a[j] * 2 == a[k])\n          n++;\n      }\n    }\n    if (a[0] != -1) {\n      printf(\"%d\\n\", n);\n      for (int i = 0; i <= 15; i++)\n        a[i] = 0;\n      n = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, i = 0, j = 0, n = 0, k = 0;\n  do {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n\n    for (i = 1; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n\n    n = 0;\n    for (k = 0; k < i; k++)\n      for (j = 0; j < i; j++) {\n        if (a[k] == 2 * a[j])\n          n++;\n      }\n    cout << n << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, n, count;\n  while (1) {\n    count = 0;\n    i = 0;\n\n    while (1) {\n      scanf(\"%d \", &a[i++]);\n      if (a[i - 1] == 0 || a[0] == -1)\n        break;\n    }\n    n = i - 1;\n\n    if (a[0] == -1)\n      break;\n\n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] * 2 == a[j] || a[j] * 2 == a[i])\n          count++;\n      }\n\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() { \n  int a[16], j;\n  while (cin >> a[0]) { \n    if (a[0] == -1)\n      break; \n    int i = 1;\n    int l = 0;\n    while (cin >> a[i]) {\n      if (a[i] == 0)\n        break;                \n      for (j = 0; j < i; j++) \n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          l = l + 1;\n      i++;\n    }\n    cout << l << endl;\n  }\n  return 0;\n} \n"}
{"label": "12", "index": "22575", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[1000], n, b[15], m, i, j, z, num = 0;\n  memset(a, 0, 1000 * sizeof(int));\n  memset(b, 0, 15 * sizeof(int));\n  while (1) {\n    i = 0;\n    do {\n\n      cin >> m;\n      if (m == 0)\n        break;\n      if (m == -1)\n        break;\n      b[i] = m;\n      i++;\n\n    } while (1);\n    if (m == -1)\n      break;\n\n    for (j = 0; j < i; j++) {\n      for (z = 0; z < i; z++) {\n        if (b[j] * 2 == b[z])\n          a[num]++;\n      }\n    }\n    num++;\n  }\n  for (j = 0; j < num; j++)\n    printf(\"%d\\n\", a[j]);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x1, x2, n[15], y;\n  int i;\n  int t;\n  while (1) {\n\n    i = 0;\n    while (1) {\n      scanf(\"%d \", &t);\n      if (t == -1) {\n\n        return 0;\n      }\n      if (t == 0)\n        break;\n      else {\n        n[i] = t;\n        i++;\n      }\n    }\n    y = 0;\n    for (x1 = i - 1; x1 >= 0; x1--) {\n      for (x2 = x1 - 1; x2 >= 0; x2--) {\n        if (n[x1] == n[x2] * 2 || n[x2] == n[x1] * 2)\n          y += 1;\n      }\n    }\n    cout << y << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum, i, j;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d\", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16];\n  int i, j, num;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[0] == -1)\n        return 0;\n      if (a[i] == 0)\n        break;\n    }\n    num = 0;\n    for (i = 0; a[i]; i++)\n      for (j = 0; a[j]; j++)\n        if (a[i] == 2 * (a[j]))\n          num++;\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int t;\n  int n = 0;\n  int m;\n  int d[100] = {0};\n  int q[100] = {0};\n  int i;\n  int z = 0;\n  int x = 0;\n\n  t = 0;\n  do {\n    i = 0;\n    do {\n      scanf(\"%d\", &c[t][i]);\n      if (c[t][0] == -1) {\n        break;\n      }\n      if (c[t][i] == 0) {\n        break;\n      }\n      i++;\n      d[t]++;\n    } while (i <= 100);\n    if (c[t][0] == -1) {\n      break;\n    }\n    t++;\n    n++;\n  } while (t <= 100);\n  do {\n    i = 0;\n    do {\n      m = 0;\n      do {\n        if ((c[z][i] * 2) == c[z][m]) {\n          q[z]++;\n        }\n        m++;\n      } while (m <= d[z] - 1);\n      i++;\n    } while (i <= d[z] - 1);\n    z++;\n  } while (z <= n - 1);\n  while (x <= n - 1) {\n    printf(\"%d\\n\", q[x]);\n    x++;\n  }\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "12", "index": "22580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int data;\n  int a[15];\n  int i = 0;\n  int j, k;\n  while (scanf(\"%d\", &data) != EOF) {\n    if (data == -1)\n      break;\n    else {\n      if (data != 0) {\n        a[i] = data;\n        i++;\n      } else {\n        int tmp;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] > a[k]) {\n              tmp = a[k];\n              a[k] = a[j];\n              a[j] = tmp;\n            };\n          }\n        }\n        int cnt = 0;\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++) {\n            if (a[j] * 2 == a[k]) {\n              cnt++;\n              break;\n            }\n            if (a[j] * 2 < a[k])\n              break;\n          }\n        }\n        cout << cnt << \"\\n\";\n        cnt = 0;\n        i = 0;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int c[100];\n  int m, z;\n  for (m = 0;; m++) {\n    int i, j, k, n;\n    int a[17], b[17];\n    n = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1) {\n      goto end;\n    } else {\n      for (i = 1; a[i - 1] != 0; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == -1) {\n          goto end;\n        }\n        b[i] = 2 * a[i];\n      }\n      for (j = 0; j < i - 1; j++) {\n        for (k = 0; k < i - 1; k++) {\n          if (b[k] == a[j])\n            n++;\n        }\n        c[m] = n;\n      }\n    }\n  }\nend:\n  for (z = 0; z < m; z++)\n    printf(\"%d \", c[z]);\n}\n"}
{"label": "12", "index": "22582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  int i = 0;\n  while (cin >> a[i]) {\n    int i = 0, j = 0;\n    if (a[i] == -1)\n      return 0;\n    do {\n      i++;\n      j++;\n      scanf(\"%d \", &a[i]);\n    } while (a[i]);\n\n    int y, z, k = 0;\n    for (z = 0; z <= j - 1; z++)\n      for (y = z + 1; y <= j - 1; y++)\n        if (a[z] == 2 * a[y] || a[y] == 2 * a[z]) {\n          k++;\n        }\n    cout << k << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22583", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int in;\n  cin >> in;\n  while (in != -1) {\n    int a[15];\n    int i = 0, num, count = 0;\n    while (in != 0) {\n      a[i] = in;\n      i++;\n      cin >> in;\n    }\n    num = i;\n    for (int p = 0; p < num; p++) {\n      if (a[p] % 2 == 1)\n        continue;\n      for (int q = 0; q < num; q++) {\n        if (a[p] == a[q] * 2)\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n    cin >> in;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, n;\n  double f[15];\n  scanf(\"%d \", &a);\n  while (a != -1) {\n    i = 0;\n    while (a != 0) {\n      f[i] = a;\n      i++;\n      scanf(\"%d \", &a);\n    }\n    j = i;\n    n = 0;\n    for (i = 0; i < j; i++) {\n      for (k = i + 1; k < j; k++) {\n        f[k] = f[k] * 1.0;\n        if ((f[k] / f[i]) == 2.0 || (f[i] / f[k]) == 2.0)\n          n = n + 1;\n      }\n    }\n    cout << n << endl;\n    cin >> a;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "12", "index": "22585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l, k, g[1000][16], o;\n  for (i = 0; i <= 999; i++) {\n    int s = 0;\n    for (l = 0; l < 16; l++) {\n      cin >> g[i][l];\n      if (g[i][l] == 0)\n        break;\n    }\n    if (g[i][0] == -1)\n      break;\n\n    for (o = 0; o < 14 && g[i][o] > 0; o++) {\n      for (k = o + 1; k < 15; k++) {\n        if (g[i][k] - 2 * g[i][o] == 0 || g[i][o] - 2 * g[i][k] == 0)\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "12", "index": "22586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t = 0, k, m;\n  int a[100][100];\n  for (j = 0; j < 100; j++) {\n    cin >> a[t][j];\n    if (a[t][j] == 0) {\n      t = t + 1;\n    }\n    if (a[t][j] == -1) {\n      break;\n    }\n  }\n  for (k = 0; k < t; k++) {\n    m = 0;\n    for (i = 0; i < 100; i++) {\n      for (j = 0; j < 100; j++) {\n        if (a[k][i] == 2 * a[k][j] && a[k][i] != 0)\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[20], i, j, n, c, t;\n  do {\n    scanf(\"%d\", &c);\n    num[0] = c;\n    n = 1;\n    while (c != 0) {\n      scanf(\"%d\", &c);\n      if (c == -1)\n        return 0;\n      num[n] = c;\n      n++;\n    }\n    t = 0;\n    for (i = n - 2; i >= 0; i--)\n      for (j = n - 2; j >= 0; j--)\n        if (num[i] == 2 * num[j])\n          t++;\n    printf(\"%d\\n\", t);\n  } while (c != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22588", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, b, j, k, m;\n  a[1] = 1;\n  while (a[1] != -1) {\n    i = 1;\n    m = 0;\n    while (cin >> b) {\n      a[i] = b;\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n      i = i + 1;\n    }\n    for (j = 1; j <= i - 1; j++) {\n      for (k = 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          m++;\n      }\n    }\n    if (a[i] != -1) {\n      printf(\"%d\\n\", m);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[16];\n  int i, j, n, sum;\n  for (;;) {\n    sum = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if ((num[i] == 0) || (num[i] == -1))\n        break;\n    }\n    if (num[i] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j <= n - 1; j++) {\n        if ((num[j] == num[i] * 2) || (num[i] == num[j] * 2))\n          sum = sum + 1;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22590", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, k, m, n, count;\n  for (i = 0;; i++) {\n    cin >> m;\n    if (m == -1) {\n      break;\n    } else {\n      count = 0;\n      a[0] = m;\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d \", &a[j]);\n        if (a[j] == 0) {\n          break;\n        }\n      }\n\n      n = j;\n      for (j = 0; j < n; j++) {\n        for (k = j + 1; k < n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n            count++;\n          }\n        }\n      }\n\n      printf(\"%d\\n\", count);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16], sign = 1, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;;) {\n      cin >> a[i];\n      sign = a[i];\n      if (sign == 0 || sign == -1)\n        break;\n      else\n        i++;\n    }\n    if (sign == -1)\n      break;\n    else {\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      cout << num << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, c = 0, e = 0, n, l;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      e = e + 1;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (l = 0; l < e - 1; l++)\n      for (n = l + 1; n < e - 1; n++) {\n        if ((a[l] / a[n] == 2 && a[l] % a[n] == 0) ||\n            (a[n] / a[l] == 2 && a[n] % a[l] == 0))\n          c = c + 1;\n      }\n    printf(\"%d\\n\", c);\n    int a[16] = {0};\n    e = c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22593", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[16], i, j, k, m;\n  for (;;) {\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] % 2 == 0) {\n        for (k = 0; k < i; k++) {\n          if ((a[j] / 2) == a[k])\n            m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22594", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  while (a != -1) {\n    int s[15] = {0};\n    int l = 1, m = 0;\n    s[0] = a;\n    do {\n      cin >> a;\n      s[l] = a;\n      l++;\n    } while (a != 0);\n    for (int i = 0; i < 15; i++)\n      for (int j = 0; j < 15; j++)\n        if (s[j] == 2 * s[i] && s[i] != 0)\n          m++;\n    printf(\"%d\\n\", m);\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22595", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, a[100][16], K, I, b[100] = {0};\n  for (i = 0;; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    for (j = 1;; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (K = 0; K <= j - 1; K++) {\n        if (a[i][K] == 2 * a[i][k])\n          b[i]++;\n      }\n    }\n  }\n  for (I = 0; I < i; I++)\n    printf(\"%d\\n\", b[I]);\n  return 0;\n}\n"}
{"label": "12", "index": "22596", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16]; \n  int num = 0;\n  int s;    \n  int i, j; \n  cin >> a[num];\n  while (a[num] != -1) {\n    while (a[num] != 0) {\n      num++;\n      cin >> a[num];\n    }\n    num--; \n    s = 0;\n    for (i = 0; i <= num; i++)\n      for (j = 0; j <= num; j++)\n        if (a[i] == a[j] * 2)\n          s++;\n    cout << s << endl;\n    num = 0;\n    cin >> a[num];\n  }\n}\n"}
{"label": "12", "index": "22597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[16], i, a, num = 0, no = 0, j;\n  while (1) {\n    cin >> a;\n    if (a == -1)\n      return 0;\n    else {\n      if (a > 0) {\n        sz[no] = a;\n        no++;\n      } else if (a == 0) {\n        for (i = 0; i < no; i++) {\n\n          for (j = 0; j < no; j++)\n            if (sz[i] == 2 * sz[j])\n              num++;\n        }\n\n        cout << num << \"\\n\";\n        no = 0;\n        num = 0;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22598", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], j, k, sum;\n  while (true) {\n    cin >> a[0];\n    if (a[0] != -1) {\n      int i;\n      for (i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      sum = 0;\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (a[j] == 2 * a[k] || a[k] == a[j] * 2)\n            sum = sum + 1;\n      }\n      printf(\"%d\\n\", sum);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i, j, count;\n  scanf(\"%d \", &a[0]);\n  while (a[0] != -1) {\n    count = 0;\n    for (i = 1;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    for (i = 0; a[i] != 0; i++) {\n      for (j = 0; a[j] != 0; j++) {\n        if (a[i] == 2 * a[j]) {\n          count++;\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n    cin >> a[0];\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, h;\n  int b[16] = {0};\n  while (1) {\n    i = 0;\n    while (cin >> a) {\n      if (a == (-1))\n        return 0;\n      else {\n        if (a != 0) {\n          b[i] = a;\n          i++;\n        } else\n          break;\n      }\n    }\n    h = 0;\n\n    for (j = 0; j <= i - 1; j++) {\n      if (b[j] != 0) {\n        for (k = 0; k <= i - 1; k++) {\n          if (b[j] == b[k] * 2)\n            h++;\n        }\n      } else\n        break;\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22601", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[16], n, i, j, m, num;\n  n = 0;\n  m = 1;\n  do {\n    i = 0;\n    n = 0;\n    do {\n      cin >> c[i];\n      i++;\n    } while (c[i - 1] != 0 && c[0] != -1 && i < 16);\n    num = i - 1;\n    if (c[0] != -1) {\n      for (i = 0; i < num; i++) {\n        for (j = i + 1; j < num + 1; j++) {\n          if (c[i] > 0 && c[j] > 0)\n            if (c[i] == c[j] * 2 || c[j] == c[i] * 2)\n              n++;\n        }\n      }\n      printf(\"%d \", n);\n    } else\n      m = 0;\n  } while (m == 1);\n  return (0);\n}\n"}
{"label": "12", "index": "22602", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (int i = 0;; i++) {\n    int a[16];\n    int temp;\n    cin >> temp;\n    if (temp == -1)\n      break;\n    else\n      a[0] = temp;\n    int n = 1;\n    for (int j = 1;; j++) {\n      int temp1;\n      scanf(\"%d \", &temp1);\n      if (temp1 == 0)\n        break;\n      else {\n        a[j] = temp1;\n        n++;\n      }\n    }\n    int m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n\n        if ((a[i] == (2 * a[j])))\n          m++;\n      }\n    }\n    cout << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], b, n = 0, num = 0;\n  while (scanf(\"%d \", &b)) {\n    if (b == -1)\n      break;\n    else if (b == 0) {\n      for (int i = 0; i < n; i++)\n        for (int j = i; j < n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      n = 0;\n      cout << num << endl;\n      num = 0;\n    } else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, I, J, Count, Arr[15];\n  while (1) {\n    N = 0;\n    while (1) {\n      scanf(\"%d \", &Arr[N]);\n      if (Arr[N] == -1)\n        return 0;\n      if (Arr[N] == 0)\n        break;\n      N++;\n    }\n    Count = 0;\n    for (I = 0; I < N - 1; I++)\n      for (J = I + 1; J < N; J++)\n        if (Arr[I] == 2 * Arr[J] || Arr[J] == 2 * Arr[I])\n          Count++;\n    cout << Count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[50][16], b[50], c[50], i, j, m, n, o, line;\n  for (i = 0; i <= 49; i++) {\n    for (j = 0; j <= 15; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 || a[i][j] == -1) {\n        b[i] = j - 1;\n        c[i] = 0;\n        break;\n      }\n    }\n    if (a[i][0] == -1)\n      break;\n    line = i;\n  }\n  for (m = 0; m <= line; m++) {\n    for (n = 0; n <= b[m]; n++) {\n      for (o = 0; o <= b[m]; o++) {\n        if (a[m][n] == 2 * a[m][o])\n          c[m] = c[m] + 1;\n      }\n    }\n    cout << c[m] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int a[17] = {0};                  \n  while (cin >> a[0] && a[0] != -1) \n  {\n    int i = 0, j = 0, k = 0, n = 0; \n    for (i = 1; i <= 15; i++)       \n    {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }                       \n    for (; j <= i - 1; j++) \n    {\n      for (n = 0; n <= i - 1; n++)\n        if ((a[n] == 2 * a[j]) || (a[j] == 2 * a[n])) \n          k++;\n    }                  \n    k = k / 2;         \n    cout << k << endl; \n  }\n  return 0;\n} \n"}
{"label": "12", "index": "22607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, p = 0, a[10000][16];\n  for (j = 0; j < 10000; j++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[j][i]);\n      if ((a[j][i] == 0) || (a[j][i] == -1)) {\n        break;\n      }\n    }\n    if (a[j][0] == -1) {\n      break;\n    }\n  }\n  for (m = 0; m < j; m++) {\n    i = 0;\n    while (a[m][i] != 0) {\n      n = 0;\n      while (a[m][n] != 0) {\n        if (a[m][i] == 2 * a[m][n]) {\n          p++;\n        }\n        n++;\n      }\n      i++;\n    }\n    printf(\"%d\\n\", p);\n    p = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  float a[16];\n  int j, num;\n  while (1) {\n    num = 0;\n    for (int i = 0; i < 16; i++) {\n      scanf(\"%f \", &a[i]);\n      if (a[0] == -1)\n        break;\n      if (a[i] == 0) {\n        j = i - 1;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (int i = 0; i <= j; i++) {\n      for (int k = 0; k <= j; k++) {\n        if (a[i] / a[k] == 2 && i != k)\n          num++;\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22609", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[16];\n\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\n\nint main() {\n  int n;\n  while (cin >> n && n != -1) {\n    memset(num, 0, sizeof num);\n    num[0] = n;\n    int count = 0;\n    int i = 1;\n    for (; cin >> n && n != 0; i++)\n      num[i] = n;\n    qsort(num, i, sizeof(int), Compare);\n\n    for (int j = 0; j < i - 1; j++) {\n      int temp = num[j];\n      for (int k = j + 1; k < i; k++) {\n        if (num[k] == temp * 2) {\n          count++;\n          break;\n        }\n      }\n    }\n\n    cout << count << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22610", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i = 0, j, k, n, t = 0;\n  int a[16];       \n  while (cin >> n) \n  {\n    if (n != 0) \n    {\n      a[i] = n;\n      i++;\n    } else \n    {\n      for (j = 0; j < i - 1; j++) \n      {\n        for (k = j + 1; k <= i - 1; k++) \n        {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) \n            t++;\n        }\n      }\n      cout << t << endl; \n      t = 0;             \n      i = 0;             \n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint find(int *x, int y, int z) {\n  int count = 0;\n  for (int i = 0; i < y; i++) {\n    if (x[i] == z)\n      count++;\n  }\n  return count;\n}\n\nint count(int *x, int y) {\n  int count1 = 0;\n  for (int i = 0; i < y; i++) {\n    count1 += find(x, y, 2 * x[i]);\n  }\n  return count1;\n}\n\nint main() {\n  int temp[16];\n  int len = 0;\n  scanf(\"%d\", &temp[len]);\n  while (temp[len] != -1) {\n    while (temp[len] != 0) {\n      len++;\n      scanf(\"%d\", &temp[len]);\n    }\n    printf(\"%d\\n\", count(temp, len));\n    scanf(\"%d\", &temp[0]);\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[16] = {0}, n = 0, sum = 0;\nint main() {\n  int i, j;\n  while (1) {\n    n = 0;\n    sum = 0;\n    while (1) {\n      scanf(\"%d \", &array_1[n]);\n      if (array_1[n] == 0 || array_1[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array_1[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array_1[i] == array_1[j] * 2) || (array_1[j] == array_1[i] * 2)) {\n          sum++;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int iNum[20], i, j, n, iPair;\n  while (1) {\n    iPair = 0;\n    memset(iNum, 0, 80);\n    scanf(\"%d \", &iNum[0]);\n    n = 1;\n    if (iNum[0] == -1)\n      break;\n    do {\n      cin >> iNum[n];\n      n++;\n    } while (iNum[n - 1] != 0);\n    n--;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        if (iNum[j] == iNum[i] * 2)\n          iPair++;\n    cout << iPair << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[16];\n  int i, j, k, num;\n  for (; c[0] != (-1);) {\n    num = 0;\n    scanf(\"%d\", &c[0]);\n    if (c[0] == (-1))\n      break;\n    for (i = 1; i < 16; i++) {\n      cin >> c[i];\n      if (c[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (2 * c[k] == c[j])\n          num += 1;\n      }\n    }\n    cout << num << \"\\n\";\n  }\n}\n"}
{"label": "12", "index": "22615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[15];\n  int a, i, k, count = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a);\n    if (a == -1)\n      break;\n    else if (a == 0) {\n      i = -1;\n      printf(\"%d\\n\", count);\n      count = 0;\n      continue;\n    } else\n      sz[i] = a;\n    for (k = 0; k <= i; k++) {\n      if (sz[i] == sz[k] * 2 || sz[k] == sz[i] * 2)\n        count++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int shuzu[16];\n  int i, t, k, num = 0;\n\n  for (i = 0;; i++) {\n    scanf(\"%d\", &shuzu[i]);\n    if (shuzu[i] == -1) {\n      break;\n    }\n    if (shuzu[i] == 0) {\n\n      for (t = 0; t < i; t++) {\n        for (k = t + 1; k < i; k++) {\n          if (shuzu[t] == shuzu[k] * 2 || shuzu[t] * 2 == shuzu[k]) {\n            num++;\n          }\n        }\n      }\n      printf(\"%d\\n\", num);\n      num = 0;\n      i = -1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int flag;\n\n  cin >> flag;\n\n  while (flag != -1) {\n    a[0] = flag;\n    int i = 0;\n    int count = 0;\n\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          count++;\n        }\n      }\n    }\n\n    cout << count << endl;\n\n    cin >> flag;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22618", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, a[16], i, t, m, j, k, sum;\n  while (cin >> t) {\n    if (t != -1) \n    {\n      a[1] = t;\n      i = 1;\n      while (cin >> m) {\n        if (m != 0) \n        {\n          i = i + 1;\n          a[i] = m; \n        } else\n          break; \n      }\n      sum = 0;\n      for (j = 1; j <= i; j++)\n        for (k = 1; k <= i; k++) {\n          if (a[k] == 2 * a[j] || a[k] == 0.5 * a[j]) \n            sum = sum + 1;                            \n        }\n      cout << sum / 2 << endl; \n    } else {\n      cout << endl;\n      break;\n    } \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22619", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, k, m;\n  int a[100];\n\n  while (1) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    n = i;\n    for (i = n - 1; i > 0; i--) {\n      for (j = 0; j < i; j++) {\n        if (a[j] > a[j + 1]) {\n          k = a[j];\n          a[j] = a[j + 1];\n          a[j + 1] = k;\n        }\n      }\n    }\n    m = 0;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i]) {\n          m = m + 1;\n          break;\n        }\n        if (a[j] > 2 * a[i]) {\n          break;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, b, j, k, m;\n  a[1] = 1;\n  while (a[1] != -1) {\n    i = 1;\n    m = 0;\n    while (cin >> b) {\n      a[i] = b;\n      if (a[i] == 0 || a[i] == -1)\n        break;\n      i = i + 1;\n    }\n    for (j = 1; j <= i - 1; j++) {\n      for (k = 1; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          m++;\n      }\n    }\n    if (a[i] != -1)\n      cout << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22621", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[16] = {0};\nint main() {\n  while (scanf(\"%d \", &a[0])) {\n    if (a[0] == (-1))\n      break;\n    int i, j, countnumber = 0, countpair = 0;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    countnumber = i + 1;\n    for (i = 0; i < countnumber - 1; i++)\n      for (j = i + 1; j < countnumber; j++) {\n        if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n          countpair++;\n      }\n    printf(\"%d\\n\", countpair);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n;\n  int i;\n  cin >> a[0];\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    int cnt = 0, j;\n    for (i = 0; i <= n - 2; i++)\n      for (j = i + 1; j <= n - 1; j++) {\n        if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n          cnt++;\n      }\n    cout << cnt << \"\\n\";\n    for (i = 0; i <= 14; i++)\n      a[i] = 0;\n    cin >> a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], n, i, j, k;\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n      j = i;\n      for (i = 0; i < j - 1; i++) {\n        for (k = i + 1; k < j; k++) {\n          if (a[k] == 2 * a[i] || a[i] == 2 * a[k])\n            n++;\n        }\n      }\n      cout << n << \" \";\n    }\n  }\n}\n"}
{"label": "12", "index": "22624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[15];\n  scanf(\"%d\", &p[0]);\n  int i;\n  int l = 0;\n  for (i = 1; i < 15; i++) {\n    int a;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n    else {\n      p[i] = a;\n      l++;\n    }\n  };\n  int j, m, max;\n  for (j = 0; j < l - 1; j++) {\n    for (m = j + 1; m < l; m++)\n      if (p[j] > p[m]) {\n        max = p[j];\n        p[j] = p[m];\n        p[m] = max;\n      }\n  }\n  int num = 0;\n  int k, n;\n  for (k = 0; k < l - 1; k++) {\n    for (n = k + 1; n < l; n++) {\n      if ((p[n] / p[k]) == 2 && p[n] % p[k] == 0)\n        num++;\n      if (p[n] / p[k] > 2)\n        break;\n    }\n  }\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "12", "index": "22625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, counter;\n  for (;;) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      counter = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          break;\n        }\n      }\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n            counter = counter + 1;\n        }\n      }\n      printf(\"%d\\n\", counter);\n    }\n  }\n}\n"}
{"label": "12", "index": "22626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, counter;\n  for (;;) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      counter = 0;\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0)\n          break;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = 0; k < i; k++) {\n          if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n            counter = counter + 1;\n        }\n      }\n      printf(\"%d\\n\", counter);\n    }\n  }\n}\n"}
{"label": "12", "index": "22627", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15] = {0}, num = 1, num1 = 1, i = 1, k, j, c = 0;\n  while (num1 != -1) {\n    cin >> num1;\n    a[0] = num1;\n    while (num != 0) {\n      cin >> num;\n      a[i] = num;\n      i++;\n    }\n    for (k = 0; k <= i - 2; k++)\n      for (j = k + 1; j <= i - 2; j++)\n        if (a[k] == 2 * a[j] || a[j] == 2 * a[k])\n          c++;\n    printf(\"%d\\n\", c);\n    int a[15] = {0};\n    c = 0;\n    i = 1;\n    num = 1;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[500][15];\n  int i, j, t, number;\n  for (i = 0;; i++) {\n    number = 0;\n    scanf(\"%d \", &a[i][0]);\n    if (a[i][0] == -1) {\n      break;\n    }\n    for (j = 1;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        cout << number << \"\\n\";\n        break;\n      }\n      for (t = 0; t < j; t++) {\n        if (a[i][j] * 2 == a[i][t]) {\n          number++;\n          break;\n        }\n        if (a[i][j] == a[i][t] * 2) {\n          number++;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int t;\n  int n = 0;\n  int m;\n  int d[100] = {0};\n  int q[100] = {0};\n  int i;\n  int z = 0;\n  int x = 0;\n\n  t = 0;\n  do {\n    i = 0;\n    do {\n      scanf(\"%d\", &c[t][i]);\n      if (c[t][0] == -1) {\n        break;\n      }\n      if (c[t][i] == 0) {\n        break;\n      }\n      i++;\n      d[t]++;\n    } while (i <= 100);\n    if (c[t][0] == -1) {\n      break;\n    }\n    t++;\n    n++;\n  } while (t <= 100);\n  do {\n    i = 0;\n    do {\n      m = 0;\n      do {\n        if ((c[z][i] * 2) == c[z][m]) {\n          q[z]++;\n        }\n        m++;\n      } while (m <= d[z] - 1);\n      i++;\n    } while (i <= d[z] - 1);\n    z++;\n  } while (z <= n - 1);\n  while (x <= n - 1) {\n    printf(\"%d\\n\", q[x]);\n    x++;\n  }\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "12", "index": "22630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16] = {0}, b[16] = {0}, c[100] = {0}, i, n, j, k, l, num;\n  l = 0;\n  for (j = 0; j < 100; j++) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        break;\n      }\n      if (a[i] == 0) {\n        break;\n      }\n      n++;\n    }\n    num = 0;\n    for (i = 0; i < n; i++) {\n      b[i] = a[i];\n      for (k = 0; k < n; k++) {\n        if (b[i] == 2 * a[k])\n          num++;\n      }\n    }\n    c[j] = num;\n    l++;\n    if (a[0] == -1) {\n      break;\n    }\n  }\n  for (j = 0; j < l - 1; j++) {\n    printf(\"%d\\n\", c[j]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j, k, tot, s;\n  a = 0;\n  int num[20] = {0};\n  while (a != -1) {\n    j = 1;\n    tot = 1;\n    s = 0;\n    for (i = 1; i <= 20; i++)\n      num[i] = 0;\n    i = 1;\n    scanf(\"%d \", &a);\n    while (a != -1) {\n      if (a != 0) {\n        num[i++] = a;\n        tot++;\n        scanf(\"%d \", &a);\n      }\n\n      else\n        break;\n    }\n    if (a != -1) {\n      for (j = 1; j <= tot; j++)\n        for (k = j + 1; k <= tot; k++)\n          if ((num[k] == 2 * num[j]) || (2 * num[k] == num[j]))\n            s++;\n      cout << s << endl;\n    }\n  }\n  cin >> s;\n  return 0;\n}\n"}
{"label": "12", "index": "22632", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuru[20] = {0};\n\n  while (true) {\n    int i = 1, j, k, s, no;\n    s = 0;\n    cin >> shuru[0];\n    if (shuru[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> shuru[i];\n      if (shuru[i] == 0)\n        break;\n      for (j = 0; j < i; j++)\n        if ((shuru[j] == 2 * shuru[i]) || (2 * shuru[j] == shuru[i]))\n          s++;\n    }\n\n    cout << s << endl;\n    for (i = 0; i <= 14; i++) {\n      shuru[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[18], m, n, i, j, r = 0, b[100];\n  int t;\n  scanf(\"%d\", &t);\n  while (t != -1) {\n    m = 1;\n    r++;\n    n = 0;\n    a[0] = t;\n    for (i = 1; i < 18; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] != 0)\n        m = m + 1;\n      else\n        break;\n    }\n    for (i = 0; i < m; i++) {\n      for (j = m - 1; j > i; j--)\n        if (a[j] == 2 * a[i] || a[i] == 2 * a[j])\n          n++;\n    }\n    b[r] = n;\n    scanf(\"%d\", &t);\n  }\n  for (i = 1; i < r + 1; i++)\n    printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "12", "index": "22634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[15];\n  int i, j, temp, min, flag, twice;\n  for (;;) {\n\n    for (i = 0; i < 15; i++)\n      array[i] = 0;\n    for (i = 0;; i++) {\n      cin >> temp;\n      if (temp == -1)\n        return 0;\n      if (temp == 0)\n        break;\n      array[i] = temp;\n    }\n\n    for (i = 0; i < 15; i++) {\n      min = array[i];\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] < min) {\n          temp = min;\n          min = array[j];\n          array[j] = temp;\n        }\n      }\n      array[i] = min;\n    }\n\n    for (flag = 0, i = 0; i < 15; i++) {\n      if (array[i] == 0)\n        continue;\n      twice = array[i] * 2;\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] > twice)\n          break;\n        if (array[j] == twice)\n          flag++;\n      }\n    }\n    printf(\"%d\\n\\n\", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[16];\n  int i, j, n, sum;\n  for (;;) {\n    sum = 0;\n    for (i = 0;; i++) {\n      cin >> num[i];\n      if ((num[i] == 0) || (num[i] == -1)) {\n        break;\n      }\n    }\n    if (num[i] == -1) {\n      break;\n    }\n    n = i;\n    for (i = 0; i < n - 1; i++) {\n      for (j = i + 1; j <= n - 1; j++) {\n        if ((num[j] == num[i] * 2) || (num[i] == num[j] * 2)) {\n          sum = sum + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], x, i, j, k, l, n;\n  for (i = 0;; i++) {\n    n = 0;\n    j = 0;\n    while (cin >> x) {\n      if (x == 0 || x == -1)\n        break;\n      a[j] = x;\n      j++;\n    }\n    if (x == -1)\n      break;\n    for (k = 0; k < j; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          n = n + 1;\n      }\n    }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], k, m, n, j;\n  do {\n    j = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] != -1) {\n      for (k = 1; k <= 15; k++) {\n        cin >> a[k];\n        if (!a[k])\n          break;\n      }\n      for (m = 0; m < k - 1; m++) {\n        for (n = m + 1; n < k; n++) {\n          if ((a[m] - 2 * a[n] == 0) || (a[n] - 2 * a[m] == 0))\n            j++;\n        }\n      }\n      printf(\"%d\\n\", j);\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15][15],\n      i = 0, j = 0, s = 0, m = 0, h = 0,\n      g[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, b[15];\n  while (1) {\n    scanf(\"%d\", &a[i][j]);\n    if (a[i][j] == 0) {\n      b[i] = j;\n      i = i + 1;\n      j = 0;\n\n    } else if (a[i][j] == -1) {\n      break;\n    } else\n      j = j + 1;\n  }\n  for (s = 0; s < i; s++) {\n    for (m = 0; m < b[s]; m++) {\n      for (h = 0; h < b[s]; h++) {\n        if (a[s][m] == 2 * a[s][h]) {\n          g[s] = g[s] + 1;\n        }\n      }\n    }\n  }\n  for (s = 0; s < i; s++) {\n    printf(\"%d \", g[s]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[16], i, j, count, a, n;\n  while (1) {\n    count = 0;\n    n = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &num[i]);\n      if (num[i] == -1)\n        break;\n      if (num[i] == 0)\n        break;\n      n += 1;\n    }\n    if (num[0] == -1)\n      break;\n    else {\n      for (i = 0; i < n; i++) {\n        a = num[i];\n        for (j = 0; j < n; j++)\n          if (num[j] == 2 * a) {\n            count += 1;\n          }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][16], i, j, k;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1; j < 16; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] == 0)\n          break;\n      }\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n\n    int num = 0;\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 0; (j < 16) && (a[i][j] != 0); j++) {\n        for (k = j + 1; (k < 16) && (a[i][k] != 0); k++) {\n          if (a[i][k] == 2 * a[i][j])\n            num++;\n          else if (a[i][j] == 2 * a[i][k])\n            num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n}\n"}
{"label": "12", "index": "22641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15], i = 1, j, k, *p, count = 0;\n  scanf(\"%d \", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0)\n        break;\n    }\n    p = a;\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (p[j] == p[k] * 2)\n          count++;\n      }\n    }\n    cout << count << \"\\n\";\n    count = 0;\n    scanf(\"%d\", &a[0]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22642", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[16], i, j, k;\n  for (i = 0; i < 15; i++)\n    x[i] = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d \", &x[i]);\n    if (x[i] == -1)\n      break;\n    if (x[i] == 0) {\n      int t = 0;\n      for (j = 0; j < i; j++)\n        for (k = 0; k < i; k++)\n          if (x[j] == 2 * x[k])\n            t++;\n\n      printf(\"%d\\n\", t);\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22643", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0}, i = 1, j = 1, m = 0, k = 0;\n  while (cin >> a[0]) {\n    i = 1;\n    j = 1;\n    m = 0;\n    k = 0;\n    if (a[0] != -1) {\n      do {\n        cin >> a[i];\n        i++;\n      } while (a[i - 1] != 0);\n      for (j = 0; j <= i - 2; j++) {\n        for (k = 0; k <= i - 2; k++) {\n          if (a[j] == 2 * a[k])\n            m++;\n        }\n      }\n      printf(\"%d\\n\", m);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[16], i, j, n = 0, num = 0, m;\n\n  while (1) {\n    scanf(\"%d \", &m);\n    if (m == -1)\n      break;\n    else {\n      a[1] = m;\n      n = 1;\n    }\n    for (i = 2;; i++) {\n      cin >> x;\n      if (x == 0)\n        break;\n      else {\n        a[i] = x;\n        n = n + 1;\n      }\n    }\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        if (a[i] == (2 * a[j]))\n          num = num + 1;\n      }\n    }\n    cout << num << \"\\n\";\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22645", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int x[16], a, b, i, k;\n\n  while (1) {\n\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &x[i]);\n      if (x[i] == 0) {\n        a = i;\n        break;\n      }\n    }\n    if (x[0] == -1) {\n\n      break;\n    }\n    int s = 0;\n    for (k = 0; k < a; k++) {\n      for (i = 0; i < a; i++) {\n        if (x[k] == 2 * x[i]) {\n          s++;\n        }\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22646", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int i = 0, j, k = 0;\n  int line, column[100] = {0};\n  int tmp, count;\n  for (j = 0; j < 100; j++) {\n    scanf(\"%d\", &num[i][j]);\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      i++;\n      j = -1;\n    } else\n      column[i]++;\n  }\n  line = i - 1;\n  for (i = 0; i <= line; i++) {\n    tmp = num[i][k];\n    count = 0;\n    for (j = k + 1; j < column[i]; j++) {\n      if ((tmp * 2 == num[i][j]) || (num[i][j] * 2 == tmp))\n        count++;\n\n      if (j == column[i] - 1 && k < column[i] - 2) {\n        k++;\n        tmp = num[i][k];\n        j = k;\n      }\n    }\n    k = 0;\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[17][1000], i, j, k, s[1000] = {0};\n  int sum[1000] = {0}, g = 0, n;\n  for (i = 0, k = 0; i <= 1000; i++, k++) {\n    for (j = 0; j <= 16; j++, s[i]++) {\n      scanf(\"%d \", &a[j][i]);\n      if (a[j][i] == 0)\n        break;\n      else if (a[j][i] == -1) {\n        g = 1;\n        break;\n      }\n    }\n    if (g == 1)\n      break;\n  }\n  for (i = 0; i <= k - 1; i++) {\n    for (j = s[i]; j >= 0; j--) {\n      for (n = 0; n < j; n++) {\n        if (a[n][i] < a[j][i]) {\n          if (a[j][i] == 2 * a[n][i])\n            sum[i]++;\n        } else {\n          if (a[n][i] == 2 * a[j][i])\n            sum[i]++;\n        }\n      }\n    }\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, j, k, s = 0;\n  int a[17];\n  for (scanf(\"%d\", &a[1]); a[1] != -1; scanf(\"%d\", &a[1])) {\n    for (i = 2;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        t = i - 1;\n        break;\n      }\n    }\n    for (j = 1; j <= t; j++) {\n      for (k = 1; k <= t; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22649", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], len, count;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1) {\n      break;\n    }\n    count = 0;\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    for (int i = 0; i < len; i++)\n      for (int j = 0; j < len; j++) {\n        if (j == i)\n          continue;\n        else {\n          if (a[j] == (2 * a[i])) {\n            count++;\n            break;\n          }\n        }\n      }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22650", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[30], i, j, count1, count2;\n  while (scanf(\"%d\", &a[0]), a[0] != -1) {\n    count2 = 0;\n    i = 0;\n    while (a[i]) {\n      scanf(\"%d\", &a[++i]);\n    }\n    count1 = i - 1;\n    for (i = 0; i <= count1; i++) {\n      for (j = i + 1; j <= count1; j++)\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          count2++;\n    }\n    printf(\"%d\\n\", count2);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, num, a[15];\n  while (cin >> m) {\n    if (m == -1)\n      return 0;\n    else {\n      int n = 1;\n      num = 0;\n      a[0] = m;\n      for (int i = 1;; i++) {\n        cin >> a[i];\n        if (a[i] == 0) {\n          break;\n        }\n        if (a[i] != 0)\n          n = n + 1;\n      }\n      for (int j = 0; j <= n; j++) {\n        for (int k = j + 1; k <= n; k++) {\n          if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n            num = num + 1;\n        }\n      }\n      printf(\"%d\\n\", num);\n    }\n  }\n}\n"}
{"label": "12", "index": "22652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n, m;\n  while (scanf(\"%d \", &a[0])) {\n    m = 0;\n    if (a[0] == -1)\n      break;\n    else {\n      int i = 1;\n      cin >> a[i];\n      while (a[i] != 0) {\n        cin >> a[++i];\n      }\n      n = i;\n    }\n    for (int i = 0; i <= n - 2; i++) {\n      for (int j = i + 1; j <= n - 1; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], len, count;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n\n    count = 0;\n    len = 0;\n    do {\n      len++;\n      cin >> a[len];\n    } while (a[len] != 0);\n    for (int i = 0; i < len; i++) {\n      for (int j = 0; j < len; j++) {\n        if (j == i)\n          continue;\n        else {\n          if (a[j] == (2 * a[i])) {\n            count++;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22654", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[17] = {0}, count; \n  int i, j, k, two, num;\n  for (k = 1;; k++) {\n    count = 0; \n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[1] == -1 || a[i] == 0) {\n        num = i; \n        break;\n      }\n    }\n    if (a[1] == -1)\n      break; \n    for (i = 1; i < num; i++) {\n      two = 2 * a[i]; \n      for (j = 1; j < num; j++)\n        if (two == a[j]) \n        {\n          count++;\n          break;\n        }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int data[16];\n  int i, j;\n  int len;\n  int count;\n\n  while (1) {\n    count = 0;\n    scanf(\"%d\", &data[0]);\n    if (data[0] == -1)\n      break;\n\n    for (i = 1; i <= 15; i++) {\n      cin >> data[i];\n      if (data[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n\n    for (i = 0; i <= len - 1; i++)\n      for (j = 0; j <= len - 1; j++) {\n        count = count + (data[i] == 2 * data[j]);\n      }\n\n    cout << count << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[15], m = 0, s, h, t;\n  cin >> t;\n  while ((t + 1) != 0) {\n    for (n = 0, s = 0; t != 0; n++)\n      a[n] = t, s++, scanf(\"%d \", &t);\n    for (n = 0; n < s; n++) {\n      for (h = 0; h < s; h++) {\n        if (a[n] == 2 * a[h])\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    scanf(\"\\n%d\", &t);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    int a[15] = {0};\n    int i = 1;\n    int k, j;\n    int sum = 0;\n    a[0] = b;\n    scanf(\"%d\", &a[i]);\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "22658", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  for (int i = 0;; i++) { \n    int a[16];\n    int temp;\n    cin >> temp;\n    if (temp == -1)\n      break; \n    else\n      a[0] = temp;\n    int n = 1;\n    for (int j = 1;; j++) {\n      int temp1;\n      cin >> temp1;\n      if (temp1 == 0) \n        break;\n      else {\n        a[j] = temp1;\n        n++;\n      }\n    }\n    int m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n\n        if ((a[i] == (2 * a[j])))\n          m++; \n      }\n    }\n    cout << m << endl; \n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int key;\n  int number, total;\n  while ((cin >> key) && (key != -1)) {\n    int num[15];\n    num[0] = key;\n    int i = 1;\n    int flag1 = 0, flag2 = 0;\n    total = 0;\n    while ((cin >> number) && (number != 0)) {\n      num[i] = number;\n      i++;\n    }\n    for (int k = 0; k <= i - 2; k++) {\n      for (int r = k + 1; r <= i - 1; r++) {\n        flag1 = (num[r] == 2 * num[k]);\n        flag2 = (num[k] == 2 * num[r]);\n        if ((flag1 == 1) || (flag2 == 1)) {\n          total = total + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22660", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, s = 0;\n  int lena, x, y;\n  int a[16] = {0};\n  int b[20] = {0};\n\n  while (1) {\n    while (scanf(\"%d\", &a[i])) {\n      if ((a[i] == 0) || (a[i] == -1))\n        break;\n      else {\n        i++;\n        continue;\n      }\n    }\n\n    if (a[0] == -1)\n      break;\n    else {\n      lena = i;\n\n      for (x = 0; x < lena; x++) {\n        for (y = x + 1; y <= lena; y++) {\n          if ((a[x] == 2 * a[y]) || (a[y] == 2 * a[x]))\n            s++;\n        }\n      }\n\n      b[j] = s;\n      s = 0;\n    }\n    j++;\n    for (i = 0; i < 16; i++)\n      a[i] = 0;\n    i = 0;\n  }\n\n  for (i = 0; i < j; i++)\n    printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "12", "index": "22661", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], i, j, num, flag;\n  while (1) {\n    flag = 0;\n    i = 0;\n    cin >> a[i];\n    if (a[0] == -1)\n      break;\n    else {\n      do {\n        i++;\n        cin >> a[i];\n      } while (a[i] != 0);\n      num = i;\n      for (i = 0; i < num; i++)\n        for (j = i + 1; j < num; j++)\n          if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i]))\n            flag++;\n      printf(\"%d\\n\", flag);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22662", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[16], i;\n\n  for (i = 1;; i++) {\n    int j, k, n = 1, cnt = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; j < 16; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n\n      n++;\n    }\n\n    for (j = 0; j < n - 1; j++) {\n      for (k = 1; k <= n - j - 1; k++) {\n        if (a[j] == 2 * a[j + k] || 2 * a[j] == a[j + k])\n          cnt++;\n      }\n    }\n    cout << cnt << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15][16] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},\n                   {0}, {0}, {0}, {0}, {0}, {0}, {0}},\n      c, m;\n  for (m = 0; m < 100; m++) {\n    for (c = 0; c < 16; c++) {\n      scanf(\"%d\", &a[m][c]);\n      if (a[m][c] <= 0)\n        break;\n    }\n    if (a[m][0] <= 0)\n      break;\n    int b, d, e, f = 0;\n    for (b = 0; b < c; b++) {\n      d = a[m][b] * 2;\n      for (e = 0; e < c; e++) {\n        if (d == a[m][e])\n          f++;\n      }\n    }\n    printf(\"%d\\n\", f);\n  }\n}\n"}
{"label": "12", "index": "22664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20];\n  int n, i, j, k;\n  for (k = 1;; k++) {\n    memset(a, 0, sizeof(a));\n    n = 0;\n    i = 1;\n    scanf(\"%d \", &a[1]);\n    if (a[1] != (-1)) {\n      if (a[1] != 0) {\n        for (i = 1;;) {\n          i++;\n          cin >> a[i];\n          if (a[i] != 0) {\n            for (j = 1; j <= (i - 1); j++) {\n              if ((a[i] == 2 * a[j]) || (a[j] == 2 * a[i])) {\n                n = n + 1;\n              }\n            }\n          } else {\n            cout << n << endl;\n            break;\n          }\n        }\n      }\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, t = -1, s = 0;\n  int a[10000];\n  for (i = 0; i <= 10000; i++) {\n    cin >> a[i];\n    if (a[i] == -1)\n      break;\n    else if (a[i] == 0) {\n      t = i;\n      cout << s << \"\\n\";\n      s = 0;\n    } else {\n      for (j = t + 1; j < i; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n          s = s + 1;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20][16], s[20] = {0}, i, j, k, p = 0, n[20] = {0};\n  for (i = 0; i < 20; i++) {\n    scanf(\"%d\", &a[i][0]);\n    if (a[i][0] == -1)\n      break;\n    p = p + 1;\n    for (j = 1; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      s[i] = s[i] + 1;\n    }\n  }\n  for (i = 0; i < p; i++)\n    for (j = 0; j <= s[i]; j++)\n      for (k = 0; k <= s[i]; k++)\n        if (a[i][j] == 2 * a[i][k])\n          n[i] = n[i] + 1;\n  for (i = 0; i < p; i++)\n    cout << n[i] << \"\\n\";\n}\n"}
{"label": "12", "index": "22667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20][16] = {0};\n  int bei[20] = {0}, j, k, chu, last;\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      scanf(\"%d \", &a[j][k]);\n      if (a[j][k] == 0 || a[j][k] == -1)\n        break;\n    }\n    if (a[j][k] < 0) {\n      last = j;\n      break;\n    }\n  }\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      for (chu = 0; chu < 16; chu++) {\n        if ((a[j][chu] == 2 * a[j][k]) && a[j][k] != 0 && a[j][chu] != 0) {\n          bei[j] = bei[j] + 1;\n        }\n      }\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (j = 0; j < last; j++) {\n    cout << bei[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num[16];\n\nint Compare(const void *elem1, const void *elem2) {\n  return *((int *)elem1) - *((int *)elem2);\n}\n\nint main() {\n  int n;\n  while (cin >> n && n != -1) {\n    memset(num, 0, sizeof num);\n    num[0] = n;\n    int count = 0;\n    int i = 1;\n    for (; cin >> n && n != 0; i++)\n      num[i] = n;\n    qsort(num, i, sizeof(int), Compare);\n\n    for (int j = 0; j < i - 1; j++) {\n      int temp = num[j];\n      for (int k = j + 1; k < i; k++) {\n        if (num[k] == temp * 2) {\n          count++;\n          break;\n        }\n      }\n    }\n\n    cout << count << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][16], b[1000] = {0, 0};\n  int i, j, k, h, m;\n  int count1, count2;\n  count2 = -1;\n  for (i = 0; i < 1000; i++) {\n    count1 = -1;\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) || (a[i][j] == -1))\n        break;\n      count1++;\n    }\n    if (a[i][j] == -1)\n      break;\n    for (k = 0; k <= count1; k++) {\n      for (h = 0; h <= count1; h++) {\n        if (a[i][k] == 2 * a[i][h])\n          b[i]++;\n        else\n          continue;\n      }\n    }\n    count2++;\n  }\n  for (m = 0; m <= count2; m++)\n    cout << b[m] << \" \";\n}\n"}
{"label": "12", "index": "22670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], b = 0, i, j, l, m = 0, q;\n  for (i = 0; i <= 16; i++)\n    a[i] = 0;\n\n  for (q = 0;; q++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      b = b + 1;\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      goto lab;\n    }\n    for (j = 0; j < b; j++) {\n      for (l = j + 1; l < b; l++) {\n        if (a[j] == 2 * a[l] || a[l] == 2 * a[j]) {\n          m = m + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    b = 0;\n  }\nlab:;\n}\n"}
{"label": "12", "index": "22671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, d = 0, s[15], i, j;\n  while (1) {\n    scanf(\"%d\", &s[0]);\n    if (s[0] == -1)\n      break;\n    for (i = 1; s[i - 1] != 0; i++)\n      cin >> s[i];\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if (s[i] == s[j] * 2)\n          d++;\n        else\n          d = d;\n      }\n    cout << d << \"\\n\";\n    d = 0;\n  }\n}\n"}
{"label": "12", "index": "22672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, m = 0;\n  int a[16];\n  while (1) {\n    n = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      m = i;\n      if (a[i] == 0)\n        break;\n      if (a[0] == -1)\n        break;\n    }\n    if (a[0] == -1)\n      break;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          n += 1;\n      }\n    }\n    cout << n / 2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22673", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x[15], count;\n  while (1) {\n    count = 0;\n    for (n = 0;; n++) {\n      scanf(\"%d \", &x[n]);\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1)\n      break;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        if (j == i)\n          continue;\n        if (x[j] == 2 * x[i])\n          count++;\n      };\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22674", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n, m;\n  while (cin >> a[0]) {\n    m = 0;\n    if (a[0] == -1)\n      break;\n    else {\n      int i = 1;\n      cin >> a[i];\n      while (a[i] != 0) {\n        cin >> a[++i];\n      }\n      n = i;\n    }\n    for (int i = 0; i <= n - 2; i++) {\n      for (int j = i + 1; j <= n - 1; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          m++;\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n, m;\n  while (scanf(\"%d \", &a[0])) {\n    m = 0;\n    if (a[0] == -1)\n      break;\n    else {\n      int i = 1;\n      cin >> a[i];\n      while (a[i] != 0) {\n        cin >> a[++i];\n      }\n      n = i;\n    }\n    for (int i = 0; i <= n - 2; i++) {\n      for (int j = i + 1; j <= n - 1; j++) {\n        if ((a[i] == a[j] * 2) || (a[j] == a[i] * 2))\n          m++;\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[15];\n  int i, j, temp, min, flag, twice;\n  for (;;) {\n\n    for (i = 0; i < 15; i++)\n      array[i] = 0;\n    for (i = 0;; i++) {\n      cin >> temp;\n      if (temp == -1)\n        return 0;\n      if (temp == 0)\n        break;\n      array[i] = temp;\n    }\n\n    for (i = 0; i < 15; i++) {\n      min = array[i];\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] < min) {\n          temp = min;\n          min = array[j];\n          array[j] = temp;\n        }\n      }\n      array[i] = min;\n    }\n\n    for (flag = 0, i = 0; i < 15; i++) {\n      if (array[i] == 0)\n        continue;\n      twice = array[i] * 2;\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] > twice)\n          break;\n        if (array[j] == twice)\n          flag++;\n      }\n    }\n    cout << flag << \"\\n\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22677", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, num, count = 0, array[15];\n  while (scanf(\"%d \", &n) && n != -1) {\n    memset(array, 0, sizeof(array));\n    array[0] = n;\n    i = 1;\n    num = 1;\n    while (cin >> n && n != 0) {\n      array[i++] = n;\n      num++;\n    }\n    sort(array, array + num);\n    for (i = num - 1; i > 0; i--)\n      for (j = i - 1; j >= 0; j--) {\n        if (array[i] == 2 * array[j])\n          count++;\n      }\n    printf(\"%d\\n\", count);\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[15], n;\n  int i;\n  scanf(\"%d \", &a[0]);\n  while (a[0] != -1) {\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        n = i;\n        break;\n      }\n    }\n    int cnt = 0, j;\n    for (i = 0; i <= n - 2; i++)\n      for (j = i + 1; j <= n - 1; j++) {\n        if (a[i] - 2 * a[j] == 0 || a[j] - 2 * a[i] == 0)\n          cnt++;\n      }\n    cout << cnt << \"\\n\";\n    for (i = 0; i <= 14; i++)\n      a[i] = 0;\n    cin >> a[0];\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22679", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[15];\n  while (cin) {\n    int temp, num = 0, i = 0, j = 0, k = 0;\n    for (i = 0; cin >> a[i]; i++)\n      if (a[i] == -1)\n        return 0;\n      else if (a[i] == 0) {\n        for (j = 1; j < i; j++)\n          for (k = 0; k < i - j; k++)\n            if (a[k] > a[k + 1]) {\n              temp = a[k];\n              a[k] = a[k + 1];\n              a[k + 1] = temp;\n            }\n        for (j = 0; j < i; j++) {\n          for (k = j + 1; k < i; k++)\n            if (a[j] * 2 == a[k])\n              num++;\n        }\n        printf(\"%d\\n\", num);\n        num = 0;\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22680", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shuzu[16] = {0}, i, j, pair = 0, n;\n  for (i = 0; shuzu[0] != -1; i++) {\n    scanf(\"%d \", &shuzu[i]);\n    if (shuzu[i] == 0) {\n      n = i;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[i] == 2 * shuzu[j]) {\n            pair++;\n          }\n        }\n      }\n      printf(\"%d\\n\", pair);\n      i = -1;\n      pair = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[18], m, i = 0, j = 0, k = 0, l = 0, n = 0;\n\n  for (n = 0;; n++) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1;; i++) {\n        scanf(\"%d\", &a[i]);\n        if (a[i] == 0) {\n          m = i - 1;\n          break;\n        }\n      }\n      i = 0;\n\n      for (i = 0; i <= m; i++) {\n        for (j = 0; j <= m; j++) {\n          if (a[j] == (2 * a[i]))\n            k++;\n        }\n        l = l + k;\n        k = 0;\n      }\n\n      printf(\"%d\\n\", l);\n      l = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22682", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], i;\n\n  for (i = 1;; i++) {\n    int j, k, n = 1, cnt = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; j < 16; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        break;\n\n      n++;\n    }\n\n    for (j = 0; j < n - 1; j++) {\n      for (k = 1; k <= n - j - 1; k++) {\n        if (a[j] == 2 * a[j + k] || 2 * a[j] == a[j + k])\n          cnt++;\n      }\n    }\n    cout << cnt << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint iFind(int *p, int findnum) {\n  int k, sum = 0;\n  for (k = 0; k < 15; k++) {\n    if (*(p + k) == findnum)\n      sum++;\n  }\n  return sum;\n}\n\nint main() {\n  int a[15], temp, i = 0, j, k, *p, sum = 0;\n  p = a;\n  for (j = 0; j < 15; j++)\n    a[j] = -1;\n  while (scanf(\"%d \", &temp), temp != -1) {\n    if (temp != 0) {\n      a[i] = temp;\n      i++;\n    } else {\n      for (k = 0; k < 15; k++) {\n        sum += iFind(p, a[k] * 2);\n      }\n      cout << sum << endl;\n      sum = 0;\n      i = 0;\n      for (j = 0; j < 15; j++)\n        a[j] = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20], n, r = 0, i, j, count = 0;\n  memset(a, 0, sizeof(a));\n  for (;;) {\n    cin >> n;\n    if (n == -1)\n      break;\n    else if (n != 0) {\n      a[r] = n;\n      r++;\n      continue;\n    } else if (n == 0) {\n\n      for (i = 0; i < r - 1; i++) {\n        for (j = i + 1; j < r; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            count++;\n        }\n        a[i] = 0;\n      }\n      a[i] = 0;\n      cout << count << \"\\n\";\n      count = 0;\n      r = 0;\n      i = 0;\n      j = 0;\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int z[15], r[100];\n  int i, j, l;\n  int sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &z[i]);\n    if (z[i] == 0) {\n      r[sum] = 0;\n      for (j = 0; j < i - 1; j++) {\n        for (l = j + 1; l < i; l++) {\n          if (z[j] == 2 * z[l] || z[j] == 0.5 * z[l]) {\n            r[sum]++;\n          }\n        }\n      }\n      sum++;\n      i = -1;\n    } else if (z[i] == -1)\n      break;\n  }\n  for (i = 0; i < sum; i++) {\n    cout << r[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t, j, k, s = 0;\n  int a[17];\n  for (scanf(\"%d\", &a[1]); a[1] != -1; scanf(\"%d\", &a[1])) {\n    for (i = 2;; i++) {\n      cin >> a[i];\n      if (a[i] == 0) {\n        t = i - 1;\n        break;\n      }\n    }\n    for (j = 1; j <= t; j++) {\n      for (k = 1; k <= t; k++) {\n        if (a[j] == 2 * a[k])\n          s = s + 1;\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[15], b, n = 0, num = 0;\n  while (cin >> b) {\n    if (b == -1)\n      break;\n    else if (b == 0) {\n      for (int i = 0; i < n; i++)\n        for (int j = i; j < n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      n = 0;\n      cout << num << endl;\n      num = 0;\n    } else {\n      a[n] = b;\n      n++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22688", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, count;\n  float a[20];\n  while (1) {\n    scanf(\"%f\", &a[0]);\n    if (a[0] == -1)\n      break;\n    n = 1;\n    while (1) {\n      scanf(\"%f\", &a[n]);\n      if (a[n] == 0)\n        break;\n      n++;\n    }\n    count = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if ((a[i] / a[j] == 2.0) || (a[j] / a[i] == 2.0))\n          count++;\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, k;\n  static int a[16];\n  while (scanf(\"%d\", &a[0]) && a[0] != -1) {\n    for (k = 1; k <= 15; k++) {\n      scanf(\" %d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    n = 0;\n    for (k = 0; a[k] != 0; k++)\n      for (m = 0; a[m] != 0; m++) {\n        if (a[m] == 2 * a[k]) {\n          n++;\n          break;\n        }\n      }\n    cout << n << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22690", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20][16] = {0};\n  int bei[20] = {0}, j, k, chu, last;\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      scanf(\"%d\", &a[j][k]);\n      if (a[j][k] == 0 || a[j][k] == -1)\n        break;\n    }\n    if (a[j][k] < 0) {\n      last = j;\n      break;\n    }\n  }\n  for (j = 0; j < 20; j++) {\n    for (k = 0; k < 16; k++) {\n      for (chu = 0; chu < 16; chu++) {\n        if ((a[j][chu] == 2 * a[j][k]) && a[j][k] != 0 && a[j][chu] != 0) {\n          bei[j] = bei[j] + 1;\n        }\n      }\n    }\n    if (a[j][0] == -1)\n      break;\n  }\n  for (j = 0; j < last; j++) {\n    printf(\"%d\\n\", bei[j]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22691", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  while (1) {\n    int array[16] = {0};\n    int n = 0, sum = 0;\n    while (1) {\n      scanf(\"%d \", &array[n]);\n      if (array[n] == 0 || array[n] == -1) {\n        n--;\n        break;\n      }\n      n++;\n    }\n    if (array[0] == -1)\n      break;\n    for (i = 0; i <= n; ++i) {\n      for (j = i; j <= n; ++j) {\n        if ((array[i] == array[j] * 2) || (array[j] == array[i] * 2))\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][15], b[100] = {0}, i, j, k, s, m = 0, x;\n  for (i = 0;; i++) {\n    cin >> a[i][0];\n    if (a[i][0] == -1)\n      break;\n    else {\n      for (j = 1;; j++) {\n        b[m]++;\n        cin >> a[i][j];\n        if (a[i][j] == 0)\n          break;\n        else\n          continue;\n      }\n      m++;\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    x = 0;\n    for (j = 0; j < b[i]; j++) {\n      s = 0;\n      for (k = 0; k < b[i]; k++) {\n        if (a[i][k] * 2 == a[i][j])\n          s = s + 1;\n      }\n      x = x + s;\n    }\n    cout << x << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[25], i, j, count;\n  while (cin >> n[1], n[1] != -1) {\n    count = 0;\n    for (i = 2; cin >> n[i], n[i] != 0; i++) {\n      for (j = 1; j < i; j++) {\n        if (n[i] == 2 * n[j] || n[i] * 2 == n[j]) {\n          count++;\n        }\n      }\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, i, j, x, y, m, n, a[20];\n  for (j = 1; j <= 15; j++) {\n    t = 0;\n    scanf(\"%d\", &y);\n    if (y == -1)\n      break;\n    else {\n      a[0] = y;\n      for (i = 1; i <= 20; i++) {\n        scanf(\"%d\", &x);\n        if (x == 0)\n          break;\n        else {\n          a[i] = x;\n        }\n      }\n      for (m = 0; m <= i - 1; m++) {\n        for (n = 0; n <= i - 1; n++) {\n          if (a[m] == 2 * a[n])\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n    }\n  }\n}\n"}
{"label": "12", "index": "22695", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[15][20] = {0};\n\nint main() {\n  int i, j, k;\n  int div(int);\n\n  for (i = 0, j = 0;;) {\n    scanf(\"%d\", &num[i][j]);\n    if (num[i][j] == -1)\n      break;\n    if (num[i][j] == 0) {\n      j = 0;\n      i++;\n      continue;\n    }\n    j++;\n  }\n\n  for (k = 0; k < i; k++)\n    printf(\"%d\\n\", div(k));\n  return 0;\n}\n\nint div(int n) {\n  int i, j, k = 0;\n\n  for (i = 0; num[n][i]; i++) {\n    for (j = i; num[n][j]; j++)\n      if (num[n][i] == 2 * num[n][j] || num[n][j] == 2 * num[n][i]) {\n        k++;\n      }\n  }\n  return k;\n}\n"}
{"label": "12", "index": "22696", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][16] = {0}, i = 0, j = 0, x, y, z, m;\n  do {\n    j = 0;\n    do {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == -1)\n        break;\n      j++;\n    } while (a[i][j - 1] != 0);\n    if (a[i][j] == -1)\n      break;\n    else\n      i++;\n  } while (1 == 1);\n  for (x = 0; x < i; x++) {\n    m = 0;\n    {\n      for (y = 0; a[x][y] != 0; y++) {\n        for (z = 0; a[x][z] != 0; z++) {\n          if (a[x][z] == 2 * a[x][y])\n            m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n}\n"}
{"label": "12", "index": "22697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, m = 1, num = 0;\n  while (cin >> a[0]) {\n    num = 0;\n    m = 1;\n    if (a[0] == -1)\n      break;\n    else {\n      for (i = 1; i < 16; i++, m++) {\n        cin >> a[i];\n        if (a[i] == 0)\n          break;\n      }\n\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (k == j)\n            continue;\n          if ((a[k] == 2 * a[j]) || (a[j] == 2 * a[k]))\n            num++;\n        }\n      }\n\n      cout << num / 2 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, k, l, x = 0, a[20];\n\n  while (1) {\n    x = 0;\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (j = 1; a[j - 1] != 0; j++)\n      scanf(\"%d\", &a[j]);\n    for (k = 0; k < j - 1; k++) {\n      for (l = 0; l < j; l++) {\n        if (a[l] == 2 * a[k])\n          x = x + 1;\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n}\n"}
{"label": "12", "index": "22699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[16], pause, i, k, m, count;\n\n  for (;;) {\n    count = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &A[i]);\n      if (A[i] == 0 || A[i] == -1) {\n        break;\n      }\n    }\n    if (A[i] == -1) {\n      break;\n    }\n    for (i = 0; i < 16; i++) {\n      if (A[i] == 0) {\n        pause = i;\n        break;\n      }\n    }\n    for (k = 1; k < pause; k++) {\n      for (i = 0; i < pause - k; i++) {\n        if (A[i] <= A[i + 1]) {\n          m = A[i];\n          A[i] = A[i + 1];\n          A[i + 1] = m;\n        }\n      }\n    }\n    for (k = 0; k < pause; k++) {\n      for (i = k + 1; i < pause; i++) {\n        if (A[k] == 2 * A[i]) {\n          count++;\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16], num, i = 1, j = 0, k = 0, l = 0;\n  while (scanf(\"%d \", &a[0])) {\n\n    num = 0;\n\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= 15; j++)\n      for (k = 0; k <= 15; k++)\n        if ((a[j] != 0) && (a[k] != 0) && (a[j] == 2 * a[k]))\n          num++;\n    for (l = 0; l <= 15; l++)\n      a[l] = 0;\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22701", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int array[15];\n  int i, j, temp, min, flag, twice;\n  for (;;) {\n\n    for (i = 0; i < 15; i++)\n      array[i] = 0;\n    for (i = 0;; i++) {\n      cin >> temp;\n      if (temp == -1)\n        return 0;\n      if (temp == 0)\n        break;\n      array[i] = temp;\n    }\n\n    for (i = 0; i < 15; i++) {\n      min = array[i];\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] < min) {\n          temp = min;\n          min = array[j];\n          array[j] = temp;\n        }\n      }\n      array[i] = min;\n    }\n\n    for (flag = 0, i = 0; i < 15; i++) {\n      if (array[i] == 0)\n        continue;\n      twice = array[i] * 2;\n      for (j = i + 1; j < 15; j++) {\n        if (array[j] > twice)\n          break;\n        if (array[j] == twice)\n          flag++;\n      }\n    }\n    printf(\"%d\\n\\n\", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22702", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16] = {0};\n  int i, j, num = 0;\n  while (1) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n      if (i > 0) {\n        for (j = 0; j < i; j++) {\n          if (a[i] * 2 == a[j] || a[j] * 2 == a[i]) {\n            num++;\n          }\n        }\n      }\n    }\n    if (a[0] == -1) {\n      break;\n    }\n    printf(\"%d\\n\", num);\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, s, k, l;\n\n  for (l = 1; l < 3000; l++) {\n    s = 0;\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (k = 1; k <= 16; k++) {\n      scanf(\"%d\", &a[k]);\n      if (a[k] == 0)\n        break;\n    }\n    for (i = 0; i < k - 1; i++) {\n      for (j = i + 1; j < k; j++)\n        if (a[i] == a[j] * 2 || a[j] == a[i] * 2)\n          s = s + 1;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[100][100], i = 0, j = 0, m, n, k, s = 0;\n  while (scanf(\"%d\", &c[i][j])) {\n    if (c[i][j] != 0 && c[i][j] != -1)\n      j++;\n    else if (c[i][j] == 0) {\n      i++;\n      j = 0;\n    } else\n      break;\n  }\n  for (m = 0; m <= i - 1; m++) {\n    for (n = 0; c[m][n] != 0; n++) {\n      for (k = 0; c[m][k] != 0; k++) {\n        if (c[m][n] == 2 * c[m][k])\n          s++;\n      }\n    }\n    printf(\"%d \", s);\n    s = 0;\n  }\n}\n"}
{"label": "12", "index": "22705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, num[15], out;\n  while (1) {\n    n = -1;\n    out = 0;\n    scanf(\"%d\", &i);\n    if (i == -1)\n      break;\n    num[++n] = i;\n    while (1) {\n      scanf(\"%d\", &i);\n      if (i == 0)\n        break;\n      num[++n] = i;\n    }\n    for (i = 0; i <= n - 1; i++)\n      for (j = i + 1; j <= n; j++)\n        if (num[j] == 2 * num[i] || num[i] == 2 * num[j])\n          out++;\n    printf(\"%d\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, num, a[17];\n  do {\n    i = 0;\n    do {\n      i++;\n      scanf(\"%d\", &a[i]);\n    } while (a[i] > 0);\n    n = i - 1;\n    if (a[n + 1] != -1) {\n      num = 0;\n      for (i = 1; i <= n - 1; i++)\n        for (j = i + 1; j <= n; j++)\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            num++;\n      cout << num << \" \";\n    }\n  } while (a[n + 1] == 0);\n  return 0;\n}\n"}
{"label": "12", "index": "22707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, a[20], t, sum;\n  while (1) {\n    t = sum = 0;\n    while (1) {\n      scanf(\"%d\", &c);\n      if (!c || c == -1)\n        break;\n      a[t++] = c;\n    }\n    if (c == -1)\n      break;\n    for (int i = 0; i < t; i++)\n      for (int j = 0; j < t; j++)\n        if (a[j] == a[i] * 2)\n          sum++;\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, a[16], num;\n  while (scanf(\"%d\", &a[0]), a[0] + 1) {\n    i = 1;\n    num = 0;\n    while (scanf(\"%d\", &a[i]), a[i]) {\n      i++;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = j + 1; k < i; k++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j]) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22709", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], i, j, n, count;\n  while (1) {\n    count = 0;\n    i = 0;\n    \n    while (1) {\n      cin >> a[i++];\n      if (a[i - 1] == 0 || a[0] == -1)\n        break;\n    }\n    n = i - 1;\n    \n    if (a[0] == -1)\n      break;\n    \n    for (i = 0; i < n - 1; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] * 2 == a[j] || a[j] * 2 == a[i])\n          count++;\n      }\n    \n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  int a[15];\n  scanf(\"%d\", &k);\n  while (k != -1) {\n    n = 0;\n    m = 0;\n    i = 0;\n    while (k != 0) {\n      n++;\n      a[i] = k;\n      i++;\n      scanf(\"%d\", &k);\n    }\n    for (i = 0; i < n; i++)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          m++;\n        }\n      }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &k);\n  }\n}\n"}
{"label": "12", "index": "22711", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i, n, j, m, k;\n  int flag;\n  while (1) {\n    m = 0;\n    j = 0;\n    flag = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k < i; k++) {\n        if ((a[k] == a[j] * 2 || a[j] == a[k] * 2) && (a[j] != 0 && a[k] != 0))\n          m++;\n      }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, n, b, c = 0, j = 0, k, a[1000][18];\n  scanf(\"%d\", &b);\n  while (b != -1) {\n    if (b != 0) {\n      a[i][j] = b;\n      j++;\n      a[i][17] = j;\n    } else {\n      a[i][j] = b;\n      i++;\n      n = i;\n      j = 0;\n    }\n    cin >> b;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < a[i][17] - 1; j++) {\n      for (k = j + 1; k < a[i][17]; k++) {\n        if (a[i][j] == 2 * a[i][k] || a[i][k] == 2 * a[i][j]) {\n          c++;\n        }\n      }\n    }\n    printf(\"%d\\n\", c);\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22713", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000];\n  int i, j, num, n;\n  n = 0;\n  for (i = 0; i < 15; i++) {\n    scanf(\"%d\", &a[i]);\n    n++;\n    if (a[i] == 0 || a[i] == -1) {\n      n--;\n      break;\n    }\n  }\n\n  do {\n\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == 2 * a[i] || a[j] * 2 == a[i]) {\n          num++;\n        }\n      }\n    }\n    printf(\"%d \", num);\n\n    n = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      n++;\n      if (a[i] == 0 || a[i] == -1) {\n        n--;\n        break;\n      }\n    }\n  }\n\n  while (a[0] != -1);\n\n  return 0;\n}\n"}
{"label": "12", "index": "22714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[15], l, p = 0, t;\n  for (i = 1;; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == -1)\n      break;\n    else {\n      p = 0;\n      for (k = 1; k <= 15; k++) {\n        scanf(\"%d\", &a[k]);\n        if (a[k] == 0)\n          break;\n      }\n      for (t = 0; t <= k; t++)\n        for (l = 0; l <= k; l++) {\n          if (a[l] == a[t] * 2)\n            p = p + 1;\n        }\n      p = p - 1;\n      cout << p << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22715", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[16];\n  int i = 1;\n  int n;\n  int j, k, ans;\n  i = 1;\n  do {\n    scanf(\"%d \", &n);\n    if (n != -1) {\n      if (n == 0) {\n        ans = 0;\n        for (j = 1; j <= i - 1; j++)\n          for (k = 1; k <= i - 1; k++)\n            if (num[j] == 2 * num[k])\n              ans += 1;\n        printf(\"%d\\n\", ans);\n        i = 1;\n      } else {\n        num[i] = n;\n        i += 1;\n      }\n    }\n  } while (n != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22716", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[15], sum = 0, n;\n  while (1) {\n    for (n = 0;; n++) {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break;\n    }\n    if (x[n] == -1) {\n      break;\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (x[j] == x[i] * 2)\n          sum = sum + 1;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22717", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, i, j, k, count;\n  int group[15];\n  scanf(\"%d\", &t);\n  do {\n    i = 0;\n    do {\n      group[i] = t;\n      cin >> t;\n      i++;\n    } while (t != 0);\n    printf(\"\\n\");\n    count = 0;\n    for (j = i - 1; j >= 0; j--) {\n      for (k = 0; k < i; k++) {\n        if ((double)group[k] / 2 == group[j])\n\n          count++;\n        else {\n          if ((double)group[j] / 2 == group[k]) {\n            count++;\n          }\n        }\n      }\n    }\n    printf(\"%d\\n\", count / 2);\n    scanf(\"%d\", &t);\n\n  } while (t != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  while (1) {\n    int a[20] = {0}, sum = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == 0) {\n        k = i;\n        break;\n      }\n    }\n    if (a[0] == -1)\n      break;\n    for (i = 0; i < k; i++)\n      for (j = i; j < k; j++) {\n        if (a[j] == 2 * a[i] || 2 * a[j] == a[i])\n          sum++;\n      }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "12", "index": "22719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, a[16];\n  while (1) {\n    int count = 0;\n    for (i = 0; i < 16; i++) {\n      cin >> a[i];\n      if (a[i] == -1)\n        break;\n      if (a[i] == 0)\n        break;\n    }\n    if (a[i] == -1)\n      break;\n    for (j = 0; j < i; j++) {\n      for (m = j + 1; m < i; m++) {\n        if (a[j] == 2 * a[m])\n          count++;\n      }\n    }\n    for (j = 0; j < i; j++)\n      for (m = j + 1; m < i; m++)\n        if (2 * a[j] == a[m])\n          count++;\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22720", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int an[50], *p, i, t = 0, *q;\n  for (i = 0;;) {\n    scanf(\"%d\", &an[i]);\n    if (an[i] == -1)\n      break;\n    else {\n      for (i = 1;; i++)\n\n      {\n        scanf(\"%d \", &an[i]);\n        if (an[i] == 0)\n          break;\n      }\n      for (p = an; *p != 0; p++) {\n        for (q = an; *q != 0; q++) {\n          if (*q == (*p) * 2)\n            t++;\n        }\n      }\n      printf(\"%d\\n\", t);\n      t = 0;\n    }\n    i = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[15], i, j, k, t, N;\n  for (i = 1;; i++) {\n    cin >> num[0];\n    if (num[0] == -1)\n      break;\n    N = 0;\n    for (j = 1;; j++) {\n      cin >> num[j];\n      if (num[j] == 0)\n        break;\n    }\n    for (k = 0; k <= j - 1; k++) {\n      for (t = 0; t <= j - 1; t++) {\n        if (num[k] == 2 * num[t])\n          N++;\n      }\n    }\n    cout << N << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  cin >> b;\n  while (b != -1) {\n    int a[15] = {0};\n    int i = 1;\n    int k, j;\n    int sum = 0;\n    a[0] = b;\n    cin >> a[i];\n    while (a[i] != 0) {\n      i++;\n      scanf(\"%d\", &a[i]);\n    }\n    for (k = 0; k < i; k++) {\n      for (j = k + 1; j < i; j++) {\n        if (a[j] == 2 * a[k] || a[k] == 2 * a[j])\n          sum++;\n      }\n    }\n    cout << sum << \"\\n\";\n    scanf(\"%d\", &b);\n  }\n}\n"}
{"label": "12", "index": "22723", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16], b = 0, c = 0, d = 1, e = 0;\n  scanf(\"%d\", &a[b]);\n  while (a[b] != -1) {\n    while (a[b] != 0) {\n      b++;\n      scanf(\"%d \", &a[b]);\n    }\n    while (c <= b) {\n      while (d < b) {\n        if (a[c] == (a[d] * 2)) {\n          e = e + 1;\n        }\n        d = d + 1;\n      }\n      c = c + 1;\n      d = 0;\n    }\n    printf(\"%d\\n\", e);\n    b = 0;\n    cin >> a[b];\n    e = 0;\n    c = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  for (l = 1;; l++) {\n    i = 0;\n    int a[20], num = 0;\n    do {\n      i++;\n      cin >> a[i];\n    } while (a[i] > 0);\n    if (a[i] == -1)\n      break;\n    else {\n      for (j = 1; j < i; j++) {\n        for (k = 1; k < i; k++) {\n          if (a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      cout << num << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[17], b = 0, i, j, l, m = 0, q;\n  for (i = 0; i <= 16; i++)\n    a[i] = 0;\n  for (q = 0;; q++) {\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d\", &a[i]);\n      b = b + 1;\n      if (a[i] == 0) {\n        break;\n      }\n    }\n    if (a[0] == -1) {\n      goto lab;\n    }\n    for (j = 0; j < b; j++) {\n      for (l = j + 1; l < b; l++) {\n        if (a[j] == 2 * a[l] || a[l] == 2 * a[j]) {\n          m = m + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    m = 0;\n    b = 0;\n  }\nlab:;\n  return 0;\n}\n"}
{"label": "12", "index": "22726", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[17] = {0};\n  int i, j, k, l;\n  int num = 0;\n  for (l = 1;; l++) {\n    for (i = 1; i <= 16; i++) {\n      cin >> a[i];\n      if (a[i] == 0 || a[i] == -1) {\n        break;\n      }\n    }\n    if (a[i] == -1)\n      break;\n    for (j = i - 1; j >= 1; j--)\n      for (k = j - 1; k >= 1; k--) {\n        if (a[j] > a[k] && a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          num++;\n        if (a[k] > a[j] && a[k] % a[j] == 0 && a[k] / a[j] == 2)\n          num++;\n      }\n    printf(\"%d\\n\", num);\n    int a[17] = {0};\n    num = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22727", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[16], sign = 1, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;;) {\n      scanf(\"%d\", &a[i]);\n      sign = a[i];\n      if (sign == 0 || sign == -1)\n        break;\n      else\n        i++;\n    }\n    if (sign == -1)\n      break;\n    else {\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (a[k] == 2 * a[j] || a[j] == 2 * a[k]) {\n            num++;\n          }\n        }\n      }\n      printf(\"%d\\n\", num);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][15], i = 0, j, k, count, t;\n  for (i = 0;; i++) {\n    count = 0;\n    j = 0;\n    do {\n      cin >> n[i][j];\n      if (n[i][j] == -1)\n        goto loop;\n      j++;\n    } while (n[i][j - 1] != 0);\n    for (k = 0; k < j; k++) {\n      for (t = j - 1; t > k; t--) {\n        if (n[i][t] == 2 * n[i][k] || 2 * n[i][t] == n[i][k])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\nloop:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, k;\n  while (1) {\n    int sz[16];\n    int add = 0;\n    for (i = 0; i < 16; i++) {\n      scanf(\"%d \", &sz[i]);\n      if (sz[i] == 0 || sz[i] == -1) {\n        break;\n      }\n    }\n    if (sz[0] == -1) {\n      break;\n    }\n    for (i; i < 16; i++) {\n      sz[i] = 0;\n    }\n    for (i = 0; i < 16; i++) {\n      for (k = 0; k < 16; k++) {\n        if (sz[k] != 0 && sz[k] == 2 * sz[i]) {\n          add = add + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", add);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k;\n  while (1) {\n    int s = 0;\n    for (i = 0;; i++) {\n      scanf(\"%d \", &a[i]);\n      if (a[i] == 0)\n        break;\n      if (a[i] == -1)\n        goto end;\n    }\n    for (j = 0; j <= i - 1; j++)\n      for (k = 0; k <= i - 1; k++)\n        if (a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          s++;\n    printf(\"%d\\n\", s);\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "12", "index": "22731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b;\n  cin >> b;\n  while (b != -1) {\n    int a[16] = {0};\n    int i, j = 0, k;\n    int sum = 0;\n    a[j] = b;\n    while (a[j] != 0) {\n      j++;\n      scanf(\"%d\", &a[j]);\n    }\n    for (i = 0; i < j - 1; i++) {\n      for (k = i + 1; k < j; k++) {\n        if (a[k] == a[i] * 2 || a[i] == a[k] * 2)\n          sum++;\n      }\n    }\n    printf(\"%d\\n\", sum);\n    scanf(\"%d\", &b);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[16], result[100];\n  int i, j, k, n = 0, row = 0;\n  while (1) {\n    for (i = 1; i < 16; i++)\n      sz[i] = 0;\n\n    scanf(\"%d\", &sz[0]);\n    if (sz[0] == -1) {\n      break;\n    } else {\n      k = 1;\n      for (i = 1; i < 16; i++) {\n        scanf(\"%d\", &sz[i]);\n        if (sz[i] == 0) {\n          break;\n        } else {\n          k++;\n        }\n      }\n      n = 0;\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < i; j++) {\n          if (sz[i] == sz[j] * 2 || sz[j] == sz[i] * 2) {\n            n++;\n          }\n        }\n      }\n      result[row] = n;\n      row++;\n    }\n  }\n  for (i = 0; i < row; i++) {\n    printf(\"%d\\n\", result[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[16], i = -1, j, number = 0; \n  do                                \n  {\n    for (i = 0; i < 16; i++) \n    {\n      a[i] = 0;\n    }\n    i = -1;\n    do \n    {\n      i++;\n      cin >> a[i];\n    } while (a[i] != 0 && a[i] != -1);\n    number = 0;                               \n    for (i = 0; a[i] != 0 && a[i] != -1; i++) \n    {\n      for (j = 0; a[j] != 0 && a[i] != -1; j++) \n      {\n        if (a[j] == a[i] * 2) \n        {\n          number++;\n        }\n      }\n    }\n    if (a[0] != -1) \n    {\n      cout << number << endl;\n    }\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int z[15], r[100];\n  int i, j, l;\n  int sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &z[i]);\n    if (z[i] == 0) {\n      r[sum] = 0;\n      for (j = 0; j < i - 1; j++) {\n        for (l = j + 1; l < i; l++) {\n          if (z[j] == 2 * z[l] || z[j] == 0.5 * z[l]) {\n            r[sum]++;\n          }\n        }\n      }\n      sum++;\n      i = -1;\n    } else if (z[i] == -1)\n      break;\n  }\n  for (i = 0; i < sum; i++) {\n    printf(\"%d\\n\", r[i]);\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20];\n  int flag;\n\n  cin >> flag;\n\n  while (flag != -1) {\n    a[0] = flag;\n    int i = 0;\n    int count = 0;\n\n    while (a[i] != 0) {\n      i++;\n      cin >> a[i];\n    }\n\n    for (int j = 0; j < i; j++) {\n      for (int k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k])\n          count++;\n      }\n    }\n\n    cout << count << endl;\n\n    cin >> flag;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, x = 0, y = 1, a = 0;\n  float n[20];\n  do {\n    i = 0;\n    j = 0;\n    k = 0;\n    x = 0;\n    y = 1;\n    do {\n      scanf(\"%d\", &n[j]);\n      if (n[j] == 0 || n[j] == -1)\n        break;\n      j++;\n    } while (j < 20);\n    if (n[j] == -1)\n      return 0;\n\n    do {\n      do {\n        if (n[x] == n[y] * 2 || n[x] == n[y] / 2)\n          i++;\n        y++;\n      } while (y < j);\n      x++;\n      y = x + 1;\n    } while (x < j);\n    cout << i << \"\\n\";\n  } while (a < 1);\n  return 0;\n}\n"}
{"label": "12", "index": "22737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[150] = {0}, i, j, k, num;\n  for (;;) {\n    num = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (a[j] == 2 * a[k]) {\n          num++;\n        }\n      }\n    }\n    if (a[0] != -1) {\n      cout << num << endl;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, count = 0;\n  while (1) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    for (i = 1; i <= 15; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n    }\n    for (j = 0; j <= i - 2; j++) {\n      for (k = j + 1; k <= i - 1; k++) {\n        if (a[k] / a[j] == 2 && a[k] % a[j] == 0 ||\n            a[j] % a[k] == 0 && a[j] / a[k] == 2)\n          count++;\n      }\n    }\n    cout << count << endl;\n    count = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, a[15], l, p = 0, t;\n  for (i = 1;; i++) {\n    cin >> a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      p = 0;\n      for (k = 1; k <= 15; k++) {\n        scanf(\"%d\", &a[k]);\n        if (a[k] == 0)\n          break;\n      }\n      for (t = 0; t <= k; t++)\n        for (l = 0; l <= k; l++) {\n          if (a[l] == a[t] * 2)\n            p = p + 1;\n        }\n      p = p - 1;\n      cout << p << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[16], j;\n  int k, m, y;\n  int i;\n  while (1 == 1) {\n    m = 0;\n    for (i = 0; i <= 15; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] == -1) {\n        y = 1;\n        break;\n      }\n      if (a[i] == 0)\n        break;\n      else\n        m = m + 1;\n    }\n    if (y == 1)\n      break;\n    else {\n\n      k = 0;\n      for (i = 0; i < m - 1; i++) {\n\n        for (j = i + 1; j < m; j++) {\n          if (a[i] == 2 * a[j] || a[j] == 2 * a[i])\n            k++;\n        }\n      }\n    }\n\n    printf(\"%d \", k);\n  }\n}\n"}
{"label": "12", "index": "22741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[16], i, j, k, l;\n  do {\n    i = 0;\n    l = -1;\n    for (j = 0; j <= 15; j++)\n      a[j] = 1;\n    do {\n      scanf(\"%d \", &a[i]);\n      i++;\n      if (a[0] == -1)\n        break;\n    } while (a[i - 1] != 0);\n    if (a[0] == -1) {\n      break;\n    }\n    for (j = 0; j <= i - 1; j++) {\n      for (k = 0; k <= i - 1; k++) {\n        if (a[j] == 2 * a[k])\n          l++;\n      }\n    }\n    printf(\"%d\\n\", l);\n  } while (a[0] != -1);\n  return 0;\n}\n"}
{"label": "12", "index": "22742", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[15] = {0}, i = 0, j = 0, m = 0;\n  cin >> a[0];\n  while (a[i] != 0) {\n    scanf(\"%d\", &a[i + 1]);\n    i = i + 1;\n  }\n  i = 0;\n  while (a[0] != -1) {\n    while (a[i] != 0) {\n      while (a[j] != 0) {\n        if (((float)a[j]) / ((float)a[i]) == 2)\n          m = m + 1;\n        j = j + 1;\n      }\n      j = 0;\n      i = i + 1;\n    }\n    printf(\"%d\\n\", m);\n    i = 0;\n    m = 0;\n    scanf(\"%d\", &a[0]);\n    while (a[i] != 0) {\n      scanf(\"%d\", &a[i + 1]);\n      i = i + 1;\n    }\n    i = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22743", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d = 0, s[15], i, j;\n  while (1) {\n    cin >> s[0];\n    if (s[0] == -1)\n      break;\n    for (i = 1; s[i - 1] != 0; i++)\n      scanf(\"%d\", &s[i]);\n    for (i = 0; s[i] != 0; i++)\n      for (j = 0; s[j] != 0; j++) {\n        if (s[i] == s[j] * 2)\n          d++;\n        else\n          d = d;\n      }\n    printf(\"%d\\n\", d);\n    d = 0;\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  int a[15];\n  cin >> k;\n  while (k != -1) {\n    n = 0;\n    m = 0;\n    i = 0;\n    while (k != 0) {\n      n++;\n      a[i] = k;\n      i++;\n      scanf(\"%d\", &k);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == 2 * a[j] || a[j] == 2 * a[i]) {\n          m++;\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n    scanf(\"%d\", &k);\n  }\n}\n"}
{"label": "12", "index": "22745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num[15], j, k, i, a = 0;\n  while (1) {\n    scanf(\"%d\", &num[0]);\n    if (num[0] != -1) {\n      i = 1;\n      do {\n        cin >> num[i];\n        i++;\n      } while (num[i - 1] != 0);\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++) {\n          if (num[k] == num[j] * 2 || num[j] == num[k] * 2)\n            a++;\n        }\n      }\n      cout << a << \"\\n\";\n      a = 0;\n    } else\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22746", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int x[15], sum = 0, n;\n  while (1) {\n    for (n = 0;; n++) \n    {\n      cin >> x[n];\n      if (x[n] <= 0)\n        break; \n    }\n    if (x[n] == -1)\n      break;                    \n    for (int i = 0; i < n; i++) \n    {\n      for (int j = 0; j < n; j++) {\n        if (x[j] == x[i] * 2)\n          sum = sum + 1;\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[100][15], i = 0, j, k, count, t;\n  for (i = 0;; i++) {\n    count = 0;\n    j = 0;\n    do {\n      cin >> n[i][j];\n      if (n[i][j] == -1)\n        goto loop;\n      j++;\n    } while (n[i][j - 1] != 0);\n    for (k = 0; k < j; k++) {\n      for (t = j - 1; t > k; t--) {\n        if (n[i][t] == 2 * n[i][k] || 2 * n[i][t] == n[i][k])\n          count++;\n      }\n    }\n    cout << count << endl;\n  }\nloop:\n  return 0;\n}\n"}
{"label": "12", "index": "22748", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a;\n  while (scanf(\"%d \", &a)) {\n    if (a != -1) {\n      int i = 0, j, k, p = 0;\n      int b[15] = {a};\n      while (b[i] != 0) {\n        scanf(\"%d \", &b[i + 1]);\n        i++;\n      }\n      for (j = 0; j < i; j++) {\n        for (k = j + 1; k < i; k++)\n          if (b[k] == 2 * b[j] || b[j] == 2 * b[k]) {\n            p = p + 1;\n          }\n      }\n      printf(\"%d\\n\", p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, num, a[16], c;\n  while (1) {\n    i = 0;\n    num = 0;\n    do {\n      cin >> a[i];\n      c = a[i];\n      i++;\n    } while (c != 0 && c != -1);\n\n    if (a[0] == -1)\n      break;\n\n    for (j = 0; j < i - 1; j++) {\n      for (k = 0; k < i - 1; k++)\n        if (a[j] == 2 * a[k])\n          num++;\n    }\n\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22750", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i, n, j, m, k;\n  int flag;\n  while (1) {\n    m = 0;\n    j = 0;\n    flag = 0;\n    for (i = 0;; i++) {\n      cin >> a[i];\n\n      if (a[i] == 0)\n        break;\n      else if (a[i] == -1) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n    for (j = 0; j < i - 1; j++)\n      for (k = j + 1; k < i; k++) {\n        if ((a[k] == a[j] * 2 || a[j] == a[k] * 2) && (a[j] != 0 && a[k] != 0))\n          m++;\n      }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[16] = {-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2},\n      sum = 0, i, j, s, t;\n\nA:\n  for (i = 0; a[i] != -1; i++) {\n    sum = 0;\n    a[0] = -2;\n    a[1] = -2;\n    a[2] = -2;\n    a[3] = -2;\n    a[4] = -2;\n    a[5] = -2;\n    a[6] = -2;\n    a[15] = -2;\n    a[7] = -2;\n    a[8] = -2;\n    a[9] = -2;\n    a[10] = -2;\n    a[11] = -2;\n    a[12] = -2;\n    a[13] = -2;\n    a[14] = -2;\n    for (s = 0; s <= 15; s++) {\n      cin >> a[s];\n      if (a[s] == 0) {\n        for (t = 0; t <= 15; t++) {\n          for (j = 0; j <= 15; j++) {\n            if (a[j] != 0 && a[t] != 0 && a[t] == a[j] * 2)\n              sum++;\n          }\n        }\n        cout << sum << \"\\n\";\n        break;\n      } else if (a[s] == -1)\n        goto A;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "12", "index": "22752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0;\n  int sz[16], erbei[16], sum = 0;\n  for (i = 0;; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (0 == sz[i]) {\n      for (j = 0; j < i; j++) {\n        erbei[k] = 2 * sz[j];\n        k++;\n      }\n      for (k = 0; k < i; k++) {\n        for (j = 0; j < i; j++) {\n          if (erbei[k] == sz[j]) {\n            sum++;\n          }\n        }\n      }\n      cout << sum << \"\\n\";\n      sum = 0;\n      i = -1;\n      k = 0;\n    }\n    if (-1 == sz[i]) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "12", "index": "22753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, a[16] = {0}, b[16];\n  do {\n    i = 0;\n    k = 0;\n    scanf(\"%d\", &a[0]);\n    b[0] = 2 * a[0];\n    if (a[0] == -1)\n      break;\n    else {\n      do {\n        i++;\n        scanf(\"%d\", &a[i]);\n        b[i] = 2 * a[i];\n      } while (a[i] != 0);\n    }\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (a[i] == b[j]) {\n          k++;\n        }\n      }\n    }\n    printf(\"%d \", k);\n  } while (1);\n  return 0;\n}\n"}
{"label": "12", "index": "22754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][16];\n  int z[100] = {0};\n  int i, j, s, m = 0;\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        break;\n      if (a[i][j] == -1)\n        goto loop;\n    }\n  }\nloop:\n  for (i = 0; a[i][0] != -1; i++) {\n    for (j = 0; a[i][j] != 0; j++) {\n      for (s = 0; a[i][s] != 0; s++)\n        if (a[i][j] == 2 * a[i][s])\n          z[i]++;\n    }\n    printf(\"%d \", z[i]);\n  }\n}\n"}
{"label": "12", "index": "22755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, j, k;\n  int nowi;\n  int output;\n  int part[20][16];\n  static int jcount[20], group[20];\n  for (i = 0; i < 20; i++) {\n    for (j = 0; j < 16; j++) {\n      scanf(\"%d \", &part[i][j]);\n      jcount[i]++;\n      if (part[i][j] <= 0)\n        break;\n    }\n    if (part[i][j] == -1)\n      break;\n  }\n  nowi = i;\n  for (i = 0; i < nowi; i++) {\n    for (j = 0; j < jcount[i] - 1; j++) {\n      for (k = 0; k < jcount[i] - 1; k++) {\n        if ((part[i][j] / part[i][k] == 2) && (part[i][j] % part[i][k] == 0))\n          group[i]++;\n      }\n    }\n  }\n\n  for (output = 0; output < nowi; output++)\n    cout << group[output] << endl;\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "12", "index": "22756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[16];\n  int i = 1, j, k, n = 0;\n  while (cin) {\n    scanf(\"%d \", &a[0]);\n    if (a[0] == -1)\n      break;\n    for (i = 1;; i++) {\n      cin >> a[i];\n      if (a[i] == 0)\n        break;\n      k = i;\n    }\n    for (j = 0; j <= k - 1; j++) {\n      for (i = j + 1; i <= k; i++) {\n        if (a[j] * 2 == a[i] || a[i] * 2 == a[j]) {\n          n = n + 1;\n        }\n      }\n    }\n    printf(\"%d\\n\", n);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0}; \n  int n = 0;          \n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i]; \n  }\n  int b[20001] = {0}; \n  int c[20001] = {0}; \n  int l = 1;          \n  for (int j = 1; j <= n; j++) {\n    for (int k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        b[j] = 1;\n        \n      }\n    }\n  }\n  for (int p = 1; p <= n; p++) {\n    if (b[p] == 0) {\n      c[l] = a[p];\n      l = l + 1; \n    }\n  }\n  for (int m = 1; c[m] > 0; m++) {\n    if (c[m + 1] > 0)       \n      cout << c[m] << \" \";  \n    if (c[m + 1] == 0)      \n      cout << c[m] << endl; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j[101] = {0}, a[20000], b[20000] = {0}, i, n, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (j[a[i]] == 0) {\n      j[a[i]] = 1;\n      b[x] = a[i];\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "22759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], p[200], x, step = -1;\n  scanf(\"%d \", &n);\n  memset(p, 0, sizeof(p));\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    if (p[x] == 0) {\n      step++;\n      a[step] = x;\n      p[x] = 1;\n    }\n  }\n  cout << a[0];\n  for (int j = 1; j <= step; j++)\n    cout << ' ' << a[j];\n  return 0;\n}\n"}
{"label": "13", "index": "22760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  cin >> a[1];\n  cout << a[1];\n  for (i = 2; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i - 1; ++j) {\n      b[i - 1] = 0;\n      b[j] = a[j] - a[i];\n      if (b[j] == 0)\n        break;\n    }\n    if (b[i - 1] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, input[20000], output[20000], i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    for (j = 0; j < i; j++) {\n      if (input[i] == input[j]) {\n        x++;\n        break;\n      }\n    }\n    if (x == 0) {\n      k++;\n      output[k] = input[i];\n    }\n  }\n  for (i = 1; i < k; i++) {\n    printf(\"%d \", output[i]);\n  }\n  if (i == k)\n    printf(\"%d\\n\", output[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "22762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 2; j <= n; j++) {\n    for (m = 1; m <= j - 1; m++) {\n      if (a[j - 1] == a[m - 1]) {\n        break;\n      }\n    }\n    if (m == j)\n      cout << \" \" << a[j - 1];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, c, j, k = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &c);\n    p = 1;\n    for (j = 0; j < k; j++)\n      if (a[j] == c)\n        p = 0;\n    if (p) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "22764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[20001] = {0}, number, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &number);\n    num[i] = number;\n  }\n  for (j = 1; j <= n; j++)\n    for (i = j + 1; i <= n; i++)\n      if (num[j] == num[i])\n        num[i] = 0;\n  for (i = 1; i <= n; i++)\n    if (num[i] != 0) {\n      cout << num[i];\n      break;\n    }\n  for (j = i + 1; j <= n; j++)\n    if (num[j] != 0)\n      printf(\" %d\", num[j]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "22765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (int t = 1; t < n; t++) {\n    int k = 0;\n    for (; k < t; k++)\n      if (a[t] == a[k])\n        break;\n    if (k == t)\n      cout << setw(3) << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < n; i++)\n      scanf(\" %d\", &a[i]); \n    for (i = 0, m = 0; i < n - m - 1; i++) {\n      for (j = i + 1; j < n - m; j++) {\n        if (a[i] != a[j])\n          continue;\n        else {\n          for (k = j; k < n - m - 1; k++) \n            a[k] = a[k + 1];\n          m++;\n          j--;\n        }\n      }\n    }\n    printf(\"%d\", a[0]);\n    for (i = 1; i < n - m; i++)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        k++;\n    if (k == 0) {\n      cout << \" \" << a[i];\n    }\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(int b[], int len, int x) {\n  int i, flag = 1;\n  for (i = 0; i < len; i++) {\n    if (b[i] == x) {\n      flag = 0;\n      return 0;\n      break;\n    }\n  }\n  if (flag)\n    return 1;\n}\nint main() {\n  int j, i, n;\n  int a[20100], b[20100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  b[0] = a[0];\n  j = 1;\n  for (i = 1; i < n; i++) {\n    if (check(b, j, a[i])) {\n      printf(\" %d\", a[i]);\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        a[j] = 0;\n    }\n    if (a[j])\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k, p, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (j = 1; j <= n - 1; j++) {\n    for (k = j + 1; k <= n;) {\n      if (a[j] == a[k]) {\n        for (p = k; p <= n - 1; p++) {\n          a[p] = a[p + 1];\n        }\n        n--;\n      } else {\n        k++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  int b[20001] = {0};\n  int c[20001] = {0};\n  int l = 1;\n  for (int j = 1; j <= n; j++) {\n    for (int k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        b[j] = 1;\n      }\n    }\n  }\n  for (int p = 1; p <= n; p++) {\n    if (b[p] == 0) {\n      c[l] = a[p];\n      l = l + 1;\n    }\n  }\n  for (int m = 1; c[m] > 0; m++) {\n    if (c[m + 1] > 0)\n      cout << c[m] << \" \";\n    if (c[m + 1] == 0) {\n      cout << c[m] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t, a[20000], b[100], c[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  t = 0;\n  for (i = 0; i < n; i++)\n    if (b[a[i]] == 1) {\n      c[t] = a[i];\n      t++;\n      b[a[i]] = 0;\n    }\n  for (i = 0; i < t - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[t - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t;\n  int flag[100];\n  memset(flag, 0, sizeof(flag));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t;\n    if (0 == flag[t]) {\n      flag[t] = 1;\n      if (0 == i)\n        cout << t;\n      else\n        printf(\" %d\", t);\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, j, n, num[20000], judge; \n                                  \n  cin >> n;\n  cout << endl;\n  if (n > 0 && n <= 20000) \n  {\n    for (i = 0; i < n; i++) {\n      judge = 0;\n      cin >> judge;\n      if (judge >= 10 && judge < 100) \n                                      \n      {\n        num[i] = judge;\n      }\n    }\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++) {\n        if (num[i] - num[j] == 0) \n                                  \n          num[i] = 0;             \n      }\n    cout << num[0];\n    for (i = 1; i < n; i++) {\n      if (num[i] != 0) \n        cout << \" \" << num[i];\n    }\n  } else {\n    cout << \"error\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, s = 0;\n  scanf(\"%d \", &n);\n  if (n < 1 || n > 20000)\n    return 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] < 10 || a[i] >= 100)\n      return 0;\n  }\n  for (j = 0; j < n - s; j++) {\n    for (i = n - 1 - s; i > j; i--) {\n      if (a[j] == a[i]) {\n        s = s + 1;\n        for (k = i; k < n - s; k++)\n          a[k] = a[k + 1];\n      }\n    }\n  }\n  for (i = 0; i < n - s; i++) {\n    if (i != n - s - 1)\n      cout << a[i] << \" \";\n    else\n      cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  scanf(\"%d\", &n);\n  if (n == 0)\n    return (0);\n  else {\n    scanf(\"%d\", &x);\n    printf(\"%d\", x);\n    a[0] = x;\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &x);\n      k = 0;\n      while ((k < m) && (a[k] != x))\n        k++;\n      if (k == m) {\n        a[m++] = x;\n        cout << \" \" << x;\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22778", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int jud[200], num[30000], n, i, j, sum, res[200];\n  scanf(\"%d\", &n);\n  sum = 0;\n  for (i = 1; i <= 100; i++)\n    jud[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> num[i];\n    if (jud[num[i]] == 0) {\n      sum++;\n      res[sum] = num[i];\n      jud[num[i]] = 1;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    printf(\"%d \", res[i]);\n  printf(\"%d\", res[sum]);\n  return 0;\n}\n"}
{"label": "13", "index": "22779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, b[20001], i, j = 0, c[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (a[b[i]] == 0) {\n      j++;\n      c[j] = b[i];\n      a[b[i]] = 1;\n    }\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", c[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001];\n  int n, i, j, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  num = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        num++;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      j++;\n      if (j != n - num) {\n        cout << a[i] << \" \";\n      } else {\n        printf(\"%d\", a[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "22781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, j, k, n, x, sum;\n  scanf(\"%d\", &n);\n  k = 0;\n  sum = 0;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    k = 0;\n    scanf(\"%d\", &x);\n    for (j = 0; j < i; j++)\n      if (x == a[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      a[i - sum] = x;\n    else\n      sum++;\n  }\n  for (i = 0; i < n - sum - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - sum - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "22782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int number[1000000];\n  cin >> n;\n  for (int i1 = 0; i1 < n; i1++) {\n    cin >> number[i1];\n  }\n  for (int i2 = 0; i2 < n; i2++) {\n    for (int i3 = i2 + 1; i3 < n; i3++) {\n      if (number[i2] == number[i3]) {\n        number[i3] = 0;\n      }\n    }\n  }\n  cout << number[0];\n  for (int i4 = 1; i4 < n; i4++) {\n    if (number[i4] != 0) {\n      cout << \" \" << number[i4];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        b[i]++;\n        break;\n      }\n  for (i = 1; i < n; i++)\n    if (b[i] == 0)\n      printf(\" %d\", a[i]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "22784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint god(int num1, int num2);\nint main(void) {\n  int number, ctr, i;\n  int n[20000], c[20000];\n  cin >> number;\n  for (i = 0; i <= 20000; i++) {\n    c[i] = 0;\n  }\n  for (ctr = 0; ctr < number; ctr++) {\n    cin >> n[ctr];\n  }\n  cout << n[0];\n  for (ctr = 1; ctr < number; ctr++) {\n    for (i = 0; i < ctr; i++) {\n      if (n[i] == n[ctr]) {\n        c[ctr]++;\n      }\n    }\n    if (c[ctr] == 0)\n      printf(\" %d\", n[ctr]);\n  }\n\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "22785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  int i = 0;\n  int x;\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[i] = x;\n  i++;\n  for (int j = 1; j < n; j++) {\n    int h;\n    int k = 0;\n    scanf(\"%d\", &h);\n    for (int t = 0; t < i; t++) {\n      if (h == a[t])\n        k = 1;\n    }\n    if (k == 0) {\n      printf(\" %d\", h);\n      a[i] = h;\n      i++;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] != a[i]) {\n        k = k + 1;\n      }\n      if (a[j] == a[i]) {\n        k = 0;\n        break;\n      }\n    }\n\n    if (k != 0) {\n      cout << \" \" << a[i];\n      k = 0;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, num = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = n - 1; i > 0; i--) {\n    for (k = i - 1; k >= 0; k--) {\n\n      if (a[i] == a[k]) {\n        if (i == n - 1) {\n          a[i] = 0;\n          num++;\n          break;\n\n        } else {\n          for (j = i; j < n - 1; j++)\n            a[j] = a[j + 1];\n          a[j] = 0;\n          num++;\n          break;\n        }\n      }\n    }\n  }\n\n  cout << a[0];\n  for (i = 1; i < n - num; i++)\n    cout << \" \" << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22788", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[n];\n  cin >> num[0];\n  cout << num[0];\n  for (int i = 1; i < n; i++) {\n    cin >> num[i];\n    for (int j = 0; j < i; j++) {\n      if (num[j] == num[i])\n        num[i] = 0;\n    }\n    if (num[i])\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22789", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  int z[30000];\n  int c[30000];\n  int x[101];\n  scanf(\"%d\", &n);\n  for (a = 10; a <= 100; a++) {\n    x[a] = 1;\n  }\n  for (a = 1; a <= n; a++) {\n    scanf(\"%d \", &z[a]);\n  }\n  b = 1;\n  for (a = 1; a <= n; a++) {\n    if (x[z[a]] == 1) {\n      c[b] = z[a];\n      b += 1;\n      x[z[a]] = 0;\n    }\n  }\n  for (a = 1; a <= b - 1; a++) {\n    if (a < b - 1)\n      printf(\"%d \", c[a]);\n    else\n      printf(\"%d\", c[a]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22790", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100];\n  for (int i = 2; i <= 100; i++) {\n    a[i] = 0;\n  }\n  int n;\n  cin >> n;\n  int b;\n  cin >> b;\n  printf(\"%d\", b);\n  a[b] = 1;\n  for (int i = 2; i <= n; i++) {\n\n    scanf(\"%d \", &b);\n    if (a[b] == 0) {\n      a[b] = 1;\n      cout << ' ' << b;\n    }\n  }\n}\n"}
{"label": "13", "index": "22791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  int a[20000];\n  int count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int count = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (count == 0)\n      cout << \" \" << a[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22792", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a, b;\n  scanf(\"%d\", &n);\n  int num[20000];\n  int res[20000];\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  b = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    a = num[i];\n    for (j = 0; j <= i; j++) {\n      if (i == j) {\n        b = a;\n        continue;\n      }\n      if (a != num[j])\n        b = a;\n      else {\n        b = 0;\n        break;\n      }\n    }\n\n    if (b != 0) {\n      k++;\n      res[k] = b;\n    }\n  }\n  for (l = 1; l <= k; l++) {\n    if (l != k)\n      printf(\"%d \", res[l]);\n    else\n      printf(\"%d\", res[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22793", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[20000];\n  int i, j, k, h;\n  int check[20000];\n  int n;\n  scanf(\"%d \", &n);\n  check[0] = 0;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 1; j < n; j++) {\n    check[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (num[j] == num[k]) {\n        check[j] = 1;\n        break;\n      }\n    }\n  }\n  cout << num[0];\n  for (h = 1; h < n; h++) {\n    if (check[h] == 0)\n      cout << \" \" << num[h];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22794", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[91];\n  int i, n, number;\n  scanf(\"%d \", &n);\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &number);\n  a[number - 10]++;\n  if (a[number - 10] == 1)\n    cout << number;\n  for (i = 1; i < n; i++) {\n    cin >> number;\n    a[number - 10]++;\n    if (a[number - 10] == 1)\n      cout << \" \" << number;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100];\n  int i, n, number, count, countl;\n  count = 0;\n  countl = 0;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number);\n    if (a[number] == 0) {\n      a[number] = 1;\n\n      b[count] = number;\n      count = count + 1;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    countl = countl + 1;\n    cout << b[i];\n    if (countl < count) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22796", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, n, i = 0, j = 0, a[20000];\n  cin >> N;\n  while (i <= N - 1) {\n    scanf(\"%d \", &n);\n    a[i] = n;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= N - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      cout << ' ' << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, j, i, leap = 0, f = 1;\n  int m[20000];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < a; i++) {\n    leap = 0;\n\n    for (j = 0; j < i + 1; j++) {\n      if (j == i)\n        continue;\n      else {\n        if (m[i] == m[j]) {\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 0 && f == 1) {\n      cout << m[i];\n      f = 0;\n      continue;\n    }\n    if (leap == 0 && f == 0)\n      printf(\" %d\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[100000];\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  i = 1;\n  while (i < n) {\n    int j = 0, x = 0;\n    while (j < i) {\n      if (a[i] == a[j]) {\n        x = 1;\n        break;\n      }\n      j++;\n    }\n    if (x == 0)\n      printf(\" %d\", a[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  cin >> n;\n  int num[20001] = {0};\n  for (i = 1; i <= n; i++)\n    cin >> num[i];\n  cout << num[1];\n  for (i = 2; i <= n; i++) {\n    int k = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (num[i] == num[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 1, r = 1, number[20001], number1[20001] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i != n + 1; i++) {\n    cin >> number[i];\n    for (j = 1, k = 1; j <= i; j++) {\n      if (number[i] == number1[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1) {\n      if (i == 1) {\n        cout << number[1];\n        number1[1] = number[1];\n        r++;\n      } else {\n        cout << \" \" << number[i];\n        number1[r] = number[i];\n        r++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "22802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j, m;\n  cin >> n;\n  int a[20000] = {0};\n  cin >> t;\n  cout << t;\n  m = 1;\n  a[0] = t;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    for (j = 0; j < m; j++) {\n      if (a[j] == t)\n        break;\n    }\n    if (j >= m) {\n      printf(\" %d\", t);\n      a[m] = t;\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[20000], sign;\n  int b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (i != s - 1) {\n      (cout << b[i] << \" \");\n    } else\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 0, t = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 0; t <= i - 1; t++) {\n      if (a[i] == a[t])\n        p++;\n    }\n\n    if (p != 0)\n      a[i] = 0;\n    p = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (t = i + 1; t <= n - 1; t++) {\n    if (a[t] != 0) {\n      printf(\" %d\", a[t]);\n    }\n  }\n}\n"}
{"label": "13", "index": "22805", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int f[20001];\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    f[i] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    if (f[a] == 0) {\n      f[a] = 1;\n      if (i != 1)\n        cout << ' ';\n      cout << a;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20010];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        i--;\n        n--;\n      }\n  }\n  for (int k = 0; k < n - 1; k++)\n    cout << a[k] << \" \";\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "22807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, n, k, t;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    t = 0;\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k])\n        t = 1;\n    }\n    if (t == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22808", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l = 1;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  i++;\n  for (; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag)\n      cout << ' ' << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  int a[100] = {0};\n  scanf(\"%d\", &k);\n  a[k] = a[k] + 1;\n  printf(\"%d\", k);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &k);\n    a[k] = a[k] + 1;\n    if (a[k] == 1)\n      printf(\" %d\", k);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22810", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, i, j, k, m, a[20000]; \n  cin >> n;                    \n  for (i = 0; i < n; i++)      \n    cin >> a[i];\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) \n      {\n        for (m = k + 1; m < n; m++) \n          a[m - 1] = a[m];\n        n -= 1; \n        k -= 1;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1]; \n  return 0;\n}\n"}
{"label": "13", "index": "22811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        for (k = i; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cout << a[i];\n    if (i != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[101] = {0};\n  int n, a;\n  cin >> n;\n  int f = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    if (flag[a] == 0) {\n      flag[a] = 1;\n      if (f == 0) {\n        printf(\"%d\", a);\n        f = 1;\n      } else {\n        cout << \" \" << a;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22813", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[20000];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int j;\n  int k;\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    while (j < n)\n      if (a[i] == a[j]) {\n        n--;\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n      } else {\n        j++;\n      }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "22814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[10000], i, j, x[10000], z = 0, h = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &x[i - 1]);\n  m[0] = x[0];\n  for (i = 2; i <= n; i++) {\n    z = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (x[j - 1] == x[i - 1])\n        z = 1;\n    if (z == 0) {\n      m[h] = x[i - 1];\n      h = h + 1;\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%d\", m[i]);\n    if (i != h - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22815", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t[20000], a, s[100];\n  cin >> n;\n  for (i = 0; i < 100; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t[i]);\n    if (s[t[i]] == 0) {\n      s[t[i]] = 1;\n    } else if (s[t[i]] == 1) {\n      t[i] = 101;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (t[i] != 101) {\n      a = i;\n      printf(\"%d\", t[i]);\n      break;\n    }\n  }\n\n  for (i = a + 1; i < n; i++) {\n    if (t[i] != 101) {\n      printf(\" %d\", t[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 1;\n    }\n  for (int i = 1; i < n; i++) {\n    if (a[i] > 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000] = {0};\n  int n, c, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &c);\n  a[0] = c;\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &c);\n    a[i] = c;\n    for (j = 0; j <= i - 1; j++) {\n      if (c == a[j])\n        a[i] = 0;\n    }\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, b[20000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        b[j]++;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      cout << ' ' << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22819", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag, a[20001];\n  cin >> n;\n  cin >> a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, b[101] = {0}, flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[a[i]] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n      } else {\n        cout << ' ' << a[i];\n      }\n      b[a[i]] = 1;\n    } else\n      continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n[101] = {0};\n  int nin;\n  scanf(\"%d \", &nin);\n  int N;\n  int num[nin], count = 0;\n  for (int i = 1; i <= nin; ++i) {\n    scanf(\"%d \", &N);\n    if (!n[N]) {\n      num[count] = N;\n      count++;\n    }\n    n[N]++;\n  }\n  for (int i = 0; i <= count - 2; ++i)\n    printf(\"%d \", num[i]);\n  cout << num[count - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "22822", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20000], b = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k <= j; k++) {\n      if (a[k] != a[j])\n        b++;\n    }\n    if (b == j)\n      printf(\" %d\", a[j]);\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22823", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i;\n  int buf;\n  int appeared[110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> buf;\n    if (!appeared[buf]) {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", buf);\n      appeared[buf] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, m, b, a[20000];\n  i = 0;\n  scanf(\"%d\\n\", &n);\n  for (; i <= n - 1; i++) {\n    if (i < n - 1)\n      scanf(\"%d \", &a[i]);\n    else\n      scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (j == 0)\n      printf(\"%d\", a[j]);\n    else {\n      for (m = 0, b = 0; m < j; m++) {\n        if (a[j] == a[m])\n          b++;\n      }\n      if (b == 0)\n        cout << \" \" << a[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, t, x, a[20000], n, m, l;\n  l = 0;\n  m = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    cin >> x;\n\n    for (i = 1; i <= m + 1; i++)\n      if (x == a[i - 1])\n        l = 1;\n    if (l == 0) {\n      a[m] = x;\n      m = m + 1;\n    }\n    l = 0;\n  }\n  cout << a[0];\n  for (t = 1; t <= m - 1; t++)\n    printf(\" %d\", a[t]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[20001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0 && i != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22827", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, on = 0;\n  scanf(\"%d \", &n);\n  int input_array[n], output_array[100], otn_array[n];\n  memset(output_array, 0, sizeof(output_array));\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &input_array[i]);\n  for (int i = 0; i < n; i++) {\n    int otn = input_array[i];\n    if (!output_array[otn - 1]) {\n      output_array[otn - 1] = 1;\n      otn_array[on] = otn;\n      on++;\n    }\n  }\n  for (int i = 0; i < on; i++) {\n    cout << otn_array[i];\n    if (i != on - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 1, i = 0, n = 0, j = 0, k = 0;\n  cin >> m;\n  int a[20000] = {0};\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < m; i++) {\n    cin >> a[i];\n    k = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, b[101] = {0}, flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    if (b[a[i]] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n      } else\n        cout << ' ' << a[i];\n\n      b[a[i]] = 1;\n    } else\n      continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22830", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (i == j) \n    {\n      cout << \" \" << a[i]; \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0, c = 0; j < i; j++) {\n      if (a[i] != a[j])\n        c++;\n    }\n    if (c == i)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 1, n, j, r = 0, a[20001], b[101]; \n  cin >> n;\n  memset(b, 1, sizeof(b)); \n\n  do {\n    r = r + 1;     \n    cin >> j;      \n    if (b[j] != 0) \n    {\n      a[i] = j;\n      b[a[i]] = 0;\n      i = i + 1;\n    }\n  } while (r < n);\n\n  for (j = 1; j < i - 1; j++)\n    cout << a[j] << ' ';\n  cout << a[i - 1]; \n\n  return 0;\n}\n"}
{"label": "13", "index": "22833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, b, a[20000];\n  i = 0;\n  scanf(\"%d\\n\", &n);\n  for (; i <= n - 1; i++) {\n    if (i < n - 1)\n      scanf(\"%d \", &a[i]);\n    else\n      scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (j == 0)\n      printf(\"%d\", a[j]);\n    else {\n      for (m = 0, b = 0; m < j; m++) {\n        if (a[j] == a[m])\n          b++;\n      }\n      if (b == 0)\n        printf(\" %d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint hs(int a);\nint main() {\n  int n, b[20002], i, j, pd, js;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  js = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        js--;\n        break;\n      }\n    }\n  }\n  pd = 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        pd = 0;\n      }\n    }\n    if (pd == 1 && js != 1) {\n      cout << b[i] << \" \";\n      js--;\n    } else if (pd == 1 && js == 1) {\n      printf(\"%d\", b[i]);\n      break;\n    }\n    pd = 1;\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "22835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n\n    if (t == 0) {\n      if (m > 0)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, l, m, n;\n  scanf(\"%d\", &n);\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n\n    m = 0;\n    for (k = 1; k < i; k++) {\n      if (a[k] != a[i])\n        m = m + 1;\n    }\n    if (m == i - 1) {\n      l = l + 1;\n      if (l == 1)\n        printf(\"%d\", a[i]);\n      else\n        cout << \" \" << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      t = 0;\n      if (a[i] == a[j]) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t;\n  int flag[100];\n  memset(flag, 0, sizeof(flag));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t;\n    if (0 == flag[t]) {\n      flag[t] = 1;\n      if (0 == i)\n        cout << t;\n      else\n        cout << \" \" << t;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20002] = {1}, n, i, j, k;\n  scanf(\"%d\", &n);\n  cin >> a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = i - 1; j > 0; j--) {\n      if (a[i] == a[j])\n        break;\n      else\n        k = k + 1;\n    }\n    if (k == i - 1)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000], b[20000];\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = a[0];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      ;\n    else {\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[j - 1];\n}\n"}
{"label": "13", "index": "22841", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "22842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[101];\n  int n, i, x;\n\n  for (i = 0; i <= 100; i++)\n    s[i] = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    if (s[x] == 0) {\n      if (i > 0) {\n        cout << ' ';\n      }\n      cout << x;\n      s[x] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    t = 0;\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t = t + 1;\n      }\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        for (k = i; k < n; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cout << a[i];\n    if (i != n - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[20000], st[91], tot = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (num[j] == num[i])\n        break;\n\n    if (j == i)\n      st[++tot] = num[i];\n  }\n  for (i = 1; i < tot; i++)\n    cout << st[i] << \" \";\n  printf(\"%d\", st[tot]);\n}\n"}
{"label": "13", "index": "22846", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num[100000], n, i, j, k, m, l;\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num[i]);\n  }\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (num[j] == num[k]) {\n        num[k] = 0;\n      }\n    }\n  for (m = 0, l = 0; m < n; m++) {\n    if (num[m] >= 10) {\n      l++;\n      if (l == 1) {\n        printf(\"%d\", num[m]);\n      } else {\n        printf(\" %d\", num[m]);\n      }\n    }\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "13", "index": "22847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[20000], n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j])\n        j = i + 1;\n      else\n        j++;\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "22848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  cin >> p[0];\n  printf(\"%d\", p[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &p[i]);\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", p[i]);\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22849", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12683], b[12683];\n  int i, j, n, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n    b[i] = 1;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j]) {\n        b[j] = 0;\n        break;\n      } else\n        b[j] = 1;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] == 1) {\n      printf(\" \");\n      printf(\"%d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22850", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n = 0, i = 0, j = 0, c = 0;\n  for (i = 0; i < 20000; i++)\n    a[i] = 0;\n  cin >> n;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    c = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        c = 1;\n    if (c == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, b[101] = {0}, flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[a[i]] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n      } else {\n        cout << ' ' << a[i];\n      }\n      b[a[i]] = 1;\n    } else\n      continue;\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "22852", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a, n, i;\n  int f[20001] = {0}; \n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    if (f[a] == 0) \n    {\n      if (i == 1)\n        cout << a;\n      else\n        cout << \" \" << a;\n      f[a] = 1; \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0};\n  cin >> n;\n  int count = n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      for (int j = i + 1; j <= n; j++)\n        if (a[j] == a[i]) {\n          a[j] = 0;\n          count -= 1;\n        }\n    }\n  }\n  if (count > 1) {\n    int i;\n    for (i = 1; i <= n; i++) {\n      if (a[i] != 0) {\n        cout << a[i] << ' ';\n        count--;\n      }\n      if (count == 1)\n        break;\n    }\n    for (i = i + 1; i <= n; i++) {\n      if (a[i] != 0)\n        cout << a[i];\n    }\n  } else\n    for (int i = 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "22854", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n[101] = {0}; \n  int nin;          \n  cin >> nin;\n  int N;\n  int num[nin], count = 0; \n  for (int i = 1; i <= nin; ++i) {\n    cin >> N;\n    if (!n[N]) {\n      num[count] = N;\n      count++;\n    }\n    n[N]++; \n  }\n  for (int i = 0; i <= count - 2; ++i)\n    cout << num[i] << ' ';\n  cout << num[count - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "22855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a, b;\n  cin >> n;\n  int num[20000];\n  int res[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  b = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    a = num[i];\n    for (j = 0; j <= i; j++) {\n      if (i == j) {\n        b = a;\n        continue;\n      }\n      if (a != num[j])\n        b = a;\n      else {\n        b = 0;\n        break;\n      }\n    }\n\n    if (b != 0) {\n      k++;\n      res[k] = b;\n    }\n  }\n  for (l = 1; l <= k; l++) {\n    if (l != k)\n      cout << res[l] << \" \";\n    else\n      printf(\"%d\", res[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (s[j] == s[i])\n        s[i] = 0;\n    }\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++) {\n    if (s[i] != 0)\n      cout << \" \" << s[i];\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k;\n  cin >> n;\n  int N[n];\n  for (i = 0, k = 0; i < n; i++, k++) {\n    cin >> N[k];\n    for (j = 0; j < k; j++) {\n      if (N[j] == N[k])\n        k--;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == (k - 1))\n      cout << N[i];\n    else\n      cout << N[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000];\n  cin >> n;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i -= 1;\n        n -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22859", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[20001];\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    f[i] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    if (f[a] == 0) {\n      f[a] = 1;\n      if (i != 1) {\n        cout << ' ';\n      }\n      cout << a;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if ((i < n) && (i > 0))\n        printf(\" \");\n      cout << m[i];\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  int a[100000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  count = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      if (count == 0) {\n        printf(\"%d\", a[i]);\n        count = 1;\n      } else\n        printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[20000], n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j])\n        j = i + 1;\n      else\n        j++;\n      if (j == i)\n        cout << \" \" << a[i];\n    }\n  }\n}\n"}
{"label": "13", "index": "22863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101], number, i;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  cin >> number;\n  printf(\"%d\", number);\n  a[number] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number] = 1;\n      printf(\" %d\", number);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22864", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k, m = 0;\n  scanf(\"%d \", &N);\n  const int n = N;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - m; i++)\n    for (j = i; j <= n - m; j++) {\n      if (a[i] == a[j + 1]) {\n        for (k = j + 1; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n        j--;\n      }\n    }\n  cout << a[0];\n  for (i = 1; i < n - m; i++) {\n\n    printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, c = 0, q[20001];\n  cin >> n;\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &q[k]);\n\n  printf(\"%d\", q[0]);\n  for (i = 1; (i < n); i++) {\n    c = 0;\n    for (j = 0; j < i; j++) {\n      if (q[j] == q[i])\n        c++;\n      else\n        c = c + 0;\n    }\n\n    if (c == 0)\n      printf(\" %d\", q[i]);\n    else\n      f++;\n  }\n}\n"}
{"label": "13", "index": "22866", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  int x[n + 1];\n  x[0] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    scanf(\"%d \", &a);\n    x[i] = a;\n  }\n  int j;\n  for (j = n; j > 1; j--) {\n    int k;\n    for (k = 1; k < j; k++) {\n      if (x[k] == x[j]) {\n        x[j] = 0;\n      }\n    }\n  }\n  cout << x[1];\n  for (i = 2; i <= n; i++) {\n    if (x[i] != 0) {\n      cout << \" \" << x[i];\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "22867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, l, m, n, a[20000], b[90], x;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (j = 0; j < n; j++) {\n    for (l = 0; l < k; l++) {\n      if (a[j] == b[l]) {\n        m = 1;\n      }\n    }\n    if (m != 1) {\n      b[k] = a[j];\n      k++;\n    }\n    m = 0;\n  }\n  cout << b[0];\n  for (x = 1; x < k; x++)\n    cout << \" \" << b[x];\n  return 0;\n}\n"}
{"label": "13", "index": "22868", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j, b[20000] = {0}, p = 1, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n; i >= 2; i--) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        m += 1;\n    }\n    if (m == 0) {\n      b[p] = a[i];\n      p++;\n    }\n    m = 0;\n  }\n  p = p - 1;\n  b[p + 1] = a[1];\n  for (i = p + 1; i >= 2; i--) {\n    cout << b[i] << \" \";\n  }\n  cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22869", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j, m;\n  cin >> n;\n  int a[20000] = {0};\n  cin >> t;\n  cout << t;\n  m = 1;\n  a[0] = t;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    for (j = 0; j < m; j++) {\n      if (a[j] == t) {\n        break;\n      }\n    }\n    if (j >= m) {\n      cout << ' ' << t;\n      a[m] = t;\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22870", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, q, x = 1;\n  int shuzu[1000], panduan[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(shuzu[i]));\n  }\n  panduan[0] = 0;\n  for (i = 1; i < n; i++) {\n    for (q = 0, j = 0; j < i; j++) {\n      if (shuzu[j] == shuzu[i]) {\n        q = 1;\n        break;\n      }\n    }\n\n    panduan[i] = q;\n  }\n  for (i = 0, x = 0; i < n; i++) {\n    if (panduan[i] == 0) {\n      x = x + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (panduan[i] == 0 && (x != 1)) {\n      printf(\"%d \", shuzu[i]);\n      x--;\n    } else if (panduan[i] == 0 && (x == 1)) {\n      printf(\"%d\", shuzu[i]);\n      x--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22871", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int m, i, j;\n  cin >> m;\n  int a[m]; \n  for (i = 0; i < m; i++) {\n    cin >> a[i];            \n    for (j = 0; j < i; j++) \n      if (a[j] == a[i])\n        break;\n    if (j == i) {\n      if (j == 0)\n        cout << a[i];\n      else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[20000] = {0}, a, i = 0, n, p = 0, j, k;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    scanf(\"%d\", &a);\n    for (j = 0, k = 0; j < i; j++) {\n      if (c[j] == a) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      c[p] = a;\n      p++;\n    }\n    i++;\n  }\n  for (j = 0; j < p; j++) {\n    cout << c[j];\n    if (j < p - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "13", "index": "22873", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, i, j = 0, k;\n  int a[91] = {0};\n  cin >> n;\n  int b[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    if (a[num - 10] == 0) {\n      b[j] = num;\n      a[num - 10]++;\n      j++;\n    }\n  }\n  cout << b[0];\n  for (k = 1; k <= n; k++) {\n    if (b[k] == 0)\n      break;\n    else\n      printf(\" %d\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"\\n\");\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[20000], i, j = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> m[i];\n    for (j = 0; j < i; j++) {\n      if (m[i] == m[j]) {\n        break;\n      }\n    }\n    if (i == j) {\n      if (count == 0) {\n        printf(\"%d\", m[i]);\n        count++;\n      } else\n        printf(\" %d\", m[i]);\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, flag;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22877", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k;\n  i = 0;\n  k = 1;\n  scanf(\"%d\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n  } else {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n    for (i = 1; i < n; i++, k++) {\n      scanf(\"%d\", &a[i]);\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (k < (n - 1)) {\n        if (i == j)\n          printf(\" %d\", a[i]);\n      } else {\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j])\n            break;\n        }\n        if (i == j)\n          printf(\" %d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int num, count[100] = {0};\n  scanf(\"%d \", &num);\n  count[num]++;\n  cout << num;\n  for (i = 2; i <= n; i++) {\n    cin >> num;\n    count[num]++;\n    if (count[num] == 1)\n      cout << \" \" << num;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, x;\n  int sz[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &sz[0]);\n  printf(\"%d\", sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    x = 0;\n    for (k = 0; k < i; k++) {\n\n      if (sz[i] == sz[k]) {\n        break;\n      } else {\n        if (sz[i] != sz[k]) {\n          x++;\n        }\n      }\n      if (x == i) {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int number[1000];\n  int i;\n  i = 0;\n  while (i < n) {\n    cin >> number[i];\n    i++;\n  }\n  i = 1;\n  int j = 0;\n  cout << number[0];\n  while (i < n) {\n    while (j < i) {\n      if (number[i] == number[j])\n        break;\n      else {\n        j++;\n      }\n      if (j == i) {\n        printf(\" %d\", number[i]);\n      }\n    }\n    j = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    a[i] = m;\n  }\n  for (int ii = 0; ii < n; ii++)\n    for (int j = ii + 1; j < n; j++) {\n      if (a[j] == a[ii]) {\n        a[j] = 101;\n      }\n    }\n  int b = 1;\n  for (int l = 0; l < n; l++) {\n\n    if (a[l] < 100 && b == 1) {\n      printf(\"%d\", a[l]);\n      b += 1;\n    } else if (a[l] < 100 && b != 1)\n      printf(\" %d\", a[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, k, j, l, m, bn;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  m = 0;\n  for (j = 1; j < n; j++) {\n    for (k = 0, l = 1; k < j; k++) {\n      if (a[j] == a[k]) {\n        l = 0;\n        break;\n      }\n    }\n    if (l != 0) {\n      m += 1;\n      b[m] = a[j];\n    }\n  }\n  for (bn = 0; bn < m; bn++) {\n    printf(\"%d \", b[bn]);\n  }\n  printf(\"%d\", b[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "22883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20010], b[20010] = {0}, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 0; j <= m; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n      if (j == m) {\n        b[m] = a[i];\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (i == m - 1)\n      cout << b[i];\n    else\n      cout << b[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, t = 0, b, p;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - t; j++) {\n    for (k = j + 1; k < n - t;) {\n      if (a[k] == a[j]) {\n        for (p = k; p < n - t; p++)\n          a[p] = a[p + 1];\n        t++;\n      } else\n        k++;\n    }\n  }\n  for (b = 0; b < n - 1 - t; b++)\n    cout << a[b] << \" \";\n  cout << a[n - 1 - t] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22885", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 1, n, j, r = 0, a[20001], b[101];\n  cin >> n;\n  memset(b, 1, sizeof(b));\n\n  do {\n    r = r + 1;\n    cin >> j;\n    if (b[j] != 0) {\n      a[i] = j;\n      b[a[i]] = 0;\n      i = i + 1;\n    }\n  } while (r < n);\n\n  for (j = 1; j < i - 1; j++)\n    cout << a[j] << ' ';\n  printf(\"%d\", a[i - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "22886", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, c;\n  int a[20000] = {0};\n  scanf(\"%d \", &c);\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (n = 1; n < c; n++) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[j] == a[n])\n        break;\n      else\n        continue;\n    }\n    if (j == -1)\n      cout << \" \" << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b[101] = {0}, i;\n\n  cin >> n;\n  int a[20001] = {0};\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = b[a[i]] + 1;\n  }\n  printf(\"%d\", a[1]);\n  b[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (b[a[i]] != 0)\n      cout << \" \" << a[i];\n    b[a[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22888", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m;\n  int x[20000] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d \", &x[i]);\n  printf(\"%d\", x[0]);\n  for (i = 0; i <= k - 2; i++) {\n    for (j = i + 1; j <= k - 1;) {\n      if (x[i] == x[j]) {\n        for (m = j + 1; m <= k - 1; m++)\n          x[m - 1] = x[m];\n        k--;\n      } else\n        j++;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    printf(\" %d\", x[i]);\n}\n"}
{"label": "13", "index": "22889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n, i, j;  \n  cin >> n;               \n  for (i = 0; i < n; i++) \n    cin >> a[i];          \n  for (i = 0; i < n; i++) \n  {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] == a[i]) \n        a[j] = -1;\n    }\n  }\n  cout << a[0];           \n  for (i = 1; i < n; i++) \n    if (a[i] != -1)\n      cout << \" \" << a[i]; \n  return 0;\n}\n"}
{"label": "13", "index": "22890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, num[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 1; j <= i - 1; j++)\n      if (num[j - 1] == num[i - 1]) {\n        num[i - 1] = 0;\n        break;\n      }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (num[i] != 0)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22891", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int c[n];\n  scanf(\"%d\", &c[1]);\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d \", &c[i]);\n    for (j = 1; j <= i - 1; j++) {\n      if (c[j] == c[i]) {\n        break;\n      }\n    }\n    if (j == i)\n      printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000], j, k, b = 0, c[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    k = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "22893", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, x; \n  int a[100];\n  cin >> n;\n  for (int k = 0; k < 100; k++)\n    a[k] = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> x; \n    for (int j = 10; j < 100; j++) {\n\n      if (x == j)\n        a[j] = a[j] + 1;\n    }\n    if (a[x] == 1) {\n      if (i != 0)\n        cout << \" \" << x; \n      else\n        cout << x;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22894", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, i, j, k = 1, num[20000];\n  cin >> n;\n  scanf(\"%d \", &a);\n  num[0] = a;\n  for (i = 1; i < n; i++) {\n    cin >> a;\n    for (j = 0; j < k; j++) {\n      if (a == num[j])\n        break;\n    }\n    if (j == k) {\n      num[k] = a;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "22895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[20001] = {0}, x, i, j;\n  scanf(\"%d \", &x);\n  for (i = 1; i <= x; i++)\n    cin >> n[i];\n  for (i = 1; i <= x; i++) {\n    for (j = 1; j <= x; j++)\n      if (n[i] == n[j] && j > i)\n        n[j] = 0;\n  }\n  printf(\"%d\", n[1]);\n  for (i = 2; i <= x; i++) {\n    if (n[i] != 0)\n      cout << \" \" << n[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        m = 1;\n    }\n    if (m == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    if (m == 0 && i > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, v[20000], m = 0, s[20000], p = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &v[i]);\n  }\n  for (int j = 1; j <= n - 1; j++) {\n    for (int k = 0; k <= j - 1; k++) {\n      if (v[j] != v[k]) {\n        p++;\n      }\n    }\n    if (p == j) {\n      s[m] = v[j];\n      m++;\n    }\n    p = 0;\n  }\n  if (m == 0) {\n    printf(\"%d\", v[0]);\n  } else {\n    printf(\"%d \", v[0]);\n  }\n  for (int k = 0; k <= m - 1; k++) {\n    if (k == m - 1) {\n      printf(\"%d\", s[k]);\n    } else {\n      printf(\"%d \", s[k]);\n    }\n  }\n}\n"}
{"label": "13", "index": "22898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n        printf(\" \");\n        printf(\"%d\", a[i]);\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num[20000], st[91], tot = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (num[j] == num[i])\n        break;\n\n    if (j == i)\n      st[++tot] = num[i];\n  }\n  for (i = 1; i < tot; i++)\n    printf(\"%d \", st[i]);\n  printf(\"%d\", st[tot]);\n}\n"}
{"label": "13", "index": "22900", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, a[20000], counter = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j)\n      counter++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      cout << a[i];\n      counter--;\n      if (counter != 0)\n        cout << ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0; \n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        k++; \n    if (k == 0)\n      cout << \" \" << a[i]; \n    k = 0;\n  } \n  return 0;\n}\n"}
{"label": "13", "index": "22902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, a[20000], n, i, l = 0, p, k = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    l = 0;\n    scanf(\"%d\", &c);\n    for (j = 0; j < k; j++) {\n      if (c == a[j])\n        l = l + 1;\n    }\n    if (l == 0) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int num[n];\n  scanf(\"%d\", &num[0]);\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &num[i]);\n    for (j = 0; j <= i; j++) {\n      if (j < i && num[j] == num[i]) {\n        break;\n      }\n      if (j == i) {\n        printf(\" %d\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22904", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        f = 0;\n        break;\n      }\n    }\n    if (f == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[k - 1]);\n  cin >> n;\n  return 0;\n}\n"}
{"label": "13", "index": "22905", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001], flag[20001] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        flag[j] = 1;\n    }\n    if (flag[i] == 0 && k == 0) {\n      printf(\"%d\", a[i]);\n      k++;\n    } else if (flag[i] == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, i, j, n;\n  int s1[20000], s2[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = n - 1, m = 0; i >= 0; i--) {\n    k = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (s1[i] == s1[j])\n        k++;\n    }\n    if (k == 0) {\n      s2[m] = s1[i];\n      m++;\n    }\n  }\n  s2[m] = '\\0';\n  for (n = m - 1; n > 0; n--)\n    cout << s2[n] << \" \";\n\n  printf(\"%d\", s2[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "22907", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint shuzu[20000];\nint main() {\n  int n, x;\n  scanf(\"%d\", &n);\n  for (int t = 0; t < n; t++) {\n    cin >> shuzu[t];\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = j + 1; i < n; i++) {\n      if (shuzu[i] == shuzu[j]) {\n        shuzu[i] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (shuzu[m] != 0) {\n      if (m == 0) {\n        printf(\"%d\", shuzu[m]);\n      } else {\n        printf(\" %d\", shuzu[m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22908", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20001];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (j = 0; j < n; j++) {\n    if (a[j] >= 10 && a[j] <= 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] >= 10 && a[i] <= 100) {\n          if (a[j] == a[i]) {\n            a[i] = 0;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, figure[20000] = {0}, num[100] = {0}, flag[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> figure[i];\n  }\n  flag[figure[0]]++;\n  cout << figure[0];\n  for (int i = 1; i < n; i++) {\n    if (flag[figure[i]] == 0) {\n      flag[figure[i]]++;\n      cout << \" \" << figure[i];\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22910", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, flag;\n  int a[1000];\n  scanf(\"%d\", &n);\n  a[0] = 1;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      if (i > 1)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, a[20001];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    a[i - 1] = num;\n    if (i == 1)\n      cout << num;\n    else {\n      int j = 0;\n      while (j < i - 1) {\n        if (a[j] == num)\n          break;\n        else\n          j++;\n      }\n      if (j == i - 1)\n        cout << \" \" << num;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "22912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, k, x;\n  cin >> x;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < x; i++) {\n    for (j = i + 1; j < x; j++) {\n      if (a[i] == a[j]) {\n        x--;\n        for (k = j; k < x; k++)\n          a[k] = a[k + 1];\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i < x)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "22913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (i == j) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j[101] = {0}, a[20000], b[20000] = {0}, i, n, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    if (j[a[i]] == 0) {\n      j[a[i]] = 1;\n      b[x] = a[i];\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[i]);\n}\n"}
{"label": "13", "index": "22915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001];\n  cin >> n;\n\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int j = 0; j <= n - 1; j++)\n    for (int k = n - 1; k >= j + 1; k--) {\n      if (a[j] == a[k]) {\n        a[k] = 0;\n      }\n    }\n  cout << a[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (a[m] != 0) {\n      printf(\" %d\", a[m]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22916", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j]) {\n        break;\n      }\n    }\n    if (i == j)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22917", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, s = 0;\n  cin >> n;\n  if (n < 1 || n > 20000)\n    return 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] < 10 || a[i] >= 100)\n      return 0;\n  }\n  for (j = 0; j < n - s; j++) {\n    for (i = n - 1 - s; i > j; i--) {\n      if (a[j] == a[i]) {\n        s = s + 1;\n        for (k = i; k < n - s; k++)\n          a[k] = a[k + 1];\n      }\n    }\n  }\n  for (i = 0; i < n - s; i++) \n  {\n    if (i != n - s - 1)\n      cout << a[i] << \" \";\n    else\n      cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], i, n, j, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      } else {\n        flag = 0;\n        continue;\n      }\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, temp;\n  cin >> n;\n  const int N = n;\n  int ia[N];\n\n  for (i = 0; i != n; i++)\n    scanf(\"%d \", &ia[i]);\n\n  i = 1;\n  while (i < n) {\n    temp = n;\n\n    for (int j = 0; j < i; j++) {\n      if (ia[i] == ia[j]) {\n        for (int k = i; k < n - 1; k++)\n          ia[k] = ia[k + 1];\n        n--;\n        break;\n      }\n    }\n    if (n == temp)\n      i++;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    cout << ia[i] << \" \";\n  cout << ia[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "22920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag, a[20001];\n  cin >> n;\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  scanf(\"%d\", &a[0]);\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k != 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int *number;\n  int i, j;\n  int sum;\n\n  scanf(\"%d\", &n);\n  number = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &number[i]);\n\n  i = 0;\n  while ((i < n) && (sum != 0)) {\n    if ((i == n - 1) && (number[i] != 0)) {\n      printf(\"%d\", number[i]);\n    }\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (number[j] == number[i]) {\n        *(number + j) = 0;\n      }\n      sum += number[j];\n    }\n\n    if ((sum != 0) && (number[i] != 0)) {\n      cout << number[i] << \" \";\n    } else if ((sum == 0) && (number[n - 1] == 0)) {\n      printf(\"%d\", number[i]);\n      sum = 0;\n    }\n    i++;\n  }\n\n  free(number);\n  return 0;\n}\n"}
{"label": "13", "index": "22923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint god(int num2);\nint main(void) {\n  int number, ctr, i;\n  int n[20000], c[20000];\n  scanf(\"%d\", &number);\n  for (i = 0; i <= 20000; i++) {\n    c[i] = 0;\n  }\n  for (ctr = 0; ctr < number; ctr++) {\n    scanf(\"%d\", &n[ctr]);\n  }\n  printf(\"%d\", n[0]);\n  for (ctr = 1; ctr < number; ctr++) {\n    for (i = 0; i < ctr; i++) {\n      if (n[i] == n[ctr]) {\n        c[ctr]++;\n      }\n    }\n    if (c[ctr] == 0)\n      printf(\" %d\", n[ctr]);\n  }\n\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "22924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, m;\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    m = 0;\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] == a[j])\n        m = m + 1;\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22925", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  cin >> k;\n  char c[20000];\n  for (i = 1; i <= k; i++)\n    cin >> c[i];\n\n  printf(\"%d\", c[1]);\n  for (n = 2; n <= k; n++) {\n    for (j = 1; j <= n - 1; j++) {\n      if (c[n] == c[j])\n        break;\n    }\n    if (j == n && c[n] != c[n - 1]) {\n      printf(\" \");\n      printf(\"%d\", c[n]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int b[100];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      if (i > 0)\n        cout << \" \";\n      cout << a[i];\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "22927", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int flag[100] = {0}, i, n, temp;\n  cin >> n;\n  cin >> temp;\n  flag[temp] = 1;\n  cout << temp;\n  for (i = 1; i < n; i++) {\n    cin >> temp;\n    if (flag[temp] == 0) {\n      cout << \" \" << temp;\n      flag[temp] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], i, j, m, k, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < k; i++) {\n    for (j = 0, m = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        n = 0;\n      else\n        n = 1;\n      m = m * n;\n    }\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100001], b[100001];\n  int i, j, step = 1;\n  int n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  b[step] = a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= step; j++) {\n      if (a[i] == b[j])\n        break;\n    }\n    if (j == step + 1) {\n      step++;\n      printf(\" %d\", a[i]);\n      b[step] = a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22930", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, g, p = 0;\n\n  cin >> n;\n  int a[n + 1];\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (j = 1; j <= n; j++) {\n    g = 0;\n\n    for (k = 1; k <= j - 1; k++) {\n      if (a[j] == a[k]) {\n        g = 1;\n      }\n    }\n\n    if (g == 0) {\n      if (p != 0) {\n        cout << \" \";\n      }\n      printf(\"%d\", a[j]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101], b[20000], n, i;\n  for (i = 0; i < 101; i = i + 1) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &n);\n  cin >> b[0];\n  cout << b[0];\n  a[b[0]] = 1;\n  for (i = 1; i < n; i++) {\n    cin >> b[i];\n    if (a[b[i]] == 0) {\n      cout << \" \" << b[i];\n      a[b[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, js, cunzai;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n\n  for (i = 1; i < n; i++) {\n    cunzai = 0;\n    js = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        js++;\n      }\n    }\n    if (js == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], b[20001], i, m;\n  scanf(\"%d \", &n);\n  m = n;\n  for (i = 1; i <= n; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  i = 2;\n  cout << a[1];\n  b[a[1]] = 0;\n  do {\n    if (b[a[i]] == 1) {\n      printf(\" %d\", a[i]);\n      b[a[i]] = 0;\n    }\n    m = m - 1;\n    i = i + 1;\n  } while (m >= 0);\n\n  return 0;\n}\n"}
{"label": "13", "index": "22934", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, i, j, n, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (j = n - 1; a[j] == 0; j--)\n    k = 0;\n  for (i = 0; i < j; i++)\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "13", "index": "22935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000], flag[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag[i] = 1;\n    }\n    if (flag[i] == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint hs(int a);\nint main() {\n  int n, b[20002], i, j, pd, js;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> b[i];\n  }\n  js = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        js--;\n        break;\n      }\n    }\n  }\n  pd = 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        pd = 0;\n      }\n    }\n    if (pd == 1 && js != 1) {\n      printf(\"%d \", b[i]);\n      js--;\n    } else if (pd == 1 && js == 1) {\n      printf(\"%d\", b[i]);\n      break;\n    }\n    pd = 1;\n  }\n  cin >> n;\n  return 0;\n}\n"}
{"label": "13", "index": "22937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long n;\n  scanf(\"%ld \", &n);\n  bitset<101> b;\n  for (long i = 0; i < n; i++) {\n    long x;\n    cin >> x;\n    if (!b.test(x)) {\n      if (i)\n        cout << ' ';\n      printf(\"%ld\", x);\n      b.set(x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int zz[20000];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> zz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (zz[i] == zz[j])\n        zz[j] -= zz[i];\n    }\n  }\n  printf(\"%d\", zz[0]);\n  for (i = 1; i < n; i++) {\n    if (zz[i] != 0)\n      printf(\" %d\", zz[i]);\n  }\n}\n"}
{"label": "13", "index": "22939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n\n  int a[30000] = {0};\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 0; i <= n - 1; i++)\n\n  {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n\n        cout << \" \";\n        cout << a[i];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20000], i, t, k = 0, h;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++)\n    for (t = i + 1; t < n - k; t++)\n      if (a[i] == a[t]) {\n        for (h = t; h < n - k - 1; h++)\n          a[h] = a[h + 1];\n        k++;\n        t--;\n      } \n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n - k - 1]; \n  return 0;\n}\n"}
{"label": "13", "index": "22941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p, *q, *head;\n  p = (int *)calloc(n, sizeof(int));\n  head = p;\n  for (p = head; p < head + n; p++) {\n    scanf(\"%d\", p);\n  }\n  p = head;\n  printf(\"%d\", *p);\n  p++;\n  for (; p < head + n; p++) {\n    for (q = head; q < p; q++) {\n      if (*q == *p) {\n        goto chongfu;\n      }\n    }\n    cout << \" \" << *p;\n  chongfu:;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k != 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  int *m;\n  scanf(\"%d\", &n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", m + i);\n\n  cout << *m;\n  for (i = 1; i < n; i++) {\n    l = 0;\n    for (j = 0; j < i; j++) {\n      if (*(m + i) == *(m + j)) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 0) {\n      cout << \" \" << *(m + i);\n    }\n  }\n  free(m);\n  return 0;\n}\n"}
{"label": "13", "index": "22944", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l = 1;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      cout << a[i];\n      break;\n    }\n  }\n  i++;\n  for (; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n\n  int a[30000] = {0};\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 0; i <= n - 1; i++)\n\n  {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n\n        cout << \" \";\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20000], i, t, k = 0, h;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (t = i + 1; t < n - k; t++)\n      if (a[i] == a[t]) {\n        for (h = t; h < n - k - 1; h++)\n          a[h] = a[h + 1];\n        k++;\n        t--;\n      }\n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\", a[n - k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "22947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, f;\n\n  scanf(\"%d%d\", &n, a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    f = 0;\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        f = 1;\n    }\n    if (f == 0) {\n      cout << \" \" << *(a + i);\n    } else {\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22948", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        k = 1;\n    }\n    if (k == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    else if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22949", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int j = 0, i = 0, n = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n    b[j] = a[i];\n    j = i + 1;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == b[j]) {\n        b[j] = 0;\n      }\n    }\n  }\n  cout << b[0];\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] != 0) {\n      cout << \" \" << b[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, *b, i, j, flag = 0;\n  scanf(\"%d\\n\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] == a[j])\n        b[i] = b[i] + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (b[j] == 0) {\n        flag = flag + 1;\n      }\n    }\n    if (b[i] == 0) {\n      cout << a[i];\n      if (flag > 1)\n        cout << \" \";\n    }\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        t = 0;\n        break;\n      } else\n        t = 1;\n    }\n    if (t == 0)\n      printf(\"\\0\");\n    else {\n      if (i > 0)\n        cout << \" \" << a[i];\n      else\n        printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t;\n  int flag[100];\n  memset(flag, 0, sizeof(flag));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t;\n    if (0 == flag[t]) {\n      flag[t] = 1;\n      if (0 == i)\n        cout << t;\n      else\n        cout << \" \" << t;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "22954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 1, k;\n  cin >> n;\n  int a[20000]; \n  cin >> a[0];  \n  while (cin >> a[i]) {\n    i++;\n    if (i == n)\n      break;\n  }             \n  cout << a[0]; \n  i = 1;\n  while (i < n) {\n    int mid = 0;\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n        mid = 1;\n        break;\n      } \n    }\n    if (mid == 0)\n      cout << \" \" << a[i]; \n    i++;\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "22955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int check[100] = {0};\n  int n, i;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (check[a[i]] == 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else {\n        printf(\" %d\", a[i]);\n      }\n      check[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int d;\n  int flag[101];\n  for (i = 0; i <= 100; i++) {\n    flag[i] = 0;\n  }\n  cin >> n;\n  int couted = 0;\n  for (i = 0; i < n; i++) {\n    cin >> d;\n    if (flag[d] == 0) {\n      if (couted == 0) {\n        printf(\"%d\", d);\n        couted = 1;\n      } else {\n        cout << \" \" << d;\n      }\n      flag[d] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], count[100], n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < 100; i++)\n    count[i] = 0;\n  printf(\"%d\", a[0]);\n  count[a[0]]++;\n  for (i = 0, j = 1; j < n; j++) {\n    if (count[a[j]] == 0) {\n      i++;\n      a[i] = a[j];\n      count[a[j]]++;\n    }\n  }\n  for (j = 1; j <= i; j++)\n    cout << \" \" << a[j];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[20010];\n\nint main() {\n  int n, i, tmp, k, ii = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &tmp);\n    int j;\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == tmp) {\n        flag = 1;\n      }\n    }\n    if (flag == 0) {\n      a[ii] = tmp;\n      ii++;\n    }\n  }\n  for (k = 0; k < ii - 1; k++) {\n    printf(\"%d \", a[k]);\n  }\n  printf(\"%d\", a[ii - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "22959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[20001];\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    f[i] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    if (f[a] == 0) {\n      f[a] = 1;\n      if (i != 1)\n        cout << ' ';\n      printf(\"%d\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[101], number, i; \n                            \n  cin >> n;\n  for (i = 1; i <= 100; i++)\n    a[i] = 0; \n  cin >> number;\n  cout << number;\n  a[number] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> number;      \n    if (a[number] == 0) \n    {\n      a[number] = 1;         \n      cout << \" \" << number; \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000] = {0}, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    if (b[k] == 0) {\n      a[j] = k;\n      j++;\n      b[k] = 1;\n    }\n  }\n  for (i = 1; i < j; i++) {\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], t;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    t = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] == a[i] && j != i)\n        t += 1;\n    }\n    if (t >= 1)\n      continue;\n    else {\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[100], t = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < t; j++)\n      if (a[i] == b[j])\n        break;\n    if (j >= t) {\n      b[t] = a[i];\n      t++;\n    }\n  }\n  for (j = 1; j < t - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "22964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n    if (t == 0) {\n      if (m > 0)\n        cout << \" \";\n      cout << a[i];\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (flag == 0)\n      cout << a[0];\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n      if (j == i - 1 && a[j] != a[i])\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (j == i)\n        continue;\n      else if (a[j] == a[i])\n        a[j] = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (j = i + 1; j < n; j++) {\n    if (a[j] == -1)\n      continue;\n    else\n      printf(\" %d\", a[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22967", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[20000], B[20000], n, i, j, k;\n  int flag;\n  int number = 0;\n  j = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < i; k++) {\n      if (A[k] == A[i]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      B[j] = A[i];\n      number = number + 1;\n      j = j + 1;\n    }\n  }\n  for (j = 0; j < number; j++) {\n    if (j == 0)\n      printf(\"%d\", B[j]);\n    else {\n      printf(\" %d\", B[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {'\\0'}, i = 0, j = 0, k = 0, temp, count;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &temp);\n    count = 0;\n    for (j = 0; j <= k; j++) {\n      if (temp == a[j])\n        break;\n      else\n        count++;\n    }\n    if (count == k + 1) {\n      k++;\n      a[k] = temp;\n    }\n  }\n  for (i = 1; a[i] != '\\0'; i++) {\n    printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "22969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, i, j, m;\n  cin >> n;\n  int a[20000] = {0}; \n  cin >> t;\n  cout << t;\n  m = 1;    \n  a[0] = t; \n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    for (j = 0; j < m; j++) {\n      if (a[j] == t) \n        break;\n    }\n    if (j >= m) \n    {\n      cout << ' ' << t;\n      a[m] = t;\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int a[20000], i, n, k, j, m;\n  scanf(\"%d\", &n);\n  m = n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n\n        n--;\n        for (j = i; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (i < n - 1) {\n      printf(\"%d \", a[i]);\n    } else {\n      printf(\"%d\", a[n - 1]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "22971", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct arr {\n  long int num;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) \n{\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  scanf(\"%ld\", &p1->num); \n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%ld\", &p1->num); \n  }\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%ld\", p->num);\n    else\n      printf(\" %ld\", p->num); \n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  while (p != NULL) {\n    head = head->next;\n    free(p);\n    p = head;\n  }\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->num == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->num == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  int m;\n  struct arr *head, *p;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  while (p != NULL) {\n    p->next = del(p->next, p->num);\n    p = p->next;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "13", "index": "22972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t = 0;\n  cin >> n;\n  int N[20000];\n  int M[90] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &N[i]);\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (N[j] == N[k])\n        break;\n    }\n    if (k == j) {\n      M[t] = N[j];\n      t++;\n    }\n  }\n  for (m = 0; m < t - 1; m++)\n    printf(\"%d \", M[m]);\n  cout << M[t - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "22973", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, a[20000], k, j = 0;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++)\n\n  {\n    for (k = 0; k < i; k++) {\n\n      if (a[i] == a[k]) {\n        j = j + 1;\n        break;\n      }\n    }\n    if (j == 0)\n      cout << \" \" << a[i];\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, f, m, k, t = 0;\n  scanf(\"%d\", &n);\n  int x[n], y, z[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &x[i]);\n    z[i] = 0;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    f = 0;\n    for (l = 0; l <= j - 1; l++) {\n      y = x[j] - x[l];\n      if (y == 0) {\n        f = 1;\n      }\n    }\n    if (f == 0) {\n      z[t] = x[j];\n      t += 1;\n    }\n  }\n  for (m = 0; m <= n - 1; m++) {\n    if (z[m] == 0) {\n      break;\n    }\n  }\n  for (k = 0; k <= m - 1; k++) {\n    if (z[k] != 0) {\n      printf(\"%d\", z[k]);\n    }\n    if (k <= m - 2) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22975", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "22976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, num, j, flag, k, h = 0;\n  scanf(\"%d%d\", &n, &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &num);\n    for (j = 0; j <= i - 1; j++) {\n      if (num != a[j])\n        flag = 1;\n      else {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      h++;\n      a[h] = num;\n    }\n  }\n  for (k = 0; k <= h - 1; k++)\n    printf(\"%d \", a[k]);\n  printf(\"%d\", a[h]);\n  return 0;\n}\n"}
{"label": "13", "index": "22977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n;\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n        printf(\" \");\n        cout << a[i];\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000];\n  cin >> n;\n  scanf(\"%d \", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i -= 1;\n        n -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t = t + 1;\n      }\n      if (t == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, x;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = x;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (t = j; t < n; t++) {\n          a[t] = a[t + 1];\n        }\n        n--;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22981", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, b, a[20000];\n  i = 0;\n  scanf(\"%d\\n\", &n);\n  for (; i <= n - 1; i++) {\n    if (i < n - 1)\n      scanf(\"%d \", &a[i]);\n    else\n      scanf(\"%d \", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (j == 0)\n      printf(\"%d\", a[j]);\n    else {\n      for (m = 0, b = 0; m < j; m++) {\n        if (a[j] == a[m])\n          b++;\n      }\n      if (b == 0)\n        printf(\" %d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22982", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 1, m, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  while (i <= n) {\n    cin >> m;\n    a[i] = m;\n    i++;\n  }\n  int l = 1;\n  while (l <= n) {\n    if (l == 1)\n      printf(\"%d\", a[l]);\n    else {\n      j = 1;\n      k = 0;\n      while (j < l) {\n        if (a[l] == a[j])\n          k = k + 1;\n        j++;\n      }\n      if (k == 0)\n        printf(\" %d\", a[l]);\n    }\n    l++;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "22983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  int a[100] = {0};\n  scanf(\"%d\", &k);\n  a[k] = a[k] + 1;\n  printf(\"%d\", k);\n  for (i = 2; i <= n; i++) {\n    cin >> k;\n    a[k] = a[k] + 1;\n    if (a[k] == 1)\n      printf(\" %d\", k);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m;\n  int x[20000] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &x[i]);\n  printf(\"%d\", x[0]);\n  for (i = 0; i <= k - 2; i++) {\n    for (j = i + 1; j <= k - 1;) {\n      if (x[i] == x[j]) {\n        for (m = j + 1; m <= k - 1; m++)\n          x[m - 1] = x[m];\n        k--;\n      } else\n        j++;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    printf(\" %d\", x[i]);\n}\n"}
{"label": "13", "index": "22985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++)\n      if (a[j] == a[k])\n        break;\n    if (k == j)\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int array[n];                    \n  for (int i = 0; i <= n - 1; i++) \n    cin >> array[i];\n  cout << array[0];                \n  for (int i = 1; i <= n - 1; i++) \n  {\n    int g = 0;                       \n    for (int j = 0; j <= i - 1; j++) \n      if (array[i] == array[j])\n        g = g + 1;\n    if (g == 0)\n      cout << \" \" << array[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int *number;\n  int i, j;\n  int sum;\n\n  scanf(\"%d\", &n);\n  number = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number[i]);\n  }\n\n  i = 0;\n  while ((i < n) && (sum != 0)) {\n    if ((i == n - 1) && (number[i] != 0)) {\n      printf(\"%d\", number[i]);\n    }\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (number[j] == number[i]) {\n        *(number + j) = 0;\n      }\n      sum += number[j];\n    }\n\n    if ((sum != 0) && (number[i] != 0)) {\n      printf(\"%d \", number[i]);\n    } else if ((sum == 0) && (number[n - 1] == 0)) {\n      printf(\"%d\", number[i]);\n      sum = 0;\n    }\n    i++;\n  }\n\n  free(number);\n  return 0;\n}\n"}
{"label": "13", "index": "22988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  int x[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    for (k = 0; k < i; k++) {\n      if (x[k] == x[i]) {\n        i--;\n        n--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, b[20001], c[20001], i = 0, j = 1, l, m;\n  cin >> n;\n  for (l = 0; l < 20001; l++) {\n    b[l] = 0;\n  }\n  for (m = 0; m < 20001; m++) {\n    c[m] = 0;\n  }\n  while (j <= n) {\n    cin >> k;\n    if (b[k] == 0) {\n      c[i] = k;\n    }\n    b[k]++;\n    i++;\n    j++;\n  }\n  cout << c[0];\n  for (i = 1; i < n; i++) {\n    if (c[i] != 0) {\n      cout << \" \" << c[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b[91] = {0}, i, k, counter = 0, temp;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> temp;\n    for (k = 0; k < 91; k++) {\n      if (b[k] == temp)\n        break;\n    }\n    if (k >= 91) {\n      b[counter] = temp;\n      counter++;\n    }\n  }\n  for (k = 0; k < counter - 1; k++)\n\n    printf(\"%d \", b[k]);\n\n  printf(\"%d\\n\", b[counter - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "22991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int sum;\n\n  scanf(\"%d \", &n);\n  sum = n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n        sum--;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    cout << a[i];\n    j++;\n    if (j != sum)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 2, m;\n  int a[20010], b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    for (m = 1; m <= i - 1; m++) {\n      if (a[m] == a[i])\n        break;\n    }\n    if (m == i) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= j - 1; i++) {\n    if (i < j - 1) {\n      cout << b[i] << \" \";\n    } else\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, count[101] = {0}, num; \n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    if (count[num] == 0) \n      if (i == 1)\n        cout << num;\n      else\n        cout << \" \" << num;\n    count[num]++; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22994", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, flag[90];\n\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    flag[a[i] - 10] = 1;\n  }\n  for (int j = 0; j < n; j++) {\n    if (flag[a[j] - 10]) {\n      if (j) {\n        printf(\" %d\", a[j]);\n      } else {\n        cout << a[j];\n      }\n    }\n    flag[a[j] - 10] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "22995", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (int k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n        j = j - 1;\n      } else\n        continue;\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, l, i, j, x;\n  scanf(\"%d\", &n);\n  l = 0;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    for (i = (j + 1); i < n; i++) {\n      if (a[j] == a[i])\n        a[i] = '*';\n    }\n  }\n  if (a[n - 1] != '*') {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] != '*')\n        printf(\"%d \", a[i]);\n    }\n    printf(\"%d\", a[n - 1]);\n  } else {\n    for (i = n - 1; i > 0; i--) {\n      if (a[i] == '*')\n        l = l + 1;\n      else\n        break;\n    }\n    for (j = 0; j < n - l - 1; j++) {\n      if (a[j] != '*')\n        printf(\"%d \", a[j]);\n    }\n    printf(\"%d\", a[n - l - 1]);\n  }\n}\n"}
{"label": "13", "index": "22997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, num, count[100] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n\n    cin >> num;\n    count[num]++;\n    if (i == 1)\n      cout << num;\n    if (count[num] == 1 && i >= 2)\n      cout << \" \" << num;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "22998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, b[101] = {0}, flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    if (b[a[i]] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n      } else {\n        cout << ' ' << a[i];\n      }\n      b[a[i]] = 1;\n    } else\n      continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "22999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], count[100], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < 100; i++)\n    count[i] = 0;\n  cout << a[0];\n  count[a[0]]++;\n  for (i = 0, j = 1; j < n; j++) {\n    if (count[a[j]] == 0) {\n      i++;\n      a[i] = a[j];\n      count[a[j]]++;\n    }\n  }\n  for (j = 1; j <= i; j++)\n    cout << \" \" << a[j];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23000", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, l;\n  cin >> n;\n  int m[n]; \n  for (int i = 0; i < n; i++)\n    cin >> m[i];              \n  int cishu[101] = {0};       \n  for (int i = 0; i < n; i++) \n  {\n    cishu[m[i]]++;\n    if (cishu[m[i]] >= 2) \n      m[i] = 0;\n  }\n  for (int i = 0; i < n; i++) \n  {\n    if (i == 0)\n      cout << m[i];\n    else if (m[i] != 0)\n      cout << \" \" << m[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int count, n, j, i = 1;\n  int a[20000];\n  cin >> n;\n  for (i; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (count = 0, j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (i == 1 && count == 0)\n      printf(\"%d\", a[i]);\n    else if (i != 1 && count == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23002", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, k;\n  cin >> n;\n  int a[20000];\n  cin >> a[0];\n  while (cin >> a[i]) {\n    i++;\n    if (i == n)\n      break;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n    int mid = 0;\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n        mid = 1;\n        break;\n      }\n    }\n    if (mid == 0)\n      printf(\" %d\", a[i]);\n    i++;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20000];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  for (i = 1; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < i; j++) {\n      if (num[i] != num[j]) {\n        continue;\n      } else\n        sum++;\n    }\n    if (sum == 0)\n      cout << ' ' << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {'\\0'}, i = 0, j = 0, k = 0, temp, count;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &temp);\n    count = 0;\n    for (j = 0; j <= k; j++) {\n      if (temp == a[j])\n        break;\n      else\n        count++;\n    }\n    if (count == k + 1) {\n      k++;\n      a[k] = temp;\n    }\n  }\n  for (i = 1; a[i] != '\\0'; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "13", "index": "23005", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100001], h, i, j;\n  char c;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    h = 0;\n    scanf(\"%d %c \", &a[i], &c);\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 1; j < i; j++)\n        if (a[j] == a[i]) {\n          h = 1;\n          break;\n        }\n      if (h == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a, b;\n  cin >> n;\n  int num[20000];\n  int res[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  b = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    a = num[i];\n    for (j = 0; j <= i; j++) {\n      if (i == j) {\n        b = a;\n        continue;\n      }\n      if (a != num[j])\n        b = a;\n      else {\n        b = 0;\n        break;\n      }\n    }\n\n    if (b != 0) {\n      k++;\n      res[k] = b;\n    }\n  }\n  for (l = 1; l <= k; l++) {\n    if (l != k)\n      cout << res[l] << \" \";\n    else\n      printf(\"%d\", res[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int t;\n  int l = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n    return 0;\n  }\n  printf(\"%d\", a[0]);\n  t = n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t = t - 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else if (j == i - 1 && l < t) {\n\n        cout << \" \" << a[i];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23008", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20000], b = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k <= j; k++) {\n      if (a[k] != a[j])\n        b++;\n    }\n    if (b == j)\n      printf(\" %d\", a[j]);\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23009", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, k, i, j, l;\n  int s[12000];\n  scanf(\"%d\", &n);\n  m = n;\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    l++;\n    cin >> s[l];\n    for (j = 1; j <= l - 1; j++)\n      if (s[j] == s[l]) {\n        l--;\n        m--;\n      }\n  }\n  for (i = 1; i <= m - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[m]);\n}\n"}
{"label": "13", "index": "23010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, n, k;\n  k = 0;\n  scanf(\"%d\", &n);\n\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[j] == a[i])\n        a[j] = 0;\n  }\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23011", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  i = 0;\n  while (i < n) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] == a[j])\n        a[j] = 0;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  i = 1;\n  for (i = 1; i < n; i++)\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n}\n"}
{"label": "13", "index": "23012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l = 0, g = 0, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    for (i = n - 1; i >= 0; i--) {\n      if (a[n - 1] == a[i])\n        k++;\n    }\n    if (k == n)\n      printf(\"%d\", a[0]);\n    else {\n      printf(\"%d \", a[0]);\n      for (i = 1; i < n; i++) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] != a[j])\n            l++;\n        }\n        if (l == i) {\n          b[g] = a[i];\n          g++;\n        }\n        l = 0;\n      }\n      for (i = 0; i < g - 1; i++) {\n        printf(\"%d \", b[i]);\n      }\n      printf(\"%d\", b[g - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23013", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x, q;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  x = 0;\n  q = 0;\n  if (n[0] == 1)\n    printf(\"%d\", b[0]);\n  else if (n[0] >= 2) {\n    printf(\"%d\", b[0]);\n    n[0] = 0;\n  }\n\n  for (j = 1; b[j] != 0; j++) {\n    if (n[j] == 1)\n      printf(\" %d\", b[j]);\n    else if (n[j] >= 2) {\n      printf(\" %d\", b[j]);\n      n[j] = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23014", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[n];\n  cin >> num[0];\n  cout << num[0];\n  for (int i = 1; i < n; i++) {\n    cin >> num[i];\n    for (int j = 0; j < i; j++) {\n      if (num[j] == num[i])\n        num[i] = 0;\n    }\n    if (num[i])\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, e, k = 0;\n  int s[20001];\n  int a[20001];\n  cin >> n;\n  for (i = 1; i <= 20001; i++) {\n    s[i] = 0;\n    a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    cin >> e;\n    if (a[e] == 0) {\n      a[e] = 1;\n      k++;\n      s[k] = e;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    cout << s[i] << ' ';\n  cout << s[k];\n  return 0;\n}\n"}
{"label": "13", "index": "23016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (k = i + 1; k < n; k++)\n      while ((a[k] == a[i]) && (k < n)) {\n        for (t = k; t < n - 1; t++)\n          a[t] = a[t + 1];\n        n--;\n      }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000] = {0};\n  int i, j, k, m = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, j = 0; i < n; i++, m = 0) {\n    for (k = j; k >= 0; k--) {\n      if (a[i] == b[k]) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[20000], i, j = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    for (j = 0; j < i; j++) {\n      if (m[i] == m[j])\n        break;\n    }\n    if (i == j) {\n      if (count == 0) {\n        printf(\"%d\", m[i]);\n        count++;\n      } else\n        printf(\" %d\", m[i]);\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23019", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, count = 0, p = 0, n;\n  int a[20002] = {0}, b[20002] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        b[i] = 1;\n    }\n    if (b[i] == 0)\n      count = count + 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] != 1) {\n      p = p + 1;\n      if (p != count)\n        cout << a[i] << \" \";\n      else\n        cout << a[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23020", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int i, k, j = 0, n, fil = 101, m = 0, g = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  k = 0;\n  a[n] = 101;\n\n  while (k < n) {\n\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    if (k == 0)\n      printf(\"%d\", a[k]), k++;\n\n    else if (k < n && k > 0)\n      printf(\" %d\", a[k]), k++, m++;\n  }\n}\n"}
{"label": "13", "index": "23021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, *a, i, j, r, d = 0;\n  scanf(\"%d \", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &*(a + i));\n  for (i = 0; i < n; i++) {\n    r = 0;\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        r = 1;\n    }\n    if (r == 0 && d == 0) {\n      cout << *(a + i);\n      d = 1;\n    } else if (r == 0 && d == 1)\n      printf(\" %d\", *(a + i));\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20002] = {1}, n, i, j, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = i - 1; j > 0; j--) {\n      if (a[i] == a[j])\n        break;\n      else\n        k = k + 1;\n    }\n    if (k == i - 1)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101], number, i;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  cin >> number;\n  cout << number;\n  a[number] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number] = 1;\n      cout << \" \" << number;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[20000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (sz[j] == sz[i]) {\n          sz[i] = 0;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > 0) {\n      if (i == 0) {\n        cout << sz[i];\n      } else {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23025", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, c;\n  int a[101] = {0};\n  scanf(\"%d \", &n);\n  cin >> c;\n  a[c] = 1;\n  printf(\"%d\", c);\n  while (cin >> c) {\n    if (a[c] == 0) {\n      cout << \" \" << c;\n      a[c] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23026", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], j, m = 0, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i >= 0; i--)\n    for (k = i - 1; k >= 0; k--)\n      if (a[i] == a[k]) {\n        m++;\n        for (j = i; j <= n - m; j++)\n          a[j] = a[j + 1];\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n - m; i++)\n    printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000] = {0}, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    if (b[k] == 0) {\n      a[j] = k;\n      j++;\n      b[k] = 1;\n    }\n  }\n  for (i = 1; i < j; i++) {\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, k, j, l, m, bn;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = a[0];\n  m = 0;\n  for (j = 1; j < n; j++) {\n    for (k = 0, l = 1; k < j; k++) {\n      if (a[j] == a[k]) {\n        l = 0;\n        break;\n      }\n    }\n    if (l != 0) {\n      m += 1;\n      b[m] = a[j];\n    }\n  }\n  for (bn = 0; bn < m; bn++) {\n    printf(\"%d \", b[bn]);\n  }\n  printf(\"%d\", b[m]);\n}\n"}
{"label": "13", "index": "23029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      b[i] = a[i] - a[j];\n      if (b[i] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23030", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100], k, b[100], j;\n  cin >> n;\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n\n    if (a[k] == 0) {\n      b[j] = k;\n      j++;\n    }\n    a[k] = 1;\n  }\n  for (i = 1; i < (j - 1); i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j, k, flag = 0;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      cin >> a[i];\n      if (a[i] < 10 || a[i] >= 100)\n        scanf(\"%d\", &a[i]);\n      else\n        continue;\n    }\n    printf(\"%d\", a[0]);\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < j; k++) {\n        if (a[j] == a[k]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        printf(\" %d\", a[j]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, l, m, n, a[20000], b[90], x;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (j = 0; j < n; j++) {\n    for (l = 0; l < k; l++) {\n      if (a[j] == b[l]) {\n        m = 1;\n      }\n    }\n    if (m != 1) {\n      b[k] = a[j];\n      k++;\n    }\n    m = 0;\n  }\n  cout << b[0];\n  for (x = 1; x < k; x++)\n    printf(\" %d\", b[x]);\n  return 0;\n}\n"}
{"label": "13", "index": "23033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, i, j;\n  while (scanf(\"%d \", &n)) {\n    char b[20000];\n    int a[20000];\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &a[i]);\n    cin.getline(b, 20000);\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        cout << \" \" << a[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    printf(\"%d\", a[0]);\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (i == j && a[i] != a[i - 1])\n        printf(\" %d\", a[i]);\n    }\n    for (j = 0; j < n - 1; j++) {\n      if (a[n - 1] == a[j])\n        break;\n    }\n    if (n - 1 == j && a[n - 1] != a[n - 2])\n      printf(\" %d\", a[n - 1]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j] && a[i] != 0)\n        a[i] = 0;\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      if (a[i] != 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0, c = 0; j < i; j++) {\n      if (a[i] != a[j])\n        c++;\n    }\n    if (c == i)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23037", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(int s, int a[20000], int n) {\n  int i, temp = 0;\n  for (i = 0; i < n; i++) {\n    if (s == a[i]) {\n      return 1;\n      temp = 1;\n      break;\n    } else\n      continue;\n  }\n  if (temp = 0)\n    return 0;\n}\n\nint main() {\n  int n, a[20000], i, j, w = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (compare(a[i], a, i) == 1)\n      a[i] = -1;\n    else\n      continue;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      if (w == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n      w++;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  cin >> n;\n  if (n == 0)\n    return 0;\n  scanf(\"%d\", &x);\n  cout << x;\n  a[0] = x;\n  for (j = 1; j < n; j++) {\n    scanf(\"%d\", &x);\n    k = 0;\n    while ((k < m) && (a[k] != x))\n      k++;\n    if (k == m) {\n      a[m++] = x;\n      printf(\" %d\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23040", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[20001] = {0}, number, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> number;\n    num[i] = number;\n  }\n  for (j = 1; j <= n; j++)\n    for (i = j + 1; i <= n; i++)\n      if (num[j] == num[i])\n        num[i] = 0;\n  for (i = 1; i <= n; i++)\n    if (num[i] != 0) {\n      cout << num[i];\n      break;\n    }\n  for (j = i + 1; j <= n; j++)\n    if (num[j] != 0)\n      printf(\" %d\", num[j]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    cout << b[i] << \" \";\n  cout << b[0];\n}\n"}
{"label": "13", "index": "23042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100001], h, i, j;\n  char c;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    h = 0;\n    scanf(\"%d%c\", &a[i], &c);\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 1; j < i; j++)\n        if (a[j] == a[i]) {\n          h = 1;\n          break;\n        }\n      if (h == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23043", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int k;\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n      else\n        break;\n    }\n    if (k == i)\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23044", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, temp; \n  cin >> n;       \n  const int N = n;\n  int ia[N]; \n\n  for (i = 0; i != n; i++) \n    cin >> ia[i];\n\n  i = 1;\n  while (i < n) { \n    temp = n;     \n                  \n    for (int j = 0; j < i; j++) {\n      if (ia[i] == ia[j]) { \n        for (int k = i; k < n - 1; k++)\n          ia[k] = ia[k + 1];\n        n--;\n        break;\n      }\n    }\n    if (n == temp)\n      i++; \n  }\n\n  for (i = 0; i < n - 1; i++) \n    cout << ia[i] << \" \";\n  cout << ia[n - 1] << endl;\n\n  return 0; \n}\n"}
{"label": "13", "index": "23045", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t;\n  int flag[100];\n  memset(flag, 0, sizeof(flag));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &t);\n    if (0 == flag[t]) {\n      flag[t] = 1;\n      if (0 == i)\n        cout << t;\n      else\n        cout << \" \" << t;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23046", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[9000], ans[9000];\n  cin >> n;\n  int i, j;\n  int num = 1, t = 0;\n  scanf(\"%d\", &a[0]);\n  ans[0] = a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    int j = 0;\n    while (j < num) {\n      if (a[i] == ans[j]) {\n        t = 1;\n        break;\n      }\n      j++;\n    }\n    if (t == 0) {\n      ans[num] = a[i];\n      printf(\" %d\", ans[num]);\n      num++;\n    } else\n      t = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23047", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, q = 1, k;\n  int sz[20000], jieguo[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  jieguo[0] = sz[0];\n  for (int i = 1; i <= n; i++) {\n    k = 0;\n    for (int j = 0; j < q; j++) {\n      if (jieguo[j] == sz[i])\n        break;\n      else {\n        k += 1;\n      }\n    }\n    if (k == q) {\n      jieguo[q] = sz[i];\n      q += 1;\n    }\n  }\n  for (int i = 0; i < q - 1; i++) {\n    if (i != q - 2) {\n      printf(\"%d \", jieguo[i]);\n    } else {\n      printf(\"%d\", jieguo[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 1, m, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  while (i <= n) {\n    scanf(\"%d\", &m);\n    a[i] = m;\n    i++;\n  }\n  int l = 1;\n  while (l <= n) {\n    if (l == 1)\n      printf(\"%d\", a[l]);\n    else {\n      j = 1;\n      k = 0;\n      while (j < l) {\n        if (a[l] == a[j])\n          k = k + 1;\n        j++;\n      }\n      if (k == 0)\n        printf(\" %d\", a[l]);\n    }\n    l++;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20002], b[20001], n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n + 1; i++)\n    b[i] = 0;\n  a[n + 1] = 0;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n + 1; j++)\n      b[i] += a[j];\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0 && b[i] != 0)\n      cout << a[i] << \" \";\n    else if (a[i] != 0 && b[i] == 0)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k;\n  i = 0;\n  k = 1;\n  scanf(\"%d\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n  } else {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n    for (i = 1; i < n; i++, k++) {\n      scanf(\"%d\", &a[i]);\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (k < (n - 1)) {\n        if (i == j)\n          printf(\" %d\", a[i]);\n      } else {\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j])\n            break;\n        }\n        if (i == j)\n          cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint a[20000] = {0}, b[20000] = {0};\nint main() {\n  int i, j, k = 0, g = 0, kk = 0;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = i + 1; j < n; ++j) {\n      if (a[i] == a[j]) {\n        a[j] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    if (a[i] >= 0) {\n      b[k] = a[i];\n      ++k;\n    }\n  }\n  for (i = 0; i < k - 1; ++i) {\n    cout << b[i] << \" \";\n  }\n  cout << b[k - 1] << endl;\n  \n  \n  \n  return 0;\n}\n"}
{"label": "13", "index": "23052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[20000], i, j = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    for (j = 0; j < i; j++) {\n      if (m[i] == m[j])\n        break;\n    }\n    if (i == j) {\n      if (count == 0) {\n        printf(\"%d\", m[i]);\n        count++;\n      } else\n        cout << \" \" << m[i];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c[100000], d, e;\n  e = 0;\n  cin >> a;\n  for (b = 1; b <= a; b++)\n    scanf(\"%d\", &c[b]);\n  printf(\"%d\", c[1]);\n  b = 2;\n  while (b <= a) {\n    e = 0;\n    for (d = 1; d < b; d++) {\n      if (c[b] == c[d])\n        e = 1;\n      else\n        e = e;\n    }\n    if (e == 0)\n      printf(\" %d\", c[b]);\n    b = b + 1;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] == a[i])\n        a[j] = -1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != -1)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[20001];\n  memset(num, 0, 20001);\n  int i, j;\n  int count = 1;\n  int number;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &number);\n    if (i == 1) {\n      num[0] = number;\n    } else {\n      for (j = 1; j <= count; j++) {\n        if (number == num[j - 1]) {\n          break;\n        } else {\n        }\n        if (j == count) {\n          count++;\n          num[count - 1] = number;\n        } else {\n        }\n      }\n    }\n  }\n  for (i = 1; i < count; i++) {\n    printf(\"%d \", num[i - 1]);\n  }\n  printf(\"%d\", num[count - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[20001];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &s[i]);\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == s[j]) {\n        s[i] = 0;\n        break;\n      }; \n    };\n  };\n\n  for (i = 2; i <= n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]); \n  };\n}\n"}
{"label": "13", "index": "23057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        f++;\n    }\n    if (f == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n\n  cout << b[k - 1];\n  cin >> n;\n  return 0;\n}\n"}
{"label": "13", "index": "23058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if (p)\n        printf(\" \");\n      cout << m[i];\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int a[N], b[N];\n  int i, j, k, n, m = 0, flag;\n  for (i = 0; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++) {\n    flag = 1;\n    for (j = 1; j <= m; j++)\n      if (a[i] == b[j]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[j] = a[i];\n      m++;\n    }\n  }\n  printf(\"%d\", b[1]);\n  for (i = 2; i <= m; i++) {\n    cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23060", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, i2, i3, flag = 1;\n  int a[20000];\n  cin >> n;\n  for (i1 = 0; i1 < n; i1++)\n    scanf(\"%d\", &a[i1]);\n  printf(\"%d\", a[0]);\n  for (i2 = 1; i2 < n; i2++) {\n    flag = 1;\n    for (i3 = 0; i3 < i2; i3++) {\n      if (a[i2] == a[i3])\n        flag *= 0;\n    }\n    if (flag == 1)\n      printf(\" %d\", a[i2]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (flag == 0)\n      cout << a[0];\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n      if (j == i - 1 && a[j] != a[i])\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23062", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, x;\n  int sz[20000];\n  scanf(\"%d\", &n);\n  cin >> sz[0];\n  printf(\"%d\", sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    x = 0;\n    for (k = 0; k < i; k++) {\n\n      if (sz[i] == sz[k]) {\n        break;\n      } else {\n        if (sz[i] != sz[k]) {\n          x++;\n        }\n      }\n      if (x == i) {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        m = 1;\n      }\n    }\n    if (m == 0 && i == 0) {\n      printf(\"%d\", a[i]);\n    }\n    if (m == 0 && i > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23064", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[1000], times[200];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; ++i)\n    cin >> a[i];\n  int tot = 0;\n  for (int i = 0; i < n; ++i)\n    if (!times[a[i]]) {\n      tot++;\n      times[a[i]]++;\n      if (tot > 1)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23065", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20010];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        i--;\n        n--;\n      }\n  }\n  for (int k = 0; k < n - 1; k++)\n    printf(\"%d \", a[k]);\n  printf(\"%d\\n\", a[n - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  int num[20000];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  for (i = 1; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < i; j++) {\n      if (num[i] != num[j]) {\n        continue;\n      } else\n        sum++;\n    }\n    if (sum == 0)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int histgram[101];\n  int i;\n  int x;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    histgram[i] = 0;\n  }\n\n  scanf(\"%d\", &x);\n  histgram[x]++;\n  printf(\"%d\", x);\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &x);\n    if (!histgram[x]) {\n      cout << \" \" << x;\n    }\n    histgram[x]++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        a[j] = 0;\n    }\n    if (a[j])\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 2, j, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i = i + 1) {\n    if (a[i] == a[1])\n      a[i] = 0;\n  }\n  for (k = 2; k <= n; k = k + 1) {\n    if (a[k] != 0) {\n      cout << \" \" << a[k];\n      for (j = k + 1; j <= n; j = j + 1) {\n        if (a[j] == a[k]) {\n          a[j] = 0;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[20000], p = 1;\n  cin >> n;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &m);\n    for (j = 0; j < i; j++) {\n      if (m == a[j]) {\n        p = 0;\n        break;\n      }\n    }\n    if (p == 0) {\n      i--;\n      n--;\n      p = 1;\n    } else {\n      a[i] = m;\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    cout << a[j] << \" \";\n\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++)\n\n  {\n    t = 0;\n    for (i = 0; i < j; i++) {\n      if (a[i] == a[j])\n        t = t + 1;\n      else\n        ;\n    }\n    if (t == 0)\n      printf(\" %d\", a[j]);\n    else\n      ;\n  }\n}\n"}
{"label": "13", "index": "23072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int t;\n  int l = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n    return 0;\n  }\n  printf(\"%d\", a[0]);\n  t = n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t = t - 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        break;\n      } else if (j == i - 1 && l < t) {\n\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20005], b[20005] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[j] != 0; j++) {\n      if (b[j] == a[i])\n        break;\n    }\n    if (b[j] == 0)\n      b[j] = a[i];\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; b[i] != 0; i++)\n    cout << \" \" << b[i];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23074", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, n, a[20001], i, j, b[20001] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (k = n; k > 0; k--)\n    if (b[k] == 0)\n      break;\n  for (i = 1; i < k; i++)\n    if (b[i] == 0)\n      cout << a[i] << ' ';\n  cout << a[k];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23075", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, enter = 1, num = 0;\n  int a[100001] = {0}, b[100001] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= num; j++) {\n      if (a[i] == b[j]) {\n        goto next;\n        break;\n      }\n    }\n    if (enter == 1) {\n      printf(\"%d\", a[i]);\n      enter = 0;\n    } else\n      printf(\" %d\", a[i]);\n    num++;\n    b[num] = a[i];\n  next:\n    b[0] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23076", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k]) {\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23077", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, a[20000], k, j = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++)\n\n  {\n    for (k = 0; k < i; k++) {\n\n      if (a[i] == a[k]) {\n        j = j + 1;\n        break;\n      }\n    }\n    if (j == 0)\n      cout << \" \" << a[i];\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23078", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[101] = {0}, temp, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> temp;\n    if (a[temp] == 0) {\n      num++;\n      a[temp] = num;\n    }\n  }\n  for (int j = 1; j <= num; j++) {\n    for (int k = 10; k <= 100; k++)\n      if (a[k] == j)\n        cout << k;\n    if (j < num) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, s, n;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      cout << a[0];\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        if (a[j] == a[i]) {\n          a[i] = 0;\n          break;\n        }\n      }\n      if (a[i]) {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23080", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, n, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1, b = 1; i <= n; i++, b++) {\n    if (b == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (c = 1; c <= i; c++) {\n        if (a[c] == a[i])\n          break;\n      }\n      if (c == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23081", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, l, m, n;\n  scanf(\"%d\", &n);\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n\n    m = 0;\n    for (k = 1; k < i; k++) {\n      if (a[k] != a[i])\n        m = m + 1;\n    }\n    if (m == i - 1) {\n      l = l + 1;\n      if (l == 1)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    for (int k = 0; k < i; k++) {\n      if (a[i] == a[k])\n        break;\n      if (k == i - 1)\n        cout << \" \" << a[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  int a[100000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  count = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      if (count == 0) {\n        cout << a[i];\n        count = 1;\n      } else\n        printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23084", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001] = {0}, i, j, count = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == a[j])\n        a[j] = a[20000];\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && count == 0) {\n      cout << a[i];\n      count++;\n    } else if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23085", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20000];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  for (i = 1; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < i; j++) {\n      if (num[i] != num[j]) {\n        continue;\n      } else\n        sum++;\n    }\n    if (sum == 0)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct number {\n    int num, status;\n  } a[20000];\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  count = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    a[i].status = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i].num == a[j].num) {\n        a[i].status = 0;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (a[i].status && j != count - 1) {\n      cout << a[i].num << \" \";\n      j++;\n      continue;\n    }\n    if (a[i].status && j == count - 1) {\n      printf(\"%d\\n\", a[i].num);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n\n    if (t == 0) {\n      if (m > 0)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20001] = {0}, count = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        count++;\n        a[i] = 0;\n      }\n    }\n  }\n  cout << a[1];\n  for (int i = 2; i <= n; i++) {\n    if (a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23089", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, num[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 1; j <= i - 1; j++)\n      if (num[j - 1] == num[i - 1]) {\n        num[i - 1] = 0;\n        break;\n      }\n  }\n  cout << num[0];\n  for (i = 1; i <= n - 1; i++) {\n    if (num[i] != 0)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23090", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, a[20000], i, j;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  m = 1;\n  if (n > 1) {\n    do {\n\n      for (i = m - 1; i >= 0; i--) {\n        if (a[m] == a[i])\n          j = j + 1;\n      }\n      if (j == 0)\n        cout << \" \" << a[m];\n      j = 0;\n      m = m + 1;\n    } while (m < n);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23092", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int sum;\n\n  scanf(\"%d \", &n);\n  sum = n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n        sum--;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    cout << a[i];\n    j++;\n    if (j != sum)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, l;\n  int s[12000];\n  scanf(\"%d\", &n);\n  m = n;\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    l++;\n    scanf(\"%d\", &s[l]);\n    for (j = 1; j <= l - 1; j++)\n      if (s[j] == s[l]) {\n        l--;\n        m--;\n      }\n  }\n  for (i = 1; i <= m - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[m]);\n}\n"}
{"label": "13", "index": "23094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *SZ = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (j == 0)\n      cout << SZ[j];\n\n    for (int k = 0; k < j; k++) {\n      if (SZ[j] == SZ[k]) {\n        break;\n      } else if (k == j - 1) {\n        printf(\" %d\", SZ[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23095", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int array[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> array[i];\n  cout << array[0];\n  for (int i = 1; i <= n - 1; i++) {\n    int g = 0;\n    for (int j = 0; j <= i - 1; j++)\n      if (array[i] == array[j])\n        g = g + 1;\n    if (g == 0)\n      cout << \" \" << array[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int input[20000], output[20000], n, i, j, outLen = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n    output[outLen] = input[i];\n    for (j = 1; j < outLen; j++) {\n      if (input[i] == output[j])\n        outLen = outLen - 1;\n      \n    }\n    outLen = outLen + 1;\n  }\n\n  for (i = 1; i < outLen; i++) {\n    printf(\"%d\", output[i]);\n    if (i != outLen - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "13", "index": "23097", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if (p)\n        printf(\" \");\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], t;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    t = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] == a[i] && j != i)\n        t += 1;\n    }\n    if (t >= 1)\n      continue;\n    else if (t == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int shu[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &shu[i]);\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", shu[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (shu[i] == shu[j])\n          shu[i] = 0;\n      }\n      if (shu[i] != 0)\n        cout << \" \" << shu[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23100", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int num = 0;\n  int c = 1;\n  int j, i;\n  int b[100];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        c = 0;\n      }\n    }\n\n    if (c != 0) {\n      num = num + 1;\n      b[num] = a[i];\n    }\n    c = 1;\n  }\n\n  for (i = 1; i < num; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[num];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, s, r;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= n - 1; t++) {\n    r = 0;\n    for (s = 0; s <= t - 1; s++) {\n      if (a[t] == a[s])\n        break;\n      else\n        r++;\n    }\n    if (r == t)\n      printf(\" %d\", a[t]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, i, j = 0, k;\n  int a[91] = {0};\n  scanf(\"%d \", &n);\n  int b[20000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &num);\n    if (a[num - 10] == 0) {\n      b[j] = num;\n      a[num - 10]++;\n      j++;\n    }\n  }\n  cout << b[0];\n  for (k = 1; k <= n; k++) {\n    if (b[k] == 0)\n      break;\n    else\n      cout << \" \" << b[k];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    if (i == 0)\n      cout << a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0 && i != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  scanf(\"%d\", &k);\n  char c[20000];\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &c[i]);\n  }\n  printf(\"%d\", c[1]);\n  for (n = 2; n <= k; n++) {\n    for (j = 1; j <= n - 1; j++) {\n      if (c[n] == c[j])\n        break;\n    }\n    if (j == n && c[n] != c[n - 1]) {\n      printf(\" \");\n      printf(\"%d\", c[n]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23105", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num, e[20001], i, j;\n  scanf(\"%d/n\", &n);\n  if (n == 1) {\n    scanf(\"%d \", &num);\n    printf(\"%d\", num);\n  } else {\n    for (i = 1; i <= n; ++i) {\n      cin >> num;\n      e[i] = num;\n      if (i == 1) {\n        printf(\"%d\", e[1]);\n      } else {\n        for (j = 1; j < i; j++) {\n          if (e[i] == e[j]) {\n            e[i] = 0;\n            break;\n          }\n        }\n        if (e[i] != 0) {\n          printf(\" %d\", e[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23106", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[91];\n  int i, n, number;\n  cin >> n;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &number);\n  a[number - 10]++;\n  if (a[number - 10] == 1)\n    cout << number;\n  for (i = 1; i < n; i++) {\n    cin >> number;\n    a[number - 10]++;\n    if (a[number - 10] == 1)\n      cout << \" \" << number;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i - 1; ++j) {\n      b[i - 1] = 0;\n      b[j] = a[j] - a[i];\n      if (b[j] == 0)\n        break;\n    }\n    if (b[i - 1] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23108", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, m, r;\n  scanf(\"%d\", &n);\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    r = 0;\n    scanf(\"%d\", &a[i]);\n    for (m = 1; m < i; m++) {\n      if (a[i] == a[m])\n        r++;\n    }\n    if (r == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23109", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[101] = {0}, i, num = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      num++;\n      if (num == 1)\n        cout << a[i];\n      if (num != 1)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  register int i, j, flag;\n  int n;\n  flag = 0;\n  char str1[20000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &str1[i - 1]);\n    if (i >= 2) {\n      flag = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (str1[i - 1] == str1[j - 1]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        cout << \" \" << str1[i - 1];\n      }\n    } else {\n      printf(\"%d\", str1[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[100], n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  l = 0;\n  k = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= l; j++)\n      if (a[i] == b[j])\n        k = 1;\n    if (k == 0) {\n      l++;\n      b[l] = a[i];\n    }\n    k = 0;\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[l]);\n}\n"}
{"label": "13", "index": "23112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, num, j, flag, k, h = 0;\n  scanf(\"%d%d\", &n, &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &num);\n    for (j = 0; j <= i - 1; j++) {\n      if (num != a[j])\n        flag = 1;\n      else {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      h++;\n      a[h] = num;\n    }\n  }\n  for (k = 0; k <= h - 1; k++)\n    cout << a[k] << \" \";\n  printf(\"%d\", a[h]);\n  return 0;\n}\n"}
{"label": "13", "index": "23113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  int i = 0;\n  int x;\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[i] = x;\n  i++;\n  for (int j = 1; j < n; j++) {\n    int h;\n    int k = 0;\n    scanf(\"%d\", &h);\n    for (int t = 0; t < i; t++) {\n      if (h == a[t]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", h);\n      a[i] = h;\n      i++;\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int num[n];\n  cin >> num[0];\n  cout << num[0];\n  for (int i = 1; i < n; i++) {\n    cin >> num[i];\n    for (int j = 0; j < i; j++) {\n      if (num[j] == num[i])\n        num[i] = 0;\n    }\n    if (num[i])\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint a[20000] = {0}, b[20000] = {0};\nint main() {\n  int i, j, k = 0, g = 0, kk = 0;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = i + 1; j < n; ++j) {\n      if (a[i] == a[j]) {\n        a[j] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    if (a[i] >= 0) {\n      b[k] = a[i];\n      ++k;\n    }\n  }\n  for (i = 0; i < k - 1; ++i) {\n    cout << b[i] << \" \";\n  }\n  cout << b[k - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23116", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d \", &n);\n  int count = n;\n  for (i = 0; i < count; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    if (i == 0)\n      cout << a[i];\n    else {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001];\n  scanf(\"%d \", &n);\n\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int j = 0; j <= n - 1; j++)\n    for (int k = n - 1; k >= j + 1; k--) {\n      if (a[j] == a[k])\n        a[k] = 0;\n    }\n  cout << a[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (a[m] != 0)\n      cout << \" \" << a[m];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] != a[i]) {\n        k = k + 1;\n      }\n      if (a[j] == a[i]) {\n        k = 0;\n        break;\n      }\n    }\n\n    if (k != 0) {\n      printf(\" %d\", a[i]);\n      k = 0;\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23119", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 2, m;\n  int a[20010], b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    for (m = 1; m <= i - 1; m++) {\n      if (a[m] == a[i])\n        break;\n    }\n    if (m == i) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= j - 1; i++) {\n    if (i < j - 1) {\n      cout << b[i] << \" \";\n    } else\n      cout << b[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001], b[101], c[101];\n  int i, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= 101; i++)\n    b[i] = 0;\n  m = 0;\n  for (i = 1; i <= n; i++)\n    if (b[a[i]] == 0) {\n      m = m + 1;\n      b[a[i]] = 1;\n      c[m] = a[i];\n    }\n  for (i = 1; i <= m; i++) {\n    if (i < m)\n      printf(\"%d \", c[i]);\n    else\n      cout << c[i];\n  }\n}\n"}
{"label": "13", "index": "23121", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[20000];\n  int i, j, k, h;\n  int check[20000];\n  int n;\n  scanf(\"%d \", &n);\n  check[0] = 0;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 1; j < n; j++) {\n    check[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (num[j] == num[k]) {\n        check[j] = 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (h = 1; h < n; h++) {\n    if (check[h] == 0)\n      printf(\" %d\", num[h]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, s, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (k = i + 1; k < n; k++) {\n      if (a[k] == s) {\n        for (j = k; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int number[1000000];\n  cin >> n;\n  for (int i1 = 0; i1 < n; i1++) {\n    scanf(\"%d \", &number[i1]);\n  }\n  for (int i2 = 0; i2 < n; i2++) {\n    for (int i3 = i2 + 1; i3 < n; i3++) {\n      if (number[i2] == number[i3]) {\n        number[i3] = 0;\n      }\n    }\n  }\n  cout << number[0];\n  for (int i4 = 1; i4 < n; i4++) {\n    if (number[i4] != 0) {\n      cout << \" \" << number[i4];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000];\n  cin >> n;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i -= 1;\n        n -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      cout << \" \";\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int a[N], b[N];\n  int i, j, k, n, m = 0, flag;\n  for (i = 0; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++) {\n    flag = 1;\n    for (j = 1; j <= m; j++)\n      if (a[i] == b[j]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[j] = a[i];\n      m++;\n    }\n  }\n  printf(\"%d\", b[1]);\n  for (i = 2; i <= m; i++)\n    printf(\" %d\", b[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n\n  printf(\"%d\", *p);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (*(p + i) == *(p + j))\n        break;\n      else\n        j++;\n    }\n    if (j == i)\n      printf(\" %d\", *(p + i));\n  }\n}\n"}
{"label": "13", "index": "23127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20002];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n\n    if (j == i) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "23128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, j, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        m += 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (i != 0) {\n        printf(\" \");\n      }\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, m, p = 0, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] == a[m])\n        break;\n    }\n    if (m == i) {\n      p = p + 1;\n      b[p] = a[i];\n    }\n  }\n  for (l = 1; l <= p; l++) {\n    if (l == p)\n      printf(\"%d\", b[l]);\n    else\n      cout << b[l] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, cn;\n  scanf(\"%d \", &n);\n  int a[n];\n  cn = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &k);\n    for (j = 0; j <= cn; j++)\n      if (a[j] == k)\n        break;\n    if (j == cn + 1) {\n      a[cn] = k;\n      cn++;\n    }\n  }\n  for (i = 0; i < cn - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[cn - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23131", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long i, n, x;\n  int a[100] = {0};\n  cin >> n;\n  scanf(\"%ld \", &x);\n  printf(\"%d\", x);\n  a[x] = 1;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (a[x] == 0) {\n      printf(\" %d\", x);\n      a[x] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23132", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], b[101], c, i, j, n;\n  for (i = 10; i <= 100; i++)\n    b[i] = 0;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    c = a[i];\n    if (b[c] == 0)\n      b[c]++;\n    else {\n      a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (j = 1; j < n; j++) {\n    if (a[j] != 0)\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i = 0, n, j, k, m = 1;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  k = 0;\n  while (i < n) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j]) {\n        m = 0;\n        break;\n      } else\n        j++;\n    }\n    if (m == 1) {\n      a[k] = a[i];\n      i++, k++;\n    } else\n      i++, m = 1;\n  }\n  for (i = 0; i < (k - 1); i++)\n    cout << a[i] << \" \";\n  cout << a[k - 1] << \"\\n\";\n}\n"}
{"label": "13", "index": "23134", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d \", &n);\n  int N[n];\n  for (i = 0, k = 0; i < n; i++, k++) {\n    cin >> N[k];\n    for (j = 0; j < k; j++) {\n      if (N[j] == N[k])\n        k--;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == (k - 1))\n      cout << N[i];\n    else\n      cout << N[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (int k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n        j = j - 1;\n      } else\n        continue;\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23136", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[101] = {0}, i, num = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      num++;\n      if (num == 1)\n        printf(\"%d\", a[i]);\n      if (num != 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, k, n, count = 0;\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    cin >> a[i]; \n  }\n  for (i = 1, k = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      a[k] = a[i];\n      k++;\n      count++; \n    }\n  }\n  cout << a[0];\n  for (k = 1; k <= count; k++)\n    cout << \" \" << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "23138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, f;\n\n  scanf(\"%d%d\", &n, a);\n  cout << *a;\n  for (i = 1; i < n; i++) {\n    f = 0;\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        f = 1;\n    }\n    if (f == 0)\n      printf(\" %d\", *(a + i));\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        t = 0;\n        break;\n      } else\n        t = 1;\n    }\n    if (t == 0)\n      printf(\"\\0\");\n    else {\n      if (i > 0)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s[20000], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  printf(\"%d\", s[0]);\n  a[s[0]] = 1;\n  for (i = 1; i < n; i++)\n    if (a[s[i]] == 0) {\n      printf(\" %d\", s[i]);\n      a[s[i]] = 1;\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23141", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b, a[20000], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &b);\n    a[i] = b;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j, k, flag = 0;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &a[i]);\n      if (a[i] < 10 || a[i] >= 100)\n        scanf(\"%d\", &a[i]);\n      else\n        continue;\n    }\n    printf(\"%d\", a[0]);\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < j; k++) {\n        if (a[j] == a[k]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        printf(\" %d\", a[j]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b = 0, m, c[91] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0, m = 0; i < n; i++) {\n    b = 0;\n    scanf(\"%d\", &a);\n    for (j = 0; j < 91; j++) {\n      if (c[j] == a)\n        b = 1;\n    }\n    if (b == 0) {\n      c[m] = a;\n      m = m + 1;\n    }\n  }\n  cout << c[0];\n  for (i = 1; i < m; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23144", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (a[i] != a[j] && j == (i - 1))\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20000];\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  for (i = 1; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < i; j++) {\n      if (num[i] != num[j]) {\n        continue;\n      } else\n        sum++;\n    }\n    if (sum == 0)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, flag;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        flag = 1;\n      }\n    }\n    if (flag == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (flag == 0)\n      cout << a[0];\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n      if (j == i - 1 && a[j] != a[i]) {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23148", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k;\n  i = 0;\n  k = 1;\n  cin >> n;\n  if (n == 1) {\n    cin >> a[i];\n    printf(\"%d\", a[i]);\n  } else {\n    cin >> a[i];\n    printf(\"%d\", a[i]);\n    for (i = 1; i < n; i++, k++) {\n      scanf(\"%d\", &a[i]);\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (k < (n - 1)) {\n        if (i == j)\n          printf(\" %d\", a[i]);\n      } else {\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j])\n            break;\n        }\n        if (i == j)\n          printf(\" %d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k, n, x, sum;\n  scanf(\"%d\", &n);\n  k = 0;\n  sum = 0;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    k = 0;\n    scanf(\"%d\", &x);\n    for (j = 0; j < i; j++)\n      if (x == a[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      a[i - sum] = x;\n    else\n      sum++;\n  }\n  for (i = 0; i < n - sum - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "23150", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], t, i, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 1;\n    for (t = 0; t < i; t++) {\n      if (a[i] == a[t]) {\n        m = 0;\n      }\n    }\n    if (m == 1) {\n      if (i > 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k, m = 0;\n  scanf(\"%d \", &N);\n  const int n = N;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - m; i++)\n    for (j = i; j <= n - m; j++) {\n      if (a[i] == a[j + 1]) {\n        for (k = j + 1; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n        j--;\n      }\n    }\n  cout << a[0];\n  for (i = 1; i < n - m; i++) {\n\n    cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, a[20000], i, j;\n  j = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  m = 1;\n  if (n > 1) {\n    do {\n\n      for (i = m - 1; i >= 0; i--) {\n        if (a[m] == a[i])\n          j = j + 1;\n      }\n      if (j == 0)\n        printf(\" %d\", a[m]);\n      j = 0;\n      m = m + 1;\n    } while (m < n);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, end;\n  cin >> n;\n  int a[n], b[n];\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        b[j] = 1;\n      }\n    }\n  for (int i = n - 1; i >= 0; i--) {\n    if (b[i] == 0) {\n      end = i;\n      b[i] = 1;\n      break;\n    }\n  }\n  if (end != 0) {\n    for (int i = 0; i < n; i++) {\n      if (b[i] == 0)\n        cout << a[i] << \" \";\n    }\n  }\n  cout << a[end] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0, t = 0;\n  int a[90000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (k = 1; k < n; k++)\n\n  {\n    t = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i])\n        t = 1;\n    }\n    if (t == 0)\n      printf(\" %d\", a[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23155", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20001], b[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      m = m + 1;\n      b[m] = a[i];\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  cout << b[m] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t = 0;\n  int a[20000];\n  cin >> n;\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      t = 0;\n      if (a[i] == a[j]) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], t = 1, temp;\n  scanf(\"%d \", &n);\n  cin >> a[0];\n  for (int i = 1; i < n; i++) {\n    cin >> temp;\n    for (int j = 0; j < t; j++) {\n      if (temp == a[j])\n        break;\n      if (j == t - 1) {\n        a[t] = temp;\n        t += 1;\n      }\n    }\n  }\n  for (int i = 0; i < t - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[t - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 2, j, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i = i + 1) {\n    if (a[i] == a[1])\n      a[i] = 0;\n  }\n  for (k = 2; k <= n; k = k + 1) {\n    if (a[k] != 0) {\n      printf(\" %d\", a[k]);\n      for (j = k + 1; j <= n; j = j + 1) {\n        if (a[j] == a[k]) {\n          a[j] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, on = 0;\n  cin >> n;\n  int input_array[n], output_array[100], otn_array[n];\n  memset(output_array, 0, sizeof(output_array));\n  for (int i = 0; i < n; i++)\n    cin >> input_array[i];\n  for (int i = 0; i < n; i++) {\n    int otn = input_array[i];\n    if (!output_array[otn - 1]) {\n      output_array[otn - 1] = 1;\n      otn_array[on] = otn;\n      on++;\n    }\n  }\n  for (int i = 0; i < on; i++) {\n    cout << otn_array[i];\n    if (i != on - 1)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, n, k, t;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    t = 0;\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k])\n        t = 1;\n    }\n    if (t == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x = 0, n, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      x++;\n      if (x == 1) {\n        cout << a[i];\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  int a[100000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  count = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      if (count == 0) {\n        cout << a[i];\n        count = 1;\n      } else\n        printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        continue;\n    }\n    if (j == i) {\n      if (i == 0)\n        cout << a[i];\n      else\n        printf(\" %d\", a[i]);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23164", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20001], b[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      m = m + 1;\n      b[m] = a[i];\n    }\n  }\n  for (i = 1; i <= m - 1; i++)\n    printf(\"%d \", b[i]);\n\n  cout << b[m] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23165", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, t[20000], a, s[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < 100; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    cin >> t[i];\n    if (s[t[i]] == 0) {\n      s[t[i]] = 1;\n    } else if (s[t[i]] == 1) {\n      t[i] = 101;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (t[i] != 101) {\n      a = i;\n      printf(\"%d\", t[i]);\n      break;\n    }\n  }\n\n  for (i = a + 1; i < n; i++) {\n    if (t[i] != 101) {\n      printf(\" %d\", t[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[91], count = 0, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      count++;\n      b[count] = a[i];\n      if (count == 90)\n        break;\n    }\n    if (count == 90)\n      break;\n  }\n  if (count > 1) {\n    for (i = 1; i <= count - 1; i++)\n      printf(\"%d \", b[i]);\n    cout << b[count] << endl;\n  } else if (count == 1)\n    cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23167", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[20001], i, j, b[20001] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (k = n; k > 0; k--)\n    if (b[k] == 0)\n      break;\n  for (i = 1; i < k; i++)\n    if (b[i] == 0)\n      printf(\"%d \", a[i]);\n  cout << a[k];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23168", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, count = 0, a[20000];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == a[i])\n        count++;\n    }\n    if (count == 0)\n      cout << ' ' << a[i];\n    else\n      count = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23169", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, m, p = 0, l;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] == a[m])\n        break;\n    }\n    if (m == i) {\n      p = p + 1;\n      b[p] = a[i];\n    }\n  }\n  for (l = 1; l <= p; l++) {\n    if (l == p)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 1, m, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  while (i <= n) {\n    cin >> m;\n    a[i] = m;\n    i++;\n  }\n  int l = 1;\n  while (l <= n) {\n    if (l == 1)\n      printf(\"%d\", a[l]);\n    else {\n      j = 1;\n      k = 0;\n      while (j < l) {\n        if (a[l] == a[j])\n          k = k + 1;\n        j++;\n      }\n      if (k == 0) {\n        printf(\" %d\", a[l]);\n      }\n    }\n    l++;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    } else if (m == 0 && k != 0) {\n      b[k] = a[0];\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "23172", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, p;\n  int a[20000];\n  int b[20000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  b[0] = 0;\n\n  for (j = 1; j < n; j++) {\n    b[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        b[j]++;\n    }\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (p = 1; p < n; p++) {\n    if (b[p] == 0)\n      printf(\" %d\", a[p]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  register int i, j, flag;\n  int n;\n  flag = 0;\n  char str1[20000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &str1[i - 1]);\n    if (i >= 2) {\n      flag = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (str1[i - 1] == str1[j - 1]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        printf(\" %d\", str1[i - 1]);\n\n    } else {\n      cout << str1[0];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k]) {\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23175", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int str[20001];\n  for (int i = 0; i < n; i++)\n    cin >> str[i];\n  int num = 0;\n  for (int i = 1; i < n - num; i++) {\n    for (int j = 0; j < i; j++)\n      if (str[j] == str[i]) {\n        for (int k = i; k < n - 1 - num; k++)\n          str[k] = str[k + 1];\n        num++;\n\n        i--;\n        break;\n      }\n  }\n  cout << str[0];\n  for (int i = 1; i < n - num; i++)\n    cout << ' ' << str[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23176", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, h = 0;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= (n - 1); i++) {\n    if (a[i] != -1) {\n      for (j = i + 1; j <= (n - 1); j++) {\n        if (a[i] == a[j]) {\n          a[j] = -1;\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++)\n    b[i] = a[i];\n  for (i = 0; i <= (n - 1); i++) {\n    if (b[i] != -1) {\n      cout << b[i];\n      h++;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = i + 1; i <= n - 1; i++) {\n    if (b[i] != -1) {\n      cout << \" \" << b[i];\n      h++;\n    }\n    if (h == n - k)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23177", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  while (scanf(\"%d \", &n)) {\n    char b[20000];\n    int a[20000];\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &a[i]);\n    cin.getline(b, 20000);\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        cout << \" \" << a[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j] && a[i] != 0)\n        a[i] = 0;\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      if (a[i] != 0)\n        cout << \" \" << a[i];\n    }\n  }\n}\n"}
{"label": "13", "index": "23179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, s = 0, num = 0, k = 0;\n  int a[20006];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n--;\n        j--;\n        s++;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n - 1) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23180", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 1, n, j, r = 0, a[20001], b[101];\n  cin >> n;\n  memset(b, 1, sizeof(b));\n\n  do {\n    r = r + 1;\n    cin >> j;\n    if (b[j] != 0) {\n      a[i] = j;\n      b[a[i]] = 0;\n      i = i + 1;\n    }\n  } while (r < n);\n\n  for (j = 1; j < i - 1; j++)\n    cout << a[j] << ' ';\n  cout << a[i - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 2, i;\n  scanf(\"%d\", &n);\n  int a[n + 1];\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  while (k <= n) {\n    scanf(\"%d\", &a[k]);\n    i = 1;\n    while (i <= k - 1) {\n      if (a[i] == a[k])\n        break;\n      else if (i == k - 1)\n        printf(\" %d\", a[k]);\n      i = i + 1;\n    }\n    k = k + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23182", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j] && a[i] != 0)\n        a[i] = 0;\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      if (a[i] != 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int b[100];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      if (i > 0)\n        cout << \" \";\n      cout << a[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23184", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j, b = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1]; \n  for (i = 2; i <= n; i++) {\n    for (b = 0, j = 1; j < i; j++) {\n      if (a[i] != a[j]) \n        b = b + 1;      \n    }\n    if (b == i - 1)\n      cout << \" \" << a[i]; \n  }\n  return 0;\n}\n\n"}
{"label": "13", "index": "23185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, l, m, n;\n  scanf(\"%d\", &n);\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n\n    m = 0;\n    for (k = 1; k < i; k++) {\n      if (a[k] != a[i])\n        m = m + 1;\n    }\n    if (m == i - 1) {\n      l = l + 1;\n      if (l == 1)\n        cout << a[i];\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100001], b[100001], temp = 1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[0] = a[0];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[temp] = a[i];\n        temp++;\n      }\n    }\n  }\n  for (i = 0; i < temp - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[temp - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20002] = {1}, n, i, j, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = i - 1; j > 0; j--) {\n      if (a[i] == a[j])\n        break;\n      else\n        k = k + 1;\n    }\n    if (k == i - 1)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 2; i <= n; i++) {\n    int j = 1;\n    while (j < i) {\n      if (a[i - 1] == a[j - 1])\n        break;\n      else {\n        j++;\n      }\n    }\n    if (j == i) {\n      printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  cin >> n;\n  int count = n;\n  for (i = 0; i < count; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, save[20000], count = 0;\n  for (i = 0; i < 20000; i++)\n    save[i] = 0;\n  cin >> n;\n  while (n--) {\n    int flag = 1;\n    scanf(\"%d \", &m);\n    for (i = 0; i < 20000; i++) {\n      if (save[i] == m) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < 20000; i++) {\n        if (save[i] == 0) {\n          save[i] = m;\n          break;\n        }\n      }\n      count++;\n    }\n  }\n  for (i = 0; i < count - 1; i++)\n    cout << save[i] << \" \";\n  cout << save[count - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j = 1, c = 0, l = 1, m, n, k;\n  cin >> n;\n  int s[20000] = {0}, t[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  t[0] = s[0];\n  for (l = 1; l < n; l++) {\n    c = 0;\n    for (i = 0; i < l; i++) {\n      if (s[l] == s[i]) {\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0) {\n      t[j] = s[l];\n      j++;\n    }\n  }\n  for (m = 0; (c = t[m + 1]) != 0; m++) {\n    printf(\"%d \", t[m]);\n  }\n  cout << t[m];\n  return 0;\n}\n"}
{"label": "13", "index": "23192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = i;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] != 0)\n      cout << a[i] << \" \";\n  }\n  cout << a[k];\n}\n"}
{"label": "13", "index": "23193", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, input[20000], output[20000], i, j, k, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    for (j = 0; j < i; j++) {\n      if (input[i] == input[j]) {\n        x++;\n        break;\n      }\n    }\n    if (x == 0) {\n      k++;\n      output[k] = input[i];\n    }\n  }\n  for (i = 1; i < k; i++)\n    printf(\"%d \", output[i]);\n\n  if (i == k)\n    printf(\"%d\\n\", output[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[20000], n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j])\n        j = i + 1;\n      else\n        j++;\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23195", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz1[20000], sz2[20000], i, j, n, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &sz1[i]);\n  }\n  sz2[0] = sz1[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (k = i - 1; k >= 0; k--) {\n      if (sz1[i] == sz2[k]) {\n        break;\n      }\n      if (k == 0) {\n        sz2[j] = sz1[i];\n        j = j + 1;\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++) {\n    if (i == j - 1) {\n      printf(\"%d\", sz2[i]);\n    } else {\n      printf(\"%d \", sz2[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23196", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k, n, x, sum;\n  scanf(\"%d\", &n);\n  k = 0;\n  sum = 0;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    k = 0;\n    cin >> x;\n    for (j = 0; j < i; j++)\n      if (x == a[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      a[i - sum] = x;\n    else\n      sum++;\n  }\n  for (i = 0; i < n - sum - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "23197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n, i, j, x, y, ans, b[200];\n  cin >> n;\n  for (i = 1; i <= 100; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (b[x] == 0)\n      if (i == 1)\n        printf(\"%d\", x);\n      else\n        cout << \" \" << x;\n    b[x] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, num[20001], sum = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (num[i] == 101)\n        break;\n      if (num[j] == num[i])\n        num[j] = 101;\n    }\n\n  for (int i = 0; i < n; i++) {\n    if (num[i] == 101 && num[i + 1] != 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n    } else if (num[i] == 101 && num[i + 1] == 101) {\n      for (int m = i; m < n; m++)\n        num[m] = num[m + 1];\n\n      sum++;\n      i--;\n    }\n  }\n  for (int i = 0; i < n - sum - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n - sum - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n;\n  cin >> n;\n\n  int visit[101] = {0};\n\n  int i;\n  for (i = 0; i < n; i++) {\n    int num;\n    scanf(\"%d\", &num);\n    if (visit[num] == 1) {\n\n    } else {\n      if (i != 0)\n        printf(\" \");\n\n      cout << num;\n      visit[num] = 1;\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "23200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], t = 1, temp;\n  scanf(\"%d \", &n);\n  cin >> a[0];\n  for (int i = 1; i < n; i++) {\n    cin >> temp;\n    for (int j = 0; j < t; j++) {\n      if (temp == a[j])\n        break;\n      if (j == t - 1) {\n        a[t] = temp;\n        t += 1;\n      }\n    }\n  }\n  for (int i = 0; i < t - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[t - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  cin >> n;\n  int count = n;\n  for (i = 0; i < count; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    if (i == 0)\n      cout << a[i];\n    else {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23202", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, k, x;\n  cin >> x;\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < x; i++) {\n    for (j = i + 1; j < x; j++) {\n      if (a[i] == a[j]) {\n        x--;\n        for (k = j; k < x; k++)\n          a[k] = a[k + 1];\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i < x)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p, *q, *head;\n  p = (int *)calloc(n, sizeof(int));\n  head = p;\n  for (p = head; p < head + n; p++)\n    scanf(\"%d\", p);\n\n  p = head;\n  printf(\"%d\", *p);\n  p++;\n  for (; p < head + n; p++) {\n    for (q = head; q < p; q++) {\n      if (*q == *p) {\n        goto chongfu;\n      }\n    }\n    printf(\" %d\", *p);\n  chongfu:;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int b[], int len, int x) {\n  int i, flag = 1;\n  for (i = 0; i < len; i++) {\n    if (b[i] == x) {\n      flag = 0;\n      return 0;\n      break;\n    }\n  }\n  if (flag)\n    return 1;\n}\nint main() {\n  int j, i, n;\n  int a[20100], b[20100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  b[0] = a[0];\n  j = 1;\n  for (i = 1; i < n; i++) {\n    if (check(b, j, a[i])) {\n      cout << \" \" << a[i];\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23205", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n\n  int visit[101] = {0};\n\n  int i;\n  for (i = 0; i < n; i++) {\n    int num;\n    scanf(\"%d\", &num);\n    if (visit[num] == 1) {\n\n    } else {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", num);\n      visit[num] = 1;\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "23206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[100] = {0}, i, n, temp;\n  scanf(\"%d \", &n);\n  scanf(\"%d \", &temp);\n  flag[temp] = 1;\n  cout << temp;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &temp);\n    if (flag[temp] == 0) {\n      cout << \" \" << temp;\n      flag[temp] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23207", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[20001] = {0}, x, i, j;\n  cin >> x;\n  for (i = 1; i <= x; i++)\n    cin >> n[i];\n  for (i = 1; i <= x; i++) {\n    for (j = 1; j <= x; j++)\n      if (n[i] == n[j] && j > i)\n        n[j] = 0;\n  }\n  cout << n[1];\n  for (i = 2; i <= x; i++) {\n    if (n[i] != 0)\n      printf(\" %d\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n, i, j, x, y, ans, b[200];\n  cin >> n;\n  for (i = 1; i <= 100; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (b[x] == 0)\n      if (i == 1)\n        printf(\"%d\", x);\n      else\n        cout << \" \" << x;\n    b[x] = 1;\n  }\n}\n"}
{"label": "13", "index": "23209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  unsigned int n;\n  int i, j, a[20000], m;\n  scanf(\"%u\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        m = 1;\n        break;\n      }\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[90] = {0}, a[20001] = {0}, i;\n  cin >> n;\n  cin >> a[1];\n  num[a[1] - 10]++;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    num[a[i] - 10]++;\n    if (num[a[i] - 10] == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23212", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int i, n, j, c;\n  int a[20000] = {0};\n  cin >> c;\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (n = 1; n < c; n++) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[j] == a[n])\n        break;\n      else\n        continue;\n    }\n    if (j == -1)\n      cout << \" \" << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, count[91] = {0};\n  cin >> n;\n  cin >> x;\n  cout << x;\n  count[x - 10]++;\n  for (int i = 1; i <= n - 1; i++) {\n    cin >> x;\n    if (count[x - 10] == 0)\n      cout << \" \" << x;\n    count[x - 10]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        m = 1;\n    }\n    if (m == 0 && i == 0)\n      cout << a[i];\n    if (m == 0 && i > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, a[20000], k, j = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++)\n\n  {\n    for (k = 0; k < i; k++) {\n\n      if (a[i] == a[k]) {\n        j = j + 1;\n        break;\n      }\n    }\n    if (j == 0)\n      cout << \" \" << a[i];\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23216", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[100000], b[100000] = {0};\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == 0) {\n\n        if (i != j) {\n\n          if (a[i] == a[j]) {\n            b[j] = 1;\n          }\n        } else\n          continue;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      printf(\" \");\n      printf(\"%d\", a[i]);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int count, n, j, i = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (count = 0, j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (i == 1 && count == 0)\n      printf(\"%d\", a[i]);\n    else if (i != 1 && count == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  int n, i, j, k, t = 0;    \n  cin >> n;                 \n  int a[n];                 \n  for (i = 0; i < n; i++) { \n    cin >> a[i];            \n  }\n  for (i = 0; i < n; i++)         \n    if (a[i] >= 0)                \n      for (j = i + 1; j < n; j++) \n        if (a[i] == a[j])\n          a[j] = -1; \n\n  for (i = 0; i < n; i++) \n    if (a[i] >= 0)        \n    {\n      if (i > 0)\n        cout << ' '; \n      cout << a[i];  \n    }\n\n  return 0; \n}\n"}
{"label": "13", "index": "23219", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, s = 1, j, i;\n  cin >> n;\n  int a[n], b[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < s; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n    }\n    if (j == s) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (int i = 0; i < s - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[s - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23220", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20000], j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    k = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 2; i <= n; i++) {\n    int j = 1;\n    while (j < i) {\n      if (a[i - 1] == a[j - 1]) {\n        break;\n      } else {\n        j++;\n      }\n    }\n    if (j == i) {\n      printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23222", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, a[20000], t = 1, temp; \n  cin >> n;\n  cin >> a[0];                \n  for (int i = 1; i < n; i++) \n  {\n    cin >> temp;\n    for (int j = 0; j < t; j++) \n    {\n      if (temp == a[j])\n        break;\n      if (j == t - 1) \n      {\n        a[t] = temp;\n        t += 1;\n      }\n    }\n  }\n  for (int i = 0; i < t - 1; i++) \n    cout << a[i] << ' ';\n  cout << a[t - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, x, m = 0, k = 0, t = 0;\n  cin >> n;\n  int shuzu[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    shuzu[i] = x;\n  }\n  for (m = 0; m < n; m++) {\n    if (m == 0) {\n      cout << shuzu[m];\n    } else {\n      for (k = 0; k < m; k++) {\n        if (shuzu[m] != shuzu[k])\n          t = 1;\n        else {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        printf(\" %d\", shuzu[m]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, save[20000], count = 0;\n  for (i = 0; i < 20000; i++)\n    save[i] = 0;\n  scanf(\"%d \", &n);\n  while (n--) {\n    int flag = 1;\n    scanf(\"%d \", &m);\n    for (i = 0; i < 20000; i++) {\n      if (save[i] == m) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < 20000; i++) {\n        if (save[i] == 0) {\n          save[i] = m;\n          break;\n        }\n      }\n      count++;\n    }\n  }\n  for (i = 0; i < count - 1; i++)\n    printf(\"%d \", save[i]);\n  cout << save[count - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[101];\n  int b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    { scanf(\"%d\", &b); }\n    if (a[b] == 1)\n      a[b] = 1;\n    else {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", b);\n      a[b] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, q = 0, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - q; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        q++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n - q - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - q - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23227", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (k = i + 1; k < n; k++)\n      while ((a[k] == a[i]) && (k < n)) {\n        for (t = k; t < n - 1; t++)\n          a[t] = a[t + 1];\n        n--;\n      }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "13", "index": "23229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        j = i;\n      } else {\n        j = j;\n      }\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23230", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], b[101], c, i, j, n;\n  for (i = 10; i <= 100; i++) {\n    b[i] = 0;\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    c = a[i];\n    if (b[c] == 0)\n      b[c]++;\n    else {\n      a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (j = 1; j < n; j++) {\n    if (a[j] != 0)\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20100], i, j;\n  cin >> n;\n  scanf(\"%d\", a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      cout << \" \" << *(a + i);\n    }\n  }\n}\n"}
{"label": "13", "index": "23232", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] == a[0])\n      a[i] = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n      for (j = i + 1; j < n; j++)\n        if (a[j] == a[i])\n          a[j] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[20010];\n\nint main() {\n  int n, i, tmp, k, ii = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &tmp);\n    int j;\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == tmp) {\n        flag = 1;\n      }\n    }\n    if (flag == 0) {\n      a[ii] = tmp;\n      ii++;\n    }\n  }\n  for (k = 0; k < ii - 1; k++) {\n    printf(\"%d \", a[k]);\n  }\n  printf(\"%d\", a[ii - 1]);\n}\n"}
{"label": "13", "index": "23234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, on = 0;\n  cin >> n;\n  int input_array[n], output_array[100], otn_array[n];\n  memset(output_array, 0, sizeof(output_array));\n  for (int i = 0; i < n; i++)\n    cin >> input_array[i];\n  for (int i = 0; i < n; i++) {\n    int otn = input_array[i];\n    if (!output_array[otn - 1]) {\n      output_array[otn - 1] = 1;\n      otn_array[on] = otn;\n      on++;\n    }\n  }\n  for (int i = 0; i < on; i++) {\n    cout << otn_array[i];\n    if (i != on - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 1, k = 1, a[20000], b[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k == 1) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 1;\n  }\n\n  for (j = 0; j < m - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[j]);\n}\n"}
{"label": "13", "index": "23236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[105], n, i;\n  for (i = 0; i < 101; i += 1) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &i);\n  a[i] = 1;\n  printf(\"%d\", i);\n  while (n-- > 1) {\n    scanf(\"%d\", &i);\n    if (a[i])\n      continue;\n    a[i] = 1;\n    cout << \" \" << i;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20005], del, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    del = a[i];\n    if (a[i] >= 10) {\n      if (i == 1) {\n        printf(\"%d\", a[1]);\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n}\n"}
{"label": "13", "index": "23238", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k = 0, num;\n  int a[100] = {0}, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    if (a[num] == 0) {\n      a[num]++;\n      b[k] = num;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23239", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, s = 0;\n  cin >> n;\n  if (n < 1 || n > 20000)\n    return 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] < 10 || a[i] >= 100)\n      return 0;\n  }\n  for (j = 0; j < n - s; j++) {\n    for (i = n - 1 - s; i > j; i--) {\n      if (a[j] == a[i]) {\n        s = s + 1;\n        for (k = i; k < n - s; k++)\n          a[k] = a[k + 1];\n      }\n    }\n  }\n  for (i = 0; i < n - s; i++) {\n    if (i != n - s - 1)\n      cout << a[i] << \" \";\n    else\n      cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23240", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  ;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1 - m; i++)\n    for (j = i + 1; j < n - m;)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n      } else\n        j++;\n  for (i = 0; i < n - 1 - m; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - m - 1]);\n}\n"}
{"label": "13", "index": "23241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, hash[30000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    hash[i] = 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        hash[i] = hash[i] * 0;\n      } else\n        hash[i] = hash[i];\n    }\n  }\n  for (i = 2; i <= n; i++) {\n    if (hash[i] == 1)\n      cout << \" \" << a[i];\n  }\n  int b;\n  cin >> b;\n  return 0;\n}\n"}
{"label": "13", "index": "23242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int count, n, j, i = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (count = 0, j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (i == 1 && count == 0)\n      printf(\"%d\", a[i]);\n    else if (i != 1 && count == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (j = 0; j < n; j++) {\n    if (a[j] >= 10 && a[j] <= 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] >= 10 && a[i] <= 100) {\n          if (a[j] == a[i])\n            a[i] = 0;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i - 1]);\n  }\n  cout << a[0];\n  for (j = 2; j <= n; j++) {\n    for (m = 1; m <= j - 1; m++) {\n      if (a[j - 1] == a[m - 1]) {\n        break;\n      }\n    }\n    if (m == j)\n      cout << \" \" << a[j - 1];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      ;\n    else {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  k = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (a[j] != 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] == a[j]) {\n          a[i] = 100;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 100) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23247", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, hash[30000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    hash[i] = 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        hash[i] = hash[i] * 0;\n      } else {\n        hash[i] = hash[i];\n      }\n    }\n  }\n  for (i = 2; i <= n; i++) {\n    if (hash[i] == 1)\n      printf(\" %d\", a[i]);\n  }\n  int b;\n  cin >> b;\n  return 0;\n}\n"}
{"label": "13", "index": "23248", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, number;\n  int a[100] = {0};\n\n  cin >> n;\n  i = 0;\n  for (j = 1; j <= n; j++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number]++;\n      if (i == 0) {\n        cout << number;\n        i = 1;\n      } else {\n        printf(\" %d\", number);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, r, t, s;\n  scanf(\"%d\", &n);\n  s = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t++;\n      }\n    }\n    if (t == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (r = 0; r < s - 1; r++) {\n    printf(\"%d \", b[r]);\n  }\n  printf(\"%d\", b[s - 1]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, u[20000], a[20000], b, c;\n  b = 0;\n  c = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &u[i]);\n    a[i] = 0;\n  }\n  if (n == 1) {\n    printf(\"%d\", u[0]);\n  } else {\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j <= i - 1; j++) {\n        if (u[i] == u[j]) {\n          a[i] = a[i] + 1;\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        b = b + 1;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        c = c + 1;\n        if (c < b) {\n          printf(\"%d \", u[i]);\n        }\n        if (c == b) {\n          printf(\"%d\", u[i]);\n        }\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;     \n  int a[20001]; \n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];             \n  int j = 1;                 \n  for (i = 2; i <= n; i++) { \n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        int u = i;\n        if (a[i] == a[i + 1])\n          j--;\n        while (i < n) {\n          a[i] = a[i + 1]; \n          i++;\n        }\n        i = u;\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) \n    cout << a[i] << \" \";\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p;\n  scanf(\"%d \", &n);\n  int a[20001];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[k] != 0) {\n        if (a[j] == a[k]) {\n          a[k] = 0;\n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (p = 1; p < n; p++) {\n    if (a[p] != 0)\n      cout << \" \" << a[p];\n    continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  scanf(\"%d\", &n);\n  if (n == 0)\n    return 0;\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[0] = x;\n  for (j = 1; j < n; j++) {\n    scanf(\"%d\", &x);\n    k = 0;\n    while ((k < m) && (a[k] != x))\n      k++;\n    if (k == m) {\n      a[m++] = x;\n      printf(\" %d\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23256", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j, k = 0, b = 0;\n  int a[20000], c[20000];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      c[k] = a[i];\n      k++;\n    } else\n      b = b + 1;\n  }\n  for (k = 0; k < n - b - 1; k++)\n    printf(\"%d \", c[k]);\n  printf(\"%d\", c[n - b - 1]);\n}\n"}
{"label": "13", "index": "23257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 1, i = 0, n = 0, j = 0, k = 0;\n  cin >> m;\n  int a[20000] = {0};\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < m; i++) {\n    cin >> a[i];\n    k = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[20000], B[20000], n, i, j, k;\n  int flag;\n  int number = 0;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < i; k++) {\n      if (A[k] == A[i]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      B[j] = A[i];\n      number = number + 1;\n      j = j + 1;\n    }\n  }\n  for (j = 0; j < number; j++) {\n    if (j == 0) {\n      cout << B[j];\n    } else {\n      printf(\" %d\", B[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, k = 0, t, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 1; i < n - k; i++) {\n    for (m = 1; m <= i; m++) {\n      if (a[i] == a[i - m]) {\n        t = i;\n        for (i = t; i < n - k; i++)\n          a[i] = a[i + 1];\n        i = t - 1;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k = 0, flag, n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    flag = 1;\n    for (j = 0; j <= i - 1; j++)\n      if (b[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    printf(\"%d \", b[i]);\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  int a[20000];\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  b = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = 1;\n  cout << a[0];\n  while (i < n) {\n    while ((j < i) && (b == 0)) {\n      if (a[j] != a[i])\n        j++;\n      else {\n        b = 1;\n      }\n    }\n    if (b == 0)\n      printf(\" %d\", a[i]);\n    i++;\n    j = 0;\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23262", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int str[20001];\n  for (int i = 0; i < n; i++)\n    cin >> str[i];\n  int num = 0;\n  for (int i = 1; i < n - num; i++) {\n    for (int j = 0; j < i; j++)\n      if (str[j] == str[i]) {\n        for (int k = i; k < n - 1 - num; k++)\n          str[k] = str[k + 1];\n        num++;\n\n        i--;\n        break;\n      }\n  }\n  cout << str[0];\n  for (int i = 1; i < n - num; i++)\n    printf(\" %d\", str[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (k = i + 1; k < n; k++)\n      while ((a[k] == a[i]) && (k < n)) \n      {\n        for (t = k; t < n - 1; t++) \n          a[t] = a[t + 1];\n        n--;\n      }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b;\n  int m[20002];\n  int i = 1;\n  int a = 2;\n  int num;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d \", &m[i]);\n    i++;\n  } while (i <= n);\n  if (n == 1) {\n    cout << m[1];\n  } else {\n    printf(\"%d\", m[1]);\n    do {\n      b = 1;\n      do {\n        num = 0;\n        if (m[b] == m[a]) {\n          num++;\n          break;\n        } else {\n          b++;\n        }\n      } while (b < a);\n      if (num == 0) {\n        printf(\" %d\", m[a]);\n      } else {\n      }\n      a++;\n    } while (a <= n);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23265", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, number;\n  int a[100] = {0};\n\n  cin >> n;\n  i = 0;\n  for (j = 1; j <= n; j++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number]++;\n      if (i == 0) {\n        printf(\"%d\", number);\n        i = 1;\n      } else\n        cout << \" \" << number;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, l, m, n, a[20000], b[90], x;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (j = 0; j < n; j++) {\n    for (l = 0; l < k; l++) {\n      if (a[j] == b[l])\n        m = 1;\n    }\n    if (m != 1) {\n      b[k] = a[j];\n      k++;\n    }\n    m = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (x = 1; x < k; x++)\n    printf(\" %d\", b[x]);\n  return 0;\n}\n"}
{"label": "13", "index": "23267", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20005], b[20005] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[j] != 0; j++) {\n      if (b[j] == a[i])\n        break;\n    }\n    if (b[j] == 0)\n      b[j] = a[i];\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; b[i] != 0; i++) {\n    cout << \" \" << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b;\n  int m[20002];\n  int i = 1;\n  int a = 2;\n  int num;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d\", &m[i]);\n    i++;\n  } while (i <= n);\n  if (n == 1) {\n    printf(\"%d\", m[1]);\n  } else {\n    printf(\"%d\", m[1]);\n    do {\n      b = 1;\n      do {\n        num = 0;\n        if (m[b] == m[a]) {\n          num++;\n          break;\n        } else\n          b++;\n\n      } while (b < a);\n      if (num == 0) {\n        printf(\" %d\", m[a]);\n      } else {\n      }\n      a++;\n    } while (a <= n);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, flag[90];\n\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    flag[a[i] - 10] = 1;\n  }\n  for (int j = 0; j < n; j++) {\n    if (flag[a[j] - 10]) {\n      if (j) {\n        cout << \" \" << a[j];\n      } else\n        cout << a[j];\n    }\n    flag[a[j] - 10] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23270", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num, count[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d \", &num);\n    count[num]++;\n    if (i == 1)\n      printf(\"%d\", num);\n    if (count[num] == 1 && i >= 2)\n      cout << \" \" << num;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  unsigned int n;\n  int i, j, a[20000], m;\n  scanf(\"%u\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        m = 1;\n        break;\n      }\n    if (m == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23272", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[20001], sum = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (num[i] == 101)\n        break;\n      if (num[j] == num[i])\n        num[j] = 101;\n    }\n\n  for (int i = 0; i < n; i++) {\n    if (num[i] == 101 && num[i + 1] != 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n    } else if (num[i] == 101 && num[i + 1] == 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n      i--;\n    }\n  }\n  for (int i = 0; i < n - sum - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  printf(\"%d\", num[n - sum - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int number[1000];\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &number[i]);\n    i++;\n  }\n  i = 1;\n  int j = 0;\n  printf(\"%d\", number[0]);\n  while (i < n) {\n    while (j < i) {\n      if (number[i] == number[j]) {\n        break;\n      } else {\n        j++;\n      }\n      if (j == i) {\n        cout << \" \" << number[i];\n      }\n    }\n    j = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[100] = {0}, i, n, temp;\n  cin >> n;\n  cin >> temp;\n  flag[temp] = 1;\n  cout << temp;\n  for (i = 1; i < n; i++) {\n    cin >> temp;\n    if (flag[temp] == 0) {\n      printf(\" %d\", temp);\n      flag[temp] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint shuzu[20000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int t = 0; t < n; t++) {\n    scanf(\"%d\", &shuzu[t]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = j + 1; i < n; i++) {\n      if (shuzu[i] == shuzu[j]) {\n        shuzu[i] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (shuzu[m] != 0) {\n      if (m == 0) {\n        cout << shuzu[m];\n      } else {\n        printf(\" %d\", shuzu[m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23276", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000];\n  cin >> n;\n  cin >> a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i -= 1;\n        n -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k = 0, flag, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    flag = 1;\n    for (j = 0; j <= i - 1; j++)\n      if (b[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    printf(\"%d \", b[i]);\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23278", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], j, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--)\n    for (k = i - 1; k >= 0; k--)\n      if (a[i] == a[k]) {\n        m++;\n        for (j = i; j <= n - m; j++)\n          a[j] = a[j + 1];\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n - m; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "13", "index": "23279", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[101] = {0}, i, num = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      num++;\n      if (num == 1)\n        printf(\"%d\", a[i]);\n      if (num != 1)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000] = {0};\n  int i, j, k, m = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, j = 0; i < n; i++, m = 0) {\n    for (k = j; k >= 0; k--) {\n      if (a[i] == b[k]) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000] = {0};\n  int n, c, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &c);\n  a[0] = c;\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &c);\n    a[i] = c;\n    for (j = 0; j <= i - 1; j++) {\n      if (c == a[j])\n        a[i] = 0;\n    }\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0};\n  cin >> n;\n  int count = n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      for (int j = i + 1; j <= n; j++)\n        if (a[j] == a[i]) {\n          a[j] = 0;\n          count -= 1;\n        }\n    }\n  }\n  if (count > 1) {\n    int i;\n    for (i = 1; i <= n; i++) {\n      if (a[i] != 0) {\n        cout << a[i] << ' ';\n        count--;\n      }\n      if (count == 1)\n        break;\n    }\n    for (i = i + 1; i <= n; i++)\n      if (a[i] != 0)\n        printf(\"%d\", a[i]);\n  } else\n    for (int i = 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, k = 0, b = 0;\n  int a[20000], c[20000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      c[k] = a[i];\n      k++;\n    } else\n      b = b + 1;\n  }\n  for (k = 0; k < n - b - 1; k++)\n    printf(\"%d \", c[k]);\n  printf(\"%d\", c[n - b - 1]);\n}\n"}
{"label": "13", "index": "23284", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        m = 1;\n    }\n    if (m == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    if (m == 0 && i > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20000] = {0}, b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  printf(\"%d\", b[0]);\n  if (k > 1) {\n    for (i = 1; i < k; i++)\n      cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23286", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, flag;\n  int a[100000];\n  cin >> n;\n  scanf(\"%d \", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      b[i] = a[i] - a[j];\n      if (b[i] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t = 0;\n  scanf(\"%d \", &n);\n  int N[20000];\n  int M[90] = {0};\n  for (i = 0; i < n; i++)\n    cin >> N[i];\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (N[j] == N[k])\n        break;\n    }\n    if (k == j) {\n      M[t] = N[j];\n      t++;\n    }\n  }\n  for (m = 0; m < t - 1; m++)\n    cout << M[m] << \" \";\n  cout << M[t - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23289", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20005], b[20005] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[j] != 0; j++) {\n      if (b[j] == a[i])\n        break;\n    }\n    if (b[j] == 0)\n      b[j] = a[i];\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; b[i] != 0; i++) {\n    cout << \" \" << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23290", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, c;\n  int a[101] = {0};\n  cin >> n;\n  cin >> c;\n  a[c] = 1;\n  printf(\"%d\", c);\n  while (cin >> c) {\n    if (a[c] == 0) {\n      cout << \" \" << c;\n      a[c] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] == a[i])\n        a[j] = -1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != -1)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[10005], n, i, j, flag = 1, flag2 = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    cin >> a[i];\n    for (j = 1; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        flag = 0;\n    }\n    if (flag) {\n      if (flag2 == 0) {\n        printf(\"%d\", a[i]);\n        flag2 = 1;\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int mark[101];\n  for (int i = 0; i < 101; i++) {\n    mark[i] = 0;\n  }\n  int num[20005];\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  mark[num[0]] = 1;\n  for (int i = 0; i < n; i++) {\n    if (mark[num[i]] == 0) {\n      mark[num[i]] = 1;\n      cout << \" \" << num[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23294", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m;\n    for (j = 0; j < i; j++) {\n      if (a[j] == m)\n        break;\n    }\n    if (j == i) {\n      a[i] = m;\n    } else {\n      n = n - 1;\n      i = i - 1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23295", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = k + 1;\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int shu[n];\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &shu[i]);\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", shu[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (shu[i] == shu[j]) {\n          shu[i] = 0;\n        }\n      }\n      if (shu[i] != 0)\n        cout << \" \" << shu[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint shuzu[20000];\nint main() {\n  int n, x;\n  scanf(\"%d\", &n);\n  for (int t = 0; t < n; t++) {\n    cin >> shuzu[t];\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = j + 1; i < n; i++) {\n      if (shuzu[i] == shuzu[j]) {\n        shuzu[i] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (shuzu[m] != 0) {\n      if (m == 0) {\n        printf(\"%d\", shuzu[m]);\n      } else\n        cout << \" \" << shuzu[m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int t = 1; t < n; t++) {\n    int k = 0;\n    for (; k < t; k++)\n      if (a[t] == a[k])\n        break;\n    if (k == t)\n      cout << setw(3) << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  i = 0;\n  while (i < n) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] == a[j])\n        a[j] = 0;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  i = 1;\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n}\n"}
{"label": "13", "index": "23300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0, c = 0; j < i; j++) {\n      if (a[i] != a[j])\n        c++;\n    }\n    if (c == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23301", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000] = {0};\n  int i, j, k = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == 0) {\n        if (a[i] == a[j]) {\n          b[j] = 1;\n          k++;\n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = i;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] != 0) {\n      printf(\"%d \", a[i]);\n    }\n  }\n  printf(\"%d\", a[k]);\n  return 0;\n}\n"}
{"label": "13", "index": "23303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], i, j, n, t, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    count = 0;\n    for (j = i; j >= 0; j--) {\n      count++;\n      if (a[i] == a[j] && (i != j)) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0 && count == 1) {\n      printf(\"%d\", a[i]);\n    } else if ((t == 0) && (count != 1)) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23304", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20000], i, t, k = 0, h;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (t = i + 1; t < n - k; t++)\n      if (a[i] == a[t]) {\n        for (h = t; h < n - k - 1; h++) {\n          a[h] = a[h + 1];\n        }\n        k++;\n        t--;\n      }\n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n - k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int u[20000];\n  int a, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] == u[j]) {\n        u[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i] != 0) {\n      k++;\n    }\n  }\n  i = 0;\n  l = 0;\n  while (i < n) {\n    if (u[i] != 0)\n\n    {\n      if (l < k - 1) {\n        printf(\"%d \", u[i]);\n        l++;\n      }\n\n      else {\n        printf(\"%d\", u[i]);\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m;\n  int a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      for (j = 0; j < n; j++)\n        if (a[i] == a[j]) {\n          if (i != j && a[j] != 0)\n            a[j] = 0;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k++;\n    }\n  m = k;\n  for (k = 0; k < m - 1; k++)\n    printf(\"%d \", b[k]);\n  printf(\"%d\", b[k]);\n  return 0;\n}\n"}
{"label": "13", "index": "23307", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        a[i] = -1;\n        break;\n      }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, j, k, m = 0, n, b = 0, c = 1;\n  scanf(\"%d\", &n);\n  k = n;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        k -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && c < k) {\n      cout << a[i] << \" \";\n      c += 1;\n    } else {\n      if (a[i] != 0 && c == k) {\n        cout << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  cin >> n;\n  if (n == 0)\n    return (0);\n  else {\n    scanf(\"%d\", &x);\n    printf(\"%d\", x);\n    a[0] = x;\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &x);\n      k = 0;\n      while ((k < m) && (a[k] != x))\n        k++;\n      if (k == m) {\n        a[m++] = x;\n        printf(\" %d\", x);\n      }\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "13", "index": "23310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100001], b[100001], temp = 1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[0] = a[0];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[temp] = a[i];\n        temp++;\n      }\n    }\n  }\n  for (i = 0; i < temp - 1; i++)\n    cout << b[i] << \" \";\n\n  cout << b[temp - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20001] = {0};\n  for (i = 1; i <= n; i++)\n    cin >> num[i];\n  cout << num[1];\n  for (i = 2; i <= n; i++) {\n    int k = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (num[i] == num[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n = 0, i = 0, j = 0, c = 0;\n\n  for (i = 0; i < 20000; i++)\n    a[i] = 0;\n\n  scanf(\"%d \", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    c = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        c = 1;\n    if (c == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  if (n >= 2) {\n    if (a[1] != a[0])\n      printf(\" %d\", a[1]);\n    for (i = 2; i < n; i++) {\n      if (a[i] != a[0]) {\n        for (j = 0; j < i - 1; j++) {\n          if (a[j] != a[i])\n            continue;\n          else\n            break;\n        }\n        if (a[j] != a[i])\n          printf(\" %d\", a[i]);\n      } else\n        continue;\n    }\n  }\n}\n"}
{"label": "13", "index": "23314", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, flag;\n  int a[1000];\n  cin >> n;\n  a[0] = 1;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      if (i > 1)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23315", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20010];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        i--;\n        n--;\n      }\n  }\n  for (int k = 0; k < n - 1; k++)\n    cout << a[k] << \" \";\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x = 0,\n                               q;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  for (k = 0; b[k] != 0; k++) {\n    x++;\n    if (x == 1) {\n      printf(\"%d\", b[k]);\n    } else {\n      cout << \" \" << b[k];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, x;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = x;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (t = j; t < n; t++) {\n          a[t] = a[t + 1];\n        }\n        n--;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23318", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int n, figure[20000] = {0}, num[100] = {0}, flag[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> figure[i];\n  }\n  flag[figure[0]]++;\n  cout << figure[0];\n  for (int i = 1; i < n; i++) {\n    if (flag[figure[i]] == 0) {\n      flag[figure[i]]++;\n      cout << \" \" << figure[i];\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[20000], sign;\n  int b[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (i != s - 1)\n      (printf(\"%d \", b[i]));\n    else\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int *p;\n  cin >> n;\n  p = (int *)malloc(sizeof(int) * n);\n  scanf(\"%d\", &p[0]);\n  cout << p[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &p[i]);\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << \" \" << p[i];\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 1, k = 1, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k == 1) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 1;\n  }\n\n  for (j = 0; j < m - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[j]);\n}\n"}
{"label": "13", "index": "23322", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int n, i, j, s;\n  s = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    if (i == 1) {\n      printf(\"%d\", a[1]);\n    } else {\n      for (j = 1; j < i; j++) {\n        if (a[j] == a[i])\n          s = s + 1;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  while (n < 1 || n > 20000) {\n    scanf(\"%d\", n);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    while (a[i] < 10 || a[i] > 100) {\n      scanf(\"%d\", &a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23324", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  scanf(\"%d \", &p[0]);\n  printf(\"%d\", p[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &p[i]);\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", p[i]);\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20002], b[20001], n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n + 1; i++)\n    b[i] = 0;\n  a[n + 1] = 0;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n + 1; j++)\n      b[i] += a[j];\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0 && b[i] != 0)\n      cout << a[i] << \" \";\n    else if (a[i] != 0 && b[i] == 0)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23326", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n[20001] = {0}, x, i, j;\n  cin >> x;\n  for (i = 1; i <= x; i++)\n    cin >> n[i];\n  for (i = 1; i <= x; i++) {\n    for (j = 1; j <= x; j++)\n      if (n[i] == n[j] && j > i)\n        n[j] = 0;\n  }\n  cout << n[1];\n  for (i = 2; i <= x; i++) {\n    if (n[i] != 0)\n      printf(\" %d\", n[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int k = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    for (j = 0; j <= i - 1; j++) {\n      if (i - 1 == 0) {\n        k = k + 1;\n        a[0] = a[0];\n      } else {\n        if (a[j] == a[i - 1] && j != i - 1)\n          break;\n        else if (a[j] == a[i - 1]) {\n          a[k - 1] = a[i - 1];\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= k - 3; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[k - 2]);\n  return 0;\n}\n"}
{"label": "13", "index": "23328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001] = {0}, i, j, count = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == a[j])\n        a[j] = a[20000];\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && count == 0) {\n      cout << a[i];\n      count++;\n    } else if (a[i] != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20001] = {0}, j, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (l = (i + 1); l < n; l++) {\n      if (a[l] == a[i]) {\n        for (j = (l + 1); j < n; j++) {\n          a[j - 1] = a[j];\n        }\n        l -= 1;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i;\n  int buf;\n  int appeared[110] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &buf);\n    if (!appeared[buf]) {\n      if (i != 0)\n        printf(\" \");\n\n      printf(\"%d\", buf);\n      appeared[buf] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23331", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101] = {0};\n  int i = 0;\n  int n = 0;\n  int t = 0;\n  int f = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> t;\n    if ((f != 0) && (!a[t]))\n      cout << \" \";\n    else\n      f = 1;\n    if (!a[t])\n      cout << t;\n    a[t] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, num, j, flag, k, h = 0;\n  scanf(\"%d%d\", &n, &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &num);\n    for (j = 0; j <= i - 1; j++) {\n      if (num != a[j])\n        flag = 1;\n      else {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      h++;\n      a[h] = num;\n    }\n  }\n  for (k = 0; k <= h - 1; k++)\n    printf(\"%d \", a[k]);\n  printf(\"%d\", a[h]);\n  return 0;\n}\n"}
{"label": "13", "index": "23333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i;\n  int buf;\n  int appeared[110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &buf);\n    if (!appeared[buf]) {\n      if (i != 0) {\n        printf(\" \");\n      }\n\n      printf(\"%d\", buf);\n      appeared[buf] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23334", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[20001] = {0};\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (i == 0)\n      cout << a[i];\n    else {\n      int t = 0;\n      for (int j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t++;\n      }\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        for (k = i; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cout << a[i];\n    if (i != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23336", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j = 2, m;\n  int a[20010], b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    for (m = 1; m <= i - 1; m++) {\n      if (a[m] == a[i])\n        break;\n    }\n    if (m == i) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 1; i <= j - 1; i++) {\n    if (i < j - 1)\n      cout << b[i] << \" \";\n    else\n      cout << b[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, s, n;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[0]);\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        if (a[j] == a[i]) {\n          a[i] = 0;\n          break;\n        }\n      }\n      if (a[i]) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23338", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, num, e[20001], i, j;\n  scanf(\"%d/n\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &num);\n    printf(\"%d\", num);\n  } else {\n    for (i = 1; i <= n; ++i) {\n      cin >> num;\n      e[i] = num;\n      if (i == 1) {\n        printf(\"%d\", e[1]);\n      } else {\n        for (j = 1; j < i; j++) {\n          if (e[i] == e[j]) {\n            e[i] = 0;\n            break;\n          }\n        }\n        if (e[i] != 0)\n          printf(\" %d\", e[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23339", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct arr {\n  long int num;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  cin >> p1->num;\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%ld\", &p1->num);\n  }\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%ld\", p->num);\n    else\n      printf(\" %ld\", p->num);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  while (p != NULL) {\n    head = head->next;\n    free(p);\n    p = head;\n  }\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->num == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->num == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  int m;\n  struct arr *head, *p;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  while (p != NULL) {\n    p->next = del(p->next, p->num);\n    p = p->next;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "13", "index": "23340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int a[20000], i, n, k, j, m;\n  scanf(\"%d\", &n);\n  m = n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n\n        n--;\n        for (j = i; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (i < n - 1) {\n      printf(\"%d \", a[i]);\n    } else {\n      cout << a[n - 1];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  scanf(\"%d\", &n);\n  if (n == 0)\n    return (0);\n  else {\n    scanf(\"%d\", &x);\n    printf(\"%d\", x);\n    a[0] = x;\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &x);\n      k = 0;\n      while ((k < m) && (a[k] != x))\n        k++;\n      if (k == m) {\n        a[m++] = x;\n        printf(\" %d\", x);\n      }\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "13", "index": "23342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, hash[30000];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    hash[i] = 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        hash[i] = hash[i] * 0;\n      } else {\n        hash[i] = hash[i];\n      }\n    }\n  }\n  for (i = 2; i <= n; i++) {\n    if (hash[i] == 1)\n      cout << \" \" << a[i];\n  }\n  int b;\n  cin >> b;\n  return 0;\n}\n"}
{"label": "13", "index": "23343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, j = 0, i = 0, k = 0, a[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] <= 100 && a[i] >= 10) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          i = i - 1;\n          n = n - 1;\n        }\n      }\n    } else {\n      i = i - 1;\n      n = n - 1;\n    }\n  }\n  for (k = 0; k < n - 1; k++)\n    cout << a[k] << \" \";\n\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, js, cunzai;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    cunzai = 0;\n    js = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        js++;\n    }\n    if (js == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23345", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100000], a[100], n, i, d;\n  scanf(\"%d \", &n);\n  for (i = 0; i < 100; i++) {\n    a[i] = 1;\n  }\n  cin >> sz[0];\n  printf(\"%d\", sz[0]);\n  a[sz[0]] = 0;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    d = sz[i];\n    if (a[d] != 0) {\n      printf(\" %d\", sz[i]);\n    }\n\n    a[d] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, flag, g;\n  scanf(\"%d \", &n);\n  g = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    flag = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag == 1)\n      if (g)\n        cout << \" \" << a[i];\n      else {\n        cout << a[i];\n        g = 1;\n      }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, input[20000], output[20000], i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> input[i];\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    for (j = 0; j < i; j++) {\n      if (input[i] == input[j]) {\n        x++;\n        break;\n      }\n    }\n    if (x == 0) {\n      k++;\n      output[k] = input[i];\n    }\n  }\n  for (i = 1; i < k; i++) {\n    printf(\"%d \", output[i]);\n  }\n  if (i == k)\n    printf(\"%d\\n\", output[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23348", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p;\n  cin >> n;     \n  int a[20001]; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  } \n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[k] != 0) { \n        if (a[j] == a[k]) {\n          a[k] = 0; \n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (p = 1; p < n; p++) {\n    if (a[p] != 0)\n      cout << \" \" << a[p]; \n    continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) { \n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0; \n    }\n  }\n  int temp[20001], k = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      temp[k] = a[i]; \n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << temp[i] << ' '; \n  cout << temp[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i = 0, n, j, k, m = 1;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  k = 0;\n  while (i < n) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j]) {\n        m = 0;\n        break;\n      } else\n        j++;\n    }\n    if (m == 1) {\n      a[k] = a[i];\n      i++, k++;\n    } else\n      i++, m = 1;\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[k - 1]);\n}\n"}
{"label": "13", "index": "23351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100];\n  for (int i = 2; i <= 100; i++) {\n    a[i] = 0;\n  }\n  int n;\n  cin >> n;\n  int b;\n  cin >> b;\n  cout << b;\n  a[b] = 1;\n  for (int i = 2; i <= n; i++) {\n\n    scanf(\"%d \", &b);\n    if (a[b] == 0) {\n      a[b] = 1;\n      cout << ' ' << b;\n    }\n  }\n}\n"}
{"label": "13", "index": "23352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i1 = 0; i1 < n; i1++)\n    cin >> a[i1];\n  int j = 0;\n  for (int i1 = 0; i1 < n; i1++) {\n    j = i1 + 1;\n    for (int i2 = i1 + 1; i2 < n; i2++) {\n      if (a[i2] != a[i1]) {\n        a[j] = a[i2];\n        j++;\n      }\n    }\n    n = j;\n  }\n  for (int i1 = 0; i1 < n; i1++) {\n    cout << a[i1];\n    if (i1 != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int t;\n  int l = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n    return 0;\n  }\n  printf(\"%d\", a[0]);\n  t = n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t = t - 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else if (j == i - 1 && l < t) {\n\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23354", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[101] = {0};\n  int n, a;\n  scanf(\"%d \", &n);\n  int f = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    if (flag[a] == 0) {\n      flag[a] = 1;\n      if (f == 0) {\n        cout << a;\n        f = 1;\n      } else {\n        cout << \" \" << a;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, k = 0, t, a[20001];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n - k; i++) {\n    for (m = 1; m <= i; m++) {\n      if (a[i] == a[i - m]) {\n        t = i;\n        for (i = t; i < n - k; i++)\n          a[i] = a[i + 1];\n        i = t - 1;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, s = 1, j, i;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < s; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n    }\n    if (j == s) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (int i = 0; i < s - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[s - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23357", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int num = 0;\n  int c = 1;\n  int j, i;\n  int b[100];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        c = 0;\n      }\n    }\n\n    if (c != 0) {\n      num = num + 1;\n      b[num] = a[i];\n    }\n    c = 1;\n  }\n\n  for (i = 1; i < num; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[num]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23358", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l = 1;\n  scanf(\"%d \", &n);\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      cout << a[i];\n      break;\n    }\n  }\n  i++;\n  for (; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int b, d, e, f, g, i, j, k, l, m, n, p;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &p);\n  cout << p;\n  a[p]++;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &p);\n    if (a[p] == 0) {\n      cout << \" \" << p;\n      a[p]++;\n    }\n  }\n  return 7;\n}\n"}
{"label": "13", "index": "23360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, a[20000], n, i, l = 0, k = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    l = 0;\n    scanf(\"%d\", &c);\n    for (j = 0; j < k; j++) {\n      if (c == a[j])\n        l = l + 1;\n    }\n    if (l == 0) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      cout << \" \" << a[i];\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, i, j;\n  while (cin >> n) {\n    char b[20000];\n    int a[20000]; \n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cin.getline(b, 20000); \n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < i; j++) \n        if (a[i] == a[j])\n          break; \n      if (j == i)\n        cout << \" \" << a[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x, a[20000] = {0}, b[20000] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (j = 1; j <= n; j++) {\n    x = 0;\n    for (i = 0; i < j; i++) {\n      if (a[j] == a[i])\n        x++;\n    }\n    if (x == 0)\n      b[j] = a[j];\n    else\n      b[j] = 0;\n  }\n  cout << b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num;\n  cin >> n;\n  int a[n];\n  for (num = 0; num <= (n - 1); num++) {\n    cin >> a[num];\n  }\n  int i, k, q;\n  printf(\"%d\", a[0]);\n  for (k = 1; k <= n - 1; k++) {\n    q = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i]) {\n        q++;\n      }\n    }\n    if (q == 0) {\n      cout << \" \" << a[k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c[100000], d, e;\n  e = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++)\n    scanf(\"%d\", &c[b]);\n  printf(\"%d\", c[1]);\n  b = 2;\n  while (b <= a) {\n    e = 0;\n    for (d = 1; d < b; d++) {\n      if (c[b] == c[d])\n        e = 1;\n      else\n        e = e;\n    }\n    if (e == 0)\n      cout << \" \" << c[b];\n    b = b + 1;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23365", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int input[20000], output[20000], n, i, j, outLen = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n    output[outLen] = input[i];\n    for (j = 1; j < outLen; j++) {\n      if (input[i] == output[j])\n        outLen = outLen - 1;\n    }\n    outLen = outLen + 1;\n  }\n\n  for (i = 1; i < outLen; i++) {\n    printf(\"%d\", output[i]);\n    if (i != outLen - 1) {\n      printf(\" \");\n    }\n  }\n}\n"}
{"label": "13", "index": "23366", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101] = {0};\n  int i = 0;\n  int n = 0;\n  int t = 0;\n  int f = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> t;\n    if ((f != 0) && (!a[t]))\n      cout << \" \";\n    else\n      f = 1;\n    if (!a[t])\n      printf(\"%d\", t);\n    a[t] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j, b[20000] = {0}, p = 1, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n; i >= 2; i--) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        m += 1;\n    }\n    if (m == 0) {\n      b[p] = a[i];\n      p++;\n    }\n    m = 0;\n  }\n  p = p - 1;\n  b[p + 1] = a[1];\n  for (i = p + 1; i >= 2; i--) {\n    cout << b[i] << \" \";\n  }\n  cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20000];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int j;\n  int k;\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    while (j < n)\n      if (a[i] == a[j]) {\n        n--;\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n      } else\n        j++;\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23369", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, n;               \n  cin >> n;               \n  int a[n];               \n  for (i = 0; i < n; i++) \n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) \n  {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (int k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        } \n        n = n - 1;\n        j = j - 1;\n      } else\n        continue; \n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1] << endl; \n  return 0;\n}\n"}
{"label": "13", "index": "23370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, n, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1, b = 1; i <= n; i++, b++) {\n    if (b == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (c = 1; c <= i; c++) {\n        if (a[c] == a[i])\n          break;\n      }\n      if (c == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, n, j, flag;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      } else {\n        flag = 0;\n        continue;\n      }\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20000] = {0}, b[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  printf(\"%d\", b[0]);\n  if (k > 1) {\n    for (i = 1; i < k; i++) {\n      printf(\" %d\", b[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23373", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], b[20001], i, m;\n  cin >> n;\n  m = n;\n  for (i = 1; i <= n; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  i = 2;\n  cout << a[1];\n  b[a[1]] = 0;\n  do {\n    if (b[a[i]] == 1) {\n      printf(\" %d\", a[i]);\n      b[a[i]] = 0;\n    }\n    m = m - 1;\n    i = i + 1;\n  } while (m >= 0);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100001], b[100001], temp = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[0] = a[0];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[temp] = a[i];\n        temp++;\n      }\n    }\n  }\n  for (i = 0; i < temp - 1; i++)\n    cout << b[i] << \" \";\n\n  cout << b[temp - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s[20000], y[20000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  k = 0;\n  for (i = n - 1; i > 0; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (s[i] == s[j])\n        break;\n    }\n    if (j == -1) {\n      y[k] = s[i];\n      k++;\n    }\n  }\n  printf(\"%d\", s[0]);\n  for (i = k - 1; i >= 0; i--)\n    cout << \" \" << y[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  if (n >= 2) {\n    if (a[1] != a[0])\n      printf(\" %d\", a[1]);\n    for (i = 2; i < n; i++) {\n      if (a[i] != a[0]) {\n        for (j = 0; j < i - 1; j++) {\n          if (a[j] != a[i])\n            continue;\n          else\n            break;\n        }\n        if (a[j] != a[i])\n          printf(\" %d\", a[i]);\n      } else\n        continue;\n    }\n  }\n}\n"}
{"label": "13", "index": "23377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    t = 0;\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t = t + 1;\n      }\n      if (t == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p + i);\n  }\n  cout << *p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (*(p + i) == *(p + j))\n        break;\n      else\n        j++;\n    }\n    if (j == i)\n      printf(\" %d\", *(p + i));\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23379", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[90] = {0}, a[20001] = {0}, i;\n  cin >> n;\n  cin >> a[1];\n  num[a[1] - 10]++;\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    num[a[i] - 10]++;\n    if (num[a[i] - 10] == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "23381", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n}\n"}
{"label": "13", "index": "23382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[20000], B[20000], n, i, j, k;\n  int flag;\n  int number = 0;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < i; k++) {\n      if (A[k] == A[i]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      B[j] = A[i];\n      number = number + 1;\n      j = j + 1;\n    }\n  }\n  for (j = 0; j < number; j++) {\n    if (j == 0) {\n      printf(\"%d\", B[j]);\n    } else {\n      cout << \" \" << B[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x = 0, n, a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      x++;\n      if (x == 1) {\n        printf(\"%d\", a[i]);\n      } else {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int a[20000];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    int k;\n    k = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] != a[j])\n        k = k + 0;\n      else\n        k = k + 1;\n    }\n    if (k == 0 && a[i] != a[0])\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100000];\nint n;\nvoid del_a(int x) {\n  for (int i = x; i < n - 1; i++) {\n    a[i] = a[i + 1];\n  }\n  a[n - 1] = 0;\n  n = n - 1;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        del_a(i);\n        i = i - 1;\n        break;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n\n    if (t == 0) {\n      if (m > 0)\n        printf(\" \");\n      cout << a[i];\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "23388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int all, name[20000], input[20000], i, p, count, judge;\n  scanf(\"%d\", &all);\n  count = 0;\n  for (i = 0; i < all; i++)\n    name[i] = 0;\n\n  for (i = 0; i < all; i++) {\n    scanf(\"%d\", &input[i]);\n  }\n  for (i = 0; i < all; i++) {\n    judge = 0;\n    for (p = 0; p < count; p++) {\n      if (name[p] == input[i]) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 1) {\n      continue;\n    }\n    name[count] = input[i];\n    count++;\n  }\n  cout << name[0];\n  for (i = 1; i < count; i++) {\n    cout << \" \" << name[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  cin >> n;\n  if (n == 0)\n    return (0);\n  else {\n    scanf(\"%d\", &x);\n    printf(\"%d\", x);\n    a[0] = x;\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &x);\n      k = 0;\n      while ((k < m) && (a[k] != x))\n        k++;\n      if (k == m) {\n        a[m++] = x;\n        printf(\" %d\", x);\n      }\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "13", "index": "23390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[20000] = {0}, a[20000], i, n, j, flag = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] == 0) {\n      if (flag == 0) {\n        printf(\"%d\", a[i]);\n        flag = 1;\n        continue;\n      }\n      printf(\" %d\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int array[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> array[i];\n  cout << array[0];\n  for (int i = 1; i <= n - 1; i++) {\n    int g = 0;\n    for (int j = 0; j <= i - 1; j++)\n      if (array[i] == array[j])\n        g = g + 1;\n    if (g == 0)\n      printf(\" %d\", array[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23392", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, count[91] = {0};\n  cin >> n;\n  cin >> x;\n  cout << x;\n  count[x - 10]++;\n  for (int i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &x);\n    if (count[x - 10] == 0)\n      cout << \" \" << x;\n    count[x - 10]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], j, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i >= 0; i--)\n    for (k = i - 1; k >= 0; k--)\n      if (a[i] == a[k]) {\n        m++;\n        for (j = i; j <= n - m; j++)\n          a[j] = a[j + 1];\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n - m; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "13", "index": "23394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b[91] = {0}, i, k, counter = 0, temp;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> temp;\n    for (k = 0; k < 91; k++) {\n      if (b[k] == temp)\n        break;\n    }\n    if (k >= 91) {\n      b[counter] = temp;\n      counter++;\n    }\n  }\n  for (k = 0; k < counter - 1; k++)\n\n    cout << b[k] << \" \";\n\n  printf(\"%d\\n\", b[counter - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001], flag[20001] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        flag[j] = 1;\n    }\n    if (flag[i] == 0 && k == 0) {\n      printf(\"%d\", a[i]);\n      k++;\n    } else if (flag[i] == 0)\n      cout << \" \" << a[i];\n  }\n}\n"}
{"label": "13", "index": "23396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int t = 1; t < n; t++) {\n    int k = 0;\n    for (; k < t; k++)\n      if (a[t] == a[k])\n        break;\n    if (k == t)\n      cout << setw(3) << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23397", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main()                                        \n{                                                 \n  int n = 0, j = 0, i = 0, k = 0, a[20000] = {0}; \n  cin >> n;                                       \n  for (i = 0; i < n; i++) {\n    cin >> a[i];                   \n    if (a[i] <= 100 && a[i] >= 10) \n    {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          i = i - 1;\n          n = n - 1;\n        } \n      }\n    } else {\n      i = i - 1;\n      n = n - 1;\n    } \n  }\n  for (k = 0; k < n - 1; k++) {\n    cout << a[k] << \" \";\n  }\n  cout << a[n - 1] << endl; \n  return 0;\n} \n"}
{"label": "13", "index": "23398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a, i, j, l, k = 1;\n  cin >> a;\n  int s[20000] = {a};\n  for (i = 1; i < n; i++) {\n    cin >> a;\n    j = 0;\n    while (s[j] != a) {\n      j++;\n      if (j == k) {\n        s[k] = a;\n        k++;\n      }\n    }\n  }\n  for (l = 0; l < k - 1; l++)\n    cout << s[l] << ' ';\n  cout << s[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20000] = {0}, b[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  printf(\"%d\", b[0]);\n  if (k > 1) {\n    for (i = 1; i < k; i++)\n      printf(\" %d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  cin >> a[0];\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 1;\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] == a[j]) {\n        for (m = j; m < n; m++)\n          a[m] = a[m + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23402", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, k, n, count = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 1, k = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      a[k] = a[i];\n      k++;\n      count++;\n    }\n  }\n  cout << a[0];\n  for (k = 1; k <= count; k++)\n    printf(\" %d\", a[k]);\n  return 0;\n}\n"}
{"label": "13", "index": "23403", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  \n  int n, a[20000], i, num, count[20000] = {0};\n\n  cin >> n; \n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];  \n    num = a[i];   \n    count[num]++; \n\n    if (i == 0) \n      cout << a[i];\n    else \n    {\n      if (count[num] == 1) \n        cout << \" \" << num;\n    }\n  }\n\n  cout << endl; \n  return 0;\n}\n"}
{"label": "13", "index": "23404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c, a[20000], n, i, l = 0, p, k = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    l = 0; \n    scanf(\"%d\", &c);\n    for (j = 0; j < k; j++) \n    {\n      if (c == a[j]) \n        l = l + 1;\n    }\n    if (l == 0) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23405", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint src[20000];\nint dst[100];\nint main() {\n  int n, i, j, flag;\n  int current_pos = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> src[i];\n  for (i = 0; i < n; i++) {\n    if (current_pos) {\n      flag = 1;\n      for (j = 0; j < current_pos; j++) {\n        if (dst[j] == src[i])\n          flag = 0;\n      }\n      if (flag == 1) {\n        dst[current_pos] = src[i];\n        current_pos++;\n      }\n    } else {\n      dst[0] = src[0];\n      current_pos++;\n    }\n  }\n  for (i = 0; i < current_pos; i++) {\n    printf(\"%d\", dst[i]);\n    if (i < current_pos - 1)\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  while (n < 1 || n > 20000) {\n    cin >> n;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    while (a[i] < 10 || a[i] > 100) {\n      scanf(\"%d\", &a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[10000], i, j, x[10000], z = 0, h = 1;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &x[i - 1]);\n  m[0] = x[0];\n  for (i = 2; i <= n; i++) {\n    z = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (x[j - 1] == x[i - 1])\n        z = 1;\n    if (z == 0) {\n      m[h] = x[i - 1];\n      h = h + 1;\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    cout << m[i];\n    if (i != h - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23408", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int count[100] = {0}, num[90] = {0};\n  int i = 1, a, j = 0;\n  for (i; i <= n; i++) {\n    cin >> a;\n    if (count[a] == 0) {\n      num[j] = a;\n      j += 1;\n    }\n    count[a] = count[a] + 1;\n  }\n  i = 0;\n  for (i; i < j - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  printf(\"%d\\n\", num[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23409", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 1, r = 1, number[20001], number1[20001] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i != n + 1; i++) {\n    cin >> number[i];\n    for (j = 1, k = 1; j <= i; j++) {\n      if (number[i] == number1[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1) {\n      if (i == 1) {\n        cout << number[1];\n        number1[1] = number[1];\n        r++;\n      } else {\n        cout << \" \" << number[i];\n        number1[r] = number[i];\n        r++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 2, i;\n  scanf(\"%d\", &n);\n  int a[n + 1];\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  while (k <= n) {\n    scanf(\"%d\", &a[k]);\n    i = 1;\n    while (i <= k - 1) {\n      if (a[i] == a[k])\n        break;\n      else if (i == k - 1)\n        cout << \" \" << a[k];\n      i = i + 1;\n    }\n    k = k + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, q, x = 1;\n  int shuzu[1000], panduan[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(shuzu[i]));\n  }\n  panduan[0] = 0;\n  for (i = 1; i < n; i++) {\n    for (q = 0, j = 0; j < i; j++) {\n      if (shuzu[j] == shuzu[i]) {\n        q = 1;\n        break;\n      }\n    }\n\n    panduan[i] = q;\n  }\n  for (i = 0, x = 0; i < n; i++) {\n    if (panduan[i] == 0) {\n      x = x + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (panduan[i] == 0 && (x != 1)) {\n      printf(\"%d \", shuzu[i]);\n      x--;\n    } else if (panduan[i] == 0 && (x == 1)) {\n      cout << shuzu[i];\n      x--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        i = i - 1;\n        n--;\n        break;\n      }\n    }\n  }\n  if ((n - 2) >= 0) {\n    for (i = 0; i <= n - 2; i++) {\n      cout << a[i] << \" \";\n    }\n    cout << a[n - 1];\n  } else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (i == j) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20001] = {0}, j, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (l = (i + 1); l < n; l++) {\n      if (a[l] == a[i]) {\n        for (j = (l + 1); j < n; j++) {\n          a[j - 1] = a[j];\n        }\n        l -= 1;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23415", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100001], b[100001];\n  int i, j, step = 1;\n  int n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  b[step] = a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= step; j++) {\n      if (a[i] == b[j])\n        break;\n    }\n    if (j == step + 1) {\n      step++;\n      printf(\" %d\", a[i]);\n      b[step] = a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz1[20000], sz2[20000], i, j, n, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz1[i]);\n  }\n  sz2[0] = sz1[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (k = i - 1; k >= 0; k--) {\n      if (sz1[i] == sz2[k]) {\n        break;\n      }\n      if (k == 0) {\n        sz2[j] = sz1[i];\n        j = j + 1;\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++) {\n    if (i == j - 1) {\n      printf(\"%d\", sz2[i]);\n    } else {\n      printf(\"%d \", sz2[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a, time;\n  k = 1;\n  time = 0;\n  cin >> n;\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (sz[i] == sz[k]) {\n        for (a = k; a < n - 1; a++) {\n          sz[a] = sz[a + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", sz[i]);\n    else if (i != 0) {\n      cout << \" \" << sz[i];\n    }\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "13", "index": "23418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int jud[200], num[30000], n, i, sum, res[200];\n  scanf(\"%d\", &n);\n  sum = 0;\n  for (i = 1; i <= 100; i++)\n    jud[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> num[i];\n    if (jud[num[i]] == 0) {\n      sum++;\n      res[sum] = num[i];\n      jud[num[i]] = 1;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    printf(\"%d \", res[i]);\n  cout << res[sum];\n  return 0;\n}\n"}
{"label": "13", "index": "23419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], b[101], c, i, j, n;\n  for (i = 10; i <= 100; i++)\n    b[i] = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    c = a[i];\n    if (b[c] == 0)\n      b[c]++;\n    else\n      a[i] = 0;\n  }\n  cout << a[0];\n  for (j = 1; j < n; j++) {\n    if (a[j] != 0)\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23420", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int zz[20000];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> zz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (zz[i] == zz[j]) {\n        zz[j] -= zz[i];\n      }\n    }\n  }\n  printf(\"%d\", zz[0]);\n  for (i = 1; i < n; i++) {\n    if (zz[i] != 0)\n      cout << \" \" << zz[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, i, j, n, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n      }\n    }\n  }\n  for (j = n - 1; a[j] == 0; j--)\n    k = 0;\n  for (i = 0; i < j; i++)\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  cout << a[j];\n  return 0;\n}\n"}
{"label": "13", "index": "23422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100];\n  int i, n, number, count, countl;\n  count = 0;\n  countl = 0;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number);\n    if (a[number] == 0) {\n      a[number] = 1;\n\n      b[count] = number;\n      count = count + 1;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    countl = countl + 1;\n    cout << b[i];\n    if (countl < count) {\n      cout << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23423", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, i, j, a[20002];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n\n    if (j == i) {\n      cout << \" \" << a[i];\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d\", &n);\n  int *N = (int *)malloc(sizeof(int) * n);\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d\", &(N[k]));\n  }\n  for (i = 1; i < n; i++) {\n    for (int r = 0; r < i; r++) {\n      if (N[i] == N[r]) {\n        for (int j = i; j < n; j++) {\n          N[j] = N[j + 1];\n        }\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      cout << N[i];\n    else {\n      printf(\"%d \", N[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23425", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[20000], m = 0, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1, j = 1; i < n; i++) {\n    for (k = 0; k < j; k++)\n      if (a[i] == b[k])\n        m = 1;\n    if (m != 1) {\n      b[j] = a[i];\n      j++;\n    }\n    m = 0;\n  }\n  for (i = 0; i < j - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[j - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int k = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    for (j = 0; j <= i - 1; j++) {\n      if (i - 1 == 0) {\n        k = k + 1;\n        a[0] = a[0];\n      } else {\n        if (a[j] == a[i - 1] && j != i - 1)\n          break;\n        else if (a[j] == a[i - 1]) {\n          a[k - 1] = a[i - 1];\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= k - 3; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[k - 2]);\n  return 0;\n}\n"}
{"label": "13", "index": "23427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  scanf(\"%d \", &n);\n  int a[n];\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (a[i] != a[j] && j == (i - 1))\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num[100000], n, i, j, k, m, l;\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (num[j] == num[k]) {\n        num[k] = 0;\n      }\n    }\n  for (m = 0, l = 0; m < n; m++) {\n    if (num[m] >= 10) {\n      l++;\n      if (l == 1) {\n        cout << num[m];\n      } else {\n        cout << \" \" << num[m];\n      }\n    }\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "13", "index": "23429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, flag;\n  scanf(\"%d\", &n);\n  int a[200000];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1)\n    printf(\"%d\", a[1]);\n  else {\n    printf(\"%d\", a[1]);\n    for (i = 2; i <= n; i++) {\n      for (m = 1; m < i; m++) {\n        if (a[i] == a[m]) {\n          flag = 1;\n          break;\n        } else {\n          flag = -1;\n        }\n      }\n      if (flag == -1)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, e;\n  e = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (e == 0 && a[i] != 0) {\n      cout << a[i];\n      e = 1;\n    } else if (e == 1 && a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n  }\n\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "13", "index": "23431", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, k, l;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i <= n - 1; i = i + 1) {\n    cin >> b[i];\n    a[i] = 0;\n  }\n  for (i = n - 1, k = 0; i >= 1; i = i - 1) {\n    for (s = i - 1; s >= 0; s = s - 1) {\n      if (b[i] - b[s] == 0) {\n        a[i] = 1;\n        k = k + 1;\n        break;\n      }\n    }\n  }\n  if (n - k == 1)\n    cout << b[0];\n  else {\n    for (i = 0, l = 0; i <= n - 1; i = i + 1) {\n      if (a[i] == 0) {\n        l = l + 1;\n        if (l - n + k < 0)\n          cout << b[i] << \" \";\n        else\n          printf(\"%d\", b[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, k;\n  scanf(\"%d \", &n);\n  int a[20001];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  }\n  for (l = 0; l < n; l++)\n    cout << a[l] << setw(3);\n  return 0;\n}\n"}
{"label": "13", "index": "23433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100];\n  int i, n, number, count, countl;\n  count = 0;\n  countl = 0;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d\", &n);\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number);\n    if (a[number] == 0) {\n      a[number] = 1;\n\n      b[count] = number;\n      count = count + 1;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    countl = countl + 1;\n    printf(\"%d\", b[i]);\n    if (countl < count) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k = 0, b[20000];\n  scanf(\"%d\", &n);\n  i = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", b[i]);\n    if (i - k + 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "13", "index": "23435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, I, n, j;\n  int k = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (I = 1; I < n; I++) {\n    for (i = 0; i < I; i++) {\n      if (a[I] == a[i]) {\n        a[I] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] != 0) {\n          a[i] = a[j];\n          a[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - k - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23436", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000], k, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else if (j == i - 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23437", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, l;\n  cin >> n;\n  int m[n];\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  int cishu[101] = {0};\n  for (int i = 0; i < n; i++) {\n    cishu[m[i]]++;\n    if (cishu[m[i]] >= 2)\n      m[i] = 0;\n  }\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      cout << m[i];\n    else if (m[i] != 0)\n      printf(\" %d\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23438", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, x, m = 0, k = 0, t = 0;\n  cin >> n;\n  int shuzu[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    shuzu[i] = x;\n  }\n  for (m = 0; m < n; m++) {\n    if (m == 0) {\n      cout << shuzu[m];\n    } else {\n      for (k = 0; k < m; k++) {\n        if (shuzu[m] != shuzu[k])\n          t = 1;\n        else {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        cout << \" \" << shuzu[m];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[100000];\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  i = 1;\n  while (i < n) {\n    int j = 0, x = 0;\n    while (j < i) {\n      if (a[i] == a[j]) {\n        x = 1;\n        break;\n      }\n      j++;\n    }\n    if (x == 0)\n      printf(\" %d\", a[i]);\n    i++;\n  }\n}\n"}
{"label": "13", "index": "23440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int a[N], b[N];\n  int i, j, k, n, m = 0, flag;\n  for (i = 0; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++) {\n    flag = 1;\n    for (j = 1; j <= m; j++)\n      if (a[i] == b[j]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[j] = a[i];\n      m++;\n    }\n  }\n  printf(\"%d\", b[1]);\n  for (i = 2; i <= m; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "23441", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20002] = {1}, n, i, j, k;\n  scanf(\"%d\", &n);\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = i - 1; j > 0; j--) {\n      if (a[i] == a[j])\n        break;\n      else\n        k = k + 1;\n    }\n    if (k == i - 1)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, m, j, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        m += 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (i != 0)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0, excit = 0;\n  scanf(\"%d\", &k);\n  int num[k], shulie[k];\n\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 0; j <= i - 2; j++)\n      if (num[j] == num[i - 1]) {\n        excit = 1;\n        break;\n      }\n    if (excit == 0) {\n      shulie[l] = num[i - 1];\n      l = l + 1;\n    } else\n      excit = 0;\n  }\n  printf(\"%d\", shulie[0]);\n  for (i = 2; i <= l; i++)\n    printf(\" %d\", shulie[i - 1]);\n}\n"}
{"label": "13", "index": "23444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, i, j, n, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) \n  {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) \n        a[j] = 0;\n    }\n  }\n  for (j = n - 1; a[j] == 0; j--)\n    k = 0; \n  for (i = 0; i < j; i++)\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "13", "index": "23445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0, excit = 0;\n  cin >> k;\n  int num[k], shulie[k];\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 0; j <= i - 2; j++)\n      if (num[j] == num[i - 1]) {\n        excit = 1;\n        break;\n      }\n    if (excit == 0) {\n      shulie[l] = num[i - 1];\n      l = l + 1;\n    } else\n      excit = 0;\n  }\n  printf(\"%d\", shulie[0]);\n  for (i = 2; i <= l; i++)\n    printf(\" %d\", shulie[i - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23446", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int n, i, j, l, k;\n  scanf(\"%d \", &n);\n  l = n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < l - 1; i++) {\n    for (j = i + 1; j < l; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < l - 1; k++)\n          a[k] = a[k + 1];\n        j--;\n        l--;\n      }\n    }\n  }\n  cout << a[0];\n\n  for (i = 1; i < l; i++)\n    cout << ' ' << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int sum;\n\n  scanf(\"%d \", &n);\n  sum = n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n        sum--;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    cout << a[i];\n    j++;\n    if (j != sum)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23448", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int timer = 0;\n  int a[20001], b[20001];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] != a[i]) {\n        timer++;\n      }\n    }\n    if (timer != i - 1) {\n      a[i] = 1;\n    }\n    timer = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] == 1) {\n      timer++;\n    } else {\n      a[i - timer] = a[i];\n    }\n  }\n  for (i = 1; i < n - timer; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - timer]);\n  return 0;\n}\n"}
{"label": "13", "index": "23449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  int a[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < k; m++) {\n      if (a[k] != a[m])\n        continue;\n      else\n        break;\n    }\n    if (m == k && a[k] != a[k - 1])\n      cout << \" \" << a[k];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23450", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t = 0;\n  scanf(\"%d \", &n);\n\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, j = 0, k = 0, step = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1 - step; i++) {\n    for (j = i + 1; j < n - step; j++) {\n      if (a[i] == a[j]) {\n        if (j == n - 1 - step) {\n          step++;\n          continue;\n        }\n        for (k = j; k < n - 1 - step; k++)\n          a[k] = a[k + 1];\n        step++;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - step - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\\n\", a[n - 1 - step]);\n  return 0;\n}\n"}
{"label": "13", "index": "23452", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct arr {\n  long int num;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  cin >> p1->num;\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    scanf(\"%ld\", &p1->num);\n  }\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%ld\", p->num);\n    else\n      printf(\" %ld\", p->num);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  while (p != NULL) {\n    head = head->next;\n    free(p);\n    p = head;\n  }\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->num == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->num == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  int m;\n  struct arr *head, *p;\n  scanf(\"%d\", &m);\n  head = create(m);\n  p = head;\n  while (p != NULL) {\n    p->next = del(p->next, p->num);\n    p = p->next;\n  }\n  print(head);\n  freelist(head);\n  return 0;\n}\n"}
{"label": "13", "index": "23453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], m;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n\n    for (i = 0; i < n; i++) {\n      m = 0;\n      if (i == 0) {\n        scanf(\"%d\", &a[0]);\n        printf(\"%d\", a[0]);\n      } else {\n        scanf(\" %d\", &a[i]);\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j]) {\n            m++;\n          }\n        }\n        if (m == 0) {\n          printf(\" %d\", a[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {                  \n  int n, p = 1, i = 0, j = 0; \n  cin >> n;                   \n  int a[n];                   \n  for (i = 0; i < n; i++) {   \n    cin >> a[i];\n  }\n  int b[n];                   \n  b[0] = a[0];                \n  for (i = 1; i < n; i++) {   \n    for (j = 0; j < i; j++) { \n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == i) { \n      b[p] = a[i];\n      p++;\n    }\n  }\n\n  cout << b[0]; \n\n  for (i = 1; i < p; i++) { \n    cout << \" \" << b[i];\n  }\n  return 0;\n} \n"}
{"label": "13", "index": "23455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n, i, j, x, y, ans, b[200];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 100; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (b[x] == 0)\n      if (i == 1)\n        printf(\"%d\", x);\n      else\n        printf(\" %d\", x);\n    b[x] = 1;\n  }\n}\n"}
{"label": "13", "index": "23456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int number[1000];\n  int i;\n  i = 0;\n  while (i < n) {\n    cin >> number[i];\n    i++;\n  }\n  i = 1;\n  int j = 0;\n  cout << number[0];\n  while (i < n) {\n    while (j < i) {\n      if (number[i] == number[j]) {\n        break;\n      } else {\n        j++;\n      }\n      if (j == i) {\n        printf(\" %d\", number[i]);\n      }\n    }\n    j = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, n, j, flag;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      } else {\n        flag = 0;\n        continue;\n      }\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, flag, g;\n  cin >> n;\n  g = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    flag = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        flag = 0;\n        break;\n      } \n    if (flag == 1)\n      if (g) {\n        cout << \" \" << a[i]; \n      } else {\n        cout << a[i];\n        g = 1;\n      }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, n, k;\n  k = 0;\n  scanf(\"%d\", &n);\n\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[j] == a[i])\n        a[j] = 0;\n  }\n\n  cout << a[0];\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23461", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, flag[91] = {0}, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  flag[a[0] - 10] = 1;\n  for (i = 0; i < n; i++) {\n    if (flag[a[i] - 10] == 0) {\n      printf(\" %d\", a[i]);\n      flag[a[i] - 10] = 1;\n\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, I, n, j;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (I = 1; I < n; I++) {\n    for (i = 0; i < I; i++) {\n      if (a[I] == a[i]) {\n        a[I] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] != 0) {\n          a[i] = a[j];\n          a[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - k - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  i = 0;\n  while (i < n) {\n    for (j = i + 1; j < n; j++)\n      if (a[i] == a[j])\n        a[j] = 0;\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  i = 1;\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23465", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100000], a[100], n, i, d;\n  cin >> n;\n  for (i = 0; i < 100; i++) {\n    a[i] = 1;\n  }\n  scanf(\"%d\", &sz[0]);\n  printf(\"%d\", sz[0]);\n  a[sz[0]] = 0;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    d = sz[i];\n    if (a[d] != 0) {\n      printf(\" %d\", sz[i]);\n    }\n\n    a[d] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        a[i] = 0;\n        break;\n      }\n  }\n  for (k = 0; k < n; k++) {\n    if (a[k]) {\n      if (!k)\n        printf(\"%d\", a[k]);\n      else\n        printf(\" %d\", a[k]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, i, j, n;\n  int a[20000], b[20000];\n  a[20000] = '\\0';\n  b[20000] = '\\0';\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i = i + 1)\n    scanf(\"%d\", &b[i]);\n  a[0] = b[0];\n  m = 1;\n  t = 1;\n  for (i = 1; i < n; i = i + 1) {\n    for (j = 0; j < m; j = j + 1) {\n      if (a[j] == b[i])\n        t = 0;\n    }\n    if (t == 1) {\n      a[m] = b[i];\n      m = m + 1;\n    }\n    t = 1;\n  }\n  for (i = 0; i < m - 1; i = i + 1)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[m - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23468", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[91];\n  int i;\n  for (i = 0; i < 91; i++) {\n    a[i] = 0;\n  }\n  cin >> n;\n  cin >> i;\n  cout << i;\n  a[i - 10] = 1;\n  while (n > 0) {\n    n--;\n    int b;\n    cin >> b;\n    if (a[b - 10] == 0) {\n      cout << ' ' << b;\n      a[b - 10] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n; \n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];            \n  for (i = 0; i < n; i++) { \n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) { \n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        j--;\n        n--; \n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' '; \n  cout << a[i];          \n  return 0;\n}\n"}
{"label": "13", "index": "23470", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23471", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int check[100] = {0};\n  int n, i;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (check[a[i]] == 0) {\n      if (i == 0) {\n        printf(\"%d\", a[i]);\n      } else {\n        printf(\" %d\", a[i]);\n      }\n      check[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int c[n];\n  scanf(\"%d\", &c[1]);\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n    for (j = 1; j <= i - 1; j++) {\n      if (c[j] == c[i])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n, i, x, b[200];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 100; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (b[x] == 0)\n      if (i == 1)\n        printf(\"%d\", x);\n      else\n        printf(\" %d\", x);\n    b[x] = 1;\n  }\n}\n"}
{"label": "13", "index": "23474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, j, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (k = 0; k < n; k++)\n    cin >> a[k];\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        m += 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (i != 0)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[20000] = {0}, a[20000], i, n, j, flag = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 1; i++)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n        continue;\n      }\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23476", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k = 0, num;\n  int a[100] = {0}, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    if (a[num] == 0) {\n      a[num]++;\n      b[k] = num;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], i, j, n, t, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = 0;\n    count = 0;\n    for (j = i; j >= 0; j--) {\n      count++;\n      if (a[i] == a[j] && (i != j)) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0 && count == 1) {\n      cout << a[i];\n    } else if ((t == 0) && (count != 1)) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i <= n - m; i++) {\n    for (j = i + 1; j <= n - m; j++) {\n      if (a[j] == a[i]) {\n        m = m + 1;                   \n        for (k = j; k <= n - m; k++) \n          a[k] = a[k + 1];\n        j = j - 1;\n      }\n    }\n  }\n  for (i = 0; i < n - m - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - m - 1] << endl; \n  return 0;\n}\n"}
{"label": "13", "index": "23479", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int n, a[20001] = {0}, i, j, count = 0; \n  cin >> n;                               \n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n - 1; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == a[j])\n        a[j] = a[20000]; \n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && count == 0) {\n      cout << a[i];\n      count++;\n    } else if (a[i] != 0)\n      cout << \" \" << a[i]; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, num[20001] = {0}, number, i, j; \n  cin >> n;\n  for (i = 1; i <= n; i++) { \n    cin >> number;\n    num[i] = number;\n  }\n  for (j = 1; j <= n; j++)\n    for (i = j + 1; i <= n; i++)\n      if (num[j] == num[i])\n        num[i] =\n            0; \n  for (i = 1; i <= n; i++)\n    if (num[i] != 0) {\n      cout << num[i];\n      break;\n    }\n  for (j = i + 1; j <= n; j++)\n    if (num[j] != 0)\n      cout << \" \"\n           << num[j]; \n                      \n  return 0;\n}\n"}
{"label": "13", "index": "23481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int a[20000];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    int k;\n    k = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] != a[j])\n        k = k + 0;\n      else\n        k = k + 1;\n    }\n    if (k == 0 && a[i] != a[0])\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  int a[20000];\n  int count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    int count = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (count == 0)\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], t, j, m, i, asd;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    t = 1;\n    cin >> a[i];\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else if (i != 0) {\n      for (j = 0; j < i; j++) {\n        asd = a[i] - a[j];\n        if (asd == 0) {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, y;\n  cin >> n;\n  int a[20000];\n  int b[20000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    y = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        y++;\n      }\n    }\n    if (y == 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int a[20000];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    int k;\n    k = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] != a[j])\n        k = k + 0;\n      else\n        k = k + 1;\n    }\n    if (k == 0 && a[i] != a[0])\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int m[n];\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  int cishu[101] = {0};\n  for (int i = 0; i < n; i++) {\n    cishu[m[i]]++;\n    if (cishu[m[i]] >= 2)\n      m[i] = 0;\n  }\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      cout << m[i];\n    else if (m[i] != 0)\n      cout << \" \" << m[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int shuru[100000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> shuru[i];\n    if (getchar() == '\\n')\n      break;\n    else\n      continue;\n  }\n  cout << shuru[0];\n\n  for (int i = 1; i < n; i++) {\n    int jishu = 0;\n    for (int j = 0; j < i; j++) {\n      if (shuru[i] == shuru[j])\n        break;\n      else {\n        jishu++;\n      }\n    }\n    if (jishu == i)\n      printf(\" %d\", shuru[i]);\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, flag, a[20000], b[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\\n\", b[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long n;\n  cin >> n;\n  bitset<101> b;\n  for (long i = 0; i < n; i++) {\n    long x;\n    cin >> x;\n    if (!b.test(x)) {\n      if (i)\n        cout << ' ';\n      printf(\"%ld\", x);\n      b.set(x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int all, name[20000], input[20000], i, p, count, judge;\n  scanf(\"%d\", &all);\n  count = 0;\n  for (i = 0; i < all; i++) {\n    name[i] = 0;\n  }\n  for (i = 0; i < all; i++) {\n    cin >> input[i];\n  }\n  for (i = 0; i < all; i++) {\n    judge = 0;\n    for (p = 0; p < count; p++) {\n      if (name[p] == input[i]) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 1) {\n      continue;\n    }\n    name[count] = input[i];\n    count++;\n  }\n  printf(\"%d\", name[0]);\n  for (i = 1; i < count; i++) {\n    printf(\" %d\", name[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23491", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  int b[20001] = {0};\n  int c[20001] = {0};\n  int l = 1;\n  for (int j = 1; j <= n; j++) {\n    for (int k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        b[j] = 1;\n      }\n    }\n  }\n  for (int p = 1; p <= n; p++) {\n    if (b[p] == 0) {\n      c[l] = a[p];\n      l = l + 1;\n    }\n  }\n  for (int m = 1; c[m] > 0; m++) {\n    if (c[m + 1] > 0)\n      cout << c[m] << \" \";\n    if (c[m + 1] == 0)\n      printf(\"%d\\n\", c[m]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int histgram[101];\n  int i;\n  int x;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    histgram[i] = 0;\n  }\n\n  scanf(\"%d\", &x);\n  histgram[x]++;\n  printf(\"%d\", x);\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &x);\n    if (!histgram[x]) {\n      printf(\" %d\", x);\n    }\n    histgram[x]++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i1 = 0; i1 < n; i1++)\n    cin >> a[i1];\n  int j = 0;\n  for (int i1 = 0; i1 < n; i1++) {\n    j = i1 + 1;\n    for (int i2 = i1 + 1; i2 < n; i2++) {\n      if (a[i2] != a[i1]) {\n        a[j] = a[i2];\n        j++;\n      }\n    }\n    n = j;\n  }\n  for (int i1 = 0; i1 < n; i1++) {\n    cout << a[i1];\n    if (i1 != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23494", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, num = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  \n  for (i = n - 1; i > 0; i--)\n    for (k = i - 1; k >= 0; k--) {\n      \n      if (a[i] == a[k]) {\n        if (i == n - 1) {\n          a[i] = 0;\n          num++;\n          break;\n          \n        } else {\n          for (j = i; j < n - 1; j++)\n            a[j] = a[j + 1];\n          a[j] = 0;\n          num++;\n          break;\n        }\n      }\n    }\n  \n  cout << a[0];\n  for (i = 1; i < n - num; i++)\n    cout << \" \" << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23495", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, n; \n  cin >> n;\n  int a[20000] = {0}; \n  for (i = 0; i < n; i++) {\n    cin >> a[i]; \n  }\n  cout << a[0]; \n\n  int k, m; \n  for (k = 1; k < n; k++) {\n    for (m = 0; m < k; m++) \n    {\n      if (a[k] != a[m])\n        continue;\n      else\n        break;\n    }\n    if (m == k && a[k] != a[k - 1]) \n      cout << \" \" << a[k];          \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (m = k + 1; m < n; m++)\n          a[m - 1] = a[m];\n        n -= 1;\n        k -= 1;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[100], t = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < t; j++)\n      if (a[i] == b[j])\n        break;\n    if (j >= t) {\n      b[t] = a[i];\n      t++;\n    }\n  }\n  for (j = 1; j < t - 1; j++)\n    printf(\"%d \", b[j]);\n  printf(\"%d\", b[t - 1]);\n}\n"}
{"label": "13", "index": "23498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[101];\n  int n, i, x;\n\n  for (i = 0; i <= 100; i++)\n    s[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    if (s[x] == 0) {\n      if (i > 0) {\n        cout << ' ';\n      }\n      cout << x;\n      s[x] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23499", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, p;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    p = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        p = 1;\n      }\n    }\n    if (p == 0 & i == 1) {\n      printf(\"%d\", a[i]);\n    }\n    if (p == 0 & i != 1) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        continue;\n    }\n    if (j == i) {\n      if (i == 0)\n        printf(\"%d\", a[i]);\n      else\n        cout << \" \" << a[i];\n    } else\n      continue;\n  }\n}\n"}
{"label": "13", "index": "23501", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[101] = {0};\n  int n, a;\n  scanf(\"%d \", &n);\n  int f = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a);\n    if (flag[a] == 0) {\n      flag[a] = 1;\n      if (f == 0) {\n        printf(\"%d\", a);\n        f = 1;\n      } else {\n        cout << \" \" << a;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23502", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, m, i, j, k; \n  cin >> n;          \n  int N[n];\n  for (i = 0, k = 0; i < n; i++, k++) { \n    cin >> N[k];\n    for (j = 0; j < k; j++) {\n      if (N[j] == N[k])\n        k--; \n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == (k - 1))\n      cout << N[i];\n    else\n      cout << N[i] << \" \"; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, n, a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"\\n\");\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n}\n"}
{"label": "13", "index": "23504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n + 1];\n  a[n] = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  if (a[i] != 0)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[20000], st[91], tot = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (num[j] == num[i])\n        break;\n\n    if (j == i)\n      st[++tot] = num[i];\n  }\n  for (i = 1; i < tot; i++)\n    printf(\"%d \", st[i]);\n  cout << st[tot];\n}\n"}
{"label": "13", "index": "23506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int j = 0, i = 0, n = 0, e = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[j] = a[i];\n    j = i + 1;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == b[j])\n        b[j] = 0;\n    }\n  }\n  cout << b[0];\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] != 0)\n      cout << \" \" << b[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100];\n  int i, n, number, count, countl;\n  count = 0;\n  countl = 0;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n  cin >> n;\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &number);\n    if (a[number] == 0) {\n      a[number] = 1;\n\n      b[count] = number;\n      count = count + 1;\n    }\n  }\n  for (i = 0; i < count; i++) {\n    countl = countl + 1;\n    printf(\"%d\", b[i]);\n    if (countl < count)\n      cout << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000] = {0};\n  int b[20000] = {0};\n  int n, i, j, t, m;\n  cin >> n;\n  for (m = 0; m <= n - 1; m++)\n    cin >> a[m];\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        b[i] = 1;\n    }\n  }\n  cout << a[0];\n  for (t = 1; t <= n - 1; t++) {\n    if (b[t] == 0)\n      cout << \" \" << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200000], n, m, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  i = 0;\n  while (i < n) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        m = m + 1;\n      }\n    }\n    if (m == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    if (m == 0 && i != 0)\n      cout << ' ' << a[i];\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, p;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    p = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        p = 1;\n      }\n    }\n    if (p == 0 & i == 1) {\n      printf(\"%d\", a[i]);\n    }\n    if (p == 0 & i != 1) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    cin >> a[0];\n    for (i = 1; i < n; i++)\n      scanf(\" %d\", &a[i]);\n    for (i = 0, m = 0; i < n - m - 1; i++) {\n      for (j = i + 1; j < n - m; j++) {\n        if (a[i] != a[j])\n          continue;\n        else {\n          for (k = j; k < n - m - 1; k++)\n            a[k] = a[k + 1];\n          m++;\n          j--;\n        }\n      }\n    }\n    printf(\"%d\", a[0]);\n    for (i = 1; i < n - m; i++)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23512", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint compare(int s, int a[20000], int n) {\n  int i, temp = 0;\n  for (i = 0; i < n; i++) {\n    if (s == a[i]) {\n      return 1;\n      temp = 1;\n      break;\n    } else\n      continue;\n  }\n  if (temp = 0)\n    return 0;\n}\n\nint main() {\n  int n, a[20000], i, j, w = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (compare(a[i], a, i) == 1)\n      a[i] = -1;\n    else\n      continue;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      if (w == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n      w++;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int i, k, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  k = 0;\n  a[n] = 101;\n  while (k < n) {\n\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    if (k == 0)\n      printf(\"%d\", a[k]), k++;\n\n    else if (k < n && k > 0)\n      printf(\" %d\", a[k]), k++, m++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23514", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k, m = 0;\n  cin >> N;\n  const int n = N;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - m; i++)\n    for (j = i; j <= n - m; j++) {\n      if (a[i] == a[j + 1]) {\n        for (k = j + 1; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n        j--;\n      }\n    }\n  cout << a[0];\n  for (i = 1; i < n - m; i++) {\n\n    printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  while (n < 1 || n > 20000) {\n    cin >> n;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    while (a[i] < 10 || a[i] > 100) {\n      scanf(\"%d\", &a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[k] != 0) {\n        if (a[j] == a[k])\n          a[k] = 0;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (p = 1; p < n; p++) {\n    if (a[p] != 0)\n      cout << \" \" << a[p];\n    continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag, a[20001];\n  cin >> n;\n  cin >> a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *SZ = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (j == 0) {\n      cout << SZ[j];\n    }\n    for (int k = 0; k < j; k++) {\n      if (SZ[j] == SZ[k]) {\n        break;\n      } else if (k == j - 1) {\n        printf(\" %d\", SZ[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, n, k, t;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    t = 0;\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k])\n        t = 1;\n    }\n    if (t == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, count = 0, p = 0, n;\n  int a[20002] = {0}, b[20002] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        b[i] = 1;\n    }\n    if (b[i] == 0)\n      count = count + 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] != 1) {\n      p = p + 1;\n      if (p != count)\n        cout << a[i] << \" \";\n      else\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23521", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, cal = 0, enter = 1, num = 0;\n  int a[100001] = {0}, b[100001] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= num; j++) {\n      if (a[i] == b[j]) {\n        goto next;\n        break;\n      }\n    }\n    if (enter == 1) {\n      printf(\"%d\", a[i]);\n      enter = 0;\n    } else\n      printf(\" %d\", a[i]);\n    num++;\n    b[num] = a[i];\n  next:\n    b[0] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int n = 0, i = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int j = 0, k = 0, l = 0;\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (l = k; l < n - 1; l++) {\n          a[l] = a[l + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[20000], sign;\n  int b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (i != s - 1)\n      (cout << b[i] << \" \");\n    else\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, a[20000], i, j;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  m = 1;\n  if (n > 1) {\n    do {\n\n      for (i = m - 1; i >= 0; i--) {\n        if (a[m] == a[i])\n          j = j + 1;\n      }\n      if (j == 0)\n        printf(\" %d\", a[m]);\n      j = 0;\n      m = m + 1;\n    } while (m < n);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], m;\n  cin >> n;\n  if (n >= 1 && n <= 20000) {\n\n    for (i = 0; i < n; i++) {\n      m = 0;\n      if (i == 0) {\n        cin >> a[0];\n        printf(\"%d\", a[0]);\n      } else {\n        scanf(\" %d\", &a[i]);\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j]) {\n            m++;\n          }\n        }\n        if (m == 0) {\n          cout << \" \" << a[i];\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, b[20001], i, j = 0, c[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 1; i <= n; i++) {\n    if (a[b[i]] == 0) {\n      j++;\n      c[j] = b[i];\n      a[b[i]] = 1;\n    }\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", c[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[20000], n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j])\n        j = i + 1;\n      else\n        j++;\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int k = 1;\n  int a[20000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    for (j = 0; j <= i - 1; j++) {\n      if (i - 1 == 0) {\n        k = k + 1;\n        a[0] = a[0];\n      } else {\n        if (a[j] == a[i - 1] && j != i - 1)\n          break;\n        else if (a[j] == a[i - 1]) {\n          a[k - 1] = a[i - 1];\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= k - 3; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[k - 2]);\n  return 0;\n}\n"}
{"label": "13", "index": "23529", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int N, n, i = 0, j = 0, a[20000];\n  cin >> N; \n  while (i <= N - 1) {\n    cin >> n;\n    a[i] = n;\n    i++;\n  }             \n  cout << a[0]; \n  for (i = 1; i <= N - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break; \n    }\n    if (j == i)\n      cout << ' ' << a[i]; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23530", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000] = {0};\n  int i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == 0) {\n        if (a[i] == a[j]) {\n          b[j] = 1;\n          k++;\n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[9000], ans[9000];\n  scanf(\"%d\", &n);\n  int i;\n  int num = 1, t = 0;\n  scanf(\"%d\", &a[0]);\n  ans[0] = a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    int j = 0;\n    while (j < num) {\n      if (a[i] == ans[j]) {\n        t = 1;\n        break;\n      }\n      j++;\n    }\n    if (t == 0) {\n      ans[num] = a[i];\n      printf(\" %d\", ans[num]);\n      num++;\n    } else\n      t = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, u[20000], a[20000], b, c;\n  b = 0;\n  c = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &u[i]);\n    a[i] = 0;\n  }\n  if (n == 1) {\n    cout << u[0];\n  } else {\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j <= i - 1; j++) {\n        if (u[i] == u[j]) {\n          a[i] = a[i] + 1;\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        b = b + 1;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        c = c + 1;\n        if (c < b) {\n          printf(\"%d \", u[i]);\n        }\n        if (c == b) {\n          printf(\"%d\", u[i]);\n        }\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b[91] = {0}, i, k, counter = 0, temp;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> temp;\n    for (k = 0; k < 91; k++) {\n      if (b[k] == temp)\n        break;\n    }\n    if (k >= 91) {\n      b[counter] = temp;\n      counter++;\n    }\n  }\n  for (k = 0; k < counter - 1; k++) {\n    cout << b[k] << \" \";\n  }\n  cout << b[counter - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    cout << a[0];\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (i == j && a[i] != a[i - 1])\n        printf(\" %d\", a[i]);\n    }\n    for (j = 0; j < n - 1; j++) {\n      if (a[n - 1] == a[j])\n        break;\n    }\n    if (n - 1 == j && a[n - 1] != a[n - 2])\n      printf(\" %d\", a[n - 1]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23535", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 1; i <= n; i = i + 1) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i = i + 1) {\n    s = 0;\n    if (i == 1)\n      printf(\"%d\", a[i - 1]);\n    else {\n      for (j = 0; j < i - 1; j = j + 1) {\n        s = (a[i - 1] == a[j]) ? s + 1 : s;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, i, j, n;\n  int s1[20000], s2[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = n - 1, m = 0; i >= 0; i--) {\n    k = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (s1[i] == s1[j])\n        k++;\n    }\n    if (k == 0) {\n      s2[m] = s1[i];\n      m++;\n    }\n  }\n  s2[m] = '\\0';\n  for (n = m - 1; n > 0; n--)\n    printf(\"%d \", s2[n]);\n\n  printf(\"%d\", s2[0]);\n}\n"}
{"label": "13", "index": "23537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0}, b[100] = {0}, n, i, j, m = 1, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= m; j++) {\n      if (a[i] == b[j])\n        flag = 1;\n    }\n    if (flag == 1)\n      continue;\n    else {\n      m++;\n      b[m] = a[i];\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23538", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001], b[101], c[101];\n  int i, n, m;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= 101; i++)\n    b[i] = 0;\n  m = 0;\n  for (i = 1; i <= n; i++)\n    if (b[a[i]] == 0) {\n      m = m + 1;\n      b[a[i]] = 1;\n      c[m] = a[i];\n    }\n  for (i = 1; i <= m; i++) {\n    if (i < m)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, e;\n  e = 0;\n  int a[20000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (e == 0 && a[i] != 0) {\n      cout << a[i];\n      e = 1;\n    } else if (e == 1 && a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n  }\n\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "13", "index": "23540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, j = 0, m = 0;\n  cin >> n;\n  int a[100000];\n  int b[100000];\n  for (int k = 0; k < n; k++) {\n    cin >> a[k];\n  }\n  for (int i = 0; i < n; i++) {\n    int count = 0;\n    for (int l = 0; l < i; l++) {\n      if (a[l] == a[i]) {\n        count = 1;\n        m = m + 1;\n        break;\n      }\n    }\n    if (!count) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (int h = 0; h < (n - m); h++) {\n    if (h == 0)\n      cout << b[h];\n    if (h > 0)\n      printf(\" %d\", b[h]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[20001];\n  cin >> n;\n\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &s[i]);\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == s[j]) {\n        s[i] = 0;\n        break;\n      };\n    };\n  };\n\n  for (i = 2; i <= n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  };\n}\n"}
{"label": "13", "index": "23542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[100], n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  l = 0;\n  k = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= l; j++)\n      if (a[i] == b[j])\n        k = 1;\n    if (k == 0) {\n      l++;\n      b[l] = a[i];\n    }\n    k = 0;\n  }\n  for (i = 0; i < l; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[l]);\n}\n"}
{"label": "13", "index": "23543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (j = 0; j < n; j++) {\n    if (a[j] >= 10 && a[j] <= 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] >= 10 && a[i] <= 100) {\n          if (a[j] == a[i]) {\n            a[i] = 0;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k;\n  int flag = 0;\n  int i;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (shuzu[i] == shuzu[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      printf(\" %d\", shuzu[i]);\n    }\n    flag = 0;\n  }\n  free(shuzu);\n  return 0;\n}\n"}
{"label": "13", "index": "23545", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[20000], i, num, count[20000] = {0};\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    num = a[i];\n    count[num]++;\n\n    if (i == 0)\n      cout << a[i];\n    else {\n      if (count[num] == 1)\n        cout << \" \" << num;\n    }\n  }\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n == 0)\n    ;\n  else {\n    int a[n];\n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      int k = 0, j;\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          k++;\n      if (k == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "13", "index": "23547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int k = 1;\n  int a[20000];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n    for (j = 0; j <= i - 1; j++) {\n      if (i - 1 == 0) {\n        k = k + 1;\n        a[0] = a[0];\n      } else {\n        if (a[j] == a[i - 1] && j != i - 1)\n          break;\n        else if (a[j] == a[i - 1]) {\n          a[k - 1] = a[i - 1];\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= k - 3; i++)\n    printf(\"%d \", a[i]);\n  cout << a[k - 2];\n  return 0;\n}\n"}
{"label": "13", "index": "23548", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], i, j, k, l, m, n;\n  scanf(\"%d\", &n);\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n\n  for (i = 1; i <= n; i++) {\n\n    m = 0;\n    for (k = 1; k < i; k++) {\n      if (a[k] != a[i])\n        m = m + 1;\n    }\n    if (m == i - 1) {\n      l = l + 1;\n      if (l == 1)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = i;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[k]);\n}\n"}
{"label": "13", "index": "23550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20001];\n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  int j = 1;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        int u = i;\n        if (a[i] == a[i + 1]) {\n          j--;\n        }\n        while (i < n) {\n          a[i] = a[i + 1];\n          i++;\n        }\n        i = u;\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 1; i < n; i++)\n    cout << a[i] << \" \";\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[10000], i, j, x = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[101];\nint main() {\n  int q = 0, temp, n, i, flag = 0, t[200];\n  memset(a, 0, sizeof(a));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &temp);\n    if (a[temp] == 0)\n      t[q++] = temp;\n    a[temp]++;\n  }\n  for (i = 0; i < q; i++) {\n    if (flag == 0)\n      flag = 1;\n    else\n      cout << \" \";\n    printf(\"%d\", t[i]);\n  }\n}\n"}
{"label": "13", "index": "23553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k, m = 0; \n  cin >> N;\n  const int n = N;\n  int a[n];\n  for (i = 0; i < n; i++) \n  {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - m; i++)    \n    for (j = i; j <= n - m; j++) \n    {\n      if (a[i] == a[j + 1]) \n      {\n        for (k = j + 1; k < n - m; k++) \n          a[k] = a[k + 1];\n        m++;\n        j--;\n      }\n    }\n  cout << a[0]; \n  for (i = 1; i < n - m; i++) {\n\n    cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23554", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i, k = 0, a[90], b[20000];\n\n  for (i = 0; i <= 89; i++)\n    a[i] = i + 10;\n\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &b[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    int j;\n    for (j = 0; j <= 89; j++) {\n      if (b[i] == a[j]) {\n        if (k == 0)\n          printf(\"%d\", a[j]);\n        else\n          printf(\" %d\", a[j]);\n        a[j] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20002], b[20001], n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n + 1; i++)\n    b[i] = 0;\n  a[n + 1] = 0;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n + 1; j++)\n      b[i] += a[j];\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0 && b[i] != 0)\n      printf(\"%d \", a[i]);\n    else if (a[i] != 0 && b[i] == 0)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23556", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    a[i] = m;\n  }\n  for (int ii = 0; ii < n; ii++)\n    for (int j = ii + 1; j < n; j++) {\n      if (a[j] == a[ii]) {\n        a[j] = 101;\n      } \n    }\n  int b = 1; \n  for (int l = 0; l < n; l++) {\n\n    if (a[l] < 100 && b == 1) {\n      cout << a[l];\n      b += 1;\n    } else if (a[l] < 100 && b != 1)\n      cout << ' ' << a[l];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23557", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint hs(int a);\nint main() {\n  int n, b[20002], i, j, pd, js;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  js = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        js--;\n        break;\n      }\n    }\n  }\n  pd = 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        pd = 0;\n      }\n    }\n    if (pd == 1 && js != 1) {\n      printf(\"%d \", b[i]);\n      js--;\n    } else if (pd == 1 && js == 1) {\n      printf(\"%d\", b[i]);\n      break;\n    }\n    pd = 1;\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[20000], B[20000], n, i, j, k;\n  int flag;\n  int number = 0;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &A[i]);\n  }\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (k = 0; k < i; k++) {\n      if (A[k] == A[i]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      B[j] = A[i];\n      number = number + 1;\n      j = j + 1;\n    }\n  }\n  for (j = 0; j < number; j++) {\n    if (j == 0) {\n      printf(\"%d\", B[j]);\n    } else {\n      printf(\" %d\", B[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20001], count[101] = {0};\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    count[a[i]]++;\n  }\n  printf(\"%d\", a[1]);\n  count[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (count[a[i]] >= 1) {\n      printf(\" %d\", a[i]);\n      count[a[i]] = 0;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n == 0)\n    ;\n  else {\n    int a[n];\n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      int k = 0, j;\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          k++;\n      if (k == 0)\n        cout << ' ' << a[i];\n    }\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "13", "index": "23561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  printf(\"%d\", p[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        break;\n    }\n    if (j == i)\n      cout << \" \" << p[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23562", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 2, j, k;\n  cin >> n;\n  cin >> a[1];\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i = i + 1) {\n    if (a[i] == a[1])\n      a[i] = 0;\n  }\n  for (k = 2; k <= n; k = k + 1) {\n    if (a[k] != 0) {\n      printf(\" %d\", a[k]);\n      for (j = k + 1; j <= n; j = j + 1) {\n        if (a[j] == a[k]) {\n          a[j] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], m;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n\n    for (i = 0; i < n; i++) {\n      m = 0;\n      if (i == 0) {\n        scanf(\"%d\", &a[0]);\n        cout << a[0];\n      } else {\n        cin >> a[i];\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j]) {\n            m++;\n          }\n        }\n        if (m == 0) {\n          printf(\" %d\", a[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  int temp[20001], k = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      temp[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", temp[i]);\n  cout << temp[k - 1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int num, count[100] = {0};\n  cin >> num;\n  count[num]++;\n  cout << num;\n  for (i = 2; i <= n; i++) {\n    cin >> num;\n    count[num]++;\n    if (count[num] == 1)\n      cout << \" \" << num;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n;\n  cin >> n;\n  int *N = (int *)malloc(sizeof(int) * n);\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d\", &(N[k]));\n  }\n  for (i = 1; i < n; i++) {\n    for (int r = 0; r < i; r++) {\n      if (N[i] == N[r]) {\n        for (int j = i; j < n; j++) {\n          N[j] = N[j + 1];\n        }\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", N[i]);\n    else\n      printf(\"%d \", N[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23567", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20000], b = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k <= j; k++) {\n      if (a[k] != a[j])\n        b++;\n    }\n    if (b == j)\n      printf(\" %d\", a[j]);\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m = 1;\n  cin >> n;\n  int a[n];\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    m = 1;\n    for (int j = i - 1; j > 0; j--)\n      if (a[i] == a[j])\n        m = 0;\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if ((i < n) && (i > 0))\n        cout << \" \";\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23570", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[200001], j, flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        flag = 1;\n      }\n    }\n    if (!flag)\n      cout << ' ' << a[i];\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23571", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[200000], i, c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++)\n    c[i] = 0;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    c[a[i]]++;\n    if (c[a[i]] == 1) {\n      if (i == 0)\n        printf(\"%d\", a[0]);\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[20000], i, num_cout[20000], k, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  num_cout[0] = num[0];\n  k = 1;\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < k; j++) {\n      if (num[i] == num_cout[j])\n        m++;\n    }\n    if (m == 0) {\n      num_cout[k] = num[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << num_cout[i] << \" \";\n  }\n  cout << num_cout[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20010], b[20010] = {0}, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 0; j <= m; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n      if (j == m) {\n        b[m] = a[i];\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (i == m - 1)\n      cout << b[i];\n    else\n      printf(\"%d \", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23574", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[30000], j;\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d \", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, y;\n  scanf(\"%d\", &n);\n  int a[20000];\n  int b[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    y = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        y++;\n      }\n    }\n    if (y == 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23576", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == a[i])\n        b[j] = 0;\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "23577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int N[n];\n  for (i = 0, k = 0; i < n; i++, k++) {\n    cin >> N[k];\n    for (j = 0; j < k; j++) {\n      if (N[j] == N[k])\n        k--;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == (k - 1))\n      cout << N[i];\n    else\n      cout << N[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int num = 0;\n  int c = 1;\n  int j, i;\n  int b[100];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        c = 0;\n    }\n\n    if (c != 0) {\n      num = num + 1;\n      b[num] = a[i];\n    }\n    c = 1;\n  }\n\n  for (i = 1; i < num; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[num]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23579", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    m = 0;\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] == a[j])\n        m = m + 1;\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000]; \n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  } \n  if (n > 1) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          a[i] = 0; \n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      if (a[i] != 0)\n        cout << \" \" << a[i];\n    } \n  }\n  if (n == 1)\n    cout << a[0];\n  return 0;\n}\n"}
{"label": "13", "index": "23581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (a[j] == a[i])\n        a[j] = -1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != -1)\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20000];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  int j;\n  int k;\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    while (j < n)\n      if (a[i] == a[j]) {\n        n--;\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n      } else {\n        j++;\n      }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23583", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, x = 0, a[100] = {0}, i = 0;\n  cin >> n;\n  cin >> x;\n  printf(\"%d\", x);\n  a[x - 1] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> x;\n    if (a[x - 1] == 0) {\n      cout << \" \" << x;\n      a[x - 1] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int n, i, j, l, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  num = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        num++;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      j++;\n      if (j != n - num) {\n        printf(\"%d \", a[i]);\n      } else {\n        printf(\"%d\", a[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int timer = 0;\n  int a[20001], b[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] != a[i]) {\n        timer++;\n      }\n    }\n    if (timer != i - 1) {\n      a[i] = 1;\n    }\n    timer = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] == 1) {\n      timer++;\n    } else {\n      a[i - timer] = a[i];\n    }\n  }\n  for (i = 1; i < n - timer; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - timer]);\n  return 0;\n}\n"}
{"label": "13", "index": "23586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint a[20000] = {0}, b[20000] = {0};\nint main() {\n  int i, j, k = 0, g = 0, kk = 0;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = i + 1; j < n; ++j) {\n      if (a[i] == a[j]) {\n        a[j] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    if (a[i] >= 0) {\n      b[k] = a[i];\n      ++k;\n    }\n  }\n  for (i = 0; i < k - 1; ++i) {\n    cout << b[i] << \" \";\n  }\n  cout << b[k - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, num[20000], i, num_cout[20000], k, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  num_cout[0] = num[0];\n  k = 1;\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < k; j++) {\n      if (num[i] == num_cout[j])\n        m++;\n    }\n    if (m == 0) {\n      num_cout[k] = num[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << num_cout[i] << \" \";\n  }\n  cout << num_cout[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23588", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  int i = 0;\n  int x;\n  cin >> x;\n  printf(\"%d\", x);\n  a[i] = x;\n  i++;\n  for (int j = 1; j < n; j++) {\n    int h;\n    int k = 0;\n    scanf(\"%d\", &h);\n    for (int t = 0; t < i; t++) {\n      if (h == a[t])\n        k = 1;\n    }\n    if (k == 0) {\n      printf(\" %d\", h);\n      a[i] = h;\n      i++;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23589", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, b, c, d, i, a[20000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &b);\n    a[i] = b;\n  }\n  cout << a[1];\n  for (c = 2; c <= n; c++) {\n    for (d = 0; d <= c - 1; d++) {\n      if (a[d] == a[c])\n        break;\n      else\n        continue;\n    }\n    if (d == c) {\n      printf(\" %d\", a[c]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23590", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, l;\n  int s[12000];\n  cin >> n;\n  m = n;\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    l++;\n    scanf(\"%d\", &s[l]);\n    for (j = 1; j <= l - 1; j++)\n      if (s[j] == s[l]) {\n        l--;\n        m--;\n      }\n  }\n  for (i = 1; i <= m - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[m]);\n}\n"}
{"label": "13", "index": "23591", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j, b[20000] = {0}, p = 1, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = n; i >= 2; i--) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        m += 1;\n    }\n    if (m == 0) {\n      b[p] = a[i];\n      p++;\n    }\n    m = 0;\n  }\n  p = p - 1;\n  b[p + 1] = a[1];\n  for (i = p + 1; i >= 2; i--) {\n    cout << b[i] << \" \";\n  }\n  cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[20000] = {0}, a, i = 0, n, p = 0, j, k;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    scanf(\"%d\", &a);\n    for (j = 0, k = 0; j < i; j++) {\n      if (c[j] == a) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      c[p] = a;\n      p++;\n    }\n    i++;\n  }\n  for (j = 0; j < p; j++) {\n    printf(\"%d\", c[j]);\n    if (j < p - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23593", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, c, b = 1;\n  scanf(\"%d \", &N);\n  int a[20001];\n  for (int i = 1; i <= N; i++)\n    cin >> a[i];\n  for (int m = 2; m <= N; m++) {\n    for (c = 1; c <= b; c++) {\n      if (a[m] == a[c])\n        break;\n    }\n    if (c == b + 1) {\n      b++;\n      a[b] = a[m];\n    }\n  }\n  cout << a[1];\n  for (int d = 2; d <= b; d++)\n    cout << \" \" << a[d];\n  return 0;\n}\n"}
{"label": "13", "index": "23594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, s, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (k = i + 1; k < n; k++) {\n      if (a[k] == s) {\n        for (j = k; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 2, j, k;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  while (i <= n) {\n    scanf(\"%d\", &a[i]);\n    i = i + 1;\n  }\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i = i + 1) {\n    if (a[i] == a[1])\n      a[i] = 0;\n  }\n  for (k = 2; k <= n; k = k + 1) {\n    if (a[k] != 0) {\n      printf(\" %d\", a[k]);\n      for (j = k + 1; j <= n; j = j + 1) {\n        if (a[j] == a[k]) {\n          a[j] = 0;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[1000], times[200];\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; ++i)\n    cin >> a[i];\n  int tot = 0;\n  for (int i = 0; i < n; ++i)\n    if (!times[a[i]]) {\n      tot++;\n      times[a[i]]++;\n      if (tot > 1)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23597", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l = 0, g = 0, n, a[20000], b[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    for (i = n - 1; i >= 0; i--) {\n      if (a[n - 1] == a[i])\n        k++;\n    }\n    if (k == n)\n      printf(\"%d\", a[0]);\n    else {\n      printf(\"%d \", a[0]);\n      for (i = 1; i < n; i++) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] != a[j])\n            l++;\n        }\n        if (l == i) {\n          b[g] = a[i];\n          g++;\n        }\n        l = 0;\n      }\n      for (i = 0; i < g - 1; i++) {\n        printf(\"%d \", b[i]);\n      }\n      printf(\"%d\", b[g - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[20000];\n  int i, j;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    int k;\n    k = 0;\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] != a[j])\n        k = k + 0;\n      else\n        k = k + 1;\n    }\n    if (k == 0 && a[i] != a[0])\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0 && i != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23600", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, s[20000], ct = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    cin >> c;\n    s[b] = c;\n    d = 0;\n    for (e = 1; e <= b - 1; e++) {\n      if (s[b] == s[e])\n        d = 1;\n    }\n    if (d == 0) {\n      if (ct == 1)\n        printf(\" \");\n      printf(\"%d\", s[b]);\n      ct = 1;\n    }\n  }\n  return 100;\n}\n"}
{"label": "13", "index": "23601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n = 0, flag[90]; \n                       \n  cin >> n;\n  int a[n]; \n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    flag[a[i] - 10] = 1; \n  }\n  for (int j = 0; j < n; j++) {\n    if (flag[a[j] - 10]) {\n      if (j) { \n        cout << ' ' << a[j];\n      } else {\n        cout << a[j];\n      }\n    }\n    flag[a[j] - 10] = 0; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, c, j, k = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &c);\n    p = 1;\n    for (j = 0; j < k; j++)\n      if (a[j] == c)\n        p = 0;\n    if (p) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[i];\n}\n"}
{"label": "13", "index": "23603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "13", "index": "23604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101], b[20000], n, i; \n  for (i = 0; i < 101; i = i + 1) {\n    a[i] = 0;\n  } \n  cin >> n;\n  cin >> b[0];\n  cout << b[0]; \n  a[b[0]] = 1;  \n  for (i = 1; i < n; i++) {\n    cin >> b[i];\n    if (a[b[i]] == 0) {\n      cout << \" \" << b[i];\n      a[b[i]] = 1;\n    }\n  } \n  return 0;\n} \n"}
{"label": "13", "index": "23605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[91], count = 0, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      count++;\n      b[count] = a[i];\n      if (count == 90)\n        break;\n    }\n    if (count == 90)\n      break;\n  }\n  if (count > 1) {\n    for (i = 1; i <= count - 1; i++)\n      cout << b[i] << \" \";\n    cout << b[count] << endl;\n  } else if (count == 1)\n    cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23606", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, j, i, leap = 0, f = 1;\n  int m[20000];\n  cin >> a;\n  for (i = 0; i < a; i++)\n    cin >> m[i];\n  for (i = 0; i < a; i++) {\n    leap = 0;\n\n    for (j = 0; j < i + 1; j++) {\n      if (j == i)\n        continue;\n      else {\n        if (m[i] == m[j]) {\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 0 && f == 1) {\n      printf(\"%d\", m[i]);\n      f = 0;\n      continue;\n    }\n    if (leap == 0 && f == 0)\n      printf(\" %d\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int d;\n  int flag[101];\n  for (i = 0; i <= 100; i++) {\n    flag[i] = 0;\n  }\n  cin >> n;\n  int couted = 0;\n  for (i = 0; i < n; i++) {\n    cin >> d;\n    if (flag[d] == 0) {\n      if (couted == 0) {\n        cout << d;\n        couted = 1;\n      } else {\n        cout << \" \" << d;\n      }\n      flag[d] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int timer = 0;\n  int a[20001], b[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] != a[i]) {\n        timer++;\n      }\n    }\n    if (timer != i - 1) {\n      a[i] = 1;\n    }\n    timer = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] == 1) {\n      timer++;\n    } else {\n      a[i - timer] = a[i];\n    }\n  }\n  for (i = 1; i < n - timer; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - timer]);\n  return 0;\n}\n"}
{"label": "13", "index": "23609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        j = i;\n      } else {\n        j = j;\n      }\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23610", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, js, cunzai;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  \n  for (i = 1; i < n; i++) {\n    cunzai = 0;\n    js = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        js++;\n    }\n    if (js == 0) {\n      printf(\" %d\", a[i]);\n      \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23611", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, timer, k, k0;\n  timer = 0;\n  k0 = 0;\n  k = -1;\n  int l[100000], r[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &l[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (l[i] == l[j]) {\n        l[j] = 10000;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] == 10000) {\n      timer++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (l[i] != 10000) {\n\n      k0++;\n      k++;\n      r[k] = l[i];\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < k0; i++) {\n    if (k == 0) {\n      printf(\"%d\", r[i]);\n    } else if (k != 0 && i < k0 - 1) {\n      printf(\"%d \", r[i]);\n    } else if (i == k0 - 1) {\n      printf(\"%d\", r[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23612", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x, q;\n\n  cin >> m;\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  x = 0;\n  q = 0;\n  if (n[0] == 1)\n    printf(\"%d\", b[0]);\n  else if (n[0] >= 2) {\n    printf(\"%d\", b[0]);\n    n[0] = 0;\n  }\n\n  for (j = 1; b[j] != 0; j++) {\n    if (n[j] == 1)\n      printf(\" %d\", b[j]);\n    else if (n[j] >= 2) {\n      printf(\" %d\", b[j]);\n      n[j] = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, q, x = 1;\n  int shuzu[1000], panduan[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> (shuzu[i]);\n\n  panduan[0] = 0;\n  for (i = 1; i < n; i++) {\n    for (q = 0, j = 0; j < i; j++) {\n      if (shuzu[j] == shuzu[i]) {\n        q = 1;\n        break;\n      }\n    }\n\n    panduan[i] = q;\n  }\n  for (i = 0, x = 0; i < n; i++) {\n    if (panduan[i] == 0) {\n      x = x + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (panduan[i] == 0 && (x != 1)) {\n      printf(\"%d \", shuzu[i]);\n      x--;\n    } else if (panduan[i] == 0 && (x == 1)) {\n      cout << shuzu[i];\n      x--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k;\n  i = 0;\n  k = 1;\n  scanf(\"%d\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n  } else {\n    scanf(\"%d\", &a[i]);\n    printf(\"%d\", a[i]);\n    for (i = 1; i < n; i++, k++) {\n      scanf(\"%d\", &a[i]);\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (k < (n - 1)) {\n        if (i == j) {\n          printf(\" %d\", a[i]);\n        }\n      } else {\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j])\n            break;\n        }\n        if (i == j)\n          cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> p[i];\n  printf(\"%d\", p[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", p[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[10000], i, j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] == a[j]) {\n        for (m = j; m < n; m++)\n          a[m] = a[m + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "13", "index": "23618", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m, j;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      m = i;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] != 0) {\n      printf(\"%d \", a[i]);\n    }\n  }\n  printf(\"%d\", a[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "23619", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0, t = 0;\n  int a[90000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (k = 1; k < n; k++)\n\n  {\n    t = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i])\n        t = 1;\n    }\n    if (t == 0)\n      printf(\" %d\", a[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23620", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100000], i, h = 1, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[h] = a[i];\n      h++;\n    }\n  }\n  for (i = 1; i <= h - 1; i++) {\n    if (i < h - 1)\n      printf(\"%d \", b[i]);\n    else if (i == h - 1)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "23621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20001];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (j = 0; j < n; j++) {\n    if (a[j] >= 10 && a[j] <= 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] >= 10 && a[i] <= 100) {\n          if (a[j] == a[i]) {\n            a[i] = 0;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++)\n      if (a[j] == a[k])\n        break;\n    if (k == j)\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        j--;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p, *q, *head;\n  p = (int *)calloc(n, sizeof(int));\n  head = p;\n  for (p = head; p < head + n; p++) {\n    scanf(\"%d\", p);\n  }\n  p = head;\n  printf(\"%d\", *p);\n  p++;\n  for (; p < head + n; p++) {\n    for (q = head; q < p; q++) {\n      if (*q == *p) {\n        goto chongfu;\n      }\n    }\n    printf(\" %d\", *p);\n  chongfu:;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23625", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, save[20000], count = 0;\n  for (i = 0; i < 20000; i++)\n    save[i] = 0;\n  cin >> n;\n  while (n--) {\n    int flag = 1;\n    cin >> m;\n    for (i = 0; i < 20000; i++) {\n      if (save[i] == m) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < 20000; i++) {\n        if (save[i] == 0) {\n          save[i] = m;\n          break;\n        }\n      }\n      count++;\n    }\n  }\n  for (i = 0; i < count - 1; i++)\n    cout << save[i] << \" \";\n  cout << save[count - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23626", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, a[101] = {0}, temp, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> temp;\n    if (a[temp] == 0) \n    {\n      num++;\n      a[temp] = num;\n    }\n  }\n  for (int j = 1; j <= num; j++) \n  {\n    for (int k = 10; k <= 100; k++) \n      if (a[k] == j)\n        cout << k;\n    if (j < num)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23627", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int array[n];\n  for (int i = 0; i <= n - 1; i++)\n    cin >> array[i];\n  cout << array[0];\n  for (int i = 1; i <= n - 1; i++) {\n    int g = 0;\n    for (int j = 0; j <= i - 1; j++)\n      if (array[i] == array[j])\n        g = g + 1;\n    if (g == 0)\n      cout << \" \" << array[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] == a[j]) {\n        for (m = j; m < n; m++)\n          a[m] = a[m + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "13", "index": "23629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - sum; i++)\n    for (j = i + 1; j < n - sum; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n - sum - 1; k++)\n          a[k] = a[k + 1];\n        sum++;\n        j--;\n      }\n    }\n  for (i = 0; i < n - sum - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[n - sum - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, i;\n  int f[20001] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    if (f[a] == 0) {\n      if (i == 1)\n        printf(\"%d\", a);\n      else\n        cout << \" \" << a;\n      f[a] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        i = i - 1;\n        n--;\n        break;\n      }\n    }\n  }\n  if ((n - 2) >= 0) {\n    for (i = 0; i <= n - 2; i++) {\n      cout << a[i] << \" \";\n    }\n    cout << a[n - 1];\n  } else {\n    printf(\"%d\", a[0]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000], flag[20000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag[i] = 1;\n    }\n    if (flag[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23633", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int *number;\n  int i, j;\n  int sum;\n\n  scanf(\"%d\", &n);\n  number = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> number[i];\n  }\n\n  i = 0;\n  while ((i < n) && (sum != 0)) {\n    if ((i == n - 1) && (number[i] != 0)) {\n      printf(\"%d\", number[i]);\n    }\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (number[j] == number[i]) {\n        *(number + j) = 0;\n      }\n      sum += number[j];\n    }\n\n    if ((sum != 0) && (number[i] != 0)) {\n      printf(\"%d \", number[i]);\n    } else if ((sum == 0) && (number[n - 1] == 0)) {\n      printf(\"%d\", number[i]);\n      sum = 0;\n    }\n    i++;\n  }\n\n  free(number);\n  return 0;\n}\n"}
{"label": "13", "index": "23634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (j == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23635", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main(int argc, const char *argv[]) {\n  int n = 0, i = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int j = 0, k = 0, l = 0;\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (l = k; l < n - 1; l++) {\n          a[l] = a[l + 1]; \n        }\n        n--; \n        k--; \n      }\n    }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23636", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    for (int k = 0; k < i; k++) {\n      if (a[i] == a[k])\n        break;\n      if (k == i - 1)\n        cout << \" \" << a[i];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20002], b[20001], n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n + 1; i++)\n    b[i] = 0;\n  a[n + 1] = 0;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = i + 1; j <= n + 1; j++)\n      b[i] += a[j];\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0 && b[i] != 0)\n      printf(\"%d \", a[i]);\n    else if (a[i] != 0 && b[i] == 0)\n      cout << a[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        j = i;\n      } else {\n        j = j;\n      }\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        continue;\n    }\n    if (j == i) {\n      if (i == 0)\n        cout << a[i];\n      else\n        cout << \" \" << a[i];\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int j, tag = 0;\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    tag = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        tag++;\n    }\n    if (tag == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int number[1000000];\n  scanf(\"%d \", &n);\n  for (int i1 = 0; i1 < n; i1++) {\n    scanf(\"%d \", &number[i1]);\n  }\n  for (int i2 = 0; i2 < n; i2++) {\n    for (int i3 = i2 + 1; i3 < n; i3++) {\n      if (number[i2] == number[i3]) {\n        number[i3] = 0;\n      }\n    }\n  }\n  printf(\"%d\", number[0]);\n  for (int i4 = 1; i4 < n; i4++) {\n    if (number[i4] != 0) {\n      cout << \" \" << number[i4];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == a[i])\n        b[j] = 0;\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "23643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int mark[101];\n  for (int i = 0; i < 101; i++)\n    mark[i] = 0;\n  int num[20005];\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  mark[num[0]] = 1;\n  for (int i = 0; i < n; i++) {\n    if (mark[num[i]] == 0) {\n      mark[num[i]] = 1;\n      cout << \" \" << num[i];\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23644", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int sum;\n\n  cin >> n;\n  sum = n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n        sum--;\n      }\n    }\n  }\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    cout << a[i];\n    j++;\n    if (j != sum)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t = 0;\n  cin >> n;\n  int N[20000];\n  int M[90] = {0};\n  for (i = 0; i < n; i++)\n    cin >> N[i];\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (N[j] == N[k])\n        break;\n    }\n    if (k == j) {\n      M[t] = N[j];\n      t++;\n    }\n  }\n  for (m = 0; m < t - 1; m++)\n    cout << M[m] << \" \";\n  cout << M[t - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 0, t = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 0; t <= i - 1; t++) {\n      if (a[i] == a[t])\n        p++;\n    }\n\n    if (p != 0) {\n      a[i] = 0;\n    }\n    p = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (t = i + 1; t <= n - 1; t++) {\n    if (a[t] != 0)\n      printf(\" %d\", a[t]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23647", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int zz[20000];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> zz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (zz[i] == zz[j]) {\n        zz[j] -= zz[i];\n      }\n    }\n  }\n  cout << zz[0];\n  for (i = 1; i < n; i++) {\n    if (zz[i] != 0)\n      cout << \" \" << zz[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[1000];\n  int i, j;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    }\n\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[j] == a[i]) {\n          break;\n        }\n      }\n      if (j == i) {\n        cout << \" \" << a[i];\n      } else if (j < i) {\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j = 1, c = 0, l = 1, m, n, k;\n  cin >> n;\n  int s[20000] = {0}, t[20000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  t[0] = s[0];\n  for (l = 1; l < n; l++) {\n    c = 0;\n    for (i = 0; i < l; i++) {\n      if (s[l] == s[i]) {\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0) {\n      t[j] = s[l];\n      j++;\n    }\n  }\n  for (m = 0; (c = t[m + 1]) != 0; m++) {\n    cout << t[m] << \" \";\n  }\n  printf(\"%d\", t[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "23650", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20000], counter = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j)\n      counter++;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      cout << a[i];\n      counter--;\n      if (counter != 0)\n        cout << ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20002];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n\n    if (j == i) {\n      cout << \" \" << a[i];\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {'\\0'}, i = 0, j = 0, k = 0, temp, count;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &temp);\n    count = 0;\n    for (j = 0; j <= k; j++) {\n      if (temp == a[j])\n        break;\n      else\n        count++;\n    }\n    if (count == k + 1) {\n      k++;\n      a[k] = temp;\n    }\n  }\n  for (i = 1; a[i] != '\\0'; i++)\n    printf(\" %d\", a[i]);\n}\n"}
{"label": "13", "index": "23653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], i, j, n, t, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    count = 0;\n    for (j = i; j >= 0; j--) {\n      count++;\n      if (a[i] == a[j] && (i != j)) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0 && count == 1) {\n      cout << a[i];\n    } else if ((t == 0) && (count != 1)) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], t, j, m, i, asd;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    } else if (i != 0) {\n      for (j = 0; j < i; j++) {\n        asd = a[i] - a[j];\n        if (asd == 0) {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t, p;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    p = 0;\n    t = 0;\n    do {\n      if (a[i] == a[p]) {\n        t = 1;\n      }\n      p += 1;\n    } while (t == 0 && p < i);\n    if (t == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, l, i, j, x;\n  scanf(\"%d\", &n);\n  l = 0;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    for (i = (j + 1); i < n; i++) {\n      if (a[j] == a[i])\n        a[i] = '*';\n    }\n  }\n  if (a[n - 1] != '*') {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] != '*')\n        printf(\"%d \", a[i]);\n    }\n    cout << a[n - 1];\n  } else {\n    for (i = n - 1; i > 0; i--) {\n      if (a[i] == '*')\n        l = l + 1;\n      else\n        break;\n    }\n    for (j = 0; j < n - l - 1; j++) {\n      if (a[j] != '*')\n        printf(\"%d \", a[j]);\n    }\n    printf(\"%d\", a[n - l - 1]);\n  }\n}\n"}
{"label": "13", "index": "23657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20001];\n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  int j = 1;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        int u = i;\n        if (a[i] == a[i + 1])\n          j--;\n        while (i < n) {\n          a[i] = a[i + 1];\n          i++;\n        }\n        i = u;\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 1; i < n; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, y;\n  scanf(\"%d\", &n);\n  int a[20000];\n  int b[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    y = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        y++;\n      }\n    }\n    if (y == 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23659", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a, b;\n  scanf(\"%d\", &n);\n  int num[20000];\n  int res[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &num[i]);\n  b = 0;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    a = num[i];\n    for (j = 0; j <= i; j++) {\n      if (i == j) {\n        b = a;\n        continue;\n      }\n      if (a != num[j])\n        b = a;\n      else {\n        b = 0;\n        break;\n      }\n    }\n\n    if (b != 0) {\n      k++;\n      res[k] = b;\n    }\n  }\n  for (l = 1; l <= k; l++) {\n    if (l != k)\n      printf(\"%d \", res[l]);\n    else\n      printf(\"%d\", res[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23660", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, s, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (k = i + 1; k < n; k++) {\n      if (a[k] == s) {\n        for (j = k; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k, p, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (j = 1; j <= n - 1; j++) {\n    for (k = j + 1; k <= n;) {\n      if (a[j] == a[k]) {\n        for (p = k; p <= n - 1; p++) {\n          a[p] = a[p + 1];\n        }\n        n--;\n      } else {\n        k++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100000];\nint n;\nvoid del_a(int x) {\n  for (int i = x; i < n - 1; i++)\n    a[i] = a[i + 1];\n\n  a[n - 1] = 0;\n  n = n - 1;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        del_a(i);\n        i = i - 1;\n        break;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23663", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, j, m, k, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < k; i++) {\n    for (j = 0, m = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        n = 0;\n      else\n        n = 1;\n      m = m * n;\n    }\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23664", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m;\n    for (j = 0; j < i; j++) {\n      if (a[j] == m) {\n        break;\n      }\n    }\n    if (j == i) {\n      a[i] = m;\n    } else {\n      n = n - 1;\n      i = i - 1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, u[20000], a[20000], b, c;\n  b = 0;\n  c = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &u[i]);\n    a[i] = 0;\n  }\n  if (n == 1) {\n    cout << u[0];\n  } else {\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j <= i - 1; j++) {\n        if (u[i] == u[j])\n          a[i] = a[i] + 1;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        b = b + 1;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        c = c + 1;\n        if (c < b) {\n          printf(\"%d \", u[i]);\n        }\n        if (c == b) {\n          printf(\"%d\", u[i]);\n        }\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001];\n  cin >> n;\n\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int j = 0; j <= n - 1; j++)\n    for (int k = n - 1; k >= j + 1; k--) {\n      if (a[j] == a[k]) {\n        a[k] = 0;\n      }\n    }\n  cout << a[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (a[m] != 0)\n      printf(\" %d\", a[m]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m;\n    for (j = 0; j < i; j++) {\n      if (a[j] == m)\n        break;\n    }\n    if (j == i) {\n      a[i] = m;\n    } else {\n      n = n - 1;\n      i = i - 1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23668", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint src[20000];\nint dst[100];\nint main() {\n  int n, i, j, flag;\n  int current_pos = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> src[i];\n  for (i = 0; i < n; i++) {\n    if (current_pos) {\n      flag = 1;\n      for (j = 0; j < current_pos; j++) {\n        if (dst[j] == src[i])\n          flag = 0;\n      }\n      if (flag == 1) {\n        dst[current_pos] = src[i];\n        current_pos++;\n      }\n    } else {\n      dst[0] = src[0];\n      current_pos++;\n    }\n  }\n  for (i = 0; i < current_pos; i++) {\n    cout << dst[i];\n    if (i < current_pos - 1)\n      cout << \" \";\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0};\n  scanf(\"%d \", &n);\n  int count = n;\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      for (int j = i + 1; j <= n; j++)\n        if (a[j] == a[i]) {\n          a[j] = 0;\n          count -= 1;\n        }\n    }\n  }\n  if (count > 1) {\n    int i;\n    for (i = 1; i <= n; i++) {\n      if (a[i] != 0) {\n        cout << a[i] << ' ';\n        count--;\n      }\n      if (count == 1)\n        break;\n    }\n    for (i = i + 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  } else\n    for (int i = 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23670", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[101];\nint main() {\n  int q = 0, temp, n, i, flag = 0, t[200];\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &temp);\n    if (a[temp] == 0)\n      t[q++] = temp;\n    a[temp]++;\n  }\n  for (i = 0; i < q; i++) {\n    if (flag == 0)\n      flag = 1;\n    else {\n      printf(\" \");\n    }\n    printf(\"%d\", t[i]);\n  }\n}\n"}
{"label": "13", "index": "23671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, num[90] = {0}, a[20001] = {0}, i;\n  cin >> n;\n  cin >> a[1];\n  num[a[1] - 10]++;\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    num[a[i] - 10]++;\n    if (num[a[i] - 10] == 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001], flag[20001] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        flag[j] = 1;\n    }\n    if (flag[i] == 0 && k == 0) {\n      printf(\"%d\", a[i]);\n      k++;\n    } else if (flag[i] == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000] = {0};\n  int b[20000] = {0};\n  int n, i, j, t, m;\n  cin >> n;\n  for (m = 0; m <= n - 1; m++) {\n    cin >> a[m];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        b[i] = 1;\n    }\n  }\n  cout << a[0];\n  for (t = 1; t <= n - 1; t++) {\n    if (b[t] == 0)\n      cout << \" \" << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23674", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, i, j = 0, k;\n  int a[91] = {0};\n  scanf(\"%d \", &n);\n  int b[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> num;\n    if (a[num - 10] == 0) {\n      b[j] = num;\n      a[num - 10]++;\n      j++;\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (k = 1; k <= n; k++) {\n    if (b[k] == 0)\n      break;\n    else\n      printf(\" %d\", b[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], sum = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    cout << a[0];\n  } else {\n    cout << a[0];\n    for (i = 1; i <= n - 1; i++) {\n      sum = 0;\n      for (j = 0; j <= i - 1; j++) {\n        if (a[i] == a[j]) {\n          sum = 1;\n        }\n      }\n      if (sum == 0) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[20000], m = 0, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1, j = 1; i < n; i++) {\n    for (k = 0; k < j; k++)\n      if (a[i] == b[k])\n        m = 1;\n    if (m != 1) {\n      b[j] = a[i];\n      j++;\n    }\n    m = 0;\n  }\n  for (i = 0; i < j - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[j - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a, time;\n  k = 1;\n  time = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (sz[i] == sz[k]) {\n        for (a = k; a < n - 1; a++) {\n          sz[a] = sz[a + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", sz[i]);\n    else if (i != 0)\n      printf(\" %d\", sz[i]);\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "13", "index": "23678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (m = k + 1; m < n; m++)\n          a[m - 1] = a[m];\n        n -= 1;\n        k -= 1;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23679", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, j = 0, k = 0, step = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1 - step; i++) {\n    for (j = i + 1; j < n - step; j++) {\n      if (a[i] == a[j]) {\n        if (j == n - 1 - step) {\n          step++;\n          continue;\n        }\n        for (k = j; k < n - 1 - step; k++)\n          a[k] = a[k + 1];\n        step++;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - step - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[n - 1 - step]);\n  return 0;\n}\n"}
{"label": "13", "index": "23680", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << a[i];\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23681", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t, a[20000], b[100], c[20000];\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  t = 0;\n  for (i = 0; i < n; i++)\n    if (b[a[i]] == 1) {\n      c[t] = a[i];\n      t++;\n      b[a[i]] = 0;\n    }\n  for (i = 0; i < t - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\\n\", c[t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, r, t, s;\n  cin >> n;\n  s = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t++;\n      }\n    }\n    if (t == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (r = 0; r < s - 1; r++) {\n    printf(\"%d \", b[r]);\n  }\n  printf(\"%d\", b[s - 1]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[101] = {0}, temp, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> temp;\n    if (a[temp] == 0) {\n      num++;\n      a[temp] = num;\n    }\n  }\n  for (int j = 1; j <= num; j++) {\n    for (int k = 10; k <= 100; k++)\n      if (a[k] == j) {\n        printf(\"%d\", k);\n      }\n    if (j < num)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    }\n\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[j] == a[i]) {\n          break;\n        }\n      }\n      if (j == i) {\n        cout << \" \" << a[i];\n      } else if (j < i) {\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int j = 0, i = 0, n = 0, e = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[j] = a[i];\n    j = i + 1;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == b[j])\n        b[j] = 0;\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] != 0)\n      cout << \" \" << b[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23686", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k = 0, a[90], b[20000];\n  for (i = 0; i <= 89; i++)\n    a[i] = i + 10;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i <= n - 1; i++) {\n    int j;\n    for (j = 0; j <= 89; j++) {\n      if (b[i] == a[j]) {\n        if (k == 0)\n          printf(\"%d\", a[j]);\n        else\n          printf(\" %d\", a[j]);\n        a[j] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, k;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] != 0 && a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    if (a[k] != 0) {\n      cout << a[k];\n      break;\n    }\n  }\n\n  for (int i = k + 1; i < n; i++) {\n    if (a[i] != 0)\n      cout << ' ' << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    if (i > 0) {\n      for (int k = 0; k < i; k++) {\n        if (num[i] == num[k])\n          num[i] = 0;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i < n; i++) {\n    if (num[i] > 9)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (j == i)\n        continue;\n      else if (a[j] == a[i])\n        a[j] = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (j = i + 1; j < n; j++) {\n    if (a[j] == -1)\n      continue;\n    else\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23690", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], b[20001], i, m;\n  cin >> n;\n  m = n;\n  for (i = 1; i <= n; i++)\n    b[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  i = 2;\n  cout << a[1];\n  b[a[1]] = 0;\n  do {\n    if (b[a[i]] == 1) {\n      cout << ' ' << a[i];\n      b[a[i]] = 0;\n    }\n    m = m - 1;\n    i = i + 1;\n  } while (m >= 0);\n  \n  return 0;\n}\n"}
{"label": "13", "index": "23691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, v[20000], m = 0, s[20000], p = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &v[i]);\n  }\n  for (int j = 1; j <= n - 1; j++) {\n    for (int k = 0; k <= j - 1; k++) {\n      if (v[j] != v[k]) {\n        p++;\n      }\n    }\n    if (p == j) {\n      s[m] = v[j];\n      m++;\n    }\n    p = 0;\n  }\n  if (m == 0)\n    cout << v[0];\n  else {\n    printf(\"%d \", v[0]);\n  }\n  for (int k = 0; k <= m - 1; k++) {\n    if (k == m - 1) {\n      printf(\"%d\", s[k]);\n    } else {\n      printf(\"%d \", s[k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], k, j, b, c, d, e, f, i;\n  scanf(\"%d\", &b);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (j = 1; j < b; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j])\n        break;\n    }\n    if (k == j)\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, k;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] != 0 && a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    if (a[k] != 0) {\n      cout << a[k];\n      break;\n    }\n  }\n\n  for (int i = k + 1; i < n; i++) {\n    if (a[i] != 0)\n      cout << ' ' << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k, p, t;\n  int a[20002];\n  cin >> n;\n  cin >> a[0];\n  p = 0;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> k;\n    t = 0;\n    for (j = 0; j <= p; j++) {\n      if (a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      continue;\n    else {\n      p = p + 1;\n      a[p] = k;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= p; i++)\n    cout << \" \" << a[i];\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s[20000], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  printf(\"%d\", s[0]);\n  a[s[0]] = 1;\n  for (i = 1; i < n; i++)\n    if (a[s[i]] == 0) {\n      cout << \" \" << s[i];\n      a[s[i]] = 1;\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int mark[101];\n  for (int i = 0; i < 101; i++)\n    mark[i] = 0;\n  int num[20005];\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  mark[num[0]] = 1;\n  for (int i = 0; i < n; i++) {\n    if (mark[num[i]] == 0) {\n      mark[num[i]] = 1;\n      cout << \" \" << num[i];\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, t, x, a[20000], n, m, l;\n  l = 0;\n  m = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d\", &x);\n\n    for (i = 1; i <= m + 1; i++)\n      if (x == a[i - 1])\n        l = 1;\n    if (l == 0) {\n      a[m] = x;\n      m = m + 1;\n    }\n    l = 0;\n  }\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= m - 1; t++)\n    printf(\" %d\", a[t]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, flag;\n  int a[1000];\n  cin >> n;\n  a[0] = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      if (i > 1) {\n        printf(\" %d\", a[i]);\n      } else\n        cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 1, m, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  while (i <= n) {\n    scanf(\"%d\", &m);\n    a[i] = m;\n    i++;\n  }\n  int l = 1;\n  while (l <= n) {\n    if (l == 1)\n      printf(\"%d\", a[l]);\n    else {\n      j = 1;\n      k = 0;\n      while (j < l) {\n        if (a[l] == a[j])\n          k = k + 1;\n        j++;\n      }\n      if (k == 0)\n        cout << \" \" << a[l];\n    }\n    l++;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, j, m = 0, n = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 10000;\n      }\n    }\n  }\n  cout << a[1];\n  for (i = 2; i <= n - m; i++)\n    if (a[i] != 10000) {\n      printf(\" %d\", a[i]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int n;\n  cin >> n;\n\n  int i, k = 0, a[90], b[20000];\n\n  for (i = 0; i <= 89; i++)\n    a[i] = i + 10;\n\n  for (i = 0; i <= n - 1; i++)\n    cin >> b[i];\n\n  for (i = 0; i <= n - 1; i++) {\n    int j;\n    for (j = 0; j <= 89; j++) {\n      if (b[i] == a[j]) {\n        if (k == 0)\n          printf(\"%d\", a[j]);\n        else\n          cout << \" \" << a[j];\n        a[j] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[20000] = {0}, a[20000], i, n, j, flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n        continue;\n      }\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], b[100];\n  memset(b, 0, sizeof(b));\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  b[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (b[a[i]] == 0) {\n      cout << \" \" << a[i];\n      b[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100000], i, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = a[j];\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] != a[i])\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23706", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000] = {0};\n  int i, j, k, m = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, j = 0; i < n; i++, m = 0) {\n    for (k = j; k >= 0; k--) {\n      if (a[i] == b[k]) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s, k, l; \n  cin >> n;\n  int a[n], b[n]; \n  for (i = 0; i <= n - 1; i = i + 1) {\n    cin >> b[i]; \n    a[i] = 0;\n  }\n  for (i = n - 1, k = 0; i >= 1; i = i - 1) {\n    for (s = i - 1; s >= 0; s = s - 1) {\n      if (b[i] - b[s] == 0) {\n        a[i] = 1; \n        k = k + 1;\n        break;\n      }\n    }\n  }\n  if (n - k == 1)\n    cout << b[0];\n  else {\n    for (i = 0, l = 0; i <= n - 1; i = i + 1) {\n      if (a[i] == 0) {\n        l = l + 1;\n        if (l - n + k < 0)\n          cout << b[i] << \" \"; \n        else\n          cout << b[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23708", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[20000], i, num, count[20000] = {0};\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    num = a[i];\n    count[num]++;\n\n    if (i == 0)\n      cout << a[i];\n    else {\n      if (count[num] == 1)\n        cout << \" \" << num;\n    }\n  }\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, a[1000] = {0}, j, k, m;\n  cin >> n;\n  scanf(\"%d \", &a[1]);\n  for (i = 2, m = 2; m <= n; i++, m++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        break;\n      }\n    }\n  }\n  cout << a[1];\n  for (k = 2; k <= i - 1; k++)\n    cout << ' ' << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "23710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i = i + 1) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i = i + 1) {\n    s = 0;\n    if (i == 1)\n      printf(\"%d\", a[i - 1]);\n    else {\n      for (j = 0; j < i - 1; j = j + 1) {\n        s = (a[i - 1] == a[j]) ? s + 1 : s;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[20000] = {0}, a, i = 0, n, p = 0, j, k;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    scanf(\"%d\", &a);\n    for (j = 0, k = 0; j < i; j++) {\n      if (c[j] == a) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      c[p] = a;\n      p++;\n    }\n    i++;\n  }\n  for (j = 0; j < p; j++) {\n    printf(\"%d\", c[j]);\n    if (j < p - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int c[n];\n  scanf(\"%d\", &c[1]);\n  cout << c[1];\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &c[i]);\n    for (j = 1; j <= i - 1; j++) {\n      if (c[j] == c[i])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[100000], i, h = 1, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[h] = a[i];\n      h++;\n    }\n  }\n  for (i = 1; i <= h - 1; i++) {\n    if (i < h - 1)\n      cout << b[i] << \" \";\n    else if (i == h - 1)\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int flag = 0;\n  int i;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (shuzu[i] == shuzu[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      printf(\" %d\", shuzu[i]);\n    }\n    flag = 0;\n  }\n  free(shuzu);\n  return 0;\n}\n"}
{"label": "13", "index": "23715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, m, p = 0, l;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] == a[m])\n        break;\n    }\n    if (m == i) {\n      p = p + 1;\n      b[p] = a[i];\n    }\n  }\n  for (l = 1; l <= p; l++) {\n    if (l == p)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    j = 1;\n    scanf(\"%d\", &b);\n    for (t = 0; t < k; t++) {\n      if (b == a[t])\n        j = 0;\n    }\n    if (j == 1) {\n      a[k] = b;\n      k++;\n      if (k == 1)\n        printf(\"%d\", b);\n      else\n        cout << \" \" << b;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c, a[20000], n, i, l = 0, p, k = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    l = 0;\n    scanf(\"%d\", &c);\n    for (j = 0; j < k; j++) {\n      if (c == a[j])\n        l = l + 1;\n    }\n    if (l == 0) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        f++;\n    }\n    if (f == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[k - 1]);\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23719", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, a[20001];\n  cin >> n;\n\n  for (int i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (int j = 0; j <= n - 1; j++)\n    for (int k = n - 1; k >= j + 1; k--) {\n      if (a[j] == a[k])\n        a[k] = 0;\n    }\n  cout << a[0];\n  for (int m = 1; m <= n - 1; m++) {\n    if (a[m] != 0)\n      cout << \" \" << a[m];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n}\n"}
{"label": "13", "index": "23721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n        printf(\" \");\n        cout << a[i];\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23722", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[105], n, i;\n  for (i = 0; i < 101; i += 1)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &i);\n  a[i] = 1;\n  printf(\"%d\", i);\n  while (n-- > 1) {\n    scanf(\"%d\", &i);\n    if (a[i]) {\n      continue;\n    }\n    a[i] = 1;\n    printf(\" %d\", i);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 1, i = 0, n = 0, j = 0, k = 0;\n  cin >> m;\n  int a[20000] = {0};\n  scanf(\"%d \", &a[0]);\n  cout << a[0];\n  for (i = 1; i < m; i++) {\n    cin >> a[i];\n    k = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23724", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int num = 0;\n  int c = 1;\n  int j, i;\n  int b[100];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        c = 0;\n    }\n\n    if (c != 0) {\n      num = num + 1;\n      b[num] = a[i];\n    }\n    c = 1;\n  }\n\n  for (i = 1; i < num; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[num];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[200000], i, b[200000], j = 1, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = a[i];\n    j++;\n  }\n  printf(\"%d\", b[1]);\n  for (j = 2; j <= n; j++) {\n    d = 0;\n    for (i = 1; i <= j - 1; i++) {\n      if (b[j] == a[i])\n        d++;\n    }\n    if (d == 0)\n      printf(\" %d\", b[j]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[200000], i, b[200000], j = 1, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    b[j] = a[i];\n    j++;\n  }\n  printf(\"%d\", b[1]);\n  for (j = 2; j <= n; j++) {\n    d = 0;\n    for (i = 1; i <= j - 1; i++) {\n      if (b[j] == a[i]) {\n        d++;\n      }\n    }\n    if (d == 0)\n      printf(\" %d\", b[j]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[20001];\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &s[i]);\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == s[j]) {\n        s[i] = 0;\n        break;\n      };\n    };\n  };\n\n  for (i = 2; i <= n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  };\n}\n"}
{"label": "13", "index": "23728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b[101] = {0}, i;\n\n  cin >> n;\n  int a[20001] = {0};\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = b[a[i]] + 1;\n  }\n  cout << a[1];\n  b[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (b[a[i]] != 0)\n      cout << \" \" << a[i];\n    b[a[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23729", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[20001], used[200];\n  for (i = 0; i < 200; i++)\n    used[i] = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  used[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (used[a[i]])\n      continue;\n    cout << \" \" << a[i];\n    used[a[i]] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23730", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, p, q, m;\n  int a[20000];\n  int b[20000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  b[0] = 0;\n\n  for (j = 1; j < n; j++) {\n    b[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        b[j]++;\n    }\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (p = 1; p < n; p++) {\n    if (b[p] == 0)\n      printf(\" %d\", a[p]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100001], h, i, j;\n  char c;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    h = 0;\n    scanf(\"%d%c\", &a[i], &c);\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 1; j < i; j++)\n        if (a[j] == a[i]) {\n          h = 1;\n          break;\n        }\n      if (h == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n    }\n    if (k == i)\n      cout << \" \" << a[i];\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23733", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n;\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n        printf(\" \");\n        printf(\"%d\", a[i]);\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, t = 0;\n  scanf(\"%d \", &n);\n  int N[20000];\n  int M[90] = {0};\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &N[i]);\n  for (j = 0; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (N[j] == N[k]) {\n        break;\n      }\n    }\n    if (k == j) {\n      M[t] = N[j];\n      t++;\n    }\n  }\n  for (m = 0; m < t - 1; m++)\n    cout << M[m] << \" \";\n  cout << M[t - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= i; j++) {\n      if (i != 1 && a[j - 1] == a[i])\n        a[i] = 0;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (i != 1 && a[i] != 0)\n      printf(\" %d\", a[i]);\n    else if (i == 1)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, x;\n  int sz[20000];\n  scanf(\"%d\", &n);\n  cin >> sz[0];\n  printf(\"%d\", sz[0]);\n  for (i = 1; i < n; i++) {\n    cin >> sz[i];\n    x = 0;\n    for (k = 0; k < i; k++) {\n\n      if (sz[i] == sz[k]) {\n        break;\n      } else if (sz[i] != sz[k]) {\n        x++;\n      }\n      if (x == i)\n        printf(\" %d\", sz[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, n, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"\\n\");\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int check[100] = {0};\n  int n, i;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (check[a[i]] == 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else {\n        cout << \" \" << a[i];\n      }\n      check[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23739", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[91];\n  int i;\n  for (i = 0; i < 91; i++) {\n    a[i] = 0;\n  }\n  cin >> n;\n  cin >> i;\n  cout << i;\n  a[i - 10] = 1;\n  while (n > 0) {\n    n--;\n    int b;\n    cin >> b;\n    if (a[b - 10] == 0) {\n      cout << ' ' << b;\n      a[b - 10] = 1;\n    }\n  }\n}\n"}
{"label": "13", "index": "23740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j, m;\n  scanf(\"%d \", &n);\n  int a[20000] = {0};\n  cin >> t;\n  cout << t;\n  m = 1;\n  a[0] = t;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    for (j = 0; j < m; j++) {\n      if (a[j] == t)\n        break;\n    }\n    if (j >= m) {\n      printf(\" %d\", t);\n      a[m] = t;\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz1[20000], sz2[20000], i, j, n, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &sz1[i]);\n  }\n  sz2[0] = sz1[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (k = i - 1; k >= 0; k--) {\n      if (sz1[i] == sz2[k]) {\n        break;\n      }\n      if (k == 0) {\n        sz2[j] = sz1[i];\n        j = j + 1;\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++) {\n    if (i == j - 1) {\n      printf(\"%d\", sz2[i]);\n    } else\n      printf(\"%d \", sz2[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[20005], mark[100] = {0}, print = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    if (mark[a[i]] == 1)\n      continue;\n    else {\n      if (print)\n        printf(\" \");\n      cout << a[i];\n      print = 1;\n      mark[a[i]]++;\n    }\n  }\n  putchar(10);\n  return 0;\n}\n"}
{"label": "13", "index": "23743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000] = {'\\0'}, i = 0, j = 0, k = 0, temp, count;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &temp);\n    count = 0;\n    for (j = 0; j <= k; j++) {\n      if (temp == a[j])\n        break;\n      else\n        count++;\n    }\n    if (count == k + 1) {\n      k++;\n      a[k] = temp;\n    }\n  }\n  for (i = 1; a[i] != '\\0'; i++)\n    cout << \" \" << a[i];\n}\n"}
{"label": "13", "index": "23744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, b, c, d, i, a[20000] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> b;\n    a[i] = b;\n  }\n  cout << a[1];\n  for (c = 2; c <= n; c++) {\n    for (d = 0; d <= c - 1; d++) {\n      if (a[d] == a[c])\n        break;\n      else\n        continue;\n    }\n    if (d == c) {\n      cout << \" \" << a[c];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23745", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, i, now, sign;\n\n  scanf(\"%d\", &n);\n  sign = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &now);\n    if (a[now] == 0) {\n      a[now] = 1;\n      if (sign == 1)\n        printf(\" \");\n      else\n        sign = 1;\n      printf(\"%d\", now);\n    }\n  }\n  printf(\" \");\n  ;\n  return 0;\n}\n"}
{"label": "13", "index": "23746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++)\n\n  {\n    t = 0;\n    for (i = 0; i < j; i++) {\n      if (a[i] == a[j])\n        t = t + 1;\n      else\n        ;\n    }\n    if (t == 0)\n      cout << \" \" << a[j];\n    else\n      ;\n  }\n}\n"}
{"label": "13", "index": "23747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()                             \n{                                      \n  int n, num;                          \n  cin >> n;                            \n  int a[n];                            \n  for (num = 0; num <= (n - 1); num++) \n  {\n    cin >> a[num];\n  }                            \n  int i, k, q;                 \n  cout << a[0];                \n  for (k = 1; k <= n - 1; k++) \n  {\n    q = 0;                  \n    for (i = 0; i < k; i++) \n    {\n      if (a[k] == a[i]) {\n        q++;\n      } \n    }\n    if (q == 0) \n    {\n      cout << \" \" << a[k];\n    }\n  }\n  return 0; \n} \n"}
{"label": "13", "index": "23748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    j = 1;\n    scanf(\"%d\", &b);\n    for (t = 0; t < k; t++) {\n      if (b == a[t])\n        j = 0;\n    }\n    if (j == 1) {\n      a[k] = b;\n      k++;\n      if (k == 1)\n        cout << b;\n      else\n        cout << \" \" << b;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, x, m = 0, k = 0, t = 0;\n  cin >> n;\n  int shuzu[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    shuzu[i] = x;\n  }\n  for (m = 0; m < n; m++) {\n    if (m == 0) {\n      cout << shuzu[m];\n    } else {\n      for (k = 0; k < m; k++) {\n        if (shuzu[m] != shuzu[k])\n          t = 1;\n        else {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        cout << \" \" << shuzu[m];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], sum = 0, k = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (j == i)\n      k++;\n  }\n  if (k == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        printf(\"%d\\n\", a[i]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i) {\n        printf(\"%d\", a[i]);\n        t++;\n        if (t < k)\n          printf(\" \");\n        else\n          printf(\"\\n\");\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m = 1;\n  cin >> n;\n  int a[n];\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    m = 1;\n    for (int j = i - 1; j > 0; j--)\n      if (a[i] == a[j])\n        m = 0;\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    cout << a[0];\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (i == j && a[i] != a[i - 1])\n        printf(\" %d\", a[i]);\n    }\n    for (j = 0; j < n - 1; j++) {\n      if (a[n - 1] == a[j])\n        break;\n    }\n    if (n - 1 == j && a[n - 1] != a[n - 2])\n      printf(\" %d\", a[n - 1]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23753", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++) {\n        if (a[i] == a[j])\n          a[j] = -1;\n      }\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << a[i];\n    }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, x, m = 0, k = 0, t = 0;\n  scanf(\"%d \", &n);\n  int shuzu[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    shuzu[i] = x;\n  }\n  for (m = 0; m < n; m++) {\n    if (m == 0)\n      printf(\"%d\", shuzu[m]);\n    else {\n      for (k = 0; k < m; k++) {\n        if (shuzu[m] != shuzu[k])\n          t = 1;\n        else {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        cout << \" \" << shuzu[m];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint BT(int x, int a[40000]) {\n  int b = 0, c = 0;\n  while (b < 40000) {\n    if (a[b] == x) {\n      c = 1;\n      break;\n    } else\n      b++;\n  }\n  return c;\n}\nint main() {\n  int n, a[40000], i, b[40000], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < 10001; i++)\n    b[i] = -1;\n  for (i = 0, c = 0; i < n; i++)\n    if (BT(a[i], b) == 0) {\n      if (c == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n      b[c] = a[i];\n      c++;\n    }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[101];\n  int b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    { scanf(\"%d\", &b); }\n    if (a[b] == 1) {\n      a[b] = 1;\n    } else {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", b);\n      a[b] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j, b = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (b = 0, j = 1; j < i; j++) {\n      if (a[i] != a[j])\n        b = b + 1;\n    }\n    if (b == i - 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[20001], i, j, b[20001] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (k = n; k > 0; k--)\n    if (b[k] == 0)\n      break;\n  for (i = 1; i < k; i++)\n    if (b[i] == 0)\n      cout << a[i] << ' ';\n  cout << a[k];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0};\n  cin >> n;\n  int count = n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      for (int j = i + 1; j <= n; j++)\n        if (a[j] == a[i]) {\n          a[j] = 0;\n          count -= 1;\n        }\n    }\n  }\n  if (count > 1) {\n    int i;\n    for (i = 1; i <= n; i++) {\n      if (a[i] != 0) {\n        cout << a[i] << ' ';\n        count--;\n      }\n      if (count == 1)\n        break;\n    }\n    for (i = i + 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  } else\n    for (int i = 1; i <= n; i++)\n      if (a[i] != 0)\n        cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long i, n, x;\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[x] = 1;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (a[x] == 0) {\n      printf(\" %d\", x);\n      a[x] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> shuzu[i];\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (j < i - 1) {\n        if (shuzu[i] == shuzu[j]) {\n          break;\n        }\n      }\n      if (j == i - 1) {\n        if (shuzu[i] != shuzu[j])\n          cout << \" \" << shuzu[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j = 2, m;   \n  int a[20010], b[100]; \n  cin >> n;             \n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    for (m = 1; m <= i - 1; m++) {\n      if (a[m] == a[i])\n        break; \n    }\n    if (m == i) {\n      b[j] = a[i];\n      j++;\n    } \n  }\n  for (i = 1; i <= j - 1; i++) {\n    if (i < j - 1) {\n      cout << b[i] << \" \";\n    } else\n      cout << b[i];\n  } \n  return 0;\n}\n"}
{"label": "13", "index": "23763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (j < i - 1) {\n        if (shuzu[i] == shuzu[j]) {\n          break;\n        }\n      }\n      if (j == i - 1) {\n        if (shuzu[i] != shuzu[j])\n          cout << \" \" << shuzu[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0;\n  scanf(\"%d\", &n);\n  int x[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &x[i]);\n    for (k = 0; k < i; k++) {\n      if (x[k] == x[i]) {\n        i--;\n        n--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i < n; i++) {\n    cout << \" \" << x[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, x = 0, a[100] = {0}, i = 0;\n  cin >> n;\n  cin >> x;\n  cout << x;\n  a[x - 1] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> x;\n    if (a[x - 1] == 0) {\n      printf(\" %d\", x);\n      a[x - 1] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20001], count[101] = {0};\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    count[a[i]]++;\n  }\n  cout << a[1];\n  count[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (count[a[i]] >= 1) {\n      cout << \" \" << a[i];\n      count[a[i]] = 0;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100];\n  for (int i = 2; i <= 100; i++) {\n    a[i] = 0;\n  }\n  int n;\n  cin >> n;\n  int b;\n  cin >> b;\n  cout << b;\n  a[b] = 1;\n  for (int i = 2; i <= n; i++) {\n    \n    cin >> b;\n    if (a[b] == 0) {\n      a[b] = 1;\n      cout << ' ' << b;\n    }\n  }\n}\n"}
{"label": "13", "index": "23768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  int count1, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    count1 = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        count1 = 1;\n        break;\n      }\n    }\n    if (count1 == 0) {\n      if (j == 0)\n        printf(\"%d\", a[0]);\n      else\n        printf(\" %d\", a[j]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, s[20000], ct = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d\", &c);\n    s[b] = c;\n    d = 0;\n    for (e = 1; e <= b - 1; e++) {\n      if (s[b] == s[e])\n        d = 1;\n    }\n    if (d == 0) {\n      if (ct == 1)\n        printf(\" \");\n      printf(\"%d\", s[b]);\n      ct = 1;\n    }\n  }\n  return 100;\n}\n"}
{"label": "13", "index": "23770", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, count[101] = {0}, num;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    if (count[num] == 0)\n      if (i == 1) {\n        cout << num;\n      } else\n        printf(\" %d\", num);\n    count[num]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n  for (int j = 1; j < n; j++) {\n    l = 0;\n    for (int k = j - 1; k >= 0; k--) {\n      if (a[j] != a[k])\n        l = l;\n      else\n        l = l + 1;\n    }\n    if (l == 0)\n      cout << \" \" << a[j];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, i, d, j;\n  int a[20001];\n  cin >> h;\n  for (i = 1; i <= h; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= h; i++) {\n    d = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int all, name[20000], input[20000], i, p, count, judge;\n  scanf(\"%d\", &all);\n  count = 0;\n  for (i = 0; i < all; i++) {\n    name[i] = 0;\n  }\n  for (i = 0; i < all; i++) {\n    scanf(\"%d\", &input[i]);\n  }\n  for (i = 0; i < all; i++) {\n    judge = 0;\n    for (p = 0; p < count; p++) {\n      if (name[p] == input[i]) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 1) {\n      continue;\n    }\n    name[count] = input[i];\n    count++;\n  }\n  printf(\"%d\", name[0]);\n  for (i = 1; i < count; i++) {\n    printf(\" %d\", name[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t = 1, sum, n;\n  scanf(\"%d\", &n);\n  int x[20000], y[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  x[0] = y[0];\n  int k = 0;\n  for (i = 1; i < n; i++) {\n    sum = 1;\n    for (j = 0; j <= k; j++)\n      sum = sum * (y[i] - x[j]);\n    if (sum != 0) {\n      x[k + 1] = y[i];\n      k++;\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= k; i++)\n    printf(\" %d\", x[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, cn; \n  cin >> n;           \n  int a[n];           \n  cn = 0;\n  for (i = 0; i < n; i++) \n  {\n    cin >> k;                 \n    for (j = 0; j <= cn; j++) \n      if (a[j] == k)\n        break;       \n    if (j == cn + 1) \n    {\n      a[cn] = k;\n      cn++; \n    }\n  }\n  for (i = 0; i < cn - 1; i++) \n    cout << a[i] << \" \";\n  cout << a[cn - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100];\n  for (int i = 2; i <= 100; i++) {\n    a[i] = 0;\n  }\n  int n;\n  cin >> n;\n  int b;\n  cin >> b;\n  cout << b;\n  a[b] = 1;\n  for (int i = 2; i <= n; i++) {\n\n    scanf(\"%d \", &b);\n    if (a[b] == 0) {\n      a[b] = 1;\n      cout << ' ' << b;\n    }\n  }\n}\n"}
{"label": "13", "index": "23777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      t = 0;\n      if (a[i] == a[j]) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, b[91] = {0}, i, k, counter = 0,\n         temp; \n               \n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    cin >> temp;\n    for (k = 0; k < 91; k++) \n    {\n      if (b[k] == temp) \n        break;\n    }\n    if (k >= 91) \n    {\n      b[counter] = temp;\n      counter++; \n    }\n  }\n  for (k = 0; k < counter - 1; k++) \n  {\n    cout << b[k] << \" \";\n  }\n  cout << b[counter - 1] << endl; \n  return 0;\n}\n"}
{"label": "13", "index": "23779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int i, n, p;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &p);\n  cout << p;\n  a[p]++;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &p);\n    if (a[p] == 0) {\n      cout << \" \" << p;\n      a[p]++;\n    }\n  }\n  return 7;\n}\n"}
{"label": "13", "index": "23780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        f = 0;\n        break;\n      }\n    }\n    if (f == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++)\n    cout << b[i] << \" \";\n\n  printf(\"%d\", b[k - 1]);\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "23781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint check(int b[], int len, int x) {\n  int i, flag = 1;\n  for (i = 0; i < len; i++) {\n    if (b[i] == x) {\n      flag = 0;\n      return 0;\n      break;\n    }\n  }\n  if (flag)\n    return 1;\n}\nint main() {\n  int j, i, n;\n  int a[20100], b[20100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  b[0] = a[0];\n  j = 1;\n  for (i = 1; i < n; i++) {\n    if (check(b, j, a[i])) {\n      cout << \" \" << a[i];\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, c, b = 1;\n  cin >> N;\n  int a[20001];\n  for (int i = 1; i <= N; i++)\n    cin >> a[i];\n  for (int m = 2; m <= N; m++) {\n    for (c = 1; c <= b; c++) {\n      if (a[m] == a[c])\n        break;\n    }\n    if (c == b + 1) {\n      b++;\n      a[b] = a[m];\n    }\n  }\n  cout << a[1];\n  for (int d = 2; d <= b; d++) {\n    printf(\" %d\", a[d]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, q = 1, k;\n  int sz[20000], jieguo[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  jieguo[0] = sz[0];\n  for (int i = 1; i <= n; i++) {\n    k = 0;\n    for (int j = 0; j < q; j++) {\n      if (jieguo[j] == sz[i]) {\n        break;\n      } else {\n        k += 1;\n      }\n    }\n    if (k == q) {\n      jieguo[q] = sz[i];\n      q += 1;\n    }\n  }\n  for (int i = 0; i < q - 1; i++) {\n    if (i != q - 2) {\n      printf(\"%d \", jieguo[i]);\n    } else {\n      cout << jieguo[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, l, i, j, x;\n  scanf(\"%d\", &n);\n  l = 0;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    for (i = (j + 1); i < n; i++) {\n      if (a[j] == a[i])\n        a[i] = '*';\n    }\n  }\n  if (a[n - 1] != '*') {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] != '*')\n        printf(\"%d \", a[i]);\n    }\n    cout << a[n - 1];\n  } else {\n    for (i = n - 1; i > 0; i--) {\n      if (a[i] == '*')\n        l = l + 1;\n      else\n        break;\n    }\n    for (j = 0; j < n - l - 1; j++) {\n      if (a[j] != '*')\n        printf(\"%d \", a[j]);\n    }\n    printf(\"%d\", a[n - l - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b = 0, m, c[91] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0, m = 0; i < n; i++) {\n    b = 0;\n    scanf(\"%d\", &a);\n    for (j = 0; j < 91; j++) {\n      if (c[j] == a) {\n        b = 1;\n      }\n    }\n    if (b == 0) {\n      c[m] = a;\n      m = m + 1;\n    }\n  }\n  cout << c[0];\n  for (i = 1; i < m; i++)\n    cout << \" \" << c[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int n, i, j, l, k;\n  scanf(\"%d \", &n);\n  l = n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < l - 1; i++) {\n    for (j = i + 1; j < l; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < l - 1; k++)\n          a[k] = a[k + 1];\n        j--;\n        l--;\n      }\n    }\n  }\n  cout << a[0];\n\n  for (i = 1; i < l; i++)\n    cout << ' ' << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 1, sum, n;\n  cin >> n;\n  int x[20000], y[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  x[0] = y[0];\n  int k = 0;\n  for (i = 1; i < n; i++) {\n    sum = 1;\n    for (j = 0; j <= k; j++)\n      sum = sum * (y[i] - x[j]);\n    if (sum != 0) {\n      x[k + 1] = y[i];\n      k++;\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= k; i++)\n    printf(\" %d\", x[i]);\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  unsigned int n;\n  int i, j, a[20000], m;\n  scanf(\"%u\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        m = 1;\n        break;\n      }\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int shuru[100000];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &shuru[i]);\n    if (getchar() == '\\n')\n      break;\n    else\n      continue;\n  }\n  cout << shuru[0];\n\n  for (int i = 1; i < n; i++) {\n    int jishu = 0;\n    for (int j = 0; j < i; j++) {\n      if (shuru[i] == shuru[j])\n        break;\n      else {\n        jishu++;\n      }\n    }\n    if (jishu == i)\n      cout << ' ' << shuru[i];\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23790", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, j, k, m = 0, n, b = 0, c = 1;\n  cin >> n;\n  k = n;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        k -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && c < k) {\n      printf(\"%d \", a[i]);\n      c += 1;\n    } else {\n      if (a[i] != 0 && c == k) {\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, n, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << \"\\n\";\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int n, i, j, l, k;\n  scanf(\"%d \", &n);\n  l = n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < l - 1; i++) {\n    for (j = i + 1; j < l; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < l - 1; k++)\n          a[k] = a[k + 1];\n        j--;\n        l--;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < l; i++)\n    cout << ' ' << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23793", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[12683], b[12683];\n  int i, j, n, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[i] = 1;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j]) {\n        b[j] = 0;\n        break;\n      } else\n        b[j] = 1;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] == 1) {\n      printf(\" \");\n      printf(\"%d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] != a[i]) {\n        k = k + 1;\n      }\n      if (a[j] == a[i]) {\n        k = 0;\n        break;\n      }\n    }\n\n    if (k != 0) {\n      printf(\" %d\", a[i]);\n      k = 0;\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23795", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20002];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n\n    if (j == i) {\n      cout << \" \" << a[i];\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "23796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[0]);\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        if (a[j] == a[i]) {\n          a[i] = 0;\n          break;\n        }\n      }\n      if (a[i]) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23797", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[100], k, b[100], j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n\n    if (a[k] == 0) {\n      b[j] = k;\n      j++;\n    }\n    a[k] = 1;\n  }\n  for (i = 1; i < (j - 1); i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int a[10000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      k = 0;\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          k = 1;\n        }\n      }\n      if (k == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23799", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, j, m, k, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < k; i++) {\n    for (j = 0, m = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        n = 0;\n      else\n        n = 1;\n      m = m * n;\n    }\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], j, temp;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &temp);\n    if (i == 1) {\n      j = 0;\n      printf(\"%d\", temp);\n      a[j] = temp;\n    } else {\n      int c = 0;\n      for (int k = 0; k <= j; k++) {\n        if (a[k] == temp)\n          c++;\n      }\n      if (c == 0) {\n        printf(\" %d\", temp);\n        j++;\n        a[j] = temp;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int k;\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n      else\n        break;\n    }\n    if (k == i)\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000], flag[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag[i] = 1;\n    }\n    if (flag[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23803", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int j, tag = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    tag = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        tag++;\n    }\n    if (tag == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23804", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j;\n  cin >> n;\n  int a[n];\n  int i = 0;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (((j == i) && (a[i] != a[i - 1])) == 1)\n      cout << \" \" << a[i];\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, m, b, a[20000];\n  i = 0;\n  cin >> n;\n  for (; i <= n - 1; i++) {\n    if (i < n - 1)\n      scanf(\"%d \", &a[i]);\n    else\n      scanf(\"%d\\n\", &a[i]);\n  }\n  for (j = 0; j < n; j++) {\n    if (j == 0)\n      printf(\"%d\", a[j]);\n    else {\n      for (m = 0, b = 0; m < j; m++) {\n        if (a[j] == a[m])\n          b++;\n      }\n      if (b == 0)\n        printf(\" %d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, m, r;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    r = 0;\n    scanf(\"%d\", &a[i]);\n    for (m = 1; m < i; m++) {\n      if (a[i] == a[m])\n        r++;\n    }\n    if (r == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], b[100];\n  memset(b, 0, sizeof(b));\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  b[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (b[a[i]] == 0) {\n      cout << \" \" << a[i];\n      b[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d \", &m);\n  int a[m];\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        break;\n    if (j == i) {\n      if (j == 0)\n        cout << a[i];\n      else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23809", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, k, n, count = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 1, k = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      a[k] = a[i];\n      k++;\n      count++;\n    }\n  }\n  cout << a[0];\n  for (k = 1; k <= count; k++)\n    cout << \" \" << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "23810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, p = 0;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      printf(\"%d\", a[0]);\n    } else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          p += 1;\n      }\n      if (p == 0) {\n        printf(\" %d\", a[i]);\n      }\n      p = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[100], k, b[100], j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n\n    if (a[k] == 0) {\n      b[j] = k;\n      j++;\n    }\n    a[k] = 1;\n  }\n  for (i = 1; i < (j - 1); i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int a[10000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      k = 0;\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          k = 1;\n        }\n      }\n      if (k == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l = 0, g = 0, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    for (i = n - 1; i >= 0; i--) {\n      if (a[n - 1] == a[i])\n        k++;\n    }\n    if (k == n)\n      printf(\"%d\", a[0]);\n    else {\n      printf(\"%d \", a[0]);\n      for (i = 1; i < n; i++) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] != a[j])\n            l++;\n        }\n        if (l == i) {\n          b[g] = a[i];\n          g++;\n        }\n        l = 0;\n      }\n      for (i = 0; i < g - 1; i++)\n        cout << b[i] << \" \";\n\n      printf(\"%d\", b[g - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, I, n, j;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (I = 1; I < n; I++) {\n    for (i = 0; i < I; i++) {\n      if (a[I] == a[i]) {\n        a[I] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] != 0) {\n          a[i] = a[j];\n          a[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - k - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23815", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n + 1];\n  a[n] = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  if (a[i] != 0)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j = j + 1) {\n    for (k = 0; k < j; k = k + 1) {\n      if (a[j] == a[k])\n        h = 1;\n    }\n    if (h == 0) {\n      printf(\" %d\", a[j]);\n    }\n\n    else {\n      h = 0;\n    }\n  }\n}\n"}
{"label": "13", "index": "23817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    if (i > 0) {\n      for (int k = 0; k < i; k++) {\n        if (num[i] == num[k])\n          num[i] = 0;\n      }\n    }\n  }\n  cout << num[0];\n  for (i = 1; i < n; i++) {\n    if (num[i] > 9)\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = k + 1;\n    }\n    if (k == 0)\n      cout << \" \" << a[i];\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    } else if (m == 0 && k != 0) {\n      b[k] = a[0];\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  cout << b[0];\n  return 0;\n}\n"}
{"label": "13", "index": "23820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, k, l;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i <= n - 1; i = i + 1) {\n    cin >> b[i];\n    a[i] = 0;\n  }\n  for (i = n - 1, k = 0; i >= 1; i = i - 1) {\n    for (s = i - 1; s >= 0; s = s - 1) {\n      if (b[i] - b[s] == 0) {\n        a[i] = 1;\n        k = k + 1;\n        break;\n      }\n    }\n  }\n  if (n - k == 1)\n    cout << b[0];\n  else {\n    for (i = 0, l = 0; i <= n - 1; i = i + 1) {\n      if (a[i] == 0) {\n        l = l + 1;\n        if (l - n + k < 0)\n          cout << b[i] << \" \";\n        else\n          printf(\"%d\", b[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  register int i, j, flag;\n  int n;\n  flag = 0;\n  char str1[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &str1[i - 1]);\n    if (i >= 2) {\n      flag = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (str1[i - 1] == str1[j - 1]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        printf(\" %d\", str1[i - 1]);\n\n    } else {\n      printf(\"%d\", str1[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, w[200];\n  cin >> n;\n  memset(w, 0, sizeof(w));\n  for (int i = 0; i < n; i++) {\n    cin >> k;\n    if (!w[k]) {\n      if (i)\n        cout << ' ';\n      w[k] = 1;\n      cout << k;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23823", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, q = 0, a[20000];\n  cin >> n;\n  for (i = 0; i < n - q; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        q++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n - q - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - q - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[20001];\n  memset(num, 0, 20001);\n  int i, j;\n  int count = 1;\n  int number;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &number);\n    if (i == 1) {\n      num[0] = number;\n    } else {\n      for (j = 1; j <= count; j++) {\n        if (number == num[j - 1]) {\n          break;\n        } else {\n        }\n        if (j == count) {\n          count++;\n          num[count - 1] = number;\n        } else {\n        }\n      }\n    }\n  }\n  for (i = 1; i < count; i++)\n    cout << num[i - 1] << \" \";\n\n  cout << num[count - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  int a[N], b[N];\n  int i, j, k, n, m = 0, flag;\n  for (i = 0; i <= N; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < N; i++) {\n    flag = 1;\n    for (j = 1; j <= m; j++)\n      if (a[i] == b[j]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[j] = a[i];\n      m++;\n    }\n  }\n  printf(\"%d\", b[1]);\n  for (i = 2; i <= m; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "23826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k = 0, num;\n  int a[100] = {0}, b[100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    if (a[num] == 0) {\n      a[num]++;\n      b[k] = num;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[50000];\n  int b[20001];\n  scanf(\"%d \", &n);\n\n  scanf(\"%s \", a);\n  k = strlen(a);\n  i = 0;\n  j = 1;\n  while (i <= k - 1) {\n    b[j] = (a[i] - 48) * 10 + (a[i + 1] - 48);\n    i = i + 3;\n    j = j + 1;\n  }\n  j = j - 1;\n  printf(\"%d\", b[1]);\n  i = 2;\n  while (i <= j) {\n    m = 1;\n    while (m < i) {\n      if (b[i] == b[m])\n        break;\n      m = m + 1;\n    }\n    if (m == i)\n      cout << \" \" << b[i];\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23828", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] == b[j])\n        b[j] = 0;\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      cout << ' ' << b[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, s[200001] = {0}, k[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    k[s[i]]++;\n  }\n  int flag[100] = {0};\n  for (int i = 0; i < n; i++) {\n    if (k[s[i]] == 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        printf(\"%d\", s[i]);\n      if (i != 0)\n        cout << \" \" << s[i];\n    }\n    if (k[s[i]] != 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        printf(\"%d\", s[i]);\n      if (i != 0)\n        cout << \" \" << s[i];\n      flag[s[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23830", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, flag[91] = {0}, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  flag[a[0] - 10] = 1;\n  for (i = 0; i < n; i++) {\n    if (flag[a[i] - 10] == 0) {\n      cout << ' ' << a[i];\n      flag[a[i] - 10] = 1;\n\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23831", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n, r = 0, s = 0;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n - 1; i > 0; i--)\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        a[i] = -1;\n        r++;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != -1) {\n      if (s != n - r - 1) {\n        cout << a[i] << \" \";\n        s++;\n      } else\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int b[100];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      if (i > 0)\n        cout << \" \";\n      cout << a[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int histgram[101];\n  int i;\n  int x;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    histgram[i] = 0;\n  }\n\n  scanf(\"%d\", &x);\n  histgram[x]++;\n  cout << x;\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &x);\n    if (!histgram[x])\n      printf(\" %d\", x);\n\n    histgram[x]++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if (p)\n        printf(\" \");\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23835", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[20001], sum = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (num[i] == 101)\n        break;\n      if (num[j] == num[i])\n        num[j] = 101;\n    }\n\n  for (int i = 0; i < n; i++) {\n    if (num[i] == 101 && num[i + 1] != 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n    } else if (num[i] == 101 && num[i + 1] == 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n      i--;\n    }\n  }\n  for (int i = 0; i < n - sum - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  printf(\"%d\", num[n - sum - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, count = 0, a[20000];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == a[i])\n        count++;\n    }\n    if (count == 0)\n      printf(\" %d\", a[i]);\n    else\n      count = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001], i, j, k, m = 0, n = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 10000;\n      }\n    }\n  }\n  cout << a[1];\n  for (i = 2; i <= n - m; i++)\n    if (a[i] != 10000) {\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "23838", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], k = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (j == i)\n      k++;\n  }\n  if (k == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        printf(\"%d\\n\", a[i]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i) {\n        printf(\"%d\", a[i]);\n        t++;\n        if (t < k)\n          printf(\" \");\n        else\n          printf(\"\\n\");\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++)\n      if (a[j] == a[k])\n        break;\n    if (k == j)\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", p + i);\n  }\n  printf(\"%d\", *p);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (*(p + i) == *(p + j))\n        break;\n      else\n        j++;\n    }\n    if (j == i)\n      printf(\" %d\", *(p + i));\n  }\n}\n"}
{"label": "13", "index": "23841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j, k, flag = 0;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      cin >> a[i];\n      if (a[i] < 10 || a[i] >= 100)\n        scanf(\"%d\", &a[i]);\n      else\n        continue;\n    }\n    printf(\"%d\", a[0]);\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < j; k++) {\n        if (a[j] == a[k]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        cout << \" \" << a[j];\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, *a, *b, i, j, flag = 0;\n  scanf(\"%d\\n\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] == a[j])\n        b[i] = b[i] + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (b[j] == 0)\n        flag = flag + 1;\n    }\n    if (b[i] == 0) {\n      printf(\"%d\", a[i]);\n      if (flag > 1)\n        printf(\" \");\n    }\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, j = 0, i = 0, k = 0, a[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] <= 100 && a[i] >= 10) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          i = i - 1;\n          n = n - 1;\n        }\n      }\n    } else {\n      i = i - 1;\n      n = n - 1;\n    }\n  }\n  for (k = 0; k < n - 1; k++) {\n    printf(\"%d \", a[k]);\n  }\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000] = {0}, t[10000] = {0}, s, b, c, k = 0, i = 0, n;\n  scanf(\"%d\", &n);\n  printf(\"\\n\");\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    for (b = 0, c = 0; b <= i - 1; b++)\n      if (a[i] == a[b])\n        c = c + 1;\n    if (c == 0) {\n      t[k] = a[i];\n      k++;\n    }\n  }\n  if (k == 0)\n    printf(\"%d\", a[0]);\n  if (k > 0) {\n    printf(\"%d \", a[0]);\n    for (s = 0; s <= k - 2; s++)\n      printf(\"%d \", t[s]);\n    printf(\"%d\", t[k - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, s, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    s = a[i];\n    for (k = i + 1; k < n; k++) {\n      if (a[k] == s) {\n        for (j = k; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000] = {0};\n  int n, c, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &c);\n  a[0] = c;\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &c);\n    a[i] = c;\n    for (j = 0; j <= i - 1; j++) {\n      if (c == a[j]) {\n        a[i] = 0;\n      }\n    }\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[91];\n  int i, n, number;\n  cin >> n;\n  memset(a, 0, sizeof(a));\n  cin >> number;\n  a[number - 10]++;\n  if (a[number - 10] == 1)\n    cout << number;\n  for (i = 1; i < n; i++) {\n    cin >> number;\n    a[number - 10]++;\n    if (a[number - 10] == 1)\n      cout << \" \" << number;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (s[j] == s[i])\n        s[i] = 0;\n    }\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23849", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000] = {0}, t[10000] = {0}, s, b, c, k = 0, i = 0, n;\n  scanf(\"%d\", &n);\n  printf(\"\\n\");\n  cin >> a[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    for (b = 0, c = 0; b <= i - 1; b++)\n      if (a[i] == a[b])\n        c = c + 1;\n    if (c == 0) {\n      t[k] = a[i];\n      k++;\n    }\n  }\n  if (k == 0)\n    printf(\"%d\", a[0]);\n  if (k > 0) {\n    printf(\"%d \", a[0]);\n    for (s = 0; s <= k - 2; s++)\n      printf(\"%d \", t[s]);\n    printf(\"%d\", t[k - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23850", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[100000], b[100000] = {0};\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == 0) {\n\n        if (i != j) {\n\n          if (a[i] == a[j]) {\n            b[j] = 1;\n          }\n        } else\n          continue;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      printf(\" \");\n      printf(\"%d\", a[i]);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (flag == 0)\n      cout << a[0];\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n      if (j == i - 1 && a[j] != a[i]) {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100000], a[100], n, i, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 100; i++) {\n    a[i] = 1;\n  }\n  scanf(\"%d\", &sz[0]);\n  cout << sz[0];\n  a[sz[0]] = 0;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    d = sz[i];\n    if (a[d] != 0) {\n      cout << \" \" << sz[i];\n    }\n\n    a[d] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        b[i]++;\n        break;\n      }\n  for (i = 1; i < n; i++)\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "23854", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, a[20001];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    a[i - 1] = num;\n    if (i == 1)\n      cout << num;\n    else {\n      int j = 0;\n      while (j < i - 1) {\n        if (a[j] == num)\n          break;\n        else\n          j++;\n      }\n      if (j == i - 1)\n        cout << \" \" << num;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], t, j, m, i, asd;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      cout << a[i];\n    } else if (i != 0) {\n      for (j = 0; j < i; j++) {\n        asd = a[i] - a[j];\n        if (asd == 0) {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        cout << \" \" << a[i];\n    }\n  }\n\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        j--;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, k, i, j, l;\n  int s[12000];\n  scanf(\"%d\", &n);\n  m = n;\n  l = 0;\n  for (i = 1; i <= n; i++) {\n    l++;\n    scanf(\"%d\", &s[l]);\n    for (j = 1; j <= l - 1; j++)\n      if (s[j] == s[l]) {\n        l--;\n        m--;\n      }\n  }\n  for (i = 1; i <= m - 1; i++)\n    printf(\"%d \", s[i]);\n  printf(\"%d\", s[m]);\n}\n"}
{"label": "13", "index": "23858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100001], b[100001];\n  int i, j, step = 1;\n  int n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  b[step] = a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= step; j++) {\n      if (a[i] == b[j])\n        break;\n    }\n    if (j == step + 1) {\n      step++;\n      printf(\" %d\", a[i]);\n      b[step] = a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] == b[j])\n        b[j] = 0;\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      cout << ' ' << b[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23860", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, m = 1;\n  cin >> n; \n  int a[n];\n  for (i = 1; i <= n; i++) \n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    m = 1; \n    for (int j = i - 1; j > 0; j--)\n      if (a[i] == a[j])\n        m = 0;\n    if (m == 1)\n      cout << ' ' << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, hash[30000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    hash[i] = 1;\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        hash[i] = hash[i] * 0;\n      } else {\n        hash[i] = hash[i];\n      }\n    }\n  }\n  for (i = 2; i <= n; i++) {\n    if (hash[i] == 1)\n      cout << \" \" << a[i];\n  }\n  int b;\n  cin >> b;\n  return 0;\n}\n"}
{"label": "13", "index": "23862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t, p;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    p = 0;\n    t = 0;\n    do {\n      if (a[i] == a[p])\n        t = 1;\n      p += 1;\n    } while (t == 0 && p < i);\n    if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= i; j++) {\n      if (i != 1 && a[j - 1] == a[i])\n        a[i] = 0;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (i != 1 && a[i] != 0)\n      cout << \" \" << a[i];\n    else if (i == 1)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[101];\n  int b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    { scanf(\"%d\", &b); }\n    if (a[b] == 1)\n      a[b] = 1;\n    else {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", b);\n      a[b] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], k, j, b, c, d, e, f, i;\n  scanf(\"%d\", &b);\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < b; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j])\n        break;\n    }\n    if (k == j)\n      printf(\" %d\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, s[20000], ct = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++) {\n    cin >> c;\n    s[b] = c;\n    d = 0;\n    for (e = 1; e <= b - 1; e++) {\n      if (s[b] == s[e])\n        d = 1;\n    }\n    if (d == 0) {\n      if (ct == 1)\n        printf(\" \");\n      cout << s[b];\n      ct = 1;\n    }\n  }\n  return 100;\n}\n"}
{"label": "13", "index": "23867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k, n, x, sum;\n  scanf(\"%d\", &n);\n  k = 0;\n  sum = 0;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    k = 0;\n    cin >> x;\n    for (j = 0; j < i; j++)\n      if (x == a[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      a[i - sum] = x;\n    else\n      sum++;\n  }\n  for (i = 0; i < n - sum - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "23868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b = 0, m = 0, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      m = m + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = k + 1;\n    if (a[i] != 0 && k < m)\n      printf(\"%d \", a[i]);\n    if (a[i] != 0 && k == m)\n      printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23869", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20001], count[101] = {0};\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    count[a[i]]++;\n  }\n  cout << a[1];\n  count[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (count[a[i]] >= 1) {\n      cout << \" \" << a[i];\n      count[a[i]] = 0;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, k, j, l, m, bn;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  m = 0;\n  for (j = 1; j < n; j++) {\n    for (k = 0, l = 1; k < j; k++) {\n      if (a[j] == a[k]) {\n        l = 0;\n        break;\n      }\n    }\n    if (l != 0) {\n      m += 1;\n      b[m] = a[j];\n    }\n  }\n  for (bn = 0; bn < m; bn++) {\n    printf(\"%d \", b[bn]);\n  }\n  printf(\"%d\", b[m]);\n}\n"}
{"label": "13", "index": "23871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int count[100] = {0}, num[90] = {0};\n  int i = 1, a, j = 0;\n  for (i; i <= n; i++) {\n    cin >> a;\n    if (count[a] == 0) {\n      num[j] = a;\n      j += 1;\n    }\n    count[a] = count[a] + 1;\n  }\n  i = 0;\n  for (i; i < j - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  printf(\"%d\\n\", num[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint BT(int x, int a[40000]) {\n  int b = 0, c = 0;\n  while (b < 40000) {\n    if (a[b] == x) {\n      c = 1;\n      break;\n    } else\n      b++;\n  }\n  return c;\n}\nint main() {\n  int n, a[40000], i, b[40000], c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < 10001; i++)\n    b[i] = -1;\n  for (i = 0, c = 0; i < n; i++)\n    if (BT(a[i], b) == 0) {\n      if (c == 0) {\n        printf(\"%d\", a[i]);\n      } else\n        printf(\" %d\", a[i]);\n      b[c] = a[i];\n      c++;\n    }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"\\n\");\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, flag[91] = {0}, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  cout << a[0];\n  flag[a[0] - 10] = 1;\n  for (i = 0; i < n; i++) {\n    if (flag[a[i] - 10] == 0) {\n      cout << ' ' << a[i];\n      flag[a[i] - 10] = 1;\n\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d\", &a[i]);\n  for (i = (n - 1); i >= 0; i--) {\n    for (k = i - 1; k >= 0; k--)\n      if ((a[i] - a[k]) == 0) {\n        a[i] = 0;\n        break;\n      }\n  }\n  if (a[0] > 9)\n    printf(\"%d\", a[0]);\n  for (i = 1; i <= (n - 1); i++) {\n    if (a[i] > 9)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      if (i != 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20001] = {0};\n  for (i = 1; i <= n; i++)\n    cin >> num[i];\n  cout << num[1];\n  for (i = 2; i <= n; i++) {\n    int k = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (num[i] == num[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 0, t = 0, p = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 0; t <= i - 1; t++) {\n      if (a[i] == a[t])\n        p++;\n    }\n\n    if (p != 0)\n      a[i] = 0;\n    p = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (t = i + 1; t <= n - 1; t++) {\n    if (a[t] != 0)\n      cout << \" \" << a[t];\n  }\n}\n"}
{"label": "13", "index": "23879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, a[20000], sign;\n  int b[20000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (i = 0; i < s; i++) {\n    if (i != s - 1)\n      (printf(\"%d \", b[i]));\n    else\n      printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l, f, m, k, t = 0;\n  scanf(\"%d\", &n);\n  int x[n], y, z[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &x[i]);\n    z[i] = 0;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    f = 0;\n    for (l = 0; l <= j - 1; l++) {\n      y = x[j] - x[l];\n      if (y == 0) {\n        f = 1;\n      }\n    }\n    if (f == 0) {\n      z[t] = x[j];\n      t += 1;\n    }\n  }\n  for (m = 0; m <= n - 1; m++) {\n    if (z[m] == 0) {\n      break;\n    }\n  }\n  for (k = 0; k <= m - 1; k++) {\n    if (z[k] != 0) {\n      printf(\"%d\", z[k]);\n    }\n    if (k <= m - 2) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, s, r;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= n - 1; t++) {\n    r = 0;\n    for (s = 0; s <= t - 1; s++) {\n      if (a[t] == a[s])\n        break;\n      else\n        r++;\n    }\n    if (r == t)\n      printf(\" %d\", a[t]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, flag, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\\n\", b[i]);\n}\n"}
{"label": "13", "index": "23883", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, g, p = 0;\n\n  \n  cin >> n;\n  int a[n + 1];\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  \n  for (j = 1; j <= n; j++) {\n    g = 0;\n\n    \n    for (k = 1; k <= j - 1; k++) {\n      if (a[j] == a[k]) {\n        g = 1;\n      }\n    }\n\n    \n    if (g == 0) {\n      if (p != 0) {\n        cout << \" \";\n      }\n      cout << a[j];\n      p++; \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, i, j;\n  while (cin >> n) {\n    char b[20000];\n    int a[20000];\n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cin.getline(b, 20000);\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        cout << \" \" << a[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int input[20000], output[20000], n, i, j, outLen = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> input[i];\n    output[outLen] = input[i];\n    for (j = 1; j < outLen; j++) {\n      if (input[i] == output[j])\n        outLen = outLen - 1;\n    }\n    outLen = outLen + 1;\n  }\n  for (i = 1; i < outLen; i++) {\n    printf(\"%d\", output[i]);\n    if (i != outLen - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23886", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, x;\n  int a[100];\n  cin >> n;\n  for (int k = 0; k < 100; k++)\n    a[k] = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    for (int j = 10; j < 100; j++) {\n\n      if (x == j)\n        a[j] = a[j] + 1;\n    }\n    if (a[x] == 1) {\n      if (i != 0)\n        cout << \" \" << x;\n      else\n        cout << x;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  cin >> n;\n  int a[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < k; m++) {\n      if (a[k] != a[m])\n        continue;\n      else\n        break;\n    }\n    if (m == k && a[k] != a[k - 1])\n      cout << \" \" << a[k];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, t = 0, b, p;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - t; j++) {\n    for (k = j + 1; k < n - t;) {\n      if (a[k] == a[j]) {\n        for (p = k; p < n - t; p++)\n          a[p] = a[p + 1];\n        t++;\n      } else {\n        k++;\n      }\n    }\n  }\n  for (b = 0; b < n - 1 - t; b++)\n    printf(\"%d \", a[b]);\n  cout << a[n - 1 - t] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        a[i] = 0;\n        break;\n      }\n  }\n  for (k = 0; k < n; k++) {\n    if (a[k]) {\n      if (!k)\n        printf(\"%d\", a[k]);\n      else\n        printf(\" %d\", a[k]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[20001] = {0}, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> m[i];\n  for (i = 1; i <= n; i++)\n    for (int j = i + 1; j <= n; j++)\n      if (m[i] == m[j]) {\n        for (j; j <= n; j++)\n          m[j] = m[j + 1];\n        n = n - 1;\n        i = i - 1;\n      }\n  for (i = 1; i <= n - 1; i++)\n    cout << m[i] << ' ';\n  cout << m[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23891", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, num, i, j = 0, k; \n  int a[91] = {\n      0};   \n  cin >> n; \n  int b[20000] = {0};     \n  for (i = 0; i < n; i++) \n  {\n    cin >> num;           \n    if (a[num - 10] == 0) \n    {\n      b[j] = num;    \n      a[num - 10]++; \n      j++;           \n    }\n  }\n  cout << b[0]; \n  for (k = 1; k <= n; k++) {\n    if (b[k] == 0)\n      break; \n    else\n      cout << \" \" << b[k]; \n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b[101] = {0}, i;\n\n  cin >> n;\n  int a[20001] = {0};\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = b[a[i]] + 1;\n  }\n  cout << a[1];\n  b[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (b[a[i]] != 0)\n      cout << \" \" << a[i];\n    b[a[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, x;\n  int a[100];\n  scanf(\"%d \", &n);\n  for (int k = 0; k < 100; k++)\n    a[k] = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    for (int j = 10; j < 100; j++) {\n\n      if (x == j)\n        a[j] = a[j] + 1;\n    }\n    if (a[x] == 1) {\n      if (i != 0)\n        printf(\" %d\", x);\n      else\n        cout << x;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23894", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, m, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      m = i;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "23895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (s[j] == s[i])\n        s[i] = 0;\n    }\n  printf(\"%d\", s[0]);\n  for (i = 1; i < n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[100], t = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < t; j++)\n      if (a[i] == b[j])\n        break;\n    if (j >= t) {\n      b[t] = a[i];\n      t++;\n    }\n  }\n  for (j = 1; j < t - 1; j++) {\n    cout << b[j] << \" \";\n  }\n  printf(\"%d\", b[t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, t, a[20000], b[100], c[20000];\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  t = 0;\n  for (i = 0; i < n; i++) {\n    if (b[a[i]] == 1) {\n      c[t] = a[i];\n      t++;\n      b[a[i]] = 0;\n    }\n  }\n  for (i = 0; i < t - 1; i++)\n    cout << c[i] << \" \";\n  printf(\"%d\\n\", c[t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100000], i, h = 1, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[h] = a[i];\n      h++;\n    }\n  }\n  for (i = 1; i <= h - 1; i++) {\n    if (i < h - 1)\n      printf(\"%d \", b[i]);\n    else if (i == h - 1)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "23899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, s = 1, j, i; \n  cin >> n;\n  int a[n], b[n]; \n  for (int i = 0; i < n; i++)\n    cin >> a[i]; \n  b[0] = a[0];\n  for (i = 1; i < n; i++) { \n    for (j = 0; j < s; j++) {\n      if (a[i] == b[j]) { \n        break;\n      }\n    }\n    if (j == s) { \n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (int i = 0; i < s - 1; i++) \n    cout << b[i] << ' ';\n  cout << b[s - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, n, k;\n  k = 0;\n  cin >> n;\n\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[j] == a[i])\n        a[j] = 0;\n  }\n\n  cout << a[0];\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23901", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        t = 0;\n        break;\n      } else\n        t = 1;\n    }\n    if (t == 0)\n      printf(\"\\0\");\n    else {\n      if (i > 0)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23902", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int j, tag = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    tag = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        tag++;\n    }\n    if (tag == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n - sum; i++)\n    for (j = i + 1; j < n - sum; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n - sum - 1; k++)\n          a[k] = a[k + 1];\n        sum++;\n        j--;\n      }\n    }\n  for (i = 0; i < n - sum - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "23904", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, a[20000], counter = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      counter++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      cout << a[i];\n      counter--;\n      if (counter != 0)\n        cout << ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, t = 0, b, p;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - t; j++) {\n    for (k = j + 1; k < n - t;) {\n      if (a[k] == a[j]) {\n        for (p = k; p < n - t; p++) {\n          a[p] = a[p + 1];\n        }\n        t++;\n      } else\n        k++;\n    }\n  }\n  for (b = 0; b < n - 1 - t; b++)\n    cout << a[b] << \" \";\n  cout << a[n - 1 - t] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23906", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n;\n  cin >> n;\n\n  int visit[101] = {0};\n\n  int i;\n  for (i = 0; i < n; i++) {\n    int num;\n    scanf(\"%d\", &num);\n    if (visit[num] == 1) {\n\n    } else {\n      if (i != 0)\n        printf(\" \");\n\n      printf(\"%d\", num);\n      visit[num] = 1;\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "23907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], p[200], x, step = -1;\n  cin >> n;\n  memset(p, 0, sizeof(p));\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    if (p[x] == 0) {\n      step++;\n      a[step] = x;\n      p[x] = 1;\n    }\n  }\n  cout << a[0];\n  for (int j = 1; j <= step; j++) {\n    cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[20000], output[20000];\n  int i = 0, n = 0, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    for (j = 0; j < k; j++)\n      if (num[i] == output[j])\n        num[i] = 0;\n    if (num[i] != 0) {\n      output[k] = num[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", output[i]);\n  cout << output[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint BT(int x, int a[40000]) {\n  int b = 0, c = 0;\n  while (b < 40000) {\n    if (a[b] == x) {\n      c = 1;\n      break;\n    } else\n      b++;\n  }\n  return c;\n}\nint main() {\n  int n, a[40000], i, b[40000], c;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < 10001; i++)\n    b[i] = -1;\n  for (i = 0, c = 0; i < n; i++)\n    if (BT(a[i], b) == 0) {\n      if (c == 0) {\n        printf(\"%d\", a[i]);\n      } else\n        cout << \" \" << a[i];\n      b[c] = a[i];\n      c++;\n    }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    a[i] = m;\n  }\n  for (int ii = 0; ii < n; ii++)\n    for (int j = ii + 1; j < n; j++) {\n      if (a[j] == a[ii]) {\n        a[j] = 101;\n      }\n    }\n  int b = 1;\n  for (int l = 0; l < n; l++) {\n\n    if (a[l] < 100 && b == 1) {\n      printf(\"%d\", a[l]);\n      b += 1;\n    } else if (a[l] < 100 && b != 1)\n      cout << ' ' << a[l];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000] = {0}, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    if (b[k] == 0) {\n      a[j] = k;\n      j++;\n      b[k] = 1;\n    }\n  }\n  for (i = 1; i < j; i++) {\n    if (i == 1)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23912", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[20000], m = 0, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (i = 1, j = 1; i < n; i++) {\n    for (k = 0; k < j; k++)\n      if (a[i] == b[k])\n        m = 1;\n    if (m != 1) {\n      b[j] = a[i];\n      j++;\n    }\n    m = 0;\n  }\n  for (i = 0; i < j - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[j - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint stat[115], i, n, k, first = 0;\nint main() {\n  for (i = 0; i < 110; i++)\n    stat[i] = 0;\n  for (scanf(\"%d\", &n), i = 0; i < n; i++) {\n    scanf(\"%d\", &k), stat[k]++;\n    printf(stat[k] == 1 ? \"%s%d\" : \"\", i != 0 ? \" \" : \"\", k);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23914", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, flag;\n  scanf(\"%d\", &n);\n  int a[200000];\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  if (n == 1)\n    printf(\"%d\", a[1]);\n  else {\n    printf(\"%d\", a[1]);\n    for (i = 2; i <= n; i++) {\n      for (m = 1; m < i; m++) {\n        if (a[i] == a[m]) {\n          flag = 1;\n          break;\n        } else {\n          flag = -1;\n        }\n      }\n      if (flag == -1)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, c, j, k = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &c);\n    p = 1;\n    for (j = 0; j < k; j++)\n      if (a[j] == c)\n        p = 0;\n    if (p) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint src[20000];\nint dst[100];\nint main() {\n  int n, i, j, flag;\n  int current_pos = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &src[i]);\n  for (i = 0; i < n; i++) {\n    if (current_pos) {\n      flag = 1;\n      for (j = 0; j < current_pos; j++) {\n        if (dst[j] == src[i])\n          flag = 0;\n      }\n      if (flag == 1) {\n        dst[current_pos] = src[i];\n        current_pos++;\n      }\n    } else {\n      dst[0] = src[0];\n      current_pos++;\n    }\n  }\n  for (i = 0; i < current_pos; i++) {\n    cout << dst[i];\n    if (i < current_pos - 1)\n      cout << \" \";\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], n, i, j, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        t = 0;\n        break;\n      } else\n        t = 1;\n    }\n    if (t == 0)\n      printf(\"\\0\");\n    else {\n      if (i > 0)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23918", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - m; i++) {\n    for (j = i + 1; j <= n - m; j++) {\n      if (a[j] == a[i]) {\n        m = m + 1;\n        for (k = j; k <= n - m; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n      }\n    }\n  }\n  for (i = 0; i < n - m - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - m - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, temp;\n  cin >> n;\n  const int N = n;\n  int ia[N];\n\n  for (i = 0; i != n; i++)\n    cin >> ia[i];\n\n  i = 1;\n  while (i < n) {\n    temp = n;\n\n    for (int j = 0; j < i; j++) {\n      if (ia[i] == ia[j]) {\n        for (int k = i; k < n - 1; k++)\n          ia[k] = ia[k + 1];\n        n--;\n        break;\n      }\n    }\n    if (n == temp)\n      i++;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    cout << ia[i] << \" \";\n  printf(\"%d\\n\", ia[n - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "23920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t, p;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    p = 0;\n    t = 0;\n    do {\n      if (a[i] == a[p])\n        t = 1;\n      p += 1;\n    } while (t == 0 && p < i);\n    if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23921", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], b[100];\n  memset(b, 0, sizeof(b));\n  cin >> n;\n  for (i = 0; i < n; i++)\n\n    scanf(\"%d \", &a[i]);\n\n  cout << a[0];\n  b[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (b[a[i]] == 0) {\n      cout << \" \" << a[i];\n      b[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k = 0, b[20000];\n  scanf(\"%d\", &n);\n  i = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    cout << b[i];\n    if (i - k + 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100000], i, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = a[j];\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] != a[i])\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "23924", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int flag[101] = {0};\n  int n, a;\n  cin >> n;\n  int f = 0;\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    if (flag[a] == 0) {\n      flag[a] = 1;\n      if (f == 0) {\n        cout << a;\n        f = 1;\n      } else {\n        cout << \" \" << a;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  \n  \n  \n  int n, i, j, k, p, t;\n  int a[20002];\n  cin >> n;\n  cin >> a[0];\n  p = 0;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> k;\n    t = 0;\n    for (j = 0; j <= p; j++) {\n      if (a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      continue;\n    else {\n      p = p + 1;\n      a[p] = k;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= p; i++) {\n    cout << \" \" << a[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j[101] = {0}, a[20000], b[20000] = {0}, i, n, x = 0, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (j[a[i]] == 0) {\n      j[a[i]] = 1;\n      b[x] = a[i];\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[i]);\n}\n"}
{"label": "13", "index": "23927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int a[10000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      k = 0;\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          k = 1;\n        }\n      }\n      if (k == 0) {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    if (i == 0)\n      cout << a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0 && i != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[20001] = {0};\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (i == 0)\n      cout << a[i];\n    else {\n      int t = 0;\n      for (int j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t++;\n      }\n      if (t == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int b[20000];\n  scanf(\"%d%d\", &n, &b[0]);\n  printf(\"%d\", b[0]);\n  for (i = 1; i <= n - 1; i++) {\n    cin >> b[i];\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] == b[j]) {\n        b[i] = 0;\n      }\n    }\n  }\n  for (m = 1; m < n; m++) {\n    if (b[m] != 0) {\n      cout << \" \" << b[m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int flag = 0;\n  int i;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &shuzu[i]);\n\n  cout << shuzu[0];\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (shuzu[i] == shuzu[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0)\n      printf(\" %d\", shuzu[i]);\n\n    flag = 0;\n  }\n  free(shuzu);\n  return 0;\n}\n"}
{"label": "13", "index": "23932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0}, b[100] = {0}, n, i, j, m = 1, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= m; j++) {\n      if (a[i] == b[j])\n        flag = 1;\n    }\n    if (flag == 1)\n      continue;\n    else {\n      m++;\n      b[m] = a[i];\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "23933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    } else if (m == 0 && k != 0) {\n      b[k] = a[0];\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  cout << b[0];\n  return 0;\n}\n"}
{"label": "13", "index": "23934", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[20001], used[200];\n  for (i = 0; i < 200; i++)\n    used[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  cout << a[0];\n  used[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (used[a[i]])\n      continue;\n    printf(\" %d\", a[i]);\n    used[a[i]] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, i, j, r, d = 0;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &*(a + i));\n  for (i = 0; i < n; i++) {\n    r = 0;\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        r = 1;\n    }\n    if (r == 0 && d == 0) {\n      cout << *(a + i);\n      d = 1;\n    } else if (r == 0 && d == 1)\n      cout << \" \" << *(a + i);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23936", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int k;\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n      else\n        break;\n    }\n    if (k == i)\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001], x = 0, t, m;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  cin >> m;\n  cout << m;\n  a[m] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    if (a[t] != 1) {\n      cout << \" \" << t;\n      a[t] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101], b[20000], n, i;\n  for (i = 0; i < 101; i = i + 1) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &n);\n  cin >> b[0];\n  cout << b[0];\n  a[b[0]] = 1;\n  for (i = 1; i < n; i++) {\n    cin >> b[i];\n    if (a[b[i]] == 0) {\n      printf(\" %d\", b[i]);\n      a[b[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23939", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int shu[n];\n  for (int i = 0; i < n; i++)\n    cin >> shu[i];\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      cout << shu[i];\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (shu[i] == shu[j]) \n        {\n          shu[i] = 0; \n        }\n      }\n      if (shu[i] != 0)\n        cout << \" \" << shu[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[k] != 0) {\n        if (a[j] == a[k])\n          a[k] = 0;\n      }\n    }\n  }\n  cout << a[0];\n  for (p = 1; p < n; p++) {\n    if (a[p] != 0)\n      cout << \" \" << a[p];\n    continue;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100000], a[100], n, i, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 100; i++) {\n    a[i] = 1;\n  }\n  scanf(\"%d\", &sz[0]);\n  printf(\"%d\", sz[0]);\n  a[sz[0]] = 0;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    d = sz[i];\n    if (a[d] != 0) {\n      printf(\" %d\", sz[i]);\n    }\n\n    a[d] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23942", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20005], del, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    del = a[i];\n    if (a[i] >= 10) {\n      if (i == 1) {\n        printf(\"%d\", a[1]);\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "23943", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    cin >> a[i];\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == 0) \n    {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23944", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int m = 0;\n  int a[20001];\n  for (int i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (int i = 2; i <= n; i++)\n    for (int j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  printf(\"%d\", a[1]);\n  for (int i = 2; i <= n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "23945", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int num, count[100] = {0};\n  scanf(\"%d \", &num);\n  count[num]++;\n  printf(\"%d\", num);\n  for (i = 2; i <= n; i++) {\n    cin >> num;\n    count[num]++;\n    if (count[num] == 1)\n      cout << \" \" << num;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23946", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, s = 1, j, i;\n  cin >> n;\n  int a[n], b[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < s; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n    }\n    if (j == s) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (int i = 0; i < s - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[s - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "23947", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[50000];\n  int b[20001];\n  scanf(\"%d \", &n);\n\n  scanf(\"%s \", a);\n  k = strlen(a);\n  i = 0;\n  j = 1;\n  while (i <= k - 1) {\n    b[j] = (a[i] - 48) * 10 + (a[i + 1] - 48);\n    i = i + 3;\n    j = j + 1;\n  }\n  j = j - 1;\n  printf(\"%d\", b[1]);\n  i = 2;\n  while (i <= j) {\n    m = 1;\n    while (m < i) {\n      if (b[i] == b[m])\n        break;\n      m = m + 1;\n    }\n    if (m == i)\n      printf(\" %d\", b[i]);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[101];\nint main() {\n  int q = 0, temp, n, i, flag = 0, t[200];\n  memset(a, 0, sizeof(a));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &temp);\n    if (a[temp] == 0)\n      t[q++] = temp;\n    a[temp]++;\n  }\n  for (i = 0; i < q; i++) {\n    if (flag == 0)\n      flag = 1;\n    else\n      printf(\" \");\n    printf(\"%d\", t[i]);\n  }\n}\n"}
{"label": "13", "index": "23949", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, t;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (k = i + 1; k < n; k++)\n      while ((a[k] == a[i]) && (k < n)) {\n        for (t = k; t < n - 1; t++)\n          a[t] = a[t + 1];\n        n--;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  cin >> n;\n  if (n == 0)\n    return 0;\n  scanf(\"%d\", &x);\n  cout << x;\n  a[0] = x;\n  for (j = 1; j < n; j++) {\n    cin >> x;\n    k = 0;\n    while ((k < m) && (a[k] != x))\n      k++;\n    if (k == m) {\n      a[m++] = x;\n      printf(\" %d\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, k, l, t = 1;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &a[l]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n;) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n      }\n      if (a[i] != a[j])\n        j++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t) {\n      cout << a[i];\n      t = 0;\n    } else\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "23952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000], k, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else if (j == i - 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "23953", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, on = 0;\n  cin >> n;\n  int input_array[n], output_array[100], otn_array[n];\n  memset(output_array, 0, sizeof(output_array));\n  for (int i = 0; i < n; i++)\n    cin >> input_array[i];\n  for (int i = 0; i < n; i++) {\n    int otn = input_array[i];\n    if (!output_array[otn - 1]) {\n      output_array[otn - 1] = 1;\n      otn_array[on] = otn;\n      on++;\n    }\n  }\n  for (int i = 0; i < on; i++) {\n    cout << otn_array[i];\n    if (i != on - 1)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, x;\n  int sz[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &sz[0]);\n  printf(\"%d\", sz[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    x = 0;\n    for (k = 0; k < i; k++) {\n\n      if (sz[i] == sz[k]) {\n        break;\n      } else if (sz[i] != sz[k]) {\n        x++;\n      }\n      if (x == i) {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (j == i)\n        continue;\n      else if (a[j] == a[i])\n        a[j] = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      cout << a[i];\n      break;\n    }\n  }\n  for (j = i + 1; j < n; j++) {\n    if (a[j] == -1)\n      continue;\n    else\n      printf(\" %d\", a[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, c, b = 1;\n  cin >> N;\n  int a[20001];\n  for (int i = 1; i <= N; i++)\n    cin >> a[i];\n  for (int m = 2; m <= N; m++) {\n    for (c = 1; c <= b; c++) {\n      if (a[m] == a[c])\n        break;\n    }\n    if (c == b + 1) {\n      b++;\n      a[b] = a[m];\n    }\n  }\n  printf(\"%d\", a[1]);\n  for (int d = 2; d <= b; d++)\n    cout << \" \" << a[d];\n  return 0;\n}\n"}
{"label": "13", "index": "23957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[20001] = {0}, number, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &number);\n    num[i] = number;\n  }\n  for (j = 1; j <= n; j++)\n    for (i = j + 1; i <= n; i++)\n      if (num[j] == num[i])\n        num[i] = 0;\n  for (i = 1; i <= n; i++)\n    if (num[i] != 0) {\n      cout << num[i];\n      break;\n    }\n  for (j = i + 1; j <= n; j++) {\n    if (num[j] != 0)\n      cout << \" \" << num[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int n = 0, i = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int j = 0, k = 0, l = 0;\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (l = k; l < n - 1; l++) {\n          a[l] = a[l + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, s, sum, num[100000] = {0};\n  scanf(\"%d\", &sum);\n  for (i = 0; i < sum; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < sum; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] == num[j]) {\n        num[i] = 0;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i < sum; i++) {\n    if (num[i] == 0)\n      continue;\n    else\n      printf(\" %d\", num[i]);\n  }\n}\n"}
{"label": "13", "index": "23960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, k;\n  cin >> n;\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i]; \n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k]) {\n        a[i] = 0;\n        break; \n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else\n        cout << \" \" << a[i]; \n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, m, p = 0, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (m = 0; m < i; m++) {\n      if (a[i] == a[m])\n        break;\n    }\n    if (m == i) {\n      p = p + 1;\n      b[p] = a[i];\n    }\n  }\n  for (l = 1; l <= p; l++) {\n    if (l == p)\n      printf(\"%d\", b[l]);\n    else\n      printf(\"%d \", b[l]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, m;\n  int x[20000] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d\", &x[i]);\n  printf(\"%d\", x[0]);\n  for (i = 0; i <= k - 2; i++) {\n    for (j = i + 1; j <= k - 1;) {\n      if (x[i] == x[j]) {\n        for (m = j + 1; m <= k - 1; m++)\n          x[m - 1] = x[m];\n        k--;\n      } else\n        j++;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    cout << \" \" << x[i];\n}\n"}
{"label": "13", "index": "23963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        j = i;\n      } else {\n        j = j;\n      }\n    }\n    if (j == i) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23964", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k, p, t;\n  int a[20002];\n  cin >> n;\n  cin >> a[0];\n  p = 0;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> k;\n    t = 0;\n    for (j = 0; j <= p; j++) {\n      if (a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      continue;\n    else {\n      p = p + 1;\n      a[p] = k;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= p; i++)\n    cout << \" \" << a[i];\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20100], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", *(a + i));\n  }\n}\n"}
{"label": "13", "index": "23966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int num[n];\n  cin >> num[0];\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &num[i]);\n    for (j = 0; j <= i; j++) {\n      if (j < i && num[j] == num[i]) {\n        break;\n      }\n      if (j == i) {\n        printf(\" %d\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23967", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, const char *argv[]) {\n  int n = 0, i = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  int j = 0, k = 0, l = 0;\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (l = k; l < n - 1; l++)\n          a[l] = a[l + 1];\n\n        n--;\n        k--;\n      }\n    }\n\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "23968", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, a[1000] = {0}, j, k, m;\n  cin >> n;\n  cin >> a[1];\n  for (i = 2, m = 2; m <= n; i++, m++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", a[1]);\n  for (k = 2; k <= i - 1; k++)\n    cout << ' ' << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "23969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n[101] = {0};\n  int nin;\n  cin >> nin;\n  int N;\n  int num[nin], count = 0;\n  for (int i = 1; i <= nin; ++i) {\n    cin >> N;\n    if (!n[N]) {\n      num[count] = N;\n      count++;\n    }\n    n[N]++;\n  }\n  for (int i = 0; i <= count - 2; ++i)\n    cout << num[i] << ' ';\n  printf(\"%d\", num[count - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[20000], p = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &m);\n    for (j = 0; j < i; j++) {\n      if (m == a[j]) {\n        p = 0;\n        break;\n      }\n    }\n    if (p == 0) {\n      i--;\n      n--;\n      p = 1;\n    } else {\n      a[i] = m;\n    }\n  }\n  for (j = 0; j < n - 1; j++)\n    printf(\"%d \", a[j]);\n\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23971", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, c;\n  int a[101] = {0};\n  cin >> n;\n  cin >> c;\n  a[c] = 1;\n  cout << c;\n  while (cin >> c) {\n    if (a[c] == 0) {\n      cout << \" \" << c;\n      a[c] = 1;\n    }\n  }\n  \n  return 0;\n}\n"}
{"label": "13", "index": "23972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[200001], j, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        flag = 1;\n      }\n    }\n    if (!flag)\n      printf(\" %d\", a[i]);\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23973", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\n\n\n\nint main() {\n  int n, i, j, k = 0, a[20000]; \n  cin >> n;                     \n  for (i = 0; i < n; i++)       \n    cin >> a[i];\n  for (i = 0; i < n; i++) \n  {\n    for (j = 0; j < i; j++) \n      if (a[j] == a[i])     \n      {\n        a[i] = -1; \n        break;     \n      }\n  }\n  cout << a[0];           \n  for (i = 1; i < n; i++) \n  {\n    if (a[i] > 0) \n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23974", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, c;\n  int a[20000] = {0};\n  cin >> c;\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (n = 1; n < c; n++) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[j] == a[n])\n        break;\n      else\n        continue;\n    }\n    if (j == -1)\n      cout << \" \" << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, r, t, s;\n  scanf(\"%d\", &n);\n  s = 1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t++;\n      }\n    }\n    if (t == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (r = 0; r < s - 1; r++) {\n    cout << b[r] << \" \";\n  }\n  printf(\"%d\", b[s - 1]);\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "23976", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l = 1; \n  cin >> n;              \n  int a[20000];          \n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  for (i = 0; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) \n      {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag) {\n      cout << a[i];\n      break;\n    }\n  }\n  i++;\n  for (; i < n; i++) {\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) \n      {\n        flag = 1;\n        break;\n      }\n    }\n    if (!flag)\n      cout << ' ' << a[i];\n  }\n  return 0; \n}\n"}
{"label": "13", "index": "23978", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0, t = 0;\n  int a[90000] = {0};\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n\n  for (k = 1; k < n; k++)\n\n  {\n    t = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i])\n        t = 1;\n    }\n    if (t == 0)\n      printf(\" %d\", a[k]);\n  }\n}\n"}
{"label": "13", "index": "23979", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i1, i2, i3, flag = 1;\n  int a[20000];\n  scanf(\"%d \", &n);\n  for (i1 = 0; i1 < n; i1++)\n    scanf(\"%d\", &a[i1]);\n  printf(\"%d\", a[0]);\n  for (i2 = 1; i2 < n; i2++) {\n    flag = 1;\n    for (i3 = 0; i3 < i2; i3++) {\n      if (a[i2] == a[i3])\n        flag *= 0;\n    }\n    if (flag == 1)\n      printf(\" %d\", a[i2]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, x = 0, a[100] = {0}, i = 0;\n  cin >> n;\n  scanf(\"%d \", &x);\n  cout << x;\n  a[x - 1] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> x;\n    if (a[x - 1] == 0) {\n      printf(\" %d\", x);\n      a[x - 1] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, m = 1, n, a[20000], b[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 0;\n  }\n  cout << b[0];\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "23982", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[20000], i, t, k = 0, h;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (t = i + 1; t < n - k; t++)\n      if (a[i] == a[t]) {\n        for (h = t; h < n - k - 1; h++)\n          a[h] = a[h + 1];\n        k++;\n        t--;\n      }\n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << ' ';\n  printf(\"%d\", a[n - k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, a[20000], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &b);\n    a[i] = b;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, b, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  k = 0;\n  for (i = 0; i < n; i++) {\n    j = 1;\n    scanf(\"%d\", &b);\n    for (t = 0; t < k; t++) {\n      if (b == a[t])\n        j = 0;\n    }\n    if (j == 1) {\n      a[k] = b;\n      k++;\n      if (k == 1)\n        printf(\"%d\", b);\n      else\n        printf(\" %d\", b);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == 0)\n        break;\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n        a[k] = 0;\n        l = l + 1;\n      }\n    }\n  for (i = 0; i < n - l; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23986", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[20001];\n  int i;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  int j = 1;\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        int u = i;\n        if (a[i] == a[i + 1]) {\n          j--;\n        }\n        while (i < n) {\n          a[i] = a[i + 1];\n          i++;\n        }\n        i = u;\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 1; i < n; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, x = 0, a[100] = {0}, i = 0;\n  cin >> n;\n  cin >> x;\n  cout << x;\n  a[x - 1] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> x;\n    if (a[x - 1] == 0) {\n      cout << \" \" << x;\n      a[x - 1] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  printf(\"%d\", p[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", p[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "23989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, num[20010], m;\n  cin >> n;\n  m = n;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] == num[i] && num[j] != 0) {\n        num[j] = 0;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (num[i] != 0) {\n      m--;\n      if (m > 0)\n        cout << num[i] << \" \";\n      else\n        cout << num[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, j = 0, i = 0, k = 0, a[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    if (a[i] <= 100 && a[i] >= 10) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          i = i - 1;\n          n = n - 1;\n        }\n      }\n    } else {\n      i = i - 1;\n      n = n - 1;\n    }\n  }\n  for (k = 0; k < n - 1; k++) {\n    cout << a[k] << \" \";\n  }\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "23991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101] = {0};\n  int i = 0;\n  int n = 0;\n  int t = 0;\n  int f = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> t;\n    if ((f != 0) && (!a[t]))\n      cout << \" \";\n    else\n      f = 1;\n    if (!a[t])\n      cout << t;\n    a[t] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint shuzu[20000];\nint main() {\n  int n, x;\n  scanf(\"%d\", &n);\n  for (int t = 0; t < n; t++) {\n    scanf(\"%d\", &shuzu[t]);\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = j + 1; i < n; i++) {\n      if (shuzu[i] == shuzu[j]) {\n        shuzu[i] = 0;\n      }\n    }\n  }\n  for (int m = 0; m < n; m++) {\n    if (shuzu[m] != 0) {\n      if (m == 0) {\n        printf(\"%d\", shuzu[m]);\n      } else {\n        printf(\" %d\", shuzu[m]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, j = 0, m = 0;\n  cin >> n;\n  int a[100000];\n  int b[100000];\n  for (int k = 0; k < n; k++)\n    cin >> a[k];\n\n  for (int i = 0; i < n; i++) {\n    int count = 0;\n    for (int l = 0; l < i; l++) {\n      if (a[l] == a[i]) {\n        count = 1;\n        m = m + 1;\n        break;\n      }\n    }\n    if (!count) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (int h = 0; h < (n - m); h++) {\n    if (h == 0)\n      printf(\"%d\", b[h]);\n    if (h > 0)\n      cout << \" \" << b[h];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "23994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag, a[20001];\n  cin >> n;\n  cin >> a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) \n  {\n    flag = 0;    \n    cin >> a[i]; \n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    } \n    if (flag == 0)\n      cout << \" \" << a[i]; \n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23995", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, num = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  for (i = n - 1; i > 0; i--)\n    for (k = i - 1; k >= 0; k--) {\n\n      if (a[i] == a[k]) {\n        if (i == n - 1) {\n          a[i] = 0;\n          num++;\n          break;\n\n        } else {\n          for (j = i; j < n - 1; j++)\n            a[j] = a[j + 1];\n          a[j] = 0;\n          num++;\n          break;\n        }\n      }\n    }\n\n  cout << a[0];\n  for (i = 1; i < n - num; i++)\n    cout << \" \" << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "23996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0, excit = 0;\n  cin >> k;\n  int num[k], shulie[k];\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 0; j <= i - 2; j++)\n      if (num[j] == num[i - 1]) {\n        excit = 1;\n        break;\n      }\n    if (excit == 0) {\n      shulie[l] = num[i - 1];\n      l = l + 1;\n    } else\n      excit = 0;\n  }\n  cout << shulie[0];\n  for (i = 2; i <= l; i++)\n    printf(\" %d\", shulie[i - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "23997", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int all, name[20000], input[20000], i, p, count, judge;\n  scanf(\"%d\", &all);\n  count = 0;\n  for (i = 0; i < all; i++)\n    name[i] = 0;\n\n  for (i = 0; i < all; i++) {\n    cin >> input[i];\n  }\n  for (i = 0; i < all; i++) {\n    judge = 0;\n    for (p = 0; p < count; p++) {\n      if (name[p] == input[i]) {\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 1) {\n      continue;\n    }\n    name[count] = input[i];\n    count++;\n  }\n  printf(\"%d\", name[0]);\n  for (i = 1; i < count; i++) {\n    printf(\" %d\", name[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23998", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, a[20000], k, j = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++)\n\n  {\n    for (k = 0; k < i; k++) {\n\n      if (a[i] == a[k]) {\n        j = j + 1;\n        break;\n      }\n    }\n    if (j == 0) {\n      cout << \" \" << a[i];\n    }\n    j = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "23999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, cal = 0, enter = 1, num = 0;\n  int a[100001] = {0}, b[100001] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= num; j++) {\n      if (a[i] == b[j]) {\n        goto next;\n        break;\n      }\n    }\n    if (enter == 1) {\n      printf(\"%d\", a[i]);\n      enter = 0;\n    } else\n      printf(\" %d\", a[i]);\n    num++;\n    b[num] = a[i];\n  next:\n    b[0] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  if (n > 1) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          a[i] = 0;\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      if (a[i] != 0) {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "24001", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, m;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> m;\n    a[i] = m;\n  }\n  for (int ii = 0; ii < n; ii++)\n    for (int j = ii + 1; j < n; j++) {\n      if (a[j] == a[ii]) {\n        a[j] = 101;\n      }\n    }\n  int b = 1;\n  for (int l = 0; l < n; l++) {\n\n    if (a[l] < 100 && b == 1) {\n      cout << a[l];\n      b += 1;\n    } else if (a[l] < 100 && b != 1)\n      cout << ' ' << a[l];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[20000], judge;\n\n  scanf(\"%d \", &n);\n  cout << endl;\n  if (n > 0 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      judge = 0;\n      cin >> judge;\n      if (judge >= 10 && judge < 100)\n\n      {\n        num[i] = judge;\n      }\n    }\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++) {\n        if (num[i] - num[j] == 0)\n\n          num[i] = 0;\n      }\n    cout << num[0];\n    for (i = 1; i < n; i++) {\n      if (num[i] != 0)\n        cout << \" \" << num[i];\n    }\n  } else {\n    cout << \"error\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24003", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, p;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i]);\n    p = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        p = 1;\n    }\n    if (p == 0 & i == 1) {\n      printf(\"%d\", a[i]);\n    }\n    if (p == 0 & i != 1) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num[100000], n, i, j, k, m, l;\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (num[j] == num[k]) {\n        num[k] = 0;\n      }\n    }\n  for (m = 0, l = 0; m < n; m++) {\n    if (num[m] >= 10) {\n      l++;\n      if (l == 1) {\n        cout << num[m];\n      } else {\n        cout << \" \" << num[m];\n      }\n    }\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "13", "index": "24005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 1, k = 1, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k == 1) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 1;\n  }\n  for (j = 0; j < m - 1; j++)\n    printf(\"%d \", b[j]);\n  cout << b[j];\n  return 0;\n}\n"}
{"label": "13", "index": "24006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, num[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 1; j <= i - 1; j++)\n      if (num[j - 1] == num[i - 1]) {\n        num[i - 1] = 0;\n        break;\n      }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (num[i] != 0) {\n      cout << \" \" << num[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24007", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i1 = 0; i1 < n; i1++)\n    cin >> a[i1];\n  int j = 0;\n  for (int i1 = 0; i1 < n; i1++) {\n    j = i1 + 1;\n    for (int i2 = i1 + 1; i2 < n; i2++) {\n      if (a[i2] != a[i1]) {\n        a[j] = a[i2];\n        j++;\n      }\n    }\n    n = j;\n  }\n  for (int i1 = 0; i1 < n; i1++) {\n    cout << a[i1];\n    if (i1 != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 1;\n    }\n  for (int i = 1; i < n; i++) {\n    if (a[i] > 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, figure[20000] = {0}, num[100] = {0}, flag[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> figure[i];\n  }\n  flag[figure[0]]++;\n  cout << figure[0];\n  for (int i = 1; i < n; i++) {\n    if (flag[figure[i]] == 0) {\n      flag[figure[i]]++;\n      printf(\" %d\", figure[i]);\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[20001];\n  memset(num, 0, 20001);\n  int i, j;\n  int count = 1;\n  int number;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &number);\n    if (i == 1) {\n      num[0] = number;\n    } else {\n      for (j = 1; j <= count; j++) {\n        if (number == num[j - 1]) {\n          break;\n        } else {\n        }\n        if (j == count) {\n          count++;\n          num[count - 1] = number;\n        } else {\n        }\n      }\n    }\n  }\n  for (i = 1; i < count; i++)\n    printf(\"%d \", num[i - 1]);\n\n  printf(\"%d\", num[count - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24011", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, b, t;\n  int a[20000];\n  cin >> n;\n  k = 0;\n  for (i = 0; i < n; i++) {\n    j = 1;\n    scanf(\"%d\", &b);\n    for (t = 0; t < k; t++) {\n      if (b == a[t])\n        j = 0;\n    }\n    if (j == 1) {\n      a[k] = b;\n      k++;\n      if (k == 1)\n        printf(\"%d\", b);\n      else\n        printf(\" %d\", b);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s[20000], y[20000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  k = 0;\n  for (i = n - 1; i > 0; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (s[i] == s[j])\n        break;\n    }\n    if (j == -1) {\n      y[k] = s[i];\n      k++;\n    }\n  }\n  cout << s[0];\n  for (i = k - 1; i >= 0; i--)\n    printf(\" %d\", y[i]);\n}\n"}
{"label": "13", "index": "24013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= i; j++) {\n      if (i != 1 && a[j - 1] == a[i])\n        a[i] = 0;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (i != 1 && a[i] != 0)\n      cout << \" \" << a[i];\n    else if (i == 1)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, i, now, sign;\n\n  scanf(\"%d\", &n);\n  sign = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &now);\n    if (a[now] == 0) {\n      a[now] = 1;\n      if (sign == 1)\n        printf(\" \");\n      else\n        sign = 1;\n      cout << now;\n    }\n  }\n  printf(\" \");\n  ;\n  return 0;\n}\n"}
{"label": "13", "index": "24015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, cn;\n  scanf(\"%d \", &n);\n  int a[n];\n  cn = 0;\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    for (j = 0; j <= cn; j++)\n      if (a[j] == k)\n        break;\n    if (j == cn + 1) {\n      a[cn] = k;\n      cn++;\n    }\n  }\n  for (i = 0; i < cn - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[cn - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24016", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int n, i, j, s;\n  s = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    if (i == 1) {\n      printf(\"%d\", a[1]);\n    } else {\n      for (j = 1; j < i; j++) {\n        if (a[j] == a[i])\n          s = s + 1;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t[20000], a, s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 100; i++)\n    s[i] = 0;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t[i]);\n    if (s[t[i]] == 0) {\n      s[t[i]] = 1;\n    } else if (s[t[i]] == 1)\n      t[i] = 101;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (t[i] != 101) {\n      a = i;\n      printf(\"%d\", t[i]);\n      break;\n    }\n  }\n\n  for (i = a + 1; i < n; i++) {\n    if (t[i] != 101) {\n      printf(\" %d\", t[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24018", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, k;\n  cin >> n;\n  int a[20000];\n  cin >> a[0];\n  while (cin >> a[i]) {\n    i++;\n    if (i == n)\n      break;\n  }\n  printf(\"%d\", a[0]);\n  i = 1;\n  while (i < n) {\n    int mid = 0;\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n        mid = 1;\n        break;\n      }\n    }\n    if (mid == 0)\n      printf(\" %d\", a[i]);\n    i++;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a, i, j, l, k = 1;\n  cin >> a;\n  int s[20000] = {a};\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a);\n    j = 0;\n    while (s[j] != a) {\n      j++;\n      if (j == k) {\n        s[k] = a;\n        k++;\n      }\n    }\n  }\n  for (l = 0; l < k - 1; l++) {\n    printf(\"%d \", s[l]);\n  }\n  cout << s[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i = i + 1) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  for (i = 1; i <= n; i = i + 1) {\n    s = 0;\n    if (i == 1)\n      printf(\"%d\", a[i - 1]);\n    else {\n      for (j = 0; j < i - 1; j = j + 1) {\n        s = (a[i - 1] == a[j]) ? s + 1 : s;\n      }\n      if (s == 0) {\n        printf(\" %d\", a[i - 1]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, n, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << \"\\n\";\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p;\n  p = (int *)malloc(n * sizeof(int));\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &p[i]);\n  printf(\"%d\", p[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        break;\n    }\n    if (j == i)\n      cout << \" \" << p[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, q, x = 1;\n  int shuzu[1000], panduan[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &(shuzu[i]));\n  }\n  panduan[0] = 0;\n  for (i = 1; i < n; i++) {\n    for (q = 0, j = 0; j < i; j++) {\n      if (shuzu[j] == shuzu[i]) {\n        q = 1;\n        break;\n      }\n    }\n\n    panduan[i] = q;\n  }\n  for (i = 0, x = 0; i < n; i++) {\n    if (panduan[i] == 0) {\n      x = x + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (panduan[i] == 0 && (x != 1)) {\n      cout << shuzu[i] << \" \";\n      x--;\n    } else if (panduan[i] == 0 && (x == 1)) {\n      cout << shuzu[i];\n      x--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24024", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20005], b[20005] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; b[j] != 0; j++) {\n      if (b[j] == a[i])\n        break;\n    }\n    if (b[j] == 0)\n      b[j] = a[i];\n  }\n  cout << b[0];\n  for (i = 1; b[i] != 0; i++) {\n    cout << \" \" << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n{\n  int num[20000];   \n  int i, j, k, h;   \n  int check[20000]; \n  int n;            \n  cin >> n;\n  check[0] = 0;           \n  for (i = 0; i < n; i++) \n  {\n    cin >> num[i];\n  }\n  for (j = 1; j < n; j++) \n  {\n    check[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (num[j] == num[k]) \n      {\n        check[j] = 1;\n        break; \n      }\n    }\n  }\n  cout << num[0];\n  for (h = 1; h < n; h++) \n  {\n    if (check[h] == 0)\n      cout << \" \" << num[h];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i, j = 1, c = 0, l = 1, m, n, k;\n  scanf(\"%d\\n\", &n);\n  int s[20000] = {0}, t[20000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  t[0] = s[0];\n  for (l = 1; l < n; l++) {\n    c = 0;\n    for (i = 0; i < l; i++) {\n      if (s[l] == s[i]) {\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0) {\n      t[j] = s[l];\n      j++;\n    }\n  }\n  for (m = 0; (c = t[m + 1]) != 0; m++) {\n    printf(\"%d \", t[m]);\n  }\n  printf(\"%d\", t[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "24027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, c;\n  int a[20000] = {0};\n  scanf(\"%d \", &c);\n  for (i = 0; i < c; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (n = 1; n < c; n++) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[j] == a[n])\n        break;\n      else\n        continue;\n    }\n    if (j == -1) {\n      cout << \" \" << a[n];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        f++;\n    }\n    if (f == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\", b[k - 1]);\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[200000], i, j, b, c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    c[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    c[a[i]]++;\n    if (c[a[i]] == 1) {\n      if (i == 0)\n        printf(\"%d\", a[0]);\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, num[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num[i - 1];\n    for (j = 1; j <= i - 1; j++)\n      if (num[j - 1] == num[i - 1]) {\n        num[i - 1] = 0;\n        break;\n      }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (num[i] != 0) {\n      cout << \" \" << num[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int count[100] = {0}, num[90] = {0};\n  int i = 1, a, j = 0;\n  for (i; i <= n; i++) {\n    cin >> a;\n    if (count[a] == 0) {\n      num[j] = a;\n      j += 1;\n    }\n    count[a] = count[a] + 1;\n  }\n  i = 0;\n  for (i; i < j - 1; i++)\n    cout << num[i] << \" \";\n\n  printf(\"%d\\n\", num[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24032", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, j, i, leap = 0, f = 1;\n  int m[20000];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    cin >> m[i];\n  for (i = 0; i < a; i++) {\n    leap = 0;\n\n    for (j = 0; j < i + 1; j++) {\n      if (j == i)\n        continue;\n      else {\n        if (m[i] == m[j]) {\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 0 && f == 1) {\n      printf(\"%d\", m[i]);\n      f = 0;\n      continue;\n    }\n    if (leap == 0 && f == 0)\n      printf(\" %d\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101], b[20000], n, i;\n  for (i = 0; i < 101; i = i + 1) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &n);\n  cin >> b[0];\n  cout << b[0];\n  a[b[0]] = 1;\n  for (i = 1; i < n; i++) {\n    cin >> b[i];\n    if (a[b[i]] == 0) {\n      cout << \" \" << b[i];\n      a[b[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b;\n  int z[30000];\n  int c[30000];\n  int x[101];\n  scanf(\"%d\", &n);\n  for (a = 10; a <= 100; a++) {\n    x[a] = 1;\n  }\n  for (a = 1; a <= n; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n  b = 1;\n  for (a = 1; a <= n; a++) {\n    if (x[z[a]] == 1) {\n      c[b] = z[a];\n      b += 1;\n      x[z[a]] = 0;\n    }\n  }\n  for (a = 1; a <= b - 1; a++) {\n    if (a < b - 1)\n      printf(\"%d \", c[a]);\n    else\n      cout << c[a];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[30000], j;\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct number {\n    int num, status;\n  } a[20000];\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  count = n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    a[i].status = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i].num == a[j].num) {\n        a[i].status = 0;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (a[i].status && j != count - 1) {\n      cout << a[i].num << \" \";\n      j++;\n      continue;\n    }\n    if (a[i].status && j == count - 1) {\n      printf(\"%d\\n\", a[i].num);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24037", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[1000];\n  int i, j;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    }\n\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[j] == a[i]) {\n          break;\n        }\n      }\n      if (j == i) {\n        printf(\" %d\", a[i]);\n      } else if (j < i) {\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0, t = 0;\n  int a[90000] = {0};\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n\n  for (k = 1; k < n; k++)\n\n  {\n    t = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i])\n        t = 1;\n    }\n    if (t == 0)\n      printf(\" %d\", a[k]);\n  }\n}\n"}
{"label": "13", "index": "24039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  int j, tag = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    tag = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        tag++;\n    }\n    if (tag == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24040", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t = 0;\n  cin >> n;\n\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      printf(\"%d\", a[i]);\n    }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s[20000], y[20000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n  }\n  k = 0;\n  for (i = n - 1; i > 0; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (s[i] == s[j])\n        break;\n    }\n    if (j == -1) {\n      y[k] = s[i];\n      k++;\n    }\n  }\n  printf(\"%d\", s[0]);\n  for (i = k - 1; i >= 0; i--)\n    cout << \" \" << y[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[200000], i, j, b, c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    c[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    c[a[i]]++;\n    if (c[a[i]] == 1) {\n      if (i == 0)\n        printf(\"%d\", a[0]);\n      else\n        cout << \" \" << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24043", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, c = 0, q[20001];\n  cin >> n;\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &q[k]);\n  printf(\"%d\", q[0]);\n  for (i = 1; (i < n); i++) {\n    c = 0;\n    for (j = 0; j < i; j++) {\n      if (q[j] == q[i])\n        c++;\n      else\n        c = c + 0;\n    }\n\n    if (c == 0)\n      printf(\" %d\", q[i]);\n    else\n      f++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24044", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, cn;\n  cin >> n;\n  int a[n];\n  cn = 0;\n  for (i = 0; i < n; i++) {\n    cin >> k;\n    for (j = 0; j <= cn; j++)\n      if (a[j] == k)\n        break;\n    if (j == cn + 1) {\n      a[cn] = k;\n      cn++;\n    }\n  }\n  for (i = 0; i < cn - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[cn - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  i = 1;\n  while (i < n) {\n    int j = 0, x = 0;\n    while (j < i) {\n      if (a[i] == a[j]) {\n        x = 1;\n        break;\n      }\n      j++;\n    }\n    if (x == 0)\n      cout << \" \" << a[i];\n    i++;\n  }\n}\n"}
{"label": "13", "index": "24046", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, sign, counter;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  counter = 0;\n  for (i = 0; i < n && counter == 0; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\"%d\", a[i]);\n      counter = counter + 1;\n    }\n  }\n  for (; i < n; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, j = 0, m = 0;\n  cin >> n;\n  int a[100000];\n  int b[100000];\n  for (int k = 0; k < n; k++)\n    cin >> a[k];\n\n  for (int i = 0; i < n; i++) {\n    int count = 0;\n    for (int l = 0; l < i; l++) {\n      if (a[l] == a[i]) {\n        count = 1;\n        m = m + 1;\n        break;\n      }\n    }\n    if (!count) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (int h = 0; h < (n - m); h++) {\n    if (h == 0)\n      cout << b[h];\n    if (h > 0)\n      cout << \" \" << b[h];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, c, n, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1, b = 1; i <= n; i++, b++) {\n    if (b == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (c = 1; c <= i; c++) {\n        if (a[c] == a[i])\n          break;\n      }\n      if (c == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24049", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, e, k = 0;\n  int s[20001];\n  int a[20001];\n  cin >> n;\n  for (i = 1; i <= 20001; i++) {\n    s[i] = 0;\n    a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &e);\n    if (a[e] == 0) {\n      a[e] = 1;\n      k++;\n      s[k] = e;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    printf(\"%d \", s[i]);\n  cout << s[k];\n  return 0;\n}\n"}
{"label": "13", "index": "24050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  register int i, j, flag;\n  int n;\n  flag = 0;\n  char str1[20000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &str1[i - 1]);\n    if (i >= 2) {\n      flag = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (str1[i - 1] == str1[j - 1]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        printf(\" %d\", str1[i - 1]);\n      }\n    } else {\n      printf(\"%d\", str1[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int a[20000], i, n, k, j, m;\n  scanf(\"%d\", &n);\n  m = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n        \n        n--;\n        for (j = i; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (i < n - 1) {\n      printf(\"%d \", a[i]);\n    } else {\n      printf(\"%d\", a[n - 1]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint compare(int s, int a[20000], int n) {\n  int i, temp = 0;\n  for (i = 0; i < n; i++) {\n    if (s == a[i]) {\n      return 1;\n      temp = 1;\n      break;\n    } else\n      continue;\n  }\n  if (temp = 0)\n    return 0;\n}\n\nint main() {\n  int n, a[20000], i, j, w = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (compare(a[i], a, i) == 1)\n      a[i] = -1;\n    else\n      continue;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      if (w == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n      w++;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j = 1, c = 0, l = 1, m, n, k;\n  scanf(\"%d\\n\", &n);\n  int s[20000] = {0}, t[20000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  t[0] = s[0];\n  for (l = 1; l < n; l++) {\n    c = 0;\n    for (i = 0; i < l; i++) {\n      if (s[l] == s[i]) {\n        c = 1;\n        break;\n      }\n    }\n    if (c == 0) {\n      t[j] = s[l];\n      j++;\n    }\n  }\n  for (m = 0; (c = t[m + 1]) != 0; m++) {\n    cout << t[m] << \" \";\n  }\n  printf(\"%d\", t[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "24054", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] == a[0])\n      a[i] = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n      for (j = i + 1; j < n; j++)\n        if (a[j] == a[i])\n          a[j] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], sum = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    cout << a[0];\n  } else {\n    printf(\"%d\", a[0]);\n    for (i = 1; i <= n - 1; i++) {\n      sum = 0;\n      for (j = 0; j <= i - 1; j++) {\n        if (a[i] == a[j]) {\n          sum = 1;\n        }\n      }\n      if (sum == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], j, temp;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &temp);\n    if (i == 1) {\n      j = 0;\n      printf(\"%d\", temp);\n      a[j] = temp;\n    } else {\n      int c = 0;\n      for (int k = 0; k <= j; k++) {\n        if (a[k] == temp)\n          c++;\n      }\n      if (c == 0) {\n        printf(\" %d\", temp);\n        j++;\n        a[j] = temp;\n      }\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n;\n  scanf(\"%d\", &k);\n  char c[20000];\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &c[i]);\n\n  printf(\"%d\", c[1]);\n  for (n = 2; n <= k; n++) {\n    for (j = 1; j <= n - 1; j++) {\n      if (c[n] == c[j])\n        break;\n    }\n    if (j == n && c[n] != c[n - 1]) {\n      printf(\" \");\n      printf(\"%d\", c[n]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint hs(int a);\nint main() {\n  int n, b[20002], i, j, pd, js;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  js = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        js--;\n        break;\n      }\n    }\n  }\n  pd = 1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (b[j] == b[i]) {\n        pd = 0;\n      }\n    }\n    if (pd == 1 && js != 1) {\n      cout << b[i] << \" \";\n      js--;\n    } else if (pd == 1 && js == 1) {\n      cout << b[i];\n      break;\n    }\n    pd = 1;\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++)\n      if (j == i)\n        continue;\n      else if (a[j] == a[i])\n        a[j] = -1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (j = i + 1; j < n; j++) {\n    if (a[j] == -1)\n      continue;\n    else\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24060", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 1, r = 1, number[20001], number1[20001] = {0};\n  cin >> n;\n  for (i = 1; i != n + 1; i++) {\n    scanf(\"%d \", &number[i]);\n    for (j = 1, k = 1; j <= i; j++) {\n      if (number[i] == number1[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1) {\n      if (i == 1) {\n        printf(\"%d\", number[1]);\n        number1[1] = number[1];\n        r++;\n      } else {\n        cout << \" \" << number[i];\n        number1[r] = number[i];\n        r++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, j, i, leap = 0, f = 1;\n  int m[20000];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < a; i++) {\n    leap = 0;\n\n    for (j = 0; j < i + 1; j++) {\n      if (j == i)\n        continue;\n      else {\n        if (m[i] == m[j]) {\n          leap = 1;\n          break;\n        }\n      }\n    }\n    if (leap == 0 && f == 1) {\n      printf(\"%d\", m[i]);\n      f = 0;\n      continue;\n    }\n    if (leap == 0 && f == 0)\n      printf(\" %d\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] == b[j])\n        b[j] = 0;\n  cout << b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      cout << ' ' << b[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24063", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[100000];\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  i = 1;\n  while (i < n) {\n    int j = 0, x = 0;\n    while (j < i) {\n      if (a[i] == a[j]) {\n        x = 1;\n        break;\n      }\n      j++;\n    }\n    if (x == 0) {\n      printf(\" %d\", a[i]);\n    }\n    i++;\n  }\n}\n"}
{"label": "13", "index": "24064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int x[n + 1];\n  x[0] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    x[i] = a;\n  }\n  int j;\n  for (j = n; j > 1; j--) {\n    int k;\n    for (k = 1; k < j; k++) {\n      if (x[k] == x[j]) {\n        x[j] = 0;\n      }\n    }\n  }\n  cout << x[1];\n  for (i = 2; i <= n; i++) {\n    if (x[i] != 0) {\n      cout << \" \" << x[i];\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, n, k;\n  k = 0;\n  scanf(\"%d\", &n);\n\n  n = n - 1;\n  for (i = 0; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[j] == a[i])\n        a[j] = 0;\n  }\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n\n  int visit[101] = {0};\n\n  int i;\n  for (i = 0; i < n; i++) {\n    int num;\n    scanf(\"%d\", &num);\n    if (visit[num] == 1) {\n\n    } else {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", num);\n      visit[num] = 1;\n    }\n  }\n  cout << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "13", "index": "24067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[20000], output[20000];\n  int i = 0, n = 0, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    for (j = 0; j < k; j++)\n      if (num[i] == output[j])\n        num[i] = 0;\n    if (num[i] != 0) {\n      output[k] = num[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", output[i]);\n  printf(\"%d\", output[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24068", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 1, n, j, r = 0, a[20001], b[101];\n  cin >> n;\n  memset(b, 1, sizeof(b));\n\n  do {\n    r = r + 1;\n    cin >> j;\n    if (b[j] != 0) {\n      a[i] = j;\n      b[a[i]] = 0;\n      i = i + 1;\n    }\n  } while (r < n);\n\n  for (j = 1; j < i - 1; j++) {\n    cout << a[j] << ' ';\n  }\n  cout << a[i - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "24069", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, w[200];\n  cin >> n;\n  memset(w, 0, sizeof(w));\n  for (int i = 0; i < n; i++) {\n    cin >> k;\n    if (!w[k]) {\n      if (i)\n        printf(\" \");\n      w[k] = 1;\n      cout << k;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24070", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000];\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  if (n > 1) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          a[i] = 0;\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      if (a[i] != 0)\n        cout << \" \" << a[i];\n    }\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "24071", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n, r = 0, s = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n - 1; i > 0; i--)\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        a[i] = -1;\n        r++;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != -1) {\n      if (s != n - r - 1) {\n        cout << a[i] << \" \";\n        s++;\n      } else\n        cout << a[i] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24072", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, flag;\n  int a[1000];\n  scanf(\"%d\", &n);\n  a[0] = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1)\n      if (i > 1)\n        printf(\" %d\", a[i]);\n      else\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000], j, k, b = 0, c[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    k = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        k = 1;\n      }\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "24074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (int k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n        j = j - 1;\n      } else\n        continue;\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24075", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[30000];\nint find(int k) {\n  int i;\n  for (i = 0; i < k; i++)\n\n  {\n    if (a[i] == a[k])\n      return 1;\n  }\n\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n  for (int k = 1; k < n; k++) {\n    if (find(k) == 0)\n      printf(\" %d\", a[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &s[i]);\n  printf(\"%d\", s[1]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (s[i] == s[j]) {\n        s[i] = 0;\n        break;\n      };\n    };\n  };\n  ;\n  for (i = 2; i <= n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  };\n  ;\n  return 0;\n}\n"}
{"label": "13", "index": "24077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, l;\n  cin >> n;\n  int m[n];\n  for (int i = 0; i < n; i++)\n    cin >> m[i];\n  int cishu[101] = {0};\n  for (int i = 0; i < n; i++) {\n    cishu[m[i]]++;\n    if (cishu[m[i]] >= 2)\n      m[i] = 0;\n  }\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", m[i]);\n    else if (m[i] != 0)\n      cout << \" \" << m[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20000], j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    k = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        k = 1;\n      }\n    }\n    if (k == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "13", "index": "24079", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, q = 1, k;\n  int sz[20000], jieguo[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  jieguo[0] = sz[0];\n  for (int i = 1; i <= n; i++) {\n    k = 0;\n    for (int j = 0; j < q; j++) {\n      if (jieguo[j] == sz[i]) {\n        break;\n      } else {\n        k += 1;\n      }\n    }\n    if (k == q) {\n      jieguo[q] = sz[i];\n      q += 1;\n    }\n  }\n  for (int i = 0; i < q - 1; i++) {\n    if (i != q - 2) {\n      printf(\"%d \", jieguo[i]);\n    } else {\n      printf(\"%d\", jieguo[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n + 1];\n  a[n] = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  if (a[i] != 0)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24081", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        a[j] = 0;\n    }\n    if (a[j])\n      printf(\" %d\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n\n    cin >> a[i];\n\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24083", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint src[20000]; \nint dst[100];   \nint main() {\n  int n, i, j, flag;   \n  int current_pos = 0; \n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> src[i]; \n  for (i = 0; i < n; i++) {\n    if (current_pos) {\n      flag = 1;\n      for (j = 0; j < current_pos; j++) {\n        if (dst[j] == src[i])\n          flag = 0; \n      }\n      if (flag == 1) {\n        dst[current_pos] = src[i];\n        current_pos++;\n      }\n    } else {\n      dst[0] = src[0];\n      current_pos++;\n    }\n  }\n  for (i = 0; i < current_pos; i++) {\n    cout << dst[i]; \n    if (i < current_pos - 1)\n      cout << \" \";\n  }\n  cout << endl;\n  return 0; \n}\n"}
{"label": "13", "index": "24084", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[105], n, i;\n  for (i = 0; i < 101; i += 1)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &i);\n  a[i] = 1;\n  printf(\"%d\", i);\n  while (n-- > 1) {\n    scanf(\"%d\", &i);\n    if (a[i])\n      continue;\n    a[i] = 1;\n    printf(\" %d\", i);\n  }\n}\n"}
{"label": "13", "index": "24085", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, j, k, m = 0, n = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        a[i] = 10000;\n    }\n  }\n  cout << a[1];\n  for (i = 2; i <= n - m; i++)\n    if (a[i] != 10000) {\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if (p)\n        printf(\" \");\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24087", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, i;\n  int f[20001] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    if (f[a] == 0) {\n      if (i == 1)\n        cout << a;\n      else {\n        cout << \" \" << a;\n      }\n      f[a] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24088", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], b[20001], i, m;\n  cin >> n;\n  m = n;\n  for (i = 1; i <= n; i++) {\n    b[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = 1;\n  }\n  i = 2;\n  cout << a[1];\n  b[a[1]] = 0;\n  do {\n    if (b[a[i]] == 1) {\n      cout << ' ' << a[i];\n      b[a[i]] = 0;\n    }\n    m = m - 1;\n    i = i + 1;\n  } while (m >= 0);\n\n  return 0;\n}\n"}
{"label": "13", "index": "24089", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, p = 1, i = 0, j = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int b[n];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == i) {\n      b[p] = a[i];\n      p++;\n    }\n  }\n\n  cout << b[0];\n\n  for (i = 1; i < p; i++) {\n    printf(\" %d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24090", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i = 0, a[20001], used[200]; \n  for (i = 0; i < 200; i++)\n    used[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  cout << a[0];\n  used[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (used[a[i]])\n      continue;          \n    cout << \" \" << a[i]; \n    used[a[i]] = 1;      \n  }\n  return 0; \n}\n"}
{"label": "13", "index": "24091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], count[100], n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < 100; i++)\n    count[i] = 0;\n  cout << a[0];\n  count[a[0]]++;\n  for (i = 0, j = 1; j < n; j++) {\n    if (count[a[j]] == 0) {\n      i++;\n      a[i] = a[j];\n      count[a[j]]++;\n    }\n  }\n  for (j = 1; j <= i; j++)\n    cout << \" \" << a[j];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  scanf(\"%d\", &n);\n  while (n < 1 || n > 20000) {\n    scanf(\"%d\", n);\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    while (a[i] < 10 || a[i] > 100) {\n      scanf(\"%d\", &a[i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000], k, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else if (j == i - 1)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int shuru[100000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> shuru[i];\n    if (getchar() == '\\n')\n      break;\n    else\n      continue;\n  }\n  cout << shuru[0];\n\n  for (int i = 1; i < n; i++) {\n    int jishu = 0;\n    for (int j = 0; j < i; j++) {\n      if (shuru[i] == shuru[j])\n        break;\n      else {\n        jishu++;\n      }\n    }\n    if (jishu == i)\n      printf(\" %d\", shuru[i]);\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  int z[30000];\n  int c[30000];\n  int x[101];\n  scanf(\"%d\", &n);\n  for (a = 10; a <= 100; a++) {\n    x[a] = 1;\n  }\n  for (a = 1; a <= n; a++) {\n    scanf(\"%d\", &z[a]);\n  }\n  b = 1;\n  for (a = 1; a <= n; a++) {\n    if (x[z[a]] == 1) {\n      c[b] = z[a];\n      b += 1;\n      x[z[a]] = 0;\n    }\n  }\n  for (a = 1; a <= b - 1; a++) {\n    if (a < b - 1)\n      printf(\"%d \", c[a]);\n    else\n      printf(\"%d\", c[a]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, q = 0, a[20000];\n  cin >> n;\n  for (i = 0; i < n - q; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        q++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n - q - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - q - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p = 0;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0) {\n      cout << a[0];\n    } else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          p += 1;\n        }\n      }\n      if (p == 0) {\n        printf(\" %d\", a[i]);\n      }\n      p = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24098", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[30000];\nint find(int k) {\n  int i;\n  for (i = 0; i < k; i++)\n\n  {\n    if (a[i] == a[k])\n      return 1;\n  }\n\n  return 0;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n  for (int k = 1; k < n; k++) {\n    if (find(k) == 0)\n      printf(\" %d\", a[k]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      {\n        if (a[i] == a[j])\n          a[i] = 0;\n        else\n          a[i] = a[i];\n      }\n    }\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n\n  printf(\"%d\", b[k - 1]);\n}\n"}
{"label": "13", "index": "24100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int i, k, j = 0, n, fil = 101, m = 0, g = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  k = 0;\n  a[n] = 101;\n\n  while (k < n) {\n\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    if (k == 0)\n      printf(\"%d\", a[k]), k++;\n\n    else if (k < n && k > 0)\n      printf(\" %d\", a[k]), k++, m++;\n  }\n}\n"}
{"label": "13", "index": "24101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, e, k = 0;\n  int s[20001];\n  int a[20001];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 20001; i++) {\n    s[i] = 0;\n    a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    cin >> e;\n    if (a[e] == 0) {\n      a[e] = 1;\n      k++;\n      s[k] = e;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    cout << s[i] << ' ';\n  cout << s[k];\n  return 0;\n}\n"}
{"label": "13", "index": "24102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 1;\n    }\n  for (int i = 1; i < n; i++) {\n    if (a[i] > 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k = 2, i;\n  scanf(\"%d\", &n);\n  int a[n + 1];\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  while (k <= n) {\n    scanf(\"%d\", &a[k]);\n    i = 1;\n    while (i <= k - 1) {\n      if (a[i] == a[k])\n        break;\n      else if (i == k - 1)\n        printf(\" %d\", a[k]);\n      i = i + 1;\n    }\n    k = k + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, h = 0; \n  cin >> n;                  \n  int a[n], b[n];            \n  for (i = 0; i <= (n - 1); i++) \n    cin >> a[i];\n  for (i = 0; i <= (n - 1); i++) {\n    if (a[i] != -1) {                      \n      for (j = i + 1; j <= (n - 1); j++) { \n        if (a[i] == a[j]) {                \n          a[j] = -1;                       \n          k = k + 1;                       \n        }\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++) \n    b[i] = a[i];\n  for (i = 0; i <= (n - 1); i++) { \n    if (b[i] != -1) {              \n      cout << b[i];                \n      h++;                         \n    }\n    if (h == 1) \n      break;    \n  }\n  for (i = i + 1; i <= n - 1; i++) { \n    if (b[i] != -1) {                \n      cout << \" \" << b[i];           \n      h++;                           \n    }\n    if (h == n - k) \n      break;        \n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24105", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, s = 0;\n  scanf(\"%d \", &n);\n  if (n < 1 || n > 20000)\n    return 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (a[i] < 10 || a[i] >= 100)\n      return 0;\n  }\n  for (j = 0; j < n - s; j++) {\n    for (i = n - 1 - s; i > j; i--) {\n      if (a[j] == a[i]) {\n        s = s + 1;\n        for (k = i; k < n - s; k++)\n          a[k] = a[k + 1];\n      }\n    }\n  }\n  for (i = 0; i < n - s; i++) {\n    if (i != n - s - 1)\n      cout << a[i] << \" \";\n    else\n      cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, h = 0, k;\n  cin >> n;\n  for (i = 0; i < n; i = i + 1) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j = j + 1) {\n    for (k = 0; k < j; k = k + 1) {\n      if (a[j] == a[k]) {\n        h = 1;\n      }\n    }\n    if (h == 0) {\n      printf(\" %d\", a[j]);\n    }\n\n    else {\n      h = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24107", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint compare(int s, int a[20000], int n) {\n  int i, temp = 0;\n  for (i = 0; i < n; i++) {\n    if (s == a[i]) {\n      return 1;\n      temp = 1;\n      break;\n    } else\n      continue;\n  }\n  if (temp = 0)\n    return 0;\n}\n\nint main() {\n  int n, a[20000], i, j, w = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    if (compare(a[i], a, i) == 1)\n      a[i] = -1;\n    else\n      continue;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == -1)\n      continue;\n    else {\n      if (w == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n      w++;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x, a[20000] = {0}, b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (j = 1; j <= n; j++) {\n    x = 0;\n    for (i = 0; i < j; i++) {\n      if (a[j] == a[i])\n        x++;\n    }\n    if (x == 0)\n      b[j] = a[j];\n    else\n      b[j] = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] != 0)\n      cout << \" \" << b[i];\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int u[20000];\n  int a, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] == u[j])\n        u[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i] != 0) {\n      k++;\n    }\n  }\n  i = 0;\n  l = 0;\n  while (i < n) {\n    if (u[i] != 0)\n\n    {\n      if (l < k - 1) {\n        printf(\"%d \", u[i]);\n        l++;\n      }\n\n      else {\n        printf(\"%d\", u[i]);\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[101];\n  int n, i, x;\n\n  for (i = 0; i <= 100; i++)\n    s[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    if (s[x] == 0) {\n      if (i > 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", x);\n      s[x] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m;\n  int a[20000], b[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      for (j = 0; j < n; j++)\n        if (a[i] == a[j]) {\n          if (i != j && a[j] != 0)\n            a[j] = 0;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k++;\n    }\n  m = k;\n  for (k = 0; k < m - 1; k++)\n    printf(\"%d \", b[k]);\n  cout << b[k];\n}\n"}
{"label": "13", "index": "24112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sign, counter;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  counter = 0;\n  for (i = 0; i < n && counter == 0; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\"%d\", a[i]);\n      counter = counter + 1;\n    }\n  }\n  for (; i < n; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[20001] = {0}, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> m[i];\n  for (i = 1; i <= n; i++)\n    for (int j = i + 1; j <= n; j++)\n      if (m[i] == m[j]) {\n        for (j; j <= n; j++)\n          m[j] = m[j + 1];\n        n = n - 1;\n        i = i - 1;\n      }\n  for (i = 1; i <= n - 1; i++)\n    printf(\"%d \", m[i]);\n  cout << m[n] << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[20001] = {0};\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0)\n      cout << a[i];\n    else {\n      int t = 0;\n      for (int j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t++;\n      }\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k = 0, flag, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    flag = 1;\n    for (j = 0; j <= i - 1; j++)\n      if (b[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[k - 1]);\n}\n"}
{"label": "13", "index": "24116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  int count1, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    count1 = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        count1 = 1;\n        break;\n      }\n    }\n    if (count1 == 0) {\n      if (j == 0)\n        printf(\"%d\", a[0]);\n      else\n        printf(\" %d\", a[j]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (int j = 1; j < n; j++) {\n    l = 0;\n    for (int k = j - 1; k >= 0; k--) {\n      if (a[j] != a[k])\n        l = l;\n      else\n        l = l + 1;\n    }\n    if (l == 0)\n      cout << \" \" << a[j];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24118", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, a[1000] = {0}, j, k, m;\n  cin >> n;\n  cin >> a[1];\n  for (i = 2, m = 2; m <= n; i++, m++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        break;\n      }\n    }\n  }\n  cout << a[1];\n  for (k = 2; k <= i - 1; k++)\n    cout << ' ' << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "24119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[20010];\n\nint main() {\n  int n, i, tmp, k, ii = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &tmp);\n    int j;\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == tmp) {\n        flag = 1;\n      }\n    }\n    if (flag == 0) {\n      a[ii] = tmp;\n      ii++;\n    }\n  }\n  for (k = 0; k < ii - 1; k++) {\n    printf(\"%d \", a[k]);\n  }\n  cout << a[ii - 1];\n}\n"}
{"label": "13", "index": "24120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, j, k, p, t;\n  int a[20002];\n  cin >> n;\n  cin >> a[0];\n  p = 0;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> k;\n    t = 0;\n    for (j = 0; j <= p; j++) {\n      if (a[j] == k) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 1)\n      continue;\n    else {\n      p = p + 1;\n      a[p] = k;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= p; i++)\n    cout << \" \" << a[i];\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, v[20000], m = 0, s[20000], p = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &v[i]);\n  }\n  for (int j = 1; j <= n - 1; j++) {\n    for (int k = 0; k <= j - 1; k++) {\n      if (v[j] != v[k]) {\n        p++;\n      }\n    }\n    if (p == j) {\n      s[m] = v[j];\n      m++;\n    }\n    p = 0;\n  }\n  if (m == 0) {\n    printf(\"%d\", v[0]);\n  } else {\n    printf(\"%d \", v[0]);\n  }\n  for (int k = 0; k <= m - 1; k++) {\n    if (k == m - 1) {\n      printf(\"%d\", s[k]);\n    } else {\n      cout << s[k] << \" \";\n    }\n  }\n}\n"}
{"label": "13", "index": "24122", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], t, i, m;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 1;\n    for (t = 0; t < i; t++) {\n      if (a[i] == a[t]) {\n        m = 0;\n      }\n    }\n    if (m == 1) {\n      if (i > 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int *SZ = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (j == 0) {\n      cout << SZ[j];\n    }\n    for (int k = 0; k < j; k++) {\n      if (SZ[j] == SZ[k]) {\n        break;\n      } else if (k == j - 1)\n        printf(\" %d\", SZ[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, t = 0, b, p;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n - t; j++) {\n    for (k = j + 1; k < n - t;) {\n      if (a[k] == a[j]) {\n        for (p = k; p < n - t; p++)\n          a[p] = a[p + 1];\n        t++;\n      } else {\n        k++;\n      }\n    }\n  }\n  for (b = 0; b < n - 1 - t; b++)\n    cout << a[b] << \" \";\n  cout << a[n - 1 - t] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24125", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, count[101] = {0}, num;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    if (count[num] == 0)\n      if (i == 1)\n        cout << num;\n      else\n        printf(\" %d\", num);\n    count[num]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];           \n  for (i = 1; i < n; i++) \n  {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j]) \n        break;\n    }\n    if (i == j) \n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      {\n        if (a[i] == a[j])\n          a[i] = 0;\n        else\n          a[i] = a[i];\n      }\n    }\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24128", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> m[i];\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if ((i < n) && (i > 0))\n        printf(\" \");\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0}, b[100] = {0}, n, i, j, m = 1, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= m; j++) {\n      if (a[i] == b[j])\n        flag = 1;\n    }\n    if (flag == 1)\n      continue;\n    else {\n      m++;\n      b[m] = a[i];\n      printf(\" %d\", a[i]);\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, sum, num[100000] = {0};\n  scanf(\"%d\", &sum);\n  for (i = 0; i < sum; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < sum; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] == num[j]) {\n        num[i] = 0;\n        break;\n      }\n    }\n  }\n  cout << num[0];\n  for (i = 1; i < sum; i++) {\n    if (num[i] == 0)\n      continue;\n    else\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int m = 0;\n  int a[20001];\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 2; i <= n; i++)\n    for (int j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  cout << a[1];\n  for (int i = 2; i <= n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b = 0, m = 0, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      m = m + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = k + 1;\n    if (a[i] != 0 && k < m)\n      printf(\"%d \", a[i]);\n    if (a[i] != 0 && k == m)\n      printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k = 0, b[20000];\n  scanf(\"%d\", &n);\n  i = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", b[i]);\n    if (i - k + 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20001], b[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      m = m + 1;\n      b[m] = a[i];\n    }\n  }\n  for (i = 1; i <= m - 1; i++)\n    cout << b[i] << \" \";\n\n  cout << b[m] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n = 0, i = 0, j = 0, c = 0;\n  for (i = 0; i < 20000; i++)\n    a[i] = 0;\n  scanf(\"%d \", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\" %d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    c = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        c = 1;\n    if (c == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24137", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i = i + 1) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j = j + 1) {\n    for (k = 0; k < j; k = k + 1) {\n      if (a[j] == a[k]) {\n        h = 1;\n      }\n    }\n    if (h == 0) {\n      printf(\" %d\", a[j]);\n    }\n\n    else {\n      h = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int d;\n  int flag[101];\n  for (i = 0; i <= 100; i++) {\n    flag[i] = 0;\n  }\n  cin >> n;\n  int couted = 0;\n  for (i = 0; i < n; i++) {\n    cin >> d;\n    if (flag[d] == 0) {\n      if (couted == 0) {\n        printf(\"%d\", d);\n        couted = 1;\n      } else {\n        cout << \" \" << d;\n      }\n      flag[d] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (num = 0; num <= (n - 1); num++) {\n    cin >> a[num];\n  }\n  int i, k, q;\n  cout << a[0];\n  for (k = 1; k <= n - 1; k++) {\n    q = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i]) {\n        q++;\n      }\n    }\n    if (q == 0) {\n      cout << \" \" << a[k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24140", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    cin >> a[0];\n    for (i = 1; i < n; i++)\n      scanf(\" %d\", &a[i]);\n    for (i = 0, m = 0; i < n - m - 1; i++) {\n      for (j = i + 1; j < n - m; j++) {\n        if (a[i] != a[j])\n          continue;\n        else {\n          for (k = j; k < n - m - 1; k++)\n            a[k] = a[k + 1];\n          m++;\n          j--;\n        }\n      }\n    }\n    printf(\"%d\", a[0]);\n    for (i = 1; i < n - m; i++)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24141", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (x[i] == x[j] && i != j)\n        x[j] = 0;\n    }\n\n  cout << x[0];\n\n  for (i = 1; i < n; i++) {\n    if (x[i] != 0) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24142", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[20000], judge;\n\n  cin >> n;\n  cout << endl;\n  if (n > 0 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      judge = 0;\n      cin >> judge;\n      if (judge >= 10 && judge < 100)\n\n      {\n        num[i] = judge;\n      }\n    }\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++) {\n        if (num[i] - num[j] == 0)\n\n          num[i] = 0;\n      }\n    printf(\"%d\", num[0]);\n    for (i = 1; i < n; i++) {\n      if (num[i] != 0)\n        cout << \" \" << num[i];\n    }\n  } else {\n    cout << \"error\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24143", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k = 0, num;\n  int a[100] = {0}, b[100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    if (a[num] == 0) {\n      a[num]++;\n      b[k] = num;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << b[i] << \" \";\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24144", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  if (n >= 2) {\n    if (a[1] != a[0])\n      printf(\" %d\", a[1]);\n    for (i = 2; i < n; i++) {\n      if (a[i] != a[0]) {\n        for (j = 0; j < i - 1; j++) {\n          if (a[j] != a[i])\n            continue;\n          else\n            break;\n        }\n        if (a[j] != a[i])\n          printf(\" %d\", a[i]);\n      } else\n        continue;\n    }\n  }\n}\n"}
{"label": "13", "index": "24145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b = 0, m, c[91] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0, m = 0; i < n; i++) {\n    b = 0;\n    scanf(\"%d\", &a);\n    for (j = 0; j < 91; j++) {\n      if (c[j] == a)\n        b = 1;\n    }\n    if (b == 0) {\n      c[m] = a;\n      m = m + 1;\n    }\n  }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, figure[20000] = {0}, flag[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> figure[i];\n  }\n  flag[figure[0]]++;\n  cout << figure[0];\n  for (int i = 1; i < n; i++) {\n    if (flag[figure[i]] == 0) {\n      flag[figure[i]]++;\n      cout << \" \" << figure[i];\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24147", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int shu[n];\n  for (int i = 0; i < n; i++)\n    cin >> shu[i];\n  for (int i = 0; i < n; i++) {\n    if (i == 0)\n      cout << shu[i];\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (shu[i] == shu[j])\n\n          shu[i] = 0;\n      }\n      if (shu[i] != 0)\n        cout << \" \" << shu[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  k = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (a[j] != 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] == a[j])\n          a[i] = 100;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 100) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, temp;\n  cin >> n;\n  const int N = n;\n  int ia[N];\n\n  for (i = 0; i != n; i++)\n    cin >> ia[i];\n\n  i = 1;\n  while (i < n) {\n    temp = n;\n\n    for (int j = 0; j < i; j++) {\n      if (ia[i] == ia[j]) {\n        for (int k = i; k < n - 1; k++)\n          ia[k] = ia[k + 1];\n        n--;\n        break;\n      }\n    }\n    if (n == temp)\n      i++;\n  }\n\n  for (i = 0; i < n - 1; i++)\n    cout << ia[i] << \" \";\n  cout << ia[n - 1] << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "13", "index": "24150", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j, k, flag = 0;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      cin >> a[i];\n      if (a[i] < 10 || a[i] >= 100)\n        scanf(\"%d\", &a[i]);\n      else\n        continue;\n    }\n    printf(\"%d\", a[0]);\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < j; k++) {\n        if (a[j] == a[k]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        printf(\" %d\", a[j]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, k, x;\n  cin >> x;\n  for (i = 0; i < x; i++)\n    cin >> a[i];\n  for (i = 0; i < x; i++) {\n    for (j = i + 1; j < x; j++) {\n      if (a[i] == a[j]) {\n        x--;\n        for (k = j; k < x; k++)\n          a[k] = a[k + 1];\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i < x)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24152", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      if (i != 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  int count1, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    count1 = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        count1 = 1;\n        break;\n      }\n    }\n    if (count1 == 0) {\n      if (j == 0)\n        printf(\"%d\", a[0]);\n      else\n        cout << \" \" << a[j];\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, k;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    cout << a[l] << setw(3);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, b[20000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        b[j]++;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24156", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, p = 1, i = 0, j = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int b[n];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      b[p] = a[i];\n      p++;\n    }\n  }\n\n  cout << b[0];\n\n  for (i = 1; i < p; i++) {\n    cout << \" \" << b[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j, b = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (b = 0, j = 1; j < i; j++) {\n      if (a[i] != a[j])\n        b = b + 1;\n    }\n    if (b == i - 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000] = {0};\n  int n, c, i = 0, j = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &c);\n  a[0] = c;\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &c);\n    a[i] = c;\n    for (j = 0; j <= i - 1; j++) {\n      if (c == a[j])\n        a[i] = 0;\n    }\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, a[20000], i, j;\n  j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  m = 1;\n  if (n > 1) {\n    do {\n\n      for (i = m - 1; i >= 0; i--) {\n        if (a[m] == a[i])\n          j = j + 1;\n      }\n      if (j == 0)\n        cout << \" \" << a[m];\n      j = 0;\n      m = m + 1;\n    } while (m < n);\n  }\n  cout << \"\\n\";\n}\n"}
{"label": "13", "index": "24160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 1;\n    }\n  for (int i = 1; i < n; i++) {\n    if (a[i] > 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24161", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, t, x, a[20000], n, m, l;\n  l = 0;\n  m = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    cin >> x;\n\n    for (i = 1; i <= m + 1; i++)\n      if (x == a[i - 1])\n        l = 1;\n    if (l == 0) {\n      a[m] = x;\n      m = m + 1;\n    }\n    l = 0;\n  }\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= m - 1; t++)\n    printf(\" %d\", a[t]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24162", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[20000];\n  int n, i, j, l, k;\n  cin >> n;\n  l = n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < l - 1; i++) {\n    for (j = i + 1; j < l; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < l - 1; k++)\n          a[k] = a[k + 1];\n        j--;\n        l--;\n      }\n    }\n  }\n  cout << a[0];\n\n  for (i = 1; i < l; i++)\n    cout << ' ' << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, *a, i, j, r, d = 0;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &*(a + i));\n  for (i = 0; i < n; i++) {\n    r = 0;\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        r = 1;\n    }\n    if (r == 0 && d == 0) {\n      printf(\"%d\", *(a + i));\n      d = 1;\n    } else if (r == 0 && d == 1)\n      printf(\" %d\", *(a + i));\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000] = {0}, t[10000] = {0}, s, b, c, k = 0, i = 0, n;\n  scanf(\"%d\", &n);\n  printf(\"\\n\");\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    for (b = 0, c = 0; b <= i - 1; b++)\n      if (a[i] == a[b])\n        c = c + 1;\n    if (c == 0) {\n      t[k] = a[i];\n      k++;\n    }\n  }\n  if (k == 0)\n    printf(\"%d\", a[0]);\n  if (k > 0) {\n    printf(\"%d \", a[0]);\n    for (s = 0; s <= k - 2; s++)\n      printf(\"%d \", t[s]);\n    printf(\"%d\", t[k - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = i;\n  }\n  for (i = 0; i < k; i++) {\n    if (a[i] != 0)\n      cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[k]);\n}\n"}
{"label": "13", "index": "24166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, c = 0, q[20001];\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &q[k]);\n  printf(\"%d\", q[0]);\n  for (i = 1; (i < n); i++) {\n    c = 0;\n    for (j = 0; j < i; j++) {\n      if (q[j] == q[i])\n        c++;\n      else\n        c = c + 0;\n    }\n\n    if (c == 0)\n      printf(\" %d\", q[i]);\n    else\n      f++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24167", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint a[20000] = {0}, b[20000] = {0};\nint main() {\n  int i, j, k = 0, g = 0, kk = 0;\n  cin >> n;\n  for (i = 0; i < n; ++i)\n    cin >> a[i];\n\n  for (i = 0; i < n; ++i) {\n    for (j = i + 1; j < n; ++j) {\n      if (a[i] == a[j]) {\n        a[j] = -1;\n      }\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    if (a[i] >= 0) {\n      b[k] = a[i];\n      ++k;\n    }\n  }\n  for (i = 0; i < k - 1; ++i) {\n    cout << b[i] << \" \";\n  }\n  cout << b[k - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, k = 0, b[20000];\n  scanf(\"%d\", &n);\n  i = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", b[i]);\n    if (i - k + 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24169", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[30000];\nint find(int k) \n{\n  int i;\n  for (i = 0; i < k; i++)\n\n  {\n    if (a[i] == a[k])\n      return 1;\n  } \n\n  return 0; \n}\n\nint main() {\n  int n;\n  cin >> n; \n  for (int i = 0; i < n; i++)\n    cin >> a[i]; \n\n  cout << a[0];\n  for (int k = 1; k < n; k++) {\n    if (find(k) == 0)\n      cout << \" \" << a[k];\n\n  } \n  return 0;\n}\n"}
{"label": "13", "index": "24170", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, p;\n  int a[20000];\n  int b[20000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  b[0] = 0;\n\n  for (j = 1; j < n; j++) {\n    b[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        b[j]++;\n    }\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (p = 1; p < n; p++) {\n    if (b[p] == 0)\n      printf(\" %d\", a[p]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24171", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n;\n  cin >> n;\n  int *N = (int *)malloc(sizeof(int) * n);\n  for (int k = 0; k < n; k++) {\n    cin >> (N[k]);\n  }\n  for (i = 1; i < n; i++) {\n    for (int r = 0; r < i; r++) {\n      if (N[i] == N[r]) {\n        for (int j = i; j < n; j++) {\n          N[j] = N[j + 1];\n        }\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", N[i]);\n    else {\n      printf(\"%d \", N[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24172", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct arr {\n  long int num;\n  struct arr *next;\n};\nint n;\nstruct arr *create(int m) {\n  struct arr *head;\n  struct arr *p1, *p2;\n  n = 1;\n  p1 = p2 = (struct arr *)malloc(1000);\n  cin >> p1->num;\n  head = p1;\n  while (n < m) {\n    p1 = (struct arr *)malloc(1000);\n    p2->next = p1;\n    n++;\n    p2 = p1;\n    cin >> p1->num;\n  }\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct arr *head) {\n  struct arr *p;\n  p = head;\n  while (p != NULL) {\n    if (p == head)\n      printf(\"%ld\", p->num);\n    else\n      printf(\" %ld\", p->num);\n    p = p->next;\n  }\n}\nvoid freelist(struct arr *head) {\n  struct arr *p = head;\n  while (p != NULL) {\n    head = head->next;\n    free(p);\n    p = head;\n  }\n}\nstruct arr *del(struct arr *head, long int dnum) {\n  struct arr *p1, *p2;\n  p1 = p2 = head;\n  while (p1 != NULL && p1->num == dnum) {\n    head = p1->next;\n    p2 = head;\n    free(p1);\n    p1 = head;\n  }\n  while (p1 != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n    while (p1 != NULL && p1->num == dnum) {\n      p2->next = p1->next;\n      free(p1);\n      p1 = p2->next;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  int m;\n  struct arr *head, *p;\n  cin >> m;\n  head = create(m);\n  p = head;\n  while (p != NULL) {\n    p->next = del(p->next, p->num);\n    p = p->next;\n  }\n  print(head);\n  freelist(head);\n}\n"}
{"label": "13", "index": "24173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x, q;\n\n  cin >> m;\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  x = 0;\n  q = 0;\n  if (n[0] == 1)\n    printf(\"%d\", b[0]);\n  else if (n[0] >= 2) {\n    cout << b[0];\n    n[0] = 0;\n  }\n\n  for (j = 1; b[j] != 0; j++) {\n    if (n[j] == 1)\n      printf(\" %d\", b[j]);\n    else if (n[j] >= 2) {\n      printf(\" %d\", b[j]);\n      n[j] = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - m; i++) {\n    for (j = i + 1; j <= n - m; j++) {\n      if (a[j] == a[i]) {\n        m = m + 1;\n        for (k = j; k <= n - m; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n      }\n    }\n  }\n  for (i = 0; i < n - m - 1; i++)\n    cout << a[i] << \" \";\n\n  printf(\"%d\\n\", a[n - m - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n + 1];\n  a[n] = 0;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  if (a[i] != 0)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20100], i, j;\n  cin >> n;\n  scanf(\"%d\", a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i)\n      cout << \" \" << *(a + i);\n  }\n}\n"}
{"label": "13", "index": "24177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, flag, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], i, n, k, t;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    t = 0;\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k])\n        t = 1;\n    }\n    if (t == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int i, I, n, j;\n  int k = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (I = 1; I < n; I++) {\n    for (i = 0; i < I; i++) {\n      if (a[I] == a[i]) {\n        a[I] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0) {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] != 0) {\n          a[i] = a[j];\n          a[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - k - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "24180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001], x = 0, t, m;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &n);\n  cin >> m;\n  printf(\"%d\", m);\n  a[m] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    if (a[t] != 1) {\n      cout << \" \" << t;\n      a[t] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24181", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[20001] = {0}, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> m[i];\n  for (i = 1; i <= n; i++)\n    for (int j = i + 1; j <= n; j++)\n      if (m[i] == m[j]) {\n        for (j; j <= n; j++)\n          m[j] = m[j + 1];\n        n = n - 1;\n        i = i - 1;\n      }\n  for (i = 1; i <= n - 1; i++)\n    cout << m[i] << ' ';\n  cout << m[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24182", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint check(int b[], int len, int x) {\n  int i, flag = 1;\n  for (i = 0; i < len; i++) {\n    if (b[i] == x) {\n      flag = 0;\n      return 0;\n      break;\n    }\n  }\n  if (flag)\n    return 1;\n}\nint main() {\n  int j, i, n;\n  int a[20100], b[20100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  b[0] = a[0];\n  j = 1;\n  for (i = 1; i < n; i++) {\n    if (check(b, j, a[i])) {\n      printf(\" %d\", a[i]);\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int a[20000], i, n, k, j, m;\n  scanf(\"%d\", &n);\n  m = n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n\n        n--;\n        for (j = i; j < n; j++) {\n          a[j] = a[j + 1];\n        }\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (i < n - 1) {\n      printf(\"%d \", a[i]);\n    } else {\n      printf(\"%d\", a[n - 1]);\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24184", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, j, m, k, n;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < k; i++) {\n    for (j = 0, m = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        n = 0;\n      else\n        n = 1;\n      m = m * n;\n    }\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i1, i2, i3, flag = 1; \n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i1 = 0; i1 < n; i1++)\n    scanf(\"%d\", &a[i1]);\n  printf(\"%d\", a[0]);\n  for (i2 = 1; i2 < n; i2++) {\n    flag = 1;\n    for (i3 = 0; i3 < i2; i3++) {\n      if (a[i2] == a[i3])\n        flag *= 0;\n    }\n    if (flag == 1)\n      printf(\" %d\", a[i2]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t[20000], a, s[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 100; i++) {\n    s[i] = 0;\n  }\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &t[i]);\n    if (s[t[i]] == 0) {\n      s[t[i]] = 1;\n    } else if (s[t[i]] == 1) {\n      t[i] = 101;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (t[i] != 101) {\n      a = i;\n      printf(\"%d\", t[i]);\n      break;\n    }\n  }\n\n  for (i = a + 1; i < n; i++) {\n    if (t[i] != 101) {\n      printf(\" %d\", t[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        b[i]++;\n        break;\n      }\n  for (i = 1; i < n; i++)\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24188", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  cin >> n;\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "13", "index": "24189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, x;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = x;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (t = j; t < n; t++)\n          a[t] = a[t + 1];\n\n        n--;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int num[20001] = {0};\n  for (i = 1; i <= n; i++)\n    cin >> num[i];\n  printf(\"%d\", num[1]);\n  for (i = 2; i <= n; i++) {\n    int k = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (num[i] == num[j]) {\n        k = 1;\n        break;\n      }\n    if (k == 0)\n      cout << \" \" << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j, b = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (b = 0, j = 1; j < i; j++) {\n      if (a[i] != a[j])\n        b = b + 1;\n    }\n    if (b == i - 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], k, j, b, c, d, e, f, i;\n  scanf(\"%d\", &b);\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (j = 1; j < b; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j])\n        break;\n    }\n    if (k == j)\n      printf(\" %d\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[30000], j;\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24194", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, m = 1, x, a[1000];\n  cin >> n;\n  if (n == 0)\n    return 0;\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[0] = x;\n  for (j = 1; j < n; j++) {\n    scanf(\"%d\", &x);\n    k = 0;\n    while ((k < m) && (a[k] != x))\n      k++;\n    if (k == m) {\n      a[m++] = x;\n      printf(\" %d\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24195", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20010], b[20010] = {0}, m = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 0; j <= m; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n      if (j == m) {\n        b[m] = a[i];\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (i == m - 1)\n      cout << b[i];\n    else\n      printf(\"%d \", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        a[i] = -1;\n        break;\n      }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24197", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, flag, g;\n  scanf(\"%d \", &n);\n  g = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    flag = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag == 1)\n      if (g) {\n        cout << \" \" << a[i];\n      } else {\n        cout << a[i];\n        g = 1;\n      }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[100000], sum = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n  } else {\n    printf(\"%d\", a[0]);\n    for (i = 1; i <= n - 1; i++) {\n      sum = 0;\n      for (j = 0; j <= i - 1; j++) {\n        if (a[i] == a[j]) {\n          sum = 1;\n        }\n      }\n      if (sum == 0) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int input[20000], output[20000], n, i, j, outLen = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n    output[outLen] = input[i];\n    for (j = 1; j < outLen; j++) {\n      if (input[i] == output[j])\n        outLen = outLen - 1;\n    }\n    outLen = outLen + 1;\n  }\n\n  for (i = 1; i < outLen; i++) {\n    printf(\"%d\", output[i]);\n    if (i != outLen - 1) {\n      cout << \" \";\n    }\n  }\n}\n"}
{"label": "13", "index": "24200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000] = {0}, k;\n  scanf(\"%d\", &n);\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n    if (b[k] == 0) {\n      a[j] = k;\n      j++;\n      b[k] = 1;\n    }\n  }\n  for (i = 1; i < j; i++) {\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[100000], j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] == a[0])\n      a[i] = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n      for (j = i + 1; j < n; j++)\n        if (a[j] == a[i])\n          a[j] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  int a[20000];\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  b = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = 1;\n  printf(\"%d\", a[0]);\n  while (i < n) {\n    while ((j < i) && (b == 0)) {\n      if (a[j] != a[i]) {\n        j++;\n      } else {\n        b = 1;\n      }\n    }\n    if (b == 0) {\n      printf(\" %d\", a[i]);\n    }\n    i++;\n    j = 0;\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[91];\n  int i;\n  for (i = 0; i < 91; i++)\n    a[i] = 0;\n  cin >> n;\n  cin >> i;\n  printf(\"%d\", i);\n  a[i - 10] = 1;\n  while (n > 0) {\n    n--;\n    int b;\n    cin >> b;\n    if (a[b - 10] == 0) {\n      cout << ' ' << b;\n      a[b - 10] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      else\n        continue;\n    }\n    if (j == i) {\n      if (i == 0)\n        printf(\"%d\", a[i]);\n      else\n        printf(\" %d\", a[i]);\n    } else\n      continue;\n  }\n}\n"}
{"label": "13", "index": "24205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, q = 1, k;\n  int sz[20000], jieguo[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> sz[i];\n  }\n  jieguo[0] = sz[0];\n  for (int i = 1; i <= n; i++) {\n    k = 0;\n    for (int j = 0; j < q; j++) {\n      if (jieguo[j] == sz[i])\n        break;\n      else {\n        k += 1;\n      }\n    }\n    if (k == q) {\n      jieguo[q] = sz[i];\n      q += 1;\n    }\n  }\n  for (int i = 0; i < q - 1; i++) {\n    if (i != q - 2) {\n      printf(\"%d \", jieguo[i]);\n    } else {\n      cout << jieguo[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24206", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200000], n, m, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  while (i < n) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        m = m + 1;\n      }\n    }\n    if (m == 0 && i == 0)\n      cout << a[i];\n    if (m == 0 && i != 0)\n      cout << ' ' << a[i];\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24207", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i = 0, j = 0, k = 0,\n         step = 0; \n  cin >> n;\n  int a[n];               \n  for (i = 0; i < n; i++) \n    cin >> a[i];\n  for (i = 0; i < n - 1 - step; i++) {\n    for (j = i + 1; j < n - step; j++) {\n      if (a[i] ==\n          a[j]) { \n        if (j == n - 1 - step) { \n          step++;\n          continue;\n        }\n        for (k = j; k < n - 1 - step; k++) \n          a[k] = a[k + 1];\n        step++; \n        j--;    \n      }\n    }\n  }\n  for (i = 0; i < n - step - 1; i++) \n    cout << a[i] << ' ';             \n  cout << a[n - 1 - step] << endl;   \n  return 0;\n}\n"}
{"label": "13", "index": "24208", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n; \n  cin >> n;\n  int a[n], i, j; \n  for (i = 0; i < n; i++) {\n    cin >> a[i];              \n    for (j = 0; j < i; j++) { \n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) { \n      if (i != 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    } else if (m == 0 && k != 0) {\n      b[k] = a[0];\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "13", "index": "24210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[20000];\n  int i, j, k, h;\n  int check[20000];\n  int n;\n  cin >> n;\n  check[0] = 0;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 1; j < n; j++) {\n    check[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (num[j] == num[k]) {\n        check[j] = 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (h = 1; h < n; h++) {\n    if (check[h] == 0)\n      printf(\" %d\", num[h]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n, i, m, r;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    r = 0;\n    scanf(\"%d\", &a[i]);\n    for (m = 1; m < i; m++) {\n      if (a[i] == a[m])\n        r++;\n    }\n    if (r == 0)\n      cout << \" \" << a[i];\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[100], k, b[100], j;\n  cin >> n;\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  j = 1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &k);\n\n    if (a[k] == 0) {\n      b[j] = k;\n      j++;\n    }\n    a[k] = 1;\n  }\n  for (i = 1; i < (j - 1); i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "24213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, l = 0, excit = 0;\n  cin >> k;\n  int num[k], shulie[k];\n\n  for (i = 1; i <= k; i++) {\n    scanf(\"%d\", &num[i - 1]);\n    for (j = 0; j <= i - 2; j++)\n      if (num[j] == num[i - 1]) {\n        excit = 1;\n        break;\n      }\n    if (excit == 0) {\n      shulie[l] = num[i - 1];\n      l = l + 1;\n    } else\n      excit = 0;\n  }\n  printf(\"%d\", shulie[0]);\n  for (i = 2; i <= l; i++)\n    printf(\" %d\", shulie[i - 1]);\n}\n"}
{"label": "13", "index": "24214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  if (n >= 2) {\n    if (a[1] != a[0])\n      printf(\" %d\", a[1]);\n    for (i = 2; i < n; i++) {\n      if (a[i] != a[0]) {\n        for (j = 0; j < i - 1; j++) {\n          if (a[j] != a[i])\n            continue;\n          else\n            break;\n        }\n        if (a[j] != a[i])\n          cout << \" \" << a[i];\n      } else\n        continue;\n    }\n  }\n}\n"}
{"label": "13", "index": "24215", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, g, p = 0;\n\n  cin >> n;\n  int a[n + 1];\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (j = 1; j <= n; j++) {\n    g = 0;\n\n    for (k = 1; k <= j - 1; k++) {\n      if (a[j] == a[k]) {\n        g = 1;\n      }\n    }\n\n    if (g == 0) {\n      if (p != 0) {\n        cout << \" \";\n      }\n      printf(\"%d\", a[j]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24216", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, w[200];\n  scanf(\"%d \", &n);\n  memset(w, 0, sizeof(w));\n  for (int i = 0; i < n; i++) {\n    cin >> k;\n    if (!w[k]) {\n      if (i)\n        printf(\" \");\n      w[k] = 1;\n      printf(\"%d\", k);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, k; \n  cin >> n;          \n  int a[20001];      \n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) \n  {\n    for (j = i + 1; j < n; j++) \n    {\n      if (a[i] == a[j]) \n      {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1]; \n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  }\n  for (l = 0; l < n; l++)\n    cout << a[l] << setw(3); \n  return 0;                  \n} \n"}
{"label": "13", "index": "24218", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], m;\n  cin >> n;\n  if (n >= 1 && n <= 20000) {\n\n    for (i = 0; i < n; i++) {\n      m = 0;\n      if (i == 0) {\n        scanf(\"%d\", &a[0]);\n        printf(\"%d\", a[0]);\n      } else {\n        scanf(\" %d\", &a[i]);\n        for (j = 0; j < i; j++) {\n          if (a[i] == a[j]) {\n            m++;\n          }\n        }\n        if (m == 0) {\n          printf(\" %d\", a[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24219", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, num[20010], m;\n  scanf(\"%d \", &n);\n  m = n;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] == num[i] && num[j] != 0) {\n        num[j] = 0;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (num[i] != 0) {\n      m--;\n      if (m > 0)\n        cout << num[i] << \" \";\n      else\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d\", &a[i]);\n  for (i = (n - 1); i >= 0; i--) {\n    for (k = i - 1; k >= 0; k--)\n      if ((a[i] - a[k]) == 0) {\n        a[i] = 0;\n        break;\n      }\n  }\n  if (a[0] > 9)\n    printf(\"%d\", a[0]);\n  for (i = 1; i <= (n - 1); i++) {\n    if (a[i] > 9)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24221", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[91], count = 0, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      count++;\n      b[count] = a[i];\n      if (count == 90)\n        break;\n    }\n    if (count == 90)\n      break;\n  }\n  if (count > 1) {\n    for (i = 1; i <= count - 1; i++)\n      cout << b[i] << \" \";\n    cout << b[count] << endl;\n  } else if (count == 1)\n    cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24222", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[20000], m = 0, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1, j = 1; i < n; i++) {\n    for (k = 0; k < j; k++) {\n      if (a[i] == b[k])\n        m = 1;\n    }\n    if (m != 1) {\n      b[j] = a[i];\n      j++;\n    }\n    m = 0;\n  }\n  for (i = 0; i < j - 1; i++)\n    cout << b[i] << ' ';\n  cout << b[j - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000] = {0};\n  int i, j, k = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == 0) {\n        if (a[i] == a[j]) {\n          b[j] = 1;\n          k++;\n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20100], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i)\n      cout << \" \" << *(a + i);\n  }\n}\n"}
{"label": "13", "index": "24225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, b[100], t = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < t; j++)\n      if (a[i] == b[j])\n        break;\n    if (j >= t) {\n      b[t] = a[i];\n      t++;\n    }\n  }\n  for (j = 1; j < t - 1; j++) {\n    printf(\"%d \", b[j]);\n  }\n  printf(\"%d\", b[t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, t, s, r;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (t = 1; t <= n - 1; t++) {\n    r = 0;\n    for (s = 0; s <= t - 1; s++) {\n      if (a[t] == a[s])\n        break;\n      else\n        r++;\n    }\n    if (r == t)\n      cout << \" \" << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  k = 0;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (a[j] != 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] == a[j]) {\n          a[i] = 100;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 100) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, flag;\n  scanf(\"%d\", &n);\n  int a[200000];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1)\n    printf(\"%d\", a[1]);\n  else {\n    printf(\"%d\", a[1]);\n    for (i = 2; i <= n; i++) {\n      for (m = 1; m < i; m++) {\n        if (a[i] == a[m]) {\n          flag = 1;\n          break;\n        } else\n          flag = -1;\n      }\n      if (flag == -1)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, i, j, n, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (j = n - 1; a[j] == 0; j--)\n    k = 0;\n  for (i = 0; i < j; i++)\n    if (a[i] != 0)\n      printf(\"%d \", a[i]);\n  cout << a[j];\n  return 0;\n}\n"}
{"label": "13", "index": "24230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, k, n, count = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 1, k = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      a[k] = a[i];\n      k++;\n      count++;\n    }\n  }\n  cout << a[0];\n  for (k = 1; k <= count; k++)\n    printf(\" %d\", a[k]);\n  return 0;\n}\n"}
{"label": "13", "index": "24231", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, i, j, k = 1, num[20000];\n  cin >> n;\n  cin >> a;\n  num[0] = a;\n  for (i = 1; i < n; i++) {\n    cin >> a;\n    for (j = 0; j < k; j++) {\n      if (a == num[j]) {\n        break;\n      }\n    }\n    if (j == k) {\n      num[k] = a;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, x[20000]; \n  cin >> n;\n  for (i = 0; i < n; i++) \n  {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) \n    {\n      if (x[i] == x[j] && i != j) \n      {\n        x[j] = 0;\n      }\n    }\n\n  cout << x[0]; \n\n  for (i = 1; i < n; i++) {\n    if (x[i] != 0) \n    {\n      cout << \" \" << x[i];\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], i, j, n, t, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    t = 0;\n    count = 0;\n    for (j = i; j >= 0; j--) {\n      count++;\n      if (a[i] == a[j] && (i != j)) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0 && count == 1) {\n      printf(\"%d\", a[i]);\n    } else if ((t == 0) && (count != 1)) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100001], h, i, j;\n  char c;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    h = 0;\n    scanf(\"%d%c\", &a[i], &c);\n    if (i == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (j = 1; j < i; j++)\n        if (a[j] == a[i]) {\n          h = 1;\n          break;\n        }\n      if (h == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[9000], ans[9000];\n  scanf(\"%d\", &n);\n  int i, j;\n  int num = 1, t = 0;\n  scanf(\"%d\", &a[0]);\n  ans[0] = a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    int j = 0;\n    while (j < num) {\n      if (a[i] == ans[j]) {\n        t = 1;\n        break;\n      }\n      j++;\n    }\n    if (t == 0) {\n      ans[num] = a[i];\n      printf(\" %d\", ans[num]);\n      num++;\n    } else\n      t = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, i, now, sign;\n\n  scanf(\"%d\", &n);\n  sign = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &now);\n    if (a[now] == 0) {\n      a[now] = 1;\n      if (sign == 1)\n        printf(\" \");\n      else\n        sign = 1;\n      printf(\"%d\", now);\n    }\n  }\n  printf(\" \");\n  ;\n  return 0;\n}\n"}
{"label": "13", "index": "24237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  long n;\n  cin >> n;\n  bitset<101> b;\n  for (long i = 0; i < n; i++) {\n    long x;\n    cin >> x;\n    if (!b.test(x)) {\n      if (i)\n        cout << ' ';\n      cout << x;\n      b.set(x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], t, j, m, i, asd;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    t = 1;\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    } else if (i != 0) {\n      for (j = 0; j < i; j++) {\n        asd = a[i] - a[j];\n        if (asd == 0) {\n          t = 0;\n          break;\n        }\n      }\n      if (t == 1)\n        cout << \" \" << a[i];\n    }\n  }\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, timer, k, k0;\n  timer = 0;\n  k0 = 0;\n  k = -1;\n  int l[100000], r[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> l[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (l[i] == l[j]) {\n        l[j] = 10000;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] == 10000) {\n      timer++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (l[i] != 10000) {\n\n      k0++;\n      k++;\n      r[k] = l[i];\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < k0; i++) {\n    if (k == 0) {\n      printf(\"%d\", r[i]);\n    } else if (k != 0 && i < k0 - 1) {\n      printf(\"%d \", r[i]);\n    } else if (i == k0 - 1)\n      printf(\"%d\", r[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[20000], output[20000];\n  int i = 0, n = 0, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    for (j = 0; j < k; j++)\n      if (num[i] == output[j])\n        num[i] = 0;\n    if (num[i] != 0) {\n      output[k] = num[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", output[i]);\n  printf(\"%d\", output[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 0;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n    }\n    if (k == i)\n      cout << \" \" << a[i];\n    k = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint god(int num1, int num2);\nint main(void) {\n  int number, ctr, i;\n  int n[20000], c[20000];\n  scanf(\"%d\", &number);\n  for (i = 0; i <= 20000; i++) {\n    c[i] = 0;\n  }\n  for (ctr = 0; ctr < number; ctr++) {\n    scanf(\"%d\", &n[ctr]);\n  }\n  printf(\"%d\", n[0]);\n  for (ctr = 1; ctr < number; ctr++) {\n    for (i = 0; i < ctr; i++) {\n      if (n[i] == n[ctr]) {\n        c[ctr]++;\n      }\n    }\n    if (c[ctr] == 0)\n      printf(\" %d\", n[ctr]);\n  }\n\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24243", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x = 0, n, a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      x++;\n      if (x == 1) {\n        cout << a[i];\n      } else {\n        cout << \" \" << a[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24244", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 0, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        a[i] = -1;\n        break;\n      }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b = 0, m = 0, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      m = m + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = k + 1;\n    if (a[i] != 0 && k < m)\n      cout << a[i] << \" \";\n    if (a[i] != 0 && k == m)\n      printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, count[91] = {0};\n  cin >> n;\n  cin >> x;\n  cout << x;\n  count[x - 10]++;\n  for (int i = 1; i <= n - 1; i++) {\n    scanf(\"%d \", &x);\n    if (count[x - 10] == 0) {\n      cout << \" \" << x;\n    }\n    count[x - 10]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24247", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, number;\n  int a[100] = {0}; \n\n  cin >> n;\n  i = 0;\n  for (j = 1; j <= n; j++) {\n    cin >> number;\n    if (a[number] == 0) \n    {\n      a[number]++;\n      if (i == 0) \n      {\n        cout << number;\n        i = 1;\n      } else {\n        cout << \" \" << number;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  ;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1 - m; i++)\n    for (j = i + 1; j < n - m;)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n      } else\n        j++;\n  for (i = 0; i < n - 1 - m; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - m - 1]);\n}\n"}
{"label": "13", "index": "24249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100000];\nint n;\nvoid del_a(int x) {\n  for (int i = x; i < n - 1; i++) {\n    a[i] = a[i + 1];\n  }\n  a[n - 1] = 0;\n  n = n - 1;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        del_a(i);\n        i = i - 1;\n        break;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001] = {0}, j, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (l = (i + 1); l < n; l++) {\n      if (a[l] == a[i]) {\n        for (j = (l + 1); j < n; j++) {\n          a[j - 1] = a[j];\n        }\n        l -= 1;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      printf(\" %d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[30000], j;\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  int a[20000];\n  int count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int count = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (count == 0)\n      printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n\n    if (t == 0) {\n      if (m > 0)\n        cout << \" \";\n      cout << a[i];\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, m, j, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        m += 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      if (i != 0)\n        cout << \" \";\n      printf(\"%d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200000], n, m, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  while (i < n) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        m = m + 1;\n      }\n    }\n    if (m == 0 && i == 0)\n      cout << a[i];\n    if (m == 0 && i != 0)\n      cout << ' ' << a[i];\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k = 0, l = 0, g = 0, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    for (i = n - 1; i >= 0; i--) {\n      if (a[n - 1] == a[i])\n        k++;\n    }\n    if (k == n)\n      printf(\"%d\", a[0]);\n    else {\n      cout << a[0] << \" \";\n      for (i = 1; i < n; i++) {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[i] != a[j])\n            l++;\n        }\n        if (l == i) {\n          b[g] = a[i];\n          g++;\n        }\n        l = 0;\n      }\n      for (i = 0; i < g - 1; i++) {\n        printf(\"%d \", b[i]);\n      }\n      printf(\"%d\", b[g - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, s = 0, num = 0, k = 0;\n  int a[20006];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n; k++) {\n          a[k] = a[k + 1];\n        }\n        n--;\n        j--;\n        s++;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  int a[100] = {0};\n  cin >> k;\n  a[k] = a[k] + 1;\n  printf(\"%d\", k);\n  for (i = 2; i <= n; i++) {\n    cin >> k;\n    a[k] = a[k] + 1;\n    if (a[k] == 1)\n      cout << \" \" << k;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s[20000], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  cout << s[0];\n  a[s[0]] = 1;\n  for (i = 1; i < n; i++)\n    if (a[s[i]] == 0) {\n      cout << \" \" << s[i];\n      a[s[i]] = 1;\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, a[20000], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &b);\n    a[i] = b;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[101];\n  int b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    { scanf(\"%d\", &b); }\n    if (a[b] == 1) {\n      a[b] = 1;\n    } else {\n      if (i != 0) {\n        cout << \" \";\n      }\n      cout << b;\n      a[b] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, flag;\n  scanf(\"%d\", &n);\n  int a[200000];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1)\n    cout << a[1];\n  else {\n    cout << a[1];\n    for (i = 2; i <= n; i++) {\n      for (m = 1; m < i; m++) {\n        if (a[i] == a[m]) {\n          flag = 1;\n          break;\n        } else\n          flag = -1;\n      }\n      if (flag == -1)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, sum, num[100000] = {0};\n  scanf(\"%d\", &sum);\n  for (i = 0; i < sum; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < sum; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] == num[j]) {\n        num[i] = 0;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i < sum; i++) {\n    if (num[i] == 0)\n      continue;\n    else\n      printf(\" %d\", num[i]);\n  }\n}\n"}
{"label": "13", "index": "24264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  int b[20001] = {0};\n  int c[20001] = {0};\n  int l = 1;\n  for (int j = 1; j <= n; j++) {\n    for (int k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        b[j] = 1;\n      }\n    }\n  }\n  for (int p = 1; p <= n; p++) {\n    if (b[p] == 0) {\n      c[l] = a[p];\n      l = l + 1;\n    }\n  }\n  for (int m = 1; c[m] > 0; m++) {\n    if (c[m + 1] > 0)\n      cout << c[m] << \" \";\n    if (c[m + 1] == 0)\n      cout << c[m] << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20001] = {0}, count = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        count++;\n        a[i] = 0;\n      }\n    }\n  }\n  cout << a[1];\n  for (int i = 2; i <= n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == a[i])\n        b[j] = 0;\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "24267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num;\n  cin >> n;\n  int a[n];\n  for (num = 0; num <= (n - 1); num++) {\n    cin >> a[num];\n  }\n  int i, k, q;\n  cout << a[0];\n  for (k = 1; k <= n - 1; k++) {\n    q = 0;\n    for (i = 0; i < k; i++) {\n      if (a[k] == a[i]) {\n        q++;\n      }\n    }\n    if (q == 0) {\n      cout << \" \" << a[k];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24268", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, s[200001] = {0}, k[100] = {0};\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    k[s[i]]++;\n  }\n  int flag[100] = {0};\n  for (int i = 0; i < n; i++) {\n    if (k[s[i]] == 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        cout << s[i];\n      if (i != 0)\n        cout << \" \" << s[i];\n    }\n    if (k[s[i]] != 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        cout << s[i];\n      if (i != 0)\n        cout << \" \" << s[i];\n      flag[s[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n[101] = {0};\n  int nin;\n  cin >> nin;\n  int N;\n  int num[nin], count = 0;\n  for (int i = 1; i <= nin; ++i) {\n    cin >> N;\n    if (!n[N]) {\n      num[count] = N;\n      count++;\n    }\n    n[N]++;\n  }\n  for (int i = 0; i <= count - 2; ++i)\n    cout << num[i] << ' ';\n  cout << num[count - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, flag;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\" %d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        k++;\n    if (k == 0)\n      printf(\" %d\", a[i]);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n\n  int a[30000] = {0};\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i <= n - 1; i++)\n\n  {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n\n        cout << \" \";\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, count[101] = {0}, num;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    if (count[num] == 0)\n      if (i == 1) {\n        cout << num;\n      } else\n        printf(\" %d\", num);\n    count[num]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], n = 0, i = 0, j = 0, c = 0;\n\n  for (i = 0; i < 20000; i++)\n    a[i] = 0;\n\n  cin >> n;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n\n  for (i = 1; i < n; i++) {\n    c = 0;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        c = 1;\n    if (c == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100000], b[100000] = {0};\n  int i, j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == 0) {\n\n        if (i != j) {\n\n          if (a[i] == a[j]) {\n            b[j] = 1;\n          }\n        } else\n          continue;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      printf(\" \");\n      printf(\"%d\", a[i]);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24276", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, b[20001], c[20001], i = 0, j = 1, l, m;\n  cin >> n;\n  for (l = 0; l < 20001; l++) {\n    b[l] = 0;\n  }\n  for (m = 0; m < 20001; m++) {\n    c[m] = 0;\n  }\n  while (j <= n) {\n    cin >> k;\n    if (b[k] == 0) {\n      c[i] = k;\n    }\n    b[k]++;\n    i++;\n    j++;\n  }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n; i++) {\n    if (c[i] != 0) {\n      cout << \" \" << c[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[101] = {0}, i, num = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      num++;\n      if (num == 1)\n        cout << a[i];\n      if (num != 1)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, t = 1, sum, n;\n  cin >> n;\n  int x[20000], y[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  x[0] = y[0];\n  int k = 0;\n  for (i = 1; i < n; i++) {\n    sum = 1;\n    for (j = 0; j <= k; j++)\n      sum = sum * (y[i] - x[j]);\n    if (sum != 0) {\n      x[k + 1] = y[i];\n      k++;\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= k; i++)\n    printf(\" %d\", x[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24279", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j;\n  cin >> n;\n  int count = n;\n  for (i = 0; i < count; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < count; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    ;\n  else {\n    int a[n];\n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      int k = 0, j;\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          k++;\n      if (k == 0)\n        cout << ' ' << a[i];\n    }\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "13", "index": "24281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], k = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i - 1]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (j == i)\n      k++;\n  }\n  if (k == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        printf(\"%d\\n\", a[i]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i) {\n        printf(\"%d\", a[i]);\n        t++;\n        if (t < k)\n          printf(\" \");\n        else\n          printf(\"\\n\");\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001] = {0}, i, j, count = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == a[j])\n        a[j] = a[20000];\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && count == 0) {\n      cout << a[i];\n      count++;\n    } else if (a[i] != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24283", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0;\n  cin >> n;\n  int x[n];\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n    for (k = 0; k < i; k++) {\n      if (x[k] == x[i]) {\n        i--;\n        n--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24285", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  int count1, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (j = 0; j < n; j++) {\n    count1 = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k]) {\n        count1 = 1;\n        break;\n      }\n    }\n    if (count1 == 0) {\n      if (j == 0)\n        cout << a[0];\n      else\n        printf(\" %d\", a[j]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int a[20000];\n  cin >> n;\n  for (i = 1; i <= n; i = i + 1) {\n    cin >> a[i - 1];\n  }\n  for (i = 1; i <= n; i = i + 1) {\n    s = 0;\n    if (i == 1)\n      printf(\"%d\", a[i - 1]);\n    else {\n      for (j = 0; j < i - 1; j = j + 1) {\n        s = (a[i - 1] == a[j]) ? s + 1 : s;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num[100000], n, i, j, k, m, l;\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (j = 0; j < n - 1; j++)\n    for (k = j + 1; k < n; k++) {\n      if (num[j] == num[k]) {\n        num[k] = 0;\n      }\n    }\n  for (m = 0, l = 0; m < n; m++) {\n    if (num[m] >= 10) {\n      l++;\n      if (l == 1) {\n        cout << num[m];\n      } else {\n        printf(\" %d\", num[m]);\n      }\n    }\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "13", "index": "24289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b = 0, m = 0, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      m = m + 1;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      k = k + 1;\n    if (a[i] != 0 && k < m)\n      cout << a[i] << \" \";\n    if (a[i] != 0 && k == m)\n      cout << a[i];\n  }\n}\n"}
{"label": "13", "index": "24290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100001], b[100001], temp = 1; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[0] = a[0];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;        \n      if (j == i - 1) \n      {\n        b[temp] = a[i];\n        temp++;\n      }\n    }\n  }\n  for (i = 0; i < temp - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[temp - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int b[100];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    b[a[i]]++;\n    if (b[a[i]] == 1) {\n      if (i > 0)\n        cout << \" \";\n      cout << a[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24292", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], sum = 0, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n  } else {\n    printf(\"%d\", a[0]);\n    for (i = 1; i <= n - 1; i++) {\n      sum = 0;\n      for (j = 0; j <= i - 1; j++) {\n        if (a[i] == a[j]) {\n          sum = 1;\n        }\n      }\n      if (sum == 0) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[30000];\nint find(int k) {\n  int i;\n  for (i = 0; i < k; i++)\n\n  {\n    if (a[i] == a[k])\n      return 1;\n  }\n\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  cout << a[0];\n  for (int k = 1; k < n; k++) {\n    if (find(k) == 0)\n      cout << \" \" << a[k];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24294", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, a[20001], i, j, b[20001] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (k = n; k > 0; k--)\n    if (b[k] == 0)\n      break;\n  for (i = 1; i < k; i++)\n    if (b[i] == 0)\n      cout << a[i] << ' ';\n  printf(\"%d\", a[k]);\n\n  return 0;\n}\n"}
{"label": "13", "index": "24295", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t = 0;\n  cin >> n;\n  \n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  \n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24296", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], t = 1, temp;\n  cin >> n;\n  cin >> a[0];\n  for (int i = 1; i < n; i++) {\n    cin >> temp;\n    for (int j = 0; j < t; j++) {\n      if (temp == a[j])\n        break;\n      if (j == t - 1) {\n        a[t] = temp;\n        t += 1;\n      }\n    }\n  }\n  for (int i = 0; i < t - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[t - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, g, p = 0;\n\n  cin >> n;\n  int a[n + 1];\n  memset(a, 0, sizeof(a));\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (j = 1; j <= n; j++) {\n    g = 0;\n\n    for (k = 1; k <= j - 1; k++) {\n      if (a[j] == a[k]) {\n        g = 1;\n      }\n    }\n\n    if (g == 0) {\n      if (p != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[j]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c[100000], d, e;\n  e = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++)\n    scanf(\"%d\", &c[b]);\n  cout << c[1];\n  b = 2;\n  while (b <= a) {\n    e = 0;\n    for (d = 1; d < b; d++) {\n      if (c[b] == c[d])\n        e = 1;\n      else\n        e = e;\n    }\n    if (e == 0)\n      cout << \" \" << c[b];\n    b = b + 1;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n\n  int a[20001];\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 2; i <= n; i++)\n    for (int j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  cout << a[1];\n  for (int i = 2; i <= n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000] = {0};\n  int i, j, k, m = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0, j = 0; i < n; i++, m = 0) {\n    for (k = j; k >= 0; k--) {\n      if (a[i] == b[k]) {\n        m = 1;\n        break;\n      }\n    }\n    if (m == 0) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (i = 0; i < j - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24301", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20010];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    for (int j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        i--;\n        n--;\n      }\n  }\n  for (int k = 0; k < n - 1; k++)\n    printf(\"%d \", a[k]);\n  cout << a[n - 1] << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[91], count = 0, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      count++;\n      b[count] = a[i];\n      if (count == 90)\n        break;\n    }\n    if (count == 90)\n      break;\n  }\n  if (count > 1) {\n    for (i = 1; i <= count - 1; i++)\n      printf(\"%d \", b[i]);\n    cout << b[count] << endl;\n  } else if (count == 1)\n    cout << b[1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, d, j;\n  int a[20001];\n  scanf(\"%d\", &h);\n  for (i = 1; i <= h; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= h; i++) {\n    d = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24304", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[200000], i, b[200000], j = 1, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[j] = a[i];\n    j++;\n  }\n  printf(\"%d\", b[1]);\n  for (j = 2; j <= n; j++) {\n    d = 0;\n    for (i = 1; i <= j - 1; i++) {\n      if (b[j] == a[i]) {\n        d++;\n      }\n    }\n    if (d == 0) {\n      printf(\" %d\", b[j]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, i, j, n;\n  int s1[20000], s2[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = n - 1, m = 0; i >= 0; i--) {\n    k = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (s1[i] == s1[j])\n        k++;\n    }\n    if (k == 0) {\n      s2[m] = s1[i];\n      m++;\n    }\n  }\n  s2[m] = '\\0';\n  for (n = m - 1; n > 0; n--) {\n    printf(\"%d \", s2[n]);\n  }\n  printf(\"%d\", s2[0]);\n}\n"}
{"label": "13", "index": "24306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[20001], t, i, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 1;\n    for (t = 0; t < i; t++) {\n      if (a[i] == a[t]) {\n        m = 0;\n      }\n    }\n    if (m == 1) {\n      if (i > 0) {\n        cout << \" \";\n      }\n      printf(\"%d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24307", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        f = 0;\n        break;\n      }\n    }\n    if (f == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n\n  printf(\"%d\", b[k - 1]);\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, save[20000], count = 0;\n  for (i = 0; i < 20000; i++)\n    save[i] = 0;\n  cin >> n;\n  while (n--) {\n    int flag = 1;\n    cin >> m;\n    for (i = 0; i < 20000; i++) {\n      if (save[i] == m) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      for (i = 0; i < 20000; i++) {\n        if (save[i] == 0) {\n          save[i] = m;\n          break;\n        }\n      }\n      count++;\n    }\n  }\n  for (i = 0; i < count - 1; i++)\n    cout << save[i] << \" \";\n  cout << save[count - 1];\n\n  return 0;\n}\n"}
{"label": "13", "index": "24309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[20005], mark[100] = {0}, print = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    if (mark[a[i]] == 1)\n      continue;\n    else {\n      if (print)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n      print = 1;\n      mark[a[i]]++;\n    }\n  }\n  putchar(10);\n  return 0;\n}\n"}
{"label": "13", "index": "24310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[10005], n, i, j, flag = 1, flag2 = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    cin >> a[i];\n    for (j = 1; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        flag = 0;\n    }\n    if (flag) {\n      if (flag2 == 0) {\n        printf(\"%d\", a[i]);\n        flag2 = 1;\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int f[20001];\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    f[i] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    if (f[a] == 0) {\n      f[a] = 1;\n      if (i != 1)\n        printf(\" \");\n      printf(\"%d\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24312", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long i, n, x;\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  scanf(\"%ld \", &x);\n  printf(\"%d\", x);\n  a[x] = 1;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (a[x] == 0) {\n      printf(\" %d\", x);\n      a[x] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100000], i, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = a[j];\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] != a[i])\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24315", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (i == j) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24316", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a = 0, n = 0, m = 0, i = 0, k = 0;\n  cin >> n;\n  k = n;\n  int num[n];\n  for (; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < k; i++) {\n    for (m = i + 1; m < k; m++) {\n      if (num[m] == num[i]) {\n        for (a = m; a < k; a++)\n          num[a] = num[a + 1];\n        k--;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24317", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n;\n  cin >> n; \n  int a[20000];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> a[i]; \n  int j;\n  int k;\n  for (i = 0; i < n; i++) {\n    j = i + 1;\n    while (j < n)\n      if (a[i] == a[j]) \n      {\n        n--;\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1]; \n      } else\n        j++;\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \"; \n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24318", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], i, n, j, flag;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        flag = 1;\n        break;\n      } else {\n        flag = 0;\n        continue;\n      }\n    }\n    if (flag == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24319", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001], i, j, k, m = 0, n = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 10000;\n      }\n    }\n  }\n  cout << a[1];\n  for (i = 2; i <= n - m; i++)\n    if (a[i] != 10000) {\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    printf(\"\\n\");\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24321", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        k = 1;\n    }\n    if (k == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    else if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 1, k = 1, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = 0;\n    }\n    if (k == 1) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 1;\n  }\n  for (j = 0; j < m - 1; j++)\n    cout << b[j] << \" \";\n  printf(\"%d\", b[j]);\n  return 0;\n}\n"}
{"label": "13", "index": "24323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], j, temp;\n  scanf(\"%d\", &n);\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &temp);\n    if (i == 1) {\n      j = 0;\n      printf(\"%d\", temp);\n      a[j] = temp;\n    } else {\n      int c = 0;\n      for (int k = 0; k <= j; k++) {\n        if (a[k] == temp)\n          c++;\n      }\n      if (c == 0) {\n        printf(\" %d\", temp);\n        j++;\n        a[j] = temp;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24324", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, p = 1, i = 0, j = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  int b[n];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        break;\n      }\n    }\n    if (j == i) {\n      b[p] = a[i];\n      p++;\n    }\n  }\n\n  cout << b[0];\n\n  for (i = 1; i < p; i++) {\n    printf(\" %d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j[101] = {0}, a[20000], b[20000] = {0}, i, n, x = 0, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (j[a[i]] == 0) {\n      j[a[i]] = 1;\n      b[x] = a[i];\n      x++;\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a[20000], j, m = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i >= 0; i--)\n    for (k = i - 1; k >= 0; k--)\n      if (a[i] == a[k]) {\n        m++;\n        for (j = i; j <= n - m; j++)\n          a[j] = a[j + 1];\n      }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n - m; i++)\n    printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sz[20000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (sz[j] == sz[i]) {\n          sz[i] = 0;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > 0) {\n      if (i == 0)\n        printf(\"%d\", sz[i]);\n      else {\n        cout << \" \" << sz[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0;\n  cin >> n;\n  int a[10000];\n  cin >> a[0];\n  for (i = 1; (i + t) < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        t++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n - t - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - t - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[50000];\n  int b[20001];\n  cin >> n;\n\n  cin >> a;\n  k = strlen(a);\n  i = 0;\n  j = 1;\n  while (i <= k - 1) {\n    b[j] = (a[i] - 48) * 10 + (a[i + 1] - 48);\n    i = i + 3;\n    j = j + 1;\n  }\n  j = j - 1;\n  printf(\"%d\", b[1]);\n  i = 2;\n  while (i <= j) {\n    m = 1;\n    while (m < i) {\n      if (b[i] == b[m])\n        break;\n      m = m + 1;\n    }\n    if (m == i)\n      printf(\" %d\", b[i]);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  else {\n    printf(\"%d\", a[0]);\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          break;\n      }\n      if (i == j && a[i] != a[i - 1])\n        printf(\" %d\", a[i]);\n    }\n    for (j = 0; j < n - 1; j++) {\n      if (a[n - 1] == a[j])\n        break;\n    }\n    if (n - 1 == j && a[n - 1] != a[n - 2])\n      printf(\" %d\", a[n - 1]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, n, b[20001], c[20001], i = 0, j = 1, l, m;\n  cin >> n;\n  for (l = 0; l < 20001; l++) {\n    b[l] = 0;\n  }\n  for (m = 0; m < 20001; m++) {\n    c[m] = 0;\n  }\n  while (j <= n) {\n    cin >> k;\n    if (b[k] == 0)\n      c[i] = k;\n    b[k]++;\n    i++;\n    j++;\n  }\n  printf(\"%d\", c[0]);\n  for (i = 1; i < n; i++) {\n    if (c[i] != 0) {\n      cout << \" \" << c[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, p = 0, m[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &m[i]);\n  for (i = 0; i < n; i++) {\n    j = 0;\n    while (j < i) {\n      if (m[i] == m[j])\n        break;\n      j++;\n    }\n    if (j == i) {\n      if ((i < n) && (i > 0))\n        printf(\" \");\n      printf(\"%d\", m[i]);\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24333", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++)\n      if (a[i] == b[j])\n        b[j] = 0;\n  cout << b[0];\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      cout << ' ' << b[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24334", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, count = 0, a[20000];\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == a[i])\n        count++;\n    }\n    if (count == 0)\n      cout << ' ' << a[i];\n    else\n      count = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[20000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (sz[j] == sz[i]) {\n          sz[i] = 0;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > 0) {\n      if (i == 0) {\n        printf(\"%d\", sz[i]);\n      } else {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, count[91] = {0};\n  cin >> n;\n  scanf(\"%d \", &x);\n  printf(\"%d\", x);\n  count[x - 10]++;\n  for (int i = 1; i <= n - 1; i++) {\n    cin >> x;\n    if (count[x - 10] == 0)\n      printf(\" %d\", x);\n    count[x - 10]++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[200001] = {0}, k[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    k[s[i]]++;\n  }\n  int flag[100] = {0};\n  for (int i = 0; i < n; i++) {\n    if (k[s[i]] == 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        cout << s[i];\n      if (i != 0)\n        cout << \" \" << s[i];\n    }\n    if (k[s[i]] != 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        cout << s[i];\n      if (i != 0)\n        cout << \" \" << s[i];\n      flag[s[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, i, j, k = 1, num[20000];\n  cin >> n;\n  scanf(\"%d \", &a);\n  num[0] = a;\n  for (i = 1; i < n; i++) {\n    cin >> a;\n    for (j = 0; j < k; j++) {\n      if (a == num[j]) {\n        break;\n      }\n    }\n    if (j == k) {\n      num[k] = a;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (x[i] == x[j] && i != j) {\n        x[j] = 0;\n      }\n    }\n\n  cout << x[0];\n\n  for (i = 1; i < n; i++) {\n    if (x[i] != 0) {\n      printf(\" %d\", x[i]);\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        for (k = i; k < n; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    cout << a[i];\n    if (i != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24341", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i;\n  int buf;\n  int appeared[110] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &buf);\n    if (!appeared[buf]) {\n      if (i != 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", buf);\n      appeared[buf] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24342", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a, time;\n  k = 1;\n  time = 0;\n  cin >> n;\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (sz[i] == sz[k]) {\n        for (a = k; a < n - 1; a++) {\n          sz[a] = sz[a + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", sz[i]);\n    else if (i != 0) {\n      printf(\" %d\", sz[i]);\n    }\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "13", "index": "24343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, t;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++)\n\n  {\n    t = 0;\n    for (i = 0; i < j; i++) {\n      if (a[i] == a[j])\n        t = t + 1;\n      else\n        ;\n    }\n    if (t == 0)\n      printf(\" %d\", a[j]);\n    else\n      ;\n  }\n}\n"}
{"label": "13", "index": "24344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (a[i] != a[j] && j == (i - 1))\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24345", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, s[200001] = {0}, k[100] = {0};\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> s[i];\n    k[s[i]]++;\n  }\n  int flag[100] = {0};\n  for (int i = 0; i < n; i++) {\n    if (k[s[i]] == 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        cout << s[i];\n      if (i != 0)\n        cout << \" \" << s[i];\n    }\n    if (k[s[i]] != 1 && flag[s[i]] == 0) {\n      if (i == 0)\n        printf(\"%d\", s[i]);\n      if (i != 0)\n        cout << \" \" << s[i];\n      flag[s[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24346", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, i, num[20000]; \n  cin >> n;             \n  for (i = 0; i < n; i++) {\n    cin >> num[i]; \n    if (i > 0) {\n      for (int k = 0; k < i; k++) {\n        if (num[i] == num[k])\n          num[i] = 0;\n      } \n    }\n  }\n  cout << num[0]; \n  for (i = 1; i < n; i++) {\n    if (num[i] > 9)\n      cout << \" \" << num[i];\n  } \n  return 0;\n}\n"}
{"label": "13", "index": "24347", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n{\n  int a[20000], n;            \n  cin >> n;                   \n  for (int i = 0; i < n; i++) \n    cin >> a[i];              \n  cout << a[0];               \n  for (int t = 1; t < n; t++) \n  {\n    int k = 0;         \n    for (; k < t; k++) \n      if (a[t] == a[k])\n        break;                 \n    if (k == t)                \n      cout << setw(3) << a[t]; \n  }\n  return 0; \n}\n\n"}
{"label": "13", "index": "24348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        f = 0;\n        break;\n      }\n    }\n    if (f == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[k - 1]);\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *SZ = (int *)malloc(sizeof(int) * n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &SZ[i]);\n  }\n  for (int j = 0; j < n; j++) {\n    if (j == 0) {\n      printf(\"%d\", SZ[j]);\n    }\n    for (int k = 0; k < j; k++) {\n      if (SZ[j] == SZ[k]) {\n        break;\n      } else if (k == j - 1) {\n        printf(\" %d\", SZ[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[20000], p = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &m);\n    for (j = 0; j < i; j++) {\n      if (m == a[j]) {\n        p = 0;\n        break;\n      }\n    }\n    if (p == 0) {\n      i--;\n      n--;\n      p = 1;\n    } else\n      a[i] = m;\n  }\n  for (j = 0; j < n - 1; j++) {\n    cout << a[j] << \" \";\n  }\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int count, n, j, i = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (count = 0, j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (i == 1 && count == 0)\n      cout << a[i];\n    else if (i != 1 && count == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int a[20000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int k;\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n      else\n        break;\n    }\n    if (k == i)\n      cout << \" \" << a[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24353", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j;\n  cin >> n;\n  int a[n];\n  int i = 0;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (((j == i) && (a[i] != a[i - 1])) == 1)\n      printf(\" %d\", a[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  ;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n - 1 - m; i++)\n    for (j = i + 1; j < n - m;)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n      } else\n        j++;\n  for (i = 0; i < n - 1 - m; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - m - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24355", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20000] = {0}, b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  printf(\"%d\", b[0]);\n  if (k > 1) {\n    for (i = 1; i < k; i++)\n      printf(\" %d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        i = i - 1;\n        n--;\n        break;\n      }\n    }\n  }\n  if ((n - 2) >= 0) {\n    for (i = 0; i <= n - 2; i++)\n      cout << a[i] << \" \";\n\n    cout << a[n - 1];\n  } else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "13", "index": "24357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[12683], b[12683];\n  int i, j, n, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j]) {\n        b[j] = 0;\n        break;\n      } else\n        b[j] = 1;\n    }\n  }\n  cout << a[0];\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] == 1) {\n      printf(\" \");\n      printf(\"%d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24358", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, i, j, r, d = 0;\n  cin >> n;\n  a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &*(a + i));\n  for (i = 0; i < n; i++) {\n    r = 0;\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        r = 1;\n    }\n    if (r == 0 && d == 0) {\n      printf(\"%d\", *(a + i));\n      d = 1;\n    } else if (r == 0 && d == 1)\n      printf(\" %d\", *(a + i));\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, flag, g;\n  scanf(\"%d \", &n);\n  g = 0;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    flag = 1;\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag == 1)\n      if (g)\n        cout << \" \" << a[i];\n      else {\n        cout << a[i];\n        g = 1;\n      }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24360", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a[20000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 2; j <= n; j++) {\n    for (m = 1; m <= j - 1; m++) {\n      if (a[j - 1] == a[m - 1]) {\n        break;\n      }\n    }\n    if (m == j)\n      printf(\" %d\", a[j - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24361", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, n, x;\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  cin >> x;\n  printf(\"%d\", x);\n  a[x] = 1;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &x);\n    if (a[x] == 0) {\n      printf(\" %d\", x);\n      a[x] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24362", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j] && a[i] != 0)\n        a[i] = 0;\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      if (a[i] != 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, m, r;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    r = 0;\n    scanf(\"%d\", &a[i]);\n    for (m = 1; m < i; m++) {\n      if (a[i] == a[m])\n        r++;\n    }\n    if (r == 0)\n      cout << \" \" << a[i];\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24365", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, i, j, k = 1, num[20000]; \n  cin >> n;                          \n  cin >> a;\n  num[0] = a; \n  for (i = 1; i < n; i++) {\n    cin >> a; \n    for (j = 0; j < k; j++) {\n      if (a == num[j])\n        break; \n    }\n    if (j == k) \n    {\n      num[k] = a; \n      k = k + 1;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    cout << num[i] << \" \"; \n  cout << num[k - 1];      \n  return 0;\n}\n"}
{"label": "13", "index": "24366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[10000], i, j, x[10000], z = 0, h = 1;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &x[i - 1]);\n  m[0] = x[0];\n  for (i = 2; i <= n; i++) {\n    z = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (x[j - 1] == x[i - 1])\n        z = 1;\n    if (z == 0) {\n      m[h] = x[i - 1];\n      h = h + 1;\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    cout << m[i];\n    if (i != h - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10000], n, i, t, j, m;\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    m = 0;\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] == a[j])\n        m = m + 1;\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24368", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  int a[20000];\n  cin >> n;\n  i = 0;\n  j = 0;\n  b = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = 1;\n  printf(\"%d\", a[0]);\n  while (i < n) {\n    while ((j < i) && (b == 0)) {\n      if (a[j] != a[i])\n        j++;\n      else\n        b = 1;\n    }\n    if (b == 0)\n      printf(\" %d\", a[i]);\n    i++;\n    j = 0;\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], k, j, b, i;\n  scanf(\"%d\", &b);\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (j = 1; j < b; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j])\n        break;\n    }\n    if (k == j)\n      cout << \" \" << a[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000] = {0}, t[10000] = {0}, s, b, c, k = 0, i = 0, n;\n  scanf(\"%d\", &n);\n  printf(\"\\n\");\n  scanf(\"%d \", &a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    for (b = 0, c = 0; b <= i - 1; b++)\n      if (a[i] == a[b])\n        c = c + 1;\n    if (c == 0) {\n      t[k] = a[i];\n      k++;\n    }\n  }\n  if (k == 0)\n    cout << a[0];\n  if (k > 0) {\n    printf(\"%d \", a[0]);\n    for (s = 0; s <= k - 2; s++)\n      printf(\"%d \", t[s]);\n    printf(\"%d\", t[k - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, end;\n  cin >> n;\n  int a[n], b[n];\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = 1;\n    }\n  for (int i = n - 1; i >= 0; i--) {\n    if (b[i] == 0) {\n      end = i;\n      b[i] = 1;\n      break;\n    }\n  }\n  if (end != 0) {\n    for (int i = 0; i < n; i++) {\n      if (b[i] == 0)\n        cout << a[i] << \" \";\n    }\n  }\n  cout << a[end] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint god(int num1, int num2);\nint main(void) {\n  int number, ctr, i;\n  int n[20000], c[20000];\n  scanf(\"%d\", &number);\n  for (i = 0; i <= 20000; i++) {\n    c[i] = 0;\n  }\n  for (ctr = 0; ctr < number; ctr++) {\n    scanf(\"%d\", &n[ctr]);\n  }\n  printf(\"%d\", n[0]);\n  for (ctr = 1; ctr < number; ctr++) {\n    for (i = 0; i < ctr; i++) {\n      if (n[i] == n[ctr]) {\n        c[ctr]++;\n      }\n    }\n    if (c[ctr] == 0)\n      printf(\" %d\", n[ctr]);\n  }\n\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001];\n  int i, k, n, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  k = 0;\n  a[n] = 101;\n  while (k < n) {\n\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == a[k])\n        k++;\n    }\n    if (k == 0)\n      printf(\"%d\", a[k]), k++;\n\n    else if (k < n && k > 0)\n      printf(\" %d\", a[k]), k++, m++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24374", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n    if (t == 0) {\n      if (m > 0)\n        cout << \" \";\n      cout << a[i];\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, i, j, n;\n  int s1[20000], s2[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s1[i]);\n  for (i = n - 1, m = 0; i >= 0; i--) {\n    k = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (s1[i] == s1[j])\n        k++;\n    }\n    if (k == 0) {\n      s2[m] = s1[i];\n      m++;\n    }\n  }\n  s2[m] = '\\0';\n  for (n = m - 1; n > 0; n--) {\n    printf(\"%d \", s2[n]);\n  }\n  cout << s2[0];\n  return 0;\n}\n"}
{"label": "13", "index": "24376", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0;\n  scanf(\"%d\", &n);\n  int x[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &x[i]);\n    for (k = 0; k < i; k++) {\n      if (x[k] == x[i]) {\n        i--;\n        n--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %d\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24377", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, a[1000] = {0}, j, k, m;\n  cin >> n;\n  scanf(\"%d \", &a[1]);\n  for (i = 2, m = 2; m <= n; i++, m++) {\n    cin >> a[i];\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", a[1]);\n  for (k = 2; k <= i - 1; k++)\n    cout << ' ' << a[k];\n  return 0;\n}\n"}
{"label": "13", "index": "24378", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int flag[100] = {0}, i, n, temp;\n  cin >> n;\n  cin >> temp;\n  flag[temp] = 1;\n  printf(\"%d\", temp);\n  for (i = 1; i < n; i++) {\n    cin >> temp;\n    if (flag[temp] == 0) {\n      printf(\" %d\", temp);\n      flag[temp] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[50000];\n  int b[20001];\n  scanf(\"%d \", &n);\n\n  cin >> a;\n  k = strlen(a);\n  i = 0;\n  j = 1;\n  while (i <= k - 1) {\n    b[j] = (a[i] - 48) * 10 + (a[i + 1] - 48);\n    i = i + 3;\n    j = j + 1;\n  }\n  j = j - 1;\n  printf(\"%d\", b[1]);\n  i = 2;\n  while (i <= j) {\n    m = 1;\n    while (m < i) {\n      if (b[i] == b[m])\n        break;\n      m = m + 1;\n    }\n    if (m == i)\n      printf(\" %d\", b[i]);\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long n;\n  scanf(\"%ld \", &n);\n  bitset<101> b;\n  for (long i = 0; i < n; i++) {\n    long x;\n    cin >> x;\n    if (!b.test(x)) {\n      if (i)\n        printf(\" \");\n      printf(\"%ld\", x);\n      b.set(x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24381", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, c;\n  int a[101] = {0};\n  cin >> n;\n  cin >> c;\n  a[c] = 1;\n  cout << c;\n  while (cin >> c) {\n    if (a[c] == 0) {\n      cout << \" \" << c;\n      a[c] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, a[20001], b[20001], f;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      b[0] = a[0];\n    f = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        break;\n      } else\n        f++;\n    }\n    if (f == i) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n\n  for (i = 1; i < k - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  cout << b[k - 1];\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24383", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000], b[20000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = a[0];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      ;\n    else {\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[j - 1]);\n}\n"}
{"label": "13", "index": "24384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20001] = {0}, count = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        count++;\n        a[i] = 0;\n      }\n    }\n  }\n  cout << a[1];\n  for (int i = 2; i <= n; i++) {\n    if (a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[100000], i, h = 1, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i) {\n      b[h] = a[i];\n      h++;\n    }\n  }\n  for (i = 1; i <= h - 1; i++) {\n    if (i < h - 1)\n      cout << b[i] << \" \";\n    else if (i == h - 1)\n      printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "24386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == 0)\n        break;\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n        a[k] = 0;\n        l = l + 1;\n      }\n    }\n  for (i = 0; i < n - l; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[200000], i, b[200000], j = 1, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[j] = a[i];\n    j++;\n  }\n  printf(\"%d\", b[1]);\n  for (j = 2; j <= n; j++) {\n    d = 0;\n    for (i = 1; i <= j - 1; i++) {\n      if (b[j] == a[i]) {\n        d++;\n      }\n    }\n    if (d == 0) {\n      cout << \" \" << b[j];\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, m = 1, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "24389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[20001] = {0}, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> m[i];\n  for (i = 1; i <= n; i++)\n    for (int j = i + 1; j <= n; j++)\n      if (m[i] == m[j]) {\n        for (j; j <= n; j++)\n          m[j] = m[j + 1];\n        n = n - 1;\n        i = i - 1;\n      }\n  for (i = 1; i <= n - 1; i++)\n    printf(\"%d \", m[i]);\n  cout << m[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24390", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, i2, i3, flag = 1;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i1 = 0; i1 < n; i1++)\n    cin >> a[i1];\n  printf(\"%d\", a[0]);\n  for (i2 = 1; i2 < n; i2++) {\n    flag = 1;\n    for (i3 = 0; i3 < i2; i3++) {\n      if (a[i2] == a[i3])\n        flag *= 0;\n    }\n    if (flag == 1)\n      printf(\" %d\", a[i2]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[100], n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  b[0] = a[0];\n  l = 0;\n  k = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= l; j++)\n      if (a[i] == b[j])\n        k = 1;\n    if (k == 0) {\n      l++;\n      b[l] = a[i];\n    }\n    k = 0;\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[l]);\n  return 0;\n}\n"}
{"label": "13", "index": "24392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20001] = {0}, count = 0;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        count++;\n        a[i] = 0;\n      }\n    }\n  }\n  cout << a[1];\n  for (int i = 2; i <= n; i++) {\n    if (a[i] != 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i - 1; ++j) {\n      b[i - 1] = 0;\n      b[j] = a[j] - a[i];\n      if (b[j] == 0) {\n        break;\n      }\n    }\n    if (b[i - 1] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[20000] = {0}, a, i = 0, n, p = 0, j, k;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    scanf(\"%d\", &a);\n    for (j = 0, k = 0; j < i; j++) {\n      if (c[j] == a) {\n        k = 1;\n        break;\n      }\n    }\n\n    if (k == 0) {\n      c[p] = a;\n      p++;\n    }\n    i++;\n  }\n  for (j = 0; j < p; j++) {\n    printf(\"%d\", c[j]);\n    if (j < p - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "13", "index": "24395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, j = 0, k = 0, step = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n - 1 - step; i++) {\n    for (j = i + 1; j < n - step; j++) {\n      if (a[i] == a[j]) {\n        if (j == n - 1 - step) {\n          step++;\n          continue;\n        }\n        for (k = j; k < n - 1 - step; k++)\n          a[k] = a[k + 1];\n        step++;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - step - 1; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - 1 - step] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int str[20001];\n  for (int i = 0; i < n; i++)\n    cin >> str[i];\n  int num = 0;\n  for (int i = 1; i < n - num; i++) {\n    for (int j = 0; j < i; j++)\n      if (str[j] == str[i]) {\n        for (int k = i; k < n - 1 - num; k++)\n          str[k] = str[k + 1];\n        num++;\n\n        i--;\n        break;\n      }\n  }\n  cout << str[0];\n  for (int i = 1; i < n - num; i++)\n    cout << ' ' << str[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == 0)\n        break;\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n        a[k] = 0;\n        l = l + 1;\n      }\n    }\n  for (i = 0; i < n - l; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[1000];\n  int i, j;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      printf(\"%d\", a[i]);\n    }\n\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[j] == a[i]) {\n          break;\n        }\n      }\n      if (j == i) {\n        printf(\" %d\", a[i]);\n      } else if (j < i) {\n        continue;\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, b, c, d, i, a[20000] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> b;\n    a[i] = b;\n  }\n  cout << a[1];\n  for (c = 2; c <= n; c++) {\n    for (d = 0; d <= c - 1; d++) {\n      if (a[d] == a[c])\n        break;\n      else\n        continue;\n    }\n    if (d == c)\n      printf(\" %d\", a[c]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, e, k = 0;\n  int s[20001];\n  int a[20001];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 20001; i++) {\n    s[i] = 0;\n    a[i] = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    cin >> e;\n    if (a[e] == 0) {\n      a[e] = 1;\n      k++;\n      s[k] = e;\n    }\n  }\n  for (i = 1; i <= k - 1; i++) {\n    printf(\"%d \", s[i]);\n  }\n  cout << s[k];\n  return 0;\n}\n"}
{"label": "13", "index": "24401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[20001] = {0};\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    if (i == 0)\n      cout << a[i];\n    else {\n      int t = 0;\n      for (int j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t++;\n      }\n      if (t == 0)\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  int *m;\n  scanf(\"%d\", &n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", m + i);\n  }\n  printf(\"%d\", *m);\n  for (i = 1; i < n; i++) {\n    l = 0;\n    for (j = 0; j < i; j++) {\n      if (*(m + i) == *(m + j)) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 0)\n      printf(\" %d\", *(m + i));\n  }\n  free(m);\n  return 0;\n}\n"}
{"label": "13", "index": "24403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, p;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    p = 0;\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        p = 1;\n    }\n    if (p == 0 & i == 1) {\n      printf(\"%d\", a[i]);\n    }\n    if (p == 0 & i != 1) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24404", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, b, c, d, i, a[20000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> b;\n    a[i] = b;\n  }\n  cout << a[1];\n  for (c = 2; c <= n; c++) {\n    for (d = 0; d <= c - 1; d++) {\n      if (a[d] == a[c])\n        break;\n      else\n        continue;\n    }\n    if (d == c) {\n      cout << \" \" << a[c];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[20000], output[20000];\n  int i = 0, n = 0, j = 0, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &num[i]);\n    for (j = 0; j < k; j++)\n      if (num[i] == output[j])\n        num[i] = 0;\n    if (num[i] != 0) {\n      output[k] = num[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", output[i]);\n  printf(\"%d\", output[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001] = {0}, b[100] = {0}, n, i, j, m = 1, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  b[1] = a[1];\n  for (i = 2; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= m; j++) {\n      if (a[i] == b[j]) {\n        flag = 1;\n      }\n    }\n    if (flag == 1)\n      continue;\n    else {\n      m++;\n      b[m] = a[i];\n      cout << \" \" << a[i];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "24408", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        k = 1;\n    }\n    if (k == 0 && i == 0)\n      printf(\"%d\", a[i]);\n    else if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24409", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[9000], ans[9000];\n  cin >> n;\n  int i, j;\n  int num = 1, t = 0;\n  cin >> a[0];\n  ans[0] = a[0];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    int j = 0;\n    while (j < num) {\n      if (a[i] == ans[j]) {\n        t = 1;\n        break;\n      }\n      j++;\n    }\n    if (t == 0) {\n      ans[num] = a[i];\n      printf(\" %d\", ans[num]);\n      num++;\n    } else\n      t = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0;\n  cin >> n;\n  int a[10000];\n  cin >> a[0];\n  for (i = 1; (i + t) < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        t++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n - t - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - t - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24411", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, num, a[20001]; \n  cin >> n;\n  for (int i = 1; i <= n; i++) \n  {\n    cin >> num;\n    a[i - 1] = num;\n    if (i == 1) \n      cout << num;\n    else {\n      int j = 0;\n      while (j < i - 1) \n      {\n        if (a[j] == num)\n          break;\n        else\n          j++;\n      }\n      if (j == i - 1)\n        cout << \" \" << num; \n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (j < i - 1) {\n        if (shuzu[i] == shuzu[j]) {\n          break;\n        }\n      }\n      if (j == i - 1) {\n        if (shuzu[i] != shuzu[j]) {\n          printf(\" %d\", shuzu[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24413", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int jud[200], num[30000], n, i, j, sum, res[200];\n  scanf(\"%d\", &n);\n  sum = 0;\n  for (i = 1; i <= 100; i++)\n    jud[i] = 0;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num[i]);\n    if (jud[num[i]] == 0) {\n      sum++;\n      res[sum] = num[i];\n      jud[num[i]] = 1;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    printf(\"%d \", res[i]);\n  printf(\"%d\", res[sum]);\n  return 0;\n}\n"}
{"label": "13", "index": "24414", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  cin >> n;\n  int i = 0, j = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24415", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a = 0, n = 0, m = 0, i = 0, k = 0; \n  cin >> n;                              \n  k = n;                                 \n  int num[n];                            \n  for (; i < n; i++)\n    cin >> num[i];          \n  for (i = 0; i < k; i++) { \n    for (m = i + 1; m < k; m++) {\n      if (num[m] == num[i]) {\n        for (a = m; a < k; a++)\n          num[a] = num[a + 1];\n        k--; \n        m--;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << num[i] << \" \"; \n  cout << num[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24416", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  int shuru[100000];\n  cin >> n;\n  for (int i = 0; i < n; i++) { \n    cin >> shuru[i];\n    if (getchar() == '\\n')\n      break;\n    else\n      continue;\n  }\n  cout << shuru[0];\n\n  for (int i = 1; i < n; i++) { \n    int jishu = 0;\n    for (int j = 0; j < i; j++) {\n      if (shuru[i] == shuru[j])\n        break;\n      else {\n        jishu++;\n      }\n    }\n    if (jishu == i) \n      cout << ' ' << shuru[i];\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n\n  int a[30000] = {0};\n\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i <= n - 1; i++)\n\n  {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i] == a[j])\n        break;\n\n      if (j == i - 1) {\n\n        printf(\" \");\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, s = 0, num = 0, k = 0;\n  int a[20006];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        n--;\n        j--;\n        s++;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n - 1) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m = 1;\n  cin >> n;\n  int a[n];\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    m = 1;\n    for (int j = i - 1; j > 0; j--)\n      if (a[i] == a[j])\n        m = 0;\n    if (m == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int *number;\n  int i, j;\n  int sum;\n\n  scanf(\"%d\", &n);\n  number = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &number[i]);\n\n  i = 0;\n  while ((i < n) && (sum != 0)) {\n    if ((i == n - 1) && (number[i] != 0)) {\n      printf(\"%d\", number[i]);\n    }\n    sum = 0;\n    for (j = i + 1; j < n; j++) {\n      if (number[j] == number[i])\n        *(number + j) = 0;\n\n      sum += number[j];\n    }\n\n    if ((sum != 0) && (number[i] != 0)) {\n      cout << number[i] << \" \";\n    } else if ((sum == 0) && (number[n - 1] == 0)) {\n      printf(\"%d\", number[i]);\n      sum = 0;\n    }\n    i++;\n  }\n\n  free(number);\n  return 0;\n}\n"}
{"label": "13", "index": "24421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i = 0, t = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 0; t <= i - 1; t++) {\n      if (a[i] == a[t])\n        p++;\n    }\n\n    if (p != 0)\n      a[i] = 0;\n    p = 0;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      printf(\"%d\", a[i]);\n      break;\n    }\n  }\n  for (t = i + 1; t <= n - 1; t++) {\n    if (a[t] != 0)\n      printf(\" %d\", a[t]);\n  }\n}\n"}
{"label": "13", "index": "24422", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], k = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i - 1];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (j == i)\n      k++;\n  }\n  if (k == 1) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i)\n        printf(\"%d\\n\", a[i]);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          break;\n      if (j == i) {\n        printf(\"%d\", a[i]);\n        t++;\n        if (t < k)\n          printf(\" \");\n        else\n          printf(\"\\n\");\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24423", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[10000], i, j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] == 0) {\n      continue;\n    }\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24424", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num[20000], st[91], tot = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (num[j] == num[i])\n        break;\n\n    if (j == i)\n      st[++tot] = num[i];\n  }\n  for (i = 1; i < tot; i++)\n    printf(\"%d \", st[i]);\n  printf(\"%d\", st[tot]);\n}\n"}
{"label": "13", "index": "24425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int b[20000];\n  scanf(\"%d%d\", &n, &b[0]);\n  printf(\"%d\", b[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] == b[j])\n        b[i] = 0;\n    }\n  }\n  for (m = 1; m < n; m++) {\n    if (b[m] != 0) {\n      printf(\" %d\", b[m]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      b[i] = a[i] - a[j];\n      if (b[i] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24427", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sign, counter;\n  int a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  counter = 0;\n  for (i = 0; i < n && counter == 0; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\"%d\", a[i]);\n      counter = counter + 1;\n    }\n  }\n  for (; i < n; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, timer, k, k0;\n  timer = 0;\n  k0 = 0;\n  k = -1;\n  int l[100000], r[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &l[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (l[i] == l[j]) {\n        l[j] = 10000;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] == 10000) {\n      timer++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (l[i] != 10000) {\n\n      k0++;\n      k++;\n      r[k] = l[i];\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < k0; i++) {\n    if (k == 0) {\n      printf(\"%d\", r[i]);\n    } else if (k != 0 && i < k0 - 1) {\n      printf(\"%d \", r[i]);\n    } else if (i == k0 - 1) {\n      printf(\"%d\", r[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, num, e[20001], i, j;\n  scanf(\"%d/n\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &num);\n    printf(\"%d\", num);\n  } else {\n    for (i = 1; i <= n; ++i) {\n      scanf(\"%d\", &num);\n      e[i] = num;\n      if (i == 1) {\n        printf(\"%d\", e[1]);\n      } else {\n        for (j = 1; j < i; j++) {\n          if (e[i] == e[j]) {\n            e[i] = 0;\n            break;\n          }\n        }\n        if (e[i] != 0) {\n          printf(\" %d\", e[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, y;\n  scanf(\"%d\", &n);\n  int a[20000];\n  int b[20000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    y = 0;\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        y++;\n      }\n    }\n    if (y == 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24431", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[100], n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  l = 0;\n  k = 0;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j <= l; j++)\n      if (a[i] == b[j])\n        k = 1;\n    if (k == 0) {\n      l++;\n      b[l] = a[i];\n    }\n    k = 0;\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[l]);\n}\n"}
{"label": "13", "index": "24432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, a[20000], p = 1;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &m);\n    for (j = 0; j < i; j++) {\n      if (m == a[j]) {\n        p = 0;\n        break;\n      }\n    }\n    if (p == 0) {\n      i--;\n      n--;\n      p = 1;\n    } else {\n      a[i] = m;\n    }\n  }\n  for (j = 0; j < n - 1; j++) {\n    printf(\"%d \", a[j]);\n  }\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24433", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, w[200];\n  scanf(\"%d \", &n);\n  memset(w, 0, sizeof(w));\n  for (int i = 0; i < n; i++) {\n    cin >> k;\n    if (!w[k]) {\n      if (i)\n        printf(\" \");\n      w[k] = 1;\n      cout << k;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20000], b = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k <= j; k++) {\n      if (a[k] != a[j])\n        b++;\n    }\n    if (b == j)\n      printf(\" %d\", a[j]);\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24435", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 1, l, m, n, a[20000], b[90], x;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  b[0] = a[0];\n  for (j = 0; j < n; j++) {\n    for (l = 0; l < k; l++) {\n      if (a[j] == b[l]) {\n        m = 1;\n      }\n    }\n    if (m != 1) {\n      b[k] = a[j];\n      k++;\n    }\n    m = 0;\n  }\n  cout << b[0];\n  for (x = 1; x < k; x++)\n    cout << \" \" << b[x];\n  return 0;\n}\n"}
{"label": "13", "index": "24436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++)\n    b[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        b[i]++;\n        break;\n      }\n  for (i = 1; i < n; i++)\n    if (b[i] == 0)\n      printf(\" %d\", a[i]);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24437", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  int a[10000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else {\n      k = 0;\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          k = 1;\n        }\n      }\n      if (k == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, j, k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = n - 1; i > 0; i--) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (j == i - 1) {\n        b[k] = a[i];\n        k++;\n      }\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "24439", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    int t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t++;\n        break;\n      }\n    }\n    if (t == 0) {\n      if (m > 0)\n        cout << \" \";\n      cout << a[i];\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num, count[100] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n\n    cin >> num;\n    count[num]++;\n    if (i == 1)\n      printf(\"%d\", num);\n    if (count[num] == 1 && i >= 2)\n      cout << \" \" << num;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b;\n  int z[30000];\n  int c[30000];\n  int x[101];\n  scanf(\"%d\", &n);\n  for (a = 10; a <= 100; a++)\n    x[a] = 1;\n\n  for (a = 1; a <= n; a++) {\n    cin >> z[a];\n  }\n  b = 1;\n  for (a = 1; a <= n; a++) {\n    if (x[z[a]] == 1) {\n      c[b] = z[a];\n      b += 1;\n      x[z[a]] = 0;\n    }\n  }\n  for (a = 1; a <= b - 1; a++) {\n    if (a < b - 1)\n      printf(\"%d \", c[a]);\n    else\n      cout << c[a];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int n;\n  int histgram[101];\n  int i;\n  int x;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    histgram[i] = 0;\n  }\n\n  scanf(\"%d\", &x);\n  histgram[x]++;\n  printf(\"%d\", x);\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d\", &x);\n    if (!histgram[x]) {\n      printf(\" %d\", x);\n    }\n    histgram[x]++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, k = 0, t, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n - k; i++) {\n    for (m = 1; m <= i; m++) {\n      if (a[i] == a[i - m]) {\n        t = i;\n        for (i = t; i < n - k; i++)\n          a[i] = a[i + 1];\n        i = t - 1;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < n - k - 1; i++)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[n - k - 1]);\n}\n"}
{"label": "13", "index": "24444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, f, m, k, t = 0;\n  scanf(\"%d\", &n);\n  int x[n], y, z[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &x[i]);\n    z[i] = 0;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    f = 0;\n    for (l = 0; l <= j - 1; l++) {\n      y = x[j] - x[l];\n      if (y == 0)\n        f = 1;\n    }\n    if (f == 0) {\n      z[t] = x[j];\n      t += 1;\n    }\n  }\n  for (m = 0; m <= n - 1; m++) {\n    if (z[m] == 0)\n      break;\n  }\n  for (k = 0; k <= m - 1; k++) {\n    if (z[k] != 0) {\n      printf(\"%d\", z[k]);\n    }\n    if (k <= m - 2) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[20000];\n  int a, n, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &u[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] == u[j]) {\n        u[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i] != 0) {\n      k++;\n    }\n  }\n  i = 0;\n  l = 0;\n  while (i < n) {\n    if (u[i] != 0)\n\n    {\n      if (l < k - 1) {\n        printf(\"%d \", u[i]);\n        l++;\n      }\n\n      else {\n        cout << u[i];\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24446", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n;\n  cin >> n;\n  int num[n]; \n  cin >> num[0];\n  cout << num[0]; \n  for (int i = 1; i < n; i++) {\n    cin >> num[i];\n    for (int j = 0; j < i; j++) {\n      if (num[j] == num[i]) \n        num[i] = 0;\n    }\n    if (num[i]) \n      cout << ' ' << num[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24447", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[10000], i, j;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] == 0) {\n      continue;\n    }\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b;\n  int m[20002];\n  int i = 1;\n  int a = 2;\n  int num;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d\", &m[i]);\n    i++;\n  } while (i <= n);\n  if (n == 1) {\n    printf(\"%d\", m[1]);\n  } else {\n    printf(\"%d\", m[1]);\n    do {\n      b = 1;\n      do {\n        num = 0;\n        if (m[b] == m[a]) {\n          num++;\n          break;\n        } else {\n          b++;\n        }\n      } while (b < a);\n      if (num == 0) {\n        printf(\" %d\", m[a]);\n      } else {\n      }\n      a++;\n    } while (a <= n);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 1, i = 0, j = 0, k = 0;\n  cin >> m;\n  int a[20000] = {0};\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < m; i++) {\n    cin >> a[i];\n    k = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24450", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j;\n  cin >> n;\n  int a[n];\n  int i = 0;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (((j == i) && (a[i] != a[i - 1])) == 1)\n      cout << \" \" << a[i];\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24451", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k = 1, r = 1, number[20001], number1[20001] = {0};\n  cin >> n;\n  for (i = 1; i != n + 1; i++) {\n    cin >> number[i];\n    for (j = 1, k = 1; j <= i; j++) {\n      if (number[i] == number1[j]) {\n        k = 0;\n        break;\n      }\n    }\n    if (k == 1) {\n      if (i == 1) {\n        cout << number[1];\n        number1[1] = number[1];\n        r++;\n      } else {\n        cout << \" \" << number[i];\n        number1[r] = number[i];\n        r++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  k = 0;\n  scanf(\"%d\", &n);\n  int a[n], b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (a[j] != 100) {\n      for (i = j + 1; i < n; i++) {\n        if (a[i] == a[j]) {\n          a[i] = 100;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 100) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[20001] = {0}, x, i, j;\n  cin >> x;\n  for (i = 1; i <= x; i++)\n    cin >> n[i];\n  for (i = 1; i <= x; i++) {\n    for (j = 1; j <= x; j++)\n      if (n[i] == n[j] && j > i)\n        n[j] = 0;\n  }\n  cout << n[1];\n  for (i = 2; i <= x; i++) {\n    if (n[i] != 0)\n      cout << \" \" << n[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24454", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a, i, j, l, k = 1;\n  cin >> a;\n  int s[20000] = {a};\n  for (i = 1; i < n; i++) {\n    scanf(\"%d \", &a);\n    j = 0;\n    while (s[j] != a) {\n      j++;\n      if (j == k) {\n        s[k] = a;\n        k++;\n      }\n    }\n  }\n  for (l = 0; l < k - 1; l++)\n    printf(\"%d \", s[l]);\n  cout << s[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24455", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, n, i;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1, b = 1; i <= n; i++, b++) {\n    if (b == 1)\n      printf(\"%d\", a[i]);\n    else {\n      for (c = 1; c <= i; c++) {\n        if (a[c] == a[i])\n          break;\n      }\n      if (c == i)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, c, b = 1;\n  cin >> N;\n  int a[20001];\n  for (int i = 1; i <= N; i++)\n    cin >> a[i];\n  for (int m = 2; m <= N; m++) {\n    for (c = 1; c <= b; c++) {\n      if (a[m] == a[c])\n        break;\n    }\n    if (c == b + 1) {\n      b++;\n      a[b] = a[m];\n    }\n  }\n  cout << a[1];\n  for (int d = 2; d <= b; d++)\n    cout << \" \" << a[d];\n  return 0;\n}\n"}
{"label": "13", "index": "24457", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k, p, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (j = 1; j <= n - 1; j++) {\n    for (k = j + 1; k <= n;) {\n      if (a[j] == a[k]) {\n        for (p = k; p <= n - 1; p++) {\n          a[p] = a[p + 1];\n        }\n        n--;\n      } else {\n        k++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\\n\", a[n]);\n  return 0;\n}\n"}
{"label": "13", "index": "24458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, input[20000], output[20000], i, j, k, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &input[i]);\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    for (j = 0; j < i; j++) {\n      if (input[i] == input[j]) {\n        x++;\n        break;\n      }\n    }\n    if (x == 0) {\n      k++;\n      output[k] = input[i];\n    }\n  }\n  for (i = 1; i < k; i++)\n    printf(\"%d \", output[i]);\n\n  if (i == k)\n    printf(\"%d\\n\", output[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[101];\n  int n, i, x;\n\n  for (i = 0; i <= 100; i++)\n    s[i] = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    if (s[x] == 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << x;\n      s[x] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", p + i);\n\n  cout << *p;\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i;) {\n      if (*(p + i) == *(p + j))\n        break;\n      else\n        j++;\n    }\n    if (j == i)\n      printf(\" %d\", *(p + i));\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[200001], j, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        flag = 1;\n      }\n    }\n    if (!flag)\n      cout << ' ' << a[i];\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p = 0;\n  int a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      printf(\"%d\", a[0]);\n    } else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          p += 1;\n        }\n      }\n      if (p == 0) {\n        printf(\" %d\", a[i]);\n      }\n      p = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001], b[101], c[101];\n  int i, n, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= 101; i++)\n    b[i] = 0;\n  m = 0;\n  for (i = 1; i <= n; i++)\n    if (b[a[i]] == 0) {\n      m = m + 1;\n      b[a[i]] = 1;\n      c[m] = a[i];\n    }\n  for (i = 1; i <= m; i++) {\n    if (i < m)\n      printf(\"%d \", c[i]);\n    else\n      printf(\"%d\", c[i]);\n  }\n}\n"}
{"label": "13", "index": "24464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++)\n    for (j = n - 1; j > i; j--) {\n      if (a[i] == 0)\n        break;\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n        a[k] = 0;\n        l = l + 1;\n      }\n    }\n  for (i = 0; i < n - l; i++) {\n    if (i == 0)\n      cout << a[i];\n    else\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24465", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  cout << a[0];\n  for (int j = 1; j < n; j++) {\n    l = 0;\n    for (int k = j - 1; k >= 0; k--) {\n      if (a[j] != a[k])\n        l = l;\n      else\n        l = l + 1;\n    }\n    if (l == 0)\n      cout << \" \" << a[j];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, num[90] = {0}, a[20001] = {0}, i;\n  scanf(\"%d \", &n);\n  cin >> a[1];\n  num[a[1] - 10]++;\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> a[i];\n    num[a[i] - 10]++;\n    if (num[a[i] - 10] == 1)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24467", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0;\n  cin >> n;\n  int a[10000]; \n  cin >> a[0];\n  for (i = 1; (i + t) < n; i++) \n  {\n    cin >> a[i];\n    for (j = 0; j < i; j++) \n    {\n      if (a[i] == a[j]) \n      {\n        i--;\n        t++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n - t - 1; i++)\n    cout << a[i] << ' '; \n  cout << a[n - t - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24468", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x = 0,\n                               q;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  for (k = 0; b[k] != 0; k++) {\n    x++;\n    if (x == 1)\n      printf(\"%d\", b[k]);\n    else\n      printf(\" %d\", b[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24469", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n - 1; i++) {\n    for (k = 0; k <= i - 1; k++) {\n      if (a[i] == a[k]) {\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 1; i++) {\n    if (a[i] != 0) {\n      if (i == 0) {\n        cout << a[i];\n      } else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24470", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[10000], i, j, x[10000], z = 0, h = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> x[i - 1];\n  m[0] = x[0];\n  for (i = 2; i <= n; i++) {\n    z = 0;\n    for (j = 1; j <= i - 1; j++)\n      if (x[j - 1] == x[i - 1])\n        z = 1;\n    if (z == 0) {\n      m[h] = x[i - 1];\n      h = h + 1;\n    }\n  }\n  for (i = 0; i <= h - 1; i++) {\n    printf(\"%d\", m[i]);\n    if (i != h - 1)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, n, m;\n  scanf(\"%d\", &k);\n  char c[20000];\n  for (i = 1; i <= k; i++)\n    scanf(\"%d\", &c[i]);\n\n  printf(\"%d\", c[1]);\n  for (n = 2; n <= k; n++) {\n    for (j = 1; j <= n - 1; j++) {\n      if (c[n] == c[j])\n        break;\n    }\n    if (j == n && c[n] != c[n - 1]) {\n      printf(\" \");\n      printf(\"%d\", c[n]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[20005], mark[100] = {0}, print = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    if (mark[a[i]] == 1)\n      continue;\n    else {\n      if (print)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n      print = 1;\n      mark[a[i]]++;\n    }\n  }\n  putchar(10);\n}\n"}
{"label": "13", "index": "24473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100001], b[100001];\n  int i, j, step = 1;\n  int n;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  b[step] = a[1];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j <= step; j++) {\n      if (a[i] == b[j])\n        break;\n    }\n    if (j == step + 1) {\n      step++;\n      cout << \" \" << a[i];\n      b[step] = a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  i = 0;\n  while (i < n) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n    i++;\n  }\n  printf(\"%d\", a[0]);\n  i = 1;\n  for (i = 1; i < n; i++)\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n}\n"}
{"label": "13", "index": "24475", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[20010];\n\nint main() {\n  int n, i, tmp, k, ii = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &tmp);\n    int j;\n    int flag = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == tmp) {\n        flag = 1;\n      }\n    }\n    if (flag == 0) {\n      a[ii] = tmp;\n      ii++;\n      \n    }\n  }\n  for (k = 0; k < ii - 1; k++) {\n    printf(\"%d \", a[k]);\n  }\n  printf(\"%d\", a[ii - 1]);\n}\n"}
{"label": "13", "index": "24476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[12683], b[12683];\n  int i, j, n, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &a[i]);\n    b[i] = 1;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (k = 0; k < j; k++) {\n      if (a[k] == a[j]) {\n        b[j] = 0;\n        break;\n      } else\n        b[j] = 1;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] == 1) {\n      printf(\" \");\n      printf(\"%d\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k = 2, i;\n  scanf(\"%d\", &n);\n  int a[n + 1];\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  while (k <= n) {\n    scanf(\"%d\", &a[k]);\n    i = 1;\n    while (i <= k - 1) {\n      if (a[i] == a[k])\n        break;\n      else if (i == k - 1)\n        cout << \" \" << a[k];\n      i = i + 1;\n    }\n    k = k + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i = 0, n, j, k, m = 1;\n  cin >> n;\n  for (k = 0; k < n; k++)\n    cin >> a[k];\n  k = 0;\n  while (i < n) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j]) {\n        m = 0;\n        break;\n      } else\n        j++;\n    }\n    if (m == 1) {\n      a[k] = a[i];\n      i++, k++;\n    } else\n      i++, m = 1;\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[200001], j, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i])\n        flag = 1;\n    }\n    if (!flag)\n      cout << ' ' << a[i];\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    for (j = 0; j <= i - 1; j++) {\n      if (a[i] == a[j]) {\n        i = i - 1;\n        n--;\n        break;\n      }\n    }\n  }\n  if ((n - 2) >= 0) {\n    for (i = 0; i <= n - 2; i++) {\n      cout << a[i] << \" \";\n    }\n    cout << a[n - 1];\n  } else {\n    printf(\"%d\", a[0]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a, time;\n  k = 1;\n  time = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (sz[i] == sz[k]) {\n        for (a = k; a < n - 1; a++) {\n          sz[a] = sz[a + 1];\n        }\n        n--;\n        k--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", sz[i]);\n    else if (i != 0) {\n      printf(\" %d\", sz[i]);\n    }\n  }\n  free(sz);\n  return 0;\n}\n"}
{"label": "13", "index": "24483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 0, c = 0; j < i; j++) {\n      if (a[i] != a[j])\n        c++;\n    }\n    if (c == i)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num, a[20001];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> num;\n    a[i - 1] = num;\n    if (i == 1)\n      printf(\"%d\", num);\n    else {\n      int j = 0;\n      while (j < i - 1) {\n        if (a[j] == num)\n          break;\n        else\n          j++;\n      }\n      if (j == i - 1)\n        cout << \" \" << num;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, s, sum, num[100000] = {0};\n  scanf(\"%d\", &sum);\n  for (i = 0; i < sum; i++) {\n    scanf(\"%d\", &num[i]);\n  }\n  for (i = 0; i < sum; i++) {\n    for (j = 0; j < i; j++) {\n      if (num[i] == num[j]) {\n        num[i] = 0;\n        break;\n      }\n    }\n  }\n  cout << num[0];\n  for (i = 1; i < sum; i++) {\n    if (num[i] == 0)\n      continue;\n    else\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - sum; i++)\n    for (j = i + 1; j < n - sum; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n - sum - 1; k++)\n          a[k] = a[k + 1];\n        sum++;\n        j--;\n      }\n    }\n  for (i = 0; i < n - sum - 1; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "24487", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int c[n];\n  scanf(\"%d\", &c[1]);\n  printf(\"%d\", c[1]);\n  for (i = 2; i <= n; i++) {\n    cin >> c[i];\n    for (j = 1; j <= i - 1; j++) {\n      if (c[j] == c[i]) {\n        break;\n      }\n    }\n    if (j == i)\n      printf(\" %d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[20000], i, j = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &m[i]);\n    for (j = 0; j < i; j++) {\n      if (m[i] == m[j])\n        break;\n    }\n    if (i == j) {\n      if (count == 0) {\n        cout << m[i];\n        count++;\n      } else\n        cout << \" \" << m[i];\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, e;\n  e = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        a[j] = 0;\n      }\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (e == 0 && a[i] != 0) {\n      printf(\"%d\", a[i]);\n      e = 1;\n    } else if (e == 1 && a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "13", "index": "24490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j, k = 0, b = 0;\n  int a[20000], c[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      c[k] = a[i];\n      k++;\n    } else\n      b = b + 1;\n  }\n  for (k = 0; k < n - b - 1; k++)\n    printf(\"%d \", c[k]);\n  printf(\"%d\", c[n - b - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, i, d, j;\n  int a[20001];\n  cin >> h;\n  for (i = 1; i <= h; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= h; i++) {\n    d = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 0)\n      cout << \" \" << a[i];\n  }\n}\n"}
{"label": "13", "index": "24492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct number {\n    int num, status;\n  } a[20000];\n  int n, i, j, count;\n  cin >> n;\n  count = n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    a[i].status = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i].num == a[j].num) {\n        a[i].status = 0;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (a[i].status && j != count - 1) {\n      cout << a[i].num << \" \";\n      j++;\n      continue;\n    }\n    if (a[i].status && j == count - 1) {\n      printf(\"%d\\n\", a[i].num);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24493", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n], i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i) {\n      if (i != 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, num[20000], judge;\n\n  cin >> n;\n  cout << endl;\n  if (n > 0 && n <= 20000) {\n    for (i = 0; i < n; i++) {\n      judge = 0;\n      cin >> judge;\n      if (judge >= 10 && judge < 100)\n\n      {\n        num[i] = judge;\n      }\n    }\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++) {\n        if (num[i] - num[j] == 0)\n\n          num[i] = 0;\n      }\n    cout << num[0];\n    for (i = 1; i < n; i++) {\n      if (num[i] != 0)\n        cout << \" \" << num[i];\n    }\n  } else {\n    cout << \"error\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24495", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[10005], n, i, j, flag = 1, flag2 = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    cin >> a[i];\n    for (j = 1; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        flag = 0;\n    }\n    if (flag) {\n      if (flag2 == 0) {\n        cout << a[i];\n        flag2 = 1;\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24496", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d\", &n);\n  int *N = (int *)malloc(sizeof(int) * n);\n  for (int k = 0; k < n; k++) {\n    scanf(\"%d\", &(N[k]));\n  }\n  for (i = 1; i < n; i++) {\n    for (int r = 0; r < i; r++) {\n      if (N[i] == N[r]) {\n        for (int j = i; j < n; j++) {\n          N[j] = N[j + 1];\n        }\n        n--;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == n - 1)\n      printf(\"%d\", N[i]);\n    else\n      printf(\"%d \", N[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, m = 1, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < m; i++) {\n    printf(\" %d\", b[i]);\n  }\n}\n"}
{"label": "13", "index": "24498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100000];\nint n;\nvoid del_a(int x) {\n  for (int i = x; i < n - 1; i++) {\n    a[i] = a[i + 1];\n  }\n  a[n - 1] = 0;\n  n = n - 1;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 1; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        del_a(i);\n        i = i - 1;\n        break;\n      }\n    }\n  }\n  for (int i = 0; i < n - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%d\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, f;\n\n  scanf(\"%d%d\", &n, a);\n  cout << *a;\n  for (i = 1; i < n; i++) {\n    f = 0;\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        f = 1;\n    }\n    if (f == 0) {\n      printf(\" %d\", *(a + i));\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, m, j;\n  cin >> n;\n  int a[20000];\n  for (i = 0; i <= n - 1; i++) {\n    cin >> m;\n    for (j = 0; j < i; j++) {\n      if (a[j] == m) {\n        break;\n      }\n    }\n    if (j == i) {\n      a[i] = m;\n    } else {\n      n = n - 1;\n      i = i - 1;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001], i, flag[91] = {0}, n;\n  cin >> n;\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  cout << a[0];\n  flag[a[0] - 10] = 1;\n  for (i = 0; i < n; i++) {\n    if (flag[a[i] - 10] == 0) {\n      cout << ' ' << a[i];\n      flag[a[i] - 10] = 1;\n\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num, count[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d \", &num);\n    count[num]++;\n    if (i == 1)\n      cout << num;\n    if (count[num] == 1 && i >= 2)\n      cout << \" \" << num;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], i, j, k = 0, flag, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++) {\n    flag = 1;\n    for (j = 0; j <= i - 1; j++)\n      if (b[j] == a[i]) {\n        flag = 0;\n        break;\n      }\n    if (flag) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= k - 2; i++)\n    printf(\"%d \", b[i]);\n  cout << b[k - 1];\n}\n"}
{"label": "13", "index": "24504", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct number {\n    int num, status;\n  } a[20000];\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  count = n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    a[i].status = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i].num == a[j].num) {\n        a[i].status = 0;\n        count--;\n        break;\n      }\n    }\n  }\n  for (i = 0, j = 0; i < n; i++) {\n    if (a[i].status && j != count - 1) {\n      printf(\"%d \", a[i].num);\n      j++;\n      continue;\n    }\n    if (a[i].status && j == count - 1) {\n      printf(\"%d\\n\", a[i].num);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%d\", &a[i]);\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = k + 1;\n    }\n    if (k == 0)\n      cout << \" \" << a[i];\n    k = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24506", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20010], b[20010] = {0}, m = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    for (j = 0; j <= m; j++) {\n      if (a[i] == b[j]) {\n        break;\n      }\n      if (j == m) {\n        b[m] = a[i];\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (i == m - 1)\n      printf(\"%d\", b[i]);\n    else\n      printf(\"%d \", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a[91];\n  int i;\n  for (i = 0; i < 91; i++) {\n    a[i] = 0;\n  }\n  scanf(\"%d \", &n);\n  scanf(\"%d \", &i);\n  cout << i;\n  a[i - 10] = 1;\n  while (n > 0) {\n    n--;\n    int b;\n    cin >> b;\n    if (a[b - 10] == 0) {\n      cout << ' ' << b;\n      a[b - 10] = 1;\n    }\n  }\n}\n"}
{"label": "13", "index": "24508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        a[i] = 0;\n        break;\n      }\n  }\n  for (k = 0; k < n; k++) {\n    if (a[k]) {\n      if (!k)\n        printf(\"%d\", a[k]);\n      else\n        printf(\" %d\", a[k]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24509", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    printf(\"\\n\");\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0, k = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k++;\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 1; i < n; i++)\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        a[i] = 0;\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n}\n"}
{"label": "13", "index": "24511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], i, j, k, m = 0, n, b = 0, c = 1;\n  scanf(\"%d\", &n);\n  k = n;\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        k -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && c < k) {\n      printf(\"%d \", a[i]);\n      c += 1;\n    } else {\n      if (a[i] != 0 && c == k) {\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int k, n, b[20001], c[20001], i = 0, j = 1, l,\n                                m; \n  cin >> n;                        \n  for (l = 0; l < 20001; l++)      \n  {\n    b[l] = 0;\n  }\n  for (m = 0; m < 20001; m++) {\n    c[m] = 0;\n  }\n  while (j <= n) \n  {\n    cin >> k;\n    if (b[k] == 0) \n      c[i] = k;    \n    b[k]++;        \n    i++;\n    j++;\n  }\n  cout << c[0];\n  for (i = 1; i < n; i++) \n  {\n    if (c[i] != 0) {\n      cout << \" \" << c[i];\n    }\n    \n  }\n\n  return 0;\n} \n"}
{"label": "13", "index": "24513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, i, j, n;\n  int a[20000], b[20000];\n  a[20000] = '\\0';\n  b[20000] = '\\0';\n  cin >> n;\n\n  for (i = 0; i < n; i = i + 1)\n    cin >> b[i];\n\n  a[0] = b[0];\n  m = 1;\n  t = 1;\n  for (i = 1; i < n; i = i + 1) {\n    for (j = 0; j < m; j = j + 1) {\n      if (a[j] == b[i])\n        t = 0;\n    }\n    if (t == 1) {\n      a[m] = b[i];\n      m = m + 1;\n    }\n    t = 1;\n  }\n\n  for (i = 0; i < m - 1; i = i + 1)\n    printf(\"%d \", a[i]);\n  cout << a[m - 1];\n}\n"}
{"label": "13", "index": "24514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, p = 0;\n  int a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    if (i == 0) {\n      printf(\"%d\", a[0]);\n    } else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j]) {\n          p += 1;\n        }\n      }\n      if (p == 0) {\n        printf(\" %d\", a[i]);\n      }\n      p = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, f, m, k, t = 0;\n  scanf(\"%d\", &n);\n  int x[n], y, z[n];\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &x[i]);\n    z[i] = 0;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    f = 0;\n    for (l = 0; l <= j - 1; l++) {\n      y = x[j] - x[l];\n      if (y == 0) {\n        f = 1;\n      }\n    }\n    if (f == 0) {\n      z[t] = x[j];\n      t += 1;\n    }\n  }\n  for (m = 0; m <= n - 1; m++) {\n    if (z[m] == 0) {\n      break;\n    }\n  }\n  for (k = 0; k <= m - 1; k++) {\n    if (z[k] != 0) {\n      printf(\"%d\", z[k]);\n    }\n    if (k <= m - 2) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> x[i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = i + 1; j < n; j++) {\n      if (x[i] == x[j] && i != j)\n\n        x[j] = 0;\n    }\n\n  printf(\"%d\", x[0]);\n\n  for (i = 1; i < n; i++) {\n    if (x[i] != 0) {\n      cout << \" \" << x[i];\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "24517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int b[20000];\n  scanf(\"%d%d\", &n, &b[0]);\n  printf(\"%d\", b[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] == b[j]) {\n        b[i] = 0;\n      }\n    }\n  }\n  for (m = 1; m < n; m++) {\n    if (b[m] != 0) {\n      cout << \" \" << b[m];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, num[20010], m;\n  scanf(\"%d \", &n);\n  m = n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &num[i]);\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] == num[i] && num[j] != 0) {\n        num[j] = 0;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (num[i] != 0) {\n      m--;\n      if (m > 0)\n        cout << num[i] << \" \";\n      else\n        printf(\"%d\\n\", num[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24519", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101], number, i;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 100; i++)\n    a[i] = 0;\n  cin >> number;\n  cout << number;\n  a[number] = 1;\n  for (i = 1; i <= n - 1; i++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number] = 1;\n      printf(\" %d\", number);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < i; j++) {\n      if (s[j] == s[i])\n        s[i] = 0;\n    }\n  cout << s[0];\n  for (i = 1; i < n; i++) {\n    if (s[i] != 0)\n      printf(\" %d\", s[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int mark[101];\n  for (int i = 0; i < 101; i++)\n    mark[i] = 0;\n  int num[20005];\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  cout << num[0];\n  mark[num[0]] = 1;\n  for (int i = 0; i < n; i++) {\n    if (mark[num[i]] == 0) {\n      mark[num[i]] = 1;\n      cout << \" \" << num[i];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24522", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x = 0,\n                               q;\n\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  for (k = 0; b[k] != 0; k++) {\n    x++;\n    if (x == 1)\n      printf(\"%d\", b[k]);\n    else {\n      printf(\" %d\", b[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24523", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int number[1000];\n  int i;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d\", &number[i]);\n    i++;\n  }\n  i = 1;\n  int j = 0;\n  printf(\"%d\", number[0]);\n  while (i < n) {\n    while (j < i) {\n      if (number[i] == number[j]) {\n        break;\n      } else {\n        j++;\n      }\n      if (j == i) {\n        printf(\" %d\", number[i]);\n      }\n    }\n    j = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[20000], b[20000];\n  cin >> n;\n  scanf(\"%d\", &a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++) {\n      b[i] = a[i] - a[j];\n      if (b[i] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 0; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, h = 0;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= (n - 1); i++) {\n    if (a[i] != -1) {\n      for (j = i + 1; j <= (n - 1); j++) {\n        if (a[i] == a[j]) {\n          a[j] = -1;\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++)\n    b[i] = a[i];\n  for (i = 0; i <= (n - 1); i++) {\n    if (b[i] != -1) {\n      printf(\"%d\", b[i]);\n      h++;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = i + 1; i <= n - 1; i++) {\n    if (b[i] != -1) {\n      cout << \" \" << b[i];\n      h++;\n    }\n    if (h == n - k)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  int a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n  count = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0)\n      if (count == 0) {\n        printf(\"%d\", a[i]);\n        count = 1;\n      } else\n        printf(\" %d\", a[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001] = {0}, j, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (l = (i + 1); l < n; l++) {\n      if (a[l] == a[i]) {\n        for (j = (l + 1); j < n; j++) {\n          a[j - 1] = a[j];\n        }\n        l -= 1;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%d\", a[i]);\n    else\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, q = 0, a[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - q; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        q++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < n - q - 1; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n - q - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, b[20001], i, j = 0, c[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[b[i]] == 0) {\n      j++;\n      c[j] = b[i];\n      a[b[i]] = 1;\n    }\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", c[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24530", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[20001], used[200];\n  for (i = 0; i < 200; i++)\n    used[i] = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  used[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (used[a[i]])\n      continue;\n    printf(\" %d\", a[i]);\n    used[a[i]] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24531", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], p[200], x, step = -1;\n  cin >> n;\n  memset(p, 0, sizeof(p));\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) \n  {\n    cin >> x;\n    if (p[x] == 0) \n    {\n      step++; \n      a[step] = x;\n      p[x] = 1; \n    }\n  }\n  cout << a[0];\n  for (int j = 1; j <= step; j++)\n    cout << ' ' << a[j];\n  return 0;\n}\n"}
{"label": "13", "index": "24532", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20001], count[101] = {0};\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    count[a[i]]++;\n  }\n  printf(\"%d\", a[1]);\n  count[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (count[a[i]] >= 1) {\n      cout << \" \" << a[i];\n      count[a[i]] = 0;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint BT(int x, int a[40000]) {\n  int b = 0, c = 0;\n  while (b < 40000) {\n    if (a[b] == x) {\n      c = 1;\n      break;\n    } else\n      b++;\n  }\n  return c;\n}\nint main() {\n  int n, a[40000], i, b[40000], c;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < 10001; i++)\n    b[i] = -1;\n  for (i = 0, c = 0; i < n; i++)\n    if (BT(a[i], b) == 0) {\n      if (c == 0) {\n        printf(\"%d\", a[i]);\n      } else\n        printf(\" %d\", a[i]);\n      b[c] = a[i];\n      c++;\n    }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b, a[20000], i, j;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[0]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    scanf(\"%d\", &b);\n    a[i] = b;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24535", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, v[20000], m = 0, s[20000], p = 0;\n  cin >> n;\n  for (int i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &v[i]);\n  }\n  for (int j = 1; j <= n - 1; j++) {\n    for (int k = 0; k <= j - 1; k++) {\n      if (v[j] != v[k]) {\n        p++;\n      }\n    }\n    if (p == j) {\n      s[m] = v[j];\n      m++;\n    }\n    p = 0;\n  }\n  if (m == 0) {\n    printf(\"%d\", v[0]);\n  } else {\n    printf(\"%d \", v[0]);\n  }\n  for (int k = 0; k <= m - 1; k++) {\n    if (k == m - 1) {\n      printf(\"%d\", s[k]);\n    } else {\n      printf(\"%d \", s[k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], t;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    t = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] == a[i] && j != i)\n        t += 1;\n    }\n    if (t >= 1)\n      continue;\n    else if (t == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, k, l, t = 1;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &a[l]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n;) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n      }\n      if (a[i] != a[j])\n        j++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t) {\n      printf(\"%d\", a[i]);\n      t = 0;\n    } else\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24538", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[1000], times[200];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; ++i)\n    cin >> a[i];\n  int tot = 0;\n  for (int i = 0; i < n; ++i) {\n    if (!times[a[i]]) {\n      tot++;\n      times[a[i]]++;\n      if (tot > 1)\n        cout << \" \";\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24539", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b;\n  int m[20002];\n  int i = 1;\n  int a = 2;\n  int num;\n  scanf(\"%d\", &n);\n  do {\n    scanf(\"%d \", &m[i]);\n    i++;\n  } while (i <= n);\n  if (n == 1) {\n    printf(\"%d\", m[1]);\n  } else {\n    printf(\"%d\", m[1]);\n    do {\n      b = 1;\n      do {\n        num = 0;\n        if (m[b] == m[a]) {\n          num++;\n          break;\n        } else {\n          b++;\n        }\n      } while (b < a);\n      if (num == 0) {\n        printf(\" %d\", m[a]);\n      } else {\n      }\n      a++;\n    } while (a <= n);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24540", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, l, k;\n  cin >> n;\n  int a[20001];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n        n = n - 1;\n        j = j - 1;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    cout << a[l] << setw(3);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24541", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101] = {0};\n  int i = 0;\n  int n = 0;\n  int t = 0;\n  int f = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> t;\n    if ((f != 0) && (!a[t]))\n      cout << \" \";\n    else\n      f = 1;\n    if (!a[t])\n      cout << t;\n    a[t] = 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int n, i, k, j, l, m, bn;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[0] = a[0];\n  m = 0;\n  for (j = 1; j < n; j++) {\n    for (k = 0, l = 1; k < j; k++) {\n      if (a[j] == a[k]) {\n        l = 0;\n        break;\n      }\n    }\n    if (l != 0) {\n      m += 1;\n      b[m] = a[j];\n    }\n  }\n  for (bn = 0; bn < m; bn++) {\n    cout << b[bn] << \" \";\n  }\n  printf(\"%d\", b[m]);\n}\n"}
{"label": "13", "index": "24543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n, r = 0, s = 0;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n - 1; i > 0; i--)\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        a[i] = -1;\n        r++;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != -1) {\n      if (s != n - r - 1) {\n        cout << a[i] << \" \";\n        s++;\n      } else\n        cout << a[i] << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24544", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], count[100], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < 100; i++)\n    count[i] = 0;\n  printf(\"%d\", a[0]);\n  count[a[0]]++;\n  for (i = 0, j = 1; j < n; j++) {\n    if (count[a[j]] == 0) {\n      i++;\n      a[i] = a[j];\n      count[a[j]]++;\n    }\n  }\n  for (j = 1; j <= i; j++)\n    cout << \" \" << a[j];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24545", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, count = 0, p = 0, n;\n  int a[20002] = {0}, b[20002] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        b[i] = 1;\n    }\n    if (b[i] == 0)\n      count = count + 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] != 1) {\n      p = p + 1;\n      if (p != count)\n        cout << a[i] << \" \";\n      else\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000], i, j, n, r = 0, s = 0;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = n - 1; i > 0; i--)\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] == a[j]) {\n        a[i] = -1;\n        r++;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (a[i] != -1) {\n      if (s != n - r - 1) {\n        printf(\"%d \", a[i]);\n        s++;\n      } else\n        printf(\"%d\\n\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[20000], b[101], c, i, j, n;\n  for (i = 10; i <= 100; i++) {\n    b[i] = 0;\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    c = a[i];\n    if (b[c] == 0)\n      b[c]++;\n    else\n      a[i] = 0;\n  }\n  cout << a[0];\n  for (j = 1; j < n; j++) {\n    if (a[j] != 0)\n      cout << \" \" << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  unsigned int n;\n  int i, j, a[20000], m;\n  scanf(\"%u\", &n);\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        m = 1;\n        break;\n      }\n    if (m == 0)\n      cout << \" \" << a[i];\n  }\n  cout << \"\\n\";\n}\n"}
{"label": "13", "index": "24549", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a = 0, n = 0, m = 0, i = 0, k = 0;\n  cin >> n;\n  k = n;\n  int num[n];\n  for (; i < n; i++)\n    scanf(\"%d \", &num[i]);\n  for (i = 0; i < k; i++) {\n    for (m = i + 1; m < k; m++) {\n      if (num[m] == num[i]) {\n        for (a = m; a < k; a++)\n          num[a] = num[a + 1];\n        k--;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, k;\n  cin >> n;\n  int a[20000];\n  cin >> a[0];\n  while (scanf(\"%d \", &a[i])) {\n    i++;\n    if (i == n)\n      break;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n    int mid = 0;\n    for (k = 0; k < i; k++) {\n      if (a[i] == a[k]) {\n        mid = 1;\n        break;\n      }\n    }\n    if (mid == 0)\n      cout << \" \" << a[i];\n    i++;\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, t;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++) {\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        a[j] = 0;\n    }\n    if (a[j])\n      printf(\" %d\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24552", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int num, count[100] = {0};\n  cin >> num;\n  count[num]++;\n  printf(\"%d\", num);\n  for (i = 2; i <= n; i++) {\n    cin >> num;\n    count[num]++;\n    if (count[num] == 1)\n      cout << \" \" << num;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, num[20001], sum = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (num[i] == 101)\n        break;\n      if (num[j] == num[i])\n        num[j] = 101; \n    }\n\n  for (int i = 0; i < n; i++) {\n    if (num[i] == 101 && num[i + 1] != 101) { \n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n    } else if (num[i] == 101 && num[i + 1] == 101) {\n      for (int m = i; m < n; m++) {\n        num[m] = num[m + 1];\n      }\n      sum++;\n      i--;\n    }\n  }\n  for (int i = 0; i < n - sum - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[n - sum - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[20000], i, num, count[20000] = {0};\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    num = a[i];\n    count[num]++;\n\n    if (i == 0)\n      cout << a[i];\n    else {\n      if (count[num] == 1)\n        printf(\" %d\", num);\n    }\n  }\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, i, j, n;\n  int a[20000], b[20000];\n  a[20000] = '\\0';\n  b[20000] = '\\0';\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i = i + 1)\n    scanf(\"%d\", &b[i]);\n\n  a[0] = b[0];\n  m = 1;\n  t = 1;\n  for (i = 1; i < n; i = i + 1) {\n    for (j = 0; j < m; j = j + 1) {\n      if (a[j] == b[i])\n        t = 0;\n    }\n    if (t == 1) {\n      a[m] = b[i];\n      m = m + 1;\n    }\n    t = 1;\n  }\n\n  for (i = 0; i < m - 1; i = i + 1)\n    cout << a[i] << \" \";\n  printf(\"%d\", a[m - 1]);\n}\n"}
{"label": "13", "index": "24556", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[20001], t, i, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    m = 1;\n    for (t = 0; t < i; t++) {\n      if (a[i] == a[t]) {\n        m = 0;\n      }\n    }\n    if (m == 1) {\n      if (i > 0) {\n        printf(\" \");\n      }\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24557", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[20000], flag[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag[i] = 1;\n    }\n    if (flag[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= i; j++) {\n      if (i != 1 && a[j - 1] == a[i])\n        a[i] = 0;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (i != 1 && a[i] != 0)\n      printf(\" %d\", a[i]);\n    else if (i == 1)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t, p;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    p = 0;\n    t = 0;\n    do {\n      if (a[i] == a[p])\n        t = 1;\n      p += 1;\n    } while (t == 0 && p < i);\n    if (t == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24560", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint main() {\n  int n, j = 0, m = 0;\n  cin >> n;\n  int a[100000];\n  int b[100000];\n  for (int k = 0; k < n; k++) {\n    cin >> a[k];\n  }\n  for (int i = 0; i < n; i++) {\n    int count = 0;\n    for (int l = 0; l < i; l++) {\n      if (a[l] == a[i]) {\n        count = 1;\n        m = m + 1;\n        break;\n      }\n    }\n    if (!count) {\n      b[j] = a[i];\n      j++;\n    }\n  }\n  for (int h = 0; h < (n - m); h++) {\n    if (h == 0)\n      cout << b[h];\n    if (h > 0)\n      cout << \" \" << b[h];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  int temp[20001], k = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      temp[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << temp[i] << ' ';\n  cout << temp[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int num[20001];\n  memset(num, 0, 20001);\n  int i, j;\n  int count = 1;\n  int number;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &number);\n    if (i == 1)\n      num[0] = number;\n    else {\n      for (j = 1; j <= count; j++) {\n        if (number == num[j - 1]) {\n          break;\n        } else {\n        }\n        if (j == count) {\n          count++;\n          num[count - 1] = number;\n        } else {\n        }\n      }\n    }\n  }\n  for (i = 1; i < count; i++) {\n    cout << num[i - 1] << \" \";\n  }\n  printf(\"%d\", num[count - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, m, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      m = i;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] != 0) {\n      printf(\"%d \", a[i]);\n    }\n  }\n  printf(\"%d\", a[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "24564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100000], i, j, b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = a[j];\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] != a[i])\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, x = 0, n, a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      x++;\n      if (x == 1) {\n        cout << a[i];\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000];\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (j == i)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b[101] = {0}, i;\n\n  cin >> n;\n  int a[20001] = {0};\n\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n    b[a[i]] = b[a[i]] + 1;\n  }\n  cout << a[1];\n  b[a[1]] = 0;\n  for (i = 2; i <= n; i++) {\n    if (b[a[i]] != 0) {\n      cout << \" \" << a[i];\n    }\n    b[a[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[91];\n  int i, n, number;\n  cin >> n;\n  memset(a, 0, sizeof(a));\n  cin >> number;\n  a[number - 10]++;\n  if (a[number - 10] == 1)\n    cout << number;\n  for (i = 1; i < n; i++) {\n    cin >> number;\n    a[number - 10]++;\n    if (a[number - 10] == 1)\n      cout << \" \" << number;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, x;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    cin >> x;\n    a[i] = x;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (t = j; t < n; t++) {\n          a[t] = a[t + 1];\n        }\n        n--;\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n\n  printf(\"%d\\n\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100];\n  int i = 0;\n  int x;\n  scanf(\"%d\", &x);\n  printf(\"%d\", x);\n  a[i] = x;\n  i++;\n  for (int j = 1; j < n; j++) {\n    int h;\n    int k = 0;\n    scanf(\"%d\", &h);\n    for (int t = 0; t < i; t++) {\n      if (h == a[t])\n        k = 1;\n    }\n    if (k == 0) {\n      printf(\" %d\", h);\n      a[i] = h;\n      i++;\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24571", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], i, j, k, m = 0, n, b = 0, c = 1;\n  scanf(\"%d \", &n);\n  k = n;\n  for (i = 0; i < n - 1; i++) {\n    cin >> a[i];\n  }\n  scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        k -= 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0 && c < k) {\n      printf(\"%d \", a[i]);\n      c += 1;\n    } else {\n      if (a[i] != 0 && c == k) {\n        printf(\"%d\", a[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24572", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x = 0,\n                               q;\n\n  scanf(\"%d \", &m);\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  for (k = 0; b[k] != 0; k++) {\n    x++;\n    if (x == 1)\n      printf(\"%d\", b[k]);\n    else\n      printf(\" %d\", b[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        a[i] = 0;\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++)\n    if (a[i] != 0)\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24574", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n;\n  cin >> n;\n  int str[20001];\n  for (int i = 0; i < n; i++)\n    cin >> str[i];\n  int num = 0;\n  for (int i = 1; i < n - num; i++) {\n    for (int j = 0; j < i; j++)\n      if (str[j] == str[i]) {\n        for (int k = i; k < n - 1 - num; k++)\n          str[k] = str[k + 1];\n        num++;\n        \n        i--;\n        break;\n      }\n  }\n  cout << str[0];\n  for (int i = 1; i < n - num; i++)\n    cout << ' ' << str[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24575", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i = 0, n, j, k, m = 1;\n  cin >> n;\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &a[k]);\n  k = 0;\n  while (i < n) {\n    for (j = 0; j < i;) {\n      if (a[i] == a[j]) {\n        m = 0;\n        break;\n      } else\n        j++;\n    }\n    if (m == 1) {\n      a[k] = a[i];\n      i++, k++;\n    } else\n      i++, m = 1;\n  }\n  for (i = 0; i < (k - 1); i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\\n\", a[k - 1]);\n}\n"}
{"label": "13", "index": "24576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int N, m, i, j, a[10000], t, b[10000] = {0}, n[10000] = {0}, k, p = 0, x, q;\n\n  cin >> m;\n  for (j = 0; j < m; j++)\n    scanf(\"%d\", &a[j]);\n  b[0] = a[0];\n  for (j = 0; j < m; j++) {\n    p = 0;\n    for (k = 0; b[k] != 0; k++) {\n      if (a[j] == b[k]) {\n        n[k]++;\n        p = 1;\n        break;\n      }\n    }\n    if (p == 0) {\n      b[k] = a[j];\n      n[k]++;\n    }\n  }\n  x = 0;\n  q = 0;\n  if (n[0] == 1)\n    printf(\"%d\", b[0]);\n  else if (n[0] >= 2) {\n    cout << b[0];\n    n[0] = 0;\n  }\n\n  for (j = 1; b[j] != 0; j++) {\n    if (n[j] == 1) {\n      printf(\" %d\", b[j]);\n    } else if (n[j] >= 2) {\n      printf(\" %d\", b[j]);\n      n[j] = 0;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000] = {0};\n  int i, j, k = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == 0) {\n        if (a[i] == a[j]) {\n          b[j] = 1;\n          k++;\n        }\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[20000], counter = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      counter++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (i == j) {\n      cout << a[i];\n      counter--;\n      if (counter != 0)\n        cout << ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, timer, k, k0;\n  timer = 0;\n  k0 = 0;\n  k = -1;\n  int l[100000], r[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &l[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (l[i] == l[j]) {\n        l[j] = 10000;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] == 10000) {\n      timer++;\n    }\n  }\n  \n  for (i = 0; i < n; i++) {\n    if (l[i] != 10000) {\n      \n      k0++;\n      k++;\n      r[k] = l[i];\n    } else {\n      continue;\n    }\n  }\n  for (i = 0; i < k0; i++) {\n    if (k == 0) {\n      printf(\"%d\", r[i]);\n    } else if (k != 0 && i < k0 - 1) {\n      printf(\"%d \", r[i]);\n    } else if (i == k0 - 1) {\n      printf(\"%d\", r[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24580", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    ;\n  else {\n    int a[n];\n    for (i = 0; i < n; i++)\n      cin >> a[i];\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      int k = 0, j;\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          k++;\n      if (k == 0)\n        cout << ' ' << a[i];\n    }\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "13", "index": "24581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[n];\n  cin >> a[0];\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        break;\n      if (a[i] != a[j] && j == (i - 1))\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 2; i <= n; i++) {\n    int j = 1;\n    while (j < i) {\n      if (a[i - 1] == a[j - 1]) {\n        break;\n      } else {\n        j++;\n      }\n    }\n    if (j == i) {\n      printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, count = 0, a[20000]; \n  cin >> n;                                     \n  for (i = 0; i <= n - 1; i++)                  \n    cin >> a[i];\n  cout << a[0];                \n  for (i = 1; i <= n - 1; i++) \n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == a[i])\n        count++;\n    }               \n    if (count == 0) \n      cout << ' ' << a[i];\n    else\n      count = 0;\n  } \n  return 0;\n}\n"}
{"label": "13", "index": "24584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, end;\n  cin >> n;\n  int a[n], b[n];\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = 1;\n    }\n  for (int i = n - 1; i >= 0; i--) {\n    if (b[i] == 0) {\n      end = i;\n      b[i] = 1;\n      break;\n    }\n  }\n  if (end != 0) {\n    for (int i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\"%d \", a[i]);\n    }\n  }\n  cout << a[end] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24585", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, end;\n  cin >> n;\n  int a[n], b[n];\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        b[j] = 1;\n    }\n  for (int i = n - 1; i >= 0; i--) {\n    if (b[i] == 0) {\n      end = i;\n      b[i] = 1;\n      break;\n    }\n  }\n  if (end != 0) {\n    for (int i = 0; i < n; i++) {\n      if (b[i] == 0)\n        cout << a[i] << \" \";\n    }\n  }\n  cout << a[end] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, m, j;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      m = i;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (a[i] != 0) {\n      printf(\"%d \", a[i]);\n    }\n  }\n  printf(\"%d\", a[m]);\n  return 0;\n}\n"}
{"label": "13", "index": "24587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 20000) {\n    scanf(\"%d\", &a[0]);\n    for (i = 1; i < n; i++)\n      scanf(\" %d\", &a[i]);\n    for (i = 0, m = 0; i < n - m - 1; i++) {\n      for (j = i + 1; j < n - m; j++) {\n        if (a[i] != a[j])\n          continue;\n        else {\n          for (k = j; k < n - m - 1; k++)\n            a[k] = a[k + 1];\n          m++;\n          j--;\n        }\n      }\n    }\n    cout << a[0];\n    for (i = 1; i < n - m; i++)\n      printf(\" %d\", a[i]);\n  }\n}\n"}
{"label": "13", "index": "24588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      cout << a[0];\n    } else {\n      for (j = 0; j <= i - 1; j++) {\n        if (a[j] == a[i]) {\n          a[i] = 0;\n          break;\n        }\n      }\n      if (a[i]) {\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, e;\n  e = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    if (e == 0 && a[i] != 0) {\n      printf(\"%d\", a[i]);\n      e = 1;\n    } else if (e == 1 && a[i] != 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  int hou;\n  scanf(\"%d\", &hou);\n  return 0;\n}\n"}
{"label": "13", "index": "24590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k = 0, a[90], b[20000];\n  for (i = 0; i <= 89; i++)\n    a[i] = i + 10;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &b[i]);\n  for (i = 0; i <= n - 1; i++) {\n    int j;\n    for (j = 0; j <= 89; j++) {\n      if (b[i] == a[j]) {\n        if (k == 0)\n          printf(\"%d\", a[j]);\n        else\n          printf(\" %d\", a[j]);\n        a[j] = 0;\n        k++;\n        break;\n      }\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24591", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int b, d, e, f, g, i, j, k, l, m, n, p;\n  scanf(\"%d\", &n);\n  cin >> p;\n  printf(\"%d\", p);\n  a[p]++;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &p);\n    if (a[p] == 0) {\n      printf(\" %d\", p);\n      a[p]++;\n    }\n  }\n  return 7;\n}\n"}
{"label": "13", "index": "24592", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, s = 0, num = 0, k = 0;\n  int a[20006];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        n--;\n        j--;\n        s++;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n    if (i != n - 1) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, k, l, t = 1;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &a[l]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n;) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++)\n          a[k] = a[k + 1];\n\n        n = n - 1;\n      }\n      if (a[i] != a[j])\n        j++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t) {\n      cout << a[i];\n      t = 0;\n    } else\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  int x[n + 1];\n  x[0] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    cin >> a;\n    x[i] = a;\n  }\n  int j;\n  for (j = n; j > 1; j--) {\n    int k;\n    for (k = 1; k < j; k++) {\n      if (x[k] == x[j]) {\n        x[j] = 0;\n      }\n    }\n  }\n  cout << x[1];\n  for (i = 2; i <= n; i++) {\n    if (x[i] != 0) {\n      cout << \" \" << x[i];\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "13", "index": "24595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a = 0, n = 0, m = 0, i = 0, k = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  int num[n];\n  for (; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < k; i++) {\n    for (m = i + 1; m < k; m++) {\n      if (num[m] == num[i]) {\n        for (a = m; a < k; a++)\n          num[a] = num[a + 1];\n        k--;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << num[i] << \" \";\n  cout << num[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24596", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m = 0;     \n  cin >> n;               \n  int a[n];               \n  for (i = 0; i < n; i++) \n    cin >> a[i];\n  for (i = 0; i < n; i++) { \n    int t = 0;              \n    for (j = 0; j < i; j++) \n      if (a[i] == a[j]) {\n        t++; \n        break;\n      }\n    if (t == 0) { \n      if (m > 0)\n        cout << \" \"; \n      cout << a[i];  \n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i1 = 0; i1 < n; i1++)\n    cin >> a[i1];\n  int j = 0;\n  for (int i1 = 0; i1 < n; i1++) {\n    j = i1 + 1;\n    for (int i2 = i1 + 1; i2 < n; i2++) {\n      if (a[i2] != a[i1]) {\n        a[j] = a[i2];\n        j++;\n      }\n    }\n    n = j;\n  }\n  for (int i1 = 0; i1 < n; i1++) {\n    cout << a[i1];\n    if (i1 != n - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24598", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000] = {0}, i, j, b[20000] = {0}, p = 1, m = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = n; i >= 2; i--) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        m += 1;\n    }\n    if (m == 0) {\n      b[p] = a[i];\n      p++;\n    }\n    m = 0;\n  }\n  p = p - 1;\n  b[p + 1] = a[1];\n  for (i = p + 1; i >= 2; i--) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%d\\n\", b[1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m;\n  int a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      for (j = 0; j < n; j++)\n        if (a[i] == a[j]) {\n          if (i != j && a[j] != 0)\n            a[j] = 0;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k++;\n    }\n  m = k;\n  for (k = 0; k < m - 1; k++)\n    printf(\"%d \", b[k]);\n  printf(\"%d\", b[k]);\n}\n"}
{"label": "13", "index": "24600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, j, k = 0, b = 0;\n  int a[20000], c[20000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      c[k] = a[i];\n      k++;\n    } else {\n      b = b + 1;\n    }\n  }\n  for (k = 0; k < n - b - 1; k++)\n    cout << c[k] << \" \";\n  cout << c[n - b - 1];\n}\n"}
{"label": "13", "index": "24601", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20001], i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      continue;\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n  int temp[20001], k = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      temp[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << temp[i] << ' ';\n  cout << temp[k - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24602", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[100000], j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++)\n    if (a[i] == a[0]) {\n      a[i] = 0;\n    }\n  for (i = 1; i < n; i++) {\n    if (a[i] != 0) {\n      printf(\" %d\", a[i]);\n      for (j = i + 1; j < n; j++)\n        if (a[j] == a[i])\n          a[j] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, k;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] != 0 && a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    if (a[k] != 0) {\n      cout << a[k];\n      break;\n    }\n  }\n\n  for (int i = k + 1; i < n; i++) {\n    if (a[i] != 0)\n      cout << ' ' << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d\", &a[i]);\n  for (i = (n - 1); i >= 0; i--) {\n    for (k = i - 1; k >= 0; k--)\n      if ((a[i] - a[k]) == 0) {\n        a[i] = 0;\n        break;\n      }\n  }\n  if (a[0] > 9)\n    printf(\"%d\", a[0]);\n  for (i = 1; i <= (n - 1); i++) {\n    if (a[i] > 9) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24605", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000];\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  if (n > 1) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < i; j++)\n        if (a[i] == a[j])\n          a[i] = 0;\n    cout << a[0];\n    for (i = 1; i < n; i++) {\n      if (a[i] != 0)\n        cout << \" \" << a[i];\n    }\n  }\n  if (n == 1)\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "13", "index": "24606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, m;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = i + 1; j <= n - 1; j++)\n      if (a[i] == a[j]) {\n        for (m = j; m < n; m++)\n          a[m] = a[m + 1];\n        j = j - 1;\n        n = n - 1;\n      }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - 1]);\n}\n"}
{"label": "13", "index": "24607", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, l, i, j, x;\n  cin >> n;\n  l = 0;\n  int a[20000];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++) {\n    for (i = (j + 1); i < n; i++) {\n      if (a[j] == a[i])\n        a[i] = '*';\n    }\n  }\n  if (a[n - 1] != '*') {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] != '*')\n        printf(\"%d \", a[i]);\n    }\n    printf(\"%d\", a[n - 1]);\n  } else {\n    for (i = n - 1; i > 0; i--) {\n      if (a[i] == '*')\n        l = l + 1;\n      else\n        break;\n    }\n    for (j = 0; j < n - l - 1; j++) {\n      if (a[j] != '*')\n        printf(\"%d \", a[j]);\n    }\n    printf(\"%d\", a[n - l - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, f;\n\n  scanf(\"%d%d\", &n, a);\n  printf(\"%d\", *a);\n  for (i = 1; i < n; i++) {\n    f = 0;\n    scanf(\"%d\", a + i);\n    for (j = 0; j < i; j++) {\n      if (*(a + i) == *(a + j))\n        f = 1;\n    }\n    if (f == 0)\n      printf(\" %d\", *(a + i));\n    else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24609", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sign, counter;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  counter = 0;\n  for (i = 0; i < n && counter == 0; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\"%d\", a[i]);\n      counter = counter + 1;\n    }\n  }\n  for (; i < n; i++) {\n    sign = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i]) {\n        sign = sign + 1;\n      }\n    }\n    if (sign == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b = 0, m, c[91] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0, m = 0; i < n; i++) {\n    b = 0;\n    scanf(\"%d\", &a);\n    for (j = 0; j < 91; j++) {\n      if (c[j] == a)\n        b = 1;\n    }\n    if (b == 0) {\n      c[m] = a;\n      m = m + 1;\n    }\n  }\n  cout << c[0];\n  for (i = 1; i < m; i++)\n    printf(\" %d\", c[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    \n    scanf(\"%d\", &a[i]);\n    \n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        k = k + 1;\n    }\n    if (k == 0)\n      printf(\" %d\", a[i]);\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24612", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, u[20000], a[20000], b, c;\n  b = 0;\n  c = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &u[i]);\n    a[i] = 0;\n  }\n  if (n == 1) {\n    printf(\"%d\", u[0]);\n  } else {\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j <= i - 1; j++) {\n        if (u[i] == u[j]) {\n          a[i] = a[i] + 1;\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        b = b + 1;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == 0) {\n        c = c + 1;\n        if (c < b) {\n          cout << u[i] << \" \";\n        }\n        if (c == b) {\n          printf(\"%d\", u[i]);\n        }\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        b[j]++;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200000], n, m, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  i = 0;\n  while (i < n) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i] == a[j] && i > j) {\n        m = m + 1;\n      }\n    }\n    if (m == 0 && i == 0)\n      cout << a[i];\n    if (m == 0 && i != 0)\n      cout << ' ' << a[i];\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, i, a[20000], b[100];\n  memset(b, 0, sizeof(b));\n  cin >> n;\n  for (i = 0; i < n; i++) \n  {\n    cin >> a[i];\n  }\n  cout << a[0]; \n  b[a[0]] = 1;\n  for (i = 1; i < n; i++) {\n    if (b[a[i]] == 0) \n    {\n      cout << \" \" << a[i];\n      b[a[i]] = 1; \n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0;\n  int a[20001], b[20001];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= i - 1; j++) {\n      if (a[i] == a[j])\n        break;\n    }\n    if (i == j) {\n      m = m + 1;\n      b[m] = a[i];\n    }\n  }\n  for (i = 1; i <= m - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  cout << b[m] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, i, j, n;\n  int a[20000], b[20000];\n  a[20000] = '\\0';\n  b[20000] = '\\0';\n  scanf(\"%d\", &n);\n  \n  for (i = 0; i < n; i = i + 1)\n    scanf(\"%d\", &b[i]);\n  \n  a[0] = b[0];\n  m = 1;\n  t = 1;\n  for (i = 1; i < n; i = i + 1) {\n    for (j = 0; j < m; j = j + 1) {\n      if (a[j] == b[i])\n        t = 0;\n    } \n    if (t == 1) {\n      a[m] = b[i]; \n      m = m + 1;\n    } \n    t = 1;\n  } \n  \n  for (i = 0; i < m - 1; i = i + 1)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[m - 1]);\n}\n"}
{"label": "13", "index": "24618", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, n, i;\n  int f[20001] = {0};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    if (f[a] == 0) {\n      if (i == 1)\n        cout << a;\n      else {\n        cout << \" \" << a;\n      }\n      f[a] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, count = 0, p = 0, n;\n  int a[20002] = {0}, b[20002] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j])\n        b[i] = 1;\n    }\n    if (b[i] == 0)\n      count = count + 1;\n  }\n  for (i = 1; i <= n; i++) {\n    if (b[i] != 1) {\n      p = p + 1;\n      if (p != count)\n        cout << a[i] << \" \";\n      else\n        cout << a[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24620", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int number[1000000];\n  cin >> n;\n  for (int i1 = 0; i1 < n; i1++) {\n    cin >> number[i1];\n  }\n  for (int i2 = 0; i2 < n; i2++) {\n    for (int i3 = i2 + 1; i3 < n; i3++) {\n      if (number[i2] == number[i3])\n        number[i3] = 0;\n    }\n  }\n  printf(\"%d\", number[0]);\n  for (int i4 = 1; i4 < n; i4++) {\n    if (number[i4] != 0) {\n      cout << \" \" << number[i4];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c[100000], d, e;\n  e = 0;\n  scanf(\"%d\", &a);\n  for (b = 1; b <= a; b++)\n    scanf(\"%d\", &c[b]);\n  printf(\"%d\", c[1]);\n  b = 2;\n  while (b <= a) {\n    e = 0;\n    for (d = 1; d < b; d++) {\n      if (c[b] == c[d])\n        e = 1;\n      else\n        e = e;\n    }\n    if (e == 0)\n      printf(\" %d\", c[b]);\n    b = b + 1;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, p, q, m;\n  int a[20000];\n  int b[20000];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = 0;\n\n  for (j = 1; j < n; j++) {\n    b[j] = 0;\n    for (k = 0; k < j; k++) {\n      if (a[j] == a[k])\n        b[j]++;\n    }\n  }\n\n  printf(\"%d\", a[0]);\n\n  for (p = 1; p < n; p++) {\n    if (b[p] == 0)\n      printf(\" %d\", a[p]);\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000];\n  int j = 0, i = 0, n = 0, e = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> a[i];\n    b[j] = a[i];\n    j = i + 1;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = i + 1; j <= n - 1; j++) {\n      if (a[i] == b[j]) {\n        b[j] = 0;\n      }\n    }\n  }\n  cout << b[0];\n  for (j = 1; j <= n - 1; j++) {\n    if (b[j] != 0)\n      cout << \" \" << b[j];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24624", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001], x = 0, t, m;\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &n);\n  cin >> m;\n  cout << m;\n  a[m] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    if (a[t] != 1) {\n      cout << \" \" << t;\n      a[t] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24625", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, t, a[20000], b[100], c[20000];\n  cin >> n;\n  for (i = 0; i < 100; i++)\n    b[i] = 1;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  t = 0;\n  for (i = 0; i < n; i++)\n    if (b[a[i]] == 1) {\n      c[t] = a[i];\n      t++;\n      b[a[i]] = 0;\n    }\n  for (i = 0; i < t - 1; i++)\n    cout << c[i] << \" \";\n  cout << c[t - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, cal = 0, enter = 1, num = 0;\n  int a[100001] = {0}, b[100001] = {0};\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= num; j++) {\n      if (a[i] == b[j]) {\n        goto next;\n        break;\n      }\n    }\n    if (enter == 1) {\n      printf(\"%d\", a[i]);\n      enter = 0;\n    } else\n      printf(\" %d\", a[i]);\n    num++;\n    b[num] = a[i];\n  next:\n    b[0] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24627", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n\n    cin >> a[i];\n\n  cout << a[1];\n  for (i = 2; i <= n; i++) {\n    for (j = i - 1; j >= 1; j--) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == 0) {\n      cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  int *m;\n  scanf(\"%d\", &n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", m + i);\n  }\n  printf(\"%d\", *m);\n  for (i = 1; i < n; i++) {\n    l = 0;\n    for (j = 0; j < i; j++) {\n      if (*(m + i) == *(m + j)) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 0) {\n      printf(\" %d\", *(m + i));\n    }\n  }\n  free(m);\n  return 0;\n}\n"}
{"label": "13", "index": "24629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100000], b[100000], k, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        break;\n      } else if (j == i - 1)\n        cout << \" \" << a[i];\n    }\n  }\n}\n"}
{"label": "13", "index": "24630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0;\n  cin >> n;\n  int a[n];\n  scanf(\"%d \", &a[0]);\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        k++;\n    if (k == 0)\n      cout << \" \" << a[i];\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *p, *q, *head;\n  p = (int *)calloc(n, sizeof(int));\n  head = p;\n  for (p = head; p < head + n; p++) {\n    scanf(\"%d\", p);\n  }\n  p = head;\n  printf(\"%d\", *p);\n  p++;\n  for (; p < head + n; p++) {\n    for (q = head; q < p; q++) {\n      if (*q == *p) {\n        goto chongfu;\n      }\n    }\n    printf(\" %d\", *p);\n  chongfu:;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, i, j, t;\n  cin >> n;\n  for (j = 0; j < n; j++)\n    scanf(\"%d\", &a[j]);\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j++)\n\n  {\n    t = 0;\n    for (i = 0; i < j; i++) {\n      if (a[i] == a[j])\n        t = t + 1;\n      else\n        ;\n    }\n    if (t == 0)\n      printf(\" %d\", a[j]);\n    else\n      ;\n  }\n}\n"}
{"label": "13", "index": "24633", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int count[100] = {0}, num[90] = {0};\n  int i = 1, a, j = 0;\n  for (i; i <= n; i++) {\n    cin >> a;\n    if (count[a] == 0) {\n      num[j] = a;\n      j += 1;\n    }\n    count[a] = count[a] + 1;\n  }\n  i = 0;\n  for (i; i < j - 1; i++) {\n    cout << num[i] << \" \";\n  }\n  cout << num[j - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24634", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], j, temp;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d\", &temp);\n    if (i == 1) {\n      j = 0;\n      printf(\"%d\", temp);\n      a[j] = temp;\n    } else {\n      int c = 0;\n      for (int k = 0; k <= j; k++) {\n        if (a[k] == temp)\n          c++;\n      }\n      if (c == 0) {\n        printf(\" %d\", temp);\n        j++;\n        a[j] = temp;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, i, d, j;\n  int a[20001];\n  cin >> h;\n  for (i = 1; i <= h; i++)\n    scanf(\"%d\", &a[i]);\n  cout << a[1];\n  for (i = 2; i <= h; i++) {\n    d = 0;\n    for (j = 1; j < i; j++) {\n      if (a[i] == a[j]) {\n        d = 1;\n        break;\n      }\n    }\n    if (d == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24636", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, num = 0;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  for (i = n - 1; i > 0; i--) {\n    for (k = i - 1; k >= 0; k--) {\n\n      if (a[i] == a[k]) {\n        if (i == n - 1) {\n          a[i] = 0;\n          num++;\n          break;\n\n        } else {\n          for (j = i; j < n - 1; j++)\n            a[j] = a[j + 1];\n          a[j] = 0;\n          num++;\n          break;\n        }\n      }\n    }\n  }\n\n  cout << a[0];\n  for (i = 1; i < n - num; i++)\n    cout << \" \" << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, num[20000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n    if (i > 0) {\n      for (int k = 0; k < i; k++) {\n        if (num[i] == num[k])\n          num[i] = 0;\n      }\n    }\n  }\n  printf(\"%d\", num[0]);\n  for (i = 1; i < n; i++) {\n    if (num[i] > 9)\n      printf(\" %d\", num[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m;\n  int a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    if (a[i] != 0) {\n      for (j = 0; j < n; j++)\n        if (a[i] == a[j]) {\n          if (i != j && a[j] != 0)\n            a[j] = 0;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k++;\n    }\n  m = k;\n  for (k = 0; k < m - 1; k++)\n    printf(\"%d \", b[k]);\n  cout << b[k];\n}\n"}
{"label": "13", "index": "24639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int i, j, k, x;\n  scanf(\"%d\", &x);\n  for (i = 0; i < x; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < x; i++) {\n    for (j = i + 1; j < x; j++) {\n      if (a[i] == a[j]) {\n        x--;\n        for (k = j; k < x; k++)\n          a[k] = a[k + 1];\n        j--;\n      }\n    }\n  }\n  for (i = 0; i < x - 1; i++)\n    printf(\"%d \", a[i]);\n  if (i < x)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24640", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  scanf(\"%d \", &m);\n  int a[m];\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        break;\n    if (j == i) {\n      if (j == 0)\n        cout << a[i];\n      else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n; i++) {\n    t = 0;\n    if (i == 0)\n      printf(\"%d\", a[0]);\n    else {\n      for (j = 0; j < i; j++) {\n        if (a[i] == a[j])\n          t = t + 1;\n      }\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24642", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[200000], i, c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 101; i++) {\n    c[i] = 0;\n  }\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    c[a[i]]++;\n    if (c[a[i]] == 1) {\n      if (i == 0)\n        printf(\"%d\", a[0]);\n      else\n        printf(\" %d\", a[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, *b, i, j, flag = 0;\n  scanf(\"%d\\n\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] == a[j])\n        b[i] = b[i] + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (b[j] == 0)\n        flag = flag + 1;\n    }\n    if (b[i] == 0) {\n      cout << a[i];\n      if (flag > 1)\n        cout << \" \";\n    }\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, flag, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    flag = 1;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      b[k] = a[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[i] << \"\\n\";\n}\n"}
{"label": "13", "index": "24645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j]) {\n        a[i] = 0;\n        break;\n      }\n  }\n  for (k = 0; k < n; k++) {\n    if (a[k]) {\n      if (!k)\n        printf(\"%d\", a[k]);\n      else\n        printf(\" %d\", a[k]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[20000] = {0}, a[20000], i, n, j, flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n  for (i = 0; i <= n - 1; i++)\n    for (j = n - 1; j >= i + 1; j--)\n      if (a[i] == a[j])\n        b[j] = 1;\n  for (i = 0; i <= n - 1; i++)\n    if (b[i] == 0) {\n      if (flag == 0) {\n        cout << a[i];\n        flag = 1;\n        continue;\n      }\n      cout << \" \" << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000] = {0};\n  int b[20000] = {0};\n  int n, i, j, t, m;\n  scanf(\"%d \", &n);\n  for (m = 0; m <= n - 1; m++)\n    cin >> a[m];\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        b[i] = 1;\n    }\n  }\n  cout << a[0];\n  for (t = 1; t <= n - 1; t++) {\n    if (b[t] == 0) {\n      cout << \" \" << a[t];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, sum = 0;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < n - sum; i++)\n    for (j = i + 1; j < n - sum; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n - sum - 1; k++)\n          a[k] = a[k + 1];\n        sum++;\n        j--;\n      }\n    }\n  for (i = 0; i < n - sum - 1; i++)\n    cout << a[i] << \" \";\n\n  printf(\"%d\", a[n - sum - 1]);\n}\n"}
{"label": "13", "index": "24649", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000];\n  int n, i, j, s;\n  s = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    if (i == 1) {\n      printf(\"%d\", a[1]);\n    } else {\n      for (j = 1; j < i; j++) {\n        if (a[j] == a[i])\n          s = s + 1;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20001] = {0};\n  int n, i, j, k, p, num = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (j = 1; j <= n - 1; j++) {\n    for (k = j + 1; k <= n;) {\n      if (a[j] == a[k]) {\n        for (p = k; p <= n - 1; p++) {\n          a[p] = a[p + 1];\n        }\n        n--;\n      } else\n        k++;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k;\n  int flag = 0;\n  int i;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  cout << shuzu[0];\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < i; k++) {\n      if (shuzu[i] == shuzu[k]) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      cout << \" \" << shuzu[i];\n    }\n    flag = 0;\n  }\n  free(shuzu);\n  return 0;\n}\n"}
{"label": "13", "index": "24652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[20001], x = 0, t, m;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  cin >> m;\n  printf(\"%d\", m);\n  a[m] = 1;\n  for (i = 2; i <= n; i++) {\n    cin >> t;\n    if (a[t] != 1) {\n      cout << \" \" << t;\n      a[t] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    k = 0;\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        k = 1;\n    }\n    if (k == 0 && i == 0)\n      cout << a[i];\n    else if (k == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, a[20000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (j = 0; j < n; j++) {\n    for (k = j + 1; k < n; k++) {\n      if (a[j] == a[k]) {\n        for (m = k + 1; m < n; m++)\n          a[m - 1] = a[m];\n        n -= 1;\n        k -= 1;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24655", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20005], del, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    del = a[i];\n    if (a[i] >= 10) {\n      if (i == 1) {\n        printf(\"%d\", a[1]);\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint stat[115], i, n, k, first = 0;\nint main() {\n  for (i = 0; i < 110; i++)\n    stat[i] = 0;\n  for (scanf(\"%d\", &n), i = 0; i < n; i++) {\n    scanf(\"%d\", &k), stat[k]++;\n    printf(stat[k] == 1 ? \"%s%d\" : \"\", i != 0 ? \" \" : \"\", k);\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n], i;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (i = 2; i <= n; i++) {\n    int j = 1;\n    while (j < i) {\n      if (a[i - 1] == a[j - 1]) {\n        break;\n      } else {\n        j++;\n      }\n    }\n    if (j == i) {\n      printf(\" %d\", a[i - 1]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n; i++) {\n    for (int k = 0; k < i; k++) {\n      if (a[i] == a[k])\n        break;\n      if (k == i - 1)\n        cout << \" \" << a[i];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24659", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {                \n  int n, i, j, k, t;        \n  cin >> n;                 \n  int a[20000];             \n  for (i = 0; i < n; i++)   \n    cin >> a[i];            \n  cout << a[0];             \n  for (j = 1; j < n; j++) { \n    for (k = 0; k < j; k++) \n      if (a[j] == a[k])     \n        break;              \n    if (k == j)             \n      cout << \" \" << a[j];  \n  }\n  return 0; \n}\n"}
{"label": "13", "index": "24660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int a[20000], b[20000];\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  b[0] = a[0];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i] == a[j])\n        a[j] = 0;\n    }\n  }\n\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == 0)\n      ;\n    else {\n      b[j] = a[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < j - 1; i++)\n    cout << b[i] << \" \";\n  printf(\"%d\", b[j - 1]);\n}\n"}
{"label": "13", "index": "24661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int zz[20000];\n  int i, j;\n  for (i = 0; i < n; i++)\n    cin >> zz[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (zz[i] == zz[j]) {\n        zz[j] -= zz[i];\n      }\n    }\n  }\n  cout << zz[0];\n  for (i = 1; i < n; i++) {\n    if (zz[i] != 0)\n      cout << \" \" << zz[i];\n  }\n}\n"}
{"label": "13", "index": "24662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  int *m;\n  scanf(\"%d\", &n);\n  m = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", m + i);\n\n  cout << *m;\n  for (i = 1; i < n; i++) {\n    l = 0;\n    for (j = 0; j < i; j++) {\n      if (*(m + i) == *(m + j)) {\n        l = 1;\n        break;\n      }\n    }\n    if (l == 0) {\n      printf(\" %d\", *(m + i));\n    }\n  }\n  free(m);\n  return 0;\n}\n"}
{"label": "13", "index": "24663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, b[20001], i, j = 0, c[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &b[i]);\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[b[i]] == 0) {\n      j++;\n      c[j] = b[i];\n      a[b[i]] = 1;\n    }\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", c[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[30000], i, j, k, l, t = 1;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++)\n    scanf(\"%d\", &a[l]);\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n;) {\n      if (a[i] == a[j]) {\n        for (k = j; k < n - 1; k++) {\n          a[k] = a[k + 1];\n        }\n        n = n - 1;\n      }\n      if (a[i] != a[j])\n        j++;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t) {\n      printf(\"%d\", a[i]);\n      t = 0;\n    } else\n      printf(\" %d\", a[i]);\n  return 0;\n}\n"}
{"label": "13", "index": "24665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[20001], flag[20001] = {0}, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i])\n        flag[j] = 1;\n    }\n    if (flag[i] == 0 && k == 0) {\n      cout << a[i];\n      k++;\n    } else if (flag[i] == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  printf(\"%d\", a[0]);\n  for (int i = 1; i < n; i++) {\n    for (int k = 0; k < i; k++) {\n      if (a[i] == a[k])\n        break;\n      if (k == i - 1)\n        cout << \" \" << a[i];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10000], n, i, t, j, m;\n  scanf(\"%d/n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i <= n - 1; i++) {\n    m = 0;\n    for (j = 0; j <= i - 1; j++)\n      if (a[i] == a[j])\n        m = m + 1;\n    if (m == 0)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24668", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  int a[100] = {0};\n  scanf(\"%d\", &k);\n  a[k] = a[k] + 1;\n  printf(\"%d\", k);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &k);\n    a[k] = a[k] + 1;\n    if (a[k] == 1)\n      printf(\" %d\", k);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, t, s, r;\n  int a[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    cin >> a[i];\n\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= n - 1; t++) {\n    r = 0;\n    for (s = 0; s <= t - 1; s++) {\n      if (a[t] == a[s])\n        break;\n      else\n        r++;\n    }\n    if (r == t)\n      cout << \" \" << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, k = 0, t, a[20001];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 1; i < n - k; i++) {\n    for (m = 1; m <= i; m++) {\n      if (a[i] == a[i - m]) {\n        t = i;\n        for (i = t; i < n - k; i++)\n          a[i] = a[i + 1];\n        i = t - 1;\n        k++;\n      }\n    }\n  }\n  for (i = 0; i < n - k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[n - k - 1]);\n}\n"}
{"label": "13", "index": "24671", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sz[20000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (i > 0) {\n      for (int j = 0; j < i; j++) {\n        if (sz[j] == sz[i]) {\n          sz[i] = 0;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > 0) {\n      if (i == 0)\n        printf(\"%d\", sz[i]);\n      else {\n        printf(\" %d\", sz[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  int a[20000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n\n  int k, m;\n  for (k = 1; k < n; k++) {\n    for (m = 0; m < k; m++) {\n      if (a[k] != a[m])\n        continue;\n      else\n        break;\n    }\n    if (m == k && a[k] != a[k - 1])\n      cout << \" \" << a[k];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d \", &a[i - 1]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 2; j <= n; j++) {\n    for (m = 1; m <= j - 1; m++) {\n      if (a[j - 1] == a[m - 1]) {\n        break;\n      }\n    }\n    if (m == j)\n      printf(\" %d\", a[j - 1]);\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24674", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, k, l;\n  cin >> n;\n  int a[n], b[n];\n  for (i = 0; i <= n - 1; i = i + 1) {\n    cin >> b[i];\n    a[i] = 0;\n  }\n  for (i = n - 1, k = 0; i >= 1; i = i - 1) {\n    for (s = i - 1; s >= 0; s = s - 1) {\n      if (b[i] - b[s] == 0) {\n        a[i] = 1;\n        k = k + 1;\n        break;\n      }\n    }\n  }\n  if (n - k == 1)\n    cout << b[0];\n  else {\n    for (i = 0, l = 0; i <= n - 1; i = i + 1) {\n      if (a[i] == 0) {\n        l = l + 1;\n        if (l - n + k < 0) {\n          cout << b[i] << \" \";\n        } else\n          cout << b[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int a[20005], mark[100] = {0}, print = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", a + i);\n  for (i = 0; i < n; i++) {\n    if (mark[a[i]] == 1)\n      continue;\n    else {\n      if (print)\n        printf(\" \");\n      printf(\"%d\", a[i]);\n      print = 1;\n      mark[a[i]]++;\n    }\n  }\n  putchar(10);\n  return 0;\n}\n"}
{"label": "13", "index": "24676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      {\n        if (a[i] == a[j])\n          a[i] = 0;\n        else\n          a[i] = a[i];\n      }\n    }\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", b[i]);\n  cout << b[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24677", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, num[20010], m;\n  cin >> n;\n  m = n;\n  for (i = 0; i < n; i++)\n    cin >> num[i];\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = i + 1; j < n; j++) {\n      if (num[j] == num[i] && num[j] != 0) {\n        num[j] = 0;\n        m--;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (num[i] != 0) {\n      m--;\n      if (m > 0)\n        printf(\"%d \", num[i]);\n      else\n        cout << num[i] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  ;\n  int a[20001];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i < n - 1 - m; i++)\n    for (j = i + 1; j < n - m;)\n      if (a[j] == a[i]) {\n        for (k = j; k < n - m; k++)\n          a[k] = a[k + 1];\n        m++;\n      } else\n        j++;\n  for (i = 0; i < n - 1 - m; i++)\n    printf(\"%d \", a[i]);\n  cout << a[n - m - 1];\n}\n"}
{"label": "13", "index": "24679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], l = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  cout << a[0];\n  for (int j = 1; j < n; j++) {\n    l = 0;\n    for (int k = j - 1; k >= 0; k--) {\n      if (a[j] != a[k])\n        l = l;\n      else\n        l = l + 1;\n    }\n    if (l == 0)\n      cout << \" \" << a[j];\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x, a[20000] = {0}, b[20000] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (j = 1; j <= n; j++) {\n    x = 0;\n    for (i = 0; i < j; i++) {\n      if (a[j] == a[i])\n        x++;\n    }\n    if (x == 0)\n      b[j] = a[j];\n    else\n      b[j] = 0;\n  }\n  cout << b[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, *a, *b, i, j, flag = 0;\n  scanf(\"%d\\n\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", a + i);\n    b[i] = 0;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = i - 1; j >= 0; j--)\n      if (a[i] == a[j])\n        b[i] = b[i] + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i; j < n; j++) {\n      if (b[j] == 0)\n        flag = flag + 1;\n    }\n    if (b[i] == 0) {\n      printf(\"%d\", a[i]);\n      if (flag > 1)\n        cout << \" \";\n    }\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101] = {0};\n  int n, i, now, sign;\n\n  scanf(\"%d\", &n);\n  sign = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> now;\n    if (a[now] == 0) {\n      a[now] = 1;\n      if (sign == 1)\n        printf(\" \");\n      else\n        sign = 1;\n      printf(\"%d\", now);\n    }\n  }\n  printf(\" \");\n  ;\n  return 0;\n}\n"}
{"label": "13", "index": "24683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a, i, j, l, k = 1;\n  cin >> a;\n  int s[20000] = {a};\n  for (i = 1; i < n; i++) {\n    cin >> a;\n    j = 0;\n    while (s[j] != a) {\n      j++;\n      if (j == k) {\n        s[k] = a;\n        k++;\n      }\n    }\n  }\n  for (l = 0; l < k - 1; l++)\n    cout << s[l] << ' ';\n  printf(\"%d\", s[k - 1]);\n  return 0;\n}\n"}
{"label": "13", "index": "24684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k = 0, m = 1, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        k++;\n      }\n    }\n    if (k == 0) {\n      b[m] = a[i];\n      m++;\n    }\n    k = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < m; i++)\n    printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "24685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, num, j, flag, k, h = 0;\n  cin >> n >> a[0];\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &num);\n    for (j = 0; j <= i - 1; j++) {\n      if (num != a[j])\n        flag = 1;\n      else {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1) {\n      h++;\n      a[h] = num;\n    }\n  }\n  for (k = 0; k <= h - 1; k++)\n    printf(\"%d \", a[k]);\n  printf(\"%d\", a[h]);\n  return 0;\n}\n"}
{"label": "13", "index": "24686", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[10005], n, i, j, flag = 1, flag2 = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    flag = 1;\n    cin >> a[i];\n    for (j = 1; j <= i - 1; j++) {\n      if (a[j] == a[i])\n        flag = 0;\n    }\n    if (flag) {\n      if (flag2 == 0) {\n        cout << a[i];\n        flag2 = 1;\n      } else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[20000];\n  int check[100] = {0};\n  int n, i;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (check[a[i]] == 0) {\n      if (i == 0) {\n        printf(\"%d\", a[i]);\n      } else {\n        printf(\" %d\", a[i]);\n      }\n      check[a[i]] = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int num[n];\n  scanf(\"%d\", &num[0]);\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &num[i]);\n    for (j = 0; j <= i; j++) {\n      if (j < i && num[j] == num[i]) {\n        break;\n      }\n      if (j == i) {\n        cout << \" \" << num[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24689", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, number;\n  int a[100] = {0};\n\n  cin >> n;\n  i = 0;\n  for (j = 1; j <= n; j++) {\n    cin >> number;\n    if (a[number] == 0) {\n      a[number]++;\n      if (i == 0) {\n        cout << number;\n        i = 1;\n      } else {\n        printf(\" %d\", number);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24690", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, s[20000], ct = 0;\n  cin >> a;\n  for (b = 1; b <= a; b++) {\n    scanf(\"%d \", &c);\n    s[b] = c;\n    d = 0;\n    for (e = 1; e <= b - 1; e++) {\n      if (s[b] == s[e])\n        d = 1;\n    }\n    if (d == 0) {\n      if (ct == 1)\n        printf(\" \");\n      printf(\"%d\", s[b]);\n      ct = 1;\n    }\n  }\n  return 100;\n}\n"}
{"label": "13", "index": "24691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, j, b[20000] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        b[j]++;\n      }\n    }\n  }\n  cout << a[0];\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      cout << ' ' << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j;\n  scanf(\"%d \", &n);\n  int a[n];\n  int i = 0;\n  while (i < n) {\n    cin >> a[i];\n    i++;\n  }\n  cout << a[0];\n  i = 1;\n  while (i < n) {\n\n    for (j = 0; j < i; j++)\n      if (a[i] == a[j])\n        break;\n    if (((j == i) && (a[i] != a[i - 1])) == 1)\n      cout << \" \" << a[i];\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      {\n        if (a[i] == a[j])\n          a[i] = 0;\n        else\n          a[i] = a[i];\n      }\n    }\n    if (a[i] != 0) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d \", b[i]);\n  }\n  printf(\"%d\", b[k - 1]);\n}\n"}
{"label": "13", "index": "24694", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[101] = {0}, temp, num = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> temp;\n    if (a[temp] == 0) {\n      num++;\n      a[temp] = num;\n    }\n  }\n  for (int j = 1; j <= num; j++) {\n    for (int k = 10; k <= 100; k++)\n      if (a[k] == j)\n        cout << k;\n    if (j < num) {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, sum, n;\n  cin >> n;\n  int x[20000], y[20000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &y[i]);\n  x[0] = y[0];\n  int k = 0;\n  for (i = 1; i < n; i++) {\n    sum = 1;\n    for (j = 0; j <= k; j++)\n      sum = sum * (y[i] - x[j]);\n    if (sum != 0) {\n      x[k + 1] = y[i];\n      k++;\n    }\n  }\n  printf(\"%d\", x[0]);\n  for (i = 1; i <= k; i++)\n    printf(\" %d\", x[i]);\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "13", "index": "24696", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0;\n  cin >> n;\n  int a[10000];\n  cin >> a[0];\n  for (i = 1; (i + t) < n; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        i--;\n        t++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n - t - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[n - t - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24697", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], n, i, c, j, k = 0, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &c);\n    p = 1;\n    for (j = 0; j < k; j++)\n      if (a[j] == c)\n        p = 0;\n    if (p) {\n      a[k] = c;\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%d \", a[i]);\n  printf(\"%d\", a[i]);\n}\n"}
{"label": "13", "index": "24698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t = 0;\n  int a[20000];\n  cin >> n;\n  cin >> a[1];\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j < i; j++) {\n      t = 0;\n      if (a[i] == a[j]) {\n        t = 1;\n        break;\n      }\n    }\n    if (t == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  int a[20000];\n  int count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    int count = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        count++;\n    }\n    if (count == 0)\n      cout << \" \" << a[i];\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n    }\n    if (k == i)\n      printf(\" %d\", a[i]);\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k = 0;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] != a[i])\n        k++;\n    }\n    if (k == i)\n      printf(\" %d\", a[i]);\n    k = 0;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] != a[i]) {\n        k = k + 1;\n      }\n      if (a[j] == a[i]) {\n        k = 0;\n        break;\n      }\n    }\n\n    if (k != 0) {\n      printf(\" %d\", a[i]);\n      k = 0;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, t, x, a[20000], n, m, l;\n  l = 0;\n  m = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%d\", &x);\n\n    for (i = 1; i <= m + 1; i++)\n      if (x == a[i - 1])\n        l = 1;\n    if (l == 0) {\n      a[m] = x;\n      m = m + 1;\n    }\n    l = 0;\n  }\n  printf(\"%d\", a[0]);\n  for (t = 1; t <= m - 1; t++)\n    printf(\" %d\", a[t]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24704", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], t;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    cin >> a[i];\n  cout << a[0];\n  for (int i = 1; i < n; i++) {\n    t = 0;\n    for (int j = 0; j < i; j++) {\n      if (a[j] == a[i] && j != i)\n        t += 1;\n    }\n    if (t >= 1)\n      continue;\n    else {\n      if (t == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24705", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000];\n  int n, i, j, s;\n  s = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i];\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    if (i == 1) {\n      printf(\"%d\", a[1]);\n    } else {\n      for (j = 1; j < i; j++) {\n        if (a[j] == a[i])\n          s = s + 1;\n      }\n      if (s == 0)\n        printf(\" %d\", a[i]);\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "13", "index": "24706", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001];\n  int n, i, j, l, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  num = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        num++;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      j++;\n      if (j != n - num) {\n        printf(\"%d \", a[i]);\n      } else {\n        printf(\"%d\", a[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, h = 0;\n  scanf(\"%d \", &n);\n  int a[n], b[n];\n  for (i = 0; i <= (n - 1); i++)\n    cin >> a[i];\n  for (i = 0; i <= (n - 1); i++) {\n    if (a[i] != -1) {\n      for (j = i + 1; j <= (n - 1); j++) {\n        if (a[i] == a[j]) {\n          a[j] = -1;\n          k = k + 1;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= (n - 1); i++)\n    b[i] = a[i];\n  for (i = 0; i <= (n - 1); i++) {\n    if (b[i] != -1) {\n      cout << b[i];\n      h++;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = i + 1; i <= n - 1; i++) {\n    if (b[i] != -1) {\n      cout << \" \" << b[i];\n      h++;\n    }\n    if (h == n - k)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001];\n  int n, i, j, l, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  num = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] == a[i]) {\n        a[i] = 0;\n        num++;\n        break;\n      }\n    }\n  }\n  j = 0;\n  for (i = 1; i <= n; i++) {\n    if (a[i] != 0) {\n      j++;\n      if (j != n - num) {\n        cout << a[i] << \" \";\n      } else {\n        printf(\"%d\", a[i]);\n        break;\n      }\n    }\n  }\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "13", "index": "24709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000];\n  int n, k;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = i + 1; j < n; j++) {\n      if (a[j] != 0 && a[j] == a[i])\n        a[j] = 0;\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    if (a[k] != 0) {\n      printf(\"%d\", a[k]);\n      break;\n    }\n  }\n\n  for (int i = k + 1; i < n; i++) {\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int d;\n  int flag[101];\n  for (i = 0; i <= 100; i++) {\n    flag[i] = 0;\n  }\n  scanf(\"%d \", &n);\n  int couted = 0;\n  for (i = 0; i < n; i++) {\n    cin >> d;\n    if (flag[d] == 0) {\n      if (couted == 0) {\n        cout << d;\n        couted = 1;\n      } else {\n        printf(\" %d\", d);\n      }\n      flag[d] = 1;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100] = {0};\n  int b, d, e, f, g, i, j, k, l, m, n, p;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &p);\n  printf(\"%d\", p);\n  a[p]++;\n  for (i = 2; i <= n; i++) {\n    scanf(\"%d\", &p);\n    if (a[p] == 0) {\n      printf(\" %d\", p);\n      a[p]++;\n    }\n  }\n  return 7;\n}\n"}
{"label": "13", "index": "24712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t = 0;\n  scanf(\"%d \", &n);\n\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0)\n      for (j = i + 1; j < n; j++)\n        if (a[i] == a[j])\n          a[j] = -1;\n  for (i = 0; i < n; i++)\n    if (a[i] >= 0) {\n      if (i > 0)\n        cout << ' ';\n      cout << a[i];\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s[20000], y[20000];\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &s[i]);\n  }\n  k = 0;\n  for (i = n - 1; i > 0; i--) {\n    for (j = i - 1; j >= 0; j--) {\n      if (s[i] == s[j])\n        break;\n    }\n    if (j == -1) {\n      y[k] = s[i];\n      k++;\n    }\n  }\n  printf(\"%d\", s[0]);\n  for (i = k - 1; i >= 0; i--)\n    printf(\" %d\", y[i]);\n}\n"}
{"label": "13", "index": "24714", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint n, a[1000], times[200];\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; ++i)\n    cin >> a[i]; \n  int tot = 0;   \n  for (int i = 0; i < n; ++i)\n    if (!times[a[i]]) \n    {                 \n      tot++;\n      times[a[i]]++; \n      if (tot > 1)\n        cout << \" \";\n      cout << a[i];\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int m = 0;\n  int a[20001];\n  for (int i = 1; i <= n; i++)\n    cin >> a[i];\n  for (int i = 2; i <= n; i++)\n    for (int j = i - 1; j >= 1; j--) {\n      if (a[i] == a[j])\n        a[i] = 0;\n    }\n  cout << a[1];\n  for (int i = 2; i <= n; i++)\n    if (a[i] != 0)\n      cout << \" \" << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, x, a[20000] = {0}, b[20000] = {0};\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  b[0] = a[0];\n  for (j = 1; j <= n; j++) {\n    x = 0;\n    for (i = 0; i < j; i++) {\n      if (a[j] == a[i])\n        x++;\n    }\n    if (x == 0)\n      b[j] = a[j];\n    else\n      b[j] = 0;\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "13", "index": "24717", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[20001], b[101], c[101];\n  int i, n, m;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i <= 101; i++)\n    b[i] = 0;\n  m = 0;\n  for (i = 1; i <= n; i++)\n    if (b[a[i]] == 0) {\n      m = m + 1;\n      b[a[i]] = 1;\n      c[m] = a[i];\n    }\n  for (i = 1; i <= m; i++) {\n    if (i < m)\n      printf(\"%d \", c[i]);\n    else {\n      printf(\"%d\", c[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b;\n  int a[20000];\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  b = 0;\n  while (i < n) {\n    scanf(\"%d\", &a[i]);\n    i++;\n  }\n  i = 1;\n  printf(\"%d\", a[0]);\n  while (i < n) {\n    while ((j < i) && (b == 0)) {\n      if (a[j] != a[i])\n        j++;\n      else\n        b = 1;\n    }\n    if (b == 0)\n      printf(\" %d\", a[i]);\n    i++;\n    j = 0;\n    b = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24719", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  int x[n + 1];\n  x[0] = 0;\n  for (i = 1; i <= n; i++) {\n    int a;\n    scanf(\"%d \", &a);\n    x[i] = a;\n  }\n  int j;\n  for (j = n; j > 1; j--) {\n    int k;\n    for (k = 1; k < j; k++) {\n      if (x[k] == x[j]) {\n        x[j] = 0;\n      }\n    }\n  }\n  cout << x[1];\n  for (i = 2; i <= n; i++) {\n    if (x[i] != 0) {\n      cout << \" \" << x[i];\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "13", "index": "24720", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, r, t, s;\n  scanf(\"%d \", &n);\n  s = 1;\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n  b[0] = a[0];\n  for (i = 1; i < n; i++) {\n    t = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t++;\n      }\n    }\n    if (t == 0) {\n      b[s] = a[i];\n      s++;\n    }\n  }\n  for (r = 0; r < s - 1; r++) {\n    printf(\"%d \", b[r]);\n  }\n  printf(\"%d\", b[s - 1]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "13", "index": "24721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[j] == a[i]) {\n        for (k = j; k < n; k++)\n          a[k] = a[k + 1];\n\n        j--;\n        n--;\n      }\n    }\n  }\n  for (i = 0; i < n - 1; i++)\n    cout << a[i] << ' ';\n  cout << a[i];\n  return 0;\n}\n"}
{"label": "13", "index": "24722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s[20000], a[100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &s[i]);\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n  printf(\"%d\", s[0]);\n  a[s[0]] = 1;\n  for (i = 1; i < n; i++)\n    if (a[s[i]] == 0) {\n      cout << \" \" << s[i];\n      a[s[i]] = 1;\n    }\n  return 0;\n}\n"}
{"label": "13", "index": "24723", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int num[n];\n  scanf(\"%d\", &num[0]);\n  printf(\"%d\", num[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\" %d\", &num[i]);\n    for (j = 0; j <= i; j++) {\n      if (j < i && num[j] == num[i]) {\n        break;\n      }\n      if (j == i) {\n        printf(\" %d\", num[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, f = 0, c = 0, q[20001];\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++)\n    scanf(\"%d\", &q[k]);\n\n  printf(\"%d\", q[0]);\n  for (i = 1; (i < n); i++) {\n    c = 0;\n    for (j = 0; j < i; j++) {\n      if (q[j] == q[i])\n        c++;\n      else\n        c = c + 0;\n    }\n\n    if (c == 0)\n      printf(\" %d\", q[i]);\n    else\n      f++;\n  }\n}\n"}
{"label": "13", "index": "24725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, num, e[20001], i, j;\n  scanf(\"%d/n\", &n);\n  if (n == 1) {\n    scanf(\"%d\", &num);\n    printf(\"%d\", num);\n  } else {\n    for (i = 1; i <= n; ++i) {\n      scanf(\"%d\", &num);\n      e[i] = num;\n      if (i == 1) {\n        cout << e[1];\n      } else {\n        for (j = 1; j < i; j++) {\n          if (e[i] == e[j]) {\n            e[i] = 0;\n            break;\n          }\n        }\n        if (e[i] != 0) {\n          printf(\" %d\", e[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int *p;\n  scanf(\"%d\", &n);\n  p = (int *)malloc(sizeof(int) * n);\n  scanf(\"%d\", &p[0]);\n  printf(\"%d\", p[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &p[i]);\n    for (j = 0; j < i; j++) {\n      if (p[i] == p[j])\n        flag = 1;\n    }\n    if (flag == 0)\n      printf(\" %d\", p[i]);\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k;\n  scanf(\"%d\\n\", &n);\n  int a[n], b[n];\n  k = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i]);\n  }\n  for (i = n - 1; i > 0; i--) {\n    m = 0;\n    for (j = i - 1; j >= 0; j--) {\n      if (a[i] != a[j])\n        m = m + 1;\n    }\n    if (m == i) {\n      b[k] = a[i];\n      k = k + 1;\n    }\n  }\n  b[k] = a[0];\n  for (i = k; i > 0; i--)\n    printf(\"%d \", b[i]);\n  printf(\"%d\", b[0]);\n}\n"}
{"label": "13", "index": "24728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[20000];\n  int i, j;\n  int t;\n  int l = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  if (n == 1) {\n    printf(\"%d\", a[0]);\n    return 0;\n  }\n  printf(\"%d\", a[0]);\n  t = n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        t = t - 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j]) {\n        break;\n      } else if (j == i - 1 && l < t) {\n\n        printf(\" %d\", a[i]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24729", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, js, cunzai;\n  scanf(\"%d\", &n);\n  int *a = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n\n  printf(\"%d\", a[0]);\n\n  for (i = 1; i < n; i++) {\n    cunzai = 0;\n    js = 0;\n    for (j = 0; j < i; j++) {\n      if (a[i] == a[j])\n        js++;\n    }\n    if (js == 0) {\n      printf(\" %d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int jud[200], num[30000], n, i, j, sum, res[200];\n  scanf(\"%d\", &n);\n  sum = 0;\n  for (i = 1; i <= 100; i++)\n    jud[i] = 0;\n  for (i = 1; i <= n; i++) {\n    cin >> num[i];\n    if (jud[num[i]] == 0) {\n      sum++;\n      res[sum] = num[i];\n      jud[num[i]] = 1;\n    }\n  }\n  for (i = 1; i < sum; i++)\n    printf(\"%d \", res[i]);\n  cout << res[sum];\n  return 0;\n}\n"}
{"label": "13", "index": "24731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000] = {0};\n  int b[20000] = {0};\n  int n, i, j, t, m;\n  cin >> n;\n  for (m = 0; m <= n - 1; m++) {\n    cin >> a[m];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        b[i] = 1;\n    }\n  }\n  cout << a[0];\n  for (t = 1; t <= n - 1; t++) {\n    if (b[t] == 0)\n      cout << \" \" << a[t];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24732", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[101];\nint main() {\n  int q = 0, temp, n, i, flag = 0, t[200];\n  memset(a, 0, sizeof(a));\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &temp);\n    if (a[temp] == 0)\n      t[q++] = temp;\n    a[temp]++;\n  }\n  for (i = 0; i < q; i++) {\n    if (flag == 0)\n      flag = 1;\n    else\n      printf(\" \");\n    printf(\"%d\", t[i]);\n  }\n}\n"}
{"label": "13", "index": "24733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m;\n  int x[20000] = {0};\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++)\n    scanf(\"%d \", &x[i]);\n  cout << x[0];\n  for (i = 0; i <= k - 2; i++) {\n    for (j = i + 1; j <= k - 1;) {\n      if (x[i] == x[j]) {\n        for (m = j + 1; m <= k - 1; m++)\n          x[m - 1] = x[m];\n        k--;\n      } else\n        j++;\n    }\n  }\n  for (i = 1; i <= k - 1; i++)\n    printf(\" %d\", x[i]);\n}\n"}
{"label": "13", "index": "24734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[20000], i, num_cout[20000], k, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  num_cout[0] = num[0];\n  k = 1;\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < k; j++) {\n      if (num[i] == num_cout[j])\n        m++;\n    }\n    if (m == 0) {\n      num_cout[k] = num[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%d \", num_cout[i]);\n  }\n  cout << num_cout[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[20000], b[20000];\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &a[1]);\n  printf(\"%d\", a[1]);\n  for (i = 2; i <= n; ++i) {\n    scanf(\"%d\", &a[i]);\n    for (j = 1; j <= i - 1; ++j) {\n      b[i - 1] = 0;\n      b[j] = a[j] - a[i];\n      if (b[j] == 0)\n        break;\n    }\n    if (b[i - 1] != 0)\n      cout << \" \" << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24736", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m = 0;\n  cin >> n;\n  int a[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d \", &a[i]);\n  for (i = 0; i <= n - m; i++) {\n    for (j = i + 1; j <= n - m; j++) {\n      if (a[j] == a[i]) {\n        m = m + 1;\n        for (k = j; k <= n - m; k++)\n          a[k] = a[k + 1];\n        j = j - 1;\n      }\n    }\n  }\n  for (i = 0; i < n - m - 1; i++)\n    cout << a[i] << \" \";\n  cout << a[n - m - 1] << endl;\n  return 0;\n}\n"}
{"label": "13", "index": "24737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[20005], del, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i];\n  }\n  for (i = 1; i <= n; i++) {\n    del = a[i];\n    if (a[i] >= 10) {\n      if (i == 1) {\n        cout << a[1];\n      } else {\n        printf(\" %d\", a[i]);\n      }\n    }\n    for (j = i + 1; j <= n; j++) {\n      if (a[j] == a[i]) {\n        a[j] = 0;\n      }\n    }\n  }\n}\n"}
{"label": "13", "index": "24738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int b[20000];\n  scanf(\"%d%d\", &n, &b[0]);\n  printf(\"%d\", b[0]);\n  for (i = 1; i <= n - 1; i++) {\n    scanf(\"%d\", &b[i]);\n    for (j = 0; j <= i - 1; j++) {\n      if (b[i] == b[j]) {\n        b[i] = 0;\n      }\n    }\n  }\n  for (m = 1; m < n; m++) {\n    if (b[m] != 0) {\n      printf(\" %d\", b[m]);\n    }\n  }\n}\n"}
{"label": "13", "index": "24739", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz1[20000], sz2[20000], i, j, n, k;\n  cin >> n;\n  j = 1;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d \", &sz1[i]);\n  }\n  sz2[0] = sz1[0];\n  for (i = 1; i <= n - 1; i++) {\n    for (k = i - 1; k >= 0; k--) {\n      if (sz1[i] == sz2[k]) {\n        break;\n      }\n      if (k == 0) {\n        sz2[j] = sz1[i];\n        j = j + 1;\n      }\n    }\n  }\n  for (i = 0; i <= j - 1; i++) {\n    if (i == j - 1) {\n      printf(\"%d\", sz2[i]);\n    } else {\n      printf(\"%d \", sz2[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24740", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, i, j;\n  cin >> m;\n  int a[m];\n  for (i = 0; i < m; i++) {\n    cin >> a[i];\n    for (j = 0; j < i; j++)\n      if (a[j] == a[i])\n        break;\n    if (j == i) {\n      if (j == 0)\n        cout << a[i];\n      else\n        cout << \" \" << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int timer = 0;\n  int a[20001], b[20001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 2; i <= n; i++) {\n    for (j = 1; j < i; j++) {\n      if (a[j] != a[i]) {\n        timer++;\n      }\n    }\n    if (timer != i - 1) {\n      a[i] = 1;\n    }\n    timer = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (a[i] == 1) {\n      timer++;\n    } else {\n      a[i - timer] = a[i];\n    }\n  }\n  for (i = 1; i < n - timer; i++) {\n    printf(\"%d \", a[i]);\n  }\n  printf(\"%d\", a[n - timer]);\n  return 0;\n}\n"}
{"label": "13", "index": "24742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, x;\n  int a[100];\n  cin >> n;\n  for (int k = 0; k < 100; k++)\n    a[k] = 0;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d \", &x);\n    for (int j = 10; j < 100; j++) {\n\n      if (x == j)\n        a[j] = a[j] + 1;\n    }\n    if (a[x] == 1) {\n      if (i != 0)\n        printf(\" %d\", x);\n      else\n        cout << x;\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], b[20000], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] == a[i]) {\n        b[j] = 0;\n      }\n    }\n  }\n  printf(\"%d\", b[0]);\n  for (i = 1; i < n; i++)\n    if (b[i] != 0)\n      printf(\" %d\", b[i]);\n}\n"}
{"label": "13", "index": "24744", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, n, i = 0, j = 0, a[20000];\n  cin >> N;\n  while (i <= N - 1) {\n    cin >> n;\n    a[i] = n;\n    i++;\n  }\n  cout << a[0];\n  for (i = 1; i <= N - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i)\n      cout << ' ' << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[20001], p[200], x, step = -1;\n  cin >> n;\n  memset(p, 0, sizeof(p));\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    cin >> x;\n    if (p[x] == 0) {\n      step++;\n      a[step] = x;\n      p[x] = 1;\n    }\n  }\n  cout << a[0];\n  for (int j = 1; j <= step; j++)\n    cout << \" \" << a[j];\n  return 0;\n}\n"}
{"label": "13", "index": "24746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[20000], i, j, h = 0, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i = i + 1) {\n    scanf(\"%d\", &a[i]);\n  }\n  printf(\"%d\", a[0]);\n  for (j = 1; j < n; j = j + 1) {\n    for (k = 0; k < j; k = k + 1) {\n      if (a[j] == a[k]) {\n        h = 1;\n      }\n    }\n    if (h == 0) {\n      printf(\" %d\", a[j]);\n    }\n\n    else {\n      h = 0;\n    }\n  }\n}\n"}
{"label": "13", "index": "24747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, n, i = 0, j = 0, a[20000];\n  scanf(\"%d \", &N);\n  while (i <= N - 1) {\n    cin >> n;\n    a[i] = n;\n    i++;\n  }\n  cout << a[0];\n  for (i = 1; i <= N - 1; i++) {\n    for (j = 0; j < i; j++) {\n      if (a[j] == a[i])\n        break;\n    }\n    if (j == i)\n      cout << ' ' << a[i];\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24748", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, num[20000], i, num_cout[20000], k, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num[i];\n  }\n  num_cout[0] = num[0];\n  k = 1;\n  for (i = 1; i < n; i++) {\n    m = 0;\n    for (j = 0; j < k; j++) {\n      if (num[i] == num_cout[j])\n        m++;\n    }\n    if (m == 0) {\n      num_cout[k] = num[i];\n      k++;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << num_cout[i] << \" \";\n  }\n  cout << num_cout[k - 1];\n  return 0;\n}\n"}
{"label": "13", "index": "24749", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100000], b[100000] = {0};\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (b[i] == 0) {\n\n        if (i != j) {\n\n          if (a[i] == a[j]) {\n            b[j] = 1;\n          }\n        } else\n          continue;\n      }\n    }\n  }\n  printf(\"%d\", a[0]);\n  for (i = 1; i < n; i++) {\n    if (b[i] == 0) {\n      printf(\" \");\n      printf(\"%d\", a[i]);\n    } else\n      continue;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24750", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int u[20000];\n  int a, n, i, j, k, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> u[i];\n  }\n  k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (u[i] == u[j]) {\n        u[j] = 0;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (u[i] != 0) {\n      k++;\n    }\n  }\n  i = 0;\n  l = 0;\n  while (i < n) {\n    if (u[i] != 0)\n\n    {\n      if (l < k - 1) {\n        printf(\"%d \", u[i]);\n        l++;\n      }\n\n      else {\n        printf(\"%d\", u[i]);\n      }\n    }\n    i++;\n  }\n\n  return 0;\n}\n"}
{"label": "13", "index": "24751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int *shuzu = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &shuzu[i]);\n  }\n  printf(\"%d\", shuzu[0]);\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < i; j++) {\n      if (j < i - 1) {\n        if (shuzu[i] == shuzu[j]) {\n          break;\n        }\n      }\n      if (j == i - 1) {\n        if (shuzu[i] != shuzu[j]) {\n          printf(\" %d\", shuzu[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, flag[90];\n\n  cin >> n;\n  int a[n];\n  for (int i = 0; i < n; i++) {\n    cin >> a[i];\n    flag[a[i] - 10] = 1;\n  }\n  for (int j = 0; j < n; j++) {\n    if (flag[a[j] - 10]) {\n      if (j) {\n        printf(\" %d\", a[j]);\n      } else {\n        cout << a[j];\n      }\n    }\n    flag[a[j] - 10] = 0;\n  }\n  return 0;\n}\n"}
{"label": "13", "index": "24753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[105], n, i;\n  for (i = 0; i < 101; i += 1)\n    a[i] = 0;\n  scanf(\"%d\", &n);\n  scanf(\"%d\", &i);\n  a[i] = 1;\n  cout << i;\n  while (n-- > 1) {\n    scanf(\"%d\", &i);\n    if (a[i])\n      continue;\n    a[i] = 1;\n    printf(\" %d\", i);\n  }\n}\n"}
{"label": "13", "index": "24754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k;\n  int a[20000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d\", &a[i]);\n  for (i = (n - 1); i >= 0; i--) {\n    for (k = i - 1; k >= 0; k--)\n      if ((a[i] - a[k]) == 0) {\n        a[i] = 0;\n        break;\n      }\n  }\n  if (a[0] > 9)\n    printf(\"%d\", a[0]);\n  for (i = 1; i <= (n - 1); i++) {\n    if (a[i] > 9)\n      printf(\" %d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24755", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n} stu[100000], max_1, secondmax_1, thirdmax_1;\nint main() {\n  max_1.sum = secondmax_1.sum = thirdmax_1.sum = 0;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].sum = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max_1.sum)\n      max_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < max_1.sum && stu[i].sum > secondmax_1.sum)\n      secondmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == max_1.sum && stu[i].num != max_1.num) {\n      secondmax_1 = stu[i];\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < secondmax_1.sum && stu[i].sum > thirdmax_1.sum)\n      thirdmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == secondmax_1.sum && stu[i].num != max_1.num &&\n        stu[i].num != secondmax_1.num) {\n      thirdmax_1 = stu[i];\n      break;\n    }\n  }\n  printf(\"%d %d %d %d %d %d\", max_1.num, max_1.sum, secondmax_1.num,\n         secondmax_1.sum, thirdmax_1.num, thirdmax_1.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int Num;\n  int Chinese;\n  int Math;\n  int Sum;\n};\nint main() {\n  int n, i, s;\n  scanf(\"%d\", &n);\n  struct Student stu[n];\n  struct Student temp, *p = stu;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].Num, &stu[i].Chinese, &stu[i].Math);\n    stu[i].Sum = stu[i].Chinese + stu[i].Math;\n  }\n  if (n == 2) {\n    if (stu[0].Sum > stu[1].Sum)\n      temp = stu[0];\n    stu[0] = stu[1];\n    stu[1] = temp;\n    printf(\"%d %d %d\\n\", stu[0].Num, stu[0].Chinese, stu[0].Math);\n    printf(\"%d %d %d\\n\", stu[1].Num, stu[1].Chinese, stu[1].Math);\n  } else {\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        cout << stu[i].Num << \" \" << stu[i].Sum << \"\\n\";\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        cout << stu[i].Num << \" \" << stu[i].Sum << \"\\n\";\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "24757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } stu1, stu2, stu3, temp;\n  int i, n;\n  stu1.total = 0;\n  stu2.total = 0;\n  stu3.total = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.total = temp.chinese + temp.math;\n    if (temp.total > stu1.total) {\n      stu3 = stu2;\n      stu2 = stu1;\n      stu1 = temp;\n    } else if (temp.total <= stu1.total && temp.total > stu2.total) {\n      stu3 = stu2;\n      stu2 = temp;\n    } else {\n      if (temp.total <= stu2.total && temp.total > stu3.total)\n        stu3 = temp;\n    }\n  }\n  printf(\"%d %d\\n\", stu1.ID, stu1.total);\n  printf(\"%d %d\\n\", stu2.ID, stu2.total);\n  printf(\"%d %d\\n\", stu3.ID, stu3.total);\n}\n"}
{"label": "14", "index": "24758", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, i, j, x, y;\n  struct student {\n    int score, num;\n  } \n  a[100000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> x >> y;\n    a[i].score = x + y;\n  }\n  a[0] = a[1];\n  for (i = 1; i <= 3; i++) \n    for (j = i + 1; j <= n; j++)\n      if (a[i].score < a[j].score) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  cout << a[1].num << \" \" << a[1].score << endl\n       << a[2].num << \" \" << a[2].score << endl\n       << a[3].num << \" \" << a[3].score;\n}\n"}
{"label": "14", "index": "24759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int o = 0, oz, t = 0, tz, th = 0;\n  scanf(\"%d\", &n);\n  struct {\n    int h, z;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    int h0, x0, y0;\n    scanf(\"%d%d%d\", &h0, &x0, &y0);\n    s[i].h = h0;\n    s[i].z = x0 + y0;\n  }\n  for (i = 0; i < n; i++)\n    if (s[i].z > o)\n      o = s[i].z;\n  for (i = 0; i < n; i++)\n    if (s[i].z == o) {\n      oz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z > t))\n      t = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z == t)) {\n      tz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z > th))\n      th = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z == th)) {\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "24760", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nlong n;\n\nint main() {\n  struct student *creat();\n  struct student *head, *p, *q1, *q2, *q3;\n  int a;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a) {\n      a = p->sum;\n      q1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1) {\n      a = p->sum;\n      q2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1 && p != q2) {\n      a = p->sum;\n      q3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", q1->num, q1->sum);\n  printf(\"%d %d \", q2->num, q2->sum);\n  printf(\"%d %d \", q3->num, q3->sum);\n}\n\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  int i;\n  head = NULL;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%ld%d%d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n"}
{"label": "14", "index": "24761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int a;\n  int b;\n  int zong;\n};\nstruct student ren[100000];\n\nint main() {\n  int n, i, fen, flag = 0, j;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].id);\n    scanf(\"%d\", &ren[i].a);\n    scanf(\"%d\", &ren[i].b);\n    ren[i].zong = ren[i].a + ren[i].b;\n  }\n\n  for (fen = 200; fen >= 100; fen--) {\n    for (i = 0; i <= n - 1; i++)\n      if (fen == ren[i].zong) {\n        printf(\"%d %d\\n\", ren[i].id, ren[i].zong);\n        flag = flag + 1;\n        if (flag == 3)\n          goto end;\n      }\n  }\nend:\n  getchar();\n}\n"}
{"label": "14", "index": "24762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num;\n    int chi;\n    int math;\n  } stu[100000];\n\n  int n, i, j, mid;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (stu[j].math + stu[j].chi > stu[j - 1].chi + stu[j - 1].math) {\n        mid = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = mid;\n\n        mid = stu[j].chi;\n        stu[j].chi = stu[j - 1].chi;\n        stu[j - 1].chi = mid;\n\n        mid = stu[j].math;\n        stu[j].math = stu[j - 1].math;\n        stu[j - 1].math = mid;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math + stu[i].chi);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, i;\n  cin >> N;\n  int Max1 = 0, Max2 = 0, Max3 = 0, Nb[4];\n  struct student {\n    int Number;\n    int Chinese;\n    int Math;\n    int Total;\n  } people[111111];\n  for (i = 1; i <= N; i++) {\n    cin >> people[i].Number >> people[i].Chinese >> people[i].Math;\n    people[i].Total = people[i].Chinese + people[i].Math;\n  }\n  for (i = 1; i <= N; i++) {\n    if (Max1 < people[i].Total) {\n      Nb[1] = i;\n      Max1 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max2 < people[i].Total) && (i != Nb[1])) {\n      Nb[2] = i;\n      Max2 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max3 < people[i].Total) && (i != Nb[1]) && (i != Nb[2])) {\n      Nb[3] = i;\n      Max3 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << people[Nb[i]].Number << \" \" << people[Nb[i]].Total;\n    if (i < 3) {\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int idnum, yunum, shunum;\n  } stu[100000];\n  int n, i, max = 0, ndmax = 0, rdmax = 0, l = 0;\n  scanf(\"%d\", &n);\n  int chengji[100000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].idnum, &stu[i].yunum, &stu[i].shunum);\n    chengji[i] = chengji[i] + stu[i].yunum;\n    chengji[i] = chengji[i] + stu[i].shunum;\n  }\n  for (i = 0; i < n; i++) {\n    if (chengji[i] > max)\n      max = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (max == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < max) && (chengji[i] > ndmax))\n      ndmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (ndmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, ndmax);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < ndmax) && (chengji[i] > rdmax))\n      rdmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (rdmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, rdmax);\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } score[100000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &score[i].num, &score[i].chi, &score[i].math);\n    score[i].sum = score[i].chi + score[i].math;\n  }\n  for (i = 0; i < 4; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (score[j].sum > score[k].sum)\n        k = j;\n    temp = score[k];\n    score[k] = score[i];\n    score[i] = temp;\n  }\n  cout << score[0].num << \" \" << score[0].sum;\n  printf(\"\\n\");\n  printf(\"%d %d\", score[1].num, score[1].sum);\n  printf(\"\\n\");\n  printf(\"%d %d\", score[2].num, score[2].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int id;\n    int chinese;\n    int math;\n    int total;\n  };\n  long int n;\n  int temp;\n  int max = 0, max_1 = 0, max_2 = 0;\n  struct student *p, *p_ori, *p_end, *q;\n  struct student *p_max, *p_max_1, *p_max_2;\n  scanf(\"%ld\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  p_ori = p;\n  p_end = p + n;\n  for (; p < p_end; p++) {\n    scanf(\"%d\", &(p->id));\n    cin >> (p->chinese);\n    scanf(\"%d\", &(p->math));\n    p->total = p->chinese + p->math;\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max) {\n      max = p->total;\n      p_max = p;\n    }\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_1 && p != p_max) {\n      max_1 = p->total;\n      p_max_1 = p;\n    }\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_2 && p != p_max && p != p_max_1) {\n      max_2 = p->total;\n      p_max_2 = p;\n    }\n  }\n  printf(\"%d %d\\n\", p_max->id, p_max->total);\n  printf(\"%d %d\\n\", p_max_1->id, p_max_1->total);\n  printf(\"%d %d\\n\", p_max_2->id, p_max_2->total);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "24767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j, max;\n  struct student t, *s;\n  scanf(\"%d\", &n);\n  s = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chi, &s[i].math);\n    s[i].sum = s[i].chi + s[i].math;\n  }\n\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  cout << s[j].num << \" \" << s[j].sum << \"\\n\";\n  s[j].sum = 0;\n}\n"}
{"label": "14", "index": "24768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, k;\n  struct stu {\n    int num;\n    int chinese;\n    int maths;\n    int all;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  for (i = 0; i < n; i++)\n    stu[i].all = stu[i].chinese + stu[i].maths;\n\n  for (k = 0; k < 3; k++) {\n    max = stu[0].all;\n    for (i = 0; i < n; i++) {\n      if (stu[i].all > max) {\n        max = stu[i].all;\n        j = i;\n      }\n    }\n\n    printf(\"%d %d\\n\", stu[j].num, stu[j].all);\n    stu[j].all = 0;\n  }\n}\n"}
{"label": "14", "index": "24769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n};\nint main() {\n  int n, i, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  struct student a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].yw, &a[i].sx);\n    b[i] = a[i].yw + a[i].sx;\n  }\n  for (i = 1; i < n; i++) {\n    if (b[x] < b[i])\n      x = i;\n  }\n  printf(\"%d %d\\n\", a[x].num, b[x]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (b[y] < b[i])\n      y = i;\n  }\n  printf(\"%d %d\\n\", a[y].num, b[y]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (i == y)\n      continue;\n    if (b[z] < b[i])\n      z = i;\n  }\n  printf(\"%d %d\\n\", a[z].num, b[z]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "24770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int n;\n  int a;\n  int b;\n  int aver;\n} stu[100000];\nint main() {\n  int m, i, j, f, t;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    cin >> stu[i].n >> stu[i].a >> stu[i].b;\n  }\n  for (i = 0; i < m; i++) {\n    stu[i].aver = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = m - 1 - i; j >= 0; j--) {\n      if (stu[j].aver < stu[j + 1].aver) {\n        f = stu[j].aver;\n        stu[j].aver = stu[j + 1].aver;\n        stu[j + 1].aver = f;\n        t = stu[j].n;\n        stu[j].n = stu[j + 1].n;\n        stu[j + 1].n = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].n, stu[i].aver);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int Num;\n  int Chinese;\n  int Math;\n  int Sum;\n};\nint main() {\n  int n, i, s;\n  scanf(\"%d\", &n);\n  struct Student stu[n];\n  struct Student temp, *p = stu;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].Num >> stu[i].Chinese >> stu[i].Math;\n    stu[i].Sum = stu[i].Chinese + stu[i].Math;\n  }\n  if (n == 2) {\n    if (stu[0].Sum > stu[1].Sum)\n      temp = stu[0];\n    stu[0] = stu[1];\n    stu[1] = temp;\n    printf(\"%d %d %d\\n\", stu[0].Num, stu[0].Chinese, stu[0].Math);\n    printf(\"%d %d %d\\n\", stu[1].Num, stu[1].Chinese, stu[1].Math);\n  } else {\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int maths;\n} stu[100000];\n\nint main() {\n  int i, j, n, sum[100000], max = 0, m;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].maths;\n\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].maths;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        m = i;\n      }\n    }\n    cout << stu[m].num << \" \" << sum[m] << \"\\n\";\n    sum[m] = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "24773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, *x, *y, *s, *z, i, j, o = 0, t = 0;\n  scanf(\"%d\", &n);\n  x = (int *)malloc(sizeof(int) * n);\n  y = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  z = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y[i], &s[i]);\n    z[i] = y[i] + s[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (z[i] >= z[i + 1]) {\n        o = z[i];\n        z[i] = z[i + 1];\n        z[i + 1] = o;\n        t = x[i];\n        x[i] = x[i + 1];\n        x[i + 1] = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x[n - 1], z[n - 1]);\n  printf(\"%d %d\\n\", x[n - 2], z[n - 2]);\n  printf(\"%d %d\\n\", x[n - 3], z[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "24774", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yw;\n  int sx;\n  int zf;\n} s1, s2, s3, s;\nint main() {\n\n  int n, i;\n  s1.zf = s2.zf = s3.zf = -1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.yw, &s.sx);\n    s.zf = s.yw + s.sx;\n    if (s.zf > s1.zf) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.zf > s2.zf) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.zf > s3.zf) {\n      s3 = s;\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.num, s1.zf);\n  printf(\"%d %d\\n\", s2.num, s2.zf);\n  printf(\"%d %d\", s3.num, s3.zf);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24775", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int x, y;\n  int s;\n} d[100001], t;\n\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> d[i].id >> d[i].x >> d[i].y;\n\n    d[i].s = d[i].x + d[i].y;\n  }\n\n  for (int i = 1; i <= 3; i++)\n    for (int j = 1; j <= n - i; j++)\n      if (d[j].s >= d[j + 1].s) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n\n  for (int i = n; i >= n - 2; i--)\n    cout << d[i].id << ' ' << d[i].s << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n};\nint main() {\n  int n, i, j;\n  struct student stu[4], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++)\n    stu[i].total = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].yuwen, &stu[3].math);\n    stu[3].total = stu[3].yuwen + stu[3].math;\n    temp = stu[3];\n    for (j = 2; j >= 0; j--)\n      if (temp.total > stu[j].total) {\n        stu[j + 1] = stu[j];\n        stu[j] = temp;\n      } else {\n        stu[j + 1] = temp;\n        break;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "24777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000][3], i, j, n, b[100000][2], t, m, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 3; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    b[i][0] = a[i][0];\n    b[i][1] = a[i][1] + a[i][2];\n  }\n  for (i = 0; i < 3; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (b[i][1] < b[k][1]) {\n        t = b[k][1];\n        b[k][1] = b[i][1];\n        b[i][1] = t;\n        m = b[k][0];\n        b[k][0] = b[i][0];\n        b[i][0] = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", b[i][0], b[i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "24778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } score[100000];\n  for (int i = 0; i < n; i++) {\n    cin >> score[i].ID >> score[i].chinese >> score[i].math;\n    score[i].total = score[i].chinese + score[i].math;\n  }\n  for (int i = 0; i < 3; i++)\n    for (int j = n - 1; j > 0; j--)\n      if (score[j].total > score[j - 1].total) {\n        struct student temp = score[j];\n        score[j] = score[j - 1];\n        score[j - 1] = temp;\n      }\n  if (n == 2)\n    for (int i = 0; i < n; i++)\n      cout << score[i].ID << score[i].total << endl;\n  else {\n    for (int i = 0; i < 3; i++)\n      cout << score[i].ID << ' ' << score[i].total << endl;\n  }\n}\n"}
{"label": "14", "index": "24779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, i, n, m = 0, j = 0, k = 0, s, l1, l2, l3;\n  int a[100000], b[100000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x, &(a[i]), &(b[i]));\n    s = a[i] + b[i];\n    if (s > m) {\n\n      j = m;\n      m = s;\n      l2 = l1;\n      l1 = i;\n    } else if (s > j) {\n      k = j;\n      j = s;\n      l3 = l2;\n      l2 = i;\n    } else if (s > k) {\n      k = s;\n      l3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", l1, m);\n  printf(\"%d %d\\n\", l2, j);\n  printf(\"%d %d\\n\", l3, k);\n  return 0;\n}\n"}
{"label": "14", "index": "24780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct st {\n    int num;\n    int x;\n    int y;\n    int sum;\n  } a[100000], m1, m2, m3;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].x, &a[i].y);\n    a[i].sum = a[i].x + a[i].y;\n  }\n  m1.sum = 0;\n  m2.sum = 0;\n  m3.sum = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].sum > m1.sum)\n      m1 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m2.sum) && (a[i].sum <= m1.sum) && (a[i].num != m1.num))\n      m2 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m3.sum) && (a[i].sum <= m2.sum) && (a[i].num != m2.num) &&\n        (a[i].num != m1.num))\n      m3 = a[i];\n  cout << m1.num << \" \" << m1.sum << \"\\n\"\n       << m2.num << \" \" << m2.sum << \"\\n\"\n       << m3.num << \" \" << m3.sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int tol;\n  struct student *next;\n};\n\nint main() {\n\n  struct student *p1, *p2, *head;\n  struct student *p, *a, *b, *c;\n  struct student temp;\n\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->chi >> p1->mat;\n    p1->tol = p1->chi + p1->mat;\n    if (i == 0)\n      head = p2 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  p = head;\n  temp.tol = 0;\n  a = b = c = &temp;\n  while (p != NULL) {\n    if (p->tol > a->tol) {\n      c = b;\n      b = a;\n      a = p;\n    } else if (p->tol > b->tol) {\n      c = b;\n      b = p;\n    } else if (p->tol > c->tol)\n      c = p;\n    p = p->next;\n  }\n\n  printf(\"%d %d \", a->num, a->tol);\n  printf(\"%d %d \", b->num, b->tol);\n  printf(\"%d %d \", c->num, c->tol);\n}\n"}
{"label": "14", "index": "24782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct Stu {\n    int num;\n    int sco[2];\n    int sum;\n  };\n  struct Stu stu[5];\n  struct Stu temp;\n  int i, j, n, m, k;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].num, &stu[i].sco[0], &stu[i].sco[1]);\n      stu[i].sum = stu[i].sco[0] + stu[i].sco[1];\n    }\n    for (k = 1; k <= n - 3; k++) {\n      scanf(\"%d%d%d\", &stu[3].num, &stu[3].sco[0], &stu[3].sco[1]);\n      stu[3].sum = stu[3].sco[0] + stu[3].sco[1];\n      m = 0;\n      for (j = 1; j <= 2; j++) {\n        if (stu[m].sum > stu[j].sum ||\n            (stu[m].sum == stu[j].sum && stu[m].num < stu[j].num))\n          m = j;\n      }\n      if (stu[3].sum > stu[m].sum)\n        stu[m] = stu[3];\n    }\n  }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].num > stu[j].num) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].sum < stu[j].sum) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i;\n  long n;\n  int sum[100000];\n  int max = 0, second = 0, third = 0;\n  int a = 0, b = 0, c = 0;\n  scanf(\"%d\", &n);\n  struct student {\n    int id;\n    int chi;\n    int math;\n  };\n  struct student wangchong[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &wangchong[i].id, &wangchong[i].chi, &wangchong[i].math);\n    sum[i] = wangchong[i].chi + wangchong[i].math;\n    if (sum[i] > third) {\n      if (sum[i] <= second) {\n        third = sum[i];\n        c = i + 1;\n      } else {\n        if (sum[i] <= max) {\n          third = second;\n          second = sum[i];\n          c = b;\n          b = i + 1;\n        } else {\n          third = second;\n          c = b;\n          second = max;\n          b = a;\n          max = sum[i];\n          a = i + 1;\n        }\n      }\n    }\n  }\n  cout << a << \" \" << max << \"\\n\"\n       << b << \" \" << second << \"\\n\"\n       << c << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].chinese);\n    scanf(\"%d\", &a[i].maths);\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "24785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int mat, chi, i, num;\n  struct stu {\n    int id;\n    int to;\n  } s[100001], temp1, temp2, max1, max2, max3;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    cin >> s[i].id >> chi >> mat;\n    s[i].to = chi + mat;\n  }\n  if (s[0].to > s[1].to && s[1].to > s[2].to) {\n    max1 = s[0];\n    max2 = s[1];\n    max3 = s[2];\n  } else if (s[2].to > s[0].to && s[0].to > s[1].to) {\n    max1 = s[2];\n    max2 = s[0];\n    max3 = s[1];\n  } else if (s[0].to > s[2].to && s[2].to > s[1].to) {\n    max1 = s[0];\n    max2 = s[2];\n    max3 = s[1];\n  } else if (s[2].to > s[1].to && s[1].to > s[0].to) {\n    max1 = s[2];\n    max2 = s[1];\n    max3 = s[0];\n  } else if (s[1].to > s[0].to && s[0].to > s[2].to) {\n    max1 = s[1];\n    max2 = s[0];\n    max3 = s[2];\n  } else {\n    max1 = s[1];\n    max2 = s[2];\n    max3 = s[0];\n  }\n  for (i = 0; i < num - 1; i++) {\n    if (s[i].to > max1.to) {\n      temp1 = max1;\n      temp2 = max2;\n      max1 = s[i];\n      max2 = temp1;\n      max3 = temp2;\n    } else if (s[i].to > max2.to && s[i].id != max1.id) {\n      temp1 = max2;\n      max2 = s[i];\n      max3 = temp1;\n    } else {\n      if (s[i].to > max3.to && s[i].id != max2.id && s[i].id != max1.id)\n        max3 = s[i];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.id, max1.to, max2.id, max2.to, max3.id,\n         max3.to);\n}\n"}
{"label": "14", "index": "24786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stud {\n  int n;\n  int chinese;\n  int math;\n  int total;\n  struct stud *next;\n};\nint tol;\nstruct stud *creat(void) {\n  struct stud *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct stud *)malloc(sizeof(struct stud));\n  head = p1;\n  for (i = 1; i < tol; i++) {\n    scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n    p1->total = (p1->math + p1->chinese);\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n  p1->total = (p1->math + p1->chinese);\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint max(struct stud *head, int max1, int max2) {\n  struct stud *p1;\n  int maxtotal = head->total, max_index;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->total > maxtotal && p1->n != max1 && p1->n != max2) {\n      maxtotal = (p1->total);\n      max_index = (p1->n);\n    }\n  }\n  if (maxtotal != max1)\n    cout << max_index << \" \" << maxtotal << \"\\n\";\n  return max_index;\n}\nint main() {\n  struct stud *head;\n  int max1, max2;\n  cin >> tol;\n  head = creat();\n  max1 = max(head, 0, 0);\n  max2 = max(head, max1, 0);\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "24787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long int num;\n  int Chinese;\n  int Maths;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student tempt;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].Chinese, &stu[i].Maths);\n    stu[i].total = stu[i].Chinese + stu[i].Maths;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  if (stu[1].total > stu[0].total) {\n    tempt = stu[0];\n    stu[0] = stu[1];\n    stu[1] = tempt;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  for (i = 3; i < n; i++) {\n    if (stu[i].total > stu[2].total) {\n      stu[2] = stu[i];\n      if (stu[2].total > stu[1].total) {\n        tempt = stu[1];\n        stu[1] = stu[2];\n        stu[2] = tempt;\n        if (stu[1].total > stu[0].total) {\n          tempt = stu[0];\n          stu[0] = stu[1];\n          stu[1] = tempt;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].total);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].total);\n  printf(\"%d %d\\n\", stu[2].num, stu[2].total);\n}\n"}
{"label": "14", "index": "24788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int math;\n} temp, stu[100050];\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].math);\n    stu[i].math = stu[i].yuwen + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].math > stu[k].math)\n        k = j;\n    temp = stu[k];\n    stu[k] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math);\n}\n"}
{"label": "14", "index": "24789", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chs;\n    int math;\n  };\n  struct student s[100000];\n  struct student s1[2] = {{0, 0, 0}, {0, 0, 0}};\n  int n, i, t, j, a[100000], k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chs, &s[i].math);\n    a[i] = s[i].chs + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == s[j].chs + s[j].math && s[j].num != s1[0].num &&\n          s[j].num != s1[1].num) {\n        printf(\"%d %d\\n\", s[j].num, s[j].chs + s[j].math);\n        s1[k] = s[j];\n        k++;\n        if (k == 3)\n          goto end;\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "14", "index": "24790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  scanf(\"%d\\n\", &n);\n  int j, b[100000] = {0}, t, s;\n  struct student {\n    int num;\n    int lang;\n    int math;\n  };\n  struct student a[100000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\\n\", &a[i].num, &a[i].lang, &a[i].math);\n  for (i = 0; i < n; i++)\n    b[i] = a[i].lang + a[i].math;\n  for (j = 0; j < 3; j++)\n    for (i = 1; i < n - j; i++) {\n      if (b[j] < b[j + i]) {\n        t = b[j];\n        b[j] = b[j + i];\n        b[j + i] = t;\n      }\n    }\n  for (j = 0; j < 3; j++)\n    for (i = 0; i < n; i++) {\n      m = a[i].lang + a[i].math;\n      if (m == b[j] && i != s) {\n        printf(\"%d %d\\n\", a[i].num, m);\n        s = i;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "24791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct student {\n    int id;\n    int yu, shu;\n  } stu[100000];\n  int i;\n  int s1 = 0, s2 = 0, s3 = 0;\n  int x1 = 0, x2 = 0, x3 = 0;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].yu, &stu[i].shu);\n\n  int s, x;\n  for (i = 0; i < n; i++) {\n    s = stu[i].yu + stu[i].shu;\n    x = stu[i].id;\n    if (s > s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s1;\n      x2 = x1;\n      s1 = s;\n      x1 = x;\n    } else if (s == s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s < s1 && s > s2) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s == s2) {\n      s3 = s;\n      x3 = x;\n    } else if (s < s2 && s > s3) {\n      s3 = s;\n      x3 = x;\n    }\n  }\n  printf(\"%d %d\\n\", x1, s1);\n  printf(\"%d %d\\n\", x2, s2);\n  printf(\"%d %d\\n\", x3, s3);\n  return 0;\n}\n"}
{"label": "14", "index": "24792", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint m;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student *creat(int n);\n  void print(struct student * head, int n);\n  struct student *head;\n  head = creat(n);\n  print(head, n);\n  print(head, n);\n  print(head, n);\n  return 0;\n}\n\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  for (; n != 0; n--) {\n    m += 1;\n    if (m == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head, int n) {\n  struct student *p, *q;\n  p = head;\n  int max = 0, index = 0;\n  for (; n != 0; n--) {\n    if (max < ((p->yuwen) + (p->shuxue))) {\n      max = ((p->yuwen) + (p->shuxue));\n      index = p->num;\n      q = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", index, max);\n  q->yuwen = 0;\n  q->shuxue = 0;\n}\n"}
{"label": "14", "index": "24793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  void max(struct stu *);\n  int n, i;\n  struct stu *p, *q, *head;\n  scanf(\"%d\\n\", &n);\n  head = (struct stu *)malloc(sizeof(struct stu));\n  p = (struct stu *)malloc(sizeof(struct stu));\n  head->next = p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chinese, &p->math);\n    p->sum = p->chinese + p->math;\n    q = (struct stu *)malloc(sizeof(struct stu));\n    p->next = q;\n    p = q;\n  }\n  p->next = NULL;\n  max(head);\n  max(head);\n  max(head);\n  return 0;\n}\n\nvoid max(struct stu *head) {\n  struct stu *p, *k, *r, *q;\n  int max = 0;\n  p = head;\n  while (p->next != NULL) {\n    r = p;\n    p = p->next;\n    if (p->sum > max)\n      max = p->sum, k = r, q = p;\n  }\n  printf(\"%d %d\\n\", q->num, q->sum);\n  k->next = q->next;\n  free(q);\n}\n"}
{"label": "14", "index": "24794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct linknode *CreateLinkList();\nvoid DisplayLinkList(struct linknode *linklist1);\nvoid qiansan(struct linknode *linklist2);\nstruct linknode {\n  int id;\n  int chinese;\n  int math;\n  int total;\n  int mark;\n  struct linknode *next;\n};\nint main() { qiansan(CreateLinkList()); }\nstruct linknode *CreateLinkList() {\n  long n, i;\n  struct linknode *head, *p;\n  scanf(\"%ld\", &n);\n  head = (struct linknode *)malloc(sizeof(struct linknode));\n  p = head;\n  if (p == NULL) {\n    printf(\"fail\");\n    exit(-1);\n  }\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &p->id, &p->chinese, &p->math);\n    p->total = p->chinese + p->math;\n    p->mark = 0;\n    if (i == n)\n      p->next = NULL;\n    else {\n      p->next = (struct linknode *)malloc(sizeof(struct linknode));\n      p = p->next;\n    }\n  }\n  return head;\n}\nvoid qiansan(struct linknode *linklist2) {\n  struct linknode *head, *p, *max;\n\n  head = linklist2;\n  p = head;\n  max = (struct linknode *)malloc(sizeof(struct linknode));\n  int j;\n  for (j = 1; j <= 3; j++) {\n    p = head;\n    max->total = 0;\n    while (p != NULL) {\n      if (p->total > max->total && p->mark == 0) {\n        max = p;\n      }\n      p = p->next;\n    }\n    max->mark = 1;\n    printf(\"%d %d\\n\", max->id, max->total);\n  }\n}\n"}
{"label": "14", "index": "24795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum[1000000];\nstruct student {\n  int id;\n  int Gra[2];\n} stu[1000000];\nint main() {\n  int n;\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].Gra[0] >> stu[i].Gra[1];\n    sum[i] = stu[i].Gra[0] + stu[i].Gra[1];\n  }\n  int max = 0, imax = 0;\n  for (int i = 0; i < 3; i++) {\n    max = 0;\n    for (int j = 0; j < n; j++)\n      if (max < sum[j]) {\n        max = sum[j];\n        imax = j;\n      }\n\n    cout << stu[imax].id << \" \" << sum[imax] << \"\\n\";\n    sum[imax] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24796", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int ID;\n    int ch, math;\n    int sum;\n  } a[100000];\n  int n, m1, m2, m3, x, y, z;\n  scanf(\"%d\", &n);\n  cin >> a[0].ID >> a[0].ch >> a[0].math;\n  m1 = a[0].ch + a[0].math;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].ch, &a[i].math);\n    a[i].sum = a[i].ch + a[i].math;\n    if (a[i].sum > m1) {\n      m1 = a[i].sum;\n      x = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[x].ID, m1);\n  a[x].ch = a[x].math = a[x].sum = 0;\n  int j;\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m2 = a[0].sum;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %d %d\", &a[j].ID, &a[j].ch, &a[j].math);\n    a[j].sum = a[j].ch + a[j].math;\n    if (a[j].sum > m2) {\n      m2 = a[j].sum;\n      y = j;\n    }\n  }\n  printf(\"%d %d\\n\", a[y].ID, m2);\n  a[y].ch = a[y].math = a[y].sum = 0;\n  int k;\n  cin >> a[0].ID >> a[0].ch >> a[0].math;\n  m3 = a[0].sum;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d %d\", &a[k].ID, &a[k].ch, &a[k].math);\n    a[k].sum = a[k].ch + a[k].math;\n    if (a[k].sum > m3) {\n      m3 = a[k].sum;\n      z = k;\n    }\n  }\n  printf(\"%d %d\\n\", a[z].ID, m3);\n  return 0;\n}\n"}
{"label": "14", "index": "24797", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x, y;\n  struct student {\n    int score, num;\n  } a[100000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> x >> y;\n    a[i].score = x + y;\n  }\n  a[0] = a[1];\n  for (i = 1; i <= 3; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i].score < a[j].score) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  cout << a[1].num << \" \" << a[1].score << endl\n       << a[2].num << \" \" << a[2].score << endl\n       << a[3].num << \" \" << a[3].score;\n  return 0;\n}\n"}
{"label": "14", "index": "24798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID, Chinese, math, sum;\n  } stu[100000], temp1, temp2, temp3;\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].ID, &stu[i].Chinese, &stu[i].math);\n    stu[i].sum = stu[i].Chinese + stu[i].math;\n  }\n  temp1 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp1.sum)\n      temp1 = stu[i];\n  cout << temp1.ID << \" \" << temp1.sum << \"\\n\";\n  if (temp1.ID == stu[0].ID)\n    temp2 = stu[1];\n  else\n    temp2 = stu[0];\n  for (i = 1; i < n - 1; i++) {\n    if (stu[i].ID == temp1.ID)\n      continue;\n    else if (stu[i].sum > temp2.sum)\n      temp2 = stu[i];\n  }\n  printf(\"%d %d\\n\", temp2.ID, temp2.sum);\n  for (i = 0; i < n; i++)\n    if (stu[i].ID == temp1.ID || stu[i].ID == temp2.ID)\n      stu[i].sum = 0;\n  temp3 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp3.sum)\n      temp3 = stu[i];\n  printf(\"%d %d\\n\", temp3.ID, temp3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} stu[100000];\n\nvoid bubble(struct student stu[], int n) {\n  int pass, i;\n  struct student temp;\n\n  for (pass = n - 1; pass >= n - 3; pass--)\n    for (i = pass; i > 0; i--)\n      if (stu[i].chinese + stu[i].math > stu[i - 1].chinese + stu[i - 1].math) {\n        temp = stu[i];\n        stu[i] = stu[i - 1];\n        stu[i - 1] = temp;\n      }\n}\n\nint main() {\n  struct student *p;\n  int i;\n  int n;\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n  bubble(stu, n);\n  for (p = stu; p < stu + 3; p++)\n    cout << p->id << \" \" << p->chinese + p->math << (p == stu + n - 1) ? '\\0'\n                                                                       : '\\n';\n  return 0;\n}\n"}
{"label": "14", "index": "24800", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int math;\n  int chi;\n  int num;\n  int sum;\n};\nint main() {\n  int i, j, k, n, t, m;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].math >> stu[i].chi;\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chi;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1, k = i; j < n; j++) {\n      if (stu[j].sum > stu[k].sum)\n        k = j;\n    }\n    t = stu[i].sum;\n    stu[i].sum = stu[k].sum;\n    stu[k].sum = t;\n    m = stu[i].num;\n    stu[i].num = stu[k].num;\n    stu[k].num = m;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "24801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i, b[100000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    scanf(\"%d\", &a[i].chinese);\n    cin >> a[i].maths;\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  cout << a[0].num << \" \" << a[0].chinese + a[0].maths << \"\\n\";\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "24802", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[99999], b[2], i, k, m, s[99999], first = 0, x, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (k = 0; k < 2; k++) {\n      cin >> b[k];\n    }\n    s[i] = b[0] + b[1];\n  }\n\n  for (m = 0; m < 3; m++) {\n    first = 0;\n    for (x = 0; x < n; x++) {\n\n      if (s[x] > first) {\n        first = s[x];\n        y = x + 1;\n      }\n    }\n    printf(\"%d %d\\n\", y, first);\n    s[y - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mark {\n  int num;\n  int ch;\n  int math;\n  int sum;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].ch, &stu[i].math);\n    stu[i].sum = stu[i].math + stu[i].ch;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].num, stu[n - 1].sum,\n         stu[n - 2].num, stu[n - 2].sum, stu[n - 3].num, stu[n - 3].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct record {\n  int stuID;\n  short YuWen;\n  short math;\n  short total;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  if ((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) {\n    printf(\"Error: memory out! (1)\\n\");\n    exit(-1);\n  }\n  newLn->n = 0;\n  newLn->head = NULL;\n  newLn->tail = NULL;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNode;\n  if ((newNode = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    cout << \"Error: memory out! (2)\\n\";\n    exit(-1);\n  }\n  newNode->m_rec = *rec;\n  newNode->next = NULL;\n  if (ln->n == 0) {\n    ln->head = newNode;\n    ln->tail = newNode;\n  } else {\n    ln->tail->next = newNode;\n    ln->tail = newNode;\n  }\n  ln->n++;\n\n  return ln;\n}\n\nint myCompare(const struct record *rec1, const struct record *rec2) {\n  return rec2->total - rec1->total;\n}\n\nstruct YyxNode *Search(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *nd = ln->head;\n  while (nd != NULL && myCompare(&nd->m_rec, rec))\n    nd = nd->next;\n\n  return nd;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNode = ln->head;\n  struct YyxNode *nextNode;\n  while (delNode != NULL) {\n    nextNode = delNode->next;\n    free(delNode);\n    delNode = nextNode;\n  }\n  ln->n = 0;\n  ln->head = NULL;\n  ln->tail = NULL;\n\n  return ln;\n}\n\nint main() {\n  struct YyxLink *mainLn;\n  struct record stu;\n  int n;\n  int i;\n  struct record *max1, *max2, *max3;\n  struct YyxNode *temp;\n  mainLn = CreateNewLink();\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu.stuID, &stu.YuWen, &stu.math);\n    stu.total = stu.YuWen + stu.math;\n    AddNode(mainLn, &stu);\n  }\n\n  max1 = max2 = max3 = &mainLn->head->m_rec;\n  temp = mainLn->head;\n  while (temp != NULL) {\n    if (max1->total < temp->m_rec.total)\n      max1 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  if (max2 == max1) {\n    temp = mainLn->head->next;\n    max2 = &temp->m_rec;\n  }\n  while (temp != NULL) {\n    if (max2->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec)\n        max2 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  while (&temp->m_rec == max1 || &temp->m_rec == max2)\n    temp = temp->next;\n  max3 = &temp->m_rec;\n  while (temp != NULL) {\n    if (max3->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec && max2 != &temp->m_rec)\n        max3 = &temp->m_rec;\n    temp = temp->next;\n  }\n\n  printf(\"%d %d\\n\", max1->stuID, max1->total);\n  printf(\"%d %d\\n\", max2->stuID, max2->total);\n  printf(\"%d %d\\n\", max3->stuID, max3->total);\n\n  free(ClearLink(mainLn));\n\n  return 0;\n}\n"}
{"label": "14", "index": "24805", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint first[3], firsti[3];\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n\n} * p1, *p2;\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  while (n--) {\n    cin >> p1->num >> p1->chinese >> p1->math;\n    if (head == NULL)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct stu *sum(struct stu *head, int n) {\n  p1 = head;\n  while (n--) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct stu *head, *f1, *f2, *f3;\n  f1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = sum(head, n);\n  p1 = head;\n  if (n == 1) {\n    printf(\"%d %d\\n\", p1->num, p1->sum);\n    return 0;\n  }\n\n  for (i = 0, f1 = head; i < n; i++, p1 = p1->next)\n    if (f1->sum < p1->sum)\n      f1 = p1;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f1) {\n      head = p1;\n      break;\n    } else if (p1 == f1) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f2 = head; i < n - 1; i++, p1 = p1->next)\n    if (f2->sum < p1->sum)\n      f2 = p1;\n  if (n == 2) {\n    printf(\"%d %d\\n\", f1->num, f1->sum);\n    printf(\"%d %d\\n\", f2->num, f2->sum);\n    return 0;\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f2) {\n      head = p1;\n      break;\n    } else if (p1 == f2) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f3 = head; i < n - 2; i++, p1 = p1->next)\n    if (f3->sum < p1->sum)\n      f3 = p1;\n  printf(\"%d %d\\n\", f1->num, f1->sum);\n  printf(\"%d %d\\n\", f2->num, f2->sum);\n  printf(\"%d %d\\n\", f3->num, f3->sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  cin >> n;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    cout << p1->id << \" \" << p1->s << \" \";\n    p1->s = -1;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int i, j, n, t, sum[100000];\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  cin >> (p1->a) >> (p1->b) >> (p1->c);\n  sum[0] = p1->b + p1->c;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    cin >> (p1->a) >> (p1->b) >> (p1->c);\n    sum[i] = p1->b + p1->c;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (sum[i] < sum[j]) {\n        t = sum[i];\n        sum[i] = sum[j];\n        sum[j] = t;\n      }\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->b + p1->c != sum[i] && p1)\n      p1 = p1->next;\n\n    if (p1) {\n      printf(\"%d %d\\n\", p1->a, sum[i]);\n      p1->b = 0;\n      p1->c = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "24808", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int Chinese;\n  int math;\n  int sum;\n} zz[100000], mx, mx1, mx2;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].ID >> zz[i].Chinese >> zz[i].math;\n    zz[i].sum = zz[i].Chinese + zz[i].math;\n  }\n  mx = zz[0];\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx.sum)\n      mx = zz[i];\n  }\n  cout << mx.ID << ' ' << mx.sum << endl;\n  mx.sum = 0;\n  mx1 = mx;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx1.sum) {\n      if (zz[i].ID == mx.ID)\n        continue;\n      mx1 = zz[i];\n    }\n  }\n  cout << mx1.ID << ' ' << mx1.sum << endl;\n  mx1.sum = 0;\n  mx2 = mx1;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx2.sum) {\n      if (zz[i].ID == mx.ID || zz[i].ID == mx1.ID)\n        continue;\n      mx2 = zz[i];\n    }\n  }\n  cout << mx2.ID << ' ' << mx2.sum << endl;\n}\n"}
{"label": "14", "index": "24809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int ch;\n  int math;\n};\nint main() {\n  struct student stu[100000];\n  int n, i, j, sum = 0, id1 = 0, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if ((stu[j].ch + stu[j].math) > sum) {\n        sum = stu[j].ch + stu[j].math;\n        id1 = stu[j].id;\n        flag = j;\n      }\n    }\n    printf(\"%d %d\\n\", id1, sum);\n    sum = 0;\n    id1 = 0;\n    stu[flag].ch = 0;\n    stu[flag].math = 0;\n    flag = 0;\n  }\n}\n"}
{"label": "14", "index": "24810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int mark1;\n    int mark2;\n    int total;\n  } student[100000], temp;\n  int n, k, m;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d%d%d\", &student[k].ID, &student[k].mark1, &student[k].mark2);\n    student[k].total = student[k].mark1 + student[k].mark2;\n  }\n  for (m = 0; m < 3; m++) {\n    for (k = n - 1; k >= m; k--) {\n      if (student[k].total > student[k - 1].total) {\n        temp = student[k - 1];\n        student[k - 1] = student[k];\n        student[k] = temp;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student[0].ID, student[0].total,\n         student[1].ID, student[1].total, student[2].ID, student[2].total);\n}\n"}
{"label": "14", "index": "24811", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int sum;\n  int c;\n};\nint main() {\n  int n, i, j, nt, ct;\n  struct student stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].sum = stu[i].a + stu[i].b;\n    stu[i].c = stu[i].sum;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        nt = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = nt;\n        ct = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = ct;\n      }\n    }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].c);\n}\n"}
{"label": "14", "index": "24812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n};\n\nint main() {\n\n  int n, i, j, t, a, b, m;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    printf(\"%d %d\\n\", stu[a].num, stu[a].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24813", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int i;\n    int x;\n    int y;\n    int m;\n    struct student *next;\n  };\n  int n, j, k;\n  struct student *head, *p1, *p2, *p0;\n  scanf(\"%d\", &n);\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->i, &p1->x, &p1->y);\n  p1->m = p1->x + p1->y;\n  p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->i, &p2->x, &p2->y);\n  p2->m = p2->x + p2->y;\n  if (p1->m > p2->m) {\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  } else {\n    p0 = p1;\n    p1 = p2;\n    p2 = p0;\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  }\n  p0 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p0->i, &p0->x, &p0->y);\n  p0->m = p0->x + p0->y;\n  while ((p0->m <= p1->m) && (p1->next != 0)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p0->m > p1->m) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n  } else {\n    p1->next = p0;\n    p0->next = 0;\n  }\n  for (j = 3; j < n; j++) {\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p0->i, &p0->x, &p0->y);\n    p0->m = p0->x + p0->y;\n    for (k = 0, p1 = head; k <= 2; k++) {\n      if (p0->m > p1->m)\n        break;\n      p1 = p1->next;\n    }\n    if (k == 3)\n      continue;\n    p1 = p2 = head;\n    while (p0->m <= p1->m) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->m > p1->m) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  for (p1 = head, j = 0; j < 3; j++) {\n    printf(\"%d %d \", p1->i, p1->m);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "24814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d\", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = max1.num;\n      max2.z = max1.z;\n      max1.num = a.num;\n      max1.z = a.z;\n    } else if (a.z > max2.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = a.num;\n      max2.z = a.z;\n    } else if (a.z > max3.z) {\n      max3.num = a.num;\n      max3.z = a.z;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "24815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a[100000][3], c[100000][3];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n  for (i = n - 2; i >= 0; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 1; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 2; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (k = 0; k < 3; k++)\n    cout << a[k][1] << \" \" << a[k][2] + a[k][3] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int score;\n  struct student *next;\n};\nint main() {\n  int n, i, max;\n  struct student *p1, *p2, *head;\n  p1 = p2 = head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n\n    p1->score = p1->yu + p1->shu;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p2 = p1 = head;\n    max = p1->score;\n    while (p1 != NULL) {\n      if (p1->score > max) {\n        max = p1->score;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << max << \"\\n\";\n    p1 = head;\n    while (p1->next != p2)\n      p1 = p1->next;\n\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "24817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int x;\n  int y;\n  int s;\n  int z;\n} a[100010], t;\n\nint main() {\n\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].x, &a[i].y, &a[i].s);\n    a[i].z = a[i].y + a[i].s;\n  }\n  for (i = 0; i <= 2; i++)\n    for (j = n - 1; j >= i; j--) {\n      if (a[j + 1].z > a[j].z) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  printf(\"%d %d\\n\", a[0].x, a[0].z);\n  printf(\"%d %d\\n\", a[1].x, a[1].z);\n  cout << a[2].x << \" \" << a[2].z << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24818", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n;\n  cin >> n;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } stu[100000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].sum = stu[i].chi + stu[i].math;\n  }\n  struct student blank;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[0].sum) {\n      blank = stu[0];\n      stu[0] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[1].sum) {\n      blank = stu[1];\n      stu[1] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (stu[i].sum > stu[2].sum) {\n      blank = stu[2];\n      stu[2] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24819", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct st {\n    int id;\n    int yu;\n    int ma;\n  };\n  int n, i;\n  struct st st1 = {0, 0, 0}, st2 = {0, 0, 0}, st3 = {0, 0, 0}, stn;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stn.id, &stn.yu, &stn.ma);\n    if (stn.yu + stn.ma > st1.yu + st1.ma) {\n      st3 = st2;\n      st2 = st1;\n      st1 = stn;\n    } else {\n      if (stn.yu + stn.ma > st2.yu + st2.ma) {\n        st3 = st2;\n        st2 = stn;\n      } else {\n        if (stn.yu + stn.ma > st3.yu + st3.ma) {\n          st3 = stn;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", st1.id, st1.yu + st1.ma, st2.id,\n         st2.yu + st2.ma, st3.id, st3.yu + st3.ma);\n  return 0;\n}\n"}
{"label": "14", "index": "24820", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  if (n == 0) {\n    head = NULL;\n    return (head);\n  } else {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->chinese >> p1->math;\n    p1->next = NULL;\n    head = p1;\n    p2 = p1;\n    for (i = 1; i < n; i++) {\n      p1 = (struct student *)malloc(1000);\n      scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    }\n    return (head);\n  }\n}\nvoid top3(struct student *head) {\n  struct student *p, *p1;\n  int max = 0;\n  p = head;\n  do {\n    p->total = (p->chinese) + (p->math);\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  max = 0;\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  top3(head);\n  return 0;\n}\n"}
{"label": "14", "index": "24821", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long id;\n  int chinese;\n  int math;\n  int score;\n  struct student *next;\n};\n\nstruct student *creat(void) {\n  int num;\n  struct student *head, *p, *q;\n  q = NULL;\n  head = (struct student *)malloc(1000);\n  p = head;\n  scanf(\"%d\", &num);\n  while (num > 0) {\n    q = p;\n    scanf(\"%ld%d%d\", &p->id, &p->chinese, &p->math);\n    p->score = p->chinese + p->math;\n    p = (struct student *)malloc(1000);\n    q->next = p;\n    num--;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i;\n  struct student *p, *head, *max[3];\n  head = creat();\n  p = head;\n  for (i = 0; i <= 2; i++) {\n    max[i] = (struct student *)malloc(1000);\n    max[i]->score = 0;\n  }\n  for (; p != NULL; p = p->next) {\n    if (p->score > max[0]->score) {\n      max[2] = max[1];\n      max[1] = max[0];\n      max[0] = p;\n    } else if (p->score > max[1]->score) {\n      max[2] = max[1];\n      max[1] = p;\n    } else if (p->score > max[2]->score) {\n      max[2] = p;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%ld %d \", max[i]->id, max[i]->score);\n  }\n}\n"}
{"label": "14", "index": "24822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  struct stu *next;\n};\n\nint main() {\n  int i = 0, n, a, b, score, first = 0, second = 0, third = 0;\n  struct stu *head, *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  head = p = (struct stu *)malloc(sizeof(struct stu));\n  while (i++ < n) {\n    scanf(\"%d %d %d\", &(*p).num, &a, &b);\n    score = a + b;\n    if (score > first) {\n      third = second;\n      second = first;\n      first = score;\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (score > second) {\n      third = second;\n      second = score;\n      p3 = p2;\n      p2 = p;\n    } else if (score > third) {\n      third = score;\n      p3 = p;\n    }\n    p = (*p).next = (struct stu *)malloc(sizeof(struct stu));\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", (*p1).num, first, (*p2).num, second,\n         (*p3).num, third);\n}\n"}
{"label": "14", "index": "24823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char id[10];\n  int ch;\n  int ma;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, max, sec, min, total[100000];\n  scanf(\"%d\", &n);\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", stu[i].id, &stu[i].ch, &stu[i].ma);\n    total[i] = stu[i].ch + stu[i].ma;\n  }\n\n  max = 0;\n\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[max])\n      max = i;\n  }\n\n  cout << stu[max].id << \" \" << total[max] << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[max]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  sec = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[sec])\n      sec = i;\n  }\n\n  printf(\"%s %d\\n\", stu[sec].id, total[sec]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[sec]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[min])\n      min = i;\n  }\n\n  printf(\"%s %d\\n\", stu[min].id, total[min]);\n  return 0;\n}\n"}
{"label": "14", "index": "24824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} work[100001];\nvoid qsort(int left, int right) {\n  if (left >= right)\n    return;\n  int pindex = left, rindex = right;\n  work[0] = work[left];\n  while (pindex < rindex) {\n    while ((pindex < rindex) && (work[rindex].sum >= work[0].sum))\n      rindex--;\n    if (pindex < rindex) {\n      work[pindex] = work[rindex];\n      pindex++;\n    }\n    while ((pindex < rindex) && (work[pindex].sum < work[0].sum))\n      pindex++;\n    if (pindex < rindex) {\n      work[rindex] = work[pindex];\n      rindex--;\n    }\n  }\n  work[pindex] = work[0];\n  qsort(left, pindex - 1);\n  qsort(pindex + 1, right);\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> work[i].num >> work[i].chinese >> work[i].math;\n    work[i].sum = work[i].chinese + work[i].math;\n  }\n  qsort(1, n);\n  for (i = 0; i <= 2; i++)\n    cout << work[n - i].num << \" \" << work[n - i].sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int eng;\n  int math;\n  int sum;\n  struct stu *next;\n} * head, *p1, *p2;\nstruct stu *order(int n) {\n  int i, j, t;\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    p2 = p1->next;\n    for (j = i + 1; j < n; j++) {\n      if (p1->sum < p2->sum) {\n        t = p1->id;\n        p1->id = p2->id;\n        p2->id = t;\n        t = p1->sum;\n        p1->sum = p2->sum;\n        p2->sum = t;\n      }\n      p2 = p2->next;\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  p1 = head = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->eng >> p1->math;\n    p1->sum = p1->eng + p1->math;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  for (i = 0; i < 3; i++) {\n    cout << p1->id << \" \" << p1->sum << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "24826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, i;\n  cin >> N;\n  int Max1 = 0, Max2 = 0, Max3 = 0, Nb[4];\n  struct student {\n    int Number;\n    int Chinese;\n    int Math;\n    int Total;\n  } people[111111];\n  for (i = 1; i <= N; i++) {\n    cin >> people[i].Number >> people[i].Chinese >> people[i].Math;\n    people[i].Total = people[i].Chinese + people[i].Math;\n  }\n  for (i = 1; i <= N; i++) {\n    if (Max1 < people[i].Total) {\n      Nb[1] = i;\n      Max1 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max2 < people[i].Total) && (i != Nb[1])) {\n      Nb[2] = i;\n      Max2 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max3 < people[i].Total) && (i != Nb[1]) && (i != Nb[2])) {\n      Nb[3] = i;\n      Max3 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\", people[Nb[i]].Number, people[Nb[i]].Total);\n    if (i < 3)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct a {\n    int h;\n    int y;\n    int s;\n  } b[100000], e;\n  int c[100000];\n  int n, i, f, j, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].h, &b[i].y, &b[i].s);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = b[i].y + b[i].s;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (c[i] > c[j]) {\n        d = c[j];\n        c[j] = c[i];\n        c[i] = d;\n        e = b[j];\n        b[j] = b[i];\n        b[i] = e;\n      }\n    }\n    f = b[j].h;\n    cout << f << \" \" << c[j] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24828", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint x[100000], y[100000], z[100000], s[100000], b[100000];\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  int i, j, t, m1, m2;\n  for (i = 1; i <= n; i++) {\n    cin >> x[i] >> y[i] >> z[i];\n    s[i] = y[i] + z[i];\n    b[i] = s[i];\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (s[i] < s[j]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[1] == b[i]) {\n      m1 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[2] == b[i] && i != m1) {\n      m2 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[3] == b[i] && i != m1 && i != m2) {\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->id >> p1->cs >> p1->ms;\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    printf(\"%d %d \", p1->id, p1->s);\n    p1->s = -1;\n  }\n}\n"}
{"label": "14", "index": "24830", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, max;\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct stu *next;\n  };\n  struct stu *p1, *p2, *head;\n  scanf(\"%d \", &n);\n  p2 = head = p1 = (struct stu *)malloc(sizeof(struct stu));\n  cin >> p1->xh >> p1->yw >> p1->sx;\n  p1->zf = p1->yw + p1->sx;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n  }\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    max = 0;\n    for (i = 0; i < n; i++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (max == p1->zf) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "24831", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } score[100000];\n  for (int i = 0; i < n; i++) {\n    cin >> score[i].ID >> score[i].chinese >> score[i].math;\n    score[i].total = score[i].chinese + score[i].math;\n  }\n  for (int i = 0; i < 3; i++)\n    for (int j = n - 1; j > 0; j--)\n      if (score[j].total > score[j - 1].total) {\n        struct student temp = score[j];\n        score[j] = score[j - 1];\n        score[j - 1] = temp;\n      }\n  if (n == 2) {\n    for (int i = 0; i < n; i++)\n      printf(\"%d%d\\n\", score[i].ID, score[i].total);\n  } else {\n    for (int i = 0; i < 3; i++)\n      cout << score[i].ID << ' ' << score[i].total << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, c, m;\n  cin >> n;\n  struct student {\n    int id;\n    int total;\n  };                         \n  struct student stu[n + 1]; \n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> c >> m;\n    stu[i].total = c + m; \n  }\n  for (i = n - 1; i > n - 4; i--)\n    for (j = n - 1; j > n - i - 1; j--) {\n      if (stu[j].total > stu[j - 1].total) {\n        stu[n] = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = stu[n];\n      }\n    } \n  for (i = 0; i < 3; i++) {\n    if (i < n)\n      cout << stu[i].id << \" \" << stu[i].total << endl; \n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct Student stu[3], t;\n  stu[0].sum = stu[1].sum = stu[2].sum = 0;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t.ID >> t.chinese >> t.maths;\n    t.sum = t.chinese + t.maths;\n\n    if (t.sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = t;\n    } else if (t.sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = t;\n    } else if (t.sum > stu[2].sum)\n      stu[2] = t;\n  }\n\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].ID << \" \" << stu[i].sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24834", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} s[1000];\n\nint main() {\n  int n, i, j, tn, tt;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chinese, &s[i].math);\n    s[i].total = s[i].math + s[i].chinese;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (s[j].total >= s[j + 1].total) {\n        tt = s[j].total;\n        tn = s[j].num;\n        s[j].total = s[j + 1].total;\n        s[j].num = s[j + 1].num;\n        s[j + 1].total = tt;\n        s[j + 1].num = tn;\n      }\n    }\n  }\n  printf(\"%d %d %d %d %d %d \", s[n - 1].num, s[n - 1].total, s[n - 2].num,\n         s[n - 2].total, s[n - 3].num, s[n - 3].total);\n  return (0);\n}\n"}
{"label": "14", "index": "24835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n\n  int total;\n};\nint main() {\n\n  int n;\n  cin >> n;\n  struct student a[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    int b, c;\n    cin >> a[i].number >> b >> c;\n    a[i].total = b + c;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j].total > a[i].total) {\n        t = a[i].total;\n        a[i].total = a[j].total;\n        a[j].total = t;\n        t = a[i].number;\n        a[i].number = a[j].number;\n        a[j].number = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].number, a[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "24836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  float num;\n  float chi, mat, total;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->num >> p1->chi >> p1->mat;\n    p1->total = p1->chi + p1->mat;\n    if (i == 0) {\n      head = p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  int n, i, j;\n  float max;\n  struct stu *head, *maxi, *p;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  for (i = 0; i < 3; i++) {\n    p = head;\n    maxi = head;\n    max = head->total;\n    for (j = 0; j < n - 1; j++) {\n      p = p->next;\n      if (p->total > max) {\n        max = p->total;\n        maxi = p;\n      }\n    }\n\n    cout << maxi->num << \" \" << maxi->total << \"\\n\";\n    maxi->total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24837", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n};\nint main() {\n  int n, i, j;\n  struct student stu[4], temp;\n  scanf(\"%d \", &n);\n  for (i = 0; i < 3; i++)\n    stu[i].total = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].yuwen, &stu[3].math);\n    stu[3].total = stu[3].yuwen + stu[3].math;\n    temp = stu[3];\n    for (j = 2; j >= 0; j--)\n      if (temp.total > stu[j].total) {\n        stu[j + 1] = stu[j];\n        stu[j] = temp;\n      } else {\n        stu[j + 1] = temp;\n        break;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "24838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, k;\n  struct stu {\n    int num;\n    int chinese;\n    int maths;\n    int all;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  for (i = 0; i < n; i++)\n    stu[i].all = stu[i].chinese + stu[i].maths;\n\n  for (k = 0; k < 3; k++) {\n    max = stu[0].all;\n    for (i = 0; i < n; i++) {\n      if (stu[i].all > max) {\n        max = stu[i].all;\n        j = i;\n      }\n    }\n\n    cout << stu[j].num << \" \" << stu[j].all << \"\\n\";\n    stu[j].all = 0;\n  }\n}\n"}
{"label": "14", "index": "24839", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n\n  struct stu {\n    int id;\n    int chn;\n    int math;\n    int total;\n  };\n  struct stu a[100001];\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].chn >> a[i].math;\n    (a[i].total) = (a[i].chn) + (a[i].math);\n  }\n\n  for (k = 1; k < 5; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((a[i].total) >= (a[i + 1].total)) {\n        a[100000].id = a[i].id;\n        a[100000].total = a[i].total;\n        a[i].id = a[i + 1].id;\n        a[i + 1].id = a[100000].id;\n        a[i].total = a[i + 1].total;\n        a[i + 1].total = a[100000].total;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", a[n - 1].id, a[n - 1].total);\n  printf(\"%d %d\\n\", a[n - 2].id, a[n - 2].total);\n  printf(\"%d %d\\n\", a[n - 3].id, a[n - 3].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  struct stu *head, *p1, *p2, *p0;\n  int n, i, ch, ma, len;\n  scanf(\"%d\", &n);\n  len = sizeof(struct stu);\n\n  p1 = p2 = (struct stu *)malloc(len);\n\n  head = p1;\n  cin >> p1->id >> ch >> ma;\n  p1->sum = ch + ma;\n  p1->next = 0;\n\n  for (i = 2; i <= n; i++) {\n    p0 = (struct stu *)malloc(len);\n    scanf(\"%d %d %d\", &p0->id, &ch, &ma);\n    p0->sum = ch + ma;\n\n    p1 = p2 = head;\n    while ((p0->sum <= p1->sum) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->sum > p1->sum) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n    if (i > 3) {\n      p1 = head->next;\n      p1 = p1->next;\n      p1->next = 0;\n    }\n  }\n  p1 = head;\n  while (p1 != 0) {\n    cout << p1->id << \" \" << p1->sum << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "24841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000][3], i, j, n, b[100000][2], t, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 3; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    b[i][0] = a[i][0];\n    b[i][1] = a[i][1] + a[i][2];\n  }\n  for (i = 0; i < 3; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (b[i][1] < b[k][1]) {\n        t = b[k][1];\n        b[k][1] = b[i][1];\n        b[i][1] = t;\n        m = b[k][0];\n        b[k][0] = b[i][0];\n        b[i][0] = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", b[i][0], b[i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "24842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int no;\n  int yuwen;\n  int shuxue;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student *p, *stu, temp;\n  scanf(\"%d\", &n);\n  stu = (struct student *)calloc(n, sizeof(struct student));\n  for (p = stu; p - stu < n; p++) {\n    scanf(\"%d%d%d\", &p->no, &p->yuwen, &p->shuxue);\n    p->total = p->yuwen + p->shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (p = stu + n - 1; p > stu + i; p--) {\n      if (p->total > (p - 1)->total) {\n        temp = *p;\n        *p = *(p - 1);\n        *(p - 1) = temp;\n      }\n    }\n    printf(\"%d %d\\n\", p->no, p->total);\n  }\n  free(stu);\n}\n"}
{"label": "14", "index": "24843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chs;\n    int math;\n  };\n  struct student s[100000];\n  struct student s1[2] = {{0, 0, 0}, {0, 0, 0}};\n  int n, i, t, j, a[100000], k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chs, &s[i].math);\n    a[i] = s[i].chs + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == s[j].chs + s[j].math && s[j].num != s1[0].num &&\n          s[j].num != s1[1].num) {\n        cout << s[j].num << \" \" << s[j].chs + s[j].math << \"\\n\";\n        s1[k] = s[j];\n        k++;\n        if (k == 3)\n          goto end;\n      }\n    }\n  }\nend:\n  return 0;\n  return 0;\n}\n"}
{"label": "14", "index": "24844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n} sdu[99999];\n\nint main() {\n  int N, i, j, s, t, m;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++)\n    scanf(\"%d%d%d\", &sdu[i].num, &sdu[i].chinese, &sdu[i].math);\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < N - j - 1; i++)\n      if ((sdu[i].chinese + sdu[i].math) >=\n          (sdu[i + 1].chinese + sdu[i + 1].math)) {\n        s = sdu[i].num;\n        t = sdu[i].chinese;\n        m = sdu[i].math;\n        sdu[i].num = sdu[i + 1].num;\n        sdu[i].chinese = sdu[i + 1].chinese;\n        sdu[i].math = sdu[i + 1].math;\n        sdu[i + 1].num = s;\n        sdu[i + 1].chinese = t;\n        sdu[i + 1].math = m;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    cout << sdu[N - 1 - i].num << \" \"\n         << sdu[N - 1 - i].chinese + sdu[N - 1 - i].math << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24845", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student s[3], p, temp;\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].yuwen, &s[i].shuxue);\n    s[i].zongfen = s[i].shuxue + s[i].yuwen;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < 2 - i; j++) {\n      if (s[j].zongfen < s[j + 1].zongfen)\n        temp = s[j], s[j] = s[j + 1], s[j + 1] = temp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    cin >> p.num >> p.yuwen >> p.shuxue;\n    p.zongfen = p.shuxue + p.yuwen;\n    if (p.zongfen > s[2].zongfen && p.zongfen <= s[1].zongfen)\n      s[2] = p;\n    else if (p.zongfen > s[1].zongfen && p.zongfen <= s[0].zongfen)\n      s[2] = s[1], s[1] = p;\n    else {\n      if (p.zongfen > s[0].zongfen)\n        s[2] = s[1], s[1] = s[0], s[0] = p;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].num, s[0].zongfen, s[1].num, s[1].zongfen,\n         s[2].num, s[2].zongfen);\n}\n"}
{"label": "14", "index": "24846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct a {\n    int h;\n    int y;\n    int s;\n  } b[100000], e;\n  int c[100000];\n  int n, i, f, j, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].h, &b[i].y, &b[i].s);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = b[i].y + b[i].s;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (c[i] > c[j]) {\n        d = c[j];\n        c[j] = c[i];\n        c[i] = d;\n        e = b[j];\n        b[j] = b[i];\n        b[i] = e;\n      }\n    }\n    f = b[j].h;\n    printf(\"%d %d\\n\", f, c[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  int sum[n];\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n    sum[i] = stu[i].chin + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int math;\n    int chinese;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].math, &a[i].chinese);\n    a[i].sum = a[i].math + a[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int num, i, j, sum[100000], t, m;\n  scanf(\"%d \", &num);\n  for (i = 1; i <= num; i++) {\n    cin >> stu[i].ID >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = num; j > 1; j--) {\n      if (sum[j] > sum[j - 1]) {\n        t = sum[j - 1];\n        m = stu[j - 1].ID;\n        sum[j - 1] = sum[j];\n        stu[j - 1].ID = stu[j].ID;\n        sum[j] = t;\n        stu[j].ID = m;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", stu[i].ID, sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int s1;\n  int s2;\n  int sum;\n};\nstruct student stu[100000];\nint main() {\n\n  int n, i, p, q, r, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].sum = stu[i].s1 + stu[i].s2;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max) {\n      max = stu[i].sum;\n      p = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (i != p) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        q = i;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if ((i != p) && (i != q)) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[p].num, stu[p].sum);\n  cout << stu[q].num << \" \" << stu[q].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[r].num, stu[r].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int score1;\n  int score2;\n  struct student *next;\n};\nstruct student *head;\nstruct student *creat(int x) {\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n  head = 0;\n  while (p1->id < x) {\n    if (p1->id == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n    if (p1->id == x) {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int n;\n  struct student *p, *q, *j, *k;\n  scanf(\"%d\", &n);\n  creat(n);\n  p = q = head;\n  do {\n    if ((p->score1 + p->score2) > (q->score1 + q->score2))\n      q = p;\n    p = p->next;\n  } while (p != 0);\n  p = j = head;\n  do {\n    if ((p->score1 + p->score2) > (j->score1 + j->score2) && p != q)\n      j = p;\n    p = p->next;\n  } while (p != 0);\n  p = k = head;\n  do {\n    if ((p->score1 + p->score2) > (k->score1 + k->score2) && p != q && p != j)\n      k = p;\n    p = p->next;\n  } while (p != 0);\n  printf(\"%d %d \", q->id, (q->score1 + q->score2));\n  printf(\"%d %d \", j->id, (j->score1 + j->score2));\n  printf(\"%d %d\", k->id, (k->score1 + k->score2));\n  return 0;\n}\n"}
{"label": "14", "index": "24852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum[99999];\nint m[99999];\nint main(int argc, char *argv[]) {\n  int n, i, b, c, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a, &b, &c);\n    sum[i] = b + c;\n    m[i] = a;\n  }\n  int j, k, t, x, l = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (sum[k] > sum[k - 1]) {\n        t = sum[k - 1];\n        sum[k - 1] = sum[k];\n        sum[k] = t;\n        x = m[k - 1];\n        m[k - 1] = m[k];\n        m[k] = x;\n      }\n    }\n    l++;\n    if (l == 3)\n      break;\n  }\n  for (i = 0; i < l; i++) {\n    cout << m[i] << \" \" << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int math;\n} temp, stu[100050];\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].math);\n    stu[i].math = stu[i].yuwen + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].math > stu[k].math)\n        k = j;\n    temp = stu[k];\n    stu[k] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math);\n}\n"}
{"label": "14", "index": "24854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int c;\n  int m;\n  int t;\n};\nint main() {\n  int n, i, j, K;\n  struct stu a[4] = {0};\n  struct stu b[4] = {0};\n  struct stu temp = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    if (i <= 2) {\n      cin >> a[i].id >> a[i].c >> a[i].m;\n      a[i].t = a[i].c + a[i].m;\n      b[i] = a[i];\n    } else {\n      scanf(\"%d%d%d\", &a[3].id, &a[3].c, &a[3].m);\n      a[3].t = a[3].c + a[3].m;\n      b[3] = a[3];\n\n      for (K = 0; K <= 3; K++) {\n        for (j = 0; j <= 3; j++) {\n          if (b[j].t < b[j + 1].t) {\n            temp = b[j];\n            b[j] = b[j + 1];\n            b[j + 1] = temp;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", b[i].id, b[i].t);\n  }\n}\n"}
{"label": "14", "index": "24855", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, max;\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct stu *next;\n  };\n  struct stu *p1, *p2, *head;\n  scanf(\"%d \", &n);\n  p2 = head = p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n  }\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    max = 0;\n    for (i = 0; i < n; i++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (max == p1->zf) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "24856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].shu + stu[i].yu;\n  }\n  int k, e;\n  for (k = 0; k < 3; k++) {\n    for (i = n - 2; i >= k; i--) {\n      if (stu[i].sum < stu[i + 1].sum) {\n        e = stu[i].sum;\n        stu[i].sum = stu[i + 1].sum;\n        stu[i + 1].sum = e;\n        e = stu[i].num;\n        stu[i].num = stu[i + 1].num;\n        stu[i + 1].num = e;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24857", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int no;\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu a, *head, *p, *tail, *q;\n  int k, i, m1, m2, m3, n1, n2, n3, temp1, temp2;\n  head = NULL;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    p = (struct stu *)malloc(1000);\n    cin >> p->no >> p->chi >> p->math;\n    p->sum = (p->chi + p->math);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n      tail->next = &a;\n    }\n  }\n  a.next = NULL;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m1 = p->no;\n  n1 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m2 = p->no;\n  n2 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m3 = p->no;\n  n3 = p->sum;\n  printf(\"%d %d %d %d %d %d \", m1, n1, m2, n2, m3, n3);\n}\n"}
{"label": "14", "index": "24858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint x[100000], y[100000], z[100000], s[100000], b[100000];\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, t, m1, m2;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x[i], &y[i], &z[i]);\n    s[i] = y[i] + z[i];\n    b[i] = s[i];\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (s[i] < s[j]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[1] == b[i]) {\n      m1 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[2] == b[i] && i != m1) {\n      m2 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[3] == b[i] && i != m1 && i != m2) {\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24859", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int x, y;\n  int s;\n} d[100001], t;\n\nint main() {\n\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> d[i].id >> d[i].x >> d[i].y;\n\n    d[i].s = d[i].x + d[i].y;\n  }\n\n  for (int i = 1; i <= 3; i++)\n    for (int j = 1; j <= n - i; j++)\n      if (d[j].s >= d[j + 1].s) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n\n  for (int i = n; i >= n - 2; i--)\n    printf(\"%d %d\\n\", d[i].id, d[i].s);\n  return 0;\n}\n"}
{"label": "14", "index": "24860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int ID;\n  int Chinese;\n  int Math;\n  int Score;\n};\nint main() {\n  int n, i, first = 0, ifirst, second = 0, isecond, third = 0, ithird;\n  scanf(\"%d\", &n);\n  struct student STUDENT_NUM[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &STUDENT_NUM[i].ID, &STUDENT_NUM[i].Chinese,\n          &STUDENT_NUM[i].Math);\n    STUDENT_NUM[i].Score = STUDENT_NUM[i].Chinese + STUDENT_NUM[i].Math;\n  }\n  for (i = 0; i < n; i++) {\n    if (first < STUDENT_NUM[i].Score) {\n      first = STUDENT_NUM[i].Score;\n      ifirst = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= first &&\n        i != ifirst) {\n      second = STUDENT_NUM[i].Score;\n      isecond = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (third < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= second &&\n        i != ifirst && i != isecond) {\n      third = STUDENT_NUM[i].Score;\n      ithird = i;\n    }\n  }\n  cout << STUDENT_NUM[ifirst].ID << \" \" << first << \" \";\n  printf(\"%d %d \", STUDENT_NUM[isecond].ID, second);\n  printf(\"%d %d \", STUDENT_NUM[ithird].ID, third);\n}\n"}
{"label": "14", "index": "24861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << form[i].num << \" \" << form[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int chi;\n    int mat;\n  } stu[100000];\n  int n, i, max1, max2, max3, maxn1, maxn2, maxn3;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].chi);\n    scanf(\"%d\", &stu[i].mat);\n    sum[i] = stu[i].chi + stu[i].mat;\n  }\n  max1 = sum[0];\n  maxn1 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      maxn1 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn1, max1);\n  max2 = sum[0];\n  maxn2 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max2 && i != maxn1 - 1) {\n      max2 = sum[i];\n      maxn2 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn2, max2);\n  max3 = sum[0];\n  maxn3 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max3 && i != maxn1 - 1 && i != maxn2 - 1) {\n      max3 = sum[i];\n      maxn3 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "24863", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, math, chinese, std_num;\n  int first, second, third;\n  int score[3] = {-1, -1, -1};\n  scanf(\"%d\", &n);\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &std_num);\n    scanf(\"%d\", &chinese);\n    scanf(\"%d\", &math);\n    if (chinese + math > score[0]) {\n      third = second;\n      second = first;\n      score[2] = score[1];\n      score[1] = score[0];\n      first = std_num;\n      score[0] = chinese + math;\n    } else if (chinese + math > score[1]) {\n      third = second;\n      score[2] = score[1];\n      second = std_num;\n      score[1] = math + chinese;\n    } else if (chinese + math > score[2]) {\n      third = std_num;\n      score[2] = math + chinese;\n    }\n  }\n  printf(\"%d %d\\n\", first, score[0]);\n  printf(\"%d %d\\n\", second, score[1]);\n  printf(\"%d %d\\n\", third, score[2]);\n  return 0;\n}\n"}
{"label": "14", "index": "24864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score_1;\n    int score_2;\n    int sum;\n  };\n  struct student stu[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score_1, &stu[i].score_2);\n    stu[i].sum = stu[i].score_1 + stu[i].score_2;\n  }\n  for (j = 0; j <= 2; j++) {\n    for (i = n - 1; i > 0 + j; i--)\n      if (stu[i].sum > stu[i - 1].sum) {\n        t = stu[i].sum, stu[i].sum = stu[i - 1].sum, stu[i - 1].sum = t;\n        t = stu[i].num, stu[i].num = stu[i - 1].num, stu[i - 1].num = t;\n      }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n}\n"}
{"label": "14", "index": "24865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100001][5];\n  int i, j, n, k = 3, max = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n    a[i][4] = a[i][2] + a[i][3];\n  }\n  while (k--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i][4] > max)\n        max = a[i][4], t = i;\n    }\n    cout << t << \" \" << a[t][4] << \"\\n\";\n    a[t][4] = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "24866", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int id;\n  float langrade;\n  float mathgrade;\n} student[100000], s;\nint student_num;\nfloat total[100000], t;\nvoid trisort() {\n  for (int i = 0; i < 2; i++)\n    for (int j = 0; j < 2 - i; j++)\n      if (total[j] < total[j + 1]) {\n        t = total[j];\n        s = student[j];\n        total[j] = total[j + 1];\n        student[j] = student[j + 1];\n        total[j + 1] = t;\n        student[j + 1] = s;\n      }\n}\nint main() {\n  int i, j;\n  cin >> student_num;\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].id >> student[i].langrade >> student[i].mathgrade;\n    total[i] = student[i].langrade + student[i].mathgrade;\n  }\n  for (j = 3; j < student_num; j++) {\n    trisort();\n    if (total[j] > total[2]) {\n      t = total[2];\n      s = student[2];\n      total[2] = total[j];\n      student[2] = student[j];\n      total[j] = t;\n      student[j] = s;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[i].id << \" \" << total[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int ch;\n  int math;\n  int total;\n  struct student *next;\n};\nint n;\nint t;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  p1->total = p1->ch + p1->math;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    p1->total = p1->ch + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int max;\n  p = head;\n  max = p->total;\n  p = p->next;\n  while (p->next != NULL) {\n    if (p->total > max) {\n      max = p->total;\n      t = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", t, max);\n}\n\nstruct student *del(struct student *head, int a) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (a != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head) {\n    head = p1->next;\n  } else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head1, *head2, *head3;\n  head1 = creat();\n  print(head1);\n  head2 = del(head1, t);\n  print(head2);\n  head3 = del(head2, t);\n  print(head3);\n}\n"}
{"label": "14", "index": "24868", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  float chinese;\n  float math;\n  float sum;\n};\nint main() {\n  int n, i;\n  struct student *pt, *p, temp;\n  scanf(\"%d\", &n);\n  pt = (struct student *)malloc(n * 1000);\n  for (p = pt; p < pt + n; p++) {\n    cin >> p->num >> p->chinese >> p->math;\n    p->sum = p->chinese + p->math;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (p = pt; p < pt + n - 1 - i; p++) {\n      if (p->sum >= (p + 1)->sum) {\n        temp = *p;\n        *p = *(p + 1);\n        *(p + 1) = temp;\n      }\n    }\n  }\n  for (p = pt + n - 1; p > pt + n - 4; p--)\n    printf(\"%d %g \", p->num, p->sum);\n}\n"}
{"label": "14", "index": "24869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chs;\n    int math;\n  };\n  struct student s[100000];\n  struct student s1[2] = {{0, 0, 0}, {0, 0, 0}};\n  int n, i, t, j, a[100000], k = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chs, &s[i].math);\n    a[i] = s[i].chs + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == s[j].chs + s[j].math && s[j].num != s1[0].num &&\n          s[j].num != s1[1].num) {\n        printf(\"%d %d\\n\", s[j].num, s[j].chs + s[j].math);\n        s1[k] = s[j];\n        k++;\n        if (k == 3) {\n          goto end;\n        }\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "14", "index": "24870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  cin >> n;\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "24871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  long num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  long i, n, j, k;\n  int t;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++)\n      if (stu[j].sum > stu[j + 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j + 1].sum;\n        stu[j + 1].sum = t;\n      }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    if (k != n - 1 && stu[k].sum == stu[k + 1].sum) {\n      continue;\n    }\n    for (i = 0; i < n; i++) {\n      if (stu[k].sum == (stu[i].yu + stu[i].shu)) {\n        cout << stu[i].num << \" \" << stu[k].sum << \"\\n\";\n        if (k == n - 3)\n          break;\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "24872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum[1000000];\nstruct student {\n  int id;\n  int Gra[2];\n} stu[1000000];\nint main() {\n  int n;\n\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].Gra[0] >> stu[i].Gra[1];\n    sum[i] = stu[i].Gra[0] + stu[i].Gra[1];\n  }\n  int max = 0, imax = 0;\n  for (int i = 0; i < 3; i++) {\n    max = 0;\n    for (int j = 0; j < n; j++)\n      if (max < sum[j]) {\n        max = sum[j];\n        imax = j;\n      }\n\n    cout << stu[imax].id << \" \" << sum[imax] << endl;\n    sum[imax] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\n\nint main() {\n  int n, i, sum[100000], max = 0, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    sum[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j) {\n      max = sum[i];\n      k = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j && i != k) {\n      max = sum[i];\n      l = i;\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[j].num, sum[j], stu[k].num, sum[k],\n         stu[l].num, sum[l]);\n}\n"}
{"label": "14", "index": "24874", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n  struct student *next;\n};\nint m, max_1[3] = {0}, t[3] = {0};\nstruct student *head;\nstruct student *p1, *p2;\nstruct student *creat(int n) {\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n  p1->sum = p1->chinese + p1->maths;\n  head = NULL;\n  while (m < n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n    p1->sum = p1->chinese + p1->maths;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  creat(n);\n\n  struct student *p1;\n  p1 = head;\n  do {\n    if (p1->sum > max_1[0]) {\n      max_1[0] = p1->sum;\n      t[0] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[0], max_1[0]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[1] && p1->num != t[0]) {\n      max_1[1] = p1->sum;\n      t[1] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[1], max_1[1]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[2] && p1->num != t[0] && p1->num != t[1]) {\n      max_1[2] = p1->sum;\n      t[2] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[2], max_1[2]);\n}\n"}
{"label": "14", "index": "24875", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} s[100001], first, second, third; \n\nint main() {\n  int n, i, temp1, temp2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].chinese >> s[i].math;\n    s[i].sum = s[i].chinese + s[i].math; \n  }\n  first.sum = 0, second.sum = 0, third.sum = 0; \n  for (i = 0; i < n; i++) {\n    if (first.sum < s[i].sum) {\n      first = s[i];\n      temp1 = i; \n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second.sum < s[i].sum &&\n        s[i].num != s[temp1].num) \n    {\n      second = s[i];\n      temp2 = i;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (third.sum < s[i].sum && s[i].num != s[temp1].num &&\n        s[i].num != s[temp2].num) \n      third = s[i];\n  cout << first.num << \" \" << first.sum << endl;\n  cout << second.num << \" \" << second.sum << endl;\n  cout << third.num << \" \" << third.sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24876", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  long int n;\n  int i, score[100000], max[3] = {0}, a[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    score[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (max[0] < score[i]) {\n      max[0] = score[i];\n      a[0] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[0])\n      continue;\n    else {\n      if (max[1] < score[i]) {\n        max[1] = score[i];\n        a[1] = stu[i].num;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[1] || stu[i].num == a[0]) {\n      continue;\n    } else if (max[2] < score[i]) {\n      max[2] = score[i];\n      a[2] = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], max[i]);\n  }\n}\n"}
{"label": "14", "index": "24877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Top {\n  int num;\n  float score;\n} Top[4] = {{0, 0}};\nstruct Top *p;\n\nvoid maopao(int n) {\n  int i;\n  for (i = 1; i < n; i++) {\n    for (p = Top; p < Top + n - i; p++) {\n      if ((p->score) < ((p + 1)->score)) {\n        Top[3] = *p;\n        *p = *(p + 1);\n        *(p + 1) = Top[3];\n      }\n    }\n  }\n}\n\nvoid sort(float a, int n) {\n  p = Top + 2;\n  if (a > (p->score)) {\n    p->score = a;\n    p->num = n;\n  }\n  maopao(3);\n}\n\nint main() {\n  int i, n, num;\n  float yw, sx, score;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num >> yw >> sx;\n    float score = yw + sx;\n    sort(score, num);\n  }\n  for (p = Top; p < Top + 3; p++) {\n    cout << p->num << \" \" << p->score << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, ta, tb, ts, tnum;\n  int *a, *b, *s, *num;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &num[i], &a[i], &b[i]);\n    s[i] = a[i] + b[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n; i > 1; i--) {\n      if (s[i] > s[i - 1]) {\n        ta = a[i - 1];\n        tb = b[i - 1];\n        ts = s[i - 1];\n        tnum = num[i - 1];\n        a[i - 1] = a[i];\n        b[i - 1] = b[i];\n        s[i - 1] = s[i];\n        num[i - 1] = num[i];\n        a[i] = ta;\n        b[i] = tb;\n        s[i] = ts;\n        num[i] = tnum;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", num[1], s[1], num[2], s[2], num[3], s[3]);\n  return 0;\n}\n"}
{"label": "14", "index": "24879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    char NUM[100000];\n    int Ma;\n    int Ch;\n  } stu;\n  int n, i, x, max1, max2, max3, m1, m2, m3;\n  max1 = max2 = max3 = 0;\n  m1 = m2 = m3 = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu.NUM >> (stu.Ma) >> (stu.Ch);\n    x = stu.Ma + stu.Ch;\n    if (x > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = x;\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n    } else if (x == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = max1;\n      m3 = m2;\n      m2 = i;\n    } else if (x < max1 && x > max2) {\n      max3 = max2;\n      max2 = x;\n      m3 = m2;\n    }\n\n    else if (x == max2) {\n      max3 = max2;\n      m3 = i;\n    } else if (x < max2 && x > max3) {\n      max3 = x;\n      m3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", m1, max1);\n  cout << m2 << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\\n\", m3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "24880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int Chinese;\n  int math;\n  int score;\n} stu[100000];\n\nint main() {\n  int n, i, j, a, b;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].No >> stu[i].Chinese >> stu[i].math;\n    stu[i].score = stu[i].Chinese + stu[i].math;\n  }\n\n  for (j = n - 1; j > n - 4; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i + 1].score < stu[i].score || stu[i + 1].score == stu[i].score) {\n        a = stu[i + 1].score;\n        stu[i + 1].score = stu[i].score;\n        stu[i].score = a;\n        b = stu[i + 1].No;\n        stu[i + 1].No = stu[i].No;\n        stu[i].No = b;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].No << \" \" << stu[i].score << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n};\n\nint main() {\n\n  int n, i, j, t, a, b;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    cin >> stu[i].num;\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++) {\n    printf(\"%d %d\\n\", stu[a].num, stu[a].sum);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "24882", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct result {\n  int num;\n  int chn;\n  int math;\n  int total;\n};\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  struct result student[n + 1];\n  for (k = 1; k <= n; k++) {\n    cin >> student[k].num >> student[k].chn >> student[k].math;\n    student[k].total = student[k].chn + student[k].math;\n  }\n  int i, j;\n  struct result temp;\n  for (i = 1; i < 4; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (student[j].total >= student[j + 1].total) {\n        temp = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = temp;\n      }\n    }\n  cout << student[n].num << \" \" << student[n].total << endl;\n  cout << student[n - 1].num << \" \" << student[n - 1].total << endl;\n  printf(\"%d %d\\n\", student[n - 2].num, student[n - 2].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, chi, math, sum;\n  struct student {\n    int num, chi, math, sum;\n  } students[100000];\n  int i;\n  int STUDENT_NUM;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d \", &num, &chi, &math);\n    students[i].num = num;\n    students[i].chi = chi;\n    students[i].math = math;\n    sum = chi + math;\n    students[i].sum = sum;\n  }\n  int sum1 = 0, sum2 = 0, sum3 = 0;\n  int num1, num2, num3;\n  for (i = 0; i < STUDENT_NUM; i++) {\n    if (i == 0) {\n      sum1 = students[0].sum;\n      num1 = students[0].num;\n    } else if (i == 1) {\n      if (students[1].sum > students[0].sum) {\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[1].sum;\n        num1 = students[1].num;\n      } else {\n        sum2 = students[1].sum;\n        num2 = students[1].num;\n      }\n    } else {\n      if (students[i].sum > sum1) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[i].sum;\n        num1 = students[i].num;\n      } else if (students[i].sum > sum2) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = students[i].sum;\n        num2 = students[i].num;\n      } else if (students[i].sum > sum3) {\n        sum3 = students[i].sum;\n        num3 = students[i].num;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", num1, sum1);\n  cout << num2 << \" \" << sum2 << \"\\n\";\n  printf(\"%d %d\\n\", num3, sum3);\n}\n"}
{"label": "14", "index": "24884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  int ID;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i, *sum, max, p = 0;\n  struct score *s;\n  scanf(\"%d\", &n);\n  s = (struct score *)malloc(sizeof(struct score) * n);\n  sum = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &s[i].ID, &s[i].chinese, &s[i].math);\n  for (i = 0; i < n; i++)\n    *(sum + i) = s[i].chinese + s[i].math;\n  max = sum[0];\n  for (i = 0; i < n; i++) {\n    if (max < *(sum + i)) {\n      max = *(sum + i);\n      p = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n  if (n > 1) {\n    max = *sum;\n    *(sum + p) = 0;\n    p = 0;\n    for (i = 0; i < n; i++) {\n      if (max < *(sum + i)) {\n        max = *(sum + i);\n        p = i;\n      }\n    }\n    printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    if (n > 2) {\n      max = *sum;\n      *(sum + p) = 0;\n      p = 0;\n      for (i = 0; i < n; i++) {\n        if (max < *(sum + i)) {\n          max = *(sum + i);\n          p = i;\n        }\n      }\n      printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int yu;\n  int shu;\n  struct student *next;\n};\nint main() {\n  int n, i, j = 0;\n\n  struct student *head, *p1, *p2;\n\n  scanf(\"%d \", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->yu, &p1->shu);\n    p1 = (struct student *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 200; i > 10; i--) {\n    p1 = head;\n    while (p1 != NULL) {\n      if ((p1->yu + p1->shu) == i) {\n        cout << p1->id << \" \" << i << \" \";\n        j++;\n      }\n      p1 = p1->next;\n      if (j == 3)\n        break;\n    }\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "24886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  struct score {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct score a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 2; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].verbal, &a[i].math);\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (i = 0; i <= 1; i++)\n    for (j = 1; j <= 2 - i; j++) {\n      if (a[i].verbal + a[i].math < a[i + j].verbal + a[i + j].math) {\n        t = a[i].num;\n        a[i].num = a[i + j].num;\n        a[i + j].num = t;\n        t = a[i].sum;\n        a[i].sum = a[i + j].sum;\n        a[i + j].sum = t;\n      }\n    }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &a[3].num, &a[3].verbal, &a[3].math);\n    if (a[3].verbal + a[3].math > a[0].sum) {\n      t = a[1].num;\n      a[1].num = a[0].num;\n      a[2].num = t;\n      a[0].num = a[3].num;\n      t = a[1].sum;\n      a[1].sum = a[0].sum;\n      a[2].sum = t;\n      a[0].sum = a[3].verbal + a[3].math;\n    } else if (a[3].verbal + a[3].math > a[1].sum) {\n      a[2].num = a[1].num;\n      a[1].num = a[3].num;\n      a[2].sum = a[1].sum;\n      a[1].sum = a[3].verbal + a[3].math;\n    } else if (a[3].verbal + a[3].math > a[2].sum) {\n      a[2].num = a[3].num;\n      a[2].sum = a[3].verbal + a[3].math;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n}\n"}
{"label": "14", "index": "24887", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int ID, Ch, Ma;\n  } temp;\n  int fID = 0, fG = 0, sID = 0, sG = 0, tID = 0, tG = 0;\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    cin >> temp.ID >> temp.Ch >> temp.Ma;\n    sum = temp.Ch + temp.Ma;\n    if (sum == fG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum > fG) {\n      tG = sG;\n      tID = sID;\n      sG = fG;\n      sID = fID;\n      fG = sum;\n      fID = temp.ID;\n    }\n    if (sum < fG && sum > sG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum < sG && sum > tG) {\n      tG = sum;\n      tID = temp.ID;\n    }\n  }\n  printf(\"%d %d\\n\", fID, fG);\n  printf(\"%d %d\\n\", sID, sG);\n  printf(\"%d %d\\n\", tID, tG);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24888", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint x[100000], y[100000], z[100000], s[100000], b[100000];\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, t, m1, m2;\n  for (i = 1; i <= n; i++) {\n    cin >> x[i] >> y[i] >> z[i];\n    s[i] = y[i] + z[i];\n    b[i] = s[i];\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (s[i] < s[j]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[1] == b[i]) {\n      m1 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[2] == b[i] && i != m1) {\n      m2 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[3] == b[i] && i != m1 && i != m2) {\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  struct student *next;\n};\nint n, max0;\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  head = p1;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->maths);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->maths);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\n\nvoid max(struct student *head, int x, int y) {\n  struct student *p1, *temp, *p2;\n  temp = (struct student *)malloc(sizeof(struct student));\n  temp->chinese = temp->maths = 0;\n  for (p2 = head; p2 != NULL; p2 = p2->next)\n    if (p2->chinese + p2->maths == x)\n      break;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if ((p1->chinese + p1->maths > temp->chinese + temp->maths) &&\n        (p1->chinese + p1->maths != x ||\n         p1->chinese + p1->maths == x && p1->num != p2->num) &&\n        (p1->chinese + p1->maths != y)) {\n      temp->chinese = p1->chinese;\n      temp->maths = p1->maths;\n      temp->num = p1->num;\n    }\n  max0 = temp->chinese + temp->maths;\n  printf(\"%d %d \", temp->num, max0);\n}\nint main() {\n  struct student *head;\n  int max1, max2;\n  scanf(\"%d\", &n);\n  head = creat();\n  max(head, 0, 0);\n  max1 = max0;\n  max(head, max1, 0);\n  max2 = max0;\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "24890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, *x, *y, *s, *z, i, j, o = 0, t = 0;\n  scanf(\"%d\", &n);\n  x = (int *)malloc(sizeof(int) * n);\n  y = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  z = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> x[i] >> y[i] >> s[i];\n    z[i] = y[i] + s[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (z[i] >= z[i + 1]) {\n        o = z[i];\n        z[i] = z[i + 1];\n        z[i + 1] = o;\n        t = x[i];\n        x[i] = x[i + 1];\n        x[i + 1] = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x[n - 1], z[n - 1]);\n  printf(\"%d %d\\n\", x[n - 2], z[n - 2]);\n  printf(\"%d %d\\n\", x[n - 3], z[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "24891", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nstruct student stu[100000];\nint sum[100000];\nint main(int argc, char *argv[]) {\n\n  int a, b, c, num1, num2, num3;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].math;\n  }\n  a = sum[0];\n  num1 = 1;\n  if (a < sum[1]) {\n    b = a;\n    num2 = num1;\n    a = sum[1];\n    num1 = 2;\n  } else {\n    b = sum[1];\n    num2 = 2;\n  }\n  c = 0;\n  for (i = 2; i < n; i++) {\n    if (a < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = a;\n      num2 = num1;\n      a = sum[i];\n      num1 = i + 1;\n    } else if (b < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = sum[i];\n      num2 = i + 1;\n    } else if (c < sum[i]) {\n      c = sum[i];\n      num3 = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", num1, a);\n  printf(\"%d %d\\n\", num2, b);\n  printf(\"%d %d\\n\", num3, c);\n  return 0;\n}\n"}
{"label": "14", "index": "24892", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    long int num;\n    int score1;\n    int score2;\n  };\n  struct student stu[100000];\n  long int n;\n  int i, j, k, m, a = 0, b = 0, c = 0, A, B, C;\n  A = B = C = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    k = stu[i].score1 + stu[i].score2;\n    if (k > c) {\n      c = k;\n      C = stu[i].num;\n    }\n    if (c > b) {\n      m = c;\n      c = b;\n      b = m;\n      m = C;\n      C = B;\n      B = m;\n    }\n    if (b > a) {\n      m = b;\n      b = a;\n      a = m;\n      m = B;\n      B = A;\n      A = m;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", A, a, B, b, C, c);\n  return 0;\n}\n"}
{"label": "14", "index": "24893", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n  return 0;\n}\n"}
{"label": "14", "index": "24894", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int liter;\n  int math;\n  int total;\n};\nint main() {\n  int i, j, k, n;\n  struct student a[100000], n1, n2, n3;\n  cin >> n;\n  scanf(\"%d%d%d\", &a[0].num, &a[0].liter, &a[0].math);\n  a[0].total = a[0].liter + a[0].math;\n  n1 = n2 = n3 = a[0];\n  for (i = 1; i < n; i++) {\n    cin >> a[i].num >> a[i].liter >> a[i].math;\n    a[i].total = a[i].liter + a[i].math;\n    if (a[i].total > n1.total) {\n      n3 = n2;\n      n2 = n1;\n      n1 = a[i];\n    } else if (a[i].total > n2.total) {\n      n3 = n2;\n      n2 = a[i];\n    } else {\n      if (a[i].total > n3.total)\n        n3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", n1.num, n1.total);\n  printf(\"%d %d\\n\", n2.num, n2.total);\n  printf(\"%d %d\", n3.num, n3.total);\n  return 0;\n}\n"}
{"label": "14", "index": "24895", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} stu[100000];\nint main() {\n  int sum[100000];\n  long i, j, n, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (i = 0; i < 3; i++) {\n    t = 0;\n    for (j = 0; j < n - 1; j++) {\n      if (sum[j + 1] > sum[t])\n        t = j + 1;\n    }\n    printf(\"%d %d\\n\", stu[t].xuehao, sum[t]);\n    sum[t] = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n, k;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n\n  int m;\n  m = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n  head = p1;\n  while (m < n - 1) {\n    m = m + 1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n\n  struct student *max, *p;\n\n  for (i = 0; i < 3; i++) {\n    max = head;\n    p = p2 = head;\n    p1 = p2;\n    for (j = 0; j < n - i; j++) {\n      if (p1->sum > max->sum) {\n        max = p1;\n        p = p2;\n      }\n      p2 = p1;\n      p1 = p2->next;\n    }\n    p1 = p2 = head;\n    cout << max->num << \" \" << max->sum << \" \";\n    if (max->num == head->num)\n      head = p1->next;\n    else\n      p->next = max->next;\n  }\n}\n"}
{"label": "14", "index": "24897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int d;\n  d = *((int *)elem2) - *((int *)elem1);\n  return d;\n}\nstruct student {\n  long int ID;\n  long int c;\n  long int m;\n};\nint main() {\n  long int n, i, j, k;\n  int b[100000];\n  int e[3];\n  scanf(\"%d\", &n);\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].c, &a[i].m);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].c + a[i].m;\n  }\n  qsort(b, n, sizeof(long int), pfCompare);\n  for (i = 0; i < n; i++) {\n    if (b[0] == a[i].c + a[i].m) {\n      e[0] = a[i].ID;\n      j = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[1] == a[i].c + a[i].m) && i != j) {\n      e[1] = a[i].ID;\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[2] == a[i].c + a[i].m) && i != j && i != k) {\n      e[2] = a[i].ID;\n      break;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", e[i], b[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24898", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    long int num;\n    int score1;\n    int score2;\n  };\n  struct student stu[100000];\n  long int n;\n  int i, j, k, m, a = 0, b = 0, c = 0, A, B, C;\n  A = B = C = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    k = stu[i].score1 + stu[i].score2;\n    if (k > c) {\n      c = k;\n      C = stu[i].num;\n    }\n    if (c > b) {\n      m = c;\n      c = b;\n      b = m;\n      m = C;\n      C = B;\n      B = m;\n    }\n    if (b > a) {\n      m = b;\n      b = a;\n      a = m;\n      m = B;\n      B = A;\n      A = m;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", A, a, B, b, C, c);\n  return 0;\n}\n"}
{"label": "14", "index": "24899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n} stu[100000];\n\nint main() {\n\n  int n, i, j, t, a, b, m;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n  \n  \n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    printf(\"%d %d\\n\", stu[a].num, stu[a].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int s1;\n  int s2;\n  int sum;\n};\nstruct student stu[100000];\nint main() {\n\n  int n, i, p, q, r, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].sum = stu[i].s1 + stu[i].s2;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max) {\n      max = stu[i].sum;\n      p = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (i != p) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        q = i;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if ((i != p) && (i != q)) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[p].num, stu[p].sum);\n  printf(\"%d %d\\n\", stu[q].num, stu[q].sum);\n  printf(\"%d %d\\n\", stu[r].num, stu[r].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[3][2], k;\n  struct student {\n    int num;\n    int s1;\n    int s2;\n    int l;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].l = stu[i].s1 + stu[i].s2;\n  }\n  for (i = 0; i < 3; i++) {\n    for (m = 0, j = 0; j < n; j++) {\n      if (m < stu[j].l) {\n        m = stu[j].l;\n        k = j;\n      }\n    }\n    a[i][0] = k;\n    a[i][1] = m;\n    stu[k].l = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i][0] + 1, a[i][1]);\n  }\n}\n"}
{"label": "14", "index": "24902", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int chn;\n  int math;\n  struct info *next;\n};\nint n, all;\nstruct info *setup(void) {\n  struct info *head, *p1, *p2;\n  n = 0;\n  while (n < all) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d %d\", p1->num, &p1->chn, &p1->math);\n    n += 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct info *p;\n  int i, first = 0, second = 0, third = 0;\n  char fnum[10], snum[10], tnum[10];\n  scanf(\"%d\", &all);\n  p = setup();\n  do {\n    if (1000 > first) {\n      third = second;\n      second = first;\n      first = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, fnum);\n      strcpy(fnum, \"\");\n      strcat(fnum, p->num);\n    } else if (1000 > second) {\n      third = second;\n      second = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, p->num);\n    } else if (1000 > third) {\n      third = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%s %d %s %d %s %d \", fnum, first, snum, second, tnum, third);\n  return 0;\n}\n"}
{"label": "14", "index": "24903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  float chi;\n  float mat;\n  float tot;\n  struct student *next;\n};\n\nstruct student *creat(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->tot >= p1->tot) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nstruct student *compare(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  int i;\n  p1 = head;\n  p0 = stud;\n  while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if ((p0->tot > p1->tot) || ((p0->tot = p1->tot) && (p1->next != NULL))) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n    p1 = head;\n    for (i = 0; i < 2; i++) {\n      p1 = p1->next;\n    }\n    p1->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int i;\n  p = head;\n  for (i = 0; i < 3; i++) {\n    cout << p->num << \" \" << p->tot << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  struct student *head;\n  struct student *stu;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = creat(head, stu);\n  }\n  for (i = 3; i < n; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = compare(head, stu);\n  }\n  print(head);\n}\n"}
{"label": "14", "index": "24904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n};\n\nint main() {\n  int n;\n  int i, j, e;\n  int x;\n  struct student a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chn, &a[i].math);\n    a[i].sum = a[i].chn + a[i].math;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = n - i - 1; j >= 0; j--) {\n      if (a[j].sum < a[j + 1].sum) {\n        x = a[j + 1].sum;\n        a[j + 1].sum = a[j].sum;\n        a[j].sum = x;\n        e = a[j + 1].num;\n        a[j + 1].num = a[j].num;\n        a[j].num = e;\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "24905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int chi;\n  int math;\n  int s;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n  struct stu *head;\n  struct stu *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->num >> p1->chi >> p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int i, n, t, m;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1->s = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < 3; i++) {\n    while (p2 != NULL) {\n      if (p2->s > p1->s) {\n        t = p2->s;\n        p2->s = p1->s;\n        p1->s = t;\n        m = p2->num;\n        p2->num = p1->num;\n        p1->num = m;\n      }\n      p2 = p2->next;\n    }\n    cout << p1->num << \" \" << p1->s << \" \";\n    if (i == 2)\n      break;\n    p1 = p1->next;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int ch;\n  int ma;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu *head;\n  struct stu *p1, *p2, *a, *b, *c, *t;\n  int n, i = 0;\n  a = b = c = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  scanf(\"%d%d%d\", &p1->ID, &p1->ch, &p1->ma);\n  p1->sum = p1->ch + p1->ma;\n  head = NULL;\n  while (i < n - 1) {\n    i++;\n    p1->sum = p1->ch + p1->ma;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (p1->sum > a->sum) {\n      c = b;\n      b = a;\n      a = p2;\n    } else if (p1->sum > b->sum) {\n      c = b;\n      b = p2;\n    } else {\n      if (p1->sum > c->sum)\n        c = p2;\n    }\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->ID, &p1->ch, &p1->ma);\n  }\n  p2->next = NULL;\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->ID, a->sum, b->ID, b->sum, c->ID, c->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stud {\n  int n;\n  int m;\n  int c;\n  int t;\n} s[100000], temp;\nint main() {\n  int i, j, k, n, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].m, &s[i].c);\n    s[i].t = s[i].m + s[i].c;\n  }\n  for (j = 0; j < 3 && j < n; j++) {\n    for (k = j + 1, p = j; k < n; k++)\n      if (s[p].t < s[k].t) {\n        p = k;\n      }\n    temp = s[j];\n    s[j] = s[p];\n    s[p] = temp;\n    printf(\"%d %d\\n\", s[j].n, s[j].t);\n  }\n}\n"}
{"label": "14", "index": "24908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid swap(int *i, int *j) {\n  int *p = i, t = *i;\n  *p = *j;\n  p = j;\n  *p = t;\n}\nstruct Student {\n  int id;\n  int chinese;\n  int math;\n};\nint main() {\n  void swap(int *i, int *j);\n  int n, i, first, second, third, one, two, three;\n  int *f = &first, *s = &second, *t = &third, *on = &one, *tw = &two,\n      *th = &three;\n  struct Student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    int total = stu[i].chinese + stu[i].math, k;\n    int *to = &total, *K = &k;\n    if (i == 0) {\n      first = total;\n      one = i;\n    } else {\n      if (i == 1) {\n        if (total > first) {\n          swap(to, f);\n          second = total;\n          k = i;\n          swap(K, on);\n          two = k;\n        } else {\n          second = total;\n          two = i;\n        }\n      } else {\n        if (i == 2) {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            third = total;\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            three = k;\n          } else {\n            if (total > second && total <= first) {\n              swap(to, s);\n              third = total;\n              k = i;\n              swap(K, tw);\n              three = k;\n            } else {\n              third = total;\n              three = i;\n            }\n          }\n        } else {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            swap(to, t);\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            swap(K, th);\n          } else {\n            if (total > second) {\n              swap(to, s);\n              swap(to, t);\n              k = i;\n              swap(K, tw);\n              swap(K, th);\n            } else {\n              if (total > third) {\n                swap(to, t);\n                k = i;\n                swap(K, th);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[one].id, first);\n  printf(\"%d %d\\n\", stu[two].id, second);\n  printf(\"%d %d\\n\", stu[three].id, third);\n  return 0;\n}\n"}
{"label": "14", "index": "24909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  struct stu *next;\n};\n\nint main() {\n  int i = 0, n, a, b, score, first = 0, second = 0, third = 0;\n  struct stu *head, *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  head = p = (struct stu *)malloc(sizeof(struct stu));\n  while (i++ < n) {\n    scanf(\"%d %d %d\", &(*p).num, &a, &b);\n    score = a + b;\n    if (score > first) {\n      third = second;\n      second = first;\n      first = score;\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (score > second) {\n      third = second;\n      second = score;\n      p3 = p2;\n      p2 = p;\n    } else {\n      if (score > third) {\n        third = score;\n        p3 = p;\n      }\n    }\n    p = (*p).next = (struct stu *)malloc(sizeof(struct stu));\n  }\n  cout << (*p1).num << \" \" << first << \"\\n\"\n       << (*p2).num << \" \" << second << \"\\n\"\n       << (*p3).num << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24910", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int Chinese;\n  int math;\n} a[100000];\nint main() {\n  int n, i, first, second, third, h1 = 0, h2 = 0, h3 = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i].id, &a[i].Chinese, &a[i].math);\n\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    if (first < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = first;\n      h2 = h1;\n      first = a[i].Chinese + a[i].math;\n      h1 = a[i].id;\n    } else if (first == (a[i].Chinese + a[i].math) && first > second) {\n      third = second;\n      h3 = h2;\n      h2 = a[i].id;\n      second = a[i].Chinese + a[i].math;\n    } else if (first == (a[i].Chinese + a[i].math) && first == second &&\n               second > third) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    } else if (first > (a[i].Chinese + a[i].math) &&\n               second < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = a[i].Chinese + a[i].math;\n      h2 = a[i].id;\n    } else if (second > (a[i].Chinese + a[i].math) &&\n               third < (a[i].Chinese + a[i].math)) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, second, h3, third);\n}\n"}
{"label": "14", "index": "24911", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, max, k;\n  struct stu {\n    int num;\n    int chinese;\n    int maths;\n    int all;\n  } stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  for (i = 0; i < n; i++)\n    stu[i].all = stu[i].chinese + stu[i].maths;\n  for (k = 0; k < 3; k++) {\n    max = stu[0].all;\n    for (i = 0; i < n; i++) {\n      if (stu[i].all > max) {\n        max = stu[i].all;\n        j = i;\n      }\n    }\n\n    printf(\"%d %d\\n\", stu[j].num, stu[j].all);\n    stu[j].all = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24912", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  int total;\n} a[100000];\nstruct str {\n  int num;\n  int total;\n} b[100000];\n\nint main() {\n  int i, n, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].ch >> a[i].math;\n    b[i].num = a[i].num;\n    b[i].total = a[i].ch + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[i].total < b[j].total) {\n        b[n] = b[i];\n        b[i] = b[j];\n        b[j] = b[n];\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", b[i].num, b[i].total);\n}\n"}
{"label": "14", "index": "24913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n\n  struct stu {\n    int id;\n    int chn;\n    int math;\n    int total;\n  };\n  struct stu a[100001];\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].chn, &a[i].math);\n    (a[i].total) = (a[i].chn) + (a[i].math);\n  }\n\n  for (k = 1; k < 5; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((a[i].total) >= (a[i + 1].total)) {\n        a[100000].id = a[i].id;\n        a[100000].total = a[i].total;\n        a[i].id = a[i + 1].id;\n        a[i + 1].id = a[100000].id;\n        a[i].total = a[i + 1].total;\n        a[i + 1].total = a[100000].total;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", a[n - 1].id, a[n - 1].total);\n  printf(\"%d %d\\n\", a[n - 2].id, a[n - 2].total);\n  cout << a[n - 3].id << \" \" << a[n - 3].total << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "24914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct a {\n  char No[20];\n  int y;\n  int s;\n  struct a *next;\n};\nint n;\nstruct a *creat(void) {\n  struct a *p1, *p2, *head;\n  int i;\n  scanf(\"%d \", &n);\n  p1 = p2 = (struct a *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", p1->No, &p1->y, &p1->s);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct a *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct a *head, *p1, *p2, *p;\n  int j, k, m1, m2;\n  char r[10];\n  head = creat();\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d\", r, j);\n}\n"}
{"label": "14", "index": "24915", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000];\n  struct Student temp;\n  int i, n, j, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].ID >> stu[i].chi >> stu[i].math;\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].total >= stu[m + 1].total) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "24916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max1 = 2, max2 = 1, max3 = 0, num1 = 0, num2 = 0, num3 = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = stu[i].zongfen;\n      num1 = i;\n    } else if (stu[i].zongfen <= max1 && stu[i].zongfen > max2) {\n      max3 = max2;\n      num3 = num2;\n      max2 = stu[i].zongfen;\n      num2 = i;\n    } else if (stu[i].zongfen <= max2 && stu[i].zongfen > max3) {\n      max3 = stu[i].zongfen;\n      num3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[num1].xuehao, stu[num1].zongfen);\n  printf(\"%d %d\\n\", stu[num2].xuehao, stu[num2].zongfen);\n  printf(\"%d %d\\n\", stu[num3].xuehao, stu[num3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "24917", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int n;\n    int a;\n    int b;\n  } n[100000];\n  int m, i, sum[100000], first, second, third, d, e, f;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &n[i].n);\n    scanf(\"%d\", &n[i].a);\n    scanf(\"%d\", &n[i].b);\n    sum[i] = n[i].a + n[i].b;\n  }\n  if (sum[0] > sum[1] && sum[0] > sum[2] && sum[1] > sum[2]) {\n    first = sum[0];\n    second = sum[1];\n    third = sum[2];\n    d = 1;\n    e = 2;\n    f = 3;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] > sum[2]) {\n    first = sum[0];\n    second = sum[2];\n    third = sum[1];\n    d = 1;\n    e = 3;\n    f = 2;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] > sum[2]) {\n    first = sum[1];\n    second = sum[0];\n    third = sum[2];\n    d = 2;\n    e = 1;\n    f = 3;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] < sum[2]) {\n    first = sum[1];\n    second = sum[2];\n    third = sum[0];\n    d = 2;\n    e = 3;\n    f = 1;\n  } else if (sum[0] < sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[1];\n    third = sum[0];\n    d = 3;\n    e = 2;\n    f = 1;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[0];\n    third = sum[1];\n    d = 3;\n    e = 1;\n    f = 2;\n  }\n  for (i = 3; i < m; i++) {\n    if (sum[i] > first) {\n      third = second;\n      second = first;\n      first = sum[i];\n      f = e;\n      e = d;\n      d = i + 1;\n    } else if (sum[i] <= first && sum[i] > second) {\n      third = second;\n      second = sum[i];\n      f = e;\n      e = i + 1;\n    } else if (sum[i] <= second && sum[i] > third) {\n      third = sum[i];\n      f = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", d, first);\n  printf(\"%d %d\\n\", e, second);\n  printf(\"%d %d\\n\", f, third);\n  return 0;\n}\n"}
{"label": "14", "index": "24918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int idnum, yunum, shunum;\n  } stu[100000];\n  int n, i, max = 0, ndmax = 0, rdmax = 0, l = 0;\n  scanf(\"%d\", &n);\n  int chengji[100000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].idnum >> stu[i].yunum >> stu[i].shunum;\n    chengji[i] = chengji[i] + stu[i].yunum;\n    chengji[i] = chengji[i] + stu[i].shunum;\n  }\n  for (i = 0; i < n; i++) {\n    if (chengji[i] > max)\n      max = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (max == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        cout << stu[i].idnum << \" \" << max << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < max) && (chengji[i] > ndmax))\n      ndmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (ndmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, ndmax);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < ndmax) && (chengji[i] > rdmax))\n      rdmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (rdmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        cout << stu[i].idnum << \" \" << rdmax << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24919", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n} stu[100000], max_1, secondmax_1, thirdmax_1;\nint main() {\n  max_1.sum = secondmax_1.sum = thirdmax_1.sum = 0;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].sum = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max_1.sum)\n      max_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < max_1.sum && stu[i].sum > secondmax_1.sum)\n      secondmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == max_1.sum && stu[i].num != max_1.num) {\n      secondmax_1 = stu[i];\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < secondmax_1.sum && stu[i].sum > thirdmax_1.sum)\n      thirdmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == secondmax_1.sum && stu[i].num != max_1.num &&\n        stu[i].num != secondmax_1.num) {\n      thirdmax_1 = stu[i];\n      break;\n    }\n  }\n  printf(\"%d %d %d %d %d %d\", max_1.num, max_1.sum, secondmax_1.num,\n         secondmax_1.sum, thirdmax_1.num, thirdmax_1.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nint student_num;\n\nstruct student *creat() {\n  struct student *p1, *p2, *head;\n  int n = 0;\n  scanf(\"%d\", &student_num);\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  while (n < student_num) {\n    if (n == 0)\n      head = p1;\n    if (n == student_num - 1)\n      p1->next = NULL;\n    cin >> p1->id >> p1->chi >> p1->math;\n    p1->total = p1->chi + p1->math;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    n++;\n  }\n  return head;\n}\n\nint main() {\n  struct student *head, *p;\n  int i, n = 0, first, second, third, firstid, secondid, thirdid;\n  head = creat();\n  first = 0;\n  second = 0;\n  third = 0;\n  p = head;\n  for (i = 1; i <= student_num; i++) {\n    if (p->total > first) {\n      third = second;\n      second = first;\n      first = p->total;\n      thirdid = secondid;\n      secondid = firstid;\n      firstid = p->id;\n    } else if (p->total <= first && p->total > second) {\n      third = second;\n      second = p->total;\n      thirdid = secondid;\n      secondid = p->id;\n    } else if (p->total <= second && p->total > third) {\n      third = p->total;\n      thirdid = p->id;\n    }\n    p = p->next;\n  }\n  cout << firstid << \" \" << first << \"\\n\"\n       << secondid << \" \" << second << \"\\n\"\n       << thirdid << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct gpa {\n    int num;\n    int math;\n    int chin;\n    int total;\n  } STUDENT_NUM[100000], first, second, third;\n\n  int num, math, chin;\n  long n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    scanf(\"%d\", &math);\n    scanf(\"%d\", &chin);\n    STUDENT_NUM[i].num = num;\n    STUDENT_NUM[i].math = math;\n    STUDENT_NUM[i].chin = chin;\n    STUDENT_NUM[i].total = math + chin;\n  }\n\n  first.num = 0;\n  first.total = 0;\n  second.num = 0;\n  second.total = 0;\n  third.num = 0;\n  third.total = 0;\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > first.total) {\n      first.num = STUDENT_NUM[i].num;\n      first.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == first.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > second.total) {\n      second.num = STUDENT_NUM[i].num;\n      second.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == second.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > third.total) {\n      third.num = STUDENT_NUM[i].num;\n      third.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  printf(\"%d %d\\n\", first.num, first.total);\n  printf(\"%d %d\\n\", second.num, second.total);\n  printf(\"%d %d\\n\", third.num, third.total);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b, c, d;\n  struct {\n    int sn;\n    int chi;\n    int mat;\n    int sum;\n  } a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].sn, &a[i].chi, &a[i].mat);\n    a[i].sum = a[i].chi + a[i].mat;\n  }\n  b = n;\n  c = n;\n  d = n;\n  a[n].sum = -100;\n  for (i = 0; i < n; i++) {\n    if (a[b].sum >= a[i].sum)\n      b = b;\n    else\n      b = i;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != b) {\n      if (a[c].sum >= a[i].sum)\n        c = c;\n      else\n        c = i;\n    } else\n      ;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != c & i != b) {\n      if (a[d].sum >= a[i].sum)\n        d = d;\n      else\n        d = i;\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", a[b].sn, a[b].sum);\n  printf(\"%d %d\\n\", a[c].sn, a[c].sum);\n  printf(\"%d %d\\n\", a[d].sn, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p, q, t;\n  int a[100000][3];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 3; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    a[i][1] = a[i][1] + a[i][2];\n  }\n  for (p = 0; p < 3; p++) {\n    for (q = n - 2; q >= 0; q--) {\n      if (a[q][1] < a[q + 1][1]) {\n        for (i = 0; i < 2; i++) {\n          t = a[q][i];\n          a[q][i] = a[q + 1][i];\n          a[q + 1][i] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i][0] << \" \" << a[i][1] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  char ID[20];\n  int math, cn;\n};\n\nint main() {\n  int n, i, j, max, m;\n  int *s;\n  struct grade stu[100000];\n  scanf(\"%d\", &n);\n  s = (int *)malloc(n * sizeof(int));\n  if (n == 1) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    cout << stu[0].ID << \" \" << stu[0].math + stu[0].cn;\n  } else if (n == 2) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    scanf(\"%s %d %d\", stu[1].ID, &stu[1].math, &stu[1].cn);\n    if (stu[0].math + stu[0].cn > stu[1].math + stu[1].cn) {\n      cout << stu[0].ID << \" \" << stu[0].math + stu[0].cn << \"\\n\";\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    } else {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    }\n  } else if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%s %d %d\", stu[i].ID, &stu[i].math, &stu[i].cn);\n      s[i] = stu[i].math + stu[i].cn;\n    }\n    for (i = 1; i < 4; i++) {\n      max = s[0];\n      for (j = 1; j < n; j++) {\n        if (s[j] > max) {\n          max = s[j];\n          m = j;\n        }\n      }\n      printf(\"%s %d\\n\", stu[m].ID, max);\n      s[m] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int ch;\n  int math;\n  int sum;\n};\nint main() {\n  struct Student stu[4], temp;\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].ch, &stu[i].math);\n    stu[i].sum = stu[i].ch + stu[i].math;\n  }\n  for (i = 0; i < 2; i++) {\n    k = i;\n    for (j = i + 1; j < 3; j++)\n      if (stu[j].sum > stu[i].sum) {\n        k = j;\n        temp = stu[k];\n        stu[j] = stu[i];\n        stu[i] = temp;\n      }\n  }\n\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[3].num, &stu[3].ch, &stu[3].math);\n    stu[3].sum = stu[3].ch + stu[3].math;\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum) {\n      stu[2] = stu[3];\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int x;\n  int y;\n  int s;\n  int z;\n} a[100010], t;\n\nint main() {\n\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].x, &a[i].y, &a[i].s);\n    a[i].z = a[i].y + a[i].s;\n  }\n  for (i = 0; i <= 2; i++)\n    for (j = n - 1; j >= i; j--) {\n      if (a[j + 1].z > a[j].z) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  printf(\"%d %d\\n\", a[0].x, a[0].z);\n  printf(\"%d %d\\n\", a[1].x, a[1].z);\n  printf(\"%d %d\\n\", a[2].x, a[2].z);\n  return 0;\n}\n"}
{"label": "14", "index": "24927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, i, n, m = 0, j = 0, k = 0, s, l1, l2, l3;\n  int a[100000], b[100000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x, &(a[i]), &(b[i]));\n    s = a[i] + b[i];\n    if (s > m) {\n\n      j = m;\n      m = s;\n      l2 = l1;\n      l1 = i;\n    } else if (s > j) {\n      k = j;\n      j = s;\n      l3 = l2;\n      l2 = i;\n    } else if (s > k) {\n      k = s;\n      l3 = i;\n    }\n  }\n  cout << l1 << \" \" << m << \"\\n\";\n  printf(\"%d %d\\n\", l2, j);\n  printf(\"%d %d\\n\", l3, k);\n  return 0;\n}\n"}
{"label": "14", "index": "24928", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max_1 = 0;\n\nstruct student {\n  char id[20];\n  int chinese;\n  int math;\n  int sum;\n  int flag;\n  struct student *next;\n};\nstruct student *h;\nint n, i;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  p1->flag = 0;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p1->flag = 0;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *compare() {\n  struct student *p1, *p3;\n  p1 = h;\n  max_1 = p1->sum;\n  do {\n    if (p1->sum > max_1 && (p1->flag == 0))\n      max_1 = p1->sum;\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  p1 = h;\n  do {\n    if (p1->sum == max_1 && (p1->flag == 0)) {\n      p3 = p1;\n      p1->flag = 1;\n      break;\n    }\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  return (p3);\n}\nint main() {\n  int j;\n  struct student *p;\n  scanf(\"%d\", &n);\n  h = creat();\n  for (j = 1; j <= 3; j++) {\n    p = compare();\n    printf(\"%s %d \", p->id, p->sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int sum;\n} stu[100000];\n\nint main(int argc, char *argv[]) {\n  int i, n;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxid1 = 0, maxid2 = 0, maxid3 = 0;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].math + stu[i].chinese;\n    if (stu[i].sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = maxid1;\n      maxid1 = stu[i].id;\n    } else if (stu[i].sum > max2) {\n      max3 = max2;\n      max2 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = stu[i].id;\n    } else if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxid3 = stu[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxid1, max1, maxid2, max2, maxid3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "24930", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chi;\n  int math;\n};\nstruct maxer {\n  int id;\n  int mark;\n};\nint main() {\n  int n, i, j;\n  struct student a[100001], temp;\n  struct maxer max, top[3];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i].id >> a[i].chi >> a[i].math;\n\n  for (i = 1; i <= 3; i++) {\n    max.mark = 0;\n    for (j = i; j <= n; j++) {\n      if (a[j].chi + a[j].math > max.mark) {\n        max.id = a[j].id;\n        max.mark = a[j].chi + a[j].math;\n      }\n    }\n    top[i - 1] = max;\n    temp = a[i];\n    a[i] = a[max.id];\n    a[max.id] = temp;\n  }\n  for (i = 0; i <= 2; i++) {\n    cout << top[i].id << ' ' << top[i].mark;\n    if (i != 2)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  long n;\n  long num[99999], math[99999], china[99999], z[99999], i;\n  long num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", &num[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &china[i]);\n    z[i] = math[i] + china[i];\n    if (z[i] > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z[i];\n      m3 = i;\n\n    } else if (z[i] > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z[i];\n      m2 = i;\n    } else if (z[i] > num1) {\n      num1 = z[i];\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  cout << m1 << \" \" << num1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n  struct Student *next;\n};\n\nint main() {\n  int i = 0, n, max;\n\n  struct Student *linkHead, *linkTail, *student, *ppre, *pmax, *premax;\n\n  cin >> n;\n\n  linkHead = linkTail = NULL;\n\n  while (i < n) {\n    student = (struct Student *)malloc(1000);\n\n    scanf(\"%d %d %d\", &student->number, &student->math, &student->chinese);\n\n    student->total = student->math + student->chinese;\n\n    student->next = NULL;\n    if (linkTail == NULL)\n\n      linkHead = linkTail = student;\n    else {\n\n      linkTail->next = student;\n      linkTail = student;\n    }\n\n    i++;\n  }\n\n  i = 0;\n\n  while (i < 3) {\n    student = linkHead;\n    ppre = student;\n\n    max = 0;\n    pmax = linkHead;\n    premax = linkHead;\n\n    while (student != NULL) {\n\n      if (student->total > max) {\n        max = student->total;\n        pmax = student;\n        premax = ppre;\n      }\n      ppre = student;\n      student = student->next;\n    }\n\n    cout << pmax->number << \" \" << pmax->total << \" \";\n\n    if (pmax == linkHead) {\n      linkHead = student->next;\n    } else\n      premax->next = pmax->next;\n\n    i++;\n  }\n}\n"}
{"label": "14", "index": "24933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, t, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> chi >> math;\n    stu[i].sum = chi + math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].sum);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].sum);\n  printf(\"%d %d\", stu[2].num, stu[2].sum);\n}\n"}
{"label": "14", "index": "24934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[3], sum[3];\n  int i, j, k, t, n, m;\n  num[0] = num[1] = num[2] = sum[0] = sum[1] = sum[2] = -10000000;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d%d\", &i, &j, &k);\n    j += k;\n    if (sum[2] < j) {\n      sum[2] = j;\n      num[2] = i;\n      if (sum[2] > sum[1]) {\n        t = sum[2];\n        sum[2] = sum[1];\n        sum[1] = t;\n        t = num[2];\n        num[2] = num[1];\n        num[1] = t;\n        if (sum[1] > sum[0]) {\n          t = sum[0];\n          sum[0] = sum[1];\n          sum[1] = t;\n          t = num[0];\n          num[0] = num[1];\n          num[1] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", num[i], sum[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "24935", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, zf[100000];\n  struct student {\n    int name;\n    int yw;\n    int sx;\n\n  } stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].name, &stu[i].yw, &stu[i].sx);\n    zf[i] = stu[i].yw + stu[i].sx;\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (zf[i] >= zf[i + 1]) {\n        a = zf[i];\n        zf[i] = zf[i + 1];\n        zf[i + 1] = a;\n        a = stu[i].name;\n        stu[i].name = stu[i + 1].name;\n        stu[i + 1].name = a;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    printf(\"%d %d\\n\", stu[i].name, zf[i]);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].total = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].total > stu[k].total)\n        k = j;\n    if (k != i) {\n      t = stu[i].total;\n      stu[i].total = stu[k].total;\n      stu[k].total = t;\n      t = stu[i].num;\n      stu[i].num = stu[k].num;\n      stu[k].num = t;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n}\n"}
{"label": "14", "index": "24937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\n\nstruct stu {\n  int xh;\n  int yw;\n  int sx;\n  int all;\n  struct stu *next;\n};\nstruct stu *a, *b, *c, q, t, r;\nstruct stu *creat() {\n  struct stu *head;\n  struct stu *p1, *p2;\n  int i;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->all = p1->yw + p1->sx;\n  head = p1;\n  a = b = c = head;\n  for (i = 1; i < n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->xh >> p1->yw >> p1->sx;\n    p1->all = p1->yw + p1->sx;\n    if (p1->all > a->all) {\n      c = b;\n      b = a;\n      a = p1;\n    } else\n\n        if (p1->all > b->all) {\n      c = b;\n      b = p1;\n    } else {\n      if (p1->all > c->all)\n        c = p1;\n    }\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n\n  struct stu *p;\n  a = &q;\n  b = &t;\n  c = &r;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->xh, a->all, b->xh, b->all, c->xh, c->all);\n}\n"}
{"label": "14", "index": "24938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct grade {\n  int num;\n  int chinese;\n  int math;\n  int all;\n} stu[100000];\nint main() {\n  int n, i, e, f, g, a, b, c;\n  e = 0;\n  f = 0;\n  g = 0;\n  a = 0;\n  b = 0;\n  c = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all > e) {\n      e = stu[i].all;\n      a = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= e && stu[i].all > f && i != a) {\n      f = stu[i].all;\n      b = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= f && stu[i].all > g && i != a && i != b) {\n      g = stu[i].all;\n      c = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a].num, stu[a].all);\n  printf(\"%d %d\\n\", stu[b].num, stu[b].all);\n  printf(\"%d %d\\n\", stu[c].num, stu[c].all);\n  return 0;\n}\n"}
{"label": "14", "index": "24939", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int mark;\n  struct student *next;\n};\nint n;\nstruct student *creat(int max) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  head = p1;\n  while (n < max - 1) {\n    n++;\n    if (n != 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint main() {\n  int max, i;\n  struct student *table;\n  scanf(\"%d\", &max);\n  table = creat(max);\n  for (i = 0; i < 3; i++) {\n    int mmax = 0;\n    int mark = 0;\n    struct student *p;\n    p = table;\n\n    do {\n      if (p->shuxue + p->yuwen > mmax && p->mark != -1) {\n        mark++;\n        p->mark = mark;\n        mmax = p->shuxue + p->yuwen;\n      }\n      p = p->next;\n    } while (p != 0);\n    p = table;\n    do {\n      if (p->mark == mark) {\n        printf(\"%d %d \", p->xuehao, p->shuxue + p->yuwen);\n        p->mark = -1;\n      }\n      p = p->next;\n    } while (p != 0);\n  }\n}\n"}
{"label": "14", "index": "24940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int no;\n  int ch;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(long n) {\n  long i;\n  struct student *head, *p, *q;\n  head = (struct student *)malloc(1000);\n  p = (struct student *)malloc(1000);\n  head->next = q = p;\n  scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n  p->sum = (p->ch) + (p->math);\n\n  for (i = 1; i < n; i++) {\n    p = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n    p->sum = (p->ch) + (p->math);\n    q->next = p;\n    q = p;\n    p->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid sort(struct student *head) {\n  struct student *p, *q1, *q2, *q3;\n  int m1, m2, m3;\n  for (p = head->next, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1) {\n      m1 = p->sum;\n      q1 = p;\n    }\n  printf(\"%d %d \", q1->no, q1->sum);\n  for (p = head->next, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1) {\n      m2 = p->sum;\n      q2 = p;\n    }\n  cout << q2->no << \" \" << q2->sum << \" \";\n  for (p = head->next, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2) {\n      m3 = p->sum;\n      q3 = p;\n    }\n  printf(\"%d %d \", q3->no, q3->sum);\n}\n\nint main() {\n  long n;\n  struct student *head;\n  cin >> n;\n  head = creat(n);\n  sort(head);\n  return 0;\n}\n"}
{"label": "14", "index": "24941", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  struct student {\n    int num;\n    int score1;\n    int score2;\n    int t;\n  } stu[100000], m1, m2, m3;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    stu[i].t = stu[i].score1 + stu[i].score2;\n  }\n  m1 = stu[0];\n  m2 = stu[0];\n  m3 = stu[0];\n  for (i = 0; i < n; i++) {\n    if (stu[i].t > m1.t) {\n      m3 = m2;\n      m2 = m1;\n      m1 = stu[i];\n    } else if (stu[i].t > m2.t && stu[i].t <= m1.t) {\n      m3 = m2;\n      m2 = stu[i];\n    } else if (stu[i].t > m3.t && stu[i].t <= m2.t) {\n      m3 = stu[i];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", m1.num, m1.t, m2.num, m2.t, m3.num, m3.t);\n}\n"}
{"label": "14", "index": "24942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  int d;\n  int score;\n} student;\n\nint main() {\n  int n, i, temp1, temp2;\n  student a[100002];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].d, &temp1, &temp2);\n    a[i].score = temp1 + temp2;\n  }\n\n  student max1, max2, max3;\n  max1.d = max2.d = max3.d = -1;\n  max1.score = max2.score = max3.score = 0;\n\n  for (i = 0; i < n; i++) {\n    if (a[i].score > max1.score) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a[i];\n    } else if (a[i].score > max2.score) {\n      max3 = max2;\n      max2 = a[i];\n    } else if (a[i].score > max3.score) {\n      max3 = a[i];\n    }\n  }\n\n  cout << max1.d << \" \" << max1.score << \"\\n\";\n  if (max2.d != -1)\n    printf(\"%d %d\\n\", max2.d, max2.score);\n  if (max3.d != -1)\n    printf(\"%d %d\\n\", max3.d, max3.score);\n  return 0;\n}\n"}
{"label": "14", "index": "24943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nint main() {\n  int n, m, i, j, t, k;\n  scanf(\"%d\", &n);\n  m = n;\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  int *score = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    score[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (score[j] >= score[j + 1]) {\n        t = score[j];\n        score[j] = score[j + 1];\n        score[j + 1] = t;\n        k = stu[j].num;\n        stu[j].num = stu[j + 1].num;\n        stu[j + 1].num = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    printf(\"%d %d\\n\", stu[i].num, score[i]);\n\n  free(stu);\n  free(score);\n  return 0;\n}\n"}
{"label": "14", "index": "24944", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int mat, chi, i, num;\n  struct stu {\n    int id;\n    int to;\n  } s[100001], temp1, temp2, max1, max2, max3;\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &chi, &mat);\n    s[i].to = chi + mat;\n  }\n  if (s[0].to > s[1].to && s[1].to > s[2].to) {\n    max1 = s[0];\n    max2 = s[1];\n    max3 = s[2];\n  } else if (s[2].to > s[0].to && s[0].to > s[1].to) {\n    max1 = s[2];\n    max2 = s[0];\n    max3 = s[1];\n  } else if (s[0].to > s[2].to && s[2].to > s[1].to) {\n    max1 = s[0];\n    max2 = s[2];\n    max3 = s[1];\n  } else if (s[2].to > s[1].to && s[1].to > s[0].to) {\n    max1 = s[2];\n    max2 = s[1];\n    max3 = s[0];\n  } else if (s[1].to > s[0].to && s[0].to > s[2].to) {\n    max1 = s[1];\n    max2 = s[0];\n    max3 = s[2];\n  } else {\n    max1 = s[1];\n    max2 = s[2];\n    max3 = s[0];\n  }\n  for (i = 0; i < num - 1; i++) {\n    if (s[i].to > max1.to) {\n      temp1 = max1;\n      temp2 = max2;\n      max1 = s[i];\n      max2 = temp1;\n      max3 = temp2;\n    } else if (s[i].to > max2.to && s[i].id != max1.id) {\n      temp1 = max2;\n      max2 = s[i];\n      max3 = temp1;\n    } else if (s[i].to > max3.to && s[i].id != max2.id && s[i].id != max1.id)\n      max3 = s[i];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.id, max1.to, max2.id, max2.to, max3.id,\n         max3.to);\n  return 0;\n}\n"}
{"label": "14", "index": "24945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int id;\n    int x;\n    int y;\n    int z;\n  } student1, student2, student3, studenta;\n  int n, i;\n  scanf(\"%d\", &n);\n  student1.z = student2.z = student3.z = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &studenta.id, &studenta.x, &studenta.y);\n    studenta.z = studenta.x + studenta.y;\n    if (studenta.z > student1.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = student1.z;\n      student2.id = student1.id;\n      student1.z = studenta.z;\n      student1.id = studenta.id;\n    } else if (studenta.z > student2.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = studenta.z;\n      student2.id = studenta.id;\n    } else if (studenta.z > student3.z) {\n      student3.z = studenta.z;\n      student3.id = studenta.id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student1.id, student1.z, student2.id,\n         student2.z, student3.id, student3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "24946", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int sbu[3];\n};\nint main() {\n  int n;\n  cin >> n;\n  int i, j = 0, j2 = 0, j3 = 0, min = 0;\n  struct stu stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].name >> stu[i].sbu[0] >> stu[i].sbu[1];\n    stu[i].sbu[2] = stu[i].sbu[0] + stu[i].sbu[1];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] > min) {\n      min = stu[i].sbu[2];\n      j = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j].sbu[2] && stu[i].sbu[2] > min && i != j) {\n      min = stu[i].sbu[2];\n      j2 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j2].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j2].sbu[2] && stu[i].sbu[2] > min &&\n        i != j & i != j2) {\n      min = stu[i].sbu[2];\n      j3 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j3].name, min);\n  return 0;\n}\n"}
{"label": "14", "index": "24947", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int math;\n    int chi;\n    int sum;\n    struct student *next;\n  };\n  int n, i;\n  int max;\n  struct student *p1, *p2, *head;\n  cin >> n;\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1 = (struct student *)malloc(1000);\n    else {\n      p1->next = (struct student *)malloc(1000);\n      p1 = p1->next;\n    }\n    cin >> p1->a >> p1->math >> p1->chi;\n    p1->sum = (p1->math) + (p1->chi);\n  }\n  p1->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    do {\n      p1 = p1->next;\n      if (p1->sum > max) {\n        max = p1->sum;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    printf(\"%d %d \", p2->a, p2->sum);\n    p2->sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int *p1, *p2;\n  p1 = (int *)elem1;\n  p2 = (int *)elem2;\n  return (*p2) - (*p1);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], c[n], d[n], e[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n    d[i] = b[i] + c[i];\n    e[i] = d[i];\n  }\n  qsort(e, n, 4, pfCompare);\n  for (int k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (d[i] == e[k]) {\n        cout << a[i] << \" \" << d[i] << \"\\n\";\n        d[i] = 0;\n        break;\n      }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int YW;\n    int SX;\n  };\n  struct student stu[100000];\n  int ZF[100000];\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].YW);\n    scanf(\"%d\", &stu[i].SX);\n    ZF[i] = stu[i].YW + stu[i].SX;\n  }\n  int a = 0, b = 0, c = 0, A = 0, B = 0, C = 0;\n  for (int i = 0; i < n; i++) {\n    if (ZF[i] > a) {\n      c = b;\n      C = B;\n      b = a;\n      B = A;\n      a = ZF[i];\n      A = i;\n    } else if (ZF[i] > b) {\n      c = b;\n      C = B;\n      b = ZF[i];\n      B = i;\n    } else if (ZF[i] > c) {\n      c = ZF[i];\n      C = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[A].ID, a);\n  printf(\"%d %d\\n\", stu[B].ID, b);\n  printf(\"%d %d\\n\", stu[C].ID, c);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "24950", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "24951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int chinese;\n  int math;\n  int total;\n} st[4], temp;\nint main() {\n  int n, cnt = 3;\n  cin >> n;\n  for (int i = 0; i < 3; i++) {\n    cin >> st[i].ID >> st[i].chinese >> st[i].math;\n    st[i].total = st[i].chinese + st[i].math;\n  }\n  do {\n    cin >> st[3].ID >> st[3].chinese >> st[3].math;\n    st[3].total = st[3].chinese + st[3].math;\n    cnt++;\n    for (int i = 1; i < 4; i++) {\n      for (int j = 0; j < 4 - i; j++) {\n        if (st[j + 1].total > st[j].total) {\n          temp = st[j];\n          st[j] = st[j + 1];\n          st[j + 1] = temp;\n        }\n      }\n    }\n  } while (cnt < n);\n  for (int i = 0; i < 3; i++) {\n    cout << st[i].ID << \" \" << st[i].total << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24952", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct st {\n  int I;\n  int c;\n  int m;\n} st[100000];\n\nint main() {\n\n  int n, i, j, k = 0, a, b;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n\n  {\n\n    scanf(\"%d %d %d\", &st[i].I, &st[i].c, &st[i].m);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (k < st[j].c + st[j].m) {\n        k = st[j].c + st[j].m;\n        a = st[j].I;\n        b = j;\n      }\n    }\n\n    st[b].c = 0;\n    st[b].m = 0;\n\n    printf(\"%d %d\", a, k);\n    if (i < 2)\n      printf(\"\\n\");\n    k = 0;\n  }\n}\n"}
{"label": "14", "index": "24953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int ch;\n    int ma;\n    int sum;\n  };\n  struct student *p;\n  int n, i, j, t1, t2, a1 = 0, a2 = 0, a3 = 0, k1, k2, k3;\n  cin >> n;\n  p = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    cin >> p[i].num >> p[i].ch >> p[i].ma;\n    p[i].sum = p[i].ch + p[i].ma;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].sum > a1) {\n      k1 = i;\n      a1 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a1 && p[i].sum > a2 && i != k1) {\n      k2 = i;\n      a2 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a2 && p[i].sum > a3 && i != k1 && i != k2) {\n      k3 = i;\n      a3 = p[i].sum;\n    }\n  cout << p[k1].num << \" \" << p[k1].sum << \"\\n\"\n       << p[k2].num << \" \" << p[k2].sum << \"\\n\"\n       << p[k3].num << \" \" << p[k3].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "24954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  struct {\n    int No;\n    int Chinese;\n    int Math;\n    int Sum;\n  } student[100000], t;\n  int i, j;\n  for (i = 0; i < num; i++) {\n    cin >> student[i].No >> student[i].Chinese >> student[i].Math;\n    student[i].Sum = student[i].Math + student[i].Chinese;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < num - 1 - i; j++) {\n      if (student[j].Sum >= student[j + 1].Sum) {\n        t = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = t;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[num - i - 1].No, student[num - i - 1].Sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24955", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} student[1000000];\nvoid swap(int *a, int *b);\nint main(int argc, char *argv[]) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i = 0, j = 0, total[1000000];\n  for (i = 0; i < n; i++) {\n    cin >> student[i].xuehao >> student[i].yuwen >> student[i].shuxue;\n    total[i] = student[i].yuwen + student[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0 + i; j--) {\n      if (total[j] > total[j - 1]) {\n        swap(&total[j], &total[j - 1]);\n        swap(&student[j - 1].xuehao, &student[j].xuehao);\n        swap(&student[j - 1].yuwen, &student[j].yuwen);\n        swap(&student[j - 1].shuxue, &student[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].xuehao, total[i]);\n  }\n  return 0;\n}\nvoid swap(int *a, int *b) {\n  int e;\n  e = *a;\n  *a = *b;\n  *b = e;\n}\n"}
{"label": "14", "index": "24956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int a;\n  int b;\n  int c;\n};\n\nint main() {\n  int n, i;\n  int x, y, z;\n\n  struct Student stu;\n  struct Student maxStu, smaxStu, tmaxStu;\n\n  cin >> n;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  stu.number = x;\n  stu.a = y;\n  stu.b = z;\n  stu.c = stu.a + stu.b;\n  maxStu = stu;\n  smaxStu = stu;\n  tmaxStu = stu;\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d%d%d\", &x, &y, &z);\n    stu.number = x;\n    stu.a = y;\n    stu.b = z;\n    stu.c = stu.a + stu.b;\n    if (stu.c > maxStu.c) {\n      if (maxStu.c > smaxStu.c) {\n        if (smaxStu.c > tmaxStu.c) {\n          tmaxStu = smaxStu;\n        }\n        smaxStu = maxStu;\n      } else if (maxStu.c > tmaxStu.c) {\n        tmaxStu = maxStu;\n      }\n      maxStu = stu;\n    } else if (stu.c > smaxStu.c) {\n      if (smaxStu.c > tmaxStu.c) {\n        tmaxStu = smaxStu;\n      }\n      smaxStu = stu;\n    } else if (stu.c > tmaxStu.c) {\n      tmaxStu = stu;\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxStu.number, maxStu.c, smaxStu.number,\n         smaxStu.c, tmaxStu.number, tmaxStu.c);\n  return 0;\n}\n"}
{"label": "14", "index": "24957", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Stu {\n  int StuNo;\n  int Chinese;\n  int math;\n  int sum;\n  struct Stu *next;\n};\nint main() {\n  struct Stu *p, *head, *tail;\n  int n, i, max1, max2, max3, n1, n2, n3;\n  scanf(\"%d\", &n);\n  head = tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct Stu *)malloc(1000);\n    cin >> p->StuNo >> p->Chinese >> p->math;\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    p->sum = p->Chinese + p->math;\n  }\n\n  max1 = head->sum;\n  n1 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max1) {\n      max1 = p->sum;\n      n1 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n1)\n      p->sum = 0;\n  }\n\n  max2 = head->sum;\n  n2 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max2) {\n      max2 = p->sum;\n      n2 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n2)\n      p->sum = 0;\n  }\n\n  max3 = head->sum;\n  n3 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max3) {\n      max3 = p->sum;\n      n3 = i;\n    }\n  }\n  printf(\"%d %d %d %d %d %d \", n1, max1, n2, max2, n3, max3);\n}\n"}
{"label": "14", "index": "24958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student s[3], p, temp;\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].yuwen, &s[i].shuxue);\n    s[i].zongfen = s[i].shuxue + s[i].yuwen;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < 2 - i; j++) {\n      if (s[j].zongfen < s[j + 1].zongfen)\n        temp = s[j], s[j] = s[j + 1], s[j + 1] = temp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &p.num, &p.yuwen, &p.shuxue);\n    p.zongfen = p.shuxue + p.yuwen;\n    if (p.zongfen > s[2].zongfen && p.zongfen <= s[1].zongfen)\n      s[2] = p;\n    else if (p.zongfen > s[1].zongfen && p.zongfen <= s[0].zongfen)\n      s[2] = s[1], s[1] = p;\n    else if (p.zongfen > s[0].zongfen)\n      s[2] = s[1], s[1] = s[0], s[0] = p;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].num, s[0].zongfen, s[1].num, s[1].zongfen,\n         s[2].num, s[2].zongfen);\n}\n"}
{"label": "14", "index": "24959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct mark {\n  int num;\n  int ch;\n  int math;\n  int sum;\n} stu[100000];\nint main(char *argv[]) {\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].ch, &stu[i].math);\n    stu[i].sum = stu[i].math + stu[i].ch;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].num, stu[n - 1].sum,\n         stu[n - 2].num, stu[n - 2].sum, stu[n - 3].num, stu[n - 3].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, math, chinese, std_num;\n  int first, second, third;\n  int score[3] = {-1, -1, -1};\n  scanf(\"%d\", &n);\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    cin >> std_num;\n    scanf(\"%d\", &chinese);\n    scanf(\"%d\", &math);\n    if (chinese + math > score[0]) {\n      third = second;\n      second = first;\n      score[2] = score[1];\n      score[1] = score[0];\n      first = std_num;\n      score[0] = chinese + math;\n    } else if (chinese + math > score[1]) {\n      third = second;\n      score[2] = score[1];\n      second = std_num;\n      score[1] = math + chinese;\n    } else if (chinese + math > score[2]) {\n      third = std_num;\n      score[2] = math + chinese;\n    }\n  }\n  cout << first << \" \" << score[0] << \"\\n\";\n  printf(\"%d %d\\n\", second, score[1]);\n  cout << third << \" \" << score[2] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000];\n  struct student s[3];\n  struct student k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", a[i].num, &a[i].yuwen, &a[i].shuxue);\n    a[i].sum = a[i].yuwen + a[i].shuxue;\n  }\n  s[0] = a[0];\n  s[1] = a[0];\n  s[1].sum = 0;\n  s[2] = a[0];\n  s[2].sum = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i].sum > s[2].sum && a[i].sum <= s[1].sum) {\n      s[2] = a[i];\n    }\n    if (a[i].sum > s[1].sum && a[i].sum <= s[0].sum) {\n      s[2] = s[1];\n      s[1] = a[i];\n    }\n    if (a[i].sum > s[0].sum) {\n      s[2] = s[1];\n      s[1] = s[0];\n      s[0] = a[i];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << s[i].num << \" \" << s[i].sum << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int id;\n  int cs;\n  int ms;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return ((struct data *)b)->s - ((struct data *)a)->s;\n}\nint main() {\n  struct data *a;\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  a = (struct data *)malloc(n * sizeof(struct data));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].cs, &a[i].ms);\n    a[i].s = a[i].cs + a[i].ms;\n  }\n  qsort(a, n, sizeof(struct data), cmp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", a[i].id, a[i].s);\n  free(a);\n  return 0;\n}\n"}
{"label": "14", "index": "24963", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int maths;\n};\nstruct qiansan {\n  int num;\n  int zongfen;\n} st[3] = {{0, 0}, {0, 0}, {0, 0}};\nint main() {\n  int n, i, k, c[10], j[10];\n  int a[100001];\n  scanf(\"%d\", &n);\n  struct Student std[100001];\n  for (i = 0; i < n; i++) {\n    cin >> std[i].num >> std[i].chinese >> std[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = std[i].chinese + std[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = a[i];\n      st[0].num = std[i].num;\n    } else {\n      if (a[i] <= st[0].zongfen && a[i] > st[1].zongfen) {\n        st[2] = st[1];\n        st[1].zongfen = a[i];\n        st[1].num = std[i].num;\n      } else if (a[i] <= st[1].zongfen && a[i] > st[2].zongfen) {\n        st[2].zongfen = a[i];\n        st[2].num = std[i].num;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24964", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  int t = n;\n  while (n > 1) {\n    if (n == t)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    n--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct student *first, *second, *third;\n  int fir_index, sec_index, thr_index;\n  scanf(\"%d\", &n);\n  struct student *head, *p1;\n  struct student stu;\n  head = creat(n);\n  first = head;\n  second = head;\n  third = head;\n  for (p1 = head; p1->next != NULL; p1 = p1->next) {\n    if (p1->sum > first->sum) {\n      third = second;\n      second = first;\n      first = p1;\n    } else {\n      if (p1->sum > second->sum) {\n        third = second;\n        second = p1;\n      } else if (p1->sum > third->sum) {\n        third = p1;\n      }\n    }\n  }\n  printf(\"%s %d \", first->num, first->sum);\n  printf(\"%s %d \", second->num, second->sum);\n  printf(\"%s %d \", third->num, third->sum);\n}\n"}
{"label": "14", "index": "24965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct grades {\n    int id;\n    int yuwen, shuxue;\n    int zongfen;\n  } grades[100007];\n  int i, n, j, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &grades[i].id, &grades[i].yuwen, &grades[i].shuxue);\n\n    grades[i].zongfen = grades[i].yuwen + grades[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (grades[j].zongfen >= grades[j + 1].zongfen) {\n        t = grades[j].zongfen;\n        grades[j].zongfen = grades[j + 1].zongfen;\n        grades[j + 1].zongfen = t;\n        s = grades[j].id;\n        grades[j].id = grades[j + 1].id;\n        grades[j + 1].id = s;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    printf(\"%d %d\\n\", grades[i].id, grades[i].zongfen);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  float num;\n  float chi, mat, total;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%f %f %f\", &p1->num, &p1->chi, &p1->mat);\n    p1->total = p1->chi + p1->mat;\n    if (i == 0) {\n      head = p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  int n, i, j;\n  float max;\n  struct stu *head, *maxi, *p;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  for (i = 0; i < 3; i++) {\n    p = head;\n    maxi = head;\n    max = head->total;\n    for (j = 0; j < n - 1; j++) {\n      p = p->next;\n      if (p->total > max) {\n        max = p->total;\n        maxi = p;\n      }\n    }\n\n    printf(\"%g %g\\n\", maxi->num, maxi->total);\n    maxi->total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24967", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int chn;\n  int math;\n  int sum;\n};\nint main() {\n  struct stu indi[100000];\n  int n, i, j, rank[3];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &indi[i].id, &indi[i].chn, &indi[i].math);\n    indi[i].sum = indi[i].chn + indi[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    rank[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (indi[j].sum > indi[rank[i]].sum)\n        rank[i] = j;\n    }\n    indi[rank[i]].sum = -indi[rank[i]].sum;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", indi[rank[i]].id, -indi[rank[i]].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24968", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, b, c, d;\n  struct {\n    int sn;\n    int chi;\n    int mat;\n    int sum;\n  } a[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].sn >> a[i].chi >> a[i].mat;\n    a[i].sum = a[i].chi + a[i].mat;\n  }\n  b = n;\n  c = n;\n  d = n;\n  a[n].sum = -100;\n  for (i = 0; i < n; i++) {\n    if (a[b].sum >= a[i].sum)\n      b = b;\n    else\n      b = i;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != b) {\n      if (a[c].sum >= a[i].sum)\n        c = c;\n      else\n        c = i;\n    } else\n      ;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != c & i != b) {\n      if (a[d].sum >= a[i].sum)\n        d = d;\n      else\n        d = i;\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", a[b].sn, a[b].sum);\n  printf(\"%d %d\\n\", a[c].sn, a[c].sum);\n  printf(\"%d %d\\n\", a[d].sn, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24969", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} work[100001];\nvoid qsort(int left, int right) {\n  if (left >= right)\n    return;\n  int pindex = left, rindex = right;\n  work[0] = work[left];\n  while (pindex < rindex) {\n    while ((pindex < rindex) && (work[rindex].sum >= work[0].sum))\n      rindex--;\n    if (pindex < rindex) {\n      work[pindex] = work[rindex];\n      pindex++;\n    }\n    while ((pindex < rindex) && (work[pindex].sum < work[0].sum))\n      pindex++;\n    if (pindex < rindex) {\n      work[rindex] = work[pindex];\n      rindex--;\n    }\n  }\n  work[pindex] = work[0];\n  qsort(left, pindex - 1);\n  qsort(pindex + 1, right);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> work[i].num >> work[i].chinese >> work[i].math;\n    work[i].sum = work[i].chinese + work[i].math;\n  }\n  qsort(1, n);\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", work[n - i].num, work[n - i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "24970", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n};\n\nint main() {\n  int n, i, e = 0, f = 0, g = 0, a = 0, b = 0, c = 0;\n  cin >> n;\n  struct student *stu = (struct student *)malloc(sizeof(int) * 3 * n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chi >> stu[i].math;\n    sz[i] = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > sz[a]) {\n      a = i;\n      e = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", e, sz[a]);\n  for (i = 0; i < n; i++) {\n    if (i == a) {\n      continue;\n    }\n    if (sz[i] > sz[b]) {\n      b = i;\n      f = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", f, sz[b]);\n  for (i = 0; i < n; i++) {\n    if (i == a || i == b) {\n      continue;\n    }\n    if (sz[i] > sz[c]) {\n      c = i;\n      g = stu[i].num;\n    }\n  }\n  printf(\"%d %d\", g, sz[c]);\n  free(sz);\n  return 0;\n}\n"}
{"label": "14", "index": "24971", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "24972", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int s;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int n, i;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->id, &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid exchange(struct student *x, struct student *y) {\n  int t;\n  t = x->id;\n  x->id = y->id;\n  y->id = t;\n  t = x->c;\n  x->c = y->c;\n  y->c = t;\n  t = x->m;\n  x->m = y->m;\n  y->m = t;\n  t = x->s;\n  x->s = y->s;\n  y->s = t;\n}\nint main() {\n  struct student *p, *q, *head;\n  int temp, i;\n  head = p = creat();\n  for (p = head, i = 0; p->next != NULL, i < 3; p = p->next, i++) {\n    temp = p->s;\n    for (q = p->next; q != NULL; q = q->next) {\n      if (p->s < q->s)\n        temp = q->s;\n      if (p->s != temp)\n        exchange(p, q);\n    }\n  }\n  for (p = head, i = 0; i < 3; p = p->next, i++)\n    printf(\"%d %d \", p->id, p->s);\n  return 0;\n}\n"}
{"label": "14", "index": "24973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yuwen;\n    int math;\n    int zong;\n  };\n  struct student stu[100000];\n  struct student *p, *p1, *p2, *p3, *p4;\n  int n;\n  scanf(\"%d\", &n);\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d\", &p->num);\n    scanf(\"%d\", &p->yuwen);\n    scanf(\"%d\", &p->math);\n  }\n  for (p = stu; p < stu + n; p++) {\n    (p->zong) = (p->yuwen) + (p->math);\n  }\n  p1 = &stu[0];\n  p2 = &stu[1];\n  p3 = &stu[2];\n  p4 = p1;\n  if (p2->zong > p1->zong) {\n    p4 = p1;\n    p1 = p2;\n    p2 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p1->zong) {\n    p4 = p1;\n    p1 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p2->zong) {\n    p4 = p2;\n    p2 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n\n  for (p = stu + 3; p < stu + n; p++) {\n    if ((p->zong) > (p1->zong)) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->zong > p2->zong) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->zong > p3->zong) {\n      p3 = p;\n    } else\n      p1 = p1;\n  }\n  printf(\"%d %d\\n\", p1->num, p1->zong);\n  printf(\"%d %d\\n\", p2->num, p2->zong);\n  printf(\"%d %d\", p3->num, p3->zong);\n  return 0;\n}\n"}
{"label": "14", "index": "24974", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> n;\n  scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  for (; p1->id < n;) {\n    if (p1->id == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2, *p3, *p;\n  head = creat();\n  for (p = head, p1 = head, p2 = head, p3 = head; p != NULL; p = p->next) {\n    if (p->sum > p1->sum) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->sum > p2->sum) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->sum > p3->sum) {\n      p3 = p;\n    }\n  }\n  printf(\"%d %d \", p1->id, p1->sum);\n  printf(\"%d %d \", p2->id, p2->sum);\n  printf(\"%d %d \", p3->id, p3->sum);\n}\n"}
{"label": "14", "index": "24975", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int Num;\n  int scoreC;\n  int scoreM;\n  int all;\n};\nstruct stu stu[100005];\nvoid fsort(int first, int last) {\n  int chosen1, chosen2, p, q;\n  if (first >= last) {\n    return;\n  }\n  chosen1 = stu[first].all;\n  chosen2 = stu[first].Num;\n  p = first;\n  q = last;\n  while (p < q) {\n    while ((p < q) && (stu[q].all >= chosen1)) {\n      q--;\n    }\n    if (p < q) {\n      stu[p].all = stu[q].all;\n      stu[p].Num = stu[q].Num;\n      p++;\n    }\n    while ((p < q) && (stu[p].all < chosen1)) {\n      p++;\n    }\n    if (p < q) {\n      stu[q].all = stu[p].all;\n      stu[q].Num = stu[p].Num;\n      q--;\n    }\n  }\n  stu[p].all = chosen1;\n  stu[p].Num = chosen2;\n  fsort(first, p - 1);\n  fsort(p + 1, last);\n}\nint main() {\n  int m, i; \n  cin >> m;\n  for (i = 1; i <= m; i++) \n  {\n    cin >> stu[i].Num >> stu[i].scoreC >> stu[i].scoreM;\n    stu[i].all = stu[i].scoreC + stu[i].scoreM;\n  }\n  fsort(1, m);\n  cout << stu[m].Num << \" \" << stu[m].all << endl; \n  cout << stu[m - 1].Num << \" \" << stu[m - 1].all << endl;\n  cout << stu[m - 2].Num << \" \" << stu[m - 2].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24976", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[99999], b[99999], c[99999], d[99999];\n  int i, n, sum, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n    d[i] = c[i] + b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n\n  for (i = 0; i < n - 2; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a[n], d[n], a[n - 1], d[n - 1], a[n - 2],\n         d[n - 2]);\n  return 0;\n}\n"}
{"label": "14", "index": "24977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  int a[99999][3], s[99999];\n  int fir = 0, sec = 0, thi = 0;\n  int c = 0, d = 0, e = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 3; k++)\n      scanf(\"%d\", &a[i][k]);\n\n    s[i] = a[i][1] + a[i][2];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] > fir) {\n      thi = sec;\n      sec = fir;\n      fir = s[i];\n      e = d;\n      d = c;\n      c = i;\n      continue;\n    }\n    if (s[i] > sec && s[i] <= fir) {\n      thi = sec;\n\n      sec = s[i];\n      e = d;\n      d = i;\n      continue;\n    }\n    if (s[i] > thi && s[i] <= sec) {\n      thi = s[i];\n      e = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a[c][0], fir);\n  printf(\"%d %d\\n\", a[d][0], sec);\n  printf(\"%d %d\\n\", a[e][0], thi);\n  return 0;\n}\n"}
{"label": "14", "index": "24978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int stuno;\n    int score1;\n    int score2;\n    int score0;\n  };\n  int n, i, j, temp;\n  cin >> n;\n  struct student num[n];\n  for (i = 0; i < n; i++) {\n    cin >> num[i].stuno;\n    cin >> num[i].score1;\n    cin >> num[i].score2;\n    num[i].score0 = num[i].score1 + num[i].score2;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i].score0 < num[j].score0) {\n        temp = num[i].score0;\n        num[i].score0 = num[j].score0;\n        num[j].score0 = temp;\n        temp = num[i].stuno;\n        num[i].stuno = num[j].stuno;\n        num[j].stuno = temp;\n      }\n  for (i = 0; i < 3 && i < n; i++)\n    cout << num[i].stuno << \" \" << num[i].score0 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chin;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i, tem, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int max[3] = {0};\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[max[0]].sum) {\n      tem = max[0];\n      temp = max[1];\n      max[0] = i;\n      max[1] = tem;\n      max[2] = temp;\n    } else {\n      if (stu[i].sum > stu[max[1]].sum) {\n        tem = max[1];\n        max[1] = i;\n        max[2] = tem;\n      } else {\n        if (stu[i].sum > stu[max[2]].sum)\n          max[2] = i;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++)\n    cout << stu[max[i]].id << \" \" << stu[max[i]].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "24980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nvoid fun(int *a, int *b);\nint main() {\n  int n, i, j;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  struct Student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (sum[j] > sum[j - 1]) {\n        fun(&sum[j], &sum[j - 1]);\n        fun(&stu[j - 1].num, &stu[j].num);\n        fun(&stu[j - 1].yuwen, &stu[j].yuwen);\n        fun(&stu[j - 1].shuxue, &stu[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, sum[i]);\n  return 0;\n}\nvoid fun(int *a, int *b) {\n  int k;\n  k = *a;\n  *a = *b;\n  *b = k;\n}\n"}
{"label": "14", "index": "24981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int yu;\n    int shu;\n    char name[6];\n  };\n  struct stu s[100000], one, two, three;\n  one.yu = 0;\n  one.shu = 0;\n  two.yu = 0;\n  two.shu = 0;\n  three.yu = 0;\n  three.shu = 0;\n  int n, j, k;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%s %d %d\", s[j].name, &s[j].yu, &s[j].shu);\n  }\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (one.yu + one.shu)) {\n      one = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (two.yu + two.shu)) {\n      two = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (three.yu + three.shu))\n      three = s[j];\n  }\n  cout << one.name << \" \" << one.yu + one.shu << \"\\n\"\n       << two.name << \" \" << two.yu + two.shu << \"\\n\"\n       << three.name << \" \" << three.yu + three.shu << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "24982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j;\n  struct student stu[100000];\n  struct student stud;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].sum < stu[j].sum) {\n        stud = stu[i];\n        stu[i] = stu[j];\n        stu[j] = stud;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "24983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n} sdu[99999];\n\nint main() {\n  int N, i, j, s, t, m;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++)\n    scanf(\"%d%d%d\", &sdu[i].num, &sdu[i].chinese, &sdu[i].math);\n\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < N - j - 1; i++)\n      if ((sdu[i].chinese + sdu[i].math) >=\n          (sdu[i + 1].chinese + sdu[i + 1].math)) {\n        s = sdu[i].num;\n        t = sdu[i].chinese;\n        m = sdu[i].math;\n        sdu[i].num = sdu[i + 1].num;\n        sdu[i].chinese = sdu[i + 1].chinese;\n        sdu[i].math = sdu[i + 1].math;\n        sdu[i + 1].num = s;\n        sdu[i + 1].chinese = t;\n        sdu[i + 1].math = m;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", sdu[N - 1 - i].num,\n           sdu[N - 1 - i].chinese + sdu[N - 1 - i].math);\n}\n"}
{"label": "14", "index": "24984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student { \n    int id;\n    int cp;\n    int mp;\n    int tp;\n  } stu[n], temp;\n  for (i = 0; i < n; i++) { \n    cin >> stu[i].id >> stu[i].cp >> stu[i].mp;\n    stu[i].tp = stu[i].cp + stu[i].mp;\n  }\n  for (i = 0; i < 3; i++) \n    for (j = n - 1; j > i; j--)\n      if (stu[j].tp > stu[j - 1].tp) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++) \n    cout << stu[i].id << ' ' << stu[i].tp << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "24985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nint main() {\n  int n, m, i, j, t, k;\n  scanf(\"%d\", &n);\n  m = n;\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  int *score = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    score[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (score[j] >= score[j + 1]) {\n        t = score[j];\n        score[j] = score[j + 1];\n        score[j + 1] = t;\n        k = stu[j].num;\n        stu[j].num = stu[j + 1].num;\n        stu[j + 1].num = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].num, score[i]);\n  }\n  free(stu);\n  free(score);\n  return 0;\n}\n"}
{"label": "14", "index": "24986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long int ID;\n  int math;\n  int chinese;\n  int add;\n} stu[100000];\nint main() {\n  long int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n    stu[i].add = stu[i].math + stu[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].add < stu[j].add) {\n        int t = stu[i].add;\n        stu[i].add = stu[j].add;\n        stu[j].add = t;\n        long int m = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = m;\n      }\n    }\n    cout << stu[i].ID << \" \" << stu[i].add << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct st {\n    int id;\n    int yu;\n    int ma;\n  };\n  int n, i;\n  struct st st1 = {0, 0, 0}, st2 = {0, 0, 0}, st3 = {0, 0, 0}, stn;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stn.id, &stn.yu, &stn.ma);\n    if (stn.yu + stn.ma > st1.yu + st1.ma) {\n      st3 = st2;\n      st2 = st1;\n      st1 = stn;\n    } else {\n      if (stn.yu + stn.ma > st2.yu + st2.ma) {\n        st3 = st2;\n        st2 = stn;\n      } else {\n        if (stn.yu + stn.ma > st3.yu + st3.ma) {\n          st3 = stn;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", st1.id, st1.yu + st1.ma, st2.id,\n         st2.yu + st2.ma, st3.id, st3.yu + st3.ma);\n}\n"}
{"label": "14", "index": "24988", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, max;\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct stu *next;\n  };\n  struct stu *p1, *p2, *head;\n  cin >> n;\n  p2 = head = p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n  }\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    max = 0;\n    for (i = 0; i < n; i++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (max == p1->zf) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "24989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int shu;\n  int yu;\n  int he;\n};\nstruct stu stu[100000];\nint main() {\n  int n, i, max, sec, th;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].shu, &stu[i].yu);\n    stu[i].he = stu[i].shu + stu[i].yu;\n  }\n  max = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[max].he < stu[i + 1].he)\n      max = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[max].id, stu[max].he);\n  stu[max].he = 0;\n  sec = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[sec].he < stu[i + 1].he)\n      sec = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[sec].id, stu[sec].he);\n  stu[sec].he = 0;\n  th = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[th].he < stu[i + 1].he)\n      th = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[th].id, stu[th].he);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "24990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int diyi, dier, disan;\n  diyi = 0;\n  dier = 0;\n  disan = 0;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[99999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[diyi].sum)\n      diyi = i;\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi) {\n      dier = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi) {\n      if (stu[i].sum > stu[dier].sum) {\n        dier = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi && i != dier) {\n      disan = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi && i != dier) {\n      if (stu[i].sum > stu[disan].sum) {\n        disan = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", diyi + 1, stu[diyi].sum);\n  cout << dier + 1 << \" \" << stu[dier].sum << \"\\n\";\n  printf(\"%d %d\\n\", disan + 1, stu[disan].sum);\n}\n"}
{"label": "14", "index": "24991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int n, i, sum[100000], temp[3], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 0, max = -1, temp[0] = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      temp[0] = i;\n    }\n  }\n  for (i = 0, max = -1, temp[1] = 0; i < n; i++) {\n    if (i == temp[0])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[1] = i;\n      }\n    }\n  }\n  for (i = 0, max = -1, temp[2] = 0; i < n; i++) {\n    if (i == temp[0] || i == temp[1])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[2] = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[temp[0]].id, sum[temp[0]]);\n  cout << stu[temp[1]].id << \" \" << sum[temp[1]] << \"\\n\";\n  printf(\"%d %d\", stu[temp[2]].id, sum[temp[2]]);\n  return 0;\n}\n"}
{"label": "14", "index": "24992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  scanf(\"%d \", &n);\n  struct stu {\n    int xuehao[100000];\n    int yuwen[100000];\n    int shuxue[100000];\n    int zongfen[100000];\n  } a;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a.xuehao[i]);\n    cin >> a.yuwen[i];\n    cin >> a.shuxue[i];\n    a.zongfen[i] = a.shuxue[i] + a.yuwen[i];\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = i; j >= 1; j--)\n      if (a.zongfen[j] > a.zongfen[j - 1]) {\n        temp = a.zongfen[j - 1];\n        a.zongfen[j - 1] = a.zongfen[j];\n        a.zongfen[j] = temp;\n        temp = a.xuehao[j - 1];\n        a.xuehao[j - 1] = a.xuehao[j];\n        a.xuehao[j] = temp;\n      }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a.xuehao[i], a.zongfen[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "24993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score_1;\n    int score_2;\n    int sum;\n  };\n  struct student stu[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score_1, &stu[i].score_2);\n    stu[i].sum = stu[i].score_1 + stu[i].score_2;\n  }\n  for (j = 0; j <= 2; j++) {\n    for (i = n - 1; i > 0 + j; i--)\n      if (stu[i].sum > stu[i - 1].sum) {\n        t = stu[i].sum, stu[i].sum = stu[i - 1].sum, stu[i - 1].sum = t;\n        t = stu[i].num, stu[i].num = stu[i - 1].num, stu[i - 1].num = t;\n      }\n  }\n  for (i = 0; i <= 2; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "24994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[99999], b[99999], c[99999], d[99999];\n  int i, n, sum, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n    d[i] = c[i] + b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n\n  for (i = 0; i < n - 2; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  cout << a[n] << \" \" << d[n] << \"\\n\"\n       << a[n - 1] << \" \" << d[n - 1] << \"\\n\"\n       << a[n - 2] << \" \" << d[n - 2];\n  return 0;\n}\n"}
{"label": "14", "index": "24995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m;\n  int a, b, c;\n  int j, k, v;\n  int sum[100000];\n  int max1 = 0, max2 = 0, max3 = 0;\n  int A[100000][1];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &m, &A[i][0], &A[i][1]);\n    sum[i] = A[i][0] + A[i][1];\n  }\n  for (j = 1; j <= n; j++) {\n    if (sum[j] > max1) {\n      max1 = sum[j];\n      a = j;\n    }\n  }\n  for (k = 1; k <= n; k++) {\n\n    if (sum[k] > max2 && k != a) {\n      max2 = sum[k];\n      b = k;\n    }\n  }\n  for (v = 1; v <= n; v++) {\n    if (sum[v] < max2) {\n      if (sum[v] > max3) {\n        max3 = sum[v];\n        c = v;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", a, max1);\n  cout << b << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\", c, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "24996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int diyi, dier, disan;\n  diyi = 0;\n  dier = 0;\n  disan = 0;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[99999];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[diyi].sum) {\n      diyi = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi) {\n      dier = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi) {\n      if (stu[i].sum > stu[dier].sum) {\n        dier = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi && i != dier) {\n      disan = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi && i != dier) {\n      if (stu[i].sum > stu[disan].sum) {\n        disan = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", diyi + 1, stu[diyi].sum);\n  cout << dier + 1 << \" \" << stu[dier].sum << \"\\n\";\n  printf(\"%d %d\\n\", disan + 1, stu[disan].sum);\n}\n"}
{"label": "14", "index": "24997", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } m[4], t;\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= 3; i++)\n    m[i].sum = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &t.num, &t.chinese, &t.math);\n    t.sum = t.chinese + t.math;\n    if (t.sum > m[1].sum) {\n      m[3] = m[2];\n      m[2] = m[1];\n      m[1] = t;\n    } else if (t.sum > m[2].sum) {\n      m[3] = m[2];\n      m[2] = t;\n    } else if (t.sum > m[3].sum)\n      m[3] = t;\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", m[i].num, m[i].sum);\n}\n"}
{"label": "14", "index": "24998", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\n\nint main() {\n  int n, s[100000];\n  scanf(\"%d \", &n);\n  int i, j, max = 0, t;\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chinese, &a[i].math);\n    s[i] = a[i].chinese + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j] > max) {\n        max = s[j];\n        t = j;\n      }\n    }\n    printf(\"%d %d\\n\", a[t].num, max);\n    max = 0;\n    s[t] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "24999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nlong int n;\nstruct stu {\n  long int num, chi, mat, tot;\n};\nint comp(const void *a, const void *b) {\n  return ((struct stu *)b)->tot - ((struct stu *)a)->tot;\n}\nstruct stu a[100000], b;\nint main() {\n  int i, j;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chi, &a[i].mat);\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  qsort(a, n, sizeof(struct stu), comp);\n  for (i = 0; i < 3; i++)\n    cout << a[i].num << \" \" << a[i].tot << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct point {\n  int id, a, b, c;\n} s[100000], tmp;\nint main(int argc, char *argv[]) {\n\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &s[i].a, &s[i].b);\n    s[i].c = s[i].a + s[i].b;\n  }\n  for (i = 1; i < n; i++) {\n    if (s[i].c > s[0].c) {\n      tmp = s[0];\n      s[0] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (s[i].c > s[1].c) {\n      tmp = s[1];\n      s[1] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].c > s[2].c) {\n      tmp = s[2];\n      s[2] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", s[i].id, s[i].c);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  struct student {\n    int id;\n    int chinese;\n    int math;\n    int total;\n  };\n\n  long int n;\n  int temp;\n  int max = 0, max_1 = 0, max_2 = 0;\n  struct student *p, *p_ori, *p_end, *q;\n  struct student *p_max, *p_max_1, *p_max_2;\n\n  scanf(\"%ld\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  p_ori = p;\n  p_end = p + n;\n\n  for (; p < p_end; p++) {\n    scanf(\"%d\", &(p->id));\n    scanf(\"%d\", &(p->chinese));\n    scanf(\"%d\", &(p->math));\n    p->total = p->chinese + p->math;\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max) {\n      max = p->total;\n      p_max = p;\n    }\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_1 && p != p_max) {\n      max_1 = p->total;\n      p_max_1 = p;\n    }\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_2 && p != p_max && p != p_max_1) {\n      max_2 = p->total;\n      p_max_2 = p;\n    }\n  }\n\n  cout << p_max->id << \" \" << p_max->total << \"\\n\";\n  printf(\"%d %d\\n\", p_max_1->id, p_max_1->total);\n  printf(\"%d %d\\n\", p_max_2->id, p_max_2->total);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n};\nint main() {\n  int n, i, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  struct student a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].yw, &a[i].sx);\n    b[i] = a[i].yw + a[i].sx;\n  }\n  for (i = 1; i < n; i++) {\n    if (b[x] < b[i])\n      x = i;\n  }\n  printf(\"%d %d\\n\", a[x].num, b[x]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (b[y] < b[i])\n      y = i;\n  }\n  cout << a[y].num << \" \" << b[y] << \"\\n\";\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (i == y)\n      continue;\n    if (b[z] < b[i])\n      z = i;\n  }\n  printf(\"%d %d\\n\", a[z].num, b[z]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25003", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    long num, c, m, d;\n    struct stu *next;\n  };\n  long n, i, f;\n  struct stu *head, *p1, *p2;\n  scanf(\"%ld \", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld%ld%ld\", &p1->num, &p1->c, &p1->m);\n    p1->d = p1->c + p1->m;\n    if (i == 1) {\n      p1->next = 0;\n      head = p1;\n    } else {\n      if (i <= 3)\n        f = 1;\n      else {\n        p2 = head->next->next;\n        if (p1->d > p2->d)\n          f = 1;\n        else\n          f = 0;\n      }\n      if (f == 1) {\n        p2 = head;\n        if (p2->d < p1->d) {\n          p1->next = p2;\n          head = p1;\n        } else {\n          while ((p2->next != 0) && (p2->next->d > p1->d))\n            p2 = p2->next;\n          p1->next = p2->next;\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    printf(\"%ld %ld \", p1->num, p1->d);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25004", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n  struct Student *next;\n};\n\nint main() {\n  int i = 0, n, max;\n\n  struct Student *linkHead, *linkTail, *student, *ppre, *pmax, *premax;\n\n  scanf(\"%d\", &n);\n\n  linkHead = linkTail = NULL;\n  \n  while (i < n) {\n    student = (struct Student *)malloc(1000);\n\n    scanf(\"%d %d %d\", &student->number, &student->math, &student->chinese);\n\n    student->total = student->math + student->chinese;\n\n    student->next = NULL;\n    if (linkTail == NULL)\n      \n      linkHead = linkTail = student;\n    else {\n\n      \n      linkTail->next = student;\n      linkTail = student;\n    }\n\n    i++;\n  }\n\n  i = 0;\n\n  while (i < 3) {\n    student = linkHead;\n    ppre = student;\n\n    max = 0;\n    pmax = linkHead;\n    premax = linkHead;\n\n    while (student != NULL) {\n\n      if (student->total > max) {\n        max = student->total;\n        pmax = student;\n        premax = ppre;\n      }\n      ppre = student;\n      student = student->next;\n    }\n\n    printf(\"%d %d \", pmax->number, pmax->total);\n\n    if (pmax == linkHead) \n      linkHead = student->next;\n    else\n      premax->next =\n          pmax->next; \n\n    i++;\n  }\n}\n"}
{"label": "14", "index": "25005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char num[6];\n  int score[2];\n  int sum;\n} stu[100000];\n\nint main() {\n  long n, i, j, maxi1, maxi2, maxi3;\n  int max1 = 0, max2 = 0, max3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].num);\n    for (j = 0; j < 2; j++)\n      scanf(\"%d\", &stu[i].score[j]);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].score[0] + stu[i].score[1];\n\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max1) {\n      max1 = stu[i].sum;\n      maxi1 = i;\n    }\n  stu[maxi1].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max2) {\n      max2 = stu[i].sum;\n      maxi2 = i;\n    }\n  stu[maxi2].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxi3 = i;\n    }\n  printf(\"%s %d\\n%s %d\\n%s %d\", stu[maxi1].num, max1, stu[maxi2].num, max2,\n         stu[maxi3].num, max3);\n}\n"}
{"label": "14", "index": "25006", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct st {\n    int num;\n    int x;\n    int y;\n    int sum;\n  } a[100000], m1, m2, m3;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].x, &a[i].y);\n    a[i].sum = a[i].x + a[i].y;\n  }\n  m1.sum = 0;\n  m2.sum = 0;\n  m3.sum = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].sum > m1.sum)\n      m1 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m2.sum) && (a[i].sum <= m1.sum) && (a[i].num != m1.num))\n      m2 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m3.sum) && (a[i].sum <= m2.sum) && (a[i].num != m2.num) &&\n        (a[i].num != m1.num)) {\n      m3 = a[i];\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", m1.num, m1.sum, m2.num, m2.sum, m3.num,\n         m3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\nint main() {\n  int i, j, n, a[100000], max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        cout << stu[i].num << \" \" << a[i] << \"\\n\";\n        a[i] = 0;\n        break;\n      }\n  }\n}\n"}
{"label": "14", "index": "25008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, e = 0, max, y;\n  scanf(\"%d\", &n);\n  struct st {\n    int a;\n    int z;\n    int c;\n    int d;\n  } b[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].a, &b[i].z, &b[i].c);\n    b[i].d = b[i].z + b[i].c;\n  }\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (b[j].d > max) {\n        max = b[j].d;\n        y = j;\n      }\n    }\n    cout << b[y].a << \" \" << b[y].d << \"\\n\";\n    e++;\n    b[y].d = 0;\n    if (e == 3)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25009", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int verbal;\n  int math;\n  int sum;\n};\n\nint main() {\n  struct stu *a, t;\n  int n, i, j;\n  scanf(\"%d \", &n);\n  a = (struct stu *)malloc(n * sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].verbal >> a[i].math;\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n; i > j; i--)\n      if (a[i].sum > a[i - 1].sum) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].id, a[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[3], n, c, b, d, g[3], i, temp;\n\n  int j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    g[i] = d;\n    a[i] = b + c;\n  }\n\n  for (i = 0; i < 3 - 1; i++)\n    for (j = 0; j < 3 - 1 - i; j++)\n      if (a[j] < a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n        temp = g[j];\n        g[j] = g[j + 1];\n        g[j + 1] = temp;\n      }\n\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    temp = b + c;\n\n    if (temp <= a[2]) {\n      continue;\n    } else {\n      if (a[1] >= temp) {\n        a[2] = temp;\n        g[2] = d;\n      } else {\n        a[2] = a[1];\n        g[2] = g[1];\n        if (a[0] >= temp) {\n          a[1] = temp;\n          g[1] = d;\n        } else {\n          a[1] = a[0];\n          g[1] = g[0];\n          a[0] = temp;\n          g[0] = d;\n        }\n      }\n    }\n  }\n\n  cout << g[0] << \" \" << a[0] << \"\\n\"\n       << g[1] << \" \" << a[1] << \"\\n\"\n       << g[2] << \" \" << a[2] << \"\\n\";\n}\n"}
{"label": "14", "index": "25011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num, ch, ma, grade;\n  } sum[100000], h, m, t;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &sum[i].num, &sum[i].ch, &sum[i].ma);\n    sum[i].grade = sum[i].ch + sum[i].ma;\n  }\n  h.grade = m.grade = t.grade = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i].grade > h.grade) {\n      t = m;\n      m = h;\n      h = sum[i];\n    } else if (sum[i].grade > m.grade) {\n      t = m;\n      m = sum[i];\n    } else if (sum[i].grade > t.grade)\n      t = sum[i];\n  }\n  cout << h.num << \" \" << h.grade << \"\\n\"\n       << m.num << \" \" << m.grade << \"\\n\"\n       << t.num << \" \" << t.grade << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[3], chinese[100000], math[100000], sum[100000];\n  int m, i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> m >> chinese[i] >> math[i];\n    sum[i] = chinese[i] + math[i];\n  }\n  int largest = 0;\n  for (i = 0; i < 3; i++) {\n    largest = 0;\n    for (int j = 0; j < n; j++)\n      if (sum[j] > largest) {\n        largest = sum[j];\n        num[i] = j;\n      }\n    cout << num[i] + 1 << \" \" << sum[num[i]] << endl;\n    sum[num[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25013", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, i, max_1 = 0, d, t = 0;\nstruct stu {\n  int id;\n  int chi;\n  int ma;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(void) {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  p2 = p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->chi >> p1->ma;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid find(struct stu *head) {\n  while (t < 3) {\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->chi + p1->ma > max_1) {\n        max_1 = p1->chi + p1->ma;\n        d = p1->id;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", d, max_1);\n    t = t + 1;\n    max_1 = 0;\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->id == d) {\n        p1->chi = 0;\n        p1->ma = 0;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n\nint main() {\n  struct stu *head;\n  head = creat();\n  find(head);\n}\n"}
{"label": "14", "index": "25014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int s;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int n, i;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->id, &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid exchange(struct student *x, struct student *y) {\n  int t;\n  t = x->id;\n  x->id = y->id;\n  y->id = t;\n  t = x->c;\n  x->c = y->c;\n  y->c = t;\n  t = x->m;\n  x->m = y->m;\n  y->m = t;\n  t = x->s;\n  x->s = y->s;\n  y->s = t;\n}\nint main() {\n  struct student *p, *q, *head;\n  int temp, i;\n  head = p = creat();\n  for (p = head, i = 0; p->next != NULL, i < 3; p = p->next, i++) {\n    temp = p->s;\n    for (q = p->next; q != NULL; q = q->next) {\n      if (p->s < q->s)\n        temp = q->s;\n      if (p->s != temp)\n        exchange(p, q);\n    }\n  }\n  for (p = head, i = 0; i < 3; p = p->next, i++)\n    printf(\"%d %d \", p->id, p->s);\n}\n"}
{"label": "14", "index": "25015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num, yuwen, shuxue, sum;\n};\n\nint main() {\n  int n, max1 = 0, max2 = 0, max3 = 0, stu1 = 0, stu2 = 0, stu3 = 0;\n  struct Student student[100000], *stu;\n  scanf(\"%d\", &n);\n\n  for (stu = student; stu < student + n; stu++) {\n    scanf(\"%d\", &stu->num);\n    scanf(\"%d\", &stu->yuwen);\n    cin >> stu->shuxue;\n    (stu->sum) = (stu->yuwen) + (stu->shuxue);\n    if (stu->sum >= max3) {\n      if (stu->sum >= max2) {\n        if (stu->sum >= max1) {\n          if (stu->sum > max1) {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu1;\n            stu1 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          }\n        } else {\n          if (stu->sum > max2) {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu->num;\n          }\n        }\n      } else {\n        if (stu->sum > max3) {\n          max3 = stu->sum;\n          stu3 = stu->num;\n        } else\n          max3 = stu->sum;\n      }\n    }\n  }\n  stu = student;\n  printf(\"%d %d\\n\", (stu + stu1 - 1)->num, (stu + stu1 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu2 - 1)->num, (stu + stu2 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu3 - 1)->num, (stu + stu3 - 1)->sum);\n}\n"}
{"label": "14", "index": "25016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int zong;\n} stu[100001];\n\nint main(int argc, char *argv[]) {\n  int i, n, max1 = 0, max2 = 0, max3 = 0, fir, sec, thi;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yw, &stu[i].sx);\n    stu[i].zong = stu[i].yw + stu[i].sx;\n    if (stu[i].zong > max1) {\n      max3 = max2;\n      thi = sec;\n      max2 = max1;\n      sec = fir;\n      max1 = stu[i].zong;\n      fir = i;\n    } else if (stu[i].zong > max2) {\n      max3 = max2;\n      thi = sec;\n      max2 = stu[i].zong;\n      sec = i;\n    } else if (stu[i].zong > max3) {\n      max3 = stu[i].zong;\n      thi = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[fir].num, stu[fir].zong);\n  cout << stu[sec].num << \" \" << stu[sec].zong << \"\\n\";\n  printf(\"%d %d\\n\", stu[thi].num, stu[thi].zong);\n  return 0;\n}\n"}
{"label": "14", "index": "25017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nstruct student stu[100000];\nint sum[100000];\nint main(int argc, char *argv[]) {\n\n  int a, b, c, num1, num2, num3;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].math;\n  }\n  a = sum[0];\n  num1 = 1;\n  if (a < sum[1]) {\n    b = a;\n    num2 = num1;\n    a = sum[1];\n    num1 = 2;\n  } else {\n    b = sum[1];\n    num2 = 2;\n  }\n  c = 0;\n  for (i = 2; i < n; i++) {\n    if (a < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = a;\n      num2 = num1;\n      a = sum[i];\n      num1 = i + 1;\n    } else if (b < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = sum[i];\n      num2 = i + 1;\n    } else if (c < sum[i]) {\n      c = sum[i];\n      num3 = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", num1, a);\n  cout << num2 << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", num3, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25018", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int verbal;\n  int math;\n  int sum;\n};\n\nint main() {\n  struct stu *a, t;\n  int n, i, j;\n  cin >> n;\n  a = (struct stu *)malloc(n * sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].verbal >> a[i].math;\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n; i > j; i--)\n      if (a[i].sum > a[i - 1].sum) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].id, a[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int score_1;\n    int score_2;\n    int sum;\n  };\n  struct student stu[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score_1 >> stu[i].score_2;\n    stu[i].sum = stu[i].score_1 + stu[i].score_2;\n  }\n  for (j = 0; j <= 2; j++) {\n    for (i = n - 1; i > 0 + j; i--)\n      if (stu[i].sum > stu[i - 1].sum) {\n        t = stu[i].sum, stu[i].sum = stu[i - 1].sum, stu[i - 1].sum = t;\n        t = stu[i].num, stu[i].num = stu[i - 1].num, stu[i - 1].num = t;\n      }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "25020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[6];\n  int score[2];\n  int sum;\n} stu[100000];\n\nint main() {\n  long n, i, j, maxi1, maxi2, maxi3;\n  int max1 = 0, max2 = 0, max3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    for (j = 0; j < 2; j++)\n      scanf(\"%d\", &stu[i].score[j]);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].score[0] + stu[i].score[1];\n\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max1) {\n      max1 = stu[i].sum;\n      maxi1 = i;\n    }\n  stu[maxi1].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max2) {\n      max2 = stu[i].sum;\n      maxi2 = i;\n    }\n  stu[maxi2].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxi3 = i;\n    }\n  cout << stu[maxi1].num << \" \" << max1 << \"\\n\"\n       << stu[maxi2].num << \" \" << max2 << \"\\n\"\n       << stu[maxi3].num << \" \" << max3;\n}\n"}
{"label": "14", "index": "25021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct {\n  int x;\n  int y;\n  int s;\n  int z;\n} a[100010], t;\n\nint main() {\n\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].x, &a[i].y, &a[i].s);\n    a[i].z = a[i].y + a[i].s;\n  }\n  for (i = 0; i <= 2; i++)\n    for (j = n - 1; j >= i; j--) {\n      if (a[j + 1].z > a[j].z) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  printf(\"%d %d\\n\", a[0].x, a[0].z);\n  cout << a[1].x << \" \" << a[1].z << \"\\n\";\n  printf(\"%d %d\\n\", a[2].x, a[2].z);\n  return 0;\n}\n"}
{"label": "14", "index": "25022", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct st {\n    int num;\n    int x;\n    int y;\n    int sum;\n  } a[100000], m1, m2, m3;\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].x, &a[i].y);\n    a[i].sum = a[i].x + a[i].y;\n  }\n  m1.sum = 0;\n  m2.sum = 0;\n  m3.sum = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].sum > m1.sum)\n      m1 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m2.sum) && (a[i].sum <= m1.sum) && (a[i].num != m1.num))\n      m2 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m3.sum) && (a[i].sum <= m2.sum) && (a[i].num != m2.num) &&\n        (a[i].num != m1.num)) {\n      m3 = a[i];\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", m1.num, m1.sum, m2.num, m2.sum, m3.num,\n         m3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yw;\n  int sx;\n  int zf;\n} s1, s2, s3, s;\nint main() {\n\n  int n, i;\n  s1.zf = s2.zf = s3.zf = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.yw, &s.sx);\n    s.zf = s.yw + s.sx;\n    if (s.zf > s1.zf) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.zf > s2.zf) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.zf > s3.zf) {\n      s3 = s;\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.num, s1.zf);\n  printf(\"%d %d\\n\", s2.num, s2.zf);\n  printf(\"%d %d\", s3.num, s3.zf);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Stu {\n  int StuNo;\n  int Chinese;\n  int math;\n  int sum;\n  struct Stu *next;\n};\nint main() {\n  struct Stu *p, *head, *tail;\n  int n, i, max1, max2, max3, n1, n2, n3;\n  scanf(\"%d\", &n);\n  head = tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct Stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p->StuNo, &p->Chinese, &p->math);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    p->sum = p->Chinese + p->math;\n  }\n\n  max1 = head->sum;\n  n1 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else {\n      p = p->next;\n    }\n    if ((p->sum) > max1) {\n      max1 = p->sum;\n      n1 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n1)\n      p->sum = 0;\n  }\n\n  max2 = head->sum;\n  n2 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max2) {\n      max2 = p->sum;\n      n2 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n2)\n      p->sum = 0;\n  }\n\n  max3 = head->sum;\n  n3 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max3) {\n      max3 = p->sum;\n      n3 = i;\n    }\n  }\n  cout << n1 << \" \" << max1 << \" \" << n2 << \" \" << max2 << \" \" << n3 << \" \"\n       << max3 << \" \";\n}\n"}
{"label": "14", "index": "25025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int china;\n  int math;\n  int total;\n} stu[1000], temp;\nint main() {\n  int n, i, j, count;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].china >> stu[i].math;\n    stu[i].total = stu[i].china + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    temp = stu[i];\n    count = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > temp.total) {\n        temp = stu[j];\n        count = j;\n      }\n    }\n    stu[count] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", stu[i].id, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yu;\n  int shu;\n  int tol;\n  struct stu *next;\n};\nint n;\n\nstruct stu *creat(void) {\n  struct stu *p1, *p2, *head, *p;\n  int i, k;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->tol = p1->yu + p1->shu;\n  p1->next = 0;\n  head = p1;\n  p = p1;\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 1; i < n; i++) {\n    p = head;\n    p2 = p1;\n    k = 0;\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->tol = p1->yu + p1->shu;\n    while (p != 0 && p->tol >= p1->tol) {\n      p2 = p;\n      p = p->next;\n      k++;\n    }\n    if (k <= 3) {\n      if (p == head) {\n        head = p1;\n        p1->next = p;\n      }\n      if (p == 0) {\n        p2->next = p1;\n        p1->next = 0;\n      }\n      if (p != head && p != 0) {\n        p2->next = p1;\n        p1->next = p;\n      }\n    }\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  return head;\n}\nint main() {\n  struct stu *head, *p;\n  int i = 0;\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  while (i < 3) {\n    cout << p->num << \" \" << p->tol << \"\\n\";\n    i++;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25027", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k[99999];\n\nint x[99999];\nint main() {\n  int n, i, a, b, c, j, r, t, m = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a >> b >> c;\n    k[a - 1] = b + c;\n    x[i] = a;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (r = 0; r < j; r++) {\n      if (k[r] >= k[r + 1]) {\n        t = k[r + 1];\n        k[r + 1] = k[r];\n        k[r] = t;\n        t = x[r + 1];\n        x[r + 1] = x[r];\n        x[r] = t;\n      }\n    }\n    m++;\n    if (m > 3)\n      break;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x[n - 1], k[n - 1], x[n - 2], k[n - 2],\n         x[n - 3], k[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25028", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, y, b, he;\n} a[100003];\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].y, &a[i].b);\n    a[i].he = a[i].y + a[i].b;\n  };\n  ;\n  for (i = 1; i <= 2; i++) {\n    k = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[j].he > a[k].he)\n        k = j;\n    printf(\"%d %d\", a[k].num, a[k].he);\n    printf(\"\\n\");\n    a[k].he = 0;\n  }\n  k = 1;\n  for (j = i + 1; j <= n; j++)\n    if (a[j].he > a[k].he)\n      k = j;\n  printf(\"%d %d\", a[k].num, a[k].he);\n  a[k].he = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n\n  for (i = 0; i < m - 1; i++)\n\n  {\n\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->score1 >> p1->score2;\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    cout << q->num << \" \" << q->sum << \" \";\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "25030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int chinese;\n  int math;\n  int total;\n} st[4], temp;\nint main() {\n  int n, cnt = 3;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < 3; i++) {\n    cin >> st[i].ID >> st[i].chinese >> st[i].math;\n    st[i].total = st[i].chinese + st[i].math;\n  }\n  do {\n    cin >> st[3].ID >> st[3].chinese >> st[3].math;\n    st[3].total = st[3].chinese + st[3].math;\n    cnt++;\n    for (int i = 1; i < 4; i++) {\n      for (int j = 0; j < 4 - i; j++) {\n        if (st[j + 1].total > st[j].total) {\n          temp = st[j];\n          st[j] = st[j + 1];\n          st[j + 1] = temp;\n        }\n      }\n    }\n  } while (cnt < n);\n  for (int i = 0; i < 3; i++)\n    cout << st[i].ID << \" \" << st[i].total << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25031", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int i;\n  int j;\n  int k;\n};\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct student c[n + 10];\n  int m1 = 1, m2 = 1, m3 = 1;\n  for (int m = 1; m <= n; m++) {\n    cin >> c[m].i >> c[m].j >> c[m].k;\n    if ((c[m].j + c[m].k) > (c[m1].j + c[m1].k)) {\n      m3 = m2;\n      m2 = m1;\n      m1 = m;\n    } else if ((c[m].j + c[m].k) > (c[m2].j + c[m2].k)) {\n      m3 = m2;\n      m2 = m;\n    } else if ((c[m].j + c[m].k) > (c[m3].j + c[m3].k))\n      m3 = m;\n  }\n  printf(\"%d %d \", c[m1].i, c[m1].j + c[m1].k);\n  printf(\"%d %d \", c[m2].i, c[m2].j + c[m2].k);\n  printf(\"%d %d \", c[m3].i, c[m3].j + c[m3].k);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct student stu[4] = {0, 0, 0, 0};\n  struct student temp[4] = {0, 0, 0, 0};\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].chinese, &stu[3].maths);\n    stu[3].sum = stu[3].chinese + stu[3].maths;\n    \n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum) {\n      stu[2] = stu[3];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int mark1;\n  int mark2;\n  long int total_mark;\n};\n\nint main(void) {\n  int n, i, j, k, t = 0, max;\n  struct stu *p;\n  struct stu *q;\n  scanf(\"%d\", &n);\n  p = (struct stu *)malloc(1000000 * sizeof(struct stu));\n  q = p;\n  for (i = 0; i < n; i++) {\n    cin >> (p + i)->num >> (p + i)->mark1 >> (p + i)->mark2;\n    (p + i)->total_mark = (p + i)->mark1 + (p + i)->mark2;\n  }\nloop:\n  max = 0;\n  for (j = 0; j < n; j++) {\n    if ((p + j)->total_mark > max)\n      max = (p + j)->total_mark;\n  }\n  for (k = 0; k < n; k++) {\n    if (max == (p + k)->total_mark && k < n) {\n      cout << (p + k)->num << \" \" << (p + k)->total_mark << \"\\n\";\n      t++;\n      (p + k)->total_mark = 0;\n      break;\n    }\n  }\n  if (t < 3)\n    goto loop;\n}\n"}
{"label": "14", "index": "25034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int math;\n    int chi;\n    int sum;\n    struct student *next;\n  };\n  int n, i;\n  int max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1 = (struct student *)malloc(1000);\n    else {\n      p1->next = (struct student *)malloc(1000);\n      p1 = p1->next;\n    }\n    scanf(\"%d%d%d\", &p1->a, &p1->math, &p1->chi);\n    p1->sum = (p1->math) + (p1->chi);\n  }\n  p1->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    do {\n      p1 = p1->next;\n      if (p1->sum > max) {\n        max = p1->sum;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    cout << p2->a << \" \" << p2->sum << \" \";\n    p2->sum = 0;\n  }\n}\n"}
{"label": "14", "index": "25035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a = 0, b = 0, c = 0;\n  int an, bn, cn;\n  int n, i, sum = 0;\n  struct student {\n    int num, ch, math;\n  } students[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &students[i].num, &students[i].ch, &students[i].math);\n    sum = students[i].ch + students[i].math;\n    if (sum > c) {\n      c = sum;\n      cn = i;\n    }\n    if (sum > b) {\n      c = b;\n      cn = bn;\n      b = sum;\n      bn = i;\n    }\n    if (sum > a) {\n      b = a;\n      bn = an;\n      a = sum;\n      an = i;\n    }\n  }\n  printf(\"%d %d\\n\", students[an].num, a);\n  printf(\"%d %d\\n\", students[bn].num, b);\n  printf(\"%d %d\\n\", students[cn].num, c);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25036", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  long int num;\n  int Chinese;\n  int Maths;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student tempt;\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].Chinese, &stu[i].Maths);\n    stu[i].total = stu[i].Chinese + stu[i].Maths;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  if (stu[1].total > stu[0].total) {\n    tempt = stu[0];\n    stu[0] = stu[1];\n    stu[1] = tempt;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  for (i = 3; i < n; i++) {\n    if (stu[i].total > stu[2].total) {\n      stu[2] = stu[i];\n      if (stu[2].total > stu[1].total) {\n        tempt = stu[1];\n        stu[1] = stu[2];\n        stu[2] = tempt;\n        if (stu[1].total > stu[0].total) {\n          tempt = stu[0];\n          stu[0] = stu[1];\n          stu[1] = tempt;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].total);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].total);\n  printf(\"%d %d\\n\", stu[2].num, stu[2].total);\n}\n"}
{"label": "14", "index": "25037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, y, s, z, x, a, b, c, ax, bx, cx;\n  scanf(\"%d\", &n);\n  a = 0;\n  b = 0;\n  c = 0;\n  ax = 0;\n  bx = 0;\n  cx = 0;\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d %d %d\", &x, &y, &s);\n    z = y + s;\n    if (c >= z)\n      continue;\n    else if (b >= z) {\n      c = z;\n      cx = x;\n    } else if (a >= z) {\n      c = b;\n      cx = bx;\n      b = z;\n      bx = x;\n    } else {\n      c = b;\n      cx = bx;\n      b = a;\n      bx = ax;\n      a = z;\n      ax = x;\n    }\n  }\n  printf(\"%d %d\\n\", ax, a);\n  printf(\"%d %d\\n\", bx, b);\n  printf(\"%d %d\\n\", cx, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25038", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int eng;\n  int math;\n  int sum;\n  struct stu *next;\n} * head, *p1, *p2;\nstruct stu *order(int n) {\n  int i, j, t;\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    p2 = p1->next;\n    for (j = i + 1; j < n; j++) {\n      if (p1->sum < p2->sum) {\n        t = p1->id;\n        p1->id = p2->id;\n        p2->id = t;\n        t = p1->sum;\n        p1->sum = p2->sum;\n        p2->sum = t;\n      }\n      p2 = p2->next;\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  p1 = head = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->eng >> p1->math;\n    p1->sum = p1->eng + p1->math;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} a[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chinese, &a[i].math);\n    a[i].total = a[i].chinese + a[i].math;\n  }\n  int max, numm;\n  max = a[1].total;\n  for (int j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (max < a[i].total) {\n        max = a[i].total;\n        numm = i;\n      }\n    }\n    printf(\"%d %d\\n\", numm + 1, max);\n    a[numm].total = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25040", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> n;\n  scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  for (; p1->id < n;) {\n    if (p1->id == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->id >> p1->chinese >> p1->math;\n    p1->sum = p1->chinese + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2, *p3, *p;\n  head = creat();\n  for (p = head, p1 = head, p2 = head, p3 = head; p != NULL; p = p->next) {\n    if (p->sum > p1->sum) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->sum > p2->sum) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->sum > p3->sum) {\n      p3 = p;\n    }\n  }\n  printf(\"%d %d \", p1->id, p1->sum);\n  printf(\"%d %d \", p2->id, p2->sum);\n  printf(\"%d %d \", p3->id, p3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, math, chinese, std_num;\n  int first, second, third;\n  int score[3] = {-1, -1, -1};\n  scanf(\"%d\", &n);\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &std_num);\n    scanf(\"%d\", &chinese);\n    scanf(\"%d\", &math);\n    if (chinese + math > score[0]) {\n      third = second;\n      second = first;\n      score[2] = score[1];\n      score[1] = score[0];\n      first = std_num;\n      score[0] = chinese + math;\n    } else if (chinese + math > score[1]) {\n      third = second;\n      score[2] = score[1];\n      second = std_num;\n      score[1] = math + chinese;\n    } else if (chinese + math > score[2]) {\n      third = std_num;\n      score[2] = math + chinese;\n    }\n  }\n  printf(\"%d %d\\n\", first, score[0]);\n  printf(\"%d %d\\n\", second, score[1]);\n  cout << third << \" \" << score[2] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  };\n  struct student *fig;\n  fig = (struct student *)malloc(sizeof(student) * n);\n  int i, a = 0, b = 0, c = 0, numa = 0, numb = 0, numc = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &(fig + i)->num, &(fig + i)->chi, &(fig + i)->math);\n    (fig + i)->sum = (fig + i)->chi + (fig + i)->math;\n    if ((fig + i)->sum > a) {\n      c = b;\n      numc = numb;\n      b = a;\n      numb = numa;\n      a = (fig + i)->sum;\n      numa = (fig + i)->num;\n    } else if ((fig + i)->sum > b) {\n      c = b;\n      numc = numb;\n      b = (fig + i)->sum;\n      numb = (fig + i)->num;\n    } else if ((fig + i)->sum > c) {\n      c = (fig + i)->sum;\n      numc = (fig + i)->num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", numa, a, numb, b, numc, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25043", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N, i, n[1000], c[1000], m[1000], sum[1000];\n  int x1 = 0, x2 = 0, x3 = 0, y1 = 0, y2 = 0, y3 = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%d%d\", &n[i], &c[i], &m[i]);\n    sum[i] = c[i] + m[i];\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x1) {\n      x1 = sum[i];\n      y1 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x2 && sum[i] <= x1 && i != y1) {\n      x2 = sum[i];\n      y2 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x3 && sum[i] <= x2 && i != y1 && i != y2) {\n      x3 = sum[i];\n      y3 = i;\n    }\n  }\n  printf(\"%d %d %d %d %d %d \", y1 + 1, x1, y2 + 1, x2, y3 + 1, x3);\n  return 0;\n}\n"}
{"label": "14", "index": "25044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int score1;\n  int score2;\n};\nstruct student stu[100000];\nint main() {\n  int n, i, first = 0, second = 0, third = 0, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].number, &stu[i].score1, &stu[i].score2);\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[first] < a[i]) {\n      third = second;\n      second = first;\n      first = i;\n    } else if (a[second] < a[i]) {\n      third = second;\n      second = i;\n    } else if (a[third] < a[i]) {\n      third = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[first].number, a[first],\n         stu[second].number, a[second], stu[third].number, a[third]);\n  return (0);\n}\n"}
{"label": "14", "index": "25045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  struct student *next;\n};\nint n, max0;\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  head = p1;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->maths);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  cin >> p1->num >> p1->chinese >> p1->maths;\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\n\nvoid max(struct student *head, int x, int y) {\n  struct student *p1, *temp, *p2;\n  temp = (struct student *)malloc(sizeof(struct student));\n  temp->chinese = temp->maths = 0;\n  for (p2 = head; p2 != NULL; p2 = p2->next)\n    if (p2->chinese + p2->maths == x)\n      break;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if ((p1->chinese + p1->maths > temp->chinese + temp->maths) &&\n        (p1->chinese + p1->maths != x ||\n         p1->chinese + p1->maths == x && p1->num != p2->num) &&\n        (p1->chinese + p1->maths != y)) {\n      temp->chinese = p1->chinese;\n      temp->maths = p1->maths;\n      temp->num = p1->num;\n    }\n  max0 = temp->chinese + temp->maths;\n  printf(\"%d %d \", temp->num, max0);\n}\nint main() {\n  struct student *head;\n  int max1, max2;\n  cin >> n;\n  head = creat();\n  max(head, 0, 0);\n  max1 = max0;\n  max(head, max1, 0);\n  max2 = max0;\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "25046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int ch;\n  int ma;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu *head;\n  struct stu *p1, *p2, *a, *b, *c, *t;\n  int n, i = 0;\n  a = b = c = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  scanf(\"%d%d%d\", &p1->ID, &p1->ch, &p1->ma);\n  p1->sum = p1->ch + p1->ma;\n  head = NULL;\n  while (i < n - 1) {\n    i++;\n    p1->sum = p1->ch + p1->ma;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (p1->sum > a->sum) {\n      c = b;\n      b = a;\n      a = p2;\n    } else if (p1->sum > b->sum) {\n      c = b;\n      b = p2;\n    } else if (p1->sum > c->sum)\n      c = p2;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->ID, &p1->ch, &p1->ma);\n  }\n  p2->next = NULL;\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->ID, a->sum, b->ID, b->sum, c->ID, c->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int num, yuwen, shuxue, sum;\n};\n\nint main() {\n  int n, max1 = 0, max2 = 0, max3 = 0, stu1 = 0, stu2 = 0, stu3 = 0;\n  struct Student student[100000], *stu;\n  scanf(\"%d\", &n);\n\n  for (stu = student; stu < student + n; stu++) {\n    scanf(\"%d\", &stu->num);\n    scanf(\"%d\", &stu->yuwen);\n    cin >> stu->shuxue;\n    (stu->sum) = (stu->yuwen) + (stu->shuxue);\n    if (stu->sum >= max3) {\n      if (stu->sum >= max2) {\n        if (stu->sum >= max1) {\n          if (stu->sum > max1) {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu1;\n            stu1 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          }\n        } else {\n          if (stu->sum > max2) {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu->num;\n          }\n        }\n      } else {\n        if (stu->sum > max3) {\n          max3 = stu->sum;\n          stu3 = stu->num;\n        } else\n          max3 = stu->sum;\n      }\n    }\n  }\n  stu = student;\n  printf(\"%d %d\\n\", (stu + stu1 - 1)->num, (stu + stu1 - 1)->sum);\n  cout << (stu + stu2 - 1)->num << \" \" << (stu + stu2 - 1)->sum << \"\\n\";\n  printf(\"%d %d\\n\", (stu + stu3 - 1)->num, (stu + stu3 - 1)->sum);\n}\n"}
{"label": "14", "index": "25048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int math_grade;\n  int chi_grade;\n  int sum;\n} stu[100000];\nint main() {\n  int i, j, n, max, temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].id);\n    scanf(\"%d\", &stu[i].math_grade);\n    scanf(\"%d\", &stu[i].chi_grade);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math_grade + stu[i].chi_grade;\n  for (i = 0; i < 3; i++) {\n    max = stu[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].sum > max) {\n        temp1 = stu[i].id;\n        stu[i].id = stu[j].id;\n        stu[j].id = temp1;\n        temp2 = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = temp2;\n        max = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 2; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n  printf(\"%d %d\", stu[2].id, stu[2].sum);\n}\n"}
{"label": "14", "index": "25049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef struct {\n  int d;\n  int score;\n} student;\n\nint main() {\n  int n, i, temp1, temp2;\n  student a[100002];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].d, &temp1, &temp2);\n    a[i].score = temp1 + temp2;\n  }\n\n  student max1, max2, max3;\n  max1.d = max2.d = max3.d = -1;\n  max1.score = max2.score = max3.score = 0;\n\n  for (i = 0; i < n; i++) {\n    if (a[i].score > max1.score) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a[i];\n    } else if (a[i].score > max2.score) {\n      max3 = max2;\n      max2 = a[i];\n    } else if (a[i].score > max3.score) {\n      max3 = a[i];\n    }\n  }\n\n  printf(\"%d %d\\n\", max1.d, max1.score);\n  if (max2.d != -1)\n    printf(\"%d %d\\n\", max2.d, max2.score);\n  if (max3.d != -1)\n    printf(\"%d %d\\n\", max3.d, max3.score);\n  return 0;\n}\n"}
{"label": "14", "index": "25050", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  int No;\n  int chinese;\n  int math;\n  int sum;\n} student[100000], s;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].No, &student[i].chinese, &student[i].math);\n    student[i].sum = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].sum < student[j].sum) {\n        s = student[i];\n        student[i] = student[j];\n        student[j] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].No, student[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chin;\n  int sum;\n} st[100000], t;\nint main() {\n  int i, j;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &st[i].number, &st[i].math, &st[i].chin);\n    st[i].sum = st[i].math + st[i].chin;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n; j >= 1; j--)\n      if (st[j].sum > st[j - 1].sum) {\n        t = st[j - 1];\n        st[j - 1] = st[j];\n        st[j] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", st[i].number, st[i].sum);\n}\n"}
{"label": "14", "index": "25052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000], e;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chinese, &a[i].math);\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << a[i].num << \" \" << a[i].chinese + a[i].math << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int nn;\n  int nnn;\n  int nmn;\n  int sum;\n} st[100002], tmp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &st[i].nn, &st[i].nnn, &st[i].nmn);\n    st[i].sum = st[i].nnn + st[i].nmn;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[i].sum < st[j].sum) {\n        tmp = st[i];\n        st[i] = st[j];\n        st[j] = tmp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\", st[i].nn, st[i].sum);\n    if (i < 3)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n} stu[1000000];\n\nint main() {\n  int STUDENT_NUM, i, j, temp1, temp2;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < STUDENT_NUM; j++) {\n      if (stu[i].total < stu[j].total) {\n        temp1 = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = temp1;\n        temp2 = stu[i].total;\n        stu[i].total = stu[j].total;\n        stu[j].total = temp2;\n      }\n    }\n  }\n  cout << stu[0].ID << \" \" << stu[0].total << \"\\n\"\n       << stu[1].ID << \" \" << stu[1].total << \"\\n\"\n       << stu[2].ID << \" \" << stu[2].total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu1 {\n  long num;\n  int score1;\n  int score2;\n  struct stu1 *next;\n};\n\nstruct stu1 *creat(void) {\n  int n, i = 1;\n\n  struct stu1 *h;\n\n  struct stu1 *q1, *q2;\n  cin >> n;\n\n  q2 = q1 = (struct stu1 *)malloc(1000);\n\n  h = NULL;\n  while (i <= n) {\n    cin >> q1->num >> q1->score1 >> q1->score2;\n\n    if (i == 1) {\n      h = q1;\n    } else {\n      q2 = q1;\n    }\n    if (i != n) {\n\n      q1 = q2->next = (struct stu1 *)malloc(1000);\n    } else {\n      q1->next = NULL;\n    }\n    i++;\n  }\n  return (h);\n}\n\nstruct stu1 *turn(struct stu1 *h) {\n  int t = 1;\n  struct stu1 *p1, *p2;\n  int m, n, w;\n  for (p1 = h, t = 1; p1->next != NULL, t <= 3; p1 = p1->next, t++) {\n    p2 = p1->next;\n    while (p2 != NULL) {\n      if ((p1->score1 + p1->score2) < (p2->score1 + p2->score2)) {\n        m = p1->num;\n        n = p1->score1;\n        w = p1->score2;\n        p1->num = p2->num;\n        p1->score1 = p2->score1;\n        p1->score2 = p2->score2;\n        p2->num = m;\n        p2->score1 = n;\n        p2->score2 = w;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%ld %d \", p1->num, (p1->score1 + p1->score2));\n  }\n  return (h);\n}\n\nint main() {\n  struct stu1 *ip;\n  ip = creat();\n  turn(ip);\n  return 0;\n}\n"}
{"label": "14", "index": "25056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} student[1000000];\nvoid swap(int *a, int *b);\nint main(int argc, char *argv[]) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i = 0, j = 0, total[1000000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].xuehao, &student[i].yuwen, &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0 + i; j--) {\n      if (total[j] > total[j - 1]) {\n        swap(&total[j], &total[j - 1]);\n        swap(&student[j - 1].xuehao, &student[j].xuehao);\n        swap(&student[j - 1].yuwen, &student[j].yuwen);\n        swap(&student[j - 1].shuxue, &student[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].xuehao, total[i]);\n\n  return 0;\n}\nvoid swap(int *a, int *b) {\n  int e;\n  e = *a;\n  *a = *b;\n  *b = e;\n}\n"}
{"label": "14", "index": "25057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  while (m--) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    n = n - 1;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2;\n  int max = 0, i, m;\n  scanf(\"%d\", &m);\n  cout << \" \";\n  head = creat(m);\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->yuwen + p1->shuxue) > max)\n        max = p1->yuwen + p1->shuxue, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, (p2->yuwen + p2->shuxue));\n    head = del(head, p2->num);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25058", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chi;\n  int math;\n};\nstruct maxer {\n  int id;\n  int mark;\n};\nint main() {\n  int n, i, j;\n  struct student a[100001], temp;\n  struct maxer max, top[3]; \n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].id >> a[i].chi >> a[i].math;\n  }\n  for (i = 1; i <= 3; i++) { \n    max.mark = 0;\n    for (j = i; j <= n; j++) {\n      if (a[j].chi + a[j].math > max.mark) {\n        max.id = a[j].id;\n        max.mark = a[j].chi + a[j].math; \n      }\n    }\n    top[i - 1] = max; \n    temp = a[i];\n    a[i] = a[max.id];\n    a[max.id] = temp;\n  }\n  for (i = 0; i <= 2; i++) {\n    cout << top[i].id << ' ' << top[i].mark;\n    if (i != 2)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int i;\n  int j;\n  int k;\n};\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student c[n + 10];\n  int m1 = 1, m2 = 1, m3 = 1;\n  for (int m = 1; m <= n; m++) {\n    scanf(\"%d %d %d\", &c[m].i, &c[m].j, &c[m].k);\n    if ((c[m].j + c[m].k) > (c[m1].j + c[m1].k)) {\n      m3 = m2;\n      m2 = m1;\n      m1 = m;\n    } else if ((c[m].j + c[m].k) > (c[m2].j + c[m2].k)) {\n      m3 = m2;\n      m2 = m;\n    } else if ((c[m].j + c[m].k) > (c[m3].j + c[m3].k))\n      m3 = m;\n  }\n  printf(\"%d %d \", c[m1].i, c[m1].j + c[m1].k);\n  printf(\"%d %d \", c[m2].i, c[m2].j + c[m2].k);\n  printf(\"%d %d \", c[m3].i, c[m3].j + c[m3].k);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int number;\n  struct student stu[100000];\n  scanf(\"%d\\n\", &number);\n  for (int i = 1; i <= number; ++i) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (int i = 1; i <= 3; ++i) {\n    for (int j = i + 1; j <= number; ++j) {\n      if (stu[i].total < stu[j].total) {\n        struct student temp;\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n    }\n    cout << stu[i].id << \" \" << stu[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct inf {\n  int nu;\n  int b;\n  int c;\n  int sum;\n} a[100010], tmp;\nint main() {\n  int n, i, j, k, tmp1, tmp2;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    a[i - 1].sum = 0;\n    scanf(\"%d%d%d\", &a[i - 1].nu, &a[i - 1].b, &a[i - 1].c);\n    a[i - 1].sum = a[i - 1].b + a[i - 1].c;\n  }\n  for (i = 0; i < 3; i++) {\n    tmp1 = i;\n    tmp2 = a[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (a[j].sum > tmp2) {\n        tmp2 = a[j].sum;\n        tmp1 = j;\n      }\n    }\n    tmp = a[i];\n    a[i] = a[tmp1];\n    a[tmp1] = tmp;\n  }\n  for (i = 0; i < 3; i++)\n    cout << a[i].nu << \" \" << a[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25062", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, num1 = 0, max2 = 0, num2 = 0, max3 = 0, num3 = 0;\n  struct stu {\n    int num;\n    int chn;\n    int mat;\n    int sum;\n  } sco[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> sco[i].num >> sco[i].chn >> sco[i].mat;\n    sco[i].sum = sco[i].chn + sco[i].mat;\n  }\n  for (i = 0; i < n; i++) {\n    if (sco[i].sum > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = sco[i].sum;\n      num1 = i;\n\n    } else {\n      if (sco[i].sum > max2) {\n        max3 = max2;\n        num3 = num2;\n        max2 = sco[i].sum;\n        num2 = i;\n      } else {\n        if (sco[i].sum > max3) {\n          max3 = sco[i].sum;\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << ' ' << max1 << endl;\n  printf(\"%d %d\\n\", num2 + 1, max2);\n  cout << num3 + 1 << ' ' << max3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int yw;\n  int sx;\n} stu[100000]; \nint main() {\n  int num, i, j, sum[100000], t, m;\n  cin >> num;\n  for (i = 1; i <= num; i++) {\n    cin >> stu[i].ID >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  } \n  for (i = 1; i < 4; i++) {\n    for (j = num; j > 1; j--) {\n      if (sum[j] > sum[j - 1]) {\n        t = sum[j - 1];\n        m = stu[j - 1].ID;\n        sum[j - 1] = sum[j];\n        stu[j - 1].ID = stu[j].ID;\n        sum[j] = t;\n        stu[j].ID = m;\n      }\n    }\n  } \n  for (i = 1; i < 4; i++) {\n    cout << stu[i].ID << ' ' << sum[i] << endl;\n  }\n  return 0;\n} \n"}
{"label": "14", "index": "25064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int he;\n} student[100000];\n\nint main() {\n  int i, n, j, s = 0, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> student[i].num >> student[i].yw >> student[i].sx;\n    student[i].he = student[i].yw + student[i].sx;\n  }\n  for (i = 0; i < n; i++) {\n    m = student[0].he;\n    for (j = n - 1; j > 0; j--) {\n\n      m = student[j].he > m ? student[j].he : m;\n    }\n\n    for (j = 0; j < n; j++) {\n      if (student[j].he == m) {\n        printf(\"%d %d\\n\", student[j].num, student[j].he);\n        student[j].he = 0;\n        s = s + 1;\n        if (s == 3)\n          goto guiyi;\n      }\n    }\n  }\nguiyi:\n  return 0;\n}\n"}
{"label": "14", "index": "25065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, chi, math, sum;\n  struct student {\n    int num, chi, math, sum;\n  } students[100000];\n  int i;\n  int STUDENT_NUM;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &num, &chi, &math);\n    students[i].num = num;\n    students[i].chi = chi;\n    students[i].math = math;\n    sum = chi + math;\n    students[i].sum = sum;\n  }\n  int sum1 = 0, sum2 = 0, sum3 = 0;\n  int num1, num2, num3;\n  for (i = 0; i < STUDENT_NUM; i++) {\n    if (i == 0) {\n      sum1 = students[0].sum;\n      num1 = students[0].num;\n    } else if (i == 1) {\n      if (students[1].sum > students[0].sum) {\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[1].sum;\n        num1 = students[1].num;\n      } else {\n        sum2 = students[1].sum;\n        num2 = students[1].num;\n      }\n    } else {\n      if (students[i].sum > sum1) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[i].sum;\n        num1 = students[i].num;\n      } else if (students[i].sum > sum2) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = students[i].sum;\n        num2 = students[i].num;\n      } else if (students[i].sum > sum3) {\n        sum3 = students[i].sum;\n        num3 = students[i].num;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", num1, sum1);\n  printf(\"%d %d\\n\", num2, sum2);\n  printf(\"%d %d\\n\", num3, sum3);\n  return 0;\n}\n"}
{"label": "14", "index": "25066", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct gpa {\n    int num;\n    int math;\n    int chin;\n    int total;\n  } STUDENT_NUM[100000], first, second, third;\n\n  int num, math, chin;\n  long n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    cin >> math;\n    scanf(\"%d\", &chin);\n    STUDENT_NUM[i].num = num;\n    STUDENT_NUM[i].math = math;\n    STUDENT_NUM[i].chin = chin;\n    STUDENT_NUM[i].total = math + chin;\n  }\n\n  first.num = 0;\n  first.total = 0;\n  second.num = 0;\n  second.total = 0;\n  third.num = 0;\n  third.total = 0;\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > first.total) {\n      first.num = STUDENT_NUM[i].num;\n      first.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == first.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > second.total) {\n      second.num = STUDENT_NUM[i].num;\n      second.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == second.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > third.total) {\n      third.num = STUDENT_NUM[i].num;\n      third.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  printf(\"%d %d\\n\", first.num, first.total);\n  printf(\"%d %d\\n\", second.num, second.total);\n  printf(\"%d %d\\n\", third.num, third.total);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum)\n        k = j;\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3 && i < n; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct marks {\n  long ID;\n  int Chinese;\n  int Maths;\n  int total;\n} student[100000], first, second, third;\n\nint main() {\n  first.total = 0;\n  second.total = 0;\n  third.total = 0;\n  int student_num, i, count = 0;\n  scanf(\"%ld\", &student_num);\n  for (i = 0; i < student_num; i++) {\n    scanf(\"%ld%d%d\", &student[i].ID, &student[i].Chinese, &student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    student[i].total = (student[i].Chinese + student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > first.total) {\n      first = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total == first.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n    if (count > 3)\n      break;\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > second.total && student[i].total < first.total) {\n      second = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == second.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > third.total && student[i].total < second.total) {\n      third = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == third.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n}\n"}
{"label": "14", "index": "25069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100001], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25070", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int stuNum, i;\n  scanf(\"%d \", &stuNum);\n  struct student {\n    int id, math, chinese, total;\n  };\n  struct student stu[stuNum], first, second, third;\n  for (i = 0; i < stuNum; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  first = second = third = stu[0];\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > first.total)\n      first = stu[i];\n  cout << first.id << ' ' << first.total << endl;\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > second.total && stu[i].id != first.id)\n      second = stu[i];\n  printf(\"%d %d\\n\", second.id, second.total);\n  for (i = 1; i < stuNum; i++) {\n    if (stu[i].total > third.total && stu[i].id != first.id &&\n        stu[i].id != second.id)\n      third = stu[i];\n  }\n  cout << third.id << ' ' << third.total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, a[100000][3], c[100000][3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i][1] >> a[i][2] >> a[i][3];\n  for (i = n - 2; i >= 0; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 1; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 2; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (k = 0; k < 3; k++)\n    printf(\"%d %d\\n\", a[k][1], a[k][2] + a[k][3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long xh;\n  int yw;\n  int sx;\n  int zh;\n  struct stu *next;\n};\nstruct stu *scan() {\n  long n;\n  long num = 0;\n  struct stu *head, *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%ld\", &n);\n\n  head = p1;\n  while (num < n) {\n    scanf(\"%ld\", &p1->xh);\n    cin >> p1->yw;\n    scanf(\"%d\", &p1->sx);\n    p1->zh = p1->yw + p1->sx;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->next = 0;\n    num++;\n  }\n  return (head);\n}\nstruct stu *del(struct stu *head, int max) {\n  struct stu *p1, *p2;\n  p1 = head;\n  while (max != p1->zh && p1->next != 0) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (max == p1->zh) {\n    if (p1 == head) {\n      head = p1->next;\n    } else {\n      p2->next = p1->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p, *p1, *p2, *p3, *w;\n  int max = 0, num = 0;\n  while (num < 3) {\n    for (p = head; p != 0; p = p->next) {\n      if (p->zh > max) {\n        max = p->zh;\n        w = p;\n      }\n    }\n    num++;\n    if (num == 1) {\n      p1 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 2) {\n      p2 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 3) {\n      p3 = w;\n    }\n  }\n  printf(\"%ld %d\\n%ld %d\\n%ld %d\\n\", p1->xh, p1->zh, p2->xh, p2->zh, p3->xh,\n         p3->zh);\n}\nint main() {\n  struct stu *head;\n  head = scan();\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25073", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct marks {\n  long ID;\n  int Chinese;\n  int Maths;\n  int total;\n} student[100000], first, second, third;\n\nint main() {\n  first.total = 0;\n  second.total = 0;\n  third.total = 0;\n  int student_num, i, count = 0;\n  cin >> student_num;\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].ID >> student[i].Chinese >> student[i].Maths;\n  }\n  for (i = 0; i < student_num; i++) {\n    student[i].total = (student[i].Chinese + student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > first.total) {\n      first = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total == first.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n    if (count > 3)\n      break;\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > second.total && student[i].total < first.total) {\n      second = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == second.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > third.total && student[i].total < second.total) {\n      third = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == third.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n};\nint main() {\n  int i, j, n;\n  struct stu *p1, p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)calloc(n, sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p1[i].a), &(p1[i].b), &(p1[i].c));\n    p1[i].d = p1[i].b + p1[i].c;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (p1[i].d < p1[j].d) {\n        p2 = p1[i];\n        p1[i] = p1[j];\n        p1[j] = p2;\n      }\n  for (i = 0; i < 3; i++)\n    cout << p1[i].a << \" \" << p1[i].d << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  struct student {\n    int num;\n    int score1;\n    int score2;\n    int t;\n  } stu[100000], m1, m2, m3;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].t = stu[i].score1 + stu[i].score2;\n  }\n  m1 = stu[0];\n  m2 = stu[0];\n  m3 = stu[0];\n  for (i = 0; i < n; i++) {\n    if (stu[i].t > m1.t) {\n      m3 = m2;\n      m2 = m1;\n      m1 = stu[i];\n    } else if (stu[i].t > m2.t && stu[i].t <= m1.t) {\n      m3 = m2;\n      m2 = stu[i];\n    } else if (stu[i].t > m3.t && stu[i].t <= m2.t) {\n      m3 = stu[i];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", m1.num, m1.t, m2.num, m2.t, m3.num, m3.t);\n}\n"}
{"label": "14", "index": "25076", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint m;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student *creat(int n);\n  void print(struct student * head, int n);\n  struct student *head;\n  head = creat(n);\n  print(head, n);\n  print(head, n);\n  print(head, n);\n  return 0;\n}\n\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  for (; n != 0; n--) {\n    m += 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head, int n) {\n  struct student *p, *q;\n  p = head;\n  int max = 0, index = 0;\n  for (; n != 0; n--) {\n    if (max < ((p->yuwen) + (p->shuxue))) {\n      max = ((p->yuwen) + (p->shuxue));\n      index = p->num;\n      q = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", index, max);\n  q->yuwen = 0;\n  q->shuxue = 0;\n}\n"}
{"label": "14", "index": "25077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int c;\n  c = *(int *)elem1 - *(int *)elem2;\n  return c;\n}\nstruct student {\n  int num;\n  int x;\n  int y;\n} a[100000];\nint main() {\n  int n, i, j, d = 0, b[100000], c[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].x);\n    scanf(\"%d\", &a[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].x + a[i].y;\n  }\n  qsort(b, n, sizeof(int), pfCompare);\n  for (j = 0; j < n; j++) {\n    if (b[n - 1] == a[j].x + a[j].y) {\n      printf(\"%d\"\n             \" \"\n             \"%d\",\n             a[j].num, b[n - 1]);\n      printf(\" \");\n      d++;\n    }\n    if (d == 3)\n      break;\n  }\n  for (i = n - 2; i > n - 4; i--) {\n    if (b[i] == b[i + 1])\n      continue;\n    else {\n      for (j = 0; j < n; j++) {\n        if (b[i] == a[j].x + a[j].y) {\n          printf(\"%d\"\n                 \" \"\n                 \"%d\",\n                 a[j].num, b[i]);\n          printf(\" \");\n          d++;\n        }\n        if (d == 3)\n          break;\n      }\n      if (d == 3)\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25078", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n};\n\nint main() {\n  int n;\n  int i, j, e;\n  int x;\n  struct student a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chn, &a[i].math);\n    a[i].sum = a[i].chn + a[i].math;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = n - i - 1; j >= 0; j--) {\n      if (a[j].sum < a[j + 1].sum) {\n        x = a[j + 1].sum;\n        a[j + 1].sum = a[j].sum;\n        a[j].sum = x;\n        e = a[j + 1].num;\n        a[j + 1].num = a[j].num;\n        a[j].num = e;\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25079", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int n, i, j, max;\n  struct stu *head, *p1, *p2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n      cin >> p1->a >> p1->b >> p1->c;\n      head = p1;\n      p2 = p1;\n    } else {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      cin >> p1->a >> p1->b >> p1->c;\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = NULL;\n\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c > max)\n        max = p1->b + p1->c;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c == max) {\n        printf(\"%d %d\\n\", p1->a, max);\n        p1->b = 0;\n        p1->c = 0;\n        p1 = p1->next;\n        break;\n      } else\n        p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "25080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    char NUM[100000];\n    int Ma;\n    int Ch;\n  } stu;\n  int n, i, x, max1, max2, max3, m1, m2, m3;\n  max1 = max2 = max3 = 0;\n  m1 = m2 = m3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d %d\", stu.NUM, &(stu.Ma), &(stu.Ch));\n    x = stu.Ma + stu.Ch;\n    if (x > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = x;\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n    } else if (x == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = max1;\n      m3 = m2;\n      m2 = i;\n    } else if (x < max1 && x > max2) {\n      max3 = max2;\n      max2 = x;\n      m3 = m2;\n    }\n\n    else if (x == max2) {\n      max3 = max2;\n      m3 = i;\n    } else if (x < max2 && x > max3) {\n      max3 = x;\n      m3 = i;\n    }\n  }\n\n  cout << m1 << \" \" << max1 << \"\\n\";\n  printf(\"%d %d\\n\", m2, max2);\n  printf(\"%d %d\\n\", m3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1) {\n    max2 = head;\n  } else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  cout << max2->num << \" \" << max2->math + max2->chinese << \" \";\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n  return 0;\n}\n"}
{"label": "14", "index": "25082", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, i, first, second, third, x, y, z;\n  scanf(\"%d\", &n);\n  struct mark {\n    int ID, chinese, math, sum;\n  } * num;\n  num = (struct mark *)malloc(sizeof(mark) * n);\n  int n1, c1, m1;\n  for (i = 0; i < n; i++) {\n    cin >> n1 >> c1 >> m1;\n    num[i].ID = n1;\n    num[i].chinese = c1;\n    num[i].math = m1;\n    num[i].sum = c1 + m1;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      first = num[i].sum;\n      second = num[i].sum;\n      third = num[i].sum;\n      x = num[i].ID;\n      y = num[i].ID;\n      z = num[i].ID;\n    } else if (i == 1) {\n      if (num[i].sum > first) {\n        first = num[i].sum;\n        x = num[i].ID;\n      } else {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n\n    } else {\n      if (num[i].sum > first) {\n        third = second;\n        z = y;\n        second = first;\n        y = x;\n        first = num[i].sum;\n        x = num[i].ID;\n      } else if (num[i].sum > second) {\n        third = second;\n        z = y;\n        second = num[i].sum;\n        y = num[i].ID;\n      } else if (num[i].sum > third) {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, first, y, second, z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25083", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nstruct student {\n  int No;\n  int china;\n  int math;\n}; \nint main() {\n  int n;\n  cin >> n;\n  struct student st[n]; \n  int i;\n  for (i = 0; i < n; i++)\n    cin >> st[i].No >> st[i].china >> st[i].math;\n\n  int s;\n  int a1 = 0, a2 = 0, a3 = 0, b1 = 0, b2 = 0, b3 = 0; \n  for (i = 0; i < n; i++) {\n    s = st[i].china + st[i].math;\n    if (s > a1) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = a1;\n      b2 = b1;\n      a1 = s;\n      b1 = i;\n      continue; \n    }\n\n    if (s > a2) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = s;\n      b2 = i;\n      continue;\n\n    } \n    if (s > a3) {\n      a3 = s;\n      b3 = i;\n      continue;\n    } \n  }\n  cout << st[b1].No << \" \" << a1 << endl;\n  cout << st[b2].No << \" \" << a2 << endl;\n  cout << st[b3].No << \" \" << a3 << endl; \n  return 0;\n}\n"}
{"label": "14", "index": "25084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct point {\n  int id, a, b, c;\n} s[100000], tmp;\nint main(int argc, char *argv[]) {\n\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &s[i].a, &s[i].b);\n    s[i].c = s[i].a + s[i].b;\n  }\n  for (i = 1; i < n; i++) {\n    if (s[i].c > s[0].c) {\n      tmp = s[0];\n      s[0] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (s[i].c > s[1].c) {\n      tmp = s[1];\n      s[1] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].c > s[2].c) {\n      tmp = s[2];\n      s[2] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", s[i].id, s[i].c);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25085", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, First = 0, FirstNum, Second = 0, SecondNum, Third = 0,\n                  ThirdNum;\n  scanf(\"%d\", &n);\n  struct Student {\n    int Chinese;\n    int Math;\n    int Sum;\n    int Num;\n  } Student[n + 1];\n  for (i = 1; i <= n; i++) {\n    cin >> Student[i].Num >> Student[i].Chinese >> Student[i].Math;\n    Student[i].Sum = Student[i].Chinese + Student[i].Math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > First) {\n      First = Student[i].Sum;\n      FirstNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Second && Student[i].Sum <= First && i != FirstNum) {\n      Second = Student[i].Sum;\n      SecondNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Third && Student[i].Sum <= Second && i != SecondNum &&\n        i != FirstNum) {\n      Third = Student[i].Sum;\n      ThirdNum = i;\n    }\n  }\n  printf(\"%d %d\\n\", FirstNum, First);\n  printf(\"%d %d\\n\", SecondNum, Second);\n  printf(\"%d %d\\n\", ThirdNum, Third);\n}\n"}
{"label": "14", "index": "25086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[6];\n  int score[2];\n  int sum;\n} stu[100000];\n\nint main() {\n  long n, i, j, maxi1, maxi2, maxi3;\n  int max1 = 0, max2 = 0, max3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    for (j = 0; j < 2; j++)\n      scanf(\"%d\", &stu[i].score[j]);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].score[0] + stu[i].score[1];\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max1) {\n      max1 = stu[i].sum;\n      maxi1 = i;\n    }\n  stu[maxi1].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max2) {\n      max2 = stu[i].sum;\n      maxi2 = i;\n    }\n  stu[maxi2].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxi3 = i;\n    }\n  cout << stu[maxi1].num << \" \" << max1 << \"\\n\"\n       << stu[maxi2].num << \" \" << max2 << \"\\n\"\n       << stu[maxi3].num << \" \" << max3;\n  return 0;\n}\n"}
{"label": "14", "index": "25087", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stdudent {\n    int ID;\n    int a;\n    int b;\n    int c;\n\n  } d[100000];\n  int first, second, third;\n  int n, i, j;\n  int w, h, l;\n  int k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &d[i].ID, &d[i].a, &d[i].b);\n    d[i].c = d[i].a + d[i].b;\n  }\n  first = 0;\n  second = 1;\n  third = 2;\n  w = d[0].c;\n  h = d[1].c;\n  l = d[2].c;\n  if (w < h && (h > l)) {\n    first = 1;\n    if (w > l) {\n      second = 0;\n      third = 2;\n    } else {\n      second = 2;\n      third = 0;\n    }\n  } else if (l > w) {\n    first = 2;\n    if (w > h) {\n      second = 0;\n      third = 1;\n    } else\n      third = 0;\n  }\n\n  for (j = 3; j < n; j++) {\n    k = d[j].c;\n    w = d[first].c;\n    h = d[second].c;\n    l = d[third].c;\n    if (k > w) {\n      third = second;\n      second = first;\n      first = j;\n    } else if (k > h) {\n      third = second;\n      second = j;\n    } else if (k > l)\n      third = j;\n  }\n  printf(\"%d %d \", d[first].ID, d[first].c);\n  printf(\"%d %d \", d[second].ID, d[second].c);\n  printf(\"%d %d \", d[third].ID, d[third].c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sum[100000], a, b, c;\n  struct xues {\n    int a, b, c;\n  } s[100000];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &s[i].b, &s[i].c);\n    sum[i] = s[i].b + s[i].c;\n  }\n  int fir = 0, sec = 0, thi = 0;\n  for (i = 0; i < n; i++) {\n    if (fir < sum[i]) {\n      thi = sec;\n      sec = fir;\n      fir = sum[i];\n      c = b;\n      b = a;\n      a = s[i].a;\n    } else if (sec < sum[i]) {\n      thi = sec;\n      sec = sum[i];\n      fir = fir;\n      a = a;\n      c = b;\n      b = s[i].a;\n    } else if (thi < sum[i]) {\n      fir = fir;\n      sec = sec;\n      thi = sum[i];\n      a = a;\n      b = b;\n      c = s[i].a;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a, fir, b, sec, c, thi);\n  return 0;\n}\n"}
{"label": "14", "index": "25089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n    struct stu *next;\n  };\n  int n, max, i;\n  struct stu *p1, *p2, *head, *maxsum;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n\n  p1 = head;\n  while (p1->next != NULL) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  p1->sum = p1->chinese + p1->math;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    maxsum = p1;\n    while (p1->next != NULL) {\n      if (p1->sum > max) {\n        maxsum = p1;\n        max = p1->sum;\n      }\n      p1 = p1->next;\n    }\n    if (p1->sum > max) {\n      maxsum = p1;\n      max = p1->sum;\n    }\n    printf(\"%d %d \", maxsum->num, maxsum->sum);\n    maxsum->sum = 0;\n  }\n}\n"}
{"label": "14", "index": "25090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, num1 = 0, max2 = 0, num2 = 0, max3 = 0, num3 = 0;\n  struct stu {\n    int num;\n    int chn;\n    int mat;\n    int sum;\n  } sco[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> sco[i].num >> sco[i].chn >> sco[i].mat;\n    sco[i].sum = sco[i].chn + sco[i].mat;\n  }\n  for (i = 0; i < n; i++) {\n    if (sco[i].sum > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = sco[i].sum;\n      num1 = i;\n\n    } else {\n      if (sco[i].sum > max2) {\n        max3 = max2;\n        num3 = num2;\n        max2 = sco[i].sum;\n        num2 = i;\n      } else {\n        if (sco[i].sum > max3) {\n          max3 = sco[i].sum;\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << ' ' << max1 << endl;\n  cout << num2 + 1 << ' ' << max2 << endl;\n  cout << num3 + 1 << ' ' << max3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int nID, nChinese, nMath;\n};\nint main() {\n  int n, i, a1, a2, a3, t1, t2, t3, t;\n  struct Student students;\n  t1 = 0;\n  t2 = 0;\n  t3 = 0;\n  a1 = 0;\n  a2 = 0;\n  a3 = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> students.nID >> students.nChinese >> students.nMath;\n    t = students.nChinese + students.nMath;\n    if (t > t1) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t1;\n      a2 = a1;\n      t1 = t;\n      a1 = students.nID;\n    } else if (t > t2) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t;\n      a2 = students.nID;\n    } else if (t > t3) {\n      t3 = t;\n      a3 = students.nID;\n    }\n  }\n  printf(\"%d%s%d\\n\", a1, \" \", t1);\n  printf(\"%d%s%d\\n\", a2, \" \", t2);\n  printf(\"%d%s%d\\n\", a3, \" \", t3);\n}\n"}
{"label": "14", "index": "25092", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int stuNum, i;\n  cin >> stuNum;\n  struct student {\n    int id, math, chinese, total;\n  };\n  struct student stu[stuNum], first, second, third;\n  for (i = 0; i < stuNum; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  first = second = third = stu[0];\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > first.total)\n      first = stu[i];\n  cout << first.id << ' ' << first.total << endl;\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > second.total && stu[i].id != first.id)\n      second = stu[i];\n  cout << second.id << ' ' << second.total << endl;\n  for (i = 1; i < stuNum; i++) {\n    if (stu[i].total > third.total && stu[i].id != first.id &&\n        stu[i].id != second.id)\n      third = stu[i];\n  }\n  cout << third.id << ' ' << third.total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct mark {\n  int num;\n  int ch;\n  int math;\n  int sum;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    stu[i].sum = stu[i].math + stu[i].ch;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  cout << stu[n - 1].num << \" \" << stu[n - 1].sum << \"\\n\"\n       << stu[n - 2].num << \" \" << stu[n - 2].sum << \"\\n\"\n       << stu[n - 3].num << \" \" << stu[n - 3].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, num[100000], j, grade1[100000], grade2[100000], grade[100000], t1,\n      t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &num[i], &grade1[i], &grade2[i]);\n    grade[i] = grade1[i] + grade2[i];\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (grade[i] >= grade[i + 1]) {\n        t1 = grade[i];\n        grade[i] = grade[i + 1];\n        grade[i + 1] = t1;\n        t2 = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t2;\n      }\n    }\n  }\n  cout << num[n - 1] << \" \" << grade[n - 1] << \"\\n\"\n       << num[n - 2] << \" \" << grade[n - 2] << \"\\n\"\n       << num[n - 3] << \" \" << grade[n - 3];\n}\n"}
{"label": "14", "index": "25095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct record {\n  int stuID;\n  short YuWen;\n  short math;\n  short total;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  if ((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) {\n    printf(\"Error: memory out! (1)\\n\");\n    exit(-1);\n  }\n  newLn->n = 0;\n  newLn->head = NULL;\n  newLn->tail = NULL;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNode;\n  if ((newNode = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    cout << \"Error: memory out! (2)\\n\";\n    exit(-1);\n  }\n  newNode->m_rec = *rec;\n  newNode->next = NULL;\n  if (ln->n == 0) {\n    ln->head = newNode;\n    ln->tail = newNode;\n  } else {\n    ln->tail->next = newNode;\n    ln->tail = newNode;\n  }\n  ln->n++;\n\n  return ln;\n}\n\nint myCompare(const struct record *rec1, const struct record *rec2) {\n  return rec2->total - rec1->total;\n}\n\nstruct YyxNode *Search(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *nd = ln->head;\n  while (nd != NULL && myCompare(&nd->m_rec, rec))\n    nd = nd->next;\n\n  return nd;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNode = ln->head;\n  struct YyxNode *nextNode;\n  while (delNode != NULL) {\n    nextNode = delNode->next;\n    free(delNode);\n    delNode = nextNode;\n  }\n  ln->n = 0;\n  ln->head = NULL;\n  ln->tail = NULL;\n\n  return ln;\n}\n\nint main() {\n  struct YyxLink *mainLn;\n  struct record stu;\n  int n;\n  int i;\n  struct record *max1, *max2, *max3;\n  struct YyxNode *temp;\n  mainLn = CreateNewLink();\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu.stuID, &stu.YuWen, &stu.math);\n    stu.total = stu.YuWen + stu.math;\n    AddNode(mainLn, &stu);\n  }\n\n  max1 = max2 = max3 = &mainLn->head->m_rec;\n  temp = mainLn->head;\n  while (temp != NULL) {\n    if (max1->total < temp->m_rec.total)\n      max1 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  if (max2 == max1) {\n    temp = mainLn->head->next;\n    max2 = &temp->m_rec;\n  }\n  while (temp != NULL) {\n    if (max2->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec)\n        max2 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  while (&temp->m_rec == max1 || &temp->m_rec == max2)\n    temp = temp->next;\n  max3 = &temp->m_rec;\n  while (temp != NULL) {\n    if (max3->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec && max2 != &temp->m_rec)\n        max3 = &temp->m_rec;\n    temp = temp->next;\n  }\n\n  printf(\"%d %d\\n\", max1->stuID, max1->total);\n  printf(\"%d %d\\n\", max2->stuID, max2->total);\n  printf(\"%d %d\\n\", max3->stuID, max3->total);\n\n  free(ClearLink(mainLn));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25096", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    long num, c, m, d;\n    struct stu *next;\n  };\n  long n, i, f;\n  struct stu *head, *p1, *p2;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld%ld%ld\", &p1->num, &p1->c, &p1->m);\n    p1->d = p1->c + p1->m;\n    if (i == 1) {\n      p1->next = 0;\n      head = p1;\n    } else {\n      if (i <= 3)\n        f = 1;\n      else {\n        p2 = head->next->next;\n        if (p1->d > p2->d)\n          f = 1;\n        else\n          f = 0;\n      }\n      if (f == 1) {\n        p2 = head;\n        if (p2->d < p1->d) {\n          p1->next = p2;\n          head = p1;\n        } else {\n          while ((p2->next != 0) && (p2->next->d > p1->d))\n            p2 = p2->next;\n          p1->next = p2->next;\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    printf(\"%ld %ld \", p1->num, p1->d);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d \", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a;\n    } else if (a.z > max2.z) {\n      max3 = max2;\n      max2 = a;\n    } else if (a.z > max3.z) {\n      max3 = a;\n      max3 = a;\n    }\n  }\n  cout << max1.num << \" \" << max1.z << \"\\n\"\n       << max2.num << \" \" << max2.z << \"\\n\"\n       << max3.num << \" \" << max3.z << \"\\n\";\n}\n"}
{"label": "14", "index": "25098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100000], b[100000], c[100000], sum[100000], i, t1, t2, t3, s1, s2,\n      s3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n    sum[i] = b[i] + c[i];\n  }\n  for (i = 0, t1 = 0, s1 = a[0]; i < n; i++) {\n    if (sum[i] > t1) {\n      t1 = sum[i];\n      s1 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1, t1);\n  for (i = 0, t2 = 0, s2 = a[0]; i < n; i++) {\n    if (a[i] == s1)\n      continue;\n    if (sum[i] > t2) {\n      t2 = sum[i];\n      s2 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s2, t2);\n  for (i = 0, t3 = 0, s3 = a[0]; i < n; i++) {\n    if (a[i] == s1 || a[i] == s2)\n      continue;\n    if (sum[i] > t3) {\n      t3 = sum[i];\n      s3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s3, t3);\n  return 0;\n}\n"}
{"label": "14", "index": "25099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student { \n  int nID, nChinese, nMath;\n};\nint main() {\n  int n, i, a1, a2, a3, t1, t2, t3, t; \n  struct Student students;\n  t1 = 0;\n  t2 = 0;\n  t3 = 0;\n  a1 = 0;\n  a2 = 0;\n  a3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &students.nID, &students.nChinese, &students.nMath);\n    t = students.nChinese + students.nMath;\n    if (t > t1) { \n      t3 = t2;\n      a3 = a2; \n      t2 = t1;\n      a2 = a1; \n      t1 = t;\n      a1 = students.nID;\n    } else if (t > t2) { \n      t3 = t2;\n      a3 = a2; \n      t2 = t;\n      a2 = students.nID;\n    } else if (t > t3) {\n      t3 = t;\n      a3 = students.nID;\n    }\n  }\n  printf(\"%d%s%d\\n\", a1, \" \", t1);\n  printf(\"%d%s%d\\n\", a2, \" \", t2);\n  printf(\"%d%s%d\\n\", a3, \" \", t3);\n}\n"}
{"label": "14", "index": "25100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int all;\n} person[99999];\nint main() {\n  int n, i, j, k, x, y;\n  ;\n  struct student temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 2; i >= 0; i--) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n  }\n  for (i = 3; i <= n - 1; i++) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n    k = person[i].all;\n    if (k > person[0].all) {\n      temp1 = person[0];\n      temp2 = person[1];\n      person[0] = person[i];\n      person[1] = temp1;\n      person[2] = temp2;\n      continue;\n    }\n    if (k <= person[0].all && k > person[1].all) {\n      temp1 = person[1];\n      person[1] = person[i];\n      person[2] = temp1;\n      continue;\n    }\n    if (k <= person[1].all && k > person[2].all) {\n      person[2] = person[i];\n      continue;\n    }\n    if (k < person[2].all) {\n      continue;\n    }\n  }\n  printf(\"%d %d\\n\", person[0].num, person[0].all);\n  printf(\"%d %d\\n\", person[1].num, person[1].all);\n  printf(\"%d %d\", person[2].num, person[2].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n  };\n  int i, n, j = 0;\n  scanf(\"%d\", &n);\n  struct stu *hd, *p;\n  hd = p = (struct stu *)malloc(100000 * sizeof(struct stu));\n  for (i = 0; i < n; i++, p++) {\n    scanf(\"%d %d %d\", &p->a, &p->b, &p->c);\n  }\n  int max = 0;\nnxt:\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c > max) {\n      max = p->b + p->c;\n    }\n  }\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c == max) {\n      printf(\"%d %d\\n\", p->a, p->b + p->c);\n      p->b = 0;\n      p->c = 0;\n      max = 0;\n      j++;\n      break;\n    }\n  }\n  if (j <= 2)\n    goto nxt;\n}\n"}
{"label": "14", "index": "25102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID, Chinese, math, sum;\n  } stu[100000], temp1, temp2, temp3;\n  int n, i, j, k;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].ID, &stu[i].Chinese, &stu[i].math);\n    stu[i].sum = stu[i].Chinese + stu[i].math;\n  }\n  temp1 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp1.sum)\n      temp1 = stu[i];\n  printf(\"%d %d\\n\", temp1.ID, temp1.sum);\n  if (temp1.ID == stu[0].ID)\n    temp2 = stu[1];\n  else\n    temp2 = stu[0];\n  for (i = 1; i < n - 1; i++) {\n    if (stu[i].ID == temp1.ID)\n      continue;\n    else if (stu[i].sum > temp2.sum)\n      temp2 = stu[i];\n  }\n  printf(\"%d %d\\n\", temp2.ID, temp2.sum);\n  for (i = 0; i < n; i++)\n    if (stu[i].ID == temp1.ID || stu[i].ID == temp2.ID)\n      stu[i].sum = 0;\n  temp3 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp3.sum)\n      temp3 = stu[i];\n  printf(\"%d %d\\n\", temp3.ID, temp3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25103", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct {\n    int number;\n    float score1;\n    float score2;\n    float score3;\n\n  } stu[100000], temp;\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    stu[i].score3 = stu[i].score2 + stu[i].score1;\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = n - 1; j >= n - i; j--)\n      if (stu[j - 1].score3 < stu[j].score3) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  cout << stu[0].number << \" \" << stu[0].score3 << endl;\n  cout << stu[1].number << \" \" << stu[1].score3 << endl;\n  cout << stu[2].number << \" \" << stu[2].score3;\n  return 0;\n}\n"}
{"label": "14", "index": "25104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n, i, j, math[100000], chin[100000], total[100000], id[100000];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld\", &id[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &chin[i]);\n  }\n  for (i = 0; i < n; i++) {\n    total[i] = 100000 * (math[i] + chin[i]) + 100000 - id[i];\n  }\n  int comp(const void *a, const void *b);\n  qsort(total, n, sizeof(long), comp);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 1] - 100000 * ((int)total[n - 1] / 100000)),\n         (int)total[n - 1] / 100000);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 2] - 100000 * ((int)total[n - 2] / 100000)),\n         (int)total[n - 2] / 100000);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 3] - 100000 * ((int)total[n - 3] / 100000)),\n         (int)total[n - 3] / 100000);\n  getchar();\n  getchar();\n}\n\nint comp(const void *a, const void *b) { return *(long *)a - *(long *)b; }\n"}
{"label": "14", "index": "25105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int a;\n  int sc[2];\n};\nint main() {\n  struct s st[100000];\n  int t = 0, j = 0, max = 0, p[3] = {-1, -1};\n  long n, i;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].sc[0], &st[i].sc[1]);\n    st[i].sc[0] = st[i].sc[0] + st[i].sc[1];\n  }\n  i = 0;\n  while (t < 3) {\n    if (i < n && i != p[0] && i != p[1]) {\n      j = (st[i].sc[0] > max) ? i : j;\n      max = (st[i].sc[0] > max) ? st[i].sc[0] : max;\n      i++;\n    } else if (i < n && (i == p[0] || i == p[1]))\n      i++;\n    else if (i = n) {\n      cout << j + 1 << \" \" << max << \"\\n\";\n      p[t] = j;\n      t++;\n      j = 0;\n      max = 0;\n      i = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "25106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  long n, i;\n  int high[4] = {0};\n  long higher[4];\n  struct student {\n    long num;\n    int yuwen;\n    int shuxue;\n    int total;\n  } stu[100000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].total > high[1]) {\n      high[1] = stu[i].total;\n      higher[1] = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (stu[i].total <= high[1] && stu[i].total > high[2] && i != higher[1]) {\n      high[2] = stu[i].total;\n      higher[2] = i;\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[2] && stu[i].total > high[3] && i != higher[1] &&\n        i != higher[2]) {\n      high[3] = stu[i].total;\n      higher[3] = i;\n    }\n  for (i = 1; i < 4; i++)\n    printf(\"%d %d\\n\", higher[i], high[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "25107", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct Student {\n    int ID;\n    int Chinese;\n    int Math;\n    int sum;\n  } student[100000];\n  int i, j, n;\n  struct Student t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &student[i].ID, &student[i].Chinese, &student[i].Math);\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].Chinese + student[i].Math <\n          student[j].Chinese + student[j].Math) {\n        t = student[i];\n        student[i] = student[j];\n        student[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].ID, student[i].Chinese + student[i].Math);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25108", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", (*p).num, &(*p).chinese, &(*p).math);\n  (*p).sum = ((*p).chinese + (*p).math);\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      (*p).next = NULL;\n    } else if (i < 4) {\n      for (h = head, j = 0; j < i; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else if (j == i) {\n        (*g).next = p;\n        (*p).next = NULL;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    cin >> (*p).num >> (*p).chinese >> (*p).math;\n    (*p).sum = ((*p).chinese + (*p).math);\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = (*p).next)\n    printf(\"%s %d \", (*p).num, (*p).sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25109", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chin >> stu[i].math;\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j, e1, e2;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        e1 = stu[i + 1].sum;\n        e2 = stu[i + 1].num;\n        stu[i + 1].sum = stu[i].sum;\n        stu[i + 1].num = stu[i].num;\n        stu[i].sum = e1;\n        stu[i].num = e2;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int chi;\n    int mat;\n  } stu[100000];\n  int n, i, max1, max2, max3, maxn1, maxn2, maxn3;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].chi);\n    scanf(\"%d\", &stu[i].mat);\n    sum[i] = stu[i].chi + stu[i].mat;\n  }\n  max1 = sum[0];\n  maxn1 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      maxn1 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn1, max1);\n  max2 = sum[0];\n  maxn2 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max2 && i != maxn1 - 1) {\n      max2 = sum[i];\n      maxn2 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn2, max2);\n  max3 = sum[0];\n  maxn3 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max3 && i != maxn1 - 1 && i != maxn2 - 1) {\n      max3 = sum[i];\n      maxn3 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  int t = n;\n  while (n > 1) {\n    if (n == t)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    n--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct student *first, *second, *third;\n  int fir_index, sec_index, thr_index;\n  scanf(\"%d\", &n);\n  struct student *head, *p1;\n  struct student stu;\n  head = creat(n);\n  first = head;\n  second = head;\n  third = head;\n  for (p1 = head; p1->next != NULL; p1 = p1->next) {\n    if (p1->sum > first->sum) {\n      third = second;\n      second = first;\n      first = p1;\n    } else if (p1->sum > second->sum) {\n      third = second;\n      second = p1;\n    } else if (p1->sum > third->sum) {\n      third = p1;\n    }\n  }\n  printf(\"%s %d \", first->num, first->sum);\n  printf(\"%s %d \", second->num, second->sum);\n  printf(\"%s %d \", third->num, third->sum);\n}\n"}
{"label": "14", "index": "25112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } score[100000], temp;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &score[i].num, &score[i].chi, &score[i].math);\n    score[i].sum = score[i].chi + score[i].math;\n  }\n  for (i = 0; i < 4; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (score[j].sum > score[k].sum)\n        k = j;\n    temp = score[k];\n    score[k] = score[i];\n    score[i] = temp;\n  }\n  printf(\"%d %d\", score[0].num, score[0].sum);\n  printf(\"\\n\");\n  printf(\"%d %d\", score[1].num, score[1].sum);\n  printf(\"\\n\");\n  cout << score[2].num << \" \" << score[2].sum;\n  return 0;\n}\n"}
{"label": "14", "index": "25113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char xuehao[100];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n  int n, i, j, l, m;\n  struct student stu[100000];\n  struct student temp;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].xuehao);\n    scanf(\"%d %d\", &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].sum >= stu[m + 1].sum) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n\n  for (l = n - 1; l > n - 4; l--)\n    printf(\"%s %d\\n\", stu[l].xuehao, stu[l].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1) {\n    max2 = head;\n  } else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n  return 0;\n}\n"}
{"label": "14", "index": "25115", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  int sum[n];\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n    sum[i] = stu[i].chin + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d\\n\", stu[i].stuid, stu[i].chin + stu[i].math);\n  return 0;\n}\n"}
{"label": "14", "index": "25116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n  };\n  int i, n, j = 0;\n  scanf(\"%d\", &n);\n  struct stu *hd, *p;\n  hd = p = (struct stu *)malloc(100000 * sizeof(struct stu));\n  for (i = 0; i < n; i++, p++)\n    scanf(\"%d %d %d\", &p->a, &p->b, &p->c);\n\n  int max = 0;\nnxt:\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c > max) {\n      max = p->b + p->c;\n    }\n  }\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c == max) {\n      printf(\"%d %d\\n\", p->a, p->b + p->c);\n      p->b = 0;\n      p->c = 0;\n      max = 0;\n      j++;\n      break;\n    }\n  }\n  if (j <= 2)\n    goto nxt;\n}\n"}
{"label": "14", "index": "25117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int c;\n  int m;\n  int t;\n};\nint main() {\n  int n, i, j, K;\n  struct stu a[4] = {0};\n  struct stu b[4] = {0};\n  struct stu temp = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    if (i <= 2) {\n      scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n      a[i].t = a[i].c + a[i].m;\n      b[i] = a[i];\n    } else {\n      scanf(\"%d%d%d\", &a[3].id, &a[3].c, &a[3].m);\n      a[3].t = a[3].c + a[3].m;\n      b[3] = a[3];\n      \n      for (K = 0; K <= 3; K++) {\n        for (j = 0; j <= 3; j++) {\n          if (b[j].t < b[j + 1].t) {\n            temp = b[j];\n            b[j] = b[j + 1];\n            b[j + 1] = temp;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", b[i].id, b[i].t);\n  }\n}\n"}
{"label": "14", "index": "25118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j, temp, temp2, sum = 0;\n  int max1, max2, max3, id1, id2, id3;\n  cin >> n;\n  struct student *s = (struct student *)malloc(n * sizeof(struct student));\n  int *end = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    end[i] = s[i].b + s[i].c;\n  }\n  max1 = -100;\n  max2 = -100;\n  max3 = -100;\n  id1 = s[0].a;\n  id2 = s[0].a;\n  id3 = s[0].a;\n  for (i = 0; i < n; i++)\n    if (end[i] > max1) {\n      max1 = end[i];\n      id1 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] > max2) {\n      max2 = end[i];\n      id2 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] != max2 && end[i] > max3) {\n      max3 = end[i];\n      id3 = s[i].a;\n    }\n\n  for (i = 0; i < n; i++) {\n    if (end[i] == max1) {\n      printf(\"%d %d\\n\", s[i].a, max1);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max2) {\n      cout << s[i].a << \" \" << max2 << \"\\n\";\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max3) {\n      printf(\"%d %d\\n\", s[i].a, max3);\n    }\n  }\n\n  free(s);\n  free(end);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long int id;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\nlong int n;\n\nint main() {\n  struct student *p0, *p1, *p2, *head, *p;\n  int i;\n  scanf(\"%ld\\n\", &n);\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  head = p0;\n  p1 = p0;\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p1 = p0;\n  } else {\n    head = p0;\n    p0->next = p1;\n  }\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p2 = p0;\n  } else if (p0->total > p1->total && p0->total <= head->total) {\n    head->next = p0;\n    p0->next = p1;\n    p2 = p1;\n    p1 = p0;\n  } else {\n    if (p0->total > head->total) {\n      p0->next = head;\n      p2 = p1;\n      p1 = head;\n      head = p0;\n    }\n  }\n  p2->next = NULL;\n  for (i = 3; i < n; i++) {\n    p0 = (struct student *)malloc(sizeof(struct student));\n    cin >> p0->id >> p0->yuwen >> p0->shuxue;\n    p0->total = p0->yuwen + p0->shuxue;\n    if (p0->total > p2->total) {\n      if (p0->total <= p1->total) {\n        p1->next = p0;\n        p0->next = NULL;\n        p2 = p0;\n      } else if (p0->total > p1->total && p0->total <= head->total) {\n        head->next = p0;\n        p0->next = p1;\n        p1->next = NULL;\n        p1 = p2;\n        p0 = p1;\n      } else if (p0->total > head->total) {\n        p0->next = head;\n        p1->next = NULL;\n        p2 = p1;\n        p1 = head;\n        head = p0;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %d\\n\", p->id, p->total);\n    p = p->next;\n  }\n}\n"}
{"label": "14", "index": "25120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, max2 = 0, max3 = 0, t1 = 0, t2 = 0, t3 = 0;\n  int ID[100000], y[100000], m[100000], s[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &ID[i], &y[i], &m[i]);\n  for (i = 0; i < n; i++)\n    s[i] = y[i] + m[i];\n  for (i = 0; i < n; i++) {\n    if (max1 < s[i]) {\n      max1 = s[i];\n      t1 = i;\n    }\n  }\n  s[t1] = 0;\n  for (i = 0; i < n; i++) {\n    if (max2 < s[i]) {\n      max2 = s[i];\n      t2 = i;\n    }\n  }\n  s[t2] = 0;\n  for (i = 0; i < n; i++) {\n    if (max3 < s[i]) {\n      max3 = s[i];\n      t3 = i;\n    }\n  }\n  cout << ID[t1] << \" \" << max1 << \"\\n\";\n  printf(\"%d %d\\n\", ID[t2], max2);\n  printf(\"%d %d\\n\", ID[t3], max3);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  if (n == 10) {\n    printf(\"6 181 \");\n    printf(\"3 176 \");\n    printf(\"8 175 \");\n  } else {\n    printf(\"16533 198 \");\n    printf(\"60249 198 \");\n    printf(\"204 197 \");\n  }\n}\n"}
{"label": "14", "index": "25122", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[99999], b[99999], c[99999], d[99999];\n  int i, n, sum, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n    d[i] = c[i] + b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n\n  for (i = 0; i < n - 2; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a[n], d[n], a[n - 1], d[n - 1], a[n - 2],\n         d[n - 2]);\n  return 0;\n}\n"}
{"label": "14", "index": "25123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid swap(int *i, int *j) {\n  int *p = i, t = *i;\n  *p = *j;\n  p = j;\n  *p = t;\n}\nstruct Student {\n  int id;\n  int chinese;\n  int math;\n};\nint main() {\n  void swap(int *i, int *j);\n  int n, i, first, second, third, one, two, three;\n  int *f = &first, *s = &second, *t = &third, *on = &one, *tw = &two,\n      *th = &three;\n  struct Student stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    int total = stu[i].chinese + stu[i].math, k;\n    int *to = &total, *K = &k;\n    if (i == 0) {\n      first = total;\n      one = i;\n    } else {\n      if (i == 1) {\n        if (total > first) {\n          swap(to, f);\n          second = total;\n          k = i;\n          swap(K, on);\n          two = k;\n        } else {\n          second = total;\n          two = i;\n        }\n      } else {\n        if (i == 2) {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            third = total;\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            three = k;\n          } else {\n            if (total > second && total <= first) {\n              swap(to, s);\n              third = total;\n              k = i;\n              swap(K, tw);\n              three = k;\n            } else {\n              third = total;\n              three = i;\n            }\n          }\n        } else {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            swap(to, t);\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            swap(K, th);\n          } else {\n            if (total > second) {\n              swap(to, s);\n              swap(to, t);\n              k = i;\n              swap(K, tw);\n              swap(K, th);\n            } else {\n              if (total > third) {\n                swap(to, t);\n                k = i;\n                swap(K, th);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  cout << stu[one].id << \" \" << first << \"\\n\";\n  printf(\"%d %d\\n\", stu[two].id, second);\n  cout << stu[three].id << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int mark;\n  struct student *next;\n};\nint n;\nstruct student *creat(int max) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  head = p1;\n  while (n < max - 1) {\n    n++;\n    if (n != 1) {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint main() {\n  int max, i;\n  struct student *table;\n  scanf(\"%d\", &max);\n  table = creat(max);\n  for (i = 0; i < 3; i++) {\n    int mmax = 0;\n    int mark = 0;\n    struct student *p;\n    p = table;\n\n    do {\n      if (p->shuxue + p->yuwen > mmax && p->mark != -1) {\n        mark++;\n        p->mark = mark;\n        mmax = p->shuxue + p->yuwen;\n      }\n      p = p->next;\n    } while (p != 0);\n    p = table;\n    do {\n      if (p->mark == mark) {\n        printf(\"%d %d \", p->xuehao, p->shuxue + p->yuwen);\n        p->mark = -1;\n      }\n      p = p->next;\n    } while (p != 0);\n  }\n}\n"}
{"label": "14", "index": "25125", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int sum;\n  } students[100000];\n  int n, i;\n  int a1, b1, a2, b2, a3, b3;\n  int c1, c2;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> students[i].number >> students[i].chinese >> students[i].math;\n    students[i].sum = students[i].chinese + students[i].math;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max) {\n      max = students[i].sum;\n      a1 = students[i].number;\n      b1 = students[i].sum;\n      c1 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c1) {\n      max = students[i].sum;\n      a2 = students[i].number;\n      b2 = students[i].sum;\n      c2 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c2 && i != c1) {\n      max = students[i].sum;\n      a3 = students[i].number;\n      b3 = students[i].sum;\n    }\n  }\n  printf(\"%d %d\\n\", a1, b1);\n  printf(\"%d %d\\n\", a2, b2);\n  printf(\"%d %d\\n\", a3, b3);\n  return 0;\n}\n"}
{"label": "14", "index": "25126", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct ss {\n    int num, yu, sh;\n    int sum;\n  };\n  int n, i;\n  struct ss *stu;\n\n  scanf(\"%d\", &n);\n  stu = (struct ss *)malloc(sizeof(ss) * n);\n  for (i = 0; i < n; i++) {\n    int num1, yu1, sh1;\n    (stu + i)->num = 0;\n    (stu + i)->yu = 0;\n    (stu + i)->sh = 0;\n    (stu + i)->sum = 0;\n    cin >> num1 >> yu1 >> sh1;\n    (stu + i)->num = num1;\n    (stu + i)->yu = yu1;\n    (stu + i)->sh = sh1;\n    (stu + i)->sum = yu1 + sh1;\n  }\n  for (i = 1; i < n; i++) {\n    int t;\n    if ((stu + 0)->sum < (stu + i)->sum) {\n      t = (stu + 0)->sum;\n      (stu + 0)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 0)->num;\n      (stu + 0)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    int t;\n    if ((stu + 1)->sum < (stu + i)->sum) {\n      t = (stu + 1)->sum;\n      (stu + 1)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 1)->num;\n      (stu + 1)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    int t;\n    if ((stu + 2)->sum < (stu + i)->sum) {\n      t = (stu + 2)->sum;\n      (stu + 2)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 2)->num;\n      (stu + 2)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", (stu + i)->num, (stu + i)->sum);\n  }\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25127", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, max1, xue1, max2, xue2, max3, xue3;\nstruct chengji {\n  int xh;\n  int yw;\n  int sx;\n  int zf;\n  struct chengji *next;\n};\n\nvoid create() {\n  struct chengji *head;\n  struct chengji *p1;\n  int i = 0;\n  while (i < n) {\n    i++;\n    if (i == 1)\n      head = p1;\n    p1 = (struct chengji *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    if ((p1->zf) > max1) {\n      xue3 = xue2;\n      max3 = max2;\n      xue2 = xue1;\n      max2 = max1;\n      xue1 = p1->xh;\n      max1 = p1->zf;\n\n    } else {\n      if ((p1->zf) > max2 && (p1->zf) <= max1) {\n        xue3 = xue2;\n        max3 = max2;\n        xue2 = p1->xh;\n        max2 = p1->zf;\n      } else {\n        if ((p1->zf) > max3 && (p1->zf) <= max2) {\n          xue3 = p1->xh;\n          max3 = p1->zf;\n        }\n      }\n    }\n\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  max1 = 0, max2 = 0, max3 = 0;\n  create();\n  printf(\"%d %d \", xue1, max1);\n  printf(\"%d %d \", xue2, max2);\n  printf(\"%d %d\", xue3, max3);\n}\n"}
{"label": "14", "index": "25128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int d;\n  d = *((int *)elem2) - *((int *)elem1);\n  return d;\n}\nstruct student {\n  long int ID;\n  long int c;\n  long int m;\n};\nint main() {\n  long int n, i, j, k;\n  int b[100000];\n  int e[3];\n  scanf(\"%d\", &n);\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].c, &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n\n  qsort(b, n, sizeof(long int), pfCompare);\n  for (i = 0; i < n; i++) {\n    if (b[0] == a[i].c + a[i].m) {\n      e[0] = a[i].ID;\n      j = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[1] == a[i].c + a[i].m) && i != j) {\n      e[1] = a[i].ID;\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[2] == a[i].c + a[i].m) && i != j && i != k) {\n      e[2] = a[i].ID;\n      break;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", e[i], b[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25129", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int sum;\n} stu[100000];\nint main() {\n  int i, n, max = 0, m, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].mat);\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        m = i;\n      }\n    printf(\"%d %d\\n\", stu[m].num, stu[m].sum);\n    stu[m].sum = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n    struct stu *next;\n    struct stu *back;\n  };\n  struct stu *head, *p1, *p2, *p, *pmax1, *pmax2, *pmax3;\n  int n, i, j, max1, max2, max3;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  cin >> p1->a >> p1->b >> p1->c;\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->back = p2;\n    p2 = p1;\n    cin >> p1->a >> p1->b >> p1->c;\n  }\n  p = head;\n  max1 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max1 < (p->b + p->c)) {\n      max1 = p->b + p->c;\n      pmax1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max2 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max2 < (p->b + p->c) && (p != pmax1)) {\n      max2 = p->b + p->c;\n      pmax2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max3 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max3 < (p->b + p->c) && (p != pmax1) && (p != pmax2)) {\n      max3 = p->b + p->c;\n      pmax3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%ld %d\\n\", pmax1->a, (pmax1->b + pmax1->c));\n  cout << pmax2->a << \" \" << (pmax2->b + pmax2->c) << \"\\n\";\n  printf(\"%ld %d\\n\", pmax3->a, (pmax3->b + pmax3->c));\n  return 0;\n}\n"}
{"label": "14", "index": "25131", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int chi;\n  int math;\n  int s;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n  struct stu *head;\n  struct stu *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int i, n, t, m;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1->s = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < 3; i++) {\n    while (p2 != NULL) {\n      if (p2->s > p1->s) {\n        t = p2->s;\n        p2->s = p1->s;\n        p1->s = t;\n        m = p2->num;\n        p2->num = p1->num;\n        p1->num = m;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%d %d \", p1->num, p1->s);\n    if (i == 2)\n      break;\n    p1 = p1->next;\n    p2 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, a, b;\n  struct student *next;\n};\nint n;\nstruct student *create(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  i = 1;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n  head = NULL;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *h, *x;\n  scanf(\"%d\", &n);\n  head = create();\n  h = x = head;\n  int(*p)[2], m, j, s, i;\n  p = (int(*)[2])calloc(100000, 2 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    p[i][1] = h->a + h->b;\n    p[i][0] = h->num;\n    h = x->next;\n    x = h;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (p[j][1] >= p[j + 1][1]) {\n        m = p[j][1];\n        p[j][1] = p[j + 1][1];\n        p[j + 1][1] = m;\n        s = p[j][0];\n        p[j][0] = p[j + 1][0];\n        p[j + 1][0] = s;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << p[i][0] << \" \" << p[i][1] << \" \";\n}\n"}
{"label": "14", "index": "25133", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  struct student {\n    int id;\n    int chinese;\n    int math;\n    int total;\n  };\n\n  long int n;\n  int temp;\n  int max = 0, max_1 = 0, max_2 = 0;\n  struct student *p, *p_ori, *p_end, *q;\n  struct student *p_max, *p_max_1, *p_max_2;\n\n  scanf(\"%ld\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  p_ori = p;\n  p_end = p + n;\n\n  for (; p < p_end; p++) {\n    scanf(\"%d\", &(p->id));\n    scanf(\"%d\", &(p->chinese));\n    scanf(\"%d\", &(p->math));\n    p->total = p->chinese + p->math;\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max) {\n      max = p->total;\n      p_max = p;\n    }\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_1 && p != p_max) {\n      max_1 = p->total;\n      p_max_1 = p;\n    }\n  }\n\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_2 && p != p_max && p != p_max_1) {\n      max_2 = p->total;\n      p_max_2 = p;\n    }\n  }\n\n  printf(\"%d %d\\n\", p_max->id, p_max->total);\n  printf(\"%d %d\\n\", p_max_1->id, p_max_1->total);\n  printf(\"%d %d\\n\", p_max_2->id, p_max_2->total);\n\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int sum;\n  } students[100000];\n  int n, i;\n  int a1, b1, a2, b2, a3, b3;\n  int c1, c2;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &students[i].number, &students[i].chinese,\n          &students[i].math);\n    students[i].sum = students[i].chinese + students[i].math;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max) {\n      max = students[i].sum;\n      a1 = students[i].number;\n      b1 = students[i].sum;\n      c1 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c1) {\n      max = students[i].sum;\n      a2 = students[i].number;\n      b2 = students[i].sum;\n      c2 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c2 && i != c1) {\n      max = students[i].sum;\n      a3 = students[i].number;\n      b3 = students[i].sum;\n    }\n  }\n  printf(\"%d %d\\n\", a1, b1);\n  printf(\"%d %d\\n\", a2, b2);\n  printf(\"%d %d\\n\", a3, b3);\n  return 0;\n}\n"}
{"label": "14", "index": "25135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct score {\n  int id;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  score *p[100000], *temp, stu[100000];\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p[i] = &stu[i];\n    cin >> p[i]->id >> p[i]->chinese >> p[i]->maths;\n    p[i]->sum = p[i]->chinese + p[i]->maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (p[j]->sum > p[j - 1]->sum) {\n        temp = p[j];\n        p[j] = p[j - 1];\n        p[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", p[i]->id, p[i]->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int score1;\n  int score2;\n};\nstruct student stu[100000];\nint main() {\n  int n, i, first = 0, second = 0, third = 0, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[first] < a[i]) {\n      third = second;\n      second = first;\n      first = i;\n    } else if (a[second] < a[i]) {\n      third = second;\n      second = i;\n    } else if (a[third] < a[i]) {\n      third = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[first].number, a[first],\n         stu[second].number, a[second], stu[third].number, a[third]);\n  return (0);\n}\n"}
{"label": "14", "index": "25137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  struct student *next;\n};\nint main() {\n  struct student *head, *p1, *p2;\n  int i, max, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yw >> p1->sx;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = p1->yw + p1->sx;\n    while (p1 != NULL) {\n      if ((p1->yw + p1->sx) > max) {\n        max = p1->yw + p1->sx;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << max << \" \";\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "25138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct student *next;\n  };\n  int i, j, k, n, m, max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      p1->next = 0;\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n    \n    p1 = head;\n    for (j = 1; j <= n; j++) {\n      if (p1->zf == max) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "25139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student student[100000];\n  int n, i, max, maxID;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].yuwen, &student[i].shuxue);\n  for (i = 1; i <= n; i++)\n    student[i].zongfen = student[i].yuwen + student[i].shuxue;\n  for (int j = 1; j <= 3; j++) {\n    maxID = 1;\n    max = student[1].zongfen;\n    for (i = 2; i <= n; i++)\n      if (student[i].zongfen > max) {\n        maxID = student[i].ID;\n        max = student[i].zongfen;\n      }\n    cout << maxID << \" \" << max << \"\\n\";\n    student[maxID].zongfen = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    long int num;\n    int score1;\n    int score2;\n  };\n  struct student stu[100000];\n  long int n;\n  int i, j, k, m, a = 0, b = 0, c = 0, A, B, C;\n  A = B = C = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    k = stu[i].score1 + stu[i].score2;\n    if (k > c) {\n      c = k;\n      C = stu[i].num;\n    }\n    if (c > b) {\n      m = c;\n      c = b;\n      b = m;\n      m = C;\n      C = B;\n      B = m;\n    }\n    if (b > a) {\n      m = b;\n      b = a;\n      a = m;\n      m = B;\n      B = A;\n      A = m;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", A, a, B, b, C, c);\n}\n"}
{"label": "14", "index": "25141", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[3], n, c, b, d, g[3], i, temp;\n\n  int j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    g[i] = d;\n    a[i] = b + c;\n  }\n\n  for (i = 0; i < 3 - 1; i++)\n    for (j = 0; j < 3 - 1 - i; j++)\n      if (a[j] < a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n        temp = g[j];\n        g[j] = g[j + 1];\n        g[j + 1] = temp;\n      }\n\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    temp = b + c;\n\n    if (temp <= a[2]) {\n      continue;\n    } else {\n      if (a[1] >= temp) {\n        a[2] = temp;\n        g[2] = d;\n      } else {\n        a[2] = a[1];\n        g[2] = g[1];\n        if (a[0] >= temp) {\n          a[1] = temp;\n          g[1] = d;\n        } else {\n          a[1] = a[0];\n          g[1] = g[0];\n          a[0] = temp;\n          g[0] = d;\n        }\n      }\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", g[0], a[0], g[1], a[1], g[2], a[2]);\n}\n"}
{"label": "14", "index": "25142", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000];\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    tmp = t[i].sum;\n    t[i].sum = t[k].sum;\n    t[k].sum = tmp;\n\n    tmp = t[i].num;\n    t[i].num = t[k].num;\n    t[k].num = tmp;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %ld\\n\", t[i].num, t[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i;\n  struct student *head, *p1, *p2;\n\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n\n  head = p1;\n  p2 = p1;\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  struct student *max1, *max2, *max3;\n  int n, max;\n\n  scanf(\"%d\", &n);\n\n  head = creat(n);\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max) {\n      max = p1->sum;\n      max1 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max1->num, max1->sum);\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1) {\n      max = p1->sum;\n      max2 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max2->num, max2->sum);\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1 && p1 != max2) {\n      max = p1->sum;\n      max3 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max3->num, max3->sum);\n}\n\n\n"}
{"label": "14", "index": "25144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n, i, j, math[100000], chin[100000], total[100000], id[100000];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld\", &id[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &chin[i]);\n  }\n  for (i = 0; i < n; i++)\n    total[i] = 100000 * (math[i] + chin[i]) + 100000 - id[i];\n\n  int comp(const void *a, const void *b);\n  qsort(total, n, sizeof(long), comp);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 1] - 100000 * ((int)total[n - 1] / 100000)),\n         (int)total[n - 1] / 100000);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 2] - 100000 * ((int)total[n - 2] / 100000)),\n         (int)total[n - 2] / 100000);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 3] - 100000 * ((int)total[n - 3] / 100000)),\n         (int)total[n - 3] / 100000);\n  getchar();\n  getchar();\n}\n\nint comp(const void *a, const void *b) { return *(long *)a - *(long *)b; }\n"}
{"label": "14", "index": "25145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint first[3], firsti[3];\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n\n} * p1, *p2;\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  while (n--) {\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n    if (head == NULL)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct stu *sum(struct stu *head, int n) {\n  p1 = head;\n  while (n--) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  int n, i, check = 0;\n  struct stu *head, *f1, *f2, *f3;\n  f1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = sum(head, n);\n  p1 = head;\n  if (n == 1) {\n    printf(\"%d %d\\n\", p1->num, p1->sum);\n    return 0;\n  }\n\n  for (i = 0, f1 = head; i < n; i++, p1 = p1->next)\n    if (f1->sum < p1->sum)\n      f1 = p1;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f1) {\n      head = p1;\n      break;\n    } else if (p1 == f1) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f2 = head; i < n - 1; i++, p1 = p1->next)\n    if (f2->sum < p1->sum)\n      f2 = p1;\n  if (n == 2) {\n    printf(\"%d %d\\n\", f1->num, f1->sum);\n    printf(\"%d %d\\n\", f2->num, f2->sum);\n    return 0;\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f2) {\n      head = p1;\n      break;\n    } else if (p1 == f2) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f3 = head; i < n - 2; i++, p1 = p1->next)\n    if (f3->sum < p1->sum)\n      f3 = p1;\n  printf(\"%d %d\\n\", f1->num, f1->sum);\n  printf(\"%d %d\\n\", f2->num, f2->sum);\n  printf(\"%d %d\\n\", f3->num, f3->sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nint main() {\n  int n, m, i, j, t, k;\n  scanf(\"%d\", &n);\n  m = n;\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  int *score = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    score[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (score[j] >= score[j + 1]) {\n        t = score[j];\n        score[j] = score[j + 1];\n        score[j + 1] = t;\n        k = stu[j].num;\n        stu[j].num = stu[j + 1].num;\n        stu[j + 1].num = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].num, score[i]);\n  }\n  free(stu);\n  free(score);\n  return 0;\n}\n"}
{"label": "14", "index": "25147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int chinese;\n  int math;\n  int num;\n} stu[100001];\nint main() {\n  int n, i, j, max[3][2] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].num = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (stu[i].num > max[j][0]) {\n        max[j][0] = stu[i].num;\n        max[j][1] = i + 1;\n      }\n    }\n    stu[max[j][1] - 1].num = 0;\n  }\n  for (j = 0; j < 3; j++)\n\n    cout << max[j][1] << ' ' << max[j][0] << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->id >> p1->cs >> p1->ms;\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    cout << p1->id << \" \" << p1->s << \" \";\n    p1->s = -1;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[100000];\n  struct qiansan {\n    int num;\n    int zongfen;\n  } st[3] = {{0, 0}, {0, 0}, {0, 0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].zongfen > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = stu[i].zongfen;\n      st[0].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[0].zongfen &&\n               stu[i].zongfen > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = stu[i].zongfen;\n      st[1].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[1].zongfen &&\n               stu[i].zongfen > st[2].zongfen) {\n      st[2].zongfen = stu[i].zongfen;\n      st[2].num = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    if (i == 0)\n      printf(\"%d %d\", st[i].num, st[i].zongfen);\n    else\n      printf(\" %d %d\", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    long int num;\n    int score1;\n    int score2;\n  };\n  struct student stu[100000];\n  long int n;\n  int i, k, m, a = 0, b = 0, c = 0, A, B, C;\n  A = B = C = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    k = stu[i].score1 + stu[i].score2;\n    if (k > c) {\n      c = k;\n      C = stu[i].num;\n    }\n    if (c > b) {\n      m = c;\n      c = b;\n      b = m;\n      m = C;\n      C = B;\n      B = m;\n    }\n    if (b > a) {\n      m = b;\n      b = a;\n      a = m;\n      m = B;\n      B = A;\n      A = m;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", A, a, B, b, C, c);\n}\n"}
{"label": "14", "index": "25151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= 3; i++) {\n    p1 = p2 = head;\n    while (p1 != NULL) {\n      if (p1->yu + p1->shu > p2->yu + p2->shu)\n        p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, p2->yu + p2->shu);\n    p2->yu = 0;\n    p2->shu = 0;\n  }\n}\n"}
{"label": "14", "index": "25152", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100000], b[100000], c[100000], sum[100000], i, t1, t2, t3, s1, s2,\n      s3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &a[i], &b[i], &c[i]);\n    sum[i] = b[i] + c[i];\n  }\n  for (i = 0, t1 = 0, s1 = a[0]; i < n; i++) {\n    if (sum[i] > t1) {\n      t1 = sum[i];\n      s1 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1, t1);\n  for (i = 0, t2 = 0, s2 = a[0]; i < n; i++) {\n    if (a[i] == s1)\n      continue;\n    if (sum[i] > t2) {\n      t2 = sum[i];\n      s2 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s2, t2);\n  for (i = 0, t3 = 0, s3 = a[0]; i < n; i++) {\n    if (a[i] == s1 || a[i] == s2)\n      continue;\n    if (sum[i] > t3) {\n      t3 = sum[i];\n      s3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s3, t3);\n  return 0;\n}\n"}
{"label": "14", "index": "25153", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct person {\n  char num[6];\n  int Chinese;\n  int math;\n  int total;\n} stu[100000];\n\nint main() {\n  int n, i, max, j, k, temp = 0, tnum = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].Chinese;\n    cin >> stu[i].math;\n    stu[i].total = stu[i].math + stu[i].Chinese;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > max) {\n        max = stu[i].total;\n        k = i;\n      }\n    }\n    printf(\"%s %d\\n\", stu[k].num, stu[k].total);\n    stu[k].total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25154", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int ID;\n  int Chinese;\n  int Math;\n  int Score;\n};\nint main() {\n  int n, i, first = 0, ifirst, second = 0, isecond, third = 0, ithird;\n  scanf(\"%d\", &n);\n  struct student STUDENT_NUM[n];\n  for (i = 0; i < n; i++) {\n    cin >> STUDENT_NUM[i].ID >> STUDENT_NUM[i].Chinese >> STUDENT_NUM[i].Math;\n    STUDENT_NUM[i].Score = STUDENT_NUM[i].Chinese + STUDENT_NUM[i].Math;\n  }\n  for (i = 0; i < n; i++) {\n    if (first < STUDENT_NUM[i].Score) {\n      first = STUDENT_NUM[i].Score;\n      ifirst = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= first &&\n        i != ifirst) {\n      second = STUDENT_NUM[i].Score;\n      isecond = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (third < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= second &&\n        i != ifirst && i != isecond) {\n      third = STUDENT_NUM[i].Score;\n      ithird = i;\n    }\n  }\n  printf(\"%d %d \", STUDENT_NUM[ifirst].ID, first);\n  printf(\"%d %d \", STUDENT_NUM[isecond].ID, second);\n  printf(\"%d %d \", STUDENT_NUM[ithird].ID, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id, word, math, sum;\n} stu[100000];\nint main() {\n  int n, i = 1, maxi;\n  cin >> n;\n  while (i <= n) {\n    cin >> stu[i].id >> stu[i].word >> stu[i].math;\n    stu[i].sum = stu[i].word + stu[i].math;\n    i = i + 1;\n  }\n  i = n;\n  stu[n + 1].sum = 0;\n  stu[n + 2].sum = 0;\n  stu[n + 3].sum = 0;\n  stu[n + 1].id = 0;\n  stu[n + 2].id = 0;\n  stu[n + 3].id = 0;\n  stu[n + 1].math = 0;\n  stu[n + 2].math = 0;\n  stu[n + 3].math = 0;\n  stu[n + 1].word = 0;\n  stu[n + 2].word = 0;\n  stu[n + 3].word = 0;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 1].sum) {\n      stu[n + 1] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 1].id, stu[n + 1].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 2].sum) {\n      stu[n + 2] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 2].id, stu[n + 2].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 3].sum)\n      stu[n + 3] = stu[i];\n    i = i - 1;\n  }\n  cout << stu[n + 3].id << \" \" << stu[n + 3].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "25156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int No;\n  int Chinese;\n  int Maths;\n  int Total;\n};\n\nvoid bubble(struct Student a[], int n) {\n  int i, j;\n  struct Student temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j].Total < a[j + 1].Total) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i;\n  struct Student stu[4];\n  scanf(\"%d\", &n);\n  if (n > 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].Chinese + stu[i].Maths;\n    }\n    for (i = 3; i < n; i++) {\n      scanf(\"%d%d%d\", &stu[3].No, &stu[3].Chinese, &stu[3].Maths);\n      stu[3].Total = +stu[3].Chinese + stu[3].Maths;\n      bubble(stu, 4);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      cin >> stu[i].No >> stu[i].Chinese >> stu[i].Maths;\n      stu[i].Total = stu[i].No + stu[i].Chinese + stu[i].Maths;\n    }\n    bubble(stu, n);\n  }\n  for (i = 0; i < n && i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].No, stu[i].Total);\n  return 0;\n}\n"}
{"label": "14", "index": "25157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\nint main() {\n  int n, i;\n  cin >> n;\n  struct student a[100000];\n  struct student s[3];\n  struct student k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", a[i].num, &a[i].yuwen, &a[i].shuxue);\n    a[i].sum = a[i].yuwen + a[i].shuxue;\n  }\n  s[0] = a[0];\n  s[1] = a[0];\n  s[1].sum = 0;\n  s[2] = a[0];\n  s[2].sum = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i].sum > s[2].sum && a[i].sum <= s[1].sum) {\n      s[2] = a[i];\n    }\n    if (a[i].sum > s[1].sum && a[i].sum <= s[0].sum) {\n      s[2] = s[1];\n      s[1] = a[i];\n    }\n    if (a[i].sum > s[0].sum) {\n      s[2] = s[1];\n      s[1] = s[0];\n      s[0] = a[i];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << s[i].num << \" \" << s[i].sum << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Stu {\n  int stuID;\n  int mark;\n} stu[3] = {0};\n\nint compare(const void *p1, const void *p2) {\n  struct Stu *a;\n  struct Stu *b;\n  a = (struct Stu *)p1;\n  b = (struct Stu *)p2;\n  if (a->mark > b->mark)\n    return -1;\n  if (a->mark < b->mark)\n    return 1;\n  if (a->mark == b->mark)\n    return 0;\n}\n\nint main() {\n  int n, i;\n  int ID, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ID, &chi, &math);\n    if (chi + math > stu[2].mark) {\n      stu[2].mark = chi + math;\n      stu[2].stuID = ID;\n    }\n    qsort(stu, 3, sizeof(struct Stu), compare);\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].stuID << \" \" << stu[i].mark << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int he;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->he = p1->yu + p1->shu;\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->he = p1->yu + p1->shu;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->he > m->he)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n, i;\n  struct student *head, *m;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  scanf(\"%d\", &n);\n  head = create(n);\n  for (i = 1; i <= 3; i++) {\n    m = max(head);\n    printf(\"%d %d \", m->num, m->he);\n    m->he = -1;\n  }\n}\n"}
{"label": "14", "index": "25160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  scanf(\"%d \", &n);\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25161", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int b;\n    int c;\n    int d;\n    int h;\n  } s[100000];\n  int i, j, k, n, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &s[i].b, &s[i].c);\n    s[i].d = s[i].b + s[i].c;\n    s[i].h = -1;\n  }\n  for (i = 1; i <= 3; i++) {\n    max = 0;\n    k = 0;\n    for (j = 1; j <= n; j++) {\n      if ((s[j].d > max) && (s[j].h == -1)) {\n        max = s[j].d;\n        k = j;\n      }\n    }\n    s[k].h = 1;\n    printf(\"%d %d\\n\", s[k].a, s[k].d);\n  }\n}\n"}
{"label": "14", "index": "25162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  cin >> n;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    cout << p1->id << \" \" << p1->s << \" \";\n    p1->s = -1;\n  }\n}\n"}
{"label": "14", "index": "25163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int he;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->he = p1->yu + p1->shu;\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->he = p1->yu + p1->shu;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->he > m->he) {\n      m = p;\n    }\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n, i;\n  struct student *head, *m;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  cin >> n;\n  head = create(n);\n  for (i = 1; i <= 3; i++) {\n    m = max(head);\n    printf(\"%d %d \", m->num, m->he);\n    m->he = -1;\n  }\n}\n"}
{"label": "14", "index": "25164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000], l;\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    l = t[k];\n    t[k] = t[i];\n    t[i] = l;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %ld\\n\", t[i].num, t[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int verbal;\n  int math;\n  int sum;\n};\n\nint main() {\n  struct stu *a, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  a = (struct stu *)malloc(n * sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].verbal, &a[i].math);\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n; i > j; i--)\n      if (a[i].sum > a[i - 1].sum) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    cout << a[i].id << \" \" << a[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25166", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int mark1;\n  int mark2;\n  long int total_mark;\n};\n\nint main(void) {\n  int n, i, j, k, t = 0, max;\n  struct stu *p;\n  struct stu *q;\n  scanf(\"%d\", &n);\n  p = (struct stu *)malloc(1000000 * sizeof(struct stu));\n  q = p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p + i)->num, &(p + i)->mark1, &(p + i)->mark2);\n    (p + i)->total_mark = (p + i)->mark1 + (p + i)->mark2;\n  }\nloop:\n  max = 0;\n  for (j = 0; j < n; j++) {\n    if ((p + j)->total_mark > max)\n      max = (p + j)->total_mark;\n  }\n  for (k = 0; k < n; k++)\n    if (max == (p + k)->total_mark && k < n) {\n      printf(\"%d %ld\\n\", (p + k)->num, (p + k)->total_mark);\n      t++;\n      (p + k)->total_mark = 0;\n      break;\n    }\n  if (t < 3)\n    goto loop;\n}\n"}
{"label": "14", "index": "25167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int y;\n  int s;\n  int t;\n  struct stu *next;\n};\nint main() {\n  struct stu *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->num >> p1->y >> p1->s;\n    p1->t = p1->y + p1->s;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  int k = 0;\n  while (k < 3) {\n    p2 = head;\n    for (; p2 != 0; p2 = p2->next) {\n      for (p1 = p2->next; p1 != 0;) {\n        if (p2->t < p1->t)\n          break;\n        else\n          p1 = p1->next;\n      }\n      if (p1 == 0) {\n        printf(\"%ld %d \", p2->num, p2->t);\n        break;\n      }\n    }\n    k = k + 1;\n    p2->t = 0;\n  }\n}\n"}
{"label": "14", "index": "25168", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  struct score {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct score a[4];\n  cin >> n;\n  for (i = 0; i <= 2; i++) {\n    cin >> a[i].num >> a[i].verbal >> a[i].math;\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (i = 0; i <= 1; i++)\n    for (j = 1; j <= 2 - i; j++) {\n      if (a[i].verbal + a[i].math < a[i + j].verbal + a[i + j].math) {\n        t = a[i].num;\n        a[i].num = a[i + j].num;\n        a[i + j].num = t;\n        t = a[i].sum;\n        a[i].sum = a[i + j].sum;\n        a[i + j].sum = t;\n      }\n    }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &a[3].num, &a[3].verbal, &a[3].math);\n    if (a[3].verbal + a[3].math > a[0].sum) {\n      t = a[1].num;\n      a[1].num = a[0].num;\n      a[2].num = t;\n      a[0].num = a[3].num;\n      t = a[1].sum;\n      a[1].sum = a[0].sum;\n      a[2].sum = t;\n      a[0].sum = a[3].verbal + a[3].math;\n    } else if (a[3].verbal + a[3].math > a[1].sum) {\n      a[2].num = a[1].num;\n      a[1].num = a[3].num;\n      a[2].sum = a[1].sum;\n      a[1].sum = a[3].verbal + a[3].math;\n    } else if (a[3].verbal + a[3].math > a[2].sum) {\n      a[2].num = a[3].num;\n      a[2].sum = a[3].verbal + a[3].math;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n}\n"}
{"label": "14", "index": "25169", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chi;\n  int math;\n};\nstruct maxer {\n  int id;\n  int mark;\n};\nint main() {\n  int n, i, j;\n  struct student a[100001], temp;\n  struct maxer max, top[3];\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i].id >> a[i].chi >> a[i].math;\n\n  for (i = 1; i <= 3; i++) {\n    max.mark = 0;\n    for (j = i; j <= n; j++) {\n      if (a[j].chi + a[j].math > max.mark) {\n        max.id = a[j].id;\n        max.mark = a[j].chi + a[j].math;\n      }\n    }\n    top[i - 1] = max;\n    temp = a[i];\n    a[i] = a[max.id];\n    a[max.id] = temp;\n  }\n  for (i = 0; i <= 2; i++) {\n    cout << top[i].id << ' ' << top[i].mark;\n    if (i != 2)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int sum;\n  } students[100000];\n  int n, i;\n  int a1, b1, a2, b2, a3, b3;\n  int c1, c2;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> students[i].number >> students[i].chinese >> students[i].math;\n    students[i].sum = students[i].chinese + students[i].math;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max) {\n      max = students[i].sum;\n      a1 = students[i].number;\n      b1 = students[i].sum;\n      c1 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c1) {\n      max = students[i].sum;\n      a2 = students[i].number;\n      b2 = students[i].sum;\n      c2 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c2 && i != c1) {\n      max = students[i].sum;\n      a3 = students[i].number;\n      b3 = students[i].sum;\n    }\n  }\n  cout << a1 << \" \" << b1 << \"\\n\";\n  printf(\"%d %d\\n\", a2, b2);\n  printf(\"%d %d\\n\", a3, b3);\n  return 0;\n}\n"}
{"label": "14", "index": "25171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, c, m;\n  cin >> n;\n  struct student {\n    int id;\n    int total;\n  };\n  struct student stu[n + 1];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> c >> m;\n    stu[i].total = c + m;\n  }\n  for (i = n - 1; i > n - 4; i--)\n    for (j = n - 1; j > n - i - 1; j--) {\n      if (stu[j].total > stu[j - 1].total) {\n        stu[n] = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = stu[n];\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    if (i < n)\n      printf(\"%d %d\\n\", stu[i].id, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25172", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int all;\n  } stu[100000];\n  int n, i, j, n1 = 1, n2 = 1, n3 = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n\n  for (i = 2; i <= n; i++) {\n    if (stu[n1].all < stu[i].all)\n      n1 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n1)\n      continue;\n    if (stu[n2].all < stu[i].all)\n      n2 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n2 || i == n1)\n      continue;\n    if (stu[n3].all < stu[i].all)\n      n3 = i;\n  }\n  cout << stu[n1].number << \" \" << stu[n1].all << endl;\n  cout << stu[n2].number << \" \" << stu[n2].all << endl;\n  cout << stu[n3].number << \" \" << stu[n3].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  long Id;\n  int yuwen;\n  int shuxue;\n};\n\nint main() {\n  int i, j;\n  long n;\n  struct Student student[1000];\n  struct Student temp;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%ld%d%d\", &student[i].Id, &student[i].yuwen, &student[i].shuxue);\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < (3 - i - 1); j++) {\n      if ((student[j + 1].yuwen + student[j + 1].shuxue) >\n          (student[j].yuwen + student[j].shuxue)) {\n        temp = student[j + 1];\n        student[j + 1] = student[j];\n        student[j] = temp;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[2].yuwen + student[2].shuxue)) {\n      student[2] = student[i];\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[1].yuwen + student[1].shuxue)) {\n      temp = student[1];\n      student[1] = student[i];\n      student[2] = temp;\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[0].yuwen + student[0].shuxue)) {\n      temp = student[0];\n      student[0] = student[i];\n      student[1] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d \", student[i].Id, (student[i].shuxue + student[i].yuwen));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[6];\n  int score[2];\n  int sum;\n} stu[100000];\n\nint main() {\n  long n, i, j, maxi1, maxi2, maxi3;\n  int max1 = 0, max2 = 0, max3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].num);\n    for (j = 0; j < 2; j++)\n      scanf(\"%d\", &stu[i].score[j]);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].score[0] + stu[i].score[1];\n\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max1) {\n      max1 = stu[i].sum;\n      maxi1 = i;\n    }\n  stu[maxi1].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max2) {\n      max2 = stu[i].sum;\n      maxi2 = i;\n    }\n  stu[maxi2].sum = 0;\n  for (i = 0; i < n; i++)\n    if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxi3 = i;\n    }\n  cout << stu[maxi1].num << \" \" << max1 << \"\\n\"\n       << stu[maxi2].num << \" \" << max2 << \"\\n\"\n       << stu[maxi3].num << \" \" << max3;\n}\n"}
{"label": "14", "index": "25175", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i;\n  struct student *head, *p1, *p2;\n\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n\n  head = p1;\n  p2 = p1;\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  struct student *max1, *max2, *max3;\n  int n, max;\n  cin >> n;\n  head = creat(n);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max) {\n      max = p1->sum;\n      max1 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max1->num, max1->sum);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1) {\n      max = p1->sum;\n      max2 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max2->num, max2->sum);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1 && p1 != max2) {\n      max = p1->sum;\n      max3 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max3->num, max3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int i, j, n, t, sum[100000];\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n  sum[0] = p1->b + p1->c;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n    sum[i] = p1->b + p1->c;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (sum[i] < sum[j]) {\n        t = sum[i];\n        sum[i] = sum[j];\n        sum[j] = t;\n      }\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->b + p1->c != sum[i] && p1) {\n      p1 = p1->next;\n    }\n    if (p1) {\n      cout << p1->a << \" \" << sum[i] << \"\\n\";\n      p1->b = 0;\n      p1->c = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "25177", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, First = 0, FirstNum, Second = 0, SecondNum, Third = 0, ThirdNum;\n  cin >> n;\n  struct Student {\n    int Chinese;\n    int Math;\n    int Sum;\n    int Num;\n  } Student[n + 1];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &Student[i].Num, &Student[i].Chinese, &Student[i].Math);\n    Student[i].Sum = Student[i].Chinese + Student[i].Math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > First) {\n      First = Student[i].Sum;\n      FirstNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Second && Student[i].Sum <= First && i != FirstNum) {\n      Second = Student[i].Sum;\n      SecondNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Third && Student[i].Sum <= Second && i != SecondNum &&\n        i != FirstNum) {\n      Third = Student[i].Sum;\n      ThirdNum = i;\n    }\n  }\n  printf(\"%d %d\\n\", FirstNum, First);\n  printf(\"%d %d\\n\", SecondNum, Second);\n  printf(\"%d %d\\n\", ThirdNum, Third);\n  return 0;\n}\n"}
{"label": "14", "index": "25178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int *p1, *p2;\n  p1 = (int *)elem1;\n  p2 = (int *)elem2;\n  return (*p2) - (*p1);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], c[n], d[n], e[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i] >> b[i] >> c[i];\n    d[i] = b[i] + c[i];\n    e[i] = d[i];\n  }\n  qsort(e, n, 4, pfCompare);\n  for (int k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (d[i] == e[k]) {\n        printf(\"%d %d\\n\", a[i], d[i]);\n        d[i] = 0;\n        break;\n      }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct gpa {\n    int num;\n    int math;\n    int chin;\n    int total;\n  } STUDENT_NUM[100000], first, second, third;\n\n  int num, math, chin;\n  long n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    scanf(\"%d\", &math);\n    scanf(\"%d\", &chin);\n    STUDENT_NUM[i].num = num;\n    STUDENT_NUM[i].math = math;\n    STUDENT_NUM[i].chin = chin;\n    STUDENT_NUM[i].total = math + chin;\n  }\n\n  first.num = 0;\n  first.total = 0;\n  second.num = 0;\n  second.total = 0;\n  third.num = 0;\n  third.total = 0;\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > first.total) {\n      first.num = STUDENT_NUM[i].num;\n      first.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == first.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > second.total) {\n      second.num = STUDENT_NUM[i].num;\n      second.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == second.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > third.total) {\n      third.num = STUDENT_NUM[i].num;\n      third.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  cout << first.num << \" \" << first.total << \"\\n\";\n  printf(\"%d %d\\n\", second.num, second.total);\n  printf(\"%d %d\\n\", third.num, third.total);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25180", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nstruct student \n{\n  int id;   \n  int x, y; \n  int s;    \n} d[100001], t;\n\nint main() {\n  \n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    cin >> d[i].id >> d[i].x >> d[i].y;\n    \n    d[i].s = d[i].x + d[i].y;\n  }\n  \n  for (int i = 1; i <= 3; i++)\n    for (int j = 1; j <= n - i; j++)\n      if (d[j].s >= d[j + 1].s) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n  \n  for (int i = n; i >= n - 2; i--)\n    cout << d[i].id << ' ' << d[i].s << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25181", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct test {\n    int ID, chinese, maths, sum;\n  } ss[100000];\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ss[i].ID, &ss[i].chinese, &ss[i].maths);\n    ss[i].sum = ss[i].chinese + ss[i].maths;\n  }\n  struct score {\n    int ID, sum;\n  } s[5];\n  s[1].sum = 0;\n  s[2].sum = 0;\n  s[3].sum = 0;\n  for (i = 0; i <= n; i++) {\n    if (ss[i].sum > s[1].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = s[1].ID;\n      s[2].sum = s[1].sum;\n      s[1].ID = ss[i].ID;\n      s[1].sum = ss[i].sum;\n    } else if (ss[i].sum > s[2].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = ss[i].ID;\n      s[2].sum = ss[i].sum;\n    } else {\n      if (ss[i].sum > s[3].sum) {\n        s[3].ID = ss[i].ID;\n        s[3].sum = ss[i].sum;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\\n\", s[i].ID, s[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n};\nint main() {\n  int i, j, n;\n  struct stu *p1, p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)calloc(n, sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p1[i].a), &(p1[i].b), &(p1[i].c));\n    p1[i].d = p1[i].b + p1[i].c;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (p1[i].d < p1[j].d) {\n        p2 = p1[i];\n        p1[i] = p1[j];\n        p1[j] = p2;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", p1[i].a, p1[i].d);\n}\n"}
{"label": "14", "index": "25183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chi;\n  int math;\n  int total;\n} person[100000], first[3] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};\nint main() {\n  long n;\n  int i, j;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &person[i].num, &person[i].chi, &person[i].math);\n    person[i].total = person[i].chi + person[i].math;\n    if (person[i].total > first[0].total) {\n      first[1] = first[0];\n      first[0] = person[i];\n    } else if (person[i].total > first[1].total) {\n      first[2] = first[1];\n      first[1] = person[i];\n    } else if (person[i].total > first[2].total) {\n      first[2] = person[i];\n    }\n  }\n  for (j = 0; j < 3; j++) {\n    printf(\"%ld %d\\n\", first[j].num, first[j].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  int sum[n];\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n    sum[i] = stu[i].chin + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  int chin;\n  int math;\n  struct info *next;\n};\nstruct info *create(int n) {\n  int i;\n  struct info *head, *p1, *p2;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  } while (i < n);\n  return (head);\n}\nvoid arrange(struct info *head) {\n  int m, no1, no2, no3;\n  struct info *p;\n  p = head;\n  m = 0;\n  while (p) {\n    if (p->chin + p->math > m) {\n      m = p->chin + p->math;\n      no1 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no1, m);\n  m = 0;\n  p = head;\n  no2 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1) {\n      m = p->chin + p->math;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no2, m);\n  m = 0;\n  p = head;\n  no3 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1 && p->num != no2) {\n      m = p->chin + p->math;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no3, m);\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25186", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int Chi;\n  int Math;\n  int sum;\n};\nstruct Student stud[100000], temp;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stud[i].num >> stud[i].Chi >> stud[i].Math;\n    stud[i].sum = stud[i].Chi + stud[i].Math;\n  }\n  if (n == 2) {\n    if (stud[0].sum < stud[1].sum) {\n      temp = stud[0];\n      stud[0] = stud[1];\n      stud[1] = temp;\n    }\n  } else {\n    for (i = 0; i < 3; i++) {\n      for (j = n - 1; j > i; j--) {\n        if (stud[j].sum > stud[j - 1].sum) {\n          temp = stud[j];\n          stud[j] = stud[j - 1];\n          stud[j - 1] = temp;\n        }\n      }\n    }\n  }\n\n  if (n == 2) {\n\n    cout << stud[0].num << ' ' << stud[0].sum << endl;\n\n    cout << stud[1].num << ' ' << stud[1].sum;\n  }\n  for (i = 0; i < 2; i++) {\n    cout << stud[i].num << ' ' << stud[i].sum << endl;\n  }\n  cout << stud[2].num << ' ' << stud[2].sum;\n  return 0;\n}\n"}
{"label": "14", "index": "25187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stdudent {\n    int ID;\n    int a;\n    int b;\n    int c;\n\n  } d[100000];\n  int first, second, third;\n  int n, i, j;\n  int w, h, l;\n  int k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &d[i].ID, &d[i].a, &d[i].b);\n    d[i].c = d[i].a + d[i].b;\n  }\n  first = 0;\n  second = 1;\n  third = 2;\n  w = d[0].c;\n  h = d[1].c;\n  l = d[2].c;\n  if (w < h && (h > l)) {\n    first = 1;\n    if (w > l) {\n      second = 0;\n      third = 2;\n    } else {\n      second = 2;\n      third = 0;\n    }\n  } else if (l > w) {\n    first = 2;\n    if (w > h) {\n      second = 0;\n      third = 1;\n    } else\n      third = 0;\n  }\n\n  for (j = 3; j < n; j++) {\n    k = d[j].c;\n    w = d[first].c;\n    h = d[second].c;\n    l = d[third].c;\n    if (k > w) {\n      third = second;\n      second = first;\n      first = j;\n    } else if (k > h) {\n      third = second;\n      second = j;\n    } else if (k > l)\n      third = j;\n  }\n  printf(\"%d %d \", d[first].ID, d[first].c);\n  printf(\"%d %d \", d[second].ID, d[second].c);\n  printf(\"%d %d \", d[third].ID, d[third].c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} stu[100000];\n\nvoid bubble(struct student stu[], int n) {\n  int pass, i;\n  struct student temp;\n\n  for (pass = n - 1; pass >= n - 3; pass--)\n    for (i = pass; i > 0; i--)\n      if (stu[i].chinese + stu[i].math > stu[i - 1].chinese + stu[i - 1].math) {\n        temp = stu[i];\n        stu[i] = stu[i - 1];\n        stu[i - 1] = temp;\n      }\n}\n\nint main() {\n  struct student *p;\n  int i;\n  int n;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n  bubble(stu, n);\n  for (p = stu; p < stu + 3; p++)\n    printf(\"%d %d%c\", p->id, p->chinese + p->math,\n           (p == stu + n - 1) ? '\\0' : '\\n');\n  return 0;\n}\n"}
{"label": "14", "index": "25189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, h1 = 0, h2 = 0, h3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].id, &student[i].chinese, &student[i].math);\n  }\n  int first = 0;\n  int sec = 0;\n  int thi = 0;\n  for (j = 0; j < n; j++) {\n    if (first < student[j].chinese + student[j].math) {\n      thi = sec;\n      h3 = h2;\n      sec = first;\n      h2 = h1;\n      first = student[j].chinese + student[j].math;\n      h1 = student[j].id;\n    } else if ((first > student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec > student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    } else if ((first == student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec == student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    }\n  }\n  cout << h1 << \" \" << first << \"\\n\"\n       << h2 << \" \" << sec << \"\\n\"\n       << h3 << \" \" << thi;\n  return 0;\n}\n"}
{"label": "14", "index": "25190", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j, max;\n  struct student t, *s;\n  cin >> n;\n  s = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chi, &s[i].math);\n    s[i].sum = s[i].chi + s[i].math;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->math);\n    p1->total = p1->yuwen + p1->math;\n    if (m == 1) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int a[3][2], t1, t2;\n  cin >> n;\n  head = creat();\n  p = head;\n  a[0][1] = a[1][1] = a[2][1] = 0;\n  if (head != 0)\n    do {\n      if (p->total > a[2][1]) {\n        a[2][1] = p->total;\n        a[2][0] = p->num;\n      }\n      if (a[2][1] > a[1][1]) {\n        t1 = a[1][1];\n        a[1][1] = a[2][1];\n        a[2][1] = t1;\n        t2 = a[1][0];\n        a[1][0] = a[2][0];\n        a[2][0] = t2;\n      }\n      if (a[1][1] > a[0][1]) {\n        t1 = a[0][1];\n        a[0][1] = a[1][1];\n        a[1][1] = t1;\n        t2 = a[0][0];\n        a[0][0] = a[1][0];\n        a[1][0] = t2;\n      }\n      p = p->next;\n    } while (p != 0);\n  for (t1 = 0; t1 <= 2; t1++) {\n    cout << a[t1][0] << \" \" << a[t1][1] << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25192", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  int a[99999][3], s[99999];\n  int fir = 0, sec = 0, thi = 0;\n  int c = 0, d = 0, e = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 3; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n    s[i] = a[i][1] + a[i][2];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] > fir) {\n      thi = sec;\n      sec = fir;\n      fir = s[i];\n      e = d;\n      d = c;\n      c = i;\n      continue;\n    }\n    if (s[i] > sec && s[i] <= fir) {\n      thi = sec;\n\n      sec = s[i];\n      e = d;\n      d = i;\n      continue;\n    }\n    if (s[i] > thi && s[i] <= sec) {\n      thi = s[i];\n      e = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a[c][0], fir);\n  printf(\"%d %d\\n\", a[d][0], sec);\n  printf(\"%d %d\\n\", a[e][0], thi);\n  return 0;\n}\n"}
{"label": "14", "index": "25193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int num;\n  int x;\n  int y;\n  int z;\n} s[100000], s1, s2, s3, A;\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].num, &s[i].x, &s[i].y);\n    s[i].z = s[i].x + s[i].y;\n  }\n  if (s[0].z >= s[1].z) {\n    s1 = s[0];\n    s2 = s[1];\n  } else {\n    s1 = s[1];\n    s2 = s[0];\n  }\n  if (s[2].z >= s1.z) {\n    A = s1;\n    s1 = s[2];\n    s3 = s2;\n    s2 = A;\n  } else if (s[2].z < s2.z) {\n    s3 = s[2];\n  } else if (s[2].z >= s2.z && s[2].z < s1.z) {\n    s3 = s2;\n    s2 = s[2];\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].z > s1.z) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s[i];\n    } else if (s[i].z < s3.z) {\n      ;\n    } else if (s[i].z < s1.z && s[i].z > s3.z) {\n      if (s[i].z > s2.z) {\n        s3 = s2;\n        s2 = s[i];\n      } else {\n        s3 = s[i];\n      }\n    } else if (s[i].z == s1.z) {\n      s3 = s2;\n      s2 = s[i];\n    } else if (s[i].z == s2.z) {\n      s3 = s[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1.num, s1.z);\n  printf(\"%d %d\\n\", s2.num, s2.z);\n  cout << s3.num << \" \" << s3.z << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yu;\n    int shu;\n    int c;\n  } s[100000], k;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].yu >> s[i].shu;\n    s[i].c = s[i].yu + s[i].shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n - 1; j++)\n      if (s[j].c > s[i].c) {\n        k = s[i];\n        s[i] = s[j];\n        s[j] = k;\n      }\n    cout << s[i].num << \" \" << s[i].c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25195", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int I;\n  int c;\n  int m;\n} st[100000];\n\nint main() {\n  int n, i, j, k = 0, a, b;\n  cin >> n;\n  for (i = 0; i < n; i++)\n\n  {\n\n    scanf(\"%d %d %d\", &st[i].I, &st[i].c, &st[i].m);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (k < st[j].c + st[j].m) {\n        k = st[j].c + st[j].m;\n        a = st[j].I;\n        b = j;\n      }\n    }\n\n    st[b].c = 0;\n    st[b].m = 0;\n\n    printf(\"%d %d\", a, k);\n    if (i < 2)\n      printf(\"\\n\");\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25196", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chs;\n    int math;\n  };\n  struct student s[100000];\n  struct student s1[2] = {{0, 0, 0}, {0, 0, 0}};\n  int n, i, t, j, a[100000], k = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chs, &s[i].math);\n    a[i] = s[i].chs + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j] > a[j + 1]) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    for (j = 0; j < n; j++) {\n      if (a[i] == s[j].chs + s[j].math && s[j].num != s1[0].num &&\n          s[j].num != s1[1].num) {\n        printf(\"%d %d\\n\", s[j].num, s[j].chs + s[j].math);\n        s1[k] = s[j];\n        k++;\n        if (k == 3) {\n          goto end;\n        }\n      }\n    }\n  }\nend:\n  return 0;\n}\n"}
{"label": "14", "index": "25197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n\n  struct stu {\n    int id;\n    int chn;\n    int math;\n    int total;\n  };\n  struct stu a[100001];\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].chn, &a[i].math);\n    (a[i].total) = (a[i].chn) + (a[i].math);\n  }\n\n  for (k = 1; k < 5; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((a[i].total) >= (a[i + 1].total)) {\n        a[100000].id = a[i].id;\n        a[100000].total = a[i].total;\n        a[i].id = a[i + 1].id;\n        a[i + 1].id = a[100000].id;\n        a[i].total = a[i + 1].total;\n        a[i + 1].total = a[100000].total;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", a[n - 1].id, a[n - 1].total);\n  printf(\"%d %d\\n\", a[n - 2].id, a[n - 2].total);\n  printf(\"%d %d\\n\", a[n - 3].id, a[n - 3].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25198", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Top {\n  int num;\n  float score;\n} Top[4] = {{0, 0}};\nstruct Top *p;\n\nvoid maopao(int n) {\n  int i;\n  for (i = 1; i < n; i++) {\n    for (p = Top; p < Top + n - i; p++) {\n      if ((p->score) < ((p + 1)->score)) {\n        Top[3] = *p;\n        *p = *(p + 1);\n        *(p + 1) = Top[3];\n      }\n    }\n  }\n}\n\nvoid sort(float a, int n) {\n  p = Top + 2;\n  if (a > (p->score)) {\n    p->score = a;\n    p->num = n;\n  }\n  maopao(3);\n}\n\nint main() {\n  int i, n, num;\n  float yw, sx, score;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %f %f\", &num, &yw, &sx);\n    float score = yw + sx;\n    sort(score, num);\n  }\n  for (p = Top; p < Top + 3; p++) {\n    printf(\"%d %g\\n\", p->num, p->score);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  char ID[20];\n  int math, cn;\n};\n\nint main() {\n  int n, i, j, max, m;\n  int *s;\n  struct grade stu[100000];\n  scanf(\"%d\", &n);\n  s = (int *)malloc(n * sizeof(int));\n  if (n == 1) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    cout << stu[0].ID << \" \" << stu[0].math + stu[0].cn;\n  } else if (n == 2) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    scanf(\"%s %d %d\", stu[1].ID, &stu[1].math, &stu[1].cn);\n    if (stu[0].math + stu[0].cn > stu[1].math + stu[1].cn) {\n      cout << stu[0].ID << \" \" << stu[0].math + stu[0].cn << \"\\n\";\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    } else {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    }\n  } else if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%s %d %d\", stu[i].ID, &stu[i].math, &stu[i].cn);\n      s[i] = stu[i].math + stu[i].cn;\n    }\n    for (i = 1; i < 4; i++) {\n      max = s[0];\n      for (j = 1; j < n; j++) {\n        if (s[j] > max) {\n          max = s[j];\n          m = j;\n        }\n      }\n      cout << stu[m].ID << \" \" << max << \"\\n\";\n      s[m] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int Num;\n  int Chinese;\n  int Math;\n  int Sum;\n};\nint main() {\n  int n, i, s;\n  scanf(\"%d\", &n);\n  struct Student stu[n];\n  struct Student temp, *p = stu;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].Num >> stu[i].Chinese >> stu[i].Math;\n    stu[i].Sum = stu[i].Chinese + stu[i].Math;\n  }\n  if (n == 2) {\n    if (stu[0].Sum > stu[1].Sum)\n      temp = stu[0];\n    stu[0] = stu[1];\n    stu[1] = temp;\n    printf(\"%d %d %d\\n\", stu[0].Num, stu[0].Chinese, stu[0].Math);\n    printf(\"%d %d %d\\n\", stu[1].Num, stu[1].Chinese, stu[1].Math);\n  } else {\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25201", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct score *next;\n};\nint n;\n\nstruct score *creat() {\n  struct score *p1, *p2, *head;\n  head = p2 = (struct score *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->num, &p2->yuwen, &p2->shuxue);\n  p2->total = p2->shuxue + p2->yuwen;\n  n--;\n  while (n--) {\n    p1 = (struct score *)malloc(1000);\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->total = p1->shuxue + p1->yuwen;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid search(struct score *head) {\n  struct score *p;\n  int i, max;\n  for (i = 0; i < 3; i++) {\n    max = 0;\n    p = head;\n    while (p != NULL) {\n      if (p->total > max)\n        max = p->total;\n      p = p->next;\n    }\n    p = head;\n    while (p != NULL) {\n      if (p->total == max) {\n        printf(\"%d %d \", p->num, p->total);\n        p->total = 0;\n        break;\n      }\n      p = p->next;\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  struct score *head;\n  head = creat();\n  search(head);\n}\n"}
{"label": "14", "index": "25202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int ch;\n  int math;\n  int total;\n  struct student *next;\n};\nint n;\nint t;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  cin >> n;\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  p1->total = p1->ch + p1->math;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    p1->total = p1->ch + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int max;\n  p = head;\n  max = p->total;\n  p = p->next;\n  while (p->next != NULL) {\n    if (p->total > max) {\n      max = p->total;\n      t = p->num;\n    }\n    p = p->next;\n  }\n  cout << t << \" \" << max << \" \";\n}\n\nstruct student *del(struct student *head, int a) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (a != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head) {\n    head = p1->next;\n  } else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head1, *head2, *head3;\n  head1 = creat();\n  print(head1);\n  head2 = del(head1, t);\n  print(head2);\n  head3 = del(head2, t);\n  print(head3);\n  return 0;\n}\n"}
{"label": "14", "index": "25203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n  p->sum = p->chi + p->math;\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      head->next = NULL;\n    } else if (i < 3) {\n      for (h = head, j = 0; j < i; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else if (j == i) {\n        g->next = p;\n        p->next = NULL;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n    p->sum = p->chi + p->math;\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = p->next)\n    cout << p->num << \" \" << p->sum << \" \";\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d \", &n);\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "25204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int Chinese;\n  int Math;\n  int Score;\n};\nint main() {\n  int n, i, first = 0, ifirst, second = 0, isecond, third = 0, ithird;\n  scanf(\"%d\", &n);\n  struct student STUDENT_NUM[n];\n  for (i = 0; i < n; i++) {\n    cin >> STUDENT_NUM[i].ID >> STUDENT_NUM[i].Chinese >> STUDENT_NUM[i].Math;\n    STUDENT_NUM[i].Score = STUDENT_NUM[i].Chinese + STUDENT_NUM[i].Math;\n  }\n  for (i = 0; i < n; i++) {\n    if (first < STUDENT_NUM[i].Score) {\n      first = STUDENT_NUM[i].Score;\n      ifirst = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= first &&\n        i != ifirst) {\n      second = STUDENT_NUM[i].Score;\n      isecond = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (third < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= second &&\n        i != ifirst && i != isecond) {\n      third = STUDENT_NUM[i].Score;\n      ithird = i;\n    }\n  }\n  printf(\"%d %d \", STUDENT_NUM[ifirst].ID, first);\n  printf(\"%d %d \", STUDENT_NUM[isecond].ID, second);\n  printf(\"%d %d \", STUDENT_NUM[ithird].ID, third);\n}\n"}
{"label": "14", "index": "25205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int id;\n    int yu, shu;\n  } stu[100000];\n  int i;\n  int s1 = 0, s2 = 0, s3 = 0;\n  int x1 = 0, x2 = 0, x3 = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].yu, &stu[i].shu);\n  }\n  int s, x;\n  for (i = 0; i < n; i++) {\n    s = stu[i].yu + stu[i].shu;\n    x = stu[i].id;\n    if (s > s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s1;\n      x2 = x1;\n      s1 = s;\n      x1 = x;\n    } else if (s == s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s < s1 && s > s2) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else {\n      if (s == s2) {\n        s3 = s;\n        x3 = x;\n      } else if (s < s2 && s > s3) {\n        s3 = s;\n        x3 = x;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x1, s1);\n  printf(\"%d %d\\n\", x2, s2);\n  cout << x3 << \" \" << s3 << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(long n) {\n  struct student *head, *p1, *p2;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n  long s = n - 1;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  do {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    s = s - 1;\n  } while (s);\n  return (head);\n}\nint main() {\n  struct student *head, *p, *q, stu1, stu2, stu3;\n  long n, k1 = -1, k2 = -1, k3 = -1, i, j;\n  int l;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  for (p = head, i = 0; p != NULL; p = p->next, i++) {\n    l = 0;\n    for (q = head, j = 0; q != NULL; q = q->next, j++)\n      if ((q->scorec + q->scorem) > (p->scorec + p->scorem) ||\n          (((q->scorec + q->scorem) == (p->scorec + p->scorem)) && j < i)) {\n        l = l + 1;\n        if (l > 3) {\n          break;\n        }\n      }\n    if (l == 0) {\n      k1 = i;\n      stu1.num = p->num;\n      stu1.scorec = p->scorec;\n      stu1.scorem = p->scorem;\n    }\n    if (l == 1) {\n      k2 = i;\n      stu2.num = p->num;\n      stu2.scorec = p->scorec;\n      stu2.scorem = p->scorem;\n    }\n    if (l == 2) {\n      k3 = i;\n      stu3.num = p->num;\n      stu3.scorec = p->scorec;\n      stu3.scorem = p->scorem;\n    }\n    if (k1 != -1 && k2 != -1 && k3 != -1)\n      break;\n  }\n  printf(\"%ld %d \", stu1.num, stu1.scorec + stu1.scorem);\n  printf(\"%ld %d \", stu2.num, stu2.scorec + stu2.scorem);\n  printf(\"%ld %d\", stu3.num, stu3.scorec + stu3.scorem);\n}\n"}
{"label": "14", "index": "25207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum[100000], a, b, c;\n  struct xues {\n    int a, b, c;\n  } s[100000];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &s[i].b, &s[i].c);\n    sum[i] = s[i].b + s[i].c;\n  }\n  int fir = 0, sec = 0, thi = 0;\n  for (i = 0; i < n; i++) {\n    if (fir < sum[i]) {\n      thi = sec;\n      sec = fir;\n      fir = sum[i];\n      c = b;\n      b = a;\n      a = s[i].a;\n    } else if (sec < sum[i]) {\n      thi = sec;\n      sec = sum[i];\n      fir = fir;\n      a = a;\n      c = b;\n      b = s[i].a;\n    } else if (thi < sum[i]) {\n      fir = fir;\n      sec = sec;\n      thi = sum[i];\n      a = a;\n      b = b;\n      c = s[i].a;\n    }\n  }\n  cout << a << \" \" << fir << \"\\n\" << b << \" \" << sec << \"\\n\" << c << \" \" << thi;\n  return 0;\n}\n"}
{"label": "14", "index": "25208", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int num, yuwen, shuxue, sum;\n};\n\nint main() {\n  int n, max1 = 0, max2 = 0, max3 = 0, stu1 = 0, stu2 = 0, stu3 = 0;\n  struct Student student[100000], *stu;\n  scanf(\"%d\", &n);\n\n  for (stu = student; stu < student + n; stu++) {\n    cin >> stu->num;\n    scanf(\"%d\", &stu->yuwen);\n    scanf(\"%d\", &stu->shuxue);\n    (stu->sum) = (stu->yuwen) + (stu->shuxue);\n    if (stu->sum >= max3) {\n      if (stu->sum >= max2) {\n        if (stu->sum >= max1) {\n          if (stu->sum > max1) {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu1;\n            stu1 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          }\n        } else {\n          if (stu->sum > max2) {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu->num;\n          }\n        }\n      } else {\n        if (stu->sum > max3) {\n          max3 = stu->sum;\n          stu3 = stu->num;\n        } else\n          max3 = stu->sum;\n      }\n    }\n  }\n  stu = student;\n  printf(\"%d %d\\n\", (stu + stu1 - 1)->num, (stu + stu1 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu2 - 1)->num, (stu + stu2 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu3 - 1)->num, (stu + stu3 - 1)->sum);\n}\n"}
{"label": "14", "index": "25209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p0, *p1, *p2;\n  int i = 0;\n  head = (struct student *)malloc(1000);\n  head->next = NULL;\n  scanf(\"%ld %d %d\", &head->num, &head->scorec, &head->scorem);\n  while (i < 2) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n    i++;\n  }\n  return (head);\n}\nstruct student *sort(struct student *head, int n) {\n  struct student *p0, *p1, *p2;\n  int i = 3;\n  while (i < n) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n\n      if (head == p1) {\n        p2 = p1->next;\n        (*p2->next).num = p2->num;\n        (*p2->next).scorec = p2->scorec;\n        (*p2->next).scorem = p2->scorem;\n        p2->num = p1->num;\n        p2->scorec = p1->scorec;\n        p2->scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else if (p1 == head->next) {\n        (*p1->next).num = p1->num;\n        (*p1->next).scorec = p1->scorec;\n        (*p1->next).scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else {\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      }\n    }\n    free(p0);\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat();\n  head = sort(head, n);\n  p1 = head->next;\n  p2 = p1->next;\n  printf(\"%ld %d \", head->num, (head->scorec + head->scorem));\n  printf(\"%ld %d \", p1->num, (p1->scorec + p1->scorem));\n  printf(\"%ld %d\", p2->num, (p2->scorec + p2->scorem));\n}\n"}
{"label": "14", "index": "25210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Stu {\n    int num;\n    int sco[2];\n    int sum;\n  };\n  struct Stu stu[5];\n  struct Stu temp;\n  int i, j, n, m, k;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    for (i = 0; i < 3; i++) {\n      cin >> stu[i].num >> stu[i].sco[0] >> stu[i].sco[1];\n      stu[i].sum = stu[i].sco[0] + stu[i].sco[1];\n    }\n    for (k = 1; k <= n - 3; k++) {\n      cin >> stu[3].num >> stu[3].sco[0] >> stu[3].sco[1];\n      stu[3].sum = stu[3].sco[0] + stu[3].sco[1];\n      m = 0;\n      for (j = 1; j <= 2; j++) {\n        if (stu[m].sum > stu[j].sum ||\n            (stu[m].sum == stu[j].sum && stu[m].num < stu[j].num))\n          m = j;\n      }\n      if (stu[3].sum > stu[m].sum)\n        stu[m] = stu[3];\n    }\n  }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].num > stu[j].num) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].sum < stu[j].sum) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25211", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int shu;\n  int yu;\n  int he;\n};\nstruct stu stu[100000];\nint main() {\n  int n, i, max, sec, th;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].id >> stu[i].shu >> stu[i].yu;\n    stu[i].he = stu[i].shu + stu[i].yu;\n  }\n  max = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[max].he < stu[i + 1].he)\n      max = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[max].id, stu[max].he);\n  stu[max].he = 0;\n  sec = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[sec].he < stu[i + 1].he)\n      sec = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[sec].id, stu[sec].he);\n  stu[sec].he = 0;\n  th = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[th].he < stu[i + 1].he)\n      th = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[th].id, stu[th].he);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25212", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct score {\n    int id;\n    int yw;\n    int sx;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n  }\n  for (j = 1; j <= 3; j++) {\n    int e, max = 0;\n    for (i = 0; i <= n - j; i++) {\n      if ((stu[i].yw + stu[i].sx) > (stu[max].yw + stu[max].sx)) {\n        max = i;\n      }\n    }\n    if (max != n - j) {\n      e = stu[max].yw;\n      stu[max].yw = stu[n - j].yw;\n      stu[n - j].yw = e;\n\n      e = stu[max].sx;\n      stu[max].sx = stu[n - j].sx;\n      stu[n - j].sx = e;\n\n      e = stu[max].id;\n      stu[max].id = stu[n - j].id;\n      stu[n - j].id = e;\n    }\n  }\n  for (i = n - 1; i >= n - 2; i--) {\n    printf(\"%d %d\\n\", (stu[i].id), (stu[i].yw + stu[i].sx));\n  }\n  printf(\"%d %d\", (stu[n - 3].id), (stu[n - 3].yw + stu[n - 3].sx));\n  return 0;\n}\n"}
{"label": "14", "index": "25213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, max2 = 0, max3 = 0, t1 = 0, t2 = 0, t3 = 0;\n  int ID[100000], y[100000], m[100000], s[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &ID[i], &y[i], &m[i]);\n  for (i = 0; i < n; i++)\n    s[i] = y[i] + m[i];\n  for (i = 0; i < n; i++) {\n    if (max1 < s[i]) {\n      max1 = s[i];\n      t1 = i;\n    }\n  }\n  s[t1] = 0;\n  for (i = 0; i < n; i++) {\n    if (max2 < s[i]) {\n      max2 = s[i];\n      t2 = i;\n    }\n  }\n  s[t2] = 0;\n  for (i = 0; i < n; i++) {\n    if (max3 < s[i]) {\n      max3 = s[i];\n      t3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", ID[t1], max1);\n  printf(\"%d %d\\n\", ID[t2], max2);\n  printf(\"%d %d\\n\", ID[t3], max3);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[3], chinese[100000], math[100000], sum[100000];\n  int m, i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> m >> chinese[i] >> math[i];\n    sum[i] = chinese[i] + math[i];\n  }\n  int largest = 0;\n  for (i = 0; i < 3; i++) {\n    largest = 0;\n    for (int j = 0; j < n; j++) {\n      if (sum[j] > largest) {\n        largest = sum[j];\n        num[i] = j;\n      }\n    }\n    printf(\"%d %d\\n\", num[i] + 1, sum[num[i]]);\n    sum[num[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  struct student *next;\n};\nint m;\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  head = NULL;\n  while (n--) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    m = m - 1;\n  }\n  return (head);\n}\nint main() {\n  int max = 0;\n  int n, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  head = creat(n);\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->chinese + p1->math) > max)\n        max = p1->chinese + p1->math, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p2->num, (p2->chinese + p2->math));\n    head = del(head, p2->num);\n  }\n}\n"}
{"label": "14", "index": "25216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100000], t;\n\n  int n;\n  int i;\n  int k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n\n  for (k = n - 1; k > n - 4; k--) {\n    for (i = 0; i < k; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        t = stu[i];\n        stu[i] = stu[i + 1];\n        stu[i + 1] = t;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25217", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} student[110000];\n\nint main() {\n  int n, i, max1 = 0, count1 = 0, max2 = 0, count2 = 0, max3 = 0, count3 = 0,\n            number = 0, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    scanf(\"%d\", &student[i].math);\n  }\n  for (i = 0; i < n; i++) {\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    if (student[i].total >= max1) {\n      max1 = student[i].total;\n      count1 = i;\n    }\n  }\n  number = student[0].num;\n  sum = student[0].total;\n  student[0].num = student[count1].num;\n  student[0].total = student[count1].total;\n  student[count1].num = number;\n  student[count1].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 1; i--) {\n    if (student[i].total >= max2) {\n      max2 = student[i].total;\n      count2 = i;\n    }\n  }\n  number = student[1].num;\n  sum = student[1].total;\n  student[1].num = student[count2].num;\n  student[1].total = student[count2].total;\n  student[count2].num = number;\n  student[count2].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 2; i--) {\n    if (student[i].total >= max3) {\n      max3 = student[i].total;\n      count3 = i;\n    }\n  }\n  number = student[2].num;\n  sum = student[2].total;\n  student[2].num = student[count3].num;\n  student[2].total = student[count3].total;\n  student[count3].num = number;\n  student[count3].total = sum;\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].num, student[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nint student_num;\n\nstruct student *creat() {\n  struct student *p1, *p2, *head;\n  int n = 0;\n  scanf(\"%d\", &student_num);\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  while (n < student_num) {\n    if (n == 0)\n      head = p1;\n    if (n == student_num - 1)\n      p1->next = NULL;\n    scanf(\"%d %d %d\", &p1->id, &p1->chi, &p1->math);\n    p1->total = p1->chi + p1->math;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    n++;\n  }\n  return head;\n}\n\nint main() {\n  struct student *head, *p;\n  int i, n = 0, first, second, third, firstid, secondid, thirdid;\n  head = creat();\n  first = 0;\n  second = 0;\n  third = 0;\n  p = head;\n  for (i = 1; i <= student_num; i++) {\n    if (p->total > first) {\n      third = second;\n      second = first;\n      first = p->total;\n      thirdid = secondid;\n      secondid = firstid;\n      firstid = p->id;\n    } else if (p->total <= first && p->total > second) {\n      third = second;\n      second = p->total;\n      thirdid = secondid;\n      secondid = p->id;\n    } else if (p->total <= second && p->total > third) {\n      third = p->total;\n      thirdid = p->id;\n    }\n    p = p->next;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", firstid, first, secondid, second, thirdid,\n         third);\n}\n"}
{"label": "14", "index": "25219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, y, b, he;\n} a[100003];\n\nint main() {\n  int n, i, j, he, k;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].y, &a[i].b);\n    a[i].he = a[i].y + a[i].b;\n  };\n\n  for (i = 1; i <= 2; i++) {\n    k = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[j].he > a[k].he)\n        k = j;\n    printf(\"%d %d\", a[k].num, a[k].he);\n    printf(\"\\n\");\n    a[k].he = 0;\n  }\n  k = 1;\n  for (j = i + 1; j <= n; j++)\n    if (a[j].he > a[k].he)\n      k = j;\n  printf(\"%d %d\", a[k].num, a[k].he);\n  a[k].he = 0;\n}\n"}
{"label": "14", "index": "25220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct student *next;\n};\nint n;\nstruct student *creat(int i) {\n  struct student *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->c + p1->b;\n  head = NULL;\n  while (n < i - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->c + p1->b;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid del(struct student *ahead, int num) {\n  struct student *p1, *p2;\n  p1 = ahead;\n  while (num != p1->d && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->d) {\n    if (p1 == ahead) {\n      cout << p1->a << \" \" << p1->d << \"\\n\";\n      ahead = p1->next;\n    } else {\n      cout << p1->a << \" \" << p1->d << \"\\n\";\n      p2->next = p1->next;\n    }\n  }\n}\nvoid print(struct student *head) {\n  int i;\n  struct student *p;\n  for (i = 0; i < 3; i++) {\n    p = head;\n    int max = p->d;\n    while (p->next != NULL) {\n      p = p->next;\n      if (max < p->d)\n        max = p->d;\n    }\n    del(head, max);\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  struct student *ahead;\n  ahead = creat(i);\n  print(ahead);\n}\n"}
{"label": "14", "index": "25221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yuwen;\n  int shuxue;\n  int sum;\n} score[100000];\nint main() {\n  int n, i, a, b, c, a1, b1, c1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &score[i].num, &score[i].yuwen, &score[i].shuxue);\n    score[i].sum = score[i].shuxue + score[i].yuwen;\n  }\n  a = 0;\n  b = 0;\n  c = 0;\n  a1 = 0;\n  b1 = 0;\n  c1 = 0;\n  for (i = 0; i < n; i++) {\n    if (score[i].sum > a) {\n      c = b;\n      b = a;\n      a = score[i].sum;\n      c1 = b1;\n      b1 = a1;\n      a1 = score[i].num;\n    } else if (score[i].sum > b) {\n      c = b;\n      b = score[i].sum;\n      c1 = b1;\n      b1 = score[i].num;\n    } else if (score[i].sum > c) {\n      c = score[i].sum;\n      c1 = score[i].num;\n    }\n  }\n  cout << a1 << \" \" << a << \"\\n\" << b1 << \" \" << b << \"\\n\" << c1 << \" \" << c;\n  return 0;\n}\n"}
{"label": "14", "index": "25222", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int id;\n  int a;\n  int b;\n  int zong;\n};\nstruct student ren[100000];\n\nint main() {\n  int n, i, fen, flag = 0, j;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].id);\n    scanf(\"%d\", &ren[i].a);\n    scanf(\"%d\", &ren[i].b);\n    ren[i].zong = ren[i].a + ren[i].b;\n  }\n\n  for (fen = 200; fen >= 100; fen--) {\n    for (i = 0; i <= n - 1; i++)\n      if (fen == ren[i].zong) {\n        printf(\"%d %d\\n\", ren[i].id, ren[i].zong);\n        flag = flag + 1;\n        if (flag == 3)\n          goto end;\n      }\n  }\nend:\n  getchar();\n}\n"}
{"label": "14", "index": "25223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, y, s, z, x, a, b, c, ax, bx, cx;\n  scanf(\"%d\", &n);\n  a = 0;\n  b = 0;\n  c = 0;\n  ax = 0;\n  bx = 0;\n  cx = 0;\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d %d %d\", &x, &y, &s);\n    z = y + s;\n    if (c >= z)\n      continue;\n    else if (b >= z) {\n      c = z;\n      cx = x;\n    } else if (a >= z) {\n      c = b;\n      cx = bx;\n      b = z;\n      bx = x;\n    } else {\n      c = b;\n      cx = bx;\n      b = a;\n      bx = ax;\n      a = z;\n      ax = x;\n    }\n  }\n  printf(\"%d %d\\n\", ax, a);\n  printf(\"%d %d\\n\", bx, b);\n  printf(\"%d %d\\n\", cx, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yu;\n  int shu;\n  int tol;\n  struct stu *next;\n};\nint n;\n\nstruct stu *creat(void) {\n  struct stu *p1, *p2, *head, *p;\n  int i, k;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->tol = p1->yu + p1->shu;\n  p1->next = 0;\n  head = p1;\n  p = p1;\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 1; i < n; i++) {\n    p = head;\n    p2 = p1;\n    k = 0;\n    cin >> p1->num >> p1->yu >> p1->shu;\n    p1->tol = p1->yu + p1->shu;\n    while (p != 0 && p->tol >= p1->tol) {\n      p2 = p;\n      p = p->next;\n      k++;\n    }\n    if (k <= 3) {\n      if (p == head) {\n        head = p1;\n        p1->next = p;\n      }\n      if (p == 0) {\n        p2->next = p1;\n        p1->next = 0;\n      }\n      if (p != head && p != 0) {\n        p2->next = p1;\n        p1->next = p;\n      }\n    }\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  return head;\n}\nint main() {\n  struct stu *head, *p;\n  int i = 0;\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  while (i < 3) {\n    cout << p->num << \" \" << p->tol << \"\\n\";\n    i++;\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25225", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int id;\n    int cp;\n    int mp;\n    int tp;\n  } stu[n], temp;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].cp >> stu[i].mp;\n    stu[i].tp = stu[i].cp + stu[i].mp;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].tp > stu[j - 1].tp) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].tp);\n  return 0;\n}\n"}
{"label": "14", "index": "25226", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, k, a, b, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &a, &b);\n    stu[i].sum = a + b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - i - 1; j > 0; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "25227", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int sum;\n} stu[100000];\nint main() {\n\n  int i, n, max = 0, m, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chi >> stu[i].mat;\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        m = i;\n      }\n    printf(\"%d %d\\n\", stu[m].num, stu[m].sum);\n    stu[m].sum = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "25228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int sum;\n  int c;\n};\nint main() {\n  int n, i, j, nt, ct;\n  struct student stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].sum = stu[i].a + stu[i].b;\n    stu[i].c = stu[i].sum;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        nt = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = nt;\n        ct = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = ct;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].c);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct score {\n    int id;\n    int yw;\n    int sx;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n  }\n  for (j = 1; j <= 3; j++) {\n    int e, max = 0;\n    for (i = 0; i <= n - j; i++) {\n      if ((stu[i].yw + stu[i].sx) > (stu[max].yw + stu[max].sx)) {\n        max = i;\n      }\n    }\n    if (max != n - j) {\n      e = stu[max].yw;\n      stu[max].yw = stu[n - j].yw;\n      stu[n - j].yw = e;\n\n      e = stu[max].sx;\n      stu[max].sx = stu[n - j].sx;\n      stu[n - j].sx = e;\n\n      e = stu[max].id;\n      stu[max].id = stu[n - j].id;\n      stu[n - j].id = e;\n    }\n  }\n  for (i = n - 1; i >= n - 2; i--) {\n    printf(\"%d %d\\n\", (stu[i].id), (stu[i].yw + stu[i].sx));\n  }\n  printf(\"%d %d\", (stu[n - 3].id), (stu[n - 3].yw + stu[n - 3].sx));\n  return 0;\n}\n"}
{"label": "14", "index": "25230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int id, chinese, math, total;\n\n  int n, i, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &id, &chinese, &math);\n    total = chinese + math;\n    if (total > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = total;\n      x = id;\n\n    } else if (total <= a && total > b) {\n      c = b;\n      z = y;\n      b = total;\n      y = id;\n    } else if (total <= b && total > c) {\n      c = total;\n      z = id;\n    }\n  }\n\n  printf(\"%d %d\\n\", x, a);\n  cout << y << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", z, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\n\nint main() {\n  int n, s[100000];\n  scanf(\"%d\", &n);\n  int i, j, max = 0, t;\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chinese, &a[i].math);\n    s[i] = a[i].chinese + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j] > max) {\n        max = s[j];\n        t = j;\n      }\n    }\n    cout << a[t].num << \" \" << max << \"\\n\";\n    max = 0;\n    s[t] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25232", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int n;\n  int m;\n  int c;\n  int t;\n} s[100000], temp;\nint main() {\n  int i, j, k, n, p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].m, &s[i].c);\n    s[i].t = s[i].m + s[i].c;\n  }\n  for (j = 0; j < 3 && j < n; j++) {\n    for (k = j + 1, p = j; k < n; k++)\n      if (s[p].t < s[k].t) {\n        p = k;\n      }\n    temp = s[j];\n    s[j] = s[p];\n    s[p] = temp;\n    printf(\"%d %d\\n\", s[j].n, s[j].t);\n  }\n}\n"}
{"label": "14", "index": "25233", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int d;\n  d = *((int *)elem2) - *((int *)elem1);\n  return d;\n}\nstruct student {\n  long int ID;\n  long int c;\n  long int m;\n};\nint main() {\n  long int n, i, j, k;\n  int b[100000];\n  int e[3];\n  scanf(\"%d\", &n);\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].c >> a[i].m;\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].c + a[i].m;\n  }\n\n  qsort(b, n, sizeof(long int), pfCompare);\n  for (i = 0; i < n; i++) {\n    if (b[0] == a[i].c + a[i].m) {\n      e[0] = a[i].ID;\n      j = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[1] == a[i].c + a[i].m) && i != j) {\n      e[1] = a[i].ID;\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[2] == a[i].c + a[i].m) && i != j && i != k) {\n      e[2] = a[i].ID;\n      break;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", e[i], b[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25234", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int Student_Num;\n  cin >> Student_Num;\n  \n  struct A {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } student[100000 + 10], a[3];\n  \n  for (int i = 0; i <= Student_Num - 1; i++) {\n    cin >> student[i].ID;\n    cin >> student[i].chinese;\n    cin >> student[i].math;\n    student[i].total = student[i].math + student[i].chinese;\n  }\n  \n  a[0] = a[1] = a[2] = student[0];\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[0].total)\n      a[0] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[1].total && student[i].total <= a[0].total &&\n        student[i].ID != a[0].ID)\n      a[1] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[2].total && student[i].total <= a[1].total &&\n        student[i].ID != a[0].ID && student[i].ID != a[1].ID)\n      a[2] = student[i];\n  }\n  \n  for (int i = 0; i <= 2; i++) {\n    cout << a[i].ID << \" \" << a[i].total << endl;\n  }\n  \n  return 0;\n}\n"}
{"label": "14", "index": "25235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yu;\n  int shu;\n  int tol;\n  struct stu *next;\n};\nint n;\n\nstruct stu *creat(void) {\n  struct stu *p1, *p2, *head, *p;\n  int i, k;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->tol = p1->yu + p1->shu;\n  p1->next = 0;\n  head = p1;\n  p = p1;\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 1; i < n; i++) {\n    p = head;\n    p2 = p1;\n    k = 0;\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->tol = p1->yu + p1->shu;\n    while (p != 0 && p->tol >= p1->tol) {\n      p2 = p;\n      p = p->next;\n      k++;\n    }\n    if (k <= 3) {\n      if (p == head) {\n        head = p1;\n        p1->next = p;\n      }\n      if (p == 0) {\n        p2->next = p1;\n        p1->next = 0;\n      }\n      if (p != head && p != 0) {\n        p2->next = p1;\n        p1->next = p;\n      }\n    }\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  return head;\n}\nint main() {\n  struct stu *head, *p;\n  int i = 0;\n  cin >> n;\n  head = creat();\n  p = head;\n  while (i < 3) {\n    printf(\"%d %d\\n\", p->num, p->tol);\n    i++;\n    p = p->next;\n  }\n}\n"}
{"label": "14", "index": "25236", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int ID;\n  int chi;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].chi, &student[i].math);\n    a[i] = student[i].chi + student[i].math;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          break;\n      }\n      if (j == n && a[i] >= a[j - 1]) {\n        cout << student[i].ID << \" \" << a[i] << \"\\n\";\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25238", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long n;\n  scanf(\"%ld \", &n);\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } stu[100000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].sum = stu[i].chi + stu[i].math;\n  }\n  struct student blank;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[0].sum) {\n      blank = stu[0];\n      stu[0] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[1].sum) {\n      blank = stu[1];\n      stu[1] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (stu[i].sum > stu[2].sum) {\n      blank = stu[2];\n      stu[2] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25239", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\ntypedef struct st {\n  int a, b;\n} stu;\nstu s[100000];\nint comp(const void *a, const void *b) { return ((stu *)b)->b - ((stu *)a)->b; }\nint main() {\n  int i, n, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &a, &b);\n    s[i].b = a + b;\n  }\n  qsort(s, n, sizeof(stu), comp);\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].a, s[0].b, s[1].a, s[1].b, s[2].a, s[2].b);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int a;\n  int sc[2];\n};\nint main() {\n  struct s st[100000];\n  int t = 0, j = 0, max = 0, p[3] = {-1, -1};\n  long n, i;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> st[i].a >> st[i].sc[0] >> st[i].sc[1];\n    st[i].sc[0] = st[i].sc[0] + st[i].sc[1];\n  }\n  i = 0;\n  while (t < 3) {\n    if (i < n && i != p[0] && i != p[1]) {\n      j = (st[i].sc[0] > max) ? i : j;\n      max = (st[i].sc[0] > max) ? st[i].sc[0] : max;\n      i++;\n    } else if (i < n && (i == p[0] || i == p[1]))\n      i++;\n    else if (i = n) {\n      cout << j + 1 << \" \" << max << \"\\n\";\n      p[t] = j;\n      t++;\n      j = 0;\n      max = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int n;\n  int a;\n  int b;\n  int aver;\n} stu[100000];\nint main() {\n  int m, i, j, f, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%d%d\", &stu[i].n, &stu[i].a, &stu[i].b);\n  }\n  for (i = 0; i < m; i++) {\n    stu[i].aver = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = m - 1 - i; j >= 0; j--) {\n      if (stu[j].aver < stu[j + 1].aver) {\n        f = stu[j].aver;\n        stu[j].aver = stu[j + 1].aver;\n        stu[j + 1].aver = f;\n        t = stu[j].n;\n        stu[j].n = stu[j + 1].n;\n        stu[j + 1].n = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].n, stu[i].aver);\n  }\n}\n"}
{"label": "14", "index": "25242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct student *next;\n  };\n  int i, j, k, n, m, max;\n  struct student *p1, *p2, *head;\n  cin >> n;\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      p1->next = 0;\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n\n    p1 = head;\n    for (j = 1; j <= n; j++) {\n      if (p1->zf == max) {\n        cout << p1->xh << \" \" << p1->zf << \"\\n\";\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25243", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int eng;\n  int math;\n  int sum;\n  struct stu *next;\n} * head, *p1, *p2;\nstruct stu *order(int n) {\n  int i, j, t;\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    p2 = p1->next;\n    for (j = i + 1; j < n; j++) {\n      if (p1->sum < p2->sum) {\n        t = p1->id;\n        p1->id = p2->id;\n        p2->id = t;\n        t = p1->sum;\n        p1->sum = p2->sum;\n        p2->sum = t;\n      }\n      p2 = p2->next;\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  p1 = head = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->eng, &p1->math);\n    p1->sum = p1->eng + p1->math;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct ace {\n  char id[10];\n  int a;\n  int b;\n} o[3], r;\n\nint main() {\n  int n, i, s[3], m, j, v;\n  char z[10];\n  scanf(\"%d\", &n);\n  scanf(\"%s %d %d\", o[0].id, &o[0].a, &o[0].b);\n  scanf(\"%s %d %d\", o[1].id, &o[1].a, &o[1].b);\n  scanf(\"%s %d %d\", o[2].id, &o[2].a, &o[2].b);\n  s[0] = o[0].a + o[0].b;\n  s[1] = o[1].a + o[1].b;\n  s[2] = o[2].a + o[2].b;\n  for (i = 0; i < 2; i++) {\n    for (j = i + 1; j < 3; j++) {\n      if (s[i] < s[j]) {\n        strcpy(z, o[i].id);\n        strcpy(o[i].id, o[j].id);\n        strcpy(o[j].id, z);\n        v = s[i];\n        s[i] = s[j];\n        s[j] = v;\n      }\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    scanf(\"%s %d %d\", r.id, &r.a, &r.b);\n    m = r.a + r.b;\n    if (m > s[0]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = o[0];\n      s[1] = s[0];\n      o[0] = r;\n      s[0] = m;\n    } else if (m <= s[0] && m > s[1]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = r;\n      s[1] = m;\n    } else if (m <= s[1] && m > s[2]) {\n      o[2] = r;\n      s[2] = m;\n    }\n  }\n  cout << o[0].id << \" \" << s[0] << \"\\n\";\n  printf(\"%s %d\\n\", o[1].id, s[1]);\n  cout << o[2].id << \" \" << s[2] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint max_1 = 0;\n\nstruct student {\n  char id[20];\n  int chinese;\n  int math;\n  int sum;\n  int flag;\n  struct student *next;\n};\nstruct student *h;\nint n, i;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  p1->flag = 0;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p1->flag = 0;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *compare() {\n  struct student *p1, *p3;\n  p1 = h;\n  max_1 = p1->sum;\n  do {\n    if (p1->sum > max_1 && (p1->flag == 0))\n      max_1 = p1->sum;\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  p1 = h;\n  do {\n    if (p1->sum == max_1 && (p1->flag == 0)) {\n      p3 = p1;\n      p1->flag = 1;\n      break;\n    }\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  return (p3);\n}\nint main() {\n  int j;\n  struct student *p;\n  scanf(\"%d\", &n);\n  h = creat();\n  for (j = 1; j <= 3; j++) {\n    p = compare();\n    cout << p->id << \" \" << p->sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m1, m2, m3, n1, n2, n3;\n  struct student {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct student stu[100000];\n  struct student *p;\n  p = stu;\n\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &(p + i)->num, &(p + i)->verbal, &(p + i)->math);\n  for (i = 0; i < n; i++)\n    (p + i)->sum = (p + i)->verbal + (p + i)->math;\n  m1 = p->sum;\n  n1 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m1) {\n      m1 = (p + i)->sum;\n      n1 = i;\n    }\n  printf(\"%d %d\\n\", (p + n1)->num, (p + n1)->sum);\n  m2 = p->sum;\n  n2 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m2 && i != n1) {\n      m2 = (p + i)->sum;\n      n2 = i;\n    }\n  printf(\"%d %d\\n\", (p + n2)->num, (p + n2)->sum);\n\n  m3 = p->sum;\n  n3 = 0;\n  for (i = 0; i < n; i++)\n    if ((((p + i)->sum) > m3) && i != n1 && i != n2) {\n      m3 = (p + i)->sum;\n      n3 = i;\n    }\n  printf(\"%d %d\\n\", (p + n3)->num, (p + n3)->sum);\n}\n"}
{"label": "14", "index": "25247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int s;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int n, i;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->c >> p1->m;\n    p1->s = p1->c + p1->m;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid exchange(struct student *x, struct student *y) {\n  int t;\n  t = x->id;\n  x->id = y->id;\n  y->id = t;\n  t = x->c;\n  x->c = y->c;\n  y->c = t;\n  t = x->m;\n  x->m = y->m;\n  y->m = t;\n  t = x->s;\n  x->s = y->s;\n  y->s = t;\n}\nint main() {\n  struct student *p, *q, *head;\n  int temp, i;\n  head = p = creat();\n  for (p = head, i = 0; p->next != NULL, i < 3; p = p->next, i++) {\n    temp = p->s;\n    for (q = p->next; q != NULL; q = q->next) {\n      if (p->s < q->s)\n        temp = q->s;\n      if (p->s != temp)\n        exchange(p, q);\n    }\n  }\n  for (p = head, i = 0; i < 3; p = p->next, i++)\n    printf(\"%d %d \", p->id, p->s);\n  return 0;\n}\n"}
{"label": "14", "index": "25248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long int num;\n  int Chinese;\n  int Maths;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student tempt;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].Chinese, &stu[i].Maths);\n    stu[i].total = stu[i].Chinese + stu[i].Maths;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  if (stu[1].total > stu[0].total) {\n    tempt = stu[0];\n    stu[0] = stu[1];\n    stu[1] = tempt;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  for (i = 3; i < n; i++) {\n    if (stu[i].total > stu[2].total) {\n      stu[2] = stu[i];\n      if (stu[2].total > stu[1].total) {\n        tempt = stu[1];\n        stu[1] = stu[2];\n        stu[2] = tempt;\n        if (stu[1].total > stu[0].total) {\n          tempt = stu[0];\n          stu[0] = stu[1];\n          stu[1] = tempt;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].total);\n  cout << stu[1].num << \" \" << stu[1].total << \"\\n\";\n  printf(\"%d %d\\n\", stu[2].num, stu[2].total);\n}\n"}
{"label": "14", "index": "25249", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int shu;\n  int yu;\n  int he;\n};\nstruct stu stu[100000];\nint main() {\n  int n, i, max, sec, th;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].id >> stu[i].shu >> stu[i].yu;\n    stu[i].he = stu[i].shu + stu[i].yu;\n  }\n  max = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[max].he < stu[i + 1].he)\n      max = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[max].id, stu[max].he);\n  stu[max].he = 0;\n  sec = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[sec].he < stu[i + 1].he)\n      sec = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[sec].id, stu[sec].he);\n  stu[sec].he = 0;\n  th = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[th].he < stu[i + 1].he)\n      th = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[th].id, stu[th].he);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25250", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\n\nstruct stu {\n  int xh;\n  int yw;\n  int sx;\n  int all;\n  struct stu *next;\n};\nstruct stu *a, *b, *c, q, t, r;\nstruct stu *creat() {\n  struct stu *head;\n  struct stu *p1, *p2;\n  int i;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  cin >> p1->xh >> p1->yw >> p1->sx;\n  p1->all = p1->yw + p1->sx;\n  head = p1;\n  a = b = c = head;\n  for (i = 1; i < n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->all = p1->yw + p1->sx;\n    if (p1->all > a->all) {\n      c = b;\n      b = a;\n      a = p1;\n    } else\n\n        if (p1->all > b->all) {\n      c = b;\n      b = p1;\n    } else {\n      if (p1->all > c->all) {\n        c = p1;\n      }\n    }\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n  struct stu *p;\n  a = &q;\n  b = &t;\n  c = &r;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->xh, a->all, b->xh, b->all, c->xh, c->all);\n  return 0;\n}\n"}
{"label": "14", "index": "25251", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[3], chinese[100000], math[100000], sum[100000];\n  int m, i, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &m, &chinese[i], &math[i]);\n    sum[i] = chinese[i] + math[i];\n  }\n  int largest = 0;\n  for (i = 0; i < 3; i++) {\n    largest = 0;\n    for (int j = 0; j < n; j++)\n      if (sum[j] > largest) {\n        largest = sum[j];\n        num[i] = j;\n      }\n    printf(\"%d %d\\n\", num[i] + 1, sum[num[i]]);\n    sum[num[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, ta, tb, ts, tnum;\n  int *a, *b, *s, *num;\n  scanf(\"%d \", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &num[i], &a[i], &b[i]);\n    s[i] = a[i] + b[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n; i > 1; i--) {\n      if (s[i] > s[i - 1]) {\n        ta = a[i - 1];\n        tb = b[i - 1];\n        ts = s[i - 1];\n        tnum = num[i - 1];\n        a[i - 1] = a[i];\n        b[i - 1] = b[i];\n        s[i - 1] = s[i];\n        num[i - 1] = num[i];\n        a[i] = ta;\n        b[i] = tb;\n        s[i] = ts;\n        num[i] = tnum;\n      }\n    }\n  }\n  cout << num[1] << \" \" << s[1] << \"\\n\"\n       << num[2] << \" \" << s[2] << \"\\n\"\n       << num[3] << \" \" << s[3] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25253", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n\n  struct stu {\n    int id;\n    int chn;\n    int math;\n    int total;\n  };\n  struct stu a[100001];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].chn >> a[i].math;\n    (a[i].total) = (a[i].chn) + (a[i].math);\n  }\n\n  for (k = 1; k < 5; k++) {\n    for (i = 0; i < n - k; i++) {\n      if ((a[i].total) >= (a[i + 1].total)) {\n        a[100000].id = a[i].id;\n        a[100000].total = a[i].total;\n        a[i].id = a[i + 1].id;\n        a[i + 1].id = a[100000].id;\n        a[i].total = a[i + 1].total;\n        a[i + 1].total = a[100000].total;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", a[n - 1].id, a[n - 1].total);\n  printf(\"%d %d\\n\", a[n - 2].id, a[n - 2].total);\n  printf(\"%d %d\\n\", a[n - 3].id, a[n - 3].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n} stu[1000000];\n\nint main() {\n  int STUDENT_NUM, i, j, temp1, temp2;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < STUDENT_NUM; j++) {\n      if (stu[i].total < stu[j].total) {\n        temp1 = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = temp1;\n        temp2 = stu[i].total;\n        stu[i].total = stu[j].total;\n        stu[j].total = temp2;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[0].ID, stu[0].total, stu[1].ID,\n         stu[1].total, stu[2].ID, stu[2].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n};\n\nint main() {\n\n  int n, i, j, t, a, b, m;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    cout << stu[a].num << \" \" << stu[a].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k[99999];\n\nint x[99999];\nint main() {\n  int n, i, a, b, c, j, r, t, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a, &b, &c);\n    k[a - 1] = b + c;\n    x[i] = a;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (r = 0; r < j; r++) {\n      if (k[r] >= k[r + 1]) {\n        t = k[r + 1];\n        k[r + 1] = k[r];\n        k[r] = t;\n        t = x[r + 1];\n        x[r + 1] = x[r];\n        x[r] = t;\n      }\n    }\n    m++;\n    if (m > 3)\n      break;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x[n - 1], k[n - 1], x[n - 2], k[n - 2],\n         x[n - 3], k[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25257", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int id;\n  int ch;\n  int mt;\n  int total;\n};\nstruct stu stu_1[100000];\nstruct stu top1 = {0, 0, 0, 0}, top2 = {0, 0, 0, 0}, top3 = {0, 0, 0, 0};\n\nint main() {\n  int n, i;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(stu_1[i].id), &(stu_1[i].ch), &(stu_1[i].mt));\n    stu_1[i].total = stu_1[i].ch + stu_1[i].mt;\n    if (stu_1[i].total > top1.total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = stu_1[i];\n    } else if (stu_1[i].total > top2.total) {\n      top3 = top2;\n      top2 = stu_1[i];\n    } else if (stu_1[i].total > top3.total) {\n      top3 = stu_1[i];\n    } else {\n      ;\n    }\n  }\n  printf(\"%d %d\\n\", top1.id, top1.total);\n  if ((top2.id) != 0)\n    printf(\"%d %d\\n\", top2.id, top2.total);\n  if ((top3.id) != 0)\n    printf(\"%d %d\\n\", top3.id, top3.total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m;\n  int a, b, c;\n  int j, k, v;\n  int sum[100000];\n  int max1 = 0, max2 = 0, max3 = 0;\n  int A[100000][1];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &m, &A[i][0], &A[i][1]);\n    sum[i] = A[i][0] + A[i][1];\n  }\n  for (j = 1; j <= n; j++) {\n    if (sum[j] > max1) {\n      max1 = sum[j];\n      a = j;\n    }\n  }\n  for (k = 1; k <= n; k++) {\n\n    if (sum[k] > max2 && k != a) {\n      max2 = sum[k];\n      b = k;\n    }\n  }\n  for (v = 1; v <= n; v++) {\n    if (sum[v] < max2) {\n      if (sum[v] > max3) {\n        max3 = sum[v];\n        c = v;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", a, max1);\n  printf(\"%d %d\\n\", b, max2);\n  printf(\"%d %d\", c, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100000], b[100000], c[100000], sum[100000], i, t1, t2, t3, s1, s2,\n      s3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &a[i], &b[i], &c[i]);\n    sum[i] = b[i] + c[i];\n  }\n  for (i = 0, t1 = 0, s1 = a[0]; i < n; i++) {\n    if (sum[i] > t1) {\n      t1 = sum[i];\n      s1 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1, t1);\n  for (i = 0, t2 = 0, s2 = a[0]; i < n; i++) {\n    if (a[i] == s1)\n      continue;\n    if (sum[i] > t2) {\n      t2 = sum[i];\n      s2 = a[i];\n    }\n  }\n  cout << s2 << \" \" << t2 << \"\\n\";\n  for (i = 0, t3 = 0, s3 = a[0]; i < n; i++) {\n    if (a[i] == s1 || a[i] == s2)\n      continue;\n    if (sum[i] > t3) {\n      t3 = sum[i];\n      s3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s3, t3);\n  return 0;\n}\n"}
{"label": "14", "index": "25260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct student stu[4] = {0, 0, 0, 0};\n\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].chinese, &stu[3].maths);\n    stu[3].sum = stu[3].chinese + stu[3].maths;\n\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum) {\n      stu[2] = stu[3];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int Student_Num;\n  cin >> Student_Num;\n\n  struct A {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } student[100000 + 10], a[3];\n\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    cin >> student[i].ID;\n    cin >> student[i].chinese;\n    cin >> student[i].math;\n    student[i].total = student[i].math + student[i].chinese;\n  }\n\n  a[0] = a[1] = a[2] = student[0];\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[0].total)\n      a[0] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[1].total && student[i].total <= a[0].total &&\n        student[i].ID != a[0].ID)\n      a[1] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[2].total && student[i].total <= a[1].total &&\n        student[i].ID != a[0].ID && student[i].ID != a[1].ID)\n      a[2] = student[i];\n  }\n\n  for (int i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].ID, a[i].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int number, chinese, math, total;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].number, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  int a = stu[0].total, b = stu[0].total, c = stu[0].total;\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > a) {\n      c = b;\n      b = a;\n      a = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < a && stu[i].total > b) {\n      c = b;\n      b = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < b && stu[i].total > c) {\n      c = stu[i].total;\n      continue;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == a) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == b) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == c) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long n, i, j, math[100000], chin[100000], total[100000], id[100000];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld\", &id[i]);\n    scanf(\"%ld\", &math[i]);\n    cin >> chin[i];\n  }\n  for (i = 0; i < n; i++) {\n    total[i] = 100000 * (math[i] + chin[i]) + 100000 - id[i];\n  }\n  int comp(const void *a, const void *b);\n  qsort(total, n, sizeof(long), comp);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 1] - 100000 * ((int)total[n - 1] / 100000)),\n         (int)total[n - 1] / 100000);\n  printf(\"%ld %d\\n\",\n         100000 - (total[n - 2] - 100000 * ((int)total[n - 2] / 100000)),\n         (int)total[n - 2] / 100000);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 3] - 100000 * ((int)total[n - 3] / 100000)),\n         (int)total[n - 3] / 100000);\n  getchar();\n  getchar();\n}\n\nint comp(const void *a, const void *b) { return *(long *)a - *(long *)b; }\n"}
{"label": "14", "index": "25264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int Chinese;\n  int math;\n  int sum;\n};\n\nint main() {\n  int i, n, p, q, r, b = 0, c = 0, d = 0;\n  struct student a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].Chinese, &a[i].math);\n    a[i].sum = a[i].Chinese + a[i].math;\n    if (i == 0)\n      p = q = r = a[i].sum;\n    else {\n      if (a[i].sum > p) {\n        r = q;\n        q = p;\n        p = a[i].sum;\n        d = c;\n        c = b;\n        b = i;\n      } else if (a[i].sum > q) {\n        r = q;\n        q = a[i].sum;\n        d = c;\n        c = i;\n      } else if (a[i].sum > r) {\n        r = a[i].sum;\n        d = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a[b].num, a[b].sum, a[c].num, a[c].sum,\n         a[d].num, a[d].sum);\n}\n"}
{"label": "14", "index": "25265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int chinese;\n  int math;\n  int all;\n} stu[1000], temp;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (k = 1; k < 4; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (stu[i].all >= stu[i + 1].all) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].No << \" \" << stu[i].all << \" \";\n  }\n}\n"}
{"label": "14", "index": "25266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct r {\n    int a;\n    int b;\n    int c;\n  } r[99999];\n  int i, n, x = 0, y = 0, z = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &r[i].a, &r[i].b, &r[i].c);\n  }\n  for (i = 1; i <= n; i++) {\n    if (r[i].b + r[i].c > m1) {\n      m1 = r[i].b + r[i].c;\n      x = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m1) && (i != x)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    } else if ((m1 > r[i].b + r[i].c) && (r[i].b + r[i].c > m2)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m2) && (i != y) && (i != x)) {\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n\n    else if ((m2 > r[i].b + r[i].c) && (r[i].b + r[i].c > m3)) {\n\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", x, m1);\n  printf(\"%d %d\\n\", y, m2);\n  printf(\"%d %d\\n\", z, m3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yu;\n    int shu;\n    int c;\n  } s[100000], k;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].yu, &s[i].shu);\n    s[i].c = s[i].yu + s[i].shu;\n  }\n\n  \n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n - 1; j++)\n      if (s[j].c > s[i].c) {\n        k = s[i];\n        s[i] = s[j];\n        s[j] = k;\n      }\n    printf(\"%d %d\\n\", s[i].num, s[i].c);\n  }\n}\n"}
{"label": "14", "index": "25268", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct {\n    int number;\n    float score1;\n    float score2;\n    float score3;\n\n  } stu[100000], temp;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    stu[i].score3 = stu[i].score2 + stu[i].score1;\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = n - 1; j >= n - i; j--)\n      if (stu[j - 1].score3 < stu[j].score3) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  cout << stu[0].number << \" \" << stu[0].score3 << endl;\n  cout << stu[1].number << \" \" << stu[1].score3 << endl;\n  cout << stu[2].number << \" \" << stu[2].score3;\n  return 0;\n}\n"}
{"label": "14", "index": "25269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  int sum[n];\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n    sum[i] = stu[i].chin + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++) {\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n    }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  float yuwen;\n  float shuxue;\n  float total;\n} stu[100000];\nint main() {\n  int i, n, j;\n  struct student *p;\n  p = &stu[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%f%f\", &(p + i)->num, &(p + i)->yuwen, &(p + i)->shuxue);\n    (p + i)->total = (p + i)->shuxue + (p + i)->yuwen;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((*(p + j)).total >= (*(p + j + 1)).total) {\n        struct student temp;\n        temp = *(p + j + 1);\n        *(p + j + 1) = *(p + j);\n        *(p + j) = temp;\n      }\n    }\n  if (n > 2)\n    for (i = 1; i < 4; i++)\n      printf(\"%d %g\\n\", (*(p + n - i)).num, (*(p + n - i)).total);\n  else if (n = 2)\n    printf(\"%d %g\\n%d %g\\n\", (*(p + 1)).num, (*(p + 1)).total, (*p).num,\n           (*p).total);\n}\n"}
{"label": "14", "index": "25271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k;\n  cin >> N;\n  struct Student_Num {\n    int num;\n    int Chinese;\n    int Math;\n  };\n  struct Student_Num student[N];\n  struct Student_Num temp;\n  for (i = 0; i < N; i++) {\n    cin >> student[i].num >> student[i].Chinese >> student[i].Math;\n  }\n  int total[N], totalNum[3], p[3];\n  for (i = 0; i < N; i++) {\n    total[i] = student[i].Chinese + student[i].Math;\n  }\n  for (i = 0; i < 3; i++) {\n    totalNum[i] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < N; j++) {\n      if (totalNum[i] < total[j]) {\n        totalNum[i] = total[j];\n        p[i] = j;\n      }\n    }\n    total[p[i]] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[p[i]].num, totalNum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} work[100001];\nvoid qsort(int left, int right) {\n  if (left >= right)\n    return;\n  int pindex = left, rindex = right;\n  work[0] = work[left];\n  while (pindex < rindex) {\n    while ((pindex < rindex) && (work[rindex].sum >= work[0].sum))\n      rindex--;\n    if (pindex < rindex) {\n      work[pindex] = work[rindex];\n      pindex++;\n    }\n    while ((pindex < rindex) && (work[pindex].sum < work[0].sum))\n      pindex++;\n    if (pindex < rindex) {\n      work[rindex] = work[pindex];\n      rindex--;\n    }\n  }\n  work[pindex] = work[0];\n  qsort(left, pindex - 1);\n  qsort(pindex + 1, right);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> work[i].num >> work[i].chinese >> work[i].math;\n    work[i].sum = work[i].chinese + work[i].math;\n  }\n  qsort(1, n);\n  for (i = 0; i <= 2; i++)\n    cout << work[n - i].num << \" \" << work[n - i].sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int id;\n    int yuwen;\n    int shuxue;\n  } stu[1000001];\n  int grade[100000];\n  int i, a, b;\n  int m1 = 0, m2 = 0, m3 = 0;\n  int m1id, m2id, m3id;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id;\n    cin >> stu[i].yuwen;\n    scanf(\"%d\", &stu[i].shuxue);\n    grade[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (grade[i] > m1) {\n      m1 = grade[i];\n      a = i;\n      m1id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m1id);\n  printf(\"%d\\n\", m1);\n\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m2) && (i != a)) {\n      m2 = grade[i];\n      b = i;\n      m2id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m2id);\n  printf(\"%d\\n\", m2);\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m3) && (i != a) && (i != b)) {\n      m3 = grade[i];\n      m3id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m3id);\n  printf(\"%d\\n\", m3);\n  return 0;\n}\n"}
{"label": "14", "index": "25274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, s, p;\n  struct student {\n    int id;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student stu[100000];\n  struct student temp;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    scanf(\"%d %d %d\", &stu[p].id, &stu[p].yuwen, &stu[p].shuxue);\n    stu[p].zongfen = stu[p].yuwen + stu[p].shuxue;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (stu[i].zongfen >= stu[i + 1].zongfen) {\n        temp.id = stu[i].id;\n        temp.yuwen = stu[i].yuwen;\n        temp.shuxue = stu[i].shuxue;\n        temp.zongfen = stu[i].zongfen;\n        stu[i].id = stu[i + 1].id;\n        stu[i].yuwen = stu[i + 1].yuwen;\n        stu[i].shuxue = stu[i + 1].shuxue;\n        stu[i].zongfen = stu[i + 1].zongfen;\n        stu[i + 1].id = temp.id;\n        stu[i + 1].yuwen = temp.yuwen;\n        stu[i + 1].shuxue = temp.shuxue;\n        stu[i + 1].zongfen = temp.zongfen;\n      }\n    }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    printf(\"%d %d \", stu[k].id, stu[k].zongfen);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int m;\n  int c;\n  int sum;\n};\n\nint main() {\n  long int n;\n  int a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  struct stu student[65535];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].c, &student[i].m);\n    student[i].sum = student[i].m + student[i].c;\n  }\n  for (int i = 0; i < n; i++) {\n    if (student[i].sum > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = student[i].sum;\n      x = student[i].num;\n      continue;\n    }\n    if (student[i].sum > b) {\n      c = b;\n      z = y;\n      b = student[i].sum;\n      y = student[i].num;\n      continue;\n    }\n    if (student[i].sum > c) {\n      c = student[i].sum;\n      z = student[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, a, y, b, z, c);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, i, max_1 = 0, d, t = 0;\nstruct stu {\n  int id;\n  int chi;\n  int ma;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(void) {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  p2 = p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->chi >> p1->ma;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid find(struct stu *head) {\n  while (t < 3) {\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->chi + p1->ma > max_1) {\n        max_1 = p1->chi + p1->ma;\n        d = p1->id;\n      }\n      p1 = p1->next;\n    }\n    cout << d << \" \" << max_1 << \" \";\n    t = t + 1;\n    max_1 = 0;\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->id == d) {\n        p1->chi = 0;\n        p1->ma = 0;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n\nint main() {\n  struct stu *head;\n  head = creat();\n  find(head);\n}\n"}
{"label": "14", "index": "25277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student student[100000];\n  int n, i, max, maxID;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].yuwen, &student[i].shuxue);\n  for (i = 1; i <= n; i++)\n    student[i].zongfen = student[i].yuwen + student[i].shuxue;\n  for (int j = 1; j <= 3; j++) {\n    maxID = 1;\n    max = student[1].zongfen;\n    for (i = 2; i <= n; i++)\n      if (student[i].zongfen > max) {\n        maxID = student[i].ID;\n        max = student[i].zongfen;\n      }\n    printf(\"%d %d\\n\", maxID, max);\n    student[maxID].zongfen = 0;\n  }\n}\n"}
{"label": "14", "index": "25278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int china;\n  int math;\n  int total;\n} stu[1000], temp;\nint main() {\n  int n, i, j, count;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].china, &stu[i].math);\n    stu[i].total = stu[i].china + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    temp = stu[i];\n    count = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > temp.total) {\n        temp = stu[j];\n        count = j;\n      }\n    }\n    stu[count] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", stu[i].id, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N, i, n[1000], c[1000], m[1000], sum[1000];\n  int x1 = 0, x2 = 0, x3 = 0, y1 = 0, y2 = 0, y3 = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d %d %d \", &n[i], &c[i], &m[i]);\n    sum[i] = c[i] + m[i];\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x1) {\n      x1 = sum[i];\n      y1 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x2 && sum[i] <= x1 && i != y1) {\n      x2 = sum[i];\n      y2 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x3 && sum[i] <= x2 && i != y1 && i != y2) {\n      x3 = sum[i];\n      y3 = i;\n    }\n  }\n  cout << y1 + 1 << \" \" << x1 << \" \" << y2 + 1 << \" \" << x2 << \" \" << y3 + 1\n       << \" \" << x3 << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int ID, chin, math;\n  };\n  stu *pp;\n  int sum, second, third, x, y, z;\n  int i, n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  pp = (struct stu *)malloc(sizeof(stu) * n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    (pp + i)->ID = a;\n    (pp + i)->chin = b;\n    (pp + i)->math = c;\n  }\n  sum = ((pp + i)->chin) + ((pp + i)->math);\n  for (i = 1; i <= n; i++) {\n    if (i == 1) {\n      sum = ((pp + i)->chin) + ((pp + i)->math);\n      second = ((pp + i)->chin) + ((pp + i)->math);\n      third = ((pp + i)->chin) + ((pp + i)->math);\n      x = (pp + i)->ID;\n      y = (pp + i)->ID;\n      z = (pp + i)->ID;\n\n    } else if (i == 2) {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        y = x;\n        x = (pp + i)->ID;\n      } else {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    } else {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = x;\n        x = (pp + i)->ID;\n      } else if (second < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = (pp + i)->ID;\n      } else if (third < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x, sum);\n  printf(\"%d %d\\n\", y, second);\n  printf(\"%d %d\\n\", z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j, max;\n  struct student t, *s;\n  scanf(\"%d\", &n);\n  s = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chi, &s[i].math);\n    s[i].sum = s[i].chi + s[i].math;\n  }\n\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[j].num, s[j].sum);\n  s[j].sum = 0;\n}\n"}
{"label": "14", "index": "25282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  if (n == 0) {\n    head = NULL;\n    return (head);\n  } else {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n    p1->next = NULL;\n    head = p1;\n    p2 = p1;\n    for (i = 1; i < n; i++) {\n      p1 = (struct student *)malloc(1000);\n      scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    }\n    return (head);\n  }\n}\nvoid top3(struct student *head) {\n  struct student *p, *p1;\n  int max = 0;\n  p = head;\n  do {\n    p->total = (p->chinese) + (p->math);\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  cout << p1->num << \" \" << p1->total << \" \";\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  cout << p1->num << \" \" << p1->total << \" \";\n  p1->total = 0;\n  max = 0;\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  top3(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum[100001], temp = 0;\n  cin >> n;\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n  } person[100001];\n  for (i = 1; i <= n; i++) {\n    cin >> person[i].ID >> person[i].chinese >> person[i].math;\n    sum[i] = person[i].chinese + person[i].math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp) {\n      temp = sum[i];\n      j = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j) {\n      temp = sum[i];\n      k = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j && i != k) {\n      temp = sum[i];\n      l = i;\n    }\n  }\n  printf(\"%d %d\\n\", person[j].ID, sum[j]);\n  cout << person[k].ID << \" \" << sum[k] << endl;\n  cout << person[l].ID << \" \" << sum[l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25284", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int ma;\n};\n\nint main() {\n  int n, i, j, score[100000], max[2];\n  struct stu STU[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &STU[i].num, &STU[i].ch, &STU[i].ma);\n    score[i] = STU[i].ch + STU[i].ma;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (score[i] > max[1]) {\n        max[0] = STU[i].num;\n        max[1] = score[i];\n      }\n    }\n    printf(\"%d %d\\n\", max[0], max[1]);\n    max[1] = 0;\n    int temp = max[0];\n    score[temp - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25285", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int ch;\n    int ma;\n    int sum;\n  };\n  struct student *p;\n  int n, i, a1 = 0, a2 = 0, a3 = 0, k1, k2, k3;\n  scanf(\"%d\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    cin >> p[i].num >> p[i].ch >> p[i].ma;\n    p[i].sum = p[i].ch + p[i].ma;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].sum > a1) {\n      k1 = i;\n      a1 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a1 && p[i].sum > a2 && i != k1) {\n      k2 = i;\n      a2 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a2 && p[i].sum > a3 && i != k1 && i != k2) {\n      k3 = i;\n      a3 = p[i].sum;\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", p[k1].num, p[k1].sum, p[k2].num, p[k2].sum,\n         p[k3].num, p[k3].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25286", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student max[3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[1].total) {\n      max[1] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[2].total && stu[i].total <= max[1].total &&\n        stu[i].id != max[1].id)\n      max[2] = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[3].total && stu[i].total <= max[2].total &&\n        stu[i].id != max[2].id && stu[i].id != max[1].id) {\n      max[3] = stu[i];\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", max[i].id, max[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stdudent {\n    int ID;\n    int a;\n    int b;\n    int c;\n\n  } d[100000];\n  int first, second, third;\n  int n, i, j;\n  int w, h, l;\n  int k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> d[i].ID >> d[i].a >> d[i].b;\n    d[i].c = d[i].a + d[i].b;\n  }\n  first = 0;\n  second = 1;\n  third = 2;\n  w = d[0].c;\n  h = d[1].c;\n  l = d[2].c;\n  if (w < h && (h > l)) {\n    first = 1;\n    if (w > l) {\n      second = 0;\n      third = 2;\n    } else {\n      second = 2;\n      third = 0;\n    }\n  } else if (l > w) {\n    first = 2;\n    if (w > h) {\n      second = 0;\n      third = 1;\n    } else\n      third = 0;\n  }\n\n  for (j = 3; j < n; j++) {\n    k = d[j].c;\n    w = d[first].c;\n    h = d[second].c;\n    l = d[third].c;\n    if (k > w) {\n      third = second;\n      second = first;\n      first = j;\n    } else if (k > h) {\n      third = second;\n      second = j;\n    } else if (k > l)\n      third = j;\n  }\n  printf(\"%d %d \", d[first].ID, d[first].c);\n  printf(\"%d %d \", d[second].ID, d[second].c);\n  printf(\"%d %d \", d[third].ID, d[third].c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, j, y, t, m;\n  struct s {\n    int a;\n    int b;\n    int c;\n  } stu[100000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].a, &stu[i].b, &stu[i].c);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((stu[j].b + stu[j].c) > (stu[i].b + stu[i].c)) {\n        y = stu[i].b;\n        t = stu[i].c;\n        m = stu[i].a;\n        stu[i].b = stu[j].b;\n        stu[j].b = y;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        stu[i].a = stu[j].a;\n        stu[j].a = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].a << \" \" << (stu[i].b + stu[i].c) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int tol;\n  struct student *next;\n};\n\nint main() {\n  struct student *p1, *p2, *head;\n  struct student *p, *a, *b, *c;\n  struct student temp;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->chi, &p1->mat);\n    p1->tol = p1->chi + p1->mat;\n    if (i == 0)\n      head = p2 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p = head;\n  temp.tol = 0;\n  a = b = c = &temp;\n  while (p != NULL) {\n    if (p->tol > a->tol) {\n      c = b;\n      b = a;\n      a = p;\n    } else if (p->tol > b->tol) {\n      c = b;\n      b = p;\n    } else if (p->tol > c->tol)\n      c = p;\n    p = p->next;\n  }\n  cout << a->num << \" \" << a->tol << \" \";\n  printf(\"%d %d \", b->num, b->tol);\n  printf(\"%d %d \", c->num, c->tol);\n  return 0;\n}\n"}
{"label": "14", "index": "25290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int o = 0, oz, t = 0, tz, th = 0;\n  scanf(\"%d\", &n);\n  struct {\n    int h, z;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    int h0, x0, y0;\n    cin >> h0 >> x0 >> y0;\n    s[i].h = h0;\n    s[i].z = x0 + y0;\n  }\n  for (i = 0; i < n; i++)\n    if (s[i].z > o)\n      o = s[i].z;\n  for (i = 0; i < n; i++)\n    if (s[i].z == o) {\n      oz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z > t))\n      t = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z == t)) {\n      tz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z > th))\n      th = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z == th)) {\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "25291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max = 0, maxj = 0;\n  if (n >= 3) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n  } else {\n    if (stu[0].sum > stu[1].sum)\n      cout << stu[0].num << ' ' << stu[0].sum << endl\n           << stu[1].num << ' ' << stu[1].sum;\n    else\n      cout << stu[1].num << ' ' << stu[1].sum << endl\n           << stu[0].num << ' ' << stu[0].sum;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25292", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int No;\n  int Chinese;\n  int Maths;\n  int Total;\n};\n\nvoid bubble(struct Student a[], int n) {\n  int i, j;\n  struct Student temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j].Total < a[j + 1].Total) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i;\n  struct Student stu[4];\n  scanf(\"%d\", &n);\n  if (n > 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].Chinese + stu[i].Maths;\n    }\n    for (i = 3; i < n; i++) {\n      cin >> stu[3].No >> stu[3].Chinese >> stu[3].Maths;\n      stu[3].Total = +stu[3].Chinese + stu[3].Maths;\n      bubble(stu, 4);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      cin >> stu[i].No >> stu[i].Chinese >> stu[i].Maths;\n      stu[i].Total = stu[i].No + stu[i].Chinese + stu[i].Maths;\n    }\n    bubble(stu, n);\n  }\n  for (i = 0; i < n && i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].No, stu[i].Total);\n  return 0;\n}\n"}
{"label": "14", "index": "25293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct data {\n    int number;\n    int chinese;\n    int math;\n    int total;\n  } student[100000], temp;\n  long n, i, j;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].number, &student[i].chinese,\n          &student[i].math);\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (student[i].total < student[j].total) {\n        temp.number = student[i].number;\n        temp.chinese = student[i].chinese;\n        temp.math = student[i].math;\n        temp.total = student[i].total;\n\n        student[i].number = student[j].number;\n        student[i].chinese = student[j].chinese;\n        student[i].math = student[j].math;\n        student[i].total = student[j].total;\n\n        student[j].number = temp.number;\n        student[j].chinese = temp.chinese;\n        student[j].math = temp.math;\n        student[j].total = temp.total;\n      }\n  for (i = 0; i < 3; i++)\n    cout << student[i].number << \" \" << student[i].total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25294", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int Student_Num;\n  cin >> Student_Num;\n\n  struct A {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } student[100000 + 10], a[3];\n\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    cin >> student[i].ID;\n    cin >> student[i].chinese;\n    cin >> student[i].math;\n    student[i].total = student[i].math + student[i].chinese;\n  }\n\n  a[0] = a[1] = a[2] = student[0];\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[0].total)\n      a[0] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[1].total && student[i].total <= a[0].total &&\n        student[i].ID != a[0].ID)\n      a[1] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[2].total && student[i].total <= a[1].total &&\n        student[i].ID != a[0].ID && student[i].ID != a[1].ID)\n      a[2] = student[i];\n  }\n\n  for (int i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", a[i].ID, a[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25295", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct s {\n    int id;\n    int ch;\n    int ma;\n  } s;\n  long int n;\n  int i = 0, j, zong, c = 0;\n  int a[3] = {0}, b[3] = {0};\n  int t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    a[i] = i + 1;\n    b[i] = s.ma + s.ch;\n  }\n  for (i = 0; i < 2; i++) {\n    if (b[i] > b[1 + i]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    zong = s.ch + s.ma;\n    for (j = 0; j < 3; j++) {\n      if (zong > b[j]) {\n        c++;\n      }\n    }\n    if (c == 1) {\n      a[0] = s.id;\n      b[0] = zong;\n    }\n    if (c == 2) {\n      a[0] = a[1];\n      b[0] = b[1];\n      a[1] = s.id;\n      b[1] = zong;\n    }\n    if (c == 3) {\n      a[0] = a[1];\n      a[1] = a[2];\n      a[2] = s.id;\n      b[0] = b[1];\n      b[1] = b[2];\n      b[2] = zong;\n    }\n    c = 0;\n  }\n  for (i = 2; i >= 0; i--) {\n    printf(\"%d %d\\n\", a[i], b[i]);\n  }\n}\n"}
{"label": "14", "index": "25296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long int num[100000];\n  int y[100000];\n  int m[100000];\n};\n\nint main() {\n  int n, i, temp = 0, sum[100000];\n  struct stu p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p.num[i] >> p.y[i] >> p.m[i];\n    sum[i] = p.m[i] + p.y[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 1], sum[n - 1]);\n  for (i = 0; i < n - 2; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 2], sum[n - 2]);\n  for (i = 0; i < n - 3; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 3], sum[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25297", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num[3], chinese[100000], math[100000], sum[100000];\n  int m, i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &m, &chinese[i], &math[i]);\n    sum[i] = chinese[i] + math[i];\n  }\n  int largest = 0;\n  for (i = 0; i < 3; i++) {\n    largest = 0;\n    for (int j = 0; j < n; j++)\n      if (sum[j] > largest) {\n        largest = sum[j];\n        num[i] = j;\n      }\n    cout << num[i] + 1 << \" \" << sum[num[i]] << endl;\n    sum[num[i]] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25298", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p, q, t;\n  int a[100000][3];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 3; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    a[i][1] = a[i][1] + a[i][2];\n  }\n  for (p = 0; p < 3; p++) {\n    for (q = n - 2; q >= 0; q--) {\n      if (a[q][1] < a[q + 1][1]) {\n        for (i = 0; i < 2; i++) {\n          t = a[q][i];\n          a[q][i] = a[q + 1][i];\n          a[q + 1][i] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i][0], a[i][1]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int score;\n};\n\nint main() {\n  int n;\n  cin >> n;\n  struct student stu[100000];\n  struct student *p, *p1, *t1, *t2, *t3;\n  int tem, tem1;\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d %d %d\", &p->num, &p->score1, &p->score2);\n    p->score = p->score1 + p->score2;\n  }\n  int max;\n  for (p = stu, t1 = stu, max = stu->score; p < stu + n; p++) {\n    if (p->score > max) {\n      t1 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t2 = stu, max = stu->score; p < stu + n; p++) {\n    if (p == t1)\n      continue;\n    if (p->score > max) {\n      t2 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t3 = stu, max = stu->score; p < stu + n; p++) {\n    if ((p == t1) || (p == t2))\n      continue;\n    if (p->score > max) {\n      t3 = p;\n      max = p->score;\n    }\n  }\n  printf(\"%d %d\\n\", t1->num, t1->score);\n  printf(\"%d %d\\n\", t2->num, t2->score);\n  printf(\"%d %d\\n\", t3->num, t3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "25300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct grades {\n    int id;\n    int yuwen, shuxue;\n    int zongfen;\n  } grades[100007];\n  int i, n, j, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &grades[i].id, &grades[i].yuwen, &grades[i].shuxue);\n\n    grades[i].zongfen = grades[i].yuwen + grades[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (grades[j].zongfen >= grades[j + 1].zongfen) {\n        t = grades[j].zongfen;\n        grades[j].zongfen = grades[j + 1].zongfen;\n        grades[j + 1].zongfen = t;\n        s = grades[j].id;\n        grades[j].id = grades[j + 1].id;\n        grades[j + 1].id = s;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    cout << grades[i].id << \" \" << grades[i].zongfen << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25301", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char num[10];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000];\n  struct student s[3];\n  struct student k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", a[i].num, &a[i].yuwen, &a[i].shuxue);\n    a[i].sum = a[i].yuwen + a[i].shuxue;\n  }\n  s[0] = a[0];\n  s[1] = a[0];\n  s[1].sum = 0;\n  s[2] = a[0];\n  s[2].sum = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i].sum > s[2].sum && a[i].sum <= s[1].sum) {\n      s[2] = a[i];\n    }\n    if (a[i].sum > s[1].sum && a[i].sum <= s[0].sum) {\n      s[2] = s[1];\n      s[1] = a[i];\n    }\n    if (a[i].sum > s[0].sum) {\n      s[2] = s[1];\n      s[1] = s[0];\n      s[0] = a[i];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%s %d\\n\", s[i].num, s[i].sum);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25302", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p1, *p2;\n  int i = 1;\n  head = NULL;\n  p2 = p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->b + p1->c;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i >= n)\n      break;\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->a >> p1->b >> p1->c;\n    p1->d = p1->b + p1->c;\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct stu *z, *p3, *p[100007], *q;\n  int i = 0, j, m;\n  scanf(\"%d\", &n);\n  z = creat();\n  p3 = p[i] = z;\n  while (p3 != NULL) {\n    i++;\n    p[i] = p3->next;\n    p3 = p[i];\n  }\n  m = i;\n  q = p[0];\n  for (i = 0; i < 4; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[j]->d >= p[j + 1]->d) {\n        q = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = q;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d \", p[m - i]->a, p[m - i]->d);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25303", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\n\nint main() {\n  int n, i, j, e;\n  scanf(\"%d \", &n);\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        e = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = e;\n        e = stu[j].ID;\n        stu[j].ID = stu[j + 1].ID;\n        stu[j + 1].ID = e;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].ID, stu[n - 1].zongfen,\n         stu[n - 2].ID, stu[n - 2].zongfen, stu[n - 3].ID, stu[n - 3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "25304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n};\nint main() {\n  struct Student *p1, *top1, *top2, *top3, *temp;\n  int i;\n  long int n;\n  scanf(\"%ld\", &n);\n\n  top1 = (struct Student *)malloc(sizeof(struct Student));\n  top2 = (struct Student *)malloc(sizeof(struct Student));\n  top3 = (struct Student *)malloc(sizeof(struct Student));\n  temp = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &top1->id, &top1->chn, &top1->mth);\n  top1->total = top1->chn + top1->mth;\n  cin >> top2->id >> top2->chn >> top2->mth;\n  top2->total = top2->chn + top2->mth;\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  scanf(\"%d %d %d\", &top3->id, &top3->chn, &top3->mth);\n  top3->total = top3->chn + top3->mth;\n  if (top3->total > top2->total) {\n    temp = top3;\n    top3 = top2;\n    top2 = temp;\n  }\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  for (i = 3; i < n; i++) {\n    p1 = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &p1->id, &p1->chn, &p1->mth);\n    p1->total = p1->chn + p1->mth;\n    if (top1->total < p1->total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = p1;\n      continue;\n    }\n    if (top2->total < p1->total) {\n      top3 = top2;\n      top2 = p1;\n      continue;\n    }\n    if (top3->total < p1->total) {\n      top3 = p1;\n      continue;\n    }\n    free(p1);\n  }\n  printf(\"%ld %d\\n%ld %d\\n%ld %d\\n\", top1->id, top1->total, top2->id,\n         top2->total, top3->id, top3->total);\n}\n"}
{"label": "14", "index": "25305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int mat, chi, i, num;\n  struct stu {\n    int id;\n    int to;\n  } s[100001], temp1, temp2, max1, max2, max3;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &chi, &mat);\n    s[i].to = chi + mat;\n  }\n  if (s[0].to > s[1].to && s[1].to > s[2].to) {\n    max1 = s[0];\n    max2 = s[1];\n    max3 = s[2];\n  } else if (s[2].to > s[0].to && s[0].to > s[1].to) {\n    max1 = s[2];\n    max2 = s[0];\n    max3 = s[1];\n  } else if (s[0].to > s[2].to && s[2].to > s[1].to) {\n    max1 = s[0];\n    max2 = s[2];\n    max3 = s[1];\n  } else if (s[2].to > s[1].to && s[1].to > s[0].to) {\n    max1 = s[2];\n    max2 = s[1];\n    max3 = s[0];\n  } else if (s[1].to > s[0].to && s[0].to > s[2].to) {\n    max1 = s[1];\n    max2 = s[0];\n    max3 = s[2];\n  } else {\n    max1 = s[1];\n    max2 = s[2];\n    max3 = s[0];\n  }\n  for (i = 0; i < num - 1; i++) {\n    if (s[i].to > max1.to) {\n      temp1 = max1;\n      temp2 = max2;\n      max1 = s[i];\n      max2 = temp1;\n      max3 = temp2;\n    } else if (s[i].to > max2.to && s[i].id != max1.id) {\n      temp1 = max2;\n      max2 = s[i];\n      max3 = temp1;\n    } else if (s[i].to > max3.to && s[i].id != max2.id && s[i].id != max1.id)\n      max3 = s[i];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.id, max1.to, max2.id, max2.to, max3.id,\n         max3.to);\n}\n"}
{"label": "14", "index": "25306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int i;\n    int x;\n    int y;\n    int m;\n    struct student *next;\n  };\n  int n, j, k;\n  struct student *head, *p1, *p2, *p0;\n  cin >> n;\n  p1 = (struct student *)malloc(1000);\n  cin >> p1->i >> p1->x >> p1->y;\n  p1->m = p1->x + p1->y;\n  p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->i, &p2->x, &p2->y);\n  p2->m = p2->x + p2->y;\n  if (p1->m > p2->m) {\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  } else {\n    p0 = p1;\n    p1 = p2;\n    p2 = p0;\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  }\n  p0 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p0->i, &p0->x, &p0->y);\n  p0->m = p0->x + p0->y;\n  while ((p0->m <= p1->m) && (p1->next != 0)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p0->m > p1->m) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n  } else {\n    p1->next = p0;\n    p0->next = 0;\n  }\n  for (j = 3; j < n; j++) {\n    p0 = (struct student *)malloc(1000);\n    cin >> p0->i >> p0->x >> p0->y;\n    p0->m = p0->x + p0->y;\n    for (k = 0, p1 = head; k <= 2; k++) {\n      if (p0->m > p1->m)\n        break;\n      p1 = p1->next;\n    }\n    if (k == 3)\n      continue;\n    p1 = p2 = head;\n    while (p0->m <= p1->m) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->m > p1->m) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  for (p1 = head, j = 0; j < 3; j++) {\n    printf(\"%d %d \", p1->i, p1->m);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int score1;\n  int score2;\n};\nstruct student stu[100000];\nint main() {\n  int n, i, first = 0, second = 0, third = 0, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[first] < a[i]) {\n      third = second;\n      second = first;\n      first = i;\n    } else if (a[second] < a[i]) {\n      third = second;\n      second = i;\n    } else {\n      if (a[third] < a[i]) {\n        third = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[first].number, a[first],\n         stu[second].number, a[second], stu[third].number, a[third]);\n  return (0);\n}\n"}
{"label": "14", "index": "25308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int ch;\n  int ma;\n};\n\nint main() {\n  struct student re[1000];\n  int n;\n  int i = 0, j = 0, rec;\n  int total[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &re[i].ID, &re[i].ch, &re[i].ma);\n    total[i] = re[i].ch + re[i].ma;\n  }\n\n  int max = total[0];\n\n  for (i = 0; i < n; i++) {\n    if (max < total[i]) {\n      max = total[i];\n      rec = i;\n    }\n    if (i == n - 1) {\n      printf(\"%d %d \", re[rec].ID, total[rec]);\n      total[rec] = 0;\n      i = 0;\n      max = total[0];\n      j++;\n    }\n\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25309", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[99999], b[2], i, k, m, s[99999], first = 0, x, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    for (k = 0; k < 2; k++) {\n      scanf(\"%d\", &b[k]);\n    }\n\n    s[i] = b[0] + b[1];\n  }\n\n  for (m = 0; m < 3; m++) {\n    first = 0;\n    for (x = 0; x < n; x++) {\n\n      if (s[x] > first) {\n        first = s[x];\n        y = x + 1;\n      }\n    }\n    printf(\"%d %d\\n\", y, first);\n    s[y - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    char ID[10];\n    int m;\n    int c;\n\n  } tmp;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int a1 = 0, a2 = 0, a3 = 0;\n  int n, i;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d %d\", tmp.ID, &(tmp.m), &(tmp.c));\n    if ((tmp.m + tmp.c) > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = a1;\n      a1 = i;\n    } else if ((tmp.m + tmp.c) == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    } else if ((tmp.m + tmp.c) < max1 && (tmp.m + tmp.c) > max2) {\n      max3 = max2;\n      max2 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    }\n\n    else if ((tmp.m + tmp.c) == max2) {\n      max3 = max2;\n      a3 = atoi(tmp.ID);\n    } else if ((tmp.m + tmp.c) < max2 && (tmp.m + tmp.c) > max3) {\n      max3 = tmp.m + tmp.c;\n      a3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a1, max1);\n  printf(\"%d %d\\n\", a2, max2);\n  printf(\"%d %d\\n\", a3, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct result {\n  int num;\n  int chn;\n  int math;\n  int total;\n};\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  struct result student[n + 1];\n  for (k = 1; k <= n; k++) {\n    cin >> student[k].num >> student[k].chn >> student[k].math;\n    student[k].total = student[k].chn + student[k].math;\n  }\n  int i, j;\n  struct result temp;\n  for (i = 1; i < 4; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (student[j].total >= student[j + 1].total) {\n        temp = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = temp;\n      }\n    }\n  printf(\"%d %d\\n\", student[n].num, student[n].total);\n  cout << student[n - 1].num << \" \" << student[n - 1].total << endl;\n  printf(\"%d %d\\n\", student[n - 2].num, student[n - 2].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    char a[6];\n    int c;\n    int m;\n    int s;\n    struct student *next;\n  };\n  struct student *head;\n  struct student *p1, *p2;\n  struct student first = {\"\", 0, 0, 0, 0};\n  struct student second = {\"\", 0, 0, 0, 0};\n  struct student third = {\"\", 0, 0, 0, 0};\n  int n, i, j;\n  char ch;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  for (j = 0; j < 6; j = j + 1)\n    p1->a[j] = '\u0000';\n  getchar();\n  for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n    p1->a[j] = ch;\n  scanf(\"%d%d\", &p1->c, &p1->m);\n  p1->s = p1->c + p1->m;\n  head = 0;\n  for (i = 1; i < n; i = i + 1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    for (j = 0; j < 6; j = j + 1)\n      p1->a[j] = '\u0000';\n    getchar();\n    for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n      p1->a[j] = ch;\n    scanf(\"%d%d\", &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n  }\n  p2->next = 0;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->s > first.s) {\n      third = second;\n      second = first;\n      first = *p1;\n    } else if (p1->s > second.s) {\n      third = second;\n      second = *p1;\n    } else if (p1->s > third.s) {\n      third = *p1;\n    } else\n      continue;\n  }\n  printf(\"%s %d \", first.a, first.s);\n  printf(\"%s %d \", second.a, second.s);\n  printf(\"%s %d \", third.a, third.s);\n}\n"}
{"label": "14", "index": "25313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\n\nint main() {\n  int n, i, j, e;\n  scanf(\"%d \", &n);\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        e = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = e;\n        e = stu[j].ID;\n        stu[j].ID = stu[j + 1].ID;\n        stu[j + 1].ID = e;\n      }\n    }\n  }\n\n  cout << stu[n - 1].ID << \" \" << stu[n - 1].zongfen << \"\\n\"\n       << stu[n - 2].ID << \" \" << stu[n - 2].zongfen << \"\\n\"\n       << stu[n - 3].ID << \" \" << stu[n - 3].zongfen << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25314", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct stu {\n    int num;\n    int chin;\n    int math;\n    int sum;\n  } one[n + 1];\n\n  for (int i = 1; i <= n; i++) {\n    cin >> one[i].num >> one[i].chin >> one[i].math;\n    one[i].sum = one[i].chin + one[i].math;\n  }\n  int t = 0;\n  for (int i = 200; i >= 0; i--)\n    for (int j = 1; j <= n; j++) {\n      if (one[j].sum == i) {\n        cout << j << \" \" << one[j].sum << endl;\n        t = t + 1;\n      }\n      if (t == 3) {\n        i = -1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "25315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int no;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000], t;\n  int n, i, j, max, order;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].no >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[i].total;\n    order = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > max) {\n        max = stu[j].total;\n        order = j;\n      }\n    }\n    if (order != i) {\n      t = stu[i];\n      stu[i] = stu[order];\n      stu[order] = t;\n    }\n    cout << stu[i].no << \" \" << stu[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n  };\n  int n, i, x, y, z, o, p, q;\n  cin >> n;\n  int a[100000];\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].ID >> stu[i].yuwen >> stu[i].shuxue;\n    a[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  x = 0;\n  y = 1;\n  z = 2;\n  for (i = 0; i < 3; i++) {\n    if (a[i] >= a[0] && a[i] >= a[1] && a[i] >= a[2]) {\n      x = i;\n      o = a[i];\n      continue;\n    }\n    if (a[i] <= a[0] && a[i] <= a[1] && a[i] <= a[2]) {\n      z = i;\n      q = a[i];\n      continue;\n    }\n    y = i;\n    p = a[i];\n  }\n\n  for (i = 3; i < n; i++) {\n    if (a[i] > q) {\n      if (a[i] > o) {\n        z = y;\n        y = x;\n        x = i;\n        q = p;\n        p = o;\n        o = a[i];\n      } else {\n        if (a[i] > p) {\n          z = y;\n          y = i;\n          q = p;\n          p = a[i];\n        } else {\n          z = i;\n          q = a[i];\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[x].ID, o);\n  cout << stu[y].ID << \" \" << p << \"\\n\";\n  printf(\"%d %d\\n\", stu[z].ID, q);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].total = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].total > stu[k].total)\n        k = j;\n    if (k != i) {\n      t = stu[i].total;\n      stu[i].total = stu[k].total;\n      stu[k].total = t;\n      t = stu[i].num;\n      stu[i].num = stu[k].num;\n      stu[k].num = t;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n}\n"}
{"label": "14", "index": "25318", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int ch;\n  int math;\n};\nint main() {\n  struct student stu[100000];\n  int n, i, j, sum = 0, id1 = 0, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].ch >> stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if ((stu[j].ch + stu[j].math) > sum) {\n        sum = stu[j].ch + stu[j].math;\n        id1 = stu[j].id;\n        flag = j;\n      }\n    }\n    printf(\"%d %d\\n\", id1, sum);\n    sum = 0;\n    id1 = 0;\n    stu[flag].ch = 0;\n    stu[flag].math = 0;\n    flag = 0;\n  }\n}\n"}
{"label": "14", "index": "25319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x[100000];\n  int i, j, n, s, y, p;\n  int b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y, &p);\n    b[i] = y + p;\n  }\n  int t;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] > b[i]) {\n        s = x[i];\n        x[i] = x[j];\n        x[j] = s;\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", x[i], b[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int id;\n    int yuwen;\n    int shuxue;\n  } stu[1000001];\n  int grade[100000];\n  int i, a, b;\n  int m1 = 0, m2 = 0, m3 = 0;\n  int m1id, m2id, m3id;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].id);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    grade[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (grade[i] > m1) {\n      m1 = grade[i];\n      a = i;\n      m1id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m1id);\n  cout << m1 << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m2) && (i != a)) {\n      m2 = grade[i];\n      b = i;\n      m2id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m2id);\n  printf(\"%d\\n\", m2);\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m3) && (i != a) && (i != b)) {\n      m3 = grade[i];\n      m3id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m3id);\n  printf(\"%d\\n\", m3);\n  return 0;\n}\n"}
{"label": "14", "index": "25321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, z;\n  struct a {\n    int num;\n    int b;\n    int c;\n    int d;\n  } a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].b, &a[i].c);\n    a[i].d = a[i].b + a[i].c;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < 2 - j; i++) {\n      if (a[i].d < a[i + 1].d) {\n        t = a[i].d;\n        z = a[i].num;\n        a[i].d = a[i + 1].d;\n        a[i].num = a[i + 1].num;\n        a[i + 1].d = t;\n        a[i + 1].num = z;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &a[3].num, &a[3].b, &a[3].c);\n    a[3].d = a[3].b + a[3].c;\n    if (a[3].d > a[0].d) {\n      a[2] = a[1];\n      a[1] = a[0];\n      a[0] = a[3];\n    } else if (a[3].d > a[1].d) {\n      a[2] = a[1];\n      a[1] = a[3];\n    } else if (a[3].d > a[2].d) {\n      a[2] = a[3];\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].d);\n  printf(\"%d %d\\n\", a[1].num, a[1].d);\n  printf(\"%d %d\\n\", a[2].num, a[2].d);\n  return 0;\n}\n"}
{"label": "14", "index": "25322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum[99999];\nint m[99999];\nint main(int argc, char *argv[]) {\n  int n, i, b, c, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a, &b, &c);\n    sum[i] = b + c;\n    m[i] = a;\n  }\n  int j, k, t, x, l = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (sum[k] > sum[k - 1]) {\n        t = sum[k - 1];\n        sum[k - 1] = sum[k];\n        sum[k] = t;\n        x = m[k - 1];\n        m[k - 1] = m[k];\n        m[k] = x;\n      }\n    }\n    l++;\n    if (l == 3)\n      break;\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%d %d\\n\", m[i], sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int math;\n  int chinese;\n} stu[100000];\nint main() {\n  int n, i, j, s[100000], t[100000], c = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    s[i] = stu[i].math + stu[i].chinese;\n    t[i] = s[i];\n  }\n  int p;\n  for (i = 0; i <= 2; i++) {\n    for (j = 0; j <= (n - i - 2); j++) {\n      if (s[j] >= s[j + 1]) {\n        p = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = p;\n      }\n    }\n  }\n  int d[3];\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 1]) {\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 2]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 3]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[100000];\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n\n} a[100000];\n\nint main() {\n  int max(int b[], int n);\n\n  int i, j = 0, n, c;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].score1, &a[i].score2);\n    b[i] = a[i].score1 + a[i].score2;\n  }\n  while (j < 3) {\n    c = max(b, n);\n    for (i = 0; i < n; i++) {\n      if (b[i] == c) {\n        printf(\"%d %d\\n\", a[i].num, b[i]);\n        b[i] = 0;\n        j = j + 1;\n        if (j == 3)\n          break;\n      }\n    }\n  }\n}\nint max(int b[], int n) {\n  int c, i;\n  c = b[0];\n  for (i = 0; i < n; i++) {\n    if (c < b[i])\n      c = b[i];\n  }\n  return (c);\n}\n"}
{"label": "14", "index": "25325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n  };\n  int n, i, x, y, z, o, p, q;\n  scanf(\"%d\", &n);\n  int a[100000];\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    a[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  x = 0;\n  y = 1;\n  z = 2;\n  for (i = 0; i < 3; i++) {\n    if (a[i] >= a[0] && a[i] >= a[1] && a[i] >= a[2]) {\n      x = i;\n      o = a[i];\n      continue;\n    }\n    if (a[i] <= a[0] && a[i] <= a[1] && a[i] <= a[2]) {\n      z = i;\n      q = a[i];\n      continue;\n    }\n    y = i;\n    p = a[i];\n  }\n\n  for (i = 3; i < n; i++) {\n    if (a[i] > q) {\n      if (a[i] > o) {\n        z = y;\n        y = x;\n        x = i;\n        q = p;\n        p = o;\n        o = a[i];\n      } else {\n        if (a[i] > p) {\n          z = y;\n          y = i;\n          q = p;\n          p = a[i];\n        } else {\n          z = i;\n          q = a[i];\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[x].ID, o);\n  printf(\"%d %d\\n\", stu[y].ID, p);\n  printf(\"%d %d\\n\", stu[z].ID, q);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num[3], sum[3];\n  int i, j, k, t, n, m;\n  num[0] = num[1] = num[2] = sum[0] = sum[1] = sum[2] = -10000000;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d%d\", &i, &j, &k);\n    j += k;\n    if (sum[2] < j) {\n      sum[2] = j;\n      num[2] = i;\n      if (sum[2] > sum[1]) {\n        t = sum[2];\n        sum[2] = sum[1];\n        sum[1] = t;\n        t = num[2];\n        num[2] = num[1];\n        num[1] = t;\n        if (sum[1] > sum[0]) {\n          t = sum[0];\n          sum[0] = sum[1];\n          sum[1] = t;\n          t = num[0];\n          num[0] = num[1];\n          num[1] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << num[i] << \" \" << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25327", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int x, y;\n  int s;\n} d[100001], t;\n\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    cin >> d[i].id >> d[i].x >> d[i].y;\n\n    d[i].s = d[i].x + d[i].y;\n  }\n\n  for (int i = 1; i <= 3; i++)\n    for (int j = 1; j <= n - i; j++)\n      if (d[j].s >= d[j + 1].s) {\n        t = d[j];\n        d[j] = d[j + 1];\n        d[j + 1] = t;\n      }\n\n  for (int i = n; i >= n - 2; i--)\n    printf(\"%d %d\\n\", d[i].id, d[i].s);\n  return 0;\n}\n"}
{"label": "14", "index": "25328", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yu;\n    int shu;\n    int c;\n  } s[100000], k;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].yu >> s[i].shu;\n    s[i].c = s[i].yu + s[i].shu;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n - 1; j++)\n      if (s[j].c > s[i].c) {\n        k = s[i];\n        s[i] = s[j];\n        s[j] = k;\n      }\n    printf(\"%d %d\\n\", s[i].num, s[i].c);\n  }\n}\n"}
{"label": "14", "index": "25329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100001][5];\n  int i, j, n, k = 3, max = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n    a[i][4] = a[i][2] + a[i][3];\n  }\n  while (k--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i][4] > max)\n        max = a[i][4], t = i;\n    }\n    printf(\"%d %d\\n\", t, a[t][4]);\n    a[t][4] = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "25330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int grade[2];\n};\nstruct student stu[100000];\nint main() {\n  int n, sum[100000], i, count, max, j;\n  count = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%s %d %d\", stu[i].num, &stu[i].grade[0], &stu[i].grade[1]);\n    sum[i] = stu[i].grade[0] + stu[i].grade[1];\n  }\n  while (count <= 2) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        j = i;\n      }\n    }\n    cout << stu[j].num << \" \" << sum[j] << \"\\n\";\n    count++;\n    sum[j] = 0;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  }\n  printf(\"%s %d\", stu[j].num, sum[j]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int n;\n    int a;\n    int b;\n  } n[100000];\n  int m, i, sum[100000], first, second, third, d, e, f;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &n[i].n);\n    scanf(\"%d\", &n[i].a);\n    scanf(\"%d\", &n[i].b);\n    sum[i] = n[i].a + n[i].b;\n  }\n  if (sum[0] > sum[1] && sum[0] > sum[2] && sum[1] > sum[2]) {\n    first = sum[0];\n    second = sum[1];\n    third = sum[2];\n    d = 1;\n    e = 2;\n    f = 3;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] > sum[2]) {\n    first = sum[0];\n    second = sum[2];\n    third = sum[1];\n    d = 1;\n    e = 3;\n    f = 2;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] > sum[2]) {\n    first = sum[1];\n    second = sum[0];\n    third = sum[2];\n    d = 2;\n    e = 1;\n    f = 3;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] < sum[2]) {\n    first = sum[1];\n    second = sum[2];\n    third = sum[0];\n    d = 2;\n    e = 3;\n    f = 1;\n  } else if (sum[0] < sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[1];\n    third = sum[0];\n    d = 3;\n    e = 2;\n    f = 1;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[0];\n    third = sum[1];\n    d = 3;\n    e = 1;\n    f = 2;\n  }\n  for (i = 3; i < m; i++) {\n    if (sum[i] > first) {\n      third = second;\n      second = first;\n      first = sum[i];\n      f = e;\n      e = d;\n      d = i + 1;\n    } else if (sum[i] <= first && sum[i] > second) {\n      third = second;\n      second = sum[i];\n      f = e;\n      e = i + 1;\n    } else if (sum[i] <= second && sum[i] > third) {\n      third = sum[i];\n      f = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", d, first);\n  printf(\"%d %d\\n\", e, second);\n  printf(\"%d %d\\n\", f, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25332", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int n, i, j, max;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n      cin >> p1->a >> p1->b >> p1->c;\n      head = p1;\n      p2 = p1;\n    } else {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      cin >> p1->a >> p1->b >> p1->c;\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = NULL;\n\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c > max)\n        max = p1->b + p1->c;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c == max) {\n        printf(\"%d %d\\n\", p1->a, max);\n        p1->b = 0;\n        p1->c = 0;\n        p1 = p1->next;\n        break;\n      } else\n        p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "25333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000];\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> t[i].num >> t[i].chinese >> t[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    tmp = t[i].sum;\n    t[i].sum = t[k].sum;\n    t[k].sum = tmp;\n\n    tmp = t[i].num;\n    t[i].num = t[k].num;\n    t[k].num = tmp;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %ld\\n\", t[i].num, t[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25334", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c;\n  struct student {\n    int id;\n    int score;\n  } stu[100000], t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> b >> c;\n    stu[i].score = b + c;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].score > stu[j - 1].score) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].score);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int sum;\n  } stu[100000], temp;\n  int total, i, j, chin, math;\n  cin >> total;\n  for (i = 0; i < total; i++) {\n    cin >> stu[i].num >> chin >> math;\n    stu[i].sum = chin + math;\n  }\n  for (i = 2; i < 5; i++) {\n    for (j = total - i; j >= 0; j--) {\n      if (stu[j].sum < stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "25336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int n1;\n  int n2;\n  int n3;\n  struct student *next;\n};\nint main() {\n  struct student *p, *head, *tail;\n  int n, i, sum[100000], max1, max2, max3, k1, k2, k3;\n  cin >> n;\n  head = NULL;\n  tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct student *)malloc(1000);\n    cin >> p->n1 >> p->n2 >> p->n3;\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    sum[i] = p->n2 + p->n3;\n  }\n  max1 = sum[1];\n  k1 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      k1 = i;\n    }\n  sum[k1] = 0;\n\n  max2 = sum[1];\n  k2 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max2) {\n      max2 = sum[i];\n      k2 = i;\n    }\n  sum[k2] = 0;\n\n  max3 = sum[1];\n  k3 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max3) {\n      max3 = sum[i];\n      k3 = i;\n    }\n  cout << k1 << \" \" << max1 << \" \" << k2 << \" \" << max2 << \" \" << k3 << \" \"\n       << max3 << \" \";\n}\n"}
{"label": "14", "index": "25337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n    struct stu *next;\n    struct stu *back;\n  };\n  struct stu *head, *p1, *p2, *p, *pmax1, *pmax2, *pmax3;\n  int n, i, max1, max2, max3;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->back = p2;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p = head;\n  max1 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max1 < (p->b + p->c)) {\n      max1 = p->b + p->c;\n      pmax1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max2 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max2 < (p->b + p->c) && (p != pmax1)) {\n      max2 = p->b + p->c;\n      pmax2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max3 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max3 < (p->b + p->c) && (p != pmax1) && (p != pmax2)) {\n      max3 = p->b + p->c;\n      pmax3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%ld %d\\n\", pmax1->a, (pmax1->b + pmax1->c));\n  printf(\"%ld %d\\n\", pmax2->a, (pmax2->b + pmax2->c));\n  printf(\"%ld %d\\n\", pmax3->a, (pmax3->b + pmax3->c));\n  return 0;\n}\n"}
{"label": "14", "index": "25338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n, i, j, math[100000], chin[100000], total[100000], id[100000];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld\", &id[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &chin[i]);\n  }\n  for (i = 0; i < n; i++)\n    total[i] = 100000 * (math[i] + chin[i]) + 100000 - id[i];\n\n  int comp(const void *a, const void *b);\n  qsort(total, n, sizeof(long), comp);\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 1] - 100000 * ((int)total[n - 1] / 100000)),\n         (int)total[n - 1] / 100000);\n  cout << 100000 - (total[n - 2] - 100000 * ((int)total[n - 2] / 100000)) << \" \"\n       << (int)total[n - 2] / 100000 << \"\\n\";\n  printf(\"%ld %ld\\n\",\n         100000 - (total[n - 3] - 100000 * ((int)total[n - 3] / 100000)),\n         (int)total[n - 3] / 100000);\n  getchar();\n  getchar();\n}\n\nint comp(const void *a, const void *b) { return *(long *)a - *(long *)b; }\n"}
{"label": "14", "index": "25339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int num;\n  int chin;\n  int math;\n  struct info *next;\n};\nstruct info *create(int n) {\n  int i;\n  struct info *head, *p1, *p2;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  } while (i < n);\n  return (head);\n}\nvoid arrange(struct info *head) {\n  int m, no1, no2, no3;\n  struct info *p;\n  p = head;\n  m = 0;\n  while (p) {\n    if (p->chin + p->math > m) {\n      m = p->chin + p->math;\n      no1 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no1, m);\n  m = 0;\n  p = head;\n  no2 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1) {\n      m = p->chin + p->math;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no2, m);\n  m = 0;\n  p = head;\n  no3 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1 && p->num != no2) {\n      m = p->chin + p->math;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  cout << no3 << \" \" << m << \"\\n\";\n}\nint main() {\n  int n;\n  struct info *head;\n  cin >> n;\n  head = create(n);\n  arrange(head);\n}\n"}
{"label": "14", "index": "25340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k;\n  struct student {\n    int num;\n    int score1;\n    int score2;\n    int t;\n  } stu[100000], m1, m2, m3;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].t = stu[i].score1 + stu[i].score2;\n  }\n  m1 = stu[0];\n  m2 = stu[0];\n  m3 = stu[0];\n  for (i = 0; i < n; i++) {\n    if (stu[i].t > m1.t) {\n      m3 = m2;\n      m2 = m1;\n      m1 = stu[i];\n    } else if (stu[i].t > m2.t && stu[i].t <= m1.t) {\n      m3 = m2;\n      m2 = stu[i];\n    } else if (stu[i].t > m3.t && stu[i].t <= m2.t) {\n      m3 = stu[i];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", m1.num, m1.t, m2.num, m2.t, m3.num, m3.t);\n}\n"}
{"label": "14", "index": "25341", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint first[3], firsti[3];\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n\n} * p1, *p2;\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  while (n--) {\n    cin >> p1->num >> p1->chinese >> p1->math;\n    if (head == NULL)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct stu *sum(struct stu *head, int n) {\n  p1 = head;\n  while (n--) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  int n, i, check = 0;\n  struct stu *head, *f1, *f2, *f3;\n  f1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = sum(head, n);\n  p1 = head;\n  if (n == 1) {\n    printf(\"%d %d\\n\", p1->num, p1->sum);\n    return 0;\n  }\n\n  for (i = 0, f1 = head; i < n; i++, p1 = p1->next)\n    if (f1->sum < p1->sum)\n      f1 = p1;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f1) {\n      head = p1;\n      break;\n    } else if (p1 == f1) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f2 = head; i < n - 1; i++, p1 = p1->next)\n    if (f2->sum < p1->sum)\n      f2 = p1;\n  if (n == 2) {\n    printf(\"%d %d\\n\", f1->num, f1->sum);\n    printf(\"%d %d\\n\", f2->num, f2->sum);\n    return 0;\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f2) {\n      head = p1;\n      break;\n    } else if (p1 == f2) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f3 = head; i < n - 2; i++, p1 = p1->next)\n    if (f3->sum < p1->sum)\n      f3 = p1;\n  printf(\"%d %d\\n\", f1->num, f1->sum);\n  printf(\"%d %d\\n\", f2->num, f2->sum);\n  printf(\"%d %d\\n\", f3->num, f3->sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, max, k;\n  struct stu {\n    int num;\n    int chinese;\n    int maths;\n    int all;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].maths;\n  for (i = 0; i < n; i++)\n    stu[i].all = stu[i].chinese + stu[i].maths;\n\n  for (k = 0; k < 3; k++) {\n    max = stu[0].all;\n    for (i = 0; i < n; i++) {\n      if (stu[i].all > max) {\n        max = stu[i].all;\n        j = i;\n      }\n    }\n\n    printf(\"%d %d\\n\", stu[j].num, stu[j].all);\n    stu[j].all = 0;\n  }\n}\n"}
{"label": "14", "index": "25343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int maths;\n};\nstruct qiansan {\n  int num;\n  int zongfen;\n} st[3] = {{0, 0}, {0, 0}, {0, 0}};\nint main() {\n  int n, i;\n  int a[100001];\n  scanf(\"%d\", &n);\n  struct Student std[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &std[i].num, &std[i].chinese, &std[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = std[i].chinese + std[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = a[i];\n      st[0].num = std[i].num;\n    } else if (a[i] <= st[0].zongfen && a[i] > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = a[i];\n      st[1].num = std[i].num;\n    } else if (a[i] <= st[1].zongfen && a[i] > st[2].zongfen) {\n      st[2].zongfen = a[i];\n      st[2].num = std[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  long n, i;\n  int high[4] = {0};\n  long higher[4];\n  struct student {\n    long num;\n    int yuwen;\n    int shuxue;\n    int total;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].total > high[1]) {\n      high[1] = stu[i].total;\n      higher[1] = i;\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[1] && stu[i].total > high[2] && i != higher[1]) {\n      high[2] = stu[i].total;\n      higher[2] = i;\n    }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[2] && stu[i].total > high[3] && i != higher[1] &&\n        i != higher[2]) {\n      high[3] = stu[i].total;\n      higher[3] = i;\n    }\n  for (i = 1; i < 4; i++)\n    printf(\"%d %d\\n\", higher[i], high[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "25345", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t = 0, c = 1, d = 1, n, p = 0, q = 0, r = 0, *b;\n  struct pp {\n    int x;\n    int y;\n    int z;\n  } * s;\n  cin >> n;\n  b = (int *)malloc(sizeof(int) * n);\n  s = (struct pp *)malloc(sizeof(int) * 3 * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].x, &s[i].y, &s[i].z);\n    b[i] = ((s[i].y) + (s[i].z));\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > t) {\n      t = b[i];\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > c) && (i != p)) {\n        c = b[i];\n        q = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > d) && (i != p) && (i != q)) {\n        d = b[i];\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", s[p].x, b[p]);\n  printf(\"%d %d\\n\", s[q].x, b[q]);\n  printf(\"%d %d\\n\", s[r].x, b[r]);\n  return 0;\n}\n"}
{"label": "14", "index": "25346", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int stuID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main() {\n  int i, n, j, x, str;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuID >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (stu[j].zongfen > stu[j + 1].zongfen ||\n          ((stu[j].zongfen == stu[j + 1].zongfen) &&\n           (stu[j].stuID < stu[j + 1].stuID))) {\n        x = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = x;\n        str = stu[j].stuID;\n        stu[j].stuID = stu[j + 1].stuID;\n        stu[j + 1].stuID = str;\n      }\n    }\n    printf(\"%d %d\\n\", stu[n - 1 - i].stuID, stu[n - 1 - i].zongfen);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int ch;\n  int math;\n  int sum;\n};\nint main() {\n  struct Student stu[4], temp;\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].ch, &stu[i].math);\n    stu[i].sum = stu[i].ch + stu[i].math;\n  }\n  for (i = 0; i < 2; i++) {\n    k = i;\n    for (j = i + 1; j < 3; j++)\n      if (stu[j].sum > stu[i].sum) {\n        k = j;\n        temp = stu[k];\n        stu[j] = stu[i];\n        stu[i] = temp;\n      }\n  }\n  \n  \n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[3].num, &stu[3].ch, &stu[3].math);\n    stu[3].sum = stu[3].ch + stu[3].math;\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum)\n      stu[2] = stu[3];\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chi;\n  int math;\n  int total;\n} person[100000], first[3] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};\nint main() {\n  long n;\n  int i, j;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &person[i].num, &person[i].chi, &person[i].math);\n    person[i].total = person[i].chi + person[i].math;\n    if (person[i].total > first[0].total) {\n      first[1] = first[0];\n      first[0] = person[i];\n    } else if (person[i].total > first[1].total) {\n      first[2] = first[1];\n      first[1] = person[i];\n    } else if (person[i].total > first[2].total)\n      first[2] = person[i];\n  }\n  for (j = 0; j < 3; j++) {\n    printf(\"%ld %d\\n\", first[j].num, first[j].total);\n  }\n}\n"}
{"label": "14", "index": "25349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chinese >> p1->math;\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  int t = n;\n  while (n > 1) {\n    if (n == t)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    n--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct student *first, *second, *third;\n  int fir_index, sec_index, thr_index;\n  scanf(\"%d\", &n);\n  struct student *head, *p1;\n  struct student stu;\n  head = creat(n);\n  first = head;\n  second = head;\n  third = head;\n  for (p1 = head; p1->next != NULL; p1 = p1->next) {\n    if (p1->sum > first->sum) {\n      third = second;\n      second = first;\n      first = p1;\n    } else if (p1->sum > second->sum) {\n      third = second;\n      second = p1;\n    } else if (p1->sum > third->sum) {\n      third = p1;\n    }\n  }\n  printf(\"%s %d \", first->num, first->sum);\n  cout << second->num << \" \" << second->sum << \" \";\n  printf(\"%s %d \", third->num, third->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m1, m2, m3, n1, n2, n3;\n  struct student {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct student stu[100000];\n  struct student *p;\n  p = stu;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> (p + i)->num >> (p + i)->verbal >> (p + i)->math;\n  for (i = 0; i < n; i++) {\n    (p + i)->sum = (p + i)->verbal + (p + i)->math;\n  }\n  m1 = p->sum;\n  n1 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m1) {\n      m1 = (p + i)->sum;\n      n1 = i;\n    }\n  printf(\"%d %d\\n\", (p + n1)->num, (p + n1)->sum);\n  m2 = p->sum;\n  n2 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m2 && i != n1) {\n      m2 = (p + i)->sum;\n      n2 = i;\n    }\n  printf(\"%d %d\\n\", (p + n2)->num, (p + n2)->sum);\n  m3 = p->sum;\n  n3 = 0;\n  for (i = 0; i < n; i++)\n    if ((((p + i)->sum) > m3) && i != n1 && i != n2) {\n      m3 = (p + i)->sum;\n      n3 = i;\n    }\n  printf(\"%d %d\\n\", (p + n3)->num, (p + n3)->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int chn;\n  int math;\n  int sum;\n};\nint main() {\n  struct stu indi[100000];\n  int n, i, j, rank[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &indi[i].id, &indi[i].chn, &indi[i].math);\n    indi[i].sum = indi[i].chn + indi[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    rank[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (indi[j].sum > indi[rank[i]].sum)\n        rank[i] = j;\n    }\n    indi[rank[i]].sum = -indi[rank[i]].sum;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", indi[rank[i]].id, -indi[rank[i]].sum);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, score[100000], max1 = 0, m1 = 0, max2 = 0, m2 = 0, max3 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  struct stu {\n    int No;\n    int yw;\n    int math;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].No, &s[i].yw, &s[i].math),\n        score[i] = s[i].yw + s[i].math;\n    if (score[i] > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = score[i];\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n      continue;\n    }\n    if (score[i] <= max1 && score[i] > max2) {\n      max3 = max2;\n      max2 = score[i];\n      m3 = m2;\n      m2 = i;\n      continue;\n    }\n    if (score[i] <= max2 && score[i] > max3) {\n      max3 = score[i];\n      m3 = i;\n      continue;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s[m1].No, max1, s[m2].No, max2, s[m3].No,\n         max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, max, m;\n  cin >> n;\n  struct stu {\n    int hao, yuwen, shuxue, zong;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].hao >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].zong = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[0].zong;\n    for (j = 1; j < n; j++) {\n      if (stu[j].zong > max) {\n        max = stu[j].zong;\n        m = j;\n      }\n    }\n    cout << stu[m].hao << \" \" << max << \"\\n\";\n    stu[m].zong = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int c;\n  int m;\n  int sum;\n  struct student *next;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p0, *p, *q;\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    q = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &q->num, &q->c, &q->m);\n    q->sum = q->c + q->m;\n    q->next = NULL;\n    p0 = head;\n    p = p0->next;\n    j = 0;\n    while (p != NULL && q->sum <= p->sum) {\n      p0 = p;\n      p = p->next;\n      j++;\n      if (j > 3)\n        goto A;\n    }\n    p0->next = q;\n    q->next = p;\n  A:\n    continue;\n  }\n  p = head->next;\n  for (i = 0; i < 3; i++) {\n    cout << p->num << \" \" << p->sum << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25355", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i;\n  cin >> n; \n  struct student {\n    int stuNo;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n]; \n  struct tri {\n    int stuNo;\n    int zongfen;\n  } qian[3] = {0, 0, 0, 0, 0, 0}; \n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuNo;\n    cin >> stu[i].yuwen;\n    cin >> stu[i].shuxue;                          \n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue; \n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > qian[0].zongfen) {\n      qian[2] = qian[1];\n      qian[1] = qian[0];\n      qian[0].stuNo = stu[i].stuNo;\n      qian[0].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[1].zongfen) {\n      qian[2] = qian[1];\n      qian[1].stuNo = stu[i].stuNo;\n      qian[1].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[2].zongfen) {\n      qian[2].stuNo = stu[i].stuNo;\n      qian[2].zongfen = stu[i].zongfen;\n    }\n  } \n  for (i = 0; i < 3; i++)\n    cout << qian[i].stuNo << ' ' << qian[i].zongfen << endl; \n  return 0;\n}\n"}
{"label": "14", "index": "25356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int scorechinese;\n    int scoremath;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].scorechinese >> a[i].scoremath;\n    a[i].sum = a[i].scorechinese + a[i].scoremath;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], d[100], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  if (n == 10) {\n    printf(\"6 181 \");\n    printf(\"3 176 \");\n    printf(\"8 175 \");\n  } else {\n    printf(\"16533 198 \");\n    printf(\"60249 198 \");\n    printf(\"204 197 \");\n  }\n}\n"}
{"label": "14", "index": "25358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int num;\n  int score, score1, score2;\n  struct stud *next;\n} head, end_1;\nvoid create(int n) {\n  int i;\n  struct stud *p1, *p2;\n  head.next = NULL;\n  for (i = 0; i <= n - 1; i++) {\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    if (!i)\n      head.next = p1;\n    else\n      p2->next = p1;\n    scanf(\"%d\", &p1->num);\n    scanf(\"%d\", &p1->score1);\n    scanf(\"%d\", &p1->score2);\n    p1->score = p1->score1 + p1->score2;\n    p2 = p1;\n  }\n  p2->next = &end_1;\n}\nvoid find() {\n  struct stud *max1, *max2, *max3, *p1, *swap;\n  max1 = head.next;\n  max2 = max1->next;\n  max3 = max2->next;\n  p1 = max3->next;\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  if (max2->score < max3->score) {\n    swap = max2;\n    max2 = max3;\n    max3 = swap;\n  }\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  while (p1 != &end_1) {\n    if (p1->score > max3->score)\n      max3 = p1;\n    if (max3->score > max2->score) {\n      swap = max3;\n      max3 = max2;\n      max2 = swap;\n    }\n    if (max2->score > max1->score) {\n      swap = max1;\n      max1 = max2;\n      max2 = swap;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d \", max1->num, max1->score);\n  printf(\"%d %d \", max2->num, max2->score);\n  printf(\"%d %d \", max3->num, max3->score);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  create(n);\n  find();\n  return 0;\n}\n"}
{"label": "14", "index": "25359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int Chi;\n  int Math;\n  int sum;\n};\nstruct Student stud[100000], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stud[i].num >> stud[i].Chi >> stud[i].Math;\n    stud[i].sum = stud[i].Chi + stud[i].Math;\n  }\n  if (n == 2) {\n    if (stud[0].sum < stud[1].sum) {\n      temp = stud[0];\n      stud[0] = stud[1];\n      stud[1] = temp;\n    }\n  } else {\n    for (i = 0; i < 3; i++) {\n      for (j = n - 1; j > i; j--) {\n        if (stud[j].sum > stud[j - 1].sum) {\n          temp = stud[j];\n          stud[j] = stud[j - 1];\n          stud[j - 1] = temp;\n        }\n      }\n    }\n  }\n\n  if (n == 2) {\n\n    cout << stud[0].num << ' ' << stud[0].sum << endl;\n\n    cout << stud[1].num << ' ' << stud[1].sum;\n  }\n  for (i = 0; i < 2; i++) {\n    cout << stud[i].num << ' ' << stud[i].sum << endl;\n  }\n  cout << stud[2].num << ' ' << stud[2].sum;\n  return 0;\n}\n"}
{"label": "14", "index": "25360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, k, a, b, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &a, &b);\n    stu[i].sum = a + b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - i - 1; j > 0; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "25361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n  struct student *next;\n};\nint main() {\n  int n = 0, i, j, k;\n  scanf(\"%d\", &k);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = NULL;\n  for (i = 0; i < k - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->a >> p1->b >> p1->c;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  struct student *g;\n  int x[100000], y[100000];\n  g = head;\n  for (i = 0; i < k; i++) {\n    x[i] = g->a;\n    y[i] = g->b + g->c;\n    g = g->next;\n  }\n  int m[4] = {0}, t, r = 1, z = 0;\n  m[0] = 201;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < k; j++) {\n      if (m[r] < y[j] && y[j] < m[r - 1])\n        m[r] = y[j];\n    }\n    r++;\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[1]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[2]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[3]) {\n      cout << x[i] << \" \" << y[i];\n      z++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[99999], b[99999], c[99999], d[99999];\n  int i, n, sum, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n    d[i] = c[i] + b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n\n  for (i = 0; i < n - 2; i++) {\n    if (d[i] >= d[i + 1]) {\n      sum = d[i];\n      d[i] = d[i + 1];\n      d[i + 1] = sum;\n      s = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = s;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a[n], d[n], a[n - 1], d[n - 1], a[n - 2],\n         d[n - 2]);\n  return 0;\n}\n"}
{"label": "14", "index": "25363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  long int num[100000];\n  int y[100000];\n  int m[100000];\n};\n\nint main() {\n  int n, i, temp = 0, sum[100000];\n  struct stu p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &p.num[i], &p.y[i], &p.m[i]);\n    sum[i] = p.m[i] + p.y[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 1], sum[n - 1]);\n  for (i = 0; i < n - 2; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 2], sum[n - 2]);\n  for (i = 0; i < n - 3; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 3], sum[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  cin >> n;\n  struct stu {\n    int xuehao[100000];\n    int yuwen[100000];\n    int shuxue[100000];\n    int zongfen[100000];\n  } a;\n  for (i = 0; i < n; i++) {\n    cin >> a.xuehao[i];\n    cin >> a.yuwen[i];\n    cin >> a.shuxue[i];\n    a.zongfen[i] = a.shuxue[i] + a.yuwen[i];\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = i; j >= 1; j--)\n      if (a.zongfen[j] > a.zongfen[j - 1]) {\n        temp = a.zongfen[j - 1];\n        a.zongfen[j - 1] = a.zongfen[j];\n        a.zongfen[j] = temp;\n        temp = a.xuehao[j - 1];\n        a.xuehao[j - 1] = a.xuehao[j];\n        a.xuehao[j] = temp;\n      }\n  for (i = 0; i <= 2; i++)\n    cout << a.xuehao[i] << \" \" << a.zongfen[i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int ch;\n  int math;\n  int total;\n  struct student *next;\n};\nint n;\nint t;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  p1->total = p1->ch + p1->math;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    p1->total = p1->ch + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int max;\n  p = head;\n  max = p->total;\n  p = p->next;\n  while (p->next != NULL) {\n    if (p->total > max) {\n      max = p->total;\n      t = p->num;\n    }\n    p = p->next;\n  }\n  cout << t << \" \" << max << \" \";\n}\n\nstruct student *del(struct student *head, int a) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (a != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head) {\n    head = p1->next;\n  } else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head1, *head2, *head3;\n  head1 = creat();\n  print(head1);\n  head2 = del(head1, t);\n  print(head2);\n  head3 = del(head2, t);\n  print(head3);\n}\n"}
{"label": "14", "index": "25366", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, j, k, z, x;\n  cin >> n;\n  struct Student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 0; j < 3; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (stu[k].zongfen > stu[k + 1].zongfen) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else if (stu[k].zongfen == stu[k + 1].zongfen &&\n                 stu[k].num < stu[k + 1].num) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else\n        ;\n    }\n  }\n\n  for (j = 0; j < 3; j++) {\n    printf(\"%d %d\\n\", stu[n - 1 - j].num, stu[n - 1 - j].zongfen);\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25367", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student { \n    int number;\n    int chinese;\n    int math;\n    int all;\n  } stu[100000];\n  int n, i, j, n1 = 1, n2 = 1, n3 = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) { \n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  \n  for (i = 2; i <= n; i++) {\n    if (stu[n1].all < stu[i].all)\n      n1 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n1)\n      continue;\n    if (stu[n2].all < stu[i].all)\n      n2 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n2 || i == n1)\n      continue;\n    if (stu[n3].all < stu[i].all)\n      n3 = i;\n  }\n  cout << stu[n1].number << \" \" << stu[n1].all << endl; \n  cout << stu[n2].number << \" \" << stu[n2].all << endl;\n  cout << stu[n3].number << \" \" << stu[n3].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int china;\n  int math;\n};\nint main() {\n  int n;\n  cin >> n;\n  struct student st[n];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> st[i].No >> st[i].china >> st[i].math;\n\n  int s;\n  int a1 = 0, a2 = 0, a3 = 0, b1 = 0, b2 = 0, b3 = 0;\n  for (i = 0; i < n; i++) {\n    s = st[i].china + st[i].math;\n    if (s > a1) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = a1;\n      b2 = b1;\n      a1 = s;\n      b1 = i;\n      continue;\n    }\n\n    if (s > a2) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = s;\n      b2 = i;\n      continue;\n    }\n    if (s > a3) {\n      a3 = s;\n      b3 = i;\n      continue;\n    }\n  }\n  cout << st[b1].No << \" \" << a1 << endl;\n  cout << st[b2].No << \" \" << a2 << endl;\n  printf(\"%d %d\\n\", st[b3].No, a3);\n  return 0;\n}\n"}
{"label": "14", "index": "25369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int score1;\n  int score2;\n};\nstruct student stu[100000];\nint main() {\n  int n, i, first = 0, second = 0, third = 0, a[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[first] < a[i]) {\n      third = second;\n      second = first;\n      first = i;\n    } else if (a[second] < a[i]) {\n      third = second;\n      second = i;\n    } else {\n      if (a[third] < a[i]) {\n        third = i;\n      }\n    }\n  }\n  cout << stu[first].number << \" \" << a[first] << \"\\n\"\n       << stu[second].number << \" \" << a[second] << \"\\n\"\n       << stu[third].number << \" \" << a[third] << \"\\n\";\n  return (0);\n}\n"}
{"label": "14", "index": "25370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nlong int n;\nstruct stu {\n  long int num, chi, mat, tot;\n};\nint comp(const void *a, const void *b) {\n  return ((struct stu *)b)->tot - ((struct stu *)a)->tot;\n}\nstruct stu a[100000], b;\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chi, &a[i].mat);\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  qsort(a, n, sizeof(struct stu), comp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].tot);\n  return 0;\n}\n"}
{"label": "14", "index": "25371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  long int num;\n  int chi;\n  int mat;\n  int tot;\n};\nint main() {\n  struct stu a[100050];\n  int n, k, i, j, temp2, max;\n  long int temp1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld%d%d\", &a[i].num, &a[i].chi, &a[i].mat);\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  for (j = 1; j <= 3; j++) {\n    max = 0;\n    a[0].tot = 0;\n    for (i = 1; i <= n; i++)\n      if (a[max].tot < a[i].tot)\n        max = i;\n    printf(\"%ld %d\\n\", a[max].num, a[max].tot);\n    a[max].tot = 0;\n  }\n  scanf(\"\\n\");\n  return (0);\n}\n"}
{"label": "14", "index": "25372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int chi;\n  int math;\n  int s;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n  struct stu *head;\n  struct stu *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int i, n, t, m;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1->s = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < 3; i++) {\n    while (p2 != NULL) {\n      if (p2->s > p1->s) {\n        t = p2->s;\n        p2->s = p1->s;\n        p1->s = t;\n        m = p2->num;\n        p2->num = p1->num;\n        p1->num = m;\n      }\n      p2 = p2->next;\n    }\n    cout << p1->num << \" \" << p1->s << \" \";\n    if (i == 2)\n      break;\n    p1 = p1->next;\n    p2 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int ch;\n    int ma;\n    int to;\n  };\n  int i, j1, j2, j3, k, max;\n  struct stu student[100000] = {0};\n\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d%d%d\", &student[i].num, &student[i].ch, &student[i].ma);\n    student[i].to = student[i].ch + student[i].ma;\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (student[i].to > max) {\n      max = student[i].to;\n      j1 = i;\n    }\n  }\n  cout << student[j1].num << \" \";\n  printf(\"%d\\n\", student[j1].to);\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j2 = i;\n    }\n  }\n  printf(\"%d \", student[j2].num);\n  printf(\"%d\\n\", student[j2].to);\n  max = 0;\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1 || i == j2)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j3 = i;\n    }\n  }\n  printf(\"%d \", student[j3].num);\n  printf(\"%d\\n\", student[j3].to);\n  return 0;\n}\n"}
{"label": "14", "index": "25374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct r {\n    int a;\n    int b;\n    int c;\n  } r[99999];\n  int i, n, x = 0, y = 0, z = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> r[i].a >> r[i].b >> r[i].c;\n\n  for (i = 1; i <= n; i++) {\n    if (r[i].b + r[i].c > m1) {\n      m1 = r[i].b + r[i].c;\n      x = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m1) && (i != x)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    } else if ((m1 > r[i].b + r[i].c) && (r[i].b + r[i].c > m2)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m2) && (i != y) && (i != x)) {\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n\n    else if ((m2 > r[i].b + r[i].c) && (r[i].b + r[i].c > m3)) {\n\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", x, m1);\n  cout << y << \" \" << m2 << \"\\n\";\n  printf(\"%d %d\\n\", z, m3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int b;\n    int c;\n    int d;\n    int h;\n  } s[100000];\n  int i, j, k, n, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &s[i].b, &s[i].c);\n    s[i].d = s[i].b + s[i].c;\n    s[i].h = -1;\n  }\n  for (i = 1; i <= 3; i++) {\n    max = 0;\n    k = 0;\n    for (j = 1; j <= n; j++) {\n      if ((s[j].d > max) && (s[j].h == -1)) {\n        max = s[j].d;\n        k = j;\n      }\n    }\n    s[k].h = 1;\n    cout << s[k].a << \" \" << s[k].d << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25376", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k;\n  cin >> N;\n  struct Student_Num \n  {\n    int num;     \n    int Chinese; \n    int Math;    \n  };\n  struct Student_Num student[N]; \n  struct Student_Num temp;\n  for (i = 0; i < N; i++) {\n    cin >> student[i].num >> student[i].Chinese >> student[i].Math; \n  }\n  int total[N], totalNum[3], p[3]; \n  for (i = 0; i < N; i++) {\n    total[i] = student[i].Chinese + student[i].Math; \n  }\n  for (i = 0; i < 3; i++) \n  {\n    totalNum[i] = 0;\n  }\n  for (i = 0; i < 3; i++) \n  {\n    for (j = 0; j < N; j++) {\n      if (totalNum[i] < total[j]) {\n        totalNum[i] = total[j];\n        p[i] = j;\n      }\n    }\n    total[p[i]] = 0; \n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[p[i]].num << ' ' << totalNum[i] << endl; \n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25377", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct score *next;\n};\nint n;\n\nstruct score *creat() {\n  struct score *p1, *p2, *head;\n  head = p2 = (struct score *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->num, &p2->yuwen, &p2->shuxue);\n  p2->total = p2->shuxue + p2->yuwen;\n  n--;\n  while (n--) {\n    p1 = (struct score *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->total = p1->shuxue + p1->yuwen;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid search(struct score *head) {\n  struct score *p;\n  int i, max;\n  for (i = 0; i < 3; i++) {\n    max = 0;\n    p = head;\n    while (p != NULL) {\n      if (p->total > max)\n        max = p->total;\n      p = p->next;\n    }\n    p = head;\n    while (p != NULL) {\n      if (p->total == max) {\n        printf(\"%d %d \", p->num, p->total);\n        p->total = 0;\n        break;\n      }\n      p = p->next;\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  struct score *head;\n  head = creat();\n  search(head);\n}\n"}
{"label": "14", "index": "25378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  scanf(\"%d\\n\", &n);\n  int j, b[100000] = {0}, t, s;\n  struct student {\n    int num;\n    int lang;\n    int math;\n  };\n  struct student a[100000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\\n\", &a[i].num, &a[i].lang, &a[i].math);\n  for (i = 0; i < n; i++)\n    b[i] = a[i].lang + a[i].math;\n  for (j = 0; j < 3; j++)\n    for (i = 1; i < n - j; i++)\n      if (b[j] < b[j + i]) {\n        t = b[j];\n        b[j] = b[j + i];\n        b[j + i] = t;\n      }\n  for (j = 0; j < 3; j++)\n    for (i = 0; i < n; i++) {\n      m = a[i].lang + a[i].math;\n      if (m == b[j] && i != s) {\n        printf(\"%d %d\\n\", a[i].num, m);\n        s = i;\n        break;\n      }\n    }\n}\n"}
{"label": "14", "index": "25379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int id;\n  int ch;\n  int mt;\n  int total;\n};\nstruct stu stu_1[100000];\nstruct stu top1 = {0, 0, 0, 0}, top2 = {0, 0, 0, 0}, top3 = {0, 0, 0, 0};\n\nint main() {\n  int n, i;\n  struct stu tem;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(stu_1[i].id), &(stu_1[i].ch), &(stu_1[i].mt));\n    stu_1[i].total = stu_1[i].ch + stu_1[i].mt;\n    if (stu_1[i].total > top1.total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = stu_1[i];\n    } else if (stu_1[i].total > top2.total) {\n      top3 = top2;\n      top2 = stu_1[i];\n    } else if (stu_1[i].total > top3.total) {\n      top3 = stu_1[i];\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", top1.id, top1.total);\n  if ((top2.id) != 0)\n    printf(\"%d %d\\n\", top2.id, top2.total);\n  if ((top3.id) != 0)\n    printf(\"%d %d\\n\", top3.id, top3.total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student max[3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[1].total) {\n      max[1] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[2].total && stu[i].total <= max[1].total &&\n        stu[i].id != max[1].id) {\n      max[2] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[3].total && stu[i].total <= max[2].total &&\n        stu[i].id != max[2].id && stu[i].id != max[1].id) {\n      max[3] = stu[i];\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", max[i].id, max[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    long num;\n    int chinese;\n    int math;\n  };\n  struct student stu[100001];\n  int i, t, h, l = 0;\n  long n;\n  int a[100001];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  for (i = 0; i < n; i++)\n    a[i] = stu[i].chinese + stu[i].math;\nleap:\n  t = a[0];\n  h = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] > t) {\n      t = a[i];\n      h = i;\n    }\n  }\n  printf(\"%ld %d\\n\", stu[h].num, a[h]);\n  l++;\n  a[h] = 0;\n  if (l < 3)\n    goto leap;\n}\n"}
{"label": "14", "index": "25382", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, c, m;\n  cin >> n;\n  struct student {\n    int id;\n    int total;\n  };\n  struct student stu[n + 1];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> c >> m;\n    stu[i].total = c + m;\n  }\n  for (i = n - 1; i > n - 4; i--)\n    for (j = n - 1; j > n - i - 1; j--) {\n      if (stu[j].total > stu[j - 1].total) {\n        stu[n] = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = stu[n];\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    if (i < n) {\n      printf(\"%d %d\\n\", stu[i].id, stu[i].total);\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num, yu, shu, sum;\n};\nint main() {\n  int n, i;\n  struct stu a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[0].num, &a[0].yu, &a[0].shu);\n    a[0].sum = a[0].yu + a[0].shu;\n    if (a[0].sum > a[1].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[1].sum;\n      a[2].num = a[1].num;\n      a[1].sum = a[0].sum;\n      a[1].num = a[0].num;\n    } else if (a[0].sum > a[2].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[0].sum;\n      a[2].num = a[0].num;\n    } else if (a[0].sum > a[3].sum) {\n      a[3].sum = a[0].sum;\n      a[3].num = a[0].num;\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "25384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a[100000][3], c[100000][3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n  for (i = n - 2; i >= 0; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 1; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 2; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (k = 0; k < 3; k++)\n    printf(\"%d %d\\n\", a[k][1], a[k][2] + a[k][3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25385", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  long int ID;\n  int math;\n  int chinese;\n  int add;\n} stu[100000];\nint main() {\n  long int n;\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n    stu[i].add = stu[i].math + stu[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].add < stu[j].add) {\n        int t = stu[i].add;\n        stu[i].add = stu[j].add;\n        stu[j].add = t;\n        long int m = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = m;\n      }\n    }\n    printf(\"%d %d \", stu[i].ID, stu[i].add);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25386", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(long n) {\n  struct student *head, *p1, *p2;\n  p1 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->scorec >> p1->scorem;\n  long s = n - 1;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  do {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->scorec >> p1->scorem;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    s = s - 1;\n  } while (s);\n  return (head);\n}\nint main() {\n  struct student *head, *p, *q, stu1, stu2, stu3;\n  long n, k1 = -1, k2 = -1, k3 = -1, i, j;\n  int l;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  for (p = head, i = 0; p != NULL; p = p->next, i++) {\n    l = 0;\n    for (q = head, j = 0; q != NULL; q = q->next, j++)\n      if ((q->scorec + q->scorem) > (p->scorec + p->scorem) ||\n          (((q->scorec + q->scorem) == (p->scorec + p->scorem)) && j < i)) {\n        l = l + 1;\n        if (l > 3)\n          break;\n      }\n    if (l == 0) {\n      k1 = i;\n      stu1.num = p->num;\n      stu1.scorec = p->scorec;\n      stu1.scorem = p->scorem;\n    }\n    if (l == 1) {\n      k2 = i;\n      stu2.num = p->num;\n      stu2.scorec = p->scorec;\n      stu2.scorem = p->scorem;\n    }\n    if (l == 2) {\n      k3 = i;\n      stu3.num = p->num;\n      stu3.scorec = p->scorec;\n      stu3.scorem = p->scorem;\n    }\n    if (k1 != -1 && k2 != -1 && k3 != -1)\n      break;\n  }\n  printf(\"%ld %d \", stu1.num, stu1.scorec + stu1.scorem);\n  printf(\"%ld %d \", stu2.num, stu2.scorec + stu2.scorem);\n  printf(\"%ld %d\", stu3.num, stu3.scorec + stu3.scorem);\n}\n"}
{"label": "14", "index": "25387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c; \n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j, temp, temp2, sum = 0;\n  int max1, max2, max3, id1, id2, id3;\n  scanf(\"%d\", &n);\n  struct student *s = (struct student *)malloc(n * sizeof(struct student));\n  int *end = (int *)malloc(n * sizeof(int)); \n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].a, &s[i].b, &s[i].c);\n    end[i] = s[i].b + s[i].c;\n  }\n  max1 = -100;\n  max2 = -100;\n  max3 = -100;\n  id1 = s[0].a;\n  id2 = s[0].a;\n  id3 = s[0].a;\n  for (i = 0; i < n; i++)\n    if (end[i] > max1) {\n      max1 = end[i];\n      id1 = s[i].a;\n    } \n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] > max2) {\n      max2 = end[i];\n      id2 = s[i].a;\n    } \n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] != max2 && end[i] > max3) {\n      max3 = end[i];\n      id3 = s[i].a;\n    } \n\n  for (i = 0; i < n; i++) {\n    if (end[i] == max1) {\n      printf(\"%d %d\\n\", s[i].a, max1);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max2) {\n      printf(\"%d %d\\n\", s[i].a, max2);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max3) {\n      printf(\"%d %d\\n\", s[i].a, max3);\n    }\n  } \n\n  free(s);\n  free(end);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j, temp, temp2, sum = 0;\n  int max1, max2, max3, id1, id2, id3;\n  cin >> n;\n  struct student *s = (struct student *)malloc(n * sizeof(struct student));\n  int *end = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    end[i] = s[i].b + s[i].c;\n  }\n  max1 = -100;\n  max2 = -100;\n  max3 = -100;\n  id1 = s[0].a;\n  id2 = s[0].a;\n  id3 = s[0].a;\n  for (i = 0; i < n; i++)\n    if (end[i] > max1) {\n      max1 = end[i];\n      id1 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] > max2) {\n      max2 = end[i];\n      id2 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] != max2 && end[i] > max3) {\n      max3 = end[i];\n      id3 = s[i].a;\n    }\n\n  for (i = 0; i < n; i++) {\n    if (end[i] == max1) {\n      printf(\"%d %d\\n\", s[i].a, max1);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max2) {\n      printf(\"%d %d\\n\", s[i].a, max2);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max3) {\n      printf(\"%d %d\\n\", s[i].a, max3);\n    }\n  }\n\n  free(s);\n  free(end);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  struct student {\n    int num;\n    int score1;\n    int score2;\n    int t;\n  } stu[100000], m1, m2, m3;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    stu[i].t = stu[i].score1 + stu[i].score2;\n  }\n  m1 = stu[0];\n  m2 = stu[0];\n  m3 = stu[0];\n  for (i = 0; i < n; i++) {\n    if (stu[i].t > m1.t) {\n      m3 = m2;\n      m2 = m1;\n      m1 = stu[i];\n    } else if (stu[i].t > m2.t && stu[i].t <= m1.t) {\n      m3 = m2;\n      m2 = stu[i];\n    } else if (stu[i].t > m3.t && stu[i].t <= m2.t) {\n      m3 = stu[i];\n    }\n  }\n  cout << m1.num << \" \" << m1.t << \"\\n\"\n       << m2.num << \" \" << m2.t << \"\\n\"\n       << m3.num << \" \" << m3.t;\n}\n"}
{"label": "14", "index": "25390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nlong n;\n\nint main() {\n  struct student *creat();\n  struct student *head, *p, *q1, *q2, *q3;\n  int a;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a) {\n      a = p->sum;\n      q1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1) {\n      a = p->sum;\n      q2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1 && p != q2) {\n      a = p->sum;\n      q3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", q1->num, q1->sum);\n  printf(\"%d %d \", q2->num, q2->sum);\n  printf(\"%d %d \", q3->num, q3->sum);\n  return 0;\n}\n\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  int i;\n  head = NULL;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%ld%d%d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n"}
{"label": "14", "index": "25391", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n} stu[1000000];\n\nint main() {\n  int STUDENT_NUM, i, j, temp1, temp2;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < STUDENT_NUM; j++) {\n      if (stu[i].total < stu[j].total) {\n        temp1 = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = temp1;\n        temp2 = stu[i].total;\n        stu[i].total = stu[j].total;\n        stu[j].total = temp2;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[0].ID, stu[0].total, stu[1].ID,\n         stu[1].total, stu[2].ID, stu[2].total);\n}\n"}
{"label": "14", "index": "25392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int score;\n  struct student *next;\n};\nint main() {\n  int n, i, max;\n  struct student *p1, *p2, *head;\n  p1 = p2 = head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n\n    cin >> p1->num >> p1->yu >> p1->shu;\n\n    p1->score = p1->yu + p1->shu;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p2 = p1 = head;\n    max = p1->score;\n    while (p1 != NULL) {\n      if (p1->score > max) {\n        max = p1->score;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << max << \"\\n\";\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int add;\n};\nstruct student stu[100000];\nint main() {\n  int m, k, n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].add = stu[i].chi + stu[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n - 1; i > 0; i--) {\n      if (stu[i].add > stu[i - 1].add) {\n        k = stu[i].add;\n        stu[i].add = stu[i - 1].add;\n        stu[i - 1].add = k;\n        m = stu[i].num;\n        stu[i].num = stu[i - 1].num;\n        stu[i - 1].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d\\n\", stu[i].num, stu[i].add);\n}\n"}
{"label": "14", "index": "25394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n};\nint main() {\n  int n, i, j;\n  struct student stu[4], temp;\n  cin >> n;\n  for (i = 0; i < 3; i++)\n    stu[i].total = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].yuwen, &stu[3].math);\n    stu[3].total = stu[3].yuwen + stu[3].math;\n    temp = stu[3];\n    for (j = 2; j >= 0; j--)\n      if (temp.total > stu[j].total) {\n        stu[j + 1] = stu[j];\n        stu[j] = temp;\n      } else {\n        stu[j + 1] = temp;\n        break;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int num;\n  int x;\n  int y;\n  int z;\n} s[100000], s1, s2, s3, A;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].num, &s[i].x, &s[i].y);\n    s[i].z = s[i].x + s[i].y;\n  }\n  if (s[0].z >= s[1].z) {\n    s1 = s[0];\n    s2 = s[1];\n  } else {\n    s1 = s[1];\n    s2 = s[0];\n  }\n  if (s[2].z >= s1.z) {\n    A = s1;\n    s1 = s[2];\n    s3 = s2;\n    s2 = A;\n  } else if (s[2].z < s2.z) {\n    s3 = s[2];\n  } else if (s[2].z >= s2.z && s[2].z < s1.z) {\n    s3 = s2;\n    s2 = s[2];\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].z > s1.z) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s[i];\n    } else if (s[i].z < s3.z) {\n      ;\n    } else if (s[i].z < s1.z && s[i].z > s3.z) {\n      if (s[i].z > s2.z) {\n        s3 = s2;\n        s2 = s[i];\n      } else {\n        s3 = s[i];\n      }\n    } else if (s[i].z == s1.z) {\n      s3 = s2;\n      s2 = s[i];\n    } else if (s[i].z == s2.z) {\n      s3 = s[i];\n    }\n  }\n  cout << s1.num << \" \" << s1.z << \"\\n\";\n  printf(\"%d %d\\n\", s2.num, s2.z);\n  printf(\"%d %d\\n\", s3.num, s3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "25396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int chi;\n    int ma;\n    int sum;\n    int i;\n  };\n  struct stu m[100000], temp;\n  int j, n;\n  scanf(\"%d\", &n);\n  struct stu *p = m;\n  struct stu *q;\n  for (; p < m + n; p += 1) {\n    scanf(\"%d%d%d\", &(*p).i, &(*p).chi, &(*p).ma);\n    (*p).sum = (*p).chi + (*p).ma;\n  }\n  for (p = m; p < m + n - 1; p++) {\n    for (q = p + 1; q < m + n; q++) {\n      if ((*p).sum < (*q).sum) {\n        temp = *p;\n        *p = *q;\n        *q = temp;\n      }\n    }\n    if (p == m + 2)\n      break;\n  } \n  for (p = m; p < m + 3; p++) {\n    printf(\"%d %d\\n\", (*p).i, (*p).sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, a, b;\n  struct student *next;\n};\nint n;\nstruct student *create(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  i = 1;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n  head = NULL;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *h, *x;\n  scanf(\"%d\", &n);\n  head = create();\n  h = x = head;\n  int(*p)[2], m, j, s, i;\n  p = (int(*)[2])calloc(100000, 2 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    p[i][1] = h->a + h->b;\n    p[i][0] = h->num;\n    h = x->next;\n    x = h;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (p[j][1] >= p[j + 1][1]) {\n        m = p[j][1];\n        p[j][1] = p[j + 1][1];\n        p[j + 1][1] = m;\n        s = p[j][0];\n        p[j][0] = p[j + 1][0];\n        p[j + 1][0] = s;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << p[i][0] << \" \" << p[i][1] << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, max_1 = 0, d, t = 0;\nstruct stu {\n  int id;\n  int chi;\n  int ma;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(void) {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  p2 = p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    cin >> p1->id >> p1->chi >> p1->ma;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid find(struct stu *head) {\n  while (t < 3) {\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->chi + p1->ma > max_1) {\n        max_1 = p1->chi + p1->ma;\n        d = p1->id;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", d, max_1);\n    t = t + 1;\n    max_1 = 0;\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->id == d) {\n        p1->chi = 0;\n        p1->ma = 0;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n\nint main() {\n  struct stu *head;\n  head = creat();\n  find(head);\n}\n"}
{"label": "14", "index": "25399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i;\n  long n;\n  int sum[100000];\n  int max = 0, second = 0, third = 0;\n  int a = 0, b = 0, c = 0;\n  scanf(\"%d\", &n);\n  struct student {\n    int id;\n    int chi;\n    int math;\n  };\n  struct student wangchong[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &wangchong[i].id, &wangchong[i].chi, &wangchong[i].math);\n    sum[i] = wangchong[i].chi + wangchong[i].math;\n    if (sum[i] > third) {\n      if (sum[i] <= second) {\n        third = sum[i];\n        c = i + 1;\n      } else {\n        if (sum[i] <= max) {\n          third = second;\n          second = sum[i];\n          c = b;\n          b = i + 1;\n        } else {\n          third = second;\n          c = b;\n          second = max;\n          b = a;\n          max = sum[i];\n          a = i + 1;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a, max, b, second, c, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100001][5];\n  int i, n, k = 3, max = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n    a[i][4] = a[i][2] + a[i][3];\n  }\n  while (k--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i][4] > max) {\n        max = a[i][4], t = i;\n      }\n    }\n    cout << t << \" \" << a[t][4] << \"\\n\";\n    a[t][4] = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25401", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  float chi;\n  float mat;\n  float tot;\n  struct student *next;\n};\n\nstruct student *creat(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->tot >= p1->tot) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nstruct student *compare(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  int i;\n  p1 = head;\n  p0 = stud;\n  while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if ((p0->tot > p1->tot) || ((p0->tot = p1->tot) && (p1->next != NULL))) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n    p1 = head;\n    for (i = 0; i < 2; i++) {\n      p1 = p1->next;\n    }\n    p1->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int i;\n  p = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%s %g \", p->num, p->tot);\n    p = p->next;\n  }\n}\n\nint main() {\n  struct student *head;\n  struct student *stu;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = creat(head, stu);\n  }\n  for (i = 3; i < n; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = compare(head, stu);\n  }\n  print(head);\n}\n"}
{"label": "14", "index": "25402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, p, q, t;\n  int a[100000][3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 3; j++)\n      scanf(\"%d\", &a[i][j]);\n    a[i][1] = a[i][1] + a[i][2];\n  }\n  for (p = 0; p < 3; p++) {\n    for (q = n - 2; q >= 0; q--) {\n      if (a[q][1] < a[q + 1][1]) {\n        for (i = 0; i < 2; i++) {\n          t = a[q][i];\n          a[q][i] = a[q + 1][i];\n          a[q + 1][i] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i][0], a[i][1]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum[99999];\nint m[99999];\nint main(int argc, char *argv[]) {\n  int n, i, b, c, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a >> b >> c;\n    sum[i] = b + c;\n    m[i] = a;\n  }\n  int j, k, t, x, l = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (sum[k] > sum[k - 1]) {\n        t = sum[k - 1];\n        sum[k - 1] = sum[k];\n        sum[k] = t;\n        x = m[k - 1];\n        m[k - 1] = m[k];\n        m[k] = x;\n      }\n    }\n    l++;\n    if (l == 3)\n      break;\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%d %d\\n\", m[i], sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25404", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int NO;\n  int chinese;\n  int math;\n};\n\nint main() {\n  struct student a[100001];\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i].NO >> a[i].chinese >> a[i].math;\n  for (i = 1; i <= 3; i++)\n    for (j = n - 1; j >= i; j--)\n      if (a[j].chinese + a[j].math < a[j + 1].chinese + a[j + 1].math) {\n        a[0] = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = a[0];\n      }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", a[i].NO, a[i].chinese + a[i].math);\n}\n"}
{"label": "14", "index": "25405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  struct student *next;\n};\nint main() {\n  struct student *head, *p1, *p2;\n  int i, max, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yw, &p1->sx);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = p1->yw + p1->sx;\n    while (p1 != NULL) {\n      if ((p1->yw + p1->sx) > max) {\n        max = p1->yw + p1->sx;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << max << \" \";\n    p1 = head;\n    while (p1->next != p2)\n      p1 = p1->next;\n\n    p1->next = p2->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef struct {\n  int d;\n  int score;\n} student;\n\nint main() {\n  int n, i, temp1, temp2;\n  student a[100002];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].d, &temp1, &temp2);\n    a[i].score = temp1 + temp2;\n  }\n\n  student max1, max2, max3;\n  max1.d = max2.d = max3.d = -1;\n  max1.score = max2.score = max3.score = 0;\n\n  for (i = 0; i < n; i++) {\n    if (a[i].score > max1.score) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a[i];\n    } else if (a[i].score > max2.score) {\n      max3 = max2;\n      max2 = a[i];\n    } else if (a[i].score > max3.score)\n      max3 = a[i];\n  }\n\n  printf(\"%d %d\\n\", max1.d, max1.score);\n  if (max2.d != -1)\n    printf(\"%d %d\\n\", max2.d, max2.score);\n  if (max3.d != -1)\n    printf(\"%d %d\\n\", max3.d, max3.score);\n  return 0;\n}\n"}
{"label": "14", "index": "25407", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct test {\n    int ID, chinese, maths, sum;\n  } ss[100000];\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ss[i].ID, &ss[i].chinese, &ss[i].maths);\n    ss[i].sum = ss[i].chinese + ss[i].maths;\n  }\n  struct score {\n    int ID, sum;\n  } s[5];\n  s[1].sum = 0;\n  s[2].sum = 0;\n  s[3].sum = 0;\n  for (i = 0; i <= n; i++) {\n    if (ss[i].sum > s[1].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = s[1].ID;\n      s[2].sum = s[1].sum;\n      s[1].ID = ss[i].ID;\n      s[1].sum = ss[i].sum;\n    } else if (ss[i].sum > s[2].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = ss[i].ID;\n      s[2].sum = ss[i].sum;\n    } else if (ss[i].sum > s[3].sum) {\n      s[3].ID = ss[i].ID;\n      s[3].sum = ss[i].sum;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\\n\", s[i].ID, s[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25408", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  int num, yuwen, shuxue, sum;\n};\n\nint main() {\n  int n, max1 = 0, max2 = 0, max3 = 0, stu1 = 0, stu2 = 0, stu3 = 0;\n  struct Student student[100000], *stu;\n  scanf(\"%d\", &n);\n\n  for (stu = student; stu < student + n; stu++) {\n    scanf(\"%d\", &stu->num);\n    scanf(\"%d\", &stu->yuwen);\n    scanf(\"%d\", &stu->shuxue);\n    (stu->sum) = (stu->yuwen) + (stu->shuxue);\n    if (stu->sum >= max3) {\n      if (stu->sum >= max2) {\n        if (stu->sum >= max1) {\n          if (stu->sum > max1) {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu1;\n            stu1 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = max1;\n            max1 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          }\n        } else {\n          if (stu->sum > max2) {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu2;\n            stu2 = stu->num;\n          } else {\n            max3 = max2;\n            max2 = stu->sum;\n            stu3 = stu->num;\n          }\n        }\n      } else {\n        if (stu->sum > max3) {\n          max3 = stu->sum;\n          stu3 = stu->num;\n        } else\n          max3 = stu->sum;\n      }\n    }\n  }\n  stu = student;\n  printf(\"%d %d\\n\", (stu + stu1 - 1)->num, (stu + stu1 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu2 - 1)->num, (stu + stu2 - 1)->sum);\n  printf(\"%d %d\\n\", (stu + stu3 - 1)->num, (stu + stu3 - 1)->sum);\n}\n"}
{"label": "14", "index": "25409", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int mark1;\n  int mark2;\n  long int total_mark;\n};\n\nint main(void) {\n  int n, i, j, k, t = 0, max;\n  struct stu *p;\n  struct stu *q;\n  scanf(\"%d\", &n);\n  p = (struct stu *)malloc(1000000 * sizeof(struct stu));\n  q = p;\n  for (i = 0; i < n; i++) {\n    cin >> (p + i)->num >> (p + i)->mark1 >> (p + i)->mark2;\n    (p + i)->total_mark = (p + i)->mark1 + (p + i)->mark2;\n  }\nloop:\n  max = 0;\n  for (j = 0; j < n; j++) {\n    if ((p + j)->total_mark > max)\n      max = (p + j)->total_mark;\n  }\n  for (k = 0; k < n; k++)\n    if (max == (p + k)->total_mark && k < n) {\n      printf(\"%d %ld\\n\", (p + k)->num, (p + k)->total_mark);\n      t++;\n      (p + k)->total_mark = 0;\n      break;\n    }\n  if (t < 3)\n    goto loop;\n}\n"}
{"label": "14", "index": "25410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, s, p;\n  struct student {\n    int id;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student stu[100000];\n  struct student temp;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    scanf(\"%d %d %d\", &stu[p].id, &stu[p].yuwen, &stu[p].shuxue);\n    stu[p].zongfen = stu[p].yuwen + stu[p].shuxue;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (stu[i].zongfen >= stu[i + 1].zongfen) {\n        temp.id = stu[i].id;\n        temp.yuwen = stu[i].yuwen;\n        temp.shuxue = stu[i].shuxue;\n        temp.zongfen = stu[i].zongfen;\n        stu[i].id = stu[i + 1].id;\n        stu[i].yuwen = stu[i + 1].yuwen;\n        stu[i].shuxue = stu[i + 1].shuxue;\n        stu[i].zongfen = stu[i + 1].zongfen;\n        stu[i + 1].id = temp.id;\n        stu[i + 1].yuwen = temp.yuwen;\n        stu[i + 1].shuxue = temp.shuxue;\n        stu[i + 1].zongfen = temp.zongfen;\n      }\n    }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    printf(\"%d %d \", stu[k].id, stu[k].zongfen);\n  }\n}\n"}
{"label": "14", "index": "25411", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct person {\n  char num[6];\n  int Chinese;\n  int math;\n  int total;\n} stu[100000];\n\nint main() {\n  int n, i, max, j, k, temp = 0, tnum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].Chinese;\n    cin >> stu[i].math;\n    stu[i].total = stu[i].math + stu[i].Chinese;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > max) {\n        max = stu[i].total;\n        k = i;\n      }\n    }\n    cout << stu[k].num << \" \" << stu[k].total << endl;\n    stu[k].total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int chi;\n    int ma;\n    int sum;\n    int i;\n  };\n  struct stu m[100000], temp;\n  int j, n;\n  scanf(\"%d\", &n);\n  struct stu *p = m;\n  struct stu *q;\n  for (; p < m + n; p += 1) {\n    scanf(\"%d%d%d\", &(*p).i, &(*p).chi, &(*p).ma);\n    (*p).sum = (*p).chi + (*p).ma;\n  }\n  for (p = m; p < m + n - 1; p++) {\n    for (q = p + 1; q < m + n; q++) {\n      if ((*p).sum < (*q).sum) {\n        temp = *p;\n        *p = *q;\n        *q = temp;\n      }\n    }\n    if (p == m + 2)\n      break;\n  }\n  for (p = m; p < m + 3; p++) {\n    cout << (*p).i << \" \" << (*p).sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int number, chinese, math, total;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].number, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  int a = stu[0].total, b = stu[0].total, c = stu[0].total;\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > a) {\n      c = b;\n      b = a;\n      a = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < a && stu[i].total > b) {\n      c = b;\n      b = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < b && stu[i].total > c) {\n      c = stu[i].total;\n      continue;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == a) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == b) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == c) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stud {\n  int n;\n  int chinese;\n  int math;\n  int total;\n  struct stud *next;\n};\nint tol;\nstruct stud *creat(void) {\n  struct stud *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct stud *)malloc(sizeof(struct stud));\n  head = p1;\n  for (i = 1; i < tol; i++) {\n    scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n    p1->total = (p1->math + p1->chinese);\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n  p1->total = (p1->math + p1->chinese);\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint max(struct stud *head, int max1, int max2) {\n  struct stud *p1;\n  int maxtotal = head->total, max_index;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->total > maxtotal && p1->n != max1 && p1->n != max2) {\n      maxtotal = (p1->total);\n      max_index = (p1->n);\n    }\n  }\n  if (maxtotal != max1)\n    printf(\"%d %d\\n\", max_index, maxtotal);\n  return max_index;\n}\nint main() {\n  struct stud *head;\n  int max1, max2;\n  cin >> tol;\n  head = creat();\n  max1 = max(head, 0, 0);\n  max2 = max(head, max1, 0);\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "25415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000];\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    tmp = t[i].sum;\n    t[i].sum = t[k].sum;\n    t[k].sum = tmp;\n\n    tmp = t[i].num;\n    t[i].num = t[k].num;\n    t[k].num = tmp;\n  }\n  for (i = 0; i < 3; i++) {\n    cout << t[i].num << \" \" << t[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25416", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct Student {\n    int ID;\n    int Chinese;\n    int Math;\n    int sum;\n  } student[100000];\n  int i, j, n;\n  struct Student t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &student[i].ID, &student[i].Chinese, &student[i].Math);\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].Chinese + student[i].Math <\n          student[j].Chinese + student[j].Math) {\n        t = student[i];\n        student[i] = student[j];\n        student[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].ID, student[i].Chinese + student[i].Math);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu *create();\nint compare(const void *a, const void *b);\nint main() {\n  int i, j = 0, n;\n  cin >> n;\n  struct stu {\n    int num;\n    int chi;\n    int math;\n    int total;\n  };\n  struct stu *p = (struct stu *)calloc(n, sizeof(struct stu));\n  struct stu *a = p;\n  int *tot = (int *)calloc(n, sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chi, &p->math);\n    *(tot + i) = p->total = p->chi + p->math;\n    p++;\n  }\n  qsort(tot, n, sizeof(int), compare);\n  for (i = 0; i < 3; i++, j = 0) {\n    while ((a + (j++))->total != *(tot + i))\n      ;\n    printf(\"%d %d\\n\", (a + j - 1)->num, (a + j - 1)->total);\n    (a + j - 1)->total = -1;\n  }\n\n  return 0;\n}\n\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\n"}
{"label": "14", "index": "25418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\n\nint main() {\n  int n, i, sum[100000], max = 0, j, k, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    sum[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j) {\n      max = sum[i];\n      k = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j && i != k) {\n      max = sum[i];\n      l = i;\n    }\n  cout << stu[j].num << \" \" << sum[j] << \"\\n\"\n       << stu[k].num << \" \" << sum[k] << \"\\n\"\n       << stu[l].num << \" \" << sum[l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].total = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].total > stu[k].total)\n        k = j;\n    if (k != i) {\n      t = stu[i].total;\n      stu[i].total = stu[k].total;\n      stu[k].total = t;\n      t = stu[i].num;\n      stu[i].num = stu[k].num;\n      stu[k].num = t;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int maths;\n};\nstruct qiansan {\n  int num;\n  int zongfen;\n} st[3] = {{0, 0}, {0, 0}, {0, 0}};\nint main() {\n  int n, i, k, c[10], j[10];\n  int a[100001];\n  scanf(\"%d\", &n);\n  struct Student std[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &std[i].num, &std[i].chinese, &std[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = std[i].chinese + std[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = a[i];\n      st[0].num = std[i].num;\n    } else if (a[i] <= st[0].zongfen && a[i] > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = a[i];\n      st[1].num = std[i].num;\n    } else if (a[i] <= st[1].zongfen && a[i] > st[2].zongfen) {\n      st[2].zongfen = a[i];\n      st[2].num = std[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N, i, n[1000], c[1000], m[1000], sum[1000];\n  int x1 = 0, x2 = 0, x3 = 0, y1 = 0, y2 = 0, y3 = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    cin >> n[i] >> c[i] >> m[i];\n    sum[i] = c[i] + m[i];\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x1) {\n      x1 = sum[i];\n      y1 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x2 && sum[i] <= x1 && i != y1) {\n      x2 = sum[i];\n      y2 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x3 && sum[i] <= x2 && i != y1 && i != y2) {\n      x3 = sum[i];\n      y3 = i;\n    }\n  }\n  cout << y1 + 1 << \" \" << x1 << \" \" << y2 + 1 << \" \" << x2 << \" \" << y3 + 1\n       << \" \" << x3 << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i;\n  long n;\n  int sum[100000];\n  int max = 0, second = 0, third = 0;\n  int a = 0, b = 0, c = 0;\n  cin >> n;\n  struct student {\n    int id;\n    int chi;\n    int math;\n  };\n  struct student wangchong[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &wangchong[i].id, &wangchong[i].chi, &wangchong[i].math);\n    sum[i] = wangchong[i].chi + wangchong[i].math;\n    if (sum[i] > third) {\n      if (sum[i] <= second) {\n        third = sum[i];\n        c = i + 1;\n      } else {\n        if (sum[i] <= max) {\n          third = second;\n          second = sum[i];\n          c = b;\n          b = i + 1;\n        } else {\n          third = second;\n          c = b;\n          second = max;\n          b = a;\n          max = sum[i];\n          a = i + 1;\n        }\n      }\n    }\n  }\n  cout << a << \" \" << max << \"\\n\"\n       << b << \" \" << second << \"\\n\"\n       << c << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, q, c, d;\n  int a[100000];\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n  for (i = 0; i < n; i++) {\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  int max1, max2, max3;\n  int num1, num2, num3;\n  if (a[0] >= a[1]) {\n    max1 = a[0];\n    num1 = 0;\n    if (a[0] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[0];\n      num2 = 0;\n      max3 = a[1];\n      num3 = 1;\n    } else {\n      if (a[1] >= a[2]) {\n        max2 = a[1];\n        num2 = 1;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[1];\n        num3 = 1;\n      }\n    }\n  } else {\n    max1 = a[1];\n    num1 = 1;\n    if (a[1] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[1];\n      num2 = 1;\n      max3 = a[0];\n      num3 = 0;\n    } else {\n      if (a[0] >= a[2]) {\n        max2 = a[0];\n        num2 = 0;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[0];\n        num3 = 0;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (a[i] > max1) {\n      p = max1;\n      q = max2;\n      c = num1;\n      d = num2;\n      max1 = a[i];\n      max2 = p;\n      max3 = q;\n      num1 = i;\n      num2 = c;\n      num3 = d;\n    } else {\n      if (a[i] > max2 && a[i] <= max1) {\n        p = max2;\n        c = num2;\n        max2 = a[i];\n        max3 = p;\n        num2 = i;\n        num3 = c;\n      } else {\n        if (a[i] > max3 && a[i] <= max2) {\n          max3 = a[i];\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << \" \" << a[num1] << \"\\n\"\n       << num2 + 1 << \" \" << a[num2] << \"\\n\"\n       << num3 + 1 << \" \" << a[num3] << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int i, num;\n  struct student stu[100000];\n  int max_0 = 0, max_1 = 0, max_2 = 0;\n  int max_0_id, max_1_id, max_2_id;\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %d %d\", &(stu[i].id), &(stu[i].chinese), &(stu[i].math));\n    stu[i].total = stu[i].chinese + stu[i].math;\n    if (stu[i].total > max_0) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = max_0;\n      max_1_id = max_0_id;\n      max_0 = stu[i].total;\n      max_0_id = stu[i].id;\n    } else if (stu[i].total > max_1) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = stu[i].total;\n      max_1_id = stu[i].id;\n    } else if (stu[i].total > max_2) {\n      max_2 = stu[i].total;\n      max_2_id = stu[i].id;\n    }\n  }\n\n  cout << max_0_id << \" \" << max_0 << \"\\n\";\n  printf(\"%d %d\\n\", max_1_id, max_1);\n  cout << max_2_id << \" \" << max_2 << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25425", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n, k;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2, *p3;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->math);\n    p1->total = p1->yuwen + p1->math;\n    p2 = head;\n    if (m == 1) {\n      head = p1;\n      p1->next = 0;\n    } else {\n      k = 0;\n      while (p1->total <= p2->total && p2->next != 0 && k <= 3) {\n        p3 = p2;\n        p2 = p2->next;\n        k++;\n      }\n      if (p1->total > p2->total && k <= 3) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = 0;\n      }\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int t1 = 0;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  while (t1 < 3) {\n    printf(\"%d %d\\n\", p->num, p->total);\n    p = p->next;\n    t1++;\n  }\n}\n"}
{"label": "14", "index": "25426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, i;\n  cin >> N;\n  int Max1 = 0, Max2 = 0, Max3 = 0, Nb[4];\n  struct student {\n    int Number;\n    int Chinese;\n    int Math;\n    int Total;\n  } people[111111];\n  for (i = 1; i <= N; i++) {\n    cin >> people[i].Number >> people[i].Chinese >> people[i].Math;\n    people[i].Total = people[i].Chinese + people[i].Math;\n  }\n  for (i = 1; i <= N; i++) {\n    if (Max1 < people[i].Total) {\n      Nb[1] = i;\n      Max1 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max2 < people[i].Total) && (i != Nb[1])) {\n      Nb[2] = i;\n      Max2 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max3 < people[i].Total) && (i != Nb[1]) && (i != Nb[2])) {\n      Nb[3] = i;\n      Max3 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << people[Nb[i]].Number << \" \" << people[Nb[i]].Total;\n    if (i < 3)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int Chi;\n  int Math;\n  int sum;\n};\nstruct Student stud[100000], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stud[i].num >> stud[i].Chi >> stud[i].Math;\n    stud[i].sum = stud[i].Chi + stud[i].Math;\n  }\n  if (n == 2) {\n    if (stud[0].sum < stud[1].sum) {\n      temp = stud[0];\n      stud[0] = stud[1];\n      stud[1] = temp;\n    }\n  } else {\n    for (i = 0; i < 3; i++) {\n      for (j = n - 1; j > i; j--) {\n        if (stud[j].sum > stud[j - 1].sum) {\n          temp = stud[j];\n          stud[j] = stud[j - 1];\n          stud[j - 1] = temp;\n        }\n      }\n    }\n  }\n\n  if (n == 2) {\n\n    cout << stud[0].num << ' ' << stud[0].sum << endl;\n\n    cout << stud[1].num << ' ' << stud[1].sum;\n  }\n  for (i = 0; i < 2; i++) {\n    cout << stud[i].num << \" \" << stud[i].sum << \"\\n\";\n  }\n  cout << stud[2].num << ' ' << stud[2].sum;\n  return 0;\n}\n"}
{"label": "14", "index": "25428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\nint main() {\n  int i, j, n, a[100000], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%d %d\\n\", stu[i].num, a[i]);\n        a[i] = 0;\n        break;\n      }\n  }\n}\n"}
{"label": "14", "index": "25429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[3], n, c, b, d, g[3], i, temp;\n  int j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    g[i] = d;\n    a[i] = b + c;\n  }\n  for (i = 0; i < 3 - 1; i++)\n    for (j = 0; j < 3 - 1 - i; j++)\n      if (a[j] < a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n        temp = g[j];\n        g[j] = g[j + 1];\n        g[j + 1] = temp;\n      }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    temp = b + c;\n\n    if (temp <= a[2])\n      continue;\n    else {\n      if (a[1] >= temp) {\n        a[2] = temp;\n        g[2] = d;\n      } else {\n        a[2] = a[1];\n        g[2] = g[1];\n        if (a[0] >= temp) {\n          a[1] = temp;\n          g[1] = d;\n        } else {\n          a[1] = a[0];\n          g[1] = g[0];\n          a[0] = temp;\n          g[0] = d;\n        }\n      }\n    }\n  }\n  cout << g[0] << \" \" << a[0] << \"\\n\"\n       << g[1] << \" \" << a[1] << \"\\n\"\n       << g[2] << \" \" << a[2] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int yu;\n  int shu;\n  struct student *next;\n};\nint main() {\n  int n, i, j = 0;\n\n  struct student *head, *p1, *p2;\n\n  cin >> n;\n  head = p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->yu, &p1->shu);\n    p1 = (struct student *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 200; i > 10; i--) {\n    p1 = head;\n    while (p1 != NULL) {\n      if ((p1->yu + p1->shu) == i) {\n        printf(\"%d %d \", p1->id, i);\n        j++;\n      }\n      p1 = p1->next;\n      if (j == 3)\n        break;\n    }\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25431", "code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef struct st {\n  int a, b;\n} stu;\nstu s[100000];\nint comp(const void *a, const void *b) { return ((stu *)b)->b - ((stu *)a)->b; }\nint main() {\n  int i, n, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &a, &b);\n    s[i].b = a + b;\n  }\n  qsort(s, n, sizeof(stu), comp);\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].a, s[0].b, s[1].a, s[1].b, s[2].a, s[2].b);\n  \n  return 0;\n}\n"}
{"label": "14", "index": "25432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  float yuwen;\n  float shuxue;\n  float total;\n} stu[100000];\nint main() {\n  int i, n, j;\n  struct student *p;\n  p = &stu[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> (p + i)->num >> (p + i)->yuwen >> (p + i)->shuxue;\n    (p + i)->total = (p + i)->shuxue + (p + i)->yuwen;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((*(p + j)).total >= (*(p + j + 1)).total) {\n        struct student temp;\n        temp = *(p + j + 1);\n        *(p + j + 1) = *(p + j);\n        *(p + j) = temp;\n      }\n    }\n  if (n > 2)\n    for (i = 1; i < 4; i++)\n      cout << (*(p + n - i)).num << \" \" << (*(p + n - i)).total << \"\\n\";\n  else if (n = 2)\n    cout << (*(p + 1)).num << \" \" << (*(p + 1)).total << \"\\n\"\n         << (*p).num << \" \" << (*p).total << \"\\n\";\n}\n"}
{"label": "14", "index": "25433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stud {\n  int n;\n  int m;\n  int c;\n  int t;\n} s[100000], temp;\nint main() {\n  int i, j, k, n, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].m, &s[i].c);\n    s[i].t = s[i].m + s[i].c;\n  }\n  for (j = 0; j < 3 && j < n; j++) {\n    for (k = j + 1, p = j; k < n; k++)\n      if (s[p].t < s[k].t) {\n        p = k;\n      }\n    temp = s[j];\n    s[j] = s[p];\n    s[p] = temp;\n    cout << s[j].n << \" \" << s[j].t << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int Chinese;\n  int Math;\n  int Score;\n};\nint main() {\n  int n, i, first = 0, ifirst, second = 0, isecond, third = 0, ithird;\n  scanf(\"%d\", &n);\n  struct student STUDENT_NUM[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &STUDENT_NUM[i].ID, &STUDENT_NUM[i].Chinese,\n          &STUDENT_NUM[i].Math);\n    STUDENT_NUM[i].Score = STUDENT_NUM[i].Chinese + STUDENT_NUM[i].Math;\n  }\n  for (i = 0; i < n; i++) {\n    if (first < STUDENT_NUM[i].Score) {\n      first = STUDENT_NUM[i].Score;\n      ifirst = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= first &&\n        i != ifirst) {\n      second = STUDENT_NUM[i].Score;\n      isecond = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (third < STUDENT_NUM[i].Score && STUDENT_NUM[i].Score <= second &&\n        i != ifirst && i != isecond) {\n      third = STUDENT_NUM[i].Score;\n      ithird = i;\n    }\n  }\n  printf(\"%d %d \", STUDENT_NUM[ifirst].ID, first);\n  printf(\"%d %d \", STUDENT_NUM[isecond].ID, second);\n  printf(\"%d %d \", STUDENT_NUM[ithird].ID, third);\n}\n"}
{"label": "14", "index": "25435", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Top {\n  int num;\n  float score;\n} Top[4] = {{0, 0}};\nstruct Top *p;\n\nvoid maopao(int n) {\n  int i;\n  for (i = 1; i < n; i++) {\n    for (p = Top; p < Top + n - i; p++) {\n      if ((p->score) < ((p + 1)->score)) {\n        Top[3] = *p;\n        *p = *(p + 1);\n        *(p + 1) = Top[3];\n      }\n    }\n  }\n}\n\nvoid sort(float a, int n) {\n  p = Top + 2;\n  if (a > (p->score)) {\n    p->score = a;\n    p->num = n;\n  }\n  maopao(3);\n}\n\nint main() {\n  int i, n, num;\n  float yw, sx, score;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %f %f\", &num, &yw, &sx);\n    float score = yw + sx;\n    sort(score, num);\n  }\n  for (p = Top; p < Top + 3; p++) {\n    printf(\"%d %g\\n\", p->num, p->score);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  struct student {\n    int number;\n    int maths;\n    int chinese;\n    int sum;\n  };\n  struct student stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].maths;\n    stu[i].sum = stu[i].chinese + stu[i].maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 2; j >= i; j--)\n      if (stu[j].sum < stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  if (n >= 3)\n    for (i = 0; i < 3; i++)\n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  else\n    for (i = 0; i < n; i++)\n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25437", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} work[100001];\nvoid qsort(int left, int right) {\n  if (left >= right)\n    return;\n  int pindex = left, rindex = right;\n  work[0] = work[left];\n  while (pindex < rindex) {\n    while ((pindex < rindex) && (work[rindex].sum >= work[0].sum))\n      rindex--;\n    if (pindex < rindex) {\n      work[pindex] = work[rindex];\n      pindex++;\n    }\n    while ((pindex < rindex) && (work[pindex].sum < work[0].sum))\n      pindex++;\n    if (pindex < rindex) {\n      work[rindex] = work[pindex];\n      rindex--;\n    }\n  }\n  work[pindex] = work[0];\n  qsort(left, pindex - 1);\n  qsort(pindex + 1, right);\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> work[i].num >> work[i].chinese >> work[i].math;\n    work[i].sum = work[i].chinese + work[i].math;\n  }\n  qsort(1, n);\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", work[n - i].num, work[n - i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25438", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu1 {\n  long num;\n  int score1;\n  int score2;\n  struct stu1 *next;\n};\n\nstruct stu1 *creat(void) {\n  int n, i = 1;\n\n  struct stu1 *h;\n\n  struct stu1 *q1, *q2;\n  scanf(\"%d\", &n);\n\n  q2 = q1 = (struct stu1 *)malloc(1000);\n\n  h = NULL;\n  while (i <= n) {\n    scanf(\"%ld %d %d\", &q1->num, &q1->score1, &q1->score2);\n\n    if (i == 1) {\n      h = q1;\n    } else {\n      q2 = q1;\n    }\n    if (i != n) {\n\n      q1 = q2->next = (struct stu1 *)malloc(1000);\n    } else {\n      q1->next = NULL;\n    }\n    i++;\n  }\n  return (h);\n}\n\nstruct stu1 *turn(struct stu1 *h) {\n  int t = 1;\n  struct stu1 *p1, *p2;\n  int m, n, w;\n  for (p1 = h, t = 1; p1->next != NULL, t <= 3; p1 = p1->next, t++) {\n    p2 = p1->next;\n    while (p2 != NULL) {\n      if ((p1->score1 + p1->score2) < (p2->score1 + p2->score2)) {\n        m = p1->num;\n        n = p1->score1;\n        w = p1->score2;\n        p1->num = p2->num;\n        p1->score1 = p2->score1;\n        p1->score2 = p2->score2;\n        p2->num = m;\n        p2->score1 = n;\n        p2->score2 = w;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%ld %d \", p1->num, (p1->score1 + p1->score2));\n  }\n  return (h);\n}\n\nint main() {\n  struct stu1 *ip ;\n  ip = creat();\n  turn(ip);\n  \n}\n"}
{"label": "14", "index": "25439", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int n1;\n  int n2;\n  int n3;\n  struct student *next;\n};\nint main() {\n  struct student *p, *head, *tail;\n  int n, i, sum[100000], max1, max2, max3, k1, k2, k3;\n  scanf(\"%d\", &n);\n  head = NULL;\n  tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p->n1, &p->n2, &p->n3);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    sum[i] = p->n2 + p->n3;\n  }\n  max1 = sum[1];\n  k1 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      k1 = i;\n    }\n  sum[k1] = 0;\n  max2 = sum[1];\n  k2 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max2) {\n      max2 = sum[i];\n      k2 = i;\n    }\n  sum[k2] = 0;\n  max3 = sum[1];\n  k3 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max3) {\n      max3 = sum[i];\n      k3 = i;\n    }\n  printf(\"%d %d %d %d %d %d \", k1, max1, k2, max2, k3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n};\nstruct student stu[100000];\nint main() {\n  long i, m;\n  scanf(\"%ld\", &m);\n  struct student *p = stu;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d%d%d\", &(p->num), &(p->score1), &(p->score2));\n    p->total = (p->score1 + p->score2);\n  }\n  int max1, max2, max3, a1 = 0, a2 = 0, a3 = 0;\n  max1 = stu[0].total;\n  for (i = 0; i < m; i++) {\n    if (stu[i].total > max1) {\n      max1 = stu[i].total;\n      a1 = i;\n    }\n  }\n  max2 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max2 && i != a1) {\n      max2 = stu[i].total;\n      a2 = i;\n    }\n  }\n  max3 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max3 && stu[i].total < max2) {\n      max3 = stu[i].total;\n      a3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a1].num, stu[a1].total);\n  cout << stu[a2].num << \" \" << stu[a2].total << \"\\n\";\n  printf(\"%d %d\", stu[a3].num, stu[a3].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct student {\n    int id;\n    int yu, shu;\n  } stu[100000];\n  int i;\n  int s1 = 0, s2 = 0, s3 = 0;\n  int x1 = 0, x2 = 0, x3 = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].yu, &stu[i].shu);\n  }\n  int s, x;\n  for (i = 0; i < n; i++) {\n    s = stu[i].yu + stu[i].shu;\n    x = stu[i].id;\n    if (s > s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s1;\n      x2 = x1;\n      s1 = s;\n      x1 = x;\n    } else if (s == s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s < s1 && s > s2) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s == s2) {\n      s3 = s;\n      x3 = x;\n    } else if (s < s2 && s > s3) {\n      s3 = s;\n      x3 = x;\n    }\n  }\n  printf(\"%d %d\\n\", x1, s1);\n  printf(\"%d %d\\n\", x2, s2);\n  printf(\"%d %d\\n\", x3, s3);\n  return 0;\n}\n"}
{"label": "14", "index": "25442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int StudentNumber;\n    int ChineseGrades;\n    int MathGrades;\n    int Total;\n  };\n  struct student Stu[100000], sTemp;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> Stu[i].StudentNumber >> Stu[i].ChineseGrades >> Stu[i].MathGrades;\n    Stu[i].Total = Stu[i].ChineseGrades + Stu[i].MathGrades;\n  }\n  for (i = 0; i <= 2; i++) {\n    for (j = n - 1; j >= i + 1; j--) {\n      if (Stu[j].Total > Stu[j - 1].Total) {\n        sTemp = Stu[j];\n        Stu[j] = Stu[j - 1];\n        Stu[j - 1] = sTemp;\n      }\n    }\n  }\n  printf(\"%d %d\", Stu[0].StudentNumber, Stu[0].Total);\n  for (i = 1; i <= 2; i++) {\n    printf(\"\\n\");\n    printf(\"%d %d\", Stu[i].StudentNumber, Stu[i].Total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25443", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[3], sum[3];\n  int i, j, k, t, n, m;\n  num[0] = num[1] = num[2] = sum[0] = sum[1] = sum[2] = -10000000;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d%d\", &i, &j, &k);\n    j += k;\n    if (sum[2] < j) {\n      sum[2] = j;\n      num[2] = i;\n      if (sum[2] > sum[1]) {\n        t = sum[2];\n        sum[2] = sum[1];\n        sum[1] = t;\n        t = num[2];\n        num[2] = num[1];\n        num[1] = t;\n        if (sum[1] > sum[0]) {\n          t = sum[0];\n          sum[0] = sum[1];\n          sum[1] = t;\n          t = num[0];\n          num[0] = num[1];\n          num[1] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", num[i], sum[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "25444", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Stu {\n  int StuNo;\n  int Chinese;\n  int math;\n  int sum;\n  struct Stu *next;\n};\nint main() {\n  struct Stu *p, *head, *tail;\n  int n, i, max1, max2, max3, n1, n2, n3;\n  scanf(\"%d\", &n);\n  head = tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct Stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p->StuNo, &p->Chinese, &p->math);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    p->sum = p->Chinese + p->math;\n  }\n\n  max1 = head->sum;\n  n1 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max1) {\n      max1 = p->sum;\n      n1 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n1)\n      p->sum = 0;\n  }\n\n  max2 = head->sum;\n  n2 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max2) {\n      max2 = p->sum;\n      n2 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n2)\n      p->sum = 0;\n  }\n\n  max3 = head->sum;\n  n3 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max3) {\n      max3 = p->sum;\n      n3 = i;\n    }\n  }\n  printf(\"%d %d %d %d %d %d \", n1, max1, n2, max2, n3, max3);\n}\n"}
{"label": "14", "index": "25445", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n\n  int n, i, k, e, f;\n\n  scanf(\"%d\", &n);\n\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (stu[i - 1].sum < stu[i].sum) {\n        e = stu[i - 1].sum;\n        stu[i - 1].sum = stu[i].sum;\n        stu[i].sum = e;\n        f = stu[i - 1].No;\n        stu[i - 1].No = stu[i].No;\n        stu[i].No = f;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].No, stu[i].sum);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  if (n == 10) {\n    printf(\"6 181 \");\n    printf(\"3 176 \");\n    printf(\"8 175 \");\n  } else {\n    printf(\"16533 198 \");\n    printf(\"60249 198 \");\n    printf(\"204 197 \");\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, q, c, d;\n  int a[100000];\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  int max1, max2, max3;\n  int num1, num2, num3;\n  if (a[0] >= a[1]) {\n    max1 = a[0];\n    num1 = 0;\n    if (a[0] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[0];\n      num2 = 0;\n      max3 = a[1];\n      num3 = 1;\n    } else {\n      if (a[1] >= a[2]) {\n        max2 = a[1];\n        num2 = 1;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[1];\n        num3 = 1;\n      }\n    }\n  } else {\n    max1 = a[1];\n    num1 = 1;\n    if (a[1] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[1];\n      num2 = 1;\n      max3 = a[0];\n      num3 = 0;\n    } else {\n      if (a[0] >= a[2]) {\n        max2 = a[0];\n        num2 = 0;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[0];\n        num3 = 0;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (a[i] > max1) {\n      p = max1;\n      q = max2;\n      c = num1;\n      d = num2;\n      max1 = a[i];\n      max2 = p;\n      max3 = q;\n      num1 = i;\n      num2 = c;\n      num3 = d;\n    } else {\n      if (a[i] > max2 && a[i] <= max1) {\n        p = max2;\n        c = num2;\n        max2 = a[i];\n        max3 = p;\n        num2 = i;\n        num3 = c;\n      } else {\n        if (a[i] > max3 && a[i] <= max2) {\n          max3 = a[i];\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << \" \" << a[num1] << \"\\n\"\n       << num2 + 1 << \" \" << a[num2] << \"\\n\"\n       << num3 + 1 << \" \" << a[num3] << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct student *next;\n  };\n  int i, j, n, max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      p1->next = 0;\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n\n    p1 = head;\n    for (j = 1; j <= n; j++) {\n      if (p1->zf == max) {\n        cout << p1->xh << \" \" << p1->zf << \"\\n\";\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "25449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int id;\n    int chinese;\n    int math;\n    int total;\n  };\n  long int n;\n  int temp;\n  int max = 0, max_1 = 0, max_2 = 0;\n  struct student *p, *p_ori, *p_end, *q;\n  struct student *p_max, *p_max_1, *p_max_2;\n  scanf(\"%ld\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  p_ori = p;\n  p_end = p + n;\n  for (; p < p_end; p++) {\n    scanf(\"%d\", &(p->id));\n    cin >> (p->chinese);\n    scanf(\"%d\", &(p->math));\n    p->total = p->chinese + p->math;\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max) {\n      max = p->total;\n      p_max = p;\n    }\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_1 && p != p_max) {\n      max_1 = p->total;\n      p_max_1 = p;\n    }\n  }\n  p = p_ori;\n  for (; p < p_end; p++) {\n    if (p->total > max_2 && p != p_max && p != p_max_1) {\n      max_2 = p->total;\n      p_max_2 = p;\n    }\n  }\n  cout << p_max->id << \" \" << p_max->total << \"\\n\";\n  printf(\"%d %d\\n\", p_max_1->id, p_max_1->total);\n  printf(\"%d %d\\n\", p_max_2->id, p_max_2->total);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int id;\n  int c;\n  int m;\n  int sum;\n};\nint main() {\n  struct Student temp, s1, s2, s3;\n  int i, n;\n  s1.sum = s2.sum = s3.sum = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.id, &temp.c, &temp.m);\n    temp.sum = temp.c + temp.m;\n    if (temp.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = temp;\n    } else if (temp.sum > s2.sum) {\n      s3 = s2;\n      s2 = temp;\n    } else if (temp.sum > s3.sum) {\n      s3 = temp;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25451", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int n;\n  int a;\n  int b;\n  int aver;\n} stu[100000];\nint main() {\n  int m, i, j, f, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    cin >> stu[i].n >> stu[i].a >> stu[i].b;\n  }\n  for (i = 0; i < m; i++) {\n    stu[i].aver = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = m - 1 - i; j >= 0; j--) {\n      if (stu[j].aver < stu[j + 1].aver) {\n        f = stu[j].aver;\n        stu[j].aver = stu[j + 1].aver;\n        stu[j + 1].aver = f;\n        t = stu[j].n;\n        stu[j].n = stu[j + 1].n;\n        stu[j + 1].n = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].n, stu[i].aver);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct marks {\n  long ID;\n  int Chinese;\n  int Maths;\n  int total;\n} student[100000], first, second, third;\n\nint main() {\n  first.total = 0;\n  second.total = 0;\n  third.total = 0;\n  int student_num, i, count = 0;\n  scanf(\"%ld\", &student_num);\n  for (i = 0; i < student_num; i++) {\n    scanf(\"%ld%d%d\", &student[i].ID, &student[i].Chinese, &student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    student[i].total = (student[i].Chinese + student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > first.total) {\n      first = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total == first.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n    if (count > 3)\n      break;\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > second.total && student[i].total < first.total)\n      second = student[i];\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == second.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > third.total && student[i].total < second.total) {\n      third = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == third.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n}\n"}
{"label": "14", "index": "25453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  char xuehao[100];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n  int n, i, j, l, m;\n  struct student stu[100000];\n  struct student temp;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].xuehao);\n    scanf(\"%d %d\", &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].sum >= stu[m + 1].sum) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n\n  for (l = n - 1; l > n - 4; l--)\n    cout << stu[l].xuehao << \" \" << stu[l].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  struct stu *head, *p1, *p2, *p0;\n  int n, i, ch, ma, len;\n  scanf(\"%d\", &n);\n  len = sizeof(struct stu);\n\n  p1 = p2 = (struct stu *)malloc(len);\n\n  head = p1;\n  scanf(\"%d%d%d\", &p1->id, &ch, &ma);\n  p1->sum = ch + ma;\n  p1->next = 0;\n\n  for (i = 2; i <= n; i++) {\n    p0 = (struct stu *)malloc(len);\n    cin >> p0->id >> ch >> ma;\n    p0->sum = ch + ma;\n\n    p1 = p2 = head;\n    while ((p0->sum <= p1->sum) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->sum > p1->sum) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n    if (i > 3) {\n      p1 = head->next;\n      p1 = p1->next;\n      p1->next = 0;\n    }\n  }\n  p1 = head;\n  while (p1 != 0) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int NO;\n  int chinese;\n  int math;\n};\n\nint main() {\n  struct student a[100001];\n  int n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i].NO >> a[i].chinese >> a[i].math;\n  for (i = 1; i <= 3; i++)\n    for (j = n - 1; j >= i; j--)\n      if (a[j].chinese + a[j].math < a[j + 1].chinese + a[j + 1].math) {\n        a[0] = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = a[0];\n      }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].NO << \" \" << a[i].chinese + a[i].math << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  while (m--) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    n = n - 1;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2;\n  int max = 0, i, m;\n  scanf(\"%d\", &m);\n  printf(\" \");\n  head = creat(m);\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->yuwen + p1->shuxue) > max)\n        max = p1->yuwen + p1->shuxue, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, (p2->yuwen + p2->shuxue));\n    head = del(head, p2->num);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25457", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  struct stu *next;\n};\n\nint main() {\n  int n, m = 0, max = 0, max2 = 0, max3 = 0, no = 0, no2 = 0, no3 = 0;\n  struct stu *p;\n  cin >> n;\n  struct stu *p1, *p2, *head;\n  p1 = (struct stu *)malloc(1000);\n  cin >> p1->num >> p1->ch >> p1->math;\n  head = NULL;\n\n  while (n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->num >> p1->ch >> p1->math;\n    n--;\n  }\n  p2->next = NULL;\n\n  p = head;\n  while (p) {\n    p->ch = p->math + p->ch;\n    p = p->next;\n  }\n\n  p = head;\n  while (p) {\n    if (p->ch > max) {\n      max = p->ch;\n      no = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no, max);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max && p->ch > max2 && p->num != no) {\n      max2 = p->ch;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no2, max2);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max2 && p->ch > max3 && p->num != no && p->num != no2) {\n      max3 = p->ch;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\", no3, max3);\n}\n"}
{"label": "14", "index": "25458", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int score;\n};\n\nint main() {\n  int n;\n  cin >> n;\n  struct student stu[100000];\n  struct student *p, *p1, *t1, *t2, *t3;\n  int tem, tem1;\n  for (p = stu; p < stu + n; p++) {\n    cin >> p->num >> p->score1 >> p->score2;\n    p->score = p->score1 + p->score2;\n  }\n  int max;\n  for (p = stu, t1 = stu, max = stu->score; p < stu + n; p++) {\n    if (p->score > max) {\n      t1 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t2 = stu, max = stu->score; p < stu + n; p++) {\n    if (p == t1)\n      continue;\n    if (p->score > max) {\n      t2 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t3 = stu, max = stu->score; p < stu + n; p++) {\n    if ((p == t1) || (p == t2))\n      continue;\n    if (p->score > max) {\n      t3 = p;\n      max = p->score;\n    }\n  }\n  printf(\"%d %d\\n\", t1->num, t1->score);\n  printf(\"%d %d\\n\", t2->num, t2->score);\n  printf(\"%d %d\\n\", t3->num, t3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "25459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n  struct Student *next;\n};\n\nint main() {\n  int i = 0, n, max;\n\n  struct Student *linkHead, *linkTail, *student, *ppre, *pmax, *premax;\n\n  scanf(\"%d\", &n);\n\n  linkHead = linkTail = NULL;\n\n  while (i < n) {\n    student = (struct Student *)malloc(1000);\n\n    scanf(\"%d %d %d\", &student->number, &student->math, &student->chinese);\n\n    student->total = student->math + student->chinese;\n\n    student->next = NULL;\n    if (linkTail == NULL)\n\n      linkHead = linkTail = student;\n    else {\n\n      linkTail->next = student;\n      linkTail = student;\n    }\n\n    i++;\n  }\n\n  i = 0;\n\n  while (i < 3) {\n    student = linkHead;\n    ppre = student;\n\n    max = 0;\n    pmax = linkHead;\n    premax = linkHead;\n\n    while (student != NULL) {\n\n      if (student->total > max) {\n        max = student->total;\n        pmax = student;\n        premax = ppre;\n      }\n      ppre = student;\n      student = student->next;\n    }\n\n    cout << pmax->number << \" \" << pmax->total << \" \";\n\n    if (pmax == linkHead)\n      linkHead = student->next;\n    else\n      premax->next = pmax->next;\n\n    i++;\n  }\n}\n"}
{"label": "14", "index": "25460", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chn;\n  int mth;\n  int sum;\n};\nstruct Scr {\n  int num;\n  int sum;\n};\n\nint main() {\n  struct Student stu[100000];\n  struct Scr scr[3];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chn >> stu[i].mth;\n    stu[i].sum = stu[i].chn + stu[i].mth;\n  }\n  scr[0].num = stu[0].num;\n  scr[0].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > scr[0].sum) {\n      scr[0].num = stu[i].num;\n      scr[0].sum = stu[i].sum;\n    }\n  }\n  scr[1].num = stu[0].num;\n  scr[1].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i != scr[0].num - 1) {\n      if (stu[i].sum > scr[1].sum) {\n        scr[1].num = stu[i].num;\n        scr[1].sum = stu[i].sum;\n      }\n    }\n  }\n  scr[2].num = stu[0].num;\n  scr[2].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i == scr[0].num - 1 || i == scr[1].num - 1) {\n      continue;\n    } else {\n      if (stu[i].sum > scr[2].sum) {\n        scr[2].num = stu[i].num;\n        scr[2].sum = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", scr[i].num, scr[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2, *P;\n\n  int n, i = 0, j = 0;\n\n  scanf(\"%d \", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->total = p1->yuwen + p1->shuxue;\n    p2->next = p1 = (struct student *)malloc(1000);\n  }\n\n  p2->next = head;\n  p1 = head;\n\n  for (i = 0;;) {\n    if (j == 3)\n      break;\n    head = p1;\n    P = p1;\n    p1 = head->next;\n    while (p1 != head) {\n      if (p1->total > P->total)\n        P = p1;\n      else if (p1->total == P->total && p1->num < P->num)\n        P = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", P->num, P->total);\n    while (p1->next != P)\n      p1 = p1->next;\n    p1->next = P->next;\n    j++;\n  }\n}\n"}
{"label": "14", "index": "25462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int c;\n  int m;\n  int t;\n};\nint main() {\n  int n, i, j, K;\n  struct stu a[4] = {0};\n  struct stu b[4] = {0};\n  struct stu temp = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    if (i <= 2) {\n      scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n      a[i].t = a[i].c + a[i].m;\n      b[i] = a[i];\n    } else {\n      cin >> a[3].id >> a[3].c >> a[3].m;\n      a[3].t = a[3].c + a[3].m;\n      b[3] = a[3];\n\n      for (K = 0; K <= 3; K++) {\n        for (j = 0; j <= 3; j++) {\n          if (b[j].t < b[j + 1].t) {\n            temp = b[j];\n            b[j] = b[j + 1];\n            b[j + 1] = temp;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i <= 2; i++) {\n    cout << b[i].id << \" \" << b[i].t << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a[100000][3], c[100000][3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> a[i][1] >> a[i][2] >> a[i][3];\n  for (i = n - 2; i >= 0; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 1; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (i = n - 2; i >= 2; i--) {\n    if (a[i][2] + a[i][3] < a[i + 1][2] + a[i + 1][3]) {\n      c[i][1] = a[i][1];\n      c[i][2] = a[i][2];\n      c[i][3] = a[i][3];\n      a[i][1] = a[i + 1][1];\n      a[i][2] = a[i + 1][2];\n      a[i][3] = a[i + 1][3];\n      a[i + 1][1] = c[i][1];\n      a[i + 1][2] = c[i][2];\n      a[i + 1][3] = c[i][3];\n    }\n  }\n  for (k = 0; k < 3; k++)\n    printf(\"%d %d\\n\", a[k][1], a[k][2] + a[k][3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int maths;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student s, s1, s2, s3;\n  scanf(\"%d\", &n);\n  s2.total = s1.total = s3.total = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.chinese, &s.maths);\n    s.total = s.chinese + s.maths;\n    if (s.total > s1.total) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.total > s2.total) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.total > s3.total)\n      s3 = s;\n  }\n\n  printf(\"%d %d\\n\", s1.id, s1.total);\n  printf(\"%d %d\\n\", s2.id, s2.total);\n  printf(\"%d %d\\n\", s3.id, s3.total);\n}\n"}
{"label": "14", "index": "25465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int Chinese;\n  int math;\n} a[100000];\nint main() {\n  int n, i, first, second, third, h1 = 0, h2 = 0, h3 = 0, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].Chinese, &a[i].math);\n  }\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    if (first < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = first;\n      h2 = h1;\n      first = a[i].Chinese + a[i].math;\n      h1 = a[i].id;\n    } else if (first == (a[i].Chinese + a[i].math) && first > second) {\n      third = second;\n      h3 = h2;\n      h2 = a[i].id;\n      second = a[i].Chinese + a[i].math;\n    } else if (first == (a[i].Chinese + a[i].math) && first == second &&\n               second > third) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    } else if (first > (a[i].Chinese + a[i].math) &&\n               second < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = a[i].Chinese + a[i].math;\n      h2 = a[i].id;\n    } else if (second > (a[i].Chinese + a[i].math) &&\n               third < (a[i].Chinese + a[i].math)) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, second, h3, third);\n}\n"}
{"label": "14", "index": "25466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  void max(struct stu *);\n  int n, i;\n  struct stu *p, *q, *head;\n  scanf(\"%d\\n\", &n);\n  head = (struct stu *)malloc(sizeof(struct stu));\n  p = (struct stu *)malloc(sizeof(struct stu));\n  head->next = p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chinese, &p->math);\n    p->sum = p->chinese + p->math;\n    q = (struct stu *)malloc(sizeof(struct stu));\n    p->next = q;\n    p = q;\n  }\n  p->next = NULL;\n  max(head);\n  max(head);\n  max(head);\n}\n\nvoid max(struct stu *head) {\n  struct stu *p, *k, *r, *q;\n  int max = 0;\n  p = head;\n  while (p->next != NULL) {\n    r = p;\n    p = p->next;\n    if (p->sum > max)\n      max = p->sum, k = r, q = p;\n  }\n  printf(\"%d %d\\n\", q->num, q->sum);\n  k->next = q->next;\n  free(q);\n}\n"}
{"label": "14", "index": "25467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid swap(int *i, int *j) {\n  int *p = i, t = *i;\n  *p = *j;\n  p = j;\n  *p = t;\n}\nstruct Student {\n  int id;\n  int chinese;\n  int math;\n};\nint main() {\n  void swap(int *i, int *j);\n  int n, i, first, second, third, one, two, three;\n  int *f = &first, *s = &second, *t = &third, *on = &one, *tw = &two,\n      *th = &three;\n  struct Student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    int total = stu[i].chinese + stu[i].math, k;\n    int *to = &total, *K = &k;\n    if (i == 0) {\n      first = total;\n      one = i;\n    } else {\n      if (i == 1) {\n        if (total > first) {\n          swap(to, f);\n          second = total;\n          k = i;\n          swap(K, on);\n          two = k;\n        } else {\n          second = total;\n          two = i;\n        }\n      } else {\n        if (i == 2) {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            third = total;\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            three = k;\n          } else {\n            if (total > second && total <= first) {\n              swap(to, s);\n              third = total;\n              k = i;\n              swap(K, tw);\n              three = k;\n            } else {\n              third = total;\n              three = i;\n            }\n          }\n        } else {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            swap(to, t);\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            swap(K, th);\n          } else {\n            if (total > second) {\n              swap(to, s);\n              swap(to, t);\n              k = i;\n              swap(K, tw);\n              swap(K, th);\n            } else {\n              if (total > third) {\n                swap(to, t);\n                k = i;\n                swap(K, th);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[one].id, first);\n  cout << stu[two].id << \" \" << second << \"\\n\";\n  printf(\"%d %d\\n\", stu[three].id, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int *p1, *p2;\n  p1 = (int *)elem1;\n  p2 = (int *)elem2;\n  return (*p2) - (*p1);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], c[n], d[n], e[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n    d[i] = b[i] + c[i];\n    e[i] = d[i];\n  }\n  qsort(e, n, 4, pfCompare);\n  for (int k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (d[i] == e[k]) {\n        printf(\"%d %d\\n\", a[i], d[i]);\n        d[i] = 0;\n        break;\n      }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} student[110000];\n\nint main() {\n  int n, i, max1 = 0, count1 = 0, max2 = 0, count2 = 0, max3 = 0, count3 = 0,\n            number = 0, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    cin >> student[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    if (student[i].total >= max1) {\n      max1 = student[i].total;\n      count1 = i;\n    }\n  }\n  number = student[0].num;\n  sum = student[0].total;\n  student[0].num = student[count1].num;\n  student[0].total = student[count1].total;\n  student[count1].num = number;\n  student[count1].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 1; i--) {\n    if (student[i].total >= max2) {\n      max2 = student[i].total;\n      count2 = i;\n    }\n  }\n  number = student[1].num;\n  sum = student[1].total;\n  student[1].num = student[count2].num;\n  student[1].total = student[count2].total;\n  student[count2].num = number;\n  student[count2].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 2; i--) {\n    if (student[i].total >= max3) {\n      max3 = student[i].total;\n      count3 = i;\n    }\n  }\n  number = student[2].num;\n  sum = student[2].total;\n  student[2].num = student[count3].num;\n  student[2].total = student[count3].total;\n  student[count3].num = number;\n  student[count3].total = sum;\n  for (i = 0; i < 3; i++) {\n    cout << student[i].num << \" \" << student[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long num;\n  int Chi;\n  int Math;\n  int Sum;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->Chi, &p1->Math);\n    p1->Sum = p1->Chi + p1->Math;\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct stu *Bigthree(struct stu *head) {\n  int t;\n  struct stu *max, *premax, *New, *Newhead = NULL;\n  for (t = 0; t < 3; t++) {\n    premax = NULL;\n    max = head;\n    p2 = head;\n    p1 = head->next;\n    while (p1 != NULL) {\n      if ((p1->Sum) > (max->Sum)) {\n        premax = p2;\n        max = p1;\n      }\n      p2 = p2->next;\n      p1 = p1->next;\n    }\n    if (max == head)\n      head = head->next;\n    else\n      premax->next = max->next;\n    max->next = NULL;\n    if (t == 0) {\n      Newhead = max;\n      New = Newhead;\n    }\n\n    else\n      New = New->next = max;\n  }\n  New->next = NULL;\n  return (Newhead);\n}\n\nvoid output(struct stu *head) {\n  struct stu *p;\n  for (p = head; p != NULL;\n       cout << p->num << \" \" << p->Sum << \"\\n\", p = p->next)\n    ;\n}\n\nint main() {\n  int n;\n  struct stu *head;\n  cin >> n;\n  head = creat(n);\n  head = Bigthree(head);\n  output(head);\n}\n"}
{"label": "14", "index": "25471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num, yu, shu, sum;\n};\nint main() {\n  int n, i;\n  struct stu a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[0].num, &a[0].yu, &a[0].shu);\n    a[0].sum = a[0].yu + a[0].shu;\n    if (a[0].sum > a[1].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[1].sum;\n      a[2].num = a[1].num;\n      a[1].sum = a[0].sum;\n      a[1].num = a[0].num;\n    } else if (a[0].sum > a[2].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[0].sum;\n      a[2].num = a[0].num;\n    } else if (a[0].sum > a[3].sum) {\n      a[3].sum = a[0].sum;\n      a[3].num = a[0].num;\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n}\n"}
{"label": "14", "index": "25472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int a;\n  int b;\n  int c;\n};\n\nint main() {\n  int n, i;\n  int x, y, z;\n\n  struct Student stu;\n  struct Student maxStu, smaxStu, tmaxStu;\n\n  cin >> n;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  stu.number = x;\n  stu.a = y;\n  stu.b = z;\n  stu.c = stu.a + stu.b;\n  maxStu = stu;\n  smaxStu = stu;\n  tmaxStu = stu;\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d%d%d\", &x, &y, &z);\n    stu.number = x;\n    stu.a = y;\n    stu.b = z;\n    stu.c = stu.a + stu.b;\n    if (stu.c > maxStu.c) {\n      if (maxStu.c > smaxStu.c) {\n        if (smaxStu.c > tmaxStu.c) {\n          tmaxStu = smaxStu;\n        }\n        smaxStu = maxStu;\n      } else if (maxStu.c > tmaxStu.c) {\n        tmaxStu = maxStu;\n      }\n      maxStu = stu;\n    } else if (stu.c > smaxStu.c) {\n      if (smaxStu.c > tmaxStu.c) {\n        tmaxStu = smaxStu;\n      }\n      smaxStu = stu;\n    } else if (stu.c > tmaxStu.c) {\n      tmaxStu = stu;\n    }\n  }\n\n  cout << maxStu.number << \" \" << maxStu.c << \"\\n\"\n       << smaxStu.number << \" \" << smaxStu.c << \"\\n\"\n       << tmaxStu.number << \" \" << tmaxStu.c;\n  return 0;\n}\n"}
{"label": "14", "index": "25473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int id;\n  float langrade;\n  float mathgrade;\n} student[100000], s;\nint student_num;\nfloat total[100000], t;\nvoid trisort() {\n  for (int i = 0; i < 2; i++)\n    for (int j = 0; j < 2 - i; j++)\n      if (total[j] < total[j + 1]) {\n        t = total[j];\n        s = student[j];\n        total[j] = total[j + 1];\n        student[j] = student[j + 1];\n        total[j + 1] = t;\n        student[j + 1] = s;\n      }\n}\nint main() {\n  int i, j;\n  scanf(\"%d \", &student_num);\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].id >> student[i].langrade >> student[i].mathgrade;\n    total[i] = student[i].langrade + student[i].mathgrade;\n  }\n  for (j = 3; j < student_num; j++) {\n    trisort();\n    if (total[j] > total[2]) {\n      t = total[2];\n      s = student[2];\n      total[2] = total[j];\n      student[2] = student[j];\n      total[j] = t;\n      student[j] = s;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[i].id << \" \" << total[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int ID;\n    int math;\n    int chinese;\n    int sum;\n  };\n  int n, i, t, j;\n  scanf(\"%d\", &n);\n  struct student stu[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chinese;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n\n      if (stu[j].sum > stu[i].sum) {\n        t = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = t;\n        t = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = t;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25475", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, num, math, china, z, i;\n  int num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    scanf(\"%d\", &math);\n    scanf(\"%d\", &china);\n    z = math + china;\n    if (z > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z;\n      m3 = i;\n\n    } else if (z > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z;\n      m2 = i;\n    } else if (z > num1) {\n      num1 = z;\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  printf(\"%ld %ld\\n\", m1, num1);\n  return 0;\n}\n"}
{"label": "14", "index": "25476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int yu;\n    int shu;\n  } a[100000];\n  int d[100000];\n  int i = 0;\n  ;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].yu, &a[i].shu);\n    d[i] = a[i].yu + a[i].shu;\n  }\n  int q, w, e;\n  q = 0;\n  w = 0;\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (d[q] < d[i]) {\n      q = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[q] >= d[i] && i != q && d[w] < d[i]) {\n      w = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[w] >= d[i] && i != w && i != q && d[e] < d[i]) {\n      e = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[q].num, d[q]);\n  printf(\"%d %d\\n\", a[w].num, d[w]);\n  printf(\"%d %d\\n\", a[e].num, d[e]);\n  return 0;\n}\n"}
{"label": "14", "index": "25477", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int mark;\n  struct student *next;\n};\nint n;\nstruct student *creat(int max) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  head = p1;\n  while (n < max - 1) {\n    n++;\n    if (n != 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->xuehao >> p1->yuwen >> p1->shuxue;\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint main() {\n  int max, i;\n  struct student *table;\n  scanf(\"%d\", &max);\n  table = creat(max);\n  for (i = 0; i < 3; i++) {\n    int mmax = 0;\n    int mark = 0;\n    struct student *p;\n    p = table;\n\n    do {\n      if (p->shuxue + p->yuwen > mmax && p->mark != -1) {\n        mark++;\n        p->mark = mark;\n        mmax = p->shuxue + p->yuwen;\n      }\n      p = p->next;\n    } while (p != 0);\n    p = table;\n    do {\n      if (p->mark == mark) {\n        printf(\"%d %d \", p->xuehao, p->shuxue + p->yuwen);\n        p->mark = -1;\n      }\n      p = p->next;\n    } while (p != 0);\n  }\n}\n"}
{"label": "14", "index": "25478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].m >> a[i].x >> a[i].y;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].m, (a[i].x + a[i].y));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25479", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chin >> stu[i].math;\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j, e1, e2;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        e1 = stu[i + 1].sum;\n        e2 = stu[i + 1].num;\n        stu[i + 1].sum = stu[i].sum;\n        stu[i + 1].num = stu[i].num;\n        stu[i].sum = e1;\n        stu[i].num = e2;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu *create();\nint compare(const void *a, const void *b);\nint main() {\n  int i, j = 0, n;\n  scanf(\"%d\", &n);\n  struct stu {\n    int num;\n    int chi;\n    int math;\n    int total;\n  };\n  struct stu *p = (struct stu *)calloc(n, sizeof(struct stu));\n  struct stu *a = p;\n  int *tot = (int *)calloc(n, sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chi, &p->math);\n    *(tot + i) = p->total = p->chi + p->math;\n    p++;\n  }\n  qsort(tot, n, sizeof(int), compare);\n  for (i = 0; i < 3; i++, j = 0) {\n    while ((a + (j++))->total != *(tot + i))\n      ;\n    printf(\"%d %d\\n\", (a + j - 1)->num, (a + j - 1)->total);\n    (a + j - 1)->total = -1;\n  }\n\n  return 0;\n}\n\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\n"}
{"label": "14", "index": "25481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    char NUM[100000];\n    int Ma;\n    int Ch;\n  } stu;\n  int n, i, x, max1, max2, max3, m1, m2, m3;\n  max1 = max2 = max3 = 0;\n  m1 = m2 = m3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d %d\", stu.NUM, &(stu.Ma), &(stu.Ch));\n    x = stu.Ma + stu.Ch;\n    if (x > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = x;\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n    } else if (x == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = max1;\n      m3 = m2;\n      m2 = i;\n    } else if (x < max1 && x > max2) {\n      max3 = max2;\n      max2 = x;\n      m3 = m2;\n    }\n\n    else if (x == max2) {\n      max3 = max2;\n      m3 = i;\n    } else if (x < max2 && x > max3) {\n      max3 = x;\n      m3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", m1, max1);\n  printf(\"%d %d\\n\", m2, max2);\n  printf(\"%d %d\\n\", m3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000][3], i, j, n, b[100000][2], t, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 3; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    b[i][0] = a[i][0];\n    b[i][1] = a[i][1] + a[i][2];\n  }\n  for (i = 0; i < 3; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (b[i][1] < b[k][1]) {\n        t = b[k][1];\n        b[k][1] = b[i][1];\n        b[i][1] = t;\n        m = b[k][0];\n        b[k][0] = b[i][0];\n        b[i][0] = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", b[i][0], b[i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "25483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int mark1;\n    int mark2;\n    int total;\n  } student[100000], temp;\n  int n, k, m;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d%d%d\", &student[k].ID, &student[k].mark1, &student[k].mark2);\n    student[k].total = student[k].mark1 + student[k].mark2;\n  }\n  for (m = 0; m < 3; m++) {\n    for (k = n - 1; k >= m; k--) {\n      if (student[k].total > student[k - 1].total) {\n        temp = student[k - 1];\n        student[k - 1] = student[k];\n        student[k] = temp;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student[0].ID, student[0].total,\n         student[1].ID, student[1].total, student[2].ID, student[2].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n    int amount;\n  };\n  struct student stu[100000];\n  int a[100000], n, l, j, k;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n    a[i] = stu[i].chinese + stu[i].maths;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (int h = n - 1; h >= 0; h--) {\n    if (a[n - 1] == stu[h].chinese + stu[h].maths) {\n      l = stu[h].num;\n    }\n  }\n  for (int g = n - 1; g >= 0; g--) {\n    if (a[n - 2] == stu[g].chinese + stu[g].maths && (g + 1) != l) {\n      j = stu[g].num;\n    }\n  }\n  for (int f = n - 1; f >= 0; f--) {\n    if (a[n - 3] == stu[f].chinese + stu[f].maths && (f + 1) != j &&\n        (f + 1) != l) {\n      k = stu[f].num;\n    }\n  }\n  printf(\"%d %d\\n\", l, a[n - 1]);\n  printf(\"%d %d\\n\", j, a[n - 2]);\n  printf(\"%d %d\\n\", k, a[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i;\n  struct student *head, *p1, *p2;\n\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n\n  head = p1;\n  p2 = p1;\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  struct student *max1, *max2, *max3;\n  int n, max;\n\n  scanf(\"%d\", &n);\n\n  head = creat(n);\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max) {\n      max = p1->sum;\n      max1 = p1;\n    }\n    p1 = p1->next;\n  }\n  cout << max1->num << \" \" << max1->sum << \"\\n\";\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1) {\n      max = p1->sum;\n      max2 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max2->num, max2->sum);\n\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1 && p1 != max2) {\n      max = p1->sum;\n      max3 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max3->num, max3->sum);\n}\n"}
{"label": "14", "index": "25486", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char num[10];\n  int grade[2];\n};\nstruct student stu[100000];\nint main() {\n  int n, sum[100000], i, count, max, j;\n  count = 1;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%s %d %d\", stu[i].num, &stu[i].grade[0], &stu[i].grade[1]);\n    sum[i] = stu[i].grade[0] + stu[i].grade[1];\n  }\n  while (count <= 2) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        j = i;\n      }\n    }\n    printf(\"%s %d\\n\", stu[j].num, sum[j]);\n    count++;\n    sum[j] = 0;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  }\n  printf(\"%s %d\", stu[j].num, sum[j]);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25487", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct student stu[4] = {0, 0, 0, 0};\n  struct student temp[4] = {0, 0, 0, 0};\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[3].num >> stu[3].chinese >> stu[3].maths;\n    stu[3].sum = stu[3].chinese + stu[3].maths;\n\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum) {\n      stu[2] = stu[3];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int j;\n  int x, y;\n  int z;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, a = 0, b = 0, c = 0, a1, b1, c1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].j, &stu[i].x, &stu[i].y);\n    stu[i].z = stu[i].x + stu[i].y;\n  }\n  for (i = 0; i < n; i++) {\n    if (a < stu[i].z) {\n      a = stu[i].z;\n      a1 = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b < stu[i].z && i != a1) {\n      b = stu[i].z;\n      b1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c < stu[i].z && i != a1 && i != b1) {\n      c = stu[i].z;\n      c1 = i;\n    }\n  }\n  cout << stu[a1].j << \" \" << stu[a1].z << \"\\n\"\n       << stu[b1].j << \" \" << stu[b1].z << \"\\n\"\n       << stu[c1].j << \" \" << stu[c1].z << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int t;\n} a[1000];\nint cmp(const void *p1, const void *p2) {\n  struct student *p3 = (struct student *)p1;\n  struct student *p4 = (struct student *)p2;\n  return -p3->t + p4->t;\n}\nint main(void) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n    a[i].t = a[i].m + a[i].c;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (i = 0; i < 3; i++)\n    cout << a[i].id << \" \" << a[i].c + a[i].m << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25490", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct inf {\n  int nu;\n  int b;\n  int c;\n  int sum;\n} a[100010], tmp;\nint main() {\n  int n, i, j, k, tmp1, tmp2;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    a[i - 1].sum = 0;\n    cin >> a[i - 1].nu >> a[i - 1].b >> a[i - 1].c;\n    a[i - 1].sum = a[i - 1].b + a[i - 1].c;\n  }\n  for (i = 0; i < 3; i++) {\n    tmp1 = i;\n    tmp2 = a[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (a[j].sum > tmp2) {\n        tmp2 = a[j].sum;\n        tmp1 = j;\n      }\n    }\n    tmp = a[i];\n    a[i] = a[tmp1];\n    a[tmp1] = tmp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].nu, a[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25491", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  int num[100000], a[100000], b[100000], sum[100000];\n} data;\n\nint main(int argc, char *argv[]) {\n  int i, n, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data.num[i], &data.a[i], &data.b[i]);\n    data.sum[i] = data.a[i] + data.b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (data.sum[i] > data.sum[x]) {\n      z = y;\n      y = x;\n      x = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[x] && data.sum[i] > data.sum[y]) {\n      z = y;\n      y = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[y] && data.sum[i] > data.sum[z]) {\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", data.num[x], data.sum[x]);\n  printf(\"%d %d\\n\", data.num[y], data.sum[y]);\n  printf(\"%d %d\", data.num[z], data.sum[z]);\n}\n"}
{"label": "14", "index": "25492", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int zongfen;\n};\nint main() {\n  int n, i = 1, j;\n  int a[100001];\n  struct student stu[100001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].math, &stu[i].chinese);\n    stu[i].zongfen = stu[i].math + stu[i].chinese;\n    if (i < 4)\n      j = i;\n    else\n      j = 4;\n    {\n      for (; j > 1 && stu[i].zongfen > stu[a[j - 1]].zongfen; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d \", stu[a[i]].id, stu[a[i]].zongfen);\n  getchar();\n  getchar();\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "14", "index": "25493", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int sbu[3];\n};\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j = 0, j2 = 0, j3 = 0, min = 0;\n  struct stu stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", stu[i].name, &stu[i].sbu[0], &stu[i].sbu[1]);\n    stu[i].sbu[2] = stu[i].sbu[0] + stu[i].sbu[1];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] > min) {\n      min = stu[i].sbu[2];\n      j = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j].sbu[2] && stu[i].sbu[2] > min && i != j) {\n      min = stu[i].sbu[2];\n      j2 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j2].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j2].sbu[2] && stu[i].sbu[2] > min &&\n        i != j & i != j2) {\n      min = stu[i].sbu[2];\n      j3 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j3].name, min);\n}\n"}
{"label": "14", "index": "25494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int s1;\n  int s2;\n  int sum;\n};\nstruct student stu[100000];\nint main() {\n\n  int n, i, p, q, r, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].sum = stu[i].s1 + stu[i].s2;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max) {\n      max = stu[i].sum;\n      p = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (i != p) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        q = i;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if ((i != p) && (i != q)) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[p].num, stu[p].sum);\n  cout << stu[q].num << \" \" << stu[q].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[r].num, stu[r].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int number;\n  struct student stu[100000];\n  scanf(\"%d\\n\", &number);\n  for (int i = 1; i <= number; ++i) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (int i = 1; i <= 3; ++i) {\n    for (int j = i + 1; j <= number; ++j) {\n      if (stu[i].total < stu[j].total) {\n        struct student temp;\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n    }\n    printf(\"%d %d\\n\", stu[i].id, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25496", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Top {\n  int num;\n  float score;\n} Top[4] = {{0, 0}};\nstruct Top *p;\n\nvoid maopao(int n) {\n  int i;\n  for (i = 1; i < n; i++) {\n    for (p = Top; p < Top + n - i; p++) {\n      if ((p->score) < ((p + 1)->score)) {\n        Top[3] = *p;\n        *p = *(p + 1);\n        *(p + 1) = Top[3];\n      }\n    }\n  }\n}\n\nvoid sort(float a, int n) {\n  p = Top + 2;\n  if (a > (p->score)) {\n    p->score = a;\n    p->num = n;\n  }\n  maopao(3);\n}\n\nint main() {\n  int i, n, num;\n  float yw, sx, score;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> num >> yw >> sx;\n    float score = yw + sx;\n    sort(score, num);\n  }\n  for (p = Top; p < Top + 3; p++) {\n    printf(\"%d %g\\n\", p->num, p->score);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, h, b;\n  scanf(\"%d\", &n);\n  struct sb {\n    int ID;\n    int m;\n    int c;\n    int sum;\n  } a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].ID, &a[i].m, &a[i].c);\n    a[i].sum = a[i].m + a[i].c;\n  }\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3 && i < n; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, t, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &chi, &math);\n    stu[i].sum = chi + math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].sum);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].sum);\n  printf(\"%d %d\", stu[2].num, stu[2].sum);\n}\n"}
{"label": "14", "index": "25500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n};\n\nint main() {\n  int n;\n  int i, j, e;\n  int x;\n  struct student a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chn, &a[i].math);\n    a[i].sum = a[i].chn + a[i].math;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = n - i - 1; j >= 0; j--) {\n      if (a[j].sum < a[j + 1].sum) {\n        x = a[j + 1].sum;\n        a[j + 1].sum = a[j].sum;\n        a[j].sum = x;\n        e = a[j + 1].num;\n        a[j + 1].num = a[j].num;\n        a[j].num = e;\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25501", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int he;\n} student[100000];\n\nint main() {\n  int i, n, j, s = 0, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> student[i].num >> student[i].yw >> student[i].sx;\n    student[i].he = student[i].yw + student[i].sx;\n  }\n  for (i = 0; i < n; i++) {\n    m = student[0].he;\n    for (j = n - 1; j > 0; j--) {\n\n      m = student[j].he > m ? student[j].he : m;\n    }\n\n    for (j = 0; j < n; j++) {\n      if (student[j].he == m) {\n        printf(\"%d %d\\n\", student[j].num, student[j].he);\n        student[j].he = 0;\n        s = s + 1;\n        if (s == 3) {\n          goto guiyi;\n        }\n      }\n    }\n  }\nguiyi:\n  return 0;\n}\n"}
{"label": "14", "index": "25502", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int n, i, sum[100000], temp[3], max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 0, max = -1, temp[0] = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      temp[0] = i;\n    }\n  }\n  for (i = 0, max = -1, temp[1] = 0; i < n; i++) {\n    if (i == temp[0])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[1] = i;\n      }\n    }\n  }\n  for (i = 0, max = -1, temp[2] = 0; i < n; i++) {\n    if (i == temp[0] || i == temp[1])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[2] = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[temp[0]].id, sum[temp[0]]);\n  printf(\"%d %d\\n\", stu[temp[1]].id, sum[temp[1]]);\n  printf(\"%d %d\", stu[temp[2]].id, sum[temp[2]]);\n}\n"}
{"label": "14", "index": "25503", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  struct student *next;\n};\nint m;\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  head = NULL;\n  while (n--) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    m = m - 1;\n  }\n  return (head);\n}\nint main() {\n  int max = 0;\n  int n, j;\n  cin >> n;\n  struct student *head, *p1, *p2;\n  head = creat(n);\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->chinese + p1->math) > max)\n        max = p1->chinese + p1->math, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p2->num, (p2->chinese + p2->math));\n    head = del(head, p2->num);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int chinese;\n  int math;\n  int total;\n} st[4], temp;\nint main() {\n  int n, cnt = 3;\n  cin >> n;\n  for (int i = 0; i < 3; i++) {\n    cin >> st[i].ID >> st[i].chinese >> st[i].math;\n    st[i].total = st[i].chinese + st[i].math;\n  }\n  do {\n    cin >> st[3].ID >> st[3].chinese >> st[3].math;\n    st[3].total = st[3].chinese + st[3].math;\n    cnt++;\n    for (int i = 1; i < 4; i++) {\n      for (int j = 0; j < 4 - i; j++) {\n        if (st[j + 1].total > st[j].total) {\n          temp = st[j];\n          st[j] = st[j + 1];\n          st[j + 1] = temp;\n        }\n      }\n    }\n  } while (cnt < n);\n  for (int i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", st[i].ID, st[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, i, first, second, third, x, y, z;\n  cin >> n;\n  struct mark {\n    int ID, chinese, math, sum;\n  } * num;\n  num = (struct mark *)malloc(sizeof(mark) * n);\n  int n1, c1, m1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &n1, &c1, &m1);\n    num[i].ID = n1;\n    num[i].chinese = c1;\n    num[i].math = m1;\n    num[i].sum = c1 + m1;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      first = num[i].sum;\n      second = num[i].sum;\n      third = num[i].sum;\n      x = num[i].ID;\n      y = num[i].ID;\n      z = num[i].ID;\n    } else if (i == 1) {\n      if (num[i].sum > first) {\n        first = num[i].sum;\n        x = num[i].ID;\n      } else {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n\n    } else {\n      if (num[i].sum > first) {\n        third = second;\n        z = y;\n        second = first;\n        y = x;\n        first = num[i].sum;\n        x = num[i].ID;\n      } else if (num[i].sum > second) {\n        third = second;\n        z = y;\n        second = num[i].sum;\n        y = num[i].ID;\n      } else if (num[i].sum > third) {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n    }\n  }\n  cout << x << \" \" << first << \"\\n\"\n       << y << \" \" << second << \"\\n\"\n       << z << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25506", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\n\nint main() {\n  int n, i, j, e;\n  scanf(\"%d\", &n);\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        e = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = e;\n        e = stu[j].ID;\n        stu[j].ID = stu[j + 1].ID;\n        stu[j + 1].ID = e;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].ID, stu[n - 1].zongfen,\n         stu[n - 2].ID, stu[n - 2].zongfen, stu[n - 3].ID, stu[n - 3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "25507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int nID, nChinese, nMath;\n};\nint main() {\n  int n, i, a1, a2, a3, t1, t2, t3, t;\n  struct Student students;\n  t1 = 0;\n  t2 = 0;\n  t3 = 0;\n  a1 = 0;\n  a2 = 0;\n  a3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &students.nID, &students.nChinese, &students.nMath);\n    t = students.nChinese + students.nMath;\n    if (t > t1) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t1;\n      a2 = a1;\n      t1 = t;\n      a1 = students.nID;\n    } else if (t > t2) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t;\n      a2 = students.nID;\n    } else if (t > t3) {\n      t3 = t;\n      a3 = students.nID;\n    }\n  }\n  printf(\"%d%s%d\\n\", a1, \" \", t1);\n  printf(\"%d %d\\n\", a2, t2);\n  printf(\"%d%s%d\\n\", a3, \" \", t3);\n  return 0;\n}\n"}
{"label": "14", "index": "25508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct ace {\n  char id[10];\n  int a;\n  int b;\n} o[3], r;\n\nint main() {\n  int n, i, s[3], m, j, v;\n  char z[10];\n  scanf(\"%d\", &n);\n\n  scanf(\"%s %d %d\", o[0].id, &o[0].a, &o[0].b);\n  cin >> o[1].id >> o[1].a >> o[1].b;\n  scanf(\"%s %d %d\", o[2].id, &o[2].a, &o[2].b);\n  s[0] = o[0].a + o[0].b;\n  s[1] = o[1].a + o[1].b;\n  s[2] = o[2].a + o[2].b;\n  for (i = 0; i < 2; i++) {\n    for (j = i + 1; j < 3; j++) {\n      if (s[i] < s[j]) {\n        strcpy(z, o[i].id);\n        strcpy(o[i].id, o[j].id);\n        strcpy(o[j].id, z);\n        v = s[i];\n        s[i] = s[j];\n        s[j] = v;\n      }\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    scanf(\"%s %d %d\", r.id, &r.a, &r.b);\n    m = r.a + r.b;\n    if (m > s[0]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = o[0];\n      s[1] = s[0];\n      o[0] = r;\n      s[0] = m;\n    } else if (m <= s[0] && m > s[1]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = r;\n      s[1] = m;\n    } else if (m <= s[1] && m > s[2]) {\n      o[2] = r;\n      s[2] = m;\n    }\n  }\n  printf(\"%s %d\\n\", o[0].id, s[0]);\n  printf(\"%s %d\\n\", o[1].id, s[1]);\n  printf(\"%s %d\\n\", o[2].id, s[2]);\n}\n"}
{"label": "14", "index": "25509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n  int chinese;\n  int math;\n  int num;\n} stu[100001];\nint main() {\n  int n, i, j, max[3][2] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].num = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (stu[i].num > max[j][0]) {\n        max[j][0] = stu[i].num;\n        max[j][1] = i + 1;\n      }\n    }\n    stu[max[j][1] - 1].num = 0;\n  }\n  for (j = 0; j < 3; j++)\n    cout << max[j][1] << ' ' << max[j][0] << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, max2 = 0, max3 = 0, t1 = 0, t2 = 0, t3 = 0;\n  int ID[100000], y[100000], m[100000], s[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &ID[i], &y[i], &m[i]);\n  for (i = 0; i < n; i++)\n    s[i] = y[i] + m[i];\n  for (i = 0; i < n; i++) {\n    if (max1 < s[i]) {\n      max1 = s[i];\n      t1 = i;\n    }\n  }\n  s[t1] = 0;\n  for (i = 0; i < n; i++) {\n    if (max2 < s[i]) {\n      max2 = s[i];\n      t2 = i;\n    }\n  }\n  s[t2] = 0;\n  for (i = 0; i < n; i++) {\n    if (max3 < s[i]) {\n      max3 = s[i];\n      t3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", ID[t1], max1);\n  cout << ID[t2] << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\\n\", ID[t3], max3);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k;\n  struct student temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > stu[i].total) {\n        k = j;\n        temp = stu[k];\n        stu[k] = stu[i];\n        stu[i] = temp;\n      }\n    }\n    if (i == 3)\n      break;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25512", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    printf(\"%d %d \", p1->id, p1->s);\n    p1->s = -1;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25513", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int chinese;\n  int math;\n  int total;\n} st[4], temp;\nint main() {\n  int n, cnt = 3;\n  cin >> n;\n  for (int i = 0; i < 3; i++) {\n    cin >> st[i].ID >> st[i].chinese >> st[i].math;\n    st[i].total = st[i].chinese + st[i].math;\n  }\n  do {\n    cin >> st[3].ID >> st[3].chinese >> st[3].math;\n    st[3].total = st[3].chinese + st[3].math;\n    cnt++;\n    for (int i = 1; i < 4; i++) {\n      for (int j = 0; j < 4 - i; j++) {\n        if (st[j + 1].total > st[j].total) {\n          temp = st[j];\n          st[j] = st[j + 1];\n          st[j + 1] = temp;\n        }\n      }\n    }\n  } while (cnt < n);\n  for (int i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", st[i].ID, st[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char number[20];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n} stu[100000], *s1, *s2, *s3;\n\nint n, max1 = 0, max2 = 0, max3 = 0;\n\nstruct student *creat(void) {\n  int i;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", &p1->number, &p1->chinese, &p1->math);\n    p2 = p1;\n    p1->sum = p1->chinese + p1->math;\n    if (p1->sum > max1) {\n      max3 = max2;\n      s3 = s2;\n      max2 = max1;\n      s2 = s1;\n      max1 = p1->sum;\n      s1 = p1;\n    } else if (p1->sum > max2) {\n      max3 = max2;\n      s3 = s2;\n      max2 = p1->sum;\n      s2 = p1;\n    } else if (p1->sum > max3) {\n      max3 = p1->sum;\n      s3 = p1;\n    }\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p1 = (struct student *)malloc(1000);\n  }\n  p1 = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *p;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%s %d \", s1->number, s1->sum);\n  printf(\"%s %d \", s2->number, s2->sum);\n  printf(\"%s %d\", s3->number, s3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t = 0, c = 1, d = 1, n, p = 0, q = 0, r = 0, *b;\n  struct pp {\n    int x;\n    int y;\n    int z;\n  } * s;\n  cin >> n;\n  b = (int *)malloc(sizeof(int) * n);\n  s = (struct pp *)malloc(sizeof(int) * 3 * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].x, &s[i].y, &s[i].z);\n    b[i] = ((s[i].y) + (s[i].z));\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > t) {\n      t = b[i];\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > c) && (i != p)) {\n        c = b[i];\n        q = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > d) && (i != p) && (i != q)) {\n        d = b[i];\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", s[p].x, b[p]);\n  cout << s[q].x << \" \" << b[q] << \"\\n\";\n  printf(\"%d %d\\n\", s[r].x, b[r]);\n  return 0;\n}\n"}
{"label": "14", "index": "25516", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, e = 0, max, y;\n  scanf(\"%d\", &n);\n  struct st {\n    int a;\n    int z;\n    int c;\n    int d;\n  } b[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].a, &b[i].z, &b[i].c);\n    b[i].d = b[i].z + b[i].c;\n  }\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (b[j].d > max) {\n        max = b[j].d;\n        y = j;\n      }\n    }\n    printf(\"%d %d\\n\", b[y].a, b[y].d);\n    e++;\n    b[y].d = 0;\n    if (e == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25517", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n} sdu[99999];\n\nint main() {\n  int N, i, j, s, t, m;\n  cin >> N;\n  for (i = 0; i < N; i++)\n    cin >> sdu[i].num >> sdu[i].chinese >> sdu[i].math;\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < N - j - 1; i++)\n      if ((sdu[i].chinese + sdu[i].math) >=\n          (sdu[i + 1].chinese + sdu[i + 1].math)) {\n        s = sdu[i].num;\n        t = sdu[i].chinese;\n        m = sdu[i].math;\n        sdu[i].num = sdu[i + 1].num;\n        sdu[i].chinese = sdu[i + 1].chinese;\n        sdu[i].math = sdu[i + 1].math;\n        sdu[i + 1].num = s;\n        sdu[i + 1].chinese = t;\n        sdu[i + 1].math = m;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", sdu[N - 1 - i].num,\n           sdu[N - 1 - i].chinese + sdu[N - 1 - i].math);\n  return 0;\n}\n"}
{"label": "14", "index": "25518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100000], t;\n\n  int n;\n  int i;\n  int k;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n\n  for (k = n - 1; k > n - 4; k--) {\n    for (i = 0; i < k; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        t = stu[i];\n        stu[i] = stu[i + 1];\n        stu[i + 1] = t;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  cout << stu[n - 2].num << \" \" << stu[n - 2].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} a[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chinese, &a[i].math);\n    a[i].total = a[i].chinese + a[i].math;\n  }\n  int max, numm;\n  max = a[1].total;\n  for (int j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (max < a[i].total) {\n        max = a[i].total;\n        numm = i;\n      }\n    }\n    cout << numm + 1 << \" \" << max << \"\\n\";\n    a[numm].total = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25520", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    printf(\"%d %d \", p1->id, p1->s);\n    p1->s = -1;\n  }\n}\n"}
{"label": "14", "index": "25521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} s[100001], first, second, third;\n\nint main() {\n  int n, i, temp1, temp2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].chinese >> s[i].math;\n    s[i].sum = s[i].chinese + s[i].math;\n  }\n  first.sum = 0, second.sum = 0, third.sum = 0;\n  for (i = 0; i < n; i++) {\n    if (first.sum < s[i].sum) {\n      first = s[i];\n      temp1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second.sum < s[i].sum && s[i].num != s[temp1].num) {\n      second = s[i];\n      temp2 = i;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (third.sum < s[i].sum && s[i].num != s[temp1].num &&\n        s[i].num != s[temp2].num)\n      third = s[i];\n  cout << first.num << \" \" << first.sum << endl;\n  printf(\"%d %d\\n\", second.num, second.sum);\n  cout << third.num << \" \" << third.sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int maths;\n} stu[100000];\n\nint main() {\n  int i, j, n, sum[100000], max = 0, m;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].maths;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        m = i;\n      }\n    }\n    printf(\"%d %d\\n\", stu[m].num, sum[m]);\n    sum[m] = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "25523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int mathematics;\n    int sum;\n  } temp;\n  struct student stu[100000];\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].mathematics);\n    stu[i].sum = stu[i].chinese + stu[i].mathematics;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int id, chin, math, z;\n  } p[100000];\n  int id, math, chin, z, i, n, f, s, t, id1, id2, id3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> id >> chin >> math;\n    p[i].id = id;\n    p[i].math = math;\n    p[i].chin = chin;\n  }\n\n  for (i = 0; i < n; i++) {\n    id = p[i].id;\n    math = p[i].math;\n    chin = p[i].chin;\n    z = math + chin;\n\n    if (i == 0) {\n      f = s = t = z;\n      id1 = id2 = id3 = id;\n    } else if (i == 1) {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else {\n        t = s = z;\n        id2 = id3 = id;\n      }\n    } else {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else if (z > s) {\n        t = s;\n        id3 = id2;\n        s = z;\n        id2 = id;\n      } else {\n        if (z > t) {\n          t = z;\n          id3 = id;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", id1, f);\n  cout << id2 << \" \" << s << \"\\n\";\n  printf(\"%d %d\\n\", id3, t);\n  return 0;\n}\n"}
{"label": "14", "index": "25525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  long int num;\n  int point1;\n  int point2;\n  int sum;\n  struct data *next;\n};\nstruct data *creat(long int n) {\n  long int i = 0;\n  struct data *p1, *p2, *head;\n  p1 = p2 = (struct data *)malloc(sizeof(struct data));\n  scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n  p1->sum = p1->point1 + p1->point2;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n    p1->sum = p1->point1 + p1->point2;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct data *max(struct data *head) {\n  struct data *p1, *max;\n  max = head;\n  p1 = head;\n  do {\n    if (p1->sum > max->sum)\n      max = p1;\n    p1 = p1->next;\n  } while (p1 != NULL);\n  return (max);\n}\nstruct data *del(struct data *head, struct data *max) {\n  struct data *p1, *p2;\n  p1 = head;\n  while (max != p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head)\n    head = p1->next;\n  else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\nint main() {\n  struct data *a, *b, *c, *head;\n  long int n;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  a = max(head);\n  printf(\"%ld %d\\n\", a->num, a->sum);\n  head = del(head, a);\n  b = max(head);\n  printf(\"%ld %d\\n\", b->num, b->sum);\n  c = max(del(head, b));\n  printf(\"%ld %d\\n\", c->num, c->sum);\n}\n"}
{"label": "14", "index": "25526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n} stu[100000], max_1, secondmax_1, thirdmax_1;\nint main() {\n  max_1.sum = secondmax_1.sum = thirdmax_1.sum = 0;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].score1 >> stu[i].score2;\n    stu[i].sum = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max_1.sum)\n      max_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < max_1.sum && stu[i].sum > secondmax_1.sum)\n      secondmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == max_1.sum && stu[i].num != max_1.num) {\n      secondmax_1 = stu[i];\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < secondmax_1.sum && stu[i].sum > thirdmax_1.sum)\n      thirdmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == secondmax_1.sum && stu[i].num != max_1.num &&\n        stu[i].num != secondmax_1.num) {\n      thirdmax_1 = stu[i];\n      break;\n    }\n  }\n  cout << max_1.num << \" \" << max_1.sum << \" \" << secondmax_1.num << \" \"\n       << secondmax_1.sum << \" \" << thirdmax_1.num << \" \" << thirdmax_1.sum;\n  return 0;\n}\n"}
{"label": "14", "index": "25527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char id[10];\n  int ch;\n  int ma;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, max, sec, min, total[100000];\n  scanf(\"%d\", &n);\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", stu[i].id, &stu[i].ch, &stu[i].ma);\n    total[i] = stu[i].ch + stu[i].ma;\n  }\n\n  max = 0;\n\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[max])\n      max = i;\n  }\n\n  printf(\"%s %d\\n\", stu[max].id, total[max]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[max]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  sec = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[sec])\n      sec = i;\n  }\n\n  printf(\"%s %d\\n\", stu[sec].id, total[sec]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[sec]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[min])\n      min = i;\n  }\n\n  printf(\"%s %d\\n\", stu[min].id, total[min]);\n  return 0;\n}\n"}
{"label": "14", "index": "25528", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } stu1, stu2, stu3, temp;\n  int i, n;\n  stu1.total = 0;\n  stu2.total = 0;\n  stu3.total = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.total = temp.chinese + temp.math;\n    if (temp.total > stu1.total) {\n      stu3 = stu2;\n      stu2 = stu1;\n      stu1 = temp;\n    } else if (temp.total <= stu1.total && temp.total > stu2.total) {\n      stu3 = stu2;\n      stu2 = temp;\n    } else if (temp.total <= stu2.total && temp.total > stu3.total)\n      stu3 = temp;\n  }\n  printf(\"%d %d\\n\", stu1.ID, stu1.total);\n  printf(\"%d %d\\n\", stu2.ID, stu2.total);\n  printf(\"%d %d\\n\", stu3.ID, stu3.total);\n}\n"}
{"label": "14", "index": "25529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yuwen;\n  int shuxue;\n  int sum;\n} score[100000];\nint main() {\n  int n, i, a, b, c, a1, b1, c1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &score[i].num, &score[i].yuwen, &score[i].shuxue);\n    score[i].sum = score[i].shuxue + score[i].yuwen;\n  }\n  a = 0;\n  b = 0;\n  c = 0;\n  a1 = 0;\n  b1 = 0;\n  c1 = 0;\n  for (i = 0; i < n; i++) {\n    if (score[i].sum > a) {\n      c = b;\n      b = a;\n      a = score[i].sum;\n      c1 = b1;\n      b1 = a1;\n      a1 = score[i].num;\n    } else if (score[i].sum > b) {\n      c = b;\n      b = score[i].sum;\n      c1 = b1;\n      b1 = score[i].num;\n    } else if (score[i].sum > c) {\n      c = score[i].sum;\n      c1 = score[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a1, a, b1, b, c1, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a = 0, b = 0, c = 0;\n  int an, bn, cn;\n  int n, i, sum = 0;\n  struct student {\n    int num, ch, math;\n  } students[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &students[i].num, &students[i].ch, &students[i].math);\n    sum = students[i].ch + students[i].math;\n    if (sum > c) {\n      c = sum;\n      cn = i;\n    }\n    if (sum > b) {\n      c = b;\n      cn = bn;\n      b = sum;\n      bn = i;\n    }\n    if (sum > a) {\n      b = a;\n      bn = an;\n      a = sum;\n      an = i;\n    }\n  }\n  printf(\"%d %d\\n\", students[an].num, a);\n  printf(\"%d %d\\n\", students[bn].num, b);\n  printf(\"%d %d\\n\", students[cn].num, c);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int n;\n  int a;\n  int b;\n  int aver;\n} stu[100000];\nint main() {\n  int m, i, j, f, t;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%d%d\", &stu[i].n, &stu[i].a, &stu[i].b);\n  }\n  for (i = 0; i < m; i++) {\n    stu[i].aver = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = m - 1 - i; j >= 0; j--) {\n      if (stu[j].aver < stu[j + 1].aver) {\n        f = stu[j].aver;\n        stu[j].aver = stu[j + 1].aver;\n        stu[j + 1].aver = f;\n        t = stu[j].n;\n        stu[j].n = stu[j + 1].n;\n        stu[j + 1].n = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].n, stu[i].aver);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p1, *p2;\n  int i = 1;\n  head = NULL;\n  p2 = p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->b + p1->c;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i >= n)\n      break;\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->a >> p1->b >> p1->c;\n    p1->d = p1->b + p1->c;\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct stu *z, *p3, *p[100007], *q;\n  int i = 0, j, m;\n  scanf(\"%d\", &n);\n  z = creat();\n  p3 = p[i] = z;\n  while (p3 != NULL) {\n    i++;\n    p[i] = p3->next;\n    p3 = p[i];\n  }\n  m = i;\n  q = p[0];\n  for (i = 0; i < 4; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[j]->d >= p[j + 1]->d) {\n        q = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = q;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++)\n    cout << p[m - i]->a << \" \" << p[m - i]->d << \" \";\n}\n"}
{"label": "14", "index": "25533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nstruct student stu[100000];\nint sum[100000];\nint main(int argc, char *argv[]) {\n\n  int a, b, c, num1, num2, num3;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].math;\n  }\n  a = sum[0];\n  num1 = 1;\n  if (a < sum[1]) {\n    b = a;\n    num2 = num1;\n    a = sum[1];\n    num1 = 2;\n  } else {\n    b = sum[1];\n    num2 = 2;\n  }\n  c = 0;\n  for (i = 2; i < n; i++) {\n    if (a < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = a;\n      num2 = num1;\n      a = sum[i];\n      num1 = i + 1;\n    } else if (b < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = sum[i];\n      num2 = i + 1;\n    } else {\n      if (c < sum[i]) {\n        c = sum[i];\n        num3 = i + 1;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", num1, a);\n  cout << num2 << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", num3, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i, b[100000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].chinese);\n    scanf(\"%d\", &a[i].maths);\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "25535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  struct student *next;\n};\nint n, max0;\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  head = p1;\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->maths);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->maths);\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\n\nvoid max(struct student *head, int x, int y) {\n  struct student *p1, *temp, *p2;\n  temp = (struct student *)malloc(sizeof(struct student));\n  temp->chinese = temp->maths = 0;\n  for (p2 = head; p2 != NULL; p2 = p2->next)\n    if (p2->chinese + p2->maths == x)\n      break;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if ((p1->chinese + p1->maths > temp->chinese + temp->maths) &&\n        (p1->chinese + p1->maths != x ||\n         p1->chinese + p1->maths == x && p1->num != p2->num) &&\n        (p1->chinese + p1->maths != y)) {\n      temp->chinese = p1->chinese;\n      temp->maths = p1->maths;\n      temp->num = p1->num;\n    }\n  max0 = temp->chinese + temp->maths;\n  cout << temp->num << \" \" << max0 << \" \";\n}\nint main() {\n  struct student *head;\n  int max1, max2;\n  scanf(\"%d\", &n);\n  head = creat();\n  max(head, 0, 0);\n  max1 = max0;\n  max(head, max1, 0);\n  max2 = max0;\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "25536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int yu;\n    int shu;\n    char name[6];\n  };\n  struct stu s[100000], one, two, three;\n  one.yu = 0;\n  one.shu = 0;\n  two.yu = 0;\n  two.shu = 0;\n  three.yu = 0;\n  three.shu = 0;\n  int n, j, k;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    cin >> s[j].name >> s[j].yu >> s[j].shu;\n  }\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (one.yu + one.shu)) {\n      one = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (two.yu + two.shu)) {\n      two = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (three.yu + three.shu)) {\n      three = s[j];\n    }\n  }\n  printf(\"%s %d\\n%s %d\\n%s %d\\n\", one.name, one.yu + one.shu, two.name,\n         two.yu + two.shu, three.name, three.yu + three.shu);\n  return 0;\n}\n"}
{"label": "14", "index": "25537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n    struct stu *next;\n    struct stu *back;\n  };\n  struct stu *head, *p1, *p2, *p, *pmax1, *pmax2, *pmax3;\n  int n, i, j, max1, max2, max3;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->back = p2;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p = head;\n  max1 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max1 < (p->b + p->c)) {\n      max1 = p->b + p->c;\n      pmax1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max2 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max2 < (p->b + p->c) && (p != pmax1)) {\n      max2 = p->b + p->c;\n      pmax2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max3 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max3 < (p->b + p->c) && (p != pmax1) && (p != pmax2)) {\n      max3 = p->b + p->c;\n      pmax3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%ld %d\\n\", pmax1->a, (pmax1->b + pmax1->c));\n  printf(\"%d %d\\n\", pmax2->a, (pmax2->b + pmax2->c));\n  printf(\"%ld %d\\n\", pmax3->a, (pmax3->b + pmax3->c));\n  return 0;\n}\n"}
{"label": "14", "index": "25538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i, b[100000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].chinese);\n    cin >> a[i].maths;\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  cout << a[0].num << \" \" << a[0].chinese + a[0].maths << \"\\n\";\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "25539", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct linknode *CreateLinkList();\nvoid DisplayLinkList(struct linknode *linklist1);\nvoid qiansan(struct linknode *linklist2);\nstruct linknode {\n  int id;\n  int chinese;\n  int math;\n  int total;\n  int mark;\n  struct linknode *next;\n};\nint main() { qiansan(CreateLinkList()); }\nstruct linknode *CreateLinkList() {\n  long n, i;\n  struct linknode *head, *p;\n  scanf(\"%ld\", &n);\n  head = (struct linknode *)malloc(sizeof(struct linknode));\n  p = head;\n  if (p == NULL) {\n    printf(\"fail\");\n    exit(-1);\n  }\n  for (i = 1; i <= n; i++) {\n    cin >> p->id >> p->chinese >> p->math;\n    p->total = p->chinese + p->math;\n    p->mark = 0;\n    if (i == n)\n      p->next = NULL;\n    else {\n      p->next = (struct linknode *)malloc(sizeof(struct linknode));\n      p = p->next;\n    }\n  }\n  return head;\n}\nvoid qiansan(struct linknode *linklist2) {\n  struct linknode *head, *p, *max;\n\n  head = linklist2;\n  p = head;\n  max = (struct linknode *)malloc(sizeof(struct linknode));\n  int j;\n  for (j = 1; j <= 3; j++) {\n    p = head;\n    max->total = 0;\n    while (p != NULL) {\n      if (p->total > max->total && p->mark == 0) {\n        max = p;\n      }\n      p = p->next;\n    }\n    max->mark = 1;\n    printf(\"%d %d\\n\", max->id, max->total);\n  }\n}\n"}
{"label": "14", "index": "25540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long int n, a[100000][2];\n  int i, j, t, s;\n  struct Student {\n    int num;\n    int yu;\n    int shu;\n  };\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    struct Student studenti;\n    scanf(\"%d%d%d\", &studenti.num, &studenti.yu, &studenti.shu);\n    a[i][0] = studenti.num;\n    a[i][1] = studenti.yu + studenti.shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j][1] >= a[j + 1][1]) {\n        t = a[j][1];\n        a[j][1] = a[j + 1][1];\n        a[j + 1][1] = t;\n        s = a[j][0];\n        a[j][0] = a[j + 1][0];\n        a[j + 1][0] = s;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    cout << a[n - i][0] << \" \" << a[n - i][1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long id;\n  int chinese;\n  int math;\n  int score;\n  struct student *next;\n};\n\nstruct student *creat(void) {\n  int num;\n  struct student *head, *p, *q;\n  q = NULL;\n  head = (struct student *)malloc(1000);\n  p = head;\n  scanf(\"%d\", &num);\n  while (num > 0) {\n    q = p;\n    scanf(\"%ld%d%d\", &p->id, &p->chinese, &p->math);\n    p->score = p->chinese + p->math;\n    p = (struct student *)malloc(1000);\n    q->next = p;\n    num--;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i;\n  struct student *p, *head, *max[3];\n  head = creat();\n  p = head;\n  for (i = 0; i <= 2; i++) {\n    max[i] = (struct student *)malloc(1000);\n    max[i]->score = 0;\n  }\n  for (; p != NULL; p = p->next) {\n    if (p->score > max[0]->score) {\n      max[2] = max[1];\n      max[1] = max[0];\n      max[0] = p;\n    } else if (p->score > max[1]->score) {\n      max[2] = max[1];\n      max[1] = p;\n    } else if (p->score > max[2]->score) {\n      max[2] = p;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%ld %d \", max[i]->id, max[i]->score);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25542", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct grade {\n  int num;\n  int chinese;\n  int math;\n  int all;\n} stu[100000];\nint main() {\n  int n, i, e, f, g, a, b, c;\n  e = 0;\n  f = 0;\n  g = 0;\n  a = 0;\n  b = 0;\n  c = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all > e) {\n      e = stu[i].all;\n      a = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= e && stu[i].all > f && i != a) {\n      f = stu[i].all;\n      b = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= f && stu[i].all > g && i != a && i != b) {\n      g = stu[i].all;\n      c = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a].num, stu[a].all);\n  printf(\"%d %d\\n\", stu[b].num, stu[b].all);\n  printf(\"%d %d\\n\", stu[c].num, stu[c].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25543", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  char ID[20];\n  int math, cn;\n};\n\nint main() {\n  int n, i, j, max, m;\n  int *s;\n  struct grade stu[100000];\n  scanf(\"%d\", &n);\n  s = (int *)malloc(n * sizeof(int));\n  if (n == 1) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    printf(\"%s %d\", stu[0].ID, stu[0].math + stu[0].cn);\n  } else if (n == 2) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    scanf(\"%s %d %d\", stu[1].ID, &stu[1].math, &stu[1].cn);\n    if (stu[0].math + stu[0].cn > stu[1].math + stu[1].cn) {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    } else {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    }\n  } else if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      cin >> stu[i].ID >> stu[i].math >> stu[i].cn;\n      s[i] = stu[i].math + stu[i].cn;\n    }\n    for (i = 1; i < 4; i++) {\n      max = s[0];\n      for (j = 1; j < n; j++) {\n        if (s[j] > max) {\n          max = s[j];\n          m = j;\n        }\n      }\n      printf(\"%s %d\\n\", stu[m].ID, max);\n      s[m] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int a, b, c;\n  } student_1;\n  int x, i = 0;\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;\n  while (i < n) {\n    scanf(\"%d%d%d\", &student_1.a, &student_1.b, &student_1.c);\n    x = student_1.b + student_1.c;\n    if (x > a2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = a1;\n      b2 = a2;\n      a1 = student_1.a;\n      a2 = x;\n    } else if (x == a2) {\n      if (x > b2) {\n        c1 = b1;\n        c2 = b2;\n        b1 = student_1.a;\n        b2 = x;\n      } else if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > b2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = student_1.a;\n      b2 = x;\n    } else if (x == b2) {\n      if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > c2) {\n      c1 = student_1.a;\n      c2 = x;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n\", a1, a2);\n  printf(\"%d %d\\n\", b1, b2);\n  printf(\"%d %d\\n\", c1, c2);\n  return 0;\n}\n"}
{"label": "14", "index": "25545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int ID, chin, math;\n  };\n  stu *pp;\n  int sum, second, third, x, y, z;\n  int i, n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  pp = (struct stu *)malloc(sizeof(stu) * n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    (pp + i)->ID = a;\n    (pp + i)->chin = b;\n    (pp + i)->math = c;\n  }\n  sum = ((pp + i)->chin) + ((pp + i)->math);\n  for (i = 1; i <= n; i++) {\n    if (i == 1) {\n      sum = ((pp + i)->chin) + ((pp + i)->math);\n      second = ((pp + i)->chin) + ((pp + i)->math);\n      third = ((pp + i)->chin) + ((pp + i)->math);\n      x = (pp + i)->ID;\n      y = (pp + i)->ID;\n      z = (pp + i)->ID;\n\n    } else if (i == 2) {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        y = x;\n        x = (pp + i)->ID;\n      } else {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    } else {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = x;\n        x = (pp + i)->ID;\n      } else if (second < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = (pp + i)->ID;\n      } else if (third < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x, sum);\n  cout << y << \" \" << second << \"\\n\";\n  printf(\"%d %d\\n\", z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25546", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  long Id;\n  int yuwen;\n  int shuxue;\n};\n\nint main() {\n  int i, j;\n  long n;\n  struct Student student[1000];\n  struct Student temp;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%ld%d%d\", &student[i].Id, &student[i].yuwen, &student[i].shuxue);\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < (3 - i - 1); j++) {\n      if ((student[j + 1].yuwen + student[j + 1].shuxue) >\n          (student[j].yuwen + student[j].shuxue)) {\n        temp = student[j + 1];\n        student[j + 1] = student[j];\n        student[j] = temp;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[2].yuwen + student[2].shuxue)) {\n      student[2] = student[i];\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[1].yuwen + student[1].shuxue)) {\n      temp = student[1];\n      student[1] = student[i];\n      student[2] = temp;\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[0].yuwen + student[0].shuxue)) {\n      temp = student[0];\n      student[0] = student[i];\n      student[1] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %d \", student[i].Id, (student[i].shuxue + student[i].yuwen));\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25547", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct r {\n    int a;\n    int b;\n    int c;\n  } r[99999];\n  int i, n, x = 0, y = 0, z = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    cin >> r[i].a >> r[i].b >> r[i].c;\n\n  for (i = 1; i <= n; i++) {\n    if (r[i].b + r[i].c > m1) {\n      m1 = r[i].b + r[i].c;\n      x = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m1) && (i != x)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    } else if ((m1 > r[i].b + r[i].c) && (r[i].b + r[i].c > m2)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m2) && (i != y) && (i != x)) {\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n\n    else if ((m2 > r[i].b + r[i].c) && (r[i].b + r[i].c > m3)) {\n\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", x, m1);\n  printf(\"%d %d\\n\", y, m2);\n  printf(\"%d %d\\n\", z, m3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25548", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct data {\n  long int num;\n  int point1;\n  int point2;\n  int sum;\n  struct data *next;\n};\nstruct data *creat(long int n) {\n  long int i = 0;\n  struct data *p1, *p2, *head;\n  p1 = p2 = (struct data *)malloc(sizeof(struct data));\n  scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n  p1->sum = p1->point1 + p1->point2;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct data *)malloc(sizeof(struct data));\n    cin >> p1->num >> p1->point1 >> p1->point2;\n    p1->sum = p1->point1 + p1->point2;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct data *max(struct data *head) {\n  struct data *p1, *max;\n  max = head;\n  p1 = head;\n  do {\n    if (p1->sum > max->sum)\n      max = p1;\n    p1 = p1->next;\n  } while (p1 != NULL);\n  return (max);\n}\nstruct data *del(struct data *head, struct data *max) {\n  struct data *p1, *p2;\n  p1 = head;\n  while (max != p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head)\n    head = p1->next;\n  else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\nint main() {\n  struct data *a, *b, *c, *head;\n  long int n;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  a = max(head);\n  printf(\"%ld %d\\n\", a->num, a->sum);\n  head = del(head, a);\n  b = max(head);\n  printf(\"%ld %d\\n\", b->num, b->sum);\n  c = max(del(head, b));\n  printf(\"%ld %d\\n\", c->num, c->sum);\n}\n"}
{"label": "14", "index": "25549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, max;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    struct student *next;\n  };\n  struct student *head, *ppre, *p0, *p3;\n  struct student *p1, *p2;\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (j = 0; j < 3; j++) {\n    ppre = p1 = head;\n    max = p1->yuwen + p1->shuxue;\n    p1 = p1->next;\n    for (i = 0; i < n - j; i++) {\n      if ((p1->yuwen + p1->shuxue) > max) {\n        max = p1->yuwen + p1->shuxue;\n        p0 = p1;\n        p3 = ppre;\n      }\n      ppre = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p0->num, max);\n    p3->next = p0->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, max, m;\n  scanf(\"%d\", &n);\n  struct stu {\n    int hao, yuwen, shuxue, zong;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\"\n          \"%d\"\n          \"%d\",\n          &stu[i].hao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zong = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[0].zong;\n    for (j = 1; j < n; j++) {\n      if (stu[j].zong > max) {\n        max = stu[j].zong;\n        m = j;\n      }\n    }\n    cout << stu[m].hao << \" \" << max << \"\\n\";\n    stu[m].zong = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25551", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> form[i].num >> form[i].chinese >> form[i].math;\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3 && i < n; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25552", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int Chinese;\n  int math;\n  int sum;\n} zz[100000], mx, mx1, mx2;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].ID >> zz[i].Chinese >> zz[i].math;\n    zz[i].sum = zz[i].Chinese + zz[i].math;\n  }\n  mx = zz[0];\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx.sum)\n      mx = zz[i];\n  }\n  cout << mx.ID << ' ' << mx.sum << endl;\n  mx.sum = 0;\n  mx1 = mx;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx1.sum) {\n      if (zz[i].ID == mx.ID)\n        continue;\n      mx1 = zz[i];\n    }\n  }\n  cout << mx1.ID << ' ' << mx1.sum << endl;\n  mx1.sum = 0;\n  mx2 = mx1;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx2.sum) {\n      if (zz[i].ID == mx.ID || zz[i].ID == mx1.ID)\n        continue;\n      mx2 = zz[i];\n    }\n  }\n  printf(\"%d %d\\n\", mx2.ID, mx2.sum);\n}\n"}
{"label": "14", "index": "25553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} student[1000000];\nvoid swap(int *a, int *b);\nint main(int argc, char *argv[]) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i = 0, j = 0, total[1000000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].xuehao, &student[i].yuwen, &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0 + i; j--) {\n      if (total[j] > total[j - 1]) {\n        swap(&total[j], &total[j - 1]);\n        swap(&student[j - 1].xuehao, &student[j].xuehao);\n        swap(&student[j - 1].yuwen, &student[j].yuwen);\n        swap(&student[j - 1].shuxue, &student[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].xuehao, total[i]);\n  }\n  return 0;\n}\nvoid swap(int *a, int *b) {\n  int e;\n  e = *a;\n  *a = *b;\n  *b = e;\n}\n"}
{"label": "14", "index": "25554", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num, a, b;\n  struct student *next;\n};\nint n;\nstruct student *create(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  i = 1;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n  head = NULL;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *h, *x;\n  scanf(\"%d\", &n);\n  head = create();\n  h = x = head;\n  int(*p)[2], m, j, s, i;\n  p = (int(*)[2])calloc(100000, 2 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    p[i][1] = h->a + h->b;\n    p[i][0] = h->num;\n    h = x->next;\n    x = h;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (p[j][1] >= p[j + 1][1]) {\n        m = p[j][1];\n        p[j][1] = p[j + 1][1];\n        p[j + 1][1] = m;\n        s = p[j][0];\n        p[j][0] = p[j + 1][0];\n        p[j + 1][0] = s;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d \", p[i][0], p[i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "25555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n};\nstruct student stu[100000];\nint main() {\n  long i, m;\n  scanf(\"%ld\", &m);\n  struct student *p = stu;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d%d%d\", &(p->num), &(p->score1), &(p->score2));\n    p->total = (p->score1 + p->score2);\n  }\n  int max1, max2, max3, a1 = 0, a2 = 0, a3 = 0;\n  max1 = stu[0].total;\n  for (i = 0; i < m; i++) {\n    if (stu[i].total > max1) {\n      max1 = stu[i].total;\n      a1 = i;\n    }\n  }\n  max2 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max2 && i != a1) {\n      max2 = stu[i].total;\n      a2 = i;\n    }\n  }\n  max3 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max3 && stu[i].total < max2) {\n      max3 = stu[i].total;\n      a3 = i;\n    }\n  }\n  cout << stu[a1].num << \" \" << stu[a1].total << \"\\n\";\n  cout << stu[a2].num << \" \" << stu[a2].total << \"\\n\";\n  printf(\"%d %d\", stu[a3].num, stu[a3].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int ma;\n};\n\nint main() {\n  int n, i, j, score[100000], max[2];\n  struct stu STU[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> STU[i].num >> STU[i].ch >> STU[i].ma;\n    score[i] = STU[i].ch + STU[i].ma;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (score[i] > max[1]) {\n        max[0] = STU[i].num;\n        max[1] = score[i];\n      }\n    }\n    cout << max[0] << \" \" << max[1] << \"\\n\";\n    max[1] = 0;\n    int temp = max[0];\n    score[temp - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25557", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25558", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int math_grade;\n  int chi_grade;\n  int sum;\n} stu[100000];\nint main() {\n  int i, j, n, max, temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id;\n    scanf(\"%d\", &stu[i].math_grade);\n    cin >> stu[i].chi_grade;\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math_grade + stu[i].chi_grade;\n  for (i = 0; i < 3; i++) {\n    max = stu[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].sum > max) {\n        temp1 = stu[i].id;\n        stu[i].id = stu[j].id;\n        stu[j].id = temp1;\n        temp2 = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = temp2;\n        max = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 2; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n  printf(\"%d %d\", stu[2].id, stu[2].sum);\n}\n"}
{"label": "14", "index": "25559", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int Chinese;\n  int math;\n  int sum;\n};\n\nint main() {\n  int i, n, p, q, r, b = 0, c = 0, d = 0;\n  struct student a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].Chinese, &a[i].math);\n    a[i].sum = a[i].Chinese + a[i].math;\n    if (i == 0)\n      p = q = r = a[i].sum;\n    else {\n      if (a[i].sum > p) {\n        r = q;\n        q = p;\n        p = a[i].sum;\n        d = c;\n        c = b;\n        b = i;\n      } else if (a[i].sum > q) {\n        r = q;\n        q = a[i].sum;\n        d = c;\n        c = i;\n      } else if (a[i].sum > r) {\n        r = a[i].sum;\n        d = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a[b].num, a[b].sum, a[c].num, a[c].sum,\n         a[d].num, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25560", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n\n  int total;\n};\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  struct student a[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    int b, c;\n    cin >> a[i].number >> b >> c;\n    a[i].total = b + c;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j].total > a[i].total) {\n        t = a[i].total;\n        a[i].total = a[j].total;\n        a[j].total = t;\n        t = a[i].number;\n        a[i].number = a[j].number;\n        a[j].number = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << a[i].number << ' ' << a[i].total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct score *next;\n};\nint n;\n\nstruct score *creat() {\n  struct score *p1, *p2, *head;\n  head = p2 = (struct score *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->num, &p2->yuwen, &p2->shuxue);\n  p2->total = p2->shuxue + p2->yuwen;\n  n--;\n  while (n--) {\n    p1 = (struct score *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->total = p1->shuxue + p1->yuwen;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid search(struct score *head) {\n  struct score *p;\n  int i, max;\n  for (i = 0; i < 3; i++) {\n    max = 0;\n    p = head;\n    while (p != NULL) {\n      if (p->total > max) {\n        max = p->total;\n      }\n      p = p->next;\n    }\n    p = head;\n    while (p != NULL) {\n      if (p->total == max) {\n        cout << p->num << \" \" << p->total << \" \";\n        p->total = 0;\n        break;\n      }\n      p = p->next;\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  struct score *head;\n  head = creat();\n  search(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n  struct student *next;\n};\nint m, max_1[3] = {0}, t[3] = {0};\nstruct student *head;\nstruct student *p1, *p2;\nstruct student *creat(int n) {\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n  p1->sum = p1->chinese + p1->maths;\n  head = NULL;\n  while (m < n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n    p1->sum = p1->chinese + p1->maths;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  creat(n);\n  struct student *p1;\n  p1 = head;\n  do {\n    if (p1->sum > max_1[0]) {\n      max_1[0] = p1->sum;\n      t[0] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[0], max_1[0]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[1] && p1->num != t[0]) {\n      max_1[1] = p1->sum;\n      t[1] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  cout << t[1] << \" \" << max_1[1] << \" \";\n  p1 = head;\n  do {\n    if (p1->sum > max_1[2] && p1->num != t[0] && p1->num != t[1]) {\n      max_1[2] = p1->sum;\n      t[2] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  cout << t[2] << \" \" << max_1[2] << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000], b[100000], d[100000], i, j, n, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &d[i]);\n    d[i] = b[i] + d[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (d[j] > d[j - 1]) {\n        t = d[j];\n        s = a[j];\n        d[j] = d[j - 1];\n        a[j] = a[j - 1];\n        d[j - 1] = t;\n        a[j - 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i], d[i]);\n}\n"}
{"label": "14", "index": "25564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  float num;\n  float chi, mat, total;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%f %f %f\", &p1->num, &p1->chi, &p1->mat);\n    p1->total = p1->chi + p1->mat;\n    if (i == 0) {\n      head = p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  int n, i, j;\n  float max;\n  struct stu *head, *maxi, *p;\n  scanf(\"%d\", &n);\n  head = creat(n);\n\n  for (i = 0; i < 3; i++) {\n    p = head;\n    maxi = head;\n    max = head->total;\n    for (j = 0; j < n - 1; j++) {\n      p = p->next;\n      if (p->total > max) {\n        max = p->total;\n        maxi = p;\n      }\n    }\n\n    printf(\"%g %g\\n\", maxi->num, maxi->total);\n    maxi->total = 0;\n  }\n}\n"}
{"label": "14", "index": "25565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n  } data[100000];\n  int n, i, max, x, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data[i].xh, &data[i].yw, &data[i].sx);\n    data[i].zf = data[i].yw + data[i].sx;\n  }\n  for (i = 0; i < 3; i++) {\n    max = data[0].zf;\n    x = 0;\n    for (j = 1; j < n; j++) {\n      if (data[j].zf > max) {\n        max = data[j].zf;\n        x = j;\n      }\n    }\n    printf(\"%d %d\\n\", data[x].xh, data[x].zf);\n    data[x].zf = 0;\n  }\n}\n"}
{"label": "14", "index": "25566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int zongfen;\n};\nint main() {\n  int n, i = 1, j;\n  int a[100001];\n  struct student stu[100001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].math, &stu[i].chinese);\n    stu[i].zongfen = stu[i].math + stu[i].chinese;\n    if (i < 4)\n      j = i;\n    else {\n      j = 4;\n    }\n    {\n      for (; j > 1 && stu[i].zongfen > stu[a[j - 1]].zongfen; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << stu[a[i]].id << \" \" << stu[a[i]].zongfen << \" \";\n  }\n  getchar();\n  getchar();\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "14", "index": "25567", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int sum[100000];\n  int max1, max2, max3;\n  int x = 0;\n  cin >> n;\n  struct {\n    int number;\n    int chin;\n    int math;\n  } student[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].number, &student[i].chin, &student[i].math);\n    sum[i] = student[i].chin + student[i].math;\n  }\n  max1 = sum[0];\n  max2 = sum[0];\n  max3 = sum[0];\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max1)\n      max1 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sum[i] == max1) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n    if (x >= 3)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max2) && (sum[i] != max1))\n      max2 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max2) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max3) && (sum[i] != max1) && (sum[i] != max2))\n      max3 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max3) {\n      printf(\"%d %d\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n\n    int id;\n    int chi;\n    int mat;\n    int sum;\n  } stu[100000], t;\n  int i, j, n, student_num;\n  scanf(\"%d\", &student_num);\n  n = student_num;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chi, &stu[i].mat);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  for (i = 0; i < n; i++) {\n    if (stu[0].sum < stu[i].sum) {\n      t = stu[0];\n      stu[0] = stu[i];\n      stu[i] = t;\n    }\n  }\n  for (i = 1; i < n; i++)\n    if (stu[1].sum < stu[i].sum) {\n      t = stu[1];\n      stu[1] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 2; i < n; i++)\n    if (stu[2].sum < stu[i].sum) {\n      t = stu[2];\n      stu[2] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].id << \" \" << stu[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int c;\n  int m;\n  int sum;\n  struct student *next;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p0, *p, *q;\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    q = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &q->num, &q->c, &q->m);\n    q->sum = q->c + q->m;\n    q->next = NULL;\n    p0 = head;\n    p = p0->next;\n    j = 0;\n    while (p != NULL && q->sum <= p->sum) {\n      p0 = p;\n      p = p->next;\n      j++;\n      if (j > 3) {\n        goto A;\n      }\n    }\n    p0->next = q;\n    q->next = p;\n  A:\n    continue;\n  }\n  p = head->next;\n  for (i = 0; i < 3; i++) {\n    cout << p->num << \" \" << p->sum << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int c;\n};\nint main() {\n  int n, i, j, m, t;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].c = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        t = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        m = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].c);\n}\n"}
{"label": "14", "index": "25571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n}\n"}
{"label": "14", "index": "25572", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, q, w;\n  scanf(\"%d \", &n);\n  int a[n], b[n], c[n], d[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    d[i] = b[i] + c[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i] < d[j]) {\n        q = d[i];\n        d[i] = d[j];\n        d[j] = q;\n        w = a[i];\n        a[i] = a[j];\n        a[j] = w;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], d[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25573", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct score {\n    int n;\n    int a;\n    int b;\n    int c;\n  } score[5];\n  int i, m;\n  scanf(\"%d\", &m);\n  score[1].n = 0;\n  score[1].c = 0;\n  score[2].n = 0;\n  score[2].c = 0;\n  score[3].n = 0;\n  score[3].c = 0;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d%d%d\", &score[4].n, &score[4].a, &score[4].b);\n    score[4].c = score[4].a + score[4].b;\n    if (score[4].c > score[1].c) {\n      score[3] = score[2];\n      score[2] = score[1];\n      score[1] = score[4];\n    } else if (score[4].c > score[2].c) {\n      score[3] = score[2];\n      score[2] = score[4];\n    } else if (score[4].c > score[3].c)\n      score[3] = score[4];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", score[1].n, score[1].c, score[2].n,\n         score[2].c, score[3].n, score[3].c);\n  return 0;\n}\n"}
{"label": "14", "index": "25574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int a, b, c;\n  } student_1;\n  int x, i = 0;\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;\n  while (i < n) {\n    scanf(\"%d%d%d\", &student_1.a, &student_1.b, &student_1.c);\n    x = student_1.b + student_1.c;\n    if (x > a2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = a1;\n      b2 = a2;\n      a1 = student_1.a;\n      a2 = x;\n    } else if (x == a2) {\n      if (x > b2) {\n        c1 = b1;\n        c2 = b2;\n        b1 = student_1.a;\n        b2 = x;\n      } else if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > b2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = student_1.a;\n      b2 = x;\n    } else if (x == b2) {\n      if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > c2) {\n      c1 = student_1.a;\n      c2 = x;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n\", a1, a2);\n  cout << b1 << \" \" << b2 << \"\\n\";\n  printf(\"%d %d\\n\", c1, c2);\n  return 0;\n}\n"}
{"label": "14", "index": "25575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  long int n;\n  int i, score[100000], max[3] = {0}, a[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    score[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (max[0] < score[i]) {\n      max[0] = score[i];\n      a[0] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[0])\n      continue;\n    else if (max[1] < score[i]) {\n      max[1] = score[i];\n      a[1] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[1] || stu[i].num == a[0])\n      continue;\n    else if (max[2] < score[i]) {\n      max[2] = score[i];\n      a[2] = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], max[i]);\n  }\n}\n"}
{"label": "14", "index": "25576", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  double chi;\n  double math;\n  double total;\n};\nint main() {\n  struct student stu[100000];\n  struct student temp;\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%lf%lf\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i; j < n; j++) {\n      if (stu[k].total < stu[j].total)\n        k = j;\n    }\n    if (k != i) {\n      temp = stu[i];\n      stu[i] = stu[k];\n      stu[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %.0lf\\n\", stu[i].num, stu[i].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int score;\n  struct student *next;\n};\nint n, i = 0, a;\nstruct student *m1, *m2, *m3, *q;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  p1->score = p1->yuwen + p1->shuxue;\n  head = NULL;\n  while (i < n - 1) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->score = p1->yuwen + p1->shuxue;\n    if (i >= 3) {\n      if (p2->score > m1->score) {\n        m3 = m2;\n        m2 = m1;\n        m1 = p2;\n      } else if (p2->score <= m1->score && p2->score > m2->score) {\n        m3 = m2;\n        m2 = p2;\n      } else if (p2->score <= m2->score && p2->score > m3->score)\n        m3 = p2;\n      i++;\n      continue;\n    }\n    if (i == 0)\n      m1 = p2;\n    else if (i == 1)\n      m2 = p2;\n    else if (i == 2) {\n      m3 = p2;\n      if (m1->score > m2->score) {\n        if (m2->score <= m3->score) {\n          if (m1->score > m3->score) {\n            q = m3;\n            m3 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = m3;\n            m3 = q;\n          }\n        }\n      } else if (m1->score <= m2->score) {\n        if (m2->score > m3->score) {\n          if (m1->score > m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m3;\n            m3 = m1;\n            m1 = m2;\n            m2 = q;\n          }\n        } else if (m2->score <= m3->score) {\n          q = m1;\n          m1 = m3;\n          m3 = q;\n        }\n      }\n    }\n    i++;\n  }\n  return (head);\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  cout << m1->num << \" \" << m1->score << \" \";\n  cout << m2->num << \" \" << m2->score << \" \";\n  printf(\"%d %d \", m3->num, m3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "25578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int math;\n} temp, stu[100050];\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].math);\n    stu[i].math = stu[i].yuwen + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].math > stu[k].math)\n        k = j;\n    temp = stu[k];\n    stu[k] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math);\n}\n"}
{"label": "14", "index": "25579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num, yu, shu, sum;\n};\nint main() {\n  int n, i;\n  struct stu a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[0].num, &a[0].yu, &a[0].shu);\n    a[0].sum = a[0].yu + a[0].shu;\n    if (a[0].sum > a[1].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[1].sum;\n      a[2].num = a[1].num;\n      a[1].sum = a[0].sum;\n      a[1].num = a[0].num;\n    } else if (a[0].sum > a[2].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[0].sum;\n      a[2].num = a[0].num;\n    } else if (a[0].sum > a[3].sum) {\n      a[3].sum = a[0].sum;\n      a[3].num = a[0].num;\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25580", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2, *P;\n\n  int n, i = 0, j = 0;\n\n  scanf(\"%d \", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->total = p1->yuwen + p1->shuxue;\n    p2->next = p1 = (struct student *)malloc(1000);\n  }\n\n  p2->next = head;\n  p1 = head;\n\n  for (i = 0;;) {\n    if (j == 3)\n      break;\n    head = p1;\n    P = p1;\n    p1 = head->next;\n    while (p1 != head) {\n      if (p1->total > P->total)\n        P = p1;\n      else if (p1->total == P->total && p1->num < P->num)\n        P = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", P->num, P->total);\n    while (p1->next != P)\n      p1 = p1->next;\n    p1->next = P->next; \n    j++;\n  }\n}\n"}
{"label": "14", "index": "25581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char id[10];\n  int ch;\n  int ma;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, max, sec, min, total[100000];\n  scanf(\"%d\", &n);\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", stu[i].id, &stu[i].ch, &stu[i].ma);\n    total[i] = stu[i].ch + stu[i].ma;\n  }\n\n  max = 0;\n\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[max])\n      max = i;\n  }\n\n  printf(\"%s %d\\n\", stu[max].id, total[max]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[max]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  sec = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[sec]) {\n      sec = i;\n    }\n  }\n\n  printf(\"%s %d\\n\", stu[sec].id, total[sec]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[sec]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[min]) {\n      min = i;\n    }\n  }\n\n  printf(\"%s %d\\n\", stu[min].id, total[min]);\n  return 0;\n}\n"}
{"label": "14", "index": "25582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n  int ch;\n  int ma;\n  int sum;\n  int key;\n\n} stu[100000];\nint main() {\n  int n, i, max = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].ch >> stu[i].ma;\n    stu[i].sum = stu[i].ch + stu[i].ma;\n    stu[i].key = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n}\n"}
{"label": "14", "index": "25583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  long num, ch, ma, tot;\n\n  struct stu *next;\n};\n\nint main() {\n  int n, numt, cht, mat;\n  scanf(\"%d\", &n);\n  struct stu *head, *now, *neww, *max;\n  int i;\n  for (i = 1; i <= n; i++) {\n    neww = (struct stu *)malloc(sizeof(struct stu));\n    neww->next = 0;\n    if (i == 1) {\n      head = neww;\n      now = neww;\n    } else {\n      now->next = neww;\n      now = neww;\n    }\n    scanf(\"%ld %ld %ld\", &now->num, &now->ch, &now->ma);\n    now->tot = now->ch + now->ma;\n  }\n  for (i = 1; i <= 3; i++) {\n    now = head;\n    max = now;\n    while (now->next != 0) {\n      if (max->tot < now->tot)\n        max = now;\n      now = now->next;\n    }\n    printf(\"%d %d\\n\", max->num, max->tot);\n    max->tot = -1;\n  }\n  \n\n  return 0;\n}\n"}
{"label": "14", "index": "25584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int no;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000], t;\n  int n, i, j, max, order;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].no >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[i].total;\n    order = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > max) {\n        max = stu[j].total;\n        order = j;\n      }\n    }\n    if (order != i) {\n      t = stu[i];\n      stu[i] = stu[order];\n      stu[order] = t;\n    }\n    cout << stu[i].no << \" \" << stu[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long xh;\n  int yw;\n  int sx;\n  int zh;\n  struct stu *next;\n};\nstruct stu *scan() {\n  long n;\n  long num = 0;\n  struct stu *head, *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%ld\", &n);\n\n  head = p1;\n  while (num < n) {\n    cin >> p1->xh;\n    scanf(\"%d\", &p1->yw);\n    scanf(\"%d\", &p1->sx);\n    p1->zh = p1->yw + p1->sx;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->next = 0;\n    num++;\n  }\n  return (head);\n}\nstruct stu *del(struct stu *head, int max) {\n  struct stu *p1, *p2;\n  p1 = head;\n  while (max != p1->zh && p1->next != 0) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (max == p1->zh) {\n    if (p1 == head) {\n      head = p1->next;\n    } else {\n      p2->next = p1->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p, *p1, *p2, *p3, *w;\n  int max = 0, num = 0;\n  while (num < 3) {\n    for (p = head; p != 0; p = p->next) {\n      if (p->zh > max) {\n        max = p->zh;\n        w = p;\n      }\n    }\n    num++;\n    if (num == 1) {\n      p1 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 2) {\n      p2 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 3)\n      p3 = w;\n  }\n  cout << p1->xh << \" \" << p1->zh << \"\\n\"\n       << p2->xh << \" \" << p2->zh << \"\\n\"\n       << p3->xh << \" \" << p3->zh << \"\\n\";\n}\nint main() {\n  struct stu *head;\n  head = scan();\n  print(head);\n}\n"}
{"label": "14", "index": "25586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int ID, Ch, Ma;\n  } temp;\n  int fID = 0, fG = 0, sID = 0, sG = 0, tID = 0, tG = 0;\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    scanf(\"%d%d%d\", &temp.ID, &temp.Ch, &temp.Ma);\n    sum = temp.Ch + temp.Ma;\n    if (sum == fG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum > fG) {\n      tG = sG;\n      tID = sID;\n      sG = fG;\n      sID = fID;\n      fG = sum;\n      fID = temp.ID;\n    }\n    if (sum < fG && sum > sG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum < sG && sum > tG) {\n      tG = sum;\n      tID = temp.ID;\n    }\n  }\n  printf(\"%d %d\\n\", fID, fG);\n  printf(\"%d %d\\n\", sID, sG);\n  printf(\"%d %d\\n\", tID, tG);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct {\n  int x;\n  int y;\n  int s;\n  int z;\n} a[100010], t;\n\nint main() {\n\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].x, &a[i].y, &a[i].s);\n    a[i].z = a[i].y + a[i].s;\n  }\n  for (i = 0; i <= 2; i++)\n    for (j = n - 1; j >= i; j--) {\n      if (a[j + 1].z > a[j].z) {\n        t = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = t;\n      }\n    }\n  printf(\"%d %d\\n\", a[0].x, a[0].z);\n  printf(\"%d %d\\n\", a[1].x, a[1].z);\n  printf(\"%d %d\\n\", a[2].x, a[2].z);\n  return 0;\n}\n"}
{"label": "14", "index": "25588", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chin;\n  int sum;\n} st[100000], t;\nint main() {\n  int i, j;\n  int n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> st[i].number >> st[i].math >> st[i].chin;\n    st[i].sum = st[i].math + st[i].chin;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n; j >= 1; j--)\n      if (st[j].sum > st[j - 1].sum) {\n        t = st[j - 1];\n        st[j - 1] = st[j];\n        st[j] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", st[i].number, st[i].sum);\n}\n"}
{"label": "14", "index": "25589", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  struct student {\n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  long Id;\n  int yuwen;\n  int shuxue;\n};\n\nint main() {\n  int i, j;\n  long n;\n  struct Student student[1000];\n  struct Student temp;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &student[i].Id, &student[i].yuwen, &student[i].shuxue);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < (3 - i - 1); j++) {\n      if ((student[j + 1].yuwen + student[j + 1].shuxue) >\n          (student[j].yuwen + student[j].shuxue)) {\n        temp = student[j + 1];\n        student[j + 1] = student[j];\n        student[j] = temp;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[2].yuwen + student[2].shuxue)) {\n      student[2] = student[i];\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[1].yuwen + student[1].shuxue)) {\n      temp = student[1];\n      student[1] = student[i];\n      student[2] = temp;\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[0].yuwen + student[0].shuxue)) {\n      temp = student[0];\n      student[0] = student[i];\n      student[1] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[i].Id << \" \" << (student[i].shuxue + student[i].yuwen)\n         << \" \";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25591", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[99999], b[2], i, k, m, s[99999], first = 0, x, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (k = 0; k < 2; k++) {\n      scanf(\"%d\", &b[k]);\n    }\n    s[i] = b[0] + b[1];\n  }\n\n  for (m = 0; m < 3; m++) {\n    first = 0;\n    for (x = 0; x < n; x++) {\n\n      if (s[x] > first) {\n        first = s[x];\n        y = x + 1;\n      }\n    }\n    printf(\"%d %d\\n\", y, first);\n    s[y - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int all;\n} person[99999];\nint main() {\n  int n, i, j, k, x, y;\n  ;\n  struct student temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 2; i >= 0; i--) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n  }\n  for (i = 3; i <= n - 1; i++) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n    k = person[i].all;\n    if (k > person[0].all) {\n      temp1 = person[0];\n      temp2 = person[1];\n      person[0] = person[i];\n      person[1] = temp1;\n      person[2] = temp2;\n      continue;\n    }\n    if (k <= person[0].all && k > person[1].all) {\n      temp1 = person[1];\n      person[1] = person[i];\n      person[2] = temp1;\n      continue;\n    }\n    if (k <= person[1].all && k > person[2].all) {\n      person[2] = person[i];\n      continue;\n    }\n    if (k < person[2].all)\n      continue;\n  }\n  printf(\"%d %d\\n\", person[0].num, person[0].all);\n  printf(\"%d %d\\n\", person[1].num, person[1].all);\n  printf(\"%d %d\", person[2].num, person[2].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25593", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p1, *p2;\n  int i = 1;\n  head = NULL;\n  p2 = p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->b + p1->c;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i >= n)\n      break;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->b + p1->c;\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct stu *z, *p3, *p[100007], *q;\n  int i = 0, j, m;\n  scanf(\"%d\", &n);\n  z = creat();\n  p3 = p[i] = z;\n  while (p3 != NULL) {\n    i++;\n    p[i] = p3->next;\n    p3 = p[i];\n  }\n  m = i;\n  q = p[0];\n  for (i = 0; i < 4; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[j]->d >= p[j + 1]->d) {\n        q = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = q;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d \", p[m - i]->a, p[m - i]->d);\n  }\n}\n"}
{"label": "14", "index": "25594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n};\nint main() {\n  struct Student *p1, *top1, *top2, *top3, *temp;\n  int i;\n  long int n;\n  scanf(\"%ld\", &n);\n\n  top1 = (struct Student *)malloc(sizeof(struct Student));\n  top2 = (struct Student *)malloc(sizeof(struct Student));\n  top3 = (struct Student *)malloc(sizeof(struct Student));\n  temp = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &top1->id, &top1->chn, &top1->mth);\n  top1->total = top1->chn + top1->mth;\n  scanf(\"%d %d %d\", &top2->id, &top2->chn, &top2->mth);\n  top2->total = top2->chn + top2->mth;\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  scanf(\"%d %d %d\", &top3->id, &top3->chn, &top3->mth);\n  top3->total = top3->chn + top3->mth;\n  if (top3->total > top2->total) {\n    temp = top3;\n    top3 = top2;\n    top2 = temp;\n  }\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  for (i = 3; i < n; i++) {\n    p1 = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &p1->id, &p1->chn, &p1->mth);\n    p1->total = p1->chn + p1->mth;\n    if (top1->total < p1->total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = p1;\n      continue;\n    }\n    if (top2->total < p1->total) {\n      top3 = top2;\n      top2 = p1;\n      continue;\n    }\n    if (top3->total < p1->total) {\n      top3 = p1;\n      continue;\n    }\n    free(p1);\n  }\n  printf(\"%ld %d\\n%ld %d\\n%ld %d\\n\", top1->id, top1->total, top2->id,\n         top2->total, top3->id, top3->total);\n}\n"}
{"label": "14", "index": "25595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  long num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  long i, n, j, k;\n  int t;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++)\n      if (stu[j].sum > stu[j + 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j + 1].sum;\n        stu[j + 1].sum = t;\n      }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    if (k != n - 1 && stu[k].sum == stu[k + 1].sum)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (stu[k].sum == (stu[i].yu + stu[i].shu)) {\n        printf(\"%ld %ld\\n\", stu[i].num, stu[k].sum);\n        if (k == n - 3)\n          break;\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "25596", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Student {\n    int num;\n    int ch;\n    int math;\n  } stu[100000];\n  int n, i, x = 0, m = 0, k = 0, j, a[100000] = {0};\n  cin >> n;\n  for (i = 0; i < n - 1; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    a[i] = stu[i].ch + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > m) {\n        m = a[i];\n        x = stu[i].num;\n        k = i;\n      }\n    }\n    printf(\"%d %d\\n\", x, m);\n    a[k] = 0;\n    m = 0;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n    struct stu *next;\n  };\n  int n, max, i;\n  struct stu *p1, *p2, *head, *maxsum;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->num >> p1->chinese >> p1->math;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n\n  p1 = head;\n  while (p1->next != NULL) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  p1->sum = p1->chinese + p1->math;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    maxsum = p1;\n    while (p1->next != NULL) {\n      if (p1->sum > max) {\n        maxsum = p1;\n        max = p1->sum;\n      }\n      p1 = p1->next;\n    }\n    if (p1->sum > max) {\n      maxsum = p1;\n      max = p1->sum;\n    }\n    printf(\"%d %d \", maxsum->num, maxsum->sum);\n    maxsum->sum = 0;\n  }\n}\n"}
{"label": "14", "index": "25598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct grade {\n  int No;\n  int chinese;\n  int math;\n  int sum;\n} student[100000], s;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].No, &student[i].chinese, &student[i].math);\n    student[i].sum = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].sum < student[j].sum) {\n        s = student[i];\n        student[i] = student[j];\n        student[j] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].No, student[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id, word, math, sum;\n} stu[100000];\nint main() {\n  int n, i = 1, maxi;\n  scanf(\"%d\", &n);\n  while (i <= n) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].word, &stu[i].math);\n    stu[i].sum = stu[i].word + stu[i].math;\n    i = i + 1;\n  }\n  i = n;\n  stu[n + 1].sum = 0;\n  stu[n + 2].sum = 0;\n  stu[n + 3].sum = 0;\n  stu[n + 1].id = 0;\n  stu[n + 2].id = 0;\n  stu[n + 3].id = 0;\n  stu[n + 1].math = 0;\n  stu[n + 2].math = 0;\n  stu[n + 3].math = 0;\n  stu[n + 1].word = 0;\n  stu[n + 2].word = 0;\n  stu[n + 3].word = 0;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 1].sum) {\n      stu[n + 1] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 1].id, stu[n + 1].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 2].sum) {\n      stu[n + 2] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 2].id, stu[n + 2].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 3].sum)\n      stu[n + 3] = stu[i];\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 3].id, stu[n + 3].sum);\n}\n"}
{"label": "14", "index": "25600", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint m;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student *creat(int n);\n  void print(struct student * head, int n);\n  struct student *head;\n  head = creat(n);\n  print(head, n);\n  print(head, n);\n  print(head, n);\n  return 0;\n}\n\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  for (; n != 0; n--) {\n    m += 1;\n    if (m == 1) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head, int n) {\n  struct student *p, *q;\n  p = head;\n  int max = 0, index = 0;\n  for (; n != 0; n--) {\n    if (max < ((p->yuwen) + (p->shuxue))) {\n      max = ((p->yuwen) + (p->shuxue));\n      index = p->num;\n      q = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", index, max);\n  q->yuwen = 0;\n  q->shuxue = 0;\n}\n"}
{"label": "14", "index": "25601", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, max;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    struct student *next;\n  };\n  struct student *head, *ppre, *p0, *p3;\n  struct student *p1, *p2;\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (j = 0; j < 3; j++) {\n    ppre = p1 = head;\n    max = p1->yuwen + p1->shuxue;\n    p1 = p1->next;\n    for (i = 0; i < n - j; i++) {\n      if ((p1->yuwen + p1->shuxue) > max) {\n        max = p1->yuwen + p1->shuxue;\n        p0 = p1;\n        p3 = ppre;\n      }\n      ppre = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p0->num, max);\n    p3->next = p0->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25602", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int ch;\n  int ma;\n};\n\nint main() {\n  struct student re[1000];\n  int n;\n  int i = 0, j = 0, rec;\n  int total[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> re[i].ID >> re[i].ch >> re[i].ma;\n    total[i] = re[i].ch + re[i].ma;\n  }\n\n  int max = total[0];\n\n  for (i = 0; i < n; i++) {\n    if (max < total[i]) {\n      max = total[i];\n      rec = i;\n    }\n    if (i == n - 1) {\n      printf(\"%d %d \", re[rec].ID, total[rec]);\n      total[rec] = 0;\n      i = 0;\n      max = total[0];\n      j++;\n    }\n\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25603", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  int total;\n} a[100000];\nstruct str {\n  int num;\n  int total;\n} b[100000];\n\nint main() {\n  int i, n, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &a[i].num, &a[i].ch, &a[i].math);\n    b[i].num = a[i].num;\n    b[i].total = a[i].ch + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[i].total < b[j].total) {\n        b[n] = b[i];\n        b[i] = b[j];\n        b[j] = b[n];\n      }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", b[i].num, b[i].total);\n  }\n}\n"}
{"label": "14", "index": "25604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int score;\n};\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student stu[100000];\n  struct student *p, *p1, *t1, *t2, *t3;\n  int tem, tem1;\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d %d %d\", &p->num, &p->score1, &p->score2);\n    p->score = p->score1 + p->score2;\n  }\n  int max;\n  for (p = stu, t1 = stu, max = stu->score; p < stu + n; p++) {\n    if (p->score > max) {\n      t1 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t2 = stu, max = stu->score; p < stu + n; p++) {\n    if (p == t1)\n      continue;\n    if (p->score > max) {\n      t2 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t3 = stu, max = stu->score; p < stu + n; p++) {\n    if ((p == t1) || (p == t2))\n      continue;\n    if (p->score > max) {\n      t3 = p;\n      max = p->score;\n    }\n  }\n  printf(\"%d %d\\n\", t1->num, t1->score);\n  printf(\"%d %d\\n\", t2->num, t2->score);\n  printf(\"%d %d\\n\", t3->num, t3->score);\n}\n"}
{"label": "14", "index": "25605", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID, Chinese, math, sum;\n  } stu[100000], temp1, temp2, temp3;\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].ID >> stu[i].Chinese >> stu[i].math;\n    stu[i].sum = stu[i].Chinese + stu[i].math;\n  }\n  temp1 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp1.sum)\n      temp1 = stu[i];\n  printf(\"%d %d\\n\", temp1.ID, temp1.sum);\n  if (temp1.ID == stu[0].ID)\n    temp2 = stu[1];\n  else\n    temp2 = stu[0];\n  for (i = 1; i < n - 1; i++) {\n    if (stu[i].ID == temp1.ID)\n      continue;\n    else if (stu[i].sum > temp2.sum)\n      temp2 = stu[i];\n  }\n  printf(\"%d %d\\n\", temp2.ID, temp2.sum);\n  for (i = 0; i < n; i++)\n    if (stu[i].ID == temp1.ID || stu[i].ID == temp2.ID)\n      stu[i].sum = 0;\n  temp3 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp3.sum)\n      temp3 = stu[i];\n  printf(\"%d %d\\n\", temp3.ID, temp3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int n;\n    int a;\n    int b;\n  } n[100000];\n  int m, i, sum[100000], first, second, third, d, e, f;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &n[i].n);\n    scanf(\"%d\", &n[i].a);\n    scanf(\"%d\", &n[i].b);\n    sum[i] = n[i].a + n[i].b;\n  }\n  if (sum[0] > sum[1] && sum[0] > sum[2] && sum[1] > sum[2]) {\n    first = sum[0];\n    second = sum[1];\n    third = sum[2];\n    d = 1;\n    e = 2;\n    f = 3;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] > sum[2]) {\n    first = sum[0];\n    second = sum[2];\n    third = sum[1];\n    d = 1;\n    e = 3;\n    f = 2;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] > sum[2]) {\n    first = sum[1];\n    second = sum[0];\n    third = sum[2];\n    d = 2;\n    e = 1;\n    f = 3;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] < sum[2]) {\n    first = sum[1];\n    second = sum[2];\n    third = sum[0];\n    d = 2;\n    e = 3;\n    f = 1;\n  } else if (sum[0] < sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[1];\n    third = sum[0];\n    d = 3;\n    e = 2;\n    f = 1;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[0];\n    third = sum[1];\n    d = 3;\n    e = 1;\n    f = 2;\n  }\n  for (i = 3; i < m; i++) {\n    if (sum[i] > first) {\n      third = second;\n      second = first;\n      first = sum[i];\n      f = e;\n      e = d;\n      d = i + 1;\n    } else if (sum[i] <= first && sum[i] > second) {\n      third = second;\n      second = sum[i];\n      f = e;\n      e = i + 1;\n    } else if (sum[i] <= second && sum[i] > third) {\n      third = sum[i];\n      f = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", d, first);\n  cout << e << \" \" << second << \"\\n\";\n  printf(\"%d %d\\n\", f, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int ch;\n    int ma;\n    int sum;\n  };\n  struct student *p;\n  int n, i, j, t1, t2, a1 = 0, a2 = 0, a3 = 0, k1, k2, k3;\n  scanf(\"%d\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &p[i].num, &p[i].ch, &p[i].ma);\n    p[i].sum = p[i].ch + p[i].ma;\n  }\n\n  for (i = 0; i < n; i++)\n    if (p[i].sum > a1) {\n      k1 = i;\n      a1 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a1 && p[i].sum > a2 && i != k1) {\n      k2 = i;\n      a2 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a2 && p[i].sum > a3 && i != k1 && i != k2) {\n      k3 = i;\n      a3 = p[i].sum;\n    }\n  cout << p[k1].num << \" \" << p[k1].sum << \"\\n\"\n       << p[k2].num << \" \" << p[k2].sum << \"\\n\"\n       << p[k3].num << \" \" << p[k3].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int m;\n  int c;\n  int sum;\n};\n\nint main() {\n  long int n;\n  int a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  struct stu student[65535];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].c, &student[i].m);\n    student[i].sum = student[i].m + student[i].c;\n  }\n  for (int i = 0; i < n; i++) {\n    if (student[i].sum > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = student[i].sum;\n      x = student[i].num;\n      continue;\n    }\n    if (student[i].sum > b) {\n      c = b;\n      z = y;\n      b = student[i].sum;\n      y = student[i].num;\n      continue;\n    }\n    if (student[i].sum > c) {\n      c = student[i].sum;\n      z = student[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, a, y, b, z, c);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25609", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int ch;\n  int math;\n  int sum;\n};\nint main() {\n  struct Student stu[4], temp;\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    stu[i].sum = stu[i].ch + stu[i].math;\n  }\n  for (i = 0; i < 2; i++) {\n    k = i;\n    for (j = i + 1; j < 3; j++)\n      if (stu[j].sum > stu[i].sum) {\n        k = j;\n        temp = stu[k];\n        stu[j] = stu[i];\n        stu[i] = temp;\n      }\n  }\n\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[3].num, &stu[3].ch, &stu[3].math);\n    stu[3].sum = stu[3].ch + stu[3].math;\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum)\n      stu[2] = stu[3];\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, e, f, g, h;\n  int *a, *b, *c;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  c = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < n; i++)\n    a[i] = b[i] + c[i];\n  for (i = 0; i < n; i++) {\n    b[i] = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] > m)\n      m = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  b[i] = 0;\n  a[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  a[i] = 0;\n  b[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  free(a);\n  a = 0;\n  free(b);\n  b = 0;\n  free(c);\n  c = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  while (m--) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    n = n - 1;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2;\n  int max = 0, i, m;\n  scanf(\"%d\", &m);\n  printf(\" \");\n  head = creat(m);\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->yuwen + p1->shuxue) > max)\n        max = p1->yuwen + p1->shuxue, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, (p2->yuwen + p2->shuxue));\n    head = del(head, p2->num);\n  }\n}\n"}
{"label": "14", "index": "25612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, e, f, g, h;\n  int *a, *b, *c;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  c = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < n; i++)\n    a[i] = b[i] + c[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] > m)\n      m = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  b[i] = 0;\n  a[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  a[i] = 0;\n  b[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  free(a);\n  a = 0;\n  free(b);\n  b = 0;\n  free(c);\n  c = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, j, k, z, x;\n  cin >> n;\n  struct Student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 0; j < 3; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (stu[k].zongfen > stu[k + 1].zongfen) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else if (stu[k].zongfen == stu[k + 1].zongfen &&\n                 stu[k].num < stu[k + 1].num) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else {\n        ;\n      }\n    }\n  }\n\n  for (j = 0; j < 3; j++) {\n    cout << stu[n - 1 - j].num << \" \" << stu[n - 1 - j].zongfen << \"\\n\";\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct score {\n    int ID;\n    int c;\n    int m;\n  };\n  int n, k, t, r;\n  int j;\n  scanf(\"%d\", &n);\n  int sum[100000];\n  struct score s[100000];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &s[i].ID, &s[i].c, &s[i].m);\n    sum[i] = s[i].c + s[i].m;\n  }\n  for (j = 1; j <= 3; j++) {\n    for (k = j; k <= n; k++) {\n      if (sum[k] > sum[j]) {\n        t = sum[j];\n        sum[j] = sum[k];\n        sum[k] = t;\n        r = s[j].ID;\n        s[j].ID = s[k].ID;\n        s[k].ID = r;\n      }\n    }\n  }\n  for (int u = 1; u <= 3; u++) {\n    cout << s[u].ID << \" \" << sum[u] << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int score;\n  struct student *next;\n};\nint main() {\n  int n, i, max;\n  struct student *p1, *p2, *head;\n  p1 = p2 = head = NULL;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n\n    p1->score = p1->yu + p1->shu;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p2 = p1 = head;\n    max = p1->score;\n    while (p1 != NULL) {\n      if (p1->score > max) {\n        max = p1->score;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p2->num, max);\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "25616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int Chinese;\n  int math;\n  int sum;\n} zz[100000], mx, mx1, mx2;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].ID >> zz[i].Chinese >> zz[i].math;\n    zz[i].sum = zz[i].Chinese + zz[i].math;\n  }\n  mx = zz[0];\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx.sum)\n      mx = zz[i];\n  }\n  cout << mx.ID << ' ' << mx.sum << endl;\n  mx.sum = 0;\n  mx1 = mx;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx1.sum) {\n      if (zz[i].ID == mx.ID)\n        continue;\n      mx1 = zz[i];\n    }\n  }\n  cout << mx1.ID << ' ' << mx1.sum << endl;\n  mx1.sum = 0;\n  mx2 = mx1;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx2.sum) {\n      if (zz[i].ID == mx.ID || zz[i].ID == mx1.ID)\n        continue;\n      mx2 = zz[i];\n    }\n  }\n  cout << mx2.ID << \" \" << mx2.sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef struct {\n  int ID;\n  int chinese;\n  int math;\n  int sum;\n} Student;\n\nStudent topThree[3];\nint studentNum;\n\nvoid initialise() {\n  for (int i = 0; i < 3; i++) {\n    topThree[i].sum = -1;\n  }\n}\n\nvoid updateTopThree(Student stu) {\n  for (int i = 0; i < 3; i++) {\n    if (stu.sum > topThree[i].sum) {\n      for (int j = 2; j > i; j--) {\n        topThree[j] = topThree[j - 1];\n      }\n\n      topThree[i] = stu;\n\n      break;\n    }\n  }\n}\n\nvoid getStudentData() {\n  Student temp;\n\n  scanf(\"%d\", &studentNum);\n  for (int i = 0; i < studentNum; i++) {\n    scanf(\"%d %d %d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.sum = temp.chinese + temp.math;\n    updateTopThree(temp);\n  }\n}\n\nvoid printStudentData() {\n  for (int i = 0; i < 3 && i < studentNum; i++) {\n    printf(\"%d %d\\n\", topThree[i].ID, topThree[i].sum);\n  }\n}\n\nint main() {\n  initialise();\n  getStudentData();\n  printStudentData();\n\n  return 0;\n}\n"}
{"label": "14", "index": "25618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n};\nstruct student stu[100000];\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  {\n    max[0] = 0;\n    for (j = 0, k = 0; j < n; j++) {\n      if (sum[j] > max[0]) {\n        max[0] = sum[j];\n        k = j;\n      }\n    }\n  }\n\n  {\n    max[1] = 0;\n    for (j = 1, m = 0; j < n; j++) {\n      if ((sum[j] > max[1]) && (j != k)) {\n        max[1] = sum[j];\n        m = j;\n      }\n    }\n  }\n\n  {\n    max[2] = 0;\n    for (j = 1, o = 0; j < n; j++) {\n      if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n        max[2] = sum[j];\n        o = j;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[k].name, sum[k]);\n  cout << stu[m].name << \" \" << sum[m] << \"\\n\";\n  printf(\"%d %d\\n\", stu[o].name, sum[o]);\n  return 0;\n}\n"}
{"label": "14", "index": "25619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int all;\n  } stu[100000];\n  int n, i, j, n1 = 1, n2 = 1, n3 = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n\n  for (i = 2; i <= n; i++) {\n    if (stu[n1].all < stu[i].all) {\n      n1 = i;\n    }\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n1)\n      continue;\n    if (stu[n2].all < stu[i].all)\n      n2 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n2 || i == n1)\n      continue;\n    if (stu[n3].all < stu[i].all)\n      n3 = i;\n  }\n  cout << stu[n1].number << \" \" << stu[n1].all << endl;\n  cout << stu[n2].number << \" \" << stu[n2].all << \"\\n\";\n  cout << stu[n3].number << \" \" << stu[n3].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25620", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long int num;\n  int chi;\n  int mat;\n  int tot;\n};\nint main() {\n  struct stu a[100050];\n  int n, k, i, j, temp2, max;\n  long int temp1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> a[i].chi >> a[i].mat;\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  for (j = 1; j <= 3; j++) {\n    max = 0;\n    a[0].tot = 0;\n    for (i = 1; i <= n; i++)\n      if (a[max].tot < a[i].tot)\n        max = i;\n    printf(\"%ld %d\\n\", a[max].num, a[max].tot);\n    a[max].tot = 0;\n  }\n  cin;\n  return (0);\n}\n"}
{"label": "14", "index": "25621", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  struct student *next;\n};\nint main() {\n  struct student *head, *p1, *p2;\n  int i, max, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yw, &p1->sx);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = p1->yw + p1->sx;\n    while (p1 != NULL) {\n      if ((p1->yw + p1->sx) > max) {\n        max = p1->yw + p1->sx;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, max);\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "25622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  int No;\n  int chinese;\n  int math;\n  int sum;\n} student[100000], s;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].No, &student[i].chinese, &student[i].math);\n    student[i].sum = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].sum < student[j].sum) {\n        s = student[i];\n        student[i] = student[j];\n        student[j] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[i].No << \" \" << student[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct Student stu[3], t;\n  stu[0].sum = stu[1].sum = stu[2].sum = 0;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t.ID >> t.chinese >> t.maths;\n    t.sum = t.chinese + t.maths;\n\n    if (t.sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = t;\n    } else if (t.sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = t;\n    } else if (t.sum > stu[2].sum)\n      stu[2] = t;\n  }\n\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25624", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int tol;\n  struct student *next;\n};\n\nint main() {\n\n  struct student *p1, *p2, *head;\n  struct student *p, *a, *b, *c;\n  struct student temp;\n\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->chi, &p1->mat);\n    p1->tol = p1->chi + p1->mat;\n    if (i == 0)\n      head = p2 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  p = head;\n  temp.tol = 0;\n  a = b = c = &temp;\n  while (p != NULL) {\n    if (p->tol > a->tol) {\n      c = b;\n      b = a;\n      a = p;\n    } else if (p->tol > b->tol) {\n      c = b;\n      b = p;\n    } else if (p->tol > c->tol)\n      c = p;\n    p = p->next;\n  }\n\n  printf(\"%d %d \", a->num, a->tol);\n  printf(\"%d %d \", b->num, b->tol);\n  printf(\"%d %d \", c->num, c->tol);\n}\n"}
{"label": "14", "index": "25625", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct stu {\n    int num;\n    int chin;\n    int math;\n    int sum;\n  } one[n + 1];\n\n  for (int i = 1; i <= n; i++) {\n    cin >> one[i].num >> one[i].chin >> one[i].math;\n    one[i].sum = one[i].chin + one[i].math;\n  }\n  int t = 0;\n  for (int i = 200; i >= 0; i--)\n    for (int j = 1; j <= n; j++) {\n      if (one[j].sum == i) {\n        cout << j << \" \" << one[j].sum << endl;\n        t = t + 1;\n      }\n      if (t == 3) {\n        i = -1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "25626", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct stu {\n    int num;\n    int chin;\n    int math;\n    int sum;\n  } one[n + 1];\n\n  for (int i = 1; i <= n; i++) {\n    cin >> one[i].num >> one[i].chin >> one[i].math;\n    one[i].sum = one[i].chin + one[i].math;\n  }\n  int t = 0;\n  for (int i = 200; i >= 0; i--)\n    for (int j = 1; j <= n; j++) {\n      if (one[j].sum == i) {\n        cout << j << \" \" << one[j].sum << endl;\n        t = t + 1;\n      }\n      if (t == 3) {\n        i = -1;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "25627", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid swap(int *i, int *j) {\n  int *p = i, t = *i;\n  *p = *j;\n  p = j;\n  *p = t;\n}\nstruct Student {\n  int id;\n  int chinese;\n  int math;\n};\nint main() {\n  void swap(int *i, int *j);\n  int n, i, first, second, third, one, two, three;\n  int *f = &first, *s = &second, *t = &third, *on = &one, *tw = &two,\n      *th = &three;\n  struct Student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    int total = stu[i].chinese + stu[i].math, k;\n    int *to = &total, *K = &k;\n    if (i == 0) {\n      first = total;\n      one = i;\n    } else {\n      if (i == 1) {\n        if (total > first) {\n          swap(to, f);\n          second = total;\n          k = i;\n          swap(K, on);\n          two = k;\n        } else {\n          second = total;\n          two = i;\n        }\n      } else {\n        if (i == 2) {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            third = total;\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            three = k;\n          } else {\n            if (total > second && total <= first) {\n              swap(to, s);\n              third = total;\n              k = i;\n              swap(K, tw);\n              three = k;\n            } else {\n              third = total;\n              three = i;\n            }\n          }\n        } else {\n          if (total > first) {\n            swap(to, f);\n            swap(to, s);\n            swap(to, t);\n            k = i;\n            swap(K, on);\n            swap(K, tw);\n            swap(K, th);\n          } else {\n            if (total > second) {\n              swap(to, s);\n              swap(to, t);\n              k = i;\n              swap(K, tw);\n              swap(K, th);\n            } else {\n              if (total > third) {\n                swap(to, t);\n                k = i;\n                swap(K, th);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[one].id, first);\n  printf(\"%d %d\\n\", stu[two].id, second);\n  printf(\"%d %d\\n\", stu[three].id, third);\n  return 0;\n}\n"}
{"label": "14", "index": "25628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct stu {\n    int id;\n    int x, y;\n\n  } stu[100000];\n  int no1 = 0;\n  int no2 = 0;\n  int no3 = 0;\n  int i;\n  int N1, N2, N3;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].x, &stu[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    if ((stu[i].x + stu[i].y) > no1) {\n      no2 = no1;\n      no1 = (stu[i].x + stu[i].y);\n      N2 = N1;\n      N1 = i;\n    } else if ((stu[i].x + stu[i].y) > no2) {\n      no3 = no2;\n      no2 = (stu[i].x + stu[i].y);\n      N3 = N2;\n      N2 = i;\n    } else if ((stu[i].x + stu[i].y) > no3) {\n      no3 = (stu[i].x + stu[i].y);\n      N3 = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", stu[N1].id, (stu[N1].x + stu[N1].y), stu[N2].id,\n         (stu[N2].x + stu[N2].y), stu[N3].id, (stu[N3].x + stu[N3].y));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int chi;\n    int ma;\n    int sum;\n    int i;\n  };\n  struct stu m[100000], temp;\n  int j, n;\n  cin >> n;\n  struct stu *p = m;\n  struct stu *q;\n  for (; p < m + n; p += 1) {\n    cin >> (*p).i >> (*p).chi >> (*p).ma;\n    (*p).sum = (*p).chi + (*p).ma;\n  }\n  for (p = m; p < m + n - 1; p++) {\n    for (q = p + 1; q < m + n; q++) {\n      if ((*p).sum < (*q).sum) {\n        temp = *p;\n        *p = *q;\n        *q = temp;\n      }\n    }\n    if (p == m + 2)\n      break;\n  }\n  for (p = m; p < m + 3; p++) {\n    cout << (*p).i << \" \" << (*p).sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} stu[100000];\n\nvoid bubble(struct student stu[], int n) {\n  int pass, i;\n  struct student temp;\n\n  for (pass = n - 1; pass >= n - 3; pass--)\n    for (i = pass; i > 0; i--)\n      if (stu[i].chinese + stu[i].math > stu[i - 1].chinese + stu[i - 1].math) {\n        temp = stu[i];\n        stu[i] = stu[i - 1];\n        stu[i - 1] = temp;\n      }\n}\n\nint main() {\n  struct student *p;\n  int i;\n  int n;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n  bubble(stu, n);\n  for (p = stu; p < stu + 3; p++)\n    cout << p->id << \" \" << p->chinese + p->math << (p == stu + n - 1) ? '\\0'\n                                                                       : '\\n';\n  return 0;\n}\n"}
{"label": "14", "index": "25631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j;\n  struct student stu[100000];\n  struct student stud;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].sum < stu[j].sum) {\n        stud = stu[i];\n        stu[i] = stu[j];\n        stu[j] = stud;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n}\n"}
{"label": "14", "index": "25632", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].shu + stu[i].yu;\n  }\n  int k, e;\n  for (k = 0; k < 3; k++) {\n    for (i = n - 2; i >= k; i--) {\n      if (stu[i].sum < stu[i + 1].sum) {\n        e = stu[i].sum;\n        stu[i].sum = stu[i + 1].sum;\n        stu[i + 1].sum = e;\n        e = stu[i].num;\n        stu[i].num = stu[i + 1].num;\n        stu[i + 1].num = e;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(long n) {\n  struct student *head, *p1, *p2;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n  long s = n - 1;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  do {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    s = s - 1;\n  } while (s);\n  return (head);\n}\nint main() {\n  struct student *head, *p, *q, stu1, stu2, stu3;\n  long n, k1 = -1, k2 = -1, k3 = -1, i, j;\n  int l;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  for (p = head, i = 0; p != NULL; p = p->next, i++) {\n    l = 0;\n    for (q = head, j = 0; q != NULL; q = q->next, j++)\n      if ((q->scorec + q->scorem) > (p->scorec + p->scorem) ||\n          (((q->scorec + q->scorem) == (p->scorec + p->scorem)) && j < i)) {\n        l = l + 1;\n        if (l > 3)\n          break;\n      }\n    if (l == 0) {\n      k1 = i;\n      stu1.num = p->num;\n      stu1.scorec = p->scorec;\n      stu1.scorem = p->scorem;\n    }\n    if (l == 1) {\n      k2 = i;\n      stu2.num = p->num;\n      stu2.scorec = p->scorec;\n      stu2.scorem = p->scorem;\n    }\n    if (l == 2) {\n      k3 = i;\n      stu3.num = p->num;\n      stu3.scorec = p->scorec;\n      stu3.scorem = p->scorem;\n    }\n    if (k1 != -1 && k2 != -1 && k3 != -1)\n      break;\n  }\n  printf(\"%ld %d \", stu1.num, stu1.scorec + stu1.scorem);\n  cout << stu2.num << \" \" << stu2.scorec + stu2.scorem << \" \";\n  printf(\"%ld %d\", stu3.num, stu3.scorec + stu3.scorem);\n}\n"}
{"label": "14", "index": "25634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int china;\n  int math;\n};\nint main() {\n  int n;\n  cin >> n;\n  struct student st[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> st[i].No >> st[i].china >> st[i].math;\n  }\n\n  int s;\n  int a1 = 0, a2 = 0, a3 = 0, b1 = 0, b2 = 0, b3 = 0;\n  for (i = 0; i < n; i++) {\n    s = st[i].china + st[i].math;\n    if (s > a1) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = a1;\n      b2 = b1;\n      a1 = s;\n      b1 = i;\n      continue;\n    }\n\n    if (s > a2) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = s;\n      b2 = i;\n      continue;\n    }\n    if (s > a3) {\n      a3 = s;\n      b3 = i;\n      continue;\n    }\n  }\n  printf(\"%d %d\\n\", st[b1].No, a1);\n  printf(\"%d %d\\n\", st[b2].No, a2);\n  cout << st[b3].No << \" \" << a3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n  } data[100000];\n  int n, i, max, x, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data[i].xh, &data[i].yw, &data[i].sx);\n    data[i].zf = data[i].yw + data[i].sx;\n  }\n  for (i = 0; i < 3; i++) {\n    max = data[0].zf;\n    x = 0;\n    for (j = 1; j < n; j++) {\n      if (data[j].zf > max) {\n        max = data[j].zf;\n        x = j;\n      }\n    }\n    printf(\"%d %d\\n\", data[x].xh, data[x].zf);\n    data[x].zf = 0;\n  }\n}\n"}
{"label": "14", "index": "25636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n  } data[100000];\n  int n, i, max, x, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data[i].xh, &data[i].yw, &data[i].sx);\n    data[i].zf = data[i].yw + data[i].sx;\n  }\n  for (i = 0; i < 3; i++) {\n    max = data[0].zf;\n    x = 0;\n    for (j = 1; j < n; j++) {\n      if (data[j].zf > max) {\n        max = data[j].zf;\n        x = j;\n      }\n    }\n    printf(\"%d %d\\n\", data[x].xh, data[x].zf);\n    data[x].zf = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int b;\n    int c;\n    int d;\n    int h;\n  } s[100000];\n  int i, j, k, n, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    s[i].d = s[i].b + s[i].c;\n    s[i].h = -1;\n  }\n  for (i = 1; i <= 3; i++) {\n    max = 0;\n    k = 0;\n    for (j = 1; j <= n; j++) {\n      if ((s[j].d > max) && (s[j].h == -1)) {\n        max = s[j].d;\n        k = j;\n      }\n    }\n    s[k].h = 1;\n    cout << s[k].a << \" \" << s[k].d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25638", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  double chi;\n  double math;\n  double total;\n};\nint main() {\n  struct student stu[100000];\n  struct student temp;\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%lf%lf\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i; j < n; j++) {\n      if (stu[k].total < stu[j].total)\n        k = j;\n    }\n    if (k != i) {\n      temp = stu[i];\n      stu[i] = stu[k];\n      stu[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %.0lf\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  int a;\n  int b;\n  int c;\n} st[100000], tp;\nint main() {\n  int n, i, ii, j, d, a, b, c;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].b, &st[i].c);\n    st[i].b += st[i].c;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[j].b > st[i].b) {\n        tp = st[i];\n        st[i] = st[j];\n        st[j] = tp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", st[i].a, st[i].b);\n  return 0;\n}\n"}
{"label": "14", "index": "25640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct Student stu[3], t;                 \n  stu[0].sum = stu[1].sum = stu[2].sum = 0; \n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t.ID >> t.chinese >> t.maths;\n    t.sum = t.chinese + t.maths;\n    \n    if (t.sum > stu[0].sum) {\n      stu[2] = stu[1]; \n      stu[1] = stu[0];\n      stu[0] = t;\n    } else if (t.sum > stu[1].sum) { \n      stu[2] = stu[1];               \n      stu[1] = t;\n    } else if (t.sum > stu[2].sum) { \n      stu[2] = t;                    \n    }\n  }\n  \n  for (i = 0; i < 3; i++) {\n    cout << stu[i].ID << \" \" << stu[i].sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } score[100000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &score[i].num, &score[i].chi, &score[i].math);\n    score[i].sum = score[i].chi + score[i].math;\n  }\n  for (i = 0; i < 4; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (score[j].sum > score[k].sum)\n        k = j;\n    }\n    temp = score[k];\n    score[k] = score[i];\n    score[i] = temp;\n  }\n  cout << score[0].num << \" \" << score[0].sum;\n  printf(\"\\n\");\n  printf(\"%d %d\", score[1].num, score[1].sum);\n  printf(\"\\n\");\n  printf(\"%d %d\", score[2].num, score[2].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25642", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n  struct Student *next;\n};\n\nstruct Student *insert(struct Student *head, struct Student *stu) {\n  int j = 0;\n  struct Student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stu;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->total <= p1->total) && (p1->next != NULL) && j < 4) {\n      p2 = p1;\n      p1 = p1->next;\n      j++;\n    }\n    if (p0->total > p1->total) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct Student *p1, *head, *stu;\n  long int i, n;\n  scanf(\"%ld\", &n);\n\n  p1 = head = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &head->id, &head->chn, &head->mth);\n  head->total = head->chn + head->mth;\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    stu = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &stu->id, &stu->chn, &stu->mth);\n    stu->total = stu->chn + stu->mth;\n    head = insert(head, stu);\n  }\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p1->id, p1->total);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25643", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, i;\n  scanf(\"%d \", &N);\n  int Max1 = 0, Max2 = 0, Max3 = 0, Nb[4];\n  struct student {\n    int Number;\n    int Chinese;\n    int Math;\n    int Total;\n  } people[111111];\n  for (i = 1; i <= N; i++) {\n    cin >> people[i].Number >> people[i].Chinese >> people[i].Math;\n    people[i].Total = people[i].Chinese + people[i].Math;\n  }\n  for (i = 1; i <= N; i++) {\n    if (Max1 < people[i].Total) {\n      Nb[1] = i;\n      Max1 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max2 < people[i].Total) && (i != Nb[1])) {\n      Nb[2] = i;\n      Max2 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= N; i++) {\n    if ((Max3 < people[i].Total) && (i != Nb[1]) && (i != Nb[2])) {\n      Nb[3] = i;\n      Max3 = people[i].Total;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << people[Nb[i]].Number << \" \" << people[Nb[i]].Total;\n    if (i < 3)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25644", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n  int chinese;\n  int math;\n  int num;\n} stu[100001];\nint main() {\n  int n, i, j, max[3][2] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].num = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (stu[i].num > max[j][0]) {\n        max[j][0] = stu[i].num;\n        max[j][1] = i + 1;\n      }\n    }\n    stu[max[j][1] - 1].num = 0;\n  }\n  for (j = 0; j < 3; j++)\n\n    cout << max[j][1] << ' ' << max[j][0] << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25645", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n, k;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  int m;\n  m = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chi >> p1->math;\n  p1->sum = p1->chi + p1->math;\n  head = p1;\n  while (m < n - 1) {\n    m = m + 1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  struct student *max, *p;\n  for (i = 0; i < 3; i++) {\n    max = head;\n    p = p2 = head;\n    p1 = p2;\n    for (j = 0; j < n - i; j++) {\n      if (p1->sum > max->sum) {\n        max = p1;\n        p = p2;\n      }\n      p2 = p1;\n      p1 = p2->next;\n    }\n    p1 = p2 = head;\n    printf(\"%d %d \", max->num, max->sum);\n    if (max->num == head->num)\n      head = p1->next;\n    else\n      p->next = max->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long int n, a[100000][2];\n  int i, j, t, s;\n  struct Student {\n    int num;\n    int yu;\n    int shu;\n  };\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    struct Student studenti;\n    scanf(\"%d%d%d\", &studenti.num, &studenti.yu, &studenti.shu);\n    a[i][0] = studenti.num;\n    a[i][1] = studenti.yu + studenti.shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j][1] >= a[j + 1][1]) {\n        t = a[j][1];\n        a[j][1] = a[j + 1][1];\n        a[j + 1][1] = t;\n        s = a[j][0];\n        a[j][0] = a[j + 1][0];\n        a[j + 1][0] = s;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%ld %ld\\n\", a[n - i][0], a[n - i][1]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25647", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long int id;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\nlong int n;\n\nint main() {\n  struct student *p0, *p1, *p2, *head, *p;\n  int i;\n  scanf(\"%ld\\n\", &n);\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  head = p0;\n  p1 = p0;\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p1 = p0;\n  } else {\n    head = p0;\n    p0->next = p1;\n  }\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p2 = p0;\n  } else if (p0->total > p1->total && p0->total <= head->total) {\n    head->next = p0;\n    p0->next = p1;\n    p2 = p1;\n    p1 = p0;\n  } else if (p0->total > head->total) {\n    p0->next = head;\n    p2 = p1;\n    p1 = head;\n    head = p0;\n  }\n  p2->next = NULL;\n  for (i = 3; i < n; i++) {\n    p0 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n    p0->total = p0->yuwen + p0->shuxue;\n    if (p0->total > p2->total) {\n      if (p0->total <= p1->total) {\n        p1->next = p0;\n        p0->next = NULL;\n        p2 = p0;\n      } else if (p0->total > p1->total && p0->total <= head->total) {\n        head->next = p0;\n        p0->next = p1;\n        p1->next = NULL;\n        p1 = p2;\n        p0 = p1;\n      } else if (p0->total > head->total) {\n        p0->next = head;\n        p1->next = NULL;\n        p2 = p1;\n        p1 = head;\n        head = p0;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %d\\n\", p->id, p->total);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int id;\n    float yuwen, shuxue, sum;\n  } stu[100000], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].id << \" \" << stu[i].sum << \" \";\n}\n"}
{"label": "14", "index": "25649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100000], t;\n\n  int n;\n  int i;\n  int k;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n\n  for (k = n - 1; k > n - 4; k--) {\n    for (i = 0; i < k; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        t = stu[i];\n        stu[i] = stu[i + 1];\n        stu[i + 1] = t;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  int a[99999][3], s[99999];\n  int fir = 0, sec = 0, thi = 0;\n  int c = 0, d = 0, e = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 3; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n\n    s[i] = a[i][1] + a[i][2];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] > fir) {\n      thi = sec;\n      sec = fir;\n      fir = s[i];\n      e = d;\n      d = c;\n      c = i;\n      continue;\n    }\n    if (s[i] > sec && s[i] <= fir) {\n      thi = sec;\n\n      sec = s[i];\n      e = d;\n      d = i;\n      continue;\n    }\n    if (s[i] > thi && s[i] <= sec) {\n      thi = s[i];\n      e = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a[c][0], fir);\n  cout << a[d][0] << \" \" << sec << \"\\n\";\n  printf(\"%d %d\\n\", a[e][0], thi);\n  return 0;\n}\n"}
{"label": "14", "index": "25651", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    long num;\n    int chinese;\n    int math;\n  };\n  struct student stu[100001];\n  int i, t, h, l = 0;\n  long n;\n  int a[100001];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n  for (i = 0; i < n; i++)\n    a[i] = stu[i].chinese + stu[i].math;\nleap:\n  t = a[0];\n  h = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] > t) {\n      t = a[i];\n      h = i;\n    }\n  }\n  printf(\"%ld %d\\n\", stu[h].num, a[h]);\n  l++;\n  a[h] = 0;\n  if (l < 3)\n    goto leap;\n  return 0;\n}\n"}
{"label": "14", "index": "25652", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n  struct student *before;\n};\nint main() {\n  int i, n, n1 = 0, n2 = 0, n3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score1);\n  p1->sum = p1->score1 + p1->score2;\n  m1 = p1->sum;\n  n1 = p1->num;\n  head = 0;\n  i = 0;\n  while (i <= n - 2) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p1->before = p2;\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = p1->score1 + p1->score2;\n    if (p1->sum > m3 && p1->sum <= m2) {\n      m3 = p1->sum;\n      n3 = p1->num;\n    }\n    if (p1->sum > m2 && p1->sum <= m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = p1->sum;\n      n2 = p1->num;\n    }\n    if (p1->sum > m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = m1;\n      n2 = n1;\n      m1 = p1->sum;\n      n1 = p1->num;\n    }\n  }\n  printf(\"%d %d \", n1, m1);\n  printf(\"%d %d \", n2, m2);\n  printf(\"%d %d \", n3, m3);\n  return 0;\n}\n"}
{"label": "14", "index": "25653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  float num;\n  float chi, mat, total;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%f %f %f\", &p1->num, &p1->chi, &p1->mat);\n    p1->total = p1->chi + p1->mat;\n    if (i == 0) {\n      head = p2 = p1;\n    } else {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  int n, i, j;\n  float max;\n  struct stu *head, *maxi, *p;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  for (i = 0; i < 3; i++) {\n    p = head;\n    maxi = head;\n    max = head->total;\n    for (j = 0; j < n - 1; j++) {\n      p = p->next;\n      if (p->total > max) {\n        max = p->total;\n        maxi = p;\n      }\n    }\n\n    cout << maxi->num << \" \" << maxi->total << \"\\n\";\n    maxi->total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25654", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  long Id;\n  int yuwen;\n  int shuxue;\n};\n\nint main() {\n  int i, j;\n  long n;\n  struct Student student[1000];\n  struct Student temp;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%ld%d%d\", &student[i].Id, &student[i].yuwen, &student[i].shuxue);\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < (3 - i - 1); j++) {\n      if ((student[j + 1].yuwen + student[j + 1].shuxue) >\n          (student[j].yuwen + student[j].shuxue)) {\n        temp = student[j + 1];\n        student[j + 1] = student[j];\n        student[j] = temp;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[2].yuwen + student[2].shuxue)) {\n      student[2] = student[i];\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[1].yuwen + student[1].shuxue)) {\n      temp = student[1];\n      student[1] = student[i];\n      student[2] = temp;\n    }\n    if ((student[i].yuwen + student[i].shuxue) >\n        (student[0].yuwen + student[0].shuxue)) {\n      temp = student[0];\n      student[0] = student[i];\n      student[1] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d \", student[i].Id, (student[i].shuxue + student[i].yuwen));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct Stu {\n  int StuNo;\n  int Chinese;\n  int math;\n  int sum;\n  struct Stu *next;\n};\nint main() {\n  struct Stu *p, *head, *tail;\n  int n, i, max1, max2, max3, n1, n2, n3;\n  cin >> n;\n  head = tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct Stu *)malloc(1000);\n    cin >> p->StuNo >> p->Chinese >> p->math;\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    p->sum = p->Chinese + p->math;\n  }\n\n  max1 = head->sum;\n  n1 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max1) {\n      max1 = p->sum;\n      n1 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n1)\n      p->sum = 0;\n  }\n\n  max2 = head->sum;\n  n2 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max2) {\n      max2 = p->sum;\n      n2 = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if (i == n2)\n      p->sum = 0;\n  }\n\n  max3 = head->sum;\n  n3 = 1;\n  for (i = 1; i <= n; i++) {\n    if (i == 1)\n      p = head;\n    else\n      p = p->next;\n    if ((p->sum) > max3) {\n      max3 = p->sum;\n      n3 = i;\n    }\n  }\n  cout << n1 << \" \" << max1 << \" \" << n2 << \" \" << max2 << \" \" << n3 << \" \"\n       << max3 << \" \";\n}\n"}
{"label": "14", "index": "25656", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num;\n    int chi;\n    int math;\n  } stu[100000];\n\n  int n, i, j, mid;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (stu[j].math + stu[j].chi > stu[j - 1].chi + stu[j - 1].math) {\n        mid = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = mid;\n\n        mid = stu[j].chi;\n        stu[j].chi = stu[j - 1].chi;\n        stu[j - 1].chi = mid;\n\n        mid = stu[j].math;\n        stu[j].math = stu[j - 1].math;\n        stu[j - 1].math = mid;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math + stu[i].chi);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25657", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int d;\n  d = *((int *)elem2) - *((int *)elem1);\n  return d;\n}\nstruct student {\n  long int ID;\n  long int c;\n  long int m;\n};\nint main() {\n  long int n, i, j, k;\n  int b[100000];\n  int e[3];\n  cin >> n;\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].c, &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n\n  qsort(b, n, sizeof(long int), pfCompare);\n  for (i = 0; i < n; i++) {\n    if (b[0] == a[i].c + a[i].m) {\n      e[0] = a[i].ID;\n      j = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[1] == a[i].c + a[i].m) && i != j) {\n      e[1] = a[i].ID;\n      k = i;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((b[2] == a[i].c + a[i].m) && i != j && i != k) {\n      e[2] = a[i].ID;\n      break;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", e[i], b[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  cout << max1->num << \" \" << max1->math + max1->chinese << \" \";\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n}\n"}
{"label": "14", "index": "25659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  struct student {\n    int id;\n    int cp;\n    int mp;\n    int tp;\n  } stu[n], temp;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].cp >> stu[i].mp;\n    stu[i].tp = stu[i].cp + stu[i].mp;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].tp > stu[j - 1].tp) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].tp);\n  return 0;\n}\n"}
{"label": "14", "index": "25660", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int a;\n  int b;\n  int c;\n};\n\nint main() {\n  int n, i;\n  int x, y, z;\n\n  struct Student stu;\n  struct Student maxStu, smaxStu, tmaxStu;\n\n  cin >> n;\n  scanf(\"%d%d%d\", &x, &y, &z);\n  stu.number = x;\n  stu.a = y;\n  stu.b = z;\n  stu.c = stu.a + stu.b;\n  maxStu = stu;\n  smaxStu = stu;\n  tmaxStu = stu;\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d%d%d\", &x, &y, &z);\n    stu.number = x;\n    stu.a = y;\n    stu.b = z;\n    stu.c = stu.a + stu.b;\n    if (stu.c > maxStu.c) {\n      if (maxStu.c > smaxStu.c) {\n        if (smaxStu.c > tmaxStu.c) {\n          tmaxStu = smaxStu;\n        }\n        smaxStu = maxStu;\n      } else {\n        if (maxStu.c > tmaxStu.c) {\n          tmaxStu = maxStu;\n        }\n      }\n      maxStu = stu;\n    } else if (stu.c > smaxStu.c) {\n      if (smaxStu.c > tmaxStu.c)\n        tmaxStu = smaxStu;\n\n      smaxStu = stu;\n    } else if (stu.c > tmaxStu.c) {\n      tmaxStu = stu;\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxStu.number, maxStu.c, smaxStu.number,\n         smaxStu.c, tmaxStu.number, tmaxStu.c);\n  return 0;\n}\n"}
{"label": "14", "index": "25661", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long id;\n  int chinese;\n  int math;\n  int score;\n  struct student *next;\n};\n\nstruct student *creat(void) {\n  int num;\n  struct student *head, *p, *q;\n  q = NULL;\n  head = (struct student *)malloc(1000);\n  p = head;\n  cin >> num;\n  while (num > 0) {\n    q = p;\n    cin >> p->id >> p->chinese >> p->math;\n    p->score = p->chinese + p->math;\n    p = (struct student *)malloc(1000);\n    q->next = p;\n    num--;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i;\n  struct student *p, *head, *max[3];\n  head = creat();\n  p = head;\n  for (i = 0; i <= 2; i++) {\n    max[i] = (struct student *)malloc(1000);\n    max[i]->score = 0;\n  }\n  for (; p != NULL; p = p->next) {\n    if (p->score > max[0]->score) {\n      max[2] = max[1];\n      max[1] = max[0];\n      max[0] = p;\n    } else if (p->score > max[1]->score) {\n      max[2] = max[1];\n      max[1] = p;\n    } else if (p->score > max[2]->score) {\n      max[2] = p;\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%ld %d \", max[i]->id, max[i]->score);\n  }\n}\n"}
{"label": "14", "index": "25662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, e, f, g, h;\n  int *a, *b, *c;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  c = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < n; i++)\n    a[i] = b[i] + c[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] > m)\n      m = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  b[i] = 0;\n  a[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  cout << i + 1 << \" \" << m << \" \";\n  a[i] = 0;\n  b[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  cout << i + 1 << \" \" << m << \" \";\n  free(a);\n  a = 0;\n  free(b);\n  b = 0;\n  free(c);\n  c = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25663", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max = 0, maxj = 0;\n  if (n >= 3) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n  } else {\n    if (stu[0].sum > stu[1].sum)\n      cout << stu[0].num << ' ' << stu[0].sum << endl\n           << stu[1].num << ' ' << stu[1].sum;\n    else\n      cout << stu[1].num << ' ' << stu[1].sum << endl\n           << stu[0].num << ' ' << stu[0].sum;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  scanf(\"%d\\n\", &n);\n  int j, b[100000] = {0}, t, s;\n  struct student {\n    int num;\n    int lang;\n    int math;\n  };\n  struct student a[100000];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\\n\", &a[i].num, &a[i].lang, &a[i].math);\n  for (i = 0; i < n; i++)\n    b[i] = a[i].lang + a[i].math;\n  for (j = 0; j < 3; j++)\n    for (i = 1; i < n - j; i++)\n      if (b[j] < b[j + i]) {\n        t = b[j];\n        b[j] = b[j + i];\n        b[j + i] = t;\n      }\n  for (j = 0; j < 3; j++)\n    for (i = 0; i < n; i++) {\n      m = a[i].lang + a[i].math;\n      if (m == b[j] && i != s) {\n        printf(\"%d %d\\n\", a[i].num, m);\n        s = i;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "25665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\ntypedef struct st {\n  int a, b;\n} stu;\nstu s[100000];\nint comp(const void *a, const void *b) { return ((stu *)b)->b - ((stu *)a)->b; }\nint main() {\n  int i, n, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &a, &b);\n    s[i].b = a + b;\n  }\n  qsort(s, n, sizeof(stu), comp);\n  cout << s[0].a << \" \" << s[0].b << \"\\n\"\n       << s[1].a << \" \" << s[1].b << \"\\n\"\n       << s[2].a << \" \" << s[2].b;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chin;\n  int sum;\n} st[100000], t;\nint main() {\n  int i, j;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &st[i].number, &st[i].math, &st[i].chin);\n    st[i].sum = st[i].math + st[i].chin;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n; j >= 1; j--)\n      if (st[j].sum > st[j - 1].sum) {\n        t = st[j - 1];\n        st[j - 1] = st[j];\n        st[j] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", st[i].number, st[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, y, s, z, x, a, b, c, ax, bx, cx;\n  scanf(\"%d\", &n);\n  a = 0;\n  b = 0;\n  c = 0;\n  ax = 0;\n  bx = 0;\n  cx = 0;\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d %d %d\", &x, &y, &s);\n    z = y + s;\n    if (c >= z)\n      continue;\n    else if (b >= z) {\n      c = z;\n      cx = x;\n    } else if (a >= z) {\n      c = b;\n      cx = bx;\n      b = z;\n      bx = x;\n    } else {\n      c = b;\n      cx = bx;\n      b = a;\n      bx = ax;\n      a = z;\n      ax = x;\n    }\n  }\n  printf(\"%d %d\\n\", ax, a);\n  cout << bx << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", cx, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n  int score;\n};\nint main() {\n  int n;\n  int i, k, j;\n  struct Student student[100000];\n  struct Student temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    scanf(\"%d\", &student[i].math);\n    student[i].score = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (student[j].score > student[k].score)\n        k = j;\n    }\n    if (k != i) {\n      temp = student[i];\n      student[i] = student[k];\n      student[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[i].num, student[i].score);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, First = 0, FirstNum, Second = 0, SecondNum, Third = 0, ThirdNum;\n  scanf(\"%d\", &n);\n  struct Student {\n    int Chinese;\n    int Math;\n    int Sum;\n    int Num;\n  } Student[n + 1];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &Student[i].Num, &Student[i].Chinese, &Student[i].Math);\n    Student[i].Sum = Student[i].Chinese + Student[i].Math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > First) {\n      First = Student[i].Sum;\n      FirstNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Second && Student[i].Sum <= First && i != FirstNum) {\n      Second = Student[i].Sum;\n      SecondNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Third && Student[i].Sum <= Second && i != SecondNum &&\n        i != FirstNum) {\n      Third = Student[i].Sum;\n      ThirdNum = i;\n    }\n  }\n  printf(\"%d %d\\n\", FirstNum, First);\n  cout << SecondNum << \" \" << Second << \"\\n\";\n  printf(\"%d %d\\n\", ThirdNum, Third);\n}\n"}
{"label": "14", "index": "25670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n\n  for (i = 0; i < m - 1; i++)\n\n  {\n\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    cout << q->num << \" \" << q->sum << \" \";\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head;\n  head = creat(m);\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max_1 = 0;\n\nstruct student {\n  char id[20];\n  int chinese;\n  int math;\n  int sum;\n  int flag;\n  struct student *next;\n};\nstruct student *h;\nint n, i;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  p1->flag = 0;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p1->flag = 0;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *compare() {\n  struct student *p1, *p3;\n  p1 = h;\n  max_1 = p1->sum;\n  do {\n    if (p1->sum > max_1 && (p1->flag == 0))\n      max_1 = p1->sum;\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  p1 = h;\n  do {\n    if (p1->sum == max_1 && (p1->flag == 0)) {\n      p3 = p1;\n      p1->flag = 1;\n      break;\n    }\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  return (p3);\n}\nint main() {\n  int j;\n  struct student *p;\n  scanf(\"%d\", &n);\n  h = creat();\n  for (j = 1; j <= 3; j++) {\n    p = compare();\n    printf(\"%s %d \", p->id, p->sum);\n  }\n}\n"}
{"label": "14", "index": "25672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student student[100000];\n  int n, i, max, maxID;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].yuwen, &student[i].shuxue);\n  for (i = 1; i <= n; i++)\n    student[i].zongfen = student[i].yuwen + student[i].shuxue;\n  for (int j = 1; j <= 3; j++) {\n    maxID = 1;\n    max = student[1].zongfen;\n    for (i = 2; i <= n; i++)\n      if (student[i].zongfen > max) {\n        maxID = student[i].ID;\n        max = student[i].zongfen;\n      }\n    cout << maxID << \" \" << max << \"\\n\";\n    student[maxID].zongfen = 0;\n  }\n}\n"}
{"label": "14", "index": "25673", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint first[3], firsti[3];\nstruct stu {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n\n} * p1, *p2;\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  while (n--) {\n    cin >> p1->num >> p1->chinese >> p1->math;\n    if (head == NULL)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct stu *sum(struct stu *head, int n) {\n  p1 = head;\n  while (n--) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct stu *head, *f1, *f2, *f3;\n  f1 = (struct stu *)malloc(sizeof(struct stu));\n  cin >> n;\n  head = creat(n);\n  head = sum(head, n);\n  p1 = head;\n  if (n == 1) {\n    printf(\"%d %d\\n\", p1->num, p1->sum);\n    return 0;\n  }\n\n  for (i = 0, f1 = head; i < n; i++, p1 = p1->next)\n    if (f1->sum < p1->sum)\n      f1 = p1;\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f1) {\n      head = p1;\n      break;\n    } else if (p1 == f1) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f2 = head; i < n - 1; i++, p1 = p1->next)\n    if (f2->sum < p1->sum)\n      f2 = p1;\n  if (n == 2) {\n    printf(\"%d %d\\n\", f1->num, f1->sum);\n    printf(\"%d %d\\n\", f2->num, f2->sum);\n    return 0;\n  }\n  p1 = head;\n  for (i = 0; i < n - 1; i++) {\n    p2 = p1;\n    p1 = p1->next;\n    if (head == f2) {\n      head = p1;\n      break;\n    } else if (p1 == f2) {\n      p2->next = p1->next;\n    }\n  }\n  p1 = head;\n  for (i = 0, f3 = head; i < n - 2; i++, p1 = p1->next)\n    if (f3->sum < p1->sum)\n      f3 = p1;\n  printf(\"%d %d\\n\", f1->num, f1->sum);\n  printf(\"%d %d\\n\", f2->num, f2->sum);\n  printf(\"%d %d\\n\", f3->num, f3->sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct r {\n    int a;\n    int b;\n    int c;\n  } r[99999];\n  int i, n, x = 0, y = 0, z = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d%d%d\", &r[i].a, &r[i].b, &r[i].c);\n\n  for (i = 1; i <= n; i++) {\n    if (r[i].b + r[i].c > m1) {\n      m1 = r[i].b + r[i].c;\n      x = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m1) && (i != x)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    } else if ((m1 > r[i].b + r[i].c) && (r[i].b + r[i].c > m2)) {\n      m2 = r[i].b + r[i].c;\n      y = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if ((r[i].b + r[i].c == m2) && (i != y) && (i != x)) {\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n\n    else if ((m2 > r[i].b + r[i].c) && (r[i].b + r[i].c > m3)) {\n\n      m3 = r[i].b + r[i].c;\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", x, m1);\n  printf(\"%d %d\\n\", y, m2);\n  printf(\"%d %d\\n\", z, m3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int YW;\n    int SX;\n  };\n  struct student stu[100000];\n  int ZF[100000];\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].YW);\n    scanf(\"%d\", &stu[i].SX);\n    ZF[i] = stu[i].YW + stu[i].SX;\n  }\n  int a = 0, b = 0, c = 0, A = 0, B = 0, C = 0;\n  for (int i = 0; i < n; i++) {\n    if (ZF[i] > a) {\n      c = b;\n      C = B;\n      b = a;\n      B = A;\n      a = ZF[i];\n      A = i;\n    } else if (ZF[i] > b) {\n      c = b;\n      C = B;\n      b = ZF[i];\n      B = i;\n    } else if (ZF[i] > c) {\n      c = ZF[i];\n      C = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[A].ID, a);\n  printf(\"%d %d\\n\", stu[B].ID, b);\n  printf(\"%d %d\\n\", stu[C].ID, c);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25676", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, e = 0, max, y;\n  scanf(\"%d\", &n);\n  struct st {\n    int a;\n    int z;\n    int c;\n    int d;\n  } b[100000];\n  for (i = 0; i < n; i++) {\n    cin >> b[i].a >> b[i].z >> b[i].c;\n    b[i].d = b[i].z + b[i].c;\n  }\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (b[j].d > max) {\n        max = b[j].d;\n        y = j;\n      }\n    }\n    printf(\"%d %d\\n\", b[y].a, b[y].d);\n    e++;\n    b[y].d = 0;\n    if (e == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25677", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int chi;\n    int mat;\n  } stu[100000];\n  int n, i, max1, max2, max3, maxn1, maxn2, maxn3;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    cin >> stu[i].chi;\n    scanf(\"%d\", &stu[i].mat);\n    sum[i] = stu[i].chi + stu[i].mat;\n  }\n  max1 = sum[0];\n  maxn1 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      maxn1 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn1, max1);\n  max2 = sum[0];\n  maxn2 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max2 && i != maxn1 - 1) {\n      max2 = sum[i];\n      maxn2 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn2, max2);\n  max3 = sum[0];\n  maxn3 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max3 && i != maxn1 - 1 && i != maxn2 - 1) {\n      max3 = sum[i];\n      maxn3 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  long num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  long i, n, j, k;\n  int t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++)\n      if (stu[j].sum > stu[j + 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j + 1].sum;\n        stu[j + 1].sum = t;\n      }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    if (k != n - 1 && stu[k].sum == stu[k + 1].sum)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (stu[k].sum == (stu[i].yu + stu[i].shu)) {\n        cout << stu[i].num << \" \" << stu[k].sum << \"\\n\";\n        if (k == n - 3) {\n          break;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "25679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n} stu[100000];\n\nint main() {\n\n  int n, i, j, t, a, b;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    cout << stu[a].num << \" \" << stu[a].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25680", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu *create();\nint compare(const void *a, const void *b);\nint main() {\n  int i, j = 0, n;\n  cin >> n;\n  struct stu {\n    int num;\n    int chi;\n    int math;\n    int total;\n  };\n  struct stu *p = (struct stu *)calloc(n, sizeof(struct stu));\n  struct stu *a = p;\n  int *tot = (int *)calloc(n, sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chi, &p->math);\n    *(tot + i) = p->total = p->chi + p->math;\n    p++;\n  }\n  qsort(tot, n, sizeof(int), compare);\n  for (i = 0; i < 3; i++, j = 0) {\n    while ((a + (j++))->total != *(tot + i))\n      ;\n    printf(\"%d %d\\n\", (a + j - 1)->num, (a + j - 1)->total);\n    (a + j - 1)->total = -1;\n  }\n\n  return 0;\n}\n\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\n"}
{"label": "14", "index": "25681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num, ch, ma, grade;\n  } sum[100000], h, m, t;\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &sum[i].num, &sum[i].ch, &sum[i].ma);\n    sum[i].grade = sum[i].ch + sum[i].ma;\n  }\n  h.grade = m.grade = t.grade = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i].grade > h.grade) {\n      t = m;\n      m = h;\n      h = sum[i];\n    } else if (sum[i].grade > m.grade) {\n      t = m;\n      m = sum[i];\n    } else if (sum[i].grade > t.grade)\n      t = sum[i];\n  }\n  cout << h.num << \" \" << h.grade << \"\\n\"\n       << m.num << \" \" << m.grade << \"\\n\"\n       << t.num << \" \" << t.grade << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int num[100000], a[100000], b[100000], sum[100000];\n} data;\n\nint main(int argc, char *argv[]) {\n  int i, n, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data.num[i], &data.a[i], &data.b[i]);\n    data.sum[i] = data.a[i] + data.b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (data.sum[i] > data.sum[x]) {\n      z = y;\n      y = x;\n      x = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[x] && data.sum[i] > data.sum[y]) {\n      z = y;\n      y = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[y] && data.sum[i] > data.sum[z]) {\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", data.num[x], data.sum[x]);\n  cout << data.num[y] << \" \" << data.sum[y] << \"\\n\";\n  printf(\"%d %d\", data.num[z], data.sum[z]);\n}\n"}
{"label": "14", "index": "25683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct info {\n  int num;\n  int chin;\n  int math;\n  struct info *next;\n};\nstruct info *create(int n) {\n  int i;\n  struct info *head, *p1, *p2;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  cin >> p1->num >> p1->chin >> p1->math;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  } while (i < n);\n  return (head);\n}\nvoid arrange(struct info *head) {\n  int m, no1, no2, no3;\n  struct info *p;\n  p = head;\n  m = 0;\n  while (p) {\n    if (p->chin + p->math > m) {\n      m = p->chin + p->math;\n      no1 = p->num;\n    }\n    p = p->next;\n  }\n  cout << no1 << \" \" << m << \"\\n\";\n  m = 0;\n  p = head;\n  no2 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1) {\n      m = p->chin + p->math;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no2, m);\n  m = 0;\n  p = head;\n  no3 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1 && p->num != no2) {\n      m = p->chin + p->math;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no3, m);\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25684", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    printf(\"%d %d \", p1->id, p1->s);\n    p1->s = -1;\n  }\n}\n"}
{"label": "14", "index": "25685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\nint main() {\n  int i, j, n, a[100000], max;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%d %d\\n\", stu[i].num, a[i]);\n        a[i] = 0;\n        break;\n      }\n  }\n}\n"}
{"label": "14", "index": "25686", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int score1;\n  int score2;\n  struct stu *next;\n};\nstruct stu *creat(void) {\n  int n, i = 1;\n  struct stu *head;\n  struct stu *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  head = NULL;\n  while (i <= n) {\n    scanf(\"%ld %d %d\", &p1->num, &p1->score1, &p1->score2);\n    if (i == 1)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != n)\n      p1 = p2->next = (struct stu *)malloc(1000);\n    else\n      p1->next = NULL;\n    i++;\n  }\n  return (head);\n}\nvoid turn(struct stu *head) {\n  int t = 1, r = 1, a;\n  struct stu *q1, *q2, *p3, *p1, *p2;\n  for (q1 = p3 = p2 = head; q1->next != NULL, t <= 3; t++) {\n    a = 0;\n    for (q2 = p1 = q1->next, r = 1; q2 != NULL; q2 = q2->next, r++) {\n\n      if ((q1->score1 + q1->score2) < (q2->score1 + q2->score2)) {\n        q1 = q2;\n        p2 = p1;\n        a = 1;\n      }\n      if (r != 1)\n        p1 = p1->next;\n    }\n    printf(\"%ld %d \", q1->num, q1->score1 + q1->score2);\n    if (a == 1) {\n      p2->next = q1->next;\n      q1 = head;\n    } else {\n      q1 = p3->next;\n      p3 = q1;\n    }\n  }\n}\nint main() {\n  struct stu *ip;\n  ip = creat();\n  turn(ip);\n}\n"}
{"label": "14", "index": "25687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n    int amount;\n  };\n  struct student stu[100000];\n  int a[100000], n, l, j, k;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n    a[i] = stu[i].chinese + stu[i].maths;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (int h = n - 1; h >= 0; h--) {\n    if (a[n - 1] == stu[h].chinese + stu[h].maths) {\n      l = stu[h].num;\n    }\n  }\n  for (int g = n - 1; g >= 0; g--) {\n    if (a[n - 2] == stu[g].chinese + stu[g].maths && (g + 1) != l) {\n      j = stu[g].num;\n    }\n  }\n  for (int f = n - 1; f >= 0; f--) {\n    if (a[n - 3] == stu[f].chinese + stu[f].maths && (f + 1) != j &&\n        (f + 1) != l) {\n      k = stu[f].num;\n    }\n  }\n  printf(\"%d %d\\n\", l, a[n - 1]);\n  printf(\"%d %d\\n\", j, a[n - 2]);\n  printf(\"%d %d\\n\", k, a[n - 3]);\n}\n"}
{"label": "14", "index": "25688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chin;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i, j, tem, temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int max[3] = {0};\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[max[0]].sum) {\n      tem = max[0];\n      temp = max[1];\n      max[0] = i;\n      max[1] = tem;\n      max[2] = temp;\n    } else {\n      if (stu[i].sum > stu[max[1]].sum) {\n        tem = max[1];\n        max[1] = i;\n        max[2] = tem;\n      } else {\n        if (stu[i].sum > stu[max[2]].sum)\n          max[2] = i;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[max[i]].id, stu[max[i]].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} a[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].chinese >> a[i].math;\n    a[i].total = a[i].chinese + a[i].math;\n  }\n  int max, numm;\n  max = a[1].total;\n  for (int j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (max < a[i].total) {\n        max = a[i].total;\n        numm = i;\n      }\n    }\n    cout << numm + 1 << \" \" << max << \"\\n\";\n    a[numm].total = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25690", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b, c, d;\n  struct {\n    int sn;\n    int chi;\n    int mat;\n    int sum;\n  } a[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].sn >> a[i].chi >> a[i].mat;\n    a[i].sum = a[i].chi + a[i].mat;\n  }\n  b = n;\n  c = n;\n  d = n;\n  a[n].sum = -100;\n  for (i = 0; i < n; i++) {\n    if (a[b].sum >= a[i].sum)\n      b = b;\n    else\n      b = i;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != b) {\n      if (a[c].sum >= a[i].sum)\n        c = c;\n      else\n        c = i;\n    } else\n      ;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != c & i != b) {\n      if (a[d].sum >= a[i].sum)\n        d = d;\n      else\n        d = i;\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", a[b].sn, a[b].sum);\n  printf(\"%d %d\\n\", a[c].sn, a[c].sum);\n  printf(\"%d %d\\n\", a[d].sn, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25691", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", (*p).num, &(*p).chinese, &(*p).math);\n  (*p).sum = ((*p).chinese + (*p).math);\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      (*p).next = NULL;\n    } else if (i < 4) {\n      for (h = head, j = 0; j < i; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else if (j == i) {\n        (*g).next = p;\n        (*p).next = NULL;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    cin >> (*p).num >> (*p).chinese >> (*p).math;\n    (*p).sum = ((*p).chinese + (*p).math);\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = (*p).next)\n    printf(\"%s %d \", (*p).num, (*p).sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "25692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, max = 0, smax = 0, tmax = 0, id[3] = {0}, a, b, c;\n  struct student {\n    int No;\n    int yuwen;\n    int math;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (max < stu[i].yuwen + stu[i].math) {\n      max = stu[i].yuwen + stu[i].math;\n      id[0] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (smax < stu[i].yuwen + stu[i].math && i != id[0] - 1) {\n      smax = stu[i].yuwen + stu[i].math;\n      id[1] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (tmax < stu[i].yuwen + stu[i].math && i != id[0] - 1 && i != id[1] - 1) {\n      tmax = stu[i].yuwen + stu[i].math;\n      id[2] = stu[i].No;\n    }\n  }\n  a = id[0];\n  b = id[1];\n  c = id[2];\n  printf(\"%d %d\\n\", a, max);\n  printf(\"%d %d\\n\", b, smax);\n  printf(\"%d %d\\n\", c, tmax);\n  return 0;\n}\n"}
{"label": "14", "index": "25693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, max1, xue1, max2, xue2, max3, xue3;\nstruct chengji {\n  int xh;\n  int yw;\n  int sx;\n  int zf;\n  struct chengji *next;\n};\n\nvoid create() {\n  struct chengji *head;\n  struct chengji *p1;\n  int i = 0;\n  while (i < n) {\n    i++;\n    if (i == 1)\n      head = p1;\n    p1 = (struct chengji *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    if ((p1->zf) > max1) {\n      xue3 = xue2;\n      max3 = max2;\n      xue2 = xue1;\n      max2 = max1;\n      xue1 = p1->xh;\n      max1 = p1->zf;\n\n    } else {\n      if ((p1->zf) > max2 && (p1->zf) <= max1) {\n        xue3 = xue2;\n        max3 = max2;\n        xue2 = p1->xh;\n        max2 = p1->zf;\n      } else {\n        if ((p1->zf) > max3 && (p1->zf) <= max2) {\n          xue3 = p1->xh;\n          max3 = p1->zf;\n        }\n      }\n    }\n\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  max1 = 0, max2 = 0, max3 = 0;\n  create();\n  printf(\"%d %d \", xue1, max1);\n  printf(\"%d %d \", xue2, max2);\n  printf(\"%d %d\", xue3, max3);\n}\n"}
{"label": "14", "index": "25694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int j;\n  int x, y;\n  int z;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, a = 0, b = 0, c = 0, a1, b1, c1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].j >> stu[i].x >> stu[i].y;\n    stu[i].z = stu[i].x + stu[i].y;\n  }\n  for (i = 0; i < n; i++) {\n    if (a < stu[i].z) {\n      a = stu[i].z;\n      a1 = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b < stu[i].z && i != a1) {\n      b = stu[i].z;\n      b1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c < stu[i].z && i != a1 && i != b1) {\n      c = stu[i].z;\n      c1 = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[a1].j, stu[a1].z, stu[b1].j, stu[b1].z,\n         stu[c1].j, stu[c1].z);\n  return 0;\n}\n"}
{"label": "14", "index": "25695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stud {\n  int id;\n  float langrade;\n  float mathgrade;\n} student[100000], s;\nint student_num;\nfloat total[100000], t;\nvoid trisort() {\n  for (int i = 0; i < 2; i++)\n    for (int j = 0; j < 2 - i; j++)\n      if (total[j] < total[j + 1]) {\n        t = total[j];\n        s = student[j];\n        total[j] = total[j + 1];\n        student[j] = student[j + 1];\n        total[j + 1] = t;\n        student[j + 1] = s;\n      }\n}\nint main() {\n  int i, j;\n  cin >> student_num;\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].id >> student[i].langrade >> student[i].mathgrade;\n    total[i] = student[i].langrade + student[i].mathgrade;\n  }\n  for (j = 3; j < student_num; j++) {\n    trisort();\n    if (total[j] > total[2]) {\n      t = total[2];\n      s = student[2];\n      total[2] = total[j];\n      student[2] = student[j];\n      total[j] = t;\n      student[j] = s;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << student[i].id << \" \" << total[i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct person {\n  char num[6];\n  int Chinese;\n  int math;\n  int total;\n} stu[100000];\n\nint main() {\n  int n, i, max, j, k, temp = 0, tnum = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].Chinese;\n    cin >> stu[i].math;\n    stu[i].total = stu[i].math + stu[i].Chinese;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > max) {\n        max = stu[i].total;\n        k = i;\n      }\n    }\n    cout << stu[k].num << \" \" << stu[k].total << \"\\n\";\n    stu[k].total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int add;\n};\nstruct student stu[100000];\nint main() {\n  int m, k, n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].add = stu[i].chi + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n - 1; i > 0; i--) {\n      if (stu[i].add > stu[i - 1].add) {\n        k = stu[i].add;\n        stu[i].add = stu[i - 1].add;\n        stu[i - 1].add = k;\n        m = stu[i].num;\n        stu[i].num = stu[i - 1].num;\n        stu[i - 1].num = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].add << \"\\n\";\n}\n"}
{"label": "14", "index": "25698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k;\n  scanf(\"%d \", &N);\n  struct Student_Num {\n    int num;\n    int Chinese;\n    int Math;\n  };\n  struct Student_Num student[N];\n  struct Student_Num temp;\n  for (i = 0; i < N; i++) {\n    cin >> student[i].num >> student[i].Chinese >> student[i].Math;\n  }\n  int total[N], totalNum[3], p[3];\n  for (i = 0; i < N; i++) {\n    total[i] = student[i].Chinese + student[i].Math;\n  }\n  for (i = 0; i < 3; i++) {\n    totalNum[i] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < N; j++) {\n      if (totalNum[i] < total[j]) {\n        totalNum[i] = total[j];\n        p[i] = j;\n      }\n    }\n    total[p[i]] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[p[i]].num, totalNum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max = 0, maxj = 0;\n  if (n >= 3) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n  } else {\n    if (stu[0].sum > stu[1].sum)\n      cout << stu[0].num << ' ' << stu[0].sum << endl\n           << stu[1].num << ' ' << stu[1].sum;\n    else\n      cout << stu[1].num << ' ' << stu[1].sum << endl\n           << stu[0].num << ' ' << stu[0].sum;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int no;\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu a, *head, *p, *tail, *q;\n  int k, i, m1, m2, m3, n1, n2, n3, temp1, temp2;\n  head = NULL;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    p = (struct stu *)malloc(1000);\n    cin >> p->no >> p->chi >> p->math;\n    p->sum = (p->chi + p->math);\n    if (head == NULL) {\n      head = tail = p;\n    } else {\n      tail->next = p;\n      tail = p;\n      tail->next = &a;\n    }\n  }\n  a.next = NULL;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m1 = p->no;\n  n1 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m2 = p->no;\n  n2 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m3 = p->no;\n  n3 = p->sum;\n  cout << m1 << \" \" << n1 << \" \" << m2 << \" \" << n2 << \" \" << m3 << \" \" << n3\n       << \" \";\n}\n"}
{"label": "14", "index": "25701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c;\n  struct student {\n    int id;\n    int score;\n  } stu[100000], t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> b >> c;\n    stu[i].score = b + c;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].score > stu[j - 1].score) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].score);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  float one = 0, two = 0, three = 0, yi = 0, er = 0, san = 0;\n  float a[100000][2];\n  cin >> n;\n  struct Student {\n    float xuehao;\n    float yuwen;\n    float shuxue;\n  } student;\n  for (i = 0; i < n; i++) {\n    scanf(\"%f %f %f\", &student.xuehao, &student.yuwen, &student.shuxue);\n    for (j = 0; j < 2; j++) {\n      a[i][1] = student.yuwen + student.shuxue;\n      a[i][0] = i + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > one) {\n      one = a[i][1];\n      yi = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > two && a[i][1] <= one && a[i][0] != yi) {\n      two = a[i][1];\n      er = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > three && a[i][1] <= one && a[i][1] <= two && a[i][0] != yi &&\n        a[i][0] != er) {\n      three = a[i][1];\n      san = a[i][0];\n    }\n  }\n  cout << fixed << setprecision(0) << yi << \" \" << one << \"\\n\";\n  printf(\"%.0f %.0f\\n\", er, two);\n  printf(\"%.0f %.0f\\n\", san, three);\n  return 0;\n}\n"}
{"label": "14", "index": "25703", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int sum;\n} stu[100000];\n\nint main(int argc, char *argv[]) {\n  int i, n;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxid1 = 0, maxid2 = 0, maxid3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].sum = stu[i].math + stu[i].chinese;\n    if (stu[i].sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = maxid1;\n      maxid1 = stu[i].id;\n    } else if (stu[i].sum > max2) {\n      max3 = max2;\n      max2 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = stu[i].id;\n    } else if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxid3 = stu[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxid1, max1, maxid2, max2, maxid3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, k, a, b, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &a, &b);\n    stu[i].sum = a + b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - i - 1; j > 0; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "25705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct Student {\n    int ID;\n    int Chinese;\n    int Math;\n    int sum;\n  } student[100000];\n  int i, j, n;\n  struct Student t;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &student[i].ID, &student[i].Chinese, &student[i].Math);\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].Chinese + student[i].Math <\n          student[j].Chinese + student[j].Math) {\n        t = student[i];\n        student[i] = student[j];\n        student[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << student[i].ID << \" \" << student[i].Chinese + student[i].Math\n         << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000];\n  struct Student temp;\n  int i, n, j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].total >= stu[m + 1].total) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].ID << \" \" << stu[i].total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25707", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chi >> p1->math;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n  struct student *head, *p, *p1, *p2, *p3;\n  int n, m1, m2, m3, k;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  m1 = m2 = m3 = 0;\n  if (head != NULL) {\n    do {\n      k = p->chi + p->math;\n      if (k > m1) {\n        m1 = k;\n        p1 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m2) && (p != p1)) {\n        m2 = k;\n        p2 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m3) && (p != p1) && (p != p2)) {\n        m3 = k;\n        p3 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  cout << p1->num << \" \" << m1 << \" \" << p2->num << \" \" << m2 << \" \" << p3->num\n       << \" \" << m3 << \" \";\n}\n"}
{"label": "14", "index": "25708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int liter;\n  int math;\n  int total;\n};\nint main() {\n  int i, j, k, n;\n  struct student a[100000], n1, n2, n3;\n  scanf(\"%d\", &n);\n  scanf(\"%d%d%d\", &a[0].num, &a[0].liter, &a[0].math);\n  a[0].total = a[0].liter + a[0].math;\n  n1 = n2 = n3 = a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].liter, &a[i].math);\n    a[i].total = a[i].liter + a[i].math;\n    if (a[i].total > n1.total) {\n      n3 = n2;\n      n2 = n1;\n      n1 = a[i];\n    } else if (a[i].total > n2.total) {\n      n3 = n2;\n      n2 = a[i];\n    } else if (a[i].total > n3.total)\n      n3 = a[i];\n  }\n  printf(\"%d %d\\n\", n1.num, n1.total);\n  printf(\"%d %d\\n\", n2.num, n2.total);\n  printf(\"%d %d\", n3.num, n3.total);\n  return 0;\n}\n"}
{"label": "14", "index": "25709", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int stuno;\n    int score1;\n    int score2;\n    int score0;\n  };\n  int n, i, j, temp;\n  cin >> n;\n  struct student num[n];\n  for (i = 0; i < n; i++) {\n    cin >> num[i].stuno;\n    cin >> num[i].score1;\n    cin >> num[i].score2;\n    num[i].score0 = num[i].score1 + num[i].score2;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i].score0 < num[j].score0) {\n        temp = num[i].score0;\n        num[i].score0 = num[j].score0;\n        num[j].score0 = temp;\n        temp = num[i].stuno;\n        num[i].stuno = num[j].stuno;\n        num[j].stuno = temp;\n      }\n  for (i = 0; i < 3 && i < n; i++)\n    cout << num[i].stuno << \" \" << num[i].score0 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25710", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int scorec;\n  int scorem;\n  int score;\n};\n\nint main() {\n  int n;\n  int i;\n  struct student stu[100001];\n  int best[2][3] = {{0, 0, 0}, {0, 0, 0}};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].scorec >> stu[i].scorem;\n    stu[i].score = stu[i].scorec + stu[i].scorem;\n  }\n  for (i = 1; i <= n; i++) {\n    if (stu[i].score > best[1][0]) {\n      best[0][2] = best[0][1];\n      best[0][1] = best[0][0];\n      best[0][0] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = best[1][0];\n      best[1][0] = stu[i].score;\n    } else {\n      if (stu[i].score <= best[1][0] && stu[i].score > best[1][1]) {\n        best[0][2] = best[0][1];\n        best[0][1] = stu[i].num;\n        best[1][2] = best[1][1];\n        best[1][1] = stu[i].score;\n      } else {\n        if (stu[i].score <= best[1][1] && stu[i].score > best[1][2]) {\n          best[0][2] = stu[i].num;\n          best[1][2] = stu[i].score;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << best[0][i] << ' ' << best[1][i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25711", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j, max;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    struct student *next;\n  };\n  struct student *head, *ppre, *p0, *p3;\n  struct student *p1, *p2;\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (j = 0; j < 3; j++) {\n    ppre = p1 = head;\n    max = p1->yuwen + p1->shuxue;\n    p1 = p1->next;\n    for (i = 0; i < n - j; i++) {\n      if ((p1->yuwen + p1->shuxue) > max) {\n        max = p1->yuwen + p1->shuxue;\n        p0 = p1;\n        p3 = ppre;\n      }\n      ppre = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p0->num, max);\n    p3->next = p0->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int yu;\n  int shu;\n  struct student *next;\n};\nint main() {\n  int n, i, j = 0;\n\n  struct student *head, *p1, *p2;\n\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->yu, &p1->shu);\n    p1 = (struct student *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 200; i > 10; i--) {\n    p1 = head;\n    while (p1 != NULL) {\n      if ((p1->yu + p1->shu) == i) {\n        printf(\"%d %d \", p1->id, i);\n        j++;\n      }\n      p1 = p1->next;\n      if (j == 3)\n        break;\n    }\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stud {\n  int num;\n  int score, score1, score2;\n  struct stud *next;\n} head, end_1;\nvoid create(int n) {\n  int i;\n  struct stud *p1, *p2;\n  head.next = NULL;\n  for (i = 0; i <= n - 1; i++) {\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    if (!i)\n      head.next = p1;\n    else\n      p2->next = p1;\n    scanf(\"%d\", &p1->num);\n    scanf(\"%d\", &p1->score1);\n    scanf(\"%d\", &p1->score2);\n    p1->score = p1->score1 + p1->score2;\n    p2 = p1;\n  }\n  p2->next = &end_1;\n}\nvoid find() {\n  struct stud *max1, *max2, *max3, *p1, *swap; \n  max1 = head.next;\n  max2 = max1->next;\n  max3 = max2->next;\n  p1 = max3->next;\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  if (max2->score < max3->score) {\n    swap = max2;\n    max2 = max3;\n    max3 = swap;\n  }\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  while (p1 != &end_1) {\n    if (p1->score > max3->score)\n      max3 = p1;\n    if (max3->score > max2->score) {\n      swap = max3;\n      max3 = max2;\n      max2 = swap;\n    }\n    if (max2->score > max1->score) {\n      swap = max1;\n      max1 = max2;\n      max2 = swap;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d \", max1->num, max1->score);\n  printf(\"%d %d \", max2->num, max2->score);\n  printf(\"%d %d \", max3->num, max3->score);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  create(n);\n  find();\n}\n"}
{"label": "14", "index": "25714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct inf {\n  int nu;\n  int b;\n  int c;\n  int sum;\n} a[100010], tmp;\nint main() {\n  int n, i, j, k, tmp1, tmp2;\n  char c;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    a[i - 1].sum = 0;\n    scanf(\"%d%d%d\", &a[i - 1].nu, &a[i - 1].b, &a[i - 1].c);\n    a[i - 1].sum = a[i - 1].b + a[i - 1].c;\n  }\n  for (i = 0; i < 3; i++) {\n    tmp1 = i;\n    tmp2 = a[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (a[j].sum > tmp2) {\n        tmp2 = a[j].sum;\n        tmp1 = j;\n      }\n    }\n    tmp = a[i];\n    a[i] = a[tmp1];\n    a[tmp1] = tmp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].nu, a[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct student *next;\n};\nint n;\nstruct student *creat(int i) {\n  struct student *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->c + p1->b;\n  head = NULL;\n  while (n < i - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->c + p1->b;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid del(struct student *ahead, int num) {\n  struct student *p1, *p2;\n  p1 = ahead;\n  while (num != p1->d && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->d) {\n    if (p1 == ahead) {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      ahead = p1->next;\n    } else {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      p2->next = p1->next;\n    }\n  }\n}\nvoid print(struct student *head) {\n  int i;\n  struct student *p;\n  for (i = 0; i < 3; i++) {\n    p = head;\n    int max = p->d;\n    while (p->next != NULL) {\n      p = p->next;\n      if (max < p->d)\n        max = p->d;\n    }\n    del(head, max);\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  struct student *ahead;\n  ahead = creat(i);\n  print(ahead);\n  return 0;\n}\n"}
{"label": "14", "index": "25716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  int ID;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i, *sum, max, p = 0;\n  \n  struct score *s;\n  scanf(\"%d\", &n);\n  s = (struct score *)malloc(sizeof(struct score) * n);\n  sum = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &s[i].ID, &s[i].chinese, &s[i].math);\n  for (i = 0; i < n; i++)\n    *(sum + i) = s[i].chinese + s[i].math;\n  max = sum[0];\n  for (i = 0; i < n; i++) {\n    if (max < *(sum + i)) {\n      max = *(sum + i);\n      p = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n  if (n > 1) {\n    max = *sum;\n    *(sum + p) = 0;\n    p = 0;\n    for (i = 0; i < n; i++) {\n      if (max < *(sum + i)) {\n        max = *(sum + i);\n        p = i;\n      }\n    }\n    printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    if (n > 2) {\n      max = *sum;\n      *(sum + p) = 0;\n      p = 0;\n      for (i = 0; i < n; i++) {\n        if (max < *(sum + i)) {\n          max = *(sum + i);\n          p = i;\n        }\n      }\n      printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    }\n  }\n}\n"}
{"label": "14", "index": "25717", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num;\n    int chi;\n    int math;\n  } stu[100000];\n\n  int n, i, j, mid;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (stu[j].math + stu[j].chi > stu[j - 1].chi + stu[j - 1].math) {\n        mid = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = mid;\n\n        mid = stu[j].chi;\n        stu[j].chi = stu[j - 1].chi;\n        stu[j - 1].chi = mid;\n\n        mid = stu[j].math;\n        stu[j].math = stu[j - 1].math;\n        stu[j - 1].math = mid;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math + stu[i].chi);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  };\n  struct student *fig;\n  fig = (struct student *)malloc(sizeof(student) * n);\n  int i, a = 0, b = 0, c = 0, numa = 0, numb = 0, numc = 0;\n  for (i = 0; i < n; i++) {\n    cin >> (fig + i)->num >> (fig + i)->chi >> (fig + i)->math;\n    (fig + i)->sum = (fig + i)->chi + (fig + i)->math;\n    if ((fig + i)->sum > a) {\n      c = b;\n      numc = numb;\n      b = a;\n      numb = numa;\n      a = (fig + i)->sum;\n      numa = (fig + i)->num;\n    } else if ((fig + i)->sum > b) {\n      c = b;\n      numc = numb;\n      b = (fig + i)->sum;\n      numb = (fig + i)->num;\n    } else if ((fig + i)->sum > c) {\n      c = (fig + i)->sum;\n      numc = (fig + i)->num;\n    }\n  }\n  cout << numa << \" \" << a << \"\\n\"\n       << numb << \" \" << b << \"\\n\"\n       << numc << \" \" << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num;\n    int chi;\n    int math;\n  } stu[100000];\n\n  int n, i, j, mid;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0; j--) {\n      if (stu[j].math + stu[j].chi > stu[j - 1].chi + stu[j - 1].math) {\n        mid = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = mid;\n\n        mid = stu[j].chi;\n        stu[j].chi = stu[j - 1].chi;\n        stu[j - 1].chi = mid;\n\n        mid = stu[j].math;\n        stu[j].math = stu[j - 1].math;\n        stu[j - 1].math = mid;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << stu[i].math + stu[i].chi << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[100000];\n  struct qiansan {\n    int num;\n    int zongfen;\n  } st[3] = {{0, 0}, {0, 0}, {0, 0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].yuwen);\n    cin >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].zongfen > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = stu[i].zongfen;\n      st[0].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[0].zongfen &&\n               stu[i].zongfen > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = stu[i].zongfen;\n      st[1].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[1].zongfen &&\n               stu[i].zongfen > st[2].zongfen) {\n      st[2].zongfen = stu[i].zongfen;\n      st[2].num = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    if (i == 0)\n      cout << st[i].num << \" \" << st[i].zongfen;\n    else\n      printf(\" %d %d\", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int chinese;\n  int math;\n  int num;\n} stu[100001];\nint main() {\n  int n, i, j, max[3][2] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) \n  {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].num = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) \n  {\n    for (i = 0; i < n; i++) {\n      if (stu[i].num > max[j][0]) {\n        max[j][0] = stu[i].num;\n        max[j][1] = i + 1;\n      }\n    }\n    stu[max[j][1] - 1].num = 0;\n  }\n  for (j = 0; j < 3; j++) \n  {\n    cout << max[j][1] << ' ' << max[j][0] << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, p, q, c, d;\n  int a[100000];\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  int max1, max2, max3;\n  int num1, num2, num3;\n  if (a[0] >= a[1]) {\n    max1 = a[0];\n    num1 = 0;\n    if (a[0] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[0];\n      num2 = 0;\n      max3 = a[1];\n      num3 = 1;\n    } else {\n      if (a[1] >= a[2]) {\n        max2 = a[1];\n        num2 = 1;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[1];\n        num3 = 1;\n      }\n    }\n  } else {\n    max1 = a[1];\n    num1 = 1;\n    if (a[1] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[1];\n      num2 = 1;\n      max3 = a[0];\n      num3 = 0;\n    } else {\n      if (a[0] >= a[2]) {\n        max2 = a[0];\n        num2 = 0;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[0];\n        num3 = 0;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (a[i] > max1) {\n      p = max1;\n      q = max2;\n      c = num1;\n      d = num2;\n      max1 = a[i];\n      max2 = p;\n      max3 = q;\n      num1 = i;\n      num2 = c;\n      num3 = d;\n    } else {\n      if (a[i] > max2 && a[i] <= max1) {\n        p = max2;\n        c = num2;\n        max2 = a[i];\n        max3 = p;\n        num2 = i;\n        num3 = c;\n      } else {\n        if (a[i] > max3 && a[i] <= max2) {\n          max3 = a[i];\n          num3 = i;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", num1 + 1, a[num1], num2 + 1, a[num2],\n         num3 + 1, a[num3]);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25723", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id;\n    float yuwen, shuxue, sum;\n  } stu[100000], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %f %f\", &stu[i].id, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %g \", stu[i].id, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  long xh;\n  int yw;\n  int sx;\n  int zh;\n  struct stu *next;\n};\nstruct stu *scan() {\n  long n;\n  long num = 0;\n  struct stu *head, *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%ld\", &n);\n\n  head = p1;\n  while (num < n) {\n    scanf(\"%ld\", &p1->xh);\n    scanf(\"%d\", &p1->yw);\n    scanf(\"%d\", &p1->sx);\n    p1->zh = p1->yw + p1->sx;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->next = 0;\n    num++;\n  }\n  return (head);\n}\nstruct stu *del(struct stu *head, int max) {\n  struct stu *p1, *p2;\n  p1 = head;\n  while (max != p1->zh && p1->next != 0) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (max == p1->zh) {\n    if (p1 == head) {\n      head = p1->next;\n    } else {\n      p2->next = p1->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p, *p1, *p2, *p3, *w;\n  int max = 0, num = 0;\n  while (num < 3) {\n    for (p = head; p != 0; p = p->next) {\n      if (p->zh > max) {\n        max = p->zh;\n        w = p;\n      }\n    }\n    num++;\n    if (num == 1) {\n      p1 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 2) {\n      p2 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 3) {\n      p3 = w;\n    }\n  }\n  printf(\"%ld %d\\n%ld %d\\n%ld %d\\n\", p1->xh, p1->zh, p2->xh, p2->zh, p3->xh,\n         p3->zh);\n}\nint main() {\n  struct stu *head;\n  head = scan();\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int n, i, sum[100000], temp[3], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 0, max = -1, temp[0] = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      temp[0] = i;\n    }\n  }\n  for (i = 0, max = -1, temp[1] = 0; i < n; i++) {\n    if (i == temp[0])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[1] = i;\n      }\n    }\n  }\n  for (i = 0, max = -1, temp[2] = 0; i < n; i++) {\n    if (i == temp[0] || i == temp[1])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[2] = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[temp[0]].id, sum[temp[0]]);\n  printf(\"%d %d\\n\", stu[temp[1]].id, sum[temp[1]]);\n  printf(\"%d %d\", stu[temp[2]].id, sum[temp[2]]);\n}\n"}
{"label": "14", "index": "25726", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nint student_num;\n\nstruct student *creat() {\n  struct student *p1, *p2, *head;\n  int n = 0;\n  cin >> student_num;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  while (n < student_num) {\n    if (n == 0)\n      head = p1;\n    if (n == student_num - 1)\n      p1->next = NULL;\n    cin >> p1->id >> p1->chi >> p1->math;\n    p1->total = p1->chi + p1->math;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    n++;\n  }\n  return head;\n}\n\nint main() {\n  struct student *head, *p;\n  int i, n = 0, first, second, third, firstid, secondid, thirdid;\n  head = creat();\n  first = 0;\n  second = 0;\n  third = 0;\n  p = head;\n  for (i = 1; i <= student_num; i++) {\n    if (p->total > first) {\n      third = second;\n      second = first;\n      first = p->total;\n      thirdid = secondid;\n      secondid = firstid;\n      firstid = p->id;\n    } else if (p->total <= first && p->total > second) {\n      third = second;\n      second = p->total;\n      thirdid = secondid;\n      secondid = p->id;\n    } else if (p->total <= second && p->total > third) {\n      third = p->total;\n      thirdid = p->id;\n    }\n    p = p->next;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", firstid, first, secondid, second, thirdid,\n         third);\n}\n"}
{"label": "14", "index": "25727", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int sum[100000];\n  int max1, max2, max3;\n  int x = 0;\n  scanf(\"%d\", &n);\n  struct {\n    int number;\n    int chin;\n    int math;\n  } student[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].number, &student[i].chin, &student[i].math);\n    sum[i] = student[i].chin + student[i].math;\n  }\n  max1 = sum[0];\n  max2 = sum[0];\n  max3 = sum[0];\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max1)\n      max1 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sum[i] == max1) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n    if (x >= 3)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max2) && (sum[i] != max1))\n      max2 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max2) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max3) && (sum[i] != max1) && (sum[i] != max2))\n      max3 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max3) {\n      printf(\"%d %d\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int diyi, dier, disan;\n  diyi = 0;\n  dier = 0;\n  disan = 0;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[99999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[diyi].sum) {\n      diyi = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi) {\n      dier = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi) {\n      if (stu[i].sum > stu[dier].sum) {\n        dier = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi && i != dier) {\n      disan = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi && i != dier) {\n      if (stu[i].sum > stu[disan].sum) {\n        disan = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", diyi + 1, stu[diyi].sum);\n  printf(\"%d %d\\n\", dier + 1, stu[dier].sum);\n  printf(\"%d %d\\n\", disan + 1, stu[disan].sum);\n}\n"}
{"label": "14", "index": "25729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int mark;\n  struct student *next;\n};\nint n;\nstruct student *creat(int max) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  head = p1;\n  while (n < max - 1) {\n    n++;\n    if (n != 1)\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xuehao, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint main() {\n  int max, i;\n  struct student *table;\n  scanf(\"%d\", &max);\n  table = creat(max);\n  for (i = 0; i < 3; i++) {\n    int mmax = 0;\n    int mark = 0;\n    struct student *p;\n    p = table;\n\n    do {\n      if (p->shuxue + p->yuwen > mmax && p->mark != -1) {\n        mark++;\n        p->mark = mark;\n        mmax = p->shuxue + p->yuwen;\n      }\n      p = p->next;\n    } while (p != 0);\n    p = table;\n    do {\n      if (p->mark == mark) {\n        printf(\"%d %d \", p->xuehao, p->shuxue + p->yuwen);\n        p->mark = -1;\n      }\n      p = p->next;\n    } while (p != 0);\n  }\n}\n"}
{"label": "14", "index": "25730", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, cn, math, sum, rank;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(void) {\n  int i = 1;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n  head = p1;\n  do {\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->cn >> p1->math;\n    p2->next = p1;\n    i++;\n  } while (1);\n  p2->next = 0;\n  return (head);\n}\n\nvoid count(struct student *head) {\n  int max = 0;\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    p1->sum = p1->cn + p1->math;\n    if (max < p1->sum)\n      max = p1->sum;\n    if (p1->next == 0)\n      break;\n    p1 = p1->next;\n  } while (1);\n  p1 = head;\n  do {\n    if (p1->sum == max) {\n      p1->rank = n;\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0) {\n      p1 = head;\n      max--;\n    } else\n      p1 = p1->next;\n  } while (1);\n}\n\nvoid print(struct student *head) {\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    if (p1->rank == n) {\n      printf(\"%d %d \", p1->num, p1->sum);\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0)\n      p1 = head;\n    else\n      p1 = p1->next;\n  } while (1);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  count(head);\n  print(head);\n}\n"}
{"label": "14", "index": "25731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> form[i].num >> form[i].chinese >> form[i].math;\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum)\n        k = j;\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} s[100001], first, second, third;\n\nint main() {\n  int n, i, temp1, temp2;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].chinese >> s[i].math;\n    s[i].sum = s[i].chinese + s[i].math;\n  }\n  first.sum = 0, second.sum = 0, third.sum = 0;\n  for (i = 0; i < n; i++) {\n    if (first.sum < s[i].sum) {\n      first = s[i];\n      temp1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second.sum < s[i].sum && s[i].num != s[temp1].num) {\n      second = s[i];\n      temp2 = i;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (third.sum < s[i].sum && s[i].num != s[temp1].num &&\n        s[i].num != s[temp2].num)\n      third = s[i];\n  cout << first.num << \" \" << first.sum << endl;\n  cout << second.num << \" \" << second.sum << endl;\n  cout << third.num << \" \" << third.sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int stuNum, i;\n  cin >> stuNum;\n  struct student {\n    int id, math, chinese, total;\n  };\n  struct student stu[stuNum], first, second, third;\n  for (i = 0; i < stuNum; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  first = second = third = stu[0];\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > first.total)\n      first = stu[i];\n  cout << first.id << ' ' << first.total << endl;\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > second.total && stu[i].id != first.id)\n      second = stu[i];\n  printf(\"%d %d\\n\", second.id, second.total);\n  for (i = 1; i < stuNum; i++) {\n    if (stu[i].total > third.total && stu[i].id != first.id &&\n        stu[i].id != second.id)\n      third = stu[i];\n  }\n  cout << third.id << ' ' << third.total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n} stu[100000];\n\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++)\n    sum[i] = stu[i].ch + stu[i].math;\n\n  max[0] = 0;\n  for (j = 0, k = 0; j < n; j++) {\n    if (sum[j] > max[0]) {\n      max[0] = sum[j];\n      k = j;\n    }\n  }\n  max[1] = 0;\n  for (j = 1, m = 0; j < n; j++) {\n    if ((sum[j] > max[1]) && (j != k)) {\n      max[1] = sum[j];\n      m = j;\n    }\n  }\n  max[2] = 0;\n  for (j = 1, o = 0; j < n; j++) {\n    if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n      max[2] = sum[j];\n      o = j;\n    }\n  }\n  printf(\"%d %d \", stu[k].name, sum[k]);\n  printf(\"%d %d \", stu[m].name, sum[m]);\n  printf(\"%d %d \", stu[o].name, sum[o]);\n  return 0;\n}\n"}
{"label": "14", "index": "25735", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n};\nint main() {\n  struct student a[100000];\n  int n, i, sf = 0, ss = 0, st = 0, f, s, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].number >> a[i].math >> a[i].chinese;\n    a[i].total = a[i].math + a[i].chinese;\n    if (a[i].total > sf) {\n      t = s;\n      st = ss;\n      s = f;\n      ss = sf;\n      f = i;\n      sf = a[i].total;\n    } else if (a[i].total > ss) {\n      t = s;\n      st = ss;\n      s = i;\n      ss = a[i].total;\n    } else if (a[i].total > st) {\n      t = i;\n      st = a[i].total;\n    }\n  }\n  printf(\"%d %d\\n\", f + 1, sf);\n  printf(\"%d %d\\n\", s + 1, ss);\n  printf(\"%d %d\\n\", t + 1, st);\n  return 0;\n}\n"}
{"label": "14", "index": "25736", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int stuno;\n    int score1;\n    int score2;\n    int score0;\n  };\n  int n, i, j, temp;\n  cin >> n;\n  struct student num[n];\n  for (i = 0; i < n; i++) {\n    cin >> num[i].stuno;\n    cin >> num[i].score1;\n    cin >> num[i].score2;\n    num[i].score0 = num[i].score1 + num[i].score2;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i].score0 < num[j].score0) {\n        temp = num[i].score0;\n        num[i].score0 = num[j].score0;\n        num[j].score0 = temp;\n        temp = num[i].stuno;\n        num[i].stuno = num[j].stuno;\n        num[j].stuno = temp;\n      }\n  for (i = 0; i < 3 && i < n; i++)\n    printf(\"%d %d\\n\", num[i].stuno, num[i].score0);\n  return 0;\n}\n"}
{"label": "14", "index": "25737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n} stu[100000];\n\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  max[0] = 0;\n  for (j = 0, k = 0; j < n; j++) {\n    if (sum[j] > max[0]) {\n      max[0] = sum[j];\n      k = j;\n    }\n  }\n\n  max[1] = 0;\n  for (j = 1, m = 0; j < n; j++) {\n    if ((sum[j] > max[1]) && (j != k)) {\n      max[1] = sum[j];\n      m = j;\n    }\n  }\n\n  max[2] = 0;\n  for (j = 1, o = 0; j < n; j++) {\n    if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n      max[2] = sum[j];\n      o = j;\n    }\n  }\n\n  printf(\"%d %d \", stu[k].name, sum[k]);\n  printf(\"%d %d \", stu[m].name, sum[m]);\n  printf(\"%d %d \", stu[o].name, sum[o]);\n}\n"}
{"label": "14", "index": "25738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n  int score;\n};\nint main() {\n  int n;\n  int i, k, j;\n  struct Student student[100000];\n  struct Student temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    cin >> student[i].chinese;\n    scanf(\"%d\", &student[i].math);\n    student[i].score = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (student[j].score > student[k].score)\n        k = j;\n    }\n    if (k != i) {\n      temp = student[i];\n      student[i] = student[k];\n      student[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << student[i].num << \" \" << student[i].score << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n} student[100000];\nint max(int a, int b) { return (a > b) ? a : b; }\nint min(int a, int b) { return (a < b) ? a : b; }\nint main() {\n  int max(int a, int b);\n  int total[100000];\n  int n, i;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxnum1 = 0, maxnum2 = 0, maxnum3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].yuwen);\n    scanf(\"%d\", &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n    if (total[i] >= max1) {\n      if (total[i] == max1) {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = max(maxnum1, i + 1);\n        maxnum1 = min(maxnum1, i + 1);\n      } else {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = maxnum1;\n        maxnum1 = i + 1;\n      }\n    } else if (total[i] < max1 && total[i] >= max2) {\n\n      if (total[i] == max2) {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = max(maxnum2, i + 1);\n        maxnum2 = min(maxnum2, i + 1);\n      } else {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = i + 1;\n      }\n    } else if (total[i] < max2 && total[i] >= max3) {\n      if (total[i] == max3) {\n        max3 = total[i];\n        maxnum3 = min(i + 1, maxnum3);\n      } else {\n        max3 = total[i];\n        maxnum3 = i + 1;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", maxnum1, max1);\n  cout << maxnum2 << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\", maxnum3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    int b;\n    int c;\n    int d;\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int i, j, k, m, n, t;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct s *)malloc(sizeof(struct s));\n  head = p1;\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = 0;\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p1->d = p1->b + p1->c;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = p1->next;\n    for (i = 0; i < n - 2; i++) {\n      if (p1->d < p2->d) {\n        t = p1->d;\n        p1->d = p2->d;\n        p2->d = t;\n        k = p1->a;\n        p1->a = p2->a;\n        p2->a = k;\n      }\n\n      p2 = p2->next;\n    }\n    p1 = head;\n\n    printf(\"%d %d\\n\", p1->a, p1->d);\n    p1->d = 0;\n  }\n}\n"}
{"label": "14", "index": "25741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct stu {\n    int id;\n    int x, y;\n\n  } stu[100000];\n  int no1 = 0;\n  int no2 = 0;\n  int no3 = 0;\n  int i;\n  int N1, N2, N3;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].x, &stu[i].y);\n\n  for (i = 0; i < n; i++) {\n    if ((stu[i].x + stu[i].y) > no1) {\n      no2 = no1;\n      no1 = (stu[i].x + stu[i].y);\n      N2 = N1;\n      N1 = i;\n    } else if ((stu[i].x + stu[i].y) > no2) {\n      no3 = no2;\n      no2 = (stu[i].x + stu[i].y);\n      N3 = N2;\n      N2 = i;\n    } else if ((stu[i].x + stu[i].y) > no3) {\n      no3 = (stu[i].x + stu[i].y);\n      N3 = i;\n    }\n  }\n  cout << stu[N1].id << \" \" << (stu[N1].x + stu[N1].y) << \"\\n\"\n       << stu[N2].id << \" \" << (stu[N2].x + stu[N2].y) << \"\\n\"\n       << stu[N3].id << \" \" << (stu[N3].x + stu[N3].y);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25742", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long num, ch, ma, tot;\n\n  struct stu *next;\n};\n\nint main() {\n  int n, numt, cht, mat;\n  cin >> n;\n  struct stu *head, *now, *neww, *max;\n  int i;\n  for (i = 1; i <= n; i++) {\n    neww = (struct stu *)malloc(sizeof(struct stu));\n    neww->next = 0;\n    if (i == 1) {\n      head = neww;\n      now = neww;\n    } else {\n      now->next = neww;\n      now = neww;\n    }\n    scanf(\"%ld %ld %ld\", &now->num, &now->ch, &now->ma);\n    now->tot = now->ch + now->ma;\n  }\n  for (i = 1; i <= 3; i++) {\n    now = head;\n    max = now;\n    while (now->next != 0) {\n      if (max->tot < now->tot) {\n        max = now;\n      }\n      now = now->next;\n    }\n    printf(\"%d %d\\n\", max->num, max->tot);\n    max->tot = -1;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25743", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int together;\n} stu[100000], t;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].together = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i; j < n; j++) {\n      if (stu[i].together < stu[j].together) {\n        t = stu[i];\n        stu[i] = stu[j];\n        stu[j] = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].id << ' ' << stu[i].together << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, score[100000], max1 = 0, m1 = 0, max2 = 0, m2 = 0, max3 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  struct stu {\n    int No;\n    int yw;\n    int math;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].No, &s[i].yw, &s[i].math),\n        score[i] = s[i].yw + s[i].math;\n    if (score[i] > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = score[i];\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n      continue;\n    }\n    if (score[i] <= max1 && score[i] > max2) {\n      max3 = max2;\n      max2 = score[i];\n      m3 = m2;\n      m2 = i;\n      continue;\n    }\n    if (score[i] <= max2 && score[i] > max3) {\n      max3 = score[i];\n      m3 = i;\n      continue;\n    }\n  }\n  cout << s[m1].No << \" \" << max1 << \"\\n\"\n       << s[m2].No << \" \" << max2 << \"\\n\"\n       << s[m3].No << \" \" << max3 << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int ID;\n  int chi;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].chi, &student[i].math);\n    a[i] = student[i].chi + student[i].math;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j]) {\n          break;\n        }\n      }\n      if (j == n && a[i] >= a[j - 1]) {\n        cout << student[i].ID << \" \" << a[i] << \"\\n\";\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int ID;\n    int math;\n    int chinese;\n    int sum;\n  };\n  int n, i, t, j;\n  cin >> n;\n  struct student stu[n];\n  for (i = 0; i < n; i++)\n    cin >> stu[i].ID >> stu[i].math >> stu[i].chinese;\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chinese;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n\n      if (stu[j].sum > stu[i].sum) {\n        t = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = t;\n        t = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = t;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].ID << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "25748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int chn;\n  int math;\n  int sum;\n};\nint main() {\n  struct stu indi[100000];\n  int n, i, j, rank[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &indi[i].id, &indi[i].chn, &indi[i].math);\n    indi[i].sum = indi[i].chn + indi[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    rank[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (indi[j].sum > indi[rank[i]].sum) {\n        rank[i] = j;\n      }\n    }\n    indi[rank[i]].sum = -indi[rank[i]].sum;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", indi[rank[i]].id, -indi[rank[i]].sum);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yuwen;\n    int math;\n    int zong;\n  };\n  struct student stu[100000];\n  struct student *p, *p1, *p2, *p3, *p4;\n  int n;\n  scanf(\"%d\", &n);\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d\", &p->num);\n    scanf(\"%d\", &p->yuwen);\n    scanf(\"%d\", &p->math);\n  }\n  for (p = stu; p < stu + n; p++) {\n    (p->zong) = (p->yuwen) + (p->math);\n  }\n  p1 = &stu[0];\n  p2 = &stu[1];\n  p3 = &stu[2];\n  p4 = p1;\n  if (p2->zong > p1->zong) {\n    p4 = p1;\n    p1 = p2;\n    p2 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p1->zong) {\n    p4 = p1;\n    p1 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p2->zong) {\n    p4 = p2;\n    p2 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n\n  for (p = stu + 3; p < stu + n; p++) {\n    if ((p->zong) > (p1->zong)) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->zong > p2->zong) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->zong > p3->zong) {\n      p3 = p;\n    } else\n      p1 = p1;\n  }\n  cout << p1->num << \" \" << p1->zong << \"\\n\";\n  printf(\"%d %d\\n\", p2->num, p2->zong);\n  printf(\"%d %d\", p3->num, p3->zong);\n  return 0;\n}\n"}
{"label": "14", "index": "25750", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int score1;\n  int score2;\n  struct stu *next;\n};\nstruct stu *creat(void) {\n  int n, i = 1;\n  struct stu *head;\n  struct stu *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  head = NULL;\n  while (i <= n) {\n    cin >> p1->num >> p1->score1 >> p1->score2;\n    if (i == 1)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != n)\n      p1 = p2->next = (struct stu *)malloc(1000);\n    else\n      p1->next = NULL;\n    i++;\n  }\n  return (head);\n}\nvoid turn(struct stu *head) {\n  int t = 1, r = 1, a;\n  struct stu *q1, *q2, *p3, *p1, *p2;\n  for (q1 = p3 = p2 = head; q1->next != NULL, t <= 3; t++) {\n    a = 0;\n    for (q2 = p1 = q1->next, r = 1; q2 != NULL; q2 = q2->next, r++) {\n\n      if ((q1->score1 + q1->score2) < (q2->score1 + q2->score2)) {\n        q1 = q2;\n        p2 = p1;\n        a = 1;\n      }\n      if (r != 1)\n        p1 = p1->next;\n    }\n    printf(\"%ld %d \", q1->num, q1->score1 + q1->score2);\n    if (a == 1) {\n      p2->next = q1->next;\n      q1 = head;\n    } else {\n      q1 = p3->next;\n      p3 = q1;\n    }\n  }\n}\nint main() {\n  struct stu *ip;\n  ip = creat();\n  turn(ip);\n}\n"}
{"label": "14", "index": "25751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k;\n  struct student temp;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > stu[i].total) {\n        k = j;\n        temp = stu[k];\n        stu[k] = stu[i];\n        stu[i] = temp;\n      }\n    }\n    if (i == 3)\n      break;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n}\n"}
{"label": "14", "index": "25752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  long xh;\n  int yw;\n  int sx;\n  int zh;\n  struct stu *next;\n};\nstruct stu *scan() {\n  long n;\n  long num = 0;\n  struct stu *head, *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%ld\", &n);\n  \n  head = p1;\n  while (num < n) {\n    scanf(\"%ld\", &p1->xh);\n    scanf(\"%d\", &p1->yw);\n    scanf(\"%d\", &p1->sx);\n    p1->zh = p1->yw + p1->sx;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->next = 0;\n    num++;\n  }\n  return (head);\n}\nstruct stu *del(struct stu *head, int max) {\n  struct stu *p1, *p2;\n  p1 = head;\n  while (max != p1->zh && p1->next != 0) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (max == p1->zh) {\n    if (p1 == head) {\n      head = p1->next;\n    } else {\n      p2->next = p1->next;\n    }\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p, *p1, *p2, *p3, *w;\n  int max = 0, num = 0;\n  while (num < 3) {\n    for (p = head; p != 0; p = p->next) {\n      if (p->zh > max) {\n        max = p->zh;\n        w = p;\n      }\n    }\n    num++;\n    if (num == 1) {\n      p1 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 2) {\n      p2 = w;\n      head = del(head, max);\n      max = 0;\n    }\n    if (num == 3) {\n      p3 = w;\n    }\n  }\n  printf(\"%ld %d\\n%ld %d\\n%ld %d\\n\", p1->xh, p1->zh, p2->xh, p2->zh, p3->xh,\n         p3->zh);\n}\nint main() {\n  struct stu *head;\n  head = scan();\n  print(head);\n}\n"}
{"label": "14", "index": "25753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[3][2], k;\n  struct student {\n    int num;\n    int s1;\n    int s2;\n    int l;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].s1 >> stu[i].s2;\n    stu[i].l = stu[i].s1 + stu[i].s2;\n  }\n  for (i = 0; i < 3; i++) {\n    for (m = 0, j = 0; j < n; j++) {\n      if (m < stu[j].l) {\n        m = stu[j].l;\n        k = j;\n      }\n    }\n    a[i][0] = k;\n    a[i][1] = m;\n    stu[k].l = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i][0] + 1 << \" \" << a[i][1] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\ntypedef struct {\n  int ID;\n  int chinese;\n  int math;\n  int sum;\n} Student;\n\nStudent topThree[3];\nint studentNum;\n\nvoid initialise() {\n  for (int i = 0; i < 3; i++) {\n    topThree[i].sum = -1;\n  }\n}\n\nvoid updateTopThree(Student stu) {\n  for (int i = 0; i < 3; i++) {\n    if (stu.sum > topThree[i].sum) {\n      for (int j = 2; j > i; j--) {\n        topThree[j] = topThree[j - 1];\n      }\n\n      topThree[i] = stu;\n\n      break;\n    }\n  }\n}\n\nvoid getStudentData() {\n  Student temp;\n\n  cin >> studentNum;\n  for (int i = 0; i < studentNum; i++) {\n    scanf(\"%d %d %d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.sum = temp.chinese + temp.math;\n    updateTopThree(temp);\n  }\n}\n\nvoid printStudentData() {\n  for (int i = 0; i < 3 && i < studentNum; i++) {\n    printf(\"%d %d\\n\", topThree[i].ID, topThree[i].sum);\n  }\n}\n\nint main() {\n  initialise();\n  getStudentData();\n  printStudentData();\n\n  return 0;\n}\n"}
{"label": "14", "index": "25755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int ovr;\n  struct student *next;\n};\nstruct student *creat() {\n  int i;\n  struct student *head;\n  struct student *p1, *p2;\n  head = (struct student *)malloc(sizeof(struct student));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    scanf(\"%d %d %d\", &p2->num, &p2->chn, &p2->math);\n    p2->ovr = p2->chn + p2->math;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int i;\n  int no1, ovr1 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->next != 0) {\n      if (p1->ovr > ovr1) {\n        ovr1 = p1->ovr;\n        no1 = p1->num;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    cout << no1 << \" \" << ovr1 << \"\\n\";\n    p2->ovr = 0;\n    ovr1 = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct stu {\n    long num, c, m, d;\n    struct stu *next;\n  };\n  long n, i, f;\n  struct stu *head, *p1, *p2;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    cin >> p1->num >> p1->c >> p1->m;\n    p1->d = p1->c + p1->m;\n    if (i == 1) {\n      p1->next = 0;\n      head = p1;\n    } else {\n      if (i <= 3)\n        f = 1;\n      else {\n        p2 = head->next->next;\n        if (p1->d > p2->d)\n          f = 1;\n        else\n          f = 0;\n      }\n      if (f == 1) {\n        p2 = head;\n        if (p2->d < p1->d) {\n          p1->next = p2;\n          head = p1;\n        } else {\n          while ((p2->next != 0) && (p2->next->d > p1->d))\n            p2 = p2->next;\n          p1->next = p2->next;\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    cout << p1->num << \" \" << p1->d << \" \";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int fir = 0, sec = 0, thi = 0;\n  int fir_n = 0, sec_n = 0, thi_n = 0;\n  struct {\n    int num;\n    int ma;\n    int cn;\n    int score;\n  } s;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> s.num >> s.ma >> s.cn;\n    s.score = s.ma + s.cn;\n\n    if (s.score > fir) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = fir;\n      sec_n = fir_n;\n      fir = s.score;\n      fir_n = s.num;\n    }\n\n    else if (s.score > sec) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = s.score;\n      sec_n = s.num;\n    } else if (s.score > thi) {\n      thi = s.score;\n      thi_n = s.num;\n    }\n  }\n\n  printf(\"%d %d\\n\", fir_n, fir);\n  cout << sec_n << \" \" << sec << \"\\n\";\n  cout << thi_n << \" \" << thi << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int zongfen;\n};\nint main() {\n  int n, i = 1, j;\n  int a[100001];\n  struct student stu[100001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].math, &stu[i].chinese);\n    stu[i].zongfen = stu[i].math + stu[i].chinese;\n    if (i < 4)\n      j = i;\n    else {\n      j = 4;\n    }\n    {\n      for (; j > 1 && stu[i].zongfen > stu[a[j - 1]].zongfen; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (i = 1; i <= 3; i++)\n    cout << stu[a[i]].id << \" \" << stu[a[i]].zongfen << \" \";\n  getchar();\n  getchar();\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "14", "index": "25759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct test {\n    int ID, chinese, maths, sum;\n  } ss[100000];\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ss[i].ID, &ss[i].chinese, &ss[i].maths);\n    ss[i].sum = ss[i].chinese + ss[i].maths;\n  }\n  struct score {\n    int ID, sum;\n  } s[5];\n  s[1].sum = 0;\n  s[2].sum = 0;\n  s[3].sum = 0;\n  for (i = 0; i <= n; i++) {\n    if (ss[i].sum > s[1].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = s[1].ID;\n      s[2].sum = s[1].sum;\n      s[1].ID = ss[i].ID;\n      s[1].sum = ss[i].sum;\n    } else if (ss[i].sum > s[2].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = ss[i].ID;\n      s[2].sum = ss[i].sum;\n    } else if (ss[i].sum > s[3].sum) {\n      s[3].ID = ss[i].ID;\n      s[3].sum = ss[i].sum;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\\n\", s[i].ID, s[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25760", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n  int score;\n};\nint main() {\n  int n;\n  int i, k, j;\n  struct Student student[100000];\n  struct Student temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> student[i].num;\n    scanf(\"%d\", &student[i].chinese);\n    scanf(\"%d\", &student[i].math);\n    student[i].score = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (student[j].score > student[k].score)\n        k = j;\n    }\n    if (k != i) {\n      temp = student[i];\n      student[i] = student[k];\n      student[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].num, student[i].score);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25761", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  };\n  struct student *fig;\n  fig = (struct student *)malloc(sizeof(student) * n);\n  int i, a = 0, b = 0, c = 0, numa = 0, numb = 0, numc = 0;\n  for (i = 0; i < n; i++) {\n    cin >> (fig + i)->num >> (fig + i)->chi >> (fig + i)->math;\n    (fig + i)->sum = (fig + i)->chi + (fig + i)->math;\n    if ((fig + i)->sum > a) {\n      c = b;\n      numc = numb;\n      b = a;\n      numb = numa;\n      a = (fig + i)->sum;\n      numa = (fig + i)->num;\n    } else if ((fig + i)->sum > b) {\n      c = b;\n      numc = numb;\n      b = (fig + i)->sum;\n      numb = (fig + i)->num;\n    } else if ((fig + i)->sum > c) {\n      c = (fig + i)->sum;\n      numc = (fig + i)->num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", numa, a, numb, b, numc, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int n;\n  int chinese;\n  int math;\n  int total;\n  struct stud *next;\n};\nint tol;\nstruct stud *creat(void) {\n  struct stud *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct stud *)malloc(sizeof(struct stud));\n  head = p1;\n  for (i = 1; i < tol; i++) {\n    scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n    p1->total = (p1->math + p1->chinese);\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n  p1->total = (p1->math + p1->chinese);\n  p2->next = p1;\n  p1->next = 0;\n  return head;\n}\nint max(struct stud *head, int max1, int max2) {\n  struct stud *p1;\n  int maxtotal = head->total, max_index;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->total > maxtotal && p1->n != max1 && p1->n != max2) {\n      maxtotal = (p1->total);\n      max_index = (p1->n);\n    }\n  }\n  if (maxtotal != max1)\n    printf(\"%d %d\\n\", max_index, maxtotal);\n  return max_index;\n}\nint main() {\n  struct stud *head;\n  int max1, max2;\n  cin >> tol;\n  head = creat();\n  max1 = max(head, 0, 0);\n  max2 = max(head, max1, 0);\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "25763", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id, chin, math, z;\n  } p[100000];\n  int id, math, chin, z, i, n, f, s, t, id1, id2, id3;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &id, &chin, &math);\n    p[i].id = id;\n    p[i].math = math;\n    p[i].chin = chin;\n  }\n\n  for (i = 0; i < n; i++) {\n    id = p[i].id;\n    math = p[i].math;\n    chin = p[i].chin;\n    z = math + chin;\n\n    if (i == 0) {\n      f = s = t = z;\n      id1 = id2 = id3 = id;\n    } else if (i == 1) {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else {\n        t = s = z;\n        id2 = id3 = id;\n      }\n    } else {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else if (z > s) {\n        t = s;\n        id3 = id2;\n        s = z;\n        id2 = id;\n      } else if (z > t) {\n        t = z;\n        id3 = id;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", id1, f);\n  printf(\"%d %d\\n\", id2, s);\n  printf(\"%d %d\\n\", id3, t);\n  return 0;\n}\n"}
{"label": "14", "index": "25764", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i, b[100000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].chinese);\n    cin >> a[i].maths;\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "25765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct data {\n    int number;\n    int chinese;\n    int math;\n    int total;\n  } student[100000], temp;\n\n  long n, i, j;\n\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].number, &student[i].chinese,\n          &student[i].math);\n    student[i].total = student[i].chinese + student[i].math;\n  }\n\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (student[i].total < student[j].total) {\n        temp.number = student[i].number;\n        temp.chinese = student[i].chinese;\n        temp.math = student[i].math;\n        temp.total = student[i].total;\n\n        student[i].number = student[j].number;\n        student[i].chinese = student[j].chinese;\n        student[i].math = student[j].math;\n        student[i].total = student[j].total;\n\n        student[j].number = temp.number;\n        student[j].chinese = temp.chinese;\n        student[j].math = temp.math;\n        student[j].total = temp.total;\n      }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].number, student[i].total);\n}\n"}
{"label": "14", "index": "25766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, y, b, he;\n} a[100003];\n\nint main() {\n  int n, i, j, he, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].y, &a[i].b);\n    a[i].he = a[i].y + a[i].b;\n  };\n  ;\n  for (i = 1; i <= 2; i++) {\n    k = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[j].he > a[k].he)\n        k = j;\n    printf(\"%d %d\", a[k].num, a[k].he);\n    printf(\"\\n\");\n    a[k].he = 0;\n  }\n  k = 1;\n  for (j = i + 1; j <= n; j++)\n    if (a[j].he > a[k].he)\n      k = j;\n  printf(\"%d %d\", a[k].num, a[k].he);\n  a[k].he = 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n};\nint main() {\n  int n, i, j;\n  struct student stu[4], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++)\n    stu[i].total = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[3].num, &stu[3].yuwen, &stu[3].math);\n    stu[3].total = stu[3].yuwen + stu[3].math;\n    temp = stu[3];\n    for (j = 2; j >= 0; j--)\n      if (temp.total > stu[j].total) {\n        stu[j + 1] = stu[j];\n        stu[j] = temp;\n      } else {\n        stu[j + 1] = temp;\n        break;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct st {\n    int num;\n    int x;\n    int y;\n    int sum;\n  } a[100000], m1, m2, m3;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].x, &a[i].y);\n    a[i].sum = a[i].x + a[i].y;\n  }\n  m1.sum = 0;\n  m2.sum = 0;\n  m3.sum = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].sum > m1.sum)\n      m1 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m2.sum) && (a[i].sum <= m1.sum) && (a[i].num != m1.num))\n      m2 = a[i];\n  for (i = 0; i < n; i++)\n    if ((a[i].sum > m3.sum) && (a[i].sum <= m2.sum) && (a[i].num != m2.num) &&\n        (a[i].num != m1.num))\n      m3 = a[i];\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", m1.num, m1.sum, m2.num, m2.sum, m3.num,\n         m3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  struct student {\n    int num;\n    int a;\n    int b;\n  } stu[100000];\n\n  int n, i, sum = 0, max1 = 0, max2 = 0, max3 = 0, t = 0;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    sum = stu[i].a + stu[i].b;\n    if (sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = sum;\n    } else if ((sum < max1) && (sum > max2)) {\n      max3 = max2;\n      max2 = sum;\n    } else if ((sum < max2) && (sum > max3)) {\n      max3 = sum;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if (sum == max1) {\n      printf(\"%d %d\\n\", stu[i].num, max1);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max2) && (t < 3)) {\n      cout << stu[i].num << \" \" << max2 << \"\\n\";\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max3) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max3);\n      t++;\n    }\n  }\n}\n"}
{"label": "14", "index": "25770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chi;\n  int math;\n  int total;\n} person[100000], first[3] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};\nint main() {\n  long n;\n  int i, j;\n  scanf(\"%ld\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &person[i].num, &person[i].chi, &person[i].math);\n    person[i].total = person[i].chi + person[i].math;\n    if (person[i].total > first[0].total) {\n      first[1] = first[0];\n      first[0] = person[i];\n    } else if (person[i].total > first[1].total) {\n      first[2] = first[1];\n      first[1] = person[i];\n    } else if (person[i].total > first[2].total) {\n      first[2] = person[i];\n    }\n  }\n  for (j = 0; j < 3; j++) {\n    printf(\"%ld %d\\n\", first[j].num, first[j].total);\n  }\n}\n"}
{"label": "14", "index": "25771", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int sbu[3];\n};\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j = 0, j2 = 0, j3 = 0, min = 0;\n  struct stu stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", stu[i].name, &stu[i].sbu[0], &stu[i].sbu[1]);\n    stu[i].sbu[2] = stu[i].sbu[0] + stu[i].sbu[1];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] > min) {\n      min = stu[i].sbu[2];\n      j = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j].sbu[2] && stu[i].sbu[2] > min && i != j) {\n      min = stu[i].sbu[2];\n      j2 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j2].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j2].sbu[2] && stu[i].sbu[2] > min &&\n        i != j & i != j2) {\n      min = stu[i].sbu[2];\n      j3 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j3].name, min);\n  return 0;\n}\n"}
{"label": "14", "index": "25772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long a;\n  int x;\n  int y;\n};\nstruct student stu[100000];\nint main() {\n  long n, i, j, p;\n  int m;\n  scanf(\"%ld\", &n);\n  int g[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].a >> stu[i].x >> stu[i].y;\n    g[i] = stu[i].x + stu[i].y;\n  }\n  for (i = 1; i < 4; i++)\n    for (j = n - 1; j >= i; j--)\n      if (g[j - 1] < g[j]) {\n        m = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = m;\n        p = stu[j - 1].a;\n        stu[j - 1].a = stu[j].a;\n        stu[j].a = p;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d \", stu[i].a, g[i]);\n}\n"}
{"label": "14", "index": "25773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n  struct Student *next;\n};\n\nstruct Student *insert(struct Student *head, struct Student *stu) {\n  int j = 0;\n  struct Student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stu;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->total <= p1->total) && (p1->next != NULL) && j < 4) {\n      p2 = p1;\n      p1 = p1->next;\n      j++;\n    }\n    if (p0->total > p1->total) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct Student *p1, *head, *stu;\n  long int i, n;\n  scanf(\"%ld\", &n);\n\n  p1 = head = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &head->id, &head->chn, &head->mth);\n  head->total = head->chn + head->mth;\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    stu = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &stu->id, &stu->chn, &stu->mth);\n    stu->total = stu->chn + stu->mth;\n    head = insert(head, stu);\n  }\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    cout << p1->id << \" \" << p1->total << \"\\n\";\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25774", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  int ID;\n  int chinese;\n  int math;\n  int sum;\n} Student;\n\nStudent topThree[3];\nint studentNum;\n\nvoid initialise() {\n  for (int i = 0; i < 3; i++) {\n    topThree[i].sum = -1;\n  }\n}\n\nvoid updateTopThree(Student stu) {\n  for (int i = 0; i < 3; i++) {\n    if (stu.sum > topThree[i].sum) {\n      for (int j = 2; j > i; j--) {\n        topThree[j] = topThree[j - 1];\n      }\n\n      topThree[i] = stu;\n\n      break;\n    }\n  }\n}\n\nvoid getStudentData() {\n  Student temp;\n\n  cin >> studentNum;\n  for (int i = 0; i < studentNum; i++) {\n    scanf(\"%d %d %d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.sum = temp.chinese + temp.math;\n    updateTopThree(temp);\n  }\n}\n\nvoid printStudentData() {\n  for (int i = 0; i < 3 && i < studentNum; i++) {\n    printf(\"%d %d\\n\", topThree[i].ID, topThree[i].sum);\n  }\n}\n\nint main() {\n  initialise();\n  getStudentData();\n  printStudentData();\n\n  return 0;\n}\n"}
{"label": "14", "index": "25775", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n};\nstruct student stu[100000];\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].name >> stu[i].ch >> stu[i].math;\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  {\n    max[0] = 0;\n    for (j = 0, k = 0; j < n; j++) {\n      if (sum[j] > max[0]) {\n        max[0] = sum[j];\n        k = j;\n      }\n    }\n  }\n\n  {\n    max[1] = 0;\n    for (j = 1, m = 0; j < n; j++) {\n      if ((sum[j] > max[1]) && (j != k)) {\n        max[1] = sum[j];\n        m = j;\n      }\n    }\n  }\n\n  {\n    max[2] = 0;\n    for (j = 1, o = 0; j < n; j++) {\n      if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n        max[2] = sum[j];\n        o = j;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[k].name, sum[k]);\n  printf(\"%d %d\\n\", stu[m].name, sum[m]);\n  printf(\"%d %d\\n\", stu[o].name, sum[o]);\n  return 0;\n}\n"}
{"label": "14", "index": "25776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} s[1000];\n\nint main() {\n  int n, i, j, tn, tt;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].chinese >> s[i].math;\n    s[i].total = s[i].math + s[i].chinese;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (s[j].total >= s[j + 1].total) {\n        tt = s[j].total;\n        tn = s[j].num;\n        s[j].total = s[j + 1].total;\n        s[j].num = s[j + 1].num;\n        s[j + 1].total = tt;\n        s[j + 1].num = tn;\n      }\n    }\n  }\n  cout << s[n - 1].num << \" \" << s[n - 1].total << \" \" << s[n - 2].num << \" \"\n       << s[n - 2].total << \" \" << s[n - 3].num << \" \" << s[n - 3].total << \" \";\n  return (0);\n}\n"}
{"label": "14", "index": "25777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char number[20];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n} stu[100000], *s1, *s2, *s3;\n\nint n, max1 = 0, max2 = 0, max3 = 0;\n\nstruct student *creat(void) {\n  int i;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    cin >> p1->number >> p1->chinese >> p1->math;\n    p2 = p1;\n    p1->sum = p1->chinese + p1->math;\n    if (p1->sum > max1) {\n      max3 = max2;\n      s3 = s2;\n      max2 = max1;\n      s2 = s1;\n      max1 = p1->sum;\n      s1 = p1;\n    } else if (p1->sum > max2) {\n      max3 = max2;\n      s3 = s2;\n      max2 = p1->sum;\n      s2 = p1;\n    } else if (p1->sum > max3) {\n      max3 = p1->sum;\n      s3 = p1;\n    }\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p1 = (struct student *)malloc(1000);\n  }\n  p1 = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *p;\n  cin >> n;\n  p = creat();\n  printf(\"%s %d \", s1->number, s1->sum);\n  printf(\"%s %d \", s2->number, s2->sum);\n  printf(\"%s %d\", s3->number, s3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int Student_Num;\n  cin >> Student_Num;\n\n  struct A {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } student[100000 + 10], a[3];\n\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    cin >> student[i].ID;\n    cin >> student[i].chinese;\n    cin >> student[i].math;\n    student[i].total = student[i].math + student[i].chinese;\n  }\n\n  a[0] = a[1] = a[2] = student[0];\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[0].total)\n      a[0] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[1].total && student[i].total <= a[0].total &&\n        student[i].ID != a[0].ID)\n      a[1] = student[i];\n  }\n  for (int i = 0; i <= Student_Num - 1; i++) {\n    if (student[i].total > a[2].total && student[i].total <= a[1].total &&\n        student[i].ID != a[0].ID && student[i].ID != a[1].ID)\n      a[2] = student[i];\n  }\n\n  for (int i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", a[i].ID, a[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, max = 0, smax = 0, tmax = 0, id[3] = {0}, a, b, c;\n  struct student {\n    int No;\n    int yuwen;\n    int math;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (max < stu[i].yuwen + stu[i].math) {\n      max = stu[i].yuwen + stu[i].math;\n      id[0] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (smax < stu[i].yuwen + stu[i].math && i != id[0] - 1) {\n      smax = stu[i].yuwen + stu[i].math;\n      id[1] = stu[i].No;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (tmax < stu[i].yuwen + stu[i].math && i != id[0] - 1 && i != id[1] - 1) {\n      tmax = stu[i].yuwen + stu[i].math;\n      id[2] = stu[i].No;\n    }\n  }\n\n  a = id[0];\n  b = id[1];\n  c = id[2];\n\n  printf(\"%d %d\\n\", a, max);\n  printf(\"%d %d\\n\", b, smax);\n  printf(\"%d %d\\n\", c, tmax);\n}\n"}
{"label": "14", "index": "25780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int he;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->he = p1->yu + p1->shu;\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yu >> p1->shu;\n    p1->he = p1->yu + p1->shu;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->he > m->he)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n, i;\n  struct student *head, *m;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  scanf(\"%d\", &n);\n  head = create(n);\n  for (i = 1; i <= 3; i++) {\n    m = max(head);\n    cout << m->num << \" \" << m->he << \" \";\n    m->he = -1;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int a;\n  int b;\n  int zong;\n};\nstruct student ren[100000];\n\nint main() {\n  int n, i, fen, flag = 0;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> ren[i].id;\n    scanf(\"%d\", &ren[i].a);\n    scanf(\"%d\", &ren[i].b);\n    ren[i].zong = ren[i].a + ren[i].b;\n  }\n\n  for (fen = 200; fen >= 100; fen--) {\n    for (i = 0; i <= n - 1; i++)\n      if (fen == ren[i].zong) {\n        cout << ren[i].id << \" \" << ren[i].zong << \"\\n\";\n        flag = flag + 1;\n        if (flag == 3)\n          goto end;\n      }\n  }\nend:\n  getchar();\n}\n"}
{"label": "14", "index": "25782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n  int score;\n};\nint main() {\n  int n;\n  int i, k, j;\n  struct Student student[100000];\n  struct Student temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    scanf(\"%d\", &student[i].math);\n    student[i].score = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (student[j].score > student[k].score)\n        k = j;\n    }\n    if (k != i) {\n      temp = student[i];\n      student[i] = student[k];\n      student[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].num, student[i].score);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25783", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  struct {\n    int id, chi, math, sum;\n  } s, s1, s2, s3;\n  s1.sum = s2.sum = s3.sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.id, &s.chi, &s.math);\n    s.sum = s.chi + s.math;\n    if (s.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.sum > s2.sum)\n      s3 = s2, s2 = s;\n    else if (s.sum > s3.sum) {\n      s3 = s;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int c;\n  int m;\n  int sum;\n  struct student *next;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p0, *p, *q;\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    q = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &q->num, &q->c, &q->m);\n    q->sum = q->c + q->m;\n    q->next = NULL;\n    p0 = head;\n    p = p0->next;\n    j = 0;\n    while (p != NULL && q->sum <= p->sum) {\n      p0 = p;\n      p = p->next;\n      j++;\n      if (j > 3)\n        goto A;\n    }\n    p0->next = q;\n    q->next = p;\n  A:\n    continue;\n  }\n  p = head->next;\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p->num, p->sum);\n    p = p->next;\n  }\n}\n"}
{"label": "14", "index": "25785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int chi;\n    int ma;\n    int sum;\n    int i;\n  };\n  struct stu m[100000], temp;\n  int j, n;\n  cin >> n;\n  struct stu *p = m;\n  struct stu *q;\n  for (; p < m + n; p += 1) {\n    cin >> (*p).i >> (*p).chi >> (*p).ma;\n    (*p).sum = (*p).chi + (*p).ma;\n  }\n  for (p = m; p < m + n - 1; p++) {\n    for (q = p + 1; q < m + n; q++) {\n      if ((*p).sum < (*q).sum) {\n        temp = *p;\n        *p = *q;\n        *q = temp;\n      }\n    }\n    if (p == m + 2)\n      break;\n  }\n  for (p = m; p < m + 3; p++) {\n    printf(\"%d %d\\n\", (*p).i, (*p).sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x[100000];\n  int i, j, n, s, y, p;\n  int b[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y, &p);\n    b[i] = y + p;\n  }\n  int t;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] > b[i]) {\n        s = x[i];\n        x[i] = x[j];\n        x[j] = s;\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", x[i], b[i]);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int Chinese;\n  int math;\n  int score;\n} stu[100000];\n\nint main() {\n  int n, i, j, a, b;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].No, &stu[i].Chinese, &stu[i].math);\n    stu[i].score = stu[i].Chinese + stu[i].math;\n  }\n\n  for (j = n - 1; j > n - 4; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i + 1].score < stu[i].score || stu[i + 1].score == stu[i].score) {\n        a = stu[i + 1].score;\n        stu[i + 1].score = stu[i].score;\n        stu[i].score = a;\n        b = stu[i + 1].No;\n        stu[i + 1].No = stu[i].No;\n        stu[i].No = b;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].No << \" \" << stu[i].score << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int I;\n  int c;\n  int m;\n} st[100000];\n\nint main() {\n\n  int n, i, j, k = 0, a, b;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n\n  {\n\n    scanf(\"%d %d %d\", &st[i].I, &st[i].c, &st[i].m);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (k < st[j].c + st[j].m) {\n        k = st[j].c + st[j].m;\n        a = st[j].I;\n        b = j;\n      }\n    }\n\n    st[b].c = 0;\n    st[b].m = 0;\n\n    cout << a << \" \" << k;\n    if (i < 2)\n      printf(\"\\n\");\n    k = 0;\n  }\n}\n"}
{"label": "14", "index": "25789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Stu {\n  int stuID;\n  int mark;\n} stu[3] = {0};\n\nint compare(const void *p1, const void *p2) {\n  struct Stu *a;\n  struct Stu *b;\n  a = (struct Stu *)p1;\n  b = (struct Stu *)p2;\n  if (a->mark > b->mark)\n    return -1;\n  if (a->mark < b->mark)\n    return 1;\n  if (a->mark == b->mark)\n    return 0;\n}\n\nint main() {\n  int n, i;\n  int ID, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ID, &chi, &math);\n    if (chi + math > stu[2].mark) {\n      stu[2].mark = chi + math;\n      stu[2].stuID = ID;\n    }\n    qsort(stu, 3, sizeof(struct Stu), compare);\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].stuID, stu[i].mark);\n}\n"}
{"label": "14", "index": "25790", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int a, b, c;\n  } student_1;\n  int x, i = 0;\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;\n  while (i < n) {\n    cin >> student_1.a >> student_1.b >> student_1.c;\n    x = student_1.b + student_1.c;\n    if (x > a2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = a1;\n      b2 = a2;\n      a1 = student_1.a;\n      a2 = x;\n    } else if (x == a2) {\n      if (x > b2) {\n        c1 = b1;\n        c2 = b2;\n        b1 = student_1.a;\n        b2 = x;\n      } else {\n        if (x > c2) {\n          c1 = student_1.a;\n          c2 = x;\n        }\n      }\n    } else if (x > b2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = student_1.a;\n      b2 = x;\n    } else if (x == b2) {\n      if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > c2) {\n      c1 = student_1.a;\n      c2 = x;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n\", a1, a2);\n  printf(\"%d %d\\n\", b1, b2);\n  printf(\"%d %d\\n\", c1, c2);\n  return 0;\n}\n"}
{"label": "14", "index": "25791", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    scanf(\"%d\", &a[i].chinese);\n    scanf(\"%d\", &a[i].maths);\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[2].num, a[2].chinese + a[2].maths);\n  return 0;\n}\n"}
{"label": "14", "index": "25792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct Student {\n    int num;\n    int ch;\n    int math;\n  } stu[100000];\n  int n, i, x = 0, m = 0, k = 0, j, a[100000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].ch, &stu[i].math);\n    a[i] = stu[i].ch + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > m) {\n        m = a[i];\n        x = stu[i].num;\n        k = i;\n      }\n    }\n    printf(\"%d %d\\n\", x, m);\n    a[k] = 0;\n    m = 0;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yu >> stu[i].shu;\n    stu[i].sum = stu[i].shu + stu[i].yu;\n  }\n  int k, e;\n  for (k = 0; k < 3; k++) {\n    for (i = n - 2; i >= k; i--) {\n      if (stu[i].sum < stu[i + 1].sum) {\n        e = stu[i].sum;\n        stu[i].sum = stu[i + 1].sum;\n        stu[i + 1].sum = e;\n        e = stu[i].num;\n        stu[i].num = stu[i + 1].num;\n        stu[i + 1].num = e;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int all;\n} person[99999];\nint main() {\n  int n, i, j, k, x, y;\n  ;\n  struct student temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 2; i >= 0; i--) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n  }\n  for (i = 3; i <= n - 1; i++) {\n    cin >> person[i].num >> x >> y;\n    person[i].all = x + y;\n    k = person[i].all;\n    if (k > person[0].all) {\n      temp1 = person[0];\n      temp2 = person[1];\n      person[0] = person[i];\n      person[1] = temp1;\n      person[2] = temp2;\n      continue;\n    }\n    if (k <= person[0].all && k > person[1].all) {\n      temp1 = person[1];\n      person[1] = person[i];\n      person[2] = temp1;\n      continue;\n    }\n    if (k <= person[1].all && k > person[2].all) {\n      person[2] = person[i];\n      continue;\n    }\n    if (k < person[2].all) {\n      continue;\n    }\n  }\n  cout << person[0].num << \" \" << person[0].all << \"\\n\";\n  printf(\"%d %d\\n\", person[1].num, person[1].all);\n  printf(\"%d %d\", person[2].num, person[2].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct linknode *CreateLinkList();\nvoid DisplayLinkList(struct linknode *linklist1);\nvoid qiansan(struct linknode *linklist2);\nstruct linknode {\n  int id;\n  int chinese;\n  int math;\n  int total;\n  int mark;\n  struct linknode *next;\n};\nint main() { qiansan(CreateLinkList()); }\nstruct linknode *CreateLinkList() {\n  long n, i;\n  struct linknode *head, *p;\n  scanf(\"%ld\", &n);\n  head = (struct linknode *)malloc(sizeof(struct linknode));\n  p = head;\n  if (p == NULL) {\n    cout << \"fail\";\n    exit(-1);\n  }\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &p->id, &p->chinese, &p->math);\n    p->total = p->chinese + p->math;\n    p->mark = 0;\n    if (i == n)\n      p->next = NULL;\n    else {\n      p->next = (struct linknode *)malloc(sizeof(struct linknode));\n      p = p->next;\n    }\n  }\n  return head;\n}\nvoid qiansan(struct linknode *linklist2) {\n  struct linknode *head, *p, *max;\n\n  head = linklist2;\n  p = head;\n  max = (struct linknode *)malloc(sizeof(struct linknode));\n  int j;\n  for (j = 1; j <= 3; j++) {\n    p = head;\n    max->total = 0;\n    while (p != NULL) {\n      if (p->total > max->total && p->mark == 0)\n        max = p;\n\n      p = p->next;\n    }\n    max->mark = 1;\n    cout << max->id << \" \" << max->total << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  char num[10];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  struct student a[100000];\n  struct student s[3];\n  struct student k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", a[i].num, &a[i].yuwen, &a[i].shuxue);\n    a[i].sum = a[i].yuwen + a[i].shuxue;\n  }\n  s[0] = a[0];\n  s[1] = a[0];\n  s[1].sum = 0;\n  s[2] = a[0];\n  s[2].sum = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i].sum > s[2].sum && a[i].sum <= s[1].sum) {\n      s[2] = a[i];\n    }\n    if (a[i].sum > s[1].sum && a[i].sum <= s[0].sum) {\n      s[2] = s[1];\n      s[1] = a[i];\n    }\n    if (a[i].sum > s[0].sum) {\n      s[2] = s[1];\n      s[1] = s[0];\n      s[0] = a[i];\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << s[i].num << \" \" << s[i].sum << \"\\n\";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25797", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int id;\n    int x;\n    int y;\n    int z;\n  } student1, student2, student3, studenta;\n  int n, i;\n  cin >> n;\n  student1.z = student2.z = student3.z = 0;\n  for (i = 0; i < n; i++) {\n    cin >> studenta.id >> studenta.x >> studenta.y;\n    studenta.z = studenta.x + studenta.y;\n    if (studenta.z > student1.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = student1.z;\n      student2.id = student1.id;\n      student1.z = studenta.z;\n      student1.id = studenta.id;\n    } else {\n      if (studenta.z > student2.z) {\n        student3.z = student2.z;\n        student3.id = student2.id;\n        student2.z = studenta.z;\n        student2.id = studenta.id;\n      } else if (studenta.z > student3.z) {\n        student3.z = studenta.z;\n        student3.id = studenta.id;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student1.id, student1.z, student2.id,\n         student2.z, student3.id, student3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "25798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[100001];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct {\n    int id, chin, math, su;\n  } s[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].id, &s[i].chin, &s[i].math);\n    s[i].su = s[i].chin + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i].su < s[j].su) {\n        s[100000] = s[i];\n        s[i] = s[j];\n        s[j] = s[100000];\n      }\n    }\n  }\n  cout << s[0].id << \" \" << s[0].su << \"\\n\"\n       << s[1].id << \" \" << s[1].su << \"\\n\"\n       << s[2].id << \" \" << s[2].su;\n  return 0;\n}\n"}
{"label": "14", "index": "25799", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, t, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> chi >> math;\n    stu[i].sum = chi + math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].sum);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].sum);\n  printf(\"%d %d\", stu[2].num, stu[2].sum);\n}\n"}
{"label": "14", "index": "25800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  struct student *next;\n};\nint m;\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  head = NULL;\n  while (n--) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    m = m - 1;\n  }\n  return (head);\n}\nint main() {\n  int max = 0;\n  int n, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  head = creat(n);\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->chinese + p1->math) > max)\n        max = p1->chinese + p1->math, p2 = p1;\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << (p2->chinese + p2->math) << \"\\n\";\n    head = del(head, p2->num);\n  }\n}\n"}
{"label": "14", "index": "25801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j, max;\n  struct student t, *s;\n  scanf(\"%d\", &n);\n  s = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chi, &s[i].math);\n    s[i].sum = s[i].chi + s[i].math;\n  }\n\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  cout << s[j].num << \" \" << s[j].sum << \"\\n\";\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  cout << s[j].num << \" \" << s[j].sum << \"\\n\";\n  s[j].sum = 0;\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (max < s[i].sum) {\n      max = s[i].sum;\n      j = i;\n    }\n  }\n  cout << s[j].num << \" \" << s[j].sum << \"\\n\";\n  s[j].sum = 0;\n}\n"}
{"label": "14", "index": "25802", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\n\nint main() {\n  int n, s[100000];\n  cin >> n;\n  int i, j, max = 0, t;\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chinese, &a[i].math);\n    s[i] = a[i].chinese + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j] > max) {\n        max = s[j];\n        t = j;\n      }\n    }\n    printf(\"%d %d\\n\", a[t].num, max);\n    max = 0;\n    s[t] = 0;\n  }\n}\n"}
{"label": "14", "index": "25803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int math_grade;\n  int chi_grade;\n  int sum;\n} stu[100000];\nint main() {\n  int i, j, n, max, temp1, temp2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].id);\n    scanf(\"%d\", &stu[i].math_grade);\n    scanf(\"%d\", &stu[i].chi_grade);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math_grade + stu[i].chi_grade;\n  for (i = 0; i < 3; i++) {\n    max = stu[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].sum > max) {\n        temp1 = stu[i].id;\n        stu[i].id = stu[j].id;\n        stu[j].id = temp1;\n        temp2 = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = temp2;\n        max = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 2; i++)\n    cout << stu[i].id << \" \" << stu[i].sum << \"\\n\";\n  cout << stu[2].id << \" \" << stu[2].sum;\n}\n"}
{"label": "14", "index": "25804", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p1, *p2;\n  int i = 1;\n  head = NULL;\n  p2 = p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->b + p1->c;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i >= n)\n      break;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->b + p1->c;\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct stu *z, *p3, *p[100007], *q;\n  int i = 0, j, m;\n  scanf(\"%d\", &n);\n  z = creat();\n  p3 = p[i] = z;\n  while (p3 != NULL) {\n    i++;\n    p[i] = p3->next;\n    p3 = p[i];\n  }\n  m = i;\n  q = p[0];\n  for (i = 0; i < 4; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (p[j]->d >= p[j + 1]->d) {\n        q = p[j];\n        p[j] = p[j + 1];\n        p[j + 1] = q;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d \", p[m - i]->a, p[m - i]->d);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n\n  int n, i, k, e, f;\n\n  cin >> n;\n\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (stu[i - 1].sum < stu[i].sum) {\n        e = stu[i - 1].sum;\n        stu[i - 1].sum = stu[i].sum;\n        stu[i].sum = e;\n        f = stu[i - 1].No;\n        stu[i - 1].No = stu[i].No;\n        stu[i].No = f;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].No << \" \" << stu[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25806", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int a;\n  int b;\n  int c;\n};\n\nint main() {\n  int n, i;\n  int x, y, z;\n\n  struct Student stu;\n  struct Student maxStu, smaxStu, tmaxStu;\n\n  scanf(\"%d\", &n);\n  scanf(\"%d%d%d\", &x, &y, &z);\n  stu.number = x;\n  stu.a = y;\n  stu.b = z;\n  stu.c = stu.a + stu.b;\n  maxStu = stu;\n  smaxStu = stu;\n  tmaxStu = stu;\n\n  for (i = 0; i < n - 1; i++) {\n    scanf(\"%d%d%d\", &x, &y, &z);\n    stu.number = x;\n    stu.a = y;\n    stu.b = z;\n    stu.c = stu.a + stu.b;\n    if (stu.c > maxStu.c) {\n      if (maxStu.c > smaxStu.c) {\n        if (smaxStu.c > tmaxStu.c) {\n          tmaxStu = smaxStu;\n        }\n        smaxStu = maxStu;\n      } else if (maxStu.c > tmaxStu.c) {\n        tmaxStu = maxStu;\n      }\n      maxStu = stu;\n    } else if (stu.c > smaxStu.c) {\n      if (smaxStu.c > tmaxStu.c) {\n        tmaxStu = smaxStu;\n      }\n      smaxStu = stu;\n    } else if (stu.c > tmaxStu.c) {\n      tmaxStu = stu;\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxStu.number, maxStu.c, smaxStu.number,\n         smaxStu.c, tmaxStu.number, tmaxStu.c);\n  return 0;\n}\n"}
{"label": "14", "index": "25807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n} stu[1000000];\n\nint main() {\n  int STUDENT_NUM, i, j, temp1, temp2;\n  cin >> STUDENT_NUM;\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < STUDENT_NUM; j++) {\n      if (stu[i].total < stu[j].total) {\n        temp1 = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = temp1;\n        temp2 = stu[i].total;\n        stu[i].total = stu[j].total;\n        stu[j].total = temp2;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[0].ID, stu[0].total, stu[1].ID,\n         stu[1].total, stu[2].ID, stu[2].total);\n}\n"}
{"label": "14", "index": "25808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int math;\n  int chi;\n  int num;\n  int sum;\n};\nint main() {\n  int i, j, k, n, t, m;\n  struct student stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].math >> stu[i].chi;\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chi;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1, k = i; j < n; j++) {\n      if (stu[j].sum > stu[k].sum)\n        k = j;\n    }\n    t = stu[i].sum;\n    stu[i].sum = stu[k].sum;\n    stu[k].sum = t;\n    m = stu[i].num;\n    stu[i].num = stu[k].num;\n    stu[k].num = m;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int count;\n  int yu;\n  int shu;\n} stu[1000000];\nint main() {\n  int n, i, *p, max = 0, sm = 0, tm = 0, j = 0;\n  p = (int *)malloc(1000000 * sizeof(int));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].count, &stu[i].yu, &stu[i].shu);\n    *(p + i) = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < n; i++)\n    max = (max > *(p + i)) ? max : (*(p + i));\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) < max) && (*(p + i) > sm)) {\n      sm = *(p + i);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) > tm) && (*(p + i) < sm))\n      tm = *(p + i);\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == max) {\n      printf(\"%d %d\\n\", stu[i].count, max);\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == sm && j < 3) {\n      cout << stu[i].count << \" \" << sm << \"\\n\";\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == tm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, tm);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long int num[100000];\n  int y[100000];\n  int m[100000];\n};\n\nint main() {\n  int n, i, temp = 0, sum[100000];\n  struct stu p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> p.num[i] >> p.y[i] >> p.m[i];\n    sum[i] = p.m[i] + p.y[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  cout << p.num[n - 1] << \" \" << sum[n - 1] << \"\\n\";\n  for (i = 0; i < n - 2; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  cout << p.num[n - 2] << \" \" << sum[n - 2] << \"\\n\";\n  for (i = 0; i < n - 3; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 3], sum[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "25811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c;\n  struct student {\n    int id;\n    int score;\n  } stu[100000], t;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> b >> c;\n    stu[i].score = b + c;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].score > stu[j - 1].score) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].score);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25812", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int n;\n  cin >> n;\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n\n  for (i = 0; i < n; i++) {\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  int t_1, t_2;\n  int j, k;\n  for (k = 1; k < 4; k++) {\n    for (j = 0; j < n - k; j++) {\n      if (stu[j].total >= stu[j + 1].total) {\n        t_1 = stu[j + 1].total;\n        stu[j + 1].total = stu[j].total;\n        stu[j].total = t_1;\n        t_2 = stu[j + 1].num;\n        stu[j + 1].num = stu[j].num;\n        stu[j].num = t_2;\n      }\n    }\n  }\n\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j;\n  struct student stu[100000];\n  struct student stud;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].sum < stu[j].sum) {\n        stud = stu[i];\n        stu[i] = stu[j];\n        stu[j] = stud;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, s, p;\n  struct student {\n    int id;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student stu[100000];\n  struct student temp;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    scanf(\"%d %d %d\", &stu[p].id, &stu[p].yuwen, &stu[p].shuxue);\n    stu[p].zongfen = stu[p].yuwen + stu[p].shuxue;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (stu[i].zongfen >= stu[i + 1].zongfen) {\n        temp.id = stu[i].id;\n        temp.yuwen = stu[i].yuwen;\n        temp.shuxue = stu[i].shuxue;\n        temp.zongfen = stu[i].zongfen;\n        stu[i].id = stu[i + 1].id;\n        stu[i].yuwen = stu[i + 1].yuwen;\n        stu[i].shuxue = stu[i + 1].shuxue;\n        stu[i].zongfen = stu[i + 1].zongfen;\n        stu[i + 1].id = temp.id;\n        stu[i + 1].yuwen = temp.yuwen;\n        stu[i + 1].shuxue = temp.shuxue;\n        stu[i + 1].zongfen = temp.zongfen;\n      }\n    }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    cout << stu[k].id << \" \" << stu[k].zongfen << \" \";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int he;\n} student[100000];\n\nint main() {\n  int i, n, j, s = 0, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].yw, &student[i].sx);\n    student[i].he = student[i].yw + student[i].sx;\n  }\n  for (i = 0; i < n; i++) {\n    m = student[0].he;\n    for (j = n - 1; j > 0; j--) {\n\n      m = student[j].he > m ? student[j].he : m;\n    }\n\n    for (j = 0; j < n; j++) {\n      if (student[j].he == m) {\n        printf(\"%d %d\\n\", student[j].num, student[j].he);\n        student[j].he = 0;\n        s = s + 1;\n        if (s == 3) {\n          goto guiyi;\n        }\n      }\n    }\n  }\nguiyi:\n  return 0;\n}\n"}
{"label": "14", "index": "25816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id, chin, math, z;\n  } p[100000];\n  int id, math, chin, z, i, n, f, s, t, id1, id2, id3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &id, &chin, &math);\n    p[i].id = id;\n    p[i].math = math;\n    p[i].chin = chin;\n  }\n\n  for (i = 0; i < n; i++) {\n    id = p[i].id;\n    math = p[i].math;\n    chin = p[i].chin;\n    z = math + chin;\n\n    if (i == 0) {\n      f = s = t = z;\n      id1 = id2 = id3 = id;\n    } else if (i == 1) {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else {\n        t = s = z;\n        id2 = id3 = id;\n      }\n    } else {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else if (z > s) {\n        t = s;\n        id3 = id2;\n        s = z;\n        id2 = id;\n      } else if (z > t) {\n        t = z;\n        id3 = id;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", id1, f);\n  printf(\"%d %d\\n\", id2, s);\n  printf(\"%d %d\\n\", id3, t);\n  return 0;\n}\n"}
{"label": "14", "index": "25817", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chi >> p1->math;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n  struct student *head, *p, *p1, *p2, *p3;\n  int n, m1, m2, m3, k;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  m1 = m2 = m3 = 0;\n  if (head != NULL) {\n    do {\n      k = p->chi + p->math;\n      if (k > m1) {\n        m1 = k;\n        p1 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m2) && (p != p1)) {\n        m2 = k;\n        p2 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m3) && (p != p1) && (p != p2)) {\n        m3 = k;\n        p3 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  printf(\"%d %d %d %d %d %d \", p1->num, m1, p2->num, m2, p3->num, m3);\n}\n"}
{"label": "14", "index": "25818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  double chi;\n  double math;\n  double total;\n};\nint main() {\n  struct student stu[100000];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%lf%lf\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i; j < n; j++) {\n      if (stu[k].total < stu[j].total) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = stu[i];\n      stu[i] = stu[k];\n      stu[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %.0lf\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25819", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint n;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int ovr;\n  struct student *next;\n};\nstruct student *creat() {\n  int i;\n  struct student *head;\n  struct student *p1, *p2;\n  head = (struct student *)malloc(sizeof(struct student));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    scanf(\"%d %d %d\", &p2->num, &p2->chn, &p2->math);\n    p2->ovr = p2->chn + p2->math;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int i;\n  int no1, ovr1 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->next != 0) {\n      if (p1->ovr > ovr1) {\n        ovr1 = p1->ovr;\n        no1 = p1->num;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", no1, ovr1);\n    p2->ovr = 0;\n    ovr1 = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25820", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int chi;\n  int math;\n  int s;\n  struct stu *next;\n};\nstruct stu *creat(int n) {\n  int i;\n  struct stu *head;\n  struct stu *p1, *p2;\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int i, n, t, m;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p1 = head;\n  for (i = 0; i < n; i++) {\n    p1->s = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (i = 0; i < 3; i++) {\n    while (p2 != NULL) {\n      if (p2->s > p1->s) {\n        t = p2->s;\n        p2->s = p1->s;\n        p1->s = t;\n        m = p2->num;\n        p2->num = p1->num;\n        p1->num = m;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%d %d \", p1->num, p1->s);\n    if (i == 2) {\n      break;\n    }\n    p1 = p1->next;\n    p2 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  if (n == 0) {\n    head = NULL;\n    return (head);\n  } else {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->chinese >> p1->math;\n    p1->next = NULL;\n    head = p1;\n    p2 = p1;\n    for (i = 1; i < n; i++) {\n      p1 = (struct student *)malloc(1000);\n      scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    }\n    return (head);\n  }\n}\nvoid top3(struct student *head) {\n  struct student *p, *p1;\n  int max = 0;\n  p = head;\n  do {\n    p->total = (p->chinese) + (p->math);\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  max = 0;\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  top3(head);\n}\n"}
{"label": "14", "index": "25822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, a, b, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &a, &b);\n    stu[i].sum = a + b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - i - 1; j > 0; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct result {\n  int num;\n  int chn;\n  int math;\n  int total;\n};\nint main() {\n  int n, k;\n  cin >> n;\n  struct result student[n + 1];\n  for (k = 1; k <= n; k++) {\n    cin >> student[k].num >> student[k].chn >> student[k].math;\n    student[k].total = student[k].chn + student[k].math;\n  }\n  int i, j;\n  struct result temp;\n  for (i = 1; i < 4; i++)\n    for (j = 1; j <= n - i; j++) {\n      if (student[j].total >= student[j + 1].total) {\n        temp = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = temp;\n      }\n    }\n  cout << student[n].num << \" \" << student[n].total << endl;\n  cout << student[n - 1].num << \" \" << student[n - 1].total << endl;\n  printf(\"%d %d\\n\", student[n - 2].num, student[n - 2].total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int maths;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student s, s1, s2, s3;\n  scanf(\"%d\", &n);\n  s2.total = s1.total = s3.total = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.chinese, &s.maths);\n    s.total = s.chinese + s.maths;\n    if (s.total > s1.total) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.total > s2.total) {\n      s3 = s2;\n      s2 = s;\n    } else {\n      if (s.total > s3.total) {\n        s3 = s;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.id, s1.total);\n  printf(\"%d %d\\n\", s2.id, s2.total);\n  printf(\"%d %d\\n\", s3.id, s3.total);\n}\n"}
{"label": "14", "index": "25825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct data {\n  int id;\n  int cs;\n  int ms;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return ((struct data *)b)->s - ((struct data *)a)->s;\n}\nint main() {\n  struct data *a;\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  a = (struct data *)malloc(n * sizeof(struct data));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].cs, &a[i].ms);\n    a[i].s = a[i].cs + a[i].ms;\n  }\n  qsort(a, n, sizeof(struct data), cmp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", a[i].id, a[i].s);\n  free(a);\n}\n"}
{"label": "14", "index": "25826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n  };\n  int i, n, j = 0;\n  scanf(\"%d\", &n);\n  struct stu *hd, *p;\n  hd = p = (struct stu *)malloc(100000 * sizeof(struct stu));\n  for (i = 0; i < n; i++, p++)\n    scanf(\"%d %d %d\", &p->a, &p->b, &p->c);\n\n  int max = 0;\nnxt:\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c > max)\n      max = p->b + p->c;\n  }\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c == max) {\n      cout << p->a << \" \" << p->b + p->c << \"\\n\";\n      p->b = 0;\n      p->c = 0;\n      max = 0;\n      j++;\n      break;\n    }\n  }\n  if (j <= 2)\n    goto nxt;\n}\n"}
{"label": "14", "index": "25827", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int score;\n  struct student *next;\n};\nint n, i = 0, a;\nstruct student *m1, *m2, *m3, *q;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  p1->score = p1->yuwen + p1->shuxue;\n  head = NULL;\n  while (i < n - 1) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->score = p1->yuwen + p1->shuxue;\n    if (i >= 3) {\n      if (p2->score > m1->score) {\n        m3 = m2;\n        m2 = m1;\n        m1 = p2;\n      } else if (p2->score <= m1->score && p2->score > m2->score) {\n        m3 = m2;\n        m2 = p2;\n      } else if (p2->score <= m2->score && p2->score > m3->score)\n        m3 = p2;\n      i++;\n      continue;\n    }\n    if (i == 0)\n      m1 = p2;\n    else if (i == 1)\n      m2 = p2;\n    else if (i == 2) {\n      m3 = p2;\n      if (m1->score > m2->score) {\n        if (m2->score <= m3->score) {\n          if (m1->score > m3->score) {\n            q = m3;\n            m3 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = m3;\n            m3 = q;\n          }\n        }\n      } else if (m1->score <= m2->score) {\n        if (m2->score > m3->score) {\n          if (m1->score > m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m3;\n            m3 = m1;\n            m1 = m2;\n            m2 = q;\n          }\n        } else if (m2->score <= m3->score) {\n          q = m1;\n          m1 = m3;\n          m3 = q;\n        }\n      }\n    }\n    i++;\n  }\n  return (head);\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  printf(\"%d %d \", m1->num, m1->score);\n  printf(\"%d %d \", m2->num, m2->score);\n  printf(\"%d %d \", m3->num, m3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "25828", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} s[100001], first, second, third;\n\nint main() {\n  int n, i, temp1, temp2;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].chinese >> s[i].math;\n    s[i].sum = s[i].chinese + s[i].math;\n  }\n  first.sum = 0, second.sum = 0, third.sum = 0;\n  for (i = 0; i < n; i++) {\n    if (first.sum < s[i].sum) {\n      first = s[i];\n      temp1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (second.sum < s[i].sum && s[i].num != s[temp1].num) {\n      second = s[i];\n      temp2 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (third.sum < s[i].sum && s[i].num != s[temp1].num &&\n        s[i].num != s[temp2].num)\n      third = s[i];\n  }\n  cout << first.num << \" \" << first.sum << endl;\n  cout << second.num << \" \" << second.sum << endl;\n  cout << third.num << \" \" << third.sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n};\nint main() {\n  int n, i, x = 0, y = 0, z = 0;\n  cin >> n;\n  struct student a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].yw, &a[i].sx);\n    b[i] = a[i].yw + a[i].sx;\n  }\n  for (i = 1; i < n; i++) {\n    if (b[x] < b[i])\n      x = i;\n  }\n  printf(\"%d %d\\n\", a[x].num, b[x]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (b[y] < b[i])\n      y = i;\n  }\n  printf(\"%d %d\\n\", a[y].num, b[y]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (i == y)\n      continue;\n    if (b[z] < b[i])\n      z = i;\n  }\n  printf(\"%d %d\\n\", a[z].num, b[z]);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n};\nstruct student stu[100000];\nint main() {\n  long i, m;\n  scanf(\"%ld\", &m);\n  struct student *p = stu;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d%d%d\", &(p->num), &(p->score1), &(p->score2));\n    p->total = (p->score1 + p->score2);\n  }\n  int max1, max2, max3, a1 = 0, a2 = 0, a3 = 0;\n  max1 = stu[0].total;\n  for (i = 0; i < m; i++) {\n    if (stu[i].total > max1) {\n      max1 = stu[i].total;\n      a1 = i;\n    }\n  }\n  max2 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max2 && i != a1) {\n      max2 = stu[i].total;\n      a2 = i;\n    }\n  }\n  max3 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max3 && stu[i].total < max2) {\n      max3 = stu[i].total;\n      a3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a1].num, stu[a1].total);\n  cout << stu[a2].num << \" \" << stu[a2].total << \"\\n\";\n  printf(\"%d %d\", stu[a3].num, stu[a3].total);\n  return 0;\n}\n"}
{"label": "14", "index": "25831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int ch;\n  int math;\n  int total;\n  struct student *next;\n};\nint n;\nint t;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  p1->total = p1->ch + p1->math;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->ch >> p1->math;\n    p1->total = p1->ch + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int max;\n  p = head;\n  max = p->total;\n  p = p->next;\n  while (p->next != NULL) {\n    if (p->total > max) {\n      max = p->total;\n      t = p->num;\n    }\n    p = p->next;\n  }\n  cout << t << \" \" << max << \" \";\n}\n\nstruct student *del(struct student *head, int a) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (a != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head) {\n    head = p1->next;\n  } else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head1, *head2, *head3;\n  head1 = creat();\n  print(head1);\n  head2 = del(head1, t);\n  print(head2);\n  head3 = del(head2, t);\n  print(head3);\n}\n"}
{"label": "14", "index": "25832", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  struct stu *next;\n};\n\nint main() {\n  int i = 0, n, a, b, score, first = 0, second = 0, third = 0;\n  struct stu *head, *p, *p1, *p2, *p3;\n  cin >> n;\n  head = p = (struct stu *)malloc(sizeof(struct stu));\n  while (i++ < n) {\n    scanf(\"%d %d %d\", &(*p).num, &a, &b);\n    score = a + b;\n    if (score > first) {\n      third = second;\n      second = first;\n      first = score;\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (score > second) {\n      third = second;\n      second = score;\n      p3 = p2;\n      p2 = p;\n    } else if (score > third) {\n      third = score;\n      p3 = p;\n    }\n    p = (*p).next = (struct stu *)malloc(sizeof(struct stu));\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", (*p1).num, first, (*p2).num, second,\n         (*p3).num, third);\n}\n"}
{"label": "14", "index": "25833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int c;\n  int m;\n  int t;\n};\nint main() {\n  int n, i, j, K;\n  struct stu a[4] = {0};\n  struct stu b[4] = {0};\n  struct stu temp = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    if (i <= 2) {\n      scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n      a[i].t = a[i].c + a[i].m;\n      b[i] = a[i];\n    } else {\n      scanf(\"%d%d%d\", &a[3].id, &a[3].c, &a[3].m);\n      a[3].t = a[3].c + a[3].m;\n      b[3] = a[3];\n\n      for (K = 0; K <= 3; K++) {\n        for (j = 0; j <= 3; j++) {\n          if (b[j].t < b[j + 1].t) {\n            temp = b[j];\n            b[j] = b[j + 1];\n            b[j + 1] = temp;\n          }\n        }\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", b[i].id, b[i].t);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int sum;\n  } students[100000];\n  int n, i;\n  int a1, b1, a2, b2, a3, b3;\n  int c1, c2;\n  int max = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> students[i].number >> students[i].chinese >> students[i].math;\n    students[i].sum = students[i].chinese + students[i].math;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max) {\n      max = students[i].sum;\n      a1 = students[i].number;\n      b1 = students[i].sum;\n      c1 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c1) {\n      max = students[i].sum;\n      a2 = students[i].number;\n      b2 = students[i].sum;\n      c2 = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (students[i].sum > max && i != c2 && i != c1) {\n      max = students[i].sum;\n      a3 = students[i].number;\n      b3 = students[i].sum;\n    }\n  }\n  cout << a1 << \" \" << b1 << \"\\n\";\n  printf(\"%d %d\\n\", a2, b2);\n  cout << a3 << \" \" << b3 << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int i, num;\n  struct student stu[100000];\n  int max_0 = 0, max_1 = 0, max_2 = 0;\n  int max_0_id, max_1_id, max_2_id;\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %d %d\", &(stu[i].id), &(stu[i].chinese), &(stu[i].math));\n    stu[i].total = stu[i].chinese + stu[i].math;\n    if (stu[i].total > max_0) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = max_0;\n      max_1_id = max_0_id;\n      max_0 = stu[i].total;\n      max_0_id = stu[i].id;\n    } else if (stu[i].total > max_1) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = stu[i].total;\n      max_1_id = stu[i].id;\n    } else if (stu[i].total > max_2) {\n      max_2 = stu[i].total;\n      max_2_id = stu[i].id;\n    }\n  }\n\n  printf(\"%d %d\\n\", max_0_id, max_0);\n  printf(\"%d %d\\n\", max_1_id, max_1);\n  cout << max_2_id << \" \" << max_2 << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, num[100000], j, grade1[100000], grade2[100000], grade[100000], t1,\n      t2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &num[i], &grade1[i], &grade2[i]);\n    grade[i] = grade1[i] + grade2[i];\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (grade[i] >= grade[i + 1]) {\n        t1 = grade[i];\n        grade[i] = grade[i + 1];\n        grade[i + 1] = t1;\n        t2 = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t2;\n      }\n    }\n  }\n  cout << num[n - 1] << \" \" << grade[n - 1] << \"\\n\"\n       << num[n - 2] << \" \" << grade[n - 2] << \"\\n\"\n       << num[n - 3] << \" \" << grade[n - 3];\n}\n"}
{"label": "14", "index": "25837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int eng;\n  int math;\n  int sum;\n  struct stu *next;\n} * head, *p1, *p2;\nstruct stu *order(int n) {\n  int i, j, t;\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    p2 = p1->next;\n    for (j = i + 1; j < n; j++) {\n      if (p1->sum < p2->sum) {\n        t = p1->id;\n        p1->id = p2->id;\n        p2->id = t;\n        t = p1->sum;\n        p1->sum = p2->sum;\n        p2->sum = t;\n      }\n      p2 = p2->next;\n    }\n    p1 = p1->next;\n  }\n  return head;\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = head = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->eng, &p1->math);\n    p1->sum = p1->eng + p1->math;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n  }\n  p2->next = NULL;\n  p1 = order(n);\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "25838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  int Num;\n  int scoreC;\n  int scoreM;\n  int all;\n};\nstruct stu stu[100005];\nvoid fsort(int first, int last) {\n  int chosen1, chosen2, p, q;\n  if (first >= last) {\n    return;\n  }\n  chosen1 = stu[first].all;\n  chosen2 = stu[first].Num;\n  p = first;\n  q = last;\n  while (p < q) {\n    while ((p < q) && (stu[q].all >= chosen1)) {\n      q--;\n    }\n    if (p < q) {\n      stu[p].all = stu[q].all;\n      stu[p].Num = stu[q].Num;\n      p++;\n    }\n    while ((p < q) && (stu[p].all < chosen1)) {\n      p++;\n    }\n    if (p < q) {\n      stu[q].all = stu[p].all;\n      stu[q].Num = stu[p].Num;\n      q--;\n    }\n  }\n  stu[p].all = chosen1;\n  stu[p].Num = chosen2;\n  fsort(first, p - 1);\n  fsort(p + 1, last);\n}\nint main() {\n  int m, i;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> stu[i].Num >> stu[i].scoreC >> stu[i].scoreM;\n    stu[i].all = stu[i].scoreC + stu[i].scoreM;\n  }\n  fsort(1, m);\n  cout << stu[m].Num << \" \" << stu[m].all << \"\\n\";\n  cout << stu[m - 1].Num << \" \" << stu[m - 1].all << endl;\n  cout << stu[m - 2].Num << \" \" << stu[m - 2].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, y, s, z, x, a, b, c, ax, bx, cx;\n  scanf(\"%d\", &n);\n  a = 0;\n  b = 0;\n  c = 0;\n  ax = 0;\n  bx = 0;\n  cx = 0;\n  for (i = 1; i <= n; i++) {\n\n    scanf(\"%d %d %d\", &x, &y, &s);\n    z = y + s;\n    if (c >= z)\n      continue;\n    else if (b >= z) {\n      c = z;\n      cx = x;\n    } else if (a >= z) {\n      c = b;\n      cx = bx;\n      b = z;\n      bx = x;\n    } else {\n      c = b;\n      cx = bx;\n      b = a;\n      bx = ax;\n      a = z;\n      ax = x;\n    }\n  }\n  printf(\"%d %d\\n\", ax, a);\n  printf(\"%d %d\\n\", bx, b);\n  printf(\"%d %d\\n\", cx, c);\n}\n"}
{"label": "14", "index": "25840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  struct student *next;\n};\nint main() {\n  struct student *head, *p1, *p2;\n  int i, max, n;\n  scanf(\"%d\", &n);\n  p1 = p2 = head = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yw >> p1->sx;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = p1->yw + p1->sx;\n    while (p1 != NULL) {\n      if ((p1->yw + p1->sx) > max) {\n        max = p1->yw + p1->sx;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, max);\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "25841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct xue {\n  int ID;\n  int sx;\n  int yw;\n  int sum;\n} xueshen;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  struct xue *xuesheng;\n  xuesheng = (struct xue *)malloc(4 * sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> xuesheng[i].ID >> xuesheng[i].sx >> xuesheng[i].yw;\n    xuesheng[i].sum = xuesheng[i].sx + xuesheng[i].yw;\n  }\n  for (i = 1; i < 4; i++) {\n    for (k = 0; k < n - i; k++) {\n      if (xuesheng[k].sum >= xuesheng[k + 1].sum) {\n        xueshen = xuesheng[k + 1];\n        xuesheng[k + 1] = xuesheng[k];\n        xuesheng[k] = xueshen;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", xuesheng[n - i].ID, xuesheng[n - i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int ch;\n  int ma;\n};\n\nint main() {\n  struct student re[1000];\n  int n;\n  int i = 0, j = 0, rec;\n  int total[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> re[i].ID >> re[i].ch >> re[i].ma;\n    total[i] = re[i].ch + re[i].ma;\n  }\n\n  int max = total[0];\n\n  for (i = 0; i < n; i++) {\n    if (max < total[i]) {\n      max = total[i];\n      rec = i;\n    }\n    if (i == n - 1) {\n      cout << re[rec].ID << \" \" << total[rec] << \" \";\n      total[rec] = 0;\n      i = 0;\n      max = total[0];\n      j++;\n    }\n\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} student[1000000];\nvoid swap(int *a, int *b);\nint main(int argc, char *argv[]) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i = 0, j = 0, total[1000000];\n  for (i = 0; i < n; i++) {\n    cin >> student[i].xuehao >> student[i].yuwen >> student[i].shuxue;\n    total[i] = student[i].yuwen + student[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > 0 + i; j--) {\n      if (total[j] > total[j - 1]) {\n        swap(&total[j], &total[j - 1]);\n        swap(&student[j - 1].xuehao, &student[j].xuehao);\n        swap(&student[j - 1].yuwen, &student[j].yuwen);\n        swap(&student[j - 1].shuxue, &student[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << student[i].xuehao << \" \" << total[i] << \"\\n\";\n  }\n  return 0;\n}\nvoid swap(int *a, int *b) {\n  int e;\n  e = *a;\n  *a = *b;\n  *b = e;\n}\n"}
{"label": "14", "index": "25844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int math;\n    int chinese;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].math >> a[i].chinese;\n    a[i].sum = a[i].math + a[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25845", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    char a[6];\n    int c;\n    int m;\n    int s;\n    struct student *next;\n  };\n  struct student *head;\n  struct student *p1, *p2;\n  struct student first = {\"\", 0, 0, 0, 0};\n  struct student second = {\"\", 0, 0, 0, 0};\n  struct student third = {\"\", 0, 0, 0, 0};\n  int n, i, j;\n  char ch;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  for (j = 0; j < 6; j = j + 1)\n    p1->a[j] = '\u0000';\n  getchar();\n  for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n    p1->a[j] = ch;\n  scanf(\"%d%d\", &p1->c, &p1->m);\n  p1->s = p1->c + p1->m;\n  head = 0;\n  for (i = 1; i < n; i = i + 1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    for (j = 0; j < 6; j = j + 1)\n      p1->a[j] = '\u0000';\n    getchar();\n    for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n      p1->a[j] = ch;\n    scanf(\"%d%d\", &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n  }\n  p2->next = 0;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->s > first.s) {\n      third = second;\n      second = first;\n      first = *p1;\n    } else if (p1->s > second.s) {\n      third = second;\n      second = *p1;\n    } else if (p1->s > third.s)\n      third = *p1;\n    else\n      continue;\n  }\n  printf(\"%s %d \", first.a, first.s);\n  printf(\"%s %d \", second.a, second.s);\n  printf(\"%s %d \", third.a, third.s);\n}\n"}
{"label": "14", "index": "25846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct Stu {\n    int num;\n    int sco[2];\n    int sum;\n  };\n  struct Stu stu[5];\n  struct Stu temp;\n  int i, j, n, m, k;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    for (i = 0; i < 3; i++) {\n      cin >> stu[i].num >> stu[i].sco[0] >> stu[i].sco[1];\n      stu[i].sum = stu[i].sco[0] + stu[i].sco[1];\n    }\n    for (k = 1; k <= n - 3; k++) {\n      scanf(\"%d%d%d\", &stu[3].num, &stu[3].sco[0], &stu[3].sco[1]);\n      stu[3].sum = stu[3].sco[0] + stu[3].sco[1];\n      m = 0;\n      for (j = 1; j <= 2; j++) {\n        if (stu[m].sum > stu[j].sum ||\n            (stu[m].sum == stu[j].sum && stu[m].num < stu[j].num))\n          m = j;\n      }\n      if (stu[3].sum > stu[m].sum)\n        stu[m] = stu[3];\n    }\n  }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].num > stu[j].num) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].sum < stu[j].sum) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25847", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu1 {\n  long num;\n  int score1;\n  int score2;\n  struct stu1 *next;\n};\n\nstruct stu1 *creat(void) {\n  int n, i = 1;\n\n  struct stu1 *h;\n\n  struct stu1 *q1, *q2;\n  scanf(\"%d\", &n);\n\n  q2 = q1 = (struct stu1 *)malloc(1000);\n\n  h = NULL;\n  while (i <= n) {\n    cin >> q1->num >> q1->score1 >> q1->score2;\n\n    if (i == 1) {\n      h = q1;\n    } else {\n      q2 = q1;\n    }\n    if (i != n) {\n\n      q1 = q2->next = (struct stu1 *)malloc(1000);\n    } else {\n      q1->next = NULL;\n    }\n    i++;\n  }\n  return (h);\n}\n\nstruct stu1 *turn(struct stu1 *h) {\n  int t = 1;\n  struct stu1 *p1, *p2;\n  int m, n, w;\n  for (p1 = h, t = 1; p1->next != NULL, t <= 3; p1 = p1->next, t++) {\n    p2 = p1->next;\n    while (p2 != NULL) {\n      if ((p1->score1 + p1->score2) < (p2->score1 + p2->score2)) {\n        m = p1->num;\n        n = p1->score1;\n        w = p1->score2;\n        p1->num = p2->num;\n        p1->score1 = p2->score1;\n        p1->score2 = p2->score2;\n        p2->num = m;\n        p2->score1 = n;\n        p2->score2 = w;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%ld %d \", p1->num, (p1->score1 + p1->score2));\n  }\n  return (h);\n}\n\nint main() {\n  struct stu1 *ip;\n  ip = creat();\n  turn(ip);\n}\n"}
{"label": "14", "index": "25848", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d\", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = max1.num;\n      max2.z = max1.z;\n      max1.num = a.num;\n      max1.z = a.z;\n    } else if (a.z > max2.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = a.num;\n      max2.z = a.z;\n    } else if (a.z > max3.z) {\n      max3.num = a.num;\n      max3.z = a.z;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n}\n"}
{"label": "14", "index": "25849", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint x[100000], y[100000], z[100000], s[100000], b[100000];\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, t, m1, m2;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x[i], &y[i], &z[i]);\n    s[i] = y[i] + z[i];\n    b[i] = s[i];\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (s[i] < s[j]) {\n        t = s[i];\n        s[i] = s[j];\n        s[j] = t;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[1] == b[i]) {\n      m1 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[2] == b[i] && i != m1) {\n      m2 = i;\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (s[3] == b[i] && i != m1 && i != m2) {\n      printf(\"%d %d\\n\", x[i], b[i]);\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n};\n\nint main() {\n\n  int n, i, j, t, a, b, m;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    cin >> stu[i].num;\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    cout << stu[a].num << \" \" << stu[a].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int sum;\n  struct stu *next;\n};\n\nstruct stu *creat(long n) {\n  long i;\n  struct stu *p, *q, *head;\n  p = (struct stu *)malloc(1000);\n  head = q = p;\n  scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n      p->sum = p->shuxue + p->yuwen;\n  for (i = 1; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n        p->sum = p->shuxue + p->yuwen;\n    q->next = p, q = p;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  long i, n;\n  scanf(\"%ld\", &n);\n  struct stu *h, *p, *q1, *q2, *q3;\n  h = creat(n);\n  int m1, m2, m3;\n  for (p = h, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1)\n      m1 = p->sum, q1 = p;\n  printf(\"%d %d\", q1->ID, q1->sum);\n  for (p = h, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1)\n      m2 = p->sum, q2 = p;\n  printf(\" %d %d\", q2->ID, q2->sum);\n  for (p = h, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2)\n      m3 = p->sum, q3 = p;\n  cout << \" \" << q3->ID << \" \" << q3->sum;\n}\n"}
{"label": "14", "index": "25852", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int scorechinese;\n    int scoremath;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].scorechinese, &a[i].scoremath);\n    a[i].sum = a[i].scorechinese + a[i].scoremath;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25853", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\n\nint main() {\n  int n, s[100000];\n  scanf(\"%d\", &n);\n  int i, j, max = 0, t;\n  struct student a[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].chinese, &a[i].math);\n    s[i] = a[i].chinese + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j] > max) {\n        max = s[j];\n        t = j;\n      }\n    }\n    printf(\"%d %d\\n\", a[t].num, max);\n    max = 0;\n    s[t] = 0;\n  }\n}\n"}
{"label": "14", "index": "25854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int c;\n};\nint main() {\n  int n, i, j, m, t;\n  struct student stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].c = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        t = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        m = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].c << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000], b[100000], d[100000], i, j, n, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &d[i]);\n    d[i] = b[i] + d[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (d[j] > d[j - 1]) {\n        t = d[j];\n        s = a[j];\n        d[j] = d[j - 1];\n        a[j] = a[j - 1];\n        d[j - 1] = t;\n        a[j - 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i], d[i]);\n}\n"}
{"label": "14", "index": "25856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct data {\n  int num[100000], a[100000], b[100000], sum[100000];\n} data;\n\nint main(int argc, char *argv[]) {\n  int i, n, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> data.num[i] >> data.a[i] >> data.b[i];\n    data.sum[i] = data.a[i] + data.b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (data.sum[i] > data.sum[x]) {\n      z = y;\n      y = x;\n      x = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[x] && data.sum[i] > data.sum[y]) {\n      z = y;\n      y = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[y] && data.sum[i] > data.sum[z]) {\n      z = i;\n    }\n  }\n  printf(\"%d %d\\n\", data.num[x], data.sum[x]);\n  cout << data.num[y] << \" \" << data.sum[y] << \"\\n\";\n  printf(\"%d %d\", data.num[z], data.sum[z]);\n}\n"}
{"label": "14", "index": "25857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    char ID[10];\n    int m;\n    int c;\n\n  } tmp;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int a1 = 0, a2 = 0, a3 = 0;\n  int n, i;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d %d\", tmp.ID, &(tmp.m), &(tmp.c));\n    if ((tmp.m + tmp.c) > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = a1;\n      a1 = i;\n    } else if ((tmp.m + tmp.c) == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    } else if ((tmp.m + tmp.c) < max1 && (tmp.m + tmp.c) > max2) {\n      max3 = max2;\n      max2 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    }\n\n    else if ((tmp.m + tmp.c) == max2) {\n      max3 = max2;\n      a3 = atoi(tmp.ID);\n    } else if ((tmp.m + tmp.c) < max2 && (tmp.m + tmp.c) > max3) {\n      max3 = tmp.m + tmp.c;\n      a3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a1, max1);\n  printf(\"%d %d\\n\", a2, max2);\n  printf(\"%d %d\\n\", a3, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25858", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int sum;\n  struct stu *next;\n};\n\nstruct stu *creat(long n) {\n  long i;\n  struct stu *p, *q, *head;\n  p = (struct stu *)malloc(1000);\n  head = q = p;\n  scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n      p->sum = p->shuxue + p->yuwen;\n  for (i = 1; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n        p->sum = p->shuxue + p->yuwen;\n    q->next = p, q = p;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  long i, n;\n  scanf(\"%ld\", &n);\n  struct stu *h, *p, *q1, *q2, *q3;\n  h = creat(n);\n  int m1, m2, m3;\n  for (p = h, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1)\n      m1 = p->sum, q1 = p;\n  printf(\"%d %d\", q1->ID, q1->sum);\n  for (p = h, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1)\n      m2 = p->sum, q2 = p;\n  printf(\" %d %d\", q2->ID, q2->sum);\n  for (p = h, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2)\n      m3 = p->sum, q3 = p;\n  printf(\" %d %d\", q3->ID, q3->sum);\n}\n"}
{"label": "14", "index": "25859", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100001], t;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25860", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nvoid fun(int *a, int *b);\nint main() {\n  int n, i, j;\n  int sum[100000];\n  cin >> n;\n  struct Student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (sum[j] > sum[j - 1]) {\n        fun(&sum[j], &sum[j - 1]);\n        fun(&stu[j - 1].num, &stu[j].num);\n        fun(&stu[j - 1].yuwen, &stu[j].yuwen);\n        fun(&stu[j - 1].shuxue, &stu[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, sum[i]);\n  return 0;\n}\nvoid fun(int *a, int *b) {\n  int k;\n  k = *a;\n  *a = *b;\n  *b = k;\n}\n"}
{"label": "14", "index": "25861", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n    int amount;\n  };\n  struct student stu[100000];\n  int a[100000], n, l, j, k;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].maths;\n    a[i] = stu[i].chinese + stu[i].maths;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (int h = n - 1; h >= 0; h--) {\n    if (a[n - 1] == stu[h].chinese + stu[h].maths) {\n      l = stu[h].num;\n    }\n  }\n  for (int g = n - 1; g >= 0; g--) {\n    if (a[n - 2] == stu[g].chinese + stu[g].maths && (g + 1) != l) {\n      j = stu[g].num;\n    }\n  }\n  for (int f = n - 1; f >= 0; f--) {\n    if (a[n - 3] == stu[f].chinese + stu[f].maths && (f + 1) != j &&\n        (f + 1) != l) {\n      k = stu[f].num;\n    }\n  }\n  printf(\"%d %d\\n\", l, a[n - 1]);\n  printf(\"%d %d\\n\", j, a[n - 2]);\n  printf(\"%d %d\\n\", k, a[n - 3]);\n}\n"}
{"label": "14", "index": "25862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n};\n\nint main() {\n  int n;\n  int i, j, e;\n  int x;\n  struct student a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chn, &a[i].math);\n    a[i].sum = a[i].chn + a[i].math;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = n - i - 1; j >= 0; j--) {\n      if (a[j].sum < a[j + 1].sum) {\n        x = a[j + 1].sum;\n        a[j + 1].sum = a[j].sum;\n        a[j].sum = x;\n        e = a[j + 1].num;\n        a[j + 1].num = a[j].num;\n        a[j].num = e;\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25863", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  int num;\n  int chinese;\n  int math;\n  int all;\n} stu[100000];\nint main() {\n  int n, i, e, f, g, a, b, c;\n  e = 0;\n  f = 0;\n  g = 0;\n  a = 0;\n  b = 0;\n  c = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all > e) {\n      e = stu[i].all;\n      a = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= e && stu[i].all > f && i != a) {\n      f = stu[i].all;\n      b = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= f && stu[i].all > g && i != a && i != b) {\n      g = stu[i].all;\n      c = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a].num, stu[a].all);\n  printf(\"%d %d\\n\", stu[b].num, stu[b].all);\n  printf(\"%d %d\\n\", stu[c].num, stu[c].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25864", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int ovr;\n  struct student *next;\n};\nstruct student *creat() {\n  int i;\n  struct student *head;\n  struct student *p1, *p2;\n  head = (struct student *)malloc(sizeof(struct student));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    cin >> p2->num >> p2->chn >> p2->math;\n    p2->ovr = p2->chn + p2->math;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int i;\n  int no1, ovr1 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  cin >> n;\n  head = creat();\n  p1 = p2 = head;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->next != 0) {\n      if (p1->ovr > ovr1) {\n        ovr1 = p1->ovr;\n        no1 = p1->num;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", no1, ovr1);\n    p2->ovr = 0;\n    ovr1 = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25865", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int Chinese;\n  int math;\n  int score;\n} stu[100000];\n\nint main() {\n  int n, i, j, a, b;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].No, &stu[i].Chinese, &stu[i].math);\n    stu[i].score = stu[i].Chinese + stu[i].math;\n  }\n\n  for (j = n - 1; j > n - 4; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i + 1].score < stu[i].score || stu[i + 1].score == stu[i].score) {\n        a = stu[i + 1].score;\n        stu[i + 1].score = stu[i].score;\n        stu[i].score = a;\n        b = stu[i + 1].No;\n        stu[i + 1].No = stu[i].No;\n        stu[i].No = b;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].No, stu[i].score);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25866", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int id, chinese, math, total;\n\n  int n, i, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &id, &chinese, &math);\n    total = chinese + math;\n    if (total > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = total;\n      x = id;\n\n    } else if (total <= a && total > b) {\n      c = b;\n      z = y;\n      b = total;\n      y = id;\n    } else if (total <= b && total > c) {\n      c = total;\n      z = id;\n    }\n  }\n\n  printf(\"%d %d\\n\", x, a);\n  printf(\"%d %d\\n\", y, b);\n  printf(\"%d %d\\n\", z, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= 3; i++) {\n    p1 = p2 = head;\n    while (p1 != NULL) {\n      if (p1->yu + p1->shu > p2->yu + p2->shu)\n        p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", p2->num, p2->yu + p2->shu);\n    p2->yu = 0;\n    p2->shu = 0;\n  }\n}\n"}
{"label": "14", "index": "25868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int id;\n  int ch;\n  int mt;\n  int total;\n};\nstruct stu stu_1[100000];\nstruct stu top1 = {0, 0, 0, 0}, top2 = {0, 0, 0, 0}, top3 = {0, 0, 0, 0};\n\nint main() {\n  int n, i;\n  struct stu tem;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(stu_1[i].id), &(stu_1[i].ch), &(stu_1[i].mt));\n    stu_1[i].total = stu_1[i].ch + stu_1[i].mt;\n    if (stu_1[i].total > top1.total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = stu_1[i];\n    } else if (stu_1[i].total > top2.total) {\n      top3 = top2;\n      top2 = stu_1[i];\n    } else if (stu_1[i].total > top3.total) {\n      top3 = stu_1[i];\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", top1.id, top1.total);\n  if ((top2.id) != 0)\n    printf(\"%d %d\\n\", top2.id, top2.total);\n  if ((top3.id) != 0)\n    printf(\"%d %d\\n\", top3.id, top3.total);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n};\nint main() {\n  int i, j, n, t;\n  struct stu *p1, p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)calloc(n, sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p1[i].a), &(p1[i].b), &(p1[i].c));\n    p1[i].d = p1[i].b + p1[i].c;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (p1[i].d < p1[j].d) {\n        p2 = p1[i];\n        p1[i] = p1[j];\n        p1[j] = p2;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", p1[i].a, p1[i].d);\n}\n"}
{"label": "14", "index": "25870", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int scorec;\n  int scorem;\n  int score;\n};\n\nint main() {\n  int n;\n  int i;\n  struct student stu[100001];\n  int best[2][3] = {{0, 0, 0}, {0, 0, 0}};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].scorec >> stu[i].scorem;\n    stu[i].score = stu[i].scorec + stu[i].scorem;\n  }\n  for (i = 1; i <= n; i++) {\n    if (stu[i].score > best[1][0]) {\n      best[0][2] = best[0][1];\n      best[0][1] = best[0][0];\n      best[0][0] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = best[1][0];\n      best[1][0] = stu[i].score;\n    } else if (stu[i].score <= best[1][0] && stu[i].score > best[1][1]) {\n      best[0][2] = best[0][1];\n      best[0][1] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = stu[i].score;\n    } else {\n      if (stu[i].score <= best[1][1] && stu[i].score > best[1][2]) {\n        best[0][2] = stu[i].num;\n        best[1][2] = stu[i].score;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << best[0][i] << ' ' << best[1][i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int maths;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student s, s1, s2, s3;\n  scanf(\"%d\", &n);\n  s2.total = s1.total = s3.total = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.chinese, &s.maths);\n    s.total = s.chinese + s.maths;\n    if (s.total > s1.total) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.total > s2.total) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.total > s3.total) {\n      s3 = s;\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.id, s1.total);\n  printf(\"%d %d\\n\", s2.id, s2.total);\n  printf(\"%d %d\\n\", s3.id, s3.total);\n}\n"}
{"label": "14", "index": "25872", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct Student {\n    int num;\n    int ch;\n    int math;\n  } stu[100000];\n  int n, i, x = 0, m = 0, k = 0, j, a[100000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n - 1; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    a[i] = stu[i].ch + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > m) {\n        m = a[i];\n        x = stu[i].num;\n        k = i;\n      }\n    }\n    printf(\"%d %d\\n\", x, m);\n    a[k] = 0;\n    m = 0;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25873", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct grade {\n  int num;\n  int chinese;\n  int math;\n  int all;\n} stu[100000];\nint main() {\n  int n, i, e, f, g, a, b, c;\n  e = 0;\n  f = 0;\n  g = 0;\n  a = 0;\n  b = 0;\n  c = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all > e) {\n      e = stu[i].all;\n      a = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= e && stu[i].all > f && i != a) {\n      f = stu[i].all;\n      b = i;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    if (stu[i].all <= f && stu[i].all > g && i != a && i != b) {\n      g = stu[i].all;\n      c = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a].num, stu[a].all);\n  printf(\"%d %d\\n\", stu[b].num, stu[b].all);\n  printf(\"%d %d\\n\", stu[c].num, stu[c].all);\n  return 0;\n}\n"}
{"label": "14", "index": "25874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int math;\n} temp, stu[100050];\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].math);\n    stu[i].math = stu[i].yuwen + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].math > stu[k].math)\n        k = j;\n    temp = stu[k];\n    stu[k] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].math);\n}\n"}
{"label": "14", "index": "25875", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int ID;\n    int ch, math;\n    int sum;\n  } a[100000];\n  int n, m1, m2, m3, x, y, z;\n  scanf(\"%d\", &n);\n  cin >> a[0].ID >> a[0].ch >> a[0].math;\n  m1 = a[0].ch + a[0].math;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].ch, &a[i].math);\n    a[i].sum = a[i].ch + a[i].math;\n    if (a[i].sum > m1) {\n      m1 = a[i].sum;\n      x = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[x].ID, m1);\n  a[x].ch = a[x].math = a[x].sum = 0;\n  int j;\n  cin >> a[0].ID >> a[0].ch >> a[0].math;\n  m2 = a[0].sum;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %d %d\", &a[j].ID, &a[j].ch, &a[j].math);\n    a[j].sum = a[j].ch + a[j].math;\n    if (a[j].sum > m2) {\n      m2 = a[j].sum;\n      y = j;\n    }\n  }\n  printf(\"%d %d\\n\", a[y].ID, m2);\n  a[y].ch = a[y].math = a[y].sum = 0;\n  int k;\n  cin >> a[0].ID >> a[0].ch >> a[0].math;\n  m3 = a[0].sum;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d %d\", &a[k].ID, &a[k].ch, &a[k].math);\n    a[k].sum = a[k].ch + a[k].math;\n    if (a[k].sum > m3) {\n      m3 = a[k].sum;\n      z = k;\n    }\n  }\n  printf(\"%d %d\\n\", a[z].ID, m3);\n  return 0;\n}\n"}
{"label": "14", "index": "25876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    char NUM[100000];\n    int Ma;\n    int Ch;\n  } stu;\n  int n, i, x, max1, max2, max3, m1, m2, m3;\n  max1 = max2 = max3 = 0;\n  m1 = m2 = m3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu.NUM >> (stu.Ma) >> (stu.Ch);\n    x = stu.Ma + stu.Ch;\n    if (x > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = x;\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n    } else if (x == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = max1;\n      m3 = m2;\n      m2 = i;\n    } else if (x < max1 && x > max2) {\n      max3 = max2;\n      max2 = x;\n      m3 = m2;\n    }\n\n    else if (x == max2) {\n      max3 = max2;\n      m3 = i;\n    } else if (x < max2 && x > max3) {\n      max3 = x;\n      m3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", m1, max1);\n  cout << m2 << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\\n\", m3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct stu {\n    int id;\n    int x, y;\n\n  } stu[100000];\n  int no1 = 0;\n  int no2 = 0;\n  int no3 = 0;\n  int i;\n  int N1, N2, N3;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].x, &stu[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    if ((stu[i].x + stu[i].y) > no1) {\n      no2 = no1;\n      no1 = (stu[i].x + stu[i].y);\n      N2 = N1;\n      N1 = i;\n    } else if ((stu[i].x + stu[i].y) > no2) {\n      no3 = no2;\n      no2 = (stu[i].x + stu[i].y);\n      N3 = N2;\n      N2 = i;\n    } else if ((stu[i].x + stu[i].y) > no3) {\n      no3 = (stu[i].x + stu[i].y);\n      N3 = i;\n    }\n  }\n  cout << stu[N1].id << \" \" << (stu[N1].x + stu[N1].y) << \"\\n\"\n       << stu[N2].id << \" \" << (stu[N2].x + stu[N2].y) << \"\\n\"\n       << stu[N3].id << \" \" << (stu[N3].x + stu[N3].y);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, e = 0, max, y;\n  scanf(\"%d\", &n);\n  struct st {\n    int a;\n    int z;\n    int c;\n    int d;\n  } b[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].a, &b[i].z, &b[i].c);\n    b[i].d = b[i].z + b[i].c;\n  }\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; j < n; j++) {\n      if (b[j].d > max) {\n        max = b[j].d;\n        y = j;\n      }\n    }\n    cout << b[y].a << \" \" << b[y].d << \"\\n\";\n    e++;\n    b[y].d = 0;\n    if (e == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "25879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int b;\n    int c;\n    int d;\n    int h;\n  } s[100000];\n  int i, j, k, n, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    s[i].d = s[i].b + s[i].c;\n    s[i].h = -1;\n  }\n  for (i = 1; i <= 3; i++) {\n    max = 0;\n    k = 0;\n    for (j = 1; j <= n; j++) {\n      if ((s[j].d > max) && (s[j].h == -1)) {\n        max = s[j].d;\n        k = j;\n      }\n    }\n    s[k].h = 1;\n    cout << s[k].a << \" \" << s[k].d << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "25880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int mark1;\n    int mark2;\n    int total;\n  } student[100000], temp;\n  int n, k, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d%d%d\", &student[k].ID, &student[k].mark1, &student[k].mark2);\n    student[k].total = student[k].mark1 + student[k].mark2;\n  }\n  for (m = 0; m < 3; m++) {\n    for (k = n - 1; k >= m; k--) {\n      if (student[k].total > student[k - 1].total) {\n        temp = student[k - 1];\n        student[k - 1] = student[k];\n        student[k] = temp;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student[0].ID, student[0].total,\n         student[1].ID, student[1].total, student[2].ID, student[2].total);\n}\n"}
{"label": "14", "index": "25881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int n;\n    int a;\n    int b;\n  } n[100000];\n  int m, i, sum[100000], first, second, third, d, e, f;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &n[i].n);\n    scanf(\"%d\", &n[i].a);\n    scanf(\"%d\", &n[i].b);\n    sum[i] = n[i].a + n[i].b;\n  }\n  if (sum[0] > sum[1] && sum[0] > sum[2] && sum[1] > sum[2]) {\n    first = sum[0];\n    second = sum[1];\n    third = sum[2];\n    d = 1;\n    e = 2;\n    f = 3;\n  } else if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] > sum[2]) {\n    first = sum[0];\n    second = sum[2];\n    third = sum[1];\n    d = 1;\n    e = 3;\n    f = 2;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] > sum[2]) {\n    first = sum[1];\n    second = sum[0];\n    third = sum[2];\n    d = 2;\n    e = 1;\n    f = 3;\n  } else if (sum[0] < sum[1] && sum[1] > sum[2] && sum[0] < sum[2]) {\n    first = sum[1];\n    second = sum[2];\n    third = sum[0];\n    d = 2;\n    e = 3;\n    f = 1;\n  } else if (sum[0] < sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n    first = sum[2];\n    second = sum[1];\n    third = sum[0];\n    d = 3;\n    e = 2;\n    f = 1;\n  } else {\n    if (sum[0] > sum[1] && sum[1] < sum[2] && sum[0] < sum[2]) {\n      first = sum[2];\n      second = sum[0];\n      third = sum[1];\n      d = 3;\n      e = 1;\n      f = 2;\n    }\n  }\n  for (i = 3; i < m; i++) {\n    if (sum[i] > first) {\n      third = second;\n      second = first;\n      first = sum[i];\n      f = e;\n      e = d;\n      d = i + 1;\n    } else if (sum[i] <= first && sum[i] > second) {\n      third = second;\n      second = sum[i];\n      f = e;\n      e = i + 1;\n    } else if (sum[i] <= second && sum[i] > third) {\n      third = sum[i];\n      f = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", d, first);\n  cout << e << \" \" << second << \"\\n\";\n  cout << f << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25882", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i, j;\n  struct student stu[100000];\n  struct student stud;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].sum < stu[j].sum) {\n        stud = stu[i];\n        stu[i] = stu[j];\n        stu[j] = stud;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n}\n"}
{"label": "14", "index": "25883", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int Num;\n  int scoreC;\n  int scoreM;\n  int all;\n};\nstruct stu stu[100005];\nvoid fsort(int first, int last) {\n  int chosen1, chosen2, p, q;\n  if (first >= last)\n    return;\n\n  chosen1 = stu[first].all;\n  chosen2 = stu[first].Num;\n  p = first;\n  q = last;\n  while (p < q) {\n    while ((p < q) && (stu[q].all >= chosen1)) {\n      q--;\n    }\n    if (p < q) {\n      stu[p].all = stu[q].all;\n      stu[p].Num = stu[q].Num;\n      p++;\n    }\n    while ((p < q) && (stu[p].all < chosen1)) {\n      p++;\n    }\n    if (p < q) {\n      stu[q].all = stu[p].all;\n      stu[q].Num = stu[p].Num;\n      q--;\n    }\n  }\n  stu[p].all = chosen1;\n  stu[p].Num = chosen2;\n  fsort(first, p - 1);\n  fsort(p + 1, last);\n}\nint main() {\n  int m, i;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> stu[i].Num >> stu[i].scoreC >> stu[i].scoreM;\n    stu[i].all = stu[i].scoreC + stu[i].scoreM;\n  }\n  fsort(1, m);\n  cout << stu[m].Num << \" \" << stu[m].all << endl;\n  cout << stu[m - 1].Num << \" \" << stu[m - 1].all << endl;\n  cout << stu[m - 2].Num << \" \" << stu[m - 2].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25884", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n  struct student *next;\n};\nint m, max_1[3] = {0}, t[3] = {0};\nstruct student *head;\nstruct student *p1, *p2;\nstruct student *creat(int n) {\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n  p1->sum = p1->chinese + p1->maths;\n  head = NULL;\n  while (m < n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->chinese >> p1->maths;\n    p1->sum = p1->chinese + p1->maths;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  creat(n);\n\n  struct student *p1;\n  p1 = head;\n  do {\n    if (p1->sum > max_1[0]) {\n      max_1[0] = p1->sum;\n      t[0] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[0], max_1[0]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[1] && p1->num != t[0]) {\n      max_1[1] = p1->sum;\n      t[1] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[1], max_1[1]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[2] && p1->num != t[0] && p1->num != t[1]) {\n      max_1[2] = p1->sum;\n      t[2] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[2], max_1[2]);\n}\n"}
{"label": "14", "index": "25885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100001], t;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  float chi;\n  float mat;\n  float tot;\n  struct student *next;\n};\n\nstruct student *creat(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->tot >= p1->tot) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nstruct student *compare(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  int i;\n  p1 = head;\n  p0 = stud;\n  while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if ((p0->tot > p1->tot) || ((p0->tot = p1->tot) && (p1->next != NULL))) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n    p1 = head;\n    for (i = 0; i < 2; i++) {\n      p1 = p1->next;\n    }\n    p1->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int i;\n  p = head;\n  for (i = 0; i < 3; i++) {\n    cout << p->num << \" \" << p->tot << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  struct student *head;\n  struct student *stu;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = creat(head, stu);\n  }\n  for (i = 3; i < n; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = compare(head, stu);\n  }\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "25887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct stu {\n    int num;\n    int chin;\n    int math;\n    int sum;\n  } one[n + 1];\n\n  for (int i = 1; i <= n; i++) {\n    cin >> one[i].num >> one[i].chin >> one[i].math;\n    one[i].sum = one[i].chin + one[i].math;\n  } \n  int t = 0;\n  for (int i = 200; i >= 0; i--)\n    for (int j = 1; j <= n; j++) {\n      if (one[j].sum == i) {\n        cout << j << \" \" << one[j].sum << endl;\n        t = t + 1;\n      }\n      if (t == 3) {\n        i = -1;\n        break;\n      }\n    } \n  return 0;\n}\n"}
{"label": "14", "index": "25888", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, sum[100000] = {0}, h1 = 0, h2 = 0, h3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> student[i].id >> student[i].chinese >> student[i].math;\n  }\n  int first = 0;\n  int sec = 0;\n  int thi = 0;\n  for (j = 0; j < n; j++) {\n    if (first < student[j].chinese + student[j].math) {\n      thi = sec;\n      h3 = h2;\n      sec = first;\n      h2 = h1;\n      first = student[j].chinese + student[j].math;\n      h1 = student[j].id;\n    } else if ((first > student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec > student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    } else if ((first == student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else {\n      if ((sec == student[j].chinese + student[j].math) &&\n          (thi < student[j].chinese + student[j].math)) {\n        thi = student[j].chinese + student[j].math;\n        h3 = student[j].id;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, sec, h3, thi);\n}\n"}
{"label": "14", "index": "25889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  float chinese;\n  float math;\n  float sum;\n};\nint main() {\n  int n, i;\n  struct student *pt, *p, temp;\n  scanf(\"%d\", &n);\n  pt = (struct student *)malloc(n * 1000);\n  for (p = pt; p < pt + n; p++) {\n    scanf(\"%d%f%f\", &p->num, &p->chinese, &p->math);\n    p->sum = p->chinese + p->math;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (p = pt; p < pt + n - 1 - i; p++) {\n      if (p->sum >= (p + 1)->sum) {\n        temp = *p;\n        *p = *(p + 1);\n        *(p + 1) = temp;\n      }\n    }\n  }\n  for (p = pt + n - 1; p > pt + n - 4; p--)\n    printf(\"%d %g \", p->num, p->sum);\n}\n"}
{"label": "14", "index": "25890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int shuxue;\n  int yuwen;\n  int zongfen;\n};\n\nint main() {\n  int n, i, e, j;\n  scanf(\"%d\", &n);\n\n  struct student stu[100001];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].xuehao >> stu[i].shuxue >> stu[i].yuwen;\n    stu[i].zongfen = stu[i].shuxue + stu[i].yuwen;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        stu[100000] = stu[j + 1];\n        stu[j + 1] = stu[j];\n        stu[j] = stu[100000];\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    cout << stu[i].xuehao << \" \" << stu[i].zongfen << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25891", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n\n  int n, i, k, e, f;\n\n  cin >> n;\n\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].No >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (stu[i - 1].sum < stu[i].sum) {\n        e = stu[i - 1].sum;\n        stu[i - 1].sum = stu[i].sum;\n        stu[i].sum = e;\n        f = stu[i - 1].No;\n        stu[i - 1].No = stu[i].No;\n        stu[i].No = f;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].No, stu[i].sum);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct record {\n  int stuID;\n  short YuWen;\n  short math;\n  short total;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  if ((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) {\n    printf(\"Error: memory out! (1)\\n\");\n    exit(-1);\n  }\n  newLn->n = 0;\n  newLn->head = NULL;\n  newLn->tail = NULL;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNode;\n  if ((newNode = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\\n\");\n    exit(-1);\n  }\n  newNode->m_rec = *rec;\n  newNode->next = NULL;\n  if (ln->n == 0) {\n    ln->head = newNode;\n    ln->tail = newNode;\n  } else {\n    ln->tail->next = newNode;\n    ln->tail = newNode;\n  }\n  ln->n++;\n\n  return ln;\n}\n\nint myCompare(const struct record *rec1, const struct record *rec2) {\n  return rec2->total - rec1->total;\n}\n\nstruct YyxNode *Search(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *nd = ln->head;\n  while (nd != NULL && myCompare(&nd->m_rec, rec))\n    nd = nd->next;\n\n  return nd;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNode = ln->head;\n  struct YyxNode *nextNode;\n  while (delNode != NULL) {\n    nextNode = delNode->next;\n    free(delNode);\n    delNode = nextNode;\n  }\n  ln->n = 0;\n  ln->head = NULL;\n  ln->tail = NULL;\n\n  return ln;\n}\n\nint main() {\n  struct YyxLink *mainLn;\n  struct record stu;\n  int n;\n  int i;\n  struct record *max1, *max2, *max3;\n  struct YyxNode *temp;\n  mainLn = CreateNewLink();\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu.stuID, &stu.YuWen, &stu.math);\n    stu.total = stu.YuWen + stu.math;\n    AddNode(mainLn, &stu);\n  }\n\n  max1 = max2 = max3 = &mainLn->head->m_rec;\n  temp = mainLn->head;\n  while (temp != NULL) {\n    if (max1->total < temp->m_rec.total)\n      max1 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  if (max2 == max1) {\n    temp = mainLn->head->next;\n    max2 = &temp->m_rec;\n  }\n  while (temp != NULL) {\n    if (max2->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec)\n        max2 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  while (&temp->m_rec == max1 || &temp->m_rec == max2)\n    temp = temp->next;\n  max3 = &temp->m_rec;\n  while (temp != NULL) {\n    if (max3->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec && max2 != &temp->m_rec)\n        max3 = &temp->m_rec;\n    temp = temp->next;\n  }\n\n  printf(\"%d %d\\n\", max1->stuID, max1->total);\n  printf(\"%d %d\\n\", max2->stuID, max2->total);\n  printf(\"%d %d\\n\", max3->stuID, max3->total);\n\n  free(ClearLink(mainLn));\n\n  return 0;\n}\n"}
{"label": "14", "index": "25893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  int a;\n  int b;\n  int c;\n} st[100000], tp;\nint main() {\n  int n, i, ii, j, d, a, b, c;\n  char cc;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].b, &st[i].c);\n    st[i].b += st[i].c;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[j].b > st[i].b) {\n        tp = st[i];\n        st[i] = st[j];\n        st[j] = tp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", st[i].a, st[i].b);\n}\n"}
{"label": "14", "index": "25894", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct student {\n    int stuNo;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n  struct tri {\n    int stuNo;\n    int zongfen;\n  } qian[3] = {0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuNo;\n    cin >> stu[i].yuwen;\n    cin >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > qian[0].zongfen) {\n      qian[2] = qian[1];\n      qian[1] = qian[0];\n      qian[0].stuNo = stu[i].stuNo;\n      qian[0].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[1].zongfen) {\n      qian[2] = qian[1];\n      qian[1].stuNo = stu[i].stuNo;\n      qian[1].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[2].zongfen) {\n      qian[2].stuNo = stu[i].stuNo;\n      qian[2].zongfen = stu[i].zongfen;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", qian[i].stuNo, qian[i].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "25895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int sum;\n  int c;\n};\nint main() {\n  int n, i, j, nt, ct;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].sum = stu[i].a + stu[i].b;\n    stu[i].c = stu[i].sum;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        nt = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = nt;\n        ct = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = ct;\n      }\n    }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].c);\n}\n"}
{"label": "14", "index": "25896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int maths;\n} stu[100000];\n\nint main() {\n  int i, j, n, sum[100000], max = 0, m;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].maths;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        m = i;\n      }\n    }\n    cout << stu[m].num << \" \" << sum[m] << \"\\n\";\n    sum[m] = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yuwen;\n    int math;\n    int zong;\n  };\n  struct student stu[100000];\n  struct student *p, *p1, *p2, *p3, *p4;\n  int n;\n  scanf(\"%d\", &n);\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d\", &p->num);\n    scanf(\"%d\", &p->yuwen);\n    scanf(\"%d\", &p->math);\n  }\n  for (p = stu; p < stu + n; p++) {\n    (p->zong) = (p->yuwen) + (p->math);\n  }\n  p1 = &stu[0];\n  p2 = &stu[1];\n  p3 = &stu[2];\n  p4 = p1;\n  if (p2->zong > p1->zong) {\n    p4 = p1;\n    p1 = p2;\n    p2 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p1->zong) {\n    p4 = p1;\n    p1 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p2->zong) {\n    p4 = p2;\n    p2 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n\n  for (p = stu + 3; p < stu + n; p++) {\n    if ((p->zong) > (p1->zong)) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->zong > p2->zong) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->zong > p3->zong) {\n      p3 = p;\n    } else\n      p1 = p1;\n  }\n  printf(\"%d %d\\n\", p1->num, p1->zong);\n  printf(\"%d %d\\n\", p2->num, p2->zong);\n  printf(\"%d %d\", p3->num, p3->zong);\n  return 0;\n}\n"}
{"label": "14", "index": "25898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct student stu[4] = {0, 0, 0, 0};\n  struct student temp[4] = {0, 0, 0, 0};\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[3].num >> stu[3].chinese >> stu[3].maths;\n    stu[3].sum = stu[3].chinese + stu[3].maths;\n\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum) {\n      stu[2] = stu[3];\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "25899", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, j, k, z, x;\n  cin >> n;\n  struct Student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (j = 0; j < 3; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (stu[k].zongfen > stu[k + 1].zongfen) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else if (stu[k].zongfen == stu[k + 1].zongfen &&\n                 stu[k].num < stu[k + 1].num) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else\n        ;\n    }\n  }\n  for (j = 0; j < 3; j++) {\n    printf(\"%d %d\\n\", stu[n - 1 - j].num, stu[n - 1 - j].zongfen);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student max[3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[1].total) {\n      max[1] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[2].total && stu[i].total <= max[1].total &&\n        stu[i].id != max[1].id) {\n      max[2] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[3].total && stu[i].total <= max[2].total &&\n        stu[i].id != max[2].id && stu[i].id != max[1].id) {\n      max[3] = stu[i];\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    cout << max[i].id << \" \" << max[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25901", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int StudentNumber;\n    int ChineseGrades;\n    int MathGrades;\n    int Total;\n  };\n  struct student Stu[100000], sTemp;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> Stu[i].StudentNumber >> Stu[i].ChineseGrades >> Stu[i].MathGrades;\n    Stu[i].Total = Stu[i].ChineseGrades + Stu[i].MathGrades;\n  }\n  for (i = 0; i <= 2; i++) {\n    for (j = n - 1; j >= i + 1; j--) {\n      if (Stu[j].Total > Stu[j - 1].Total) {\n        sTemp = Stu[j];\n        Stu[j] = Stu[j - 1];\n        Stu[j - 1] = sTemp;\n      }\n    }\n  }\n  cout << Stu[0].StudentNumber << \" \" << Stu[0].Total;\n  for (i = 1; i <= 2; i++) {\n    cout << endl;\n    cout << Stu[i].StudentNumber << \" \" << Stu[i].Total;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } m[4], t;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 3; i++)\n    m[i].sum = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &t.num, &t.chinese, &t.math);\n    t.sum = t.chinese + t.math;\n    if (t.sum > m[1].sum) {\n      m[3] = m[2];\n      m[2] = m[1];\n      m[1] = t;\n    } else if (t.sum > m[2].sum) {\n      m[3] = m[2];\n      m[2] = t;\n    } else if (t.sum > m[3].sum)\n      m[3] = t;\n  }\n  for (i = 1; i <= 3; i++)\n    cout << m[i].num << \" \" << m[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25903", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char number[20];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n} stu[100000], *s1, *s2, *s3;\n\nint n, max1 = 0, max2 = 0, max3 = 0;\n\nstruct student *creat(void) {\n  int i;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", &p1->number, &p1->chinese, &p1->math);\n    p2 = p1;\n    p1->sum = p1->chinese + p1->math;\n    if (p1->sum > max1) {\n      max3 = max2;\n      s3 = s2;\n      max2 = max1;\n      s2 = s1;\n      max1 = p1->sum;\n      s1 = p1;\n    } else if (p1->sum > max2) {\n      max3 = max2;\n      s3 = s2;\n      max2 = p1->sum;\n      s2 = p1;\n    } else if (p1->sum > max3) {\n      max3 = p1->sum;\n      s3 = p1;\n    }\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p1 = (struct student *)malloc(1000);\n  }\n  p1 = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *p;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%s %d \", s1->number, s1->sum);\n  printf(\"%s %d \", s2->number, s2->sum);\n  printf(\"%s %d\", s3->number, s3->sum);\n}\n"}
{"label": "14", "index": "25904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int id, chinese, math, total;\n\n  int n, i, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &id, &chinese, &math);\n    total = chinese + math;\n    if (total > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = total;\n      x = id;\n\n    } else if (total <= a && total > b) {\n      c = b;\n      z = y;\n      b = total;\n      y = id;\n    } else if (total <= b && total > c) {\n      c = total;\n      z = id;\n    }\n  }\n\n  cout << x << \" \" << a << \"\\n\";\n  cout << y << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", z, c);\n  return 0;\n}\n"}
{"label": "14", "index": "25905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int score1;\n  int score2;\n  struct stu *next;\n};\nstruct stu *creat(void) {\n  int n, i = 1;\n  struct stu *head;\n  struct stu *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  head = NULL;\n  while (i <= n) {\n    cin >> p1->num >> p1->score1 >> p1->score2;\n    if (i == 1)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != n)\n      p1 = p2->next = (struct stu *)malloc(1000);\n    else\n      p1->next = NULL;\n    i++;\n  }\n  return (head);\n}\nvoid turn(struct stu *head) {\n  int t = 1, r = 1, a;\n  struct stu *q1, *q2, *p3, *p1, *p2;\n  for (q1 = p3 = p2 = head; q1->next != NULL, t <= 3; t++) {\n    a = 0;\n    for (q2 = p1 = q1->next, r = 1; q2 != NULL; q2 = q2->next, r++) {\n\n      if ((q1->score1 + q1->score2) < (q2->score1 + q2->score2)) {\n        q1 = q2;\n        p2 = p1;\n        a = 1;\n      }\n      if (r != 1)\n        p1 = p1->next;\n    }\n    cout << q1->num << \" \" << q1->score1 + q1->score2 << \" \";\n    if (a == 1) {\n      p2->next = q1->next;\n      q1 = head;\n    } else {\n      q1 = p3->next;\n      p3 = q1;\n    }\n  }\n}\nint main() {\n  struct stu *ip;\n  ip = creat();\n  turn(ip);\n  return 0;\n}\n"}
{"label": "14", "index": "25906", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int scorechinese;\n    int scoremath;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].scorechinese, &a[i].scoremath);\n    a[i].sum = a[i].scorechinese + a[i].scoremath;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25907", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student s[3], p, temp;\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].yuwen, &s[i].shuxue);\n    s[i].zongfen = s[i].shuxue + s[i].yuwen;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < 2 - i; j++) {\n      if (s[j].zongfen < s[j + 1].zongfen)\n        temp = s[j], s[j] = s[j + 1], s[j + 1] = temp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &p.num, &p.yuwen, &p.shuxue);\n    p.zongfen = p.shuxue + p.yuwen;\n    if (p.zongfen > s[2].zongfen && p.zongfen <= s[1].zongfen)\n      s[2] = p;\n    else if (p.zongfen > s[1].zongfen && p.zongfen <= s[0].zongfen)\n      s[2] = s[1], s[1] = p;\n    else if (p.zongfen > s[0].zongfen)\n      s[2] = s[1], s[1] = s[0], s[0] = p;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].num, s[0].zongfen, s[1].num, s[1].zongfen,\n         s[2].num, s[2].zongfen);\n}\n"}
{"label": "14", "index": "25908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } stu1, stu2, stu3, temp;\n  int i, n;\n  stu1.total = 0;\n  stu2.total = 0;\n  stu3.total = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.total = temp.chinese + temp.math;\n    if (temp.total > stu1.total) {\n      stu3 = stu2;\n      stu2 = stu1;\n      stu1 = temp;\n    } else if (temp.total <= stu1.total && temp.total > stu2.total) {\n      stu3 = stu2;\n      stu2 = temp;\n    } else if (temp.total <= stu2.total && temp.total > stu3.total)\n      stu3 = temp;\n  }\n  printf(\"%d %d\\n\", stu1.ID, stu1.total);\n  printf(\"%d %d\\n\", stu2.ID, stu2.total);\n  printf(\"%d %d\\n\", stu3.ID, stu3.total);\n  return 0;\n}\n"}
{"label": "14", "index": "25909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m1, m2, m3, n1, n2, n3;\n  struct student {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct student stu[100000];\n  struct student *p;\n  p = stu;\n\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &(p + i)->num, &(p + i)->verbal, &(p + i)->math);\n  for (i = 0; i < n; i++)\n    (p + i)->sum = (p + i)->verbal + (p + i)->math;\n  m1 = p->sum;\n  n1 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m1) {\n      m1 = (p + i)->sum;\n      n1 = i;\n    }\n  printf(\"%d %d\\n\", (p + n1)->num, (p + n1)->sum);\n  m2 = p->sum;\n  n2 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m2 && i != n1) {\n      m2 = (p + i)->sum;\n      n2 = i;\n    }\n  printf(\"%d %d\\n\", (p + n2)->num, (p + n2)->sum);\n\n  m3 = p->sum;\n  n3 = 0;\n  for (i = 0; i < n; i++)\n    if ((((p + i)->sum) > m3) && i != n1 && i != n2) {\n      m3 = (p + i)->sum;\n      n3 = i;\n    }\n  printf(\"%d %d\\n\", (p + n3)->num, (p + n3)->sum);\n}\n"}
{"label": "14", "index": "25910", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n};\n\nint main() {\n  int n, i, e = 0, f = 0, g = 0, a = 0, b = 0, c = 0;\n  cin >> n;\n  struct student *stu = (struct student *)malloc(sizeof(int) * 3 * n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    sz[i] = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > sz[a]) {\n      a = i;\n      e = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", e, sz[a]);\n  for (i = 0; i < n; i++) {\n    if (i == a) {\n      continue;\n    }\n    if (sz[i] > sz[b]) {\n      b = i;\n      f = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", f, sz[b]);\n  for (i = 0; i < n; i++) {\n    if (i == a || i == b) {\n      continue;\n    }\n    if (sz[i] > sz[c]) {\n      c = i;\n      g = stu[i].num;\n    }\n  }\n  printf(\"%d %d\", g, sz[c]);\n  free(sz);\n  return 0;\n}\n"}
{"label": "14", "index": "25911", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} stu[100000];\n\nvoid bubble(struct student stu[], int n) {\n  int pass, i;\n  struct student temp;\n\n  for (pass = n - 1; pass >= n - 3; pass--)\n    for (i = pass; i > 0; i--)\n      if (stu[i].chinese + stu[i].math > stu[i - 1].chinese + stu[i - 1].math) {\n        temp = stu[i];\n        stu[i] = stu[i - 1];\n        stu[i - 1] = temp;\n      }\n}\n\nint main() {\n  struct student *p;\n  int i;\n  int n;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n  bubble(stu, n);\n  for (p = stu; p < stu + 3; p++)\n    printf(\"%d %d%c\", p->id, p->chinese + p->math,\n           (p == stu + n - 1) ? '\\0' : '\\n');\n  return 0;\n}\n"}
{"label": "14", "index": "25912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].m, &a[i].x, &a[i].y);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i].m, (a[i].x + a[i].y));\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chn;\n  int mth;\n  int sum;\n};\nstruct Scr {\n  int num;\n  int sum;\n};\n\nint main() {\n  struct Student stu[100000];\n  struct Scr scr[3];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chn, &stu[i].mth);\n    stu[i].sum = stu[i].chn + stu[i].mth;\n  }\n  scr[0].num = stu[0].num;\n  scr[0].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > scr[0].sum) {\n      scr[0].num = stu[i].num;\n      scr[0].sum = stu[i].sum;\n    }\n  }\n  scr[1].num = stu[0].num;\n  scr[1].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i != scr[0].num - 1) {\n      if (stu[i].sum > scr[1].sum) {\n        scr[1].num = stu[i].num;\n        scr[1].sum = stu[i].sum;\n      }\n    }\n  }\n  scr[2].num = stu[0].num;\n  scr[2].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i == scr[0].num - 1 || i == scr[1].num - 1)\n      continue;\n    else {\n      if (stu[i].sum > scr[2].sum) {\n        scr[2].num = stu[i].num;\n        scr[2].sum = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", scr[i].num, scr[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score_1;\n    int score_2;\n    int sum;\n  };\n  struct student stu[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score_1, &stu[i].score_2);\n    stu[i].sum = stu[i].score_1 + stu[i].score_2;\n  }\n  for (j = 0; j <= 2; j++) {\n    for (i = n - 1; i > 0 + j; i--)\n      if (stu[i].sum > stu[i - 1].sum) {\n        t = stu[i].sum, stu[i].sum = stu[i - 1].sum, stu[i - 1].sum = t;\n        t = stu[i].num, stu[i].num = stu[i - 1].num, stu[i - 1].num = t;\n      }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "25915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  long n, i;\n  int high[4] = {0};\n  long higher[4];\n  struct student {\n    long num;\n    int yuwen;\n    int shuxue;\n    int total;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].total > high[1]) {\n      high[1] = stu[i].total;\n      higher[1] = i;\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[1] && stu[i].total > high[2] && i != higher[1]) {\n      high[2] = stu[i].total;\n      higher[2] = i;\n    }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[2] && stu[i].total > high[3] && i != higher[1] &&\n        i != higher[2]) {\n      high[3] = stu[i].total;\n      higher[3] = i;\n    }\n\n  for (i = 1; i < 4; i++)\n    printf(\"%ld %d\\n\", higher[i], high[i]);\n}\n"}
{"label": "14", "index": "25916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100000], b[100000], c[100000], sum[100000], i, t1, t2, t3, s1, s2,\n      s3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &c[i]);\n    sum[i] = b[i] + c[i];\n  }\n  for (i = 0, t1 = 0, s1 = a[0]; i < n; i++) {\n    if (sum[i] > t1) {\n      t1 = sum[i];\n      s1 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1, t1);\n  for (i = 0, t2 = 0, s2 = a[0]; i < n; i++) {\n    if (a[i] == s1)\n      continue;\n    if (sum[i] > t2) {\n      t2 = sum[i];\n      s2 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s2, t2);\n  for (i = 0, t3 = 0, s3 = a[0]; i < n; i++) {\n    if (a[i] == s1 || a[i] == s2)\n      continue;\n    if (sum[i] > t3) {\n      t3 = sum[i];\n      s3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", s3, t3);\n  return 0;\n}\n"}
{"label": "14", "index": "25917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int verbal;\n  int math;\n  int sum;\n};\n\nint main() {\n  struct stu *a, t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  a = (struct stu *)malloc(n * sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].id, &a[i].verbal, &a[i].math);\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n; i > j; i--)\n      if (a[i].sum > a[i - 1].sum) {\n        t = a[i];\n        a[i] = a[i - 1];\n        a[i - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].id, a[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu *create();\nint compare(const void *a, const void *b);\nint main() {\n  int i, j = 0, n;\n  cin >> n;\n  struct stu {\n    int num;\n    int chi;\n    int math;\n    int total;\n  };\n  struct stu *p = (struct stu *)calloc(n, sizeof(struct stu));\n  struct stu *a = p;\n  int *tot = (int *)calloc(n, sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p->num, &p->chi, &p->math);\n    *(tot + i) = p->total = p->chi + p->math;\n    p++;\n  }\n  qsort(tot, n, sizeof(int), compare);\n  for (i = 0; i < 3; i++, j = 0) {\n    while ((a + (j++))->total != *(tot + i))\n      ;\n    cout << (a + j - 1)->num << \" \" << (a + j - 1)->total << \"\\n\";\n    (a + j - 1)->total = -1;\n  }\n\n  return 0;\n}\n\nint compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }\n"}
{"label": "14", "index": "25919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100], b[100], c[100], d[100], n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  if (n == 10) {\n    printf(\"6 181 \");\n    printf(\"3 176 \");\n    printf(\"8 175 \");\n  } else {\n    printf(\"16533 198 \");\n    printf(\"60249 198 \");\n    printf(\"204 197 \");\n  }\n}\n"}
{"label": "14", "index": "25920", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long num, ch, ma, tot;\n\n  struct stu *next;\n};\n\nint main() {\n  int n, numt, cht, mat;\n  cin >> n;\n  struct stu *head, *now, *neww, *max;\n  int i;\n  for (i = 1; i <= n; i++) {\n    neww = (struct stu *)malloc(sizeof(struct stu));\n    neww->next = 0;\n    if (i == 1) {\n      head = neww;\n      now = neww;\n    } else {\n      now->next = neww;\n      now = neww;\n    }\n    scanf(\"%ld %ld %ld\", &now->num, &now->ch, &now->ma);\n    now->tot = now->ch + now->ma;\n  }\n  for (i = 1; i <= 3; i++) {\n    now = head;\n    max = now;\n    while (now->next != 0) {\n      if (max->tot < now->tot)\n        max = now;\n      now = now->next;\n    }\n    printf(\"%d %d\\n\", max->num, max->tot);\n    max->tot = -1;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum)\n        k = j;\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3 && i < n; i++)\n    cout << form[i].num << \" \" << form[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25922", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id, word, math, sum;\n} stu[100000];\nint main() {\n  int n, i = 1, maxi;\n  scanf(\"%d\", &n);\n  while (i <= n) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].word, &stu[i].math);\n    stu[i].sum = stu[i].word + stu[i].math;\n    i = i + 1;\n  }\n  i = n;\n  stu[n + 1].sum = 0;\n  stu[n + 2].sum = 0;\n  stu[n + 3].sum = 0;\n  stu[n + 1].id = 0;\n  stu[n + 2].id = 0;\n  stu[n + 3].id = 0;\n  stu[n + 1].math = 0;\n  stu[n + 2].math = 0;\n  stu[n + 3].math = 0;\n  stu[n + 1].word = 0;\n  stu[n + 2].word = 0;\n  stu[n + 3].word = 0;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 1].sum) {\n      stu[n + 1] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 1].id, stu[n + 1].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 2].sum) {\n      stu[n + 2] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 2].id, stu[n + 2].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 3].sum) {\n      stu[n + 3] = stu[i];\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 3].id, stu[n + 3].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  struct {\n    int No;\n    int Chinese;\n    int Math;\n    int Sum;\n  } student[100000], t;\n  int i, j;\n  for (i = 0; i < num; i++) {\n    cin >> student[i].No >> student[i].Chinese >> student[i].Math;\n    student[i].Sum = student[i].Math + student[i].Chinese;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < num - 1 - i; j++) {\n      if (student[j].Sum >= student[j + 1].Sum) {\n        t = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = t;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[num - i - 1].No, student[num - i - 1].Sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, max, m, c;\n  int a[100000];\n  struct student {\n    int num;\n    int math;\n    int b;\n  } stu1;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu1.num, &stu1.math, &stu1.b);\n    a[i] = stu1.math + stu1.b;\n  }\n\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%d %d\\n\", k + 1, a[k]);\n  a[k] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      m = i;\n    }\n  }\n  printf(\"%d %d\\n\", m + 1, a[m]);\n  a[m] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  cout << c + 1 << \" \" << a[c];\n}\n"}
{"label": "14", "index": "25925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct data {\n    int number;\n    int chinese;\n    int math;\n    int total;\n  } student[100000], temp;\n\n  long n, i, j;\n\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].number, &student[i].chinese,\n          &student[i].math);\n    student[i].total = student[i].chinese + student[i].math;\n  }\n\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (student[i].total < student[j].total) {\n        temp.number = student[i].number;\n        temp.chinese = student[i].chinese;\n        temp.math = student[i].math;\n        temp.total = student[i].total;\n\n        student[i].number = student[j].number;\n        student[i].chinese = student[j].chinese;\n        student[i].math = student[j].math;\n        student[i].total = student[j].total;\n\n        student[j].number = temp.number;\n        student[j].chinese = temp.chinese;\n        student[j].math = temp.math;\n        student[j].total = temp.total;\n      }\n\n  for (i = 0; i < 3; i++)\n    cout << student[i].number << \" \" << student[i].total << \"\\n\";\n}\n"}
{"label": "14", "index": "25926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n  p->sum = p->chi + p->math;\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      head->next = NULL;\n    } else if (i < 3) {\n      for (h = head, j = 0; j < i; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else if (j == i) {\n        g->next = p;\n        p->next = NULL;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n    p->sum = p->chi + p->math;\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = p->next)\n    printf(\"%s %d \", p->num, p->sum);\n}\nint main() {\n  struct stu *head;\n  cin >> n;\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "25927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000], e;\n  for (i = 0; i < n; i++)\n    cin >> a[i].num >> a[i].chinese >> a[i].math;\n\n  for (i = 0; i < n - 1; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", a[i].num, a[i].chinese + a[i].math);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25928", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int liter;\n  int math;\n  int total;\n};\nint main() {\n  int i, j, k, n;\n  struct student a[100000], n1, n2, n3;\n  cin >> n;\n  scanf(\"%d%d%d\", &a[0].num, &a[0].liter, &a[0].math);\n  a[0].total = a[0].liter + a[0].math;\n  n1 = n2 = n3 = a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].liter, &a[i].math);\n    a[i].total = a[i].liter + a[i].math;\n    if (a[i].total > n1.total) {\n      n3 = n2;\n      n2 = n1;\n      n1 = a[i];\n    } else if (a[i].total > n2.total) {\n      n3 = n2;\n      n2 = a[i];\n    } else {\n      if (a[i].total > n3.total)\n        n3 = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", n1.num, n1.total);\n  printf(\"%d %d\\n\", n2.num, n2.total);\n  printf(\"%d %d\", n3.num, n3.total);\n  return 0;\n}\n"}
{"label": "14", "index": "25929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long int id;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\nlong int n;\n\nint main() {\n  struct student *p0, *p1, *p2, *head, *p;\n  int i;\n  scanf(\"%ld\\n\", &n);\n  p0 = (struct student *)malloc(sizeof(struct student));\n  cin >> p0->id >> p0->yuwen >> p0->shuxue;\n  p0->total = p0->yuwen + p0->shuxue;\n  head = p0;\n  p1 = p0;\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p1 = p0;\n  } else {\n    head = p0;\n    p0->next = p1;\n  }\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p2 = p0;\n  } else if (p0->total > p1->total && p0->total <= head->total) {\n    head->next = p0;\n    p0->next = p1;\n    p2 = p1;\n    p1 = p0;\n  } else if (p0->total > head->total) {\n    p0->next = head;\n    p2 = p1;\n    p1 = head;\n    head = p0;\n  }\n  p2->next = NULL;\n  for (i = 3; i < n; i++) {\n    p0 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n    p0->total = p0->yuwen + p0->shuxue;\n    if (p0->total > p2->total) {\n      if (p0->total <= p1->total) {\n        p1->next = p0;\n        p0->next = NULL;\n        p2 = p0;\n      } else if (p0->total > p1->total && p0->total <= head->total) {\n        head->next = p0;\n        p0->next = p1;\n        p1->next = NULL;\n        p1 = p2;\n        p0 = p1;\n      } else if (p0->total > head->total) {\n        p0->next = head;\n        p1->next = NULL;\n        p2 = p1;\n        p1 = head;\n        head = p0;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < 3; i++) {\n    cout << p->id << \" \" << p->total << \"\\n\";\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25930", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int ID;\n    int math;\n    int chinese;\n    int sum;\n  };\n  int n, i, t, j;\n  scanf(\"%d\", &n);\n  struct student stu[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chinese;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n\n      if (stu[j].sum > stu[i].sum) {\n        t = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = t;\n        t = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = t;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].sum);\n}\n"}
{"label": "14", "index": "25931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, max, m, c;\n  int a[100000];\n  struct student {\n    int num;\n    int math;\n    int b;\n  } stu1;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu1.num, &stu1.math, &stu1.b);\n    a[i] = stu1.math + stu1.b;\n  }\n\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  cout << k + 1 << \" \" << a[k] << \"\\n\";\n  a[k] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      m = i;\n    }\n  }\n  printf(\"%d %d\\n\", m + 1, a[m]);\n  a[m] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%d %d\", c + 1, a[c]);\n}\n"}
{"label": "14", "index": "25932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int c;\n  int m;\n};\nstruct stu a[100000];\n\nint main(char *argv[]) {\n  int n, i, x, y, z, t, q, w, e;\n  int b[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i].ID);\n    scanf(\"%d \", &a[i].c);\n    scanf(\"%d\", &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n  if (b[0] > b[1] && b[1] > b[2]) {\n    x = b[0];\n    q = 1;\n    y = b[1];\n    w = 1 + 1;\n    z = b[2];\n    e = 2 + 1;\n  } else if (b[1] > b[0] && b[0] > b[2]) {\n    x = b[1];\n    y = b[0];\n    z = b[2];\n    q = 1 + 1;\n    w = 0 + 1;\n    e = 2 + 1;\n  } else if (b[2] > b[1] && b[1] > b[0]) {\n    x = b[2];\n    y = b[1];\n    z = b[0];\n    q = 2 + 1;\n    w = 1 + 1;\n    e = 0 + 1;\n  } else if (b[2] > b[0] && b[0] > b[1]) {\n    x = b[2];\n    y = b[0];\n    z = b[1];\n    q = 2 + 1;\n    w = 0 + 1;\n    e = 1 + 1;\n  } else if (b[1] > b[2] && b[2] > b[0]) {\n    x = b[1];\n    y = b[2];\n    z = b[0];\n    q = 1 + 1;\n    w = 2 + 1;\n    e = 0 + 1;\n  } else if (b[0] > b[2] && b[2] > b[1]) {\n    x = b[0];\n    y = b[2];\n    z = b[1];\n    q = 0 + 1;\n    w = 2 + 1;\n    e = 1 + 1;\n  }\n  for (i = 3; i < n; i++) {\n    if (b[i] > x) {\n      t = x;\n      x = b[i];\n      z = y;\n      y = t;\n      e = w;\n      w = q;\n      q = i + 1;\n    } else if (b[i] > y) {\n      z = y;\n      y = b[i];\n      e = w;\n      w = i + 1;\n    } else if (b[i] > z) {\n      z = b[i];\n      e = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", q, x);\n  printf(\"%d %d\\n\", w, y);\n  printf(\"%d %d\\n\", e, z);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25933", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct mark {\n  int num;\n  int ch;\n  int math;\n  int sum;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    stu[i].sum = stu[i].math + stu[i].ch;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (stu[i].sum >= stu[i + 1].sum) {\n      stu[100000] = stu[i];\n      stu[i] = stu[i + 1];\n      stu[i + 1] = stu[100000];\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].num, stu[n - 1].sum,\n         stu[n - 2].num, stu[n - 2].sum, stu[n - 3].num, stu[n - 3].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "25934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct s {\n    int id;\n    int ch;\n    int ma;\n  } s;\n  long int n;\n  int i = 0, j, zong, c = 0;\n  int a[3] = {0}, b[3] = {0};\n  int t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    a[i] = i + 1;\n    b[i] = s.ma + s.ch;\n  }\n  for (i = 0; i < 2; i++) {\n    if (b[i] > b[1 + i]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    zong = s.ch + s.ma;\n    for (j = 0; j < 3; j++) {\n      if (zong > b[j])\n        c++;\n    }\n    if (c == 1) {\n      a[0] = s.id;\n      b[0] = zong;\n    }\n    if (c == 2) {\n      a[0] = a[1];\n      b[0] = b[1];\n      a[1] = s.id;\n      b[1] = zong;\n    }\n    if (c == 3) {\n      a[0] = a[1];\n      a[1] = a[2];\n      a[2] = s.id;\n      b[0] = b[1];\n      b[1] = b[2];\n      b[2] = zong;\n    }\n    c = 0;\n  }\n  for (i = 2; i >= 0; i--) {\n    cout << a[i] << \" \" << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25935", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sum(struct student *head) {\n  struct student *p1;\n  p1 = head;\n  while (p1) {\n    p1->total = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n}\nstruct student *choose(struct student *head) {\n  struct student *p1, *p2;\n  p1 = head;\n  p2 = p1;\n  while (p1->next) {\n    if (p2->total < (p1->next)->total)\n      p2 = p1->next;\n    p1 = p1->next;\n  }\n  printf(\"%d %d \", p2->num, p2->total);\n  return (p2);\n}\nstruct student *del(struct student *head, struct student *p2) {\n  struct student *p1;\n  p1 = head;\n  if (p2 == head) {\n    head = p2->next;\n    return (head);\n  } else {\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n  } else if (n = 2) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n\n  } else {\n\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n  }\n}\n"}
{"label": "14", "index": "25936", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student max[3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[1].total) {\n      max[1] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[2].total && stu[i].total <= max[1].total &&\n        stu[i].id != max[1].id) {\n      max[2] = stu[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > max[3].total && stu[i].total <= max[2].total &&\n        stu[i].id != max[2].id && stu[i].id != max[1].id) {\n      max[3] = stu[i];\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", max[i].id, max[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int diyi, dier, disan;\n  diyi = 0;\n  dier = 0;\n  disan = 0;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[99999];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[diyi].sum) {\n      diyi = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi) {\n      dier = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi) {\n      if (stu[i].sum > stu[dier].sum) {\n        dier = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    while (i != diyi && i != dier) {\n      disan = i;\n      break;\n    }\n    break;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != diyi && i != dier) {\n      if (stu[i].sum > stu[disan].sum) {\n        disan = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", diyi + 1, stu[diyi].sum);\n  printf(\"%d %d\\n\", dier + 1, stu[dier].sum);\n  printf(\"%d %d\\n\", disan + 1, stu[disan].sum);\n}\n"}
{"label": "14", "index": "25938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n};\n\nint main() {\n  int n, i, e = 0, f = 0, g = 0, a = 0, b = 0, c = 0;\n  scanf(\"%d \", &n);\n  struct student *stu = (struct student *)malloc(sizeof(int) * 3 * n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    sz[i] = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > sz[a]) {\n      a = i;\n      e = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", e, sz[a]);\n  for (i = 0; i < n; i++) {\n    if (i == a) {\n      continue;\n    }\n    if (sz[i] > sz[b]) {\n      b = i;\n      f = stu[i].num;\n    }\n  }\n  cout << f << \" \" << sz[b] << \"\\n\";\n  for (i = 0; i < n; i++) {\n    if (i == a || i == b) {\n      continue;\n    }\n    if (sz[i] > sz[c]) {\n      c = i;\n      g = stu[i].num;\n    }\n  }\n  printf(\"%d %d\", g, sz[c]);\n  free(sz);\n  return 0;\n}\n"}
{"label": "14", "index": "25939", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100000], b[100000], d[100000], i, j, n, t, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &d[i]);\n    d[i] = b[i] + d[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (d[j] > d[j - 1]) {\n        t = d[j];\n        s = a[j];\n        d[j] = d[j - 1];\n        a[j] = a[j - 1];\n        d[j - 1] = t;\n        a[j - 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i], d[i]);\n}\n"}
{"label": "14", "index": "25940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  long n, i;\n  int high[4] = {0};\n  long higher[4];\n  struct student {\n    long num;\n    int yuwen;\n    int shuxue;\n    int total;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].total > high[1]) {\n      high[1] = stu[i].total;\n      higher[1] = i;\n    }\n  }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[1] && stu[i].total > high[2] && i != higher[1]) {\n      high[2] = stu[i].total;\n      higher[2] = i;\n    }\n  for (i = 1; i <= n; i++)\n    if (stu[i].total <= high[2] && stu[i].total > high[3] && i != higher[1] &&\n        i != higher[2]) {\n      high[3] = stu[i].total;\n      higher[3] = i;\n    }\n\n  for (i = 1; i < 4; i++)\n    printf(\"%d %d\\n\", higher[i], high[i]);\n}\n"}
{"label": "14", "index": "25941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    scanf(\"%d\", &a[i].chinese);\n    scanf(\"%d\", &a[i].maths);\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  cout << a[2].num << \" \" << a[2].chinese + a[2].maths << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, i, j, k, z, x;\n  scanf(\"%d\", &n);\n  struct Student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 0; j < 3; j++) {\n    for (k = 0; k < n - 1; k++) {\n      if (stu[k].zongfen > stu[k + 1].zongfen) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else if (stu[k].zongfen == stu[k + 1].zongfen &&\n                 stu[k].num < stu[k + 1].num) {\n        z = stu[k + 1].zongfen;\n        stu[k + 1].zongfen = stu[k].zongfen;\n        stu[k].zongfen = z;\n        x = stu[k + 1].num;\n        stu[k + 1].num = stu[k].num;\n        stu[k].num = x;\n      } else\n        ;\n    }\n  }\n\n  for (j = 0; j < 3; j++) {\n    printf(\"%d %d\\n\", stu[n - 1 - j].num, stu[n - 1 - j].zongfen);\n  }\n\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j, e1, e2;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        e1 = stu[i + 1].sum;\n        e2 = stu[i + 1].num;\n        stu[i + 1].sum = stu[i].sum;\n        stu[i + 1].num = stu[i].num;\n        stu[i].sum = e1;\n        stu[i].num = e2;\n      }\n    }\n  }\n\n  cout << stu[n - 1].num << \" \" << stu[n - 1].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  cout << stu[n - 3].num << \" \" << stu[n - 3].sum << \"\\n\";\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int num, i, j, sum[100000], t, m;\n  cin >> num;\n  for (i = 1; i <= num; i++) {\n    cin >> stu[i].ID >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = num; j > 1; j--) {\n      if (sum[j] > sum[j - 1]) {\n        t = sum[j - 1];\n        m = stu[j - 1].ID;\n        sum[j - 1] = sum[j];\n        stu[j - 1].ID = stu[j].ID;\n        sum[j] = t;\n        stu[j].ID = m;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++)\n    cout << stu[i].ID << ' ' << sum[i] << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "25945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int sum;\n} stu[100000];\n\nint main(int argc, char *argv[]) {\n  int i, n;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxid1 = 0, maxid2 = 0, maxid3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].sum = stu[i].math + stu[i].chinese;\n    if (stu[i].sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = maxid1;\n      maxid1 = stu[i].id;\n    } else {\n      if (stu[i].sum > max2) {\n        max3 = max2;\n        max2 = stu[i].sum;\n        maxid3 = maxid2;\n        maxid2 = stu[i].id;\n      } else if (stu[i].sum > max3) {\n        max3 = stu[i].sum;\n        maxid3 = stu[i].id;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxid1, max1, maxid2, max2, maxid3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "25946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  int ID;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i, *sum, max, p = 0;\n\n  struct score *s;\n  cin >> n;\n  s = (struct score *)malloc(sizeof(struct score) * n);\n  sum = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &s[i].ID, &s[i].chinese, &s[i].math);\n  for (i = 0; i < n; i++)\n    *(sum + i) = s[i].chinese + s[i].math;\n  max = sum[0];\n  for (i = 0; i < n; i++) {\n    if (max < *(sum + i)) {\n      max = *(sum + i);\n      p = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n  if (n > 1) {\n    max = *sum;\n    *(sum + p) = 0;\n    p = 0;\n    for (i = 0; i < n; i++) {\n      if (max < *(sum + i)) {\n        max = *(sum + i);\n        p = i;\n      }\n    }\n    printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    if (n > 2) {\n      max = *sum;\n      *(sum + p) = 0;\n      p = 0;\n      for (i = 0; i < n; i++) {\n        if (max < *(sum + i)) {\n          max = *(sum + i);\n          p = i;\n        }\n      }\n      cout << s[p].ID << \" \" << *(sum + p) << \"\\n\";\n    }\n  }\n}\n"}
{"label": "14", "index": "25947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n\n  for (i = 0; i < m - 1; i++)\n\n  {\n\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "25948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yw;\n  int sx;\n  int zf;\n} s1, s2, s3, s;\nint main() {\n\n  int n, i;\n  s1.zf = s2.zf = s3.zf = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.yw, &s.sx);\n    s.zf = s.yw + s.sx;\n    if (s.zf > s1.zf) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.zf > s2.zf) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.zf > s3.zf) {\n      s3 = s;\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.num, s1.zf);\n  cout << s2.num << \" \" << s2.zf << \"\\n\";\n  printf(\"%d %d\", s3.num, s3.zf);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int math;\n  int chinese;\n} stu[100000];\nint main() {\n  int n, i, j, s[100000], t[100000], c = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    s[i] = stu[i].math + stu[i].chinese;\n    t[i] = s[i];\n  }\n  int p;\n  for (i = 0; i <= 2; i++) {\n    for (j = 0; j <= (n - i - 2); j++) {\n      if (s[j] >= s[j + 1]) {\n        p = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = p;\n      }\n    }\n  }\n  int d[3];\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 1]) {\n      cout << stu[i].num << \" \" << t[i];\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 2]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 3]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chi;\n  int math;\n  int total;\n} person[100000], first[3] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};\nint main() {\n  long n;\n  int i, j;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> person[i].num >> person[i].chi >> person[i].math;\n    person[i].total = person[i].chi + person[i].math;\n    if (person[i].total > first[0].total) {\n      first[1] = first[0];\n      first[0] = person[i];\n    } else if (person[i].total > first[1].total) {\n      first[2] = first[1];\n      first[1] = person[i];\n    } else {\n      if (person[i].total > first[2].total) {\n        first[2] = person[i];\n      }\n    }\n  }\n  for (j = 0; j < 3; j++) {\n    printf(\"%ld %d\\n\", first[j].num, first[j].total);\n  }\n}\n"}
{"label": "14", "index": "25951", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, h, b;\n  cin >> n;\n  struct sb {\n    int ID;\n    int m;\n    int c;\n    int sum;\n  } a[n];\n  for (i = 0; i < n; i++) {\n    cin >> a[i].ID >> a[i].m >> a[i].c;\n    a[i].sum = a[i].m + a[i].c;\n  }\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25952", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  int Num;\n  int scoreC;\n  int scoreM;\n  int all;\n};\nstruct stu stu[100005];\nvoid fsort(int first, int last) {\n  int chosen1, chosen2, p, q;\n  if (first >= last) {\n    return;\n  }\n  chosen1 = stu[first].all;\n  chosen2 = stu[first].Num;\n  p = first;\n  q = last;\n  while (p < q) {\n    while ((p < q) && (stu[q].all >= chosen1)) {\n      q--;\n    }\n    if (p < q) {\n      stu[p].all = stu[q].all;\n      stu[p].Num = stu[q].Num;\n      p++;\n    }\n    while ((p < q) && (stu[p].all < chosen1)) {\n      p++;\n    }\n    if (p < q) {\n      stu[q].all = stu[p].all;\n      stu[q].Num = stu[p].Num;\n      q--;\n    }\n  }\n  stu[p].all = chosen1;\n  stu[p].Num = chosen2;\n  fsort(first, p - 1);\n  fsort(p + 1, last);\n}\nint main() {\n  int m, i;\n  cin >> m;\n  for (i = 1; i <= m; i++) {\n    cin >> stu[i].Num >> stu[i].scoreC >> stu[i].scoreM;\n    stu[i].all = stu[i].scoreC + stu[i].scoreM;\n  }\n  fsort(1, m);\n  cout << stu[m].Num << \" \" << stu[m].all << endl;\n  printf(\"%d %d\\n\", stu[m - 1].Num, stu[m - 1].all);\n  cout << stu[m - 2].Num << \" \" << stu[m - 2].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int maths;\n};\nstruct qiansan {\n  int num;\n  int zongfen;\n} st[3] = {{0, 0}, {0, 0}, {0, 0}};\nint main() {\n  int n, i, k, c[10], j[10];\n  int a[100001];\n  scanf(\"%d\", &n);\n  struct Student std[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &std[i].num, &std[i].chinese, &std[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = std[i].chinese + std[i].maths;\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = a[i];\n      st[0].num = std[i].num;\n    } else if (a[i] <= st[0].zongfen && a[i] > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = a[i];\n      st[1].num = std[i].num;\n    } else if (a[i] <= st[1].zongfen && a[i] > st[2].zongfen) {\n      st[2].zongfen = a[i];\n      st[2].num = std[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25954", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, y, t, m;\n  struct s {\n    int a;\n    int b;\n    int c;\n  } stu[100000];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].a, &stu[i].b, &stu[i].c);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((stu[j].b + stu[j].c) > (stu[i].b + stu[i].c)) {\n        y = stu[i].b;\n        t = stu[i].c;\n        m = stu[i].a;\n        stu[i].b = stu[j].b;\n        stu[j].b = y;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        stu[i].a = stu[j].a;\n        stu[j].a = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].a, (stu[i].b + stu[i].c));\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25955", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct Student {\n    int ID;\n    int Chinese;\n    int Math;\n    int sum;\n  } student[100000];\n  int i, j, n;\n  struct Student t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> student[i].ID >> student[i].Chinese >> student[i].Math;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].Chinese + student[i].Math <\n          student[j].Chinese + student[j].Math) {\n        t = student[i];\n        student[i] = student[j];\n        student[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].ID, student[i].Chinese + student[i].Math);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25956", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d \", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = max1.num;\n      max2.z = max1.z;\n      max1.num = a.num;\n      max1.z = a.z;\n    } else {\n      if (a.z > max2.z) {\n        max3.num = max2.num;\n        max3.z = max2.z;\n        max2.num = a.num;\n        max2.z = a.z;\n      } else if (a.z > max3.z) {\n        max3.num = a.num;\n        max3.z = a.z;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n}\n"}
{"label": "14", "index": "25957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  struct stu *next;\n};\n\nint main() {\n  int i = 0, n, a, b, score, first = 0, second = 0, third = 0;\n  struct stu *head, *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  head = p = (struct stu *)malloc(sizeof(struct stu));\n  while (i++ < n) {\n    scanf(\"%d %d %d\", &(*p).num, &a, &b);\n    score = a + b;\n    if (score > first) {\n      third = second;\n      second = first;\n      first = score;\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (score > second) {\n      third = second;\n      second = score;\n      p3 = p2;\n      p2 = p;\n    } else if (score > third) {\n      third = score;\n      p3 = p;\n    }\n    p = (*p).next = (struct stu *)malloc(sizeof(struct stu));\n  }\n  cout << (*p1).num << \" \" << first << \"\\n\"\n       << (*p2).num << \" \" << second << \"\\n\"\n       << (*p3).num << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25958", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, zf[100000];\n  struct student {\n    int name;\n    int yw;\n    int sx;\n\n  } stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].name, &stu[i].yw, &stu[i].sx);\n    zf[i] = stu[i].yw + stu[i].sx;\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (zf[i] >= zf[i + 1]) {\n        a = zf[i];\n        zf[i] = zf[i + 1];\n        zf[i + 1] = a;\n        a = stu[i].name;\n        stu[i].name = stu[i + 1].name;\n        stu[i + 1].name = a;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].name, zf[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].m, &a[i].x, &a[i].y);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i].m << \" \" << (a[i].x + a[i].y) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25960", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct st {\n    int id;\n    int yu;\n    int ma;\n  };\n  int n, i;\n  struct st st1 = {0, 0, 0}, st2 = {0, 0, 0}, st3 = {0, 0, 0}, stn;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stn.id, &stn.yu, &stn.ma);\n    if (stn.yu + stn.ma > st1.yu + st1.ma) {\n      st3 = st2;\n      st2 = st1;\n      st1 = stn;\n    } else {\n      if (stn.yu + stn.ma > st2.yu + st2.ma) {\n        st3 = st2;\n        st2 = stn;\n      } else {\n        if (stn.yu + stn.ma > st3.yu + st3.ma) {\n          st3 = stn;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", st1.id, st1.yu + st1.ma, st2.id,\n         st2.yu + st2.ma, st3.id, st3.yu + st3.ma);\n}\n"}
{"label": "14", "index": "25961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int Num;\n  int Chinese;\n  int Math;\n  int Sum;\n};\nint main() {\n  int n, i, s;\n  scanf(\"%d\", &n);\n  struct Student stu[n];\n  struct Student temp, *p = stu;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].Num, &stu[i].Chinese, &stu[i].Math);\n    stu[i].Sum = stu[i].Chinese + stu[i].Math;\n  }\n  if (n == 2) {\n    if (stu[0].Sum > stu[1].Sum)\n      temp = stu[0];\n    stu[0] = stu[1];\n    stu[1] = temp;\n    printf(\"%d %d %d\\n\", stu[0].Num, stu[0].Chinese, stu[0].Math);\n    printf(\"%d %d %d\\n\", stu[1].Num, stu[1].Chinese, stu[1].Math);\n  } else {\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n    for (i = 0, s = 0; i < n; i++)\n      if (stu[i].Sum > s)\n        s = stu[i].Sum;\n    for (i = 0; i < n; i++) {\n      if (stu[i].Sum == s) {\n        printf(\"%d %d\\n\", stu[i].Num, stu[i].Sum);\n        stu[i].Sum = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int n;\n  int y;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return (((struct student *)b)->y > ((struct student *)a)->y ? 1 : -1);\n}\n\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  struct student s[100000];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].y, &s[i].s);\n    s[i].y = s[i].y + s[i].s;\n  }\n  qsort(s, num, sizeof(s[0]), cmp);\n  for (int i = 0; i < 3; i++)\n    cout << s[i].n << \" \" << s[i].y << \" \";\n}\n"}
{"label": "14", "index": "25963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  float yuwen;\n  float shuxue;\n  float total;\n} stu[100000];\nint main() {\n  int i, n, j;\n  struct student *p;\n  p = &stu[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%f%f\", &(p + i)->num, &(p + i)->yuwen, &(p + i)->shuxue);\n    (p + i)->total = (p + i)->shuxue + (p + i)->yuwen;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((*(p + j)).total >= (*(p + j + 1)).total) {\n        struct student temp;\n        temp = *(p + j + 1);\n        *(p + j + 1) = *(p + j);\n        *(p + j) = temp;\n      }\n    }\n  if (n > 2)\n    for (i = 1; i < 4; i++)\n      printf(\"%d %g\\n\", (*(p + n - i)).num, (*(p + n - i)).total);\n  else if (n = 2)\n    cout << (*(p + 1)).num << \" \" << (*(p + 1)).total << \"\\n\"\n         << (*p).num << \" \" << (*p).total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25964", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, num, math, china, z, i;\n  int num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    cin >> math;\n    scanf(\"%d\", &china);\n    z = math + china;\n    if (z > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z;\n      m3 = i;\n\n    } else if (z > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z;\n      m2 = i;\n    } else if (z > num1) {\n      num1 = z;\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  printf(\"%ld %ld\\n\", m1, num1);\n  return 0;\n}\n"}
{"label": "14", "index": "25965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} a[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chinese, &a[i].math);\n    a[i].total = a[i].chinese + a[i].math;\n  }\n  int max, numm;\n  max = a[1].total;\n  for (int j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (max < a[i].total) {\n        max = a[i].total;\n        numm = i;\n      }\n    }\n    cout << numm + 1 << \" \" << max << \"\\n\";\n    a[numm].total = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  cout << stu[n - 2].num << \" \" << stu[n - 2].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "25967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nvoid fun(int *a, int *b);\nint main() {\n  int n, i, j;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  struct Student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (sum[j] > sum[j - 1]) {\n        fun(&sum[j], &sum[j - 1]);\n        fun(&stu[j - 1].num, &stu[j].num);\n        fun(&stu[j - 1].yuwen, &stu[j].yuwen);\n        fun(&stu[j - 1].shuxue, &stu[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, sum[i]);\n  return 0;\n}\nvoid fun(int *a, int *b) {\n  int k;\n  k = *a;\n  *a = *b;\n  *b = k;\n}\n"}
{"label": "14", "index": "25968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, ta, tb, ts, tnum;\n  int *a, *b, *s, *num;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &num[i], &a[i], &b[i]);\n    s[i] = a[i] + b[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n; i > 1; i--) {\n      if (s[i] > s[i - 1]) {\n        ta = a[i - 1];\n        tb = b[i - 1];\n        ts = s[i - 1];\n        tnum = num[i - 1];\n        a[i - 1] = a[i];\n        b[i - 1] = b[i];\n        s[i - 1] = s[i];\n        num[i - 1] = num[i];\n        a[i] = ta;\n        b[i] = tb;\n        s[i] = ts;\n        num[i] = tnum;\n      }\n    }\n  }\n  cout << num[1] << \" \" << s[1] << \"\\n\"\n       << num[2] << \" \" << s[2] << \"\\n\"\n       << num[3] << \" \" << s[3] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  char yw;\n  char sx;\n  int zf;\n  int pm;\n};\nint main() {\n  struct student a[100000], b[2];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i].id, &a[i].yw, &a[i].sx);\n  for (i = 0; i < n; i++)\n    a[i].zf = a[i].yw + a[i].sx;\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j) {\n      j = a[i].zf;\n      b[0] = a[i];\n    }\n  printf(\"%d %d\\n\", b[0].id, b[0].zf);\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i].zf > j && a[i].id != b[0].id) {\n      j = a[i].zf;\n      b[1] = a[i];\n    }\n  }\n  printf(\"%d %d\\n\", b[1].id, b[1].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id && a[i].id != b[1].id) {\n      j = a[i].zf;\n      b[2] = a[i];\n    }\n  printf(\"%d %d\\n\", b[2].id, b[2].zf);\n  return 0;\n}\n"}
{"label": "14", "index": "25970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int china;\n  int math;\n  int total;\n} stu[1000], temp;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].china, &stu[i].math);\n    stu[i].total = stu[i].china + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    temp = stu[i];\n    count = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > temp.total) {\n        temp = stu[j];\n        count = j;\n      }\n    }\n    stu[count] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].id << \" \" << stu[i].total << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct xue {\n  int ID;\n  int sx;\n  int yw;\n  int sum;\n} xueshen;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  struct xue *xuesheng;\n  xuesheng = (struct xue *)malloc(4 * sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> xuesheng[i].ID >> xuesheng[i].sx >> xuesheng[i].yw;\n    xuesheng[i].sum = xuesheng[i].sx + xuesheng[i].yw;\n  }\n  for (i = 1; i < 4; i++) {\n    for (k = 0; k < n - i; k++) {\n      if (xuesheng[k].sum >= xuesheng[k + 1].sum) {\n        xueshen = xuesheng[k + 1];\n        xuesheng[k + 1] = xuesheng[k];\n        xuesheng[k] = xueshen;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    cout << xuesheng[n - i].ID << \" \" << xuesheng[n - i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].m, &a[i].x, &a[i].y);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i].m, (a[i].x + a[i].y));\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "25973", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p0, *p1, *p2;\n  int i = 0;\n  head = (struct student *)malloc(1000);\n  head->next = NULL;\n  scanf(\"%ld %d %d\", &head->num, &head->scorec, &head->scorem);\n  while (i < 2) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n      if (head == p1)\n        head = p0;\n      else {\n        p2->next = p0;\n      }\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n    i++;\n  }\n  return (head);\n}\nstruct student *sort(struct student *head, int n) {\n  struct student *p0, *p1, *p2;\n  int i = 3;\n  while (i < n) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n\n      if (head == p1) {\n        p2 = p1->next;\n        (*p2->next).num = p2->num;\n        (*p2->next).scorec = p2->scorec;\n        (*p2->next).scorem = p2->scorem;\n        p2->num = p1->num;\n        p2->scorec = p1->scorec;\n        p2->scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else if (p1 == head->next) {\n        (*p1->next).num = p1->num;\n        (*p1->next).scorec = p1->scorec;\n        (*p1->next).scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else {\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      }\n    }\n    free(p0);\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat();\n  head = sort(head, n);\n  p1 = head->next;\n  p2 = p1->next;\n  printf(\"%ld %d \", head->num, (head->scorec + head->scorem));\n  printf(\"%ld %d \", p1->num, (p1->scorec + p1->scorem));\n  printf(\"%ld %d\", p2->num, (p2->scorec + p2->scorem));\n}\n"}
{"label": "14", "index": "25974", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nlong n;\n\nint main() {\n  struct student *creat();\n  struct student *head, *p, *q1, *q2, *q3;\n  int a;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a) {\n      a = p->sum;\n      q1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1) {\n      a = p->sum;\n      q2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1 && p != q2) {\n      a = p->sum;\n      q3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", q1->num, q1->sum);\n  printf(\"%d %d \", q2->num, q2->sum);\n  printf(\"%d %d \", q3->num, q3->sum);\n}\n\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  int i;\n  head = NULL;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%ld%d%d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    if (i == 0) {\n      head = p1;\n    } else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n"}
{"label": "14", "index": "25975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int he;\n  struct student *next;\n};\n\nstruct student *create(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n\n  p1 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->yu >> p1->shu;\n  p1->he = p1->yu + p1->shu;\n  p1->next = NULL;\n\n  head = p1;\n  p2 = p1;\n  for (i = 1; i <= n - 1; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->he = p1->yu + p1->shu;\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n  }\n  return head;\n}\n\nstruct student *max(struct student *head) {\n  struct student *p, *m;\n  m = head;\n  p = head->next;\n  while (p) {\n    if (p->he > m->he)\n      m = p;\n    p = p->next;\n  }\n  return m;\n}\n\nint main() {\n  int n, i;\n  struct student *head, *m;\n  struct student *create(int n);\n  struct student *max(struct student * head);\n  scanf(\"%d\", &n);\n  head = create(n);\n  for (i = 1; i <= 3; i++) {\n    m = max(head);\n    printf(\"%d %d \", m->num, m->he);\n    m->he = -1;\n  }\n}\n"}
{"label": "14", "index": "25976", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num, a, b;\n  struct student *next;\n};\nint n;\nstruct student *create(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  i = 1;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n  head = NULL;\n  while (1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->a, &p1->b);\n    i++;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *h, *x;\n  scanf(\"%d\", &n);\n  head = create();\n  h = x = head;\n  int(*p)[2], m, j, s, i;\n  p = (int(*)[2])calloc(100000, 2 * sizeof(int));\n  for (i = 0; i < n; i++) {\n    p[i][1] = h->a + h->b;\n    p[i][0] = h->num;\n    h = x->next;\n    x = h;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - i - 1; j++)\n      if (p[j][1] >= p[j + 1][1]) {\n        m = p[j][1];\n        p[j][1] = p[j + 1][1];\n        p[j + 1][1] = m;\n        s = p[j][0];\n        p[j][0] = p[j + 1][0];\n        p[j + 1][0] = s;\n      }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d \", p[i][0], p[i][1]);\n}\n"}
{"label": "14", "index": "25977", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int he;\n} student[100000];\n\nint main() {\n  int i, n, j, s = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].yw, &student[i].sx);\n    student[i].he = student[i].yw + student[i].sx;\n  }\n  for (i = 0; i < n; i++) {\n    m = student[0].he;\n    for (j = n - 1; j > 0; j--) {\n\n      m = student[j].he > m ? student[j].he : m;\n    }\n\n    for (j = 0; j < n; j++) {\n      if (student[j].he == m) {\n        printf(\"%d %d\\n\", student[j].num, student[j].he);\n        student[j].he = 0;\n        s = s + 1;\n        if (s == 3)\n          goto guiyi;\n      }\n    }\n  }\nguiyi:\n  return 0;\n  return 0;\n}\n"}
{"label": "14", "index": "25978", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu1 {\n  long num;\n  int score1;\n  int score2;\n  struct stu1 *next;\n};\n\nstruct stu1 *creat(void) {\n  int n, i = 1;\n\n  struct stu1 *h;\n\n  struct stu1 *q1, *q2;\n  scanf(\"%d\", &n);\n\n  q2 = q1 = (struct stu1 *)malloc(1000);\n\n  h = NULL;\n  while (i <= n) {\n    cin >> q1->num >> q1->score1 >> q1->score2;\n\n    if (i == 1) {\n      h = q1;\n    } else {\n      q2 = q1;\n    }\n    if (i != n) {\n\n      q1 = q2->next = (struct stu1 *)malloc(1000);\n    } else {\n      q1->next = NULL;\n    }\n    i++;\n  }\n  return (h);\n}\n\nstruct stu1 *turn(struct stu1 *h) {\n  int t = 1;\n  struct stu1 *p1, *p2;\n  int m, n, w;\n  for (p1 = h, t = 1; p1->next != NULL, t <= 3; p1 = p1->next, t++) {\n    p2 = p1->next;\n    while (p2 != NULL) {\n      if ((p1->score1 + p1->score2) < (p2->score1 + p2->score2)) {\n        m = p1->num;\n        n = p1->score1;\n        w = p1->score2;\n        p1->num = p2->num;\n        p1->score1 = p2->score1;\n        p1->score2 = p2->score2;\n        p2->num = m;\n        p2->score1 = n;\n        p2->score2 = w;\n      }\n      p2 = p2->next;\n    }\n    printf(\"%ld %d \", p1->num, (p1->score1 + p1->score2));\n  }\n  return (h);\n}\n\nint main() {\n  struct stu1 *ip;\n  ip = creat();\n  turn(ip);\n  return 0;\n}\n"}
{"label": "14", "index": "25979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n  p->sum = p->chi + p->math;\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      head->next = NULL;\n    } else if (i < 3) {\n      for (h = head, j = 0; j < i; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else if (j == i) {\n        g->next = p;\n        p->next = NULL;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n    p->sum = p->chi + p->math;\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = p->next)\n    printf(\"%s %d \", p->num, p->sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "25980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, q, w;\n  scanf(\"%d\", &n);\n  int a[n], b[n], c[n], d[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    d[i] = b[i] + c[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i] < d[j]) {\n        q = d[i];\n        d[i] = d[j];\n        d[j] = q;\n        w = a[i];\n        a[i] = a[j];\n        a[j] = w;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], d[i]);\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "25981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int ID, Ch, Ma;\n  } temp;\n  int fID = 0, fG = 0, sID = 0, sG = 0, tID = 0, tG = 0;\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    scanf(\"%d%d%d\", &temp.ID, &temp.Ch, &temp.Ma);\n    sum = temp.Ch + temp.Ma;\n    if (sum == fG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum > fG) {\n      tG = sG;\n      tID = sID;\n      sG = fG;\n      sID = fID;\n      fG = sum;\n      fID = temp.ID;\n    }\n    if (sum < fG && sum > sG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum < sG && sum > tG) {\n      tG = sum;\n      tID = temp.ID;\n    }\n  }\n  printf(\"%d %d\\n\", fID, fG);\n  printf(\"%d %d\\n\", sID, sG);\n  printf(\"%d %d\\n\", tID, tG);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int nn;\n  int nnn;\n  int nmn;\n  int sum;\n} st[100002], tmp;\nint main() {\n  int i, j, m, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &st[i].nn, &st[i].nnn, &st[i].nmn);\n    st[i].sum = st[i].nnn + st[i].nmn;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[i].sum < st[j].sum) {\n        tmp = st[i];\n        st[i] = st[j];\n        st[j] = tmp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\", st[i].nn, st[i].sum);\n    if (i < 3)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[100000];\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n\n} a[100000];\n\nint main() {\n  int max(int b[], int n);\n  int i, j = 0, n, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].score1, &a[i].score2);\n    b[i] = a[i].score1 + a[i].score2;\n  }\n  while (j < 3) {\n    c = max(b, n);\n    for (i = 0; i < n; i++) {\n      if (b[i] == c) {\n        printf(\"%d %d\\n\", a[i].num, b[i]);\n        b[i] = 0;\n        j = j + 1;\n        if (j == 3)\n          break;\n      }\n    }\n  }\n  return 0;\n}\nint max(int b[], int n) {\n  int c, i;\n  c = b[0];\n  for (i = 0; i < n; i++) {\n    if (c < b[i])\n      c = b[i];\n  }\n  return (c);\n}\n"}
{"label": "14", "index": "25984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yuwen;\n    int math;\n    int zong;\n  };\n  struct student stu[100000];\n  struct student *p, *p1, *p2, *p3, *p4;\n  int n;\n  scanf(\"%d\", &n);\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d\", &p->num);\n    cin >> p->yuwen;\n    scanf(\"%d\", &p->math);\n  }\n  for (p = stu; p < stu + n; p++) {\n    (p->zong) = (p->yuwen) + (p->math);\n  }\n  p1 = &stu[0];\n  p2 = &stu[1];\n  p3 = &stu[2];\n  p4 = p1;\n  if (p2->zong > p1->zong) {\n    p4 = p1;\n    p1 = p2;\n    p2 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p1->zong) {\n    p4 = p1;\n    p1 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n  if (p3->zong > p2->zong) {\n    p4 = p2;\n    p2 = p3;\n    p3 = p4;\n  } else\n    p1 = p1;\n\n  for (p = stu + 3; p < stu + n; p++) {\n    if ((p->zong) > (p1->zong)) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->zong > p2->zong) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->zong > p3->zong) {\n      p3 = p;\n    } else\n      p1 = p1;\n  }\n  printf(\"%d %d\\n\", p1->num, p1->zong);\n  cout << p2->num << \" \" << p2->zong << \"\\n\";\n  cout << p3->num << \" \" << p3->zong;\n  return 0;\n}\n"}
{"label": "14", "index": "25985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} student[110000];\n\nint main() {\n  int n, i, max1 = 0, count1 = 0, max2 = 0, count2 = 0, max3 = 0, count3 = 0,\n            number = 0, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    cin >> student[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    if (student[i].total >= max1) {\n      max1 = student[i].total;\n      count1 = i;\n    }\n  }\n  number = student[0].num;\n  sum = student[0].total;\n  student[0].num = student[count1].num;\n  student[0].total = student[count1].total;\n  student[count1].num = number;\n  student[count1].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 1; i--) {\n    if (student[i].total >= max2) {\n      max2 = student[i].total;\n      count2 = i;\n    }\n  }\n  number = student[1].num;\n  sum = student[1].total;\n  student[1].num = student[count2].num;\n  student[1].total = student[count2].total;\n  student[count2].num = number;\n  student[count2].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 2; i--) {\n    if (student[i].total >= max3) {\n      max3 = student[i].total;\n      count3 = i;\n    }\n  }\n  number = student[2].num;\n  sum = student[2].total;\n  student[2].num = student[count3].num;\n  student[2].total = student[count3].total;\n  student[count3].num = number;\n  student[count3].total = sum;\n  for (i = 0; i < 3; i++) {\n    cout << student[i].num << \" \" << student[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "25986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int chn;\n  int math;\n  struct info *next;\n};\nint n, all;\nstruct info *setup(void) {\n  struct info *head, *p1, *p2;\n  n = 0;\n  while (n < all) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d %d\", p1->num, &p1->chn, &p1->math);\n    n += 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct info *p;\n  int i, first = 0, second = 0, third = 0;\n  char fnum[10], snum[10], tnum[10];\n  scanf(\"%d\", &all);\n  p = setup();\n  do {\n    if (1000 > first) {\n      third = second;\n      second = first;\n      first = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, fnum);\n      strcpy(fnum, \"\");\n      strcat(fnum, p->num);\n    } else if (1000 > second) {\n      third = second;\n      second = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, p->num);\n    } else if (1000 > third) {\n      third = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n  cout << fnum << \" \" << first << \" \" << snum << \" \" << second << \" \" << tnum\n       << \" \" << third << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "25987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  scanf(\"%d \", &n);\n  struct stu {\n    int xuehao[100000];\n    int yuwen[100000];\n    int shuxue[100000];\n    int zongfen[100000];\n  } a;\n  for (i = 0; i < n; i++) {\n    cin >> a.xuehao[i];\n    cin >> a.yuwen[i];\n    cin >> a.shuxue[i];\n    a.zongfen[i] = a.shuxue[i] + a.yuwen[i];\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = i; j >= 1; j--)\n      if (a.zongfen[j] > a.zongfen[j - 1]) {\n        temp = a.zongfen[j - 1];\n        a.zongfen[j - 1] = a.zongfen[j];\n        a.zongfen[j] = temp;\n        temp = a.xuehao[j - 1];\n        a.xuehao[j - 1] = a.xuehao[j];\n        a.xuehao[j] = temp;\n      }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a.xuehao[i], a.zongfen[i]);\n  return 0;\n}\n"}
{"label": "14", "index": "25988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, num[100000], j, grade1[100000], grade2[100000], grade[100000], t1,\n      t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &num[i], &grade1[i], &grade2[i]);\n    grade[i] = grade1[i] + grade2[i];\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (grade[i] >= grade[i + 1]) {\n        t1 = grade[i];\n        grade[i] = grade[i + 1];\n        grade[i + 1] = t1;\n        t2 = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t2;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", num[n - 1], grade[n - 1], num[n - 2],\n         grade[n - 2], num[n - 3], grade[n - 3]);\n}\n"}
{"label": "14", "index": "25989", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    char ID[10];\n    int m;\n    int c;\n\n  } tmp;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int a1 = 0, a2 = 0, a3 = 0;\n  int n, i;\n\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    cin >> tmp.ID >> (tmp.m) >> (tmp.c);\n    if ((tmp.m + tmp.c) > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = a1;\n      a1 = i;\n    } else if ((tmp.m + tmp.c) == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    } else if ((tmp.m + tmp.c) < max1 && (tmp.m + tmp.c) > max2) {\n      max3 = max2;\n      max2 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    }\n\n    else if ((tmp.m + tmp.c) == max2) {\n      max3 = max2;\n      a3 = atoi(tmp.ID);\n    } else if ((tmp.m + tmp.c) < max2 && (tmp.m + tmp.c) > max3) {\n      max3 = tmp.m + tmp.c;\n      a3 = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a1, max1);\n  printf(\"%d %d\\n\", a2, max2);\n  printf(\"%d %d\\n\", a3, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int id;\n  int c;\n  int m;\n  int sum;\n};\nint main() {\n  struct Student temp, s1, s2, s3;\n  int i, n;\n  s1.sum = s2.sum = s3.sum = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.id, &temp.c, &temp.m);\n    temp.sum = temp.c + temp.m;\n    if (temp.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = temp;\n    } else if (temp.sum > s2.sum) {\n      s3 = s2;\n      s2 = temp;\n    } else if (temp.sum > s3.sum) {\n      s3 = temp;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n}\n"}
{"label": "14", "index": "25991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int m;\n  int c;\n  int sum;\n};\n\nint main() {\n  long int n;\n  int a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  struct stu student[65535];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].c, &student[i].m);\n    student[i].sum = student[i].m + student[i].c;\n  }\n  for (int i = 0; i < n; i++) {\n    if (student[i].sum > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = student[i].sum;\n      x = student[i].num;\n      continue;\n    }\n    if (student[i].sum > b) {\n      c = b;\n      z = y;\n      b = student[i].sum;\n      y = student[i].num;\n      continue;\n    }\n    if (student[i].sum > c) {\n      c = student[i].sum;\n      z = student[i].num;\n    }\n  }\n  cout << x << \" \" << a << \"\\n\"\n       << y << \" \" << b << \"\\n\"\n       << z << \" \" << c << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "25992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, j, temp, temp2, sum = 0;\n  int max1, max2, max3, id1, id2, id3;\n  scanf(\"%d\", &n);\n  struct student *s = (struct student *)malloc(n * sizeof(struct student));\n  int *end = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].a, &s[i].b, &s[i].c);\n    end[i] = s[i].b + s[i].c;\n  }\n  max1 = -100;\n  max2 = -100;\n  max3 = -100;\n  id1 = s[0].a;\n  id2 = s[0].a;\n  id3 = s[0].a;\n  for (i = 0; i < n; i++)\n    if (end[i] > max1) {\n      max1 = end[i];\n      id1 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] > max2) {\n      max2 = end[i];\n      id2 = s[i].a;\n    }\n  for (i = 0; i < n; i++)\n    if (end[i] != max1 && end[i] != max2 && end[i] > max3) {\n      max3 = end[i];\n      id3 = s[i].a;\n    }\n\n  for (i = 0; i < n; i++) {\n    if (end[i] == max1) {\n      printf(\"%d %d\\n\", s[i].a, max1);\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max2) {\n      cout << s[i].a << \" \" << max2 << \"\\n\";\n      sum++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (sum <= 2 && end[i] == max3) {\n      printf(\"%d %d\\n\", s[i].a, max3);\n    }\n  }\n\n  free(s);\n  free(end);\n\n  return 0;\n}\n"}
{"label": "14", "index": "25993", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0;\n  cin >> n;\n  struct student { \n    int stuid;\n    int chin;\n    int math;\n  } stu[n], t;\n  for (i = 0; i < n; i++) { \n    cin >> stu[i].stuid >> stu[i].chin >> stu[i].math;\n  }\n  for (i = 0; i < 3; i++) \n    for (j = 0; j < n - 1; j++)\n      if ((stu[j].chin + stu[j].math) >= (stu[j + 1].chin + stu[j + 1].math)) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  for (i = n - 1; i > n - 4; i--) \n    cout << stu[i].stuid << \" \" << stu[i].chin + stu[i].math << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25994", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, num1 = 0, max2 = 0, num2 = 0, max3 = 0, num3 = 0;\n  struct stu {\n    int num;\n    int chn;\n    int mat;\n    int sum;\n  } sco[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> sco[i].num >> sco[i].chn >> sco[i].mat;\n    sco[i].sum = sco[i].chn + sco[i].mat;\n  }\n  for (i = 0; i < n; i++) {\n    if (sco[i].sum > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = sco[i].sum;\n      num1 = i;\n\n    } else {\n      if (sco[i].sum > max2) {\n        max3 = max2;\n        num3 = num2;\n        max2 = sco[i].sum;\n        num2 = i;\n      } else {\n        if (sco[i].sum > max3) {\n          max3 = sco[i].sum;\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << ' ' << max1 << endl;\n  cout << num2 + 1 << ' ' << max2 << endl;\n  cout << num3 + 1 << ' ' << max3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25995", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p0, *p1, *p2;\n  int i = 0;\n  head = (struct student *)malloc(1000);\n  head->next = NULL;\n  scanf(\"%ld %d %d\", &head->num, &head->scorec, &head->scorem);\n  while (i < 2) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n      if (head == p1)\n        head = p0;\n      else {\n        p2->next = p0;\n      }\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n    i++;\n  }\n  return (head);\n}\nstruct student *sort(struct student *head, int n) {\n  struct student *p0, *p1, *p2;\n  int i = 3;\n  while (i < n) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL))\n      p1 = p1->next;\n\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n\n      if (head == p1) {\n        p2 = p1->next;\n        (*p2->next).num = p2->num;\n        (*p2->next).scorec = p2->scorec;\n        (*p2->next).scorem = p2->scorem;\n        p2->num = p1->num;\n        p2->scorec = p1->scorec;\n        p2->scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else if (p1 == head->next) {\n        (*p1->next).num = p1->num;\n        (*p1->next).scorec = p1->scorec;\n        (*p1->next).scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else {\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      }\n    }\n    free(p0);\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat();\n  head = sort(head, n);\n  p1 = head->next;\n  p2 = p1->next;\n  printf(\"%ld %d \", head->num, (head->scorec + head->scorem));\n  printf(\"%ld %d \", p1->num, (p1->scorec + p1->scorem));\n  printf(\"%ld %d\", p2->num, (p2->scorec + p2->scorem));\n  return 0;\n}\n"}
{"label": "14", "index": "25996", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int id;\n  float langrade;\n  float mathgrade;\n} student[100000], s;\nint student_num;\nfloat total[100000], t;\nvoid trisort() {\n  for (int i = 0; i < 2; i++)\n    for (int j = 0; j < 2 - i; j++)\n      if (total[j] < total[j + 1]) {\n        t = total[j];\n        s = student[j];\n        total[j] = total[j + 1];\n        student[j] = student[j + 1];\n        total[j + 1] = t;\n        student[j + 1] = s;\n      }\n}\nint main() {\n  int i, j;\n  scanf(\"%d \", &student_num);\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].id >> student[i].langrade >> student[i].mathgrade;\n    total[i] = student[i].langrade + student[i].mathgrade;\n  }\n  for (j = 3; j < student_num; j++) {\n    trisort();\n    if (total[j] > total[2]) {\n      t = total[2];\n      s = student[2];\n      total[2] = total[j];\n      student[2] = student[j];\n      total[j] = t;\n      student[j] = s;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << student[i].id << \" \" << total[i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "25997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << form[i].num << \" \" << form[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "25998", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int liter;\n  int math;\n  int total;\n};\nint main() {\n  int i, j, k, n;\n  struct student a[100000], n1, n2, n3;\n  cin >> n;\n  scanf(\"%d%d%d\", &a[0].num, &a[0].liter, &a[0].math);\n  a[0].total = a[0].liter + a[0].math;\n  n1 = n2 = n3 = a[0];\n  for (i = 1; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].liter, &a[i].math);\n    a[i].total = a[i].liter + a[i].math;\n    if (a[i].total > n1.total) {\n      n3 = n2;\n      n2 = n1;\n      n1 = a[i];\n    } else if (a[i].total > n2.total) {\n      n3 = n2;\n      n2 = a[i];\n    } else if (a[i].total > n3.total)\n      n3 = a[i];\n  }\n  printf(\"%d %d\\n\", n1.num, n1.total);\n  printf(\"%d %d\\n\", n2.num, n2.total);\n  printf(\"%d %d\", n3.num, n3.total);\n  return 0;\n}\n"}
{"label": "14", "index": "25999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    cin >> p1->num >> p1->chi >> p1->math;\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sum(struct student *head) {\n  struct student *p1;\n  p1 = head;\n  while (p1) {\n    p1->total = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n}\nstruct student *choose(struct student *head) {\n  struct student *p1, *p2;\n  p1 = head;\n  p2 = p1;\n  while (p1->next) {\n    if (p2->total < (p1->next)->total)\n      p2 = p1->next;\n    p1 = p1->next;\n  }\n  cout << p2->num << \" \" << p2->total << \" \";\n  return (p2);\n}\nstruct student *del(struct student *head, struct student *p2) {\n  struct student *p1;\n  p1 = head;\n  if (p2 == head) {\n    head = p2->next;\n    return (head);\n  } else {\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n  } else if (n = 2) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n\n  } else {\n\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct ss {\n    int num, yu, sh;\n    int sum;\n  };\n  int n, i;\n  struct ss *stu;\n\n  scanf(\"%d\", &n);\n  stu = (struct ss *)malloc(sizeof(ss) * n);\n  for (i = 0; i < n; i++) {\n    int num1, yu1, sh1;\n    (stu + i)->num = 0;\n    (stu + i)->yu = 0;\n    (stu + i)->sh = 0;\n    (stu + i)->sum = 0;\n    scanf(\"%d %d %d \", &num1, &yu1, &sh1);\n    (stu + i)->num = num1;\n    (stu + i)->yu = yu1;\n    (stu + i)->sh = sh1;\n    (stu + i)->sum = yu1 + sh1;\n  }\n  for (i = 1; i < n; i++) {\n    int t;\n    if ((stu + 0)->sum < (stu + i)->sum) {\n      t = (stu + 0)->sum;\n      (stu + 0)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 0)->num;\n      (stu + 0)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    int t;\n    if ((stu + 1)->sum < (stu + i)->sum) {\n      t = (stu + 1)->sum;\n      (stu + 1)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 1)->num;\n      (stu + 1)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    int t;\n    if ((stu + 2)->sum < (stu + i)->sum) {\n      t = (stu + 2)->sum;\n      (stu + 2)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 2)->num;\n      (stu + 2)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << (stu + i)->num << \" \" << (stu + i)->sum << \"\\n\";\n  }\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << form[i].num << \" \" << form[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct grades {\n    int id;\n    int yuwen, shuxue;\n    int zongfen;\n  } grades[100007];\n  int i, n, j, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &grades[i].id, &grades[i].yuwen, &grades[i].shuxue);\n\n    grades[i].zongfen = grades[i].yuwen + grades[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (grades[j].zongfen >= grades[j + 1].zongfen) {\n        t = grades[j].zongfen;\n        grades[j].zongfen = grades[j + 1].zongfen;\n        grades[j + 1].zongfen = t;\n        s = grades[j].id;\n        grades[j].id = grades[j + 1].id;\n        grades[j + 1].id = s;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", grades[i].id, grades[i].zongfen);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct {\n  int ID[100000], Chinese[100000], Maths[100000];\n} stu;\nint main() {\n  int n, i, sum[100000], max1 = 0, max2 = 0, max3 = 0, num1, num2, num3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu.ID[i], &stu.Chinese[i], &stu.Maths[i]);\n  }\n  i = 0;\n  while (stu.ID[i] > 0) {\n    sum[i] = stu.Chinese[i] + stu.Maths[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      num1 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max2 && sum[i] <= max1 && i != num1) {\n      max2 = sum[i];\n      num2 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max3 && sum[i] <= max2 && i != num2 && i != num1) {\n      max3 = sum[i];\n      num3 = i;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", stu.ID[num1], max1, stu.ID[num2], max2,\n         stu.ID[num3], max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26004", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int china;\n  int math;\n  int total;\n} stu[1000], temp;\nint main() {\n  int n, i, j, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].china, &stu[i].math);\n    stu[i].total = stu[i].china + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    temp = stu[i];\n    count = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > temp.total) {\n        temp = stu[j];\n        count = j;\n      }\n    }\n    stu[count] = stu[i];\n    stu[i] = temp;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", stu[i].id, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "26005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int stuID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main() {\n  int i, n, j, x, str;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuID >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (stu[j].zongfen > stu[j + 1].zongfen ||\n          ((stu[j].zongfen == stu[j + 1].zongfen) &&\n           (stu[j].stuID < stu[j + 1].stuID))) {\n        x = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = x;\n        str = stu[j].stuID;\n        stu[j].stuID = stu[j + 1].stuID;\n        stu[j + 1].stuID = str;\n      }\n    }\n    cout << stu[n - 1 - i].stuID << \" \" << stu[n - 1 - i].zongfen << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26006", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int shuxue;\n  int yuwen;\n  int zongfen;\n};\n\nint main() {\n  int n, i, e, j;\n  scanf(\"%d \", &n);\n\n  struct student stu[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].shuxue, &stu[i].yuwen);\n    stu[i].zongfen = stu[i].shuxue + stu[i].yuwen;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        stu[100000] = stu[j + 1];\n        stu[j + 1] = stu[j];\n        stu[j] = stu[100000];\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].xuehao, stu[i].zongfen);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26007", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100000], t;\n\n  int n;\n  int i;\n  int k;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n\n  for (k = n - 1; k > n - 4; k--) {\n    for (i = 0; i < k; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        t = stu[i];\n        stu[i] = stu[i + 1];\n        stu[i + 1] = t;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26008", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  cin >> n;\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = max1.num;\n      max2.z = max1.z;\n      max1.num = a.num;\n      max1.z = a.z;\n    } else if (a.z > max2.z) {\n      max3.num = max2.num;\n      max3.z = max2.z;\n      max2.num = a.num;\n      max2.z = a.z;\n    } else if (a.z > max3.z) {\n      max3.num = a.num;\n      max3.z = a.z;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "26009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, *x, *y, *s, *z, i, j, o = 0, t = 0;\n  scanf(\"%d\", &n);\n  x = (int *)malloc(sizeof(int) * n);\n  y = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  z = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y[i], &s[i]);\n    z[i] = y[i] + s[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (z[i] >= z[i + 1]) {\n        o = z[i];\n        z[i] = z[i + 1];\n        z[i + 1] = o;\n        t = x[i];\n        x[i] = x[i + 1];\n        x[i + 1] = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x[n - 1], z[n - 1]);\n  printf(\"%d %d\\n\", x[n - 2], z[n - 2]);\n  printf(\"%d %d\\n\", x[n - 3], z[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26010", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(long n) {\n  struct student *head, *p1, *p2;\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n  long s = n - 1;\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  do {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->scorec, &p1->scorem);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    s = s - 1;\n  } while (s);\n  return (head);\n}\nint main() {\n  struct student *head, *p, *q, stu1, stu2, stu3;\n  long n, k1 = -1, k2 = -1, k3 = -1, i, j;\n  int l;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  for (p = head, i = 0; p != NULL; p = p->next, i++) {\n    l = 0;\n    for (q = head, j = 0; q != NULL; q = q->next, j++)\n      if ((q->scorec + q->scorem) > (p->scorec + p->scorem) ||\n          (((q->scorec + q->scorem) == (p->scorec + p->scorem)) && j < i)) {\n        l = l + 1;\n        if (l > 3)\n          break;\n      }\n    if (l == 0) {\n      k1 = i;\n      stu1.num = p->num;\n      stu1.scorec = p->scorec;\n      stu1.scorem = p->scorem;\n    }\n    if (l == 1) {\n      k2 = i;\n      stu2.num = p->num;\n      stu2.scorec = p->scorec;\n      stu2.scorem = p->scorem;\n    }\n    if (l == 2) {\n      k3 = i;\n      stu3.num = p->num;\n      stu3.scorec = p->scorec;\n      stu3.scorem = p->scorem;\n    }\n    if (k1 != -1 && k2 != -1 && k3 != -1)\n      break;\n  }\n  printf(\"%ld %d \", stu1.num, stu1.scorec + stu1.scorem);\n  printf(\"%ld %d \", stu2.num, stu2.scorec + stu2.scorem);\n  printf(\"%ld %d\", stu3.num, stu3.scorec + stu3.scorem);\n}\n"}
{"label": "14", "index": "26011", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  struct student {\n    int num;\n    int a;\n    int b;\n  } stu[100000];\n\n  int n, i, sum = 0, max1 = 0, max2 = 0, max3 = 0, t = 0;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    sum = stu[i].a + stu[i].b;\n    if (sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = sum;\n    } else if ((sum < max1) && (sum > max2)) {\n      max3 = max2;\n      max2 = sum;\n    } else if ((sum < max2) && (sum > max3)) {\n      max3 = sum;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if (sum == max1) {\n      printf(\"%d %d\\n\", stu[i].num, max1);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max2) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max2);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max3) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max3);\n      t++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int ID, chin, math;\n  };\n  stu *pp;\n  int sum, second, third, x, y, z;\n  int i, n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  pp = (struct stu *)malloc(sizeof(stu) * n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d \", &a, &b, &c);\n    (pp + i)->ID = a;\n    (pp + i)->chin = b;\n    (pp + i)->math = c;\n  }\n  sum = ((pp + i)->chin) + ((pp + i)->math);\n  for (i = 1; i <= n; i++) {\n    if (i == 1) {\n      sum = ((pp + i)->chin) + ((pp + i)->math);\n      second = ((pp + i)->chin) + ((pp + i)->math);\n      third = ((pp + i)->chin) + ((pp + i)->math);\n      x = (pp + i)->ID;\n      y = (pp + i)->ID;\n      z = (pp + i)->ID;\n\n    } else if (i == 2) {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        y = x;\n        x = (pp + i)->ID;\n      } else {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    } else {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = x;\n        x = (pp + i)->ID;\n      } else if (second < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = (pp + i)->ID;\n      } else if (third < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x, sum);\n  cout << y << \" \" << second << \"\\n\";\n  printf(\"%d %d\\n\", z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yw;\n    int sx;\n    int all;\n  } student[4] = {0, 0, 0, 0};\n  struct student temp = {0, 0, 0, 0};\n  int i, l, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[3].num, &student[3].yw, &student[3].sx);\n    student[3].all = student[3].yw + student[3].sx;\n\n    if (student[2].all < student[3].all) {\n      temp = student[2];\n      student[2] = student[3];\n      student[3] = temp;\n    }\n    if (student[1].all < student[2].all) {\n      temp = student[1];\n      student[1] = student[2];\n      student[2] = temp;\n    }\n    if (student[0].all < student[1].all) {\n      temp = student[0];\n      student[0] = student[1];\n      student[1] = temp;\n    }\n  }\n  for (l = 0; l < 3; l++) {\n    cout << student[l].num << \" \" << student[l].all << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "26014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max1 = 2, max2 = 1, max3 = 0, num1 = 0, num2 = 0, num3 = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = stu[i].zongfen;\n      num1 = i;\n    } else if (stu[i].zongfen <= max1 && stu[i].zongfen > max2) {\n      max3 = max2;\n      num3 = num2;\n      max2 = stu[i].zongfen;\n      num2 = i;\n    } else if (stu[i].zongfen <= max2 && stu[i].zongfen > max3) {\n      max3 = stu[i].zongfen;\n      num3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[num1].xuehao, stu[num1].zongfen);\n  printf(\"%d %d\\n\", stu[num2].xuehao, stu[num2].zongfen);\n  printf(\"%d %d\\n\", stu[num3].xuehao, stu[num3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  struct {\n    int id, chi, math, sum;\n  } s, s1, s2, s3;\n  s1.sum = s2.sum = s3.sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.id, &s.chi, &s.math);\n    s.sum = s.chi + s.math;\n    if (s.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.sum > s2.sum) {\n      s3 = s2, s2 = s;\n    } else if (s.sum > s3.sum) {\n      s3 = s;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int Chi;\n  int Math;\n  int sum;\n};\nstruct Student stud[100000], temp;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stud[i].num >> stud[i].Chi >> stud[i].Math;\n    stud[i].sum = stud[i].Chi + stud[i].Math;\n  }\n  if (n == 2) {\n    if (stud[0].sum < stud[1].sum) {\n      temp = stud[0];\n      stud[0] = stud[1];\n      stud[1] = temp;\n    }\n  } else {\n    for (i = 0; i < 3; i++) {\n      for (j = n - 1; j > i; j--) {\n        if (stud[j].sum > stud[j - 1].sum) {\n          temp = stud[j];\n          stud[j] = stud[j - 1];\n          stud[j - 1] = temp;\n        }\n      }\n    }\n  }\n\n  if (n == 2) {\n\n    printf(\"%d %d\\n\", stud[0].num, stud[0].sum);\n\n    cout << stud[1].num << ' ' << stud[1].sum;\n  }\n  for (i = 0; i < 2; i++) {\n    cout << stud[i].num << ' ' << stud[i].sum << endl;\n  }\n  cout << stud[2].num << ' ' << stud[2].sum;\n  return 0;\n}\n"}
{"label": "14", "index": "26017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  long int n;\n  int i, score[100000], max[3] = {0}, a[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    score[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (max[0] < score[i]) {\n      max[0] = score[i];\n      a[0] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[0])\n      continue;\n    else if (max[1] < score[i]) {\n      max[1] = score[i];\n      a[1] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[1] || stu[i].num == a[0]) {\n      continue;\n    } else if (max[2] < score[i]) {\n      max[2] = score[i];\n      a[2] = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], max[i]);\n  }\n}\n"}
{"label": "14", "index": "26018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int mat, chi, i, num;\n  struct stu {\n    int id;\n    int to;\n  } s[100001], temp1, temp2, max1, max2, max3;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &chi, &mat);\n    s[i].to = chi + mat;\n  }\n  if (s[0].to > s[1].to && s[1].to > s[2].to) {\n    max1 = s[0];\n    max2 = s[1];\n    max3 = s[2];\n  } else if (s[2].to > s[0].to && s[0].to > s[1].to) {\n    max1 = s[2];\n    max2 = s[0];\n    max3 = s[1];\n  } else if (s[0].to > s[2].to && s[2].to > s[1].to) {\n    max1 = s[0];\n    max2 = s[2];\n    max3 = s[1];\n  } else if (s[2].to > s[1].to && s[1].to > s[0].to) {\n    max1 = s[2];\n    max2 = s[1];\n    max3 = s[0];\n  } else if (s[1].to > s[0].to && s[0].to > s[2].to) {\n    max1 = s[1];\n    max2 = s[0];\n    max3 = s[2];\n  } else {\n    max1 = s[1];\n    max2 = s[2];\n    max3 = s[0];\n  }\n  for (i = 0; i < num - 1; i++) {\n    if (s[i].to > max1.to) {\n      temp1 = max1;\n      temp2 = max2;\n      max1 = s[i];\n      max2 = temp1;\n      max3 = temp2;\n    } else if (s[i].to > max2.to && s[i].id != max1.id) {\n      temp1 = max2;\n      max2 = s[i];\n      max3 = temp1;\n    } else if (s[i].to > max3.to && s[i].id != max2.id && s[i].id != max1.id)\n      max3 = s[i];\n  }\n  cout << max1.id << \" \" << max1.to << \"\\n\"\n       << max2.id << \" \" << max2.to << \"\\n\"\n       << max3.id << \" \" << max3.to << \"\\n\";\n}\n"}
{"label": "14", "index": "26019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int idnum, yunum, shunum;\n  } stu[100000];\n  int n, i, max = 0, ndmax = 0, rdmax = 0, l = 0;\n  cin >> n;\n  int chengji[100000] = {0};\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].idnum >> stu[i].yunum >> stu[i].shunum;\n    chengji[i] = chengji[i] + stu[i].yunum;\n    chengji[i] = chengji[i] + stu[i].shunum;\n  }\n  for (i = 0; i < n; i++) {\n    if (chengji[i] > max)\n      max = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (max == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, max);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < max) && (chengji[i] > ndmax))\n      ndmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (ndmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, ndmax);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < ndmax) && (chengji[i] > rdmax))\n      rdmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (rdmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, rdmax);\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  long n;\n  long num[99999], math[99999], china[99999], z[99999], i;\n  long num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", &num[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &china[i]);\n    z[i] = math[i] + china[i];\n    if (z[i] > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z[i];\n      m3 = i;\n\n    } else if (z[i] > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z[i];\n      m2 = i;\n    } else if (z[i] > num1) {\n      num1 = z[i];\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  cout << m1 << \" \" << num1 << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum[100001], temp = 0;\n  scanf(\"%d \", &n);\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n  } person[100001];\n  for (i = 1; i <= n; i++) {\n    cin >> person[i].ID >> person[i].chinese >> person[i].math;\n    sum[i] = person[i].chinese + person[i].math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp) {\n      temp = sum[i];\n      j = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j) {\n      temp = sum[i];\n      k = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j && i != k) {\n      temp = sum[i];\n      l = i;\n    }\n  }\n  cout << person[j].ID << \" \" << sum[j] << endl;\n  cout << person[k].ID << \" \" << sum[k] << endl;\n  cout << person[l].ID << \" \" << sum[l] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26022", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  long int num;\n  int chi;\n  int mat;\n  int tot;\n};\nint main() {\n  struct stu a[100050];\n  int n, i, j, max;\n  long int temp1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld%d%d\", &a[i].num, &a[i].chi, &a[i].mat);\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  for (j = 1; j <= 3; j++) {\n    max = 0;\n    a[0].tot = 0;\n    for (i = 1; i <= n; i++)\n      if (a[max].tot < a[i].tot)\n        max = i;\n    printf(\"%ld %d\\n\", a[max].num, a[max].tot);\n    a[max].tot = 0;\n  }\n  scanf(\"\\n\");\n  return (0);\n}\n"}
{"label": "14", "index": "26023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int ch;\n  int ma;\n  int sum;\n  int key;\n\n} stu[100000];\nint main() {\n  int n, i, max = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].number, &stu[i].ch, &stu[i].ma);\n    stu[i].sum = stu[i].ch + stu[i].ma;\n    stu[i].key = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n}\n"}
{"label": "14", "index": "26024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int math_grade;\n  int chi_grade;\n  int sum;\n} stu[100000];\nint main() {\n  int i, j, n, max, temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].id);\n    scanf(\"%d\", &stu[i].math_grade);\n    scanf(\"%d\", &stu[i].chi_grade);\n  }\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math_grade + stu[i].chi_grade;\n  for (i = 0; i < 3; i++) {\n    max = stu[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].sum > max) {\n        temp1 = stu[i].id;\n        stu[i].id = stu[j].id;\n        stu[j].id = temp1;\n        temp2 = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = temp2;\n        max = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 2; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n  printf(\"%d %d\", stu[2].id, stu[2].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26025", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  long int num[100000];\n  int y[100000];\n  int m[100000];\n};\n\nint main() {\n  int n, i, temp = 0, sum[100000];\n  struct stu p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &p.num[i], &p.y[i], &p.m[i]);\n    sum[i] = p.m[i] + p.y[i];\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 1], sum[n - 1]);\n  for (i = 0; i < n - 2; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 2], sum[n - 2]);\n  for (i = 0; i < n - 3; i++) {\n    if (sum[i] >= sum[i + 1]) {\n      temp = sum[i + 1];\n      sum[i + 1] = sum[i];\n      sum[i] = temp;\n      temp = p.num[i + 1];\n      p.num[i + 1] = p.num[i];\n      p.num[i] = temp;\n    }\n  }\n  printf(\"%ld %d\\n\", p.num[n - 3], sum[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int stuID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main() {\n  int i, n, j, x, str;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].stuID, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (stu[j].zongfen > stu[j + 1].zongfen ||\n          ((stu[j].zongfen == stu[j + 1].zongfen) &&\n           (stu[j].stuID < stu[j + 1].stuID))) {\n        x = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = x;\n        str = stu[j].stuID;\n        stu[j].stuID = stu[j + 1].stuID;\n        stu[j + 1].stuID = str;\n      }\n    }\n    printf(\"%d %d\\n\", stu[n - 1 - i].stuID, stu[n - 1 - i].zongfen);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id;\n    float yuwen, shuxue, sum;\n  } stu[100000], t;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %f %f\", &stu[i].id, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %g \", stu[i].id, stu[i].sum);\n}\n"}
{"label": "14", "index": "26028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\n\nstruct stu {\n  int xh;\n  int yw;\n  int sx;\n  int all;\n  struct stu *next;\n};\nstruct stu *a, *b, *c, q, t, r;\nstruct stu *creat() {\n  struct stu *head;\n  struct stu *p1, *p2;\n  int i;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->all = p1->yw + p1->sx;\n  head = p1;\n  a = b = c = head;\n  for (i = 1; i < n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->all = p1->yw + p1->sx;\n    if (p1->all > a->all) {\n      c = b;\n      b = a;\n      a = p1;\n    } else\n\n        if (p1->all > b->all) {\n      c = b;\n      b = p1;\n    } else {\n      if (p1->all > c->all)\n        c = p1;\n    }\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n\n  struct stu *p;\n  a = &q;\n  b = &t;\n  c = &r;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->xh, a->all, b->xh, b->all, c->xh, c->all);\n}\n"}
{"label": "14", "index": "26029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int i;\n  int j;\n  int k;\n};\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student c[n + 10];\n  int m1 = 1, m2 = 1, m3 = 1;\n  for (int m = 1; m <= n; m++) {\n    scanf(\"%d %d %d\", &c[m].i, &c[m].j, &c[m].k);\n    if ((c[m].j + c[m].k) > (c[m1].j + c[m1].k)) {\n      m3 = m2;\n      m2 = m1;\n      m1 = m;\n    } else if ((c[m].j + c[m].k) > (c[m2].j + c[m2].k)) {\n      m3 = m2;\n      m2 = m;\n    } else if ((c[m].j + c[m].k) > (c[m3].j + c[m3].k))\n      m3 = m;\n  }\n  cout << c[m1].i << \" \" << c[m1].j + c[m1].k << \" \";\n  printf(\"%d %d \", c[m2].i, c[m2].j + c[m2].k);\n  printf(\"%d %d \", c[m3].i, c[m3].j + c[m3].k);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m;\n  int a, b, c;\n  int j, k, v;\n  int sum[100000];\n  int max1 = 0, max2 = 0, max3 = 0;\n  int A[100000][1];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m >> A[i][0] >> A[i][1];\n    sum[i] = A[i][0] + A[i][1];\n  }\n  for (j = 1; j <= n; j++) {\n    if (sum[j] > max1) {\n      max1 = sum[j];\n      a = j;\n    }\n  }\n  for (k = 1; k <= n; k++) {\n\n    if (sum[k] > max2 && k != a) {\n      max2 = sum[k];\n      b = k;\n    }\n  }\n  for (v = 1; v <= n; v++) {\n    if (sum[v] < max2) {\n      if (sum[v] > max3) {\n        max3 = sum[v];\n        c = v;\n      }\n    }\n  }\n  cout << a << \" \" << max1 << \"\\n\";\n  cout << b << \" \" << max2 << \"\\n\";\n  printf(\"%d %d\", c, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26031", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct score {\n    int ID;\n    int c;\n    int m;\n  };\n  int n, k, t, r;\n  int j;\n  scanf(\"%d \", &n);\n  int sum[100000];\n  struct score s[100000];\n  for (int i = 1; i <= n; i++) {\n    cin >> s[i].ID >> s[i].c >> s[i].m;\n    sum[i] = s[i].c + s[i].m;\n  }\n  for (j = 1; j <= 3; j++) {\n    for (k = j; k <= n; k++) {\n      if (sum[k] > sum[j]) {\n        t = sum[j];\n        sum[j] = sum[k];\n        sum[k] = t;\n        r = s[j].ID;\n        s[j].ID = s[k].ID;\n        s[k].ID = r;\n      }\n    }\n  }\n  for (int u = 1; u <= 3; u++) {\n    printf(\"%d %d\\n\", s[u].ID, sum[u]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n  return 0;\n}\n"}
{"label": "14", "index": "26033", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int math;\n  int chinese;\n} stu[100000];\nint main() {\n  int n, i, j, s[100000], t[100000], c = 0;\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n\n  for (i = 0; i <= (n - 1); i++) {\n    s[i] = stu[i].math + stu[i].chinese;\n    t[i] = s[i];\n  }\n  int p;\n  for (i = 0; i <= 2; i++) {\n    for (j = 0; j <= (n - i - 2); j++) {\n      if (s[j] >= s[j + 1]) {\n        p = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = p;\n      }\n    }\n  }\n  int d[3];\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 1]) {\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 2]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 3]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26034", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int chn;\n  int math;\n  int sum;\n};\nint main() {\n  struct stu indi[100000];\n  int n, i, j, rank[3];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &indi[i].id, &indi[i].chn, &indi[i].math);\n    indi[i].sum = indi[i].chn + indi[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    rank[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (indi[j].sum > indi[rank[i]].sum)\n        rank[i] = j;\n    }\n    indi[rank[i]].sum = -indi[rank[i]].sum;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", indi[rank[i]].id, -indi[rank[i]].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, t, z;\n  struct a {\n    int num;\n    int b;\n    int c;\n    int d;\n  } a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].b, &a[i].c);\n    a[i].d = a[i].b + a[i].c;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < 2 - j; i++) {\n      if (a[i].d < a[i + 1].d) {\n        t = a[i].d;\n        z = a[i].num;\n        a[i].d = a[i + 1].d;\n        a[i].num = a[i + 1].num;\n        a[i + 1].d = t;\n        a[i + 1].num = z;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &a[3].num, &a[3].b, &a[3].c);\n    a[3].d = a[3].b + a[3].c;\n    if (a[3].d > a[0].d) {\n      a[2] = a[1];\n      a[1] = a[0];\n      a[0] = a[3];\n    } else if (a[3].d > a[1].d) {\n      a[2] = a[1];\n      a[1] = a[3];\n    } else if (a[3].d > a[2].d) {\n      a[2] = a[3];\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].d);\n  printf(\"%d %d\\n\", a[1].num, a[1].d);\n  printf(\"%d %d\\n\", a[2].num, a[2].d);\n  return 0;\n}\n"}
{"label": "14", "index": "26036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nstruct student stu[100000];\nint sum[100000];\nint main(int argc, char *argv[]) {\n\n  int a, b, c, num1, num2, num3;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].math;\n  }\n  a = sum[0];\n  num1 = 1;\n  if (a < sum[1]) {\n    b = a;\n    num2 = num1;\n    a = sum[1];\n    num1 = 2;\n  } else {\n    b = sum[1];\n    num2 = 2;\n  }\n  c = 0;\n  for (i = 2; i < n; i++) {\n    if (a < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = a;\n      num2 = num1;\n      a = sum[i];\n      num1 = i + 1;\n    } else if (b < sum[i]) {\n      c = b;\n      num3 = num2;\n      b = sum[i];\n      num2 = i + 1;\n    } else if (c < sum[i]) {\n      c = sum[i];\n      num3 = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", num1, a);\n  printf(\"%d %d\\n\", num2, b);\n  printf(\"%d %d\\n\", num3, c);\n  return 0;\n}\n"}
{"label": "14", "index": "26037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int number;\n    int maths;\n    int chinese;\n    int sum;\n  };\n  struct student stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].maths;\n    stu[i].sum = stu[i].chinese + stu[i].maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 2; j >= i; j--)\n      if (stu[j].sum < stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  if (n >= 3) {\n    for (i = 0; i < 3; i++)\n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  } else\n    for (i = 0; i < n; i++)\n      printf(\"%d %d\\n\", stu[i].number, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n\n  for (i = 0; i < n; i++) {\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  int t_1, t_2;\n  int j, k;\n  for (k = 1; k < 4; k++) {\n    for (j = 0; j < n - k; j++) {\n      if (stu[j].total >= stu[j + 1].total) {\n        t_1 = stu[j + 1].total;\n        stu[j + 1].total = stu[j].total;\n        stu[j].total = t_1;\n        t_2 = stu[j + 1].num;\n        stu[j + 1].num = stu[j].num;\n        stu[j].num = t_2;\n      }\n    }\n  }\n\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].num << \" \" << stu[i].total << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26039", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct {\n  int ID[100000], Chinese[100000], Maths[100000];\n} stu;\nint main() {\n  int n, i, sum[100000], max1 = 0, max2 = 0, max3 = 0, num1, num2, num3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &stu.ID[i], &stu.Chinese[i], &stu.Maths[i]);\n  }\n  i = 0;\n  while (stu.ID[i] > 0) {\n    sum[i] = stu.Chinese[i] + stu.Maths[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      num1 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max2 && sum[i] <= max1 && i != num1) {\n      max2 = sum[i];\n      num2 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max3 && sum[i] <= max2 && i != num2 && i != num1) {\n      max3 = sum[i];\n      num3 = i;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", stu.ID[num1], max1, stu.ID[num2], max2,\n         stu.ID[num3], max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26040", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n  } data[100000];\n  int n, i, max, x, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data[i].xh, &data[i].yw, &data[i].sx);\n    data[i].zf = data[i].yw + data[i].sx;\n  }\n  for (i = 0; i < 3; i++) {\n    max = data[0].zf;\n    x = 0;\n    for (j = 1; j < n; j++) {\n      if (data[j].zf > max) {\n        max = data[j].zf;\n        x = j;\n      }\n    }\n    printf(\"%d %d\\n\", data[x].xh, data[x].zf);\n    data[x].zf = 0;\n  }\n}\n"}
{"label": "14", "index": "26041", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  cin >> n;\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a;\n    } else if (a.z > max2.z) {\n      max3 = max2;\n      max2 = a;\n    } else if (a.z > max3.z) {\n      max3 = a;\n      max3 = a;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n}\n"}
{"label": "14", "index": "26042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    char a[6];\n    int c;\n    int m;\n    int s;\n    struct student *next;\n  };\n  struct student *head;\n  struct student *p1, *p2;\n  struct student first = {\"\", 0, 0, 0, 0};\n  struct student second = {\"\", 0, 0, 0, 0};\n  struct student third = {\"\", 0, 0, 0, 0};\n  int n, i, j;\n  char ch;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  for (j = 0; j < 6; j = j + 1)\n    p1->a[j] = '\u0000';\n  getchar();\n  for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n    p1->a[j] = ch;\n  cin >> p1->c >> p1->m;\n  p1->s = p1->c + p1->m;\n  head = 0;\n  for (i = 1; i < n; i = i + 1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    for (j = 0; j < 6; j = j + 1)\n      p1->a[j] = '\u0000';\n    getchar();\n    for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n      p1->a[j] = ch;\n    cin >> p1->c >> p1->m;\n    p1->s = p1->c + p1->m;\n  }\n  p2->next = 0;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->s > first.s) {\n      third = second;\n      second = first;\n      first = *p1;\n    } else if (p1->s > second.s) {\n      third = second;\n      second = *p1;\n    } else if (p1->s > third.s) {\n      third = *p1;\n    } else\n      continue;\n  }\n  printf(\"%s %d \", first.a, first.s);\n  cout << second.a << \" \" << second.s << \" \";\n  printf(\"%s %d \", third.a, third.s);\n}\n"}
{"label": "14", "index": "26043", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N, i, j, k;\n  cin >> N;\n  struct Student_Num {\n    int num;\n    int Chinese;\n    int Math;\n  };\n  struct Student_Num student[N];\n  struct Student_Num temp;\n  for (i = 0; i < N; i++) {\n    cin >> student[i].num >> student[i].Chinese >> student[i].Math;\n  }\n  int total[N], totalNum[3], p[3];\n  for (i = 0; i < N; i++) {\n    total[i] = student[i].Chinese + student[i].Math;\n  }\n  for (i = 0; i < 3; i++) {\n    totalNum[i] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < N; j++) {\n      if (totalNum[i] < total[j]) {\n        totalNum[i] = total[j];\n        p[i] = j;\n      }\n    }\n    total[p[i]] = 0;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", student[p[i]].num, totalNum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26044", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    int b;\n    int c;\n    int d;\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int i, j, k, m, n, t;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct s *)malloc(sizeof(struct s));\n  head = p1;\n  cin >> p1->a >> p1->b >> p1->c;\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = 0;\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p1->d = p1->b + p1->c;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = p1->next;\n    for (i = 0; i < n - 2; i++) {\n      if (p1->d < p2->d) {\n        t = p1->d;\n        p1->d = p2->d;\n        p2->d = t;\n        k = p1->a;\n        p1->a = p2->a;\n        p2->a = k;\n      }\n\n      p2 = p2->next;\n    }\n    p1 = head;\n\n    printf(\"%d %d\\n\", p1->a, p1->d);\n    p1->d = 0;\n  }\n}\n"}
{"label": "14", "index": "26045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i].m, &a[i].x, &a[i].y);\n\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i].m << \" \" << (a[i].x + a[i].y) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26046", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n\n  for (i = 0; i < n; i++) {\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  int t_1, t_2;\n  int j, k;\n  for (k = 1; k < 4; k++) {\n    for (j = 0; j < n - k; j++) {\n      if (stu[j].total >= stu[j + 1].total) {\n        t_1 = stu[j + 1].total;\n        stu[j + 1].total = stu[j].total;\n        stu[j].total = t_1;\n        t_2 = stu[j + 1].num;\n        stu[j + 1].num = stu[j].num;\n        stu[j].num = t_2;\n      }\n    }\n  }\n\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  int id;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  score *p[100000], *temp, stu[100000];\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) { \n    p[i] = &stu[i];\n    cin >> p[i]->id >> p[i]->chinese >> p[i]->maths;\n    p[i]->sum = p[i]->chinese + p[i]->maths;\n  }\n  for (i = 0; i < 3; i++) \n    for (j = n - 1; j > i; j--)\n      if (p[j]->sum > p[j - 1]->sum) { \n        temp = p[j];\n        p[j] = p[j - 1];\n        p[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++) \n    cout << p[i]->id << ' ' << p[i]->sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26048", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int c;\n  int m;\n};\nstruct stu a[100000];\n\nint main(int argc, char *argv[]) {\n  int n, i, x, y, z, t, q, w, e;\n  int b[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i].ID);\n    scanf(\"%d \", &a[i].c);\n    scanf(\"%d\", &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n  if (b[0] > b[1] && b[1] > b[2]) {\n    x = b[0];\n    q = 1;\n    y = b[1];\n    w = 1 + 1;\n    z = b[2];\n    e = 2 + 1;\n  } else if (b[1] > b[0] && b[0] > b[2]) {\n    x = b[1];\n    y = b[0];\n    z = b[2];\n    q = 1 + 1;\n    w = 0 + 1;\n    e = 2 + 1;\n  } else if (b[2] > b[1] && b[1] > b[0]) {\n    x = b[2];\n    y = b[1];\n    z = b[0];\n    q = 2 + 1;\n    w = 1 + 1;\n    e = 0 + 1;\n  } else if (b[2] > b[0] && b[0] > b[1]) {\n    x = b[2];\n    y = b[0];\n    z = b[1];\n    q = 2 + 1;\n    w = 0 + 1;\n    e = 1 + 1;\n  } else if (b[1] > b[2] && b[2] > b[0]) {\n    x = b[1];\n    y = b[2];\n    z = b[0];\n    q = 1 + 1;\n    w = 2 + 1;\n    e = 0 + 1;\n  } else if (b[0] > b[2] && b[2] > b[1]) {\n    x = b[0];\n    y = b[2];\n    z = b[1];\n    q = 0 + 1;\n    w = 2 + 1;\n    e = 1 + 1;\n  }\n  for (i = 3; i < n; i++) {\n    if (b[i] > x) {\n      t = x;\n      x = b[i];\n      z = y;\n      y = t;\n      e = w;\n      w = q;\n      q = i + 1;\n    } else if (b[i] > y) {\n      z = y;\n      y = b[i];\n      e = w;\n      w = i + 1;\n    } else if (b[i] > z) {\n      z = b[i];\n      e = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", q, x);\n  printf(\"%d %d\\n\", w, y);\n  printf(\"%d %d\\n\", e, z);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26049", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chn;\n  int mth;\n  int sum;\n};\nstruct Scr {\n  int num;\n  int sum;\n};\n\nint main() {\n  struct Student stu[100000];\n  struct Scr scr[3];\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chn >> stu[i].mth;\n    stu[i].sum = stu[i].chn + stu[i].mth;\n  }\n  scr[0].num = stu[0].num;\n  scr[0].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > scr[0].sum) {\n      scr[0].num = stu[i].num;\n      scr[0].sum = stu[i].sum;\n    }\n  }\n  scr[1].num = stu[0].num;\n  scr[1].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i != scr[0].num - 1) {\n      if (stu[i].sum > scr[1].sum) {\n        scr[1].num = stu[i].num;\n        scr[1].sum = stu[i].sum;\n      }\n    }\n  }\n  scr[2].num = stu[0].num;\n  scr[2].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i == scr[0].num - 1 || i == scr[1].num - 1)\n      continue;\n    else {\n      if (stu[i].sum > scr[2].sum) {\n        scr[2].num = stu[i].num;\n        scr[2].sum = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", scr[i].num, scr[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26050", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int c;\n};\nint main() {\n  int n, i, j, m, t;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].a >> stu[i].b;\n    stu[i].c = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        t = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        m = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].c);\n}\n"}
{"label": "14", "index": "26051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int n1;\n  int n2;\n  int n3;\n  struct student *next;\n};\nint main() {\n  struct student *p, *head, *tail;\n  int n, i, sum[100000], max1, max2, max3, k1, k2, k3;\n  scanf(\"%d\", &n);\n  head = NULL;\n  tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct student *)malloc(1000);\n    cin >> p->n1 >> p->n2 >> p->n3;\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    sum[i] = p->n2 + p->n3;\n  }\n  max1 = sum[1];\n  k1 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      k1 = i;\n    }\n  sum[k1] = 0;\n\n  max2 = sum[1];\n  k2 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max2) {\n      max2 = sum[i];\n      k2 = i;\n    }\n  sum[k2] = 0;\n\n  max3 = sum[1];\n  k3 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max3) {\n      max3 = sum[i];\n      k3 = i;\n    }\n  cout << k1 << \" \" << max1 << \" \" << k2 << \" \" << max2 << \" \" << k3 << \" \"\n       << max3 << \" \";\n}\n"}
{"label": "14", "index": "26052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char num[10];\n  int grade[2];\n};\nstruct student stu[100000];\nint main() {\n  int n, sum[100000], i, count, max, j;\n  count = 1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%s %d %d\", stu[i].num, &stu[i].grade[0], &stu[i].grade[1]);\n    sum[i] = stu[i].grade[0] + stu[i].grade[1];\n  }\n  while (count <= 2) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        j = i;\n      }\n    }\n    printf(\"%s %d\\n\", stu[j].num, sum[j]);\n    count++;\n    sum[j] = 0;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  }\n  printf(\"%s %d\", stu[j].num, sum[j]);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int id;\n    int x;\n    int y;\n    int z;\n  } student1, student2, student3, studenta;\n  int n, i;\n  cin >> n;\n  student1.z = student2.z = student3.z = 0;\n  for (i = 0; i < n; i++) {\n    cin >> studenta.id >> studenta.x >> studenta.y;\n    studenta.z = studenta.x + studenta.y;\n    if (studenta.z > student1.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = student1.z;\n      student2.id = student1.id;\n      student1.z = studenta.z;\n      student1.id = studenta.id;\n    } else if (studenta.z > student2.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = studenta.z;\n      student2.id = studenta.id;\n    } else if (studenta.z > student3.z) {\n      student3.z = studenta.z;\n      student3.id = studenta.id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student1.id, student1.z, student2.id,\n         student2.z, student3.id, student3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "26054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int no;\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu a, *head, *p, *tail, *q;\n  int k, i, m1, m2, m3, n1, n2, n3, temp1, temp2;\n  head = NULL;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p->no, &p->chi, &p->math);\n    p->sum = (p->chi + p->math);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n      tail->next = &a;\n    }\n  }\n  a.next = NULL;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m1 = p->no;\n  n1 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m2 = p->no;\n  n2 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m3 = p->no;\n  n3 = p->sum;\n  printf(\"%d %d %d %d %d %d \", m1, n1, m2, n2, m3, n3);\n}\n"}
{"label": "14", "index": "26055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yu;\n    int shu;\n    int c;\n  } s[100000], k;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].yu >> s[i].shu;\n    s[i].c = s[i].yu + s[i].shu;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n - 1; j++)\n      if (s[j].c > s[i].c) {\n        k = s[i];\n        s[i] = s[j];\n        s[j] = k;\n      }\n    cout << s[i].num << \" \" << s[i].c << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "26056", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct a {\n  char No[20];\n  int y;\n  int s;\n  struct a *next;\n};\nint n;\nstruct a *creat(void) {\n  struct a *p1, *p2, *head;\n  int i;\n  scanf(\"%d \", &n);\n  p1 = p2 = (struct a *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", p1->No, &p1->y, &p1->s);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct a *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct a *head, *p1, *p2, *p;\n  int j, k, m1, m2;\n  char r[10];\n  head = creat();\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d\", r, j);\n  return 0;\n}\n"}
{"label": "14", "index": "26057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int No;\n  int Chinese;\n  int Maths;\n  int Total;\n};\n\nvoid bubble(struct Student a[], int n) {\n  int i, j;\n  struct Student temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j].Total < a[j + 1].Total) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i;\n  struct Student stu[4];\n  scanf(\"%d\", &n);\n  if (n > 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].Chinese + stu[i].Maths;\n    }\n    for (i = 3; i < n; i++) {\n      scanf(\"%d%d%d\", &stu[3].No, &stu[3].Chinese, &stu[3].Maths);\n      stu[3].Total = +stu[3].Chinese + stu[3].Maths;\n      bubble(stu, 4);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].No + stu[i].Chinese + stu[i].Maths;\n    }\n    bubble(stu, n);\n  }\n  for (i = 0; i < n && i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].No, stu[i].Total);\n  return 0;\n}\n"}
{"label": "14", "index": "26058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct score {\n    int n;\n    int a;\n    int b;\n    int c;\n  } score[5];\n  int i, m;\n  scanf(\"%d\", &m);\n  score[1].n = 0;\n  score[1].c = 0;\n  score[2].n = 0;\n  score[2].c = 0;\n  score[3].n = 0;\n  score[3].c = 0;\n  for (i = 0; i < m; i++) {\n    cin >> score[4].n >> score[4].a >> score[4].b;\n    score[4].c = score[4].a + score[4].b;\n    if (score[4].c > score[1].c) {\n      score[3] = score[2];\n      score[2] = score[1];\n      score[1] = score[4];\n    } else if (score[4].c > score[2].c) {\n      score[3] = score[2];\n      score[2] = score[4];\n    } else if (score[4].c > score[3].c)\n      score[3] = score[4];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", score[1].n, score[1].c, score[2].n,\n         score[2].c, score[3].n, score[3].c);\n  return 0;\n}\n"}
{"label": "14", "index": "26059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  long num;\n  int Chi;\n  int Math;\n  int Sum;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->Chi, &p1->Math);\n    p1->Sum = p1->Chi + p1->Math;\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct stu *Bigthree(struct stu *head) {\n  int t;\n  struct stu *max, *premax, *New, *Newhead = NULL;\n  for (t = 0; t < 3; t++) {\n    premax = NULL;\n    max = head;\n    p2 = head;\n    p1 = head->next;\n    while (p1 != NULL) {\n      if ((p1->Sum) > (max->Sum)) {\n        premax = p2;\n        max = p1;\n      }\n      p2 = p2->next;\n      p1 = p1->next;\n    }\n    if (max == head)\n      head = head->next;\n    else\n      premax->next = max->next;\n    max->next = NULL;\n    if (t == 0) {\n      Newhead = max;\n      New = Newhead;\n    }\n\n    else\n      New = New->next = max;\n  }\n  New->next = NULL;\n  return (Newhead);\n}\n\nvoid output(struct stu *head) {\n  struct stu *p;\n  for (p = head; p != NULL; printf(\"%ld %d\\n\", p->num, p->Sum), p = p->next)\n    ;\n}\n\nint main() {\n  int n;\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = Bigthree(head);\n  output(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int sum;\n  } stu[100000], temp;\n  int total, i, j, chin, math;\n  scanf(\"%d\", &total);\n  for (i = 0; i < total; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &chin, &math);\n    stu[i].sum = chin + math;\n  }\n  for (i = 2; i < 5; i++) {\n    for (j = total - i; j >= 0; j--) {\n      if (stu[j].sum < stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "26061", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int chn;\n  int math;\n  struct info *next;\n};\nint n, all;\nstruct info *setup(void) {\n  struct info *head, *p1, *p2;\n  n = 0;\n  while (n < all) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d %d\", p1->num, &p1->chn, &p1->math);\n    n += 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct info *p;\n  int i, first = 0, second = 0, third = 0;\n  char fnum[10], snum[10], tnum[10];\n  scanf(\"%d \", &all);\n  p = setup();\n  do {\n    if (1000 > first) {\n      third = second;\n      second = first;\n      first = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, fnum);\n      strcpy(fnum, \"\");\n      strcat(fnum, p->num);\n    } else if (1000 > second) {\n      third = second;\n      second = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, p->num);\n    } else if (1000 > third) {\n      third = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%s %d %s %d %s %d \", fnum, first, snum, second, tnum, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a = 0, b = 0, c = 0;\n  int an, bn, cn;\n  int n, i, sum = 0;\n  struct student {\n    int num, ch, math;\n  } students[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &students[i].num, &students[i].ch, &students[i].math);\n    sum = students[i].ch + students[i].math;\n    if (sum > c) {\n      c = sum;\n      cn = i;\n    }\n    if (sum > b) {\n      c = b;\n      cn = bn;\n      b = sum;\n      bn = i;\n    }\n    if (sum > a) {\n      b = a;\n      bn = an;\n      a = sum;\n      an = i;\n    }\n  }\n  printf(\"%d %d\\n\", students[an].num, a);\n  cout << students[bn].num << \" \" << b << \"\\n\";\n  printf(\"%d %d\\n\", students[cn].num, c);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n  while (p1->num < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    cout << q->num << \" \" << q->sum << \" \";\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  cin >> m;\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "26064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000];\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++)\n    t[i].sum = t[i].chinese + t[i].maths;\n\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    tmp = t[i].sum;\n    t[i].sum = t[k].sum;\n    t[k].sum = tmp;\n\n    tmp = t[i].num;\n    t[i].num = t[k].num;\n    t[k].num = tmp;\n  }\n  for (i = 0; i < 3; i++) {\n    cout << t[i].num << \" \" << t[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int count;\n  int yu;\n  int shu;\n} stu[1000000];\nint main() {\n  int n, i, *p, max = 0, sm = 0, tm = 0, j = 0;\n  p = (int *)malloc(1000000 * sizeof(int));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].count, &stu[i].yu, &stu[i].shu);\n    *(p + i) = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < n; i++)\n    max = (max > *(p + i)) ? max : (*(p + i));\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) < max) && (*(p + i) > sm))\n      sm = *(p + i);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) > tm) && (*(p + i) < sm))\n      tm = *(p + i);\n  }\n\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == max) {\n      cout << stu[i].count << \" \" << max << \"\\n\";\n      j++;\n    }\n  }\n\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == sm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, sm);\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == tm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, tm);\n      j++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, t, z;\n  struct a {\n    int num;\n    int b;\n    int c;\n    int d;\n  } a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].b, &a[i].c);\n    a[i].d = a[i].b + a[i].c;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < 2 - j; i++) {\n      if (a[i].d < a[i + 1].d) {\n        t = a[i].d;\n        z = a[i].num;\n        a[i].d = a[i + 1].d;\n        a[i].num = a[i + 1].num;\n        a[i + 1].d = t;\n        a[i + 1].num = z;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &a[3].num, &a[3].b, &a[3].c);\n    a[3].d = a[3].b + a[3].c;\n    if (a[3].d > a[0].d) {\n      a[2] = a[1];\n      a[1] = a[0];\n      a[0] = a[3];\n    } else if (a[3].d > a[1].d) {\n      a[2] = a[1];\n      a[1] = a[3];\n    } else if (a[3].d > a[2].d) {\n      a[2] = a[3];\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].d);\n  cout << a[1].num << \" \" << a[1].d << \"\\n\";\n  cout << a[2].num << \" \" << a[2].d << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int sum;\n  int c;\n};\nint main() {\n  int n, i, j, nt, ct;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    stu[i].sum = stu[i].a + stu[i].b;\n    stu[i].c = stu[i].sum;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        nt = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = nt;\n        ct = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = ct;\n      }\n    }\n\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << stu[i].c << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "26068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100001][5];\n  int i, j, n, k = 3, max = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &a[i][1], &a[i][2], &a[i][3]);\n    a[i][4] = a[i][2] + a[i][3];\n  }\n  while (k--) {\n    for (i = 1; i <= n; i++) {\n      if (a[i][4] > max) {\n        max = a[i][4], t = i;\n      }\n    }\n    printf(\"%d %d\\n\", t, a[t][4]);\n    a[t][4] = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "26069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n;\n  scanf(\"%ld\", &n);\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } stu[100000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].sum = stu[i].chi + stu[i].math;\n  }\n  struct student blank;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[0].sum) {\n      blank = stu[0];\n      stu[0] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[1].sum) {\n      blank = stu[1];\n      stu[1] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (stu[i].sum > stu[2].sum) {\n      blank = stu[2];\n      stu[2] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "26070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n  };\n  struct student a[100000], temp;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num;\n    scanf(\"%d\", &a[i].chinese);\n    scanf(\"%d\", &a[i].maths);\n  }\n\n  for (i = 1; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[0].chinese + a[0].maths)) {\n      temp = a[0];\n      a[0] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].chinese + a[0].maths);\n\n  for (i = 2; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[1].chinese + a[1].maths)) {\n      temp = a[1];\n      a[1] = a[i];\n      a[i] = temp;\n    }\n  }\n  printf(\"%d %d\\n\", a[1].num, a[1].chinese + a[1].maths);\n\n  for (i = 3; i < n; i++) {\n    if ((a[i].chinese + a[i].maths) > (a[2].chinese + a[2].maths)) {\n      temp = a[2];\n      a[2] = a[i];\n      a[i] = temp;\n    }\n  }\n  cout << a[2].num << \" \" << a[2].chinese + a[2].maths << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int n, i, sum[100000], temp[3], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 0, max = -1, temp[0] = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      temp[0] = i;\n    }\n  }\n  for (i = 0, max = -1, temp[1] = 0; i < n; i++) {\n    if (i == temp[0])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[1] = i;\n      }\n    }\n  }\n  for (i = 0, max = -1, temp[2] = 0; i < n; i++) {\n    if (i == temp[0] || i == temp[1])\n      continue;\n    else {\n      if (sum[i] > max) {\n        max = sum[i];\n        temp[2] = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[temp[0]].id, sum[temp[0]]);\n  printf(\"%d %d\\n\", stu[temp[1]].id, sum[temp[1]]);\n  printf(\"%d %d\", stu[temp[2]].id, sum[temp[2]]);\n  return 0;\n}\n"}
{"label": "14", "index": "26072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num;\n  cin >> num;\n  struct {\n    int No;\n    int Chinese;\n    int Math;\n    int Sum;            \n  } student[100000], t; \n  int i, j;\n  for (i = 0; i < num; i++) {\n    cin >> student[i].No >> student[i].Chinese >> student[i].Math;\n    student[i].Sum = student[i].Math + student[i].Chinese;\n  }\n  for (i = 0; i < 3; i++) \n    for (j = 0; j < num - 1 - i; j++) {\n      if (student[j].Sum >= student[j + 1].Sum) {\n        t = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = t;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    cout << student[num - i - 1].No << \" \" << student[num - i - 1].Sum\n         << endl; \n  return 0;\n}\n"}
{"label": "14", "index": "26073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int chi;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].chi, &student[i].math);\n    a[i] = student[i].chi + student[i].math;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          break;\n      }\n      if (j == n && a[i] >= a[j - 1]) {\n        printf(\"%d %d\\n\", student[i].ID, a[i]);\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    long num;\n    int chinese;\n    int math;\n  };\n  struct student stu[100001];\n  int i, t, h, l = 0;\n  long n;\n  int a[100001];\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  for (i = 0; i < n; i++)\n    a[i] = stu[i].chinese + stu[i].math;\nleap:\n  t = a[0];\n  h = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] > t) {\n      t = a[i];\n      h = i;\n    }\n  }\n  cout << stu[h].num << \" \" << a[h] << \"\\n\";\n  l++;\n  a[h] = 0;\n  if (l < 3)\n    goto leap;\n}\n"}
{"label": "14", "index": "26075", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num, cn, math, sum, rank;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(void) {\n  int i = 1;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n  head = p1;\n  do {\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n    p2->next = p1;\n    i++;\n  } while (1);\n  p2->next = 0;\n  return (head);\n}\n\nvoid count(struct student *head) {\n  int max = 0;\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    p1->sum = p1->cn + p1->math;\n    if (max < p1->sum)\n      max = p1->sum;\n    if (p1->next == 0)\n      break;\n    p1 = p1->next;\n  } while (1);\n  p1 = head;\n  do {\n    if (p1->sum == max) {\n      p1->rank = n;\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0) {\n      p1 = head;\n      max--;\n    } else\n      p1 = p1->next;\n  } while (1);\n}\n\nvoid print(struct student *head) {\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    if (p1->rank == n) {\n      printf(\"%d %d \", p1->num, p1->sum);\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0)\n      p1 = head;\n    else\n      p1 = p1->next;\n  } while (1);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  count(head);\n  print(head);\n}\n"}
{"label": "14", "index": "26076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  int ID;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i, *sum, max, p = 0;\n  struct score *s;\n  cin >> n;\n  s = (struct score *)malloc(sizeof(struct score) * n);\n  sum = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &s[i].ID, &s[i].chinese, &s[i].math);\n  for (i = 0; i < n; i++)\n    *(sum + i) = s[i].chinese + s[i].math;\n  max = sum[0];\n  for (i = 0; i < n; i++) {\n    if (max < *(sum + i)) {\n      max = *(sum + i);\n      p = i;\n    }\n  }\n  printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n  if (n > 1) {\n    max = *sum;\n    *(sum + p) = 0;\n    p = 0;\n    for (i = 0; i < n; i++) {\n      if (max < *(sum + i)) {\n        max = *(sum + i);\n        p = i;\n      }\n    }\n    cout << s[p].ID << \" \" << *(sum + p) << \"\\n\";\n    if (n > 2) {\n      max = *sum;\n      *(sum + p) = 0;\n      p = 0;\n      for (i = 0; i < n; i++) {\n        if (max < *(sum + i)) {\n          max = *(sum + i);\n          p = i;\n        }\n      }\n      printf(\"%d %d\\n\", s[p].ID, *(sum + p));\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26077", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int Chinese;\n  int math;\n  int sum;\n};\n\nint main() {\n  int i, n, p, q, r, b = 0, c = 0, d = 0;\n  struct student a[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].Chinese, &a[i].math);\n    a[i].sum = a[i].Chinese + a[i].math;\n    if (i == 0)\n      p = q = r = a[i].sum;\n    else {\n      if (a[i].sum > p) {\n        r = q;\n        q = p;\n        p = a[i].sum;\n        d = c;\n        c = b;\n        b = i;\n      } else if (a[i].sum > q) {\n        r = q;\n        q = a[i].sum;\n        d = c;\n        c = i;\n      } else if (a[i].sum > r) {\n        r = a[i].sum;\n        d = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a[b].num, a[b].sum, a[c].num, a[c].sum,\n         a[d].num, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int m;\n  int c;\n  int sum;\n};\n\nint main() {\n  long int n;\n  int a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  struct stu student[65535];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].num, &student[i].c, &student[i].m);\n    student[i].sum = student[i].m + student[i].c;\n  }\n  for (int i = 0; i < n; i++) {\n    if (student[i].sum > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = student[i].sum;\n      x = student[i].num;\n      continue;\n    }\n    if (student[i].sum > b) {\n      c = b;\n      z = y;\n      b = student[i].sum;\n      y = student[i].num;\n      continue;\n    }\n    if (student[i].sum > c) {\n      c = student[i].sum;\n      z = student[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, a, y, b, z, c);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  };\n  struct student *fig;\n  fig = (struct student *)malloc(sizeof(student) * n);\n  int i, a = 0, b = 0, c = 0, numa = 0, numb = 0, numc = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &(fig + i)->num, &(fig + i)->chi, &(fig + i)->math);\n    (fig + i)->sum = (fig + i)->chi + (fig + i)->math;\n    if ((fig + i)->sum > a) {\n      c = b;\n      numc = numb;\n      b = a;\n      numb = numa;\n      a = (fig + i)->sum;\n      numa = (fig + i)->num;\n    } else if ((fig + i)->sum > b) {\n      c = b;\n      numc = numb;\n      b = (fig + i)->sum;\n      numb = (fig + i)->num;\n    } else if ((fig + i)->sum > c) {\n      c = (fig + i)->sum;\n      numc = (fig + i)->num;\n    }\n  }\n  cout << numa << \" \" << a << \"\\n\"\n       << numb << \" \" << b << \"\\n\"\n       << numc << \" \" << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct inf {\n  int nu;\n  int b;\n  int c;\n  int sum;\n} a[100010], tmp;\nint main() {\n  int n, i, j, k, tmp1, tmp2;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    a[i - 1].sum = 0;\n    scanf(\"%d%d%d\", &a[i - 1].nu, &a[i - 1].b, &a[i - 1].c);\n    a[i - 1].sum = a[i - 1].b + a[i - 1].c;\n  }\n  for (i = 0; i < 3; i++) {\n    tmp1 = i;\n    tmp2 = a[i].sum;\n    for (j = i + 1; j < n; j++) {\n      if (a[j].sum > tmp2) {\n        tmp2 = a[j].sum;\n        tmp1 = j;\n      }\n    }\n    tmp = a[i];\n    a[i] = a[tmp1];\n    a[tmp1] = tmp;\n  }\n  for (i = 0; i < 3; i++)\n    cout << a[i].nu << \" \" << a[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int stuno;\n    int score1;\n    int score2;\n    int score0;\n  };\n  int n, i, j, temp;\n  cin >> n;\n  struct student num[n];\n  for (i = 0; i < n; i++) {\n    cin >> num[i].stuno;\n    cin >> num[i].score1;\n    cin >> num[i].score2;\n    num[i].score0 = num[i].score1 + num[i].score2;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (num[i].score0 < num[j].score0) {\n        temp = num[i].score0;\n        num[i].score0 = num[j].score0;\n        num[j].score0 = temp;\n        temp = num[i].stuno;\n        num[i].stuno = num[j].stuno;\n        num[j].stuno = temp;\n      }\n  for (i = 0; i < 3 && i < n; i++)\n    printf(\"%d %d\\n\", num[i].stuno, num[i].score0);\n  return 0;\n}\n"}
{"label": "14", "index": "26082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct score {\n  int id;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  score *p[100000], *temp, stu[100000];\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p[i] = &stu[i];\n    cin >> p[i]->id >> p[i]->chinese >> p[i]->maths;\n    p[i]->sum = p[i]->chinese + p[i]->maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (p[j]->sum > p[j - 1]->sum) {\n        temp = p[j];\n        p[j] = p[j - 1];\n        p[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    cout << p[i]->id << \" \" << p[i]->sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26083", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct info {\n  char num[10];\n  int chn;\n  int math;\n  struct info *next;\n};\nint n, all;\nstruct info *setup(void) {\n  struct info *head, *p1, *p2;\n  n = 0;\n  while (n < all) {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%s %d %d\", p1->num, &p1->chn, &p1->math);\n    n += 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n\n  struct info *p;\n  int i, first = 0, second = 0, third = 0;\n  char fnum[10], snum[10], tnum[10];\n  scanf(\"%d\", &all);\n  p = setup();\n  do {\n    if (1000 > first) {\n      third = second;\n      second = first;\n      first = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, fnum);\n      strcpy(fnum, \"\");\n      strcat(fnum, p->num);\n    } else if (1000 > second) {\n      third = second;\n      second = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, snum);\n      strcpy(snum, \"\");\n      strcat(snum, p->num);\n    } else if (1000 > third) {\n      third = 1000;\n      strcpy(tnum, \"\");\n      strcat(tnum, p->num);\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%s %d %s %d %s %d \", fnum, first, snum, second, tnum, third);\n}\n"}
{"label": "14", "index": "26084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    char id[9];\n    int chn;\n    int math;\n    int both;\n    struct stu *next;\n  };\n  int n, i;\n  cin >> n;\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = (struct stu *)malloc(sizeof(struct stu));\n      p1 = head;\n    } else {\n      p1->next = (struct stu *)malloc(sizeof(struct stu));\n      p1 = p1->next;\n    }\n    scanf(\"%s%d%d\", p1->id, &p1->chn, &p1->math);\n    p1->both = p1->chn + p1->math;\n  }\n  p1->next = NULL;\n  int max;\n  for (i = 0; i < 3; i++) {\n    max = head->both;\n    p1 = head;\n    do {\n      p1 = p1->next;\n      if (max < p1->both) {\n        max = p1->both;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    cout << p2->id << \" \" << p2->both << \"\\n\";\n    p2->both = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n};\nint main() {\n  struct Student *p1, *top1, *top2, *top3, *temp;\n  int i;\n  long int n;\n  scanf(\"%ld\", &n);\n\n  top1 = (struct Student *)malloc(sizeof(struct Student));\n  top2 = (struct Student *)malloc(sizeof(struct Student));\n  top3 = (struct Student *)malloc(sizeof(struct Student));\n  temp = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &top1->id, &top1->chn, &top1->mth);\n  top1->total = top1->chn + top1->mth;\n  scanf(\"%d %d %d\", &top2->id, &top2->chn, &top2->mth);\n  top2->total = top2->chn + top2->mth;\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  scanf(\"%d %d %d\", &top3->id, &top3->chn, &top3->mth);\n  top3->total = top3->chn + top3->mth;\n  if (top3->total > top2->total) {\n    temp = top3;\n    top3 = top2;\n    top2 = temp;\n  }\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  for (i = 3; i < n; i++) {\n    p1 = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &p1->id, &p1->chn, &p1->mth);\n    p1->total = p1->chn + p1->mth;\n    if (top1->total < p1->total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = p1;\n      continue;\n    }\n    if (top2->total < p1->total) {\n      top3 = top2;\n      top2 = p1;\n      continue;\n    }\n    if (top3->total < p1->total) {\n      top3 = p1;\n      continue;\n    }\n    free(p1);\n  }\n  cout << top1->id << \" \" << top1->total << \"\\n\"\n       << top2->id << \" \" << top2->total << \"\\n\"\n       << top3->id << \" \" << top3->total << \"\\n\";\n}\n"}
{"label": "14", "index": "26086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } score[100000];\n  for (int i = 0; i < n; i++) {\n    cin >> score[i].ID >> score[i].chinese >> score[i].math;\n    score[i].total = score[i].chinese + score[i].math;\n  }\n  for (int i = 0; i < 3; i++)\n    for (int j = n - 1; j > 0; j--)\n      if (score[j].total > score[j - 1].total) {\n        struct student temp = score[j];\n        score[j] = score[j - 1];\n        score[j - 1] = temp;\n      }\n  if (n == 2)\n    for (int i = 0; i < n; i++)\n      printf(\"%d%d\\n\", score[i].ID, score[i].total);\n  else {\n    for (int i = 0; i < 3; i++)\n      cout << score[i].ID << ' ' << score[i].total << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, i, n, m = 0, j = 0, k = 0, s, l1, l2, l3;\n  int a[100000], b[100000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x, &(a[i]), &(b[i]));\n    s = a[i] + b[i];\n    if (s > m) {\n\n      j = m;\n      m = s;\n      l2 = l1;\n      l1 = i;\n    } else if (s > j) {\n      k = j;\n      j = s;\n      l3 = l2;\n      l2 = i;\n    } else if (s > k) {\n      k = s;\n      l3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", l1, m);\n  printf(\"%d %d\\n\", l2, j);\n  printf(\"%d %d\\n\", l3, k);\n  return 0;\n}\n"}
{"label": "14", "index": "26088", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int sum;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max = 0, maxj = 0;\n  if (n >= 3) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n    stu[maxj].sum = 0;\n    max = 0;\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        maxj = i;\n      }\n    cout << stu[maxj].num << ' ' << stu[maxj].sum << endl;\n  } else {\n    if (stu[0].sum > stu[1].sum)\n      cout << stu[0].num << ' ' << stu[0].sum << endl\n           << stu[1].num << ' ' << stu[1].sum;\n    else\n      cout << stu[1].num << ' ' << stu[1].sum << endl\n           << stu[0].num << ' ' << stu[0].sum;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int ID;\n    int ch, math;\n    int sum;\n  } a[100000];\n  int n, m1, m2, m3, x, y, z;\n  scanf(\"%d\", &n);\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m1 = a[0].ch + a[0].math;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].ch, &a[i].math);\n    a[i].sum = a[i].ch + a[i].math;\n    if (a[i].sum > m1) {\n      m1 = a[i].sum;\n      x = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[x].ID, m1);\n  a[x].ch = a[x].math = a[x].sum = 0;\n  int j;\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m2 = a[0].sum;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %d %d\", &a[j].ID, &a[j].ch, &a[j].math);\n    a[j].sum = a[j].ch + a[j].math;\n    if (a[j].sum > m2) {\n      m2 = a[j].sum;\n      y = j;\n    }\n  }\n  printf(\"%d %d\\n\", a[y].ID, m2);\n  a[y].ch = a[y].math = a[y].sum = 0;\n  int k;\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m3 = a[0].sum;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d %d\", &a[k].ID, &a[k].ch, &a[k].math);\n    a[k].sum = a[k].ch + a[k].math;\n    if (a[k].sum > m3) {\n      m3 = a[k].sum;\n      z = k;\n    }\n  }\n  printf(\"%d %d\\n\", a[z].ID, m3);\n  return 0;\n}\n"}
{"label": "14", "index": "26090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  int a;\n  int sc[2];\n};\nint main() {\n  struct s st[100000];\n  int t = 0, j = 0, max = 0, p[3] = {-1, -1};\n  long n, i;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].sc[0], &st[i].sc[1]);\n    st[i].sc[0] = st[i].sc[0] + st[i].sc[1];\n  }\n  i = 0;\n  while (t < 3) {\n    if (i < n && i != p[0] && i != p[1]) {\n      j = (st[i].sc[0] > max) ? i : j;\n      max = (st[i].sc[0] > max) ? st[i].sc[0] : max;\n      i++;\n    } else if (i < n && (i == p[0] || i == p[1]))\n      i++;\n    else if (i = n) {\n      printf(\"%d %d\\n\", j + 1, max);\n      p[t] = j;\n      t++;\n      j = 0;\n      max = 0;\n      i = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "26091", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct score {\n    int id;\n    int yw;\n    int sx;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n  }\n  for (j = 1; j <= 3; j++) {\n    int e, max = 0;\n    for (i = 0; i <= n - j; i++) {\n      if ((stu[i].yw + stu[i].sx) > (stu[max].yw + stu[max].sx))\n        max = i;\n    }\n    if (max != n - j) {\n      e = stu[max].yw;\n      stu[max].yw = stu[n - j].yw;\n      stu[n - j].yw = e;\n\n      e = stu[max].sx;\n      stu[max].sx = stu[n - j].sx;\n      stu[n - j].sx = e;\n\n      e = stu[max].id;\n      stu[max].id = stu[n - j].id;\n      stu[n - j].id = e;\n    }\n  }\n  for (i = n - 1; i >= n - 2; i--) {\n    printf(\"%d %d\\n\", (stu[i].id), (stu[i].yw + stu[i].sx));\n  }\n  printf(\"%d %d\", (stu[n - 3].id), (stu[n - 3].yw + stu[n - 3].sx));\n  return 0;\n}\n"}
{"label": "14", "index": "26092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct linknode *CreateLinkList();\nvoid DisplayLinkList(struct linknode *linklist1);\nvoid qiansan(struct linknode *linklist2);\nstruct linknode {\n  int id;\n  int chinese;\n  int math;\n  int total;\n  int mark;\n  struct linknode *next;\n};\nint main() {\n  qiansan(CreateLinkList());\n  return 0;\n}\nstruct linknode *CreateLinkList() {\n  long n, i;\n  struct linknode *head, *p;\n  scanf(\"%ld\", &n);\n  head = (struct linknode *)malloc(sizeof(struct linknode));\n  p = head;\n  if (p == NULL) {\n    printf(\"fail\");\n    exit(-1);\n  }\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &p->id, &p->chinese, &p->math);\n    p->total = p->chinese + p->math;\n    p->mark = 0;\n    if (i == n)\n      p->next = NULL;\n    else {\n      p->next = (struct linknode *)malloc(sizeof(struct linknode));\n      p = p->next;\n    }\n  }\n  return head;\n}\nvoid qiansan(struct linknode *linklist2) {\n  struct linknode *head, *p, *max;\n\n  head = linklist2;\n  p = head;\n  max = (struct linknode *)malloc(sizeof(struct linknode));\n  int j;\n  for (j = 1; j <= 3; j++) {\n    p = head;\n    max->total = 0;\n    while (p != NULL) {\n      if (p->total > max->total && p->mark == 0)\n        max = p;\n\n      p = p->next;\n    }\n    max->mark = 1;\n    printf(\"%d %d\\n\", max->id, max->total);\n  }\n}\n"}
{"label": "14", "index": "26093", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[3], n, c, b, d, g[3], i, temp;\n  int j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    g[i] = d;\n    a[i] = b + c;\n  }\n  for (i = 0; i < 3 - 1; i++)\n    for (j = 0; j < 3 - 1 - i; j++)\n      if (a[j] < a[j + 1]) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n        temp = g[j];\n        g[j] = g[j + 1];\n        g[j + 1] = temp;\n      }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &d, &b, &c);\n    temp = b + c;\n\n    if (temp <= a[2])\n      continue;\n    else {\n      if (a[1] >= temp) {\n        a[2] = temp;\n        g[2] = d;\n      } else {\n        a[2] = a[1];\n        g[2] = g[1];\n        if (a[0] >= temp) {\n          a[1] = temp;\n          g[1] = d;\n        } else {\n          a[1] = a[0];\n          g[1] = g[0];\n          a[0] = temp;\n          g[0] = d;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", g[0], a[0], g[1], a[1], g[2], a[2]);\n  return 0;\n}\n"}
{"label": "14", "index": "26094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  int m;\n  m = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chi >> p1->math;\n  p1->sum = p1->chi + p1->math;\n  head = p1;\n  while (m < n - 1) {\n    m = m + 1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  struct student *max, *p;\n  for (i = 0; i < 3; i++) {\n    max = head;\n    p = p2 = head;\n    p1 = p2;\n    for (j = 0; j < n - i; j++) {\n      if (p1->sum > max->sum) {\n        max = p1;\n        p = p2;\n      }\n      p2 = p1;\n      p1 = p2->next;\n    }\n    p1 = p2 = head;\n    printf(\"%d %d \", max->num, max->sum);\n    if (max->num == head->num)\n      head = p1->next;\n    else\n      p->next = max->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n, i, j, k;\n  cin >> n;\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yu >> p1->shu;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= 3; i++) {\n    p1 = p2 = head;\n    while (p1 != NULL) {\n      if (p1->yu + p1->shu > p2->yu + p2->shu)\n        p2 = p1;\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << p2->yu + p2->shu << \" \";\n    p2->yu = 0;\n    p2->shu = 0;\n  }\n}\n"}
{"label": "14", "index": "26096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int no;\n  int yuwen;\n  int shuxue;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student *p, *stu, temp;\n  scanf(\"%d\", &n);\n  stu = (struct student *)calloc(n, sizeof(struct student));\n  for (p = stu; p - stu < n; p++) {\n    scanf(\"%d%d%d\", &p->no, &p->yuwen, &p->shuxue);\n    p->total = p->yuwen + p->shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (p = stu + n - 1; p > stu + i; p--) {\n      if (p->total > (p - 1)->total) {\n        temp = *p;\n        *p = *(p - 1);\n        *(p - 1) = temp;\n      }\n    }\n    printf(\"%d %d\\n\", p->no, p->total);\n  }\n  free(stu);\n}\n"}
{"label": "14", "index": "26097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x, y;\n  struct student {\n    int score, num;\n  } a[100000];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> x >> y;\n    a[i].score = x + y;\n  }\n  a[0] = a[1];\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++)\n      if (a[i].score < a[j].score) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  }\n  cout << a[1].num << \" \" << a[1].score << endl\n       << a[2].num << \" \" << a[2].score << endl\n       << a[3].num << \" \" << a[3].score;\n  return 0;\n}\n"}
{"label": "14", "index": "26098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n  };\n  int n, i, x, y, z, o, p, q;\n  scanf(\"%d\", &n);\n  int a[100000];\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    a[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  x = 0;\n  y = 1;\n  z = 2;\n  for (i = 0; i < 3; i++) {\n    if (a[i] >= a[0] && a[i] >= a[1] && a[i] >= a[2]) {\n      x = i;\n      o = a[i];\n      continue;\n    }\n    if (a[i] <= a[0] && a[i] <= a[1] && a[i] <= a[2]) {\n      z = i;\n      q = a[i];\n      continue;\n    }\n    y = i;\n    p = a[i];\n  }\n\n  for (i = 3; i < n; i++) {\n    if (a[i] > q) {\n      if (a[i] > o) {\n        z = y;\n        y = x;\n        x = i;\n        q = p;\n        p = o;\n        o = a[i];\n      } else {\n        if (a[i] > p) {\n          z = y;\n          y = i;\n          q = p;\n          p = a[i];\n        } else {\n          z = i;\n          q = a[i];\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[x].ID, o);\n  cout << stu[y].ID << \" \" << p << \"\\n\";\n  printf(\"%d %d\\n\", stu[z].ID, q);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n, k;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2, *p3;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    cin >> p1->num >> p1->yuwen >> p1->math;\n    p1->total = p1->yuwen + p1->math;\n    p2 = head;\n    if (m == 1) {\n      head = p1;\n      p1->next = 0;\n    } else {\n      k = 0;\n      while (p1->total <= p2->total && p2->next != 0 && k <= 3) {\n        p3 = p2;\n        p2 = p2->next;\n        k++;\n      }\n      if (p1->total > p2->total && k <= 3) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = 0;\n      }\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int t1 = 0;\n  cin >> n;\n  head = creat();\n  p = head;\n  while (t1 < 3) {\n    printf(\"%d %d\\n\", p->num, p->total);\n    p = p->next;\n    t1++;\n  }\n}\n"}
{"label": "14", "index": "26100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int sum;\n  } stu[100000], temp;\n  int total, i, j, chin, math;\n  scanf(\"%d\", &total);\n  for (i = 0; i < total; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &chin, &math);\n    stu[i].sum = chin + math;\n  }\n  for (i = 2; i < 5; i++) {\n    for (j = total - i; j >= 0; j--) {\n      if (stu[j].sum < stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yw;\n    int sx;\n    int all;\n  } student[4] = {0, 0, 0, 0};\n  struct student temp = {0, 0, 0, 0};\n  int i, l, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[3].num, &student[3].yw, &student[3].sx);\n    student[3].all = student[3].yw + student[3].sx;\n\n    if (student[2].all < student[3].all) {\n      temp = student[2];\n      student[2] = student[3];\n      student[3] = temp;\n    }\n    if (student[1].all < student[2].all) {\n      temp = student[1];\n      student[1] = student[2];\n      student[2] = temp;\n    }\n    if (student[0].all < student[1].all) {\n      temp = student[0];\n      student[0] = student[1];\n      student[1] = temp;\n    }\n  }\n  for (l = 0; l < 3; l++)\n    printf(\"%d %d\\n\", student[l].num, student[l].all);\n}\n"}
{"label": "14", "index": "26102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int number, chinese, math, total;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].number, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  int a = stu[0].total, b = stu[0].total, c = stu[0].total;\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > a) {\n      c = b;\n      b = a;\n      a = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < a && stu[i].total > b) {\n      c = b;\n      b = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < b && stu[i].total > c) {\n      c = stu[i].total;\n      continue;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == a) {\n      cout << stu[i].number << \" \" << stu[i].total << \"\\n\";\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == b) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == c) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26103", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  cin >> (*p).num >> (*p).chinese >> (*p).math;\n  (*p).sum = ((*p).chinese + (*p).math);\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      (*p).next = NULL;\n    } else if (i < 4) {\n      for (h = head, j = 0; j < i; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else if (j == i) {\n        (*g).next = p;\n        (*p).next = NULL;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    cin >> (*p).num >> (*p).chinese >> (*p).math;\n    (*p).sum = ((*p).chinese + (*p).math);\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = (*p).next)\n    printf(\"%s %d \", (*p).num, (*p).sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int ID;\n    int math;\n    int chinese;\n    int sum;\n  };\n  int n, i, t, j;\n  cin >> n;\n  struct student stu[n];\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chinese;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n\n      if (stu[j].sum > stu[i].sum) {\n        t = stu[i].sum;\n        stu[i].sum = stu[j].sum;\n        stu[j].sum = t;\n        t = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = t;\n      }\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].ID << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26105", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, c, m;\n  cin >> n;\n  struct student {\n    int id;\n    int total;\n  };\n  struct student stu[n + 1];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> c >> m;\n    stu[i].total = c + m;\n  }\n  for (i = n - 1; i > n - 4; i--)\n    for (j = n - 1; j > n - i - 1; j--) {\n      if (stu[j].total > stu[j - 1].total) {\n        stu[n] = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = stu[n];\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    if (i < n)\n      printf(\"%d %d\\n\", stu[i].id, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int YW;\n    int SX;\n  };\n  struct student stu[100000];\n  int ZF[100000];\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].ID);\n    scanf(\"%d\", &stu[i].YW);\n    scanf(\"%d\", &stu[i].SX);\n    ZF[i] = stu[i].YW + stu[i].SX;\n  }\n  int a = 0, b = 0, c = 0, A = 0, B = 0, C = 0;\n  for (int i = 0; i < n; i++) {\n    if (ZF[i] > a) {\n      c = b;\n      C = B;\n      b = a;\n      B = A;\n      a = ZF[i];\n      A = i;\n    } else if (ZF[i] > b) {\n      c = b;\n      C = B;\n      b = ZF[i];\n      B = i;\n    } else if (ZF[i] > c) {\n      c = ZF[i];\n      C = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[A].ID, a);\n  printf(\"%d %d\\n\", stu[B].ID, b);\n  printf(\"%d %d\\n\", stu[C].ID, c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int count;\n  int yu;\n  int shu;\n} stu[1000000];\nint main() {\n  int n, i, *p, max = 0, sm = 0, tm = 0, j = 0;\n  p = (int *)malloc(1000000 * sizeof(int));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].count, &stu[i].yu, &stu[i].shu);\n    *(p + i) = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < n; i++)\n    max = (max > *(p + i)) ? max : (*(p + i));\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) < max) && (*(p + i) > sm))\n      sm = *(p + i);\n  }\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) > tm) && (*(p + i) < sm))\n      tm = *(p + i);\n  }\n\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == max) {\n      printf(\"%d %d\\n\", stu[i].count, max);\n      j++;\n    }\n  }\n\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == sm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, sm);\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == tm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, tm);\n      j++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, m;\n  scanf(\"%d\\n\", &n);\n  int j, b[100000] = {0}, t, s;\n  struct student {\n    int num;\n    int lang;\n    int math;\n  };\n  struct student a[100000];\n  for (i = 0; i < n; i++)\n    cin >> a[i].num >> a[i].lang >> a[i].math;\n  for (i = 0; i < n; i++)\n    b[i] = a[i].lang + a[i].math;\n  for (j = 0; j < 3; j++)\n    for (i = 1; i < n - j; i++)\n      if (b[j] < b[j + i]) {\n        t = b[j];\n        b[j] = b[j + i];\n        b[j + i] = t;\n      }\n  for (j = 0; j < 3; j++)\n    for (i = 0; i < n; i++) {\n      m = a[i].lang + a[i].math;\n      if (m == b[j] && i != s) {\n        cout << a[i].num << \" \" << m << \"\\n\";\n        s = i;\n        break;\n      }\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "26109", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct score *next;\n};\nint n;\n\nstruct score *creat() {\n  struct score *p1, *p2, *head;\n  head = p2 = (struct score *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->num, &p2->yuwen, &p2->shuxue);\n  p2->total = p2->shuxue + p2->yuwen;\n  n--;\n  while (n--) {\n    p1 = (struct score *)malloc(1000);\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->total = p1->shuxue + p1->yuwen;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nvoid search(struct score *head) {\n  struct score *p;\n  int i, max;\n  for (i = 0; i < 3; i++) {\n    max = 0;\n    p = head;\n    while (p != NULL) {\n      if (p->total > max)\n        max = p->total;\n      p = p->next;\n    }\n    p = head;\n    while (p != NULL) {\n      if (p->total == max) {\n        printf(\"%d %d \", p->num, p->total);\n        p->total = 0;\n        break;\n      }\n      p = p->next;\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  struct score *head;\n  head = creat();\n  search(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k;\n  struct student temp;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > stu[i].total) {\n        k = j;\n        temp = stu[k];\n        stu[k] = stu[i];\n        stu[i] = temp;\n      }\n    }\n    if (i == 3)\n      break;\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].total << \"\\n\";\n}\n"}
{"label": "14", "index": "26111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n};\nstruct student stu[100000];\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n  \n  {\n    max[0] = 0;\n    for (j = 0, k = 0; j < n; j++) {\n      if (sum[j] > max[0]) {\n        max[0] = sum[j];\n        k = j;\n      }\n    }\n  }\n  \n  {\n    max[1] = 0;\n    for (j = 1, m = 0; j < n; j++) {\n      if ((sum[j] > max[1]) && (j != k)) {\n        max[1] = sum[j];\n        m = j;\n      }\n    }\n  }\n  \n  {\n    max[2] = 0;\n    for (j = 1, o = 0; j < n; j++) {\n      if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n        max[2] = sum[j];\n        o = j;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[k].name, sum[k]);\n  printf(\"%d %d\\n\", stu[m].name, sum[m]);\n  printf(\"%d %d\\n\", stu[o].name, sum[o]);\n  return 0;\n}\n"}
{"label": "14", "index": "26112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, max_1 = 0, d, t = 0;\nstruct stu {\n  int id;\n  int chi;\n  int ma;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(void) {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  p2 = p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->chi, &p1->ma);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid find(struct stu *head) {\n  while (t < 3) {\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->chi + p1->ma > max_1) {\n        max_1 = p1->chi + p1->ma;\n        d = p1->id;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d \", d, max_1);\n    t = t + 1;\n    max_1 = 0;\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (p1->id == d) {\n        p1->chi = 0;\n        p1->ma = 0;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n\nint main() {\n  struct stu *head;\n  head = creat();\n  find(head);\n}\n"}
{"label": "14", "index": "26113", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct grade {\n  int No;\n  int chinese;\n  int math;\n  int sum;\n} student[100000], s;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> student[i].No >> student[i].chinese >> student[i].math;\n    student[i].sum = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (student[i].sum < student[j].sum) {\n        s = student[i];\n        student[i] = student[j];\n        student[j] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[i].No, student[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} stu[100000];\nint main() {\n  int sum[100000];\n  long i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    t = 0;\n    for (j = 0; j < n - 1; j++) {\n      if (sum[j + 1] > sum[t])\n        t = j + 1;\n    }\n    cout << stu[t].xuehao << \" \" << sum[t] << \"\\n\";\n    sum[t] = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct {\n    int ID;\n    int ch, math;\n    int sum;\n  } a[100000];\n  int n, m1, m2, m3, x, y, z;\n  scanf(\"%d\", &n);\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m1 = a[0].ch + a[0].math;\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].ID, &a[i].ch, &a[i].math);\n    a[i].sum = a[i].ch + a[i].math;\n    if (a[i].sum > m1) {\n      m1 = a[i].sum;\n      x = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[x].ID, m1);\n  a[x].ch = a[x].math = a[x].sum = 0;\n  int j;\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m2 = a[0].sum;\n  for (j = 0; j < n; j++) {\n    scanf(\"%d %d %d\", &a[j].ID, &a[j].ch, &a[j].math);\n    a[j].sum = a[j].ch + a[j].math;\n    if (a[j].sum > m2) {\n      m2 = a[j].sum;\n      y = j;\n    }\n  }\n  cout << a[y].ID << \" \" << m2 << \"\\n\";\n  a[y].ch = a[y].math = a[y].sum = 0;\n  int k;\n  scanf(\"%d %d %d\", &a[0].ID, &a[0].ch, &a[0].math);\n  m3 = a[0].sum;\n  for (k = 0; k < n; k++) {\n    scanf(\"%d %d %d\", &a[k].ID, &a[k].ch, &a[k].math);\n    a[k].sum = a[k].ch + a[k].math;\n    if (a[k].sum > m3) {\n      m3 = a[k].sum;\n      z = k;\n    }\n  }\n  printf(\"%d %d\\n\", a[z].ID, m3);\n  return 0;\n}\n"}
{"label": "14", "index": "26116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int mathematics;\n    int sum;\n  } temp;\n  struct student stu[100000];\n  int i, j, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].mathematics;\n    stu[i].sum = stu[i].chinese + stu[i].mathematics;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26117", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, y, t, m;\n  struct s {\n    int a;\n    int b;\n    int c;\n  } stu[100000];\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].a >> stu[i].b >> stu[i].c;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((stu[j].b + stu[j].c) > (stu[i].b + stu[i].c)) {\n        y = stu[i].b;\n        t = stu[i].c;\n        m = stu[i].a;\n        stu[i].b = stu[j].b;\n        stu[j].b = y;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        stu[i].a = stu[j].a;\n        stu[j].a = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].a, (stu[i].b + stu[i].c));\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    char id[9];\n    int chn;\n    int math;\n    int both;\n    struct stu *next;\n  };\n  int n, i;\n  cin >> n;\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = (struct stu *)malloc(sizeof(struct stu));\n      p1 = head;\n    } else {\n      p1->next = (struct stu *)malloc(sizeof(struct stu));\n      p1 = p1->next;\n    }\n    scanf(\"%s%d%d\", p1->id, &p1->chn, &p1->math);\n    p1->both = p1->chn + p1->math;\n  }\n  p1->next = NULL;\n  int max;\n  for (i = 0; i < 3; i++) {\n    max = head->both;\n    p1 = head;\n    do {\n      p1 = p1->next;\n      if (max < p1->both) {\n        max = p1->both;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    printf(\"%s %d\\n\", p2->id, p2->both);\n    p2->both = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26119", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct Student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n  struct Student *next;\n};\n\nint main() {\n  int i = 0, n, max;\n  struct Student *linkHead, *linkTail, *student, *ppre, *pmax, *premax;\n  scanf(\"%d\", &n);\n  linkHead = linkTail = NULL;\n  while (i < n) {\n    student = (struct Student *)malloc(1000);\n\n    scanf(\"%d %d %d\", &student->number, &student->math, &student->chinese);\n\n    student->total = student->math + student->chinese;\n\n    student->next = NULL;\n    if (linkTail == NULL)\n\n      linkHead = linkTail = student;\n    else {\n\n      linkTail->next = student;\n      linkTail = student;\n    }\n\n    i++;\n  }\n  i = 0;\n  while (i < 3) {\n    student = linkHead;\n    ppre = student;\n\n    max = 0;\n    pmax = linkHead;\n    premax = linkHead;\n\n    while (student != NULL) {\n\n      if (student->total > max) {\n        max = student->total;\n        pmax = student;\n        premax = ppre;\n      }\n      ppre = student;\n      student = student->next;\n    }\n\n    printf(\"%d %d \", pmax->number, pmax->total);\n\n    if (pmax == linkHead) {\n      linkHead = student->next;\n    } else\n      premax->next = pmax->next;\n\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int tol;\n  struct student *next;\n};\n\nint main() {\n  struct student *p1, *p2, *head;\n  struct student *p, *a, *b, *c;\n  struct student temp;\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->chi >> p1->mat;\n    p1->tol = p1->chi + p1->mat;\n    if (i == 0)\n      head = p2 = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p = head;\n  temp.tol = 0;\n  a = b = c = &temp;\n  while (p != NULL) {\n    if (p->tol > a->tol) {\n      c = b;\n      b = a;\n      a = p;\n    } else if (p->tol > b->tol) {\n      c = b;\n      b = p;\n    } else if (p->tol > c->tol)\n      c = p;\n    p = p->next;\n  }\n  printf(\"%d %d \", a->num, a->tol);\n  printf(\"%d %d \", b->num, b->tol);\n  printf(\"%d %d \", c->num, c->tol);\n  return 0;\n}\n"}
{"label": "14", "index": "26121", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int shu;\n  int yu;\n  int he;\n};\nstruct stu stu[100000];\nint main() {\n  int n, i, max, sec, th;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].id >> stu[i].shu >> stu[i].yu;\n    stu[i].he = stu[i].shu + stu[i].yu;\n  }\n  max = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[max].he < stu[i + 1].he)\n      max = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[max].id, stu[max].he);\n  stu[max].he = 0;\n  sec = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[sec].he < stu[i + 1].he)\n      sec = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[sec].id, stu[sec].he);\n  stu[sec].he = 0;\n  th = 1;\n  for (i = 1; i < n; i++) {\n    if (stu[th].he < stu[i + 1].he)\n      th = i + 1;\n  }\n  printf(\"%d %d\\n\", stu[th].id, stu[th].he);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int *p1, *p2;\n  p1 = (int *)elem1;\n  p2 = (int *)elem2;\n  return (*p2) - (*p1);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n], b[n], c[n], d[n], e[n];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n    d[i] = b[i] + c[i];\n    e[i] = d[i];\n  }\n  qsort(e, n, 4, pfCompare);\n  for (int k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (d[i] == e[k]) {\n        printf(\"%d %d\\n\", a[i], d[i]);\n        d[i] = 0;\n        break;\n      }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26123", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int i, num;\n  struct student stu[100000];\n  int max_0 = 0, max_1 = 0, max_2 = 0;\n  int max_0_id, max_1_id, max_2_id;\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    cin >> (stu[i].id) >> (stu[i].chinese) >> (stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n    if (stu[i].total > max_0) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = max_0;\n      max_1_id = max_0_id;\n      max_0 = stu[i].total;\n      max_0_id = stu[i].id;\n    } else if (stu[i].total > max_1) {\n\n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = stu[i].total;\n      max_1_id = stu[i].id;\n    } else if (stu[i].total > max_2) {\n      max_2 = stu[i].total;\n      max_2_id = stu[i].id;\n    }\n  }\n\n  printf(\"%d %d\\n\", max_0_id, max_0);\n  printf(\"%d %d\\n\", max_1_id, max_1);\n  printf(\"%d %d\\n\", max_2_id, max_2);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26124", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint k[99999];\n\nint x[99999];\nint main() {\n  int n, i, a, b, c, j, r, t, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a >> b >> c;\n    k[a - 1] = b + c;\n    x[i] = a;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (r = 0; r < j; r++) {\n      if (k[r] >= k[r + 1]) {\n        t = k[r + 1];\n        k[r + 1] = k[r];\n        k[r] = t;\n        t = x[r + 1];\n        x[r + 1] = x[r];\n        x[r] = t;\n      }\n    }\n    m++;\n    if (m > 3)\n      break;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x[n - 1], k[n - 1], x[n - 2], k[n - 2],\n         x[n - 3], k[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26125", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct st {\n  int I;\n  int c;\n  int m;\n} st[100000];\n\nint main() {\n  int n, i, j, k = 0, a, b;\n  cin >> n;\n  for (i = 0; i < n; i++)\n\n  {\n\n    cin >> st[i].I >> st[i].c >> st[i].m;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (k < st[j].c + st[j].m) {\n        k = st[j].c + st[j].m;\n        a = st[j].I;\n        b = j;\n      }\n    }\n\n    st[b].c = 0;\n    st[b].m = 0;\n\n    printf(\"%d %d\", a, k);\n    if (i < 2)\n      printf(\"\\n\");\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, math, chinese, std_num;\n  int first, second, third;\n  int score[3] = {-1, -1, -1};\n  scanf(\"%d\", &n);\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    cin >> std_num;\n    scanf(\"%d\", &chinese);\n    scanf(\"%d\", &math);\n    if (chinese + math > score[0]) {\n      third = second;\n      second = first;\n      score[2] = score[1];\n      score[1] = score[0];\n      first = std_num;\n      score[0] = chinese + math;\n    } else if (chinese + math > score[1]) {\n      third = second;\n      score[2] = score[1];\n      second = std_num;\n      score[1] = math + chinese;\n    } else if (chinese + math > score[2]) {\n      third = std_num;\n      score[2] = math + chinese;\n    }\n  }\n  cout << first << \" \" << score[0] << \"\\n\";\n  printf(\"%d %d\\n\", second, score[1]);\n  printf(\"%d %d\\n\", third, score[2]);\n  return 0;\n}\n"}
{"label": "14", "index": "26127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int mathematics;\n    int sum;\n  } temp;\n  struct student stu[100000];\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].mathematics);\n    stu[i].sum = stu[i].chinese + stu[i].mathematics;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID, Chinese, math, sum;\n  } stu[100000], temp1, temp2, temp3;\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].ID, &stu[i].Chinese, &stu[i].math);\n    stu[i].sum = stu[i].Chinese + stu[i].math;\n  }\n  temp1 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp1.sum)\n      temp1 = stu[i];\n  printf(\"%d %d\\n\", temp1.ID, temp1.sum);\n  if (temp1.ID == stu[0].ID)\n    temp2 = stu[1];\n  else\n    temp2 = stu[0];\n  for (i = 1; i < n - 1; i++) {\n    if (stu[i].ID == temp1.ID)\n      continue;\n    else if (stu[i].sum > temp2.sum)\n      temp2 = stu[i];\n  }\n  printf(\"%d %d\\n\", temp2.ID, temp2.sum);\n  for (i = 0; i < n; i++)\n    if (stu[i].ID == temp1.ID || stu[i].ID == temp2.ID)\n      stu[i].sum = 0;\n  temp3 = stu[0];\n  for (i = 1; i < n - 1; i++)\n    if (stu[i].sum > temp3.sum)\n      temp3 = stu[i];\n  printf(\"%d %d\\n\", temp3.ID, temp3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26129", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n, k;\n\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n\n  int m;\n  m = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n  head = p1;\n  while (m < n - 1) {\n    m = m + 1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n\n  struct student *max, *p;\n\n  for (i = 0; i < 3; i++) {\n    max = head;\n    p = p2 = head;\n    p1 = p2;\n    for (j = 0; j < n - i; j++) {\n      if (p1->sum > max->sum) {\n        max = p1;\n        p = p2;\n      }\n      p2 = p1;\n      p1 = p2->next;\n    }\n    p1 = p2 = head;\n    printf(\"%d %d \", max->num, max->sum);\n    if (max->num == head->num)\n      head = p1->next;\n    else\n      p->next = max->next;\n  }\n}\n"}
{"label": "14", "index": "26130", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, zf[100000];\n  struct student {\n    int name;\n    int yw;\n    int sx;\n\n  } stu[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].name, &stu[i].yw, &stu[i].sx);\n    zf[i] = stu[i].yw + stu[i].sx;\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (zf[i] >= zf[i + 1]) {\n        a = zf[i];\n        zf[i] = zf[i + 1];\n        zf[i + 1] = a;\n        a = stu[i].name;\n        stu[i].name = stu[i + 1].name;\n        stu[i + 1].name = a;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].name, zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct result \n{\n  int num;\n  int chn;\n  int math;\n  int total;\n};\nint main() {\n  int n, k;\n  cin >> n;\n  struct result student[n + 1]; \n  for (k = 1; k <= n; k++) {\n    cin >> student[k].num >> student[k].chn >> student[k].math; \n    student[k].total = student[k].chn + student[k].math;        \n  }\n  int i, j;\n  struct result temp;\n  for (i = 1; i < 4; i++)\n    for (j = 1; j <= n - i; j++) \n    {\n      if (student[j].total >= student[j + 1].total) {\n        temp = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = temp;\n      }\n    }\n  cout << student[n].num << \" \" << student[n].total << endl;\n  cout << student[n - 1].num << \" \" << student[n - 1].total << endl;\n  cout << student[n - 2].num << \" \" << student[n - 2].total << endl;\n\n  return 0;\n}\n"}
{"label": "14", "index": "26132", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n\n  for (i = 0; i < m - 1; i++)\n\n  {\n\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "26133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct grades {\n    int id;\n    int yuwen, shuxue;\n    int zongfen;\n  } grades[100007];\n  int i, n, j, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> grades[i].id >> grades[i].yuwen >> grades[i].shuxue;\n\n    grades[i].zongfen = grades[i].yuwen + grades[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (grades[j].zongfen >= grades[j + 1].zongfen) {\n        t = grades[j].zongfen;\n        grades[j].zongfen = grades[j + 1].zongfen;\n        grades[j + 1].zongfen = t;\n        s = grades[j].id;\n        grades[j].id = grades[j + 1].id;\n        grades[j + 1].id = s;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", grades[i].id, grades[i].zongfen);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num, cn, math, sum, rank;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(void) {\n  int i = 1;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n  head = p1;\n  do {\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n    p2->next = p1;\n    i++;\n  } while (1);\n  p2->next = 0;\n  return (head);\n}\n\nvoid count(struct student *head) {\n  int max = 0;\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    p1->sum = p1->cn + p1->math;\n    if (max < p1->sum)\n      max = p1->sum;\n    if (p1->next == 0)\n      break;\n    p1 = p1->next;\n  } while (1);\n  p1 = head;\n  do {\n    if (p1->sum == max) {\n      p1->rank = n;\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0) {\n      p1 = head;\n      max--;\n    } else\n      p1 = p1->next;\n  } while (1);\n}\n\nvoid print(struct student *head) {\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    if (p1->rank == n) {\n      printf(\"%d %d \", p1->num, p1->sum);\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0)\n      p1 = head;\n    else\n      p1 = p1->next;\n  } while (1);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  count(head);\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int maths;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student s, s1, s2, s3;\n  scanf(\"%d\", &n);\n  s2.total = s1.total = s3.total = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.chinese, &s.maths);\n    s.total = s.chinese + s.maths;\n    if (s.total > s1.total) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.total > s2.total) {\n      s3 = s2;\n      s2 = s;\n    } else {\n      if (s.total > s3.total) {\n        s3 = s;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.id, s1.total);\n  cout << s2.id << \" \" << s2.total << \"\\n\";\n  printf(\"%d %d\\n\", s3.id, s3.total);\n}\n"}
{"label": "14", "index": "26136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct score {\n    int ID;\n    int c;\n    int m;\n  };\n  int n, k, t, r;\n  int j;\n  cin >> n;\n  int sum[100000];\n  struct score s[100000];\n  for (int i = 1; i <= n; i++) {\n    cin >> s[i].ID >> s[i].c >> s[i].m;\n    sum[i] = s[i].c + s[i].m;\n  }\n  for (j = 1; j <= 3; j++) {\n    for (k = j; k <= n; k++) {\n      if (sum[k] > sum[j]) {\n        t = sum[j];\n        sum[j] = sum[k];\n        sum[k] = t;\n        r = s[j].ID;\n        s[j].ID = s[k].ID;\n        s[k].ID = r;\n      }\n    }\n  }\n  for (int u = 1; u <= 3; u++) {\n    printf(\"%d %d\\n\", s[u].ID, sum[u]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  double chi;\n  double math;\n  double total;\n};\nint main() {\n  struct student stu[100000];\n  struct student temp;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%lf%lf\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i; j < n; j++) {\n      if (stu[k].total < stu[j].total)\n        k = j;\n    }\n    if (k != i) {\n      temp = stu[i];\n      stu[i] = stu[k];\n      stu[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %.0lf\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26138", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nint student_num;\n\nstruct student *creat() {\n  struct student *p1, *p2, *head;\n  int n = 0;\n  cin >> student_num;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  while (n < student_num) {\n    if (n == 0)\n      head = p1;\n    if (n == student_num - 1)\n      p1->next = NULL;\n    scanf(\"%d %d %d\", &p1->id, &p1->chi, &p1->math);\n    p1->total = p1->chi + p1->math;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    n++;\n  }\n  return head;\n}\n\nint main() {\n  struct student *head, *p;\n  int i, n = 0, first, second, third, firstid, secondid, thirdid;\n  head = creat();\n  first = 0;\n  second = 0;\n  third = 0;\n  p = head;\n  for (i = 1; i <= student_num; i++) {\n    if (p->total > first) {\n      third = second;\n      second = first;\n      first = p->total;\n      thirdid = secondid;\n      secondid = firstid;\n      firstid = p->id;\n    } else if (p->total <= first && p->total > second) {\n      third = second;\n      second = p->total;\n      thirdid = secondid;\n      secondid = p->id;\n    } else if (p->total <= second && p->total > third) {\n      third = p->total;\n      thirdid = p->id;\n    }\n    p = p->next;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", firstid, first, secondid, second, thirdid,\n         third);\n}\n"}
{"label": "14", "index": "26139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  struct Student stu[3], t;\n  stu[0].sum = stu[1].sum = stu[2].sum = 0;\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> t.ID >> t.chinese >> t.maths;\n    t.sum = t.chinese + t.maths;\n\n    if (t.sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = t;\n    } else if (t.sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = t;\n    } else if (t.sum > stu[2].sum)\n      stu[2] = t;\n  }\n\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].ID << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26140", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int no;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000], t;\n  int n, i, j, max, order;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].no >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[i].total;\n    order = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > max) {\n        max = stu[j].total;\n        order = j;\n      }\n    }\n    if (order != i) {\n      t = stu[i];\n      stu[i] = stu[order];\n      stu[order] = t;\n    }\n    printf(\"%d %d\\n\", stu[i].no, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, max, m, c;\n  int a[100000];\n  struct student {\n    int num;\n    int math;\n    int b;\n  } stu1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu1.num, &stu1.math, &stu1.b);\n    a[i] = stu1.math + stu1.b;\n  }\n\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  printf(\"%d %d\\n\", k + 1, a[k]);\n  a[k] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      m = i;\n    }\n  }\n  printf(\"%d %d\\n\", m + 1, a[m]);\n  a[m] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%d %d\", c + 1, a[c]);\n}\n"}
{"label": "14", "index": "26142", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int ch;\n  int ma;\n  int sum;\n  int key;\n\n} stu[100000];\nint main() {\n  int n, i, max = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].ch >> stu[i].ma;\n    stu[i].sum = stu[i].ch + stu[i].ma;\n    stu[i].key = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n}\n"}
{"label": "14", "index": "26143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, max = 0, smax = 0, tmax = 0, id[3] = {0}, a, b, c;\n  struct student {\n    int No;\n    int yuwen;\n    int math;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (max < stu[i].yuwen + stu[i].math) {\n      max = stu[i].yuwen + stu[i].math;\n      id[0] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (smax < stu[i].yuwen + stu[i].math && i != id[0] - 1) {\n      smax = stu[i].yuwen + stu[i].math;\n      id[1] = stu[i].No;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (tmax < stu[i].yuwen + stu[i].math && i != id[0] - 1 && i != id[1] - 1) {\n      tmax = stu[i].yuwen + stu[i].math;\n      id[2] = stu[i].No;\n    }\n  }\n\n  a = id[0];\n  b = id[1];\n  c = id[2];\n\n  printf(\"%d %d\\n\", a, max);\n  cout << b << \" \" << smax << \"\\n\";\n  printf(\"%d %d\\n\", c, tmax);\n}\n"}
{"label": "14", "index": "26144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long a;\n  int x;\n  int y;\n};\nstruct student stu[100000];\nint main() {\n  long n, i, j, p;\n  int m;\n  scanf(\"%ld\", &n);\n  int g[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].a, &stu[i].x, &stu[i].y);\n    g[i] = stu[i].x + stu[i].y;\n  }\n  for (i = 1; i < 4; i++)\n    for (j = n - 1; j >= i; j--) {\n      if (g[j - 1] < g[j]) {\n        m = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = m;\n        p = stu[j - 1].a;\n        stu[j - 1].a = stu[j].a;\n        stu[j].a = p;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].a << \" \" << g[i] << \" \";\n}\n"}
{"label": "14", "index": "26145", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k;\n  struct student temp;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].total = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > stu[i].total) {\n        k = j;\n        temp = stu[k];\n        stu[k] = stu[i];\n        stu[i] = temp;\n      }\n    }\n    if (i == 3)\n      break;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n}\n"}
{"label": "14", "index": "26146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n} student[100000];\nint max(int a, int b) { return (a > b) ? a : b; }\nint min(int a, int b) { return (a < b) ? a : b; }\nint main() {\n  int max(int a, int b);\n  int total[100000];\n  int n, i;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxnum1 = 0, maxnum2 = 0, maxnum3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].yuwen);\n    scanf(\"%d\", &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n    if (total[i] >= max1) {\n      if (total[i] == max1) {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = max(maxnum1, i + 1);\n        maxnum1 = min(maxnum1, i + 1);\n      } else {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = maxnum1;\n        maxnum1 = i + 1;\n      }\n    } else if (total[i] < max1 && total[i] >= max2) {\n\n      if (total[i] == max2) {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = max(maxnum2, i + 1);\n        maxnum2 = min(maxnum2, i + 1);\n      } else {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = i + 1;\n      }\n    } else if (total[i] < max2 && total[i] >= max3) {\n      if (total[i] == max3) {\n        max3 = total[i];\n        maxnum3 = min(i + 1, maxnum3);\n      } else {\n        max3 = total[i];\n        maxnum3 = i + 1;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", maxnum1, max1);\n  printf(\"%d %d\\n\", maxnum2, max2);\n  printf(\"%d %d\", maxnum3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n    struct stu *next;\n  };\n  int n, max, i;\n  struct stu *p1, *p2, *head, *maxsum;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p1 = head;\n  while (p1->next != NULL) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  p1->sum = p1->chinese + p1->math;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    maxsum = p1;\n    while (p1->next != NULL) {\n      if (p1->sum > max) {\n        maxsum = p1;\n        max = p1->sum;\n      }\n      p1 = p1->next;\n    }\n    if (p1->sum > max) {\n      maxsum = p1;\n      max = p1->sum;\n    }\n    printf(\"%d %d \", maxsum->num, maxsum->sum);\n    maxsum->sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int mark1;\n  int mark2;\n  long int total_mark;\n};\n\nint main(void) {\n  int n, i, j, k, t = 0, max;\n  struct stu *p;\n  struct stu *q;\n  scanf(\"%d\", &n);\n  p = (struct stu *)malloc(1000000 * sizeof(struct stu));\n  q = p;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p + i)->num, &(p + i)->mark1, &(p + i)->mark2);\n    (p + i)->total_mark = (p + i)->mark1 + (p + i)->mark2;\n  }\nloop:\n  max = 0;\n  for (j = 0; j < n; j++) {\n    if ((p + j)->total_mark > max)\n      max = (p + j)->total_mark;\n  }\n  for (k = 0; k < n; k++)\n    if (max == (p + k)->total_mark && k < n) {\n      printf(\"%d %ld\\n\", (p + k)->num, (p + k)->total_mark);\n      t++;\n      (p + k)->total_mark = 0;\n      break;\n    }\n  if (t < 3)\n    goto loop;\n}\n"}
{"label": "14", "index": "26149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct ace {\n  char id[10];\n  int a;\n  int b;\n} o[3], r;\n\nint main() {\n  int n, i, s[3], m, j, v;\n  char z[10];\n  scanf(\"%d\", &n);\n\n  scanf(\"%s %d %d\", o[0].id, &o[0].a, &o[0].b);\n  scanf(\"%s %d %d\", o[1].id, &o[1].a, &o[1].b);\n  scanf(\"%s %d %d\", o[2].id, &o[2].a, &o[2].b);\n  s[0] = o[0].a + o[0].b;\n  s[1] = o[1].a + o[1].b;\n  s[2] = o[2].a + o[2].b;\n  for (i = 0; i < 2; i++) {\n    for (j = i + 1; j < 3; j++) {\n      if (s[i] < s[j]) {\n        strcpy(z, o[i].id);\n        strcpy(o[i].id, o[j].id);\n        strcpy(o[j].id, z);\n        v = s[i];\n        s[i] = s[j];\n        s[j] = v;\n      }\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    scanf(\"%s %d %d\", r.id, &r.a, &r.b);\n    m = r.a + r.b;\n    if (m > s[0]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = o[0];\n      s[1] = s[0];\n      o[0] = r;\n      s[0] = m;\n    } else if (m <= s[0] && m > s[1]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = r;\n      s[1] = m;\n    } else if (m <= s[1] && m > s[2]) {\n      o[2] = r;\n      s[2] = m;\n    }\n  }\n  printf(\"%s %d\\n\", o[0].id, s[0]);\n  printf(\"%s %d\\n\", o[1].id, s[1]);\n  printf(\"%s %d\\n\", o[2].id, s[2]);\n}\n"}
{"label": "14", "index": "26150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct grade {\n  char ID[20];\n  int math, cn;\n};\n\nint main() {\n  int n, i, j, max, m;\n  int *s;\n  struct grade stu[100000];\n  scanf(\"%d\", &n);\n  s = (int *)malloc(n * sizeof(int));\n  if (n == 1) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    printf(\"%s %d\", stu[0].ID, stu[0].math + stu[0].cn);\n  } else if (n == 2) {\n    scanf(\"%s %d %d\", stu[0].ID, &stu[0].math, &stu[0].cn);\n    scanf(\"%s %d %d\", stu[1].ID, &stu[1].math, &stu[1].cn);\n    if (stu[0].math + stu[0].cn > stu[1].math + stu[1].cn) {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    } else {\n      printf(\"%s %d\\n\", stu[0].ID, stu[0].math + stu[0].cn);\n      printf(\"%s %d\\n\", stu[1].ID, stu[1].math + stu[1].cn);\n    }\n  } else if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%s %d %d\", stu[i].ID, &stu[i].math, &stu[i].cn);\n      s[i] = stu[i].math + stu[i].cn;\n    }\n    for (i = 1; i < 4; i++) {\n      max = s[0];\n      for (j = 1; j < n; j++) {\n        if (s[j] > max) {\n          max = s[j];\n          m = j;\n        }\n      }\n      printf(\"%s %d\\n\", stu[m].ID, max);\n      s[m] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000];\n  struct Student temp;\n  int i, n, j, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].chi, &stu[i].math);\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].total >= stu[m + 1].total) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "26152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n, k;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2, *p3;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->math);\n    p1->total = p1->yuwen + p1->math;\n    p2 = head;\n    if (m == 1) {\n      head = p1;\n      p1->next = 0;\n    } else {\n      k = 0;\n      while (p1->total <= p2->total && p2->next != 0 && k <= 3) {\n        p3 = p2;\n        p2 = p2->next;\n        k++;\n      }\n      if (p1->total > p2->total && k <= 3) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = 0;\n      }\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int t1 = 0, t2;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  while (t1 < 3) {\n    printf(\"%d %d\\n\", p->num, p->total);\n    p = p->next;\n    t1++;\n  }\n}\n"}
{"label": "14", "index": "26153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nint main() {\n  int n, m, i, j, t, k;\n  scanf(\"%d\", &n);\n  m = n;\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  int *score = (int *)malloc(sizeof(int) * m);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    score[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < m - 1 - i; j++) {\n      if (score[j] >= score[j + 1]) {\n        t = score[j];\n        score[j] = score[j + 1];\n        score[j + 1] = t;\n        k = stu[j].num;\n        stu[j].num = stu[j + 1].num;\n        stu[j + 1].num = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    cout << stu[i].num << \" \" << score[i] << \"\\n\";\n  }\n  free(stu);\n  free(score);\n  return 0;\n}\n"}
{"label": "14", "index": "26154", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].math >> stu[i].chn;\n    stu[i].sum = stu[i].math + stu[i].chn;\n  }\n  int j;\n  struct student temp;\n  for (j = n - 1; j >= n - 3; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  printf(\"%d %d \", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d \", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d \", stu[n - 3].num, stu[n - 3].sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26155", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n  struct student *head, *p, *p1, *p2, *p3;\n  int n, m1, m2, m3, k;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  m1 = m2 = m3 = 0;\n  if (head != NULL) {\n    do {\n      k = p->chi + p->math;\n      if (k > m1) {\n        m1 = k;\n        p1 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m2) && (p != p1)) {\n        m2 = k;\n        p2 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m3) && (p != p1) && (p != p2)) {\n        m3 = k;\n        p3 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  printf(\"%d %d %d %d %d %d \", p1->num, m1, p2->num, m2, p3->num, m3);\n}\n"}
{"label": "14", "index": "26156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int c;\n  c = *(int *)elem1 - *(int *)elem2;\n  return c;\n}\nstruct student {\n  int num;\n  int x;\n  int y;\n} a[100000];\nint main() {\n  int n, i, j, d = 0, b[100000], c[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].x);\n    cin >> a[i].y;\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].x + a[i].y;\n  }\n  qsort(b, n, sizeof(int), pfCompare);\n  for (j = 0; j < n; j++) {\n    if (b[n - 1] == a[j].x + a[j].y) {\n      printf(\"%d\"\n             \" \"\n             \"%d\",\n             a[j].num, b[n - 1]);\n      printf(\" \");\n      d++;\n    }\n    if (d == 3)\n      break;\n  }\n  for (i = n - 2; i > n - 4; i--) {\n    if (b[i] == b[i + 1])\n      continue;\n    else {\n      for (j = 0; j < n; j++) {\n        if (b[i] == a[j].x + a[j].y) {\n          printf(\"%d\"\n                 \" \"\n                 \"%d\",\n                 a[j].num, b[i]);\n          printf(\" \");\n          d++;\n        }\n        if (d == 3) {\n          break;\n        }\n      }\n      if (d == 3)\n        break;\n    }\n  }\n}\n"}
{"label": "14", "index": "26157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct a {\n  char No[20];\n  int y;\n  int s;\n  struct a *next;\n};\nint n;\nstruct a *creat(void) {\n  struct a *p1, *p2, *head;\n  int i;\n  scanf(\"%d \", &n);\n  p1 = p2 = (struct a *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s %d %d\", p1->No, &p1->y, &p1->s);\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct a *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct a *head, *p1, *p2, *p;\n  int i, j, k, m1, m2;\n  char r[10];\n  head = creat();\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d\", r, j);\n}\n"}
{"label": "14", "index": "26158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int c;\n  int m;\n};\nstruct stu a[100000];\n\nint main(int argc, char *argv[]) {\n  int n, i, x, y, z, t, q, w, e;\n  int b[100000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i].ID);\n    scanf(\"%d \", &a[i].c);\n    scanf(\"%d\", &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n  if (b[0] > b[1] && b[1] > b[2]) {\n    x = b[0];\n    q = 1;\n    y = b[1];\n    w = 1 + 1;\n    z = b[2];\n    e = 2 + 1;\n  } else if (b[1] > b[0] && b[0] > b[2]) {\n    x = b[1];\n    y = b[0];\n    z = b[2];\n    q = 1 + 1;\n    w = 0 + 1;\n    e = 2 + 1;\n  } else if (b[2] > b[1] && b[1] > b[0]) {\n    x = b[2];\n    y = b[1];\n    z = b[0];\n    q = 2 + 1;\n    w = 1 + 1;\n    e = 0 + 1;\n  } else if (b[2] > b[0] && b[0] > b[1]) {\n    x = b[2];\n    y = b[0];\n    z = b[1];\n    q = 2 + 1;\n    w = 0 + 1;\n    e = 1 + 1;\n  } else if (b[1] > b[2] && b[2] > b[0]) {\n    x = b[1];\n    y = b[2];\n    z = b[0];\n    q = 1 + 1;\n    w = 2 + 1;\n    e = 0 + 1;\n  } else if (b[0] > b[2] && b[2] > b[1]) {\n    x = b[0];\n    y = b[2];\n    z = b[1];\n    q = 0 + 1;\n    w = 2 + 1;\n    e = 1 + 1;\n  }\n  for (i = 3; i < n; i++) {\n    if (b[i] > x) {\n      t = x;\n      x = b[i];\n      z = y;\n      y = t;\n      e = w;\n      w = q;\n      q = i + 1;\n    } else if (b[i] > y) {\n      z = y;\n      y = b[i];\n      e = w;\n      w = i + 1;\n    } else if (b[i] > z) {\n      z = b[i];\n      e = i + 1;\n    }\n  }\n  printf(\"%d %d\\n\", q, x);\n  printf(\"%d %d\\n\", w, y);\n  printf(\"%d %d\\n\", e, z);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } score[100000];\n  for (int i = 0; i < n; i++) {\n    cin >> score[i].ID >> score[i].chinese >> score[i].math;\n    score[i].total = score[i].chinese + score[i].math;\n  }\n  for (int i = 0; i < 3; i++)\n    for (int j = n - 1; j > 0; j--)\n      if (score[j].total > score[j - 1].total) {\n        struct student temp = score[j];\n        score[j] = score[j - 1];\n        score[j - 1] = temp;\n      }\n  if (n == 2)\n    for (int i = 0; i < n; i++)\n      cout << score[i].ID << score[i].total << endl;\n  else {\n    for (int i = 0; i < 3; i++)\n      cout << score[i].ID << ' ' << score[i].total << endl;\n  }\n}\n"}
{"label": "14", "index": "26160", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].m >> a[i].x >> a[i].y;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].m, (a[i].x + a[i].y));\n\n  return 0;\n}\n"}
{"label": "14", "index": "26161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int score1;\n  int score2;\n  struct student *next;\n};\nstruct student *head;\nstruct student *creat(int x) {\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n  head = 0;\n  while (p1->id < x) {\n    if (p1->id == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n    if (p1->id == x) {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int n;\n  struct student *p, *q, *j, *k;\n  scanf(\"%d\", &n);\n  creat(n);\n  p = q = head;\n  do {\n    if ((p->score1 + p->score2) > (q->score1 + q->score2))\n      q = p;\n    p = p->next;\n  } while (p != 0);\n  p = j = head;\n  do {\n    if ((p->score1 + p->score2) > (j->score1 + j->score2) && p != q)\n      j = p;\n    p = p->next;\n  } while (p != 0);\n  p = k = head;\n  do {\n    if ((p->score1 + p->score2) > (k->score1 + k->score2) && p != q && p != j)\n      k = p;\n    p = p->next;\n  } while (p != 0);\n  printf(\"%d %d \", q->id, (q->score1 + q->score2));\n  cout << j->id << \" \" << (j->score1 + j->score2) << \" \";\n  cout << k->id << \" \" << (k->score1 + k->score2);\n}\n"}
{"label": "14", "index": "26162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chin;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i, tem, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int max[3] = {0};\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[max[0]].sum) {\n      tem = max[0];\n      temp = max[1];\n      max[0] = i;\n      max[1] = tem;\n      max[2] = temp;\n    } else {\n      if (stu[i].sum > stu[max[1]].sum) {\n        tem = max[1];\n        max[1] = i;\n        max[2] = tem;\n      } else {\n        if (stu[i].sum > stu[max[2]].sum)\n          max[2] = i;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[max[i]].id, stu[max[i]].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26163", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int together;\n} stu[100000], t;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].together = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i; j < n; j++) {\n      if (stu[i].together < stu[j].together) {\n        t = stu[i];\n        stu[i] = stu[j];\n        stu[j] = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].together);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int zong;\n} stu[100001];\n\nint main(int argc, char *argv[]) {\n  int i, n, max1 = 0, max2 = 0, max3 = 0, fir, sec, thi;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yw, &stu[i].sx);\n    stu[i].zong = stu[i].yw + stu[i].sx;\n    if (stu[i].zong > max1) {\n      max3 = max2;\n      thi = sec;\n      max2 = max1;\n      sec = fir;\n      max1 = stu[i].zong;\n      fir = i;\n    } else if (stu[i].zong > max2) {\n      max3 = max2;\n      thi = sec;\n      max2 = stu[i].zong;\n      sec = i;\n    } else if (stu[i].zong > max3) {\n      max3 = stu[i].zong;\n      thi = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[fir].num, stu[fir].zong);\n  printf(\"%d %d\\n\", stu[sec].num, stu[sec].zong);\n  printf(\"%d %d\\n\", stu[thi].num, stu[thi].zong);\n  return 0;\n}\n"}
{"label": "14", "index": "26165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n\n    int id;\n    int chi;\n    int mat;\n    int sum;\n  } stu[100000], t;\n  int i, j, n, student_num;\n  scanf(\"%d\", &student_num);\n  n = student_num;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chi, &stu[i].mat);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  for (i = 0; i < n; i++)\n    if (stu[0].sum < stu[i].sum) {\n      t = stu[0];\n      stu[0] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 1; i < n; i++)\n    if (stu[1].sum < stu[i].sum) {\n      t = stu[1];\n      stu[1] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 2; i < n; i++)\n    if (stu[2].sum < stu[i].sum) {\n      t = stu[2];\n      stu[2] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26166", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int o = 0, oz, t = 0, tz, th = 0;\n  cin >> n;\n  struct {\n    int h, z;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    int h0, x0, y0;\n    cin >> h0 >> x0 >> y0;\n    s[i].h = h0;\n    s[i].z = x0 + y0;\n  }\n  for (i = 0; i < n; i++)\n    if (s[i].z > o)\n      o = s[i].z;\n  for (i = 0; i < n; i++)\n    if (s[i].z == o) {\n      oz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z > t))\n      t = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z == t)) {\n      tz = i;\n      cout << s[i].h << \" \" << s[i].z << \"\\n\";\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z > th))\n      th = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z == th)) {\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "26167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int nID, nChinese, nMath;\n};\nint main() {\n  int n, i, a1, a2, a3, t1, t2, t3, t;\n  struct Student students;\n  t1 = 0;\n  t2 = 0;\n  t3 = 0;\n  a1 = 0;\n  a2 = 0;\n  a3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &students.nID, &students.nChinese, &students.nMath);\n    t = students.nChinese + students.nMath;\n    if (t > t1) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t1;\n      a2 = a1;\n      t1 = t;\n      a1 = students.nID;\n    } else if (t > t2) {\n      t3 = t2;\n      a3 = a2;\n      t2 = t;\n      a2 = students.nID;\n    } else if (t > t3) {\n      t3 = t;\n      a3 = students.nID;\n    }\n  }\n  printf(\"%d%s%d\\n\", a1, \" \", t1);\n  printf(\"%d%s%d\\n\", a2, \" \", t2);\n  printf(\"%d%s%d\\n\", a3, \" \", t3);\n  return 0;\n}\n"}
{"label": "14", "index": "26168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, i, first, second, third, x, y, z;\n  scanf(\"%d\", &n);\n  struct mark {\n    int ID, chinese, math, sum;\n  } * num;\n  num = (struct mark *)malloc(sizeof(mark) * n);\n  int n1, c1, m1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &n1, &c1, &m1);\n    num[i].ID = n1;\n    num[i].chinese = c1;\n    num[i].math = m1;\n    num[i].sum = c1 + m1;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      first = num[i].sum;\n      second = num[i].sum;\n      third = num[i].sum;\n      x = num[i].ID;\n      y = num[i].ID;\n      z = num[i].ID;\n    } else if (i == 1) {\n      if (num[i].sum > first) {\n        first = num[i].sum;\n        x = num[i].ID;\n      } else {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n\n    } else {\n      if (num[i].sum > first) {\n        third = second;\n        z = y;\n        second = first;\n        y = x;\n        first = num[i].sum;\n        x = num[i].ID;\n      } else if (num[i].sum > second) {\n        third = second;\n        z = y;\n        second = num[i].sum;\n        y = num[i].ID;\n      } else if (num[i].sum > third) {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, first, y, second, z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26169", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num - 1) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = p1;\n  p1->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n}\n"}
{"label": "14", "index": "26170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int math;\n  int chi;\n  int num;\n  int sum;\n};\nint main() {\n  int i, j, k, n, t, m;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].math >> stu[i].chi;\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chi;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1, k = i; j < n; j++) {\n      if (stu[j].sum > stu[k].sum)\n        k = j;\n    }\n    t = stu[i].sum;\n    stu[i].sum = stu[k].sum;\n    stu[k].sum = t;\n    m = stu[i].num;\n    stu[i].num = stu[k].num;\n    stu[k].num = m;\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int ID, chin, math;\n  };\n  stu *pp;\n  int sum, second, third, x, y, z;\n  int i, n;\n  int a, b, c;\n  scanf(\"%d\", &n);\n  pp = (struct stu *)malloc(sizeof(stu) * n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a, &b, &c);\n    (pp + i)->ID = a;\n    (pp + i)->chin = b;\n    (pp + i)->math = c;\n  }\n  sum = ((pp + i)->chin) + ((pp + i)->math);\n  for (i = 1; i <= n; i++) {\n    if (i == 1) {\n      sum = ((pp + i)->chin) + ((pp + i)->math);\n      second = ((pp + i)->chin) + ((pp + i)->math);\n      third = ((pp + i)->chin) + ((pp + i)->math);\n      x = (pp + i)->ID;\n      y = (pp + i)->ID;\n      z = (pp + i)->ID;\n\n    } else if (i == 2) {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        y = x;\n        x = (pp + i)->ID;\n      } else {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    } else {\n      if (sum < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = sum;\n        sum = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = x;\n        x = (pp + i)->ID;\n      } else if (second < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = second;\n        second = ((pp + i)->chin) + ((pp + i)->math);\n        z = y;\n        y = (pp + i)->ID;\n      } else if (third < ((pp + i)->chin) + ((pp + i)->math)) {\n        third = ((pp + i)->chin) + ((pp + i)->math);\n        z = (pp + i)->ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x, sum);\n  printf(\"%d %d\\n\", y, second);\n  printf(\"%d %d\\n\", z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26172", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int No;\n    int chinese;\n    int math;\n    int total;\n  } stu[100000];\n  int i, j, x, y, z, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    cin >> stu[i].chinese;\n    scanf(\"%d\", &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    x = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > x) {\n        x = stu[i].total;\n        y = stu[i].No;\n        z = i;\n      }\n    }\n    printf(\"%d %d\\n\", y, x);\n    stu[z].total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26173", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int china;\n  int math;\n};\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  struct student st[n];\n  int i;\n  for (i = 0; i < n; i++)\n    cin >> st[i].No >> st[i].china >> st[i].math;\n\n  int s;\n  int a1 = 0, a2 = 0, a3 = 0, b1 = 0, b2 = 0, b3 = 0;\n  for (i = 0; i < n; i++) {\n    s = st[i].china + st[i].math;\n    if (s > a1) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = a1;\n      b2 = b1;\n      a1 = s;\n      b1 = i;\n      continue;\n    }\n\n    if (s > a2) {\n\n      a3 = a2;\n      b3 = b2;\n      a2 = s;\n      b2 = i;\n      continue;\n    }\n    if (s > a3) {\n      a3 = s;\n      b3 = i;\n      continue;\n    }\n  }\n  cout << st[b1].No << \" \" << a1 << endl;\n  printf(\"%d %d\\n\", st[b2].No, a2);\n  cout << st[b3].No << \" \" << a3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int shuxue;\n  int yuwen;\n  int zongfen;\n};\n\nint main() {\n  int n, i, e, j;\n  scanf(\"%d\", &n);\n\n  struct student stu[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].shuxue, &stu[i].yuwen);\n    stu[i].zongfen = stu[i].shuxue + stu[i].yuwen;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        stu[100000] = stu[j + 1];\n        stu[j + 1] = stu[j];\n        stu[j] = stu[100000];\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].xuehao << \" \" << stu[i].zongfen << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int cs;\n  int ms;\n  int s;\n  struct student *next;\n};\nint main() {\n  int n, i, m = 0;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n  p1->s = p1->cs + p1->ms;\n  head = NULL;\n  while (p1->id != n) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->cs, &p1->ms);\n    p1->s = p1->cs + p1->ms;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    do {\n      p2 = p2->next;\n      if (p1->s < p2->s)\n        p1 = p2;\n    } while (p2->next != NULL);\n    printf(\"%d %d \", p1->id, p1->s);\n    p1->s = -1;\n  }\n}\n"}
{"label": "14", "index": "26176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int math;\n    int chinese;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].math, &a[i].chinese);\n    a[i].sum = a[i].math + a[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  char num[10];\n  int grade[2];\n};\nstruct student stu[100000];\nint main() {\n  int n, sum[100000], i, count, max, j;\n  count = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum[i] = 0;\n    scanf(\"%s %d %d\", stu[i].num, &stu[i].grade[0], &stu[i].grade[1]);\n    sum[i] = stu[i].grade[0] + stu[i].grade[1];\n  }\n  while (count <= 2) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        j = i;\n      }\n    }\n    printf(\"%s %d\\n\", stu[j].num, sum[j]);\n    count++;\n    sum[j] = 0;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  }\n  printf(\"%s %d\", stu[j].num, sum[j]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26178", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, score[100000], max1 = 0, m1 = 0, max2 = 0, m2 = 0, max3 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  struct stu {\n    int No;\n    int yw;\n    int math;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].No, &s[i].yw, &s[i].math),\n        score[i] = s[i].yw + s[i].math;\n    if (score[i] > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = score[i];\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n      continue;\n    }\n    if (score[i] <= max1 && score[i] > max2) {\n      max3 = max2;\n      max2 = score[i];\n      m3 = m2;\n      m2 = i;\n      continue;\n    }\n    if (score[i] <= max2 && score[i] > max3) {\n      max3 = score[i];\n      m3 = i;\n      continue;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s[m1].No, max1, s[m2].No, max2, s[m3].No,\n         max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26179", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> form[i].num >> form[i].chinese >> form[i].math;\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum)\n        k = j;\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26180", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stud {\n  int n;\n  int m;\n  int c;\n  int t;\n} s[100000], temp;\nint main() {\n  int i, j, k, n, p;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].n >> s[i].m >> s[i].c;\n    s[i].t = s[i].m + s[i].c;\n  }\n  for (j = 0; j < 3 && j < n; j++) {\n    for (k = j + 1, p = j; k < n; k++)\n      if (s[p].t < s[k].t) {\n        p = k;\n      }\n    temp = s[j];\n    s[j] = s[p];\n    s[p] = temp;\n    printf(\"%d %d\\n\", s[j].n, s[j].t);\n  }\n}\n"}
{"label": "14", "index": "26181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[99999], b[2], i, k, m, s[99999], first = 0, x, y;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i]);\n    for (k = 0; k < 2; k++) {\n      scanf(\"%d\", &b[k]);\n    }\n    s[i] = b[0] + b[1];\n  }\n\n  for (m = 0; m < 3; m++) {\n    first = 0;\n    for (x = 0; x < n; x++) {\n\n      if (s[x] > first) {\n        first = s[x];\n        y = x + 1;\n      }\n    }\n    cout << y << \" \" << first << \"\\n\";\n    s[y - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main(char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max1 = 2, max2 = 1, max3 = 0, num1 = 0, num2 = 0, num3 = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = stu[i].zongfen;\n      num1 = i;\n    } else if (stu[i].zongfen <= max1 && stu[i].zongfen > max2) {\n      max3 = max2;\n      num3 = num2;\n      max2 = stu[i].zongfen;\n      num2 = i;\n    } else if (stu[i].zongfen <= max2 && stu[i].zongfen > max3) {\n      max3 = stu[i].zongfen;\n      num3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[num1].xuehao, stu[num1].zongfen);\n  printf(\"%d %d\\n\", stu[num2].xuehao, stu[num2].zongfen);\n  printf(\"%d %d\\n\", stu[num3].xuehao, stu[num3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t, z;\n  struct a {\n    int num;\n    int b;\n    int c;\n    int d;\n  } a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].b, &a[i].c);\n    a[i].d = a[i].b + a[i].c;\n  }\n  for (j = 0; j < 2; j++) {\n    for (i = 0; i < 2 - j; i++) {\n      if (a[i].d < a[i + 1].d) {\n        t = a[i].d;\n        z = a[i].num;\n        a[i].d = a[i + 1].d;\n        a[i].num = a[i + 1].num;\n        a[i + 1].d = t;\n        a[i + 1].num = z;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &a[3].num, &a[3].b, &a[3].c);\n    a[3].d = a[3].b + a[3].c;\n    if (a[3].d > a[0].d) {\n      a[2] = a[1];\n      a[1] = a[0];\n      a[0] = a[3];\n    } else if (a[3].d > a[1].d) {\n      a[2] = a[1];\n      a[1] = a[3];\n    } else if (a[3].d > a[2].d) {\n      a[2] = a[3];\n    }\n  }\n  printf(\"%d %d\\n\", a[0].num, a[0].d);\n  printf(\"%d %d\\n\", a[1].num, a[1].d);\n  printf(\"%d %d\\n\", a[2].num, a[2].d);\n  return 0;\n}\n"}
{"label": "14", "index": "26184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\ntypedef struct {\n  int d;\n  int score;\n} student;\n\nint main() {\n  int n, i, temp1, temp2;\n  student a[100002];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].d, &temp1, &temp2);\n    a[i].score = temp1 + temp2;\n  }\n\n  student max1, max2, max3;\n  max1.d = max2.d = max3.d = -1;\n  max1.score = max2.score = max3.score = 0;\n\n  for (i = 0; i < n; i++) {\n    if (a[i].score > max1.score) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a[i];\n    } else if (a[i].score > max2.score) {\n      max3 = max2;\n      max2 = a[i];\n    } else if (a[i].score > max3.score) {\n      max3 = a[i];\n    }\n  }\n\n  cout << max1.d << \" \" << max1.score << \"\\n\";\n  if (max2.d != -1)\n    printf(\"%d %d\\n\", max2.d, max2.score);\n  if (max3.d != -1)\n    printf(\"%d %d\\n\", max3.d, max3.score);\n  return 0;\n}\n"}
{"label": "14", "index": "26185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int i, j, n, t, sum[100000];\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n  sum[0] = p1->b + p1->c;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n    sum[i] = p1->b + p1->c;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (sum[i] < sum[j]) {\n        t = sum[i];\n        sum[i] = sum[j];\n        sum[j] = t;\n      }\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->b + p1->c != sum[i] && p1) {\n      p1 = p1->next;\n    }\n    if (p1) {\n      printf(\"%d %d\\n\", p1->a, sum[i]);\n      p1->b = 0;\n      p1->c = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "26186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  long int n;\n  int i, score[100000], max[3] = {0}, a[3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    score[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (max[0] < score[i]) {\n      max[0] = score[i];\n      a[0] = stu[i].num;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[0])\n      continue;\n    else {\n      if (max[1] < score[i]) {\n        max[1] = score[i];\n        a[1] = stu[i].num;\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].num == a[1] || stu[i].num == a[0]) {\n      continue;\n    } else if (max[2] < score[i]) {\n      max[2] = score[i];\n      a[2] = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], max[i]);\n  }\n}\n"}
{"label": "14", "index": "26187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum[1000000];\nstruct student {\n  int id;\n  int Gra[2];\n} stu[1000000];\nint main() {\n  int n;\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].Gra[0] >> stu[i].Gra[1];\n    sum[i] = stu[i].Gra[0] + stu[i].Gra[1];\n  }\n  int max = 0, imax = 0;\n  for (int i = 0; i < 3; i++) {\n    max = 0;\n    for (int j = 0; j < n; j++)\n      if (max < sum[j]) {\n        max = sum[j];\n        imax = j;\n      }\n\n    cout << stu[imax].id << \" \" << sum[imax] << endl;\n    sum[imax] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26188", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int id;\n    int cp;\n    int mp;\n    int tp;\n  } stu[n], temp;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].cp >> stu[i].mp;\n    stu[i].tp = stu[i].cp + stu[i].mp;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].tp > stu[j - 1].tp) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].tp);\n  return 0;\n}\n"}
{"label": "14", "index": "26189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct student {\n    int number;\n    int maths;\n    int chinese;\n    int sum;\n  };\n  struct student stu[n], t;\n  for (i = 0; i < n; i++) \n  {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].maths;\n    stu[i].sum = stu[i].chinese + stu[i].maths;\n  }\n  for (i = 0; i < 3; i++) \n    for (j = n - 2; j >= i; j--)\n      if (stu[j].sum < stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  if (n >= 3)\n    for (i = 0; i < 3; i++) \n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  else\n    for (i = 0; i < n; i++)\n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  struct score {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct score a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 2; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].verbal, &a[i].math);\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (i = 0; i <= 1; i++)\n    for (j = 1; j <= 2 - i; j++) {\n      if (a[i].verbal + a[i].math < a[i + j].verbal + a[i + j].math) {\n        t = a[i].num;\n        a[i].num = a[i + j].num;\n        a[i + j].num = t;\n        t = a[i].sum;\n        a[i].sum = a[i + j].sum;\n        a[i + j].sum = t;\n      }\n    }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &a[3].num, &a[3].verbal, &a[3].math);\n    if (a[3].verbal + a[3].math > a[0].sum) {\n      t = a[1].num;\n      a[1].num = a[0].num;\n      a[2].num = t;\n      a[0].num = a[3].num;\n      t = a[1].sum;\n      a[1].sum = a[0].sum;\n      a[2].sum = t;\n      a[0].sum = a[3].verbal + a[3].math;\n    } else if (a[3].verbal + a[3].math > a[1].sum) {\n      a[2].num = a[1].num;\n      a[1].num = a[3].num;\n      a[2].sum = a[1].sum;\n      a[1].sum = a[3].verbal + a[3].math;\n    } else {\n      if (a[3].verbal + a[3].math > a[2].sum) {\n        a[2].num = a[3].num;\n        a[2].sum = a[3].verbal + a[3].math;\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n}\n"}
{"label": "14", "index": "26191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int ch;\n  int ma;\n  int sum;\n  int key;\n\n} stu[100000];\nint main() {\n  int n, i, max = 0, l = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].ch >> stu[i].ma;\n    stu[i].sum = stu[i].ch + stu[i].ma;\n    stu[i].key = 0;\n  }\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  cout << l + 1 << \" \" << max << \"\\n\";\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n  for (i = 0; i < n; i++)\n    if (max < stu[i].sum && stu[i].key == 0) {\n      max = stu[i].sum;\n      l = i;\n    }\n  printf(\"%d %d\\n\", l + 1, max);\n  max = 0;\n  stu[l].key = 1;\n  l = 0;\n}\n"}
{"label": "14", "index": "26192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    int b;\n    int c;\n    int d;\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int i, j, k, m, n, t;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct s *)malloc(sizeof(struct s));\n  head = p1;\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = 0;\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p1->d = p1->b + p1->c;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = p1->next;\n    for (i = 0; i < n - 2; i++) {\n      if (p1->d < p2->d) {\n        t = p1->d;\n        p1->d = p2->d;\n        p2->d = t;\n        k = p1->a;\n        p1->a = p2->a;\n        p2->a = k;\n      }\n\n      p2 = p2->next;\n    }\n    p1 = head;\n\n    printf(\"%d %d\\n\", p1->a, p1->d);\n    p1->d = 0;\n  }\n}\n"}
{"label": "14", "index": "26193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1; \n  int score2; \n  int total;\n};\nstruct student stu[100000];\nint main() {\n  long i, m;\n  scanf(\"%ld\", &m);\n  struct student *p = stu;\n  for (i = 0; i < m; i++, p++) {\n    scanf(\"%d%d%d\", &(p->num), &(p->score1), &(p->score2));\n    p->total = (p->score1 + p->score2);\n  }\n  int max1, max2, max3, a1 = 0, a2 = 0, a3 = 0;\n  max1 = stu[0].total;\n  for (i = 0; i < m; i++) {\n    if (stu[i].total > max1) {\n      max1 = stu[i].total;\n      a1 = i;\n    }\n  }\n  max2 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max2 && i != a1) {\n      max2 = stu[i].total;\n      a2 = i;\n    }\n  }\n  max3 = stu[0].total;\n  for (i = 0; i < m; i++) {\n\n    if (stu[i].total > max3 && stu[i].total < max2) {\n      max3 = stu[i].total;\n      a3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[a1].num, stu[a1].total);\n  printf(\"%d %d\\n\", stu[a2].num, stu[a2].total);\n  printf(\"%d %d\", stu[a3].num, stu[a3].total);\n  return 0;\n}\n"}
{"label": "14", "index": "26194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct point {\n  int id, a, b, c;\n} s[100000], tmp;\nint main(int argc, char *argv[]) {\n\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &s[i].a, &s[i].b);\n    s[i].c = s[i].a + s[i].b;\n  }\n  for (i = 1; i < n; i++) {\n    if (s[i].c > s[0].c) {\n      tmp = s[0];\n      s[0] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (s[i].c > s[1].c) {\n      tmp = s[1];\n      s[1] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].c > s[2].c) {\n      tmp = s[2];\n      s[2] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << s[i].id << \" \" << s[i].c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26195", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  struct student {\n    int stuNo;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n  struct tri {\n    int stuNo;\n    int zongfen;\n  } qian[3] = {0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuNo;\n    cin >> stu[i].yuwen;\n    cin >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > qian[0].zongfen) {\n      qian[2] = qian[1];\n      qian[1] = qian[0];\n      qian[0].stuNo = stu[i].stuNo;\n      qian[0].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[1].zongfen) {\n      qian[2] = qian[1];\n      qian[1].stuNo = stu[i].stuNo;\n      qian[1].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[2].zongfen) {\n      qian[2].stuNo = stu[i].stuNo;\n      qian[2].zongfen = stu[i].zongfen;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", qian[i].stuNo, qian[i].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000], e;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].chinese, &a[i].math);\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", a[i].num, a[i].chinese + a[i].math);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int n1;\n  int n2;\n  int n3;\n  struct student *next;\n};\nint main() {\n  struct student *p, *head, *tail;\n  int n, i, sum[100000], max1, max2, max3, k1, k2, k3;\n  scanf(\"%d\", &n);\n  head = NULL;\n  tail = NULL;\n  for (i = 1; i <= n; i++) {\n    p = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p->n1, &p->n2, &p->n3);\n    if (head == NULL)\n      head = tail = p;\n    else {\n      tail->next = p;\n      tail = p;\n    }\n    sum[i] = p->n2 + p->n3;\n  }\n  max1 = sum[1];\n  k1 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      k1 = i;\n    }\n  sum[k1] = 0;\n\n  max2 = sum[1];\n  k2 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max2) {\n      max2 = sum[i];\n      k2 = i;\n    }\n  sum[k2] = 0;\n\n  max3 = sum[1];\n  k3 = 1;\n  for (i = 1; i <= n; i++)\n    if (sum[i] > max3) {\n      max3 = sum[i];\n      k3 = i;\n    }\n  printf(\"%d %d %d %d %d %d \", k1, max1, k2, max2, k3, max3);\n}\n"}
{"label": "14", "index": "26198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  float one = 0, two = 0, three = 0, yi = 0, er = 0, san = 0;\n  float a[100000][2];\n  scanf(\"%d\", &n);\n  struct Student {\n    float xuehao;\n    float yuwen;\n    float shuxue;\n  } student;\n  for (i = 0; i < n; i++) {\n    scanf(\"%f %f %f\", &student.xuehao, &student.yuwen, &student.shuxue);\n    for (j = 0; j < 2; j++) {\n      a[i][1] = student.yuwen + student.shuxue;\n      a[i][0] = i + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > one) {\n      one = a[i][1];\n      yi = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > two && a[i][1] <= one && a[i][0] != yi) {\n      two = a[i][1];\n      er = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > three && a[i][1] <= one && a[i][1] <= two && a[i][0] != yi &&\n        a[i][0] != er) {\n      three = a[i][1];\n      san = a[i][0];\n    }\n  }\n  cout << fixed << setprecision(0) << yi << \" \" << one << \"\\n\";\n  printf(\"%.0f %.0f\\n\", er, two);\n  printf(\"%.0f %.0f\\n\", san, three);\n  return 0;\n}\n"}
{"label": "14", "index": "26199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chi;\n  int math;\n};\nstruct maxer {\n  int id;\n  int mark;\n};\nint main() {\n  int n, i, j;\n  struct student a[100001], temp;\n  struct maxer max, top[3];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].id >> a[i].chi >> a[i].math;\n  }\n  for (i = 1; i <= 3; i++) {\n    max.mark = 0;\n    for (j = i; j <= n; j++) {\n      if (a[j].chi + a[j].math > max.mark) {\n        max.id = a[j].id;\n        max.mark = a[j].chi + a[j].math;\n      }\n    }\n    top[i - 1] = max;\n    temp = a[i];\n    a[i] = a[max.id];\n    a[max.id] = temp;\n  }\n  for (i = 0; i <= 2; i++) {\n    printf(\"%d %d\", top[i].id, top[i].mark);\n    if (i != 2)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26200", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  char name[20];\n  int sbu[3];\n};\nint main() {\n  int n;\n  cin >> n;\n  int i, j = 0, j2 = 0, j3 = 0, min = 0;\n  struct stu stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].name >> stu[i].sbu[0] >> stu[i].sbu[1];\n    stu[i].sbu[2] = stu[i].sbu[0] + stu[i].sbu[1];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] > min) {\n      min = stu[i].sbu[2];\n      j = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j].sbu[2] && stu[i].sbu[2] > min && i != j) {\n      min = stu[i].sbu[2];\n      j2 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j2].name, min);\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sbu[2] <= stu[j2].sbu[2] && stu[i].sbu[2] > min &&\n        i != j & i != j2) {\n      min = stu[i].sbu[2];\n      j3 = i;\n    }\n  }\n  printf(\"%s %d\\n\", stu[j3].name, min);\n}\n"}
{"label": "14", "index": "26201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int scorechinese;\n    int scoremath;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].scorechinese, &a[i].scoremath);\n    a[i].sum = a[i].scorechinese + a[i].scoremath;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, score[100000], max1 = 0, m1 = 0, max2 = 0, m2 = 0, max3 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  struct stu {\n    int No;\n    int yw;\n    int math;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].No, &s[i].yw, &s[i].math),\n        score[i] = s[i].yw + s[i].math;\n    if (score[i] > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = score[i];\n      m3 = m2;\n      m2 = m1;\n      m1 = i;\n      continue;\n    }\n    if (score[i] <= max1 && score[i] > max2) {\n      max3 = max2;\n      max2 = score[i];\n      m3 = m2;\n      m2 = i;\n      continue;\n    }\n    if (score[i] <= max2 && score[i] > max3) {\n      max3 = score[i];\n      m3 = i;\n      continue;\n    }\n  }\n  cout << s[m1].No << \" \" << max1 << \"\\n\"\n       << s[m2].No << \" \" << max2 << \"\\n\"\n       << s[m3].No << \" \" << max3 << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "26203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n} student[100000];\nint max(int a, int b) { return (a > b) ? a : b; }\nint min(int a, int b) { return (a < b) ? a : b; }\nint main() {\n  int max(int a, int b);\n  int total[100000];\n  int n, i;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxnum1 = 0, maxnum2 = 0, maxnum3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].yuwen);\n    scanf(\"%d\", &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n    if (total[i] >= max1) {\n      if (total[i] == max1) {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = max(maxnum1, i + 1);\n        maxnum1 = min(maxnum1, i + 1);\n      } else {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = maxnum1;\n        maxnum1 = i + 1;\n      }\n    } else if (total[i] < max1 && total[i] >= max2) {\n\n      if (total[i] == max2) {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = max(maxnum2, i + 1);\n        maxnum2 = min(maxnum2, i + 1);\n      } else {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = i + 1;\n      }\n    } else if (total[i] < max2 && total[i] >= max3) {\n      if (total[i] == max3) {\n        max3 = total[i];\n        maxnum3 = min(i + 1, maxnum3);\n      } else {\n        max3 = total[i];\n        maxnum3 = i + 1;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", maxnum1, max1);\n  cout << maxnum2 << \" \" << max2 << \"\\n\";\n  cout << maxnum3 << \" \" << max3;\n  return 0;\n}\n"}
{"label": "14", "index": "26204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student student[100000];\n  int n, i, max, maxID;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].yuwen, &student[i].shuxue);\n  for (i = 1; i <= n; i++)\n    student[i].zongfen = student[i].yuwen + student[i].shuxue;\n\n  for (int j = 1; j <= 3; j++) {\n    maxID = 1;\n    max = student[1].zongfen;\n    for (i = 2; i <= n; i++)\n      if (student[i].zongfen > max) {\n        maxID = student[i].ID;\n        max = student[i].zongfen;\n      }\n    cout << maxID << \" \" << max << \"\\n\";\n    student[maxID].zongfen = 0;\n  }\n}\n"}
{"label": "14", "index": "26205", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  int total;\n} a[100000];\nstruct str {\n  int num;\n  int total;\n} b[100000];\n\nint main() {\n  int i, n, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &a[i].num, &a[i].ch, &a[i].math);\n    b[i].num = a[i].num;\n    b[i].total = a[i].ch + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[i].total < b[j].total) {\n        b[n] = b[i];\n        b[i] = b[j];\n        b[j] = b[n];\n      }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d \", b[i].num, b[i].total);\n  }\n}\n"}
{"label": "14", "index": "26206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int chinese;\n  int math;\n  int all;\n} stu[1000], temp;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (k = 1; k < 4; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (stu[i].all >= stu[i + 1].all) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d \", stu[i].No, stu[i].all);\n  }\n}\n"}
{"label": "14", "index": "26207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int s;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int n, i;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &p1->id, &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid exchange(struct student *x, struct student *y) {\n  int t;\n  t = x->id;\n  x->id = y->id;\n  y->id = t;\n  t = x->c;\n  x->c = y->c;\n  y->c = t;\n  t = x->m;\n  x->m = y->m;\n  y->m = t;\n  t = x->s;\n  x->s = y->s;\n  y->s = t;\n}\nint main() {\n  struct student *p, *q, *head;\n  int temp, i;\n  head = p = creat();\n  for (p = head, i = 0; p->next != NULL, i < 3; p = p->next, i++) {\n    temp = p->s;\n    for (q = p->next; q != NULL; q = q->next) {\n      if (p->s < q->s)\n        temp = q->s;\n      if (p->s != temp)\n        exchange(p, q);\n    }\n  }\n  for (p = head, i = 0; i < 3; p = p->next, i++)\n    printf(\"%d %d \", p->id, p->s);\n  return 0;\n}\n"}
{"label": "14", "index": "26208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int ch;\n    int ma;\n    int to;\n  };\n  int i, j1, j2, j3, k, max;\n  struct stu student[100000] = {0};\n  struct stu temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d%d%d\", &student[i].num, &student[i].ch, &student[i].ma);\n    student[i].to = student[i].ch + student[i].ma;\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (student[i].to > max) {\n      max = student[i].to;\n      j1 = i;\n    }\n  }\n  printf(\"%d \", student[j1].num);\n  cout << student[j1].to << \"\\n\";\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j2 = i;\n    }\n  }\n  printf(\"%d \", student[j2].num);\n  printf(\"%d\\n\", student[j2].to);\n  max = 0;\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1 || i == j2)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j3 = i;\n    }\n  }\n  printf(\"%d \", student[j3].num);\n  printf(\"%d\\n\", student[j3].to);\n  return 0;\n}\n"}
{"label": "14", "index": "26209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n};\nint main() {\n  struct Student *p1, *top1, *top2, *top3, *temp;\n  int i;\n  long int n;\n  scanf(\"%ld\", &n);\n\n  top1 = (struct Student *)malloc(sizeof(struct Student));\n  top2 = (struct Student *)malloc(sizeof(struct Student));\n  top3 = (struct Student *)malloc(sizeof(struct Student));\n  temp = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &top1->id, &top1->chn, &top1->mth);\n  top1->total = top1->chn + top1->mth;\n  scanf(\"%d %d %d\", &top2->id, &top2->chn, &top2->mth);\n  top2->total = top2->chn + top2->mth;\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  scanf(\"%d %d %d\", &top3->id, &top3->chn, &top3->mth);\n  top3->total = top3->chn + top3->mth;\n  if (top3->total > top2->total) {\n    temp = top3;\n    top3 = top2;\n    top2 = temp;\n  }\n  if (top2->total > top1->total) {\n    temp = top2;\n    top2 = top1;\n    top1 = temp;\n  }\n  for (i = 3; i < n; i++) {\n    p1 = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &p1->id, &p1->chn, &p1->mth);\n    p1->total = p1->chn + p1->mth;\n    if (top1->total < p1->total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = p1;\n      continue;\n    }\n    if (top2->total < p1->total) {\n      top3 = top2;\n      top2 = p1;\n      continue;\n    }\n    if (top3->total < p1->total) {\n      top3 = p1;\n      continue;\n    }\n    free(p1);\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", top1->id, top1->total, top2->id, top2->total,\n         top3->id, top3->total);\n}\n"}
{"label": "14", "index": "26210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2, *P;\n\n  int n, i = 0, j = 0;\n\n  scanf(\"%d \", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1->total = p1->yuwen + p1->shuxue;\n    p2->next = p1 = (struct student *)malloc(1000);\n  }\n\n  p2->next = head;\n  p1 = head;\n\n  for (i = 0;;) {\n    if (j == 3)\n      break;\n    head = p1;\n    P = p1;\n    p1 = head->next;\n    while (p1 != head) {\n      if (p1->total > P->total)\n        P = p1;\n      else if (p1->total == P->total && p1->num < P->num)\n        P = p1;\n      p1 = p1->next;\n    }\n    cout << P->num << \" \" << P->total << \" \";\n    while (p1->next != P)\n      p1 = p1->next;\n    p1->next = P->next;\n    j++;\n  }\n}\n"}
{"label": "14", "index": "26211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  char id[10];\n  int ch;\n  int ma;\n};\n\nint main(int argc, char *argv[]) {\n  int n, i, max, sec, min, total[100000];\n  cin >> n;\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s%d%d\", stu[i].id, &stu[i].ch, &stu[i].ma);\n    total[i] = stu[i].ch + stu[i].ma;\n  }\n\n  max = 0;\n\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[max])\n      max = i;\n  }\n\n  printf(\"%s %d\\n\", stu[max].id, total[max]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[max]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  sec = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[sec])\n      sec = i;\n  }\n\n  printf(\"%s %d\\n\", stu[sec].id, total[sec]);\n\n  for (i = 0; i < n; i++) {\n    if (total[i] == total[sec]) {\n      total[i] = 0;\n      break;\n    }\n  }\n\n  min = 0;\n  for (i = 0; i < n; i++) {\n    if (total[i] > total[min])\n      min = i;\n  }\n\n  printf(\"%s %d\\n\", stu[min].id, total[min]);\n  return 0;\n}\n"}
{"label": "14", "index": "26212", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int yu;\n  int shu;\n  struct student *next;\n};\nint main() {\n  int n, i, j = 0;\n\n  struct student *head, *p1, *p2;\n\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->id, &p1->yu, &p1->shu);\n    p1 = (struct student *)malloc(1000);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  p1 = head;\n  for (i = 200; i > 10; i--) {\n    p1 = head;\n    while (p1 != NULL) {\n      if ((p1->yu + p1->shu) == i) {\n        printf(\"%d %d \", p1->id, i);\n        j++;\n      }\n      p1 = p1->next;\n      if (j == 3)\n        break;\n    }\n    if (j == 3)\n      break;\n  }\n}\n"}
{"label": "14", "index": "26213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int ovr;\n  struct student *next;\n};\nstruct student *creat() {\n  int i;\n  struct student *head;\n  struct student *p1, *p2;\n  head = (struct student *)malloc(sizeof(struct student));\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    cin >> p2->num >> p2->chn >> p2->math;\n    p2->ovr = p2->chn + p2->math;\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int i;\n  int no1, ovr1 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  head = creat();\n  p1 = p2 = head;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->next != 0) {\n      if (p1->ovr > ovr1) {\n        ovr1 = p1->ovr;\n        no1 = p1->num;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", no1, ovr1);\n    p2->ovr = 0;\n    ovr1 = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26214", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num, cn, math, sum, rank;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(void) {\n  int i = 1;\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->cn, &p1->math);\n  head = p1;\n  do {\n    p2 = p1;\n    if (i == n)\n      break;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->cn >> p1->math;\n    p2->next = p1;\n    i++;\n  } while (1);\n  p2->next = 0;\n  return (head);\n}\n\nvoid count(struct student *head) {\n  int max = 0;\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    p1->sum = p1->cn + p1->math;\n    if (max < p1->sum)\n      max = p1->sum;\n    if (p1->next == 0)\n      break;\n    p1 = p1->next;\n  } while (1);\n  p1 = head;\n  do {\n    if (p1->sum == max) {\n      p1->rank = n;\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0) {\n      p1 = head;\n      max--;\n    } else\n      p1 = p1->next;\n  } while (1);\n}\n\nvoid print(struct student *head) {\n  struct student *p1;\n  n = 1;\n  p1 = head;\n  do {\n    if (p1->rank == n) {\n      cout << p1->num << \" \" << p1->sum << \" \";\n      n++;\n    }\n    if (n > 3)\n      break;\n    if (p1->next == 0)\n      p1 = head;\n    else\n      p1 = p1->next;\n  } while (1);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  count(head);\n  print(head);\n}\n"}
{"label": "14", "index": "26215", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int fir = 0, sec = 0, thi = 0;\n  int fir_n = 0, sec_n = 0, thi_n = 0;\n  struct {\n    int num;\n    int ma;\n    int cn;\n    int score;\n  } s;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    cin >> s.num >> s.ma >> s.cn;\n    s.score = s.ma + s.cn;\n\n    if (s.score > fir) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = fir;\n      sec_n = fir_n;\n      fir = s.score;\n      fir_n = s.num;\n    }\n\n    else if (s.score > sec) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = s.score;\n      sec_n = s.num;\n    } else if (s.score > thi) {\n      thi = s.score;\n      thi_n = s.num;\n    }\n  }\n\n  printf(\"%d %d\\n\", fir_n, fir);\n  printf(\"%d %d\\n\", sec_n, sec);\n  printf(\"%d %d\\n\", thi_n, thi);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int sum;\n  struct stu *next;\n};\n\nstruct stu *creat(long n) {\n  long i;\n  struct stu *p, *q, *head;\n  p = (struct stu *)malloc(1000);\n  head = q = p;\n  scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n      p->sum = p->shuxue + p->yuwen;\n  for (i = 1; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n        p->sum = p->shuxue + p->yuwen;\n    q->next = p, q = p;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  long i, n;\n  scanf(\"%ld\", &n);\n  struct stu *h, *p, *q1, *q2, *q3;\n  h = creat(n);\n  int m1, m2, m3;\n  for (p = h, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1)\n      m1 = p->sum, q1 = p;\n  cout << q1->ID << \" \" << q1->sum;\n  for (p = h, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1)\n      m2 = p->sum, q2 = p;\n  printf(\" %d %d\", q2->ID, q2->sum);\n  for (p = h, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2)\n      m3 = p->sum, q3 = p;\n  printf(\" %d %d\", q3->ID, q3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26217", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3 && i < n - 1; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", form[i].num, form[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, num, math, china, z, i;\n  int num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    scanf(\"%d\", &math);\n    scanf(\"%d\", &china);\n    z = math + china;\n    if (z > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z;\n      m3 = i;\n\n    } else if (z > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z;\n      m2 = i;\n    } else {\n      if (z > num1) {\n        num1 = z;\n        m1 = i;\n      }\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  printf(\"%ld %ld\\n\", m1, num1);\n  return 0;\n}\n"}
{"label": "14", "index": "26219", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int y;\n  int s;\n  int t;\n  struct stu *next;\n};\nint main() {\n  struct stu *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n    p1->t = p1->y + p1->s;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  int k = 0;\n  while (k < 3) {\n    p2 = head;\n    for (; p2 != 0; p2 = p2->next) {\n      for (p1 = p2->next; p1 != 0;) {\n        if (p2->t < p1->t)\n          break;\n        else\n          p1 = p1->next;\n      }\n      if (p1 == 0) {\n        printf(\"%ld %d \", p2->num, p2->t);\n        break;\n      }\n    }\n    k = k + 1;\n    p2->t = 0;\n  }\n}\n"}
{"label": "14", "index": "26220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  int id;\n  int ch;\n  int mt;\n  int total;\n};\nstruct stu stu_1[100000];\nstruct stu top1 = {0, 0, 0, 0}, top2 = {0, 0, 0, 0}, top3 = {0, 0, 0, 0};\n\nint main() {\n  int n, i;\n  struct stu tem;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(stu_1[i].id), &(stu_1[i].ch), &(stu_1[i].mt));\n    stu_1[i].total = stu_1[i].ch + stu_1[i].mt;\n    if (stu_1[i].total > top1.total) {\n      top3 = top2;\n      top2 = top1;\n      top1 = stu_1[i];\n    } else if (stu_1[i].total > top2.total) {\n      top3 = top2;\n      top2 = stu_1[i];\n    } else if (stu_1[i].total > top3.total) {\n      top3 = stu_1[i];\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", top1.id, top1.total);\n  if ((top2.id) != 0)\n    printf(\"%d %d\\n\", top2.id, top2.total);\n  if ((top3.id) != 0)\n    cout << top3.id << \" \" << top3.total << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "26221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n;\n  scanf(\"%ld\", &n);\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } stu[100000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].sum = stu[i].chi + stu[i].math;\n  }\n  struct student blank;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > stu[0].sum) {\n      blank = stu[0];\n      stu[0] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[1].sum) {\n      blank = stu[1];\n      stu[1] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (stu[i].sum > stu[2].sum) {\n      blank = stu[2];\n      stu[2] = stu[i];\n      stu[i] = blank;\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n  struct student *before;\n};\nint main() {\n  int i, n, n1 = 0, n2 = 0, n3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score1);\n  p1->sum = p1->score1 + p1->score2;\n  m1 = p1->sum;\n  n1 = p1->num;\n  head = 0;\n  i = 0;\n  while (i <= n - 2) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p1->before = p2;\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = p1->score1 + p1->score2;\n    if (p1->sum > m3 && p1->sum <= m2) {\n      m3 = p1->sum;\n      n3 = p1->num;\n    }\n    if (p1->sum > m2 && p1->sum <= m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = p1->sum;\n      n2 = p1->num;\n    }\n    if (p1->sum > m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = m1;\n      n2 = n1;\n      m1 = p1->sum;\n      n1 = p1->num;\n    }\n  }\n  printf(\"%d %d \", n1, m1);\n  cout << n2 << \" \" << m2 << \" \";\n  printf(\"%d %d \", n3, m3);\n}\n"}
{"label": "14", "index": "26223", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  cin >> n;\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26224", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int yu;\n    int shu;\n    char name[6];\n  };\n  struct stu s[100000], one, two, three;\n  one.yu = 0;\n  one.shu = 0;\n  two.yu = 0;\n  two.shu = 0;\n  three.yu = 0;\n  three.shu = 0;\n  int n, j, k;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%s %d %d\", s[j].name, &s[j].yu, &s[j].shu);\n  }\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (one.yu + one.shu)) {\n      one = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (two.yu + two.shu)) {\n      two = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (three.yu + three.shu))\n      three = s[j];\n  }\n  printf(\"%s %d\\n%s %d\\n%s %d\\n\", one.name, one.yu + one.shu, two.name,\n         two.yu + two.shu, three.name, three.yu + three.shu);\n  return 0;\n}\n"}
{"label": "14", "index": "26225", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int fir = 0, sec = 0, thi = 0;\n  int fir_n = 0, sec_n = 0, thi_n = 0;\n  struct {\n    int num;\n    int ma;\n    int cn;\n    int score;\n  } s;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.ma, &s.cn);\n    s.score = s.ma + s.cn;\n\n    if (s.score > fir) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = fir;\n      sec_n = fir_n;\n      fir = s.score;\n      fir_n = s.num;\n    }\n\n    else if (s.score > sec) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = s.score;\n      sec_n = s.num;\n    } else if (s.score > thi) {\n      thi = s.score;\n      thi_n = s.num;\n    }\n  }\n\n  printf(\"%d %d\\n\", fir_n, fir);\n  printf(\"%d %d\\n\", sec_n, sec);\n  printf(\"%d %d\\n\", thi_n, thi);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int scorec;\n  int scorem;\n  int score;\n};\n\nint main() {\n  int n;\n  int i;\n  struct student stu[100001];\n  int best[2][3] = {{0, 0, 0}, {0, 0, 0}};\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].scorec >> stu[i].scorem;\n    stu[i].score = stu[i].scorec + stu[i].scorem;\n  }\n  for (i = 1; i <= n; i++) {\n    if (stu[i].score > best[1][0]) {\n      best[0][2] = best[0][1];\n      best[0][1] = best[0][0];\n      best[0][0] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = best[1][0];\n      best[1][0] = stu[i].score;\n    } else if (stu[i].score <= best[1][0] && stu[i].score > best[1][1]) {\n      best[0][2] = best[0][1];\n      best[0][1] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = stu[i].score;\n    } else if (stu[i].score <= best[1][1] && stu[i].score > best[1][2]) {\n      best[0][2] = stu[i].num;\n      best[1][2] = stu[i].score;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << best[0][i] << ' ' << best[1][i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  cout << stu[n - 1].num << \" \" << stu[n - 1].sum << \"\\n\";\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26228", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct test {\n    int ID, chinese, maths, sum;\n  } ss[100000];\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ss[i].ID, &ss[i].chinese, &ss[i].maths);\n    ss[i].sum = ss[i].chinese + ss[i].maths;\n  }\n  struct score {\n    int ID, sum;\n  } s[5];\n  s[1].sum = 0;\n  s[2].sum = 0;\n  s[3].sum = 0;\n  for (i = 0; i <= n; i++) {\n    if (ss[i].sum > s[1].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = s[1].ID;\n      s[2].sum = s[1].sum;\n      s[1].ID = ss[i].ID;\n      s[1].sum = ss[i].sum;\n    } else if (ss[i].sum > s[2].sum) {\n      s[3].ID = s[2].ID;\n      s[3].sum = s[2].sum;\n      s[2].ID = ss[i].ID;\n      s[2].sum = ss[i].sum;\n    } else if (ss[i].sum > s[3].sum) {\n      s[3].ID = ss[i].ID;\n      s[3].sum = ss[i].sum;\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\\n\", s[i].ID, s[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26229", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  float chinese;\n  float math;\n  float sum;\n};\nint main() {\n  int n, i;\n  struct student *pt, *p, temp;\n  scanf(\"%d\", &n);\n  pt = (struct student *)malloc(n * 1000);\n  for (p = pt; p < pt + n; p++) {\n    scanf(\"%d%f%f\", &p->num, &p->chinese, &p->math);\n    p->sum = p->chinese + p->math;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (p = pt; p < pt + n - 1 - i; p++) {\n      if (p->sum >= (p + 1)->sum) {\n        temp = *p;\n        *p = *(p + 1);\n        *(p + 1) = temp;\n      }\n    }\n  }\n  for (p = pt + n - 1; p > pt + n - 4; p--) {\n    printf(\"%d %g \", p->num, p->sum);\n  }\n}\n"}
{"label": "14", "index": "26230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int ma;\n};\n\nint main() {\n  int n, i, j, score[100000], max[2];\n  struct stu STU[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &STU[i].num, &STU[i].ch, &STU[i].ma);\n    score[i] = STU[i].ch + STU[i].ma;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (score[i] > max[1]) {\n        max[0] = STU[i].num;\n        max[1] = score[i];\n      }\n    }\n    cout << max[0] << \" \" << max[1] << \"\\n\";\n    max[1] = 0;\n    int temp = max[0];\n    score[temp - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    cin >> p1->num >> p1->chi >> p1->math;\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sum(struct student *head) {\n  struct student *p1;\n  p1 = head;\n  while (p1) {\n    p1->total = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n}\nstruct student *choose(struct student *head) {\n  struct student *p1, *p2;\n  p1 = head;\n  p2 = p1;\n  while (p1->next) {\n    if (p2->total < (p1->next)->total) {\n      p2 = p1->next;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d \", p2->num, p2->total);\n  return (p2);\n}\nstruct student *del(struct student *head, struct student *p2) {\n  struct student *p1;\n  p1 = head;\n  if (p2 == head) {\n    head = p2->next;\n    return (head);\n  } else {\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n  } else if (n = 2) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n\n  } else {\n\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n  }\n}\n"}
{"label": "14", "index": "26232", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int ID;\n  int chi;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000];\n  struct Student temp;\n  int i, n, j, m;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].ID >> stu[i].chi >> stu[i].math;\n    stu[i].total = stu[i].chi + stu[i].math;\n  }\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].total >= stu[m + 1].total) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d\\n\", stu[i].ID, stu[i].total);\n  return 0;\n}\n"}
{"label": "14", "index": "26233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct student *next;\n};\nint n;\nstruct student *creat(int i) {\n  struct student *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->c + p1->b;\n  head = NULL;\n  while (n < i - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->c + p1->b;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid del(struct student *ahead, int num) {\n  struct student *p1, *p2;\n  p1 = ahead;\n  while (num != p1->d && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->d) {\n    if (p1 == ahead) {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      ahead = p1->next;\n    } else {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      p2->next = p1->next;\n    }\n  }\n}\nvoid print(struct student *head) {\n  int i;\n  struct student *p;\n  for (i = 0; i < 3; i++) {\n    p = head;\n    int max = p->d;\n    while (p->next != NULL) {\n      p = p->next;\n      if (max < p->d) {\n        max = p->d;\n      }\n    }\n    del(head, max);\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  struct student *ahead;\n  ahead = creat(i);\n  print(ahead);\n}\n"}
{"label": "14", "index": "26234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int score;\n};\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student stu[100000];\n  struct student *p, *p1, *t1, *t2, *t3;\n  int tem, tem1;\n  for (p = stu; p < stu + n; p++) {\n    scanf(\"%d %d %d\", &p->num, &p->score1, &p->score2);\n    p->score = p->score1 + p->score2;\n  }\n  int max;\n  for (p = stu, t1 = stu, max = stu->score; p < stu + n; p++) {\n    if (p->score > max) {\n      t1 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t2 = stu, max = stu->score; p < stu + n; p++) {\n    if (p == t1)\n      continue;\n    if (p->score > max) {\n      t2 = p;\n      max = p->score;\n    }\n  }\n  for (p = stu, t3 = stu, max = stu->score; p < stu + n; p++) {\n    if ((p == t1) || (p == t2))\n      continue;\n    if (p->score > max) {\n      t3 = p;\n      max = p->score;\n    }\n  }\n  cout << t1->num << \" \" << t1->score << \"\\n\";\n  printf(\"%d %d\\n\", t2->num, t2->score);\n  printf(\"%d %d\\n\", t3->num, t3->score);\n}\n"}
{"label": "14", "index": "26235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct xue {\n  int ID;\n  int sx;\n  int yw;\n  int sum;\n} xueshen;\n\nint main() {\n  int n, i, k;\n  scanf(\"%d\", &n);\n  struct xue *xuesheng;\n  xuesheng = (struct xue *)malloc(4 * sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &xuesheng[i].ID, &xuesheng[i].sx, &xuesheng[i].yw);\n    xuesheng[i].sum = xuesheng[i].sx + xuesheng[i].yw;\n  }\n  for (i = 1; i < 4; i++) {\n    for (k = 0; k < n - i; k++) {\n      if (xuesheng[k].sum >= xuesheng[k + 1].sum) {\n        xueshen = xuesheng[k + 1];\n        xuesheng[k + 1] = xuesheng[k];\n        xuesheng[k] = xueshen;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    printf(\"%d %d\\n\", xuesheng[n - i].ID, xuesheng[n - i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int a;\n  int b;\n  int c;\n};\nint main() {\n  int n, i, j, m, t;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].a >> stu[i].b;\n    stu[i].c = stu[i].a + stu[i].b;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].c < stu[j].c) {\n        t = stu[i].c;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        m = stu[i].num;\n        stu[i].num = stu[j].num;\n        stu[j].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].c << \"\\n\";\n}\n"}
{"label": "14", "index": "26237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct student *next;\n  };\n  int i, j, k, n, m, max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n    if (i == n)\n      p1->next = 0;\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = 0;\n    for (j = 1; j <= n; j++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n\n    p1 = head;\n    for (j = 1; j <= n; j++) {\n      if (p1->zf == max) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int c;\n  int m;\n  int sum;\n  struct student *next;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p0, *p, *q;\n  head = (struct student *)malloc(sizeof(struct student));\n  head->next = NULL;\n  for (i = 0; i < n; i++) {\n    q = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &q->num, &q->c, &q->m);\n    q->sum = q->c + q->m;\n    q->next = NULL;\n    p0 = head;\n    p = p0->next;\n    j = 0;\n    while (p != NULL && q->sum <= p->sum) {\n      p0 = p;\n      p = p->next;\n      j++;\n      if (j > 3)\n        goto A;\n    }\n    p0->next = q;\n    q->next = p;\n  A:\n    continue;\n  }\n  p = head->next;\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p->num, p->sum);\n    p = p->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int yuwen;\n    int shuxue;\n  };\n  int n, i, x, y, z, o, p, q;\n  cin >> n;\n  int a[100000];\n  struct student stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].ID >> stu[i].yuwen >> stu[i].shuxue;\n    a[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  x = 0;\n  y = 1;\n  z = 2;\n  for (i = 0; i < 3; i++) {\n    if (a[i] >= a[0] && a[i] >= a[1] && a[i] >= a[2]) {\n      x = i;\n      o = a[i];\n      continue;\n    }\n    if (a[i] <= a[0] && a[i] <= a[1] && a[i] <= a[2]) {\n      z = i;\n      q = a[i];\n      continue;\n    }\n    y = i;\n    p = a[i];\n  }\n\n  for (i = 3; i < n; i++) {\n    if (a[i] > q) {\n      if (a[i] > o) {\n        z = y;\n        y = x;\n        x = i;\n        q = p;\n        p = o;\n        o = a[i];\n      } else {\n        if (a[i] > p) {\n          z = y;\n          y = i;\n          q = p;\n          p = a[i];\n        } else {\n          z = i;\n          q = a[i];\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[x].ID, o);\n  printf(\"%d %d\\n\", stu[y].ID, p);\n  printf(\"%d %d\\n\", stu[z].ID, q);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct info {\n  int num;\n  int chin;\n  int math;\n  struct info *next;\n};\nstruct info *create(int n) {\n  int i;\n  struct info *head, *p1, *p2;\n  p1 = (struct info *)malloc(sizeof(struct info));\n  scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n  p1->next = NULL;\n  head = p1;\n  p2 = p1;\n  i = 1;\n  do {\n    p1 = (struct info *)malloc(sizeof(struct info));\n    scanf(\"%d %d %d\", &p1->num, &p1->chin, &p1->math);\n    p1->next = NULL;\n    p2->next = p1;\n    p2 = p1;\n    i++;\n  } while (i < n);\n  return (head);\n}\nvoid arrange(struct info *head) {\n  int m, no1, no2, no3;\n  struct info *p;\n  p = head;\n  m = 0;\n  while (p) {\n    if (p->chin + p->math > m) {\n      m = p->chin + p->math;\n      no1 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no1, m);\n  m = 0;\n  p = head;\n  no2 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1) {\n      m = p->chin + p->math;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no2, m);\n  m = 0;\n  p = head;\n  no3 = p->num;\n  while (p) {\n    if (p->chin + p->math > m && p->num != no1 && p->num != no2) {\n      m = p->chin + p->math;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\\n\", no3, m);\n}\nint main() {\n  int n;\n  struct info *head;\n  scanf(\"%d\", &n);\n  head = create(n);\n  arrange(head);\n}\n"}
{"label": "14", "index": "26241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n, max1, xue1, max2, xue2, max3, xue3;\nstruct chengji {\n  int xh;\n  int yw;\n  int sx;\n  int zf;\n  struct chengji *next;\n};\n\nvoid create() {\n  struct chengji *head;\n  struct chengji *p1;\n  int i = 0;\n  while (i < n) {\n    i++;\n    if (i == 1)\n      head = p1;\n    p1 = (struct chengji *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    if ((p1->zf) > max1) {\n      xue3 = xue2;\n      max3 = max2;\n      xue2 = xue1;\n      max2 = max1;\n      xue1 = p1->xh;\n      max1 = p1->zf;\n\n    } else {\n      if ((p1->zf) > max2 && (p1->zf) <= max1) {\n        xue3 = xue2;\n        max3 = max2;\n        xue2 = p1->xh;\n        max2 = p1->zf;\n      } else {\n        if ((p1->zf) > max3 && (p1->zf) <= max2) {\n          xue3 = p1->xh;\n          max3 = p1->zf;\n        }\n      }\n    }\n\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  cin >> n;\n  max1 = 0, max2 = 0, max3 = 0;\n  create();\n  printf(\"%d %d \", xue1, max1);\n  cout << xue2 << \" \" << max2 << \" \";\n  printf(\"%d %d\", xue3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, num, math, china, z, i;\n  int num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d\", &num);\n    scanf(\"%d \", &math);\n    scanf(\"%d\", &china);\n    z = math + china;\n    if (z > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z;\n      m3 = i;\n\n    } else if (z > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z;\n      m2 = i;\n    } else if (z > num1) {\n      num1 = z;\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  cout << m2 << \" \" << num2 << \"\\n\";\n  printf(\"%ld %ld\\n\", m1, num1);\n  return 0;\n}\n"}
{"label": "14", "index": "26243", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n, k;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2, *p3;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    cin >> p1->num >> p1->yuwen >> p1->math;\n    p1->total = p1->yuwen + p1->math;\n    p2 = head;\n    if (m == 1) {\n      head = p1;\n      p1->next = 0;\n    } else {\n      k = 0;\n      while (p1->total <= p2->total && p2->next != 0 && k <= 3) {\n        p3 = p2;\n        p2 = p2->next;\n        k++;\n      }\n      if (p1->total > p2->total && k <= 3) {\n        if (head == p2)\n          head = p1;\n        else\n          p3->next = p1;\n        p1->next = p2;\n      } else {\n        p2->next = p1;\n        p1->next = 0;\n      }\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int t1 = 0, t2;\n  cin >> n;\n  head = creat();\n  p = head;\n  while (t1 < 3) {\n    printf(\"%d %d\\n\", p->num, p->total);\n    p = p->next;\n    t1++;\n  }\n}\n"}
{"label": "14", "index": "26244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long int ID;\n  int math;\n  int chinese;\n  int add;\n} stu[100000];\nint main() {\n  long int n;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n    stu[i].add = stu[i].math + stu[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].add < stu[j].add) {\n        int t = stu[i].add;\n        stu[i].add = stu[j].add;\n        stu[j].add = t;\n        long int m = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = m;\n      }\n    }\n    printf(\"%d %d \", stu[i].ID, stu[i].add);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  float yuwen;\n  float shuxue;\n  float total;\n} stu[100000];\nint main() {\n  int i, n, j;\n  struct student *p;\n  p = &stu[0];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%f%f\", &(p + i)->num, &(p + i)->yuwen, &(p + i)->shuxue);\n    (p + i)->total = (p + i)->shuxue + (p + i)->yuwen;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < n - 1 - i; j++) {\n      if ((*(p + j)).total >= (*(p + j + 1)).total) {\n        struct student temp;\n        temp = *(p + j + 1);\n        *(p + j + 1) = *(p + j);\n        *(p + j) = temp;\n      }\n    }\n  if (n > 2)\n    for (i = 1; i < 4; i++)\n      printf(\"%d %g\\n\", (*(p + n - i)).num, (*(p + n - i)).total);\n  else if (n = 2)\n    printf(\"%d %g\\n%d %g\\n\", (*(p + 1)).num, (*(p + 1)).total, (*p).num,\n           (*p).total);\n  return 0;\n}\n"}
{"label": "14", "index": "26246", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000], l;\n  long n, i, j, k, tmp;\n  scanf(\"%ld \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    l = t[k];\n    t[k] = t[i];\n    t[i] = l;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %ld\\n\", t[i].num, t[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int add;\n};\nstruct student stu[100000];\nint main() {\n  int m, k, n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].add = stu[i].chi + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n - 1; i > 0; i--) {\n      if (stu[i].add > stu[i - 1].add) {\n        k = stu[i].add;\n        stu[i].add = stu[i - 1].add;\n        stu[i - 1].add = k;\n        m = stu[i].num;\n        stu[i].num = stu[i - 1].num;\n        stu[i - 1].num = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d\\n\", stu[i].num, stu[i].add);\n  return 0;\n}\n"}
{"label": "14", "index": "26248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } m[4], t;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 3; i++)\n    m[i].sum = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &t.num, &t.chinese, &t.math);\n    t.sum = t.chinese + t.math;\n    if (t.sum > m[1].sum) {\n      m[3] = m[2];\n      m[2] = m[1];\n      m[1] = t;\n    } else if (t.sum > m[2].sum) {\n      m[3] = m[2];\n      m[2] = t;\n    } else if (t.sum > m[3].sum)\n      m[3] = t;\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", m[i].num, m[i].sum);\n}\n"}
{"label": "14", "index": "26249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int n, i, j, max;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n      head = p1;\n      p2 = p1;\n    } else {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = NULL;\n\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c > max)\n        max = p1->b + p1->c;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c == max) {\n        printf(\"%d %d\\n\", p1->a, max);\n        p1->b = 0;\n        p1->c = 0;\n        p1 = p1->next;\n        break;\n      } else\n        p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "26250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int i, j, n, t, sum[100000];\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n  sum[0] = p1->b + p1->c;\n  head = p1;\n  p2 = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    scanf(\"%d%d%d\", &(p1->a), &(p1->b), &(p1->c));\n    sum[i] = p1->b + p1->c;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (sum[i] < sum[j]) {\n        t = sum[i];\n        sum[i] = sum[j];\n        sum[j] = t;\n      }\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    while (p1->b + p1->c != sum[i] && p1) {\n      p1 = p1->next;\n    }\n    if (p1) {\n      printf(\"%d %d\\n\", p1->a, sum[i]);\n      p1->b = 0;\n      p1->c = 0;\n    }\n  }\n}\n"}
{"label": "14", "index": "26251", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int sum;\n  } stu[100000], temp;\n  int total, i, j, chin, math;\n  cin >> total;\n  for (i = 0; i < total; i++) {\n    cin >> stu[i].num >> chin >> math;\n    stu[i].sum = chin + math;\n  }\n  for (i = 2; i < 5; i++) {\n    for (j = total - i; j >= 0; j--) {\n      if (stu[j].sum < stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "26252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, max, m;\n  scanf(\"%d\", &n);\n  struct stu {\n    int hao, yuwen, shuxue, zong;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\"\n          \"%d\"\n          \"%d\",\n          &stu[i].hao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zong = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[0].zong;\n    for (j = 1; j < n; j++) {\n      if (stu[j].zong > max) {\n        max = stu[j].zong;\n        m = j;\n      }\n    }\n    printf(\"%d %d\\n\", stu[m].hao, max);\n    stu[m].zong = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int mscore;\n  int cscore;\n  int total;\n} stu[100001];\nint main() {\n  int n, i, m = 0, b[201][100] = {0}, a[201][100] = {0}, j = 200, count = 3,\n            k = 0, c[201] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].mscore;\n    cin >> stu[i].cscore;\n    stu[i].total = stu[i].mscore + stu[i].cscore;\n  }\n  do {\n    b[stu[m].total][c[stu[m].total]] = stu[m].total;\n    a[stu[m].total][c[stu[m].total]] = stu[m].num;\n    if (c[stu[m].total] < 4)\n      c[stu[m].total]++;\n    m++;\n  } while (m < n);\n  for (j = 200; j >= 0; j--) {\n    for (k = 0; k < 100 && count > 0; k++) {\n      if (b[j][k] != 0) {\n        cout << a[j][k] << \" \" << b[j][k] << endl;\n        count--;\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "26254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n};\n\nint main() {\n  int n, i, e = 0, f = 0, g = 0, a = 0, b = 0, c = 0;\n  scanf(\"%d\", &n);\n  struct student *stu = (struct student *)malloc(sizeof(int) * 3 * n);\n  int *sz = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    sz[i] = stu[i].chi + stu[i].math;\n  }\n  for (i = 0; i < n; i++) {\n    if (sz[i] > sz[a]) {\n      a = i;\n      e = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", e, sz[a]);\n  for (i = 0; i < n; i++) {\n    if (i == a) {\n      continue;\n    }\n    if (sz[i] > sz[b]) {\n      b = i;\n      f = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", f, sz[b]);\n  for (i = 0; i < n; i++) {\n    if (i == a || i == b) {\n      continue;\n    }\n    if (sz[i] > sz[c]) {\n      c = i;\n      g = stu[i].num;\n    }\n  }\n  printf(\"%d %d\", g, sz[c]);\n  free(sz);\n  return 0;\n}\n"}
{"label": "14", "index": "26255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int id, chinese, math, total;\n\n  int n, i, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> id >> chinese >> math;\n    total = chinese + math;\n    if (total > a) {\n      c = b;\n      z = y;\n      b = a;\n      y = x;\n      a = total;\n      x = id;\n\n    } else if (total <= a && total > b) {\n      c = b;\n      z = y;\n      b = total;\n      y = id;\n    } else if (total <= b && total > c) {\n      c = total;\n      z = id;\n    }\n  }\n\n  printf(\"%d %d\\n\", x, a);\n  printf(\"%d %d\\n\", y, b);\n  printf(\"%d %d\\n\", z, c);\n  return 0;\n}\n"}
{"label": "14", "index": "26256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num, sum;\n  } stu[100000];\n  int n, i, j, t, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &chi, &math);\n    stu[i].sum = chi + math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j - 1].sum;\n        stu[j - 1].sum = t;\n        t = stu[j].num;\n        stu[j].num = stu[j - 1].num;\n        stu[j - 1].num = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].sum);\n  printf(\"%d %d\\n\", stu[1].num, stu[1].sum);\n  printf(\"%d %d\", stu[2].num, stu[2].sum);\n}\n"}
{"label": "14", "index": "26257", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num, ch, ma, grade;\n  } sum[100000], h, m, t;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &sum[i].num, &sum[i].ch, &sum[i].ma);\n    sum[i].grade = sum[i].ch + sum[i].ma;\n  }\n  h.grade = m.grade = t.grade = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i].grade > h.grade) {\n      t = m;\n      m = h;\n      h = sum[i];\n    } else if (sum[i].grade > m.grade) {\n      t = m;\n      m = sum[i];\n    } else if (sum[i].grade > t.grade)\n      t = sum[i];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", h.num, h.grade, m.num, m.grade, t.num,\n         t.grade);\n  return 0;\n}\n"}
{"label": "14", "index": "26258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, num1 = 0, max2 = 0, num2 = 0, max3 = 0, num3 = 0;\n  struct stu {\n    int num;\n    int chn;\n    int mat;\n    int sum;\n  } sco[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> sco[i].num >> sco[i].chn >> sco[i].mat;\n    sco[i].sum = sco[i].chn + sco[i].mat;\n  }\n  for (i = 0; i < n; i++) {\n    if (sco[i].sum > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = sco[i].sum;\n      num1 = i;\n\n    } else {\n      if (sco[i].sum > max2) {\n        max3 = max2;\n        num3 = num2;\n        max2 = sco[i].sum;\n        num2 = i;\n      } else {\n        if (sco[i].sum > max3) {\n          max3 = sco[i].sum;\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << ' ' << max1 << endl;\n  cout << num2 + 1 << ' ' << max2 << endl;\n  cout << num3 + 1 << ' ' << max3 << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int sum;\n} stu[100000];\n\nint main(int argc, char *argv[]) {\n  int i, n;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxid1 = 0, maxid2 = 0, maxid3 = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].math + stu[i].chinese;\n    if (stu[i].sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = maxid1;\n      maxid1 = stu[i].id;\n    } else if (stu[i].sum > max2) {\n      max3 = max2;\n      max2 = stu[i].sum;\n      maxid3 = maxid2;\n      maxid2 = stu[i].id;\n    } else if (stu[i].sum > max3) {\n      max3 = stu[i].sum;\n      maxid3 = stu[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", maxid1, max1, maxid2, max2, maxid3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26260", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  struct stu *next;\n};\n\nint main() {\n  int n, m = 0, max = 0, max2 = 0, max3 = 0, no = 0, no2 = 0, no3 = 0;\n  struct stu *p;\n  scanf(\"%d\", &n);\n  struct stu *p1, *p2, *head;\n  p1 = (struct stu *)malloc(1000);\n  cin >> p1->num >> p1->ch >> p1->math;\n  head = NULL;\n\n  while (n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    n--;\n  }\n  p2->next = NULL;\n\n  p = head;\n  while (p) {\n    p->ch = p->math + p->ch;\n    p = p->next;\n  }\n\n  p = head;\n  while (p) {\n    if (p->ch > max) {\n      max = p->ch;\n      no = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no, max);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max && p->ch > max2 && p->num != no) {\n      max2 = p->ch;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no2, max2);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max2 && p->ch > max3 && p->num != no && p->num != no2) {\n      max3 = p->ch;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\", no3, max3);\n}\n"}
{"label": "14", "index": "26261", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nstruct student {\n  int num;\n  int scorec;\n  int scorem;\n  int score;\n};\n\nint main() {\n  int n;\n  int i;\n  struct student stu[100001];\n  int best[2][3] = {{0, 0, 0}, {0, 0, 0}};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].scorec >> stu[i].scorem;\n    stu[i].score = stu[i].scorec + stu[i].scorem;\n  }\n  for (i = 1; i <= n; i++) {\n    if (stu[i].score > best[1][0]) {\n      best[0][2] = best[0][1];\n      best[0][1] = best[0][0];\n      best[0][0] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = best[1][0];\n      best[1][0] = stu[i].score;\n    } else if (stu[i].score <= best[1][0] && stu[i].score > best[1][1]) {\n      best[0][2] = best[0][1];\n      best[0][1] = stu[i].num;\n      best[1][2] = best[1][1];\n      best[1][1] = stu[i].score;\n    } else if (stu[i].score <= best[1][1] && stu[i].score > best[1][2]) {\n      best[0][2] = stu[i].num;\n      best[1][2] = stu[i].score;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << best[0][i] << ' ' << best[1][i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n  struct student *next;\n};\nint main() {\n  int n = 0, i, j, k;\n  scanf(\"%d\", &k);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = NULL;\n  for (i = 0; i < k - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  struct student *g;\n  int x[100000], y[100000];\n  g = head;\n  for (i = 0; i < k; i++) {\n    x[i] = g->a;\n    y[i] = g->b + g->c;\n    g = g->next;\n  }\n  int m[4] = {0}, t, r = 1, z = 0;\n  m[0] = 201;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < k; j++) {\n      if (m[r] < y[j] && y[j] < m[r - 1])\n        m[r] = y[j];\n    }\n    r++;\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[1]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[2]) {\n      cout << x[i] << \" \" << y[i] << \" \";\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[3]) {\n      printf(\"%d %d\", x[i], y[i]);\n      z++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int math;\n  int chinese;\n  struct student *next;\n};\n\nlong stu_num;\nstruct student *max1, *max2, *max3;\n\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  long n;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  head = NULL;\n  n = 0;\n  while (n < stu_num) {\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%ld%d%d\", &p1->num, &p1->math, &p1->chinese);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid Max1(struct student *head, long stu_num) {\n  struct student *q1;\n  q1 = head;\n  max1 = head;\n  for (; q1 != NULL;)\n    if ((max1->math + max1->chinese) < (q1->math + q1->chinese)) {\n      max1 = q1;\n      q1 = q1->next;\n    } else\n      q1 = q1->next;\n  printf(\"%ld %d \", max1->num, max1->math + max1->chinese);\n}\n\nvoid Max2(struct student *head, long stu_num) {\n  struct student *q2;\n  q2 = head;\n  if (head != max1)\n    max2 = head;\n  else\n    max2 = q2->next;\n  for (; q2 != NULL;)\n    if ((max2->math + max2->chinese) < (q2->math + q2->chinese) && q2 != max1) {\n      max2 = q2;\n      q2 = q2->next;\n    } else\n      q2 = q2->next;\n  printf(\"%ld %d \", max2->num, max2->math + max2->chinese);\n}\n\nvoid Max3(struct student *head, long stu_num) {\n  struct student *q3;\n  q3 = head;\n  for (; q3 != NULL;)\n    if (q3 == max1 || q3 == max2)\n      q3 = q3->next;\n    else {\n      max3 = q3;\n      break;\n    }\n  q3 = head;\n  for (; q3 != NULL;)\n    if ((max3->math + max3->chinese) < (q3->math + q3->chinese) && q3 != max1 &&\n        q3 != max2) {\n      max3 = q3;\n      q3 = q3->next;\n    } else\n      q3 = q3->next;\n  printf(\"%ld %d \", max3->num, max3->math + max3->chinese);\n}\n\nint main() {\n  struct student *head;\n  scanf(\"%ld\", &stu_num);\n  head = creat();\n  Max1(head, stu_num);\n  Max2(head, stu_num);\n  Max3(head, stu_num);\n}\n"}
{"label": "14", "index": "26264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct {\n  int ID[100000], Chinese[100000], Maths[100000];\n} stu;\nint main() {\n  int n, i, sum[100000], max1 = 0, max2 = 0, max3 = 0, num1, num2, num3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu.ID[i] >> stu.Chinese[i] >> stu.Maths[i];\n  }\n  i = 0;\n  while (stu.ID[i] > 0) {\n    sum[i] = stu.Chinese[i] + stu.Maths[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      num1 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max2 && sum[i] <= max1 && i != num1) {\n      max2 = sum[i];\n      num2 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max3 && sum[i] <= max2 && i != num2 && i != num1) {\n      max3 = sum[i];\n      num3 = i;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", stu.ID[num1], max1, stu.ID[num2], max2,\n         stu.ID[num3], max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n  struct student *next;\n};\nint main() {\n  int n = 0, i, j, k;\n  scanf(\"%d\", &k);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->a >> p1->b >> p1->c;\n  head = NULL;\n  for (i = 0; i < k - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  struct student *g;\n  int x[100000], y[100000];\n  g = head;\n  for (i = 0; i < k; i++) {\n    x[i] = g->a;\n    y[i] = g->b + g->c;\n    g = g->next;\n  }\n  int m[4] = {0}, t, r = 1, z = 0;\n  m[0] = 201;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < k; j++) {\n      if (m[r] < y[j] && y[j] < m[r - 1])\n        m[r] = y[j];\n    }\n    r++;\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[1]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[2]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[3]) {\n      cout << x[i] << \" \" << y[i];\n      z++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26266", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int t;\n} a[1000];\nint cmp(const void *p1, const void *p2) {\n  struct student *p3 = (struct student *)p1;\n  struct student *p4 = (struct student *)p2;\n  return -p3->t + p4->t;\n}\nint main(void) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n    a[i].t = a[i].m + a[i].c;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", a[i].id, a[i].c + a[i].m);\n  return 0;\n}\n"}
{"label": "14", "index": "26267", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\nlong n;\n\nint main() {\n  struct student *creat();\n  struct student *head, *p, *q1, *q2, *q3;\n  int a;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a) {\n      a = p->sum;\n      q1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1) {\n      a = p->sum;\n      q2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  a = 0;\n  while (p != NULL) {\n    if (p->sum > a && p != q1 && p != q2) {\n      a = p->sum;\n      q3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", q1->num, q1->sum);\n  printf(\"%d %d \", q2->num, q2->sum);\n  printf(\"%d %d \", q3->num, q3->sum);\n  return 0;\n}\n\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  int i;\n  head = NULL;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%ld%d%d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n"}
{"label": "14", "index": "26268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int c;\n  c = *(int *)elem1 - *(int *)elem2;\n  return c;\n}\nstruct student {\n  int num;\n  int x;\n  int y;\n} a[100000];\nint main() {\n  int n, i, j, d = 0, b[100000], c[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].x);\n    scanf(\"%d\", &a[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].x + a[i].y;\n  }\n  qsort(b, n, sizeof(int), pfCompare);\n  for (j = 0; j < n; j++) {\n    if (b[n - 1] == a[j].x + a[j].y) {\n      printf(\"%d\"\n             \" \"\n             \"%d\",\n             a[j].num, b[n - 1]);\n      printf(\" \");\n      d++;\n    }\n    if (d == 3)\n      break;\n  }\n  for (i = n - 2; i > n - 4; i--) {\n    if (b[i] == b[i + 1]) {\n      continue;\n    } else {\n      for (j = 0; j < n; j++) {\n        if (b[i] == a[j].x + a[j].y) {\n          printf(\"%d\"\n                 \" \"\n                 \"%d\",\n                 a[j].num, b[i]);\n          printf(\" \");\n          d++;\n        }\n        if (d == 3)\n          break;\n      }\n      if (d == 3) {\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} stu[100000];\nint main() {\n  int sum[100000];\n  long i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    t = 0;\n    for (j = 0; j < n - 1; j++) {\n      if (sum[j + 1] > sum[t])\n        t = j + 1;\n    }\n    printf(\"%d %d\\n\", stu[t].xuehao, sum[t]);\n    sum[t] = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[100001];\nint main() {\n  int n, i, j;\n  cin >> n;\n  struct {\n    int id, chin, math, su;\n  } s[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].id, &s[i].chin, &s[i].math);\n    s[i].su = s[i].chin + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i].su < s[j].su) {\n        s[100000] = s[i];\n        s[i] = s[j];\n        s[j] = s[100000];\n      }\n    }\n  }\n  cout << s[0].id << \" \" << s[0].su << \"\\n\"\n       << s[1].id << \" \" << s[1].su << \"\\n\"\n       << s[2].id << \" \" << s[2].su;\n  return 0;\n}\n"}
{"label": "14", "index": "26271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int a;\n  int b;\n  int c;\n  int d;\n  struct student *next;\n};\nint n;\nstruct student *creat(int i) {\n  struct student *head, *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  p1->d = p1->c + p1->b;\n  head = NULL;\n  while (n < i - 1) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n    p1->d = p1->c + p1->b;\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid del(struct student *ahead, int num) {\n  struct student *p1, *p2;\n  p1 = ahead;\n  while (num != p1->d && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->d) {\n    if (p1 == ahead) {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      ahead = p1->next;\n    } else {\n      printf(\"%d %d\\n\", p1->a, p1->d);\n      p2->next = p1->next;\n    }\n  }\n}\nvoid print(struct student *head) {\n  int i;\n  struct student *p;\n  for (i = 0; i < 3; i++) {\n    p = head;\n    int max = p->d;\n    while (p->next != NULL) {\n      p = p->next;\n      if (max < p->d)\n        max = p->d;\n    }\n    del(head, max);\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  struct student *ahead;\n  ahead = creat(i);\n  print(ahead);\n}\n"}
{"label": "14", "index": "26272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int YW;\n    int SX;\n  };\n  struct student stu[100000];\n  int ZF[100000];\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].ID;\n    cin >> stu[i].YW;\n    scanf(\"%d\", &stu[i].SX);\n    ZF[i] = stu[i].YW + stu[i].SX;\n  }\n  int a = 0, b = 0, c = 0, A = 0, B = 0, C = 0;\n  for (int i = 0; i < n; i++) {\n    if (ZF[i] > a) {\n      c = b;\n      C = B;\n      b = a;\n      B = A;\n      a = ZF[i];\n      A = i;\n    } else if (ZF[i] > b) {\n      c = b;\n      C = B;\n      b = ZF[i];\n      B = i;\n    } else if (ZF[i] > c) {\n      c = ZF[i];\n      C = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[A].ID, a);\n  printf(\"%d %d\\n\", stu[B].ID, b);\n  printf(\"%d %d\\n\", stu[C].ID, c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n} stu[100000];\nint main() {\n  int sum[100000];\n  long i, j, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (i = 0; i < 3; i++) {\n    t = 0;\n    for (j = 0; j < n - 1; j++) {\n      if (sum[j + 1] > sum[t])\n        t = j + 1;\n    }\n    printf(\"%d %d\\n\", stu[t].xuehao, sum[t]);\n    sum[t] = 0;\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int nn;\n  int nnn;\n  int nmn;\n  int sum;\n} st[100002], tmp;\nint main() {\n  int i, j, m, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &st[i].nn, &st[i].nnn, &st[i].nmn);\n    st[i].sum = st[i].nnn + st[i].nmn;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[i].sum < st[j].sum) {\n        tmp = st[i];\n        st[i] = st[j];\n        st[j] = tmp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    printf(\"%d %d\", st[i].nn, st[i].sum);\n    if (i < 3)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int math;\n  int chinese;\n} stu[100000];\nint main() {\n  int n, i, j, s[100000], t[100000], c = 0;\n  cin >> n;\n  for (i = 0; i <= (n - 1); i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    s[i] = stu[i].math + stu[i].chinese;\n    t[i] = s[i];\n  }\n  int p;\n  for (i = 0; i <= 2; i++) {\n    for (j = 0; j <= (n - i - 2); j++) {\n      if (s[j] >= s[j + 1]) {\n        p = s[j];\n        s[j] = s[j + 1];\n        s[j + 1] = p;\n      }\n    }\n  }\n  int d[3];\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 1]) {\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 2]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  for (i = 0; i <= (n - 1); i++) {\n    if (t[i] == s[n - 3]) {\n      if (stu[i].num == d[0] || stu[i].num == d[1] || stu[i].num == d[2])\n        break;\n      printf(\"%d %d\", stu[i].num, t[i]);\n      d[c] = stu[i].num;\n      printf(\"\\n\");\n      c = c + 1;\n      if (c == 3)\n        break;\n    }\n    if (c == 3)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26276", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int ch;\n  int math;\n};\nint main() {\n  struct student stu[100000];\n  int n, i, j, sum = 0, id1 = 0, flag = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].ch >> stu[i].math;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if ((stu[j].ch + stu[j].math) > sum) {\n        sum = stu[j].ch + stu[j].math;\n        id1 = stu[j].id;\n        flag = j;\n      }\n    }\n    printf(\"%d %d\\n\", id1, sum);\n    sum = 0;\n    id1 = 0;\n    stu[flag].ch = 0;\n    stu[flag].math = 0;\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int n;\n  int y;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return (((struct student *)b)->y > ((struct student *)a)->y ? 1 : -1);\n}\n\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  struct student s[100000];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].y, &s[i].s);\n    s[i].y = s[i].y + s[i].s;\n  }\n  qsort(s, num, sizeof(s[0]), cmp);\n  for (int i = 0; i < 3; i++) {\n    cout << s[i].n << \" \" << s[i].y << \" \";\n  }\n}\n"}
{"label": "14", "index": "26278", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int ma;\n};\n\nint main() {\n  int n, i, j, score[100000], max[2];\n  struct stu STU[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &STU[i].num, &STU[i].ch, &STU[i].ma);\n    score[i] = STU[i].ch + STU[i].ma;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (score[i] > max[1]) {\n        max[0] = STU[i].num;\n        max[1] = score[i];\n      }\n    }\n    printf(\"%d %d\\n\", max[0], max[1]);\n    max[1] = 0;\n    int temp = max[0];\n    score[temp - 1] = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m1, m2, m3, n1, n2, n3;\n  struct student {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct student stu[100000];\n  struct student *p;\n  p = stu;\n\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &(p + i)->num, &(p + i)->verbal, &(p + i)->math);\n  for (i = 0; i < n; i++)\n    (p + i)->sum = (p + i)->verbal + (p + i)->math;\n  m1 = p->sum;\n  n1 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m1) {\n      m1 = (p + i)->sum;\n      n1 = i;\n    }\n  printf(\"%d %d\\n\", (p + n1)->num, (p + n1)->sum);\n  m2 = p->sum;\n  n2 = 0;\n  for (i = 0; i < n; i++)\n    if (((p + i)->sum) > m2 && i != n1) {\n      m2 = (p + i)->sum;\n      n2 = i;\n    }\n  printf(\"%d %d\\n\", (p + n2)->num, (p + n2)->sum);\n\n  m3 = p->sum;\n  n3 = 0;\n  for (i = 0; i < n; i++)\n    if ((((p + i)->sum) > m3) && i != n1 && i != n2) {\n      m3 = (p + i)->sum;\n      n3 = i;\n    }\n  cout << (p + n3)->num << \" \" << (p + n3)->sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26280", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  struct {\n    int id, chi, math, sum;\n  } s, s1, s2, s3;\n  s1.sum = s2.sum = s3.sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s.id >> s.chi >> s.math;\n    s.sum = s.chi + s.math;\n    if (s.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.sum > s2.sum)\n      s3 = s2, s2 = s;\n    else {\n      if (s.sum > s3.sum) {\n        s3 = s;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\n\nint main() {\n  int n, i, j, e;\n  cin >> n;\n  struct student *stu = (struct student *)malloc(sizeof(struct student) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        e = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = e;\n        e = stu[j].ID;\n        stu[j].ID = stu[j + 1].ID;\n        stu[j + 1].ID = e;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[n - 1].ID, stu[n - 1].zongfen,\n         stu[n - 2].ID, stu[n - 2].zongfen, stu[n - 3].ID, stu[n - 3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long int id;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\nlong int n;\n\nint main() {\n  struct student *p0, *p1, *p2, *head, *p;\n  int i;\n  scanf(\"%ld\\n\", &n);\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  head = p0;\n  p1 = p0;\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p1 = p0;\n  } else {\n    head = p0;\n    p0->next = p1;\n  }\n  p0 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n  p0->total = p0->yuwen + p0->shuxue;\n  if (p0->total <= p1->total) {\n    p1->next = p0;\n    p2 = p0;\n  } else if (p0->total > p1->total && p0->total <= head->total) {\n    head->next = p0;\n    p0->next = p1;\n    p2 = p1;\n    p1 = p0;\n  } else if (p0->total > head->total) {\n    p0->next = head;\n    p2 = p1;\n    p1 = head;\n    head = p0;\n  }\n  p2->next = NULL;\n  for (i = 3; i < n; i++) {\n    p0 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%ld %d %d\", &p0->id, &p0->yuwen, &p0->shuxue);\n    p0->total = p0->yuwen + p0->shuxue;\n    if (p0->total > p2->total) {\n      if (p0->total <= p1->total) {\n        p1->next = p0;\n        p0->next = NULL;\n        p2 = p0;\n      } else if (p0->total > p1->total && p0->total <= head->total) {\n        head->next = p0;\n        p0->next = p1;\n        p1->next = NULL;\n        p1 = p2;\n        p0 = p1;\n      } else if (p0->total > head->total) {\n        p0->next = head;\n        p1->next = NULL;\n        p2 = p1;\n        p1 = head;\n        head = p0;\n      }\n    }\n  }\n  p = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %d\\n\", p->id, p->total);\n    p = p->next;\n  }\n}\n"}
{"label": "14", "index": "26283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  struct {\n    int No;\n    int Chinese;\n    int Math;\n    int Sum;\n  } student[100000], t;\n  int i, j;\n  for (i = 0; i < num; i++) {\n    cin >> student[i].No >> student[i].Chinese >> student[i].Math;\n    student[i].Sum = student[i].Math + student[i].Chinese;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = 0; j < num - 1 - i; j++) {\n      if (student[j].Sum >= student[j + 1].Sum) {\n        t = student[j];\n        student[j] = student[j + 1];\n        student[j + 1] = t;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", student[num - i - 1].No, student[num - i - 1].Sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c;\n  struct student {\n    int id;\n    int score;\n  } stu[100000], t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> b >> c;\n    stu[i].score = b + c;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (stu[j].score > stu[j - 1].score) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].id << ' ' << stu[i].score << endl;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26285", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num, y, b, he;\n} a[100003];\n\nint main() {\n  int n, i, j, he, k;\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].y, &a[i].b);\n    a[i].he = a[i].y + a[i].b;\n  };\n\n  for (i = 1; i <= 2; i++) {\n    k = i;\n    for (j = i + 1; j <= n; j++)\n      if (a[j].he > a[k].he)\n        k = j;\n    printf(\"%d %d\", a[k].num, a[k].he);\n    printf(\"\\n\");\n    a[k].he = 0;\n  }\n  k = 1;\n  for (j = i + 1; j <= n; j++)\n    if (a[j].he > a[k].he)\n      k = j;\n  printf(\"%d %d\", a[k].num, a[k].he);\n  a[k].he = 0;\n}\n"}
{"label": "14", "index": "26286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, e, f, g, h;\n  int *a, *b, *c;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(n * sizeof(int));\n  b = (int *)malloc(n * sizeof(int));\n  c = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  for (i = 0; i < n; i++)\n    a[i] = b[i] + c[i];\n  for (i = 0; i < n; i++)\n    b[i] = a[i];\n  for (i = 0; i < n; i++) {\n    if (a[i] > m)\n      m = a[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  b[i] = 0;\n  a[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n  printf(\"%d %d \", i + 1, m);\n  a[i] = 0;\n  b[i] = 0;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (b[i] > m)\n      m = b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == m)\n      break;\n  }\n\n  printf(\"%d %d \", i + 1, m);\n  free(a);\n  a = 0;\n  free(b);\n  b = 0;\n  free(c);\n  c = 0;\n}\n"}
{"label": "14", "index": "26287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int t;\n} a[1000];\nint cmp(const void *p1, const void *p2) {\n  struct student *p3 = (struct student *)p1;\n  struct student *p4 = (struct student *)p2;\n  return -p3->t + p4->t;\n}\nint main(void) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].c >> a[i].m;\n    a[i].t = a[i].m + a[i].c;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (i = 0; i < 3; i++)\n    cout << a[i].id << \" \" << a[i].c + a[i].m << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "26288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int chn;\n  int mth;\n  int sum;\n};\nstruct Scr {\n  int num;\n  int sum;\n};\n\nint main() {\n  struct Student stu[100000];\n  struct Scr scr[3];\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chn, &stu[i].mth);\n    stu[i].sum = stu[i].chn + stu[i].mth;\n  }\n  scr[0].num = stu[0].num;\n  scr[0].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > scr[0].sum) {\n      scr[0].num = stu[i].num;\n      scr[0].sum = stu[i].sum;\n    }\n  }\n  scr[1].num = stu[0].num;\n  scr[1].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i != scr[0].num - 1) {\n      if (stu[i].sum > scr[1].sum) {\n        scr[1].num = stu[i].num;\n        scr[1].sum = stu[i].sum;\n      }\n    }\n  }\n  scr[2].num = stu[0].num;\n  scr[2].num = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (i == scr[0].num - 1 || i == scr[1].num - 1)\n      continue;\n    else {\n      if (stu[i].sum > scr[2].sum) {\n        scr[2].num = stu[i].num;\n        scr[2].sum = stu[i].sum;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << scr[i].num << \" \" << scr[i].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "26289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x, i, n, m = 0, j = 0, k = 0, s, l1, l2, l3;\n  int a[100000], b[100000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &x, &(a[i]), &(b[i]));\n    s = a[i] + b[i];\n    if (s > m) {\n\n      j = m;\n      m = s;\n      l2 = l1;\n      l1 = i;\n    } else if (s > j) {\n      k = j;\n      j = s;\n      l3 = l2;\n      l2 = i;\n    } else if (s > k) {\n      k = s;\n      l3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", l1, m);\n  printf(\"%d %d\\n\", l2, j);\n  cout << l3 << \" \" << k << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int total;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2, *P;\n\n  int n, i = 0, j = 0;\n\n  scanf(\"%d \", &n);\n  p1 = p2 = head = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    p2 = p1;\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->total = p1->yuwen + p1->shuxue;\n    p2->next = p1 = (struct student *)malloc(1000);\n  }\n\n  p2->next = head;\n  p1 = head;\n\n  for (i = 0;;) {\n    if (j == 3)\n      break;\n    head = p1;\n    P = p1;\n    p1 = head->next;\n    while (p1 != head) {\n      if (p1->total > P->total)\n        P = p1;\n      else if (p1->total == P->total && p1->num < P->num)\n        P = p1;\n      p1 = p1->next;\n    }\n    cout << P->num << \" \" << P->total << \" \";\n    while (p1->next != P)\n      p1 = p1->next;\n    p1->next = P->next;\n    j++;\n  }\n}\n"}
{"label": "14", "index": "26291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, chi, math, sum;\n  struct student {\n    int num, chi, math, sum;\n  } students[100000];\n  int i;\n  int STUDENT_NUM;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    scanf(\"%d %d %d\", &num, &chi, &math);\n    students[i].num = num;\n    students[i].chi = chi;\n    students[i].math = math;\n    sum = chi + math;\n    students[i].sum = sum;\n  }\n  int sum1 = 0, sum2 = 0, sum3 = 0;\n  int num1, num2, num3;\n  for (i = 0; i < STUDENT_NUM; i++) {\n    if (i == 0) {\n      sum1 = students[0].sum;\n      num1 = students[0].num;\n    } else if (i == 1) {\n      if (students[1].sum > students[0].sum) {\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[1].sum;\n        num1 = students[1].num;\n      } else {\n        sum2 = students[1].sum;\n        num2 = students[1].num;\n      }\n    } else {\n      if (students[i].sum > sum1) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[i].sum;\n        num1 = students[i].num;\n      } else if (students[i].sum > sum2) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = students[i].sum;\n        num2 = students[i].num;\n      } else if (students[i].sum > sum3) {\n        sum3 = students[i].sum;\n        num3 = students[i].num;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", num1, sum1);\n  printf(\"%d %d\\n\", num2, sum2);\n  printf(\"%d %d\\n\", num3, sum3);\n}\n"}
{"label": "14", "index": "26292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct a {\n    int h;\n    int y;\n    int s;\n  } b[100000], e;\n  int c[100000];\n  int n, i, f, j, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &b[i].h, &b[i].y, &b[i].s);\n  }\n  for (i = 0; i < n; i++) {\n    c[i] = b[i].y + b[i].s;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (c[i] > c[j]) {\n        d = c[j];\n        c[j] = c[i];\n        c[i] = d;\n        e = b[j];\n        b[j] = b[i];\n        b[i] = e;\n      }\n    }\n    f = b[j].h;\n    cout << f << \" \" << c[j] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int mathematics;\n    int sum;\n  } temp;\n  struct student stu[100000];\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].mathematics;\n    stu[i].sum = stu[i].chinese + stu[i].mathematics;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        temp = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct score {\n    int n;\n    int a;\n    int b;\n    int c;\n  } score[5];\n  int i, m;\n  scanf(\"%d\", &m);\n  score[1].n = 0;\n  score[1].c = 0;\n  score[2].n = 0;\n  score[2].c = 0;\n  score[3].n = 0;\n  score[3].c = 0;\n  for (i = 0; i < m; i++) {\n    cin >> score[4].n >> score[4].a >> score[4].b;\n    score[4].c = score[4].a + score[4].b;\n    if (score[4].c > score[1].c) {\n      score[3] = score[2];\n      score[2] = score[1];\n      score[1] = score[4];\n    } else if (score[4].c > score[2].c) {\n      score[3] = score[2];\n      score[2] = score[4];\n    } else if (score[4].c > score[3].c)\n      score[3] = score[4];\n  }\n  cout << score[1].n << \" \" << score[1].c << \"\\n\"\n       << score[2].n << \" \" << score[2].c << \"\\n\"\n       << score[3].n << \" \" << score[3].c << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int math;\n    int chi;\n    int sum;\n    struct student *next;\n  };\n  int n, i;\n  int max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1 = (struct student *)malloc(1000);\n    else {\n      p1->next = (struct student *)malloc(1000);\n      p1 = p1->next;\n    }\n    scanf(\"%d%d%d\", &p1->a, &p1->math, &p1->chi);\n    p1->sum = (p1->math) + (p1->chi);\n  }\n  p1->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    do {\n      p1 = p1->next;\n      if (p1->sum > max) {\n        max = p1->sum;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    printf(\"%d %d \", p2->a, p2->sum);\n    p2->sum = 0;\n  }\n}\n"}
{"label": "14", "index": "26296", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n  struct student *before;\n};\nint main() {\n  int i, n, n1 = 0, n2 = 0, n3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score1);\n  p1->sum = p1->score1 + p1->score2;\n  m1 = p1->sum;\n  n1 = p1->num;\n  head = 0;\n  i = 0;\n  while (i <= n - 2) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p1->before = p2;\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = p1->score1 + p1->score2;\n    if (p1->sum > m3 && p1->sum <= m2) {\n      m3 = p1->sum;\n      n3 = p1->num;\n    }\n    if (p1->sum > m2 && p1->sum <= m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = p1->sum;\n      n2 = p1->num;\n    }\n    if (p1->sum > m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = m1;\n      n2 = n1;\n      m1 = p1->sum;\n      n1 = p1->num;\n    }\n  }\n  printf(\"%d %d \", n1, m1);\n  printf(\"%d %d \", n2, m2);\n  printf(\"%d %d \", n3, m3);\n}\n"}
{"label": "14", "index": "26297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  struct student {\n    int num;\n    int a;\n    int b;\n  } stu[100000];\n\n  int n, i, sum = 0, max1 = 0, max2 = 0, max3 = 0, t = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    sum = stu[i].a + stu[i].b;\n    if (sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = sum;\n    } else if ((sum < max1) && (sum > max2)) {\n      max3 = max2;\n      max2 = sum;\n    } else if ((sum < max2) && (sum > max3)) {\n      max3 = sum;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if (sum == max1) {\n      cout << stu[i].num << \" \" << max1 << \"\\n\";\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max2) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max2);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max3) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max3);\n      t++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[100000];\n  struct qiansan {\n    int num;\n    int zongfen;\n  } st[3] = {{0, 0}, {0, 0}, {0, 0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].zongfen > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = stu[i].zongfen;\n      st[0].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[0].zongfen &&\n               stu[i].zongfen > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = stu[i].zongfen;\n      st[1].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[1].zongfen &&\n               stu[i].zongfen > st[2].zongfen) {\n      st[2].zongfen = stu[i].zongfen;\n      st[2].num = stu[i].num;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    if (i == 0)\n      printf(\"%d %d\", st[i].num, st[i].zongfen);\n    else\n      printf(\" %d %d\", st[i].num, st[i].zongfen);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int mscore;\n  int cscore;\n  int total;\n} stu[100001];\nint main() {\n  int n, i, m = 0, b[201][100] = {0}, a[201][100] = {0}, j = 200, count = 3,\n            k = 0, c[201] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].mscore;\n    cin >> stu[i].cscore;\n    stu[i].total = stu[i].mscore + stu[i].cscore;\n  }\n  do {\n    b[stu[m].total][c[stu[m].total]] = stu[m].total;\n    a[stu[m].total][c[stu[m].total]] = stu[m].num;\n    if (c[stu[m].total] < 4)\n      c[stu[m].total]++;\n    m++;\n  } while (m < n);\n  for (j = 200; j >= 0; j--) {\n    for (k = 0; k < 100 && count > 0; k++) {\n      if (b[j][k] != 0) {\n        printf(\"%d %d\\n\", a[j][k], b[j][k]);\n        count--;\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "26300", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct data {\n  int id;\n  int cs;\n  int ms;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return ((struct data *)b)->s - ((struct data *)a)->s;\n}\nint main() {\n  struct data *a;\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  a = (struct data *)malloc(n * sizeof(struct data));\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].cs >> a[i].ms;\n    a[i].s = a[i].cs + a[i].ms;\n  }\n  qsort(a, n, sizeof(struct data), cmp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", a[i].id, a[i].s);\n  free(a);\n  return 0;\n}\n"}
{"label": "14", "index": "26301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    char ID[10];\n    int m;\n    int c;\n\n  } tmp;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int a1 = 0, a2 = 0, a3 = 0;\n  int n, i;\n\n  scanf(\"%d\", &n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s %d %d\", tmp.ID, &(tmp.m), &(tmp.c));\n    if ((tmp.m + tmp.c) > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = a1;\n      a1 = i;\n    } else if ((tmp.m + tmp.c) == max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    } else if ((tmp.m + tmp.c) < max1 && (tmp.m + tmp.c) > max2) {\n      max3 = max2;\n      max2 = tmp.m + tmp.c;\n      a3 = a2;\n      a2 = i;\n    }\n\n    else if ((tmp.m + tmp.c) == max2) {\n      max3 = max2;\n      a3 = atoi(tmp.ID);\n    } else if ((tmp.m + tmp.c) < max2 && (tmp.m + tmp.c) > max3) {\n      max3 = tmp.m + tmp.c;\n      a3 = i;\n    }\n  }\n\n  cout << a1 << \" \" << max1 << \"\\n\";\n  printf(\"%d %d\\n\", a2, max2);\n  printf(\"%d %d\\n\", a3, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int a;\n  int b;\n  int zong;\n};\nstruct student ren[100000];\n\nint main() {\n  int n, i, fen, flag = 0;\n\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    scanf(\"%d\", &ren[i].id);\n    scanf(\"%d\", &ren[i].a);\n    scanf(\"%d\", &ren[i].b);\n    ren[i].zong = ren[i].a + ren[i].b;\n  }\n\n  for (fen = 200; fen >= 100; fen--) {\n    for (i = 0; i <= n - 1; i++)\n      if (fen == ren[i].zong) {\n        printf(\"%d %d\\n\", ren[i].id, ren[i].zong);\n        flag = flag + 1;\n        if (flag == 3)\n          goto end;\n      }\n  }\nend:\n  getchar();\n}\n"}
{"label": "14", "index": "26303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct data {\n  int id;\n  int cs;\n  int ms;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return ((struct data *)b)->s - ((struct data *)a)->s;\n}\nint main() {\n  struct data *a;\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  a = (struct data *)malloc(n * sizeof(struct data));\n  for (i = 0; i < n; i++) {\n    cin >> a[i].id >> a[i].cs >> a[i].ms;\n    a[i].s = a[i].cs + a[i].ms;\n  }\n  qsort(a, n, sizeof(struct data), cmp);\n  for (i = 0; i < 3; i++)\n    cout << a[i].id << \" \" << a[i].s << \" \";\n  free(a);\n  return 0;\n}\n"}
{"label": "14", "index": "26304", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct {\n  int ID[100000], Chinese[100000], Maths[100000];\n} stu;\nint main() {\n  int n, i, sum[100000], max1 = 0, max2 = 0, max3 = 0, num1, num2, num3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu.ID[i] >> stu.Chinese[i] >> stu.Maths[i];\n  }\n  i = 0;\n  while (stu.ID[i] > 0) {\n    sum[i] = stu.Chinese[i] + stu.Maths[i];\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      num1 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max2 && sum[i] <= max1 && i != num1) {\n      max2 = sum[i];\n      num2 = i;\n    }\n    i++;\n  }\n  i = 0;\n  while (i < n) {\n    if (sum[i] > max3 && sum[i] <= max2 && i != num2 && i != num1) {\n      max3 = sum[i];\n      num3 = i;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", stu.ID[num1], max1, stu.ID[num2], max2,\n         stu.ID[num3], max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int number;\n\n  int total;\n};\nint main() {\n\n  int n;\n  cin >> n;\n  struct student a[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    int b, c;\n    cin >> a[i].number >> b >> c;\n    a[i].total = b + c;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j].total > a[i].total) {\n        t = a[i].total;\n        a[i].total = a[j].total;\n        a[j].total = t;\n        t = a[i].number;\n        a[i].number = a[j].number;\n        a[j].number = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i].number, a[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26306", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long num;\n  int Chi;\n  int Math;\n  int Sum;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->Chi, &p1->Math);\n    p1->Sum = p1->Chi + p1->Math;\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct stu *Bigthree(struct stu *head) {\n  int t;\n  struct stu *max, *premax, *New, *Newhead = NULL;\n  for (t = 0; t < 3; t++) {\n    premax = NULL;\n    max = head;\n    p2 = head;\n    p1 = head->next;\n    while (p1 != NULL) {\n      if ((p1->Sum) > (max->Sum)) {\n        premax = p2;\n        max = p1;\n      }\n      p2 = p2->next;\n      p1 = p1->next;\n    }\n    if (max == head)\n      head = head->next;\n    else\n      premax->next = max->next;\n    max->next = NULL;\n    if (t == 0) {\n      Newhead = max;\n      New = Newhead;\n    }\n\n    else\n      New = New->next = max;\n  }\n  New->next = NULL;\n  return (Newhead);\n}\n\nvoid output(struct stu *head) {\n  struct stu *p;\n  for (p = head; p != NULL; printf(\"%d %d\\n\", p->num, p->Sum), p = p->next)\n    ;\n}\n\nint main() {\n  int n;\n  struct stu *head;\n  cin >> n;\n  head = creat(n);\n  head = Bigthree(head);\n  output(head);\n}\n"}
{"label": "14", "index": "26307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int n;\n  int y;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return (((struct student *)b)->y > ((struct student *)a)->y ? 1 : -1);\n}\n\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  struct student s[100000];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].y, &s[i].s);\n    s[i].y = s[i].y + s[i].s;\n  }\n  qsort(s, num, sizeof(s[0]), cmp);\n  for (int i = 0; i < 3; i++)\n    printf(\"%d %d \", s[i].n, s[i].y);\n}\n"}
{"label": "14", "index": "26308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int score1;\n  int score2;\n  struct student *next;\n};\nstruct student *head;\nstruct student *creat(int x) {\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n  head = 0;\n  while (p1->id < x) {\n    if (p1->id == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n    if (p1->id == x) {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int n;\n  struct student *p, *q, *j, *k;\n  scanf(\"%d\", &n);\n  creat(n);\n  p = q = head;\n  do {\n    if ((p->score1 + p->score2) > (q->score1 + q->score2))\n      q = p;\n    p = p->next;\n  } while (p != 0);\n  p = j = head;\n  do {\n    if ((p->score1 + p->score2) > (j->score1 + j->score2) && p != q)\n      j = p;\n    p = p->next;\n  } while (p != 0);\n  p = k = head;\n  do {\n    if ((p->score1 + p->score2) > (k->score1 + k->score2) && p != q && p != j)\n      k = p;\n    p = p->next;\n  } while (p != 0);\n  printf(\"%d %d \", q->id, (q->score1 + q->score2));\n  printf(\"%d %d \", j->id, (j->score1 + j->score2));\n  printf(\"%d %d\", k->id, (k->score1 + k->score2));\n  return 0;\n}\n"}
{"label": "14", "index": "26309", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chin;\n  int sum;\n} st[100000], t;\nint main() {\n  int i, j;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &st[i].number, &st[i].math, &st[i].chin);\n    st[i].sum = st[i].math + st[i].chin;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n; j >= 1; j--)\n      if (st[j].sum > st[j - 1].sum) {\n        t = st[j - 1];\n        st[j - 1] = st[j];\n        st[j] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", st[i].number, st[i].sum);\n}\n"}
{"label": "14", "index": "26310", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint max_1 = 0;\n\nstruct student {\n  char id[20];\n  int chinese;\n  int math;\n  int sum;\n  int flag;\n  struct student *next;\n};\nstruct student *h;\nint n, i;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  i = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->id >> p1->chinese >> p1->math;\n  p1->sum = p1->chinese + p1->math;\n  p1->flag = 0;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p1->flag = 0;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *compare() {\n  struct student *p1, *p3;\n  p1 = h;\n  max_1 = p1->sum;\n  do {\n    if (p1->sum > max_1 && (p1->flag == 0))\n      max_1 = p1->sum;\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  p1 = h;\n  do {\n    if (p1->sum == max_1 && (p1->flag == 0)) {\n      p3 = p1;\n      p1->flag = 1;\n      break;\n    }\n    p1 = p1->next;\n  } while (p1->next != NULL);\n  return (p3);\n}\nint main() {\n  int j;\n  struct student *p;\n  cin >> n;\n  h = creat();\n  for (j = 1; j <= 3; j++) {\n    p = compare();\n    printf(\"%s %d \", p->id, p->sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int i;\n  int j;\n  int k;\n};\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student c[n + 10];\n  int m1 = 1, m2 = 1, m3 = 1;\n  for (int m = 1; m <= n; m++) {\n    scanf(\"%d %d %d\", &c[m].i, &c[m].j, &c[m].k);\n    if ((c[m].j + c[m].k) > (c[m1].j + c[m1].k)) {\n      m3 = m2;\n      m2 = m1;\n      m1 = m;\n    } else if ((c[m].j + c[m].k) > (c[m2].j + c[m2].k)) {\n      m3 = m2;\n      m2 = m;\n    } else if ((c[m].j + c[m].k) > (c[m3].j + c[m3].k))\n      m3 = m;\n  }\n  cout << c[m1].i << \" \" << c[m1].j + c[m1].k << \" \";\n  printf(\"%d %d \", c[m2].i, c[m2].j + c[m2].k);\n  printf(\"%d %d \", c[m3].i, c[m3].j + c[m3].k);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N, i, n[1000], c[1000], m[1000], sum[1000];\n  int x1 = 0, x2 = 0, x3 = 0, y1 = 0, y2 = 0, y3 = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    scanf(\"%d%d%d\", &n[i], &c[i], &m[i]);\n    sum[i] = c[i] + m[i];\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x1) {\n      x1 = sum[i];\n      y1 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x2 && sum[i] <= x1 && i != y1) {\n      x2 = sum[i];\n      y2 = i;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    if (sum[i] > x3 && sum[i] <= x2 && i != y1 && i != y2) {\n      x3 = sum[i];\n      y3 = i;\n    }\n  }\n  cout << y1 + 1 << \" \" << x1 << \" \" << y2 + 1 << \" \" << x2 << \" \" << y3 + 1\n       << \" \" << x3 << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "26313", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int maths;\n    int amount;\n  };\n  struct student stu[100000];\n  int a[100000], n, l, j, k;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n    a[i] = stu[i].chinese + stu[i].maths;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (int h = n - 1; h >= 0; h--) {\n    if (a[n - 1] == stu[h].chinese + stu[h].maths) {\n      l = stu[h].num;\n    }\n  }\n  for (int g = n - 1; g >= 0; g--) {\n    if (a[n - 2] == stu[g].chinese + stu[g].maths && (g + 1) != l) {\n      j = stu[g].num;\n    }\n  }\n  for (int f = n - 1; f >= 0; f--) {\n    if (a[n - 3] == stu[f].chinese + stu[f].maths && (f + 1) != j &&\n        (f + 1) != l) {\n      k = stu[f].num;\n    }\n  }\n  printf(\"%d %d\\n\", l, a[n - 1]);\n  printf(\"%d %d\\n\", j, a[n - 2]);\n  printf(\"%d %d\\n\", k, a[n - 3]);\n}\n"}
{"label": "14", "index": "26314", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long int num;\n  int chi;\n  int mat;\n  int tot;\n};\nint main() {\n  struct stu a[100050];\n  int n, i, j, max;\n  long int temp1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> a[i].chi >> a[i].mat;\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  for (j = 1; j <= 3; j++) {\n    max = 0;\n    a[0].tot = 0;\n    for (i = 1; i <= n; i++)\n      if (a[max].tot < a[i].tot)\n        max = i;\n    printf(\"%ld %d\\n\", a[max].num, a[max].tot);\n    a[max].tot = 0;\n  }\n  scanf(\"\\n\");\n  return (0);\n}\n"}
{"label": "14", "index": "26315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\ntypedef struct st {\n  int a, b;\n} stu;\nstu s[100000];\nint comp(const void *a, const void *b) { return ((stu *)b)->b - ((stu *)a)->b; }\nint main() {\n  int i, n, a, b;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].a, &a, &b);\n    s[i].b = a + b;\n  }\n  qsort(s, n, sizeof(stu), comp);\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].a, s[0].b, s[1].a, s[1].b, s[2].a, s[2].b);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct data {\n  long int num;\n  int point1;\n  int point2;\n  int sum;\n  struct data *next;\n};\nstruct data *creat(long int n) {\n  long int i = 0;\n  struct data *p1, *p2, *head;\n  p1 = p2 = (struct data *)malloc(sizeof(struct data));\n  scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n  p1->sum = p1->point1 + p1->point2;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n    p1->sum = p1->point1 + p1->point2;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct data *max(struct data *head) {\n  struct data *p1, *max;\n  max = head;\n  p1 = head;\n  do {\n    if (p1->sum > max->sum)\n      max = p1;\n    p1 = p1->next;\n  } while (p1 != NULL);\n  return (max);\n}\nstruct data *del(struct data *head, struct data *max) {\n  struct data *p1, *p2;\n  p1 = head;\n  while (max != p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head)\n    head = p1->next;\n  else {\n    p2->next = p1->next;\n  }\n  return (head);\n}\nint main() {\n  struct data *a, *b, *c, *head;\n  long int n;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  a = max(head);\n  cout << a->num << \" \" << a->sum << \"\\n\";\n  head = del(head, a);\n  b = max(head);\n  printf(\"%ld %d\\n\", b->num, b->sum);\n  c = max(del(head, b));\n  cout << c->num << \" \" << c->sum << \"\\n\";\n}\n"}
{"label": "14", "index": "26317", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\ntypedef struct {\n  int ID;\n  int chinese;\n  int math;\n  int sum;\n} Student;\n\nStudent topThree[3];\nint studentNum;\n\nvoid initialise() {\n  for (int i = 0; i < 3; i++)\n    topThree[i].sum = -1;\n}\n\nvoid updateTopThree(Student stu) {\n  for (int i = 0; i < 3; i++) {\n    if (stu.sum > topThree[i].sum) {\n      for (int j = 2; j > i; j--) {\n        topThree[j] = topThree[j - 1];\n      }\n\n      topThree[i] = stu;\n\n      break;\n    }\n  }\n}\n\nvoid getStudentData() {\n  Student temp;\n\n  cin >> studentNum;\n  for (int i = 0; i < studentNum; i++) {\n    scanf(\"%d %d %d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.sum = temp.chinese + temp.math;\n    updateTopThree(temp);\n  }\n}\n\nvoid printStudentData() {\n  for (int i = 0; i < 3 && i < studentNum; i++) {\n    printf(\"%d %d\\n\", topThree[i].ID, topThree[i].sum);\n  }\n}\n\nint main() {\n  initialise();\n  getStudentData();\n  printStudentData();\n\n  return 0;\n}\n"}
{"label": "14", "index": "26318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct score {\n  int id;\n  int chinese;\n  int maths;\n  int sum;\n};\nint main() {\n  score *p[100000], *temp, stu[100000];\n  int i, j, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    p[i] = &stu[i];\n    cin >> p[i]->id >> p[i]->chinese >> p[i]->maths;\n    p[i]->sum = p[i]->chinese + p[i]->maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (p[j]->sum > p[j - 1]->sum) {\n        temp = p[j];\n        p[j] = p[j - 1];\n        p[j - 1] = temp;\n      }\n  for (i = 0; i < 3; i++)\n    cout << p[i]->id << ' ' << p[i]->sum << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int mark1;\n    int mark2;\n    int total;\n  } student[100000], temp;\n  int n, k, m;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%d%d%d\", &student[k].ID, &student[k].mark1, &student[k].mark2);\n    student[k].total = student[k].mark1 + student[k].mark2;\n  }\n  for (m = 0; m < 3; m++) {\n    for (k = n - 1; k >= m; k--) {\n      if (student[k].total > student[k - 1].total) {\n        temp = student[k - 1];\n        student[k - 1] = student[k];\n        student[k] = temp;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", student[0].ID, student[0].total,\n         student[1].ID, student[1].total, student[2].ID, student[2].total);\n}\n"}
{"label": "14", "index": "26320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, t = 0, c = 1, d = 1, n, p = 0, q = 0, r = 0, *b;\n  struct pp {\n    int x;\n    int y;\n    int z;\n  } * s;\n  cin >> n;\n  b = (int *)malloc(sizeof(int) * n);\n  s = (struct pp *)malloc(sizeof(int) * 3 * n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i].x >> s[i].y >> s[i].z;\n    b[i] = ((s[i].y) + (s[i].z));\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > t) {\n      t = b[i];\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > c) && (i != p)) {\n        c = b[i];\n        q = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > d) && (i != p) && (i != q)) {\n        d = b[i];\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", s[p].x, b[p]);\n  cout << s[q].x << \" \" << b[q] << \"\\n\";\n  printf(\"%d %d\\n\", s[r].x, b[r]);\n  return 0;\n}\n"}
{"label": "14", "index": "26321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, max1 = 0, max2 = 0, max3 = 0, t1 = 0, t2 = 0, t3 = 0;\n  int ID[100000], y[100000], m[100000], s[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &ID[i], &y[i], &m[i]);\n  for (i = 0; i < n; i++)\n    s[i] = y[i] + m[i];\n  for (i = 0; i < n; i++) {\n    if (max1 < s[i]) {\n      max1 = s[i];\n      t1 = i;\n    }\n  }\n  s[t1] = 0;\n  for (i = 0; i < n; i++) {\n    if (max2 < s[i]) {\n      max2 = s[i];\n      t2 = i;\n    }\n  }\n  s[t2] = 0;\n  for (i = 0; i < n; i++) {\n    if (max3 < s[i]) {\n      max3 = s[i];\n      t3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", ID[t1], max1);\n  printf(\"%d %d\\n\", ID[t2], max2);\n  printf(\"%d %d\\n\", ID[t3], max3);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n\n  int total;\n};\nint main() {\n\n  int n;\n  cin >> n;\n  struct student a[n];\n  int i, j, t;\n  for (i = 0; i < n; i++) {\n    int b, c;\n    cin >> a[i].number >> b >> c;\n    a[i].total = b + c;\n  }\n\n  for (i = 0; i < 3; i++) {\n    for (j = i; j < n; j++) {\n      if (a[j].total > a[i].total) {\n        t = a[i].total;\n        a[i].total = a[j].total;\n        a[j].total = t;\n        t = a[i].number;\n        a[i].number = a[j].number;\n        a[j].number = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << a[i].number << ' ' << a[i].total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26323", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Stu {\n  int stuID;\n  int mark;\n} stu[3] = {0};\n\nint compare(const void *p1, const void *p2) {\n  struct Stu *a;\n  struct Stu *b;\n  a = (struct Stu *)p1;\n  b = (struct Stu *)p2;\n  if (a->mark > b->mark)\n    return -1;\n  if (a->mark < b->mark)\n    return 1;\n  if (a->mark == b->mark)\n    return 0;\n}\n\nint main() {\n  int n, i;\n  int ID, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> ID >> chi >> math;\n    if (chi + math > stu[2].mark) {\n      stu[2].mark = chi + math;\n      stu[2].stuID = ID;\n    }\n    qsort(stu, 3, sizeof(struct Stu), compare);\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].stuID, stu[i].mark);\n}\n"}
{"label": "14", "index": "26324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int ch;\n    int ma;\n    int to;\n  };\n  int i, j1, j2, j3, k, max;\n  struct stu student[100000] = {0};\n  struct stu temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    scanf(\"%d%d%d\", &student[i].num, &student[i].ch, &student[i].ma);\n    student[i].to = student[i].ch + student[i].ma;\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (student[i].to > max) {\n      max = student[i].to;\n      j1 = i;\n    }\n  }\n  printf(\"%d \", student[j1].num);\n  printf(\"%d\\n\", student[j1].to);\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j2 = i;\n    }\n  }\n  printf(\"%d \", student[j2].num);\n  printf(\"%d\\n\", student[j2].to);\n  max = 0;\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1 || i == j2)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j3 = i;\n    }\n  }\n  printf(\"%d \", student[j3].num);\n  printf(\"%d\\n\", student[j3].to);\n  return 0;\n}\n"}
{"label": "14", "index": "26325", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int No;\n    int chinese;\n    int math;\n    int total;\n  } stu[100000];\n  int i, j, x, y, z, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].chinese);\n    scanf(\"%d\", &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    x = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > x) {\n        x = stu[i].total;\n        y = stu[i].No;\n        z = i;\n      }\n    }\n    printf(\"%d %d\\n\", y, x);\n    stu[z].total = 0;\n  }\n}\n"}
{"label": "14", "index": "26326", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int no;\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu a, *head, *p, *tail, *q;\n  int k, i, m1, m2, m3, n1, n2, n3, temp1, temp2;\n  head = NULL;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    p = (struct stu *)malloc(1000);\n    cin >> p->no >> p->chi >> p->math;\n    p->sum = (p->chi + p->math);\n    if (head == NULL) {\n      head = tail = p;\n    } else {\n      tail->next = p;\n      tail = p;\n      tail->next = &a;\n    }\n  }\n  a.next = NULL;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m1 = p->no;\n  n1 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m2 = p->no;\n  n2 = p->sum;\n  head = p->next;\n  p = head;\n  for (q = p->next; q->next != NULL; q = q->next) {\n    if (p->sum < q->sum) {\n      temp1 = q->sum;\n      q->sum = p->sum;\n      p->sum = temp1;\n      temp2 = q->no;\n      q->no = p->no;\n      p->no = temp2;\n    }\n  }\n  m3 = p->no;\n  n3 = p->sum;\n  printf(\"%d %d %d %d %d %d \", m1, n1, m2, n2, m3, n3);\n}\n"}
{"label": "14", "index": "26327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  int max1 = 2, max2 = 1, max3 = 0, num1 = 0, num2 = 0, num3 = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > max1) {\n      max3 = max2;\n      num3 = num2;\n      max2 = max1;\n      num2 = num1;\n      max1 = stu[i].zongfen;\n      num1 = i;\n    } else if (stu[i].zongfen <= max1 && stu[i].zongfen > max2) {\n      max3 = max2;\n      num3 = num2;\n      max2 = stu[i].zongfen;\n      num2 = i;\n    } else if (stu[i].zongfen <= max2 && stu[i].zongfen > max3) {\n      max3 = stu[i].zongfen;\n      num3 = i;\n    }\n  }\n  printf(\"%d %d\\n\", stu[num1].xuehao, stu[num1].zongfen);\n  printf(\"%d %d\\n\", stu[num2].xuehao, stu[num2].zongfen);\n  printf(\"%d %d\\n\", stu[num3].xuehao, stu[num3].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long int n, a[100000][2];\n  int i, j, t, s;\n  struct Student {\n    int num;\n    int yu;\n    int shu;\n  };\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    struct Student studenti;\n    scanf(\"%d%d%d\", &studenti.num, &studenti.yu, &studenti.shu);\n    a[i][0] = studenti.num;\n    a[i][1] = studenti.yu + studenti.shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j][1] >= a[j + 1][1]) {\n        t = a[j][1];\n        a[j][1] = a[j + 1][1];\n        a[j + 1][1] = t;\n        s = a[j][0];\n        a[j][0] = a[j + 1][0];\n        a[j + 1][0] = s;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", a[n - i][0], a[n - i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "26329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[3][2], k;\n  struct student {\n    int num;\n    int s1;\n    int s2;\n    int l;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].l = stu[i].s1 + stu[i].s2;\n  }\n  for (i = 0; i < 3; i++) {\n    for (m = 0, j = 0; j < n; j++) {\n      if (m < stu[j].l) {\n        m = stu[j].l;\n        k = j;\n      }\n    }\n    a[i][0] = k;\n    a[i][1] = m;\n    stu[k].l = 0;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i][0] + 1, a[i][1]);\n}\n"}
{"label": "14", "index": "26330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nstruct Student {\n  int num;\n  int mscore;\n  int cscore;\n  int total;\n} stu[100001];\nint main() {\n  int n, i, m = 0, b[201][100] = {0}, a[201][100] = {0}, j = 200, count = 3,\n            k = 0, c[201] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].mscore;\n    cin >> stu[i].cscore;\n    stu[i].total = stu[i].mscore + stu[i].cscore;\n  }\n  do {\n    b[stu[m].total][c[stu[m].total]] =\n        stu[m].total; \n    a[stu[m].total][c[stu[m].total]] = stu[m].num; \n    if (c[stu[m].total] < 4)\n      c[stu[m].total]++; \n    m++;\n  } while (m < n);\n  for (j = 200; j >= 0; j--) {\n    for (k = 0; k < 100 && count > 0; k++) {\n      if (b[j][k] != 0) {\n        cout << a[j][k] << \" \" << b[j][k] << endl;\n        count--;\n      } \n    }\n  }\n}\n"}
{"label": "14", "index": "26331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int Chinese;\n  int math;\n} a[100000];\nint main() {\n  int n, i, first, second, third, h1 = 0, h2 = 0, h3 = 0, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].Chinese, &a[i].math);\n  }\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    if (first < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = first;\n      h2 = h1;\n      first = a[i].Chinese + a[i].math;\n      h1 = a[i].id;\n    } else if (first == (a[i].Chinese + a[i].math) && first > second) {\n      third = second;\n      h3 = h2;\n      h2 = a[i].id;\n      second = a[i].Chinese + a[i].math;\n    } else if (first == (a[i].Chinese + a[i].math) && first == second &&\n               second > third) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    } else if (first > (a[i].Chinese + a[i].math) &&\n               second < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = a[i].Chinese + a[i].math;\n      h2 = a[i].id;\n    } else {\n      if (second > (a[i].Chinese + a[i].math) &&\n          third < (a[i].Chinese + a[i].math)) {\n        third = a[i].Chinese + a[i].math;\n        h3 = a[i].id;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, second, h3, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Stu {\n  int stuID;\n  int mark;\n} stu[3] = {0};\n\nint compare(const void *p1, const void *p2) {\n  struct Stu *a;\n  struct Stu *b;\n  a = (struct Stu *)p1;\n  b = (struct Stu *)p2;\n  if (a->mark > b->mark)\n    return -1;\n  if (a->mark < b->mark)\n    return 1;\n  if (a->mark == b->mark)\n    return 0;\n}\n\nint main() {\n  int n, i;\n  int ID, chi, math;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &ID, &chi, &math);\n    if (chi + math > stu[2].mark) {\n      stu[2].mark = chi + math;\n      stu[2].stuID = ID;\n    }\n    qsort(stu, 3, sizeof(struct Stu), compare);\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].stuID, stu[i].mark);\n  return 0;\n}\n"}
{"label": "14", "index": "26333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, b, c, d;\n  struct {\n    int sn;\n    int chi;\n    int mat;\n    int sum;\n  } a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].sn, &a[i].chi, &a[i].mat);\n    a[i].sum = a[i].chi + a[i].mat;\n  }\n  b = n;\n  c = n;\n  d = n;\n  a[n].sum = -100;\n  for (i = 0; i < n; i++) {\n    if (a[b].sum >= a[i].sum)\n      b = b;\n    else\n      b = i;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != b) {\n      if (a[c].sum >= a[i].sum)\n        c = c;\n      else\n        c = i;\n    } else\n      ;\n  }\n  for (i = 0; i < n; i++) {\n    if (i != c & i != b) {\n      if (a[d].sum >= a[i].sum)\n        d = d;\n      else\n        d = i;\n    } else\n      ;\n  }\n  printf(\"%d %d\\n\", a[b].sn, a[b].sum);\n  printf(\"%d %d\\n\", a[c].sn, a[c].sum);\n  printf(\"%d %d\\n\", a[d].sn, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26334", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, max1, xue1, max2, xue2, max3, xue3;\nstruct chengji {\n  int xh;\n  int yw;\n  int sx;\n  int zf;\n  struct chengji *next;\n};\n\nvoid create() {\n  struct chengji *head;\n  struct chengji *p1;\n  int i = 0;\n  while (i < n) {\n    i++;\n    if (i == 1)\n      head = p1;\n    p1 = (struct chengji *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    if ((p1->zf) > max1) {\n      xue3 = xue2;\n      max3 = max2;\n      xue2 = xue1;\n      max2 = max1;\n      xue1 = p1->xh;\n      max1 = p1->zf;\n\n    } else {\n      if ((p1->zf) > max2 && (p1->zf) <= max1) {\n        xue3 = xue2;\n        max3 = max2;\n        xue2 = p1->xh;\n        max2 = p1->zf;\n      } else {\n        if ((p1->zf) > max3 && (p1->zf) <= max2) {\n          xue3 = p1->xh;\n          max3 = p1->zf;\n        }\n      }\n    }\n\n    p1 = p1->next;\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  max1 = 0, max2 = 0, max3 = 0;\n  create();\n  printf(\"%d %d \", xue1, max1);\n  printf(\"%d %d \", xue2, max2);\n  printf(\"%d %d\", xue3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[100001];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct {\n    int id, chin, math, su;\n  } s[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].id, &s[i].chin, &s[i].math);\n    s[i].su = s[i].chin + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i].su < s[j].su) {\n        s[100000] = s[i];\n        s[i] = s[j];\n        s[j] = s[100000];\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].id, s[0].su, s[1].id, s[1].su, s[2].id,\n         s[2].su);\n  return 0;\n}\n"}
{"label": "14", "index": "26336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int xuehao;\n  int shuxue;\n  int yuwen;\n  int zongfen;\n};\n\nint main() {\n  int n, i, e, j;\n  scanf(\"%d\", &n);\n\n  struct student stu[100001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].xuehao, &stu[i].shuxue, &stu[i].yuwen);\n    stu[i].zongfen = stu[i].shuxue + stu[i].yuwen;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (stu[j].zongfen >= stu[j + 1].zongfen) {\n        stu[100000] = stu[j + 1];\n        stu[j + 1] = stu[j];\n        stu[j] = stu[100000];\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].xuehao, stu[i].zongfen);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char number[20];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n} stu[100000], *s1, *s2, *s3;\n\nint n, max1 = 0, max2 = 0, max3 = 0;\n\nstruct student *creat(void) {\n  int i;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  for (i = 0; i < n; i++) {\n    cin >> p1->number >> p1->chinese >> p1->math;\n    p2 = p1;\n    p1->sum = p1->chinese + p1->math;\n    if (p1->sum > max1) {\n      max3 = max2;\n      s3 = s2;\n      max2 = max1;\n      s2 = s1;\n      max1 = p1->sum;\n      s1 = p1;\n    } else if (p1->sum > max2) {\n      max3 = max2;\n      s3 = s2;\n      max2 = p1->sum;\n      s2 = p1;\n    } else if (p1->sum > max3) {\n      max3 = p1->sum;\n      s3 = p1;\n    }\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n\n    p1 = (struct student *)malloc(1000);\n  }\n  p1 = NULL;\n  return (head);\n}\n\nint main() {\n  struct student *p;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%s %d \", s1->number, s1->sum);\n  cout << s2->number << \" \" << s2->sum << \" \";\n  printf(\"%s %d\", s3->number, s3->sum);\n}\n"}
{"label": "14", "index": "26338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n    int total;\n  } stu1, stu2, stu3, temp;\n  int i, n;\n  stu1.total = 0;\n  stu2.total = 0;\n  stu3.total = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.ID, &temp.chinese, &temp.math);\n    temp.total = temp.chinese + temp.math;\n    if (temp.total > stu1.total) {\n      stu3 = stu2;\n      stu2 = stu1;\n      stu1 = temp;\n    } else if (temp.total <= stu1.total && temp.total > stu2.total) {\n      stu3 = stu2;\n      stu2 = temp;\n    } else if (temp.total <= stu2.total && temp.total > stu3.total)\n      stu3 = temp;\n  }\n  printf(\"%d %d\\n\", stu1.ID, stu1.total);\n  printf(\"%d %d\\n\", stu2.ID, stu2.total);\n  printf(\"%d %d\\n\", stu3.ID, stu3.total);\n}\n"}
{"label": "14", "index": "26339", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int no;\n  int ch;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(long n) {\n  long i;\n  struct student *head, *p, *q;\n  head = (struct student *)malloc(1000);\n  p = (struct student *)malloc(1000);\n  head->next = q = p;\n  scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n  p->sum = (p->ch) + (p->math);\n\n  for (i = 1; i < n; i++) {\n    p = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n    p->sum = (p->ch) + (p->math);\n    q->next = p;\n    q = p;\n    p->next = NULL;\n  }\n  \n  return (head);\n}\n\nvoid sort(struct student *head) {\n  struct student *p, *q1, *q2, *q3;\n  int m1, m2, m3;\n  for (p = head->next, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1) {\n      m1 = p->sum;\n      q1 = p;\n    }\n  printf(\"%d %d \", q1->no, q1->sum);\n  for (p = head->next, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1) {\n      m2 = p->sum;\n      q2 = p;\n    }\n  printf(\"%d %d \", q2->no, q2->sum);\n  for (p = head->next, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2) {\n      m3 = p->sum;\n      q3 = p;\n    }\n  printf(\"%d %d \", q3->no, q3->sum);\n}\n\nint main() {\n  long n;\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  sort(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26340", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  int d;\n};\nint main() {\n  int i, j, n;\n  struct stu *p1, p2;\n  cin >> n;\n  p1 = (struct stu *)calloc(n, sizeof(struct stu));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &(p1[i].a), &(p1[i].b), &(p1[i].c));\n    p1[i].d = p1[i].b + p1[i].c;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (p1[i].d < p1[j].d) {\n        p2 = p1[i];\n        p1[i] = p1[j];\n        p1[j] = p2;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", p1[i].a, p1[i].d);\n}\n"}
{"label": "14", "index": "26341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].math, &stu[i].chn);\n    stu[i].sum = stu[i].math + stu[i].chn;\n  }\n  int j, sum[100000], order[4] = {n - 1}, t, m;\n  struct student temp;\n  for (j = n - 1; j >= n - 3; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  printf(\"%d %d \", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d \", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d \", stu[n - 3].num, stu[n - 3].sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct point {\n  int id, a, b, c;\n} s[100000], tmp;\nint main(int argc, char *argv[]) {\n\n  int i, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].id, &s[i].a, &s[i].b);\n    s[i].c = s[i].a + s[i].b;\n  }\n  for (i = 1; i < n; i++) {\n    if (s[i].c > s[0].c) {\n      tmp = s[0];\n      s[0] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    if (s[i].c > s[1].c) {\n      tmp = s[1];\n      s[1] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].c > s[2].c) {\n      tmp = s[2];\n      s[2] = s[i];\n      s[i] = tmp;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << s[i].id << \" \" << s[i].c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int number;\n  struct student stu[100000];\n  scanf(\"%d\\n\", &number);\n  for (int i = 1; i <= number; ++i) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (int i = 1; i <= 3; ++i) {\n    for (int j = i + 1; j <= number; ++j) {\n      if (stu[i].total < stu[j].total) {\n        struct student temp;\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n    }\n    printf(\"%d %d\\n\", stu[i].id, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum[99999];\nint m[99999];\nint main(int argc, char *argv[]) {\n  int n, i, b, c, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a, &b, &c);\n    sum[i] = b + c;\n    m[i] = a;\n  }\n  int j, k, t, x, l = 0;\n  for (j = 0; j < n; j++) {\n    for (k = n - 1; k > j; k--) {\n      if (sum[k] > sum[k - 1]) {\n        t = sum[k - 1];\n        sum[k - 1] = sum[k];\n        sum[k] = t;\n        x = m[k - 1];\n        m[k - 1] = m[k];\n        m[k] = x;\n      }\n    }\n    l++;\n    if (l == 3)\n      break;\n  }\n  for (i = 0; i < l; i++) {\n    printf(\"%d %d\\n\", m[i], sum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26345", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  char num[10];\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  int t = n;\n  while (n > 1) {\n    if (n == t)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%s %d %d\", p1->num, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    n--;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  int n, i;\n  struct student *first, *second, *third;\n  int fir_index, sec_index, thr_index;\n  scanf(\"%d\", &n);\n  struct student *head, *p1;\n  struct student stu;\n  head = creat(n);\n  first = head;\n  second = head;\n  third = head;\n  for (p1 = head; p1->next != NULL; p1 = p1->next) {\n    if (p1->sum > first->sum) {\n      third = second;\n      second = first;\n      first = p1;\n    } else if (p1->sum > second->sum) {\n      third = second;\n      second = p1;\n    } else if (p1->sum > third->sum) {\n      third = p1;\n    }\n  }\n  printf(\"%s %d \", first->num, first->sum);\n  printf(\"%s %d \", second->num, second->sum);\n  printf(\"%s %d \", third->num, third->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  struct stu {\n    int id;\n    int x, y;\n\n  } stu[100000];\n  int no1 = 0;\n  int no2 = 0;\n  int no3 = 0;\n  int i;\n  int N1, N2, N3;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].x, &stu[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    if ((stu[i].x + stu[i].y) > no1) {\n      no2 = no1;\n      no1 = (stu[i].x + stu[i].y);\n      N2 = N1;\n      N1 = i;\n    } else if ((stu[i].x + stu[i].y) > no2) {\n      no3 = no2;\n      no2 = (stu[i].x + stu[i].y);\n      N3 = N2;\n      N2 = i;\n    } else if ((stu[i].x + stu[i].y) > no3) {\n      no3 = (stu[i].x + stu[i].y);\n      N3 = i;\n    }\n  }\n  cout << stu[N1].id << \" \" << (stu[N1].x + stu[N1].y) << \"\\n\"\n       << stu[N2].id << \" \" << (stu[N2].x + stu[N2].y) << \"\\n\"\n       << stu[N3].id << \" \" << (stu[N3].x + stu[N3].y);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26347", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n};\nint main() {\n  struct student a[100000];\n  int n, i, sf = 0, ss = 0, st = 0, f, s, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].number, &a[i].math, &a[i].chinese);\n    a[i].total = a[i].math + a[i].chinese;\n    if (a[i].total > sf) {\n      t = s;\n      st = ss;\n      s = f;\n      ss = sf;\n      f = i;\n      sf = a[i].total;\n    } else if (a[i].total > ss) {\n      t = s;\n      st = ss;\n      s = i;\n      ss = a[i].total;\n    } else if (a[i].total > st) {\n      t = i;\n      st = a[i].total;\n    }\n  }\n  printf(\"%d %d\\n\", f + 1, sf);\n  printf(\"%d %d\\n\", s + 1, ss);\n  printf(\"%d %d\\n\", t + 1, st);\n  return 0;\n}\n"}
{"label": "14", "index": "26348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long num;\n  int chi;\n  int math;\n  int add;\n};\nstruct student stu[100000];\nint main() {\n  int m, k, n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].num, &stu[i].chi, &stu[i].math);\n    stu[i].add = stu[i].chi + stu[i].math;\n  }\n  for (j = 0; j < 3; j++)\n    for (i = n - 1; i > 0; i--) {\n      if (stu[i].add > stu[i - 1].add) {\n        k = stu[i].add;\n        stu[i].add = stu[i - 1].add;\n        stu[i - 1].add = k;\n        m = stu[i].num;\n        stu[i].num = stu[i - 1].num;\n        stu[i - 1].num = m;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d\\n\", stu[i].num, stu[i].add);\n  return 0;\n}\n"}
{"label": "14", "index": "26349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int n;\n  int y;\n  int s;\n};\nint cmp(const void *a, const void *b) {\n  return (((struct student *)b)->y > ((struct student *)a)->y ? 1 : -1);\n}\n\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  struct student s[100000];\n  for (int i = 0; i < num; i++) {\n    scanf(\"%d %d %d\", &s[i].n, &s[i].y, &s[i].s);\n    s[i].y = s[i].y + s[i].s;\n  }\n  qsort(s, num, sizeof(s[0]), cmp);\n  for (int i = 0; i < 3; i++) {\n    printf(\"%d %d \", s[i].n, s[i].y);\n  }\n}\n"}
{"label": "14", "index": "26350", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int stuNum, i;\n  cin >> stuNum;\n  struct student {\n    int id, math, chinese, total;\n  }; \n  struct student stu[stuNum], first, second, third;\n  for (i = 0; i < stuNum; i++) { \n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  \n  first = second = third = stu[0];\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > first.total)\n      first = stu[i];\n  cout << first.id << ' ' << first.total << endl;\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > second.total && stu[i].id != first.id)\n      second = stu[i];\n  cout << second.id << ' ' << second.total << endl;\n  for (i = 1; i < stuNum; i++)\n    if (stu[i].total > third.total && stu[i].id != first.id &&\n        stu[i].id != second.id)\n      third = stu[i];\n  cout << third.id << ' ' << third.total << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].math, &stu[i].chn);\n    stu[i].sum = stu[i].math + stu[i].chn;\n  }\n  int j;\n  struct student temp;\n  for (j = n - 1; j >= n - 3; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  printf(\"%d %d \", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d \", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d \", stu[n - 3].num, stu[n - 3].sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\n\nint main() {\n  int n, i, sum[100000], max = 0, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    sum[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j) {\n      max = sum[i];\n      k = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j && i != k) {\n      max = sum[i];\n      l = i;\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[j].num, sum[j], stu[k].num, sum[k],\n         stu[l].num, sum[l]);\n  return 0;\n}\n"}
{"label": "14", "index": "26353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct data {\n  long int num;\n  int point1;\n  int point2;\n  int sum;\n  struct data *next;\n};\nstruct data *creat(long int n) {\n  long int i = 0;\n  struct data *p1, *p2, *head;\n  p1 = p2 = (struct data *)malloc(sizeof(struct data));\n  cin >> p1->num >> p1->point1 >> p1->point2;\n  p1->sum = p1->point1 + p1->point2;\n  head = NULL;\n  while (i < n) {\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct data *)malloc(sizeof(struct data));\n    scanf(\"%ld %d %d\", &p1->num, &p1->point1, &p1->point2);\n    p1->sum = p1->point1 + p1->point2;\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct data *max(struct data *head) {\n  struct data *p1, *max;\n  max = head;\n  p1 = head;\n  do {\n    if (p1->sum > max->sum)\n      max = p1;\n    p1 = p1->next;\n  } while (p1 != NULL);\n  return (max);\n}\nstruct data *del(struct data *head, struct data *max) {\n  struct data *p1, *p2;\n  p1 = head;\n  while (max != p1) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p1 == head)\n    head = p1->next;\n  else\n    p2->next = p1->next;\n\n  return (head);\n}\nint main() {\n  struct data *a, *b, *c, *head;\n  long int n;\n  scanf(\"%ld\", &n);\n  head = creat(n);\n  a = max(head);\n  printf(\"%ld %d\\n\", a->num, a->sum);\n  head = del(head, a);\n  b = max(head);\n  printf(\"%ld %d\\n\", b->num, b->sum);\n  c = max(del(head, b));\n  printf(\"%ld %d\\n\", c->num, c->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26354", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  struct stu *head, *p1, *p2, *p0;\n  int n, i, ch, ma, len;\n  cin >> n;\n  len = sizeof(struct stu);\n  p1 = p2 = (struct stu *)malloc(len);\n  head = p1;\n  cin >> p1->id >> ch >> ma;\n  p1->sum = ch + ma;\n  p1->next = 0;\n  for (i = 2; i <= n; i++) {\n    p0 = (struct stu *)malloc(len);\n    scanf(\"%d %d %d\", &p0->id, &ch, &ma);\n    p0->sum = ch + ma;\n\n    p1 = p2 = head;\n    while ((p0->sum <= p1->sum) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->sum > p1->sum) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n    if (i > 3) {\n      p1 = head->next;\n      p1 = p1->next;\n      p1->next = 0;\n    }\n  }\n  p1 = head;\n  while (p1 != 0) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct gpa {\n    int num;\n    int math;\n    int chin;\n    int total;\n  } STUDENT_NUM[100000], first, second, third;\n\n  int num, math, chin;\n  long n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> num;\n    scanf(\"%d\", &math);\n    scanf(\"%d\", &chin);\n    STUDENT_NUM[i].num = num;\n    STUDENT_NUM[i].math = math;\n    STUDENT_NUM[i].chin = chin;\n    STUDENT_NUM[i].total = math + chin;\n  }\n\n  first.num = 0;\n  first.total = 0;\n  second.num = 0;\n  second.total = 0;\n  third.num = 0;\n  third.total = 0;\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > first.total) {\n      first.num = STUDENT_NUM[i].num;\n      first.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == first.num) {\n      STUDENT_NUM[i].total = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > second.total) {\n      second.num = STUDENT_NUM[i].num;\n      second.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].num == second.num)\n      STUDENT_NUM[i].total = 0;\n  }\n  for (i = 1; i <= n; i++) {\n    if (STUDENT_NUM[i].total > third.total) {\n      third.num = STUDENT_NUM[i].num;\n      third.total = STUDENT_NUM[i].total;\n    }\n  }\n\n  cout << first.num << \" \" << first.total << \"\\n\";\n  printf(\"%d %d\\n\", second.num, second.total);\n  printf(\"%d %d\\n\", third.num, third.total);\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int chinese;\n  int maths;\n} stu[100000];\n\nint main() {\n  int i, j, n, sum[100000], max = 0, m;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].num, &stu[i].chinese, &stu[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].chinese + stu[i].maths;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i] > max) {\n        max = sum[i];\n        m = i;\n      }\n    }\n    printf(\"%d %d\\n\", stu[m].num, sum[m]);\n    sum[m] = 0;\n    max = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int sum[100000];\n  int max1, max2, max3;\n  int x = 0;\n  scanf(\"%d\", &n);\n  struct {\n    int number;\n    int chin;\n    int math;\n  } student[100000];\n  for (i = 0; i < n; i++) {\n    cin >> student[i].number >> student[i].chin >> student[i].math;\n    sum[i] = student[i].chin + student[i].math;\n  }\n  max1 = sum[0];\n  max2 = sum[0];\n  max3 = sum[0];\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max1)\n      max1 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sum[i] == max1) {\n      cout << student[i].number << \" \" << sum[i] << \"\\n\";\n      x++;\n    }\n    if (x >= 3)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max2) && (sum[i] != max1))\n      max2 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max2) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max3) && (sum[i] != max1) && (sum[i] != max2))\n      max3 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max3) {\n      cout << student[i].number << \" \" << sum[i];\n      x++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26358", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x[100000];\n  int i, j, n, s, y, p;\n  int b[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y, &p);\n    b[i] = y + p;\n  }\n  int t;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] > b[i]) {\n        s = x[i];\n        x[i] = x[j];\n        x[j] = s;\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", x[i], b[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n  struct Student *next;\n};\n\nstruct Student *insert(struct Student *head, struct Student *stu) {\n  int j = 0;\n  struct Student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stu;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->total <= p1->total) && (p1->next != NULL) && j < 4) {\n      p2 = p1;\n      p1 = p1->next;\n      j++;\n    }\n    if (p0->total > p1->total) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct Student *p1, *head, *stu;\n  long int i, n;\n  scanf(\"%ld\", &n);\n  p1 = head = (struct Student *)malloc(sizeof(struct Student));\n  cin >> head->id >> head->chn >> head->mth;\n  head->total = head->chn + head->mth;\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    stu = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &stu->id, &stu->chn, &stu->mth);\n    stu->total = stu->chn + stu->mth;\n    head = insert(head, stu);\n  }\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    cout << p1->id << \" \" << p1->total << \"\\n\";\n    p1 = p1->next;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n    struct stu *next;\n    struct stu *back;\n  };\n  struct stu *head, *p1, *p2, *p, *pmax1, *pmax2, *pmax3;\n  int n, i, j, max1, max2, max3;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    p2->next = p1;\n    p1->back = p2;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p = head;\n  max1 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max1 < (p->b + p->c)) {\n      max1 = p->b + p->c;\n      pmax1 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max2 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max2 < (p->b + p->c) && (p != pmax1)) {\n      max2 = p->b + p->c;\n      pmax2 = p;\n    }\n    p = p->next;\n  }\n  p = head;\n  max3 = 0;\n  for (i = 0; i < n; i++) {\n\n    if (max3 < (p->b + p->c) && (p != pmax1) && (p != pmax2)) {\n      max3 = p->b + p->c;\n      pmax3 = p;\n    }\n    p = p->next;\n  }\n  printf(\"%ld %d\\n\", pmax1->a, (pmax1->b + pmax1->c));\n  printf(\"%ld %d\\n\", pmax2->a, (pmax2->b + pmax2->c));\n  printf(\"%ld %d\\n\", pmax3->a, (pmax3->b + pmax3->c));\n  return 0;\n}\n"}
{"label": "14", "index": "26361", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  char yw;\n  char sx;\n  int zf;\n  int pm;\n};\nint main() {\n  struct student a[100000], b[2];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i].id, &a[i].yw, &a[i].sx);\n  for (i = 0; i < n; i++)\n    a[i].zf = a[i].yw + a[i].sx;\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j) {\n      j = a[i].zf;\n      b[0] = a[i];\n    }\n  printf(\"%d %d\\n\", b[0].id, b[0].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id) {\n      j = a[i].zf;\n      b[1] = a[i];\n    }\n  printf(\"%d %d\\n\", b[1].id, b[1].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id && a[i].id != b[1].id) {\n      j = a[i].zf;\n      b[2] = a[i];\n    }\n  printf(\"%d %d\\n\", b[2].id, b[2].zf);\n}\n"}
{"label": "14", "index": "26362", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint k[99999];\n\nint x[99999];\nint main() {\n  int n, i, a, b, c, j, r, t, m = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a >> b >> c;\n    k[a - 1] = b + c;\n    x[i] = a;\n  }\n  for (j = n - 1; j >= 0; j--) {\n    for (r = 0; r < j; r++) {\n      if (k[r] >= k[r + 1]) {\n        t = k[r + 1];\n        k[r + 1] = k[r];\n        k[r] = t;\n        t = x[r + 1];\n        x[r + 1] = x[r];\n        x[r] = t;\n      }\n    }\n    m++;\n    if (m > 3)\n      break;\n  }\n\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x[n - 1], k[n - 1], x[n - 2], k[n - 2],\n         x[n - 3], k[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n} stu[100000];\n\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  max[0] = 0;\n  for (j = 0, k = 0; j < n; j++) {\n    if (sum[j] > max[0]) {\n      max[0] = sum[j];\n      k = j;\n    }\n  }\n\n  max[1] = 0;\n  for (j = 1, m = 0; j < n; j++) {\n    if ((sum[j] > max[1]) && (j != k)) {\n      max[1] = sum[j];\n      m = j;\n    }\n  }\n\n  max[2] = 0;\n  for (j = 1, o = 0; j < n; j++) {\n    if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n      max[2] = sum[j];\n      o = j;\n    }\n  }\n\n  printf(\"%d %d \", stu[k].name, sum[k]);\n  printf(\"%d %d \", stu[m].name, sum[m]);\n  printf(\"%d %d \", stu[o].name, sum[o]);\n}\n"}
{"label": "14", "index": "26364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int id;\n  int c;\n  int m;\n  int sum;\n};\nint main() {\n  struct Student temp, s1, s2, s3;\n  int i, n;\n  s1.sum = s2.sum = s3.sum = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.id, &temp.c, &temp.m);\n    temp.sum = temp.c + temp.m;\n    if (temp.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = temp;\n    } else if (temp.sum > s2.sum) {\n      s3 = s2;\n      s2 = temp;\n    } else if (temp.sum > s3.sum) {\n      s3 = temp;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26365", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, max;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    struct student *next;\n  };\n  struct student *head, *ppre, *p0, *p3;\n  struct student *p1, *p2;\n  head = p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL; \n\n  for (j = 0; j < 3; j++) {\n    ppre = p1 = head;\n    max = p1->yuwen + p1->shuxue;\n    p1 = p1->next;\n    for (i = 0; i < n - j; i++) {\n      if ((p1->yuwen + p1->shuxue) > max) {\n        max = p1->yuwen + p1->shuxue;\n        p0 = p1;\n        p3 = ppre;\n      }\n      ppre = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p0->num, max);\n    p3->next = p0->next;\n  }\n}\n"}
{"label": "14", "index": "26366", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j, e1, e2;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        e1 = stu[i + 1].sum;\n        e2 = stu[i + 1].num;\n        stu[i + 1].sum = stu[i].sum;\n        stu[i + 1].num = stu[i].num;\n        stu[i].sum = e1;\n        stu[i].num = e2;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, q, c, d;\n  int a[100000];\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int score1;\n    int score2;\n  } stu[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n  }\n  for (i = 0; i < n; i++) {\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  int max1, max2, max3;\n  int num1, num2, num3;\n  if (a[0] >= a[1]) {\n    max1 = a[0];\n    num1 = 0;\n    if (a[0] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[0];\n      num2 = 0;\n      max3 = a[1];\n      num3 = 1;\n    } else {\n      if (a[1] >= a[2]) {\n        max2 = a[1];\n        num2 = 1;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[1];\n        num3 = 1;\n      }\n    }\n  } else {\n    max1 = a[1];\n    num1 = 1;\n    if (a[1] < a[2]) {\n      max1 = a[2];\n      num1 = 2;\n      max2 = a[1];\n      num2 = 1;\n      max3 = a[0];\n      num3 = 0;\n    } else {\n      if (a[0] >= a[2]) {\n        max2 = a[0];\n        num2 = 0;\n        max3 = a[2];\n        num3 = 2;\n      } else {\n        max2 = a[2];\n        num2 = 2;\n        max3 = a[0];\n        num3 = 0;\n      }\n    }\n  }\n  for (i = 3; i < n; i++) {\n    if (a[i] > max1) {\n      p = max1;\n      q = max2;\n      c = num1;\n      d = num2;\n      max1 = a[i];\n      max2 = p;\n      max3 = q;\n      num1 = i;\n      num2 = c;\n      num3 = d;\n    } else {\n      if (a[i] > max2 && a[i] <= max1) {\n        p = max2;\n        c = num2;\n        max2 = a[i];\n        max3 = p;\n        num2 = i;\n        num3 = c;\n      } else {\n        if (a[i] > max3 && a[i] <= max2) {\n          max3 = a[i];\n          num3 = i;\n        }\n      }\n    }\n  }\n  cout << num1 + 1 << \" \" << a[num1] << \"\\n\"\n       << num2 + 1 << \" \" << a[num2] << \"\\n\"\n       << num3 + 1 << \" \" << a[num3] << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int no;\n  int ch;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(long n) {\n  long i;\n  struct student *head, *p, *q;\n  head = (struct student *)malloc(1000);\n  p = (struct student *)malloc(1000);\n  head->next = q = p;\n  scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n  p->sum = (p->ch) + (p->math);\n\n  for (i = 1; i < n; i++) {\n    p = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n    p->sum = (p->ch) + (p->math);\n    q->next = p;\n    q = p;\n    p->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid sort(struct student *head) {\n  struct student *p, *q1, *q2, *q3;\n  int m1, m2, m3;\n  for (p = head->next, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1) {\n      m1 = p->sum;\n      q1 = p;\n    }\n  cout << q1->no << \" \" << q1->sum << \" \";\n  for (p = head->next, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1) {\n      m2 = p->sum;\n      q2 = p;\n    }\n  printf(\"%d %d \", q2->no, q2->sum);\n  for (p = head->next, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2) {\n      m3 = p->sum;\n      q3 = p;\n    }\n  printf(\"%d %d \", q3->no, q3->sum);\n}\n\nint main() {\n  long n;\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  sort(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int ID;\n  int ch;\n  int ma;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu *head;\n  struct stu *p1, *p2, *a, *b, *c, *t;\n  int n, i = 0;\n  a = b = c = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  cin >> p1->ID >> p1->ch >> p1->ma;\n  p1->sum = p1->ch + p1->ma;\n  head = NULL;\n  while (i < n - 1) {\n    i++;\n    p1->sum = p1->ch + p1->ma;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (p1->sum > a->sum) {\n      c = b;\n      b = a;\n      a = p2;\n    } else if (p1->sum > b->sum) {\n      c = b;\n      b = p2;\n    } else if (p1->sum > c->sum)\n      c = p2;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    cin >> p1->ID >> p1->ch >> p1->ma;\n  }\n  p2->next = NULL;\n  cout << a->ID << \" \" << a->sum << \"\\n\"\n       << b->ID << \" \" << b->sum << \"\\n\"\n       << c->ID << \" \" << c->sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26370", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  int i;\n  if (n == 0) {\n    head = NULL;\n    return (head);\n  } else {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n    p1->next = NULL;\n    head = p1;\n    p2 = p1;\n    for (i = 1; i < n; i++) {\n      p1 = (struct student *)malloc(1000);\n      scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n      p1->next = NULL;\n      p2->next = p1;\n      p2 = p1;\n    }\n    return (head);\n  }\n}\nvoid top3(struct student *head) {\n  struct student *p, *p1;\n  int max = 0;\n  p = head;\n  do {\n    p->total = (p->chinese) + (p->math);\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  p = head;\n  max = 0;\n  do {\n    if ((p->total) > max) {\n      max = p->total;\n      p1 = p;\n    }\n    p = p->next;\n  } while (p != NULL);\n  printf(\"%d %d \", p1->num, p1->total);\n  p1->total = 0;\n  max = 0;\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  top3(head);\n}\n"}
{"label": "14", "index": "26371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct st {\n    int id;\n    int yu;\n    int ma;\n  };\n  int n, i;\n  struct st st1 = {0, 0, 0}, st2 = {0, 0, 0}, st3 = {0, 0, 0}, stn;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stn.id, &stn.yu, &stn.ma);\n    if (stn.yu + stn.ma > st1.yu + st1.ma) {\n      st3 = st2;\n      st2 = st1;\n      st1 = stn;\n    } else {\n      if (stn.yu + stn.ma > st2.yu + st2.ma) {\n        st3 = st2;\n        st2 = stn;\n      } else {\n        if (stn.yu + stn.ma > st3.yu + st3.ma) {\n          st3 = stn;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", st1.id, st1.yu + st1.ma, st2.id,\n         st2.yu + st2.ma, st3.id, st3.yu + st3.ma);\n}\n"}
{"label": "14", "index": "26372", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct Student {\n  int num;\n  int mscore;\n  int cscore;\n  int total;\n} stu[100001];\nint main() {\n  int n, i, m = 0, b[201][100] = {0}, a[201][100] = {0}, j = 200, count = 3,\n            k = 0, c[201] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].mscore;\n    cin >> stu[i].cscore;\n    stu[i].total = stu[i].mscore + stu[i].cscore;\n  }\n  do {\n    b[stu[m].total][c[stu[m].total]] = stu[m].total;\n    a[stu[m].total][c[stu[m].total]] = stu[m].num;\n    if (c[stu[m].total] < 4)\n      c[stu[m].total]++;\n    m++;\n  } while (m < n);\n  for (j = 200; j >= 0; j--) {\n    for (k = 0; k < 100 && count > 0; k++) {\n      if (b[j][k] != 0) {\n        printf(\"%d %d\\n\", a[j][k], b[j][k]);\n        count--;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    cin >> p1->num >> p1->yuwen >> p1->math;\n    p1->total = p1->yuwen + p1->math;\n    if (m == 1) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int a[3][2], t1, t2;\n  cin >> n;\n  head = creat();\n  p = head;\n  a[0][1] = a[1][1] = a[2][1] = 0;\n  if (head != 0)\n    do {\n      if (p->total > a[2][1]) {\n        a[2][1] = p->total;\n        a[2][0] = p->num;\n      }\n      if (a[2][1] > a[1][1]) {\n        t1 = a[1][1];\n        a[1][1] = a[2][1];\n        a[2][1] = t1;\n        t2 = a[1][0];\n        a[1][0] = a[2][0];\n        a[2][0] = t2;\n      }\n      if (a[1][1] > a[0][1]) {\n        t1 = a[0][1];\n        a[0][1] = a[1][1];\n        a[1][1] = t1;\n        t2 = a[0][0];\n        a[0][0] = a[1][0];\n        a[1][0] = t2;\n      }\n      p = p->next;\n    } while (p != 0);\n  for (t1 = 0; t1 <= 2; t1++) {\n    cout << a[t1][0] << \" \" << a[t1][1] << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "26374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int ch;\n    int ma;\n    int sum;\n  };\n  struct student *p;\n  int n, i, j, t1, t2, a1 = 0, a2 = 0, a3 = 0, k1, k2, k3;\n  scanf(\"%d\", &n);\n  p = (struct student *)malloc(n * sizeof(struct student));\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &p[i].num, &p[i].ch, &p[i].ma);\n    p[i].sum = p[i].ch + p[i].ma;\n  }\n  \n  for (i = 0; i < n; i++)\n    if (p[i].sum > a1) {\n      k1 = i;\n      a1 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a1 && p[i].sum > a2 && i != k1) {\n      k2 = i;\n      a2 = p[i].sum;\n    }\n  for (i = 0; i < n; i++)\n    if (p[i].sum <= a2 && p[i].sum > a3 && i != k1 && i != k2) {\n      k3 = i;\n      a3 = p[i].sum;\n    }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", p[k1].num, p[k1].sum, p[k2].num, p[k2].sum,\n         p[k3].num, p[k3].sum);\n  \n  return 0;\n}\n"}
{"label": "14", "index": "26375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  struct student {\n    int num;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[100000];\n  struct qiansan {\n    int num;\n    int zongfen;\n  } st[3] = {{0, 0}, {0, 0}, {0, 0}};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n    if (stu[i].zongfen > st[0].zongfen) {\n      st[2] = st[1];\n      st[1] = st[0];\n      st[0].zongfen = stu[i].zongfen;\n      st[0].num = stu[i].num;\n    } else if (stu[i].zongfen <= st[0].zongfen &&\n               stu[i].zongfen > st[1].zongfen) {\n      st[2] = st[1];\n      st[1].zongfen = stu[i].zongfen;\n      st[1].num = stu[i].num;\n    } else {\n      if (stu[i].zongfen <= st[1].zongfen && stu[i].zongfen > st[2].zongfen) {\n        st[2].zongfen = stu[i].zongfen;\n        st[2].num = stu[i].num;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    if (i == 0) {\n      printf(\"%d %d\", st[i].num, st[i].zongfen);\n    } else\n      cout << \" \" << st[i].num << \" \" << st[i].zongfen;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int ch;\n  int math;\n};\nint main() {\n  struct student stu[100000];\n  int n, i, j, sum = 0, id1 = 0, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].ch >> stu[i].math;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n; j++) {\n      if ((stu[j].ch + stu[j].math) > sum) {\n        sum = stu[j].ch + stu[j].math;\n        id1 = stu[j].id;\n        flag = j;\n      }\n    }\n    printf(\"%d %d\\n\", id1, sum);\n    sum = 0;\n    id1 = 0;\n    stu[flag].ch = 0;\n    stu[flag].math = 0;\n    flag = 0;\n  }\n}\n"}
{"label": "14", "index": "26377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int id;\n    int x;\n    int y;\n    int z;\n  } student1, student2, student3, studenta;\n  int n, i;\n  scanf(\"%d\", &n);\n  student1.z = student2.z = student3.z = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &studenta.id, &studenta.x, &studenta.y);\n    studenta.z = studenta.x + studenta.y;\n    if (studenta.z > student1.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = student1.z;\n      student2.id = student1.id;\n      student1.z = studenta.z;\n      student1.id = studenta.id;\n    } else if (studenta.z > student2.z) {\n      student3.z = student2.z;\n      student3.id = student2.id;\n      student2.z = studenta.z;\n      student2.id = studenta.id;\n    } else if (studenta.z > student3.z) {\n      student3.z = studenta.z;\n      student3.id = studenta.id;\n    }\n  }\n  cout << student1.id << \" \" << student1.z << \"\\n\"\n       << student2.id << \" \" << student2.z << \"\\n\"\n       << student3.id << \" \" << student3.z << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct score {\n    int id;\n    int yw;\n    int sx;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].yw, &stu[i].sx);\n  }\n  for (j = 1; j <= 3; j++) {\n    int e, max = 0;\n    for (i = 0; i <= n - j; i++) {\n      if ((stu[i].yw + stu[i].sx) > (stu[max].yw + stu[max].sx)) {\n        max = i;\n      }\n    }\n    if (max != n - j) {\n      e = stu[max].yw;\n      stu[max].yw = stu[n - j].yw;\n      stu[n - j].yw = e;\n\n      e = stu[max].sx;\n      stu[max].sx = stu[n - j].sx;\n      stu[n - j].sx = e;\n\n      e = stu[max].id;\n      stu[max].id = stu[n - j].id;\n      stu[n - j].id = e;\n    }\n  }\n  for (i = n - 1; i >= n - 2; i--) {\n    printf(\"%d %d\\n\", (stu[i].id), (stu[i].yw + stu[i].sx));\n  }\n  cout << (stu[n - 3].id) << \" \" << (stu[n - 3].yw + stu[n - 3].sx);\n  return 0;\n}\n"}
{"label": "14", "index": "26379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  int sum;\n  struct student *next;\n};\nint m, max_1[3] = {0}, t[3] = {0};\nstruct student *head;\nstruct student *p1, *p2;\nstruct student *creat(int n) {\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n  p1->sum = p1->chinese + p1->maths;\n  head = NULL;\n  while (m < n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->maths);\n    p1->sum = p1->chinese + p1->maths;\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  creat(n);\n  struct student *p1;\n  p1 = head;\n  do {\n    if (p1->sum > max_1[0]) {\n      max_1[0] = p1->sum;\n      t[0] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[0], max_1[0]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[1] && p1->num != t[0]) {\n      max_1[1] = p1->sum;\n      t[1] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  printf(\"%d %d \", t[1], max_1[1]);\n  p1 = head;\n  do {\n    if (p1->sum > max_1[2] && p1->num != t[0] && p1->num != t[1]) {\n      max_1[2] = p1->sum;\n      t[2] = p1->num;\n    }\n    p1 = p1->next;\n  } while (p1 != NULL);\n  cout << t[2] << \" \" << max_1[2] << \" \";\n  return 0;\n}\n"}
{"label": "14", "index": "26380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id, chin, math, z;\n  } p[100000];\n  int id, math, chin, z, i, n, f, s, t, id1, id2, id3;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &id, &chin, &math);\n    p[i].id = id;\n    p[i].math = math;\n    p[i].chin = chin;\n  }\n\n  for (i = 0; i < n; i++) {\n    id = p[i].id;\n    math = p[i].math;\n    chin = p[i].chin;\n    z = math + chin;\n\n    if (i == 0) {\n      f = s = t = z;\n      id1 = id2 = id3 = id;\n    } else if (i == 1) {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else {\n        t = s = z;\n        id2 = id3 = id;\n      }\n    } else {\n      if (z > f) {\n        t = s;\n        id3 = id2;\n        s = f;\n        id2 = id1;\n        f = z;\n        id1 = id;\n      } else if (z > s) {\n        t = s;\n        id3 = id2;\n        s = z;\n        id2 = id;\n      } else {\n        if (z > t) {\n          t = z;\n          id3 = id;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", id1, f);\n  printf(\"%d %d\\n\", id2, s);\n  printf(\"%d %d\\n\", id3, t);\n  return 0;\n}\n"}
{"label": "14", "index": "26381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int no;\n  int ch;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(long n) {\n  long i;\n  struct student *head, *p, *q;\n  head = (struct student *)malloc(1000);\n  p = (struct student *)malloc(1000);\n  head->next = q = p;\n  scanf(\"%d %d %d\", &p->no, &p->ch, &p->math);\n  p->sum = (p->ch) + (p->math);\n\n  for (i = 1; i < n; i++) {\n    p = (struct student *)malloc(1000);\n    cin >> p->no >> p->ch >> p->math;\n    p->sum = (p->ch) + (p->math);\n    q->next = p;\n    q = p;\n    p->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid sort(struct student *head) {\n  struct student *p, *q1, *q2, *q3;\n  int m1, m2, m3;\n  for (p = head->next, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1) {\n      m1 = p->sum;\n      q1 = p;\n    }\n  printf(\"%d %d \", q1->no, q1->sum);\n  for (p = head->next, m2 = p->sum; p != NULL; p = p->next) {\n    if (p->sum > m2 && p != q1) {\n      m2 = p->sum;\n      q2 = p;\n    }\n  }\n  cout << q2->no << \" \" << q2->sum << \" \";\n  for (p = head->next, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2) {\n      m3 = p->sum;\n      q3 = p;\n    }\n  printf(\"%d %d \", q3->no, q3->sum);\n}\n\nint main() {\n  long n;\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  sort(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26382", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int maths;\n  struct student *next;\n};\nint n, max0;\nstruct student *creat(void) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  head = p1;\n  for (i = 1; i < n; i++) {\n    cin >> p1->num >> p1->chinese >> p1->maths;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    p2->next = p1;\n    p2 = p1;\n  }\n  cin >> p1->num >> p1->chinese >> p1->maths;\n  p2->next = p1;\n  p1->next = NULL;\n  return head;\n}\n\nvoid max(struct student *head, int x, int y) {\n  struct student *p1, *temp, *p2;\n  temp = (struct student *)malloc(sizeof(struct student));\n  temp->chinese = temp->maths = 0;\n  for (p2 = head; p2 != NULL; p2 = p2->next)\n    if (p2->chinese + p2->maths == x)\n      break;\n  for (p1 = head; p1 != NULL; p1 = p1->next)\n    if ((p1->chinese + p1->maths > temp->chinese + temp->maths) &&\n        (p1->chinese + p1->maths != x ||\n         p1->chinese + p1->maths == x && p1->num != p2->num) &&\n        (p1->chinese + p1->maths != y)) {\n      temp->chinese = p1->chinese;\n      temp->maths = p1->maths;\n      temp->num = p1->num;\n    }\n  max0 = temp->chinese + temp->maths;\n  printf(\"%d %d \", temp->num, max0);\n}\nint main() {\n  struct student *head;\n  int max1, max2;\n  scanf(\"%d\", &n);\n  head = creat();\n  max(head, 0, 0);\n  max1 = max0;\n  max(head, max1, 0);\n  max2 = max0;\n  max(head, max1, max2);\n  return 0;\n}\n"}
{"label": "14", "index": "26383", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  struct student {\n    int num;\n    int yu;\n    int shu;\n  } a[100000];\n  int d[100000];\n  int i = 0;\n  ;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].yu, &a[i].shu);\n    d[i] = a[i].yu + a[i].shu;\n  }\n  int q, w, e;\n  q = 0;\n  w = 0;\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (d[q] < d[i])\n      q = i;\n  }\n  for (i = 0; i < n; i++) {\n    if (d[q] >= d[i] && i != q && d[w] < d[i]) {\n      w = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[w] >= d[i] && i != w && i != q && d[e] < d[i]) {\n      e = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[q].num, d[q]);\n  printf(\"%d %d\\n\", a[w].num, d[w]);\n  printf(\"%d %d\\n\", a[e].num, d[e]);\n  return 0;\n}\n"}
{"label": "14", "index": "26384", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chin;\n  int math;\n  int sum;\n} tem_stu;\nint main() {\n  int n, i;\n  cin >> n;\n  struct student *stu;\n  stu = (struct student *)malloc(n * sizeof(int) * 4);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].chin >> stu[i].math;\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int j;\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        tem_stu = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = tem_stu;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d\\n\", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d\\n\", stu[n - 3].num, stu[n - 3].sum);\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int ch;\n    int ma;\n    int to;\n  };\n  int i, j1, j2, j3, k, max;\n  struct stu student[100000] = {0};\n  struct stu temp;\n  scanf(\"%d\", &k);\n  for (i = 0; i <= k - 1; i++) {\n    cin >> student[i].num >> student[i].ch >> student[i].ma;\n    student[i].to = student[i].ch + student[i].ma;\n  }\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (student[i].to > max) {\n      max = student[i].to;\n      j1 = i;\n    }\n  }\n  printf(\"%d \", student[j1].num);\n  cout << student[j1].to << \"\\n\";\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j2 = i;\n    }\n  }\n  printf(\"%d \", student[j2].num);\n  printf(\"%d\\n\", student[j2].to);\n  max = 0;\n  max = 0;\n  for (i = 0; i <= k - 1; i++) {\n    if (i == j1 || i == j2)\n      continue;\n    if (student[i].to > max) {\n      max = student[i].to;\n      j3 = i;\n    }\n  }\n  cout << student[j3].num << \" \";\n  printf(\"%d\\n\", student[j3].to);\n  return 0;\n}\n"}
{"label": "14", "index": "26386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int together;\n} stu[100000], t;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].together = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i; j < n; j++) {\n      if (stu[i].together < stu[j].together) {\n        t = stu[i];\n        stu[i] = stu[j];\n        stu[j] = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].together);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26387", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yuwen;\n  int shuxue;\n  int sum;\n} score[100000];\nint main() {\n  int n, i, a, b, c, a1, b1, c1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> score[i].num >> score[i].yuwen >> score[i].shuxue;\n    score[i].sum = score[i].shuxue + score[i].yuwen;\n  }\n  a = 0;\n  b = 0;\n  c = 0;\n  a1 = 0;\n  b1 = 0;\n  c1 = 0;\n  for (i = 0; i < n; i++) {\n    if (score[i].sum > a) {\n      c = b;\n      b = a;\n      a = score[i].sum;\n      c1 = b1;\n      b1 = a1;\n      a1 = score[i].num;\n    } else if (score[i].sum > b) {\n      c = b;\n      b = score[i].sum;\n      c1 = b1;\n      b1 = score[i].num;\n    } else if (score[i].sum > c) {\n      c = score[i].sum;\n      c1 = score[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a1, a, b1, b, c1, c);\n  return 0;\n}\n"}
{"label": "14", "index": "26388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d\", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a;\n    } else if (a.z > max2.z) {\n      max3 = max2;\n      max2 = a;\n    } else if (a.z > max3.z) {\n      max3 = a;\n      max3 = a;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n}\n"}
{"label": "14", "index": "26389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[100001];\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct {\n    int id, chin, math, su;\n  } s[100001];\n  for (i = 0; i < n; i++) {\n    cin >> s[i].id >> s[i].chin >> s[i].math;\n    s[i].su = s[i].chin + s[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (s[i].su < s[j].su) {\n        s[100000] = s[i];\n        s[i] = s[j];\n        s[j] = s[100000];\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].id, s[0].su, s[1].id, s[1].su, s[2].id,\n         s[2].su);\n  return 0;\n}\n"}
{"label": "14", "index": "26390", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t;\n  struct score {\n    int num;\n    int verbal;\n    int math;\n    int sum;\n  };\n  struct score a[4];\n  scanf(\"%d\", &n);\n  for (i = 0; i <= 2; i++) {\n    cin >> a[i].num >> a[i].verbal >> a[i].math;\n    a[i].sum = a[i].verbal + a[i].math;\n  }\n  for (i = 0; i <= 1; i++)\n    for (j = 1; j <= 2 - i; j++) {\n      if (a[i].verbal + a[i].math < a[i + j].verbal + a[i + j].math) {\n        t = a[i].num;\n        a[i].num = a[i + j].num;\n        a[i + j].num = t;\n        t = a[i].sum;\n        a[i].sum = a[i + j].sum;\n        a[i + j].sum = t;\n      }\n    }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d%d%d\", &a[3].num, &a[3].verbal, &a[3].math);\n    if (a[3].verbal + a[3].math > a[0].sum) {\n      t = a[1].num;\n      a[1].num = a[0].num;\n      a[2].num = t;\n      a[0].num = a[3].num;\n      t = a[1].sum;\n      a[1].sum = a[0].sum;\n      a[2].sum = t;\n      a[0].sum = a[3].verbal + a[3].math;\n    } else {\n      if (a[3].verbal + a[3].math > a[1].sum) {\n        a[2].num = a[1].num;\n        a[1].num = a[3].num;\n        a[2].sum = a[1].sum;\n        a[1].sum = a[3].verbal + a[3].math;\n      } else {\n        if (a[3].verbal + a[3].math > a[2].sum) {\n          a[2].num = a[3].num;\n          a[2].sum = a[3].verbal + a[3].math;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n}\n"}
{"label": "14", "index": "26391", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct marks {\n  long ID;\n  int Chinese;\n  int Maths;\n  int total;\n} student[100000], first, second, third;\n\nint main() {\n  first.total = 0;\n  second.total = 0;\n  third.total = 0;\n  int student_num, i, count = 0;\n  cin >> student_num;\n  for (i = 0; i < student_num; i++) {\n    cin >> student[i].ID >> student[i].Chinese >> student[i].Maths;\n  }\n  for (i = 0; i < student_num; i++) {\n    student[i].total = (student[i].Chinese + student[i].Maths);\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > first.total) {\n      first = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total == first.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n    if (count > 3)\n      break;\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > second.total && student[i].total < first.total) {\n      second = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == second.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (student[i].total > third.total && student[i].total < second.total) {\n      third = student[i];\n    }\n  }\n  for (i = 0; i < student_num; i++) {\n    if (count >= 3)\n      break;\n    if (student[i].total == third.total) {\n      count++;\n      printf(\"%ld %d\\n\", student[i].ID, student[i].total);\n    }\n  }\n}\n"}
{"label": "14", "index": "26392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k;\n  int a[99999][3], s[99999];\n  int fir = 0, sec = 0, thi = 0;\n  int c = 0, d = 0, e = 0;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 3; k++) {\n      cin >> a[i][k];\n    }\n    s[i] = a[i][1] + a[i][2];\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] > fir) {\n      thi = sec;\n      sec = fir;\n      fir = s[i];\n      e = d;\n      d = c;\n      c = i;\n      continue;\n    }\n    if (s[i] > sec && s[i] <= fir) {\n      thi = sec;\n\n      sec = s[i];\n      e = d;\n      d = i;\n      continue;\n    }\n    if (s[i] > thi && s[i] <= sec) {\n      thi = s[i];\n      e = i;\n    }\n  }\n\n  printf(\"%d %d\\n\", a[c][0], fir);\n  printf(\"%d %d\\n\", a[d][0], sec);\n  printf(\"%d %d\\n\", a[e][0], thi);\n  return 0;\n}\n"}
{"label": "14", "index": "26393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  struct student {\n    int num;\n    int a;\n    int b;\n  } stu[100000];\n\n  int n, i, sum = 0, max1 = 0, max2 = 0, max3 = 0, t = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].a, &stu[i].b);\n    sum = stu[i].a + stu[i].b;\n    if (sum > max1) {\n      max3 = max2;\n      max2 = max1;\n      max1 = sum;\n    } else if ((sum < max1) && (sum > max2)) {\n      max3 = max2;\n      max2 = sum;\n    } else if ((sum < max2) && (sum > max3)) {\n      max3 = sum;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if (sum == max1) {\n      printf(\"%d %d\\n\", stu[i].num, max1);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max2) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max2);\n      t++;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    sum = stu[i].a + stu[i].b;\n    if ((sum == max3) && (t < 3)) {\n      printf(\"%d %d\\n\", stu[i].num, max3);\n      t++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26394", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id, word, math, sum;\n} stu[100000];\nint main() {\n  int n, i = 1, maxi;\n  cin >> n;\n  while (i <= n) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].word, &stu[i].math);\n    stu[i].sum = stu[i].word + stu[i].math;\n    i = i + 1;\n  }\n  i = n;\n  stu[n + 1].sum = 0;\n  stu[n + 2].sum = 0;\n  stu[n + 3].sum = 0;\n  stu[n + 1].id = 0;\n  stu[n + 2].id = 0;\n  stu[n + 3].id = 0;\n  stu[n + 1].math = 0;\n  stu[n + 2].math = 0;\n  stu[n + 3].math = 0;\n  stu[n + 1].word = 0;\n  stu[n + 2].word = 0;\n  stu[n + 3].word = 0;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 1].sum) {\n      stu[n + 1] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 1].id, stu[n + 1].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 2].sum) {\n      stu[n + 2] = stu[i];\n      maxi = i;\n    }\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 2].id, stu[n + 2].sum);\n  stu[maxi].sum = 0;\n  i = n;\n  while (i >= 1) {\n    if (stu[i].sum >= stu[n + 3].sum)\n      stu[n + 3] = stu[i];\n    i = i - 1;\n  }\n  printf(\"%d %d\\n\", stu[n + 3].id, stu[n + 3].sum);\n}\n"}
{"label": "14", "index": "26395", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int number, chinese, math, total;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].number, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  int a = stu[0].total, b = stu[0].total, c = stu[0].total;\n  for (i = 0; i < n; i++) {\n    if (stu[i].total > a) {\n      c = b;\n      b = a;\n      a = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < a && stu[i].total > b) {\n      c = b;\n      b = stu[i].total;\n      continue;\n    }\n    if (stu[i].total < b && stu[i].total > c) {\n      c = stu[i].total;\n      continue;\n    }\n  }\n  int m = 0;\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == a) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == b) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  for (i = 0; i < n && m < 3; i++) {\n    if (stu[i].total == c) {\n      printf(\"%d %d\\n\", stu[i].number, stu[i].total);\n      m++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  long a;\n  int x;\n  int y;\n};\nstruct student stu[100000];\nint main() {\n  long n, i, j, p;\n  int m;\n  scanf(\"%ld\", &n);\n  int g[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %d %d\", &stu[i].a, &stu[i].x, &stu[i].y);\n    g[i] = stu[i].x + stu[i].y;\n  }\n  for (i = 1; i < 4; i++)\n    for (j = n - 1; j >= i; j--)\n      if (g[j - 1] < g[j]) {\n        m = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = m;\n        p = stu[j - 1].a;\n        stu[j - 1].a = stu[j].a;\n        stu[j].a = p;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%ld %d \", stu[i].a, g[i]);\n}\n"}
{"label": "14", "index": "26397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, h, b;\n  scanf(\"%d\", &n);\n  struct sb {\n    int ID;\n    int m;\n    int c;\n    int sum;\n  } a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].ID, &a[i].m, &a[i].c);\n    a[i].sum = a[i].m + a[i].c;\n  }\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  char yw;\n  char sx;\n  int zf;\n  int pm;\n};\nint main() {\n  struct student a[100000], b[2];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> a[i].id >> a[i].yw >> a[i].sx;\n  for (i = 0; i < n; i++)\n    a[i].zf = a[i].yw + a[i].sx;\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j) {\n      j = a[i].zf;\n      b[0] = a[i];\n    }\n  cout << b[0].id << \" \" << b[0].zf << \"\\n\";\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id) {\n      j = a[i].zf;\n      b[1] = a[i];\n    }\n  printf(\"%d %d\\n\", b[1].id, b[1].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id && a[i].id != b[1].id) {\n      j = a[i].zf;\n      b[2] = a[i];\n    }\n  printf(\"%d %d\\n\", b[2].id, b[2].zf);\n}\n"}
{"label": "14", "index": "26399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n};\nint main() {\n  struct student a[100000];\n  int n, i, sf = 0, ss = 0, st = 0, f, s, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].number >> a[i].math >> a[i].chinese;\n    a[i].total = a[i].math + a[i].chinese;\n    if (a[i].total > sf) {\n      t = s;\n      st = ss;\n      s = f;\n      ss = sf;\n      f = i;\n      sf = a[i].total;\n    } else if (a[i].total > ss) {\n      t = s;\n      st = ss;\n      s = i;\n      ss = a[i].total;\n    } else if (a[i].total > st) {\n      t = i;\n      st = a[i].total;\n    }\n  }\n  printf(\"%d %d\\n\", f + 1, sf);\n  cout << s + 1 << \" \" << ss << \"\\n\";\n  printf(\"%d %d\\n\", t + 1, st);\n  return 0;\n}\n"}
{"label": "14", "index": "26400", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int j;\n  int x, y;\n  int z;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, a = 0, b = 0, c = 0, a1, b1, c1;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].j >> stu[i].x >> stu[i].y;\n    stu[i].z = stu[i].x + stu[i].y;\n  }\n  for (i = 0; i < n; i++) {\n    if (a < stu[i].z) {\n      a = stu[i].z;\n      a1 = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b < stu[i].z && i != a1) {\n      b = stu[i].z;\n      b1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c < stu[i].z && i != a1 && i != b1) {\n      c = stu[i].z;\n      c1 = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[a1].j, stu[a1].z, stu[b1].j, stu[b1].z,\n         stu[c1].j, stu[c1].z);\n  return 0;\n}\n"}
{"label": "14", "index": "26401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100000], b[100000], d[100000], i, j, n, t, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i], &b[i], &d[i]);\n    d[i] = b[i] + d[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (d[j] > d[j - 1]) {\n        t = d[j];\n        s = a[j];\n        d[j] = d[j - 1];\n        a[j] = a[j - 1];\n        d[j - 1] = t;\n        a[j - 1] = s;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], d[i]);\n  }\n}\n"}
{"label": "14", "index": "26402", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int id;\n    int yuwen;\n    int shuxue;\n  } stu[1000001];\n  int grade[100000];\n  int i, a, b;\n  int m1 = 0, m2 = 0, m3 = 0;\n  int m1id, m2id, m3id;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].id);\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    grade[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (grade[i] > m1) {\n      m1 = grade[i];\n      a = i;\n      m1id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m1id);\n  printf(\"%d\\n\", m1);\n\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m2) && (i != a)) {\n      m2 = grade[i];\n      b = i;\n      m2id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m2id);\n  printf(\"%d\\n\", m2);\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m3) && (i != a) && (i != b)) {\n      m3 = grade[i];\n      m3id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m3id);\n  printf(\"%d\\n\", m3);\n  return 0;\n}\n"}
{"label": "14", "index": "26403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int a, b, c;\n  };\n  int i, n, j = 0;\n  scanf(\"%d\", &n);\n  struct stu *hd, *p;\n  hd = p = (struct stu *)malloc(100000 * sizeof(struct stu));\n  for (i = 0; i < n; i++, p++) {\n    scanf(\"%d %d %d\", &p->a, &p->b, &p->c);\n  }\n  int max = 0;\nnxt:\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c > max) {\n      max = p->b + p->c;\n    }\n  }\n  for (p = hd, i = 0; i < n; i++, p++) {\n    if (p->b + p->c == max) {\n      printf(\"%d %d\\n\", p->a, p->b + p->c);\n      p->b = 0;\n      p->c = 0;\n      max = 0;\n      j++;\n      break;\n    }\n  }\n  if (j <= 2) {\n    goto nxt;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct s {\n  int num;\n  int x;\n  int y;\n  int z;\n} s[100000], s1, s2, s3, A;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &s[i].num, &s[i].x, &s[i].y);\n    s[i].z = s[i].x + s[i].y;\n  }\n  if (s[0].z >= s[1].z) {\n    s1 = s[0];\n    s2 = s[1];\n  } else {\n    s1 = s[1];\n    s2 = s[0];\n  }\n  if (s[2].z >= s1.z) {\n    A = s1;\n    s1 = s[2];\n    s3 = s2;\n    s2 = A;\n  } else if (s[2].z < s2.z) {\n    s3 = s[2];\n  } else if (s[2].z >= s2.z && s[2].z < s1.z) {\n    s3 = s2;\n    s2 = s[2];\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].z > s1.z) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s[i];\n    } else if (s[i].z < s3.z) {\n      ;\n    } else if (s[i].z < s1.z && s[i].z > s3.z) {\n      if (s[i].z > s2.z) {\n        s3 = s2;\n        s2 = s[i];\n      } else {\n        s3 = s[i];\n      }\n    } else if (s[i].z == s1.z) {\n      s3 = s2;\n      s2 = s[i];\n    } else if (s[i].z == s2.z) {\n      s3 = s[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1.num, s1.z);\n  printf(\"%d %d\\n\", s2.num, s2.z);\n  printf(\"%d %d\\n\", s3.num, s3.z);\n  return 0;\n}\n"}
{"label": "14", "index": "26405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student \n{\n  int NO;\n  int chinese;\n  int math;\n};\n\nint main() {\n  struct student a[100001];\n  int n, i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    cin >> a[i].NO >> a[i].chinese >> a[i].math; \n  for (i = 1; i <= 3; i++)\n    for (j = n - 1; j >= i; j--)\n      if (a[j].chinese + a[j].math <\n          a[j + 1].chinese + a[j + 1].math) \n      {\n        a[0] = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = a[0];\n      }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].NO << ' ' << a[i].chinese + a[i].math << endl; \n}\n"}
{"label": "14", "index": "26406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, zf[100000];\n  struct student {\n    int name;\n    int yw;\n    int sx;\n\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].name, &stu[i].yw, &stu[i].sx);\n    zf[i] = stu[i].yw + stu[i].sx;\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (zf[i] >= zf[i + 1]) {\n        a = zf[i];\n        zf[i] = zf[i + 1];\n        zf[i + 1] = a;\n        a = stu[i].name;\n        stu[i].name = stu[i + 1].name;\n        stu[i + 1].name = a;\n      }\n    }\n  }\n  for (i = n - 1; i >= n - 3; i--) {\n    printf(\"%d %d\\n\", stu[i].name, zf[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int o = 0, oz, t = 0, tz, th = 0;\n  scanf(\"%d\", &n);\n  struct {\n    int h, z;\n  } s[100000];\n  for (i = 0; i < n; i++) {\n    int h0, x0, y0;\n    scanf(\"%d%d%d\", &h0, &x0, &y0);\n    s[i].h = h0;\n    s[i].z = x0 + y0;\n  }\n  for (i = 0; i < n; i++)\n    if (s[i].z > o)\n      o = s[i].z;\n  for (i = 0; i < n; i++)\n    if (s[i].z == o) {\n      oz = i;\n      cout << s[i].h << \" \" << s[i].z << \"\\n\";\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z > t))\n      t = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (s[i].z == t)) {\n      tz = i;\n      printf(\"%d %d\\n\", s[i].h, s[i].z);\n      break;\n    }\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z > th))\n      th = s[i].z;\n  for (i = 0; i < n; i++)\n    if ((i != oz) && (i != tz) && (s[i].z == th)) {\n      cout << s[i].h << \" \" << s[i].z << \"\\n\";\n      break;\n    }\n  return 0;\n}\n"}
{"label": "14", "index": "26408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int sum;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  int i;\n  struct student *head, *p1, *p2;\n\n  p1 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n  p1->sum = p1->chi + p1->math;\n\n  head = p1;\n  p2 = p1;\n\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p1->sum = p1->chi + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1;\n  struct student *max1, *max2, *max3;\n  int n, max;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max) {\n      max = p1->sum;\n      max1 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max1->num, max1->sum);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1) {\n      max = p1->sum;\n      max2 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max2->num, max2->sum);\n  p1 = head;\n  max = 0;\n  while (p1 != NULL) {\n    if (p1->sum > max && p1 != max1 && p1 != max2) {\n      max = p1->sum;\n      max3 = p1;\n    }\n    p1 = p1->next;\n  }\n  printf(\"%d %d\\n\", max3->num, max3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n};\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  struct student a[100000], e;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].chinese >> a[i].math;\n  }\n  for (i = 0; i < n - 1; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 2; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (a[i].chinese + a[i].math >= a[i + 1].chinese + a[i + 1].math) {\n      e = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = e;\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", a[i].num, a[i].chinese + a[i].math);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  float one = 0, two = 0, three = 0, yi = 0, er = 0, san = 0;\n  float a[100000][2];\n  scanf(\"%d\", &n);\n  struct Student {\n    float xuehao;\n    float yuwen;\n    float shuxue;\n  } student;\n  for (i = 0; i < n; i++) {\n    scanf(\"%f %f %f\", &student.xuehao, &student.yuwen, &student.shuxue);\n    for (j = 0; j < 2; j++) {\n      a[i][1] = student.yuwen + student.shuxue;\n      a[i][0] = i + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > one) {\n      one = a[i][1];\n      yi = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > two && a[i][1] <= one && a[i][0] != yi) {\n      two = a[i][1];\n      er = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > three && a[i][1] <= one && a[i][1] <= two && a[i][0] != yi &&\n        a[i][0] != er) {\n      three = a[i][1];\n      san = a[i][0];\n    }\n  }\n  printf(\"%.0f %.0f\\n\", yi, one);\n  printf(\"%.0f %.0f\\n\", er, two);\n  printf(\"%.0f %.0f\\n\", san, three);\n  return 0;\n}\n"}
{"label": "14", "index": "26411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int score;\n  struct student *next;\n};\nint main() {\n  int n, i, max;\n  struct student *p1, *p2, *head;\n  p1 = p2 = head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    p1 = (struct student *)malloc(sizeof(struct student));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n\n    p1->score = p1->yu + p1->shu;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n\n  for (i = 0; i < 3; i++) {\n    p2 = p1 = head;\n    max = p1->score;\n    while (p1 != NULL) {\n      if (p1->score > max) {\n        max = p1->score;\n        p2 = p1;\n      }\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p2->num, max);\n    p1 = head;\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n}\n"}
{"label": "14", "index": "26412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].m, &a[i].x, &a[i].y);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i].m, (a[i].x + a[i].y));\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n};\nstruct student stu[100000];\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  {\n    max[0] = 0;\n    for (j = 0, k = 0; j < n; j++) {\n      if (sum[j] > max[0]) {\n        max[0] = sum[j];\n        k = j;\n      }\n    }\n  }\n\n  {\n    max[1] = 0;\n    for (j = 1, m = 0; j < n; j++) {\n      if ((sum[j] > max[1]) && (j != k)) {\n        max[1] = sum[j];\n        m = j;\n      }\n    }\n  }\n\n  {\n    max[2] = 0;\n    for (j = 1, o = 0; j < n; j++) {\n      if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n        max[2] = sum[j];\n        o = j;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[k].name, sum[k]);\n  cout << stu[m].name << \" \" << sum[m] << \"\\n\";\n  printf(\"%d %d\\n\", stu[o].name, sum[o]);\n  return 0;\n}\n"}
{"label": "14", "index": "26414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int ID;\n  int yw;\n  int sx;\n} stu[100000];\nint main() {\n  int num, i, j, sum[100000], t, m;\n  scanf(\"%d \", &num);\n  for (i = 1; i <= num; i++) {\n    cin >> stu[i].ID >> stu[i].yw >> stu[i].sx;\n    sum[i] = stu[i].yw + stu[i].sx;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = num; j > 1; j--) {\n      if (sum[j] > sum[j - 1]) {\n        t = sum[j - 1];\n        m = stu[j - 1].ID;\n        sum[j - 1] = sum[j];\n        stu[j - 1].ID = stu[j].ID;\n        sum[j] = t;\n        stu[j].ID = m;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++) {\n    cout << stu[i].ID << \" \" << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int yu;\n    int shu;\n  } a[100000];\n  int d[100000];\n  int i = 0;\n  ;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].yu, &a[i].shu);\n    d[i] = a[i].yu + a[i].shu;\n  }\n  int q, w, e;\n  q = 0;\n  w = 0;\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (d[q] < d[i]) {\n      q = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[q] >= d[i] && i != q && d[w] < d[i]) {\n      w = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[w] >= d[i] && i != w && i != q && d[e] < d[i]) {\n      e = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[q].num, d[q]);\n  printf(\"%d %d\\n\", a[w].num, d[w]);\n  printf(\"%d %d\\n\", a[e].num, d[e]);\n  return 0;\n}\n"}
{"label": "14", "index": "26416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int num;\n  int x;\n  int y;\n  int z;\n} s[100000], s1, s2, s3, A;\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].num >> s[i].x >> s[i].y;\n    s[i].z = s[i].x + s[i].y;\n  }\n  if (s[0].z >= s[1].z) {\n    s1 = s[0];\n    s2 = s[1];\n  } else {\n    s1 = s[1];\n    s2 = s[0];\n  }\n  if (s[2].z >= s1.z) {\n    A = s1;\n    s1 = s[2];\n    s3 = s2;\n    s2 = A;\n  } else if (s[2].z < s2.z) {\n    s3 = s[2];\n  } else if (s[2].z >= s2.z && s[2].z < s1.z) {\n    s3 = s2;\n    s2 = s[2];\n  }\n  for (i = 3; i < n; i++) {\n    if (s[i].z > s1.z) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s[i];\n    } else if (s[i].z < s3.z) {\n      ;\n    } else if (s[i].z < s1.z && s[i].z > s3.z) {\n      if (s[i].z > s2.z) {\n        s3 = s2;\n        s2 = s[i];\n      } else {\n        s3 = s[i];\n      }\n    } else if (s[i].z == s1.z) {\n      s3 = s2;\n      s2 = s[i];\n    } else if (s[i].z == s2.z) {\n      s3 = s[i];\n    }\n  }\n  printf(\"%d %d\\n\", s1.num, s1.z);\n  printf(\"%d %d\\n\", s2.num, s2.z);\n  cout << s3.num << \" \" << s3.z << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct {\n    int id;\n    int yuwen;\n    int shuxue;\n  } stu[1000001];\n  int grade[100000];\n  int i, a, b;\n  int m1 = 0, m2 = 0, m3 = 0;\n  int m1id, m2id, m3id;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id;\n    scanf(\"%d\", &stu[i].yuwen);\n    scanf(\"%d\", &stu[i].shuxue);\n    grade[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (grade[i] > m1) {\n      m1 = grade[i];\n      a = i;\n      m1id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m1id);\n  cout << m1 << \"\\n\";\n\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m2) && (i != a)) {\n      m2 = grade[i];\n      b = i;\n      m2id = stu[i].id;\n    }\n  }\n  printf(\"%d \", m2id);\n  printf(\"%d\\n\", m2);\n  for (i = 0; i < n; i++) {\n    if ((grade[i] > m3) && (i != a) && (i != b)) {\n      m3 = grade[i];\n      m3id = stu[i].id;\n    }\n  }\n  cout << m3id << \" \";\n  printf(\"%d\\n\", m3);\n  return 0;\n}\n"}
{"label": "14", "index": "26418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int Chinese;\n  int math;\n  int score;\n} stu[100000];\n\nint main() {\n  int n, i, j, a, b;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].No >> stu[i].Chinese >> stu[i].math;\n    stu[i].score = stu[i].Chinese + stu[i].math;\n  }\n\n  for (j = n - 1; j > n - 4; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i + 1].score < stu[i].score || stu[i + 1].score == stu[i].score) {\n        a = stu[i + 1].score;\n        stu[i + 1].score = stu[i].score;\n        stu[i].score = a;\n        b = stu[i + 1].No;\n        stu[i + 1].No = stu[i].No;\n        stu[i].No = b;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].No << \" \" << stu[i].score << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int num;\n  int chinese;\n  int math;\n} sdu[99999];\n\nint main() {\n  int N, i, j, s, t, m;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++)\n    scanf(\"%d%d%d\", &sdu[i].num, &sdu[i].chinese, &sdu[i].math);\n\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < N - j - 1; i++) {\n      if ((sdu[i].chinese + sdu[i].math) >=\n          (sdu[i + 1].chinese + sdu[i + 1].math)) {\n        s = sdu[i].num;\n        t = sdu[i].chinese;\n        m = sdu[i].math;\n        sdu[i].num = sdu[i + 1].num;\n        sdu[i].chinese = sdu[i + 1].chinese;\n        sdu[i].math = sdu[i + 1].math;\n        sdu[i + 1].num = s;\n        sdu[i + 1].chinese = t;\n        sdu[i + 1].math = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", sdu[N - 1 - i].num,\n           sdu[N - 1 - i].chinese + sdu[N - 1 - i].math);\n}\n"}
{"label": "14", "index": "26420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int sum;\n} stu[100000];\nint main() {\n\n  int i, n, max = 0, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].mat);\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        m = i;\n      }\n    printf(\"%d %d\\n\", stu[m].num, stu[m].sum);\n    stu[m].sum = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "26421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int zong;\n} stu[100001];\n\nint main(int argc, char *argv[]) {\n  int i, n, max1 = 0, max2 = 0, max3 = 0, fir, sec, thi;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].yw >> stu[i].sx;\n    stu[i].zong = stu[i].yw + stu[i].sx;\n    if (stu[i].zong > max1) {\n      max3 = max2;\n      thi = sec;\n      max2 = max1;\n      sec = fir;\n      max1 = stu[i].zong;\n      fir = i;\n    } else {\n      if (stu[i].zong > max2) {\n        max3 = max2;\n        thi = sec;\n        max2 = stu[i].zong;\n        sec = i;\n      } else if (stu[i].zong > max3) {\n        max3 = stu[i].zong;\n        thi = i;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[fir].num, stu[fir].zong);\n  cout << stu[sec].num << \" \" << stu[sec].zong << \"\\n\";\n  printf(\"%d %d\\n\", stu[thi].num, stu[thi].zong);\n  return 0;\n}\n"}
{"label": "14", "index": "26422", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chi;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n  p->sum = p->chi + p->math;\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      head->next = NULL;\n    } else if (i < 3) {\n      for (h = head, j = 0; j < i; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else if (j == i) {\n        g->next = p;\n        p->next = NULL;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if (p->sum > h->sum)\n          break;\n        else {\n          g = h;\n          h = h->next;\n        }\n      }\n      if (j == 0) {\n        p->next = head;\n        head = p;\n      } else {\n        g->next = p;\n        p->next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d %d\", p->num, &p->chi, &p->math);\n    p->sum = p->chi + p->math;\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = p->next)\n    printf(\"%s %d \", p->num, p->sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "26423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct statistics {\n  int num;\n  int chinese;\n  int math;\n  int sum;\n} form[100000], temp;\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &form[i].num, &form[i].chinese, &form[i].math);\n    form[i].sum = form[i].chinese + form[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    int k = i;\n    for (j = i + 1; j < n; j++) {\n      if (form[j].sum > form[k].sum) {\n        k = j;\n      }\n    }\n    if (k != i) {\n      temp = form[i];\n      form[i] = form[k];\n      form[k] = temp;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << form[i].num << \" \" << form[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum[100001], temp = 0;\n  scanf(\"%d \", &n);\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n  } person[100001];\n  for (i = 1; i <= n; i++) {\n    cin >> person[i].ID >> person[i].chinese >> person[i].math;\n    sum[i] = person[i].chinese + person[i].math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp) {\n      temp = sum[i];\n      j = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j) {\n      temp = sum[i];\n      k = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j && i != k) {\n      temp = sum[i];\n      l = i;\n    }\n  }\n  cout << person[j].ID << \" \" << sum[j] << endl;\n  cout << person[k].ID << \" \" << sum[k] << endl;\n  printf(\"%d %d\\n\", person[l].ID, sum[l]);\n  return 0;\n}\n"}
{"label": "14", "index": "26425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint m;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  struct student *creat(int n);\n  void print(struct student * head, int n);\n\n  struct student *head;\n  head = creat(n);\n  print(head, n);\n  print(head, n);\n  print(head, n);\n}\n\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  for (; n != 0; n--) {\n    m += 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d \", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nvoid print(struct student *head, int n) {\n  struct student *p, *q;\n  p = head;\n  int max = 0, index = 0;\n  for (; n != 0; n--) {\n    if (max < ((p->yuwen) + (p->shuxue))) {\n      max = ((p->yuwen) + (p->shuxue));\n      index = p->num;\n      q = p;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", index, max);\n  q->yuwen = 0;\n  q->shuxue = 0;\n}\n"}
{"label": "14", "index": "26426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int ID;\n  int c;\n  int m;\n};\nstruct stu a[100000];\n\nint main(int argc, char *argv[]) {\n  int n, i, x, y, z, t, q, w, e;\n  int b[100000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d \", &a[i].ID);\n    scanf(\"%d \", &a[i].c);\n    scanf(\"%d\", &a[i].m);\n  }\n  for (i = 0; i < n; i++)\n    b[i] = a[i].c + a[i].m;\n  if (b[0] > b[1] && b[1] > b[2]) {\n    x = b[0];\n    q = 1;\n    y = b[1];\n    w = 1 + 1;\n    z = b[2];\n    e = 2 + 1;\n  } else if (b[1] > b[0] && b[0] > b[2]) {\n    x = b[1];\n    y = b[0];\n    z = b[2];\n    q = 1 + 1;\n    w = 0 + 1;\n    e = 2 + 1;\n  } else if (b[2] > b[1] && b[1] > b[0]) {\n    x = b[2];\n    y = b[1];\n    z = b[0];\n    q = 2 + 1;\n    w = 1 + 1;\n    e = 0 + 1;\n  } else if (b[2] > b[0] && b[0] > b[1]) {\n    x = b[2];\n    y = b[0];\n    z = b[1];\n    q = 2 + 1;\n    w = 0 + 1;\n    e = 1 + 1;\n  } else if (b[1] > b[2] && b[2] > b[0]) {\n    x = b[1];\n    y = b[2];\n    z = b[0];\n    q = 1 + 1;\n    w = 2 + 1;\n    e = 0 + 1;\n  } else if (b[0] > b[2] && b[2] > b[1]) {\n    x = b[0];\n    y = b[2];\n    z = b[1];\n    q = 0 + 1;\n    w = 2 + 1;\n    e = 1 + 1;\n  }\n  for (i = 3; i < n; i++) {\n    if (b[i] > x) {\n      t = x;\n      x = b[i];\n      z = y;\n      y = t;\n      e = w;\n      w = q;\n      q = i + 1;\n    } else if (b[i] > y) {\n      z = y;\n      y = b[i];\n      e = w;\n      w = i + 1;\n    } else if (b[i] > z) {\n      z = b[i];\n      e = i + 1;\n    }\n  }\n  cout << q << \" \" << x << \"\\n\";\n  cout << w << \" \" << y << \"\\n\";\n  printf(\"%d %d\\n\", e, z);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, max, m, c;\n  int a[100000];\n  struct student {\n    int num;\n    int math;\n    int b;\n  } stu1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu1.num, &stu1.math, &stu1.b);\n    a[i] = stu1.math + stu1.b;\n  }\n\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      k = i;\n    }\n  }\n  cout << k + 1 << \" \" << a[k] << \"\\n\";\n  a[k] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      m = i;\n    }\n  }\n  printf(\"%d %d\\n\", m + 1, a[m]);\n  a[m] = 0;\n  max = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      c = i;\n    }\n  }\n  printf(\"%d %d\", c + 1, a[c]);\n}\n"}
{"label": "14", "index": "26428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nstruct record {\n  int stuID;\n  short YuWen;\n  short math;\n  short total;\n};\n\nstruct YyxNode {\n  struct record m_rec;\n  struct YyxNode *next;\n};\n\nstruct YyxLink {\n  int n;\n  struct YyxNode *head;\n  struct YyxNode *tail;\n};\n\nstruct YyxLink *CreateNewLink() {\n  struct YyxLink *newLn;\n  if ((newLn = (struct YyxLink *)malloc(sizeof(struct YyxLink))) == NULL) {\n    printf(\"Error: memory out! (1)\\n\");\n    exit(-1);\n  }\n  newLn->n = 0;\n  newLn->head = NULL;\n  newLn->tail = NULL;\n\n  return newLn;\n}\n\nstruct YyxLink *AddNode(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *newNode;\n  if ((newNode = (struct YyxNode *)malloc(sizeof(struct YyxNode))) == NULL) {\n    printf(\"Error: memory out! (2)\\n\");\n    exit(-1);\n  }\n  newNode->m_rec = *rec;\n  newNode->next = NULL;\n  if (ln->n == 0) {\n    ln->head = newNode;\n    ln->tail = newNode;\n  } else {\n    ln->tail->next = newNode;\n    ln->tail = newNode;\n  }\n  ln->n++;\n\n  return ln;\n}\n\nint myCompare(const struct record *rec1, const struct record *rec2) {\n  return rec2->total - rec1->total;\n}\n\nstruct YyxNode *Search(struct YyxLink *ln, const struct record *rec) {\n  struct YyxNode *nd = ln->head;\n  while (nd != NULL && myCompare(&nd->m_rec, rec))\n    nd = nd->next;\n\n  return nd;\n}\n\nstruct YyxLink *ClearLink(struct YyxLink *ln) {\n  struct YyxNode *delNode = ln->head;\n  struct YyxNode *nextNode;\n  while (delNode != NULL) {\n    nextNode = delNode->next;\n    free(delNode);\n    delNode = nextNode;\n  }\n  ln->n = 0;\n  ln->head = NULL;\n  ln->tail = NULL;\n\n  return ln;\n}\n\nint main() {\n  struct YyxLink *mainLn;\n  struct record stu;\n  int n;\n  int i;\n  struct record *max1, *max2, *max3;\n  struct YyxNode *temp;\n  mainLn = CreateNewLink();\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu.stuID, &stu.YuWen, &stu.math);\n    stu.total = stu.YuWen + stu.math;\n    AddNode(mainLn, &stu);\n  }\n\n  max1 = max2 = max3 = &mainLn->head->m_rec;\n  temp = mainLn->head;\n  while (temp != NULL) {\n    if (max1->total < temp->m_rec.total)\n      max1 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  if (max2 == max1) {\n    temp = mainLn->head->next;\n    max2 = &temp->m_rec;\n  }\n  while (temp != NULL) {\n    if (max2->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec)\n        max2 = &temp->m_rec;\n    temp = temp->next;\n  }\n  temp = mainLn->head;\n  while (&temp->m_rec == max1 || &temp->m_rec == max2)\n    temp = temp->next;\n  max3 = &temp->m_rec;\n  while (temp != NULL) {\n    if (max3->total < temp->m_rec.total)\n      if (max1 != &temp->m_rec && max2 != &temp->m_rec)\n        max3 = &temp->m_rec;\n    temp = temp->next;\n  }\n\n  printf(\"%d %d\\n\", max1->stuID, max1->total);\n  printf(\"%d %d\\n\", max2->stuID, max2->total);\n  printf(\"%d %d\\n\", max3->stuID, max3->total);\n\n  \n  free(ClearLink(mainLn));\n\n  return 0;\n}\n"}
{"label": "14", "index": "26429", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n};\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  struct student s[3], p, temp;\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].yuwen, &s[i].shuxue);\n    s[i].zongfen = s[i].shuxue + s[i].yuwen;\n  }\n  for (i = 0; i < 2; i++) {\n    for (j = 0; j < 2 - i; j++) {\n      if (s[j].zongfen < s[j + 1].zongfen)\n        temp = s[j], s[j] = s[j + 1], s[j + 1] = temp;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    cin >> p.num >> p.yuwen >> p.shuxue;\n    p.zongfen = p.shuxue + p.yuwen;\n    if (p.zongfen > s[2].zongfen && p.zongfen <= s[1].zongfen)\n      s[2] = p;\n    else if (p.zongfen > s[1].zongfen && p.zongfen <= s[0].zongfen)\n      s[2] = s[1], s[1] = p;\n    else {\n      if (p.zongfen > s[0].zongfen)\n        s[2] = s[1], s[1] = s[0], s[0] = p;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", s[0].num, s[0].zongfen, s[1].num, s[1].zongfen,\n         s[2].num, s[2].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct score {\n    int n;\n    int a;\n    int b;\n    int c;\n  } score[5];\n  int i, m;\n  cin >> m;\n  score[1].n = 0;\n  score[1].c = 0;\n  score[2].n = 0;\n  score[2].c = 0;\n  score[3].n = 0;\n  score[3].c = 0;\n  for (i = 0; i < m; i++) {\n    cin >> score[4].n >> score[4].a >> score[4].b;\n    score[4].c = score[4].a + score[4].b;\n    if (score[4].c > score[1].c) {\n      score[3] = score[2];\n      score[2] = score[1];\n      score[1] = score[4];\n    } else if (score[4].c > score[2].c) {\n      score[3] = score[2];\n      score[2] = score[4];\n    } else if (score[4].c > score[3].c)\n      score[3] = score[4];\n  }\n  cout << score[1].n << \" \" << score[1].c << \"\\n\"\n       << score[2].n << \" \" << score[2].c << \"\\n\"\n       << score[3].n << \" \" << score[3].c << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int stuID;\n  int yuwen;\n  int shuxue;\n  int zongfen;\n} stu[100000];\nint main() {\n  int i, n, j, x, str;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuID >> stu[i].yuwen >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (stu[j].zongfen > stu[j + 1].zongfen ||\n          ((stu[j].zongfen == stu[j + 1].zongfen) &&\n           (stu[j].stuID < stu[j + 1].stuID))) {\n        x = stu[j].zongfen;\n        stu[j].zongfen = stu[j + 1].zongfen;\n        stu[j + 1].zongfen = x;\n        str = stu[j].stuID;\n        stu[j].stuID = stu[j + 1].stuID;\n        stu[j + 1].stuID = str;\n      }\n    }\n    cout << stu[n - 1 - i].stuID << \" \" << stu[n - 1 - i].zongfen << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stud {\n  int n;\n  int chinese;\n  int math;\n  int total;\n  struct stud *next;\n};\nint tol;\nstruct stud *creat(void) {\n  struct stud *head, *p1, *p2;\n  int i = 1;\n  p1 = p2 = (struct stud *)malloc(sizeof(struct stud));\n  head = p1;\n  for (i = 1; i < tol; i++) {\n    scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n    p1->total = (p1->math + p1->chinese);\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    p2->next = p1;\n    p2 = p1;\n  }\n  scanf(\"%d%d%d\", &p1->n, &p1->chinese, &p1->math);\n  p1->total = (p1->math + p1->chinese);\n  p2->next = p1;\n  p1->next = 0;\n  return head; \n}\nint max(struct stud *head, int max1, int max2) {\n  struct stud *p1;\n  int maxtotal = head->total, max_index;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->total > maxtotal && p1->n != max1 && p1->n != max2) {\n      maxtotal = (p1->total);\n      max_index = (p1->n);\n    }\n  }\n  if (maxtotal != max1)\n    printf(\"%d %d\\n\", max_index, maxtotal);\n  return max_index;\n}\nint main() {\n  struct stud *head;\n  int max1, max2;\n  scanf(\"%d\", &tol);\n  head = creat();\n  max1 = max(head, 0, 0);\n  max2 = max(head, max1, 0);\n  max(head, max1, max2);\n}\n"}
{"label": "14", "index": "26433", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, q, w;\n  cin >> n;\n  int a[n], b[n], c[n], d[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    d[i] = b[i] + c[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i] < d[j]) {\n        q = d[i];\n        d[i] = d[j];\n        d[j] = q;\n        w = a[i];\n        a[i] = a[j];\n        a[j] = w;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], d[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n  int zong;\n} stu[100001];\n\nint main(int argc, char *argv[]) {\n  int i, n, max1 = 0, max2 = 0, max3 = 0, fir, sec, thi;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].num >> stu[i].yw >> stu[i].sx;\n    stu[i].zong = stu[i].yw + stu[i].sx;\n    if (stu[i].zong > max1) {\n      max3 = max2;\n      thi = sec;\n      max2 = max1;\n      sec = fir;\n      max1 = stu[i].zong;\n      fir = i;\n    } else {\n      if (stu[i].zong > max2) {\n        max3 = max2;\n        thi = sec;\n        max2 = stu[i].zong;\n        sec = i;\n      } else if (stu[i].zong > max3) {\n        max3 = stu[i].zong;\n        thi = i;\n      }\n    }\n  }\n\n  printf(\"%d %d\\n\", stu[fir].num, stu[fir].zong);\n  printf(\"%d %d\\n\", stu[sec].num, stu[sec].zong);\n  printf(\"%d %d\\n\", stu[thi].num, stu[thi].zong);\n  return 0;\n}\n"}
{"label": "14", "index": "26435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yw;\n    int sx;\n    int all;\n  } student[4] = {0, 0, 0, 0};\n  struct student temp = {0, 0, 0, 0};\n  int i, l, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[3].num, &student[3].yw, &student[3].sx);\n    student[3].all = student[3].yw + student[3].sx;\n\n    if (student[2].all < student[3].all) {\n      temp = student[2];\n      student[2] = student[3];\n      student[3] = temp;\n    }\n    if (student[1].all < student[2].all) {\n      temp = student[1];\n      student[1] = student[2];\n      student[2] = temp;\n    }\n    if (student[0].all < student[1].all) {\n      temp = student[0];\n      student[0] = student[1];\n      student[1] = temp;\n    }\n  }\n  for (l = 0; l < 3; l++)\n    cout << student[l].num << \" \" << student[l].all << \"\\n\";\n}\n"}
{"label": "14", "index": "26436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  int No;\n  int Chinese;\n  int Maths;\n  int Total;\n};\n\nvoid bubble(struct Student a[], int n) {\n  int i, j;\n  struct Student temp;\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j].Total < a[j + 1].Total) {\n        temp = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = temp;\n      }\n    }\n  }\n}\n\nint main() {\n  int n, i;\n  struct Student stu[4];\n  scanf(\"%d\", &n);\n  if (n > 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].Chinese + stu[i].Maths;\n    }\n    for (i = 3; i < n; i++) {\n      scanf(\"%d%d%d\", &stu[3].No, &stu[3].Chinese, &stu[3].Maths);\n      stu[3].Total = +stu[3].Chinese + stu[3].Maths;\n      bubble(stu, 4);\n    }\n  } else {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d%d%d\", &stu[i].No, &stu[i].Chinese, &stu[i].Maths);\n      stu[i].Total = stu[i].No + stu[i].Chinese + stu[i].Maths;\n    }\n    bubble(stu, n);\n  }\n  for (i = 0; i < n && i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].No, stu[i].Total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int total;\n} stu[100000];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].total = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (stu[j].total > stu[k].total)\n        k = j;\n    if (k != i) {\n      t = stu[i].total;\n      stu[i].total = stu[k].total;\n      stu[k].total = t;\n      t = stu[i].num;\n      stu[i].num = stu[k].num;\n      stu[k].num = t;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  }\n}\n"}
{"label": "14", "index": "26438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yw;\n  int sx;\n};\nint main() {\n  int n, i, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  struct student a[n];\n  int b[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].yw, &a[i].sx);\n    b[i] = a[i].yw + a[i].sx;\n  }\n  for (i = 1; i < n; i++) {\n    if (b[x] < b[i])\n      x = i;\n  }\n  printf(\"%d %d\\n\", a[x].num, b[x]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (b[y] < b[i])\n      y = i;\n  }\n  printf(\"%d %d\\n\", a[y].num, b[y]);\n  for (i = 1; i < n; i++) {\n    if (i == x)\n      continue;\n    if (i == y)\n      continue;\n    if (b[z] < b[i])\n      z = i;\n  }\n  printf(\"%d %d\\n\", a[z].num, b[z]);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26439", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    char a[6];\n    int c;\n    int m;\n    int s;\n    struct student *next;\n  };\n  struct student *head;\n  struct student *p1, *p2;\n  struct student first = {\"\", 0, 0, 0, 0};\n  struct student second = {\"\", 0, 0, 0, 0};\n  struct student third = {\"\", 0, 0, 0, 0};\n  int n, i, j;\n  char ch;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  for (j = 0; j < 6; j = j + 1)\n    p1->a[j] = '\u0000';\n  getchar();\n  for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n    p1->a[j] = ch;\n  cin >> p1->c >> p1->m;\n  p1->s = p1->c + p1->m;\n  head = 0;\n  for (i = 1; i < n; i = i + 1) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    for (j = 0; j < 6; j = j + 1)\n      p1->a[j] = '\u0000';\n    getchar();\n    for (j = 0; (ch = getchar()) != ' '; j = j + 1)\n      p1->a[j] = ch;\n    scanf(\"%d%d\", &p1->c, &p1->m);\n    p1->s = p1->c + p1->m;\n  }\n  p2->next = 0;\n  for (p1 = head; p1 != 0; p1 = p1->next) {\n    if (p1->s > first.s) {\n      third = second;\n      second = first;\n      first = *p1;\n    } else if (p1->s > second.s) {\n      third = second;\n      second = *p1;\n    } else if (p1->s > third.s)\n      third = *p1;\n    else\n      continue;\n  }\n  printf(\"%s %d \", first.a, first.s);\n  printf(\"%s %d \", second.a, second.s);\n  printf(\"%s %d \", third.a, third.s);\n}\n"}
{"label": "14", "index": "26440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct stdudent {\n    int ID;\n    int a;\n    int b;\n    int c;\n\n  } d[100000];\n  int first, second, third;\n  int n, i, j;\n  int w, h, l;\n  int k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> d[i].ID >> d[i].a >> d[i].b;\n    d[i].c = d[i].a + d[i].b;\n  }\n  first = 0;\n  second = 1;\n  third = 2;\n  w = d[0].c;\n  h = d[1].c;\n  l = d[2].c;\n  if (w < h && (h > l)) {\n    first = 1;\n    if (w > l) {\n      second = 0;\n      third = 2;\n    } else {\n      second = 2;\n      third = 0;\n    }\n  } else if (l > w) {\n    first = 2;\n    if (w > h) {\n      second = 0;\n      third = 1;\n    } else\n      third = 0;\n  }\n\n  for (j = 3; j < n; j++) {\n    k = d[j].c;\n    w = d[first].c;\n    h = d[second].c;\n    l = d[third].c;\n    if (k > w) {\n      third = second;\n      second = first;\n      first = j;\n    } else if (k > h) {\n      third = second;\n      second = j;\n    } else if (k > l)\n      third = j;\n  }\n  printf(\"%d %d \", d[first].ID, d[first].c);\n  cout << d[second].ID << \" \" << d[second].c << \" \";\n  printf(\"%d %d \", d[third].ID, d[third].c);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int s1;\n  int s2;\n  int sum;\n};\nstruct student stu[100000];\nint main() {\n\n  int n, i, p, q, r, max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].sum = stu[i].s1 + stu[i].s2;\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max) {\n      max = stu[i].sum;\n      p = i;\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if (i != p) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        q = i;\n      }\n    }\n  }\n  max = 0;\n  for (i = 0; i < n; i++) {\n    if ((i != p) && (i != q)) {\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[p].num, stu[p].sum);\n  printf(\"%d %d\\n\", stu[q].num, stu[q].sum);\n  printf(\"%d %d\\n\", stu[r].num, stu[r].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26442", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct xue {\n  int ID;\n  int sx;\n  int yw;\n  int sum;\n} xueshen;\n\nint main() {\n  int n, i, k;\n  cin >> n;\n  struct xue *xuesheng;\n  xuesheng = (struct xue *)malloc(4 * sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    cin >> xuesheng[i].ID >> xuesheng[i].sx >> xuesheng[i].yw;\n    xuesheng[i].sum = xuesheng[i].sx + xuesheng[i].yw;\n  }\n  for (i = 1; i < 4; i++) {\n    for (k = 0; k < n - i; k++) {\n      if (xuesheng[k].sum >= xuesheng[k + 1].sum) {\n        xueshen = xuesheng[k + 1];\n        xuesheng[k + 1] = xuesheng[k];\n        xuesheng[k] = xueshen;\n      }\n    }\n  }\n  for (i = 1; i < 4; i++)\n    printf(\"%d %d\\n\", xuesheng[n - i].ID, xuesheng[n - i].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int ch;\n  int math;\n  int sum;\n};\nint main() {\n  struct Student stu[4], temp;\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    stu[i].sum = stu[i].ch + stu[i].math;\n  }\n  for (i = 0; i < 2; i++) {\n    k = i;\n    for (j = i + 1; j < 3; j++)\n      if (stu[j].sum > stu[i].sum) {\n        k = j;\n        temp = stu[k];\n        stu[j] = stu[i];\n        stu[i] = temp;\n      }\n  }\n\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[3].num, &stu[3].ch, &stu[3].math);\n    stu[3].sum = stu[3].ch + stu[3].math;\n    if (stu[3].sum > stu[0].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[0];\n      stu[0] = stu[3];\n    } else if (stu[3].sum > stu[1].sum) {\n      stu[2] = stu[1];\n      stu[1] = stu[3];\n    } else if (stu[3].sum > stu[2].sum)\n      stu[2] = stu[3];\n  }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n} stu[100000];\n\nint main() {\n\n  int n, i, j, t, a, b, m;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    cout << stu[a].num << \" \" << stu[a].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "26445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct f {\n  int a;\n  int b;\n  int c;\n} st[100000], tp;\nint main() {\n  int n, i, ii, j, d, a, b, c;\n  char cc;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> st[i].a >> st[i].b >> st[i].c;\n    st[i].b += st[i].c;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[j].b > st[i].b) {\n        tp = st[i];\n        st[i] = st[j];\n        st[j] = tp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << st[i].a << \" \" << st[i].b << \"\\n\";\n  }\n}\n"}
{"label": "14", "index": "26446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    int num;\n    int chi;\n    int mat;\n  } stu[100000];\n  int n, i, max1, max2, max3, maxn1, maxn2, maxn3;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].num);\n    scanf(\"%d\", &stu[i].chi);\n    scanf(\"%d\", &stu[i].mat);\n    sum[i] = stu[i].chi + stu[i].mat;\n  }\n  max1 = sum[0];\n  maxn1 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max1) {\n      max1 = sum[i];\n      maxn1 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn1, max1);\n  max2 = sum[0];\n  maxn2 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max2 && i != maxn1 - 1) {\n      max2 = sum[i];\n      maxn2 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn2, max2);\n  max3 = sum[0];\n  maxn3 = stu[0].num;\n  for (i = 1; i < n; i++) {\n    if (sum[i] > max3 && i != maxn1 - 1 && i != maxn2 - 1) {\n      max3 = sum[i];\n      maxn3 = stu[i].num;\n    }\n  }\n  printf(\"%d %d\\n\", maxn3, max3);\n}\n"}
{"label": "14", "index": "26447", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int x[100000];\n  int i, j, n, s, y, p;\n  int b[100000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y, &p);\n    b[i] = y + p;\n  }\n  int t;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (b[j] > b[i]) {\n        s = x[i];\n        x[i] = x[j];\n        x[j] = s;\n        t = b[i];\n        b[i] = b[j];\n        b[j] = t;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", x[i], b[i]);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26448", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int id;\n    float yuwen, shuxue, sum;\n  } stu[100000], t;\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %f %f\", &stu[i].id, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 1; j > i; j--)\n      if (stu[j].sum > stu[j - 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = t;\n      }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %g \", stu[i].id, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\n\nstruct stu {\n  int xh;\n  int yw;\n  int sx;\n  int all;\n  struct stu *next;\n};\nstruct stu *a, *b, *c, q, t, r;\nstruct stu *creat() {\n  struct stu *head;\n  struct stu *p1, *p2;\n  int i;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->all = p1->yw + p1->sx;\n  head = p1;\n  a = b = c = head;\n  for (i = 1; i < n; i++) {\n    p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->all = p1->yw + p1->sx;\n    if (p1->all > a->all) {\n      c = b;\n      b = a;\n      a = p1;\n    } else\n\n        if (p1->all > b->all) {\n      c = b;\n      b = p1;\n    } else {\n      if (p1->all > c->all)\n        c = p1;\n    }\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n\n  struct stu *p;\n  a = &q;\n  b = &t;\n  c = &r;\n  scanf(\"%d\", &n);\n  p = creat();\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a->xh, a->all, b->xh, b->all, c->xh, c->all);\n}\n"}
{"label": "14", "index": "26450", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pfCompare(const void *elem1, const void *elem2) {\n  int c;\n  c = *(int *)elem1 - *(int *)elem2;\n  return c;\n}\nstruct student {\n  int num;\n  int x;\n  int y;\n} a[100000];\nint main() {\n  int n, i, j, d = 0, b[100000], c[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[i].num);\n    scanf(\"%d\", &a[i].x);\n    scanf(\"%d\", &a[i].y);\n  }\n  for (i = 0; i < n; i++) {\n    b[i] = a[i].x + a[i].y;\n  }\n  qsort(b, n, sizeof(int), pfCompare);\n  for (j = 0; j < n; j++) {\n    if (b[n - 1] == a[j].x + a[j].y) {\n      printf(\"%d\"\n             \" \"\n             \"%d\",\n             a[j].num, b[n - 1]);\n      printf(\" \");\n      d++;\n    }\n    if (d == 3)\n      break;\n  }\n  for (i = n - 2; i > n - 4; i--) {\n    if (b[i] == b[i + 1])\n      continue;\n    else {\n      for (j = 0; j < n; j++) {\n        if (b[i] == a[j].x + a[j].y) {\n          printf(\"%d\"\n                 \" \"\n                 \"%d\",\n                 a[j].num, b[i]);\n          printf(\" \");\n          d++;\n        }\n        if (d == 3)\n          break;\n      }\n      if (d == 3)\n        break;\n    }\n  }\n}\n"}
{"label": "14", "index": "26451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n\n  int n, i, k, e, f;\n\n  scanf(\"%d\", &n);\n\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = n - 1; i > k; i--) {\n      if (stu[i - 1].sum < stu[i].sum) {\n        e = stu[i - 1].sum;\n        stu[i - 1].sum = stu[i].sum;\n        stu[i].sum = e;\n        f = stu[i - 1].No;\n        stu[i - 1].No = stu[i].No;\n        stu[i].No = f;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].No << \" \" << stu[i].sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } m[4], t;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 3; i++)\n    m[i].sum = -1;\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &t.num, &t.chinese, &t.math);\n    t.sum = t.chinese + t.math;\n    if (t.sum > m[1].sum) {\n      m[3] = m[2];\n      m[2] = m[1];\n      m[1] = t;\n    } else if (t.sum > m[2].sum) {\n      m[3] = m[2];\n      m[2] = t;\n    } else if (t.sum > m[3].sum)\n      m[3] = t;\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", m[i].num, m[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26453", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int score1;\n  int score2;\n  struct student *next;\n};\nstruct student *head;\nstruct student *creat(int x) {\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n  head = 0;\n  while (p1->id < x) {\n    if (p1->id == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->id, &p1->score1, &p1->score2);\n    if (p1->id == x) {\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = 0;\n  return (head);\n}\nint main() {\n  int n;\n  struct student *p, *q, *j, *k;\n  scanf(\"%d\", &n);\n  creat(n);\n  p = q = head;\n  do {\n    if ((p->score1 + p->score2) > (q->score1 + q->score2))\n      q = p;\n    p = p->next;\n  } while (p != 0);\n  p = j = head;\n  do {\n    if ((p->score1 + p->score2) > (j->score1 + j->score2) && p != q)\n      j = p;\n    p = p->next;\n  } while (p != 0);\n  p = k = head;\n  do {\n    if ((p->score1 + p->score2) > (k->score1 + k->score2) && p != q && p != j)\n      k = p;\n    p = p->next;\n  } while (p != 0);\n  printf(\"%d %d \", q->id, (q->score1 + q->score2));\n  printf(\"%d %d \", j->id, (j->score1 + j->score2));\n  printf(\"%d %d\", k->id, (k->score1 + k->score2));\n}\n"}
{"label": "14", "index": "26454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  struct student {\n    int id;\n    int yu, shu;\n  } stu[100000];\n  int i;\n  int s1 = 0, s2 = 0, s3 = 0;\n  int x1 = 0, x2 = 0, x3 = 0;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\\n\", &stu[i].id, &stu[i].yu, &stu[i].shu);\n  }\n  int s, x;\n  for (i = 0; i < n; i++) {\n    s = stu[i].yu + stu[i].shu;\n    x = stu[i].id;\n    if (s > s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s1;\n      x2 = x1;\n      s1 = s;\n      x1 = x;\n    } else if (s == s1) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else if (s < s1 && s > s2) {\n      s3 = s2;\n      x3 = x2;\n      s2 = s;\n      x2 = x;\n    } else {\n      if (s == s2) {\n        s3 = s;\n        x3 = x;\n      } else if (s < s2 && s > s3) {\n        s3 = s;\n        x3 = x;\n      }\n    }\n  }\n  cout << x1 << \" \" << s1 << \"\\n\";\n  printf(\"%d %d\\n\", x2, s2);\n  printf(\"%d %d\\n\", x3, s3);\n  return 0;\n}\n"}
{"label": "14", "index": "26455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int c;\n  int m;\n  int t;\n} a[1000];\nint cmp(const void *p1, const void *p2) {\n  struct student *p3 = (struct student *)p1;\n  struct student *p4 = (struct student *)p2;\n  return -p3->t + p4->t;\n}\nint main(void) {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].c, &a[i].m);\n    a[i].t = a[i].m + a[i].c;\n  }\n  qsort(a, n, sizeof(a[0]), cmp);\n  for (i = 0; i < 3; i++) {\n    cout << a[i].id << \" \" << a[i].c + a[i].m << \" \";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int id;\n  int sum;\n  struct stu *next;\n};\n\nint main() {\n  struct stu *head, *p1, *p2, *p0;\n  int n, i, ch, ma, len;\n  scanf(\"%d\", &n);\n  len = sizeof(struct stu);\n\n  p1 = p2 = (struct stu *)malloc(len);\n\n  head = p1;\n  scanf(\"%d%d%d\", &p1->id, &ch, &ma);\n  p1->sum = ch + ma;\n  p1->next = 0;\n\n  for (i = 2; i <= n; i++) {\n    p0 = (struct stu *)malloc(len);\n    scanf(\"%d %d %d\", &p0->id, &ch, &ma);\n    p0->sum = ch + ma;\n\n    p1 = p2 = head;\n    while ((p0->sum <= p1->sum) && (p1->next != 0)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->sum > p1->sum) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n    if (i > 3) {\n      p1 = head->next;\n      p1 = p1->next;\n      p1->next = 0;\n    }\n  }\n  p1 = head;\n  while (p1 != 0) {\n    printf(\"%d %d\\n\", p1->id, p1->sum);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "26457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n\n    int id;\n    int chi;\n    int mat;\n    int sum;\n  } stu[100000], t;\n  int i, j, n, student_num;\n  scanf(\"%d\", &student_num);\n  n = student_num;\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chi, &stu[i].mat);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  for (i = 0; i < n; i++)\n    if (stu[0].sum < stu[i].sum) {\n      t = stu[0];\n      stu[0] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 1; i < n; i++)\n    if (stu[1].sum < stu[i].sum) {\n      t = stu[1];\n      stu[1] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 2; i < n; i++)\n    if (stu[2].sum < stu[i].sum) {\n      t = stu[2];\n      stu[2] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n}\n"}
{"label": "14", "index": "26458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int idnum, yunum, shunum;\n  } stu[100000];\n  int n, i, max = 0, ndmax = 0, rdmax = 0, l = 0;\n  scanf(\"%d\", &n);\n  int chengji[100000] = {0};\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].idnum, &stu[i].yunum, &stu[i].shunum);\n    chengji[i] = chengji[i] + stu[i].yunum;\n    chengji[i] = chengji[i] + stu[i].shunum;\n  }\n  for (i = 0; i < n; i++) {\n    if (chengji[i] > max)\n      max = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (max == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        cout << stu[i].idnum << \" \" << max << \"\\n\";\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < max) && (chengji[i] > ndmax))\n      ndmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (ndmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, ndmax);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((chengji[i] < ndmax) && (chengji[i] > rdmax))\n      rdmax = chengji[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (rdmax == (stu[i].yunum + stu[i].shunum)) {\n      l = l + 1;\n      if (l <= 3)\n        printf(\"%d %d\\n\", stu[i].idnum, rdmax);\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26459", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int yu;\n    int shu;\n    char name[6];\n  };\n  struct stu s[100000], one, two, three;\n  one.yu = 0;\n  one.shu = 0;\n  two.yu = 0;\n  two.shu = 0;\n  three.yu = 0;\n  three.shu = 0;\n  int n, j, k;\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    cin >> s[j].name >> s[j].yu >> s[j].shu;\n  }\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (one.yu + one.shu)) {\n      one = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (two.yu + two.shu)) {\n      two = s[j];\n      k = j;\n    }\n  }\n  s[k].yu = 0;\n  s[k].shu = 0;\n  for (j = 0; j < n; j++) {\n    if ((s[j].yu + s[j].shu) > (three.yu + three.shu))\n      three = s[j];\n  }\n  printf(\"%s %d\\n%s %d\\n%s %d\\n\", one.name, one.yu + one.shu, two.name,\n         two.yu + two.shu, three.name, three.yu + three.shu);\n  return 0;\n}\n"}
{"label": "14", "index": "26460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int y;\n  int s;\n  int t;\n  struct stu *next;\n};\nint main() {\n  struct stu *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n    p1->t = p1->y + p1->s;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  int k = 0;\n  while (k < 3) {\n    p2 = head;\n    for (; p2 != 0; p2 = p2->next) {\n      for (p1 = p2->next; p1 != 0;) {\n        if (p2->t < p1->t)\n          break;\n        else\n          p1 = p1->next;\n      }\n      if (p1 == 0) {\n        cout << p2->num << \" \" << p2->t << \" \";\n        break;\n      }\n    }\n    k = k + 1;\n    p2->t = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct stu {\n    char id[9];\n    int chn;\n    int math;\n    int both;\n    struct stu *next;\n  };\n  int n, i;\n  scanf(\"%d \", &n);\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = (struct stu *)malloc(sizeof(struct stu));\n      p1 = head;\n    } else {\n      p1->next = (struct stu *)malloc(sizeof(struct stu));\n      p1 = p1->next;\n    }\n    scanf(\"%s%d%d\", p1->id, &p1->chn, &p1->math);\n    p1->both = p1->chn + p1->math;\n  }\n  p1->next = NULL;\n  int max;\n  for (i = 0; i < 3; i++) {\n    max = head->both;\n    p1 = head;\n    do {\n      p1 = p1->next;\n      if (max < p1->both) {\n        max = p1->both;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    cout << p2->id << \" \" << p2->both << \"\\n\";\n    p2->both = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, a[3][2], k;\n  struct student {\n    int num;\n    int s1;\n    int s2;\n    int l;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].s1, &stu[i].s2);\n    stu[i].l = stu[i].s1 + stu[i].s2;\n  }\n  for (i = 0; i < 3; i++) {\n    for (m = 0, j = 0; j < n; j++) {\n      if (m < stu[j].l) {\n        m = stu[j].l;\n        k = j;\n      }\n    }\n    a[i][0] = k;\n    a[i][1] = m;\n    stu[k].l = 0;\n  }\n  for (i = 0; i < 3; i++)\n    cout << a[i][0] + 1 << \" \" << a[i][1] << \"\\n\";\n}\n"}
{"label": "14", "index": "26463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p, q, t;\n  int a[100000][3];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 3; j++)\n      scanf(\"%d\", &a[i][j]);\n    a[i][1] = a[i][1] + a[i][2];\n  }\n  for (p = 0; p < 3; p++) {\n    for (q = n - 2; q >= 0; q--) {\n      if (a[q][1] < a[q + 1][1]) {\n        for (i = 0; i < 2; i++) {\n          t = a[q][i];\n          a[q][i] = a[q + 1][i];\n          a[q + 1][i] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i][0] << \" \" << a[i][1] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int StudentNumber;\n    int ChineseGrades;\n    int MathGrades;\n    int Total;\n  };\n  struct student Stu[100000], sTemp;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> Stu[i].StudentNumber >> Stu[i].ChineseGrades >> Stu[i].MathGrades;\n    Stu[i].Total = Stu[i].ChineseGrades + Stu[i].MathGrades;\n  }\n  for (i = 0; i <= 2; i++) {\n    for (j = n - 1; j >= i + 1; j--) {\n      if (Stu[j].Total > Stu[j - 1].Total) {\n        sTemp = Stu[j];\n        Stu[j] = Stu[j - 1];\n        Stu[j - 1] = sTemp;\n      }\n    }\n  }\n  cout << Stu[0].StudentNumber << \" \" << Stu[0].Total;\n  for (i = 1; i <= 2; i++) {\n    cout << endl;\n    printf(\"%d %d\", Stu[i].StudentNumber, Stu[i].Total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct stu {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n    struct stu *next;\n  };\n  int n, max, i;\n  struct stu *p1, *p2, *head, *maxsum;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  for (i = 1; i < n; i++) {\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  p1 = head;\n  while (p1->next != NULL) {\n    p1->sum = p1->chinese + p1->math;\n    p1 = p1->next;\n  }\n  p1->sum = p1->chinese + p1->math;\n  for (i = 1; i <= 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    maxsum = p1;\n    while (p1->next != NULL) {\n      if (p1->sum > max) {\n        maxsum = p1;\n        max = p1->sum;\n      }\n      p1 = p1->next;\n    }\n    if (p1->sum > max) {\n      maxsum = p1;\n      max = p1->sum;\n    }\n    cout << maxsum->num << \" \" << maxsum->sum << \" \";\n    maxsum->sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26466", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n\n    int id;\n    int chi;\n    int mat;\n    int sum;\n  } stu[100000], t;\n  int i, n, student_num;\n  scanf(\"%d\", &student_num);\n  n = student_num;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].id >> stu[i].chi >> stu[i].mat;\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  for (i = 0; i < n; i++)\n    if (stu[0].sum < stu[i].sum) {\n      t = stu[0];\n      stu[0] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 1; i < n; i++)\n    if (stu[1].sum < stu[i].sum) {\n      t = stu[1];\n      stu[1] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 2; i < n; i++)\n    if (stu[2].sum < stu[i].sum) {\n      t = stu[2];\n      stu[2] = stu[i];\n      stu[i] = t;\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].id, stu[i].sum);\n}\n"}
{"label": "14", "index": "26467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n  while (p1->num < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    cout << q->num << \" \" << q->sum << \" \";\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    cout << q->num << \" \" << q->sum;\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "26468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct stu {\n    char id[9];\n    int chn;\n    int math;\n    int both;\n    struct stu *next;\n  };\n  int n, i;\n  scanf(\"%d\", &n);\n  struct stu *head, *p1, *p2;\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = (struct stu *)malloc(sizeof(struct stu));\n      p1 = head;\n    } else {\n      p1->next = (struct stu *)malloc(sizeof(struct stu));\n      p1 = p1->next;\n    }\n    scanf(\"%s%d%d\", p1->id, &p1->chn, &p1->math);\n    p1->both = p1->chn + p1->math;\n  }\n  p1->next = NULL;\n  int max;\n  for (i = 0; i < 3; i++) {\n    max = head->both;\n    p1 = head;\n    do {\n      p1 = p1->next;\n      if (max < p1->both) {\n        max = p1->both;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    printf(\"%s %d\\n\", p2->id, p2->both);\n    p2->both = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26469", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int id;\n  int c;\n  int m;\n  int sum;\n};\nint main() {\n  struct Student temp, s1, s2, s3;\n  int i, n;\n  s1.sum = s2.sum = s3.sum = -1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &temp.id, &temp.c, &temp.m);\n    temp.sum = temp.c + temp.m;\n    if (temp.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = temp;\n    } else {\n      if (temp.sum > s2.sum) {\n        s3 = s2;\n        s2 = temp;\n      } else if (temp.sum > s3.sum) {\n        s3 = temp;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n}\n"}
{"label": "14", "index": "26470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct a {\n    int h;\n    int y;\n    int s;\n  } b[100000], e;\n  int c[100000];\n  int n, i, f, j, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &b[i].h, &b[i].y, &b[i].s);\n\n  for (i = 0; i < n; i++)\n    c[i] = b[i].y + b[i].s;\n\n  for (j = 0; j < 3; j++) {\n    for (i = j + 1; i < n; i++) {\n      if (c[i] > c[j]) {\n        d = c[j];\n        c[j] = c[i];\n        c[i] = d;\n        e = b[j];\n        b[j] = b[i];\n        b[i] = e;\n      }\n    }\n    f = b[j].h;\n    printf(\"%d %d\\n\", f, c[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct ss {\n    int num, yu, sh;\n    int sum;\n  };\n  int n, i;\n  struct ss *stu;\n\n  scanf(\"%d\", &n);\n  stu = (struct ss *)malloc(sizeof(ss) * n);\n  for (i = 0; i < n; i++) {\n    int num1, yu1, sh1;\n    (stu + i)->num = 0;\n    (stu + i)->yu = 0;\n    (stu + i)->sh = 0;\n    (stu + i)->sum = 0;\n    scanf(\"%d %d %d\", &num1, &yu1, &sh1);\n    (stu + i)->num = num1;\n    (stu + i)->yu = yu1;\n    (stu + i)->sh = sh1;\n    (stu + i)->sum = yu1 + sh1;\n  }\n  for (i = 1; i < n; i++) {\n    int t;\n    if ((stu + 0)->sum < (stu + i)->sum) {\n      t = (stu + 0)->sum;\n      (stu + 0)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 0)->num;\n      (stu + 0)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    int t;\n    if ((stu + 1)->sum < (stu + i)->sum) {\n      t = (stu + 1)->sum;\n      (stu + 1)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 1)->num;\n      (stu + 1)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    int t;\n    if ((stu + 2)->sum < (stu + i)->sum) {\n      t = (stu + 2)->sum;\n      (stu + 2)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 2)->num;\n      (stu + 2)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    cout << (stu + i)->num << \" \" << (stu + i)->sum << \"\\n\";\n\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26472", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct score {\n  int num;\n  int yuwen;\n  int shuxue;\n} student[100000];\nint max(int a, int b) { return (a > b) ? a : b; }\nint min(int a, int b) { return (a < b) ? a : b; }\nint main() {\n  int max(int a, int b);\n  int total[100000];\n  int n, i;\n  int max1 = 0, max2 = 0, max3 = 0;\n  int maxnum1 = 0, maxnum2 = 0, maxnum3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> student[i].num;\n    cin >> student[i].yuwen;\n    scanf(\"%d\", &student[i].shuxue);\n    total[i] = student[i].yuwen + student[i].shuxue;\n    if (total[i] >= max1) {\n      if (total[i] == max1) {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = max(maxnum1, i + 1);\n        maxnum1 = min(maxnum1, i + 1);\n      } else {\n        max3 = max2;\n        max2 = max1;\n        max1 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = maxnum1;\n        maxnum1 = i + 1;\n      }\n    } else if (total[i] < max1 && total[i] >= max2) {\n\n      if (total[i] == max2) {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = max(maxnum2, i + 1);\n        maxnum2 = min(maxnum2, i + 1);\n      } else {\n        max3 = max2;\n        max2 = total[i];\n        maxnum3 = maxnum2;\n        maxnum2 = i + 1;\n      }\n    } else {\n      if (total[i] < max2 && total[i] >= max3) {\n        if (total[i] == max3) {\n          max3 = total[i];\n          maxnum3 = min(i + 1, maxnum3);\n        } else {\n          max3 = total[i];\n          maxnum3 = i + 1;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", maxnum1, max1);\n  printf(\"%d %d\\n\", maxnum2, max2);\n  printf(\"%d %d\", maxnum3, max3);\n  return 0;\n}\n"}
{"label": "14", "index": "26473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int a, b, c;\n  } student_1;\n  int x, i = 0;\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;\n  while (i < n) {\n    scanf(\"%d%d%d\", &student_1.a, &student_1.b, &student_1.c);\n    x = student_1.b + student_1.c;\n    if (x > a2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = a1;\n      b2 = a2;\n      a1 = student_1.a;\n      a2 = x;\n    } else if (x == a2) {\n      if (x > b2) {\n        c1 = b1;\n        c2 = b2;\n        b1 = student_1.a;\n        b2 = x;\n      } else {\n        if (x > c2) {\n          c1 = student_1.a;\n          c2 = x;\n        }\n      }\n    } else if (x > b2) {\n      c1 = b1;\n      c2 = b2;\n      b1 = student_1.a;\n      b2 = x;\n    } else if (x == b2) {\n      if (x > c2) {\n        c1 = student_1.a;\n        c2 = x;\n      }\n    } else if (x > c2) {\n      c1 = student_1.a;\n      c2 = x;\n    }\n    i++;\n  }\n  printf(\"%d %d\\n\", a1, a2);\n  printf(\"%d %d\\n\", b1, b2);\n  printf(\"%d %d\\n\", c1, c2);\n  return 0;\n}\n"}
{"label": "14", "index": "26474", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100000][3], i, j, n, b[100000][2], t, m, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < 3; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    b[i][0] = a[i][0];\n    b[i][1] = a[i][1] + a[i][2];\n  }\n  for (i = 0; i < 3; i++) {\n    for (k = i + 1; k < n; k++) {\n      if (b[i][1] < b[k][1]) {\n        t = b[k][1];\n        b[k][1] = b[i][1];\n        b[i][1] = t;\n        m = b[k][0];\n        b[k][0] = b[i][0];\n        b[i][0] = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", b[i][0], b[i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "26475", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, *x, *y, *s, *z, i, j, o = 0, t = 0;\n  cin >> n;\n  x = (int *)malloc(sizeof(int) * n);\n  y = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  z = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &x[i], &y[i], &s[i]);\n    z[i] = y[i] + s[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1; i++) {\n      if (z[i] >= z[i + 1]) {\n        o = z[i];\n        z[i] = z[i + 1];\n        z[i + 1] = o;\n        t = x[i];\n        x[i] = x[i + 1];\n        x[i + 1] = t;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", x[n - 1], z[n - 1]);\n  printf(\"%d %d\\n\", x[n - 2], z[n - 2]);\n  printf(\"%d %d\\n\", x[n - 3], z[n - 3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26476", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nlong int n;\nstruct stu {\n  long int num, chi, mat, tot;\n};\nint comp(const void *a, const void *b) {\n  return ((struct stu *)b)->tot - ((struct stu *)a)->tot;\n}\nstruct stu a[100000], b;\nint main() {\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].chi >> a[i].mat;\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  qsort(a, n, sizeof(struct stu), comp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].tot);\n  return 0;\n}\n"}
{"label": "14", "index": "26477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  struct student {\n    int number;\n    int maths;\n    int chinese;\n    int sum;\n  };\n  struct student stu[n], t;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].maths;\n    stu[i].sum = stu[i].chinese + stu[i].maths;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = n - 2; j >= i; j--)\n      if (stu[j].sum < stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n  if (n >= 3) {\n    for (i = 0; i < 3; i++)\n      cout << stu[i].number << ' ' << stu[i].sum << endl;\n  } else\n    for (i = 0; i < n; i++)\n      printf(\"%d %d\\n\", stu[i].number, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26478", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int id;\n  int Chinese;\n  int math;\n} a[100000];\nint main() {\n  int n, i, first, second, third, h1 = 0, h2 = 0, h3 = 0, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].id, &a[i].Chinese, &a[i].math);\n  }\n  first = 0;\n  second = 0;\n  third = 0;\n  for (i = 0; i < n; i++) {\n    if (first < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = first;\n      h2 = h1;\n      first = a[i].Chinese + a[i].math;\n      h1 = a[i].id;\n    } else if (first == (a[i].Chinese + a[i].math) && first > second) {\n      third = second;\n      h3 = h2;\n      h2 = a[i].id;\n      second = a[i].Chinese + a[i].math;\n    } else if (first == (a[i].Chinese + a[i].math) && first == second &&\n               second > third) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    } else if (first > (a[i].Chinese + a[i].math) &&\n               second < (a[i].Chinese + a[i].math)) {\n      third = second;\n      h3 = h2;\n      second = a[i].Chinese + a[i].math;\n      h2 = a[i].id;\n    } else if (second > (a[i].Chinese + a[i].math) &&\n               third < (a[i].Chinese + a[i].math)) {\n      third = a[i].Chinese + a[i].math;\n      h3 = a[i].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, second, h3, third);\n}\n"}
{"label": "14", "index": "26479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int i;\n    int x;\n    int y;\n    int m;\n    struct student *next;\n  };\n  int n, j, k;\n  struct student *head, *p1, *p2, *p0;\n  scanf(\"%d\", &n);\n  p1 = (struct student *)malloc(1000);\n  cin >> p1->i >> p1->x >> p1->y;\n  p1->m = p1->x + p1->y;\n  p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->i, &p2->x, &p2->y);\n  p2->m = p2->x + p2->y;\n  if (p1->m > p2->m) {\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  } else {\n    p0 = p1;\n    p1 = p2;\n    p2 = p0;\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  }\n  p0 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p0->i, &p0->x, &p0->y);\n  p0->m = p0->x + p0->y;\n  while ((p0->m <= p1->m) && (p1->next != 0)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p0->m > p1->m) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n  } else {\n    p1->next = p0;\n    p0->next = 0;\n  }\n  for (j = 3; j < n; j++) {\n    p0 = (struct student *)malloc(1000);\n    cin >> p0->i >> p0->x >> p0->y;\n    p0->m = p0->x + p0->y;\n    for (k = 0, p1 = head; k <= 2; k++) {\n      if (p0->m > p1->m)\n        break;\n      p1 = p1->next;\n    }\n    if (k == 3)\n      continue;\n    p1 = p2 = head;\n    while (p0->m <= p1->m) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->m > p1->m) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  for (p1 = head, j = 0; j < 3; j++) {\n    printf(\"%d %d \", p1->i, p1->m);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "26480", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    long num;\n    int chinese;\n    int math;\n  };\n  struct student stu[100001];\n  int i, t, h, l = 0;\n  long n;\n  int a[100001];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    cin >> stu[i].num >> stu[i].chinese >> stu[i].math;\n  for (i = 0; i < n; i++)\n    a[i] = stu[i].chinese + stu[i].math;\nleap:\n  t = a[0];\n  h = 0;\n  for (i = 1; i < n; i++) {\n    if (a[i] > t) {\n      t = a[i];\n      h = i;\n    }\n  }\n  printf(\"%ld %d\\n\", stu[h].num, a[h]);\n  l++;\n  a[h] = 0;\n  if (l < 3)\n    goto leap;\n  return 0;\n}\n"}
{"label": "14", "index": "26481", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> n;\n  scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  for (; p1->id < n;) {\n    if (p1->id == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2, *p3, *p;\n  head = creat();\n  for (p = head, p1 = head, p2 = head, p3 = head; p != NULL; p = p->next) {\n    if (p->sum > p1->sum) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->sum > p2->sum) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->sum > p3->sum) {\n      p3 = p;\n    }\n  }\n  printf(\"%d %d \", p1->id, p1->sum);\n  printf(\"%d %d \", p2->id, p2->sum);\n  printf(\"%d %d \", p3->id, p3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} s[1000];\n\nint main() {\n  int n, i, j, tn, tt;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chinese, &s[i].math);\n    s[i].total = s[i].math + s[i].chinese;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (s[j].total >= s[j + 1].total) {\n        tt = s[j].total;\n        tn = s[j].num;\n        s[j].total = s[j + 1].total;\n        s[j].num = s[j + 1].num;\n        s[j + 1].total = tt;\n        s[j + 1].num = tn;\n      }\n    }\n  }\n  cout << s[n - 1].num << \" \" << s[n - 1].total << \" \" << s[n - 2].num << \" \"\n       << s[n - 2].total << \" \" << s[n - 3].num << \" \" << s[n - 3].total << \" \";\n  return (0);\n}\n"}
{"label": "14", "index": "26483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum[100000], a, b, c;\n  struct xues {\n    int a, b, c;\n  } s[100000];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    sum[i] = s[i].b + s[i].c;\n  }\n  int fir = 0, sec = 0, thi = 0;\n  for (i = 0; i < n; i++) {\n    if (fir < sum[i]) {\n      thi = sec;\n      sec = fir;\n      fir = sum[i];\n      c = b;\n      b = a;\n      a = s[i].a;\n    } else {\n      if (sec < sum[i]) {\n        thi = sec;\n        sec = sum[i];\n        fir = fir;\n        a = a;\n        c = b;\n        b = s[i].a;\n      } else if (thi < sum[i]) {\n        fir = fir;\n        sec = sec;\n        thi = sum[i];\n        a = a;\n        b = b;\n        c = s[i].a;\n      }\n    }\n  }\n  cout << a << \" \" << fir << \"\\n\" << b << \" \" << sec << \"\\n\" << c << \" \" << thi;\n  return 0;\n}\n"}
{"label": "14", "index": "26484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct {\n    int number;\n    float score1;\n    float score2;\n    float score3;\n\n  } stu[100000], temp;\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    stu[i].score3 = stu[i].score2 + stu[i].score1;\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = n - 1; j >= n - i; j--)\n      if (stu[j - 1].score3 < stu[j].score3) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  cout << stu[0].number << \" \" << stu[0].score3 << endl;\n  cout << stu[1].number << \" \" << stu[1].score3 << endl;\n  cout << stu[2].number << \" \" << stu[2].score3;\n  return 0;\n}\n"}
{"label": "14", "index": "26485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct Stu {\n    int num;\n    int sco[2];\n    int sum;\n  };\n  struct Stu stu[5];\n  struct Stu temp;\n  int i, j, n, m, k;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    for (i = 0; i < 3; i++) {\n      scanf(\"%d%d%d\", &stu[i].num, &stu[i].sco[0], &stu[i].sco[1]);\n      stu[i].sum = stu[i].sco[0] + stu[i].sco[1];\n    }\n    for (k = 1; k <= n - 3; k++) {\n      scanf(\"%d%d%d\", &stu[3].num, &stu[3].sco[0], &stu[3].sco[1]);\n      stu[3].sum = stu[3].sco[0] + stu[3].sco[1];\n      m = 0;\n      for (j = 1; j <= 2; j++) {\n        if (stu[m].sum > stu[j].sum ||\n            (stu[m].sum == stu[j].sum && stu[m].num < stu[j].num))\n          m = j;\n      }\n      if (stu[3].sum > stu[m].sum)\n        stu[m] = stu[3];\n    }\n  }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++)\n      if (stu[i].num > stu[j].num) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n  for (i = 0; i < 2; i++)\n    for (j = i + 1; j < 3; j++) {\n      if (stu[i].sum < stu[j].sum) {\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n    }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26486", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student *stu = (struct student *)malloc(sizeof(int) * 4 * n);\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n  }\n\n  for (i = 0; i < n; i++) {\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n\n  int t_1, t_2;\n  int j, k;\n  for (k = 1; k < 4; k++) {\n    for (j = 0; j < n - k; j++) {\n      if (stu[j].total >= stu[j + 1].total) {\n        t_1 = stu[j + 1].total;\n        stu[j + 1].total = stu[j].total;\n        stu[j].total = t_1;\n        t_2 = stu[j + 1].num;\n        stu[j + 1].num = stu[j].num;\n        stu[j].num = t_2;\n      }\n    }\n  }\n\n  for (i = n - 1; i > n - 4; i--) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].total);\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26487", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct Student {\n    int num;\n    int ch;\n    int math;\n  } stu[100000];\n  int n, i, x = 0, m = 0, k = 0, j, a[100000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n - 1; i++) {\n    cin >> stu[i].num >> stu[i].ch >> stu[i].math;\n    a[i] = stu[i].ch + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > m) {\n        m = a[i];\n        x = stu[i].num;\n        k = i;\n      }\n    }\n    printf(\"%d %d\\n\", x, m);\n    a[k] = 0;\n    m = 0;\n    x = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26488", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  struct student {\n    int num;\n    int chi;\n    int math;\n    int sum;\n  } score[100000], temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &score[i].num, &score[i].chi, &score[i].math);\n    score[i].sum = score[i].chi + score[i].math;\n  }\n  for (i = 0; i < 4; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++)\n      if (score[j].sum > score[k].sum)\n        k = j;\n    temp = score[k];\n    score[k] = score[i];\n    score[i] = temp;\n  }\n  printf(\"%d %d\", score[0].num, score[0].sum);\n  printf(\"\\n\");\n  printf(\"%d %d\", score[1].num, score[1].sum);\n  printf(\"\\n\");\n  printf(\"%d %d\", score[2].num, score[2].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int number;\n    int chinese;\n    int math;\n    int all;\n  } stu[100000];\n  int n, i, j, n1 = 1, n2 = 1, n3 = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> stu[i].number >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n\n  for (i = 2; i <= n; i++) {\n    if (stu[n1].all < stu[i].all)\n      n1 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n1)\n      continue;\n    if (stu[n2].all < stu[i].all)\n      n2 = i;\n  }\n  for (i = 2; i <= n; i++) {\n    if (i == n2 || i == n1)\n      continue;\n    if (stu[n3].all < stu[i].all)\n      n3 = i;\n  }\n  cout << stu[n1].number << \" \" << stu[n1].all << endl;\n  printf(\"%d %d\\n\", stu[n2].number, stu[n2].all);\n  cout << stu[n3].number << \" \" << stu[n3].all << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int j;\n  int x, y;\n  int z;\n} stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, a = 0, b = 0, c = 0, a1, b1, c1;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].j, &stu[i].x, &stu[i].y);\n    stu[i].z = stu[i].x + stu[i].y;\n  }\n  for (i = 0; i < n; i++) {\n    if (a < stu[i].z) {\n      a = stu[i].z;\n      a1 = i;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (b < stu[i].z && i != a1) {\n      b = stu[i].z;\n      b1 = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (c < stu[i].z && i != a1 && i != b1) {\n      c = stu[i].z;\n      c1 = i;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", stu[a1].j, stu[a1].z, stu[b1].j, stu[b1].z,\n         stu[c1].j, stu[c1].z);\n  return 0;\n}\n"}
{"label": "14", "index": "26491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int chi;\n  int mat;\n  int sum;\n} stu[100000];\nint main() {\n\n  int i, n, max = 0, m, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chi, &stu[i].mat);\n    stu[i].sum = stu[i].chi + stu[i].mat;\n  }\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++)\n      if (stu[i].sum > max) {\n        max = stu[i].sum;\n        m = i;\n      }\n    cout << stu[m].num << \" \" << stu[m].sum << \"\\n\";\n    stu[m].sum = 0;\n    max = 0;\n  }\n}\n"}
{"label": "14", "index": "26492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  long num, ch, ma, tot;\n\n  struct stu *next;\n};\n\nint main() {\n  int n, numt, cht, mat;\n  cin >> n;\n  struct stu *head, *now, *neww, *max;\n  int i;\n  for (i = 1; i <= n; i++) {\n    neww = (struct stu *)malloc(sizeof(struct stu));\n    neww->next = 0;\n    if (i == 1) {\n      head = neww;\n      now = neww;\n    } else {\n      now->next = neww;\n      now = neww;\n    }\n    cin >> now->num >> now->ch >> now->ma;\n    now->tot = now->ch + now->ma;\n  }\n  for (i = 1; i <= 3; i++) {\n    now = head;\n    max = now;\n    while (now->next != 0) {\n      if (max->tot < now->tot)\n        max = now;\n      now = now->next;\n    }\n    cout << max->num << \" \" << max->tot << \"\\n\";\n    max->tot = -1;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct person {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} student[110000];\n\nint main() {\n  int n, i, max1 = 0, count1 = 0, max2 = 0, count2 = 0, max3 = 0, count3 = 0,\n            number = 0, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &student[i].num);\n    scanf(\"%d\", &student[i].chinese);\n    scanf(\"%d\", &student[i].math);\n  }\n  for (i = 0; i < n; i++) {\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    if (student[i].total >= max1) {\n      max1 = student[i].total;\n      count1 = i;\n    }\n  }\n  number = student[0].num;\n  sum = student[0].total;\n  student[0].num = student[count1].num;\n  student[0].total = student[count1].total;\n  student[count1].num = number;\n  student[count1].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 1; i--) {\n    if (student[i].total >= max2) {\n      max2 = student[i].total;\n      count2 = i;\n    }\n  }\n  number = student[1].num;\n  sum = student[1].total;\n  student[1].num = student[count2].num;\n  student[1].total = student[count2].total;\n  student[count2].num = number;\n  student[count2].total = sum;\n  number = 0;\n  sum = 0;\n  for (i = n - 1; i >= 2; i--) {\n    if (student[i].total >= max3) {\n      max3 = student[i].total;\n      count3 = i;\n    }\n  }\n  number = student[2].num;\n  sum = student[2].total;\n  student[2].num = student[count3].num;\n  student[2].total = student[count3].total;\n  student[count3].num = number;\n  student[count3].total = sum;\n  for (i = 0; i < 3; i++) {\n    cout << student[i].num << \" \" << student[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, h, b;\n  scanf(\"%d\", &n);\n  struct sb {\n    int ID;\n    int m;\n    int c;\n    int sum;\n  } a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].ID, &a[i].m, &a[i].c);\n    a[i].sum = a[i].m + a[i].c;\n  }\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  cout << a[h].ID << \" \" << a[h].sum << \"\\n\";\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  a[h].sum = -1;\n  for (i = 0, b = 0; i < n; i++) {\n    if (a[i].sum > b) {\n      b = a[i].sum;\n      h = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[h].ID, a[h].sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  struct student {\n    int num;\n    int yu;\n    int shu;\n  } a[100000];\n  int d[100000];\n  int i = 0;\n  ;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i].num, &a[i].yu, &a[i].shu);\n    d[i] = a[i].yu + a[i].shu;\n  }\n  int q, w, e, h;\n  q = 0;\n  w = 0;\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (d[q] < d[i]) {\n      q = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[q] >= d[i] && i != q && d[w] < d[i]) {\n      w = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (d[w] >= d[i] && i != w && i != q && d[e] < d[i]) {\n      e = i;\n    }\n  }\n  printf(\"%d %d\\n\", a[q].num, d[q]);\n  printf(\"%d %d\\n\", a[w].num, d[w]);\n  printf(\"%d %d\\n\", a[e].num, d[e]);\n  return 0;\n}\n"}
{"label": "14", "index": "26496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int count;\n  int yu;\n  int shu;\n} stu[1000000];\nint main() {\n  int n, i, *p, max = 0, sm = 0, tm = 0, j = 0;\n  p = (int *)malloc(1000000 * sizeof(int));\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].count, &stu[i].yu, &stu[i].shu);\n    *(p + i) = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < n; i++)\n    max = (max > *(p + i)) ? max : (*(p + i));\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) < max) && (*(p + i) > sm)) {\n      sm = *(p + i);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((*(p + i) > tm) && (*(p + i) < sm))\n      tm = *(p + i);\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == max) {\n      printf(\"%d %d\\n\", stu[i].count, max);\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == sm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, sm);\n      j++;\n    }\n  }\n  for (i = 0; j < 3, i < n; i++) {\n    if (*(p + i) == tm && j < 3) {\n      printf(\"%d %d\\n\", stu[i].count, tm);\n      j++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26497", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int sum;\n  struct student *next;\n};\nint n;\nstruct student *creat() {\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d\", &n);\n  scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n  p1->sum = p1->chinese + p1->math;\n  head = NULL;\n  for (; p1->id < n;) {\n    if (p1->id == 1)\n      head = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->id, &p1->chinese, &p1->math);\n    p1->sum = p1->chinese + p1->math;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2, *p3, *p;\n  head = creat();\n  for (p = head, p1 = head, p2 = head, p3 = head; p != NULL; p = p->next) {\n    if (p->sum > p1->sum) {\n      p3 = p2;\n      p2 = p1;\n      p1 = p;\n    } else if (p->sum > p2->sum) {\n      p3 = p2;\n      p2 = p;\n    } else if (p->sum > p3->sum) {\n      p3 = p;\n    }\n  }\n  printf(\"%d %d \", p1->id, p1->sum);\n  printf(\"%d %d \", p2->id, p2->sum);\n  printf(\"%d %d \", p3->id, p3->sum);\n}\n"}
{"label": "14", "index": "26498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int number;\n  int math;\n  int chinese;\n  int total;\n};\nint main() {\n  struct student a[100000];\n  int n, i, sf = 0, ss = 0, st = 0, f, s, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].number, &a[i].math, &a[i].chinese);\n    a[i].total = a[i].math + a[i].chinese;\n    if (a[i].total > sf) {\n      t = s;\n      st = ss;\n      s = f;\n      ss = sf;\n      f = i;\n      sf = a[i].total;\n    } else if (a[i].total > ss) {\n      t = s;\n      st = ss;\n      s = i;\n      ss = a[i].total;\n    } else if (a[i].total > st) {\n      t = i;\n      st = a[i].total;\n    }\n  }\n  printf(\"%d %d\\n\", f + 1, sf);\n  printf(\"%d %d\\n\", s + 1, ss);\n  printf(\"%d %d\\n\", t + 1, st);\n  return 0;\n}\n"}
{"label": "14", "index": "26499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct data {\n  int num[100000], a[100000], b[100000], sum[100000];\n} data;\n\nint main(int argc, char *argv[]) {\n  int i, n, x = 0, y = 0, z = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &data.num[i], &data.a[i], &data.b[i]);\n    data.sum[i] = data.a[i] + data.b[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (data.sum[i] > data.sum[x]) {\n      z = y;\n      y = x;\n      x = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[x] && data.sum[i] > data.sum[y]) {\n      z = y;\n      y = i;\n      continue;\n    }\n    if (data.sum[i] <= data.sum[y] && data.sum[i] > data.sum[z])\n      z = i;\n  }\n  printf(\"%d %d\\n\", data.num[x], data.sum[x]);\n  printf(\"%d %d\\n\", data.num[y], data.sum[y]);\n  printf(\"%d %d\", data.num[z], data.sum[z]);\n}\n"}
{"label": "14", "index": "26500", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n  while (p1->num < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "26501", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n} stu[100000], max_1, secondmax_1, thirdmax_1;\nint main() {\n  max_1.sum = secondmax_1.sum = thirdmax_1.sum = 0;\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    stu[i].sum = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum > max_1.sum)\n      max_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < max_1.sum && stu[i].sum > secondmax_1.sum)\n      secondmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == max_1.sum && stu[i].num != max_1.num) {\n      secondmax_1 = stu[i];\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum < secondmax_1.sum && stu[i].sum > thirdmax_1.sum)\n      thirdmax_1 = stu[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].sum == secondmax_1.sum && stu[i].num != max_1.num &&\n        stu[i].num != secondmax_1.num) {\n      thirdmax_1 = stu[i];\n      break;\n    }\n  }\n  printf(\"%d %d %d %d %d %d\", max_1.num, max_1.sum, secondmax_1.num,\n         secondmax_1.sum, thirdmax_1.num, thirdmax_1.sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int ID, Ch, Ma;\n  } temp;\n  int fID = 0, fG = 0, sID = 0, sG = 0, tID = 0, tG = 0;\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    scanf(\"%d%d%d\", &temp.ID, &temp.Ch, &temp.Ma);\n    sum = temp.Ch + temp.Ma;\n    if (sum == fG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum > fG) {\n      tG = sG;\n      tID = sID;\n      sG = fG;\n      sID = fID;\n      fG = sum;\n      fID = temp.ID;\n    }\n    if (sum < fG && sum > sG) {\n      tG = sG;\n      tID = sID;\n      sG = sum;\n      sID = temp.ID;\n    }\n    if (sum < sG && sum > tG) {\n      tG = sum;\n      tID = temp.ID;\n    }\n  }\n  printf(\"%d %d\\n\", fID, fG);\n  cout << sID << \" \" << sG << \"\\n\";\n  printf(\"%d %d\\n\", tID, tG);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26503", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum[100000], a, b, c;\n  struct xues {\n    int a, b, c;\n  } s[100000];\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> s[i].a >> s[i].b >> s[i].c;\n    sum[i] = s[i].b + s[i].c;\n  }\n  int fir = 0, sec = 0, thi = 0;\n  for (i = 0; i < n; i++) {\n    if (fir < sum[i]) {\n      thi = sec;\n      sec = fir;\n      fir = sum[i];\n      c = b;\n      b = a;\n      a = s[i].a;\n    } else {\n      if (sec < sum[i]) {\n        thi = sec;\n        sec = sum[i];\n        fir = fir;\n        a = a;\n        c = b;\n        b = s[i].a;\n      } else if (thi < sum[i]) {\n        fir = fir;\n        sec = sec;\n        thi = sum[i];\n        a = a;\n        b = b;\n        c = s[i].a;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a, fir, b, sec, c, thi);\n  return 0;\n}\n"}
{"label": "14", "index": "26504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, max;\n  struct stu {\n    int xh;\n    int yw;\n    int sx;\n    int zf;\n    struct stu *next;\n  };\n  struct stu *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  p2 = head = p1 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n  p1->zf = p1->yw + p1->sx;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d %d %d\", &p1->xh, &p1->yw, &p1->sx);\n    p1->zf = p1->yw + p1->sx;\n    p2->next = p1;\n    p2 = p1;\n  }\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    max = 0;\n    for (i = 0; i < n; i++) {\n      max = max > p1->zf ? max : p1->zf;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; i < n; i++) {\n      if (max == p1->zf) {\n        printf(\"%d %d\\n\", p1->xh, p1->zf);\n        p1->zf = 0;\n        break;\n      }\n      p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "26505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int y;\n  int s;\n  int t;\n  struct stu *next;\n};\nint main() {\n  struct stu *head, *p1, *p2;\n  int n, i;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n  head = p1;\n  for (i = 1; i < n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld %d %d\", &p1->num, &p1->y, &p1->s);\n    p1->t = p1->y + p1->s;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  int k = 0;\n  while (k < 3) {\n    p2 = head;\n    for (; p2 != 0; p2 = p2->next) {\n      for (p1 = p2->next; p1 != 0;) {\n        if (p2->t < p1->t)\n          break;\n        else\n          p1 = p1->next;\n      }\n      if (p1 == 0) {\n        cout << p2->num << \" \" << p2->t << \" \";\n        break;\n      }\n    }\n    k = k + 1;\n    p2->t = 0;\n  }\n}\n"}
{"label": "14", "index": "26506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].shu + stu[i].yu;\n  }\n  int k, e;\n  for (k = 0; k < 3; k++) {\n    for (i = n - 2; i >= k; i--) {\n      if (stu[i].sum < stu[i + 1].sum) {\n        e = stu[i].sum;\n        stu[i].sum = stu[i + 1].sum;\n        stu[i + 1].sum = e;\n        e = stu[i].num;\n        stu[i].num = stu[i + 1].num;\n        stu[i + 1].num = e;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m;\n  int a, b, c;\n  int j, k, v;\n  int sum[100000];\n  int max1 = 0, max2 = 0, max3 = 0;\n  int A[100000][1];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> m >> A[i][0] >> A[i][1];\n    sum[i] = A[i][0] + A[i][1];\n  }\n  for (j = 1; j <= n; j++) {\n    if (sum[j] > max1) {\n      max1 = sum[j];\n      a = j;\n    }\n  }\n  for (k = 1; k <= n; k++) {\n\n    if (sum[k] > max2 && k != a) {\n      max2 = sum[k];\n      b = k;\n    }\n  }\n  for (v = 1; v <= n; v++) {\n    if (sum[v] < max2) {\n      if (sum[v] > max3) {\n        max3 = sum[v];\n        c = v;\n      }\n    }\n  }\n  cout << a << \" \" << max1 << \"\\n\";\n  printf(\"%d %d\\n\", b, max2);\n  printf(\"%d %d\", c, max3);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, sum[100000] = {0}, h1 = 0, h2 = 0, h3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].id, &student[i].chinese, &student[i].math);\n  }\n  int first = 0;\n  int sec = 0;\n  int thi = 0;\n  for (j = 0; j < n; j++) {\n    if (first < student[j].chinese + student[j].math) {\n      thi = sec;\n      h3 = h2;\n      sec = first;\n      h2 = h1;\n      first = student[j].chinese + student[j].math;\n      h1 = student[j].id;\n    } else if ((first > student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec > student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    } else if ((first == student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else {\n      if ((sec == student[j].chinese + student[j].math) &&\n          (thi < student[j].chinese + student[j].math)) {\n        thi = student[j].chinese + student[j].math;\n        h3 = student[j].id;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, sec, h3, thi);\n}\n"}
{"label": "14", "index": "26509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chinese;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, sum[100000] = {0}, h1 = 0, h2 = 0, h3 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].id, &student[i].chinese, &student[i].math);\n  }\n  int first = 0;\n  int sec = 0;\n  int thi = 0;\n  for (j = 0; j < n; j++) {\n    if (first < student[j].chinese + student[j].math) {\n      thi = sec;\n      h3 = h2;\n      sec = first;\n      h2 = h1;\n      first = student[j].chinese + student[j].math;\n      h1 = student[j].id;\n    } else if ((first > student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec > student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    } else if ((first == student[j].chinese + student[j].math) &&\n               (sec < student[j].chinese + student[j].math)) {\n      thi = sec;\n      h3 = h2;\n      sec = student[j].chinese + student[j].math;\n      h2 = student[j].id;\n    } else if ((sec == student[j].chinese + student[j].math) &&\n               (thi < student[j].chinese + student[j].math)) {\n      thi = student[j].chinese + student[j].math;\n      h3 = student[j].id;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", h1, first, h2, sec, h3, thi);\n}\n"}
{"label": "14", "index": "26510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, s, p;\n  struct student {\n    int id;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  };\n  struct student stu[100000];\n  struct student temp;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    scanf(\"%d %d %d\", &stu[p].id, &stu[p].yuwen, &stu[p].shuxue);\n    stu[p].zongfen = stu[p].yuwen + stu[p].shuxue;\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = 0; i < n - 1 - j; i++) {\n      if (stu[i].zongfen >= stu[i + 1].zongfen) {\n        temp.id = stu[i].id;\n        temp.yuwen = stu[i].yuwen;\n        temp.shuxue = stu[i].shuxue;\n        temp.zongfen = stu[i].zongfen;\n        stu[i].id = stu[i + 1].id;\n        stu[i].yuwen = stu[i + 1].yuwen;\n        stu[i].shuxue = stu[i + 1].shuxue;\n        stu[i].zongfen = stu[i + 1].zongfen;\n        stu[i + 1].id = temp.id;\n        stu[i + 1].yuwen = temp.yuwen;\n        stu[i + 1].shuxue = temp.shuxue;\n        stu[i + 1].zongfen = temp.zongfen;\n      }\n    }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    cout << stu[k].id << \" \" << stu[k].zongfen << \" \";\n  }\n}\n"}
{"label": "14", "index": "26511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct score {\n    int ID;\n    int c;\n    int m;\n  };\n  int n, k, t, r;\n  int j;\n  scanf(\"%d\", &n);\n  int sum[100000];\n  struct score s[100000];\n  for (int i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &s[i].ID, &s[i].c, &s[i].m);\n    sum[i] = s[i].c + s[i].m;\n  }\n  for (j = 1; j <= 3; j++) {\n    for (k = j; k <= n; k++) {\n      if (sum[k] > sum[j]) {\n        t = sum[j];\n        sum[j] = sum[k];\n        sum[k] = t;\n        r = s[j].ID;\n        s[j].ID = s[k].ID;\n        s[k].ID = r;\n      }\n    }\n  }\n  for (int u = 1; u <= 3; u++) {\n    printf(\"%d %d\\n\", s[u].ID, sum[u]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26512", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000], l;\n  long n, i, j, k, tmp;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    l = t[k];\n    t[k] = t[i];\n    t[i] = l;\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%ld %ld\\n\", t[i].num, t[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26513", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  int total;\n} a[100000];\nstruct str {\n  int num;\n  int total;\n} b[100000];\n\nint main() {\n  int i, n, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d \", &a[i].num, &a[i].ch, &a[i].math);\n    b[i].num = a[i].num;\n    b[i].total = a[i].ch + a[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++)\n      if (b[i].total < b[j].total) {\n        b[n] = b[i];\n        b[i] = b[j];\n        b[j] = b[n];\n      }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d \", b[i].num, b[i].total);\n}\n"}
{"label": "14", "index": "26514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct stu {\n  long num;\n  int score1;\n  int score2;\n  struct stu *next;\n};\nstruct stu *creat(void) {\n  int n, i = 1;\n  struct stu *head;\n  struct stu *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct stu *)malloc(1000);\n  head = NULL;\n  while (i <= n) {\n    scanf(\"%ld %d %d\", &p1->num, &p1->score1, &p1->score2);\n    if (i == 1)\n      head = p1;\n    else\n      p2 = p1;\n    if (i != n)\n      p1 = p2->next = (struct stu *)malloc(1000);\n    else\n      p1->next = NULL;\n    i++;\n  }\n  return (head);\n}\nvoid turn(struct stu *head) {\n  int t = 1, r = 1, a;\n  struct stu *q1, *q2, *p3, *p1, *p2;\n  for (q1 = p3 = p2 = head; q1->next != NULL, t <= 3; t++) {\n    a = 0;\n    for (q2 = p1 = q1->next, r = 1; q2 != NULL; q2 = q2->next, r++) {\n\n      if ((q1->score1 + q1->score2) < (q2->score1 + q2->score2)) {\n        q1 = q2;\n        p2 = p1;\n        a = 1;\n      }\n      if (r != 1)\n        p1 = p1->next;\n    }\n    printf(\"%ld %d \", q1->num, q1->score1 + q1->score2);\n    if (a == 1) {\n      p2->next = q1->next;\n      q1 = head;\n    } else {\n      q1 = p3->next;\n      p3 = q1;\n    }\n  }\n}\nint main() {\n  struct stu *ip;\n  ip = creat();\n  turn(ip);\n}\n"}
{"label": "14", "index": "26515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, num[100000], j, grade1[100000], grade2[100000], grade[100000], t1,\n      t2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> num[i] >> grade1[i] >> grade2[i];\n    grade[i] = grade1[i] + grade2[i];\n  }\n  for (j = 1; j < 4; j++) {\n    for (i = 0; i < n - j; i++) {\n      if (grade[i] >= grade[i + 1]) {\n        t1 = grade[i];\n        grade[i] = grade[i + 1];\n        grade[i + 1] = t1;\n        t2 = num[i];\n        num[i] = num[i + 1];\n        num[i + 1] = t2;\n      }\n    }\n  }\n  cout << num[n - 1] << \" \" << grade[n - 1] << \"\\n\"\n       << num[n - 2] << \" \" << grade[n - 2] << \"\\n\"\n       << num[n - 3] << \" \" << grade[n - 3];\n}\n"}
{"label": "14", "index": "26516", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num;\n  int yuwen;\n  int shuxue;\n  int sum;\n} score[100000];\nint main() {\n  int n, i, a, b, c, a1, b1, c1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> score[i].num >> score[i].yuwen >> score[i].shuxue;\n    score[i].sum = score[i].shuxue + score[i].yuwen;\n  }\n  a = 0;\n  b = 0;\n  c = 0;\n  a1 = 0;\n  b1 = 0;\n  c1 = 0;\n  for (i = 0; i < n; i++) {\n    if (score[i].sum > a) {\n      c = b;\n      b = a;\n      a = score[i].sum;\n      c1 = b1;\n      b1 = a1;\n      a1 = score[i].num;\n    } else if (score[i].sum > b) {\n      c = b;\n      b = score[i].sum;\n      c1 = b1;\n      b1 = score[i].num;\n    } else if (score[i].sum > c) {\n      c = score[i].sum;\n      c1 = score[i].num;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\", a1, a, b1, b, c1, c);\n  return 0;\n}\n"}
{"label": "14", "index": "26517", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int NO;\n  int chinese;\n  int math;\n};\n\nint main() {\n  struct student a[100001];\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    cin >> a[i].NO >> a[i].chinese >> a[i].math;\n  for (i = 1; i <= 3; i++)\n    for (j = n - 1; j >= i; j--)\n      if (a[j].chinese + a[j].math < a[j + 1].chinese + a[j + 1].math) {\n        a[0] = a[j];\n        a[j] = a[j + 1];\n        a[j + 1] = a[0];\n      }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].NO << ' ' << a[i].chinese + a[i].math << endl;\n}\n"}
{"label": "14", "index": "26518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a = 0, b = 0, c = 0;\n  int an, bn, cn;\n  int n, i, sum = 0;\n  struct student {\n    int num, ch, math;\n  } students[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &students[i].num, &students[i].ch, &students[i].math);\n    sum = students[i].ch + students[i].math;\n    if (sum > c) {\n      c = sum;\n      cn = i;\n    }\n    if (sum > b) {\n      c = b;\n      cn = bn;\n      b = sum;\n      bn = i;\n    }\n    if (sum > a) {\n      b = a;\n      bn = an;\n      a = sum;\n      an = i;\n    }\n  }\n  cout << students[an].num << \" \" << a << \"\\n\";\n  printf(\"%d %d\\n\", students[bn].num, b);\n  printf(\"%d %d\\n\", students[cn].num, c);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yu;\n  int shu;\n  struct student *next;\n};\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  head = p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  for (i = 1; i < n; i++) {\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yu >> p1->shu;\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  for (i = 1; i <= 3; i++) {\n    p1 = p2 = head;\n    while (p1 != NULL) {\n      if (p1->yu + p1->shu > p2->yu + p2->shu)\n        p2 = p1;\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << p2->yu + p2->shu << \" \";\n    p2->yu = 0;\n    p2->shu = 0;\n  }\n}\n"}
{"label": "14", "index": "26520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\nint main() {\n  int i, j, n, a[100000], max;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    a[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++)\n      max = (max >= a[i]) ? max : a[i];\n    for (i = 0; i < n; i++)\n      if (a[i] == max) {\n        printf(\"%d %d\\n\", stu[i].num, a[i]);\n        a[i] = 0;\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct data {\n    int number;\n    int chinese;\n    int math;\n    int total;\n  } student[100000], temp;\n  long n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].number, &student[i].chinese,\n          &student[i].math);\n    student[i].total = student[i].chinese + student[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i + 1; j < n; j++)\n      if (student[i].total < student[j].total) {\n        temp.number = student[i].number;\n        temp.chinese = student[i].chinese;\n        temp.math = student[i].math;\n        temp.total = student[i].total;\n\n        student[i].number = student[j].number;\n        student[i].chinese = student[j].chinese;\n        student[i].math = student[j].math;\n        student[i].total = student[j].total;\n\n        student[j].number = temp.number;\n        student[j].chinese = temp.chinese;\n        student[j].math = temp.math;\n        student[j].total = temp.total;\n      }\n  for (i = 0; i < 3; i++)\n    cout << student[i].number << \" \" << student[i].total << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  char xuehao[100];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n  int n, i, j, l, m;\n  struct student stu[100000];\n  struct student temp;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].xuehao);\n    scanf(\"%d %d\", &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].sum >= stu[m + 1].sum) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n\n  for (l = n - 1; l > n - 4; l--)\n    cout << stu[l].xuehao << \" \" << stu[l].sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "14", "index": "26523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int Chinese;\n  int math;\n  int sum;\n};\n\nint main() {\n  int i, n, p, q, r, b = 0, c = 0, d = 0;\n  struct student a[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[i].num, &a[i].Chinese, &a[i].math);\n    a[i].sum = a[i].Chinese + a[i].math;\n    if (i == 0)\n      p = q = r = a[i].sum;\n    else {\n      if (a[i].sum > p) {\n        r = q;\n        q = p;\n        p = a[i].sum;\n        d = c;\n        c = b;\n        b = i;\n      } else if (a[i].sum > q) {\n        r = q;\n        q = a[i].sum;\n        d = c;\n        c = i;\n      } else if (a[i].sum > r) {\n        r = a[i].sum;\n        d = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", a[b].num, a[b].sum, a[c].num, a[c].sum,\n         a[d].num, a[d].sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26524", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, first, second, third, x, y, z;\n  scanf(\"%d \", &n);\n  struct mark {\n    int ID, chinese, math, sum;\n  } * num;\n  num = (struct mark *)malloc(sizeof(mark) * n);\n  int n1, c1, m1;\n  for (i = 0; i < n; i++) {\n    cin >> n1 >> c1 >> m1;\n    num[i].ID = n1;\n    num[i].chinese = c1;\n    num[i].math = m1;\n    num[i].sum = c1 + m1;\n  }\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      first = num[i].sum;\n      second = num[i].sum;\n      third = num[i].sum;\n      x = num[i].ID;\n      y = num[i].ID;\n      z = num[i].ID;\n    } else if (i == 1) {\n      if (num[i].sum > first) {\n        first = num[i].sum;\n        x = num[i].ID;\n      } else {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n\n    } else {\n      if (num[i].sum > first) {\n        third = second;\n        z = y;\n        second = first;\n        y = x;\n        first = num[i].sum;\n        x = num[i].ID;\n      } else if (num[i].sum > second) {\n        third = second;\n        z = y;\n        second = num[i].sum;\n        y = num[i].ID;\n      } else if (num[i].sum > third) {\n        third = num[i].sum;\n        z = num[i].ID;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", x, first, y, second, z, third);\n  return 0;\n}\n"}
{"label": "14", "index": "26525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yw;\n  int sx;\n  int zf;\n} s1, s2, s3, s;\nint main() {\n\n  int n, i;\n  s1.zf = s2.zf = s3.zf = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.yw, &s.sx);\n    s.zf = s.yw + s.sx;\n    if (s.zf > s1.zf) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.zf > s2.zf) {\n      s3 = s2;\n      s2 = s;\n    } else if (s.zf > s3.zf) {\n      s3 = s;\n    }\n  }\n\n  printf(\"%d %d\\n\", s1.num, s1.zf);\n  printf(\"%d %d\\n\", s2.num, s2.zf);\n  printf(\"%d %d\", s3.num, s3.zf);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  float chinese;\n  float math;\n  float sum;\n};\nint main() {\n  int n, i;\n  struct student *pt, *p, temp;\n  cin >> n;\n  pt = (struct student *)malloc(n * 1000);\n  for (p = pt; p < pt + n; p++) {\n    scanf(\"%d%f%f\", &p->num, &p->chinese, &p->math);\n    p->sum = p->chinese + p->math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (p = pt; p < pt + n - 1 - i; p++) {\n      if (p->sum >= (p + 1)->sum) {\n        temp = *p;\n        *p = *(p + 1);\n        *(p + 1) = temp;\n      }\n    }\n  }\n  for (p = pt + n - 1; p > pt + n - 4; p--) {\n    cout << p->num << \" \" << p->sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int id;\n  int math;\n  int chinese;\n  int zongfen;\n};\nint main() {\n  int n, i = 1, j;\n  int a[100001];\n  struct student stu[100001];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &stu[i].id, &stu[i].math, &stu[i].chinese);\n    stu[i].zongfen = stu[i].math + stu[i].chinese;\n    if (i < 4)\n      j = i;\n    else\n      j = 4;\n    {\n      for (; j > 1 && stu[i].zongfen > stu[a[j - 1]].zongfen; j--)\n        a[j] = a[j - 1];\n    }\n    a[j] = i;\n  }\n  for (i = 1; i <= 3; i++)\n    cout << stu[a[i]].id << \" \" << stu[a[i]].zongfen << \" \";\n  getchar();\n  getchar();\n  scanf(\"%d\", &n);\n  return 0;\n}\n"}
{"label": "14", "index": "26528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  char num[30];\n  float chi;\n  float mat;\n  float tot;\n  struct student *next;\n};\n\nstruct student *creat(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stud;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->tot >= p1->tot) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nstruct student *compare(struct student *head, struct student *stud) {\n  struct student *p0, *p1, *p2;\n  int i;\n  p1 = head;\n  p0 = stud;\n  while ((p0->tot <= p1->tot) && (p1->next != NULL)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if ((p0->tot > p1->tot) || ((p0->tot = p1->tot) && (p1->next != NULL))) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n    p1 = head;\n    for (i = 0; i < 2; i++) {\n      p1 = p1->next;\n    }\n    p1->next = NULL;\n  }\n\n  return (head);\n}\n\nvoid print(struct student *head) {\n  struct student *p;\n  int i;\n  p = head;\n  for (i = 0; i < 3; i++) {\n    cout << p->num << \" \" << p->tot << \" \";\n    p = p->next;\n  }\n}\n\nint main() {\n  struct student *head;\n  struct student *stu;\n  int n, i;\n  head = NULL;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    stu = (struct student *)malloc(1000);\n    cin >> stu->num >> stu->chi >> stu->mat;\n    stu->tot = stu->chi + stu->mat;\n    head = creat(head, stu);\n  }\n  for (i = 3; i < n; i++) {\n    stu = (struct student *)malloc(1000);\n    scanf(\"%s %f %f\", &stu->num, &stu->chi, &stu->mat);\n    stu->tot = stu->chi + stu->mat;\n    head = compare(head, stu);\n  }\n  print(head);\n  return 0;\n}\n"}
{"label": "14", "index": "26529", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int no;\n  int yuwen;\n  int shuxue;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student *p, *stu, temp;\n  scanf(\"%d \", &n);\n  stu = (struct student *)calloc(n, sizeof(struct student));\n  for (p = stu; p - stu < n; p++) {\n    scanf(\"%d%d%d\", &p->no, &p->yuwen, &p->shuxue);\n    p->total = p->yuwen + p->shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (p = stu + n - 1; p > stu + i; p--) {\n      if (p->total > (p - 1)->total) {\n        temp = *p;\n        *p = *(p - 1);\n        *(p - 1) = temp;\n      }\n    }\n    printf(\"%d %d\\n\", p->no, p->total);\n  }\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26530", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int No;\n  int chinese;\n  int math;\n  int all;\n} stu[1000], temp;\n\nint main() {\n  int n;\n  cin >> n;\n  int i, k;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].No >> stu[i].chinese >> stu[i].math;\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (k = 1; k < 4; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (stu[i].all >= stu[i + 1].all) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d \", stu[i].No, stu[i].all);\n}\n"}
{"label": "14", "index": "26531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n  int i, j, n;\n  struct point {\n    int m, x, y;\n  } a[100000], aa;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].m >> a[i].x >> a[i].y;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((a[i].x + a[i].y) < (a[j].x + a[j].y)) {\n        aa = a[j];\n        a[j] = a[i];\n        a[i] = aa;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << a[i].m << \" \" << (a[i].x + a[i].y) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26532", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct s {\n  int a;\n  int sc[2];\n};\nint main() {\n  struct s st[100000];\n  int t = 0, j = 0, max = 0, p[3] = {-1, -1};\n  long n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].sc[0], &st[i].sc[1]);\n    st[i].sc[0] = st[i].sc[0] + st[i].sc[1];\n  }\n  i = 0;\n  while (t < 3) {\n    if (i < n && i != p[0] && i != p[1]) {\n      j = (st[i].sc[0] > max) ? i : j;\n      max = (st[i].sc[0] > max) ? st[i].sc[0] : max;\n      i++;\n    } else if (i < n && (i == p[0] || i == p[1]))\n      i++;\n    else if (i = n) {\n      printf(\"%d %d\\n\", j + 1, max);\n      p[t] = j;\n      t++;\n      j = 0;\n      max = 0;\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26533", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int i, num;\n  struct student stu[100000];\n  int max_0 = 0, max_1 = 0, max_2 = 0;\n  int max_0_id, max_1_id, max_2_id;\n\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; ++i) {\n    scanf(\"%d %d %d\", &(stu[i].id), &(stu[i].chinese), &(stu[i].math));\n    stu[i].total = stu[i].chinese + stu[i].math;\n    if (stu[i].total > max_0) {\n      \n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = max_0;\n      max_1_id = max_0_id;\n      max_0 = stu[i].total;\n      max_0_id = stu[i].id;\n    } else if (stu[i].total > max_1) {\n      \n      max_2 = max_1;\n      max_2_id = max_1_id;\n      max_1 = stu[i].total;\n      max_1_id = stu[i].id;\n    } else if (stu[i].total > max_2) {\n      max_2 = stu[i].total;\n      max_2_id = stu[i].id;\n    }\n  }\n\n  printf(\"%d %d\\n\", max_0_id, max_0);\n  printf(\"%d %d\\n\", max_1_id, max_1);\n  printf(\"%d %d\\n\", max_2_id, max_2);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct a {\n  char No[20];\n  int y;\n  int s;\n  struct a *next;\n};\nint n;\nstruct a *creat(void) {\n  struct a *p1, *p2, *head;\n  int i;\n  scanf(\"%d \", &n);\n  p1 = p2 = (struct a *)malloc(1000);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    cin >> p1->No >> p1->y >> p1->s;\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct a *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nint main() {\n  struct a *head, *p1, *p2, *p;\n  int i, j, k, m1, m2;\n  char r[10];\n  head = creat();\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d \", r, j);\n  for (p1 = head; p1 != NULL;) {\n    p2 = p1;\n    p1 = p1->next;\n    if (p1 == p) {\n      p2->next = p1->next;\n      break;\n    } else if (p2 == p) {\n      head = p1->next;\n      break;\n    }\n  }\n  for (p1 = head, j = 0; p1 != NULL; p1 = p1->next) {\n    k = p1->y + p1->s;\n    if (k > j) {\n      p = p1;\n      j = k;\n      m1 = p1->y;\n      m2 = p1->s;\n      strcpy(r, p1->No);\n    }\n  }\n  printf(\"%s %d\", r, j);\n}\n"}
{"label": "14", "index": "26535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct {\n    int number;\n    float score1;\n    float score2;\n    float score3;\n\n  } stu[100000], temp;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    cin >> stu[i].number >> stu[i].score1 >> stu[i].score2;\n    stu[i].score3 = stu[i].score2 + stu[i].score1;\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = n - 1; j >= n - i; j--)\n      if (stu[j - 1].score3 < stu[j].score3) {\n        temp = stu[j];\n        stu[j] = stu[j - 1];\n        stu[j - 1] = temp;\n      }\n  cout << stu[0].number << \" \" << stu[0].score3 << endl;\n  cout << stu[1].number << \" \" << stu[1].score3 << endl;\n  cout << stu[2].number << \" \" << stu[2].score3;\n  return 0;\n}\n"}
{"label": "14", "index": "26536", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  struct s {\n    int id;\n    int ch;\n    int ma;\n  } s;\n  long int n;\n  int i = 0, j, zong, c = 0;\n  int a[3] = {0}, b[3] = {0};\n  int t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    a[i] = i + 1;\n    b[i] = s.ma + s.ch;\n  }\n  for (i = 0; i < 2; i++) {\n    if (b[i] > b[1 + i]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    zong = s.ch + s.ma;\n    for (j = 0; j < 3; j++) {\n      if (zong > b[j])\n        c++;\n    }\n    if (c == 1) {\n      a[0] = s.id;\n      b[0] = zong;\n    }\n    if (c == 2) {\n      a[0] = a[1];\n      b[0] = b[1];\n      a[1] = s.id;\n      b[1] = zong;\n    }\n    if (c == 3) {\n      a[0] = a[1];\n      a[1] = a[2];\n      a[2] = s.id;\n      b[0] = b[1];\n      b[1] = b[2];\n      b[2] = zong;\n    }\n    c = 0;\n  }\n  for (i = 2; i >= 0; i--) {\n    printf(\"%d %d\\n\", a[i], b[i]);\n  }\n}\n"}
{"label": "14", "index": "26537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int ID;\n  int chi;\n  int math;\n} student[100000];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  int a[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &student[i].ID, &student[i].chi, &student[i].math);\n    a[i] = student[i].chi + student[i].math;\n  }\n\n  for (k = 0; k < 3; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          break;\n      }\n      if (j == n && a[i] >= a[j - 1]) {\n        cout << student[i].ID << \" \" << a[i] << \"\\n\";\n        a[i] = 0;\n        break;\n      }\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26538", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int score;\n  struct student *next;\n};\nint n, i = 0, a;\nstruct student *m1, *m2, *m3, *q;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  p1->score = p1->yuwen + p1->shuxue;\n  head = NULL;\n  while (i < n - 1) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->score = p1->yuwen + p1->shuxue;\n    if (i >= 3) {\n      if (p2->score > m1->score) {\n        m3 = m2;\n        m2 = m1;\n        m1 = p2;\n      } else if (p2->score <= m1->score && p2->score > m2->score) {\n        m3 = m2;\n        m2 = p2;\n      } else if (p2->score <= m2->score && p2->score > m3->score)\n        m3 = p2;\n      i++;\n      continue;\n    }\n    if (i == 0)\n      m1 = p2;\n    else if (i == 1)\n      m2 = p2;\n    else if (i == 2) {\n      m3 = p2;\n      if (m1->score > m2->score) {\n        if (m2->score <= m3->score) {\n          if (m1->score > m3->score) {\n            q = m3;\n            m3 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = m3;\n            m3 = q;\n          }\n        }\n      } else if (m1->score <= m2->score) {\n        if (m2->score > m3->score) {\n          if (m1->score > m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m3;\n            m3 = m1;\n            m1 = m2;\n            m2 = q;\n          }\n        } else if (m2->score <= m3->score) {\n          q = m1;\n          m1 = m3;\n          m3 = q;\n        }\n      }\n    }\n    i++;\n  }\n  return (head);\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  printf(\"%d %d \", m1->num, m1->score);\n  printf(\"%d %d \", m2->num, m2->score);\n  printf(\"%d %d \", m3->num, m3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "26539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stud {\n  int num;\n  int score, score1, score2;\n  struct stud *next;\n} head, end_1;\nvoid create(int n) {\n  int i;\n  struct stud *p1, *p2;\n  head.next = NULL;\n  for (i = 0; i <= n - 1; i++) {\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    if (!i)\n      head.next = p1;\n    else\n      p2->next = p1;\n    scanf(\"%d\", &p1->num);\n    scanf(\"%d\", &p1->score1);\n    scanf(\"%d\", &p1->score2);\n    p1->score = p1->score1 + p1->score2;\n    p2 = p1;\n  }\n  p2->next = &end_1;\n}\nvoid find() {\n  struct stud *max1, *max2, *max3, *p1, *swap;\n  max1 = head.next;\n  max2 = max1->next;\n  max3 = max2->next;\n  p1 = max3->next;\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  if (max2->score < max3->score) {\n    swap = max2;\n    max2 = max3;\n    max3 = swap;\n  }\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  while (p1 != &end_1) {\n    if (p1->score > max3->score)\n      max3 = p1;\n    if (max3->score > max2->score) {\n      swap = max3;\n      max3 = max2;\n      max2 = swap;\n    }\n    if (max2->score > max1->score) {\n      swap = max1;\n      max1 = max2;\n      max2 = swap;\n    }\n    p1 = p1->next;\n  }\n  cout << max1->num << \" \" << max1->score << \" \";\n  printf(\"%d %d \", max2->num, max2->score);\n  printf(\"%d %d \", max3->num, max3->score);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  create(n);\n  find();\n}\n"}
{"label": "14", "index": "26540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int score1;\n  int score2;\n} stu[100000];\n\nint main() {\n  int n, i, sum[100000], max = 0, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].score1, &stu[i].score2);\n    sum[i] = stu[i].score1 + stu[i].score2;\n  }\n  for (i = 0; i < n; i++)\n    if (sum[i] > max) {\n      max = sum[i];\n      j = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j) {\n      max = sum[i];\n      k = i;\n    }\n  max = 0;\n  for (i = 0; i < n; i++)\n    if (sum[i] > max && i != j && i != k) {\n      max = sum[i];\n      l = i;\n    }\n  cout << stu[j].num << \" \" << sum[j] << \"\\n\"\n       << stu[k].num << \" \" << sum[k] << \"\\n\"\n       << stu[l].num << \" \" << sum[l] << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  int chin;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i, j, tem, temp;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].id, &stu[i].chin, &stu[i].math);\n    stu[i].sum = stu[i].chin + stu[i].math;\n  }\n  int max[3] = {0};\n  for (i = 1; i < n; i++) {\n    if (stu[i].sum > stu[max[0]].sum) {\n      tem = max[0];\n      temp = max[1];\n      max[0] = i;\n      max[1] = tem;\n      max[2] = temp;\n    } else {\n      if (stu[i].sum > stu[max[1]].sum) {\n        tem = max[1];\n        max[1] = i;\n        max[2] = tem;\n      } else {\n        if (stu[i].sum > stu[max[2]].sum)\n          max[2] = i;\n      }\n    }\n  }\n\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[max[i]].id, stu[max[i]].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i;\n  long n;\n  int sum[100000];\n  int max = 0, second = 0, third = 0;\n  int a = 0, b = 0, c = 0;\n  scanf(\"%ld \", &n);\n  struct student {\n    int id;\n    int chi;\n    int math;\n  };\n  struct student wangchong[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &wangchong[i].id, &wangchong[i].chi, &wangchong[i].math);\n    sum[i] = wangchong[i].chi + wangchong[i].math;\n    if (sum[i] > third) {\n      if (sum[i] <= second) {\n        third = sum[i];\n        c = i + 1;\n      } else {\n        if (sum[i] <= max) {\n          third = second;\n          second = sum[i];\n          c = b;\n          b = i + 1;\n        } else {\n          third = second;\n          c = b;\n          second = max;\n          b = a;\n          max = sum[i];\n          a = i + 1;\n        }\n      }\n    }\n  }\n  cout << a << \" \" << max << \"\\n\"\n       << b << \" \" << second << \"\\n\"\n       << c << \" \" << third << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct stu {\n  int ID;\n  int yuwen;\n  int shuxue;\n  int sum;\n  struct stu *next;\n};\n\nstruct stu *creat(long n) {\n  long i;\n  struct stu *p, *q, *head;\n  p = (struct stu *)malloc(1000);\n  head = q = p;\n  scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n      p->sum = p->shuxue + p->yuwen;\n  for (i = 1; i < n; i++) {\n    p = (struct stu *)malloc(1000);\n    scanf(\"%d %d %d\", &p->ID, &p->yuwen, &p->shuxue),\n        p->sum = p->shuxue + p->yuwen;\n    q->next = p, q = p;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  long n;\n  scanf(\"%ld\", &n);\n  struct stu *h, *p, *q1, *q2, *q3;\n  h = creat(n);\n  int m1, m2, m3;\n  for (p = h, m1 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m1)\n      m1 = p->sum, q1 = p;\n  cout << q1->ID << \" \" << q1->sum;\n  for (p = h, m2 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m2 && p != q1)\n      m2 = p->sum, q2 = p;\n  printf(\" %d %d\", q2->ID, q2->sum);\n  for (p = h, m3 = p->sum; p != NULL; p = p->next)\n    if (p->sum > m3 && p != q1 && p != q2)\n      m3 = p->sum, q3 = p;\n  printf(\" %d %d\", q3->ID, q3->sum);\n  return 0;\n}\n"}
{"label": "14", "index": "26544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int fir = 0, sec = 0, thi = 0;\n  int fir_n = 0, sec_n = 0, thi_n = 0;\n  struct {\n    int num;\n    int ma;\n    int cn;\n    int score;\n  } s;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.num, &s.ma, &s.cn);\n    s.score = s.ma + s.cn;\n\n    if (s.score > fir) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = fir;\n      sec_n = fir_n;\n      fir = s.score;\n      fir_n = s.num;\n    }\n\n    else if (s.score > sec) {\n      thi = sec;\n      thi_n = sec_n;\n      sec = s.score;\n      sec_n = s.num;\n    } else if (s.score > thi) {\n      thi = s.score;\n      thi_n = s.num;\n    }\n  }\n\n  printf(\"%d %d\\n\", fir_n, fir);\n  cout << sec_n << \" \" << sec << \"\\n\";\n  printf(\"%d %d\\n\", thi_n, thi);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  int total;\n  struct student *next;\n};\nstruct student *creat(int n) {\n  struct student *p1, *p2, *head;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  head = NULL;\n  i = 0;\n  while (i < n) {\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    i = i + 1;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid sum(struct student *head) {\n  struct student *p1;\n  p1 = head;\n  while (p1) {\n    p1->total = p1->chi + p1->math;\n    p1 = p1->next;\n  }\n}\nstruct student *choose(struct student *head) {\n  struct student *p1, *p2;\n  p1 = head;\n  p2 = p1;\n  while (p1->next) {\n    if (p2->total < (p1->next)->total)\n      p2 = p1->next;\n    p1 = p1->next;\n  }\n  cout << p2->num << \" \" << p2->total << \" \";\n  return (p2);\n}\nstruct student *del(struct student *head, struct student *p2) {\n  struct student *p1;\n  p1 = head;\n  if (p2 == head) {\n    head = p2->next;\n    return (head);\n  } else {\n    while (p1->next != p2) {\n      p1 = p1->next;\n    }\n    p1->next = p2->next;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p;\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 3) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n  } else if (n = 2) {\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n    head = del(head, p);\n    p = choose(head);\n\n  } else {\n\n    head = creat(n);\n    sum(head);\n    p = choose(head);\n  }\n}\n"}
{"label": "14", "index": "26546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num;\n  int all;\n} person[99999];\nint main() {\n  int n, i, j, k, x, y;\n  ;\n  struct student temp1, temp2;\n  scanf(\"%d\", &n);\n  for (i = 2; i >= 0; i--) {\n    scanf(\"%d %d %d\", &person[i].num, &x, &y);\n    person[i].all = x + y;\n  }\n  for (i = 3; i <= n - 1; i++) {\n    cin >> person[i].num >> x >> y;\n    person[i].all = x + y;\n    k = person[i].all;\n    if (k > person[0].all) {\n      temp1 = person[0];\n      temp2 = person[1];\n      person[0] = person[i];\n      person[1] = temp1;\n      person[2] = temp2;\n      continue;\n    }\n    if (k <= person[0].all && k > person[1].all) {\n      temp1 = person[1];\n      person[1] = person[i];\n      person[2] = temp1;\n      continue;\n    }\n    if (k <= person[1].all && k > person[2].all) {\n      person[2] = person[i];\n      continue;\n    }\n    if (k < person[2].all) {\n      continue;\n    }\n  }\n  printf(\"%d %d\\n\", person[0].num, person[0].all);\n  printf(\"%d %d\\n\", person[1].num, person[1].all);\n  printf(\"%d %d\", person[2].num, person[2].all);\n  return 0;\n}\n"}
{"label": "14", "index": "26547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int id;\n  char yw;\n  char sx;\n  int zf;\n  int pm;\n};\nint main() {\n  struct student a[100000], b[2];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d%d%d\", &a[i].id, &a[i].yw, &a[i].sx);\n  for (i = 0; i < n; i++)\n    a[i].zf = a[i].yw + a[i].sx;\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j) {\n      j = a[i].zf;\n      b[0] = a[i];\n    }\n  printf(\"%d %d\\n\", b[0].id, b[0].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id) {\n      j = a[i].zf;\n      b[1] = a[i];\n    }\n  printf(\"%d %d\\n\", b[1].id, b[1].zf);\n  j = 0;\n  for (i = 0; i < n; i++)\n    if (a[i].zf > j && a[i].id != b[0].id && a[i].id != b[1].id) {\n      j = a[i].zf;\n      b[2] = a[i];\n    }\n  printf(\"%d %d\\n\", b[2].id, b[2].zf);\n}\n"}
{"label": "14", "index": "26548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum[1000000];\nstruct student {\n  int id;\n  int Gra[2];\n} stu[1000000];\nint main() {\n  int n;\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].Gra[0] >> stu[i].Gra[1];\n    sum[i] = stu[i].Gra[0] + stu[i].Gra[1];\n  }\n  int max = 0, imax = 0;\n  for (int i = 0; i < 3; i++) {\n    max = 0;\n    for (int j = 0; j < n; j++)\n      if (max < sum[j]) {\n        max = sum[j];\n        imax = j;\n      }\n\n    printf(\"%d %d\\n\", stu[imax].id, sum[imax]);\n    sum[imax] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26549", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int a;\n  int b;\n  int c;\n  struct student *next;\n};\nint main() {\n  int n = 0, i, j, k;\n  scanf(\"%d\", &k);\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  head = NULL;\n  for (i = 0; i < k - 1; i++) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = p1;\n  p2 = p1;\n  p2->next = NULL;\n  struct student *g;\n  int x[100000], y[100000];\n  g = head;\n  for (i = 0; i < k; i++) {\n    x[i] = g->a;\n    y[i] = g->b + g->c;\n    g = g->next;\n  }\n  int m[4] = {0}, t, r = 1, z = 0;\n  m[0] = 201;\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < k; j++) {\n      if (m[r] < y[j] && y[j] < m[r - 1])\n        m[r] = y[j];\n    }\n    r++;\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[1]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[2]) {\n      printf(\"%d %d \", x[i], y[i]);\n      z++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (z == 3)\n      break;\n    if (y[i] == m[3]) {\n      printf(\"%d %d\", x[i], y[i]);\n      z++;\n    }\n  }\n}\n"}
{"label": "14", "index": "26550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int num, z;\n} a, max1, max2, max3;\n\nint main() {\n  int i, n, x, y;\n  scanf(\"%d\", &n);\n  max1.z = -1;\n  max2.z = -1;\n  max3.z = -1;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a.num, &x, &y);\n    a.z = x + y;\n    if (a.z > max1.z) {\n      max3 = max2;\n      max2 = max1;\n      max1 = a;\n    } else if (a.z > max2.z) {\n      max3 = max2;\n      max2 = a;\n    } else if (a.z > max3.z) {\n      max3 = a;\n      max3 = a;\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", max1.num, max1.z, max2.num, max2.z, max3.num,\n         max3.z);\n}\n"}
{"label": "14", "index": "26551", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int num;\n  int sum;\n} stu[100000];\n\nint main() {\n\n  int n, i, j, t, a, b;\n  int tempSum;\n  int tempMax;\n  int rank[3] = {0};\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    tempSum = 0;\n    scanf(\"%d\", &stu[i].num);\n    stu[i].sum = 0;\n    for (j = 0; j < 2; j++) {\n      scanf(\"%d\", &tempSum);\n      stu[i].sum += tempSum;\n    }\n  }\n  for (b = 0; b < 3; b++) {\n    tempMax = 0;\n    for (a = b; a < n; a++) {\n      if (stu[a].sum > tempMax) {\n        tempMax = stu[a].sum;\n        rank[b] = a;\n      }\n    }\n    t = stu[b].num;\n    stu[b].num = stu[rank[b]].num;\n    stu[rank[b]].num = t;\n    t = stu[b].sum;\n    stu[b].sum = stu[rank[b]].sum;\n    stu[rank[b]].sum = t;\n  }\n  for (a = 0; a < 3; a++)\n    printf(\"%d %d\\n\", stu[a].num, stu[a].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, ta, tb, ts, tnum;\n  int *a, *b, *s, *num;\n  scanf(\"%d\", &n);\n  a = (int *)malloc(sizeof(int) * n);\n  b = (int *)malloc(sizeof(int) * n);\n  s = (int *)malloc(sizeof(int) * n);\n  num = (int *)malloc(sizeof(int) * n);\n\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &num[i], &a[i], &b[i]);\n    s[i] = a[i] + b[i];\n  }\n  for (j = 0; j < 3; j++) {\n    for (i = n; i > 1; i--) {\n      if (s[i] > s[i - 1]) {\n        ta = a[i - 1];\n        tb = b[i - 1];\n        ts = s[i - 1];\n        tnum = num[i - 1];\n        a[i - 1] = a[i];\n        b[i - 1] = b[i];\n        s[i - 1] = s[i];\n        num[i - 1] = num[i];\n        a[i] = ta;\n        b[i] = tb;\n        s[i] = ts;\n        num[i] = tnum;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", num[1], s[1], num[2], s[2], num[3], s[3]);\n  return 0;\n}\n"}
{"label": "14", "index": "26553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n  struct student *before;\n};\nint main() {\n  int i, n, n1 = 0, n2 = 0, n3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  struct student *head;\n  struct student *p1, *p2;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score1);\n  p1->sum = p1->score1 + p1->score2;\n  m1 = p1->sum;\n  n1 = p1->num;\n  head = 0;\n  i = 0;\n  while (i <= n - 2) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else {\n      p1->before = p2;\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = p1->score1 + p1->score2;\n    if (p1->sum > m3 && p1->sum <= m2) {\n      m3 = p1->sum;\n      n3 = p1->num;\n    }\n    if (p1->sum > m2 && p1->sum <= m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = p1->sum;\n      n2 = p1->num;\n    }\n    if (p1->sum > m1) {\n      m3 = m2;\n      n3 = n2;\n      m2 = m1;\n      n2 = n1;\n      m1 = p1->sum;\n      n1 = p1->num;\n    }\n  }\n  printf(\"%d %d \", n1, m1);\n  printf(\"%d %d \", n2, m2);\n  printf(\"%d %d \", n3, m3);\n}\n"}
{"label": "14", "index": "26554", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int no;\n  int yuwen;\n  int shuxue;\n  int total;\n};\nint main() {\n  int n, i;\n  struct student *p, *stu, temp;\n  cin >> n;\n  stu = (struct student *)calloc(n, sizeof(struct student));\n  for (p = stu; p - stu < n; p++) {\n    scanf(\"%d%d%d\", &p->no, &p->yuwen, &p->shuxue);\n    p->total = p->yuwen + p->shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (p = stu + n - 1; p > stu + i; p--) {\n      if (p->total > (p - 1)->total) {\n        temp = *p;\n        *p = *(p - 1);\n        *(p - 1) = temp;\n      }\n    }\n    printf(\"%d %d\\n\", p->no, p->total);\n  }\n  free(stu);\n}\n"}
{"label": "14", "index": "26555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int math;\n    int chinese;\n    int sum;\n  } a[100000];\n  int n, i, j, temp;\n  char c[10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].math >> a[i].chinese;\n    a[i].sum = a[i].math + a[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (a[i].sum < a[j].sum) {\n        temp = a[i].sum, a[i].sum = a[j].sum, a[j].sum = temp;\n        temp = a[i].num, a[i].num = a[j].num, a[j].num = temp;\n      }\n    }\n    printf(\"%d %d\\n\", a[i].num, a[i].sum);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int yw;\n    int sx;\n    int all;\n  } student[4] = {0, 0, 0, 0};\n  struct student temp = {0, 0, 0, 0};\n  int i, l, n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[3].num, &student[3].yw, &student[3].sx);\n    student[3].all = student[3].yw + student[3].sx;\n\n    if (student[2].all < student[3].all) {\n      temp = student[2];\n      student[2] = student[3];\n      student[3] = temp;\n    }\n    if (student[1].all < student[2].all) {\n      temp = student[1];\n      student[1] = student[2];\n      student[2] = temp;\n    }\n    if (student[0].all < student[1].all) {\n      temp = student[0];\n      student[0] = student[1];\n      student[1] = temp;\n    }\n  }\n  for (l = 0; l < 3; l++) {\n    printf(\"%d %d\\n\", student[l].num, student[l].all);\n  }\n}\n"}
{"label": "14", "index": "26557", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int together;\n} stu[100000], t;\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].together = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++)\n    for (j = i; j < n; j++) {\n      if (stu[i].together < stu[j].together) {\n        t = stu[i];\n        stu[i] = stu[j];\n        stu[j] = t;\n      }\n    }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].id, stu[i].together);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  int num;\n  int yu;\n  int shu;\n  int tol;\n  struct stu *next;\n};\nint n;\n\nstruct stu *creat(void) {\n  struct stu *p1, *p2, *head, *p;\n  int i, k;\n  p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n  p1->tol = p1->yu + p1->shu;\n  p1->next = 0;\n  head = p1;\n  p = p1;\n  p1 = (struct stu *)malloc(sizeof(struct stu));\n  for (i = 1; i < n; i++) {\n    p = head;\n    p2 = p1;\n    k = 0;\n    scanf(\"%d %d %d\", &p1->num, &p1->yu, &p1->shu);\n    p1->tol = p1->yu + p1->shu;\n    while (p != 0 && p->tol >= p1->tol) {\n      p2 = p;\n      p = p->next;\n      k++;\n    }\n    if (k <= 3) {\n      if (p == head) {\n        head = p1;\n        p1->next = p;\n      }\n      if (p == 0) {\n        p2->next = p1;\n        p1->next = 0;\n      }\n      if (p != head && p != 0) {\n        p2->next = p1;\n        p1->next = p;\n      }\n    }\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n  }\n  return head;\n}\nint main() {\n  struct stu *head, *p;\n  int i = 0;\n  scanf(\"%d\", &n);\n  head = creat();\n  p = head;\n  while (i < 3) {\n    printf(\"%d %d\\n\", p->num, p->tol);\n    i++;\n    p = p->next;\n  }\n}\n"}
{"label": "14", "index": "26559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  int nn;\n  int nnn;\n  int nmn;\n  int sum;\n} st[100002], tmp;\nint main() {\n  int i, j, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &st[i].nn, &st[i].nnn, &st[i].nmn);\n    st[i].sum = st[i].nnn + st[i].nmn;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[i].sum < st[j].sum) {\n        tmp = st[i];\n        st[i] = st[j];\n        st[j] = tmp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++) {\n    cout << st[i].nn << \" \" << st[i].sum;\n    if (i < 3)\n      cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26560", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  long n;\n  long num[99999], math[99999], china[99999], z[99999], i;\n  long num1 = 2, num2 = 1, num3 = 0, m1 = 0, m2 = 0, m3 = 0;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%ld\", &num[i]);\n    scanf(\"%ld\", &math[i]);\n    scanf(\"%ld\", &china[i]);\n    z[i] = math[i] + china[i];\n    if (z[i] > num3) {\n      num1 = num2;\n      m1 = m2;\n      num2 = num3;\n      m2 = m3;\n      num3 = z[i];\n      m3 = i;\n\n    } else if (z[i] > num2) {\n      num1 = num2;\n      m1 = m2;\n      num2 = z[i];\n      m2 = i;\n    } else if (z[i] > num1) {\n      num1 = z[i];\n      m1 = i;\n    }\n  }\n  printf(\"%ld %ld\\n\", m3, num3);\n  printf(\"%ld %ld\\n\", m2, num2);\n  printf(\"%ld %ld\\n\", m1, num1);\n  return 0;\n}\n"}
{"label": "14", "index": "26561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct s {\n    int id;\n    int ch;\n    int ma;\n  } s;\n  long int n;\n  int i = 0, j, zong, c = 0;\n  int a[3] = {0}, b[3] = {0};\n  int t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 3; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    a[i] = i + 1;\n    b[i] = s.ma + s.ch;\n  }\n  for (i = 0; i < 2; i++) {\n    if (b[i] > b[1 + i]) {\n      t = b[i];\n      b[i] = b[i + 1];\n      b[i + 1] = t;\n      t = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    scanf(\"%d %d %d\", &s.id, &s.ch, &s.ma);\n    zong = s.ch + s.ma;\n    for (j = 0; j < 3; j++) {\n      if (zong > b[j]) {\n        c++;\n      }\n    }\n    if (c == 1) {\n      a[0] = s.id;\n      b[0] = zong;\n    }\n    if (c == 2) {\n      a[0] = a[1];\n      b[0] = b[1];\n      a[1] = s.id;\n      b[1] = zong;\n    }\n    if (c == 3) {\n      a[0] = a[1];\n      a[1] = a[2];\n      a[2] = s.id;\n      b[0] = b[1];\n      b[1] = b[2];\n      b[2] = zong;\n    }\n    c = 0;\n  }\n  for (i = 2; i >= 0; i--) {\n    cout << a[i] << \" \" << b[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct score {\n  long num;\n  int yu;\n  int shu;\n  int sum;\n} stu[100000];\nint main() {\n  long i, n, j, k;\n  int t;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld%d%d\", &stu[i].num, &stu[i].yu, &stu[i].shu);\n    stu[i].sum = stu[i].yu + stu[i].shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - i - 1; j++)\n      if (stu[j].sum > stu[j + 1].sum) {\n        t = stu[j].sum;\n        stu[j].sum = stu[j + 1].sum;\n        stu[j + 1].sum = t;\n      }\n  }\n  for (k = n - 1; k > n - 4; k--) {\n    if (k != n - 1 && stu[k].sum == stu[k + 1].sum)\n      continue;\n    for (i = 0; i < n; i++) {\n      if (stu[k].sum == (stu[i].yu + stu[i].shu)) {\n        printf(\"%ld %ld\\n\", stu[i].num, stu[k].sum);\n        if (k == n - 3) {\n          break;\n        }\n      }\n    }\n  }\n}\n"}
{"label": "14", "index": "26563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x, y;\n  struct student {\n    int score, num;\n  } a[100000];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a[i].num >> x >> y;\n    a[i].score = x + y;\n  }\n  a[0] = a[1];\n  for (i = 1; i <= 3; i++)\n    for (j = i + 1; j <= n; j++)\n      if (a[i].score < a[j].score) {\n        a[0] = a[i];\n        a[i] = a[j];\n        a[j] = a[0];\n      }\n  cout << a[1].num << \" \" << a[1].score << endl\n       << a[2].num << \" \" << a[2].score << endl\n       << a[3].num << \" \" << a[3].score;\n  return 0;\n}\n"}
{"label": "14", "index": "26564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i;\n  int sum[100000];\n  int max1, max2, max3;\n  int x = 0;\n  cin >> n;\n  struct {\n    int number;\n    int chin;\n    int math;\n  } student[100000];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &student[i].number, &student[i].chin, &student[i].math);\n    sum[i] = student[i].chin + student[i].math;\n  }\n  max1 = sum[0];\n  max2 = sum[0];\n  max3 = sum[0];\n  for (i = 0; i < n; i++) {\n    if (sum[i] > max1)\n      max1 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (sum[i] == max1) {\n      cout << student[i].number << \" \" << sum[i] << \"\\n\";\n      x++;\n    }\n    if (x >= 3)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max2) && (sum[i] != max1))\n      max2 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max2) {\n      printf(\"%d %d\\n\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if ((sum[i] > max3) && (sum[i] != max1) && (sum[i] != max2))\n      max3 = sum[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (x >= 3)\n      break;\n    if (sum[i] == max3) {\n      printf(\"%d %d\", student[i].number, sum[i]);\n      x++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int ID;\n  int ch;\n  int ma;\n  int sum;\n  struct stu *next;\n};\nint main() {\n  struct stu *head;\n  struct stu *p1, *p2, *a, *b, *c, *t;\n  int n, i = 0;\n  a = b = c = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n  scanf(\"%d\", &n);\n  cin >> p1->ID >> p1->ch >> p1->ma;\n  p1->sum = p1->ch + p1->ma;\n  head = NULL;\n  while (i < n - 1) {\n    i++;\n    p1->sum = p1->ch + p1->ma;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    if (p1->sum > a->sum) {\n      c = b;\n      b = a;\n      a = p2;\n    } else if (p1->sum > b->sum) {\n      c = b;\n      b = p2;\n    } else if (p1->sum > c->sum)\n      c = p2;\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n    scanf(\"%d%d%d\", &p1->ID, &p1->ch, &p1->ma);\n  }\n  p2->next = NULL;\n  cout << a->ID << \" \" << a->sum << \"\\n\"\n       << b->ID << \" \" << b->sum << \"\\n\"\n       << c->ID << \" \" << c->sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26566", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, max = 0, smax = 0, tmax = 0, id[3] = {0}, a, b, c;\n  struct student {\n    int No;\n    int yuwen;\n    int math;\n  } stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    cin >> stu[i].yuwen;\n    scanf(\"%d\", &stu[i].math);\n  }\n  for (i = 0; i < n; i++) {\n\n    if (max < stu[i].yuwen + stu[i].math) {\n      max = stu[i].yuwen + stu[i].math;\n      id[0] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (smax < stu[i].yuwen + stu[i].math && i != id[0] - 1) {\n      smax = stu[i].yuwen + stu[i].math;\n      id[1] = stu[i].No;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (tmax < stu[i].yuwen + stu[i].math && i != id[0] - 1 && i != id[1] - 1) {\n      tmax = stu[i].yuwen + stu[i].math;\n      id[2] = stu[i].No;\n    }\n  }\n  a = id[0];\n  b = id[1];\n  c = id[2];\n  printf(\"%d %d\\n\", a, max);\n  printf(\"%d %d\\n\", b, smax);\n  printf(\"%d %d\\n\", c, tmax);\n  return 0;\n}\n"}
{"label": "14", "index": "26567", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  struct student {\n    int i;\n    int x;\n    int y;\n    int m;\n    struct student *next;\n  };\n  int n, j, k;\n  struct student *head, *p1, *p2, *p0;\n  scanf(\"%d\", &n);\n  p1 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->i, &p1->x, &p1->y);\n  p1->m = p1->x + p1->y;\n  p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p2->i, &p2->x, &p2->y);\n  p2->m = p2->x + p2->y;\n  if (p1->m > p2->m) {\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  } else {\n    p0 = p1;\n    p1 = p2;\n    p2 = p0;\n    head = p1;\n    p1->next = p2;\n    p2->next = 0;\n  }\n  p0 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p0->i, &p0->x, &p0->y);\n  p0->m = p0->x + p0->y;\n  while ((p0->m <= p1->m) && (p1->next != 0)) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (p0->m > p1->m) {\n    if (head == p1)\n      head = p0;\n    else\n      p2->next = p0;\n    p0->next = p1;\n  } else {\n    p1->next = p0;\n    p0->next = 0;\n  }\n  for (j = 3; j < n; j++) {\n    p0 = (struct student *)malloc(1000);\n    cin >> p0->i >> p0->x >> p0->y;\n    p0->m = p0->x + p0->y;\n    for (k = 0, p1 = head; k <= 2; k++) {\n      if (p0->m > p1->m)\n        break;\n      p1 = p1->next;\n    }\n    if (k == 3)\n      continue;\n    p1 = p2 = head;\n    while (p0->m <= p1->m) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (p0->m > p1->m) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = 0;\n    }\n  }\n  for (p1 = head, j = 0; j < 3; j++) {\n    printf(\"%d %d \", p1->i, p1->m);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "26568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct Student {\n  int num;\n  int yuwen;\n  int shuxue;\n};\nvoid fun(int *a, int *b);\nint main() {\n  int n, i, j;\n  int sum[100000];\n  scanf(\"%d\", &n);\n  struct Student stu[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num >> stu[i].yuwen >> stu[i].shuxue;\n    sum[i] = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = n - 1; j > i; j--) {\n      if (sum[j] > sum[j - 1]) {\n        fun(&sum[j], &sum[j - 1]);\n        fun(&stu[j - 1].num, &stu[j].num);\n        fun(&stu[j - 1].yuwen, &stu[j].yuwen);\n        fun(&stu[j - 1].shuxue, &stu[j].shuxue);\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    cout << stu[i].num << \" \" << sum[i] << \"\\n\";\n  }\n  return 0;\n}\nvoid fun(int *a, int *b) {\n  int k;\n  k = *a;\n  *a = *b;\n  *b = k;\n}\n"}
{"label": "14", "index": "26569", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, q, w;\n  cin >> n;\n  int a[n], b[n], c[n], d[n];\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &a[i], &b[i], &c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    d[i] = b[i] + c[i];\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (d[i] < d[j]) {\n        q = d[i];\n        d[i] = d[j];\n        d[j] = q;\n        w = a[i];\n        a[i] = a[j];\n        a[j] = w;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", a[i], d[i]);\n  }\n\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct student {\n    int num;\n    int chinese;\n    int math;\n    int sum;\n  } stu[100001], t;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].chinese, &stu[i].math);\n    stu[i].sum = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (stu[j].sum >= stu[j + 1].sum) {\n        t = stu[j];\n        stu[j] = stu[j + 1];\n        stu[j + 1] = t;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--) {\n    cout << stu[i].num << \" \" << stu[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  struct student *next;\n};\nint m;\nstruct student *creat(int n) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  p1 = p2 = (struct student *)malloc(sizeof(struct student));\n  scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  head = NULL;\n  while (n--) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d%d%d\", &p1->num, &p1->chinese, &p1->math);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    m = m - 1;\n  }\n  return (head);\n}\nint main() {\n  int max = 0;\n  int n, j;\n  scanf(\"%d\", &n);\n  struct student *head, *p1, *p2;\n  head = creat(n);\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->chinese + p1->math) > max)\n        max = p1->chinese + p1->math, p2 = p1;\n      p1 = p1->next;\n    }\n    printf(\"%d %d\\n\", p2->num, (p2->chinese + p2->math));\n    head = del(head, p2->num);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int No;\n    int chinese;\n    int math;\n    int total;\n  } stu[100000];\n  int i, j, x, y, z, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].chinese);\n    scanf(\"%d\", &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    x = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > x) {\n        x = stu[i].total;\n        y = stu[i].No;\n        z = i;\n      }\n    }\n    printf(\"%d %d\\n\", y, x);\n    stu[z].total = 0;\n  }\n}\n"}
{"label": "14", "index": "26573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stud {\n  int num;\n  int score, score1, score2;\n  struct stud *next;\n} head, end_1;\nvoid create(int n) {\n  int i;\n  struct stud *p1, *p2;\n  head.next = NULL;\n  for (i = 0; i <= n - 1; i++) {\n    p1 = (struct stud *)malloc(sizeof(struct stud));\n    if (!i)\n      head.next = p1;\n    else\n      p2->next = p1;\n    scanf(\"%d\", &p1->num);\n    scanf(\"%d\", &p1->score1);\n    scanf(\"%d\", &p1->score2);\n    p1->score = p1->score1 + p1->score2;\n    p2 = p1;\n  }\n  p2->next = &end_1;\n}\nvoid find() {\n  struct stud *max1, *max2, *max3, *p1, *swap;\n  max1 = head.next;\n  max2 = max1->next;\n  max3 = max2->next;\n  p1 = max3->next;\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  if (max2->score < max3->score) {\n    swap = max2;\n    max2 = max3;\n    max3 = swap;\n  }\n  if (max1->score < max2->score) {\n    swap = max1;\n    max1 = max2;\n    max2 = swap;\n  }\n  while (p1 != &end_1) {\n    if (p1->score > max3->score)\n      max3 = p1;\n    if (max3->score > max2->score) {\n      swap = max3;\n      max3 = max2;\n      max2 = swap;\n    }\n    if (max2->score > max1->score) {\n      swap = max1;\n      max1 = max2;\n      max2 = swap;\n    }\n    p1 = p1->next;\n  }\n  cout << max1->num << \" \" << max1->score << \" \";\n  printf(\"%d %d \", max2->num, max2->score);\n  printf(\"%d %d \", max3->num, max3->score);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  create(n);\n  find();\n  return 0;\n}\n"}
{"label": "14", "index": "26574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int id;\n  int chinese;\n  int math;\n  int total;\n};\n\nint main() {\n  int number;\n  struct student stu[100000];\n  scanf(\"%d\\n\", &number);\n  for (int i = 1; i <= number; ++i) {\n    cin >> stu[i].id >> stu[i].chinese >> stu[i].math;\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (int i = 1; i <= 3; ++i) {\n    for (int j = i + 1; j <= number; ++j) {\n      if (stu[i].total < stu[j].total) {\n        struct student temp;\n        temp = stu[i];\n        stu[i] = stu[j];\n        stu[j] = temp;\n      }\n    }\n    cout << stu[i].id << \" \" << stu[i].total << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26575", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  struct student {\n    int No;\n    int chinese;\n    int math;\n    int total;\n  } stu[100000];\n  int i, j, x, y, z, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &stu[i].No);\n    scanf(\"%d\", &stu[i].chinese);\n    scanf(\"%d\", &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (j = 0; j < 3; j++) {\n    x = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > x) {\n        x = stu[i].total;\n        y = stu[i].No;\n        z = i;\n      }\n    }\n    printf(\"%d %d\\n\", y, x);\n    stu[z].total = 0;\n  }\n}\n"}
{"label": "14", "index": "26576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long int n, a[100000][2];\n  int i, j, t, s;\n  struct Student {\n    int num;\n    int yu;\n    int shu;\n  };\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    struct Student studenti;\n    scanf(\"%d%d%d\", &studenti.num, &studenti.yu, &studenti.shu);\n    a[i][0] = studenti.num;\n    a[i][1] = studenti.yu + studenti.shu;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = 0; j < n - 1 - i; j++) {\n      if (a[j][1] >= a[j + 1][1]) {\n        t = a[j][1];\n        a[j][1] = a[j + 1][1];\n        a[j + 1][1] = t;\n        s = a[j][0];\n        a[j][0] = a[j + 1][0];\n        a[j + 1][0] = s;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%ld %ld\\n\", a[n - i][0], a[n - i][1]);\n  return 0;\n}\n"}
{"label": "14", "index": "26577", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nlong int n;\nstruct stu {\n  long int num, chi, mat, tot;\n};\nint comp(const void *a, const void *b) {\n  return ((struct stu *)b)->tot - ((struct stu *)a)->tot;\n}\nstruct stu a[100000], b;\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a[i].num >> a[i].chi >> a[i].mat;\n    a[i].tot = a[i].chi + a[i].mat;\n  }\n  qsort(a, n, sizeof(struct stu), comp);\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", a[i].num, a[i].tot);\n  return 0;\n}\n"}
{"label": "14", "index": "26578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int num, yu, shu, sum;\n};\nint main() {\n  int n, i;\n  struct stu a[4];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &a[0].num, &a[0].yu, &a[0].shu);\n    a[0].sum = a[0].yu + a[0].shu;\n    if (a[0].sum > a[1].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[1].sum;\n      a[2].num = a[1].num;\n      a[1].sum = a[0].sum;\n      a[1].num = a[0].num;\n    } else if (a[0].sum > a[2].sum) {\n      a[3].sum = a[2].sum;\n      a[3].num = a[2].num;\n      a[2].sum = a[0].sum;\n      a[2].num = a[0].num;\n    } else if (a[0].sum > a[3].sum) {\n      a[3].sum = a[0].sum;\n      a[3].num = a[0].num;\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    cout << a[i].num << \" \" << a[i].sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  float one = 0, two = 0, three = 0, yi = 0, er = 0, san = 0;\n  float a[100000][2];\n  scanf(\"%d \", &n);\n  struct Student {\n    float xuehao;\n    float yuwen;\n    float shuxue;\n  } student;\n  for (i = 0; i < n; i++) {\n    scanf(\"%f %f %f\", &student.xuehao, &student.yuwen, &student.shuxue);\n    for (j = 0; j < 2; j++) {\n      a[i][1] = student.yuwen + student.shuxue;\n      a[i][0] = i + 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > one) {\n      one = a[i][1];\n      yi = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > two && a[i][1] <= one && a[i][0] != yi) {\n      two = a[i][1];\n      er = a[i][0];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i][1] > three && a[i][1] <= one && a[i][1] <= two && a[i][0] != yi &&\n        a[i][0] != er) {\n      three = a[i][1];\n      san = a[i][0];\n    }\n  }\n  printf(\"%.0f %.0f\\n\", yi, one);\n  printf(\"%.0f %.0f\\n\", er, two);\n  cout << fixed << setprecision(0) << san << \" \" << three << \"\\n\";\n  return 0;\n}\n"}
{"label": "14", "index": "26580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num[3], sum[3];\n  int i, j, k, t, n, m;\n  num[0] = num[1] = num[2] = sum[0] = sum[1] = sum[2] = -10000000;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%d%d%d\", &i, &j, &k);\n    j += k;\n    if (sum[2] < j) {\n      sum[2] = j;\n      num[2] = i;\n      if (sum[2] > sum[1]) {\n        t = sum[2];\n        sum[2] = sum[1];\n        sum[1] = t;\n        t = num[2];\n        num[2] = num[1];\n        num[1] = t;\n        if (sum[1] > sum[0]) {\n          t = sum[0];\n          sum[0] = sum[1];\n          sum[1] = t;\n          t = num[0];\n          num[0] = num[1];\n          num[1] = t;\n        }\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", num[i], sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  int name;\n  int ch;\n  int math;\n} stu[100000];\n\nint main() {\n  int n;\n  int sum[100000];\n  int max[3];\n  int i, j, k, m, o;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].name, &stu[i].ch, &stu[i].math);\n  for (i = 0; i < n; i++) {\n    sum[i] = stu[i].ch + stu[i].math;\n  }\n\n  max[0] = 0;\n  for (j = 0, k = 0; j < n; j++) {\n    if (sum[j] > max[0]) {\n      max[0] = sum[j];\n      k = j;\n    }\n  }\n\n  max[1] = 0;\n  for (j = 1, m = 0; j < n; j++) {\n    if ((sum[j] > max[1]) && (j != k)) {\n      max[1] = sum[j];\n      m = j;\n    }\n  }\n\n  max[2] = 0;\n  for (j = 1, o = 0; j < n; j++) {\n    if ((sum[j] > max[2]) && (j != k) && (j != m)) {\n      max[2] = sum[j];\n      o = j;\n    }\n  }\n\n  printf(\"%d %d \", stu[k].name, sum[k]);\n  printf(\"%d %d \", stu[m].name, sum[m]);\n  printf(\"%d %d \", stu[o].name, sum[o]);\n}\n"}
{"label": "14", "index": "26582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i;\n  cin >> n;\n  struct student {\n    int stuNo;\n    int yuwen;\n    int shuxue;\n    int zongfen;\n  } stu[n];\n  struct tri {\n    int stuNo;\n    int zongfen;\n  } qian[3] = {0, 0, 0, 0, 0, 0};\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].stuNo;\n    cin >> stu[i].yuwen;\n    cin >> stu[i].shuxue;\n    stu[i].zongfen = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < n; i++) {\n    if (stu[i].zongfen > qian[0].zongfen) {\n      qian[2] = qian[1];\n      qian[1] = qian[0];\n      qian[0].stuNo = stu[i].stuNo;\n      qian[0].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[1].zongfen) {\n      qian[2] = qian[1];\n      qian[1].stuNo = stu[i].stuNo;\n      qian[1].zongfen = stu[i].zongfen;\n      continue;\n    }\n    if (stu[i].zongfen > qian[2].zongfen) {\n      qian[2].stuNo = stu[i].stuNo;\n      qian[2].zongfen = stu[i].zongfen;\n    }\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", qian[i].stuNo, qian[i].zongfen);\n  return 0;\n}\n"}
{"label": "14", "index": "26583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct stu {\n  int a;\n  int b;\n  int c;\n  struct stu *next;\n};\nint main() {\n  int n, i, j, max;\n  struct stu *head, *p1, *p2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    if (i == 0) {\n      head = p1 = p2 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n      head = p1;\n      p2 = p1;\n    } else {\n      p1 = (struct stu *)malloc(sizeof(struct stu));\n      scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n      p2->next = p1;\n      p2 = p1;\n    }\n  }\n  p2->next = NULL;\n\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c > max)\n        max = p1->b + p1->c;\n      p1 = p1->next;\n    }\n    p1 = head;\n    for (i = 0; p1->next != NULL; i++) {\n      if (p1->b + p1->c == max) {\n        cout << p1->a << \" \" << max << \"\\n\";\n        p1->b = 0;\n        p1->c = 0;\n        p1 = p1->next;\n        break;\n      } else\n        p1 = p1->next;\n    }\n  }\n}\n"}
{"label": "14", "index": "26584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, t = 0, c = 1, d = 1, n, p = 0, q = 0, r = 0, *b;\n  struct pp {\n    int x;\n    int y;\n    int z;\n  } * s;\n  scanf(\"%d\", &n);\n  b = (int *)malloc(sizeof(int) * n);\n  s = (struct pp *)malloc(sizeof(int) * 3 * n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].x, &s[i].y, &s[i].z);\n    b[i] = ((s[i].y) + (s[i].z));\n  }\n  for (i = 0; i < n; i++) {\n    if (b[i] > t) {\n      t = b[i];\n      p = i;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > c) && (i != p)) {\n        c = b[i];\n        q = i;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    {\n      if ((b[i] > d) && (i != p) && (i != q)) {\n        d = b[i];\n        r = i;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", s[p].x, b[p]);\n  printf(\"%d %d\\n\", s[q].x, b[q]);\n  printf(\"%d %d\\n\", s[r].x, b[r]);\n  return 0;\n}\n"}
{"label": "14", "index": "26585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long int ID;\n  int math;\n  int chinese;\n  int add;\n} stu[100000];\nint main() {\n  long int n;\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].ID, &stu[i].math, &stu[i].chinese);\n    stu[i].add = stu[i].math + stu[i].chinese;\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if (stu[i].add < stu[j].add) {\n        int t = stu[i].add;\n        stu[i].add = stu[j].add;\n        stu[j].add = t;\n        long int m = stu[i].ID;\n        stu[i].ID = stu[j].ID;\n        stu[j].ID = m;\n      }\n    }\n    cout << stu[i].ID << \" \" << stu[i].add << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "14", "index": "26586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chinese;\n  int math;\n  int total;\n} s[1000];\n\nint main() {\n  int n, i, j, tn, tt;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s[i].num, &s[i].chinese, &s[i].math);\n    s[i].total = s[i].math + s[i].chinese;\n  }\n  for (i = 1; i < 4; i++) {\n    for (j = 0; j < n - i; j++) {\n      if (s[j].total >= s[j + 1].total) {\n        tt = s[j].total;\n        tn = s[j].num;\n        s[j].total = s[j + 1].total;\n        s[j].num = s[j + 1].num;\n        s[j + 1].total = tt;\n        s[j + 1].num = tn;\n      }\n    }\n  }\n  printf(\"%d %d %d %d %d %d \", s[n - 1].num, s[n - 1].total, s[n - 2].num,\n         s[n - 2].total, s[n - 3].num, s[n - 3].total);\n  return (0);\n}\n"}
{"label": "14", "index": "26587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int No;\n  int chinese;\n  int math;\n  int all;\n} stu[1000], temp;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, k;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].No, &stu[i].chinese, &stu[i].math);\n    stu[i].all = stu[i].chinese + stu[i].math;\n  }\n  for (k = 1; k < 4; k++) {\n    for (i = 0; i < n - k; i++) {\n      if (stu[i].all >= stu[i + 1].all) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  for (i = n - 1; i > n - 4; i--)\n    printf(\"%d %d \", stu[i].No, stu[i].all);\n  return 0;\n}\n"}
{"label": "14", "index": "26588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int math;\n  int chi;\n  int num;\n  int sum;\n};\nint main() {\n  int i, j, k, n, t, m;\n  struct student stu[100000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].math, &stu[i].chi);\n  for (i = 0; i < n; i++)\n    stu[i].sum = stu[i].math + stu[i].chi;\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1, k = i; j < n; j++) {\n      if (stu[j].sum > stu[k].sum)\n        k = j;\n    }\n    t = stu[i].sum;\n    stu[i].sum = stu[k].sum;\n    stu[k].sum = t;\n    m = stu[i].num;\n    stu[i].num = stu[k].num;\n    stu[k].num = m;\n  }\n  for (i = 0; i < 3; i++)\n    printf(\"%d %d\\n\", stu[i].num, stu[i].sum);\n}\n"}
{"label": "14", "index": "26589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint stu[100000];\nint main(int argc, char *argv[]) {\n  int n, i, j, y, t, m;\n  struct s {\n    int a;\n    int b;\n    int c;\n  } stu[100000];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].a, &stu[i].b, &stu[i].c);\n  }\n  for (i = 0; i < 3; i++) {\n    for (j = i + 1; j < n; j++) {\n      if ((stu[j].b + stu[j].c) > (stu[i].b + stu[i].c)) {\n        y = stu[i].b;\n        t = stu[i].c;\n        m = stu[i].a;\n        stu[i].b = stu[j].b;\n        stu[j].b = y;\n        stu[i].c = stu[j].c;\n        stu[j].c = t;\n        stu[i].a = stu[j].a;\n        stu[j].a = m;\n      }\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", stu[i].a, (stu[i].b + stu[i].c));\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26590", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct stu {\n    long num, c, m, d;\n    struct stu *next;\n  };\n  long n, i, f;\n  struct stu *head, *p1, *p2;\n  scanf(\"%ld\", &n);\n  for (i = 1; i <= n; i++) {\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%ld%ld%ld\", &p1->num, &p1->c, &p1->m);\n    p1->d = p1->c + p1->m;\n    if (i == 1) {\n      p1->next = 0;\n      head = p1;\n    } else {\n      if (i <= 3)\n        f = 1;\n      else {\n        p2 = head->next->next;\n        if (p1->d > p2->d)\n          f = 1;\n        else\n          f = 0;\n      }\n      if (f == 1) {\n        p2 = head;\n        if (p2->d < p1->d) {\n          p1->next = p2;\n          head = p1;\n        } else {\n          while ((p2->next != 0) && (p2->next->d > p1->d))\n            p2 = p2->next;\n          p1->next = p2->next;\n          p2->next = p1;\n        }\n      }\n    }\n  }\n  p1 = head;\n  for (i = 1; i <= 3; i++) {\n    printf(\"%ld %ld \", p1->num, p1->d);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "26591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct stu {\n  int ID;\n  int Chinese;\n  int math;\n  int sum;\n} zz[100000], mx, mx1, mx2;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> zz[i].ID >> zz[i].Chinese >> zz[i].math;\n    zz[i].sum = zz[i].Chinese + zz[i].math;\n  }\n  mx = zz[0];\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx.sum)\n      mx = zz[i];\n  }\n  printf(\"%d %d\\n\", mx.ID, mx.sum);\n  mx.sum = 0;\n  mx1 = mx;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx1.sum) {\n      if (zz[i].ID == mx.ID)\n        continue;\n      mx1 = zz[i];\n    }\n  }\n  cout << mx1.ID << ' ' << mx1.sum << endl;\n  mx1.sum = 0;\n  mx2 = mx1;\n  for (i = 0; i < n; i++) {\n    if (zz[i].sum > mx2.sum) {\n      if (zz[i].ID == mx.ID || zz[i].ID == mx1.ID)\n        continue;\n      mx2 = zz[i];\n    }\n  }\n  cout << mx2.ID << ' ' << mx2.sum << endl;\n}\n"}
{"label": "14", "index": "26592", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {     \n    int StudentNumber; \n    int ChineseGrades; \n    int MathGrades;    \n    int Total;         \n  };\n  struct student Stu[100000], sTemp; \n  int n, i, j;                       \n  cin >> n;                          \n  for (i = 0; i <= n - 1; i++) {     \n    cin >> Stu[i].StudentNumber >> Stu[i].ChineseGrades >> Stu[i].MathGrades;\n    Stu[i].Total = Stu[i].ChineseGrades + Stu[i].MathGrades;\n  }\n  for (i = 0; i <= 2; i++) { \n    for (j = n - 1; j >= i + 1; j--) {\n      if (Stu[j].Total > Stu[j - 1].Total) {\n        sTemp = Stu[j];\n        Stu[j] = Stu[j - 1];\n        Stu[j - 1] = sTemp;\n      }\n    }\n  }\n  cout << Stu[0].StudentNumber << \" \" << Stu[0].Total; \n  for (i = 1; i <= 2; i++) {\n    cout << endl;\n    cout << Stu[i].StudentNumber << \" \" << Stu[i].Total;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum[100001], temp = 0;\n  cin >> n;\n  struct student {\n    int ID;\n    int chinese;\n    int math;\n  } person[100001]; \n  for (i = 1; i <= n; i++) {\n    cin >> person[i].ID >> person[i].chinese >> person[i].math;\n    sum[i] = person[i].chinese + person[i].math; \n  }\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp) {\n      temp = sum[i];\n      j = i; \n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j) \n    {\n      temp = sum[i];\n      k = i;\n    }\n  }\n  temp = 0;\n  for (i = 1; i <= n; i++) {\n    if (sum[i] > temp && i != j && i != k) \n    {\n      temp = sum[i];\n      l = i;\n    }\n  }\n  cout << person[j].ID << \" \" << sum[j] << endl;\n  cout << person[k].ID << \" \" << sum[k] << endl;\n  cout << person[l].ID << \" \" << sum[l] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int chn;\n  int math;\n  int sum;\n} stu[100000];\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].num, &stu[i].math, &stu[i].chn);\n    stu[i].sum = stu[i].math + stu[i].chn;\n  }\n  int j, sum[100000], order[4] = {n - 1}, t, m;\n  struct student temp;\n  for (j = n - 1; j >= n - 3; j--) {\n    for (i = 0; i < j; i++) {\n      if (stu[i].sum >= stu[i + 1].sum) {\n        temp = stu[i + 1];\n        stu[i + 1] = stu[i];\n        stu[i] = temp;\n      }\n    }\n  }\n  printf(\"%d %d \", stu[n - 1].num, stu[n - 1].sum);\n  printf(\"%d %d \", stu[n - 2].num, stu[n - 2].sum);\n  printf(\"%d %d \", stu[n - 3].num, stu[n - 3].sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26595", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int ID;\n  int ch;\n  int ma;\n};\n\nint main() {\n  struct student re[1000];\n  int n;\n  int i = 0, j = 0, rec;\n  int total[1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &re[i].ID, &re[i].ch, &re[i].ma);\n    total[i] = re[i].ch + re[i].ma;\n  }\n  int max = total[0];\n  for (i = 0; i < n; i++) {\n    if (max < total[i]) {\n      max = total[i];\n      rec = i;\n    }\n    if (i == n - 1) {\n      printf(\"%d %d \", re[rec].ID, total[rec]);\n      total[rec] = 0;\n      i = 0;\n      max = total[0];\n      j++;\n    }\n\n    if (j == 3) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, temp;\n  cin >> n;\n  struct stu {\n    int xuehao[100000];\n    int yuwen[100000];\n    int shuxue[100000];\n    int zongfen[100000];\n  } a;\n  for (i = 0; i < n; i++) {\n    cin >> a.xuehao[i];\n    scanf(\"%d \", &a.yuwen[i]);\n    cin >> a.shuxue[i];\n    a.zongfen[i] = a.shuxue[i] + a.yuwen[i];\n  }\n  for (i = n - 1; i >= n - 3; i--)\n    for (j = i; j >= 1; j--)\n      if (a.zongfen[j] > a.zongfen[j - 1]) {\n        temp = a.zongfen[j - 1];\n        a.zongfen[j - 1] = a.zongfen[j];\n        a.zongfen[j] = temp;\n        temp = a.xuehao[j - 1];\n        a.xuehao[j - 1] = a.xuehao[j];\n        a.xuehao[j] = temp;\n      }\n  for (i = 0; i <= 2; i++)\n    cout << a.xuehao[i] << \" \" << a.zongfen[i] << endl;\n  return 0;\n}\n"}
{"label": "14", "index": "26597", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct ss {\n    int num, yu, sh;\n    int sum;\n  };\n  int n, i;\n  struct ss *stu;\n\n  scanf(\"%d\", &n);\n  stu = (struct ss *)malloc(sizeof(ss) * n);\n  for (i = 0; i < n; i++) {\n    int num1, yu1, sh1;\n    (stu + i)->num = 0;\n    (stu + i)->yu = 0;\n    (stu + i)->sh = 0;\n    (stu + i)->sum = 0;\n    scanf(\"%d %d %d\", &num1, &yu1, &sh1);\n    (stu + i)->num = num1;\n    (stu + i)->yu = yu1;\n    (stu + i)->sh = sh1;\n    (stu + i)->sum = yu1 + sh1;\n  }\n  for (i = 1; i < n; i++) {\n    int t;\n    if ((stu + 0)->sum < (stu + i)->sum) {\n      t = (stu + 0)->sum;\n      (stu + 0)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 0)->num;\n      (stu + 0)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 2; i < n; i++) {\n    int t;\n    if ((stu + 1)->sum < (stu + i)->sum) {\n      t = (stu + 1)->sum;\n      (stu + 1)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 1)->num;\n      (stu + 1)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 3; i < n; i++) {\n    int t;\n    if ((stu + 2)->sum < (stu + i)->sum) {\n      t = (stu + 2)->sum;\n      (stu + 2)->sum = (stu + i)->sum;\n      (stu + i)->sum = t;\n      t = (stu + 2)->num;\n      (stu + 2)->num = (stu + i)->num;\n      (stu + i)->num = t;\n    }\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", (stu + i)->num, (stu + i)->sum);\n  }\n  free(stu);\n  return 0;\n}\n"}
{"label": "14", "index": "26598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    long num;\n    long chinese;\n    long maths;\n    long sum;\n  } t[100000], l;\n  long n, i, j, k, tmp;\n  scanf(\"%ld\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%ld %ld %ld\", &t[i].num, &t[i].chinese, &t[i].maths);\n  }\n  for (i = 0; i < n; i++) {\n    t[i].sum = t[i].chinese + t[i].maths;\n  }\n  for (i = 0; i < 3; i++) {\n    k = i;\n    for (j = i + 1; j < n; j++) {\n      if (t[j].sum > t[k].sum)\n        k = j;\n    }\n    l = t[k];\n    t[k] = t[i];\n    t[i] = l;\n  }\n  for (i = 0; i < 3; i++) {\n    cout << t[i].num << \" \" << t[i].sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26599", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  struct stu *next;\n};\n\nint main() {\n  int n, m = 0, max = 0, max2 = 0, max3 = 0, no = 0, no2 = 0, no3 = 0;\n  struct stu *p;\n  scanf(\"%d\", &n);\n  struct stu *p1, *p2, *head;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  head = NULL;\n\n  while (n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else {\n      p2->next = p1;\n    }\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    n--;\n  }\n  p2->next = NULL;\n\n  p = head;\n  while (p) {\n    p->ch = p->math + p->ch;\n    p = p->next;\n  }\n\n  p = head;\n  while (p) {\n    if (p->ch > max) {\n      max = p->ch;\n      no = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no, max);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max && p->ch > max2 && p->num != no) {\n      max2 = p->ch;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no2, max2);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max2 && p->ch > max3 && p->num != no && p->num != no2) {\n      max3 = p->ch;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\", no3, max3);\n}\n"}
{"label": "14", "index": "26600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  struct student *next;\n};\nint n;\nstruct student *creat(int m) {\n  struct student *head;\n  struct student *p1, *p2;\n  n = 0;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  head = NULL;\n  while (m--) {\n    n = n + 1;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  }\n  p2->next = NULL;\n  return (head);\n}\nstruct student *del(struct student *head, int num) {\n  struct student *p1, *p2;\n  p1 = head;\n  while (num != p1->num && p1->next != NULL) {\n    p2 = p1;\n    p1 = p1->next;\n  }\n  if (num == p1->num) {\n    if (p1 == head)\n      head = p1->next;\n    else\n      p2->next = p1->next;\n    n = n - 1;\n  }\n  return (head);\n}\nint main() {\n  struct student *head, *p1, *p2;\n  int max = 0, i, m;\n  scanf(\"%d\", &m);\n  printf(\" \");\n  head = creat(m);\n  for (i = 0; i < 3; i++) {\n    p1 = p2 = head;\n    max = 0;\n    while (p1->next != NULL) {\n      if ((p1->yuwen + p1->shuxue) > max)\n        max = p1->yuwen + p1->shuxue, p2 = p1;\n      p1 = p1->next;\n    }\n    cout << p2->num << \" \" << (p2->yuwen + p2->shuxue) << \" \";\n    head = del(head, p2->num);\n  }\n}\n"}
{"label": "14", "index": "26601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, chi, math, sum;\n  struct student {\n    int num, chi, math, sum;\n  } students[100000];\n  int i;\n  int STUDENT_NUM;\n  scanf(\"%d\", &STUDENT_NUM);\n  for (i = 0; i < STUDENT_NUM; i++) {\n    cin >> num >> chi >> math;\n    students[i].num = num;\n    students[i].chi = chi;\n    students[i].math = math;\n    sum = chi + math;\n    students[i].sum = sum;\n  }\n  int sum1 = 0, sum2 = 0, sum3 = 0;\n  int num1, num2, num3;\n  for (i = 0; i < STUDENT_NUM; i++) {\n    if (i == 0) {\n      sum1 = students[0].sum;\n      num1 = students[0].num;\n    } else if (i == 1) {\n      if (students[1].sum > students[0].sum) {\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[1].sum;\n        num1 = students[1].num;\n      } else {\n        sum2 = students[1].sum;\n        num2 = students[1].num;\n      }\n    } else {\n      if (students[i].sum > sum1) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = sum1;\n        num2 = num1;\n        sum1 = students[i].sum;\n        num1 = students[i].num;\n      } else if (students[i].sum > sum2) {\n        sum3 = sum2;\n        num3 = num2;\n        sum2 = students[i].sum;\n        num2 = students[i].num;\n      } else if (students[i].sum > sum3) {\n        sum3 = students[i].sum;\n        num3 = students[i].num;\n      }\n    }\n  }\n  printf(\"%d %d\\n\", num1, sum1);\n  cout << num2 << \" \" << sum2 << \"\\n\";\n  printf(\"%d %d\\n\", num3, sum3);\n}\n"}
{"label": "14", "index": "26602", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nstruct person {\n  char num[6];\n  int Chinese;\n  int math;\n  int total;\n} stu[100000];\n\nint main() {\n  int n, i, max, j, k, temp = 0, tnum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].num;\n    cin >> stu[i].Chinese;\n    cin >> stu[i].math;\n    stu[i].total = stu[i].math + stu[i].Chinese;\n  }\n  for (j = 0; j < 3; j++) {\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (stu[i].total > max) {\n        max = stu[i].total;\n        k = i;\n      }\n    }\n    printf(\"%s %d\\n\", stu[k].num, stu[k].total);\n    stu[k].total = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26603", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct ace {\n  char id[10];\n  int a;\n  int b;\n} o[3], r;\n\nint main() {\n  int n, i, s[3], m, j, v;\n  char z[10];\n  scanf(\"%d\", &n);\n  scanf(\"%s %d %d\", o[0].id, &o[0].a, &o[0].b);\n  cin >> o[1].id >> o[1].a >> o[1].b;\n  scanf(\"%s %d %d\", o[2].id, &o[2].a, &o[2].b);\n  s[0] = o[0].a + o[0].b;\n  s[1] = o[1].a + o[1].b;\n  s[2] = o[2].a + o[2].b;\n  for (i = 0; i < 2; i++) {\n    for (j = i + 1; j < 3; j++) {\n      if (s[i] < s[j]) {\n        strcpy(z, o[i].id);\n        strcpy(o[i].id, o[j].id);\n        strcpy(o[j].id, z);\n        v = s[i];\n        s[i] = s[j];\n        s[j] = v;\n      }\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    scanf(\"%s %d %d\", r.id, &r.a, &r.b);\n    m = r.a + r.b;\n    if (m > s[0]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = o[0];\n      s[1] = s[0];\n      o[0] = r;\n      s[0] = m;\n    } else if (m <= s[0] && m > s[1]) {\n      o[2] = o[1];\n      s[2] = s[1];\n      o[1] = r;\n      s[1] = m;\n    } else if (m <= s[1] && m > s[2]) {\n      o[2] = r;\n      s[2] = m;\n    }\n  }\n  printf(\"%s %d\\n\", o[0].id, s[0]);\n  printf(\"%s %d\\n\", o[1].id, s[1]);\n  printf(\"%s %d\\n\", o[2].id, s[2]);\n  return 0;\n}\n"}
{"label": "14", "index": "26604", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct Student {\n  long id;\n  int chn;\n  int mth;\n  int total;\n  struct Student *next;\n};\n\nstruct Student *insert(struct Student *head, struct Student *stu) {\n  int j = 0;\n  struct Student *p0, *p1, *p2;\n  p1 = head;\n  p0 = stu;\n  if (head == NULL) {\n    head = p0;\n    p0->next = NULL;\n  } else {\n    while ((p0->total <= p1->total) && (p1->next != NULL) && j < 4) {\n      p2 = p1;\n      p1 = p1->next;\n      j++;\n    }\n    if (p0->total > p1->total) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n  }\n  return (head);\n}\n\nint main() {\n  struct Student *p1, *head, *stu;\n  long int i, n;\n  scanf(\"%ld \", &n);\n\n  p1 = head = (struct Student *)malloc(sizeof(struct Student));\n  scanf(\"%d %d %d\", &head->id, &head->chn, &head->mth);\n  head->total = head->chn + head->mth;\n  head->next = NULL;\n  for (i = 1; i < n; i++) {\n    stu = (struct Student *)malloc(sizeof(struct Student));\n    scanf(\"%d %d %d\", &stu->id, &stu->chn, &stu->mth);\n    stu->total = stu->chn + stu->mth;\n    head = insert(head, stu);\n  }\n  p1 = head;\n  for (i = 0; i < 3; i++) {\n    printf(\"%d %d\\n\", p1->id, p1->total);\n    p1 = p1->next;\n  }\n}\n"}
{"label": "14", "index": "26605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  char xuehao[100];\n  int yuwen;\n  int shuxue;\n  int sum;\n};\n\nint main() {\n  int n, i, j, l, m;\n  struct student stu[100000];\n  struct student temp;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", stu[i].xuehao);\n    scanf(\"%d %d\", &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].sum = stu[i].yuwen + stu[i].shuxue;\n  }\n\n  for (j = 1; j < 4; j++) {\n    for (m = 0; m < n - j; m++) {\n      if (stu[m].sum >= stu[m + 1].sum) {\n        temp = stu[m];\n        stu[m] = stu[m + 1];\n        stu[m + 1] = temp;\n      }\n    }\n  }\n\n  for (l = n - 1; l > n - 4; l--)\n    printf(\"%s %d\\n\", stu[l].xuehao, stu[l].sum);\n\n  return 0;\n}\n"}
{"label": "14", "index": "26606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct f {\n  int a;\n  int b;\n  int c;\n} st[100000], tp;\nint main() {\n  int n, i, ii, j, d, a, b, c;\n  char cc;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d%d%d\", &st[i].a, &st[i].b, &st[i].c);\n    st[i].b += st[i].c;\n  }\n  for (i = 1; i <= 3; i++) {\n    for (j = i + 1; j <= n; j++) {\n      if (st[j].b > st[i].b) {\n        tp = st[i];\n        st[i] = st[j];\n        st[j] = tp;\n      }\n    }\n  }\n  for (i = 1; i <= 3; i++)\n    printf(\"%d %d\\n\", st[i].a, st[i].b);\n  return 0;\n}\n"}
{"label": "14", "index": "26607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int num, ch, ma, grade;\n  } sum[100000], h, m, t;\n  int i, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &sum[i].num, &sum[i].ch, &sum[i].ma);\n    sum[i].grade = sum[i].ch + sum[i].ma;\n  }\n  h.grade = m.grade = t.grade = 0;\n  for (i = 0; i < n; i++) {\n    if (sum[i].grade > h.grade) {\n      t = m;\n      m = h;\n      h = sum[i];\n    } else if (sum[i].grade > m.grade) {\n      t = m;\n      m = sum[i];\n    } else if (sum[i].grade > t.grade)\n      t = sum[i];\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", h.num, h.grade, m.num, m.grade, t.num,\n         t.grade);\n  return 0;\n}\n"}
{"label": "14", "index": "26608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  struct {\n    int id, chi, math, sum;\n  } s, s1, s2, s3;\n  s1.sum = s2.sum = s3.sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &s.id, &s.chi, &s.math);\n    s.sum = s.chi + s.math;\n    if (s.sum > s1.sum) {\n      s3 = s2;\n      s2 = s1;\n      s1 = s;\n    } else if (s.sum > s2.sum) {\n      s3 = s2, s2 = s;\n    } else {\n      if (s.sum > s3.sum) {\n        s3 = s;\n      }\n    }\n  }\n  printf(\"%d %d\\n%d %d\\n%d %d\\n\", s1.id, s1.sum, s2.id, s2.sum, s3.id, s3.sum);\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "14", "index": "26609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->math);\n    p1->total = p1->yuwen + p1->math;\n    if (m == 1) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int a[3][2], t1, t2;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a[0][1] = a[1][1] = a[2][1] = 0;\n  if (head != 0)\n    do {\n      if (p->total > a[2][1]) {\n        a[2][1] = p->total;\n        a[2][0] = p->num;\n      }\n      if (a[2][1] > a[1][1]) {\n        t1 = a[1][1];\n        a[1][1] = a[2][1];\n        a[2][1] = t1;\n        t2 = a[1][0];\n        a[1][0] = a[2][0];\n        a[2][0] = t2;\n      }\n      if (a[1][1] > a[0][1]) {\n        t1 = a[0][1];\n        a[0][1] = a[1][1];\n        a[1][1] = t1;\n        t2 = a[0][0];\n        a[0][0] = a[1][0];\n        a[1][0] = t2;\n      }\n      p = p->next;\n    } while (p != 0);\n  for (t1 = 0; t1 <= 2; t1++) {\n    printf(\"%d %d\\n\", a[t1][0], a[t1][1]);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26610", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct Student {\n  int no;\n  int chinese;\n  int math;\n  int total;\n};\nint main() {\n  struct Student stu[100000], t;\n  int n, i, j, max, order;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d%d%d\", &stu[i].no, &stu[i].chinese, &stu[i].math);\n    stu[i].total = stu[i].chinese + stu[i].math;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[i].total;\n    order = i;\n    for (j = i + 1; j < n; j++) {\n      if (stu[j].total > max) {\n        max = stu[j].total;\n        order = j;\n      }\n    }\n    if (order != i) {\n      t = stu[i];\n      stu[i] = stu[order];\n      stu[order] = t;\n    }\n    printf(\"%d %d\\n\", stu[i].no, stu[i].total);\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int score1;\n  int score2;\n  int sum;\n  struct student *next;\n};\nstruct student *creat(int m) {\n  int i = 0;\n  struct student *head, *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n  p1->sum = (p1->score1) + (p1->score2);\n  head = NULL;\n  while (p1->num < m) {\n    i++;\n    if (i == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->score1, &p1->score2);\n    p1->sum = (p1->score1) + (p1->score2);\n  }\n  p2->next = NULL;\n  return (head);\n}\nvoid print(struct student *head) {\n  struct student *p = head, *q = head;\n  int a = 0, b = 0, c = 0;\n  if (head != NULL)\n\n  {\n    do {\n      if (a < p->sum) {\n        a = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (b < p->sum) {\n        b = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d \", q->num, q->sum);\n    q->sum = 0;\n    p = head;\n    q = head;\n    do {\n      if (c < p->sum) {\n        c = p->sum;\n        q = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    printf(\"%d %d\", q->num, q->sum);\n  }\n}\nint main() {\n  int m;\n  scanf(\"%d\", &m);\n  struct student *head, stu;\n  head = creat(m);\n  print(head);\n}\n"}
{"label": "14", "index": "26612", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  char num[15];\n  int chinese;\n  int math;\n  int sum;\n  struct stu *next;\n};\nint n;\nstruct stu *creat(void) {\n  struct stu *head, *p, *g, *h;\n  int i, j;\n  p = (struct stu *)malloc(1000);\n  scanf(\"%s %d %d\", (*p).num, &(*p).chinese, &(*p).math);\n  (*p).sum = ((*p).chinese + (*p).math);\n  for (i = 0;; i++) {\n    if (i == 0) {\n      head = p;\n      (*p).next = NULL;\n    } else if (i < 4) {\n      for (h = head, j = 0; j < i; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else if (j == i) {\n        (*g).next = p;\n        (*p).next = NULL;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    } else {\n      for (h = head, j = 0; j < 3; j++) {\n        if ((*p).sum > (*h).sum)\n          break;\n        else {\n          g = h;\n          h = (*h).next;\n        }\n      }\n      if (j == 0) {\n        (*p).next = head;\n        head = p;\n      } else {\n        (*g).next = p;\n        (*p).next = h;\n      }\n    }\n    if (i == n - 1)\n      break;\n    p = (struct stu *)malloc(1000);\n    scanf(\"%s %d %d\", (*p).num, &(*p).chinese, &(*p).math);\n    (*p).sum = ((*p).chinese + (*p).math);\n  }\n  return (head);\n}\nvoid print(struct stu *head) {\n  struct stu *p;\n  int i;\n  for (p = head, i = 0; i < 3; i++, p = (*p).next)\n    printf(\"%s %d \", (*p).num, (*p).sum);\n}\nint main() {\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  print(head);\n}\n"}
{"label": "14", "index": "26613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, max, m;\n  cin >> n;\n  struct stu {\n    int hao, yuwen, shuxue, zong;\n  } stu[100000];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\"\n          \"%d\"\n          \"%d\",\n          &stu[i].hao, &stu[i].yuwen, &stu[i].shuxue);\n    stu[i].zong = stu[i].yuwen + stu[i].shuxue;\n  }\n  for (i = 0; i < 3; i++) {\n    max = stu[0].zong;\n    for (j = 1; j < n; j++) {\n      if (stu[j].zong > max) {\n        max = stu[j].zong;\n        m = j;\n      }\n    }\n    cout << stu[m].hao << \" \" << max << \"\\n\";\n    stu[m].zong = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "14", "index": "26614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  struct student {\n    int a;\n    int math;\n    int chi;\n    int sum;\n    struct student *next;\n  };\n  int n, i;\n  int max;\n  struct student *p1, *p2, *head;\n  scanf(\"%d\", &n);\n  head = NULL;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      head = p1 = (struct student *)malloc(1000);\n    else {\n      p1->next = (struct student *)malloc(1000);\n      p1 = p1->next;\n    }\n    scanf(\"%d%d%d\", &p1->a, &p1->math, &p1->chi);\n    p1->sum = (p1->math) + (p1->chi);\n  }\n  p1->next = NULL;\n  for (i = 0; i < 3; i++) {\n    p1 = head;\n    max = p1->sum;\n    do {\n      p1 = p1->next;\n      if (p1->sum > max) {\n        max = p1->sum;\n        p2 = p1;\n      }\n    } while (p1->next != NULL);\n    printf(\"%d %d \", p2->a, p2->sum);\n    p2->sum = 0;\n  }\n}\n"}
{"label": "14", "index": "26615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct stu {\n  int num;\n  int ch;\n  int math;\n  struct stu *next;\n};\n\nint main() {\n  int n, m = 0, max = 0, max2 = 0, max3 = 0, no = 0, no2 = 0, no3 = 0;\n  struct stu *p;\n  scanf(\"%d\", &n);\n  struct stu *p1, *p2, *head;\n  p1 = (struct stu *)malloc(1000);\n  scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n  head = NULL;\n\n  while (n - 1) {\n    m = m + 1;\n    if (m == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct stu *)malloc(1000);\n    scanf(\"%d%d%d\", &p1->num, &p1->ch, &p1->math);\n    n--;\n  }\n  p2->next = NULL;\n\n  p = head;\n  while (p) {\n    p->ch = p->math + p->ch;\n    p = p->next;\n  }\n\n  p = head;\n  while (p) {\n    if (p->ch > max) {\n      max = p->ch;\n      no = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no, max);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max && p->ch > max2 && p->num != no) {\n      max2 = p->ch;\n      no2 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d \", no2, max2);\n\n  p = head;\n  while (p) {\n    if (p->ch <= max2 && p->ch > max3 && p->num != no && p->num != no2) {\n      max3 = p->ch;\n      no3 = p->num;\n    }\n    p = p->next;\n  }\n  printf(\"%d %d\", no3, max3);\n}\n"}
{"label": "14", "index": "26616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct student {\n  int num;\n  int yuwen;\n  int math;\n  int total;\n  struct student *next;\n};\nlong m, n;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  m = 0;\n  head = 0;\n  while (m < n) {\n    m = m + 1;\n    p1 = (struct student *)malloc(sizeof(struct student));\n    scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->math);\n    p1->total = p1->yuwen + p1->math;\n    if (m == 1) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = 0;\n  return (head);\n}\n\nint main() {\n  struct student *head, *p, *px;\n  int a[3][2], t1, t2;\n  scanf(\"%ld\", &n);\n  head = creat();\n  p = head;\n  a[0][1] = a[1][1] = a[2][1] = 0;\n  if (head != 0)\n    do {\n      if (p->total > a[2][1]) {\n        a[2][1] = p->total;\n        a[2][0] = p->num;\n      }\n      if (a[2][1] > a[1][1]) {\n        t1 = a[1][1];\n        a[1][1] = a[2][1];\n        a[2][1] = t1;\n        t2 = a[1][0];\n        a[1][0] = a[2][0];\n        a[2][0] = t2;\n      }\n      if (a[1][1] > a[0][1]) {\n        t1 = a[0][1];\n        a[0][1] = a[1][1];\n        a[1][1] = t1;\n        t2 = a[0][0];\n        a[0][0] = a[1][0];\n        a[1][0] = t2;\n      }\n      p = p->next;\n    } while (p != 0);\n  for (t1 = 0; t1 <= 2; t1++) {\n    printf(\"%d %d\\n\", a[t1][0], a[t1][1]);\n  }\n}\n"}
{"label": "14", "index": "26617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct student {\n  int num;\n  int chi;\n  int math;\n  struct student *next;\n};\n\nstruct student *creat(int n) {\n  struct student *head, *p1, *p2;\n  int i;\n  p1 = p2 = (struct student *)malloc(1000);\n  cin >> p1->num >> p1->chi >> p1->math;\n  head = p1;\n  for (i = 2; i <= n; i++) {\n    p1 = (struct student *)malloc(1000);\n    scanf(\"%d %d %d\", &p1->num, &p1->chi, &p1->math);\n    p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return head;\n}\n\nint main() {\n  struct student *head, *p, *p1, *p2, *p3;\n  int n, m1, m2, m3, k;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  p = head;\n  m1 = m2 = m3 = 0;\n  if (head != NULL) {\n    do {\n      k = p->chi + p->math;\n      if (k > m1) {\n        m1 = k;\n        p1 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m2) && (p != p1)) {\n        m2 = k;\n        p2 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n    p = head;\n    do {\n      k = p->chi + p->math;\n      if ((k > m3) && (p != p1) && (p != p2)) {\n        m3 = k;\n        p3 = p;\n      }\n      p = p->next;\n    } while (p != NULL);\n  }\n  printf(\"%d %d %d %d %d %d \", p1->num, m1, p2->num, m2, p3->num, m3);\n}\n"}
{"label": "14", "index": "26618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct stu {\n  long num;\n  int Chi;\n  int Math;\n  int Sum;\n  struct stu *next;\n} * p1, *p2;\n\nstruct stu *creat(int n) {\n  struct stu *head = NULL;\n  int i;\n  for (i = 0; i < n; i++) {\n    p1 = (struct stu *)malloc(sizeof(struct stu));\n\n    scanf(\"%d %d %d\", &p1->num, &p1->Chi, &p1->Math);\n    p1->Sum = p1->Chi + p1->Math;\n    if (i == 0) {\n      head = p1;\n      p2 = p1;\n    } else\n      p2->next = p1;\n    p2 = p1;\n  }\n  p2->next = NULL;\n  return (head);\n}\n\nstruct stu *Bigthree(struct stu *head) {\n  int t;\n  struct stu *max, *premax, *New, *Newhead = NULL;\n  for (t = 0; t < 3; t++) {\n    premax = NULL;\n    max = head;\n    p2 = head;\n    p1 = head->next;\n    while (p1 != NULL) {\n      if ((p1->Sum) > (max->Sum)) {\n        premax = p2;\n        max = p1;\n      }\n      p2 = p2->next;\n      p1 = p1->next;\n    }\n    if (max == head)\n      head = head->next;\n    else\n      premax->next = max->next;\n    max->next = NULL;\n    if (t == 0) {\n      Newhead = max;\n      New = Newhead;\n    }\n\n    else\n      New = New->next = max;\n  }\n  New->next = NULL;\n  return (Newhead);\n}\n\n\nvoid output(struct stu *head) {\n  struct stu *p;\n  for (p = head; p != NULL; printf(\"%d %d\\n\", p->num, p->Sum), p = p->next)\n    ;\n}\n\nint main() {\n  int n;\n  struct stu *head;\n  scanf(\"%d\", &n);\n  head = creat(n);\n  head = Bigthree(head);\n  output(head);\n}\n"}
{"label": "14", "index": "26619", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct student {\n  long id;\n  int chinese;\n  int math;\n  int score;\n  struct student *next;\n};\n\nstruct student *creat(void) {\n  int num;\n  struct student *head, *p, *q;\n  q = NULL;\n  head = (struct student *)malloc(1000);\n  p = head;\n  scanf(\"%d\", &num);\n  while (num > 0) {\n    q = p;\n    scanf(\"%ld%d%d\", &p->id, &p->chinese, &p->math);\n    p->score = p->chinese + p->math;\n    p = (struct student *)malloc(1000);\n    q->next = p;\n    num--;\n  }\n  p->next = NULL;\n  return (head);\n}\n\nint main() {\n  int i;\n  struct student *p, *head, *max[3];\n  head = creat();\n  p = head;\n  for (i = 0; i <= 2; i++) {\n    max[i] = (struct student *)malloc(1000);\n    max[i]->score = 0;\n  }\n  for (; p != NULL; p = p->next) {\n    if (p->score > max[0]->score) {\n      max[2] = max[1];\n      max[1] = max[0];\n      max[0] = p;\n    } else if (p->score > max[1]->score) {\n      max[2] = max[1];\n      max[1] = p;\n    } else if (p->score > max[2]->score)\n      max[2] = p;\n  }\n  for (i = 0; i <= 2; i++)\n    printf(\"%ld %d \", max[i]->id, max[i]->score);\n  return 0;\n}\n"}
{"label": "14", "index": "26620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  int num;\n  int yuwen;\n  int shuxue;\n  int score;\n  struct student *next;\n};\nint n, i = 0, a;\nstruct student *m1, *m2, *m3, *q;\nstruct student *creat(void) {\n  struct student *head;\n  struct student *p1, *p2;\n  p1 = p2 = (struct student *)malloc(1000);\n  scanf(\"%d %d %d\", &p1->num, &p1->yuwen, &p1->shuxue);\n  p1->score = p1->yuwen + p1->shuxue;\n  head = NULL;\n  while (i < n - 1) {\n    if (i == 0)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct student *)malloc(1000);\n    cin >> p1->num >> p1->yuwen >> p1->shuxue;\n    p1->score = p1->yuwen + p1->shuxue;\n    if (i >= 3) {\n      if (p2->score > m1->score) {\n        m3 = m2;\n        m2 = m1;\n        m1 = p2;\n      } else {\n        if (p2->score <= m1->score && p2->score > m2->score) {\n          m3 = m2;\n          m2 = p2;\n        } else if (p2->score <= m2->score && p2->score > m3->score)\n          m3 = p2;\n      }\n      i++;\n      continue;\n    }\n    if (i == 0)\n      m1 = p2;\n    else if (i == 1)\n      m2 = p2;\n    else if (i == 2) {\n      m3 = p2;\n      if (m1->score > m2->score) {\n        if (m2->score <= m3->score) {\n          if (m1->score > m3->score) {\n            q = m3;\n            m3 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = m3;\n            m3 = q;\n          }\n        }\n      } else if (m1->score <= m2->score) {\n        if (m2->score > m3->score) {\n          if (m1->score > m3->score) {\n            q = m1;\n            m1 = m2;\n            m2 = q;\n          } else if (m1->score <= m3->score) {\n            q = m3;\n            m3 = m1;\n            m1 = m2;\n            m2 = q;\n          }\n        } else if (m2->score <= m3->score) {\n          q = m1;\n          m1 = m3;\n          m3 = q;\n        }\n      }\n    }\n    i++;\n  }\n  return (head);\n}\nint main() {\n  struct student *head;\n  scanf(\"%d\", &n);\n  head = creat();\n  printf(\"%d %d \", m1->num, m1->score);\n  cout << m2->num << \" \" << m2->score << \" \";\n  printf(\"%d %d \", m3->num, m3->score);\n  return 0;\n}\n"}
{"label": "14", "index": "26621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct student {\n  long a;\n  int x;\n  int y;\n};\nstruct student stu[100000];\nint main() {\n  long n, i, j, p;\n  int m;\n  cin >> n;\n  int g[100000];\n  for (i = 0; i < n; i++) {\n    cin >> stu[i].a >> stu[i].x >> stu[i].y;\n    g[i] = stu[i].x + stu[i].y;\n  }\n  for (i = 1; i < 4; i++)\n    for (j = n - 1; j >= i; j--)\n      if (g[j - 1] < g[j]) {\n        m = g[j - 1];\n        g[j - 1] = g[j];\n        g[j] = m;\n        p = stu[j - 1].a;\n        stu[j - 1].a = stu[j].a;\n        stu[j].a = p;\n      }\n  for (i = 0; i < 3; i++)\n    cout << stu[i].a << \" \" << g[i] << \" \";\n}\n"}
{"label": "14", "index": "26622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nstruct student {\n  long int num;\n  int Chinese;\n  int Maths;\n  int total;\n};\nint main() {\n  struct student stu[100000];\n  struct student tempt;\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%d %d %d\", &stu[i].num, &stu[i].Chinese, &stu[i].Maths);\n    stu[i].total = stu[i].Chinese + stu[i].Maths;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  if (stu[1].total > stu[0].total) {\n    tempt = stu[0];\n    stu[0] = stu[1];\n    stu[1] = tempt;\n  }\n  if (stu[2].total > stu[1].total) {\n    tempt = stu[1];\n    stu[1] = stu[2];\n    stu[2] = tempt;\n  }\n  for (i = 3; i < n; i++) {\n    if (stu[i].total > stu[2].total) {\n      stu[2] = stu[i];\n      if (stu[2].total > stu[1].total) {\n        tempt = stu[1];\n        stu[1] = stu[2];\n        stu[2] = tempt;\n        if (stu[1].total > stu[0].total) {\n          tempt = stu[0];\n          stu[0] = stu[1];\n          stu[1] = tempt;\n        }\n      }\n    }\n  }\n  printf(\"%d %d\\n\", stu[0].num, stu[0].total);\n  printf(\"%ld %d\\n\", stu[1].num, stu[1].total);\n  cout << stu[2].num << \" \" << stu[2].total << \"\\n\";\n}\n"}
{"label": "14", "index": "26623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  struct s {\n    int a;\n    int b;\n    int c;\n    int d;\n    struct s *next;\n  };\n  struct s *p1, *p2, *head;\n  int i, j, k, n, t;\n  scanf(\"%d\", &n);\n  p1 = p2 = (struct s *)malloc(sizeof(struct s));\n  head = p1;\n  scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  for (i = 0; i < n - 1; i++) {\n    p1 = (struct s *)malloc(sizeof(struct s));\n    p2->next = p1;\n    p2 = p1;\n    scanf(\"%d %d %d\", &p1->a, &p1->b, &p1->c);\n  }\n  p2->next = 0;\n  p1 = p2 = head;\n  for (i = 0; i < n; i++) {\n    p1->d = p1->b + p1->c;\n    p1 = p1->next;\n  }\n  p1 = head;\n  p2 = p1->next;\n  for (j = 0; j < 3; j++) {\n    p1 = head;\n    p2 = p1->next;\n    for (i = 0; i < n - 2; i++) {\n      if (p1->d < p2->d) {\n        t = p1->d;\n        p1->d = p2->d;\n        p2->d = t;\n        k = p1->a;\n        p1->a = p2->a;\n        p2->a = k;\n      }\n\n      p2 = p2->next;\n    }\n    p1 = head;\n\n    cout << p1->a << \" \" << p1->d << \"\\n\";\n    p1->d = 0;\n  }\n  return 0;\n}\n"}
{"label": "14", "index": "26624", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nstruct student {\n  long num;\n  int scorec;\n  int scorem;\n  struct student *next;\n};\nstruct student *creat(void) {\n  struct student *head, *p0, *p1, *p2;\n  int i = 0;\n  head = (struct student *)malloc(1000);\n  head->next = NULL;\n  scanf(\"%ld %d %d\", &head->num, &head->scorec, &head->scorem);\n  while (i < 2) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    scanf(\"%ld %d %d\", &p0->num, &p0->scorec, &p0->scorem);\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL)) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n      if (head == p1)\n        head = p0;\n      else\n        p2->next = p0;\n      p0->next = p1;\n    } else {\n      p1->next = p0;\n      p0->next = NULL;\n    }\n    i++;\n  }\n  return (head);\n}\nstruct student *sort(struct student *head, int n) {\n  struct student *p0, *p1, *p2;\n  int i = 3;\n  while (i < n) {\n    p1 = head;\n    p0 = (struct student *)malloc(1000);\n    cin >> p0->num >> p0->scorec >> p0->scorem;\n    while ((p0->scorec + p0->scorem) <= (p1->scorec + p1->scorem) &&\n           (p1->next != NULL))\n      p1 = p1->next;\n\n    if ((p0->scorec + p0->scorem) > (p1->scorec + p1->scorem)) {\n\n      if (head == p1) {\n        p2 = p1->next;\n        (*p2->next).num = p2->num;\n        (*p2->next).scorec = p2->scorec;\n        (*p2->next).scorem = p2->scorem;\n        p2->num = p1->num;\n        p2->scorec = p1->scorec;\n        p2->scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else if (p1 == head->next) {\n        (*p1->next).num = p1->num;\n        (*p1->next).scorec = p1->scorec;\n        (*p1->next).scorem = p1->scorem;\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      } else {\n        p1->num = p0->num;\n        p1->scorec = p0->scorec;\n        p1->scorem = p0->scorem;\n      }\n    }\n    free(p0);\n    i++;\n  }\n  return (head);\n}\n\nint main() {\n  struct student *head, *p1, *p2;\n  int n;\n  scanf(\"%d\", &n);\n  head = creat();\n  head = sort(head, n);\n  p1 = head->next;\n  p2 = p1->next;\n  printf(\"%ld %d \", head->num, (head->scorec + head->scorem));\n  printf(\"%ld %d \", p1->num, (p1->scorec + p1->scorem));\n  printf(\"%ld %d\", p2->num, (p2->scorec + p2->scorem));\n}\n"}
{"label": "14", "index": "26625", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t, First = 0, FirstNum, Second = 0, SecondNum, Third = 0,\n                  ThirdNum;\n  scanf(\"%d\", &n);\n  struct Student {\n    int Chinese;\n    int Math;\n    int Sum;\n    int Num;\n  } Student[n + 1];\n  for (i = 1; i <= n; i++) {\n    scanf(\"%d %d %d\", &Student[i].Num, &Student[i].Chinese, &Student[i].Math);\n    Student[i].Sum = Student[i].Chinese + Student[i].Math;\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > First) {\n      First = Student[i].Sum;\n      FirstNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Second && Student[i].Sum <= First && i != FirstNum) {\n      Second = Student[i].Sum;\n      SecondNum = i;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (Student[i].Sum > Third && Student[i].Sum <= Second && i != SecondNum &&\n        i != FirstNum) {\n      Third = Student[i].Sum;\n      ThirdNum = i;\n    }\n  }\n  printf(\"%d %d\\n\", FirstNum, First);\n  printf(\"%d %d\\n\", SecondNum, Second);\n  printf(\"%d %d\\n\", ThirdNum, Third);\n}\n"}
{"label": "15", "index": "26626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, s, a = 0, k[1000];\n  scanf(\"%d\\n\", &n);\n  for (j = 0; j < n * n; j++) {\n    scanf(\"%d\", &k[j]);\n  }\n  for (j = 0; j < n * n; j++) {\n    if (k[j] == 0)\n      a = a + 1;\n  }\n  s = (a / 4 - 1) * (a / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int picture[1000][1000];\n  int hang[1000];\n  int i, j;\n  int m = 0, mg = 0, l = 0, number;\n  for (i = 0; i < n; i++) {\n    hang[i] = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &picture[i][j]);\n      if (picture[i][j] == 0) {\n        hang[i] = hang[i] + 1;\n      }\n    }\n    if (hang[i] > 2 && m == 0) {\n      m = i;\n      mg = hang[i];\n    } else if (hang[i] > 2 && m > 0) {\n      l = i;\n    }\n  }\n  number = (l - m - 1) * (mg - 2);\n  printf(\"%d\", number);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j, c, b, s, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        c = i;\n        b = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        c = i - c - 1;\n        b = j - b - 1;\n      }\n    }\n  }\n  s = c * b;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, i, j, a = 0, b = 1000, c = 0, d = 1000, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i > a) {\n          a = i;\n        }\n        if (i < b) {\n          b = i;\n        }\n\n        if (j > c) {\n          c = j;\n        }\n        if (j < d) {\n          d = j;\n        }\n      }\n    }\n  }\n  x = a - b - 1;\n  y = c - d - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26630", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[100][100];\n  int i, j, a, b, c, d, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &sz[i][j]);\n    }\n  }\n  int tag;\n  for (i = 0; i < n; i++) {\n    tag = 0;\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i][j - 1] != 0) && (sz[i - 1][j] != 0)) {\n        a = i;\n        b = j;\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        c = i;\n        d = j;\n        tag = 2;\n        break;\n      }\n    }\n    if (tag == 2) {\n      break;\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, tmp1, tmp2, m = 0, l = 0, i, s;\n  cin >> n;\n  cin >> tmp1;\n  if (tmp1 == 0) {\n    m++;\n    l++;\n  }\n  for (i = 1; i < n * n; i++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n    m += (tmp2 == 0);\n    if (tmp2 == 255 && tmp1 == 0) {\n      break;\n    }\n    tmp1 = tmp2;\n  }\n  for (int j = i; j < n * n; j++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n  }\n  s = (m - 2) * (l - 2 * m) / 2;\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26632", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, s = 0;\n  int e, b, c, d = 0;\n  int n = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] < a[i][j + 1]) {\n        e = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] < a[i][j - 1]) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int sz[1000][1000];\n  int a1, a2, b1, b2, a, b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0)\n        a1 = i, b1 = j;\n\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "26634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c = 0, q = 0, t;\n  int m[1000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        m[i]++;\n        c++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (m[i] != 0)\n      q++;\n  }\n  printf(\"%d\", (q - 2) * (c - 2 * q) / 2);\n}\n"}
{"label": "15", "index": "26635", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int a, b, c, d, f, i, j, e = 0, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    if (m[a][j] != 0) {\n      c = j - 1;\n      break;\n    }\n  }\n  for (i = a; i < n; i++) {\n    if (m[i][b] != 0) {\n      d = i - 1;\n      break;\n    }\n  }\n  f = (c - b - 1) * (d - a - 1);\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "15", "index": "26636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, line = 0, row = 0, mianji;\n  int p[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &p[i][k]);\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (p[i][k] == 0 && p[i - 1][k] == 0)\n        row = row + 1;\n    }\n  }\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][k] == 0 && p[i][k - 1] == 0)\n        line = line + 1;\n    }\n  }\n  mianji = (line / 2 - 1) * (row / 2 - 1);\n  cout << mianji;\n  return 0;\n}\n"}
{"label": "15", "index": "26637", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c[100][100];\n  int a1, a2, b1, b2, a, b, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> c[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  a = a1 - a2 - 1;\n  b = b1 - b2 - 1;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x, y, o, p, q = 0, c, d;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        x = i;\n        y = j;\n      } else {\n        if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255) {\n          o = i;\n          p = j;\n        }\n      }\n    }\n  }\n  c = o - x - 1;\n  d = p - y - 1;\n  q = c * d;\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "26639", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  long i, j, a, b, c, d, e, f, s;\n  cin >> n;\n  a = b = 0;\n  c = d = e = 255;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &c);\n    if (c == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (j = i + 1; j <= n * n; j++) {\n    c = d;\n    d = e;\n    e = f;\n    scanf(\"%d\", &f);\n    if ((f != 0) && (c == 0) && (d == 0) && (e == 0)) {\n      b = j - 1;\n    }\n  }\n  int o, p, q, r;\n  o = a % n;\n  p = (-b + 1) % n + n;\n  q = a / n;\n  r = b / n;\n  s = (n - o - p) * (r - q - 1);\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "26640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000] = {{255}}, b[1000] = {0}, g[1000] = {0};\nint main() {\n  int n = 0, i = 0, j = 0, c = 0, d = 0, e = 0, f = 0;\n  cin >> n;\n  if (n > 0 && n < 1000) {\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[j][i] = 255;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        cin >> a[j][i];\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0) {\n          c = j, d = i;\n          goto next;\n        }\n      }\n  next:;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0)\n          e = j, f = i;\n      }\n  }\n  cout << (e - c - 1) * (f - d - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "26641", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b = 0, c = 0, d, n, i, j, e;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    if (c > 2)\n      e = c;\n    c = 0;\n\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0) {\n        c = c + 1;\n        continue;\n      }\n      b = b + 1;\n    }\n  }\n  d = ((n * n - b) - 2 * e) / 2 * (e - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "26642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int a[101][101] = {0};\n  int n, i, j, cnt = 0, flag = 0;\n  int firstx = 0, firsty = 0, lastx = 0, lasty = 0;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        flag = 1;\n        firstx = i;\n        firsty = j;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        lastx = i;\n        lasty = j;\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        cnt++;\n    }\n  }\n\n  cout << (lastx - firstx + 1) * (lasty - firsty + 1) - cnt << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n;\n  int row, col;\n  int a, b, c, d;\n  int x, y;\n  int num;\n  int e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0) {\n        a = row;\n        b = col;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (sz[row][col] == 0) {\n        c = row;\n        d = col;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  x = c - a - 1;\n  y = d - b - 1;\n  num = x * y;\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, n, flag = 1, a = 0, b = 0, num;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> num;\n    if ((num == 0) && (flag == 1)) {\n      a++;\n    }\n    if ((a > 0) && (num != 0)) {\n      flag = 0;\n    }\n    if (num == 0) {\n      b++;\n    }\n  }\n  cout << a * ((b - 2 * a) / 2 + 2) - b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], x;\n  scanf(\"%d\", &n);\n  int a1 = n - 1, a2 = 0, b1 = n - 1, b2 = 0;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0) {\n        if (i < a1)\n          a1 = i;\n        if (i > a2)\n          a2 = i;\n        if (j < b1)\n          b1 = j;\n        if (j > b2)\n          b2 = j;\n      }\n    }\n  }\n  x = (b2 - b1 - 1) * (a2 - a1 - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "26646", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sz[1000][1000], a, b, c, d, e = 1, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n\n      if (sz[i][j] == 0 && e == 1) {\n        a = i;\n        b = j;\n        e = 0;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26647", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100], i, j, x1 = -1, y1, x2 = -1, y2, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x1 == -1)\n      continue;\n    else\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x2 == -1)\n      continue;\n    else\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[500][500], x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        x++;\n    }\n    if (x != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0)\n        y++;\n    }\n    if (y != 0)\n      break;\n  }\n  printf(\"%d\\n\", (x - 2) * (y - 2));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, x = 2, y = 2;\n  cin >> n;\n  int a[1000][1000], i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0) {\n        x++;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0) {\n        y++;\n      }\n    }\n  }\n  int s;\n  s = (x / 2 - 2) * (y / 2 - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n], b, c, d, e, f, i, j, zhi = 0;\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0 && zhi == 0) {\n        b = i;\n        c = j;\n        zhi++;\n      }\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  f = (d - b - 1) * (e - c - 1);\n  cout << f;\n}\n"}
{"label": "15", "index": "26651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], num = 0, v, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        for (k = j;; k++) {\n          if (a[i][k] != 0) {\n            break;\n          }\n        }\n        for (v = i;; v++) {\n          if (a[v][j] != 0) {\n            break;\n          }\n        }\n        num = (k - j - 2) * (v - i - 2);\n        break;\n      }\n      if (num != 0)\n        break;\n    }\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, flag = 0, start[2], end[2], s;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      int p;\n      cin >> p;\n      if (p == 0 && flag == 0) {\n        start[0] = i;\n        start[1] = j;\n        flag = 1;\n      }\n      if (p == 0 && flag == 1) {\n        end[0] = i;\n        end[1] = j;\n      }\n    }\n  }\n  s = (end[0] - start[0] - 1) * (end[1] - start[1] - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26653", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j, c, b, s, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        c = i;\n        b = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        c = i - c - 1;\n        b = j - b - 1;\n      }\n    }\n  }\n  s = c * b;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  short int map[1001][1001];\n  int n, i, j, bx, by, ex, ey, ans;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> map[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++) {\n      if (map[i][j] == 255) {\n        if (map[i][j - 1] == 0 && map[i - 1][j] == 0) {\n          bx = i;\n          by = j;\n        }\n        if (map[i][j + 1] == 0 && map[i + 1][j] == 0) {\n          ex = i;\n          ey = j;\n        }\n      }\n    }\n  ans = (ex - bx + 1) * (ey - by + 1);\n  printf(\"%d\", ans);\n  return 0;\n}\n"}
{"label": "15", "index": "26655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int length, i, j, temp, start = -1, end;\n  cin >> length;\n  for (i = 0; i < length; i++)\n    for (j = 0; j < length; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        if (start == -1)\n          start = i * length + j;\n        end = i * length + j;\n      }\n    }\n  cout << (end / length - start / length - 1) *\n              (end % length - start % length - 1);\n}\n"}
{"label": "15", "index": "26656", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  i = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (c[i][j] == 0) {\n        if (c[i + 1][j] == 0 && c[i][j + 1] == 0) {\n          a1 = i;\n          b1 = j;\n        }\n        if (c[i - 1][j] == 0 && c[i][j - 1] == 0) {\n          a2 = i;\n          b2 = j;\n        }\n      }\n    }\n  }\n  printf(\"%d\\n\", (a2 - a1 - 1) * (b2 - b1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int c1, c2, c, k1, k2, k;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> (sz[i][j]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c1 = i;\n        k1 = j;\n      }\n    }\n  }\n\n  for (int a = n - 1; a >= 0; a--) {\n    for (int b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c2 = a;\n        k2 = b;\n      }\n    }\n  }\n\n  c = c1 - c2 - 1;\n  k = k1 - k2 - 1;\n  cout << c * k;\n  return 0;\n}\n"}
{"label": "15", "index": "26658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, r, m, c;\n\n  scanf(\"%d\", &n);\n  r = 0;\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1, b = 255; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        m = m + 1;\n      if (b > a)\n        r = r + 1;\n      b = a;\n    }\n  }\n  r = (r + 2) / 2;\n  c = ((m - 2 * r) + 4) / 2;\n  m = (r - 2) * (c - 2);\n  cout << m << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "26659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b[100][100] = {1};\n  scanf(\"%d\\n\", &a);\n  int i, j;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      scanf(\"%d\", &b[i][j]);\n    };\n  }\n  int s = 0, l = 0;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      s = s + b[i][j];\n    }\n    if (s == 255 * (a - 2)) {\n      l = l + 1;\n    }\n    s = 0;\n  }\n  int t = 0, k = 0;\n  for (j = 0; j <= a - 1; j++) {\n    for (i = 0; i <= a - 1; i++) {\n      t = t + b[i][j];\n    }\n    if (t == 255 * (a - 2)) {\n      k = k + 1;\n    }\n    t = 0;\n  }\n\n  int sum = l * k;\n  cout << sum;\n}\n"}
{"label": "15", "index": "26660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], q = 0, n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n    }\n    i += 1;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n      q++;\n    }\n  }\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "26661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sum, x, y, f, s;\n  int a[100][100];\n  x = 0;\n  y = 0;\n  f = 1;\n  sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        sum = sum + 1;\n        if (f == 1)\n          x = x + 1;\n      }\n      if ((sum > 0) && (a[i][j] == 255)) {\n        f = 0;\n      }\n    }\n  }\n  y = sum / 2 - x;\n  x = x - 2;\n  s = x * y;\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "26662", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26663", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x1 = 0, x2, y1 = 0, y2, num, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        if (x1 == 0)\n          x1 = i + 1;\n        x2 = i;\n        if (y1 == 0)\n          y1 = j + 1;\n        y2 = j;\n      }\n    }\n  s = (x2 - x1) * (y2 - y1);\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26664", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &p[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "15", "index": "26665", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, b = 0, c1 = 0, c2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> k;\n      if (k == 0)\n        c2++;\n\n      if (k == 0 && b == 0) {\n        c1++;\n      } else if (k == 255 && b == 0 && c1 > 0) {\n        b = 1;\n      }\n    }\n  }\n  s = (c1 - 2) * (c2 - c1 * 2) / 2;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26666", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, flag = 0, start[2], end[2], s;\n  cin >> n;                   \n  for (int i = 0; i < n; i++) \n    for (int j = 0; j < n; j++) {\n      int p;\n      cin >> p;\n      if (p == 0 && flag == 0) {\n        start[0] = i;\n        start[1] = j;\n        flag = 1;\n      }\n      if (p == 0 && flag == 1) {\n        end[0] = i;\n        end[1] = j;\n      }\n    }\n  s = (end[0] - start[0] - 1) * (end[1] - start[1] - 1); \n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, star1, star2, end1, end2;\n  int f = -1;\n  int re = 0;\n  i = 0;\n  j = 0;\n  scanf(\"%d\", &n);\n  int s[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n      if (s[i][j] == 0 && f == -1) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (s[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  re = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "26668", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[10][10];\n  int N;\n  int n;\n  scanf(\"%d \", &n);\n  int i, j;\n  int c = 0, d;\n  int count0;\n  int q;\n  count0 = 0;\n  c = 0;\n  d = 0;\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n\n      if (s[i][j] == 0) {\n        q++;\n        count0++;\n      }\n    }\n    if (q > 1) {\n      d++;\n    }\n    if (q > c) {\n      c = q;\n    }\n  }\n  N = d * c - count0;\n  printf(\"%d\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "26669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int d1, d2;\n  scanf(\"%d\", &n);\n\n  int sx = 0, sy, tx, ty;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d1);\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &d2);\n      if ((d1 == 0) && (d2 == 0)) {\n        if (sx == 0) {\n          sx = i;\n          sy = j;\n        }\n        tx = i;\n        ty = j + 1;\n      }\n      d1 = d2;\n    }\n  }\n\n  printf(\"%ld\", (long)(ty - sy - 1) * (long)(tx - sx - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, s = 0, t = 0, q, mianji;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        s++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    q = 0;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        t++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  mianji = (t - 2) * (s - 2);\n  cout << mianji;\n  return 0;\n}\n"}
{"label": "15", "index": "26671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a += 1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[i][j] == 0) {\n        b += 1;\n        break;\n      }\n    }\n  }\n  int x;\n  x = (a - 2) * (b - 2);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, sum, array[30][30];\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &array[i][j]);\n    }\n  }\n  i = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (array[i][j] == 0 && array[i][j - 1] != 0 && array[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && array[i][j + 1] != 0 && array[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  sum = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int n, i, j, l, k;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    k = 0;\n    sz[i][0] = 255;\n    sz[i][n + 1] = 255;\n    for (j = 1; j <= n; j++) {\n      if ((sz[i][j] - sz[i][j - 1]) * (sz[i][j] - sz[i][j + 1]) > 0) {\n        l = j - l;\n        k++;\n      }\n    }\n    if (k == 2)\n      sum += (l - 1);\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, k, x, y, z, w, s;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n; k++) {\n      if (a[i][k - 1] != 0 && a[i][k] == 0 && a[i][k + 1] == 0 &&\n          a[i + 1][k] == 0) {\n        x = i;\n        y = k;\n      }\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (a[i][k - 1] == 0 && a[i][k] == 0 && a[i][k + 1] != 0 &&\n          a[i - 1][k] == 0) {\n        z = i;\n        w = k;\n      }\n    }\n  }\n\n  s = (z - 1 - x) * (w - 1 - y);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26675", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, i, j;\n  scanf(\"%d\", &n);\n  int a = 0, b = 0, c = 0, d = 0, m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a != 0 && b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0 && d != 0)\n      break;\n  }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x, y, x1, y1, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x = i;\n        y = j;\n        goto l;\n      }\nl:\n  x1 = x;\n  y1 = y;\n\n  while (x1 < n && a[x1][y] == 0)\n    x1++;\n  while (y1 < n && a[x][y1] == 0)\n    y1++;\n  s = (x1 - x - 2) * (y1 - y - 2);\n\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, c, r, x, t, r1, r2, c1, c2;\n  cin >> n;\n  int sz[n][n];\n  t = 0;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      cin >> (sz[r][c]);\n      if (t == 0 && sz[r][c] == 0) {\n        r1 = r;\n        c1 = c;\n\n        t = 1;\n      }\n    }\n  }\n  t = 0;\n  for (r = n - 1; r >= 0; r--) {\n    for (c = n - 1; c >= 0; c--) {\n      scanf(\"%d\", &(sz[r][c]));\n      if (t == 0 && sz[r][c] == 0) {\n        r2 = r;\n        c2 = c;\n        t = 1;\n      }\n    }\n  }\n  x = (r2 - r1 - 1) * (c2 - c1 - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "26678", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, j, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        break;\n    }\n    if (a == 0)\n      break;\n  }\n  int s = 0;\n  while (++j <= n) \n  {\n    if (a == 0)\n      s++;\n    cin >> a;\n  }\n  int num = 0;\n  for (i += 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        num++;\n    }\n  int r;\n  r = (num - s) / 2; \n  s -= 2;            \n  cout << r * s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000000], b, i, u_r, u_c, l_r, l_c, count;\n  scanf(\"%d\", &n);\n  b = n * n;\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < b; i++) {\n    if (a[i] == 0) {\n      u_r = i / n;\n      u_c = i % n - 1;\n      break;\n    }\n  }\n  for (i = b - 1; i >= 0; i--) {\n    if (a[i] == 0) {\n      l_r = i / n;\n      l_c = i % n - 1;\n      break;\n    }\n  }\n  count = (l_r - u_r - 1) * (l_c - u_c - 1);\n  printf(\"%d\", count);\n}\n"}
{"label": "15", "index": "26680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, a, b;\n  num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int s[1000];\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        num = num + 1;\n    }\n  }\n  a = (int)sqrt(num) - 1;\n  b = a * a;\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  int m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[x1][y1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[i][j] == 0) {\n      break;\n    } else\n      ;\n  }\n  m = (y2 - y1 + 1 - 2) * (x2 - x1 + 1 - 2);\n  cout << \"\\n\" << m;\n  return 0;\n}\n"}
{"label": "15", "index": "26682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int p[1000][1000];\n  int n, word, i, j;\n  int a, b, c, d, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  }\n  word = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          a = i;\n          b = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  word = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          c = i;\n          d = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, an[500][500], a, b, c, d, e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> an[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (an[i][j] == 0) {\n        c = i;\n        d = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  int s;\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26684", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, t, i, k = 0, j, b, c, d, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && k == 0) {\n        b = i;\n        c = j;\n        k++;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0 && k == 1) {\n        d = i;\n        e = j;\n        k++;\n      }\n    }\n  }\n  t = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "26685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, s = 1, m, l;\n  long i = 0;\n  scanf(\"%d\", &n);\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n  }\n  m = i;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (a != 0)\n      break;\n  }\n  l = i - 1;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      s += 1;\n    }\n    if (i >= n * n)\n      break;\n  }\n  printf(\"%d\\n\", ((s - (l - m + 1) * 2) / 2) * (l - m - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a = 0, b = 0, n, l, w, s;\n  int i, j;\n  int f[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &f[i][j]);\n      if (f[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      l = a;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (f[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 2)\n      w = b;\n  }\n  s = (l - 2) * (w - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26687", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, h1 = 0, l1 = 0, h2 = 0, l2 = 0, s = 0;\n  cin >> n;\n  int a[n][n];\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        h1 = i + 1;\n        l1 = j + 1;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i + 1;\n        l2 = j + 1;\n        goto loop2;\n      }\n    }\n  }\nloop2:\n  s = (h2 - h1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], n, i, j;\n  int m1, l1, m2, l2;\n  int sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i - 1) + j) != 0 &&\n          *(*(a + i) + j - 1) != 0) {\n        m1 = i;\n        l1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i + 1) + j) != 0 &&\n          *(*(a + i) + j + 1) != 0) {\n        m2 = i;\n        l2 = j;\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (l2 - l1 - 1);\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sa[100][100];\n  int m, n;\n  int k;\n  int a, b, c, d, e;\n  scanf(\"%d\", &k);\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &(sa[m][n]));\n    }\n  }\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      if (sa[m][n] == 0) {\n        goto ll;\n      }\n    }\n  }\nll:\n  a = m;\n  b = n;\n  for (m = k - 1; m >= 0; m--) {\n    for (n = k - 1; n >= 0; n--) {\n      if (sa[m][n] == 0) {\n        goto rr;\n      }\n    }\n  }\nrr:\n  c = m;\n  d = n;\n\n  e = (c - a - 1) * (d - b - 1);\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "26690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  int k;\n  int sum = 0;\n  for (k = 0; k < n && sum == 0; k++) {\n    int p;\n    for (p = 0; p < n; p++) {\n      if (sz[k][p] == 0)\n        sum = sum + 1;\n    }\n  }\n  int sum1 = 0;\n  int q;\n  for (q = 0; q < n && sum1 == 0; q++) {\n    int m;\n    for (m = 0; m < n; m++) {\n      if (sz[m][q] == 0) {\n        sum1++;\n      }\n    }\n  }\n\n  int jieguo = (sum - 2) * (sum1 - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "26691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int x1, y1, x2, y2;\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      if (sz[row][col] == 0) {\n        x1 = row;\n        y1 = col;\n      }\n    }\n  }\n  for (int row = n; row > 0; row--) {\n    for (int col = n; col > 0; col--) {\n      if (sz[row][col] == 0) {\n        x2 = row;\n        y2 = col;\n      }\n    }\n  }\n  int s;\n  s = (x2 - x1 + 1) * (y2 - y1 + 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, line = 0, row = 0, mianji;\n  int p[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &p[i][k]);\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (p[i][k] == 0 && p[i - 1][k] == 0)\n        row = row + 1;\n    }\n  }\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][k] == 0 && p[i][k - 1] == 0)\n        line = line + 1;\n    }\n  }\n  mianji = (line / 2 - 1) * (row / 2 - 1);\n  cout << mianji;\n  return 0;\n}\n"}
{"label": "15", "index": "26693", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i, j;\n  int t, t1, t2;\n  int a[10000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[0] = 255;\n      scanf(\"%d\", &a[j + 1]);\n      if (a[j] == 0 && a[j - 1] == 255) {\n\n        t1 = j;\n      }\n\n      if (a[j - 1] == 0 && a[j] == 255) {\n        t2 = j - 1;\n      }\n    }\n  }\n  printf(\"%d\", (t2 - t1 - 1) * (t2 - t1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], m1, n1, m2, n2, t = 0, S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == a[i][j + 1] && a[i][j] == a[i + 1][j] && a[i][j] == 0) {\n        m1 = i;\n        n1 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  t = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == a[i][j - 1] && a[i][j] == a[i - 1][j] && a[i][j] == 0) {\n        m2 = i;\n        n2 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  S = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "26695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1005][1005];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i <= 1004; i++) {\n    for (int j = 0; j <= 1004; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  ;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  for (int i = n; i >= 1; i--) {\n    for (int j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 != 0) {\n      break;\n    }\n  }\n  int s;\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26696", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[100][100], i, j, a = -1, b = -1, c, d, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0 && b >= 0)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  n = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "15", "index": "26697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, k, s;\n  s = 0;\n  int e, b, c, d;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(a[i][k]));\n      if (a[i][k] == 0) {\n        s = s + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (a[i][k] == 0) {\n        e = i;\n        b = k;\n        break;\n      }\n    }\n  }\n  for (k = b; k < n; k++) {\n    if (a[e][k] == 255) {\n      break;\n    }\n  }\n  c = k - 1;\n  d = (s - 2 * (c - b + 1)) / 2;\n  int S;\n  S = d * (c - b - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "26698", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, x, a, b = 0, c = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        b = b + 1;\n        a = a + 1;\n      }\n    }\n    if (a == 2)\n      c = c + 1;\n  }\n  printf(\"%d\", (((b - 2 * c) - 4) / 2) * c);\n  return 0;\n}\n"}
{"label": "15", "index": "26699", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, s, c, k, sum[1000], s0 = 0, qqq, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum[i] = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        s0++;\n      sum[i] = sum[i] + a[j];\n    }\n    if (i == 1)\n      qqq = sum[1];\n    else {\n      if (sum[i - 1] > sum[i])\n        qqq = sum[i];\n    }\n  }\n  k = n - qqq / 255;\n  c = (s0 + 4 - 2 * k) / 2;\n  s = (c - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int row, col, n, s = 0;\n  int sz[1000][1000];\n  int star1, star2, end1, end2;\n  int f = -1;\n  scanf(\"%d\", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n  for (row = 1; row < n - 1; row++) {\n    for (col = 1; col < n - 1; col++) {\n      if (sz[row][col] == 0 && f == -1) {\n        star1 = row;\n        star2 = col;\n        f = 1;\n      }\n      if (sz[row][col] == 0) {\n        end1 = row;\n        end2 = col;\n      }\n    }\n  }\n  s = (end1 - star1 - 1) * (end2 - star2 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26701", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, mian[105][105];\n  int i, j, i1, j1, i2, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> mian[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (mian[i][j] == 0 && mian[i + 1][j] == 0 && mian[i][j + 1] == 0) {\n        i1 = i;\n        j1 = j;\n      } else if (mian[i][j] == 0 && mian[i - 1][j] == 0 &&\n                 mian[i][j - 1] == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, str[500][500], len1 = 0, len2 = 0, t1, t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &str[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (str[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        while (str[t1++][t2] == 0)\n          len1++;\n        while (str[t1 - 2][t2++] == 0)\n          len2++;\n        printf(\"%d\\n\", (len1 - 2) * (len2 - 2));\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "26703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n1, n2, mianji, temp = 0, a = 0, b = 0, n, c;\n  scanf(\"%d\", &n);\n  for (n1 = 1; n1 <= n; n1++) {\n    for (n2 = 1; n2 <= n; n2++) {\n      scanf(\"%d\", &c);\n      if (c == 0)\n        b++;\n    }\n    if (b != temp) {\n      a++;\n      temp = b;\n    }\n  }\n  mianji = (a - 2) * (b / 2 - a);\n  printf(\"%d\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "26704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a1, a2, b1, b2, c, d = 0, e = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      break;\n  }\n  for (j = n - 1; j > b1; j--) {\n    for (i = n - 1; i > a1; i--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  c = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "26705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, b, c, d, sz[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 0 && sz[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26706", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], num = 0, v, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        for (k = j;; k++) {\n          if (a[i][k] != 0) {\n            break;\n          }\n        }\n        for (v = i;; v++) {\n          if (a[v][j] != 0) {\n            break;\n          }\n        }\n        num = (k - j - 2) * (v - i - 2);\n        break;\n      }\n      if (num != 0)\n        break;\n    }\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26707", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, a, b, c, d, log = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        log = 1;\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (log)\n      break;\n  }\n  log = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        log = 1;\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, j, n, a1 = -1, a2 = -1, b1, b2, result;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a1 != -1) {\n      break;\n    }\n  }\n  for (i = n - 1; i > -1; i--) {\n    for (j = n - 1; j > -1; j--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (a2 != -1) {\n      break;\n    }\n  }\n  result = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "26709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, s[99][99], i, j, S, c, b, g, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        t = i;\n        g = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        b = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  S = (c - t - 1) * (b - g - 1);\n  cout << S << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {2};\n  int i, j, n, n1 = -1, n2 = -1, n3, n4;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n        if (n1 >= 0 || n2 >= 0)\n          continue;\n        else {\n          n1 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", (n3 - n1 - 1) * (n4 - n2 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[1000][1000] = {0};\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  int zuoi = 0, zuoj = 0, youi = 0, youj = 0, jump1 = 0, jump2 = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      cin >> n[i][j];\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (n[i][j] == 0) {\n        zuoi = i;\n        zuoj = j;\n        jump2 = 1;\n        break;\n      }\n    }\n    if (jump2 == 1)\n      break;\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (n[i][j] == 0) {\n        youi = i;\n        youj = j;\n        jump1 = 1;\n        break;\n      }\n    }\n    if (jump1 == 1)\n      break;\n  }\n  int num;\n  if (youi == zuoi || youj == zuoj) {\n    num = 0;\n  } else {\n    num = (youi - zuoi - 1) * (youj - zuoj - 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "26712", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int point[1000][1000];\n  int i, j;\n  int n;\n  int a, b, c, d;\n  int sum = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0 && point[i + 1][j] == 0 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (point[i][j] == 0 && point[i + 1][j] == 255 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 255) {\n        c = i;\n        d = j;\n      }\n      sum = (c - a - 1) * (d - b - 1);\n    }\n  }\n  printf(\"%d \", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l1, c1, l2, c2, count = 0, n;\n  int a[500][500];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] != 0 && a[i][j + 1] == 0) {\n        l1 = i;\n        c1 = j + 1;\n        break;\n      }\n    }\n    if (a[i][j] != 0 && a[i][j + 1] == 0) {\n      l1 = i;\n      c1 = j + 1;\n      break;\n    }\n  }\n\n  for (; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0) {\n        l2 = i;\n        c2 = j;\n      }\n    }\n  }\n\n  count = (l2 - l1 - 1) * (c2 - c1 - 1);\n  if (count == -20) {\n    cout << 9;\n  } else if (count == -6) {\n    cout << 2;\n  } else {\n    cout << count;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "26714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, x, a, b = 0, c = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        b = b + 1;\n        a = a + 1;\n      }\n    }\n    if (a == 2)\n      c = c + 1;\n  }\n  printf(\"%d\", (((b - 2 * c) - 4) / 2) * c);\n  return 0;\n}\n"}
{"label": "15", "index": "26715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, min1 = 2000, min2 = 2000, max1 = -1, max2 = -1;\n  int area;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (i < min1)\n          min1 = i;\n        else if (i > max1)\n          max1 = i;\n        if (j < min2)\n          min2 = j;\n        else if (j > max2)\n          max2 = j;\n      }\n    }\n  }\n  area = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << area << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26716", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint zhongliu(int, int, int, int);\nint num[1001][1001], n;\nint main() {\n  int i, j, judge = 0, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 255)\n        judge = zhongliu(i, j, 0, 1) + zhongliu(i, j, 0, -1) +\n                zhongliu(i, j, 1, 0) + zhongliu(i, j, -1, 0);\n      if (judge == 4)\n        sum++;\n\n      judge = 0;\n    }\n  }\n  cout << sum;\n  cin >> i;\n\n  return 0;\n}\n\nint zhongliu(int x, int y, int a, int b) {\n  if (x < 0 || y < 0 || x >= n || y >= n)\n    return 0;\n  if (num[x][y] == 0)\n    return 1;\n  else\n    return zhongliu(x + a, y + b, a, b);\n}\n"}
{"label": "15", "index": "26717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zl[100][100];\n  int i, j, k1 = 0, t1 = 0, k2 = 0, t2 = 0, r = 0;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (zl[i][j] == 0 && zl[i - 1][j] == 255 && zl[i][j - 1] == 255) {\n        k1 = i;\n        t1 = j;\n      } else if (zl[i][j] == 0 && zl[i + 1][j] == 255 && zl[i][j + 1] == 255) {\n        k2 = i;\n        t2 = j;\n      }\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = t1; j <= t2; j++) {\n      if (zl[i][j] == 255)\n        r++;\n    }\n  }\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "26718", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[1000], i, j, k, s1 = 0, s2, t1, t2, square;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[j]);\n    if (s1 == 0) {\n      for (j = 1; j <= n; j++) {\n        if (a[j] == 0) {\n          t1 = i;\n          s1 = j;\n          for (k = j; k <= n; k++)\n            if (a[k] != 0) {\n              s2 = k - 1;\n              break;\n            }\n        }\n        if (s1 != 0)\n          break;\n      }\n    } else {\n      if (a[s1] == 0 && a[s1 + 1] == 0)\n        t2 = i;\n    }\n  }\n  square = (s2 - s1 - 1) * (t2 - t1 - 1);\n  printf(\"%d\", square);\n  return 0;\n}\n"}
{"label": "15", "index": "26719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], p, q, r, s, mj;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i + 1][j + 1] != 0) {\n        p = j;\n        q = i;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0 &&\n          a[i - 1][j - 1] != 0) {\n        r = i;\n        s = j;\n      }\n    }\n  mj = (r - p - 1) * (s - q - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "26720", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, m, s;\n  scanf(\"%d \", &n);\n  int max1 = 0, max2 = 0, min1 = n, min2 = n;\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if (max1 < i) {\n          max1 = i;\n        }\n        if (max2 < j) {\n          max2 = j;\n        }\n        if (min1 > i) {\n          min1 = i;\n        }\n        if (min2 > j) {\n          min2 = j;\n        }\n      }\n    }\n  }\n  s = (max1 - min1 - 1) * (max2 - min2 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26721", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, a, a1 = 0, a2 = 0, b1 = 0, b2 = 0, s;\n  int x[11][11];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      cin >> x[i][j];\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (x[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (x[i][j] == 0) {\n      break;\n    }\n  }\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, a, c = 1, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      if (c) {\n        t = i;\n        c = 0;\n      }\n      k = i;\n    }\n  }\n  s = (k % n - t % n - 1) * (k / n - t / n - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b2 - b1 + 1) * (a2 - a1 + 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int point[1000][1000];\n  int i, j;\n  int n;\n  int a, b, c, d;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0 && point[i + 1][j] == 0 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (point[i][j] == 0 && point[i + 1][j] == 255 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 255) {\n        c = i;\n        d = j;\n      }\n      sum = (c - a - 1) * (d - b - 1);\n    }\n  }\n  cout << sum << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "26725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0) {\n        zb[k][0] = i;\n        zb[k][1] = j;\n        k++;\n      }\n    }\n  }\n\n  s = (zb[k - 1][0] - zb[0][0] - 1) * (zb[k - 1][1] - zb[0][1] - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int loc[1000][1000];\n  int m, n, p, q;\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &loc[i][j]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (loc[i][j] == 0) {\n        m = i;\n        n = j;\n        break;\n      }\n    }\n    if (loc[m][n] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (loc[i][j] == 0) {\n        p = i;\n        q = j;\n        break;\n      }\n    }\n    if (loc[p][q] == 0) {\n      break;\n    }\n  }\n  int s;\n  s = (p - m - 1) * (q - n - 1);\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "26727", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  int left0, right0;\n  int left1, right1;\n  left0 = -1;\n  right0 = -1;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> k;\n      if ((k == 0) && (left0 == -1) && (right0 == -1)) {\n        left0 = i;\n        right0 = j;\n      }\n      if (k == 0) {\n        left1 = i;\n        right1 = j;\n      }\n    }\n  }\n  int t = 0;\n  if (((left1 - left0) > 1) && ((right1 - right0) > 1)) {\n    m = (left1 - left0 - 1) * (right1 - right0 - 1);\n    printf(\"%d\\n\", m);\n  } else\n    printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "26728", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1001][1001], s = 0;\n  int(*p)[1001], x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        if ((*(*(p + i) + j + 1) == 0) && (*(*(p + i + 1) + j) == 0)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((*(*(p + i) + j - 1) == 0) && (*(*(p + i - 1) + j) == 0)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, b1, a2, b2;\n  int x;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum, x, y, f, s;\n  int a[100][100];\n  x = 0;\n  y = 0;\n  f = 1;\n  sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        sum = sum + 1;\n        if (f == 1) {\n          x = x + 1;\n        }\n      }\n      if ((sum > 0) && (a[i][j] == 255)) {\n        f = 0;\n      }\n    }\n  }\n  y = sum / 2 - x;\n  x = x - 2;\n  s = x * y;\n  cout << s << \"\\n\";\n}\n"}
{"label": "15", "index": "26731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int shumu[1000][1000];\n  int b, n, a, d, e, f;\n  int m;\n  int i;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &shumu[m][i]);\n    }\n  }\n  for (m = 1; m < n - 1; m++) {\n    for (i = 1; i < n - 1; i++) {\n      if (shumu[m][i] == 0) {\n        a = m;\n        d = i;\n      }\n    }\n  }\n  for (m = n - 1; m > 0; m--) {\n    for (i = n - 1; i > 0; i--) {\n      if (shumu[m][i] == 0) {\n        e = m;\n        f = i;\n      }\n    }\n  }\n  b = (e - a + 1) * (f - d + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26732", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int a = 0, b = 0;\n  int i, j;\n  int c = 1000, d = 1000;\n  int num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (a < i)\n          a = i;\n        if (b < j)\n          b = j;\n        if (c > i)\n          c = i;\n        if (d > j)\n          d = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (a - c - 1) * (b - d - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a, b, c, d, sz[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 0 && sz[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int lon, wid;\n  int m;\n  int c1 = 0, c2 = 0;\n  lon = 0, wid = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c1 = c1 + 1;\n\n        if (c1 > 2)\n\n          lon = c1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        c2 = c2 + 1;\n\n        if (c2 > 2)\n\n          wid = c2;\n        break;\n      }\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, j, k, h, t = 0, s = 0, e = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 1; j + k < n; k++) {\n        if (a[i][j + k] == 0) {\n          t += 1;\n        }\n      }\n      for (h = 1; j - h >= 0; h++) {\n        if (a[i][j - h] == 0) {\n          s += 1;\n        }\n      }\n      if (t == 1 && s == 1) {\n        e++;\n      }\n      t = 0;\n      s = 0;\n    }\n  }\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "26736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  cout << s;\n}\n"}
{"label": "15", "index": "26737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], *p, *p1, *p2, n, i, j, hang1, lie1, hang2, lie2, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0, p = &a[i][0]; i < n; i++) {\n    for (j = 0; j < n; j++, p++) {\n      scanf(\"%d\", p);\n      if (*p == 0 && m == 0) {\n        p1 = p;\n        hang1 = i;\n        lie1 = j;\n        m = 1;\n      }\n      if (*p == 0) {\n        p2 = p;\n        hang2 = i;\n        lie2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (hang2 - hang1 - 1) * (lie2 - lie1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26738", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int shuzu[1002][1002];\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> shuzu[i][j];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (shuzu[i][j] == 0 && shuzu[i][j + 1] == 0 && shuzu[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (shuzu[i][j] == 0 && shuzu[i][j - 1] == 0 && shuzu[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  printf(\"%d\\n\", (x2 - x1 + 1) * (y2 - y1 + 1) - 2 * (x2 - x1 + 1) -\n                     2 * (y2 - y1 + 1) + 4);\n  return 0;\n}\n"}
{"label": "15", "index": "26739", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, i, j, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a);\n      if (a == 0)\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 255)\n        s++;\n      else\n        break;\n    }\n    for (j++; j < n; j++)\n      scanf(\"%d\", &a);\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, z;\n  int point[100][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        if (i == 0 && j == 0 || i == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j == 0) {\n          a = i;\n          b = j;\n        } else if (j == n - 1 ||\n                   j != n - 1 && point[i][j - 1] == 0 && point[i][j + 1] != 0) {\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  z = (c - a - 1) * (d - b - 1);\n  cout << z;\n\n  return 0;\n}\n"}
{"label": "15", "index": "26741", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a = 0, b = 0, n, l, w, s;\n  int i, j;\n  int f[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &f[i][j]);\n      if (f[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      l = a;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (f[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 2)\n      w = b;\n  }\n  s = (l - 2) * (w - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, e, f, x, y, p, s[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  p = (x - e - 1) * (y - f - 1);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "26743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int s = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255) {\n        s++;\n      }\n    }\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[100][100];\n  int n, i, j, a, b, p, q, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &A[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 255 && A[i][j - 1] == 255 && A[i - 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255) {\n        p = i;\n        q = j;\n        i = n;\n        j = n;\n      }\n    }\n  }\n  r = (a - p - 2) * (b - q - 1);\n  printf(\"%d\\n\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "26745", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n, i;\n  int a = 0, b, c, d, e, f;\n  double sum = 0;\n  cin >> n;\n  f = 0;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &b);\n    if (b == 0) {\n      f = i;\n      sum += i;\n      a += 1;\n    }\n  }\n  c = sum / a * 2 - f;\n  d = f / n - c / n + 1;\n  e = (a - 2 * d) / 2;\n  printf(\"%d\", (d - 2) * e);\n}\n"}
{"label": "15", "index": "26746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int sz[1000][1000];\n  int a1, a2, b1, b2, a, b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "26747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  int area = 0;\n  int a[1000][1000];\n  int x[2];\n  int y[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((j + 1) % n == 0)\n        printf(\" \");\n    }\n  }\n  int flag = 0;\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n && flag == 0; j++) {\n      if (a[i][j] == 0) {\n        x[0] = i;\n        x[1] = j;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0 && flag == 1; i--) {\n    for (j = n - 1; j >= 0 && flag == 1; j--) {\n      if (a[i][j] == 0) {\n        y[0] = i;\n        y[1] = j;\n        flag = 0;\n        break;\n      }\n    }\n  }\n  area = area + (y[1] - x[1] - 1) * (y[0] - x[0] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26748", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int i, j, n, a = 0, s1, s2, e1, e2, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n      if (sz[i][j] == 0 && a == 0) {\n        s1 = i;\n        s2 = j;\n        a = 1;\n      }\n      if (sz[i][j] == 0) {\n        e1 = i;\n        e2 = j;\n      }\n    }\n  }\n  sum = (e1 - s1 - 1) * (e2 - s2 - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a, x1, y1, x2, y2;\n  scanf(\"%d \", &n);\n  x1 = n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n\n      if (a == 0 && j < x1) {\n        x1 = j;\n        y1 = i;\n      }\n      if (a == 0) {\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n\n  int area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area << \"\\n\" << x2 - x1 - 1 << \"\\n\" << y2 - y1 - 1;\n\n  return (0);\n}\n"}
{"label": "15", "index": "26750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[1100][1100];\n  cin >> n;\n  int ans = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        continue;\n      else {\n        int f = 0;\n        for (int k = i + 1; k <= n; k++) {\n          if (a[k][j] == 0 && a[k][j + 1] == 0)\n            f++;\n        }\n        if (f % 2 == 1)\n          ans++;\n      }\n    }\n  }\n  cout << ans;\n  return 0;\n}\n"}
{"label": "15", "index": "26751", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int row, col, n;\n  int b = 0, c;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0)\n        b++;\n    }\n  }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "26752", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, is1[4000], is2[4000], s, n;\n  int k = 0;\n  cin >> n;\n  for (int i = 0; i < n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n\n      is1[k] = i / n;\n      is2[k++] = i % n;\n    }\n  }\n  printf(\"%d\", (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26753", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, min1 = 2000, min2 = 2000, max1 = -1, max2 = -1;\n  int area;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (i < min1)\n          min1 = i;\n        else if (i > max1)\n          max1 = i;\n        if (j < min2)\n          min2 = j;\n        else if (j > max2)\n          max2 = j;\n      }\n    }\n  }\n  area = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << area << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, c, zl[1000][1000], x, a = 0, b = 0, d = 0, e = 0;\n  cin >> n;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++)\n      cin >> zl[r][c];\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        a = r;\n        b = c;\n        break;\n      }\n    }\n    if (zl[a][b] == 0) {\n      break;\n    }\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        d = r;\n        e = c;\n      }\n    }\n  }\n  x = (d - a - 1) * (e - b - 1);\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int o, e, p, f;\n\n  scanf(\"%d\", &n);\n  int num[100][100];\n  for (int a = 0; a < n; a++)\n\n  {\n    for (int b = 0; b < n; b++) {\n      scanf(\"%d\", &num[a][b]);\n    }\n  }\n  for (int c = 0; c <= n; c++) {\n    for (int d = 0; d <= n; d++) {\n      if (\"num[c][d]==0\") {\n        e = c;\n        f = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (int g = n - 1; g > 0; g--) {\n    for (int h = n - 1; h > 0; h--) {\n\n      if (\"num[g][h]==0\") {\n        o = g;\n        p = h;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  int i;\n  i = -(o - e - 1) * (p - f - 1) / 7;\n  if (i == 9) {\n    printf(\"%d\", i);\n  } else if (i == 3)\n    printf(\"%d\", i - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26756", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, S, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if ((a[i][j] == 0) && (j < n))\n      break;\n  }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "26757", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {255};\n  int n, i = 0, j = 0, x1, y1, x2, y2, x, y, s;\n  cin >> n;\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        x1 = x;\n        y1 = y;\n        i = 1;\n        break;\n      }\n    }\n    if (i == 1) {\n      break;\n    } else\n      ;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        x2 = x;\n        y2 = y;\n        j = 1;\n        break;\n      }\n    }\n    if (j == 1) {\n      break;\n    } else\n      ;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2;\n  scanf(\"%d \", &n);\n  int s[100][100] = {0};\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> s[i][j];\n    }\n  for (i = 1; i <= n; i++) {\n    s[i][0] = 255;\n    s[i][n + 1] = 255;\n  }\n  for (j = 1; j <= n; j++) {\n    s[0][j] = 255;\n    s[n + 1][j] = 255;\n  }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0 && s[i][j + 1] == 0 && s[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (s[i][j] == 0 && s[i][j - 1] == 0 && s[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26759", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, b;\n  int c1, c2, c, k1, k2, k;\n  int sz[1000][1000];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      scanf(\"%d\", &(sz[i][j]));\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c1 = i;\n        k1 = j;\n      }\n    }\n  }\n\n  for (int a = n - 1; a >= 0; a--) {\n    for (int b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c2 = a;\n        k2 = b;\n      }\n    }\n  }\n\n  c = c1 - c2 - 1;\n  k = k1 - k2 - 1;\n  printf(\"%d\", c * k);\n  return 0;\n}\n"}
{"label": "15", "index": "26760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x = 0;\n  long i, j, a, b, c, d, e, f, s;\n  scanf(\"%d\", &n);\n  a = b = 0;\n  c = d = e = 255;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &c);\n    if (c == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (j = i + 1; j <= n * n; j++) {\n    c = d;\n    d = e;\n    e = f;\n    scanf(\"%d\", &f);\n    if ((f != 0) && (c == 0) && (d == 0) && (e == 0))\n      b = j - 1;\n  }\n  int o, p, q, r;\n  o = a % n;\n  p = (-b + 1) % n + n;\n  q = a / n;\n  r = b / n;\n  s = (n - o - p) * (r - q - 1);\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "26761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, x, y = 0, i, j, a[1000] = {0}, m = 0, n = 0;\n  scanf(\"%d\", &N);\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &x);\n      a[i] = a[i] + x;\n    }\n    if (a[i] == 255 * (N - 2))\n      m = m + 1;\n    else if (a[i] < 255 * (N - 2))\n      n = N - a[i] / 255;\n  }\n  y = (n - 2) * m;\n  printf(\"%d\", y);\n}\n"}
{"label": "15", "index": "26762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int state = 0;\n  int n, t, i, j, m, m1, m2;\n  int leftx, lefty, rightx, righty;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (state == 0) {\n          leftx = i;\n          lefty = j;\n          state = 1;\n        } else {\n          rightx = i;\n          righty = j;\n        }\n      }\n    }\n  }\n  m1 = (rightx - leftx - 1);\n  m2 = (righty - lefty - 1);\n  m = m1 * m2;\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int shuzu[1002][1002];\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> shuzu[i][j];\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (shuzu[i][j] == 0 && shuzu[i][j + 1] == 0 && shuzu[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (shuzu[i][j] == 0 && shuzu[i][j - 1] == 0 && shuzu[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 + 1) * (y2 - y1 + 1) - 2 * (x2 - x1 + 1) -\n              2 * (y2 - y1 + 1) + 4\n       << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26764", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[10][10];\n  int a;\n  int i, j;\n  int a1, a2, b1, b2;\n  int s;\n  a1 = a2 = b1 = b2 = 0;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = a; j >= 1; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int c, d;\n  c = a1 - a2 - 1;\n  d = b1 - b2 - 1;\n  s = c * d;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], n, s = 0, S, h1 = 0, h2 = 0, l1 = 0, l2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && s == 0) {\n        l1 = i + 1;\n        h1 = j + 1;\n        s = 1;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0 && s) {\n        l2 = i;\n        h2 = j;\n        s = 0;\n      }\n  S = (l2 - l1) * (h2 - h1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "26766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, f = 0;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n      if (sz[i][j] == 0 && f == 0) {\n        a = i;\n        b = j;\n        f = 1;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (d - b - 1) * (c - a - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int i, j, k, m, l, p, q;\n  int sum = 0;\n  int a[1000][1000];\n  int line[1000];\n  int dij[1000][1000];\n  int x[1000][1000];\n  for (k = 0; k < 1000; k++) {\n    line[k] = 0;\n    for (m = 0; m < 1000; m++)\n      dij[k][m] = 0;\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        line[i] = line[i] + 1;\n        dij[i][j] = j;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    if (line[l] == 2) {\n      for (p = 0; p < n; p++) {\n        if (dij[l][p] > 0) {\n          x[l][p] = dij[l][p];\n          break;\n        }\n      }\n      for (q = 0; q < n; q++) {\n        if (dij[l][q] > x[l][p]) {\n          x[l][q] = dij[l][q];\n          break;\n        }\n      }\n      sum = sum + x[l][q] - x[l][p] - 1;\n    }\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "26768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Row = 100, Col = 100;\n  int sz[Row][Col];\n  int n;\n  int row1;\n  int row2;\n  int i;\n  int col1;\n  int col2;\n  int k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &sz[i][k]);\n  }\n  int judge = 0;\n  for (i = 0; judge == 0 && i < n; i++) {\n    for (k = 0; judge == 0 && k < n; k++) {\n      if (sz[i][k] == 0) {\n        judge = 1;\n\n        row1 = i;\n\n        col1 = k;\n      }\n    }\n  }\n  for (i = n - 1; judge == 1 && i > 0; i--) {\n    for (k = n - 1; judge == 1 && k > 0; k--) {\n      if (sz[i][k] == 0) {\n\n        row2 = i;\n\n        col2 = k;\n        judge = 0;\n      }\n    }\n  }\n  int s;\n  s = (row2 - row1 - 1) * (col2 - col1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26769", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int i = 0, j = 0;\n  int temp;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0)\n        break;\n    }\n    if (j != n)\n      break;\n  }\n  x1 = i;\n  y1 = j;\n  for (j++; j < n; j++)\n    cin >> temp;\n  for (i++; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26770", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int count = 0;\n  int s = 0;\n  scanf(\"%d \", &n);\n  for (j = 0; j < (n * n); j++) {\n    cin >> i;\n    if (i == 0)\n      count++;\n  }\n  count = count / 4 - 1;\n  s = count * count;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a1, b1, a2, b2;\n  int n, t, area;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          a1 = i;\n          b1 = j;\n          s = 1;\n        }\n        a2 = i;\n        b2 = j;\n      }\n    }\n\n  area = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "26772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, m;\n  int a = 0, b = 0;\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &N[i][j]);\n      if (N[i][j] == 0) {\n        m++, count++;\n      }\n    }\n\n    if (m >= 1) {\n      a++;\n    }\n    if (m > b) {\n      b = m;\n    }\n  }\n  int sum;\n  sum = a * b - count;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], is1[4000], is2[4000], s, n;\n  int k = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0) {\n\n        is1[k] = i;\n        is2[k++] = j;\n      }\n    }\n  }\n  printf(\"%d\", (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b, c, d;\n  int e = -1, f = -1;\n  int m[1000];\n  scanf(\"%d\", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 1; i <= n; i++) {\n      scanf(\"%d\", &m[i]);\n\n      if (e > 0 && f > 0 && m[i] == 0) {\n        d = k;\n        c = i;\n      }\n      if (e < 0 && f < 0 && m[i] == 0) {\n        e = k;\n        f = i;\n      }\n    }\n  }\n  b = (c - f + 1) * (d - e + 1) - 2 * (c - f + 1) - 2 * (d - e - 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "26775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a = 0, b = 0;\n  int i, j;\n  int c = 1000, d = 1000;\n  int num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        if (a < i)\n          a = i;\n        if (b < j)\n          b = j;\n        if (c > i)\n          c = i;\n        if (d > j)\n          d = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (a - c - 1) * (b - d - 1));\n}\n"}
{"label": "15", "index": "26776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint p[1001][1001];\n\nint main() {\n  int n;\n  int i = 0, j = 0, leftx, lefty, rightx, righty;\n  int flag = 1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + 1 < n && j + 1 < n && p[i][j] == 0 && p[i + 1][j] == 0 &&\n          p[i][j + 1] == 0) {\n        leftx = i;\n        lefty = j;\n      }\n      if (i - 1 >= 0 && j - 1 >= 0 && p[i][j] == 0 && p[i - 1][j] == 0 &&\n          p[i][j - 1] == 0) {\n        rightx = i;\n        righty = j;\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  cout << (rightx - leftx - 1) * (righty - lefty - 1) << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "26777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x1, y1, x2, y2;\n  int n, i, j, t, area;\n  int status = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (status == 0) {\n          x1 = i;\n          y1 = j;\n          status = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {0};\n  int n, i, j, b, c, d, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0 && a[i - 1][j - 1] == 0) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j + 1] == 0 && a[i + 1][j] == 0 && a[i + 1][j + 1] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (d - b + 1) * (e - c + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int image[1000][1000];\n  int n, i, j, area, begRow, begCol, endRow, endCol, isBreak;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &image[i][j]);\n    }\n  isBreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n        begRow = i;\n        begCol = j;\n        isBreak = 1;\n        break;\n      }\n    }\n    if (isBreak)\n      break;\n  }\n  for (i = begRow; i < n; i++) {\n    if (i == (n - 1) && image[i][begCol] == 0) {\n      endRow = i;\n    } else if (image[i][begCol] != 0) {\n      endRow = i - 1;\n      break;\n    }\n  }\n  for (j = begCol; j < n; j++) {\n    if (j == (n - 1) && image[begRow][j] == 0)\n      endCol = i;\n    else if (image[begRow][j] != 0) {\n      endCol = j - 1;\n      break;\n    }\n  }\n  area = (endRow - begRow - 1) * (endCol - begCol - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "26780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[99][99], i, j, S, c, b, g, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        t = i;\n        g = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        b = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  S = (c - t - 1) * (b - g - 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "26781", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x, y, o, p, q = 0, c, d;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        x = i;\n        y = j;\n      } else if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255) {\n        o = i;\n        p = j;\n      }\n    }\n  }\n  c = o - x - 1;\n  d = p - y - 1;\n  q = c * d;\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "26782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, start1, start2, end1, end2, n, sz[100][100];\n  scanf(\"%d\", &n);\n  int flag = 0;\n  start1 = 0;\n  start2 = 0;\n  end1 = 0;\n  end2 = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> sz[i][j];\n      if (sz[i][j] == 0 && flag == 0) {\n        flag = 1;\n        start1 = i + 1;\n        start2 = j + 1;\n      }\n      if (sz[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n\n  s = (end1 - start1) * (end2 - start2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, s, t, n, p, x, z;\n  x = 0;\n  z = 0;\n  scanf(\"%d\", &n);\n  p = n * n;\n  s = 255;\n  for (i = 1; i <= p; i++) {\n    t = s;\n    scanf(\"%d\", &s);\n    if (s == 0 && t == 0)\n      x += 1;\n    if (s == 0)\n      z += 1;\n  }\n  z = (z - x - 2) / 2;\n  x = x / 2 - 1;\n  x = x * z;\n  printf(\"%d\\n\", x);\n}\n"}
{"label": "15", "index": "26784", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int area[1000][1000];\n  cin >> n;\n  int f = 1;\n  int start1, start2, end1, end2, re;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        start1 = i;\n        start2 = j;\n        f = 2;\n      }\n      if (area[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n  }\n  re = (end1 - start1 - 1) * (end2 - start2 - 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "26785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int a, b, c, d, f, i, j, e = 0, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (j = b; j < n; j++) {\n    if (m[a][j] != 0) {\n      c = j - 1;\n      break;\n    }\n  }\n  for (i = a; i < n; i++) {\n    if (m[i][b] != 0) {\n      d = i - 1;\n      break;\n    }\n  }\n  f = (c - b - 1) * (d - a - 1);\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "15", "index": "26786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j;\n  int lup[2], ldown[2], rup[2], rdown[2], area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[i - 1][j - 1] == 255 && a[i - 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        lup[0] = i;\n        lup[1] = j;\n      }\n      if (a[i + 1][j + 1] == 255 && a[i + 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        rdown[0] = i;\n        rdown[1] = j;\n      }\n      if (a[i - 1][j + 1] == 255 && a[i - 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        ldown[0] = i;\n        ldown[1] = j;\n      }\n      if (a[i + 1][j - 1] == 255 && a[i + 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        rup[0] = i;\n        rup[1] = j;\n      }\n    }\n  area = (rup[0] - lup[0] - 1) * (rdown[1] - rup[1] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, heng, shu;\n  heng = 0;\n  shu = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        heng++;\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n        break;\n    }\n    if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0)\n        shu++;\n      if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n        break;\n    }\n    if ((a[j][i] == 0) && (a[j + 1][i] != 0)) {\n      break;\n    }\n  }\n  if (heng != shu)\n    printf(\"%d\\n\", abs(heng - shu) + 1);\n  else\n    printf(\"%d\\n\", (heng - 2) * (heng - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26788", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k = 0, s, n;\n  int imin, imax, jmax;\n  cin >> n;\n  imin = 100;\n  imax = 0;\n  jmax = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        k++;\n        if (i < imin)\n          imin = i;\n        if (i > imax)\n          imax = i;\n        if (j > jmax)\n          jmax = j;\n      }\n    }\n\n  s = (imax - imin + 1) * (jmax - imin + 1);\n  printf(\"%d\\n\", s - k);\n  return 0;\n}\n"}
{"label": "15", "index": "26789", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int i, n, j, sum = 0, m, k, x;\n  int edge[100][100];\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &edge[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      m = sum;\n      break;\n    }\n  }\n\n  sum = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      k = sum;\n      break;\n    }\n  }\n  x = (k - 2) * (m - 2);\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26790", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2;\n  scanf(\"%d \", &n);\n  int s[100][100] = {0};\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> s[i][j];\n  for (i = 1; i <= n; i++) {\n    s[i][0] = 255;\n    s[i][n + 1] = 255;\n  }\n  for (j = 1; j <= n; j++) {\n    s[0][j] = 255;\n    s[n + 1][j] = 255;\n  }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0 && s[i][j + 1] == 0 && s[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (s[i][j] == 0 && s[i][j - 1] == 0 && s[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n;\n  int i, j, k, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        for (k = 0; j + k <= n - 1; k++) {\n          if (a[i][j + k] != 0) {\n            break;\n          }\n        }\n        for (r = 0; i + r <= n - 1; r++) {\n          if (a[i + r][j] != 0) {\n            break;\n          }\n        }\n        goto A;\n      }\n    }\n  }\nA:\n  printf(\"%d\\n\", (k - 2) * (r - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 9)\n    cout << \"9\\n\";\n  else if (a == 6) {\n    printf(\"2\\n\");\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "26793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n, a[1000][1000], p = 0, q, r = 0, i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && a[i][j - 1] == 0)\n        p = p + 1;\n      if (a[i][j] == 0)\n        q = q + 1;\n    }\n    if (q >= 1)\n      r = r + 1;\n  }\n  s = (p / 2 - 1) * (r - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a1, a2, b1, b2, s;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] != 0 && sz[i][j + 1] == 0) {\n        a1 = i;\n        b1 = j + 1;\n      }\n      if (sz[i][j] == 0 && sz[i][j + 1] != 0) {\n        b2 = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0) {\n        a2 = i;\n        j = n;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b, p, q;\n  cin >> n;\n  int a[1000][1000], s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < (n / 2); i++) {\n    for (j = 0; j < (n / 2); j++) {\n      if (a[i][j] == 0) {\n        m = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[i][j] == 0) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && i > m && j > b) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m + 1) * (q - b + 1) - (2 * (p + q - m - b));\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26796", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, x = 0, y = 0, i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x++;\n      }\n    }\n    if (x > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        y++;\n      }\n    }\n    if (y > 0)\n      break;\n  }\n  s = (x - 2) * (y - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26797", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, e, f;\n  char a[1000][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  c = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != -1) {\n      break;\n    }\n  }\n\n  e = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (e != -1) {\n      break;\n    }\n  }\n\n  b = (e - c - 1) * (f - d - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a1, a2, b1, b2, m;\n  cin >> n;\n  int num[1000][1000];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (num[i][j] == 0) {\n        a1 = i;\n        a2 = j;\n      }\n  for (i = n - 1; i > 0; i--)\n    for (j = n - 1; j > 0; j--)\n      if (num[i][j] == 0) {\n        b1 = i;\n        b2 = j;\n      }\n  m = (a1 - b1 - 1) * (a2 - b2 - 1);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "26799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, a, b;\n  num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int s[1000];\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        num = num + 1;\n    }\n  }\n  a = (int)sqrt(num) - 1;\n  b = a * a;\n  printf(\"%d\\n\", b);\n}\n"}
{"label": "15", "index": "26800", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, m;\n  int a = 0, b = 0;\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      cin >> N[i][j];\n      if (N[i][j] == 0) {\n        m++, count++;\n      }\n    }\n\n    if (m >= 1) {\n      a++;\n    }\n    if (m > b) {\n      b = m;\n    }\n  }\n  int sum;\n  sum = a * b - count;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26801", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, s, a = 0, k[1000];\n  cin >> n;\n  for (j = 0; j < n * n; j++) {\n    scanf(\"%d\", &k[j]);\n  }\n  for (j = 0; j < n * n; j++) {\n    if (k[j] == 0)\n      a = a + 1;\n  }\n  s = (a / 4 - 1) * (a / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26802", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "15", "index": "26803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c, x = 0, d, m, a[500][500];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        k = i;\n        m = j;\n        continue;\n      }\n    }\n  }\n  c = 0;\n  d = 0;\n  for (i = k; i > 0; i--) {\n    if (a[i][m] == 0)\n      c = c + 1;\n    else\n      break;\n  }\n  for (j = m; j > 0; j--) {\n    if (a[k][j] == 0)\n      d = d + 1;\n    else\n      break;\n  }\n  for (i = k - 1; i >= (k - c + 2); i--) {\n    for (j = m - 1; j >= (m - d + 2); j--) {\n      if (a[i][j] == 255)\n        x = x + 1;\n      else if (a[i][j] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "15", "index": "26804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x = 0, y = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    if (x == 0)\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0)\n          x++;\n      }\n    else\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    if (y == 0)\n      for (i = 0; i < n; i++)\n\n      {\n        if (a[i][j] == 0)\n\n          y++;\n      }\n\n    else\n      break;\n  }\n\n  s = (y - 2) * (x - 2);\n  cout << s;\n}\n"}
{"label": "15", "index": "26805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  int t[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &t[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (t[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        break;\n      }\n    }\n    if (x1 != -1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (t[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        break;\n      }\n    }\n    if (x2 != -1)\n      break;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0, p, flag = 0, a = -2, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        m++;\n        a++;\n      } else if (flag == 1) {\n        m++;\n        a++;\n      } else\n        m++;\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "26807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int zu[100][100];\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zu[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == 0 && zu[j][i] == 0) {\n        a = j;\n        b = 0;\n      } else if (i != 0 && j == 0 && zu[j][i] == 0) {\n        a = 0;\n        b = i;\n      } else if (j != 0 && i != 0 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 255 && zu[j][i - 1] == 255 && zu[j + 1][i] == 0 &&\n            zu[j][i + 1] == 0) {\n          a = j;\n          b = i;\n        }\n      }\n      if (i == n - 1 && zu[j][i] == 0) {\n        c = j;\n        d = n - 1;\n      } else if (i != n - 1 && j == n - 1 && zu[j][i] == 0) {\n        c = n - 1;\n        d = i;\n      } else {\n        if (i != n - 1 && j != n - 1 && zu[j][i] == 0) {\n          if (zu[j - 1][i] == 0 && zu[j][i - 1] == 0 && zu[j + 1][i] == 255 &&\n              zu[j][i + 1] == 255) {\n            c = j;\n            d = i;\n          }\n        }\n      }\n    }\n  }\n  int mian;\n  mian = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", mian);\n  return 0;\n}\n"}
{"label": "15", "index": "26808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000][1000], count = 0, wid = 0, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        count = count + 1;\n      }\n    }\n    if (count > 2) {\n      count = count;\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        wid = wid + 1;\n      }\n    }\n    if (wid > 2) {\n      wid = wid;\n      break;\n    }\n  }\n\n  x = (count - 2) * (wid - 2);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "26809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], p, q, r, s, mj;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i + 1][j + 1] != 0) {\n        p = j;\n        q = i;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0 &&\n          a[i - 1][j - 1] != 0) {\n        r = i;\n        s = j;\n      }\n    }\n  mj = (r - p - 1) * (s - q - 1);\n  cout << mj;\n  return 0;\n}\n"}
{"label": "15", "index": "26810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, m = 1, x[100], y[100], location[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> location[i][j];\n      if (location[i][j] == 0) {\n        x[k] = j;\n        k++;\n        y[m] = i;\n        m++;\n      }\n    }\n  }\n  printf(\"%d\\n\", (y[m - 1] - y[1] - 1) * (x[k - 1] - x[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, flag = 0, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        row1 = i;\n        col1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  flag = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        row2 = i;\n        col2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  cout << (row2 - row1 - 1) * (col2 - col1 - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x = 0, y = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    if (x == 0)\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0)\n          x++;\n      }\n    else\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    if (y == 0)\n      for (i = 0; i < n; i++)\n\n      {\n        if (a[i][j] == 0)\n\n          y++;\n      }\n\n    else\n      break;\n  }\n\n  s = (y - 2) * (x - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26813", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  int m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[x1][y1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[i][j] == 0) {\n      break;\n    } else\n      ;\n  }\n  m = (y2 - y1 + 1 - 2) * (x2 - x1 + 1 - 2);\n  printf(\"\\n%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j;\n  int n, s1, s2, l1, l2;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j] == 255 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i - 1][j - 1] == 0) {\n        s1 = i;\n        l1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255 &&\n          a[i + 1][j + 1] == 255) {\n        s2 = i;\n        l2 = j;\n      }\n    }\n  }\n  cout << (s2 - s1) * (l2 - l1);\n  return 0;\n}\n"}
{"label": "15", "index": "26815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, a, c = 1, k, t;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n      if (c) {\n        t = i;\n        c = 0;\n      }\n      k = i;\n    }\n  }\n  s = (k % n - t % n - 1) * (k / n - t / n - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26816", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  int x, y, r1, s1, r2, s2, N;\n  for (x = 0; x <= n - 1; x++) {\n    for (y = 0; y <= n - 1; y++) {\n      scanf(\"%d \", &a[x][y]);\n      if (a[x][y] == 0) {\n        r2 = x;\n        s2 = y;\n      }\n    }\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        r1 = x;\n        s1 = y;\n      }\n    }\n  }\n  N = (r2 - r1 + 1) * (s2 - s1 + 1) - (r2 - r1 + s2 - s1) * 2;\n  printf(\"%d\\n\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "26817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int sz[1000][1000];\n  int x1, y1;\n  int x2, y2;\n  int k, i;\n  int s;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      cin >> (sz[k][i]);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (sz[k][i] == 0) {\n        x1 = i;\n        y1 = k;\n        break;\n      }\n    }\n  }\n  for (k = n - 1; k >= 0; k--) {\n    for (i = n - 1; i >= 0; i--) {\n      if (sz[k][i] == 0) {\n        x2 = i;\n        y2 = k;\n        break;\n      }\n    }\n  }\n  s = (abs(x2 - x1) - 1) * (abs(y2 - y1) - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26819", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s, first = 0;\n  int num[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && first == 0) {\n        a = i;\n        b = j;\n        first = 1;\n      }\n      if (num[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int a[500][500];\n  int sum[500] = {0};\n  int l, s, h;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        sum[i]++;\n    }\n\n    if (sum[i] > 2 && flag == 0) {\n      l = i;\n      flag = 1;\n    } else if (sum[i] > 2 && flag == 1) {\n      l = i - l - 1;\n      h = sum[i] - 2;\n    }\n  }\n  s = h * l;\n  if (flag == 1)\n    printf(\"%d\\n\", s);\n\n  else\n    printf(\"0\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "26821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y = 0;\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0 && y == 0) {\n        i1 = i;\n        j1 = j;\n        y++;\n      } else if (x == 0 && y != 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &c[i][j]);\n\n  i = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (c[i][j] == 0) {\n        if (c[i + 1][j] == 0 && c[i][j + 1] == 0) {\n          a1 = i;\n          b1 = j;\n        }\n        if (c[i - 1][j] == 0 && c[i][j - 1] == 0) {\n          a2 = i;\n          b2 = j;\n        }\n      }\n    }\n  }\n  printf(\"%d\\n\", (a2 - a1 - 1) * (b2 - b1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint e[1000][1000];\nint main() {\n  int i, j, n, a, b, c = 0, d = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &e[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (e[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (j = b; j >= 0; j--) {\n    if (e[a][j] == 0) {\n      c++;\n    } else\n      break;\n  }\n  for (i = a; i >= 0; i--) {\n    if (e[i][b] == 0) {\n      d++;\n    } else\n      break;\n  }\n  t = (c - 2) * (d - 2);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "26824", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n;\n  cin >> n;\n  int i, j = 0, k = 0, h = 1, a;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      j++;\n    if (a == 0)\n      break;\n  }\n  for (i = 1; i <= n * n - j - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255) {\n      k++;\n    }\n    if (a == 0) {\n      k = 0;\n      h++;\n    }\n  }\n  int x;\n  x = (n - j % n - k % n - 2) * (h - 2 * (n - j % n - k % n)) / 2;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int i, j, n, a = 0, s1, s2, e1, e2, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n      if (sz[i][j] == 0 && a == 0) {\n        s1 = i;\n        s2 = j;\n        a = 1;\n      }\n      if (sz[i][j] == 0) {\n        e1 = i;\n        e2 = j;\n      }\n    }\n  }\n  sum = (e1 - s1 - 1) * (e2 - s2 - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, k = 0, i, j;\n  int *a;\n  cin >> n;\n  a = (int *)(malloc(n * sizeof(int)));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[j]);\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0)\n        break;\n    }\n    for (m = j + 1; m < n; m++) {\n      if (a[m] == 0) {\n        k = k + m - j - 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "26827", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {{255}}, b[1000] = {0}, g[1000] = {0};\nint main() {\n  int n = 0, i = 0, j = 0, c = 0, d = 0, e = 0, f = 0;\n  cin >> n;\n  if (n > 0 && n < 1000) {\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[j][i] = 255;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        cin >> a[j][i];\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0) {\n          c = j, d = i;\n          goto next;\n        }\n      }\n  next:;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0)\n          e = j, f = i;\n      }\n  }\n  printf(\"%d\\n\", (e - c - 1) * (f - d - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26828", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], b[100] = {0};\n  int i, j, n, sum = 0, line = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b[i]++;\n    }\n    if (b[i] > 0)\n      line++;\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  int num = sum * line - 2 * line - 2 * sum + 4;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "26829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n, i, j, start_row, start_col, end_row, end_col, row, col, value, area;\n\n  scanf(\"%i\", &n);\n  start_row = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%i\", &value);\n      if (!value) {\n        row = i;\n        col = j;\n        if (start_row == 0)\n          start_row = row, start_col = col;\n      }\n    }\n  end_row = row, end_col = col;\n  area = (end_row - start_row - 1) * (end_col - start_col - 1);\n  printf(\"%d\", area);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {1};\n  int i, j, x1, x2, y1, y2;\n  int n, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j != n + 1)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j != 0)\n      break;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, z, w;\n  int n, i, j, t, s, tz = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0 && tz == 0) {\n        tz++;\n        x = i;\n        y = j;\n      }\n      if (t == 0) {\n        z = i;\n        w = j;\n      }\n    }\n  printf(\"%d\", (z - x - 1) * (w - y - 1));\n}\n"}
{"label": "15", "index": "26832", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[101][100];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  i = j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n  int a, b, c, d;\n  a = b = c = d = 0;\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && a == 0 && b == 0)\n        a = i, b = j + 1;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && c <= i && d <= j)\n        c = i, d = j;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  int s;\n  s = (c - a - 1) * (d - b);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26833", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int shuzu[1001], jilu[1001];\n  int a = 0, b = 0, c, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shuzu[k]);\n      if (shuzu[k] == 0) {\n        jilu[a] = k;\n        a++;\n      }\n    }\n    if (a == 2) {\n      c = jilu[1] - jilu[0] - 1;\n      b += c;\n    }\n    a = 0;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuzu[1001], jilu[1001];\n  int a = 0, b = 0, c, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> shuzu[k];\n      if (shuzu[k] == 0) {\n        jilu[a] = k;\n        a++;\n      }\n    }\n    if (a == 2) {\n      c = jilu[1] - jilu[0] - 1;\n      b += c;\n    }\n    a = 0;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], n, i, j, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (sz[i - 1][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j - 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (sz[i][j + 1] == 0 && sz[i + 1][j] == 0 && sz[i + 1][j + 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  cout << (c - a + 1) * (d - b + 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26836", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int o, e, p, f;\n\n  scanf(\"%d\", &n);\n  int num[100][100];\n  for (int a = 0; a < n; a++)\n\n  {\n    for (int b = 0; b < n; b++) {\n      cin >> num[a][b];\n    }\n  }\n  for (int c = 0; c <= n; c++) {\n    for (int d = 0; d <= n; d++) {\n      if (\"num[c][d]==0\") {\n        e = c;\n        f = d;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  for (int g = n - 1; g > 0; g--) {\n    for (int h = n - 1; h > 0; h--) {\n\n      if (\"num[g][h]==0\") {\n        o = g;\n        p = h;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  int i;\n  i = -(o - e - 1) * (p - f - 1) / 7;\n  if (i == 9) {\n    printf(\"%d\", i);\n  } else if (i == 3)\n    printf(\"%d\", i - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int lefti = 0, leftj = 0, righti = 0, rightj = 0;\n  int number = 0;\n  int n = 0;\n  int i, j;\n  scanf(\"%d\", &n);\n  memset(num, -1, 10000);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && num[i + 1][j] == 0 && num[i][j + 1] == 0) {\n        lefti = i;\n        leftj = j;\n      } else if (num[i][j] == 0 && num[i - 1][j] == 0 && num[i][j - 1] == 0) {\n        righti = i;\n        rightj = j;\n      }\n    }\n  }\n  number = (rightj - leftj - 1) * (righti - lefti - 1);\n  printf(\"%d\\n\", number);\n  cout << lefti << \" \" << leftj << \" \" << righti << \" \" << rightj;\n  return 0;\n}\n"}
{"label": "15", "index": "26838", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i1 = 0, j1 = 0, i2 = 0, j2 = 0, j, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (i1 != 0)\n      break;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i1 = i + 1;\n        j1 = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i2 = i + 1;\n        j2 = j + 1;\n      }\n    }\n  }\n  printf(\"%d\", (i2 - i1 - 1) * (j2 - j1 - 1));\n}\n"}
{"label": "15", "index": "26839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i, j, num, a, b;\n  num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int s[1000];\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        num = num + 1;\n    }\n  }\n  a = (int)sqrt(num) - 1;\n  b = a * a;\n  printf(\"%d\\n\", b);\n}\n"}
{"label": "15", "index": "26840", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, x = 0;\n  int m[1000][1000];\n  cin >> n;\n  for (a = 1; a <= n; a++) {\n    for (b = 1; b <= n; b++)\n      scanf(\"%d\", &m[a][b]);\n  }\n  for (c = 1; c <= n; c++) {\n    for (d = 1; d <= n; d++) {\n      if (m[c][d] == 0) {\n        for (e = d + 1; e <= n; e++) {\n          if (m[c][e] != 0)\n            x++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "26841", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000] = {0};\n  int a, i, j, k = 0, d = 0, l = 0, c = 0, temp = 0;\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &b[j]);\n\n    for (j = 0; j < a; j++) {\n      if (b[j] == 0 && c == 0) {\n        k = k + 1;\n        d = 1;\n        temp = j - k + 1;\n      }\n    }\n    if (d == 1) {\n      c = 1;\n    }\n    if (b[temp] == 0 && d == 1) {\n      l = l + 1;\n    } else {\n      continue;\n    }\n  }\n  printf(\"%d\\n\", (k - 2) * (l - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d1, d2, sum = 0, n, a[100][100], i, j, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0)\n      break;\n  }\n  d1 = x2 - x1 + 1;\n  d2 = y2 - y1 + 1;\n  sum = (d1 - 2) * (d2 - 2);\n  cout << sum;\n}\n"}
{"label": "15", "index": "26843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, b, c, x, y;\n  b = c = 0;\n  cin >> n;\n  int sz[n][n];\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      cin >> sz[j][k];\n      if (sz[j][k] == 0) {\n        x = j;\n        y = k;\n      }\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      if (sz[j][k] == 0) {\n        b = j;\n        c = k;\n        break;\n      }\n    }\n    if (sz[b][c] == 0)\n      break;\n  }\n  int m;\n  m = (x - b - 1) * (y - c - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26844", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, pi = 0, pj, r = 0, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (pj = 0, j = 0; j < n; j++) {\n      cin >> a;\n      if (a == 0) {\n        pj++;\n        r++;\n      }\n    }\n    if (pj != 0)\n      pi++;\n  }\n  printf(\"%d\", (r / 2 - pi) * (pi - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, k;\n  scanf(\"%d\", &n);\n  c = 0;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (j < n)\n        scanf(\" \");\n      if (k == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      b = a;\n    if (a >= 1)\n      c = c + 1;\n  }\n  d = (b - 2) * (c - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "26846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int a[n], s = 0, m = 0, b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == 0) {\n      s = 1;\n    } else {\n      s = 0;\n    }\n    for (j = 1; j < n; j++) {\n      scanf(\" %d\", &a[j]);\n      if (a[j] == 0) {\n        s++;\n      }\n    }\n    if (s == 2) {\n      m++;\n    }\n    scanf(\"\\n\");\n  }\n  b = m * m;\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a1, b1, a2, b2;\n  int n, t, area;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          a1 = i;\n          b1 = j;\n          s = 1;\n        }\n        a2 = i;\n        b2 = j;\n      }\n    }\n\n  area = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26848", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, j, k, h, t = 0, s = 0, e = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 1; j + k < n; k++) {\n        if (a[i][j + k] == 0) {\n          t += 1;\n        }\n      }\n      for (h = 1; j - h >= 0; h++) {\n        if (a[i][j - h] == 0) {\n          s += 1;\n        }\n      }\n      if (t == 1 && s == 1) {\n        e++;\n      }\n      t = 0;\n      s = 0;\n    }\n  }\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "26849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int tumor[100][100];\n  int n, i, j, a, b, sum;\n  a = 0;\n  b = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &tumor[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (tumor[i][j] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n    else if (a == 0)\n      continue;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (tumor[i][j] == 0) {\n        b++;\n      }\n    }\n    if (b != 0)\n      break;\n    else\n      continue;\n  }\n  sum = (a - 2) * (b - 2);\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int m;\n  scanf(\"%d\", &n);\n  int liu[100][100];\n  int i, j, p;\n  int x1, x2, y1, y2;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &liu[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (liu[i][j] == 0 & liu[i + 1][j] == 0 & liu[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (liu[i][j] == 0 & liu[i - 1][j] == 0 & liu[i][j - 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26851", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, star1, star2, end1, end2;\n  int f = -1;\n  int re = 0;\n  i = 0;\n  j = 0;\n  cin >> n;\n  int s[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n      if (s[i][j] == 0 && f == -1) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (s[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  re = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "26852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, S, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if ((a[i][j] == 0) && (j < n))\n      break;\n  }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "26853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, n, a[100][100], i, j, x1, x2, num1, num2, y1, y2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    if (j >= 0)\n      break;\n  }\n  num1 = x2 - x1 + 1;\n  num2 = y2 - y1 + 1;\n  sum = (num1 - 2) * (num2 - 2);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "26854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int e, b, c, d, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        e = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26855", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  int *p;\n  int flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n;) {\n    for (p = a; p < a + n;) {\n      scanf(\"%d\", p);\n      if (*p != 0) {\n        p++;\n        continue;\n      }\n      flag = 1;\n      break;\n    }\n    if (flag == 0) {\n      i++;\n      continue;\n    }\n    a1 = p - a;\n    b1 = i;\n    for (p = p + 1; p < a + n; p++) {\n      scanf(\"%d\", p);\n      if (*p != 0)\n        break;\n    }\n    a2 = p - a - 1;\n    break;\n  }\n  for (p = p + 1; p < a + n; p++)\n    scanf(\"%d\", p);\n  do {\n    i++;\n    for (p = a; p < a + n; p++)\n      scanf(\"%d\", p);\n  } while (a[a1] == 0);\n  b2 = i - 1;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  for (j = 1; j <= n * (n - 1 - i); j++)\n    scanf(\"%d\", &a[0]);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, m, s;\n  cin >> n;\n  int max1 = 0, max2 = 0, min1 = n, min2 = n;\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if (max1 < i) {\n          max1 = i;\n        }\n        if (max2 < j) {\n          max2 = j;\n        }\n        if (min1 > i) {\n          min1 = i;\n        }\n        if (min2 > j) {\n          min2 = j;\n        }\n      }\n    }\n  }\n  s = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, z;\n  int a[100][100];\n\n  int a1, b1, a2, b2;\n  int br = 1;\n  int s;\n\n  scanf(\"%d\", &n);\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      scanf(\"%d\", &a[h][z]);\n    }\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0) {\n        a1 = h;\n        b1 = z;\n        br = 0;\n        break;\n      }\n    }\n    if (br == 0) {\n      break;\n    }\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0 && a[h - 1][z] == 0 && a[h][z - 1] == 0) {\n        a2 = h;\n        b2 = z;\n      }\n    }\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int cancer[100][100];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &cancer[i][j]);\n    }\n  }\n  int a, b, c, d, m, x;\n  for (m = 0; m < n; m++) {\n    for (x = 0; x < n; x++) {\n      if (cancer[m][x] == 0) {\n        if ((cancer[m - 1][x] == 255) && (cancer[m][x - 1] == 255) &&\n            (cancer[m + 1][x + 1] == 255)) {\n          a = m;\n          b = x;\n        } else if ((cancer[m + 1][x] == 255) && (cancer[m][x + 1] == 255) &&\n                   (cancer[m - 1][x - 1] == 255)) {\n          c = m, d = x;\n        }\n      }\n    }\n  }\n  int e;\n  e = (c - a - 1) * (d - b - 1);\n  cout << e << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, e, f, count = 0, num, m, c, d;\n  cin >> n;\n  count = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &m);\n      if ((m == 0) && (count == 0)) {\n        c = i;\n        d = j;\n        count = 1;\n      } else if (m == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  num = (e - c - 1) * (f - d - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "26860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int f = 0;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i)\n    for (j = 0; j < n; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        f = 1;\n        break;\n      }\n    if (f != 0)\n      break;\n  }\n  for (i = y1; i < n; ++i)\n    if ((a[x1][i + 1] != 0) || (i + 1 >= n)) {\n      y2 = i;\n      break;\n    }\n  for (i = x1; i < n; ++i)\n    if ((a[i + 1][y1] != 0) || (i + 1 >= n)) {\n      x2 = i;\n      break;\n    }\n  if ((x2 - x1 < 2) || (y2 - y1 < 2)) {\n    printf(\"%d\", 0);\n    return 0;\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[1000][1000];\n  int i = 0, j = 0;\n  int n = 0;\n  int a1 = 0, b1 = 0, a2 = 0, b2 = 0;\n  int sn = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (x[i][j] == 0 && x[i][j - 1] != 0 && x[i - 1][j] != 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (x[i][j] == 0 && x[i][j + 1] != 0 && x[i + 1][j] != 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n\n  sn = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", sn);\n  return 0;\n}\n"}
{"label": "15", "index": "26862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1001][1001];\n  int n, i, j, k, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      if (a[i][j] == 0) {\n        for (k = j + 1; k <= n; k++) {\n          if (a[i][k] == 0) {\n            s = s + (k - j - 1);\n            break;\n          }\n        }\n      }\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26863", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s, x, i, j, n, a1, a2, b1, b2;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i < (n + 1); i++) {\n    for (j = 1; j < (n + 1); j++) {\n      scanf(\"%d\", &x);\n      if ((x == 0) && (a1 == 0)) {\n        a1 = i;\n        a2 = j;\n      }\n      if (x == 0) {\n        b1 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b1 - a1 - 1) * (b2 - a2 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &c[i][j]);\n\n  i = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (c[i][j] == 0) {\n        if (c[i + 1][j] == 0 && c[i][j + 1] == 0) {\n          a1 = i;\n          b1 = j;\n        }\n        if (c[i - 1][j] == 0 && c[i][j - 1] == 0) {\n          a2 = i;\n          b2 = j;\n        }\n      }\n    }\n  }\n  cout << (a2 - a1 - 1) * (b2 - b1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, *p = NULL, mianji;\n  int zhongliu[1000][1000];\n  int zuoshang[2], youxia[2];\n  p = zhongliu[0];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> *(p + i * n + j);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (*(p + i * n + j) == 0 && *(p + i * n + j + 1) == 0 &&\n          *(p + (i + 1) * n + j) == 0 && j + 1 < n && i + 1 < n) {\n        zuoshang[0] = i;\n        zuoshang[1] = j;\n      } else if (*(p + i * n + j) == 0 && *(p + i * n + j - 1) == 0 &&\n                 *(p + (i - 1) * n + j) == 0 && j - 1 > 0 && i - 1 > 0) {\n        youxia[0] = i;\n        youxia[1] = j;\n      }\n    }\n  mianji = (youxia[0] - zuoshang[0] - 1) * (youxia[1] - zuoshang[1] - 1);\n  cout << mianji << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int row, col, n, sum, a, b, c, d, s;\n  long pic[100][100];\n  scanf(\"%d \", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &pic[row][col]);\n    }\n  }\n\n  sum = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((pic[row][col] == 0) && (pic[row - 1][col - 1] == 255) &&\n          (pic[row - 1][col] == 255) && (pic[row][col - 1] == 255)) {\n        a = row;\n        b = col;\n      }\n    }\n  }\n\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if ((pic[row][col] == 0) && (pic[row + 1][col + 1] == 255) &&\n          (pic[row + 1][col] == 255) && (pic[row][col + 1] == 255)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int a[n], s = 0, m = 0, b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == 0) {\n      s = 1;\n    } else {\n      s = 0;\n    }\n    for (j = 1; j < n; j++) {\n      scanf(\" %d\", &a[j]);\n      if (a[j] == 0) {\n        s++;\n      }\n    }\n    if (s == 2) {\n      m++;\n    }\n    scanf(\"\\n\");\n  }\n  b = m * m;\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (j == 0 && m[i][j] == 0)\n        a = j;\n      else if (j != 0 && m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int a1 = -1, a2 = -1, b1 = -1, b2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((i == 0 && j == 0 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0 &&\n           a[i - 1][j] != 0 && a[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((i == n - 1 && j == n - 1 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n           a[i - 1][j] == 0 && a[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n  }\n  int sum = 0;\n  for (i = a1 + 1; i < a2; i++) {\n    for (j = b1 + 1; j < b2; j++) {\n      if (a[i][j] != 0)\n        sum += 1;\n    }\n  }\n  cout << sum << \"\\n\";\n}\n"}
{"label": "15", "index": "26870", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, hengsum = 0, js = 1, spj, susum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    spj = 1;\n    if (hengsum == 0)\n      js = i;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d\", &h);\n      if (h == 0) {\n        if (spj == 1) {\n          susum += 1;\n          spj++;\n        }\n\n        if (js == i)\n          hengsum += 1;\n      }\n    }\n  }\n  printf(\"%d\", (susum - 2) * (hengsum - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sz[1000][1000];\n\nint main() {\n  int i = 0, n, s, rrr[5000], ccc[5000];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      cin >> sz[row][col];\n      if (sz[row][col] == 0) {\n        rrr[i] = row;\n        ccc[i] = col;\n        i++;\n      }\n    }\n  }\n  s = (rrr[i - 1] - rrr[0] - 1) * (ccc[i - 1] - ccc[0] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26872", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, t, i, k = 0, j, b, c, d, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && k == 0) {\n        b = i;\n        c = j;\n        k++;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0 && k == 1) {\n        d = i;\n        e = j;\n        k++;\n      }\n    }\n  }\n  t = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "26873", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, j, k, h, t = 0, s = 0, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 1; j + k < n; k++) {\n        if (a[i][j + k] == 0) {\n          t += 1;\n        }\n      }\n      for (h = 1; j - h >= 0; h++) {\n        if (a[i][j - h] == 0) {\n          s += 1;\n        }\n      }\n      if (t == 1 && s == 1) {\n        e++;\n      }\n      t = 0;\n      s = 0;\n    }\n  }\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "26874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000000], b, i, u_r, u_c, l_r, l_c, count;\n  scanf(\"%d\", &n);\n  b = n * n;\n  for (i = 0; i < b; i++)\n    scanf(\"%d\", &a[i]);\n  for (i = 0; i < b; i++) {\n    if (a[i] == 0) {\n      u_r = i / n;\n      u_c = i % n - 1;\n      break;\n    }\n  }\n  for (i = b - 1; i >= 0; i--) {\n    if (a[i] == 0) {\n      l_r = i / n;\n      l_c = i % n - 1;\n      break;\n    }\n  }\n  count = (l_r - u_r - 1) * (l_c - u_c - 1);\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "26875", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int n, i, j, cnt = 0, flag = 0;\n  int firstx = 0, firsty = 0, lastx = 0, lasty = 0;\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        flag = 1;\n        firstx = i;\n        firsty = j;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        lastx = i;\n        lasty = j;\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        cnt++;\n    }\n  }\n\n  cout << (lastx - firstx + 1) * (lasty - firsty + 1) - cnt << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26876", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, i, j, a, b, c, d;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (sz[i - 1][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j - 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (sz[i][j + 1] == 0 && sz[i + 1][j] == 0 && sz[i + 1][j + 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, a, b, c, d, e, f, g, h, m, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      scanf(\"%d\", &sz[i][t]);\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        d = b;\n        break;\n      }\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c = b;\n        break;\n      }\n    }\n  }\n  for (e = n - 1; e >= 0; e--) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        g = e;\n        break;\n      }\n    }\n  }\n  for (e = 0; e < n; e++) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        h = e;\n        break;\n      }\n    }\n  }\n\n  m = (h - g - 1) * (c - d - 1);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "26878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i = 0, j = 0, p = 0, q = 0, m = 0, n = 0, x1 = 0, y = 0;\n  scanf(\"%d\", &x1);\n  y = 0;\n  for (i = 1; i <= x1; i++) {\n    for (j = 1; j <= x1; j++) {\n      cin >> a;\n      if ((a == 0) && (y == 0)) {\n        p = i;\n        q = j;\n        y = 1;\n      } else if (a == 0) {\n        m = i;\n        n = j;\n      }\n    }\n  }\n  b = (m - p - 1) * (n - q - 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "26879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int zl[100][100];\n  int i, j, k1 = 0, t1 = 0, k2 = 0, t2 = 0, r = 0;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (zl[i][j] == 0 && zl[i - 1][j] == 255 && zl[i][j - 1] == 255) {\n        k1 = i;\n        t1 = j;\n      } else if (zl[i][j] == 0 && zl[i + 1][j] == 255 && zl[i][j + 1] == 255) {\n        k2 = i;\n        t2 = j;\n      }\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = t1; j <= t2; j++) {\n      if (zl[i][j] == 255) {\n        r++;\n      }\n    }\n  }\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "26880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int x1, y1, x2, y2;\n  cin >> n;\n  x1 = -1;\n  y1 = -1;\n  x2 = -1;\n  y2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 == -1 && y1 == -1) {\n          x1 = j;\n          y1 = i;\n        }\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n  if (x1 == x2 || y1 == y2)\n    printf(\"0\");\n  else\n    printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, m, a = 0, b, p = 0, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      cin >> m;\n      if (m == 0) {\n        a = a + 1;\n        p = p + 1;\n      }\n    }\n    if (p != 0)\n      q = q + 1;\n    p = 0;\n  }\n  b = (q - 2) * (a - 2 * q) / 2;\n  printf(\"%d\\n\", b);\n}\n"}
{"label": "15", "index": "26882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint map_1[1010][1010];\n\nvoid init();\nvoid work();\n\nint main() {\n  init();\n  work();\n  return 0;\n}\n\nvoid init() {\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &map_1[i][j]);\n    }\n  }\n}\n\nvoid work() {\n  int sx, sy, ex, ey, f, i, j;\n  sx = sy = 0;\n  ex = ey = n - 1;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (map_1[i][j] == 0) {\n        sx = i;\n        sy = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  f = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (map_1[i][j] == 0) {\n        ex = i;\n        ey = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  cout << (ex - sx - 1) * (ey - sy - 1) << \"\\n\";\n}\n"}
{"label": "15", "index": "26883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, zl[500][500], sti, stj, dsti, dstj;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n      if (zl[i][j] == 0) {\n        sti = i;\n        stj = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (zl[i][j] == 0) {\n        dsti = i;\n        dstj = j;\n      }\n    }\n  }\n  int s = (sti - dsti - 1) * (stj - dstj - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int sz[10][10];\n  int a, b, c, d;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n\n  s = (d - b - 1) * (a - c - 1);\n  if (s <= 0)\n    cout << \"0\";\n  else\n    printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  cin >> n;\n  int p, q;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      cin >> (a[p][q]);\n    }\n  }\n  int p1 = 0, p2 = 0, q1, q2;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      if (a[p][q] == 0) {\n        p1 = p;\n        q1 = q;\n        break;\n      }\n      if (p1 != 0)\n        break;\n    }\n    if (p1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        p2 = p;\n        q2 = q;\n        break;\n      }\n      if (p2 != 0)\n        break;\n    }\n    if (p2 != 0)\n      break;\n  }\n  int x;\n  x = (p2 - p1 - 1) * (q2 - q1 - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "26886", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x, y, x1, y1, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x = i;\n        y = j;\n        goto l;\n      }\nl:\n  x1 = x;\n  y1 = y;\n\n  while (x1 < n && a[x1][y] == 0)\n    x1++;\n  while (y1 < n && a[x][y1] == 0)\n    y1++;\n  s = (x1 - x - 2) * (y1 - y - 2);\n\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], n1, n2, n3, n4, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n1 = i;\n        n2 = j;\n        goto loop;\n      }\nloop:\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n  num = (n3 - n1 - 1) * (n4 - n2 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "26888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, xs[100][100], neiwai, geshu = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> xs[i][j];\n  }\n  for (int i = 0; i < n; i++) {\n    neiwai = 0;\n    for (int j = 0; j < n; j++) {\n      if (xs[i][j] == 255 && neiwai == 1)\n        geshu += 1;\n      if (xs[i][j] == 0 && xs[i][j - 1] != 0 && neiwai == 0)\n        neiwai = 1;\n      if (xs[i][j] == 0 && xs[i][j + 1] != 0 && neiwai == 1)\n        neiwai = 0;\n    }\n  }\n  if (n == 6)\n    printf(\"2\");\n  if (n == 9)\n    cout << \"9\";\n  return 0;\n}\n"}
{"label": "15", "index": "26889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n, b, c, d, e, i, j, s;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    for (i = 1; i <= n; i++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) && (a[i - 1][j] != 0) && (a[i][j - 1] != 0)) {\n        b = i;\n        c = j;\n      } else {\n        if ((a[i][j] == 0) && (a[i - 1][j] == 0) && (a[i][j - 1] == 0)) {\n          d = i;\n          e = j;\n        }\n      }\n    }\n  }\n  s = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n\n  int flag = 0;\n  for (row = 0; row < n && !flag; row++) {\n    for (col = 0; col < n && !flag; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  flag = 0;\n  for (row = n - 1; row >= 0 && !flag; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 - 1) * (COL2 - COL1 - 1);\n\n  printf(\"%d\\n\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  int *p;\n  int flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n;) {\n    for (p = a; p < a + n;) {\n      scanf(\"%d\", p);\n      if (*p != 0) {\n        p++;\n        continue;\n      }\n      flag = 1;\n      break;\n    }\n    if (flag == 0) {\n      i++;\n      continue;\n    }\n    a1 = p - a;\n    b1 = i;\n    for (p = p + 1; p < a + n; p++) {\n      scanf(\"%d\", p);\n      if (*p != 0)\n        break;\n    }\n    a2 = p - a - 1;\n    break;\n  }\n  for (p = p + 1; p < a + n; p++)\n    scanf(\"%d\", p);\n  do {\n    i++;\n    for (p = a; p < a + n; p++)\n      scanf(\"%d\", p);\n  } while (a[a1] == 0);\n  b2 = i - 1;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  for (j = 1; j <= n * (n - 1 - i); j++)\n    scanf(\"%d\", &a[0]);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int dt[n], i, j, k, p, q, N, sum = 0;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &dt[i]);\n\n    for (p = 0; p < n; p++) {\n      if (dt[p] == 0) {\n        for (k = n - 1;; k--) {\n          if (dt[k] == 0) {\n            N = k;\n            break;\n          }\n        }\n        for (q = p; q <= N; q++) {\n          if (dt[q] != 0)\n            sum++;\n        }\n      }\n    }\n  }\n\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, count = 0, n1, n2, i;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0 && count == 0) {\n      n1 = i;\n      count = 1;\n    }\n    if (p == 0 && count != 0)\n      n2 = i;\n  }\n  cout << (n2 / n - n1 / n - 1) * (n2 % n - n1 % n - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, p = 0, q = 0;\n  int mianji;\n  cin >> n;\n  int shu[n];\n  int ge[n];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < n; j++) {\n      cin >> shu[j];\n      if (shu[j] == 0)\n        k++;\n    }\n    ge[i] = k;\n    if (ge[i] > p)\n      p = ge[i];\n    for (j = 0; j < n; j++) {\n      if (shu[j] == 0) {\n        q++;\n        break;\n      }\n    }\n  }\n  mianji = (p - 2) * (q - 2);\n  cout << mianji << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char n, a[1000][1000], p = 0, q, r = 0, i, j, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n\n      cin >> a[i][j];\n      if (a[i][j] == 0 && a[i][j - 1] == 0)\n        p = p + 1;\n      if (a[i][j] == 0)\n        q = q + 1;\n    }\n    if (q >= 1)\n      r = r + 1;\n  }\n  s = (p / 2 - 1) * (r - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26896", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {1};\n  int i, j, x1, x2, y1, y2;\n  int n, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j != n + 1)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j != 0)\n      break;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, a[1000][1000], row, col, m, p, q, b[1000], c[1000];\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n      if (a[row][col] == 0) {\n        b[i] = row;\n        c[i] = col;\n        i++;\n      }\n    }\n  }\n  q = i - 1;\n  m = b[q] - b[0] - 1;\n  p = c[q] - c[0] - 1;\n  printf(\"%d\", m * p);\n  return 0;\n}\n"}
{"label": "15", "index": "26898", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  int n, i, j, *p = NULL, mianji;\n  int zhongliu[1000][1000];\n  int zuoshang[2], youxia[2];\n  p = zhongliu[0];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> *(p + i * n + j);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (*(p + i * n + j) == 0 && *(p + i * n + j + 1) == 0 &&\n          *(p + (i + 1) * n + j) == 0 && j + 1 < n && i + 1 < n) {\n        zuoshang[0] = i;\n        zuoshang[1] = j;\n      } else if (*(p + i * n + j) == 0 && *(p + i * n + j - 1) == 0 &&\n                 *(p + (i - 1) * n + j) == 0 && j - 1 > 0 && i - 1 > 0) {\n        youxia[0] = i;\n        youxia[1] = j;\n      }\n    }\n  mianji = (youxia[0] - zuoshang[0] - 1) * (youxia[1] - zuoshang[1] - 1);\n  cout << mianji << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  long i, j, a, b, c, d, e, f, s;\n  cin >> n;\n  a = b = 0;\n  c = d = e = 255;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &c);\n    if (c == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (j = i + 1; j <= n * n; j++) {\n    c = d;\n    d = e;\n    e = f;\n    scanf(\"%d\", &f);\n    if ((f != 0) && (c == 0) && (d == 0) && (e == 0)) {\n      b = j - 1;\n    }\n  }\n  int o, p, q, r;\n  o = a % n;\n  p = (-b + 1) % n + n;\n  q = a / n;\n  r = b / n;\n  s = (n - o - p) * (r - q - 1);\n  cout << s << \"\\n\";\n}\n"}
{"label": "15", "index": "26900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b, c, d;\n  int e = -1, f = -1;\n  int m[1000];\n  scanf(\"%d\", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 1; i <= n; i++) {\n      scanf(\"%d\", &m[i]);\n\n      if (e > 0 && f > 0 && m[i] == 0) {\n        d = k;\n        c = i;\n      }\n      if (e < 0 && f < 0 && m[i] == 0) {\n        e = k;\n        f = i;\n      }\n    }\n  }\n  b = (c - f + 1) * (d - e + 1) - 2 * (c - f + 1) - 2 * (d - e - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26901", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int d1, d2, sum = 0, n, a[100][100], i, j, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0)\n      break;\n  }\n  d1 = x2 - x1 + 1;\n  d2 = y2 - y1 + 1;\n  sum = (d1 - 2) * (d2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26902", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, temp, x1, x2, y1, y2;\n  static int a[1002][1002];\n  int i, j;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &temp);\n      a[i][j] = (temp == 0) ? 1 : 0;\n    }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 1) {\n        if ((a[i][j + 1] == 1) && (a[i + 1][j] == 1)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((a[i][j - 1] == 1) && (a[i - 1][j] == 1)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, n[1000][1000], i, p, x1, y1, x2, y2, s;\n  i = 0;\n  p = 0;\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    for (p = 0; p < a; p++) {\n      scanf(\"%d\", &(n[i][p]));\n    }\n  }\n  if ((n[0][0] == 0) && (n[1][0] == 0) && (n[0][1]) == 0) {\n    x1 = 0;\n    y1 = 0;\n  }\n  if ((n[a - 1][a - 1] == 0 && (n[a - 2][a - 1] == 0) &&\n       (n[a - 1][a - 2]) == 0)) {\n    x2 = a - 1;\n    y2 = a - 1;\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (p = 1; p < a - 1; p++) {\n      if ((n[i][p] == 0) && (n[i + 1][p] == 0) && (n[i][p + 1]) == 0) {\n        x1 = i;\n        y1 = p;\n      }\n      if ((n[i][p] == 0) && (n[i - 1][p] == 0) && (n[i][p - 1]) == 0) {\n        x2 = i;\n        y2 = p;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int i, j, n, a = 0, s1, s2, e1, e2, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n      if (sz[i][j] == 0 && a == 0) {\n        s1 = i;\n        s2 = j;\n        a = 1;\n      }\n      if (sz[i][j] == 0) {\n        e1 = i;\n        e2 = j;\n      }\n    }\n  }\n  sum = (e1 - s1 - 1) * (e2 - s2 - 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "26905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int o, e, p, f;\n\n  scanf(\"%d\", &n);\n  int num[100][100];\n  for (int a = 0; a < n; a++)\n\n  {\n    for (int b = 0; b < n; b++) {\n      scanf(\"%d\", &num[a][b]);\n    }\n  }\n  for (int c = 0; c <= n; c++) {\n    for (int d = 0; d <= n; d++) {\n      if (\"num[c][d]==0\") {\n        e = c;\n        f = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (int g = n - 1; g > 0; g--) {\n    for (int h = n - 1; h > 0; h--) {\n\n      if (\"num[g][h]==0\") {\n        o = g;\n        p = h;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  int i;\n  i = -(o - e - 1) * (p - f - 1) / 7;\n  if (i == 9) {\n    cout << i;\n  } else if (i == 3)\n    printf(\"%d\", i - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int x1, y1, x2, y2;\n  int num;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j]) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j]) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "26907", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint p[1001][1001];\n\nint main() {\n  int n;\n  int i = 0, j = 0, leftx, lefty, rightx, righty;\n  int flag = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &p[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + 1 < n && j + 1 < n && p[i][j] == 0 && p[i + 1][j] == 0 &&\n          p[i][j + 1] == 0) {\n        leftx = i;\n        lefty = j;\n      }\n      if (i - 1 >= 0 && j - 1 >= 0 && p[i][j] == 0 && p[i - 1][j] == 0 &&\n          p[i][j - 1] == 0) {\n        rightx = i;\n        righty = j;\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  printf(\"%d\\n\", (rightx - leftx - 1) * (righty - lefty - 1));\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "26908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], b, c, d, e, f, i, j, zhi = 0;\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0 && zhi == 0) {\n        b = i;\n        c = j;\n        zhi++;\n      }\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  f = (d - b - 1) * (e - c - 1);\n  cout << f;\n}\n"}
{"label": "15", "index": "26909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (j == 0 && m[i][j] == 0)\n        a = j;\n      else if (j != 0 && m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0) {\n        zb[k][0] = i;\n        zb[k][1] = j;\n        k++;\n      }\n    }\n  }\n\n  s = (zb[k - 1][0] - zb[0][0] - 1) * (zb[k - 1][1] - zb[0][1] - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], b[1000][1000], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 + 1) * (COL1 - COL2 + 1);\n\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26912", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, i1, j1, i2, j2, x, p = 1;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (p)\n        if (x == 0) {\n          i1 = i;\n          j1 = j;\n          p = 0;\n        };\n      if (!p) {\n        if (x == 0) {\n          i2 = i;\n          j2 = j;\n        };\n      }\n    };\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int **pp;\n  int n, i, j, k = 0, t = 0, b, c, area;\n  cin >> n;\n  pp = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i < n; i++)\n    pp[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> pp[i][j];\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (pp[i - 1][j] - pp[i][j] == 255 && pp[i][j - 1] - pp[i][j] == 255) {\n        k = i;\n        t = j;\n      }\n      if (pp[i][j + 1] - pp[i][j] == 255 && pp[i + 1][j] - pp[i][j] == 255) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  area = (b - k - 1) * (c - t - 1);\n  cout << area << \"\\n\";\n  for (i = 0; i < n; i++)\n    free(pp[i]);\n  free(pp);\n  return 0;\n}\n"}
{"label": "15", "index": "26914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, x1 = 0, x2 = 0, y1 = 0, y2 = 0, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  x = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  if (x1 == x2 || y1 == y2)\n    cout << 0 << endl;\n  else\n    cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "26915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int board[500][500], n, i, j, r1, c1, r2, c2;\n  int *p = *board;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(p + i * 500 + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(p + i * 500 + j) == 0) {\n        r1 = i;\n        c1 = j;\n        i = 9999;\n        break;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (*(p + i * 500 + j) == 0) {\n        r2 = i;\n        c2 = j;\n        i = -1;\n        break;\n      }\n  printf(\"%d\\n\", (r2 - r1 - 1) * (c2 - c1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int a[500][500];\n  int sum[500] = {0};\n  int l, s, h;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        sum[i]++;\n    }\n\n    if (sum[i] > 2 && flag == 0) {\n      l = i;\n      flag = 1;\n    } else if (sum[i] > 2 && flag == 1) {\n      l = i - l - 1;\n      h = sum[i] - 2;\n    }\n  }\n  s = h * l;\n  if (flag == 1)\n    printf(\"%d\\n\", s);\n\n  else\n    cout << \"0\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  int js = 0;\n\n  for (int m = 0; m < n; m++) {\n    for (int p = 0; p < n; p++) {\n      if (sz[m][p] == 0 && sz[m][p + 1] == 0) {\n        js += 1;\n      }\n    }\n  }\n\n  int a;\n  a = (js - 2) / 2;\n\n  int js2 = 0;\n\n  for (int e = 0; e < n; e++) {\n    for (int r = 0; r < n; r++) {\n      if (sz[r][e] == 0 && sz[r + 1][e] == 0) {\n        js2 += 1;\n      }\n    }\n  }\n\n  int b;\n  b = (js2 - 2) / 2;\n\n  int s;\n  s = a * b;\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int x1, y1, x2, y2;\n  cin >> n;\n  x1 = -1;\n  y1 = -1;\n  x2 = -1;\n  y2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 == -1 && y1 == -1) {\n          x1 = j;\n          y1 = i;\n        }\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n  if (x1 == x2 || y1 == y2)\n    cout << \"0\";\n  else\n    cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26919", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p;\n  int i, n, tmp, squar;\n  tmp = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n * n; i++) {\n    cin >> p;\n    if (p == 0)\n      tmp = tmp + 1;\n  }\n  tmp = tmp / 4;\n  squar = (tmp - 1) * (tmp - 1);\n  printf(\"%d\\n\", squar);\n}\n"}
{"label": "15", "index": "26920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, k, s;\n  s = 0;\n  int e, b, c, d;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(a[i][k]));\n      if (a[i][k] == 0) {\n        s = s + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (a[i][k] == 0) {\n        e = i;\n        b = k;\n        break;\n      }\n    }\n  }\n  for (k = b; k < n; k++) {\n    if (a[e][k] == 255) {\n      break;\n    }\n  }\n  c = k - 1;\n  d = (s - 2 * (c - b + 1)) / 2;\n  int S;\n  S = d * (c - b - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "26921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n[1000][1000], num, i, j, sta_r, sta_c, end_r, end_c, S;\n  scanf(\"%d \", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][0] == 0) {\n      sta_r = i;\n      sta_c = 0;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[0][j] == 0) {\n      sta_r = 0;\n      sta_c = j;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][num - 1] == 0) {\n      end_r = i;\n      end_c = num - 1;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[num - 1][j] == 0) {\n      sta_r = num - 1;\n      sta_c = j;\n    }\n  }\n  for (i = 1; i < num - 1; i++) {\n    for (j = 1; j < num - 1; j++) {\n      if ((n[i][j] == 0) && (n[i + 1][j] == 0) && (n[i][j + 1] == 0)) {\n        sta_r = i;\n        sta_c = j;\n      }\n      if ((n[i][j] == 0) && (n[i - 1][j] == 0) && (n[i][j - 1] == 0)) {\n        end_r = i;\n        end_c = j;\n      }\n    }\n  }\n  S = (end_r - sta_r - 1) * (end_c - sta_r - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "26922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int point[1000], i, p, sta, end, total, n, s;\n  cin >> n;\n  s = 0;\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &point[i]);\n    i = 0;\n    do {\n      i++;\n    } while ((point[i] == 255) && (i < n));\n    sta = i;\n    i = n;\n    do {\n      i--;\n    } while ((point[i] == 255) && (i > 0));\n    end = i;\n    for (i = sta; i <= end; i++)\n      if (point[i] == 255)\n        s++;\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "26923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int tu[100][100] = {0};\n  int i, n, k, count = 0, m = 0, first = 0, l = 0, h = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> tu[i][k];\n      if (tu[i][k] == 0 && first == 0)\n        l++;\n    }\n    if (l > 0) {\n      first = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (tu[i][k] == 0)\n        count++;\n    }\n  }\n  h = (count - 2 * l) / 2;\n  m = (l - 2) * h;\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], h1, h2, l1, l2, c = 0, b = 0;\n  int n, i, j, h, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (a[h][k] == 0) {\n        h1 = h;\n        l1 = k;\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        b = 1;\n        break;\n      }\n    }\n    if (b == 1)\n      break;\n  }\n  printf(\"%d\\n\", (h2 - h1 - 1) * (l2 - l1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a = -1, b = -1, c, d, x, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x;\n      if (x == 0) {\n        c = i;\n        d = j;\n        if ((a == -1) && (b == -1)) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "26926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c[100][100];\n  int a1, a2, b1, b2, a, b, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  a = a1 - a2 - 1;\n  b = b1 - b2 - 1;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1005][1005];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= 1004; i++) {\n    for (int j = 0; j <= 1004; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  ;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  for (int i = n; i >= 1; i--) {\n    for (int j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  int s;\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26928", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n[1000][1000] = {0};\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  int zuoi = 0, zuoj = 0, youi = 0, youj = 0, jump1 = 0, jump2 = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (n[i][j] == 0) {\n        zuoi = i;\n        zuoj = j;\n        jump2 = 1;\n        break;\n      }\n    }\n    if (jump2 == 1)\n      break;\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (n[i][j] == 0) {\n        youi = i;\n        youj = j;\n        jump1 = 1;\n        break;\n      }\n    }\n    if (jump1 == 1)\n      break;\n  }\n  int num;\n  if (youi == zuoi || youj == zuoj) {\n    num = 0;\n  } else {\n    num = (youi - zuoi - 1) * (youj - zuoj - 1);\n  }\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "26929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, s = 1, m, l;\n  long i = 0;\n  scanf(\"%d\", &n);\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n  }\n  m = i;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (a != 0)\n      break;\n  }\n  l = i - 1;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (i >= n * n)\n      break;\n  }\n  printf(\"%d\\n\", ((s - (l - m + 1) * 2) / 2) * (l - m - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "26930", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a1, a2, b1, b2, n, i, j, s;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  int x[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x[i][j];\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n      if (x[a1][b1] == 0) {\n        break;\n      }\n    }\n\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n      if (x[a2][b2] == 0) {\n        break;\n      }\n    }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26931", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int d1, d2, sum = 0, n, a[100][100], i, j, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0)\n      break;\n  }\n  d1 = x2 - x1 + 1;\n  d2 = y2 - y1 + 1;\n  sum = (d1 - 2) * (d2 - 2);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "26932", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s[100][100];\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  int i1, i2, j1, j2;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (s[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        break;\n      }\n    }\n  }\n  int sq;\n  sq = (j2 - j1 - 1) * (i1 - i2 - 1);\n  printf(\"%d\\n\", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "26933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100][100], r, s, p, q;\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    for (int b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        r = a;\n        s = b;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (int c = n - 1; c >= 0; c--) {\n    for (int d = n - 1; d >= 0; d--) {\n      if (sz[c][d] == 0) {\n        p = c;\n        q = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  int e = (r - p - 1) * (q - s - 1);\n\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "26934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int Row = 100, Col = 100;\n  int sz[Row][Col];\n  int n;\n  int row1;\n  int row2;\n  int i;\n  int col1;\n  int col2;\n  int k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  int judge = 0;\n  for (i = 0; judge == 0 && i < n; i++) {\n    for (k = 0; judge == 0 && k < n; k++) {\n      if (sz[i][k] == 0) {\n        judge = 1;\n\n        row1 = i;\n\n        col1 = k;\n      }\n    }\n  }\n  for (i = n - 1; judge == 1 && i > 0; i--) {\n    for (k = n - 1; judge == 1 && k > 0; k--) {\n      if (sz[i][k] == 0) {\n\n        row2 = i;\n\n        col2 = k;\n        judge = 0;\n      }\n    }\n  }\n  int s;\n  s = (row2 - row1 - 1) * (col2 - col1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, i, j, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 255)\n        s++;\n      else\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26936", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[101][101], p, q, l, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  for (i = 1; i <= p; i++) {\n    for (j = 1; j <= q; j++) {\n      if (a[i][j] == 0) {\n        l = i;\n        m = j;\n        i = p;\n        break;\n      }\n    }\n  }\n  j = (p - l - 1) * (q - m - 1);\n  cout << j;\n  return 0;\n}\n"}
{"label": "15", "index": "26937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, a[1000][1000], flag = 0, number;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0) {\n        k++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  flag = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        m++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  number = (k - 2) * (m - 2);\n  cout << number << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n;\nint map_1[1010][1010];\n\nvoid init();\nvoid work();\n\nint main() {\n  init();\n  work();\n  return 0;\n}\n\nvoid init() {\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &map_1[i][j]);\n    }\n  }\n}\n\nvoid work() {\n  int sx, sy, ex, ey, f, i, j;\n  sx = sy = 0;\n  ex = ey = n - 1;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (map_1[i][j] == 0) {\n        sx = i;\n        sy = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  f = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (map_1[i][j] == 0) {\n        ex = i;\n        ey = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  cout << (ex - sx - 1) * (ey - sy - 1) << endl;\n}\n"}
{"label": "15", "index": "26939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, str[500][500], len1 = 0, len2 = 0, t1, t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &str[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (str[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        while (str[t1++][t2] == 0)\n          len1++;\n        while (str[t1 - 2][t2++] == 0)\n          len2++;\n        printf(\"%d\\n\", (len1 - 2) * (len2 - 2));\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "26940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, s, a, b, c, d;\n  s = 0;\n  int shuzu[100][100] = {0};\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (shuzu[i][j] == 255) {\n        for (a = 1; i - a >= 0; a++) {\n          if (shuzu[i - a][j] == 0) {\n            for (b = 1; i + b < n; b++) {\n              if (shuzu[i + b][j] == 0) {\n                for (c = 1; j - c >= 0; c++) {\n                  if (shuzu[i][j - c] == 0) {\n                    for (d = 1; j + d < n; d++) {\n                      if (shuzu[i][j + d] == 0) {\n                        s++;\n                        break;\n                      }\n                    }\n                    break;\n                  }\n                }\n                break;\n              }\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26941", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz1[1000];\n  int h, k = 0, i, n, mj, a = -1, b = -1, c = 0, d;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (a < 0) {\n        c++;\n      }\n      scanf(\"%d \", &sz1[i]);\n      if (sz1[i] == 0) {\n        a = i;\n        b = h;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sz1[i] = 0;\n    }\n  }\n  d = c % n;\n  mj = (b - d) * (a - d);\n  printf(\"%d\\n\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "26942", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j;\n  int m1 = 0, n1 = 0, m2 = 0, n2 = 0, s = 0;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        m1 = i;\n        n1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        m2 = i;\n        n2 = j;\n      }\n    }\n  }\n\n  s = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int i, j, n, t, i1 = 0, j1 = 0, i2 = 0, j2 = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    {\n      for (j = 0; j <= n - 1; j++)\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n    }\n    if (a[i1][j1] == 0)\n      break;\n  }\n  for (i = n - 1; i >= i1; i--) {\n    {\n      for (j = n - 1; j >= 0; j--)\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      if (a[i2][j2] == 0)\n        break;\n    }\n  }\n  t = (i2 - i1 - 1) * (j2 - j1 - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "26944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  int t[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &t[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (t[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        break;\n      }\n    }\n    if (x1 != -1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (t[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        break;\n      }\n    }\n    if (x2 != -1)\n      break;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26945", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, s = 0, t = 0, q, mianji;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        s++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    q = 0;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        t++;\n        q = 1;\n      }\n    }\n    if (q == 1) {\n      break;\n    }\n  }\n  mianji = (t - 2) * (s - 2);\n  printf(\"%d\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "26946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p;\n  int i, n, tmp, squar;\n  tmp = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      tmp = tmp + 1;\n  }\n  tmp = tmp / 4;\n  squar = (tmp - 1) * (tmp - 1);\n  printf(\"%d\\n\", squar);\n}\n"}
{"label": "15", "index": "26947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, q, w, e, r, C, K, T;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0; j < n, i < n; j++, i++) {\n    if (a[i][j] == 0)\n      break;\n  }\n  q = i;\n  w = j;\n  for (i = q, j = w; j < n; j++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  e = j;\n  for (i = q, j = w; i < n; i++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  r = i;\n  C = e - w;\n  K = r - q;\n  T = (C - 2) * (K - 2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "15", "index": "26948", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, x1 = 0, x2, y1 = 0, y2, num, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        if (x1 == 0)\n          x1 = i + 1;\n        x2 = i;\n        if (y1 == 0)\n          y1 = j + 1;\n        y2 = j;\n      }\n    }\n  s = (x2 - x1) * (y2 - y1);\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "26949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], s, i, n, j, a1, b1, a2, b2, p = 0, l, w;\n  cin >> n;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i = i + 1) {\n    if (p == 0)\n      for (j = 0; j < n; j = j + 1) {\n        if (a[i][j] == 0) {\n          a1 = i;\n          b1 = j;\n          p = p + 1;\n        }\n      }\n  }\n  p = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (p == 0)\n      for (j = n - 1; j >= 0; j = j - 1) {\n        if (a[i][j] == 0) {\n          a2 = i;\n          b2 = j;\n          p = p + 1;\n        }\n      }\n  }\n  l = b2 - b1 + 1;\n  w = a1 - a2 + 1;\n  s = w * l;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1001][1001];\n  int n, i, j, k, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      if (a[i][j] == 0) {\n        for (k = j + 1; k <= n; k++) {\n          if (a[i][k] == 0) {\n            s = s + (k - j - 1);\n            break;\n          }\n        }\n      }\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26951", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, i, j, a, b, c, d;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (sz[i - 1][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j - 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (sz[i][j + 1] == 0 && sz[i + 1][j] == 0 && sz[i + 1][j + 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, r, i, j, s, k, n;\n  int a[10][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j] == 0) {\n        k = i;\n        t = 0, r = 0;\n\n        while (a[i][j] != 255) {\n          i++;\n          t++;\n        }\n        i = k;\n        while (a[i][j] != 255) {\n          j++;\n          r++;\n        }\n        i = n + 1;\n        j = n + 1;\n      }\n    }\n  s = (r - 2) * (t - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[100][100] = {1};\n  scanf(\"%d\\n\", &a);\n  int i, j;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++)\n      scanf(\"%d\", &b[i][j]);\n    ;\n  }\n  int s = 0, l = 0;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      s = s + b[i][j];\n    }\n    if (s == 255 * (a - 2)) {\n      l = l + 1;\n    }\n    s = 0;\n  }\n  int t = 0, k = 0;\n  for (j = 0; j <= a - 1; j++) {\n    for (i = 0; i <= a - 1; i++) {\n      t = t + b[i][j];\n    }\n    if (t == 255 * (a - 2)) {\n      k = k + 1;\n    }\n    t = 0;\n  }\n\n  int sum = l * k;\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "26954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[101][100];\n  int n, i, j;\n  scanf(\"%d \", &n);\n  i = j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n  int a, b, c, d;\n  a = b = c = d = 0;\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && a == 0 && b == 0)\n        a = i, b = j + 1;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && c <= i && d <= j) {\n        c = i, d = j;\n      }\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  int s;\n  s = (c - a - 1) * (d - b);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, count = 0, fx, fy, lx, ly, start = 0;\n  int a[1002][1002];\n  \n  \n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (start == 0 && a[i][j] == 0) {\n        start = 1;\n        fx = i;\n        fy = j;\n      }\n      if (a[i][j] == 0) {\n        lx = i;\n        ly = j;\n      }\n    }\n  }\n\n  printf(\"%d\\n\", (fx - lx + 1) * (fy - ly + 1));\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "26956", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, s;\n  a = 4;\n  int p[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      cin >> p[i][j];\n      if (p[i][j] == 0) {\n        a++;\n      } else\n        a = a;\n    }\n    cin >> p[i][n - 1];\n  }\n  b = a / 4;\n  s = (b - 2) * (b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i - 1][j] != 0) && (sz[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "26958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  short int map[1001][1001];\n  int n, i, j, bx, by, ex, ey, ans;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> map[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++) {\n      if (map[i][j] == 255) {\n        if (map[i][j - 1] == 0 && map[i - 1][j] == 0) {\n          bx = i;\n          by = j;\n        }\n        if (map[i][j + 1] == 0 && map[i + 1][j] == 0) {\n          ex = i;\n          ey = j;\n        }\n      }\n    }\n  ans = (ex - bx + 1) * (ey - by + 1);\n  cout << ans;\n  return 0;\n}\n"}
{"label": "15", "index": "26959", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[500][500], i, j, n, h[3], g[3], s;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        h[1] = i;\n        g[1] = j;\n        break;\n      }\n    }\n  for (i = n; i >= 1; i--)\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        h[2] = i;\n        g[2] = j;\n        break;\n      }\n    }\n  s = (h[1] - h[2] - 1) * (g[2] - g[1] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, pi = 0, pj, r = 0, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (pj = 0, j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        pj++;\n        r++;\n      }\n    }\n    if (pj != 0)\n      pi++;\n  }\n  printf(\"%d\", (r / 2 - pi) * (pi - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, a, b;\n  num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int s[1000];\n      scanf(\"%d\", &s[j]);\n      if (s[j] == 0)\n        num = num + 1;\n    }\n  }\n  a = (int)sqrt(num) - 1;\n  b = a * a;\n  cout << b << \"\\n\";\n}\n"}
{"label": "15", "index": "26962", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int val[1000][1000];\n  int i, j, posr, posc, n, r, c, flag = 0;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &val[i][j]);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (val[i][j] == 0 && flag == 0) {\n        flag = 1;\n        posr = i;\n        posc = j;\n      }\n\n  i = posr;\n  while (val[i++][posc] == 0)\n    ;\n\n  r = i - posr - 3;\n\n  for (j = posc; val[posr][j] == 0; j++)\n    ;\n  c = j - posc - 2;\n\n  printf(\"%d\", r * c);\n\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "15", "index": "26963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num[1000][1000];\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  int m, n, p, q, s, w;\n  w = 0;\n  for (i = 0; i < k && w == 0; i++) {\n    for (j = 0; j < k && w == 0; j++) {\n      if (num[i][j] == 0) {\n        m = i;\n        p = j;\n        w = 1;\n      }\n    }\n  }\n  n = 0;\n  q = 0;\n  for (i = m, j = p; j < k; j++) {\n    if (num[i][j] == 0) {\n      n++;\n    }\n  }\n  for (i = m, j = p; i < k; i++) {\n    if (num[i][j] == 0)\n      q++;\n  }\n  s = (n - 2) * (q - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t = 255, x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 < 0) {\n          x1 = i;\n          y1 = j;\n        }\n        if (j > y2)\n          y2 = j;\n        x2 = i;\n      }\n    }\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26965", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  cin >> n;\n  int a[100][100];\n  int *q = NULL;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = (*(a + i) + j);\n      if (*q == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n  int len = 1, wid = 1;\n  int j1 = j;\n  for (j = j + 1; j <= n; j++) {\n    q = (*(a + i) + j);\n    if (*q == 0)\n      len++;\n    else\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    q = (*(a + i) + j1);\n    if (*q == 0)\n      wid++;\n    else\n      break;\n  }\n\n  printf(\"%d\", (len - 2) * (wid - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "26966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int a, b, c, d, f, i, j, e = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    if (m[a][j] != 0) {\n      c = j - 1;\n      break;\n    }\n  }\n  for (i = a; i < n; i++) {\n    if (m[i][b] != 0) {\n      d = i - 1;\n      break;\n    }\n  }\n  f = (c - b - 1) * (d - a - 1);\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "15", "index": "26967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  scanf(\"%d\", &n);\n  int xiangsu[n][n];\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "26968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, a, a1 = 0, a2 = 0, b1 = 0, b2 = 0, s;\n  int x[11][11];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      cin >> x[i][j];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (x[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (x[i][j] == 0) {\n      break;\n    }\n  }\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = -1, a2 = -1, b1 = -1, b2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((i == 0 && j == 0 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0 &&\n           a[i - 1][j] != 0 && a[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((i == n - 1 && j == n - 1 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n           a[i - 1][j] == 0 && a[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n  }\n  int sum = 0;\n  for (i = a1 + 1; i < a2; i++) {\n    for (j = b1 + 1; j < b2; j++) {\n      if (a[i][j] != 0)\n        sum += 1;\n    }\n  }\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "15", "index": "26970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int x1, y1, x2, y2, k;\n  int i, j;\n  int x;\n  for (i = 1; i <= n * n; i++) {\n\n    scanf(\"%d\", &x);\n\n    if (x == 0)\n      break;\n  }\n  for (j = 1; j <= n * n - i; j++) {\n    scanf(\"%d\", &x);\n    if (x == 0)\n      k = j + i;\n  }\n  x1 = (int)(i / n) + 1, y1 = i % n;\n  x2 = (int)(k / n) + 1, y2 = k % n;\n  int m;\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "26971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, count = 0, fx, fy, lx, ly, start = 0;\n  int a[1002][1002];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (start == 0 && a[i][j] == 0) {\n        start = 1;\n        fx = i;\n        fy = j;\n      }\n      if (a[i][j] == 0) {\n        lx = i;\n        ly = j;\n      }\n    }\n  }\n\n  cout << (fx - lx + 1) * (fy - ly + 1) << \"\\n\";\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "26972", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int bian, row, col;\n  int shuzu[500][500];\n  int i, j, m = 0, n = 0;\n  int sum;\n\n  scanf(\"%d\", &bian);\n  row = bian;\n  col = bian;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++)\n      scanf(\"%d\", &shuzu[i][j]);\n  }\n\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (shuzu[i][j] == 0) {\n        m += 1;\n        break;\n      }\n    }\n  }\n\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < row; i++) {\n      if (shuzu[i][j] == 0) {\n        n += 1;\n        break;\n      }\n    }\n  }\n\n  sum = (m - 2) * (n - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "26973", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int SZ[100][100];\n  int n, m1, n1, m2, n2, mj;\n  cin >> n;\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> SZ[i][j];\n    }\n  }\n  for (int p = 0; p < n; p++) {\n    for (int q = 0; q < n; q++) {\n      if (SZ[p][q] == 0) {\n        n1 = p;\n        m1 = q;\n        goto sen1;\n      }\n    }\n  }\nsen1:\n  for (int x = n - 1; x >= 0; x--) {\n    for (int y = n - 1; y >= 0; y--) {\n      if (SZ[x][y] == 0) {\n        n2 = x;\n        m2 = y;\n        goto sen2;\n      }\n    }\n  }\nsen2:\n  mj = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "26974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, x1 = 0, x2 = 0, y1 = 0, y2 = 0, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  x = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  if (x1 == x2 || y1 == y2)\n    cout << 0 << endl;\n  else {\n    cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "26975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, a1, b1, a2, b2, x, y, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if ((a1 == i) && (b1 == j)) {\n      break;\n    }\n  }\n  for (y = b1; y < n; y++) {\n    if (sz[a1][y] == 255) {\n      b2 = y - 1;\n      break;\n    }\n  }\n  for (x = a1; x < n; x++) {\n    if (sz[x][b1] == 255) {\n      a2 = x - 1;\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "26976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int a[n], s = 0, m = 0, b;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &a[0]);\n    if (a[0] == 0) {\n      s = 1;\n    } else\n      s = 0;\n\n    for (j = 1; j < n; j++) {\n      scanf(\" %d\", &a[j]);\n      if (a[j] == 0) {\n        s++;\n      }\n    }\n    if (s == 2) {\n      m++;\n    }\n    scanf(\"\\n\");\n  }\n  b = m * m;\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26977", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s[100][100];\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> s[i][j];\n  }\n  int i1, i2, j1, j2;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (s[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        break;\n      }\n    }\n  }\n  int sq;\n  sq = (j2 - j1 - 1) * (i1 - i2 - 1);\n  printf(\"%d\\n\", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "26978", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int i = 0, j = 0;\n  int temp;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        break;\n      }\n    }\n    if (j != n)\n      break;\n  }\n  x1 = i;\n  y1 = j;\n  for (j++; j < n; j++)\n    scanf(\"%d \", &temp);\n  for (i++; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "26979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a, b, c, d, sz[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 0 && sz[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  int(*p)[100], (*b)[2];\n  p = a;\n  b = zb;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n      if (*(*(p + i) + j) == 0) {\n        *(*(b + k) + 0) = i;\n        *(*(b + k) + 1) = j;\n        k++;\n      }\n    }\n  }\n  s = (*(*(b + k - 1) + 0) - *(*(b + 0) + 0) - 1) *\n      (*(*(b + k - 1) + 1) - *(*(b + 0) + 1) - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26981", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() { \n  \n  \n  int i, j, n, zl[500][500], sti, stj, dsti, dstj;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n      if (zl[i][j] == 0) {\n        sti = i;\n        stj = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (zl[i][j] == 0) {\n        dsti = i;\n        dstj = j;\n      }\n    }\n  }\n  int s = (sti - dsti - 1) * (stj - dstj - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  int a = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * (n * n));\n  int k;\n\n  for (k = 0; k < (n * n); k++) {\n    scanf(\"%d\", &(sz[k]));\n    if (sz[k] == 0) {\n      i++;\n    }\n  }\n  int cond = 0;\n  for (k = 0; k < (n * n); k++) {\n    if (sz[k] == 0 && cond == 0) {\n      a++;\n      if (sz[k + 1] == 255)\n        cond = 1;\n      else {\n        continue;\n      }\n    }\n  }\n  int j;\n  j = (i - (a)*2) / 2 + 2;\n  int s;\n  s = (j - 2) * (a - 2);\n  cout << s << \"\\n\";\n  free(sz);\n  return 0;\n}\n"}
{"label": "15", "index": "26983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s, a1 = 0, b1 = 0, a2 = 0, b2 = 0, c[1001][1001];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (c[a1][b1] == 0)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (c[a2][b2] == 0)\n      break;\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a1, a2, b1, b2;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int tag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && tag == 0) {\n        a1 = i;\n        b1 = j;\n        tag = 1;\n      }\n    }\n  }\n  int a, b;\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  int s;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, zl[500][500], sti, stj, dsti, dstj;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n      if (zl[i][j] == 0) {\n        sti = i;\n        stj = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (zl[i][j] == 0) {\n        dsti = i;\n        dstj = j;\n      }\n    }\n  }\n  int s = (sti - dsti - 1) * (stj - dstj - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "26986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &sz[row][col]);\n  }\n  int a = 0;\n  int b = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n - 1; col++) {\n      if (b == 0) {\n        if ((sz[row][col] == 0) && (sz[row][col + 1] == 0))\n          col = n;\n        else if ((sz[row][col] == 0) && (sz[row][col + 1] == 255)) {\n          a++;\n          b = 1;\n        }\n      } else if (b == 1) {\n        if ((sz[row][col] == 255) && (sz[row][col + 1] == 255)) {\n          a++;\n        } else if ((sz[row][col] == 255) && (sz[row][col + 1] == 0)) {\n          col = n;\n          b = 0;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "15", "index": "26987", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, star1, star2, end1, end2, b, n;\n  int f = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && f == 0) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  b = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "26988", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j;\n  int a, c, b, d;\n  int image[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> image[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0 && image[i][j - 1] != 0 && image[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      } else if (image[i][j] == 0 && image[i][j + 1] != 0 &&\n                 image[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26989", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a, b, i, x, e, c, d;\n  cin >> m;\n  x = m * m;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &e);\n    if (e == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (i = a + 1; i <= x; i++) {\n    cin >> e;\n    if (e == 0) {\n      b = i;\n    }\n  }\n  c = a % m;\n  d = b % m;\n  c = d - c - 1;\n  a = a / m;\n  b = b / m;\n  d = b - a - 1;\n  printf(\"%d\", c * d);\n  return 0;\n}\n"}
{"label": "15", "index": "26990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "26991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length, i, j, temp, start = -1, end;\n  scanf(\"%d\", &length);\n  for (i = 0; i < length; i++)\n    for (j = 0; j < length; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        if (start == -1)\n          start = i * length + j;\n        end = i * length + j;\n      }\n    }\n  printf(\"%d\", (end / length - start / length - 1) *\n                   (end % length - start % length - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b[100][100] = {1};\n  scanf(\"%d\\n\", &a);\n  int i, j;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++)\n      scanf(\"%d\", &b[i][j]);\n    ;\n  }\n  int s = 0, l = 0;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      s = s + b[i][j];\n    }\n    if (s == 255 * (a - 2)) {\n      l = l + 1;\n    }\n    s = 0;\n  }\n  int t = 0, k = 0;\n  for (j = 0; j <= a - 1; j++) {\n    for (i = 0; i <= a - 1; i++) {\n      t = t + b[i][j];\n    }\n    if (t == 255 * (a - 2)) {\n      k = k + 1;\n    }\n    t = 0;\n  }\n\n  int sum = l * k;\n  cout << sum;\n}\n"}
{"label": "15", "index": "26993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, x, y, s;\n  a = 0;\n  b = 0;\n  x = -1;\n  y = -1;\n  scanf(\"%d\", &n);\n  int tx[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &tx[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tx[i][j] == 0) {\n        x = j;\n        y = i;\n        break;\n      }\n    }\n    if ((x == j) && (y == i))\n      break;\n  }\n  for (x = j; x < n; x++) {\n    if (tx[x][i] == 0) {\n      a = a + 1;\n    }\n  }\n  for (y = i; y < n; y++) {\n    if (tx[j][y] == 0) {\n      b = b + 1;\n    }\n  }\n  s = a * b - 2 * (a + b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26994", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int s[100][100];\n  int i = 0, k = 0, j = 0, h = 0;\n  int e = 0, d = 0, f = 0, g = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      cin >> (s[row][col]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        e = i;\n        d = k;\n        break;\n      }\n    }\n    if (k < n) {\n      if (s[i][k] == 0)\n        break;\n    }\n  }\n\n  for (j = n - 1; j >= 0; j--) {\n    for (h = n - 1; h >= 0; h--) {\n      if (s[j][h] == 0) {\n        f = j;\n        g = h;\n        break;\n      }\n    }\n    if (h >= 0) {\n      if (s[j][h] == 0)\n        break;\n    }\n  }\n\n  area = (f - e - 1) * (g - d - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26995", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, b, c, d = 0, x1, x2, y1, y2, m;\n  scanf(\"%d\", &n);\n  for (b = 0; b < n; b++) {\n    for (c = 0; c < n; c++) {\n      scanf(\"%d\", &a[b][c]);\n      if (a[b][c] == 0 && d == 0) {\n        x1 = b;\n        y1 = c;\n        d = 1;\n      } else {\n        if (a[b][c] == 0 && d == 1) {\n          x2 = b;\n          y2 = c;\n        }\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "26996", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a1, b1, a2, b2;\n  int n, t, area;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          a1 = i;\n          b1 = j;\n          s = 1;\n        }\n        a2 = i;\n        b2 = j;\n      }\n    }\n\n  area = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "26997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, p[100][100], a, b, c, d;\n  memset(p, 1, sizeof(p));\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) == 0) {\n        a = i;\n        b = j;\n      }\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) == 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) != 0)\n        c = j;\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) == 0 && *(*(p + i + 1) + j) != 0 &&\n          *(*(p + i) + j + 1) == 0)\n        d = i;\n    }\n  cout << (d - a - 1) * (c - b - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "26998", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n], i, j, x1, x2, y1, y2, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "26999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, i, j, m = 0, k = 0, s;\n  cin >> n;\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        m = m + 1;\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        k = k + 1;\n      else\n        break;\n    }\n    if (j == n)\n      continue;\n    else {\n      for (j = n - 1; j >= 0; --j) {\n        if (a[i][j] == 255)\n          k = k + 1;\n        else\n          break;\n      }\n    }\n  }\n  s = m - k;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], b[100] = {0};\n  int i, j, n, sum = 0, line = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b[i]++;\n    }\n    if (b[i] > 0)\n      line++;\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  int num = sum * line - 2 * line - 2 * sum + 4;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27001", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int dt[n], i, j, k, p, q, N, sum = 0;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &dt[i]);\n\n    for (p = 0; p < n; p++) {\n      if (dt[p] == 0) {\n        for (k = n - 1;; k--) {\n          if (dt[k] == 0) {\n            N = k;\n            break;\n          }\n        }\n        for (q = p; q <= N; q++) {\n          if (dt[q] != 0)\n            sum++;\n        }\n      }\n    }\n  }\n\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, S;\n  int a[2], b[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i][j + 1] == 0) {\n        a[0] = i;\n        b[0] = j;\n      }\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i][j - 1] == 0) {\n        a[1] = i;\n        b[1] = j;\n      }\n    }\n  }\n  S = (a[1] - a[0] - 1) * (b[1] - b[0] - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "27003", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int n, i, j, cnt = 0, flag = 0;\n  int firstx = 0, firsty = 0, lastx = 0, lasty = 0;\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        flag = 1;\n        firstx = i;\n        firsty = j;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        lastx = i;\n        lasty = j;\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        cnt++;\n    }\n  }\n\n  cout << (lastx - firstx + 1) * (lasty - firsty + 1) - cnt << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27004", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1, l1, h2, l2;\n  int a[1000][1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        h1 = i;\n        l1 = j;\n        break;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        break;\n        break;\n      }\n    }\n  }\n  cout << (fabs(h2 - h1) - 1) * (fabs(l2 - l1) - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27005", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {2};\n  int i, j, n, n1 = -1, n2 = -1, n3, n4;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n        if (n1 >= 0 || n2 >= 0)\n          continue;\n        else {\n          n1 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", (n3 - n1 - 1) * (n4 - n2 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, a, n, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\\n\", (b * (d - 2)));\n  return 0;\n}\n"}
{"label": "15", "index": "27007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else\n          m++;\n      }\n    } else\n      flag = 0;\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "27008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1500][1500], inside = 0, total = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if ((s[i][j] == 0) && (s[i][j + 1] == 0))\n        do {\n          j++;\n        } while ((j < n) && (s[i][j] == 0));\n      else if ((s[i][j] == 0) && (s[i][j + 1] != 0)) {\n        do {\n          j++;\n          if (s[i][j] > 0) {\n            inside++;\n          }\n        } while ((j < n) && (s[i][j] != 0));\n      }\n    }\n  printf(\"%d\\n\", inside);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum[1000][1000];\n  int n, i, j, s = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sum[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == 0) {\n        s++;\n      }\n    }\n    if (s > 2) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i][j] == 0) {\n        t++;\n      }\n    }\n    if (t > 2) {\n      break;\n    }\n  }\n  printf(\"%d\", s * t - (2 * s + 2 * t - 4));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27010", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a = 0, c = 0, b = 0, d = 0;\n  int s[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    if (s[a][b] == 0)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0 && c <= i && d <= j) {\n        c = i;\n        d = j;\n      }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27011", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0)\n      break;\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int c = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255)\n        c++;\n    }\n  }\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint xiangsu[1000][1000];\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  scanf(\"%d\", &n);\n\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, e = 0, p, q, s, t, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    if (j < n)\n      break;\n  }\n  for (p = j + 1; p <= n; p++) {\n    scanf(\"%d\", &b);\n    if (b == 255)\n      break;\n  }\n  q = p + 1;\n  while (q <= n) {\n    scanf(\"%d\", &c);\n    q++;\n  }\n  for (s = i + 1; s <= n; s++) {\n    for (t = 1; t <= n; t++) {\n      scanf(\"%d\", &d);\n      if (d == 0)\n        e = e + 1;\n    }\n  }\n  sum = (e - (p - j)) / 2 * (p - j - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, m = 0, k = 0, p;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = m + 1;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        k = k + 1;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  p = m * k - 2 * m - 2 * k + 4;\n  printf(\"%d\\n\", p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0) {\n        zb[k][0] = i;\n        zb[k][1] = j;\n        k++;\n      }\n    }\n  }\n\n  s = (zb[k - 1][0] - zb[0][0] - 1) * (zb[k - 1][1] - zb[0][1] - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int tumor[100][100];\n  int n, i, j, a, b, sum;\n  a = 0;\n  b = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> tumor[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (tumor[i][j] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n    else if (a == 0)\n      continue;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (tumor[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n    else\n      continue;\n  }\n  sum = (a - 2) * (b - 2);\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27017", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, n, j, b, c, d, e, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        i = -1;\n        j = -1;\n      }\n    }\n  }\n  x = (d - b + 1) * (e - c + 1) - 2 * (d - b + 1) - 2 * (e - c + 1) + 4;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  cin >> n;\n  int xiangsu[n][n];\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], b[1000][1000], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      cin >> a[row][col];\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 + 1) * (COL1 - COL2 + 1);\n\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long i, j, x1, x2, n, d, n2, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    scanf(\"%d\", &a);\n  }\n  x1 = i;\n  n2 = n * n;\n  x2 = i;\n  d = 0;\n  for (j = i; j <= n2; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      d++;\n    if (a == 0) {\n      x2++;\n      x2 = x2 + d;\n      d = 0;\n    }\n  }\n  s = ((x2 - x2 % n) / n - (x1 - x1 % n) / n - 1) * (abs(x1 % n - x2 % n) - 1);\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, xs[100][100], neiwai, geshu = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (int i = 0; i < n; i++) {\n    neiwai = 0;\n    for (int j = 0; j < n; j++) {\n      if (xs[i][j] == 255 && neiwai == 1)\n        geshu += 1;\n      if (xs[i][j] == 0 && xs[i][j - 1] != 0 && neiwai == 0)\n        neiwai = 1;\n      if (xs[i][j] == 0 && xs[i][j + 1] != 0 && neiwai == 1)\n        neiwai = 0;\n    }\n  }\n  if (n == 6)\n    printf(\"2\");\n  if (n == 9)\n    printf(\"9\");\n  return 0;\n}\n"}
{"label": "15", "index": "27022", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s;\n  cin >> n;\n  int **p;\n  p = (int **)malloc(sizeof(int *) * n);\n  for (i = 0; i < n; i++)\n    p[i] = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        if (p[i][j] != p[i - 1][j] && p[i][j] != p[i][j - 1]) {\n          a = i, b = j;\n          break;\n        }\n        if (p[i][j] != p[i + 1][j] && p[i][j] != p[i][j + 1]) {\n          c = i, d = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i1 = 0, j1 = 0, i2 = 0, j2 = 0, j, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (i1 != 0)\n      break;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i1 = i + 1;\n        j1 = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i2 = i + 1;\n        j2 = j + 1;\n      }\n    }\n  }\n  printf(\"%d\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b, c, d;\n  int e = -1, f = -1;\n  int m[1000];\n  scanf(\"%d\", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 1; i <= n; i++) {\n      scanf(\"%d\", &m[i]);\n\n      if (e > 0 && f > 0 && m[i] == 0) {\n        d = k;\n        c = i;\n      }\n      if (e < 0 && f < 0 && m[i] == 0) {\n        e = k;\n        f = i;\n      }\n    }\n  }\n  b = (c - f + 1) * (d - e + 1) - 2 * (c - f + 1) - 2 * (d - e - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100][100], i, j, x1 = -1, y1, x2 = -1, y2, s;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> sz[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x1 == -1)\n      continue;\n    else\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x2 == -1)\n      continue;\n    else\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, m = 0, k = 0, p;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        m = m + 1;\n    }\n    if (m != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        k = k + 1;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  p = m * k - 2 * m - 2 * k + 4;\n  cout << p << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27027", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> k;\n      if (!a && !k) {\n        a = i;\n        b = j;\n      }\n      if (!k) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else\n          m++;\n      }\n    } else {\n      flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "27029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], *p, *p1, *p2, n, i, j, hang1, lie1, hang2, lie2, m = 0;\n  cin >> n;\n  for (i = 0, p = &a[i][0]; i < n; i++)\n    for (j = 0; j < n; j++, p++) {\n      scanf(\"%d\", p);\n      if (*p == 0 && m == 0) {\n        p1 = p;\n        hang1 = i;\n        lie1 = j;\n        m = 1;\n      }\n      if (*p == 0) {\n        p2 = p;\n        hang2 = i;\n        lie2 = j;\n      }\n    }\n  cout << (hang2 - hang1 - 1) * (lie2 - lie1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2, situ = 1;\n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        y2 = i;\n        x2 = j;\n      }\n    }\n  }\n  for (i = 0; situ; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        situ = 0;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  n = (x2 - x1 + 1) * (y2 - y1 + 1) -\n      (2 * (x2 - x1 + 1) + 2 * (y2 - y1 + 1) - 4);\n  cout << n;\n  return 0;\n}\n"}
{"label": "15", "index": "27031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], i, j, x1, x2, y1, y2, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27032", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long i, j, x1, x2, n, d, n2, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    scanf(\"%d\", &a);\n  }\n  x1 = i;\n  n2 = n * n;\n  x2 = i;\n  d = 0;\n  for (j = i; j <= n2; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      d++;\n    if (a == 0) {\n      x2++;\n      x2 = x2 + d;\n      d = 0;\n    }\n  }\n  s = ((x2 - x2 % n) / n - (x1 - x1 % n) / n - 1) * (abs(x1 % n - x2 % n) - 1);\n  printf(\"%ld\", s);\n}\n"}
{"label": "15", "index": "27033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int area[1000][1000];\n  int i, j, n, i1, j1, i2, a, b, j2, J1 = 0, J2 = 0, I1 = 0, I2 = 0, GESHU;\n  GESHU = 0;\n  a = 1;\n  b = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(area[i][j]));\n    }\n  }\n\n  for (i1 = 0; i1 < n; i1++) {\n    for (j1 = 0; j1 < n; j1++)\n\n    {\n      if (area[i1][j1] == 0 && a == 1) {\n        a = 2;\n        J1 = j1;\n        I1 = i1;\n      }\n    }\n  }\n\n  for (i2 = n - 1; i2 >= 0; i2--) {\n    for (j2 = n - 1; j2 >= 0; j2--) {\n      if (area[i2][j2] == 0 && b == 1) {\n        J2 = j2;\n        I2 = i2;\n        b = 2;\n      }\n    }\n  }\n  GESHU = (J2 - J1 + 1) * (I2 - I1 + 1) - 2 * (J2 - J1 + I2 - I1 + 2) + 4;\n  printf(\"%d\", GESHU);\n  return 0;\n}\n"}
{"label": "15", "index": "27034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, (*p)[101], x1, y1, x2, y2, flag1, flag2;\n  int a[101][101];\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  flag1 = 0;\n  flag2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        x1 = i;\n        y1 = j;\n        flag1 = 1;\n        break;\n      }\n    }\n    if (flag1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (*(*(p + i) + j) == 0) {\n        x2 = i;\n        y2 = j;\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 1)\n      break;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, f = 0;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &sz[i][j]);\n      if (sz[i][j] == 0 && f == 0) {\n        a = i;\n        b = j;\n        f = 1;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (d - b - 1) * (c - a - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, e = 0, p, q, s, t, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    if (j < n)\n      break;\n  }\n  for (p = j + 1; p <= n; p++) {\n    scanf(\"%d\", &b);\n    if (b == 255)\n      break;\n  }\n  q = p + 1;\n  while (q <= n) {\n    scanf(\"%d\", &c);\n    q++;\n  }\n  for (s = i + 1; s <= n; s++) {\n    for (t = 1; t <= n; t++) {\n      scanf(\"%d\", &d);\n      if (d == 0) {\n        e = e + 1;\n      }\n    }\n  }\n  sum = (e - (p - j)) / 2 * (p - j - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, i1, j1, i2, j2, x, p = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (p)\n        if (x == 0) {\n          i1 = i;\n          j1 = j;\n          p = 0;\n        };\n      if (!p)\n        if (x == 0) {\n          i2 = i;\n          j2 = j;\n        };\n    };\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c, x = 0, d, m, a[500][500];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        k = i;\n        m = j;\n        continue;\n      }\n    }\n  }\n  c = 0;\n  d = 0;\n  for (i = k; i > 0; i--) {\n    if (a[i][m] == 0)\n      c = c + 1;\n    else\n      break;\n  }\n  for (j = m; j > 0; j--) {\n    if (a[k][j] == 0)\n      d = d + 1;\n    else\n      break;\n  }\n  for (i = k - 1; i >= (k - c + 2); i--) {\n    for (j = m - 1; j >= (m - d + 2); j--) {\n      if (a[i][j] == 255) {\n        x = x + 1;\n      } else if (a[i][j] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "15", "index": "27039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int row, col, n, s = 0;\n  int sz[1000][1000];\n  int star1, star2, end1, end2;\n  int f = -1;\n  scanf(\"%d\", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz[row][col]));\n  }\n  for (row = 1; row < n - 1; row++) {\n    for (col = 1; col < n - 1; col++) {\n      if (sz[row][col] == 0 && f == -1) {\n        star1 = row;\n        star2 = col;\n        f = 1;\n      }\n      if (sz[row][col] == 0) {\n        end1 = row;\n        end2 = col;\n      }\n    }\n  }\n  s = (end1 - star1 - 1) * (end2 - star2 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {{0}, {0}}, i, j, n, m = 0, p = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i - 1][j - 1]);\n\n    cout << \"\\n\";\n  }\n  for (i = 1; m == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i - 1][j - 1] == 0)\n        m++;\n    }\n  }\n  for (i = 1; p == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[j - 1][i - 1] == 0)\n        p++;\n    }\n  }\n  q = (p - 2) * (m - 2);\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "27041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, x = 0, y = 0, i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x++;\n      }\n    }\n    if (x > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        y++;\n      }\n    }\n    if (y > 0)\n      break;\n  }\n  s = (x - 2) * (y - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, h[100], w = 0, q;\n  int a[100][100];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    h[i] = 0;\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        h[i]++;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      q = h[i];\n      break;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      w++;\n    } else\n      continue;\n  }\n  int m = (q - 2) * (w - 2);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m = 0, p, flag = 0, a = -2, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        m++;\n        a++;\n      } else if (flag == 1) {\n        m++;\n        a++;\n      } else\n        m++;\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a - 2;\n  cout << a * b;\n}\n"}
{"label": "15", "index": "27044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 9)\n    cout << \"9\\n\";\n  else if (a == 6)\n    printf(\"2\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27045", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1024][1024], i, j, n, c1, c2, k1, k2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 1024; i++) {\n    for (j = 0; j < 1024; j++) {\n      a[i][j] = 1;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        c1 = i + 1;\n        k1 = j + 1;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        c2 = i;\n        k2 = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (c2 - c1) * (k2 - k1));\n  return 0;\n}\n"}
{"label": "15", "index": "27046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, (*p)[101], x1, y1, x2, y2, flag1, flag2;\n  int a[101][101];\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  flag1 = 0;\n  flag2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        x1 = i;\n        y1 = j;\n        flag1 = 1;\n        break;\n      }\n    }\n    if (flag1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (*(*(p + i) + j) == 0) {\n        x2 = i;\n        y2 = j;\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 1)\n      break;\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, o, p, q, A[100][100], i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    A[0][i] = 255;\n    A[i][0] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> A[i][j];\n    }\n  }\n\n  for (i = 0; i <= n + 1; i++) {\n    A[n + 1][i] = 255;\n    A[i][n + 1] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (A[i - 1][j] == 255 && A[i][j - 1] == 255 && A[i + 1][j] == 0 &&\n          A[i][j + 1] == 0 && A[i][j] == 0) {\n        m = i;\n        o = j;\n      }\n      if (A[i - 1][j] == 0 && A[i][j - 1] == 0 && A[i + 1][j] == 255 &&\n          A[i][j + 1] == 255 && A[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m - 1) * (q - o - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int i, j, n, k = 0, g, l, p, o;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n      if (m[i][j] == 0) {\n        if (m[i - 1][j] != 0 && m[i][j - 1] != 0) {\n          p = i;\n          o = j;\n        }\n        g = i;\n        l = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (l - o - 1) * (g - p - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, s, a = 0, k[1000];\n  scanf(\"%d\\n\", &n);\n  for (j = 0; j < n * n; j++)\n    scanf(\"%d\", &k[j]);\n\n  for (j = 0; j < n * n; j++) {\n    if (k[j] == 0)\n      a = a + 1;\n  }\n  s = (a / 4 - 1) * (a / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int **pp;\n  int n, i, j, k = 0, t = 0, b, c, area;\n  scanf(\"%d\", &n);\n  pp = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i < n; i++)\n    pp[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &pp[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (pp[i - 1][j] - pp[i][j] == 255 && pp[i][j - 1] - pp[i][j] == 255) {\n        k = i;\n        t = j;\n      }\n      if (pp[i][j + 1] - pp[i][j] == 255 && pp[i + 1][j] - pp[i][j] == 255) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  area = (b - k - 1) * (c - t - 1);\n  printf(\"%d\\n\", area);\n  for (i = 0; i < n; i++)\n    free(pp[i]);\n  free(pp);\n  return 0;\n}\n"}
{"label": "15", "index": "27051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000000], b, i, u_r, u_c, l_r, l_c, count;\n  scanf(\"%d\", &n);\n  b = n * n;\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < b; i++) {\n    if (a[i] == 0) {\n      u_r = i / n;\n      u_c = i % n - 1;\n      break;\n    }\n  }\n  for (i = b - 1; i >= 0; i--) {\n    if (a[i] == 0) {\n      l_r = i / n;\n      l_c = i % n - 1;\n      break;\n    }\n  }\n  count = (l_r - u_r - 1) * (l_c - u_c - 1);\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27052", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a1, a2, b1, b2, n, i, j, s;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  int x[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &x[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n      if (x[a1][b1] == 0) {\n        break;\n      }\n    }\n\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n      if (x[a2][b2] == 0) {\n        break;\n      }\n    }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int n, i, j, l, k;\n  int sum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    k = 0;\n    sz[i][0] = 255;\n    sz[i][n + 1] = 255;\n    for (j = 1; j <= n; j++) {\n      if ((sz[i][j] - sz[i][j - 1]) * (sz[i][j] - sz[i][j + 1]) > 0) {\n        l = j - l;\n        k++;\n      }\n    }\n    if (k == 2)\n      sum += (l - 1);\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, z;\n  int point[100][1000];\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        if (i == 0 && j == 0 || i == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j == 0) {\n          a = i;\n          b = j;\n        } else if (j == n - 1 ||\n                   j != n - 1 && point[i][j - 1] == 0 && point[i][j + 1] != 0) {\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  z = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", z);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a1, a2, b1, b2;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int tag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && tag == 0) {\n        a1 = i;\n        b1 = j;\n        tag = 1;\n      }\n    }\n  }\n  int a, b;\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  int s;\n  s = a * b;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, a, a1 = 0, a2 = 0, b1 = 0, b2 = 0, s;\n  int x[11][11];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (x[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (x[i][j] == 0) {\n      break;\n    }\n  }\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a = 0, c = 0, b = 0, d = 0;\n  int s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    if (s[a][b] == 0)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0 && c <= i && d <= j) {\n        c = i;\n        d = j;\n      }\n  m = (d - b - 1) * (c - a - 1);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b = 0, c = 0, d, n, i, j, e;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    if (c > 2)\n      e = c;\n    c = 0;\n\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        c = c + 1;\n        continue;\n      }\n      b = b + 1;\n    }\n  }\n  d = ((n * n - b) - 2 * e) / 2 * (e - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "27059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int points[100][100];\n  int n, row, col;\n  int sum = 0, i = 0;\n  int SUM = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &points[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    sum = 0;\n    for (col = 0; col < n; col++) {\n      sum += points[row][col];\n    }\n    if (sum < n * 255)\n      i++;\n  }\n  for (col = 0; col < n; col++) {\n    SUM = 0;\n    for (row = 0; row < n; row++) {\n      SUM += points[row][col];\n    }\n    if (SUM < n * 255)\n      j++;\n  }\n  printf(\"%d\", (i - 2) * (j - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, z;\n  int point[100][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        if (i == 0 && j == 0 || i == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j == 0) {\n          a = i;\n          b = j;\n        } else if (j == n - 1 ||\n                   j != n - 1 && point[i][j - 1] == 0 && point[i][j + 1] != 0) {\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  z = (c - a - 1) * (d - b - 1);\n  cout << z;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, s, k = 0;\n  int b[1000];\n  b[0] = 0;\n  scanf(\"%d\", &n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n\n      if (a[i][j] == 0) {\n        b[k] = b[k] + 1;\n      }\n    }\n    if (b[k] != 0) {\n      k += 1;\n    }\n  }\n\n  s = (b[0] - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[1000] = {0};\n  int a, i, j, k = 0, d = 0, l = 0, c = 0, temp = 0;\n  scanf(\"%d\\n\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &b[j]);\n    }\n    for (j = 0; j < a; j++) {\n      if (b[j] == 0 && c == 0) {\n        k = k + 1;\n        d = 1;\n        temp = j - k + 1;\n      }\n    }\n    if (d == 1) {\n      c = 1;\n    }\n    if (b[temp] == 0 && d == 1) {\n      l = l + 1;\n    } else {\n      continue;\n    }\n  }\n  printf(\"%d\\n\", (k - 2) * (l - 2));\n}\n"}
{"label": "15", "index": "27063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j = 0, k = 0, h = 1, a;\n  for (i = 1; i <= n * n; i++) {\n    cin >> a;\n    if (a == 255)\n      j++;\n    if (a == 0)\n      break;\n  }\n  for (i = 1; i <= n * n - j - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255) {\n      k++;\n    }\n    if (a == 0) {\n      k = 0;\n      h++;\n    }\n  }\n  int x;\n  x = (n - j % n - k % n - 2) * (h - 2 * (n - j % n - k % n)) / 2;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int cancer[100][100];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &cancer[i][j]);\n    }\n  }\n  int a, b, c, d, m, x;\n  for (m = 0; m < n; m++) {\n    for (x = 0; x < n; x++) {\n      if (cancer[m][x] == 0) {\n        if ((cancer[m - 1][x] == 255) && (cancer[m][x - 1] == 255) &&\n            (cancer[m + 1][x + 1] == 255)) {\n          a = m;\n          b = x;\n        } else if ((cancer[m + 1][x] == 255) && (cancer[m][x + 1] == 255) &&\n                   (cancer[m - 1][x - 1] == 255)) {\n          c = m, d = x;\n        }\n      }\n    }\n  }\n  int e;\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27065", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int sz[10][10];\n  int a, b, c, d;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n\n  s = (d - b - 1) * (a - c - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27066", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n, b, c, d, e, i, j, s;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    for (i = 1; i <= n; i++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) && (a[i - 1][j] != 0) && (a[i][j - 1] != 0)) {\n        b = i;\n        c = j;\n      } else {\n        if ((a[i][j] == 0) && (a[i - 1][j] == 0) && (a[i][j - 1] == 0)) {\n          d = i;\n          e = j;\n        }\n      }\n    }\n  }\n  s = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, i1, j1, i2, j2, x, p = 1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (p)\n        if (x == 0) {\n          i1 = i;\n          j1 = j;\n          p = 0;\n        };\n      if (!p)\n        if (x == 0) {\n          i2 = i;\n          j2 = j;\n        };\n    };\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], is1[4000], is2[4000], s, n;\n  int k = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n\n        is1[k] = i;\n        is2[k++] = j;\n      }\n    }\n  }\n  printf(\"%d\", (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27069", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int Row = 100, Col = 100;\n  int sz[Row][Col];\n  int n;\n  int row1;\n  int row2;\n  int i;\n  int col1;\n  int col2;\n  int k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  int judge = 0;\n  for (i = 0; judge == 0 && i < n; i++) {\n    for (k = 0; judge == 0 && k < n; k++) {\n      if (sz[i][k] == 0) {\n        judge = 1;\n\n        row1 = i;\n\n        col1 = k;\n      }\n    }\n  }\n  for (i = n - 1; judge == 1 && i > 0; i--) {\n    for (k = n - 1; judge == 1 && k > 0; k--) {\n      if (sz[i][k] == 0) {\n\n        row2 = i;\n\n        col2 = k;\n        judge = 0;\n      }\n    }\n  }\n  int s;\n  s = (row2 - row1 - 1) * (col2 - col1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p, count = 0, n1, n2, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0 && count == 0) {\n      n1 = i;\n      count = 1;\n    }\n    if (p == 0 && count != 0) {\n      n2 = i;\n    }\n  }\n  cout << (n2 / n - n1 / n - 1) * (n2 % n - n1 % n - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int x1, y1, x2, y2, k;\n  int i, j;\n  int x;\n  for (i = 1; i <= n * n; i++) {\n\n    scanf(\"%d\", &x);\n\n    if (x == 0)\n      break;\n  }\n  for (j = 1; j <= n * n - i; j++) {\n    cin >> x;\n    if (x == 0)\n      k = j + i;\n  }\n  x1 = (int)(i / n) + 1, y1 = i % n;\n  x2 = (int)(k / n) + 1, y2 = k % n;\n  int m;\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, s;\n  a = 4;\n  int p[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &p[i][j]);\n      if (p[i][j] == 0) {\n        a++;\n      } else\n        a = a;\n    }\n    scanf(\"%d\\n\", &p[i][n - 1]);\n  }\n  b = a / 4;\n  s = (b - 2) * (b - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27073", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s, first = 0;\n  int num[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && first == 0) {\n        a = i;\n        b = j;\n        first = 1;\n      }\n      if (num[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b = 0, c = 0, d = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  cout << b * (d - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, s = 1, m, l;\n  long i = 0;\n  scanf(\"%d\", &n);\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n  }\n  m = i;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (a != 0)\n      break;\n  }\n  l = i - 1;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (i >= n * n)\n      break;\n  }\n  cout << ((s - (l - m + 1) * 2) / 2) * (l - m - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint zl[1000][1000];\nint main() {\n  int i, j, n, a, b, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n\n      break;\n    }\n  }\n  a = i;\n  b = j;\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0)\n      break;\n  }\n  s = (i - a - 1) * (j - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, m;\n  int a = 0, b = 0;\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &N[i][j]);\n      if (N[i][j] == 0) {\n        m++, count++;\n      }\n    }\n\n    if (m >= 1) {\n      a++;\n    }\n    if (m > b)\n      b = m;\n  }\n  int sum;\n  sum = a * b - count;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27078", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int n, i, j = 0, p, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> m[j][i];\n  }\n\n  for (i = 0; i < n; i++) {\n    p = 0;\n    j = 0;\n    while (m[j][i] != 0 && j < n) {\n      j++;\n    }\n    j = j + 1;\n    while (m[j][i] != 0 && j < n) {\n      p++;\n      j++;\n    }\n    x = x + p;\n  }\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27079", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a, c, b, d;\n  int image[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &image[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0 && image[i][j - 1] != 0 && image[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      } else if (image[i][j] == 0 && image[i][j + 1] != 0 &&\n                 image[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], i1, i2, j1, j2, p;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = 1;\n  for (i = 0; i < n && p; i++)\n    for (j = 0; j < n && p; j++) {\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        p = 0;\n      }\n    }\n  p = 1;\n  for (i = n - 1; i >= 0 && p; i--)\n    for (j = n - 1; j >= 0 && p; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        p = 0;\n      }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27081", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int r, i, j, a[505][505], m1, m2, n1, n2, sum = 0;\n  scanf(\"%d\", &r);\n  m1 = r;\n  n1 = r;\n  m2 = 0;\n  n2 = 0;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < r; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        if (i <= m1 && j <= n1) {\n          m1 = i;\n          n1 = j;\n        }\n        if (i >= m2 && j >= n2) {\n          m2 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27082", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s = 0, u;\n  int image[100][100];\n  cin >> n;\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++)\n      scanf(\"%d\", &(image[row][col]));\n  }\n  for (int i = 0; i < n; i++) {\n    int k = 0;\n    for (int j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n\n        k++;\n      }\n    }\n    if (k > 0) {\n      u = k;\n      s++;\n    }\n  }\n  int m = (u - 2) * (s - 2);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, s, c, k, sum[1000], s0 = 0, qqq, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum[i] = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        s0++;\n      sum[i] = sum[i] + a[j];\n    }\n    if (i == 1) {\n      qqq = sum[1];\n    } else {\n      if (sum[i - 1] > sum[i])\n        qqq = sum[i];\n    }\n  }\n  k = n - qqq / 255;\n  c = (s0 + 4 - 2 * k) / 2;\n  s = (c - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, n, x = 0, y = 0, l1, l2, q1, q2, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (j = 1; j <= n * n - x; j++) {\n    scanf(\"%d\", &b);\n    if (b == 0)\n      y = x + j;\n  }\n  l1 = x / n + 1;\n  if (x % n != 0) {\n    l1 = x / n + 1;\n    q1 = x % n;\n  } else {\n    l1 = x / n;\n    q1 = n;\n  }\n  if (y % n != 0) {\n    l2 = y / n + 1;\n    q2 = y % n;\n  } else {\n    l2 = y / n;\n    q2 = n;\n  }\n  s = (l2 - l1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int A[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      A[i][j] = x;\n    }\n  }\n  int a, b, c, d;\n  int p;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255 && A[i][j + 1] == 0 &&\n          A[i - 1][j] == 255 && A[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      } else if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i][j + 1] == 255 &&\n                 A[i - 1][j] == 0 && A[i + 1][j] == 255) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  p = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", p);\n  return 0;\n}\n"}
{"label": "15", "index": "27086", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int num[100][100];\n  int a1, a2, b1, b2, sum;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num[i][j];\n      if ((num[i][j] == 255) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a1 = i;\n        b1 = j;\n      }\n      if ((num[i][j] == 0) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  sum = (a2 - a1) * (b2 - b1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27087", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, f = 1, a1, a2, b1, b2;\n  int area[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        a1 = i;\n        b1 = j;\n        f = 0;\n      }\n      if (area[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 + 1) * (b2 - b1 + 1) - 2 * (a2 - a1 + 1) - 2 * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  int(*p)[100], (*b)[2];\n  p = a;\n  b = zb;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n      if (*(*(p + i) + j) == 0) {\n        *(*(b + k) + 0) = i;\n        *(*(b + k) + 1) = j;\n        k++;\n      }\n    }\n  }\n  s = (*(*(b + k - 1) + 0) - *(*(b + 0) + 0) - 1) *\n      (*(*(b + k - 1) + 1) - *(*(b + 0) + 1) - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, i, count, key;\n  scanf(\"%d\", &n);\n\n  count = 0;\n  key = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n    }\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0 && a[j + 1] == 0) {\n        break;\n      }\n      if (a[j] == 0)\n        key = 1 - key;\n      if (a[j] * key != 0)\n        count = count + 1;\n    }\n  }\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i = 0, j = 0, p = 0, q = 0, m = 0, n = 0, x1 = 0, y = 0;\n  scanf(\"%d\", &x1);\n  y = 0;\n  for (i = 1; i <= x1; i++) {\n    for (j = 1; j <= x1; j++) {\n      scanf(\"%d\", &a);\n      if ((a == 0) && (y == 0)) {\n        p = i;\n        q = j;\n        y = 1;\n      } else if (a == 0) {\n        m = i;\n        n = j;\n      }\n    }\n  }\n  b = (m - p - 1) * (n - q - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (!a && !k) {\n        a = i;\n        b = j;\n      }\n      if (!k) {\n        c = i;\n        d = j;\n      }\n    }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n}\n"}
{"label": "15", "index": "27092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], i, j, a, b, c, d, n, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        goto A;\n      }\n    }\nA:\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        goto B;\n      }\nB:\n  sum = (c - a - 1) * (d - b - 1);\n  cout << sum << \" \";\n}\n"}
{"label": "15", "index": "27093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, ki, kj, endj, endi, a[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n  ki = -1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 0) {\n        ki = i;\n        kj = j;\n        break;\n      }\n    if (ki >= 0)\n      break;\n  }\n  for (i = ki, j = kj; j <= n; j++)\n    if (a[i][j] == 255) {\n      endj = j - 1;\n      break;\n    }\n  for (i = ki, j = kj; i <= n; i++)\n    if (a[i][j] == 255) {\n      endi = i - 1;\n      break;\n    }\n  s = (endi - ki - 1) * (endj - kj - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, temp1, temp2, i, j, a, b, c, d, e;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  temp1 = 0;\n  temp2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n && temp1 == 0; i++) {\n    for (j = 0; j < n && temp1 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] == 0 && sz[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        temp1 = 1;\n      }\n    }\n  }\n  for (i = a; i < n && temp2 == 0; i++) {\n    for (j = b; j < n && temp2 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] == 0 && sz[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        temp2 = 1;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "27095", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, a[100][100], i, j, i1, i2, j1, j2, k1 = 0, k2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        k1 = 1;\n        break;\n      }\n    if (k1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        k2 = 1;\n        break;\n      }\n    if (k2 == 1)\n      break;\n  }\n  printf(\"%d\", ((i2 - i1 - 1) * (j2 - j1 - 1)));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], i, j, a, b, c, d, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        goto A;\n      }\n    }\nA:\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        goto B;\n      }\nB:\n  sum = (c - a - 1) * (d - b - 1);\n  printf(\"%d \", sum);\n}\n"}
{"label": "15", "index": "27098", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, m = 0, k = 0, p;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = m + 1;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        k = k + 1;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  p = m * k - 2 * m - 2 * k + 4;\n  printf(\"%d\\n\", p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[1000][1000];\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i + 1;\n        y1 = j + 1;\n        break;\n      }\n    }\n    if (x1 != 0 || y1 != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i - 1;\n        y2 = j - 1;\n        break;\n      }\n    }\n    if (x2 != 0 || y2 != 0)\n      break;\n  }\n  area = (x2 - x1 + 1) * (y2 - y1 + 1);\n  cout << area << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x = 0;\n  long i, j, a, b, c, d, e, f, s;\n  scanf(\"%d\", &n);\n  a = b = 0;\n  c = d = e = 255;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &c);\n    if (c == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (j = i + 1; j <= n * n; j++) {\n    c = d;\n    d = e;\n    e = f;\n    scanf(\"%d\", &f);\n    if ((f != 0) && (c == 0) && (d == 0) && (e == 0)) {\n      b = j - 1;\n    }\n  }\n  int o, p, q, r;\n  o = a % n;\n  p = (-b + 1) % n + n;\n  q = a / n;\n  r = b / n;\n  s = (n - o - p) * (r - q - 1);\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "27101", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (j == 0 && m[i][j] == 0)\n        a = j;\n      else if (j != 0 && m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0) {\n        c = i;\n      } else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 &&\n                 m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {0};\n  int n, i, j, b, c, d, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0 && a[i - 1][j - 1] == 0) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j + 1] == 0 && a[i + 1][j] == 0 && a[i + 1][j + 1] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  cout << (d - b + 1) * (e - c + 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27103", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, s = 0, t = 0, q, mianji;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        s++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    q = 0;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        t++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  mianji = (t - 2) * (s - 2);\n  printf(\"%d\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "27104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, b[1000][2];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        b[m][0] = i;\n        b[m][1] = j;\n        m++;\n      }\n    }\n  }\n  cout << (b[m - 1][0] - b[0][0] - 1) * (b[m - 1][1] - b[0][1] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27105", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int n, i, j, start_row, start_col, end_row, end_col, row, col, value, area;\n\n  scanf(\"%i\", &n);\n  start_row = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%i\", &value);\n      if (!value) {\n        row = i;\n        col = j;\n        if (start_row == 0)\n          start_row = row, start_col = col;\n      }\n    }\n  end_row = row, end_col = col;\n  area = (end_row - start_row - 1) * (end_col - start_col - 1);\n  printf(\"%i\", area);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, n, x = 0, k;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n\n  k = 2;\n\n  for (row = k; row < n - k; row++) {\n    for (col = k; col < n - k; col++) {\n      if (sz[row][col] != 0) {\n        x++;\n      }\n    }\n  }\n\n  printf(\"%d\\n\", x);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  int i, j;\n  int x1, y1, x2, y2;\n  int num;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j]) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j]) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0, s = 0, m = 0, l = 0, a, q;\n  scanf(\"%d\", &n);\n  t = n, s = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        if ((m + l) <= (i + j))\n          m = i, l = j;\n        if ((t + s) >= (i + j))\n          t = i, s = j;\n      }\n    }\n  }\n  q = (m - t - 1) * (l - s - 1);\n  cout << q;\n  return 0;\n}\n"}
{"label": "15", "index": "27109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, mian[105][105];\n  int i, j, i1, j1, i2, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> mian[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (mian[i][j] == 0 && mian[i + 1][j] == 0 && mian[i][j + 1] == 0) {\n        i1 = i;\n        j1 = j;\n      } else if (mian[i][j] == 0 && mian[i - 1][j] == 0 &&\n                 mian[i][j - 1] == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a, b, c, d, e = 0, h = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        h = 1;\n      }\n      if (h == 1)\n        break;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "27111", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int m;\n  scanf(\"%d\", &n);\n  int liu[100][100];\n  int i, j, p;\n  int x1, x2, y1, y2;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &liu[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (liu[i][j] == 0 & liu[i + 1][j] == 0 & liu[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (liu[i][j] == 0 & liu[i - 1][j] == 0 & liu[i][j - 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j;\n  int point[1000][1000];\n  int n, s, sum, result;\n  int a, b;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n;) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n    if (a != 0)\n      break;\n    else\n      i++;\n  }\n  for (j = 0; j < n;) {\n    for (i = 0; i < n; i++) {\n      if (point[i][j] == 0) {\n        b = b + 1;\n      }\n    }\n    if (b != 0)\n      break;\n    else\n      j++;\n  }\n  sum = 2 * (a + b - 2);\n  s = a * b;\n  result = s - sum;\n  cout << result << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "27113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  int s = 0;\n  int a, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          x1 = i;\n          y1 = j;\n          s = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  a = (x2 - x1 - 1) * (y2 - y1 - 1);\n  if (a < 0)\n    a = -a;\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "15", "index": "27114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, l = 1000, q = 1001, b = 1001, x = 1000, p, k, z, r;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> (s[i][j]);\n    }\n  }\n  for (k = 0; k < n; k++) {\n    if (l == q) {\n      break;\n    }\n    for (l = 0; l < n; l++) {\n      if (s[k][l] == 0) {\n        q = l;\n        p = k;\n        break;\n      }\n    }\n  }\n  for (int a = n - 1; a > -1; a--) {\n    if (b == x) {\n      break;\n    }\n    for (b = n - 1; b > -1; b--) {\n      if (s[a][b] == 0) {\n        x = b;\n        z = a;\n        break;\n      }\n    }\n  }\n  r = (x - l - 1) * (z - k);\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, d = 0, k, a[1001], s, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        l++;\n    }\n    if (l != 0)\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    int m = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        m++;\n    }\n    if (m != 0)\n      d++;\n    else\n      break;\n  }\n  s = (d - 1) * (l - 2);\n  cout << s;\n}\n"}
{"label": "15", "index": "27116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (x1 - x2 - 1) * (y1 - y2 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "27118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int n, m;\n  int sum, num;\n  int lon, wid;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> (c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0)\n        sum += 1;\n\n      if (sum > 2)\n        lon = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      if (c[i][j] == 0)\n        num += 1;\n      if (num > 2)\n        wid = num;\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "15", "index": "27119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int area[1000][1000];\n  scanf(\"%d\", &n);\n  int f = 1;\n  int start1, start2, end1, end2, re;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        start1 = i;\n        start2 = j;\n        f = 2;\n      }\n      if (area[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n  }\n  re = (end1 - start1 - 1) * (end2 - start2 - 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "27120", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, s, k = 0;\n  int b[1000];\n  b[0] = 0;\n  cin >> n;\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n\n      if (a[i][j] == 0) {\n        b[k] = b[k] + 1;\n      }\n    }\n    if (b[k] != 0) {\n      k += 1;\n    }\n  }\n\n  s = (b[0] - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27121", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint zl[1000][1000];\nint main() {\n  int i, j, n, a, b, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n\n      break;\n    }\n  }\n  a = i;\n  b = j;\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n      break;\n    }\n  }\n  s = (i - a - 1) * (j - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, i, j;\n  scanf(\"%d\", &n);\n  int a = 0, b = 0, c = 0, d = 0, m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a != 0 && b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0 && d != 0)\n      break;\n  }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, col1 = 0, row1 = 0, col2 = 0, row2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        col1 = i;\n        row1 = j;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        col2 = i;\n        row2 = j;\n        break;\n      }\n    }\n\n  printf(\"%d\", (col1 - col2 - 1) * (row2 - row1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, m;\n  int a = 0, b = 0;\n  int count = 0;\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &N[i][j]);\n      if (N[i][j] == 0) {\n        m++, count++;\n      }\n    }\n\n    if (m >= 1) {\n      a++;\n    }\n    if (m > b) {\n      b = m;\n    }\n  }\n  int sum;\n  sum = a * b - count;\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, c, d, e, f, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  s = (c - e - 1) * (f - d - 1);\n  printf(\"%d\", (c - e - 1) * (d - f - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum = 0, len = 0, final;\n  unsigned short a[500][500];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        sum++;\n    }\n  for (i = 0; i < n && len == 0; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        len++;\n    }\n  }\n  final = (sum - 2 * len) / 2 * (len - 2);\n  cout << final << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27127", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c = 0, q = 0, t;\n  int m[1000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        m[i]++;\n        c++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (m[i] != 0)\n      q++;\n  }\n  printf(\"%d\", (q - 2) * (c - 2 * q) / 2);\n}\n"}
{"label": "15", "index": "27128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int len0, wid0, len1, wid1;\n  int a[100][100];\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        len0 = i;\n        wid0 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        len1 = i;\n        wid1 = j;\n      }\n    }\n  printf(\"%d\\n\", abs((len1 - len0 - 1) * (wid1 - wid0 - 1)));\n  return 0;\n}\n"}
{"label": "15", "index": "27129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, rol, col, a, b, c, d, x;\n  int sz1[100][100];\n  scanf(\"%d\", &n);\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz1[rol][col]));\n  }\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      if (sz1[rol][col] == 0) {\n        b = col;\n        break;\n      }\n    }\n  }\n  for (col = 0; col < n; col++) {\n    for (rol = 0; rol < n; rol++) {\n      if (sz1[rol][col] == 0) {\n        a = rol;\n        break;\n      }\n    }\n  }\n  for (col = b; col < n; col++) {\n    if (sz1[a][col] != 0) {\n      d = col - 1;\n      break;\n    }\n  }\n\n  for (rol = a; rol < n; rol++) {\n    if (sz1[rol][d] != 0) {\n      c = rol - 1;\n      break;\n    }\n  }\n\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, x = 0, y = 0, i, j, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x++;\n      }\n    }\n    if (x > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        y++;\n      }\n    }\n    if (y > 0) {\n      break;\n    }\n  }\n  s = (x - 2) * (y - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[1000][1000], m[2], n[2], S, f;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  f = -1;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == 0 && f == -1) {\n        m[0] = i + 1;\n        n[0] = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        m[1] = i - 1;\n        n[1] = j - 1;\n      }\n    }\n  }\n  S = (m[1] - m[0] + 1) * (n[1] - n[0] + 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27132", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[1000][1000];\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i + 1;\n        y1 = j + 1;\n        break;\n      }\n    }\n    if (x1 != 0 || y1 != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i - 1;\n        y2 = j - 1;\n        break;\n      }\n    }\n    if (x2 != 0 || y2 != 0)\n      break;\n  }\n  area = (x2 - x1 + 1) * (y2 - y1 + 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        i = n;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        i = -1;\n        break;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27134", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, left_i = -1, left_j, right_i, right_j, num, temp;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        num++;\n        if (num == 1 && left_i < 0) {\n          left_i = i;\n          left_j = j;\n        } else {\n          right_i = i;\n          right_j = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\\n\", (right_i - left_i - 1) * (right_j - left_i - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1002][1002] = {0}, flag = 0, er, ec, sr, sc;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (*(*(a + i) + j) == 0) {\n        sr = i;\n        sc = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  flag = 0;\n\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (*(*(a + i) + j) == 0) {\n        er = i;\n        ec = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  cout << (er - sr - 1) * (ec - sc - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], i, j, x1, x2, y1, y2, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, hang, hang2, hang3, lie, lie2, lie3, squ;\n  squ = 0;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  for (hang = 0; hang < n; hang++) {\n    for (lie = 0; lie < n; lie++)\n      scanf(\"%d\", &a[hang][lie]);\n  }\n  for (hang = 1; hang < n - 1; hang++) {\n    for (lie = 1; lie < n - 1; lie++) {\n      for (hang2 = hang; a[hang][lie] == 255 && hang2 >= 0; hang2--) {\n        if (a[hang2][lie] == 0) {\n          for (hang3 = hang; hang3 < n; hang3++) {\n            if (a[hang3][lie] == 0) {\n              for (lie2 = lie; lie2 >= 0; lie2--) {\n                if (a[hang][lie2] == 0) {\n                  for (lie3 = lie; lie3 <= n; lie3++) {\n                    if (a[hang][lie3] == 0) {\n                      squ += 1;\n                      break;\n                    }\n                  }\n                  break;\n                }\n              }\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%d\", squ);\n  return 0;\n}\n"}
{"label": "15", "index": "27138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++)\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n        break;\n    if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n      break;\n  }\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++)\n      if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n        break;\n    if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n      break;\n  }\n  printf(\"%d\", (k - i) * (l - j));\n}\n"}
{"label": "15", "index": "27139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N;\n  int **array, i, j;\n  int a = 1000, b = 1000, c = 0, d = 0;\n  scanf(\"%d\", &N);\n  array = (int **)malloc(N * sizeof(int *));\n  for (i = 0; i < N; i++) {\n    array[i] = (int *)malloc(N * sizeof(int));\n    for (j = 0; j < N; j++) {\n      cin >> array[i][j];\n\n      if (array[i][j] == 0 && i <= a && j <= b) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && i >= c && j >= d) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n}\n"}
{"label": "15", "index": "27140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int A[1000][1000];\n  int n, a, b, c, d;\n  int i = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> A[i][j];\n      if (A[i][j] == 0 && A[i][j - 1] != 0 && A[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  cout << (c - a - 1) * (d - b - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, col1 = 0, row1 = 0, col2 = 0, row2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        col1 = i;\n        row1 = j;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        col2 = i;\n        row2 = j;\n        break;\n      }\n    }\n\n  cout << (col1 - col2 - 1) * (row2 - row1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else\n          m++;\n      }\n    } else\n      flag = 0;\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  printf(\"%d\", a * b);\n  return 0;\n}\n"}
{"label": "15", "index": "27143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, ki, kj, endj, endi, a[1000][1000], s;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n  ki = -1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 0) {\n        ki = i;\n        kj = j;\n        break;\n      }\n    if (ki >= 0)\n      break;\n  }\n  for (i = ki, j = kj; j <= n; j++)\n    if (a[i][j] == 255) {\n      endj = j - 1;\n      break;\n    }\n  for (i = ki, j = kj; i <= n; i++)\n    if (a[i][j] == 255) {\n      endi = i - 1;\n      break;\n    }\n  s = (endi - ki - 1) * (endj - kj - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n[1000][1000], ai, aj, zi, zj, i, j, s;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &n[i][j]);\n      if (n[i][j] == 0) {\n        zi = i;\n        zj = j;\n      }\n    }\n  }\n  for (i = (m - 1); i >= 0; i--) {\n    for (j = (m - 1); j >= 0; j--) {\n\n      if (n[i][j] == 0) {\n        ai = i;\n        aj = j;\n      }\n    }\n  }\n  s = (zj - aj - 1) * (zi - ai - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int i, j, n, t, i1 = 0, j1 = 0, i2 = 0, j2 = 0;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    {\n      for (j = 0; j <= n - 1; j++)\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n    }\n    if (a[i1][j1] == 0)\n      break;\n  }\n  for (i = n - 1; i >= i1; i--) {\n    {\n      for (j = n - 1; j >= 0; j--)\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      if (a[i2][j2] == 0)\n        break;\n    }\n  }\n  t = (i2 - i1 - 1) * (j2 - j1 - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "27146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, temp, x1, x2, y1, y2;\n  static int a[1002][1002];\n  int i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &temp);\n      a[i][j] = (temp == 0) ? 1 : 0;\n    }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 1) {\n        if ((a[i][j + 1] == 1) && (a[i + 1][j] == 1)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((a[i][j - 1] == 1) && (a[i - 1][j] == 1)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[1000][1000];\nint main() {\n  int n, i, k, area, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        a = i;\n        b = k;\n        break;\n      }\n    }\n    if (k == n) {\n      if (s[i][k - 1] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (s[i][k] == 0) {\n        c = i;\n        d = k;\n        break;\n      }\n    }\n    if (k == -1) {\n      if (s[i][0] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  area = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h, z;\n  int a[100][100];\n  int x;\n  int a1, b1, a2, b2;\n  int br = 1;\n  int s;\n\n  cin >> n;\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      cin >> a[h][z];\n    }\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0) {\n        a1 = h;\n        b1 = z;\n        br = 0;\n        break;\n      }\n    }\n    if (br == 0)\n      break;\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0 && a[h - 1][z] == 0 && a[h][z - 1] == 0) {\n        a2 = h;\n        b2 = z;\n      }\n    }\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27149", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, c, d, e, f, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  s = (c - e - 1) * (f - d - 1);\n  printf(\"%d\", (c - e - 1) * (d - f - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27150", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, sum = 0, m, k, x;\n  int edge[100][100];\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &edge[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      m = sum;\n      break;\n    }\n  }\n\n  sum = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      k = sum;\n      break;\n    }\n  }\n  x = (k - 2) * (m - 2);\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, sum;\n  scanf(\"%d\\n\", &n);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\\n\", &(sz[row][col]));\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0 && sz[row][col + 1] == 255) {\n        a = row;\n        b = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row > 0; row--) {\n    for (col = n - 1; col > 0; col--) {\n      if (sz[row][col] == 0 && sz[row][col - 1] == 255) {\n        c = row;\n        d = col;\n        break;\n      }\n    }\n  }\n  sum = (c - a + 1) * (d - b + 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, e = -1, r, row1, row2, rol1, rol2, s[1000][1000];\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(s[i][k]));\n      getchar();\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0 && e < 0) {\n        e += 1;\n        row1 = i;\n        rol1 = k;\n      } else if ((s[i][k] == 0) && (e >= 0)) {\n        row2 = i;\n        rol2 = k;\n      }\n    }\n  }\n  r = (row2 - row1 - 1) * (rol2 - rol1 - 1);\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "27153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[1000][1000], count = 0, mark;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    mark = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0 && c[i][j + 1] == 0)\n        break;\n      else {\n        if (c[i][j] == 0)\n          mark++;\n      }\n      if (c[i][j] && mark % 2)\n        count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n}\n"}
{"label": "15", "index": "27154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, feiwu, x, l, s, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0) {\n      x = i + 1;\n      break;\n    }\n  }\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu != 0) {\n      l = i;\n      break;\n    }\n  }\n  s = l - x + 1;\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0)\n      s++;\n  }\n  printf(\"%d\", (l - x - 1) * (s - 2 * (l - x + 1)) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27155", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, s, n, b[2], c[2], q = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      b[p] = i;\n      p += 1;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      c[q] = i;\n      q += 1;\n    }\n  }\n  printf(\"%d\", (b[1] - b[0] - 1) * (c[1] - c[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27156", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], n, s = 0, S, h1 = 0, h2 = 0, l1 = 0, l2 = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && s == 0) {\n        l1 = i + 1;\n        h1 = j + 1;\n        s = 1;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0 && s) {\n        l2 = i;\n        h2 = j;\n        s = 0;\n      }\n  S = (l2 - l1) * (h2 - h1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[100][100], x;\n  scanf(\"%d\", &n);\n  int a1 = n - 1, a2 = 0, b1 = n - 1, b2 = 0;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n      if (s[i][j] == 0) {\n        if (i < a1)\n          a1 = i;\n        if (i > a2)\n          a2 = i;\n        if (j < b1)\n          b1 = j;\n        if (j > b2)\n          b2 = j;\n      }\n    }\n  }\n  x = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27158", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, b[1000][1000], i, k, s;\n  int x1, x2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> (b[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (b[i][k] == 0 && b[i + 1][k] == b[i][k] && b[i][k + 1] == b[i][k]) {\n        x1 = i;\n        y1 = k;\n      }\n      if (b[i][k] == 0 && b[i - 1][k] == b[i][k] && b[i][k - 1] == b[i][k]) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27159", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n, b, c, d, e, i, j, s;\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    for (i = 1; i <= n; i++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((a[i][j] == 0) && (a[i - 1][j] != 0) && (a[i][j - 1] != 0)) {\n        b = i;\n        c = j;\n      } else if ((a[i][j] == 0) && (a[i - 1][j] == 0) && (a[i][j - 1] == 0)) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  s = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  int a1 = -1, a2 = -1, b1 = -1, b2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((i == 0 && j == 0 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0 &&\n           a[i - 1][j] != 0 && a[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((i == n - 1 && j == n - 1 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n           a[i - 1][j] == 0 && a[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n  }\n  int sum = 0;\n  for (i = a1 + 1; i < a2; i++) {\n    for (j = b1 + 1; j < b2; j++) {\n      if (a[i][j] != 0)\n        sum += 1;\n    }\n  }\n  cout << sum << \"\\n\";\n}\n"}
{"label": "15", "index": "27161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, a, b, i, x, e, c, d;\n  scanf(\"%d\", &m);\n  x = m * m;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &e);\n    if (e == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (i = a + 1; i <= x; i++) {\n    scanf(\"%d\", &e);\n    if (e == 0) {\n      b = i;\n    }\n  }\n  c = a % m;\n  d = b % m;\n  c = d - c - 1;\n  a = a / m;\n  b = b / m;\n  d = b - a - 1;\n  printf(\"%d\", c * d);\n  return 0;\n}\n"}
{"label": "15", "index": "27162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, a, b, c, d, e, f, g, h, m, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      scanf(\"%d\", &sz[i][t]);\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        d = b;\n        break;\n      }\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c = b;\n        break;\n      }\n    }\n  }\n  for (e = n - 1; e >= 0; e--) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        g = e;\n        break;\n      }\n    }\n  }\n  for (e = 0; e < n; e++) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        h = e;\n        break;\n      }\n    }\n  }\n\n  m = (h - g - 1) * (c - d - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s[1000][1000], x1, y1, x2, y2, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i + 2][j] == 0 &&\n          s[i][j + 1] == 0 && s[i + 1][j + 1] == 255) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i - 2][j] == 0 &&\n          s[i][j - 1] == 0 && s[i - 1][j - 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, shu[1000][1000], i, k, heng = 0, s = 0, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shu[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (shu[i][k] == 0) {\n        heng += 1;\n      }\n    }\n    if (heng != 0) {\n      break;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (shu[i][k] == 0) {\n        s += 1;\n      }\n    }\n    if (s != 0) {\n      break;\n    }\n  }\n  count = (s - 2) * (heng - 2);\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, s, k = 0;\n  int b[1000];\n  b[0] = 0;\n  scanf(\"%d\", &n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n\n      if (a[i][j] == 0) {\n        b[k] = b[k] + 1;\n      }\n    }\n    if (b[k] != 0) {\n      k += 1;\n    }\n  }\n\n  s = (b[0] - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27166", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int A[100][100];\n  int n, i, j, a, b, p, q, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> A[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 255 && A[i][j - 1] == 255 && A[i - 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255) {\n        p = i;\n        q = j;\n        i = n;\n        j = n;\n      }\n    }\n  }\n  r = (a - p - 2) * (b - q - 1);\n  printf(\"%d\\n\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  int **array, i, j;\n  int a = 1000, b = 1000, c = 0, d = 0;\n  scanf(\"%d\", &N);\n  array = (int **)malloc(N * sizeof(int *));\n  for (i = 0; i < N; i++) {\n    array[i] = (int *)malloc(N * sizeof(int));\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &array[i][j]);\n\n      if (array[i][j] == 0 && i <= a && j <= b) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && i >= c && j >= d) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  int i, j = 0, k = 0, h = 1, a;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      j++;\n    if (a == 0)\n      break;\n  }\n  for (i = 1; i <= n * n - j - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255) {\n      k++;\n    }\n    if (a == 0) {\n      k = 0;\n      h++;\n    }\n  }\n  int x;\n  x = (n - j % n - k % n - 2) * (h - 2 * (n - j % n - k % n)) / 2;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N;\n  int **array, i, j;\n  int a = 1000, b = 1000, c = 0, d = 0;\n  scanf(\"%d\", &N);\n  array = (int **)malloc(N * sizeof(int *));\n  for (i = 0; i < N; i++) {\n    array[i] = (int *)malloc(N * sizeof(int));\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &array[i][j]);\n\n      if (array[i][j] == 0 && i <= a && j <= b) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && i >= c && j >= d) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  cout << (c - a - 1) * (d - b - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a = -1, b = -1, c, d, x, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        c = i;\n        d = j;\n        if ((a == -1) && (b == -1)) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int shuzu[1001], jilu[1001];\n  int a = 0, b = 0, c, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shuzu[k]);\n      if (shuzu[k] == 0) {\n        jilu[a] = k;\n        a++;\n      }\n    }\n    if (a == 2) {\n      c = jilu[1] - jilu[0] - 1;\n      b += c;\n    }\n    a = 0;\n  }\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j;\n  int lup[2], ldown[2], rup[2], rdown[2], area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[i - 1][j - 1] == 255 && a[i - 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        lup[0] = i;\n        lup[1] = j;\n      }\n      if (a[i + 1][j + 1] == 255 && a[i + 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        rdown[0] = i;\n        rdown[1] = j;\n      }\n      if (a[i - 1][j + 1] == 255 && a[i - 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        ldown[0] = i;\n        ldown[1] = j;\n      }\n      if (a[i + 1][j - 1] == 255 && a[i + 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        rup[0] = i;\n        rup[1] = j;\n      }\n    }\n  area = (rup[0] - lup[0] - 1) * (rdown[1] - rup[1] - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "27173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, fir1, fir2, la1, la2, s, a[1000][1000];\n  scanf(\"%d\", &n);\n  fir1 = 0;\n  for (i = 1; i < n + 1; i++)\n    for (j = 1; j < n + 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (fir1 == 0 && a[i][j] == 0) {\n        fir1 = i;\n        fir2 = j;\n      }\n      if (a[i][j] == 0) {\n        la1 = i;\n        la2 = j;\n      }\n    }\n  s = (la1 - fir1 - 1) * (la2 - fir2 - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, p, q, i, k, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      if (sz[i][k] == 0) {\n        p = i;\n        q = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  printf(\"%d\", (p - a - 1) * (q - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  int a = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * (n * n));\n  int k;\n\n  for (k = 0; k < (n * n); k++) {\n    scanf(\"%d\", &(sz[k]));\n    if (sz[k] == 0) {\n      i++;\n    }\n  }\n  int cond = 0;\n  for (k = 0; k < (n * n); k++) {\n    if (sz[k] == 0 && cond == 0) {\n      a++;\n      if (sz[k + 1] == 255) {\n        cond = 1;\n      } else {\n        continue;\n      }\n    }\n  }\n  int j;\n  j = (i - (a)*2) / 2 + 2;\n  int s;\n  s = (j - 2) * (a - 2);\n  printf(\"%d\\n\", s);\n  free(sz);\n  return 0;\n}\n"}
{"label": "15", "index": "27176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[1000][1000];\nint main() {\n  \n  int a = 1, b = 1, j, i, n, m, first = 0;\n  int c = 0, d = 0;\n  scanf(\"%d\", &n);\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        first = 1;\n        break;\n      }\n    }\n\n    if (first == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    c++;\n    if (s[a][j] == 255)\n      break;\n  }\n\n  for (i = a; i < n; i++) {\n    d++;\n    if (s[i][b] == 255)\n      break;\n  }\n\n  m = (c - 3) * (d - 3);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {0};\n  int n, i, j, b, c, d, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0 && a[i - 1][j - 1] == 0) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j + 1] == 0 && a[i + 1][j] == 0 && a[i + 1][j + 1] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  cout << (d - b + 1) * (e - c + 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, a, b, i, x, e, c, d;\n  scanf(\"%d\", &m);\n  x = m * m;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &e);\n    if (e == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (i = a + 1; i <= x; i++) {\n    cin >> e;\n    if (e == 0) {\n      b = i;\n    }\n  }\n  c = a % m;\n  d = b % m;\n  c = d - c - 1;\n  a = a / m;\n  b = b / m;\n  d = b - a - 1;\n  printf(\"%d\", c * d);\n  return 0;\n}\n"}
{"label": "15", "index": "27179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], i, j, a, b, c, d, n, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        goto A;\n      }\n    }\nA:\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        goto B;\n      }\nB:\n  sum = (c - a - 1) * (d - b - 1);\n  cout << sum << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "27180", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int sz[100][100];\n\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n\n  int a1 = 100, b1 = 100, a2 = 0, b2 = 0;\n\n  for (int r = 0; r < n; r++) {\n    for (int c = 0; c < n; c++) {\n      if (sz[r][c] == 0) {\n        a1 = r;\n        b1 = c;\n        break;\n      }\n    }\n    if (a1 != 100 || b1 != 100) {\n      break;\n    }\n  }\n\n  for (int rr = n - 1; rr >= 0; rr--) {\n    for (int cc = n - 1; cc >= 0; cc--) {\n      if (sz[rr][cc] == 0) {\n        a2 = rr;\n        b2 = cc;\n        break;\n      }\n    }\n    if (a2 != 0 || b2 != 0) {\n      break;\n    }\n  }\n\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27181", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[100] = {0};\n  int i, j, n, sum = 0, line = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b[i]++;\n    }\n    if (b[i] > 0)\n      line++;\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  int num = sum * line - 2 * line - 2 * sum + 4;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int y = 0;\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0 && y == 0) {\n        i1 = i;\n        j1 = j;\n        y++;\n      } else if (x == 0 && y != 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, t = 0, flag, line = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        t++;\n        flag = 1;\n      }\n    }\n    if (flag == 1)\n      line++;\n  }\n  cout << (line - 2) * (t - line * 2) / 2;\n  return 0;\n}\n"}
{"label": "15", "index": "27184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int e, f = 0, g[1000];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  while (i < n) {\n    int k = 0;\n    while (k < n) {\n      scanf(\"%d\", &e);\n      if (e == 0) {\n        f++;\n      }\n      k++;\n    }\n\n    g[i] = f;\n    f = 0;\n    i++;\n  }\n\n  int m = 0, x, y;\n  int j = 0;\n  while (j < n) {\n    if (g[j] > m) {\n      m = g[j];\n    }\n    if (g[j] == 0 && g[j + 1] != 0) {\n      x = j;\n    }\n    if (g[j] != 0 && g[j + 1] == 0) {\n      y = j;\n    }\n    j++;\n  }\n\n  int d, sum;\n  d = y - x;\n  sum = (m - 2) * (d - 2);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27185", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, n, a[100][100], i, j, x1, x2, num1, num2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    if (j >= 0)\n      break;\n  }\n  num1 = x2 - x1 + 1;\n  num2 = y2 - y1 + 1;\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "27186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100000], b = 0, c, f = 0, d, e, i, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == 0) {\n      b += 1;\n      if (b == 1)\n        d = i;\n    }\n  }\n  for (i = 0; i < n * n; i++) {\n    if (sz[i] == 0) {\n      f += 1;\n      if (f == b)\n        e = i;\n    }\n  }\n  row1 = d / n;\n  col1 = d % n;\n  row2 = e / n;\n  col2 = e % n;\n  c = (col2 - col1 + 1) * (row2 - row1 + 1) - b;\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27187", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num, l, k, p, q;\n  scanf(\"%d \", &n);\n  int a1, b1, a2, b2;\n  int square[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> square[i][j];\n    }\n  }\n  for (l = 0; l < n; l++) {\n    for (k = 0; k < n; k++) {\n      if (square[l][k] == 0) {\n        a1 = l;\n        b1 = k;\n      }\n    }\n  }\n  for (p = (n - 1); p >= 0; p--) {\n    for (q = (n - 1); q >= 0; q--) {\n      if (square[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n      }\n    }\n  }\n  num = (a1 - a2 - 1) * (b1 - b2 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int loc[1000][1000];\n  int m, n, p, q;\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      cin >> loc[i][j];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (loc[i][j] == 0) {\n        m = i;\n        n = j;\n        break;\n      }\n    }\n    if (loc[m][n] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (loc[i][j] == 0) {\n        p = i;\n        q = j;\n        break;\n      }\n    }\n    if (loc[p][q] == 0) {\n      break;\n    }\n  }\n  int s;\n  s = (p - m - 1) * (q - n - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, l = 1000, q = 1001, b = 1001, x = 1000, p, k, z, r;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n    }\n  }\n  for (k = 0; k < n; k++) {\n    if (l == q) {\n      break;\n    }\n    for (l = 0; l < n; l++) {\n      if (s[k][l] == 0) {\n        q = l;\n        p = k;\n        break;\n      }\n    }\n  }\n  for (int a = n - 1; a > -1; a--) {\n    if (b == x) {\n      break;\n    }\n    for (b = n - 1; b > -1; b--) {\n      if (s[a][b] == 0) {\n        x = b;\n        z = a;\n        break;\n      }\n    }\n  }\n  r = (x - l - 1) * (z - k);\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {2};\n  int i, j, n, n1 = -1, n2 = -1, n3, n4;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n        if (n1 >= 0 || n2 >= 0)\n          continue;\n        else {\n          n1 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", (n3 - n1 - 1) * (n4 - n2 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int SZ[100][100];\n  int n, m1, n1, m2, n2, mj;\n  scanf(\"%d\", &n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &SZ[i][j]);\n    }\n  }\n  for (int p = 0; p < n; p++) {\n    for (int q = 0; q < n; q++) {\n      if (SZ[p][q] == 0) {\n        n1 = p;\n        m1 = q;\n        goto sen1;\n      }\n    }\n  }\nsen1:\n  for (int x = n - 1; x >= 0; x--) {\n    for (int y = n - 1; y >= 0; y--) {\n      if (SZ[x][y] == 0) {\n        n2 = x;\n        m2 = y;\n        goto sen2;\n      }\n    }\n  }\nsen2:\n  mj = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, area, flag = 1, glaf = 0, a_1, a_2, b_1, b_2, term_1, term_2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    term_2 = 1;\n    for (j = 0; j < n; j++) {\n      term_1 = term_2;\n      scanf(\"%d\", &term_2);\n      if (flag) {\n        if (!term_2) {\n          a_1 = i;\n          b_1 = j;\n          flag = !flag;\n        }\n      } else {\n        if (!glaf && i > a_1 && term_1 == 0 && term_2 == 0) {\n          a_2 = i;\n          glaf = !glaf;\n        }\n        if (glaf && term_1 == 0 && term_2 == 255) {\n          b_2 = j - 1;\n          goto label;\n        }\n      }\n    }\n  }\nlabel:\n  area = (a_2 - a_1 - 1) * (b_2 - b_1 - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27193", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], s, i, n, j, a1, b1, a2, b2, p = 0, l, w;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i = i + 1) {\n    if (p == 0)\n      for (j = 0; j < n; j = j + 1) {\n        if (a[i][j] == 0) {\n          a1 = i;\n          b1 = j;\n          p = p + 1;\n        }\n      }\n  }\n  p = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (p == 0)\n      for (j = n - 1; j >= 0; j = j - 1) {\n        if (a[i][j] == 0) {\n          a2 = i;\n          b2 = j;\n          p = p + 1;\n        }\n      }\n  }\n  l = b2 - b1 + 1;\n  w = a1 - a2 + 1;\n  s = w * l;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, b[1000][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        b[m][0] = i;\n        b[m][1] = j;\n        m++;\n      }\n    }\n  printf(\"%d\", (b[m - 1][0] - b[0][0] - 1) * (b[m - 1][1] - b[0][1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27195", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {{255}}, b[1000] = {0}, g[1000] = {0};\nint main() {\n  int n = 0, i = 0, j = 0, c = 0, d = 0, e = 0, f = 0;\n  scanf(\"%d \", &n);\n  if (n > 0 && n < 1000) {\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[j][i] = 255;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        cin >> a[j][i];\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0) {\n          c = j, d = i;\n          goto next;\n        }\n      }\n  next:;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0)\n          e = j, f = i;\n      }\n  }\n  cout << (e - c - 1) * (f - d - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int lon, wid;\n  int m;\n  int c1 = 0, c2 = 0;\n  lon = 0, wid = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c1 = c1 + 1;\n\n        if (c1 > 2)\n\n          lon = c1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        c2 = c2 + 1;\n\n        if (c2 > 2)\n\n          wid = c2;\n        break;\n      }\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, k = 0, i, j;\n  int *a;\n  scanf(\"%d\", &n);\n  a = (int *)(malloc(n * sizeof(int)));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[j]);\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0)\n        break;\n    }\n    for (m = j + 1; m < n; m++) {\n      if (a[m] == 0) {\n        k = k + m - j - 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "27198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, mianji, temp = 0, a = 0, b = 0, n, c;\n  scanf(\"%d \", &n);\n  for (n1 = 1; n1 <= n; n1++) {\n    for (n2 = 1; n2 <= n; n2++) {\n      scanf(\"%d\", &c);\n      if (c == 0)\n        b++;\n    }\n    if (b != temp) {\n      a++;\n      temp = b;\n    }\n  }\n  mianji = (a - 2) * (b / 2 - a);\n  cout << mianji;\n}\n"}
{"label": "15", "index": "27199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sz[500][500];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  int mincol = n, minrow = n, maxcol = 0, maxrow = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i < mincol) {\n          mincol = i;\n        }\n        if (j < minrow) {\n          minrow = j;\n        }\n        if (i > maxcol) {\n          maxcol = i;\n        }\n        if (j > maxrow) {\n          maxrow = j;\n        }\n      }\n    }\n  }\n  int zong;\n  zong = (maxcol - mincol - 1) * (maxrow - minrow - 1);\n  printf(\"%d\", zong);\n  return 0;\n}\n"}
{"label": "15", "index": "27200", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[101][101], p, q, l, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  for (i = 1; i <= p; i++) {\n    for (j = 1; j <= q; j++) {\n      if (a[i][j] == 0) {\n        l = i;\n        m = j;\n        i = p;\n        break;\n      }\n    }\n  }\n  j = (p - l - 1) * (q - m - 1);\n  cout << j;\n  return 0;\n}\n"}
{"label": "15", "index": "27201", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint matrix[1000][1000];\n\nint main(int argc, char *argv[]) {\n  int row, col, k = 0, n, i, j, l;\n  cin >> n;\n  ;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> matrix[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] == 0 && matrix[i][j + 1] != 0 && matrix[i][j - 1] != 0) {\n        for (j; j < n; j++) {\n          if (matrix[i][j + 1] == 255)\n            k++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  cout << k << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1, l1, h2, l2;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        h1 = i;\n        l1 = j;\n        break;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        break;\n        break;\n      }\n    }\n  }\n  cout << (fabs(h2 - h1) - 1) * (fabs(l2 - l1) - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1024][1024], i, j, n, c1, c2, k1, k2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 1024; i++) {\n    for (j = 0; j < 1024; j++)\n      a[i][j] = 1;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        c1 = i + 1;\n        k1 = j + 1;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        c2 = i;\n        k2 = j;\n      }\n    }\n  }\n  cout << (c2 - c1) * (k2 - k1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27204", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, c, r, x, t, r1, r2, c1, c2;\n  scanf(\"%d\", &n);\n  int sz[n][n];\n  t = 0;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      scanf(\"%d\", &(sz[r][c]));\n      if (t == 0 && sz[r][c] == 0) {\n        r1 = r;\n        c1 = c;\n\n        t = 1;\n      }\n    }\n  }\n  t = 0;\n  for (r = n - 1; r >= 0; r--) {\n    for (c = n - 1; c >= 0; c--) {\n      scanf(\"%d\", &(sz[r][c]));\n      if (t == 0 && sz[r][c] == 0) {\n        r2 = r;\n        c2 = c;\n        t = 1;\n      }\n    }\n  }\n  x = (r2 - r1 - 1) * (c2 - c1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27205", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, i, j, a[40][40];\n  scanf(\"%d \", &i);\n  for (i = 1; i < x; i++) {\n    a[i][i] = 1;\n    a[i][1] = 1;\n  }\n  for (i = 3; i < x; i++) {\n    for (j = 2; j <= i - 1; j++)\n      a[i][j] = a[i - 1][j - 1] + a[i - 1][j];\n  }\n  for (i = 1; i < x; i++) {\n    for (j = 1; j < i; j++) {\n      printf(\"%6d\", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, shu[1000][1000], i, k, heng = 0, s = 0, count;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shu[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (shu[i][k] == 0)\n        heng += 1;\n    }\n    if (heng != 0) {\n      break;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (shu[i][k] == 0) {\n        s += 1;\n      }\n    }\n    if (s != 0) {\n      break;\n    }\n  }\n  count = (s - 2) * (heng - 2);\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "27207", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, z, w;\n  int n, i, j, t, s, tz = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0 && tz == 0) {\n        tz++;\n        x = i;\n        y = j;\n      }\n      if (t == 0) {\n        z = i;\n        w = j;\n      }\n    }\n  printf(\"%d\", (z - x - 1) * (w - y - 1));\n}\n"}
{"label": "15", "index": "27208", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, s = 0;\n  cin >> m;\n  int area[1000][1000];\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++)\n      scanf(\"%d\", &area[i][j]);\n  }\n  k = 0;\n  int ib = 0, jb = 0, ie = 0, je = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ib = i;\n          jb = j;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n  for (i = m - 1; i >= 0; i--) {\n    for (j = m - 1; j >= 0; j--) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ie = i;\n          je = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (ie - ib - 1) * (je - jb - 1);\n  printf(\"%d \", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int len0, wid0, len1, wid1;\n  int a[100][100];\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        len0 = i;\n        wid0 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        len1 = i;\n        wid1 = j;\n      }\n    }\n  cout << abs((len1 - len0 - 1) * (wid1 - wid0 - 1)) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  int t[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &t[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (t[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        break;\n      }\n    }\n    if (x1 != -1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (t[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        break;\n      }\n    }\n    if (x2 != -1)\n      break;\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100000], b = 0, c, f = 0, d, e, i, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    cin >> sz[i];\n    if (sz[i] == 0) {\n      b += 1;\n      if (b == 1)\n        d = i;\n    }\n  }\n  for (i = 0; i < n * n; i++) {\n    if (sz[i] == 0) {\n      f += 1;\n      if (f == b)\n        e = i;\n    }\n  }\n  row1 = d / n;\n  col1 = d % n;\n  row2 = e / n;\n  col2 = e % n;\n  c = (col2 - col1 + 1) * (row2 - row1 + 1) - b;\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, e, f;\n  char a[1000][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  c = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != -1)\n      break;\n  }\n\n  e = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (e != -1)\n      break;\n  }\n\n  b = (e - c - 1) * (f - d - 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "27213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int i, j, n, b = 0, c, d = 0, m, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        break;\n      }\n    }\n    if (b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        d = i;\n        m = j;\n        break;\n      }\n    }\n    if (d != 0)\n      break;\n  }\n  s = (d - b - 1) * (m - c - 1);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  int s = 0;\n  int a, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          x1 = i;\n          y1 = j;\n          s = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  a = (x2 - x1 - 1) * (y2 - y1 - 1);\n  if (a < 0)\n    a = -a;\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "15", "index": "27215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a, sum = 0, m;\n  scanf(\"%d\", &n);\n  while (i <= n * n) {\n\n    scanf(\"%d\", &a);\n    i = i + 1;\n    if (a == 0)\n      sum = sum + 1;\n  }\n  m = sum * sum / 16 + 1 - sum / 2;\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a = 0, c = 0, b = 0, d = 0;\n  int s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    if (s[a][b] == 0)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0 && c <= i && d <= j) {\n        c = i;\n        d = j;\n      }\n  m = (d - b - 1) * (c - a - 1);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27217", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (x1 - x2 - 1) * (y1 - y2 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27218", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, i, j, a = 0, b = 1000, c = 0, d = 1000, x, y, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i > a) {\n          a = i;\n        }\n        if (i < b) {\n          b = i;\n        }\n\n        if (j > c) {\n          c = j;\n        }\n        if (j < d) {\n          d = j;\n        }\n      }\n    }\n  }\n  x = a - b - 1;\n  y = c - d - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[101][101], p, q, l, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  for (i = 1; i <= p; i++) {\n    for (j = 1; j <= q; j++) {\n      if (a[i][j] == 0) {\n        l = i;\n        m = j;\n        i = p;\n        break;\n      }\n    }\n  }\n  j = (p - l - 1) * (q - m - 1);\n  cout << j;\n  return 0;\n}\n"}
{"label": "15", "index": "27220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a, sum = 0, m;\n  cin >> n;\n  while (i <= n * n) {\n\n    scanf(\"%d\", &a);\n    i = i + 1;\n    if (a == 0)\n      sum = sum + 1;\n  }\n  m = sum * sum / 16 + 1 - sum / 2;\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, i, j, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 255)\n        s++;\n      else\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n    }\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27222", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, leftrow, leftcolumn, rightrow, rightcolumn, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 0; i < n + 2; i++) {\n    for (j = 0; j < n + 2; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        leftrow = i;\n        leftcolumn = j;\n      }\n      if (a[i][j] == 0 && a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        rightrow = i;\n        rightcolumn = j;\n      }\n    }\n  }\n  s = (rightcolumn - leftcolumn - 1) * (rightrow - leftrow - 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][2000], i, j, h, s = 0, l[100], S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] != 0) {\n      s++;\n    }\n    if (l[i] != 0 && l[i] != 2) {\n      h = l[i];\n    }\n  }\n  S = s * h - 2 * h - 2 * s + 4;\n  printf(\"%d\", S);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27224", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint e[1000][1000];\nint main() {\n  int i, j, n, a, b, c = 0, d = 0, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &e[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (e[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (j = b; j >= 0; j--) {\n    if (e[a][j] == 0) {\n      c++;\n    } else\n      break;\n  }\n  for (i = a; i >= 0; i--) {\n    if (e[i][b] == 0) {\n      d++;\n    } else\n      break;\n  }\n  t = (c - 2) * (d - 2);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int **pp;\n  int n, i, j, k = 0, t = 0, b, c, area;\n  scanf(\"%d\", &n);\n  pp = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i < n; i++)\n    pp[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &pp[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (pp[i - 1][j] - pp[i][j] == 255 && pp[i][j - 1] - pp[i][j] == 255) {\n        k = i;\n        t = j;\n      }\n      if (pp[i][j + 1] - pp[i][j] == 255 && pp[i + 1][j] - pp[i][j] == 255) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  area = (b - k - 1) * (c - t - 1);\n  cout << area << \"\\n\";\n  for (i = 0; i < n; i++)\n    free(pp[i]);\n  free(pp);\n  return 0;\n}\n"}
{"label": "15", "index": "27226", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, n, x = 0, y = 0, l1, l2, q1, q2, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (j = 1; j <= n * n - x; j++) {\n    scanf(\"%d \", &b);\n    if (b == 0) {\n      y = x + j;\n    }\n  }\n  l1 = x / n + 1;\n  if (x % n != 0) {\n    l1 = x / n + 1;\n    q1 = x % n;\n  } else {\n    l1 = x / n;\n    q1 = n;\n  }\n  if (y % n != 0) {\n    l2 = y / n + 1;\n    q2 = y % n;\n  } else {\n    l2 = y / n;\n    q2 = n;\n  }\n  s = (l2 - l1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, i, j, a[40][40];\n  scanf(\"%d\", i);\n  for (i = 1; i < x; i++) {\n    a[i][i] = 1;\n    a[i][1] = 1;\n  }\n  for (i = 3; i < x; i++) {\n    for (j = 2; j <= i - 1; j++)\n      a[i][j] = a[i - 1][j - 1] + a[i - 1][j];\n  }\n  for (i = 1; i < x; i++) {\n    for (j = 1; j < i; j++) {\n      printf(\"%6d\", a[i][j]);\n    }\n    cout << \"\\n\";\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, line = 0, row = 0, mianji;\n  int p[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &p[i][k]);\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (p[i][k] == 0 && p[i - 1][k] == 0)\n        row = row + 1;\n    }\n  }\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][k] == 0 && p[i][k - 1] == 0)\n        line = line + 1;\n    }\n  }\n  mianji = (line / 2 - 1) * (row / 2 - 1);\n  cout << mianji;\n  return 0;\n}\n"}
{"label": "15", "index": "27229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int x1, y1, x2, y2;\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      scanf(\"%d \", &sz[row][col]);\n    }\n  }\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      if (sz[row][col] == 0) {\n        x1 = row;\n        y1 = col;\n      }\n    }\n  }\n  for (int row = n; row > 0; row--) {\n    for (int col = n; col > 0; col--) {\n      if (sz[row][col] == 0) {\n        x2 = row;\n        y2 = col;\n      }\n    }\n  }\n  int s;\n  s = (x2 - x1 + 1) * (y2 - y1 + 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27230", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[10][10];\n  int a;\n  int i, j;\n  int a1, a2, b1, b2;\n  int s;\n  a1 = a2 = b1 = b2 = 0;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = a; j >= 1; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int c, d;\n  c = a1 - a2 - 1;\n  d = b1 - b2 - 1;\n  s = c * d;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cancer[1000][1000];\nint main() {\n  int i, n, j, k1, k2, m1, m2, sum = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &cancer[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (cancer[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n        s = 1;\n        break;\n      }\n    if (s == 1) {\n      s = 0;\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (cancer[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n        s = 1;\n        break;\n      }\n    }\n    if (s == 1) {\n      break;\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = m1; j <= m2; j++)\n      if (cancer[i][j] == 255)\n        sum++;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], n, i, j;\n  int m1, l1, m2, l2;\n  int sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i - 1) + j) != 0 &&\n          *(*(a + i) + j - 1) != 0) {\n        m1 = i;\n        l1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i + 1) + j) != 0 &&\n          *(*(a + i) + j + 1) != 0) {\n        m2 = i;\n        l2 = j;\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, c, ans = 0, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &c);\n      if (!c) {\n        if (flag) {\n          ans = ans + j - flag - 1;\n          flag = 0;\n        } else\n          flag = j;\n      }\n    }\n    flag = 0;\n  }\n  printf(\"%d\", ans);\n}\n"}
{"label": "15", "index": "27234", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int sz[n][n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, a2, b1, b2, a, b, c;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, area, flag = 1, glaf = 0, a_1, a_2, b_1, b_2, term_1, term_2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    term_2 = 1;\n    for (j = 0; j < n; j++) {\n      term_1 = term_2;\n      scanf(\"%d\", &term_2);\n      if (flag) {\n        if (!term_2) {\n          a_1 = i;\n          b_1 = j;\n          flag = !flag;\n        }\n      } else {\n        if (!glaf && i > a_1 && term_1 == 0 && term_2 == 0) {\n          a_2 = i;\n          glaf = !glaf;\n        }\n        if (glaf && term_1 == 0 && term_2 == 255) {\n          b_2 = j - 1;\n          goto label;\n        }\n      }\n    }\n  }\nlabel:\n  area = (a_2 - a_1 - 1) * (b_2 - b_1 - 1);\n  cout << area << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27236", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, leftrow, leftcolumn, rightrow, rightcolumn, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 0; i < n + 2; i++) {\n    for (j = 0; j < n + 2; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        leftrow = i;\n        leftcolumn = j;\n      }\n      if (a[i][j] == 0 && a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        rightrow = i;\n        rightcolumn = j;\n      }\n    }\n  }\n  s = (rightcolumn - leftcolumn - 1) * (rightrow - leftrow - 1);\n  cout << s;\n}\n"}
{"label": "15", "index": "27237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int a = 0, b = 0;\n  int i, j;\n  int c = 1000, d = 1000;\n  int num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (a < i)\n          a = i;\n        if (b < j)\n          b = j;\n        if (c > i)\n          c = i;\n        if (d > j)\n          d = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (a - c - 1) * (b - d - 1));\n}\n"}
{"label": "15", "index": "27238", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x1, y1, x2, y2;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        i = n;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        i = -1;\n        break;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27239", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, c, d;\n  int e = -1, f = -1;\n  int m[1000];\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 1; i <= n; i++) {\n      scanf(\"%d\", &m[i]);\n\n      if (e > 0 && f > 0 && m[i] == 0) {\n        d = k;\n        c = i;\n      }\n      if (e < 0 && f < 0 && m[i] == 0) {\n        e = k;\n        f = i;\n      }\n    }\n  }\n  b = (c - f + 1) * (d - e + 1) - 2 * (c - f + 1) - 2 * (d - e - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int zu[100][100];\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zu[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == 0 && zu[j][i] == 0) {\n        a = j;\n        b = 0;\n      } else if (i != 0 && j == 0 && zu[j][i] == 0) {\n        a = 0;\n        b = i;\n      } else if (j != 0 && i != 0 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 255 && zu[j][i - 1] == 255 && zu[j + 1][i] == 0 &&\n            zu[j][i + 1] == 0) {\n          a = j;\n          b = i;\n        }\n      }\n      if (i == n - 1 && zu[j][i] == 0) {\n        c = j;\n        d = n - 1;\n      } else if (i != n - 1 && j == n - 1 && zu[j][i] == 0) {\n        c = n - 1;\n        d = i;\n      } else if (i != n - 1 && j != n - 1 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 0 && zu[j][i - 1] == 0 && zu[j + 1][i] == 255 &&\n            zu[j][i + 1] == 255) {\n          c = j;\n          d = i;\n        }\n      }\n    }\n  }\n  int mian;\n  mian = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", mian);\n  return 0;\n}\n"}
{"label": "15", "index": "27241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, j1, i2, j2, i, j, t, a[100][100];\n  scanf(\"%d\", &n);\n  if (n == 9)\n    cout << n;\n  else if (n == 6)\n    printf(\"2\");\n\n  else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (j = n - 1; j >= 0; j--) {\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    t = (i2 - i1 - 1) * (j2 - j1 - 1);\n    cout << t << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int count = 0;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < (n * n); j++) {\n    scanf(\"%d\", &i);\n    if (i == 0)\n      count++;\n  }\n  count = count / 4 - 1;\n  s = count * count;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int A[1000][1000];\n  int n, a, b, c, d;\n  int i = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> A[i][j];\n      if (A[i][j] == 0 && A[i][j - 1] != 0 && A[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  int a = 0;\n  int b = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n - 1; col++) {\n      if (b == 0) {\n        if ((sz[row][col] == 0) && (sz[row][col + 1] == 0)) {\n          col = n;\n        } else if ((sz[row][col] == 0) && (sz[row][col + 1] == 255)) {\n          a++;\n          b = 1;\n        }\n      } else if (b == 1) {\n        if ((sz[row][col] == 255) && (sz[row][col + 1] == 255)) {\n          a++;\n        } else if ((sz[row][col] == 255) && (sz[row][col + 1] == 0)) {\n          col = n;\n          b = 0;\n        }\n      }\n    }\n  }\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "15", "index": "27245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int A[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      A[i][j] = x;\n    }\n  }\n  int a, b, c, d;\n  int p;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255 && A[i][j + 1] == 0 &&\n          A[i - 1][j] == 255 && A[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      } else if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i][j + 1] == 255 &&\n                 A[i - 1][j] == 0 && A[i + 1][j] == 255) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  p = (c - a - 1) * (d - b - 1);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "27246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n[1000][1000], ai, aj, zi, zj, i, j, s;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &n[i][j]);\n      if (n[i][j] == 0) {\n        zi = i;\n        zj = j;\n      }\n    }\n  }\n  for (i = (m - 1); i >= 0; i--) {\n    for (j = (m - 1); j >= 0; j--) {\n\n      if (n[i][j] == 0) {\n        ai = i;\n        aj = j;\n      }\n    }\n  }\n  s = (zj - aj - 1) * (zi - ai - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000] = {0}, j, m[100], i, k[100], p[100], b[100], s = 0,\n         g = 0;\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        s += 1;\n        m[s] = j;\n        k[s] = i;\n        break;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (a[j][i] == 0) {\n        g += 1;\n        p[g] = j;\n        b[g] = i;\n        break;\n      }\n    }\n  }\n  cout << (p[1] - m[1] - 1) * (b[1] - k[1] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  int(*p)[100], (*b)[2];\n  p = a;\n  b = zb;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n      if (*(*(p + i) + j) == 0) {\n        *(*(b + k) + 0) = i;\n        *(*(b + k) + 1) = j;\n        k++;\n      }\n    }\n  }\n  s = (*(*(b + k - 1) + 0) - *(*(b + 0) + 0) - 1) *\n      (*(*(b + k - 1) + 1) - *(*(b + 0) + 1) - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j;\n  int lup[2], ldown[2], rup[2], rdown[2], area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[i - 1][j - 1] == 255 && a[i - 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        lup[0] = i;\n        lup[1] = j;\n      }\n      if (a[i + 1][j + 1] == 255 && a[i + 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        rdown[0] = i;\n        rdown[1] = j;\n      }\n      if (a[i - 1][j + 1] == 255 && a[i - 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        ldown[0] = i;\n        ldown[1] = j;\n      }\n      if (a[i + 1][j - 1] == 255 && a[i + 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        rup[0] = i;\n        rup[1] = j;\n      }\n    }\n  area = (rup[0] - lup[0] - 1) * (rdown[1] - rup[1] - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "27250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a1, a2, b1, b2;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  int tag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && tag == 0) {\n        a1 = i;\n        b1 = j;\n        tag = 1;\n      }\n    }\n  }\n  int a, b;\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  int s;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27251", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c[100][100];\n  int a1, a2, b1, b2, a, b, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  a = a1 - a2 - 1;\n  b = b1 - b2 - 1;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, n[1000][1000], i, p, x1, y1, x2, y2, s;\n  i = 0;\n  p = 0;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (p = 0; p < a; p++) {\n      scanf(\"%d\", &(n[i][p]));\n    }\n  }\n  if ((n[0][0] == 0) && (n[1][0] == 0) && (n[0][1]) == 0) {\n    x1 = 0;\n    y1 = 0;\n  }\n  if ((n[a - 1][a - 1] == 0 && (n[a - 2][a - 1] == 0) &&\n       (n[a - 1][a - 2]) == 0)) {\n    x2 = a - 1;\n    y2 = a - 1;\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (p = 1; p < a - 1; p++) {\n      if ((n[i][p] == 0) && (n[i + 1][p] == 0) && (n[i][p + 1]) == 0) {\n        x1 = i;\n        y1 = p;\n      }\n      if ((n[i][p] == 0) && (n[i - 1][p] == 0) && (n[i][p - 1]) == 0) {\n        x2 = i;\n        y2 = p;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, C[1000][1000];\n  int n, s;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(C[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (C[i][j] == 0)\n        sum = sum + 1;\n\n      if (sum > 2)\n        a = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int um = 0;\n    for (i = 0; i < n; i++) {\n      if (C[i][j] == 0)\n        um = um + 1;\n\n      if (um > 2)\n        b = um;\n    }\n  }\n\n  s = (a - 2) * (b - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  cin >> n;\n  int a[100][100];\n  int *q = NULL;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = (*(a + i) + j);\n      if (*q == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n  int len = 1, wid = 1;\n  int j1 = j;\n  for (j = j + 1; j <= n; j++) {\n    q = (*(a + i) + j);\n    if (*q == 0)\n      len++;\n    else\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    q = (*(a + i) + j1);\n    if (*q == 0)\n      wid++;\n    else\n      break;\n  }\n\n  cout << (len - 2) * (wid - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, p, q = 0, r = 0, l = 0, ll = 0;\n  scanf(\"%d\", &n);\n  int s;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      q++;\n      if (ll == 0)\n        l = 1;\n    }\n    if (p == 0 && l == 1) {\n      r++;\n    }\n\n    if (l == 1 && p != 0) {\n      l = 2;\n      ll = 1;\n    }\n  }\n  if (r > n)\n    r = n;\n  s = (q - 2 * r) * (r - 2) / 2;\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], x;\n  cin >> n;\n  int a1 = n - 1, a2 = 0, b1 = n - 1, b2 = 0;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0) {\n        if (i < a1)\n          a1 = i;\n        if (i > a2)\n          a2 = i;\n        if (j < b1)\n          b1 = j;\n        if (j > b2)\n          b2 = j;\n      }\n    }\n  }\n  x = (b2 - b1 - 1) * (a2 - a1 - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "27257", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l1, c1, l2, c2, count = 0, n;\n  int a[500][500];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] != 0 && a[i][j + 1] == 0) {\n        l1 = i;\n        c1 = j + 1;\n        break;\n      }\n    }\n    if (a[i][j] != 0 && a[i][j + 1] == 0) {\n      l1 = i;\n      c1 = j + 1;\n      break;\n    }\n  }\n\n  for (; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0) {\n        l2 = i;\n        c2 = j;\n      }\n    }\n  }\n\n  count = (l2 - l1 - 1) * (c2 - c1 - 1);\n  if (count == -20) {\n    cout << 9;\n  } else if (count == -6) {\n    cout << 2;\n  } else {\n    cout << count;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27258", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0, s = 0, m = 0, l = 0, a, q;\n  scanf(\"%d\", &n);\n  t = n, s = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        if ((m + l) <= (i + j))\n          m = i, l = j;\n        if ((t + s) >= (i + j))\n          t = i, s = j;\n      }\n    }\n  }\n  q = (m - t - 1) * (l - s - 1);\n  printf(\"%d\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "27259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int s[100][100];\n  int i = 0, k = 0, j = 0, h = 0;\n  int e = 0, d = 0, f = 0, g = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(s[row][col]));\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        e = i;\n        d = k;\n        break;\n      }\n    }\n    if (k < n) {\n      if (s[i][k] == 0) {\n        break;\n      }\n    }\n  }\n\n  for (j = n - 1; j >= 0; j--) {\n    for (h = n - 1; h >= 0; h--) {\n      if (s[j][h] == 0) {\n        f = j;\n        g = h;\n        break;\n      }\n    }\n    if (h >= 0) {\n      if (s[j][h] == 0) {\n        break;\n      }\n    }\n  }\n\n  area = (f - e - 1) * (g - d - 1);\n  cout << area << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27260", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, m = 1, x[100], y[100], location[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &location[i][j]);\n      if (location[i][j] == 0) {\n        x[k] = j;\n        k++;\n        y[m] = i;\n        m++;\n      }\n    }\n  }\n  printf(\"%d\\n\", (y[m - 1] - y[1] - 1) * (x[k - 1] - x[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int sz[100][100];\n\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      cin >> sz[row][col];\n    }\n  }\n\n  int a1 = 100, b1 = 100, a2 = 0, b2 = 0;\n\n  for (int r = 0; r < n; r++) {\n    for (int c = 0; c < n; c++) {\n      if (sz[r][c] == 0) {\n        a1 = r;\n        b1 = c;\n        break;\n      }\n    }\n    if (a1 != 100 || b1 != 100) {\n      break;\n    }\n  }\n\n  for (int rr = n - 1; rr >= 0; rr--) {\n    for (int cc = n - 1; cc >= 0; cc--) {\n      if (sz[rr][cc] == 0) {\n        a2 = rr;\n        b2 = cc;\n        break;\n      }\n    }\n    if (a2 != 0 || b2 != 0) {\n      break;\n    }\n  }\n\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, p;\n  scanf(\"%d\", &n);\n  m = n * n;\n  int i, j = 0, k, x = 0, a, b, c, d, e;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &p);\n    if (i % n == 1) {\n      j++;\n    }\n    k = i % n;\n    while (x == 0) {\n      if (p == 0) {\n        a = j;\n        b = k;\n        x = 1;\n      } else {\n        break;\n      }\n    }\n\n    if (p == 0) {\n      c = j;\n      d = k;\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27263", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s = 0, i, j;\n  int a = 0;\n  int b = 0;\n  int sz[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0)\n        a++;\n    }\n    if (a != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0) {\n        b++;\n      }\n    }\n    if (b != 0) {\n      break;\n    }\n  }\n  s = a * b - 2 * a - 2 * b + 4;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, str[500][500], len1 = 0, len2 = 0, t1, t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &str[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (str[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        while (str[t1++][t2] == 0)\n          len1++;\n        while (str[t1 - 2][t2++] == 0)\n          len2++;\n        cout << (len1 - 2) * (len2 - 2) << \"\\n\";\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "27265", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s = 0, i, j;\n  int a = 0;\n  int b = 0;\n  int sz[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a++;\n      }\n    }\n    if (a != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0)\n        b++;\n    }\n    if (b != 0) {\n      break;\n    }\n  }\n  s = a * b - 2 * a - 2 * b + 4;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int x1, y1, x2, y2, k;\n  int i, j;\n  int x;\n  for (i = 1; i <= n * n; i++) {\n\n    cin >> x;\n\n    if (x == 0)\n      break;\n  }\n  for (j = 1; j <= n * n - i; j++) {\n    cin >> x;\n    if (x == 0)\n      k = j + i;\n  }\n  x1 = (int)(i / n) + 1, y1 = i % n;\n  x2 = (int)(k / n) + 1, y2 = k % n;\n  int m;\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz1[1000];\n  int h, j = 0, k = 0, i, n, mj, a = -1, b = -1, c = 0, d;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (a < 0) {\n        c++;\n      }\n      scanf(\"%d\", &sz1[i]);\n      if (sz1[i] == 0) {\n        a = i;\n        b = h;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sz1[i] = 0;\n    }\n  }\n  d = c % n;\n  mj = (b - d) * (a - d);\n  printf(\"%d\\n\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, n, x = 0, y = 0, l1, l2, q1, q2, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (j = 1; j <= n * n - x; j++) {\n    cin >> b;\n    if (b == 0) {\n      y = x + j;\n    }\n  }\n  l1 = x / n + 1;\n  if (x % n != 0) {\n    l1 = x / n + 1;\n    q1 = x % n;\n  } else {\n    l1 = x / n;\n    q1 = n;\n  }\n  if (y % n != 0) {\n    l2 = y / n + 1;\n    q2 = y % n;\n  } else {\n    l2 = y / n;\n    q2 = n;\n  }\n  s = (l2 - l1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27269", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000];\n\nint main() {\n  int n, i, j, i1, j1, i2, j2, flag = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n      if (flag && *(*(a + i) + j) == 0) {\n        i1 = i;\n        j1 = j;\n        flag = 0;\n      }\n    }\n  }\n  for (i = i1; i < n; i++) {\n    if (*(*(a + i) + j1) != 0) {\n      i2 = i - 1;\n      break;\n    }\n  }\n  if (i == n)\n    i2 = i - 1;\n  for (j = j1; j < n; j++) {\n    if (*(*(a + i2) + j) != 0) {\n      j2 = j - 1;\n      break;\n    }\n  }\n  if (j == n)\n    j2 = j - 1;\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], h1, h2, l1, l2, c = 0, b = 0;\n  int n, i, j, h, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (a[h][k] == 0) {\n        h1 = h;\n        l1 = k;\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1) {\n      break;\n    }\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        b = 1;\n        break;\n      }\n    }\n    if (b == 1)\n      break;\n  }\n  cout << (h2 - h1 - 1) * (l2 - l1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27271", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, count, key;\n  cin >> n;\n\n  count = 0;\n  key = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[j];\n\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0 && a[j + 1] == 0) {\n        break;\n      }\n      if (a[j] == 0)\n        key = 1 - key;\n      if (a[j] * key != 0)\n        count = count + 1;\n    }\n  }\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27272", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000][1000];\n  int a, b, c, d, g;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      scanf(\"%d \", &sz[i][k]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        c = i;\n        d = k;\n      }\n    }\n  }\n  g = (a - c - 1) * (b - d - 1);\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "15", "index": "27273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1024][1024], i, j, n, c1, c2, k1, k2;\n  cin >> n;\n  for (i = 0; i < 1024; i++) {\n    for (j = 0; j < 1024; j++) {\n      a[i][j] = 1;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        c1 = i + 1;\n        k1 = j + 1;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        c2 = i;\n        k2 = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (c2 - c1) * (k2 - k1));\n  return 0;\n}\n"}
{"label": "15", "index": "27274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1001][1001] = {0};\n  int i, j, temp = 0;\n  int c1, c2, d1, d2, f1, f2, g1, g2;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        c1 = i;\n        c2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i + 1][j] == 0) {\n        d1 = i;\n        d2 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j + 1] == 0) {\n        f1 = i;\n        f2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        g1 = i;\n        g2 = j;\n      }\n    }\n  temp = (d2 - c2 - 1) * (f1 - c1 - 1);\n  cout << temp;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, j, s = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    for (j++; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 255)\n        s++;\n      else\n        break;\n    }\n    for (j++; j < n; j++)\n      scanf(\"%d\", &a);\n  }\n  cout << s;\n}\n"}
{"label": "15", "index": "27276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, count = 0, fx, fy, lx, ly, start = 0;\n  int a[1002][1002];\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (start == 0 && a[i][j] == 0) {\n        start = 1;\n        fx = i;\n        fy = j;\n      }\n      if (a[i][j] == 0) {\n        lx = i;\n        ly = j;\n      }\n    }\n  }\n\n  cout << (fx - lx + 1) * (fy - ly + 1) << \"\\n\";\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint p[1001][1001];\n\nint main() {\n  int n;\n  int i = 0, j = 0, leftx, lefty, rightx, righty;\n  int flag = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &p[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + 1 < n && j + 1 < n && p[i][j] == 0 && p[i + 1][j] == 0 &&\n          p[i][j + 1] == 0) {\n        leftx = i;\n        lefty = j;\n      }\n      if (i - 1 >= 0 && j - 1 >= 0 && p[i][j] == 0 && p[i - 1][j] == 0 &&\n          p[i][j - 1] == 0) {\n        rightx = i;\n        righty = j;\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  cout << (rightx - leftx - 1) * (righty - lefty - 1) << \"\\n\";\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  int i, j;\n  int x1, y1, x2, y2;\n  int num;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j]) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j]) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  int a = 0;\n  int b = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n - 1; col++) {\n      if (b == 0) {\n        if ((sz[row][col] == 0) && (sz[row][col + 1] == 0)) {\n          col = n;\n        } else if ((sz[row][col] == 0) && (sz[row][col + 1] == 255)) {\n          a++;\n          b = 1;\n        }\n      } else if (b == 1) {\n        if ((sz[row][col] == 255) && (sz[row][col + 1] == 255)) {\n          a++;\n        } else if ((sz[row][col] == 255) && (sz[row][col + 1] == 0)) {\n          col = n;\n          b = 0;\n        }\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "15", "index": "27280", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, S, notfind = 1, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < n && notfind; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        notfind = 0;\n        break;\n      }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "27281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, c;\n  scanf(\"%d\", &n);\n  int count = 0;\n  int f[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &f[i][j]);\n      if (f[i][j] == 0)\n        count = count + 1;\n    }\n    scanf(\"\\n\");\n  }\n  c = (((count + 4) / 4) - 2) * (((count + 4) / 4) - 2);\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1002][1002] = {0}, flag = 0, er, ec, sr, sc;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (*(*(a + i) + j) == 0) {\n        sr = i;\n        sc = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  flag = 0;\n\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (*(*(a + i) + j) == 0) {\n        er = i;\n        ec = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  cout << (er - sr - 1) * (ec - sc - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27283", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j;\n  int lup[2], ldown[2], rup[2], rdown[2], area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  for (i = 1; i < n; i++)\n    for (j = 1; j < n; j++) {\n      if (a[i - 1][j - 1] == 255 && a[i - 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        lup[0] = i;\n        lup[1] = j;\n      }\n      if (a[i + 1][j + 1] == 255 && a[i + 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        rdown[0] = i;\n        rdown[1] = j;\n      }\n      if (a[i - 1][j + 1] == 255 && a[i - 1][j] == 255 && a[i][j + 1] == 255 &&\n          a[i][j] == 0) {\n        ldown[0] = i;\n        ldown[1] = j;\n      }\n      if (a[i + 1][j - 1] == 255 && a[i + 1][j] == 255 && a[i][j - 1] == 255 &&\n          a[i][j] == 0) {\n        rup[0] = i;\n        rup[1] = j;\n      }\n    }\n  area = (rup[0] - lup[0] - 1) * (rdown[1] - rup[1] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[1100][1100];\n  cin >> n;\n  int ans = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        continue;\n      else {\n        int f = 0;\n        for (int k = i + 1; k <= n; k++) {\n          if (a[k][j] == 0 && a[k][j + 1] == 0)\n            f++;\n        }\n        if (f % 2 == 1)\n          ans++;\n      }\n    }\n  }\n  cout << ans;\n  return 0;\n}\n"}
{"label": "15", "index": "27285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  int graphic[100][100];\n  int i = 0, j = 0, rightEst, bottumEst;\n  int width = 0, lengh = 0;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      cin >> graphic[i][j];\n      if (graphic[i][j] == 0) {\n        rightEst = i;\n        bottumEst = j;\n      }\n    }\n  }\n  for (i = rightEst, j = bottumEst; i >= 0; i--) {\n    if (graphic[i][j] == 0)\n      width++;\n    else\n      break;\n  }\n  for (i = rightEst, j = bottumEst; j >= 0; j--) {\n    if (graphic[i][j] == 0)\n      lengh++;\n    else\n      break;\n  }\n  int portation = width * lengh - width * 2 - (lengh - 2) * 2;\n\n  cout << portation << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27286", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a, c, b, d;\n  int image[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &image[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0 && image[i][j - 1] != 0 && image[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      } else if (image[i][j] == 0 && image[i][j + 1] != 0 &&\n                 image[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, n, j, b, c, d, e, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        i = -1;\n        j = -1;\n      }\n    }\n  }\n  x = (d - b + 1) * (e - c + 1) - 2 * (d - b + 1) - 2 * (e - c + 1) + 4;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s, a1 = 0, b1 = 0, a2 = 0, b2 = 0, c[1001][1001];\n\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> c[i][j];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (c[a1][b1] == 0)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (c[a2][b2] == 0)\n      break;\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else {\n          m++;\n        }\n      }\n    } else {\n      flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "27290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, b, c, d = 0, x1, x2, y1, y2, m;\n  scanf(\"%d\", &n);\n  for (b = 0; b < n; b++) {\n    for (c = 0; c < n; c++) {\n      scanf(\"%d\", &a[b][c]);\n      if (a[b][c] == 0 && d == 0) {\n        x1 = b;\n        y1 = c;\n        d = 1;\n      } else {\n        if (a[b][c] == 0 && d == 1) {\n          x2 = b;\n          y2 = c;\n        }\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, c, zl[1000][1000], x, a = 0, b = 0, d = 0, e = 0;\n  cin >> n;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++)\n      cin >> zl[r][c];\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        a = r;\n        b = c;\n        break;\n      }\n    }\n    if (zl[a][b] == 0)\n      break;\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        d = r;\n        e = c;\n      }\n    }\n  }\n  x = (d - a - 1) * (e - b - 1);\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[1000][1000];\n  int a, b, c, d, g;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        c = i;\n        d = k;\n      }\n    }\n  }\n  g = (a - c - 1) * (b - d - 1);\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "15", "index": "27293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[100][100] = {1};\n  scanf(\"%d\\n\", &a);\n  int i, j;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      scanf(\"%d\", &b[i][j]);\n    };\n  }\n  int s = 0, l = 0;\n  for (i = 0; i <= a - 1; i++) {\n    for (j = 0; j <= a - 1; j++) {\n      s = s + b[i][j];\n    }\n    if (s == 255 * (a - 2)) {\n      l = l + 1;\n    }\n    s = 0;\n  }\n  int t = 0, k = 0;\n  for (j = 0; j <= a - 1; j++) {\n    for (i = 0; i <= a - 1; i++) {\n      t = t + b[i][j];\n    }\n    if (t == 255 * (a - 2)) {\n      k = k + 1;\n    }\n    t = 0;\n  }\n\n  int sum = l * k;\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "27294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int sz[100][100];\n  int i, j;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n\n  int a, b, c;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 255) {\n        a = j;\n        break;\n      }\n    }\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 255) {\n        b = j;\n        break;\n      }\n    }\n\n    if (a < b) {\n      c = b - a - 1;\n    } else {\n      c = 0;\n    }\n\n    s = s + c;\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint zhongliu(int, int, int, int);\nint num[1001][1001], n;\nint main() {\n  int i, j, judge = 0, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 255)\n        judge = zhongliu(i, j, 0, 1) + zhongliu(i, j, 0, -1) +\n                zhongliu(i, j, 1, 0) + zhongliu(i, j, -1, 0);\n      if (judge == 4) {\n        sum++;\n      }\n      judge = 0;\n    }\n  }\n  printf(\"%d\", sum);\n  cin >> i;\n\n  return 0;\n}\n\nint zhongliu(int x, int y, int a, int b) {\n  if (x < 0 || y < 0 || x >= n || y >= n)\n    return 0;\n  if (num[x][y] == 0)\n    return 1;\n  else\n    return zhongliu(x + a, y + b, a, b);\n}\n"}
{"label": "15", "index": "27296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, first, num, fstn, counter1 = 0, counter2 = 0;\n  int sum = 0;\n  int c[100][100] = {0};\n  int s[100] = {0};\n  int t[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int tum1 = 0;\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += c[i][j];\n    }\n    tum1 = n - sum / 255;\n    s[i] = tum1;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] != 0) {\n      first = i + 1;\n      fstn = s[i];\n      break;\n    }\n  }\n  for (i = first; s[i] != fstn; i++) {\n    counter1++;\n  }\n  for (j = 0; j < n; j++) {\n    int tum2;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      sum += c[i][j];\n    }\n    tum2 = n - sum / 255;\n    t[j] = tum2;\n  }\n  for (j = 0; j < n; j++) {\n    if (t[j] != 0) {\n      first = j + 1;\n      fstn = t[j];\n      break;\n    }\n  }\n  for (j = first; t[j] != fstn; j++) {\n    counter2++;\n  }\n\n  printf(\"%d\", counter1 * counter2);\n}\n"}
{"label": "15", "index": "27297", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int p[100][100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n\n  int e, b, h, k, kk = 0;\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0) {\n        e = h;\n        b = k;\n        kk = 1;\n        break;\n      }\n    }\n    if (kk == 1)\n      break;\n  }\n  int c, d, l, m;\n  for (l = 0; l < n; l++) {\n    for (m = 0; m < n; m++) {\n      if (p[l][m] == 0) {\n        c = l;\n        d = m;\n      }\n    }\n  }\n  int s;\n  s = (c - e - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 9)\n    printf(\"9\\n\");\n  else if (a == 6)\n    printf(\"2\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int i, j;\n  int chang1[100];\n  int kuan, chang = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0, chang1[i] = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        chang1[i] = chang1[i] + 1;\n      }\n    }\n  }\n  int yo;\n  for (yo = 0; yo < n; yo++) {\n    if (chang1[yo] != 0) {\n      chang = chang1[yo];\n      break;\n    }\n  }\n  int t;\n  for (t = 0, kuan = 0; t < n; t++) {\n    if (chang1[t] == 2)\n      kuan = kuan + 1;\n  }\n  int jieguo;\n  jieguo = kuan * (chang - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "27300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, m, a = 0, b, p = 0, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d\", &m);\n      if (m == 0) {\n        a = a + 1;\n        p = p + 1;\n      }\n    }\n    if (p != 0)\n      q = q + 1;\n    p = 0;\n  }\n  b = (q - 2) * (a - 2 * q) / 2;\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, b[1000][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        b[m][0] = i;\n        b[m][1] = j;\n        m++;\n      }\n    }\n  cout << (b[m - 1][0] - b[0][0] - 1) * (b[m - 1][1] - b[0][1] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  cin >> n;\n  int xiangsu[n][n];\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27303", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, p, q, num1 = 0, num2 = 0, sum;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &a[j][i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        num1++;\n        p = j;\n        q = i;\n      }\n    }\n    if (num1 != 0)\n      break;\n  }\n  for (j = p; a[j][q] == 0; j++)\n    num2++;\n\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int p[1000][1000];\n  int n, word, i, j;\n  int a, b, c, d, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  word = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          a = i;\n          b = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  word = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          c = i;\n          d = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27305", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, C[1000][1000];\n  int n, s;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> (C[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (C[i][j] == 0)\n        sum = sum + 1;\n\n      if (sum > 2)\n        a = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int um = 0;\n    for (i = 0; i < n; i++) {\n      if (C[i][j] == 0)\n        um = um + 1;\n\n      if (um > 2)\n        b = um;\n    }\n  }\n\n  s = (a - 2) * (b - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27306", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int image[1000][1000];\n  int n, i, j, area, begRow, begCol, endRow, endCol, isBreak;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &image[i][j]);\n    }\n\n  isBreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n        begRow = i;\n        begCol = j;\n        isBreak = 1;\n        break;\n      }\n    }\n    if (isBreak)\n      break;\n  }\n\n  for (i = begRow; i < n; i++) {\n    if (i == (n - 1) && image[i][begCol] == 0)\n      endRow = i;\n    else if (image[i][begCol] != 0) {\n      endRow = i - 1;\n      break;\n    }\n  }\n\n  for (j = begCol; j < n; j++) {\n    if (j == (n - 1) && image[begRow][j] == 0)\n      endCol = i;\n    else if (image[begRow][j] != 0) {\n      endCol = j - 1;\n      break;\n    }\n  }\n\n  area = (endRow - begRow - 1) * (endCol - begCol - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "27307", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int i = 0, j = 0;\n  int temp;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0)\n        break;\n    }\n    if (j != n)\n      break;\n  }\n  x1 = i;\n  y1 = j;\n  for (j++; j < n; j++)\n    scanf(\"%d \", &temp);\n  for (i++; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, z[1000][1000], i, j, k, l, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &z[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j < n)\n      break;\n  }\n  k = i;\n  l = j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j >= 0)\n      break;\n  }\n  k = i - k - 1;\n  l = j - l - 1;\n  s = k * l;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b, p, q;\n  scanf(\"%d\", &n);\n  int a[1000][1000], s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < (n / 2); i++) {\n    for (j = 0; j < (n / 2); j++) {\n      if (a[i][j] == 0) {\n        m = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[i][j] == 0) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && i > m && j > b) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m + 1) * (q - b + 1) - (2 * (p + q - m - b));\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, min, max, e, b, c, d, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  max = 0;\n  min = 200;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if ((i + j) > max) {\n          max = i + j;\n          e = i;\n          b = j;\n        }\n        if ((i + j) < min) {\n          min = i + j;\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  t = (e - c + 1) * (b - d + 1) - 2 * (e - c + 1) - 2 * (b - d - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "27311", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, a, b, c, d, log = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        log = 1;\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  log = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        log = 1;\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27312", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, S, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if ((a[i][j] == 0) && (j < n))\n      break;\n  }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "27313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, tmp1, tmp2, m = 0, l = 0, i, s;\n  cin >> n;\n  cin >> tmp1;\n  if (tmp1 == 0) {\n    m++;\n    l++;\n  }\n  for (i = 1; i < n * n; i++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n    m += (tmp2 == 0);\n    if (tmp2 == 255 && tmp1 == 0) {\n      break;\n    }\n    tmp1 = tmp2;\n  }\n  for (int j = i; j < n * n; j++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n  }\n  s = (m - 2) * (l - 2 * m) / 2;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long n, i;\n  int a = 0, b, c, d, e, f;\n  double sum = 0;\n  scanf(\"%ld\", &n);\n  f = 0;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &b);\n    if (b == 0) {\n      f = i;\n      sum += i;\n      a += 1;\n    }\n  }\n  c = sum / a * 2 - f;\n  d = f / n - c / n + 1;\n  e = (a - 2 * d) / 2;\n  printf(\"%d\", (d - 2) * e);\n}\n"}
{"label": "15", "index": "27315", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int lon, wid;\n  int m;\n  int c1 = 0, c2 = 0;\n  lon = 0, wid = 0;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c1 = c1 + 1;\n\n        if (c1 > 2)\n\n          lon = c1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        c2 = c2 + 1;\n\n        if (c2 > 2)\n\n          wid = c2;\n        break;\n      }\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27316", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, p = 0, q = 0;\n  int mianji;\n  scanf(\"%d\\n\", &n);\n  int shu[n];\n  int ge[n];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &shu[j]);\n      if (shu[j] == 0)\n        k++;\n    }\n    ge[i] = k;\n    if (ge[i] > p)\n      p = ge[i];\n    for (j = 0; j < n; j++) {\n      if (shu[j] == 0) {\n        q++;\n        break;\n      }\n    }\n  }\n  mianji = (p - 2) * (q - 2);\n  printf(\"%d\\n\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "27317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int count = 0;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < (n * n); j++) {\n    scanf(\"%d\", &i);\n    if (i == 0)\n      count++;\n  }\n  count = count / 4 - 1;\n  s = count * count;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  int m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[x1][y1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[i][j] == 0) {\n      break;\n    } else\n      ;\n  }\n  m = (y2 - y1 + 1 - 2) * (x2 - x1 + 1 - 2);\n  cout << \"\\n\" << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  int area = 0;\n  int a[1000][1000];\n  int x[2];\n  int y[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if ((j + 1) % n == 0)\n        printf(\" \");\n    }\n  }\n  int flag = 0;\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n && flag == 0; j++) {\n      if (a[i][j] == 0) {\n        x[0] = i;\n        x[1] = j;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0 && flag == 1; i--) {\n    for (j = n - 1; j >= 0 && flag == 1; j--) {\n      if (a[i][j] == 0) {\n        y[0] = i;\n        y[1] = j;\n        flag = 0;\n        break;\n      }\n    }\n  }\n  area = area + (y[1] - x[1] - 1) * (y[0] - x[0] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27320", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[1000][1000];\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i + 1;\n        y1 = j + 1;\n        break;\n      }\n    }\n    if (x1 != 0 || y1 != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i - 1;\n        y2 = j - 1;\n        break;\n      }\n    }\n    if (x2 != 0 || y2 != 0)\n      break;\n  }\n  area = (x2 - x1 + 1) * (y2 - y1 + 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27321", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\n\nint main() {\n  int x1 = 1000, y1 = 1000, x2, y2, i, j, n;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &array_1[i][j]);\n\n      if (array_1[i][j] == 0) {\n        x1 = (i < x1) ? i : x1;\n        y1 = (j < y1) ? j : y1;\n        x2 = i;\n        y2 = j;\n      }\n    }\n\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b, c, d, e, f, g, h;\n  scanf(\"%d\", &b);\n  g = 0;\n  for (c = 0; c < b; c++) {\n    for (d = 0; d < b; d++)\n      scanf(\"%d\", &a[c][d]);\n  }\n  for (e = 0; e < b; e++) {\n    for (f = 0; f < b; f++) {\n      if (a[e][f] == 0)\n        g = g + 1;\n    }\n  }\n  h = (g / 4 - 1) * (g / 4 - 1);\n  printf(\"%d\", h);\n}\n"}
{"label": "15", "index": "27323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int shu[1000][1000];\n  int i, j;\n  int sth, stl, enh, enl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &shu[i][j]);\n  }\n  int b = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (shu[i][j] == 0 && b == -1) {\n        sth = i;\n        stl = j;\n        b = 1;\n      }\n    }\n  }\n  int a = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (shu[i][j] == 0 && a == -1) {\n        enh = i;\n        enl = j;\n        a = 1;\n      }\n    }\n  }\n  int s;\n  s = (enh - sth - 1) * (enl - stl - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27324", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[1000][1000], i, j, a, b, a1, b1, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (p[a][b] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (p[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (p[a1][b1] == 0) {\n      break;\n    }\n  }\n  s = (a1 - a - 1) * (b1 - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, h[100], w = 0, q;\n  int a[100][100];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    h[i] = 0;\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        h[i]++;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      q = h[i];\n      break;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      w++;\n    } else\n      continue;\n  }\n\n  int m = (q - 2) * (w - 2);\n  cout << m;\n}\n"}
{"label": "15", "index": "27326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, a[100][100], b = 0, c, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b++;\n    }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27327", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint zhongliu(int, int, int, int);\nint num[1001][1001], n;\nint main() {\n  int i, j, judge = 0, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 255)\n        judge = zhongliu(i, j, 0, 1) + zhongliu(i, j, 0, -1) +\n                zhongliu(i, j, 1, 0) + zhongliu(i, j, -1, 0);\n      if (judge == 4) {\n        sum++;\n      }\n      judge = 0;\n    }\n  }\n  cout << sum;\n  cin >> i;\n\n  return 0;\n}\n\nint zhongliu(int x, int y, int a, int b) {\n  if (x < 0 || y < 0 || x >= n || y >= n)\n    return 0;\n  if (num[x][y] == 0)\n    return 1;\n  else\n    return zhongliu(x + a, y + b, a, b);\n}\n"}
{"label": "15", "index": "27328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n  int sum1 = 0, sum2 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        for (k = 1;; k++) {\n          if (a[i][j + k] == 0)\n            sum1++;\n          else\n            break;\n        }\n        for (k = 1;; k++) {\n          if (a[i + k][j] == 0)\n            sum2++;\n          else\n            break;\n        }\n        break;\n      }\n      if (sum1 != 0)\n        break;\n    }\n  }\n  cout << (sum1 - 1) * (sum2 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, sum0, n, s, t, b;\n  scanf(\"%d\", &n);\n  sum0 = 0;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        sum0 = sum0 + 1;\n        s = s + 1;\n      }\n    }\n    if (s != 0)\n      t = s;\n    else\n      t = t;\n  }\n  b = (t - 2) * (sum0 - 2 * t) / 2;\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, q[1000][1000], a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &q[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (q[i][j] == 0) {\n        a = i + 1;\n        b = j + 1;\n        goto tsu;\n      }\n    }\n  }\ntsu:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (q[i][j] == 0) {\n        c = i - 1;\n        d = j - 1;\n        goto pku;\n      }\n    }\n  }\npku:\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n}\n"}
{"label": "15", "index": "27331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int d1, d2;\n  scanf(\"%d\", &n);\n\n  int sx = 0, sy, tx, ty;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d1);\n    for (j = 1; j < n; j++) {\n      scanf(\"%d \", &d2);\n      if ((d1 == 0) && (d2 == 0)) {\n        if (sx == 0) {\n          sx = i;\n          sy = j;\n        }\n        tx = i;\n        ty = j + 1;\n      }\n      d1 = d2;\n    }\n  }\n\n  cout << (long)(ty - sy - 1) * (long)(tx - sx - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int sz[100][100];\n  int i, j;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n\n  int a, b, c;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 255) {\n        a = j;\n        break;\n      }\n    }\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 255) {\n        b = j;\n        break;\n      }\n    }\n\n    if (a < b) {\n      c = b - a - 1;\n    } else {\n      c = 0;\n    }\n\n    s = s + c;\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int d1, d2;\n  scanf(\"%d\", &n);\n  \n\n  int sx = 0, sy, tx, ty;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d1);\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &d2);\n      if ((d1 == 0) && (d2 == 0)) {\n        if (sx == 0) {\n          sx = i;\n          sy = j;\n        }\n        tx = i;\n        ty = j + 1;\n      }\n      d1 = d2;\n    }\n  }\n\n  printf(\"%ld\", (long)(ty - sy - 1) * (long)(tx - sx - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, star1, star2, end1, end2, b, n;\n  int f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && f == 0) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  b = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int xs[100][100];\n  int i, j, x1, x2, y1, y2, S;\n  scanf(\"%d\", &n);\n  y1 = 0;\n  y2 = n + 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    x1 = 1;\n    y1++;\n    for (j = 0; j < n; j++) {\n      if (xs[i][j])\n        x1++;\n      else {\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    x2 = n;\n    y2--;\n    for (j = n - 1; j >= 0; j--) {\n      if (xs[i][j]) {\n        x2--;\n      } else {\n        j = -1;\n        i = -1;\n      }\n    }\n  }\n  S = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int board[500][500], n, i, j, r1, c1, r2, c2;\n  int *p = *board;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(p + i * 500 + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(p + i * 500 + j) == 0) {\n        r1 = i;\n        c1 = j;\n        i = 9999;\n        break;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (*(p + i * 500 + j) == 0) {\n        r2 = i;\n        c2 = j;\n        i = -1;\n        break;\n      }\n  printf(\"%d\\n\", (r2 - r1 - 1) * (c2 - c1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[1000][1000];\n  int n, i, j, point1, point2, row1, colum1, row2, colum2, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        point1 = a[i][j];\n        row1 = i;\n        colum1 = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        point2 = a[i][j];\n        row2 = i;\n        colum2 = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  num = (row2 - row1 - 1) * (colum2 - colum1 - 1);\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[100000], b = 0, c, f = 0, d, e, i, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d \", &sz[i]);\n    if (sz[i] == 0) {\n      b += 1;\n      if (b == 1)\n        d = i;\n    }\n  }\n  for (i = 0; i < n * n; i++) {\n    if (sz[i] == 0) {\n      f += 1;\n      if (f == b)\n        e = i;\n    }\n  }\n  row1 = d / n;\n  col1 = d % n;\n  row2 = e / n;\n  col2 = e % n;\n  c = (col2 - col1 + 1) * (row2 - row1 + 1) - b;\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][2000], i, j, h, s = 0, l[100], S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] != 0) {\n      s++;\n    }\n    if (l[i] != 0 && l[i] != 2) {\n      h = l[i];\n    }\n  }\n  S = s * h - 2 * h - 2 * s + 4;\n  printf(\"%d\", S);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, k, line = 0, row = 0, mianji;\n  int p[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &p[i][k]);\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (p[i][k] == 0 && p[i - 1][k] == 0)\n        row = row + 1;\n    }\n  }\n\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][k] == 0 && p[i][k - 1] == 0)\n        line = line + 1;\n    }\n  }\n  mianji = (line / 2 - 1) * (row / 2 - 1);\n  printf(\"%d\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "27341", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, u[1000][1000], i, j, chang = 0, bian = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> u[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (u[i][j] == 0) {\n        chang = chang + 1;\n      }\n    }\n    if (chang != 0) {\n      break;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (u[i][j] == 0) {\n        bian = bian + 1;\n      }\n    }\n    if (bian != 0) {\n      break;\n    }\n  }\n  sum = (chang - 2) * (bian - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, M;\n  scanf(\"%d\", &N);\n  M = N;\n\n  \n  \n  int k[50][50];\n  int i, j, y = 0;\n  int sum = 0;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      if (k[i][j] == 0) {\n        sum++;\n      }\n    }\n  }\n  y = (sum / 4 - 1) * (sum / 4 - 1);\n  printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "15", "index": "27343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], n, i, j;\n  int m1, l1, m2, l2;\n  int sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i - 1) + j) != 0 &&\n          *(*(a + i) + j - 1) != 0) {\n        m1 = i;\n        l1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i + 1) + j) != 0 &&\n          *(*(a + i) + j + 1) != 0) {\n        m2 = i;\n        l2 = j;\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100];\n  int row, col, a = 0, b = 0, c = 0, d = 0, s = 0, p = 0;\n  int i, j, k, l;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p != 1) {\n      for (j = 0; j < n; j++) {\n        if (sz[j][i] == 0) {\n          a = j;\n          b = i;\n          p = 1;\n          break;\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  for (k = n - 1; k >= 0; k--) {\n    if (p != 0) {\n      for (l = n - 1; l >= 0; l--) {\n        if (sz[l][k] == 0) {\n          c = l;\n          d = k;\n          p = 0;\n          break;\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27345", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], m1, n1, m2, n2, t = 0, S;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == a[i][j + 1] && a[i][j] == a[i + 1][j] && a[i][j] == 0) {\n        m1 = i;\n        n1 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  t = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == a[i][j - 1] && a[i][j] == a[i - 1][j] && a[i][j] == 0) {\n        m2 = i;\n        n2 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  S = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, l, m, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n    scanf(\"%d\", &a[i][n - 1]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m++;\n        break;\n      }\n    }\n  }\n  l = 0;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        l++;\n\n        break;\n      }\n    }\n\n  s = (l - 2) * (m - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int m = 0;\n  int l = 0;\n  int t = 0;\n  int L, h, S;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      p[i][j] = x;\n    }\n  }\n  int a, b;\n  for (a = 0; a < n; a++) {\n    if (p[a][0] != 0) {\n      for (b = 1; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b - 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 4;\n      L = (m - 2 * h - 4) / 2;\n    } else {\n      for (b = 0; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b + 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 3;\n      L = (m - 2 * h - 4) / 2;\n    }\n  }\n  S = h * L;\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "27348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, a[1000][1000], m[2], n[2], S, f;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      cin >> a[i][j];\n    }\n  }\n  f = -1;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == 0 && f == -1) {\n        m[0] = i + 1;\n        n[0] = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        m[1] = i - 1;\n        n[1] = j - 1;\n      }\n    }\n  }\n  S = (m[1] - m[0] + 1) * (n[1] - n[0] + 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27349", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x, y, x1, y1, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x = i;\n        y = j;\n        goto l;\n      }\nl:\n  x1 = x;\n  y1 = y;\n\n  while (x1 < n && a[x1][y] == 0)\n    x1++;\n  while (y1 < n && a[x][y1] == 0)\n    y1++;\n  s = (x1 - x - 2) * (y1 - y - 2);\n\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s, a1 = 0, b1 = 0, a2 = 0, b2 = 0, c[1001][1001];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> c[i][j];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (c[a1][b1] == 0)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (c[a2][b2] == 0)\n      break;\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0, s = 0, m = 0, l = 0, a, q;\n  scanf(\"%d \", &n);\n  t = n, s = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        if ((m + l) <= (i + j))\n          m = i, l = j;\n        if ((t + s) >= (i + j))\n          t = i, s = j;\n      }\n    }\n  }\n  q = (m - t - 1) * (l - s - 1);\n  cout << q;\n  return 0;\n}\n"}
{"label": "15", "index": "27352", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, s;\n  a = 4;\n  int p[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &p[i][j]);\n      if (p[i][j] == 0) {\n        a++;\n      } else\n        a = a;\n    }\n    scanf(\"%d\\n\", &p[i][n - 1]);\n  }\n  b = a / 4;\n  s = (b - 2) * (b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[1000][1000];\n  int i, j, sum;\n  int c = 0, k = 0, r = 0, t = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255) {\n        c = i;\n        k = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        r = i;\n        t = j;\n      }\n    }\n  }\n\n  sum = (r - c - 1) * (t - k - 1);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27354", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a = 0, b = 0, c = 0, d = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (k == 0) {\n        c = i;\n        d = j;\n        if (a == 0 && b == 0) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  m = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0, b = 0, c = 0, d = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (!a && !k) {\n        a = i;\n        b = j;\n      }\n      if (!k) {\n        c = i;\n        d = j;\n      }\n    }\n  cout << (c - a - 1) * (d - b - 1);\n}\n"}
{"label": "15", "index": "27356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, b1, a2, b2;\n  int x;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27357", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, h[100], w = 0, q;\n  int a[100][100];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    h[i] = 0;\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        h[i]++;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      q = h[i];\n      break;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      w++;\n    } else\n      continue;\n  }\n\n  int m = (q - 2) * (w - 2);\n  cout << m;\n}\n"}
{"label": "15", "index": "27358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j;\n  int k = 0, l = 0, m = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        k++, m = j;\n    }\n    if (a[i][m] == 0)\n      l++;\n  }\n  k = ((k - 4) / 2 - l + 2) * (l - 2);\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "27359", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[101][100];\n  int n, i, j;\n  cin >> n;\n  i = j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n  int a, b, c, d;\n  a = b = c = d = 0;\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && a == 0 && b == 0)\n        a = i, b = j + 1;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && c <= i && d <= j) {\n        c = i, d = j;\n      }\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  int s;\n  s = (c - a - 1) * (d - b);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++)\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n        break;\n    if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n      break;\n  }\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++)\n      if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n        break;\n    if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n      break;\n  }\n  cout << (k - i) * (l - j);\n}\n"}
{"label": "15", "index": "27361", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int SZ[100][100];\n  int n, m1, n1, m2, n2, mj;\n  cin >> n;\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &SZ[i][j]);\n    }\n  }\n  for (int p = 0; p < n; p++) {\n    for (int q = 0; q < n; q++) {\n      if (SZ[p][q] == 0) {\n        n1 = p;\n        m1 = q;\n        goto sen1;\n      }\n    }\n  }\nsen1:\n  for (int x = n - 1; x >= 0; x--) {\n    for (int y = n - 1; y >= 0; y--) {\n      if (SZ[x][y] == 0) {\n        n2 = x;\n        m2 = y;\n        goto sen2;\n      }\n    }\n  }\nsen2:\n  mj = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27362", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000][1000];\n  int n, a, b, c, d, l;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &shu[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (shu[i][j] == 0) {\n        a = i;\n        b = j;\n\n        break;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (shu[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0)\n      break;\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  int b, start1, start2, end1, end2;\n  b = 0;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && b == 0) {\n        start1 = i + 1;\n        start2 = j + 1;\n        b = 1;\n      }\n      if (a[i][j] == 0 && b == 1) {\n        end1 = i + 1;\n        end2 = j + 1;\n      }\n    }\n  }\n  int area;\n  area = (end1 - start1 - 1) * (end2 - start2 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, o, p, q, A[100][100], i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    A[0][i] = 255;\n    A[i][0] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &A[i][j]);\n    }\n  }\n\n  for (i = 0; i <= n + 1; i++) {\n    A[n + 1][i] = 255;\n    A[i][n + 1] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (A[i - 1][j] == 255 && A[i][j - 1] == 255 && A[i + 1][j] == 0 &&\n          A[i][j + 1] == 0 && A[i][j] == 0) {\n        m = i;\n        o = j;\n      }\n      if (A[i - 1][j] == 0 && A[i][j - 1] == 0 && A[i + 1][j] == 255 &&\n          A[i][j + 1] == 255 && A[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m - 1) * (q - o - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, q = 0, m = 0, number;\n  scanf(\"%d\", &n);\n  int s[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n    if (j == (n - 1)) {\n      scanf(\"%d\\n\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0)\n        q++;\n    }\n    if (q != 0)\n      break;\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (s[b][a] == 0)\n        m++;\n    }\n    if (m != 0)\n      break;\n  }\n\n  number = (q - 2) * (m - 2);\n  printf(\"%d\", number);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27366", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, p[100][100], a, b, c, d;\n  memset(p, 1, sizeof(p));\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) == 0) {\n        a = i;\n        b = j;\n      }\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) == 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) != 0)\n        c = j;\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) == 0 && *(*(p + i + 1) + j) != 0 &&\n          *(*(p + i) + j + 1) == 0)\n        d = i;\n    }\n  printf(\"%d\\n\", (d - a - 1) * (c - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1001][1001];\n  int n, i, j, k, s = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      if (a[i][j] == 0) {\n        for (k = j + 1; k <= n; k++) {\n          if (a[i][k] == 0) {\n            s = s + (k - j - 1);\n            break;\n          }\n        }\n      }\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, b, c, s, y = 0;\n  int **a;\n  cin >> n;\n  a = (int **)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    a[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = i + 1;\n        k = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  y = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        b = i + 1;\n        c = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  s = (b - m - 1) * (c - k - 1);\n  cout << s;\n  for (i = 0; i < n; i++) {\n    free(a[i]);\n    a[i] = 0;\n  }\n  free(a);\n  a = 0;\n}\n"}
{"label": "15", "index": "27369", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  int graphic[100][100];                 \n  int i = 0, j = 0, rightEst, bottumEst; \n  int width = 0, lengh = 0;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &graphic[i][j]);\n      if (graphic[i][j] == 0) {\n        rightEst = i;\n        bottumEst = j; \n      }\n    }\n  }\n  for (i = rightEst, j = bottumEst; i >= 0; i--) { \n    if (graphic[i][j] == 0)\n      width++;\n    else\n      break;\n  }\n  for (i = rightEst, j = bottumEst; j >= 0; j--) { \n    if (graphic[i][j] == 0)\n      lengh++;\n    else\n      break;\n  }\n  int portation = width * lengh - width * 2 - (lengh - 2) * 2; \n\n  cout << portation << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1500][1500], inside = 0, total = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if ((s[i][j] == 0) && (s[i][j + 1] == 0))\n        do {\n          j++;\n        } while ((j < n) && (s[i][j] == 0));\n      else if ((s[i][j] == 0) && (s[i][j + 1] != 0)) {\n        do {\n          j++;\n          if (s[i][j] > 0) {\n            inside++;\n          }\n        } while ((j < n) && (s[i][j] != 0));\n      }\n    }\n  cout << inside << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27371", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n\n  int js = 0;\n\n  for (int m = 0; m < n; m++) {\n    for (int p = 0; p < n; p++) {\n      if (sz[m][p] == 0 && sz[m][p + 1] == 0) {\n        js += 1;\n      }\n    }\n  }\n\n  int a;\n  a = (js - 2) / 2;\n\n  int js2 = 0;\n\n  for (int e = 0; e < n; e++) {\n    for (int r = 0; r < n; r++) {\n      if (sz[r][e] == 0 && sz[r + 1][e] == 0) {\n        js2 += 1;\n      }\n    }\n  }\n\n  int b;\n  b = (js2 - 2) / 2;\n\n  int s;\n  s = a * b;\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int point[1000], i, p, sta, end, total, n, s;\n  scanf(\"%d\", &n);\n  s = 0;\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &point[i]);\n    i = 0;\n    do\n      i++;\n    while ((point[i] == 255) && (i < n));\n    sta = i;\n    i = n;\n    do {\n      i--;\n    } while ((point[i] == 255) && (i > 0));\n    end = i;\n    for (i = sta; i <= end; i++)\n      if (point[i] == 255)\n        s++;\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27373", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, a1, b1, a2, b2, x, y, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if ((a1 == i) && (b1 == j))\n      break;\n  }\n  for (y = b1; y < n; y++) {\n    if (sz[a1][y] == 255) {\n      b2 = y - 1;\n      break;\n    }\n  }\n  for (x = a1; x < n; x++) {\n    if (sz[x][b1] == 255) {\n      a2 = x - 1;\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "27374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, b, c, d, e, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] != 0) && (a[i][j + 1] == 0)) {\n        b = i;\n        c = j + 1;\n      }\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0)) {\n        d = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if ((a[i][j] == 0) && (a[i + 1][j] != 0)) {\n        e = i;\n        j = n;\n      }\n    }\n  }\n  s = (d - c + 1) * (e - b + 1) - (4 + (d - c - 1) * 2 + (e - b - 1) * 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint main() {\n  int n, i, j, b = 0, c = 0, d = 0, e = 0, f, x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n\n  f = (d - b - 1) * (e - c - 1);\n  printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, s, n;\n  int l, r;\n  cin >> n;\n  if (n <= 10) {\n    int cancel[10][10];\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        cin >> cancel[l][r];\n      }\n    }\n    int r1, r2, l1, l2;\n    for (i = 0, l = 0; l < n; l++) {\n      for (i = 0, r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l1 = l;\n          r1 = r;\n          i = 1;\n          break;\n        }\n      }\n      if (i == 1) {\n        break;\n      }\n    }\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l2 = l;\n          r2 = r;\n        }\n      }\n    }\n    s = (l2 - l1 - 1) * (r2 - r1 - 1);\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27377", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long i, j, q, e, n, w, m, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    cin >> a;\n  }\n  q = i;\n  m = n * n;\n  e = i;\n  w = 0;\n  for (j = i; j <= m; j++) {\n    scanf(\"%d \", &a);\n    if (a == 255)\n      w++;\n    if (a == 0) {\n      e++;\n      e = e + w;\n      w = 0;\n    }\n  }\n  if ((q % n - e % n) >= 0) {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((q % n - e % n) - 1);\n  } else {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((e % n - q % n) - 1);\n  }\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, a = 0, t;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n * n; i++)\n\n  {\n    scanf(\"%d\", &m);\n    if (m == 0)\n      a = a + 1;\n  }\n\n  t = (a + 4) / 4;\n  cout << (t - 2) * (t - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int i, j;\n  int chang1[100];\n  int kuan, chang = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0, chang1[i] = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        chang1[i] = chang1[i] + 1;\n    }\n  }\n  int yo;\n  for (yo = 0; yo < n; yo++) {\n    if (chang1[yo] != 0) {\n      chang = chang1[yo];\n      break;\n    }\n  }\n  int t;\n  for (t = 0, kuan = 0; t < n; t++) {\n    if (chang1[t] == 2)\n      kuan = kuan + 1;\n  }\n  int jieguo;\n  jieguo = kuan * (chang - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "27380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int r, i, j, a[505][505], m1, m2, n1, n2, sum = 0;\n  scanf(\"%d\", &r);\n  m1 = r;\n  n1 = r;\n  m2 = 0;\n  n2 = 0;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < r; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        if (i <= m1 && j <= n1) {\n          m1 = i;\n          n1 = j;\n        }\n        if (i >= m2 && j >= n2) {\n          m2 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27381", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0, sum = 0, a[50][50];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        sum += 1;\n      }\n      num = (sum / 4 - 1) * (sum / 4 - 1);\n    }\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1001][1001];\n  int n, i, j, k, s = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      if (a[i][j] == 0) {\n        for (k = j + 1; k <= n; k++) {\n          if (a[i][k] == 0) {\n            s = s + (k - j - 1);\n            break;\n          }\n        }\n      }\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000000], b, i, u_r, u_c, l_r, l_c, count;\n  scanf(\"%d\", &n);\n  b = n * n;\n  for (i = 0; i < b; i++) {\n    scanf(\"%d\", &a[i]);\n  }\n  for (i = 0; i < b; i++) {\n    if (a[i] == 0) {\n      u_r = i / n;\n      u_c = i % n - 1;\n      break;\n    }\n  }\n  for (i = b - 1; i >= 0; i--) {\n    if (a[i] == 0) {\n      l_r = i / n;\n      l_c = i % n - 1;\n      break;\n    }\n  }\n  count = (l_r - u_r - 1) * (l_c - u_c - 1);\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "27384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, x, y, s;\n  a = 0;\n  b = 0;\n  x = -1;\n  y = -1;\n  scanf(\"%d\", &n);\n  int tx[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &tx[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tx[i][j] == 0) {\n        x = j;\n        y = i;\n        break;\n      }\n    }\n    if ((x == j) && (y == i))\n      break;\n  }\n  for (x = j; x < n; x++) {\n    if (tx[x][i] == 0)\n      a = a + 1;\n  }\n  for (y = i; y < n; y++) {\n    if (tx[j][y] == 0) {\n      b = b + 1;\n    }\n  }\n  s = a * b - 2 * (a + b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, x = 2, y = 2;\n  scanf(\"%d\", &n);\n  int a[1000][1000], i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0) {\n        x++;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0) {\n        y++;\n      }\n    }\n  }\n  int s;\n  s = (x / 2 - 2) * (y / 2 - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[1000][1000];\nint main() {\n  int n, i, k, area, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &s[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        a = i;\n        b = k;\n        break;\n      }\n    }\n    if (k == n) {\n      if (s[i][k - 1] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (s[i][k] == 0) {\n        c = i;\n        d = k;\n        break;\n      }\n    }\n    if (k == -1) {\n      if (s[i][0] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  area = (d - b - 1) * (c - a - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "27387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j;\n  int k = 0, l = 0, m = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        k++, m = j;\n    }\n    if (a[i][m] == 0)\n      l++;\n  }\n  k = ((k - 4) / 2 - l + 2) * (l - 2);\n  printf(\"%d\\n\", k);\n}\n"}
{"label": "15", "index": "27388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][2000], i, j, h, s = 0, l[100], S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] != 0)\n      s++;\n\n    if (l[i] != 0 && l[i] != 2) {\n      h = l[i];\n    }\n  }\n  S = s * h - 2 * h - 2 * s + 4;\n  cout << S;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, i, j, x, y, s, m[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i + 1][j] == 0 && m[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (m[i][j] == 0 && m[i][j - 1] == 0 && m[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  x = c - a - 1;\n  y = d - b - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  \n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  scanf(\"%d\", &n);\n  int xiangsu[n][n];\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (k == 0) {\n        c = i;\n        d = j;\n        if (a == 0 && b == 0) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  m = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[1000][1000];\n  int a, b, c, d, g;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        c = i;\n        d = k;\n      }\n    }\n  }\n  g = (a - c - 1) * (b - d - 1);\n  cout << g;\n  return 0;\n}\n"}
{"label": "15", "index": "27393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, i, k, aj, ai, bi, bj;\n  int k1, k2, k3;\n  aj = 0;\n  ai = 0;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> k;\n      k1 = k2;\n      k2 = k3;\n      k3 = k;\n      if (k3 == 0 && k2 == 0 && k1 == 255) {\n        if (aj == 0) {\n          aj = j;\n          ai = i - 1;\n        }\n      } else if (k1 == 0 && k2 == 0 && k3 == 255) {\n        bj = j;\n        bi = i - 1;\n      } else\n        continue;\n    }\n  }\n  cout << ((bj - aj - 1) * (bi - ai - 1)) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int picture[1000][1000];\n  int hang[1000];\n  int i, j;\n  int m = 0, mg = 0, l = 0, number;\n  for (i = 0; i < n; i++) {\n    hang[i] = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &picture[i][j]);\n      if (picture[i][j] == 0) {\n        hang[i] = hang[i] + 1;\n      }\n    }\n    if (hang[i] > 2 && m == 0) {\n      m = i;\n      mg = hang[i];\n    } else if (hang[i] > 2 && m > 0)\n      l = i;\n  }\n  number = (l - m - 1) * (mg - 2);\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27395", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, area, flag = 1, glaf = 0, a_1, a_2, b_1, b_2, term_1, term_2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    term_2 = 1;\n    for (j = 0; j < n; j++) {\n      term_1 = term_2;\n      cin >> term_2;\n      if (flag) {\n        if (!term_2) {\n          a_1 = i;\n          b_1 = j;\n          flag = !flag;\n        }\n      } else {\n        if (!glaf && i > a_1 && term_1 == 0 && term_2 == 0) {\n          a_2 = i;\n          glaf = !glaf;\n        }\n        if (glaf && term_1 == 0 && term_2 == 255) {\n          b_2 = j - 1;\n          goto label;\n        }\n      }\n    }\n  }\nlabel:\n  area = (a_2 - a_1 - 1) * (b_2 - b_1 - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  int i, j;\n  cin >> n;\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &(sz[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  int l = b - d - 1;\n  int w = a - c - 1;\n  int s = l * w;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, sum0, n, s, t, b;\n  scanf(\"%d\", &n);\n  sum0 = 0;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        sum0 = sum0 + 1;\n        s = s + 1;\n      }\n    }\n    if (s != 0)\n      t = s;\n    else\n      t = t;\n  }\n  b = (t - 2) * (sum0 - 2 * t) / 2;\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int row, col, n;\n  int b = 0, c;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0) {\n        b++;\n      }\n    }\n  }\n  c = (b - 4) * (b - 4) / 16;\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, sum0, n, s, t, b;\n  scanf(\"%d\", &n);\n  sum0 = 0;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        sum0 = sum0 + 1;\n        s = s + 1;\n      }\n    }\n    if (s != 0)\n      t = s;\n    else\n      t = t;\n  }\n  b = (t - 2) * (sum0 - 2 * t) / 2;\n  cout << b << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x1 = 0, x2, y1 = 0, y2, num, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        if (x1 == 0)\n          x1 = i + 1;\n        x2 = i;\n        if (y1 == 0)\n          y1 = j + 1;\n        y2 = j;\n      }\n    }\n  s = (x2 - x1) * (y2 - y1);\n  cout << s << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27401", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long n, i;\n  int a = 0, b, c, d, e, f;\n  double sum = 0;\n  scanf(\"%ld \", &n);\n  f = 0;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &b);\n    if (b == 0) {\n      f = i;\n      sum += i;\n      a += 1;\n    }\n  }\n  c = sum / a * 2 - f;\n  d = f / n - c / n + 1;\n  e = (a - 2 * d) / 2;\n  printf(\"%d\", (d - 2) * e);\n  return 0;\n}\n"}
{"label": "15", "index": "27402", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, i, j, a[505][505], m1, m2, n1, n2, sum = 0;\n  cin >> r;\n  m1 = r;\n  n1 = r;\n  m2 = 0;\n  n2 = 0;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < r; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        if (i <= m1 && j <= n1) {\n          m1 = i;\n          n1 = j;\n        }\n        if (i >= m2 && j >= n2) {\n          m2 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27403", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int t, i, j, x = 0, b = 0, m = 0, n = 0, s, s1, s2;\n\n  scanf(\"%d\", &t);\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i][j] == 0) {\n        x = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[x][b] == 0)\n      break;\n  }\n  for (i = t - 1; i >= 0; i--) {\n    for (j = t - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        m = i;\n        n = j;\n\n        break;\n      }\n    }\n    if (a[m][n] == 0)\n      break;\n  }\n  s1 = m - x - 1;\n  s2 = n - b - 1;\n  s = s1 * s2;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, e, f;\n  char a[1000][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  c = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != -1) {\n      break;\n    }\n  }\n\n  e = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (e != -1) {\n      break;\n    }\n  }\n\n  b = (e - c - 1) * (f - d - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, s, n;\n  int l, r;\n  scanf(\"%d\", &n);\n  if (n <= 10) {\n    int cancel[10][10];\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &cancel[l][r]);\n      }\n    }\n    int r1, r2, l1, l2;\n    for (i = 0, l = 0; l < n; l++) {\n      for (i = 0, r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l1 = l;\n          r1 = r;\n          i = 1;\n          break;\n        }\n      }\n      if (i == 1)\n        break;\n    }\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l2 = l;\n          r2 = r;\n        }\n      }\n    }\n    s = (l2 - l1 - 1) * (r2 - r1 - 1);\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27406", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int n, i, j, start_row, start_col, end_row, end_col, row, col, value, area;\n\n  cin >> n;\n  start_row = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%i\", &value);\n      if (!value) {\n        row = i;\n        col = j;\n        if (start_row == 0)\n          start_row = row, start_col = col;\n      }\n    }\n  end_row = row, end_col = col;\n  area = (end_row - start_row - 1) * (end_col - start_col - 1);\n  printf(\"%i\", area);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, c;\n  scanf(\"%d\", &n);\n  int count = 0;\n  int f[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> f[i][j];\n      if (f[i][j] == 0)\n        count = count + 1;\n    }\n    scanf(\"\\n\");\n  }\n  c = (((count + 4) / 4) - 2) * (((count + 4) / 4) - 2);\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000] = {0}, j, m[100], i, k[100], p[100], b[100], s = 0,\n         g = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &a[j][i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        s += 1;\n        m[s] = j;\n        k[s] = i;\n        break;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (a[j][i] == 0) {\n        g += 1;\n        p[g] = j;\n        b[g] = i;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", (p[1] - m[1] - 1) * (b[1] - k[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27409", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, s = 0;\n  int e, b, c, d = 0;\n  int n = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] < a[i][j + 1]) {\n        e = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] < a[i][j - 1]) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27410", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int sz[10][10];\n  int a, b, c, d;\n  int s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n\n  s = (d - b - 1) * (a - c - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else {\n          m++;\n        }\n      }\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  cout << a * b;\n  return 0;\n}\n"}
{"label": "15", "index": "27412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, N[1000][1000], i, j, n, m, a = 0, b = 0, s;\n  scanf(\"%d\", &t);\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      cin >> N[i][j];\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (N[i][j] == 0) {\n        n = i;\n        m = j;\n      }\n    }\n  }\n  for (i = n, j = m; j < t; j--) {\n    if (N[i][j] == 0)\n      a++;\n    else\n      break;\n  }\n  for (j = m, i = n; i < t; i--) {\n    if (N[i][j] == 0) {\n      b++;\n    } else\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27413", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, x = 2, y = 2;\n  scanf(\"%d\", &n);\n  int a[1000][1000], i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0) {\n        x++;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0) {\n        y++;\n      }\n    }\n  }\n  int s;\n  s = (x / 2 - 2) * (y / 2 - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int len0, wid0, len1, wid1;\n  int a[100][100];\n  int i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        len0 = i;\n        wid0 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        len1 = i;\n        wid1 = j;\n      }\n    }\n  cout << abs((len1 - len0 - 1) * (wid1 - wid0 - 1)) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s;\n  scanf(\"%d\", &n);\n  int **p;\n  p = (int **)malloc(sizeof(int *) * n);\n  for (i = 0; i < n; i++)\n    p[i] = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &p[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        if (p[i][j] != p[i - 1][j] && p[i][j] != p[i][j - 1]) {\n          a = i, b = j;\n          break;\n        }\n        if (p[i][j] != p[i + 1][j] && p[i][j] != p[i][j + 1]) {\n          c = i, d = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s << \"\\n\";\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27416", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int x, y, r1, s1, r2, s2, N;\n  for (x = 0; x <= n - 1; x++) {\n    for (y = 0; y <= n - 1; y++) {\n      scanf(\"%d \", &a[x][y]);\n      if (a[x][y] == 0) {\n        r2 = x;\n        s2 = y;\n      }\n    }\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        r1 = x;\n        s1 = y;\n      }\n    }\n  }\n  N = (r2 - r1 + 1) * (s2 - s1 + 1) - (r2 - r1 + s2 - s1) * 2;\n  printf(\"%d\\n\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "27417", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int lefti = 0, leftj = 0, righti = 0, rightj = 0;\n  int number = 0;\n  int n = 0;\n  int i, j;\n  scanf(\"%d\", &n);\n  memset(num, -1, 10000);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && num[i + 1][j] == 0 && num[i][j + 1] == 0) {\n        lefti = i;\n        leftj = j;\n      } else if (num[i][j] == 0 && num[i - 1][j] == 0 && num[i][j - 1] == 0) {\n        righti = i;\n        rightj = j;\n      }\n    }\n  }\n  number = (rightj - leftj - 1) * (righti - lefti - 1);\n  printf(\"%d\\n\", number);\n  printf(\"%d %d %d %d\", lefti, leftj, righti, rightj);\n  return 0;\n}\n"}
{"label": "15", "index": "27418", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, hang, hang2, hang3, lie, lie2, lie3, squ;\n  squ = 0;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  for (hang = 0; hang < n; hang++) {\n    for (lie = 0; lie < n; lie++) {\n      scanf(\"%d\", &a[hang][lie]);\n    }\n  }\n  for (hang = 1; hang < n - 1; hang++) {\n    for (lie = 1; lie < n - 1; lie++) {\n      for (hang2 = hang; a[hang][lie] == 255 && hang2 >= 0; hang2--) {\n        if (a[hang2][lie] == 0) {\n          for (hang3 = hang; hang3 < n; hang3++) {\n            if (a[hang3][lie] == 0) {\n              for (lie2 = lie; lie2 >= 0; lie2--) {\n                if (a[hang][lie2] == 0) {\n                  for (lie3 = lie; lie3 <= n; lie3++) {\n                    if (a[hang][lie3] == 0) {\n                      squ += 1;\n                      break;\n                    }\n                  }\n                  break;\n                }\n              }\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%d\", squ);\n  return 0;\n}\n"}
{"label": "15", "index": "27419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, k, s;\n  s = 0;\n  int e, b, c, d;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(a[i][k]));\n      if (a[i][k] == 0) {\n        s = s + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (a[i][k] == 0) {\n        e = i;\n        b = k;\n        break;\n      }\n    }\n  }\n  for (k = b; k < n; k++) {\n    if (a[e][k] == 255) {\n      break;\n    }\n  }\n  c = k - 1;\n  d = (s - 2 * (c - b + 1)) / 2;\n  int S;\n  S = d * (c - b - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int a, b, c, d, f, i, j, e = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    if (m[a][j] != 0) {\n      c = j - 1;\n      break;\n    }\n  }\n  for (i = a; i < n; i++) {\n    if (m[i][b] != 0) {\n      d = i - 1;\n      break;\n    }\n  }\n  f = (c - b - 1) * (d - a - 1);\n  printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "15", "index": "27421", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x1, x2, y1, y2, s;\n  int a[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  x1 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        y1 = i, x1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  x2 = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        y2 = i, x2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x1, x2, y1, y2, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  x1 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        y1 = i, x1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  x2 = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        y2 = i, x2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27423", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, row, col, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d \", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((sz[row][col] == 0) && (sz[row][col - 1] != 0) &&\n          (sz[row - 1][col] != 0)) {\n        a = row;\n        b = col;\n      }\n      if ((sz[row][col] == 0) && (sz[row][col + 1] != 0) &&\n          (sz[row + 1][col] != 0)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  if ((c - a - 1 > 0) && (d - b - 1 > 0)) {\n    int s = (c - a - 1) * (d - b - 1);\n    printf(\"%d\", s);\n  } else {\n    int s = 0;\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27424", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[500][500], i, j, n, h[3], g[3], s;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        h[1] = i;\n        g[1] = j;\n        break;\n      }\n    }\n  for (i = n; i >= 1; i--)\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        h[2] = i;\n        g[2] = j;\n        break;\n      }\n    }\n  s = (h[1] - h[2] - 1) * (g[2] - g[1] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, b1, b2, c1, c2, flag, flag1, result;\n  scanf(\"%d\\n\", &a);\n  flag1 = 1;\n  flag = 1;\n  for (b = 1; b <= a; b++) {\n    e = 0;\n    if (b <= a - 1) {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\\n\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    } else {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          cin >> d;\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    }\n    if (e != 255 * a && flag1 == 1) {\n      flag1 = 0;\n      c1 = b;\n    }\n    if (e == 255 * a && flag1 == 0) {\n      c2 = b;\n    }\n  }\n  result = (c2 - c1 - 3) * (b2 - b1 - 2);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "27426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int ROW, COL, ROW1, COL1, col, row;\n  int n, k = 0;\n  int T = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  ROW = n - 1;\n  COL = n - 1;\n\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++)\n      scanf(\"%d\", &sz[row][col]);\n  }\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      if (T == 0 && sz[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n\n        T = 1;\n      }\n    }\n  }\n  for (row = ROW; row >= ROW1; row--) {\n    for (col = COL; col >= COL1; col--) {\n      if (T == 0 && sz[row][col] == 0) {\n        COL = col;\n        ROW = row;\n\n        T = 1;\n      }\n    }\n  }\n\n  a = ROW - ROW1 - 3;\n  b = COL - COL1 - 1;\n  k = a * b;\n  cout << k;\n  return 0;\n}\n"}
{"label": "15", "index": "27427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k = 0, s, n;\n  int imin, imax, jmax;\n  cin >> n;\n  imin = 100;\n  imax = 0;\n  jmax = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        k++;\n        if (i < imin)\n          imin = i;\n        if (i > imax)\n          imax = i;\n        if (j > jmax)\n          jmax = j;\n      }\n    }\n\n  s = (imax - imin + 1) * (jmax - imin + 1);\n  cout << s - k << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, l = 1000, q = 1001, b = 1001, x = 1000, p, k, z, r;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n    }\n  }\n  for (k = 0; k < n; k++) {\n    if (l == q) {\n      break;\n    }\n    for (l = 0; l < n; l++) {\n      if (s[k][l] == 0) {\n        q = l;\n        p = k;\n        break;\n      }\n    }\n  }\n  for (int a = n - 1; a > -1; a--) {\n    if (b == x) {\n      break;\n    }\n    for (b = n - 1; b > -1; b--) {\n      if (s[a][b] == 0) {\n        x = b;\n        z = a;\n        break;\n      }\n    }\n  }\n  r = (x - l - 1) * (z - k);\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "27429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, aa1, bb1, aa2, bb2, a[99][99];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        aa1 = i;\n        bb1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        aa2 = i;\n        bb2 = j;\n      }\n    }\n  }\n  cout << (aa2 - aa1 - 1) * (bb2 - bb1 - 1);\n}\n"}
{"label": "15", "index": "27430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, b, x, p = 0, q;\n  cin >> a;\n  for (i = 1; i <= a; i++) {\n    for (x = 0, j = 1; j <= a; j++) {\n      cin >> b;\n      if (b == 0)\n        x = x + 1;\n      else\n        x = x + 0;\n    }\n    if (x != 0) {\n      p++;\n      q = x;\n    }\n  }\n  printf(\"%d\", (p - 2) * (q - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, first, num, fstn, counter1 = 0, counter2 = 0;\n  int sum = 0;\n  int c[100][100] = {0};\n  int s[100] = {0};\n  int t[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int tum1 = 0;\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += c[i][j];\n    }\n    tum1 = n - sum / 255;\n    s[i] = tum1;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] != 0) {\n      first = i + 1;\n      fstn = s[i];\n      break;\n    }\n  }\n  for (i = first; s[i] != fstn; i++) {\n    counter1++;\n  }\n  for (j = 0; j < n; j++) {\n    int tum2;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      sum += c[i][j];\n    }\n    tum2 = n - sum / 255;\n    t[j] = tum2;\n  }\n  for (j = 0; j < n; j++) {\n    if (t[j] != 0) {\n      first = j + 1;\n      fstn = t[j];\n      break;\n    }\n  }\n  for (j = first; t[j] != fstn; j++) {\n    counter2++;\n  }\n\n  printf(\"%d\", counter1 * counter2);\n}\n"}
{"label": "15", "index": "27432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n, a[1000][1000], p = 0, q, r = 0, i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && a[i][j - 1] == 0)\n        p = p + 1;\n      if (a[i][j] == 0)\n        q = q + 1;\n    }\n    if (q >= 1)\n      r = r + 1;\n  }\n  s = (p / 2 - 1) * (r - 2);\n  printf(\"%c\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int bian, row, col;\n  int shuzu[500][500];\n  int i, j, m = 0, n = 0;\n  int sum;\n\n  scanf(\"%d\", &bian);\n  row = bian;\n  col = bian;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      cin >> shuzu[i][j];\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (shuzu[i][j] == 0) {\n        m += 1;\n        break;\n      }\n    }\n  }\n\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < row; i++) {\n      if (shuzu[i][j] == 0) {\n        n += 1;\n        break;\n      }\n    }\n  }\n\n  sum = (m - 2) * (n - 2);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27434", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num, l, k, p, q;\n  scanf(\"%d\", &n);\n  int a1, b1, a2, b2;\n  int square[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &square[i][j]);\n    }\n  }\n  for (l = 0; l < n; l++) {\n    for (k = 0; k < n; k++) {\n      if (square[l][k] == 0) {\n        a1 = l;\n        b1 = k;\n      }\n    }\n  }\n  for (p = (n - 1); p >= 0; p--) {\n    for (q = (n - 1); q >= 0; q--) {\n      if (square[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n      }\n    }\n  }\n  num = (a1 - a2 - 1) * (b1 - b2 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27435", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, temp1, temp2, i, j, a, b, k, c, d, e;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  temp1 = 0;\n  temp2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> sz[i][j];\n  }\n  for (i = 0; i < n && temp1 == 0; i++) {\n    for (j = 0; j < n && temp1 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] == 0 && sz[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        temp1 = 1;\n      }\n    }\n  }\n  for (i = a; i < n && temp2 == 0; i++) {\n    for (j = b; j < n && temp2 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] == 0 && sz[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        temp2 = 1;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0;\n  int k[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &k[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k[i][j] == 0) {\n        while (k[i][j + 1] == 255) {\n          j++;\n          num++;\n        }\n\n        if (k[i][j + 1] == 0)\n          break;\n      }\n    }\n  }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, i, j, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (sz[i - 1][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j - 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (sz[i][j + 1] == 0 && sz[i + 1][j] == 0 && sz[i + 1][j + 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27438", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A[100][100];\n  int n, i, j, a, b, p, q, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &A[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 255 && A[i][j - 1] == 255 && A[i - 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255) {\n        p = i;\n        q = j;\n        i = n;\n        j = n;\n      }\n    }\n  }\n  r = (a - p - 2) * (b - q - 1);\n  printf(\"%d\\n\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b, c, d, e, f, g, h;\n  scanf(\"%d\", &b);\n  g = 0;\n  for (c = 0; c < b; c++) {\n    for (d = 0; d < b; d++) {\n      scanf(\"%d\", &a[c][d]);\n    }\n  }\n  for (e = 0; e < b; e++) {\n    for (f = 0; f < b; f++) {\n      if (a[e][f] == 0)\n        g = g + 1;\n    }\n  }\n  h = (g / 4 - 1) * (g / 4 - 1);\n  printf(\"%d\", h);\n}\n"}
{"label": "15", "index": "27440", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, s = 0;\n  int e, b, c, d = 0;\n  int n = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] < a[i][j + 1]) {\n        e = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] < a[i][j - 1]) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27441", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum = 0, len = 0, final;\n  unsigned short a[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        sum++;\n    }\n  for (i = 0; i < n && len == 0; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        len++;\n    }\n  final = (sum - 2 * len) / 2 * (len - 2);\n  cout << final << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint main() {\n  int n, i, j, b = 0, c = 0, d = 0, e = 0, f, x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n\n  f = (d - b - 1) * (e - c - 1);\n  printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, p;\n  scanf(\"%d\", &n);\n  m = n * n;\n  int i, j = 0, k, x = 0, a, b, c, d, e;\n  for (i = 1; i <= m; i++) {\n    scanf(\"%d\", &p);\n    if (i % n == 1) {\n      j++;\n    }\n    k = i % n;\n    while (x == 0) {\n      if (p == 0) {\n        a = j;\n        b = k;\n        x = 1;\n      } else {\n        break;\n      }\n    }\n\n    if (p == 0) {\n      c = j;\n      d = k;\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  cout << e << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27444", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, n, flag = 1, a = 0, b = 0, num;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> num;\n    if ((num == 0) && (flag == 1)) {\n      a++;\n    }\n    if ((a > 0) && (num != 0)) {\n      flag = 0;\n    }\n    if (num == 0) {\n      b++;\n    }\n  }\n  cout << a * ((b - 2 * a) / 2 + 2) - b << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      cin >> a[row][col];\n  }\n\n  int flag = 0;\n  for (row = 0; row < n && !flag; row++) {\n    for (col = 0; col < n && !flag; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  flag = 0;\n  for (row = n - 1; row >= 0 && !flag; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 - 1) * (COL2 - COL1 - 1);\n\n  cout << sum << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a1, a2, b1, b2, m;\n  scanf(\"%d\", &n);\n  int num[1000][1000];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (num[i][j] == 0) {\n        a1 = i;\n        a2 = j;\n      }\n  for (i = n - 1; i > 0; i--)\n    for (j = n - 1; j > 0; j--)\n      if (num[i][j] == 0) {\n        b1 = i;\n        b2 = j;\n      }\n  m = (a1 - b1 - 1) * (a2 - b2 - 1);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, c, r, x, t, r1, r2, c1, c2;\n  scanf(\"%d\", &n);\n  int sz[n][n];\n  t = 0;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      cin >> (sz[r][c]);\n      if (t == 0 && sz[r][c] == 0) {\n        r1 = r;\n        c1 = c;\n\n        t = 1;\n      }\n    }\n  }\n  t = 0;\n  for (r = n - 1; r >= 0; r--) {\n    for (c = n - 1; c >= 0; c--) {\n      scanf(\"%d\", &(sz[r][c]));\n      if (t == 0 && sz[r][c] == 0) {\n        r2 = r;\n        c2 = c;\n        t = 1;\n      }\n    }\n  }\n  x = (r2 - r1 - 1) * (c2 - c1 - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "27448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a1, a2, b1, b2, c, d = 0, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      break;\n  }\n  for (j = n - 1; j > b1; j--) {\n    for (i = n - 1; i > a1; i--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  c = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27449", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, c, ans = 0, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &c);\n      if (!c) {\n        if (flag) {\n          ans = ans + j - flag - 1;\n          flag = 0;\n        } else\n          flag = j;\n      }\n    }\n    flag = 0;\n  }\n  printf(\"%d\", ans);\n}\n"}
{"label": "15", "index": "27450", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, x1 = 0, x2, y1 = 0, y2, num, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (x1 == 0)\n          x1 = i + 1;\n        x2 = i;\n        if (y1 == 0)\n          y1 = j + 1;\n        y2 = j;\n      }\n    }\n  s = (x2 - x1) * (y2 - y1);\n  printf(\"%d\\n\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, flag = 0, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        row1 = i;\n        col1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        row2 = i;\n        col2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  printf(\"%d\", (row2 - row1 - 1) * (col2 - col1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, e = -1, r, row1, row2, rol1, rol2, s[1000][1000];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(s[i][k]));\n      getchar();\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0 && e < 0) {\n        e += 1;\n        row1 = i;\n        rol1 = k;\n      } else if ((s[i][k] == 0) && (e >= 0)) {\n        row2 = i;\n        rol2 = k;\n      }\n    }\n  }\n  r = (row2 - row1 - 1) * (rol2 - rol1 - 1);\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, num;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 1; i < n - 1; i++)\n\n  {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i - 1][j - 1] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i + 1][j + 1] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n    num = (x2 - x1 + 1) * (y2 - y1 + 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27454", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10], n, i, j, b, t, q, sum;\n  scanf(\"%d\", &n);\n  for (i = 0, t = 0; i <= (n - 1); i++) {\n    for (j = 0, sum = 0; j <= (n - 1); j++) {\n      scanf(\"%d\", &a[j]);\n      sum = sum + a[j];\n    }\n    if (sum == (n * 255))\n      continue;\n    b = (n * 255 - sum) / 255;\n    t = t + 1;\n  }\n  q = (t - 2) * (b - 2);\n  printf(\"%d\", q);\n}\n"}
{"label": "15", "index": "27455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sum = 0, len = 0, final;\n  unsigned short a[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        sum++;\n    }\n  for (i = 0; i < n && len == 0; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        len++;\n    }\n  final = (sum - 2 * len) / 2 * (len - 2);\n  printf(\"%d\\n\", final);\n  return 0;\n}\n"}
{"label": "15", "index": "27456", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x, y, p, q, s, t, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(*(a + i) + j) == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n  for (p = n - 1; p >= 0; p--)\n    for (q = n - 1; q >= 0; q--)\n      if (*(*(a + p) + q) == 0) {\n        s = p;\n        t = q;\n        break;\n      }\n  printf(\"%d\", (x - s - 1) * (t - y - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k1, k2, m1, m2, s;\n  int a[1001][1001];\n  k1 = 0;\n  k2 = 0;\n  m1 = 0;\n  m2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j - 1] != 0 && a[i - 1][j] != 0 && a[i][j + 1] == 0 &&\n          a[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n      } else if (a[i][j - 1] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n                 a[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n      }\n    }\n  s = (k2 - k1 - 1) * (m2 - m1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "15", "index": "27459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t[100][100] = {0}, i, j, n, row[2] = {0}, col[2] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> t[i][j];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n\n      if (t[i][j] == 0 && row[0] == 0)\n        row[0] = i;\n      if (t[n - i + 1][j] == 0 && row[1] == 0)\n        row[1] = n - i + 1;\n      if (t[j][i] == 0 && col[0] == 0)\n        col[0] = i;\n      if (t[n - j + 1][n - i + 1] == 0 && col[1] == 0)\n\n        col[1] = n - i + 1;\n    }\n  }\n  cout << (row[1] - row[0] - 1) * (col[1] - col[0] - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27460", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a, sum = 0, m;\n  scanf(\"%d\", &n);\n  while (i <= n * n) {\n\n    scanf(\"%d\", &a);\n    i = i + 1;\n    if (a == 0)\n      sum = sum + 1;\n  }\n  m = sum * sum / 16 + 1 - sum / 2;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27461", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (sz[i][j] == 0)\n        break;\n    if (j < n)\n      break;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--)\n      if (sz[x][y] == 0)\n        break;\n    if (y >= 0)\n      break;\n  }\n  s = (x - i - 1) * (y - j - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27462", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, q, e, n, w, m, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    cin >> a;\n  }\n  q = i;\n  m = n * n;\n  e = i;\n  w = 0;\n  for (j = i; j <= m; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      w++;\n    if (a == 0) {\n      e++;\n      e = e + w;\n      w = 0;\n    }\n  }\n  if ((q % n - e % n) >= 0) {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((q % n - e % n) - 1);\n  } else {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((e % n - q % n) - 1);\n  }\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, e, f, count = 0, num, m, c, d;\n  cin >> n;\n  count = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &m);\n      if ((m == 0) && (count == 0)) {\n        c = i;\n        d = j;\n        count = 1;\n      } else if (m == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  num = (e - c - 1) * (f - d - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  int k;\n  int sum = 0;\n  for (k = 0; k < n && sum == 0; k++) {\n    int p;\n    for (p = 0; p < n; p++) {\n      if (sz[k][p] == 0) {\n        sum = sum + 1;\n      }\n    }\n  }\n  int sum1 = 0;\n  int q;\n  for (q = 0; q < n && sum1 == 0; q++) {\n    int m;\n    for (m = 0; m < n; m++) {\n      if (sz[m][q] == 0) {\n        sum1++;\n      }\n    }\n  }\n\n  int jieguo = (sum - 2) * (sum1 - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "27465", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0)\n      break;\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int c = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255)\n        c++;\n    }\n  }\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27466", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a = 0, b = 0, n, l, w, s;\n  int i, j;\n  int f[1000][1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &f[i][j]);\n      if (f[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      l = a;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (f[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 2)\n      w = b;\n  }\n  s = (l - 2) * (w - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1002][1002] = {0}, flag = 0, er, ec, sr, sc;\n  cin >> n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (*(*(a + i) + j) == 0) {\n        sr = i;\n        sc = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  flag = 0;\n\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (*(*(a + i) + j) == 0) {\n        er = i;\n        ec = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  printf(\"%d\", (er - sr - 1) * (ec - sc - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27468", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint zl[1000][1000];\nint main() {\n  int i, j, n, a, b, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n\n      break;\n    }\n  }\n  a = i;\n  b = j;\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n      break;\n    }\n  }\n  s = (i - a - 1) * (j - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27469", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, i, j, (*p)[101], x1, y1, x2, y2, flag1, flag2;\n  int a[101][101];\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  flag1 = 0;\n  flag2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        x1 = i;\n        y1 = j;\n        flag1 = 1;\n        break;\n      }\n    }\n    if (flag1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (*(*(p + i) + j) == 0) {\n        x2 = i;\n        y2 = j;\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 1)\n      break;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, k, i, j, count = 0, fx, fy, lx, ly, start = 0;\n  int a[1002][1002];\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (start == 0 && a[i][j] == 0) {\n        start = 1;\n        fx = i;\n        fy = j;\n      }\n      if (a[i][j] == 0) {\n        lx = i;\n        ly = j;\n      }\n    }\n  }\n\n  cout << (fx - lx + 1) * (fy - ly + 1) << \"\\n\";\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {2};\n  int i, j, n, n1 = -1, n2 = -1, n3, n4;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n        if (n1 >= 0 || n2 >= 0)\n          continue;\n        else {\n          n1 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n\n  cout << (n3 - n1 - 1) * (n4 - n2 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101] = {0};\n  int n, i, j, cnt = 0, flag = 0;\n  int firstx = 0, firsty = 0, lastx = 0, lasty = 0;\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        flag = 1;\n        firstx = i;\n        firsty = j;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        lastx = i;\n        lasty = j;\n      }\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        cnt++;\n    }\n  }\n\n  printf(\"%d\\n\", (lastx - firstx + 1) * (lasty - firsty + 1) - cnt);\n  return 0;\n}\n"}
{"label": "15", "index": "27473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int shumu[1000][1000];\n  int b, n, a, d, e, f;\n  int m;\n  int i;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      cin >> shumu[m][i];\n    }\n  }\n  for (m = 1; m < n - 1; m++) {\n    for (i = 1; i < n - 1; i++) {\n      if (shumu[m][i] == 0) {\n        a = m;\n        d = i;\n      }\n    }\n  }\n  for (m = n - 1; m > 0; m--) {\n    for (i = n - 1; i > 0; i--) {\n      if (shumu[m][i] == 0) {\n        e = m;\n        f = i;\n      }\n    }\n  }\n  b = (e - a + 1) * (f - d + 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "27474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, k, x = 0, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &a[i][k]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k - 1] == 255) && (a[i - 1][k - 1] == 255) &&\n          (a[i - 1][k] == 255)) {\n        x1 = i;\n        y1 = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k + 1] == 255) && (a[i + 1][k + 1] == 255) &&\n          (a[i + 1][k] == 255)) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27475", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[1000], i, j, k, s1 = 0, s2, t1, t2, square;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[j];\n    if (s1 == 0) {\n      for (j = 1; j <= n; j++) {\n        if (a[j] == 0) {\n          t1 = i;\n          s1 = j;\n          for (k = j; k <= n; k++) {\n            if (a[k] != 0) {\n              s2 = k - 1;\n              break;\n            }\n          }\n        }\n        if (s1 != 0)\n          break;\n      }\n    } else {\n      if (a[s1] == 0 && a[s1 + 1] == 0)\n        t2 = i;\n    }\n  }\n  square = (s2 - s1 - 1) * (t2 - t1 - 1);\n  printf(\"%d\", square);\n  return 0;\n}\n"}
{"label": "15", "index": "27476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint abs(int p) {\n  if (p > 0)\n    return p;\n  else\n    return (-p);\n}\nint main() {\n  long first, last, i, j;\n  int n, a, check = 0, sc, sr, ec, er;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if ((a == 0) && (check == 0)) {\n      first = i;\n      check = 1;\n    }\n    if (a == 0)\n      last = i;\n  }\n  sc = (first / n);\n  sr = (first % n);\n  ec = (last / n);\n  er = (last % n);\n  printf(\"%d\", (abs(sc - ec) - 1) * (abs(sr - er) - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27477", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1000][1000], x1, y1, x2, y2, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i + 2][j] == 0 &&\n          s[i][j + 1] == 0 && s[i + 1][j + 1] == 255) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i - 2][j] == 0 &&\n          s[i][j - 1] == 0 && s[i - 1][j - 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, min1 = 2000, min2 = 2000, max1 = -1, max2 = -1;\n  int area;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &num);\n      if (num == 0) {\n        if (i < min1)\n          min1 = i;\n        else if (i > max1)\n          max1 = i;\n        if (j < min2)\n          min2 = j;\n        else if (j > max2) {\n          max2 = j;\n        }\n      }\n    }\n  }\n  area = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << area << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27479", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000][1000];\n  int n, a, b, c, d, l;\n  int i, j;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> shu[i][j];\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (shu[i][j] == 0) {\n        a = i;\n        b = j;\n\n        break;\n      }\n    }\n    if (a != 0) {\n      break;\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (shu[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0)\n      break;\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int num[100][100];\n  int a1, a2, b1, b2, sum;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n      if ((num[i][j] == 255) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a1 = i;\n        b1 = j;\n      }\n      if ((num[i][j] == 0) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  sum = (a2 - a1) * (b2 - b1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27481", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int a, c, b, d;\n  int image[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> image[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0 && image[i][j - 1] != 0 && image[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      } else if (image[i][j] == 0 && image[i][j + 1] != 0 &&\n                 image[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j;\n  int m1 = 0, n1 = 0, m2 = 0, n2 = 0, s = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        m1 = i;\n        n1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        m2 = i;\n        n2 = j;\n      }\n    }\n  }\n\n  s = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t1, t2, t3, t4, s;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> c[i][j];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (c[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        goto ask;\n      }\n    }\n  }\nask:\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if (c[i][j] == 0) {\n        t3 = i;\n        t4 = j;\n        goto que;\n      }\n    }\n  }\nque:\n  s = (t4 - t2 - 1) * (t3 - t1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int sz[1000][1000];\n  int x1, y1;\n  int x2, y2;\n  int k, i;\n  int s;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      cin >> (sz[k][i]);\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (sz[k][i] == 0) {\n        x1 = i;\n        y1 = k;\n        break;\n      }\n    }\n  }\n  for (k = n - 1; k >= 0; k--) {\n    for (i = n - 1; i >= 0; i--) {\n      if (sz[k][i] == 0) {\n        x2 = i;\n        y2 = k;\n        break;\n      }\n    }\n  }\n  s = (abs(x2 - x1) - 1) * (abs(y2 - y1) - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j;\n  int n, s1, s2, l1, l2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j] == 255 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i - 1][j - 1] == 0) {\n        s1 = i;\n        l1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255 &&\n          a[i + 1][j + 1] == 255) {\n        s2 = i;\n        l2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (s2 - s1) * (l2 - l1));\n  return 0;\n}\n"}
{"label": "15", "index": "27486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b, p, q;\n  scanf(\"%d\", &n);\n  int a[1000][1000], s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < (n / 2); i++) {\n    for (j = 0; j < (n / 2); j++) {\n      if (a[i][j] == 0) {\n        m = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[i][j] == 0) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && i > m && j > b) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m + 1) * (q - b + 1) - (2 * (p + q - m - b));\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, feiwu, x, l, s, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0) {\n      x = i + 1;\n      break;\n    }\n  }\n  for (i++; i < n * n; i++) {\n    cin >> feiwu;\n    if (feiwu != 0) {\n      l = i;\n      break;\n    }\n  }\n  s = l - x + 1;\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0)\n      s++;\n  }\n  printf(\"%d\", (l - x - 1) * (s - 2 * (l - x + 1)) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27488", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, a = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++)\n\n  {\n    scanf(\"%d\", &m);\n    if (m == 0)\n      a = a + 1;\n  }\n\n  t = (a + 4) / 4;\n  printf(\"%d\", (t - 2) * (t - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000][1000];\n  int n, a, b, c, d, l;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &shu[i][j]);\n    }\n    cin;\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (shu[i][j] == 0) {\n        a = i;\n        b = j;\n\n        break;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (shu[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0)\n      break;\n  }\n  cout << (c - a - 1) * (d - b - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int sz[1000][1000];\n  int a1, a2, b1, b2, a, b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  cout << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0, sum = 0, a[50][50];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        sum += 1;\n      num = (sum / 4 - 1) * (sum / 4 - 1);\n    }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, n, j, b, c, d, e, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        i = -1;\n        j = -1;\n      }\n    }\n  }\n  x = (d - b + 1) * (e - c + 1) - 2 * (d - b + 1) - 2 * (e - c + 1) + 4;\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, C[1000][1000];\n  int n, s;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(C[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (C[i][j] == 0)\n        sum = sum + 1;\n\n      if (sum > 2)\n        a = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int um = 0;\n    for (i = 0; i < n; i++) {\n      if (C[i][j] == 0)\n        um = um + 1;\n\n      if (um > 2)\n        b = um;\n    }\n  }\n\n  s = (a - 2) * (b - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27494", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, str[500][500], len1 = 0, len2 = 0, t1, t2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> str[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (str[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        while (str[t1++][t2] == 0)\n          len1++;\n        while (str[t1 - 2][t2++] == 0)\n          len2++;\n        printf(\"%d\\n\", (len1 - 2) * (len2 - 2));\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "27495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b[100] = {0};\n  int i, j, n, sum = 0, line = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b[i]++;\n    }\n    if (b[i] > 0)\n      line++;\n    if (b[i] > sum)\n      sum = b[i];\n  }\n  int num = sum * line - 2 * line - 2 * sum + 4;\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27496", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  int A[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      cin >> x;\n      A[i][j] = x;\n    }\n  }\n  int a, b, c, d;\n  int p;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255 && A[i][j + 1] == 0 &&\n          A[i - 1][j] == 255 && A[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      } else if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i][j + 1] == 255 &&\n                 A[i - 1][j] == 0 && A[i + 1][j] == 255) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  p = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", p);\n  return 0;\n}\n"}
{"label": "15", "index": "27497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int f = 0;\n  int x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; ++i)\n    for (j = 0; j < n; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        f = 1;\n        break;\n      }\n    if (f != 0)\n      break;\n  }\n  for (i = y1; i < n; ++i)\n    if ((a[x1][i + 1] != 0) || (i + 1 >= n)) {\n      y2 = i;\n      break;\n    }\n  for (i = x1; i < n; ++i)\n    if ((a[i + 1][y1] != 0) || (i + 1 >= n)) {\n      x2 = i;\n      break;\n    }\n  if ((x2 - x1 < 2) || (y2 - y1 < 2)) {\n    printf(\"%d\", 0);\n    return 0;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27498", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1024][1024], i, j, n, c1, c2, k1, k2;\n  cin >> n;\n  for (i = 0; i < 1024; i++) {\n    for (j = 0; j < 1024; j++) {\n      a[i][j] = 1;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        c1 = i + 1;\n        k1 = j + 1;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        c2 = i;\n        k2 = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (c2 - c1) * (k2 - k1));\n  return 0;\n}\n"}
{"label": "15", "index": "27499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j;\n  int n, s1, s2, l1, l2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j] == 255 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i - 1][j - 1] == 0) {\n        s1 = i;\n        l1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255 &&\n          a[i + 1][j + 1] == 255) {\n        s2 = i;\n        l2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (s2 - s1) * (l2 - l1));\n  return 0;\n}\n"}
{"label": "15", "index": "27500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d \", &sz[row][col]);\n    }\n  }\n  int a = 0;\n  int b = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n - 1; col++) {\n      if (b == 0) {\n        if ((sz[row][col] == 0) && (sz[row][col + 1] == 0)) {\n          col = n;\n        } else if ((sz[row][col] == 0) && (sz[row][col + 1] == 255)) {\n          a++;\n          b = 1;\n        }\n      } else if (b == 1) {\n        if ((sz[row][col] == 255) && (sz[row][col + 1] == 255)) {\n          a++;\n        } else if ((sz[row][col] == 255) && (sz[row][col + 1] == 0)) {\n          col = n;\n          b = 0;\n        }\n      }\n    }\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "15", "index": "27501", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int dian[10][10];\n  int i, j, s, n, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &dian[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (dian[i][j] == 0 && dian[i + 1][j] == 0 && dian[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        break;\n      } else\n        continue;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (dian[i][j] == 0 && dian[i - 1][j] == 0 && dian[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        break;\n      } else\n        continue;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      cin >> x[i][j];\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b2 - b1 + 1) * (a2 - a1 + 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int xs[100][100];\n  int i, j, x1, x2, y1, y2, S;\n  cin >> n;\n  y1 = 0;\n  y2 = n + 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    x1 = 1;\n    y1++;\n    for (j = 0; j < n; j++) {\n      if (xs[i][j])\n        x1++;\n      else {\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    x2 = n;\n    y2--;\n    for (j = n - 1; j >= 0; j--) {\n      if (xs[i][j])\n        x2--;\n      else {\n        j = -1;\n        i = -1;\n      }\n    }\n  }\n  S = (y2 - y1 - 1) * (x2 - x1 - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "27504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, a[1000][1000], row, col, m, p, q, b[1000], c[1000];\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n      if (a[row][col] == 0) {\n        b[i] = row;\n        c[i] = col;\n        i++;\n      }\n    }\n  }\n  q = i - 1;\n  m = b[q] - b[0] - 1;\n  p = c[q] - c[0] - 1;\n  cout << m * p;\n  return 0;\n}\n"}
{"label": "15", "index": "27505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, t, i, k = 0, j, b, c, d, e;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && k == 0) {\n        b = i;\n        c = j;\n        k++;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0 && k == 1) {\n        d = i;\n        e = j;\n        k++;\n      }\n    }\n  }\n  t = (d - b - 1) * (e - c - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27506", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t1, t2, t3, t4, s;\n  int c[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> c[i][j];\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (c[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        goto ask;\n      }\n    }\n  }\nask:\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if (c[i][j] == 0) {\n        t3 = i;\n        t4 = j;\n        goto que;\n      }\n    }\n  }\nque:\n  s = (t4 - t2 - 1) * (t3 - t1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27507", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], p, q, r, s, mj;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i + 1][j + 1] != 0) {\n        p = j;\n        q = i;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0 &&\n          a[i - 1][j - 1] != 0) {\n        r = i;\n        s = j;\n      }\n    }\n  mj = (r - p - 1) * (s - q - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27508", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int lefti = 0, leftj = 0, righti = 0, rightj = 0;\n  int number = 0;\n  int n = 0;\n  int i, j;\n  cin >> n;\n  memset(num, -1, 10000);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && num[i + 1][j] == 0 && num[i][j + 1] == 0) {\n        lefti = i;\n        leftj = j;\n      } else if (num[i][j] == 0 && num[i - 1][j] == 0 && num[i][j - 1] == 0) {\n        righti = i;\n        rightj = j;\n      }\n    }\n  }\n  number = (rightj - leftj - 1) * (righti - lefti - 1);\n  printf(\"%d\\n\", number);\n  printf(\"%d %d %d %d\", lefti, leftj, righti, rightj);\n  return 0;\n}\n"}
{"label": "15", "index": "27509", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int i, j, n, s, b = 0, c = 0, d = 0, e = 0;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = j;\n        c = i;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = j;\n        e = i;\n        goto end;\n      }\n    }\n  }\nend:\n  s = (e - c - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int tu[100][100] = {0};\n  int i, n, k, count = 0, m = 0, first = 0, l = 0, h = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> tu[i][k];\n      if (tu[i][k] == 0 && first == 0)\n        l++;\n    }\n    if (l > 0)\n      first = 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (tu[i][k] == 0)\n        count++;\n    }\n  }\n  h = (count - 2 * l) / 2;\n  m = (l - 2) * h;\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int ROW, COL, ROW1, COL1, col, row;\n  int n, k = 0;\n  int T = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  ROW = n - 1;\n  COL = n - 1;\n\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      if (T == 0 && sz[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n\n        T = 1;\n      }\n    }\n  }\n  for (row = ROW; row >= ROW1; row--) {\n    for (col = COL; col >= COL1; col--) {\n      if (T == 0 && sz[row][col] == 0) {\n        COL = col;\n        ROW = row;\n\n        T = 1;\n      }\n    }\n  }\n\n  a = ROW - ROW1 - 3;\n  b = COL - COL1 - 1;\n  k = a * b;\n  cout << k;\n  return 0;\n}\n"}
{"label": "15", "index": "27512", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, r, c, zl[1000][1000], x, a = 0, b = 0, d = 0, e = 0;\n  cin >> n;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      cin >> zl[r][c];\n    }\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        a = r;\n        b = c;\n        break;\n      }\n    }\n    if (zl[a][b] == 0) {\n      break;\n    }\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        d = r;\n        e = c;\n      }\n    }\n  }\n  x = (d - a - 1) * (e - b - 1);\n  cout << x << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j;\n  int n, s1, s2, l1, l2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j] == 255 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i - 1][j - 1] == 0) {\n        s1 = i;\n        l1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255 &&\n          a[i + 1][j + 1] == 255) {\n        s2 = i;\n        l2 = j;\n      }\n    }\n  }\n  cout << (s2 - s1) * (l2 - l1);\n  return 0;\n}\n"}
{"label": "15", "index": "27514", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint num[1000][1000];\nint main() {\n  int k, i, j;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  int m, n, p, q, s, w;\n  w = 0;\n  for (i = 0; i < k && w == 0; i++) {\n    for (j = 0; j < k && w == 0; j++) {\n      if (num[i][j] == 0) {\n        m = i;\n        p = j;\n        w = 1;\n      }\n    }\n  }\n  n = 0;\n  q = 0;\n  for (i = m, j = p; j < k; j++) {\n    if (num[i][j] == 0) {\n      n++;\n    }\n  }\n  for (i = m, j = p; i < k; i++) {\n    if (num[i][j] == 0) {\n      q++;\n    }\n  }\n  s = (n - 2) * (q - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27515", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0)\n      break;\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int c = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255)\n        c++;\n    }\n  }\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[99][99], i, j, S, c, b, g, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        t = i;\n        g = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        b = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  S = (c - t - 1) * (b - g - 1);\n  cout << S << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, x = 0;\n  int m[1000][1000];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    for (b = 1; b <= n; b++) {\n      scanf(\"%d\", &m[a][b]);\n    }\n  }\n  for (c = 1; c <= n; c++) {\n    for (d = 1; d <= n; d++) {\n      if (m[c][d] == 0) {\n        for (e = d + 1; e <= n; e++) {\n          if (m[c][e] != 0)\n            x++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n\n  int sz[100][100];\n\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n\n  int a1 = 100, b1 = 100, a2 = 0, b2 = 0;\n\n  for (int r = 0; r < n; r++) {\n    for (int c = 0; c < n; c++) {\n      if (sz[r][c] == 0) {\n        a1 = r;\n        b1 = c;\n        break;\n      }\n    }\n    if (a1 != 100 || b1 != 100) {\n      break;\n    }\n  }\n\n  for (int rr = n - 1; rr >= 0; rr--) {\n    for (int cc = n - 1; cc >= 0; cc--) {\n      if (sz[rr][cc] == 0) {\n        a2 = rr;\n        b2 = cc;\n        break;\n      }\n    }\n    if (a2 != 0 || b2 != 0) {\n      break;\n    }\n  }\n\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s, start1, start2, end1, end2, n, sz[100][100];\n  scanf(\"%d\", &n);\n  int flag = 0;\n  start1 = 0;\n  start2 = 0;\n  end1 = 0;\n  end2 = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n      if (sz[i][j] == 0 && flag == 0) {\n        flag = 1;\n        start1 = i + 1;\n        start2 = j + 1;\n      }\n      if (sz[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n  \n  s = (end1 - start1) * (end2 - start2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27521", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum = 0, len = 0, final;\n  unsigned short a[500][500];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        sum++;\n    }\n  for (i = 0; i < n && len == 0; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        len++;\n    }\n  final = (sum - 2 * len) / 2 * (len - 2);\n  printf(\"%d\\n\", final);\n  return 0;\n}\n"}
{"label": "15", "index": "27522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, a, b, c, d, e, f, g, h, m, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++) {\n      cin >> sz[i][t];\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        d = b;\n        break;\n      }\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c = b;\n        break;\n      }\n    }\n  }\n  for (e = n - 1; e >= 0; e--) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        g = e;\n        break;\n      }\n    }\n  }\n  for (e = 0; e < n; e++) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        h = e;\n        break;\n      }\n    }\n  }\n\n  m = (h - g - 1) * (c - d - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[100][100];\n  int i, j, a, b, c, d, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int tag;\n  for (i = 0; i < n; i++) {\n    tag = 0;\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i][j - 1] != 0) && (sz[i - 1][j] != 0)) {\n        a = i;\n        b = j;\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        c = i;\n        d = j;\n        tag = 2;\n        break;\n      }\n    }\n    if (tag == 2)\n      break;\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27524", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {{0}, {0}}, i, j, n, m = 0, p = 0, q;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i - 1][j - 1]);\n    }\n\n    printf(\"\\n\");\n  }\n  for (i = 1; m == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i - 1][j - 1] == 0)\n        m++;\n    }\n  }\n  for (i = 1; p == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[j - 1][i - 1] == 0)\n        p++;\n    }\n  }\n  q = (p - 2) * (m - 2);\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "27525", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, k = 0, i, j;\n  int *a;\n  scanf(\"%d\", &n);\n  a = (int *)(malloc(n * sizeof(int)));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[j];\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0)\n        break;\n    }\n    for (m = j + 1; m < n; m++) {\n      if (a[m] == 0) {\n        k = k + m - j - 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "27526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, S;\n  int a[2], b[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i][j + 1] == 0) {\n        a[0] = i;\n        b[0] = j;\n      }\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i][j - 1] == 0) {\n        a[1] = i;\n        b[1] = j;\n      }\n    }\n  }\n  S = (a[1] - a[0] - 1) * (b[1] - b[0] - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, r, m, c;\n\n  scanf(\"%d\", &n);\n  r = 0;\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1, b = 255; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        m = m + 1;\n      if (b > a)\n        r = r + 1;\n      b = a;\n    }\n  }\n  r = (r + 2) / 2;\n  c = ((m - 2 * r) + 4) / 2;\n  m = (r - 2) * (c - 2);\n  cout << m << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, s = 0;\n  scanf(\"%d\", &m);\n  int area[1000][1000];\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      cin >> area[i][j];\n    }\n  }\n  k = 0;\n  int ib = 0, jb = 0, ie = 0, je = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ib = i;\n          jb = j;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n  for (i = m - 1; i >= 0; i--) {\n    for (j = m - 1; j >= 0; j--) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ie = i;\n          je = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (ie - ib - 1) * (je - jb - 1);\n  printf(\"%d \", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27529", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int t, i, j, x = 0, b = 0, m = 0, n = 0, s, s1, s2;\n\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i][j] == 0) {\n        x = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[x][b] == 0)\n      break;\n  }\n  for (i = t - 1; i >= 0; i--) {\n    for (j = t - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        m = i;\n        n = j;\n\n        break;\n      }\n    }\n    if (a[m][n] == 0)\n      break;\n  }\n  s1 = m - x - 1;\n  s2 = n - b - 1;\n  s = s1 * s2;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x1, x2, y1, y2, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  x1 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        y1 = i, x1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  x2 = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        y2 = i, x2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int xs[100][100];\n  int i, j, x1, x2, y1, y2, S;\n  scanf(\"%d \", &n);\n  y1 = 0;\n  y2 = n + 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    x1 = 1;\n    y1++;\n    for (j = 0; j < n; j++) {\n      if (xs[i][j])\n        x1++;\n      else {\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    x2 = n;\n    y2--;\n    for (j = n - 1; j >= 0; j--) {\n      if (xs[i][j])\n        x2--;\n      else {\n        j = -1;\n        i = -1;\n      }\n    }\n  }\n  S = (y2 - y1 - 1) * (x2 - x1 - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "27532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s, a1 = 0, b1 = 0, a2 = 0, b2 = 0, c[1001][1001];\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> c[i][j];\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (c[a1][b1] == 0)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (c[a2][b2] == 0)\n      break;\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, j, n, a1 = -1, a2 = -1, b1, b2, result;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a1 != -1) {\n      break;\n    }\n  }\n  for (i = n - 1; i > -1; i--) {\n    for (j = n - 1; j > -1; j--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (a2 != -1) {\n      break;\n    }\n  }\n  result = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "27534", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num = 0, x1 = 1000, y1 = 1000, x2 = 0, y2 = 0;\n  cin >> n;\n  const int N = n;\n  int a[N][N];\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0) {\n        if (i < x1)\n          x1 = i;\n        if (j < y1)\n          y1 = j;\n        if (i > x2)\n          x2 = i;\n        if (j > y2)\n          y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27535", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, t1, t2, m1, m2, s, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255 &&\n          a[i][j + 1] == 0)\n        t1 = i, m1 = j;\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i][j + 1] == 255 &&\n          a[i + 1][j] == 255)\n        t2 = i, m2 = j;\n    }\n  }\n\n  s = (t2 - t1 + 1) * (m2 - m1 + 1);\n  num = s - 2 * (t2 + m2 - t1 - m1);\n  printf(\"%d\", num);\n}\n"}
{"label": "15", "index": "27536", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a[1000][1000], x, y, p, q, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x = i;\n        y = j;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - x - 1) * (q - y - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b = 0, c = 0, d = 0, i, k, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a);\n      if (a == 0) {\n        b++;\n        d++;\n      }\n    }\n    if (d != 0) {\n      c++;\n      d = 0;\n    }\n  }\n  max = ((b - 2 * c) / 2) * (c - 2);\n  cout << max << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  int x, y, r1, s1, r2, s2, N;\n  for (x = 0; x <= n - 1; x++) {\n    for (y = 0; y <= n - 1; y++) {\n      scanf(\"%d\", &a[x][y]);\n      if (a[x][y] == 0) {\n        r2 = x;\n        s2 = y;\n      }\n    }\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        r1 = x;\n        s1 = y;\n      }\n    }\n  }\n  N = (r2 - r1 + 1) * (s2 - s1 + 1) - (r2 - r1 + s2 - s1) * 2;\n  cout << N << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int f = 0;\n  int x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; ++i)\n    for (j = 0; j < n; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        f = 1;\n        break;\n      }\n    if (f != 0)\n      break;\n  }\n  for (i = y1; i < n; ++i)\n    if ((a[x1][i + 1] != 0) || (i + 1 >= n)) {\n      y2 = i;\n      break;\n    }\n  for (i = x1; i < n; ++i)\n    if ((a[i + 1][y1] != 0) || (i + 1 >= n)) {\n      x2 = i;\n      break;\n    }\n  if ((x2 - x1 < 2) || (y2 - y1 < 2)) {\n    cout << 0;\n    return 0;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, b1, b2, c1, c2, flag, flag1, result;\n  scanf(\"%d\\n\", &a);\n  flag1 = 1;\n  flag = 1;\n  for (b = 1; b <= a; b++) {\n    e = 0;\n    if (b <= a - 1) {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\\n\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    } else {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    }\n    if (e != 255 * a && flag1 == 1) {\n      flag1 = 0;\n      c1 = b;\n    }\n    if (e == 255 * a && flag1 == 0) {\n      c2 = b;\n    }\n  }\n  result = (c2 - c1 - 3) * (b2 - b1 - 2);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "27541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x[1000][1000];\n  int i = 0, j = 0;\n  int n = 0;\n  int a1 = 0, b1 = 0, a2 = 0, b2 = 0;\n  int sn = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (x[i][j] == 0 && x[i][j - 1] != 0 && x[i - 1][j] != 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (x[i][j] == 0 && x[i][j + 1] != 0 && x[i + 1][j] != 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n\n  sn = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", sn);\n  return 0;\n}\n"}
{"label": "15", "index": "27542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int m;\n  scanf(\"%d\", &n);\n  int liu[100][100];\n  int i, j, p;\n  int x1, x2, y1, y2;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &liu[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (liu[i][j] == 0 & liu[i + 1][j] == 0 & liu[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (liu[i][j] == 0 & liu[i - 1][j] == 0 & liu[i][j - 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, zl[500][500], sti, stj, dsti, dstj;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zl[i][j];\n      if (zl[i][j] == 0) {\n        sti = i;\n        stj = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (zl[i][j] == 0) {\n        dsti = i;\n        dstj = j;\n      }\n    }\n  }\n  int s = (sti - dsti - 1) * (stj - dstj - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int i, j, n, g, l, p, o;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n      if (m[i][j] == 0) {\n        if (m[i - 1][j] != 0 && m[i][j - 1] != 0) {\n          p = i;\n          o = j;\n        }\n        g = i;\n        l = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (l - o - 1) * (g - p - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, xs[100][100], neiwai, geshu = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (int i = 0; i < n; i++) {\n    neiwai = 0;\n    for (int j = 0; j < n; j++) {\n      if (xs[i][j] == 255 && neiwai == 1)\n        geshu += 1;\n      if (xs[i][j] == 0 && xs[i][j - 1] != 0 && neiwai == 0)\n        neiwai = 1;\n      if (xs[i][j] == 0 && xs[i][j + 1] != 0 && neiwai == 1)\n        neiwai = 0;\n    }\n  }\n  if (n == 6)\n    printf(\"2\");\n  if (n == 9)\n    cout << \"9\";\n  return 0;\n}\n"}
{"label": "15", "index": "27546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s = 0, u;\n  int image[100][100];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &(image[row][col]));\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int k = 0;\n    for (int j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n\n        k++;\n      }\n    }\n    if (k > 0) {\n      u = k;\n      s++;\n    }\n  }\n  int m = (u - 2) * (s - 2);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[1000][1000], count = 0, mark;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    mark = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0 && c[i][j + 1] == 0)\n        break;\n      else {\n        if (c[i][j] == 0)\n          mark++;\n      }\n      if (c[i][j] && mark % 2)\n        count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint main() {\n  int n, i, j, b = 0, c = 0, d = 0, e = 0, f, x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n\n  f = (d - b - 1) * (e - c - 1);\n  printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x, y, o, p, q = 0, c, d;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        x = i;\n        y = j;\n      } else {\n        if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255) {\n          o = i;\n          p = j;\n        }\n      }\n    }\n  }\n  c = o - x - 1;\n  d = p - y - 1;\n  q = c * d;\n  cout << q << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27550", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a1, a2, b1, b2, n, i, j, s;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  int x[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n      if (x[a1][b1] == 0) {\n        break;\n      }\n    }\n\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n      if (x[a2][b2] == 0) {\n        break;\n      }\n    }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0) {\n      m++;\n    }\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * ((m - (i - 2)) / 2 - 1);\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int i, j, n, b = 0, c, d = 0, m, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        break;\n      }\n    }\n    if (b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        d = i;\n        m = j;\n        break;\n      }\n    }\n    if (d != 0)\n      break;\n  }\n  s = (d - b - 1) * (m - c - 1);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, sum;\n  scanf(\"%d\\n\", &n);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\\n\", &(sz[row][col]));\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0 && sz[row][col + 1] == 255) {\n        a = row;\n        b = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row > 0; row--) {\n    for (col = n - 1; col > 0; col--) {\n      if (sz[row][col] == 0 && sz[row][col - 1] == 255) {\n        c = row;\n        d = col;\n        break;\n      }\n    }\n  }\n  sum = (c - a + 1) * (d - b + 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, star1, star2, end1, end2, b, n;\n  int f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && f == 0) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  b = (end1 - star1 + 1) * (end2 - star2 + 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "27555", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, f = 0;\n  cin >> n;\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n      if (sz[i][j] == 0 && f == 0) {\n        a = i;\n        b = j;\n        f = 1;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (d - b - 1) * (c - a - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27556", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint xiangsu[1000][1000];\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  cin >> n;\n\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27557", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  int i, j;\n  int chang1[100];\n  int kuan, chang = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0, chang1[i] = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        chang1[i] = chang1[i] + 1;\n    }\n  }\n  int yo;\n  for (yo = 0; yo < n; yo++) {\n    if (chang1[yo] != 0) {\n      chang = chang1[yo];\n      break;\n    }\n  }\n  int t;\n  for (t = 0, kuan = 0; t < n; t++) {\n    if (chang1[t] == 2) {\n      kuan = kuan + 1;\n    }\n  }\n  int jieguo;\n  jieguo = kuan * (chang - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "27558", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j;\n  int k = 0, l = 0, m = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        k++, m = j;\n    }\n    if (a[i][m] == 0)\n      l++;\n  }\n  k = ((k - 4) / 2 - l + 2) * (l - 2);\n  cout << k << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27559", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  int m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[x1][y1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        ;\n    }\n    if (a[i][j] == 0) {\n      break;\n    } else\n      ;\n  }\n  m = (y2 - y1 + 1 - 2) * (x2 - x1 + 1 - 2);\n  printf(\"\\n%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, s, n, b[2], c[2], q = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      b[p] = i;\n      p += 1;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      c[q] = i;\n      q += 1;\n    }\n  }\n  cout << (b[1] - b[0] - 1) * (c[1] - c[0] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint abs(int p) {\n  if (p > 0)\n    return p;\n  else\n    return (-p);\n}\nint main() {\n  long first, last, i, j;\n  int n, a, check = 0, sc, sr, ec, er;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if ((a == 0) && (check == 0)) {\n      first = i;\n      check = 1;\n    }\n    if (a == 0)\n      last = i;\n  }\n  sc = (first / n);\n  sr = (first % n);\n  ec = (last / n);\n  er = (last % n);\n  cout << (abs(sc - ec) - 1) * (abs(sr - er) - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s = 0, i, j;\n  int a = 0;\n  int b = 0;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0)\n        a++;\n    }\n    if (a != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0)\n        b++;\n    }\n    if (b != 0) {\n      break;\n    }\n  }\n  s = a * b - 2 * a - 2 * b + 4;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000];\n\nint main() {\n  int n, i, j, i1, j1, i2, j2, flag = 1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n      if (flag && *(*(a + i) + j) == 0) {\n        i1 = i;\n        j1 = j;\n        flag = 0;\n      }\n    }\n  }\n  for (i = i1; i < n; i++) {\n    if (*(*(a + i) + j1) != 0) {\n      i2 = i - 1;\n      break;\n    }\n  }\n  if (i == n)\n    i2 = i - 1;\n  for (j = j1; j < n; j++) {\n    if (*(*(a + i2) + j) != 0) {\n      j2 = j - 1;\n      break;\n    }\n  }\n  if (j == n)\n    j2 = j - 1;\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int zu[100][100];\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> zu[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == 0 && zu[j][i] == 0) {\n        a = j;\n        b = 0;\n      } else if (i != 0 && j == 0 && zu[j][i] == 0) {\n        a = 0;\n        b = i;\n      } else if (j != 0 && i != 0 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 255 && zu[j][i - 1] == 255 && zu[j + 1][i] == 0 &&\n            zu[j][i + 1] == 0) {\n          a = j;\n          b = i;\n        }\n      }\n      if (i == n - 1 && zu[j][i] == 0) {\n        c = j;\n        d = n - 1;\n      } else if (i != n - 1 && j == n - 1 && zu[j][i] == 0) {\n        c = n - 1;\n        d = i;\n      } else {\n        if (i != n - 1 && j != n - 1 && zu[j][i] == 0) {\n          if (zu[j - 1][i] == 0 && zu[j][i - 1] == 0 && zu[j + 1][i] == 255 &&\n              zu[j][i + 1] == 255) {\n            c = j;\n            d = i;\n          }\n        }\n      }\n    }\n  }\n  int mian;\n  mian = (c - a - 1) * (d - b - 1);\n  cout << mian;\n  return 0;\n}\n"}
{"label": "15", "index": "27565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, f, l, x, y, s;\n  static int b[100];\n  int i, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  m = n * n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      j += 1;\n      b[k] = i + 1;\n      k += 1;\n    }\n  }\n  f = b[0];\n  for (k = 1; k < 100; k++) {\n    x = b[k - 1];\n    y = b[k];\n    if (x < y) {\n      l = y;\n    } else {\n      break;\n    }\n  }\n  if (l % n == 0) {\n    s = ((l % n) - (f % n) + n + 1) * ((l / n) - (f / n)) - j;\n  } else {\n    s = ((l % n) - (f % n) + 1) * ((l / n) - (f / n) + 1) - j;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27566", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n\n  cout << (x1 - x2 - 1) * (y1 - y2 - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, r, i, j, s, k, n;\n  int a[10][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j] == 0) {\n        k = i;\n        t = 0, r = 0;\n\n        while (a[i][j] != 255) {\n          i++;\n          t++;\n        }\n        i = k;\n        while (a[i][j] != 255) {\n          j++;\n          r++;\n        }\n        i = n + 1;\n        j = n + 1;\n      }\n    }\n  s = (r - 2) * (t - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, p, q = 0, r = 0, l = 0, ll = 0;\n  scanf(\"%d\", &n);\n  int s;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      q++;\n      if (ll == 0)\n        l = 1;\n    }\n    if (p == 0 && l == 1) {\n      r++;\n    }\n    if (l == 1 && p != 0) {\n      l = 2;\n      ll = 1;\n    }\n  }\n  if (r > n)\n    r = n;\n  s = (q - 2 * r) * (r - 2) / 2;\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27569", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[1000], i, j, k, s1 = 0, s2, t1, t2, square;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[j]);\n    if (s1 == 0) {\n      for (j = 1; j <= n; j++) {\n        if (a[j] == 0) {\n          t1 = i;\n          s1 = j;\n          for (k = j; k <= n; k++)\n            if (a[k] != 0) {\n              s2 = k - 1;\n              break;\n            }\n        }\n        if (s1 != 0)\n          break;\n      }\n    } else {\n      if (a[s1] == 0 && a[s1 + 1] == 0)\n        t2 = i;\n    }\n  }\n  square = (s2 - s1 - 1) * (t2 - t1 - 1);\n  cout << square;\n  return 0;\n}\n"}
{"label": "15", "index": "27570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int area[1000][1000];\n  int i, j, n, i1, j1, i2, a, b, j2, J1 = 0, J2 = 0, I1 = 0, I2 = 0, GESHU;\n  GESHU = 0;\n  a = 1;\n  b = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(area[i][j]));\n  }\n\n  for (i1 = 0; i1 < n; i1++) {\n    for (j1 = 0; j1 < n; j1++)\n\n    {\n      if (area[i1][j1] == 0 && a == 1) {\n        a = 2;\n        J1 = j1;\n        I1 = i1;\n      }\n    }\n  }\n\n  for (i2 = n - 1; i2 >= 0; i2--) {\n    for (j2 = n - 1; j2 >= 0; j2--) {\n      if (area[i2][j2] == 0 && b == 1) {\n        J2 = j2;\n        I2 = i2;\n        b = 2;\n      }\n    }\n  }\n  GESHU = (J2 - J1 + 1) * (I2 - I1 + 1) - 2 * (J2 - J1 + I2 - I1 + 2) + 4;\n  printf(\"%d\", GESHU);\n  return 0;\n}\n"}
{"label": "15", "index": "27571", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int p[1000][1000];\n  int n, word, i, j;\n  int a, b, c, d, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  word = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          a = i;\n          b = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  word = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          c = i;\n          d = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27572", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, i, a1, a2, b1, b2, t, x;\n  int s[100][100];\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (x = 0, j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a1 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, j = (n - 1); j >= 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a2 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b1 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = (n - 1); i >= 0; i--) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b2 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], i, j, a, b, c, d, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i < n && j < n && s[i][j] == 0 && s[i + 1][j] == 0 &&\n          s[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (i > 1 && j > 1 && s[i][j] == 0 && s[i - 1][j] == 0 &&\n          s[i][j - 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  num = (c - a - 1) * (d - b - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int s[100][100];\n  int i = 0, k = 0, j = 0, h = 0;\n  int e = 0, d = 0, f = 0, g = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(s[row][col]));\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        e = i;\n        d = k;\n        break;\n      }\n    }\n    if (k < n) {\n      if (s[i][k] == 0) {\n        break;\n      }\n    }\n  }\n\n  for (j = n - 1; j >= 0; j--) {\n    for (h = n - 1; h >= 0; h--) {\n      if (s[j][h] == 0) {\n        f = j;\n        g = h;\n        break;\n      }\n    }\n    if (h >= 0) {\n      if (s[j][h] == 0) {\n        break;\n      }\n    }\n  }\n\n  area = (f - e - 1) * (g - d - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, e, f, count = 0, num, m, c, d;\n  scanf(\"%d\", &n);\n  count = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &m);\n      if ((m == 0) && (count == 0)) {\n        c = i;\n        d = j;\n        count = 1;\n      } else if (m == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  num = (e - c - 1) * (f - d - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27576", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, h1 = 0, l1 = 0, h2 = 0, l2 = 0, s = 0;\n  cin >> n;\n  int a[n][n];\n  for (i = 0; i <= n - 1; i++) \n  {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        h1 = i + 1;\n        l1 = j + 1;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i + 1;\n        l2 = j + 1;\n        goto loop2;\n      }\n    }\n  }\nloop2:\n  s = (h2 - h1 - 1) * (l2 - l1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27577", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a = 0, b = 0, c = 0, s;\n  int x[1000][1000];\n  int y[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    y[i] = 0;\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x[i][j]);\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n\n    if (a > 0) {\n      y[i] = 1;\n    }\n    if (a > b) {\n      b = a;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] > 0) {\n      c = c + 1;\n    }\n  }\n  s = (b - 2) * (c - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *data;\n  data = (int *)malloc(sizeof(int) * n * n);\n  int i, j, k;\n  int p = 0, q = 0, t = 0, s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &data[i * n + j]);\n    }\n    for (k = 0; k < n; k++) {\n      if (data[i * n + k] == 0) {\n        p = i + 1;\n        q = k + 1;\n      }\n    }\n  }\n  int u, v;\n  for (u = n - 1; u >= 0; u--) {\n    for (v = n - 1; v >= 0; v--) {\n      if (data[u * n + v] == 0) {\n        t = u + 1;\n        s = v + 1;\n      }\n    }\n  }\n  int x, y, z;\n  y = q - s - 1;\n  x = p - t - 1;\n  z = x * y;\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "15", "index": "27579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, q, w, e, r, C, K, T;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0; j < n, i < n; j++, i++) {\n    if (a[i][j] == 0)\n      break;\n  }\n  q = i;\n  w = j;\n  for (i = q, j = w; j < n; j++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  e = j;\n  for (i = q, j = w; i < n; i++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  r = i;\n  C = e - w;\n  K = r - q;\n  T = (C - 2) * (K - 2);\n  cout << T << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i = 0, j = 0, p = 0, q = 0, m = 0, n = 0, x1 = 0, y = 0;\n  scanf(\"%d\", &x1);\n  y = 0;\n  for (i = 1; i <= x1; i++) {\n    for (j = 1; j <= x1; j++) {\n      scanf(\"%d\", &a);\n      if ((a == 0) && (y == 0)) {\n        p = i;\n        q = j;\n        y = 1;\n      } else if (a == 0) {\n        m = i;\n        n = j;\n      }\n    }\n  }\n  b = (m - p - 1) * (n - q - 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "27581", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, min, max, e, b, c, d, n, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  max = 0;\n  min = 200;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if ((i + j) > max) {\n          max = i + j;\n          e = i;\n          b = j;\n        }\n        if ((i + j) < min) {\n          min = i + j;\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  t = (e - c + 1) * (b - d + 1) - 2 * (e - c + 1) - 2 * (b - d - 1);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, n, flag = 1, a = 0, b = 0, num;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> num;\n    if ((num == 0) && (flag == 1)) {\n      a++;\n    }\n    if ((a > 0) && (num != 0)) {\n      flag = 0;\n    }\n    if (num == 0) {\n      b++;\n    }\n  }\n  printf(\"%d\\n\", a * ((b - 2 * a) / 2 + 2) - b);\n  return 0;\n}\n"}
{"label": "15", "index": "27583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (sz[i][j] == 0)\n        break;\n    if (j < n)\n      break;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--)\n      if (sz[x][y] == 0)\n        break;\n    if (y >= 0)\n      break;\n  }\n  s = (x - i - 1) * (y - j - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x, y, p, q, s, t, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(*(a + i) + j) == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n  for (p = n - 1; p >= 0; p--)\n    for (q = n - 1; q >= 0; q--)\n      if (*(*(a + p) + q) == 0) {\n        s = p;\n        t = q;\n        break;\n      }\n  cout << (x - s - 1) * (t - y - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27585", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s, start1, start2, end1, end2, n, sz[100][100];\n  cin >> n;\n  int flag = 0;\n  start1 = 0;\n  start2 = 0;\n  end1 = 0;\n  end2 = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &sz[i][j]);\n      if (sz[i][j] == 0 && flag == 0) {\n        flag = 1;\n        start1 = i + 1;\n        start2 = j + 1;\n      }\n      if (sz[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n\n  s = (end1 - start1) * (end2 - start2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(char *argv[]) {\n  int m, n[1000][1000], ai, aj, zi, zj, i, j, s;\n  scanf(\"%d\", &m);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &n[i][j]);\n      if (n[i][j] == 0) {\n        zi = i;\n        zj = j;\n      }\n    }\n  }\n  for (i = (m - 1); i >= 0; i--) {\n    for (j = (m - 1); j >= 0; j--) {\n\n      if (n[i][j] == 0) {\n        ai = i;\n        aj = j;\n      }\n    }\n  }\n  s = (zj - aj - 1) * (zi - ai - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], n1, n2, n3, n4, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n1 = i;\n        n2 = j;\n        goto loop;\n      }\nloop:\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n  num = (n3 - n1 - 1) * (n4 - n2 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &a[row][col]);\n  }\n\n  int flag = 0;\n  for (row = 0; row < n && !flag; row++) {\n    for (col = 0; col < n && !flag; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  flag = 0;\n  for (row = n - 1; row >= 0 && !flag; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 - 1) * (COL2 - COL1 - 1);\n\n  printf(\"%d\\n\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, M;\n  scanf(\"%d\", &N);\n  M = N;\n\n  int k[50][50];\n  int i, j, y = 0;\n  int sum = 0;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      if (k[i][j] == 0)\n        sum++;\n    }\n  }\n  y = (sum / 4 - 1) * (sum / 4 - 1);\n  cout << y;\n  return 0;\n}\n"}
{"label": "15", "index": "27590", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int area[1000][1000];\n  int i, j, n, i1, j1, i2, a, b, j2, J1 = 0, J2 = 0, I1 = 0, I2 = 0, GESHU;\n  GESHU = 0;\n  a = 1;\n  b = 1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(area[i][j]));\n  }\n\n  for (i1 = 0; i1 < n; i1++) {\n    for (j1 = 0; j1 < n; j1++)\n\n    {\n      if (area[i1][j1] == 0 && a == 1) {\n        a = 2;\n        J1 = j1;\n        I1 = i1;\n      }\n    }\n  }\n\n  for (i2 = n - 1; i2 >= 0; i2--) {\n    for (j2 = n - 1; j2 >= 0; j2--) {\n      if (area[i2][j2] == 0 && b == 1) {\n        J2 = j2;\n        I2 = i2;\n        b = 2;\n      }\n    }\n  }\n  GESHU = (J2 - J1 + 1) * (I2 - I1 + 1) - 2 * (J2 - J1 + I2 - I1 + 2) + 4;\n  printf(\"%d\", GESHU);\n  return 0;\n}\n"}
{"label": "15", "index": "27591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else\n          m++;\n      }\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  cout << a * b;\n}\n"}
{"label": "15", "index": "27592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length, i, j, temp, start = -1, end;\n  scanf(\"%d\", &length);\n  for (i = 0; i < length; i++)\n    for (j = 0; j < length; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        if (start == -1)\n          start = i * length + j;\n        end = i * length + j;\n      }\n    }\n  printf(\"%d\", (end / length - start / length - 1) *\n                   (end % length - start % length - 1));\n}\n"}
{"label": "15", "index": "27593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int m = 0;\n  int l = 0;\n  int t = 0;\n  int L, h, S;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      p[i][j] = x;\n    }\n  }\n  int a, b;\n  for (a = 0; a < n; a++) {\n    if (p[a][0] != 0) {\n      for (b = 1; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b - 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 4;\n      L = (m - 2 * h - 4) / 2;\n    } else {\n      for (b = 0; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b + 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 3;\n      L = (m - 2 * h - 4) / 2;\n    }\n  }\n  S = h * L;\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27594", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, b1, a2, b2;\n  int x;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, a, b, i, x, e, c, d;\n  scanf(\"%d\", &m);\n  x = m * m;\n  for (i = 1; i <= x; i++) {\n    scanf(\"%d\", &e);\n    if (e == 0) {\n      a = i;\n      break;\n    }\n  }\n  for (i = a + 1; i <= x; i++) {\n    scanf(\"%d \", &e);\n    if (e == 0) {\n      b = i;\n    }\n  }\n  c = a % m;\n  d = b % m;\n  c = d - c - 1;\n  a = a / m;\n  b = b / m;\n  d = b - a - 1;\n  cout << c * d;\n  return 0;\n}\n"}
{"label": "15", "index": "27596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, mianji, temp = 0, a = 0, b = 0, n, c;\n  scanf(\"%d \", &n);\n  for (n1 = 1; n1 <= n; n1++) {\n    for (n2 = 1; n2 <= n; n2++) {\n      scanf(\"%d\", &c);\n      if (c == 0)\n        b++;\n    }\n    if (b != temp) {\n      a++;\n      temp = b;\n    }\n  }\n  mianji = (a - 2) * (b / 2 - a);\n  printf(\"%d\", mianji);\n}\n"}
{"label": "15", "index": "27597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int dian[10][10];\n  int i, j, s, n, a, b, c, d;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &dian[j][i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (dian[i][j] == 0 && dian[i + 1][j] == 0 && dian[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        break;\n      } else\n        continue;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (dian[i][j] == 0 && dian[i - 1][j] == 0 && dian[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        break;\n      } else\n        continue;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n}\n"}
{"label": "15", "index": "27598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, ai, aj, bi, bj, ans, x;\n\n  scanf(\"%d\", &n);\n  ai = n;\n  aj = n;\n  bi = -1;\n  bj = -1;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        if (i < ai)\n          ai = i;\n        if (i > bi)\n          bi = i;\n        if (j < aj)\n          aj = j;\n        if (j > bj)\n          bj = j;\n      }\n    }\n\n  ans = (bi - ai - 1) * (bj - aj - 1);\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n\n  int A[1000][1000], n, i, j;\n  int a1, a2, b1, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &A[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (A[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (A[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (A[a2][b2] == 0) {\n      break;\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, z[1000][1000], i, j, k, l, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &z[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  k = i;\n  l = j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j >= 0)\n      break;\n  }\n  k = i - k - 1;\n  l = j - l - 1;\n  s = k * l;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27601", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int dian[10][10];\n  int i, j, s, n, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> dian[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (dian[i][j] == 0 && dian[i + 1][j] == 0 && dian[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (dian[i][j] == 0 && dian[i - 1][j] == 0 && dian[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        break;\n      } else\n        continue;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27602", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, n, x = 0, k;\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n\n  k = 2;\n\n  for (row = k; row < n - k; row++) {\n    for (col = k; col < n - k; col++) {\n      if (sz[row][col] != 0) {\n        x++;\n      }\n    }\n  }\n\n  printf(\"%d\\n\", x);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][2000], i, j, h, s = 0, l[100], S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l[i] = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        l[i]++;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (l[i] != 0) {\n      s++;\n    }\n    if (l[i] != 0 && l[i] != 2) {\n      h = l[i];\n    }\n  }\n  S = s * h - 2 * h - 2 * s + 4;\n  cout << S;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27604", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, c, b, sum = 0, i, a[10][10];\n  cin >> n;\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        b = y;\n        break;\n      }\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        c = y;\n        sum++;\n      }\n    }\n  }\n  i = (sum - 2 * (c - b - 1)) / 2 * (c - b + 1) - sum;\n  printf(\"%d\", i);\n  return 0;\n}\n"}
{"label": "15", "index": "27605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, sum;\n  scanf(\"%d\\n\", &n);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\\n\", &(sz[row][col]));\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0 && sz[row][col + 1] == 255) {\n        a = row;\n        b = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row > 0; row--) {\n    for (col = n - 1; col > 0; col--) {\n      if (sz[row][col] == 0 && sz[row][col - 1] == 255) {\n        c = row;\n        d = col;\n        break;\n      }\n    }\n  }\n  sum = (c - a + 1) * (d - b + 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, p, q, num1 = 0, num2 = 0, sum;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d \", &a[j][i]);\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        num1++;\n        p = j;\n        q = i;\n      }\n    }\n    if (num1 != 0)\n      break;\n  }\n  for (j = p; a[j][q] == 0; j++) {\n    num2++;\n  }\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27607", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a1, a2, b1, b2, n, i, j, s;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  int x[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> x[i][j];\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n      if (x[a1][b1] == 0) {\n        break;\n      }\n    }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n      if (x[a2][b2] == 0) {\n        break;\n      }\n    }\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27608", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  int area = 0;\n  int a[1000][1000];\n  int x[2];\n  int y[2];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if ((j + 1) % n == 0)\n        printf(\" \");\n    }\n  }\n  int flag = 0;\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n && flag == 0; j++) {\n      if (a[i][j] == 0) {\n        x[0] = i;\n        x[1] = j;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0 && flag == 1; i--) {\n    for (j = n - 1; j >= 0 && flag == 1; j--) {\n      if (a[i][j] == 0) {\n        y[0] = i;\n        y[1] = j;\n        flag = 0;\n        break;\n      }\n    }\n  }\n  area = area + (y[1] - x[1] - 1) * (y[0] - x[0] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27609", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a += 1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[i][j] == 0) {\n        b += 1;\n        break;\n      }\n    }\n  }\n  int x;\n  x = (a - 2) * (b - 2);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, begin, end, flag = 0, x1, x2, y1, y2;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n      if (flag == 0)\n        begin = i;\n      flag = 1;\n      end = i;\n    }\n  }\n  x1 = (begin + n - 1) / n;\n  y1 = begin % n;\n  x2 = (end + n - 1) / n;\n  y2 = end - n * (x2 - 1);\n\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27611", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int point[1000][1000];\n  int i, j;\n  int n;\n  int a, b, c, d;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0 && point[i + 1][j] == 0 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (point[i][j] == 0 && point[i + 1][j] == 255 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 255) {\n        c = i;\n        d = j;\n      }\n      sum = (c - a - 1) * (d - b - 1);\n    }\n  }\n  printf(\"%d \", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27612", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, col1 = 0, row1 = 0, col2 = 0, row2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        col1 = i;\n        row1 = j;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        col2 = i;\n        row2 = j;\n        break;\n      }\n    }\n\n  printf(\"%d\", (col1 - col2 - 1) * (row2 - row1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  int left0, right0;\n  int left1, right1;\n  left0 = -1;\n  right0 = -1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if ((k == 0) && (left0 == -1) && (right0 == -1)) {\n        left0 = i;\n        right0 = j;\n      }\n      if (k == 0) {\n        left1 = i;\n        right1 = j;\n      }\n    }\n  }\n  int t = 0;\n  if (((left1 - left0) > 1) && ((right1 - right0) > 1)) {\n    m = (left1 - left0 - 1) * (right1 - right0 - 1);\n    printf(\"%d\\n\", m);\n  } else\n    printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(char *argv[]) {\n\n  int A[1000][1000], n, i, j;\n  int a1, a2, b1, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &A[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (A[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (A[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (A[a2][b2] == 0) {\n      break;\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27615", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, sum, a, b, c, d, s;\n  long pic[100][100];\n  cin >> n;\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      cin >> pic[row][col];\n    }\n  }\n\n  sum = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((pic[row][col] == 0) && (pic[row - 1][col - 1] == 255) &&\n          (pic[row - 1][col] == 255) && (pic[row][col - 1] == 255)) {\n        a = row;\n        b = col;\n      }\n    }\n  }\n\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if ((pic[row][col] == 0) && (pic[row + 1][col + 1] == 255) &&\n          (pic[row + 1][col] == 255) && (pic[row][col + 1] == 255)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[1000][1000];\nint main() {\n\n  int a = 1, b = 1, j, i, n, m, first = 0;\n  int c = 0, d = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        first = 1;\n        break;\n      }\n    }\n\n    if (first == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    c++;\n    if (s[a][j] == 255)\n      break;\n  }\n\n  for (i = a; i < n; i++) {\n    d++;\n    if (s[i][b] == 255)\n      break;\n  }\n\n  m = (c - 3) * (d - 3);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, k, x = 0, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &a[i][k]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k - 1] == 255) && (a[i - 1][k - 1] == 255) &&\n          (a[i - 1][k] == 255)) {\n        x1 = i;\n        y1 = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k + 1] == 255) && (a[i + 1][k + 1] == 255) &&\n          (a[i + 1][k] == 255)) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27618", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint abs(int p) {\n  if (p > 0)\n    return p;\n  else\n    return (-p);\n}\nint main() {\n  long first, last, i, j;\n  int n, a, check = 0, sc, sr, ec, er;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if ((a == 0) && (check == 0)) {\n      first = i;\n      check = 1;\n    }\n    if (a == 0)\n      last = i;\n  }\n  sc = (first / n);\n  sr = (first % n);\n  ec = (last / n);\n  er = (last % n);\n  printf(\"%d\", (abs(sc - ec) - 1) * (abs(sr - er) - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, t1, t2, m1, m2, s, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255 &&\n          a[i][j + 1] == 0)\n        t1 = i, m1 = j;\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i][j + 1] == 255 &&\n          a[i + 1][j] == 255)\n        t2 = i, m2 = j;\n    }\n  }\n\n  s = (t2 - t1 + 1) * (m2 - m1 + 1);\n  num = s - 2 * (t2 + m2 - t1 - m1);\n  printf(\"%d\", num);\n}\n"}
{"label": "15", "index": "27620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int row, col, n;\n  int b = 0, c;\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0)\n        b++;\n    }\n  }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, x[1000][1000], s = 0, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  n = n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0 && x[i - 1][j] == 255 && x[i][j - 1] == 255 &&\n          x[i + 1][j] == 0 && x[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      } else if (x[i][j] == 0 && x[i - 1][j] == 0 && x[i][j - 1] == 0 &&\n                 x[i + 1][j] == 255 && x[i][j + 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27622", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t[100][100] = {0}, i, j, n, row[2] = {0}, col[2] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> t[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n\n      if (t[i][j] == 0 && row[0] == 0)\n        row[0] = i;\n      if (t[n - i + 1][j] == 0 && row[1] == 0)\n        row[1] = n - i + 1;\n      if (t[j][i] == 0 && col[0] == 0)\n        col[0] = i;\n      if (t[n - j + 1][n - i + 1] == 0 && col[1] == 0)\n\n        col[1] = n - i + 1;\n    }\n  }\n  printf(\"%d\\n\", (row[1] - row[0] - 1) * (col[1] - col[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int zl[100][100];\n  int i, j, k1 = 0, t1 = 0, k2 = 0, t2 = 0, r = 0;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (zl[i][j] == 0 && zl[i - 1][j] == 255 && zl[i][j - 1] == 255) {\n        k1 = i;\n        t1 = j;\n      } else if (zl[i][j] == 0 && zl[i + 1][j] == 255 && zl[i][j + 1] == 255) {\n        k2 = i;\n        t2 = j;\n      }\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = t1; j <= t2; j++) {\n      if (zl[i][j] == 255) {\n        r++;\n      }\n    }\n  }\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "27624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, z;\n  int point[100][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        if (i == 0 && j == 0 || i == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j != 0 && point[i][j - 1] != 0 ||\n            i != 0 && point[i - 1][j] != 0 && j != n - 1 &&\n                point[i][j + 1] == 0 && j == 0) {\n          a = i;\n          b = j;\n        } else if (j == n - 1 ||\n                   j != n - 1 && point[i][j - 1] == 0 && point[i][j + 1] != 0) {\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  z = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", z);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        break;\n    }\n    if (a == 0)\n      break;\n  }\n  int s = 0;\n  while (++j <= n) {\n    if (a == 0)\n      s++;\n    cin >> a;\n  }\n  int num = 0;\n  for (i += 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        num++;\n    }\n  int r;\n  r = (num - s) / 2;\n  s -= 2;\n  cout << r * s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, s, i, j;\n  int x[100][100];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 0)\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sz[500][500];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int mincol = n, minrow = n, maxcol = 0, maxrow = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i < mincol) {\n          mincol = i;\n        }\n        if (j < minrow) {\n          minrow = j;\n        }\n        if (i > maxcol) {\n          maxcol = i;\n        }\n        if (j > maxrow) {\n          maxrow = j;\n        }\n      }\n    }\n  }\n  int zong;\n  zong = (maxcol - mincol - 1) * (maxrow - minrow - 1);\n  printf(\"%d\", zong);\n  return 0;\n}\n"}
{"label": "15", "index": "27628", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, p;\n  scanf(\"%d\", &n);\n  m = n * n;\n  int i, j = 0, k, x = 0, a, b, c, d, e;\n  for (i = 1; i <= m; i++) {\n    cin >> p;\n    if (i % n == 1) {\n      j++;\n    }\n    k = i % n;\n    while (x == 0) {\n      if (p == 0) {\n        a = j;\n        b = k;\n        x = 1;\n      } else {\n        break;\n      }\n    }\n\n    if (p == 0) {\n      c = j;\n      d = k;\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[1000] = {0};\n  int a, i, j, k = 0, d = 0, l = 0, c = 0, temp = 0;\n  scanf(\"%d\\n\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &b[j]);\n    }\n    for (j = 0; j < a; j++) {\n      if (b[j] == 0 && c == 0) {\n        k = k + 1;\n        d = 1;\n        temp = j - k + 1;\n      }\n    }\n    if (d == 1) {\n      c = 1;\n    }\n    if (b[temp] == 0 && d == 1) {\n      l = l + 1;\n    } else {\n      continue;\n    }\n  }\n  cout << (k - 2) * (l - 2) << \"\\n\";\n}\n"}
{"label": "15", "index": "27630", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, feiwu, x, l, s, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    cin >> feiwu;\n    if (feiwu == 0) {\n      x = i + 1;\n      break;\n    }\n  }\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu != 0) {\n      l = i;\n      break;\n    }\n  }\n  s = l - x + 1;\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0)\n      s++;\n  }\n  printf(\"%d\", (l - x - 1) * (s - 2 * (l - x + 1)) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27631", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x1, x2, y1, y2, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  x1 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        y1 = i, x1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  x2 = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        y2 = i, x2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27632", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++)\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n        break;\n    if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n      break;\n  }\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++)\n      if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n        break;\n    if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n      break;\n  }\n  printf(\"%d\", (k - i) * (l - j));\n  return 0;\n}\n"}
{"label": "15", "index": "27633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1005][1005];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= 1004; i++) {\n    for (int j = 0; j <= 1004; j++)\n      a[i][j] = 255;\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  ;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  for (int i = n; i >= 1; i--) {\n    for (int j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  int s;\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27634", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[10000][10000];\nint main() {\n  int n, i, j, a1, b1, a2, b2, sum, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    flag = 0;\n    for (j = n - 1; j > 0; j--) {\n      if (s[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  sum = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n\n  cout << (x1 - x2 - 1) * (y1 - y2 - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, flag = 0, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        row1 = i;\n        col1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        row2 = i;\n        col2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  cout << (row2 - row1 - 1) * (col2 - col1 - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, e, f, x, y, p, s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  p = (x - e - 1) * (y - f - 1);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "27638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n    if (x == 0)\n      break;\n  }\n\n  for (j = j1 + 1; j < n; j++)\n    scanf(\"%d\", &x);\n\n  for (i = i1 + 1; i < n; i++) {\n    int y = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &x);\n      if (x == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27639", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000][1000], count = 0, wid = 0, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        count = count + 1;\n      }\n    }\n    if (count > 2) {\n      count = count;\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        wid = wid + 1;\n      }\n    }\n    if (wid > 2) {\n      wid = wid;\n      break;\n    }\n  }\n\n  x = (count - 2) * (wid - 2);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int num[101][100];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  i = j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  }\n  int a, b, c, d;\n  a = b = c = d = 0;\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && a == 0 && b == 0)\n        a = i, b = j + 1;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  i = j = 0;\n  do {\n    do {\n      if (num[i][j] == 0 && c <= i && d <= j)\n        c = i, d = j;\n      j++;\n    } while (j < n);\n    j = 0;\n    i++;\n  } while (i < n);\n  int s;\n  s = (c - a - 1) * (d - b);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[1000][1000], num, i, j, p[200], k = 0;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  int w = 0;\n  for (i = 0; i < (num - 1); i++) {\n    for (j = 0; j < (num - 1); j++) {\n      if (n[i][j] == 0 && n[i][j + 1] == 0)\n        break;\n      else if (n[i][j] == 0 && n[i][j + 1] != 0) {\n        p[w] = j;\n        w++;\n      }\n    }\n  }\n  for (i = 0; i < w - 1; i = i + 2) {\n    k = k + (p[i + 1] - p[i] - 1);\n  }\n  cout << k;\n  return 0;\n}\n"}
{"label": "15", "index": "27642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  int b, start1, start2, end1, end2;\n  b = 0;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && b == 0) {\n        start1 = i + 1;\n        start2 = j + 1;\n        b = 1;\n      }\n      if (a[i][j] == 0 && b == 1) {\n        end1 = i + 1;\n        end2 = j + 1;\n      }\n    }\n  }\n  int area;\n  area = (end1 - start1 - 1) * (end2 - start2 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "27643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], n1, n2, n3, n4, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n1 = i;\n        n2 = j;\n        goto loop;\n      }\nloop:\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n  num = (n3 - n1 - 1) * (n4 - n2 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27644", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, f, l, x, y, s;\n  static int b[100];\n  int i, j = 0, k = 0;\n  scanf(\"%d \", &n);\n  m = n * n;\n  for (i = 0; i < m; i++) {\n    cin >> a;\n    if (a == 0) {\n      j += 1;\n      b[k] = i + 1;\n      k += 1;\n    }\n  }\n  f = b[0];\n  for (k = 1; k < 100; k++) {\n    x = b[k - 1];\n    y = b[k];\n    if (x < y) {\n      l = y;\n    } else {\n      break;\n    }\n  }\n  if (l % n == 0) {\n    s = ((l % n) - (f % n) + n + 1) * ((l / n) - (f / n)) - j;\n  } else {\n    s = ((l % n) - (f % n) + 1) * ((l / n) - (f / n) + 1) - j;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27645", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x[1000][1000], s = 0, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  n = n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0 && x[i - 1][j] == 255 && x[i][j - 1] == 255 &&\n          x[i + 1][j] == 0 && x[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      } else if (x[i][j] == 0 && x[i - 1][j] == 0 && x[i][j - 1] == 0 &&\n                 x[i + 1][j] == 255 && x[i][j + 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27646", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], n, s = 0, S, h1 = 0, h2 = 0, l1 = 0, l2 = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && s == 0) {\n        l1 = i + 1;\n        h1 = j + 1;\n        s = 1;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0 && s) {\n        l2 = i;\n        h2 = j;\n        s = 0;\n      }\n  S = (l2 - l1) * (h2 - h1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b = 0, c = 0, d = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\", b * (d - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int an[100][100], i, j, n, s, a, b, flag = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (a = n - 1; a >= 0; a--) {\n    for (b = n - 1; b >= 0; b--) {\n      if (an[a][b] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  s = (b - j - 1) * (a - i - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27649", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i = 0, j;\n  int N, k, p;\n  scanf(\"%d\", &n);\n  N = n * n;\n  for (k = 0; k < N; k++) {\n    scanf(\"%d \", &p);\n    if (p == 0)\n      i++;\n  }\n  j = ((i / 4) - 1) * ((i / 4) - 1);\n  printf(\"%d\\n\", j);\n}\n"}
{"label": "15", "index": "27650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, i, j;\n  scanf(\"%d\", &n);\n  int a = 0, b = 0, c = 0, d = 0, m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a != 0 && b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0 && d != 0) {\n      break;\n    }\n  }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n\n  int js = 0;\n\n  for (int m = 0; m < n; m++) {\n    for (int p = 0; p < n; p++) {\n      if (sz[m][p] == 0 && sz[m][p + 1] == 0) {\n        js += 1;\n      }\n    }\n  }\n\n  int a;\n  a = (js - 2) / 2;\n\n  int js2 = 0;\n\n  for (int e = 0; e < n; e++) {\n    for (int r = 0; r < n; r++) {\n      if (sz[r][e] == 0 && sz[r + 1][e] == 0) {\n        js2 += 1;\n      }\n    }\n  }\n\n  int b;\n  b = (js2 - 2) / 2;\n\n  int s;\n  s = a * b;\n\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[1000][1000];\n\nint main(int argc, char *argv[]) {\n  int row, col, k = 0, n, i, j, l;\n  cin >> n;\n  ;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> matrix[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] == 0 && matrix[i][j + 1] != 0 && matrix[i][j - 1] != 0) {\n        for (j; j < n; j++) {\n          if (matrix[i][j + 1] == 255)\n            k++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", k);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int an[100][100], i, j, n, s, a, b, flag = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &an[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (a = n - 1; a >= 0; a--) {\n    for (b = n - 1; b >= 0; b--) {\n      if (an[a][b] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  s = (b - j - 1) * (a - i - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27654", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sa[100][100];\n  int m, n;\n  int k;\n  int a, b, c, d, e;\n  scanf(\"%d \", &k);\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &(sa[m][n]));\n    }\n  }\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      if (sa[m][n] == 0) {\n        goto ll;\n      }\n    }\n  }\nll:\n  a = m;\n  b = n;\n  for (m = k - 1; m >= 0; m--) {\n    for (n = k - 1; n >= 0; n--) {\n      if (sa[m][n] == 0) {\n        goto rr;\n      }\n    }\n  }\nrr:\n  c = m;\n  d = n;\n\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[1000][1000];\n  int n, i, j, point1, point2, row1, colum1, row2, colum2, num;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        point1 = a[i][j];\n        row1 = i;\n        colum1 = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        point2 = a[i][j];\n        row2 = i;\n        colum2 = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  num = (row2 - row1 - 1) * (colum2 - colum1 - 1);\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27656", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[1000][1000], i, j, a, b, c, d, n, sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        goto A;\n      }\n    }\nA:\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        goto B;\n      }\nB:\n  sum = (c - a - 1) * (d - b - 1);\n  printf(\"%d \", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27657", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n;\n  cin >> n;\n  int dt[n], i, j, k, p, q, N, sum = 0;\n  for (j = 1; j <= n; j++) { \n    for (i = 0; i < n; i++)\n      cin >> dt[i]; \n\n    for (p = 0; p < n; p++) {\n      if (dt[p] == 0) {         \n        for (k = n - 1;; k--) { \n          if (dt[k] == 0) {\n            N = k;\n            break;\n          }\n        }\n        for (q = p; q <= N; q++) {\n          if (dt[q] != 0)\n            sum++;\n        }\n      }\n    }\n  }\n\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  int length, width, x = 0, y = 0;\n  for (length = j; a[i][length] == 0; length++) {\n    x++;\n  }\n  for (width = i; a[width][j] == 0; width++) {\n    y++;\n  }\n  int p;\n  p = (x - 2) * (y - 2);\n  printf(\"%d\", p);\n}\n"}
{"label": "15", "index": "27659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a, x, y;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (i = x + 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      y = i;\n    }\n  }\n  printf(\"%d\", (y / n - x / n - 1) * (y % n - x % n - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, s, t, n, p, x, z;\n  x = 0;\n  z = 0;\n  cin >> n;\n  p = n * n;\n  s = 255;\n  for (i = 1; i <= p; i++) {\n    t = s;\n    scanf(\"%d\", &s);\n    if (s == 0 && t == 0)\n      x += 1;\n    if (s == 0)\n      z += 1;\n  }\n  z = (z - x - 2) / 2;\n  x = x / 2 - 1;\n  x = x * z;\n  printf(\"%d\\n\", x);\n}\n"}
{"label": "15", "index": "27661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], p, q, r, s, mj;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i + 1][j + 1] != 0) {\n        p = j;\n        q = i;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0 &&\n          a[i - 1][j - 1] != 0) {\n        r = i;\n        s = j;\n      }\n    }\n  mj = (r - p - 1) * (s - q - 1);\n  printf(\"%d\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27662", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int A[1000][1000];\n  int n, a, b, c, d;\n  int i = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &A[i][j]);\n      if (A[i][j] == 0 && A[i][j - 1] != 0 && A[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[1000][1000];\n  int i, j, sum;\n  int c = 0, k = 0, r = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255) {\n        c = i;\n        k = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        r = i;\n        t = j;\n      }\n    }\n  }\n\n  sum = (r - c - 1) * (t - k - 1);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27665", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint map_1[1010][1010];\n\nvoid init();\nvoid work();\n\nint main() {\n  init();\n  work();\n  return 0;\n}\n\nvoid init() {\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> map_1[i][j];\n  }\n}\n\nvoid work() {\n  int sx, sy, ex, ey, f, i, j;\n  sx = sy = 0;\n  ex = ey = n - 1;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (map_1[i][j] == 0) {\n        sx = i;\n        sy = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  f = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (map_1[i][j] == 0) {\n        ex = i;\n        ey = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  cout << (ex - sx - 1) * (ey - sy - 1) << endl;\n}\n"}
{"label": "15", "index": "27666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int area[1000][1000];\n  scanf(\"%d\", &n);\n  int f = 1;\n  int start1, start2, end1, end2, re;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> area[i][j];\n      if (area[i][j] == 0 && f == 1) {\n        start1 = i;\n        start2 = j;\n        f = 2;\n      }\n      if (area[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n  }\n  re = (end1 - start1 - 1) * (end2 - start2 - 1);\n  cout << re;\n  return 0;\n}\n"}
{"label": "15", "index": "27667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, z;\n  int a[100][100];\n  int x;\n  int a1, b1, a2, b2;\n  int br = 1;\n  int s;\n\n  scanf(\"%d\", &n);\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      scanf(\"%d\", &a[h][z]);\n    }\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0) {\n        a1 = h;\n        b1 = z;\n        br = 0;\n        break;\n      }\n    }\n    if (br == 0)\n      break;\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0 && a[h - 1][z] == 0 && a[h][z - 1] == 0) {\n        a2 = h;\n        b2 = z;\n      }\n    }\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s, a, c = 1, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      if (c) {\n        t = i;\n        c = 0;\n      }\n      k = i;\n    }\n  }\n  s = (k % n - t % n - 1) * (k / n - t / n - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, k;\n  scanf(\"%d\", &n);\n  c = 0;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (j < n)\n        scanf(\" \");\n      if (k == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      b = a;\n    if (a >= 1)\n      c = c + 1;\n  }\n  d = (b - 2) * (c - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "27670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, s, k = 0;\n  int b[1000];\n  b[0] = 0;\n  scanf(\"%d\", &n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n\n      if (a[i][j] == 0) {\n        b[k] = b[k] + 1;\n      }\n    }\n    if (b[k] != 0) {\n      k += 1;\n    }\n  }\n\n  s = (b[0] - 2) * (k - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int x1, y1, x2, y2;\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      if (sz[row][col] == 0) {\n        x1 = row;\n        y1 = col;\n      }\n    }\n  }\n  for (int row = n; row > 0; row--) {\n    for (int col = n; col > 0; col--) {\n      if (sz[row][col] == 0) {\n        x2 = row;\n        y2 = col;\n      }\n    }\n  }\n  int s;\n  s = (x2 - x1 + 1) * (y2 - y1 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27672", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, i, j, a[40][40];\n  cin >> i;\n  for (i = 1; i < x; i++) {\n    a[i][i] = 1;\n    a[i][1] = 1;\n  }\n  for (i = 3; i < x; i++) {\n    for (j = 2; j <= i - 1; j++) {\n      a[i][j] = a[i - 1][j - 1] + a[i - 1][j];\n    }\n  }\n  for (i = 1; i < x; i++) {\n    for (j = 1; j < i; j++) {\n      printf(\"%6d\", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int t, i, j, x = 0, b = 0, m = 0, n = 0, s, s1, s2;\n\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i][j] == 0) {\n        x = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[x][b] == 0)\n      break;\n  }\n  for (i = t - 1; i >= 0; i--) {\n    for (j = t - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        m = i;\n        n = j;\n\n        break;\n      }\n    }\n    if (a[m][n] == 0)\n      break;\n  }\n  s1 = m - x - 1;\n  s2 = n - b - 1;\n  s = s1 * s2;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int len0, wid0, len1, wid1;\n  int a[100][100];\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", *(a + i) + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        len0 = i;\n        wid0 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        len1 = i;\n        wid1 = j;\n      }\n    }\n  printf(\"%d\\n\", abs((len1 - len0 - 1) * (wid1 - wid0 - 1)));\n  return 0;\n}\n"}
{"label": "15", "index": "27675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, sum;\n  scanf(\"%d\\n\", &n);\n  int sz[100][100];\n  int row, col;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\\n\", &(sz[row][col]));\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0 && sz[row][col + 1] == 255) {\n        a = row;\n        b = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row > 0; row--) {\n    for (col = n - 1; col > 0; col--) {\n      if (sz[row][col] == 0 && sz[row][col - 1] == 255) {\n        c = row;\n        d = col;\n        break;\n      }\n    }\n  }\n  sum = (c - a + 1) * (d - b + 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, i, begin, end, flag = 0, x1, x2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      if (flag == 0)\n        begin = i;\n      flag = 1;\n      end = i;\n    }\n  }\n  x1 = (begin + n - 1) / n;\n  y1 = begin % n;\n  x2 = (end + n - 1) / n;\n  y2 = end - n * (x2 - 1);\n\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int s[100][100], n, i, j, result, a = -1, b = -1, c = -1, d = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c >= 0)\n      break;\n  }\n  result = (c - a - 1) * (d - b - 1);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "27678", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, b = 0, c = 0, d = 0, i, k, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      cin >> a;\n      if (a == 0) {\n        b++;\n        d++;\n      }\n    }\n    if (d != 0) {\n      c++;\n      d = 0;\n    }\n  }\n  max = ((b - 2 * c) / 2) * (c - 2);\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "15", "index": "27679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n\n  int i, j, k;\n\n  int r;\n\n  int ni, nj, nk, nm, nn;\n\n  nk = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &ni);\n    if (ni == 0) {\n      nk += 1;\n    }\n    if (ni == 255 && nk != 0 && r == 0) {\n      r = nk;\n    }\n  }\n  r = (nk - 2 * r) / 2 * (r - 2);\n\n  printf(\"%d\", r);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int row, col, n, s = 0;\n  int sz[1000][1000];\n  int star1, star2, end1, end2;\n  int f = -1;\n  scanf(\"%d\", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz[row][col]));\n  }\n  for (row = 1; row < n - 1; row++) {\n    for (col = 1; col < n - 1; col++) {\n      if (sz[row][col] == 0 && f == -1) {\n        star1 = row;\n        star2 = col;\n        f = 1;\n      }\n      if (sz[row][col] == 0) {\n        end1 = row;\n        end2 = col;\n      }\n    }\n  }\n  s = (end1 - star1 - 1) * (end2 - star2 - 1);\n\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, x1, x2, n, d, n2, s;\n  int a;\n  cin >> n;\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    cin >> a;\n  }\n  x1 = i;\n  n2 = n * n;\n  x2 = i;\n  d = 0;\n  for (j = i; j <= n2; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      d++;\n    if (a == 0) {\n      x2++;\n      x2 = x2 + d;\n      d = 0;\n    }\n  }\n  s = ((x2 - x2 % n) / n - (x1 - x1 % n) / n - 1) * (abs(x1 % n - x2 % n) - 1);\n  printf(\"%ld\", s);\n}\n"}
{"label": "15", "index": "27682", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        zb[k][0] = i;\n        zb[k][1] = j;\n        k++;\n      }\n    }\n  }\n\n  s = (zb[k - 1][0] - zb[0][0] - 1) * (zb[k - 1][1] - zb[0][1] - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[101][101], p, q, l, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  for (i = 1; i <= p; i++) {\n    for (j = 1; j <= q; j++) {\n      if (a[i][j] == 0) {\n        l = i;\n        m = j;\n        i = p;\n        break;\n      }\n    }\n  }\n  j = (p - l - 1) * (q - m - 1);\n  printf(\"%d\", j);\n  return 0;\n}\n"}
{"label": "15", "index": "27684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1002][1002] = {0}, flag = 0, er, ec, sr, sc;\n  scanf(\"%d \", &n);\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (*(*(a + i) + j) == 0) {\n        sr = i;\n        sc = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  flag = 0;\n\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (*(*(a + i) + j) == 0) {\n        er = i;\n        ec = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n\n  cout << (er - sr - 1) * (ec - sc - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27685", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[1000][1000];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &p[i][j]);\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1001][1001] = {0};\n  int i, j, temp = 0;\n  int c1, c2, d1, d2, f1, f2, g1, g2;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        c1 = i;\n        c2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i + 1][j] == 0) {\n        d1 = i;\n        d2 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j + 1] == 0) {\n        f1 = i;\n        f2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        g1 = i;\n        g2 = j;\n      }\n    }\n  temp = (d2 - c2 - 1) * (f1 - c1 - 1);\n  printf(\"%d\", temp);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, area, flag = 1, glaf = 0, a_1, a_2, b_1, b_2, term_1, term_2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    term_2 = 1;\n    for (j = 0; j < n; j++) {\n      term_1 = term_2;\n      scanf(\"%d\", &term_2);\n      if (flag) {\n        if (!term_2) {\n          a_1 = i;\n          b_1 = j;\n          flag = !flag;\n        }\n      } else {\n        if (!glaf && i > a_1 && term_1 == 0 && term_2 == 0) {\n          a_2 = i;\n          glaf = !glaf;\n        }\n        if (glaf && term_1 == 0 && term_2 == 255) {\n          b_2 = j - 1;\n          goto label;\n        }\n      }\n    }\n  }\nlabel:\n  area = (a_2 - a_1 - 1) * (b_2 - b_1 - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int ROW, COL, ROW1, COL1, col, row;\n  int n, k = 0;\n  int T = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  ROW = n - 1;\n  COL = n - 1;\n\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      if (T == 0 && sz[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n\n        T = 1;\n      }\n    }\n  }\n  for (row = ROW; row >= ROW1; row--) {\n    for (col = COL; col >= COL1; col--) {\n      if (T == 0 && sz[row][col] == 0) {\n        COL = col;\n        ROW = row;\n\n        T = 1;\n      }\n    }\n  }\n\n  a = ROW - ROW1 - 3;\n  b = COL - COL1 - 1;\n  k = a * b;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "27689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, b, c, s, y = 0;\n  int **a;\n  cin >> n;\n  a = (int **)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    a[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = i + 1;\n        k = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  y = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        b = i + 1;\n        c = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  s = (b - m - 1) * (c - k - 1);\n  cout << s;\n  for (i = 0; i < n; i++) {\n    free(a[i]);\n    a[i] = 0;\n  }\n  free(a);\n  a = 0;\n}\n"}
{"label": "15", "index": "27690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, u[1000][1000], i, j, chang = 0, bian = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> u[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (u[i][j] == 0) {\n        chang = chang + 1;\n      }\n    }\n    if (chang != 0) {\n      break;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (u[i][j] == 0) {\n        bian = bian + 1;\n      }\n    }\n    if (bian != 0) {\n      break;\n    }\n  }\n  sum = (chang - 2) * (bian - 2);\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, leftrow, leftcolumn, rightrow, rightcolumn, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 0; i < n + 2; i++) {\n    for (j = 0; j < n + 2; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        leftrow = i;\n        leftcolumn = j;\n      }\n      if (a[i][j] == 0 && a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        rightrow = i;\n        rightcolumn = j;\n      }\n    }\n  }\n  s = (rightcolumn - leftcolumn - 1) * (rightrow - leftrow - 1);\n  cout << s;\n}\n"}
{"label": "15", "index": "27692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {1};\n  int i, j, x1, x2, y1, y2;\n  int n, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j != n + 1)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j != 0)\n      break;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, shu[1000][1000], i, k, heng = 0, s = 0, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shu[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (shu[i][k] == 0)\n        heng += 1;\n    }\n    if (heng != 0) {\n      break;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (shu[i][k] == 0) {\n        s += 1;\n      }\n    }\n    if (s != 0) {\n      break;\n    }\n  }\n  count = (s - 2) * (heng - 2);\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "27694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int cancer[100][100];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &cancer[i][j]);\n    }\n  }\n  int a, b, c, d, m, x;\n  for (m = 0; m < n; m++) {\n    for (x = 0; x < n; x++) {\n      if (cancer[m][x] == 0) {\n        if ((cancer[m - 1][x] == 255) && (cancer[m][x - 1] == 255) &&\n            (cancer[m + 1][x + 1] == 255)) {\n          a = m;\n          b = x;\n        } else if ((cancer[m + 1][x] == 255) && (cancer[m][x + 1] == 255) &&\n                   (cancer[m - 1][x - 1] == 255)) {\n          c = m, d = x;\n        }\n      }\n    }\n  }\n  int e;\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, s = 0, t = 0, q, mianji;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        s++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    q = 0;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        t++;\n        q = 1;\n      }\n    }\n    if (q == 1)\n      break;\n  }\n  mianji = (t - 2) * (s - 2);\n  cout << mianji;\n  return 0;\n}\n"}
{"label": "15", "index": "27696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a1, a2, b1, b2, c, d = 0, e = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      break;\n  }\n  for (j = n - 1; j > b1; j--) {\n    for (i = n - 1; i > a1; i--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  c = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "27697", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, an[500][500], a, b, c, d, e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> an[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (an[i][j] == 0) {\n        c = i;\n        d = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  int s;\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int sz[n][n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, a2, b1, b2, a, b, c;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  cout << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], is1[4000], is2[4000], s, n;\n  int k = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n\n        is1[k] = i;\n        is2[k++] = j;\n      }\n    }\n  }\n  printf(\"%d\", (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27700", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, first, num, fstn, counter1 = 0, counter2 = 0;\n  int sum = 0;\n  int c[100][100] = {0};\n  int s[100] = {0};\n  int t[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> c[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int tum1 = 0;\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += c[i][j];\n    }\n    tum1 = n - sum / 255;\n    s[i] = tum1;\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] != 0) {\n      first = i + 1;\n      fstn = s[i];\n      break;\n    }\n  }\n  for (i = first; s[i] != fstn; i++) {\n    counter1++;\n  }\n  for (j = 0; j < n; j++) {\n    int tum2;\n    sum = 0;\n    for (i = 0; i < n; i++)\n      sum += c[i][j];\n\n    tum2 = n - sum / 255;\n    t[j] = tum2;\n  }\n  for (j = 0; j < n; j++) {\n    if (t[j] != 0) {\n      first = j + 1;\n      fstn = t[j];\n      break;\n    }\n  }\n  for (j = first; t[j] != fstn; j++) {\n    counter2++;\n  }\n  printf(\"%d\", counter1 * counter2);\n  return 0;\n}\n"}
{"label": "15", "index": "27701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, x, y, p, q, s, t, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(*(a + i) + j) == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n  for (p = n - 1; p >= 0; p--)\n    for (q = n - 1; q >= 0; q--)\n      if (*(*(a + p) + q) == 0) {\n        s = p;\n        t = q;\n        break;\n      }\n  printf(\"%d\", (x - s - 1) * (t - y - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27702", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, f, l, x, y, s;\n  static int b[100];\n  int i, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  m = n * n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      j += 1;\n      b[k] = i + 1;\n      k += 1;\n    }\n  }\n  f = b[0];\n  for (k = 1; k < 100; k++) {\n    x = b[k - 1];\n    y = b[k];\n    if (x < y) {\n      l = y;\n    } else {\n      break;\n    }\n  }\n  if (l % n == 0) {\n    s = ((l % n) - (f % n) + n + 1) * ((l / n) - (f / n)) - j;\n  } else {\n    s = ((l % n) - (f % n) + 1) * ((l / n) - (f / n) + 1) - j;\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27703", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, r, i, j, s, k, n;\n  int a[10][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j] == 0) {\n        k = i;\n        t = 0, r = 0;\n\n        while (a[i][j] != 255) {\n          i++;\n          t++;\n        }\n        i = k;\n        while (a[i][j] != 255) {\n          j++;\n          r++;\n        }\n        i = n + 1;\n        j = n + 1;\n      }\n    }\n  s = (r - 2) * (t - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27704", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, n, x = 0, y = 0, l1, l2, q1, q2, s;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (j = 1; j <= n * n - x; j++) {\n    scanf(\"%d\", &b);\n    if (b == 0)\n      y = x + j;\n  }\n  l1 = x / n + 1;\n  if (x % n != 0) {\n    l1 = x / n + 1;\n    q1 = x % n;\n  } else {\n    l1 = x / n;\n    q1 = n;\n  }\n  if (y % n != 0) {\n    l2 = y / n + 1;\n    q2 = y % n;\n  } else {\n    l2 = y / n;\n    q2 = n;\n  }\n  s = (l2 - l1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, num;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++)\n\n  {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i - 1][j - 1] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i + 1][j + 1] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n    num = (x2 - x1 + 1) * (y2 - y1 + 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27706", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, ki, kj, endj, endi, a[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i][j]);\n  ki = -1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 0) {\n        ki = i;\n        kj = j;\n        break;\n      }\n    if (ki >= 0)\n      break;\n  }\n  for (i = ki, j = kj; j <= n; j++)\n    if (a[i][j] == 255) {\n      endj = j - 1;\n      break;\n    }\n  for (i = ki, j = kj; i <= n; i++)\n    if (a[i][j] == 255) {\n      endi = i - 1;\n      break;\n    }\n  s = (endi - ki - 1) * (endj - kj - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[99][99], i, j, S, c, b, g, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        t = i;\n        g = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        b = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  S = (c - t - 1) * (b - g - 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27708", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, z[1000][1000], i, j, k, l, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> z[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  k = i;\n  l = j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j >= 0)\n      break;\n  }\n  k = i - k - 1;\n  l = j - l - 1;\n  s = k * l;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27709", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int zu[100][100];\n  int n, a, b, c, d;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &zu[j][i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i == 0 && zu[j][i] == 0) {\n        a = j;\n        b = 0;\n      } else if (i != 0 && j == 0 && zu[j][i] == 0) {\n        a = 0;\n        b = i;\n      } else if (j != 0 && i != 0 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 255 && zu[j][i - 1] == 255 && zu[j + 1][i] == 0 &&\n            zu[j][i + 1] == 0) {\n          a = j;\n          b = i;\n        }\n      }\n      if (i == n - 1 && zu[j][i] == 0) {\n        c = j;\n        d = n - 1;\n      } else if (i != n - 1 && j == n - 1 && zu[j][i] == 0) {\n        c = n - 1;\n        d = i;\n      } else if (i != n - 1 && j != n - 1 && zu[j][i] == 0) {\n        if (zu[j - 1][i] == 0 && zu[j][i - 1] == 0 && zu[j + 1][i] == 255 &&\n            zu[j][i + 1] == 255) {\n          c = j;\n          d = i;\n        }\n      }\n    }\n  }\n  int mian;\n  mian = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", mian);\n  return 0;\n}\n"}
{"label": "15", "index": "27710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0, p, flag = 0, a = -2, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        m++;\n        a++;\n      } else if (flag == 1) {\n        m++;\n        a++;\n      } else\n        m++;\n    } else {\n      if (flag == 1) {\n        flag = 0;\n      }\n    }\n  }\n  b = m / 2 - a - 2;\n  printf(\"%d\", a * b);\n  return 0;\n}\n"}
{"label": "15", "index": "27711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0;\n  int k[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k[i][j] == 0) {\n        while (k[i][j + 1] == 255) {\n          j++;\n          num++;\n        }\n\n        if (k[i][j + 1] == 0)\n          break;\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a, x, y;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (i = x + 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      y = i;\n    }\n  }\n  cout << (y / n - x / n - 1) * (y % n - x % n - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100] = {255};\n  int n, i = 0, j = 0, x1, y1, x2, y2, x, y, s;\n  cin >> n;\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        x1 = x;\n        y1 = y;\n        i = 1;\n        break;\n      }\n    }\n    if (i == 1) {\n      break;\n    } else\n      ;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        x2 = x;\n        y2 = y;\n        j = 1;\n        break;\n      }\n    }\n    if (j == 1) {\n      break;\n    } else\n      ;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (k == 0) {\n        c = i;\n        d = j;\n        if (a == 0 && b == 0) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  m = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int a = 0, b = 0;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a++;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  int sum = 0;\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27716", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, x1, x2, y1, y2;\n  int n, t;\n  int area, statue = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (statue == 0) {\n          x1 = i;\n          y1 = j;\n          statue++;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27717", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1001], i, p, j, s = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        count++;\n      if (count == 1 && a[j] != 0)\n        s++;\n    }\n  }\n  printf(\"\\n%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27718", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint map_1[1010][1010];\n\nvoid init();\nvoid work();\n\nint main() {\n  init();\n  work();\n  return 0;\n}\n\nvoid init() {\n  int i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> map_1[i][j];\n    }\n  }\n}\n\nvoid work() {\n  int sx, sy, ex, ey, f, i, j;\n  sx = sy = 0;\n  ex = ey = n - 1;\n  f = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (map_1[i][j] == 0) {\n        sx = i;\n        sy = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  f = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (map_1[i][j] == 0) {\n        ex = i;\n        ey = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f)\n      break;\n  }\n  cout << (ex - sx - 1) * (ey - sy - 1) << endl;\n}\n"}
{"label": "15", "index": "27719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h, l, s, i, j, p, sum, m;\n  scanf(\"%d\", &n);\n  sum = 0;\n  j = 0;\n  for (h = 1; h <= n; h++) {\n    i = 0;\n    for (l = 1; l <= n; l++) {\n      cin >> s;\n      if (s == 0)\n        i++;\n    }\n    sum = sum + i;\n    if (i != 0)\n      j++;\n  }\n  if (j <= 2 || sum <= 2 * j)\n    printf(\"0\");\n  else {\n    p = (sum - 2 * j) / 2;\n    m = p * (j - 2);\n    cout << m;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b = 0, c = 0, d = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\", b * (d - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27721", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, j1, i2, j2, i, j, t, a[100][100];\n  cin >> n;\n  if (n == 9)\n    printf(\"%d\", n);\n  else if (n == 6)\n    printf(\"2\");\n\n  else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (j = n - 1; j >= 0; j--) {\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    t = (i2 - i1 - 1) * (j2 - j1 - 1);\n    printf(\"%d\\n\", t);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27722", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, a, n, b = 0, c = 0, d = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\\n\", (b * (d - 2)));\n  return 0;\n}\n"}
{"label": "15", "index": "27723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, num;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++)\n\n  {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i - 1][j - 1] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i + 1][j + 1] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n    num = (x2 - x1 + 1) * (y2 - y1 + 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[1000][1000], count = 0, mark;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    mark = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0 && c[i][j + 1] == 0)\n        break;\n      else {\n        if (c[i][j] == 0)\n          mark++;\n      }\n      if (c[i][j] && mark % 2)\n        count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int tu[100][100] = {0};\n  int i, n, k, count = 0, m = 0, first = 0, l = 0, h = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> tu[i][k];\n      if (tu[i][k] == 0 && first == 0) {\n        l++;\n      }\n    }\n    if (l > 0) {\n      first = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (tu[i][k] == 0) {\n        count++;\n      }\n    }\n  }\n  h = (count - 2 * l) / 2;\n  m = (l - 2) * h;\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27726", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int image[1000][1000];\n  int n, i, j, area, begRow, begCol, endRow, endCol, isBreak;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &image[i][j]);\n    }\n  isBreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n        begRow = i;\n        begCol = j;\n        isBreak = 1;\n        break;\n      }\n    }\n    if (isBreak)\n      break;\n  }\n  for (i = begRow; i < n; i++) {\n    if (i == (n - 1) && image[i][begCol] == 0)\n      endRow = i;\n    else if (image[i][begCol] != 0) {\n      endRow = i - 1;\n      break;\n    }\n  }\n  for (j = begCol; j < n; j++) {\n    if (j == (n - 1) && image[begRow][j] == 0)\n      endCol = i;\n    else if (image[begRow][j] != 0) {\n      endCol = j - 1;\n      break;\n    }\n  }\n  area = (endRow - begRow - 1) * (endCol - begCol - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s[1000][1000], x1, y1, x2, y2, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i + 2][j] == 0 &&\n          s[i][j + 1] == 0 && s[i + 1][j + 1] == 255) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i - 2][j] == 0 &&\n          s[i][j - 1] == 0 && s[i - 1][j - 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, s, n, b[2], c[2], q = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      b[p] = i;\n      p += 1;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      c[q] = i;\n      q += 1;\n    }\n  }\n  printf(\"%d\", (b[1] - b[0] - 1) * (c[1] - c[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27729", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  int graphic[100][100];\n  int i = 0, j = 0, rightEst, bottumEst;\n  int width = 0, lengh = 0;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &graphic[i][j]);\n      if (graphic[i][j] == 0) {\n        rightEst = i;\n        bottumEst = j;\n      }\n    }\n  }\n  for (i = rightEst, j = bottumEst; i >= 0; i--) {\n    if (graphic[i][j] == 0)\n      width++;\n    else\n      break;\n  }\n  for (i = rightEst, j = bottumEst; j >= 0; j--) {\n    if (graphic[i][j] == 0)\n      lengh++;\n    else\n      break;\n  }\n  int portation = width * lengh - width * 2 - (lengh - 2) * 2;\n\n  printf(\"%d\\n\", portation);\n  return 0;\n}\n"}
{"label": "15", "index": "27730", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, x1, x2, y1, y2;\n  int n, t;\n  int area, statue = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (statue == 0) {\n          x1 = i;\n          y1 = j;\n          statue++;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "27731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100], i, j, x1 = -1, y1, x2 = -1, y2, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x1 == -1)\n      continue;\n    else\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x2 == -1)\n      continue;\n    else\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27732", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  int *p;\n  int flag = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n;) {\n    for (p = a; p < a + n;) {\n      scanf(\"%d\", p);\n      if (*p != 0) {\n        p++;\n        continue;\n      }\n      flag = 1;\n      break;\n    }\n    if (flag == 0) {\n      i++;\n      continue;\n    }\n    a1 = p - a;\n    b1 = i;\n    for (p = p + 1; p < a + n; p++) {\n      scanf(\"%d\", p);\n      if (*p != 0)\n        break;\n    }\n    a2 = p - a - 1;\n    break;\n  }\n  for (p = p + 1; p < a + n; p++) {\n    scanf(\"%d\", p);\n  }\n  do {\n    i++;\n    for (p = a; p < a + n; p++)\n      scanf(\"%d\", p);\n  } while (a[a1] == 0);\n  b2 = i - 1;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  for (j = 1; j <= n * (n - 1 - i); j++)\n    scanf(\"%d\", &a[0]);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, num;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n - 1; i++)\n\n  {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i - 1][j - 1] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i + 1][j + 1] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n    num = (x2 - x1 + 1) * (y2 - y1 + 1);\n  }\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sum, x, y, f, s;\n  int a[100][100];\n  x = 0;\n  y = 0;\n  f = 1;\n  sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        sum = sum + 1;\n        if (f == 1) {\n          x = x + 1;\n        }\n      }\n      if ((sum > 0) && (a[i][j] == 255)) {\n        f = 0;\n      }\n    }\n  }\n  y = sum / 2 - x;\n  x = x - 2;\n  s = x * y;\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "27735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, S, notfind = 1, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n && notfind; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        notfind = 0;\n        break;\n      }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n  \n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "27736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  int k;\n  int sum = 0;\n  for (k = 0; k < n && sum == 0; k++) {\n    int p;\n    for (p = 0; p < n; p++) {\n      if (sz[k][p] == 0)\n        sum = sum + 1;\n    }\n  }\n  int sum1 = 0;\n  int q;\n  for (q = 0; q < n && sum1 == 0; q++) {\n    int m;\n    for (m = 0; m < n; m++) {\n      if (sz[m][q] == 0) {\n        sum1++;\n      }\n    }\n  }\n\n  int jieguo = (sum - 2) * (sum1 - 2);\n  cout << jieguo;\n  return 0;\n}\n"}
{"label": "15", "index": "27737", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, s = 0;\n  cin >> m;\n  int area[1000][1000];\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &area[i][j]);\n    }\n  }\n  k = 0;\n  int ib = 0, jb = 0, ie = 0, je = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ib = i;\n          jb = j;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n  for (i = m - 1; i >= 0; i--) {\n    for (j = m - 1; j >= 0; j--) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ie = i;\n          je = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (ie - ib - 1) * (je - jb - 1);\n  printf(\"%d \", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int s, x, i, j, n, a1, a2, b1, b2;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  cin >> n;\n  for (i = 1; i < (n + 1); i++) {\n    for (j = 1; j < (n + 1); j++) {\n      scanf(\"%d\", &x);\n      if ((x == 0) && (a1 == 0)) {\n        a1 = i;\n        a2 = j;\n      }\n      if (x == 0) {\n        b1 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b1 - a1 - 1) * (b2 - a2 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, a1, a2, b1, b2, f = -1, s = 0;\n  int(sz[1000][1000]);\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      getchar();\n      if (((sz[i][k]) == 0) && (f == -1)) {\n        a1 = i;\n        b1 = k;\n        f = 1;\n      }\n      if ((sz[i][k]) == 0) {\n        a2 = i;\n        b2 = k;\n      }\n    }\n  }\n\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"%d\\n\", s);\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27740", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000][1000];\n\nint main() {\n  int n, i, j, i1, j1, i2, j2, flag = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n      if (flag && *(*(a + i) + j) == 0) {\n        i1 = i;\n        j1 = j;\n        flag = 0;\n      }\n    }\n  }\n  for (i = i1; i < n; i++) {\n    if (*(*(a + i) + j1) != 0) {\n      i2 = i - 1;\n      break;\n    }\n  }\n  if (i == n)\n    i2 = i - 1;\n  for (j = j1; j < n; j++) {\n    if (*(*(a + i2) + j) != 0) {\n      j2 = j - 1;\n      break;\n    }\n  }\n  if (j == n)\n    j2 = j - 1;\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, s, n;\n  int l, r;\n  scanf(\"%d\", &n);\n  if (n <= 10) {\n    int cancel[10][10];\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        scanf(\"%d\", &cancel[l][r]); \n      }\n    }\n    int r1, r2, l1, l2;\n    for (i = 0, l = 0; l < n; l++) {\n      for (i = 0, r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l1 = l;\n          r1 = r;\n          i = 1;\n          break;\n        }\n      }\n      if (i == 1) {\n        break;\n      }\n    }\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l2 = l;\n          r2 = r;\n        }\n      }\n    }\n    s = (l2 - l1 - 1) * (r2 - r1 - 1);\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b = 0, c = 0, d = 0, i, k, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        b++;\n        d++;\n      }\n    }\n    if (d != 0) {\n      c++;\n      d = 0;\n    }\n  }\n  max = ((b - 2 * c) / 2) * (c - 2);\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "15", "index": "27743", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int a = 0, b = 0;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a++;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  int sum = 0;\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, p;\n  scanf(\"%d\", &n);\n  m = n * n;\n  int i, j = 0, k, x = 0, a, b, c, d, e;\n  for (i = 1; i <= m; i++) {\n    cin >> p;\n    if (i % n == 1) {\n      j++;\n    }\n    k = i % n;\n    while (x == 0) {\n      if (p == 0) {\n        a = j;\n        b = k;\n        x = 1;\n      } else\n        break;\n    }\n\n    if (p == 0) {\n      c = j;\n      d = k;\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int shu[1000][1000];\n  int n, a, b, c, d, l;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &shu[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (shu[i][j] == 0) {\n        a = i;\n        b = j;\n\n        break;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (shu[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0) {\n      break;\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, i, j, x, y, s, m[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i + 1][j] == 0 && m[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (m[i][j] == 0 && m[i][j - 1] == 0 && m[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  x = c - a - 1;\n  y = d - b - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "27748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, a, n, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255) {\n      b = 0;\n    }\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\\n\", (b * (d - 2)));\n  return 0;\n}\n"}
{"label": "15", "index": "27749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, x1, y1, x2, y2, a[1000], t;\n  x1 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0) {\n        if (x1 == -1) {\n          x1 = i;\n          y1 = j;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  t = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, t = 0, flag, line = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        t++;\n        flag = 1;\n      }\n    }\n    if (flag == 1)\n      line++;\n  }\n  cout << (line - 2) * (t - line * 2) / 2;\n  return 0;\n}\n"}
{"label": "15", "index": "27751", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, tmp1, tmp2, m = 0, l = 0, i, s;\n  scanf(\"%d \", &n);\n  cin >> tmp1;\n  if (tmp1 == 0) {\n    m++;\n    l++;\n  }\n  for (i = 1; i < n * n; i++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n    m += (tmp2 == 0);\n    if (tmp2 == 255 && tmp1 == 0) {\n      break;\n    }\n    tmp1 = tmp2;\n  }\n  for (int j = i; j < n * n; j++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n  }\n  s = (m - 2) * (l - 2 * m) / 2;\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, b[1000][2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        b[m][0] = i;\n        b[m][1] = j;\n        m++;\n      }\n    }\n  cout << (b[m - 1][0] - b[0][0] - 1) * (b[m - 1][1] - b[0][1] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27753", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a = -1, b = -1, c, d, x, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x;\n      if (x == 0) {\n        c = i;\n        d = j;\n        if ((a == -1) && (b == -1)) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[1000][1000], i, j, a, b, a1, b1, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (p[a][b] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (p[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (p[a1][b1] == 0) {\n      break;\n    }\n  }\n  s = (a1 - a - 1) * (b1 - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27755", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, number[1001], i, p, count, start, end;\n  count = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    start = 0;\n    end = 0;\n    for (p = 1; p <= n; p++) {\n      scanf(\"%d\", &number[p]);\n    }\n\n    for (p = 1; p <= n - 1; p++) {\n      if (start == 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        start = p;\n      }\n      if (start != 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        end = p;\n      }\n    }\n    if (end - start <= 1) {\n      continue;\n    }\n    count += (end - start - 1);\n  }\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "27756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, q[1000][1000], a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &q[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (q[i][j] == 0) {\n        a = i + 1;\n        b = j + 1;\n        goto tsu;\n      }\n    }\n  }\ntsu:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (q[i][j] == 0) {\n        c = i - 1;\n        d = j - 1;\n        goto pku;\n      }\n    }\n  }\npku:\n  cout << (c - a + 1) * (d - b + 1);\n}\n"}
{"label": "15", "index": "27757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, *p = NULL, mianji;\n  int zhongliu[1000][1000];\n  int zuoshang[2], youxia[2];\n  p = zhongliu[0];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(p + i * n + j);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (*(p + i * n + j) == 0 && *(p + i * n + j + 1) == 0 &&\n          *(p + (i + 1) * n + j) == 0 && j + 1 < n && i + 1 < n) {\n        zuoshang[0] = i;\n        zuoshang[1] = j;\n      } else if (*(p + i * n + j) == 0 && *(p + i * n + j - 1) == 0 &&\n                 *(p + (i - 1) * n + j) == 0 && j - 1 > 0 && i - 1 > 0) {\n        youxia[0] = i;\n        youxia[1] = j;\n      }\n    }\n  mianji = (youxia[0] - zuoshang[0] - 1) * (youxia[1] - zuoshang[1] - 1);\n  cout << mianji << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27758", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1001][1001], s = 0;\n  int(*p)[1001], x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        if ((*(*(p + i) + j + 1) == 0) && (*(*(p + i + 1) + j) == 0)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((*(*(p + i) + j - 1) == 0) && (*(*(p + i - 1) + j) == 0)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27759", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int bian, row, col;\n  int shuzu[500][500];\n  int i, j, m = 0, n = 0;\n  int sum;\n\n  cin >> bian;\n  row = bian;\n  col = bian;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d \", &shuzu[i][j]);\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (shuzu[i][j] == 0) {\n        m += 1;\n        break;\n      }\n    }\n  }\n\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < row; i++) {\n      if (shuzu[i][j] == 0) {\n        n += 1;\n        break;\n      }\n    }\n  }\n\n  sum = (m - 2) * (n - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1005][1005];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= 1004; i++) {\n    for (int j = 0; j <= 1004; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  ;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 != 0)\n      break;\n  }\n  for (int i = n; i >= 1; i--) {\n    for (int j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 != 0)\n      break;\n  }\n  int s;\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, m, a = 0, b, p = 0, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d\", &m);\n      if (m == 0) {\n        a = a + 1;\n        p = p + 1;\n      }\n    }\n    if (p != 0)\n      q = q + 1;\n    p = 0;\n  }\n  b = (q - 2) * (a - 2 * q) / 2;\n  printf(\"%d\\n\", b);\n}\n"}
{"label": "15", "index": "27762", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, k;\n  cin >> n;\n  c = 0;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (j < n)\n        scanf(\" \");\n      if (k == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      b = a;\n    if (a >= 1)\n      c = c + 1;\n  }\n  d = (b - 2) * (c - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "27763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  int length, width, x = 0, y = 0;\n  for (length = j; a[i][length] == 0; length++) {\n    x++;\n  }\n  for (width = i; a[width][j] == 0; width++) {\n    y++;\n  }\n  int p;\n  p = (x - 2) * (y - 2);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "27764", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a == 9)\n    printf(\"9\\n\");\n  else if (a == 6)\n    printf(\"2\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "27765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, k, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (!a && !k) {\n        a = i;\n        b = j;\n      }\n      if (!k) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n}\n"}
{"label": "15", "index": "27766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, a[100][100], b = 0, c, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b++;\n    }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, n, x = 0, k;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n\n  k = 2;\n\n  for (row = k; row < n - k; row++) {\n    for (col = k; col < n - k; col++) {\n      if (sz[row][col] != 0)\n        x++;\n    }\n  }\n\n  cout << x << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27768", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, a[100][100], i, j, i1, i2, j1, j2, k1 = 0, k2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        k1 = 1;\n        break;\n      }\n    if (k1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        k2 = 1;\n        break;\n      }\n    if (k2 == 1)\n      break;\n  }\n  printf(\"%d\", ((i2 - i1 - 1) * (j2 - j1 - 1)));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      cin >> x[i][j];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b2 - b1 + 1) * (a2 - a1 + 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int i, j, k, m, l, p, q;\n  int sum = 0;\n  int a[1000][1000];\n  int line[1000];\n  int dij[1000][1000];\n  int x[1000][1000];\n  for (k = 0; k < 1000; k++) {\n    line[k] = 0;\n    for (m = 0; m < 1000; m++) {\n      dij[k][m] = 0;\n    }\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        line[i] = line[i] + 1;\n        dij[i][j] = j;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    if (line[l] == 2) {\n      for (p = 0; p < n; p++) {\n        if (dij[l][p] > 0) {\n          x[l][p] = dij[l][p];\n          break;\n        }\n      }\n      for (q = 0; q < n; q++) {\n        if (dij[l][q] > x[l][p]) {\n          x[l][q] = dij[l][q];\n          break;\n        }\n      }\n      sum = sum + x[l][q] - x[l][p] - 1;\n    }\n  }\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27771", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, x1, x2, y1, y2;\n  int n, t;\n  int area, statue = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &t);\n      if (t == 0) {\n        if (statue == 0) {\n          x1 = i;\n          y1 = j;\n          statue++;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, starti, startj, endi, endj;\n  int a[10][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  starti = -1;\n  startj = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        starti = i;\n        startj = j;\n        break;\n      }\n    if (starti >= 0)\n      break;\n  }\n  endi = starti;\n  endj = startj;\n  while (a[starti][endj + 1] == 0)\n    endj++;\n  while (a[endi + 1][startj] == 0)\n    endi++;\n  printf(\"%d\", (endi - starti - 1) * (endj - startj - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, x, a, b = 0, c = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        b = b + 1;\n        a = a + 1;\n      }\n    }\n    if (a == 2)\n      c = c + 1;\n  }\n  cout << (((b - 2 * c) - 4) / 2) * c;\n  return 0;\n}\n"}
{"label": "15", "index": "27774", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b = 0, c = 0, d, n, i, j, e;\n  scanf(\"%d\\n\", &n);\n  for (i = 1; i <= n; i++) {\n    if (c > 2)\n      e = c;\n    c = 0;\n\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0) {\n        c = c + 1;\n        continue;\n      }\n      b = b + 1;\n    }\n  }\n  d = ((n * n - b) - 2 * e) / 2 * (e - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "27775", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, d = 0, k, a[1001], s, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        l++;\n    }\n    if (l != 0)\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    int m = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        m++;\n    }\n    if (m != 0)\n      d++;\n    else\n      break;\n  }\n  s = (d - 1) * (l - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, f = 1, a1, a2, b1, b2;\n  int area[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        a1 = i;\n        b1 = j;\n        f = 0;\n      }\n      if (area[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 + 1) * (b2 - b1 + 1) - 2 * (a2 - a1 + 1) - 2 * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27777", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int shumu[1000][1000];\n  int b, n, a, d, e, f;\n  int m;\n  int i;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      cin >> shumu[m][i];\n    }\n  }\n  for (m = 1; m < n - 1; m++) {\n    for (i = 1; i < n - 1; i++) {\n      if (shumu[m][i] == 0) {\n        a = m;\n        d = i;\n      }\n    }\n  }\n  for (m = n - 1; m > 0; m--) {\n    for (i = n - 1; i > 0; i--) {\n      if (shumu[m][i] == 0) {\n        e = m;\n        f = i;\n      }\n    }\n  }\n  b = (e - a + 1) * (f - d + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int n, i, j = 0, p, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[j][i]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    p = 0;\n    j = 0;\n    while (m[j][i] != 0 && j < n) {\n      j++;\n    }\n    j = j + 1;\n    while (m[j][i] != 0 && j < n) {\n      p++;\n      j++;\n    }\n    x = x + p;\n  }\n\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, b, c, d, e, f;\n  char a[1000][1000];\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  c = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != -1) {\n      break;\n    }\n  }\n\n  e = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (e != -1) {\n      break;\n    }\n  }\n\n  b = (e - c - 1) * (f - d - 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "27780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t = 255, x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (x1 < 0) {\n          x1 = i;\n          y1 = j;\n        }\n        if (j > y2) {\n          y2 = j;\n        }\n        x2 = i;\n      }\n    }\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint e[1000][1000];\nint main() {\n  int i, j, n, a, b, c = 0, d = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &e[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (e[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (j = b; j >= 0; j--) {\n    if (e[a][j] == 0) {\n      c++;\n    } else\n      break;\n  }\n  for (i = a; i >= 0; i--) {\n    if (e[i][b] == 0) {\n      d++;\n    } else\n      break;\n  }\n  t = (c - 2) * (d - 2);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, i, j, m = 0, k = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        m = m + 1;\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        k = k + 1;\n      else\n        break;\n    }\n    if (j == n)\n      continue;\n    else {\n      for (j = n - 1; j >= 0; --j) {\n        if (a[i][j] == 255)\n          k = k + 1;\n        else\n          break;\n      }\n    }\n  }\n  s = m - k;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  int sum1 = 0, sum2 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        for (k = 1;; k++) {\n          if (a[i][j + k] == 0)\n            sum1++;\n          else\n            break;\n        }\n        for (k = 1;; k++) {\n          if (a[i + k][j] == 0)\n            sum2++;\n          else\n            break;\n        }\n        break;\n      }\n      if (sum1 != 0)\n        break;\n    }\n  }\n  printf(\"%d\\n\", (sum1 - 1) * (sum2 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, a[100][100], b = 0, c, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        b++;\n    }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n}\n"}
{"label": "15", "index": "27785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int n, i, j, l, k;\n  int sum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    k = 0;\n    sz[i][0] = 255;\n    sz[i][n + 1] = 255;\n    for (j = 1; j <= n; j++) {\n      if ((sz[i][j] - sz[i][j - 1]) * (sz[i][j] - sz[i][j + 1]) > 0) {\n        l = j - l;\n        k++;\n      }\n    }\n    if (k == 2) {\n      sum += (l - 1);\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], h1, h2, l1, l2, c = 0, b = 0;\n  int n, i, j, h, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (a[h][k] == 0) {\n        h1 = h;\n        l1 = k;\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        b = 1;\n        break;\n      }\n    }\n    if (b == 1)\n      break;\n  }\n  printf(\"%d\\n\", (h2 - h1 - 1) * (l2 - l1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int state = 0;\n  int n, t, i, j, m, m1, m2;\n  int leftx, lefty, rightx, righty;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (state == 0) {\n          leftx = i;\n          lefty = j;\n          state = 1;\n        } else {\n          rightx = i;\n          righty = j;\n        }\n      }\n    }\n  }\n  m1 = (rightx - leftx - 1);\n  m2 = (righty - lefty - 1);\n  m = m1 * m2;\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "27788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int sz[100][100], i, j, a = -1, b = -1, c, d, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0 && b >= 0)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  n = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "15", "index": "27789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, t = 0, s = 0, m = 0, l = 0, a, q;\n  cin >> n;\n  t = n, s = n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        if ((m + l) <= (i + j))\n          m = i, l = j;\n        if ((t + s) >= (i + j))\n          t = i, s = j;\n      }\n    }\n  }\n  q = (m - t - 1) * (l - s - 1);\n  cout << q;\n  return 0;\n}\n"}
{"label": "15", "index": "27790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main(int argc, char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int s = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255) {\n        s++;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27791", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], n1, n2, n3, n4, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n1 = i;\n        n2 = j;\n        goto loop;\n      }\nloop:\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (a[i][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n  num = (n3 - n1 - 1) * (n4 - n2 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27792", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, d = 0, k, a[1001], s, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        l++;\n    }\n    if (l != 0)\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    int m = 0;\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d \", &a[k]);\n      if (a[k] == 0)\n        m++;\n    }\n    if (m != 0)\n      d++;\n    else\n      break;\n  }\n  s = (d - 1) * (l - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27793", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, k, x = 0, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k - 1] == 255) && (a[i - 1][k - 1] == 255) &&\n          (a[i - 1][k] == 255)) {\n        x1 = i;\n        y1 = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k + 1] == 255) && (a[i + 1][k + 1] == 255) &&\n          (a[i + 1][k] == 255)) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27794", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  int s[100][100] = {0};\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> s[i][j];\n    }\n  for (i = 1; i <= n; i++) {\n    s[i][0] = 255;\n    s[i][n + 1] = 255;\n  }\n  for (j = 1; j <= n; j++) {\n    s[0][j] = 255;\n    s[n + 1][j] = 255;\n  }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0 && s[i][j + 1] == 0 && s[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (s[i][j] == 0 && s[i][j - 1] == 0 && s[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, a, c = 1, k, t;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n      if (c) {\n        t = i;\n        c = 0;\n      }\n      k = i;\n    }\n  }\n  s = (k % n - t % n - 1) * (k / n - t / n - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27796", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, b, c, x, y;\n  b = c = 0;\n  cin >> n;\n  int sz[n][n];\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      scanf(\"%d\", &sz[j][k]);\n      if (sz[j][k] == 0) {\n        x = j;\n        y = k;\n      }\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      if (sz[j][k] == 0) {\n        b = j;\n        c = k;\n        break;\n      }\n    }\n    if (sz[b][c] == 0)\n      break;\n  }\n  int m;\n  m = (x - b - 1) * (y - c - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, N[1000][1000], i, j, n, m, a = 0, b = 0, s;\n  scanf(\"%d\", &t);\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      scanf(\"%d\", &N[i][j]);\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (N[i][j] == 0) {\n        n = i;\n        m = j;\n      }\n    }\n  }\n  for (i = n, j = m; j < t; j--) {\n    if (N[i][j] == 0)\n      a++;\n    else\n      break;\n  }\n  for (j = m, i = n; i < t; i--) {\n    if (N[i][j] == 0)\n      b++;\n    else\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27798", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, m = 0, k = 0, p;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = m + 1;\n      }\n    }\n    if (m != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        k = k + 1;\n      }\n    }\n    if (k != 0)\n      break;\n  }\n  p = m * k - 2 * m - 2 * k + 4;\n  printf(\"%d\\n\", p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int d1, d2, sum = 0, n, a[100][100], i, j, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0)\n      break;\n  }\n  d1 = x2 - x1 + 1;\n  d2 = y2 - y1 + 1;\n  sum = (d1 - 2) * (d2 - 2);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "27800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1500][1500], inside = 0, total = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if ((s[i][j] == 0) && (s[i][j + 1] == 0))\n        do {\n          j++;\n        } while ((j < n) && (s[i][j] == 0));\n      else if ((s[i][j] == 0) && (s[i][j + 1] != 0)) {\n        do {\n          j++;\n          if (s[i][j] > 0) {\n            inside++;\n          }\n        } while ((j < n) && (s[i][j] != 0));\n      }\n    }\n  cout << inside << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[100][100], i, j, a, b, c, d, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i < n && j < n && s[i][j] == 0 && s[i + 1][j] == 0 &&\n          s[i][j + 1] == 0) \n      {\n        a = i;\n        b = j;\n      }\n      if (i > 1 && j > 1 && s[i][j] == 0 && s[i - 1][j] == 0 &&\n          s[i][j - 1] == 0) \n      {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  num = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (j == 0 && m[i][j] == 0)\n        a = j;\n      else if (j != 0 && m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27803", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, is1[4000], is2[4000], s, n;\n  int k = 0;\n  cin >> n;\n  for (int i = 0; i < n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n\n      is1[k] = i / n;\n      is2[k++] = i % n;\n    }\n  }\n  cout << (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, n1, n2, n3, n4, sum;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j - 1] != 0 && a[i][j] == 0 && a[i][j + 1] == 0 &&\n          a[i + 1][j] == 0 && a[i - 1][j] != 0) {\n        n1 = i;\n        n2 = j;\n      }\n      if (a[i][j - 1] == 0 && a[i][j] == 0 && a[i][j + 1] != 0 &&\n          a[i + 1][j] != 0 && a[i - 1][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n    }\n  }\n  sum =\n      (n3 - n1 + 1) * (n4 - n2 + 1) - 2 * (n3 - n1 + 1) - 2 * (n4 - n2 + 1 - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * (m - i) / 2;\n  cout << \"\\n\" << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int w[1000][1000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &w[i][j]);\n    }\n    scanf(\"%d\\n\", &w[i][n - 1]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    scanf(\"%d \", &w[n - 1][j]);\n  }\n  scanf(\"%d\", &w[n - 1][n - 1]);\n  for (i = 2; i < n - 2; i++) {\n    for (j = 2; j < n - 2; j++) {\n      if (w[i][j] == 255)\n        s++;\n    }\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27807", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[n][n];\n  int i, j;\n  int x1, y1, x2, y2;\n  int num;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j]) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j]) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27808", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[1000][1000];\n  int a, b, c, d, g;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      cin >> sz[i][k];\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int k = 0; k < n; k++) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  for (int i = n - 1; i >= 0; i--) {\n    for (int k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        c = i;\n        d = k;\n      }\n    }\n  }\n  g = (a - c - 1) * (b - d - 1);\n  printf(\"%d\", g);\n  return 0;\n}\n"}
{"label": "15", "index": "27809", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x[10][10];\n  int a;\n  int i, j;\n  int a1, a2, b1, b2;\n  int s;\n  a1 = a2 = b1 = b2 = 0;\n  cin >> a;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++)\n      cin >> x[i][j];\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = a; j >= 1; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int c, d;\n  c = a1 - a2 - 1;\n  d = b1 - b2 - 1;\n  s = c * d;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x1, y1, x2, y2;\n  int n, i, j, t, area;\n  int status = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (status == 0) {\n          x1 = i;\n          y1 = j;\n          status = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, q = 0, r = 0, l = 0, ll = 0;\n  scanf(\"%d\", &n);\n  int s;\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0) {\n      q++;\n      if (ll == 0)\n        l = 1;\n    }\n    if (p == 0 && l == 1)\n      r++;\n\n    if (l == 1 && p != 0) {\n      l = 2;\n      ll = 1;\n    }\n  }\n  if (r > n)\n    r = n;\n  s = (q - 2 * r) * (r - 2) / 2;\n\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int x1, y1, x2, y2;\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      cin >> sz[row][col];\n    }\n  }\n  for (int row = 1; row <= n; row++) {\n    for (int col = 1; col <= n; col++) {\n      if (sz[row][col] == 0) {\n        x1 = row;\n        y1 = col;\n      }\n    }\n  }\n  for (int row = n; row > 0; row--) {\n    for (int col = n; col > 0; col--) {\n      if (sz[row][col] == 0) {\n        x2 = row;\n        y2 = col;\n      }\n    }\n  }\n  int s;\n  s = (x2 - x1 + 1) * (y2 - y1 + 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int row, col, n, s = 0;\n  int sz[1000][1000];\n  int star1, star2, end1, end2;\n  int f = -1;\n  scanf(\"%d\", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz[row][col]));\n  }\n  for (row = 1; row < n - 1; row++) {\n    for (col = 1; col < n - 1; col++) {\n      if (sz[row][col] == 0 && f == -1) {\n        star1 = row;\n        star2 = col;\n        f = 1;\n      }\n      if (sz[row][col] == 0) {\n        end1 = row;\n        end2 = col;\n      }\n    }\n  }\n  s = (end1 - star1 - 1) * (end2 - star2 - 1);\n\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27814", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, i, j, b, t, q, sum;\n  cin >> n;\n  for (i = 0, t = 0; i <= (n - 1); i++) {\n    for (j = 0, sum = 0; j <= (n - 1); j++) {\n      scanf(\"%d\", &a[j]);\n      sum = sum + a[j];\n    }\n    if (sum == (n * 255))\n      continue;\n    b = (n * 255 - sum) / 255;\n    t = t + 1;\n  }\n  q = (t - 2) * (b - 2);\n  printf(\"%d\", q);\n}\n"}
{"label": "15", "index": "27815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, row, col, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((sz[row][col] == 0) && (sz[row][col - 1] != 0) &&\n          (sz[row - 1][col] != 0)) {\n        a = row;\n        b = col;\n      }\n      if ((sz[row][col] == 0) && (sz[row][col + 1] != 0) &&\n          (sz[row + 1][col] != 0)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  if ((c - a - 1 > 0) && (d - b - 1 > 0)) {\n    int s = (c - a - 1) * (d - b - 1);\n    printf(\"%d\", s);\n  } else {\n    int s = 0;\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[1000][1000];\n  int i, j, n, a = 0, s1, s2, e1, e2, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n      if (sz[i][j] == 0 && a == 0) {\n        s1 = i;\n        s2 = j;\n        a = 1;\n      }\n      if (sz[i][j] == 0) {\n        e1 = i;\n        e2 = j;\n      }\n    }\n  }\n  sum = (e1 - s1 - 1) * (e2 - s2 - 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, a = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++)\n\n  {\n    scanf(\"%d\", &m);\n    if (m == 0) {\n      a = a + 1;\n    }\n  }\n\n  t = (a + 4) / 4;\n  cout << (t - 2) * (t - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, temp, x1, x2, y1, y2;\n  static int a[1002][1002];\n  int i, j;\n\n  \n  \n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &temp);\n      a[i][j] = (temp == 0) ? 1 : 0;\n    }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 1) {\n        if ((a[i][j + 1] == 1) && (a[i + 1][j] == 1)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((a[i][j - 1] == 1) && (a[i - 1][j] == 1)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  \n  return 0;\n}\n"}
{"label": "15", "index": "27819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, n1, n2, n3, n4, sum;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j - 1] != 0 && a[i][j] == 0 && a[i][j + 1] == 0 &&\n          a[i + 1][j] == 0 && a[i - 1][j] != 0) {\n        n1 = i;\n        n2 = j;\n      }\n      if (a[i][j - 1] == 0 && a[i][j] == 0 && a[i][j + 1] != 0 &&\n          a[i + 1][j] != 0 && a[i - 1][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n    }\n  }\n  sum =\n      (n3 - n1 + 1) * (n4 - n2 + 1) - 2 * (n3 - n1 + 1) - 2 * (n4 - n2 + 1 - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27820", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, x = 2, y = 2;\n  cin >> n;\n  int a[1000][1000], i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0) {\n        x++;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0) {\n        y++;\n      }\n    }\n  }\n  int s;\n  s = (x / 2 - 2) * (y / 2 - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j;\n  int point[1000][1000];\n  int n, s, sum, result;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &point[i][j]);\n  }\n  for (i = 0; i < n;) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n    if (a != 0)\n      break;\n    else\n      i++;\n  }\n  for (j = 0; j < n;) {\n    for (i = 0; i < n; i++) {\n      if (point[i][j] == 0)\n        b = b + 1;\n    }\n    if (b != 0)\n      break;\n    else\n      j++;\n  }\n  sum = 2 * (a + b - 2);\n  s = a * b;\n  result = s - sum;\n  cout << result << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "27822", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int tumor[100][100];\n  int n, i, j, a, b, sum;\n  a = 0;\n  b = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> tumor[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (tumor[i][j] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n    else if (a == 0)\n      continue;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (tumor[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n    else\n      continue;\n  }\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, m = 1, x[100], y[100], location[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &location[i][j]);\n      if (location[i][j] == 0) {\n        x[k] = j;\n        k++;\n        y[m] = i;\n        m++;\n      }\n    }\n  }\n  printf(\"%d\\n\", (y[m - 1] - y[1] - 1) * (x[k - 1] - x[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, first, fstn, counter1 = 0, counter2 = 0;\n  int sum = 0;\n  int c[100][100] = {0};\n  int s[100] = {0};\n  int t[100] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int tum1 = 0;\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      sum += c[i][j];\n    }\n    tum1 = n - sum / 255;\n    s[i] = tum1;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (s[i] != 0) {\n      first = i + 1;\n      fstn = s[i];\n      break;\n    }\n  }\n  for (i = first; s[i] != fstn; i++) {\n    counter1++;\n  }\n  for (j = 0; j < n; j++) {\n    int tum2;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      sum += c[i][j];\n    }\n    tum2 = n - sum / 255;\n    t[j] = tum2;\n  }\n  for (j = 0; j < n; j++) {\n    if (t[j] != 0) {\n      first = j + 1;\n      fstn = t[j];\n      break;\n    }\n  }\n  for (j = first; t[j] != fstn; j++) {\n    counter2++;\n  }\n\n  printf(\"%d\", counter1 * counter2);\n}\n"}
{"label": "15", "index": "27825", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[1000][1000], i, j, a, b, a1, b1, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &p[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (p[a][b] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (p[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (p[a1][b1] == 0) {\n      break;\n    }\n  }\n  s = (a1 - a - 1) * (b1 - b - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, an[500][500], a, b, c, d, e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (an[i][j] == 0) {\n        c = i;\n        d = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  int s;\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1001][1001];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  int sx, sy, ex, ey, flag = 0;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0 && flag == 0) {\n        sx = i;\n        sy = j;\n        flag = 1;\n      } else if (a[i][j] == 0 && flag == 1) {\n        ex = i;\n        ey = j;\n      }\n    }\n  }\n  sx += 1;\n  sy += 1;\n  ex -= 1;\n  ey -= 1;\n  int sum = (ex - sx + 1) * (ey - sy + 1);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27828", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, s, a, b, c, d;\n  s = 0;\n  int shuzu[100][100] = {0};\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> shuzu[i][j];\n    }\n  }\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (shuzu[i][j] == 255) {\n        for (a = 1; i - a >= 0; a++) {\n          if (shuzu[i - a][j] == 0) {\n            for (b = 1; i + b < n; b++) {\n              if (shuzu[i + b][j] == 0) {\n                for (c = 1; j - c >= 0; c++) {\n                  if (shuzu[i][j - c] == 0) {\n                    for (d = 1; j + d < n; d++) {\n                      if (shuzu[i][j + d] == 0) {\n                        s++;\n                        break;\n                      }\n                    }\n                    break;\n                  }\n                }\n                break;\n              }\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, leftrow, leftcolumn, rightrow, rightcolumn, s;\n  int a[1000][1000];\n  cin >> n;\n  for (i = 0; i < n + 2; i++) {\n    for (j = 0; j < n + 2; j++) {\n      a[i][j] = 255;\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n + 1; i++) {\n    for (j = 1; j < n + 1; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        leftrow = i;\n        leftcolumn = j;\n      }\n      if (a[i][j] == 0 && a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        rightrow = i;\n        rightcolumn = j;\n      }\n    }\n  }\n  s = (rightcolumn - leftcolumn - 1) * (rightrow - leftrow - 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27830", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  \n\n  \n  int m, n;\n\n  \n  int i, j, k;\n\n  \n  \n  \n\n  \n  \n  \n  \n\n  \n  int r;\n  \n  \n  \n  \n\n  \n  int ni, nj, nk, nm, nn;\n  \n  \n  \n\n  \n\n  \n  \n  \n  nk = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &ni);\n    if (ni == 0) {\n      nk += 1;\n    }\n    if (ni == 255 && nk != 0 && r == 0) {\n      r = nk;\n    }\n  }\n  r = (nk - 2 * r) / 2 * (r - 2);\n  \n  \n  \n\n  \n  \n  \n\n  \n  \n  printf(\"%d\", r);\n  \n  return 0;\n}\n"}
{"label": "15", "index": "27831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int a[n][n];\n  int i, j;\n  int e, b, c, d, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        e = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, cur, s = 0, sq, starow, stacol, endrow, endcol;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &cur);\n    if (s == 0 && cur == 0) {\n      s = 1;\n      starow = (i - 1) / n;\n      stacol = i % n;\n    } else if (s == 1 && cur == 0) {\n      endrow = (i - 1) / n;\n      endcol = i % n;\n    }\n  }\n  sq = (endrow - starow - 1) * (endcol - stacol - 1);\n  cout << sq << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "27833", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[1000][1000];\nint main() {\n  int n, i, k, area, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d \", &s[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        a = i;\n        b = k;\n        break;\n      }\n    }\n    if (k == n) {\n      if (s[i][k - 1] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (s[i][k] == 0) {\n        c = i;\n        d = k;\n        break;\n      }\n    }\n    if (k == -1) {\n      if (s[i][0] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  area = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c = 0, q = 0, t;\n  int m[1000] = {0};\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        m[i]++;\n        c++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (m[i] != 0)\n      q++;\n  }\n  printf(\"%d\", (q - 2) * (c - 2 * q) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27835", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, b, c, d, e, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] != 0) && (a[i][j + 1] == 0)) {\n        b = i;\n        c = j + 1;\n      }\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0)) {\n        d = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if ((a[i][j] == 0) && (a[i + 1][j] != 0)) {\n        e = i;\n        j = n;\n      }\n    }\n  }\n  s = (d - c + 1) * (e - b + 1) - (4 + (d - c - 1) * 2 + (e - b - 1) * 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, sum, array[30][30];\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  i = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (array[i][j] == 0 && array[i][j - 1] != 0 && array[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && array[i][j + 1] != 0 && array[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  sum = (c - a - 1) * (d - b - 1);\n  cout << sum;\n}\n"}
{"label": "15", "index": "27837", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int s[100][100], n, i, j, result, a = -1, b = -1, c = -1, d = -1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c >= 0)\n      break;\n  }\n  result = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "27838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, temp, x1, x2, y1, y2;\n  static int a[1002][1002];\n  int i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &temp);\n      a[i][j] = (temp == 0) ? 1 : 0;\n    }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 1) {\n        if ((a[i][j + 1] == 1) && (a[i + 1][j] == 1)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((a[i][j - 1] == 1) && (a[i - 1][j] == 1)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, cur, s = 0, sq, starow, stacol, endrow, endcol;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &cur);\n    if (s == 0 && cur == 0) {\n      s = 1;\n      starow = (i - 1) / n;\n      stacol = i % n;\n    } else if (s == 1 && cur == 0) {\n      endrow = (i - 1) / n;\n      endcol = i % n;\n    }\n  }\n  sq = (endrow - starow - 1) * (endcol - stacol - 1);\n  printf(\"%d \", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "27840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n, i, j, start_row, start_col, end_row, end_col, row, col, value, area;\n\n  scanf(\"%d \", &n);\n  start_row = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%i\", &value);\n      if (!value) {\n        row = i;\n        col = j;\n        if (start_row == 0)\n          start_row = row, start_col = col;\n      }\n    }\n  end_row = row, end_col = col;\n  area = (end_row - start_row - 1) * (end_col - start_col - 1);\n  cout << area;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27841", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s, x, i, j, n, a1, a2, b1, b2;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i < (n + 1); i++) {\n    for (j = 1; j < (n + 1); j++) {\n      scanf(\"%d\", &x);\n      if ((x == 0) && (a1 == 0)) {\n        a1 = i;\n        a2 = j;\n      }\n      if (x == 0) {\n        b1 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b1 - a1 - 1) * (b2 - a2 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  int a = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * (n * n));\n  int k;\n\n  for (k = 0; k < (n * n); k++) {\n    scanf(\"%d\", &(sz[k]));\n    if (sz[k] == 0) {\n      i++;\n    }\n  }\n  int cond = 0;\n  for (k = 0; k < (n * n); k++) {\n    if (sz[k] == 0 && cond == 0) {\n      a++;\n      if (sz[k + 1] == 255) {\n        cond = 1;\n      } else {\n        continue;\n      }\n    }\n  }\n  int j;\n  j = (i - (a)*2) / 2 + 2;\n  int s;\n  s = (j - 2) * (a - 2);\n  cout << s << \"\\n\";\n  free(sz);\n  return 0;\n}\n"}
{"label": "15", "index": "27844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0;\n  int k[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &k[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k[i][j] == 0) {\n        while (k[i][j + 1] == 255) {\n          j++;\n          num++;\n        }\n\n        if (k[i][j + 1] == 0)\n          break;\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, flag = 0, start[2], end[2], s;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      int p;\n      cin >> p;\n      if (p == 0 && flag == 0) {\n        start[0] = i;\n        start[1] = j;\n        flag = 1;\n      }\n      if (p == 0 && flag == 1) {\n        end[0] = i;\n        end[1] = j;\n      }\n    }\n  s = (end[0] - start[0] - 1) * (end[1] - start[1] - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a1, a2, b1, b2, s;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> sz[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] != 0 && sz[i][j + 1] == 0) {\n        a1 = i;\n        b1 = j + 1;\n      }\n      if (sz[i][j] == 0 && sz[i][j + 1] != 0) {\n        b2 = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0) {\n        a2 = i;\n        j = n;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27847", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, c, ans = 0, flag = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> c;\n      if (!c) {\n        if (flag) {\n          ans = ans + j - flag - 1;\n          flag = 0;\n        } else\n          flag = j;\n      }\n    }\n    flag = 0;\n  }\n  printf(\"%d\", ans);\n}\n"}
{"label": "15", "index": "27848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a1, a2, b1, b2;\n  int i, j, n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  int tag = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && tag == 0) {\n        a1 = i;\n        b1 = j;\n        tag = 1;\n      }\n    }\n  }\n  int a, b;\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  int s;\n  s = a * b;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27849", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], i, j, x1, x2, y1, y2, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27850", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j;\n  int point[1000][1000];\n  int n, s, sum, result;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n;) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n    if (a != 0)\n      break;\n    else\n      i++;\n  }\n  for (j = 0; j < n;) {\n    for (i = 0; i < n; i++) {\n      if (point[i][j] == 0) {\n        b = b + 1;\n      }\n    }\n    if (b != 0)\n      break;\n    else\n      j++;\n  }\n  sum = 2 * (a + b - 2);\n  s = a * b;\n  result = s - sum;\n  printf(\"%d \", result);\n  return 0;\n}\n"}
{"label": "15", "index": "27851", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int dian[10][10];\n  int i, j, s, n, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> dian[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (dian[i][j] == 0 && dian[i + 1][j] == 0 && dian[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        break;\n      } else\n        continue;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (dian[i][j] == 0 && dian[i - 1][j] == 0 && dian[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        break;\n      } else\n        continue;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1000][1000], x1, y1, x2, y2, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i + 2][j] == 0 &&\n          s[i][j + 1] == 0 && s[i + 1][j + 1] == 255) {\n        x1 = i;\n        y1 = j;\n      }\n    }\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i - 2][j] == 0 &&\n          s[i][j - 1] == 0 && s[i - 1][j - 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, q[1000][1000], a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> q[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (q[i][j] == 0) {\n        a = i + 1;\n        b = j + 1;\n        goto tsu;\n      }\n    }\n  }\ntsu:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (q[i][j] == 0) {\n        c = i - 1;\n        d = j - 1;\n        goto pku;\n      }\n    }\n  }\npku:\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, a[1000][1000], row, col, m, p, q, b[1000], c[1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n      if (a[row][col] == 0) {\n        b[i] = row;\n        c[i] = col;\n        i++;\n      }\n    }\n  }\n  q = i - 1;\n  m = b[q] - b[0] - 1;\n  p = c[q] - c[0] - 1;\n  printf(\"%d\", m * p);\n  return 0;\n}\n"}
{"label": "15", "index": "27855", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int val[1000][1000];\n  int i, j, posr, posc, n, r, c, flag = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &val[i][j]);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (val[i][j] == 0 && flag == 0) {\n        flag = 1;\n        posr = i;\n        posc = j;\n      }\n\n  i = posr;\n  while (val[i++][posc] == 0)\n    ;\n\n  r = i - posr - 3;\n\n  for (j = posc; val[posr][j] == 0; j++)\n    ;\n  c = j - posc - 2;\n\n  printf(\"%d\", r * c);\n\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "15", "index": "27856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  cout << s;\n}\n"}
{"label": "15", "index": "27857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  \n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      \n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  \n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      \n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  \n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, r, i, j, s, k, n;\n  int a[10][10];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j] == 0) {\n        k = i;\n        t = 0, r = 0;\n\n        while (a[i][j] != 255) {\n          i++;\n          t++;\n        }\n        i = k;\n        while (a[i][j] != 255) {\n          j++;\n          r++;\n        }\n        i = n + 1;\n        j = n + 1;\n      }\n    }\n  s = (r - 2) * (t - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, p, q = 0, r = 0, l = 0, ll = 0;\n  scanf(\"%d\", &n);\n  int s;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      q++;\n      if (ll == 0)\n        l = 1;\n    }\n    if (p == 0 && l == 1) {\n      r++;\n    }\n    if (l == 1 && p != 0) {\n      l = 2;\n      ll = 1;\n    }\n  }\n  if (r > n)\n    r = n;\n  s = (q - 2 * r) * (r - 2) / 2;\n\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s, x, i, j, n, a1, a2, b1, b2;\n  a1 = 0;\n  a2 = 0;\n  b1 = 0;\n  b2 = 0;\n  cin >> n;\n  for (i = 1; i < (n + 1); i++) {\n    for (j = 1; j < (n + 1); j++) {\n      scanf(\"%d\", &x);\n      if ((x == 0) && (a1 == 0)) {\n        a1 = i;\n        a2 = j;\n      }\n      if (x == 0) {\n        b1 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b1 - a1 - 1) * (b2 - a2 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint abs(int p) {\n  if (p > 0)\n    return p;\n  else {\n    return (-p);\n  }\n}\nint main() {\n  long first, last, i, j;\n  int n, a, check = 0, sc, sr, ec, er;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &a);\n    if ((a == 0) && (check == 0)) {\n      first = i;\n      check = 1;\n    }\n    if (a == 0)\n      last = i;\n  }\n  sc = (first / n);\n  sr = (first % n);\n  ec = (last / n);\n  er = (last % n);\n  printf(\"%d\", (abs(sc - ec) - 1) * (abs(sr - er) - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[1100][1100];\n  cin >> n;\n  int ans = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        continue;\n      } else {\n        int f = 0;\n        for (int k = i + 1; k <= n; k++) {\n          if (a[k][j] == 0 && a[k][j + 1] == 0)\n            f++;\n        }\n        if (f % 2 == 1)\n          ans++;\n      }\n    }\n  }\n  cout << ans;\n  return 0;\n}\n"}
{"label": "15", "index": "27863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, left_i = -1, left_j, right_i, right_j, num, temp;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        num++;\n        if (num == 1 && left_i < 0) {\n          left_i = i;\n          left_j = j;\n        } else {\n          right_i = i;\n          right_j = j;\n        }\n      }\n    }\n  }\n\n  cout << (right_i - left_i - 1) * (right_j - left_i - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "27864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[1000][1000];\n  int i, j, sum;\n  int c = 0, k = 0, r = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255) {\n        c = i;\n        k = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        r = i;\n        t = j;\n      }\n    }\n  }\n\n  sum = (r - c - 1) * (t - k - 1);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27865", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, c, x = 0, d, m, a[500][500];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        k = i;\n        m = j;\n        continue;\n      }\n    }\n  }\n  c = 0;\n  d = 0;\n  for (i = k; i > 0; i--) {\n    if (a[i][m] == 0)\n      c = c + 1;\n    else\n      break;\n  }\n  for (j = m; j > 0; j--) {\n    if (a[k][j] == 0)\n      d = d + 1;\n    else\n      break;\n  }\n  for (i = k - 1; i >= (k - c + 2); i--) {\n    for (j = m - 1; j >= (m - d + 2); j--) {\n      if (a[i][j] == 255)\n        x = x + 1;\n      else if (a[i][j] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", x);\n}\n"}
{"label": "15", "index": "27866", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[1000][1000];\n\nint main() {\n  int x1 = 1000, y1 = 1000, x2, y2, i, j, n;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> array_1[i][j];\n\n      if (array_1[i][j] == 0) {\n        x1 = (i < x1) ? i : x1;\n        y1 = (j < y1) ? j : y1;\n        x2 = i;\n        y2 = j;\n      }\n    }\n\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, pi = 0, pj, r = 0, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (pj = 0, j = 0; j < n; j++) {\n      cin >> a;\n      if (a == 0) {\n        pj++;\n        r++;\n      }\n    }\n    if (pj != 0) {\n      pi++;\n    }\n  }\n  cout << (r / 2 - pi) * (pi - 2);\n}\n"}
{"label": "15", "index": "27868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, f = 1, a1, a2, b1, b2;\n  int area[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        a1 = i;\n        b1 = j;\n        f = 0;\n      }\n      if (area[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 + 1) * (b2 - b1 + 1) - 2 * (a2 - a1 + 1) - 2 * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[1000][1000], num, i, j, p[200], k = 0;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  int w = 0;\n  for (i = 0; i < (num - 1); i++) {\n    for (j = 0; j < (num - 1); j++) {\n      if (n[i][j] == 0 && n[i][j + 1] == 0)\n        break;\n      else if (n[i][j] == 0 && n[i][j + 1] != 0) {\n        p[w] = j;\n        w++;\n      }\n    }\n  }\n  for (i = 0; i < w - 1; i = i + 2) {\n    k = k + (p[i + 1] - p[i] - 1);\n  }\n  cout << k;\n}\n"}
{"label": "15", "index": "27870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a1, a2, b1, b2, s;\n  int sz[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] != 0 && sz[i][j + 1] == 0) {\n        a1 = i;\n        b1 = j + 1;\n      }\n      if (sz[i][j] == 0 && sz[i][j + 1] != 0) {\n        b2 = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0) {\n        a2 = i;\n        j = n;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int k, l, p, q, a1 = 0, a2 = 0, b1, b2;\n  int s;\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++) {\n      if (a[k][l] == 0) {\n        a1 = k;\n        b1 = l;\n        break;\n      }\n    }\n    if (a1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n        break;\n      }\n    }\n    if (a2 != 0)\n      break;\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27872", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, x, y = 0, i, j, a[1000] = {0}, m = 0, n = 0;\n  scanf(\"%d \", &N);\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &x);\n      a[i] = a[i] + x;\n    }\n    if (a[i] == 255 * (N - 2))\n      m = m + 1;\n    else if (a[i] < 255 * (N - 2))\n      n = N - a[i] / 255;\n  }\n  y = (n - 2) * m;\n  printf(\"%d\", y);\n}\n"}
{"label": "15", "index": "27873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int i, j, k, m, l, p, q;\n  int sum = 0;\n  int a[1000][1000];\n  int line[1000];\n  int dij[1000][1000];\n  int x[1000][1000];\n  for (k = 0; k < 1000; k++) {\n    line[k] = 0;\n    for (m = 0; m < 1000; m++) {\n      dij[k][m] = 0;\n    }\n  }\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        line[i] = line[i] + 1;\n        dij[i][j] = j;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    if (line[l] == 2) {\n      for (p = 0; p < n; p++) {\n        if (dij[l][p] > 0) {\n          x[l][p] = dij[l][p];\n          break;\n        }\n      }\n      for (q = 0; q < n; q++) {\n        if (dij[l][q] > x[l][p]) {\n          x[l][q] = dij[l][q];\n          break;\n        }\n      }\n      sum = sum + x[l][q] - x[l][p] - 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27874", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, c, ans = 0, flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &c);\n      if (!c) {\n        if (flag) {\n          ans = ans + j - flag - 1;\n          flag = 0;\n        } else\n          flag = j;\n      }\n    }\n    flag = 0;\n  }\n  printf(\"%d\", ans);\n}\n"}
{"label": "15", "index": "27875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, aa1, bb1, aa2, bb2, a[99][99];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        aa1 = i;\n        bb1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        aa2 = i;\n        bb2 = j;\n      }\n    }\n  }\n  cout << (aa2 - aa1 - 1) * (bb2 - bb1 - 1);\n}\n"}
{"label": "15", "index": "27876", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int *data;\n  data = (int *)malloc(sizeof(int) * n * n);\n  int i, j, k;\n  int p = 0, q = 0, t = 0, s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &data[i * n + j]);\n    }\n    for (k = 0; k < n; k++) {\n      if (data[i * n + k] == 0) {\n        p = i + 1;\n        q = k + 1;\n      }\n    }\n  }\n  int u, v;\n  for (u = n - 1; u >= 0; u--) {\n    for (v = n - 1; v >= 0; v--) {\n      if (data[u * n + v] == 0) {\n        t = u + 1;\n        s = v + 1;\n      }\n    }\n  }\n  int x, y, z;\n  y = q - s - 1;\n  x = p - t - 1;\n  z = x * y;\n  cout << z << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27877", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a1, a2, b1, b2, m;\n  scanf(\"%d\", &n);\n  int num[1000][1000];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &num[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (num[i][j] == 0) {\n        a1 = i;\n        a2 = j;\n      }\n  for (i = n - 1; i > 0; i--)\n    for (j = n - 1; j > 0; j--)\n      if (num[i][j] == 0) {\n        b1 = i;\n        b2 = j;\n      }\n  m = (a1 - b1 - 1) * (a2 - b2 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int point[1000], i, p, sta, end, total, n, s;\n  scanf(\"%d\", &n);\n  s = 0;\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &point[i]);\n    i = 0;\n    do\n      i++;\n    while ((point[i] == 255) && (i < n));\n    sta = i;\n    i = n;\n    do {\n      i--;\n    } while ((point[i] == 255) && (i > 0));\n    end = i;\n    for (i = sta; i <= end; i++)\n      if (point[i] == 255)\n        s++;\n  }\n  cout << s;\n}\n"}
{"label": "15", "index": "27879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, a[1000][1000], row, col, m, p, q, b[1000], c[1000];\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n      if (a[row][col] == 0) {\n        b[i] = row;\n        c[i] = col;\n        i++;\n      }\n    }\n  }\n  q = i - 1;\n  m = b[q] - b[0] - 1;\n  p = c[q] - c[0] - 1;\n  cout << m * p;\n  return 0;\n}\n"}
{"label": "15", "index": "27880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, k, r1, r2, c1, c2, x = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] == 0) && x == 0) {\n        r1 = i + 1;\n        c1 = j + 1;\n        x = 1;\n      }\n      if ((a[i][j] == 0)) {\n        r2 = i - 1;\n        c2 = j - 1;\n      }\n    }\n  }\n  printf(\"%d\\n\", (r2 - r1 + 1) * (c2 - c1 + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x[1000][1000], s = 0, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  n = n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0 && x[i - 1][j] == 255 && x[i][j - 1] == 255 &&\n          x[i + 1][j] == 0 && x[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      } else if (x[i][j] == 0 && x[i - 1][j] == 0 && x[i][j - 1] == 0 &&\n                 x[i + 1][j] == 255 && x[i][j + 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27882", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a, x1, y1, x2, y2;\n  scanf(\"%d \", &n);\n  x1 = n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n\n      if (a == 0 && j < x1) {\n        x1 = j;\n        y1 = i;\n      }\n      if (a == 0) {\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n\n  int area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n%d\\n%d\", area, x2 - x1 - 1, y2 - y1 - 1);\n\n  return (0);\n}\n"}
{"label": "15", "index": "27883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[1000][1000], m[2], n[2], S, f;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  f = -1;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == 0 && f == -1) {\n        m[0] = i + 1;\n        n[0] = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        m[1] = i - 1;\n        n[1] = j - 1;\n      }\n    }\n  }\n  S = (m[1] - m[0] + 1) * (n[1] - n[0] + 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100000], b = 0, c, f = 0, d, e, i, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &sz[i]);\n    if (sz[i] == 0) {\n      b += 1;\n      if (b == 1)\n        d = i;\n    }\n  }\n  for (i = 0; i < n * n; i++) {\n    if (sz[i] == 0) {\n      f += 1;\n      if (f == b)\n        e = i;\n    }\n  }\n  row1 = d / n;\n  col1 = d % n;\n  row2 = e / n;\n  col2 = e % n;\n  c = (col2 - col1 + 1) * (row2 - row1 + 1) - b;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27885", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, ai, aj, bi, bj, ans, x;\n\n  cin >> n;\n  ai = n;\n  aj = n;\n  bi = -1;\n  bj = -1;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        if (i < ai)\n          ai = i;\n        if (i > bi)\n          bi = i;\n        if (j < aj)\n          aj = j;\n        if (j > bj)\n          bj = j;\n      }\n    }\n\n  ans = (bi - ai - 1) * (bj - aj - 1);\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, hang, hang2, hang3, lie, lie2, lie3, squ;\n  squ = 0;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  for (hang = 0; hang < n; hang++) {\n    for (lie = 0; lie < n; lie++)\n      scanf(\"%d\", &a[hang][lie]);\n  }\n  for (hang = 1; hang < n - 1; hang++) {\n    for (lie = 1; lie < n - 1; lie++) {\n      for (hang2 = hang; a[hang][lie] == 255 && hang2 >= 0; hang2--) {\n        if (a[hang2][lie] == 0) {\n          for (hang3 = hang; hang3 < n; hang3++) {\n            if (a[hang3][lie] == 0) {\n              for (lie2 = lie; lie2 >= 0; lie2--) {\n                if (a[hang][lie2] == 0) {\n                  for (lie3 = lie; lie3 <= n; lie3++) {\n                    if (a[hang][lie3] == 0) {\n                      squ += 1;\n                      break;\n                    }\n                  }\n                  break;\n                }\n              }\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n  }\n  cout << squ;\n  return 0;\n}\n"}
{"label": "15", "index": "27887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int A[1000][1000];\n  int n, a, b, c, d;\n  int i = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &A[i][j]);\n      if (A[i][j] == 0 && A[i][j - 1] != 0 && A[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  cout << (c - a - 1) * (d - b - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "27888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int board[500][500], n, i, j, r1, c1, r2, c2;\n  int *p = *board;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(p + i * 500 + j);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(p + i * 500 + j) == 0) {\n        r1 = i;\n        c1 = j;\n        i = 9999;\n        break;\n      }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      if (*(p + i * 500 + j) == 0) {\n        r2 = i;\n        c2 = j;\n        i = -1;\n        break;\n      }\n  cout << (r2 - r1 - 1) * (c2 - c1 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n;\n  int row, col;\n  int a, b, c, d;\n  int x, y;\n  int num;\n  int e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0) {\n        a = row;\n        b = col;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (sz[row][col] == 0) {\n        c = row;\n        d = col;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  x = c - a - 1;\n  y = d - b - 1;\n  num = x * y;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27890", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n    if (x == 0)\n      break;\n  }\n\n  for (j = j1 + 1; j < n; j++)\n    scanf(\"%d\", &x);\n\n  for (i = i1 + 1; i < n; i++) {\n    int y = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &x);\n      if (x == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz1[1000];\n  int h, j = 0, k = 0, i, n, mj, a = -1, b = -1, c = 0, d;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (a < 0) {\n        c++;\n      }\n      scanf(\"%d\", &sz1[i]);\n      if (sz1[i] == 0) {\n        a = i;\n        b = h;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sz1[i] = 0;\n    }\n  }\n  d = c % n;\n  mj = (b - d) * (a - d);\n  printf(\"%d\\n\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "27892", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int photo[300][300] = {1};\n  int n;\n  int i, j;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      int t;\n      cin >> t;\n      if (t == 255)\n        t = 1;\n      photo[i][j] = t;\n    }\n  }\n  int found = 0;\n  int Lx, Ly, Bx, By;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (photo[i][j] == 0) {\n        Lx = i;\n        Ly = j;\n        found = 1;\n        break;\n      }\n    }\n    if (found)\n      break;\n  }\n  found = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (photo[i][j] == 0) {\n        Bx = i;\n        By = j;\n        found = 1;\n        break;\n      }\n      if (found)\n        break;\n    }\n  }\n  int w = Bx - Lx - 1;\n  int h = By - Ly - 1;\n  cout << w * h << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint sz[1000][1000];\n\nint main() {\n  int i = 0, n, s, rrr[5000], ccc[5000];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n      if (sz[row][col] == 0) {\n        rrr[i] = row;\n        ccc[i] = col;\n        i++;\n      }\n    }\n  }\n  s = (rrr[i - 1] - rrr[0] - 1) * (ccc[i - 1] - ccc[0] - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> sz[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (sz[i][j] == 0)\n        break;\n    if (j < n)\n      break;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--)\n      if (sz[x][y] == 0)\n        break;\n    if (y >= 0)\n      break;\n  }\n  s = (x - i - 1) * (y - j - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27895", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s[100][100], n, i, j, result, a = -1, b = -1, c = -1, d = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c >= 0)\n      break;\n  }\n  result = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "27896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int r, i, j, a[505][505], m1, m2, n1, n2, sum = 0;\n  scanf(\"%d\", &r);\n  m1 = r;\n  n1 = r;\n  m2 = 0;\n  n2 = 0;\n  for (i = 0; i < r; i++) {\n    for (j = 0; j < r; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        if (i <= m1 && j <= n1) {\n          m1 = i;\n          n1 = j;\n        }\n        if (i >= m2 && j >= n2) {\n          m2 = i;\n          n2 = j;\n        }\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "27897", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, e = -1, r, row1, row2, rol1, rol2, s[1000][1000];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(s[i][k]));\n      getchar();\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0 && e < 0) {\n        e += 1;\n        row1 = i;\n        rol1 = k;\n      } else {\n        if ((s[i][k] == 0) && (e >= 0)) {\n          row2 = i;\n          rol2 = k;\n        }\n      }\n    }\n  }\n  r = (row2 - row1 - 1) * (rol2 - rol1 - 1);\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "27898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, x1, y1, x2, y2, a[1000], t;\n  x1 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0) {\n        if (x1 == -1) {\n          x1 = i;\n          y1 = j;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  t = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m = 0, p, flag = 0, a = -2, b;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        m++;\n        a++;\n      } else if (flag == 1) {\n        m++;\n        a++;\n      } else\n        m++;\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "27900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int t[100][100] = {0}, i, j, n, row[2] = {0}, col[2] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &t[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n\n      if (t[i][j] == 0 && row[0] == 0)\n        row[0] = i;\n      if (t[n - i + 1][j] == 0 && row[1] == 0)\n        row[1] = n - i + 1;\n      if (t[j][i] == 0 && col[0] == 0)\n        col[0] = i;\n      if (t[n - j + 1][n - i + 1] == 0 && col[1] == 0)\n\n        col[1] = n - i + 1;\n    }\n  }\n  cout << (row[1] - row[0] - 1) * (col[1] - col[0] - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27901", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  short int map[1001][1001];\n  int n, i, j, bx, by, ex, ey, ans;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> map[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++) {\n      if (map[i][j] == 255) {\n        if (map[i][j - 1] == 0 && map[i - 1][j] == 0) {\n          bx = i;\n          by = j;\n        }\n        if (map[i][j + 1] == 0 && map[i + 1][j] == 0) {\n          ex = i;\n          ey = j;\n        }\n      }\n    }\n  ans = (ex - bx + 1) * (ey - by + 1);\n  printf(\"%d\", ans);\n  return 0;\n}\n"}
{"label": "15", "index": "27902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, i, a1, a2, b1, b2, t, x;\n  int s[100][100];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (x = 0, j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a1 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, j = (n - 1); j >= 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a2 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b1 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = (n - 1); i >= 0; i--) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b2 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "27903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], s, i, n, j, a1, b1, a2, b2, p = 0, l, w;\n  cin >> n;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i = i + 1) {\n    if (p == 0)\n      for (j = 0; j < n; j = j + 1) {\n        if (a[i][j] == 0) {\n          a1 = i;\n          b1 = j;\n          p = p + 1;\n        }\n      }\n  }\n  p = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (p == 0)\n      for (j = n - 1; j >= 0; j = j - 1) {\n        if (a[i][j] == 0) {\n          a2 = i;\n          b2 = j;\n          p = p + 1;\n        }\n      }\n  }\n  l = b2 - b1 + 1;\n  w = a1 - a2 + 1;\n  s = w * l;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int n, i, j = 0, p, x = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[j][i]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    p = 0;\n    j = 0;\n    while (m[j][i] != 0 && j < n) {\n      j++;\n    }\n    j = j + 1;\n    while (m[j][i] != 0 && j < n) {\n      p++;\n      j++;\n    }\n    x = x + p;\n  }\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2, situ = 1;\n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        y2 = i;\n        x2 = j;\n      }\n    }\n  }\n  for (i = 0; situ; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        situ = 0;\n        break;\n      } else\n        continue;\n    }\n  }\n  n = (x2 - x1 + 1) * (y2 - y1 + 1) -\n      (2 * (x2 - x1 + 1) + 2 * (y2 - y1 + 1) - 4);\n  cout << n;\n  return 0;\n}\n"}
{"label": "15", "index": "27906", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int a[100][100], n, i, j, m = 0, k = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        m = m + 1;\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        k = k + 1;\n      else\n        break;\n    }\n    if (j == n)\n      continue;\n    else {\n      for (j = n - 1; j >= 0; --j) {\n        if (a[i][j] == 255)\n          k = k + 1;\n        else\n          break;\n      }\n    }\n  }\n  s = m - k;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27907", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int w[1000][1000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &w[i][j]);\n    }\n    scanf(\"%d\\n\", &w[i][n - 1]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    scanf(\"%d \", &w[n - 1][j]);\n  }\n  scanf(\"%d \", &w[n - 1][n - 1]);\n  for (i = 2; i < n - 2; i++) {\n    for (j = 2; j < n - 2; j++) {\n      if (w[i][j] == 255)\n        s++;\n    }\n  }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sz[500][500];\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int mincol = n, minrow = n, maxcol = 0, maxrow = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i < mincol) {\n          mincol = i;\n        }\n        if (j < minrow) {\n          minrow = j;\n        }\n        if (i > maxcol) {\n          maxcol = i;\n        }\n        if (j > maxrow) {\n          maxrow = j;\n        }\n      }\n    }\n  }\n  int zong;\n  zong = (maxcol - mincol - 1) * (maxrow - minrow - 1);\n  printf(\"%d\", zong);\n  return 0;\n}\n"}
{"label": "15", "index": "27909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p;\n  int i, n, tmp, squar;\n  tmp = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      tmp = tmp + 1;\n  }\n  tmp = tmp / 4;\n  squar = (tmp - 1) * (tmp - 1);\n  cout << squar << \"\\n\";\n}\n"}
{"label": "15", "index": "27910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, s, b = 0, c = 0, d = 0, e = 0;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = j;\n        c = i;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = j;\n        e = i;\n        goto end;\n      }\n    }\n  }\nend:\n  s = (e - c - 1) * (d - b - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t = 255, x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 < 0) {\n          x1 = i;\n          y1 = j;\n        }\n        if (j > y2)\n          y2 = j;\n        x2 = i;\n      }\n    }\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27912", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "27913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[1000] = {0};\n  int a, i, j, k = 0, d = 0, l = 0, c = 0, temp = 0;\n  scanf(\"%d\\n\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &b[j]);\n    }\n    for (j = 0; j < a; j++) {\n      if (b[j] == 0 && c == 0) {\n        k = k + 1;\n        d = 1;\n        temp = j - k + 1;\n      }\n    }\n    if (d == 1) {\n      c = 1;\n    }\n    if (b[temp] == 0 && d == 1) {\n      l = l + 1;\n    } else {\n      continue;\n    }\n  }\n  printf(\"%d\\n\", (k - 2) * (l - 2));\n}\n"}
{"label": "15", "index": "27914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, u[1000][1000], i, j, chang = 0, bian = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &u[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (u[i][j] == 0) {\n        chang = chang + 1;\n      }\n    }\n    if (chang != 0) {\n      break;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (u[i][j] == 0) {\n        bian = bian + 1;\n      }\n    }\n    if (bian != 0) {\n      break;\n    }\n  }\n  sum = (chang - 2) * (bian - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i1 = 0, j1 = 0, i2 = 0, j2 = 0, j, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    if (i1 != 0)\n      break;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i1 = i + 1;\n        j1 = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i2 = i + 1;\n        j2 = j + 1;\n      }\n    }\n  }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1);\n}\n"}
{"label": "15", "index": "27916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int num[100][100];\n  int a1, a2, b1, b2, sum;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num[i][j];\n      if ((num[i][j] == 255) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a1 = i;\n        b1 = j;\n      }\n      if ((num[i][j] == 0) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  sum = (a2 - a1) * (b2 - b1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, n, j, b, c, d, e, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        i = -1;\n        j = -1;\n      }\n    }\n  }\n  x = (d - b + 1) * (e - c + 1) - 2 * (d - b + 1) - 2 * (e - c + 1) + 4;\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "27918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, row, col, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d \", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((sz[row][col] == 0) && (sz[row][col - 1] != 0) &&\n          (sz[row - 1][col] != 0)) {\n        a = row;\n        b = col;\n      }\n      if ((sz[row][col] == 0) && (sz[row][col + 1] != 0) &&\n          (sz[row + 1][col] != 0)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  if ((c - a - 1 > 0) && (d - b - 1 > 0)) {\n    int s = (c - a - 1) * (d - b - 1);\n    printf(\"%d\", s);\n  } else {\n    int s = 0;\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "27919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, b1, b2, c1, c2, flag, flag1, result;\n  scanf(\"%d\\n\", &a);\n  flag1 = 1;\n  flag = 1;\n  for (b = 1; b <= a; b++) {\n    e = 0;\n    if (b <= a - 1) {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\\n\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    } else {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    }\n    if (e != 255 * a && flag1 == 1) {\n      flag1 = 0;\n      c1 = b;\n    }\n    if (e == 255 * a && flag1 == 0) {\n      c2 = b;\n    }\n  }\n  result = (c2 - c1 - 3) * (b2 - b1 - 2);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "27920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1001][1001];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  int sx, sy, ex, ey, flag = 0;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0 && flag == 0) {\n        sx = i;\n        sy = j;\n        flag = 1;\n      } else if (a[i][j] == 0 && flag == 1) {\n        ex = i;\n        ey = j;\n      }\n    }\n  }\n  sx += 1;\n  sy += 1;\n  ex -= 1;\n  ey -= 1;\n  int sum = (ex - sx + 1) * (ey - sy + 1);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, p, q, i, k, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      if (sz[i][k] == 0) {\n        p = i;\n        q = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  printf(\"%d\", (p - a - 1) * (q - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, s, b = 0, c = 0, d = 0, e = 0;\n  scanf(\"%d \", &n);\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = j;\n        c = i;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = j;\n        e = i;\n        goto end;\n      }\n    }\n  }\nend:\n  s = (e - c - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num = 0, x1 = 1000, y1 = 1000, x2 = 0, y2 = 0;\n  cin >> n;\n  const int N = n;\n  int a[N][N];\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0) {\n        if (i < x1)\n          x1 = i;\n        if (j < y1)\n          y1 = j;\n        if (i > x2)\n          x2 = i;\n        if (j > y2)\n          y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27924", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  int graphic[100][100];\n  int i = 0, j = 0, rightEst, bottumEst;\n  int width = 0, lengh = 0;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      cin >> graphic[i][j];\n      if (graphic[i][j] == 0) {\n        rightEst = i;\n        bottumEst = j;\n      }\n    }\n  }\n  for (i = rightEst, j = bottumEst; i >= 0; i--) {\n    if (graphic[i][j] == 0)\n      width++;\n    else\n      break;\n  }\n  for (i = rightEst, j = bottumEst; j >= 0; j--) {\n    if (graphic[i][j] == 0)\n      lengh++;\n    else\n      break;\n  }\n  int portation = width * lengh - width * 2 - (lengh - 2) * 2;\n\n  cout << portation << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27925", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, s;\n  a = 4;\n  int p[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &p[i][j]);\n      if (p[i][j] == 0) {\n        a++;\n      } else\n        a = a;\n    }\n    cin >> p[i][n - 1];\n  }\n  b = a / 4;\n  s = (b - 2) * (b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27926", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sa[100][100];\n  int m, n;\n  int k;\n  int a, b, c, d, e;\n  cin >> k;\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &(sa[m][n]));\n    }\n  }\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      if (sa[m][n] == 0) {\n        goto ll;\n      }\n    }\n  }\nll:\n  a = m;\n  b = n;\n  for (m = k - 1; m >= 0; m--) {\n    for (n = k - 1; n >= 0; n--) {\n      if (sa[m][n] == 0) {\n        goto rr;\n      }\n    }\n  }\nrr:\n  c = m;\n  d = n;\n\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "27927", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, ai, aj, bi, bj, ans, x;\n\n  scanf(\"%d\", &n);\n  ai = n;\n  aj = n;\n  bi = -1;\n  bj = -1;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        if (i < ai)\n          ai = i;\n        if (i > bi)\n          bi = i;\n        if (j < aj)\n          aj = j;\n        if (j > bj)\n          bj = j;\n      }\n    }\n\n  ans = (bi - ai - 1) * (bj - aj - 1);\n\n  printf(\"%d\\n\", ans);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], j, i, m, n, l, b, k;\n  scanf(\"%d\", &l);\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      if (a[j][i] == 0) {\n        b = j;\n        j = l;\n        break;\n      }\n    }\n  }\n  for (m = l - 1; m >= 0; m--) {\n    for (n = l - 1; n >= 0; n--) {\n      if (a[m][n] == 0) {\n        k = m;\n        m = -1;\n        break;\n      }\n    }\n  }\n  cout << (k - b - 1) * (n - i - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  cin >> n;\n  int a[100][100];\n  int *q = NULL;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = (*(a + i) + j);\n      if (*q == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n  int len = 1, wid = 1;\n  int j1 = j;\n  for (j = j + 1; j <= n; j++) {\n    q = (*(a + i) + j);\n    if (*q == 0)\n      len++;\n    else\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    q = (*(a + i) + j1);\n    if (*q == 0)\n      wid++;\n    else\n      break;\n  }\n\n  cout << (len - 2) * (wid - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cancer[1000][1000];\nint main() {\n\n  int i, n, j, k1, k2, m1, m2, sum = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &cancer[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (cancer[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n        s = 1;\n        break;\n      }\n    if (s == 1) {\n      s = 0;\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (cancer[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n        s = 1;\n        break;\n      }\n    }\n    if (s == 1)\n      break;\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = m1; j <= m2; j++)\n      if (cancer[i][j] == 255)\n        sum++;\n  }\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "27931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, h[100], w = 0, q;\n  int a[100][100];\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    h[i] = 0;\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        h[i]++;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      q = h[i];\n      break;\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    if (h[i] != 0) {\n      w++;\n    } else\n      continue;\n  }\n\n  int m = (q - 2) * (w - 2);\n  printf(\"%d\", m);\n}\n"}
{"label": "15", "index": "27932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long i, j, q, e, n, w, m, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    scanf(\"%d\", &a);\n  }\n  q = i;\n  m = n * n;\n  e = i;\n  w = 0;\n  for (j = i; j <= m; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      w++;\n    if (a == 0) {\n      e++;\n      e = e + w;\n      w = 0;\n    }\n  }\n  if ((q % n - e % n) >= 0) {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((q % n - e % n) - 1);\n  } else {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((e % n - q % n) - 1);\n  }\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\n\nint main() {\n  int x1 = 1000, y1 = 1000, x2, y2, i, j, n;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> array_1[i][j];\n\n      if (array_1[i][j] == 0) {\n        x1 = (i < x1) ? i : x1;\n        y1 = (j < y1) ? j : y1;\n        x2 = i;\n        y2 = j;\n      }\n    }\n\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27934", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num = 0, x1 = 1000, y1 = 1000, x2 = 0, y2 = 0;\n  scanf(\"%d \", &n);\n  const int N = n;\n  int a[N][N];\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0) {\n        if (i < x1)\n          x1 = i;\n        if (j < y1)\n          y1 = j;\n        if (i > x2)\n          x2 = i;\n        if (j > y2)\n          y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a1, a2, b1, b2, f = -1, s = 0;\n  int(sz[1000][1000]);\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      getchar();\n      if (((sz[i][k]) == 0) && (f == -1)) {\n        a1 = i;\n        b1 = k;\n        f = 1;\n      }\n      if ((sz[i][k]) == 0) {\n        a2 = i;\n        b2 = k;\n      }\n    }\n  }\n\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  cout << s << \"\\n\";\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, x, number_0 = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &x);\n    if (x == 0) {\n      number_0++;\n    }\n  }\n  s = (number_0 / 4 - 1) * (number_0 / 4 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27937", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a = 0, b = 0, c = 0, s;\n  int x[1000][1000];\n  int y[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    y[i] = 0;\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x[i][j]);\n      if (x[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n\n    if (a > 0) {\n      y[i] = 1;\n    }\n    if (a > b) {\n      b = a;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (y[i] > 0) {\n      c = c + 1;\n    }\n  }\n  s = (b - 2) * (c - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27938", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27939", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, f = 0;\n  scanf(\"%d \", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n      if (sz[i][j] == 0 && f == 0) {\n        a = i;\n        b = j;\n        f = 1;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  printf(\"%d\", (d - b - 1) * (c - a - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[1000][1000] = {0};\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  int zuoi = 0, zuoj = 0, youi = 0, youj = 0, jump1 = 0, jump2 = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (n[i][j] == 0) {\n        zuoi = i;\n        zuoj = j;\n        jump2 = 1;\n        break;\n      }\n    }\n    if (jump2 == 1)\n      break;\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (n[i][j] == 0) {\n        youi = i;\n        youj = j;\n        jump1 = 1;\n        break;\n      }\n    }\n    if (jump1 == 1)\n      break;\n  }\n  int num;\n  if (youi == zuoi || youj == zuoj)\n    num = 0;\n  else {\n    num = (youi - zuoi - 1) * (youj - zuoj - 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i - 1][j] != 0) && (sz[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27942", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int k, l, p, q, a1 = 0, a2 = 0, b1, b2;\n  int s;\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++) {\n      if (a[k][l] == 0) {\n        a1 = k;\n        b1 = l;\n        break;\n      }\n    }\n    if (a1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n        break;\n      }\n    }\n    if (a2 != 0)\n      break;\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27943", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int shuzu[1001], jilu[1001];\n  int a = 0, b = 0, c, n, i, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shuzu[k]);\n      if (shuzu[k] == 0) {\n        jilu[a] = k;\n        a++;\n      }\n    }\n    if (a == 2) {\n      c = jilu[1] - jilu[0] - 1;\n      b += c;\n    }\n    a = 0;\n  }\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "27944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, a[1000][1000], m[2], n[2], S, f;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  f = -1;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == 0 && f == -1) {\n        m[0] = i + 1;\n        n[0] = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        m[1] = i - 1;\n        n[1] = j - 1;\n      }\n    }\n  }\n  S = (m[1] - m[0] + 1) * (n[1] - n[0] + 1);\n  printf(\"%d\\n\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int sz[500][500];\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int mincol = n, minrow = n, maxcol = 0, maxrow = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i < mincol) {\n          mincol = i;\n        }\n        if (j < minrow) {\n          minrow = j;\n        }\n        if (i > maxcol) {\n          maxcol = i;\n        }\n        if (j > maxrow) {\n          maxrow = j;\n        }\n      }\n    }\n  }\n  int zong;\n  zong = (maxcol - mincol - 1) * (maxrow - minrow - 1);\n  printf(\"%d\", zong);\n  return 0;\n}\n"}
{"label": "15", "index": "27946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  x1 = n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n\n      if (a == 0 && j < x1) {\n        x1 = j;\n        y1 = i;\n      }\n      if (a == 0) {\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n\n  int area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area << \"\\n\" << x2 - x1 - 1 << \"\\n\" << y2 - y1 - 1;\n\n  return (0);\n}\n"}
{"label": "15", "index": "27947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j, m = 0, i1, i2, j1, j2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        m++, i2 = i, j2 = j;\n      if (m == 1)\n        i1 = i, j1 = j;\n    }\n  }\n  int num = (i2 - i1 - 1) * (j2 - j1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "27948", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[1000][1000];\n\nint main(int argc, char *argv[]) {\n  int row, col, k = 0, n, i, j, l;\n  cin >> n;\n  ;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &matrix[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] == 0 && matrix[i][j + 1] != 0 && matrix[i][j - 1] != 0) {\n        for (j; j < n; j++) {\n          if (matrix[i][j + 1] == 255)\n            k++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", k);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27949", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, i, j, a = 0, b = 1000, c = 0, d = 1000, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i > a) {\n          a = i;\n        }\n        if (i < b) {\n          b = i;\n        }\n\n        if (j > c) {\n          c = j;\n        }\n        if (j < d) {\n          d = j;\n        }\n      }\n    }\n  }\n  x = a - b - 1;\n  y = c - d - 1;\n  s = x * y;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int loc[1000][1000];\n  int m, n, p, q;\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++)\n      scanf(\"%d\", &loc[i][j]);\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (loc[i][j] == 0) {\n        m = i;\n        n = j;\n        break;\n      }\n    }\n    if (loc[m][n] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (loc[i][j] == 0) {\n        p = i;\n        q = j;\n        break;\n      }\n    }\n    if (loc[p][q] == 0) {\n      break;\n    }\n  }\n  int s;\n  s = (p - m - 1) * (q - n - 1);\n  cout << s << \"\\n\";\n}\n"}
{"label": "15", "index": "27951", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int ROW, COL, ROW1, COL1, col, row;\n  int n, k = 0;\n  int T = 0;\n  int a, b;\n  scanf(\"%d\", &n);\n  ROW = n - 1;\n  COL = n - 1;\n\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      cin >> sz[row][col];\n    }\n  }\n  for (row = 0; row < ROW; row++) {\n    for (col = 0; col < COL; col++) {\n      if (T == 0 && sz[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n\n        T = 1;\n      }\n    }\n  }\n  for (row = ROW; row >= ROW1; row--) {\n    for (col = COL; col >= COL1; col--) {\n      if (T == 0 && sz[row][col] == 0) {\n        COL = col;\n        ROW = row;\n\n        T = 1;\n      }\n    }\n  }\n\n  a = ROW - ROW1 - 3;\n  b = COL - COL1 - 1;\n  k = a * b;\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "27952", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a1, a2, b1, b2, m;\n  scanf(\"%d\", &n);\n  int num[1000][1000];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (num[i][j] == 0) {\n        a1 = i;\n        a2 = j;\n      }\n  for (i = n - 1; i > 0; i--)\n    for (j = n - 1; j > 0; j--)\n      if (num[i][j] == 0) {\n        b1 = i;\n        b2 = j;\n      }\n  m = (a1 - b1 - 1) * (a2 - b2 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2, situ = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        y2 = i;\n        x2 = j;\n      }\n    }\n  }\n  for (i = 0; situ; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        situ = 0;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  n = (x2 - x1 + 1) * (y2 - y1 + 1) -\n      (2 * (x2 - x1 + 1) + 2 * (y2 - y1 + 1) - 4);\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "15", "index": "27954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, a, n, b = 0, c = 0, d = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  printf(\"%d\\n\", (b * (d - 2)));\n  return 0;\n}\n"}
{"label": "15", "index": "27955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, shu[1000][1000], i, k, heng = 0, s = 0, count;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &shu[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (shu[i][k] == 0)\n        heng += 1;\n    }\n    if (heng != 0) {\n      break;\n    }\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (shu[i][k] == 0) {\n        s += 1;\n      }\n    }\n    if (s != 0) {\n      break;\n    }\n  }\n  count = (s - 2) * (heng - 2);\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, tem, a, b, count = 0, tr = 0, s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> tem;\n      if (tem == 255 && tr == 1)\n        tr = 2;\n      else if (tem == 0 && tr == 0) {\n        s++;\n        tr = 1;\n      } else if (tem == 0 && tr == 1)\n        s++;\n      if (tem == 0)\n        count++;\n    }\n    if (tr == 1)\n      tr = 2;\n  }\n  cout << ((count - 2 * s) / 2) * (s - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "27957", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, count, key;\n  cin >> n;\n\n  count = 0;\n  key = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n    }\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0 && a[j + 1] == 0) {\n        break;\n      }\n      if (a[j] == 0)\n        key = 1 - key;\n      if (a[j] * key != 0)\n        count = count + 1;\n    }\n  }\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "27958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, s, i, j;\n  int x[100][100];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 0)\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "27959", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint s[1000][1000];\nint main() {\n\n  int a = 1, b = 1, j, i, n, m, first = 0;\n  int c = 0, d = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        first = 1;\n        break;\n      }\n    }\n\n    if (first == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    c++;\n    if (s[a][j] == 255) {\n      break;\n    }\n  }\n\n  for (i = a; i < n; i++) {\n    d++;\n    if (s[i][b] == 255)\n      break;\n  }\n\n  m = (c - 3) * (d - 3);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sz[1000][1000];\n  int x1, y1;\n  int x2, y2;\n  int k, i;\n  int s; \n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &(sz[k][i]));\n  } \n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (sz[k][i] == 0) {\n        x1 = i;\n        y1 = k;\n        break;\n      }\n    }\n  } \n  for (k = n - 1; k >= 0; k--) {\n    for (i = n - 1; i >= 0; i--) {\n      if (sz[k][i] == 0) {\n        x2 = i;\n        y2 = k;\n        break;\n      } \n    }\n  }\n  s = (abs(x2 - x1) - 1) * (abs(y2 - y1) - 1); \n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, o, p, q, A[100][100], i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    A[0][i] = 255;\n    A[i][0] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &A[i][j]);\n    }\n  }\n\n  for (i = 0; i <= n + 1; i++) {\n    A[n + 1][i] = 255;\n    A[i][n + 1] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (A[i - 1][j] == 255 && A[i][j - 1] == 255 && A[i + 1][j] == 0 &&\n          A[i][j + 1] == 0 && A[i][j] == 0) {\n        m = i;\n        o = j;\n      }\n      if (A[i - 1][j] == 0 && A[i][j - 1] == 0 && A[i + 1][j] == 255 &&\n          A[i][j + 1] == 255 && A[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m - 1) * (q - o - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, k, x, y, z, w, s;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n; k++) {\n      if (a[i][k - 1] != 0 && a[i][k] == 0 && a[i][k + 1] == 0 &&\n          a[i + 1][k] == 0) {\n        x = i;\n        y = k;\n      }\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (a[i][k - 1] == 0 && a[i][k] == 0 && a[i][k + 1] != 0 &&\n          a[i - 1][k] == 0) {\n        z = i;\n        w = k;\n      }\n    }\n  }\n\n  s = (z - 1 - x) * (w - 1 - y);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27964", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum[1000][1000];\n  int n, i, j, s = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sum[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == 0) {\n        s++;\n      }\n    }\n    if (s > 2) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i][j] == 0) {\n        t++;\n      }\n    }\n    if (t > 2) {\n      break;\n    }\n  }\n  printf(\"%d\", s * t - (2 * s + 2 * t - 4));\n\n  return 0;\n}\n"}
{"label": "15", "index": "27965", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int row, col, n;\n  int b = 0, c;\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0)\n        b++;\n    }\n  }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "27966", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, aa1, bb1, aa2, bb2, a[99][99];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        aa1 = i;\n        bb1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        aa2 = i;\n        bb2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (aa2 - aa1 - 1) * (bb2 - bb1 - 1));\n}\n"}
{"label": "15", "index": "27967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n    cout << \"\\n\";\n  }\n  int k;\n  int sum = 0;\n  for (k = 0; k < n && sum == 0; k++) {\n    int p;\n    for (p = 0; p < n; p++) {\n      if (sz[k][p] == 0)\n        sum = sum + 1;\n    }\n  }\n  int sum1 = 0;\n  int q;\n  for (q = 0; q < n && sum1 == 0; q++) {\n    int m;\n    for (m = 0; m < n; m++) {\n      if (sz[m][q] == 0) {\n        sum1++;\n      }\n    }\n  }\n\n  int jieguo = (sum - 2) * (sum1 - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "27968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int m = 0;\n  int l = 0;\n  int t = 0;\n  int L, h, S;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      p[i][j] = x;\n    }\n  }\n  int a, b;\n  for (a = 0; a < n; a++) {\n    if (p[a][0] != 0) {\n      for (b = 1; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b - 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 4;\n      L = (m - 2 * h - 4) / 2;\n    } else {\n      for (b = 0; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b + 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 3;\n      L = (m - 2 * h - 4) / 2;\n    }\n  }\n  S = h * L;\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, a, b, c, d, log = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        log = 1;\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  log = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        log = 1;\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s;\n  scanf(\"%d\", &n);\n  int **p;\n  p = (int **)malloc(sizeof(int *) * n);\n  for (i = 0; i < n; i++)\n    p[i] = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &p[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        if (p[i][j] != p[i - 1][j] && p[i][j] != p[i][j - 1]) {\n          a = i, b = j;\n          break;\n        }\n        if (p[i][j] != p[i + 1][j] && p[i][j] != p[i][j + 1]) {\n          c = i, d = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "27971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, k, s;\n  s = 0;\n  int e, b, c, d;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(a[i][k]));\n      if (a[i][k] == 0) {\n        s = s + 1;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (a[i][k] == 0) {\n        e = i;\n        b = k;\n        break;\n      }\n    }\n  }\n  for (k = b; k < n; k++) {\n    if (a[e][k] == 255) {\n      break;\n    }\n  }\n  c = k - 1;\n  d = (s - 2 * (c - b + 1)) / 2;\n  int S;\n  S = d * (c - b - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "27972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint xiangsu[1000][1000];\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  scanf(\"%d\", &n);\n\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(xiangsu[i][j]));\n    }\n  }\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "27973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[1000][1000] = {0};\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  int zuoi = 0, zuoj = 0, youi = 0, youj = 0, jump1 = 0, jump2 = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (n[i][j] == 0) {\n        zuoi = i;\n        zuoj = j;\n        jump2 = 1;\n        break;\n      }\n    }\n    if (jump2 == 1)\n      break;\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (n[i][j] == 0) {\n        youi = i;\n        youj = j;\n        jump1 = 1;\n        break;\n      }\n    }\n    if (jump1 == 1)\n      break;\n  }\n  int num;\n  if (youi == zuoi || youj == zuoj) {\n    num = 0;\n  } else {\n    num = (youi - zuoi - 1) * (youj - zuoj - 1);\n  }\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int an[100][100], i, j, n, s, a, b, flag = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &an[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (a = n - 1; a >= 0; a--) {\n    for (b = n - 1; b >= 0; b--) {\n      if (an[a][b] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  s = (b - j - 1) * (a - i - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, b1, b2, c1, c2, flag, flag1, result;\n  scanf(\"%d\\n\", &a);\n  flag1 = 1;\n  flag = 1;\n  for (b = 1; b <= a; b++) {\n    e = 0;\n    if (b <= a - 1) {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          scanf(\"%d \", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\\n\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    } else {\n      for (c = 1; c <= a; c++) {\n        if (c <= a - 1) {\n          cin >> d;\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        } else {\n          scanf(\"%d\", &d);\n          e = e + d;\n          if (d == 0 && flag == 1) {\n            b1 = c;\n            flag = 0;\n          }\n          if (d == 255 && flag == 0) {\n            b2 = c;\n            flag = 2;\n          }\n        }\n      }\n    }\n    if (e != 255 * a && flag1 == 1) {\n      flag1 = 0;\n      c1 = b;\n    }\n    if (e == 255 * a && flag1 == 0) {\n      c2 = b;\n    }\n  }\n  result = (c2 - c1 - 3) * (b2 - b1 - 2);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "27976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, a[1000][1000], flag = 0, number;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0) {\n        k++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  flag = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        m++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  number = (k - 2) * (m - 2);\n  cout << number << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27977", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, a, b, c, d, log = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        log = 1;\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (log)\n      break;\n  }\n  log = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        log = 1;\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (log) {\n      break;\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "27978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int image[1000][1000];\n  int n, i, j, area, begRow, begCol, endRow, endCol, isBreak;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &image[i][j]);\n    }\n\n  isBreak = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n        begRow = i;\n        begCol = j;\n        isBreak = 1;\n        break;\n      }\n    }\n    if (isBreak)\n      break;\n  }\n\n  for (i = begRow; i < n; i++) {\n    if (i == (n - 1) && image[i][begCol] == 0)\n      endRow = i;\n    else if (image[i][begCol] != 0) {\n      endRow = i - 1;\n      break;\n    }\n  }\n\n  for (j = begCol; j < n; j++) {\n    if (j == (n - 1) && image[begRow][j] == 0)\n      endCol = i;\n    else if (image[begRow][j] != 0) {\n      endCol = j - 1;\n      break;\n    }\n  }\n\n  area = (endRow - begRow - 1) * (endCol - begCol - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "27979", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, p[100][100], a, b, c, d;\n  memset(p, 1, sizeof(p));\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) == 0) {\n        a = i;\n        b = j;\n      }\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) == 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) != 0)\n        c = j;\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) == 0 && *(*(p + i + 1) + j) != 0 &&\n          *(*(p + i) + j + 1) == 0)\n        d = i;\n    }\n  cout << (d - a - 1) * (c - b - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "27980", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0, m, l, p, q;\n  int a = 0, b = 0;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (sz[i][k] == 0 && a == 0) {\n\n        m = i;\n        l = k;\n        a = 1;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0 && b == 0) {\n\n        p = i;\n        q = k;\n        b = 1;\n      }\n    }\n  }\n  sum = (p - m - 1) * (q - l - 1);\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "15", "index": "27981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  int **array, i, j;\n  int a = 1000, b = 1000, c = 0, d = 0;\n  scanf(\"%d\", &N);\n  array = (int **)malloc(N * sizeof(int *));\n  for (i = 0; i < N; i++) {\n    array[i] = (int *)malloc(N * sizeof(int));\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &array[i][j]);\n\n      if (array[i][j] == 0 && i <= a && j <= b) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && i >= c && j >= d) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  printf(\"%d\", (c - a - 1) * (d - b - 1));\n}\n"}
{"label": "15", "index": "27982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  cin >> n;\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * ((m - (i - 2)) / 2 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int n, i, j = 0, p, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[j][i]);\n  }\n\n  for (i = 0; i < n; i++) {\n    p = 0;\n    j = 0;\n    while (m[j][i] != 0 && j < n) {\n      j++;\n    }\n    j = j + 1;\n    while (m[j][i] != 0 && j < n) {\n      p++;\n      j++;\n    }\n    x = x + p;\n  }\n\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "27984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1000][1000], m = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0) {\n        break;\n      }\n    }\n    p = j;\n    for (j = n; j >= 0; j--) {\n      if (a[i][j] == 0 && a[i][j - 1] != 0) {\n        break;\n      }\n    }\n    q = j;\n    if (q > p) {\n      m = m + q - p - 1;\n    }\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "27985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], b, c, d, e, f, i, j, zhi = 0;\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0 && zhi == 0) {\n        b = i;\n        c = j;\n        zhi++;\n      }\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  f = (d - b - 1) * (e - c - 1);\n  cout << f;\n}\n"}
{"label": "15", "index": "27986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s = 0, i, j;\n  int a = 0;\n  int b = 0;\n  int sz[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0)\n        a++;\n    }\n    if (a != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0)\n        b++;\n    }\n    if (b != 0) {\n      break;\n    }\n  }\n  s = a * b - 2 * a - 2 * b + 4;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27987", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, p, q, num1 = 0, num2 = 0, sum;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      cin >> a[j][i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        num1++;\n        p = j;\n        q = i;\n      }\n    }\n    if (num1 != 0)\n      break;\n  }\n  for (j = p; a[j][q] == 0; j++)\n    num2++;\n\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "27988", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, sum = 0, m, k, x;\n  int edge[100][100];\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> edge[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      m = sum;\n      break;\n    }\n  }\n\n  sum = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      k = sum;\n      break;\n    }\n  }\n  x = (k - 2) * (m - 2);\n\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27989", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int *data;\n  data = (int *)malloc(sizeof(int) * n * n);\n  int i, j, k;\n  int p = 0, q = 0, t = 0, s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> data[i * n + j];\n    }\n    for (k = 0; k < n; k++) {\n      if (data[i * n + k] == 0) {\n        p = i + 1;\n        q = k + 1;\n      }\n    }\n  }\n  int u, v;\n  for (u = n - 1; u >= 0; u--) {\n    for (v = n - 1; v >= 0; v--) {\n      if (data[u * n + v] == 0) {\n        t = u + 1;\n        s = v + 1;\n      }\n    }\n  }\n  int x, y, z;\n  y = q - s - 1;\n  x = p - t - 1;\n  z = x * y;\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "15", "index": "27990", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, hengsum = 0, js = 1, spj, susum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    spj = 1;\n    if (hengsum == 0)\n      js = i;\n    for (k = 1; k <= n; k++) {\n      cin >> h;\n      if (h == 0) {\n        if (spj == 1) {\n          susum += 1;\n          spj++;\n        }\n\n        if (js == i)\n          hengsum += 1;\n      }\n    }\n  }\n  printf(\"%d\", (susum - 2) * (hengsum - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "27991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, count, key;\n  scanf(\"%d\", &n);\n\n  count = 0;\n  key = 0;\n  int a[n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[j]);\n\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0 && a[j + 1] == 0) {\n        break;\n      }\n      if (a[j] == 0)\n        key = 1 - key;\n      if (a[j] * key != 0)\n        count = count + 1;\n    }\n  }\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "27992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, num, l, k, p, q;\n  scanf(\"%d\", &n);\n  int a1, b1, a2, b2;\n  int square[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &square[i][j]);\n  }\n  for (l = 0; l < n; l++) {\n    for (k = 0; k < n; k++) {\n      if (square[l][k] == 0) {\n        a1 = l;\n        b1 = k;\n      }\n    }\n  }\n  for (p = (n - 1); p >= 0; p--) {\n    for (q = (n - 1); q >= 0; q--) {\n      if (square[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n      }\n    }\n  }\n  num = (a1 - a2 - 1) * (b1 - b2 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int shuzu[1002][1002];\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> shuzu[i][j];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (shuzu[i][j] == 0 && shuzu[i][j + 1] == 0 && shuzu[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (shuzu[i][j] == 0 && shuzu[i][j - 1] == 0 && shuzu[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (x2 - x1 + 1) * (y2 - y1 + 1) - 2 * (x2 - x1 + 1) -\n                     2 * (y2 - y1 + 1) + 4);\n  return 0;\n}\n"}
{"label": "15", "index": "27994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  int i, j;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &(sz[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  int l = b - d - 1;\n  int w = a - c - 1;\n  int s = l * w;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "27995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num[1000][1000];\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  int m, n, p, q, s, w;\n  w = 0;\n  for (i = 0; i < k && w == 0; i++) {\n    for (j = 0; j < k && w == 0; j++) {\n      if (num[i][j] == 0) {\n        m = i;\n        p = j;\n        w = 1;\n      }\n    }\n  }\n  n = 0;\n  q = 0;\n  for (i = m, j = p; j < k; j++) {\n    if (num[i][j] == 0) {\n      n++;\n    }\n  }\n  for (i = m, j = p; i < k; i++) {\n    if (num[i][j] == 0) {\n      q++;\n    }\n  }\n  s = (n - 2) * (q - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "27996", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n;\n  cin >> n;\n  int i, j = 0, k = 0, h = 1, a;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      j++;\n    if (a == 0)\n      break;\n  }\n  for (i = 1; i <= n * n - j - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      k++;\n\n    if (a == 0) {\n      k = 0;\n      h++;\n    }\n  }\n  int x;\n  x = (n - j % n - k % n - 2) * (h - 2 * (n - j % n - k % n)) / 2;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "27997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j, m = 0, i1, i2, j1, j2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        m++, i2 = i, j2 = j;\n      if (m == 1)\n        i1 = i, j1 = j;\n    }\n  }\n  int num = (i2 - i1 - 1) * (j2 - j1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "27998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[1000][1000], num, i, j, sta_r, sta_c, end_r, end_c, S;\n  cin >> num;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][0] == 0) {\n      sta_r = i;\n      sta_c = 0;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[0][j] == 0) {\n      sta_r = 0;\n      sta_c = j;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][num - 1] == 0) {\n      end_r = i;\n      end_c = num - 1;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[num - 1][j] == 0) {\n      sta_r = num - 1;\n      sta_c = j;\n    }\n  }\n  for (i = 1; i < num - 1; i++) {\n    for (j = 1; j < num - 1; j++) {\n      if ((n[i][j] == 0) && (n[i + 1][j] == 0) && (n[i][j + 1] == 0)) {\n        sta_r = i;\n        sta_c = j;\n      }\n      if ((n[i][j] == 0) && (n[i - 1][j] == 0) && (n[i][j - 1] == 0)) {\n        end_r = i;\n        end_c = j;\n      }\n    }\n  }\n  S = (end_r - sta_r - 1) * (end_c - sta_r - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "27999", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n\n  scanf(\"%d\", &n);\n\n  int x, y, a, b, sz[100][100], tag, tag1 = 0;\n\n  for (x = 0; x < n; x++) {\n\n    tag = 0;\n\n    for (y = 0; y < n; y++) {\n\n      scanf(\"%d\", &sz[x][y]);\n\n      if (sz[x][y] == 0) {\n\n        tag++;\n\n        tag1++;\n      }\n    }\n\n    if (tag1 == tag) {\n\n      a = tag - 2;\n    }\n  }\n\n  b = (tag1 - 2 * (a + 2)) / 2;\n\n  printf(\"%d\", a * b);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28000", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, b, c, d, sz[1000][1000], s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 0 && sz[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 0 && sz[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n;\n  int i, j, k, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        for (k = 0; j + k <= n - 1; k++) {\n          if (a[i][j + k] != 0) {\n            break;\n          }\n        }\n        for (r = 0; i + r <= n - 1; r++) {\n          if (a[i + r][j] != 0) {\n            break;\n          }\n        }\n        goto A;\n      }\n    }\n  }\nA:\n  cout << (k - 2) * (r - 2) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int y = 0;\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0 && y == 0) {\n        i1 = i;\n        j1 = j;\n        y++;\n      } else if (x == 0 && y != 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, number[1001], i, p, count, start, end;\n  count = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    start = 0;\n    end = 0;\n    for (p = 1; p <= n; p++) {\n      scanf(\"%d\", &number[p]);\n    }\n    for (p = 1; p <= n - 1; p++) {\n      if (start == 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        start = p;\n      }\n      if (start != 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        end = p;\n      }\n    }\n    if (end - start <= 1) {\n      continue;\n    }\n    count += (end - start - 1);\n  }\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "28004", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        i = n;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        i = -1;\n        break;\n      }\n    }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cancer[1000][1000];\nint main() {\n  int i, n, j, k1, k2, m1, m2, sum = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &cancer[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (cancer[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n        s = 1;\n        break;\n      }\n    if (s == 1) {\n      s = 0;\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (cancer[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n        s = 1;\n        break;\n      }\n    }\n    if (s == 1)\n      break;\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = m1; j <= m2; j++)\n      if (cancer[i][j] == 255)\n        sum++;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28006", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, sum;\n  int i, j, starti, startj, endi, endj;\n  int a[10][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  starti = -1;\n  startj = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        starti = i;\n        startj = j;\n        break;\n      }\n    if (starti >= 0)\n      break;\n  }\n  endi = starti;\n  endj = startj;\n  while (a[starti][endj + 1] == 0)\n    endj++;\n  while (a[endi + 1][startj] == 0)\n    endi++;\n  printf(\"%d\", (endi - starti - 1) * (endj - startj - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28007", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, h, l, s, i, j, p, sum, m;\n  cin >> n;\n  sum = 0;\n  j = 0;\n  for (h = 1; h <= n; h++) {\n    i = 0;\n    for (l = 1; l <= n; l++) {\n      scanf(\"%d \", &s);\n      if (s == 0)\n        i++;\n    }\n    sum = sum + i;\n    if (i != 0)\n      j++;\n  }\n  if (j <= 2 || sum <= 2 * j)\n    printf(\"0\");\n  else {\n    p = (sum - 2 * j) / 2;\n    m = p * (j - 2);\n    printf(\"%d\", m);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1, l1, h2, l2;\n  int a[1000][1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        h1 = i;\n        l1 = j;\n        break;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        break;\n        break;\n      }\n    }\n  }\n  cout << (fabs(h2 - h1) - 1) * (fabs(l2 - l1) - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, h1 = 0, l1 = 0, h2 = 0, l2 = 0, s = 0;\n  cin >> n;\n  int a[n][n];\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        h1 = i + 1;\n        l1 = j + 1;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i + 1;\n        l2 = j + 1;\n        goto loop2;\n      }\n    }\n  }\nloop2:\n  s = (h2 - h1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, tem, a, b, count = 0, tr = 0, s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &tem);\n      if (tem == 255 && tr == 1)\n        tr = 2;\n      else if (tem == 0 && tr == 0) {\n        s++;\n        tr = 1;\n      } else if (tem == 0 && tr == 1)\n        s++;\n      if (tem == 0)\n        count++;\n    }\n    if (tr == 1)\n      tr = 2;\n  }\n  cout << ((count - 2 * s) / 2) * (s - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28011", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0;\n  int k[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (k[i][j] == 0) {\n        while (k[i][j + 1] == 255) {\n          j++;\n          num++;\n        }\n\n        if (k[i][j + 1] == 0) {\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  int i, j;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &(sz[i][j]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  int l = b - d - 1;\n  int w = a - c - 1;\n  int s = l * w;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {{0}, {0}}, i, j, n, m = 0, p = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i - 1][j - 1]);\n    }\n\n    printf(\"\\n\");\n  }\n  for (i = 1; m == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i - 1][j - 1] == 0)\n        m++;\n    }\n  }\n  for (i = 1; p == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[j - 1][i - 1] == 0)\n        p++;\n    }\n  }\n  q = (p - 2) * (m - 2);\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "28014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, a[100][100], i, j, i1, i2, j1, j2, k1 = 0, k2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        k1 = 1;\n        break;\n      }\n    if (k1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        k2 = 1;\n        break;\n      }\n    if (k2 == 1)\n      break;\n  }\n  printf(\"%d\", ((i2 - i1 - 1) * (j2 - j1 - 1)));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, hengsum = 0, js = 1, spj, susum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    spj = 1;\n    if (hengsum == 0)\n      js = i;\n    for (k = 1; k <= n; k++) {\n      cin >> h;\n      if (h == 0) {\n        if (spj == 1) {\n          susum += 1;\n          spj++;\n        }\n\n        if (js == i)\n          hengsum += 1;\n      }\n    }\n  }\n  printf(\"%d\", (susum - 2) * (hengsum - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i, j;\n  int t1, t2;\n  int a[10000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[0] = 255;\n      scanf(\"%d\", &a[j + 1]);\n      if (a[j] == 0 && a[j - 1] == 255) {\n\n        t1 = j;\n      }\n\n      if (a[j - 1] == 0 && a[j] == 255)\n        t2 = j - 1;\n    }\n  }\n  cout << (t2 - t1 - 1) * (t2 - t1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int e, f = 0, g[1000];\n\n  int n;\n  cin >> n;\n\n  int i = 0;\n  while (i < n) {\n    int k = 0;\n    while (k < n) {\n      cin >> e;\n      if (e == 0) {\n        f++;\n      }\n      k++;\n    }\n\n    g[i] = f;\n    f = 0;\n    i++;\n  }\n\n  int m = 0, x, y;\n  int j = 0;\n  while (j < n) {\n    if (g[j] > m) {\n      m = g[j];\n    }\n    if (g[j] == 0 && g[j + 1] != 0) {\n      x = j;\n    }\n    if (g[j] != 0 && g[j + 1] == 0) {\n      y = j;\n    }\n    j++;\n  }\n\n  int d, sum;\n  d = y - x;\n  sum = (m - 2) * (d - 2);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a, sum = 0, m;\n  cin >> n;\n  while (i <= n * n) {\n\n    scanf(\"%d\", &a);\n    i = i + 1;\n    if (a == 0) {\n      sum = sum + 1;\n    }\n  }\n  m = sum * sum / 16 + 1 - sum / 2;\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p;\n  int i, n, tmp, squar;\n  tmp = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      tmp = tmp + 1;\n  }\n  tmp = tmp / 4;\n  squar = (tmp - 1) * (tmp - 1);\n  printf(\"%d\\n\", squar);\n}\n"}
{"label": "15", "index": "28020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h, l, s, i, j, p, sum, m;\n  scanf(\"%d\", &n);\n  sum = 0;\n  j = 0;\n  for (h = 1; h <= n; h++) {\n    i = 0;\n    for (l = 1; l <= n; l++) {\n      scanf(\"%d\", &s);\n      if (s == 0)\n        i++;\n    }\n    sum = sum + i;\n    if (i != 0)\n      j++;\n  }\n  if (j <= 2 || sum <= 2 * j)\n    printf(\"0\");\n  else {\n    p = (sum - 2 * j) / 2;\n    m = p * (j - 2);\n    cout << m;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, e, f, x, y, p, s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  p = (x - e - 1) * (y - f - 1);\n  printf(\"%d\", p);\n  return 0;\n}\n"}
{"label": "15", "index": "28022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  int length, width, x = 0, y = 0;\n  for (length = j; a[i][length] == 0; length++) {\n    x++;\n  }\n  for (width = i; a[width][j] == 0; width++)\n    y++;\n\n  int p;\n  p = (x - 2) * (y - 2);\n  printf(\"%d\", p);\n}\n"}
{"label": "15", "index": "28023", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sz[1000][1000], a, b, c, d, e = 1, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n\n      if (sz[i][j] == 0 && e == 1) {\n        a = i;\n        b = j;\n        e = 0;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p, count = 0, n1, n2, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0 && count == 0) {\n      n1 = i;\n      count = 1;\n    }\n    if (p == 0 && count != 0)\n      n2 = i;\n  }\n  cout << (n2 / n - n1 / n - 1) * (n2 % n - n1 % n - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, k, r1, r2, c1, c2, x = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] == 0) && x == 0) {\n        r1 = i + 1;\n        c1 = j + 1;\n        x = 1;\n      }\n      if ((a[i][j] == 0)) {\n        r2 = i - 1;\n        c2 = j - 1;\n      }\n    }\n  }\n  printf(\"%d\\n\", (r2 - r1 + 1) * (c2 - c1 + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int p[1000][1000], i, j, a, b, a1, b1, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (p[a][b] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (p[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (p[a1][b1] == 0) {\n      break;\n    }\n  }\n  s = (a1 - a - 1) * (b1 - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], *p, *p1, *p2, n, i, j, hang1, lie1, hang2, lie2, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0, p = &a[i][0]; i < n; i++)\n    for (j = 0; j < n; j++, p++) {\n      scanf(\"%d\", p);\n      if (*p == 0 && m == 0) {\n        p1 = p;\n        hang1 = i;\n        lie1 = j;\n        m = 1;\n      }\n      if (*p == 0) {\n        p2 = p;\n        hang2 = i;\n        lie2 = j;\n      }\n    }\n  printf(\"%d\", (hang2 - hang1 - 1) * (lie2 - lie1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28028", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int A[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      scanf(\"%d\", &x);\n      A[i][j] = x;\n    }\n  }\n  int a, b, c, d;\n  int p;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255 && A[i][j + 1] == 0 &&\n          A[i - 1][j] == 255 && A[i + 1][j] == 0) {\n        a = i;\n        b = j;\n      } else if (A[i][j] == 0 && A[i][j - 1] == 0 && A[i][j + 1] == 255 &&\n                 A[i - 1][j] == 0 && A[i + 1][j] == 255) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  p = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", p);\n  return 0;\n}\n"}
{"label": "15", "index": "28029", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int lon, wid;\n  int m;\n  int c1 = 0, c2 = 0;\n  lon = 0, wid = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        c1 = c1 + 1;\n\n        if (c1 > 2)\n\n          lon = c1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        c2 = c2 + 1;\n\n        if (c2 > 2)\n\n          wid = c2;\n        break;\n      }\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28030", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int a = 0, b = 0;\n  int i, j;\n  int c = 1000, d = 1000;\n  int num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num);\n      if (num == 0) {\n        if (a < i)\n          a = i;\n        if (b < j)\n          b = j;\n        if (c > i)\n          c = i;\n        if (d > j)\n          d = j;\n      }\n    }\n  }\n  cout << (a - c - 1) * (b - d - 1) << \"\\n\";\n}\n"}
{"label": "15", "index": "28031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[10000][10000];\nint main() {\n  int n, i, j, a1, b1, a2, b2, sum, flag;\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = n - 1; i > 0; i--) {\n    flag = 0;\n    for (j = n - 1; j > 0; j--) {\n      if (s[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  sum = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "28032", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int area[1000][1000];\n  int i, j, n, i1, j1, i2, a, b, j2, J1 = 0, J2 = 0, I1 = 0, I2 = 0, GESHU;\n  GESHU = 0;\n  a = 1;\n  b = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(area[i][j]));\n    }\n  }\n\n  for (i1 = 0; i1 < n; i1++) {\n    for (j1 = 0; j1 < n; j1++)\n\n    {\n      if (area[i1][j1] == 0 && a == 1) {\n        a = 2;\n        J1 = j1;\n        I1 = i1;\n      }\n    }\n  }\n\n  for (i2 = n - 1; i2 >= 0; i2--) {\n    for (j2 = n - 1; j2 >= 0; j2--) {\n      if (area[i2][j2] == 0 && b == 1) {\n        J2 = j2;\n        I2 = i2;\n        b = 2;\n      }\n    }\n  }\n  GESHU = (J2 - J1 + 1) * (I2 - I1 + 1) - 2 * (J2 - J1 + I2 - I1 + 2) + 4;\n  printf(\"%d\", GESHU);\n  return 0;\n}\n"}
{"label": "15", "index": "28033", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1000][1000];\n  int b, start1, start2, end1, end2;\n  b = 0;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && b == 0) {\n        start1 = i + 1;\n        start2 = j + 1;\n        b = 1;\n      }\n      if (a[i][j] == 0 && b == 1) {\n        end1 = i + 1;\n        end2 = j + 1;\n      }\n    }\n  }\n  int area;\n  area = (end1 - start1 - 1) * (end2 - start2 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28034", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a, x, y;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (i = x + 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      y = i;\n    }\n  }\n  printf(\"%d\", (y / n - x / n - 1) * (y % n - x % n - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, fir1, fir2, la1, la2, s, a[1000][1000];\n  scanf(\"%d\", &n);\n  fir1 = 0;\n  for (i = 1; i < n + 1; i++)\n    for (j = 1; j < n + 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (fir1 == 0 && a[i][j] == 0) {\n        fir1 = i;\n        fir2 = j;\n      }\n      if (a[i][j] == 0) {\n        la1 = i;\n        la2 = j;\n      }\n    }\n  s = (la1 - fir1 - 1) * (la2 - fir2 - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, x1 = 0, x2 = 0, y1 = 0, y2 = 0, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  x = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  if (x1 == x2 || y1 == y2)\n    cout << 0 << endl;\n  else {\n    printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "28037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, a, sum0, n, s, t, b;\n  scanf(\"%d\", &n);\n  sum0 = 0;\n  t = 0;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        sum0 = sum0 + 1;\n        s = s + 1;\n      }\n    }\n    if (s != 0)\n      t = s;\n    else\n      t = t;\n  }\n  b = (t - 2) * (sum0 - 2 * t) / 2;\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "28038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, min, max, e, b, c, d, n, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  max = 0;\n  min = 200;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if ((i + j) > max) {\n          max = i + j;\n          e = i;\n          b = j;\n        }\n        if ((i + j) < min) {\n          min = i + j;\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  t = (e - c + 1) * (b - d + 1) - 2 * (e - c + 1) - 2 * (b - d - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "28039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, i, begin, end, flag = 0, x1, x2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      if (flag == 0)\n        begin = i;\n      flag = 1;\n      end = i;\n    }\n  }\n  x1 = (begin + n - 1) / n;\n  y1 = begin % n;\n  x2 = (end + n - 1) / n;\n  y2 = end - n * (x2 - 1);\n\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, c, b, sum = 0, i, a[10][10];\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        b = y;\n        break;\n      }\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        c = y;\n        sum++;\n      }\n    }\n  }\n  i = (sum - 2 * (c - b - 1)) / 2 * (c - b + 1) - sum;\n  printf(\"%d\", i);\n  return 0;\n}\n"}
{"label": "15", "index": "28041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, aa1, bb1, aa2, bb2, a[99][99];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        aa1 = i;\n        bb1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        aa2 = i;\n        bb2 = j;\n      }\n    }\n  }\n  cout << (aa2 - aa1 - 1) * (bb2 - bb1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28042", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {1};\n  int i, j, x1, x2, y1, y2;\n  int n, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n    printf(\"\\n\");\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j != n + 1)\n      break;\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j != 0)\n      break;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28043", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, c, d, e, f, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  s = (c - e - 1) * (f - d - 1);\n  printf(\"%d\", (c - e - 1) * (d - f - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int tumor[100][100];\n  int n, i, j, a, b, sum;\n  a = 0;\n  b = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> tumor[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (tumor[i][j] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n    else if (a == 0)\n      continue;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (tumor[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n    else\n      continue;\n  }\n  sum = (a - 2) * (b - 2);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, x = 0;\n  int m[1000][1000];\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    for (b = 1; b <= n; b++) {\n      scanf(\"%d\", &m[a][b]);\n    }\n  }\n  for (c = 1; c <= n; c++) {\n    for (d = 1; d <= n; d++) {\n      if (m[c][d] == 0) {\n        for (e = d + 1; e <= n; e++) {\n          if (m[c][e] != 0) {\n            x++;\n          } else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, a1, b1, a2, b2, x, y, t;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if ((a1 == i) && (b1 == j))\n      break;\n  }\n  for (y = b1; y < n; y++) {\n    if (sz[a1][y] == 255) {\n      b2 = y - 1;\n      break;\n    }\n  }\n  for (x = a1; x < n; x++) {\n    if (sz[x][b1] == 255) {\n      a2 = x - 1;\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "28047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int count = 0;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < (n * n); j++) {\n    scanf(\"%d\", &i);\n    if (i == 0) {\n      count++;\n    }\n  }\n  count = count / 4 - 1;\n  s = count * count;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28048", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int tumour[256][256], n, i, j, x1 = -1, y1, x2 = -1, y2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &tumour[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 >= 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j, m = 0, i1, i2, j1, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        m++, i2 = i, j2 = j;\n      if (m == 1)\n        i1 = i, j1 = j;\n    }\n  }\n  int num = (i2 - i1 - 1) * (j2 - j1 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28050", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int tumour[256][256], n, i, j, x1 = -1, y1, x2 = -1, y2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &tumour[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 >= 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28051", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int x1, y1, x2, y2, k;\n  int i, j;\n  int x;\n  for (i = 1; i <= n * n; i++) {\n\n    scanf(\"%d\", &x);\n\n    if (x == 0)\n      break;\n  }\n  for (j = 1; j <= n * n - i; j++) {\n    scanf(\"%d\", &x);\n    if (x == 0) {\n      k = j + i;\n    }\n  }\n  x1 = (int)(i / n) + 1, y1 = i % n;\n  x2 = (int)(k / n) + 1, y2 = k % n;\n  int m;\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int shu[1000][1000];\n  int i, j;\n  int sth, stl, enh, enl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> shu[i][j];\n    }\n  }\n  int b = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (shu[i][j] == 0 && b == -1) {\n        sth = i;\n        stl = j;\n        b = 1;\n      }\n    }\n  }\n  int a = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (shu[i][j] == 0 && a == -1) {\n        enh = i;\n        enl = j;\n        a = 1;\n      }\n    }\n  }\n  int s;\n  s = (enh - sth - 1) * (enl - stl - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28053", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0, sum = 0, a[50][50];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        sum += 1;\n      }\n      num = (sum / 4 - 1) * (sum / 4 - 1);\n    }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28054", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a[1000][1000], x, y, p, q, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x = i;\n        y = j;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - x - 1) * (q - y - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000], i, j, s, c, k, sum[1000], s0 = 0, qqq, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum[i] = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        s0++;\n      sum[i] = sum[i] + a[j];\n    }\n    if (i == 1) {\n      qqq = sum[1];\n    } else {\n      if (sum[i - 1] > sum[i]) {\n        qqq = sum[i];\n      }\n    }\n  }\n  k = n - qqq / 255;\n  c = (s0 + 4 - 2 * k) / 2;\n  s = (c - 2) * (k - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num[1000][1000];\nint main() {\n  int k, i, j;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  int m, n, p, q, s, w;\n  w = 0;\n  for (i = 0; i < k && w == 0; i++) {\n    for (j = 0; j < k && w == 0; j++) {\n      if (num[i][j] == 0) {\n        m = i;\n        p = j;\n        w = 1;\n      }\n    }\n  }\n  n = 0;\n  q = 0;\n  for (i = m, j = p; j < k; j++) {\n    if (num[i][j] == 0) {\n      n++;\n    }\n  }\n  for (i = m, j = p; i < k; i++) {\n    if (num[i][j] == 0) {\n      q++;\n    }\n  }\n  s = (n - 2) * (q - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  int i, j;\n  int chang1[100];\n  int kuan, chang = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0, chang1[i] = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        chang1[i] = chang1[i] + 1;\n      }\n    }\n  }\n  int yo;\n  for (yo = 0; yo < n; yo++) {\n    if (chang1[yo] != 0) {\n      chang = chang1[yo];\n      break;\n    }\n  }\n  int t;\n  for (t = 0, kuan = 0; t < n; t++) {\n    if (chang1[t] == 2)\n      kuan = kuan + 1;\n  }\n  int jieguo;\n  jieguo = kuan * (chang - 2);\n  printf(\"%d\", jieguo);\n  return 0;\n}\n"}
{"label": "15", "index": "28058", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int sz[100][100];\n  int i, j;\n  int n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n\n  int a, b, c;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 255) {\n        a = j;\n        break;\n      }\n    }\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 255) {\n        b = j;\n        break;\n      }\n    }\n\n    if (a < b) {\n      c = b - a - 1;\n    } else {\n      c = 0;\n    }\n\n    s = s + c;\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28059", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int a = 0, b = 0;\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a++;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][j] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  int sum = 0;\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28060", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000], is1[4000], is2[4000], s, n;\n  int k = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n\n        is1[k] = i;\n        is2[k++] = j;\n      }\n    }\n  }\n  cout << (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  b = 0;\n  int sz[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n * n - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      sz[b] = i;\n      b++;\n    }\n  }\n  c = (sz[b - 1] + 1) % n - (sz[0] + 1) % n + 1;\n  d = (b + 2) / 2 - c + 1;\n  s = (c - 2) * (d - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], i, j, a, b, c, d, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i < n && j < n && s[i][j] == 0 && s[i + 1][j] == 0 &&\n          s[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (i > 1 && j > 1 && s[i][j] == 0 && s[i - 1][j] == 0 &&\n          s[i][j - 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  num = (c - a - 1) * (d - b - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "28063", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  int i, j;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &(sz[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  int l = b - d - 1;\n  int w = a - c - 1;\n  int s = l * w;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k, b, c, x, y;\n  b = c = 0;\n  cin >> n;\n  int sz[n][n];\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      cin >> sz[j][k];\n      if (sz[j][k] == 0) {\n        x = j;\n        y = k;\n      }\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      if (sz[j][k] == 0) {\n        b = j;\n        c = k;\n        break;\n      }\n    }\n    if (sz[b][c] == 0) {\n      break;\n    }\n  }\n  int m;\n  m = (x - b - 1) * (y - c - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[1000][1000];\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i + 1;\n        y1 = j + 1;\n        break;\n      }\n    }\n    if (x1 != 0 || y1 != 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i - 1;\n        y2 = j - 1;\n        break;\n      }\n    }\n    if (x2 != 0 || y2 != 0)\n      break;\n  }\n  area = (x2 - x1 + 1) * (y2 - y1 + 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1001][1001], s = 0;\n  int(*p)[1001], x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  scanf(\"%d \", &n);\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        if ((*(*(p + i) + j + 1) == 0) && (*(*(p + i + 1) + j) == 0)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((*(*(p + i) + j - 1) == 0) && (*(*(p + i - 1) + j) == 0)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28067", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint e[1000][1000];\nint main() {\n  int i, j, n, a, b, c = 0, d = 0, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &e[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (e[i][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (j = b; j >= 0; j--) {\n    if (e[a][j] == 0) {\n      c++;\n    } else\n      break;\n  }\n  for (i = a; i >= 0; i--) {\n    if (e[i][b] == 0) {\n      d++;\n    } else\n      break;\n  }\n  t = (c - 2) * (d - 2);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, m, b, p, q;\n  scanf(\"%d\", &n);\n  int a[1000][1000], s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < (n / 2); i++) {\n    for (j = 0; j < (n / 2); j++) {\n      if (a[i][j] == 0) {\n        m = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[i][j] == 0) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && i > m && j > b) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m + 1) * (q - b + 1) - (2 * (p + q - m - b));\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], row, col, ROW1, COL1, ROW2, COL2, sum;\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 + 1) * (COL1 - COL2 + 1);\n\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28070", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num[100][100];\n  int lefti = 0, leftj = 0, righti = 0, rightj = 0;\n  int number = 0;\n  int n = 0;\n  int i, j;\n  scanf(\"%d\", &n);\n  memset(num, -1, 10000);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && num[i + 1][j] == 0 && num[i][j + 1] == 0) {\n        lefti = i;\n        leftj = j;\n      } else if (num[i][j] == 0 && num[i - 1][j] == 0 && num[i][j - 1] == 0) {\n        righti = i;\n        rightj = j;\n      }\n    }\n  }\n  number = (rightj - leftj - 1) * (righti - lefti - 1);\n  printf(\"%d\\n\", number);\n  printf(\"%d %d %d %d\", lefti, leftj, righti, rightj);\n  return 0;\n}\n"}
{"label": "15", "index": "28071", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k1, k2, m1, m2, s;\n  int a[1001][1001];\n  k1 = 0;\n  k2 = 0;\n  m1 = 0;\n  m2 = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j - 1] != 0 && a[i - 1][j] != 0 && a[i][j + 1] == 0 &&\n          a[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n      } else if (a[i][j - 1] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n                 a[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n      }\n    }\n  s = (k2 - k1 - 1) * (m2 - m1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28072", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, z[1000][1000], i, j, k, l, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &z[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j < n)\n      break;\n  }\n  k = i;\n  l = j;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (z[i][j] == 0)\n        break;\n    }\n    if (j >= 0)\n      break;\n  }\n  k = i - k - 1;\n  l = j - l - 1;\n  s = k * l;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28073", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z, w;\n  int n, i, j, t, s, tz = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0 && tz == 0) {\n        tz++;\n        x = i;\n        y = j;\n      }\n      if (t == 0) {\n        z = i;\n        w = j;\n      }\n    }\n  printf(\"%d\", (z - x - 1) * (w - y - 1));\n}\n"}
{"label": "15", "index": "28074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  int s = 0;\n  int a, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (s == 0) {\n          x1 = i;\n          y1 = j;\n          s = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  a = (x2 - x1 - 1) * (y2 - y1 - 1);\n  if (a < 0)\n    a = -a;\n  cout << a;\n  return 0;\n}\n"}
{"label": "15", "index": "28075", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], q = 0, n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n    }\n    i += 1;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n      q++;\n    }\n  }\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "28076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {255};\n  int n, i = 0, j = 0, x1, y1, x2, y2, x, y, s;\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        x1 = x;\n        y1 = y;\n        i = 1;\n        break;\n      }\n    }\n    if (i == 1) {\n      break;\n    } else\n      ;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        x2 = x;\n        y2 = y;\n        j = 1;\n        break;\n      }\n    }\n    if (j == 1) {\n      break;\n    } else\n      ;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, mian[105][105];\n  int i, j, i1, j1, i2, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> mian[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (mian[i][j] == 0 && mian[i + 1][j] == 0 && mian[i][j + 1] == 0) {\n        i1 = i;\n        j1 = j;\n      } else {\n        if (mian[i][j] == 0 && mian[i - 1][j] == 0 && mian[i][j - 1] == 0) {\n          i2 = i;\n          j2 = j;\n        }\n      }\n    }\n  }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28078", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1001], i, p, j, s = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        count++;\n      if (count == 1 && a[j] != 0) {\n        s++;\n      }\n    }\n  }\n  printf(\"\\n%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28079", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c = 0, q = 0, t;\n  int m[1000] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        m[i]++;\n        c++;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    if (m[i] != 0)\n      q++;\n  }\n  printf(\"%d\", (q - 2) * (c - 2 * q) / 2);\n}\n"}
{"label": "15", "index": "28080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, t1, t2, m1, m2, s, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255 &&\n          a[i][j + 1] == 0)\n        t1 = i, m1 = j;\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i][j + 1] == 255 &&\n          a[i + 1][j] == 255)\n        t2 = i, m2 = j;\n    }\n  }\n\n  s = (t2 - t1 + 1) * (m2 - m1 + 1);\n  num = s - 2 * (t2 + m2 - t1 - m1);\n  cout << num;\n}\n"}
{"label": "15", "index": "28081", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, sum, array[30][30];\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  i = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (array[i][j] == 0 && array[i][j - 1] != 0 && array[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && array[i][j + 1] != 0 && array[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  sum = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sz[100][100], r, s, p, q;\n  cin >> n;\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      cin >> (sz[row][col]);\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    for (int b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        r = a;\n        s = b;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (int c = n - 1; c >= 0; c--) {\n    for (int d = n - 1; d >= 0; d--) {\n      if (sz[c][d] == 0) {\n        p = c;\n        q = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  int e = (r - p - 1) * (q - s - 1);\n\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "28083", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int photo[300][300] = {1};\n  int n;\n  int i, j;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      int t;\n      cin >> t;\n      if (t == 255)\n        t = 1;\n      photo[i][j] = t;\n    }\n  }\n  int found = 0;\n  int Lx, Ly, Bx, By;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (photo[i][j] == 0) {\n        Lx = i;\n        Ly = j;\n        found = 1;\n        break;\n      }\n    }\n    if (found) {\n      break;\n    }\n  }\n  found = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (photo[i][j] == 0) {\n        Bx = i;\n        By = j;\n        found = 1;\n        break;\n      }\n      if (found) {\n        break;\n      }\n    }\n  }\n  int w = Bx - Lx - 1;\n  int h = By - Ly - 1;\n  printf(\"%d\\n\", w * h);\n  return 0;\n}\n"}
{"label": "15", "index": "28084", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int an[100][100], i, j, n, s, a, b, flag = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> an[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (a = n - 1; a >= 0; a--) {\n    for (b = n - 1; b >= 0; b--) {\n      if (an[a][b] == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n\n  s = (b - j - 1) * (a - i - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, j, n, a1 = -1, a2 = -1, b1, b2, result;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a1 != -1) {\n      break;\n    }\n  }\n  for (i = n - 1; i > -1; i--) {\n    for (j = n - 1; j > -1; j--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (a2 != -1) {\n      break;\n    }\n  }\n  result = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << result;\n  return 0;\n}\n"}
{"label": "15", "index": "28086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        break;\n      }\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 + 1) * (COL1 - COL2 + 1);\n\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, i, j, h, k, m, l, a = 0, b = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &p[i][j]);\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0)\n        a++;\n    }\n    if (a != 0)\n      break;\n  }\n  for (m = 0; m < n; m++) {\n    for (l = 0; l < n; l++) {\n      if (p[l][m] == 0)\n        b++;\n    }\n    if (b != 0)\n      break;\n  }\n  sum = (a - 2) * (b - 2);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[100][100], i, j, a = 0, b = 0, c = 0, d = 0, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i][j - 1] == 255 && m[i][j + 1] == 0)\n        a = j;\n      if (j == n - 1 && m[i][j] == 0)\n        b = j;\n      else if (j != n - 1 && m[i][j] == 0 && m[i][j + 1] == 255 &&\n               m[i][j - 1] == 0)\n        b = j;\n      if (i == 0 && m[i][j] == 0)\n        c = i;\n      else if (i != 0 && m[i][j] == 0 && m[i - 1][j] == 255 && m[i + 1][j] == 0)\n        c = i;\n      if (i == n - 1 && m[i][j] == 0)\n        d = i;\n      else if (i != n - 1 && m[i][j] == 0 && m[i + 1][j] == 255 &&\n               m[i - 1][j] == 0)\n        d = i;\n    }\n\n  x = b - a - 1;\n  y = d - c - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  int x, y, r1, s1, r2, s2, N;\n  for (x = 0; x <= n - 1; x++) {\n    for (y = 0; y <= n - 1; y++) {\n      scanf(\"%d\", &a[x][y]);\n      if (a[x][y] == 0) {\n        r2 = x;\n        s2 = y;\n      }\n    }\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        r1 = x;\n        s1 = y;\n      }\n    }\n  }\n  N = (r2 - r1 + 1) * (s2 - s1 + 1) - (r2 - r1 + s2 - s1) * 2;\n  printf(\"%d\\n\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "28090", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, starti, startj, endi, endj;\n  int a[10][10];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  starti = -1;\n  startj = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        starti = i;\n        startj = j;\n        break;\n      }\n    if (starti >= 0)\n      break;\n  }\n  endi = starti;\n  endj = startj;\n  while (a[starti][endj + 1] == 0)\n    endj++;\n  while (a[endi + 1][startj] == 0)\n    endi++;\n  printf(\"%d\", (endi - starti - 1) * (endj - startj - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int p[100][100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n\n  int e, b, h, k, kk = 0;\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0) {\n        e = h;\n        b = k;\n        kk = 1;\n        break;\n      }\n    }\n    if (kk == 1) {\n      break;\n    }\n  }\n  int c, d, l, m;\n  for (l = 0; l < n; l++) {\n    for (m = 0; m < n; m++) {\n      if (p[l][m] == 0) {\n        c = l;\n        d = m;\n      }\n    }\n  }\n  int s;\n  s = (c - e - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0)\n      break;\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int c = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255)\n        c++;\n    }\n  }\n  cout << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char n, a[1000][1000], p = 0, q, r = 0, i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n\n      cin >> a[i][j];\n      if (a[i][j] == 0 && a[i][j - 1] == 0)\n        p = p + 1;\n      if (a[i][j] == 0)\n        q = q + 1;\n    }\n    if (q >= 1)\n      r = r + 1;\n  }\n  s = (p / 2 - 1) * (r - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int n, m;\n  int sum, num;\n  int lon, wid;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(c[i][j]));\n  }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0)\n        sum += 1;\n\n      if (sum > 2)\n        lon = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      if (c[i][j] == 0)\n        num += 1;\n      if (num > 2)\n        wid = num;\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "15", "index": "28095", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int photo[300][300] = {1};\n  int n;\n  int i, j;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      int t;\n      cin >> t;\n      if (t == 255)\n        t = 1;\n      photo[i][j] = t;\n    }\n  }\n  int found = 0;\n  int Lx, Ly, Bx, By;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (photo[i][j] == 0) {\n        Lx = i;\n        Ly = j;\n        found = 1;\n        break;\n      }\n    }\n    if (found)\n      break;\n  }\n  found = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (photo[i][j] == 0) {\n        Bx = i;\n        By = j;\n        found = 1;\n        break;\n      }\n      if (found) {\n        break;\n      }\n    }\n  }\n  int w = Bx - Lx - 1;\n  int h = By - Ly - 1;\n  cout << w * h << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, k, x, y, z, w, s;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n; k++) {\n      if (a[i][k - 1] != 0 && a[i][k] == 0 && a[i][k + 1] == 0 &&\n          a[i + 1][k] == 0) {\n        x = i;\n        y = k;\n      }\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (a[i][k - 1] == 0 && a[i][k] == 0 && a[i][k + 1] != 0 &&\n          a[i - 1][k] == 0) {\n        z = i;\n        w = k;\n      }\n    }\n  }\n\n  s = (z - 1 - x) * (w - 1 - y);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, sz[1000][1000], a, b, c, d, e = 1, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n\n      if (sz[i][j] == 0 && e == 1) {\n        a = i;\n        b = j;\n        e = 0;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, n[1000][1000], i, p, x1, y1, x2, y2, s;\n  i = 0;\n  p = 0;\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    for (p = 0; p < a; p++) {\n      scanf(\"%d\", &(n[i][p]));\n    }\n  }\n  if ((n[0][0] == 0) && (n[1][0] == 0) && (n[0][1]) == 0) {\n    x1 = 0;\n    y1 = 0;\n  }\n  if ((n[a - 1][a - 1] == 0 && (n[a - 2][a - 1] == 0) &&\n       (n[a - 1][a - 2]) == 0)) {\n    x2 = a - 1;\n    y2 = a - 1;\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (p = 1; p < a - 1; p++) {\n      if ((n[i][p] == 0) && (n[i + 1][p] == 0) && (n[i][p + 1]) == 0) {\n        x1 = i;\n        y1 = p;\n      }\n      if ((n[i][p] == 0) && (n[i - 1][p] == 0) && (n[i][p - 1]) == 0) {\n        x2 = i;\n        y2 = p;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x1, y1, x2, y2, a[1000], t;\n  x1 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0) {\n        if (x1 == -1) {\n          x1 = i;\n          y1 = j;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  t = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[10][10];\n  int N;\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c = 0, d;\n  int count0;\n  int q;\n  count0 = 0;\n  c = 0;\n  d = 0;\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n\n      if (s[i][j] == 0) {\n        q++;\n        count0++;\n      }\n    }\n    if (q > 1) {\n      d++;\n    }\n    if (q > c) {\n      c = q;\n    }\n  }\n  N = d * c - count0;\n  printf(\"%d\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "28101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a = 0, b = 0, n, l, w, s;\n  int i, j;\n  int f[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      cin >> f[i][j];\n      if (f[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      l = a;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (f[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 2)\n      w = b;\n  }\n  s = (l - 2) * (w - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28102", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c[100][100];\n  int a1, a2, b1, b2, a, b, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &c[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (c[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  a = a1 - a2 - 1;\n  b = b1 - b2 - 1;\n  s = a * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, p = 0, q = 0;\n  int mianji;\n  scanf(\"%d\\n\", &n);\n  int shu[n];\n  int ge[n];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &shu[j]);\n      if (shu[j] == 0)\n        k++;\n    }\n    ge[i] = k;\n    if (ge[i] > p)\n      p = ge[i];\n    for (j = 0; j < n; j++) {\n      if (shu[j] == 0) {\n        q++;\n        break;\n      }\n    }\n  }\n  mianji = (p - 2) * (q - 2);\n  cout << mianji << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  int left0, right0;\n  int left1, right1;\n  left0 = -1;\n  right0 = -1;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if ((k == 0) && (left0 == -1) && (right0 == -1)) {\n        left0 = i;\n        right0 = j;\n      }\n      if (k == 0) {\n        left1 = i;\n        right1 = j;\n      }\n    }\n  }\n  int t = 0;\n  if (((left1 - left0) > 1) && ((right1 - right0) > 1)) {\n    m = (left1 - left0 - 1) * (right1 - right0 - 1);\n    printf(\"%d\\n\", m);\n  } else\n    printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, c;\n  cin >> n;\n  int count = 0;\n  int f[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &f[i][j]);\n      if (f[i][j] == 0)\n        count = count + 1;\n    }\n    scanf(\"\\n\");\n  }\n  c = (((count + 4) / 4) - 2) * (((count + 4) / 4) - 2);\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "28106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[100][100], i, j, a = -1, b = -1, c, d, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0 && b >= 0)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  n = (c - a - 1) * (d - b - 1);\n  cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  int n, m;\n  int sum, num;\n  int lon, wid;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(c[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0)\n        sum += 1;\n\n      if (sum > 2)\n        lon = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      if (c[i][j] == 0)\n        num += 1;\n      if (num > 2)\n        wid = num;\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  printf(\"%d\\n\", m);\n}\n"}
{"label": "15", "index": "28108", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, x, y, o, p, q = 0, c, d;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        x = i;\n        y = j;\n      } else {\n        if (a[i][j] == 0 && a[i][j + 1] == 255 && a[i + 1][j] == 255) {\n          o = i;\n          p = j;\n        }\n      }\n    }\n  }\n  c = o - x - 1;\n  d = p - y - 1;\n  q = c * d;\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "28109", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k = 0, s, n;\n  int imin, imax, jmax;\n  cin >> n;\n  imin = 100;\n  imax = 0;\n  jmax = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        k++;\n        if (i < imin)\n          imin = i;\n        if (i > imax)\n          imax = i;\n        if (j > jmax) {\n          jmax = j;\n        }\n      }\n    }\n\n  s = (imax - imin + 1) * (jmax - imin + 1);\n  printf(\"%d\\n\", s - k);\n  return 0;\n}\n"}
{"label": "15", "index": "28110", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int e, f = 0, g[1000];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  while (i < n) {\n    int k = 0;\n    while (k < n) {\n      scanf(\"%d\", &e);\n      if (e == 0) {\n        f++;\n      }\n      k++;\n    }\n\n    g[i] = f;\n    f = 0;\n    i++;\n  }\n\n  int m = 0, x, y;\n  int j = 0;\n  while (j < n) {\n    if (g[j] > m) {\n      m = g[j];\n    }\n    if (g[j] == 0 && g[j + 1] != 0) {\n      x = j;\n    }\n    if (g[j] != 0 && g[j + 1] == 0) {\n      y = j;\n    }\n    j++;\n  }\n\n  int d, sum;\n  d = y - x;\n  sum = (m - 2) * (d - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000];\n\nint main() {\n  int n, i, j, i1, j1, i2, j2, flag = 1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n      if (flag && *(*(a + i) + j) == 0) {\n        i1 = i;\n        j1 = j;\n        flag = 0;\n      }\n    }\n  }\n  for (i = i1; i < n; i++) {\n    if (*(*(a + i) + j1) != 0) {\n      i2 = i - 1;\n      break;\n    }\n  }\n  if (i == n)\n    i2 = i - 1;\n  for (j = j1; j < n; j++) {\n    if (*(*(a + i2) + j) != 0) {\n      j2 = j - 1;\n      break;\n    }\n  }\n  if (j == n)\n    j2 = j - 1;\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28112", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {255};\n  int n, i = 0, j = 0, x1, y1, x2, y2, x, y, s;\n  scanf(\"%d \", &n);\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      cin >> a[x][y];\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        x1 = x;\n        y1 = y;\n        i = 1;\n        break;\n      }\n    }\n    if (i == 1) {\n      break;\n    } else\n      ;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--) {\n      if (a[x][y] == 0) {\n        x2 = x;\n        y2 = y;\n        j = 1;\n        break;\n      }\n    }\n    if (j == 1) {\n      break;\n    } else\n      ;\n  }\n  s = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sz[1000][1000];\n\nint main() {\n  int i = 0, n, s, rrr[5000], ccc[5000];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n      if (sz[row][col] == 0) {\n        rrr[i] = row;\n        ccc[i] = col;\n        i++;\n      }\n    }\n  }\n  s = (rrr[i - 1] - rrr[0] - 1) * (ccc[i - 1] - ccc[0] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28114", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m;\n  int a = 0, c = 0, b = 0, d = 0;\n  int s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    if (s[a][b] == 0)\n      break;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (s[i][j] == 0 && c <= i && d <= j) {\n        c = i;\n        d = j;\n      }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int c[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++)\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &c[i][j]);\n    }\n  i = 0;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (c[i][j] == 0) {\n        if (c[i + 1][j] == 0 && c[i][j + 1] == 0) {\n          a1 = i;\n          b1 = j;\n        }\n        if (c[i - 1][j] == 0 && c[i][j - 1] == 0) {\n          a2 = i;\n          b2 = j;\n        }\n      }\n    }\n  }\n  cout << (a2 - a1 - 1) * (b2 - b1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28116", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int Row = 100, Col = 100;\n  int sz[Row][Col];\n  int n;\n  int row1;\n  int row2;\n  int i;\n  int col1;\n  int col2;\n  int k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> sz[i][k];\n    }\n  }\n  int judge = 0;\n  for (i = 0; judge == 0 && i < n; i++) {\n    for (k = 0; judge == 0 && k < n; k++) {\n      if (sz[i][k] == 0) {\n        judge = 1;\n\n        row1 = i;\n\n        col1 = k;\n      }\n    }\n  }\n  for (i = n - 1; judge == 1 && i > 0; i--) {\n    for (k = n - 1; judge == 1 && k > 0; k--) {\n      if (sz[i][k] == 0) {\n\n        row2 = i;\n\n        col2 = k;\n        judge = 0;\n      }\n    }\n  }\n  int s;\n  s = (row2 - row1 - 1) * (col2 - col1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  cin >> n;\n  int a[100][100];\n  int *q = NULL;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      q = (*(a + i) + j);\n      if (*q == 0) {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag)\n      break;\n  }\n  int len = 1, wid = 1;\n  int j1 = j;\n  for (j = j + 1; j <= n; j++) {\n    q = (*(a + i) + j);\n    if (*q == 0)\n      len++;\n    else\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    q = (*(a + i) + j1);\n    if (*q == 0)\n      wid++;\n    else\n      break;\n  }\n\n  printf(\"%d\", (len - 2) * (wid - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, i, j, b, t, q, sum;\n  scanf(\"%d\", &n);\n  for (i = 0, t = 0; i <= (n - 1); i++) {\n    for (j = 0, sum = 0; j <= (n - 1); j++) {\n      cin >> a[j];\n      sum = sum + a[j];\n    }\n    if (sum == (n * 255))\n      continue;\n    b = (n * 255 - sum) / 255;\n    t = t + 1;\n  }\n  q = (t - 2) * (b - 2);\n  cout << q;\n  return 0;\n}\n"}
{"label": "15", "index": "28119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a = -1, b = -1, c, d, x, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x;\n      if (x == 0) {\n        c = i;\n        d = j;\n        if ((a == -1) && (b == -1)) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a, x, y;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      x = i;\n      break;\n    }\n  }\n  for (i = x + 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0)\n      y = i;\n  }\n  printf(\"%d\", (y / n - x / n - 1) * (y % n - x % n - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100];\n  int row, col, a = 0, b = 0, c = 0, d = 0, s = 0, p = 0;\n  int i, j, k, l;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p != 1) {\n      for (j = 0; j < n; j++) {\n        if (sz[j][i] == 0) {\n          a = j;\n          b = i;\n          p = 1;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  for (k = n - 1; k >= 0; k--) {\n    if (p != 0) {\n      for (l = n - 1; l >= 0; l--) {\n        if (sz[l][k] == 0) {\n          c = l;\n          d = k;\n          p = 0;\n          break;\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n;\n\n  scanf(\"%d\", &n);\n\n  int x, y, a, b, sz[100][100], tag, tag1 = 0;\n\n  for (x = 0; x < n; x++) {\n\n    tag = 0;\n\n    for (y = 0; y < n; y++) {\n\n      scanf(\"%d\", &sz[x][y]);\n\n      if (sz[x][y] == 0) {\n\n        tag++;\n\n        tag1++;\n      }\n    }\n\n    if (tag1 == tag) {\n\n      a = tag - 2;\n    }\n  }\n\n  b = (tag1 - 2 * (a + 2)) / 2;\n\n  cout << a * b;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  int *p;\n  int flag = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n;) {\n    for (p = a; p < a + n;) {\n      scanf(\"%d\", p);\n      if (*p != 0) {\n        p++;\n        continue;\n      }\n      flag = 1;\n      break;\n    }\n    if (flag == 0) {\n      i++;\n      continue;\n    }\n    a1 = p - a;\n    b1 = i;\n    for (p = p + 1; p < a + n; p++) {\n      scanf(\"%d\", p);\n      if (*p != 0)\n        break;\n    }\n    a2 = p - a - 1;\n    break;\n  }\n  for (p = p + 1; p < a + n; p++)\n    scanf(\"%d\", p);\n  do {\n    i++;\n    for (p = a; p < a + n; p++)\n      scanf(\"%d\", p);\n  } while (a[a1] == 0);\n  b2 = i - 1;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  for (j = 1; j <= n * (n - 1 - i); j++)\n    scanf(\"%d\", &a[0]);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, a1, b1, a2, b2, x, y, t;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if ((a1 == i) && (b1 == j))\n      break;\n  }\n  for (y = b1; y < n; y++) {\n    if (sz[a1][y] == 255) {\n      b2 = y - 1;\n      break;\n    }\n  }\n  for (x = a1; x < n; x++) {\n    if (sz[x][b1] == 255) {\n      a2 = x - 1;\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28125", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, j1, i2, j2, i, j, t, a[100][100];\n  cin >> n;\n  if (n == 9)\n    printf(\"%d\", n);\n  else if (n == 6)\n    printf(\"2\");\n\n  else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (j = n - 1; j >= 0; j--) {\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    t = (i2 - i1 - 1) * (j2 - j1 - 1);\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "15", "index": "28126", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, n, a[100][100], i, j, x1, x2, num1, num2, y1, y2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    if (j >= 0)\n      break;\n  }\n  num1 = x2 - x1 + 1;\n  num2 = y2 - y1 + 1;\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j, m = 0, i1, i2, j1, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        m++, i2 = i, j2 = j;\n      if (m == 1)\n        i1 = i, j1 = j;\n    }\n  }\n  int num = (i2 - i1 - 1) * (j2 - j1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "28128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n\n  scanf(\"%d\", &n);\n\n  int x, y, a, b, sz[100][100], tag, tag1 = 0;\n\n  for (x = 0; x < n; x++) {\n\n    tag = 0;\n\n    for (y = 0; y < n; y++) {\n\n      scanf(\"%d\", &sz[x][y]);\n\n      if (sz[x][y] == 0) {\n\n        tag++;\n\n        tag1++;\n      }\n    }\n\n    if (tag1 == tag) {\n\n      a = tag - 2;\n    }\n  }\n\n  b = (tag1 - 2 * (a + 2)) / 2;\n\n  cout << a * b;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], h1, h2, l1, l2, c = 0, b = 0;\n  int n, i, j, h, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (a[h][k] == 0) {\n        h1 = h;\n        l1 = k;\n        c = 1;\n        break;\n      }\n    }\n    if (c == 1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        b = 1;\n        break;\n      }\n    }\n    if (b == 1)\n      break;\n  }\n  cout << (h2 - h1 - 1) * (l2 - l1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28130", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, x1, x2, y1, y2;\n  int n, t;\n  int area, statue = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (statue == 0) {\n          x1 = i;\n          y1 = j;\n          statue++;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n}\n"}
{"label": "15", "index": "28131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, s, i, j;\n  int x[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 0) {\n      break;\n    }\n  }\n  s = (a - 2) * (b - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n[1000][1000], num, i, j, p[200], k = 0;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  int w = 0;\n  for (i = 0; i < (num - 1); i++) {\n    for (j = 0; j < (num - 1); j++) {\n      if (n[i][j] == 0 && n[i][j + 1] == 0)\n        break;\n      else if (n[i][j] == 0 && n[i][j + 1] != 0) {\n        p[w] = j;\n        w++;\n      }\n    }\n  }\n  for (i = 0; i < w - 1; i = i + 2) {\n    k = k + (p[i + 1] - p[i] - 1);\n  }\n  printf(\"%d\", k);\n}\n"}
{"label": "15", "index": "28133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  int length, width, x = 0, y = 0;\n  for (length = j; a[i][length] == 0; length++) {\n    x++;\n  }\n  for (width = i; a[width][j] == 0; width++) {\n    y++;\n  }\n  int p;\n  p = (x - 2) * (y - 2);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "28135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int row, col, n, sum, a, b, c, d, s;\n  long pic[100][100];\n  scanf(\"%d \", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &pic[row][col]);\n    }\n  }\n\n  sum = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((pic[row][col] == 0) && (pic[row - 1][col - 1] == 255) &&\n          (pic[row - 1][col] == 255) && (pic[row][col - 1] == 255)) {\n        a = row;\n        b = col;\n      }\n    }\n  }\n\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if ((pic[row][col] == 0) && (pic[row + 1][col + 1] == 255) &&\n          (pic[row + 1][col] == 255) && (pic[row][col + 1] == 255)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, s, i, j;\n  int x[100][100];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    a = 0;\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n    if (a > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    b = 0;\n    for (i = 0; i < n; i++) {\n      if (x[i][j] == 255)\n        continue;\n      if (x[i][j] == 0)\n        b = b + 1;\n    }\n    if (b > 0)\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  cout << s;\n}\n"}
{"label": "15", "index": "28137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j;\n  int x1, y1, x2, y2;\n  int s = 0;\n  int a, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (s == 0) {\n          x1 = i;\n          y1 = j;\n          s = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  a = (x2 - x1 - 1) * (y2 - y1 - 1);\n  if (a < 0)\n    a = -a;\n  printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "15", "index": "28138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n\n  int A[1000][1000], n, i, j;\n  int a1, a2, b1, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &A[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (A[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (A[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (A[a2][b2] == 0) {\n      break;\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int a = 0, b = 0;\n  int n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> p[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        a++;\n      }\n    }\n    if (a != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (p[i][j] == 0) {\n        b++;\n      }\n    }\n    if (b != 0)\n      break;\n  }\n  int sum = 0;\n  sum = (a - 2) * (b - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, t1, t2, t3, t4, s;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (c[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        goto ask;\n      }\n    }\n  }\nask:\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if (c[i][j] == 0) {\n        t3 = i;\n        t4 = j;\n        goto que;\n      }\n    }\n  }\nque:\n  s = (t4 - t2 - 1) * (t3 - t1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1001], i, p, j, s = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        count++;\n      if (count == 1 && a[j] != 0)\n        s++;\n    }\n  }\n  printf(\"\\n%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28142", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\\n\", &n);\n  int a[n], s = 0, m = 0, b;\n  for (i = 0; i < n; i++) {\n    cin >> a[0];\n    if (a[0] == 0) {\n      s = 1;\n    } else {\n      s = 0;\n    }\n    for (j = 1; j < n; j++) {\n      cin >> a[j];\n      if (a[j] == 0) {\n        s++;\n      }\n    }\n    if (s == 2) {\n      m++;\n    }\n    scanf(\"\\n\");\n  }\n  b = m * m;\n  printf(\"%d\\n\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "28143", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[500][500], x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        x++;\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0)\n        y++;\n    }\n    if (y != 0)\n      break;\n  }\n  printf(\"%d\\n\", (x - 2) * (y - 2));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n\n  scanf(\"%d\", &n);\n\n  int x, y, a, b, sz[100][100], tag, tag1 = 0;\n\n  for (x = 0; x < n; x++) {\n\n    tag = 0;\n\n    for (y = 0; y < n; y++) {\n\n      scanf(\"%d\", &sz[x][y]);\n\n      if (sz[x][y] == 0) {\n\n        tag++;\n\n        tag1++;\n      }\n    }\n\n    if (tag1 == tag) {\n\n      a = tag - 2;\n    }\n  }\n\n  b = (tag1 - 2 * (a + 2)) / 2;\n\n  printf(\"%d\", a * b);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000], i, j, s, c, k, sum[1000], s0 = 0, qqq, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum[i] = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0)\n        s0++;\n      sum[i] = sum[i] + a[j];\n    }\n    if (i == 1)\n      qqq = sum[1];\n    else {\n      if (sum[i - 1] > sum[i]) {\n        qqq = sum[i];\n      }\n    }\n  }\n  k = n - qqq / 255;\n  c = (s0 + 4 - 2 * k) / 2;\n  s = (c - 2) * (k - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, C[1000][1000];\n  int n, s;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> (C[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++) {\n      if (C[i][j] == 0)\n        sum = sum + 1;\n\n      if (sum > 2)\n        a = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int um = 0;\n    for (i = 0; i < n; i++) {\n      if (C[i][j] == 0)\n        um = um + 1;\n\n      if (um > 2)\n        b = um;\n    }\n  }\n\n  s = (a - 2) * (b - 2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28147", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int SZ[100][100];\n  int n, m1, n1, m2, n2, mj;\n  scanf(\"%d\", &n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> SZ[i][j];\n  }\n  for (int p = 0; p < n; p++) {\n    for (int q = 0; q < n; q++) {\n      if (SZ[p][q] == 0) {\n        n1 = p;\n        m1 = q;\n        goto sen1;\n      }\n    }\n  }\nsen1:\n  for (int x = n - 1; x >= 0; x--) {\n    for (int y = n - 1; y >= 0; y--) {\n      if (SZ[x][y] == 0) {\n        n2 = x;\n        m2 = y;\n        goto sen2;\n      }\n    }\n  }\nsen2:\n  mj = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << mj;\n  return 0;\n}\n"}
{"label": "15", "index": "28148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, k;\n  scanf(\"%d\", &n);\n  c = 0;\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (j < n)\n        scanf(\" \");\n      if (k == 0)\n        a = a + 1;\n    }\n    if (a > 2)\n      b = a;\n    if (a >= 1)\n      c = c + 1;\n  }\n  d = (b - 2) * (c - 2);\n  cout << d;\n  return 0;\n}\n"}
{"label": "15", "index": "28149", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int tu[100][100] = {0};\n  int i, n, k, count = 0, m = 0, first = 0, l = 0, h = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> tu[i][k];\n      if (tu[i][k] == 0 && first == 0) {\n        l++;\n      }\n    }\n    if (l > 0) {\n      first = 1;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (tu[i][k] == 0) {\n        count++;\n      }\n    }\n  }\n  h = (count - 2 * l) / 2;\n  m = (l - 2) * h;\n  cout << m << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, t = 0, flag, line = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        t++;\n        flag = 1;\n      }\n    }\n    if (flag == 1)\n      line++;\n  }\n  cout << (line - 2) * (t - line * 2) / 2;\n  return 0;\n}\n"}
{"label": "15", "index": "28151", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int shu[1000][1000];\n  int i, j;\n  int sth, stl, enh, enl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> shu[i][j];\n    }\n  }\n  int b = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (shu[i][j] == 0 && b == -1) {\n        sth = i;\n        stl = j;\n        b = 1;\n      }\n    }\n  }\n  int a = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (shu[i][j] == 0 && a == -1) {\n        enh = i;\n        enl = j;\n        a = 1;\n      }\n    }\n  }\n  int s;\n  s = (enh - sth - 1) * (enl - stl - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * ((m - (i - 2)) / 2 - 1);\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28153", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, num = 0, sum = 0, a[50][50];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0)\n        sum += 1;\n      num = (sum / 4 - 1) * (sum / 4 - 1);\n    }\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, h, l, s, i, j, p, sum, m;\n  scanf(\"%d\", &n);\n  sum = 0;\n  j = 0;\n  for (h = 1; h <= n; h++) {\n    i = 0;\n    for (l = 1; l <= n; l++) {\n      scanf(\"%d\", &s);\n      if (s == 0)\n        i++;\n    }\n    sum = sum + i;\n    if (i != 0)\n      j++;\n  }\n  if (j <= 2 || sum <= 2 * j)\n    printf(\"0\");\n  else {\n    p = (sum - 2 * j) / 2;\n    m = p * (j - 2);\n    printf(\"%d\", m);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28155", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i = 0, j;\n  int N, k, p;\n  scanf(\"%d\", &n);\n  N = n * n;\n  for (k = 0; k < N; k++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      i++;\n  }\n  j = ((i / 4) - 1) * ((i / 4) - 1);\n  printf(\"%d\\n\", j);\n}\n"}
{"label": "15", "index": "28156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, y, c, b, sum = 0, i, a[10][10];\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      scanf(\"%d\", &a[x][y]);\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        b = y;\n        break;\n      }\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        c = y;\n        sum++;\n      }\n    }\n  }\n  i = (sum - 2 * (c - b - 1)) / 2 * (c - b + 1) - sum;\n  printf(\"%d\", i);\n  return 0;\n}\n"}
{"label": "15", "index": "28157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i - 1][j] != 0) && (sz[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++)\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n        break;\n    if (a[i][j - 1] == 0 && a[i - 1][j] == 0)\n      break;\n  }\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++)\n      if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n        break;\n    if (a[k][l + 1] == 255 && a[k + 1][l] == 255 && a[k][l] == 0)\n      break;\n  }\n  printf(\"%d\", (k - i) * (l - j));\n}\n"}
{"label": "15", "index": "28159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int t, i, j, x = 0, b = 0, m = 0, n = 0, s, s1, s2;\n\n  scanf(\"%d\", &t);\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (a[i][j] == 0) {\n        x = i;\n        b = j;\n        break;\n      }\n    }\n    if (a[x][b] == 0)\n      break;\n  }\n  for (i = t - 1; i >= 0; i--) {\n    for (j = t - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        m = i;\n        n = j;\n\n        break;\n      }\n    }\n    if (a[m][n] == 0)\n      break;\n  }\n  s1 = m - x - 1;\n  s2 = n - b - 1;\n  s = s1 * s2;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], num = 0, v, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        for (k = j;; k++) {\n          if (a[i][k] != 0) {\n            break;\n          }\n        }\n        for (v = i;; v++) {\n          if (a[v][j] != 0) {\n            break;\n          }\n        }\n        num = (k - j - 2) * (v - i - 2);\n        break;\n      }\n      if (num != 0)\n        break;\n    }\n  }\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], m1, n1, m2, n2, t = 0, S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == a[i][j + 1] && a[i][j] == a[i + 1][j] && a[i][j] == 0) {\n        m1 = i;\n        n1 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  t = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == a[i][j - 1] && a[i][j] == a[i - 1][j] && a[i][j] == 0) {\n        m2 = i;\n        n2 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  S = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int shumu[1000][1000];\n  int b, n, a, d, e, f;\n  int m;\n  int i;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &shumu[m][i]);\n  }\n  for (m = 1; m < n - 1; m++) {\n    for (i = 1; i < n - 1; i++) {\n      if (shumu[m][i] == 0) {\n        a = m;\n        d = i;\n      }\n    }\n  }\n  for (m = n - 1; m > 0; m--) {\n    for (i = n - 1; i > 0; i--) {\n      if (shumu[m][i] == 0) {\n        e = m;\n        f = i;\n      }\n    }\n  }\n  b = (e - a + 1) * (f - d + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "28163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, left_i = -1, left_j, right_i, right_j, num, temp;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        num++;\n        if (num == 1 && left_i < 0) {\n          left_i = i;\n          left_j = j;\n        } else {\n          right_i = i;\n          right_j = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\\n\", (right_i - left_i - 1) * (right_j - left_i - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i1, j1, i2, j2, i, j, t, a[100][100];\n  scanf(\"%d\", &n);\n  if (n == 9)\n    printf(\"%d\", n);\n  else if (n == 6)\n    printf(\"2\");\n  \n  else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (j = n - 1; j >= 0; j--) {\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      }\n      if (a[i][j] == 0)\n        break;\n    }\n    t = (i2 - i1 - 1) * (j2 - j1 - 1);\n    printf(\"%d\\n\", t);\n  }\n}\n"}
{"label": "15", "index": "28165", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, h1, l1, h2, l2;\n  int a[1000][1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        h1 = i;\n        l1 = j;\n        break;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i;\n        l2 = j;\n        break;\n        break;\n      }\n    }\n  }\n  cout << (fabs(h2 - h1) - 1) * (fabs(l2 - l1) - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, count = 0, n1, n2, i;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    cin >> p;\n    if (p == 0 && count == 0) {\n      n1 = i;\n      count = 1;\n    }\n    if (p == 0 && count != 0) {\n      n2 = i;\n    }\n  }\n  cout << (n2 / n - n1 / n - 1) * (n2 % n - n1 % n - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28167", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n\n  int i, j;\n  int t, t1, t2;\n  int a[10000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[0] = 255;\n      scanf(\"%d\", &a[j + 1]);\n      if (a[j] == 0 && a[j - 1] == 255) {\n\n        t1 = j;\n      }\n\n      if (a[j - 1] == 0 && a[j] == 255) {\n        t2 = j - 1;\n      }\n    }\n  }\n  cout << (t2 - t1 - 1) * (t2 - t1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100];\n  int row, col, a = 0, b = 0, c = 0, d = 0, s = 0, p = 0;\n  int i, j, k, l;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p != 1) {\n      for (j = 0; j < n; j++) {\n        if (sz[j][i] == 0) {\n          a = j;\n          b = i;\n          p = 1;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  for (k = n - 1; k >= 0; k--) {\n    if (p != 0) {\n      for (l = n - 1; l >= 0; l--) {\n        if (sz[l][k] == 0) {\n          c = l;\n          d = k;\n          p = 0;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k1, k2, m1, m2, s;\n  int a[1001][1001];\n  k1 = 0;\n  k2 = 0;\n  m1 = 0;\n  m2 = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j - 1] != 0 && a[i - 1][j] != 0 && a[i][j + 1] == 0 &&\n          a[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n      } else if (a[i][j - 1] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n                 a[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n      }\n    }\n  s = (k2 - k1 - 1) * (m2 - m1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum[1000][1000];\n  int n, i, j, s = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sum[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == 0) {\n        s++;\n      }\n    }\n    if (s > 2) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i][j] == 0) {\n        t++;\n      }\n    }\n    if (t > 2) {\n      break;\n    }\n  }\n  printf(\"%d\", s * t - (2 * s + 2 * t - 4));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28171", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  x1 = -1;\n  y1 = -1;\n  x2 = -1;\n  y2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 == -1 && y1 == -1) {\n          x1 = j;\n          y1 = i;\n        }\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n  if (x1 == x2 || y1 == y2)\n    printf(\"0\");\n  else\n    printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int sz[100][100];\n\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      cin >> sz[row][col];\n    }\n  }\n\n  int a1 = 100, b1 = 100, a2 = 0, b2 = 0;\n\n  for (int r = 0; r < n; r++) {\n    for (int c = 0; c < n; c++) {\n      if (sz[r][c] == 0) {\n        a1 = r;\n        b1 = c;\n        break;\n      }\n    }\n    if (a1 != 100 || b1 != 100) {\n      break;\n    }\n  }\n\n  for (int rr = n - 1; rr >= 0; rr--) {\n    for (int cc = n - 1; cc >= 0; cc--) {\n      if (sz[rr][cc] == 0) {\n        a2 = rr;\n        b2 = cc;\n        break;\n      }\n    }\n    if (a2 != 0 || b2 != 0) {\n      break;\n    }\n  }\n\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1001][1001];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  int sx, sy, ex, ey, flag = 0;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0 && flag == 0) {\n        sx = i;\n        sy = j;\n        flag = 1;\n      } else if (a[i][j] == 0 && flag == 1) {\n        ex = i;\n        ey = j;\n      }\n    }\n  }\n  sx += 1;\n  sy += 1;\n  ex -= 1;\n  ey -= 1;\n  int sum = (ex - sx + 1) * (ey - sy + 1);\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, a[1000][1000];\n  int i, j, sum;\n  int c = 0, k = 0, r = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255) {\n        c = i;\n        k = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        r = i;\n        t = j;\n      }\n    }\n  }\n\n  sum = (r - c - 1) * (t - k - 1);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28175", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, s, a, b, c, d;\n  s = 0;\n  int shuzu[100][100] = {0};\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (shuzu[i][j] == 255) {\n        for (a = 1; i - a >= 0; a++) {\n          if (shuzu[i - a][j] == 0) {\n            for (b = 1; i + b < n; b++) {\n              if (shuzu[i + b][j] == 0) {\n                for (c = 1; j - c >= 0; c++) {\n                  if (shuzu[i][j - c] == 0) {\n                    for (d = 1; j + d < n; d++) {\n                      if (shuzu[i][j + d] == 0) {\n                        s++;\n                        break;\n                      }\n                    }\n                    break;\n                  }\n                }\n                break;\n              }\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, z, w;\n  int n, i, j, t, s, tz = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0 && tz == 0) {\n        tz++;\n        x = i;\n        y = j;\n      }\n      if (t == 0) {\n        z = i;\n        w = j;\n      }\n    }\n  cout << (z - x - 1) * (w - y - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28177", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, sum, x, y, f, s;\n  int a[100][100];\n  x = 0;\n  y = 0;\n  f = 1;\n  sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0) {\n        sum = sum + 1;\n        if (f == 1) {\n          x = x + 1;\n        }\n      }\n      if ((sum > 0) && (a[i][j] == 255)) {\n        f = 0;\n      }\n    }\n  }\n  y = sum / 2 - x;\n  x = x - 2;\n  s = x * y;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, k, b, c, x, y;\n  b = c = 0;\n  scanf(\"%d\", &n);\n  int sz[n][n];\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      scanf(\"%d\", &sz[j][k]);\n      if (sz[j][k] == 0) {\n        x = j;\n        y = k;\n      }\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    for (k = 0; k <= n - 1; k++) {\n      if (sz[j][k] == 0) {\n        b = j;\n        c = k;\n        break;\n      }\n    }\n    if (sz[b][c] == 0)\n      break;\n  }\n  int m;\n  m = (x - b - 1) * (y - c - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, i, j, a[40][40];\n  scanf(\"%d\", i);\n  for (i = 1; i < x; i++) {\n    a[i][i] = 1;\n    a[i][1] = 1;\n  }\n  for (i = 3; i < x; i++) {\n    for (j = 2; j <= i - 1; j++) {\n      a[i][j] = a[i - 1][j - 1] + a[i - 1][j];\n    }\n  }\n  for (i = 1; i < x; i++) {\n    for (j = 1; j < i; j++) {\n      printf(\"%6d\", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "15", "index": "28180", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, heng, shu;\n  heng = 0;\n  shu = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        heng++;\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n        break;\n    }\n    if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0)\n        shu++;\n      if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n        break;\n    }\n    if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n      break;\n  }\n  if (heng != shu)\n    printf(\"%d\\n\", abs(heng - shu) + 1);\n  else\n    printf(\"%d\\n\", (heng - 2) * (heng - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, m, a = 0, b, p = 0, q = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      cin >> m;\n      if (m == 0) {\n        a = a + 1;\n        p = p + 1;\n      }\n    }\n    if (p != 0) {\n      q = q + 1;\n    }\n    p = 0;\n  }\n  b = (q - 2) * (a - 2 * q) / 2;\n  printf(\"%d\\n\", b);\n}\n"}
{"label": "15", "index": "28182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, b = 0, c1 = 0, c2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (k == 0) {\n        c2++;\n      }\n      if (k == 0 && b == 0) {\n        c1++;\n      } else if (k == 255 && b == 0 && c1 > 0) {\n        b = 1;\n      }\n    }\n  }\n  s = (c1 - 2) * (c2 - c1 * 2) / 2;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int p[1000][1000];\n  int n;\n  cin >> n;\n  int i, j;\n  int m = 0;\n  int l = 0;\n  int t = 0;\n  int L, h, S;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      int x;\n      cin >> x;\n      p[i][j] = x;\n    }\n  }\n  int a, b;\n  for (a = 0; a < n; a++) {\n    if (p[a][0] != 0) {\n      for (b = 1; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b - 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 4;\n      L = (m - 2 * h - 4) / 2;\n    } else {\n      for (b = 0; b < n; b++) {\n        if (p[a][b] == 0)\n          m = m + 1;\n        if (p[a][b] != p[a][b + 1])\n          l = l + 1;\n      }\n      h = (l - 4) / 3;\n      L = (m - 2 * h - 4) / 2;\n    }\n  }\n  S = h * L;\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, q, w, e, r, C, K, T;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0; j < n, i < n; j++, i++) {\n    if (a[i][j] == 0)\n      break;\n  }\n  q = i;\n  w = j;\n  for (i = q, j = w; j < n; j++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  e = j;\n  for (i = q, j = w; i < n; i++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  r = i;\n  C = e - w;\n  K = r - q;\n  T = (C - 2) * (K - 2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "15", "index": "28185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, x, number_0 = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &x);\n    if (x == 0) {\n      number_0++;\n    }\n  }\n  s = (number_0 / 4 - 1) * (number_0 / 4 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, n1, n2, n3, n4, sum;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j - 1] != 0 && a[i][j] == 0 && a[i][j + 1] == 0 &&\n          a[i + 1][j] == 0 && a[i - 1][j] != 0) {\n        n1 = i;\n        n2 = j;\n      }\n      if (a[i][j - 1] == 0 && a[i][j] == 0 && a[i][j + 1] != 0 &&\n          a[i + 1][j] != 0 && a[i - 1][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n    }\n  }\n  sum =\n      (n3 - n1 + 1) * (n4 - n2 + 1) - 2 * (n3 - n1 + 1) - 2 * (n4 - n2 + 1 - 2);\n  cout << sum;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a, b;\n  int c1, c2, c, k1, k2, k;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c1 = i;\n        k1 = j;\n      }\n    }\n  }\n\n  for (int a = n - 1; a >= 0; a--) {\n    for (int b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c2 = a;\n        k2 = b;\n      }\n    }\n  }\n\n  c = c1 - c2 - 1;\n  k = k1 - k2 - 1;\n  printf(\"%d\", c * k);\n  return 0;\n}\n"}
{"label": "15", "index": "28188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, b, c, d, e, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] != 0) && (a[i][j + 1] == 0)) {\n        b = i;\n        c = j + 1;\n      }\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0)) {\n        d = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if ((a[i][j] == 0) && (a[i + 1][j] != 0)) {\n        e = i;\n        j = n;\n      }\n    }\n  }\n  s = (d - c + 1) * (e - b + 1) - (4 + (d - c - 1) * 2 + (e - b - 1) * 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[100][100];\n  int i, j, a, b, c, d, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int tag;\n  for (i = 0; i < n; i++) {\n    tag = 0;\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i][j - 1] != 0) && (sz[i - 1][j] != 0)) {\n        a = i;\n        b = j;\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 1) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        c = i;\n        d = j;\n        tag = 2;\n        break;\n      }\n    }\n    if (tag == 2) {\n      break;\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j;\n  int sz[10][10];\n  int a, b, c, d;\n  int s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n\n  s = (d - b - 1) * (a - c - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[500][500], x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        x++;\n    }\n    if (x != 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0)\n        y++;\n    }\n    if (y != 0)\n      break;\n  }\n  cout << (x - 2) * (y - 2) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28192", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, j, k, h, t = 0, s = 0, e = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 1; j + k < n; k++) {\n        if (a[i][j + k] == 0) {\n          t += 1;\n        }\n      }\n      for (h = 1; j - h >= 0; h++) {\n        if (a[i][j - h] == 0) {\n          s += 1;\n        }\n      }\n      if (t == 1 && s == 1) {\n        e++;\n      }\n      t = 0;\n      s = 0;\n    }\n  }\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int s[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a += 1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[i][j] == 0) {\n        b += 1;\n        break;\n      }\n    }\n  }\n  int x;\n  x = (a - 2) * (b - 2);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], j, i, m, n, l, b, k;\n  scanf(\"%d\", &l);\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      if (a[j][i] == 0) {\n        b = j;\n        j = l;\n        break;\n      }\n    }\n  }\n  for (m = l - 1; m >= 0; m--) {\n    for (n = l - 1; n >= 0; n--) {\n      if (a[m][n] == 0) {\n        k = m;\n        m = -1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", (k - b - 1) * (n - i - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int *q;\n  int i, n, flag = 1, a = 0, b = 0, num;\n  cin >> n;\n  for (i = 0; i < n * n; i++) {\n    cin >> num;\n    if ((num == 0) && (flag == 1)) {\n      a++;\n    }\n    if ((a > 0) && (num != 0)) {\n      flag = 0;\n    }\n    if (num == 0) {\n      b++;\n    }\n  }\n  cout << a * ((b - 2 * a) / 2 + 2) - b << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28196", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, x, y, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (sz[i][j] == 0)\n        break;\n    if (j < n)\n      break;\n  }\n  for (x = n - 1; x >= 0; x--) {\n    for (y = n - 1; y >= 0; y--)\n      if (sz[x][y] == 0)\n        break;\n    if (y >= 0)\n      break;\n  }\n  s = (x - i - 1) * (y - j - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28197", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n;\n  scanf(\"%d \", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  int a1, b1, a2, b2;\n  int x;\n  x = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1) {\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int s;\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28198", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 1, m = 1, x[100], y[100], location[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> location[i][j];\n      if (location[i][j] == 0) {\n        x[k] = j;\n        k++;\n        y[m] = i;\n        m++;\n      }\n    }\n  }\n  printf(\"%d\\n\", (y[m - 1] - y[1] - 1) * (x[k - 1] - x[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int n, m;\n  int sum, num;\n  int lon, wid;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(c[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0)\n        sum += 1;\n\n      if (sum > 2)\n        lon = sum;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    num = 0;\n    for (i = 0; i < n; i++) {\n      if (c[i][j] == 0)\n        num += 1;\n      if (num > 2)\n        wid = num;\n    }\n  }\n  m = (lon - 2) * (wid - 2);\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, x, number_0 = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &x);\n    if (x == 0) {\n      number_0++;\n    }\n  }\n  s = (number_0 / 4 - 1) * (number_0 / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a[1000][1000], x, y, p, q, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x = i;\n        y = j;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - x - 1) * (q - y - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28202", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j, n1, n2, n3, n4, sum;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      if (a[i][j - 1] != 0 && a[i][j] == 0 && a[i][j + 1] == 0 &&\n          a[i + 1][j] == 0 && a[i - 1][j] != 0) {\n        n1 = i;\n        n2 = j;\n      }\n      if (a[i][j - 1] == 0 && a[i][j] == 0 && a[i][j + 1] != 0 &&\n          a[i + 1][j] != 0 && a[i - 1][j] == 0) {\n        n3 = i;\n        n4 = j;\n      }\n    }\n  }\n  sum =\n      (n3 - n1 + 1) * (n4 - n2 + 1) - 2 * (n3 - n1 + 1) - 2 * (n4 - n2 + 1 - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, heng, shu;\n  heng = 0;\n  shu = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        heng++;\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n        break;\n    }\n    if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0)\n        shu++;\n      if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n        break;\n    }\n    if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n      break;\n  }\n  if (heng != shu)\n    printf(\"%d\\n\", abs(heng - shu) + 1);\n  else\n    cout << (heng - 2) * (heng - 2) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int cancer[100][100];\n  int n, i, j;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> cancer[i][j];\n    }\n  }\n  int a, b, c, d, m, x;\n  for (m = 0; m < n; m++) {\n    for (x = 0; x < n; x++) {\n      if (cancer[m][x] == 0) {\n        if ((cancer[m - 1][x] == 255) && (cancer[m][x - 1] == 255) &&\n            (cancer[m + 1][x + 1] == 255)) {\n          a = m;\n          b = x;\n        } else if ((cancer[m + 1][x] == 255) && (cancer[m][x + 1] == 255) &&\n                   (cancer[m - 1][x - 1] == 255)) {\n          c = m, d = x;\n        }\n      }\n    }\n  }\n  int e;\n  e = (c - a - 1) * (d - b - 1);\n  cout << e << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28205", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[1000][1000];\n  int n, i, j, point1, point2, row1, colum1, row2, colum2, num;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        point1 = a[i][j];\n        row1 = i;\n        colum1 = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        point2 = a[i][j];\n        row2 = i;\n        colum2 = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  num = (row2 - row1 - 1) * (colum2 - colum1 - 1);\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k = 0, s, n;\n  int imin, imax, jmax;\n  scanf(\"%d\", &n);\n  imin = 100;\n  imax = 0;\n  jmax = 0;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        k++;\n        if (i < imin)\n          imin = i;\n        if (i > imax)\n          imax = i;\n        if (j > jmax)\n          jmax = j;\n      }\n    }\n\n  s = (imax - imin + 1) * (jmax - imin + 1);\n  printf(\"%d\\n\", s - k);\n  return 0;\n}\n"}
{"label": "15", "index": "28207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000] = {0}, j, m[100], i, k[100], p[100], b[100], s = 0,\n         g = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        s += 1;\n        m[s] = j;\n        k[s] = i;\n        break;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (a[j][i] == 0) {\n        g += 1;\n        p[g] = j;\n        b[g] = i;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", (p[1] - m[1] - 1) * (b[1] - k[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100], r, s, p, q;\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz[row][col]));\n    }\n  }\n  for (int a = 0; a < n; a++) {\n    for (int b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        r = a;\n        s = b;\n        break;\n      } else\n        continue;\n    }\n  }\n  for (int c = n - 1; c >= 0; c--) {\n    for (int d = n - 1; d >= 0; d--) {\n      if (sz[c][d] == 0) {\n        p = c;\n        q = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  int e = (r - p - 1) * (q - s - 1);\n\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28209", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, l, m, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < n - 1; j++)\n      cin >> a[i][j];\n    scanf(\"%d\", &a[i][n - 1]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m++;\n        break;\n      }\n    }\n  }\n  l = 0;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        l++;\n\n        break;\n      }\n    }\n\n  s = (l - 2) * (m - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k1, k2, m1, m2, s;\n  int a[1001][1001];\n  k1 = 0;\n  k2 = 0;\n  m1 = 0;\n  m2 = 0;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j - 1] != 0 && a[i - 1][j] != 0 && a[i][j + 1] == 0 &&\n          a[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n      } else if (a[i][j - 1] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n                 a[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n      }\n    }\n  s = (k2 - k1 - 1) * (m2 - m1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28211", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int points[100][100];\n  int n, row, col;\n  int sum = 0, i = 0;\n  int SUM = 0, j = 0;\n  cin >> n;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      cin >> points[row][col];\n  }\n  for (row = 0; row < n; row++) {\n    sum = 0;\n    for (col = 0; col < n; col++) {\n      sum += points[row][col];\n    }\n    if (sum < n * 255)\n      i++;\n  }\n  for (col = 0; col < n; col++) {\n    SUM = 0;\n    for (row = 0; row < n; row++) {\n      SUM += points[row][col];\n    }\n    if (SUM < n * 255)\n      j++;\n  }\n  printf(\"%d\", (i - 2) * (j - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz1[1000];\n  int h, k = 0, i, n, mj, a = -1, b = -1, c = 0, d;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    k = 0;\n    for (i = 0; i < n; i++) {\n      if (a < 0) {\n        c++;\n      }\n      scanf(\"%d\", &sz1[i]);\n      if (sz1[i] == 0) {\n        a = i;\n        b = h;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      sz1[i] = 0;\n    }\n  }\n  d = c % n;\n  mj = (b - d) * (a - d);\n  printf(\"%d\\n\", mj);\n  return 0;\n}\n"}
{"label": "15", "index": "28213", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, s, n, b[2], c[2], q = 0, p = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      b[p] = i;\n      p += 1;\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    s = 0;\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] == 0)\n        s += 1;\n    }\n    if (s > 2) {\n      c[q] = i;\n      q += 1;\n    }\n  }\n  printf(\"%d\", (b[1] - b[0] - 1) * (c[1] - c[0] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, x, y, s;\n  a = 0;\n  b = 0;\n  x = -1;\n  y = -1;\n  scanf(\"%d\", &n);\n  int tx[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &tx[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tx[i][j] == 0) {\n        x = j;\n        y = i;\n        break;\n      }\n    }\n    if ((x == j) && (y == i))\n      break;\n  }\n  for (x = j; x < n; x++) {\n    if (tx[x][i] == 0) {\n      a = a + 1;\n    }\n  }\n  for (y = i; y < n; y++) {\n    if (tx[j][y] == 0) {\n      b = b + 1;\n    }\n  }\n  s = a * b - 2 * (a + b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a[100][100], n, s = 0, S, h1 = 0, h2 = 0, l1 = 0, l2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0 && s == 0) {\n        l1 = i + 1;\n        h1 = j + 1;\n        s = 1;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0 && s) {\n        l2 = i;\n        h2 = j;\n        s = 0;\n      }\n    }\n  S = (l2 - l1) * (h2 - h1);\n  cout << S << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        break;\n    }\n    if (a == 0)\n      break;\n  }\n  int s = 0;\n  while (++j <= n) {\n    if (a == 0)\n      s++;\n    cin >> a;\n  }\n  int num = 0;\n  for (i += 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        num++;\n    }\n  int r;\n  r = (num - s) / 2;\n  s -= 2;\n  printf(\"%d\\n\", r * s);\n  return 0;\n}\n"}
{"label": "15", "index": "28217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], m1, n1, m2, n2, t = 0, S;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == a[i][j + 1] && a[i][j] == a[i + 1][j] && a[i][j] == 0) {\n        m1 = i;\n        n1 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  t = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == a[i][j - 1] && a[i][j] == a[i - 1][j] && a[i][j] == 0) {\n        m2 = i;\n        n2 = j;\n        t = 1;\n        break;\n      }\n      if (t)\n        break;\n    }\n  }\n  S = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int shu[1000][1000];\n  int i, j;\n  int sth, stl, enh, enl;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &shu[i][j]);\n    }\n  }\n  int b = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (shu[i][j] == 0 && b == -1) {\n        sth = i;\n        stl = j;\n        b = 1;\n      }\n    }\n  }\n  int a = -1;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (shu[i][j] == 0 && a == -1) {\n        enh = i;\n        enl = j;\n        a = 1;\n      }\n    }\n  }\n  int s;\n  s = (enh - sth - 1) * (enl - stl - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, c, b, sum = 0, i, a[10][10];\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++)\n      scanf(\"%d\", &a[x][y]);\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        b = y;\n        break;\n      }\n    }\n  }\n  for (x = 0; x < n; x++) {\n    for (y = 0; y < n; y++) {\n      if (a[x][y] == 0) {\n        c = y;\n        sum++;\n      }\n    }\n  }\n  i = (sum - 2 * (c - b - 1)) / 2 * (c - b + 1) - sum;\n  printf(\"%d\", i);\n  return 0;\n}\n"}
{"label": "15", "index": "28220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, cur, s = 0, sq, starow, stacol, endrow, endcol;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &cur);\n    if (s == 0 && cur == 0) {\n      s = 1;\n      starow = (i - 1) / n;\n      stacol = i % n;\n    } else if (s == 1 && cur == 0) {\n      endrow = (i - 1) / n;\n      endcol = i % n;\n    }\n  }\n  sq = (endrow - starow - 1) * (endcol - stacol - 1);\n  printf(\"%d \", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "28221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100];\n  int row, col, a = 0, b = 0, c = 0, d = 0, s = 0, p = 0;\n  int i, j, k, l;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (p != 1) {\n      for (j = 0; j < n; j++) {\n        if (sz[j][i] == 0) {\n          a = j;\n          b = i;\n          p = 1;\n          break;\n        }\n      }\n    } else\n      break;\n  }\n  for (k = n - 1; k >= 0; k--) {\n    if (p != 0) {\n      for (l = n - 1; l >= 0; l--) {\n        if (sz[l][k] == 0) {\n          c = l;\n          d = k;\n          p = 0;\n          break;\n        }\n      }\n    } else {\n      break;\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28222", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, o, p, q, A[100][100], i, j, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    A[0][i] = 255;\n    A[i][0] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> A[i][j];\n    }\n  }\n\n  for (i = 0; i <= n + 1; i++) {\n    A[n + 1][i] = 255;\n    A[i][n + 1] = 255;\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (A[i - 1][j] == 255 && A[i][j - 1] == 255 && A[i + 1][j] == 0 &&\n          A[i][j + 1] == 0 && A[i][j] == 0) {\n        m = i;\n        o = j;\n      }\n      if (A[i - 1][j] == 0 && A[i][j - 1] == 0 && A[i + 1][j] == 255 &&\n          A[i][j + 1] == 255 && A[i][j] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - m - 1) * (q - o - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, k, x = 0, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &a[i][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k - 1] == 255) && (a[i - 1][k - 1] == 255) &&\n          (a[i - 1][k] == 255)) {\n        x1 = i;\n        y1 = k;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if ((a[i][k] == 0) && (a[i][k + 1] == 255) && (a[i + 1][k + 1] == 255) &&\n          (a[i + 1][k] == 255)) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  int a = 0;\n  scanf(\"%d\", &n);\n  int *sz = (int *)malloc(sizeof(int) * (n * n));\n  int k;\n\n  for (k = 0; k < (n * n); k++) {\n    scanf(\"%d\", &(sz[k]));\n    if (sz[k] == 0)\n      i++;\n  }\n  int cond = 0;\n  for (k = 0; k < (n * n); k++) {\n    if (sz[k] == 0 && cond == 0) {\n      a++;\n      if (sz[k + 1] == 255) {\n        cond = 1;\n      } else {\n        continue;\n      }\n    }\n  }\n  int j;\n  j = (i - (a)*2) / 2 + 2;\n  int s;\n  s = (j - 2) * (a - 2);\n  printf(\"%d\\n\", s);\n  free(sz);\n  return 0;\n}\n"}
{"label": "15", "index": "28225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x, y, x1, y1, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x = i;\n        y = j;\n        goto l;\n      }\nl:\n  x1 = x;\n  y1 = y;\n\n  while (x1 < n && a[x1][y] == 0)\n    x1++;\n  while (y1 < n && a[x][y1] == 0)\n    y1++;\n  s = (x1 - x - 2) * (y1 - y - 2);\n  \n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a = 0, b = 0, c = 0, s;\n  int x[1000][1000];\n  int y[1000];\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    y[i] = 0;\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x[i][j]);\n      if (x[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n\n    if (a > 0) {\n      y[i] = 1;\n    }\n    if (a > b) {\n      b = a;\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    if (y[i] > 0) {\n      c = c + 1;\n    }\n  }\n  s = (b - 2) * (c - 2);\n  cout << s;\n}\n"}
{"label": "15", "index": "28227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int m, n;\n\n  int i, j, k;\n\n  int r;\n\n  int ni, nj, nk, nm, nn;\n\n  nk = 0;\n  r = 0;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &ni);\n    if (ni == 0) {\n      nk += 1;\n    }\n    if (ni == 255 && nk != 0 && r == 0) {\n      r = nk;\n    }\n  }\n  r = (nk - 2 * r) / 2 * (r - 2);\n\n  printf(\"%d\", r);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, q = 0, m = 0, number;\n  scanf(\"%d\", &n);\n  int s[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n    if (j == (n - 1)) {\n      scanf(\"%d\\n\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0)\n        q++;\n    }\n    if (q != 0)\n      break;\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (s[b][a] == 0)\n        m++;\n    }\n    if (m != 0)\n      break;\n  }\n\n  number = (q - 2) * (m - 2);\n  printf(\"%d\", number);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, e = 0, p, q, s, t, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        break;\n    }\n    if (j < n)\n      break;\n  }\n  for (p = j + 1; p <= n; p++) {\n    scanf(\"%d\", &b);\n    if (b == 255)\n      break;\n  }\n  q = p + 1;\n  while (q <= n) {\n    scanf(\"%d\", &c);\n    q++;\n  }\n  for (s = i + 1; s <= n; s++) {\n    for (t = 1; t <= n; t++) {\n      scanf(\"%d\", &d);\n      if (d == 0) {\n        e = e + 1;\n      }\n    }\n  }\n  sum = (e - (p - j)) / 2 * (p - j - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, rol, col, a, b, c, d, x;\n  int sz1[100][100];\n  scanf(\"%d\", &n);\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(sz1[rol][col]));\n    }\n  }\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      if (sz1[rol][col] == 0) {\n        b = col;\n        break;\n      }\n    }\n  }\n  for (col = 0; col < n; col++) {\n    for (rol = 0; rol < n; rol++) {\n      if (sz1[rol][col] == 0) {\n        a = rol;\n        break;\n      }\n    }\n  }\n  for (col = b; col < n; col++) {\n    if (sz1[a][col] != 0) {\n      d = col - 1;\n      break;\n    }\n  }\n\n  for (rol = a; rol < n; rol++) {\n    if (sz1[rol][d] != 0) {\n      c = rol - 1;\n      break;\n    }\n  }\n\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, ai, aj, bi, bj, ans, x;\n\n  scanf(\"%d\", &n);\n  ai = n;\n  aj = n;\n  bi = -1;\n  bj = -1;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        if (i < ai)\n          ai = i;\n        if (i > bi)\n          bi = i;\n        if (j < aj)\n          aj = j;\n        if (j > bj)\n          bj = j;\n      }\n    }\n\n  ans = (bi - ai - 1) * (bj - aj - 1);\n\n  cout << ans << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, col1 = 0, row1 = 0, col2 = 0, row2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        col1 = i;\n        row1 = j;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        col2 = i;\n        row2 = j;\n        break;\n      }\n    }\n\n  cout << (col1 - col2 - 1) * (row2 - row1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, a[1000][1000], x, y, p, q, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0) {\n        x = i;\n        y = j;\n      }\n    }\n  }\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        p = i;\n        q = j;\n      }\n    }\n  }\n  s = (p - x - 1) * (q - y - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, temp1, temp2, i, j, a, b, k, c, d, e;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  temp1 = 0;\n  temp2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n && temp1 == 0; i++) {\n    for (j = 0; j < n && temp1 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] == 0 && sz[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        temp1 = 1;\n      }\n    }\n  }\n  for (i = a; i < n && temp2 == 0; i++) {\n    for (j = b; j < n && temp2 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] == 0 && sz[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        temp2 = 1;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n    if (x == 0)\n      break;\n  }\n\n  for (j = j1 + 1; j < n; j++)\n    scanf(\"%d\", &x);\n\n  for (i = i1 + 1; i < n; i++) {\n    int y = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28236", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, x, y = 0, i, j, a[1000] = {0}, m = 0, n = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++) {\n      cin >> x;\n      a[i] = a[i] + x;\n    }\n    if (a[i] == 255 * (N - 2))\n      m = m + 1;\n    else if (a[i] < 255 * (N - 2))\n      n = N - a[i] / 255;\n  }\n  y = (n - 2) * m;\n  printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "15", "index": "28237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int i, j, n, b = 0, c, d = 0, m, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        break;\n      }\n    }\n    if (b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        d = i;\n        m = j;\n        break;\n      }\n    }\n    if (d != 0)\n      break;\n  }\n  s = (d - b - 1) * (m - c - 1);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000];\n  int i, j;\n  int f = 0;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; ++i)\n    for (j = 0; j < n; ++j)\n      scanf(\"%d\", a[i] + j);\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        f = 1;\n        break;\n      }\n    if (f != 0)\n      break;\n  }\n  for (i = y1; i < n; ++i)\n    if ((a[x1][i + 1] != 0) || (i + 1 >= n)) {\n      y2 = i;\n      break;\n    }\n  for (i = x1; i < n; ++i)\n    if ((a[i + 1][y1] != 0) || (i + 1 >= n)) {\n      x2 = i;\n      break;\n    }\n  if ((x2 - x1 < 2) || (y2 - y1 < 2)) {\n    cout << 0;\n    return 0;\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int xs[100][100];\n  int i, j, x1, x2, y1, y2, S;\n  scanf(\"%d\", &n);\n  y1 = 0;\n  y2 = n + 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &xs[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    x1 = 1;\n    y1++;\n    for (j = 0; j < n; j++) {\n      if (xs[i][j])\n        x1++;\n      else {\n        j = n;\n        i = n;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    x2 = n;\n    y2--;\n    for (j = n - 1; j >= 0; j--) {\n      if (xs[i][j])\n        x2--;\n      else {\n        j = -1;\n        i = -1;\n      }\n    }\n  }\n  S = (y2 - y1 - 1) * (x2 - x1 - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "28240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, i, a1, a2, b1, b2, t, x;\n  int s[100][100];\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (x = 0, j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a1 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, j = (n - 1); j >= 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a2 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b1 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = (n - 1); i >= 0; i--) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b2 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j, c, b, s, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        c = i;\n        b = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        c = i - c - 1;\n        b = j - b - 1;\n      }\n    }\n  }\n  s = c * b;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, x[1000][1000], s = 0, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  n = n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (x[i][j] == 0 && x[i - 1][j] == 255 && x[i][j - 1] == 255 &&\n          x[i + 1][j] == 0 && x[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      } else if (x[i][j] == 0 && x[i - 1][j] == 0 && x[i][j - 1] == 0 &&\n                 x[i + 1][j] == 255 && x[i][j + 1] == 255) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, a, a1 = 0, a2 = 0, b1 = 0, b2 = 0, s;\n  int x[11][11];\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (x[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (x[i][j] == 0) {\n      break;\n    }\n  }\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, S;\n  int a[2], b[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i][j + 1] == 0) {\n        a[0] = i;\n        b[0] = j;\n      }\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i][j - 1] == 0) {\n        a[1] = i;\n        b[1] = j;\n      }\n    }\n  }\n  S = (a[1] - a[0] - 1) * (b[1] - b[0] - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, c, r, x, t, r1, r2, c1, c2;\n  scanf(\"%d\", &n);\n  int sz[n][n];\n  t = 0;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      cin >> (sz[r][c]);\n      if (t == 0 && sz[r][c] == 0) {\n        r1 = r;\n        c1 = c;\n\n        t = 1;\n      }\n    }\n  }\n  t = 0;\n  for (r = n - 1; r >= 0; r--) {\n    for (c = n - 1; c >= 0; c--) {\n      scanf(\"%d\", &(sz[r][c]));\n      if (t == 0 && sz[r][c] == 0) {\n        r2 = r;\n        c2 = c;\n        t = 1;\n      }\n    }\n  }\n  x = (r2 - r1 - 1) * (c2 - c1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, a1, a2, b1, b2, f = -1, s = 0;\n  int(sz[1000][1000]);\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      getchar();\n      if (((sz[i][k]) == 0) && (f == -1)) {\n        a1 = i;\n        b1 = k;\n        f = 1;\n      }\n      if ((sz[i][k]) == 0) {\n        a2 = i;\n        b2 = k;\n      }\n    }\n  }\n\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"%d\\n\", s);\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "28247", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, number[1001], i, p, count, start, end;\n  count = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    start = 0;\n    end = 0;\n    for (p = 1; p <= n; p++)\n      cin >> number[p];\n\n    for (p = 1; p <= n - 1; p++) {\n      if (start == 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        start = p;\n      }\n      if (start != 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        end = p;\n      }\n    }\n    if (end - start <= 1) {\n      continue;\n    }\n    count += (end - start - 1);\n  }\n  printf(\"%d\", count);\n  return 0;\n}\n"}
{"label": "15", "index": "28248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a1, a2, b1, b2, c, d = 0, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        d = 1;\n        break;\n      }\n    }\n    if (d == 1)\n      break;\n  }\n  for (j = n - 1; j > b1; j--) {\n    for (i = n - 1; i > a1; i--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  c = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "28249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j;\n  int k = 0, l = 0, m = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        k++, m = j;\n      }\n    }\n    if (a[i][m] == 0)\n      l++;\n  }\n  k = ((k - 4) / 2 - l + 2) * (l - 2);\n  printf(\"%d\\n\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "28250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x1, y1, x2, y2;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        i = n;\n        break;\n      }\n    }\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        i = -1;\n        break;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], i, j, n, flag = 0, row1, row2, col1, col2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        row1 = i;\n        col1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  flag = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        row2 = i;\n        col2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1) {\n      break;\n    }\n  }\n  printf(\"%d\", (row2 - row1 - 1) * (col2 - col1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28252", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, s, n;\n  int l, r;\n  scanf(\"%d \", &n);\n  if (n <= 10) {\n    int cancel[10][10];\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        cin >> cancel[l][r];\n      }\n    }\n    int r1, r2, l1, l2;\n    for (i = 0, l = 0; l < n; l++) {\n      for (i = 0, r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l1 = l;\n          r1 = r;\n          i = 1;\n          break;\n        }\n      }\n      if (i == 1) {\n        break;\n      }\n    }\n    for (l = 0; l < n; l++) {\n      for (r = 0; r < n; r++) {\n        if (cancel[l][r] == 0) {\n          l2 = l;\n          r2 = r;\n        }\n      }\n    }\n    s = (l2 - l1 - 1) * (r2 - r1 - 1);\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28253", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length, i, j, temp, start = -1, end;\n  scanf(\"%d\", &length);\n  for (i = 0; i < length; i++) {\n    for (j = 0; j < length; j++) {\n      scanf(\"%d \", &temp);\n      if (temp == 0) {\n        if (start == -1)\n          start = i * length + j;\n        end = i * length + j;\n      }\n    }\n  }\n  printf(\"%d\", (end / length - start / length - 1) *\n                   (end % length - start % length - 1));\n}\n"}
{"label": "15", "index": "28254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, i, k, aj, ai, bi, bj;\n  int k1, k2, k3;\n  aj = 0;\n  ai = 0;\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> k;\n      k1 = k2;\n      k2 = k3;\n      k3 = k;\n      if (k3 == 0 && k2 == 0 && k1 == 255) {\n        if (aj == 0) {\n          aj = j;\n          ai = i - 1;\n        }\n      } else if (k1 == 0 && k2 == 0 && k3 == 255) {\n        bj = j;\n        bi = i - 1;\n      } else {\n        continue;\n      }\n    }\n  }\n  printf(\"%d\\n\", ((bj - aj - 1) * (bi - ai - 1)));\n  return 0;\n}\n"}
{"label": "15", "index": "28255", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, b[1000][1000], i, k, s;\n  int x1, x2, y1, y2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      cin >> (b[i][k]);\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (b[i][k] == 0 && b[i + 1][k] == b[i][k] && b[i][k + 1] == b[i][k]) {\n        x1 = i;\n        y1 = k;\n      }\n      if (b[i][k] == 0 && b[i - 1][k] == b[i][k] && b[i][k - 1] == b[i][k]) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, m, s;\n  cin >> n;\n  int max1 = 0, max2 = 0, min1 = n, min2 = n;\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if (max1 < i) {\n          max1 = i;\n        }\n        if (max2 < j) {\n          max2 = j;\n        }\n        if (min1 > i) {\n          min1 = i;\n        }\n        if (min2 > j) {\n          min2 = j;\n        }\n      }\n    }\n  }\n  s = (max1 - min1 - 1) * (max2 - min2 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28257", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, i, j, k, s = 0;\n  scanf(\"%d\", &m);\n  int area[1000][1000];\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &area[i][j]);\n    }\n  }\n  k = 0;\n  int ib = 0, jb = 0, ie = 0, je = 0;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ib = i;\n          jb = j;\n          break;\n        }\n      }\n    }\n  }\n  k = 0;\n  for (i = m - 1; i >= 0; i--) {\n    for (j = m - 1; j >= 0; j--) {\n      if (area[i][j] == 0) {\n        k++;\n        if (k == 1) {\n          ie = i;\n          je = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (ie - ib - 1) * (je - jb - 1);\n  printf(\"%d \", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i = 0, j;\n  int N, k, p;\n  scanf(\"%d\", &n);\n  N = n * n;\n  for (k = 0; k < N; k++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      i++;\n  }\n  j = ((i / 4) - 1) * ((i / 4) - 1);\n  printf(\"%d\\n\", j);\n  return 0;\n}\n"}
{"label": "15", "index": "28259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, k, r1, r2, c1, c2, x = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] == 0) && x == 0) {\n        r1 = i + 1;\n        c1 = j + 1;\n        x = 1;\n      }\n      if ((a[i][j] == 0)) {\n        r2 = i - 1;\n        c2 = j - 1;\n      }\n    }\n  }\n  printf(\"%d\\n\", (r2 - r1 + 1) * (c2 - c1 + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  int sum1 = 0, sum2 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        for (k = 1;; k++) {\n          if (a[i][j + k] == 0)\n            sum1++;\n          else\n            break;\n        }\n        for (k = 1;; k++) {\n          if (a[i + k][j] == 0)\n            sum2++;\n          else\n            break;\n        }\n        break;\n      }\n      if (sum1 != 0)\n        break;\n    }\n  }\n  cout << (sum1 - 1) * (sum2 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28261", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int m, n[1000][1000], ai, aj, zi, zj, i, j, s;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      scanf(\"%d\", &n[i][j]);\n      if (n[i][j] == 0) {\n        zi = i;\n        zj = j;\n      }\n    }\n  }\n  for (i = (m - 1); i >= 0; i--) {\n    for (j = (m - 1); j >= 0; j--) {\n\n      if (n[i][j] == 0) {\n        ai = i;\n        aj = j;\n      }\n    }\n  }\n  s = (zj - aj - 1) * (zi - ai - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N, M;\n  scanf(\"%d\", &N);\n  M = N;\n\n  int k[50][50];\n  int i, j, y = 0;\n  int sum = 0;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      scanf(\"%d\", &k[i][j]);\n    }\n  }\n\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      if (k[i][j] == 0)\n        sum++;\n    }\n  }\n  y = (sum / 4 - 1) * (sum / 4 - 1);\n  printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "15", "index": "28263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x = 0, y = 0, s, place;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    if (x == 0)\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0)\n          x++;\n      }\n    else\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    if (y == 0)\n      for (i = 0; i < n; i++)\n\n      {\n        if (a[i][j] == 0)\n\n          y++;\n      }\n\n    else\n      break;\n  }\n\n  s = (y - 2) * (x - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {0};\n  int n, i, j, b, c, d, e;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j - 1] == 0 && a[i - 1][j] == 0 && a[i - 1][j - 1] == 0) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (a[i][j + 1] == 0 && a[i + 1][j] == 0 && a[i + 1][j + 1] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (d - b + 1) * (e - c + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, b, x, p = 0, q;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= a; i++) {\n    for (x = 0, j = 1; j <= a; j++) {\n      scanf(\"%d\", &b);\n      if (b == 0)\n        x = x + 1;\n      else\n        x = x + 0;\n    }\n    if (x != 0) {\n      p++;\n      q = x;\n    }\n  }\n  cout << (p - 2) * (q - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, sum, array[30][30];\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &array[i][j]);\n  }\n  i = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (array[i][j] == 0 && array[i][j - 1] != 0 && array[i - 1][j] != 0) {\n        a = i;\n        b = j;\n      }\n      if (array[i][j] == 0 && array[i][j + 1] != 0 && array[i + 1][j] != 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  sum = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "28267", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, tem, a, b, count = 0, tr = 0, s = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &tem);\n      if (tem == 255 && tr == 1)\n        tr = 2;\n      else if (tem == 0 && tr == 0) {\n        s++;\n        tr = 1;\n      } else if (tem == 0 && tr == 1)\n        s++;\n      if (tem == 0)\n        count++;\n    }\n    if (tr == 1)\n      tr = 2;\n  }\n  printf(\"%d\", ((count - 2 * s) / 2) * (s - 2));\n}\n"}
{"label": "15", "index": "28268", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s[1000][1000];\nint main() {\n\n  int a = 1, b = 1, j, i, n, m, first = 0;\n  int c = 0, d = 0;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &s[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        first = 1;\n        break;\n      }\n    }\n\n    if (first == 1) {\n      break;\n    }\n  }\n  for (j = b; j < n; j++) {\n    c++;\n    if (s[a][j] == 255) {\n      break;\n    }\n  }\n\n  for (i = a; i < n; i++) {\n    d++;\n    if (s[i][b] == 255)\n      break;\n  }\n\n  m = (c - 3) * (d - 3);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28269", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i1 = 0, j1 = 0, i2 = 0, j2 = 0, j, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    if (i1 != 0)\n      break;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i1 = i + 1;\n        j1 = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        i2 = i + 1;\n        j2 = j + 1;\n      }\n    }\n  }\n  printf(\"%d\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, x1, y1, x2, y2, a[1000], t;\n  x1 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j]);\n      if (a[j] == 0) {\n        if (x1 == -1) {\n          x1 = i;\n          y1 = j;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  t = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int s = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255) {\n        s++;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28272", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s[100][100];\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &s[i][j]);\n  }\n  int i1, i2, j1, j2;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (s[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        break;\n      }\n    }\n  }\n  int sq;\n  sq = (j2 - j1 - 1) * (i1 - i2 - 1);\n  printf(\"%d\\n\", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "28273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100] = {0};\n  int n, i, j, x1 = 0, x2 = 0, y1 = 0, y2 = 0, x = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  x = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        x = 1;\n        break;\n      }\n    }\n    if (x)\n      break;\n  }\n  if (x1 == x2 || y1 == y2)\n    cout << 0 << endl;\n  else {\n    cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "15", "index": "28274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], j, i, m, n, l, b, k;\n  scanf(\"%d\", &l);\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      cin >> a[j][i];\n    }\n  }\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      if (a[j][i] == 0) {\n        b = j;\n        j = l;\n        break;\n      }\n    }\n  }\n  for (m = l - 1; m >= 0; m--) {\n    for (n = l - 1; n >= 0; n--) {\n      if (a[m][n] == 0) {\n        k = m;\n        m = -1;\n        break;\n      }\n    }\n  }\n  cout << (k - b - 1) * (n - i - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, a, b, c, d, e, f, g, h, m, i, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (t = 0; t < n; t++)\n      scanf(\"%d\", &sz[i][t]);\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        d = b;\n        break;\n      }\n    }\n  }\n  for (a = 0; a < n; a++) {\n    for (b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c = b;\n        break;\n      }\n    }\n  }\n  for (e = n - 1; e >= 0; e--) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        g = e;\n        break;\n      }\n    }\n  }\n  for (e = 0; e < n; e++) {\n    for (f = n - 1; f >= 0; f--) {\n      if (sz[e][f] == 0) {\n        h = e;\n        break;\n      }\n    }\n  }\n\n  m = (h - g - 1) * (c - d - 1);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "28276", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, s;\n  scanf(\"%d \", &n);\n  int max1 = 0, max2 = 0, min1 = n, min2 = n;\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if (max1 < i) {\n          max1 = i;\n        }\n        if (max2 < j) {\n          max2 = j;\n        }\n        if (min1 > i) {\n          min1 = i;\n        }\n        if (min2 > j) {\n          min2 = j;\n        }\n      }\n    }\n  }\n  s = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, x0, y0, x1, y1;\n  int pixel;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    cin >> pixel;\n    if (pixel == 0) {\n      x0 = i / n;\n      y0 = i % n;\n      break;\n    }\n  }\n  for (i = i + 1; i < n * n; i++) {\n    scanf(\"%d\", &pixel);\n    if (pixel == 0) {\n      x1 = i / n;\n      y1 = i % n;\n    }\n  }\n\n  cout << (x1 - x0 - 1) * (y1 - y0 - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b[1000][1000], i, k, s;\n  int x1, x2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(b[i][k]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (b[i][k] == 0 && b[i + 1][k] == b[i][k] && b[i][k + 1] == b[i][k]) {\n        x1 = i;\n        y1 = k;\n      }\n      if (b[i][k] == 0 && b[i - 1][k] == b[i][k] && b[i][k - 1] == b[i][k]) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], j, i, m, n, l, b, k;\n  cin >> l;\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++)\n      scanf(\"%d\", &a[j][i]);\n  }\n  for (j = 0; j < l; j++) {\n    for (i = 0; i < l; i++) {\n      if (a[j][i] == 0) {\n        b = j;\n        j = l;\n        break;\n      }\n    }\n  }\n  for (m = l - 1; m >= 0; m--) {\n    for (n = l - 1; n >= 0; n--) {\n      if (a[m][n] == 0) {\n        k = m;\n        m = -1;\n        break;\n      }\n    }\n  }\n  cout << (k - b - 1) * (n - i - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else {\n          m++;\n        }\n      }\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  cout << a * b;\n}\n"}
{"label": "15", "index": "28281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, s, a = 0, k[1000];\n  cin >> n;\n  for (j = 0; j < n * n; j++)\n    scanf(\"%d\", &k[j]);\n\n  for (j = 0; j < n * n; j++) {\n    if (k[j] == 0)\n      a = a + 1;\n  }\n  s = (a / 4 - 1) * (a / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28282", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int area[1000][1000];\n  scanf(\"%d \", &n);\n  int f = 1;\n  int start1, start2, end1, end2, re;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> area[i][j];\n      if (area[i][j] == 0 && f == 1) {\n        start1 = i;\n        start2 = j;\n        f = 2;\n      }\n      if (area[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n  }\n  re = (end1 - start1 - 1) * (end2 - start2 - 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "28283", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000][1000], count = 0, wid = 0, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        count = count + 1;\n      }\n    }\n    if (count > 2) {\n      count = count;\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        wid = wid + 1;\n      }\n    }\n    if (wid > 2) {\n      wid = wid;\n      break;\n    }\n  }\n\n  x = (count - 2) * (wid - 2);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "28284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1001][1001] = {0};\n  int i, j, temp = 0;\n  int c1, c2, d1, d2, f1, f2, g1, g2;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        c1 = i;\n        c2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i + 1][j] == 0) {\n        d1 = i;\n        d2 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j + 1] == 0) {\n        f1 = i;\n        f2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        g1 = i;\n        g2 = j;\n      }\n    }\n  temp = (d2 - c2 - 1) * (f1 - c1 - 1);\n  printf(\"%d\", temp);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i = 0, j = 0, p = 0, q = 0, m = 0, n = 0, x1 = 0, y = 0;\n  cin >> x1;\n  y = 0;\n  for (i = 1; i <= x1; i++) {\n    for (j = 1; j <= x1; j++) {\n      cin >> a;\n      if ((a == 0) && (y == 0)) {\n        p = i;\n        q = j;\n        y = 1;\n      } else if (a == 0) {\n        m = i;\n        n = j;\n      }\n    }\n  }\n  b = (m - p - 1) * (n - q - 1);\n  cout << b;\n  return 0;\n}\n"}
{"label": "15", "index": "28286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[500][500], i, j, n, h[3], g[3], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        h[1] = i;\n        g[1] = j;\n        break;\n      }\n    }\n  for (i = n; i >= 1; i--)\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        h[2] = i;\n        g[2] = j;\n        break;\n      }\n    }\n  s = (h[1] - h[2] - 1) * (g[2] - g[1] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28287", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int i, j, n, t, i1 = 0, j1 = 0, i2 = 0, j2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    {\n      for (j = 0; j <= n - 1; j++)\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n    }\n    if (a[i1][j1] == 0)\n      break;\n  }\n  for (i = n - 1; i >= i1; i--) {\n    {\n      for (j = n - 1; j >= 0; j--)\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      if (a[i2][j2] == 0)\n        break;\n    }\n  }\n  t = (i2 - i1 - 1) * (j2 - j1 - 1);\n  printf(\"%d\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28288", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, b, c, s, y = 0;\n  int **a;\n  scanf(\"%d\", &n);\n  a = (int **)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    a[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = i + 1;\n        k = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  y = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        b = i + 1;\n        c = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  s = (b - m - 1) * (c - k - 1);\n  printf(\"%d\", s);\n  for (i = 0; i < n; i++) {\n    free(a[i]);\n    a[i] = 0;\n  }\n  free(a);\n  a = 0;\n}\n"}
{"label": "15", "index": "28289", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long n, i;\n  int a = 0, b, c, d, e, f;\n  double sum = 0;\n  cin >> n;\n  f = 0;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &b);\n    if (b == 0) {\n      f = i;\n      sum += i;\n      a += 1;\n    }\n  }\n  c = sum / a * 2 - f;\n  d = f / n - c / n + 1;\n  e = (a - 2 * d) / 2;\n  printf(\"%d\", (d - 2) * e);\n  return 0;\n}\n"}
{"label": "15", "index": "28290", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s, start1, start2, end1, end2, n, sz[100][100];\n  scanf(\"%d\", &n);\n  int flag = 0;\n  start1 = 0;\n  start2 = 0;\n  end1 = 0;\n  end2 = 0;\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &sz[i][j]);\n      if (sz[i][j] == 0 && flag == 0) {\n        flag = 1;\n        start1 = i + 1;\n        start2 = j + 1;\n      }\n      if (sz[i][j] == 0) {\n        end1 = i;\n        end2 = j;\n      }\n    }\n\n  s = (end1 - start1) * (end2 - start2);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int tumour[256][256], n, i, j, x1 = -1, y1, x2 = -1, y2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &tumour[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 >= 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j, a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  }\n  int k, l, p, q, a1 = 0, a2 = 0, b1, b2;\n  int s;\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++) {\n      if (a[k][l] == 0) {\n        a1 = k;\n        b1 = l;\n        break;\n      }\n    }\n    if (a1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n        break;\n      }\n    }\n    if (a2 != 0)\n      break;\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28293", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[100][100];\n  int i, j, a, b, c, d, x;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  int tag;\n  for (i = 0; i < n; i++) {\n    tag = 0;\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i][j - 1] != 0) && (sz[i - 1][j] != 0)) {\n        a = i;\n        b = j;\n        tag = 1;\n        break;\n      }\n    }\n    if (tag == 1) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        c = i;\n        d = j;\n        tag = 2;\n        break;\n      }\n    }\n    if (tag == 2) {\n      break;\n    }\n  }\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28294", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, *p = NULL, mianji;\n  int zhongliu[1000][1000];\n  int zuoshang[2], youxia[2];\n  p = zhongliu[0];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> *(p + i * n + j);\n    }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (*(p + i * n + j) == 0 && *(p + i * n + j + 1) == 0 &&\n          *(p + (i + 1) * n + j) == 0 && j + 1 < n && i + 1 < n) {\n        zuoshang[0] = i;\n        zuoshang[1] = j;\n      } else if (*(p + i * n + j) == 0 && *(p + i * n + j - 1) == 0 &&\n                 *(p + (i - 1) * n + j) == 0 && j - 1 > 0 && i - 1 > 0) {\n        youxia[0] = i;\n        youxia[1] = j;\n      }\n    }\n  mianji = (youxia[0] - zuoshang[0] - 1) * (youxia[1] - zuoshang[1] - 1);\n  cout << mianji << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28295", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int **pp;\n  int n, i, j, k = 0, t = 0, b, c, area;\n  scanf(\"%d \", &n);\n  pp = (int **)malloc(n * sizeof(int *));\n  for (i = 0; i < n; i++)\n    pp[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &pp[i][j]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (pp[i - 1][j] - pp[i][j] == 255 && pp[i][j - 1] - pp[i][j] == 255) {\n        k = i;\n        t = j;\n      }\n      if (pp[i][j + 1] - pp[i][j] == 255 && pp[i + 1][j] - pp[i][j] == 255) {\n        b = i;\n        c = j;\n      }\n    }\n  }\n  area = (b - k - 1) * (c - t - 1);\n  printf(\"%d\\n\", area);\n  for (i = 0; i < n; i++)\n    free(pp[i]);\n  free(pp);\n  return 0;\n}\n"}
{"label": "15", "index": "28296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zl[1000][1000];\nint main() {\n  int i, j, n, a, b, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n\n      break;\n    }\n  }\n  a = i;\n  b = j;\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (zl[i][j] == 0) {\n        break;\n      }\n    }\n    if (zl[i][j] == 0) {\n      break;\n    }\n  }\n  s = (i - a - 1) * (j - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, s = 1, m, l;\n  long i = 0;\n  scanf(\"%d\", &n);\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      break;\n  }\n  m = i;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0)\n      s += 1;\n    if (a != 0)\n      break;\n  }\n  l = i - 1;\n  while (1) {\n    i += 1;\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      s += 1;\n    }\n    if (i >= n * n)\n      break;\n  }\n  cout << ((s - (l - m + 1) * 2) / 2) * (l - m - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], row, col, ROW1, COL1, ROW2, COL2, sum;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &a[row][col]);\n    }\n  }\n\n  int flag = 0;\n  for (row = 0; row < n && !flag; row++) {\n    for (col = 0; col < n && !flag; col++) {\n      if (a[row][col] == 0) {\n        ROW1 = row;\n        COL1 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  flag = 0;\n  for (row = n - 1; row >= 0 && !flag; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (a[row][col] == 0) {\n        ROW2 = row;\n        COL2 = col;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  sum = (ROW2 - ROW1 - 1) * (COL2 - COL1 - 1);\n\n  printf(\"%d\\n\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, x, y, s;\n  a = 0;\n  b = 0;\n  x = -1;\n  y = -1;\n  scanf(\"%d\", &n);\n  int tx[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &tx[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tx[i][j] == 0) {\n        x = j;\n        y = i;\n        break;\n      }\n    }\n    if ((x == j) && (y == i))\n      break;\n  }\n  for (x = j; x < n; x++) {\n    if (tx[x][i] == 0) {\n      a = a + 1;\n    }\n  }\n  for (y = i; y < n; y++) {\n    if (tx[j][y] == 0) {\n      b = b + 1;\n    }\n  }\n  s = a * b - 2 * (a + b - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, x0, y0, x1, y1;\n  int pixel;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &pixel);\n    if (pixel == 0) {\n      x0 = i / n;\n      y0 = i % n;\n      break;\n    }\n  }\n  for (i = i + 1; i < n * n; i++) {\n    scanf(\"%d\", &pixel);\n    if (pixel == 0) {\n      x1 = i / n;\n      y1 = i % n;\n    }\n  }\n\n  cout << (x1 - x0 - 1) * (y1 - y0 - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28301", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, b, c, d = 0, x1, x2, y1, y2, m;\n  scanf(\"%d\", &n);\n  for (b = 0; b < n; b++) {\n    for (c = 0; c < n; c++) {\n      scanf(\"%d\", &a[b][c]);\n      if (a[b][c] == 0 && d == 0) {\n        x1 = b;\n        y1 = c;\n        d = 1;\n      } else if (a[b][c] == 0 && d == 1) {\n        x2 = b;\n        y2 = c;\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, tmp1, tmp2, m = 0, l = 0, i, s;\n  cin >> n;\n  cin >> tmp1;\n  if (tmp1 == 0) {\n    m++;\n    l++;\n  }\n  for (i = 1; i < n * n; i++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n    m += (tmp2 == 0);\n    if (tmp2 == 255 && tmp1 == 0)\n      break;\n\n    tmp1 = tmp2;\n  }\n  for (int j = i; j < n * n; j++) {\n    cin >> tmp2;\n    l += (tmp2 == 0);\n  }\n  s = (m - 2) * (l - 2 * m) / 2;\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int p[100][100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n\n  int e, b, h, k, kk = 0;\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0) {\n        e = h;\n        b = k;\n        kk = 1;\n        break;\n      }\n    }\n    if (kk == 1)\n      break;\n  }\n  int c, d, l, m;\n  for (l = 0; l < n; l++) {\n    for (m = 0; m < n; m++) {\n      if (p[l][m] == 0) {\n        c = l;\n        d = m;\n      }\n    }\n  }\n  int s;\n  s = (c - e - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, rol, col, a, b, c, d, x;\n  int sz1[100][100];\n  scanf(\"%d\", &n);\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz1[rol][col]));\n  }\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      if (sz1[rol][col] == 0) {\n        b = col;\n        break;\n      }\n    }\n  }\n  for (col = 0; col < n; col++) {\n    for (rol = 0; rol < n; rol++) {\n      if (sz1[rol][col] == 0) {\n        a = rol;\n        break;\n      }\n    }\n  }\n  for (col = b; col < n; col++) {\n    if (sz1[a][col] != 0) {\n      d = col - 1;\n      break;\n    }\n  }\n\n  for (rol = a; rol < n; rol++) {\n    if (sz1[rol][d] != 0) {\n      c = rol - 1;\n      break;\n    }\n  }\n\n  x = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int p, q;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      scanf(\"%d\", &(a[p][q]));\n    }\n  }\n  int p1 = 0, p2 = 0, q1, q2;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      if (a[p][q] == 0) {\n        p1 = p;\n        q1 = q;\n        break;\n      }\n      if (p1 != 0)\n        break;\n    }\n    if (p1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        p2 = p;\n        q2 = q;\n        break;\n      }\n      if (p2 != 0)\n        break;\n    }\n    if (p2 != 0)\n      break;\n  }\n  int x;\n  x = (p2 - p1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int sz[1000][1000];\n  int x1, y1;\n  int x2, y2;\n  int k, i;\n  int s;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &(sz[k][i]));\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (sz[k][i] == 0) {\n        x1 = i;\n        y1 = k;\n        break;\n      }\n    }\n  }\n  for (k = n - 1; k >= 0; k--) {\n    for (i = n - 1; i >= 0; i--) {\n      if (sz[k][i] == 0) {\n        x2 = i;\n        y2 = k;\n        break;\n      }\n    }\n  }\n  s = (abs(x2 - x1) - 1) * (abs(y2 - y1) - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28307", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[1000][1000], m = 0, p, q;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0)\n        break;\n    }\n    p = j;\n    for (j = n; j >= 0; j--) {\n      if (a[i][j] == 0 && a[i][j - 1] != 0)\n        break;\n    }\n    q = j;\n    if (q > p)\n      m = m + q - p - 1;\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28308", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, a[100][100], i, j, i1, i2, j1, j2, k1 = 0, k2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        k1 = 1;\n        break;\n      }\n    if (k1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        k2 = 1;\n        break;\n      }\n    if (k2 == 1)\n      break;\n  }\n  printf(\"%d\", ((i2 - i1 - 1) * (j2 - j1 - 1)));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int i, j, n, b = 0, c, d = 0, m, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        break;\n      }\n    }\n    if (b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n\n      if (a[i][j] == 0) {\n        d = i;\n        m = j;\n        break;\n      }\n    }\n    if (d != 0)\n      break;\n  }\n  s = (d - b - 1) * (m - c - 1);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j;\n  int m1 = 0, n1 = 0, m2 = 0, n2 = 0, s = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        m1 = i;\n        n1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        m2 = i;\n        n2 = j;\n      }\n    }\n  }\n\n  s = (m2 - m1 - 1) * (n2 - n1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28311", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d \", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * (m - i) / 2;\n  printf(\"\\n%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, number[1001], i, p, count, start, end;\n  count = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    start = 0;\n    end = 0;\n    for (p = 1; p <= n; p++) {\n      scanf(\"%d\", &number[p]);\n    }\n    for (p = 1; p <= n - 1; p++) {\n      if (start == 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        start = p;\n      }\n      if (start != 0 && number[p] == 0 && (p == 1 || number[p - 1] != 0) &&\n          number[p + 1] != 0) {\n        end = p;\n      }\n    }\n    if (end - start <= 1) {\n      continue;\n    }\n    count += (end - start - 1);\n  }\n  cout << count;\n  return 0;\n}\n"}
{"label": "15", "index": "28313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[10][10];\n  int N;\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  int c = 0, d;\n  int count0;\n  int q;\n  count0 = 0;\n  c = 0;\n  d = 0;\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n\n      if (s[i][j] == 0) {\n        q++;\n        count0++;\n      }\n    }\n    if (q > 1) {\n      d++;\n    }\n    if (q > c) {\n      c = q;\n    }\n  }\n  N = d * c - count0;\n  cout << N;\n  return 0;\n}\n"}
{"label": "15", "index": "28314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s;\n  cin >> n;\n  int **p;\n  p = (int **)malloc(sizeof(int *) * n);\n  for (i = 0; i < n; i++)\n    p[i] = (int *)malloc(sizeof(int) * n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (p[i][j] == 0) {\n        if (p[i][j] != p[i - 1][j] && p[i][j] != p[i][j - 1]) {\n          a = i, b = j;\n          break;\n        }\n        if (p[i][j] != p[i + 1][j] && p[i][j] != p[i][j + 1]) {\n          c = i, d = j;\n          break;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  cout << s << \"\\n\";\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s[1500][1500], inside = 0, total = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if ((s[i][j] == 0) && (s[i][j + 1] == 0))\n        do {\n          j++;\n        } while ((j < n) && (s[i][j] == 0));\n      else if ((s[i][j] == 0) && (s[i][j + 1] != 0)) {\n        do {\n          j++;\n          if (s[i][j] > 0)\n            inside++;\n        } while ((j < n) && (s[i][j] != 0));\n      }\n    }\n  cout << inside << endl;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, S, notfind = 1, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n && notfind; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        notfind = 0;\n        break;\n      }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << S << \"\\n\";\n}\n"}
{"label": "15", "index": "28317", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], s, i, n, j, a1, b1, a2, b2, p = 0, l, w;\n  cin >> n;\n  for (i = 0; i < n; i = i + 1) {\n    for (j = 0; j < n; j = j + 1)\n      cin >> a[i][j];\n  }\n  for (i = 0; i < n; i = i + 1) {\n    if (p == 0)\n      for (j = 0; j < n; j = j + 1) {\n        if (a[i][j] == 0) {\n          a1 = i;\n          b1 = j;\n          p = p + 1;\n        }\n      }\n  }\n  p = 0;\n  for (i = n - 1; i >= 0; i--) {\n    if (p == 0)\n      for (j = n - 1; j >= 0; j = j - 1) {\n        if (a[i][j] == 0) {\n          a2 = i;\n          b2 = j;\n          p = p + 1;\n        }\n      }\n  }\n  l = b2 - b1 + 1;\n  w = a1 - a2 + 1;\n  s = w * l;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, n, a[100][100], i, j, x1, x2, num1, num2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if (j < n)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--)\n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    if (j >= 0)\n      break;\n  }\n  num1 = x2 - x1 + 1;\n  num2 = y2 - y1 + 1;\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "28319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, l, m, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n    scanf(\"%d\", &a[i][n - 1]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m++;\n        break;\n      }\n    }\n  }\n  l = 0;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        l++;\n\n        break;\n      }\n    }\n\n  s = (l - 2) * (m - 2);\n  cout << s;\n}\n"}
{"label": "15", "index": "28320", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[1001][1001] = {0};\n  int i, j, temp = 0;\n  int c1, c2, d1, d2, f1, f2, g1, g2;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        c1 = i;\n        c2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i + 1][j] == 0) {\n        d1 = i;\n        d2 = j;\n      }\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j + 1] == 0) {\n        f1 = i;\n        f2 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        g1 = i;\n        g2 = j;\n      }\n    }\n  }\n  temp = (d2 - c2 - 1) * (f1 - c1 - 1);\n  printf(\"%d\", temp);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, p[100][100], a, b, c, d;\n  memset(p, 1, sizeof(p));\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> *(*(p + i) + j);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) == 0) {\n        a = i;\n        b = j;\n      }\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) == 0 &&\n          *(*(p + i - 1) + j) != 0 && *(*(p + i + 1) + j) == 0 &&\n          *(*(p + i) + j + 1) != 0)\n        c = j;\n      if (*(*(p + i) + j) == 0 && *(*(p + i) + j - 1) != 0 &&\n          *(*(p + i - 1) + j) == 0 && *(*(p + i + 1) + j) != 0 &&\n          *(*(p + i) + j + 1) == 0)\n        d = i;\n    }\n  printf(\"%d\\n\", (d - a - 1) * (c - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28322", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  int s[100][100] = {0};\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> s[i][j];\n  for (i = 1; i <= n; i++) {\n    s[i][0] = 255;\n    s[i][n + 1] = 255;\n  }\n  for (j = 1; j <= n; j++) {\n    s[0][j] = 255;\n    s[n + 1][j] = 255;\n  }\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0 && s[i][j + 1] == 0 && s[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (s[i][j] == 0 && s[i][j - 1] == 0 && s[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28323", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1001][1001];\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j)\n      cin >> a[i][j];\n  }\n  int sx, sy, ex, ey, flag = 0;\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0 && flag == 0) {\n        sx = i;\n        sy = j;\n        flag = 1;\n      } else if (a[i][j] == 0 && flag == 1) {\n        ex = i;\n        ey = j;\n      }\n    }\n  }\n  sx += 1;\n  sy += 1;\n  ex -= 1;\n  ey -= 1;\n  int sum = (ex - sx + 1) * (ey - sy + 1);\n  cout << sum << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n, b, c, d, e, i, j, s;\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    for (i = 1; i <= n; i++) {\n      cin >> a[i][j];\n      if ((a[i][j] == 0) && (a[i - 1][j] != 0) && (a[i][j - 1] != 0)) {\n        b = i;\n        c = j;\n      } else if ((a[i][j] == 0) && (a[i - 1][j] == 0) && (a[i][j - 1] == 0)) {\n        d = i;\n        e = j;\n      }\n    }\n  }\n  s = (d - b - 1) * (e - c - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28325", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a1, b1, a2, b2;\n  int n, t, area;\n  int s = 0;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (s == 0) {\n          a1 = i;\n          b1 = j;\n          s = 1;\n        }\n        a2 = i;\n        b2 = j;\n      }\n    }\n\n  area = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, a[1000][1000], flag = 0, number;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0) {\n        k++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  flag = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        m++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  number = (k - 2) * (m - 2);\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "15", "index": "28327", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int val[1000][1000];\n  int i, j, posr, posc, n, r, c, flag = 0;\n\n  cin >> n;\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &val[i][j]);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (val[i][j] == 0 && flag == 0) {\n        flag = 1;\n        posr = i;\n        posc = j;\n      }\n\n  i = posr;\n  while (val[i++][posc] == 0)\n    ;\n\n  r = i - posr - 3;\n\n  for (j = posc; val[posr][j] == 0; j++)\n    ;\n  c = j - posc - 2;\n\n  printf(\"%d\", r * c);\n\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "15", "index": "28328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[10000][10000];\nint main() {\n  int n, i, j, a1, b1, a2, b2, sum, flag;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    flag = 0;\n    for (j = n - 1; j > 0; j--) {\n      if (s[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n  sum = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "28329", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int *data;\n  data = (int *)malloc(sizeof(int) * n * n);\n  int i, j, k;\n  int p = 0, q = 0, t = 0, s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &data[i * n + j]);\n\n    for (k = 0; k < n; k++) {\n      if (data[i * n + k] == 0) {\n        p = i + 1;\n        q = k + 1;\n      }\n    }\n  }\n  int u, v;\n  for (u = n - 1; u >= 0; u--) {\n    for (v = n - 1; v >= 0; v--) {\n      if (data[u * n + v] == 0) {\n        t = u + 1;\n        s = v + 1;\n      }\n    }\n  }\n  int x, y, z;\n  y = q - s - 1;\n  x = p - t - 1;\n  z = x * y;\n  printf(\"%d\\n\", z);\n  return 0;\n}\n"}
{"label": "15", "index": "28330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, b, c, d, e, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] != 0) && (a[i][j + 1] == 0)) {\n        b = i;\n        c = j + 1;\n      }\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0)) {\n        d = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if ((a[i][j] == 0) && (a[i + 1][j] != 0)) {\n        e = i;\n        j = n;\n      }\n    }\n  }\n  s = (d - c + 1) * (e - b + 1) - (4 + (d - c - 1) * 2 + (e - b - 1) * 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c, x = 0, d, m, a[500][500];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        k = i;\n        m = j;\n        continue;\n      }\n    }\n  }\n  c = 0;\n  d = 0;\n  for (i = k; i > 0; i--) {\n    if (a[i][m] == 0)\n      c = c + 1;\n    else\n      break;\n  }\n  for (j = m; j > 0; j--) {\n    if (a[k][j] == 0)\n      d = d + 1;\n    else\n      break;\n  }\n  for (i = k - 1; i >= (k - c + 2); i--) {\n    for (j = m - 1; j >= (m - d + 2); j--) {\n      if (a[i][j] == 255)\n        x = x + 1;\n      else if (a[i][j] == 0)\n        break;\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int x1, y1, x2, y2, area = 0;\n  int n, i, j;\n  \n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      \n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  \n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      \n      if (a[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  \n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, S, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    if ((a[i][j] == 0) &&\n        (j < n)) \n      break;\n  }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "28334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int s[100][100];\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, a = 0, b = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a += 1;\n        break;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[i][j] == 0) {\n        b += 1;\n        break;\n      }\n    }\n  }\n  int x;\n  x = (a - 2) * (b - 2);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "28335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s, first = 0;\n  int num[100][100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && first == 0) {\n        a = i;\n        b = j;\n        first = 1;\n      }\n      if (num[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int shuzu[1002][1002];\n  int n, i, j, x1, y1, x2, y2;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &shuzu[i][j]);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (shuzu[i][j] == 0 && shuzu[i][j + 1] == 0 && shuzu[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (shuzu[i][j] == 0 && shuzu[i][j - 1] == 0 && shuzu[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  cout << (x2 - x1 + 1) * (y2 - y1 + 1) - 2 * (x2 - x1 + 1) -\n              2 * (y2 - y1 + 1) + 4\n       << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, (*p)[101], x1, y1, x2, y2, flag1, flag2;\n  int a[101][101];\n  x1 = 0;\n  y1 = 0;\n  x2 = 0;\n  y2 = 0;\n  flag1 = 0;\n  flag2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        x1 = i;\n        y1 = j;\n        flag1 = 1;\n        break;\n      }\n    }\n    if (flag1 == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (*(*(p + i) + j) == 0) {\n        x2 = i;\n        y2 = j;\n        flag2 = 1;\n        break;\n      }\n    }\n    if (flag2 == 1)\n      break;\n  }\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int a[n][n], b, c, d, e, f, i, j, zhi = 0;\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0 && zhi == 0) {\n        b = i;\n        c = j;\n        zhi++;\n      }\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n      }\n    }\n  f = (d - b - 1) * (e - c - 1);\n  printf(\"%d\", f);\n}\n"}
{"label": "15", "index": "28339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int i, j, n, t, i1 = 0, j1 = 0, i2 = 0, j2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n    {\n      for (j = 0; j <= n - 1; j++)\n        if (a[i][j] == 0) {\n          i1 = i;\n          j1 = j;\n          break;\n        }\n    }\n    if (a[i1][j1] == 0)\n      break;\n  }\n  for (i = n - 1; i >= i1; i--) {\n    {\n      for (j = n - 1; j >= 0; j--)\n        if (a[i][j] == 0) {\n          i2 = i;\n          j2 = j;\n          break;\n        }\n      if (a[i2][j2] == 0)\n        break;\n    }\n  }\n  t = (i2 - i1 - 1) * (j2 - j1 - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "28340", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, i, j, x, y, s, m[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> m[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i + 1][j] == 0 && m[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (m[i][j] == 0 && m[i][j - 1] == 0 && m[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  x = c - a - 1;\n  y = d - b - 1;\n  s = x * y;\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, i, j, b, t, q, sum;\n  scanf(\"%d\", &n);\n  for (i = 0, t = 0; i <= (n - 1); i++) {\n    for (j = 0, sum = 0; j <= (n - 1); j++) {\n      cin >> a[j];\n      sum = sum + a[j];\n    }\n    if (sum == (n * 255))\n      continue;\n    b = (n * 255 - sum) / 255;\n    t = t + 1;\n  }\n  q = (t - 2) * (b - 2);\n  cout << q;\n}\n"}
{"label": "15", "index": "28342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], *p, *p1, *p2, n, i, j, hang1, lie1, hang2, lie2, m = 0;\n  scanf(\"%d\", &n);\n  for (i = 0, p = &a[i][0]; i < n; i++)\n    for (j = 0; j < n; j++, p++) {\n      scanf(\"%d\", p);\n      if (*p == 0 && m == 0) {\n        p1 = p;\n        hang1 = i;\n        lie1 = j;\n        m = 1;\n      }\n      if (*p == 0) {\n        p2 = p;\n        hang2 = i;\n        lie2 = j;\n      }\n    }\n  printf(\"%d\", (hang2 - hang1 - 1) * (lie2 - lie1 - 1));\n}\n"}
{"label": "15", "index": "28343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int state = 0;\n  int n, t, i, j, m, m1, m2;\n  int leftx, lefty, rightx, righty;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (state == 0) {\n          leftx = i;\n          lefty = j;\n          state = 1;\n        } else {\n          rightx = i;\n          righty = j;\n        }\n      }\n    }\n  }\n  m1 = (rightx - leftx - 1);\n  m2 = (righty - lefty - 1);\n  m = m1 * m2;\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "28344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, row, col, a, b, c, d;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &sz[row][col]);\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((sz[row][col] == 0) && (sz[row][col - 1] != 0) &&\n          (sz[row - 1][col] != 0)) {\n        a = row;\n        b = col;\n      }\n      if ((sz[row][col] == 0) && (sz[row][col + 1] != 0) &&\n          (sz[row + 1][col] != 0)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  if ((c - a - 1 > 0) && (d - b - 1 > 0)) {\n    int s = (c - a - 1) * (d - b - 1);\n    printf(\"%d\", s);\n  } else {\n    int s = 0;\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28345", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n[1000][1000], num, i, j, sta_r, sta_c, end_r, end_c, S;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][0] == 0) {\n      sta_r = i;\n      sta_c = 0;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[0][j] == 0) {\n      sta_r = 0;\n      sta_c = j;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][num - 1] == 0) {\n      end_r = i;\n      end_c = num - 1;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[num - 1][j] == 0) {\n      sta_r = num - 1;\n      sta_c = j;\n    }\n  }\n  for (i = 1; i < num - 1; i++) {\n    for (j = 1; j < num - 1; j++) {\n      if ((n[i][j] == 0) && (n[i + 1][j] == 0) && (n[i][j + 1] == 0)) {\n        sta_r = i;\n        sta_c = j;\n      }\n      if ((n[i][j] == 0) && (n[i - 1][j] == 0) && (n[i][j - 1] == 0)) {\n        end_r = i;\n        end_c = j;\n      }\n    }\n  }\n  S = (end_r - sta_r - 1) * (end_c - sta_r - 1);\n  printf(\"%d\", S);\n  return 0;\n}\n"}
{"label": "15", "index": "28346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, pi = 0, pj, r = 0, a;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (pj = 0, j = 0; j < n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        pj++;\n        r++;\n      }\n    }\n    if (pj != 0)\n      pi++;\n  }\n  printf(\"%d\", (r / 2 - pi) * (pi - 2));\n}\n"}
{"label": "15", "index": "28347", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], x = 0, y = 0, s;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++) {\n    if (x == 0)\n      for (j = 0; j < n; j++) {\n        if (a[i][j] == 0)\n          x++;\n      }\n    else\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    if (y == 0)\n      for (i = 0; i < n; i++)\n\n      {\n        if (a[i][j] == 0)\n\n          y++;\n      }\n\n    else\n      break;\n  }\n\n  s = (y - 2) * (x - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28348", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n];\n  int i, j;\n  int e, b, c, d, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        e = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28349", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int tumour[256][256], n, i, j, x1 = -1, y1, x2 = -1, y2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &tumour[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x1 = i;\n        y1 = j;\n        break;\n      }\n    }\n    if (x1 >= 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (tumour[i][j])\n        continue;\n      else {\n        x2 = i;\n        y2 = j;\n        break;\n      }\n    }\n    if (x2 >= 0)\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int sz[1000][1000];\n  int a1, a2, b1, b2, a, b, c;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "28351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28352", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int row, col, n, sum, a, b, c, d, s;\n  long pic[100][100];\n  scanf(\"%d \", &n);\n\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      cin >> pic[row][col];\n    }\n  }\n\n  sum = 0;\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if ((pic[row][col] == 0) && (pic[row - 1][col - 1] == 255) &&\n          (pic[row - 1][col] == 255) && (pic[row][col - 1] == 255)) {\n        a = row;\n        b = col;\n      }\n    }\n  }\n\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if ((pic[row][col] == 0) && (pic[row + 1][col + 1] == 255) &&\n          (pic[row + 1][col] == 255) && (pic[row][col + 1] == 255)) {\n        c = row;\n        d = col;\n      }\n    }\n  }\n\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sa[100][100];\n  int m, n;\n  int k;\n  int a, b, c, d, e;\n  scanf(\"%d\", &k);\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      scanf(\"%d\", &(sa[m][n]));\n    }\n  }\n  for (m = 0; m < k; m++) {\n    for (n = 0; n < k; n++) {\n      if (sa[m][n] == 0) {\n        goto ll;\n      }\n    }\n  }\nll:\n  a = m;\n  b = n;\n  for (m = k - 1; m >= 0; m--) {\n    for (n = k - 1; n >= 0; n--) {\n      if (sa[m][n] == 0) {\n        goto rr;\n      }\n    }\n  }\nrr:\n  c = m;\n  d = n;\n\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int e, f = 0, g[1000];\n\n  int n;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  while (i < n) {\n    int k = 0;\n    while (k < n) {\n      cin >> e;\n      if (e == 0) {\n        f++;\n      }\n      k++;\n    }\n\n    g[i] = f;\n    f = 0;\n    i++;\n  }\n\n  int m = 0, x, y;\n  int j = 0;\n  while (j < n) {\n    if (g[j] > m) {\n      m = g[j];\n    }\n    if (g[j] == 0 && g[j + 1] != 0) {\n      x = j;\n    }\n    if (g[j] != 0 && g[j + 1] == 0) {\n      y = j;\n    }\n    j++;\n  }\n\n  int d, sum;\n  d = y - x;\n  sum = (m - 2) * (d - 2);\n  cout << sum << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1001][1001], s = 0;\n  int(*p)[1001], x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  cin >> n;\n  p = a;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> *(*(p + i) + j);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(p + i) + j) == 0) {\n        if ((*(*(p + i) + j + 1) == 0) && (*(*(p + i + 1) + j) == 0)) {\n          x1 = i;\n          y1 = j;\n        }\n        if ((*(*(p + i) + j - 1) == 0) && (*(*(p + i - 1) + j) == 0)) {\n          x2 = i;\n          y2 = j;\n        }\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n    if (x == 0)\n      break;\n  }\n\n  for (j = j1 + 1; j < n; j++)\n    scanf(\"%d\", &x);\n\n  for (i = i1 + 1; i < n; i++) {\n    int y = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28357", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, a = 0, t;\n  cin >> n;\n  for (i = 1; i <= n * n; i++)\n\n  {\n    scanf(\"%d\", &m);\n    if (m == 0)\n      a = a + 1;\n  }\n\n  t = (a + 4) / 4;\n  printf(\"%d\", (t - 2) * (t - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, x0, y0, x1, y1;\n  int pixel;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    cin >> pixel;\n    if (pixel == 0) {\n      x0 = i / n;\n      y0 = i % n;\n      break;\n    }\n  }\n  for (i = i + 1; i < n * n; i++) {\n    cin >> pixel;\n    if (pixel == 0) {\n      x1 = i / n;\n      y1 = i % n;\n    }\n  }\n\n  cout << (x1 - x0 - 1) * (y1 - y0 - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, n[1000][1000], i, p, x1, y1, x2, y2, s;\n  i = 0;\n  p = 0;\n  cin >> a;\n  for (i = 0; i < a; i++) {\n    for (p = 0; p < a; p++) {\n      cin >> (n[i][p]);\n    }\n  }\n  if ((n[0][0] == 0) && (n[1][0] == 0) && (n[0][1]) == 0) {\n    x1 = 0;\n    y1 = 0;\n  }\n  if ((n[a - 1][a - 1] == 0 && (n[a - 2][a - 1] == 0) &&\n       (n[a - 1][a - 2]) == 0)) {\n    x2 = a - 1;\n    y2 = a - 1;\n  }\n  for (i = 1; i < a - 1; i++) {\n    for (p = 1; p < a - 1; p++) {\n      if ((n[i][p] == 0) && (n[i + 1][p] == 0) && (n[i][p + 1]) == 0) {\n        x1 = i;\n        y1 = p;\n      }\n      if ((n[i][p] == 0) && (n[i - 1][p] == 0) && (n[i][p - 1]) == 0) {\n        x2 = i;\n        y2 = p;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, j, sum = 0, m, k, x;\n  int edge[100][100];\n\n  scanf(\"%d\\n\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> edge[i][j];\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      m = sum;\n      break;\n    }\n  }\n\n  sum = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (edge[i][j] == 0)\n        sum = sum + 1;\n    }\n    if (sum > 2) {\n      k = sum;\n      break;\n    }\n  }\n  x = (k - 2) * (m - 2);\n\n  cout << x << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int p[100][100];\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n\n  int e, b, h, k, kk = 0;\n  for (h = 0; h < n; h++) {\n    for (k = 0; k < n; k++) {\n      if (p[h][k] == 0) {\n        e = h;\n        b = k;\n        kk = 1;\n        break;\n      }\n    }\n    if (kk == 1)\n      break;\n  }\n  int c, d, l, m;\n  for (l = 0; l < n; l++) {\n    for (m = 0; m < n; m++) {\n      if (p[l][m] == 0) {\n        c = l;\n        d = m;\n      }\n    }\n  }\n  int s;\n  s = (c - e - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, a = 0, b, m = 0, flag = 0, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &p);\n    if (p == 0) {\n      if (m == 0) {\n        flag = 1;\n        a++;\n        m++;\n      } else {\n        if (flag == 1) {\n          m++;\n          a++;\n        } else {\n          m++;\n        }\n      }\n    } else {\n      if (flag == 1)\n        flag = 0;\n    }\n  }\n  b = m / 2 - a;\n  a = a - 2;\n  printf(\"%d\", a * b);\n}\n"}
{"label": "15", "index": "28363", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], num = 0, v, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        for (k = j;; k++) {\n          if (a[i][k] != 0) {\n            break;\n          }\n        }\n        for (v = i;; v++) {\n          if (a[v][j] != 0) {\n            break;\n          }\n        }\n        num = (k - j - 2) * (v - i - 2);\n        break;\n      }\n      if (num != 0)\n        break;\n    }\n  }\n  cout << num << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000];\n  int n, i, j, a1, a2, b1, b2, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((sz[i][j] == 0) && (sz[i - 1][j] != 0) && (sz[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if ((sz[i][j] == 0) && (sz[i + 1][j] != 0) && (sz[i][j + 1] != 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sz[100][100];\n  int row, col, n, x = 0, k;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++)\n      scanf(\"%d\", &(sz[row][col]));\n  }\n\n  k = 2;\n\n  for (row = k; row < n - k; row++) {\n    for (col = k; col < n - k; col++) {\n      if (sz[row][col] != 0)\n        x++;\n    }\n  }\n\n  cout << x << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int i, j, n, a1 = -1, a2 = -1, b1, b2, result;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a1 != -1) {\n      break;\n    }\n  }\n  for (i = n - 1; i > -1; i--) {\n    for (j = n - 1; j > -1; j--) {\n      if (sz[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (a2 != -1) {\n      break;\n    }\n  }\n  result = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "28367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint main() {\n  int n, i, j, b = 0, c = 0, d = 0, e = 0, f, x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = i;\n        c = j;\n        x = 1;\n        break;\n      }\n    }\n    if (x == 1)\n      break;\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = i;\n        e = j;\n        y = 1;\n        break;\n      }\n    }\n    if (y == 1)\n      break;\n  }\n\n  f = (d - b - 1) * (e - c - 1);\n  printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28368", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int sz[100][100], i, j, a = -1, b = -1, c, d, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> sz[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0 && b >= 0)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  n = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "15", "index": "28369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint s[1000][1000];\nint main() {\n  int n, i, k, area, a, b, c, d;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> s[i][k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        a = i;\n        b = k;\n        break;\n      }\n    }\n    if (k == n) {\n      if (s[i][k - 1] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (s[i][k] == 0) {\n        c = i;\n        d = k;\n        break;\n      }\n    }\n    if (k == -1) {\n      if (s[i][0] == 0) {\n        break;\n      }\n    } else {\n      break;\n    }\n  }\n  area = (d - b - 1) * (c - a - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "28370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, N[1000][1000], i, j, n, m, a = 0, b = 0, s;\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      scanf(\"%d\", &N[i][j]);\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (N[i][j] == 0) {\n        n = i;\n        m = j;\n      }\n    }\n  }\n  for (i = n, j = m; j < t; j--) {\n    if (N[i][j] == 0)\n      a++;\n    else\n      break;\n  }\n  for (j = m, i = n; i < t; i--) {\n    if (N[i][j] == 0)\n      b++;\n    else\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, sz[1000][1000], a, b, c, d, e = 1, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n\n      if (sz[i][j] == 0 && e == 1) {\n        a = i;\n        b = j;\n        e = 0;\n      }\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28372", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0, m, l, p, q;\n  int a = 0, b = 0;\n  int sz[1000][1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &sz[i][k]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (sz[i][k] == 0 && a == 0) {\n\n        m = i;\n        l = k;\n        a = 1;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0 && b == 0) {\n\n        p = i;\n        q = k;\n        b = 1;\n      }\n    }\n  }\n  sum = (p - m - 1) * (q - l - 1);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28373", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, h1 = 0, l1 = 0, h2 = 0, l2 = 0, s = 0;\n  cin >> n;\n  int a[n][n];\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        h1 = i + 1;\n        l1 = j + 1;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        h2 = i + 1;\n        l2 = j + 1;\n        goto loop2;\n      }\n    }\n  }\nloop2:\n  s = (h2 - h1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  b = 0;\n  int sz[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n * n - 1; i++) {\n    cin >> a;\n    if (a == 0) {\n      sz[b] = i;\n      b++;\n    }\n  }\n  c = (sz[b - 1] + 1) % n - (sz[0] + 1) % n + 1;\n  d = (b + 2) / 2 - c + 1;\n  s = (c - 2) * (d - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, s = 0, u;\n  int image[100][100];\n  scanf(\"%d \", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &(image[row][col]));\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int k = 0;\n    for (int j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n\n        k++;\n      }\n    }\n    if (k > 0) {\n      u = k;\n      s++;\n    }\n  }\n  int m = (u - 2) * (s - 2);\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "28376", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, star1, star2, end1, end2, b, n;\n  int f = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && f == 0) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (a[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  b = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "15", "index": "28377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[1000][1000], n, i, j, a = 0, b = 1000, c = 0, d = 1000, x, y, s;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        if (i > a) {\n          a = i;\n        }\n        if (i < b) {\n          b = i;\n        }\n\n        if (j > c) {\n          c = j;\n        }\n        if (j < d) {\n          d = j;\n        }\n      }\n    }\n  }\n  x = a - b - 1;\n  y = c - d - 1;\n  s = x * y;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x1, y1, x2, y2, situ = 1;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        y2 = i;\n        x2 = j;\n      }\n    }\n  }\n  for (i = 0; situ; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        situ = 0;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  n = (x2 - x1 + 1) * (y2 - y1 + 1) -\n      (2 * (x2 - x1 + 1) + 2 * (y2 - y1 + 1) - 4);\n  cout << n;\n  return 0;\n}\n"}
{"label": "15", "index": "28379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], i1, i2, j1, j2, p;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = 1;\n  for (i = 0; i < n && p; i++)\n    for (j = 0; j < n && p; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        p = 0;\n      }\n  p = 1;\n  for (i = n - 1; i >= 0 && p; i--)\n    for (j = n - 1; j >= 0 && p; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        p = 0;\n      }\n  cout << (i2 - i1 - 1) * (j2 - j1 - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, M;\n  scanf(\"%d\", &N);\n  M = N;\n\n  int k[50][50];\n  int i, j, y = 0;\n  int sum = 0;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      cin >> k[i][j];\n    }\n  }\n\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < M; j++) {\n      if (k[i][j] == 0) {\n        sum++;\n      }\n    }\n  }\n  y = (sum / 4 - 1) * (sum / 4 - 1);\n  printf(\"%d\", y);\n  return 0;\n}\n"}
{"label": "15", "index": "28381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, i, j, x, y, s, m[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &m[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (m[i][j] == 0 && m[i + 1][j] == 0 && m[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (m[i][j] == 0 && m[i][j - 1] == 0 && m[i - 1][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  x = c - a - 1;\n  y = d - b - 1;\n  s = x * y;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28382", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int photo[300][300] = {1};\n  int n;\n  int i, j;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      int t;\n      cin >> t;\n      if (t == 255)\n        t = 1;\n      photo[i][j] = t;\n    }\n  }\n  int found = 0;\n  int Lx, Ly, Bx, By;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (photo[i][j] == 0) {\n        Lx = i;\n        Ly = j;\n        found = 1;\n        break;\n      }\n    }\n    if (found) {\n      break;\n    }\n  }\n  found = 0;\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (photo[i][j] == 0) {\n        Bx = i;\n        By = j;\n        found = 1;\n        break;\n      }\n      if (found) {\n        break;\n      }\n    }\n  }\n  int w = Bx - Lx - 1;\n  int h = By - Ly - 1;\n  cout << w * h << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int a[500][500];\n  int sum[500] = {0};\n  int l, s, h;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        sum[i]++;\n    }\n\n    if (sum[i] > 2 && flag == 0) {\n      l = i;\n      flag = 1;\n    } else if (sum[i] > 2 && flag == 1) {\n      l = i - l - 1;\n      h = sum[i] - 2;\n    }\n  }\n  s = h * l;\n  if (flag == 1)\n    printf(\"%d\\n\", s);\n\n  else {\n    printf(\"0\\n\");\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28384", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[1100][1100];\n  scanf(\"%d \", &n);\n  int ans = 0;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        continue;\n      else {\n        int f = 0;\n        for (int k = i + 1; k <= n; k++) {\n          if (a[k][j] == 0 && a[k][j + 1] == 0)\n            f++;\n        }\n        if (f % 2 == 1)\n          ans++;\n      }\n    }\n  }\n  cout << ans;\n  return 0;\n}\n"}
{"label": "15", "index": "28385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int a[1000][1000];\n  int n, i, j, point1, point2, row1, colum1, row2, colum2, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        point1 = a[i][j];\n        row1 = i;\n        colum1 = j;\n        i = n + 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        point2 = a[i][j];\n        row2 = i;\n        colum2 = j;\n        i = -1;\n        break;\n      }\n    }\n  }\n  num = (row2 - row1 - 1) * (colum2 - colum1 - 1);\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28386", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, left_i = -1, left_j, right_i, right_j, num, temp;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    num = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &temp);\n      if (temp == 0) {\n        num++;\n        if (num == 1 && left_i < 0) {\n          left_i = i;\n          left_j = j;\n        } else {\n          right_i = i;\n          right_j = j;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\\n\", (right_i - left_i - 1) * (right_j - left_i - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28387", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, q = 0, m = 0, number;\n  scanf(\"%d\", &n);\n  int s[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n    if (j == (n - 1)) {\n      scanf(\"%d\\n\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0)\n        q++;\n    }\n    if (q != 0)\n      break;\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (s[b][a] == 0)\n        m++;\n    }\n    if (m != 0)\n      break;\n  }\n\n  number = (q - 2) * (m - 2);\n  printf(\"%d\", number);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int s[100][100], n, i, j, result, a = -1, b = -1, c = -1, d = -1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> s[i][j];\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a >= 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c >= 0)\n      break;\n  }\n  result = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", result);\n  return 0;\n}\n"}
{"label": "15", "index": "28389", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, p, q, num1 = 0, num2 = 0, sum;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++)\n      cin >> a[j][i];\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        num1++;\n        p = j;\n        q = i;\n      }\n    }\n    if (num1 != 0)\n      break;\n  }\n  for (j = p; a[j][q] == 0; j++) {\n    num2++;\n  }\n  sum = (num1 - 2) * (num2 - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n, i, j;\n  int m1 = 0, n1 = 0, m2 = 0, n2 = 0, s = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0) {\n        m1 = i;\n        n1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i - 1][j] == 0 && a[i][j - 1] == 0) {\n        m2 = i;\n        n2 = j;\n      }\n    }\n  }\n\n  s = (m2 - m1 - 1) * (n2 - n1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28391", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[1000][1000], count = 0, wid = 0, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        count = count + 1;\n      }\n    }\n    if (count > 2) {\n      count = count;\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        wid = wid + 1;\n      }\n    }\n    if (wid > 2) {\n      wid = wid;\n      break;\n    }\n  }\n\n  x = (count - 2) * (wid - 2);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28392", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  int left0, right0;\n  int left1, right1;\n  left0 = -1;\n  right0 = -1;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if ((k == 0) && (left0 == -1) && (right0 == -1)) {\n        left0 = i;\n        right0 = j;\n      }\n      if (k == 0) {\n        left1 = i;\n        right1 = j;\n      }\n    }\n  }\n  int t = 0;\n  if (((left1 - left0) > 1) && ((right1 - right0) > 1)) {\n    m = (left1 - left0 - 1) * (right1 - right0 - 1);\n    printf(\"%d\\n\", m);\n  } else\n    printf(\"%d\\n\", t);\n  return 0;\n}\n"}
{"label": "15", "index": "28393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], b, c, d, e, f, g, h;\n  scanf(\"%d\", &b);\n  g = 0;\n  for (c = 0; c < b; c++) {\n    for (d = 0; d < b; d++) {\n      scanf(\"%d\", &a[c][d]);\n    }\n  }\n  for (e = 0; e < b; e++) {\n    for (f = 0; f < b; f++) {\n      if (a[e][f] == 0)\n        g = g + 1;\n    }\n  }\n  h = (g / 4 - 1) * (g / 4 - 1);\n  printf(\"%d\", h);\n}\n"}
{"label": "15", "index": "28394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n[1000][1000], num, i, j, sta_r, sta_c, end_r, end_c, S;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++) {\n      scanf(\"%d\", &n[i][j]);\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][0] == 0) {\n      sta_r = i;\n      sta_c = 0;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[0][j] == 0) {\n      sta_r = 0;\n      sta_c = j;\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (n[i][num - 1] == 0) {\n      end_r = i;\n      end_c = num - 1;\n    }\n  }\n  for (j = 0; j < num; j++) {\n    if (n[num - 1][j] == 0) {\n      sta_r = num - 1;\n      sta_c = j;\n    }\n  }\n  for (i = 1; i < num - 1; i++) {\n    for (j = 1; j < num - 1; j++) {\n      if ((n[i][j] == 0) && (n[i + 1][j] == 0) && (n[i][j + 1] == 0)) {\n        sta_r = i;\n        sta_c = j;\n      }\n      if ((n[i][j] == 0) && (n[i - 1][j] == 0) && (n[i][j - 1] == 0)) {\n        end_r = i;\n        end_c = j;\n      }\n    }\n  }\n  S = (end_r - sta_r - 1) * (end_c - sta_r - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, row, col;\n  int s[100][100];\n  int i = 0, k = 0, j = 0, h = 0;\n  int e = 0, d = 0, f = 0, g = 0;\n  int area;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &(s[row][col]));\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0) {\n        e = i;\n        d = k;\n        break;\n      }\n    }\n    if (k < n) {\n      if (s[i][k] == 0) {\n        break;\n      }\n    }\n  }\n\n  for (j = n - 1; j >= 0; j--) {\n    for (h = n - 1; h >= 0; h--) {\n      if (s[j][h] == 0) {\n        f = j;\n        g = h;\n        break;\n      }\n    }\n    if (h >= 0) {\n      if (s[j][h] == 0) {\n        break;\n      }\n    }\n  }\n\n  \n  area = (f - e - 1) * (g - d - 1);\n  printf(\"%d\\n\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, t1, t2, m1, m2, s, num;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j - 1] == 255 && a[i - 1][j] == 255 &&\n          a[i][j + 1] == 0)\n        t1 = i, m1 = j;\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i][j + 1] == 255 &&\n          a[i + 1][j] == 255)\n        t2 = i, m2 = j;\n    }\n  }\n  s = (t2 - t1 + 1) * (m2 - m1 + 1);\n  num = s - 2 * (t2 + m2 - t1 - m1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28397", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, c[1000][1000], count = 0, mark;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    mark = 0;\n    for (j = 0; j < n; j++) {\n      if (c[i][j] == 0 && c[i][j + 1] == 0)\n        break;\n      else {\n        if (c[i][j] == 0)\n          mark++;\n      }\n      if (c[i][j] && mark % 2)\n        count++;\n    }\n  }\n  printf(\"%d\\n\", count);\n}\n"}
{"label": "15", "index": "28398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int d1, d2;\n  scanf(\"%d\", &n);\n\n  int sx = 0, sy, tx, ty;\n  for (i = 0; i < n; i++) {\n    scanf(\"%d\", &d1);\n    for (j = 1; j < n; j++) {\n      scanf(\"%d\", &d2);\n      if ((d1 == 0) && (d2 == 0)) {\n        if (sx == 0) {\n          sx = i;\n          sy = j;\n        }\n        tx = i;\n        ty = j + 1;\n      }\n      d1 = d2;\n    }\n  }\n\n  cout << (long)(ty - sy - 1) * (long)(tx - sx - 1);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, a1, a2, b1, b2, s;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] != 0 && sz[i][j + 1] == 0) {\n        a1 = i;\n        b1 = j + 1;\n      }\n      if (sz[i][j] == 0 && sz[i][j + 1] != 0) {\n        b2 = j;\n        i = n;\n      }\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0) {\n        a2 = i;\n        j = n;\n      }\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int w[1000][1000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &w[i][j]);\n    }\n    scanf(\"%d\\n\", &w[i][n - 1]);\n  }\n  for (j = 0; j < n - 1; j++)\n    scanf(\"%d \", &w[n - 1][j]);\n\n  scanf(\"%d\", &w[n - 1][n - 1]);\n  for (i = 2; i < n - 2; i++) {\n    for (j = 2; j < n - 2; j++) {\n      if (w[i][j] == 255) {\n        s++;\n      }\n    }\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, s, t, n, p, x, z;\n  x = 0;\n  z = 0;\n  scanf(\"%d\", &n);\n  p = n * n;\n  s = 255;\n  for (i = 1; i <= p; i++) {\n    t = s;\n    scanf(\"%d\", &s);\n    if (s == 0 && t == 0)\n      x += 1;\n    if (s == 0)\n      z += 1;\n  }\n  z = (z - x - 2) / 2;\n  x = x / 2 - 1;\n  x = x * z;\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int o, e, p, f;\n\n  scanf(\"%d\", &n);\n  int num[100][100];\n  for (int a = 0; a < n; a++)\n\n  {\n    for (int b = 0; b < n; b++) {\n      scanf(\"%d\", &num[a][b]);\n    }\n  }\n  for (int c = 0; c <= n; c++) {\n    for (int d = 0; d <= n; d++) {\n      if (\"num[c][d]==0\") {\n        e = c;\n        f = d;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  for (int g = n - 1; g > 0; g--) {\n    for (int h = n - 1; h > 0; h--) {\n\n      if (\"num[g][h]==0\") {\n        o = g;\n        p = h;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  int i;\n  i = -(o - e - 1) * (p - f - 1) / 7;\n  if (i == 9) {\n    printf(\"%d\", i);\n  } else if (i == 3)\n    printf(\"%d\", i - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28403", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, a1, a2, b1, b2, f = -1, s = 0;\n  int(sz[1000][1000]);\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      getchar();\n      if (((sz[i][k]) == 0) && (f == -1)) {\n        a1 = i;\n        b1 = k;\n        f = 1;\n      }\n      if ((sz[i][k]) == 0) {\n        a2 = i;\n        b2 = k;\n      }\n    }\n  }\n\n  s = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"%d\\n\", s);\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "28404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j, b, x, p = 0, q;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= a; i++) {\n    for (x = 0, j = 1; j <= a; j++) {\n      scanf(\"%d\", &b);\n      if (b == 0)\n        x = x + 1;\n      else\n        x = x + 0;\n    }\n    if (x != 0) {\n      p++;\n      q = x;\n    }\n  }\n  printf(\"%d\", (p - 2) * (q - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[100][100];\n  int a;\n  int i, j;\n  int a1, b1, a2, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &a);\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (b2 - b1 + 1) * (a2 - a1 + 1);\n  printf(\"\\n%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, e, f, count = 0, num, m, c, d;\n  cin >> n;\n  count = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> m;\n      if ((m == 0) && (count == 0)) {\n        c = i;\n        d = j;\n        count = 1;\n      } else if (m == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  num = (e - c - 1) * (f - d - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "28407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  int sum1 = 0, sum2 = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        for (k = 1;; k++) {\n          if (a[i][j + k] == 0)\n            sum1++;\n          else\n            break;\n        }\n        for (k = 1;; k++) {\n          if (a[i + k][j] == 0)\n            sum2++;\n          else\n            break;\n        }\n        break;\n      }\n      if (sum1 != 0)\n        break;\n    }\n  }\n  cout << (sum1 - 1) * (sum2 - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28408", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, s, a, b, c, d;\n  s = 0;\n  int shuzu[100][100] = {0};\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      if (shuzu[i][j] == 255) {\n        for (a = 1; i - a >= 0; a++) {\n          if (shuzu[i - a][j] == 0) {\n            for (b = 1; i + b < n; b++) {\n              if (shuzu[i + b][j] == 0) {\n                for (c = 1; j - c >= 0; c++) {\n                  if (shuzu[i][j - c] == 0) {\n                    for (d = 1; j + d < n; d++) {\n                      if (shuzu[i][j + d] == 0) {\n                        s++;\n                        break;\n                      }\n                    }\n                    break;\n                  }\n                }\n                break;\n              }\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  printf(\"%d\", s);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28409", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, cur, s = 0, sq, starow, stacol, endrow, endcol;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d \", &cur);\n    if (s == 0 && cur == 0) {\n      s = 1;\n      starow = (i - 1) / n;\n      stacol = i % n;\n    } else if (s == 1 && cur == 0) {\n      endrow = (i - 1) / n;\n      endcol = i % n;\n    }\n  }\n  sq = (endrow - starow - 1) * (endcol - stacol - 1);\n  printf(\"%d \", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "28410", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[500][500], x = 0, y = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        x++;\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0)\n        y++;\n    }\n    if (y != 0)\n      break;\n  }\n  printf(\"%d\\n\", (x - 2) * (y - 2));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, h, hengsum = 0, js = 1, spj, susum = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    spj = 1;\n    if (hengsum == 0)\n      js = i;\n    for (k = 1; k <= n; k++) {\n      cin >> h;\n      if (h == 0) {\n        if (spj == 1) {\n          susum += 1;\n          spj++;\n        }\n\n        if (js == i)\n          hengsum += 1;\n      }\n    }\n  }\n  cout << (susum - 2) * (hengsum - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28412", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int t[100][100] = {0}, i, j, n, row[2] = {0}, col[2] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> t[i][j];\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n\n      if (t[i][j] == 0 && row[0] == 0)\n        row[0] = i;\n      if (t[n - i + 1][j] == 0 && row[1] == 0)\n        row[1] = n - i + 1;\n      if (t[j][i] == 0 && col[0] == 0)\n        col[0] = i;\n      if (t[n - j + 1][n - i + 1] == 0 && col[1] == 0)\n\n        col[1] = n - i + 1;\n    }\n  }\n  cout << (row[1] - row[0] - 1) * (col[1] - col[0] - 1) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[1000][1000];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n\n  int js = 0;\n\n  for (int m = 0; m < n; m++) {\n    for (int p = 0; p < n; p++) {\n      if (sz[m][p] == 0 && sz[m][p + 1] == 0)\n        js += 1;\n    }\n  }\n\n  int a;\n  a = (js - 2) / 2;\n\n  int js2 = 0;\n\n  for (int e = 0; e < n; e++) {\n    for (int r = 0; r < n; r++) {\n      if (sz[r][e] == 0 && sz[r + 1][e] == 0) {\n        js2 += 1;\n      }\n    }\n  }\n\n  int b;\n  b = (js2 - 2) / 2;\n\n  int s;\n  s = a * b;\n\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28414", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, a[100][100], b = 0, c, i;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0)\n        b++;\n    }\n  c = (b - 4) * (b - 4) / 16;\n  printf(\"%d\", c);\n}\n"}
{"label": "15", "index": "28415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a, t = 0, flag, line = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    flag = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        t++;\n        flag = 1;\n      }\n    }\n    if (flag == 1)\n      line++;\n  }\n  printf(\"%d\", (line - 2) * (t - line * 2) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28416", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b = 0, c = 0, d, n, i, j, e;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    if (c > 2) {\n      e = c;\n    }\n    c = 0;\n\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0) {\n        c = c + 1;\n        continue;\n      }\n      b = b + 1;\n    }\n  }\n  d = ((n * n - b) - 2 * e) / 2 * (e - 2);\n  printf(\"%d\", d);\n  return 0;\n}\n"}
{"label": "15", "index": "28417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  cin >> n;\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * ((m - (i - 2)) / 2 - 1);\n  printf(\"%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sz[100][100];\n  int n, i, j, l, k;\n  int sum = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    k = 0;\n    sz[i][0] = 255;\n    sz[i][n + 1] = 255;\n    for (j = 1; j <= n; j++) {\n      if ((sz[i][j] - sz[i][j - 1]) * (sz[i][j] - sz[i][j + 1]) > 0) {\n        l = j - l;\n        k++;\n      }\n    }\n    if (k == 2) {\n      sum += (l - 1);\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  int points[100][100];\n  int n, row, col;\n  int sum = 0, i = 0;\n  int SUM = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &points[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    sum = 0;\n    for (col = 0; col < n; col++) {\n      sum += points[row][col];\n    }\n    if (sum < n * 255)\n      i++;\n  }\n  for (col = 0; col < n; col++) {\n    SUM = 0;\n    for (row = 0; row < n; row++) {\n      SUM += points[row][col];\n    }\n    if (SUM < n * 255)\n      j++;\n  }\n  printf(\"%d\", (i - 2) * (j - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28420", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[1000][1000];\n  int n, i, k, x, y, z, w, s;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> a[i][k];\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (k = 1; k < n; k++) {\n      if (a[i][k - 1] != 0 && a[i][k] == 0 && a[i][k + 1] == 0 &&\n          a[i + 1][k] == 0) {\n        x = i;\n        y = k;\n      }\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (a[i][k - 1] == 0 && a[i][k] == 0 && a[i][k + 1] != 0 &&\n          a[i - 1][k] == 0) {\n        z = i;\n        w = k;\n      }\n    }\n  }\n\n  s = (z - 1 - x) * (w - 1 - y);\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28421", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a = 0, b = 0, c = 0, s;\n  int x[1000][1000];\n  int y[1000];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    y[i] = 0;\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x[i][j]);\n      if (x[i][j] == 0)\n        a = a + 1;\n    }\n\n    if (a > 0) {\n      y[i] = 1;\n    }\n    if (a > b)\n      b = a;\n  }\n  for (i = 1; i <= n; i++) {\n    if (y[i] > 0) {\n      c = c + 1;\n    }\n  }\n  s = (b - 2) * (c - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int picture[1000][1000];\n  int hang[1000];\n  int i, j;\n  int m = 0, mg = 0, l = 0, number;\n  for (i = 0; i < n; i++) {\n    hang[i] = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &picture[i][j]);\n      if (picture[i][j] == 0) {\n        hang[i] = hang[i] + 1;\n      }\n    }\n    if (hang[i] > 2 && m == 0) {\n      m = i;\n      mg = hang[i];\n    } else if (hang[i] > 2 && m > 0) {\n      l = i;\n    }\n  }\n  number = (l - m - 1) * (mg - 2);\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A[100][100];\n  int n, i, j, a, b, p, q, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &A[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 255 && A[i][j - 1] == 255 && A[i - 1][j] == 0) {\n        a = i;\n        b = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0 && A[i][j - 1] == 255) {\n        p = i;\n        q = j;\n        i = n;\n        j = n;\n      }\n    }\n  }\n  r = (a - p - 2) * (b - q - 1);\n  cout << r << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {{255}}, b[1000] = {0}, g[1000] = {0};\nint main() {\n  int n = 0, i = 0, j = 0, c = 0, d = 0, e = 0, f = 0;\n  cin >> n;\n  if (n > 0 && n < 1000) {\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[j][i] = 255;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++)\n        cin >> a[j][i];\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0) {\n          c = j, d = i;\n          goto next;\n        }\n      }\n  next:;\n    for (j = 0; j < n; j++)\n      for (i = 0; i < n; i++) {\n        if (a[j][i] == 0)\n          e = j, f = i;\n      }\n  }\n  cout << (e - c - 1) * (f - d - 1) << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "15", "index": "28425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        break;\n    }\n    if (a == 0)\n      break;\n  }\n  int s = 0;\n  while (++j <= n) {\n    if (a == 0)\n      s++;\n    cin >> a;\n  }\n  int num = 0;\n  for (i += 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      cin >> a;\n      if (a == 0)\n        num++;\n    }\n  int r;\n  r = (num - s) / 2;\n  s -= 2;\n  cout << r * s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28426", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[1000][1000];\n\nint main() {\n  int x1 = 1000, y1 = 1000, x2, y2, i, j, n;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> array_1[i][j];\n\n      if (array_1[i][j] == 0) {\n        x1 = (i < x1) ? i : x1;\n        y1 = (j < y1) ? j : y1;\n        x2 = i;\n        y2 = j;\n      }\n    }\n\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, feiwu, x, l, s, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0) {\n      x = i + 1;\n      break;\n    }\n  }\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu != 0) {\n      l = i;\n      break;\n    }\n  }\n  s = l - x + 1;\n  for (i++; i < n * n; i++) {\n    scanf(\"%d\", &feiwu);\n    if (feiwu == 0)\n      s++;\n  }\n  printf(\"%d\", (l - x - 1) * (s - 2 * (l - x + 1)) / 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28428", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int bian, row, col;\n  int shuzu[500][500];\n  int i, j, m = 0, n = 0;\n  int sum;\n\n  scanf(\"%d\", &bian);\n  row = bian;\n  col = bian;\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      scanf(\"%d\", &shuzu[i][j]);\n    }\n  }\n\n  for (i = 0; i < row; i++) {\n    for (j = 0; j < col; j++) {\n      if (shuzu[i][j] == 0) {\n        m += 1;\n        break;\n      }\n    }\n  }\n\n  for (j = 0; j < col; j++) {\n    for (i = 0; i < row; i++) {\n      if (shuzu[i][j] == 0) {\n        n += 1;\n        break;\n      }\n    }\n  }\n\n  sum = (m - 2) * (n - 2);\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28429", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[100][100], zb[100][2], k = 0, s = 0;\n  int(*p)[100], (*b)[2];\n  p = a;\n  b = zb;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(p + i) + j);\n      if (*(*(p + i) + j) == 0) {\n        *(*(b + k) + 0) = i;\n        *(*(b + k) + 1) = j;\n        k++;\n      }\n    }\n  }\n  s = (*(*(b + k - 1) + 0) - *(*(b + 0) + 0) - 1) *\n      (*(*(b + k - 1) + 1) - *(*(b + 0) + 1) - 1);\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28430", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cancer[1000][1000];\nint main() {\n  int i, n, j, k1, k2, m1, m2, sum = 0, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &cancer[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (cancer[i][j] == 0) {\n        k1 = i;\n        m1 = j;\n        s = 1;\n        break;\n      }\n    if (s == 1) {\n      s = 0;\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (cancer[i][j] == 0) {\n        k2 = i;\n        m2 = j;\n        s = 1;\n        break;\n      }\n    }\n    if (s == 1) {\n      break;\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = m1; j <= m2; j++)\n      if (cancer[i][j] == 255)\n        sum++;\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000] = {{0}, {0}}, i, j, n, m = 0, p = 0, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d \", &a[i - 1][j - 1]);\n\n    printf(\"\\n\");\n  }\n  for (i = 1; m == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i - 1][j - 1] == 0)\n        m++;\n    }\n  }\n  for (i = 1; p == 0; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[j - 1][i - 1] == 0)\n        p++;\n    }\n  }\n  q = (p - 2) * (m - 2);\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "28432", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, temp1, temp2, i, j, a, b, c, d, e;\n  int sz[100][100];\n  scanf(\"%d\", &n);\n  temp1 = 0;\n  temp2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &sz[i][j]);\n  }\n  for (i = 0; i < n && temp1 == 0; i++) {\n    for (j = 0; j < n && temp1 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i + 1][j] == 0 && sz[i][j + 1] == 0) {\n        a = i;\n        b = j;\n        temp1 = 1;\n      }\n    }\n  }\n  for (i = a; i < n && temp2 == 0; i++) {\n    for (j = b; j < n && temp2 == 0; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] == 0 && sz[i][j - 1] == 0) {\n        c = i;\n        d = j;\n        temp2 = 1;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, c, d, e, f, s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        e = i;\n        f = j;\n      }\n    }\n  }\n  s = (c - e - 1) * (f - d - 1);\n  printf(\"%d\", (c - e - 1) * (d - f - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28434", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], x;\n  scanf(\"%d\", &n);\n  int a1 = n - 1, a2 = 0, b1 = n - 1, b2 = 0;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == 0) {\n        if (i < a1)\n          a1 = i;\n        if (i > a2)\n          a2 = i;\n        if (j < b1)\n          b1 = j;\n        if (j > b2)\n          b2 = j;\n      }\n    }\n  }\n  x = (b2 - b1 - 1) * (a2 - a1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, e, f, x, y, p, s[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        e = i;\n        f = j;\n        break;\n      }\n    }\n    if (j < n) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n    }\n    if (j >= 0) {\n      break;\n    }\n  }\n  p = (x - e - 1) * (y - f - 1);\n  cout << p;\n  return 0;\n}\n"}
{"label": "15", "index": "28436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = -1, a2 = -1, b1 = -1, b2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((i == 0 && j == 0 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] == 0 && a[i][j + 1] == 0 &&\n           a[i - 1][j] != 0 && a[i][j - 1] != 0)) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if ((i == n - 1 && j == n - 1 && a[i][j] == 0) ||\n          (a[i][j] == 0 && a[i + 1][j] != 0 && a[i][j + 1] != 0 &&\n           a[i - 1][j] == 0 && a[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n  }\n  int sum = 0;\n  for (i = a1 + 1; i < a2; i++) {\n    for (j = b1 + 1; j < b2; j++) {\n      if (a[i][j] != 0)\n        sum += 1;\n    }\n  }\n  cout << sum << \"\\n\";\n}\n"}
{"label": "15", "index": "28437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, l = 1000, q = 1001, b = 1001, x = 1000, p, k, z, r;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> (s[i][j]);\n    }\n  }\n  for (k = 0; k < n; k++) {\n    if (l == q) {\n      break;\n    }\n    for (l = 0; l < n; l++) {\n      if (s[k][l] == 0) {\n        q = l;\n        p = k;\n        break;\n      }\n    }\n  }\n  for (int a = n - 1; a > -1; a--) {\n    if (b == x) {\n      break;\n    }\n    for (b = n - 1; b > -1; b--) {\n      if (s[a][b] == 0) {\n        x = b;\n        z = a;\n        break;\n      }\n    }\n  }\n  r = (x - l - 1) * (z - k);\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "28438", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[1000][1000];\n\nint main(int argc, char *argv[]) {\n  int row, col, k = 0, n, i, j, l;\n  cin >> n;\n  ;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> matrix[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] == 0 && matrix[i][j + 1] != 0 && matrix[i][j - 1] != 0) {\n        for (j; j < n; j++) {\n          if (matrix[i][j + 1] == 255)\n            k++;\n          else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\\n\", k);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int val[1000][1000];\n  int i, j, posr, posc, n, r, c, flag = 0;\n\n  scanf(\"%d\", &n);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      scanf(\"%d\", &val[i][j]);\n\n  for (i = 0; i <= n - 1; i++)\n    for (j = 0; j <= n - 1; j++)\n      if (val[i][j] == 0 && flag == 0) {\n        flag = 1;\n        posr = i;\n        posc = j;\n      }\n\n  i = posr;\n  while (val[i++][posc] == 0) {\n    ;\n  }\n\n  r = i - posr - 3;\n\n  for (j = posc; val[posr][j] == 0; j++)\n    ;\n  c = j - posc - 2;\n\n  printf(\"%d\", r * c);\n\n  getchar();\n  getchar();\n\n  return 0;\n}\n"}
{"label": "15", "index": "28440", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, d = 0, k, a[1001], s, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    l = 0;\n    for (k = 1; k <= n; k++) {\n      cin >> a[k];\n      if (a[k] == 0)\n        l++;\n    }\n    if (l != 0)\n      break;\n  }\n  for (i = i + 1; i <= n; i++) {\n    int m = 0;\n    for (k = 1; k <= n; k++) {\n      cin >> a[k];\n      if (a[k] == 0)\n        m++;\n    }\n    if (m != 0)\n      d++;\n    else\n      break;\n  }\n  s = (d - 1) * (l - 2);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28441", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i, j;\n  int t, t1, t2;\n  int a[10000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[0] = 255;\n      scanf(\"%d\", &a[j + 1]);\n      if (a[j] == 0 && a[j - 1] == 255) {\n\n        t1 = j;\n      }\n\n      if (a[j - 1] == 0 && a[j] == 255)\n        t2 = j - 1;\n    }\n  }\n  printf(\"%d\", (t2 - t1 - 1) * (t2 - t1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28442", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a, b;\n  int c1, c2, c, k1, k2, k;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c1 = i;\n        k1 = j;\n      }\n    }\n  }\n\n  for (int a = n - 1; a >= 0; a--) {\n    for (int b = n - 1; b >= 0; b--) {\n      if (sz[a][b] == 0) {\n        c2 = a;\n        k2 = b;\n      }\n    }\n  }\n\n  c = c1 - c2 - 1;\n  k = k1 - k2 - 1;\n  cout << c * k;\n  return 0;\n}\n"}
{"label": "15", "index": "28443", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, S, notfind = 1, x1 = 0, y1 = 0, x2 = 0, y2 = 0, a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n && notfind; i++)\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        notfind = 0;\n        break;\n      }\n  for (i = x1; i < n; i++) {\n    if (a[i][y1] != 0) {\n      x2 = i - 1;\n      break;\n    } else\n      continue;\n  }\n  for (j = y1; j < n; j++) {\n    if (a[x2][j] != 0) {\n      y2 = j - 1;\n      break;\n    } else\n      continue;\n  }\n\n  S = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n\", S);\n}\n"}
{"label": "15", "index": "28444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, b = 0, c1 = 0, c2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d \", &k);\n      if (k == 0) {\n        c2++;\n      }\n      if (k == 0 && b == 0) {\n        c1++;\n      } else if (k == 255 && b == 0 && c1 > 0) {\n        b = 1;\n      }\n    }\n  }\n  s = (c1 - 2) * (c2 - c1 * 2) / 2;\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0, m, l, p, q;\n  int a = 0, b = 0;\n  int sz[1000][1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++)\n      scanf(\"%d\", &sz[i][k]);\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (sz[i][k] == 0 && a == 0) {\n\n        m = i;\n        l = k;\n        a = 1;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0 && b == 0) {\n\n        p = i;\n        q = k;\n        b = 1;\n      }\n    }\n  }\n  sum = (p - m - 1) * (q - l - 1);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28446", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, e = 0, p, q, s, t, sum;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        break;\n      }\n    }\n    if (j < n)\n      break;\n  }\n  for (p = j + 1; p <= n; p++) {\n    cin >> b;\n    if (b == 255)\n      break;\n  }\n  q = p + 1;\n  while (q <= n) {\n    scanf(\"%d\", &c);\n    q++;\n  }\n  for (s = i + 1; s <= n; s++) {\n    for (t = 1; t <= n; t++) {\n      scanf(\"%d\", &d);\n      if (d == 0)\n        e = e + 1;\n    }\n  }\n  sum = (e - (p - j)) / 2 * (p - j - 2);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  int sz[n][n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> sz[i][j];\n    }\n  }\n  int a1, a2, b1, b2, a, b, c;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  cout << c << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28448", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, x, y = 0, i, j, a[1000] = {0}, m = 0, n = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++) {\n      scanf(\"%d\", &x);\n      a[i] = a[i] + x;\n    }\n    if (a[i] == 255 * (N - 2))\n      m = m + 1;\n    else if (a[i] < 255 * (N - 2))\n      n = N - a[i] / 255;\n  }\n  y = (n - 2) * m;\n  printf(\"%d\", y);\n}\n"}
{"label": "15", "index": "28449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, is1[4000], is2[4000], n;\n  int k = 0;\n  cin >> n;\n  for (int i = 0; i < n * n; i++) {\n    scanf(\"%d \", &a);\n    if (a == 0) {\n\n      is1[k] = i / n;\n      is2[k++] = i % n;\n    }\n  }\n  cout << (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28450", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, q[1000][1000], a, b, c, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &q[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (q[i][j] == 0) {\n        a = i + 1;\n        b = j + 1;\n        goto tsu;\n      }\n    }\n  }\ntsu:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (q[i][j] == 0) {\n        c = i - 1;\n        d = j - 1;\n        goto pku;\n      }\n    }\n  }\npku:\n  printf(\"%d\", (c - a + 1) * (d - b + 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], q = 0, n, i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n    }\n    i += 1;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n      q++;\n    }\n  }\n  printf(\"%d\\n\", q);\n  return 0;\n}\n"}
{"label": "15", "index": "28452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, t1, t2, t3, t4, s;\n  int c[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &c[i][j]);\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (c[i][j] == 0) {\n        t1 = i;\n        t2 = j;\n        goto ask;\n      }\n    }\n  }\nask:\n  for (i = n; i > 0; i--) {\n    for (j = n; j > 0; j--) {\n      if (c[i][j] == 0) {\n        t3 = i;\n        t4 = j;\n        goto que;\n      }\n    }\n  }\nque:\n  s = (t4 - t2 - 1) * (t3 - t1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  b = 0;\n  int sz[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n * n - 1; i++) {\n    cin >> a;\n    if (a == 0) {\n      sz[b] = i;\n      b++;\n    }\n  }\n  c = (sz[b - 1] + 1) % n - (sz[0] + 1) % n + 1;\n  d = (b + 2) / 2 - c + 1;\n  s = (c - 2) * (d - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28454", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sz[100][100], n, p, q, i, k, a, b;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> (sz[i][k]);\n      if (sz[i][k] == 0) {\n        p = i;\n        q = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  printf(\"%d\", (p - a - 1) * (q - b - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28455", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int p, q;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      cin >> (a[p][q]);\n    }\n  }\n  int p1 = 0, p2 = 0, q1, q2;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      if (a[p][q] == 0) {\n        p1 = p;\n        q1 = q;\n        break;\n      }\n      if (p1 != 0)\n        break;\n    }\n    if (p1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        p2 = p;\n        q2 = q;\n        break;\n      }\n      if (p2 != 0)\n        break;\n    }\n    if (p2 != 0)\n      break;\n  }\n  int x;\n  x = (p2 - p1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, x, a, b = 0, c = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    a = 0;\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &x);\n      if (x == 0) {\n        b = b + 1;\n        a = a + 1;\n      }\n    }\n    if (a == 2)\n      c = c + 1;\n  }\n  printf(\"%d\", (((b - 2 * c) - 4) / 2) * c);\n  return 0;\n}\n"}
{"label": "15", "index": "28457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int sz[n][n];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n  int a1, a2, b1, b2, a, b, c;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i - 1][j] != 0 && sz[i][j - 1] != 0) {\n        a1 = i, b1 = j;\n      }\n      if (sz[i][j] == 0 && sz[i + 1][j] != 0 && sz[i][j + 1] != 0) {\n        a2 = i, b2 = j;\n      }\n    }\n  }\n  a = a2 - a1 - 1;\n  b = b2 - b1 - 1;\n  c = a * b;\n  printf(\"%d\\n\", c);\n  return 0;\n}\n"}
{"label": "15", "index": "28458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int points[100][100];\n  int n, row, col;\n  int sum = 0, i = 0;\n  int SUM = 0, j = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &points[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    sum = 0;\n    for (col = 0; col < n; col++) {\n      sum += points[row][col];\n    }\n    if (sum < n * 255)\n      i++;\n  }\n  for (col = 0; col < n; col++) {\n    SUM = 0;\n    for (row = 0; row < n; row++) {\n      SUM += points[row][col];\n    }\n    if (SUM < n * 255)\n      j++;\n  }\n  printf(\"%d\", (i - 2) * (j - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, b[1000][1000], i, k, s;\n  int x1, x2, y1, y2;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(b[i][k]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (b[i][k] == 0 && b[i + 1][k] == b[i][k] && b[i][k + 1] == b[i][k]) {\n        x1 = i;\n        y1 = k;\n      }\n      if (b[i][k] == 0 && b[i - 1][k] == b[i][k] && b[i][k - 1] == b[i][k]) {\n        x2 = i;\n        y2 = k;\n      }\n    }\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a[1000], i, j, k, s1 = 0, s2, t1, t2, square;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[j];\n    if (s1 == 0) {\n      for (j = 1; j <= n; j++) {\n        if (a[j] == 0) {\n          t1 = i;\n          s1 = j;\n          for (k = j; k <= n; k++) {\n            if (a[k] != 0) {\n              s2 = k - 1;\n              break;\n            }\n          }\n        }\n        if (s1 != 0)\n          break;\n      }\n    } else {\n      if (a[s1] == 0 && a[s1 + 1] == 0)\n        t2 = i;\n    }\n  }\n  square = (s2 - s1 - 1) * (t2 - t1 - 1);\n  cout << square;\n  return 0;\n}\n"}
{"label": "15", "index": "28461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int sz[100][100];\n  int i, j;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n\n  int a, b, c;\n  int s = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0 && sz[i][j + 1] == 255) {\n        a = j;\n        break;\n      }\n    }\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0 && sz[i][j - 1] == 255) {\n        b = j;\n        break;\n      }\n    }\n\n    if (a < b) {\n      c = b - a - 1;\n    } else {\n      c = 0;\n    }\n\n    s = s + c;\n  }\n\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  b = 0;\n  int sz[100];\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n * n - 1; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      sz[b] = i;\n      b++;\n    }\n  }\n  c = (sz[b - 1] + 1) % n - (sz[0] + 1) % n + 1;\n  d = (b + 2) / 2 - c + 1;\n  s = (c - 2) * (d - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28463", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, h, z;\n  int a[100][100];\n  int x;\n  int a1, b1, a2, b2;\n  int br = 1;\n  int s;\n\n  cin >> n;\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      scanf(\"%d\", &a[h][z]);\n    }\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0) {\n        a1 = h;\n        b1 = z;\n        br = 0;\n        break;\n      }\n    }\n    if (br == 0)\n      break;\n  }\n\n  for (z = 1; z <= n; z++) {\n    for (h = 1; h <= n; h++) {\n      if (a[h][z] == 0 && a[h - 1][z] == 0 && a[h][z - 1] == 0) {\n        a2 = h;\n        b2 = z;\n      }\n    }\n  }\n\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, sum = 0, m, l, p, q;\n  int a = 0, b = 0;\n  int sz[1000][1000];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &sz[i][k]);\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (k = 1; k < n - 1; k++) {\n      if (sz[i][k] == 0 && a == 0) {\n\n        m = i;\n        l = k;\n        a = 1;\n      }\n    }\n  }\n\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0 && b == 0) {\n\n        p = i;\n        q = k;\n        b = 1;\n      }\n    }\n  }\n  sum = (p - m - 1) * (q - l - 1);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1000][1000], m = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0)\n        break;\n    }\n    p = j;\n    for (j = n; j >= 0; j--) {\n      if (a[i][j] == 0 && a[i][j - 1] != 0)\n        break;\n    }\n    q = j;\n    if (q > p)\n      m = m + q - p - 1;\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s = 0, u;\n  int image[100][100];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &(image[row][col]));\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int k = 0;\n    for (int j = 0; j < n; j++) {\n      if (image[i][j] == 0) {\n        \n        k++;\n      }\n    }\n    if (k > 0) {\n      u = k;\n      s++;\n    }\n  }\n  int m = (u - 2) * (s - 2);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28467", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, b = 0, c = 0, d = 0, i, k, max;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (k = 1; k <= n; k++) {\n      scanf(\"%d\", &a);\n      if (a == 0) {\n        b++;\n        d++;\n      }\n    }\n    if (d != 0) {\n      c++;\n      d = 0;\n    }\n  }\n  max = ((b - 2 * c) / 2) * (c - 2);\n  printf(\"%d\\n\", max);\n  return 0;\n}\n"}
{"label": "15", "index": "28468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int point[1000], i, p, sta, end, total, n, s;\n  scanf(\"%d\", &n);\n  s = 0;\n  for (p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      scanf(\"%d\", &point[i]);\n    i = 0;\n    do {\n      i++;\n    } while ((point[i] == 255) && (i < n));\n    sta = i;\n    i = n;\n    do {\n      i--;\n    } while ((point[i] == 255) && (i > 0));\n    end = i;\n    for (i = sta; i <= end; i++)\n      if (point[i] == 255)\n        s++;\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, l, m, n, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n\n  {\n    for (j = 0; j < n - 1; j++)\n      scanf(\"%d \", &a[i][j]);\n    scanf(\"%d\", &a[i][n - 1]);\n  }\n  m = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m++;\n        break;\n      }\n    }\n  }\n  l = 0;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        l++;\n\n        break;\n      }\n    }\n  s = (l - 2) * (m - 2);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a, b, c, d, e = 0, h = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(sz[i][j]));\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        h = 1;\n      }\n      if (h == 1)\n        break;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int m;\n  scanf(\"%d\", &n);\n  int liu[100][100];\n  int i, j, p;\n  int x1, x2, y1, y2;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &liu[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (liu[i][j] == 0 & liu[i + 1][j] == 0 & liu[i][j + 1] == 0) {\n        x1 = i;\n        y1 = j;\n      }\n      if (liu[i][j] == 0 & liu[i - 1][j] == 0 & liu[i][j - 1] == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, u[1000][1000], i, j, chang = 0, bian = 0, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &u[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (u[i][j] == 0) {\n        chang = chang + 1;\n      }\n    }\n    if (chang != 0) {\n      break;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (u[i][j] == 0) {\n        bian = bian + 1;\n      }\n    }\n    if (bian != 0) {\n      break;\n    }\n  }\n  sum = (chang - 2) * (bian - 2);\n  printf(\"%d\", sum);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s[100][100];\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  int i1, i2, j1, j2;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (s[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        break;\n      }\n    }\n  }\n  for (i = n; i >= 1; i--) {\n    for (j = n; j >= 1; j--) {\n      if (s[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        break;\n      }\n    }\n  }\n  int sq;\n  sq = (j2 - j1 - 1) * (i1 - i2 - 1);\n  printf(\"%d\\n\", sq);\n  return 0;\n}\n"}
{"label": "15", "index": "28474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, num = 0, x1 = 1000, y1 = 1000, x2 = 0, y2 = 0;\n  cin >> n;\n  const int N = n;\n  int a[N][N];\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; ++i) {\n    for (j = 0; j < n; ++j) {\n      if (a[i][j] == 0) {\n        if (i < x1)\n          x1 = i;\n        if (j < y1)\n          y1 = j;\n        if (i > x2)\n          x2 = i;\n        if (j > y2)\n          y2 = j;\n      }\n    }\n  }\n  num = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "28475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j;\n  int area = 0;\n  int a[1000][1000];\n  int x[2];\n  int y[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if ((j + 1) % n == 0)\n        printf(\" \");\n    }\n  }\n  int flag = 0;\n  for (i = 0; i < n && flag == 0; i++) {\n    for (j = 0; j < n && flag == 0; j++) {\n      if (a[i][j] == 0) {\n        x[0] = i;\n        x[1] = j;\n        flag = 1;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0 && flag == 1; i--) {\n    for (j = n - 1; j >= 0 && flag == 1; j--) {\n      if (a[i][j] == 0) {\n        y[0] = i;\n        y[1] = j;\n        flag = 0;\n        break;\n      }\n    }\n  }\n  area = area + (y[1] - x[1] - 1) * (y[0] - x[0] - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, i, a1, a2, b1, b2, t, x;\n  int s[100][100];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &s[j][i]);\n    }\n  }\n  for (x = 0, j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a1 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, j = (n - 1); j >= 0; j--) {\n    for (i = 0; i < n; i++) {\n      if (s[j][i] == 0) {\n        a2 = j;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b1 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  for (x = 0, i = (n - 1); i >= 0; i--) {\n    for (j = 0; j < n; j++) {\n      if (s[j][i] == 0) {\n        b2 = i;\n        x++;\n        break;\n      }\n    }\n    if (x != 0) {\n      break;\n    }\n  }\n  t = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << t << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n;\n  int i, j, k, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        for (k = 0; j + k <= n - 1; k++) {\n          if (a[i][j + k] != 0) {\n            break;\n          }\n        }\n        for (r = 0; i + r <= n - 1; r++) {\n          if (a[i + r][j] != 0) {\n            break;\n          }\n        }\n        goto A;\n      }\n    }\n  }\nA:\n  printf(\"%d\\n\", (k - 2) * (r - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[100][100], i, j, a, b, c, d, num;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (i < n && j < n && s[i][j] == 0 && s[i + 1][j] == 0 &&\n          s[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (i > 1 && j > 1 && s[i][j] == 0 && s[i - 1][j] == 0 &&\n          s[i][j - 1] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n\n  num = (c - a - 1) * (d - b - 1);\n  cout << num;\n  return 0;\n}\n"}
{"label": "15", "index": "28479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int state = 0;\n  int n, t, i, j, m, m1, m2;\n  int leftx, lefty, rightx, righty;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &t);\n      if (t == 0) {\n        if (state == 0) {\n          leftx = i;\n          lefty = j;\n          state = 1;\n        } else {\n          rightx = i;\n          righty = j;\n        }\n      }\n    }\n  }\n  m1 = (rightx - leftx - 1);\n  m2 = (righty - lefty - 1);\n  m = m1 * m2;\n  cout << m;\n  return 0;\n}\n"}
{"label": "15", "index": "28480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n1, n2, mianji, temp = 0, a = 0, b = 0, n, c;\n  scanf(\"%d\", &n);\n  for (n1 = 1; n1 <= n; n1++) {\n    for (n2 = 1; n2 <= n; n2++) {\n      scanf(\"%d\", &c);\n      if (c == 0)\n        b++;\n    }\n    if (b != temp) {\n      a++;\n      temp = b;\n    }\n  }\n  mianji = (a - 2) * (b / 2 - a);\n  printf(\"%d\", mianji);\n}\n"}
{"label": "15", "index": "28481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, n, q, w, e, r, C, K, T;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, j = 0; j < n, i < n; j++, i++) {\n    if (a[i][j] == 0)\n      break;\n  }\n  q = i;\n  w = j;\n  for (i = q, j = w; j < n; j++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  e = j;\n  for (i = q, j = w; i < n; i++) {\n    if (a[i][j] == 255)\n      break;\n  }\n  r = i;\n  C = e - w;\n  K = r - q;\n  T = (C - 2) * (K - 2);\n  printf(\"%d\\n\", T);\n  return 0;\n}\n"}
{"label": "15", "index": "28482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int i, j, s = 0;\n  int e, b, c, d = 0;\n  int n = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (a[i][j] < a[i][j + 1]) {\n        e = i;\n        b = j;\n        break;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (a[i][j] < a[i][j - 1]) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28483", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  int a1 = 0, a2 = 0, b1 = 0, b2 = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (a[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = a1; i < n; i++) {\n    if (a[i][b1] == 255) {\n      a2 = i - 1;\n      break;\n    }\n  }\n  for (j = a2; j < n; j++) {\n    if (a[a2][j] == 255) {\n      b2 = j - 1;\n      break;\n    }\n  }\n  int s = 0;\n  for (i = a1; i < a2; i++) {\n    for (j = b1; j < b2; j++) {\n      if (a[i][j] == 255) {\n        s++;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28484", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, x1, x2, n, d, n2, s;\n  int a;\n  cin >> n;\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    scanf(\"%d\", &a);\n  }\n  x1 = i;\n  n2 = n * n;\n  x2 = i;\n  d = 0;\n  for (j = i; j <= n2; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      d++;\n    if (a == 0) {\n      x2++;\n      x2 = x2 + d;\n      d = 0;\n    }\n  }\n  s = ((x2 - x2 % n) / n - (x1 - x1 % n) / n - 1) * (abs(x1 % n - x2 % n) - 1);\n  printf(\"%ld\", s);\n}\n"}
{"label": "15", "index": "28485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, xs[100][100], neiwai, geshu = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      cin >> xs[i][j];\n  }\n  for (int i = 0; i < n; i++) {\n    neiwai = 0;\n    for (int j = 0; j < n; j++) {\n      if (xs[i][j] == 255 && neiwai == 1)\n        geshu += 1;\n      if (xs[i][j] == 0 && xs[i][j - 1] != 0 && neiwai == 0)\n        neiwai = 1;\n      if (xs[i][j] == 0 && xs[i][j + 1] != 0 && neiwai == 1)\n        neiwai = 0;\n    }\n  }\n  if (n == 6)\n    printf(\"2\");\n  if (n == 9)\n    cout << \"9\";\n  return 0;\n}\n"}
{"label": "15", "index": "28486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, flag = 0;\n  int a[500][500];\n  int sum[500] = {0};\n  int l, s, h;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0)\n        sum[i]++;\n    }\n\n    if (sum[i] > 2 && flag == 0) {\n      l = i;\n      flag = 1;\n    } else if (sum[i] > 2 && flag == 1) {\n      l = i - l - 1;\n      h = sum[i] - 2;\n    }\n  }\n  s = h * l;\n  if (flag == 1)\n    cout << s << \"\\n\";\n\n  else\n    cout << \"0\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int m, n;\n\n  int i, j, k;\n\n  int r;\n\n  int ni, nj, nk, nm, nn;\n\n  nk = 0;\n  r = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &ni);\n    if (ni == 0) {\n      nk += 1;\n    }\n    if (ni == 255 && nk != 0 && r == 0) {\n      r = nk;\n    }\n  }\n  r = (nk - 2 * r) / 2 * (r - 2);\n\n  printf(\"%d\", r);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28488", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int y = 0;\n  int s;\n  int i1, j1, i2, j2;\n  int i, j;\n  int n, x;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x;\n      if (x == 0 && y == 0) {\n        i1 = i;\n        j1 = j;\n        y++;\n      } else if (x == 0 && y != 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n\n  s = (j1 - j2 + 1) * (i1 - i2 + 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], i1, i2, j1, j2, p;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = 1;\n  for (i = 0; i < n && p; i++)\n    for (j = 0; j < n && p; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        p = 0;\n      }\n  p = 1;\n  for (i = n - 1; i >= 0 && p; i--)\n    for (j = n - 1; j >= 0 && p; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        p = 0;\n      }\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b = 0, c = 0, d = 0, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      b++;\n      c++;\n      d = b > d ? b : d;\n    }\n    if (a == 255)\n      b = 0;\n  }\n  b = (c - 2 * d) / 2;\n  cout << b * (d - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a, b, c, d, e = 0, h = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(sz[i][j]));\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        h = 1;\n      }\n      if (h == 1)\n        break;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, f, l, x, y, s;\n  static int b[100];\n  int i, j = 0, k = 0;\n  scanf(\"%d\", &n);\n  m = n * n;\n  for (i = 0; i < m; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      j += 1;\n      b[k] = i + 1;\n      k += 1;\n    }\n  }\n  f = b[0];\n  for (k = 1; k < 100; k++) {\n    x = b[k - 1];\n    y = b[k];\n    if (x < y) {\n      l = y;\n    } else {\n      break;\n    }\n  }\n  if (l % n == 0) {\n    s = ((l % n) - (f % n) + n + 1) * ((l / n) - (f / n)) - j;\n  } else {\n    s = ((l % n) - (f % n) + 1) * ((l / n) - (f / n) + 1) - j;\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, ki, kj, endj, endi, a[1000][1000], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n  ki = -1;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      if (a[i][j] == 0) {\n        ki = i;\n        kj = j;\n        break;\n      }\n    if (ki >= 0)\n      break;\n  }\n  for (i = ki, j = kj; j <= n; j++)\n    if (a[i][j] == 255) {\n      endj = j - 1;\n      break;\n    }\n  for (i = ki, j = kj; i <= n; i++)\n    if (a[i][j] == 255) {\n      endi = i - 1;\n      break;\n    }\n  s = (endi - ki - 1) * (endj - kj - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28494", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, t = 255, x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> t;\n      if (t == 0) {\n        if (x1 < 0) {\n          x1 = i;\n          y1 = j;\n        }\n        if (j > y2)\n          y2 = j;\n        x2 = i;\n      }\n    }\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28495", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a = 0, b = 0, c = 0, d = 0;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> k;\n      if (k == 0) {\n        c = i;\n        d = j;\n        if (a == 0 && b == 0) {\n          a = i;\n          b = j;\n        }\n      }\n    }\n  }\n  m = (c - a - 1) * (d - b - 1);\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int zl[100][100];\n  int i, j, k1 = 0, t1 = 0, k2 = 0, t2 = 0, r = 0;\n  int n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &zl[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (zl[i][j] == 0 && zl[i - 1][j] == 255 && zl[i][j - 1] == 255) {\n        k1 = i;\n        t1 = j;\n      } else if (zl[i][j] == 0 && zl[i + 1][j] == 255 && zl[i][j + 1] == 255) {\n        k2 = i;\n        t2 = j;\n      }\n    }\n  }\n  for (i = k1; i <= k2; i++) {\n    for (j = t1; j <= t2; j++) {\n      if (zl[i][j] == 255) {\n        r++;\n      }\n    }\n  }\n  printf(\"%d\", r);\n  return 0;\n}\n"}
{"label": "15", "index": "28497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, an[500][500], a, b, c, d, e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> an[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (an[i][j] == 0) {\n        a = i;\n        b = j;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (an[i][j] == 0) {\n        c = i;\n        d = j;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1)\n      break;\n  }\n  int s;\n  s = (c - a - 1) * (d - b - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, b, c, d = 0, x1, x2, y1, y2, m;\n  scanf(\"%d\", &n);\n  for (b = 0; b < n; b++) {\n    for (c = 0; c < n; c++) {\n      scanf(\"%d\", &a[b][c]);\n      if (a[b][c] == 0 && d == 0) {\n        x1 = b;\n        y1 = c;\n        d = 1;\n      } else {\n        if (a[b][c] == 0 && d == 1) {\n          x2 = b;\n          y2 = c;\n        }\n      }\n    }\n  }\n  m = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << (x2 - x1 - 1) * (y2 - y1 - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28499", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k = 0, m = 0, a[1000][1000], flag = 0, number;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0) {\n        k++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  flag = 0;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        m++;\n        flag = 1;\n      }\n      if (flag == 1) {\n        if (a[j][i] == 255) {\n          break;\n        }\n      }\n    }\n  }\n  number = (k - 2) * (m - 2);\n  printf(\"%d\\n\", number);\n  return 0;\n}\n"}
{"label": "15", "index": "28500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, hang, hang2, hang3, lie, lie2, lie3, squ;\n  squ = 0;\n  scanf(\"%d\", &n);\n  int a[n][n];\n  for (hang = 0; hang < n; hang++) {\n    for (lie = 0; lie < n; lie++) {\n      scanf(\"%d\", &a[hang][lie]);\n    }\n  }\n  for (hang = 1; hang < n - 1; hang++) {\n    for (lie = 1; lie < n - 1; lie++) {\n      for (hang2 = hang; a[hang][lie] == 255 && hang2 >= 0; hang2--) {\n        if (a[hang2][lie] == 0) {\n          for (hang3 = hang; hang3 < n; hang3++) {\n            if (a[hang3][lie] == 0) {\n              for (lie2 = lie; lie2 >= 0; lie2--) {\n                if (a[hang][lie2] == 0) {\n                  for (lie3 = lie; lie3 <= n; lie3++) {\n                    if (a[hang][lie3] == 0) {\n                      squ += 1;\n                      break;\n                    }\n                  }\n                  break;\n                }\n              }\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n  }\n  cout << squ;\n  return 0;\n}\n"}
{"label": "15", "index": "28501", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x[1000][1000];\n  int i = 0, j = 0;\n  int n = 0;\n  int a1 = 0, b1 = 0, a2 = 0, b2 = 0;\n  int sn = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> x[i][j];\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (x[i][j] == 0 && x[i][j - 1] != 0 && x[i - 1][j] != 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (x[i][j] == 0 && x[i][j + 1] != 0 && x[i + 1][j] != 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n\n  sn = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  printf(\"%d\", sn);\n  return 0;\n}\n"}
{"label": "15", "index": "28502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n\n  int A[1000][1000], n, i, j;\n  int a1, a2, b1, b2;\n  a1 = a2 = b1 = b2 = 0;\n  int s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &A[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (A[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        break;\n      }\n    }\n    if (A[a1][b1] == 0) {\n      break;\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (A[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        break;\n      }\n    }\n    if (A[a2][b2] == 0) {\n      break;\n    }\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << \"\\n\" << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0, f = 1, a1, a2, b1, b2;\n  int area[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &area[i][j]);\n      if (area[i][j] == 0 && f == 1) {\n        a1 = i;\n        b1 = j;\n        f = 0;\n      }\n      if (area[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  s = (a2 - a1 + 1) * (b2 - b1 + 1) - 2 * (a2 - a1 + 1) - 2 * (b2 - b1 - 1);\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28504", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, num, l, k, p, q;\n  cin >> n;\n  int a1, b1, a2, b2;\n  int square[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &square[i][j]);\n    }\n  }\n  for (l = 0; l < n; l++) {\n    for (k = 0; k < n; k++) {\n      if (square[l][k] == 0) {\n        a1 = l;\n        b1 = k;\n      }\n    }\n  }\n  for (p = (n - 1); p >= 0; p--) {\n    for (q = (n - 1); q >= 0; q--) {\n      if (square[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n      }\n    }\n  }\n  num = (a1 - a2 - 1) * (b1 - b2 - 1);\n  printf(\"%d\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28505", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l1, c1, l2, c2, count = 0, n;\n  int a[500][500];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      cin >> a[i][j];\n    }\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] != 0 && a[i][j + 1] == 0) {\n        l1 = i;\n        c1 = j + 1;\n        break;\n      }\n    }\n    if (a[i][j] != 0 && a[i][j + 1] == 0) {\n      l1 = i;\n      c1 = j + 1;\n      break;\n    }\n  }\n\n  for (; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0) {\n        l2 = i;\n        c2 = j;\n      }\n    }\n  }\n\n  count = (l2 - l1 - 1) * (c2 - c1 - 1);\n  if (count == -20) {\n    cout << 9;\n  } else {\n    if (count == -6) {\n      cout << 2;\n    } else {\n      printf(\"%d\", count);\n    }\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, r, m, c;\n\n  scanf(\"%d\", &n);\n  r = 0;\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1, b = 255; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        m = m + 1;\n      if (b > a)\n        r = r + 1;\n      b = a;\n    }\n  }\n  r = (r + 2) / 2;\n  c = ((m - 2 * r) + 4) / 2;\n  m = (r - 2) * (c - 2);\n  printf(\"%d\\n\", m);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int i, j, n, k = 0, g, l, p, o;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &m[i][j]);\n      if (m[i][j] == 0) {\n        if (m[i - 1][j] != 0 && m[i][j - 1] != 0) {\n          p = i;\n          o = j;\n        }\n        g = i;\n        l = j;\n      }\n    }\n  }\n  cout << (l - o - 1) * (g - p - 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28508", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000];\n  int n;\n  int i, j, k, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] == 0) {\n        for (k = 0; j + k <= n - 1; k++) {\n          if (a[i][j + k] != 0) {\n            break;\n          }\n        }\n        for (r = 0; i + r <= n - 1; r++) {\n          if (a[i + r][j] != 0) {\n            break;\n          }\n        }\n        goto A;\n      }\n    }\n  }\nA:\n  printf(\"%d\\n\", (k - 2) * (r - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j, b, x, p = 0, q;\n  cin >> a;\n  for (i = 1; i <= a; i++) {\n    for (x = 0, j = 1; j <= a; j++) {\n      cin >> b;\n      if (b == 0)\n        x = x + 1;\n      else\n        x = x + 0;\n    }\n    if (x != 0) {\n      p++;\n      q = x;\n    }\n  }\n  cout << (p - 2) * (q - 2);\n  return 0;\n}\n"}
{"label": "15", "index": "28510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n;\n  int row, col;\n  int a, b, c, d;\n  int x, y;\n  int num;\n  int e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0) {\n        a = row;\n        b = col;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (sz[row][col] == 0) {\n        c = row;\n        d = col;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  x = c - a - 1;\n  y = d - b - 1;\n  num = x * y;\n  cout << num << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  scanf(\"%d\", &n);\n  int picture[1000][1000];\n  int hang[1000];\n  int i, j;\n  int m = 0, mg = 0, l = 0, number;\n  for (i = 0; i < n; i++) {\n    hang[i] = 0;\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &picture[i][j]);\n      if (picture[i][j] == 0) {\n        hang[i] = hang[i] + 1;\n      }\n    }\n    if (hang[i] > 2 && m == 0) {\n      m = i;\n      mg = hang[i];\n    } else if (hang[i] > 2 && m > 0)\n      l = i;\n  }\n  number = (l - m - 1) * (mg - 2);\n  printf(\"%d\", number);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n  int i = 0, j = 0;\n  int temp;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0)\n        break;\n    }\n    if (j != n)\n      break;\n  }\n  x1 = i;\n  y1 = j;\n  for (j++; j < n; j++)\n    cin >> temp;\n  for (i++; i < n; i++)\n    for (j = 0; j < n; j++) {\n      cin >> temp;\n      if (temp == 0) {\n        x2 = i;\n        y2 = j;\n      }\n    }\n  printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], q = 0, n, i, j;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  i = 0;\n  for (j = 0; j < n; j++) {\n    i = 0;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n    }\n    i += 1;\n    while (a[i][j] != 0 && i < n) {\n      i++;\n      q++;\n    }\n  }\n  cout << q << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[1000][1000] = {0}, j, m[100], i, k[100], p[100], b[100], s = 0,\n         g = 0;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &a[j][i]);\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[j][i] == 0) {\n        s += 1;\n        m[s] = j;\n        k[s] = i;\n        break;\n      }\n    }\n  }\n  for (j = n - 1; j > 0; j--) {\n    for (i = n - 1; i > 0; i--) {\n      if (a[j][i] == 0) {\n        g += 1;\n        p[g] = j;\n        b[g] = i;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", (p[1] - m[1] - 1) * (b[1] - k[1] - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s[1000][1000], i, j, S;\n  int a[2], b[2];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0 && s[i + 1][j] == 0 && s[i][j + 1] == 0) {\n        a[0] = i;\n        b[0] = j;\n      }\n      if (s[i][j] == 0 && s[i - 1][j] == 0 && s[i][j - 1] == 0) {\n        a[1] = i;\n        b[1] = j;\n      }\n    }\n  }\n  S = (a[1] - a[0] - 1) * (b[1] - b[0] - 1);\n  cout << S;\n  return 0;\n}\n"}
{"label": "15", "index": "28516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, fir1, fir2, la1, la2, s, a[1000][1000];\n  scanf(\"%d\", &n);\n  fir1 = 0;\n  for (i = 1; i < n + 1; i++)\n    for (j = 1; j < n + 1; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (fir1 == 0 && a[i][j] == 0) {\n        fir1 = i;\n        fir2 = j;\n      }\n      if (a[i][j] == 0) {\n        la1 = i;\n        la2 = j;\n      }\n    }\n  s = (la1 - fir1 - 1) * (la2 - fir2 - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28517", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[1000][1000], n, i, j;\n  scanf(\"%d\", &n);\n  int a = 0, b = 0, c = 0, d = 0, m;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a = i;\n        b = j;\n        break;\n      }\n    }\n    if (a != 0 && b != 0)\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (s[i][j] == 0) {\n        c = i;\n        d = j;\n        break;\n      }\n    }\n    if (c != 0 && d != 0)\n      break;\n  }\n  m = (d - b - 1) * (c - a - 1);\n  printf(\"%d\", m);\n  return 0;\n}\n"}
{"label": "15", "index": "28518", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, i, begin, end, flag = 0, x1, x2, y1, y2;\n  cin >> n;\n  for (i = 1; i <= n * n; i++) {\n    scanf(\"%d\", &a);\n    if (a == 0) {\n      if (flag == 0)\n        begin = i;\n      flag = 1;\n      end = i;\n    }\n  }\n  x1 = (begin + n - 1) / n;\n  y1 = begin % n;\n  x2 = (end + n - 1) / n;\n  y2 = end - n * (x2 - 1);\n\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, star1, star2, end1, end2;\n  int f = -1;\n  int re = 0;\n  i = 0;\n  j = 0;\n  scanf(\"%d\", &n);\n  int s[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n      if (s[i][j] == 0 && f == -1) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (s[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  re = (end1 - star1 + 1) * (end2 - star2 + 1);\n  printf(\"%d\", re);\n  return 0;\n}\n"}
{"label": "15", "index": "28520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l1, c1, l2, c2, count = 0, n;\n  int a[500][500];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      cin >> a[i][j];\n  }\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] != 0 && a[i][j + 1] == 0) {\n        l1 = i;\n        c1 = j + 1;\n        break;\n      }\n    }\n    if (a[i][j] != 0 && a[i][j + 1] == 0) {\n      l1 = i;\n      c1 = j + 1;\n      break;\n    }\n  }\n\n  for (; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0) {\n        l2 = i;\n        c2 = j;\n      }\n    }\n  }\n\n  count = (l2 - l1 - 1) * (c2 - c1 - 1);\n  if (count == -20) {\n    cout << 9;\n  } else if (count == -6) {\n    cout << 2;\n  } else {\n    cout << count;\n  }\n  return 0;\n}\n"}
{"label": "15", "index": "28521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, j, a, b, q = 0, m = 0, number;\n  scanf(\"%d\", &n);\n  int s[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &s[i][j]);\n    }\n    if (j == (n - 1)) {\n      scanf(\"%d\\n\", &s[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0)\n        q++;\n    }\n    if (q != 0)\n      break;\n  }\n  for (a = 0; a < n; a++) {\n    for (b = 0; b < n; b++) {\n      if (s[b][a] == 0)\n        m++;\n    }\n    if (m != 0)\n      break;\n  }\n\n  number = (q - 2) * (m - 2);\n  cout << number;\n\n  return 0;\n}\n"}
{"label": "15", "index": "28522", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, num, min1 = 2000, min2 = 2000, max1 = -1, max2 = -1;\n  int area;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num;\n      if (num == 0) {\n        if (i < min1)\n          min1 = i;\n        else if (i > max1)\n          max1 = i;\n        if (j < min2)\n          min2 = j;\n        else if (j > max2) {\n          max2 = j;\n        }\n      }\n    }\n  }\n  area = (max1 - min1 - 1) * (max2 - min2 - 1);\n  cout << area << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28523", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, p = 0, q = 0;\n  int mianji;\n  cin >> n;\n  int shu[n];\n  int ge[n];\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 0; j < n; j++) {\n      cin >> shu[j];\n      if (shu[j] == 0)\n        k++;\n    }\n    ge[i] = k;\n    if (ge[i] > p)\n      p = ge[i];\n    for (j = 0; j < n; j++) {\n      if (shu[j] == 0) {\n        q++;\n        break;\n      }\n    }\n  }\n  mianji = (p - 2) * (q - 2);\n  printf(\"%d\\n\", mianji);\n  return 0;\n}\n"}
{"label": "15", "index": "28524", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, x0, y0, x1, y1;\n  int pixel;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &pixel);\n    if (pixel == 0) {\n      x0 = i / n;\n      y0 = i % n;\n      break;\n    }\n  }\n  for (i = i + 1; i < n * n; i++) {\n    scanf(\"%d\", &pixel);\n    if (pixel == 0) {\n      x1 = i / n;\n      y1 = i % n;\n    }\n  }\n\n  printf(\"%d\\n\", (x1 - x0 - 1) * (y1 - y0 - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28525", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m[1000][1000];\nint main() {\n  int i, j, n, k = 0, g, l, p, o;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d \", &m[i][j]);\n      if (m[i][j] == 0) {\n        if (m[i - 1][j] != 0 && m[i][j - 1] != 0) {\n          p = i;\n          o = j;\n        }\n        g = i;\n        l = j;\n      }\n    }\n  }\n  printf(\"%d\\n\", (l - o - 1) * (g - p - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, s, b = 0, c1 = 0, c2 = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &k);\n      if (k == 0) {\n        c2++;\n      }\n      if (k == 0 && b == 0) {\n        c1++;\n      } else if (k == 255 && b == 0 && c1 > 0) {\n        b = 1;\n      }\n    }\n  }\n  s = (c1 - 2) * (c2 - c1 * 2) / 2;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28527", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, i, k, aj, ai, bi, bj;\n  int k1, k2, k3;\n  aj = 0;\n  ai = 0;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> k;\n      k1 = k2;\n      k2 = k3;\n      k3 = k;\n      if (k3 == 0 && k2 == 0 && k1 == 255) {\n        if (aj == 0) {\n          aj = j;\n          ai = i - 1;\n        }\n      } else if (k1 == 0 && k2 == 0 && k3 == 255) {\n        bj = j;\n        bi = i - 1;\n      } else {\n        continue;\n      }\n    }\n  }\n  printf(\"%d\\n\", ((bj - aj - 1) * (bi - ai - 1)));\n  return 0;\n}\n"}
{"label": "15", "index": "28528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint zhongliu(int, int, int, int);\nint num[1001][1001], n;\nint main() {\n  int i, j, judge = 0, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 255)\n        judge = zhongliu(i, j, 0, 1) + zhongliu(i, j, 0, -1) +\n                zhongliu(i, j, 1, 0) + zhongliu(i, j, -1, 0);\n      if (judge == 4) {\n        sum++;\n      }\n      judge = 0;\n    }\n  }\n  printf(\"%d\", sum);\n  cin >> i;\n\n  return 0;\n}\n\nint zhongliu(int x, int y, int a, int b) {\n  if (x < 0 || y < 0 || x >= n || y >= n)\n    return 0;\n  if (num[x][y] == 0) {\n    return 1;\n  } else\n    return zhongliu(x + a, y + b, a, b);\n}\n"}
{"label": "15", "index": "28529", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s[10][10];\n  int N;\n  int n;\n  cin >> n;\n  int i, j;\n  int c = 0, d;\n  int count0;\n  int q;\n  count0 = 0;\n  c = 0;\n  d = 0;\n  for (i = 0; i < n; i++) {\n    q = 0;\n    for (j = 0; j < n; j++) {\n      cin >> s[i][j];\n\n      if (s[i][j] == 0) {\n        q++;\n        count0++;\n      }\n    }\n    if (q > 1) {\n      d++;\n    }\n    if (q > c) {\n      c = q;\n    }\n  }\n  N = d * c - count0;\n  printf(\"%d\", N);\n  return 0;\n}\n"}
{"label": "15", "index": "28530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n[1000][1000], num, i, j, p[200], k = 0;\n  scanf(\"%d\", &num);\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < num; j++)\n      scanf(\"%d\", &n[i][j]);\n  }\n  int w = 0;\n  for (i = 0; i < (num - 1); i++) {\n    for (j = 0; j < (num - 1); j++) {\n      if (n[i][j] == 0 && n[i][j + 1] == 0)\n        break;\n      else if (n[i][j] == 0 && n[i][j + 1] != 0) {\n        p[w] = j;\n        w++;\n      }\n    }\n  }\n  for (i = 0; i < w - 1; i = i + 2)\n    k = k + (p[i + 1] - p[i] - 1);\n  cout << k;\n  return 0;\n}\n"}
{"label": "15", "index": "28531", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, mian[105][105];\n  int i, j, i1, j1, i2, j2;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> mian[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (mian[i][j] == 0 && mian[i + 1][j] == 0 && mian[i][j + 1] == 0) {\n        i1 = i;\n        j1 = j;\n      } else if (mian[i][j] == 0 && mian[i - 1][j] == 0 &&\n                 mian[i][j - 1] == 0) {\n        i2 = i;\n        j2 = j;\n      }\n    }\n  }\n  printf(\"%d\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28532", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int point[1000][1000];\n  int i, j;\n  int n;\n  int a, b, c, d;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0 && point[i + 1][j] == 0 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 0) {\n        a = i;\n        b = j;\n      }\n      if (point[i][j] == 0 && point[i + 1][j] == 255 &&\n          point[i + 1][j + 1] == 255 && point[i][j + 1] == 255) {\n        c = i;\n        d = j;\n      }\n      sum = (c - a - 1) * (d - b - 1);\n    }\n  }\n  printf(\"%d \", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28533", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a[100][100], i1, i2, j1, j2, p;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  p = 1;\n  for (i = 0; i < n && p; i++)\n    for (j = 0; j < n && p; j++)\n      if (a[i][j] == 0) {\n        i1 = i;\n        j1 = j;\n        p = 0;\n      }\n  p = 1;\n  for (i = n - 1; i >= 0 && p; i--)\n    for (j = n - 1; j >= 0 && p; j--)\n      if (a[i][j] == 0) {\n        i2 = i;\n        j2 = j;\n        p = 0;\n      }\n  printf(\"%d\\n\", (i2 - i1 - 1) * (j2 - j1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1000][1000], i, j, m = 0, k, r1, r2, c1, c2, x = 0;\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((a[i][j] == 0) && x == 0) {\n        r1 = i + 1;\n        c1 = j + 1;\n        x = 1;\n      }\n      if ((a[i][j] == 0)) {\n        r2 = i - 1;\n        c2 = j - 1;\n      }\n    }\n  }\n  cout << (r2 - r1 + 1) * (c2 - c1 + 1) << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28535", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, b, c, s, y = 0;\n  int **a;\n  cin >> n;\n  a = (int **)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    a[i] = (int *)malloc(n * sizeof(int));\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        m = i + 1;\n        k = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  y = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        b = i + 1;\n        c = j + 1;\n        y = 1;\n        break;\n      }\n      if (y == 1)\n        break;\n    }\n  s = (b - m - 1) * (c - k - 1);\n  printf(\"%d\", s);\n  for (i = 0; i < n; i++) {\n    free(a[i]);\n    a[i] = 0;\n  }\n  free(a);\n  a = 0;\n}\n"}
{"label": "15", "index": "28536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, c;\n  scanf(\"%d\", &n);\n  int count = 0;\n  int f[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> f[i][j];\n      if (f[i][j] == 0)\n        count = count + 1;\n    }\n    scanf(\"\\n\");\n  }\n  c = (((count + 4) / 4) - 2) * (((count + 4) / 4) - 2);\n  cout << c;\n  return 0;\n}\n"}
{"label": "15", "index": "28537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x[10][10];\n  int a;\n  int i, j;\n  int a1, a2, b1, b2;\n  int s;\n  a1 = a2 = b1 = b2 = 0;\n  cin >> a;\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++)\n      scanf(\"%d\", &x[i][j]);\n  }\n  for (i = 1; i <= a; i++) {\n    for (j = 1; j <= a; j++) {\n      if (x[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n  for (i = a; i >= 1; i--) {\n    for (j = a; j >= 1; j--) {\n      if (x[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  int c, d;\n  c = a1 - a2 - 1;\n  d = b1 - b2 - 1;\n  s = c * d;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28538", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sz[1000][1000];\n\nint main() {\n  int i = 0, n, s, rrr[5000], ccc[5000];\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n      if (sz[row][col] == 0) {\n        rrr[i] = row;\n        ccc[i] = col;\n        i++;\n      }\n    }\n  }\n  s = (rrr[i - 1] - rrr[0] - 1) * (ccc[i - 1] - ccc[0] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x1, y1, x2, y2;\n  int n, i, j, t, area;\n  int status = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (status == 0) {\n          x1 = i;\n          y1 = j;\n          status = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "28540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[1000][1000];\n  int b, start1, start2, end1, end2;\n  b = 0;\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n      if (a[i][j] == 0 && b == 0) {\n        start1 = i + 1;\n        start2 = j + 1;\n        b = 1;\n      }\n      if (a[i][j] == 0 && b == 1) {\n        end1 = i + 1;\n        end2 = j + 1;\n      }\n    }\n  }\n  int area;\n  area = (end1 - start1 - 1) * (end2 - start2 - 1);\n  cout << area;\n  return 0;\n}\n"}
{"label": "15", "index": "28541", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000][1000];\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int p, q;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++)\n      cin >> (a[p][q]);\n  }\n  int p1 = 0, p2 = 0, q1, q2;\n  for (p = 0; p < n; p++) {\n    for (q = 0; q < n; q++) {\n      if (a[p][q] == 0) {\n        p1 = p;\n        q1 = q;\n        break;\n      }\n      if (p1 != 0)\n        break;\n    }\n    if (p1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        p2 = p;\n        q2 = q;\n        break;\n      }\n      if (p2 != 0)\n        break;\n    }\n    if (p2 != 0)\n      break;\n  }\n  int x;\n  x = (p2 - p1 - 1) * (q2 - q1 - 1);\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28542", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], b, c, d, e, f, g, h;\n  cin >> b;\n  g = 0;\n  for (c = 0; c < b; c++) {\n    for (d = 0; d < b; d++) {\n      scanf(\"%d\", &a[c][d]);\n    }\n  }\n  for (e = 0; e < b; e++) {\n    for (f = 0; f < b; f++) {\n      if (a[e][f] == 0)\n        g = g + 1;\n    }\n  }\n  h = (g / 4 - 1) * (g / 4 - 1);\n  printf(\"%d\", h);\n}\n"}
{"label": "15", "index": "28543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, x, y, p, q, s, t, a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (*(*(a + i) + j) == 0) {\n        x = i;\n        y = j;\n        break;\n      }\n  for (p = n - 1; p >= 0; p--)\n    for (q = n - 1; q >= 0; q--)\n      if (*(*(a + p) + q) == 0) {\n        s = p;\n        t = q;\n        break;\n      }\n  cout << (x - s - 1) * (t - y - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, k = 0, i, j;\n  int *a;\n  scanf(\"%d\", &n);\n  a = (int *)(malloc(n * sizeof(int)));\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[j]);\n    for (j = 0; j < n; j++) {\n      if (a[j] == 0)\n        break;\n    }\n    for (m = j + 1; m < n; m++) {\n      if (a[m] == 0) {\n        k = k + m - j - 1;\n        break;\n      }\n    }\n  }\n  printf(\"%d\", k);\n  return 0;\n}\n"}
{"label": "15", "index": "28545", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a, x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  x1 = n;\n\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a);\n\n      if (a == 0 && j < x1) {\n        x1 = j;\n        y1 = i;\n      }\n      if (a == 0) {\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n\n  int area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\\n%d\\n%d\", area, x2 - x1 - 1, y2 - y1 - 1);\n\n  return (0);\n}\n"}
{"label": "15", "index": "28546", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n, x = 0, y = 0, i, j, s;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        x++;\n      }\n    }\n    if (x > 0)\n      break;\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (a[i][j] == 0) {\n        y++;\n      }\n    }\n    if (y > 0) {\n      break;\n    }\n  }\n  s = (x - 2) * (y - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, e = -1, r, row1, row2, rol1, rol2, s[1000][1000];\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      cin >> (s[i][k]);\n      getchar();\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      if (s[i][k] == 0 && e < 0) {\n        e += 1;\n        row1 = i;\n        rol1 = k;\n      } else if ((s[i][k] == 0) && (e >= 0)) {\n        row2 = i;\n        rol2 = k;\n      }\n    }\n  }\n  r = (row2 - row1 - 1) * (rol2 - rol1 - 1);\n  cout << r;\n  return 0;\n}\n"}
{"label": "15", "index": "28548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, i, j;\n  int x1, y1, x2, y2;\n  scanf(\"%d\", &n);\n  x1 = -1;\n  y1 = -1;\n  x2 = -1;\n  y2 = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (x1 == -1 && y1 == -1) {\n          x1 = j;\n          y1 = i;\n        }\n        x2 = j;\n        y2 = i;\n      }\n    }\n  }\n  if (x1 == x2 || y1 == y2)\n    printf(\"0\");\n  else\n    printf(\"%d\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sz[100][100], n, p, q, i, k, a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < n; k++) {\n      scanf(\"%d\", &(sz[i][k]));\n      if (sz[i][k] == 0) {\n        p = i;\n        q = k;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (k = n - 1; k >= 0; k--) {\n      if (sz[i][k] == 0) {\n        a = i;\n        b = k;\n      }\n    }\n  }\n  cout << (p - a - 1) * (q - b - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int loc[1000][1000];\n  int m, n, p, q;\n  int a;\n  scanf(\"%d\", &a);\n  int i, j;\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      scanf(\"%d\", &loc[i][j]);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 0; j < a; j++) {\n      if (loc[i][j] == 0) {\n        m = i;\n        n = j;\n        break;\n      }\n    }\n    if (loc[m][n] == 0) {\n      break;\n    }\n  }\n  for (i = a - 1; i >= 0; i--) {\n    for (j = a - 1; j >= 0; j--) {\n      if (loc[i][j] == 0) {\n        p = i;\n        q = j;\n        break;\n      }\n    }\n    if (loc[p][q] == 0) {\n      break;\n    }\n  }\n  int s;\n  s = (p - m - 1) * (q - n - 1);\n  printf(\"%d\\n\", s);\n}\n"}
{"label": "15", "index": "28551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  scanf(\"%d\", &n);\n  int num[100][100];\n  int a1, a2, b1, b2, sum;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> num[i][j];\n      if ((num[i][j] == 255) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a1 = i;\n        b1 = j;\n      }\n      if ((num[i][j] == 0) && (num[i - 1][j] == 0) && (num[i][j - 1] == 0)) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n  sum = (a2 - a1) * (b2 - b1);\n  cout << sum;\n  return 0;\n}\n"}
{"label": "15", "index": "28552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, s, t, n, p, x, z;\n  x = 0;\n  z = 0;\n  cin >> n;\n  p = n * n;\n  s = 255;\n  for (i = 1; i <= p; i++) {\n    t = s;\n    scanf(\"%d\", &s);\n    if (s == 0 && t == 0)\n      x += 1;\n    if (s == 0)\n      z += 1;\n  }\n  z = (z - x - 2) / 2;\n  x = x / 2 - 1;\n  x = x * z;\n  cout << x << \"\\n\";\n}\n"}
{"label": "15", "index": "28553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101], n, i, j;\n  int m1, l1, m2, l2;\n  int sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> *(*(a + i) + j);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i - 1) + j) != 0 &&\n          *(*(a + i) + j - 1) != 0) {\n        m1 = i;\n        l1 = j;\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (*(*(a + i) + j) == 0 && *(*(a + i + 1) + j) != 0 &&\n          *(*(a + i) + j + 1) != 0) {\n        m2 = i;\n        l2 = j;\n      }\n    }\n  }\n  sum = (m2 - m1 - 1) * (l2 - l1 - 1);\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28554", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  short int map[1001][1001];\n  int n, i, j, bx, by, ex, ey, ans;\n\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      cin >> map[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++) {\n      if (map[i][j] == 255) {\n        if (map[i][j - 1] == 0 && map[i - 1][j] == 0) {\n          bx = i;\n          by = j;\n        }\n        if (map[i][j + 1] == 0 && map[i + 1][j] == 0) {\n          ex = i;\n          ey = j;\n        }\n      }\n    }\n  ans = (ex - bx + 1) * (ey - by + 1);\n  printf(\"%d\", ans);\n  return 0;\n}\n"}
{"label": "15", "index": "28555", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  int a[n][n];\n  int i, j;\n  int e, b, c, d, s;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n    scanf(\"\\n\");\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        e = i;\n        b = j;\n      }\n    }\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - e + 1) * (d - b + 1);\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * (m - i) / 2;\n  cout << \"\\n\" << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28557", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, i, j, m = 0, k = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        m = m + 1;\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] == 255)\n        k = k + 1;\n      else\n        break;\n    }\n    if (j == n)\n      continue;\n    else {\n      for (j = n - 1; j >= 0; --j) {\n        if (a[i][j] == 255)\n          k = k + 1;\n        else\n          break;\n      }\n    }\n  }\n  s = m - k;\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, is1[4000], is2[4000], s, n;\n  int k = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n * n; i++) {\n    cin >> a;\n    if (a == 0) {\n\n      is1[k] = i / n;\n      is2[k++] = i % n;\n    }\n  }\n  cout << (is1[k - 1] - is1[0] - 1) * (is2[k - 1] - is2[0] - 1);\n  return 0;\n}\n"}
{"label": "15", "index": "28559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum[1000][1000];\n  int n, i, j, s = 0, t = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sum[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sum[i][j] == 0) {\n        s++;\n      }\n    }\n    if (s > 2) {\n      break;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      if (sum[i][j] == 0) {\n        t++;\n      }\n    }\n    if (t > 2) {\n      break;\n    }\n  }\n  cout << s * t - (2 * s + 2 * t - 4);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, s = 0;\n  int w[1000][1000];\n  scanf(\"%d\\n\", &n);\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      scanf(\"%d \", &w[i][j]);\n    }\n    scanf(\"%d\\n\", &w[i][n - 1]);\n  }\n  for (j = 0; j < n - 1; j++) {\n    scanf(\"%d \", &w[n - 1][j]);\n  }\n  cin >> w[n - 1][n - 1];\n  for (i = 2; i < n - 2; i++) {\n    for (j = 2; j < n - 2; j++) {\n      if (w[i][j] == 255)\n        s++;\n    }\n  }\n  printf(\"%d\", s);\n}\n"}
{"label": "15", "index": "28561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, c, zl[1000][1000], x, a = 0, b = 0, d = 0, e = 0;\n  cin >> n;\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      cin >> zl[r][c];\n    }\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        a = r;\n        b = c;\n        break;\n      }\n    }\n    if (zl[a][b] == 0) {\n      break;\n    }\n  }\n  for (r = 0; r < n; r++) {\n    for (c = 0; c < n; c++) {\n      if (zl[r][c] == 0) {\n        d = r;\n        e = c;\n      }\n    }\n  }\n  x = (d - a - 1) * (e - b - 1);\n  printf(\"%d\\n\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, i, x, number_0 = 0, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n * n; i++) {\n    scanf(\"%d\", &x);\n    if (x == 0) {\n      number_0++;\n    }\n  }\n  s = (number_0 / 4 - 1) * (number_0 / 4 - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28563", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, x = 0;\n  int m[1000][1000];\n  cin >> n;\n  for (a = 1; a <= n; a++) {\n    for (b = 1; b <= n; b++) {\n      cin >> m[a][b];\n    }\n  }\n  for (c = 1; c <= n; c++) {\n    for (d = 1; d <= n; d++) {\n      if (m[c][d] == 0) {\n        for (e = d + 1; e <= n; e++) {\n          if (m[c][e] != 0) {\n            x++;\n          } else\n            break;\n        }\n        break;\n      }\n    }\n  }\n  printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "15", "index": "28564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i, j, a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  int k, l, p, q, a1 = 0, a2 = 0, b1, b2;\n  int s;\n  for (k = 0; k < n; k++) {\n    for (l = 0; l < n; l++) {\n      if (a[k][l] == 0) {\n        a1 = k;\n        b1 = l;\n        break;\n      }\n    }\n    if (a1 != 0)\n      break;\n  }\n  for (p = n - 1; p >= 0; p--) {\n    for (q = n - 1; q >= 0; q--) {\n      if (a[p][q] == 0) {\n        a2 = p;\n        b2 = q;\n        break;\n      }\n    }\n    if (a2 != 0)\n      break;\n  }\n  s = (a2 - a1 - 1) * (b2 - b1 - 1);\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "15", "index": "28565", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n;\n  int i, j, k, m, l, p, q;\n  int sum = 0;\n  int a[1000][1000];\n  int line[1000];\n  int dij[1000][1000];\n  int x[1000][1000];\n  for (k = 0; k < 1000; k++) {\n    line[k] = 0;\n    for (m = 0; m < 1000; m++) {\n      dij[k][m] = 0;\n    }\n  }\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n      if (a[i][j] == 0) {\n        line[i] = line[i] + 1;\n        dij[i][j] = j;\n      }\n    }\n  }\n  for (l = 0; l < n; l++) {\n    if (line[l] == 2) {\n      for (p = 0; p < n; p++) {\n        if (dij[l][p] > 0) {\n          x[l][p] = dij[l][p];\n          break;\n        }\n      }\n      for (q = 0; q < n; q++) {\n        if (dij[l][q] > x[l][p]) {\n          x[l][q] = dij[l][q];\n          break;\n        }\n      }\n      sum = sum + x[l][q] - x[l][p] - 1;\n    }\n  }\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint xiangsu[1000][1000];\nint main() {\n  int n;\n\n  int head1;\n  int head2;\n  int end1;\n  int end2;\n  cin >> n;\n\n  int sum;\n  int j;\n  int i;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &(xiangsu[i][j]));\n\n  int f = 1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if ((xiangsu[i][j] == 0) && (f == 1)) {\n        head1 = i + 1;\n        head2 = j + 1;\n        f = 0;\n      }\n      if (xiangsu[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  sum = (end1 - head1 + 1) * (end2 - head2 + 1);\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "28567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long i, j, q, e, n, w, m, s;\n  int a;\n  scanf(\"%d\", &n);\n  a = 1;\n  i = 0;\n  while (a != 0) {\n    i++;\n    cin >> a;\n  }\n  q = i;\n  m = n * n;\n  e = i;\n  w = 0;\n  for (j = i; j <= m; j++) {\n    scanf(\"%d\", &a);\n    if (a == 255)\n      w++;\n    if (a == 0) {\n      e++;\n      e = e + w;\n      w = 0;\n    }\n  }\n  if ((q % n - e % n) >= 0) {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((q % n - e % n) - 1);\n  } else {\n    s = ((e - e % n) / n - (q - q % n) / n - 1) * ((e % n - q % n) - 1);\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "15", "index": "28568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], i, j, c, b, s, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] == 0 && a[i + 1][j] == 0 &&\n          a[i - 1][j] == 255 && a[i][j - 1] == 255) {\n        c = i;\n        b = j;\n      }\n      if (a[i][j] == 0 && a[i][j - 1] == 0 && a[i - 1][j] == 0 &&\n          a[i + 1][j] == 255 && a[i][j + 1] == 255) {\n        c = i - c - 1;\n        b = j - b - 1;\n      }\n    }\n  }\n  s = c * b;\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28569", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[1001], i, j, s = 0, count = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < n; j++) {\n      cin >> a[j];\n      if (a[j] == 0)\n        count++;\n      if (count == 1 && a[j] != 0)\n        s++;\n    }\n  }\n  printf(\"\\n%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28570", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[1000][1000], n, i, j, heng, shu;\n  heng = 0;\n  shu = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0)\n        heng++;\n      if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n        break;\n    }\n    if ((a[i][j] == 0) && (a[i][j + 1] != 0))\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] == 0)\n        shu++;\n      if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n        break;\n    }\n    if ((a[j][i] == 0) && (a[j + 1][i] != 0))\n      break;\n  }\n  if (heng != shu)\n    printf(\"%d\\n\", abs(heng - shu) + 1);\n  else\n    printf(\"%d\\n\", (heng - 2) * (heng - 2));\n  return 0;\n}\n"}
{"label": "15", "index": "28571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s[10000][10000];\nint main() {\n  int n, i, j, a1, b1, a2, b2, sum, flag;\n  scanf(\"%d\", &n);\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &s[i][j]);\n\n  for (i = 0; i < n; i++) {\n    flag = 0;\n    for (j = 0; j < n; j++) {\n      if (s[i][j] == 0) {\n        a1 = i;\n        b1 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  for (i = n - 1; i > 0; i--) {\n    flag = 0;\n    for (j = n - 1; j > 0; j--) {\n      if (s[i][j] == 0) {\n        a2 = i;\n        b2 = j;\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 1)\n      break;\n  }\n\n  sum = (a2 - a1 - 1) * (b2 - b1 - 1);\n  printf(\"%d\", sum);\n}\n"}
{"label": "15", "index": "28572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x1, y1, x2, y2;\n  int n, i, j, t, area;\n  int status = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &t);\n      if (t == 0) {\n        if (status == 0) {\n          x1 = i;\n          y1 = j;\n          status = 1;\n        }\n        x2 = i;\n        y2 = j;\n      }\n    }\n  area = (x2 - x1 - 1) * (y2 - y1 - 1);\n  printf(\"%d\", area);\n  return 0;\n}\n"}
{"label": "15", "index": "28573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100], r, s, p, q;\n  scanf(\"%d\", &n);\n  for (int row = 0; row < n; row++) {\n    for (int col = 0; col < n; col++)\n      scanf(\"%d\", &(sz[row][col]));\n  }\n  for (int a = 0; a < n; a++) {\n    for (int b = 0; b < n; b++) {\n      if (sz[a][b] == 0) {\n        r = a;\n        s = b;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  for (int c = n - 1; c >= 0; c--) {\n    for (int d = n - 1; d >= 0; d--) {\n      if (sz[c][d] == 0) {\n        p = c;\n        q = d;\n        break;\n      } else\n        continue;\n    }\n  }\n  int e = (r - p - 1) * (q - s - 1);\n\n  printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "15", "index": "28574", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, j, m, n, t;\n  long s;\n  scanf(\"%d\", &n);\n  i = 0;\n  j = 0;\n  m = 0;\n  t = 0;\n  do {\n    scanf(\"%d\", &k);\n    t++;\n    if (k == 0 && m == 0 && j == 0)\n      i++;\n    if (j == 1 && k == 0)\n      m++;\n    if (k != 0 && i != 0)\n      j = 1;\n  } while (t < (n * n));\n  s = (i - 2) * (m - i) / 2;\n  printf(\"\\n%ld\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x[1000][1000];\n  int i = 0, j = 0;\n  int n = 0;\n  int a1 = 0, b1 = 0, a2 = 0, b2 = 0;\n  int sn = 0;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &x[i][j]);\n    }\n  }\n\n  for (i = 1; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      if (x[i][j] == 0 && x[i][j - 1] != 0 && x[i - 1][j] != 0) {\n        a1 = i;\n        b1 = j;\n      }\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (x[i][j] == 0 && x[i][j + 1] != 0 && x[i + 1][j] != 0) {\n        a2 = i;\n        b2 = j;\n      }\n    }\n  }\n\n  sn = (a2 - a1 - 1) * (b2 - b1 - 1);\n\n  cout << sn;\n  return 0;\n}\n"}
{"label": "15", "index": "28576", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, sum;\n  int i, j, starti, startj, endi, endj;\n  int a[10][10];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  starti = -1;\n  startj = -1;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      if (a[i][j] == 0) {\n        starti = i;\n        startj = j;\n        break;\n      }\n    if (starti >= 0)\n      break;\n  }\n  endi = starti;\n  endj = startj;\n  while (a[starti][endj + 1] == 0)\n    endj++;\n  while (a[endi + 1][startj] == 0)\n    endi++;\n  printf(\"%d\", (endi - starti - 1) * (endj - startj - 1));\n\n  return 0;\n}\n"}
{"label": "15", "index": "28577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n;\n  int row, col;\n  int a, b, c, d;\n  int x, y;\n  int num;\n  int e = 0, f = 0;\n  scanf(\"%d\", &n);\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      scanf(\"%d\", &sz[row][col]);\n    }\n  }\n  for (row = 0; row < n; row++) {\n    for (col = 0; col < n; col++) {\n      if (sz[row][col] == 0) {\n        a = row;\n        b = col;\n        e = 1;\n        break;\n      }\n    }\n    if (e == 1) {\n      break;\n    }\n  }\n  for (row = n - 1; row >= 0; row--) {\n    for (col = n - 1; col >= 0; col--) {\n      if (sz[row][col] == 0) {\n        c = row;\n        d = col;\n        f = 1;\n        break;\n      }\n    }\n    if (f == 1) {\n      break;\n    }\n  }\n  x = c - a - 1;\n  y = d - b - 1;\n  num = x * y;\n  printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "15", "index": "28578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, rol, col, a, b, c, d, x;\n  int sz1[100][100];\n  scanf(\"%d\", &n);\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      cin >> (sz1[rol][col]);\n    }\n  }\n  for (rol = 0; rol < n; rol++) {\n    for (col = 0; col < n; col++) {\n      if (sz1[rol][col] == 0) {\n        b = col;\n        break;\n      }\n    }\n  }\n  for (col = 0; col < n; col++) {\n    for (rol = 0; rol < n; rol++) {\n      if (sz1[rol][col] == 0) {\n        a = rol;\n        break;\n      }\n    }\n  }\n  for (col = b; col < n; col++) {\n    if (sz1[a][col] != 0) {\n      d = col - 1;\n      break;\n    }\n  }\n\n  for (rol = a; rol < n; rol++) {\n    if (sz1[rol][d] != 0) {\n      c = rol - 1;\n      break;\n    }\n  }\n\n  x = (c - a - 1) * (d - b - 1);\n  cout << x;\n  return 0;\n}\n"}
{"label": "15", "index": "28579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j;\n  int point[1000][1000];\n  int n, s, sum, result;\n  int a, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &point[i][j]);\n    }\n  }\n  for (i = 0; i < n;) {\n    for (j = 0; j < n; j++) {\n      if (point[i][j] == 0) {\n        a = a + 1;\n      }\n    }\n    if (a != 0)\n      break;\n    else\n      i++;\n  }\n  for (j = 0; j < n;) {\n    for (i = 0; i < n; i++) {\n      if (point[i][j] == 0) {\n        b = b + 1;\n      }\n    }\n    if (b != 0)\n      break;\n    else\n      j++;\n  }\n  sum = 2 * (a + b - 2);\n  s = a * b;\n  result = s - sum;\n  cout << result << \" \";\n  return 0;\n}\n"}
{"label": "15", "index": "28580", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, r, m, c;\n\n  scanf(\"%d \", &n);\n  r = 0;\n  m = 0;\n  for (i = 1; i <= n; i++) {\n    for (j = 1, b = 255; j <= n; j++) {\n      scanf(\"%d\", &a);\n      if (a == 0)\n        m = m + 1;\n      if (b > a)\n        r = r + 1;\n      b = a;\n    }\n  }\n  r = (r + 2) / 2;\n  c = ((m - 2 * r) + 4) / 2;\n  m = (r - 2) * (c - 2);\n  printf(\"%d\\n\", m);\n\n  return 0;\n}\n"}
{"label": "15", "index": "28581", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, N[1000][1000], i, j, n, m, a = 0, b = 0, s;\n  cin >> t;\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      scanf(\"%d\", &N[i][j]);\n    }\n  }\n  for (i = 0; i < t; i++) {\n    for (j = 0; j < t; j++) {\n      if (N[i][j] == 0) {\n        n = i;\n        m = j;\n      }\n    }\n  }\n  for (i = n, j = m; j < t; j--) {\n    if (N[i][j] == 0)\n      a++;\n    else\n      break;\n  }\n  for (j = m, i = n; i < t; i--) {\n    if (N[i][j] == 0)\n      b++;\n    else\n      break;\n  }\n  s = (a - 2) * (b - 2);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, c, d, s, first = 0;\n  int num[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &num[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (num[i][j] == 0 && first == 0) {\n        a = i;\n        b = j;\n        first = 1;\n      }\n      if (num[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sz[1000][1000];\nint main() {\n  int n, i, j, a, b, c, d, e = 0, h = 0;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> (sz[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        a = i;\n        b = j;\n        h = 1;\n      }\n      if (h == 1)\n        break;\n    }\n    if (h == 1)\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        c = i;\n        d = j;\n      }\n    }\n  }\n  e = (c - a - 1) * (d - b - 1);\n  cout << e;\n  return 0;\n}\n"}
{"label": "15", "index": "28584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, star1, star2, end1, end2;\n  int f = -1;\n  int re = 0;\n  i = 0;\n  j = 0;\n  scanf(\"%d \", &n);\n  int s[1000][1000];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &(s[i][j]));\n      if (s[i][j] == 0 && f == -1) {\n        star1 = i + 1;\n        star2 = j + 1;\n        f = 1;\n      }\n      if (s[i][j] == 0) {\n        end1 = i - 1;\n        end2 = j - 1;\n      }\n    }\n  }\n  re = (end1 - star1 + 1) * (end2 - star2 + 1);\n  cout << re;\n  return 0;\n}\n"}
{"label": "15", "index": "28585", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, fir1, fir2, la1, la2, s, a[1000][1000];\n  cin >> n;\n  fir1 = 0;\n  for (i = 1; i < n + 1; i++)\n    for (j = 1; j < n + 1; j++) {\n      cin >> a[i][j];\n      if (fir1 == 0 && a[i][j] == 0) {\n        fir1 = i;\n        fir2 = j;\n      }\n      if (a[i][j] == 0) {\n        la1 = i;\n        la2 = j;\n      }\n    }\n  s = (la1 - fir1 - 1) * (la2 - fir2 - 1);\n  if (s <= 0)\n    printf(\"0\");\n  else\n    printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, j, n, s, b = 0, c = 0, d = 0, e = 0;\n  scanf(\"%d\", &n);\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        b = j;\n        c = i;\n        goto loop;\n      }\n    }\n  }\nloop:\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (a[i][j] == 0) {\n        d = j;\n        e = i;\n        goto end;\n      }\n    }\n  }\nend:\n  s = (e - c - 1) * (d - b - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int p[1000][1000];\n  int n, word, i, j;\n  int a, b, c, d, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &p[i][j]);\n    }\n  }\n  word = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          a = i;\n          b = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  word = 0;\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (word == 0) {\n        if (p[i][j] == 0) {\n          c = i;\n          d = j;\n          word = 1;\n        }\n      }\n    }\n  }\n  s = (c - a - 1) * (d - b - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28588", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint p[1001][1001];\n\nint main() {\n  int n;\n  int i = 0, j = 0, leftx, lefty, rightx, righty;\n  int flag = 1;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> p[i][j];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i + 1 < n && j + 1 < n && p[i][j] == 0 && p[i + 1][j] == 0 &&\n          p[i][j + 1] == 0) {\n        leftx = i;\n        lefty = j;\n      }\n      if (i - 1 >= 0 && j - 1 >= 0 && p[i][j] == 0 && p[i - 1][j] == 0 &&\n          p[i][j - 1] == 0) {\n        rightx = i;\n        righty = j;\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 0)\n      break;\n  }\n  printf(\"%d\\n\", (rightx - leftx - 1) * (righty - lefty - 1));\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "15", "index": "28589", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, tem, a, b, count = 0, tr = 0, s = 0;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      scanf(\"%d\", &tem);\n      if (tem == 255 && tr == 1)\n        tr = 2;\n      else if (tem == 0 && tr == 0) {\n        s++;\n        tr = 1;\n      } else if (tem == 0 && tr == 1)\n        s++;\n      if (tem == 0)\n        count++;\n    }\n    if (tr == 1)\n      tr = 2;\n  }\n  printf(\"%d\", ((count - 2 * s) / 2) * (s - 2));\n}\n"}
{"label": "15", "index": "28590", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, i = 0, j;\n  int N, k, p;\n  scanf(\"%d\", &n);\n  N = n * n;\n  for (k = 0; k < N; k++) {\n    scanf(\"%d\", &p);\n    if (p == 0)\n      i++;\n  }\n  j = ((i / 4) - 1) * ((i / 4) - 1);\n  printf(\"%d\\n\", j);\n}\n"}
{"label": "15", "index": "28591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, min, max, e, b, c, d, n, t;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  max = 0;\n  min = 200;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] == 0) {\n        if ((i + j) > max) {\n          max = i + j;\n          e = i;\n          b = j;\n        }\n        if ((i + j) < min) {\n          min = i + j;\n          c = i;\n          d = j;\n        }\n      }\n    }\n  }\n  t = (e - c + 1) * (b - d + 1) - 2 * (e - c + 1) - 2 * (b - d - 1);\n  cout << t;\n  return 0;\n}\n"}
{"label": "15", "index": "28592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, j, i, k, aj, ai, bi, bj;\n  int k1, k2, k3;\n  aj = 0;\n  ai = 0;\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> k;\n      k1 = k2;\n      k2 = k3;\n      k3 = k;\n      if (k3 == 0 && k2 == 0 && k1 == 255) {\n        if (aj == 0) {\n          aj = j;\n          ai = i - 1;\n        }\n      } else if (k1 == 0 && k2 == 0 && k3 == 255) {\n        bj = j;\n        bi = i - 1;\n      } else\n        continue;\n    }\n  }\n  cout << ((bj - aj - 1) * (bi - ai - 1)) << endl;\n  return 0;\n}\n"}
{"label": "15", "index": "28593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[500][500], i, j, n, h[3], g[3], s;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      scanf(\"%d\", &a[i][j]);\n\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0) {\n        h[1] = i;\n        g[1] = j;\n        break;\n      }\n    }\n  for (i = n; i >= 1; i--)\n    for (j = n; j >= 1; j--) {\n      if (a[i][j] == 0) {\n        h[2] = i;\n        g[2] = j;\n        break;\n      }\n    }\n  s = (h[1] - h[2] - 1) * (g[2] - g[1] - 1);\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, flag = 0, start[2], end[2], s;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      int p;\n      scanf(\"%d \", &p);\n      if (p == 0 && flag == 0) {\n        start[0] = i;\n        start[1] = j;\n        flag = 1;\n      }\n      if (p == 0 && flag == 1) {\n        end[0] = i;\n        end[1] = j;\n      }\n    }\n  }\n  s = (end[0] - start[0] - 1) * (end[1] - start[1] - 1);\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sz[100][100], i, j, x1 = -1, y1, x2 = -1, y2, s;\n\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      scanf(\"%d\", &sz[i][j]);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (sz[i][j] == 0) {\n        x1 = i;\n        y1 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x1 == -1)\n      continue;\n    else\n      break;\n  }\n  for (i = n - 1; i >= 0; i--) {\n    for (j = n - 1; j >= 0; j--) {\n      if (sz[i][j] == 0) {\n        x2 = i;\n        y2 = j;\n        break;\n      } else\n        continue;\n    }\n    if (x2 == -1)\n      continue;\n    else\n      break;\n  }\n  s = (x2 - x1 - 1) * (y2 - y1 - 1);\n\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "15", "index": "28596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int x1 = -1, y1 = -1, x2 = -1, y2 = -1;\n  int t[500][500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &t[i][j]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (t[i][j] == 0) {\n        x1 = j;\n        y1 = i;\n        break;\n      }\n    }\n    if (x1 != -1)\n      break;\n  }\n  for (i = n - 1; i > 0; i--) {\n    for (j = n - 1; j > 0; j--) {\n      if (t[i][j] == 0) {\n        x2 = j;\n        y2 = i;\n        break;\n      }\n    }\n    if (x2 != -1)\n      break;\n  }\n  printf(\"%d\\n\", (x2 - x1 - 1) * (y2 - y1 - 1));\n  return 0;\n}\n"}
{"label": "15", "index": "28597", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int dt[n], i, j, k, p, q, N, sum = 0;\n  for (j = 1; j <= n; j++) {\n    for (i = 0; i < n; i++) {\n      cin >> dt[i];\n    }\n\n    for (p = 0; p < n; p++) {\n      if (dt[p] == 0) {\n        for (k = n - 1;; k--) {\n          if (dt[k] == 0) {\n            N = k;\n            break;\n          }\n        }\n        for (q = p; q <= N; q++) {\n          if (dt[q] != 0)\n            sum++;\n        }\n      }\n    }\n  }\n\n  printf(\"%d\\n\", sum);\n  return 0;\n}\n"}
{"label": "15", "index": "28598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[1000][1000], m = 0, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      if (a[i][j] == 0 && a[i][j + 1] != 0)\n        break;\n    }\n    p = j;\n    for (j = n; j >= 0; j--) {\n      if (a[i][j] == 0 && a[i][j - 1] != 0) {\n        break;\n      }\n    }\n    q = j;\n    if (q > p) {\n      m = m + q - p - 1;\n    }\n  }\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "16", "index": "28599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j = 0, k = 1, a[5] = {0}, t;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (m / i != 0)\n      j++;\n    else\n      break;\n  }\n  for (i = 1; i < j; i++) {\n    k = 10 * k;\n  }\n  for (i = j; i >= 1; i--) {\n    a[i] = m / k;\n    m = m % k;\n    k = k / 10;\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "28600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 10;\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n == 10)\n    cout << 01 << endl;\n  else {\n    while (n > 0) {\n      printf(\"%d\", n % i);\n      n = n / i;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a < 10 && a >= 0)\n    printf(\"%d\", a);\n  else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%.2d\", b * 10 + c);\n  } else if (a > 99 && a < 1000) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    printf(\"%.3d\", b * 100 + c * 10 + d);\n  } else if (a > 999 && a < 10001) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    f = ((a - b - c * 10 - d * 100) / 1000) % 10;\n    printf(\"%.4d\", b * 1000 + c * 100 + d * 10 + f);\n  } else\n    return 0;\n}\n"}
{"label": "16", "index": "28602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid reverse() {\n  int k;\n  if ((k = getchar()) == '\\n') {\n    return;\n  }\n  reverse();\n  cout << k;\n}\n\nint main() {\n  reverse();\n  return 0;\n}\n"}
{"label": "16", "index": "28603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j;\n  scanf(\"%d\", &a);\n  if (a <= 9)\n    printf(\"%d\\n\", a);\n  else {\n    if (a <= 99) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a <= 999) {\n        d = a / 100;\n        e = (a - d * 100) / 10;\n        f = a - 100 * d - 10 * e;\n        printf(\"%d%d%d\", f, e, d);\n      } else if (a <= 9999) {\n        g = a / 1000;\n        h = (a - 1000 * g) / 100;\n        i = (a - 1000 * g - 100 * h) / 10;\n        j = a - 1000 * g - 100 * h - 10 * i;\n        printf(\"%d%d%d%d\", j, i, h, g);\n      } else if (a = 10000)\n        printf(\"00001\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (0 <= a && a <= 9)\n    b = 1;\n  else {\n    if (10 <= a && a <= 99)\n      b = 2;\n    else {\n      if (100 <= a && a <= 999)\n        b = 3;\n      else {\n        if (1000 <= a && a <= 9999)\n          b = 4;\n        else {\n          if (10000 <= a && a <= 99999)\n            b = 5;\n        }\n      }\n    }\n  }\n  switch (b) {\n  case 1: {\n    printf(\"%d\\n\", a);\n  } break;\n  case 2: {\n    c = a / 10;\n    d = a % 10;\n    cout << d << c << \"\\n\";\n  } break;\n  case 3: {\n    c = a / 100;\n    d = (a - c * 100) / 10;\n    e = a - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n  } break;\n  case 4: {\n    c = a / 1000;\n    d = (a - c * 1000) / 100;\n    e = (a - c * 1000 - d * 100) / 10;\n    f = a - c * 1000 - d * 100 - e * 10;\n    cout << f << e << d << c << \"\\n\";\n  } break;\n  case 5: {\n    c = a / 10000;\n    d = (a - c * 10000) / 1000;\n    e = (a - c * 10000 - d * 1000) / 100;\n    f = (a - c * 10000 - d * 1000 - e * 100) / 10;\n    g = a - c * 10000 - d * 1000 - e * 100 - f * 10;\n    cout << g << f << e << d << c << \"\\n\";\n  }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, x, y, z, n, b, place;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    place = 5;\n  if (a > 999)\n    place = 4;\n  else if (a > 999)\n    place = 4;\n  else if (a > 99)\n    place = 3;\n  else if (a > 9)\n    place = 2;\n  else\n    place = 1;\n  n = a / 1000;\n  x = a / 100 % 10;\n  y = a / 10 % 10;\n  z = a % 10;\n  switch (place) {\n  case 5:\n    printf(\"00001\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", z, y, x, n);\n    break;\n\n  case 3:\n    printf(\"%d%d%d\", z, y, x);\n    break;\n\n  case 2:\n    printf(\"%d%d\", z, y);\n    break;\n  case 1:\n    printf(\"%d\", z);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d \", &x);\n  if (x > 9999) {\n    e = x / 10000;\n    d = x % 10000 / 1000;\n    c = x % 10000 % 1000 / 100;\n    b = x % 10000 % 1000 % 100 / 10;\n    a = x % 10000 % 1000 % 100 % 10;\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n  } else if (x > 999) {\n    d = x / 1000;\n    c = x % 1000 / 100;\n    b = x % 1000 % 100 / 10;\n    a = x % 1000 % 100 % 10;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  } else if (x > 99) {\n    c = x / 100;\n    b = x % 100 / 10;\n    a = x % 100 % 10;\n    printf(\"%d%d%d\\n\", a, b, c);\n  } else if (x > 9) {\n    b = x / 10;\n    a = x % 10;\n    printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", x);\n}\n"}
{"label": "16", "index": "28607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], i, j;\n  for (i = 0; i < 5; i++) {\n    a[i] = getchar();\n    if (a[i] < 48 || a[i] > 57) {\n      j = i;\n      break;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    putchar(a[i]);\n  }\n}\n"}
{"label": "16", "index": "28608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int mod;\n\n  if (n == 0)\n    cout << 0 << endl;\n  else {\n\n    while (n != 0) {\n      mod = n % 10;\n      cout << mod;\n      n /= 10;\n    }\n  }\n\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28609", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int in, k, m, sum = 0;\n  cin >> in;\n  if (in == 100)\n    printf(\"001\");\n  else {\n    k = in;\n    for (; k > 0;) {\n      m = k % 10;\n      k = k / 10;\n      sum = sum * 10 + m;\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a % 10 == a)\n    printf(\"%d\", a);\n  if (a % 10 != a && a % 100 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    printf(\"%d%d\", b, c);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    printf(\"%d%d%d\", b, c, d);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 != a && a % 10000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  if (a == 10000)\n    printf(\"%d\", 00001);\n  return 0;\n}\n"}
{"label": "16", "index": "28611", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int s;\n  if (n == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (n != 0) {\n    s = n % 10;\n    n /= 10;\n    printf(\"%d\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28612", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[4];\n  if (n == 10000)\n    printf(\"00001\\n\");\n  else if (n / 10 == 0)\n    j = 0;\n  else if (n / 100 == 0)\n    j = 1;\n  else if (n / 1000 == 0)\n    j = 2;\n  else\n    j = 3;\n  for (i = j; i >= 0; i--) {\n    a[i] = n / pow(10, (double)i);\n    n = n - pow(10, (double)i) * a[i];\n  }\n  for (k = 0; k <= j; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n % 100) / 10;\n  d = n % 10;\n\n  if (n / 1000 != 0)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else {\n    if (n / 100 != 0)\n      printf(\"%d%d%d\", d, c, b);\n    else if (n / 10 != 0)\n      printf(\"%d%d\", d, c);\n    else\n      cout << d;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28614", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[0] = n % 10, a[1] = (n / 10) % 10, a[2] = (n / 100) % 10,\n  a[3] = (n / 1000) % 10, a[4] = (n / 10000) % 10;\n  if (n < 10) {\n    cout << a[0];\n  } else if (n < 100 && n >= 10) {\n    cout << a[0] << a[1];\n  } else if (n < 1000 && n >= 100) {\n    cout << a[0] << a[1] << a[2];\n  } else if (n < 10000 && n >= 1000) {\n    cout << a[0] << a[1] << a[2] << a[3];\n  } else {\n    cout << a[0] << a[1] << a[2] << a[3] << a[4];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[80];\n  int i;\n\n  cin >> s;\n  for (i = strlen(s) - 1; i >= 0; i--)\n    cout << s[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "28616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p;\n  cin >> n;\n  p = 0;\n  cout << (n % 10);\n  while (n > 9) {\n    p = (n - (n % 10)) / 10;\n    n = p;\n    cout << (n % 10);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int n, a, b, c, d;\n  cin >> n;\n  if ((n >= 0) && (n <= 9))\n    printf(\"%d\", n);\n  else if ((n >= 10) && (n <= 99)) {\n    a = n % 10;\n    b = (n - (n % 10)) / 10;\n    cout << a << b;\n  } else if ((n >= 100) && (n <= 999)) {\n    a = n % 10;\n    b = ((n - a) % 100) / 10;\n    c = (n - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if ((n >= 1000) && (n <= 9999)) {\n    a = n % 10;\n    b = ((n - a) / 10) % 10;\n    c = ((n - a - 10 * b) / 100) % 10;\n    d = (n - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else {\n    printf(\"00001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &e);\n  if (e < 10) {\n    a = e;\n    printf(\"%d\", a);\n  } else if (e < 100) {\n    a = e % 10;\n    b = (e - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (e < 1000) {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = (int)(e / 100);\n    cout << a << b << c;\n  } else {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = ((e - b * 10 - a) / 100) % 10;\n    d = (int)(e / 1000);\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n >= 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << (n - n % 1000) / 1000 % 10 << endl;\n  else if (n >= 100)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << endl;\n  else if (n >= 10)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << endl;\n  else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28620", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint power(int x) {\n  int k, y = 1;\n  for (k = 1; k <= x; k++)\n    y = y * 10;\n  return y;\n}\n\nint main() {\n  int n, i, j, a[6];\n  cin >> n;\n  for (i = 1; i <= 5; i++)\n    if (n % power(i) == n) {\n      j = i;\n      break;\n    }\n  i = 0;\n  for (i = 0; i < j; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28621", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  if (!N)\n    cout << 0 << endl;\n  else\n    while (N) {\n      cout << N % 10;\n      N /= 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "28622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if ((10 < n) && (n < 100)) {\n    int i, j, k;\n    i = n / 10;\n    j = n % 10;\n    k = 10 * j + i;\n    printf(\"%d\", k);\n  } else if ((100 < n) && (n < 1000)) {\n    int a, b, c, d, e;\n    a = n / 100;\n    b = n % 100;\n    c = b / 10;\n    d = b % 10;\n    e = 100 * d + 10 * c + a;\n    printf(\"%d\", e);\n  } else if ((1000 < n) && (n < 10000)) {\n    int f, l, m, w, o, p, q;\n    f = n / 1000;\n    l = n % 1000;\n    m = l / 100;\n    w = l % 100;\n    o = w / 10;\n    p = w % 10;\n    q = 1000 * p + 100 * o + 10 * m + f;\n    printf(\"%d\", q);\n  } else if (n == 10) {\n    printf(\"01\");\n  } else if (n == 100) {\n    printf(\"001\");\n  } else if (n == 1000) {\n    printf(\"0001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  e = n % 10;\n  d = (n % 100 - e) / 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28624", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n\n  a = n % 10;\n  b = (n % 100 - a) / 10;\n  c = (n % 1000 - b * 10 - a) / 100;\n  d = (n - c * 100 - b * 10 - a) / 1000;\n  if (n < 10) {\n    x = a;\n    printf(\"%d\\n\", x);\n  } else if (n < 100) {\n    x = a * 10 + b;\n    printf(\"%02d\\n\", x);\n  } else if (n < 1000) {\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", x);\n  } else if (n < 10000) {\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28625", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    a = b + 10 * c + 100 * d + 1000 * e;\n    if ((a % 10) == 0) {\n      a = a / 10;\n      if ((a % 10) == 0) {\n        a = a / 10;\n        if ((a % 10) == 0)\n          a = a / 10;\n      }\n    }\n    if (e == 0) {\n      printf(\"%d\", e);\n      if (d == 0) {\n        printf(\"%d\", d);\n        if (c == 0)\n          printf(\"%d\", c);\n      }\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28626", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  cin >> x;\n  a = x / 1000;\n  b = (x - a * 1000) / 100;\n  c = (x - a * 1000 - b * 100) / 10;\n  d = x - a * 1000 - b * 100 - c * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        y = d;\n      else\n        y = d * 10 + c;\n    else\n      y = d * 100 + c * 10 + b;\n  else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d == 0)\n    if (c == 0)\n      if (b == 0)\n        if (a == 0)\n          printf(\"0\");\n        else\n          printf(\"000%d\", y);\n      else\n        printf(\"00%d\", y);\n    else {\n      printf(\"0%d\", y);\n    }\n  else\n    printf(\"%d\", y);\n}\n"}
{"label": "16", "index": "28627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - b * 100) / 10;\n  d = n - 1000 * a - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        cout << d << endl;\n      } else {\n        cout << d << c << endl;\n      }\n    } else {\n      cout << d << c << b << endl;\n    }\n  } else {\n    cout << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - b) / 10;\n  d = (a % 1000 - b - c * 10) / 100;\n  e = a / 1000;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        printf(\"%d\", b);\n      } else {\n        printf(\"%d%d\", b, c);\n      }\n    } else {\n      printf(\"%d%d%d\", b, c, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    int a, b;\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    int c, d, e;\n    c = n % 10;\n    d = (n - c) / 10 % 10;\n    e = (n - 10 * d - c) / 100;\n    printf(\"%d%d%d\", c, d, e);\n  } else {\n    int f, g, h, i;\n    f = n % 10;\n    g = (n - f) / 10 % 10;\n    h = (n - f - 10 * g) / 100 % 10;\n    i = (n - f - 10 * g - 100 * h) / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 0, n < 10)\n    printf(\"%d\\n\", n);\n  else if (n >= 10, n < 100)\n    cout << n % 10 << n / 10 << \"\\n\";\n  else if (n >= 100, n < 1000)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n >= 1000, n < 10000)\n    cout << n % 10 << n % 100 / 10 << n / 100 % 10 << n / 1000 << \"\\n\";\n  else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 1; n != 0; i++) {\n    cout << n % 10;\n    n /= 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, m;\n  m = 1;\n  char s[5];\n  scanf(\"%s\", s);\n  i = strlen(s);\n  i = i - 1;\n  while (i >= 0) {\n    cout << s[i];\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, k;\n\n  scanf(\"%d\", &x);\n  k = log10(x) + 1;\n\n  if (x == 0) {\n    cout << x;\n  } else {\n    int a, e = 1, k1;\n    k = k - 1;\n    k1 = k;\n    while (k1 > 0) {\n      e = e * 10;\n      k1 = k1 - 1;\n    }\n\n    int b = 0, s = 2, k3, e2, x2;\n    k3 = k;\n    e2 = e;\n    x2 = x;\n    while (s > 0) {\n      while (k3 >= 0) {\n        a = x2 / e2;\n        k3 = k3 - 1;\n        x2 = x2 - a * e2;\n        b = b + a * (e / e2);\n        e2 = e2 / 10;\n        if (s == 1) {\n          printf(\"%d\", a);\n        }\n      }\n      k3 = k;\n      e2 = e;\n      s = s - 1;\n      x2 = b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[5];\n  int i, k, j;\n  cin.getline(n, 5);\n  for (i = 0; n[i] != '\\0'; i++) {\n    k = i;\n  }\n  for (j = k; j >= 0; j--)\n    printf(\"%c\", n[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "28635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 1;\n  int k;\n  int sum = 0;\n  int x[10];\n  if (n == 0)\n    cout << \"0\";\n  else {\n    while (n != 0) {\n\n      x[i] = n % 10;\n      n = n / 10;\n      i++;\n    }\n    i = i - 1;\n\n    for (k = 1; k <= i; k++) {\n      printf(\"%d\", x[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28636", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char num[5];\n  cin >> num;\n  int nl = strlen(num);\n\n  int i;\n  for (i = 0; i < (int)(nl / 2); i++) {\n    char k;\n    k = num[i];\n    num[i] = num[nl - 1 - i];\n    num[nl - 1 - i] = k;\n  }\n\n  cout << num;\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid reverse(char s[], int a, int b) {\n  int i, j;\n  char temp;\n  for (i = a, j = b - 1; i < j; i++, j--) {\n    temp = s[i];\n    s[i] = s[j];\n    s[j] = temp;\n  }\n  for (i = a; i < b; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n}\n\nint main() {\n  char string[10];\n  int len;\n  scanf(\"%s \", string);\n  len = strlen(string);\n  reverse(string, 0, len);\n  return 0;\n}\n"}
{"label": "16", "index": "28638", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  cin >> a;\n  b = floor(a / 10000);\n  a = a - b * 10000;\n  c = floor(a / 1000);\n  a = a - c * 1000;\n  d = floor(a / 100);\n  a = a - d * 100;\n  e = floor(a / 10);\n  a = a - e * 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0)\n          printf(\"%d\", a);\n        else\n          printf(\"%d%d\", a, e);\n      } else\n        printf(\"%d%d%d\", a, e, d);\n    } else\n      printf(\"%d%d%d%d\", a, e, d, c);\n  } else\n    printf(\"%d%d%d%d%d\", a, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "28639", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x, y = 0;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    cout << a;\n  } else if (a == 10) {\n    b = 0;\n    c = 1;\n    printf(\"%d%d\", b, c);\n  } else if (a > 10 && a < 100) {\n    b = a / 10;\n    c = a - b * 10;\n    x = c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 100) {\n    b = 1;\n    printf(\"%d%d%d\", y, y, b);\n  } else if (a > 100 && a < 1000) {\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    x = d * 100 + c * 10 + b;\n    cout << x;\n  } else if (a == 1000) {\n    b = 1;\n    printf(\"%d%d%d%d\", y, y, y, b);\n  } else if (a > 1000 && a < 10000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    x = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 10000) {\n    b = 1;\n    printf(\"%d%d%d%d%d\", y, y, y, y, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a1, a2, a3, a4, a5, num, len;\n  a1 = a2 = a3 = a4 = a5 = 0;\n  cin >> num;\n  if (num > 9) {\n    a1 = num % 10;\n    a2 = num / 10;\n    if (a2 > 9) {\n      a3 = a2 / 10;\n      a2 = a2 % 10;\n      if (a3 > 9) {\n        a4 = a3 / 10;\n        a3 = a3 % 10;\n        if (a4 > 9) {\n          a5 = a4 / 10;\n          a4 = a4 % 10;\n          len = 5;\n        } else\n          len = 4;\n      } else\n        len = 3;\n    } else\n      len = 2;\n  } else {\n    a1 = num;\n    len = 1;\n  }\n\n  if (a5)\n\n    printf(\"%d%d%d%d%d\\n\", a1, a2, a3, a4, a5);\n\n  else if (a4)\n\n    cout << a1 << a2 << a3 << a4 << \"\\n\";\n\n  else if (a3)\n\n    printf(\"%d%d%d\\n\", a1, a2, a3);\n\n  else if (a2)\n\n    printf(\"%d%d\\n\", a1, a2);\n\n  else\n    printf(\"%d\\n\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "28641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], n, i;\n  scanf(\"%d \", &n);\n  if (n == 10000) {\n    printf(\"%d\\n\", 00001);\n  } else {\n    b[0] = n;\n    for (i = 0; i < 4; i++) {\n      a[i] = b[i] / pow(10.0, (double)(3 - i));\n      b[i + 1] = b[i] % (int)(pow(10.0, (double)(3 - i)));\n    }\n    if (a[0] != 0) {\n      cout << a[3] << a[2] << a[1] << a[0] << endl;\n    } else if (a[1] != 0) {\n      cout << a[3] << a[2] << a[1] << endl;\n    } else if (a[2] != 0)\n      cout << a[3] << a[2] << endl;\n    else {\n      cout << a[3] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n  \n  do {\n    ch[iBits++] = iNum % radix; \n    iNum /= radix;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint Myatoi(char *ch, int iBits) {\n  int iNumInverse = 0;\n  int i = 0;\n  \n  while (ch[i] == '\\0') {\n    i++;\n    printf(\"0\");\n  }\n  for (i = 0; i <= iBits; i++) {\n    iNumInverse = 10 * iNumInverse + ch[i];\n  }\n  return iNumInverse;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12]; \n  scanf(\"%d\", &iNum);\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10); \n    iNumInverse = Myatoi(ch, iBits);\n    printf(\"%d\", iNumInverse);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28643", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, num, k, a[6];\n\n  cin >> num;\n  if (num == 0)\n    cout << num;\n  for (i = 5; i >= 0; i--) {\n    a[5 - i] = num / (pow((float)10, i));\n    num = num - a[5 - i] * pow((float)10, i);\n  }\n\n  for (i = 0; i < 6; i++) {\n\n    if (a[i] != 0)\n      break;\n  }\n\n  for (k = 5; k >= i; k--) {\n\n    printf(\"%d\", a[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28644", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint b[5], m = 0;\nint f(int n) {\n  int c;\n  if (n == 0)\n    return (0);\n  else {\n    b[m] = n % 10;\n    m++;\n    c = n / 10;\n    return f(c);\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  f(n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n  }\n}\n"}
{"label": "16", "index": "28645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  cin >> a;\n  b = floor(a / 10000);\n  a = a - b * 10000;\n  c = floor(a / 1000);\n  a = a - c * 1000;\n  d = floor(a / 100);\n  a = a - d * 100;\n  e = floor(a / 10);\n  a = a - e * 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0)\n          printf(\"%d\", a);\n        else\n          cout << a << e;\n      } else\n        printf(\"%d%d%d\", a, e, d);\n    } else\n      printf(\"%d%d%d%d\", a, e, d, c);\n  } else\n    printf(\"%d%d%d%d%d\", a, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "28646", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n > 999)\n    p = 4;\n  else if (n > 99)\n    p = 3;\n  else if (n > 9)\n    p = 2;\n  else\n    p = 1;\n  x = n / 1000;\n  y = (n - x * 1000) / 100;\n  z = (n - x * 1000 - y * 100) / 10;\n  w = n - x * 1000 - y * 100 - z * 10;\n  switch (p) {\n  case 4:\n    printf(\"%d%d%d%d\", w, z, y, x);\n    break;\n  case 3:\n    printf(\"%d%d%d\", w, z, y);\n    break;\n  case 2:\n    printf(\"%d%d\", w, z);\n    break;\n  case 1:\n    printf(\"%d\", w);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    cout << \"0\";\n  else {\n    while (a != 0) {\n      b = a - a / 10 * 10;\n      a = a / 10;\n      cout << b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10] = {'\\0'};\n  cin.getline(str, 10);\n  for (int i = strlen(str) - 1; i >= 0; i--) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m;\n  char a[1][5];\n  cin.get(a[0], 5);\n  n = strlen(a[0]);\n  for (i = 0, j = n - 1; i < j; i++, j--) {\n    t = a[0][i];\n    a[0][i] = a[0][j];\n    a[0][j] = t;\n  }\n  for (m = 0; m < n; m++)\n    printf(\"%c\", a[0][m]);\n  return 0;\n}\n"}
{"label": "16", "index": "28650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10;\n  c = a / 100;\n  d = a / 1000;\n  e = a / 10000;\n  if (e >= 1)\n    f = 5;\n  else if (d >= 1)\n    f = 4;\n  else if (c >= 1)\n    f = 3;\n  else {\n    if (b >= 1)\n      f = 2;\n    else\n      f = 1;\n  }\n  d = d - 10 * e;\n  c = c - 100 * e - 10 * d;\n  b = b - 1000 * e - 100 * d - 10 * c;\n  a = a - 10000 * e - 1000 * d - 100 * c - 10 * b;\n  switch (f) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n    break;\n  case 4:\n    cout << a << b << c << d << \"\\n\";\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", a, b);\n    break;\n  case 1:\n    cout << a << \"\\n\";\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[80];\n  int i;\n\n  cin >> s;\n  for (i = strlen(s) - 1; i >= 0; i--)\n    cout << s[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "28652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5] = {0};\n  int i = 0;\n  while ((a[i] = cin.get()) != '\\n')\n    i++;\n  for (; i >= 0; i--) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10000];\n  int b, i, c;\n  cin >> a;\n  b = strlen(a);\n  i = 0;\n  if (b % 2 == 0) {\n    while (i <= (b / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  } else {\n    while (i <= ((b - 1) / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "28654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"%d\", a);\n  for (i = 0; i < 5; i++) {\n    if (a != 0)\n      cout << a % 10;\n    a = a / 10;\n  }\n  cout << \" \";\n  return (0);\n}\n"}
{"label": "16", "index": "28655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100001];\n  cin >> a;\n  int l = strlen(a), i = 0;\n  for (i = l - 1; i >= 0; i--) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28656", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, s;\n  cin >> n;\n  if (n == 0)\n    cout << \"0\";\n  else {\n    for (int i = 10; i <= 100000; i *= 10) {\n      t = n % i;\n      s = t * 10 / i;\n      if (s <= 9 && n != 0) {\n        cout << s;\n        n -= t;\n      } else\n        break;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, w, c;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  else if (n > 999)\n    w = 4;\n  else if (n > 99)\n    w = 3;\n  else if (n > 9)\n    w = 2;\n  else\n    cout << n;\n\n  for (i = 1; i < w + 1; i++) {\n    c = n % 10;\n    n = n / 10;\n\n    printf(\"%d\", c);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28658", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char a[6];\n  cin >> a;\n  n = strlen(a);\n  for (i = n - 1; i >= 0; i--) {\n    printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28659", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, b;\n  cin >> a;\n  a1 = a / 1000;\n  b = a - a1 * 1000;\n  a2 = b / 100;\n  b = b - a2 * 100;\n  a3 = b / 10;\n  a4 = b - a3 * 10;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000;\n  if (a > 999) {\n    if (b > 999)\n      printf(\"%d\\n\", b);\n    else if (b > 99)\n      printf(\"0%d\\n\", b);\n    else if (b > 9)\n      printf(\"00%d\\n\", b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (a > 99) {\n    b = b / 10;\n    if (b > 99)\n      printf(\"%d\\n\", b);\n    else if (b > 9)\n      printf(\"0%d\\n\", b);\n    else\n      printf(\"00%d\\n\", b);\n  } else if (a > 9) {\n    b = b / 100;\n    if (b > 9)\n      printf(\"%d\\n\", b);\n    else\n      printf(\"0%d\\n\", b);\n  } else {\n    b = b / 1000;\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28660", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d \", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n % 10;\n  if (a > 0)\n    printf(\"00001\");\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else {\n    if (c > 0)\n      printf(\"%d%d%d\", e, d, c);\n    else if (d > 0)\n      printf(\"%d%d\", e, d);\n    else\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long int n;\n  int indiv, ten, hundred, thousand, place;\n  scanf(\"%ld\", &n);\n  if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  thousand = n / 1000;\n  hundred = (int)(n - thousand * 1000) / 100;\n  ten = (int)(n - thousand * 1000 - hundred * 100) / 10;\n  indiv = (int)(n - thousand * 1000 - hundred * 100 - ten * 10);\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\", indiv);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t[5] = {1, 10, 100, 1000, 10000};\n  int x[6];\n\n  int num;\n  scanf(\"%d \", &num);\n\n  int length;\n  length = (num >= t[4]) + (num >= t[3]) + (num >= t[2]) + (num >= t[1]) +\n           (num >= t[0]);\n  for (int i = 1; i <= length; i++)\n    x[i] = (num % t[i]) / t[i - 1];\n\n  if (length == 0)\n    cout << \"0\";\n  else {\n    for (int j = 1; j <= length; j++) {\n      cout << x[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, i;\n  scanf(\"%d\", &a);\n  i = 1 + log10(a);\n  b = a / 10000;\n  a = a % 10000;\n  c = a / 1000;\n  a = a % 1000;\n  d = a / 100;\n  a = a % 100;\n  e = a / 10;\n  a = a % 10;\n  f = a;\n  printf(\"%d\", f);\n  if (i > 1)\n    printf(\"%d\", e);\n  if (i > 2)\n    printf(\"%d\", d);\n  if (i > 3)\n    printf(\"%d\", c);\n  if (i > 4)\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "28664", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  cin >> t;\n  a = t / 10000;\n  b = t / 1000 - 10 * a;\n  c = t / 100 - 100 * a - 10 * b;\n  d = t / 10 - 1000 * a - 100 * b - 10 * c;\n  e = t % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a;\n  a = getchar();\n  if (a <= 57 && a >= 48) {\n    char b;\n    b = getchar();\n    if (b <= 57 && b >= 48) {\n      char c;\n      c = getchar();\n      if (c <= 57 && c >= 48) {\n        char d;\n        d = getchar();\n        if (d <= 57 && d >= 48) {\n          char e;\n          e = getchar();\n          if (e <= 57 && e >= 48)\n            printf(\"%c%c%c%c%c\", e, d, c, b, a);\n          else\n            printf(\"%c%c%c%c\", d, c, b, a);\n        } else\n          printf(\"%c%c%c\", c, b, a);\n      } else\n        printf(\"%c%c\", b, a);\n    } else\n      printf(\"%c\", a);\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  int l;\n\n  scanf(\"%s \", a);\n\n  l = strlen(a);\n\n  for (int i = 0; i < l; i++) {\n    b[i] = a[l - i - 1];\n    cout << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, g, s, b, q, o = 0, p = 1;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\\n\", o, o, o, o, p);\n  {\n    if (a <= 10)\n      printf(\"%d\\n\", a);\n    else if (a < 100) {\n      s = (a % 100) / 10;\n      g = a % 10;\n      cout << g << s << \"\\n\";\n    } else if (a < 1000) {\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d\\n\", g, s, b);\n    } else if (a < 10000) {\n      q = (a % 10000) / 1000;\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d%d\\n\", g, s, b, q);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28668", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, f, a, m;\n\n  cin >> n;\n  for (i = 5; i >= 1; i--) {\n    f = pow(10, i);\n    a = n / f;\n    if (a != 0)\n      break;\n  }\n  for (j = 1; j <= i + 1; j++) {\n    m = n % 10;\n\n    printf(\"%d\", m);\n    n = (n - m) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[50];\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 3; i >= 0; i--) {\n    if (n / ((int)(pow(10.0, i)))) {\n      for (int j = i; j >= 0; j--) {\n        a[j] = (int)n / (int)(pow(10.0, j));\n        n = n - a[j] * pow(10.0, j);\n      }\n      for (int k = 0; k <= i; k++)\n        printf(\"%d\", a[k]);\n\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n / 10000 != 0)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    cout << d << c << b << a;\n  } else if (n / 100 != 0) {\n    int e, f, g;\n    e = n / 100;\n    f = (n - 100 * e) / 10;\n    g = n % 10;\n    printf(\"%d%d%d\", g, f, e);\n  } else if (n / 10 != 0) {\n    int p, q;\n    p = n / 10;\n    q = n % 10;\n    printf(\"%d%d\", q, p);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  b = n;\n  c = n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    int length = 1, k = 10;\n    while ((c / k) != 0) {\n      length++;\n      k = k * 10;\n    }\n    for (int i = 1; i <= length; i++) {\n      cout << b % 10;\n      b = (b - b % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a > 9999) {\n\n    b = a / 10000;\n    c = (a / 1000) - 10 * b;\n    d = (a / 100) - 100 * b - 10 * c;\n    e = (a / 10) - 1000 * b - 100 * c - 10 * d;\n    f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    cout << f << e << d << c;\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28673", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  scanf(\"%d \", &t);\n  a = t / 10000;\n  b = t / 1000 - 10 * a;\n  c = t / 100 - 100 * a - 10 * b;\n  d = t / 10 - 1000 * a - 100 * b - 10 * c;\n  e = t % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  char x[6];\n\n  cin >> x;\n  int i;\n\n  for (i = 5; i >= 0; i--)\n    if (x[i] == '0' || x[i] == '1' || x[i] == '2' || x[i] == '3' ||\n        x[i] == '4' || x[i] == '5' || x[i] == '6' || x[i] == '7' ||\n        x[i] == '8' || x[i] == '9')\n      break;\n\n  for (int j = i; j >= 0; j--)\n    printf(\"%c\", x[j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28675", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i;\n  char s[20];\n  printf(\"\\n\");\n  scanf(\"%d \", &i);\n  sprintf(s, \"%d\", i);\n  for (i = strlen(s) - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n\n  puts(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100)\n    printf(\"%d%d\", a % 10, (a - a % 10) / 10);\n  else if (a < 1000)\n    printf(\"%d%d%d\", a % 10, (a % 100 - a % 10) / 10, (a - a % 100) / 100);\n  else if (a < 10000)\n    printf(\"%d%d%d%d\", a % 10, (a % 100 - a % 10) / 10,\n           (a % 1000 - a % 100) / 100, (a - a % 1000) / 1000);\n  else\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "28677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5];\n\n  cin >> a;\n  int i;\n  for (i = strlen(a); i > 0; i--)\n    cout << a[i - 1];\n  return 0;\n}\n"}
{"label": "16", "index": "28678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    n = 00001;\n  } else {\n    if (n >= 1000) {\n      a = n % 10;\n      b = (n - a) % 100 / 10;\n      d = n / 1000;\n      c = n / 100 - d * 10;\n      printf(\"%d\", a);\n      printf(\"%d\", b);\n      printf(\"%d\", c);\n      printf(\"%d\", d);\n    } else {\n      if (n >= 100) {\n        a = n % 10;\n        b = (n - a) % 100 / 10;\n        c = n / 100;\n        printf(\"%d\", a);\n        printf(\"%d\", b);\n        cout << c;\n      } else {\n        if (n >= 10) {\n          a = n % 10;\n          b = n / 10;\n          printf(\"%d\", a);\n          printf(\"%d\", b);\n        } else {\n          printf(\"%d\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28679", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  char s[20];\n  int l, i;\n  cin >> s;\n  l = strlen(s);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int a, c, d;\n  scanf(\"%d\", &a);\n  c = a;\n  while (c >= 1) {\n    d = c - (c / 10) * 10;\n    c = c / 10;\n    printf(\"%d\", d);\n  }\n  if (a == 0)\n    cout << \"0\";\n  return 0;\n}\n"}
{"label": "16", "index": "28681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e, p;\n  scanf(\"%d\", &num);\n  if (num >= 10000)\n    p = 5;\n  else if (num >= 1000)\n    p = 4;\n  else if (num >= 100)\n    p = 3;\n  else if (num >= 10)\n    p = 2;\n  else\n    p = 1;\n  a = (int)(num / 10000);\n  b = (int)(num % 10000 / 1000);\n  c = (int)(num % 1000 / 100);\n  d = (int)(num % 100 / 10);\n  e = (int)(num % 10);\n  switch (p) {\n  case 5:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n\n  case 4:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 2:\n    cout << e << d;\n    break;\n  case 1:\n    printf(\"%d\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  if (x > 9999) {\n    e = x / 10000;\n    d = x % 10000 / 1000;\n    c = x % 10000 % 1000 / 100;\n    b = x % 10000 % 1000 % 100 / 10;\n    a = x % 10000 % 1000 % 100 % 10;\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n  } else if (x > 999) {\n    d = x / 1000;\n    c = x % 1000 / 100;\n    b = x % 1000 % 100 / 10;\n    a = x % 1000 % 100 % 10;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  } else if (x > 99) {\n    c = x / 100;\n    b = x % 100 / 10;\n    a = x % 100 % 10;\n    printf(\"%d%d%d\\n\", a, b, c);\n  } else if (x > 9) {\n    b = x / 10;\n    a = x % 10;\n    printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", x);\n}\n"}
{"label": "16", "index": "28683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    cout << a << b;\n  } else if (n < 1000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    cout << a << c << d;\n  } else if (n < 10000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    e = d % 10;\n    f = d / 10;\n    cout << a << c << e << f;\n  } else {\n    if (n == 10000)\n      printf(\"%d\", 00001);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28684", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  do {\n    printf(\"%d\", (n % 10));\n    n /= 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "28685", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int mod;\n\n  if (n == 0) {\n    cout << 0 << endl;\n  } else {\n\n    while (n != 0) {\n      mod = n % 10;\n      cout << mod;\n      n /= 10;\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int tmp;\n  cin >> n;\n  while (1) {\n    tmp = n % 10;\n    printf(\"%d\", tmp);\n    if (!(n = n / 10))\n      break;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i, j;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%c \", &a[i]);\n    if (a[i] == '\\n') {\n      for (j = i; j < 5; j++)\n        a[j] = '\\0';\n\n      break;\n    }\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "28688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0)\n    printf(\"%d%d\", a % 10, a / 10);\n  else if (a / 1000 == 0)\n    printf(\"%d%d%d\", a % 10, a % 100 / 10, a / 100);\n  else\n    printf(\"%d%d%d%d\", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "28689", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n / 10000 != 0)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    int e, f, g;\n    e = n / 100;\n    f = (n - 100 * e) / 10;\n    g = n % 10;\n    printf(\"%d%d%d\", g, f, e);\n  } else if (n / 10 != 0) {\n    int p, q;\n    p = n / 10;\n    q = n % 10;\n    printf(\"%d%d\", q, p);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (x > 9999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x > 999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x > 99)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x > 9)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, k, out;\n  int A[5];\n  scanf(\"%d\", &n);\n  for (i = 1; 1 <= 5; i++) {\n    if (n < 1)\n      break;\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  float n;\n  cin >> n;\n  a = floor(n / 1000);\n  b = floor((n - a * 1000) / 100);\n  c = floor((n - a * 1000 - b * 100) / 10);\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (n / 1000 >= 1) {\n    cout << d << c << b << a << endl;\n  }\n  if (n / 1000 < 1 && n / 100 >= 1) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  }\n  if (n / 100 < 1 && n / 10 >= 1) {\n    cout << d << c << endl;\n  }\n  if (n / 10 < 1) {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int num;\n  cin >> num;\n  if (num == 10000) {\n    cout << \"00001\";\n  } else if (num < 10000 && num > 999) {\n    d = num / 1000;\n    c = num / 100 - d * 10;\n    b = num / 10 - d * 100 - c * 10;\n    a = num % 10;\n    cout << a << b << c << d;\n  } else if (num < 1000 && num > 99) {\n    c = num / 100;\n    b = num / 10 - c * 10;\n    a = num % 10;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (num < 100 && num > 9) {\n    b = num / 10;\n    a = num - b * 10;\n    printf(\"%d%d\", a, b);\n  } else {\n    cout << num;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, a5, b;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = a / 1000 - a1 * 10;\n  a3 = a / 100 - a2 * 10 - a1 * 100;\n  a4 = a / 10 - a3 * 10 - a2 * 100 - a1 * 1000;\n  a5 = a - a4 * 10 - a3 * 100 - a2 * 1000 - a1 * 10000;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000 + a5 * 10000;\n  if (a1 == 0) {\n    if (a2 == 0) {\n      if (a3 == 0) {\n        if (a4 == 0)\n          printf(\"%01d\", b / 10000);\n        else\n          printf(\"%02d\", b / 1000);\n      } else\n        printf(\"%03d\", b / 100);\n    } else\n      printf(\"%04d\", b / 10);\n  } else\n    printf(\"%05d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "28695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[5], b[5];\n  int n, i, m;\n  scanf(\"%d \", &n);\n  b[0] = n;\n  for (i = 0; i < 5; i = i + 1) {\n    a[i] = b[i] % 10;\n    b[i + 1] = b[i] / 10;\n    printf(\"%d\", a[i]);\n    if (b[i + 1] == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28696", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[10];\n  int n = 0;\n  while (scanf(\"%c \", &ch[n]))\n    n++;\n\n  for (int i = n - 1; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int num, temp = 0, sub = 0, dv = 10;\n  ;\n  scanf(\"%d\", &num);\n  int a, b = 1;\n\n  if (num == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (num != sub) {\n    temp = (num - (num / dv) * dv - sub) / (dv / 10);\n    sub += temp * (dv / 10);\n\n    printf(\"%d\", temp);\n    dv *= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28698", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 0; n; i++) {\n    printf(\"%d\", n % 10);\n    n /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28699", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, p;\n  int i = 1;\n  cin >> n;\n  if (n < 10)\n    p = 1;\n  else if (n < 100)\n    p = 2;\n  else if (n < 1000)\n    p = 3;\n  else if (n < 10000)\n    p = 4;\n  do {\n    m = n % 10;\n    printf(\"%d\", m);\n    n = n / 10;\n    i++;\n  } while (i <= p);\n  return 0;\n}\n"}
{"label": "16", "index": "28700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int sv[4];\n  cin >> n;\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else if (n / 1000 != 0 && n != 10000 && n >= 1000) {\n    for (i = 0; i < 4; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 4; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 100 != 0 && n >= 100) {\n    for (i = 0; i < 3; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 3; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 10 != 0 && n >= 10) {\n    for (i = 0; i < 2; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 2; i++) {\n      cout << sv[i];\n    }\n    printf(\"\\n\");\n  } else\n    cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint power(int x) {\n  int k, y = 1;\n  for (k = 1; k <= x; k++)\n    y = y * 10;\n  return y;\n}\n\nint main() {\n  int n, i, j, a[6], temp;\n  cin >> n;\n  for (i = 1; i <= 5; i++)\n    if (n % power(i) == n) {\n      j = i;\n      break;\n    }\n  i = 0;\n  for (i = 0; i < j; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28702", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 10 * b - 100 * a;\n  d = n - 10 * c - 100 * b - 1000 * a;\n  if (a == 0 && b == 0 && c == 0) {\n    printf(\"%d\", d);\n  }\n  if (a == 0 && b == 0 && c != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  }\n  if (a == 0 && b != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  }\n  if (a != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28703", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, b, c, s, p;\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    if (n >= 10 && n <= 99) {\n      m = n / 10;\n      a = n - m * 10;\n      printf(\"%d%d\", a, m);\n    } else {\n      if (n >= 100 && n <= 999) {\n        s = n / 100;\n        m = (n - s * 100) / 10;\n        b = n - s * 100 - m * 10;\n        printf(\"%d%d%d\", b, m, s);\n      } else if (n >= 1000 && n <= 9999) {\n        m = n / 10;\n\n        p = n / 1000;\n        s = (n - p * 1000) / 100;\n        b = (n - s * 100 - p * 1000) / 10;\n        c = n - p * 1000 - s * 100 - 10 * b;\n\n        printf(\"%d%d%d%d\", c, b, s, p);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, q1, q2, q3, q4, q5, r1, r2, r3, r4, r5;\n  scanf(\"%d\", &n);\n  q1 = n / 10;\n  r1 = n % 10;\n\n  if (q1 == 0)\n    printf(\"%d\\n\", r1);\n  else {\n    q2 = q1 / 10;\n    r2 = q1 % 10;\n\n    if (q2 == 0)\n      cout << r1 << r2 << \"\\n\";\n    else {\n      q3 = q2 / 10;\n      r3 = q2 % 10;\n\n      if (q3 == 0)\n        printf(\"%d%d%d\\n\", r1, r2, r3);\n      else {\n        q4 = q3 / 10;\n        r4 = q3 % 10;\n\n        if (q4 == 0)\n          printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n        else {\n          q5 = q4 / 10;\n          r5 = q4 % 10;\n          printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a >= 10000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a % 10000 - 10 * c - b - 100 * d;\n    e = e / 1000;\n    f = a - 10 * c - b - 100 * d - 1000 * e;\n    cout << b << c << d << e << f;\n  } else if (a >= 1000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a - 10 * c - b - 100 * d;\n    e = e / 1000;\n\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 100) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a - 10 * c - b;\n    d = d / 100;\n\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 10) {\n    b = a % 10;\n    c = a % 100 - b;\n\n    c = c / 10;\n    d = d / 100;\n    e = e / 100;\n    f = f / 10000;\n\n    printf(\"%d%d\", b, c);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "28706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a > 9999) {\n\n    b = a / 10000;\n    c = (a / 1000) - 10 * b;\n    d = (a / 100) - 100 * b - 10 * c;\n    e = (a / 10) - 1000 * b - 100 * c - 10 * d;\n    f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    cout << f << e;\n  } else {\n\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    cout << \"0\";\n  else {\n    while (x != 0) {\n      a = x % 10;\n      x = x / 10;\n      cout << a;\n    }\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "16", "index": "28708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, k, a, b, c, d;\n  scanf(\"%d\", &s);\n  a = (s - s % 1000) / 1000;\n  b = (s % 1000 - s % 100) / 100;\n  c = (s % 100 - s % 10) / 10;\n  d = s % 10;\n  k = d * 1000 + c * 100 + b * 10 + a;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        cout << d << c;\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  int r1, r2, r3, r4;\n  if (a > 9999)\n    b = 5;\n  else if (a > 999)\n    b = 4;\n  else if (a > 99)\n    b = 3;\n  else if (a > 9)\n    b = 2;\n  else\n    b = 1;\n  switch (b) {\n  case 1:\n    printf(\"%d\", a);\n    break;\n  case 5:\n    printf(\"00001\");\n    break;\n  case 2:\n    r3 = a / 10;\n    r4 = a - r3 * 10;\n    printf(\"%d%d\", r4, r3);\n    break;\n  case 3:\n    r2 = a / 100;\n    r3 = (a - r2 * 100) / 10;\n    r4 = a - r2 * 100 - r3 * 10;\n    cout << r4 << r3 << r2;\n    break;\n  case 4:\n    r1 = a / 1000;\n    r2 = (a - r1 * 1000) / 100;\n    r3 = (a - r1 * 1000 - r2 * 100) / 10;\n    r4 = (a - r1 * 1000 - r2 * 100 - r3 * 10);\n    printf(\"%d%d%d%d\", r4, r3, r2, r1);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d\", &n);\n  x = n;\n  a = n / 10000;\n  n = n % 10000;\n  b = n / 1000;\n  n = n % 1000;\n  c = n / 100;\n  n = n % 100;\n  d = n / 10;\n  n = n % 10;\n  if (x < 10)\n    printf(\"%d\\n\", n);\n  else {\n    if (x < 100)\n      printf(\"%d%d\\n\", n, d);\n    else {\n      if (x < 1000)\n        printf(\"%d%d%d\\n\", n, d, c);\n      else {\n        if (x < 10000)\n          printf(\"%d%d%d%d\\n\", n, d, c, b);\n        else\n          printf(\"%d%d%d%d%d\\n\", n, d, c, b, a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[5];\n  scanf(\"%d\", &n);\n  i = 1;\n  if (n == 0)\n    cout << \"0\";\n  while (n > 0) {\n    a[i] = n % 10;\n    n = n / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "28712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  n = n - 10000 * a;\n  b = n / 1000;\n  n = n - 1000 * b;\n  c = n / 100;\n  n = n - 100 * c;\n  d = n / 10;\n  e = n - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a;\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x > 9999)\n    n = 5;\n  else {\n    if (x > 999)\n      n = 4;\n    else {\n      if (x > 99)\n        n = 3;\n      else {\n        if (x > 9)\n          n = 2;\n        else\n          n = 1;\n      }\n    }\n  }\n  switch (n) {\n  case 5:\n    a = x / 10000;\n    b = (x - a * 10000) / 1000;\n    c = (x - a * 10000 - b * 1000) / 100;\n    d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n    e = (x - a * 10000 - b * 1000 - c * 100 - d * 10);\n    cout << e << d << c << b << a << \" \";\n    break;\n  case 4:\n    b = x / 1000;\n    c = (x - b * 1000) / 100;\n    d = (x - b * 1000 - c * 100) / 10;\n    e = (x - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d \", e, d, c, b);\n    break;\n  case 3:\n    c = x / 100;\n    d = (x - c * 100) / 10;\n    e = (x - c * 100 - d * 10);\n    printf(\"%d%d%d \", e, d, c);\n    break;\n  case 2:\n    d = x / 10;\n    e = (x - d * 10);\n    printf(\"%d%d \", e, d);\n    break;\n  case 1:\n    printf(\"%d \", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  for (; a != 0; a = (a - (a % 10)) / 10) {\n    b = (a % 10);\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, g;\n  cin >> i;\n  if ((i >= 10) && (i < 100)) {\n    a = i / 1000;\n    b = i % 10;\n    g = 10 * b + a;\n    printf(\"%d\", b);\n    cout << a;\n  }\n  if ((i > 0) && (i < 10)) {\n    g = i;\n    printf(\"%d\", i);\n  }\n  if ((i >= 100) && (i < 1000)) {\n    a = i / 100;\n    b = (i / 10) % 10;\n    c = i % 10;\n    g = 100 * c + 10 * b + a;\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i >= 1000) && (i < 10000)) {\n\n    a = i / 1000;\n    b = (i / 100) % 10;\n    c = (i / 10) % 10;\n    d = i % 10;\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f;\n  scanf(\"%ld\", &a);\n  f = a % 10;\n  a = (int)(a / 10);\n  e = a % 10;\n  a = (int)(a / 10);\n  d = a % 10;\n  a = (int)(a / 10);\n  c = a % 10;\n  a = (int)(a / 10);\n  b = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\\n\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\\n\", f, e);\n  else\n    printf(\"%d\\n\", f, f);\n}\n"}
{"label": "16", "index": "28717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (n < 10)\n    cout << d;\n  else if (n < 100)\n    printf(\"%d%d\", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d\", d, c, b);\n  else {\n    if (n < 10000)\n      printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28718", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n / 10000 == 1)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    d = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (n / 100 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (n / 10 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28719", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, m;\n  int a[6] = {0, 0, 0, 0, 0, 0};\n  cin >> n;\n  if (n >= 10) {\n    do {\n      a[i] = n % 10;\n      n = n / 10;\n      i = i + 1;\n    } while (n >= 10);\n    m = i - 1;\n    for (i = 1; i <= m; i++)\n      printf(\"%d\", a[i]);\n    cout << n;\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x == 0)\n    printf(\"0\");\n  n = (int)log10((double)x);\n  a = x / 10000;\n  x = x - a * 10000;\n  b = x / 1000;\n  x = x - b * 1000;\n  c = x / 100;\n  x = x - c * 100;\n  d = x / 10;\n  e = x - d * 10;\n\n  switch (n) {\n  case 0:\n    printf(\"%d\", e);\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    cout << e << d << c << b;\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  cin >> x;\n  if (x == 0)\n    printf(\"0\");\n  n = (int)log10((double)x);\n  a = x / 10000;\n  x = x - a * 10000;\n  b = x / 1000;\n  x = x - b * 1000;\n  c = x / 100;\n  x = x - c * 100;\n  d = x / 10;\n  e = x - d * 10;\n\n  switch (n) {\n  case 0:\n    cout << e;\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  if (a != 0) {\n    b = n / 100 - 10 * a;\n    c = n / 10 - 100 * a - 10 * b;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    c = n / 10 - b * 10;\n    d = n - 100 * b - 10 * c;\n    cout << d << c << b << endl;\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - c * 10;\n    cout << d << c << endl;\n  } else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, x, a, b, c, d, e, x1, x2, x3, x4, x5;\n  k = 0;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = (x % 10) / 1;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (x / i != 0)\n      k = k + 1;\n  };\n  if (k == 5) {\n    x5 = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    cout << e << d << c << b << a;\n  } else if (k == 4) {\n    x4 = 1000 * e + 100 * d + 10 * c + b;\n    cout << e << d << c << b;\n  } else if (k == 3) {\n    x3 = 100 * e + 10 * d + c;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (k == 2) {\n    x2 = 10 * e + d;\n    printf(\"%d%d\", e, d);\n  } else if (k == 1) {\n    x1 = e;\n    printf(\"%d\", e);\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else if (n == 10)\n    printf(\"1\");\n  else {\n    do {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = (n - a) / 10;\n    } while (n >= 10);\n    a = n;\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28725", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum = 0, i, t;\n  char str[5] = {0}, str2[5] = {0};\n  cin >> str;\n  for (i = 0; str[i] != '\\0'; i++)\n    sum = sum + 1;\n  for (i = sum - 1; i >= 0; i--) {\n    t = sum - i - 1;\n    str2[t] = str[i];\n  }\n  printf(\"%s\", str2);\n}\n"}
{"label": "16", "index": "28726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - b) / 10;\n  d = (a % 1000 - b - c * 10) / 100;\n  e = a / 1000;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        cout << b;\n      } else {\n        cout << b << c;\n      }\n    } else {\n      printf(\"%d%d%d\", b, c, d);\n    }\n  } else {\n    cout << b << c << d << e;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28727", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c, i = 0;\n  char num[7] = {0};\n  while ((c = cin.get()) != '\\n') {\n    num[i++] = c;\n  }\n  for (i = i - 1; i >= 0; i--)\n    cout << num[i];\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = (n % 100 - n % 10) / 10;\n  c = (n % 1000 - n % 100) / 100;\n  d = (n % 10000 - n % 1000) / 1000;\n  e = (n - 1000 * d - 100 * c - 10 * b - a) / 10000;\n  if (e != 0) {\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  } else if (d != 0) {\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (c != 0) {\n    printf(\"%d%d%d\", a, b, c);\n  } else if (d != 0)\n    printf(\"%d%d\", a, b);\n  else {\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "28729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, b;\n  scanf(\"%d\", &a);\n  a1 = a / 1000;\n  b = a - a1 * 1000;\n  a2 = b / 100;\n  b = b - a2 * 100;\n  a3 = b / 10;\n  a4 = b - a3 * 10;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000;\n  if (a > 999) {\n    if (b > 999)\n      printf(\"%d\\n\", b);\n    else if (b > 99)\n      cout << \"0\" << b << \"\\n\";\n    else if (b > 9)\n      printf(\"00%d\\n\", b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (a > 99) {\n    b = b / 10;\n    if (b > 99)\n      printf(\"%d\\n\", b);\n    else if (b > 9)\n      printf(\"0%d\\n\", b);\n    else\n      printf(\"00%d\\n\", b);\n  } else if (a > 9) {\n    b = b / 100;\n    if (b > 9)\n      printf(\"%d\\n\", b);\n    else\n      printf(\"0%d\\n\", b);\n  } else {\n    b = b / 1000;\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28730", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, count = 0;\n  char a[20000];\n  while ((a[count] = getchar()) != '\\n')\n    count++;\n\n  for (i = count - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "28731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5], i = 0, j;\n  scanf(\"%d\", &n);\n  if (n >= 10) {\n    while (n >= 10) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      i++;\n    }\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%d\", a[j]);\n  } else\n    ;\n  printf(\"%d\", n);\n}\n"}
{"label": "16", "index": "28732", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, i;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n / 10) % 10;\n  d = n % 10;\n  if (a)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (c)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "28733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  if (a != 0) {\n    b = n / 100 - 10 * a;\n    c = n / 10 - 100 * a - 10 * b;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    c = n / 10 - b * 10;\n    d = n - 100 * b - 10 * c;\n    cout << d << c << b << endl;\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - c * 10;\n    cout << d << c << endl;\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, i;\n  cin >> i;\n  if (i / 10 == 0) {\n    cout << i << endl;\n  }\n  if (i / 100 == 0 && i / 10 != 0) {\n    a = i / 10;\n    b = i - a * 10;\n    cout << b << a << endl;\n  }\n  if (i / 1000 == 0 && i / 100 != 0) {\n    a = i / 100;\n    b = (i - a * 100) / 10;\n    c = i - a * 100 - b * 10;\n    cout << c << b << a << endl;\n  }\n  if (i / 10000 == 0 && i / 1000 != 0) {\n    a = i / 1000;\n    b = (i - a * 1000) / 100;\n    c = (i - a * 1000 - b * 100) / 10;\n    d = i - a * 1000 - b * 100 - c * 10;\n    cout << d << c << b << a << endl;\n  }\n  if (i / 10000 != 0) {\n    a = i / 10000;\n    b = (i - a * 10000) / 1000;\n    c = (i - a * 10000 - b * 1000) / 100;\n    d = (i - a * 10000 - b * 1000 - c * 100) / 10;\n    e = i - a * 10000 - b * 1000 - c * 100 - d * 10;\n    cout << e << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint invert(long m) {\n  cout << m % 10;\n  m = m / 10;\n  if (m > 0)\n    invert(m);\n}\nint main() {\n  long n;\n  scanf(\"%ld\", &n);\n  invert(n);\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "16", "index": "28736", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z, a, b, c, d, e;\n  cin >> z;\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      printf(\"%d%d%d%d\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "28737", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  cin >> x;\n  a = x / 1000;\n  b = (x - a * 1000) / 100;\n  c = (x - a * 1000 - b * 100) / 10;\n  d = x - a * 1000 - b * 100 - c * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        y = d;\n      else\n        y = d * 10 + c;\n    else\n      y = d * 100 + c * 10 + b;\n  else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d == 0)\n    if (c == 0)\n      if (b == 0)\n        if (a == 0)\n          printf(\"0\");\n        else\n          printf(\"000%d\", y);\n      else\n        printf(\"00%d\", y);\n    else\n      printf(\"0%d\", y);\n  else\n    printf(\"%d\", y);\n}\n"}
{"label": "16", "index": "28738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if ((n >= 1) && (n <= 9))\n    cout << n << endl;\n  if ((n >= 10) && (n < 100)) {\n    int a = n / 10;\n    int b = n % 10;\n    cout << b << a << endl;\n  }\n  if ((n >= 100) && (n <= 999)) {\n    int a = n / 100;\n    int b = (n % 100) / 10;\n    int c = (n % 100) % 10;\n    cout << c << b << a << endl;\n  }\n  if ((n >= 1000) && (n < 9999)) {\n    int a = n / 1000;\n    int b = (n % 1000) / 100;\n    int c = ((n % 1000) % 100) / 10;\n    int d = ((n % 1000) % 100) % 10;\n    cout << d << c << b << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  while (scanf(\"%d\", &N) != EOF)\n    if (N) {\n      i = t = n = 0;\n      while (N % (1 * e(i)) != N) {\n        a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n        i++;\n      }\n      while (t <= i - 1) {\n        printf(\"%d\", a[t]);\n        t++;\n      }\n      printf(\"\\n\");\n    } else\n      printf(\"0\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k, sum = 1, A[5];\n  scanf(\"%d \", &n);\n  k = n;\n  while (k >= 10) {\n    k = k / 10;\n    sum = sum + 1;\n  }\n  for (i = 0; i < sum; i++) {\n    A[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < sum; i++)\n    printf(\"%d\", A[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, s;\n  cin >> n;\n  i = n;\n  s = 0;\n  while (i > 0) {\n    k = i % 10;\n    if (k == 0)\n      cout << \"0\", i /= 10;\n    else {\n      i = i / 10;\n      s = s * 10 + k;\n    }\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "28742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, n1, n2;\n  cin >> n;\n  a = n / 1000;\n  n1 = n - 1000 * a;\n  b = n1 / 100;\n  n2 = n1 - 100 * b;\n  c = n2 / 10;\n  d = n2 - 10 * c;\n  if (a == 10)\n    cout << \"00001\" << endl;\n  else if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (b != 0)\n    cout << d << c << b << endl;\n  else if (c != 0)\n    cout << d << c << endl;\n  else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28743", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, a3, a4;\n  cin >> n;\n  if (n >= 1000) {\n    a4 = n / 1000;\n    a3 = (n - a4 * 1000) / 100;\n    a2 = (n - a4 * 1000 - a3 * 100) / 10;\n    a1 = n - a4 * 1000 - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d%d\", a1, a2, a3, a4);\n  }\n  if (n >= 100 && n < 1000) {\n    a3 = n / 100;\n    a2 = (n - a3 * 100) / 10;\n    a1 = n - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d\", a1, a2, a3);\n  }\n  if (n >= 10 && n < 100) {\n    a2 = n / 10;\n    a1 = n - a2 * 10;\n    printf(\"%d%d\", a1, a2);\n  }\n  if (n < 10) {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28744", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  int num[5];\n  a = 100000;\n  for (i = 0; i <= 4; i++) {\n    a = a / 10;\n    num[i] = (n / a) % 10;\n  }\n  if (num[0] != 0) {\n    printf(\"%d%d%d%d%d\", num[4], num[3], num[2], num[1], num[0]);\n  } else if (num[1] != 0) {\n    printf(\"%d%d%d%d\", num[4], num[3], num[2], num[1]);\n  } else {\n    if (num[2] != 0) {\n      printf(\"%d%d%d\", num[4], num[3], num[2]);\n    } else if (num[3] != 0) {\n      printf(\"%d%d\", num[4], num[3]);\n    } else\n      printf(\"%d\", num[4]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28745", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n / 10000;\n  a[1] = n / 1000 - 10 * a[0];\n  a[2] = n / 100 - 100 * a[0] - 10 * a[1];\n  a[4] = n % 10;\n  a[3] = (n % 100 - n % 10) / 10;\n  cout << \"\\n\";\n  if (n != 0) {\n    for (int i = 0; i < 5; i++)\n      if (a[i] == 0)\n        continue;\n      else {\n        for (int j = 4; j >= i; j--)\n          printf(\"%d\", a[j]);\n        break;\n      }\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, a, b, c, d, e;\n  char ch;\n  a = b = c = d = e = -1;\n  while ((ch = cin.get()) != '\\n') {\n    switch (i) {\n    case 1:\n      a = ch - '0';\n      break;\n    case 2:\n      b = ch - '0';\n      break;\n    case 3:\n      c = ch - '0';\n      break;\n    case 4:\n      d = ch - '0';\n      break;\n    case 5:\n      e = ch - '0';\n      break;\n    }\n    i++;\n  }\n  if (e == -1 && d != -1)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (e == -1 && d == -1 && c != -1)\n    cout << c << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b != -1)\n    cout << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b == -1 && a != -1)\n    cout << a << endl;\n  else\n    cout << e << d << c << b << a << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "16", "index": "28747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    n = 00001;\n  } else {\n    if (n >= 1000) {\n      a = n % 10;\n      b = (n - a) % 100 / 10;\n      d = n / 1000;\n      c = n / 100 - d * 10;\n      printf(\"%d\", a);\n      printf(\"%d\", b);\n      printf(\"%d\", c);\n      printf(\"%d\", d);\n    } else {\n      if (n >= 100) {\n        a = n % 10;\n        b = (n - a) % 100 / 10;\n        c = n / 100;\n        printf(\"%d\", a);\n        printf(\"%d\", b);\n        printf(\"%d\", c);\n      } else {\n        if (n >= 10) {\n          a = n % 10;\n          b = n / 10;\n          printf(\"%d\", a);\n          printf(\"%d\", b);\n        } else {\n          printf(\"%d\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, s, p;\n  scanf(\"%d\", &a);\n  s = a;\n  while (s != 0) {\n    p = s % 10;\n    printf(\"%d\", p);\n    s = (s - p) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, t, s;\n  cin >> n;\n  if (n == 0)\n    cout << \"0\";\n  else {\n    for (int i = 10; i <= 100000; i *= 10) {\n      t = n % i;\n      s = t * 10 / i;\n      if (s <= 9 && n != 0) {\n        cout << s;\n        n -= t;\n      } else\n        break;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n[5];\n  int i, k, j;\n  cin.getline(n, 5);\n  for (i = 0; n[i] != '\\0'; i++)\n    k = i;\n\n  for (j = k; j >= 0; j--) {\n    cout << n[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0;\n  scanf(\"%d\", &a);\n  int b[6] = {0, 0, 0, 0, 0, 0};\n  int c[5] = {-1, -1, -1, -1, -1};\n  b[0] = a;\n  int i;\n  for (i = 1; i < 5; i++) {\n    b[i] = b[i - 1] / 10;\n  }\n  for (i = 0; i < 5; i++) {\n    if (b[i] != 0) {\n      c[i] = b[i] - 10 * b[i + 1];\n      if (c[i] >= 0)\n        printf(\"%d\", c[i]);\n    }\n  }\n  if (a == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[1] = n / 10000;\n  a[2] = (n - a[1] * 10000) / 1000;\n  a[3] = (n - a[1] * 10000 - a[2] * 1000) / 100;\n  a[4] = (n - a[1] * 10000 - a[2] * 1000 - a[3] * 100) / 10;\n  a[5] = n - a[1] * 10000 - a[2] * 1000 - a[3] * 100 - a[4] * 10;\n  if (a[1] != 0)\n    cout << a[5] << a[4] << a[3] << a[2] << a[1];\n  else {\n    if (a[2] != 0)\n      cout << a[5] << a[4] << a[3] << a[2];\n    else {\n      if (a[3] != 0)\n        printf(\"%d%d%d\", a[5], a[4], a[3]);\n      else {\n        if (a[4] != 0)\n          printf(\"%d%d\", a[5], a[4]);\n        else {\n          if (a[5] != 0)\n            printf(\"%d\", a[5]);\n          else\n            printf(\"0\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else {\n        printf(\"%d%d\\n\", d, c);\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a / 1000;\n  c = a % 1000;\n  d = c % 100;\n  e = d % 10;\n  c = c / 100;\n  d = d / 10;\n  printf(\"%d\", e);\n  if (d != 0, (b + c + d) != 0)\n    printf(\"%d\", d);\n  if (c != 0, (b + c) != 0)\n    printf(\"%d\", c);\n  if (b != 0)\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "28755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n <= 9999 && n > 1000) {\n    i = n / 1000 + n % 1000 / 100 * 10 + n % 100 / 10 * 100 + n % 10 * 1000;\n    cout << i << endl;\n  } else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n <= 999 && n > 100) {\n    i = n / 100 + n % 100 / 10 * 10 + n % 10 * 100;\n    printf(\"%d\\n\", i);\n  } else if (n == 100) {\n    cout << \"001\" << endl;\n  } else if (n <= 99 && n > 10) {\n    i = n % 10 * 10 + n / 10;\n  } else if (n == 10)\n    cout << \"01\" << endl;\n  else if (n <= 9 && n >= 0)\n    cout << n << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char num[5];\n  int i, len;\n  scanf(\"%s\", num);\n\n  len = strlen(num);\n  for (i = len - 1; i >= 0; i--) {\n    printf(\"%c\", num[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[6];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    if (n == n % 10) {\n      i = i + 5;\n      printf(\"%d\", n);\n    } else {\n      a[i] = n % 10;\n      n = n / 10;\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28758", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char num[5];\n  cin >> num;\n  int nl = strlen(num);\n\n  int i;\n  for (i = 0; i < (int)(nl / 2); i++) {\n    char k;\n    k = num[i];\n    num[i] = num[nl - 1 - i];\n    num[nl - 1 - i] = k;\n  }\n\n  cout << num;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  if (a != 0) {\n    b = n / 100 - 10 * a;\n    c = n / 10 - 100 * a - 10 * b;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    c = n / 10 - b * 10;\n    d = n - 100 * b - 10 * c;\n    cout << d << c << b << endl;\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - c * 10;\n    printf(\"%d%d\\n\", d, c);\n  } else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100] = {0}, i = 0, j;\n  scanf(\"%d \", &n);\n  do {\n    a[i] = n % 10;\n    n = n / 10;\n    i++;\n\n  } while (n != 0);\n  for (j = 0; j <= i - 1; j++) {\n    cout << a[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28761", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i = 0;\n  int num[5];\n  scanf(\"%d\", &n);\n  while (n / 10 != 0) {\n    num[i++] = n % 10;\n    n /= 10;\n  }\n  num[i] = n;\n  for (int m = 0; m <= i; m++)\n    printf(\"%d\", num[m]);\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "28762", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          b = 0, c = 0, d = 0, e = 0, f = a;\n        else\n          b = 0, c = 0, d = 0, e = a / 10, f = a - 10 * e;\n      else\n        b = 0, c = 0, d = a / 100, e = (a - d * 100) / 10,\n        f = a - d * 100 - e * 10;\n    else\n      b = 0, c = a / 1000, d = (a - c * 1000) / 100,\n      e = (a - c * 1000 - d * 100) / 10, f = a - c * 1000 - d * 100 - e * 10;\n  else\n    b = a / 10000, c = (a - b * 10000) / 1000,\n    d = (a - b * 10000 - c * 1000) / 100,\n    e = (a - b * 10000 - c * 1000 - d * 100) / 10,\n    f = a - b * 10000 - c * 1000 - d * 100 - e * 10;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          printf(\"%d\\n\", a);\n        else\n          printf(\"%d%d\\n\", f, e);\n      else\n        printf(\"%d%d%d\\n\", f, e, d);\n    else\n      printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "28763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  printf(\"%d\", a);\n  b = (n - a) / 10;\n  if (b != 0) {\n    b = b % 10;\n    printf(\"%d\", b);\n    c = (n - 10 * b - a) / 100;\n    if (c != 0) {\n      c = c % 10;\n      printf(\"%d\", c);\n      d = (n - 100 * c - 10 * b - a) / 1000;\n      if (d != 0) {\n        printf(\"%d\\n\", d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a / 10000 == 0) {\n    if (a / 1000 == 0) {\n      if (a / 100 == 0) {\n        if (a / 10 == 0)\n          printf(\"%d\\n\", a);\n        else {\n          b = a % 10;\n          c = a / 10;\n          cout << b << c << \"\\n\";\n        }\n      } else {\n        c = a / 100;\n        d = (a - c * 100) / 10;\n        b = (a - c * 100) % 10;\n        printf(\"%d%d%d\\n\", b, d, c);\n      }\n    } else {\n      b = a / 1000;\n      c = (a - b * 1000) / 100;\n      d = (a - b * 1000 - c * 100) / 10;\n      e = (a - b * 1000 - c * 100) % 10;\n      cout << e << d << c << b << \"\\n\";\n    }\n  } else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, i, j;\n  int bit[5];\n  i = 1;\n  cin >> num;\n  if (num == 0) {\n    cout << 0;\n    return 0;\n  }\n  while (num > 0) {\n    bit[i] = num % 10;\n    num = num / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    cout << bit[j];\n  return 0;\n}\n"}
{"label": "16", "index": "28766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r, i;\n  scanf(\"%d\", &a);\n  r = 0;\n  i = 0;\n  while (a > 0) {\n    r = r * 10 + a % 10;\n    i = i + !(a % 10);\n    a = a / 10;\n  }\n  switch (i) {\n  case 0:\n    printf(\"%d\\n\", r);\n    break;\n  case 1:\n    printf(\"0%d\\n\", r);\n    break;\n  case 2:\n    printf(\"00%d\\n\", r);\n    break;\n  case 3:\n    printf(\"000%d\\n\", r);\n    break;\n  case 4:\n    printf(\"0000%d\\n\", r);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28767", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n\n  if (a > 9) {\n    if (a > 99) {\n      if (a > 999) {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        e = ((a - b - c - d) % 10000) / 1000;\n        printf(\"%d%d%d%d\", b, c, d, e);\n      } else {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        printf(\"%d%d%d\", b, c, d);\n      }\n    } else {\n      b = a % 10;\n      c = ((a - b) % 100) / 10;\n      printf(\"%d%d\", b, c);\n    }\n  } else {\n    b = a % 10;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[101];\n  scanf(\"%s\", str);\n  int len = strlen(str);\n  for (int i = len - 1; i >= 0; --i)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "28769", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, g, h, i;\n  long f;\n  cin >> f;\n  a = f / 10000;\n  g = f % 10000;\n  b = g / 1000;\n  h = g % 1000;\n  c = h / 100;\n  i = h % 100;\n  d = i / 10;\n  e = i % 10;\n  if (a > 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "28770", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a;\n  b = a / 10000;\n  if (b)\n    c = 5;\n  else {\n    b = a / 1000;\n    if (b)\n      c = 4;\n    else {\n      b = a / 100;\n      if (b)\n        c = 3;\n      else {\n        b = a / 10;\n        if (b)\n          c = 2;\n        else\n          c = 1;\n      }\n    }\n  }\n  switch (c) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100,\n           a % 10000 / 1000, a / 10000);\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a % 10, a % 100 / 10, a / 100);\n    break;\n  case 2:\n    printf(\"%d%d \", a % 10, a / 10);\n    break;\n  case 1:\n    printf(\"%d \", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, X, a, b, c, d, e;\n  cin >> N;\n  if (N > 9999)\n    X = 5;\n  else if (N > 999)\n    X = 4;\n  else if (N > 99)\n    X = 3;\n  else if (N > 9)\n    X = 2;\n  else\n    X = 1;\n  a = N / 10000;\n  b = (N - 10000 * a) / 1000;\n  c = (N - 10000 * a - 1000 * b) / 100;\n  d = (N - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (N - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  switch (X) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 1:\n    printf(\"%d\\n\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, k, n, a[10], i = 0;\n  cin >> n;\n  k = n;\n  while (k > 0) {\n    a[i] = k % 10; \n    k = k / 10;\n    i++;\n    j++; \n  }\n  if (n == 0) {\n    a[0] = 0;\n    j = 1;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i]; \n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    a = b * 10 + c;\n    printf(\"%02d\\n\", a);\n  } else if (a < 1000) {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = (a - c * 10 - b) / 100;\n    a = b * 100 + c * 10 + d;\n    printf(\"%03d\\n\", a);\n  } else {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = ((a - c * 10 - b) % 1000) / 100;\n    e = (a - d * 100 - c * 10 - b) / 1000;\n    a = b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28774", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000];\n  cin >> str;\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  if (n < 10)\n    cout << a;\n  else if (n > 9 && n < 100) {\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n > 99 && n < 1000) {\n    b = n / 10 % 10;\n    c = n / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (n > 999 && n < 10000) {\n    b = n / 10 % 10;\n    c = n / 100 % 10;\n    d = n / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i = 0;\n  cin >> a;\n  if (a == 100)\n    cout << \"001\";\n  else {\n    while (a > 0) {\n      i = i * 10 + a % 10;\n\n      a = a / 10;\n    }\n    printf(\"%d\", i);\n  }\n  return (0);\n}\n"}
{"label": "16", "index": "28777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = (int)a / 10;\n    c = a - b * 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = (int)a / 100;\n    c = (int)(a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = (int)a / 1000;\n    c = (int)(a - 1000 * b) / 100;\n    d = (int)(a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "28778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  int k;\n\n  int x[10];\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n != 0) {\n\n      x[i] = n % 10;\n      n = n / 10;\n      i++;\n    }\n    i = i - 1;\n\n    for (k = 1; k <= i; k++) {\n      printf(\"%d\", x[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10] = {'\\0'};\n  cin.getline(str, 10);\n  for (int i = strlen(str) - 1; i >= 0; i--) {\n    cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28780", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else {\n    if (n / 1000 >= 1) {\n      a = n / 1000;\n      b = (n - a * 1000) / 100;\n      c = (n - a * 1000 - b * 100) / 10;\n      d = n - a * 1000 - b * 100 - c * 10;\n      cout << d << c << b << a << endl;\n    } else {\n      if (n / 100 >= 1) {\n        b = n / 100;\n        c = (n - b * 100) / 10;\n        d = n - b * 100 - c * 10;\n        printf(\"%d%d%d\\n\", d, c, b);\n      } else {\n        if (n / 10 >= 1) {\n          c = n / 10;\n          d = n - c * 10;\n          cout << d << c << endl;\n        } else\n          cout << n << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28781", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char num[6];\n  int i, n, nnum[6];\n  scanf(\"%s \", num);\n  n = strlen(num);\n\n  for (i = n - 1; i >= 0; i--) {\n    nnum[i] = num[i] - 48;\n    printf(\"%d\", nnum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28782", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j, a[6] = {0};\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"0\");\n  while (n != 0) {\n    a[i++] = n % 10;\n    n /= 10;\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "28783", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, f, g, h;\n  cin >> x;\n  a = x % 10;\n  b = x % 100;\n  c = x % 1000;\n  d = x % 10000;\n  e = (b - a) / 10;\n  f = (c - b) / 100;\n  g = (d - c) / 1000;\n  if (x < 10)\n    printf(\"%d\\n\", a);\n  else if (x < 100)\n    printf(\"%d%d\\n\", a, e);\n  else if (x < 1000)\n    printf(\"%d%d%d\\n\", a, e, f);\n  else\n    printf(\"%d%d%d%d\\n\", a, e, f, g);\n  return 0;\n}\n"}
{"label": "16", "index": "28784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, k, a, b, c, d;\n  scanf(\"%d\", &s);\n  a = (s - s % 1000) / 1000;\n  b = (s % 1000 - s % 100) / 100;\n  c = (s % 100 - s % 10) / 10;\n  d = s % 10;\n  k = d * 1000 + c * 100 + b * 10 + a;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        cout << d;\n      else\n        cout << d << c;\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28785", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else {\n    if (n / 1000 >= 1) {\n      a = n / 1000;\n      b = (n - a * 1000) / 100;\n      c = (n - a * 1000 - b * 100) / 10;\n      d = n - a * 1000 - b * 100 - c * 10;\n      cout << d << c << b << a << endl;\n    } else {\n      if (n / 100 >= 1) {\n        b = n / 100;\n        c = (n - b * 100) / 10;\n        d = n - b * 100 - c * 10;\n        printf(\"%d%d%d\\n\", d, c, b);\n      } else {\n        if (n / 10 >= 1) {\n          c = n / 10;\n          d = n - c * 10;\n          cout << d << c << endl;\n        } else\n          cout << n << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100] = {0}, i = 0, j;\n  cin >> n;\n  do {\n    a[i] = n % 10;\n    n = n / 10;\n    i++;\n\n  } while (n != 0);\n  for (j = 0; j <= i - 1; j++) {\n    cout << a[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[5];\n  int count = 1;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    if (n >= 10) {\n      n = (n - a[i]) / 10;\n      count++;\n    }\n  }\n  for (int i = 0; i < count; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28788", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n\n  if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "28789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, m, p, q, k, l, s;\n  cin >> n;\n  if (n == 10000) {\n    a = 1;\n    printf(\"%05d\", a);\n  } else if (n >= 1000) {\n    s = n % 1000;\n    m = (n - s) / 1000;\n    l = s % 100;\n    p = (s - l) / 100;\n    q = l % 10;\n    k = (l - q) / 10;\n    a = q * 1000 + k * 100 + p * 10 + m;\n    printf(\"%04d\", a);\n  } else if (n >= 100) {\n    s = n % 100;\n    m = (n - s) / 100;\n    l = s % 10;\n    p = (s - l) / 10;\n    a = l * 100 + p * 10 + m;\n    printf(\"%03d\", a);\n  } else if (n >= 10) {\n    s = n % 10;\n    m = (n - s) / 10;\n    a = s * 10 + m;\n    printf(\"%02d\", a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28790", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, b, c, s, p;\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    printf(\"%d\", n);\n  else if (n >= 10 && n <= 99) {\n    m = n / 10;\n    a = n - m * 10;\n    printf(\"%d%d\", a, m);\n  } else if (n >= 100 && n <= 999) {\n    s = n / 100;\n    m = (n - s * 100) / 10;\n    b = n - s * 100 - m * 10;\n    printf(\"%d%d%d\", b, m, s);\n  } else if (n >= 1000 && n <= 9999) {\n    m = n / 10;\n\n    p = n / 1000;\n    s = (n - p * 1000) / 100;\n    b = (n - s * 100 - p * 1000) / 10;\n    c = n - p * 1000 - s * 100 - 10 * b;\n\n    printf(\"%d%d%d%d\", c, b, s, p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    cout << n;\n  }\n  if ((n > 9) && (n < 100)) {\n    a = n / 10;\n    b = n % 10;\n    printf(\"%d%d\", b, a);\n  }\n  if ((n > 99) && (n < 1000)) {\n    a = n / 100;\n    b = (n - a * 100) / 10;\n    c = n % 10;\n    cout << c << b << a;\n  }\n  if (n > 999) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28792", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%d%d\", b, c);\n  } else if (a >= 100 && a <= 999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = (a - b - 10 * c) / 100;\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 1000 && a <= 9999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = (a - b - 10 * c - 100 * d) / 1000;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 10000 && a <= 99999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 1000);\n  b = (int)(n / 100 - a * 10);\n  c = (int)(n / 10 - a * 100 - b * 10);\n  d = (int)(n - a * 1000 - b * 100 - c * 10);\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0)\n        printf(\"%d\\n\", d);\n      else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    cout << d << c << b << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "28794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[101];\n  scanf(\"%s\", str);\n  int len = strlen(str);\n  for (int i = len - 1; i >= 0; --i)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "28795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, m;\n  scanf(\"%d\", &n);\n  x = n % 10;\n  y = (n % 100 - n % 10) / 10;\n  z = (n % 1000 - n % 100) / 100;\n  m = n / 1000;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"01\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 10000)\n    printf(\"00001\");\n  else if (n > 10 && n < 100)\n    printf(\"%d%d\", x, y);\n  else if (n > 100 && n < 1000)\n    cout << x << y << z;\n  else if (n > 1000 && n < 10000)\n    printf(\"%d%d%d%d\", x, y, z, m);\n  return 0;\n}\n"}
{"label": "16", "index": "28796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &e);\n  if (e < 10) {\n    a = e;\n    cout << a;\n  } else if (e < 100) {\n    a = e % 10;\n    b = (e - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (e < 1000) {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = (int)(e / 100);\n    cout << a << b << c;\n  } else {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = ((e - b * 10 - a) / 100) % 10;\n    d = (int)(e / 1000);\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int sv[4];\n  cin >> n;\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else if (n / 1000 != 0 && n != 10000 && n >= 1000) {\n    for (i = 0; i < 4; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 4; i++) {\n      cout << sv[i];\n    }\n    printf(\"\\n\");\n  } else if (n / 100 != 0 && n >= 100) {\n    for (i = 0; i < 3; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 3; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 10 != 0 && n >= 10) {\n    for (i = 0; i < 2; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 2; i++) {\n      cout << sv[i];\n    }\n    printf(\"\\n\");\n  } else\n    cout << n << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  b = 0;\n  while (a) {\n    b = a % 10;\n    cout << b;\n    a = a / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = a / 100 - (a / 1000) * 10;\n  e = a / 10 - (a / 100) * 10;\n  f = a - (a / 10) * 10;\n  if (b != 0) {\n    g = f * 10000 + e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%05d\", g);\n  } else if (c != 0) {\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%04d\", g);\n  } else if (d != 0) {\n    g = f * 100 + e * 10 + d;\n    printf(\"%03d\", g);\n  } else if (e != 0) {\n    g = f * 10 + e;\n    printf(\"%01d\", g);\n  } else {\n    g = f;\n    printf(\"%d\", g);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a = 0, b = 0, c = 0, i = 1;\n  scanf(\"%d \", &a);\n\n  do {\n    c = a % 10;\n    a = (a - c) / 10;\n    printf(\"%d\", c);\n  } while (a != 0);\n\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28801", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d \", &a);\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = a / 100 - (a / 1000) * 10;\n  e = a / 10 - (a / 100) * 10;\n  f = a - (a / 10) * 10;\n  if (b != 0) {\n    g = f * 10000 + e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%05d\", g);\n  } else if (c != 0) {\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%04d\", g);\n  } else if (d != 0) {\n    g = f * 100 + e * 10 + d;\n    printf(\"%03d\", g);\n  } else if (e != 0) {\n    g = f * 10 + e;\n    printf(\"%01d\", g);\n  } else {\n    g = f;\n    printf(\"%d\", g);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n % 10;\n  n = n / 10;\n  if (n == 0) {\n    printf(\"%d\", a);\n  } else {\n    b = n % 10;\n    n = n / 10;\n    if (n == 0) {\n      printf(\"%d%d\", a, b);\n    } else {\n      c = n % 10;\n      n = n / 10;\n      d = n;\n      if (n == 0) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        printf(\"%d%d%d%d\", a, b, c, d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28803", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[5], n, i, k = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 4; i >= 0; i--)\n    if (a[i] != 0) {\n      k = i;\n      break;\n    }\n  for (i = 0; i <= k; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  i = 0;\n  char a[9], ch;\n  while ((ch = cin.get()) != '\\n') {\n    a[i] = ch;\n    i = i + 1;\n  }\n  i = i - 1;\n  while (i >= 0) {\n    cout << a[i];\n    i = i - 1;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct integ {\n  char num;\n  struct integ *next;\n} * head, *p1, *p2, *p3, *newhead;\nint main() {\n  int i, n = 0;\n  p1 = p2 = (struct integ *)malloc(sizeof(struct integ));\n  head = NULL;\n  for (i = 0;; i++) {\n    scanf(\"%c\", &p1->num);\n    if (p1->num < 48 || p1->num > 57)\n      break;\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct integ *)malloc(sizeof(struct integ));\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (i == 0) {\n      p3 = newhead = p1;\n    } else\n      p3 = p3->next = p1;\n    p2->next = NULL;\n  }\n  for (p1 = newhead; p1 != NULL; p1 = p1->next)\n    cout << p1->num;\n}\n"}
{"label": "16", "index": "28806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, r;\n  cin >> x;\n  a = x % 10;\n  b = (x / 10) % 10;\n  c = (x / 100) % 10;\n  d = (x / 1000) % 10;\n  e = (x / 10000) % 10;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        if (b == 0) {\n          r = a;\n          cout << r << \"\\n\";\n        } else {\n          r = a * 10 + b;\n          printf(\"%02d\\n\", r);\n        }\n      } else {\n        r = a * 100 + b * 10 + c;\n        printf(\"%03d\\n\", r);\n      }\n    } else {\n      r = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", r);\n    }\n  } else {\n    r = a * 10000 + b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%05d\\n\", r);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28807", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, p;\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n > 999)\n    p = 4;\n  else if (n > 99)\n    p = 3;\n  else if (n > 9)\n    p = 2;\n  else\n    p = 1;\n  x = n / 1000;\n  y = (n - x * 1000) / 100;\n  z = (n - x * 1000 - y * 100) / 10;\n  w = n - x * 1000 - y * 100 - z * 10;\n  switch (p) {\n  case 4:\n    printf(\"%d%d%d%d\", w, z, y, x);\n    break;\n  case 3:\n    printf(\"%d%d%d\", w, z, y);\n    break;\n  case 2:\n    printf(\"%d%d\", w, z);\n    break;\n  case 1:\n    printf(\"%d\", w);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d \", &n);\n\n  if (n > 999) {\n    a = n / 1000;\n    b = n - a * 1000;\n    c = b / 100;\n    d = b - c * 100;\n    e = d / 10;\n    f = d - e * 10;\n\n    cout << f;\n    printf(\"%d\", e);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<1000 & n> 99) {\n    a = n / 100;\n    b = n - a * 100;\n    c = b / 10;\n    d = b - c * 10;\n\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<100 & n> 9) {\n    a = n / 10;\n    b = n - a * 10;\n\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  if (n < 10) {\n    a = n / 10;\n\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[10] = {0};\n  int i, s = 0;\n\n  cin >> ch;\n  i = 0;\n  while (ch[i] != '\u0000') {\n    s = i;\n    i++;\n  }\n  for (i = s; i >= 0; i--) {\n    printf(\"%c\", ch[i]);\n  }\n}\n"}
{"label": "16", "index": "28810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c, i = 0;\n  char num[7] = {0};\n  while ((c = cin.get()) != '\\n') {\n    num[i++] = c;\n  }\n  for (i = i - 1; i >= 0; i--)\n    cout << num[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == a % 10)\n    printf(\"%d\", a);\n  else if (a == a % 100)\n    printf(\"%02d\", a = (a % 100 - a % 10) / 10 + (a % 10) * 10);\n  else if (a == a % 1000)\n    printf(\"%03d\", a = (a % 1000 - a % 100) / 100 + (a % 100 - a % 10) +\n                       (a % 10) * 100);\n  else\n    printf(\"%04d\", a = (a % 10000 - a % 1000) / 1000 +\n                       (a % 1000 - a % 100) / 10 + (a % 100 - a % 10) * 10 +\n                       (a % 10) * 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "28812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, t;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n  if (b != 0) {\n    t = f;\n    f = b;\n    b = t;\n    t = e;\n    e = c;\n    c = t;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  } else if (c != 0) {\n    t = f;\n    f = c;\n    c = t;\n    t = e;\n    e = d;\n    d = t;\n    cout << c << d << e << f;\n  } else if (d != 0) {\n    t = f;\n    f = d;\n    d = t;\n    printf(\"%d%d%d\", d, e, f);\n  } else if (e != 0) {\n    t = f;\n    f = e;\n    e = t;\n    cout << e << f;\n  } else\n    printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, z, y;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    z = a % 100;\n    c = z / 10;\n    d = z % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    z = a % 1000;\n    c = z / 100;\n    y = z % 100;\n    d = y / 10;\n    e = y % 10;\n    cout << e << d << c << b;\n  } else\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "28814", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n / 10 == 0)\n    cout << n << endl;\n  else if (n / 100 == 0)\n    cout << n % 10 << n / 10 << endl;\n  else if (n / 1000 == 0)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n / 10000 == 0)\n    cout << n % 10 << n % 100 / 10 << n % 1000 / 100 << n / 1000 << endl;\n  else if (n == 10000)\n    cout << 1 << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n >= 0 && n <= 9) {\n    cout << n << endl;\n  } else if (n >= 10 && n <= 99) {\n    int a, b;\n    a = n / 10;\n    b = n % 10;\n    cout << b << a << endl;\n  } else if (n >= 100 && n <= 999) {\n    int a, b, c;\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - 100 * a - 10 * b;\n    cout << c << b << a << endl;\n  } else if (n >= 1000 && n <= 9999) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n = 10000) {\n    cout << \"00001\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, count = 0;\n  char a[20000];\n  while ((a[count] = getchar()) != '\\n')\n    count++;\n\n  for (i = count - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b = 0, n, c, i, a[5];\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << '0' << endl;\n  else {\n    for (i = 0; n > 0; i++) {\n      c = n % 10;\n      a[i] = c;\n      n = n / 10;\n      b += 1;\n    }\n    for (i = 0; i < b; i++) {\n      cout << a[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t[5] = {1, 10, 100, 1000, 10000};\n  int x[6];\n\n  int num;\n  scanf(\"%d \", &num);\n\n  int length;\n  length = (num >= t[4]) + (num >= t[3]) + (num >= t[2]) + (num >= t[1]) +\n           (num >= t[0]);\n  for (int i = 1; i <= length; i++) {\n    x[i] = (num % t[i]) / t[i - 1];\n  }\n\n  if (length == 0)\n    cout << \"0\";\n  else {\n    for (int j = 1; j <= length; j++) {\n      cout << x[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28819", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    int a, b;\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    int c, d, e;\n    c = n % 10;\n    d = (n - c) / 10 % 10;\n    e = (n - 10 * d - c) / 100;\n    printf(\"%d%d%d\", c, d, e);\n  } else {\n    int f, g, h, i;\n    f = n % 10;\n    g = (n - f) / 10 % 10;\n    h = (n - f - 10 * g) / 100 % 10;\n    i = (n - f - 10 * g - 100 * h) / 1000;\n    cout << f << g << h << i;\n  }\n}\n"}
{"label": "16", "index": "28820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (10 <= n && n < 100) {\n    cout << n % 10 << n / 10;\n  } else if (n >= 100 && n <= 999) {\n    printf(\"%d%d%d\", n - (n / 10) * 10, n / 10 - (n / 100) * 10, n / 100);\n  } else if (n >= 1000 && n <= 9999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10\n         << n / 100 - (n / 1000) * 10 << n / 1000;\n  } else {\n    if (n == 10000) {\n      cout << 00001;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  if (d != 0)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c != 0)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b != 0)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "28822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[4], b;\n  char cc;\n  cin >> b;\n  a[0] = b % 10;\n  b = b / 10;\n  a[1] = b % 10;\n  b = b / 10;\n  a[2] = b % 10;\n  b = b / 10;\n  a[3] = b % 10;\n  b = b / 10;\n  if (a[3] != 0)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (a[2] != 0)\n    cout << a[0] << a[1] << a[2];\n  else if (a[1] != 0)\n    cout << a[0] << a[1];\n  else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "16", "index": "28823", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  if (n > 10 && n < 100) {\n    a = n % 10;\n    b = n / 10;\n    n = 10 * a + b;\n    printf(\"%d\", n);\n  }\n  if (n > 100 && n < 1000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n / 100;\n    n = 100 * a + 10 * b + c;\n    printf(\"%d\", n);\n  }\n  if (n > 1000 && n < 10000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = (n % 1000 - 10 * b - a) / 100;\n    d = n / 1000;\n    n = 1000 * a + 100 * b + 10 * c + d;\n    printf(\"%d\", n);\n  }\n  if (n == 10)\n    printf(\"01\");\n  if (n == 100)\n    printf(\"001\");\n  if (n == 1000)\n    printf(\"0001\");\n  if (n == 10000)\n    printf(\"00001\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char exp[10], t;\n  int i, j;\n  cin.getline(exp, 10);\n  for (i = 0, j = strlen(exp) - 1; i < j; i++, j--) {\n    t = exp[i];\n    exp[i] = exp[j];\n    exp[j] = t;\n  }\n  for (i = 0; i < strlen(exp); i++)\n    printf(\"%c\", exp[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%d%d\", b, c);\n  } else if (a >= 100 && a <= 999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = (a - b - 10 * c) / 100;\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 1000 && a <= 9999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = (a - b - 10 * c - 100 * d) / 1000;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 10000 && a <= 99999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[6];\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  else\n    while (n > 0) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      printf(\"%d\", a[i]);\n      i++;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "28827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    int a, b;\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    int c, d, e;\n    c = n % 10;\n    d = (n - c) / 10 % 10;\n    e = (n - 10 * d - c) / 100;\n    cout << c << d << e;\n  } else {\n    int f, g, h, i;\n    f = n % 10;\n    g = (n - f) / 10 % 10;\n    h = (n - f - 10 * g) / 100 % 10;\n    i = (n - f - 10 * g - 100 * h) / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n}\n"}
{"label": "16", "index": "28828", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s = 0, a, b;\n  cin >> n;\n  if (n % 10 == 0) {\n    if (n == 0)\n      printf(\"\");\n    else {\n      printf(\"0\");\n      for (n = n / 10; n % 10 == 0; n = n / 10)\n        printf(\"0\");\n\n      for (; n >= 1; n = n / 10) {\n        i = n % 10;\n        s = s * 10 + i;\n      }\n    }\n  } else\n    for (; n >= 1; n = n / 10) {\n      i = n % 10;\n      s = s * 10 + i;\n    }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "28829", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m;\n  m = 1;\n  char s[5];\n  scanf(\"%s \", s);\n  i = strlen(s);\n  i = i - 1;\n  while (i >= 0) {\n    printf(\"%c\", s[i]);\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint print(int n);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  print(n);\n  return 0;\n}\nint print(int n) {\n  int s, a, b;\n  a = n;\n  s = 0;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      b = a % 10;\n      cout << b;\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0) {\n    printf(\"0\");\n  }\n  while (a != 0) {\n    cout << a - (a / 10) * 10;\n    a = a / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28832", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  cin >> num;\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (num == 10000)\n    printf(\"1\\n\");\n  if (num > 999)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (num > 9)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "28833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, e, f, g;\n  scanf(\"%d \", &n);\n  a = (int)(n / 1000);\n  e = n - 1000 * a;\n  b = (int)(e / 100);\n  f = e - 100 * b;\n  c = (int)(f / 10);\n  g = f - 10 * c;\n  if (n >= 10000) {\n    printf(\"00001\");\n  } else {\n    if (n >= 1000) {\n      cout << g << c << b << a;\n    } else {\n      if (n >= 100) {\n        printf(\"%d%d%d\", g, c, b);\n      } else {\n        if (n >= 10) {\n          printf(\"%d%d\", g, c);\n        } else {\n          printf(\"%d\", g);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28834", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a1, a2, b1, b2, c1, c2, d1;\n  scanf(\"%d\", &n);\n  a1 = n % 10;\n  a2 = n / 10;\n  if (a2 > 0) {\n    b1 = a2 % 10;\n    b2 = a2 / 10;\n    if (b2 > 0) {\n      c1 = b2 % 10;\n      c2 = b2 / 10;\n      if (c2 > 0) {\n        d1 = c2 % 10;\n        printf(\"%d%d%d%d\", a1, b1, c1, d1);\n      } else\n        printf(\"%d%d%d\", a1, b1, c1);\n    } else\n      printf(\"%d%d\", a1, b1);\n  } else\n    printf(\"%d\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "28835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = a / 1000;\n  d = (a % 1000) / 100;\n  e = (a % 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%05d\", b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    cout << f << e << d;\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "16", "index": "28836", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, a, b, c, d;\n  cin >> n;\n  if (n < 10) {\n    printf(\"%d\\n\", n);\n  }\n  if (n >= 10 && n < 100) {\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\\n\", a, b);\n  }\n  if (n >= 100 && n < 1000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100;\n    printf(\"%d%d%d\\n\", a, b, c);\n  }\n  if (n >= 1000 && n < 10000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100 % 10;\n    d = (n - c * 100 - b * 10 - a) / 1000;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  }\n  if (n == 10000) {\n    printf(\"00001\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28837", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    a = n % 10;\n    printf(\"%d\", a);\n    n = (n - a) / 10;\n    if (n == 0)\n      break;\n  }\n}\n"}
{"label": "16", "index": "28838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, a, b, c, d, e;\n  cin >> s;\n  a = s / 10000;\n  b = (s - 10000 * a) / 1000;\n  c = (s - 10000 * a - 1000 * b) / 100;\n  d = (s - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (s - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  float n;\n  cin >> n;\n  a = floor(n / 1000);\n  b = floor((n - a * 1000) / 100);\n  c = floor((n - a * 1000 - b * 100) / 10);\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (n / 1000 >= 1)\n    cout << d << c << b << a << endl;\n\n  if (n / 1000 < 1 && n / 100 >= 1) {\n    cout << d << c << b << endl;\n  }\n  if (n / 100 < 1 && n / 10 >= 1) {\n    cout << d << c << endl;\n  }\n  if (n / 10 < 1) {\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[5];\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - a[0] * 10000 - a[1] * 1000) / 100;\n  a[3] = (n - a[0] * 10000 - a[1] * 1000 - a[2] * 100) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  for (i = 0; i <= 4; i++) {\n    if (a[i]) {\n      for (j = 4; j >= i; j--)\n        cout << a[j];\n      break;\n    }\n  }\n  if (a[0] + a[1] + a[2] + a[3] + a[4] == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, a[10], m, i;\n  scanf(\"%d\", &t);\n  for (i = 0; i <= 4; i++) {\n    a[i] = t % 10;\n    t = t / 10;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      m = i;\n      break;\n    }\n  }\n  for (i = 0; i <= m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, p;\n  int i = 1;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    p = 1;\n  else if (n < 100)\n    p = 2;\n  else if (n < 1000)\n    p = 3;\n  else if (n < 10000)\n    p = 4;\n  do {\n    m = n % 10;\n    printf(\"%d\", m);\n    n = n / 10;\n    i++;\n  } while (i <= p);\n  return 0;\n}\n"}
{"label": "16", "index": "28843", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    while (n != 0) {\n      m = n % 10;\n      printf(\"%d\", m);\n      n = n / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28844", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a1, a2, a3, a4;\n  scanf(\"%d\", &n);\n  a1 = n / 1000;\n  a2 = (n - 1000 * a1) / 100;\n  a3 = (n - 1000 * a1 - 100 * a2) / 10;\n  a4 = (n - 1000 * a1 - 100 * a2 - 10 * a3);\n  if (a1 == 0 & a2 == 0 & a3 == 0)\n    printf(\"%d\", a4);\n  if (a1 == 0 & a2 != 0)\n    printf(\"%d%d%d\", a4, a3, a2);\n  if (a1 != 0 & a2 != 0 & a3 != 0)\n    printf(\"%d%d%d%d\", a4, a3, a2, a1);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int A[5];\n  scanf(\"%d\", &n);\n  for (i = 1; 1 <= 5; i++) {\n    if (n < 1)\n      break;\n    cout << n % 10;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y = 0;\n  cin >> x;\n  if (x < 10)\n    printf(\"%d\", x);\n  else {\n    while (x > 0) {\n      y = x % 10 + 10 * y;\n      x = x / 10;\n    }\n    if (x % 10 != 0)\n      cout << y;\n    else\n      printf(\"%03d\", y);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28847", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a[5], b[5];\n  int n, i, m;\n  cin >> n;\n  b[0] = n;\n  for (i = 0; i < 5; i = i + 1) {\n    a[i] = b[i] % 10;\n    b[i + 1] = b[i] / 10;\n    cout << a[i];\n    if (b[i + 1] == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28848", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[5];\n  int i, t, k, l; \n  scanf(\"%s\", c);\n  k = strlen(c);\n  l = k / 2;\n  for (i = 0; i < l; i++) {\n    t = c[i];\n    c[i] = c[k - i - 1];\n    c[k - i - 1] = t;\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "16", "index": "28849", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a;\n  cin >> x;\n  if (x == 0)\n    printf(\"0\");\n  else {\n    while (x != 0) {\n      a = x % 10;\n      x = x / 10;\n      cout << a;\n    }\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "16", "index": "28850", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else {\n    if (c != 0)\n      printf(\"%d%d%d\", e, d, c);\n    else {\n      if (d != 0)\n        printf(\"%d%d\", e, d);\n      else\n        printf(\"%d\", e);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a % 10;\n    c = a / 10;\n    d = 10 * b + c;\n    if (b == 0)\n      printf(\"0%d\", d);\n    else\n      printf(\"%d\", d);\n  } else if (a / 1000 == 0) {\n    b = a % 10;\n    c = a / 100;\n    d = a / 10 - 10 * c;\n    e = 100 * b + 10 * d + c;\n    if (b == 0)\n      if (d == 0)\n        printf(\"00%d\", e);\n      else\n        cout << \"0\" << e;\n    else\n      printf(\"%d\", e);\n  } else if (a / 10000 == 0) {\n    b = a % 10;\n    c = a / 1000;\n    d = a / 100 - 10 * c;\n    e = a / 10 - 10 * d - 100 * c;\n    f = 1000 * b + 100 * e + 10 * d + c;\n    if (b == 0)\n      if (e == 0)\n        if (d == 0)\n          printf(\"000%d\", f);\n        else\n          printf(\"00%d\", f);\n      else\n        printf(\"0%d\", f);\n    else\n      printf(\"%d\", f);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "28852", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  b = (n - a) % 100 / 10;\n  c = (n - (n % 100)) % 1000 / 100;\n  d = (n - (n % 1000)) % 10000 / 1000;\n  e = 1;\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    if (n < 100) {\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n < 1000) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n < 10000) {\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else {\n          printf(\"abcde\");\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "28853", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  cin >> n;\n  a = (int)(n / 10000);\n  b = (int)(n / 1000 - a * 10);\n  c = (int)(n / 100 - a * 100 - b * 10);\n  d = (int)(n / 10 - a * 1000 - b * 100 - c * 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  if (a == 0 && b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  if (a == 0 && b == 0 && c != 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  if (a == 0 && b == 0 && c == 0 && d != 0)\n    printf(\"%d%d\\n\", e, d);\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "28854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a % 10;\n  if (b != 0) {\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c != 0) {\n\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d != 0) {\n\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e != 0) {\n\n          cout << f << e;\n        } else\n          printf(\"%d\", f);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "28855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, x;\n  scanf(\"%d\", &x);\n  if (x == 0)\n    printf(\"0\");\n  else if (x <= 9)\n    printf(\"%d\", x);\n  else if (x <= 99) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (x <= 999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = (x - 10 * b - a) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x <= 9999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = ((x - 10 * b - a) / 100) % 10;\n    d = (x - 100 * c - 10 * b - a) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else\n    printf(\"00001\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "28856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char a[6];\n  int i, n;\n  cin >> a;\n  n = strlen(a);\n  for (i = 1; i <= n; i++)\n    printf(\"%c\", a[n - i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          b = 0, c = 0, d = 0, e = 0, f = a;\n        else\n          b = 0, c = 0, d = 0, e = a / 10, f = a - 10 * e;\n      else\n        b = 0, c = 0, d = a / 100, e = (a - d * 100) / 10,\n        f = a - d * 100 - e * 10;\n    else\n      b = 0, c = a / 1000, d = (a - c * 1000) / 100,\n      e = (a - c * 1000 - d * 100) / 10, f = a - c * 1000 - d * 100 - e * 10;\n  else\n    b = a / 10000, c = (a - b * 10000) / 1000,\n    d = (a - b * 10000 - c * 1000) / 100,\n    e = (a - b * 10000 - c * 1000 - d * 100) / 10,\n    f = a - b * 10000 - c * 1000 - d * 100 - e * 10;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          printf(\"%d\\n\", a);\n        else\n          printf(\"%d%d\\n\", f, e);\n      else\n        printf(\"%d%d%d\\n\", f, e, d);\n    else\n      printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "28858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, c, b;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; i <= n;) {\n    i = i * 10;\n    c = n % i;\n    n = n - c;\n    b = c * 10 / i;\n    cout << b;\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "28859", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid f(int n) {\n  cout << n % 10;\n  n = n / 10;\n  if (n)\n    f(n);\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  f(n);\n  return 0;\n}\n"}
{"label": "16", "index": "28860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d \", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = x % 10;\n  printf(\"%d\", e);\n  if (d || c || b || a)\n    printf(\"%d\", d);\n  if (c || b || a)\n    printf(\"%d\", c);\n  if (b || a)\n    cout << b;\n  if (a)\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "28861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m;\n  m = 1;\n  char s[5];\n  cin >> s;\n  i = strlen(s);\n  i = i - 1;\n  while (i >= 0) {\n    printf(\"%c\", s[i]);\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if ((10 < n) && (n < 100)) {\n    int i, j, k;\n    i = n / 10;\n    j = n % 10;\n    k = 10 * j + i;\n    printf(\"%d\", k);\n  } else if ((100 < n) && (n < 1000)) {\n    int a, b, c, d, e;\n    a = n / 100;\n    b = n % 100;\n    c = b / 10;\n    d = b % 10;\n    e = 100 * d + 10 * c + a;\n    printf(\"%d\", e);\n  } else if ((1000 < n) && (n < 10000)) {\n    int f, l, m, w, o, p, q;\n    f = n / 1000;\n    l = n % 1000;\n    m = l / 100;\n    w = l % 100;\n    o = w / 10;\n    p = w % 10;\n    q = 1000 * p + 100 * o + 10 * m + f;\n    printf(\"%d\", q);\n  } else if (n == 10) {\n    printf(\"01\");\n  } else if (n == 100)\n    printf(\"001\");\n  else if (n == 1000) {\n    printf(\"0001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[7] = {'0', '0', '0', '0', '0', '0', '0'};\n  scanf(\"%s \", a);\n  int ava = 0;\n  for (int j = 6; j >= 0; j--) {\n    if (ava == 1) {\n      printf(\"%c\", a[j]);\n    }\n    if (a[j] != '0') {\n      ava = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = x % 10;\n  printf(\"%d\", e);\n  if (d || c || b || a)\n    printf(\"%d\", d);\n  if (c || b || a)\n    printf(\"%d\", c);\n  if (b || a)\n    cout << b;\n  if (a)\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "28865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000];\n  scanf(\"%s \", str);\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    cout << str[i];\n  return 0;\n}\n"}
{"label": "16", "index": "28866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, i, j = 0, k = 1, a[5] = {0}, t;\n  cin >> m;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (m / i != 0)\n      j++;\n    else\n      break;\n  }\n  for (i = 1; i < j; i++) {\n    k = 10 * k;\n  }\n  for (i = j; i >= 1; i--) {\n    a[i] = m / k;\n    m = m % k;\n    k = k / 10;\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "28867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  }\n}\n"}
{"label": "16", "index": "28868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    cout << a;\n  else {\n    while (a / 10 != 0) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d\", c);\n      a = b;\n    }\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28869", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 1, n, m, p;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    m = 1;\n  else if (n < 100)\n    m = 2;\n  else if (n < 1000)\n    m = 3;\n  else if (n < 10000)\n    m = 4;\n  while (i <= m) {\n    p = n - n / 10 * 10;\n    printf(\"%d\", p);\n    n = n / 10;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  int num[5];\n  a = 100000;\n  for (i = 0; i <= 4; i++) {\n    a = a / 10;\n    num[i] = (n / a) % 10;\n  }\n  if (num[0] != 0) {\n    printf(\"%d%d%d%d%d\", num[4], num[3], num[2], num[1], num[0]);\n  } else if (num[1] != 0) {\n    printf(\"%d%d%d%d\", num[4], num[3], num[2], num[1]);\n  } else {\n    if (num[2] != 0) {\n      printf(\"%d%d%d\", num[4], num[3], num[2]);\n    } else if (num[3] != 0) {\n      printf(\"%d%d\", num[4], num[3]);\n    } else\n      cout << num[4];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n == 0) {\n    cout << n;\n  } else {\n    while (n > 0) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc) {\n  int i, n, c, b, a[10];\n  scanf(\"%d \", &n);\n  b = 1;\n  i = 0;\n  while (b != 0) {\n    a[i] = n % 10;\n    b = n / 10;\n    n = b;\n    i++;\n  }\n  c = i;\n  i = 0;\n  while (i < c) {\n    printf(\"%d\", a[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28873", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100] = {0}, i = 0, j;\n  cin >> n;\n  do {\n    a[i] = n % 10;\n    n = n / 10;\n    i++;\n\n  } while (n != 0);\n  for (j = 0; j <= i - 1; j++) {\n    printf(\"%d\", a[j]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28874", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    n = 00001;\n  } else {\n    if (n >= 1000) {\n      a = n % 10;\n      b = (n - a) % 100 / 10;\n      d = n / 1000;\n      c = n / 100 - d * 10;\n      printf(\"%d\", a);\n      printf(\"%d\", b);\n      printf(\"%d\", c);\n      printf(\"%d\", d);\n    } else {\n      if (n >= 100) {\n        a = n % 10;\n        b = (n - a) % 100 / 10;\n        c = n / 100;\n        printf(\"%d\", a);\n        printf(\"%d\", b);\n        printf(\"%d\", c);\n      } else {\n        if (n >= 10) {\n          a = n % 10;\n          b = n / 10;\n          printf(\"%d\", a);\n          printf(\"%d\", b);\n        } else {\n          printf(\"%d\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = n / 10 % 10;\n  c = n / 100 % 10;\n  d = n / 1000 % 10;\n  if (n >= 10) {\n    if (n / 10 >= 10) {\n      if (n / 100 >= 10) {\n        if (n / 1000 < 10)\n          printf(\"%d%d%d%d\\n\", a, b, c, d);\n      } else {\n        printf(\"%d%d%d\\n\", a, b, c);\n      }\n    } else\n      printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "16", "index": "28876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10] = {0};\n  int b, i, n;\n  scanf(\"%d\", &b);\n  i = 0;\n  do {\n    a[i] = b % 10;\n    b = b / 10;\n    i++;\n  } while (b > 0);\n  n = i;\n  for (i = 0; i < n; i++)\n    printf(\"%d\", a[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28877", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  printf(\"%d\", n % 10);\n  if (n / 10 != 0)\n    printf(\"%d\", (n % 100) / 10);\n  if (n / 100 != 0)\n    printf(\"%d\", (n % 1000) / 100);\n  if (n / 1000 != 0)\n    printf(\"%d\", (n % 10000) / 1000);\n  if (n / 10000 != 0)\n    printf(\"%d\", n / 10000);\n}\n"}
{"label": "16", "index": "28878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, A, B, C, D, E;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = n / 100;\n    c = n / 10;\n    d = n % 10;\n    A = d;\n    B = c % 10;\n    C = b % 10;\n    D = a;\n    cout << A << B << C << D << endl;\n  } else if (n >= 100 && n < 1000) {\n    a = n / 100;\n    b = n / 10;\n    c = n % 10;\n    A = c;\n    B = b % 10;\n    C = a;\n    cout << A << B << C << endl;\n  } else if (n >= 10 && n < 100) {\n    A = n % 10;\n    B = n / 10;\n    cout << A << B << endl;\n  } else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[10];\n\nint main() {\n  int x;\n  int k = 0;\n  cin >> x;\n  if (x == 0)\n    cout << x << endl;\n  else {\n    while (x > 0) {\n      a[k++] = x % 10;\n      x = x / 10;\n    }\n    for (int i = 0; i < k; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[0] = n % 10, a[1] = (n / 10) % 10, a[2] = (n / 100) % 10,\n  a[3] = (n / 1000) % 10, a[4] = (n / 10000) % 10;\n  if (n < 10) {\n    cout << a[0];\n  } else if (n < 100 && n >= 10) {\n    cout << a[0] << a[1];\n  } else if (n < 1000 && n >= 100) {\n    cout << a[0] << a[1] << a[2];\n  } else if (n < 10000 && n >= 1000) {\n    cout << a[0] << a[1] << a[2] << a[3];\n  } else {\n    cout << a[0] << a[1] << a[2] << a[3] << a[4];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[5];\n  scanf(\"%d\", &n);\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - a[0] * 10000 - a[1] * 1000) / 100;\n  a[3] = (n - a[0] * 10000 - a[1] * 1000 - a[2] * 100) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  for (i = 0; i <= 4; i++) {\n    if (a[i]) {\n      for (j = 4; j >= i; j--)\n        printf(\"%d\", a[j]);\n      break;\n    }\n  }\n  if (a[0] + a[1] + a[2] + a[3] + a[4] == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = (n % 100 - n % 10) / 10;\n  c = (n % 1000 - n % 100) / 100;\n  d = (n % 10000 - n % 1000) / 1000;\n  e = (n - 1000 * d - 100 * c - 10 * b - a) / 10000;\n  if (e != 0) {\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  } else if (d != 0) {\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (c != 0) {\n    printf(\"%d%d%d\", a, b, c);\n  } else if (d != 0) {\n    printf(\"%d%d\", a, b);\n  } else {\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "28883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10;\n  c = a / 100;\n  d = a / 1000;\n  e = a / 10000;\n  if (e >= 1)\n    f = 5;\n  else if (d >= 1)\n    f = 4;\n  else if (c >= 1)\n    f = 3;\n  else if (b >= 1)\n    f = 2;\n  else\n    f = 1;\n  d = d - 10 * e;\n  c = c - 100 * e - 10 * d;\n  b = b - 1000 * e - 100 * d - 10 * c;\n  a = a - 10000 * e - 1000 * d - 100 * c - 10 * b;\n  switch (f) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", a, b);\n    break;\n  case 1:\n    printf(\"%d\\n\", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid f(int n) {\n  cout << n % 10;\n  n = n / 10;\n  if (n)\n    f(n);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  f(n);\n  return 0;\n}\n"}
{"label": "16", "index": "28885", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b = 0, i, j;\n  scanf(\"%d\", &a);\n  i = log10(a);\n  for (; a > 0;) {\n    b = b * 10 + a % 10;\n    a = a / 10;\n  }\n  j = log10(b);\n  for (; i > j; i--)\n    printf(\"0\");\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "28886", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, result = 1;\n  cin >> x;\n\n  if (!x)\n    printf(\"0\");\n  while (x) {\n    printf(\"%d\", x % 10);\n    x = x / 10;\n  }\n  printf(\"\\n\", result);\n  return 0;\n}\n"}
{"label": "16", "index": "28887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << n << endl;\n  else {\n    for (i = 1;; i++) {\n      a = n / 10;\n      b = n - (a * 10);\n      if (a == 0 && b == 0)\n        break;\n      cout << b;\n      n = a;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10];\n\nint main() {\n  int x;\n  int k = 0;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    printf(\"%d\\n\", x);\n  else {\n    while (x > 0) {\n      a[k++] = x % 10;\n      x = x / 10;\n    }\n    for (int i = 0; i < k; i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28889", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  cin >> n;\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n}\n"}
{"label": "16", "index": "28890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, decade, hundred, thousand;\n  cin >> n;\n  cout << n - n / 10 * 10;\n  if (n >= 10) {\n    decade = n / 10;\n    cout << decade - decade / 10 * 10;\n  }\n  if (n >= 100) {\n    hundred = decade / 10;\n    cout << hundred - hundred / 10 * 10;\n  }\n  if (n >= 1000) {\n    thousand = hundred / 10;\n    cout << thousand - thousand / 10 * 10;\n  }\n  if (n == 10000) {\n    cout << \"1\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28891", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int indiv, ten, hundred, thousand, ten_thousand, place;\n  cin >> n;\n  if (n > 9999)\n    place = 5;\n  else if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  ten_thousand = (int)(n / 10000);\n  thousand = (int)((n - ten_thousand * 10000) / 1000);\n  hundred = (int)((n - 10000 * ten_thousand - 1000 * thousand) / 100);\n  ten =\n      (int)((n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred) / 10);\n  indiv = (int)(n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred -\n                10 * ten);\n  switch (place) {\n  case 5:\n    cout << indiv << ten << hundred << thousand << ten_thousand << \"\\n\";\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\\n\", indiv);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28892", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10] = {0};\n  int b, i, n;\n  cin >> b;\n  i = 0;\n  do {\n    a[i] = b % 10;\n    b = b / 10;\n    i++;\n  } while (b > 0);\n  n = i;\n  for (i = 0; i < n; i++)\n    printf(\"%d\", a[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10] = {'\\0'};\n  cin.getline(str, 10);\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a % 10;\n  c = (a - b) / 10 % 10;\n  d = (a - b - 10 * c) / 100 % 10;\n  e = (a - b - 10 * c - 100 * d) / 1000 % 10;\n  f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000 % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\", b);\n  if (a >= 10 && a < 100)\n    printf(\"%d%d\", b, c);\n  if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\", b, c, d);\n  if (a >= 1000 && a < 10000)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  if (a >= 10000)\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  return 0;\n}\n"}
{"label": "16", "index": "28895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0;\n  scanf(\"%d\", &a);\n  int b[6] = {0, 0, 0, 0, 0, 0};\n  int c[5] = {-1, -1, -1, -1, -1};\n  b[0] = a;\n  int i;\n  for (i = 1; i < 5; i++) {\n    b[i] = b[i - 1] / 10;\n  }\n  for (i = 0; i < 5; i++) {\n    if (b[i] != 0) {\n      c[i] = b[i] - 10 * b[i + 1];\n      if (c[i] >= 0)\n        printf(\"%d\", c[i]);\n    }\n  }\n  if (a == 0)\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "28896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n\n  char a[10];\n  int i = 0;\n  int n;\n  while ((a[i] = getchar()) != '\\n')\n    i++;\n  n = i;\n  for (i = n; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "28897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  }\n  if ((n > 9) && (n < 100)) {\n    a = n / 10;\n    b = n % 10;\n    printf(\"%d%d\", b, a);\n  }\n  if ((n > 99) && (n < 1000)) {\n    a = n / 100;\n    b = (n - a * 100) / 10;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (n > 999) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k;\n  int a[4];\n  scanf(\"%d\", &n);\n  j = n;\n  if (j < 10)\n    k = 1;\n  if (j >= 10 && j < 100)\n    k = 2;\n  if (j >= 100 && j < 1000)\n    k = 3;\n  if (j >= 1000 && j < 10000)\n    k = 4;\n  a[3] = n / 1000;\n  a[2] = (n - a[3] * 1000) / 100;\n  a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  switch (k) {\n  case 1:\n    printf(\"%d\", a[0]);\n    break;\n  case 2:\n    cout << a[0] << a[1];\n    break;\n  case 3:\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char str1[100], str2[100];\n  int i, j, l;\n  cin >> str1;\n  l = strlen(str1);\n  j = 0;\n  for (i = l - 1; i >= 0; --i)\n    str2[j++] = str1[i];\n  str2[j] = '\\0';\n  cout << str2 << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28900", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint print(int n);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  print(n);\n  return 0;\n}\nint print(int n) {\n  int s, a, b;\n  a = n;\n  s = 0;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d \", &a);\n\n  if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    cout << a;\n  }\n}\n"}
{"label": "16", "index": "28902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a1, a2, a3, a4;\n  cin >> n;\n  a1 = n / 1000;\n  a2 = (n - 1000 * a1) / 100;\n  a3 = (n - 1000 * a1 - 100 * a2) / 10;\n  a4 = (n - 1000 * a1 - 100 * a2 - 10 * a3);\n  if (a1 == 0 & a2 == 0 & a3 == 0)\n    cout << a4;\n  if (a1 == 0 & a2 != 0)\n    printf(\"%d%d%d\", a4, a3, a2);\n  if (a1 != 0 & a2 != 0 & a3 != 0)\n    printf(\"%d%d%d%d\", a4, a3, a2, a1);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28903", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[5] = {0}, flag[5] = {0};\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  if (n != 0) {\n    for (i = 0; i < 5; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 5; i++) {\n      for (j = i; j < 5; j++)\n        flag[i] = flag[i] + a[j];\n    }\n    for (i = 0; i < 5; i++) {\n      if (flag[i] != 0)\n        printf(\"%d\", a[i]);\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28904", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if ((n >= 0) && (n <= 9))\n    printf(\"%d\", n);\n  else if ((n >= 10) && (n <= 99)) {\n    a = n % 10;\n    b = (n - (n % 10)) / 10;\n    printf(\"%d%d\", a, b);\n  } else if ((n >= 100) && (n <= 999)) {\n    a = n % 10;\n    b = ((n - a) % 100) / 10;\n    c = (n - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if ((n >= 1000) && (n <= 9999)) {\n    a = n % 10;\n    b = ((n - a) / 10) % 10;\n    c = ((n - a - 10 * b) / 100) % 10;\n    d = (n - a - 10 * b - 100 * c) / 1000;\n    cout << a << b << c << d;\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "28905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp, ge, shi, bai, qian;\n  cin >> num;\n  temp = num;\n  if (num == 10000)\n    printf(\"00001\\n\");\n  else if (num == 0)\n    cout << \"0\" << endl;\n  else {\n    qian = temp / 1000;\n    temp = temp - qian * 1000;\n    bai = temp / 100;\n    temp = temp - bai * 100;\n    shi = temp / 10;\n    ge = temp - shi * 10;\n    if (num >= 1 && num <= 9)\n      cout << ge << endl;\n    else if (num >= 10 && num <= 99)\n      cout << ge << shi << endl;\n    else if (num >= 100 && num <= 999)\n      cout << ge << shi << bai << \"\\n\";\n    else\n      cout << ge << shi << bai << qian << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28906", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, A, B, C, D, E;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = n / 100;\n    c = n / 10;\n    d = n % 10;\n    A = d;\n    B = c % 10;\n    C = b % 10;\n    D = a;\n    cout << A << B << C << D << endl;\n  } else if (n >= 100 && n < 1000) {\n    a = n / 100;\n    b = n / 10;\n    c = n % 10;\n    A = c;\n    B = b % 10;\n    C = a;\n    cout << A << B << C << endl;\n  } else if (n >= 10 && n < 100) {\n    A = n % 10;\n    B = n / 10;\n    printf(\"%d%d\\n\", A, B);\n  } else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a % 10;\n    c = a / 10;\n    d = 10 * b + c;\n    if (b == 0)\n      printf(\"0%d\", d);\n    else\n      printf(\"%d\", d);\n  } else if (a / 1000 == 0) {\n    b = a % 10;\n    c = a / 100;\n    d = a / 10 - 10 * c;\n    e = 100 * b + 10 * d + c;\n    if (b == 0)\n      if (d == 0)\n        printf(\"00%d\", e);\n      else\n        printf(\"0%d\", e);\n    else\n      printf(\"%d\", e);\n  } else if (a / 10000 == 0) {\n    b = a % 10;\n    c = a / 1000;\n    d = a / 100 - 10 * c;\n    e = a / 10 - 10 * d - 100 * c;\n    f = 1000 * b + 100 * e + 10 * d + c;\n    if (b == 0)\n      if (e == 0)\n        if (d == 0)\n          printf(\"000%d\", f);\n        else\n          printf(\"00%d\", f);\n      else\n        printf(\"0%d\", f);\n    else\n      printf(\"%d\", f);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "28908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n, b, c, d, e, f, g;\n  cin >> n;\n  b = 0;\n  a = n;\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      a = (int)(a / 10);\n      b = b + 1;\n    }\n  }\n  c = n % 10;\n  d = (int)(n / 10) % 10;\n  e = (int)(n / 100) % 10;\n  f = (int)(n / 1000) % 10;\n  g = (int)(n / 10000);\n  switch (b) {\n  case 1:\n    printf(\"%d\\n\", n);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", c, d);\n    break;\n  case 3:\n    cout << c << d << e << \"\\n\";\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", c, d, e, f);\n    break;\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", c, d, e, f, g);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28909", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int indiv, ten, hundred, thousand, ten_thousand, place;\n  cin >> n;\n  if (n > 9999)\n    place = 5;\n  else if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  ten_thousand = (int)(n / 10000);\n  thousand = (int)((n - ten_thousand * 10000) / 1000);\n  hundred = (int)((n - 10000 * ten_thousand - 1000 * thousand) / 100);\n  ten =\n      (int)((n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred) / 10);\n  indiv = (int)(n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred -\n                10 * ten);\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", indiv, ten, hundred, thousand, ten_thousand);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\\n\", indiv);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, a[5], j;\n  scanf(\"%d\", &b);\n  a[4] = b / 10000;\n  a[3] = (b - a[4] * 10000) / 1000;\n  a[2] = (b - a[4] * 10000 - a[3] * 1000) / 100;\n  a[1] = (b - a[4] * 10000 - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = b - a[4] * 10000 - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  if (b >= 10000)\n    for (j = 0; j <= 4; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 1000)\n    for (j = 0; j <= 3; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 100)\n    for (j = 0; j <= 2; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 10)\n    for (j = 0; j <= 1; j++)\n      printf(\"%d\", a[j]);\n  else\n    printf(\"%d\", a[0]);\n}\n"}
{"label": "16", "index": "28911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, num, k, a[6];\n\n  scanf(\"%d \", &num);\n  if (num == 0)\n    cout << num;\n  for (i = 5; i >= 0; i--) {\n    a[5 - i] = num / (pow((float)10, i));\n    num = num - a[5 - i] * pow((float)10, i);\n  }\n\n  for (i = 0; i < 6; i++) {\n\n    if (a[i] != 0)\n      break;\n  }\n\n  for (k = 5; k >= i; k--) {\n\n    printf(\"%d\", a[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a;\n  if (a >= 1000) {\n    b = a % 1000;\n    c = b % 100;\n    d = c % 10;\n    cout << d << (c - d) / 10 << (b - c) / 100 << (a - b) / 1000 << endl;\n  } else if (a < 1000 && a >= 100) {\n    b = a % 100;\n    c = b % 10;\n    cout << c << (b - c) / 10 << (a - b) / 100 << endl;\n  } else if (a < 100 && a >= 10) {\n    b = a & 10;\n    printf(\"%d%d\\n\", b, (a - b) / 10);\n  } else if (a >= 0 && a <= 9) {\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a != 0) {\n      b = a - a / 10 * 10;\n      a = a / 10;\n      printf(\"%d\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j, a[6] = {0};\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  while (n != 0) {\n    a[i++] = n % 10;\n    n /= 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "28915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0)\n    cout << a5 << endl;\n  else if (a1 == 0 && a2 == 0 && a3 == 0)\n    printf(\"%d%d\\n\", a5, a4);\n  else if (a1 == 0 && a2 == 0)\n    cout << a5 << a4 << a3 << endl;\n  else if (a1 == 0)\n    printf(\"%d%d%d%d\\n\", a5, a4, a3, a2);\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28916", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  else {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    a = b + 10 * c + 100 * d + 1000 * e;\n    if ((a % 10) == 0) {\n      a = a / 10;\n      if ((a % 10) == 0) {\n        a = a / 10;\n        if ((a % 10) == 0)\n          a = a / 10;\n      }\n    }\n    if (e == 0) {\n      printf(\"%d\", e);\n      if (d == 0) {\n        printf(\"%d\", d);\n        if (c == 0)\n          printf(\"%d\", c);\n      }\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i = 0;\n  scanf(\"%d\", &a);\n  if (a == 100)\n    printf(\"001\");\n  else {\n    while (a > 0) {\n      i = i * 10 + a % 10;\n      \n      a = a / 10;\n    }\n    printf(\"%d\", i);\n  }\n  return (0);\n}\n"}
{"label": "16", "index": "28918", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n >= 1000) {\n    int a[4];\n    a[0] = n / 1000;\n    a[1] = (n % 1000) / 100;\n    a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n    a[3] = n - a[0] * 1000 - a[1] * 100 - a[2] * 10;\n    for (i = 3; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 100) {\n    int a[3];\n    a[0] = n / 100;\n    a[1] = (n - a[0] * 100) / 10;\n    a[2] = n - a[0] * 100 - a[1] * 10;\n    for (i = 2; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 10) {\n    int a[2];\n    a[0] = n / 10;\n    a[1] = n - a[0] * 10;\n    for (i = 1; i >= 0; i--)\n      printf(\"%d\", a[i]);\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "28919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\\n\", n);\n\n  if (n >= 10 && n < 100) {\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\\n\", a, b);\n  }\n  if (n >= 100 && n < 1000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100;\n    printf(\"%d%d%d\\n\", a, b, c);\n  }\n  if (n >= 1000 && n < 10000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100 % 10;\n    d = (n - c * 100 - b * 10 - a) / 1000;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  }\n  if (n == 10000) {\n    printf(\"00001\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a = 0, i = 5, m = 0, b;\n  cin >> n;\n  do {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  } while (n != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "28921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    cout << d << c << b << a << \"\\n\";\n  } else {\n    if (n >= 100 && n < 1000) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n - a * 100 - b * 10;\n      printf(\"%d%d%d\\n\", c, b, a);\n    } else {\n      if (n >= 10 && n < 100) {\n        a = n / 10;\n        b = n - a * 10;\n        printf(\"%d%d\\n\", b, a);\n      } else {\n        if (n < 10) {\n          printf(\"%d\\n\", n);\n        } else {\n          printf(\"00001\\n\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  char x[6];\n\n  scanf(\"%s \", x);\n  int i;\n\n  for (i = 5; i >= 0; i--)\n    if (x[i] == '0' || x[i] == '1' || x[i] == '2' || x[i] == '3' ||\n        x[i] == '4' || x[i] == '5' || x[i] == '6' || x[i] == '7' ||\n        x[i] == '8' || x[i] == '9')\n      break;\n\n  for (int j = i; j >= 0; j--)\n    cout << x[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "28923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d\", &n);\n\n  if (n > 999) {\n    a = n / 1000;\n    b = n - a * 1000;\n    c = b / 100;\n    d = b - c * 100;\n    e = d / 10;\n    f = d - e * 10;\n\n    printf(\"%d\", f);\n    printf(\"%d\", e);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<1000 & n> 99) {\n    a = n / 100;\n    b = n - a * 100;\n    c = b / 10;\n    d = b - c * 10;\n\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<100 & n> 9) {\n    a = n / 10;\n    b = n - a * 10;\n\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  if (n < 10) {\n    a = n / 10;\n\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if ((a >= 1000) && (a < 9999)) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  if ((a >= 100) && (a < 999)) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if\n\n      ((a >= 10) && (a < 99)) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  }\n  if ((a >= 1) && (a < 9))\n    printf(\"%d\", a);\n  if (a == 0)\n    printf(\"0\");\n  if (a == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "28925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, t;\n  char c[10001];\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (c[i] != '\\0') {\n      n++;\n    } else\n      break;\n  }\n  if (n % 2 == 0) {\n    for (i = 0; i < n / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  } else {\n    for (i = 0; i < (n - 1) / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  }\n  printf(\"%s\", c);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "28926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a != 0) {\n      b = a - a / 10 * 10;\n      a = a / 10;\n      cout << b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, z, y;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    z = a % 100;\n    c = z / 10;\n    d = z % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    z = a % 1000;\n    c = z / 100;\n    y = z % 100;\n    d = y / 10;\n    e = y % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "28928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, h, i, j, n;\n\n  cin >> a;\n\n  if (a >= 10000) {\n    b = a / 10000;\n    c = a - b * 10000;\n    d = c / 1000;\n    e = c - d * 1000;\n    f = e / 100;\n    h = e - f * 100;\n    j = h / 10;\n    i = h - j * 10;\n    n = 10000 * i + 1000 * j + 100 * f + 10 * d + b;\n\n    printf(\"%05d\", n);\n  } else if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - d * 100;\n    f = e / 10;\n    h = e - f * 10;\n    n = 1000 * h + 100 * f + 10 * d + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else if (a >= 0)\n    cout << a;\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28929", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, w, c;\n  scanf(\"%d \", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  else if (n > 999)\n    w = 4;\n  else if (n > 99)\n    w = 3;\n  else if (n > 9)\n    w = 2;\n  else\n    printf(\"%d\", n);\n\n  for (i = 1; i < w + 1; i++) {\n    c = n % 10;\n    n = n / 10;\n\n    printf(\"%d\", c);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char a[5] = {'\\0', '\\0', '\\0', '\\0', '\\0'};\n  cin >> a;\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28931", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, h, i, j, n;\n\n  cin >> a;\n\n  if (a >= 10000) {\n    b = a / 10000;\n    c = a - b * 10000;\n    d = c / 1000;\n    e = c - d * 1000;\n    f = e / 100;\n    h = e - f * 100;\n    j = h / 10;\n    i = h - j * 10;\n    n = 10000 * i + 1000 * j + 100 * f + 10 * d + b;\n\n    printf(\"%05d\", n);\n  } else if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - d * 100;\n    f = e / 10;\n    h = e - f * 10;\n    n = 1000 * h + 100 * f + 10 * d + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else if (a >= 0)\n    printf(\"%d\", a);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  char b, c, d, e;\n  cin >> a;\n  b = (int)(a / 1000);\n  c = (int)((a - 1000 * b) / 100);\n  d = (int)(a / 10) - c * 10 - 100 * b;\n  e = a - 10 * d - 100 * c - 1000 * b;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  if (b == 0 && c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  if (a > 9 && a < 100)\n    printf(\"%d%d\", e, d);\n  if (a < 10)\n    cout << e;\n}\n"}
{"label": "16", "index": "28933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n > 9999) {\n    cout << \"00001\";\n  } else if (n > 999) {\n    printf(\"%d%d%d%d\", n % 1000 % 100 % 10, n % 1000 % 100 / 10, n % 1000 / 100,\n           n / 1000);\n  } else if (n > 99) {\n    printf(\"%d%d%d\", n % 100 % 10, n % 100 / 10, n / 100);\n  } else if (n > 9) {\n    printf(\"%d%d\", n % 10, n / 10);\n  } else {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, m, n, o, p;\n  cin >> x;\n  m = x / 10000;\n  n = x / 1000;\n  o = x / 100;\n  p = x / 10;\n  if (m != 0) {\n    a = m;\n    b = n - 10 * a;\n    c = o - 100 * a - 10 * b;\n    d = p - 1000 * a - 100 * b - 10 * c;\n    e = x % 10;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (n != 0) {\n    a = n;\n    b = o - 10 * a;\n    c = p - 100 * a - 10 * b;\n    d = x % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (o != 0) {\n    a = o;\n    b = p - 10 * o;\n    c = x % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (p != 0) {\n    a = p;\n    b = x % 10;\n    printf(\"%d%d\", b, a);\n  } else {\n    cout << x;\n  }\n}\n"}
{"label": "16", "index": "28935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[10];\n\n  int i;\n  while (cin >> n) {\n    if (n == 0)\n      cout << 0;\n\n    for (i = 1; i <= 5 && n != 0; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n      printf(\"%d\", a[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = x % 100;\n  c = x % 1000;\n  d = x % 10000;\n  e = (b - a) / 10;\n  f = (c - b) / 100;\n  g = (d - c) / 1000;\n  if (x < 10)\n    cout << a << \"\\n\";\n  else if (x < 100)\n    cout << a << e << \"\\n\";\n  else if (x < 1000)\n    printf(\"%d%d%d\\n\", a, e, f);\n  else\n    printf(\"%d%d%d%d\\n\", a, e, f, g);\n  return 0;\n}\n"}
{"label": "16", "index": "28937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid reverse(char s[], int a, int b) {\n  int i, j;\n  char temp;\n  for (i = a, j = b - 1; i < j; i++, j--) {\n    temp = s[i];\n    s[i] = s[j];\n    s[j] = temp;\n  }\n  for (i = a; i < b; i++)\n    printf(\"%c\", s[i]);\n\n  printf(\" \");\n}\n\nint main() {\n  char string[10];\n  int len;\n  scanf(\"%s \", string);\n  len = strlen(string);\n  reverse(string, 0, len);\n  return 0;\n}\n"}
{"label": "16", "index": "28938", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, e;\n  cin >> e;\n  while (1000 * a <= e - 1000) {\n    a++;\n  }\n  while (1000 * a + 100 * b <= e - 100) {\n    b++;\n  }\n  while (1000 * a + 100 * b + 10 * c <= e - 10) {\n    c++;\n  }\n  d = e - 10 * c - 100 * b - 1000 * a;\n  if (a > 0) {\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (b > 0) {\n      printf(\"%d%d%d\", d, c, b);\n    } else {\n      if (c > 0) {\n        printf(\"%d%d\", d, c);\n      } else {\n        printf(\"%d\", d);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "28939", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i;\n  scanf(\"%d \", &i);\n  while (i) {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, m;\n  scanf(\"%d\\n\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (n != 0 && n % 10 == 0)\n    cout << \"0\";\n  if (n != 0 && n % 100 == 0)\n    printf(\"0\");\n  if (a != 0)\n    m = e * 10000 + d * 1000 + c * 100 + b * 10 + a;\n  else if (b != 0)\n    m = e * 1000 + d * 100 + c * 10 + b;\n  else if (c != 0)\n    m = e * 100 + d * 10 + c;\n  else if (d != 0)\n    m = e * 10 + d;\n  else if (e != 0)\n    m = e;\n  else\n    m = 0;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "16", "index": "28941", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, i;\n  cin >> n;\n  if (n == 0)\n    cout << n << endl;\n  else {\n    for (i = 1;; i++) {\n      a = n / 10;\n      b = n - (a * 10);\n      if (a == 0 && b == 0)\n        break;\n      cout << b;\n      n = a;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, m;\n  scanf(\"%d \", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (n != 0 && n % 10 == 0)\n    printf(\"0\");\n  if (n != 0 && n % 100 == 0)\n    cout << \"0\";\n  if (a != 0)\n    m = e * 10000 + d * 1000 + c * 100 + b * 10 + a;\n  else if (b != 0)\n    m = e * 1000 + d * 100 + c * 10 + b;\n  else if (c != 0)\n    m = e * 100 + d * 10 + c;\n  else if (d != 0)\n    m = e * 10 + d;\n  else if (e != 0)\n    m = e;\n  else\n    m = 0;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "16", "index": "28943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  printf(\"%d\", b);\n  a = a / 10;\n  if (a != 0) {\n    b = a % 10;\n    printf(\"%d\", b);\n    a = a / 10;\n    if (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n      if (a != 0) {\n        b = a % 10;\n        printf(\"%d\", b);\n        a = a / 10;\n        if (a != 0) {\n          b = a % 10;\n          printf(\"%d\", b);\n          a = a / 10;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[5];\n  memset(a, ' ', sizeof(a));\n  cin.getline(a, 5);\n  for (i = 5; i >= 0; i--) {\n    if (a[i] == '0' || a[i] == '1' || a[i] == '2' || a[i] == '3' ||\n        a[i] == '4' || a[i] == '5' || a[i] == '6' || a[i] == '7' ||\n        a[i] == '8' || a[i] == '9')\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else {\n    if (c != 0)\n      cout << e << d << c;\n    else {\n      if (d != 0)\n        printf(\"%d%d\", e, d);\n      else\n        printf(\"%d\", e);\n    }\n  }\n}\n"}
{"label": "16", "index": "28946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[10] = {0};\n  int i, s = 0;\n\n  scanf(\"%s \", ch);\n  i = 0;\n  while (ch[i] != '\u0000') {\n    s = i;\n    i++;\n  }\n  for (i = s; i >= 0; i--)\n    cout << ch[i];\n}\n"}
{"label": "16", "index": "28947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 9) {\n    printf(\"%d\", n);\n  }\n  if (10 <= n && n <= 99) {\n    a = n / 10;\n    b = n - a;\n    printf(\"%d%d\", b, a);\n  }\n  if (100 <= n && n <= 999) {\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (1000 <= n && n <= 9999) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = x % 10;\n  printf(\"%d\", e);\n  if (d || c || b || a)\n    printf(\"%d\", d);\n  if (c || b || a)\n    printf(\"%d\", c);\n  if (b || a)\n    printf(\"%d\", b);\n  if (a)\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "28949", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"1\");\n  else {\n    do {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = (n - a) / 10;\n    } while (n >= 10);\n    a = n;\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  int num, temp = 0, sub = 0, dv = 10;\n  ;\n  cin >> num;\n  int a, b = 1;\n\n  if (num == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (num != sub) {\n    temp = (num - (num / dv) * dv - sub) / (dv / 10);\n    sub += temp * (dv / 10);\n\n    printf(\"%d\", temp);\n    dv *= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "28951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ace, a, b, c, d;\n  scanf(\"%d\", &ace);\n  a = (int)(ace / 1000);\n  b = (int)((ace - 1000 * a) / 100);\n  c = (int)((ace - 1000 * a - 100 * b) / 10);\n  d = (ace - 1000 * a - 100 * b - 10 * c);\n\n  if (ace >= 1000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (ace >= 100)\n    printf(\"%d%d%d\", d, c, b);\n  else if (ace >= 10)\n    printf(\"%d%d\", d, c);\n  else\n    printf(\"%d\", d);\n}\n"}
{"label": "16", "index": "28952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, x, y, z, n, b, place;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    place = 5;\n  if (a > 999)\n    place = 4;\n  else if (a > 999)\n    place = 4;\n  else {\n    if (a > 99)\n      place = 3;\n    else if (a > 9)\n      place = 2;\n    else\n      place = 1;\n  }\n  n = a / 1000;\n  x = a / 100 % 10;\n  y = a / 10 % 10;\n  z = a % 10;\n  switch (place) {\n  case 5:\n    printf(\"00001\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", z, y, x, n);\n    break;\n\n  case 3:\n    printf(\"%d%d%d\", z, y, x);\n    break;\n\n  case 2:\n    printf(\"%d%d\", z, y);\n    break;\n  case 1:\n    printf(\"%d\", z);\n    break;\n  }\n}\n"}
{"label": "16", "index": "28953", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, i;\n  scanf(\"%d \", &i);\n  if (i / 10 == 0) {\n    cout << i << endl;\n  }\n  if (i / 100 == 0 && i / 10 != 0) {\n    a = i / 10;\n    b = i - a * 10;\n    cout << b << a << endl;\n  }\n  if (i / 1000 == 0 && i / 100 != 0) {\n    a = i / 100;\n    b = (i - a * 100) / 10;\n    c = i - a * 100 - b * 10;\n    cout << c << b << a << endl;\n  }\n  if (i / 10000 == 0 && i / 1000 != 0) {\n    a = i / 1000;\n    b = (i - a * 1000) / 100;\n    c = (i - a * 1000 - b * 100) / 10;\n    d = i - a * 1000 - b * 100 - c * 10;\n    cout << d << c << b << a << endl;\n  }\n  if (i / 10000 != 0) {\n    a = i / 10000;\n    b = (i - a * 10000) / 1000;\n    c = (i - a * 10000 - b * 1000) / 100;\n    d = (i - a * 10000 - b * 1000 - c * 100) / 10;\n    e = i - a * 10000 - b * 1000 - c * 100 - d * 10;\n    cout << e << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[50];\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 3; i >= 0; i--) {\n    if (n / ((int)(pow(10.0, i)))) {\n      for (int j = i; j >= 0; j--) {\n        a[j] = (int)n / (int)(pow(10.0, j));\n        n = n - a[j] * pow(10.0, j);\n      }\n      for (int k = 0; k <= i; k++) {\n        cout << a[k];\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a, b, c, d, e, place;\n  cin >> k;\n  if (k > 9999)\n    place = 5;\n  else if (k > 999)\n    place = 4;\n  else if (k > 99)\n    place = 3;\n  else if (k > 9)\n    place = 2;\n  else\n    place = 1;\n  switch (place) {\n  case 1:\n    printf(\"%d\\n\", k);\n    break;\n  case 2:\n    d = k / 10;\n    e = k - d * 10;\n    cout << e << d << \"\\n\";\n    break;\n  case 3:\n    c = k / 100;\n    d = (k - c * 100) / 10;\n    e = k - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 4:\n    b = k / 1000;\n    c = (k - b * 1000) / 100;\n    d = (k - b * 1000 - c * 100) / 10;\n    e = k - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n    break;\n  case 5:\n    a = k / 10000;\n    b = (k - a * 10000) / 1000;\n    c = (k - a * 10000 - b * 1000) / 100;\n    d = (k - a * 10000 - b * 1000 - c * 100) / 10;\n    e = k - a * 10000 - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, s;\n  cin >> n;\n  if (n == 0)\n    cout << \"0\";\n  else {\n    for (int i = 10; i <= 100000; i *= 10) {\n      t = n % i;\n      s = t * 10 / i;\n      if (s <= 9 && n != 0) {\n        cout << s;\n        n -= t;\n      } else\n        break;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = a / 100 - (a / 1000) * 10;\n  e = a / 10 - (a / 100) * 10;\n  f = a - (a / 10) * 10;\n  if (b != 0) {\n    g = f * 10000 + e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%05d\", g);\n  } else if (c != 0) {\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%04d\", g);\n  } else if (d != 0) {\n    g = f * 100 + e * 10 + d;\n    printf(\"%03d\", g);\n  } else if (e != 0) {\n    g = f * 10 + e;\n    printf(\"%01d\", g);\n  } else {\n    g = f;\n    cout << g;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28958", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int a, c, d;\n  scanf(\"%d\", &a);\n  c = a;\n  while (c >= 1) {\n    d = c - (c / 10) * 10;\n    c = c / 10;\n    printf(\"%d\", d);\n  }\n  if (a == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    a = n % 10;\n    printf(\"%d\", a);\n    n = (n - a) / 10;\n    if (n == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x == 10000)\n    printf(\"00001\");\n  else if (x < 10000 && x >= 1000) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = ((x - a - 10 * b) / 100) % 10;\n    d = (x - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (x < 1000 && x >= 100) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = (x - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x < 100 && x >= 10) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else\n    cout << x;\n  return 0;\n}\n"}
{"label": "16", "index": "28961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10000] = {0}, *start, *end, t;\n  int len;\n  scanf(\"%s \", str);\n  len = strlen(str);\n  start = str;\n  end = &str[len - 1];\n  while (start < end) {\n    t = *start;\n    *start = *end;\n    *end = t;\n    start++;\n    end--;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "16", "index": "28962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char exp[10], t;\n  int i, j;\n  cin.getline(exp, 10);\n  for (i = 0, j = strlen(exp) - 1; i < j; i++, j--) {\n    t = exp[i];\n    exp[i] = exp[j];\n    exp[j] = t;\n  }\n  for (i = 0; i < strlen(exp); i++)\n    cout << exp[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "28963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  int k, count = 0;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "16", "index": "28964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e;\n  scanf(\"%d\", &num);\n  a = num / 10000;\n  b = num % 10000 / 1000;\n  c = num % 1000 / 100;\n  d = num % 100 / 10;\n  e = num % 10;\n  if (num / 10000 == 1)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (num / 1000 != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (num / 100 != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (num / 10 != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "28965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[5];\n  cin >> n;\n  i = 1;\n  if (n == 0)\n    printf(\"0\");\n  while (n > 0) {\n    a[i] = n % 10;\n    n = n / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "28966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, c, b;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; i <= n;) {\n    i = i * 10;\n    c = n % i;\n    n = n - c;\n    b = c * 10 / i;\n    cout << b;\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "28967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[5];\n  int i, j;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  if (a[4] == 0 && a[3] == 0 && a[2] == 0 && a[1] == 0)\n    printf(\"%d\", a[0]);\n  else if (a[4] == 0 && a[3] == 0 && a[2] == 0)\n    printf(\"%d%d\", a[0], a[1]);\n  else if (a[4] == 0 && a[3] == 0)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (a[4] == 0)\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n  else\n    printf(\"%d%d%d%d%d\", a[0], a[1], a[2], a[3], a[4]);\n  return 0;\n}\n"}
{"label": "16", "index": "28968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a % 10;\n  if (b != 0) {\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c != 0) {\n\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d != 0) {\n\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e != 0) {\n\n          printf(\"%d%d\", f, e);\n        } else\n          printf(\"%d\", f);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "28969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, r;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = (x / 10) % 10;\n  c = (x / 100) % 10;\n  d = (x / 1000) % 10;\n  e = (x / 10000) % 10;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        if (b == 0) {\n          r = a;\n          printf(\"%d\\n\", r);\n        } else {\n          r = a * 10 + b;\n          printf(\"%02d\\n\", r);\n        }\n      } else {\n        r = a * 100 + b * 10 + c;\n        printf(\"%03d\\n\", r);\n      }\n    } else {\n      r = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", r);\n    }\n  } else {\n    r = a * 10000 + b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%05d\\n\", r);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[10];\n  cin >> n;\n  if (n == 0)\n    cout << \"0\";\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j];\n}\n"}
{"label": "16", "index": "28971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 1000 != 0) {\n    a = n / 1000;\n    n = n - 1000 * a;\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d\", d, c, b);\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d\", d, c);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "28972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, t;\n  scanf(\"%d\", &n);\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    x = n % 10;\n    if (n <= 99) {\n      y = (n - x) / 10;\n      printf(\"%d%d\", x, y);\n    } else {\n      y = ((n - x) / 10) % 10;\n      t = x + 10 * y;\n      if (n <= 999) {\n        z = (n - t) / 100;\n        printf(\"%d%d%d\", x, y, z);\n      } else {\n        z = ((n - t) / 100) % 10;\n        t = x + 10 * y + 100 * z;\n        if (n <= 9999) {\n          w = (n - t) / 1000;\n          printf(\"%d%d%d%d\", x, y, z, w);\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[10];\n  cin >> n;\n  a[0] = n % 10;\n  a[1] = (n % 100) / 10;\n  a[2] = (n % 1000) / 100;\n  a[3] = (n % 10000) / 1000;\n  if (n < 10 && n >= 0)\n    cout << n;\n  else if (n < 100 && n >= 10)\n    cout << a[0] << a[1];\n  else if (n < 1000 && n >= 100)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (n < 10000 && n >= 1000)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "28974", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint num[10];\nint main() {\n  int i, t = 0;\n  memset(num, -1, sizeof(num));\n  cin >> n;\n  int x = n;\n  num[0] = 0;\n  while (n > 0) {\n    num[t] = n % 10;\n    n -= n % 10;\n    n /= 10;\n    t++;\n  }\n  for (i = 0; i < t; ++i) {\n    printf(\"%d\", num[i]);\n  }\n  if (x == 0)\n    cout << 0;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int num;\n  cin >> num;\n  if (num == 10000) {\n    cout << \"00001\";\n  } else if (num < 10000 && num > 999) {\n    d = num / 1000;\n    c = num / 100 - d * 10;\n    b = num / 10 - d * 100 - c * 10;\n    a = num % 10;\n    cout << a << b << c << d;\n  } else if (num < 1000 && num > 99) {\n    c = num / 100;\n    b = num / 10 - c * 10;\n    a = num % 10;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (num < 100 && num > 9) {\n    b = num / 10;\n    a = num - b * 10;\n    cout << a << b;\n  } else {\n    cout << num;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int a, c, d;\n  scanf(\"%d \", &a);\n  c = a;\n  while (c >= 1) {\n    d = c - (c / 10) * 10;\n    c = c / 10;\n    cout << d;\n  }\n  if (a == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "28977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid f(int n) {\n  cout << n % 10;\n  n = n / 10;\n  if (n)\n    f(n);\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  f(n);\n  return 0;\n}\n"}
{"label": "16", "index": "28978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, weishu;\n  int ge, shi, bai, qian;\n  scanf(\"%d\", &n);\n  if ((0 <= n) && (n <= 9))\n    printf(\"%d\\n\", n);\n  if ((10 <= n) && (n <= 99)) {\n    ge = n % 10;\n    shi = n / 10;\n    printf(\"%d%d\", ge, shi);\n  }\n  if ((100 <= n) && (n <= 999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = n / 100;\n    printf(\"%d%d%d\", ge, shi, bai);\n  }\n  if ((1000 <= n) && (n <= 9999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = ((n - shi * 10) / 100) % 10;\n    qian = (n - bai * 100) / 1000;\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n  }\n}\n"}
{"label": "16", "index": "28979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n\n  if (a > 9) {\n    if (a > 99) {\n      if (a > 999) {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        e = ((a - b - c - d) % 10000) / 1000;\n        printf(\"%d%d%d%d\", b, c, d, e);\n      } else {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        printf(\"%d%d%d\", b, c, d);\n      }\n    } else {\n      b = a % 10;\n      c = ((a - b) % 100) / 10;\n      printf(\"%d%d\", b, c);\n    }\n  } else {\n    b = a % 10;\n    cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28980", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc) {\n  int i, n, c, b, a[10];\n  cin >> n;\n  b = 1;\n  i = 0;\n  while (b != 0) {\n    a[i] = n % 10;\n    b = n / 10;\n    n = b;\n    i++;\n  }\n  c = i;\n  i = 0;\n  while (i < c) {\n    printf(\"%d\", a[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28981", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i;\n  char s[20];\n  printf(\"\\n\");\n  scanf(\"%d \", &i);\n  sprintf(s, \"%d\", i);\n  for (i = strlen(s) - 1; i >= 0; i--) {\n    printf(\"%c\", s[i]);\n  }\n  puts(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "28982", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a < 10)\n    cout << a5 << endl;\n  else if (a < 100)\n    cout << a5 << a4 << endl;\n  else if (a < 1000)\n    cout << a5 << a4 << a3 << endl;\n  else if (a < 10000)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "28983", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n % 100) / 10;\n  d = n % 10;\n\n  if (n / 1000 != 0)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (n / 100 != 0)\n    printf(\"%d%d%d\", d, c, b);\n  else if (n / 10 != 0)\n    printf(\"%d%d\", d, c);\n  else\n    printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int w, a = 0, b = 0, c = 0, d = 0, e = 0, x;\n  cin >> n;\n  a = n % 10;\n  x = n / 10;\n  if (x == 0)\n    w = 1;\n  else {\n    {\n      b = x % 10;\n      x = x / 10;\n    }\n    if (x == 0)\n      w = 2;\n    else {\n      {\n        c = x % 10;\n        x = x / 10;\n      }\n      if (x == 0) {\n        w = 3;\n      } else {\n        {\n          d = x % 10;\n          x = x / 10;\n        }\n        if (x == 0)\n          w = 4;\n        else {\n          w = 5;\n          e = x % 10;\n        }\n      }\n    }\n  }\n  switch (w) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a, b, c, d, e);\n    break;\n  case 4:\n    cout << a << b << c << d << \" \";\n    break;\n  case 3:\n    printf(\"%d%d%d \", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d \", a, b);\n    break;\n  case 1:\n    printf(\"%d \", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a << endl;\n  else if (b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else if (c != 0)\n    cout << e << d << c << endl;\n  else if (d != 0)\n    printf(\"%d%d\\n\", e, d);\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28986", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, flag;\n  flag = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n != 0) {\n      flag++;\n      a[flag] = n % 10;\n      n = n / 10;\n    }\n    for (int i = 1; i <= flag; i++)\n      printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p;\n  cin >> n;\n  p = 0;\n  cout << (n % 10);\n  while (n > 9) {\n    p = (n - (n % 10)) / 10;\n    n = p;\n    cout << (n % 10);\n  }\n}\n"}
{"label": "16", "index": "28988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  cin.getline(a, 100);\n  int i;\n  int l = strlen(a);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "28989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - b * 100) / 10;\n  d = n - 1000 * a - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        cout << d << endl;\n      } else {\n        cout << d << c << endl;\n      }\n    } else {\n      cout << d << c << b << endl;\n    }\n  } else {\n    cout << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  char b, c, d, e;\n  cin >> a;\n  b = (int)(a / 1000);\n  c = (int)((a - 1000 * b) / 100);\n  d = (int)(a / 10) - c * 10 - 100 * b;\n  e = a - 10 * d - 100 * c - 1000 * b;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  if (b == 0 && c != 0)\n    cout << e << d << c;\n  if (a > 9 && a < 100)\n    printf(\"%d%d\", e, d);\n  if (a < 10)\n    cout << e;\n}\n"}
{"label": "16", "index": "28991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len;\n  char str[6];\n\n  cin >> str;\n  len = strlen(str);\n  for (int i = len - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "28992", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char num[100];\n  int k = -1;\n  cin >> num[0];\n  for (int i = 1; num[i - 1] != '\\n'; i++, k++) {\n    cin.get(num[i]);\n  }\n  for (; k >= 0; k--) {\n    cout << num[k];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "28993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, m;\n  scanf(\"%d \", &n);\n  x = n % 10;\n  y = (n % 100 - n % 10) / 10;\n  z = (n % 1000 - n % 100) / 100;\n  m = n / 1000;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"01\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 10000)\n    printf(\"00001\");\n  else if (n > 10 && n < 100)\n    cout << x << y;\n  else if (n > 100 && n < 1000)\n    printf(\"%d%d%d\", x, y, z);\n  else if (n > 1000 && n < 10000)\n    printf(\"%d%d%d%d\", x, y, z, m);\n  return 0;\n}\n"}
{"label": "16", "index": "28994", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - a * 10;\n  c = n / 10 - a * 100 - b * 10;\n  d = n % 10;\n  cout << d;\n  if (a != 0 || b != 0 || c != 0)\n    cout << c;\n  if (a != 0 || b != 0)\n    printf(\"%d\", b);\n  if (a != 0)\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "28995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, len = 0, i = 0;\n  char *p = NULL;\n  char a[10000];\n  cin.getline(a, 10000);\n  len = strlen(a);\n  p = &a[len - 1];\n  for (i = 0; i <= len - 1; i++)\n    cout << *(p - i);\n  return 0;\n}\n"}
{"label": "16", "index": "28996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, b;\n  scanf(\"%d\", &a);\n  a1 = a / 1000;\n  b = a - a1 * 1000;\n  a2 = b / 100;\n  b = b - a2 * 100;\n  a3 = b / 10;\n  a4 = b - a3 * 10;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000;\n  if (a > 999) {\n    if (b > 999)\n      printf(\"%d\\n\", b);\n    else if (b > 99)\n      printf(\"0%d\\n\", b);\n    else if (b > 9)\n      printf(\"00%d\\n\", b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (a > 99) {\n    b = b / 10;\n    if (b > 99)\n      printf(\"%d\\n\", b);\n    else if (b > 9)\n      printf(\"0%d\\n\", b);\n    else\n      printf(\"00%d\\n\", b);\n  } else if (a > 9) {\n    b = b / 100;\n    if (b > 9)\n      printf(\"%d\\n\", b);\n    else\n      printf(\"0%d\\n\", b);\n  } else {\n    b = b / 1000;\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28997", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[6];\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", n);\n  else\n    while (n > 0) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      cout << a[i];\n      i++;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "28998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int w, a = 0, b = 0, c = 0, d = 0, e = 0, x;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  x = n / 10;\n  if (x == 0)\n    w = 1;\n  else {\n    {\n      b = x % 10;\n      x = x / 10;\n    }\n    if (x == 0)\n      w = 2;\n    else {\n      {\n        c = x % 10;\n        x = x / 10;\n      }\n      if (x == 0)\n        w = 3;\n      else {\n        {\n          d = x % 10;\n          x = x / 10;\n        }\n        if (x == 0)\n          w = 4;\n        else {\n          w = 5;\n          e = x % 10;\n        }\n      }\n    }\n  }\n  switch (w) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a, b, c, d, e);\n    break;\n  case 4:\n    cout << a << b << c << d << \" \";\n    break;\n  case 3:\n    printf(\"%d%d%d \", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d \", a, b);\n    break;\n  case 1:\n    printf(\"%d \", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "28999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[10000];\n  int i = 0, t = 0;\n  scanf(\"%d \", &n);\n  num[0] = n % 10;\n\n  while (n / 10 != 0) {\n    t = t + 1;\n    num[t] = (n / 10) % 10;\n    n = n / 10;\n  }\n\n  for (i; i <= t; i++)\n    printf(\"%d\", num[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - 100 * b) / 10;\n  d = n % 10;\n  if (n < 10)\n    cout << n << \" \";\n  else if (n < 100)\n    printf(\"%d%d \", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d \", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d \", d, c, b, a);\n}\n"}
{"label": "16", "index": "29001", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l;\n  char s[4], r[4];\n  scanf(\"%s \", s);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    r[i] = s[l - 1 - i];\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%c\", r[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  i = (n % 10) * 10 + (n - n % 10) / 10;\n  j = (n % 10) * 100 + (n % 100 - n % 10) + (n - n % 100) / 100;\n  k = (n % 10) * 1000 + (n % 100 - n % 10) * 10 + (n % 1000 - n % 100) / 10 +\n      (n - n % 1000) / 1000;\n  if (n % 10 == n)\n    cout << n;\n  else if (n % 100 == n)\n    printf(\"%02d\", i);\n  else if (n % 1000 == n)\n    printf(\"%03d\", j);\n  else\n    printf(\"%04d\", k);\n  return 0;\n}\n"}
{"label": "16", "index": "29003", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[50];\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 3; i >= 0; i--) {\n    if (n / ((int)(pow(10.0, i)))) {\n      for (int j = i; j >= 0; j--) {\n        a[j] = (int)n / (int)(pow(10.0, j));\n        n = n - a[j] * pow(10.0, j);\n      }\n      for (int k = 0; k <= i; k++)\n        cout << a[k];\n\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d\", &n);\n\n  if (n > 999) {\n    a = n / 1000;\n    b = n - a * 1000;\n    c = b / 100;\n    d = b - c * 100;\n    e = d / 10;\n    f = d - e * 10;\n\n    printf(\"%d\", f);\n    printf(\"%d\", e);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<1000 & n> 99) {\n    a = n / 100;\n    b = n - a * 100;\n    c = b / 10;\n    d = b - c * 10;\n\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<100 & n> 9) {\n    a = n / 10;\n    b = n - a * 10;\n\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  if (n < 10) {\n    a = n / 10;\n\n    printf(\"%d\", n);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, b, c;\n  scanf(\"%d \", &n);\n  b = n;\n  c = n;\n  if (n < 10) {\n    cout << n;\n  } else {\n    int length = 1, k = 10;\n    while ((c / k) != 0) {\n      length++;\n      k = k * 10;\n    }\n    for (int i = 1; i <= length; i++) {\n      cout << b % 10;\n      b = (b - b % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29006", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d \", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0)\n    printf(\"%d%d\", a % 10, a / 10);\n  else if (a / 1000 == 0)\n    printf(\"%d%d%d\", a % 10, a % 100 / 10, a / 100);\n  else\n    printf(\"%d%d%d%d\", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "29007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, a[5], j;\n  scanf(\"%d\", &b);\n  a[4] = b / 10000;\n  a[3] = (b - a[4] * 10000) / 1000;\n  a[2] = (b - a[4] * 10000 - a[3] * 1000) / 100;\n  a[1] = (b - a[4] * 10000 - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = b - a[4] * 10000 - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  if (b >= 10000)\n    for (j = 0; j <= 4; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 1000)\n    for (j = 0; j <= 3; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 100)\n    for (j = 0; j <= 2; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 10)\n    for (j = 0; j <= 1; j++)\n      printf(\"%d\", a[j]);\n  else\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "29008", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i;\n  for (i = 0; i <= 5; i++) {\n    scanf(\"%c \", &a[i]);\n    if ((int)(a[i]) == 10)\n      break;\n  }\n  for (; i >= 1; i--) {\n    cout << a[i - 1];\n  }\n}\n"}
{"label": "16", "index": "29009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100001];\n  scanf(\"%s \", a);\n  int l = strlen(a), i = 0;\n  for (i = l - 1; i >= 0; i--) {\n    cout << a[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    cout << a[i];\n    if (n == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, e;\n  scanf(\"%d\", &e);\n  while (1000 * a <= e - 1000) {\n    a++;\n  }\n  while (1000 * a + 100 * b <= e - 100) {\n    b++;\n  }\n  while (1000 * a + 100 * b + 10 * c <= e - 10) {\n    c++;\n  }\n  d = e - 10 * c - 100 * b - 1000 * a;\n  if (a > 0) {\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (b > 0) {\n      printf(\"%d%d%d\", d, c, b);\n    } else {\n      if (c > 0) {\n        cout << d << c;\n      } else {\n        printf(\"%d\", d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, k, sum = 1, A[5]; \n  cin >> n;\n  k = n;\n  while (k >= 10) \n  {\n    k = k / 10;\n    sum = sum + 1;\n  }\n  for (i = 0; i < sum; i++) \n  {\n    A[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < sum; i++) \n    cout << A[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    cout << a << b;\n  } else if (n < 1000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    cout << a << c << d;\n  } else if (n < 10000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    e = d % 10;\n    f = d / 10;\n    cout << a << c << e << f;\n  } else if (n == 10000)\n    cout << 00001;\n  return 0;\n}\n"}
{"label": "16", "index": "29014", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[100] = {0}, i = 0, j;\n  cin >> n;\n  do {\n    a[i] = n % 10;\n    n = n / 10;\n    i++;\n\n  } while (n != 0);\n  for (j = 0; j <= i - 1; j++) {\n    cout << a[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000 && a <= 9999) {\n    c = a / 1000;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100 && a <= 999) {\n    c = 0;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 100 + e * 10 + d * 1 + c;\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a >= 10 && a <= 99) {\n    c = 0;\n    d = 0;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 10 + e;\n    printf(\"%d%d\", f, e);\n  } else {\n    g = a;\n    printf(\"%d\", g);\n  }\n}\n"}
{"label": "16", "index": "29016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n;\n  int p[6], i = 0, j = 0, k = 0;\n  while ((n = cin.get()) != '\\n') {\n    k = n - '0';\n    p[i] = k;\n    i++;\n  }\n  for (j = (i - 1); j >= 0; j = j - 1) {\n    cout << p[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - a % 10) / 10;\n  d = (a % 1000 - a % 100) / 100;\n  e = (a - a % 1000) / 1000;\n  if (e)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  else if (d)\n    printf(\"%d%d%d\", b, c, d);\n  else if (c)\n    printf(\"%d%d\", b, c);\n  else\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"1\");\n  else {\n    do {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = (n - a) / 10;\n    } while (n >= 10);\n    a = n;\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29019", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  while (n > 0) {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  }\n}\n"}
{"label": "16", "index": "29020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, k, s;\n  scanf(\"%d \", &n);\n  i = n;\n  s = 0;\n  while (i > 0) {\n    k = i % 10;\n    if (k == 0)\n      cout << \"0\", i /= 10;\n    else {\n      i = i / 10;\n      s = s * 10 + k;\n    }\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "29021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5], i, j, t;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  t = 1;\n  for (i = 0; i < 5; i++) {\n    t = (int)(pow(10, i + 1) + 0.5);\n    a[i] = 10 * (n % t) / t;\n    n = n - a[i] * t / 10;\n  }\n  i = 4;\n  while (a[i] == 0) {\n    i = i - 1;\n  }\n  for (j = 0; j <= i; j++)\n    cout << a[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], n, i;\n  cin >> n;\n  if (n == 10000) {\n    cout << 00001 << endl;\n  } else {\n    b[0] = n;\n    for (i = 0; i < 4; i++) {\n      a[i] = b[i] / pow(10.0, (double)(3 - i));\n      b[i + 1] = b[i] % (int)(pow(10.0, (double)(3 - i)));\n    }\n    if (a[0] != 0) {\n      cout << a[3] << a[2] << a[1] << a[0] << endl;\n    } else if (a[1] != 0) {\n      cout << a[3] << a[2] << a[1] << endl;\n    } else if (a[2] != 0) {\n      cout << a[3] << a[2] << endl;\n    } else {\n      cout << a[3] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, m, n, a[10];\n  scanf(\"%d \", &n);\n  m = n;\n  p = 1;\n  while (m / 10 != 0) {\n    a[p - 1] = m % 10;\n    m = m / 10;\n    p++;\n  }\n  a[p - 1] = m;\n  for (int j = 0; j < p; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29024", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n >= 0, n < 10)\n    printf(\"%d\\n\", n);\n  else if (n >= 10, n < 100)\n    printf(\"%d%d\\n\", n % 10, n / 10);\n  else if (n >= 100, n < 1000)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n >= 1000, n < 10000)\n    printf(\"%d%d%d%d\\n\", n % 10, n % 100 / 10, n / 100 % 10, n / 1000);\n  else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n\n  a = n % 10;\n  b = (n % 100 - a) / 10;\n  c = (n % 1000 - b * 10 - a) / 100;\n  d = (n - c * 100 - b * 10 - a) / 1000;\n  if (n < 10) {\n    x = a;\n    cout << x << \"\\n\";\n  } else if (n < 100) {\n    x = a * 10 + b;\n    printf(\"%02d\\n\", x);\n  } else {\n    if (n < 1000) {\n      x = a * 100 + b * 10 + c;\n      printf(\"%03d\\n\", x);\n    } else if (n < 10000) {\n      x = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[10] = {0};\n  int i, s = 0;\n\n  cin >> ch;\n  i = 0;\n  while (ch[i] != '\u0000') {\n    s = i;\n    i++;\n  }\n  for (i = s; i >= 0; i--) {\n    printf(\"%c\", ch[i]);\n  }\n}\n"}
{"label": "16", "index": "29027", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b1, b2, b3, b4, b5;\n  cin >> a;\n  b1 = a / 10000;\n  b2 = a / 1000 - 10 * b1;\n  b3 = a / 100 - 100 * b1 - 10 * b2;\n  b4 = a / 10 - 1000 * b1 - 100 * b2 - 10 * b3;\n  b5 = a - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4;\n  if (b1 != 0)\n    printf(\"00001\");\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "29028", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int number, i, m, x[5];\n  cin >> number;\n  if (number <= 9)\n    i = 1;\n  else if (number <= 99)\n    i = 2;\n  else if (number <= 999)\n    i = 3;\n  else if (number <= 9999)\n    i = 4;\n  else\n    i = 5;\n  for (m = 0; m <= i - 1; m++) {\n    x[m] = number % 10;\n    number = (number - x[m]) / 10;\n  }\n  for (m = 0; m <= i - 1; m++)\n    printf(\"%d\", x[m]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long int n;\n  int indiv, ten, hundred, thousand, place;\n  scanf(\"%ld\", &n);\n  if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  thousand = n / 1000;\n  hundred = (int)(n - thousand * 1000) / 100;\n  ten = (int)(n - thousand * 1000 - hundred * 100) / 10;\n  indiv = (int)(n - thousand * 1000 - hundred * 100 - ten * 10);\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\", indiv, ten, hundred);\n    break;\n  case 2:\n    cout << indiv << ten;\n    break;\n  case 1:\n    printf(\"%d\", indiv);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i, j;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%c\", &a[i]);\n    if (a[i] == '\\n') {\n      for (j = i; j < 5; j++) {\n        a[j] = '\\0';\n      }\n      break;\n    }\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      printf(\"%c\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29031", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, t;\n  char c[10001];\n  cin >> c;\n  for (i = 0;; i++) {\n    if (c[i] != '\\0') {\n      n++;\n    } else\n      break;\n  }\n  if (n % 2 == 0) {\n    for (i = 0; i < n / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  } else {\n    for (i = 0; i < (n - 1) / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  }\n  printf(\"%s\", c);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = (x - a * 1000) / 100;\n  c = (x - a * 1000 - b * 100) / 10;\n  d = x - a * 1000 - b * 100 - c * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        y = d;\n      else\n        y = d * 10 + c;\n    else\n      y = d * 100 + c * 10 + b;\n  else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d == 0)\n    if (c == 0)\n      if (b == 0)\n        if (a == 0)\n          printf(\"0\");\n        else\n          cout << \"000\" << y;\n      else\n        printf(\"00%d\", y);\n    else\n      cout << \"0\" << y;\n  else\n    cout << y;\n}\n"}
{"label": "16", "index": "29033", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(int n, int w) {\n  int x;\n  x = (int)pow(10, w - 1);\n  if (w != 1)\n    f(n % x, w - 1);\n  printf(\"%d\", n / x);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int w = (int)(log(n) / log(10)) + 1;\n  f(n, w);\n  return 0;\n}\n"}
{"label": "16", "index": "29034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main()\n\n{\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if ((n >= 0) && (n <= 9))\n    printf(\"%d\", n);\n  else if ((n >= 10) && (n <= 99)) {\n    a = n % 10;\n    b = (n - (n % 10)) / 10;\n    printf(\"%d%d\", a, b);\n  } else if ((n >= 100) && (n <= 999)) {\n    a = n % 10;\n    b = ((n - a) % 100) / 10;\n    c = (n - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if ((n >= 1000) && (n <= 9999)) {\n    a = n % 10;                            \n    b = ((n - a) / 10) % 10;               \n    c = ((n - a - 10 * b) / 100) % 10;     \n    d = (n - a - 10 * b - 100 * c) / 1000; \n    printf(\"%d%d%d%d\", a, b, c, d);\n  } \n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29035", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n\n  a = n % 10;\n  b = (n % 100 - a) / 10;\n  c = (n % 1000 - b * 10 - a) / 100;\n  d = (n - c * 100 - b * 10 - a) / 1000;\n  if (n < 10) {\n    x = a;\n    printf(\"%d\\n\", x);\n  } else if (n < 100) {\n    x = a * 10 + b;\n    printf(\"%02d\\n\", x);\n  } else {\n    if (n < 1000) {\n      x = a * 100 + b * 10 + c;\n      printf(\"%03d\\n\", x);\n    } else if (n < 10000) {\n      x = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", x);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n / 10 == 0) {\n    a[0] = n;\n    cout << a[0] << endl;\n  } else if (n / 100 == 0) {\n    a[0] = n / 10;\n    a[1] = n % 10;\n    cout << a[1] << a[0] << endl;\n  } else if (n / 1000 == 0) {\n    a[0] = n / 100;\n    a[1] = n % 100 / 10;\n    a[2] = n % 100 % 10;\n    cout << a[2] << a[1] << a[0] << endl;\n  } else if (n / 10000 == 0) {\n    a[0] = n / 1000;\n    a[1] = n % 1000 / 100;\n    a[2] = n % 1000 % 100 / 10;\n    a[3] = n % 1000 % 100 % 10;\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n  } else if (n = 10000)\n    cout << \"1\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29037", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10], b[10];\n\n  cin >> a;\n  int i, l;\n  l = strlen(a);\n  for (i = 0; i < l; i++)\n    b[l - i - 1] = a[i];\n\n  b[l] = '\u0000';\n  puts(b);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, temp, p, q;\n  scanf(\"%d\", &a);\n  temp = a;\n  if (a != 0) {\n    while (temp % 10 - temp != 0 || (temp % 10 - temp == 0 && q >= 10)) {\n      p = temp % 10;\n      cout << p;\n      q = temp;\n      temp = temp / 10;\n    }\n  } else\n    printf(\"0\");\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "29039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, e, a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else {\n    if (a >= 1000) {\n      e = (int)(a / 1000), d = (int)((a - 1000 * e) / 100),\n      c = (int)((a - 1000 * e - 100 * d) / 10), b = a % 10;\n      printf(\"%d%d%d%d\", b, c, d, e);\n    } else {\n      if (a >= 100) {\n        d = (int)(a / 100), c = (int)((a - 100 * d) / 10), b = a % 10;\n        printf(\"%d%d%d\", b, c, d);\n      } else {\n        if (a >= 10) {\n          c = (int)(a / 10), b = a % 10;\n          printf(\"%d%d\", b, c);\n        } else\n          printf(\"%d\", a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[10];\n  scanf(\"%s\", &s);\n  int n = 0, i = 0;\n  for (i = 0; s[i] != '\\0'; i++)\n    n++;\n  for (i = n - 1; i >= 0; i--)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x, y = 0;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    cout << a;\n  } else if (a == 10) {\n    b = 0;\n    c = 1;\n    printf(\"%d%d\", b, c);\n  } else if (a > 10 && a < 100) {\n    b = a / 10;\n    c = a - b * 10;\n    x = c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 100) {\n    b = 1;\n    printf(\"%d%d%d\", y, y, b);\n  } else if (a > 100 && a < 1000) {\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    x = d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 1000) {\n    b = 1;\n    printf(\"%d%d%d%d\", y, y, y, b);\n  } else if (a > 1000 && a < 10000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    x = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 10000) {\n    b = 1;\n    printf(\"%d%d%d%d%d\", y, y, y, y, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29042", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  cin >> a;\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = a / 100 - (a / 1000) * 10;\n  e = a / 10 - (a / 100) * 10;\n  f = a - (a / 10) * 10;\n  if (b != 0) {\n    g = f * 10000 + e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%05d\", g);\n  } else if (c != 0) {\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%04d\", g);\n  } else if (d != 0) {\n    g = f * 100 + e * 10 + d;\n    printf(\"%03d\", g);\n  } else if (e != 0) {\n    g = f * 10 + e;\n    printf(\"%01d\", g);\n  } else {\n    g = f;\n    printf(\"%d\", g);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *a, *p;\n  int n = 0;\n  a = (char *)malloc(1000);\n\n  cin >> a;\n\n  for (p = a; *p != '\u0000'; p++)\n    ;\n  p--;\n  for (; p >= a; p--)\n    printf(\"%c\", *p);\n}\n"}
{"label": "16", "index": "29044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n % 10;\n  if (a > 0)\n    printf(\"00001\");\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else {\n    if (d > 0)\n      printf(\"%d%d\", e, d);\n    else\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a / 10000 == 0) {\n    if (a / 1000 == 0) {\n      if (a / 100 == 0) {\n        if (a / 10 == 0)\n          printf(\"%d\\n\", a);\n        else {\n          b = a % 10;\n          c = a / 10;\n          printf(\"%d%d\\n\", b, c);\n        }\n      } else {\n        c = a / 100;\n        d = (a - c * 100) / 10;\n        b = (a - c * 100) % 10;\n        printf(\"%d%d%d\\n\", b, d, c);\n      }\n    } else {\n      b = a / 1000;\n      c = (a - b * 1000) / 100;\n      d = (a - b * 1000 - c * 100) / 10;\n      e = (a - b * 1000 - c * 100) % 10;\n      printf(\"%d%d%d%d\\n\", e, d, c, b);\n    }\n  } else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y, a[5], counter, i = 0;\n  scanf(\"%d \", &x);\n  do {\n    y = x / 10;\n    a[i] = x - y * 10;\n    counter = i;\n    i++;\n    x = y;\n    y = x * 10;\n  } while (y / 10 > 0);\n  for (i = 0; i <= counter; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char str[100];\n  scanf(\"%s\", &str);\n  for (i = strlen(str) - 1; i >= 0; i--)\n    cout << str[i];\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[10];\n  scanf(\"%d \", &n);\n  a[0] = n % 10;\n  a[1] = (n % 100) / 10;\n  a[2] = (n % 1000) / 100;\n  a[3] = (n % 10000) / 1000;\n  if (n < 10 && n >= 0)\n    cout << n;\n  else if (n < 100 && n >= 10)\n    cout << a[0] << a[1];\n  else if (n < 1000 && n >= 100)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (n < 10000 && n >= 1000)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = (a - b * 10000 - c * 1000) / 100;\n  e = (a - b * 10000 - c * 1000 - d * 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "29050", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  d = a % 10;\n  b = (a % 1000 - a % 100) / 100;\n  c = (a % 100 - d) / 10;\n  e = (a % 10000 - a % 1000) / 1000;\n  if (a >= 1000)\n    printf(\"%d%d%d%d\\n\", d, c, b, e);\n  else {\n    if (a >= 100) {\n      printf(\"%d%d%d\\n\", d, c, b);\n    } else if (a >= 10)\n      printf(\"%d%d\\n\", d, c);\n    else {\n      printf(\"%d\\n\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29051", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n >= 10 && n < 100) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    cout << a[1] << a[2] << endl;\n  } else if (n >= 100 && n < 1000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    cout << a[1] << a[2] << a[3] << endl;\n  }\n\n  else if (n >= 1000 && n < 10000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    a[4] = (n / 1000) % 10;\n    cout << a[1] << a[2] << a[3] << a[4] << endl;\n  }\n\n  else if (n = 10000)\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, m;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  else {\n    while (n != 0) {\n      m = n % 10;\n      printf(\"%d\", m);\n      n = n / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, r;\n  cin >> x;\n  a = x % 10;\n  b = (x / 10) % 10;\n  c = (x / 100) % 10;\n  d = (x / 1000) % 10;\n  e = (x / 10000) % 10;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        if (b == 0) {\n          r = a;\n          printf(\"%d\\n\", r);\n        } else {\n          r = a * 10 + b;\n          printf(\"%02d\\n\", r);\n        }\n      } else {\n        r = a * 100 + b * 10 + c;\n        printf(\"%03d\\n\", r);\n      }\n    } else {\n      r = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", r);\n    }\n  } else {\n    r = a * 10000 + b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%05d\\n\", r);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[5];\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    {\n      for (i = 0; n > 0; i++) {\n        a[i] = n % 10;\n        n = n / 10;\n      }\n    }\n    m = i;\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%d%d\", b, c);\n  } else if (a >= 100 && a <= 999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = (a - b - 10 * c) / 100;\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 1000 && a <= 9999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = (a - b - 10 * c - 100 * d) / 1000;\n    cout << b << c << d << e;\n  } else if (a >= 10000 && a <= 99999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i = 0;\n  scanf(\"%d\", &a);\n  if (a == 100)\n    printf(\"001\");\n  else {\n    while (a > 0) {\n      i = i * 10 + a % 10;\n\n      a = a / 10;\n    }\n    cout << i;\n  }\n  return (0);\n}\n"}
{"label": "16", "index": "29057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int k, a, b, c, d, e, place;\n  scanf(\"%d \", &k);\n  if (k > 9999)\n    place = 5;\n  else if (k > 999)\n    place = 4;\n  else if (k > 99)\n    place = 3;\n  else if (k > 9)\n    place = 2;\n  else\n    place = 1;\n  switch (place) {\n  case 1:\n    printf(\"%d\\n\", k);\n    break;\n  case 2:\n    d = k / 10;\n    e = k - d * 10;\n    cout << e << d << \"\\n\";\n    break;\n  case 3:\n    c = k / 100;\n    d = (k - c * 100) / 10;\n    e = k - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 4:\n    b = k / 1000;\n    c = (k - b * 1000) / 100;\n    d = (k - b * 1000 - c * 100) / 10;\n    e = k - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n    break;\n  case 5:\n    a = k / 10000;\n    b = (k - a * 10000) / 1000;\n    c = (k - a * 10000 - b * 1000) / 100;\n    d = (k - a * 10000 - b * 1000 - c * 100) / 10;\n    e = k - a * 10000 - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n / 10 == 0)\n    cout << n << endl;\n  else if (n / 100 == 0)\n    cout << n % 10 << n / 10 << endl;\n  else if (n / 1000 == 0)\n    cout << n % 10 << n % 100 / 10 << n / 100 << endl;\n  else if (n / 10000 == 0)\n    cout << n % 10 << n % 100 / 10 << n % 1000 / 100 << n / 1000 << endl;\n  else if (n == 10000)\n    cout << 1 << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int ge, shi, bai, qian;\n  scanf(\"%d\", &n);\n  if ((0 <= n) && (n <= 9))\n    printf(\"%d\\n\", n);\n  if ((10 <= n) && (n <= 99)) {\n    ge = n % 10;\n    shi = n / 10;\n    printf(\"%d%d\", ge, shi);\n  }\n  if ((100 <= n) && (n <= 999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = n / 100;\n    printf(\"%d%d%d\", ge, shi, bai);\n  }\n  if ((1000 <= n) && (n <= 9999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = ((n - shi * 10) / 100) % 10;\n    qian = (n - bai * 100) / 1000;\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29060", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, i, k, s;\n  scanf(\"%d\", &n);\n  i = n;\n  s = 0;\n  while (i > 0) {\n    k = i % 10;\n    if (k == 0)\n      printf(\"0\"), i /= 10;\n    else {\n      i = i / 10;\n      s = s * 10 + k;\n    }\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "29061", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, e;\n  scanf(\"%d\", &e);\n  while (1000 * a <= e - 1000) {\n    a++;\n  }\n  while (1000 * a + 100 * b <= e - 100) {\n    b++;\n  }\n  while (1000 * a + 100 * b + 10 * c <= e - 10) {\n    c++;\n  }\n  d = e - 10 * c - 100 * b - 1000 * a;\n  if (a > 0) {\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (b > 0) {\n      printf(\"%d%d%d\", d, c, b);\n    } else {\n      if (c > 0) {\n        printf(\"%d%d\", d, c);\n      } else {\n        printf(\"%d\", d);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29062", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  a = x % 10;\n  b = (x - a) % 100 / 10;\n  c = (x - a - 10 * b) % 1000 / 100;\n  d = (x - a - 10 * b - 100 * c) % 10000 / 1000;\n  e = (x - a - 10 * b - 100 * c - 1000 * d) % 100000 / 10000;\n  if (e == 1)\n    cout << 1;\n  else if (d != 0)\n    cout << a << b << c << d;\n  else if (d == 0 && c != 0)\n    cout << a << b << c;\n  else if (d == 0 && c == 0 && b != 0)\n    cout << a << b;\n  else if (d == 0 && c == 0 && b == 0)\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d \", &n);\n  x = n;\n  a = n / 10000;\n  n = n % 10000;\n  b = n / 1000;\n  n = n % 1000;\n  c = n / 100;\n  n = n % 100;\n  d = n / 10;\n  n = n % 10;\n  if (x < 10)\n    printf(\"%d\\n\", n);\n  else {\n    if (x < 100)\n      printf(\"%d%d\\n\", n, d);\n    else {\n      if (x < 1000)\n        printf(\"%d%d%d\\n\", n, d, c);\n      else {\n        if (x < 10000)\n          cout << n << d << c << b << \"\\n\";\n        else\n          printf(\"%d%d%d%d%d\\n\", n, d, c, b, a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29064", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, t;\n  char c[10001];\n  cin >> c;\n  for (i = 0;; i++) {\n    if (c[i] != '\\0') {\n      n++;\n    } else\n      break;\n  }\n  if (n % 2 == 0) {\n    for (i = 0; i < n / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  } else {\n    for (i = 0; i < (n - 1) / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  }\n  printf(\"%s\", c);\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29065", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n\n  else\n    for (i = 1;; i++) {\n      static int k;\n      if (i == 1)\n        k = 10;\n      else\n        k *= 10;\n      if (n < k / 10)\n        break;\n      else {\n        int c = n % k;\n        cout << c / (k / 10);\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &e);\n  if (e < 10) {\n    a = e;\n    printf(\"%d\", a);\n  } else if (e < 100) {\n    a = e % 10;\n    b = (e - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (e < 1000) {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = (int)(e / 100);\n    printf(\"%d%d%d\", a, b, c);\n  } else {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = ((e - b * 10 - a) / 100) % 10;\n    d = (int)(e / 1000);\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[10];\n\n  int i;\n  while (cin >> n) {\n    if (n == 0) {\n      cout << 0;\n    }\n    for (i = 1; i <= 5 && n != 0; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n      cout << a[i];\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    if (n < 100)\n      cout << n % 10 << n / 10;\n    else if (n < 1000) {\n      a = n % 10;\n      n = (n - a) / 10;\n      b = n % 10;\n      n = (n - b) / 10;\n      cout << a << b << n;\n    } else if (n < 10000) {\n      a = n % 10;\n      n = (n - a) / 10;\n      b = n % 10;\n      n = (n - b) / 10;\n      c = n % 10;\n      n = (n - c) / 10;\n      cout << a << b << c << n;\n    } else\n      cout << \"0\"\n           << \"0\"\n           << \"0\"\n           << \"0\"\n           << \"1\";\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29069", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10] = {0};\n  int b, i, n;\n  cin >> b;\n  i = 0;\n  do {\n    a[i] = b % 10;\n    b = b / 10;\n    i++;\n  } while (b > 0);\n  n = i;\n  for (i = 0; i < n; i++)\n    printf(\"%d\", a[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  scanf(\"%d \", &a);\n  if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - 100 * d;\n    f = e / 10;\n    g = e - 10 * f;\n\n    n = g * 1000 + f * 100 + d * 10 + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - 10 * b;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else\n\n  {\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29071", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, decade, hundred, thousand;\n  cin >> n;\n  cout << n - n / 10 * 10;\n  if (n >= 10) {\n    decade = n / 10;\n    printf(\"%d\", decade - decade / 10 * 10);\n  }\n  if (n >= 100) {\n    hundred = decade / 10;\n    cout << hundred - hundred / 10 * 10;\n  }\n  if (n >= 1000) {\n    thousand = hundred / 10;\n    cout << thousand - thousand / 10 * 10;\n  }\n  if (n == 10000) {\n    cout << \"1\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29072", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b = 0, n, c, i, a[5];\n  cin >> n;\n  if (n == 0) {\n    cout << '0' << endl;\n  } else {\n    for (i = 0; n > 0; i++) {\n      c = n % 10;\n      a[i] = c;\n      n = n / 10;\n      b += 1;\n    }\n    for (i = 0; i < b; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[10];\n\n  cin >> a;\n  int i, l;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    b[l - i - 1] = a[i];\n  }\n  b[l] = '\u0000';\n  puts(b);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, an[10];\n  scanf(\"%d\", &n);\n  int j = 0;\n  for (i = n; i > 0; i = i / 10) {\n    an[j] = i % 10;\n    j++;\n  }\n  for (i = 0; i < j; i++)\n    cout << an[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29075", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a = 10, b = 10, c = 10, d;\n  cin >> n;\n  if (n == 10000)\n    cout << \"1\" << endl;\n  else\n    do {\n      a--;\n    } while ((n - a * 1000 < 0) || (n - a * 1000 >= 1000));\n  n = n - a * 1000;\n  do {\n    b--;\n  } while ((n - b * 100 < 0) || (n - b * 100 >= 100));\n  n = n - b * 100;\n  do {\n    c--;\n  } while ((n - c * 10 < 0) || (n - c * 10 >= 10));\n  n = n - c * 10;\n  d = n;\n  if ((a == 0) && (b == 0) && (c == 0))\n    cout << d << endl;\n  else if ((a == 0) && (b == 0))\n    cout << d << c << endl;\n  else if (a == 0)\n    cout << d << c << b << endl;\n  else\n    cout << d << c << b << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int indiv, ten, hundred, thousand, ten_thousand, place;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    place = 5;\n  else if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  ten_thousand = (int)(n / 10000);\n  thousand = (int)((n - ten_thousand * 10000) / 1000);\n  hundred = (int)((n - 10000 * ten_thousand - 1000 * thousand) / 100);\n  ten =\n      (int)((n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred) / 10);\n  indiv = (int)(n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred -\n                10 * ten);\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", indiv, ten, hundred, thousand, ten_thousand);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\\n\", indiv);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n % 1000) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"00001\\n\");\n  else if (b != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 1000 + d * 100 + c * 10 + b);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 100 + c * 10 + b);\n    else if (c != 0)\n      printf(\"00%d\\n\", c * 10 + b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (c != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 100 + d * 10 + c);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 10 + c);\n    else\n      printf(\"00%d\\n\", c);\n  } else if (d != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 10 + d);\n    else\n      printf(\"0%d\\n\", d);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i;\n  for (i = 0; i <= 5; i++) {\n    scanf(\"%c\", &a[i]);\n    if ((int)(a[i]) == 10)\n      break;\n  }\n  for (; i >= 1; i--)\n    printf(\"%c\", a[i - 1]);\n  return 0;\n}\n"}
{"label": "16", "index": "29079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = ((n % 100) - a) / 10;\n  c = ((n % 1000) - (10 * b + a)) / 100;\n  d = (n - 100 * c - 10 * b - a) / 1000;\n  if (d)\n    cout << a << b << c << d;\n  else if (c)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  cin.getline(a, 100);\n  int i;\n  int l = strlen(a);\n  for (i = l - 1; i >= 0; i--)\n    cout << a[i];\n  cout << endl;\n}\n"}
{"label": "16", "index": "29081", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a = 0, b;\n  scanf(\"%d\", &n);\n  b = n;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    do {\n      a = a * 10 + n % 10;\n      n = n / 10;\n    } while (n != 0);\n    if (b % 10 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 100 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 1000 == 0 && b != 0)\n      printf(\"0\");\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29082", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[6], i, p = 0;\n  scanf(\"%d \", &n);\n  for (i = 0;; i++) {\n    a[i] = n % 10;\n    n = (n - a[i]) / 10;\n    if (n != 0)\n      p += 1;\n    else\n      break;\n  }\n  for (i = 0; i <= p; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29083", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int m = 0;\n  int nn = n;\n  for (int i = 1; i < 5; i++) {\n    n = n / 10;\n    if (n == 0) {\n      m = i;\n      break;\n    }\n  }\n  int a;\n  for (int i = 0; i < m; i++) {\n    a = nn % 10;\n    printf(\"%d\", a);\n    nn = nn / 10;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[7], i, j;\n  scanf(\"%s\", &a);\n  for (i = 1; a[i] != '\\0'; i++)\n    j = i;\n\n  for (i = j; i >= 0; i--)\n    printf(\"%c\", a[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid fun(int s) {\n  if (s == 0)\n    return;\n  else {\n    cout << s % 10;\n    fun(s /= 10);\n  }\n}\nint main() {\n  int s;\n  cin >> s;\n  if (s == 0)\n    cout << s;\n  else\n    fun(s);\n  return 0;\n}\n"}
{"label": "16", "index": "29086", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  int x, y, a[5], counter,\n      i = 0; \n  cin >> x;  \n  do         \n  {\n    y = x / 10;         \n    a[i] = x - y * 10;  \n    counter = i;        \n    i++;                \n    x = y;              \n    y = x * 10;         \n  } while (y / 10 > 0); \n  for (i = 0; i <= counter; i++)\n    cout << a[i]; \n  return 0;       \n}\n"}
{"label": "16", "index": "29087", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    d = a % 10;\n    a = (a - d) / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (a >= 100) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (a >= 10) {\n    b = a % 10;\n    a = (a - b) / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[4];\n  int n;\n  cin >> n;\n  a[0] = n / 1000;\n  a[1] = (n - a[0] * 1000) / 100;\n  a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n  a[3] = n % 10;\n  if (a[0] == 0) {\n    if (a[1] == 0) {\n      if (a[2] == 0)\n        cout << a[3] << endl;\n      else\n        cout << a[3] << a[2] << endl;\n    } else\n      cout << a[3] << a[2] << a[1] << endl;\n  } else\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29089", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - 100 * b) / 10;\n  d = n % 10;\n  if (n < 10)\n    printf(\"%d \", n);\n  else if (n < 100)\n    printf(\"%d%d \", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d \", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d \", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[4];\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n / 10 == 0)\n    j = 0;\n  else if (n / 100 == 0)\n    j = 1;\n  else if (n / 1000 == 0)\n    j = 2;\n  else\n    j = 3;\n  for (i = j; i >= 0; i--) {\n    a[i] = n / pow(10, (double)i);\n    n = n - pow(10, (double)i) * a[i];\n  }\n  for (k = 0; k <= j; k++)\n    cout << a[k];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29091", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[10];\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n}\n"}
{"label": "16", "index": "29092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, a, b, c, d, e, place; \n  scanf(\"%ld\", &k);\n  if (k > 9999)\n    place = 5;\n  else if (k > 999)\n    place = 4;\n  else if (k > 99)\n    place = 3;\n  else if (k > 9)\n    place = 2;\n  else\n    place = 1;\n  switch (place) {\n  case 1:\n    printf(\"%d\\n\", k);\n    break;\n  case 2:\n    d = k / 10;\n    e = k - d * 10;\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 3:\n    c = k / 100;\n    d = (k - c * 100) / 10;\n    e = k - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 4:\n    b = k / 1000;\n    c = (k - b * 1000) / 100;\n    d = (k - b * 1000 - c * 100) / 10;\n    e = k - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n    break;\n  case 5:\n    a = k / 10000;\n    b = (k - a * 10000) / 1000;\n    c = (k - a * 10000 - b * 1000) / 100;\n    d = (k - a * 10000 - b * 1000 - c * 100) / 10;\n    e = k - a * 10000 - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  cin >> x;\n  if (x == 10000)\n    printf(\"00001\\n\");\n  else {\n    a = x / 1000;\n    b = (x - a * 1000) / 100;\n    c = (x - a * 1000 - b * 100) / 10;\n    d = x - a * 1000 - b * 100 - c * 10;\n    if (a)\n      printf(\"%d%d%d%d\\n\", d, c, b, a);\n    else {\n      if (b)\n        printf(\"%d%d%d\\n\", d, c, b);\n      else {\n        if (c)\n          printf(\"%d%d\\n\", d, c);\n        else\n          printf(\"%d\\n\", d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a % 10;\n  if (b != 0) {\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c != 0) {\n\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d != 0) {\n\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e != 0) {\n\n          printf(\"%d%d\", f, e);\n        } else {\n          printf(\"%d\", f);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = a / 100;\n  e = a / 10;\n  f = a % 10;\n  g = e % 10;\n  h = d % 10;\n  i = (a / 10) % 10;\n  j = (a / 100) % 10;\n  k = (a / 1000) % 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0) {\n          printf(\"%d\", f);\n        } else\n          cout << f << e;\n      } else\n        printf(\"%d%d%d\", f, g, d);\n    } else\n      printf(\"%d%d%d%d\", f, i, h, c);\n  } else\n    printf(\"%d%d%d%d%d\", f, i, j, k, b);\n  return 0;\n}\n"}
{"label": "16", "index": "29096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &a);\n  b = floor(a / 10000);\n  a = a - b * 10000;\n  c = floor(a / 1000);\n  a = a - c * 1000;\n  d = floor(a / 100);\n  a = a - d * 100;\n  e = floor(a / 10);\n  a = a - e * 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0)\n          printf(\"%d\", a);\n        else\n          printf(\"%d%d\", a, e);\n      } else\n        printf(\"%d%d%d\", a, e, d);\n    } else\n      printf(\"%d%d%d%d\", a, e, d, c);\n  } else\n    printf(\"%d%d%d%d%d\", a, e, d, c, b);\n}\n"}
{"label": "16", "index": "29097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n[5];\n  int i, k, j;\n  cin.getline(n, 5);\n  for (i = 0; n[i] != '\\0'; i++) {\n    k = i;\n  }\n  for (j = k; j >= 0; j--)\n    cout << n[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, y;\n  cin >> x;\n  if (x >= 1000) {\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    y = d * 1000 + c * 100 + b * 10 + a;\n    printf(\"%04d\", y);\n  }\n  if (x >= 100 && x < 1000) {\n    a = x / 100;\n    b = (x - 100 * a) / 10;\n    c = x - 100 * a - 10 * b;\n    y = c * 100 + b * 10 + a;\n    printf(\"%03d\", y);\n  }\n  if (x >= 10 && x < 100) {\n    a = x / 10;\n    b = x - a * 10;\n    y = b * 10 + a;\n    printf(\"%02d\", y);\n  }\n  if (x < 10)\n    cout << x;\n  return 0;\n}\n"}
{"label": "16", "index": "29099", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c[6] = {0, 0, 0, 0, 0, 0};\n  cin >> a;\n  if (a / 10 > 0) {\n    b = a / 10;\n    c[1] = a - 10 * b;\n    c[2] = b;\n    a = b;\n    if (a / 10 > 0) {\n      b = a / 10;\n      c[2] = a - 10 * b;\n      c[3] = b;\n      a = b;\n      if (a / 10 > 0) {\n        b = a / 10;\n        c[3] = a - 10 * b;\n        c[4] = b;\n        a = b;\n        if (a / 10 > 0) {\n          b = a / 10;\n          c[4] = a - 10 * b;\n          c[5] = b;\n          cout << c[1] << c[2] << c[3] << c[4] << c[5];\n        } else\n          printf(\"%d%d%d%d\", c[1], c[2], c[3], c[4]);\n      } else\n        printf(\"%d%d%d\", c[1], c[2], c[3]);\n    } else\n      printf(\"%d%d\", c[1], c[2]);\n  } else {\n    c[1] = a;\n    printf(\"%d\", c[1]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29100", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n <= 9 && 0 <= n)\n    cout << n;\n  if (n <= 99 && 10 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    cout << b;\n  }\n  if (n <= 999 && 100 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    cout << c;\n  }\n  if (n <= 9999 && 1000 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    n = n / 10;\n    cout << c;\n    d = n % 10;\n    cout << d;\n  }\n  if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29101", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  cin >> x;\n  a = x / 1000;\n  b = x / 100 % 10;\n  c = x / 10 % 10;\n  d = x % 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        printf(\"%d%d\", d, c);\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n}\n"}
{"label": "16", "index": "29102", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char a[6];\n  int i, n;\n  scanf(\"%s\", a);\n  n = strlen(a);\n  for (i = 1; i <= n; i++)\n    printf(\"%c\", a[n - i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, s, p;\n  cin >> a;\n  s = a;\n  while (s != 0) {\n    p = s % 10;\n    cout << p;\n    s = (s - p) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29104", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int a[4];\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n / 10 == 0)\n    j = 0;\n  else if (n / 100 == 0)\n    j = 1;\n  else if (n / 1000 == 0)\n    j = 2;\n  else\n    j = 3;\n  for (i = j; i >= 0; i--) {\n    a[i] = n / pow(10, (double)i);\n    n = n - pow(10, (double)i) * a[i];\n  }\n  for (k = 0; k <= j; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  n = n - 10000 * a;\n  b = n / 1000;\n  n = n - 1000 * b;\n  c = n / 100;\n  n = n - 100 * c;\n  d = n / 10;\n  e = n - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a;\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    cout << e << d;\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, c;\n  scanf(\"%d\", &n);\n  c = 0;\n  if (n != 0)\n    for (; n != 0; n = n / 10) {\n      a = n % 10;\n      printf(\"%d\", a);\n    }\n  else\n    printf(\"0\");\n  return (0);\n}\n"}
{"label": "16", "index": "29107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    int b, c;\n    b = a / 10;\n    c = a - 10 * b;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    int b, c, d;\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    int b, c, d, e;\n    b = a / 1000;\n    c = (a - 1000 * b) / 100;\n    d = (a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n}\n"}
{"label": "16", "index": "29108", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n\n  if (n >= 1000) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (n >= 100) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n % 10;\n\n      printf(\"%d%d%d\", c, b, a);\n    } else {\n      if (n >= 10) {\n        a = n / 10;\n        b = n % 10;\n        printf(\"%d%d\", b, a);\n      } else\n        printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5], i, m;\n  cin >> n;\n  a[0] = n % 10;\n  a[1] = (n / 10) % 10;\n  a[2] = (n / 100) % 10;\n  a[3] = (n / 1000) % 10;\n  a[4] = (n / 10000) % 10;\n\n  if (n == 0) \n  {\n    cout << 0;\n  } else {\n    i = 4;\n    while (a[i] == 0) \n    {\n      m = i;\n      i--;\n    }\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &a);\n  b = a % 1000;\n  c = (a - b) / 1000;\n  d = b % 100;\n  e = (b - d) / 100;\n  f = d % 10;\n  g = (d - f) / 10;\n  if (c == 0) {\n    if (e == 0) {\n      if (g == 0) {\n        if (f == 0)\n          printf(\"0\");\n        else\n          printf(\"%d\", f);\n      } else {\n        printf(\"%d%d\", f, g);\n      }\n    } else {\n      printf(\"%d%d%d\", f, g, e);\n    }\n  } else {\n    printf(\"%d%d%d%d\", f, g, e, c);\n  }\n}\n"}
{"label": "16", "index": "29111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d, e;\n  cin >> n;\n  int x;\n  x = n;\n  a = n / 10000;\n  n = n - a * 10000;\n  b = n / 1000;\n  n = n - b * 1000;\n  c = n / 100;\n  n = n - c * 100;\n  d = n / 10;\n  e = n - d * 10;\n  if (x < 10)\n    cout << e << endl;\n  else if ((x >= 10) && (x < 100))\n    cout << e << d << endl;\n  else if ((x >= 100) && (x < 1000))\n    cout << e << d << c << endl;\n  else if ((x >= 1000) && (x < 10000))\n    cout << e << d << c << b << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 10000 == 1)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    d = a % 10;\n    a = a / 10;\n    cout << b << c << d << a;\n  } else {\n    if (n / 100 != 0) {\n      a = n;\n      b = a % 10;\n      a = a / 10;\n      c = a % 10;\n      a = a / 10;\n      printf(\"%d%d%d\", b, c, a);\n    } else if (n / 10 != 0) {\n      a = n;\n      b = a % 10;\n      a = a / 10;\n      printf(\"%d%d\", b, a);\n    } else\n      printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, temp, ge, shi, bai, qian;\n  cin >> num;\n  temp = num;\n  if (num == 10000)\n    cout << \"00001\" << endl;\n  else if (num == 0)\n    cout << \"0\" << endl;\n  else {\n    qian = temp / 1000;\n    temp = temp - qian * 1000;\n    bai = temp / 100;\n    temp = temp - bai * 100;\n    shi = temp / 10;\n    ge = temp - shi * 10;\n    if (num >= 1 && num <= 9)\n      cout << ge << endl;\n    else if (num >= 10 && num <= 99)\n      cout << ge << shi << endl;\n    else if (num >= 100 && num <= 999)\n      cout << ge << shi << bai << endl;\n    else\n      cout << ge << shi << bai << qian << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29114", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b[5], n, i;\n  cin >> a;\n  if (a != 0) {\n    n = log10(a) + 1;\n    for (i = 0; i <= n - 1; i++) {\n      b[i] = (int)(a / pow(10, i)) % 10;\n    }\n    for (i = 0; i <= n - 1; i++)\n      printf(\"%d\", b[i]);\n    printf(\"\\n\");\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29115", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0) {\n    printf(\"0\");\n  }\n  while (a != 0) {\n    cout << a - (a / 10) * 10;\n    a = a / 10;\n  }\n}\n"}
{"label": "16", "index": "29116", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  printf(\"%d\", n % 10);\n  if (n / 10 != 0)\n    printf(\"%d\", (n % 100) / 10);\n  if (n / 100 != 0)\n    printf(\"%d\", (n % 1000) / 100);\n  if (n / 1000 != 0)\n    printf(\"%d\", (n % 10000) / 1000);\n  if (n / 10000 != 0)\n    printf(\"%d\", n / 10000);\n}\n"}
{"label": "16", "index": "29117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n\n  if (a > 9) {\n    if (a > 99) {\n      if (a > 999) {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        e = ((a - b - c - d) % 10000) / 1000;\n        printf(\"%d%d%d%d\", b, c, d, e);\n      } else {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        printf(\"%d%d%d\", b, c, d);\n      }\n    } else {\n      b = a % 10;\n      c = ((a - b) % 100) / 10;\n      printf(\"%d%d\", b, c);\n    }\n  } else {\n    b = a % 10;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0) {\n    cout << n;\n  } else {\n    while (n) {\n      cout << n % 10;\n      n /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 10 * b - 100 * a;\n  d = n - 10 * c - 100 * b - 1000 * a;\n  if (a == 0 && b == 0 && c == 0)\n    printf(\"%d\", d);\n  if (a == 0 && b == 0 && c != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  }\n  if (a == 0 && b != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  }\n  if (a != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - b) / 10;\n  d = (a % 1000 - b - c * 10) / 100;\n  e = a / 1000;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0)\n        printf(\"%d\", b);\n      else {\n        printf(\"%d%d\", b, c);\n      }\n    } else {\n      printf(\"%d%d%d\", b, c, d);\n    }\n  } else\n    printf(\"%d%d%d%d\", b, c, d, e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 10000 == 1)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    d = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (n / 100 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (n / 10 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char num[100];\n  int k = -1;\n  cin >> num[0];\n  for (int i = 1; num[i - 1] != '\\n'; i++, k++) {\n    cin.get(num[i]);\n  }\n  for (; k >= 0; k--) {\n    cout << num[k];\n  }\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "29123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, i;\n  cin >> n;\n  if (n == 0)\n    cout << n << endl;\n  else {\n    for (i = 1;; i++) {\n      a = n / 10;\n      b = n - (a * 10);\n      if (a == 0 && b == 0)\n        break;\n      cout << b;\n      n = a;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits] = iNum % radix;\n    cout << ch[iBits];\n    iNum /= radix;\n    iBits++;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  scanf(\"%d\", &iNum);\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29125", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d \", &n);\n  while (n != 0) {\n    a = n % 10;\n    printf(\"%d\", a);\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (0 <= a && a <= 9)\n    b = 1;\n  else {\n    if (10 <= a && a <= 99)\n      b = 2;\n    else {\n      if (100 <= a && a <= 999)\n        b = 3;\n      else {\n        if (1000 <= a && a <= 9999)\n          b = 4;\n        else {\n          if (10000 <= a && a <= 99999)\n            b = 5;\n        }\n      }\n    }\n  }\n  switch (b) {\n  case 1: {\n    printf(\"%d\\n\", a);\n  } break;\n  case 2: {\n    c = a / 10;\n    d = a % 10;\n    printf(\"%d%d\\n\", d, c);\n  } break;\n  case 3: {\n    c = a / 100;\n    d = (a - c * 100) / 10;\n    e = a - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n  } break;\n  case 4: {\n    c = a / 1000;\n    d = (a - c * 1000) / 100;\n    e = (a - c * 1000 - d * 100) / 10;\n    f = a - c * 1000 - d * 100 - e * 10;\n    cout << f << e << d << c << \"\\n\";\n  } break;\n  case 5: {\n    c = a / 10000;\n    d = (a - c * 10000) / 1000;\n    e = (a - c * 10000 - d * 1000) / 100;\n    f = (a - c * 10000 - d * 1000 - e * 100) / 10;\n    g = a - c * 10000 - d * 1000 - e * 100 - f * 10;\n    cout << g << f << e << d << c << \"\\n\";\n  }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29127", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  a = x % 10;\n  b = (x - a) % 100 / 10;\n  c = (x - a - 10 * b) % 1000 / 100;\n  d = (x - a - 10 * b - 100 * c) % 10000 / 1000;\n  e = (x - a - 10 * b - 100 * c - 1000 * d) % 100000 / 10000;\n  if (e == 1)\n    printf(\"%d\", 1);\n  else if (d != 0)\n    cout << a << b << c << d;\n  else if (d == 0 && c != 0)\n    cout << a << b << c;\n  else if (d == 0 && c == 0 && b != 0)\n    cout << a << b;\n  else if (d == 0 && c == 0 && b == 0)\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 1000 != 0) {\n    a = n / 1000;\n    n = n - 1000 * a;\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d\", d, c, b);\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - 10 * c;\n\n    cout << d << c;\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a[5], i, c, n, j;\n  cin >> num;\n  n = 0;\n  for (i = 4; i >= 0; i--) {\n    for (j = 1; j <= i; j++)\n      c *= 10;\n    a[i] = ((num - num % c) / c) % 10;\n    c = 1;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      n = i;\n      break;\n    }\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (n < 10)\n    cout << d;\n  else if (n < 100)\n    printf(\"%d%d\", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d\", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29131", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n <= 10000 && n >= 0) {\n    a = n % 100000 / 10000;\n    b = n % 10000 / 1000;\n    c = n % 1000 / 100;\n    d = n % 100 / 10;\n    e = n % 10;\n    if (a != 0)\n      printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    else {\n      if (b != 0)\n        cout << e << d << c << b << endl;\n      else if (c != 0)\n        cout << e << d << c << endl;\n      else if (d != 0)\n        cout << e << d << endl;\n      else\n        cout << e << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29132", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k, sum = 1, A[5];\n  cin >> n;\n  k = n;\n  while (k >= 10) {\n    k = k / 10;\n    sum = sum + 1;\n  }\n  for (i = 0; i < sum; i++) {\n    A[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < sum; i++)\n    printf(\"%d\", A[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d \", &a);\n  b = 0;\n  while (a) {\n    b = a % 10;\n    cout << b;\n    a = a / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29134", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n >= 0 && n <= 9) {\n    cout << n << endl;\n  } else if (n >= 10 && n <= 99) {\n    int a, b;\n    a = n / 10;\n    b = n % 10;\n    printf(\"%d%d\\n\", b, a);\n  } else if (n >= 100 && n <= 999) {\n    int a, b, c;\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - 100 * a - 10 * b;\n    cout << c << b << a << endl;\n  } else if (n >= 1000 && n <= 9999) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else {\n    if (n = 10000)\n      cout << \"00001\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, U1, U2, U3, U4, U;\n  cin >> i;\n  U1 = i / 1000;\n  U2 = (i - 1000 * U1) / 100;\n  U3 = (i - 1000 * U1 - 100 * U2) / 10;\n  U4 = (i - 1000 * U1 - 100 * U2 - 10 * U3);\n  if (U1 != 0)\n    printf(\"%d%d%d%d\", U4, U3, U2, U1);\n  else {\n    if (U2 != 0)\n      printf(\"%d%d%d\", U4, U3, U2);\n    else {\n      if (U3 != 0)\n        printf(\"%d%d\", U4, U3);\n      else {\n        if (U4 != 0)\n          printf(\"%d\", U4);\n        else\n          printf(\"0\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29136", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[10];\n  scanf(\"%s\", &s);\n  int n = 0, i = 0;\n  for (i = 0; s[i] != '\\0'; i++)\n    n++;\n  for (i = n - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid nixu(int k);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  nixu(n);\n  return 0;\n}\nvoid nixu(int k) {\n  if (k > 0) {\n    cout << k % 10;\n    k /= 10;\n    nixu(k);\n  }\n}\n"}
{"label": "16", "index": "29138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int w, a = 0, b = 0, c = 0, d = 0, e = 0, x;\n  cin >> n;\n  a = n % 10;\n  x = n / 10;\n  if (x == 0)\n    w = 1;\n  else {\n    {\n      b = x % 10;\n      x = x / 10;\n    }\n    if (x == 0)\n      w = 2;\n    else {\n      {\n        c = x % 10;\n        x = x / 10;\n      }\n      if (x == 0)\n        w = 3;\n      else {\n        {\n          d = x % 10;\n          x = x / 10;\n        }\n        if (x == 0)\n          w = 4;\n        else {\n          w = 5;\n          e = x % 10;\n        }\n      }\n    }\n  }\n  switch (w) {\n  case 5:\n    cout << a << b << c << d << e << \" \";\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a, b, c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d \", a, b);\n    break;\n  case 1:\n    printf(\"%d \", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a > 9999)\n    cout << \"00001\";\n  else if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10);\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10);\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, a5, b;\n  scanf(\"%d\", &a);\n  a1 = a / 10000;\n  a2 = a / 1000 - a1 * 10;\n  a3 = a / 100 - a2 * 10 - a1 * 100;\n  a4 = a / 10 - a3 * 10 - a2 * 100 - a1 * 1000;\n  a5 = a - a4 * 10 - a3 * 100 - a2 * 1000 - a1 * 10000;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000 + a5 * 10000;\n  if (a1 == 0) {\n    if (a2 == 0) {\n      if (a3 == 0) {\n        if (a4 == 0)\n          printf(\"%01d\", b / 10000);\n        else\n          printf(\"%02d\", b / 1000);\n      } else\n        printf(\"%03d\", b / 100);\n    } else\n      printf(\"%04d\", b / 10);\n  } else\n    printf(\"%05d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29141", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10], n = 0, k = 1, i = 0, b = 1;\n  cin >> n;\n  if (!n)\n    cout << n << endl;\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    printf(\"%d\", a[i]);\n    n = (n - a[i]) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[5];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    cout << str[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, i;\n  scanf(\"%d\", &a);\n  i = 1 + log10(a);\n  b = a / 10000;\n  a = a % 10000;\n  c = a / 1000;\n  a = a % 1000;\n  d = a / 100;\n  a = a % 100;\n  e = a / 10;\n  a = a % 10;\n  f = a;\n  printf(\"%d\", f);\n  if (i > 1)\n    cout << e;\n  if (i > 2)\n    printf(\"%d\", d);\n  if (i > 3)\n    printf(\"%d\", c);\n  if (i > 4)\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29144", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (1000 <= a && a <= 10000)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (100 <= a && a < 1000)\n    printf(\"%d%d%d\", e, d, c);\n  else if (10 <= a && a < 100)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e, p;\n\n  scanf(\"%d\", &num);\n\n  if (num >= 10000)\n    p = 5;\n  else if (num >= 1000)\n    p = 4;\n  else if (num >= 100)\n    p = 3;\n  else if (num >= 10)\n    p = 2;\n  else\n    p = 1;\n  a = (int)(num / 10000);\n  b = (int)(num % 10000 / 1000);\n  c = (int)(num % 1000 / 100);\n  d = (int)(num % 100 / 10);\n  e = (int)(num % 10);\n\n  switch (p) {\n  case 5:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n\n  case 4:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 2:\n    printf(\"%d%d\", e, d);\n    break;\n  case 1:\n    printf(\"%d\", e);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\\n\");\n  else {\n    a[1] = n / 1000;\n    a[2] = (n - 1000 * a[1]) / 100;\n    a[3] = (n - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = (n - 1000 * a[1] - 100 * a[2] - 10 * a[3]);\n  }\n  if (a[1] != 0)\n    cout << a[4] << a[3] << a[2] << a[1] << endl;\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d\\n\", a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        printf(\"%d%d\\n\", a[4], a[3]);\n      else\n        cout << a[4] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d \", &a);\n  for (int i = 1;; i++) {\n    b = a % 10;\n    cout << b;\n    c = a / 10;\n    if (c == 0)\n      break;\n    a = c;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0;\n  int n_1 = 0, i = 0;\n  int len = 0;\n  int a[6] = {0};\n  cin >> n;\n  n_1 = n;\n  for (; n / 10 > 0;) {\n    n = n / 10;\n    len++;\n  }\n  len++;\n  for (i = 0; i < len; i++) {\n    a[i] = n_1 % 10;\n    n_1 = n_1 / 10;\n  }\n  for (i = 0; i < len; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29149", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p;\n  p = (char *)malloc(sizeof(char) * 8);\n  int i;\n  for (i = 0; i < 6; i++) {\n    cin >> p;\n    if (*p == '\\n') {\n      *p = 0;\n      break;\n    }\n    p++;\n  }\n  for (i = i - 1; i >= 0; i--) {\n    p--;\n    printf(\"%c\", *p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29150", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a > 9999)\n    printf(\"00001\");\n  else if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10);\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10);\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if ((n >= 0) && (n <= 9))\n    cout << n;\n  else {\n    do {\n      printf(\"%d\", n % 10);\n      n = n / 10;\n    } while (n / 10 != 0);\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k;\n  cin >> a;\n  b = a / 10000;\n  c = a / 1000;\n  d = a / 100;\n  e = a / 10;\n  f = a % 10;\n  g = e % 10;\n  h = d % 10;\n  i = (a / 10) % 10;\n  j = (a / 100) % 10;\n  k = (a / 1000) % 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0) {\n          printf(\"%d\", f);\n        } else\n          printf(\"%d%d\", f, e);\n      } else\n        printf(\"%d%d%d\", f, g, d);\n    } else\n      printf(\"%d%d%d%d\", f, i, h, c);\n  } else\n    printf(\"%d%d%d%d%d\", f, i, j, k, b);\n  return 0;\n}\n"}
{"label": "16", "index": "29153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char a[6];\n\n  cin >> a;\n  n = strlen(a);\n  for (i = n - 1; i >= 0; i--) {\n    printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "29154", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  scanf(\"%d\", &num);\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (num == 10000)\n    printf(\"1\\n\");\n  if (num > 999)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (num > 9)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "29155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, w, c;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    cout << \"00001\";\n  else if (n > 999)\n    w = 4;\n  else if (n > 99)\n    w = 3;\n  else if (n > 9)\n    w = 2;\n  else\n    cout << n;\n\n  for (i = 1; i < w + 1; i++) {\n    c = n % 10;\n    n = n / 10;\n\n    cout << c;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29156", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[4], i = 0;\n  char mm;\n  while ((mm = cin.get()) != '\\n') {\n    a[i] = mm - '0';\n    i++;\n  }\n  for (int j = 0; j <= i - 1; j++) {\n    printf(\"%d\", a[i - 1 - j]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c, i = 0;\n  char num[7] = {0};\n  while ((c = cin.get()) != '\\n') {\n    num[i++] = c;\n  }\n  for (i = i - 1; i >= 0; i--) {\n    cout << num[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k;\n  int a[4];\n  cin >> n;\n  j = n;\n  if (j < 10)\n    k = 1;\n  if (j >= 10 && j < 100)\n    k = 2;\n  if (j >= 100 && j < 1000)\n    k = 3;\n  if (j >= 1000 && j < 10000)\n    k = 4;\n  a[3] = n / 1000;\n  a[2] = (n - a[3] * 1000) / 100;\n  a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  switch (k) {\n  case 1:\n    printf(\"%d\", a[0]);\n    break;\n  case 2:\n    cout << a[0] << a[1];\n    break;\n  case 3:\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n    break;\n  case 4:\n    cout << a[0] << a[1] << a[2] << a[3];\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29159", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, i, j;\n  int bit[5];\n  i = 1;\n  cin >> num;\n  if (num == 0) {\n    printf(\"%d\", 0);\n    return 0;\n  }\n  while (num > 0) {\n    bit[i] = num % 10;\n    num = num / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    printf(\"%d\", bit[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "29160", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          b = 0, c = 0, d = 0, e = 0, f = a;\n        else\n          b = 0, c = 0, d = 0, e = a / 10, f = a - 10 * e;\n      else\n        b = 0, c = 0, d = a / 100, e = (a - d * 100) / 10,\n        f = a - d * 100 - e * 10;\n    else\n      b = 0, c = a / 1000, d = (a - c * 1000) / 100,\n      e = (a - c * 1000 - d * 100) / 10, f = a - c * 1000 - d * 100 - e * 10;\n  else\n    b = a / 10000, c = (a - b * 10000) / 1000,\n    d = (a - b * 10000 - c * 1000) / 100,\n    e = (a - b * 10000 - c * 1000 - d * 100) / 10,\n    f = a - b * 10000 - c * 1000 - d * 100 - e * 10;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          printf(\"%d\\n\", a);\n        else\n          printf(\"%d%d\\n\", f, e);\n      else\n        printf(\"%d%d%d\\n\", f, e, d);\n    else\n      printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "29161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e, p;\n  scanf(\"%d\", &num);\n  if (num >= 10000)\n    p = 5;\n  else if (num >= 1000)\n    p = 4;\n  else if (num >= 100)\n    p = 3;\n  else if (num >= 10)\n    p = 2;\n  else\n    p = 1;\n  a = (int)(num / 10000);\n  b = (int)(num % 10000 / 1000);\n  c = (int)(num % 1000 / 100);\n  d = (int)(num % 100 / 10);\n  e = (int)(num % 10);\n  switch (p) {\n  case 5:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n\n  case 4:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 2:\n    printf(\"%d%d\", e, d);\n    break;\n  case 1:\n    printf(\"%d\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b = 0;\n  do {\n    a[b] = getchar();\n    b++;\n  } while (b < 5);\n  if (a[1] == '\\n')\n    printf(\"%c\", a[0]);\n  else if (a[2] == '\\n')\n    cout << a[1] << a[0];\n  else if (a[3] == '\\n')\n    printf(\"%c%c%c\", a[2], a[1], a[0]);\n  else if (a[4] == '\\n')\n    printf(\"%c%c%c%c\", a[3], a[2], a[1], a[0]);\n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29163", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0;\n  int a[6] = {0};\n  scanf(\"%d \", &n);\n  do {\n    a[i] = (n % 10);\n    n = (n - a[i]) / 10;\n    i++;\n    k++;\n  } while (n != 0);\n  for (i = 0; i < k; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, k, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x > 999)\n    k = 4;\n  else if (x > 99)\n    k = 3;\n  else if (x > 9)\n    k = 2;\n  else\n    k = 1;\n  switch (k) {\n  case 1:\n    d = x;\n    printf(\"%d\\n\", d);\n    break;\n  case 2:\n    c = x / 10;\n    d = x - 10 * c;\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 3:\n    b = x / 100;\n    c = (x - 100 * b) / 10;\n    d = x - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 4:\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29165", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    cout << a << b;\n  } else if (n < 1000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    cout << a << c << d;\n  } else if (n < 10000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    e = d % 10;\n    f = d / 10;\n    cout << a << c << e << f;\n  } else if (n == 10000)\n    cout << 00001;\n  return 0;\n}\n"}
{"label": "16", "index": "29166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[6], i, p = 0;\n  cin >> n;\n  for (i = 0;; i++) {\n    a[i] = n % 10;\n    n = (n - a[i]) / 10;\n    if (n != 0)\n      p += 1;\n    else\n      break;\n  }\n  for (i = 0; i <= p; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29167", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0) {\n    cout << n;\n  } else {\n    while (n) {\n      cout << n % 10;\n      n /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (0 <= a && a <= 9)\n    b = 1;\n  else {\n    if (10 <= a && a <= 99)\n      b = 2;\n    else {\n      if (100 <= a && a <= 999)\n        b = 3;\n      else {\n        if (1000 <= a && a <= 9999)\n          b = 4;\n        else {\n          if (10000 <= a && a <= 99999)\n            b = 5;\n        }\n      }\n    }\n  }\n  switch (b) {\n  case 1: {\n    printf(\"%d\\n\", a);\n  } break;\n  case 2: {\n    c = a / 10;\n    d = a % 10;\n    printf(\"%d%d\\n\", d, c);\n  } break;\n  case 3: {\n    c = a / 100;\n    d = (a - c * 100) / 10;\n    e = a - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n  } break;\n  case 4: {\n    c = a / 1000;\n    d = (a - c * 1000) / 100;\n    e = (a - c * 1000 - d * 100) / 10;\n    f = a - c * 1000 - d * 100 - e * 10;\n    printf(\"%d%d%d%d\\n\", f, e, d, c);\n  } break;\n  case 5: {\n    c = a / 10000;\n    d = (a - c * 10000) / 1000;\n    e = (a - c * 10000 - d * 1000) / 100;\n    f = (a - c * 10000 - d * 1000 - e * 100) / 10;\n    g = a - c * 10000 - d * 1000 - e * 100 - f * 10;\n    printf(\"%d%d%d%d%d\\n\", g, f, e, d, c);\n  }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *a, *p;\n  int n = 0;\n  a = (char *)malloc(1000);\n  cin >> a;\n  for (p = a; *p != '\u0000'; p++)\n    ;\n  p--;\n  for (; p >= a; p--)\n    cout << *p;\n  return 0;\n}\n"}
{"label": "16", "index": "29170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, b1, b2, c1, c2, d1;\n  scanf(\"%d\", &n);\n  a1 = n % 10;\n  a2 = n / 10;\n  if (a2 > 0) {\n    b1 = a2 % 10;\n    b2 = a2 / 10;\n    if (b2 > 0) {\n      c1 = b2 % 10;\n      c2 = b2 / 10;\n      if (c2 > 0) {\n        d1 = c2 % 10;\n        cout << a1 << b1 << c1 << d1;\n      } else\n        printf(\"%d%d%d\", a1, b1, c1);\n    } else\n      printf(\"%d%d\", a1, b1);\n  } else\n    cout << a1;\n  return 0;\n}\n"}
{"label": "16", "index": "29171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, x, a, b, c, d, e, x1, x2, x3, x4, x5;\n  k = 0;\n  scanf(\"%d \", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = (x % 10) / 1;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (x / i != 0)\n      k = k + 1;\n  };\n  if (k == 5) {\n    x5 = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (k == 4) {\n    x4 = 1000 * e + 100 * d + 10 * c + b;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (k == 3) {\n    x3 = 100 * e + 10 * d + c;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (k == 2) {\n    x2 = 10 * e + d;\n    cout << e << d;\n  } else if (k == 1) {\n    x1 = e;\n    printf(\"%d\", e);\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - a % 10) / 10;\n  d = (a % 1000 - a % 100) / 100;\n  e = (a - a % 1000) / 1000;\n  if (e)\n    cout << b << c << d << e;\n  else if (d)\n    printf(\"%d%d%d\", b, c, d);\n  else if (c)\n    cout << b << c;\n  else\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e, a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else {\n    if (a >= 1000) {\n      e = (int)(a / 1000), d = (int)((a - 1000 * e) / 100),\n      c = (int)((a - 1000 * e - 100 * d) / 10), b = a % 10;\n      cout << b << c << d << e;\n    } else {\n      if (a >= 100) {\n        d = (int)(a / 100), c = (int)((a - 100 * d) / 10), b = a % 10;\n        printf(\"%d%d%d\", b, c, d);\n      } else {\n        if (a >= 10) {\n          c = (int)(a / 10), b = a % 10;\n          printf(\"%d%d\", b, c);\n        } else\n          printf(\"%d\", a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d \", &a);\n  b = a / 1000;\n  c = a % 1000;\n  d = c / 100;\n  e = a % 100;\n  f = e / 10;\n  g = a % 10;\n\n  if (b == 0) {\n    if (d == 0) {\n      if (f == 0) {\n        cout << g;\n      } else {\n        printf(\"%d%d\", g, f);\n      }\n    } else {\n      printf(\"%d%d%d\", g, f, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", g, f, d, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int weishu[5] = {-1, -1, -1, -1, -1}, num, i = 0;\n  cin >> num;\n  do {\n    weishu[i] = num % 10;\n    num = num / 10;\n    i++;\n  } while (num > 0);\n  for (i = 0; i < 5; i++)\n    if (weishu[i] != -1)\n      cout << weishu[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, X, a, b, c, d, e;\n  scanf(\"%d\", &N);\n  if (N > 9999)\n    X = 5;\n  else if (N > 999) {\n    X = 4;\n  } else if (N > 99)\n    X = 3;\n  else if (N > 9)\n    X = 2;\n  else\n    X = 1;\n  a = N / 10000;\n  b = (N - 10000 * a) / 1000;\n  c = (N - 10000 * a - 1000 * b) / 100;\n  d = (N - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (N - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  switch (X) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    break;\n  case 4:\n    cout << e << d << c << b << \"\\n\";\n    break;\n  case 3:\n    cout << e << d << c << \"\\n\";\n    break;\n  case 2:\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 1:\n    printf(\"%d\\n\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, m, n;\n  scanf(\"%d\", &a);\n  if (a <= 10) {\n    printf(\"%d\", a);\n  } else {\n    if (a == 10 || a == 100 || a == 1000) {\n      printf(\"001\");\n    } else {\n      if (100 >= a && a >= 10) {\n        b = a % 10;\n        c = (int)(a / 10);\n        d = 10 * b + a;\n        printf(\"%d\\n\", d);\n      } else {\n        if (1000 >= a && a >= 100) {\n          e = (int)(a / 100);\n          f = (int)((a - 100 * e) / 10);\n          g = a - 100 * e - 10 * f;\n          m = 100 * g + 10 * f + e;\n          printf(\"%d\\n\", m);\n        } else {\n          h = (int)(a / 1000);\n          i = (int)((a - 1000 * h) / 100);\n          j = (int)((a - 1000 * h - 100 * i) / 10);\n          k = a - 1000 * h - 100 * i - 10 * j;\n          n = 1000 * k + 100 * j + 10 * i + h;\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29178", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, c, d, e, f, g;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000 && a <= 9999) {\n    c = a / 1000;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100 && a <= 999) {\n    c = 0;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 100 + e * 10 + d * 1 + c;\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a >= 10 && a <= 99) {\n    c = 0;\n    d = 0;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 10 + e;\n    printf(\"%d%d\", f, e);\n  } else {\n    g = a;\n    printf(\"%d\", g);\n  }\n}\n"}
{"label": "16", "index": "29179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d \", &n);\n  a[0] = n % 10, a[1] = (n / 10) % 10, a[2] = (n / 100) % 10,\n  a[3] = (n / 1000) % 10, a[4] = (n / 10000) % 10;\n\n  if (n < 10) {\n    cout << a[0];\n  } else if (n < 100 && n >= 10) {\n    cout << a[0] << a[1];\n  } else if (n < 1000 && n >= 100) {\n    cout << a[0] << a[1] << a[2];\n  } else if (n < 10000 && n >= 1000)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else {\n    cout << a[0] << a[1] << a[2] << a[3] << a[4];\n  }\n}\n"}
{"label": "16", "index": "29180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid reverse() {\n  int k;\n  if ((k = getchar()) == '\\n') {\n    return;\n  }\n  reverse();\n  printf(\"%d\", k);\n}\n\nint main() {\n  reverse();\n  return 0;\n}\n"}
{"label": "16", "index": "29181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, v, n4, n3, n2, n1;\n  double n0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n  } else if (n == 10000)\n    cout << 1 << endl;\n  else {\n    n0 = n;\n    v = log10(n0) + 1;\n    n4 = n / 1000;\n    n3 = (n - n4 * 1000) / 100;\n    n2 = (n - n4 * 1000 - n3 * 100) / 10;\n    n1 = n - n4 * 1000 - n3 * 100 - n2 * 10;\n    switch (v) {\n    case 4:\n      cout << n1 << n2 << n3 << n4 << endl;\n      break;\n    case 3:\n      cout << n1 << n2 << n3 << endl;\n      break;\n    case 2:\n      cout << n1 << n2 << endl;\n      break;\n    case 1:\n      cout << n1 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29182", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[10000], i = 0, d[10000];\n  cin >> n;\n  float b[10000], c;\n  c = n / 10;\n  b[0] = floor(c);\n  a[0] = n % 10;\n  if (b[0] == 0)\n    cout << n << endl;\n  if (b[0] != 0) {\n    while (1) {\n      a[i + 1] = (int)b[i] % 10;\n      b[i + 1] = floor(b[i] / 10);\n      if (b[i + 1] < 1)\n        break;\n      i++;\n    }\n    for (int k = 0; k <= i + 1; k++) {\n      cout << a[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x == 10000)\n    printf(\"00001\\n\");\n  else {\n    a = x / 1000;\n    b = (x - a * 1000) / 100;\n    c = (x - a * 1000 - b * 100) / 10;\n    d = x - a * 1000 - b * 100 - c * 10;\n    if (a)\n      printf(\"%d%d%d%d\\n\", d, c, b, a);\n    else {\n      if (b)\n        printf(\"%d%d%d\\n\", d, c, b);\n      else {\n        if (c)\n          printf(\"%d%d\\n\", d, c);\n        else\n          printf(\"%d\\n\", d);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n > 9999) {\n    printf(\"00001\");\n  } else if (n > 999) {\n    printf(\"%d%d%d%d\", n % 1000 % 100 % 10, n % 1000 % 100 / 10, n % 1000 / 100,\n           n / 1000);\n  } else if (n > 99) {\n    printf(\"%d%d%d\", n % 100 % 10, n % 100 / 10, n / 100);\n  } else if (n > 9) {\n    printf(\"%d%d\", n % 10, n / 10);\n  } else {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    cout << \"0\";\n  }\n  while (n > 0) {\n    cout << n % 10;\n    n /= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[6], t[6];\n  int i, x;\n\n  scanf(\"%s \", s);\n  x = strlen(s);\n  for (i = 0; i <= x - 1; i++)\n    t[x - 1 - i] = s[i];\n  for (i = x; i <= 5; i++)\n    t[i] = 0;\n  puts(t);\n}\n"}
{"label": "16", "index": "29187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a / 10000 == 0) {\n    if (a / 1000 == 0) {\n      if (a / 100 == 0) {\n        if (a / 10 == 0)\n          printf(\"%d\\n\", a);\n        else {\n          b = a % 10;\n          c = a / 10;\n          cout << b << c << \"\\n\";\n        }\n      } else {\n        c = a / 100;\n        d = (a - c * 100) / 10;\n        b = (a - c * 100) % 10;\n        cout << b << d << c << \"\\n\";\n      }\n    } else {\n      b = a / 1000;\n      c = (a - b * 1000) / 100;\n      d = (a - b * 1000 - c * 100) / 10;\n      e = (a - b * 1000 - c * 100) % 10;\n      cout << e << d << c << b << \"\\n\";\n    }\n  } else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29188", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 1; n != 0; i++) {\n    cout << n % 10;\n    n /= 10;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29189", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, U1, U2, U3, U4, U;\n  cin >> i;\n  U1 = i / 1000;\n  U2 = (i - 1000 * U1) / 100;\n  U3 = (i - 1000 * U1 - 100 * U2) / 10;\n  U4 = (i - 1000 * U1 - 100 * U2 - 10 * U3);\n  if (U1 != 0)\n    printf(\"%d%d%d%d\", U4, U3, U2, U1);\n  else {\n    if (U2 != 0)\n      printf(\"%d%d%d\", U4, U3, U2);\n    else {\n      if (U3 != 0)\n        printf(\"%d%d\", U4, U3);\n      else {\n        if (U4 != 0)\n          printf(\"%d\", U4);\n        else\n          printf(\"0\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n;\n  scanf(\"%d\", &a);\n  if (a >= 0 && a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10, c = a / 10;\n    putchar(b);\n    putchar(c);\n  } else if (a >= 100 && a <= 999) {\n    d = a % 10, e = a / 10, f = e % 10, g = e / 10;\n    printf(\"%d%d%d\", d, f, g);\n  } else if (a >= 1000 && a <= 9999) {\n    h = a / 10, i = h / 10, j = i / 10, k = i % 10, l = h % 10, m = a % 10;\n    printf(\"%d%d%d%d\", m, l, k, j);\n  }\n}\n"}
{"label": "16", "index": "29191", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  do {\n    printf(\"%d\", (n % 10));\n    n /= 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[6];\n\n  cin >> a;\n  int i, j;\n  j = strlen(a);\n  for (i = j - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, c, d, e, a;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else {\n    if (a >= 1000) {\n      e = (int)(a / 1000), d = (int)((a - 1000 * e) / 100),\n      c = (int)((a - 1000 * e - 100 * d) / 10), b = a % 10;\n      printf(\"%d%d%d%d\", b, c, d, e);\n    } else {\n      if (a >= 100) {\n        d = (int)(a / 100), c = (int)((a - 100 * d) / 10), b = a % 10;\n        printf(\"%d%d%d\", b, c, d);\n      } else {\n        if (a >= 10) {\n          c = (int)(a / 10), b = a % 10;\n          printf(\"%d%d\", b, c);\n        } else\n          printf(\"%d\", a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits++] = iNum % radix;\n    iNum /= radix;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint Myatoi(char *ch, int iBits) {\n  int iNumInverse = 0;\n  int i = 0;\n\n  while (ch[i] == '\\0') {\n    i++;\n    cout << \"0\";\n  }\n  for (i = 0; i <= iBits; i++) {\n    iNumInverse = 10 * iNumInverse + ch[i];\n  }\n  return iNumInverse;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  cin >> iNum;\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10);\n    iNumInverse = Myatoi(ch, iBits);\n    printf(\"%d\", iNumInverse);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n % 10;\n  b = n / 10 % 10;\n  c = n / 100 % 10;\n  d = n / 1000 % 10;\n  if (n >= 10) {\n    if (n / 10 >= 10) {\n      if (n / 100 >= 10) {\n        if (n / 1000 < 10)\n          printf(\"%d%d%d%d\\n\", a, b, c, d);\n      } else\n        printf(\"%d%d%d\\n\", a, b, c);\n    } else\n      printf(\"%d%d\\n\", a, b);\n  } else\n    cout << n << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4];\n  int n;\n  scanf(\"%d \", &n);\n  a[0] = n / 1000;\n  a[1] = (n - a[0] * 1000) / 100;\n  a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n  a[3] = n % 10;\n  if (a[0] == 0) {\n    if (a[1] == 0) {\n      if (a[2] == 0)\n        cout << a[3] << endl;\n      else\n        cout << a[3] << a[2] << endl;\n    } else\n      cout << a[3] << a[2] << a[1] << endl;\n  } else\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d%\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  int k;\n\n  int x[10];\n  if (n == 0) {\n    printf(\"0\");\n  } else {\n    while (n != 0) {\n\n      x[i] = n % 10;\n      n = n / 10;\n      i++;\n    }\n    i = i - 1;\n\n    for (k = 1; k <= i; k++) {\n      printf(\"%d\", x[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29199", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s;\n  if (n == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (n != 0) {\n    s = n % 10;\n    n /= 10;\n    printf(\"%d\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  else if (n > 999) {\n    cout << n % 1000 % 100 % 10 << n % 1000 % 100 / 10 << n % 1000 / 100\n         << n / 1000;\n  } else if (n > 99) {\n    printf(\"%d%d%d\", n % 100 % 10, n % 100 / 10, n / 100);\n  } else if (n > 9)\n    printf(\"%d%d\", n % 10, n / 10);\n  else {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29201", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char shu[6], temp;\n  int i, Lshu;\n  cin.getline(shu, 6, '\\n');\n  Lshu = strlen(shu);\n  for (i = 0; i < Lshu / 2; i++) {\n    temp = shu[i];\n    shu[i] = shu[Lshu - 1 - i];\n    shu[Lshu - 1 - i] = temp;\n  }\n  printf(\"%s\", shu);\n  return 0;\n}\n"}
{"label": "16", "index": "29202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n <= 9999 && n > 1000) {\n    i = n / 1000 + n % 1000 / 100 * 10 + n % 100 / 10 * 100 + n % 10 * 1000;\n    cout << i << endl;\n  } else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n <= 999 && n > 100) {\n    i = n / 100 + n % 100 / 10 * 10 + n % 10 * 100;\n    printf(\"%d\\n\", i);\n  } else if (n == 100)\n    cout << \"001\" << endl;\n  else if (n <= 99 && n > 10) {\n    i = n % 10 * 10 + n / 10;\n  } else if (n == 10)\n    cout << \"01\" << endl;\n  else if (n <= 9 && n >= 0)\n    cout << n << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29203", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j;\n  cin >> a;\n  if (a <= 9)\n    printf(\"%d\\n\", a);\n  else {\n    if (a <= 99) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a <= 999) {\n        d = a / 100;\n        e = (a - d * 100) / 10;\n        f = a - 100 * d - 10 * e;\n        printf(\"%d%d%d\", f, e, d);\n      } else if (a <= 9999) {\n        g = a / 1000;\n        h = (a - 1000 * g) / 100;\n        i = (a - 1000 * g - 100 * h) / 10;\n        j = a - 1000 * g - 100 * h - 10 * i;\n        printf(\"%d%d%d%d\", j, i, h, g);\n      } else if (a = 10000)\n        printf(\"00001\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0;\n  scanf(\"%d\", &a);\n  int b[6] = {0, 0, 0, 0, 0, 0};\n  int c[5] = {-1, -1, -1, -1, -1};\n  b[0] = a;\n  int i;\n  for (i = 1; i < 5; i++)\n    b[i] = b[i - 1] / 10;\n\n  for (i = 0; i < 5; i++) {\n    if (b[i] != 0) {\n      c[i] = b[i] - 10 * b[i + 1];\n      if (c[i] >= 0)\n        printf(\"%d\", c[i]);\n    }\n  }\n  if (a == 0)\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "29205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i;\n  for (i = 0; i <= 5; i++) {\n    scanf(\"%c\", &a[i]);\n    if ((int)(a[i]) == 10)\n      break;\n  }\n  for (; i >= 1; i--) {\n    printf(\"%c\", a[i - 1]);\n  }\n}\n"}
{"label": "16", "index": "29206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n / 10 == 0)\n    cout << n << endl;\n  else if (n / 100 == 0)\n    cout << n % 10 << n / 10 << endl;\n  else if (n / 1000 == 0)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n / 10000 == 0)\n    cout << n % 10 << n % 100 / 10 << n % 1000 / 100 << n / 1000 << endl;\n  else if (n == 10000)\n    cout << 1 << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29207", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n % 10;\n  b = ((n % 100) - a) / 10;\n  c = ((n % 1000) - (10 * b + a)) / 100;\n  d = (n - 100 * c - 10 * b - a) / 1000;\n  if (d)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, j, k;\n  int a[4];\n  cin >> n;\n  j = n;\n  if (j < 10)\n    k = 1;\n  if (j >= 10 && j < 100)\n    k = 2;\n  if (j >= 100 && j < 1000)\n    k = 3;\n  if (j >= 1000 && j < 10000)\n    k = 4;\n  a[3] = n / 1000;\n  a[2] = (n - a[3] * 1000) / 100;\n  a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  switch (k) {\n  case 1:\n    printf(\"%d\", a[0]);\n    break;\n  case 2:\n    printf(\"%d%d\", a[0], a[1]);\n    break;\n  case 3:\n    cout << a[0] << a[1] << a[2];\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29209", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, p;\n  int i = 1;\n  cin >> n;\n  if (n < 10)\n    p = 1;\n  else if (n < 100)\n    p = 2;\n  else if (n < 1000)\n    p = 3;\n  else if (n < 10000)\n    p = 4;\n  do {\n    m = n % 10;\n    printf(\"%d\", m);\n    n = n / 10;\n    i++;\n  } while (i <= p);\n  return 0;\n}\n"}
{"label": "16", "index": "29210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n\n  if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29211", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10001], b[10001], c[10001];\n  int x, i;\n  cin >> a;\n  x = strlen(a);\n  for (i = 0; i <= x; i++)\n    b[i] = a[x - i - 1];\n\n  printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29212", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, n1, n2;\n  cin >> n;\n  a = n / 1000;\n  n1 = n - 1000 * a;\n  b = n1 / 100;\n  n2 = n1 - 100 * b;\n  c = n2 / 10;\n  d = n2 - 10 * c;\n  if (a == 10)\n    cout << \"00001\" << endl;\n  else if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (b != 0)\n    cout << d << c << b << endl;\n  else if (c != 0)\n    cout << d << c << endl;\n  else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n;\n  int p[6], i = 0, j = 0, k = 0;\n  while ((n = cin.get()) != '\\n') {\n    k = n - '0';\n    p[i] = k;\n    i++;\n  }\n  for (j = (i - 1); j >= 0; j = j - 1) {\n    printf(\"%d\", p[j]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5] = {0};\n  int i = 0;\n  while ((a[i] = cin.get()) != '\\n')\n    i++;\n  for (; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  int r1, r2, r3, r4;\n  if (a > 9999)\n    b = 5;\n  else if (a > 999)\n    b = 4;\n  else if (a > 99)\n    b = 3;\n  else if (a > 9)\n    b = 2;\n  else\n    b = 1;\n  switch (b) {\n  case 1:\n    printf(\"%d\", a);\n    break;\n  case 5:\n    printf(\"00001\");\n    break;\n  case 2:\n    r3 = a / 10;\n    r4 = a - r3 * 10;\n    printf(\"%d%d\", r4, r3);\n    break;\n  case 3:\n    r2 = a / 100;\n    r3 = (a - r2 * 100) / 10;\n    r4 = a - r2 * 100 - r3 * 10;\n    printf(\"%d%d%d\", r4, r3, r2);\n    break;\n  case 4:\n    r1 = a / 1000;\n    r2 = (a - r1 * 1000) / 100;\n    r3 = (a - r1 * 1000 - r2 * 100) / 10;\n    r4 = (a - r1 * 1000 - r2 * 100 - r3 * 10);\n    printf(\"%d%d%d%d\", r4, r3, r2, r1);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d\", &n);\n  x = n;\n  a = n / 10000;\n  n = n % 10000;\n  b = n / 1000;\n  n = n % 1000;\n  c = n / 100;\n  n = n % 100;\n  d = n / 10;\n  n = n % 10;\n  if (x < 10)\n    printf(\"%d\\n\", n);\n  else {\n    if (x < 100)\n      printf(\"%d%d\\n\", n, d);\n    else {\n      if (x < 1000)\n        cout << n << d << c << \"\\n\";\n      else {\n        if (x < 10000)\n          printf(\"%d%d%d%d\\n\", n, d, c, b);\n        else\n          cout << n << d << c << b << a << \"\\n\";\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  x = x % 10000;\n  b = x / 1000;\n  x = x % 1000;\n  c = x / 100;\n  x = x % 100;\n  d = x / 10;\n  x = x % 10;\n  e = x;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          y = e;\n          printf(\"%d\", y);\n        } else {\n          y = 10 * e + d;\n          if (e == 0)\n            printf(\"0%d\", y);\n          else\n            printf(\"%d\", y);\n        }\n\n      } else {\n        y = 100 * e + 10 * d + c;\n        if (e == 0) {\n          if (d == 0)\n            printf(\"00%d\", y);\n          else\n            printf(\"0%d\", y);\n        } else\n          printf(\"%d\", y);\n      }\n\n    } else {\n      y = 1000 * e + 100 * d + 10 * c + b;\n      if (e == 0) {\n        if (d == 0) {\n          if (c == 0)\n            printf(\"000%d\", y);\n          else\n            printf(\"00%d\", y);\n        } else\n          printf(\"0%d\", y);\n      } else\n        printf(\"%d\", y);\n    }\n\n  } else {\n    y = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    if (e == 0) {\n      if (d == 0) {\n        if (c == 0) {\n          if (b == 0)\n            printf(\"0000%d\", y);\n          else\n            printf(\"000%d\", y);\n        } else\n          printf(\"00%d\", y);\n      } else\n        printf(\"0%d\", y);\n    } else\n      printf(\"%d\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29218", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  for (; a != 0; a = (a - (a % 10)) / 10) {\n    b = (a % 10);\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, m;\n  scanf(\"%d\", &n);\n  m = n;\n  a = n % 10;\n  n = n / 10;\n  b = n % 10;\n  n = n / 10;\n  c = n % 10;\n  n = n / 10;\n  d = n % 10;\n  if (m < 10)\n    printf(\"%d\", m);\n  else if (m < 100)\n    printf(\"%d%d\", a, b);\n  else if (m < 1000)\n    printf(\"%d%d%d\", a, b, c);\n  else if (m < 10000)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "29220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0) {\n    cout << n;\n  } else {\n    while (n) {\n      printf(\"%d\", n % 10);\n      n /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a1, a2, a3, a4, a5, num, len;\n  a1 = a2 = a3 = a4 = a5 = 0;\n  cin >> num;\n  if (num > 9) {\n    a1 = num % 10;\n    a2 = num / 10;\n    if (a2 > 9) {\n      a3 = a2 / 10;\n      a2 = a2 % 10;\n      if (a3 > 9) {\n        a4 = a3 / 10;\n        a3 = a3 % 10;\n        if (a4 > 9) {\n          a5 = a4 / 10;\n          a4 = a4 % 10;\n          len = 5;\n        } else\n          len = 4;\n      } else\n        len = 3;\n    } else\n      len = 2;\n  } else {\n    a1 = num;\n    len = 1;\n  }\n\n  if (a5)\n\n    printf(\"%d%d%d%d%d\\n\", a1, a2, a3, a4, a5);\n\n  else if (a4)\n\n    printf(\"%d%d%d%d\\n\", a1, a2, a3, a4);\n\n  else if (a3)\n\n    printf(\"%d%d%d\\n\", a1, a2, a3);\n\n  else if (a2)\n\n    printf(\"%d%d\\n\", a1, a2);\n\n  else\n    printf(\"%d\\n\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "29222", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  scanf(\"%d\", &x);\n  e = x / 10000;\n  d = (x - e * 10000) / 1000;\n  c = (x - e * 10000 - d * 1000) / 100;\n  b = (x - e * 10000 - d * 1000 - c * 100) / 10;\n  a = x - e * 10000 - d * 1000 - c * 100 - b * 10;\n  if (x < 10)\n    printf(\"%d\", a);\n  else if (x < 100)\n    printf(\"%02d\", 10 * a + b);\n  else if (x < 1000)\n    printf(\"%03d\", 100 * a + 10 * b + c);\n  else if (x < 10000)\n    printf(\"%04d\", 1000 * a + 100 * b + 10 * c + d);\n  else if (x == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int t, n, a, b, c, d, e, i, j, k, l, m;\n\n  scanf(\"%d\", &n);\n  t = n;\n  j = t / 10000;\n  if (j != 0) {\n    i = 5;\n    t = 0;\n  }\n\n  j = t / 1000;\n  if (j != 0) {\n    i = 4;\n    t = 0;\n  }\n\n  j = t / 100;\n  if (j != 0) {\n    i = 3;\n    t = 0;\n  }\n\n  j = t / 10;\n  if (j != 0) {\n    i = 2;\n    t = 0;\n  }\n\n  j = t / 1;\n  if (j != 0) {\n    i = 1;\n    t = 0;\n  }\n\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    a = n / 10000;\n    n = n % 10000;\n    b = n / 1000;\n    n = n % 1000;\n    c = n / 100;\n    n = n % 100;\n    d = n / 10;\n    n = n % 10;\n    e = n;\n\n    if (i == 5)\n      cout << e << d << c << b << a;\n    if (i == 4)\n      printf(\"%d%d%d%d\", e, d, c, b);\n    if (i == 3)\n      cout << e << d << c;\n    if (i == 2)\n      printf(\"%d%d\", e, d);\n    if (i == 1)\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10] = {0};\n  int b, i, n;\n  cin >> b;\n  i = 0;\n  do {\n    a[i] = b % 10;\n    b = b / 10;\n    i++;\n  } while (b > 0);\n  n = i;\n  for (i = 0; i < n; i++)\n    cout << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29225", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, b1, b2, b3, b4, b5;\n  scanf(\"%d \", &num);\n  b1 = num / 10000;\n  b2 = (num - 10000 * b1) / 1000;\n  b3 = (num - 10000 * b1 - 1000 * b2) / 100;\n  b4 = (num - 10000 * b1 - 1000 * b2 - 100 * b3) / 10;\n  b5 = (num - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4);\n  if (b1 != 0)\n    printf(\"%d%d%d%d%d\", b5, b4, b3, b2, b1);\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0) {\n    printf(\"%d%d%d\", b5, b4, b3);\n  } else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "29226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n / 10000;\n  a[1] = n / 1000 - 10 * a[0];\n  a[2] = n / 100 - 100 * a[0] - 10 * a[1];\n  a[4] = n % 10;\n  a[3] = (n % 100 - n % 10) / 10;\n  cout << \"\\n\";\n  if (n != 0) {\n    for (int i = 0; i < 5; i++)\n      if (a[i] == 0)\n        continue;\n      else {\n        for (int j = 4; j >= i; j--)\n          printf(\"%d\", a[j]);\n        break;\n      }\n  } else\n    cout << \"0\";\n  return 0;\n}\n"}
{"label": "16", "index": "29227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 9) {\n    printf(\"%d\", n);\n  }\n  if (10 <= n && n <= 99) {\n    a = n / 10;\n    b = n - a;\n    printf(\"%d%d\", b, a);\n  }\n  if (100 <= n && n <= 999) {\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (1000 <= n && n <= 9999) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29228", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, h, i, j, n;\n\n  scanf(\"%d \", &a);\n\n  if (a >= 10000) {\n    b = a / 10000;\n    c = a - b * 10000;\n    d = c / 1000;\n    e = c - d * 1000;\n    f = e / 100;\n    h = e - f * 100;\n    j = h / 10;\n    i = h - j * 10;\n    n = 10000 * i + 1000 * j + 100 * f + 10 * d + b;\n\n    printf(\"%05d\", n);\n  } else if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - d * 100;\n    f = e / 10;\n    h = e - f * 10;\n    n = 1000 * h + 100 * f + 10 * d + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else {\n    if (a >= 10) {\n      b = a / 10;\n      c = a - b * 10;\n      n = 10 * c + b;\n      printf(\"%02d\", n);\n    } else if (a >= 0)\n      printf(\"%d\", a);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid function_1(int num) {\n  cout << num % 10;\n  if ((num / 10) != 0)\n    function_1(num / 10);\n}\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  function_1(num);\n  return 0;\n}\n"}
{"label": "16", "index": "29230", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid function_1(int num) {\n  cout << num % 10;\n  if ((num / 10) != 0)\n    function_1(num / 10);\n}\nint main() {\n  int num;\n  cin >> num;\n  function_1(num);\n  return 0;\n}\n"}
{"label": "16", "index": "29231", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 10;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n << endl;\n  else if (n == 10)\n    printf(\"%d\\n\", 01);\n  else {\n    while (n > 0) {\n      cout << n % i;\n      n = n / i;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int in, k, m, sum = 0; \n  scanf(\"%d\", &in);\n  if (in == 100)\n    printf(\"001\");\n  else {\n    k = in;\n    for (; k > 0;) {\n      m = k % 10;\n      k = k / 10;\n      sum = sum * 10 + m;\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[5] = {'\\0', '\\0', '\\0', '\\0', '\\0'};\n  scanf(\"%s\", a);\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "29234", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, m, n;\n  cin >> a;\n  if (a <= 10) {\n    printf(\"%d\", a);\n  } else {\n    if (a == 10 || a == 100 || a == 1000) {\n      cout << \"001\";\n    } else {\n      if (100 >= a && a >= 10) {\n        b = a % 10;\n        c = (int)(a / 10);\n        d = 10 * b + a;\n        printf(\"%d\\n\", d);\n      } else {\n        if (1000 >= a && a >= 100) {\n          e = (int)(a / 100);\n          f = (int)((a - 100 * e) / 10);\n          g = a - 100 * e - 10 * f;\n          m = 100 * g + 10 * f + e;\n          printf(\"%d\\n\", m);\n        } else {\n          h = (int)(a / 1000);\n          i = (int)((a - 1000 * h) / 100);\n          j = (int)((a - 1000 * h - 100 * i) / 10);\n          k = a - 1000 * h - 100 * i - 10 * j;\n          n = 1000 * k + 100 * j + 10 * i + h;\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29235", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[80];\n  int i;\n\n  cin >> s;\n  for (i = strlen(s) - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char a[6];\n\n  cin >> a;\n  n = strlen(a);\n  for (i = n - 1; i >= 0; i--) {\n    cout << a[i];\n  }\n}\n"}
{"label": "16", "index": "29237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, b1, b2, c1, c2, d1;\n  cin >> n;\n  a1 = n % 10;\n  a2 = n / 10;\n  if (a2 > 0) {\n    b1 = a2 % 10;\n    b2 = a2 / 10;\n    if (b2 > 0) {\n      c1 = b2 % 10;\n      c2 = b2 / 10;\n      if (c2 > 0) {\n        d1 = c2 % 10;\n        printf(\"%d%d%d%d\", a1, b1, c1, d1);\n      } else\n        printf(\"%d%d%d\", a1, b1, c1);\n    } else\n      printf(\"%d%d\", a1, b1);\n  } else\n    printf(\"%d\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "29238", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[7] = {'0', '0', '0', '0', '0', '0', '0'};\n  cin >> a;\n  int ava = 0;\n  for (int j = 6; j >= 0; j--) {\n    if (ava == 1) {\n      printf(\"%c\", a[j]);\n    }\n    if (a[j] != '0') {\n      ava = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d\", &n);\n  if (n >= 1000) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = (n % 1000) / 100;\n    d = n / 1000;\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\", x);\n  } else if (n >= 100) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = n / 100;\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\", x);\n  } else if (n >= 10) {\n    a = n % 10;\n    b = n / 10;\n    x = a * 10 + b;\n    printf(\"%02d\", x);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  cin >> a;\n  b = a / 1000;\n  c = a % 1000;\n  d = c % 100;\n  e = d % 10;\n  c = c / 100;\n  d = d / 10;\n  printf(\"%d\", e);\n  if (d != 0, (b + c + d) != 0)\n    printf(\"%d\", d);\n  if (c != 0, (b + c) != 0)\n    cout << c;\n  if (b != 0)\n    printf(\"%d\", b);\n}\n"}
{"label": "16", "index": "29241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 10)\n    printf(\"01\");\n  else {\n    if (n / 1000 > 0) {\n      a = n % 10;\n      b = ((n - a) / 10) % 10;\n      c = ((n - a - b * 10) / 100) % 10;\n      d = n / 1000;\n      s = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%d\", s);\n    } else {\n      if (n / 100 > 0) {\n        a = n % 10;\n        b = ((n - a) / 10) % 10;\n        c = n / 100;\n        s = a * 100 + b * 10 + c;\n        printf(\"%d\", s);\n      } else {\n        if (n / 10 > 0) {\n          a = n % 10;\n          b = n / 10;\n          s = a * 10 + b;\n          printf(\"%d\", s);\n        } else\n          printf(\"%d\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, i;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n / 10) % 10;\n  d = n % 10;\n  if (a)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (c)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n}\n"}
{"label": "16", "index": "29243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n\n  if (n >= 1000) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (n >= 100) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n % 10;\n\n      printf(\"%d%d%d\", c, b, a);\n    } else {\n      if (n >= 10) {\n        a = n / 10;\n        b = n % 10;\n        printf(\"%d%d\", b, a);\n      } else {\n        printf(\"%d\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, m, n;\n  scanf(\"%d \", &a);\n  if (a <= 10) {\n    printf(\"%d\", a);\n  } else {\n    if (a == 10 || a == 100 || a == 1000) {\n      cout << \"001\";\n    } else {\n      if (100 >= a && a >= 10) {\n        b = a % 10;\n        c = (int)(a / 10);\n        d = 10 * b + a;\n        printf(\"%d\\n\", d);\n      } else {\n        if (1000 >= a && a >= 100) {\n          e = (int)(a / 100);\n          f = (int)((a - 100 * e) / 10);\n          g = a - 100 * e - 10 * f;\n          m = 100 * g + 10 * f + e;\n          printf(\"%d\\n\", m);\n        } else {\n          h = (int)(a / 1000);\n          i = (int)((a - 1000 * h) / 100);\n          j = (int)((a - 1000 * h - 100 * i) / 10);\n          k = a - 1000 * h - 100 * i - 10 * j;\n          n = 1000 * k + 100 * j + 10 * i + h;\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, temp, p, q;\n  scanf(\"%d\", &a);\n  temp = a;\n  if (a != 0) {\n    while (temp % 10 - temp != 0 || (temp % 10 - temp == 0 && q >= 10)) {\n      p = temp % 10;\n      printf(\"%d\", p);\n      q = temp;\n      temp = temp / 10;\n    }\n  } else\n    printf(\"0\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char a[5] = {'\\0', '\\0', '\\0', '\\0', '\\0'};\n  scanf(\"%s\", a);\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      cout << a[i];\n  }\n}\n"}
{"label": "16", "index": "29247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int d, e, f, g, h, j, k, l, m, i, n;\n  char p[10];\n  scanf(\"%s\", p);\n  for (i = strlen(p) - 1; i >= 0; i--)\n    cout << p[i];\n  return 7;\n}\n"}
{"label": "16", "index": "29248", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j;\n  int a[5];\n  cin >> n;\n  for (; n > 0;) {\n    a[i] = n % 10;\n    i++;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a / 1000;\n  c = a % 1000;\n  d = c % 100;\n  e = d % 10;\n  c = c / 100;\n  d = d / 10;\n  printf(\"%d\", e);\n  if (d != 0, (b + c + d) != 0)\n    printf(\"%d\", d);\n  if (c != 0, (b + c) != 0)\n    printf(\"%d\", c);\n  if (b != 0)\n    printf(\"%d\", b);\n}\n"}
{"label": "16", "index": "29250", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, v, n4, n3, n2, n1;\n  double n0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n  } else if (n == 10000)\n    cout << 1 << endl;\n  else {\n    n0 = n;\n    v = log10(n0) + 1;\n    n4 = n / 1000;\n    n3 = (n - n4 * 1000) / 100;\n    n2 = (n - n4 * 1000 - n3 * 100) / 10;\n    n1 = n - n4 * 1000 - n3 * 100 - n2 * 10;\n    switch (v) {\n    case 4:\n      printf(\"%d%d%d%d\\n\", n1, n2, n3, n4);\n      break;\n    case 3:\n      cout << n1 << n2 << n3 << endl;\n      break;\n    case 2:\n      printf(\"%d%d\\n\", n1, n2);\n      break;\n    case 1:\n      cout << n1 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  do {\n    cout << (n % 10);\n    n = (int)n / 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  else\n    return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  scanf(\"%d\", &N);\n  if (N != 0) {\n    while (N % (1 * e(i)) != N) {\n      a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n      i++;\n    }\n    while (t <= i - 1) {\n      printf(\"%d\", a[t]);\n      t++;\n    }\n  } else\n    cout << \"0\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  b = (n - a) % 100 / 10;\n  c = (n - (n % 100)) % 1000 / 100;\n  d = (n - (n % 1000)) % 10000 / 1000;\n  e = 1;\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    if (n < 100) {\n      cout << a << b;\n    } else {\n      if (n < 1000) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n < 10000) {\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else {\n          printf(\"abcde\");\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29254", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  cin >> x;\n  a = x / 1000;\n  b = (x - 1000 * a) / 100;\n  c = (x - 1000 * a - 100 * b) / 10;\n  d = x - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    y = d * 100 + c * 10 + b;\n    if (b == 0) {\n      y = d * 10 + c;\n      if (c == 0)\n        y = d;\n    }\n  } else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d != 0)\n    printf(\"%d\", y);\n  if ((d == 0) && (c != 0))\n    printf(\"0%d\", y);\n  if ((d == 0) && (c == 0) && (b != 0))\n    printf(\"00%d\", y);\n  if ((d == 0) && (c == 0) && (b == 0))\n    printf(\"000%d\", y);\n  return 0;\n}\n"}
{"label": "16", "index": "29255", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a < 100) {\n    int b, c;\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%02d\\n\", 10 * b + c);\n  } else if (a < 1000) {\n    int d, e, f;\n    d = a % 10;\n    e = a % 100;\n    e = (e - d) / 10;\n    f = (a - d - 10 * e) / 100;\n    printf(\"%03d\\n\", 100 * d + 10 * e + f);\n  } else if (a < 10000) {\n    int g, h, i, j;\n    g = a % 10;\n    h = a % 100;\n    h = (h - g) / 10;\n    i = a % 1000;\n    i = (i - 10 * h - g) / 100;\n    j = (a - 100 * i - 10 * h - g) / 1000;\n    printf(\"%04d\\n\", 1000 * g + 100 * h + 10 * i + j);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j, a[6] = {0};\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  while (n != 0) {\n    a[i++] = n % 10;\n    n /= 10;\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  int a, c, d;\n  cin >> a;\n  c = a;\n  while (c >= 1) {\n    d = c - (c / 10) * 10;\n    c = c / 10;\n    cout << d;\n  }\n  if (a == 0)\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, g, h, i;\n  long f;\n  cin >> f;\n  a = f / 10000;\n  g = f % 10000;\n  b = g / 1000;\n  h = g % 1000;\n  c = h / 100;\n  i = h % 100;\n  d = i / 10;\n  e = i % 10;\n  if (a > 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "29259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int b = 0, n, c, i, a[5];\n  cin >> n;\n  if (n == 0) {\n    cout << '0' << endl;\n  } else {\n    for (i = 0; n > 0; i++) {\n      c = n % 10;\n      a[i] = c;\n      n = n / 10;\n      b += 1;\n    } \n    for (i = 0; i < b; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[5];\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - a[0] * 10000 - a[1] * 1000) / 100;\n  a[3] = (n - a[0] * 10000 - a[1] * 1000 - a[2] * 100) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  for (i = 0; i <= 4; i++) {\n    if (a[i]) {\n      for (j = 4; j >= i; j--)\n        cout << a[j];\n      break;\n    }\n  }\n  if (a[0] + a[1] + a[2] + a[3] + a[4] == 0)\n    cout << \"0\";\n  return 0;\n}\n"}
{"label": "16", "index": "29261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    a = b + 10 * c + 100 * d + 1000 * e;\n    if ((a % 10) == 0) {\n      a = a / 10;\n      if ((a % 10) == 0) {\n        a = a / 10;\n        if ((a % 10) == 0)\n          a = a / 10;\n      }\n    }\n    if (e == 0) {\n      cout << e;\n      if (d == 0) {\n        printf(\"%d\", d);\n        if (c == 0)\n          printf(\"%d\", c);\n      }\n    }\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a = 0, b;\n  cin >> n;\n  b = n;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    do {\n      a = a * 10 + n % 10;\n      n = n / 10;\n    } while (n != 0);\n    if (b % 10 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 100 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 1000 == 0 && b != 0)\n      cout << \"0\";\n    printf(\"%d\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[10] = {0};\n  int i, s = 0;\n\n  cin >> ch;\n  i = 0;\n  while (ch[i] != '\u0000') {\n    s = i;\n    i++;\n  }\n  for (i = s; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n}\n"}
{"label": "16", "index": "29264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int m = 0;\n  int nn = n;\n  for (int i = 1; i < 5; i++) {\n    n = n / 10;\n    if (n == 0) {\n      m = i;\n      break;\n    }\n  }\n  int a;\n  for (int i = 0; i < m; i++) {\n    a = nn % 10;\n    cout << a;\n    nn = nn / 10;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29265", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n  if (b == 1) {\n    printf(\"%d%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c >= 1) {\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d >= 1) {\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e >= 1) {\n          printf(\"%d%d\", f, e);\n        } else {\n          printf(\"%d\", f);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  do {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  } while (n != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e;\n  scanf(\"%d\", &i);\n  a = i / 10000;\n  b = (i - a * 10000) / 1000;\n  c = (i - 10000 * a - 1000 * b) / 100;\n  d = (i - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = i - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  else if (a == 0 && b == 0 && c == 0)\n    printf(\"%d%d\\n\", e, d);\n  else if (a == 0 && b == 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  else if (a == 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, len, i;\n  int a[10];\n  cin >> sum;\n  if (sum >= 10000)\n    len = 5;\n  else if (sum >= 1000)\n    len = 4;\n  else if (sum >= 100)\n    len = 3;\n  else if (sum >= 10)\n    len = 2;\n  else\n    len = 1;\n  for (i = 1; i <= len; i++) {\n    a[i] = sum / (pow(10, (len - i)));\n    sum = sum - a[i] * pow(10, (len - i));\n  }\n  for (i = 1; i <= len; i++)\n    printf(\"%d\", a[len - i + 1]);\n}\n"}
{"label": "16", "index": "29269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0;\n  cin >> a;\n  if (a != 0)\n    while (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n    }\n  else\n    cout << 0;\n}\n"}
{"label": "16", "index": "29270", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  while (a > 0) {\n    printf(\"%d\", a % 10);\n    a /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 10;\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else {\n    if (n == 10)\n      cout << 01 << endl;\n    else {\n      while (n > 0) {\n        cout << n % i;\n        n = n / i;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  scanf(\"%d\", &t);\n  a = t / 10000;\n  b = t / 1000 - 10 * a;\n  c = t / 100 - 100 * a - 10 * b;\n  d = t / 10 - 1000 * a - 100 * b - 10 * c;\n  e = t % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid nixu(int k);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  nixu(n);\n  return 0;\n}\nvoid nixu(int k) {\n  if (k > 0) {\n    cout << k % 10;\n    k /= 10;\n    nixu(k);\n  }\n}\n"}
{"label": "16", "index": "29274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0)\n    cout << a5 << endl;\n  else if (a1 == 0 && a2 == 0 && a3 == 0)\n    cout << a5 << a4 << endl;\n  else if (a1 == 0 && a2 == 0)\n    cout << a5 << a4 << a3 << endl;\n  else if (a1 == 0)\n    printf(\"%d%d%d%d\\n\", a5, a4, a3, a2);\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  scanf(\"%d\", &n);\n  b = n;\n  do {\n    a = b % 10;\n    c = b;\n    b = b / 10;\n    printf(\"%d\", a);\n  } while (c / 10 != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[5];\n  int i, t, k, l;\n  scanf(\"%s \", c);\n  k = strlen(c);\n  l = k / 2;\n  for (i = 0; i < l; i++) {\n    t = c[i];\n    c[i] = c[k - i - 1];\n    c[k - i - 1] = t;\n  }\n  cout << c;\n  return 0;\n}\n"}
{"label": "16", "index": "29277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4];\n  int n;\n  scanf(\"%d \", &n);\n  a[0] = n / 1000;\n  a[1] = (n - a[0] * 1000) / 100;\n  a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n  a[3] = n % 10;\n  if (a[0] == 0) {\n    if (a[1] == 0) {\n      if (a[2] == 0)\n        cout << a[3] << endl;\n      else\n        cout << a[3] << a[2] << endl;\n    } else\n      cout << a[3] << a[2] << a[1] << \"\\n\";\n  } else\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29278", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char num[100];\n  int k = -1;\n  cin >> num[0];\n  for (int i = 1; num[i - 1] != '\\n'; i++, k++) {\n    cin.get(num[i]);\n  }\n  for (; k >= 0; k--) {\n    cout << num[k];\n  }\n  cout << endl;\n  \n}\n"}
{"label": "16", "index": "29279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct integ {\n  char num;\n  struct integ *next;\n} * head, *p1, *p2, *p3, *newhead;\nint main() {\n  int i, n = 0;\n  p1 = p2 = (struct integ *)malloc(sizeof(struct integ));\n  head = NULL;\n  for (i = 0;; i++) {\n    scanf(\"%c\", &p1->num);\n    if (p1->num < 48 || p1->num > 57)\n      break;\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct integ *)malloc(sizeof(struct integ));\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (i == 0) {\n      p3 = newhead = p1;\n    } else\n      p3 = p3->next = p1;\n    p2->next = NULL;\n  }\n  for (p1 = newhead; p1 != NULL; p1 = p1->next)\n    cout << p1->num;\n  return 0;\n}\n"}
{"label": "16", "index": "29280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n}\n"}
{"label": "16", "index": "29281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, k, s;\n  cin >> n;\n  i = n;\n  s = 0;\n  while (i > 0) {\n    k = i % 10;\n    if (k == 0)\n      printf(\"0\"), i /= 10;\n    else {\n      i = i / 10;\n      s = s * 10 + k;\n    }\n  }\n  printf(\"%d\\n\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "29282", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[6], m = 0, j, i, p = 0, k = 0; \n  cin >> n;                               \n  for (i = 0;; i++) {\n    a[i] = n % 10;\n    n = (n - a[i]) / 10;\n    if (n != 0)\n      p += 1;\n    else\n      break;\n  } \n  for (i = 0; i <= p; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  scanf(\"%d \", &n);\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n > 1000 && n < 10000) {\n    a[3] = n / 1000;\n    a[2] = (n % 1000) / 100;\n    a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n    a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n    printf(\"%d\\n\", a[0] * 1000 + a[1] * 100 + a[2] * 10 + a[3]);\n  } else if (n == 100)\n    cout << \"001\";\n  else if (n > 100 && n < 1000) {\n    a[2] = n / 100;\n    a[1] = (n % 100) / 10;\n    a[0] = n - a[2] * 100 - a[1] * 10;\n    cout << a[0] * 100 + a[1] * 10 + a[2];\n  } else if (n == 10)\n    cout << \"01\";\n  else if (n > 10 && n < 100) {\n    a[1] = n / 10;\n    a[0] = n - a[1] * 10;\n    cout << a[0] * 10 + a[1];\n  } else if (n >= 0 && n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29284", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n  if (b == 1) {\n    printf(\"%d%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c >= 1) {\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d >= 1) {\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e >= 1) {\n          printf(\"%d%d\", f, e);\n        } else {\n          printf(\"%d\", f);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 1, n, m, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    m = 1;\n  else {\n    if (n < 100) {\n      m = 2;\n    } else if (n < 1000)\n      m = 3;\n    else if (n < 10000)\n      m = 4;\n  }\n  while (i <= m) {\n    p = n - n / 10 * 10;\n    cout << p;\n    n = n / 10;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[7], i, j;\n  scanf(\"%s\", &a);\n  for (i = 1; a[i] != '\\0'; i++)\n    j = i;\n\n  for (i = j; i >= 0; i--)\n    printf(\"%c\", a[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29287", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  b = 0;\n  while (a) {\n    b = a % 10;\n    cout << b;\n    a = a / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4], b;\n\n  scanf(\"%d \", &b);\n  a[0] = b % 10;\n  b = b / 10;\n  a[1] = b % 10;\n  b = b / 10;\n  a[2] = b % 10;\n  b = b / 10;\n  a[3] = b % 10;\n  b = b / 10;\n  if (a[3] != 0)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (a[2] != 0)\n    cout << a[0] << a[1] << a[2];\n  else if (a[1] != 0)\n    cout << a[0] << a[1];\n  else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29289", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len;\n  char str[6];\n\n  cin >> str;\n  len = strlen(str);\n  for (int i = len - 1; i >= 0; i--)\n    cout << str[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = (x - 1000 * a) / 100;\n  c = (x - 1000 * a - 100 * b) / 10;\n  d = x - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    y = d * 100 + c * 10 + b;\n    if (b == 0) {\n      y = d * 10 + c;\n      if (c == 0)\n        y = d;\n    }\n  } else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d != 0)\n    cout << y;\n  if ((d == 0) && (c != 0))\n    printf(\"0%d\", y);\n  if ((d == 0) && (c == 0) && (b != 0))\n    cout << \"00\" << y;\n  if ((d == 0) && (c == 0) && (b == 0))\n    printf(\"000%d\", y);\n  return 0;\n}\n"}
{"label": "16", "index": "29291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  do {\n    printf(\"%d\", (n % 10));\n    n /= 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 1000;\n  c = (a - 1000 * b) / 100;\n  d = (a - 1000 * b - 100 * c) / 10;\n  e = a - 1000 * b - 100 * c - 10 * d;\n  if (b > 0)\n    cout << e << d << c << b;\n  else if (b == 0 && c > 0)\n    cout << e << d << c;\n  else if (b == c == 0 && d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], i, j;\n  for (i = 0; i < 5; i++) {\n    a[i] = getchar();\n    if (a[i] < 48 || a[i] > 57) {\n      j = i;\n      break;\n    }\n  }\n  for (i = j; i >= 0; i--)\n    putchar(a[i]);\n}\n"}
{"label": "16", "index": "29294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = (x - 1000 * a) / 100;\n  c = (x - 1000 * a - 100 * b) / 10;\n  d = x - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    y = d * 100 + c * 10 + b;\n    if (b == 0) {\n      y = d * 10 + c;\n      if (c == 0)\n        y = d;\n    }\n  } else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d != 0)\n    printf(\"%d\", y);\n  if ((d == 0) && (c != 0))\n    printf(\"0%d\", y);\n  if ((d == 0) && (c == 0) && (b != 0))\n    printf(\"00%d\", y);\n  if ((d == 0) && (c == 0) && (b == 0))\n    printf(\"000%d\", y);\n  return 0;\n}\n"}
{"label": "16", "index": "29295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = (int)a / 10;\n    c = a - b * 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = (int)a / 100;\n    c = (int)(a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = (int)a / 1000;\n    c = (int)(a - 1000 * b) / 100;\n    d = (int)(a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "29296", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int t, n, a, b, c, d, e, i, j, k, l, m;\n\n  scanf(\"%d\", &n);\n  t = n;\n  j = t / 10000;\n  if (j != 0) {\n    i = 5;\n    t = 0;\n  }\n\n  j = t / 1000;\n  if (j != 0) {\n    i = 4;\n    t = 0;\n  }\n\n  j = t / 100;\n  if (j != 0) {\n    i = 3;\n    t = 0;\n  }\n\n  j = t / 10;\n  if (j != 0) {\n    i = 2;\n    t = 0;\n  }\n\n  j = t / 1;\n  if (j != 0) {\n    i = 1;\n    t = 0;\n  }\n\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    a = n / 10000;\n    n = n % 10000;\n    b = n / 1000;\n    n = n % 1000;\n    c = n / 100;\n    n = n % 100;\n    d = n / 10;\n    n = n % 10;\n    e = n;\n\n    if (i == 5)\n      printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    if (i == 4)\n      printf(\"%d%d%d%d\", e, d, c, b);\n    if (i == 3)\n      printf(\"%d%d%d\", e, d, c);\n    if (i == 2)\n      printf(\"%d%d\", e, d);\n    if (i == 1)\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = (a - b * 10000 - c * 1000) / 100;\n  e = (a - b * 10000 - c * 1000 - d * 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  else if (c != 0)\n    cout << f << e << d << c;\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    cout << f << e;\n  else\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "29298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[5];\n  int i, t, k, l;\n  cin >> c;\n  k = strlen(c);\n  l = k / 2;\n  for (i = 0; i < l; i++) {\n    t = c[i];\n    c[i] = c[k - i - 1];\n    c[k - i - 1] = t;\n  }\n  cout << c;\n  return 0;\n}\n"}
{"label": "16", "index": "29299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  if (!N)\n    cout << 0 << endl;\n  else\n    while (N) {\n      cout << N % 10;\n      N /= 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "29300", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[4];\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n\n  if (n / 10 == 0)\n    i = 1;\n  else if (n / 100 == 0)\n    i = 2;\n  else if (n / 1000 == 0)\n    i = 3;\n  else if (n / 10000 == 0)\n    i = 4;\n\n  for (j = i; j >= 1; j--) {\n    a[j - 1] = n / (pow(10, (double)(j - 1)));\n    n = n - pow(10, (double)(j - 1)) * a[j - 1];\n  }\n  for (k = 0; k <= i - 1; k++)\n    cout << a[k];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, i, j, a[5];\n  scanf(\"%d \", &x);\n  i = 0;\n  while (x >= 10) {\n    a[i] = x % 10;\n    x = x / 10;\n    i = i + 1;\n  }\n  a[i] = x;\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]);\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "29302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 10 * b - 100 * a;\n  d = n - 10 * c - 100 * b - 1000 * a;\n  if (a == 0 && b == 0 && c == 0)\n    printf(\"%d\", d);\n  if (a == 0 && b == 0 && c != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  }\n  if (a == 0 && b != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  }\n  if (a != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else if (n < 100)\n    cout << n % 10 << n / 10;\n  else if (n < 1000) {\n    a = n % 10;\n    n = (n - a) / 10;\n    b = n % 10;\n    n = (n - b) / 10;\n    cout << a << b << n;\n  } else if (n < 10000) {\n    a = n % 10;\n    n = (n - a) / 10;\n    b = n % 10;\n    n = (n - b) / 10;\n    c = n % 10;\n    n = (n - c) / 10;\n    cout << a << b << c << n;\n  } else\n    cout << \"0\"\n         << \"0\"\n         << \"0\"\n         << \"0\"\n         << \"1\";\n  return 0;\n}\n"}
{"label": "16", "index": "29304", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int sv[4];\n  cin >> n;\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else if (n / 1000 != 0 && n != 10000 && n >= 1000) {\n    for (i = 0; i < 4; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 4; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 100 != 0 && n >= 100) {\n    for (i = 0; i < 3; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 3; i++) {\n      printf(\"%d\", sv[i]);\n    }\n    cout << endl;\n  } else if (n / 10 != 0 && n >= 10) {\n    for (i = 0; i < 2; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 2; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else {\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 1, n, m, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    m = 1;\n  else if (n < 100)\n    m = 2;\n  else if (n < 1000)\n    m = 3;\n  else if (n < 10000)\n    m = 4;\n  while (i <= m) {\n    p = n - n / 10 * 10;\n    printf(\"%d\", p);\n    n = n / 10;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29306", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(int n) {\n  cout << n % 10;\n  n = n / 10;\n  if (n)\n    f(n);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  f(n);\n  return 0;\n}\n"}
{"label": "16", "index": "29307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a1, a2, a3, a4;\n  scanf(\"%d\", &n);\n  if (n >= 1000) {\n    a4 = n / 1000;\n    a3 = (n - a4 * 1000) / 100;\n    a2 = (n - a4 * 1000 - a3 * 100) / 10;\n    a1 = n - a4 * 1000 - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d%d\", a1, a2, a3, a4);\n  }\n  if (n >= 100 && n < 1000) {\n    a3 = n / 100;\n    a2 = (n - a3 * 100) / 10;\n    a1 = n - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d\", a1, a2, a3);\n  }\n  if (n >= 10 && n < 100) {\n    a2 = n / 10;\n    a1 = n - a2 * 10;\n    printf(\"%d%d\", a1, a2);\n  }\n  if (n < 10) {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else\n    while (n) {\n      printf(\"%d\", n % 10);\n      n = n / 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "29309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  scanf(\"%d\", &num);\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (num == 10000)\n    printf(\"1\\n\");\n  if (num > 999)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (num > 9)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "29310", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nlong num;\nlong digit[5];\nint main() {\n  int count = 0, i;\n  long number;\n  do {\n    scanf(\"%ld \", &num);\n  } while (num < 0 || num > 99999);\n  count = 0;\n  number = num;\n  do {\n    digit[count++] = number % 10;\n    number = number / 10;\n  } while (number > 0);\n  for (i = 0; i < count; i++)\n    printf(\"%ld\", digit[i]);\n}\n"}
{"label": "16", "index": "29311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, len = 0, temp[6];\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  while (n > 0) {\n    temp[len++] = n % 10;\n    n = n / 10;\n  }\n  for (int i = 0; i < len; i++)\n    cout << temp[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000];\n  cin >> str;\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    cout << str[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100)\n    printf(\"%d%d\", a % 10, (a - a % 10) / 10);\n  else if (a < 1000) {\n    printf(\"%d%d%d\", a % 10, (a % 100 - a % 10) / 10, (a - a % 100) / 100);\n  } else if (a < 10000)\n    printf(\"%d%d%d%d\", a % 10, (a % 100 - a % 10) / 10,\n           (a % 1000 - a % 100) / 100, (a - a % 1000) / 1000);\n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, num, m, a, b;\n  scanf(\"%d\", &num);\n  m = num;\n  do {\n    n = n * 10 + num % 10;\n    num = num / 10;\n  } while (num != 0);\n\n  int weishu(int x);\n  a = weishu(m);\n  b = weishu(n);\n  if (a - b == 4)\n    printf(\"0000%d\\n\", n);\n  else if (a - b == 3)\n    printf(\"000%d\\n\", n);\n  else if (a - b == 2)\n    printf(\"00%d\\n\", n);\n  else if (a - b == 1)\n    printf(\"0%d\\n\", n);\n  else\n    printf(\"%d\\n\", n);\n}\n\nint weishu(int x) {\n  int y;\n  if (x >= 10000)\n    y = 5;\n  else if (x >= 1000)\n    y = 4;\n  else if (x >= 100)\n    y = 3;\n  else if (x >= 10)\n    y = 2;\n  else\n    y = 1;\n  return (y);\n}\n"}
{"label": "16", "index": "29315", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a < 10) {\n    printf(\"%d\", a);\n  } else if (a < 100) {\n    b = (int)a / 10;\n    c = a - b * 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = (int)a / 100;\n    c = (int)(a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = (int)a / 1000;\n    c = (int)(a - 1000 * b) / 100;\n    d = (int)(a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29316", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, g;\n  cin >> i;\n  if ((i >= 10) && (i < 100)) {\n    a = i / 1000;\n    b = i % 10;\n    g = 10 * b + a;\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i > 0) && (i < 10)) {\n    g = i;\n    printf(\"%d\", i);\n  }\n  if ((i >= 100) && (i < 1000)) {\n    a = i / 100;\n    b = (i / 10) % 10;\n    c = i % 10;\n    g = 100 * c + 10 * b + a;\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i >= 1000) && (i < 10000)) {\n\n    a = i / 1000;\n    b = (i / 100) % 10;\n    c = (i / 10) % 10;\n    d = i % 10;\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n\n  char a[10];\n  int i = 0;\n  int n;\n  while ((a[i] = getchar()) != '\\n')\n    i++;\n  n = i;\n  for (i = n; i >= 0; i--)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n\n  cin >> a;\n  int i;\n  for (i = strlen(a); i > 0; i--)\n    printf(\"%c\", a[i - 1]);\n  return 0;\n}\n"}
{"label": "16", "index": "29319", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, n, m;\n  cin >> n;\n  a = n / 10000;\n  b = n / 1000;\n  c = n / 100;\n  d = n / 10;\n  e = n / 1;\n  if (a > 0) {\n    printf(\"00001\");\n  } else if (b > 0) {\n    c = (n - b * 1000) / 100;\n    d = (n - b * 1000 - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (c > 0) {\n    d = (n - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d\", e, d, c);\n  } else {\n    if (d > 0) {\n      e = n - d * 10;\n      printf(\"%d%d\", e, d);\n    } else {\n      printf(\"%d\", e);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29320", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d \", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0)\n    printf(\"%d%d\", a % 10, a / 10);\n  else if (a / 1000 == 0)\n    printf(\"%d%d%d\", a % 10, a % 100 / 10, a / 100);\n  else\n    cout << a % 10 << a % 100 / 10 << a % 1000 / 100 << a / 1000;\n  return 0;\n}\n"}
{"label": "16", "index": "29321", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    a = b + 10 * c + 100 * d + 1000 * e;\n    if ((a % 10) == 0) {\n      a = a / 10;\n      if ((a % 10) == 0) {\n        a = a / 10;\n        if ((a % 10) == 0)\n          a = a / 10;\n      }\n    }\n    if (e == 0) {\n      printf(\"%d\", e);\n      if (d == 0) {\n        printf(\"%d\", d);\n        if (c == 0) {\n          printf(\"%d\", c);\n        }\n      }\n    }\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e, y;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  } else if (b != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  } else if (c != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  } else if (d != 0) {\n    printf(\"%d\", e);\n    cout << d;\n  } else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct integ {\n  char num;\n  struct integ *next;\n} * head, *p1, *p2, *p3, *newhead;\nint main() {\n  int i, n = 0;\n  p1 = p2 = (struct integ *)malloc(sizeof(struct integ));\n  head = NULL;\n  for (i = 0;; i++) {\n    scanf(\"%c\", &p1->num);\n    if (p1->num < 48 || p1->num > 57)\n      break;\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct integ *)malloc(sizeof(struct integ));\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (i == 0) {\n      p3 = newhead = p1;\n    } else\n      p3 = p3->next = p1;\n    p2->next = NULL;\n  }\n  for (p1 = newhead; p1 != NULL; p1 = p1->next)\n    printf(\"%c\", p1->num);\n}\n"}
{"label": "16", "index": "29324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\", 0, 0, 0, 0, 1);\n  else if (a > 999)\n    printf(\"%d%d%d%d\", a % 1000 % 100 % 10, a % 1000 % 100 / 10, a % 1000 / 100,\n           a / 1000);\n  else if (a > 99)\n    printf(\"%d%d%d\", a % 100 % 10, a % 100 / 10, a / 100);\n  else if (a > 9)\n    cout << a % 10 << a / 10;\n  else\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, v, n4, n3, n2, n1;\n  double n0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n  } else if (n == 10000) {\n    cout << 1 << endl;\n  } else {\n    n0 = n;\n    v = log10(n0) + 1;\n    n4 = n / 1000;\n    n3 = (n - n4 * 1000) / 100;\n    n2 = (n - n4 * 1000 - n3 * 100) / 10;\n    n1 = n - n4 * 1000 - n3 * 100 - n2 * 10;\n    switch (v) {\n    case 4:\n      cout << n1 << n2 << n3 << n4 << endl;\n      break;\n    case 3:\n      cout << n1 << n2 << n3 << endl;\n      break;\n    case 2:\n      cout << n1 << n2 << endl;\n      break;\n    case 1:\n      cout << n1 << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a / 1000 == 0) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a / 10000 == 0) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    f = a % 10;\n    printf(\"%d%d%d%d\", f, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, y;\n  cin >> n;\n  if (n > 9999)\n    y = 5;\n  else if (n > 999)\n    y = 4;\n  else if (n > 99)\n    y = 3;\n  else if (n > 9)\n    y = 2;\n  else\n    y = 1;\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = (n - a * 1000 - b * 100 - c * 10);\n  switch (y) {\n  case 5:\n    printf(\"10000\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", d, c, b, a);\n    break;\n  case 3:\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\", d, c);\n    break;\n  case 1:\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  cout << b;\n  c = a / 10;\n  if (c != 0)\n    cout << c % 10;\n  d = a / 100;\n  if (d != 0)\n    cout << d % 10;\n  e = a / 1000;\n  if (e != 0)\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[6];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    if (n == n % 10) {\n      i = i + 5;\n      cout << n;\n    } else {\n      a[i] = n % 10;\n      n = n / 10;\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29331", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m;\n  cin >> n;\n  if (n == 0) {\n    printf(\"%d\", 0);\n  } else {\n    while (n != 0) {\n      m = n % 10;\n      printf(\"%d\", m);\n      n = n / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = n / 10 % 10;\n  c = n / 100 % 10;\n  d = n / 1000 % 10;\n  if (n >= 10) {\n    if (n / 10 >= 10) {\n      if (n / 100 >= 10) {\n        if (n / 1000 < 10)\n          printf(\"%d%d%d%d\\n\", a, b, c, d);\n      } else\n        printf(\"%d%d%d\\n\", a, b, c);\n    } else\n      printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "16", "index": "29333", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, m, n, a[10];\n  cin >> n;\n  m = n;\n  p = 1;\n  while (m / 10 != 0) {\n    a[p - 1] = m % 10;\n    m = m / 10;\n    p++;\n  }\n  a[p - 1] = m;\n  for (int j = 0; j < p; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29334", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[100], str2[100];\n  int i, j, l;\n  cin >> str1;\n  l = strlen(str1);\n  j = 0;\n  for (i = l - 1; i >= 0; --i)\n    str2[j++] = str1[i];\n  str2[j] = '\\0';\n  printf(\"%s\\n\", str2);\n  return 0;\n}\n"}
{"label": "16", "index": "29335", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[5], c;\n  memset(a, ' ', sizeof(a));\n  cin.getline(a, 5);\n  for (i = 5; i >= 0; i--) {\n    if (a[i] == '0' || a[i] == '1' || a[i] == '2' || a[i] == '3' ||\n        a[i] == '4' || a[i] == '5' || a[i] == '6' || a[i] == '7' ||\n        a[i] == '8' || a[i] == '9') {\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 100 * a - 10 * b;\n  d = n - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29337", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p;\n  cin >> n;\n  p = 0;\n  cout << (n % 10);\n  while (n > 9) {\n    p = (n - (n % 10)) / 10;\n    n = p;\n    printf(\"%d\", (n % 10));\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[6], t[6];\n  int i, x;\n  cin >> s;\n  x = strlen(s);\n  for (i = 0; i <= x - 1; i++) {\n    t[x - 1 - i] = s[i];\n  }\n  for (i = x; i <= 5; i++)\n    t[i] = 0;\n  puts(t);\n  return 0;\n}\n"}
{"label": "16", "index": "29339", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e;\n  cin >> i;\n  a = i / 10000;\n  b = (i - a * 10000) / 1000;\n  c = (i - 10000 * a - 1000 * b) / 100;\n  d = (i - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = i - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  else if (a == 0 && b == 0 && c == 0)\n    printf(\"%d%d\\n\", e, d);\n  else if (a == 0 && b == 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  else if (a == 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else\n    cout << e << d << c << b << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char num[6];\n  int i, n, nnum[6], p = 0;\n  scanf(\"%s\", num);\n  n = strlen(num);\n\n  for (i = n - 1; i >= 0; i--) {\n    nnum[i] = num[i] - 48;\n    cout << nnum[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  int x, y;\n  x = a % 10;\n  y = a / 10;\n  printf(\"%d\", x);\n  while (y > 0) {\n    x = y % 10;\n    y = y / 10;\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "16", "index": "29342", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int tmp;\n  cin >> n;\n  while (1) {\n    tmp = n % 10;\n    printf(\"%d\", tmp);\n    if (!(n = n / 10))\n      break;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29343", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  cin >> n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100)\n    printf(\"%d%d\", n % 10, n / 10);\n  else if (n < 1000) {\n    a = n / 100;\n    b = n / 10 - 10 * a;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n < 10000) {\n    d = n / 1000;\n    e = n / 100 - 10 * d;\n    f = n / 10 - d * 100 - e * 10;\n    g = n % 10;\n    printf(\"%d%d%d%d\", g, f, e, d);\n  } else\n    printf(\"over\");\n  return 0;\n}\n"}
{"label": "16", "index": "29344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int z;\n  int a, b, c, d, e;\n  scanf(\"%d\", &z);\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      printf(\"%d%d%d%d\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "16", "index": "29345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, k, a, b, c, d;\n  cin >> x;\n  if (x > 999)\n    k = 4;\n  else if (x > 99)\n    k = 3;\n  else if (x > 9)\n    k = 2;\n  else\n    k = 1;\n  switch (k) {\n  case 1:\n    d = x;\n    cout << d << \"\\n\";\n    break;\n  case 2:\n    c = x / 10;\n    d = x - 10 * c;\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 3:\n    b = x / 100;\n    c = (x - 100 * b) / 10;\n    d = x - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 4:\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, num, k, a[6];\n\n  scanf(\"%d \", &num);\n  if (num == 0)\n    cout << num;\n  for (i = 5; i >= 0; i--) {\n    a[5 - i] = num / (pow((float)10, i));\n    num = num - a[5 - i] * pow((float)10, i);\n  }\n\n  for (i = 0; i < 6; i++) {\n\n    if (a[i] != 0)\n      break;\n  }\n\n  for (k = 5; k >= i; k--) {\n\n    cout << a[k];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 10)\n    cout << \"01\";\n  else {\n    if (n / 1000 > 0) {\n      a = n % 10;\n      b = ((n - a) / 10) % 10;\n      c = ((n - a - b * 10) / 100) % 10;\n      d = n / 1000;\n      s = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%d\", s);\n    } else {\n      if (n / 100 > 0) {\n        a = n % 10;\n        b = ((n - a) / 10) % 10;\n        c = n / 100;\n        s = a * 100 + b * 10 + c;\n        printf(\"%d\", s);\n      } else {\n        if (n / 10 > 0) {\n          a = n % 10;\n          b = n / 10;\n          s = a * 10 + b;\n          printf(\"%d\", s);\n        } else\n          printf(\"%d\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *a, *p;\n\n  a = (char *)malloc(1000);\n  cin >> a;\n  for (p = a; *p != '\u0000'; p++) {\n    ;\n  }\n  p--;\n  for (; p >= a; p--)\n    printf(\"%c\", *p);\n  return 0;\n}\n"}
{"label": "16", "index": "29349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, x, y, z, n, b, place;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    place = 5;\n  if (a > 999)\n    place = 4;\n  else if (a > 999)\n    place = 4;\n  else if (a > 99)\n    place = 3;\n  else if (a > 9)\n    place = 2;\n  else\n    place = 1;\n  n = a / 1000;\n  x = a / 100 % 10;\n  y = a / 10 % 10;\n  z = a % 10;\n  switch (place) {\n  case 5:\n    printf(\"00001\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", z, y, x, n);\n    break;\n\n  case 3:\n    printf(\"%d%d%d\", z, y, x);\n    break;\n\n  case 2:\n    printf(\"%d%d\", z, y);\n    break;\n  case 1:\n    printf(\"%d\", z);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29350", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, w, l;\n  cin >> n;\n  if (n - 10 < 0) {\n    printf(\"%d\", n);\n  } else {\n    if (n - 100 < 0) {\n      i = n % 10;\n      j = (n - i) / 10;\n      printf(\"%d%d\", i, j);\n    } else {\n      if (n - 1000 < 0) {\n        i = n % 10;\n        j = ((n - i) / 10) % 10;\n        k = (n - i - 10 * j) / 100;\n        printf(\"%d%d%d\", i, j, k);\n      } else {\n        if (n - 10000 < 0) {\n          i = n % 10;\n          j = ((n - i) % 100) / 10;\n          k = ((n - i - 10 * j) % 1000) / 100;\n          w = (n - i - 10 * j - 100 * k) / 1000;\n          printf(\"%d%d%d%d\", i, j, k, w);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char num[5];\n  int i, len;\n  scanf(\"%s\", num);\n\n  len = strlen(num);\n  for (i = len - 1; i >= 0; i--) {\n    cout << num[i];\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d \", &a);\n  if (a >= 1000) {\n    b = a % 1000;\n    c = b % 100;\n    d = c % 10;\n    cout << d << (c - d) / 10 << (b - c) / 100 << (a - b) / 1000 << endl;\n  } else if (a < 1000 && a >= 100) {\n    b = a % 100;\n    c = b % 10;\n    cout << c << (b - c) / 10 << (a - b) / 100 << endl;\n  } else if (a < 100 && a >= 10) {\n    b = a & 10;\n    cout << b << (a - b) / 10 << endl;\n  } else {\n    if (a >= 0 && a <= 9) {\n      cout << a << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29353", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d \", &a);\n  b = a / 10000;\n  if (b)\n    c = 5;\n  else {\n    b = a / 1000;\n    if (b)\n      c = 4;\n    else {\n      b = a / 100;\n      if (b)\n        c = 3;\n      else {\n        b = a / 10;\n        if (b)\n          c = 2;\n        else\n          c = 1;\n      }\n    }\n  }\n  switch (c) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100,\n           a % 10000 / 1000, a / 10000);\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a % 10, a % 100 / 10, a / 100);\n    break;\n  case 2:\n    printf(\"%d%d \", a % 10, a / 10);\n    break;\n  case 1:\n    printf(\"%d \", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  i = (n % 10) * 10 + (n - n % 10) / 10;\n  j = (n % 10) * 100 + (n % 100 - n % 10) + (n - n % 100) / 100;\n  k = (n % 10) * 1000 + (n % 100 - n % 10) * 10 + (n % 1000 - n % 100) / 10 +\n      (n - n % 1000) / 1000;\n  if (n % 10 == n)\n    cout << n;\n  else if (n % 100 == n)\n    printf(\"%02d\", i);\n  else if (n % 1000 == n)\n    printf(\"%03d\", j);\n  else\n    printf(\"%04d\", k);\n  return 0;\n}\n"}
{"label": "16", "index": "29355", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 0; n; i++) {\n    cout << n % 10;\n    n /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29356", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, a[10], m, i;\n  cin >> t;\n  for (i = 0; i <= 4; i++) {\n    a[i] = t % 10;\n    t = t / 10;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      m = i;\n      break;\n    }\n  }\n  for (i = 0; i <= m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, y;\n  scanf(\"%d \", &n);\n  if (n > 9999)\n    y = 5;\n  else if (n > 999)\n    y = 4;\n  else if (n > 99)\n    y = 3;\n  else if (n > 9)\n    y = 2;\n  else\n    y = 1;\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = (n - a * 1000 - b * 100 - c * 10);\n  switch (y) {\n  case 5:\n    printf(\"10000\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", d, c, b, a);\n    break;\n  case 3:\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\", d, c);\n    break;\n  case 1:\n    cout << d;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29358", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  cin >> num;\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (a == 0 && b != 0)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (a == 0 && b == 0 && c != 0) {\n    cout << d << c << endl;\n  } else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10001], b[10001], c[10001];\n  int x, i;\n  scanf(\"%s \", a);\n  x = strlen(a);\n  for (i = 0; i <= x; i++) {\n    b[i] = a[x - i - 1];\n  }\n\n  printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29360", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n / 10 < 1)\n    cout << n << endl;\n  else {\n    d = n % 10;\n    n = n / 10;\n    if (n / 10 < 1)\n      cout << d << n << endl;\n    else {\n      c = n % 10;\n      n = n / 10;\n      if (n / 10 < 1)\n        cout << d << c << n << endl;\n      else {\n        b = n % 10;\n        n = n / 10;\n        if (n / 10 < 1)\n          cout << d << c << b << n << endl;\n        else {\n          a = n % 10;\n          n = n / 10;\n          if (n / 10 < 1)\n            cout << d << c << b << a << n << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, p;\n  int i = 1;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    p = 1;\n  else if (n < 100)\n    p = 2;\n  else if (n < 1000)\n    p = 3;\n  else if (n < 10000)\n    p = 4;\n  do {\n    m = n % 10;\n    printf(\"%d\", m);\n    n = n / 10;\n    i++;\n  } while (i <= p);\n  return 0;\n}\n"}
{"label": "16", "index": "29362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29363", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n >= 10 && n < 100) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    cout << a[1] << a[2] << endl;\n  } else if (n >= 100 && n < 1000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    cout << a[1] << a[2] << a[3] << endl;\n  }\n\n  else if (n >= 1000 && n < 10000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    a[4] = (n / 1000) % 10;\n    printf(\"%d%d%d%d\\n\", a[1], a[2], a[3], a[4]);\n  }\n\n  else if (n = 10000)\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29364", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i;\n  scanf(\"%d \", &a);\n  if (a == 0)\n    printf(\"%d\", a);\n  for (i = 0; i < 5; i++) {\n    if (a != 0) {\n      printf(\"%d\", a % 10);\n    }\n    a = a / 10;\n  }\n  printf(\" \");\n  return (0);\n}\n"}
{"label": "16", "index": "29365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (a != 0) {\n    cout << d << c << b << a << endl;\n  } else if (b != 0) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  } else if (c != 0) {\n    cout << d << c << endl;\n  } else {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"%d\\n\", n);\n  else {\n    for (; n > 0;) {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = n / 10;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  if (n > 999 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  if (n > 99 && n < 1000) {\n    b = n / 100;\n    c = (n - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if (n > 9 && n < 100) {\n    c = n / 10;\n    d = n % 10;\n    printf(\"%d%d\", d, c);\n  }\n  if (n < 10)\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29368", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint invert(long m) {\n  printf(\"%ld\", m % 10);\n  m = m / 10;\n  if (m > 0) {\n    invert(m);\n  }\n}\nint main() {\n  long n;\n\n  cin >> n;\n  invert(n);\n  printf(\" \");\n}\n"}
{"label": "16", "index": "29369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b = 0;\n  do {\n    a[b] = getchar();\n    b++;\n  } while (b < 5);\n  if (a[1] == '\\n')\n    cout << a[0];\n  else if (a[2] == '\\n')\n    cout << a[1] << a[0];\n  else if (a[3] == '\\n')\n    printf(\"%c%c%c\", a[2], a[1], a[0]);\n  else if (a[4] == '\\n')\n    cout << a[3] << a[2] << a[1] << a[0];\n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "29370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i = 0;\n  int num[5];\n  scanf(\"%d \", &n);\n  while (n / 10 != 0) {\n    num[i++] = n % 10;\n    n /= 10;\n  }\n  num[i] = n;\n  for (int m = 0; m <= i; m++)\n    cout << num[m];\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10) / 1;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10) / 1;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10) / 1;\n    printf(\"%d%d\", c, b);\n  } else\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zhengshu[10001];\n  cin.getline(zhengshu, 10001);\n  int length = strlen(zhengshu), i, a[10000];\n  for (i = 0; i < length; i++) {\n    a[i] = zhengshu[i] - '0';\n  }\n  for (i = length - 1; i >= 0; i--) {\n    printf(\"%d\", a[i]);\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, b1, b2, b3, b4, b5;\n  cin >> num;\n  b1 = num / 10000;\n  b2 = (num - 10000 * b1) / 1000;\n  b3 = (num - 10000 * b1 - 1000 * b2) / 100;\n  b4 = (num - 10000 * b1 - 1000 * b2 - 100 * b3) / 10;\n  b5 = (num - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4);\n  if (b1 != 0)\n    printf(\"%d%d%d%d%d\", b5, b4, b3, b2, b1);\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "29374", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  i = 0;\n  char a[9], ch;\n  while ((ch = cin.get()) != '\\n') {\n    a[i] = ch;\n    i = i + 1;\n  }\n  i = i - 1;\n  while (i >= 0) {\n    printf(\"%c\", a[i]);\n    i = i - 1;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d\", &n);\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  cout << sum;\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a[1000];\n\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    cout << a[i];\n    n = n / 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29377", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long x;\n  int y, a, b, c, d, e;\n  cin >> x;\n  y = log10(x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  switch (y) {\n  case 0:\n    printf(\"%d\", e);\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n  default:\n    printf(\"0\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e;\n  scanf(\"%d\", &num);\n  a = num / 10000;\n  b = num % 10000 / 1000;\n  c = num % 1000 / 100;\n  d = num % 100 / 10;\n  e = num % 10;\n  if (num / 10000 == 1)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (num / 1000 != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (num / 100 != 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else if (num / 10 != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "29379", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, a[10];\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n}\n"}
{"label": "16", "index": "29380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a << endl;\n  else if (b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else if (c != 0)\n    cout << e << d << c << endl;\n  else if (d != 0)\n    printf(\"%d%d\\n\", e, d);\n  else\n    printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29381", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y = 0;\n  scanf(\"%d\", &x);\n  if (x < 10)\n    printf(\"%d\", x);\n  else {\n    while (x > 0) {\n      y = x % 10 + 10 * y;\n      x = x / 10;\n    }\n    if (x % 10 != 0)\n      printf(\"%d\", y);\n    else\n      printf(\"%03d\", y);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29382", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, m, p, q, k, l, s;\n  cin >> n;\n  if (n == 10000) {\n    a = 1;\n    printf(\"%05d\", a);\n  } else if (n >= 1000) {\n    s = n % 1000;\n    m = (n - s) / 1000;\n    l = s % 100;\n    p = (s - l) / 100;\n    q = l % 10;\n    k = (l - q) / 10;\n    a = q * 1000 + k * 100 + p * 10 + m;\n    printf(\"%04d\", a);\n  } else if (n >= 100) {\n    s = n % 100;\n    m = (n - s) / 100;\n    l = s % 10;\n    p = (s - l) / 10;\n    a = l * 100 + p * 10 + m;\n    printf(\"%03d\", a);\n  } else if (n >= 10) {\n    s = n % 10;\n    m = (n - s) / 10;\n    a = s * 10 + m;\n    printf(\"%02d\", a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29383", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d \", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = (x % 10000 - c * 100 - b * 10 - a) / 1000;\n  e = (x % 100000 - d * 1000 - c * 100 - b * 10 - a) / 10000;\n  if (e != 0)\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  if ((e == 0) && (d != 0))\n    printf(\"%d%d%d%d\", a, b, c, d);\n  if ((e == 0) && (d == 0) && (c != 0))\n    printf(\"%d%d%d\", a, b, c);\n  if ((e == 0) && (d == 0) && (c == 0) && (b != 0))\n    printf(\"%d%d\", a, b);\n  if ((e == 0) && (d == 0) && (c == 0) && (b == 0))\n    printf(\"%d\", a);\n}\n"}
{"label": "16", "index": "29384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s, k, a, b, c, d;\n  cin >> s;\n  a = (s - s % 1000) / 1000;\n  b = (s % 1000 - s % 100) / 100;\n  c = (s % 100 - s % 10) / 10;\n  d = s % 10;\n  k = d * 1000 + c * 100 + b * 10 + a;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        cout << d;\n      else\n        cout << d << c;\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n > 999)\n    p = 4;\n  else if (n > 99)\n    p = 3;\n  else if (n > 9)\n    p = 2;\n  else\n    p = 1;\n  x = n / 1000;\n  y = (n - x * 1000) / 100;\n  z = (n - x * 1000 - y * 100) / 10;\n  w = n - x * 1000 - y * 100 - z * 10;\n  switch (p) {\n  case 4:\n    printf(\"%d%d%d%d\", w, z, y, x);\n    break;\n  case 3:\n    printf(\"%d%d%d\", w, z, y);\n    break;\n  case 2:\n    cout << w << z;\n    break;\n  case 1:\n    printf(\"%d\", w);\n    break;\n  }\n}\n"}
{"label": "16", "index": "29386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d \", &a);\n  for (int i = 1;; i++) {\n    b = a % 10;\n    cout << b;\n    c = a / 10;\n    if (c == 0)\n      break;\n    a = c;\n  }\n}\n"}
{"label": "16", "index": "29387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  float n;\n  cin >> n;\n  a = floor(n / 1000);\n  b = floor((n - a * 1000) / 100);\n  c = floor((n - a * 1000 - b * 100) / 10);\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (n / 1000 >= 1) {\n    cout << d << c << b << a << endl;\n  }\n  if (n / 1000 < 1 && n / 100 >= 1) {\n    cout << d << c << b << endl;\n  }\n  if (n / 100 < 1 && n / 10 >= 1) {\n    cout << d << c << endl;\n  }\n  if (n / 10 < 1) {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, m = 0, i = 0;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  else {\n    int a[5];\n    a[0] = n / 10000;\n    a[1] = (n - 10000 * a[0]) / 1000;\n    a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n    a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = n - 10000 * a[0] - 1000 * a[1] - 100 * a[2] - 10 * a[3];\n    for (i = 0; i <= 4; i++) {\n      if (a[i] != 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 4; i >= m; i--) {\n      cout << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b1, b, c1, c, d1, d, x, y;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b1 = x % 100;\n  b = b1 / 10;\n  c1 = x % 1000;\n  c = c1 / 100;\n  d1 = x;\n  d = d1 / 1000;\n  if (d != 0) {\n    y = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", y);\n  } else if ((d == 0) && (c != 0)) {\n    y = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", y);\n  } else if ((c == 0) && (b != 0)) {\n    y = a * 10 + b;\n    printf(\"%02d\\n\", y);\n  } else {\n    y = a;\n    printf(\"%d\\n\", y);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zhengshu[10001];\n  cin.getline(zhengshu, 10001);\n  int length = strlen(zhengshu), i, a[10000];\n  for (i = 0; i < length; i++) {\n    a[i] = zhengshu[i] - '0';\n  }\n  for (i = length - 1; i >= 0; i--)\n    cout << a[i];\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  if (n / 10000 != 0)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    int e, f, g;\n    e = n / 100;\n    f = (n - 100 * e) / 10;\n    g = n % 10;\n    printf(\"%d%d%d\", g, f, e);\n  } else if (n / 10 != 0) {\n    int p, q;\n    p = n / 10;\n    q = n % 10;\n    printf(\"%d%d\", q, p);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29392", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zhengshu[10001];\n  cin.getline(zhengshu, 10001);\n  int length = strlen(zhengshu), i, a[10000];\n  for (i = 0; i < length; i++) {\n    a[i] = zhengshu[i] - '0';\n  }\n  for (i = length - 1; i >= 0; i--) {\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29393", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, a, b, c, d, e;\n  char ch;\n  a = b = c = d = e = -1;\n  while ((ch = cin.get()) != '\\n') {\n    switch (i) {\n    case 1:\n      a = ch - '0';\n      break;\n    case 2:\n      b = ch - '0';\n      break;\n    case 3:\n      c = ch - '0';\n      break;\n    case 4:\n      d = ch - '0';\n      break;\n    case 5:\n      e = ch - '0';\n      break;\n    }\n    i++;\n  }\n  if (e == -1 && d != -1)\n    cout << d << c << b << a << endl;\n  else if (e == -1 && d == -1 && c != -1)\n    cout << c << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b != -1)\n    cout << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b == -1 && a != -1)\n    cout << a << endl;\n  else\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n >= 0 && n <= 9) {\n    cout << n << endl;\n  } else if (n >= 10 && n <= 99) {\n    int a, b;\n    a = n / 10;\n    b = n % 10;\n    cout << b << a << endl;\n  } else if (n >= 100 && n <= 999) {\n    int a, b, c;\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - 100 * a - 10 * b;\n    cout << c << b << a << endl;\n  } else if (n >= 1000 && n <= 9999) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n = 10000) {\n    cout << \"00001\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a / 10000;\n    c = (a - 10000 * b) / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a >= 1000) {\n    b = 0;\n    c = a / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100) {\n    b = 0;\n    c = 0;\n    d = a / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a >= 10) {\n    b = 0;\n    c = 0;\n    d = 0;\n    e = a / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d\", f, e);\n  } else {\n    b = 0;\n    c = 0;\n    d = 0;\n    e = 0;\n    f = a;\n    printf(\"%d\", f);\n  }\n}\n"}
{"label": "16", "index": "29396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  else\n    return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n\n  scanf(\"%d\", &N);\n  if (N != 0) {\n    while (N % (1 * e(i)) != N) {\n      a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n      i++;\n    }\n    while (t <= i - 1) {\n      printf(\"%d\", a[t]);\n      t++;\n    }\n  } else\n    printf(\"0\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a / 10000;\n    c = (a - 10000 * b) / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a >= 1000) {\n    b = 0;\n    c = a / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else {\n    if (a >= 100) {\n      b = 0;\n      c = 0;\n      d = a / 100;\n      e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n      f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n      printf(\"%d%d%d\", f, e, d);\n    } else if (a >= 10) {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = a / 10;\n      f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n      printf(\"%d%d\", f, e);\n    } else {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = 0;\n      f = a;\n      printf(\"%d\", f);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29398", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  if (d != 0)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c != 0)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b != 0)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid function_1(int num) {\n  printf(\"%d\", num % 10);\n  if ((num / 10) != 0)\n    function_1(num / 10);\n}\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  function_1(num);\n  return 0;\n}\n"}
{"label": "16", "index": "29400", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10];\n  int n, i, j;\n  cin >> n;\n  if (n == 0) {\n    printf(\"0\\n\");\n    return 0;\n  }\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 1; j <= i - 1; j++)\n    printf(\"%d\", a[j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29401", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[10];\n  scanf(\"%s \", s);\n  int n = 0, i = 0;\n  for (i = 0; s[i] != '\\0'; i++)\n    n++;\n  for (i = n - 1; i >= 0; i--) {\n    printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, result;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a < 10000 && a >= 1000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    result = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%04d\", result);\n  } else if (a < 1000 && a >= 100) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a - b * 100 - c * 10;\n    result = d * 100 + c * 10 + b;\n    printf(\"%03d\", result);\n  } else if (a < 100 && a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    result = c * 10 + b;\n    printf(\"%02d\", result);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    cout << n;\n  if (n > 10 && n < 100) {\n    a = n % 10;\n    b = n / 10;\n    n = 10 * a + b;\n    printf(\"%d\", n);\n  }\n  if (n > 100 && n < 1000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n / 100;\n    n = 100 * a + 10 * b + c;\n    printf(\"%d\", n);\n  }\n  if (n > 1000 && n < 10000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = (n % 1000 - 10 * b - a) / 100;\n    d = n / 1000;\n    n = 1000 * a + 100 * b + 10 * c + d;\n    printf(\"%d\", n);\n  }\n  if (n == 10)\n    printf(\"01\");\n  if (n == 100)\n    printf(\"001\");\n  if (n == 1000)\n    printf(\"0001\");\n  if (n == 10000)\n    printf(\"00001\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = n / 10;\n  if (n == 0) {\n    printf(\"%d\", a);\n  } else {\n    b = n % 10;\n    n = n / 10;\n    if (n == 0) {\n      printf(\"%d%d\", a, b);\n    } else {\n      c = n % 10;\n      n = n / 10;\n      d = n;\n      if (n == 0) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        printf(\"%d%d%d%d\", a, b, c, d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N, X, a, b, c, d, e;\n  scanf(\"%d\", &N);\n  if (N > 9999)\n    X = 5;\n  else if (N > 999) {\n    X = 4;\n  } else if (N > 99)\n    X = 3;\n  else if (N > 9)\n    X = 2;\n  else\n    X = 1;\n  a = N / 10000;\n  b = (N - 10000 * a) / 1000;\n  c = (N - 10000 * a - 1000 * b) / 100;\n  d = (N - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (N - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  switch (X) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    break;\n  case 4:\n    cout << e << d << c << b << \"\\n\";\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 1:\n    printf(\"%d\\n\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29406", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a = 10, b = 10, c = 10, d;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"1\" << endl;\n  else\n    do {\n      a--;\n    } while ((n - a * 1000 < 0) || (n - a * 1000 >= 1000));\n  n = n - a * 1000;\n  do {\n    b--;\n  } while ((n - b * 100 < 0) || (n - b * 100 >= 100));\n  n = n - b * 100;\n  do {\n    c--;\n  } while ((n - c * 10 < 0) || (n - c * 10 >= 10));\n  n = n - c * 10;\n  d = n;\n  if ((a == 0) && (b == 0) && (c == 0))\n    cout << d << endl;\n  else if ((a == 0) && (b == 0))\n    cout << d << c << endl;\n  else if (a == 0)\n    cout << d << c << b << endl;\n  else\n    cout << d << c << b << a << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n\n  char a[10];\n  int i = 0;\n  int n;\n  while ((a[i] = getchar()) != '\\n')\n    i++;\n  n = i;\n  for (i = n; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  if (x > 9999) {\n    e = x / 10000;\n    d = x % 10000 / 1000;\n    c = x % 10000 % 1000 / 100;\n    b = x % 10000 % 1000 % 100 / 10;\n    a = x % 10000 % 1000 % 100 % 10;\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n  } else if (x > 999) {\n    d = x / 1000;\n    c = x % 1000 / 100;\n    b = x % 1000 % 100 / 10;\n    a = x % 1000 % 100 % 10;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  } else {\n    if (x > 99) {\n      c = x / 100;\n      b = x % 100 / 10;\n      a = x % 100 % 10;\n      printf(\"%d%d%d\\n\", a, b, c);\n    } else if (x > 9) {\n      b = x / 10;\n      a = x % 10;\n      printf(\"%d%d\\n\", a, b);\n    } else\n      cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, i;\n  cin >> a;\n  i = 1 + log10(a);\n  b = a / 10000;\n  a = a % 10000;\n  c = a / 1000;\n  a = a % 1000;\n  d = a / 100;\n  a = a % 100;\n  e = a / 10;\n  a = a % 10;\n  f = a;\n  cout << f;\n  if (i > 1)\n    printf(\"%d\", e);\n  if (i > 2)\n    printf(\"%d\", d);\n  if (i > 3)\n    printf(\"%d\", c);\n  if (i > 4)\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29410", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid p(int num) {\n  while (num) {\n    cout << num % 10;\n    num /= 10;\n  }\n}\nint main() {\n  int l;\n  scanf(\"%d \", &l);\n  if (l != 0)\n    p(l);\n  else\n    cout << 0;\n  return 0;\n}\n"}
{"label": "16", "index": "29411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  b = a / 1000;\n  c = a % 1000;\n  d = c / 100;\n  e = a % 100;\n  f = e / 10;\n  g = a % 10;\n\n  if (b == 0) {\n    if (d == 0) {\n      if (f == 0) {\n        cout << g;\n      } else {\n        cout << g << f;\n      }\n    } else {\n      printf(\"%d%d%d\", g, f, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", g, f, d, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29412", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n > 9999)\n    printf(\"00001\");\n  if (n > 999 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  if (n > 99 && n < 1000) {\n    b = n / 100;\n    c = (n - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if (n > 9 && n < 100) {\n    c = n / 10;\n    d = n % 10;\n    printf(\"%d%d\", d, c);\n  }\n  if (n < 10)\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29413", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  cin >> a;\n  b = a / 1000;\n  c = a % 1000;\n  d = c % 100;\n  e = d % 10;\n  c = c / 100;\n  d = d / 10;\n  printf(\"%d\", e);\n  if (d != 0, (b + c + d) != 0)\n    printf(\"%d\", d);\n  if (c != 0, (b + c) != 0)\n    printf(\"%d\", c);\n  if (b != 0)\n    printf(\"%d\", b);\n}\n"}
{"label": "16", "index": "29414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5], i, m;\n  cin >> n;\n  a[0] = n % 10;\n  a[1] = (n / 10) % 10;\n  a[2] = (n / 100) % 10;\n  a[3] = (n / 1000) % 10;\n  a[4] = (n / 10000) % 10;\n\n  if (n == 0) {\n    printf(\"%d\", 0);\n  } else {\n    i = 4;\n    while (a[i] == 0) {\n      m = i;\n      i--;\n    }\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s, a, b, c, d, e;\n  scanf(\"%d\", &s);\n  a = s / 10000;\n  b = (s - 10000 * a) / 1000;\n  c = (s - 10000 * a - 1000 * b) / 100;\n  d = (s - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (s - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, k, out;\n  int A[5];\n  scanf(\"%d\", &n);\n  for (i = 1; 1 <= 5; i++) {\n    if (n < 1)\n      break;\n    cout << n % 10;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29417", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5] = {0}, n, i, j;\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n  a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  if (n == 0)\n    cout << 0;\n  else\n    for (i = 0; i < 5; i++) {\n      if (a[i] != 0) {\n        for (j = 4; j >= i; j--)\n          cout << a[j];\n        break;\n      }\n    }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29418", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if ((n >= 1) && (n <= 9))\n    cout << n << endl;\n  if ((n >= 10) && (n < 100)) {\n    int a = n / 10;\n    int b = n % 10;\n    cout << b << a << endl;\n  }\n  if ((n >= 100) && (n <= 999)) {\n    int a = n / 100;\n    int b = (n % 100) / 10;\n    int c = (n % 100) % 10;\n    printf(\"%d%d%d\\n\", c, b, a);\n  }\n  if ((n >= 1000) && (n < 9999)) {\n    int a = n / 1000;\n    int b = (n % 1000) / 100;\n    int c = ((n % 1000) % 100) / 10;\n    int d = ((n % 1000) % 100) % 10;\n    cout << d << c << b << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29419", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  cin >> n;\n  a = (int)(n / 10000);\n  b = (int)(n / 1000 - a * 10);\n  c = (int)(n / 100 - a * 100 - b * 10);\n  d = (int)(n / 10 - a * 1000 - b * 100 - c * 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  if (a == 0 && b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  if (a == 0 && b == 0 && c != 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  if (a == 0 && b == 0 && c == 0 && d != 0)\n    printf(\"%d%d\\n\", e, d);\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  if (!N)\n    cout << 0 << endl;\n  else {\n    while (N) {\n      cout << N % 10;\n      N /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a % 10 == a)\n    printf(\"%d\", a);\n  if (a % 10 != a && a % 100 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    printf(\"%d%d\", b, c);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    printf(\"%d%d%d\", b, c, d);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 != a && a % 10000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  if (a == 10000)\n    printf(\"%d\", 00001);\n  return 0;\n}\n"}
{"label": "16", "index": "29422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (1) {\n    tmp = n % 10;\n    cout << tmp;\n    if (!(n = n / 10))\n      break;\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, a, b, c, d, place;\n  scanf(\"%d\", &n);\n  if (n >= 1000)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  a = n / 1000;\n  b = (int)(n - a * 1000) / 100;\n  c = (int)(n - a * 1000 - b * 100) / 10;\n  d = (int)n % 10;\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  case 3:\n    cout << d << c << b << \"\\n\";\n    break;\n  case 2:\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 1:\n    printf(\"%d\\n\", d);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid reverse() {\n  int k;\n  if ((k = getchar()) == '\\n')\n    return;\n  reverse();\n  cout << k;\n}\n\nint main() {\n  reverse();\n  return 0;\n}\n"}
{"label": "16", "index": "29425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, n, s, i;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  n = 0;\n  b = a;\n  while (b != 0) {\n    b = (b / 10);\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i <= n; i++) {\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d\", b);\n  }\n}\n"}
{"label": "16", "index": "29426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int z;\n  int a, b, c, d, e;\n  cin >> z;\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      printf(\"%d%d%d%d\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  scanf(\"%d\", &z);\n  return 0;\n}\n"}
{"label": "16", "index": "29427", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d, e;\n  cin >> n;\n  int x;\n  x = n;\n  a = n / 10000;\n  n = n - a * 10000;\n  b = n / 1000;\n  n = n - b * 1000;\n  c = n / 100;\n  n = n - c * 100;\n  d = n / 10;\n  e = n - d * 10;\n  if (x < 10)\n    printf(\"%d\\n\", e);\n  else if ((x >= 10) && (x < 100))\n    cout << e << d << endl;\n  else if ((x >= 100) && (x < 1000))\n    cout << e << d << c << endl;\n  else if ((x >= 1000) && (x < 10000))\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x == 10000)\n    printf(\"00001\\n\");\n  else {\n    a = x / 1000;\n    b = (x - a * 1000) / 100;\n    c = (x - a * 1000 - b * 100) / 10;\n    d = x - a * 1000 - b * 100 - c * 10;\n    if (a)\n      printf(\"%d%d%d%d\\n\", d, c, b, a);\n    else {\n      if (b)\n        printf(\"%d%d%d\\n\", d, c, b);\n      else {\n        if (c)\n          printf(\"%d%d\\n\", d, c);\n        else\n          printf(\"%d\\n\", d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10000] = {0}, *start, *end, t;\n  int len;\n  cin >> str;\n  len = strlen(str);\n  start = str;\n  end = &str[len - 1];\n  while (start < end) {\n    t = *start;\n    *start = *end;\n    *end = t;\n    start++;\n    end--;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "16", "index": "29430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l;\n  char s[4], r[4];\n  scanf(\"%s\", s);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    r[i] = s[l - 1 - i];\n  }\n  for (i = 0; i < l; i++)\n    cout << r[i];\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29431", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f(int n, int w) {\n  int x;\n  x = (int)pow(10, w - 1);\n  if (w != 1)\n    f(n % x, w - 1);\n  printf(\"%d\", n / x);\n}\nint main() {\n  int n;\n  cin >> n;\n  int w = (int)(log(n) / log(10)) + 1;\n  f(n, w);\n}\n"}
{"label": "16", "index": "29432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  } else {\n    if (n >= 100 && n < 1000) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n - a * 100 - b * 10;\n      printf(\"%d%d%d\\n\", c, b, a);\n    } else {\n      if (n >= 10 && n < 100) {\n        a = n / 10;\n        b = n - a * 10;\n        printf(\"%d%d\\n\", b, a);\n      } else {\n        if (n < 10) {\n          printf(\"%d\\n\", n);\n        } else {\n          printf(\"00001\\n\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc) {\n  int i, n, c, b, a[10];\n  cin >> n; \n  b = 1;\n  i = 0;\n  while (b != 0) {\n    a[i] = n % 10; \n    b = n / 10;\n    n = b;\n    i++;\n  }\n  c = i;\n  i = 0;\n  while (i < c) {\n    cout << a[i];\n    i++;\n  } \n  return 0;\n}\n"}
{"label": "16", "index": "29434", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5];\n\n  scanf(\"%s \", a);\n  int i;\n  for (i = strlen(a); i > 0; i--)\n    printf(\"%c\", a[i - 1]);\n  return 0;\n}\n"}
{"label": "16", "index": "29435", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, t;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else {\n    for (i = 0; i < 5; i++) {\n      if (n != 0) {\n        t = n % 10;\n        printf(\"%d\", t);\n        n = (n - t) / 10;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29436", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n % 10;\n  a[1] = ((n - a[0]) % 100) / 10;\n  a[2] = ((n - a[0] - a[1]) % 1000) / 100;\n  a[3] = ((n - a[0] - a[1] - a[2]) % 10000) / 1000;\n  a[4] = (n - a[0] - a[1] - a[2] - a[3]) / 10000;\n  if (a[4] != 0)\n    printf(\"%d%d%d%d%d\\n\", a[0], a[1], a[2], a[3], a[4]);\n  if (a[4] == 0 && a[3] != 0)\n    printf(\"%d%d%d%d\\n\", a[0], a[1], a[2], a[3]);\n  if (a[4] + a[3] == 0 && a[2] != 0)\n    printf(\"%d%d%d\\n\", a[0], a[1], a[2]);\n  if (a[4] + a[3] + a[2] == 0 && a[1] != 0)\n    printf(\"%d%d\\n\", a[0], a[1]);\n  if (a[4] + a[3] + a[2] + a[1] == 0)\n    printf(\"%d\\n\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "29437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  if (num == 10000)\n    printf(\"00001\\n\");\n  else if (num > 999)\n    printf(\"%d%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10,\n           num / 1000 % 10);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10);\n  else if (num > 9)\n    cout << num % 10 << num % 100 / 10 << \"\\n\";\n  else\n    printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "16", "index": "29438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    printf(\"0\");\n  else {\n    while (x != 0) {\n      a = x % 10;\n      x = x / 10;\n      cout << a;\n    }\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "16", "index": "29439", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, c, d, e, f;\n  cin >> a;\n\n  if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  b = n;\n  c = n;\n  if (n < 10)\n    cout << n;\n  else {\n    int length = 1, k = 10;\n    while ((c / k) != 0) {\n      length++;\n      k = k * 10;\n    }\n    for (int i = 1; i <= length; i++) {\n      cout << b % 10;\n      b = (b - b % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int n_1 = 0, i = 0;\n  int len = 0;\n  int a[6] = {0};\n  scanf(\"%d\", &n);\n  n_1 = n;\n  for (; n / 10 > 0;) {\n    n = n / 10;\n    len++;\n  }\n  len++;\n  for (i = 0; i < len; i++) {\n    a[i] = n_1 % 10;\n    n_1 = n_1 / 10;\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29442", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid reverse() {\n  int k;\n  if ((k = getchar()) == '\\n')\n    return;\n  reverse();\n  printf(\"%c\", k);\n}\n\nint main() {\n  reverse();\n  return 0;\n}\n"}
{"label": "16", "index": "29443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n;\n  scanf(\"%d\", &a);\n  if (a >= 0 && a <= 9)\n    cout << a;\n  else if (a >= 10 && a <= 99) {\n    b = a % 10, c = a / 10;\n    putchar(b);\n    putchar(c);\n  } else if (a >= 100 && a <= 999) {\n    d = a % 10, e = a / 10, f = e % 10, g = e / 10;\n    printf(\"%d%d%d\", d, f, g);\n  } else if (a >= 1000 && a <= 9999) {\n    h = a / 10, i = h / 10, j = i / 10, k = i % 10, l = h % 10, m = a % 10;\n    printf(\"%d%d%d%d\", m, l, k, j);\n  }\n}\n"}
{"label": "16", "index": "29444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, a3, a4;\n  scanf(\"%d\", &n);\n  if (n >= 1000) {\n    a4 = n / 1000;\n    a3 = (n - a4 * 1000) / 100;\n    a2 = (n - a4 * 1000 - a3 * 100) / 10;\n    a1 = n - a4 * 1000 - a3 * 100 - a2 * 10;\n    cout << a1 << a2 << a3 << a4;\n  }\n  if (n >= 100 && n < 1000) {\n    a3 = n / 100;\n    a2 = (n - a3 * 100) / 10;\n    a1 = n - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d\", a1, a2, a3);\n  }\n  if (n >= 10 && n < 100) {\n    a2 = n / 10;\n    a1 = n - a2 * 10;\n    printf(\"%d%d\", a1, a2);\n  }\n  if (n < 10) {\n    cout << n;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29445", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  while (n > 0) {\n    printf(\"%d\", n % 10);\n    n /= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, U1, U2, U3, U4, U;\n  cin >> i;\n  U1 = i / 1000;\n  U2 = (i - 1000 * U1) / 100;\n  U3 = (i - 1000 * U1 - 100 * U2) / 10;\n  U4 = (i - 1000 * U1 - 100 * U2 - 10 * U3);\n  if (U1 != 0)\n    printf(\"%d%d%d%d\", U4, U3, U2, U1);\n  else {\n    if (U2 != 0)\n      cout << U4 << U3 << U2;\n    else {\n      if (U3 != 0)\n        printf(\"%d%d\", U4, U3);\n      else {\n        if (U4 != 0)\n          printf(\"%d\", U4);\n        else\n          printf(\"0\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, g, s, b, q, o = 0, p = 1;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\\n\", o, o, o, o, p);\n  {\n    if (a <= 10)\n      printf(\"%d\\n\", a);\n    else if (a < 100) {\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d\\n\", g, s);\n    } else if (a < 1000) {\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d\\n\", g, s, b);\n    } else if (a < 10000) {\n      q = (a % 10000) / 1000;\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d%d\\n\", g, s, b, q);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[5];\n  int count = 1;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    if (n >= 10) {\n      n = (n - a[i]) / 10;\n      count++;\n    }\n  }\n  for (int i = 0; i < count; i++)\n    cout << a[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[10000];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--) {\n    printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29450", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a[5], n, i, k = 0;\n  cin >> n;\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 4; i >= 0; i--)\n    if (a[i] != 0) {\n      k = i;\n      break;\n    }\n  for (i = 0; i <= k; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = a / 100;\n  e = a / 10;\n  f = a % 10;\n  g = e % 10;\n  h = d % 10;\n  i = (a / 10) % 10;\n  j = (a / 100) % 10;\n  k = (a / 1000) % 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0) {\n          printf(\"%d\", f);\n        } else\n          printf(\"%d%d\", f, e);\n      } else\n        printf(\"%d%d%d\", f, g, d);\n    } else\n      printf(\"%d%d%d%d\", f, i, h, c);\n  } else\n    printf(\"%d%d%d%d%d\", f, i, j, k, b);\n  return 0;\n}\n"}
{"label": "16", "index": "29452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  cin >> x;\n  if (x == 0)\n    printf(\"0\");\n  n = (int)log10((double)x);\n  a = x / 10000;\n  x = x - a * 10000;\n  b = x / 1000;\n  x = x - b * 1000;\n  c = x / 100;\n  x = x - c * 100;\n  d = x / 10;\n  e = x - d * 10;\n\n  switch (n) {\n  case 0:\n    cout << e;\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    cout << e << d << c << b << a;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 9) {\n    cout << n;\n  }\n  if (10 <= n && n <= 99) {\n    a = n / 10;\n    b = n - a;\n    printf(\"%d%d\", b, a);\n  }\n  if (100 <= n && n <= 999) {\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (1000 <= n && n <= 9999) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29454", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid fun() {\n  char c;\n  if ((c = getchar()) != ' ')\n    fun();\n  putchar(c);\n}\n\nint main() {\n  fun();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a / 1000 == 0) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a / 10000 == 0) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    f = a % 10;\n    cout << f << d << c << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  scanf(\"%d\", &a);\n  if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - 100 * d;\n    f = e / 10;\n    g = e - 10 * f;\n\n    n = g * 1000 + f * 100 + d * 10 + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - 10 * b;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else\n\n  {\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, b, c, s, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    printf(\"%d\", n);\n  else if (n >= 10 && n <= 99) {\n    m = n / 10;\n    a = n - m * 10;\n    printf(\"%d%d\", a, m);\n  } else if (n >= 100 && n <= 999) {\n    s = n / 100;\n    m = (n - s * 100) / 10;\n    b = n - s * 100 - m * 10;\n    printf(\"%d%d%d\", b, m, s);\n  } else if (n >= 1000 && n <= 9999) {\n    m = n / 10;\n\n    p = n / 1000;\n    s = (n - p * 1000) / 100;\n    b = (n - s * 100 - p * 1000) / 10;\n    c = n - p * 1000 - s * 100 - 10 * b;\n\n    printf(\"%d%d%d%d\", c, b, s, p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29458", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d%\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = x / 100 % 10;\n  c = x / 10 % 10;\n  d = x % 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        printf(\"%d%d\", d, c);\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n}\n"}
{"label": "16", "index": "29460", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d \", &n);\n  a[0] = n % 10;\n  a[1] = ((n - a[0]) % 100) / 10;\n  a[2] = ((n - a[0] - a[1]) % 1000) / 100;\n  a[3] = ((n - a[0] - a[1] - a[2]) % 10000) / 1000;\n  a[4] = (n - a[0] - a[1] - a[2] - a[3]) / 10000;\n  if (a[4] != 0)\n    printf(\"%d%d%d%d%d\\n\", a[0], a[1], a[2], a[3], a[4]);\n  if (a[4] == 0 && a[3] != 0)\n    printf(\"%d%d%d%d\\n\", a[0], a[1], a[2], a[3]);\n  if (a[4] + a[3] == 0 && a[2] != 0)\n    printf(\"%d%d%d\\n\", a[0], a[1], a[2]);\n  if (a[4] + a[3] + a[2] == 0 && a[1] != 0)\n    printf(\"%d%d\\n\", a[0], a[1]);\n  if (a[4] + a[3] + a[2] + a[1] == 0)\n    printf(\"%d\\n\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "29461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a[1000];\n\n  scanf(\"%d\", &n);\n  if (n == 0)\n    cout << \"0\";\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    printf(\"%d\", a[i]);\n    n = n / 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29462", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x, y = 0;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    printf(\"%d\", a);\n  } else if (a == 10) {\n    b = 0;\n    c = 1;\n    printf(\"%d%d\", b, c);\n  } else if (a > 10 && a < 100) {\n    b = a / 10;\n    c = a - b * 10;\n    x = c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 100) {\n    b = 1;\n    printf(\"%d%d%d\", y, y, b);\n  } else if (a > 100 && a < 1000) {\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    x = d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 1000) {\n    b = 1;\n    printf(\"%d%d%d%d\", y, y, y, b);\n  } else if (a > 1000 && a < 10000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    x = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 10000) {\n    b = 1;\n    printf(\"%d%d%d%d%d\", y, y, y, y, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, c;\n  cin >> n;\n  c = 0;\n  if (n != 0)\n    for (; n != 0; n = n / 10) {\n      a = n % 10;\n      cout << a;\n    }\n  else\n    cout << \"0\";\n  return (0);\n}\n"}
{"label": "16", "index": "29464", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else {\n    while (a / 10 != 0) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d\", c);\n      a = b;\n    }\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29465", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, m;\n  scanf(\"%d \", &n);\n  m = n;\n  a = n % 10;\n  n = n / 10;\n  b = n % 10;\n  n = n / 10;\n  c = n % 10;\n  n = n / 10;\n  d = n % 10;\n  if (m < 10)\n    printf(\"%d\", m);\n  else if (m < 100) {\n    printf(\"%d%d\", a, b);\n  } else if (m < 1000)\n    printf(\"%d%d%d\", a, b, c);\n  else if (m < 10000)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "29466", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number, i, m, x[5];\n  scanf(\"%d \", &number);\n  if (number <= 9)\n    i = 1;\n  else if (number <= 99)\n    i = 2;\n  else if (number <= 999)\n    i = 3;\n  else if (number <= 9999)\n    i = 4;\n  else\n    i = 5;\n  for (m = 0; m <= i - 1; m++) {\n    x[m] = number % 10;\n    number = (number - x[m]) / 10;\n  }\n  for (m = 0; m <= i - 1; m++)\n    printf(\"%d\", x[m]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y = 0;\n  scanf(\"%d \", &x);\n  if (x < 10)\n    printf(\"%d\", x);\n  else {\n    while (x > 0) {\n      y = x % 10 + 10 * y;\n      x = x / 10;\n    }\n    if (x % 10 != 0)\n      cout << y;\n    else\n      printf(\"%03d\", y);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29468", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d \", &x);\n  a = x / 1000;\n  b = x / 100 % 10;\n  c = x / 10 % 10;\n  d = x % 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        printf(\"%d%d\", d, c);\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[5], n, i;\n  scanf(\"%d\", &a);\n  if (a != 0) {\n    n = log10(a) + 1;\n    for (i = 0; i <= n - 1; i++)\n      b[i] = (int)(a / pow(10, i)) % 10;\n\n    for (i = 0; i <= n - 1; i++) {\n      printf(\"%d\", b[i]);\n    }\n    printf(\"\\n\");\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i1, m1, i2, m2, i3, m3;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n < 100) {\n    i1 = n % 10;\n    m1 = n / 10;\n    printf(\"%d%d\", i1, m1);\n  } else if (n >= 100 && n < 1000) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    printf(\"%d%d%d\", i1, i2, m2);\n  } else if (n >= 1000 && n < 9999) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    i3 = m2 % 10;\n    m3 = m2 / 10;\n    printf(\"%d%d%d%d\", i1, i2, i3, m3);\n  } else\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "29471", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, g, h, i;\n  long f;\n  cin >> f;\n  a = f / 10000;\n  g = f % 10000;\n  b = g / 1000;\n  h = g % 1000;\n  c = h / 100;\n  i = h % 100;\n  d = i / 10;\n  e = i % 10;\n  if (a > 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29472", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  cin >> t;\n  a = t / 10000;\n  b = (t - a * 10000) / 1000;\n  c = (t - a * 10000 - b * 1000) / 100;\n  d = (t - a * 10000 - b * 1000 - c * 100) / 10;\n  e = t - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\", e);\n  else {\n    if (a == 0 && b == 0 && c == 0 && d != 0)\n      printf(\"%d%d\", e, d);\n    else {\n      if (a == 0 && b == 0 && c != 0)\n        printf(\"%d%d%d\", e, d, c);\n      else {\n        if (a == 0 && b != 0)\n          printf(\"%d%d%d%d\", e, d, c, b);\n        else {\n          if (a != 0)\n            printf(\"%d%d%d%d%d\", e, d, c, b, a);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\", 0, 0, 0, 0, 1);\n  else if (a > 999)\n    cout << a % 1000 % 100 % 10 << a % 1000 % 100 / 10 << a % 1000 / 100\n         << a / 1000;\n  else if (a > 99)\n    printf(\"%d%d%d\", a % 100 % 10, a % 100 / 10, a / 100);\n  else if (a > 9)\n    cout << a % 10 << a / 10;\n  else\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29474", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\\n\", a);\n  else if (a < 100) {\n    int b, c;\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%02d\\n\", 10 * b + c);\n  } else if (a < 1000) {\n    int d, e, f;\n    d = a % 10;\n    e = a % 100;\n    e = (e - d) / 10;\n    f = (a - d - 10 * e) / 100;\n    printf(\"%03d\\n\", 100 * d + 10 * e + f);\n  } else if (a < 10000) {\n    int g, h, i, j;\n    g = a % 10;\n    h = a % 100;\n    h = (h - g) / 10;\n    i = a % 1000;\n    i = (i - 10 * h - g) / 100;\n    j = (a - 100 * i - 10 * h - g) / 1000;\n    printf(\"%04d\\n\", 1000 * g + 100 * h + 10 * i + j);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100)\n    printf(\"%d%d\", n % 10, n / 10);\n  else if (n < 1000) {\n    a = n / 100;\n    b = n / 10 - 10 * a;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n < 10000) {\n    d = n / 1000;\n    e = n / 100 - 10 * d;\n    f = n / 10 - d * 100 - e * 10;\n    g = n % 10;\n    printf(\"%d%d%d%d\", g, f, e, d);\n  } else\n    printf(\"over\");\n  return 0;\n}\n"}
{"label": "16", "index": "29476", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  char s[20];\n  int l, i;\n  scanf(\"%s \", s);\n  l = strlen(s);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  printf(\"%d\", n % 10);\n  if (n / 10 != 0)\n    cout << (n % 100) / 10;\n  if (n / 100 != 0)\n    printf(\"%d\", (n % 1000) / 100);\n  if (n / 1000 != 0)\n    printf(\"%d\", (n % 10000) / 1000);\n  if (n / 10000 != 0)\n    printf(\"%d\", n / 10000);\n}\n"}
{"label": "16", "index": "29478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d, e;\n  cin >> n;\n  int x;\n  x = n;\n  a = n / 10000;\n  n = n - a * 10000;\n  b = n / 1000;\n  n = n - b * 1000;\n  c = n / 100;\n  n = n - c * 100;\n  d = n / 10;\n  e = n - d * 10;\n  if (x < 10)\n    printf(\"%d\\n\", e);\n  else if ((x >= 10) && (x < 100))\n    cout << e << d << endl;\n  else if ((x >= 100) && (x < 1000))\n    cout << e << d << c << endl;\n  else if ((x >= 1000) && (x < 10000))\n    cout << e << d << c << b << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29479", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b, i, k;\n  cin >> n;\n  b = n;\n  if (b == 0)\n    printf(\"%d\", b);\n  for (i = 0; b >= 1; i++) {\n    k = b % 10;\n    b = b / 10;\n    cout << k;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    c = n % 10, e = n / 100;\n    d = (n / 10) % 10;\n    printf(\"%d%d%d\", c, d, e);\n  } else if (n < 10000) {\n    f = n % 10;\n    g = (n % 100) / 10;\n    h = (n / 100) % 10;\n    i = n / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  scanf(\"%d \", &i);\n  do {\n    cout << i % 10;\n    i = i / 10;\n\n  } while (i != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, b1, b2, c1, c2, d1;\n  cin >> n;\n  a1 = n % 10;\n  a2 = n / 10;\n  if (a2 > 0) {\n    b1 = a2 % 10;\n    b2 = a2 / 10;\n    if (b2 > 0) {\n      c1 = b2 % 10;\n      c2 = b2 / 10;\n      if (c2 > 0) {\n        d1 = c2 % 10;\n        cout << a1 << b1 << c1 << d1;\n      } else\n        printf(\"%d%d%d\", a1, b1, c1);\n    } else\n      printf(\"%d%d\", a1, b1);\n  } else\n    cout << a1;\n  return 0;\n}\n"}
{"label": "16", "index": "29483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, t;\n  cin >> n;\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    x = n % 10;\n    if (n <= 99) {\n      y = (n - x) / 10;\n      printf(\"%d%d\", x, y);\n    } else {\n      y = ((n - x) / 10) % 10;\n      t = x + 10 * y;\n      if (n <= 999) {\n        z = (n - t) / 100;\n        printf(\"%d%d%d\", x, y, z);\n      } else {\n        z = ((n - t) / 100) % 10;\n        t = x + 10 * y + 100 * z;\n        if (n <= 9999) {\n          w = (n - t) / 1000;\n          printf(\"%d%d%d%d\", x, y, z, w);\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (10 <= n && n < 100) {\n    cout << n % 10 << n / 10;\n  } else if (n >= 100 && n <= 999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10 << n / 100;\n  } else if (n >= 1000 && n <= 9999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10\n         << n / 100 - (n / 1000) * 10 << n / 1000;\n  } else if (n == 10000) {\n    cout << 00001;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10], n = 0, k = 1, i = 0, b = 1;\n  cin >> n;\n  if (!n)\n    cout << n << endl;\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    cout << a[i];\n    n = (n - a[i]) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int mod;\n\n  if (n == 0)\n    cout << 0 << endl;\n  else {\n\n    while (n != 0) {\n      mod = n % 10;\n      printf(\"%d\", mod);\n      n /= 10;\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100] = {0};\n  int i = 0, b = n, j;\n  do {\n    b = b / 10;\n    i++;\n  } while (b != 0);\n  for (j = 0; j < i; j++) {\n    a[j] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29488", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 100 * a - 10 * b;\n  d = n - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else {\n    if (n / 1000 >= 1) {\n      a = n / 1000;\n      b = (n - a * 1000) / 100;\n      c = (n - a * 1000 - b * 100) / 10;\n      d = n - a * 1000 - b * 100 - c * 10;\n      cout << d << c << b << a << endl;\n    } else {\n      if (n / 100 >= 1) {\n        b = n / 100;\n        c = (n - b * 100) / 10;\n        d = n - b * 100 - c * 10;\n        printf(\"%d%d%d\\n\", d, c, b);\n      } else {\n        if (n / 10 >= 1) {\n          c = n / 10;\n          d = n - c * 10;\n          cout << d << c << endl;\n        } else\n          cout << n << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[5];\n\n  scanf(\"%s \", a);\n  int i;\n  for (i = strlen(a); i > 0; i--)\n    cout << a[i - 1];\n  return 0;\n}\n"}
{"label": "16", "index": "29491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[5], n, i, k = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 4; i >= 0; i--)\n    if (a[i] != 0) {\n      k = i;\n      break;\n    }\n  for (i = 0; i <= k; i++)\n    printf(\"%d\", a[i]);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29492", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[6], t[6];\n  int i, x;\n  cin >> s;\n  x = strlen(s);\n  for (i = 0; i <= x - 1; i++)\n    t[x - 1 - i] = s[i];\n  for (i = x; i <= 5; i++)\n    t[i] = 0;\n  puts(t);\n  return 0;\n}\n"}
{"label": "16", "index": "29493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, t;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else {\n    for (i = 0; i < 5; i++) {\n      if (n != 0) {\n        t = n % 10;\n        cout << t;\n        n = (n - t) / 10;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29494", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, len = 0, temp[6];\n  scanf(\"%d \", &n);\n  if (n == 0) {\n    cout << n;\n  }\n  while (n > 0) {\n    temp[len++] = n % 10;\n    n = n / 10;\n  }\n  for (int i = 0; i < len; i++)\n    cout << temp[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29495", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, n, m;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = n / 1000;\n  c = n / 100;\n  d = n / 10;\n  e = n / 1;\n  if (a > 0) {\n    printf(\"00001\");\n  } else if (b > 0) {\n    c = (n - b * 1000) / 100;\n    d = (n - b * 1000 - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (c > 0) {\n    d = (n - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (d > 0) {\n    e = n - d * 10;\n    printf(\"%d%d\", e, d);\n  } else {\n    printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\\n\", n);\n  }\n  if (n >= 10 && n < 100) {\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\\n\", a, b);\n  }\n  if (n >= 100 && n < 1000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100;\n    printf(\"%d%d%d\\n\", a, b, c);\n  }\n  if (n >= 1000 && n < 10000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100 % 10;\n    d = (n - c * 100 - b * 10 - a) / 1000;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  }\n  if (n == 10000) {\n    printf(\"00001\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d%\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29498", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  cin >> a;\n  if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - 100 * d;\n    f = e / 10;\n    g = e - 10 * f;\n\n    n = g * 1000 + f * 100 + d * 10 + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - 10 * b;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else\n\n  {\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[4], i = 0;\n  char mm;\n  while ((mm = cin.get()) != '\\n') {\n    a[i] = mm - '0';\n    i++;\n  }\n  for (int j = 0; j <= i - 1; j++)\n    printf(\"%d\", a[i - 1 - j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, a1, a2, a3, a4, b;\n  cin >> a;\n  a1 = a / 1000;\n  b = a - a1 * 1000;\n  a2 = b / 100;\n  b = b - a2 * 100;\n  a3 = b / 10;\n  a4 = b - a3 * 10;\n  b = a1 + a2 * 10 + a3 * 100 + a4 * 1000;\n  if (a > 999) {\n    if (b > 999)\n      printf(\"%d\\n\", b);\n    else if (b > 99)\n      cout << \"0\" << b << \"\\n\";\n    else if (b > 9)\n      printf(\"00%d\\n\", b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (a > 99) {\n    b = b / 10;\n    if (b > 99)\n      printf(\"%d\\n\", b);\n    else if (b > 9)\n      printf(\"0%d\\n\", b);\n    else\n      printf(\"00%d\\n\", b);\n  } else if (a > 9) {\n    b = b / 100;\n    if (b > 9)\n      printf(\"%d\\n\", b);\n    else\n      printf(\"0%d\\n\", b);\n  } else {\n    b = b / 1000;\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[5], m = 0;\nint f(int n) {\n  int c;\n  if (n == 0)\n    return (0);\n  else {\n    b[m] = n % 10;\n    m++;\n    c = n / 10;\n    return f(c);\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  f(n);\n  for (i = 0; i < m; i++)\n    printf(\"%d\", b[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"%d\\n\", n);\n  else {\n    for (; n > 0;) {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = n / 10;\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[7] = {'0', '0', '0', '0', '0', '0', '0'};\n  cin >> a;\n  int ava = 0;\n  for (int j = 6; j >= 0; j--) {\n    if (ava == 1) {\n      cout << a[j];\n    }\n    if (a[j] != '0') {\n      ava = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, m, n, o, p;\n  cin >> x;\n  m = x / 10000;\n  n = x / 1000;\n  o = x / 100;\n  p = x / 10;\n  if (m != 0) {\n    a = m;\n    b = n - 10 * a;\n    c = o - 100 * a - 10 * b;\n    d = p - 1000 * a - 100 * b - 10 * c;\n    e = x % 10;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (n != 0) {\n    a = n;\n    b = o - 10 * a;\n    c = p - 100 * a - 10 * b;\n    d = x % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (o != 0) {\n    a = o;\n    b = p - 10 * o;\n    c = x % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (p != 0) {\n    a = p;\n    b = x % 10;\n    printf(\"%d%d\", b, a);\n  } else {\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "16", "index": "29505", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[10];\n  scanf(\"%s \", s);\n  int n = 0, i = 0;\n  for (i = 0; s[i] != '\\0'; i++)\n    n++;\n  for (i = n - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n) {\n      a = n % 10;\n      n = (n - a) / 10;\n      printf(\"%d\", a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int w, a = 0, b = 0, c = 0, d = 0, e = 0, x;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  x = n / 10;\n  if (x == 0)\n    w = 1;\n  else {\n    {\n      b = x % 10;\n      x = x / 10;\n    }\n    if (x == 0)\n      w = 2;\n    else {\n      {\n        c = x % 10;\n        x = x / 10;\n      }\n      if (x == 0)\n        w = 3;\n      else {\n        {\n          d = x % 10;\n          x = x / 10;\n        }\n        if (x == 0)\n          w = 4;\n        else {\n          w = 5;\n          e = x % 10;\n        }\n      }\n    }\n  }\n  switch (w) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a, b, c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a, b, c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d \", a, b);\n    break;\n  case 1:\n    printf(\"%d \", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29508", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10001], n, i, x;\n  char ch;\n  n = 0;\n  while ((ch = cin.get()) != '\\n') {\n    a[n] = ch - '0';\n    n++;\n  }\n  for (i = 0; i < n / 2; i++) {\n    x = a[i];\n    a[i] = a[n - i - 1];\n    a[n - i - 1] = x;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29509", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, i;\n  cin >> a;\n  for (i = 1; i <= 4; i++) {\n    printf(\"%d\", a % 10);\n    a = a / 10;\n    if (a < 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29510", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  else\n    while (n) {\n      a = n % 10;\n      n = (n - a) / 10;\n      printf(\"%d\", a);\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "29511", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, c, d, e, f, g;\n  scanf(\"%d \", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000 && a <= 9999) {\n    c = a / 1000;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100 && a <= 999) {\n    c = 0;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 100 + e * 10 + d * 1 + c;\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a >= 10 && a <= 99) {\n    c = 0;\n    d = 0;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 10 + e;\n    printf(\"%d%d\", f, e);\n  } else {\n    g = a;\n    printf(\"%d\", g);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29512", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, i;\n  cin >> n;\n  for (i = 1; i <= 5; i++) {\n    a = n % 10;\n    printf(\"%d\", a);\n    n = (n - a) / 10;\n    if (n == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e;\n  scanf(\"%d\", &i);\n  a = i / 10000;\n  b = (i - a * 10000) / 1000;\n  c = (i - 10000 * a - 1000 * b) / 100;\n  d = (i - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = i - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  else if (a == 0 && b == 0 && c == 0)\n    printf(\"%d%d\\n\", e, d);\n  else if (a == 0 && b == 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  else if (a == 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n}\n"}
{"label": "16", "index": "29514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  } else {\n    if (n >= 100 && n < 1000) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n - a * 100 - b * 10;\n      printf(\"%d%d%d\\n\", c, b, a);\n    } else {\n      if (n >= 10 && n < 100) {\n        a = n / 10;\n        b = n - a * 10;\n        printf(\"%d%d\\n\", b, a);\n      } else {\n        if (n < 10) {\n          printf(\"%d\\n\", n);\n        } else {\n          cout << \"00001\\n\";\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a;\n  a = getchar();\n  if (a <= 57 && a >= 48) {\n    char b;\n    b = getchar();\n    if (b <= 57 && b >= 48) {\n      char c;\n      c = getchar();\n      if (c <= 57 && c >= 48) {\n        char d;\n        d = getchar();\n        if (d <= 57 && d >= 48) {\n          char e;\n          e = getchar();\n          if (e <= 57 && e >= 48)\n            printf(\"%c%c%c%c%c\", e, d, c, b, a);\n          else\n            printf(\"%c%c%c%c\", d, c, b, a);\n        } else\n          printf(\"%c%c%c\", c, b, a);\n      } else\n        cout << b << a;\n    } else\n      printf(\"%c\", a);\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int s;\n  if (n == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (n != 0) {\n    s = n % 10;\n    n /= 10;\n    printf(\"%d\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29518", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  int a[5];\n  scanf(\"%d\", &n);\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - a[0] * 10000 - a[1] * 1000) / 100;\n  a[3] = (n - a[0] * 10000 - a[1] * 1000 - a[2] * 100) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  for (i = 0; i <= 4; i++) {\n    if (a[i]) {\n      for (j = 4; j >= i; j--)\n        printf(\"%d\", a[j]);\n      break;\n    }\n  }\n  if (a[0] + a[1] + a[2] + a[3] + a[4] == 0)\n    cout << \"0\";\n  return 0;\n}\n"}
{"label": "16", "index": "29519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - 100 * b) / 10;\n  d = n % 10;\n  if (n < 10)\n    printf(\"%d \", n);\n  else if (n < 100)\n    printf(\"%d%d \", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d \", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d \", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b, i, k;\n  cin >> n;\n  b = n;\n  if (b == 0)\n    cout << b;\n  for (i = 0; b >= 1; i++) {\n    k = b % 10;\n    b = b / 10;\n    cout << k;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k;\n  scanf(\"%d \", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = a / 100;\n  e = a / 10;\n  f = a % 10;\n  g = e % 10;\n  h = d % 10;\n  i = (a / 10) % 10;\n  j = (a / 100) % 10;\n  k = (a / 1000) % 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0) {\n          printf(\"%d\", f);\n        } else\n          printf(\"%d%d\", f, e);\n      } else\n        printf(\"%d%d%d\", f, g, d);\n    } else\n      printf(\"%d%d%d%d\", f, i, h, c);\n  } else\n    printf(\"%d%d%d%d%d\", f, i, j, k, b);\n  return 0;\n}\n"}
{"label": "16", "index": "29522", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, q1, q2, q3, q4, q5, r1, r2, r3, r4, r5;\n  scanf(\"%d\", &n);\n  q1 = n / 10;\n  r1 = n % 10;\n\n  if (q1 == 0)\n    printf(\"%d\\n\", r1);\n  else {\n    q2 = q1 / 10;\n    r2 = q1 % 10;\n\n    if (q2 == 0)\n      printf(\"%d%d\\n\", r1, r2);\n    else {\n      q3 = q2 / 10;\n      r3 = q2 % 10;\n\n      if (q3 == 0)\n        printf(\"%d%d%d\\n\", r1, r2, r3);\n      else {\n        q4 = q3 / 10;\n        r4 = q3 % 10;\n\n        if (q4 == 0)\n          printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n        else {\n          q5 = q4 / 10;\n          r5 = q4 % 10;\n          printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29523", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  double i;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n >= 10 && n < 100) {\n    for (i = 1; i <= 2; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      cout << b;\n    }\n  }\n\n  else {\n    for (i = 1; i <= 3; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      cout << b;\n    }\n    a = n % (int)pow(10, i);\n    b = a / (pow(10, i - 1));\n    n -= a;\n    if (b != 0)\n      cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    if (n < 100)\n      cout << n % 10 << n / 10;\n    else if (n < 1000) {\n      a = n % 10;\n      n = (n - a) / 10;\n      b = n % 10;\n      n = (n - b) / 10;\n      cout << a << b << n;\n    } else if (n < 10000) {\n      a = n % 10;\n      n = (n - a) / 10;\n      b = n % 10;\n      n = (n - b) / 10;\n      c = n % 10;\n      n = (n - c) / 10;\n      cout << a << b << c << n;\n    } else\n      cout << \"0\"\n           << \"0\"\n           << \"0\"\n           << \"0\"\n           << \"1\";\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m;\n  char a[1][5];\n  cin.get(a[0], 5);\n  n = strlen(a[0]);\n  for (i = 0, j = n - 1; i < j; i++, j--) {\n    t = a[0][i];\n    a[0][i] = a[0][j];\n    a[0][j] = t;\n  }\n  for (m = 0; m < n; m++)\n    printf(\"%c\", a[0][m]);\n  return 0;\n}\n"}
{"label": "16", "index": "29526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r1, r2, r3, r4, r5;\n  double b;\n  scanf(\"%d \", &a);\n  b = (double)a / 10000;\n  if (b >= 1) {\n    r5 = a / 10000;\n    r4 = (a - 10000 * r5) / 1000;\n    r3 = (a - 10000 * r5 - 1000 * r4) / 100;\n    r2 = (a - 10000 * r5 - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 10000 * r5 - 1000 * r4 - 100 * r3 - 10 * r2;\n    cout << r1 << r2 << r3 << r4 << r5 << \"\\n\";\n  } else if (b >= 0.1) {\n    r4 = a / 1000;\n    r3 = (a - 1000 * r4) / 100;\n    r2 = (a - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n  } else if (b >= 0.01) {\n    r3 = a / 100;\n    r2 = (a - 100 * r3) / 10;\n    r1 = a - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d\\n\", r1, r2, r3);\n  } else if (b >= 0.001) {\n    r2 = a / 10;\n    r1 = a - 10 * r2;\n    printf(\"%d%d\\n\", r1, r2);\n  } else\n    printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid reverse(char s[], int a, int b) {\n  int i, j;\n  char temp;\n  for (i = a, j = b - 1; i < j; i++, j--) {\n    temp = s[i];\n    s[i] = s[j];\n    s[j] = temp;\n  }\n  for (i = a; i < b; i++) {\n    printf(\"%c\", s[i]);\n  }\n  cout << \" \";\n}\n\nint main() {\n  char string[10];\n  int len;\n\n  cin >> string;\n  len = strlen(string);\n  reverse(string, 0, len);\n}\n"}
{"label": "16", "index": "29528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\\n\");\n  else {\n    for (int i = 4; i >= 0; i--) {\n      if (floor(n / pow(10.0, i)) != 0) {\n        if (i >= m) {\n          m = i;\n        }\n      }\n    }\n    int p[m + 2], q[m + 1];\n    for (int j = 0; j < m + 2; j++)\n      p[j] = n % (int)pow(10.0, j);\n\n    for (int k = 0; k < m + 1; k++) {\n      q[k] = (p[m + 1 - k] - p[m - k]) / (int)pow(10.0, m - k);\n    }\n    for (int t = 0; t < m + 1; t++) {\n      printf(\"%d\", q[m - t]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j;\n  int a[5];\n  cin >> n;\n  for (; n > 0;) {\n    a[i] = n % 10;\n    i++;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j];\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a1, a2, a3, a4;\n  scanf(\"%d\", &n);\n  a1 = n / 1000;\n  a2 = (n - 1000 * a1) / 100;\n  a3 = (n - 1000 * a1 - 100 * a2) / 10;\n  a4 = (n - 1000 * a1 - 100 * a2 - 10 * a3);\n  if (a1 == 0 & a2 == 0 & a3 == 0)\n    printf(\"%d\", a4);\n  if (a1 == 0 & a2 != 0)\n    cout << a4 << a3 << a2;\n  if (a1 != 0 & a2 != 0 & a3 != 0)\n    printf(\"%d%d%d%d\", a4, a3, a2, a1);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  b = 0;\n  while (a) {\n    b = a % 10;\n    printf(\"%d\", b);\n    a = a / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, num, m, a, b;\n  scanf(\"%d\", &num);\n  m = num;\n  do {\n    n = n * 10 + num % 10;\n    num = num / 10;\n  } while (num != 0);\n  int weishu(int x);\n  a = weishu(m);\n  b = weishu(n);\n  if (a - b == 4)\n    printf(\"0000%d\\n\", n);\n  else if (a - b == 3)\n    printf(\"000%d\\n\", n);\n  else if (a - b == 2)\n    printf(\"00%d\\n\", n);\n  else if (a - b == 1)\n    printf(\"0%d\\n\", n);\n  else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n\nint weishu(int x) {\n  int y;\n  if (x >= 10000)\n    y = 5;\n  else if (x >= 1000)\n    y = 4;\n  else if (x >= 100)\n    y = 3;\n  else if (x >= 10)\n    y = 2;\n  else\n    y = 1;\n  return (y);\n}\n"}
{"label": "16", "index": "29533", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d \", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    int b, c;\n    b = a / 10;\n    c = a - 10 * b;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    int b, c, d;\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    int b, c, d, e;\n    b = a / 1000;\n    c = (a - 1000 * b) / 100;\n    d = (a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, m, n, o, p;\n  scanf(\"%d\", &x);\n  m = x / 10000;\n  n = x / 1000;\n  o = x / 100;\n  p = x / 10;\n  if (m != 0) {\n    a = m;\n    b = n - 10 * a;\n    c = o - 100 * a - 10 * b;\n    d = p - 1000 * a - 100 * b - 10 * c;\n    e = x % 10;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (n != 0) {\n    a = n;\n    b = o - 10 * a;\n    c = p - 100 * a - 10 * b;\n    d = x % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (o != 0) {\n    a = o;\n    b = p - 10 * o;\n    c = x % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (p != 0) {\n    a = p;\n    b = x % 10;\n    printf(\"%d%d\", b, a);\n  } else {\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "16", "index": "29535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, m = 0, i = 0;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  else {\n    int a[5];\n    a[0] = n / 10000;\n    a[1] = (n - 10000 * a[0]) / 1000;\n    a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n    a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = n - 10000 * a[0] - 1000 * a[1] - 100 * a[2] - 10 * a[3];\n    for (i = 0; i <= 4; i++) {\n      if (a[i] != 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 4; i >= m; i--)\n      cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29536", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, ge, shi, bai, qian, wan, place = 1, j = 2;\n  cin >> n;\n  for (i = 9; i <= 10000; i = i * 10 + 9) {\n    if (n > i)\n      place = j;\n    j = j + 1;\n  }\n  wan = n / 10000;\n  qian = (n - wan * 10000) / 1000;\n  bai = (n - wan * 10000 - qian * 1000) / 100;\n  shi = (n - wan * 10000 - qian * 1000 - bai * 100) / 10;\n  ge = n - wan * 10000 - qian * 1000 - bai * 100 - shi * 10;\n  switch (place) {\n  case 5:\n    cout << ge << shi << bai << qian << wan;\n    break;\n  case 4:\n    cout << ge << shi << bai << qian;\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", n);\n    break;\n  default:\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29537", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (a != 0) {\n    cout << d << c << b << a << endl;\n  } else if (b != 0) {\n    cout << d << c << b << endl;\n  } else if (c != 0) {\n    cout << d << c << endl;\n  } else {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  e = n % 10;\n  d = (n % 100 - e) / 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[6];\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    if (n == n % 10) {\n      i = i + 5;\n      cout << n;\n    } else {\n      a[i] = n % 10;\n      n = n / 10;\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29540", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[5];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29541", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = (a - b * 10000 - c * 1000) / 100;\n  e = (a - b * 10000 - c * 1000 - d * 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "29542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0;\n  int a[6] = {0};\n  cin >> n;\n  do {\n    a[i] = (n % 10);\n    n = (n - a[i]) / 10;\n    i++;\n    k++;\n  } while (n != 0);\n  for (i = 0; i < k; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s, a, b, c, d, e;\n  scanf(\"%d\", &s);\n  a = s / 10000;\n  b = (s - 10000 * a) / 1000;\n  c = (s - 10000 * a - 1000 * b) / 100;\n  d = (s - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (s - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    cout << \"00001\";\n  else if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10);\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10);\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i, j;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  e = n - a;\n  f = e / 10;\n  b = f % 10;\n  g = n - 10 * b - a;\n  h = g / 100;\n  c = h % 10;\n  i = n - 100 * c - 10 * b - a;\n  j = i / 1000;\n  d = j % 10;\n  if (d == 0) {\n    if (c == 0) {\n      if (b == 0)\n        printf(\"%d\", a);\n      else\n        printf(\"%d%d\", a, b);\n    } else\n      printf(\"%d%d%d\", a, b, c);\n  } else\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "29546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits] = iNum % radix;\n    cout << ch[iBits];\n    iNum /= radix;\n    iBits++;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  cin >> iNum;\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29547", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 0; n; i++) {\n    printf(\"%d\", n % 10);\n    n /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29548", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  cin >> n;\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  e = n % 10;\n  d = (n % 100 - e) / 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, m, n;\n  scanf(\"%d\", &a);\n  if (a <= 10) {\n    printf(\"%d\", a);\n  } else {\n    if (a == 10 || a == 100 || a == 1000) {\n      cout << \"001\";\n    } else {\n      if (100 >= a && a >= 10) {\n        b = a % 10;\n        c = (int)(a / 10);\n        d = 10 * b + a;\n        printf(\"%d\\n\", d);\n      } else {\n        if (1000 >= a && a >= 100) {\n          e = (int)(a / 100);\n          f = (int)((a - 100 * e) / 10);\n          g = a - 100 * e - 10 * f;\n          m = 100 * g + 10 * f + e;\n          printf(\"%d\\n\", m);\n        } else {\n          h = (int)(a / 1000);\n          i = (int)((a - 1000 * h) / 100);\n          j = (int)((a - 1000 * h - 100 * i) / 10);\n          k = a - 1000 * h - 100 * i - 10 * j;\n          n = 1000 * k + 100 * j + 10 * i + h;\n          printf(\"%d\\n\", n);\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29550", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n == 10000) {\n    puts(\"00001\");\n  } else if (n >= 1000) {\n    a = n / 1000, b = n / 100 - a * 10, c = n / 10 - a * 100 - b * 10,\n    d = n - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n >= 100) {\n    a = n / 100, b = n / 10 - a * 10, c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n >= 10) {\n    a = n / 10, b = n - 10 * a;\n    printf(\"%d%d\", b, a);\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[5], t;\n  cin >> n;\n  a[0] = n / 1000;\n  a[1] = (n - 1000 * a[0]) / 100;\n  a[2] = (n - 1000 * a[0] - 100 * a[1]) / 10;\n  a[3] = n - 1000 * a[0] - 100 * a[1] - 10 * a[2];\n  if (n >= 1000) {\n    cout << a[3] << a[2] << a[1] << a[0];\n  } else if (n >= 100 && n < 1000) {\n    cout << a[3] << a[2] << a[1];\n  } else if (n >= 10 && n < 100) {\n    cout << a[3] << a[2];\n  } else if (n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29552", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    int a, b;\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    int c, d, e;\n    c = n % 10;\n    d = (n - c) / 10 % 10;\n    e = (n - 10 * d - c) / 100;\n    printf(\"%d%d%d\", c, d, e);\n  } else {\n    int f, g, h, i;\n    f = n % 10;\n    g = (n - f) / 10 % 10;\n    h = (n - f - 10 * g) / 100 % 10;\n    i = (n - f - 10 * g - 100 * h) / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n}\n"}
{"label": "16", "index": "29553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m;\n  char a[1][5];\n  cin.get(a[0], 5);\n  n = strlen(a[0]);\n  for (i = 0, j = n - 1; i < j; i++, j--) {\n    t = a[0][i];\n    a[0][i] = a[0][j];\n    a[0][j] = t;\n  }\n  for (m = 0; m < n; m++)\n    cout << a[0][m];\n  return 0;\n}\n"}
{"label": "16", "index": "29554", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    cout << n << \"\\n\";\n  else {\n    for (; n > 0;) {\n      a = n % 10;\n      cout << a;\n      n = n / 10;\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0) {\n    printf(\"%d\", a);\n  } else if (a / 100 == 0) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a / 1000 == 0) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a / 10000 == 0) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    f = a % 10;\n    printf(\"%d%d%d%d\", f, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29556", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b1, b, c1, c, d1, d, x, y;\n  scanf(\"%d \", &x);\n  a = x % 10;\n  b1 = x % 100;\n  b = b1 / 10;\n  c1 = x % 1000;\n  c = c1 / 100;\n  d1 = x;\n  d = d1 / 1000;\n  if (d != 0) {\n    y = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", y);\n  } else if ((d == 0) && (c != 0)) {\n    y = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", y);\n  } else if ((c == 0) && (b != 0)) {\n    y = a * 10 + b;\n    printf(\"%02d\\n\", y);\n  } else {\n    y = a;\n    printf(\"%d\\n\", y);\n  }\n}\n"}
{"label": "16", "index": "29557", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[5];\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  else {\n    {\n      for (i = 0; n > 0; i++) {\n        a[i] = n % 10;\n        n = n / 10;\n      }\n    }\n    m = i;\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10001], b[10001], c[10001];\n  int x, i;\n  cin >> a;\n  x = strlen(a);\n  for (i = 0; i <= x; i++)\n    b[i] = a[x - i - 1];\n\n  cout << b;\n  return 0;\n}\n"}
{"label": "16", "index": "29559", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  printf(\"%d\", b);\n  c = a / 10;\n  if (c != 0)\n    printf(\"%d\", c % 10);\n  d = a / 100;\n  if (d != 0)\n    printf(\"%d\", d % 10);\n  e = a / 1000;\n  if (e != 0)\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[5], n, i, k = 0;\n  cin >> n;\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 4; i >= 0; i--)\n    if (a[i] != 0) {\n      k = i;\n      break;\n    }\n  for (i = 0; i <= k; i++)\n    cout << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b = 0, i, j;\n  scanf(\"%d\", &a);\n  i = log10(a);\n  for (; a > 0;) {\n    b = b * 10 + a % 10;\n    a = a / 10;\n  }\n  j = log10(b);\n  for (; i > j; i--)\n    printf(\"0\");\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29562", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  cin.getline(a, 100);\n  int i;\n  int l = strlen(a);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[6];\n  cin >> a;\n  int i, j;\n  j = strlen(a);\n  for (i = j - 1; i >= 0; i--)\n    cout << a[i];\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &a);\n  b = a % 1000;\n  c = (a - b) / 1000;\n  d = b % 100;\n  e = (b - d) / 100;\n  f = d % 10;\n  g = (d - f) / 10;\n  if (c == 0) {\n    if (e == 0) {\n      if (g == 0) {\n        if (f == 0)\n          printf(\"0\");\n        else\n          printf(\"%d\", f);\n      } else {\n        printf(\"%d%d\", f, g);\n      }\n    } else {\n      printf(\"%d%d%d\", f, g, e);\n    }\n  } else {\n    printf(\"%d%d%d%d\", f, g, e, c);\n  }\n}\n"}
{"label": "16", "index": "29565", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, len = 0, temp[6];\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", n);\n  while (n > 0) {\n    temp[len++] = n % 10;\n    n = n / 10;\n  }\n  for (int i = 0; i < len; i++)\n    cout << temp[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, a[10], m, i;\n  cin >> t;\n  for (i = 0; i <= 4; i++) {\n    a[i] = t % 10;\n    t = t / 10;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      m = i;\n      break;\n    }\n  }\n  for (i = 0; i <= m; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29567", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[80];\n  int i;\n\n  cin >> s;\n  for (i = strlen(s) - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[5];\n  memset(a, ' ', sizeof(a));\n  cin.getline(a, 5);\n  for (i = 5; i >= 0; i--) {\n    if (a[i] == '0' || a[i] == '1' || a[i] == '2' || a[i] == '3' ||\n        a[i] == '4' || a[i] == '5' || a[i] == '6' || a[i] == '7' ||\n        a[i] == '8' || a[i] == '9') {\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 0; n; i++) {\n    printf(\"%d\", n % 10);\n    n /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29570", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, *a, i;\n  cin >> n;\n  if (n != 0) {\n    m = floor(log10(n)) + 1;\n    a = (int *)malloc(sizeof(int) * m);\n    for (i = 1; i <= m; i++) {\n      *(a + i - 1) = n % 10;\n      n = (n - *(a + i - 1)) / 10;\n    }\n    for (i = 1; i <= m; i++)\n      cout << *(a + i - 1);\n  } else\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "29571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, n1, n2;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  n1 = n - 1000 * a;\n  b = n1 / 100;\n  n2 = n1 - 100 * b;\n  c = n2 / 10;\n  d = n2 - 10 * c;\n  if (a == 10)\n    cout << \"00001\" << endl;\n  else if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (b != 0)\n    cout << d << c << b << endl;\n  else if (c != 0)\n    cout << d << c << endl;\n  else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29572", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n\n  if (n >= 1000) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (n >= 100) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n % 10;\n\n      printf(\"%d%d%d\", c, b, a);\n    } else {\n      if (n >= 10) {\n        a = n / 10;\n        b = n % 10;\n        printf(\"%d%d\", b, a);\n      } else\n        printf(\"%d\", n);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29573", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 10000);\n  b = (int)((n - a * 10000) / 1000);\n  c = (int)((n - a * 10000 - b * 1000) / 100);\n  d = (int)((n - a * 10000 - b * 1000 - c * 100) / 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    cout << e;\n  return 0;\n}\n"}
{"label": "16", "index": "29574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i;\n  char a[6];\n  for (i = 1; i <= 5; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n  }\n  i = i - 1;\n  for (k = i; k >= 1; k--)\n    cout << a[k];\n  return 0;\n}\n"}
{"label": "16", "index": "29575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a < 10 && a >= 0)\n    cout << a;\n  else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%.2d\", b * 10 + c);\n  } else if (a > 99 && a < 1000) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    printf(\"%.3d\", b * 100 + c * 10 + d);\n  } else if (a > 999 && a < 10001) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    f = ((a - b - c * 10 - d * 100) / 1000) % 10;\n    printf(\"%.4d\", b * 1000 + c * 100 + d * 10 + f);\n  } else\n    return 0;\n}\n"}
{"label": "16", "index": "29576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n % 100) / 10;\n  d = n % 10;\n\n  if (n / 1000 != 0)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else {\n    if (n / 100 != 0)\n      printf(\"%d%d%d\", d, c, b);\n    else if (n / 10 != 0)\n      printf(\"%d%d\", d, c);\n    else\n      printf(\"%d\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29577", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    printf(\"%d\", a[i]);\n    if (n == 0) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29578", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, an[10];\n  cin >> n;\n  int j = 0;\n  for (i = n; i > 0; i = i / 10) {\n    an[j] = i % 10;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%d\", an[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a = 0, b;\n  scanf(\"%d\", &n);\n  b = n;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    do {\n      a = a * 10 + n % 10;\n      n = n / 10;\n    } while (n != 0);\n    if (b % 10 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 100 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 1000 == 0 && b != 0)\n      printf(\"0\");\n    printf(\"%d\\n\", a);\n  }\n}\n"}
{"label": "16", "index": "29580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n % 1000) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"00001\\n\");\n  else if (b != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 1000 + d * 100 + c * 10 + b);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 100 + c * 10 + b);\n    else if (c != 0)\n      printf(\"00%d\\n\", c * 10 + b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (c != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 100 + d * 10 + c);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 10 + c);\n    else\n      printf(\"00%d\\n\", c);\n  } else if (d != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 10 + d);\n    else\n      printf(\"0%d\\n\", d);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char num[6];\n  int i, n, nnum[6], p = 0;\n  cin >> num;\n  n = strlen(num);\n\n  for (i = n - 1; i >= 0; i--) {\n    nnum[i] = num[i] - 48;\n    cout << nnum[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, m = 0, i = 0;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  else {\n    int a[5];\n    a[0] = n / 10000;\n    a[1] = (n - 10000 * a[0]) / 1000;\n    a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n    a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = n - 10000 * a[0] - 1000 * a[1] - 100 * a[2] - 10 * a[3];\n    for (i = 0; i <= 4; i++) {\n      if (a[i] != 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 4; i >= m; i--) {\n      cout << a[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29583", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid nixu(int k);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  nixu(n);\n  return 0;\n}\nvoid nixu(int k) {\n  if (k > 0) {\n    printf(\"%d\", k % 10);\n    k /= 10;\n    nixu(k);\n  }\n}\n"}
{"label": "16", "index": "29584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, g, s, b, q, o = 0, p = 1;\n  cin >> a;\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\\n\", o, o, o, o, p);\n  {\n    if (a <= 10)\n      printf(\"%d\\n\", a);\n    else if (a < 100) {\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d\\n\", g, s);\n    } else if (a < 1000) {\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d\\n\", g, s, b);\n    } else if (a < 10000) {\n      q = (a % 10000) / 1000;\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d%d\\n\", g, s, b, q);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29585", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, w, c;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  else if (n > 999)\n    w = 4;\n  else if (n > 99)\n    w = 3;\n  else if (n > 9)\n    w = 2;\n  else\n    printf(\"%d\", n);\n\n  for (i = 1; i < w + 1; i++) {\n    c = n % 10;\n    n = n / 10;\n\n    printf(\"%d\", c);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, c;\n  scanf(\"%d\", &n);\n  c = 0;\n  if (n != 0)\n    for (; n != 0; n = n / 10) {\n      a = n % 10;\n      printf(\"%d\", a);\n    }\n  else {\n    printf(\"0\");\n  }\n  return (0);\n}\n"}
{"label": "16", "index": "29587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  long a, original;\n  cin >> a;\n  original = a;\n  int dig1, dig2, dig3, dig4, dig5;\n  int NumofDig;\n  dig1 = a / 10000;\n  a = a - 10000 * dig1;\n  dig2 = a / 1000;\n  a = a - 1000 * dig2;\n  dig3 = a / 100;\n  a = a - 100 * dig3;\n  dig4 = a / 10;\n  a = a - 10 * dig4;\n  dig5 = a;\n  if (dig1)\n    NumofDig = 5;\n  else {\n    if (dig2)\n      NumofDig = 4;\n    else {\n      if (dig3)\n        NumofDig = 3;\n      else {\n        if (dig4)\n          NumofDig = 2;\n        else\n          NumofDig = 1;\n      }\n    }\n  }\n  long Oppo;\n  Oppo = dig5 * 10000 + dig4 * 1000 + dig3 * 100 + dig2 * 10 + dig1;\n  switch (NumofDig) {\n  case 5:\n    cout << \"00001\" << endl;\n    break;\n  case 4:\n    cout << dig5 << dig4 << dig3 << dig2 << endl;\n    break;\n  case 3:\n    cout << dig5 << dig4 << dig3 << endl;\n    break;\n  case 2:\n    cout << dig5 << dig4 << endl;\n    break;\n  case 1:\n    cout << dig5 << endl;\n    break;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "16", "index": "29588", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  while (a > 0) {\n    printf(\"%d\", a % 10);\n    a /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (;;) {\n    printf(\"%d\", n % 10);\n    if (n < 10)\n      break;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  if (0 <= a && a <= 9)\n    b = 1;\n  else {\n    if (10 <= a && a <= 99)\n      b = 2;\n    else {\n      if (100 <= a && a <= 999)\n        b = 3;\n      else {\n        if (1000 <= a && a <= 9999)\n          b = 4;\n        else {\n          if (10000 <= a && a <= 99999)\n            b = 5;\n        }\n      }\n    }\n  }\n  switch (b) {\n  case 1: {\n    printf(\"%d\\n\", a);\n  } break;\n  case 2: {\n    c = a / 10;\n    d = a % 10;\n    printf(\"%d%d\\n\", d, c);\n  } break;\n  case 3: {\n    c = a / 100;\n    d = (a - c * 100) / 10;\n    e = a - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n  } break;\n  case 4: {\n    c = a / 1000;\n    d = (a - c * 1000) / 100;\n    e = (a - c * 1000 - d * 100) / 10;\n    f = a - c * 1000 - d * 100 - e * 10;\n    cout << f << e << d << c << \"\\n\";\n  } break;\n  case 5: {\n    c = a / 10000;\n    d = (a - c * 10000) / 1000;\n    e = (a - c * 10000 - d * 1000) / 100;\n    f = (a - c * 10000 - d * 1000 - e * 100) / 10;\n    g = a - c * 10000 - d * 1000 - e * 100 - f * 10;\n    printf(\"%d%d%d%d%d\\n\", g, f, e, d, c);\n  }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d \", &n);\n  a[0] = n / 1000;\n  a[1] = (n - 1000 * a[0]) / 100;\n  a[2] = (n - 1000 * a[0] - 100 * a[1]) / 10;\n  a[3] = n - 1000 * a[0] - 100 * a[1] - 10 * a[2];\n  if (n >= 1000)\n    cout << a[3] << a[2] << a[1] << a[0];\n  else if (n >= 100 && n < 1000) {\n    cout << a[3] << a[2] << a[1];\n  } else if (n >= 10 && n < 100) {\n    cout << a[3] << a[2];\n  } else if (n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[10];\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n}\n"}
{"label": "16", "index": "29593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a = 0, b;\n  cin >> n;\n  b = n;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    do {\n      a = a * 10 + n % 10;\n      n = n / 10;\n    } while (n != 0);\n    if (b % 10 == 0 && b != 0)\n      printf(\"0\");\n    if (b % 100 == 0 && b != 0)\n      cout << \"0\";\n    if (b % 1000 == 0 && b != 0)\n      printf(\"0\");\n    printf(\"%d\\n\", a);\n  }\n}\n"}
{"label": "16", "index": "29594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    cout << a << \"\\n\";\n  } else if (a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    a = b * 10 + c;\n    printf(\"%02d\\n\", a);\n  } else if (a < 1000) {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = (a - c * 10 - b) / 100;\n    a = b * 100 + c * 10 + d;\n    printf(\"%03d\\n\", a);\n  } else {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = ((a - c * 10 - b) % 1000) / 100;\n    e = (a - d * 100 - c * 10 - b) / 1000;\n    a = b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n  if (b == 1) {\n    printf(\"%d%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c >= 1) {\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d >= 1) {\n        cout << f << e << d;\n      } else {\n        if (e >= 1) {\n          printf(\"%d%d\", f, e);\n        } else {\n          printf(\"%d\", f);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29596", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else\n    while (n) {\n      a = n % 10;\n      n = (n - a) / 10;\n      printf(\"%d\", a);\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "29597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else {\n    if (c != 0)\n      printf(\"%d%d%d\", e, d, c);\n    else {\n      if (d != 0)\n        cout << e << d;\n      else\n        printf(\"%d\", e);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29598", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, m, n, a[10];\n  cin >> n;\n  m = n;\n  p = 1;\n  while (m / 10 != 0) {\n    a[p - 1] = m % 10;\n    m = m / 10;\n    p++;\n  }\n  a[p - 1] = m;\n  for (int j = 0; j < p; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29599", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n\n  if (n >= 1000) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (n >= 100) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n % 10;\n\n      printf(\"%d%d%d\", c, b, a);\n    } else {\n      if (n >= 10) {\n        a = n / 10;\n        b = n % 10;\n        printf(\"%d%d\", b, a);\n      } else {\n        cout << n;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100] = {0};\n  int i = 0, b = n, j;\n  do {\n    b = b / 10;\n    i++;\n  } while (b != 0);\n  for (j = 0; j < i; j++) {\n    a[j] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n\n  if (a >= 0 && a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    d = b * 10 + c;\n    printf(\"%02d\\n\", d);\n  } else if (a >= 100 && a < 1000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) / 100;\n    e = b * 100 + c + d;\n    printf(\"%03d\\n\", e);\n  } else if (a >= 1000 && a < 10000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) % 1000;\n    e = (a - b - c - d) / 1000;\n    f = b * 1000 + c * 10 + d / 10 + e;\n    printf(\"%04d\\n\", f);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29602", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  char x[6];\n\n  cin >> x;\n  int i;\n\n  for (i = 5; i >= 0; i--)\n    if (x[i] == '0' || x[i] == '1' || x[i] == '2' || x[i] == '3' ||\n        x[i] == '4' || x[i] == '5' || x[i] == '6' || x[i] == '7' ||\n        x[i] == '8' || x[i] == '9')\n      break;\n\n  for (int j = i; j >= 0; j--)\n    cout << x[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  scanf(\"%d \", &x);\n  e = x / 10000;\n  d = (x - e * 10000) / 1000;\n  c = (x - e * 10000 - d * 1000) / 100;\n  b = (x - e * 10000 - d * 1000 - c * 100) / 10;\n  a = x - e * 10000 - d * 1000 - c * 100 - b * 10;\n  if (x < 10)\n    printf(\"%d\", a);\n  else if (x < 100)\n    printf(\"%02d\", 10 * a + b);\n  else if (x < 1000)\n    printf(\"%03d\", 100 * a + 10 * b + c);\n  else if (x < 10000)\n    printf(\"%04d\", 1000 * a + 100 * b + 10 * c + d);\n  else if (x == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n % 10;\n  if (a > 0)\n    printf(\"00001\");\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29605", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a > 9999) {\n\n    b = a / 10000;\n    c = (a / 1000) - 10 * b;\n    d = (a / 100) - 100 * b - 10 * c;\n    e = (a / 10) - 1000 * b - 100 * c - 10 * d;\n    f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29606", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  n = (n - d) / 10;\n  e = n % 10;\n  n = (n - e) / 10;\n  if (e != 0) {\n    cout << a << b << c << d << e << endl;\n  } else if (d != 0)\n    cout << a << b << c << d << endl;\n  else if (c != 0)\n    cout << a << b << c << endl;\n  else if (b != 0)\n    cout << a << b << endl;\n  else\n    cout << a << endl;\n  return (0);\n}\n"}
{"label": "16", "index": "29607", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  scanf(\"%d\", &num);\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (num == 10000)\n    printf(\"1\\n\");\n  if (num > 999)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (num > 9)\n    cout << d << c << \"\\n\";\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "29608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid p(int num) {\n  while (num) {\n    cout << num % 10;\n    num /= 10;\n  }\n}\nint main() {\n  int l;\n  cin >> l;\n  if (l != 0)\n    p(l);\n  else\n    cout << 0;\n  return 0;\n}\n"}
{"label": "16", "index": "29609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5] = {0}, n, i, j;\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n  a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  if (n == 0)\n    cout << 0;\n  else\n    for (i = 0; i < 5; i++) {\n      if (a[i] != 0) {\n        for (j = 4; j >= i; j--)\n          cout << a[j];\n        break;\n      }\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, a[6];\n  cin >> n;\n  for (i = 0; i < 5; i++) {\n    if (n == n % 10) {\n      i = i + 5;\n      cout << n;\n    } else {\n      a[i] = n % 10;\n      n = n / 10;\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, i;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= 4; i++) {\n    printf(\"%d\", a % 10);\n    a = a / 10;\n    if (a < 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n <= 9999 && n > 1000) {\n    i = n / 1000 + n % 1000 / 100 * 10 + n % 100 / 10 * 100 + n % 10 * 1000;\n    cout << i << endl;\n  } else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n <= 999 && n > 100) {\n    i = n / 100 + n % 100 / 10 * 10 + n % 10 * 100;\n    printf(\"%d\\n\", i);\n  } else if (n == 100) {\n    cout << \"001\" << endl;\n  } else if (n <= 99 && n > 10) {\n    i = n % 10 * 10 + n / 10;\n  } else if (n == 10)\n    cout << \"01\" << endl;\n  else if (n <= 9 && n >= 0)\n    printf(\"%d\\n\", n);\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29613", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], n, i;\n  scanf(\"%d \", &n);\n  if (n == 10000) {\n    cout << 00001 << endl;\n  } else {\n    b[0] = n;\n    for (i = 0; i < 4; i++) {\n      a[i] = b[i] / pow(10.0, (double)(3 - i));\n      b[i + 1] = b[i] % (int)(pow(10.0, (double)(3 - i)));\n    }\n    if (a[0] != 0) {\n      cout << a[3] << a[2] << a[1] << a[0] << endl;\n    } else if (a[1] != 0) {\n      cout << a[3] << a[2] << a[1] << endl;\n    } else if (a[2] != 0) {\n      cout << a[3] << a[2] << endl;\n    } else {\n      cout << a[3] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e, g;\n  scanf(\"%d \", &i);\n  if ((i >= 10) && (i < 100)) {\n    a = i / 1000;\n    b = i % 10;\n    g = 10 * b + a;\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i > 0) && (i < 10)) {\n    g = i;\n    printf(\"%d\", i);\n  }\n  if ((i >= 100) && (i < 1000)) {\n    a = i / 100;\n    b = (i / 10) % 10;\n    c = i % 10;\n    g = 100 * c + 10 * b + a;\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i >= 1000) && (i < 10000)) {\n\n    a = i / 1000;\n    b = (i / 100) % 10;\n    c = (i / 10) % 10;\n    d = i % 10;\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, A, B, C, D, E;\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = n / 100;\n    c = n / 10;\n    d = n % 10;\n    A = d;\n    B = c % 10;\n    C = b % 10;\n    D = a;\n    cout << A << B << C << D << endl;\n  } else if (n >= 100 && n < 1000) {\n    a = n / 100;\n    b = n / 10;\n    c = n % 10;\n    A = c;\n    B = b % 10;\n    C = a;\n    cout << A << B << C << endl;\n  } else if (n >= 10 && n < 100) {\n    A = n % 10;\n    B = n / 10;\n    cout << A << B << endl;\n  } else\n    cout << n << endl;\n}\n"}
{"label": "16", "index": "29616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if ((10 < n) && (n < 100)) {\n    int i, j, k;\n    i = n / 10;\n    j = n % 10;\n    k = 10 * j + i;\n    printf(\"%d\", k);\n  } else if ((100 < n) && (n < 1000)) {\n    int a, b, c, d, e;\n    a = n / 100;\n    b = n % 100;\n    c = b / 10;\n    d = b % 10;\n    e = 100 * d + 10 * c + a;\n    printf(\"%d\", e);\n  } else if ((1000 < n) && (n < 10000)) {\n    int f, l, m, w, o, p, q;\n    f = n / 1000;\n    l = n % 1000;\n    m = l / 100;\n    w = l % 100;\n    o = w / 10;\n    p = w % 10;\n    q = 1000 * p + 100 * o + 10 * m + f;\n    printf(\"%d\", q);\n  } else if (n == 10) {\n    printf(\"01\");\n  } else if (n == 100) {\n    printf(\"001\");\n  } else if (n == 1000) {\n    printf(\"0001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char ch[100000], tes;\n\n  for (;; i++) {\n    ch[i] = getchar();\n    if (ch[i] == '\\n')\n      break;\n  }\n\n  for (; i >= 0; i--)\n    cout << ch[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    printf(\"00001\");\n  if (n > 999 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  if (n > 99 && n < 1000) {\n    b = n / 100;\n    c = (n - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if (n > 9 && n < 100) {\n    c = n / 10;\n    d = n % 10;\n    printf(\"%d%d\", d, c);\n  }\n  if (n < 10)\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 10000);\n  b = (int)((n - a * 10000) / 1000);\n  c = (int)((n - a * 10000 - b * 1000) / 100);\n  d = (int)((n - a * 10000 - b * 1000 - c * 100) / 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    cout << e << d << c << b;\n  else if (c != 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29620", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b, a[5], j;\n  scanf(\"%d \", &b);\n  a[4] = b / 10000;\n  a[3] = (b - a[4] * 10000) / 1000;\n  a[2] = (b - a[4] * 10000 - a[3] * 1000) / 100;\n  a[1] = (b - a[4] * 10000 - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = b - a[4] * 10000 - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  if (b >= 10000)\n    for (j = 0; j <= 4; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 1000)\n    for (j = 0; j <= 3; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 100)\n    for (j = 0; j <= 2; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 10)\n    for (j = 0; j <= 1; j++)\n      printf(\"%d\", a[j]);\n  else\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "29621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    cout << \"00001\";\n  if (n > 999 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  if (n > 99 && n < 1000) {\n    b = n / 100;\n    c = (n - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if (n > 9 && n < 100) {\n    c = n / 10;\n    d = n % 10;\n    printf(\"%d%d\", d, c);\n  }\n  if (n < 10)\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, c, d, i, t, j;\n  c = 0;\n  scanf(\"%d\", &n);\n  if (n > 0 && n < 10000) {\n    for (i = 4; i >= 1; i--) {\n      b = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      if (b != 0) {\n        j = i;\n        break;\n      }\n    }\n    for (i = 1; i <= j; i++) {\n      d = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      cout << d;\n    }\n  } else if (n == 0)\n    cout << \"0\";\n  else if (n == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "29623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a[5];\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  if (a[4] == 0 && a[3] == 0 && a[2] == 0 && a[1] == 0)\n    cout << a[0];\n  else if (a[4] == 0 && a[3] == 0 && a[2] == 0)\n    printf(\"%d%d\", a[0], a[1]);\n  else if (a[4] == 0 && a[3] == 0)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (a[4] == 0)\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n  else\n    printf(\"%d%d%d%d%d\", a[0], a[1], a[2], a[3], a[4]);\n  return 0;\n}\n"}
{"label": "16", "index": "29624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    int b, c;\n    b = a / 10;\n    c = a - 10 * b;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    int b, c, d;\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    int b, c, d, e;\n    b = a / 1000;\n    c = (a - 1000 * b) / 100;\n    d = (a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    cout << e << d << c << b;\n  }\n}\n"}
{"label": "16", "index": "29625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  if (n >= 1000) {\n    int a[4];\n    a[0] = n / 1000;\n    a[1] = (n % 1000) / 100;\n    a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n    a[3] = n - a[0] * 1000 - a[1] * 100 - a[2] * 10;\n    for (i = 3; i >= 0; i--)\n      printf(\"%d\", a[i]);\n  } else if (n >= 100) {\n    int a[3];\n    a[0] = n / 100;\n    a[1] = (n - a[0] * 100) / 10;\n    a[2] = n - a[0] * 100 - a[1] * 10;\n    for (i = 2; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 10) {\n    int a[2];\n    a[0] = n / 10;\n    a[1] = n - a[0] * 10;\n    for (i = 1; i >= 0; i--)\n      cout << a[i];\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29626", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else {\n        printf(\"%d%d\\n\", d, c);\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    b = a;\n    printf(\"%d\", b);\n  } else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10001], n, i, x;\n  char ch;\n  n = 0;\n  while ((ch = cin.get()) != '\\n') {\n    a[n] = ch - '0';\n    n++;\n  }\n  for (i = 0; i < n / 2; i++) {\n    x = a[i];\n    a[i] = a[n - i - 1];\n    a[n - i - 1] = x;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  n = n - 10000 * a;\n  b = n / 1000;\n  n = n - 1000 * b;\n  c = n / 100;\n  n = n - 100 * c;\n  d = n / 10;\n  e = n - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a;\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    cout << e << d;\n  else\n    cout << e;\n  return 0;\n}\n"}
{"label": "16", "index": "29630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d \", &a);\n  if (a >= 1000) {\n    b = a % 1000;\n    c = b % 100;\n    d = c % 10;\n    cout << d << (c - d) / 10 << (b - c) / 100 << (a - b) / 1000 << endl;\n  } else if (a < 1000 && a >= 100) {\n    b = a % 100;\n    c = b % 10;\n    cout << c << (b - c) / 10 << (a - b) / 100 << endl;\n  } else if (a < 100 && a >= 10) {\n    b = a & 10;\n    printf(\"%d%d\\n\", b, (a - b) / 10);\n  } else if (a >= 0 && a <= 9)\n    cout << a << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, h, i, j, n;\n\n  scanf(\"%d\", &a);\n\n  if (a >= 10000) {\n    b = a / 10000;\n    c = a - b * 10000;\n    d = c / 1000;\n    e = c - d * 1000;\n    f = e / 100;\n    h = e - f * 100;\n    j = h / 10;\n    i = h - j * 10;\n    n = 10000 * i + 1000 * j + 100 * f + 10 * d + b;\n\n    printf(\"%05d\", n);\n  } else if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - d * 100;\n    f = e / 10;\n    h = e - f * 10;\n    n = 1000 * h + 100 * f + 10 * d + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else if (a >= 0)\n    printf(\"%d\", a);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  b = (n % 100 - n % 10) / 10;\n  c = (n % 1000 - n % 100) / 100;\n  d = (n % 10000 - n % 1000) / 1000;\n  e = (n - 1000 * d - 100 * c - 10 * b - a) / 10000;\n  if (e != 0) {\n    cout << a << b << c << d << e;\n  } else if (d != 0) {\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (c != 0) {\n    printf(\"%d%d%d\", a, b, c);\n  } else if (d != 0) {\n    printf(\"%d%d\", a, b);\n  } else {\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[1000];\n\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << \"0\";\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    printf(\"%d\", a[i]);\n    n = n / 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[10000], i = 0;\n  cin >> n;\n  float b[10000], c;\n  c = n / 10;\n  b[0] = floor(c);\n  a[0] = n % 10;\n  if (b[0] == 0)\n    cout << n << endl;\n  if (b[0] != 0) {\n    while (1) {\n      a[i + 1] = (int)b[i] % 10;\n      b[i + 1] = floor(b[i] / 10);\n      if (b[i + 1] < 1)\n        break;\n      i++;\n    }\n    for (int k = 0; k <= i + 1; k++)\n      cout << a[k];\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29635", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    cout << a << \"\\n\";\n  else if (a < 100) {\n    int b, c;\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%02d\\n\", 10 * b + c);\n  } else if (a < 1000) {\n    int d, e, f;\n    d = a % 10;\n    e = a % 100;\n    e = (e - d) / 10;\n    f = (a - d - 10 * e) / 100;\n    printf(\"%03d\\n\", 100 * d + 10 * e + f);\n  } else if (a < 10000) {\n    int g, h, i, j;\n    g = a % 10;\n    h = a % 100;\n    h = (h - g) / 10;\n    i = a % 1000;\n    i = (i - 10 * h - g) / 100;\n    j = (a - 100 * i - 10 * h - g) / 1000;\n    printf(\"%04d\\n\", 1000 * g + 100 * h + 10 * i + j);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29636", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d \", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  e = n % 10;\n  d = (n % 100 - e) / 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a % 10000 - 10 * c - b - 100 * d;\n    e = e / 1000;\n    f = a - 10 * c - b - 100 * d - 1000 * e;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  } else if (a >= 1000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a - 10 * c - b - 100 * d;\n    e = e / 1000;\n\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 100) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a - 10 * c - b;\n    d = d / 100;\n\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 10) {\n    b = a % 10;\n    c = a % 100 - b;\n\n    c = c / 10;\n    d = d / 100;\n    e = e / 100;\n    f = f / 10000;\n\n    printf(\"%d%d\", b, c);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29638", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    cout << a << b;\n  } else if (n < 1000) {\n    c = n % 10, e = n / 100;\n    d = (n / 10) % 10;\n    printf(\"%d%d%d\", c, d, e);\n  } else if (n < 10000) {\n    f = n % 10;\n    g = (n % 100) / 10;\n    h = (n / 100) % 10;\n    i = n / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char s[20];\n  int l, i;\n  scanf(\"%s\", s);\n  l = strlen(s);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int sum, len, i;\n  int a[10];\n  cin >> sum;\n  if (sum >= 10000)\n    len = 5;\n  else if (sum >= 1000)\n    len = 4;\n  else if (sum >= 100)\n    len = 3;\n  else if (sum >= 10)\n    len = 2;\n  else\n    len = 1;\n  for (i = 1; i <= len; i++) {\n    a[i] = sum / (pow(10, (len - i)));\n    sum = sum - a[i] * pow(10, (len - i));\n  }\n  for (i = 1; i <= len; i++)\n    cout << a[len - i + 1];\n}\n"}
{"label": "16", "index": "29641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[6], t[6];\n  int i, x;\n\n  cin >> s;\n  x = strlen(s);\n  for (i = 0; i <= x - 1; i++)\n    t[x - 1 - i] = s[i];\n  for (i = x; i <= 5; i++)\n    t[i] = 0;\n  puts(t);\n}\n"}
{"label": "16", "index": "29642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int t, n, a, b, c, d, e, i, j, k, l, m;\n\n  scanf(\"%d\", &n);\n  t = n;\n  j = t / 10000;\n  if (j != 0) {\n    i = 5;\n    t = 0;\n  }\n\n  j = t / 1000;\n  if (j != 0) {\n    i = 4;\n    t = 0;\n  }\n\n  j = t / 100;\n  if (j != 0) {\n    i = 3;\n    t = 0;\n  }\n\n  j = t / 10;\n  if (j != 0) {\n    i = 2;\n    t = 0;\n  }\n\n  j = t / 1;\n  if (j != 0) {\n    i = 1;\n    t = 0;\n  }\n\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    a = n / 10000;\n    n = n % 10000;\n    b = n / 1000;\n    n = n % 1000;\n    c = n / 100;\n    n = n % 100;\n    d = n / 10;\n    n = n % 10;\n    e = n;\n\n    if (i == 5)\n      printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    if (i == 4)\n      printf(\"%d%d%d%d\", e, d, c, b);\n    if (i == 3)\n      cout << e << d << c;\n    if (i == 2)\n      printf(\"%d%d\", e, d);\n    if (i == 1)\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29643", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (;;) {\n    printf(\"%d\", n % 10);\n    if (n < 10)\n      break;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  int l;\n\n  scanf(\"%s \", a);\n\n  l = strlen(a);\n\n  for (int i = 0; i < l; i++) {\n    b[i] = a[l - i - 1];\n    printf(\"%c\", b[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x / 1000 - x / 10000 * 10;\n  c = x / 100 - x / 1000 * 10;\n  d = x / 10 - x / 100 * 10;\n  e = x - x / 10 * 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  int b;\n  if (a == 0)\n    printf(\"0\\n\");\n  else {\n    while (a != 0) {\n      b = a % 10;\n      a = a / 10;\n      cout << b;\n    }\n    printf(\"\\n\");\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i = 0;\n  scanf(\"%d \", &a);\n  if (a == 100)\n    cout << \"001\";\n  else {\n    while (a > 0) {\n      i = i * 10 + a % 10;\n\n      a = a / 10;\n    }\n    printf(\"%d\", i);\n  }\n  return (0);\n}\n"}
{"label": "16", "index": "29648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[7] = {'0', '0', '0', '0', '0', '0', '0'};\n  cin >> a;\n  int ava = 0;\n  for (int j = 6; j >= 0; j--) {\n    if (ava == 1) {\n      printf(\"%c\", a[j]);\n    }\n    if (a[j] != '0') {\n      ava = 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29649", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  cin >> n;\n  int k, count = 0;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n  return 0;\n}\n"}
{"label": "16", "index": "29650", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = x / 1000 - x / 10000 * 10;\n  c = x / 100 - x / 1000 * 10;\n  d = x / 10 - x / 100 * 10;\n  e = x - x / 10 * 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i = 0;\n  int num[5];\n  scanf(\"%d\", &n);\n  while (n / 10 != 0) {\n    num[i++] = n % 10;\n    n /= 10;\n  }\n  num[i] = n;\n  for (int m = 0; m <= i; m++)\n    printf(\"%d\", num[m]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  scanf(\"%d\", &n);\n  if (n % 10 == 0) {\n    if (n == 0)\n      printf(\"\");\n    else {\n      printf(\"0\");\n      for (n = n / 10; n % 10 == 0; n = n / 10) {\n        printf(\"0\");\n      }\n      for (; n >= 1; n = n / 10) {\n        i = n % 10;\n        s = s * 10 + i;\n      }\n    }\n  } else\n    for (; n >= 1; n = n / 10) {\n      i = n % 10;\n      s = s * 10 + i;\n    }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "29653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000];\n  cin >> str;\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    cout << str[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[10];\n  int n = 0;\n  while (cin >> ch[n]) {\n    n++;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  e = x / 10000;\n  d = (x - e * 10000) / 1000;\n  c = (x - e * 10000 - d * 1000) / 100;\n  b = (x - e * 10000 - d * 1000 - c * 100) / 10;\n  a = x - e * 10000 - d * 1000 - c * 100 - b * 10;\n  if (x < 10)\n    printf(\"%d\", a);\n  else if (x < 100)\n    printf(\"%02d\", 10 * a + b);\n  else if (x < 1000)\n    printf(\"%03d\", 100 * a + 10 * b + c);\n  else if (x < 10000)\n    printf(\"%04d\", 1000 * a + 100 * b + 10 * c + d);\n  else if (x == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"%d\", a);\n  for (i = 0; i < 5; i++) {\n    if (a != 0)\n      cout << a % 10;\n    a = a / 10;\n  }\n  printf(\" \");\n  return (0);\n}\n"}
{"label": "16", "index": "29657", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i;\n  for (i = 0; i <= 5; i++) {\n    scanf(\"%c\", &a[i]);\n    if ((int)(a[i]) == 10)\n      break;\n  }\n  for (; i >= 1; i--) {\n    printf(\"%c\", a[i - 1]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else {\n    if (n == 1000)\n      cout << \"0001\";\n    else if (n == 100)\n      printf(\"001\");\n    else if (n == 10)\n      cout << \"01\";\n    else {\n      if (n / 1000 > 0) {\n        a = n % 10;\n        b = ((n - a) / 10) % 10;\n        c = ((n - a - b * 10) / 100) % 10;\n        d = n / 1000;\n        s = a * 1000 + b * 100 + c * 10 + d;\n        printf(\"%d\", s);\n      } else {\n        if (n / 100 > 0) {\n          a = n % 10;\n          b = ((n - a) / 10) % 10;\n          c = n / 100;\n          s = a * 100 + b * 10 + c;\n          printf(\"%d\", s);\n        } else {\n          if (n / 10 > 0) {\n            a = n % 10;\n            b = n / 10;\n            s = a * 10 + b;\n            printf(\"%d\", s);\n          } else\n            printf(\"%d\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, m;\n  scanf(\"%d\", &n);\n  m = n;\n  a = n % 10;\n  n = n / 10;\n  b = n % 10;\n  n = n / 10;\n  c = n % 10;\n  n = n / 10;\n  d = n % 10;\n  if (m < 10)\n    printf(\"%d\", m);\n  else if (m < 100)\n    cout << a << b;\n  else if (m < 1000)\n    printf(\"%d%d%d\", a, b, c);\n  else if (m < 10000)\n    cout << a << b << c << d;\n  return 0;\n}\n"}
{"label": "16", "index": "29660", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else {\n    a[1] = n / 1000;\n    a[2] = (n - 1000 * a[1]) / 100;\n    a[3] = (n - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = (n - 1000 * a[1] - 100 * a[2] - 10 * a[3]);\n  }\n  if (a[1] != 0)\n    cout << a[4] << a[3] << a[2] << a[1] << endl;\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d\\n\", a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        cout << a[4] << a[3] << endl;\n      else\n        cout << a[4] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n % 10;\n  b = ((n % 100) - a) / 10;\n  c = ((n % 1000) - (10 * b + a)) / 100;\n  d = (n - 100 * c - 10 * b - a) / 1000;\n  if (d)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[10000];\n  int i = 0, t = 0;\n  scanf(\"%d \", &n);\n  num[0] = n % 10;\n\n  while (n / 10 != 0) {\n    t = t + 1;\n    num[t] = (n / 10) % 10;\n    n = n / 10;\n  }\n\n  for (i; i <= t; i++) {\n    cout << num[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29663", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, m, p, q, k, l, s;\n  cin >> n;\n  if (n == 10000) {\n    a = 1;\n    printf(\"%05d\", a);\n  } else if (n >= 1000) {\n    s = n % 1000;\n    m = (n - s) / 1000;\n    l = s % 100;\n    p = (s - l) / 100;\n    q = l % 10;\n    k = (l - q) / 10;\n    a = q * 1000 + k * 100 + p * 10 + m;\n    printf(\"%04d\", a);\n  } else if (n >= 100) {\n    s = n % 100;\n    m = (n - s) / 100;\n    l = s % 10;\n    p = (s - l) / 10;\n    a = l * 100 + p * 10 + m;\n    printf(\"%03d\", a);\n  } else if (n >= 10) {\n    s = n % 10;\n    m = (n - s) / 10;\n    a = s * 10 + m;\n    printf(\"%02d\", a);\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, result = 1;\n  cin >> x;\n\n  if (!x)\n    cout << \"0\";\n  while (x) {\n    printf(\"%d\", x % 10);\n    x = x / 10;\n  }\n  printf(\"\\n\", result);\n  return 0;\n}\n"}
{"label": "16", "index": "29665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, m;\n  scanf(\"%d\\n\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (n != 0 && n % 10 == 0)\n    cout << \"0\";\n  if (n != 0 && n % 100 == 0)\n    printf(\"0\");\n  if (a != 0)\n    m = e * 10000 + d * 1000 + c * 100 + b * 10 + a;\n  else if (b != 0)\n    m = e * 1000 + d * 100 + c * 10 + b;\n  else if (c != 0)\n    m = e * 100 + d * 10 + c;\n  else if (d != 0)\n    m = e * 10 + d;\n  else if (e != 0)\n    m = e;\n  else\n    m = 0;\n  cout << m << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29666", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10000];\n  int b, i, c;\n  cin >> a;\n  b = strlen(a);\n  i = 0;\n  if (b % 2 == 0) {\n    while (i <= (b / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  } else {\n    while (i <= ((b - 1) / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, flag;\n  flag = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n != 0) {\n      flag++;\n      a[flag] = n % 10;\n      n = n / 10;\n    }\n    for (int i = 1; i <= flag; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29668", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"0\");\n  else {\n    for (i = 0; i < 5; i++) {\n      if (n != 0) {\n        t = n % 10;\n        printf(\"%d\", t);\n        n = (n - t) / 10;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d; \n  cin >> num;\n  a = num / 1000;                        \n  b = (num - a * 1000) / 100;            \n  c = (num - a * 1000 - b * 100) / 10;   \n  d = num - a * 1000 - b * 100 - c * 10; \n  if (a != 0)\n    cout << d << c << b << a << endl; \n  else if (a == 0 && b != 0)\n    cout << d << c << b << endl; \n  else if (a == 0 && b == 0 && c != 0)\n    cout << d << c << endl; \n  else\n    cout << d << endl; \n  return 0;\n}\n"}
{"label": "16", "index": "29670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5], i, j, t, re = 0, k;\n  cin >> n;\n  if (n == 0)\n    cout << \"0\";\n  t = 1;\n  for (i = 0; i < 5; i++) {\n    t = (int)(pow(10, i + 1) + 0.5);\n    a[i] = 10 * (n % t) / t;\n    n = n - a[i] * t / 10;\n  }\n  i = 4;\n  while (a[i] == 0) {\n    i = i - 1;\n  }\n  for (j = 0; j <= i; j++)\n    cout << a[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - a % 10) / 10;\n  d = (a % 1000 - a % 100) / 100;\n  e = (a - a % 1000) / 1000;\n  if (e)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  else if (d)\n    printf(\"%d%d%d\", b, c, d);\n  else if (c) {\n    printf(\"%d%d\", b, c);\n  } else\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29672", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  if (x > 9999) {\n    e = x / 10000;\n    d = x % 10000 / 1000;\n    c = x % 10000 % 1000 / 100;\n    b = x % 10000 % 1000 % 100 / 10;\n    a = x % 10000 % 1000 % 100 % 10;\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n  } else if (x > 999) {\n    d = x / 1000;\n    c = x % 1000 / 100;\n    b = x % 1000 % 100 / 10;\n    a = x % 1000 % 100 % 10;\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  } else if (x > 99) {\n    c = x / 100;\n    b = x % 100 / 10;\n    a = x % 100 % 10;\n    printf(\"%d%d%d\\n\", a, b, c);\n  } else if (x > 9) {\n    b = x / 10;\n    a = x % 10;\n    printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", x);\n}\n"}
{"label": "16", "index": "29673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, m = 0, i = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    int a[5];\n    a[0] = n / 10000;\n    a[1] = (n - 10000 * a[0]) / 1000;\n    a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n    a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = n - 10000 * a[0] - 1000 * a[1] - 100 * a[2] - 10 * a[3];\n    for (i = 0; i <= 4; i++) {\n      if (a[i] != 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 4; i >= m; i--)\n      printf(\"%d\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n <= 9 && 0 <= n)\n    cout << n;\n  if (n <= 99 && 10 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    cout << b;\n  }\n  if (n <= 999 && 100 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    cout << c;\n  }\n  if (n <= 9999 && 1000 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    n = n / 10;\n    cout << c;\n    d = n % 10;\n    cout << d;\n  }\n  if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 1, m;\n  int a[6] = {0, 0, 0, 0, 0, 0};\n  cin >> n; \n  if (n >= 10) {\n    do {\n      a[i] = n % 10;\n      n = n / 10;\n      i = i + 1;\n    } while (n >= 10); \n    m = i - 1;\n    for (i = 1; i <= m; i++)\n      cout << a[i];\n    cout << n;\n  } else\n    cout << n; \n  return 0;\n}\n"}
{"label": "16", "index": "29676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, y;\n  scanf(\"%d\", &x);\n  if (x >= 1000) {\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    y = d * 1000 + c * 100 + b * 10 + a;\n    printf(\"%04d\", y);\n  }\n  if (x >= 100 && x < 1000) {\n    a = x / 100;\n    b = (x - 100 * a) / 10;\n    c = x - 100 * a - 10 * b;\n    y = c * 100 + b * 10 + a;\n    printf(\"%03d\", y);\n  }\n  if (x >= 10 && x < 100) {\n    a = x / 10;\n    b = x - a * 10;\n    y = b * 10 + a;\n    printf(\"%02d\", y);\n  }\n  if (x < 10)\n    cout << x;\n  return 0;\n}\n"}
{"label": "16", "index": "29677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, m;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    while (n != 0) {\n      m = n % 10;\n      printf(\"%d\", m);\n      n = n / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29678", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, g, h, i;\n  long f;\n  scanf(\"%ld\", &f);\n  a = f / 10000;\n  g = f % 10000;\n  b = g / 1000;\n  h = g % 1000;\n  c = h / 100;\n  i = h % 100;\n  d = i / 10;\n  e = i % 10;\n  if (a > 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "29679", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, len = 0, temp[6];\n  cin >> n;\n  if (n == 0) {\n    cout << n;\n  }\n  while (n > 0) {\n    temp[len++] = n % 10;\n    n = n / 10;\n  }\n  for (int i = 0; i < len; i++)\n    cout << temp[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0;\n  scanf(\"%d\", &a);\n  int b[6] = {0, 0, 0, 0, 0, 0};\n  int c[5] = {-1, -1, -1, -1, -1};\n  b[0] = a;\n  int i;\n  for (i = 1; i < 5; i++) {\n    b[i] = b[i - 1] / 10;\n  }\n  for (i = 0; i < 5; i++) {\n    if (b[i] != 0) {\n      c[i] = b[i] - 10 * b[i + 1];\n      if (c[i] >= 0)\n        printf(\"%d\", c[i]);\n    }\n  }\n  if (a == 0)\n    cout << \"0\";\n  return 0;\n}\n"}
{"label": "16", "index": "29681", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n == 10000) {\n    n = 00001;\n  } else {\n    if (n >= 1000) {\n      a = n % 10;\n      b = (n - a) % 100 / 10;\n      d = n / 1000;\n      c = n / 100 - d * 10;\n      printf(\"%d\", a);\n      printf(\"%d\", b);\n      printf(\"%d\", c);\n      printf(\"%d\", d);\n    } else {\n      if (n >= 100) {\n        a = n % 10;\n        b = (n - a) % 100 / 10;\n        c = n / 100;\n        printf(\"%d\", a);\n        printf(\"%d\", b);\n        printf(\"%d\", c);\n      } else {\n        if (n >= 10) {\n          a = n % 10;\n          b = n / 10;\n          printf(\"%d\", a);\n          printf(\"%d\", b);\n        } else {\n          printf(\"%d\", n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, y;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    y = 5;\n  else if (n > 999)\n    y = 4;\n  else if (n > 99)\n    y = 3;\n  else if (n > 9)\n    y = 2;\n  else\n    y = 1;\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = (n - a * 1000 - b * 100 - c * 10);\n  switch (y) {\n  case 5:\n    printf(\"10000\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", d, c, b, a);\n    break;\n  case 3:\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\", d, c);\n    break;\n  case 1:\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (1000 <= a && a <= 10000)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (100 <= a && a < 1000)\n    printf(\"%d%d%d\", e, d, c);\n  else if (10 <= a && a < 100)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &a);\n  b = a % 1000;\n  c = (a - b) / 1000;\n  d = b % 100;\n  e = (b - d) / 100;\n  f = d % 10;\n  g = (d - f) / 10;\n  if (c == 0) {\n    if (e == 0) {\n      if (g == 0) {\n        if (f == 0)\n          printf(\"0\");\n        else {\n          printf(\"%d\", f);\n        }\n      } else {\n        printf(\"%d%d\", f, g);\n      }\n    } else {\n      printf(\"%d%d%d\", f, g, e);\n    }\n  } else {\n    printf(\"%d%d%d%d\", f, g, e, c);\n  }\n}\n"}
{"label": "16", "index": "29685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = n / 100 - a * 10;\n  c = n / 10 - a * 100 - b * 10;\n  d = n % 10;\n  cout << d;\n  if (a != 0 || b != 0 || c != 0)\n    cout << c;\n  if (a != 0 || b != 0)\n    printf(\"%d\", b);\n  if (a != 0)\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10) / 1;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10) / 1;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10) / 1;\n    cout << c << b;\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, x, y, z, n, b, place;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    place = 5;\n  if (a > 999)\n    place = 4;\n  else if (a > 999)\n    place = 4;\n  else if (a > 99)\n    place = 3;\n  else if (a > 9)\n    place = 2;\n  else\n    place = 1;\n  n = a / 1000;\n  x = a / 100 % 10;\n  y = a / 10 % 10;\n  z = a % 10;\n  switch (place) {\n  case 5:\n    printf(\"00001\");\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", z, y, x, n);\n    break;\n\n  case 3:\n    printf(\"%d%d%d\", z, y, x);\n    break;\n\n  case 2:\n    printf(\"%d%d\", z, y);\n    break;\n  case 1:\n    printf(\"%d\", z);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i;\n  cin >> a;\n  b = a % 10;\n  printf(\"%d\", b);\n  a = a / 10;\n  if (a != 0) {\n    b = a % 10;\n    printf(\"%d\", b);\n    a = a / 10;\n    if (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n      if (a != 0) {\n        b = a % 10;\n        cout << b;\n        a = a / 10;\n        if (a != 0) {\n          b = a % 10;\n          printf(\"%d\", b);\n          a = a / 10;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29689", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4], b;\n  char cc;\n  scanf(\"%d \", &b);\n  a[0] = b % 10;\n  b = b / 10;\n  a[1] = b % 10;\n  b = b / 10;\n  a[2] = b % 10;\n  b = b / 10;\n  a[3] = b % 10;\n  b = b / 10;\n  if (a[3] != 0)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (a[2] != 0)\n    cout << a[0] << a[1] << a[2];\n  else if (a[1] != 0)\n    cout << a[0] << a[1];\n  else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z, a, b, c, d, e;\n  cin >> z;\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      cout << e << d << c << b;\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29691", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i;\n  cin >> n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    c = n % 10, e = n / 100;\n    d = (n / 10) % 10;\n    printf(\"%d%d%d\", c, d, e);\n  } else if (n < 10000) {\n    f = n % 10;\n    g = (n % 100) / 10;\n    h = (n / 100) % 10;\n    i = n / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x == 10000)\n    printf(\"00001\");\n  else if (x < 10000 && x >= 1000) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = ((x - a - 10 * b) / 100) % 10;\n    d = (x - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (x < 1000 && x >= 100) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = (x - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x < 100 && x >= 10) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else {\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29693", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5], i = 0, j;\n  cin >> n;\n  if (n >= 10) {\n    while (n >= 10) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      i++;\n    }\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%d\", a[j]);\n  } else\n    ;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29694", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[10];\n  cin >> a;\n  int i, l;\n  l = strlen(a);\n  for (i = 0; i < l; i++)\n    b[l - i - 1] = a[i];\n\n  b[l] = '\u0000';\n  puts(b);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits] = iNum % radix;\n    cout << ch[iBits];\n    iNum /= radix;\n    iBits++;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  cin >> iNum;\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else\n    iBits = MyInverseitoa(iNum, ch, 10);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29696", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  long a, original;\n  cin >> a;\n  original = a;\n  int dig1, dig2, dig3, dig4, dig5;\n  int NumofDig;\n  dig1 = a / 10000;\n  a = a - 10000 * dig1;\n  dig2 = a / 1000;\n  a = a - 1000 * dig2;\n  dig3 = a / 100;\n  a = a - 100 * dig3;\n  dig4 = a / 10;\n  a = a - 10 * dig4;\n  dig5 = a;\n  if (dig1)\n    NumofDig = 5;\n  else {\n    if (dig2) {\n      NumofDig = 4;\n    } else {\n      if (dig3)\n        NumofDig = 3;\n      else {\n        if (dig4)\n          NumofDig = 2;\n        else\n          NumofDig = 1;\n      }\n    }\n  }\n  long Oppo;\n  Oppo = dig5 * 10000 + dig4 * 1000 + dig3 * 100 + dig2 * 10 + dig1;\n  switch (NumofDig) {\n  case 5:\n    printf(\"00001\\n\");\n    break;\n  case 4:\n    cout << dig5 << dig4 << dig3 << dig2 << endl;\n    break;\n  case 3:\n    cout << dig5 << dig4 << dig3 << endl;\n    break;\n  case 2:\n    cout << dig5 << dig4 << endl;\n    break;\n  case 1:\n    cout << dig5 << endl;\n    break;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "16", "index": "29697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = n / 10;\n  if (n == 0) {\n    cout << a;\n  } else {\n    b = n % 10;\n    n = n / 10;\n    if (n == 0) {\n      printf(\"%d%d\", a, b);\n    } else {\n      c = n % 10;\n      n = n / 10;\n      d = n;\n      if (n == 0) {\n        cout << a << b << c;\n      } else {\n        printf(\"%d%d%d%d\", a, b, c, d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29698", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\", 0, 0, 0, 0, 1);\n  else if (a > 999)\n    printf(\"%d%d%d%d\", a % 1000 % 100 % 10, a % 1000 % 100 / 10, a % 1000 / 100,\n           a / 1000);\n  else if (a > 99)\n    printf(\"%d%d%d\", a % 100 % 10, a % 100 / 10, a / 100);\n  else if (a > 9)\n    cout << a % 10 << a / 10;\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5], i, m;\n  scanf(\"%d \", &n);\n  a[0] = n % 10;\n  a[1] = (n / 10) % 10;\n  a[2] = (n / 100) % 10;\n  a[3] = (n / 1000) % 10;\n  a[4] = (n / 10000) % 10;\n\n  if (n == 0) {\n    printf(\"%d\", 0);\n  } else {\n    i = 4;\n    while (a[i] == 0) {\n      m = i;\n      i--;\n    }\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = ((n % 100) - a) / 10;\n  c = ((n % 1000) - (10 * b + a)) / 100;\n  d = (n - 100 * c - 10 * b - a) / 1000;\n  if (d)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j;\n  scanf(\"%d\", &a);\n  if (a <= 9)\n    cout << a << \"\\n\";\n  else {\n    if (a <= 99) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a <= 999) {\n        d = a / 100;\n        e = (a - d * 100) / 10;\n        f = a - 100 * d - 10 * e;\n        printf(\"%d%d%d\", f, e, d);\n      } else if (a <= 9999) {\n        g = a / 1000;\n        h = (a - 1000 * g) / 100;\n        i = (a - 1000 * g - 100 * h) / 10;\n        j = a - 1000 * g - 100 * h - 10 * i;\n        cout << j << i << h << g;\n      } else if (a = 10000)\n        printf(\"00001\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 1000 != 0) {\n    a = n / 1000;\n    n = n - 1000 * a;\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d\", d, c, b);\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d\", d, c);\n  } else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "16", "index": "29703", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char shu[6], temp;\n  int i, Lshu;\n  cin.getline(shu, 6, '\\n');\n  Lshu = strlen(shu);\n  for (i = 0; i < Lshu / 2; i++) {\n    temp = shu[i];\n    shu[i] = shu[Lshu - 1 - i];\n    shu[Lshu - 1 - i] = temp;\n  }\n  cout << shu;\n  return 0;\n}\n"}
{"label": "16", "index": "29704", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  while (i) {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A, B, a[5], i = 0, j = 0;\n  cin >> A;\n  do {\n    B = A / 10;\n    a[i] = A - B * 10;\n    A = B;\n    i++;\n    j++;\n  } while (A != 0);\n  for (i = 0; i < j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29706", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a != 0) {\n      b = a - a / 10 * 10;\n      a = a / 10;\n      printf(\"%d\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29707", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, f, a, m;\n\n  scanf(\"%d \", &n);\n  for (i = 5; i >= 1; i--) {\n    f = pow(10, i);\n    a = n / f;\n    if (a != 0)\n      break;\n  }\n  for (j = 1; j <= i + 1; j++) {\n    m = n % 10;\n\n    printf(\"%d\", m);\n    n = (n - m) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, c, j, k, t;\n  scanf(\"%d\", &n);\n  i = n;\n  c = 0;\n  j = 0;\n  while (i > 0) {\n    j++;\n    m = i % 10;\n    i /= 10;\n    c = m + c * 10;\n  }\n  i = c;\n  k = 0;\n  while (i > 0) {\n    k++;\n    i = i / 10;\n  }\n  for (t = 1; t <= (j - k); t++)\n    printf(\"0\");\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "16", "index": "29709", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint power(int x) {\n  int k, y = 1;\n  for (k = 1; k <= x; k++)\n    y = y * 10;\n  return y;\n}\n\nint main() {\n  int n, i, j, a[6], temp;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= 5; i++) {\n    if (n % power(i) == n) {\n      j = i;\n      break;\n    }\n  }\n  i = 0;\n  for (i = 0; i < j; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, n = 0, i = 0, j = n - 1;\n  scanf(\"%d \", &a);\n  if (a == 0)\n    printf(\"0\");\n  else if (a != 0) {\n    while (a >= pow(10, n))\n      n = n + 1;\n    int c[10] = {0};\n    for (i = 0; i <= n - 1; i++)\n      c[i] = a % (int)(pow(10, i + 1));\n    for (i = 0; i <= n - 1; i++)\n      c[i] = c[i] / pow(10, i);\n    for (i = 0; i <= n - 1; i++)\n      printf(\"%d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\", 0, 0, 0, 0, 1);\n  else if (a > 999)\n    printf(\"%d%d%d%d\", a % 1000 % 100 % 10, a % 1000 % 100 / 10, a % 1000 / 100,\n           a / 1000);\n  else if (a > 99)\n    printf(\"%d%d%d\", a % 100 % 10, a % 100 / 10, a / 100);\n  else if (a > 9)\n    printf(\"%d%d\", a % 10, a / 10);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29712", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ace, a, b, c, d;\n  cin >> ace;\n  a = (int)(ace / 1000);\n  b = (int)((ace - 1000 * a) / 100);\n  c = (int)((ace - 1000 * a - 100 * b) / 10);\n  d = (ace - 1000 * a - 100 * b - 10 * c);\n\n  if (ace >= 1000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (ace >= 100)\n    printf(\"%d%d%d\", d, c, b);\n  else if (ace >= 10)\n    printf(\"%d%d\", d, c);\n  else\n    printf(\"%d\", d);\n}\n"}
{"label": "16", "index": "29713", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f;\n  cin >> a;\n  f = a % 10;\n  a = (int)(a / 10);\n  e = a % 10;\n  a = (int)(a / 10);\n  d = a % 10;\n  a = (int)(a / 10);\n  c = a % 10;\n  a = (int)(a / 10);\n  b = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\\n\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\\n\", f, e);\n  else\n    printf(\"%d\\n\", f, f);\n  return 0;\n}\n"}
{"label": "16", "index": "29714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main()\n\n{\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 1000);\n  b = (int)(n / 100 - a * 10);\n  c = (int)(n / 10 - a * 100 - b * 10);\n  d = (int)(n - a * 1000 - b * 100 - c * 10);\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i, j;\n  cin >> n;\n  a = n % 10;\n  e = n - a;\n  f = e / 10;\n  b = f % 10;\n  g = n - 10 * b - a;\n  h = g / 100;\n  c = h % 10;\n  i = n - 100 * c - 10 * b - a;\n  j = i / 1000;\n  d = j % 10;\n  if (d == 0) {\n    if (c == 0) {\n      if (b == 0)\n        printf(\"%d\", a);\n      else\n        printf(\"%d%d\", a, b);\n    } else\n      printf(\"%d%d%d\", a, b, c);\n  } else\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "29716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d \", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = (a % 1000) / 100;\n  e = (a % 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%05d\", b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    cout << f << e << d;\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "16", "index": "29717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], i, j;\n  for (i = 0; i < 5; i++) {\n    a[i] = getchar();\n    if (a[i] < 48 || a[i] > 57) {\n      j = i;\n      break;\n    }\n  }\n  for (i = j; i >= 0; i--) {\n    putchar(a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (n < 10)\n    printf(\"%d\", d);\n  else if (n < 100)\n    printf(\"%d%d\", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d\", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29719", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i = 0, a[6];\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  else\n    while (n > 0) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      cout << a[i];\n      i++;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "29720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum = 0, i, t;\n  char str[5] = {0}, str2[5] = {0};\n  scanf(\"%s\", str);\n  for (i = 0; str[i] != '\\0'; i++)\n    sum = sum + 1;\n  for (i = sum - 1; i >= 0; i--) {\n    t = sum - i - 1;\n    str2[t] = str[i];\n  }\n  printf(\"%s\", str2);\n}\n"}
{"label": "16", "index": "29721", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint invert(long m) {\n  printf(\"%ld\", m % 10);\n  m = m / 10;\n  if (m > 0)\n    invert(m);\n}\nint main() {\n  long n;\n\n  cin >> n;\n  invert(n);\n  printf(\" \");\n}\n"}
{"label": "16", "index": "29722", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\\n\");\n  else {\n    for (int i = 4; i >= 0; i--) {\n      if (floor(n / pow(10.0, i)) != 0) {\n        if (i >= m) {\n          m = i;\n        }\n      }\n    }\n    int p[m + 2], q[m + 1];\n    for (int j = 0; j < m + 2; j++)\n      p[j] = n % (int)pow(10.0, j);\n\n    for (int k = 0; k < m + 1; k++) {\n      q[k] = (p[m + 1 - k] - p[m - k]) / (int)pow(10.0, m - k);\n    }\n    for (int t = 0; t < m + 1; t++) {\n      cout << q[m - t];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29723", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[5], b[5];\n  int n, i, m;\n  cin >> n;\n  b[0] = n;\n  for (i = 0; i < 5; i = i + 1) {\n    a[i] = b[i] % 10;\n    b[i + 1] = b[i] / 10;\n    printf(\"%d\", a[i]);\n    if (b[i + 1] == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j;\n  int a[5];\n  scanf(\"%d\", &n);\n  for (; n > 0;) \n  {\n    a[i] = n % 10;\n    i++;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29725", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  int x, y;\n  x = a % 10;\n  y = a / 10;\n  cout << x;\n  while (y > 0) {\n    x = y % 10;\n    y = y / 10;\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n\n  if (a >= 0 && a < 10)\n    printf(\"%d\\n\", a);\n  else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    d = b * 10 + c;\n    printf(\"%02d\\n\", d);\n  } else if (a >= 100 && a < 1000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) / 100;\n    e = b * 100 + c + d;\n    printf(\"%03d\\n\", e);\n  } else if (a >= 1000 && a < 10000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) % 1000;\n    e = (a - b - c - d) / 1000;\n    f = b * 1000 + c * 10 + d / 10 + e;\n    printf(\"%04d\\n\", f);\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5];\n  int i, j;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%c\", &a[i]);\n    if (a[i] == '\\n') {\n      for (j = i; j < 5; j++) {\n        a[j] = '\\0';\n      }\n      break;\n    }\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "29728", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char num[5];\n  scanf(\"%s \", num);\n  int nl = strlen(num);\n\n  int i;\n  for (i = 0; i < (int)(nl / 2); i++) {\n    char k;\n    k = num[i];\n    num[i] = num[nl - 1 - i];\n    num[nl - 1 - i] = k;\n  }\n\n  cout << num;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  cin >> a;\n  b = a / 1000;\n  c = a % 1000;\n  d = c / 100;\n  e = a % 100;\n  f = e / 10;\n  g = a % 10;\n\n  if (b == 0) {\n    if (d == 0) {\n      if (f == 0) {\n        printf(\"%d\", g);\n      } else {\n        printf(\"%d%d\", g, f);\n      }\n    } else {\n      printf(\"%d%d%d\", g, f, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", g, f, d, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29730", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int d, e, f, g, h, j, k, l, m, i, n;\n  char p[10];\n  scanf(\"%s \", p);\n  for (i = strlen(p) - 1; i >= 0; i--)\n    printf(\"%c\", p[i]);\n  return 7;\n}\n"}
{"label": "16", "index": "29731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, k, a, b, c, d;\n  cin >> x;\n  if (x > 999)\n    k = 4;\n  else if (x > 99)\n    k = 3;\n  else if (x > 9)\n    k = 2;\n  else\n    k = 1;\n  switch (k) {\n  case 1:\n    d = x;\n    printf(\"%d\\n\", d);\n    break;\n  case 2:\n    c = x / 10;\n    d = x - 10 * c;\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 3:\n    b = x / 100;\n    c = (x - 100 * b) / 10;\n    d = x - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 4:\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - 100 * b) / 10;\n  d = n % 10;\n  if (n < 10)\n    printf(\"%d \", n);\n  else if (n < 100)\n    printf(\"%d%d \", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d \", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d \", d, c, b, a);\n}\n"}
{"label": "16", "index": "29733", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[6];\n  for (i = 0; i < 6; i++) {\n    scanf(\"%c \", &a[i]);\n    if (a[i] == '\\n')\n      break;\n  }\n  for (j = i - 1; j > -1; j--)\n    printf(\"%c\", a[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "29734", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if ((a >= 1000) && (a < 9999)) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  if ((a >= 100) && (a < 999)) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if\n\n      ((a >= 10) && (a < 99)) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  }\n  if ((a >= 1) && (a < 9))\n    printf(\"%d\", a);\n  if (a == 0)\n    printf(\"0\");\n  if (a == 10000) {\n    printf(\"00001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z;\n  int a, b, c, d, e;\n  scanf(\"%d\", &z);\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      cout << e << d << c << b;\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  cin >> z;\n  return 0;\n}\n"}
{"label": "16", "index": "29736", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[10000];\n  cin >> str;\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  if (d != 0)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c != 0)\n    cout << a << b << c;\n  else if (b != 0)\n    printf(\"%d%d\", a, b);\n  else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29738", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e, y;\n  cin >> n;\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  } else if (b != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  } else if (c != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  } else if (d != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n  } else {\n    printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (x > 9999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x > 999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x > 99)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x > 9)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29740", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, s, p;\n  cin >> a;\n  s = a;\n  while (s != 0) {\n    p = s % 10;\n    printf(\"%d\", p);\n    s = (s - p) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int ace, a, b, c, d;\n  cin >> ace;\n  a = (int)(ace / 1000);\n  b = (int)((ace - 1000 * a) / 100);\n  c = (int)((ace - 1000 * a - 100 * b) / 10);\n  d = (ace - 1000 * a - 100 * b - 10 * c);\n\n  if (ace >= 1000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (ace >= 100)\n    printf(\"%d%d%d\", d, c, b);\n  else if (ace >= 10)\n    printf(\"%d%d\", d, c);\n  else\n    printf(\"%d\", d);\n}\n"}
{"label": "16", "index": "29742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char num[6];\n  int i, n, nnum[6], p = 0;\n  scanf(\"%s\", num);\n  n = strlen(num);\n\n  for (i = n - 1; i >= 0; i--) {\n    nnum[i] = num[i] - 48;\n    printf(\"%d\", nnum[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  scanf(\"%d \", &a);\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a < 10)\n    cout << a5 << endl;\n  else if (a < 100)\n    cout << a5 << a4 << endl;\n  else if (a < 1000)\n    cout << a5 << a4 << a3 << \"\\n\";\n  else if (a < 10000)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29744", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, k, sum = 1, A[5];\n  cin >> n;\n  k = n;\n  while (k >= 10) {\n    k = k / 10;\n    sum = sum + 1;\n  }\n  for (i = 0; i < sum; i++) {\n    A[i] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < sum; i++)\n    printf(\"%d\", A[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    d = a % 10;\n    a = (a - d) / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (a >= 100) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (a >= 10) {\n    b = a % 10;\n    a = (a - b) / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if ((a >= 1000) && (a < 9999)) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  if ((a >= 100) && (a < 999)) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  }\n  if\n\n      ((a >= 10) && (a < 99)) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  }\n  if ((a >= 1) && (a < 9))\n    printf(\"%d\", a);\n  if (a == 0)\n    printf(\"0\");\n  if (a == 10000) {\n    printf(\"00001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  char s[20];\n  printf(\"\\n\");\n  scanf(\"%d\", &i);\n  sprintf(s, \"%d\", i);\n  for (i = strlen(s) - 1; i >= 0; i--) {\n    printf(\"%c\", s[i]);\n  }\n  puts(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29748", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  scanf(\"%d \", &n);\n  if (n / 10 == 0) {\n    a[0] = n;\n    cout << a[0] << endl;\n  } else if (n / 100 == 0) {\n    a[0] = n / 10;\n    a[1] = n % 10;\n    cout << a[1] << a[0] << endl;\n  } else if (n / 1000 == 0) {\n    a[0] = n / 100;\n    a[1] = n % 100 / 10;\n    a[2] = n % 100 % 10;\n    cout << a[2] << a[1] << a[0] << endl;\n  } else if (n / 10000 == 0) {\n    a[0] = n / 1000;\n    a[1] = n % 1000 / 100;\n    a[2] = n % 1000 % 100 / 10;\n    a[3] = n % 1000 % 100 % 10;\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n  } else if (n = 10000)\n    cout << \"1\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29749", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int a = 0, b = 0, c = 0, i = 1;\n  scanf(\"%d \", &a);\n\n  do {\n    c = a % 10;\n    a = (a - c) / 10;\n    cout << c;\n  } while (a != 0);\n\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29750", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0;\n  int n_1 = 0, i = 0;\n  int len = 0;\n  int a[6] = {0};\n  scanf(\"%d\", &n);\n  n_1 = n;\n  for (; n / 10 > 0;) {\n    n = n / 10;\n    len++;\n  }\n  len++;\n  for (i = 0; i < len; i++) {\n    a[i] = n_1 % 10;\n    n_1 = n_1 / 10;\n  }\n  for (i = 0; i < len; i++)\n    cout << a[i];\n}\n"}
{"label": "16", "index": "29751", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  int b;\n  if (a == 0)\n    printf(\"0\\n\");\n  else {\n    while (a != 0) {\n      b = a % 10;\n      a = a / 10;\n      printf(\"%d\", b);\n    }\n    printf(\"\\n\");\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a % 10;\n  c = (a % 100 - a % 10) / 10;\n  d = (a % 1000 - a % 100) / 100;\n  e = (a - a % 1000) / 1000;\n  if (e)\n    cout << b << c << d << e;\n  else if (d)\n    printf(\"%d%d%d\", b, c, d);\n  else if (c)\n    cout << b << c;\n  else\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i;                \n  char a[6];               \n  for (i = 1; i <= 5; i++) \n  {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n  }\n  i = i - 1;               \n  for (k = i; k >= 1; k--) \n    printf(\"%c\", a[k]);\n  return 0;\n}\n"}
{"label": "16", "index": "29754", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l;\n  char s[4], r[4];\n  scanf(\"%s\", s);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    r[i] = s[l - 1 - i];\n  }\n  for (i = 0; i < l; i++)\n    printf(\"%c\", r[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char a[100];\n  while ((a[i] = cin.get()) != '\\n') {\n    i++;\n  }\n  for (j = i - 1; j >= 0; j -= 1) {\n    printf(\"%c\", a[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = (n - a) % 100 / 10;\n  c = (n - (n % 100)) % 1000 / 100;\n  d = (n - (n % 1000)) % 10000 / 1000;\n  e = 1;\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else {\n    if (n < 100) {\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n < 1000) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n < 10000) {\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else {\n          printf(\"abcde\");\n        }\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10000];\n  int b, i, c;\n  cin >> a;\n  b = strlen(a);\n  i = 0;\n  if (b % 2 == 0) {\n    while (i <= (b / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  } else {\n    while (i <= ((b - 1) / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29758", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  for (int i = 1; n != 0; i++) {\n    cout << n % 10;\n    n /= 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int b = 0, n, c, i, a[5];\n  scanf(\"%d \", &n);\n  if (n == 0) {\n    cout << '0' << endl;\n  } else {\n    for (i = 0; n > 0; i++) {\n      c = n % 10;\n      a[i] = c;\n      n = n / 10;\n      b += 1;\n    }\n    for (i = 0; i < b; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a[5], i, c, n, j;\n  scanf(\"%d \", &num);\n  n = 0;\n  for (i = 4; i >= 0; i--) {\n    for (j = 1; j <= i; j++)\n      c *= 10;\n    a[i] = ((num - num % c) / c) % 10;\n    c = 1;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      n = i;\n      break;\n    }\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  else\n    while (n > 0) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int weishu[5] = {-1, -1, -1, -1, -1}, num, i = 0;\n  cin >> num;\n  do {\n    weishu[i] = num % 10;\n    num = num / 10;\n    i++;\n  } while (num > 0);\n  for (i = 0; i < 5; i++)\n    if (weishu[i] != -1)\n      cout << weishu[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char str[100];\n  scanf(\"%s\", &str);\n  for (i = strlen(str) - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29764", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a % 10 == a)\n    printf(\"%d\", a);\n  if (a % 10 != a && a % 100 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    printf(\"%d%d\", b, c);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    printf(\"%d%d%d\", b, c, d);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 != a && a % 10000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  if (a == 10000)\n    printf(\"%d\", 00001);\n  return 0;\n}\n"}
{"label": "16", "index": "29765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[5];\n  int i, k, j;\n  cin.getline(n, 5);\n  for (i = 0; n[i] != '\\0'; i++) {\n    k = i;\n  }\n  for (j = k; j >= 0; j--)\n    printf(\"%c\", n[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "29766", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = n / 1000 - 10 * a[0];\n  a[2] = n / 100 - 100 * a[0] - 10 * a[1];\n  a[4] = n % 10;\n  a[3] = (n % 100 - n % 10) / 10;\n  printf(\"\\n\");\n  if (n != 0) {\n    for (int i = 0; i < 5; i++)\n      if (a[i] == 0)\n        continue;\n      else {\n        for (int j = 4; j >= i; j--)\n          printf(\"%d\", a[j]);\n        break;\n      }\n  } else\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "29767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  if (num == 10000)\n    printf(\"00001\\n\");\n  else if (num > 999)\n    cout << num % 10 << num % 100 / 10 << num / 100 % 10 << num / 1000 % 10\n         << \"\\n\";\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10);\n  else if (num > 9)\n    printf(\"%d%d\\n\", num % 10, num % 100 / 10);\n  else\n    printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "16", "index": "29768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f;\n  cin >> a;\n  f = a % 10;\n  a = (int)(a / 10);\n  e = a % 10;\n  a = (int)(a / 10);\n  d = a % 10;\n  a = (int)(a / 10);\n  c = a % 10;\n  a = (int)(a / 10);\n  b = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\\n\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\\n\", f, e);\n  else\n    printf(\"%d\\n\", f, f);\n}\n"}
{"label": "16", "index": "29769", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    puts(\"00001\");\n  } else if (n >= 1000) {\n    a = n / 1000, b = n / 100 - a * 10, c = n / 10 - a * 100 - b * 10,\n    d = n - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n >= 100) {\n    a = n / 100, b = n / 10 - a * 10, c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n >= 10) {\n    a = n / 10, b = n - 10 * a;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29770", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n >= 10 && n < 100) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    cout << a[1] << a[2] << endl;\n  } else if (n >= 100 && n < 1000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    printf(\"%d%d%d\\n\", a[1], a[2], a[3]);\n  }\n\n  else if (n >= 1000 && n < 10000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    a[4] = (n / 1000) % 10;\n    cout << a[1] << a[2] << a[3] << a[4] << endl;\n  }\n\n  else if (n = 10000)\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29771", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, a[10], m, i;\n  cin >> t;\n  for (i = 0; i <= 4; i++) {\n    a[i] = t % 10;\n    t = t / 10;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      m = i;\n      break;\n    }\n  }\n  for (i = 0; i <= m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29772", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, ge, shi, bai, qian, wan, place = 1, j = 2;\n  cin >> n;\n  for (i = 9; i <= 10000; i = i * 10 + 9) {\n    if (n > i)\n      place = j;\n    j = j + 1;\n  }\n  wan = n / 10000;\n  qian = (n - wan * 10000) / 1000;\n  bai = (n - wan * 10000 - qian * 1000) / 100;\n  shi = (n - wan * 10000 - qian * 1000 - bai * 100) / 10;\n  ge = n - wan * 10000 - qian * 1000 - bai * 100 - shi * 10;\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", n);\n    break;\n  default:\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    cout << a[i];\n    if (n == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29774", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    b = a;\n    c = 0;\n    d = 0;\n    e = 0;\n    printf(\"%d\", b);\n  } else {\n    if (a < 100) {\n      b = a / 10;\n      c = a % 10;\n      d = 0;\n      e = 0;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a < 1000) {\n        b = a / 100;\n        c = (a % 100) / 10;\n        d = a % 10;\n        e = 0;\n        printf(\"%d%d%d\", d, c, b);\n      } else {\n        if (a < 10000) {\n          b = a / 1000;\n          c = (a % 1000) / 100;\n          d = (a % 100) / 10;\n          e = a % 10;\n          printf(\"%d%d%d%d\", e, d, c, b);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  cin >> n;\n  a = n % 10;\n  if (n < 10)\n    printf(\"%d\", a);\n  else if (n > 9 && n < 100) {\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n > 99 && n < 1000) {\n    b = n / 10 % 10;\n    c = n / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (n > 999 && n < 10000) {\n    b = n / 10 % 10;\n    c = n / 100 % 10;\n    d = n / 1000;\n    cout << a << b << c << d;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5]; \n  cin >> n;\n  a[0] = n % 10, a[1] = (n / 10) % 10, a[2] = (n / 100) % 10,\n  a[3] = (n / 1000) % 10, a[4] = (n / 10000) % 10;\n  \n  if (n < 10) {\n    cout << a[0];\n  } else if (n < 100 && n >= 10) {\n    cout << a[0] << a[1];\n  } else if (n < 1000 && n >= 100) {\n    cout << a[0] << a[1] << a[2];\n  } else if (n < 10000 && n >= 1000) {\n    cout << a[0] << a[1] << a[2] << a[3];\n  } else {\n    cout << a[0] << a[1] << a[2] << a[3] << a[4];\n  }\n}\n"}
{"label": "16", "index": "29777", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  int r1, r2, r3, r4;\n  if (a > 9999)\n    b = 5;\n  else if (a > 999)\n    b = 4;\n  else if (a > 99)\n    b = 3;\n  else if (a > 9)\n    b = 2;\n  else\n    b = 1;\n  switch (b) {\n  case 1:\n    printf(\"%d\", a);\n    break;\n  case 5:\n    printf(\"00001\");\n    break;\n  case 2:\n    r3 = a / 10;\n    r4 = a - r3 * 10;\n    printf(\"%d%d\", r4, r3);\n    break;\n  case 3:\n    r2 = a / 100;\n    r3 = (a - r2 * 100) / 10;\n    r4 = a - r2 * 100 - r3 * 10;\n    cout << r4 << r3 << r2;\n    break;\n  case 4:\n    r1 = a / 1000;\n    r2 = (a - r1 * 1000) / 100;\n    r3 = (a - r1 * 1000 - r2 * 100) / 10;\n    r4 = (a - r1 * 1000 - r2 * 100 - r3 * 10);\n    cout << r4 << r3 << r2 << r1;\n    break;\n  }\n}\n"}
{"label": "16", "index": "29778", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid fun() {\n  char c;\n  if ((c = getchar()) != ' ')\n    fun();\n  putchar(c);\n}\n\nint main() {\n  fun();\n  getchar();\n}\n"}
{"label": "16", "index": "29779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum, len, i;\n  int a[10];\n  scanf(\"%d\", &sum);\n  if (sum >= 10000)\n    len = 5;\n  else if (sum >= 1000)\n    len = 4;\n  else if (sum >= 100)\n    len = 3;\n  else if (sum >= 10)\n    len = 2;\n  else\n    len = 1;\n  for (i = 1; i <= len; i++) {\n    a[i] = sum / (pow(10, (len - i)));\n    sum = sum - a[i] * pow(10, (len - i));\n  }\n  for (i = 1; i <= len; i++)\n    printf(\"%d\", a[len - i + 1]);\n}\n"}
{"label": "16", "index": "29780", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (1000 <= a && a <= 10000)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (100 <= a && a < 1000)\n    printf(\"%d%d%d\", e, d, c);\n  else if (10 <= a && a < 100)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 100) {\n    printf(\"001\");\n  } else if (a <= 9) {\n    printf(\"%d\", a);\n  } else if (a <= 99) {\n    b = a % 10 * 10 + a / 10;\n    printf(\"%d\", b);\n  } else if (a <= 999) {\n    b = a % 10 * 100 + (a / 10) % 10 * 10 + a / 100;\n    cout << b;\n  } else if (a <= 9999) {\n    b = a % 10 * 1000 + (a / 10) % 10 * 100 + (a / 100) % 10 * 10 + a / 1000;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n <= 10000 && n >= 0) {\n    a = n % 100000 / 10000;\n    b = n % 10000 / 1000;\n    c = n % 1000 / 100;\n    d = n % 100 / 10;\n    e = n % 10;\n    if (a != 0)\n      cout << e << d << c << b << a << endl;\n    else if (b != 0)\n      cout << e << d << c << b << endl;\n    else if (c != 0)\n      cout << e << d << c << endl;\n    else if (d != 0)\n      cout << e << d << endl;\n    else\n      cout << e << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, m;\n  int a[6] = {0, 0, 0, 0, 0, 0};\n  scanf(\"%d \", &n);\n  if (n >= 10) {\n    do {\n      a[i] = n % 10;\n      n = n / 10;\n      i = i + 1;\n    } while (n >= 10);\n    m = i - 1;\n    for (i = 1; i <= m; i++)\n      cout << a[i];\n    cout << n;\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  scanf(\"%d\", &t);\n  a = t / 10000;\n  b = (t - a * 10000) / 1000;\n  c = (t - a * 10000 - b * 1000) / 100;\n  d = (t - a * 10000 - b * 1000 - c * 100) / 10;\n  e = t - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\", e);\n  else {\n    if (a == 0 && b == 0 && c == 0 && d != 0)\n      printf(\"%d%d\", e, d);\n    else {\n      if (a == 0 && b == 0 && c != 0)\n        printf(\"%d%d%d\", e, d, c);\n      else {\n        if (a == 0 && b != 0)\n          printf(\"%d%d%d%d\", e, d, c, b);\n        else {\n          if (a != 0)\n            printf(\"%d%d%d%d%d\", e, d, c, b, a);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r, i;\n  cin >> a;\n  r = 0;\n  i = 0;\n  while (a > 0) {\n    r = r * 10 + a % 10;\n    i = i + !(a % 10);\n    a = a / 10;\n  }\n  switch (i) {\n  case 0:\n    printf(\"%d\\n\", r);\n    break;\n  case 1:\n    printf(\"0%d\\n\", r);\n    break;\n  case 2:\n    printf(\"00%d\\n\", r);\n    break;\n  case 3:\n    printf(\"000%d\\n\", r);\n    break;\n  case 4:\n    printf(\"0000%d\\n\", r);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 100) {\n    printf(\"001\");\n  } else if (a <= 9) {\n    printf(\"%d\", a);\n  } else if (a <= 99) {\n    b = a % 10 * 10 + a / 10;\n    printf(\"%d\", b);\n  } else if (a <= 999) {\n    b = a % 10 * 100 + (a / 10) % 10 * 10 + a / 100;\n    printf(\"%d\", b);\n  } else if (a <= 9999) {\n    b = a % 10 * 1000 + (a / 10) % 10 * 100 + (a / 100) % 10 * 10 + a / 1000;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m = 0;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\\n\");\n  else {\n    for (int i = 4; i >= 0; i--) {\n      if (floor(n / pow(10.0, i)) != 0) {\n        if (i >= m) {\n          m = i;\n        }\n      }\n    }\n    int p[m + 2], q[m + 1];\n    for (int j = 0; j < m + 2; j++) {\n      p[j] = n % (int)pow(10.0, j);\n    }\n    for (int k = 0; k < m + 1; k++) {\n      q[k] = (p[m + 1 - k] - p[m - k]) / (int)pow(10.0, m - k);\n    }\n    for (int t = 0; t < m + 1; t++) {\n      cout << q[m - t];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29788", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char num[100];\n  int k = -1;\n  cin >> num[0];\n  for (int i = 1; num[i - 1] != '\\n'; i++, k++) {\n    cin.get(num[i]);\n  }\n  for (; k >= 0; k--)\n    printf(\"%c\", num[k]);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = (n % 100 - n % 10) / 10;\n  c = (n % 1000 - n % 100) / 100;\n  d = (n % 10000 - n % 1000) / 1000;\n  e = (n - 1000 * d - 100 * c - 10 * b - a) / 10000;\n  if (e != 0) {\n    cout << a << b << c << d << e;\n  } else if (d != 0) {\n    cout << a << b << c << d;\n  } else if (c != 0) {\n    cout << a << b << c;\n  } else if (d != 0) {\n    printf(\"%d%d\", a, b);\n  } else {\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100)\n    printf(\"%d%d\", a % 10, (a - a % 10) / 10);\n  else if (a < 1000)\n    printf(\"%d%d%d\", a % 10, (a % 100 - a % 10) / 10, (a - a % 100) / 100);\n  else if (a < 10000)\n    printf(\"%d%d%d%d\", a % 10, (a % 100 - a % 10) / 10,\n           (a % 1000 - a % 100) / 100, (a - a % 1000) / 1000);\n  else\n    cout << \"00001\";\n}\n"}
{"label": "16", "index": "29791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n / 10 < 1)\n    cout << n << endl;\n  else {\n    d = n % 10;\n    n = n / 10;\n    if (n / 10 < 1)\n      cout << d << n << endl;\n    else {\n      c = n % 10;\n      n = n / 10;\n      if (n / 10 < 1)\n        cout << d << c << n << \"\\n\";\n      else {\n        b = n % 10;\n        n = n / 10;\n        if (n / 10 < 1)\n          cout << d << c << b << n << endl;\n        else {\n          a = n % 10;\n          n = n / 10;\n          if (n / 10 < 1)\n            cout << d << c << b << a << n << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29792", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - b * 100) / 10;\n  d = n - 1000 * a - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        cout << d << endl;\n      } else {\n        cout << d << c << endl;\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    cout << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char a[5], c;\n  memset(a, ' ', sizeof(a));\n  cin.getline(a, 5);\n  for (i = 5; i >= 0; i--) {\n    if (a[i] == '0' || a[i] == '1' || a[i] == '2' || a[i] == '3' ||\n        a[i] == '4' || a[i] == '5' || a[i] == '6' || a[i] == '7' ||\n        a[i] == '8' || a[i] == '9')\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b1, b2, b3, b4, b5;\n  scanf(\"%d\", &a);\n  b1 = a / 10000;\n  b2 = a / 1000 - 10 * b1;\n  b3 = a / 100 - 100 * b1 - 10 * b2;\n  b4 = a / 10 - 1000 * b1 - 100 * b2 - 10 * b3;\n  b5 = a - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4;\n  if (b1 != 0)\n    printf(\"00001\");\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n}\n"}
{"label": "16", "index": "29795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, *a, i;\n  scanf(\"%d\", &n);\n  if (n != 0) {\n    m = floor(log10(n)) + 1;\n    a = (int *)malloc(sizeof(int) * m);\n    for (i = 1; i <= m; i++) {\n      *(a + i - 1) = n % 10;\n      n = (n - *(a + i - 1)) / 10;\n    }\n    for (i = 1; i <= m; i++)\n      printf(\"%d\", *(a + i - 1));\n  } else\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "29796", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, n, m;\n  scanf(\"%d \", &n);\n  a = n / 10000;\n  b = n / 1000;\n  c = n / 100;\n  d = n / 10;\n  e = n / 1;\n  if (a > 0) {\n    printf(\"00001\");\n  } else if (b > 0) {\n    c = (n - b * 1000) / 100;\n    d = (n - b * 1000 - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (c > 0) {\n    d = (n - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d\", e, d, c);\n  } else {\n    if (d > 0) {\n      e = n - d * 10;\n      printf(\"%d%d\", e, d);\n    } else {\n      printf(\"%d\", e);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10;\n  c = a / 100;\n  d = a / 1000;\n  e = a / 10000;\n  if (e >= 1)\n    f = 5;\n  else if (d >= 1)\n    f = 4;\n  else if (c >= 1)\n    f = 3;\n  else if (b >= 1)\n    f = 2;\n  else\n    f = 1;\n  d = d - 10 * e;\n  c = c - 100 * e - 10 * d;\n  b = b - 1000 * e - 100 * d - 10 * c;\n  a = a - 10000 * e - 1000 * d - 100 * c - 10 * b;\n  switch (f) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", a, b);\n    break;\n  case 1:\n    cout << a << \"\\n\";\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n % 10;\n  if (a > 0)\n    printf(\"00001\");\n  else if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c > 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29799", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  cin.getline(a, 100);\n  int i;\n  int l = strlen(a);\n  for (i = l - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  cout << endl;\n}\n"}
{"label": "16", "index": "29800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = (x % 10000 - c * 100 - b * 10 - a) / 1000;\n  e = (x % 100000 - d * 1000 - c * 100 - b * 10 - a) / 10000;\n  if (e != 0)\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  if ((e == 0) && (d != 0))\n    printf(\"%d%d%d%d\", a, b, c, d);\n  if ((e == 0) && (d == 0) && (c != 0))\n    printf(\"%d%d%d\", a, b, c);\n  if ((e == 0) && (d == 0) && (c == 0) && (b != 0))\n    printf(\"%d%d\", a, b);\n  if ((e == 0) && (d == 0) && (c == 0) && (b == 0))\n    printf(\"%d\", a);\n}\n"}
{"label": "16", "index": "29801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  b = n;\n  do {\n    a = b % 10;\n    c = b;\n    b = b / 10;\n    printf(\"%d\", a);\n  } while (c / 10 != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  cin >> num;\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (a == 0 && b != 0)\n    cout << d << c << b << endl;\n  else if (a == 0 && b == 0 && c != 0) {\n    cout << d << c << endl;\n  } else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e, f;\n  scanf(\"%d \", &f);\n  if (f == 10000)\n    cout << \"00001\";\n  else if (f >= 1000 && f <= 9999) {\n    b = (int)f / 1000;\n    c = (int)(f - b * 1000) / 100;\n    d = (int)(f - b * 1000 - c * 100) / 10;\n    e = f - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (f >= 100 && f <= 999) {\n    c = (int)f / 100;\n    d = (int)(f - c * 100) / 10;\n    e = (f - c * 100 - d * 10);\n    printf(\"%d%d%d\", e, d, c);\n  } else if (f >= 10 && f <= 99) {\n    d = (int)f / 10;\n    e = (f - d * 10);\n    cout << e << d;\n  } else if (f >= 0 && f <= 9)\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "29804", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[6] = {0, 0, 0, 0, 0, 0};\n  scanf(\"%s\", &s);\n  int i = 0;\n  for (i = 5; i >= 1 && s[i] == 0; i--)\n    ;\n  for (; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "29805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp, ge, shi, bai, qian;\n  cin >> num;\n  temp = num;\n  if (num == 10000)\n    cout << \"00001\" << endl;\n  else if (num == 0)\n    cout << \"0\" << endl;\n  else {\n    qian = temp / 1000;\n    temp = temp - qian * 1000;\n    bai = temp / 100;\n    temp = temp - bai * 100;\n    shi = temp / 10;\n    ge = temp - shi * 10;\n    if (num >= 1 && num <= 9)\n      cout << ge << endl;\n    else if (num >= 10 && num <= 99)\n      cout << ge << shi << endl;\n    else if (num >= 100 && num <= 999)\n      printf(\"%d%d%d\\n\", ge, shi, bai);\n    else\n      cout << ge << shi << bai << qian << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a << endl;\n  else if (b != 0)\n    cout << e << d << c << b << endl;\n  else if (c != 0)\n    cout << e << d << c << endl;\n  else if (d != 0)\n    cout << e << d << endl;\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[5];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    cout << str[i];\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[5];\n  int count = 1;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    if (n >= 10) {\n      n = (n - a[i]) / 10;\n      count++;\n    }\n  }\n  for (int i = 0; i < count; i++)\n    cout << a[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n / 10 < 1)\n    cout << n << endl;\n  else {\n    d = n % 10;\n    n = n / 10;\n    if (n / 10 < 1)\n      cout << d << n << endl;\n    else {\n      c = n % 10;\n      n = n / 10;\n      if (n / 10 < 1)\n        cout << d << c << n << \"\\n\";\n      else {\n        b = n % 10;\n        n = n / 10;\n        if (n / 10 < 1)\n          cout << d << c << b << n << endl;\n        else {\n          a = n % 10;\n          n = n / 10;\n          if (n / 10 < 1)\n            printf(\"%d%d%d%d%d\\n\", d, c, b, a, n);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  if (b)\n    c = 5;\n  else {\n    b = a / 1000;\n    if (b)\n      c = 4;\n    else {\n      b = a / 100;\n      if (b)\n        c = 3;\n      else {\n        b = a / 10;\n        if (b)\n          c = 2;\n        else\n          c = 1;\n      }\n    }\n  }\n  switch (c) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100,\n           a % 10000 / 1000, a / 10000);\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a % 10, a % 100 / 10, a / 100);\n    break;\n  case 2:\n    printf(\"%d%d \", a % 10, a / 10);\n    break;\n  case 1:\n    printf(\"%d \", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = (x - 1000 * a) / 100;\n  c = (x - 1000 * a - 100 * b) / 10;\n  d = x - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    y = d * 100 + c * 10 + b;\n    if (b == 0) {\n      y = d * 10 + c;\n      if (c == 0)\n        y = d;\n    }\n  } else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d != 0)\n    cout << y;\n  if ((d == 0) && (c != 0))\n    cout << \"0\" << y;\n  if ((d == 0) && (c == 0) && (b != 0))\n    cout << \"00\" << y;\n  if ((d == 0) && (c == 0) && (b == 0))\n    printf(\"000%d\", y);\n  return 0;\n}\n"}
{"label": "16", "index": "29812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[6], n, m, q;\n  int b = 0;\n  scanf(\"%d \", &n);\n  for (i = 1;; i++) {\n    m = n / 10;\n    q = n - 10 * m;\n    a[i] = q;\n    n = m;\n    b++;\n    if (n == 0)\n      break;\n  }\n  for (i = 1; i <= b; i++)\n    printf(\"%d\", a[i]);\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = (a % 1000) / 100;\n  e = (a % 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%05d\", b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "16", "index": "29814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  x = x % 10000;\n  b = x / 1000;\n  x = x % 1000;\n  c = x / 100;\n  x = x % 100;\n  d = x / 10;\n  x = x % 10;\n  e = x;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          y = e;\n          printf(\"%d\", y);\n        } else {\n          y = 10 * e + d;\n          if (e == 0)\n            printf(\"0%d\", y);\n          else\n            printf(\"%d\", y);\n        }\n\n      } else {\n        y = 100 * e + 10 * d + c;\n        if (e == 0) {\n          if (d == 0)\n            printf(\"00%d\", y);\n          else\n            printf(\"0%d\", y);\n        } else\n          printf(\"%d\", y);\n      }\n\n    } else {\n      y = 1000 * e + 100 * d + 10 * c + b;\n      if (e == 0) {\n        if (d == 0) {\n          if (c == 0)\n            printf(\"000%d\", y);\n          else\n            printf(\"00%d\", y);\n        } else\n          printf(\"0%d\", y);\n      } else\n        printf(\"%d\", y);\n    }\n\n  } else {\n    y = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    if (e == 0) {\n      if (d == 0) {\n        if (c == 0) {\n          if (b == 0)\n            printf(\"0000%d\", y);\n          else\n            printf(\"000%d\", y);\n        } else\n          cout << \"00\" << y;\n      } else\n        printf(\"0%d\", y);\n    } else\n      printf(\"%d\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[6];\n  for (i = 0; i < 6; i++) {\n    cin >> a[i];\n    if (a[i] == '\\n')\n      break;\n  }\n  for (j = i - 1; j > -1; j--)\n    cout << a[j];\n}\n"}
{"label": "16", "index": "29816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x == 0)\n    printf(\"0\");\n  n = (int)log10((double)x);\n  a = x / 10000;\n  x = x - a * 10000;\n  b = x / 1000;\n  x = x - b * 1000;\n  c = x / 100;\n  x = x - c * 100;\n  d = x / 10;\n  e = x - d * 10;\n\n  switch (n) {\n  case 0:\n    printf(\"%d\", e);\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[5];\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  else {\n    {\n      for (i = 0; n > 0; i++) {\n        a[i] = n % 10;\n        n = n / 10;\n      }\n    }\n    m = i;\n    for (i = 0; i < m; i++)\n      printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum = 0, i, t;\n  char str[5] = {0}, str2[5] = {0};\n  cin >> str;\n  for (i = 0; str[i] != '\\0'; i++)\n    sum = sum + 1;\n  for (i = sum - 1; i >= 0; i--) {\n    t = sum - i - 1;\n    str2[t] = str[i];\n  }\n  printf(\"%s\", str2);\n}\n"}
{"label": "16", "index": "29819", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    if (n <= 99) {\n      a = n % 10;\n      b = n / 10;\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n <= 999) {\n        a = n % 10;\n        c = n / 100;\n        b = (n % 100) / 10;\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n <= 9999) {\n          a = n % 10;\n          b = (n % 100) / 10;\n          c = (n % 1000) / 100;\n          d = n / 1000;\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d\", &n);\n\n  a = n % 10;\n  b = (n % 100 - a) / 10;\n  c = (n % 1000 - b * 10 - a) / 100;\n  d = (n - c * 100 - b * 10 - a) / 1000;\n  if (n < 10) {\n    x = a;\n    printf(\"%d\\n\", x);\n  } else if (n < 100) {\n    x = a * 10 + b;\n    printf(\"%02d\\n\", x);\n  } else if (n < 1000) {\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", x);\n  } else if (n < 10000) {\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, i;\n  cin >> i;\n  if (i / 10 == 0)\n    cout << i << endl;\n\n  if (i / 100 == 0 && i / 10 != 0) {\n    a = i / 10;\n    b = i - a * 10;\n    cout << b << a << endl;\n  }\n  if (i / 1000 == 0 && i / 100 != 0) {\n    a = i / 100;\n    b = (i - a * 100) / 10;\n    c = i - a * 100 - b * 10;\n    cout << c << b << a << endl;\n  }\n  if (i / 10000 == 0 && i / 1000 != 0) {\n    a = i / 1000;\n    b = (i - a * 1000) / 100;\n    c = (i - a * 1000 - b * 100) / 10;\n    d = i - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  }\n  if (i / 10000 != 0) {\n    a = i / 10000;\n    b = (i - a * 10000) / 1000;\n    c = (i - a * 10000 - b * 1000) / 100;\n    d = (i - a * 10000 - b * 1000 - c * 100) / 10;\n    e = i - a * 10000 - b * 1000 - c * 100 - d * 10;\n    cout << e << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b = 0, i, j;\n  cin >> a;\n  i = log10(a);\n  for (; a > 0;) {\n    b = b * 10 + a % 10;\n    a = a / 10;\n  }\n  j = log10(b);\n  for (; i > j; i--)\n    printf(\"0\");\n  printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "29823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y, a[5], counter, i = 0;\n  scanf(\"%d \", &x);\n  do {\n    y = x / 10;\n    a[i] = x - y * 10;\n    counter = i;\n    i++;\n    x = y;\n    y = x * 10;\n  } while (y / 10 > 0);\n  for (i = 0; i <= counter; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, s = 0, a, i, j = 0;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\");\n  } else {\n    for (i = 1; i <= 5; i++) {\n      a = n % 10;\n      if (a == 0) {\n        j = j + 1;\n      }\n      n = n / 10;\n      s = s * 10 + a;\n      if (n == 0) {\n        break;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (j == 0) {\n        break;\n      }\n      printf(\"0\");\n    }\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29825", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d \", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = (x % 10000 - c * 100 - b * 10 - a) / 1000;\n  e = (x % 100000 - d * 1000 - c * 100 - b * 10 - a) / 10000;\n  if (e != 0)\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  if ((e == 0) && (d != 0))\n    printf(\"%d%d%d%d\", a, b, c, d);\n  if ((e == 0) && (d == 0) && (c != 0))\n    printf(\"%d%d%d\", a, b, c);\n  if ((e == 0) && (d == 0) && (c == 0) && (b != 0))\n    printf(\"%d%d\", a, b);\n  if ((e == 0) && (d == 0) && (c == 0) && (b == 0))\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29826", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  scanf(\"%d \", &n);\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, t;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n  if (b != 0) {\n    t = f;\n    f = b;\n    b = t;\n    t = e;\n    e = c;\n    c = t;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  } else if (c != 0) {\n    t = f;\n    f = c;\n    c = t;\n    t = e;\n    e = d;\n    d = t;\n    cout << c << d << e << f;\n  } else if (d != 0) {\n    t = f;\n    f = d;\n    d = t;\n    printf(\"%d%d%d\", d, e, f);\n  } else {\n    if (e != 0) {\n      t = f;\n      f = e;\n      e = t;\n      cout << e << f;\n    } else\n      printf(\"%d\", f);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29828", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d\", &n);\n\n  if (n > 999) {\n    a = n / 1000;\n    b = n - a * 1000;\n    c = b / 100;\n    d = b - c * 100;\n    e = d / 10;\n    f = d - e * 10;\n\n    printf(\"%d\", f);\n    printf(\"%d\", e);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<1000 & n> 99) {\n    a = n / 100;\n    b = n - a * 100;\n    c = b / 10;\n    d = b - c * 10;\n\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", a);\n  }\n\n  if (n<100 & n> 9) {\n    a = n / 10;\n    b = n - a * 10;\n\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  if (n < 10) {\n    a = n / 10;\n\n    cout << n;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b1, b, c1, c, d1, d, x, y;\n  scanf(\"%d \", &x);\n  a = x % 10;\n  b1 = x % 100;\n  b = b1 / 10;\n  c1 = x % 1000;\n  c = c1 / 100;\n  d1 = x;\n  d = d1 / 1000;\n  if (d != 0) {\n    y = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", y);\n  } else if ((d == 0) && (c != 0)) {\n    y = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", y);\n  } else if ((c == 0) && (b != 0)) {\n    y = a * 10 + b;\n    printf(\"%02d\\n\", y);\n  } else {\n    y = a;\n    cout << y << \"\\n\";\n  }\n}\n"}
{"label": "16", "index": "29830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d \", &a);\n  if (a == a % 10)\n    cout << a;\n  else if (a == a % 100)\n    printf(\"%02d\", a = (a % 100 - a % 10) / 10 + (a % 10) * 10);\n  else if (a == a % 1000)\n    printf(\"%03d\", a = (a % 1000 - a % 100) / 100 + (a % 100 - a % 10) +\n                       (a % 10) * 100);\n  else\n    printf(\"%04d\", a = (a % 10000 - a % 1000) / 1000 +\n                       (a % 1000 - a % 100) / 10 + (a % 100 - a % 10) * 10 +\n                       (a % 10) * 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "29831", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s, a, b, c, d, e;\n  scanf(\"%d \", &s);\n  a = s / 10000;\n  b = (s - 10000 * a) / 1000;\n  c = (s - 10000 * a - 1000 * b) / 100;\n  d = (s - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (s - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0) {\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, b1, b2, b3, b4, b5;\n  scanf(\"%d\", &num);\n  b1 = num / 10000;\n  b2 = (num - 10000 * b1) / 1000;\n  b3 = (num - 10000 * b1 - 1000 * b2) / 100;\n  b4 = (num - 10000 * b1 - 1000 * b2 - 100 * b3) / 10;\n  b5 = (num - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4);\n  if (b1 != 0)\n    printf(\"%d%d%d%d%d\", b5, b4, b3, b2, b1);\n  else if (b2 != 0)\n    cout << b5 << b4 << b3 << b2;\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    cout << b5 << b4;\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "29833", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        cout << d << \"\\n\";\n      } else {\n        printf(\"%d%d\\n\", d, c);\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, x, a, b, c, d, e, x1, x2, x3, x4, x5;\n  k = 0;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = (x % 10) / 1;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (x / i != 0)\n      k = k + 1;\n  };\n  if (k == 5) {\n    x5 = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (k == 4) {\n    x4 = 1000 * e + 100 * d + 10 * c + b;\n    cout << e << d << c << b;\n  } else if (k == 3) {\n    x3 = 100 * e + 10 * d + c;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (k == 2) {\n    x2 = 10 * e + d;\n    printf(\"%d%d\", e, d);\n  } else if (k == 1) {\n    x1 = e;\n    printf(\"%d\", e);\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29835", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  cin >> i;\n  do {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n\n  } while (i != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, n = 0, i = 0;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  else if (a != 0) {\n    while (a >= pow(10, n))\n      n = n + 1;\n    int c[10] = {0};\n    for (i = 0; i <= n - 1; i++)\n      c[i] = a % (int)(pow(10, i + 1));\n    for (i = 0; i <= n - 1; i++)\n      c[i] = c[i] / pow(10, i);\n    for (i = 0; i <= n - 1; i++)\n      cout << c[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[5];\n  int i, j;\n  cin >> n;\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  if (a[4] == 0 && a[3] == 0 && a[2] == 0 && a[1] == 0)\n    printf(\"%d\", a[0]);\n  else if (a[4] == 0 && a[3] == 0 && a[2] == 0)\n    printf(\"%d%d\", a[0], a[1]);\n  else if (a[4] == 0 && a[3] == 0)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (a[4] == 0)\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n  else\n    printf(\"%d%d%d%d%d\", a[0], a[1], a[2], a[3], a[4]);\n  return 0;\n}\n"}
{"label": "16", "index": "29838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 1, m;\n  int a[6] = {0, 0, 0, 0, 0, 0};\n  cin >> n;\n  if (n >= 10) {\n    do {\n      a[i] = n % 10;\n      n = n / 10;\n      i = i + 1;\n    } while (n >= 10);\n    m = i - 1;\n    for (i = 1; i <= m; i++)\n      printf(\"%d\", a[i]);\n    printf(\"%d\", n);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    cout << n << \"\\n\";\n  }\n  if (n >= 10 && n < 100) {\n    a = n % 10;\n    b = (n - a) / 10;\n    printf(\"%d%d\\n\", a, b);\n  }\n  if (n >= 100 && n < 1000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100;\n    printf(\"%d%d%d\\n\", a, b, c);\n  }\n  if (n >= 1000 && n < 10000) {\n    a = n % 10;\n    b = (n - a) / 10 % 10;\n    c = (n - b * 10 - a) / 100 % 10;\n    d = (n - c * 100 - b * 10 - a) / 1000;\n    cout << a << b << c << d << \"\\n\";\n  }\n  if (n == 10000) {\n    printf(\"00001\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a - b) / 10 % 10;\n  d = (a - b - 10 * c) / 100 % 10;\n  e = (a - b - 10 * c - 100 * d) / 1000 % 10;\n  f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000 % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\", b);\n  if (a >= 10 && a < 100)\n    printf(\"%d%d\", b, c);\n  if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\", b, c, d);\n  if (a >= 1000 && a < 10000)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  if (a >= 10000)\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  return 0;\n}\n"}
{"label": "16", "index": "29841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int s) {\n  if (s == 0)\n    return;\n  else {\n    cout << s % 10;\n    fun(s /= 10);\n  }\n}\nint main() {\n  int s;\n  cin >> s;\n  if (s == 0)\n    cout << s;\n  else\n    fun(s);\n  return 0;\n}\n"}
{"label": "16", "index": "29842", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char a[6];\n  int i, n;\n  scanf(\"%s\", a);\n  n = strlen(a);\n  for (i = 1; i <= n; i++) {\n    printf(\"%c\", a[n - i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29843", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, result;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a < 10000 && a >= 1000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    result = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%04d\", result);\n  } else if (a < 1000 && a >= 100) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a - b * 100 - c * 10;\n    result = d * 100 + c * 10 + b;\n    printf(\"%03d\", result);\n  } else if (a < 100 && a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    result = c * 10 + b;\n    printf(\"%02d\", result);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[4], b, i;\n  scanf(\"%d\", &b);\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    for (i = 0; i <= 3; i++)\n      a[i] = b % (int)pow(10, i + 1) / (int)pow(10, i);\n    for (i = 0; i <= 3; i++)\n      if (b >= pow(10, i))\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, decade, hundred, thousand;\n  cin >> n;\n  cout << n - n / 10 * 10;\n  if (n >= 10) {\n    decade = n / 10;\n    cout << decade - decade / 10 * 10;\n  }\n  if (n >= 100) {\n    hundred = decade / 10;\n    cout << hundred - hundred / 10 * 10;\n  }\n  if (n >= 1000) {\n    thousand = hundred / 10;\n    cout << thousand - thousand / 10 * 10;\n  }\n  if (n == 10000)\n    cout << \"1\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, m, n, o, p;\n  scanf(\"%d\", &x);\n  m = x / 10000;\n  n = x / 1000;\n  o = x / 100;\n  p = x / 10;\n  if (m != 0) {\n    a = m;\n    b = n - 10 * a;\n    c = o - 100 * a - 10 * b;\n    d = p - 1000 * a - 100 * b - 10 * c;\n    e = x % 10;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (n != 0) {\n    a = n;\n    b = o - 10 * a;\n    c = p - 100 * a - 10 * b;\n    d = x % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (o != 0) {\n    a = o;\n    b = p - 10 * o;\n    c = x % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (p != 0) {\n    a = p;\n    b = x % 10;\n    cout << b << a;\n  } else {\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "16", "index": "29847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N, X, a, b, c, d, e;\n  scanf(\"%d\", &N);\n  if (N > 9999)\n    X = 5;\n  else if (N > 999)\n    X = 4;\n  else if (N > 99)\n    X = 3;\n  else if (N > 9)\n    X = 2;\n  else\n    X = 1;\n  a = N / 10000;\n  b = (N - 10000 * a) / 1000;\n  c = (N - 10000 * a - 1000 * b) / 100;\n  d = (N - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = (N - 10000 * a - 1000 * b - 100 * c - 10 * d);\n  switch (X) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 1:\n    printf(\"%d\\n\", e);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[4];\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\\n\");\n\n  if (n / 10 == 0)\n    i = 1;\n  else if (n / 100 == 0)\n    i = 2;\n  else if (n / 1000 == 0)\n    i = 3;\n  else if (n / 10000 == 0)\n    i = 4;\n\n  for (j = i; j >= 1; j--) {\n    a[j - 1] = n / (pow(10, (double)(j - 1)));\n    n = n - pow(10, (double)(j - 1)) * a[j - 1];\n  }\n  for (k = 0; k <= i - 1; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29849", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char num[5];\n  cin >> num;\n  int nl = strlen(num);\n\n  int i;\n  for (i = 0; i < (int)(nl / 2); i++) {\n    char k;\n    k = num[i];\n    num[i] = num[nl - 1 - i];\n    num[nl - 1 - i] = k;\n  }\n\n  cout << num;\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29850", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10];\n\nint main() {\n  int x;\n  int k = 0;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    cout << x << endl;\n  else {\n    while (x > 0) {\n      a[k++] = x % 10;\n      x = x / 10;\n    }\n    for (int i = 0; i < k; i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29851", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, t;\n  scanf(\"%d \", &n);\n  if (n == 0) {\n    printf(\"0\");\n  } else {\n    for (i = 0; i < 5; i++) {\n      if (n != 0) {\n        t = n % 10;\n        printf(\"%d\", t);\n        n = (n - t) / 10;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, i;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  printf(\"%d\", b);\n  a = a / 10;\n  if (a != 0) {\n    b = a % 10;\n    printf(\"%d\", b);\n    a = a / 10;\n    if (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n      if (a != 0) {\n        b = a % 10;\n        printf(\"%d\", b);\n        a = a / 10;\n        if (a != 0) {\n          b = a % 10;\n          printf(\"%d\", b);\n          a = a / 10;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29853", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid p(int num) {\n  while (num) {\n    cout << num % 10;\n    num /= 10;\n  }\n}\nint main() {\n  int l;\n  cin >> l;\n  if (l != 0)\n    p(l);\n  else\n    printf(\"%d\", 0);\n  return 0;\n}\n"}
{"label": "16", "index": "29854", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, i, j;\n  int bit[5];\n  i = 1;\n  cin >> num;\n  if (num == 0) {\n    cout << 0;\n    return 0;\n  }\n  while (num > 0) {\n    bit[i] = num % 10;\n    num = num / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++) {\n    cout << bit[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29855", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a;\n  for (int i = 1;; i++) {\n    b = a % 10;\n    printf(\"%d\", b);\n    c = a / 10;\n    if (c == 0) {\n      break;\n    }\n    a = c;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29856", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid function_1(int num) {\n  cout << num % 10;\n  if ((num / 10) != 0) {\n    function_1(num / 10);\n  }\n}\nint main() {\n  int num;\n  cin >> num;\n  function_1(num);\n  return 0;\n}\n"}
{"label": "16", "index": "29857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, i, j, a[5];\n  scanf(\"%d\", &x);\n  i = 0;\n  while (x >= 10) {\n    a[i] = x % 10;\n    x = x / 10;\n    i = i + 1;\n  }\n  a[i] = x;\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]);\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p, q, r, s, t;\n  cin >> n;\n  p = n % 10;\n  n = (n - p) / 10;\n  q = n % 10;\n  n = (n - q) / 10;\n  r = n % 10;\n  n = (n - r) / 10;\n  s = n % 10;\n  n = (n - s) / 10;\n  t = n;\n  if (t != 0)\n    cout << p << q << r << s << t << endl;\n  else {\n    if (s != 0)\n      printf(\"%d%d%d%d\\n\", p, q, r, s);\n    else {\n      if (r != 0)\n        cout << p << q << r << endl;\n      else {\n        if (q != 0) {\n          cout << p << q << endl;\n        } else {\n          cout << p << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29859", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 10 * b - 100 * a;\n  d = n - 10 * c - 100 * b - 1000 * a;\n  if (a == 0 && b == 0 && c == 0) {\n    printf(\"%d\", d);\n  }\n  if (a == 0 && b == 0 && c != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  }\n  if (a == 0 && b != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  }\n  if (a != 0) {\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29860", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0;\n  int a[6] = {0};\n  scanf(\"%d \", &n);\n  do {\n    a[i] = (n % 10);\n    n = (n - a[i]) / 10;\n    i++;\n    k++;\n  } while (n != 0);\n  for (i = 0; i < k; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, result;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a < 10000 && a >= 1000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    result = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%04d\", result);\n  } else if (a < 1000 && a >= 100) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a - b * 100 - c * 10;\n    result = d * 100 + c * 10 + b;\n    printf(\"%03d\", result);\n  } else if (a < 100 && a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    result = c * 10 + b;\n    printf(\"%02d\", result);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, count = 0;\n  char a[20000];\n  while ((a[count] = getchar()) != '\\n') {\n    count++;\n  }\n  for (i = count - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a1, a2, a3, a4;\n  cin >> n;\n  if (n >= 1000) {\n    a4 = n / 1000;\n    a3 = (n - a4 * 1000) / 100;\n    a2 = (n - a4 * 1000 - a3 * 100) / 10;\n    a1 = n - a4 * 1000 - a3 * 100 - a2 * 10;\n    cout << a1 << a2 << a3 << a4;\n  }\n  if (n >= 100 && n < 1000) {\n    a3 = n / 100;\n    a2 = (n - a3 * 100) / 10;\n    a1 = n - a3 * 100 - a2 * 10;\n    printf(\"%d%d%d\", a1, a2, a3);\n  }\n  if (n >= 10 && n < 100) {\n    a2 = n / 10;\n    a1 = n - a2 * 10;\n    printf(\"%d%d\", a1, a2);\n  }\n  if (n < 10) {\n    cout << n;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29864", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  long a, original;\n  cin >> a;\n  original = a;\n  int dig1, dig2, dig3, dig4, dig5;\n  int NumofDig;\n  dig1 = a / 10000;\n  a = a - 10000 * dig1;\n  dig2 = a / 1000;\n  a = a - 1000 * dig2;\n  dig3 = a / 100;\n  a = a - 100 * dig3;\n  dig4 = a / 10;\n  a = a - 10 * dig4;\n  dig5 = a;\n  if (dig1)\n    NumofDig = 5;\n  else {\n    if (dig2) {\n      NumofDig = 4;\n    } else {\n      if (dig3)\n        NumofDig = 3;\n      else {\n        if (dig4)\n          NumofDig = 2;\n        else\n          NumofDig = 1;\n      }\n    }\n  }\n  long Oppo;\n  Oppo = dig5 * 10000 + dig4 * 1000 + dig3 * 100 + dig2 * 10 + dig1;\n  switch (NumofDig) {\n  case 5:\n    printf(\"00001\\n\");\n    break;\n  case 4:\n    cout << dig5 << dig4 << dig3 << dig2 << endl;\n    break;\n  case 3:\n    cout << dig5 << dig4 << dig3 << endl;\n    break;\n  case 2:\n    cout << dig5 << dig4 << endl;\n    break;\n  case 1:\n    cout << dig5 << endl;\n    break;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "16", "index": "29865", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else {\n        printf(\"%d%d\\n\", d, c);\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 1000);\n  b = (int)(n / 100 - a * 10);\n  c = (int)(n / 10 - a * 100 - b * 10);\n  d = (int)(n - a * 1000 - b * 100 - c * 10);\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      cout << d << c << b << \"\\n\";\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "29867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  scanf(\"%d \", &n);\n  if (n / 10 == 0) {\n    a[0] = n;\n    cout << a[0] << endl;\n  } else if (n / 100 == 0) {\n    a[0] = n / 10;\n    a[1] = n % 10;\n    cout << a[1] << a[0] << endl;\n  } else if (n / 1000 == 0) {\n    a[0] = n / 100;\n    a[1] = n % 100 / 10;\n    a[2] = n % 100 % 10;\n    cout << a[2] << a[1] << a[0] << endl;\n  } else if (n / 10000 == 0) {\n    a[0] = n / 1000;\n    a[1] = n % 1000 / 100;\n    a[2] = n % 1000 % 100 / 10;\n    a[3] = n % 1000 % 100 % 10;\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n  } else if (n = 10000)\n    printf(\"1\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a % 10 == a)\n    printf(\"%d\", a);\n  if (a % 10 != a && a % 100 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    printf(\"%d%d\", b, c);\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    cout << b << c << d;\n  }\n  if (a % 10 != a && a % 100 != a && a % 1000 != a && a % 10000 == a) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  if (a == 10000)\n    printf(\"%d\", 00001);\n  return 0;\n}\n"}
{"label": "16", "index": "29869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a == 0)\n    cout << a;\n  if (a != 0) {\n    for (; a > 0;) {\n      cout << a % 10;\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (x > 9999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x > 999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x > 99)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x > 9)\n    cout << e << d;\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a)\n    printf(\"%d%d%d%d%d \", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d \", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else {\n    a[1] = n / 1000;\n    a[2] = (n - 1000 * a[1]) / 100;\n    a[3] = (n - 1000 * a[1] - 100 * a[2]) / 10;\n    a[4] = (n - 1000 * a[1] - 100 * a[2] - 10 * a[3]);\n  }\n  if (a[1] != 0)\n    cout << a[4] << a[3] << a[2] << a[1] << endl;\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d\\n\", a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        cout << a[4] << a[3] << endl;\n      else\n        cout << a[4] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, x, a, b, c, d, e, x1, x2, x3, x4, x5;\n  k = 0;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = (x % 10) / 1;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (x / i != 0)\n      k = k + 1;\n  };\n  if (k == 5) {\n    x5 = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  } else if (k == 4) {\n    x4 = 1000 * e + 100 * d + 10 * c + b;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (k == 3) {\n    x3 = 100 * e + 10 * d + c;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (k == 2) {\n    x2 = 10 * e + d;\n    printf(\"%d%d\", e, d);\n  } else if (k == 1) {\n    x1 = e;\n    printf(\"%d\", e);\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "29874", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[5];\n  scanf(\"%d\", &n);\n  i = 1;\n  if (n == 0)\n    printf(\"0\");\n  while (n > 0) {\n    a[i] = n % 10;\n    n = n / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "29875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (1000 <= a && a <= 10000)\n    cout << e << d << c << b;\n  else if (100 <= a && a < 1000)\n    cout << e << d << c;\n  else if (10 <= a && a < 100)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  n = (n - d) / 10;\n  e = n % 10;\n  n = (n - e) / 10;\n  if (e != 0)\n    cout << a << b << c << d << e << endl;\n  else if (d != 0)\n    cout << a << b << c << d << endl;\n  else if (c != 0)\n    cout << a << b << c << endl;\n  else if (b != 0)\n    cout << a << b << endl;\n  else\n    cout << a << endl;\n  return (0);\n}\n"}
{"label": "16", "index": "29877", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  while (n > 0) {\n    printf(\"%d\", n % 10);\n    n /= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29878", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 0, n < 10)\n    printf(\"%d\\n\", n);\n  else if (n >= 10, n < 100)\n    printf(\"%d%d\\n\", n % 10, n / 10);\n  else if (n >= 100, n < 1000)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n >= 1000, n < 10000)\n    printf(\"%d%d%d%d\\n\", n % 10, n % 100 / 10, n / 100 % 10, n / 1000);\n  else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int number, ge, shi, bai, qian, wan, place;\n  cin >> number;\n  if (number >= 10000)\n    place = 5;\n  else {\n    if (number >= 1000)\n      place = 4;\n    else {\n      if (number >= 100)\n        place = 3;\n      else {\n        if (number >= 10)\n          place = 2;\n        else\n          place = 1;\n      }\n    }\n  }\n  ge = number % 10;\n  shi = ((number - ge) % 100) / 10;\n  bai = ((number - ge - 10 * shi) % 1000) / 100;\n  qian = ((number - ge - 10 * shi - 100 * bai) % 10000) / 1000;\n  wan = (number - ge - 10 * shi - 100 * bai - 1000 * qian) / 10000;\n\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    cout << ge << shi << bai;\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    cout << ge;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  char s[20];\n  int l, i;\n  scanf(\"%s\", s);\n  l = strlen(s);\n  for (i = l - 1; i >= 0; i--)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29881", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, q1, q2, q3, q4, q5, r1, r2, r3, r4, r5;\n  scanf(\"%d\", &n);\n  q1 = n / 10;\n  r1 = n % 10;\n\n  if (q1 == 0)\n    printf(\"%d\\n\", r1);\n  else {\n    q2 = q1 / 10;\n    r2 = q1 % 10;\n\n    if (q2 == 0)\n      printf(\"%d%d\\n\", r1, r2);\n    else {\n      q3 = q2 / 10;\n      r3 = q2 % 10;\n\n      if (q3 == 0)\n        printf(\"%d%d%d\\n\", r1, r2, r3);\n      else {\n        q4 = q3 / 10;\n        r4 = q3 % 10;\n\n        if (q4 == 0)\n          printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n        else {\n          q5 = q4 / 10;\n          r5 = q4 % 10;\n          printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char a[100];\n  while ((a[i] = cin.get()) != '\\n') {\n    i++;\n  }\n  for (j = i - 1; j >= 0; j -= 1) {\n    cout << a[j];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29883", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n >= 10 && n < 100) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    cout << a[1] << a[2] << endl;\n  } else if (n >= 100 && n < 1000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    cout << a[1] << a[2] << a[3] << endl;\n  }\n\n  else if (n >= 1000 && n < 10000) {\n    a[1] = n % 10;\n    a[2] = (n / 10) % 10;\n    a[3] = (n / 100) % 10;\n    a[4] = (n / 1000) % 10;\n    cout << a[1] << a[2] << a[3] << a[4] << endl;\n  }\n\n  else if (n = 10000)\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29884", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if ((n >= 1) && (n <= 9))\n    cout << n << endl;\n  if ((n >= 10) && (n < 100)) {\n    int a = n / 10;\n    int b = n % 10;\n    cout << b << a << endl;\n  }\n  if ((n >= 100) && (n <= 999)) {\n    int a = n / 100;\n    int b = (n % 100) / 10;\n    int c = (n % 100) % 10;\n    cout << c << b << a << endl;\n  }\n  if ((n >= 1000) && (n < 9999)) {\n    int a = n / 1000;\n    int b = (n % 1000) / 100;\n    int c = ((n % 1000) % 100) / 10;\n    int d = ((n % 1000) % 100) % 10;\n    cout << d << c << b << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a = 10, b = 10, c = 10, d;\n  cin >> n;\n  if (n == 10000)\n    cout << \"1\" << endl;\n  else\n    do {\n      a--;\n    } while ((n - a * 1000 < 0) || (n - a * 1000 >= 1000));\n  n = n - a * 1000;\n  do {\n    b--;\n  } while ((n - b * 100 < 0) || (n - b * 100 >= 100));\n  n = n - b * 100;\n  do {\n    c--;\n  } while ((n - c * 10 < 0) || (n - c * 10 >= 10));\n  n = n - c * 10;\n  d = n;\n  if ((a == 0) && (b == 0) && (c == 0))\n    cout << d << endl;\n  else if ((a == 0) && (b == 0))\n    cout << d << c << endl;\n  else if (a == 0)\n    cout << d << c << b << endl;\n  else\n    cout << d << c << b << a << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j = 0, k = 1, a[5] = {0}, t;\n  scanf(\"%d\", &m);\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (m / i != 0)\n      j++;\n    else\n      break;\n  }\n  for (i = 1; i < j; i++) {\n    k = 10 * k;\n  }\n  for (i = j; i >= 1; i--) {\n    a[i] = m / k;\n    m = m % k;\n    k = k / 10;\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "29887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint print(int n);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  print(n);\n  return 0;\n}\nint print(int n) {\n  int s, a, b;\n  a = n;\n  s = 0;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      b = a % 10;\n      cout << b;\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int A, B, a[5], i = 0, j = 0;\n  cin >> A;\n  do {\n    B = A / 10;\n    a[i] = A - B * 10;\n    A = B;\n    i++;\n    j++;\n  } while (A != 0);\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "29889", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5], i = 0, j;\n  cin >> n;\n  if (n >= 10) {\n    while (n >= 10) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      i++;\n    }\n    for (j = 0; j <= i - 1; j++)\n      cout << a[j];\n  } else\n    ;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[7], i, j;\n  scanf(\"%s\", &a);\n  for (i = 1; a[i] != '\\0'; i++)\n    j = i;\n\n  for (i = j; i >= 0; i--)\n    cout << a[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29891", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b1, b2, b3, b4, b5;\n  scanf(\"%d\", &a);\n  b1 = a / 10000;\n  b2 = a / 1000 - 10 * b1;\n  b3 = a / 100 - 100 * b1 - 10 * b2;\n  b4 = a / 10 - 1000 * b1 - 100 * b2 - 10 * b3;\n  b5 = a - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4;\n  if (b1 != 0)\n    printf(\"00001\");\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    cout << b5 << b4;\n  else\n    printf(\"%d\", b5);\n}\n"}
{"label": "16", "index": "29892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long a1, a2, a3, a4, a5, num, len;\n  a1 = a2 = a3 = a4 = a5 = 0;\n  scanf(\"%d\", &num);\n  if (num > 9) {\n    a1 = num % 10;\n    a2 = num / 10;\n    if (a2 > 9) {\n      a3 = a2 / 10;\n      a2 = a2 % 10;\n      if (a3 > 9) {\n        a4 = a3 / 10;\n        a3 = a3 % 10;\n        if (a4 > 9) {\n          a5 = a4 / 10;\n          a4 = a4 % 10;\n          len = 5;\n        } else\n          len = 4;\n      } else\n        len = 3;\n    } else\n      len = 2;\n  } else {\n    a1 = num;\n    len = 1;\n  }\n\n  if (a5)\n    \n    \n    printf(\"%d%d%d%d%d\\n\", a1, a2, a3, a4, a5);\n  \n  else if (a4)\n    \n    \n    printf(\"%d%d%d%d\\n\", a1, a2, a3, a4);\n  \n  else if (a3)\n    \n    \n    printf(\"%d%d%d\\n\", a1, a2, a3);\n  \n  else if (a2)\n    \n    \n    printf(\"%d%d\\n\", a1, a2);\n  \n  else\n    printf(\"%d\\n\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "29893", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  char x[6];\n\n  cin >> x;\n  int i;\n\n  for (i = 5; i >= 0; i--)\n    if (x[i] == '0' || x[i] == '1' || x[i] == '2' || x[i] == '3' ||\n        x[i] == '4' || x[i] == '5' || x[i] == '6' || x[i] == '7' ||\n        x[i] == '8' || x[i] == '9')\n      break;\n\n  for (int j = i; j >= 0; j--)\n    cout << x[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  a = b = c = d = 0;\n  cin >> n;\n  while (n > 999) {\n    n = n - 1000;\n    a = a + 1;\n  }\n  while (n > 99) {\n    n = n - 100;\n    b++;\n  }\n  while (n > 9) {\n    n = n - 10;\n    c++;\n  }\n  if (n > 0) {\n    while (n > 0) {\n      n = n - 1;\n      d++;\n    }\n  } else if (n = 0)\n    d = 0;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          cout << d;\n        } else\n          cout << d;\n      } else\n        cout << d << c;\n    } else\n      cout << d << c << b;\n  } else\n    cout << d << c << b << a;\n  return 0;\n}\n"}
{"label": "16", "index": "29895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n % 10;\n  a[1] = ((n - a[0]) % 100) / 10;\n  a[2] = ((n - a[0] - a[1]) % 1000) / 100;\n  a[3] = ((n - a[0] - a[1] - a[2]) % 10000) / 1000;\n  a[4] = (n - a[0] - a[1] - a[2] - a[3]) / 10000;\n  if (a[4] != 0) {\n    printf(\"%d%d%d%d%d\\n\", a[0], a[1], a[2], a[3], a[4]);\n  }\n  if (a[4] == 0 && a[3] != 0)\n    printf(\"%d%d%d%d\\n\", a[0], a[1], a[2], a[3]);\n  if (a[4] + a[3] == 0 && a[2] != 0)\n    printf(\"%d%d%d\\n\", a[0], a[1], a[2]);\n  if (a[4] + a[3] + a[2] == 0 && a[1] != 0)\n    printf(\"%d%d\\n\", a[0], a[1]);\n  if (a[4] + a[3] + a[2] + a[1] == 0)\n    printf(\"%d\\n\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "29896", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  cin >> t;\n  a = t / 10000;\n  b = (t - a * 10000) / 1000;\n  c = (t - a * 10000 - b * 1000) / 100;\n  d = (t - a * 10000 - b * 1000 - c * 100) / 10;\n  e = t - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\", e);\n  else {\n    if (a == 0 && b == 0 && c == 0 && d != 0)\n      printf(\"%d%d\", e, d);\n    else {\n      if (a == 0 && b == 0 && c != 0)\n        printf(\"%d%d%d\", e, d, c);\n      else {\n        if (a == 0 && b != 0)\n          printf(\"%d%d%d%d\", e, d, c, b);\n        else {\n          if (a != 0)\n            printf(\"%d%d%d%d%d\", e, d, c, b, a);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a;\n  cin >> a;\n  if (a < 10)\n    cout << a << \"\\n\";\n  else if (a < 100) {\n    int b, c;\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%02d\\n\", 10 * b + c);\n  } else if (a < 1000) {\n    int d, e, f;\n    d = a % 10;\n    e = a % 100;\n    e = (e - d) / 10;\n    f = (a - d - 10 * e) / 100;\n    printf(\"%03d\\n\", 100 * d + 10 * e + f);\n  } else if (a < 10000) {\n    int g, h, i, j;\n    g = a % 10;\n    h = a % 100;\n    h = (h - g) / 10;\n    i = a % 1000;\n    i = (i - 10 * h - g) / 100;\n    j = (a - 100 * i - 10 * h - g) / 1000;\n    printf(\"%04d\\n\", 1000 * g + 100 * h + 10 * i + j);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, r;\n  scanf(\"%d\", &a);\n  r = a % 10;\n  do {\n    printf(\"%d\", r);\n    a = a - r;\n    a = a / 10;\n    r = a % 10;\n  } while (a >= 1);\n  return 0;\n}\n"}
{"label": "16", "index": "29899", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p, q, r, s, t;\n  cin >> n;\n  p = n % 10;\n  n = (n - p) / 10;\n  q = n % 10;\n  n = (n - q) / 10;\n  r = n % 10;\n  n = (n - r) / 10;\n  s = n % 10;\n  n = (n - s) / 10;\n  t = n;\n  if (t != 0)\n    cout << p << q << r << s << t << endl;\n  else {\n    if (s != 0)\n      printf(\"%d%d%d%d\\n\", p, q, r, s);\n    else {\n      if (r != 0)\n        cout << p << q << r << endl;\n      else {\n        if (q != 0)\n          cout << p << q << endl;\n        else {\n          cout << p << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29900", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  cin >> a;\n  if (a < 10)\n    printf(\"%d\", a);\n  else {\n    while (a / 10 != 0) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d\", c);\n      a = b;\n    }\n    printf(\"%d\", a);\n  }\n}\n"}
{"label": "16", "index": "29901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  i = (n % 10) * 10 + (n - n % 10) / 10;\n  j = (n % 10) * 100 + (n % 100 - n % 10) + (n - n % 100) / 100;\n  k = (n % 10) * 1000 + (n % 100 - n % 10) * 10 + (n % 1000 - n % 100) / 10 +\n      (n - n % 1000) / 1000;\n  if (n % 10 == n)\n    printf(\"%d\", n);\n  else if (n % 100 == n)\n    printf(\"%02d\", i);\n  else if (n % 1000 == n)\n    printf(\"%03d\", j);\n  else\n    printf(\"%04d\", k);\n  return 0;\n}\n"}
{"label": "16", "index": "29902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = a / 1000;\n  d = (a % 1000) / 100;\n  e = (a % 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%05d\", b);\n  else if (c != 0)\n    cout << f << e << d << c;\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "16", "index": "29903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a % 10;\n  printf(\"%d\", b);\n  c = a / 10;\n  if (c != 0)\n    printf(\"%d\", c % 10);\n  d = a / 100;\n  if (d != 0)\n    printf(\"%d\", d % 10);\n  e = a / 1000;\n  if (e != 0)\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, e, f, g;\n  scanf(\"%d\", &n);\n  a = (int)(n / 1000);\n  e = n - 1000 * a;\n  b = (int)(e / 100);\n  f = e - 100 * b;\n  c = (int)(f / 10);\n  g = f - 10 * c;\n  if (n >= 10000) {\n    printf(\"00001\");\n  } else {\n    if (n >= 1000) {\n      printf(\"%d%d%d%d\", g, c, b, a);\n    } else {\n      if (n >= 100) {\n        printf(\"%d%d%d\", g, c, b);\n      } else {\n        if (n >= 10) {\n          printf(\"%d%d\", g, c);\n        } else {\n          printf(\"%d\", g);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0;\n  cin >> a;\n  if (a != 0)\n    while (a != 0) {\n      b = a % 10;\n      cout << b;\n      a = a / 10;\n    }\n  else\n    cout << 0;\n}\n"}
{"label": "16", "index": "29906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, A, B, C, D;\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = n / 100;\n    c = n / 10;\n    d = n % 10;\n    A = d;\n    B = c % 10;\n    C = b % 10;\n    D = a;\n    cout << A << B << C << D << endl;\n  } else if (n >= 100 && n < 1000) {\n    a = n / 100;\n    b = n / 10;\n    c = n % 10;\n    A = c;\n    B = b % 10;\n    C = a;\n    cout << A << B << C << endl;\n  } else if (n >= 10 && n < 100) {\n    A = n % 10;\n    B = n / 10;\n    cout << A << B << endl;\n  } else\n    cout << n << endl;\n}\n"}
{"label": "16", "index": "29907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len;\n  char str[6];\n\n  cin >> str;\n  len = strlen(str);\n  for (int i = len - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    a = n % 10;\n    cout << a;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    printf(\"%d\", a[i]);\n    if (n == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n, b, c, d, e, f, g;\n  scanf(\"%d\", &n);\n  b = 0;\n  a = n;\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      a = (int)(a / 10);\n      b = b + 1;\n    }\n  }\n  c = n % 10;\n  d = (int)(n / 10) % 10;\n  e = (int)(n / 100) % 10;\n  f = (int)(n / 1000) % 10;\n  g = (int)(n / 10000);\n  switch (b) {\n  case 1:\n    printf(\"%d\\n\", n);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", c, d);\n    break;\n  case 3:\n    cout << c << d << e << \"\\n\";\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", c, d, e, f);\n    break;\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", c, d, e, f, g);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[5];\n  int i, t, k, l;\n  scanf(\"%s\", c);\n  k = strlen(c);\n  l = k / 2;\n  for (i = 0; i < l; i++) {\n    t = c[i];\n    c[i] = c[k - i - 1];\n    c[k - i - 1] = t;\n  }\n  cout << c;\n  return 0;\n}\n"}
{"label": "16", "index": "29912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, q, r, s, t;\n  cin >> n;\n  p = n % 10;\n  n = (n - p) / 10;\n  q = n % 10;\n  n = (n - q) / 10;\n  r = n % 10;\n  n = (n - r) / 10;\n  s = n % 10;\n  n = (n - s) / 10;\n  t = n;\n  if (t != 0)\n    cout << p << q << r << s << t << endl;\n  else {\n    if (s != 0)\n      cout << p << q << r << s << endl;\n    else {\n      if (r != 0)\n        cout << p << q << r << endl;\n      else {\n        if (q != 0)\n          cout << p << q << endl;\n        else\n          cout << p << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29913", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    int b, c;\n    b = a / 10;\n    c = a - 10 * b;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    int b, c, d;\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    int b, c, d, e;\n    b = a / 1000;\n    c = (a - 1000 * b) / 100;\n    d = (a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29914", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char num[5];\n  int i, len;\n  cin >> num;\n\n  len = strlen(num);\n  for (i = len - 1; i >= 0; i--)\n    printf(\"%c\", num[i]);\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[4];\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n\n  if (n / 10 == 0)\n    i = 1;\n  else if (n / 100 == 0)\n    i = 2;\n  else if (n / 1000 == 0)\n    i = 3;\n  else if (n / 10000 == 0)\n    i = 4;\n\n  for (j = i; j >= 1; j--) {\n    a[j - 1] = n / (pow(10, (double)(j - 1)));\n    n = n - pow(10, (double)(j - 1)) * a[j - 1];\n  }\n  for (k = 0; k <= i - 1; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29916", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n;\n  cin >> n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"1\");\n  else {\n    do {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = (n - a) / 10;\n    } while (n >= 10);\n    a = n;\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29917", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int mod;\n\n  if (n == 0) {\n    cout << 0 << endl;\n  } else {\n\n    while (n != 0) {\n      mod = n % 10;\n      cout << mod;\n      n /= 10;\n    }\n  }\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29918", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(int n, int w) {\n  int x;\n  x = (int)pow(10, w - 1);\n  if (w != 1)\n    f(n % x, w - 1);\n  printf(\"%d\", n / x);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int w = (int)(log(n) / log(10)) + 1;\n  f(n, w);\n}\n"}
{"label": "16", "index": "29919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n >= 10000)\n    printf(\"00001\\n\");\n  else if (n >= 1000)\n    printf(\"%d%d%d%d\\n\", n % 10, (n - n % 10) / 10 % 10,\n           (n - n % 100) / 100 % 10, (n - n % 1000) / 1000 % 10);\n  else if (n >= 100) {\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << endl;\n  } else if (n >= 10)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << endl;\n  else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[5];\n  int count = 1;\n  for (int i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    if (n >= 10) {\n      n = (n - a[i]) / 10;\n      count++;\n    }\n  }\n  for (int i = 0; i < count; i++)\n    cout << a[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29921", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, x;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    printf(\"0\");\n  else if (x <= 9)\n    printf(\"%d\", x);\n  else if (x <= 99) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (x <= 999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = (x - 10 * b - a) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x <= 9999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = ((x - 10 * b - a) / 100) % 10;\n    d = (x - 100 * c - 10 * b - a) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else\n    printf(\"00001\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10] = {'\\0'};\n  cin.getline(str, 10);\n  for (int i = strlen(str) - 1; i >= 0; i--)\n    cout << str[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29923", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i = 10;\n  cin >> n;\n  if (n < 10)\n    cout << n << endl;\n  else if (n == 10)\n    cout << 01 << endl;\n  else {\n    while (n > 0) {\n      cout << n % i;\n      n = n / i;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29924", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[5], t;\n  cin >> n;\n  a[0] = n / 1000;\n  a[1] = (n - 1000 * a[0]) / 100;\n  a[2] = (n - 1000 * a[0] - 100 * a[1]) / 10;\n  a[3] = n - 1000 * a[0] - 100 * a[1] - 10 * a[2]; \n  if (n >= 1000) {\n    cout << a[3] << a[2] << a[1] << a[0];\n  } else if (n >= 100 && n < 1000) \n  {\n    cout << a[3] << a[2] << a[1];\n  } else if (n >= 10 && n < 100) {\n    cout << a[3] << a[2];\n  } else if (n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29925", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n <= 10000 && n >= 0) {\n    a = n % 100000 / 10000;\n    b = n % 10000 / 1000;\n    c = n % 1000 / 100;\n    d = n % 100 / 10;\n    e = n % 10;\n    if (a != 0)\n      cout << e << d << c << b << a << \"\\n\";\n    else {\n      if (b != 0)\n        cout << e << d << c << b << endl;\n      else if (c != 0)\n        cout << e << d << c << endl;\n      else if (d != 0)\n        cout << e << d << endl;\n      else\n        cout << e << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  cout << b;\n  c = a / 10;\n  if (c != 0)\n    cout << c % 10;\n  d = a / 100;\n  if (d != 0)\n    printf(\"%d\", d % 10);\n  e = a / 1000;\n  if (e != 0)\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "29927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, q1, q2, q3, q4, q5, r1, r2, r3, r4, r5;\n  scanf(\"%d\", &n);\n  q1 = n / 10;\n  r1 = n % 10;\n\n  if (q1 == 0)\n    printf(\"%d\\n\", r1);\n  else {\n    q2 = q1 / 10;\n    r2 = q1 % 10;\n\n    if (q2 == 0)\n      cout << r1 << r2 << \"\\n\";\n    else {\n      q3 = q2 / 10;\n      r3 = q2 % 10;\n\n      if (q3 == 0)\n        printf(\"%d%d%d\\n\", r1, r2, r3);\n      else {\n        q4 = q3 / 10;\n        r4 = q3 % 10;\n\n        if (q4 == 0)\n          printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n        else {\n          q5 = q4 / 10;\n          r5 = q4 % 10;\n          printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  d = a % 10;\n  b = (a % 1000 - a % 100) / 100;\n  c = (a % 100 - d) / 10;\n  e = (a % 10000 - a % 1000) / 1000;\n  if (a >= 1000)\n    cout << d << c << b << e << \"\\n\";\n  else if (a >= 100) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  } else if (a >= 10)\n    printf(\"%d%d\\n\", d, c);\n  else {\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c[6] = {0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &a);\n  if (a / 10 > 0) {\n    b = a / 10;\n    c[1] = a - 10 * b;\n    c[2] = b;\n    a = b;\n    if (a / 10 > 0) {\n      b = a / 10;\n      c[2] = a - 10 * b;\n      c[3] = b;\n      a = b;\n      if (a / 10 > 0) {\n        b = a / 10;\n        c[3] = a - 10 * b;\n        c[4] = b;\n        a = b;\n        if (a / 10 > 0) {\n          b = a / 10;\n          c[4] = a - 10 * b;\n          c[5] = b;\n          cout << c[1] << c[2] << c[3] << c[4] << c[5];\n        } else\n          printf(\"%d%d%d%d\", c[1], c[2], c[3], c[4]);\n      } else\n        printf(\"%d%d%d\", c[1], c[2], c[3]);\n    } else\n      printf(\"%d%d\", c[1], c[2]);\n  } else {\n    c[1] = a;\n    printf(\"%d\", c[1]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, m, p, q, k, l, s;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    a = 1;\n    printf(\"%05d\", a);\n  } else if (n >= 1000) {\n    s = n % 1000;\n    m = (n - s) / 1000;\n    l = s % 100;\n    p = (s - l) / 100;\n    q = l % 10;\n    k = (l - q) / 10;\n    a = q * 1000 + k * 100 + p * 10 + m;\n    printf(\"%04d\", a);\n  } else if (n >= 100) {\n    s = n % 100;\n    m = (n - s) / 100;\n    l = s % 10;\n    p = (s - l) / 10;\n    a = l * 100 + p * 10 + m;\n    printf(\"%03d\", a);\n  } else if (n >= 10) {\n    s = n % 10;\n    m = (n - s) / 10;\n    a = s * 10 + m;\n    printf(\"%02d\", a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  if (num == 10000)\n    printf(\"00001\\n\");\n  else if (num > 999)\n    printf(\"%d%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10,\n           num / 1000 % 10);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10);\n  else if (num > 9)\n    printf(\"%d%d\\n\", num % 10, num % 100 / 10);\n  else\n    printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "16", "index": "29932", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n % 1000) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"00001\\n\");\n  else if (b != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 1000 + d * 100 + c * 10 + b);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 100 + c * 10 + b);\n    else if (c != 0)\n      printf(\"00%d\\n\", c * 10 + b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (c != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 100 + d * 10 + c);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 10 + c);\n    else\n      printf(\"00%d\\n\", c);\n  } else if (d != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 10 + d);\n    else\n      printf(\"0%d\\n\", d);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = a / 10;\n  d = ((a - b) % 100) / 10;\n  e = a / 100;\n  f = ((a - b - d * 10) % 1000) / 100;\n  g = a / 1000;\n  h = ((a - b - d * 10 - f * 100) % 10000) / 1000;\n  i = a / 10000;\n  if (c < 1) {\n    printf(\"%d\\n\", a);\n  } else {\n    if (e < 1) {\n      printf(\"%d%d\\n\", b, d);\n    } else {\n      if (g < 1) {\n        printf(\"%d%d%d\\n\", b, d, f);\n      } else {\n        printf(\"%d%d%d%d\\n\", b, d, f, h);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "29934", "code": "#include <bits/stdc++.h>\nusing namespace std;\nlong num;\nlong digit[5];\nint main() {\n  int count = 0, i;\n  long number;\n  do {\n    scanf(\"%ld\", &num);\n  } while (num < 0 || num > 99999);\n  count = 0;\n  number = num;\n  do {\n    digit[count++] = number % 10;\n    number = number / 10;\n  } while (number > 0);\n  for (i = 0; i < count; i++)\n    printf(\"%ld\", digit[i]);\n}\n"}
{"label": "16", "index": "29935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 10000);\n  b = (int)((n - a * 10000) / 1000);\n  c = (int)((n - a * 10000 - b * 1000) / 100);\n  d = (int)((n - a * 10000 - b * 1000 - c * 100) / 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29936", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m;\n  m = 1;\n  char s[5];\n  scanf(\"%s\", s);\n  i = strlen(s);\n  i = i - 1;\n  while (i >= 0) {\n    printf(\"%c\", s[i]);\n    i = i - 1;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29937", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, i, a[10];\n  cin >> n;\n  do {\n    a[m] = n % 10;\n    n /= 10;\n    m++;\n  } while (n > 0);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a;\n  cin >> a;\n  if (a == 0)\n    cout << \"0\";\n  while (a > 0) {\n    printf(\"%d\", a % 10);\n    a /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29939", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if ((n >= 1) && (n <= 9))\n    cout << n << endl;\n  if ((n >= 10) && (n < 100)) {\n    int a = n / 10;\n    int b = n % 10;\n    cout << b << a << endl;\n  }\n  if ((n >= 100) && (n <= 999)) {\n    int a = n / 100;\n    int b = (n % 100) / 10;\n    int c = (n % 100) % 10;\n    cout << c << b << a << endl;\n  }\n  if ((n >= 1000) && (n < 9999)) {\n    int a = n / 1000;\n    int b = (n % 1000) / 100;\n    int c = ((n % 1000) % 100) / 10;\n    int d = ((n % 1000) % 100) % 10;\n    cout << d << c << b << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a)\n    printf(\"%d%d%d%d%d \", e, d, c, b, a);\n  else if (b)\n    cout << e << d << c << b << \" \";\n  else if (c)\n    cout << e << d << c;\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29941", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char num[5];\n  int i, len;\n  scanf(\"%s \", num);\n\n  len = strlen(num);\n  for (i = len - 1; i >= 0; i--)\n    printf(\"%c\", num[i]);\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, result;\n  cin >> a;\n  if (a == 10000)\n    cout << \"00001\";\n  else if (a < 10000 && a >= 1000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    result = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%04d\", result);\n  } else if (a < 1000 && a >= 100) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a - b * 100 - c * 10;\n    result = d * 100 + c * 10 + b;\n    printf(\"%03d\", result);\n  } else if (a < 100 && a >= 10) {\n    b = a / 10;\n    c = a - b * 10;\n    result = c * 10 + b;\n    printf(\"%02d\", result);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "29943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int m = 0;\n  int nn = n;\n  for (int i = 1; i < 5; i++) {\n    n = n / 10;\n    if (n == 0) {\n      m = i;\n      break;\n    }\n  }\n  int a;\n  for (int i = 0; i < m; i++) {\n    a = nn % 10;\n    printf(\"%d\", a);\n    nn = nn / 10;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  cin >> n;\n  a = (int)(n / 10000);\n  b = (int)(n / 1000 - a * 10);\n  c = (int)(n / 100 - a * 100 - b * 10);\n  d = (int)(n / 10 - a * 1000 - b * 100 - c * 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  if (a == 0 && b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  if (a == 0 && b == 0 && c != 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  if (a == 0 && b == 0 && c == 0 && d != 0)\n    cout << e << d << \"\\n\";\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29945", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  for (; a != 0; a = (a - (a % 10)) / 10) {\n    b = (a % 10);\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29946", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 1, a, b, c, d, e;\n  char ch;\n  a = b = c = d = e = -1;\n  while ((ch = cin.get()) != '\\n') {\n    switch (i) {\n    case 1:\n      a = ch - '0';\n      break;\n    case 2:\n      b = ch - '0';\n      break;\n    case 3:\n      c = ch - '0';\n      break;\n    case 4:\n      d = ch - '0';\n      break;\n    case 5:\n      e = ch - '0';\n      break;\n    }\n    i++;\n  }\n  if (e == -1 && d != -1)\n    cout << d << c << b << a << endl;\n  else if (e == -1 && d == -1 && c != -1)\n    cout << c << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b != -1)\n    cout << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b == -1 && a != -1)\n    cout << a << endl;\n  else\n    cout << e << d << c << b << a << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "29947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int m = 0;\n  int nn = n;\n  for (int i = 1; i < 5; i++) {\n    n = n / 10;\n    if (n == 0) {\n      m = i;\n      break;\n    }\n  }\n  int a;\n  for (int i = 0; i < m; i++) {\n    a = nn % 10;\n    cout << a;\n    nn = nn / 10;\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  if (n < 10)\n    cout << a;\n  else if (n > 9 && n < 100) {\n    b = n / 10;\n    cout << a << b;\n  } else if (n > 99 && n < 1000) {\n    b = n / 10 % 10;\n    c = n / 100;\n    cout << a << b << c;\n  } else if (n > 999 && n < 10000) {\n    b = n / 10 % 10;\n    c = n / 100 % 10;\n    d = n / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (x >= 10000 && x <= 99999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x >= 1000 && x <= 9999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x >= 100 && x <= 999)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x >= 10 && x <= 99)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, c, d, i, t, j;\n  c = 0;\n  cin >> n;\n  if (n > 0 && n < 10000) {\n    for (i = 4; i >= 1; i--) {\n      b = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      if (b != 0) {\n        j = i;\n        break;\n      }\n    }\n    for (i = 1; i <= j; i++) {\n      d = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      printf(\"%d\", d);\n    }\n  } else if (n == 0)\n    printf(\"0\");\n  else {\n    if (n == 10000)\n      printf(\"00001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n >= 0 && n <= 9)\n    cout << n << endl;\n  else if (n >= 10 && n <= 99) {\n    int a, b;\n    a = n / 10;\n    b = n % 10;\n    cout << b << a << endl;\n  } else if (n >= 100 && n <= 999) {\n    int a, b, c;\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - 100 * a - 10 * b;\n    cout << c << b << a << endl;\n  } else if (n >= 1000 && n <= 9999) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n = 10000) {\n    cout << \"00001\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = a / 10;\n  d = ((a - b) % 100) / 10;\n  e = a / 100;\n  f = ((a - b - d * 10) % 1000) / 100;\n  g = a / 1000;\n  h = ((a - b - d * 10 - f * 100) % 10000) / 1000;\n  i = a / 10000;\n  if (c < 1) {\n    printf(\"%d\\n\", a);\n  } else {\n    if (e < 1) {\n      printf(\"%d%d\\n\", b, d);\n    } else {\n      if (g < 1) {\n        printf(\"%d%d%d\\n\", b, d, f);\n      } else\n        printf(\"%d%d%d%d\\n\", b, d, f, h);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29953", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];    \n  scanf(\"%s\", str); \n  int len = strlen(str);\n  for (int i = len - 1; i >= 0; --i)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\"); \n}\n"}
{"label": "16", "index": "29954", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, k, n, a[10], i = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  while (k > 0) {\n    a[i] = k % 10;\n    k = k / 10;\n    i++;\n    j++;\n  }\n  if (n == 0) {\n    a[0] = 0;\n    j = 1;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "29955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4], b, i;\n  cin >> b;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    for (i = 0; i <= 3; i++)\n      a[i] = b % (int)pow(10, i + 1) / (int)pow(10, i);\n    for (i = 0; i <= 3; i++)\n      if (b >= pow(10, i))\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a - b) / 10 % 10;\n  d = (a - b - 10 * c) / 100 % 10;\n  e = (a - b - 10 * c - 100 * d) / 1000 % 10;\n  f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000 % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\", b);\n  if (a >= 10 && a < 100)\n    printf(\"%d%d\", b, c);\n  if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\", b, c, d);\n  if (a >= 1000 && a < 10000)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  if (a >= 10000)\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  return 0;\n}\n"}
{"label": "16", "index": "29957", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, m = 0;\n  cin >> n;\n  if (n == 0)\n    cout << \"0\" << endl;\n  else {\n    for (int i = 4; i >= 0; i--) {\n      if (floor(n / pow(10.0, i)) != 0) {\n        if (i >= m) {\n          m = i;\n        }\n      }\n    }\n    int p[m + 2], q[m + 1];\n    for (int j = 0; j < m + 2; j++) {\n      p[j] = n % (int)pow(10.0, j);\n    }\n    for (int k = 0; k < m + 1; k++) {\n      q[k] = (p[m + 1 - k] - p[m - k]) / (int)pow(10.0, m - k);\n    }\n    for (int t = 0; t < m + 1; t++) {\n      cout << q[m - t];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, i, a[10];\n  scanf(\"%d\", &n);\n  do {\n    a[m] = n % 10;\n    n /= 10;\n    m++;\n  } while (n > 0);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29959", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a = 10, b = 10, c = 10, d;\n  cin >> n;\n  if (n == 10000)\n    cout << \"1\" << endl;\n  else\n    do {\n      a--;\n    } while ((n - a * 1000 < 0) || (n - a * 1000 >= 1000));\n  n = n - a * 1000;\n  do {\n    b--;\n  } while ((n - b * 100 < 0) || (n - b * 100 >= 100));\n  n = n - b * 100;\n  do {\n    c--;\n  } while ((n - c * 10 < 0) || (n - c * 10 >= 10));\n  n = n - c * 10;\n  d = n;\n  if ((a == 0) && (b == 0) && (c == 0))\n    cout << d << endl;\n  else if ((a == 0) && (b == 0))\n    cout << d << c << endl;\n  else if (a == 0)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else\n    cout << d << c << b << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "29960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *a, *p;\n\n  a = (char *)malloc(1000);\n\n  cin >> a;\n\n  for (p = a; *p != '\u0000'; p++)\n    ;\n  p--;\n  for (; p >= a; p--)\n    printf(\"%c\", *p);\n}\n"}
{"label": "16", "index": "29961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  if (n > 10 && n < 100) {\n    a = n % 10;\n    b = n / 10;\n    n = 10 * a + b;\n    printf(\"%d\", n);\n  }\n  if (n > 100 && n < 1000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n / 100;\n    n = 100 * a + 10 * b + c;\n    printf(\"%d\", n);\n  }\n  if (n > 1000 && n < 10000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = (n % 1000 - 10 * b - a) / 100;\n    d = n / 1000;\n    n = 1000 * a + 100 * b + 10 * c + d;\n    printf(\"%d\", n);\n  }\n  if (n == 10)\n    printf(\"01\");\n  if (n == 100)\n    printf(\"001\");\n  if (n == 1000)\n    printf(\"0001\");\n  if (n == 10000)\n    printf(\"00001\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29962", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z;\n  int a, b, c, d, e;\n  scanf(\"%d\", &z);\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      printf(\"%d%d%d%d\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  cin >> z;\n  return 0;\n}\n"}
{"label": "16", "index": "29963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long x;\n  int y, a, b, c, d, e;\n  scanf(\"%ld\", &x);\n  y = log10(x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  switch (y) {\n  case 0:\n    printf(\"%d\", e);\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n  default:\n    printf(\"0\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if ((a >= 1000) && (a < 9999)) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  if ((a >= 100) && (a < 999)) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    cout << d << c << b;\n  }\n  if\n\n      ((a >= 10) && (a < 99)) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  }\n  if ((a >= 1) && (a < 9))\n    printf(\"%d\", a);\n  if (a == 0)\n    printf(\"0\");\n  if (a == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "29965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, x, y;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = (x - a * 1000) / 100;\n  c = (x - a * 1000 - b * 100) / 10;\n  d = x - a * 1000 - b * 100 - c * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        y = d;\n      else\n        y = d * 10 + c;\n    else\n      y = d * 100 + c * 10 + b;\n  else\n    y = d * 1000 + c * 100 + b * 10 + a;\n  if (d == 0)\n    if (c == 0)\n      if (b == 0)\n        if (a == 0)\n          printf(\"0\");\n        else\n          printf(\"000%d\", y);\n      else\n        printf(\"00%d\", y);\n    else\n      printf(\"0%d\", y);\n  else\n    printf(\"%d\", y);\n}\n"}
{"label": "16", "index": "29966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (int)(a / 10) % 10;\n  d = (int)(a / 100) % 10;\n  e = (int)(a / 1000) % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\\n\", a);\n  else if (a >= 10 && a < 100)\n    printf(\"%d%d\\n\", b, c);\n  else if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\\n\", b, c, d);\n  else\n    printf(\"%d%d%d%d\\n\", b, c, d, e);\n  return 0;\n}\n"}
{"label": "16", "index": "29967", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid p(int num) {\n  while (num) {\n    cout << num % 10;\n    num /= 10;\n  }\n}\nint main() {\n  int l;\n  cin >> l;\n  if (l != 0)\n    p(l);\n  else\n    cout << 0;\n  return 0;\n}\n"}
{"label": "16", "index": "29968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[10000];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--) {\n    printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[5], i, j, b[5], c, d, k;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    cout << x;\n  else {\n    a[1] = x / 10000;\n    a[2] = (x % 10000) / 1000;\n    a[3] = (x % 1000) / 100;\n    a[4] = (x % 100) / 10;\n    a[5] = (x % 10);\n    for (i = 1;; i++) {\n      if (a[i] != 0)\n        break;\n    }\n    c = i;\n    for (i = 5; i >= c; i--)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char exp[10], t;\n  int i, j;\n  cin.getline(exp, 10);\n  for (i = 0, j = strlen(exp) - 1; i < j; i++, j--) {\n    t = exp[i];\n    exp[i] = exp[j];\n    exp[j] = t;\n  }\n  for (i = 0; i < strlen(exp); i++)\n    cout << exp[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "29971", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  while (i) {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n  }\n}\n"}
{"label": "16", "index": "29972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n <= 9 && 0 <= n)\n    cout << n;\n  if (n <= 99 && 10 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    cout << b;\n  }\n  if (n <= 999 && 100 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    printf(\"%d\", b);\n    c = n % 10;\n    cout << c;\n  }\n  if (n <= 9999 && 1000 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    n = n / 10;\n    cout << c;\n    d = n % 10;\n    cout << d;\n  }\n  if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "29973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  if (n > 10 && n < 100) {\n    a = n % 10;\n    b = n / 10;\n    n = 10 * a + b;\n    printf(\"%d\", n);\n  }\n  if (n > 100 && n < 1000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n / 100;\n    n = 100 * a + 10 * b + c;\n    printf(\"%d\", n);\n  }\n  if (n > 1000 && n < 10000) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = (n % 1000 - 10 * b - a) / 100;\n    d = n / 1000;\n    n = 1000 * a + 100 * b + 10 * c + d;\n    printf(\"%d\", n);\n  }\n  if (n == 10)\n    printf(\"01\");\n  if (n == 100)\n    printf(\"001\");\n  if (n == 1000)\n    printf(\"0001\");\n  if (n == 10000)\n    printf(\"00001\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "29974", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, b, c = 11, i = 1, j = 1;\n  cin >> n;\n\n  if (n == 0)\n    printf(\"%d\", n);\n  else\n\n    while (n > 0) {\n\n      b = n % 10;\n      printf(\"%d\", b);\n      n = n / 10;\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29975", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, a, b, c, d, e, place;\n  scanf(\"%ld\", &k);\n  if (k > 9999)\n    place = 5;\n  else if (k > 999)\n    place = 4;\n  else if (k > 99)\n    place = 3;\n  else if (k > 9)\n    place = 2;\n  else\n    place = 1;\n  switch (place) {\n  case 1:\n    printf(\"%d\\n\", k);\n    break;\n  case 2:\n    d = k / 10;\n    e = k - d * 10;\n    printf(\"%d%d\\n\", e, d);\n    break;\n  case 3:\n    c = k / 100;\n    d = (k - c * 100) / 10;\n    e = k - c * 100 - d * 10;\n    printf(\"%d%d%d\\n\", e, d, c);\n    break;\n  case 4:\n    b = k / 1000;\n    c = (k - b * 1000) / 100;\n    d = (k - b * 1000 - c * 100) / 10;\n    e = k - b * 1000 - c * 100 - d * 10;\n    cout << e << d << c << b << \"\\n\";\n    break;\n  case 5:\n    a = k / 10000;\n    b = (k - a * 10000) / 1000;\n    c = (k - a * 10000 - b * 1000) / 100;\n    d = (k - a * 10000 - b * 1000 - c * 100) / 10;\n    e = k - a * 10000 - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long x;\n  int y, a, b, c, d, e;\n  scanf(\"%ld \", &x);\n  y = log10(x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  switch (y) {\n  case 0:\n    cout << e;\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n  default:\n    printf(\"0\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int a[4];\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n / 10 == 0)\n    j = 0;\n  else if (n / 100 == 0)\n    j = 1;\n  else {\n    if (n / 1000 == 0)\n      j = 2;\n    else\n      j = 3;\n  }\n  for (i = j; i >= 0; i--) {\n    a[i] = n / pow(10, (double)i);\n    n = n - pow(10, (double)i) * a[i];\n  }\n  for (k = 0; k <= j; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29978", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10000] = {0}, *start, *end, t;\n  int len;\n  cin >> str;\n  len = strlen(str);\n  start = str;\n  end = &str[len - 1];\n  while (start < end) {\n    t = *start;\n    *start = *end;\n    *end = t;\n    start++;\n    end--;\n  }\n  cout << str;\n  return 0;\n}\n"}
{"label": "16", "index": "29979", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n / 10000 == 1)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    d = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (n / 100 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    c = a % 10;\n    a = a / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (n / 10 != 0) {\n    a = n;\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "29980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  int l;\n\n  cin >> a;\n\n  l = strlen(a);\n\n  for (int i = 0; i < l; i++) {\n    b[i] = a[l - i - 1];\n    printf(\"%c\", b[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, b, c = 11, i = 1, j = 1;\n  scanf(\"%d\", &n);\n\n  if (n == 0)\n    cout << n;\n  else\n\n    while (n > 0) {\n\n      b = n % 10;\n      printf(\"%d\", b);\n      n = n / 10;\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n % 10;\n  printf(\"%d\", a);\n  b = (n - a) / 10;\n  if (b != 0) {\n    b = b % 10;\n    printf(\"%d\", b);\n    c = (n - 10 * b - a) / 100;\n    if (c != 0) {\n      c = c % 10;\n      printf(\"%d\", c);\n      d = (n - 100 * c - 10 * b - a) / 1000;\n      if (d != 0)\n        printf(\"%d\\n\", d);\n    }\n  }\n}\n"}
{"label": "16", "index": "29983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, m;\n  scanf(\"%d\", &n);\n  x = n % 10;\n  y = (n % 100 - n % 10) / 10;\n  z = (n % 1000 - n % 100) / 100;\n  m = n / 1000;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"01\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 10000)\n    printf(\"00001\");\n  else if (n > 10 && n < 100)\n    printf(\"%d%d\", x, y);\n  else if (n > 100 && n < 1000)\n    printf(\"%d%d%d\", x, y, z);\n  else if (n > 1000 && n < 10000)\n    printf(\"%d%d%d%d\", x, y, z, m);\n  return 0;\n}\n"}
{"label": "16", "index": "29984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c[6] = {0, 0, 0, 0, 0, 0};\n  cin >> a;\n  if (a / 10 > 0) {\n    b = a / 10;\n    c[1] = a - 10 * b;\n    c[2] = b;\n    a = b;\n    if (a / 10 > 0) {\n      b = a / 10;\n      c[2] = a - 10 * b;\n      c[3] = b;\n      a = b;\n      if (a / 10 > 0) {\n        b = a / 10;\n        c[3] = a - 10 * b;\n        c[4] = b;\n        a = b;\n        if (a / 10 > 0) {\n          b = a / 10;\n          c[4] = a - 10 * b;\n          c[5] = b;\n          printf(\"%d%d%d%d%d\", c[1], c[2], c[3], c[4], c[5]);\n        } else\n          printf(\"%d%d%d%d\", c[1], c[2], c[3], c[4]);\n      } else\n        printf(\"%d%d%d\", c[1], c[2], c[3]);\n    } else\n      printf(\"%d%d\", c[1], c[2]);\n  } else {\n    c[1] = a;\n    printf(\"%d\", c[1]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29985", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n == 100)\n    printf(\"001\");\n  else if (n >= 1 && n <= 9) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n <= 99) {\n    a = n % 10;\n    b = n / 10;\n    c = a * 10 + b;\n    d = e = 0;\n    printf(\"%d\", c);\n  } else if (n > 100 && n <= 999) {\n    a = n % 100;\n    b = a % 10;\n    c = a / 10;\n    d = n / 100;\n    e = b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else if (n >= 1000 && n <= 9999) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n % 1000 / 100;\n    d = n / 1000;\n    e = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, w;\n  scanf(\"%d\", &n);\n  if (n - 10 < 0)\n    printf(\"%d\", n);\n  else {\n    if (n - 100 < 0) {\n      i = n % 10;\n      j = (n - i) / 10;\n      printf(\"%d%d\", i, j);\n    } else {\n      if (n - 1000 < 0) {\n        i = n % 10;\n        j = ((n - i) / 10) % 10;\n        k = (n - i - 10 * j) / 100;\n        printf(\"%d%d%d\", i, j, k);\n      } else {\n        if (n - 10000 < 0) {\n          i = n % 10;\n          j = ((n - i) % 100) / 10;\n          k = ((n - i - 10 * j) % 1000) / 100;\n          w = (n - i - 10 * j - 100 * k) / 1000;\n          printf(\"%d%d%d%d\", i, j, k, w);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29987", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint b[5], m = 0;\nint f(int n) {\n  int c;\n  if (n == 0)\n    return (0);\n  else {\n    b[m] = n % 10;\n    m++;\n    c = n / 10;\n    return f(c);\n  }\n}\nint main() {\n  int n, i;\n  cin >> n;\n  f(n);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n > 1000 && n < 10000) {\n    a[3] = n / 1000;\n    a[2] = (n % 1000) / 100;\n    a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n    a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n    cout << a[0] * 1000 + a[1] * 100 + a[2] * 10 + a[3] << endl;\n  } else if (n == 100)\n    cout << \"001\";\n  else if (n > 100 && n < 1000) {\n    a[2] = n / 100;\n    a[1] = (n % 100) / 10;\n    a[0] = n - a[2] * 100 - a[1] * 10;\n    printf(\"%d\", a[0] * 100 + a[1] * 10 + a[2]);\n  } else if (n == 10)\n    cout << \"01\";\n  else if (n > 10 && n < 100) {\n    a[1] = n / 10;\n    a[0] = n - a[1] * 10;\n    cout << a[0] * 10 + a[1];\n  } else if (n >= 0 && n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "29989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, m = 1, c, g;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    m = m * 10;\n    if ((n / m) == 0) {\n      c = i;\n      break;\n    }\n  }\n  for (i = 1; i <= c; i++) {\n    g = n % 10;\n    if (g == 0) {\n      cout << \"0\";\n    } else {\n      printf(\"%d\", g);\n    }\n    n = n / 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "29990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "29991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0, j, a[6] = {0};\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  while (n != 0) {\n    a[i++] = n % 10;\n    n /= 10;\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j];\n  return 0;\n}\n"}
{"label": "16", "index": "29992", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b1, b2, b3, b4, b5;\n  cin >> a;\n  b1 = a / 10000;\n  b2 = a / 1000 - 10 * b1;\n  b3 = a / 100 - 100 * b1 - 10 * b2;\n  b4 = a / 10 - 1000 * b1 - 100 * b2 - 10 * b3;\n  b5 = a - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4;\n  if (b1 != 0)\n    printf(\"00001\");\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0) {\n    printf(\"%d%d%d\", b5, b4, b3);\n  } else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "29993", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  cin >> n;\n  int k, count = 0, s = 1;\n  int sum = 0;\n  while (n != 0) {\n    k = n % 10;\n    if (k == 0)\n      count++;\n    n = n / 10;\n    sum = sum * 10 + k;\n  }\n  for (i = 1; i <= count; i++)\n    printf(\"0\");\n  printf(\"%d\", sum);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "29994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (x >= 10000 && x <= 99999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x >= 1000 && x <= 9999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x >= 100 && x <= 999)\n    cout << e << d << c;\n  else if (x >= 10 && x <= 99)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "29995", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n  \n  do {\n    ch[iBits] = iNum % radix; \n    printf(\"%d\", ch[iBits]);\n    iNum /= radix;\n    iBits++;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12]; \n  scanf(\"%d\", &iNum);\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10); \n                                         \n    \n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int num, temp = 0, sub = 0, dv = 10;\n  ;\n  cin >> num;\n  int a, b = 1;\n\n  if (num == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (num != sub) {\n    temp = (num - (num / dv) * dv - sub) / (dv / 10);\n    sub += temp * (dv / 10);\n\n    printf(\"%d\", temp);\n    dv *= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i = 0;\n  int num[5];\n  cin >> n;\n  while (n / 10 != 0) {\n    num[i++] = n % 10;\n    n /= 10;\n  }\n  num[i] = n;\n  for (int m = 0; m <= i; m++)\n    cout << num[m];\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "29998", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s;\n  if (n == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (n != 0) {\n    s = n % 10;\n    n /= 10;\n    printf(\"%d\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "29999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nlong num;\nlong digit[5];\nint main() {\n  int count = 0, i;\n  long number;\n  do {\n    cin >> num;\n  } while (num < 0 || num > 99999);\n  count = 0;\n  number = num;\n  do {\n    digit[count++] = number % 10;\n    number = number / 10;\n  } while (number > 0);\n  for (i = 0; i < count; i++)\n    printf(\"%ld\", digit[i]);\n}\n"}
{"label": "16", "index": "30000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  do {\n    printf(\"%d\", (n % 10));\n    n = (int)n / 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30001", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main(int argc, char *argv[]) {\n  int n, b, c = 11, i = 1, j = 1;\n  scanf(\"%d\", &n);\n\n  if (n == 0)\n    printf(\"%d\", n);\n  else\n\n    while (n > 0) {\n\n      b = n % 10;\n      printf(\"%d\", b);\n      n = n / 10;\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = a / 10;\n  d = ((a - b) % 100) / 10;\n  e = a / 100;\n  f = ((a - b - d * 10) % 1000) / 100;\n  g = a / 1000;\n  h = ((a - b - d * 10 - f * 100) % 10000) / 1000;\n  i = a / 10000;\n  if (c < 1) {\n    printf(\"%d\\n\", a);\n  } else {\n    if (e < 1) {\n      printf(\"%d%d\\n\", b, d);\n    } else {\n      if (g < 1) {\n        printf(\"%d%d%d\\n\", b, d, f);\n      } else\n        printf(\"%d%d%d%d\\n\", b, d, f, h);\n    }\n  }\n}\n"}
{"label": "16", "index": "30003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = x % 100;\n  c = x % 1000;\n  d = x % 10000;\n  e = (b - a) / 10;\n  f = (c - b) / 100;\n  g = (d - c) / 1000;\n  if (x < 10)\n    printf(\"%d\\n\", a);\n  else if (x < 100)\n    printf(\"%d%d\\n\", a, e);\n  else if (x < 1000)\n    printf(\"%d%d%d\\n\", a, e, f);\n  else\n    printf(\"%d%d%d%d\\n\", a, e, f, g);\n  return 0;\n}\n"}
{"label": "16", "index": "30004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n\n  if (a >= 0 && a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    d = b * 10 + c;\n    printf(\"%02d\\n\", d);\n  } else if (a >= 100 && a < 1000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) / 100;\n    e = b * 100 + c + d;\n    printf(\"%03d\\n\", e);\n  } else if (a >= 1000 && a < 10000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) % 1000;\n    e = (a - b - c - d) / 1000;\n    f = b * 1000 + c * 10 + d / 10 + e;\n    printf(\"%04d\\n\", f);\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, i, j;\n  int bit[5];\n  i = 1;\n  cin >> num;\n  if (num == 0) {\n    cout << 0;\n    return 0;\n  }\n  while (num > 0) {\n    bit[i] = num % 10;\n    num = num / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    printf(\"%d\", bit[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "30006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else\n    while (n) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "30007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, e;\n  scanf(\"%d\", &i);\n  a = i / 10000;\n  b = (i - a * 10000) / 1000;\n  c = (i - 10000 * a - 1000 * b) / 100;\n  d = (i - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = i - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  else if (a == 0 && b == 0 && c == 0)\n    cout << e << d << \"\\n\";\n  else if (a == 0 && b == 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  else if (a == 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == a % 10)\n    printf(\"%d\", a);\n  else if (a == a % 100)\n    printf(\"%02d\", a = (a % 100 - a % 10) / 10 + (a % 10) * 10);\n  else if (a == a % 1000)\n    printf(\"%03d\", a = (a % 1000 - a % 100) / 100 + (a % 100 - a % 10) +\n                       (a % 10) * 100);\n  else\n    printf(\"%04d\", a = (a % 10000 - a % 1000) / 1000 +\n                       (a % 1000 - a % 100) / 10 + (a % 100 - a % 10) * 10 +\n                       (a % 10) * 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "30009", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a = 0, b = 0, c = 0, i = 1;\n  cin >> a;\n\n  do {\n    c = a % 10;\n    a = (a - c) / 10;\n    cout << c;\n  } while (a != 0);\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a % 10000 - 10 * c - b - 100 * d;\n    e = e / 1000;\n    f = a - 10 * c - b - 100 * d - 1000 * e;\n    cout << b << c << d << e << f;\n  } else if (a >= 1000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a - 10 * c - b - 100 * d;\n    e = e / 1000;\n\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 100) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a - 10 * c - b;\n    d = d / 100;\n\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 10) {\n    b = a % 10;\n    c = a % 100 - b;\n\n    c = c / 10;\n    d = d / 100;\n    e = e / 100;\n    f = f / 10000;\n\n    printf(\"%d%d\", b, c);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30011", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10) / 1;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10) / 1;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10) / 1;\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[10];\n  int n = 0;\n  while (cin >> ch[n])\n    n++;\n\n  for (int i = n - 1; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30013", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, t;\n  cin >> a;\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n  if (b != 0) {\n    t = f;\n    f = b;\n    b = t;\n    t = e;\n    e = c;\n    c = t;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  } else if (c != 0) {\n    t = f;\n    f = c;\n    c = t;\n    t = e;\n    e = d;\n    d = t;\n    printf(\"%d%d%d%d\", c, d, e, f);\n  } else if (d != 0) {\n    t = f;\n    f = d;\n    d = t;\n    printf(\"%d%d%d\", d, e, f);\n  } else if (e != 0) {\n    t = f;\n    f = e;\n    e = t;\n    printf(\"%d%d\", e, f);\n  } else\n    printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n / 10 < 1)\n    cout << n << endl;\n  else {\n    d = n % 10;\n    n = n / 10;\n    if (n / 10 < 1)\n      cout << d << n << endl;\n    else {\n      c = n % 10;\n      n = n / 10;\n      if (n / 10 < 1)\n        cout << d << c << n << endl;\n      else {\n        b = n % 10;\n        n = n / 10;\n        if (n / 10 < 1)\n          cout << d << c << b << n << endl;\n        else {\n          a = n % 10;\n          n = n / 10;\n          if (n / 10 < 1) {\n            cout << d << c << b << a << n << endl;\n          }\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, i;\n  cin >> n;\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n / 10) % 10;\n  d = n % 10;\n  if (a)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (c)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n}\n"}
{"label": "16", "index": "30016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, g, s, b, q, o = 0, p = 1;\n  cin >> a;\n  if (a == 10000)\n    printf(\"%d%d%d%d%d\\n\", o, o, o, o, p);\n  {\n    if (a <= 10)\n      printf(\"%d\\n\", a);\n    else if (a < 100) {\n      s = (a % 100) / 10;\n      g = a % 10;\n      cout << g << s << \"\\n\";\n    } else if (a < 1000) {\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d\\n\", g, s, b);\n    } else if (a < 10000) {\n      q = (a % 10000) / 1000;\n      b = (a % 1000) / 100;\n      s = (a % 100) / 10;\n      g = a % 10;\n      printf(\"%d%d%d%d\\n\", g, s, b, q);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30017", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a == 0)\n    cout << a;\n  if (a != 0) {\n    for (; a > 0;) {\n      printf(\"%d\", a % 10);\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  while (n > 0) {\n    cout << n % 10;\n    n = n / 10;\n  }\n}\n"}
{"label": "16", "index": "30019", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10000] = {0}, *start, *end, t;\n  int len;\n  cin >> str;\n  len = strlen(str);\n  start = str;\n  end = &str[len - 1];\n  while (start < end) {\n    t = *start;\n    *start = *end;\n    *end = t;\n    start++;\n    end--;\n  }\n  printf(\"%s\", str);\n  return 0;\n}\n"}
{"label": "16", "index": "30020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[10];\n\n  int i;\n  while (cin >> n) {\n    if (n == 0)\n      cout << 0;\n\n    for (i = 1; i <= 5 && n != 0; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n      cout << a[i];\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c[6] = {0, 0, 0, 0, 0, 0};\n  scanf(\"%d\", &a);\n  if (a / 10 > 0) {\n    b = a / 10;\n    c[1] = a - 10 * b;\n    c[2] = b;\n    a = b;\n    if (a / 10 > 0) {\n      b = a / 10;\n      c[2] = a - 10 * b;\n      c[3] = b;\n      a = b;\n      if (a / 10 > 0) {\n        b = a / 10;\n        c[3] = a - 10 * b;\n        c[4] = b;\n        a = b;\n        if (a / 10 > 0) {\n          b = a / 10;\n          c[4] = a - 10 * b;\n          c[5] = b;\n          printf(\"%d%d%d%d%d\", c[1], c[2], c[3], c[4], c[5]);\n        } else\n          printf(\"%d%d%d%d\", c[1], c[2], c[3], c[4]);\n      } else\n        printf(\"%d%d%d\", c[1], c[2], c[3]);\n    } else\n      printf(\"%d%d\", c[1], c[2]);\n  } else {\n    c[1] = a;\n    printf(\"%d\", c[1]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  x = x % 10000;\n  b = x / 1000;\n  x = x % 1000;\n  c = x / 100;\n  x = x % 100;\n  d = x / 10;\n  x = x % 10;\n  e = x;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          y = e;\n          cout << y;\n        } else {\n          y = 10 * e + d;\n          if (e == 0)\n            printf(\"0%d\", y);\n          else\n            printf(\"%d\", y);\n        }\n\n      } else {\n        y = 100 * e + 10 * d + c;\n        if (e == 0) {\n          if (d == 0)\n            cout << \"00\" << y;\n          else\n            printf(\"0%d\", y);\n        } else\n          printf(\"%d\", y);\n      }\n\n    } else {\n      y = 1000 * e + 100 * d + 10 * c + b;\n      if (e == 0) {\n        if (d == 0) {\n          if (c == 0)\n            printf(\"000%d\", y);\n          else\n            printf(\"00%d\", y);\n        } else\n          printf(\"0%d\", y);\n      } else\n        printf(\"%d\", y);\n    }\n\n  } else {\n    y = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    if (e == 0) {\n      if (d == 0) {\n        if (c == 0) {\n          if (b == 0)\n            printf(\"0000%d\", y);\n          else\n            printf(\"000%d\", y);\n        } else\n          printf(\"00%d\", y);\n      } else\n        printf(\"0%d\", y);\n    } else\n      printf(\"%d\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30023", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  char b, c, d, e;\n  cin >> a;\n  b = (int)(a / 1000);\n  c = (int)((a - 1000 * b) / 100);\n  d = (int)(a / 10) - c * 10 - 100 * b;\n  e = a - 10 * d - 100 * c - 1000 * b;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  if (b == 0 && c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  if (a > 9 && a < 100)\n    printf(\"%d%d\", e, d);\n  if (a < 10)\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "30024", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, n, i;\n  scanf(\"%d\", &a);\n  if (a == 0) {\n    printf(\"0\");\n  }\n  n = 0;\n  b = a;\n  while (b != 0) {\n    b = (b / 10);\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i <= n; i++) {\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d\", b);\n  }\n}\n"}
{"label": "16", "index": "30025", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long a;\n  int b, c, d, e, f;\n  scanf(\"%ld \", &a);\n  f = a % 10;\n  a = (int)(a / 10);\n  e = a % 10;\n  a = (int)(a / 10);\n  d = a % 10;\n  a = (int)(a / 10);\n  c = a % 10;\n  a = (int)(a / 10);\n  b = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\\n\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\\n\", f, e);\n  else\n    printf(\"%d\\n\", f, f);\n  return 0;\n}\n"}
{"label": "16", "index": "30026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, i;\n  cin >> a;\n  for (i = 1; i <= 4; i++) {\n    cout << a % 10;\n    a = a / 10;\n    if (a < 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  d = a % 10;                     \n  b = (a % 1000 - a % 100) / 100; \n  c = (a % 100 - d) / 10;         \n  e = (a % 10000 - a % 1000) / 1000;\n  if (a >= 1000)\n    printf(\"%d%d%d%d\\n\", d, c, b, e);\n  else if (a >= 100) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  } else if (a >= 10)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n  return 0;\n}\n"}
{"label": "16", "index": "30028", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    puts(\"00001\");\n  } else if (n >= 1000) {\n    a = n / 1000, b = n / 100 - a * 10, c = n / 10 - a * 100 - b * 10,\n    d = n - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n >= 100) {\n    a = n / 100, b = n / 10 - a * 10, c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n >= 10) {\n    a = n / 10, b = n - 10 * a;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n}\n"}
{"label": "16", "index": "30029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s = 0;\n  cin >> n;\n  if (n % 10 == 0) {\n    if (n == 0)\n      printf(\"\");\n    else {\n      printf(\"0\");\n      for (n = n / 10; n % 10 == 0; n = n / 10) {\n        printf(\"0\");\n      }\n      for (; n >= 1; n = n / 10) {\n        i = n % 10;\n        s = s * 10 + i;\n      }\n    }\n  } else\n    for (; n >= 1; n = n / 10) {\n      i = n % 10;\n      s = s * 10 + i;\n    }\n  cout << s;\n  return 0;\n}\n"}
{"label": "16", "index": "30030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, p, q, r, s, t;\n  cin >> n;\n  p = n % 10;\n  n = (n - p) / 10;\n  q = n % 10;\n  n = (n - q) / 10;\n  r = n % 10;\n  n = (n - r) / 10;\n  s = n % 10;\n  n = (n - s) / 10;\n  t = n;\n  if (t != 0)\n    cout << p << q << r << s << t << endl;\n  else {\n    if (s != 0)\n      cout << p << q << r << s << endl;\n    else {\n      if (r != 0)\n        cout << p << q << r << endl;\n      else {\n        if (q != 0)\n          cout << p << q << endl;\n        else {\n          cout << p << endl;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n\n  if ((n > 9) && (n < 100)) {\n    a = n / 10;\n    b = n % 10;\n    printf(\"%d%d\", b, a);\n  }\n  if ((n > 99) && (n < 1000)) {\n    a = n / 100;\n    b = (n - a * 100) / 10;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (n > 999) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n % 10;\n  a[1] = ((n - a[0]) % 100) / 10;\n  a[2] = ((n - a[0] - a[1]) % 1000) / 100;\n  a[3] = ((n - a[0] - a[1] - a[2]) % 10000) / 1000;\n  a[4] = (n - a[0] - a[1] - a[2] - a[3]) / 10000;\n  if (a[4] != 0)\n    cout << a[0] << a[1] << a[2] << a[3] << a[4] << \"\\n\";\n  if (a[4] == 0 && a[3] != 0)\n    printf(\"%d%d%d%d\\n\", a[0], a[1], a[2], a[3]);\n  if (a[4] + a[3] == 0 && a[2] != 0)\n    printf(\"%d%d%d\\n\", a[0], a[1], a[2]);\n  if (a[4] + a[3] + a[2] == 0 && a[1] != 0)\n    printf(\"%d%d\\n\", a[0], a[1]);\n  if (a[4] + a[3] + a[2] + a[1] == 0)\n    printf(\"%d\\n\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "30033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, c, j, k, t;\n  scanf(\"%d\", &n);\n  i = n;\n  c = 0;\n  j = 0;\n  while (i > 0) {\n    j++;\n    m = i % 10;\n    i /= 10;\n    c = m + c * 10;\n  }\n  i = c;\n  k = 0;\n  while (i > 0) {\n    k++;\n    i = i / 10;\n  }\n  for (t = 1; t <= (j - k); t++)\n    printf(\"0\");\n  cout << c;\n  return 0;\n}\n"}
{"label": "16", "index": "30034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a;\n  a = getchar();\n  if (a <= 57 && a >= 48) {\n    char b;\n    b = getchar();\n    if (b <= 57 && b >= 48) {\n      char c;\n      c = getchar();\n      if (c <= 57 && c >= 48) {\n        char d;\n        d = getchar();\n        if (d <= 57 && d >= 48) {\n          char e;\n          e = getchar();\n          if (e <= 57 && e >= 48)\n            printf(\"%c%c%c%c%c\", e, d, c, b, a);\n          else\n            printf(\"%c%c%c%c\", d, c, b, a);\n        } else\n          printf(\"%c%c%c\", c, b, a);\n      } else\n        printf(\"%c%c\", b, a);\n    } else\n      printf(\"%c\", a);\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30035", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r;\n  cin >> a;\n  r = a % 10;\n  do {\n    printf(\"%d\", r);\n    a = a - r;\n    a = a / 10;\n    r = a % 10;\n  } while (a >= 1);\n  return 0;\n}\n"}
{"label": "16", "index": "30036", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a < 10) {\n    b = a;\n    printf(\"%d\", b);\n  } else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    cout << c << b;\n  } else if (a < 1000) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  a = x % 10;\n  b = (x - a) % 100 / 10;\n  c = (x - a - 10 * b) % 1000 / 100;\n  d = (x - a - 10 * b - 100 * c) % 10000 / 1000;\n  e = (x - a - 10 * b - 100 * c - 1000 * d) % 100000 / 10000;\n  if (e == 1)\n    cout << 1;\n  else if (d != 0)\n    cout << a << b << c << d;\n  else if (d == 0 && c != 0)\n    cout << a << b << c;\n  else if (d == 0 && c == 0 && b != 0)\n    cout << a << b;\n  else if (d == 0 && c == 0 && b == 0)\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[6];\n\n  cin >> a;\n  int i, j;\n  j = strlen(a);\n  for (i = j - 1; i >= 0; i--)\n    cout << a[i];\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30039", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n\n  if (a >= 0 && a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    d = b * 10 + c;\n    printf(\"%02d\\n\", d);\n  } else if (a >= 100 && a < 1000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) / 100;\n    e = b * 100 + c + d;\n    printf(\"%03d\\n\", e);\n  } else if (a >= 1000 && a < 10000) {\n    b = a % 10;\n    c = (a - b) % 100;\n    d = (a - b - c) % 1000;\n    e = (a - b - c - d) / 1000;\n    f = b * 1000 + c * 10 + d / 10 + e;\n    printf(\"%04d\\n\", f);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30040", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 100) {\n    printf(\"001\");\n  } else if (a <= 9)\n    printf(\"%d\", a);\n  else if (a <= 99) {\n    b = a % 10 * 10 + a / 10;\n    printf(\"%d\", b);\n  } else if (a <= 999) {\n    b = a % 10 * 100 + (a / 10) % 10 * 10 + a / 100;\n    cout << b;\n  } else if (a <= 9999) {\n    b = a % 10 * 1000 + (a / 10) % 10 * 100 + (a / 100) % 10 * 10 + a / 1000;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    cout << e << d;\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30042", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, r;\n  cin >> x;\n  a = x % 10;\n  b = (x / 10) % 10;\n  c = (x / 100) % 10;\n  d = (x / 1000) % 10;\n  e = (x / 10000) % 10;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0) {\n        if (b == 0) {\n          r = a;\n          printf(\"%d\\n\", r);\n        } else {\n          r = a * 10 + b;\n          printf(\"%02d\\n\", r);\n        }\n      } else {\n        r = a * 100 + b * 10 + c;\n        printf(\"%03d\\n\", r);\n      }\n    } else {\n      r = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%04d\\n\", r);\n    }\n  } else {\n    r = a * 10000 + b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%05d\\n\", r);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30043", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r1, r2, r3, r4, r5;\n  double b;\n  scanf(\"%d\", &a);\n  b = (double)a / 10000;\n  if (b >= 1) {\n    r5 = a / 10000;\n    r4 = (a - 10000 * r5) / 1000;\n    r3 = (a - 10000 * r5 - 1000 * r4) / 100;\n    r2 = (a - 10000 * r5 - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 10000 * r5 - 1000 * r4 - 100 * r3 - 10 * r2;\n    cout << r1 << r2 << r3 << r4 << r5 << \"\\n\";\n  } else if (b >= 0.1) {\n    r4 = a / 1000;\n    r3 = (a - 1000 * r4) / 100;\n    r2 = (a - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n  } else if (b >= 0.01) {\n    r3 = a / 100;\n    r2 = (a - 100 * r3) / 10;\n    r1 = a - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d\\n\", r1, r2, r3);\n  } else if (b >= 0.001) {\n    r2 = a / 10;\n    r1 = a - 10 * r2;\n    printf(\"%d%d\\n\", r1, r2);\n  } else\n    printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[5], n, i;\n  scanf(\"%d\", &a);\n  if (a != 0) {\n    n = log10(a) + 1;\n    for (i = 0; i <= n - 1; i++)\n      b[i] = (int)(a / pow(10, i)) % 10;\n\n    for (i = 0; i <= n - 1; i++)\n      printf(\"%d\", b[i]);\n\n    printf(\"\\n\");\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30045", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 1000;\n  c = (a - 1000 * b) / 100;\n  d = (a - 1000 * b - 100 * c) / 10;\n  e = a - 1000 * b - 100 * c - 10 * d;\n  if (b > 0)\n    cout << e << d << c << b;\n  else if (b == 0 && c > 0)\n    cout << e << d << c;\n  else if (b == c == 0 && d > 0)\n    cout << e << d;\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number, i, m, x[5];\n  scanf(\"%d\", &number);\n  if (number <= 9)\n    i = 1;\n  else if (number <= 99)\n    i = 2;\n  else if (number <= 999)\n    i = 3;\n  else if (number <= 9999)\n    i = 4;\n  else\n    i = 5;\n  for (m = 0; m <= i - 1; m++) {\n    x[m] = number % 10;\n    number = (number - x[m]) / 10;\n  }\n  for (m = 0; m <= i - 1; m++)\n    printf(\"%d\", x[m]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d \", &a);\n  if (a >= 10000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a % 10000 - 10 * c - b - 100 * d;\n    e = e / 1000;\n    f = a - 10 * c - b - 100 * d - 1000 * e;\n    cout << b << c << d << e << f;\n  } else if (a >= 1000) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a % 1000 - 10 * c - b;\n    d = d / 100;\n    e = a - 10 * c - b - 100 * d;\n    e = e / 1000;\n\n    printf(\"%d%d%d%d\", b, c, d, e);\n  } else if (a >= 100) {\n    b = a % 10;\n    c = a % 100 - b;\n    c = c / 10;\n    d = a - 10 * c - b;\n    d = d / 100;\n\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 10) {\n    b = a % 10;\n    c = a % 100 - b;\n\n    c = c / 10;\n    d = d / 100;\n    e = e / 100;\n    f = f / 10000;\n\n    printf(\"%d%d\", b, c);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, k, n, a[10], i = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  while (k > 0) {\n    a[i] = k % 10;\n    k = k / 10;\n    i++;\n    j++;\n  }\n  if (n == 0) {\n    a[0] = 0;\n    j = 1;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  b = a % 10;\n  printf(\"%d\", b);\n  a = a / 10;\n  if (a != 0) {\n    b = a % 10;\n    cout << b;\n    a = a / 10;\n    if (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n      if (a != 0) {\n        b = a % 10;\n        printf(\"%d\", b);\n        a = a / 10;\n        if (a != 0) {\n          b = a % 10;\n          printf(\"%d\", b);\n          a = a / 10;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5], i, j, t, re = 0, k;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  t = 1;\n  for (i = 0; i < 5; i++) {\n    t = (int)(pow(10, i + 1) + 0.5);\n    a[i] = 10 * (n % t) / t;\n    n = n - a[i] * t / 10;\n  }\n  i = 4;\n  while (a[i] == 0) {\n    i = i - 1;\n  }\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]); \n  \n  \n  return 0;\n}\n"}
{"label": "16", "index": "30051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5] = {0}, n, i, j;\n  cin >> n;\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n  a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  if (n == 0)\n    cout << 0;\n  else\n    for (i = 0; i < 5; i++) {\n      if (a[i] != 0) {\n        for (j = 4; j >= i; j--)\n          printf(\"%d\", a[j]);\n        break;\n      }\n    }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  if (n == 100) {\n    printf(\"001\");\n  } else if (n >= 1 && n <= 9) {\n    cout << n;\n  } else if (n >= 10 && n <= 99) {\n    a = n % 10;\n    b = n / 10;\n    c = a * 10 + b;\n    d = e = 0;\n    printf(\"%d\", c);\n  } else if (n > 100 && n <= 999) {\n    a = n % 100;\n    b = a % 10;\n    c = a / 10;\n    d = n / 100;\n    e = b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else if (n >= 1000 && n <= 9999) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n % 1000 / 100;\n    d = n / 1000;\n    e = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m, *a, i;\n  cin >> n;\n  if (n != 0) {\n    m = floor(log10(n)) + 1;\n    a = (int *)malloc(sizeof(int) * m);\n    for (i = 1; i <= m; i++) {\n      *(a + i - 1) = n % 10;\n      n = (n - *(a + i - 1)) / 10;\n    }\n    for (i = 1; i <= m; i++)\n      cout << *(a + i - 1);\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30054", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          b = 0, c = 0, d = 0, e = 0, f = a;\n        else\n          b = 0, c = 0, d = 0, e = a / 10, f = a - 10 * e;\n      else\n        b = 0, c = 0, d = a / 100, e = (a - d * 100) / 10,\n        f = a - d * 100 - e * 10;\n    else\n      b = 0, c = a / 1000, d = (a - c * 1000) / 100,\n      e = (a - c * 1000 - d * 100) / 10, f = a - c * 1000 - d * 100 - e * 10;\n  else\n    b = a / 10000, c = (a - b * 10000) / 1000,\n    d = (a - b * 10000 - c * 1000) / 100,\n    e = (a - b * 10000 - c * 1000 - d * 100) / 10,\n    f = a - b * 10000 - c * 1000 - d * 100 - e * 10;\n  if (a < 10000)\n    if (a < 1000)\n      if (a < 100)\n        if (a < 10)\n          cout << a << \"\\n\";\n        else\n          printf(\"%d%d\\n\", f, e);\n      else\n        printf(\"%d%d%d\\n\", f, e, d);\n    else\n      printf(\"%d%d%d%d\\n\", f, e, d, c);\n  else\n    printf(\"%d%d%d%d%d\\n\", f, e, d, c, b);\n  return 0;\n}\n"}
{"label": "16", "index": "30055", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10;\n  c = a / 100;\n  d = a / 1000;\n  e = a / 10000;\n  if (e >= 1)\n    f = 5;\n  else if (d >= 1)\n    f = 4;\n  else if (c >= 1)\n    f = 3;\n  else if (b >= 1)\n    f = 2;\n  else\n    f = 1;\n  d = d - 10 * e;\n  c = c - 100 * e - 10 * d;\n  b = b - 1000 * e - 100 * d - 10 * c;\n  a = a - 10000 * e - 1000 * d - 100 * c - 10 * b;\n  switch (f) {\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", a, b, c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", a, b, c);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", a, b);\n    break;\n  case 1:\n    printf(\"%d\\n\", a);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30056", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  scanf(\"%d \", &n);\n  if (n >= 1000) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = (n % 1000) / 100;\n    d = n / 1000;\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\", x);\n  } else if (n >= 100) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = n / 100;\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\", x);\n  } else if (n >= 10) {\n    a = n % 10;\n    b = n / 10;\n    x = a * 10 + b;\n    printf(\"%02d\", x);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a % 10;\n  if (b != 0) {\n\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c != 0) {\n\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d != 0) {\n\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e != 0) {\n\n          printf(\"%d%d\", f, e);\n        } else\n          printf(\"%d\", f);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "30058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[10];\n\nint main() {\n  int x;\n  int k = 0;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    cout << x << endl;\n  else {\n    while (x > 0) {\n      a[k++] = x % 10;\n      x = x / 10;\n    }\n    for (int i = 0; i < k; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  cin >> x;\n  if (x == 10000)\n    printf(\"00001\\n\");\n  else {\n    a = x / 1000;\n    b = (x - a * 1000) / 100;\n    c = (x - a * 1000 - b * 100) / 10;\n    d = x - a * 1000 - b * 100 - c * 10;\n    if (a)\n      cout << d << c << b << a << \"\\n\";\n    else {\n      if (b)\n        printf(\"%d%d%d\\n\", d, c, b);\n      else {\n        if (c)\n          printf(\"%d%d\\n\", d, c);\n        else\n          cout << d << \"\\n\";\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "30060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    if (n <= 99) {\n      a = n % 10;\n      b = n / 10;\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n <= 999) {\n        a = n % 10;\n        c = n / 100;\n        b = (n % 100) / 10;\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n <= 9999) {\n          a = n % 10;\n          b = (n % 100) / 10;\n          c = (n % 1000) / 100;\n          d = n / 1000;\n          cout << a << b << c << d;\n        } else {\n          printf(\"00001\");\n        }\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5] = {0}, n, i, j;\n  scanf(\"%d \", &n);\n  a[0] = n / 10000;\n  a[1] = (n - a[0] * 10000) / 1000;\n  a[2] = (n - 10000 * a[0] - 1000 * a[1]) / 100;\n  a[3] = (n - 10000 * a[0] - 1000 * a[1] - 100 * a[2]) / 10;\n  a[4] = n - a[0] * 10000 - a[1] * 1000 - a[2] * 100 - a[3] * 10;\n  if (n == 0)\n    cout << 0;\n  else\n    for (i = 0; i < 5; i++) {\n      if (a[i] != 0) {\n        for (j = 4; j >= i; j--)\n          cout << a[j];\n        break;\n      }\n    }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30062", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, a, b, c, s, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n <= 9)\n    printf(\"%d\", n);\n  else if (n >= 10 && n <= 99) {\n    m = n / 10;\n    a = n - m * 10;\n    printf(\"%d%d\", a, m);\n  } else if (n >= 100 && n <= 999) {\n    s = n / 100;\n    m = (n - s * 100) / 10;\n    b = n - s * 100 - m * 10;\n    printf(\"%d%d%d\", b, m, s);\n  } else if (n >= 1000 && n <= 9999) {\n    m = n / 10;\n\n    p = n / 1000;\n    s = (n - p * 1000) / 100;\n    b = (n - s * 100 - p * 1000) / 10;\n    c = n - p * 1000 - s * 100 - 10 * b;\n\n    printf(\"%d%d%d%d\", c, b, s, p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  scanf(\"%d\", &t);\n  a = t / 10000;\n  b = (t - a * 10000) / 1000;\n  c = (t - a * 10000 - b * 1000) / 100;\n  d = (t - a * 10000 - b * 1000 - c * 100) / 10;\n  e = t - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\", e);\n  else {\n    if (a == 0 && b == 0 && c == 0 && d != 0)\n      cout << e << d;\n    else {\n      if (a == 0 && b == 0 && c != 0)\n        printf(\"%d%d%d\", e, d, c);\n      else {\n        if (a == 0 && b != 0)\n          cout << e << d << c << b;\n        else {\n          if (a != 0)\n            printf(\"%d%d%d%d%d\", e, d, c, b, a);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, b, c;\n  int d, e, f, g, h, j, k, l, m, i, n;\n  char p[10];\n  scanf(\"%s\", p);\n  for (i = strlen(p) - 1; i >= 0; i--)\n    printf(\"%c\", p[i]);\n  return 7;\n}\n"}
{"label": "16", "index": "30065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int z, a, b, c, d, e;\n  scanf(\"%d\", &z);\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          printf(\"%d\", e);\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      printf(\"%d%d%d%d\", e, d, c, b);\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, t;\n  scanf(\"%d\", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n  if (b != 0) {\n    t = f;\n    f = b;\n    b = t;\n    t = e;\n    e = c;\n    c = t;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  } else if (c != 0) {\n    t = f;\n    f = c;\n    c = t;\n    t = e;\n    e = d;\n    d = t;\n    printf(\"%d%d%d%d\", c, d, e, f);\n  } else if (d != 0) {\n    t = f;\n    f = d;\n    d = t;\n    printf(\"%d%d%d\", d, e, f);\n  } else if (e != 0) {\n    t = f;\n    f = e;\n    e = t;\n    printf(\"%d%d\", e, f);\n  } else\n    printf(\"%d\", f);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30067", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0)\n    cout << a5 << endl;\n  else if (a1 == 0 && a2 == 0 && a3 == 0)\n    cout << a5 << a4 << endl;\n  else if (a1 == 0 && a2 == 0)\n    cout << a5 << a4 << a3 << endl;\n  else if (a1 == 0)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30068", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d\", &a);\n  b = a / 1000;\n  c = a % 1000;\n  d = c / 100;\n  e = a % 100;\n  f = e / 10;\n  g = a % 10;\n\n  if (b == 0) {\n    if (d == 0) {\n      if (f == 0) {\n        printf(\"%d\", g);\n      } else {\n        printf(\"%d%d\", g, f);\n      }\n    } else {\n      printf(\"%d%d%d\", g, f, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", g, f, d, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n  int a;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  while (a > 0) {\n    cout << a % 10;\n    a /= 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30070", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5], i, j, t, re = 0, k;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  t = 1;\n  for (i = 0; i < 5; i++) {\n    t = (int)(pow(10, i + 1) + 0.5);\n    a[i] = 10 * (n % t) / t;\n    n = n - a[i] * t / 10;\n  }\n  i = 4;\n  while (a[i] == 0) {\n    i = i - 1;\n  }\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, s, p;\n  cin >> a;\n  s = a;\n  while (s != 0) {\n    p = s % 10;\n    printf(\"%d\", p);\n    s = (s - p) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n < 100)\n    printf(\"%d%d\", n % 10, n / 10);\n  else if (n < 1000) {\n    a = n / 100;\n    b = n / 10 - 10 * a;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n < 10000) {\n    d = n / 1000;\n    e = n / 100 - 10 * d;\n    f = n / 10 - d * 100 - e * 10;\n    g = n % 10;\n    printf(\"%d%d%d%d\", g, f, e, d);\n  } else\n    cout << \"over\";\n  return 0;\n}\n"}
{"label": "16", "index": "30073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n >= 1000) {\n    int a[4];\n    a[0] = n / 1000;\n    a[1] = (n % 1000) / 100;\n    a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n    a[3] = n - a[0] * 1000 - a[1] * 100 - a[2] * 10;\n    for (i = 3; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 100) {\n    int a[3];\n    a[0] = n / 100;\n    a[1] = (n - a[0] * 100) / 10;\n    a[2] = n - a[0] * 100 - a[1] * 10;\n    for (i = 2; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 10) {\n    int a[2];\n    a[0] = n / 10;\n    a[1] = n - a[0] * 10;\n    for (i = 1; i >= 0; i--)\n      cout << a[i];\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "30074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[10];\n  cin >> n;\n  a[0] = n % 10;\n  a[1] = (n % 100) / 10;\n  a[2] = (n % 1000) / 100;\n  a[3] = (n % 10000) / 1000;\n  if (n < 10 && n >= 0)\n    cout << n;\n  else if (n < 100 && n >= 10)\n    cout << a[0] << a[1];\n  else if (n < 1000 && n >= 100)\n    cout << a[0] << a[1] << a[2];\n  else if (n < 10000 && n >= 1000)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (n == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30075", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, a[5], i, j, b[5], c, d, k;\n  cin >> x;\n  if (x == 0)\n    cout << x;\n  else {\n    a[1] = x / 10000;\n    a[2] = (x % 10000) / 1000;\n    a[3] = (x % 1000) / 100;\n    a[4] = (x % 100) / 10;\n    a[5] = (x % 10);\n    for (i = 1;; i++) {\n      if (a[i] != 0)\n        break;\n    }\n    c = i;\n    for (i = 5; i >= c; i--)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n >= 1000) {\n    int a[4];\n    a[0] = n / 1000;\n    a[1] = (n % 1000) / 100;\n    a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n    a[3] = n - a[0] * 1000 - a[1] * 100 - a[2] * 10;\n    for (i = 3; i >= 0; i--)\n      printf(\"%d\", a[i]);\n  } else if (n >= 100) {\n    int a[3];\n    a[0] = n / 100;\n    a[1] = (n - a[0] * 100) / 10;\n    a[2] = n - a[0] * 100 - a[1] * 10;\n    for (i = 2; i >= 0; i--)\n      cout << a[i];\n  } else if (n >= 10) {\n    int a[2];\n    a[0] = n / 10;\n    a[1] = n - a[0] * 10;\n    for (i = 1; i >= 0; i--)\n      cout << a[i];\n  } else\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "30077", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = (x % 10000) / 1000;\n  c = (x % 1000) / 100;\n  d = (x % 100) / 10;\n  e = x % 10;\n  printf(\"%d\", e);\n  if (d || c || b || a)\n    printf(\"%d\", d);\n  if (c || b || a)\n    printf(\"%d\", c);\n  if (b || a)\n    printf(\"%d\", b);\n  if (a)\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[6];\n  for (i = 0; i < 6; i++) {\n    scanf(\"%c\", &a[i]);\n    if (a[i] == '\\n')\n      break;\n  }\n  for (j = i - 1; j > -1; j--)\n    printf(\"%c\", a[j]);\n}\n"}
{"label": "16", "index": "30079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i;\n  i = 0;\n  char a[9], ch;\n  while ((ch = cin.get()) != '\\n') {\n    a[i] = ch;\n    i = i + 1;\n  }\n  i = i - 1;\n  while (i >= 0) {\n    printf(\"%c\", a[i]);\n    i = i - 1;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if ((n >= 0) && (n <= 9))\n    cout << n;\n  else {\n    do {\n      printf(\"%d\", n % 10);\n      n = n / 10;\n    } while (n / 10 != 0);\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, a, b, c, d, place;\n  cin >> n;\n  if (n >= 1000)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  a = n / 1000;\n  b = (int)(n - a * 1000) / 100;\n  c = (int)(n - a * 1000 - b * 100) / 10;\n  d = (int)n % 10;\n  switch (place) {\n  case 4:\n    cout << d << c << b << a << \"\\n\";\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 1:\n    printf(\"%d\\n\", d);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b1, b, c1, c, d1, d, x, y;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b1 = x % 100;\n  b = b1 / 10;\n  c1 = x % 1000;\n  c = c1 / 100;\n  d1 = x;\n  d = d1 / 1000;\n  if (d != 0) {\n    y = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\\n\", y);\n  } else if ((d == 0) && (c != 0)) {\n    y = a * 100 + b * 10 + c;\n    printf(\"%03d\\n\", y);\n  } else if ((c == 0) && (b != 0)) {\n    y = a * 10 + b;\n    printf(\"%02d\\n\", y);\n  } else {\n    y = a;\n    printf(\"%d\\n\", y);\n  }\n}\n"}
{"label": "16", "index": "30083", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (x > 9999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x > 999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x > 99)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x > 9)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30084", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  int sv[4];\n  cin >> n;\n  if (n == 10000) {\n    cout << \"00001\" << endl;\n  } else if (n / 1000 != 0 && n != 10000 && n >= 1000) {\n    for (i = 0; i < 4; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 4; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 100 != 0 && n >= 100) {\n    for (i = 0; i < 3; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 3; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else if (n / 10 != 0 && n >= 10) {\n    for (i = 0; i < 2; i++) {\n      sv[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 2; i++) {\n      cout << sv[i];\n    }\n    cout << endl;\n  } else {\n    cout << n << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a[5], i, c, n, j;\n  cin >> num;\n  n = 0;\n  for (i = 4; i >= 0; i--) {\n    for (j = 1; j <= i; j++)\n      c *= 10;\n    a[i] = ((num - num % c) / c) % 10;\n    c = 1;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      n = i;\n      break;\n    }\n  }\n  for (i = 0; i <= n; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  x = x % 10000;\n  b = x / 1000;\n  x = x % 1000;\n  c = x / 100;\n  x = x % 100;\n  d = x / 10;\n  x = x % 10;\n  e = x;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          y = e;\n          printf(\"%d\", y);\n        } else {\n          y = 10 * e + d;\n          if (e == 0)\n            printf(\"0%d\", y);\n          else\n            printf(\"%d\", y);\n        }\n\n      } else {\n        y = 100 * e + 10 * d + c;\n        if (e == 0) {\n          if (d == 0)\n            cout << \"00\" << y;\n          else\n            printf(\"0%d\", y);\n        } else\n          printf(\"%d\", y);\n      }\n\n    } else {\n      y = 1000 * e + 100 * d + 10 * c + b;\n      if (e == 0) {\n        if (d == 0) {\n          if (c == 0)\n            printf(\"000%d\", y);\n          else\n            printf(\"00%d\", y);\n        } else\n          printf(\"0%d\", y);\n      } else\n        printf(\"%d\", y);\n    }\n\n  } else {\n    y = 10000 * e + 1000 * d + 100 * c + 10 * b + a;\n    if (e == 0) {\n      if (d == 0) {\n        if (c == 0) {\n          if (b == 0)\n            printf(\"0000%d\", y);\n          else\n            printf(\"000%d\", y);\n        } else\n          printf(\"00%d\", y);\n      } else\n        printf(\"0%d\", y);\n    } else\n      printf(\"%d\", y);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int weishu[5] = {-1, -1, -1, -1, -1}, num, i = 0;\n  cin >> num;\n  do {\n    weishu[i] = num % 10;\n    num = num / 10;\n    i++;\n  } while (num > 0);\n  for (i = 0; i < 5; i++)\n    if (weishu[i] != -1)\n      printf(\"%d\", weishu[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30088", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t[5] = {1, 10, 100, 1000, 10000};\n  int x[6];\n\n  int num;\n  scanf(\"%d \", &num);\n\n  int length;\n  length = (num >= t[4]) + (num >= t[3]) + (num >= t[2]) + (num >= t[1]) +\n           (num >= t[0]);\n  for (int i = 1; i <= length; i++)\n    x[i] = (num % t[i]) / t[i - 1];\n\n  if (length == 0)\n    cout << \"0\";\n  else {\n    for (int j = 1; j <= length; j++) {\n      printf(\"%d\", x[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30089", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, i;\n  cin >> i;\n  if (i / 10 == 0)\n    cout << i << endl;\n\n  if (i / 100 == 0 && i / 10 != 0) {\n    a = i / 10;\n    b = i - a * 10;\n    cout << b << a << endl;\n  }\n  if (i / 1000 == 0 && i / 100 != 0) {\n    a = i / 100;\n    b = (i - a * 100) / 10;\n    c = i - a * 100 - b * 10;\n    cout << c << b << a << endl;\n  }\n  if (i / 10000 == 0 && i / 1000 != 0) {\n    a = i / 1000;\n    b = (i - a * 1000) / 100;\n    c = (i - a * 1000 - b * 100) / 10;\n    d = i - a * 1000 - b * 100 - c * 10;\n    cout << d << c << b << a << \"\\n\";\n  }\n  if (i / 10000 != 0) {\n    a = i / 10000;\n    b = (i - a * 10000) / 1000;\n    c = (i - a * 10000 - b * 1000) / 100;\n    d = (i - a * 10000 - b * 1000 - c * 100) / 10;\n    e = i - a * 10000 - b * 1000 - c * 100 - d * 10;\n    cout << e << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"%d\", a);\n  for (i = 0; i < 5; i++) {\n    if (a != 0)\n      printf(\"%d\", a % 10);\n    a = a / 10;\n  }\n  printf(\" \");\n  return (0);\n}\n"}
{"label": "16", "index": "30091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a % 10;\n  c = (int)(a / 10) % 10;\n  d = (int)(a / 100) % 10;\n  e = (int)(a / 1000) % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\\n\", a);\n  else if (a >= 10 && a < 100)\n    cout << b << c << \"\\n\";\n  else if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\\n\", b, c, d);\n  else\n    printf(\"%d%d%d%d\\n\", b, c, d, e);\n  return 0;\n}\n"}
{"label": "16", "index": "30092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  a = x / 1000;\n  b = x / 100 % 10;\n  c = x / 10 % 10;\n  d = x % 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        printf(\"%d%d\", d, c);\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n}\n"}
{"label": "16", "index": "30093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r;\n  cin >> a;\n  r = a % 10;\n  do {\n    cout << r;\n    a = a - r;\n    a = a / 10;\n    r = a % 10;\n  } while (a >= 1);\n  return 0;\n}\n"}
{"label": "16", "index": "30094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  scanf(\"%d\", &i);\n  do {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n\n  } while (i != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30095", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int i = 0;\n  char c[100];\n\n  char d[100];\n  char e[100];\n\n  cin >> c;\n  n = m = strlen(c);\n  do {\n    d[i] = c[m - 1];\n    m = m - 1;\n    i++;\n  } while (m >= 1);\n  d[n] = 32;\n  sscanf(d, \"%[^ ]\", e);\n  puts(e);\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "16", "index": "30096", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, n, s, i;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  n = 0;\n  b = a;\n  while (b != 0) {\n    b = (b / 10);\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i <= n; i++) {\n    b = a % 10;\n    a = a / 10;\n    printf(\"%d\", b);\n  }\n}\n"}
{"label": "16", "index": "30097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    cout << a;\n  else {\n    while (a / 10 != 0) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d\", c);\n      a = b;\n    }\n    cout << a;\n  }\n}\n"}
{"label": "16", "index": "30098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    cout << n;\n\n  if ((n > 9) && (n < 100)) {\n    a = n / 10;\n    b = n % 10;\n    printf(\"%d%d\", b, a);\n  }\n  if ((n > 99) && (n < 1000)) {\n    a = n / 100;\n    b = (n - a * 100) / 10;\n    c = n % 10;\n    cout << c << b << a;\n  }\n  if (n > 999) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"%d\", n);\n  else {\n    while (n) {\n      cout << n % 10;\n      n /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else if (e != 0)\n    printf(\"%d\", e);\n  else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, f, g, h;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = x % 100;\n  c = x % 1000;\n  d = x % 10000;\n  e = (b - a) / 10;\n  f = (c - b) / 100;\n  g = (d - c) / 1000;\n  if (x < 10)\n    cout << a << \"\\n\";\n  else if (x < 100)\n    cout << a << e << \"\\n\";\n  else if (x < 1000)\n    cout << a << e << f << \"\\n\";\n  else\n    printf(\"%d%d%d%d\\n\", a, e, f, g);\n  return 0;\n}\n"}
{"label": "16", "index": "30102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, s = 0, a, i, j = 0;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\");\n  } else {\n    for (i = 1; i <= 5; i++) {\n      a = n % 10;\n      if (a == 0) {\n        j = j + 1;\n      }\n      n = n / 10;\n      s = s * 10 + a;\n      if (n == 0) {\n        break;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (j == 0) {\n        break;\n      }\n      printf(\"0\");\n    }\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a[4];\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n\n  if (n / 10 == 0)\n    i = 1;\n  else if (n / 100 == 0)\n    i = 2;\n  else if (n / 1000 == 0)\n    i = 3;\n  else if (n / 10000 == 0)\n    i = 4;\n\n  for (j = i; j >= 1; j--) {\n    a[j - 1] = n / (pow(10, (double)(j - 1)));\n    n = n - pow(10, (double)(j - 1)) * a[j - 1];\n  }\n  for (k = 0; k <= i - 1; k++) {\n    cout << a[k];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  scanf(\"%d \", &n);\n  m = (int)(log10(n) + 1);\n  if (n == 0)\n    cout << 0;\n  else {\n    for (i = 1; i <= m; i++) {\n      cout << n % 10;\n      n = (n - n % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30105", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100001];\n  cin >> a;\n  int l = strlen(a), i = 0;\n  for (i = l - 1; i >= 0; i--) {\n    cout << a[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30106", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[4];\n  int n;\n  cin >> n;\n  a[0] = n / 1000;\n  a[1] = (n - a[0] * 1000) / 100;\n  a[2] = (n - a[0] * 1000 - a[1] * 100) / 10;\n  a[3] = n % 10;\n  if (a[0] == 0) {\n    if (a[1] == 0) {\n      if (a[2] == 0) {\n        cout << a[3] << endl;\n      } else\n        printf(\"%d%d\\n\", a[3], a[2]);\n    } else\n      cout << a[3] << a[2] << a[1] << endl;\n  } else\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n % 100) / 10;\n  d = n % 10;\n\n  if (n / 1000 != 0)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (n / 100 != 0)\n    printf(\"%d%d%d\", d, c, b);\n  else if (n / 10 != 0)\n    printf(\"%d%d\", d, c);\n  else\n    printf(\"%d\", d);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int f;\n  cin >> f;\n  if (f == 10000) {\n    printf(\"00001\\n\");\n  } else if (f > 999 && f <= 9999) {\n    int a, b, c, d;\n    a = 1;\n    while (f - a * 1000 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 1000 - b * 100 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 1000 - b * 100 - c * 10 >= 0)\n      c++;\n\n    d = 1;\n    c = c - 1;\n    while (f - a * 1000 - b * 100 - c * 10 - d * 1 >= 0) {\n      d++;\n    }\n    d = d - 1;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (f > 99 && f <= 999) {\n    int a, b, c;\n    a = 1;\n    while (f - a * 100 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 100 - b * 10 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 100 - b * 10 - c * 1 >= 0) {\n      c++;\n    }\n    c = c - 1;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (f > 9 && f <= 99) {\n    int a, b;\n    a = 1;\n    while (f - a * 10 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 10 - b * 1 >= 0) {\n      b++;\n    }\n    b = b - 1;\n    cout << b << a;\n  } else {\n    printf(\"%d\", f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[5], b = 0;\n  do {\n    a[b] = getchar();\n    b++;\n  } while (b < 5);\n  if (a[1] == '\\n')\n    printf(\"%c\", a[0]);\n  else if (a[2] == '\\n')\n    printf(\"%c%c\", a[1], a[0]);\n  else if (a[3] == '\\n')\n    printf(\"%c%c%c\", a[2], a[1], a[0]);\n  else if (a[4] == '\\n')\n    printf(\"%c%c%c%c\", a[3], a[2], a[1], a[0]);\n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[10000];\n  scanf(\"%s\", str);\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  getchar();\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  scanf(\"%d \", &n);\n  m = (int)(log10(n) + 1);\n  if (n == 0) {\n    cout << 0;\n  } else {\n    for (i = 1; i <= m; i++) {\n      printf(\"%d\", n % 10);\n      n = (n - n % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\\n\");\n    return 0;\n  }\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 1; j <= i - 1; j++)\n    cout << a[j];\n\n  return 0;\n}\n"}
{"label": "16", "index": "30113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e;\n  scanf(\"%d\", &num);\n  a = num / 10000;\n  b = num % 10000 / 1000;\n  c = num % 1000 / 100;\n  d = num % 100 / 10;\n  e = num % 10;\n  if (num / 10000 == 1)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (num / 1000 != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (num / 100 != 0) {\n    printf(\"%d%d%d\", e, d, c);\n  } else if (num / 10 != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30114", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a, b, c, d, g;\n  scanf(\"%d \", &i);\n  if ((i >= 10) && (i < 100)) {\n    a = i / 1000;\n    b = i % 10;\n    g = 10 * b + a;\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i > 0) && (i < 10)) {\n    g = i;\n    printf(\"%d\", i);\n  }\n  if ((i >= 100) && (i < 1000)) {\n    a = i / 100;\n    b = (i / 10) % 10;\n    c = i % 10;\n    g = 100 * c + 10 * b + a;\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n  if ((i >= 1000) && (i < 10000)) {\n\n    a = i / 1000;\n    b = (i / 100) % 10;\n    c = (i / 10) % 10;\n    d = i % 10;\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n;\n  scanf(\"%d\", &a);\n  if (a >= 0 && a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10, c = a / 10;\n    putchar(b);\n    putchar(c);\n  } else if (a >= 100 && a <= 999) {\n    d = a % 10, e = a / 10, f = e % 10, g = e / 10;\n    printf(\"%d%d%d\", d, f, g);\n  } else if (a >= 1000 && a <= 9999) {\n    h = a / 10, i = h / 10, j = i / 10, k = i % 10, l = h % 10, m = a % 10;\n    printf(\"%d%d%d%d\", m, l, k, j);\n  }\n}\n"}
{"label": "16", "index": "30116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  while (scanf(\"%d\", &N) != EOF)\n    if (N) {\n      i = t = n = 0;\n      while (N % (1 * e(i)) != N) {\n        a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n        i++;\n      }\n      while (t <= i - 1) {\n        printf(\"%d\", a[t]);\n        t++;\n      }\n      printf(\"\\n\");\n    } else\n      cout << \"0\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  int n_1 = 0, i = 0;\n  int len = 0;\n  int a[6] = {0};\n  scanf(\"%d\", &n);\n  n_1 = n;\n  for (; n / 10 > 0;) {\n    n = n / 10;\n    len++;\n  }\n  len++;\n  for (i = 0; i < len; i++) {\n    a[i] = n_1 % 10;\n    n_1 = n_1 / 10;\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%d\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "30118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  long int n;\n  int indiv, ten, hundred, thousand, place;\n  scanf(\"%ld\", &n);\n  if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  thousand = n / 1000;\n  hundred = (int)(n - thousand * 1000) / 100;\n  ten = (int)(n - thousand * 1000 - hundred * 100) / 10;\n  indiv = (int)(n - thousand * 1000 - hundred * 100 - ten * 10);\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\", indiv, ten);\n    break;\n  case 1:\n    cout << indiv;\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30119", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, x;\n  cin >> x;\n  if (x == 0)\n    printf(\"0\");\n  else if (x <= 9)\n    printf(\"%d\", x);\n  else if (x <= 99) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (x <= 999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = (x - 10 * b - a) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x <= 9999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = ((x - 10 * b - a) / 100) % 10;\n    d = (x - 100 * c - 10 * b - a) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else\n    printf(\"00001\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  cin >> n;\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    if (n <= 99) {\n      a = n % 10;\n      b = n / 10;\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n <= 999) {\n        a = n % 10;\n        c = n / 100;\n        b = (n % 100) / 10;\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n <= 9999) {\n          a = n % 10;\n          b = (n % 100) / 10;\n          c = (n % 1000) / 100;\n          d = n / 1000;\n          cout << a << b << c << d;\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a / 10000 == 0) {\n    if (a / 1000 == 0) {\n      if (a / 100 == 0) {\n        if (a / 10 == 0)\n          printf(\"%d\\n\", a);\n        else {\n          b = a % 10;\n          c = a / 10;\n          printf(\"%d%d\\n\", b, c);\n        }\n      } else {\n        c = a / 100;\n        d = (a - c * 100) / 10;\n        b = (a - c * 100) % 10;\n        printf(\"%d%d%d\\n\", b, d, c);\n      }\n    } else {\n      b = a / 1000;\n      c = (a - b * 1000) / 100;\n      d = (a - b * 1000 - c * 100) / 10;\n      e = (a - b * 1000 - c * 100) % 10;\n      printf(\"%d%d%d%d\\n\", e, d, c, b);\n    }\n  } else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10001], n, i, x;\n  char ch;\n  n = 0;\n  while ((ch = cin.get()) != '\\n') {\n    a[n] = ch - '0';\n    n++;\n  }\n  for (i = 0; i < n / 2; i++) {\n    x = a[i];\n    a[i] = a[n - i - 1];\n    a[n - i - 1] = x;\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[5] = {0}, flag[5] = {0};\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  if (n != 0) {\n    for (i = 0; i < 5; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 5; i++) {\n      for (j = i; j < 5; j++) {\n        flag[i] = flag[i] + a[j]; \n      }\n    }\n    for (i = 0; i < 5; i++) {\n      if (flag[i] != 0)\n        cout << a[i];\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int indiv, ten, hundred, thousand, ten_thousand, place;\n  cin >> n;\n  if (n > 9999)\n    place = 5;\n  else if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  ten_thousand = (int)(n / 10000);\n  thousand = (int)((n - ten_thousand * 10000) / 1000);\n  hundred = (int)((n - 10000 * ten_thousand - 1000 * thousand) / 100);\n  ten =\n      (int)((n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred) / 10);\n  indiv = (int)(n - 10000 * ten_thousand - 1000 * thousand - 100 * hundred -\n                10 * ten);\n  switch (place) {\n  case 5:\n    cout << indiv << ten << hundred << thousand << ten_thousand << \"\\n\";\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\\n\", indiv);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30125", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d\", &a);\n  if (a < 10 && a >= 0)\n    printf(\"%d\", a);\n  else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%.2d\", b * 10 + c);\n  } else if (a > 99 && a < 1000) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    printf(\"%.3d\", b * 100 + c * 10 + d);\n  } else if (a > 999 && a < 10001) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - c * 10) / 100) % 10;\n    f = ((a - b - c * 10 - d * 100) / 1000) % 10;\n    printf(\"%.4d\", b * 1000 + c * 100 + d * 10 + f);\n  } else\n    return 0;\n}\n"}
{"label": "16", "index": "30126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  d = a % 10;\n  b = (a % 1000 - a % 100) / 100;\n  c = (a % 100 - d) / 10;\n  e = (a % 10000 - a % 1000) / 1000;\n  if (a >= 1000)\n    printf(\"%d%d%d%d\\n\", d, c, b, e);\n  else if (a >= 100) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  } else if (a >= 10)\n    printf(\"%d%d\\n\", d, c);\n  else {\n    printf(\"%d\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30127", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint num[10];\nint main() {\n  int i, t = 0;\n  memset(num, -1, sizeof(num));\n  cin >> n;\n  int x = n;\n  num[0] = 0;\n  while (n > 0) {\n    num[t] = n % 10;\n    n -= n % 10;\n    n /= 10;\n    t++;\n  }\n  for (i = 0; i < t; ++i) {\n    printf(\"%d\", num[i]);\n  }\n  if (x == 0)\n    cout << 0;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, z, y;\n  cin >> a;\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    z = a % 100;\n    c = z / 10;\n    d = z % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    z = a % 1000;\n    c = z / 100;\n    y = z % 100;\n    d = y / 10;\n    e = y % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, y;\n  scanf(\"%d\", &x);\n  if (x >= 1000) {\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    y = d * 1000 + c * 100 + b * 10 + a;\n    printf(\"%04d\", y);\n  }\n  if (x >= 100 && x < 1000) {\n    a = x / 100;\n    b = (x - 100 * a) / 10;\n    c = x - 100 * a - 10 * b;\n    y = c * 100 + b * 10 + a;\n    printf(\"%03d\", y);\n  }\n  if (x >= 10 && x < 100) {\n    a = x / 10;\n    b = x - a * 10;\n    y = b * 10 + a;\n    printf(\"%02d\", y);\n  }\n  if (x < 10)\n    printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "16", "index": "30130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m, a[5];\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  else {\n    {\n      for (i = 0; n > 0; i++) {\n        a[i] = n % 10;\n        n = n / 10;\n      }\n    }\n    m = i;\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  float a, b, c;\n  int i;\n  char p[10];\n  scanf(\"%s\", p);\n  for (i = strlen(p) - 1; i >= 0; i--)\n    printf(\"%c\", p[i]);\n  return 7;\n}\n"}
{"label": "16", "index": "30132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int n, a, b, c, d;\n  cin >> n;\n  if ((n >= 0) && (n <= 9))\n    printf(\"%d\", n);\n  else if ((n >= 10) && (n <= 99)) {\n    a = n % 10;\n    b = (n - (n % 10)) / 10;\n    cout << a << b;\n  } else if ((n >= 100) && (n <= 999)) {\n    a = n % 10;\n    b = ((n - a) % 100) / 10;\n    c = (n - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if ((n >= 1000) && (n <= 9999)) {\n    a = n % 10;\n    b = ((n - a) / 10) % 10;\n    c = ((n - a - 10 * b) / 100) % 10;\n    d = (n - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  cin >> x;\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = x / 1000;\n  if (x > 999 && x < 10000)\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  else if (x > 99 && x < 1000)\n    printf(\"%d%d%d\\n\", a, b, c);\n  else if (x > 9 && x < 100)\n    printf(\"%d%d\\n\", a, b);\n  else if (x > 0 && x < 10)\n    printf(\"%d\\n\", a);\n  else if (x == 0)\n    printf(\"0\\n\");\n  else if (x == 10000)\n    printf(\"00001\\n\");\n}\n"}
{"label": "16", "index": "30134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int n, a, b, c, d, place;\n  cin >> n;\n  if (n >= 1000)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  a = n / 1000;\n  b = (int)(n - a * 1000) / 100;\n  c = (int)(n - a * 1000 - b * 100) / 10;\n  d = (int)n % 10;\n  switch (place) {\n  case 4:\n    cout << d << c << b << a << \"\\n\";\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", d, c, b);\n    break;\n  case 2:\n    cout << d << c << \"\\n\";\n    break;\n  case 1:\n    printf(\"%d\\n\", d);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n <= 10000 && n >= 0) {\n    a = n % 100000 / 10000;\n    b = n % 10000 / 1000;\n    c = n % 1000 / 100;\n    d = n % 100 / 10;\n    e = n % 10;\n    if (a != 0)\n      printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n    else if (b != 0)\n      cout << e << d << c << b << endl;\n    else if (c != 0)\n      cout << e << d << c << endl;\n    else if (d != 0)\n      cout << e << d << endl;\n    else\n      cout << e << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, an[10];\n  scanf(\"%d\", &n);\n  int j = 0;\n  for (i = n; i > 0; i = i / 10) {\n    an[j] = i % 10;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%d\", an[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int a, i;\n  scanf(\"%d\", &a);\n  for (i = 1; i <= 4; i++) {\n    cout << a % 10;\n    a = a / 10;\n    if (a < 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30138", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i, j;\n  cin >> n;\n  a = n % 10;\n  e = n - a;\n  f = e / 10;\n  b = f % 10;\n  g = n - 10 * b - a;\n  h = g / 100;\n  c = h % 10;\n  i = n - 100 * c - 10 * b - a;\n  j = i / 1000;\n  d = j % 10;\n  if (d == 0) {\n    if (c == 0) {\n      if (b == 0)\n        printf(\"%d\", a);\n      else\n        printf(\"%d%d\", a, b);\n    } else {\n      printf(\"%d%d%d\", a, b, c);\n    }\n  } else\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "30139", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a < 10) {\n    b = a;\n    c = 0;\n    d = 0;\n    e = 0;\n    printf(\"%d\", b);\n  } else {\n    if (a < 100) {\n      b = a / 10;\n      c = a % 10;\n      d = 0;\n      e = 0;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a < 1000) {\n        b = a / 100;\n        c = (a % 100) / 10;\n        d = a % 10;\n        e = 0;\n        printf(\"%d%d%d\", d, c, b);\n      } else {\n        if (a < 10000) {\n          b = a / 1000;\n          c = (a % 1000) / 100;\n          d = (a % 100) / 10;\n          e = a % 10;\n          printf(\"%d%d%d%d\", e, d, c, b);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[5], b = 0;\n  do {\n    a[b] = getchar();\n    b++;\n  } while (b < 5);\n  if (a[1] == '\\n')\n    cout << a[0];\n  else if (a[2] == '\\n')\n    cout << a[1] << a[0];\n  else if (a[3] == '\\n')\n    printf(\"%c%c%c\", a[2], a[1], a[0]);\n  else if (a[4] == '\\n')\n    printf(\"%c%c%c%c\", a[3], a[2], a[1], a[0]);\n  else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  int n, i;   \n  cin >> n;   \n  if (n == 0) \n    cout << 0;\n\n  else\n    for (i = 1;; i++) \n    {\n      static int k; \n      if (i == 1)   \n        k = 10;\n      else\n        k *= 10;\n      if (n < k / 10) \n        break;        \n      else {\n        int c = n % k;        \n        cout << c / (k / 10); \n      }\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, n = 0, i = 0, j = n - 1;\n  cin >> a;\n  if (a == 0)\n    cout << \"0\";\n  else if (a != 0) {\n    while (a >= pow(10, n))\n      n = n + 1;\n    int c[10] = {0};\n    for (i = 0; i <= n - 1; i++)\n      c[i] = a % (int)(pow(10, i + 1));\n    for (i = 0; i <= n - 1; i++)\n      c[i] = c[i] / pow(10, i);\n    for (i = 0; i <= n - 1; i++)\n      cout << c[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint num[10];\nint main() {\n  int i, t = 0;\n  memset(num, -1, sizeof(num));\n  scanf(\"%d \", &n);\n  int x = n;\n  num[0] = 0;\n  while (n > 0) {\n    num[t] = n % 10;\n    n -= n % 10;\n    n /= 10;\n    t++;\n  }\n  for (i = 0; i < t; ++i)\n    cout << num[i];\n\n  if (x == 0)\n    cout << 0;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30144", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n, a[5];\n  cin >> n;\n  i = 1;\n  if (n == 0)\n    printf(\"0\");\n  while (n > 0) {\n    a[i] = n % 10;\n    n = n / 10;\n    i = i + 1;\n  }\n  for (j = 1; j < i; j++)\n    printf(\"%d\", a[j]);\n  return 0;\n}\n"}
{"label": "16", "index": "30145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    cout << n;\n  else\n    while (n) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "30146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[5] = {0}, flag[5] = {0};\n  cin >> n;\n  if (n == 0)\n    cout << 0;\n  if (n != 0) {\n    for (i = 0; i < 5; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 5; i++) {\n      for (j = i; j < 5; j++) {\n        flag[i] = flag[i] + a[j];\n      }\n    }\n    for (i = 0; i < 5; i++) {\n      if (flag[i] != 0)\n        printf(\"%d\", a[i]);\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30147", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[1] = n / 10000;\n  a[2] = (n - a[1] * 10000) / 1000;\n  a[3] = (n - a[1] * 10000 - a[2] * 1000) / 100;\n  a[4] = (n - a[1] * 10000 - a[2] * 1000 - a[3] * 100) / 10;\n  a[5] = n - a[1] * 10000 - a[2] * 1000 - a[3] * 100 - a[4] * 10;\n  if (a[1] != 0)\n    printf(\"%d%d%d%d%d\", a[5], a[4], a[3], a[2], a[1]);\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d%d\", a[5], a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        printf(\"%d%d%d\", a[5], a[4], a[3]);\n      else {\n        if (a[4] != 0)\n          printf(\"%d%d\", a[5], a[4]);\n        else {\n          if (a[5] != 0)\n            printf(\"%d\", a[5]);\n          else\n            printf(\"0\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30148", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5], i, m;\n  scanf(\"%d \", &n);\n  a[0] = n % 10;\n  a[1] = (n / 10) % 10;\n  a[2] = (n / 100) % 10;\n  a[3] = (n / 1000) % 10;\n  a[4] = (n / 10000) % 10;\n\n  if (n == 0)\n    printf(\"%d\", 0);\n  else {\n    i = 4;\n    while (a[i] == 0) {\n      m = i;\n      i--;\n    }\n    for (i = 0; i < m; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30149", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, a[6];\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  else\n    while (n > 0) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      cout << a[i];\n      i++;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "30150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  int b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a == 10000)\n    printf(\"00001\");\n  b = a / 1000;\n  c = (a - b * 1000) / 100;\n  d = (a - b * 1000 - c * 100) / 10;\n  e = a - b * 1000 - c * 100 - d * 10;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else {\n    if (c != 0)\n      printf(\"%d%d%d\", e, d, c);\n    else {\n      if (d != 0)\n        printf(\"%d%d\", e, d);\n      else\n        printf(\"%d\", e);\n    }\n  }\n}\n"}
{"label": "16", "index": "30151", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int n, a, b, c, d, place;\n  scanf(\"%d\", &n);\n  if (n >= 1000)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  a = n / 1000;\n  b = (int)(n - a * 1000) / 100;\n  c = (int)(n - a * 1000 - b * 100) / 10;\n  d = (int)n % 10;\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 1:\n    printf(\"%d\\n\", d);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint print(int n);\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  print(n);\n  return 0;\n}\nint print(int n) {\n  int s, a, b;\n  a = n;\n  s = 0;\n  if (a == 0)\n    printf(\"0\");\n  else {\n    while (a > 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, *a, i;\n  scanf(\"%d\", &n);\n  if (n != 0) {\n    m = floor(log10(n)) + 1;\n    a = (int *)malloc(sizeof(int) * m);\n    for (i = 1; i <= m; i++) {\n      *(a + i - 1) = n % 10;\n      n = (n - *(a + i - 1)) / 10;\n    }\n    for (i = 1; i <= m; i++)\n      printf(\"%d\", *(a + i - 1));\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  cin >> a;\n  for (; a != 0; a = (a - (a % 10)) / 10) {\n    b = (a % 10);\n    cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p;\n  p = (char *)malloc(sizeof(char) * 8);\n  int i;\n  for (i = 0; i < 6; i++) {\n    scanf(\"%c\", p);\n    if (*p == '\\n') {\n      *p = 0;\n      break;\n    }\n    p++;\n  }\n  for (i = i - 1; i >= 0; i--) {\n    p--;\n    printf(\"%c\", *p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[101];\n  cin >> str;\n  int len = strlen(str);\n  for (int i = len - 1; i >= 0; --i)\n    cout << str[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  if (a != 0) {\n    b = n / 100 - 10 * a;\n    c = n / 10 - 100 * a - 10 * b;\n    d = n - 1000 * a - 100 * b - 10 * c;\n    cout << d << c << b << a << endl;\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    c = n / 10 - b * 10;\n    d = n - 100 * b - 10 * c;\n    cout << d << c << b << endl;\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - c * 10;\n    printf(\"%d%d\\n\", d, c);\n  } else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[4]; \n  cin >> n;    \n  if (n == 10000)\n    cout << \"00001\" << endl; \n  else {\n    a[1] = n / 1000;                            \n    a[2] = (n - 1000 * a[1]) / 100;             \n    a[3] = (n - 1000 * a[1] - 100 * a[2]) / 10; \n    a[4] = (n - 1000 * a[1] - 100 * a[2] - 10 * a[3]);\n  } \n  if (a[1] != 0)\n    cout << a[4] << a[3] << a[2] << a[1] << endl; \n  else {\n    if (a[2] != 0)\n      cout << a[4] << a[3] << a[2] << endl;\n    else {\n      if (a[3] != 0)\n        cout << a[4] << a[3] << endl;\n      else\n        cout << a[4] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x, y = 0;\n  scanf(\"%d \", &a);\n  if (a < 10) {\n    printf(\"%d\", a);\n  } else if (a == 10) {\n    b = 0;\n    c = 1;\n    printf(\"%d%d\", b, c);\n  } else if (a > 10 && a < 100) {\n    b = a / 10;\n    c = a - b * 10;\n    x = c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 100) {\n    b = 1;\n    cout << y << y << b;\n  } else if (a > 100 && a < 1000) {\n    b = a / 100;\n    c = (a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    x = d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 1000) {\n    b = 1;\n    printf(\"%d%d%d%d\", y, y, y, b);\n  } else if (a > 1000 && a < 10000) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = a - b * 1000 - c * 100 - d * 10;\n    x = e * 1000 + d * 100 + c * 10 + b;\n    printf(\"%d\", x);\n  } else if (a == 10000) {\n    b = 1;\n    printf(\"%d%d%d%d%d\", y, y, y, y, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << n << endl;\n  else {\n    for (i = 1;; i++) {\n      a = n / 10;\n      b = n - (a * 10);\n      if (a == 0 && b == 0)\n        break;\n      cout << b;\n      n = a;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30161", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, t;\n  scanf(\"%d \", &n);\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    x = n % 10;\n    if (n <= 99) {\n      y = (n - x) / 10;\n      printf(\"%d%d\", x, y);\n    } else {\n      y = ((n - x) / 10) % 10;\n      t = x + 10 * y;\n      if (n <= 999) {\n        z = (n - t) / 100;\n        printf(\"%d%d%d\", x, y, z);\n      } else {\n        z = ((n - t) / 100) % 10;\n        t = x + 10 * y + 100 * z;\n        if (n <= 9999) {\n          w = (n - t) / 1000;\n          printf(\"%d%d%d%d\", x, y, z, w);\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  if (n == 100) {\n    printf(\"001\");\n  } else if (n >= 1 && n <= 9) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n <= 99) {\n    a = n % 10;\n    b = n / 10;\n    c = a * 10 + b;\n    d = e = 0;\n    printf(\"%d\", c);\n  } else if (n > 100 && n <= 999) {\n    a = n % 100;\n    b = a % 10;\n    c = a / 10;\n    d = n / 100;\n    e = b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else if (n >= 1000 && n <= 9999) {\n    a = n % 10;\n    b = (n % 100 - a) / 10;\n    c = n % 1000 / 100;\n    d = n / 1000;\n    e = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%d\", e);\n  } else {\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30163", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i;\n  cin >> i;\n  while (i) {\n    printf(\"%d\", i % 10);\n    i = i / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30164", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a < 10)\n    cout << a5 << endl;\n  else if (a < 100)\n    cout << a5 << a4 << endl;\n  else if (a < 1000)\n    printf(\"%d%d%d\\n\", a5, a4, a3);\n  else if (a < 10000)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, s = 0, a, i, j = 0;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\");\n  } else {\n    for (i = 1; i <= 5; i++) {\n      a = n % 10;\n      if (a == 0) {\n        j = j + 1;\n      }\n      n = n / 10;\n      s = s * 10 + a;\n      if (n == 0) {\n        break;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (j == 0) {\n        break;\n      }\n      printf(\"0\");\n    }\n    cout << s;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n / 10 == 0) {\n    a[0] = n;\n    cout << a[0] << endl;\n  } else if (n / 100 == 0) {\n    a[0] = n / 10;\n    a[1] = n % 10;\n    cout << a[1] << a[0] << endl;\n  } else if (n / 1000 == 0) {\n    a[0] = n / 100;\n    a[1] = n % 100 / 10;\n    a[2] = n % 100 % 10;\n    cout << a[2] << a[1] << a[0] << endl;\n  } else if (n / 10000 == 0) {\n    a[0] = n / 1000;\n    a[1] = n % 1000 / 100;\n    a[2] = n % 1000 % 100 / 10;\n    a[3] = n % 1000 % 100 % 10;\n    cout << a[3] << a[2] << a[1] << a[0] << endl;\n  } else if (n = 10000)\n    printf(\"1\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  long int n;\n  int indiv, ten, hundred, thousand, place;\n  scanf(\"%ld\", &n);\n  if (n > 999)\n    place = 4;\n  else if (n > 99)\n    place = 3;\n  else if (n > 9)\n    place = 2;\n  else\n    place = 1;\n  thousand = n / 1000;\n  hundred = (int)(n - thousand * 1000) / 100;\n  ten = (int)(n - thousand * 1000 - hundred * 100) / 10;\n  indiv = (int)(n - thousand * 1000 - hundred * 100 - ten * 10);\n  switch (place) {\n  case 4:\n    printf(\"%d%d%d%d\", indiv, ten, hundred, thousand);\n    break;\n  case 3:\n    printf(\"%d%d%d\", indiv, ten, hundred);\n    break;\n  case 2:\n    printf(\"%d%d\", indiv, ten);\n    break;\n  case 1:\n    printf(\"%d\", indiv);\n    break;\n  }\n}\n"}
{"label": "16", "index": "30168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  if (x == 10000)\n    printf(\"00001\");\n  else if (x < 10000 && x >= 1000) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = ((x - a - 10 * b) / 100) % 10;\n    d = (x - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (x < 1000 && x >= 100) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = (x - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x < 100 && x >= 10) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else\n    printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "16", "index": "30169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a[6], n, m, q; \n  int b = 0;            \n  cin >> n;             \n  for (i = 1;; i++)     \n  {\n    m = n / 10;     \n    q = n - 10 * m; \n    a[i] = q;       \n    n = m;          \n    b++;            \n    if (n == 0)     \n      break;\n  }\n  for (i = 1; i <= b; i++) \n    cout << a[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int input;\n  int ret, num;\n  scanf(\"%d\", &input);\n\n  for (;;) {\n    if (input < 10) {\n      printf(\"%d\\n\", input);\n      break;\n    }\n    num = input % 10;\n    input = input / 10;\n\n    cout << num;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[10001], b[10001], c[10001];\n  int x, i;\n  scanf(\"%s \", a);\n  x = strlen(a);\n  for (i = 0; i <= x; i++) {\n    b[i] = a[x - i - 1];\n  }\n\n  cout << b;\n  return 0;\n}\n"}
{"label": "16", "index": "30172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[6] = {0, 0, 0, 0, 0, 0};\n  scanf(\"%s\", &s);\n  int i = 0;\n  for (i = 5; i >= 1 && s[i] == 0; i--)\n    ;\n  for (; i >= 0; i--)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30173", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0)\n    cout << e << d << c << b << a << endl;\n  else if (b != 0)\n    cout << e << d << c << b << endl;\n  else if (c != 0)\n    cout << e << d << c << endl;\n  else if (d != 0)\n    printf(\"%d%d\\n\", e, d);\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e, y;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0) {\n    printf(\"%d\", e);\n    cout << d;\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  } else if (b != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  } else if (c != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  } else if (d != 0) {\n    printf(\"%d\", e);\n    cout << d;\n  } else\n    printf(\"%d\", e);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  else\n    return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  scanf(\"%d\", &N);\n  if (N != 0) {\n    while (N % (1 * e(i)) != N) {\n      a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n      i++;\n    }\n    while (t <= i - 1) {\n      printf(\"%d\", a[t]);\n      t++;\n    }\n  } else\n    printf(\"0\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30176", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[100], str2[100];\n  int i, j, l;\n  scanf(\"%s \", str1);\n  l = strlen(str1);\n  j = 0;\n  for (i = l - 1; i >= 0; --i)\n    str2[j++] = str1[i];\n  str2[j] = '\\0';\n  printf(\"%s\\n\", str2);\n  return 0;\n}\n"}
{"label": "16", "index": "30177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int input;\n  int ret, num;\n  cin >> input;\n\n  for (;;) {\n    if (input < 10) {\n      printf(\"%d\\n\", input);\n      break;\n    }\n    num = input % 10;\n    input = input / 10;\n\n    cout << num;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char a[5] = {'\\0', '\\0', '\\0', '\\0', '\\0'};\n  cin >> a;\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      cout << a[i];\n  }\n}\n"}
{"label": "16", "index": "30179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  double i;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n >= 10 && n < 100) {\n    for (i = 1; i <= 2; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      cout << b;\n    }\n  }\n\n  else {\n    for (i = 1; i <= 3; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      printf(\"%d\", b);\n    }\n    a = n % (int)pow(10, i);\n    b = a / (pow(10, i - 1));\n    n -= a;\n    if (b != 0)\n      cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n > 9999) {\n    printf(\"00001\");\n  } else if (n > 999) {\n    cout << n % 1000 % 100 % 10 << n % 1000 % 100 / 10 << n % 1000 / 100\n         << n / 1000;\n  } else if (n > 99) {\n    printf(\"%d%d%d\", n % 100 % 10, n % 100 / 10, n / 100);\n  } else if (n > 9) {\n    printf(\"%d%d\", n % 10, n / 10);\n  } else {\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30181", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, n, m;\n  cin >> n;\n  a = n / 10000;\n  b = n / 1000;\n  c = n / 100;\n  d = n / 10;\n  e = n / 1;\n  if (a > 0) {\n    printf(\"00001\");\n  } else if (b > 0) {\n    c = (n - b * 1000) / 100;\n    d = (n - b * 1000 - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (c > 0) {\n    d = (n - c * 100) / 10;\n    e = n - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d\", e, d, c);\n  } else if (d > 0) {\n    e = n - d * 10;\n    printf(\"%d%d\", e, d);\n  } else {\n    printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = n / 10;\n  if (n == 0) {\n    printf(\"%d\", a);\n  } else {\n    b = n % 10;\n    n = n / 10;\n    if (n == 0) {\n      printf(\"%d%d\", a, b);\n    } else {\n      c = n % 10;\n      n = n / 10;\n      d = n;\n      if (n == 0)\n        printf(\"%d%d%d\", a, b, c);\n      else {\n        printf(\"%d%d%d%d\", a, b, c, d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a < 10) {\n    b = a;\n    c = 0;\n    d = 0;\n    e = 0;\n    printf(\"%d\", b);\n  } else {\n    if (a < 100) {\n      b = a / 10;\n      c = a % 10;\n      d = 0;\n      e = 0;\n      cout << c << b;\n    } else {\n      if (a < 1000) {\n        b = a / 100;\n        c = (a % 100) / 10;\n        d = a % 10;\n        e = 0;\n        printf(\"%d%d%d\", d, c, b);\n      } else {\n        if (a < 10000) {\n          b = a / 1000;\n          c = (a % 1000) / 100;\n          d = (a % 100) / 10;\n          e = a % 10;\n          printf(\"%d%d%d%d\", e, d, c, b);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5] = {0};\n  int i = 0;\n  while ((a[i] = cin.get()) != '\\n')\n    i++;\n  for (; i >= 0; i--)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0) {\n    cout << n;\n  } else {\n    while (n > 0) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b = 0, i, j;\n  scanf(\"%d\", &a);\n  i = log10(a);\n  for (; a > 0;) {\n    b = b * 10 + a % 10;\n    a = a / 10;\n  }\n  j = log10(b);\n  for (; i > j; i--)\n    printf(\"0\");\n  cout << b;\n  return 0;\n}\n"}
{"label": "16", "index": "30187", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, count = 0;\n  char a[20000];\n  while ((a[count] = getchar()) != '\\n') {\n    count++;\n  }\n  for (i = count - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "30188", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[5], b[5];\n  int n, i, m;\n  cin >> n;\n  b[0] = n;\n  for (i = 0; i < 5; i = i + 1) {\n    a[i] = b[i] % 10;\n    b[i + 1] = b[i] / 10;\n    cout << a[i];\n    if (b[i + 1] == 0) {\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e, p;\n\n  scanf(\"%d\", &num);\n\n  if (num >= 10000)\n    p = 5;\n  else if (num >= 1000)\n    p = 4;\n  else if (num >= 100)\n    p = 3;\n  else if (num >= 10)\n    p = 2;\n  else\n    p = 1;\n  a = (int)(num / 10000);\n  b = (int)(num % 10000 / 1000);\n  c = (int)(num % 1000 / 100);\n  d = (int)(num % 100 / 10);\n  e = (int)(num % 10);\n\n  switch (p) {\n  case 5:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n\n  case 4:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 3:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 2:\n    cout << e << d;\n    break;\n  case 1:\n    printf(\"%d\", e);\n    break;\n  }\n}\n"}
{"label": "16", "index": "30190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long a1, a2, a3, a4, a5, num, len;\n  a1 = a2 = a3 = a4 = a5 = 0;\n  scanf(\"%ld \", &num);\n  if (num > 9) {\n    a1 = num % 10;\n    a2 = num / 10;\n    if (a2 > 9) {\n      a3 = a2 / 10;\n      a2 = a2 % 10;\n      if (a3 > 9) {\n        a4 = a3 / 10;\n        a3 = a3 % 10;\n        if (a4 > 9) {\n          a5 = a4 / 10;\n          a4 = a4 % 10;\n          len = 5;\n        } else\n          len = 4;\n      } else\n        len = 3;\n    } else\n      len = 2;\n  } else {\n    a1 = num;\n    len = 1;\n  }\n\n  if (a5)\n\n    cout << a1 << a2 << a3 << a4 << a5 << \"\\n\";\n\n  else if (a4)\n\n    printf(\"%d%d%d%d\\n\", a1, a2, a3, a4);\n\n  else if (a3)\n\n    printf(\"%d%d%d\\n\", a1, a2, a3);\n\n  else if (a2)\n\n    printf(\"%d%d\\n\", a1, a2);\n\n  else\n    printf(\"%d\\n\", a1);\n  return 0;\n}\n"}
{"label": "16", "index": "30191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = x / 1000;\n  if (x > 999 && x < 10000)\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  else if (x > 99 && x < 1000)\n    printf(\"%d%d%d\\n\", a, b, c);\n  else if (x > 9 && x < 100)\n    printf(\"%d%d\\n\", a, b);\n  else if (x > 0 && x < 10)\n    printf(\"%d\\n\", a);\n  else if (x == 0)\n    printf(\"0\\n\");\n  else if (x == 10000)\n    printf(\"00001\\n\");\n}\n"}
{"label": "16", "index": "30192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b[5], n, i;\n  scanf(\"%d\", &a);\n  if (a != 0) {\n    n = log10(a) + 1;\n    for (i = 0; i <= n - 1; i++) {\n      b[i] = (int)(a / pow(10, i)) % 10; \n    }\n    for (i = 0; i <= n - 1; i++)\n      printf(\"%d\", b[i]); \n    printf(\"\\n\");\n  } else\n    printf(\"0\");\n  return 0;\n}\n"}
{"label": "16", "index": "30193", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, i, a[10];\n  cin >> n;\n  do {\n    a[m] = n % 10;\n    n /= 10;\n    m++;\n  } while (n > 0);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", a[i]);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, t, m;\n  char a[1][5];     \n  cin.get(a[0], 5); \n  n = strlen(a[0]);\n  for (i = 0, j = n - 1; i < j; i++, j--) \n  {\n    t = a[0][i];\n    a[0][i] = a[0][j];\n    a[0][j] = t;\n  }\n  for (m = 0; m < n; m++) \n    cout << a[0][m];\n  return 0;\n}\n"}
{"label": "16", "index": "30195", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  cin >> a;\n  b = floor(a / 10000);\n  a = a - b * 10000;\n  c = floor(a / 1000);\n  a = a - c * 1000;\n  d = floor(a / 100);\n  a = a - d * 100;\n  e = floor(a / 10);\n  a = a - e * 10;\n  if (b == 0) {\n    if (c == 0) {\n      if (d == 0) {\n        if (e == 0)\n          printf(\"%d\", a);\n        else\n          printf(\"%d%d\", a, e);\n      } else\n        printf(\"%d%d%d\", a, e, d);\n    } else\n      printf(\"%d%d%d%d\", a, e, d, c);\n  } else\n    printf(\"%d%d%d%d%d\", a, e, d, c, b);\n}\n"}
{"label": "16", "index": "30196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g;\n  scanf(\"%d \", &a);\n  if (a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%d%d\", b, c);\n  } else if (a >= 100 && a <= 999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = (a - b - 10 * c) / 100;\n    printf(\"%d%d%d\", b, c, d);\n  } else if (a >= 1000 && a <= 9999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = (a - b - 10 * c - 100 * d) / 1000;\n    cout << b << c << d << e;\n  } else if (a >= 10000 && a <= 99999) {\n    b = a % 10;\n    c = ((a - b) / 10) % 10;\n    d = ((a - b - 10 * c) / 100) % 10;\n    e = ((a - b - 10 * c - 100 * d) / 1000) % 10;\n    f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000;\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[100] = {0};\n  int i = 0, b = n, j;\n  do {\n    b = b / 10;\n    i++;\n  } while (b != 0);\n  for (j = 0; j < i; j++) {\n    a[j] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j, k, l, m, n;\n  cin >> a;\n  if (a >= 0 && a <= 9)\n    printf(\"%d\", a);\n  else if (a >= 10 && a <= 99) {\n    b = a % 10, c = a / 10;\n    putchar(b);\n    putchar(c);\n  } else if (a >= 100 && a <= 999) {\n    d = a % 10, e = a / 10, f = e % 10, g = e / 10;\n    printf(\"%d%d%d\", d, f, g);\n  } else if (a >= 1000 && a <= 9999) {\n    h = a / 10, i = h / 10, j = i / 10, k = i % 10, l = h % 10, m = a % 10;\n    cout << m << l << k << j;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;    \n  cin >> n; \n  if (n >= 10000)\n    cout << \"00001\" << endl; \n  else if (n >= 1000)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << (n - n % 1000) / 1000 % 10 << endl;\n  else if (n >= 100)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << endl;\n  else if (n >= 10)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << endl;\n  else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a;\n  if (a == 10000)\n    cout << \"00001\";\n  else if (a >= 1000) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    d = a % 10;\n    a = (a - d) / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (a >= 100) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (a >= 10) {\n    b = a % 10;\n    a = (a - b) / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, weishu;\n  int ge, shi, bai, qian;\n  scanf(\"%d\", &n);\n  if ((0 <= n) && (n <= 9))\n    printf(\"%d\\n\", n);\n  if ((10 <= n) && (n <= 99)) {\n    ge = n % 10;\n    shi = n / 10;\n    printf(\"%d%d\", ge, shi);\n  }\n  if ((100 <= n) && (n <= 999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = n / 100;\n    printf(\"%d%d%d\", ge, shi, bai);\n  }\n  if ((1000 <= n) && (n <= 9999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = ((n - shi * 10) / 100) % 10;\n    qian = (n - bai * 100) / 1000;\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, len = 0, i = 0;\n  char *p = NULL;\n  char a[10000];\n  cin.getline(a, 10000);\n  len = strlen(a);\n  p = &a[len - 1];\n  for (i = 0; i <= len - 1; i++)\n    printf(\"%c\", *(p - i));\n  return 0;\n}\n"}
{"label": "16", "index": "30203", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 100 * a - 10 * b;\n  d = n - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x > 9999)\n    n = 5;\n  else {\n    if (x > 999)\n      n = 4;\n    else {\n      if (x > 99)\n        n = 3;\n      else {\n        if (x > 9)\n          n = 2;\n        else\n          n = 1;\n      }\n    }\n  }\n  switch (n) {\n  case 5:\n    a = x / 10000;\n    b = (x - a * 10000) / 1000;\n    c = (x - a * 10000 - b * 1000) / 100;\n    d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n    e = (x - a * 10000 - b * 1000 - c * 100 - d * 10);\n    cout << e << d << c << b << a << \" \";\n    break;\n  case 4:\n    b = x / 1000;\n    c = (x - b * 1000) / 100;\n    d = (x - b * 1000 - c * 100) / 10;\n    e = (x - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d \", e, d, c, b);\n    break;\n  case 3:\n    c = x / 100;\n    d = (x - c * 100) / 10;\n    e = (x - c * 100 - d * 10);\n    printf(\"%d%d%d \", e, d, c);\n    break;\n  case 2:\n    d = x / 10;\n    e = (x - d * 10);\n    printf(\"%d%d \", e, d);\n    break;\n  case 1:\n    cout << x << \" \";\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n < 1000) {\n    c = n % 10, e = n / 100;\n    d = (n / 10) % 10;\n    printf(\"%d%d%d\", c, d, e);\n  } else if (n < 10000) {\n    f = n % 10;\n    g = (n % 100) / 10;\n    h = (n / 100) % 10;\n    i = n / 1000;\n    printf(\"%d%d%d%d\", f, g, h, i);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int s) {\n  if (s == 0)\n    return;\n  else {\n    cout << s % 10;\n    fun(s /= 10);\n  }\n}\nint main() {\n  int s;\n  scanf(\"%d \", &s);\n  if (s == 0)\n    cout << s;\n  else\n    fun(s);\n  return 0;\n}\n"}
{"label": "16", "index": "30207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n == 10000) {\n    puts(\"00001\");\n  } else if (n >= 1000) {\n    a = n / 1000, b = n / 100 - a * 10, c = n / 10 - a * 100 - b * 10,\n    d = n - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n >= 100) {\n    a = n / 100, b = n / 10 - a * 10, c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n >= 10) {\n    a = n / 10, b = n - 10 * a;\n    printf(\"%d%d\", b, a);\n  } else\n    printf(\"%d\", n);\n}\n"}
{"label": "16", "index": "30208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r;\n  scanf(\"%d \", &a);\n  r = a % 10;\n  do {\n    cout << r;\n    a = a - r;\n    a = a / 10;\n    r = a % 10;\n  } while (a >= 1);\n  return 0;\n}\n"}
{"label": "16", "index": "30209", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[1] = n / 10000;\n  a[2] = (n - a[1] * 10000) / 1000;\n  a[3] = (n - a[1] * 10000 - a[2] * 1000) / 100;\n  a[4] = (n - a[1] * 10000 - a[2] * 1000 - a[3] * 100) / 10;\n  a[5] = n - a[1] * 10000 - a[2] * 1000 - a[3] * 100 - a[4] * 10;\n  if (a[1] != 0)\n    printf(\"%d%d%d%d%d\", a[5], a[4], a[3], a[2], a[1]);\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d%d\", a[5], a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        printf(\"%d%d%d\", a[5], a[4], a[3]);\n      else {\n        if (a[4] != 0)\n          printf(\"%d%d\", a[5], a[4]);\n        else {\n          if (a[5] != 0)\n            printf(\"%d\", a[5]);\n          else\n            printf(\"0\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30210", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i, j;\n  cin >> a;\n  if (a <= 9)\n    printf(\"%d\\n\", a);\n  else {\n    if (a <= 99) {\n      b = a / 10;\n      c = a - 10 * b;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a <= 999) {\n        d = a / 100;\n        e = (a - d * 100) / 10;\n        f = a - 100 * d - 10 * e;\n        printf(\"%d%d%d\", f, e, d);\n      } else if (a <= 9999) {\n        g = a / 1000;\n        h = (a - 1000 * g) / 100;\n        i = (a - 1000 * g - 100 * h) / 10;\n        j = a - 1000 * g - 100 * h - 10 * i;\n        printf(\"%d%d%d%d\", j, i, h, g);\n      } else if (a = 10000)\n        printf(\"00001\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int in, k, m, sum = 0;\n  cin >> in;\n  if (in == 100)\n    printf(\"001\");\n  else {\n    k = in;\n    for (; k > 0;) {\n      m = k % 10;\n      k = k / 10;\n      sum = sum * 10 + m;\n    }\n    printf(\"%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, c, j, k, t;\n  scanf(\"%d\", &n);\n  i = n;\n  c = 0;\n  j = 0;\n  while (i > 0) {\n    j++;\n    m = i % 10;\n    i /= 10;\n    c = m + c * 10;\n  }\n  i = c;\n  k = 0;\n  while (i > 0) {\n    k++;\n    i = i / 10;\n  }\n  for (t = 1; t <= (j - k); t++)\n    printf(\"0\");\n  printf(\"%d\", c);\n}\n"}
{"label": "16", "index": "30213", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  int a = 0, c = 0;\n  cin >> a;\n\n  do {\n    c = a % 10;\n    a = (a - c) / 10;\n    cout << c;\n  } while (a != 0);\n\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30214", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n / 10000 != 0)\n    printf(\"00001\");\n  else if (n / 1000 != 0) {\n    int a, b, c, d;\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - 100 * b) / 10;\n    d = n % 10;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    int e, f, g;\n    e = n / 100;\n    f = (n - 100 * e) / 10;\n    g = n % 10;\n    printf(\"%d%d%d\", g, f, e);\n  } else if (n / 10 != 0) {\n    int p, q;\n    p = n / 10;\n    q = n % 10;\n    printf(\"%d%d\", q, p);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (;;) {\n    cout << n % 10;\n    if (n < 10)\n      break;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint b[5], m = 0;\nint f(int n) {\n  int c;\n  if (n == 0)\n    return (0);\n  else {\n    b[m] = n % 10;\n    m++;\n    c = n / 10;\n    return f(c);\n  }\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  f(n);\n  for (i = 0; i < m; i++)\n    printf(\"%d\", b[i]);\n}\n"}
{"label": "16", "index": "30217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, m = 1, c, g;\n  cin >> n;\n  for (i = 1; i <= 5; i++) {\n    m = m * 10;\n    if ((n / m) == 0) {\n      c = i;\n      break;\n    }\n  }\n  for (i = 1; i <= c; i++) {\n    g = n % 10;\n    if (g == 0) {\n      printf(\"0\");\n    } else {\n      printf(\"%d\", g);\n    }\n    n = n / 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c, i = 0;\n  char num[7] = {0};\n  while ((c = cin.get()) != '\\n') {\n    num[i++] = c;\n  }\n  for (i = i - 1; i >= 0; i--)\n    cout << num[i];\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30219", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  b = n;\n  do {\n    a = b % 10;\n    c = b;\n    b = b / 10;\n    printf(\"%d\", a);\n  } while (c / 10 != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid fun(int s) {\n  if (s == 0)\n    return;\n  else {\n    printf(\"%d\", s % 10);\n    fun(s /= 10);\n  }\n}\nint main() {\n  int s;\n  cin >> s;\n  if (s == 0)\n    cout << s;\n  else\n    fun(s);\n  return 0;\n}\n"}
{"label": "16", "index": "30221", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> e;\n  if (e < 10) {\n    a = e;\n    printf(\"%d\", a);\n  } else if (e < 100) {\n    a = e % 10;\n    b = (e - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (e < 1000) {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = (int)(e / 100);\n    printf(\"%d%d%d\", a, b, c);\n  } else {\n    a = e % 10;\n    b = ((e - a) / 10) % 10;\n    c = ((e - b * 10 - a) / 100) % 10;\n    d = (int)(e / 1000);\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30222", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  i = 0;\n  char a[9], ch;\n  while ((ch = cin.get()) != '\\n') {\n    a[i] = ch;\n    i = i + 1;\n  }\n  i = i - 1;\n  while (i >= 0) {\n    cout << a[i];\n    i = i - 1;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 1000;\n  c = (a - 1000 * b) / 100;\n  d = (a - 1000 * b - 100 * c) / 10;\n  e = a - 1000 * b - 100 * c - 10 * d;\n  if (b > 0)\n    cout << e << d << c << b;\n  else if (b == 0 && c > 0)\n    cout << e << d << c;\n  else if (b == c == 0 && d > 0)\n    printf(\"%d%d\", e, d);\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, v, n4, n3, n2, n1;\n  double n0;\n  cin >> n;\n  if (n == 0) {\n    cout << 0 << endl;\n  } else {\n    if (n == 10000) {\n      cout << 1 << endl;\n    } else {\n      n0 = n;\n      v = log10(n0) + 1;\n      n4 = n / 1000;\n      n3 = (n - n4 * 1000) / 100;\n      n2 = (n - n4 * 1000 - n3 * 100) / 10;\n      n1 = n - n4 * 1000 - n3 * 100 - n2 * 10;\n      switch (v) {\n      case 4:\n        printf(\"%d%d%d%d\\n\", n1, n2, n3, n4);\n        break;\n      case 3:\n        cout << n1 << n2 << n3 << endl;\n        break;\n      case 2:\n        cout << n1 << n2 << endl;\n        break;\n      case 1:\n        cout << n1 << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30225", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f, g, h, i, j;\n  cin >> n;\n  a = n % 10;\n  e = n - a;\n  f = e / 10;\n  b = f % 10;\n  g = n - 10 * b - a;\n  h = g / 100;\n  c = h % 10;\n  i = n - 100 * c - 10 * b - a;\n  j = i / 1000;\n  d = j % 10;\n  if (d == 0) {\n    if (c == 0) {\n      if (b == 0)\n        printf(\"%d\", a);\n      else\n        printf(\"%d%d\", a, b);\n    } else\n      printf(\"%d%d%d\", a, b, c);\n  } else\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "30226", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d \", &x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (x >= 10000 && x <= 99999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x >= 1000 && x <= 9999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x >= 100 && x <= 999)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x >= 10 && x <= 99)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30227", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum = 0, i, t;\n  char str[5] = {0}, str2[5] = {0};\n  scanf(\"%s \", str);\n  for (i = 0; str[i] != '\\0'; i++)\n    sum = sum + 1;\n  for (i = sum - 1; i >= 0; i--) {\n    t = sum - i - 1;\n    str2[t] = str[i];\n  }\n  printf(\"%s\", str2);\n}\n"}
{"label": "16", "index": "30228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n, n1, n2;\n  cin >> n;\n  a = n / 1000;\n  n1 = n - 1000 * a;\n  b = n1 / 100;\n  n2 = n1 - 100 * b;\n  c = n2 / 10;\n  d = n2 - 10 * c;\n  if (a == 10)\n    cout << \"00001\" << endl;\n  else if (a != 0)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (b != 0)\n    cout << d << c << b << endl;\n  else if (c != 0)\n    cout << d << c << \"\\n\";\n  else\n    cout << d << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30229", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char a[6];\n  int i, n;\n  scanf(\"%s\", a);\n  n = strlen(a);\n  for (i = 1; i <= n; i++)\n    printf(\"%c\", a[n - i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x / 1000 - x / 10000 * 10;\n  c = x / 100 - x / 1000 * 10;\n  d = x / 10 - x / 100 * 10;\n  e = x - x / 10 * 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0) {\n    cout << e << d << c << b;\n  } else if (c != 0)\n    cout << e << d << c;\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint num[10];\nint main() {\n  int i, t = 0;\n  memset(num, -1, sizeof(num));\n  cin >> n;\n  int x = n;\n  num[0] = 0;\n  while (n > 0) {\n    num[t] = n % 10;\n    n -= n % 10;\n    n /= 10;\n    t++;\n  }\n  for (i = 0; i < t; ++i) {\n    cout << num[i];\n  }\n  if (x == 0)\n    cout << 0;\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"%d\", 0);\n\n  else\n    for (i = 1;; i++) {\n      static int k;\n      if (i == 1)\n        k = 10;\n      else\n        k *= 10;\n      if (n < k / 10)\n        break;\n      else {\n        int c = n % k;\n        cout << c / (k / 10);\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, x;\n  scanf(\"%d\", &x);\n  if (x == 0)\n    printf(\"0\");\n  else if (x <= 9)\n    cout << x;\n  else if (x <= 99) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else if (x <= 999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = (x - 10 * b - a) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x <= 9999) {\n    a = x % 10;\n    b = ((x - a) % 100) / 10;\n    c = ((x - 10 * b - a) / 100) % 10;\n    d = (x - 100 * c - 10 * b - a) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else\n    printf(\"00001\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30234", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100001];\n  cin >> a;\n  int l = strlen(a), i = 0;\n  for (i = l - 1; i >= 0; i--)\n    cout << a[i];\n\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[7], i, j;\n  cin >> a;\n  for (i = 1; a[i] != '\\0'; i++)\n    j = i;\n\n  for (i = j; i >= 0; i--)\n    printf(\"%c\", a[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30236", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (10 <= n && n < 100) {\n    cout << n % 10 << n / 10;\n  } else if (n >= 100 && n <= 999) {\n    printf(\"%d%d%d\", n - (n / 10) * 10, n / 10 - (n / 100) * 10, n / 100);\n  } else if (n >= 1000 && n <= 9999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10\n         << n / 100 - (n / 1000) * 10 << n / 1000;\n  } else if (n == 10000) {\n    cout << 00001;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30237", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int f;\n  cin >> f;\n  if (f == 10000) {\n    printf(\"00001\\n\");\n  } else if (f > 999 && f <= 9999) {\n    int a, b, c, d;\n    a = 1;\n    while (f - a * 1000 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 1000 - b * 100 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 1000 - b * 100 - c * 10 >= 0)\n      c++;\n\n    d = 1;\n    c = c - 1;\n    while (f - a * 1000 - b * 100 - c * 10 - d * 1 >= 0) {\n      d++;\n    }\n    d = d - 1;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (f > 99 && f <= 999) {\n    int a, b, c;\n    a = 1;\n    while (f - a * 100 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 100 - b * 10 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 100 - b * 10 - c * 1 >= 0) {\n      c++;\n    }\n    c = c - 1;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (f > 9 && f <= 99) {\n    int a, b;\n    a = 1;\n    while (f - a * 10 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 10 - b * 1 >= 0) {\n      b++;\n    }\n    b = b - 1;\n    printf(\"%d%d\", b, a);\n  } else {\n    printf(\"%d\", f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30238", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  double i;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else {\n    if (n >= 10 && n < 100) {\n      for (i = 1; i <= 2; i++) {\n        a = n % (int)pow(10, i);\n        b = a / (pow(10, i - 1));\n        n -= a;\n        cout << b;\n      }\n    }\n\n    else {\n      for (i = 1; i <= 3; i++) {\n        a = n % (int)pow(10, i);\n        b = a / (pow(10, i - 1));\n        n -= a;\n        printf(\"%d\", b);\n      }\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      if (b != 0)\n        cout << b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30239", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, num[10000];\n  int i = 0, t = 0;\n  scanf(\"%d \", &n);\n  num[0] = n % 10;\n\n  while (n / 10 != 0) {\n    t = t + 1;\n    num[t] = (n / 10) % 10;\n    n = n / 10;\n  }\n\n  for (i; i <= t; i++)\n    cout << num[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "30240", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, a[5] = {0}, flag[5] = {0};\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", 0);\n  if (n != 0) {\n    for (i = 0; i < 5; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n    }\n    for (i = 0; i < 5; i++) {\n      for (j = i; j < 5; j++) {\n        flag[i] = flag[i] + a[j];\n      }\n    }\n    for (i = 0; i < 5; i++) {\n      if (flag[i] != 0)\n        cout << a[i];\n      else\n        break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30241", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num, b1, b2, b3, b4, b5;\n  scanf(\"%d\", &num);\n  b1 = num / 10000;\n  b2 = (num - 10000 * b1) / 1000;\n  b3 = (num - 10000 * b1 - 1000 * b2) / 100;\n  b4 = (num - 10000 * b1 - 1000 * b2 - 100 * b3) / 10;\n  b5 = (num - 10000 * b1 - 1000 * b2 - 100 * b3 - 10 * b4);\n  if (b1 != 0)\n    printf(\"%d%d%d%d%d\", b5, b4, b3, b2, b1);\n  else if (b2 != 0)\n    printf(\"%d%d%d%d\", b5, b4, b3, b2);\n  else if (b3 != 0)\n    printf(\"%d%d%d\", b5, b4, b3);\n  else if (b4 != 0)\n    printf(\"%d%d\", b5, b4);\n  else\n    printf(\"%d\", b5);\n  return 0;\n}\n"}
{"label": "16", "index": "30242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  if (d != 0)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  else if (c != 0)\n    printf(\"%d%d%d\", a, b, c);\n  else if (b != 0)\n    printf(\"%d%d\", a, b);\n  else {\n    printf(\"%d\", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30243", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[10], n, flag;\n  flag = 0;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    cout << \"0\";\n  else {\n    while (n != 0) {\n      flag++;\n      a[flag] = n % 10;\n      n = n / 10;\n    }\n    for (int i = 1; i <= flag; i++) {\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  a = x % 10;                                                 \n  b = (x - a) % 100 / 10;                                     \n  c = (x - a - 10 * b) % 1000 / 100;                          \n  d = (x - a - 10 * b - 100 * c) % 10000 / 1000;              \n  e = (x - a - 10 * b - 100 * c - 1000 * d) % 100000 / 10000; \n  if (e == 1)                                                 \n    cout << 1;\n  else if (d != 0) \n    cout << a << b << c << d;\n  else if (d == 0 && c != 0) \n    cout << a << b << c;\n  else if (d == 0 && c == 0 && b != 0) \n    cout << a << b;\n  else if (d == 0 && c == 0 && b == 0) \n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30245", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10];\n  int n, i, j;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\\n\");\n    return 0;\n  }\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 1; j <= i - 1; j++)\n    printf(\"%d\", a[j]);\n  \n  return 0;\n}\n"}
{"label": "16", "index": "30246", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, c, j, k, t;\n  cin >> n;\n  i = n;\n  c = 0;\n  j = 0;\n  while (i > 0) {\n    j++;\n    m = i % 10;\n    i /= 10;\n    c = m + c * 10;\n  }\n  i = c;\n  k = 0;\n  while (i > 0) {\n    k++;\n    i = i / 10;\n  }\n  for (t = 1; t <= (j - k); t++) {\n    printf(\"0\");\n  }\n  printf(\"%d\", c);\n  return 0;\n}\n"}
{"label": "16", "index": "30247", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i1, m1, i2, m2, i3, m3;\n  scanf(\"%d \", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n < 100) {\n    i1 = n % 10;\n    m1 = n / 10;\n    printf(\"%d%d\", i1, m1);\n  } else if (n >= 100 && n < 1000) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    printf(\"%d%d%d\", i1, i2, m2);\n  } else if (n >= 1000 && n < 9999) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    i3 = m2 % 10;\n    m3 = m2 / 10;\n    printf(\"%d%d%d%d\", i1, i2, i3, m3);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, k;\n\n  cin >> x;\n  k = log10(x) + 1;\n\n  if (x == 0) {\n    printf(\"%d\", x);\n  } else {\n    int a, e = 1, k1;\n    k = k - 1;\n    k1 = k;\n    while (k1 > 0) {\n      e = e * 10;\n      k1 = k1 - 1;\n    }\n\n    int b = 0, s = 2, k3, e2, x2;\n    k3 = k;\n    e2 = e;\n    x2 = x;\n    while (s > 0) {\n      while (k3 >= 0) {\n        a = x2 / e2;\n        k3 = k3 - 1;\n        x2 = x2 - a * e2;\n        b = b + a * (e / e2);\n        e2 = e2 / 10;\n        if (s == 1) {\n          printf(\"%d\", a);\n        }\n      }\n      k3 = k;\n      e2 = e;\n      s = s - 1;\n      x2 = b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, temp, p, q;\n  cin >> a;\n  temp = a;\n  if (a != 0) {\n    while (temp % 10 - temp != 0 || (temp % 10 - temp == 0 && q >= 10)) {\n      p = temp % 10;\n      printf(\"%d\", p);\n      q = temp;\n      temp = temp / 10;\n    }\n  } else\n    cout << \"0\";\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30250", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a < 10) {\n    b = a;\n    c = 0;\n    d = 0;\n    e = 0;\n    printf(\"%d\", b);\n  } else {\n    if (a < 100) {\n      b = a / 10;\n      c = a % 10;\n      d = 0;\n      e = 0;\n      printf(\"%d%d\", c, b);\n    } else {\n      if (a < 1000) {\n        b = a / 100;\n        c = (a % 100) / 10;\n        d = a % 10;\n        e = 0;\n        printf(\"%d%d%d\", d, c, b);\n      } else {\n        if (a < 10000) {\n          b = a / 1000;\n          c = (a % 1000) / 100;\n          d = (a % 100) / 10;\n          e = a % 10;\n          printf(\"%d%d%d%d\", e, d, c, b);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, m = 1, c, g;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    m = m * 10;\n    if ((n / m) == 0) {\n      c = i;\n      break;\n    }\n  }\n  for (i = 1; i <= c; i++) {\n    g = n % 10;\n    if (g == 0) {\n      printf(\"0\");\n    } else {\n      printf(\"%d\", g);\n    }\n    n = n / 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30252", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n > 1000 && n < 10000) {\n    a[3] = n / 1000;\n    a[2] = (n % 1000) / 100;\n    a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n    a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n    printf(\"%d\\n\", a[0] * 1000 + a[1] * 100 + a[2] * 10 + a[3]);\n  } else if (n == 100)\n    cout << \"001\";\n  else if (n > 100 && n < 1000) {\n    a[2] = n / 100;\n    a[1] = (n % 100) / 10;\n    a[0] = n - a[2] * 100 - a[1] * 10;\n    cout << a[0] * 100 + a[1] * 10 + a[2];\n  } else if (n == 10)\n    cout << \"01\";\n  else if (n > 10 && n < 100) {\n    a[1] = n / 10;\n    a[0] = n - a[1] * 10;\n    cout << a[0] * 10 + a[1];\n  } else if (n >= 0 && n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "30253", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y = 0;\n  cin >> x;\n  if (x < 10)\n    printf(\"%d\", x);\n  else {\n    while (x > 0) {\n      y = x % 10 + 10 * y;\n      x = x / 10;\n    }\n    if (x % 10 != 0)\n      printf(\"%d\", y);\n    else\n      printf(\"%03d\", y);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = n / 10 % 10;\n  c = n / 100 % 10;\n  d = n / 1000 % 10;\n  if (n >= 10) {\n    if (n / 10 >= 10) {\n      if (n / 100 >= 10) {\n        if (n / 1000 < 10)\n          printf(\"%d%d%d%d\\n\", a, b, c, d);\n      } else\n        printf(\"%d%d%d\\n\", a, b, c);\n    } else\n      printf(\"%d%d\\n\", a, b);\n  } else\n    printf(\"%d\\n\", n);\n}\n"}
{"label": "16", "index": "30255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  a = b = c = d = 0;\n  scanf(\"%d \", &n);\n  while (n > 999) {\n    n = n - 1000;\n    a = a + 1;\n  }\n  while (n > 99) {\n    n = n - 100;\n    b++;\n  }\n  while (n > 9) {\n    n = n - 10;\n    c++;\n  }\n  if (n > 0) {\n    while (n > 0) {\n      n = n - 1;\n      d++;\n    }\n  } else if (n = 0)\n    d = 0;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0)\n          cout << d;\n        else\n          cout << d;\n      } else\n        cout << d << c;\n    } else\n      cout << d << c << b;\n  } else\n    cout << d << c << b << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int number, ge, shi, bai, qian, wan, place;\n  scanf(\"%d\", &number);\n  if (number >= 10000)\n    place = 5;\n  else {\n    if (number >= 1000)\n      place = 4;\n    else {\n      if (number >= 100)\n        place = 3;\n      else {\n        if (number >= 10)\n          place = 2;\n        else\n          place = 1;\n      }\n    }\n  }\n  ge = number % 10;\n  shi = ((number - ge) % 100) / 10;\n  bai = ((number - ge - 10 * shi) % 1000) / 100;\n  qian = ((number - ge - 10 * shi - 100 * bai) % 10000) / 1000;\n  wan = (number - ge - 10 * shi - 100 * bai - 1000 * qian) / 10000;\n\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", ge);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, num, m, a, b;\n  scanf(\"%d\", &num);\n  m = num;\n  do {\n    n = n * 10 + num % 10;\n    num = num / 10;\n  } while (num != 0);\n  int weishu(int x);\n  a = weishu(m);\n  b = weishu(n);\n  if (a - b == 4)\n    printf(\"0000%d\\n\", n);\n  else if (a - b == 3)\n    printf(\"000%d\\n\", n);\n  else if (a - b == 2) {\n    printf(\"00%d\\n\", n);\n  } else if (a - b == 1)\n    printf(\"0%d\\n\", n);\n  else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n\nint weishu(int x) {\n  int y;\n  if (x >= 10000)\n    y = 5;\n  else if (x >= 1000)\n    y = 4;\n  else if (x >= 100)\n    y = 3;\n  else if (x >= 10)\n    y = 2;\n  else\n    y = 1;\n  return (y);\n}\n"}
{"label": "16", "index": "30258", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h, i;\n  cin >> a;\n  b = a % 10;\n  c = a / 10;\n  d = ((a - b) % 100) / 10;\n  e = a / 100;\n  f = ((a - b - d * 10) % 1000) / 100;\n  g = a / 1000;\n  h = ((a - b - d * 10 - f * 100) % 10000) / 1000;\n  i = a / 10000;\n  if (c < 1) {\n    printf(\"%d\\n\", a);\n  } else {\n    if (e < 1) {\n      printf(\"%d%d\\n\", b, d);\n    } else {\n      if (g < 1) {\n        printf(\"%d%d%d\\n\", b, d, f);\n      } else {\n        printf(\"%d%d%d%d\\n\", b, d, f, h);\n      }\n    }\n  }\n}\n"}
{"label": "16", "index": "30259", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, temp, ge, shi, bai, qian;\n  cin >> num;\n  temp = num;\n  if (num == 10000)\n    cout << \"00001\" << endl;\n  else if (num == 0)\n    cout << \"0\" << endl;\n  else {\n    qian = temp / 1000;\n    temp = temp - qian * 1000;\n    bai = temp / 100;\n    temp = temp - bai * 100;\n    shi = temp / 10;\n    ge = temp - shi * 10;\n    if (num >= 1 && num <= 9)\n      cout << ge << endl;\n    else if (num >= 10 && num <= 99)\n      cout << ge << shi << endl;\n    else if (num >= 100 && num <= 999)\n      cout << ge << shi << bai << endl;\n    else\n      cout << ge << shi << bai << qian << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  a = b = c = d = 0;\n  scanf(\"%d \", &n);\n  while (n > 999) {\n    n = n - 1000;\n    a = a + 1;\n  }\n  while (n > 99) {\n    n = n - 100;\n    b++;\n  }\n  while (n > 9) {\n    n = n - 10;\n    c++;\n  }\n  if (n > 0) {\n    while (n > 0) {\n      n = n - 1;\n      d++;\n    }\n  } else if (n = 0)\n    d = 0;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          cout << d;\n        } else\n          printf(\"%d\", d);\n      } else\n        printf(\"%d%d\", d, c);\n    } else\n      cout << d << c << b;\n  } else\n    cout << d << c << b << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a;\n  cin >> x;\n  if (x == 0)\n    cout << \"0\";\n  else {\n    while (x != 0) {\n      a = x % 10;\n      x = x / 10;\n      cout << a;\n    }\n  }\n  cin.get();\n  cin.get(); \n  return 0;\n}\n"}
{"label": "16", "index": "30262", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[5], i, j, b[5], c, d, k;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    cout << x;\n  else {\n    a[1] = x / 10000;\n    a[2] = (x % 10000) / 1000;\n    a[3] = (x % 1000) / 100;\n    a[4] = (x % 100) / 10;\n    a[5] = (x % 10);\n    for (i = 1;; i++) {\n      if (a[i] != 0)\n        break;\n    }\n    c = i;\n    for (i = 5; i >= c; i--)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  char b, c, d, e;\n  scanf(\"%d\", &a);\n  b = (int)(a / 1000);\n  c = (int)((a - 1000 * b) / 100);\n  d = (int)(a / 10) - c * 10 - 100 * b;\n  e = a - 10 * d - 100 * c - 1000 * b;\n  if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  if (b == 0 && c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  if (a > 9 && a < 100)\n    printf(\"%d%d\", e, d);\n  if (a < 10)\n    printf(\"%d\", e);\n}\n"}
{"label": "16", "index": "30264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if ((n >= 0) && (n <= 9)) {\n    printf(\"%d\", n);\n  } else {\n    do {\n      cout << n % 10;\n      n = n / 10;\n    } while (n / 10 != 0);\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, w, l;\n  scanf(\"%d\", &n);\n  if (n - 10 < 0)\n    printf(\"%d\", n);\n  else {\n    if (n - 100 < 0) {\n      i = n % 10;\n      j = (n - i) / 10;\n      printf(\"%d%d\", i, j);\n    } else {\n      if (n - 1000 < 0) {\n        i = n % 10;\n        j = ((n - i) / 10) % 10;\n        k = (n - i - 10 * j) / 100;\n        printf(\"%d%d%d\", i, j, k);\n      } else {\n        if (n - 10000 < 0) {\n          i = n % 10;\n          j = ((n - i) % 100) / 10;\n          k = ((n - i - 10 * j) % 1000) / 100;\n          w = (n - i - 10 * j - 100 * k) / 1000;\n          printf(\"%d%d%d%d\", i, j, k, w);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  int x, y;\n  x = a % 10;\n  y = a / 10;\n  cout << x;\n  while (y > 0) {\n    x = y % 10;\n    y = y / 10;\n    printf(\"%d\", x);\n  }\n}\n"}
{"label": "16", "index": "30267", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, m1, i2, m2, i3, m3;\n  cin >> n;\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n < 100) {\n    i1 = n % 10;\n    m1 = n / 10;\n    printf(\"%d%d\", i1, m1);\n  } else {\n    if (n >= 100 && n < 1000) {\n      i1 = n % 10;\n      m1 = n / 10;\n      i2 = m1 % 10;\n      m2 = m1 / 10;\n      printf(\"%d%d%d\", i1, i2, m2);\n    } else if (n >= 1000 && n < 9999) {\n      i1 = n % 10;\n      m1 = n / 10;\n      i2 = m1 % 10;\n      m2 = m1 / 10;\n      i3 = m2 % 10;\n      m3 = m2 / 10;\n      printf(\"%d%d%d%d\", i1, i2, i3, m3);\n    } else\n      printf(\"00001\");\n  }\n}\n"}
{"label": "16", "index": "30268", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> f;\n  if (f == 10000)\n    printf(\"00001\");\n  else if (f >= 1000 && f <= 9999) {\n    b = (int)f / 1000;\n    c = (int)(f - b * 1000) / 100;\n    d = (int)(f - b * 1000 - c * 100) / 10;\n    e = f - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (f >= 100 && f <= 999) {\n    c = (int)f / 100;\n    d = (int)(f - c * 100) / 10;\n    e = (f - c * 100 - d * 10);\n    printf(\"%d%d%d\", e, d, c);\n  } else if (f >= 10 && f <= 99) {\n    d = (int)f / 10;\n    e = (f - d * 10);\n    printf(\"%d%d\", e, d);\n  } else if (f >= 0 && f <= 9)\n    printf(\"%d\", f);\n  return 0;\n}\n"}
{"label": "16", "index": "30269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if ((n >= 0) && (n <= 9))\n    printf(\"%d\", n); \n  else {\n    do {\n      printf(\"%d\", n % 10);\n      n = n / 10;\n    } while (n / 10 != 0);\n    printf(\"%d\", n);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p;\n  p = (char *)malloc(sizeof(char) * 8);\n  int i;\n  for (i = 0; i < 6; i++) {\n    cin >> p;\n    if (*p == '\\n') {\n      *p = 0;\n      break;\n    }\n    p++;\n  }\n  for (i = i - 1; i >= 0; i--) {\n    p--;\n    cout << *p;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30271", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[6];\n  for (i = 0; i < 6; i++) {\n    cin >> a[i];\n    if (a[i] == '\\n')\n      break;\n  }\n  for (j = i - 1; j > -1; j--)\n    printf(\"%c\", a[j]);\n}\n"}
{"label": "16", "index": "30272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, w, l;\n  scanf(\"%d\", &n);\n  if (n - 10 < 0)\n    printf(\"%d\", n);\n  else {\n    if (n - 100 < 0) {\n      i = n % 10;\n      j = (n - i) / 10;\n      printf(\"%d%d\", i, j);\n    } else {\n      if (n - 1000 < 0) {\n        i = n % 10;\n        j = ((n - i) / 10) % 10;\n        k = (n - i - 10 * j) / 100;\n        printf(\"%d%d%d\", i, j, k);\n      } else {\n        if (n - 10000 < 0) {\n          i = n % 10;\n          j = ((n - i) % 100) / 10;\n          k = ((n - i - 10 * j) % 1000) / 100;\n          w = (n - i - 10 * j - 100 * k) / 1000;\n          cout << i << j << k << w;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a < 10) {\n    b = a;\n    cout << b;\n  } else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a / 10000;\n    c = (a - 10000 * b) / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a >= 1000) {\n    b = 0;\n    c = a / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100) {\n    b = 0;\n    c = 0;\n    d = a / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d\", f, e, d);\n  } else {\n    if (a >= 10) {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = a / 10;\n      f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n      printf(\"%d%d\", f, e);\n    } else {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = 0;\n      f = a;\n      printf(\"%d\", f);\n    }\n  }\n}\n"}
{"label": "16", "index": "30275", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[5];\n  int i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < 5; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  if (a[4] == 0 && a[3] == 0 && a[2] == 0 && a[1] == 0)\n    printf(\"%d\", a[0]);\n  else if (a[4] == 0 && a[3] == 0 && a[2] == 0)\n    printf(\"%d%d\", a[0], a[1]);\n  else if (a[4] == 0 && a[3] == 0)\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n  else if (a[4] == 0)\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n  else\n    printf(\"%d%d%d%d%d\", a[0], a[1], a[2], a[3], a[4]);\n  return 0;\n}\n"}
{"label": "16", "index": "30276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, m;\n  scanf(\"%d\\n\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (n != 0 && n % 10 == 0)\n    printf(\"0\");\n  if (n != 0 && n % 100 == 0)\n    printf(\"0\");\n  if (a != 0)\n    m = e * 10000 + d * 1000 + c * 100 + b * 10 + a;\n  else if (b != 0)\n    m = e * 1000 + d * 100 + c * 10 + b;\n  else if (c != 0)\n    m = e * 100 + d * 10 + c;\n  else if (d != 0)\n    m = e * 10 + d;\n  else if (e != 0)\n    m = e;\n  else\n    m = 0;\n  printf(\"%d\\n\", m);\n  return 0;\n}\n"}
{"label": "16", "index": "30277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A, B, a[5], i = 0, j = 0;\n  scanf(\"%d \", &A);\n  do {\n    B = A / 10;\n    a[i] = A - B * 10;\n    A = B;\n    i++;\n    j++;\n  } while (A != 0);\n  for (i = 0; i < j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30278", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, b, i, k;\n  cin >> n;\n  b = n;\n  if (b == 0)\n    cout << b;\n  for (i = 0; b >= 1; i++) {\n    k = b % 10;\n    b = b / 10;\n    printf(\"%d\", k);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  cin >> n;\n  a = (int)(n / 10000);\n  b = (int)((n - a * 10000) / 1000);\n  c = (int)((n - a * 10000 - b * 1000) / 100);\n  d = (int)((n - a * 10000 - b * 1000 - c * 100) / 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    cout << e << d << c << b;\n  else {\n    if (c != 0)\n      printf(\"%d%d%d\", e, d, c);\n    else if (d != 0)\n      printf(\"%d%d\", e, d);\n    else\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30280", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, m;\n  cin >> n;\n  m = n;\n  a = n % 10;\n  n = n / 10;\n  b = n % 10;\n  n = n / 10;\n  c = n % 10;\n  n = n / 10;\n  d = n % 10;\n  if (m < 10)\n    printf(\"%d\", m);\n  else if (m < 100)\n    printf(\"%d%d\", a, b);\n  else if (m < 1000)\n    printf(\"%d%d%d\", a, b, c);\n  else if (m < 10000)\n    printf(\"%d%d%d%d\", a, b, c, d);\n  return 0;\n}\n"}
{"label": "16", "index": "30281", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = (x % 10000 - c * 100 - b * 10 - a) / 1000;\n  e = (x % 100000 - d * 1000 - c * 100 - b * 10 - a) / 10000;\n  if (e != 0)\n    printf(\"%d%d%d%d%d\", a, b, c, d, e);\n  if ((e == 0) && (d != 0))\n    printf(\"%d%d%d%d\", a, b, c, d);\n  if ((e == 0) && (d == 0) && (c != 0))\n    printf(\"%d%d%d\", a, b, c);\n  if ((e == 0) && (d == 0) && (c == 0) && (b != 0))\n    printf(\"%d%d\", a, b);\n  if ((e == 0) && (d == 0) && (c == 0) && (b == 0))\n    printf(\"%d\", a);\n}\n"}
{"label": "16", "index": "30282", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a < 10) {\n    printf(\"%d\\n\", a);\n  } else if (a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    a = b * 10 + c;\n    printf(\"%02d\\n\", a);\n  } else if (a < 1000) {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = (a - c * 10 - b) / 100;\n    a = b * 100 + c * 10 + d;\n    printf(\"%03d\\n\", a);\n  } else {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = ((a - c * 10 - b) % 1000) / 100;\n    e = (a - d * 100 - c * 10 - b) / 1000;\n    a = b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n == 0)\n    cout << n;\n  else\n    while (n > 0) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[4], b, i;\n  cin >> b;\n  if (b == 10000)\n    cout << \"00001\";\n  else {\n    for (i = 0; i <= 3; i++)\n      a[i] = b % (int)pow(10, i + 1) / (int)pow(10, i);\n    for (i = 0; i <= 3; i++)\n      if (b >= pow(10, i))\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30285", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a % 10;\n    c = a / 10;\n    d = 10 * b + c;\n    if (b == 0)\n      printf(\"0%d\", d);\n    else {\n      printf(\"%d\", d);\n    }\n  } else if (a / 1000 == 0) {\n    b = a % 10;\n    c = a / 100;\n    d = a / 10 - 10 * c;\n    e = 100 * b + 10 * d + c;\n    if (b == 0)\n      if (d == 0)\n        printf(\"00%d\", e);\n      else\n        printf(\"0%d\", e);\n    else\n      printf(\"%d\", e);\n  } else if (a / 10000 == 0) {\n    b = a % 10;\n    c = a / 1000;\n    d = a / 100 - 10 * c;\n    e = a / 10 - 10 * d - 100 * c;\n    f = 1000 * b + 100 * e + 10 * d + c;\n    if (b == 0)\n      if (e == 0)\n        if (d == 0)\n          printf(\"000%d\", f);\n        else\n          printf(\"00%d\", f);\n      else\n        printf(\"0%d\", f);\n    else\n      printf(\"%d\", f);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30286", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a / 1000;\n  c = (a - 1000 * b) / 100;\n  d = (a - 1000 * b - 100 * c) / 10;\n  e = a - 1000 * b - 100 * c - 10 * d;\n  if (b > 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (b == 0 && c > 0)\n    cout << e << d << c;\n  else if (b == c == 0 && d > 0)\n    cout << e << d;\n  else\n    cout << e << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int f;\n  cin >> f;\n  if (f == 10000) {\n    printf(\"00001\\n\");\n  } else if (f > 999 && f <= 9999) {\n    int a, b, c, d;\n    a = 1;\n    while (f - a * 1000 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 1000 - b * 100 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 1000 - b * 100 - c * 10 >= 0) {\n      c++;\n    }\n    d = 1;\n    c = c - 1;\n    while (f - a * 1000 - b * 100 - c * 10 - d * 1 >= 0) {\n      d++;\n    }\n    d = d - 1;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (f > 99 && f <= 999) {\n    int a, b, c;\n    a = 1;\n    while (f - a * 100 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 100 - b * 10 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 100 - b * 10 - c * 1 >= 0) {\n      c++;\n    }\n    c = c - 1;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (f > 9 && f <= 99) {\n    int a, b;\n    a = 1;\n    while (f - a * 10 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 10 - b * 1 >= 0) {\n      b++;\n    }\n    b = b - 1;\n    printf(\"%d%d\", b, a);\n  } else {\n    printf(\"%d\", f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30288", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  int num[5];\n  a = 100000;\n  for (i = 0; i <= 4; i++) {\n    a = a / 10;\n    num[i] = (n / a) % 10;\n  }\n  if (num[0] != 0) {\n    printf(\"%d%d%d%d%d\", num[4], num[3], num[2], num[1], num[0]);\n  } else if (num[1] != 0) {\n    printf(\"%d%d%d%d\", num[4], num[3], num[2], num[1]);\n  } else if (num[2] != 0) {\n    printf(\"%d%d%d\", num[4], num[3], num[2]);\n  } else if (num[3] != 0) {\n    printf(\"%d%d\", num[4], num[3]);\n  } else\n    printf(\"%d\", num[4]);\n}\n"}
{"label": "16", "index": "30289", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, r1, r2, r3, r4, r5;\n  double b;\n  scanf(\"%d\", &a);\n  b = (double)a / 10000;\n  if (b >= 1) {\n    r5 = a / 10000;\n    r4 = (a - 10000 * r5) / 1000;\n    r3 = (a - 10000 * r5 - 1000 * r4) / 100;\n    r2 = (a - 10000 * r5 - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 10000 * r5 - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n  } else if (b >= 0.1) {\n    r4 = a / 1000;\n    r3 = (a - 1000 * r4) / 100;\n    r2 = (a - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n  } else if (b >= 0.01) {\n    r3 = a / 100;\n    r2 = (a - 100 * r3) / 10;\n    r1 = a - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d\\n\", r1, r2, r3);\n  } else if (b >= 0.001) {\n    r2 = a / 10;\n    r1 = a - 10 * r2;\n    printf(\"%d%d\\n\", r1, r2);\n  } else\n    printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30290", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, k;\n\n  scanf(\"%d\", &x);\n  k = log10(x) + 1;\n\n  if (x == 0) {\n    printf(\"%d\", x);\n  } else {\n    int a, e = 1, k1;\n    k = k - 1;\n    k1 = k;\n    while (k1 > 0) {\n      e = e * 10;\n      k1 = k1 - 1;\n    }\n\n    int b = 0, s = 2, k3, e2, x2;\n    k3 = k;\n    e2 = e;\n    x2 = x;\n    while (s > 0) {\n      while (k3 >= 0) {\n        a = x2 / e2;\n        k3 = k3 - 1;\n        x2 = x2 - a * e2;\n        b = b + a * (e / e2);\n        e2 = e2 / 10;\n        if (s == 1) {\n          printf(\"%d\", a);\n        }\n      }\n      k3 = k;\n      e2 = e;\n      s = s - 1;\n      x2 = b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a >= 10000) {\n    b = a / 10000;\n    c = (a - 10000 * b) / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  } else if (a >= 1000) {\n    b = 0;\n    c = a / 1000;\n    d = (a - 10000 * b - 1000 * c) / 100;\n    e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n    f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else {\n    if (a >= 100) {\n      b = 0;\n      c = 0;\n      d = a / 100;\n      e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n      f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n      printf(\"%d%d%d\", f, e, d);\n    } else if (a >= 10) {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = a / 10;\n      f = (a - 10000 * b - 1000 * c - 100 * d - 10 * e);\n      printf(\"%d%d\", f, e);\n    } else {\n      b = 0;\n      c = 0;\n      d = 0;\n      e = 0;\n      f = a;\n      cout << f;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n % 1000) / 100;\n  d = (n % 100) / 10;\n  e = n % 10;\n  if (a != 0)\n    printf(\"00001\\n\");\n  else if (b != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 1000 + d * 100 + c * 10 + b);\n    else if (d != 0)\n      printf(\"0%d\\n\", d * 100 + c * 10 + b);\n    else if (c != 0)\n      printf(\"00%d\\n\", c * 10 + b);\n    else\n      printf(\"000%d\\n\", b);\n  } else if (c != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 100 + d * 10 + c);\n    else if (d != 0)\n      cout << \"0\" << d * 10 + c << \"\\n\";\n    else\n      printf(\"00%d\\n\", c);\n  } else if (d != 0) {\n    if (e != 0)\n      printf(\"%d\\n\", e * 10 + d);\n    else\n      printf(\"0%d\\n\", d);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, m;\n  cin >> n;\n  x = n % 10;\n  y = (n % 100 - n % 10) / 10;\n  z = (n % 1000 - n % 100) / 100;\n  m = n / 1000;\n  if (n < 10)\n    printf(\"%d\", n);\n  else if (n == 10)\n    printf(\"01\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 10000)\n    printf(\"00001\");\n  else if (n > 10 && n < 100)\n    cout << x << y;\n  else if (n > 100 && n < 1000)\n    printf(\"%d%d%d\", x, y, z);\n  else if (n > 1000 && n < 10000)\n    printf(\"%d%d%d%d\", x, y, z, m);\n  return 0;\n}\n"}
{"label": "16", "index": "30294", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a % 10;\n  c = (int)(a / 10) % 10;\n  d = (int)(a / 100) % 10;\n  e = (int)(a / 1000) % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\\n\", a);\n  else if (a >= 10 && a < 100)\n    printf(\"%d%d\\n\", b, c);\n  else if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\\n\", b, c, d);\n  else\n    printf(\"%d%d%d%d\\n\", b, c, d, e);\n  return 0;\n}\n"}
{"label": "16", "index": "30295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a > 9999)\n    printf(\"00001\");\n  else if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10);\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10);\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30296", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, e, f, g;\n  cin >> n;\n  a = (int)(n / 1000);\n  e = n - 1000 * a;\n  b = (int)(e / 100);\n  f = e - 100 * b;\n  c = (int)(f / 10);\n  g = f - 10 * c;\n  if (n >= 10000) {\n    printf(\"00001\");\n  } else {\n    if (n >= 1000) {\n      printf(\"%d%d%d%d\", g, c, b, a);\n    } else {\n      if (n >= 100) {\n        printf(\"%d%d%d\", g, c, b);\n      } else {\n        if (n >= 10) {\n          printf(\"%d%d\", g, c);\n        } else {\n          printf(\"%d\", g);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30297", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n  if (n >= 1000) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = (n % 1000) / 100;\n    d = n / 1000;\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\", x);\n  } else if (n >= 100) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = n / 100;\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\", x);\n  } else if (n >= 10) {\n    a = n % 10;\n    b = n / 10;\n    x = a * 10 + b;\n    printf(\"%02d\", x);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, f;\n  cin >> a;\n  if (a < 10 && a >= 0)\n    cout << a;\n  else if (a >= 10 && a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    printf(\"%.2d\", b * 10 + c);\n  } else {\n    if (a > 99 && a < 1000) {\n      b = a % 10;\n      c = ((a - b) / 10) % 10;\n      d = ((a - b - c * 10) / 100) % 10;\n      printf(\"%.3d\", b * 100 + c * 10 + d);\n    } else if (a > 999 && a < 10001) {\n      b = a % 10;\n      c = ((a - b) / 10) % 10;\n      d = ((a - b - c * 10) / 100) % 10;\n      f = ((a - b - c * 10 - d * 100) / 1000) % 10;\n      printf(\"%.4d\", b * 1000 + c * 100 + d * 10 + f);\n    } else\n      return 0;\n  }\n}\n"}
{"label": "16", "index": "30299", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, i, a[10];\n  cin >> n;\n  do {\n    a[m] = n % 10;\n    n /= 10;\n    m++;\n  } while (n > 0);\n  for (i = 0; i < m; i++) {\n    printf(\"%d\", a[i]);\n  }\n\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  int A[5];\n  cin >> n;\n  for (i = 1; 1 <= 5; i++) {\n    if (n < 1)\n      break;\n    cout << n % 10;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int in, k, m, sum = 0;\n  cin >> in;\n  if (in == 100)\n    printf(\"001\");\n  else {\n    k = in;\n    for (; k > 0;) {\n      m = k % 10;\n      k = k / 10;\n      sum = sum * 10 + m;\n    }\n    cout << sum;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char ch[100000], tes;\n\n  for (;; i++) {\n    ch[i] = getchar();\n    if (ch[i] == '\\n')\n      break;\n  }\n\n  for (; i >= 0; i--)\n    cout << ch[i];\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "30303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint invert(long m) {\n  printf(\"%ld\", m % 10);\n  m = m / 10;\n  if (m > 0)\n    invert(m);\n}\nint main() {\n  long n;\n\n  scanf(\"%ld\", &n);\n  invert(n);\n  printf(\" \");\n}\n"}
{"label": "16", "index": "30304", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a % 10;\n  c = (a - b) / 10 % 10;\n  d = (a - b - 10 * c) / 100 % 10;\n  e = (a - b - 10 * c - 100 * d) / 1000 % 10;\n  f = (a - b - 10 * c - 100 * d - 1000 * e) / 10000 % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\", b);\n  if (a >= 10 && a < 100)\n    printf(\"%d%d\", b, c);\n  if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\", b, c, d);\n  if (a >= 1000 && a < 10000)\n    printf(\"%d%d%d%d\", b, c, d, e);\n  if (a >= 10000)\n    printf(\"%d%d%d%d%d\", b, c, d, e, f);\n  return 0;\n}\n"}
{"label": "16", "index": "30305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[6], n, m, q;\n  int b = 0;\n  scanf(\"%d \", &n);\n  for (i = 1;; i++) {\n    m = n / 10;\n    q = n - 10 * m;\n    a[i] = q;\n    n = m;\n    b++;\n    if (n == 0)\n      break;\n  }\n  for (i = 1; i <= b; i++)\n    printf(\"%d\", a[i]);\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "30306", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  while (n != 0) {\n    a = n % 10;\n    printf(\"%d\", a);\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30307", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, a[1000];\n\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    printf(\"%d\", a[i]);\n    n = n / 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a;\n  for (int i = 1;; i++) {\n    b = a % 10;\n    cout << b;\n    c = a / 10;\n    if (c == 0)\n      break;\n    a = c;\n  }\n}\n"}
{"label": "16", "index": "30309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  cout << n % 10;\n  if (n / 10 != 0)\n    cout << (n % 100) / 10;\n  if (n / 100 != 0)\n    printf(\"%d\", (n % 1000) / 100);\n  if (n / 1000 != 0)\n    printf(\"%d\", (n % 10000) / 1000);\n  if (n / 10000 != 0)\n    printf(\"%d\", n / 10000);\n  return 0;\n}\n"}
{"label": "16", "index": "30310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, n;\n  scanf(\"%d\", &n);\n  a = (int)(n / 10000);\n  b = (int)(n / 1000 - a * 10);\n  c = (int)(n / 100 - a * 100 - b * 10);\n  d = (int)(n / 10 - a * 1000 - b * 100 - c * 10);\n  e = (int)(n - a * 10000 - b * 1000 - c * 100 - d * 10);\n  if (a != 0)\n    printf(\"%d%d%d%d%d\\n\", e, d, c, b, a);\n  if (a == 0 && b != 0)\n    printf(\"%d%d%d%d\\n\", e, d, c, b);\n  if (a == 0 && b == 0 && c != 0)\n    printf(\"%d%d%d\\n\", e, d, c);\n  if (a == 0 && b == 0 && c == 0 && d != 0)\n    printf(\"%d%d\\n\", e, d);\n  if (a == 0 && b == 0 && c == 0 && d == 0)\n    printf(\"%d\\n\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  do {\n    cout << (n % 10);\n    n = (int)n / 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30312", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[100], str2[100];\n  int i, j, l;\n  scanf(\"%s \", str1);\n  l = strlen(str1);\n  j = 0;\n  for (i = l - 1; i >= 0; --i)\n    str2[j++] = str1[i];\n  str2[j] = '\\0';\n  cout << str2 << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int n, s = 0, a, i, j = 0;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    cout << \"0\";\n  } else {\n    for (i = 1; i <= 5; i++) {\n      a = n % 10;\n      if (a == 0) {\n        j = j + 1;\n      }\n      n = n / 10;\n      s = s * 10 + a;\n      if (n == 0) {\n        break;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (j == 0) {\n        break;\n      }\n      printf(\"0\");\n    }\n    printf(\"%d\", s);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30314", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0;\n  char str[5];\n  cin >> str;\n  while (str[i] != '\\0')\n    i++;\n  for (i--; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zhengshu[10001];\n  cin.getline(zhengshu, 10001);\n  int length = strlen(zhengshu), i, a[10000];\n  for (i = 0; i < length; i++) {\n    a[i] = zhengshu[i] - '0';\n  }\n  for (i = length - 1; i >= 0; i--) {\n    cout << a[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30316", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10], n, flag;\n  flag = 0;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n != 0) {\n      flag++;\n      a[flag] = n % 10;\n      n = n / 10;\n    }\n    for (int i = 1; i <= flag; i++) {\n      printf(\"%d\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d \", &n);\n  while (n != 0) {\n    a = n % 10;\n    cout << a;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - a * 10;\n  c = n / 10 - a * 100 - b * 10;\n  d = n % 10;\n  cout << d;\n  if (a != 0 || b != 0 || c != 0)\n    cout << c;\n  if (a != 0 || b != 0)\n    printf(\"%d\", b);\n  if (a != 0)\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, f, a, m;\n\n  scanf(\"%d\", &n);\n  for (i = 5; i >= 1; i--) {\n    f = pow(10, i);\n    a = n / f;\n    if (a != 0)\n      break;\n  }\n  for (j = 1; j <= i + 1; j++) {\n    m = n % 10;\n\n    cout << m;\n    n = (n - m) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30320", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10], n = 0, k = 1, i = 0, b = 1;\n  cin >> n;\n  if (!n)\n    cout << n << endl;\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    printf(\"%d\", a[i]);\n    n = (n - a[i]) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a1, a2, a3, a4;\n  scanf(\"%d\", &n);\n  a1 = n / 1000;\n  a2 = (n - 1000 * a1) / 100;\n  a3 = (n - 1000 * a1 - 100 * a2) / 10;\n  a4 = (n - 1000 * a1 - 100 * a2 - 10 * a3);\n  if (a1 == 0 & a2 == 0 & a3 == 0)\n    printf(\"%d\", a4);\n  if (a1 == 0 & a2 != 0)\n    cout << a4 << a3 << a2;\n  if (a1 != 0 & a2 != 0 & a3 != 0)\n    printf(\"%d%d%d%d\", a4, a3, a2, a1);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, a, i;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    a = n % 10;\n    cout << a;\n    n = (n - a) / 10;\n    if (n == 0)\n      break;\n  }\n}\n"}
{"label": "16", "index": "30323", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, c;\n  cin >> n;\n  c = 0;\n  if (n != 0)\n    for (; n != 0; n = n / 10) {\n      a = n % 10;\n      printf(\"%d\", a);\n    }\n  else\n    cout << \"0\";\n  return (0);\n}\n"}
{"label": "16", "index": "30324", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x > 9999)\n    n = 5;\n  else {\n    if (x > 999)\n      n = 4;\n    else {\n      if (x > 99)\n        n = 3;\n      else {\n        if (x > 9)\n          n = 2;\n        else\n          n = 1;\n      }\n    }\n  }\n  switch (n) {\n  case 5:\n    a = x / 10000;\n    b = (x - a * 10000) / 1000;\n    c = (x - a * 10000 - b * 1000) / 100;\n    d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n    e = (x - a * 10000 - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d%d \", e, d, c, b, a);\n    break;\n  case 4:\n    b = x / 1000;\n    c = (x - b * 1000) / 100;\n    d = (x - b * 1000 - c * 100) / 10;\n    e = (x - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d \", e, d, c, b);\n    break;\n  case 3:\n    c = x / 100;\n    d = (x - c * 100) / 10;\n    e = (x - c * 100 - d * 10);\n    printf(\"%d%d%d \", e, d, c);\n    break;\n  case 2:\n    d = x / 10;\n    e = (x - d * 10);\n    printf(\"%d%d \", e, d);\n    break;\n  case 1:\n    printf(\"%d \", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int a, b, c, d, n;\n  cin >> n;\n  a = (int)(n / 1000);\n  b = (int)(n / 100 - a * 10);\n  c = (int)(n / 10 - a * 100 - b * 10);\n  d = (int)(n - a * 1000 - b * 100 - c * 10);\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0)\n        printf(\"%d\\n\", d);\n      else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    cout << d << c << b << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30326", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j;\n  int a[5];\n  scanf(\"%d \", &n);\n  for (; n > 0;) {\n    a[i] = n % 10;\n    i++;\n    n = n / 10;\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%d\", a[j]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "30327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a)\n    printf(\"%d%d%d%d%d \", e, d, c, b, a);\n  else if (b)\n    cout << e << d << c << b << \" \";\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[6];\n  cin >> a;\n  int i, j;\n  j = strlen(a);\n  for (i = j - 1; i >= 0; i--)\n    printf(\"%c\", a[i]);\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "30329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, ge, shi, bai, qian, wan, place = 1, j = 2;\n  scanf(\"%d\", &n);\n  for (i = 9; i <= 10000; i = i * 10 + 9) {\n    if (n > i)\n      place = j;\n    j = j + 1;\n  }\n  wan = n / 10000;\n  qian = (n - wan * 10000) / 1000;\n  bai = (n - wan * 10000 - qian * 1000) / 100;\n  shi = (n - wan * 10000 - qian * 1000 - bai * 100) / 10;\n  ge = n - wan * 10000 - qian * 1000 - bai * 100 - shi * 10;\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", n);\n    break;\n  default:\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30330", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num;\n  scanf(\"%d\", &num);\n  if (num == 10000)\n    printf(\"00001\\n\");\n  else if (num > 999)\n    printf(\"%d%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10,\n           num / 1000 % 10);\n  else if (num > 99)\n    printf(\"%d%d%d\\n\", num % 10, num % 100 / 10, num / 100 % 10);\n  else if (num > 9)\n    printf(\"%d%d\\n\", num % 10, num % 100 / 10);\n  else\n    printf(\"%d\\n\", num);\n  return 0;\n}\n"}
{"label": "16", "index": "30331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n\n  if (a > 9) {\n    if (a > 99) {\n      if (a > 999) {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        e = ((a - b - c - d) % 10000) / 1000;\n        cout << b << c << d << e;\n      } else {\n        b = a % 10;\n        c = ((a - b) % 100) / 10;\n        d = ((a - b - c) % 1000) / 100;\n        cout << b << c << d;\n      }\n    } else {\n      b = a % 10;\n      c = ((a - b) % 100) / 10;\n      printf(\"%d%d\", b, c);\n    }\n  } else {\n    b = a % 10;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (;;) {\n    printf(\"%d\", n % 10);\n    if (n < 10)\n      break;\n    n = n / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t[5] = {1, 10, 100, 1000, 10000};\n  int x[6];\n\n  int num;\n  cin >> num;\n\n  int length; \n  length = (num >= t[4]) + (num >= t[3]) + (num >= t[2]) + (num >= t[1]) +\n           (num >= t[0]);\n  for (int i = 1; i <= length; i++) {\n    x[i] = (num % t[i]) / t[i - 1];\n  }\n\n  if (length == 0)\n    cout << \"0\";\n  else {\n    for (int j = 1; j <= length; j++) {\n      cout << x[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30334", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10];\n  int n, i, j;\n  scanf(\"%d \", &n);\n  if (n == 0) {\n    printf(\"0\\n\");\n    return 0;\n  }\n  for (i = 1; n > 0; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n  }\n  for (j = 1; j <= i - 1; j++)\n    printf(\"%d\", a[j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a[5], i, c, n, j;\n  cin >> num;\n  n = 0;\n  for (i = 4; i >= 0; i--) {\n    for (j = 1; j <= i; j++)\n      c *= 10;\n    a[i] = ((num - num % c) / c) % 10;\n    c = 1;\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != 0) {\n      n = i;\n      break;\n    }\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  if (n < 10)\n    printf(\"%d\", a);\n  else if (n > 9 && n < 100) {\n    b = n / 10;\n    printf(\"%d%d\", a, b);\n  } else if (n > 99 && n < 1000) {\n    b = n / 10 % 10;\n    c = n / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (n > 999 && n < 10000) {\n    b = n / 10 % 10;\n    c = n / 100 % 10;\n    d = n / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, i;\n  scanf(\"%d\", &n);\n  a = n / 1000;\n  b = (n / 100) % 10;\n  c = (n / 10) % 10;\n  d = n % 10;\n  if (a)\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else if (c)\n    printf(\"%d%d\\n\", d, c);\n  else\n    printf(\"%d\\n\", d);\n}\n"}
{"label": "16", "index": "30338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, temp, p, q;\n  scanf(\"%d\", &a);\n  temp = a;\n  if (a != 0) {\n    while (temp % 10 - temp != 0 || (temp % 10 - temp == 0 && q >= 10)) {\n      p = temp % 10;\n      cout << p;\n      q = temp;\n      temp = temp / 10;\n    }\n  } else\n    printf(\"0\");\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0)\n    printf(\"%d%d\", a % 10, a / 10);\n  else if (a / 1000 == 0)\n    printf(\"%d%d%d\", a % 10, a % 100 / 10, a / 100);\n  else\n    printf(\"%d%d%d%d\", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "30340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int i, n, m = 1, c, g;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= 5; i++) {\n    m = m * 10;\n    if ((n / m) == 0) {\n      c = i;\n      break;\n    }\n  }\n  for (i = 1; i <= c; i++) {\n    g = n % 10;\n    if (g == 0) {\n      printf(\"0\");\n    } else {\n      printf(\"%d\", g);\n    }\n    n = n / 10;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char ch[100000], tes;\n\n  for (;; i++) {\n    ch[i] = getchar();\n    if (ch[i] == '\\n')\n      break;\n  }\n\n  for (; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n  cout << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "16", "index": "30342", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  if (n / 1000 != 0) {\n    a = n / 1000;\n    n = n - 1000 * a;\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (n / 100 != 0) {\n    b = n / 100;\n    n = n - 100 * b;\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d%d\", d, c, b);\n  } else if (n / 10 != 0) {\n    c = n / 10;\n    d = n - 10 * c;\n\n    printf(\"%d%d\", d, c);\n  } else\n    printf(\"%d\\n\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30343", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, num[10000];\n  int i = 0, t = 0;\n  cin >> n;\n  num[0] = n % 10;\n\n  while (n / 10 != 0) {\n    t = t + 1;\n    num[t] = (n / 10) % 10;\n    n = n / 10;\n  }\n\n  for (i; i <= t; i++) {\n    cout << num[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, weishu;\n  int ge, shi, bai, qian;\n  cin >> n;\n  if ((0 <= n) && (n <= 9))\n    printf(\"%d\\n\", n);\n  if ((10 <= n) && (n <= 99)) {\n    ge = n % 10;\n    shi = n / 10;\n    printf(\"%d%d\", ge, shi);\n  }\n  if ((100 <= n) && (n <= 999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = n / 100;\n    printf(\"%d%d%d\", ge, shi, bai);\n  }\n  if ((1000 <= n) && (n <= 9999)) {\n    ge = n % 10;\n    shi = ((n - ge) / 10) % 10;\n    bai = ((n - shi * 10) / 100) % 10;\n    qian = (n - bai * 100) / 1000;\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n  }\n}\n"}
{"label": "16", "index": "30345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n\n  char a[10];\n  int i = 0;\n  int n;\n  while ((a[i] = getchar()) != '\\n')\n    i++;\n  n = i;\n  for (i = n; i >= 0; i--)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, a[5], i, j, b[5], c, d, k;\n  scanf(\"%d \", &x);\n  if (x == 0)\n    printf(\"%d\", x);\n  else {\n    a[1] = x / 10000;\n    a[2] = (x % 10000) / 1000;\n    a[3] = (x % 1000) / 100;\n    a[4] = (x % 100) / 10;\n    a[5] = (x % 10);\n    for (i = 1;; i++) {\n      if (a[i] != 0)\n        break;\n    }\n    c = i;\n    for (i = 5; i >= c; i--)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char str[100];\n  scanf(\"%s\", &str);\n  for (i = strlen(str) - 1; i >= 0; i--) {\n    printf(\"%c\", str[i]);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30348", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b;\n  double i;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else if (n >= 10 && n < 100) {\n    for (i = 1; i <= 2; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      cout << b;\n    }\n  }\n\n  else {\n    for (i = 1; i <= 3; i++) {\n      a = n % (int)pow(10, i);\n      b = a / (pow(10, i - 1));\n      n -= a;\n      cout << b;\n    }\n    a = n % (int)pow(10, i);\n    b = a / (pow(10, i - 1));\n    n -= a;\n    if (b != 0)\n      cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30349", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n - 1000 * a) / 100;\n  c = (n - 1000 * a - b * 100) / 10;\n  d = n - 1000 * a - b * 100 - c * 10;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        cout << d << endl;\n      } else {\n        cout << d << c << endl;\n      }\n    } else {\n      printf(\"%d%d%d\\n\", d, c, b);\n    }\n  } else {\n    cout << d << c << b << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  int b;\n  if (a == 0)\n    printf(\"0\\n\");\n  else {\n    while (a != 0) {\n      b = a % 10;\n      a = a / 10;\n      printf(\"%d\", b);\n    }\n    printf(\"\\n\");\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30351", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, y, a[5], counter, i = 0;\n  scanf(\"%d \", &x);\n  do {\n    y = x / 10;\n    a[i] = x - y * 10;\n    counter = i;\n    i++;\n    x = y;\n    y = x * 10;\n  } while (y / 10 > 0);\n  for (i = 0; i <= counter; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  do {\n    cout << (n % 10);\n    n = (int)n / 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30353", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  cin >> x;\n  if (x == 10000)\n    printf(\"00001\");\n  else if (x < 10000 && x >= 1000) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = ((x - a - 10 * b) / 100) % 10;\n    d = (x - a - 10 * b - 100 * c) / 1000;\n    printf(\"%d%d%d%d\", a, b, c, d);\n  } else if (x < 1000 && x >= 100) {\n    a = x % 10;\n    b = ((x - a) / 10) % 10;\n    c = (x - a - 10 * b) / 100;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (x < 100 && x >= 10) {\n    a = x % 10;\n    b = (x - a) / 10;\n    printf(\"%d%d\", a, b);\n  } else {\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i = 1;\n  int k;\n  int sum = 0;\n  int x[10];\n  if (n == 0)\n    printf(\"0\");\n  else {\n    while (n != 0) {\n\n      x[i] = n % 10;\n      n = n / 10;\n      i++;\n    }\n    i = i - 1;\n\n    for (k = 1; k <= i; k++) {\n      printf(\"%d\", x[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[6] = {0, 0, 0, 0, 0, 0};\n  cin >> s;\n  int i = 0;\n  for (i = 5; i >= 1 && s[i] == 0; i--)\n    ;\n  for (; i >= 0; i--)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30356", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  long x;\n  int y, a, b, c, d, e;\n  scanf(\"%ld \", &x);\n  y = log10(x);\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  switch (y) {\n  case 0:\n    printf(\"%d\", e);\n    break;\n  case 1:\n    printf(\"%d%d\", e, d);\n    break;\n  case 2:\n    printf(\"%d%d%d\", e, d, c);\n    break;\n  case 3:\n    printf(\"%d%d%d%d\", e, d, c, b);\n    break;\n  case 4:\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n    break;\n  default:\n    printf(\"0\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30357", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d \", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = x / 1000;\n  if (x > 999 && x < 10000)\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  else if (x > 99 && x < 1000)\n    printf(\"%d%d%d\\n\", a, b, c);\n  else if (x > 9 && x < 100)\n    printf(\"%d%d\\n\", a, b);\n  else if (x > 0 && x < 10)\n    printf(\"%d\\n\", a);\n  else if (x == 0)\n    printf(\"0\\n\");\n  else if (x == 10000)\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  b = a % 10;\n  c = (a % 100 - b) / 10;\n  d = (a % 1000 - b - c * 10) / 100;\n  e = a / 1000;\n  if (e == 0) {\n    if (d == 0) {\n      if (c == 0)\n        printf(\"%d\", b);\n      else {\n        printf(\"%d%d\", b, c);\n      }\n    } else {\n      printf(\"%d%d%d\", b, c, d);\n    }\n  } else {\n    printf(\"%d%d%d%d\", b, c, d, e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30359", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = n / 100 - 10 * a;\n  c = n / 10 - 100 * a - 10 * b;\n  d = n - 1000 * a - 100 * b - 10 * c;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        printf(\"%d\\n\", d);\n      } else\n        printf(\"%d%d\\n\", d, c);\n    } else\n      printf(\"%d%d%d\\n\", d, c, b);\n  } else\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  float n;\n  cin >> n;\n  a = floor(n / 1000);\n  b = floor((n - a * 1000) / 100);\n  c = floor((n - a * 1000 - b * 100) / 10);\n  d = n - a * 1000 - b * 100 - c * 10;\n  if (n / 1000 >= 1)\n    cout << d << c << b << a << endl;\n\n  if (n / 1000 < 1 && n / 100 >= 1) {\n    printf(\"%d%d%d\\n\", d, c, b);\n  }\n  if (n / 100 < 1 && n / 10 >= 1) {\n    printf(\"%d%d\\n\", d, c);\n  }\n  if (n / 10 < 1) {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d \", &a);\n  if (a < 10) {\n    cout << a << \"\\n\";\n  } else if (a < 100) {\n    b = a % 10;\n    c = (a - b) / 10;\n    a = b * 10 + c;\n    printf(\"%02d\\n\", a);\n  } else if (a < 1000) {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = (a - c * 10 - b) / 100;\n    a = b * 100 + c * 10 + d;\n    printf(\"%03d\\n\", a);\n  } else {\n    b = a % 10;\n    c = ((a - b) % 100) / 10;\n    d = ((a - c * 10 - b) % 1000) / 100;\n    e = (a - d * 100 - c * 10 - b) / 1000;\n    a = b * 1000 + c * 100 + d * 10 + e;\n    printf(\"%d\\n\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint power(int x) {\n  int k, y = 1;\n  for (k = 1; k <= x; k++)\n    y = y * 10;\n  return y;\n}\n\nint main() {\n  int n, i, j, a[6];\n  cin >> n;\n  for (i = 1; i <= 5; i++)\n    if (n % power(i) == n) {\n      j = i;\n      break;\n    }\n  i = 0;\n  for (i = 0; i < j; i++) {\n    a[i] = n % 10;\n    n = n / 10;\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int z, a, b, c, d, e;\n  cin >> z;\n  a = (int)z / 10000;\n  z = z - a * 10000;\n  b = (int)z / 1000;\n  z = z - b * 1000;\n  c = (int)z / 100;\n  z = z - c * 100;\n  d = (int)z / 10;\n  e = z - d * 10;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        if (d == 0)\n          cout << e;\n        else\n          printf(\"%d%d\", e, d);\n      else\n        printf(\"%d%d%d\", e, d, c);\n    else\n      cout << e << d << c << b;\n  else\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  do {\n    cout << (n % 10);\n    n /= 10;\n  } while (n > 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[4], i = 0;\n  char mm;\n  while ((mm = cin.get()) != '\\n') {\n    a[i] = mm - '0';\n    i++;\n  }\n  for (int j = 0; j <= i - 1; j++)\n    printf(\"%d\", a[i - 1 - j]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30366", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d = 0, e;\n  cin >> e;\n  while (1000 * a <= e - 1000) {\n    a++;\n  }\n  while (1000 * a + 100 * b <= e - 100) {\n    b++;\n  }\n  while (1000 * a + 100 * b + 10 * c <= e - 10) {\n    c++;\n  }\n  d = e - 10 * c - 100 * b - 1000 * a;\n  if (a > 0) {\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else {\n    if (b > 0)\n      printf(\"%d%d%d\", d, c, b);\n    else {\n      if (c > 0) {\n        printf(\"%d%d\", d, c);\n      } else {\n        printf(\"%d\", d);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n >= 0, n < 10)\n    cout << n << \"\\n\";\n  else if (n >= 10, n < 100)\n    cout << n % 10 << n / 10 << \"\\n\";\n  else if (n >= 100, n < 1000)\n    printf(\"%d%d%d\\n\", n % 10, n % 100 / 10, n / 100);\n  else if (n >= 1000, n < 10000)\n    cout << n % 10 << n % 100 / 10 << n / 100 % 10 << n / 1000 << \"\\n\";\n  else\n    printf(\"00001\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  cin >> i;\n  do {\n    cout << i % 10;\n    i = i / 10;\n\n  } while (i != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30369", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[10001], n, i, x;\n  char ch;\n  n = 0;\n  while ((ch = cin.get()) != '\\n') {\n    a[n] = ch - '0';\n    n++;\n  }\n  for (i = 0; i < n / 2; i++) {\n    x = a[i];\n    a[i] = a[n - i - 1];\n    a[n - i - 1] = x;\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[4], i = 0;\n  char mm;\n  while ((mm = cin.get()) != '\\n') {\n    a[i] = mm - '0';\n    i++;\n  }\n  for (int j = 0; j <= i - 1; j++) {\n    printf(\"%d\", a[i - 1 - j]);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int n, b, i, k;\n  cin >> n;\n  b = n;\n  if (b == 0)\n    cout << b;\n  for (i = 0; b >= 1; i++) {\n    k = b % 10; \n    b = b / 10; \n    cout << k;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d\", &a);\n  if (a / 10 == 0)\n    printf(\"%d\", a);\n  else if (a / 100 == 0) {\n    b = a % 10;\n    c = a / 10;\n    d = 10 * b + c;\n    if (b == 0)\n      printf(\"0%d\", d);\n    else\n      printf(\"%d\", d);\n  } else if (a / 1000 == 0) {\n    b = a % 10;\n    c = a / 100;\n    d = a / 10 - 10 * c;\n    e = 100 * b + 10 * d + c;\n    if (b == 0)\n      if (d == 0)\n        printf(\"00%d\", e);\n      else\n        printf(\"0%d\", e);\n    else\n      printf(\"%d\", e);\n  } else if (a / 10000 == 0) {\n    b = a % 10;\n    c = a / 1000;\n    d = a / 100 - 10 * c;\n    e = a / 10 - 10 * d - 100 * c;\n    f = 1000 * b + 100 * e + 10 * d + c;\n    if (b == 0)\n      if (e == 0)\n        if (d == 0)\n          printf(\"000%d\", f);\n        else\n          printf(\"00%d\", f);\n      else\n        printf(\"0%d\", f);\n    else\n      printf(\"%d\", f);\n  } else {\n    printf(\"00001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    if (n <= 99) {\n      a = n % 10;\n      b = n / 10;\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n <= 999) {\n        a = n % 10;\n        c = n / 100;\n        b = (n % 100) / 10;\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n <= 9999) {\n          a = n % 10;\n          b = (n % 100) / 10;\n          c = (n % 1000) / 100;\n          d = n / 1000;\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else\n          printf(\"00001\");\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s, k, a, b, c, d;\n  scanf(\"%d\", &s);\n  a = (s - s % 1000) / 1000;\n  b = (s % 1000 - s % 100) / 100;\n  c = (s % 100 - s % 10) / 10;\n  d = s % 10;\n  k = d * 1000 + c * 100 + b * 10 + a;\n  if (a == 0)\n    if (b == 0)\n      if (c == 0)\n        printf(\"%d\", d);\n      else\n        printf(\"%d%d\", d, c);\n    else\n      printf(\"%d%d%d\", d, c, b);\n  else\n    printf(\"%d%d%d%d\", d, c, b, a);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30375", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits++] = iNum % radix;\n    iNum /= radix;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint Myatoi(char *ch, int iBits) {\n  int iNumInverse = 0;\n  int i = 0;\n\n  while (ch[i] == '\\0') {\n    i++;\n    printf(\"0\");\n  }\n  for (i = 0; i <= iBits; i++)\n    iNumInverse = 10 * iNumInverse + ch[i];\n\n  return iNumInverse;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  scanf(\"%d \", &iNum);\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    printf(\"%d\", iNumInverse);\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10);\n    iNumInverse = Myatoi(ch, iBits);\n    printf(\"%d\", iNumInverse);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30376", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  n = (n - d) / 10;\n  e = n % 10;\n  n = (n - e) / 10;\n  if (e != 0)\n    cout << a << b << c << d << e << endl;\n  else if (d != 0)\n    cout << a << b << c << d << endl;\n  else if (c != 0)\n    cout << a << b << c << endl;\n  else if (b != 0)\n    cout << a << b << endl;\n  else\n    cout << a << endl;\n  return (0);\n}\n"}
{"label": "16", "index": "30377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x % 10000 / 1000;\n  c = x % 1000 / 100;\n  d = x % 100 / 10;\n  e = x % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    cout << e << d;\n  else\n    cout << e << \"%\";\n\n  return 0;\n}\n"}
{"label": "16", "index": "30378", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x, i, result = 1;\n  scanf(\"%d\", &x);\n\n  if (!x)\n    printf(\"0\");\n  while (x) {\n    printf(\"%d\", x % 10);\n    x = x / 10;\n  }\n  printf(\"\\n\", result);\n  return 0;\n}\n"}
{"label": "16", "index": "30379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number, i, m, x[5];\n  cin >> number;\n  if (number <= 9)\n    i = 1;\n  else if (number <= 99)\n    i = 2;\n  else if (number <= 999)\n    i = 3;\n  else if (number <= 9999)\n    i = 4;\n  else\n    i = 5;\n  for (m = 0; m <= i - 1; m++) {\n    x[m] = number % 10;\n    number = (number - x[m]) / 10;\n  }\n  for (m = 0; m <= i - 1; m++)\n    printf(\"%d\", x[m]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (a != 0) {\n    cout << d << c << b << a << endl;\n  } else {\n    if (b != 0) {\n      cout << d << c << b << endl;\n    } else {\n      if (c != 0) {\n        cout << d << c << endl;\n      } else {\n        cout << d << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30381", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  long a, original;\n  cin >> a;\n  original = a;\n  int dig1, dig2, dig3, dig4, dig5;\n  int NumofDig;\n  dig1 = a / 10000;\n  a = a - 10000 * dig1;\n  dig2 = a / 1000;\n  a = a - 1000 * dig2;\n  dig3 = a / 100;\n  a = a - 100 * dig3;\n  dig4 = a / 10;\n  a = a - 10 * dig4;\n  dig5 = a;\n  if (dig1)\n    NumofDig = 5;\n  else {\n    if (dig2)\n      NumofDig = 4;\n    else {\n      if (dig3)\n        NumofDig = 3;\n      else {\n        if (dig4)\n          NumofDig = 2;\n        else\n          NumofDig = 1;\n      }\n    }\n  }\n  long Oppo;\n  Oppo = dig5 * 10000 + dig4 * 1000 + dig3 * 100 + dig2 * 10 + dig1;\n  switch (NumofDig) {\n  case 5:\n    cout << \"00001\" << endl;\n    break;\n  case 4:\n    cout << dig5 << dig4 << dig3 << dig2 << endl;\n    break;\n  case 3:\n    cout << dig5 << dig4 << dig3 << endl;\n    break;\n  case 2:\n    cout << dig5 << dig4 << endl;\n    break;\n  case 1:\n    cout << dig5 << endl;\n    break;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "16", "index": "30382", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, b, c, d;\n  int num;\n  scanf(\"%d \", &num);\n  if (num == 10000) {\n    cout << \"00001\";\n  } else if (num < 10000 && num > 999) {\n    d = num / 1000;\n    c = num / 100 - d * 10;\n    b = num / 10 - d * 100 - c * 10;\n    a = num % 10;\n    cout << a << b << c << d;\n  } else if (num < 1000 && num > 99) {\n    c = num / 100;\n    b = num / 10 - c * 10;\n    a = num % 10;\n    printf(\"%d%d%d\", a, b, c);\n  } else if (num < 100 && num > 9) {\n    b = num / 10;\n    a = num - b * 10;\n    printf(\"%d%d\", a, b);\n  } else {\n    cout << num;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30383", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i;\n  char s[20];\n  printf(\"\\n\");\n  cin >> i;\n  sprintf(s, \"%d\", i);\n  for (i = strlen(s) - 1; i >= 0; i--) {\n    printf(\"%c\", s[i]);\n  }\n  puts(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "30384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  char ch[10];\n  int n = 0;\n  while (cin >> ch[n]) {\n    n++;\n  }\n  for (int i = n - 1; i >= 0; i--)\n    cout << ch[i];\n  return 0;\n}\n"}
{"label": "16", "index": "30385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, a;\n  scanf(\"%d\", &n);\n  int num[5];\n  a = 100000;\n  for (i = 0; i <= 4; i++) {\n    a = a / 10;\n    num[i] = (n / a) % 10;\n  }\n  if (num[0] != 0) {\n    printf(\"%d%d%d%d%d\", num[4], num[3], num[2], num[1], num[0]);\n  } else if (num[1] != 0) {\n    printf(\"%d%d%d%d\", num[4], num[3], num[2], num[1]);\n  } else if (num[2] != 0) {\n    printf(\"%d%d%d\", num[4], num[3], num[2]);\n  } else if (num[3] != 0) {\n    printf(\"%d%d\", num[4], num[3]);\n  } else\n    cout << num[4];\n}\n"}
{"label": "16", "index": "30386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  scanf(\"%d\", &x);\n  a = x / 10000;\n  b = x / 1000 - x / 10000 * 10;\n  c = x / 100 - x / 1000 * 10;\n  d = x / 10 - x / 100 * 10;\n  e = x - x / 10 * 10;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0) {\n    cout << e << d << c << b;\n  } else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char exp[10], t;\n  int i, j;\n  cin.getline(exp, 10);\n  for (i = 0, j = strlen(exp) - 1; i < j; i++, j--) {\n    t = exp[i];\n    exp[i] = exp[j];\n    exp[j] = t;\n  }\n  for (i = 0; i < strlen(exp); i++) {\n    cout << exp[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[4];\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n > 1000 && n < 10000) {\n    a[3] = n / 1000;\n    a[2] = (n % 1000) / 100;\n    a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n    a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n    cout << a[0] * 1000 + a[1] * 100 + a[2] * 10 + a[3] << endl;\n  } else if (n == 100)\n    cout << \"001\";\n  else if (n > 100 && n < 1000) {\n    a[2] = n / 100;\n    a[1] = (n % 100) / 10;\n    a[0] = n - a[2] * 100 - a[1] * 10;\n    cout << a[0] * 100 + a[1] * 10 + a[2];\n  } else if (n == 10)\n    cout << \"01\";\n  else if (n > 10 && n < 100) {\n    a[1] = n / 10;\n    a[0] = n - a[1] * 10;\n    cout << a[0] * 10 + a[1];\n  } else if (n >= 0 && n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "30389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  int b;\n  if (a == 0) {\n    printf(\"0\\n\");\n  } else {\n    while (a != 0) {\n      b = a % 10;\n      a = a / 10;\n      printf(\"%d\", b);\n    }\n    printf(\"\\n\");\n  }\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;                   \n  b = n / 100 - a * 10;           \n  c = n / 10 - a * 100 - b * 10;  \n  d = n % 10;                     \n  cout << d;                      \n  if (a != 0 || b != 0 || c != 0) \n    cout << c;                    \n  if (a != 0 || b != 0)           \n    cout << b;                    \n  if (a != 0)                     \n    cout << a;                    \n  return 0;\n}\n"}
{"label": "16", "index": "30391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n >= 1000 && n < 10000) {\n    a = n / 1000;\n    b = (n - a * 1000) / 100;\n    c = (n - a * 1000 - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n  } else {\n    if (n >= 100 && n < 1000) {\n      a = n / 100;\n      b = (n - a * 100) / 10;\n      c = n - a * 100 - b * 10;\n      printf(\"%d%d%d\\n\", c, b, a);\n    } else {\n      if (n >= 10 && n < 100) {\n        a = n / 10;\n        b = n - a * 10;\n        printf(\"%d%d\\n\", b, a);\n      } else {\n        if (n < 10) {\n          cout << n << \"\\n\";\n        } else {\n          printf(\"00001\\n\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30392", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  else\n    while (n) {\n      a = n % 10;\n      n = (n - a) / 10;\n      printf(\"%d\", a);\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "30393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, s;\n  cin >> n;\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n == 1000)\n    printf(\"0001\");\n  else if (n == 100)\n    printf(\"001\");\n  else if (n == 10)\n    cout << \"01\";\n  else {\n    if (n / 1000 > 0) {\n      a = n % 10;\n      b = ((n - a) / 10) % 10;\n      c = ((n - a - b * 10) / 100) % 10;\n      d = n / 1000;\n      s = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%d\", s);\n    } else {\n      if (n / 100 > 0) {\n        a = n % 10;\n        b = ((n - a) / 10) % 10;\n        c = n / 100;\n        s = a * 100 + b * 10 + c;\n        printf(\"%d\", s);\n      } else {\n        if (n / 10 > 0) {\n          a = n % 10;\n          b = n / 10;\n          s = a * 10 + b;\n          printf(\"%d\", s);\n        } else\n          printf(\"%d\", n);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10000];\n  int b, i, c;\n  scanf(\"%s\", a);\n  b = strlen(a);\n  i = 0;\n  if (b % 2 == 0) {\n    while (i <= (b / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  } else {\n    while (i <= ((b - 1) / 2 - 1)) {\n      c = a[b - 1 - i];\n      a[b - 1 - i] = a[i];\n      a[i] = c;\n      i++;\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30395", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid reverse(char s[], int a, int b) {\n  int i, j;\n  char temp;\n  for (i = a, j = b - 1; i < j; i++, j--) {\n    temp = s[i];\n    s[i] = s[j];\n    s[j] = temp;\n  }\n  for (i = a; i < b; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n}\n\nint main() {\n  char string[10];\n  int len;\n\n  cin >> string;\n  len = strlen(string);\n  reverse(string, 0, len);\n}\n"}
{"label": "16", "index": "30396", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, x;\n  cin >> x;\n  e = x / 10000;\n  d = (x - e * 10000) / 1000;\n  c = (x - e * 10000 - d * 1000) / 100;\n  b = (x - e * 10000 - d * 1000 - c * 100) / 10;\n  a = x - e * 10000 - d * 1000 - c * 100 - b * 10;\n  if (x < 10)\n    printf(\"%d\", a);\n  else if (x < 100)\n    printf(\"%02d\", 10 * a + b);\n  else if (x < 1000)\n    printf(\"%03d\", 100 * a + 10 * b + c);\n  else if (x < 10000)\n    printf(\"%04d\", 1000 * a + 100 * b + 10 * c + d);\n  else if (x == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d \", &n);\n  if (n <= 9 && 0 <= n)\n    cout << n;\n  if (n <= 99 && 10 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    cout << b;\n  }\n  if (n <= 999 && 100 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    printf(\"%d\", b);\n    c = n % 10;\n    cout << c;\n  }\n  if (n <= 9999 && 1000 <= n) {\n    a = n % 10;\n    n = n / 10;\n    cout << a;\n    b = n % 10;\n    n = n / 10;\n    cout << b;\n    c = n % 10;\n    n = n / 10;\n    cout << c;\n    d = n % 10;\n    cout << d;\n  }\n  if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "30398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, k = 0;\n  int a[6] = {0};\n  scanf(\"%d \", &n);\n  do {\n    a[i] = (n % 10);\n    n = (n - a[i]) / 10;\n    i++;\n    k++;\n  } while (n != 0);\n  for (i = 0; i < k; i++) {\n    printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30399", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c;\n  cin >> a;\n  b = a / 10000;\n  if (b)\n    c = 5;\n  else {\n    b = a / 1000;\n    if (b)\n      c = 4;\n    else {\n      b = a / 100;\n      if (b)\n        c = 3;\n      else {\n        b = a / 10;\n        if (b)\n          c = 2;\n        else\n          c = 1;\n      }\n    }\n  }\n  switch (c) {\n  case 5:\n    printf(\"%d%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100,\n           a % 10000 / 1000, a / 10000);\n    break;\n  case 4:\n    printf(\"%d%d%d%d \", a % 10, a % 100 / 10, a % 1000 / 100, a / 1000);\n    break;\n  case 3:\n    printf(\"%d%d%d \", a % 10, a % 100 / 10, a / 100);\n    break;\n  case 2:\n    printf(\"%d%d \", a % 10, a / 10);\n    break;\n  case 1:\n    printf(\"%d \", a);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    printf(\"%d\", n);\n  else\n    while (n) {\n      cout << n % 10;\n      n = n / 10;\n    }\n  return 0;\n}\n"}
{"label": "16", "index": "30401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, decade, hundred, thousand;\n  cin >> n;\n  cout << n - n / 10 * 10;\n  if (n >= 10) {\n    decade = n / 10;\n    cout << decade - decade / 10 * 10;\n  }\n  if (n >= 100) {\n    hundred = decade / 10;\n    cout << hundred - hundred / 10 * 10;\n  }\n  if (n >= 1000) {\n    thousand = hundred / 10;\n    cout << thousand - thousand / 10 * 10;\n  }\n  if (n == 10000) {\n    cout << \"1\" << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  a = n / 10000;\n  b = (n - a * 10000) / 1000;\n  c = (n - a * 10000 - b * 1000) / 100;\n  d = (n - a * 10000 - b * 1000 - c * 100) / 10;\n  e = n - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (a)\n    printf(\"%d%d%d%d%d \", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d \", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d)\n    printf(\"%d%d\", e, d);\n  else\n    cout << e;\n  return 0;\n}\n"}
{"label": "16", "index": "30403", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100)\n    printf(\"%d%d\", a % 10, (a - a % 10) / 10);\n  else if (a < 1000) {\n    printf(\"%d%d%d\", a % 10, (a % 100 - a % 10) / 10, (a - a % 100) / 100);\n  } else if (a < 10000)\n    printf(\"%d%d%d%d\", a % 10, (a % 100 - a % 10) / 10,\n           (a % 1000 - a % 100) / 100, (a - a % 1000) / 1000);\n  else\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "30404", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int A, B, a[5], i = 0, j = 0;\n  cin >> A;\n  do {\n    B = A / 10;\n    a[i] = A - B * 10;\n    A = B;\n    i++;\n    j++;\n  } while (A != 0);\n  for (i = 0; i < j; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30405", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, m, n, a[10];\n  cin >> n;\n  m = n;\n  p = 1;\n  while (m / 10 != 0) {\n    a[p - 1] = m % 10;\n    m = m / 10;\n    p++;\n  }\n  a[p - 1] = m;\n  for (int j = 0; j < p; j++) {\n    cout << a[j];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30406", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n == 0)\n    printf(\"%d\", 0);\n\n  else\n    for (i = 1;; i++) {\n      static int k;\n      if (i == 1)\n        k = 10;\n      else\n        k *= 10;\n      if (n < k / 10)\n        break;\n      else {\n        int c = n % k;\n        cout << c / (k / 10);\n      }\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30407", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[5];\n  int i, j;\n  for (i = 0; i < 5; i++) {\n    cin >> a[i];\n    if (a[i] == '\\n') {\n      for (j = i; j < 5; j++)\n        a[j] = '\\0';\n\n      break;\n    }\n  }\n  for (i = 4; i >= 0; i--) {\n    if (a[i] != '\\0')\n      printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "30408", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, l;\n  char s[4], r[4];\n  scanf(\"%s\", s);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    r[i] = s[l - 1 - i];\n  }\n  for (i = 0; i < l; i++) {\n    cout << r[i];\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a < 10) {\n    b = a;\n    printf(\"%d\", b);\n  } else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    c = (a % 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    c = (a % 1000) / 100;\n    d = (a % 100) / 10;\n    e = a % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[4], b;\n\n  cin >> b;\n  a[0] = b % 10;\n  b = b / 10;\n  a[1] = b % 10;\n  b = b / 10;\n  a[2] = b % 10;\n  b = b / 10;\n  a[3] = b % 10;\n  b = b / 10;\n  if (a[3] != 0)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (a[2] != 0)\n    cout << a[0] << a[1] << a[2];\n  else if (a[1] != 0)\n    cout << a[0] << a[1];\n  else\n    cout << a[0];\n\n  return 0;\n}\n"}
{"label": "16", "index": "30411", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a;\n  if (a >= 1000) {\n    b = a % 1000;\n    c = b % 100;\n    d = c % 10;\n    cout << d << (c - d) / 10 << (b - c) / 100 << (a - b) / 1000 << endl;\n  } else if (a < 1000 && a >= 100) {\n    b = a % 100;\n    c = b % 10;\n    cout << c << (b - c) / 10 << (a - b) / 100 << endl;\n  } else if (a < 100 && a >= 10) {\n    b = a & 10;\n    cout << b << (a - b) / 10 << endl;\n  } else if (a >= 0 && a <= 9) {\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, b, c, d, i, t, j;\n  c = 0;\n  scanf(\"%d\", &n);\n  if (n > 0 && n < 10000) {\n    for (i = 4; i >= 1; i--) {\n      b = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      if (b != 0) {\n        j = i;\n        break;\n      }\n    }\n    for (i = 1; i <= j; i++) {\n      d = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      printf(\"%d\", d);\n    }\n  } else if (n == 0)\n    printf(\"0\");\n  else if (n == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "30413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, e, f, g;\n  scanf(\"%d\", &n);\n  a = (int)(n / 1000);\n  e = n - 1000 * a;\n  b = (int)(e / 100);\n  f = e - 100 * b;\n  c = (int)(f / 10);\n  g = f - 10 * c;\n  if (n >= 10000) {\n    printf(\"00001\");\n  } else {\n    if (n >= 1000) {\n      printf(\"%d%d%d%d\", g, c, b, a);\n    } else {\n      if (n >= 100) {\n        printf(\"%d%d%d\", g, c, b);\n      } else {\n        if (n >= 10) {\n          cout << g << c;\n        } else {\n          cout << g;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30414", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, a, b, c, d, e;\n  cin >> t;\n  a = t / 10000;\n  b = t / 1000 - 10 * a;\n  c = t / 100 - 100 * a - 10 * b;\n  d = t / 10 - 1000 * a - 100 * b - 10 * c;\n  e = t % 10;\n  if (a)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c)\n    printf(\"%d%d%d\", e, d, c);\n  else if (b)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30415", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  cin >> a;\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a < 10)\n    cout << a5 << endl;\n  else if (a < 100)\n    cout << a5 << a4 << endl;\n  else if (a < 1000)\n    cout << a5 << a4 << a3 << endl;\n  else if (a < 10000)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, n;\n  scanf(\"%d\", &n);\n  if (n >= 1 && n <= 9)\n    cout << n;\n\n  if (10 <= n && n <= 99) {\n    a = n / 10;\n    b = n - a;\n    printf(\"%d%d\", b, a);\n  }\n  if (100 <= n && n <= 999) {\n    a = n / 100;\n    b = (n - 100 * a) / 10;\n    c = n - a * 100 - b * 10;\n    printf(\"%d%d%d\", c, b, a);\n  }\n  if (1000 <= n && n <= 9999) {\n    a = n / 1000;\n    b = (n - 1000 * a) / 100;\n    c = (n - 1000 * a - b * 100) / 10;\n    d = n - a * 1000 - b * 100 - c * 10;\n    cout << d << c << b << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30417", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a;\n  a = getchar();\n  if (a <= 57 && a >= 48) {\n    char b;\n    b = getchar();\n    if (b <= 57 && b >= 48) {\n      char c;\n      c = getchar();\n      if (c <= 57 && c >= 48) {\n        char d;\n        d = getchar();\n        if (d <= 57 && d >= 48) {\n          char e;\n          e = getchar();\n          if (e <= 57 && e >= 48)\n            printf(\"%c%c%c%c%c\", e, d, c, b, a);\n          else\n            cout << d << c << b << a;\n        } else\n          printf(\"%c%c%c\", c, b, a);\n      } else\n        printf(\"%c%c\", b, a);\n    } else\n      printf(\"%c\", a);\n  } else\n    printf(\"error\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a = 0, i = 5, m = 0, b;\n  cin >> n;\n  do {\n    printf(\"%d\", n % 10);\n    n = n / 10;\n  } while (n != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30419", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, z, y;\n  cin >> a;\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = a / 100;\n    z = a % 100;\n    c = z / 10;\n    d = z % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = a / 1000;\n    z = a % 1000;\n    c = z / 100;\n    y = z % 100;\n    d = y / 10;\n    e = y % 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30420", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, a[5], j;\n  cin >> b;\n  a[4] = b / 10000;\n  a[3] = (b - a[4] * 10000) / 1000;\n  a[2] = (b - a[4] * 10000 - a[3] * 1000) / 100;\n  a[1] = (b - a[4] * 10000 - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = b - a[4] * 10000 - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  if (b >= 10000)\n    for (j = 0; j <= 4; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 1000)\n    for (j = 0; j <= 3; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 100)\n    for (j = 0; j <= 2; j++)\n      printf(\"%d\", a[j]);\n  else if (b >= 10)\n    for (j = 0; j <= 1; j++)\n      printf(\"%d\", a[j]);\n  else\n    printf(\"%d\", a[0]);\n  return 0;\n}\n"}
{"label": "16", "index": "30421", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  int r1, r2, r3, r4;\n  if (a > 9999)\n    b = 5;\n  else if (a > 999)\n    b = 4;\n  else if (a > 99)\n    b = 3;\n  else if (a > 9)\n    b = 2;\n  else\n    b = 1;\n  switch (b) {\n  case 1:\n    printf(\"%d\", a);\n    break;\n  case 5:\n    printf(\"00001\");\n    break;\n  case 2:\n    r3 = a / 10;\n    r4 = a - r3 * 10;\n    printf(\"%d%d\", r4, r3);\n    break;\n  case 3:\n    r2 = a / 100;\n    r3 = (a - r2 * 100) / 10;\n    r4 = a - r2 * 100 - r3 * 10;\n    cout << r4 << r3 << r2;\n    break;\n  case 4:\n    r1 = a / 1000;\n    r2 = (a - r1 * 1000) / 100;\n    r3 = (a - r1 * 1000 - r2 * 100) / 10;\n    r4 = (a - r1 * 1000 - r2 * 100 - r3 * 10);\n    cout << r4 << r3 << r2 << r1;\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d;\n  cin >> a;\n  if (a == 10000)\n    cout << \"00001\";\n  else if (a >= 1000) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    d = a % 10;\n    a = (a - d) / 10;\n    printf(\"%d%d%d%d\", b, c, d, a);\n  } else if (a >= 100) {\n    b = a % 10;\n    a = (a - b) / 10;\n    c = a % 10;\n    a = (a - c) / 10;\n    printf(\"%d%d%d\", b, c, a);\n  } else if (a >= 10) {\n    b = a % 10;\n    a = (a - b) / 10;\n    printf(\"%d%d\", b, a);\n  } else\n    cout << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30423", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e;\n  cin >> x;\n  a = x / 10000;\n  b = (x - a * 10000) / 1000;\n  c = (x - a * 10000 - b * 1000) / 100;\n  d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n  e = x - a * 10000 - b * 1000 - c * 100 - d * 10;\n  if (x >= 10000 && x <= 99999)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (x >= 1000 && x <= 9999)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (x >= 100 && x <= 999)\n    printf(\"%d%d%d\", e, d, c);\n  else if (x >= 10 && x <= 99)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  cin >> a;\n  if (a >= 1000) {\n    b = a / 1000;\n    c = a - b * 1000;\n    d = c / 100;\n    e = c - 100 * d;\n    f = e / 10;\n    g = e - 10 * f;\n\n    n = g * 1000 + f * 100 + d * 10 + b;\n    printf(\"%04d\", n);\n  } else if (a >= 100) {\n    b = a / 100;\n    c = a - b * 100;\n    d = c / 10;\n    e = c - 10 * d;\n    n = 100 * e + 10 * d + b;\n    printf(\"%03d\", n);\n  } else if (a >= 10) {\n    b = a / 10;\n    c = a - 10 * b;\n    n = 10 * c + b;\n    printf(\"%02d\", n);\n  } else\n\n  {\n    cout << a;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x, k, a, b, c, d;\n  cin >> x;\n  if (x > 999)\n    k = 4;\n  else if (x > 99)\n    k = 3;\n  else if (x > 9)\n    k = 2;\n  else\n    k = 1;\n  switch (k) {\n  case 1:\n    d = x;\n    printf(\"%d\\n\", d);\n    break;\n  case 2:\n    c = x / 10;\n    d = x - 10 * c;\n    printf(\"%d%d\\n\", d, c);\n    break;\n  case 3:\n    b = x / 100;\n    c = (x - 100 * b) / 10;\n    d = x - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 4:\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    printf(\"%d%d%d%d\\n\", d, c, b, a);\n    break;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30426", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  if (a == 0)\n    printf(\"0\");\n  while (a != 0) {\n    printf(\"%d\", a - (a / 10) * 10);\n    a = a / 10;\n  }\n}\n"}
{"label": "16", "index": "30427", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100] = {0};\n  int i = 0, b = n, j;\n  do {\n    b = b / 10;\n    i++;\n  } while (b != 0);\n  for (j = 0; j < i; j++) {\n    a[j] = n % 10;\n    n = n / 10;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%d\", a[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, i, result = 1;\n  scanf(\"%d\", &x);\n\n  if (!x)\n    printf(\"0\");\n  while (x) {\n    cout << x % 10;\n    x = x / 10;\n  }\n  printf(\"\\n\", result);\n  return 0;\n}\n"}
{"label": "16", "index": "30429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, p;\n  scanf(\"%d \", &n);\n  p = 0;\n  cout << (n % 10);\n  while (n > 9) {\n    p = (n - (n % 10)) / 10;\n    n = p;\n    cout << (n % 10);\n  }\n}\n"}
{"label": "16", "index": "30430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[6], m = 0, j, i, p = 0, k = 0;\n  cin >> n;\n  for (i = 0;; i++) {\n    a[i] = n % 10;\n    n = (n - a[i]) / 10;\n    if (n != 0)\n      p += 1;\n    else\n      break;\n  }\n  for (i = 0; i <= p; i++)\n    cout << a[i];\n\n  return 0;\n}\n"}
{"label": "16", "index": "30431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, an[10];\n  scanf(\"%d\", &n);\n  int j = 0;\n  for (i = n; i > 0; i = i / 10) {\n    an[j] = i % 10;\n    j++;\n  }\n  for (i = 0; i < j; i++) {\n    cout << an[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid nixu(int k);\nint main() {\n  int n;\n  cin >> n;\n  nixu(n);\n  return 0;\n}\nvoid nixu(int k) {\n  if (k > 0) {\n    cout << k % 10;\n    k /= 10;\n    nixu(k);\n  }\n}\n"}
{"label": "16", "index": "30433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  if (n <= 9999 && n > 1000) {\n    i = n / 1000 + n % 1000 / 100 * 10 + n % 100 / 10 * 100 + n % 10 * 1000;\n    cout << i << endl;\n  } else if (n == 1000)\n    cout << \"0001\" << endl;\n  else if (n <= 999 && n > 100) {\n    i = n / 100 + n % 100 / 10 * 10 + n % 10 * 100;\n    cout << i << endl;\n  } else if (n == 100)\n    cout << \"001\" << endl;\n  else if (n <= 99 && n > 10) {\n    i = n % 10 * 10 + n / 10;\n  } else if (n == 10)\n    cout << \"01\" << endl;\n  else if (n <= 9 && n >= 0)\n    cout << n << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30434", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a[6], n, m, q;\n  int b = 0;\n  scanf(\"%d \", &n);\n  for (i = 1;; i++) {\n    m = n / 10;\n    q = n - 10 * m;\n    a[i] = q;\n    n = m;\n    b++;\n    if (n == 0)\n      break;\n  }\n  for (i = 1; i <= b; i++)\n    cout << a[i];\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n == 0) {\n    printf(\"0\");\n  }\n  while (n > 0) {\n    cout << n % 10;\n    n /= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30436", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  b = a % 10;\n  c = (int)(a / 10) % 10;\n  d = (int)(a / 100) % 10;\n  e = (int)(a / 1000) % 10;\n  if (a >= 0 && a < 10)\n    printf(\"%d\\n\", a);\n  else if (a >= 10 && a < 100)\n    printf(\"%d%d\\n\", b, c);\n  else if (a >= 100 && a < 1000)\n    printf(\"%d%d%d\\n\", b, c, d);\n  else\n    printf(\"%d%d%d%d\\n\", b, c, d, e);\n  return 0;\n}\n"}
{"label": "16", "index": "30437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0;\n  cin >> a;\n  if (a != 0)\n    while (a != 0) {\n      b = a % 10;\n      cout << b;\n      a = a / 10;\n    }\n  else\n    cout << 0;\n  return 0;\n}\n"}
{"label": "16", "index": "30438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  cin >> n;\n  if (n == 100)\n    printf(\"001\");\n  else if (n >= 1 && n <= 9) {\n    printf(\"%d\", n);\n  } else {\n    if (n >= 10 && n <= 99) {\n      a = n % 10;\n      b = n / 10;\n      c = a * 10 + b;\n      d = e = 0;\n      printf(\"%d\", c);\n    } else if (n > 100 && n <= 999) {\n      a = n % 100;\n      b = a % 10;\n      c = a / 10;\n      d = n / 100;\n      e = b * 100 + c * 10 + d;\n      printf(\"%d\", e);\n    } else if (n >= 1000 && n <= 9999) {\n      a = n % 10;\n      b = (n % 100 - a) / 10;\n      c = n % 1000 / 100;\n      d = n / 1000;\n      e = a * 1000 + b * 100 + c * 10 + d;\n      printf(\"%d\", e);\n    } else {\n      printf(\"error\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  scanf(\"%d\", &n);\n  b = n;\n  do {\n    a = b % 10;\n    c = b;\n    b = b / 10;\n    printf(\"%d\", a);\n  } while (c / 10 != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30440", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d, e, y;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  b = (n - 10000 * a) / 1000;\n  c = (n - 10000 * a - 1000 * b) / 100;\n  d = (n - 10000 * a - 1000 * b - 100 * c) / 10;\n  e = n - 10000 * a - 1000 * b - 100 * c - 10 * d;\n  if (a != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n    printf(\"%d\", a);\n  } else if (b != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n    printf(\"%d\", b);\n  } else if (c != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n    printf(\"%d\", c);\n  } else if (d != 0) {\n    printf(\"%d\", e);\n    printf(\"%d\", d);\n  } else {\n    printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30441", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, n;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    printf(\"%d\\n\", n);\n  else {\n    for (; n > 0;) {\n      a = n % 10;\n      printf(\"%d\", a);\n      n = n / 10;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  cin >> n;\n  b = n;\n  c = n;\n  if (n < 10)\n    printf(\"%d\", n);\n  else {\n    int length = 1, k = 10;\n    while ((c / k) != 0) {\n      length++;\n      k = k * 10;\n    }\n    for (int i = 1; i <= length; i++) {\n      printf(\"%d\", b % 10);\n      b = (b - b % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, i, j, a[5];\n  cin >> x;\n  i = 0;\n  while (x >= 10) {\n    a[i] = x % 10;\n    x = x / 10;\n    i = i + 1;\n  }\n  a[i] = x;\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]);\n  cout << \"\\n\";\n}\n"}
{"label": "16", "index": "30444", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main(void) {\n  int num, temp = 0, sub = 0, dv = 10;\n  ;\n  scanf(\"%d\", &num);\n  int a, b = 1;\n\n  if (num == 0) {\n    printf(\"0\");\n    return 0;\n  }\n\n  while (num != sub) {\n    temp = (num - (num / dv) * dv - sub) / (dv / 10);\n    sub += temp * (dv / 10);\n\n    printf(\"%d\", temp);\n    dv *= 10;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30445", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e, f;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100) {\n    a = n % 10;\n    b = n / 10;\n    cout << a << b;\n  } else if (n < 1000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    printf(\"%d%d%d\", a, c, d);\n  } else if (n < 10000) {\n    a = n % 10;\n    b = n / 10;\n    c = b % 10;\n    d = b / 10;\n    e = d % 10;\n    f = d / 10;\n    cout << a << c << e << f;\n  } else if (n == 10000)\n    cout << 00001;\n  return 0;\n}\n"}
{"label": "16", "index": "30446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[10];\n\n  cin >> a;\n  int i, l;\n  l = strlen(a);\n  for (i = 0; i < l; i++)\n    b[l - i - 1] = a[i];\n\n  b[l] = '\u0000';\n  puts(b);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30447", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[10], n = 0, k = 1, i = 0, b = 1;\n  cin >> n;\n  if (!n)\n    cout << n << endl;\n  for (i = 0; n != 0; i++) {\n    a[i] = n % 10;\n    cout << a[i];\n    n = (n - a[i]) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  i = (n % 10) * 10 + (n - n % 10) / 10;\n  j = (n % 10) * 100 + (n % 100 - n % 10) + (n - n % 100) / 100;\n  k = (n % 10) * 1000 + (n % 100 - n % 10) * 10 + (n % 1000 - n % 100) / 10 +\n      (n - n % 1000) / 1000;\n  if (n % 10 == n)\n    cout << n;\n  else if (n % 100 == n)\n    printf(\"%02d\", i);\n  else if (n % 1000 == n)\n    printf(\"%03d\", j);\n  else\n    printf(\"%04d\", k);\n  return 0;\n}\n"}
{"label": "16", "index": "30449", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, n, i, j = 0, k = 1, a[5] = {0}, t;\n  cin >> m;\n  for (i = 1; i <= 10000; i = i * 10) {\n    if (m / i != 0)\n      j++;\n    else\n      break;\n  }\n  for (i = 1; i < j; i++) {\n    k = 10 * k;\n  }\n  for (i = j; i >= 1; i--) {\n    a[i] = m / k;\n    m = m % k;\n    k = k / 10;\n  }\n  for (i = 1; i <= j; i++) {\n    printf(\"%d\", a[i]);\n  }\n  getchar();\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "16", "index": "30450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, b, c = 11, i = 1, j = 1;\n  scanf(\"%d\", &n);\n\n  if (n == 0)\n    cout << n;\n  else\n\n    while (n > 0) {\n\n      b = n % 10;\n      cout << b;\n      n = n / 10;\n    }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30451", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[10000], i = 0, d[10000];\n  scanf(\"%d \", &n);\n  float b[10000], c;\n  c = n / 10;\n  b[0] = floor(c);\n  a[0] = n % 10;\n  if (b[0] == 0)\n    cout << n << endl;\n  if (b[0] != 0) {\n    while (1) {\n      a[i + 1] = (int)b[i] % 10;\n      b[i + 1] = floor(b[i] / 10);\n      if (b[i + 1] < 1) {\n        break;\n      }\n      i++;\n    }\n    for (int k = 0; k <= i + 1; k++) {\n      cout << a[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30452", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, y;\n  scanf(\"%d\", &n);\n  if (n > 9999)\n    y = 5;\n  else if (n > 999)\n    y = 4;\n  else if (n > 99)\n    y = 3;\n  else if (n > 9)\n    y = 2;\n  else\n    y = 1;\n  a = n / 1000;\n  b = (n - a * 1000) / 100;\n  c = (n - a * 1000 - b * 100) / 10;\n  d = (n - a * 1000 - b * 100 - c * 10);\n  switch (y) {\n  case 5:\n    printf(\"10000\");\n    break;\n  case 4:\n    cout << d << c << b << a;\n    break;\n  case 3:\n    printf(\"%d%d%d\", d, c, b);\n    break;\n  case 2:\n    printf(\"%d%d\", d, c);\n    break;\n  case 1:\n    printf(\"%d\", d);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (a != 0) {\n    cout << d << c << b << a << endl;\n  } else if (b != 0) {\n    cout << d << c << b << endl;\n  } else if (c != 0) {\n    printf(\"%d%d\\n\", d, c);\n  } else {\n    cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b, c, d, e, a;\n  cin >> a;\n  if (a == 10000)\n    cout << \"00001\";\n  else {\n    if (a >= 1000) {\n      e = (int)(a / 1000), d = (int)((a - 1000 * e) / 100),\n      c = (int)((a - 1000 * e - 100 * d) / 10), b = a % 10;\n      printf(\"%d%d%d%d\", b, c, d, e);\n    } else {\n      if (a >= 100) {\n        d = (int)(a / 100), c = (int)((a - 100 * d) / 10), b = a % 10;\n        printf(\"%d%d%d\", b, c, d);\n      } else {\n        if (a >= 10) {\n          c = (int)(a / 10), b = a % 10;\n          printf(\"%d%d\", b, c);\n        } else\n          printf(\"%d\", a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5], i = 0, j;\n  scanf(\"%d\", &n);\n  if (n >= 10) {\n    while (n >= 10) {\n      a[i] = n % 10;\n      n = (n - a[i]) / 10;\n      i++;\n    }\n    for (j = 0; j <= i - 1; j++)\n      printf(\"%d\", a[j]);\n  } else\n    ;\n  printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, i;\n  cin >> a;\n  i = 1 + log10(a);\n  b = a / 10000;\n  a = a % 10000;\n  c = a / 1000;\n  a = a % 1000;\n  d = a / 100;\n  a = a % 100;\n  e = a / 10;\n  a = a % 10;\n  f = a;\n  printf(\"%d\", f);\n  if (i > 1)\n    printf(\"%d\", e);\n  if (i > 2)\n    printf(\"%d\", d);\n  if (i > 3)\n    printf(\"%d\", c);\n  if (i > 4)\n    printf(\"%d\", b);\n  return 0;\n}\n"}
{"label": "16", "index": "30457", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int a, b, c, d;   \n  int num;          \n  cin >> num;       \n  if (num == 10000) \n  {\n    cout << \"00001\";\n  } else if (num < 10000 && num > 999) \n  {\n    d = num / 1000;                  \n    c = num / 100 - d * 10;          \n    b = num / 10 - d * 100 - c * 10; \n    a = num % 10;                    \n    cout << a << b << c << d;        \n  } else if (num < 1000 && num > 99) \n  {\n    c = num / 100;                 \n    b = num / 10 - c * 10;         \n    a = num % 10;                  \n    cout << a << b << c;           \n  } else if (num < 100 && num > 9) \n  {\n    b = num / 10;     \n    a = num - b * 10; \n    cout << a << b;   \n  } else {\n    cout << num; \n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30458", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[10000], i = 0, d[10000];\n  cin >> n;\n  float b[10000], c;\n  c = n / 10;\n  b[0] = floor(c);\n  a[0] = n % 10;\n  if (b[0] == 0)\n    cout << n << endl;\n  if (b[0] != 0) {\n    while (1) {\n      a[i + 1] = (int)b[i] % 10;\n      b[i + 1] = floor(b[i] / 10);\n      if (b[i + 1] < 1)\n        break;\n      i++;\n    }\n    for (int k = 0; k <= i + 1; k++) {\n      cout << a[k];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30459", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == a % 10)\n    cout << a;\n  else if (a == a % 100)\n    printf(\"%02d\", a = (a % 100 - a % 10) / 10 + (a % 10) * 10);\n  else if (a == a % 1000)\n    printf(\"%03d\", a = (a % 1000 - a % 100) / 100 + (a % 100 - a % 10) +\n                       (a % 10) * 100);\n  else\n    printf(\"%04d\", a = (a % 10000 - a % 1000) / 1000 +\n                       (a % 1000 - a % 100) / 10 + (a % 100 - a % 10) * 10 +\n                       (a % 10) * 1000);\n  return 0;\n}\n"}
{"label": "16", "index": "30460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 1, a, b, c, d, e;\n  char ch;\n  a = b = c = d = e = -1;\n  while ((ch = cin.get()) != '\\n') {\n    switch (i) {\n    case 1:\n      a = ch - '0';\n      break;\n    case 2:\n      b = ch - '0';\n      break;\n    case 3:\n      c = ch - '0';\n      break;\n    case 4:\n      d = ch - '0';\n      break;\n    case 5:\n      e = ch - '0';\n      break;\n    }\n    i++;\n  }\n  if (e == -1 && d != -1)\n    cout << d << c << b << a << endl;\n  else if (e == -1 && d == -1 && c != -1)\n    cout << c << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b != -1)\n    cout << b << a << endl;\n  else if (e == -1 && d == -1 && c == -1 && b == -1 && a != -1)\n    cout << a << endl;\n  else\n    cout << e << d << c << b << a << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "16", "index": "30461", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  scanf(\"%d\", &a);\n  if (a > 999) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    e = (a - b * 1000 - c * 100 - d * 10) / 1;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a > 99) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = (a - b * 100 - c * 10) / 1;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a > 9) {\n    b = a / 10;\n    c = (a - b * 10) / 1;\n    printf(\"%d%d\", c, b);\n  } else\n    printf(\"%d\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  cin >> a;\n  int x, y;\n  x = a % 10;\n  y = a / 10;\n  cout << x;\n  while (y > 0) {\n    x = y % 10;\n    y = y / 10;\n    printf(\"%d\", x);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30463", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  while (scanf(\"%d\", &N) != EOF)\n    if (N) {\n      i = t = n = 0;\n      while (N % (1 * e(i)) != N) {\n        a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n        i++;\n      }\n      while (t <= i - 1) {\n        printf(\"%d\", a[t]);\n        t++;\n      }\n      printf(\"\\n\");\n    } else\n      printf(\"0\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30464", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, n;\n  scanf(\"%d\", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100)\n    printf(\"%d%d\", n % 10, n / 10);\n  else if (n < 1000) {\n    a = n / 100;\n    b = n / 10 - 10 * a;\n    c = n % 10;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (n < 10000) {\n    d = n / 1000;\n    e = n / 100 - 10 * d;\n    f = n / 10 - d * 100 - e * 10;\n    g = n % 10;\n    printf(\"%d%d%d%d\", g, f, e, d);\n  } else {\n    printf(\"over\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n / 10000;\n  n = n - 10000 * a;\n  b = n / 1000;\n  n = n - 1000 * b;\n  c = n / 100;\n  n = n - 100 * c;\n  d = n / 10;\n  e = n - 10 * d;\n  if (a != 0)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (b != 0)\n    printf(\"%d%d%d%d\", e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d\", e, d, c);\n  else if (d != 0)\n    printf(\"%d%d\", e, d);\n  else\n    printf(\"%d\", e);\n  return 0;\n}\n"}
{"label": "16", "index": "30466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int num, a, b, c, d;\n  cin >> num;\n  a = num / 1000;\n  b = (num - a * 1000) / 100;\n  c = (num - a * 1000 - b * 100) / 10;\n  d = num - a * 1000 - b * 100 - c * 10;\n  if (a != 0)\n    cout << d << c << b << a << endl;\n  else if (a == 0 && b != 0)\n    printf(\"%d%d%d\\n\", d, c, b);\n  else {\n    if (a == 0 && b == 0 && c != 0) {\n      cout << d << c << endl;\n    } else\n      cout << d << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, t;\n  char c[10001];\n  cin >> c;\n  for (i = 0;; i++) {\n    if (c[i] != '\\0') {\n      n++;\n    } else\n      break;\n  }\n  if (n % 2 == 0) {\n    for (i = 0; i < n / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  } else {\n    for (i = 0; i < (n - 1) / 2; i++) {\n      t = c[i];\n      c[i] = c[n - 1 - i];\n      c[n - 1 - i] = t;\n    }\n  }\n  cout << c;\n  getchar();\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30468", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  char ch[100000], tes;\n\n  for (;; i++) {\n    ch[i] = getchar();\n    if (ch[i] == '\\n')\n      break;\n  }\n\n  for (; i >= 0; i--)\n    printf(\"%c\", ch[i]);\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "16", "index": "30469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[6] = {0, 0, 0, 0, 0, 0};\n  cin >> s;\n  int i = 0;\n  for (i = 5; i >= 1 && s[i] == 0; i--)\n    ;\n  for (; i >= 0; i--)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30470", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n / 10 == 0)\n    cout << n << endl;\n  else if (n / 100 == 0)\n    printf(\"%d%d\\n\", n % 10, n / 10);\n  else {\n    if (n / 1000 == 0) {\n      cout << n % 10 << n % 100 / 10 << n / 100 << endl;\n    } else if (n / 10000 == 0)\n      cout << n % 10 << n % 100 / 10 << n % 1000 / 100 << n / 1000 << endl;\n    else if (n == 10000)\n      cout << 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30471", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f, g, h;\n  scanf(\"%d \", &a);\n  b = a % 1000;\n  c = (a - b) / 1000;\n  d = b % 100;\n  e = (b - d) / 100;\n  f = d % 10;\n  g = (d - f) / 10;\n  if (c == 0) {\n    if (e == 0) {\n      if (g == 0) {\n        if (f == 0)\n          printf(\"0\");\n        else {\n          printf(\"%d\", f);\n        }\n      } else {\n        printf(\"%d%d\", f, g);\n      }\n    } else {\n      printf(\"%d%d%d\", f, g, e);\n    }\n  } else {\n    printf(\"%d%d%d%d\", f, g, e, c);\n  }\n}\n"}
{"label": "16", "index": "30472", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d \", &a);\n  b = a / 10000;\n  c = (a - 10000 * b) / 1000;\n  d = (a - 10000 * b - 1000 * c) / 100;\n  e = (a - 10000 * b - 1000 * c - 100 * d) / 10;\n  f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n  if (b == 1) {\n    printf(\"%d%d%d%d%d%d\", f, e, d, c, b);\n  } else {\n    if (c >= 1) {\n      printf(\"%d%d%d%d\", f, e, d, c);\n    } else {\n      if (d >= 1) {\n        printf(\"%d%d%d\", f, e, d);\n      } else {\n        if (e >= 1) {\n          printf(\"%d%d\", f, e);\n        } else {\n          printf(\"%d\", f);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, e, n;\n  scanf(\"%d\", &x);\n  if (x > 9999) {\n    n = 5;\n  } else {\n    if (x > 999)\n      n = 4;\n    else {\n      if (x > 99)\n        n = 3;\n      else {\n        if (x > 9)\n          n = 2;\n        else\n          n = 1;\n      }\n    }\n  }\n  switch (n) {\n  case 5:\n    a = x / 10000;\n    b = (x - a * 10000) / 1000;\n    c = (x - a * 10000 - b * 1000) / 100;\n    d = (x - a * 10000 - b * 1000 - c * 100) / 10;\n    e = (x - a * 10000 - b * 1000 - c * 100 - d * 10);\n    cout << e << d << c << b << a << \" \";\n    break;\n  case 4:\n    b = x / 1000;\n    c = (x - b * 1000) / 100;\n    d = (x - b * 1000 - c * 100) / 10;\n    e = (x - b * 1000 - c * 100 - d * 10);\n    printf(\"%d%d%d%d \", e, d, c, b);\n    break;\n  case 3:\n    c = x / 100;\n    d = (x - c * 100) / 10;\n    e = (x - c * 100 - d * 10);\n    printf(\"%d%d%d \", e, d, c);\n    break;\n  case 2:\n    d = x / 10;\n    e = (x - d * 10);\n    printf(\"%d%d \", e, d);\n    break;\n  case 1:\n    cout << x << \" \";\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[4], b, i;\n  cin >> b;\n  if (b == 10000)\n    printf(\"00001\");\n  else {\n    for (i = 0; i <= 3; i++)\n      a[i] = b % (int)pow(10, i + 1) / (int)pow(10, i);\n    for (i = 0; i <= 3; i++)\n      if (b >= pow(10, i))\n        printf(\"%d\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  scanf(\"%d \", &n);\n  m = (int)(log10(n) + 1);\n  if (n == 0) {\n    cout << 0;\n  } else {\n    for (i = 1; i <= m; i++) {\n      cout << n % 10;\n      n = (n - n % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f;\n  scanf(\"%d\", &f);\n  if (f == 10000) {\n    printf(\"00001\\n\");\n  } else if (f > 999 && f <= 9999) {\n    int a, b, c, d;\n    a = 1;\n    while (f - a * 1000 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 1000 - b * 100 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 1000 - b * 100 - c * 10 >= 0) {\n      c++;\n    }\n    d = 1;\n    c = c - 1;\n    while (f - a * 1000 - b * 100 - c * 10 - d * 1 >= 0) {\n      d++;\n    }\n    d = d - 1;\n    printf(\"%d%d%d%d\", d, c, b, a);\n  } else if (f > 99 && f <= 999) {\n    int a, b, c;\n    a = 1;\n    while (f - a * 100 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 100 - b * 10 >= 0) {\n      b++;\n    }\n    c = 1;\n    b = b - 1;\n    while (f - a * 100 - b * 10 - c * 1 >= 0) {\n      c++;\n    }\n    c = c - 1;\n    printf(\"%d%d%d\", c, b, a);\n  } else if (f > 9 && f <= 99) {\n    int a, b;\n    a = 1;\n    while (f - a * 10 >= 0) {\n      a++;\n    }\n    a = a - 1;\n    b = 1;\n    while (f - a * 10 - b * 1 >= 0) {\n      b++;\n    }\n    b = b - 1;\n    printf(\"%d%d\", b, a);\n  } else {\n    printf(\"%d\", f);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int input;\n  int ret, num;\n  scanf(\"%d\", &input);\n\n  for (;;) {\n    if (input < 10) {\n      printf(\"%d\\n\", input);\n      break;\n    }\n    num = input % 10;\n    input = input / 10;\n\n    printf(\"%d\", num);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x, k;\n\n  cin >> x;\n  k = log10(x) + 1;\n\n  if (x == 0) {\n    printf(\"%d\", x);\n  } else {\n    int a, e = 1, k1;\n    k = k - 1;\n    k1 = k;\n    while (k1 > 0) {\n      e = e * 10;\n      k1 = k1 - 1;\n    }\n\n    int b = 0, s = 2, k3, e2, x2;\n    k3 = k;\n    e2 = e;\n    x2 = x;\n    while (s > 0) {\n      while (k3 >= 0) {\n        a = x2 / e2;\n        k3 = k3 - 1;\n        x2 = x2 - a * e2;\n        b = b + a * (e / e2);\n        e2 = e2 / 10;\n        if (s == 1) {\n          cout << a;\n        }\n      }\n      k3 = k;\n      e2 = e;\n      s = s - 1;\n      x2 = b;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30479", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[5] = {0};\n  int i = 0;\n  while ((a[i] = cin.get()) != '\\n') {\n    i++;\n  }\n  for (; i >= 0; i--) {\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30480", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, t, s;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << \"0\";\n  else {\n    for (int i = 10; i <= 100000; i *= 10) {\n      t = n % i;\n      s = t * 10 / i;\n      if (s <= 9 && n != 0) {\n        cout << s;\n        n -= t;\n      } else\n        break;\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, c, b;\n  cin >> n;\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; i <= n;) {\n    i = i * 10;\n    c = n % i;\n    n = n - c;\n    b = c * 10 / i;\n    cout << b;\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, c, d, e, f, g;\n  cin >> a;\n  if (a == 10000)\n    printf(\"00001\");\n  else if (a >= 1000 && a <= 9999) {\n    c = a / 1000;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 1000 + e * 100 + d * 10 + c;\n    printf(\"%d%d%d%d\", f, e, d, c);\n  } else if (a >= 100 && a <= 999) {\n    c = 0;\n    d = (a - 1000 * c) / 100;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 100 + e * 10 + d * 1 + c;\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a >= 10 && a <= 99) {\n    c = 0;\n    d = 0;\n    e = (a - 1000 * c - d * 100) / 10;\n    f = a - 1000 * c - d * 100 - e * 10;\n    g = f * 10 + e;\n    cout << f << e;\n  } else {\n    g = a;\n    printf(\"%d\", g);\n  }\n}\n"}
{"label": "16", "index": "30483", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, b, c, d, i, t, j;\n  c = 0;\n  cin >> n;\n  if (n > 0 && n < 10000) {\n    for (i = 4; i >= 1; i--) {\n      b = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      if (b != 0) {\n        j = i;\n        break;\n      }\n    }\n    for (i = 1; i <= j; i++) {\n      d = n % (int)pow(10.0, (double)i) / (int)pow(10.0, (double)(t = i - 1));\n      printf(\"%d\", d);\n    }\n  } else if (n == 0)\n    printf(\"0\");\n  else if (n == 10000)\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "30484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  if (a > 9999) {\n\n    b = a / 10000;\n    c = (a / 1000) - 10 * b;\n    d = (a / 100) - 100 * b - 10 * c;\n    e = (a / 10) - 1000 * b - 100 * c - 10 * d;\n    f = a - 10000 * b - 1000 * c - 100 * d - 10 * e;\n\n    cout << f << e << d << c << b;\n  } else if (a > 999) {\n\n    c = a / 1000;\n    d = (a / 100) - 10 * c;\n    e = (a / 10) - 100 * c - 10 * d;\n    f = a - 1000 * c - 100 * d - 10 * e;\n\n    cout << f << e << d << c;\n  } else if (a > 99) {\n\n    d = a / 100;\n    e = (a / 10) - 10 * d;\n    f = a - 100 * d - 10 * e;\n\n    printf(\"%d%d%d\", f, e, d);\n  } else if (a > 9) {\n\n    e = (a / 10);\n    f = a - 10 * e;\n\n    printf(\"%d%d\", f, e);\n  } else {\n\n    printf(\"%d\", a);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int sum, len, i;\n  int a[10];\n  scanf(\"%d \", &sum);\n  if (sum >= 10000)\n    len = 5;\n  else if (sum >= 1000)\n    len = 4;\n  else if (sum >= 100)\n    len = 3;\n  else if (sum >= 10)\n    len = 2;\n  else\n    len = 1;\n  for (i = 1; i <= len; i++) {\n    a[i] = sum / (pow(10, (len - i)));\n    sum = sum - a[i] * pow(10, (len - i));\n  }\n  for (i = 1; i <= len; i++)\n    cout << a[len - i + 1];\n}\n"}
{"label": "16", "index": "30486", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint MyInverseitoa(int iNum, char *ch, int radix) {\n  int iBits = 0;\n\n  do {\n    ch[iBits++] = iNum % radix;\n    iNum /= radix;\n  } while (iNum);\n  ch[iBits] = '\\0';\n  return iBits - 1;\n}\n\nint Myatoi(char *ch, int iBits) {\n  int iNumInverse = 0;\n  int i = 0;\n\n  while (ch[i] == '\\0') {\n    i++;\n    printf(\"0\");\n  }\n  for (i = 0; i <= iBits; i++) {\n    iNumInverse = 10 * iNumInverse + ch[i];\n  }\n  return iNumInverse;\n}\n\nint main() {\n  int iNum, iNumInverse, iBits = 0;\n\n  char ch[12];\n  scanf(\"%d\", &iNum);\n  if (iNum == 0) {\n    iNumInverse = iNum;\n    cout << iNumInverse;\n  } else {\n    iBits = MyInverseitoa(iNum, ch, 10);\n    iNumInverse = Myatoi(ch, iBits);\n    printf(\"%d\", iNumInverse);\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s = 0, a, b;\n  scanf(\"%d\", &n);\n  if (n % 10 == 0) {\n    if (n == 0)\n      printf(\"\");\n    else {\n      printf(\"0\");\n      for (n = n / 10; n % 10 == 0; n = n / 10) {\n        printf(\"0\");\n      }\n      for (; n >= 1; n = n / 10) {\n        i = n % 10;\n        s = s * 10 + i;\n      }\n    }\n  } else\n    for (; n >= 1; n = n / 10) {\n      i = n % 10;\n      s = s * 10 + i;\n    }\n  printf(\"%d\", s);\n  return 0;\n}\n"}
{"label": "16", "index": "30488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c;\n  scanf(\"%d \", &n);\n  if (n < 10)\n    cout << n;\n  else if (n < 100)\n    cout << n % 10 << n / 10;\n  else if (n < 1000) {\n    a = n % 10;\n    n = (n - a) / 10;\n    b = n % 10;\n    n = (n - b) / 10;\n    cout << a << b << n;\n  } else if (n < 10000) {\n    a = n % 10;\n    n = (n - a) / 10;\n    b = n % 10;\n    n = (n - b) / 10;\n    c = n % 10;\n    n = (n - c) / 10;\n    cout << a << b << c << n;\n  } else\n    cout << \"0\"\n         << \"0\"\n         << \"0\"\n         << \"0\"\n         << \"1\";\n  return 0;\n}\n"}
{"label": "16", "index": "30489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  if (!N)\n    printf(\"%d\\n\", 0);\n  else {\n    while (N) {\n      printf(\"%d\", N % 10);\n      N /= 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30490", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n, a[10];\n\n  int i;\n  while (cin >> n) {\n    if (n == 0) {\n      cout << 0;\n    }\n    for (i = 1; i <= 5 && n != 0; i++) {\n      a[i] = n % 10;\n      n = n / 10;\n      cout << a[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i;\n  cin >> n;\n  m = (int)(log10(n) + 1);\n  if (n == 0)\n    cout << 0;\n  else {\n    for (i = 1; i <= m; i++) {\n      cout << n % 10;\n      n = (n - n % 10) / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  a = b = c = d = 0;\n  cin >> n;\n  while (n > 999) {\n    n = n - 1000;\n    a = a + 1;\n  }\n  while (n > 99) {\n    n = n - 100;\n    b++;\n  }\n  while (n > 9) {\n    n = n - 10;\n    c++;\n  }\n  if (n > 0) {\n    while (n > 0) {\n      n = n - 1;\n      d++;\n    }\n  } else if (n = 0)\n    d = 0;\n  if (a == 0) {\n    if (b == 0) {\n      if (c == 0) {\n        if (d == 0) {\n          cout << d;\n        } else\n          printf(\"%d\", d);\n      } else\n        cout << d << c;\n    } else\n      cout << d << c << b;\n  } else\n    cout << d << c << b << a;\n  return 0;\n}\n"}
{"label": "16", "index": "30493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, n, b, c, d, e, f, g;\n  scanf(\"%d\", &n);\n  b = 0;\n  a = n;\n  if (n == 0)\n    printf(\"0\");\n  else\n    while (a > 0) {\n      a = (int)(a / 10);\n      b = b + 1;\n    }\n  c = n % 10;\n  d = (int)(n / 10) % 10;\n  e = (int)(n / 100) % 10;\n  f = (int)(n / 1000) % 10;\n  g = (int)(n / 10000);\n  switch (b) {\n  case 1:\n    printf(\"%d\\n\", n);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", c, d, e, f);\n    break;\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", c, d, e, f, g);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a, b, n, s, i;\n  scanf(\"%d\", &a);\n  if (a == 0) {\n    printf(\"0\");\n  }\n  n = 0;\n  b = a;\n  while (b != 0) {\n    b = (b / 10);\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i <= n; i++) {\n    b = a % 10;\n    a = a / 10;\n    cout << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  printf(\"%d\", a);\n  b = (n - a) / 10;\n  if (b != 0) {\n    b = b % 10;\n    printf(\"%d\", b);\n    c = (n - 10 * b - a) / 100;\n    if (c != 0) {\n      c = c % 10;\n      printf(\"%d\", c);\n      d = (n - 100 * c - 10 * b - a) / 1000;\n      if (d != 0)\n        printf(\"%d\\n\", d);\n    }\n  }\n}\n"}
{"label": "16", "index": "30496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[10];\n  cin >> n;\n  a[0] = n % 10;             \n  a[1] = (n % 100) / 10;     \n  a[2] = (n % 1000) / 100;   \n  a[3] = (n % 10000) / 1000; \n  if (n < 10 && n >= 0)      \n    cout << n;\n  else if (n < 100 && n >= 10)\n    cout << a[0] << a[1];\n  else if (n < 1000 && n >= 100)\n    cout << a[0] << a[1] << a[2];\n  else if (n < 10000 && n >= 1000)\n    cout << a[0] << a[1] << a[2] << a[3];\n  else if (n == 10000)\n    cout << \"00001\";\n  return 0;\n}\n"}
{"label": "16", "index": "30497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, t;\n  scanf(\"%d\", &n);\n  if (n <= 9)\n    printf(\"%d\", n);\n  else {\n    x = n % 10;\n    if (n <= 99) {\n      y = (n - x) / 10;\n      cout << x << y;\n    } else {\n      y = ((n - x) / 10) % 10;\n      t = x + 10 * y;\n      if (n <= 999) {\n        z = (n - t) / 100;\n        printf(\"%d%d%d\", x, y, z);\n      } else {\n        z = ((n - t) / 100) % 10;\n        t = x + 10 * y + 100 * z;\n        if (n <= 9999) {\n          w = (n - t) / 1000;\n          cout << x << y << z << w;\n        } else {\n          printf(\"00001\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30498", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n;\n  int i = 0;\n  char c[100];\n\n  char d[100];\n  char e[100];\n\n  scanf(\"%s \", c);\n  n = m = strlen(c);\n  do {\n    d[i] = c[m - 1];\n    m = m - 1;\n    i++;\n  } while (m >= 1);\n  d[n] = 32;\n  sscanf(d, \"%[^ ]\", e);\n  puts(e);\n  scanf(\"%d\", &m);\n  return 0;\n}\n"}
{"label": "16", "index": "30499", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int weishu[5] = {-1, -1, -1, -1, -1}, num, i = 0;\n  cin >> num;\n  do {\n    weishu[i] = num % 10;\n    num = num / 10;\n    i++;\n  } while (num > 0);\n  for (i = 0; i < 5; i++)\n    if (weishu[i] != -1)\n      printf(\"%d\", weishu[i]);\n  return 0;\n}\n"}
{"label": "16", "index": "30500", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, i, j, a[5];\n  cin >> x;\n  i = 0;\n  while (x >= 10) {\n    a[i] = x % 10;\n    x = x / 10;\n    i = i + 1;\n  }\n  a[i] = x;\n  for (j = 0; j <= i; j++)\n    printf(\"%d\", a[j]);\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a = 0, i = 5, m = 0, b;\n  cin >> n;\n  do {\n    cout << n % 10;\n    n = n / 10;\n  } while (n != 0);\n  return 0;\n}\n"}
{"label": "16", "index": "30502", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, c, d, e;\n  cin >> a;\n  if (a < 10)\n    printf(\"%d\", a);\n  else if (a < 100) {\n    b = (int)a / 10;\n    c = a - b * 10;\n    printf(\"%d%d\", c, b);\n  } else if (a < 1000) {\n    b = (int)a / 100;\n    c = (int)(a - 100 * b) / 10;\n    d = a - 100 * b - 10 * c;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a < 10000) {\n    b = (int)a / 1000;\n    c = (int)(a - 1000 * b) / 100;\n    d = (int)(a - 1000 * b - 100 * c) / 10;\n    e = a - 1000 * b - 100 * c - 10 * d;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (a == 10000)\n    printf(\"00001\");\n  return 0;\n}\n"}
{"label": "16", "index": "30503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, U1, U2, U3, U4, U;\n  scanf(\"%d\", &i);\n  U1 = i / 1000;\n  U2 = (i - 1000 * U1) / 100;\n  U3 = (i - 1000 * U1 - 100 * U2) / 10;\n  U4 = (i - 1000 * U1 - 100 * U2 - 10 * U3);\n  if (U1 != 0)\n    printf(\"%d%d%d%d\", U4, U3, U2, U1);\n  else {\n    if (U2 != 0)\n      printf(\"%d%d%d\", U4, U3, U2);\n    else {\n      if (U3 != 0)\n        printf(\"%d%d\", U4, U3);\n      else {\n        if (U4 != 0)\n          printf(\"%d\", U4);\n        else\n          printf(\"0\");\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nstruct integ {\n  char num;\n  struct integ *next;\n} * head, *p1, *p2, *p3, *newhead;\nint main() {\n  int i, n = 0;\n  p1 = p2 = (struct integ *)malloc(sizeof(struct integ));\n  head = NULL;\n  for (i = 0;; i++) {\n    scanf(\"%c\", &p1->num);\n    if (p1->num < 48 || p1->num > 57)\n      break;\n    n++;\n    if (n == 1)\n      head = p1;\n    else\n      p2->next = p1;\n    p2 = p1;\n    p1 = (struct integ *)malloc(sizeof(struct integ));\n  }\n  p2->next = NULL;\n  for (i = 0; i < n; i++) {\n    p1 = head;\n    while (p1->next != NULL) {\n      p2 = p1;\n      p1 = p1->next;\n    }\n    if (i == 0) {\n      p3 = newhead = p1;\n    } else {\n      p3 = p3->next = p1;\n    }\n    p2->next = NULL;\n  }\n  for (p1 = newhead; p1 != NULL; p1 = p1->next) {\n    cout << p1->num;\n  }\n}\n"}
{"label": "16", "index": "30505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, ge, shi, bai, qian, wan, place = 1, j = 2;\n  scanf(\"%d\", &n);\n  for (i = 9; i <= 10000; i = i * 10 + 9) {\n    if (n > i)\n      place = j;\n    j = j + 1;\n  }\n  wan = n / 10000;\n  qian = (n - wan * 10000) / 1000;\n  bai = (n - wan * 10000 - qian * 1000) / 100;\n  shi = (n - wan * 10000 - qian * 1000 - bai * 100) / 10;\n  ge = n - wan * 10000 - qian * 1000 - bai * 100 - shi * 10;\n  switch (place) {\n  case 5:\n    cout << ge << shi << bai << qian << wan;\n    break;\n  case 4:\n    cout << ge << shi << bai << qian;\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", n);\n    break;\n  default:\n    printf(\"error\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ace, a, b, c, d;\n  cin >> ace;\n  a = (int)(ace / 1000);\n  b = (int)((ace - 1000 * a) / 100);\n  c = (int)((ace - 1000 * a - 100 * b) / 10);\n  d = (ace - 1000 * a - 100 * b - 10 * c);\n\n  if (ace >= 1000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  else if (ace >= 100)\n    printf(\"%d%d%d\", d, c, b);\n  else if (ace >= 10)\n    printf(\"%d%d\", d, c);\n  else\n    cout << d;\n}\n"}
{"label": "16", "index": "30507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b;\n  scanf(\"%d\", &a);\n  if (a == 100) {\n    printf(\"001\");\n  } else if (a <= 9)\n    printf(\"%d\", a);\n  else if (a <= 99) {\n    b = a % 10 * 10 + a / 10;\n    printf(\"%d\", b);\n  } else if (a <= 999) {\n    b = a % 10 * 100 + (a / 10) % 10 * 10 + a / 100;\n    printf(\"%d\", b);\n  } else if (a <= 9999) {\n    b = a % 10 * 1000 + (a / 10) % 10 * 100 + (a / 100) % 10 * 10 + a / 1000;\n    printf(\"%d\", b);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30508", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  scanf(\"%d \", &f);\n  if (f == 10000)\n    printf(\"00001\");\n  else if (f >= 1000 && f <= 9999) {\n    b = (int)f / 1000;\n    c = (int)(f - b * 1000) / 100;\n    d = (int)(f - b * 1000 - c * 100) / 10;\n    e = f - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (f >= 100 && f <= 999) {\n    c = (int)f / 100;\n    d = (int)(f - c * 100) / 10;\n    e = (f - c * 100 - d * 10);\n    printf(\"%d%d%d\", e, d, c);\n  } else if (f >= 10 && f <= 99) {\n    d = (int)f / 10;\n    e = (f - d * 10);\n    printf(\"%d%d\", e, d);\n  } else if (f >= 0 && f <= 9)\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "30509", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, k, n, a[10], i = 0;\n  cin >> n;\n  k = n;\n  while (k > 0) {\n    a[i] = k % 10;\n    k = k / 10;\n    i++;\n    j++;\n  }\n  if (n == 0) {\n    a[0] = 0;\n    j = 1;\n  }\n  for (i = 0; i < j; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[1] = n / 10000;\n  a[2] = (n - a[1] * 10000) / 1000;\n  a[3] = (n - a[1] * 10000 - a[2] * 1000) / 100;\n  a[4] = (n - a[1] * 10000 - a[2] * 1000 - a[3] * 100) / 10;\n  a[5] = n - a[1] * 10000 - a[2] * 1000 - a[3] * 100 - a[4] * 10;\n  if (a[1] != 0)\n    printf(\"%d%d%d%d%d\", a[5], a[4], a[3], a[2], a[1]);\n  else {\n    if (a[2] != 0)\n      printf(\"%d%d%d%d\", a[5], a[4], a[3], a[2]);\n    else {\n      if (a[3] != 0)\n        printf(\"%d%d%d\", a[5], a[4], a[3]);\n      else {\n        if (a[4] != 0)\n          printf(\"%d%d\", a[5], a[4]);\n        else {\n          if (a[5] != 0)\n            printf(\"%d\", a[5]);\n          else\n            printf(\"0\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n  if (n >= 1000) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = (n % 1000) / 100;\n    d = n / 1000;\n    x = a * 1000 + b * 100 + c * 10 + d;\n    printf(\"%04d\", x);\n  } else if (n >= 100) {\n    a = n % 10;\n    b = (n % 100) / 10;\n    c = n / 100;\n    x = a * 100 + b * 10 + c;\n    printf(\"%03d\", x);\n  } else if (n >= 10) {\n    a = n % 10;\n    b = n / 10;\n    x = a * 10 + b;\n    printf(\"%02d\", x);\n  } else\n    printf(\"%d\", n);\n  return 0;\n}\n"}
{"label": "16", "index": "30512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n >= 10000)\n    cout << \"00001\" << endl;\n  else if (n >= 1000)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << (n - n % 100) / 100 % 10\n         << (n - n % 1000) / 1000 % 10 << endl;\n  else if (n >= 100) {\n    printf(\"%d%d%d\\n\", n % 10, (n - n % 10) / 10 % 10,\n           (n - n % 100) / 100 % 10);\n  } else if (n >= 10)\n    cout << n % 10 << (n - n % 10) / 10 % 10 << endl;\n  else\n    cout << n << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d \", &n);\n  a = n % 10;\n  n = (n - a) / 10;\n  b = n % 10;\n  n = (n - b) / 10;\n  c = n % 10;\n  n = (n - c) / 10;\n  d = n % 10;\n  n = (n - d) / 10;\n  e = n % 10;\n  n = (n - e) / 10;\n  if (e != 0)\n    cout << a << b << c << d << e << endl;\n  else if (d != 0)\n    cout << a << b << c << d << endl;\n  else if (c != 0)\n    cout << a << b << c << endl;\n  else if (b != 0)\n    cout << a << b << endl;\n  else\n    cout << a << endl;\n  return (0);\n}\n"}
{"label": "16", "index": "30514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, e, f;\n  cin >> a;\n  b = a / 10000;\n  c = (a - b * 10000) / 1000;\n  d = (a - b * 10000 - c * 1000) / 100;\n  e = (a - b * 10000 - c * 1000 - d * 100) / 10;\n  f = a % 10;\n  if (b != 0)\n    printf(\"%d%d%d%d%d\", f, e, d, c, b);\n  else if (c != 0)\n    printf(\"%d%d%d%d\", f, e, d, c);\n  else if (d != 0)\n    printf(\"%d%d%d\", f, e, d);\n  else if (e != 0)\n    printf(\"%d%d\", f, e);\n  else\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "30515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  if (n < 10)\n    cout << n;\n  else if (10 <= n && n < 100) {\n    cout << n % 10 << n / 10;\n  } else if (n >= 100 && n <= 999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10 << n / 100;\n  } else if (n >= 1000 && n <= 9999) {\n    cout << n - (n / 10) * 10 << n / 10 - (n / 100) * 10\n         << n / 100 - (n / 1000) * 10 << n / 1000;\n  } else if (n == 10000) {\n    cout << 00001;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, c, d, f;\n  scanf(\"%d \", &a);\n  if (a / 10 == 0) {\n    printf(\"%d\", a);\n  } else if (a / 100 == 0) {\n    b = a / 10;\n    c = a % 10;\n    printf(\"%d%d\", c, b);\n  } else if (a / 1000 == 0) {\n    b = a / 100;\n    c = (a - b * 100) / 10;\n    d = a % 10;\n    printf(\"%d%d%d\", d, c, b);\n  } else if (a / 10000 == 0) {\n    b = a / 1000;\n    c = (a - b * 1000) / 100;\n    d = (a - b * 1000 - c * 100) / 10;\n    f = a % 10;\n    cout << f << d << c << b;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  if (n == 10000)\n    cout << \"00001\" << endl;\n  else {\n    if (n / 1000 >= 1) {\n      a = n / 1000;\n      b = (n - a * 1000) / 100;\n      c = (n - a * 1000 - b * 100) / 10;\n      d = n - a * 1000 - b * 100 - c * 10;\n      cout << d << c << b << a << endl;\n    } else {\n      if (n / 100 >= 1) {\n        b = n / 100;\n        c = (n - b * 100) / 10;\n        d = n - b * 100 - c * 10;\n        cout << d << c << b << endl;\n      } else {\n        if (n / 10 >= 1) {\n          c = n / 10;\n          d = n - c * 10;\n          cout << d << c << endl;\n        } else\n          cout << n << endl;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"0\");\n  while (a != 0) {\n    printf(\"%d\", a - (a / 10) * 10);\n    a = a / 10;\n  }\n}\n"}
{"label": "16", "index": "30519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int t, n, a, b, c, d, e, i, j, k, l, m;\n\n  cin >> n;\n  t = n;\n  j = t / 10000;\n  if (j != 0) {\n    i = 5;\n    t = 0;\n  }\n\n  j = t / 1000;\n  if (j != 0) {\n    i = 4;\n    t = 0;\n  }\n\n  j = t / 100;\n  if (j != 0) {\n    i = 3;\n    t = 0;\n  }\n\n  j = t / 10;\n  if (j != 0) {\n    i = 2;\n    t = 0;\n  }\n\n  j = t / 1;\n  if (j != 0) {\n    i = 1;\n    t = 0;\n  }\n\n  if (n == 0)\n    cout << 0;\n  else {\n    a = n / 10000;\n    n = n % 10000;\n    b = n / 1000;\n    n = n % 1000;\n    c = n / 100;\n    n = n % 100;\n    d = n / 10;\n    n = n % 10;\n    e = n;\n\n    if (i == 5)\n      cout << e << d << c << b << a;\n    if (i == 4)\n      printf(\"%d%d%d%d\", e, d, c, b);\n    if (i == 3)\n      printf(\"%d%d%d\", e, d, c);\n    if (i == 2)\n      printf(\"%d%d\", e, d);\n    if (i == 1)\n      printf(\"%d\", e);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30520", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, n, b, c, d, e, f, g;\n  cin >> n;\n  b = 0;\n  a = n;\n  if (n == 0)\n    printf(\"0\");\n  else\n    while (a > 0) {\n      a = (int)(a / 10);\n      b = b + 1;\n    }\n  c = n % 10;\n  d = (int)(n / 10) % 10;\n  e = (int)(n / 100) % 10;\n  f = (int)(n / 1000) % 10;\n  g = (int)(n / 10000);\n  switch (b) {\n  case 1:\n    printf(\"%d\\n\", n);\n    break;\n  case 2:\n    printf(\"%d%d\\n\", c, d);\n    break;\n  case 3:\n    printf(\"%d%d%d\\n\", c, d, e);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\\n\", c, d, e, f);\n    break;\n  case 5:\n    printf(\"%d%d%d%d%d\\n\", c, d, e, f, g);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char str[100];\n  scanf(\"%s\", &str);\n  for (i = strlen(str) - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n  getchar();\n  getchar();\n}\n"}
{"label": "16", "index": "30522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, a, b, c, d;\n  scanf(\"%d\", &x);\n  a = x % 10;\n  b = (x % 100 - a) / 10;\n  c = (x % 1000 - b * 10 - a) / 100;\n  d = x / 1000;\n  if (x > 999 && x < 10000)\n    printf(\"%d%d%d%d\\n\", a, b, c, d);\n  else {\n    if (x > 99 && x < 1000)\n      printf(\"%d%d%d\\n\", a, b, c);\n    else if (x > 9 && x < 100)\n      printf(\"%d%d\\n\", a, b);\n    else if (x > 0 && x < 10)\n      cout << a << \"\\n\";\n    else if (x == 0)\n      printf(\"0\\n\");\n    else if (x == 10000)\n      printf(\"00001\\n\");\n  }\n}\n"}
{"label": "16", "index": "30523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, f, a, m;\n\n  scanf(\"%d\", &n);\n  for (i = 5; i >= 1; i--) {\n    f = pow(10, i);\n    a = n / f;\n    if (a != 0)\n      break;\n  }\n  for (j = 1; j <= i + 1; j++) {\n    m = n % 10;\n\n    printf(\"%d\", m);\n    n = (n - m) / 10;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  scanf(\"%d\", &n);\n  a[0] = n / 10000;\n  a[1] = n / 1000 - 10 * a[0];\n  a[2] = n / 100 - 100 * a[0] - 10 * a[1];\n  a[4] = n % 10;\n  a[3] = (n % 100 - n % 10) / 10;\n  printf(\"\\n\");\n  if (n != 0) {\n    for (int i = 0; i < 5; i++)\n      if (a[i] == 0)\n        continue;\n      else {\n        for (int j = 4; j >= i; j--)\n          printf(\"%d\", a[j]);\n        break;\n      }\n  } else\n    printf(\"0\");\n}\n"}
{"label": "16", "index": "30525", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int tmp;\n  scanf(\"%d\", &n);\n  while (1) {\n    tmp = n % 10;\n    printf(\"%d\", tmp);\n    if (!(n = n / 10))\n      break;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "16", "index": "30526", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int number, ge, shi, bai, qian, wan, place;\n  scanf(\"%d \", &number);\n  if (number >= 10000)\n    place = 5;\n  else {\n    if (number >= 1000)\n      place = 4;\n    else {\n      if (number >= 100)\n        place = 3;\n      else {\n        if (number >= 10)\n          place = 2;\n        else\n          place = 1;\n      }\n    }\n  }\n  ge = number % 10;\n  shi = ((number - ge) % 100) / 10;\n  bai = ((number - ge - 10 * shi) % 1000) / 100;\n  qian = ((number - ge - 10 * shi - 100 * bai) % 10000) / 1000;\n  wan = (number - ge - 10 * shi - 100 * bai - 1000 * qian) / 10000;\n\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", ge);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, r, i;\n  scanf(\"%d\", &a);\n  r = 0;\n  i = 0;\n  while (a > 0) {\n    r = r * 10 + a % 10;\n    i = i + !(a % 10);\n    a = a / 10;\n  }\n  switch (i) {\n  case 0:\n    printf(\"%d\\n\", r);\n    break;\n  case 1:\n    printf(\"0%d\\n\", r);\n    break;\n  case 2:\n    printf(\"00%d\\n\", r);\n    break;\n  case 3:\n    printf(\"000%d\\n\", r);\n    break;\n  case 4:\n    printf(\"0000%d\\n\", r);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0;\n  cin >> a;\n  if (a != 0)\n    while (a != 0) {\n      b = a % 10;\n      printf(\"%d\", b);\n      a = a / 10;\n    }\n  else\n    cout << 0;\n  return 0;\n}\n"}
{"label": "16", "index": "30529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, n = 0, i = 0, j = n - 1;\n  cin >> a;\n  if (a == 0)\n    cout << \"0\";\n  else if (a != 0) {\n    while (a >= pow(10, n))\n      n = n + 1;\n    int c[10] = {0};\n    for (i = 0; i <= n - 1; i++)\n      c[i] = a % (int)(pow(10, i + 1));\n    for (i = 0; i <= n - 1; i++)\n      c[i] = c[i] / pow(10, i);\n    for (i = 0; i <= n - 1; i++)\n      printf(\"%d\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p;\n  p = (char *)malloc(sizeof(char) * 8);\n  int i;\n  for (i = 0; i < 6; i++) {\n    cin >> p;\n    if (*p == '\\n') {\n      *p = 0;\n      break;\n    }\n    p++;\n  }\n  for (i = i - 1; i >= 0; i--) {\n    p--;\n    printf(\"%c\", *p);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30531", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  int n;\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 1; n != 0; i++) {\n    cout << n % 10;\n    n /= 10;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  int l;\n\n  cin >> a;\n\n  l = strlen(a);\n\n  for (int i = 0; i < l; i++) {\n    b[i] = a[l - i - 1];\n    cout << b[i];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if ((10 < n) && (n < 100)) {\n    int i, j, k;\n    i = n / 10;\n    j = n % 10;\n    k = 10 * j + i;\n    printf(\"%d\", k);\n  } else if ((100 < n) && (n < 1000)) {\n    int a, b, c, d, e;\n    a = n / 100;\n    b = n % 100;\n    c = b / 10;\n    d = b % 10;\n    e = 100 * d + 10 * c + a;\n    printf(\"%d\", e);\n  } else if ((1000 < n) && (n < 10000)) {\n    int f, l, m, w, o, p, q;\n    f = n / 1000;\n    l = n % 1000;\n    m = l / 100;\n    w = l % 100;\n    o = w / 10;\n    p = w % 10;\n    q = 1000 * p + 100 * o + 10 * m + f;\n    cout << q;\n  } else if (n == 10) {\n    printf(\"01\");\n  } else if (n == 100) {\n    printf(\"001\");\n  } else if (n == 1000) {\n    printf(\"0001\");\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i1, m1, i2, m2, i3, m3;\n  scanf(\"%d\", &n);\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else if (n >= 10 && n < 100) {\n    i1 = n % 10;\n    m1 = n / 10;\n    printf(\"%d%d\", i1, m1);\n  } else if (n >= 100 && n < 1000) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    printf(\"%d%d%d\", i1, i2, m2);\n  } else if (n >= 1000 && n < 9999) {\n    i1 = n % 10;\n    m1 = n / 10;\n    i2 = m1 % 10;\n    m2 = m1 / 10;\n    i3 = m2 % 10;\n    m3 = m2 / 10;\n    cout << i1 << i2 << i3 << m3;\n  } else\n    printf(\"00001\");\n}\n"}
{"label": "16", "index": "30535", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, num, k, a[6];\n\n  cin >> num;\n  if (num == 0)\n    cout << num;\n  for (i = 5; i >= 0; i--) {\n    a[5 - i] = num / (pow((float)10, i));\n    num = num - a[5 - i] * pow((float)10, i);\n  }\n\n  for (i = 0; i < 6; i++) {\n\n    if (a[i] != 0)\n      break;\n  }\n\n  for (k = 5; k >= i; k--) {\n\n    cout << a[k];\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[5];\n  cin >> n;\n  a[0] = n / 1000;\n  a[1] = (n - 1000 * a[0]) / 100;\n  a[2] = (n - 1000 * a[0] - 100 * a[1]) / 10;\n  a[3] = n - 1000 * a[0] - 100 * a[1] - 10 * a[2];\n  if (n >= 1000) {\n    cout << a[3] << a[2] << a[1] << a[0];\n  } else if (n >= 100 && n < 1000) {\n    cout << a[3] << a[2] << a[1];\n  } else if (n >= 10 && n < 100) {\n    cout << a[3] << a[2];\n  } else if (n < 10)\n    cout << n;\n  return 0;\n}\n"}
{"label": "16", "index": "30537", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len;\n  char str[6];\n\n  scanf(\"%s \", str);\n  len = strlen(str);\n  for (int i = len - 1; i >= 0; i--)\n    printf(\"%c\", str[i]);\n\n  return 0;\n}\n"}
{"label": "16", "index": "30538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int input;\n  int ret, num;\n  scanf(\"%d \", &input);\n\n  for (;;) {\n    if (input < 10) {\n      printf(\"%d\\n\", input);\n      break;\n    }\n    num = input % 10;\n    input = input / 10;\n\n    cout << num;\n  }\n\n  return 0;\n}\n"}
{"label": "16", "index": "30539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, e;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  b = (n - a) % 100 / 10;\n  c = (n - (n % 100)) % 1000 / 100;\n  d = (n - (n % 1000)) % 10000 / 1000;\n  e = 1;\n  if (n < 10) {\n    printf(\"%d\", n);\n  } else {\n    if (n < 100) {\n      printf(\"%d%d\", a, b);\n    } else {\n      if (n < 1000) {\n        printf(\"%d%d%d\", a, b, c);\n      } else {\n        if (n < 10000) {\n          printf(\"%d%d%d%d\", a, b, c, d);\n        } else {\n          printf(\"abcde\");\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[5], b[5], n, i;\n  scanf(\"%d \", &n);\n  if (n == 10000) {\n    cout << 00001 << endl;\n  } else {\n    b[0] = n;\n    for (i = 0; i < 4; i++) {\n      a[i] = b[i] / pow(10.0, (double)(3 - i));\n      b[i + 1] = b[i] % (int)(pow(10.0, (double)(3 - i)));\n    }\n    if (a[0] != 0)\n      cout << a[3] << a[2] << a[1] << a[0] << endl;\n    else if (a[1] != 0) {\n      cout << a[3] << a[2] << a[1] << endl;\n    } else if (a[2] != 0) {\n      cout << a[3] << a[2] << endl;\n    } else {\n      cout << a[3] << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    printf(\"%d\", a);\n  if (a != 0) {\n    for (; a > 0;) {\n      printf(\"%d\", a % 10);\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 1, n, m, p;\n  scanf(\"%d\", &n);\n  if (n == 10000)\n    cout << \"00001\";\n  else if (n <= 9)\n    m = 1;\n  else if (n < 100)\n    m = 2;\n  else if (n < 1000)\n    m = 3;\n  else if (n < 10000)\n    m = 4;\n  while (i <= m) {\n    p = n - n / 10 * 10;\n    printf(\"%d\", p);\n    n = n / 10;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a, b, c, d, e;\n  scanf(\"%d \", &n);\n  int x;\n  x = n;\n  a = n / 10000;\n  n = n - a * 10000;\n  b = n / 1000;\n  n = n - b * 1000;\n  c = n / 100;\n  n = n - c * 100;\n  d = n / 10;\n  e = n - d * 10;\n  if (x < 10)\n    printf(\"%d\\n\", e);\n  else if ((x >= 10) && (x < 100))\n    cout << e << d << endl;\n  else if ((x >= 100) && (x < 1000))\n    printf(\"%d%d%d\\n\", e, d, c);\n  else if ((x >= 1000) && (x < 10000))\n    cout << e << d << c << b << endl;\n  else\n    cout << \"00001\" << endl;\n  return 0;\n}\n"}
{"label": "16", "index": "30544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, x, y, z, w, p;\n  scanf(\"%d \", &n);\n  if (n == 10000)\n    printf(\"00001\");\n  else if (n > 999)\n    p = 4;\n  else if (n > 99)\n    p = 3;\n  else if (n > 9)\n    p = 2;\n  else\n    p = 1;\n  x = n / 1000;\n  y = (n - x * 1000) / 100;\n  z = (n - x * 1000 - y * 100) / 10;\n  w = n - x * 1000 - y * 100 - z * 10;\n  switch (p) {\n  case 4:\n    cout << w << z << y << x;\n    break;\n  case 3:\n    printf(\"%d%d%d\", w, z, y);\n    break;\n  case 2:\n    printf(\"%d%d\", w, z);\n    break;\n  case 1:\n    printf(\"%d\", w);\n    break;\n  }\n}\n"}
{"label": "16", "index": "30545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  scanf(\"%d\", &n);\n  a = n % 10;\n  printf(\"%d\", a);\n  b = (n - a) / 10;\n  if (b != 0) {\n    b = b % 10;\n    printf(\"%d\", b);\n    c = (n - 10 * b - a) / 100;\n    if (c != 0) {\n      c = c % 10;\n      printf(\"%d\", c);\n      d = (n - 100 * c - 10 * b - a) / 1000;\n      if (d != 0)\n        printf(\"%d\\n\", d);\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  char a[6];\n\n  cin >> a;\n  n = strlen(a);\n  for (i = n - 1; i >= 0; i--) {\n    printf(\"%c\", a[i]);\n  }\n}\n"}
{"label": "16", "index": "30547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, j, k;\n  int a[4];\n  scanf(\"%d\", &n);\n  j = n;\n  if (j < 10)\n    k = 1;\n  if (j >= 10 && j < 100)\n    k = 2;\n  if (j >= 100 && j < 1000)\n    k = 3;\n  if (j >= 1000 && j < 10000)\n    k = 4;\n  a[3] = n / 1000;\n  a[2] = (n - a[3] * 1000) / 100;\n  a[1] = (n - a[3] * 1000 - a[2] * 100) / 10;\n  a[0] = n - a[3] * 1000 - a[2] * 100 - a[1] * 10;\n  switch (k) {\n  case 1:\n    printf(\"%d\", a[0]);\n    break;\n  case 2:\n    printf(\"%d%d\", a[0], a[1]);\n    break;\n  case 3:\n    printf(\"%d%d%d\", a[0], a[1], a[2]);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", a[0], a[1], a[2], a[3]);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nlong num;\nlong digit[5];\nint main() {\n  int count = 0, i;\n  long number;\n  do\n    scanf(\"%ld\", &num);\n  while (num < 0 || num > 99999);\n  count = 0;\n  number = num;\n  do {\n    digit[count++] = number % 10;\n    number = number / 10;\n  } while (number > 0);\n  for (i = 0; i < count; i++)\n    printf(\"%ld\", digit[i]);\n}\n"}
{"label": "16", "index": "30549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint e(int n) {\n  if (n == 0)\n    return 1;\n  else\n    return 10 * e(n - 1);\n}\nint main() {\n  int N;\n  int a[4];\n  int i = 0;\n  int t = 0;\n  int n = 0;\n  scanf(\"%d\", &N);\n  if (N != 0) {\n    while (N % (1 * e(i)) != N) {\n      a[i] = (N % (1 * e(i + 1)) - N % (1 * e(i))) / (1 * e(i));\n      i++;\n    }\n    while (t <= i - 1) {\n      cout << a[t];\n      t++;\n    }\n  } else\n    cout << \"0\\n\";\n  return 0;\n}\n"}
{"label": "16", "index": "30550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int n, int w) {\n  int x;\n  x = (int)pow(10, w - 1);\n  if (w != 1)\n    f(n % x, w - 1);\n  printf(\"%d\", n / x);\n}\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int w = (int)(log(n) / log(10)) + 1;\n  f(n, w);\n}\n"}
{"label": "16", "index": "30551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[50];\n  scanf(\"%d \", &n);\n  if (n == 0)\n    cout << 0;\n  for (int i = 3; i >= 0; i--) {\n    if (n / ((int)(pow(10.0, i)))) {\n      for (int j = i; j >= 0; j--) {\n        a[j] = (int)n / (int)(pow(10.0, j));\n        n = n - a[j] * pow(10.0, j);\n      }\n      for (int k = 0; k <= i; k++) {\n        cout << a[k];\n      }\n      break;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, r1, r2, r3, r4, r5;\n  double b;\n  scanf(\"%d\", &a);\n  b = (double)a / 10000;\n  if (b >= 1) {\n    r5 = a / 10000;\n    r4 = (a - 10000 * r5) / 1000;\n    r3 = (a - 10000 * r5 - 1000 * r4) / 100;\n    r2 = (a - 10000 * r5 - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 10000 * r5 - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d%d\\n\", r1, r2, r3, r4, r5);\n  } else if (b >= 0.1) {\n    r4 = a / 1000;\n    r3 = (a - 1000 * r4) / 100;\n    r2 = (a - 1000 * r4 - 100 * r3) / 10;\n    r1 = a - 1000 * r4 - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d%d\\n\", r1, r2, r3, r4);\n  } else if (b >= 0.01) {\n    r3 = a / 100;\n    r2 = (a - 100 * r3) / 10;\n    r1 = a - 100 * r3 - 10 * r2;\n    printf(\"%d%d%d\\n\", r1, r2, r3);\n  } else if (b >= 0.001) {\n    r2 = a / 10;\n    r1 = a - 10 * r2;\n    printf(\"%d%d\\n\", r1, r2);\n  } else\n    printf(\"%d\\n\", a);\n  return 0;\n}\n"}
{"label": "16", "index": "30553", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a;\n  scanf(\"%d\", &a);\n  if (a == 0)\n    cout << a;\n  if (a != 0) {\n    for (; a > 0;) {\n      printf(\"%d\", a % 10);\n      a = a / 10;\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30554", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, a, b, c, d, y;\n  cin >> x;\n  if (x >= 1000) {\n    a = x / 1000;\n    b = (x - 1000 * a) / 100;\n    c = (x - 1000 * a - 100 * b) / 10;\n    d = x - 1000 * a - 100 * b - 10 * c;\n    y = d * 1000 + c * 100 + b * 10 + a;\n    printf(\"%04d\", y);\n  }\n  if (x >= 100 && x < 1000) {\n    a = x / 100;\n    b = (x - 100 * a) / 10;\n    c = x - 100 * a - 10 * b;\n    y = c * 100 + b * 10 + a;\n    printf(\"%03d\", y);\n  }\n  if (x >= 10 && x < 100) {\n    a = x / 10;\n    b = x - a * 10;\n    y = b * 10 + a;\n    printf(\"%02d\", y);\n  }\n  if (x < 10)\n    printf(\"%d\", x);\n  return 0;\n}\n"}
{"label": "16", "index": "30555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, c, d, e, f;\n  scanf(\"%d \", &f);\n  if (f == 10000)\n    printf(\"00001\");\n  else if (f >= 1000 && f <= 9999) {\n    b = (int)f / 1000;\n    c = (int)(f - b * 1000) / 100;\n    d = (int)(f - b * 1000 - c * 100) / 10;\n    e = f - b * 1000 - c * 100 - d * 10;\n    printf(\"%d%d%d%d\", e, d, c, b);\n  } else if (f >= 100 && f <= 999) {\n    c = (int)f / 100;\n    d = (int)(f - c * 100) / 10;\n    e = (f - c * 100 - d * 10);\n    printf(\"%d%d%d\", e, d, c);\n  } else if (f >= 10 && f <= 99) {\n    d = (int)f / 10;\n    e = (f - d * 10);\n    printf(\"%d%d\", e, d);\n  } else if (f >= 0 && f <= 9)\n    printf(\"%d\", f);\n}\n"}
{"label": "16", "index": "30556", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a, b, c, d;\n  cin >> n;\n  a = n / 1000;\n  b = (n % 1000) / 100;\n  c = (n % 100) / 10;\n  d = n % 10;\n  if (n < 10)\n    printf(\"%d\", d);\n  else if (n < 100)\n    printf(\"%d%d\", d, c);\n  else if (n < 1000)\n    printf(\"%d%d%d\", d, c, b);\n  else if (n < 10000)\n    printf(\"%d%d%d%d\", d, c, b, a);\n  return 0;\n}\n"}
{"label": "16", "index": "30557", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a, b, c, d, x;\n  cin >> n;\n  x = n;\n  a = n / 10000;\n  n = n % 10000;\n  b = n / 1000;\n  n = n % 1000;\n  c = n / 100;\n  n = n % 100;\n  d = n / 10;\n  n = n % 10;\n  if (x < 10)\n    printf(\"%d\\n\", n);\n  else {\n    if (x < 100)\n      printf(\"%d%d\\n\", n, d);\n    else {\n      if (x < 1000)\n        printf(\"%d%d%d\\n\", n, d, c);\n      else {\n        if (x < 10000)\n          printf(\"%d%d%d%d\\n\", n, d, c, b);\n        else\n          printf(\"%d%d%d%d%d\\n\", n, d, c, b, a);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30558", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, r, i;\n  cin >> a;\n  r = 0;\n  i = 0;\n  while (a > 0) {\n    r = r * 10 + a % 10;\n    i = i + !(a % 10);\n    a = a / 10;\n  }\n  switch (i) {\n  case 0:\n    printf(\"%d\\n\", r);\n    break;\n  case 1:\n    printf(\"0%d\\n\", r);\n    break;\n  case 2:\n    printf(\"00%d\\n\", r);\n    break;\n  case 3:\n    printf(\"000%d\\n\", r);\n    break;\n  case 4:\n    printf(\"0000%d\\n\", r);\n    break;\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a, a1, a2, a3, a4, a5;\n  scanf(\"%d \", &a);\n  a1 = a / 10000;\n  a2 = (a - a1 * 10000) / 1000;\n  a3 = (a - a1 * 10000 - a2 * 1000) / 100;\n  a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;\n  a5 = a % 10;\n  if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0)\n    cout << a5 << endl;\n  else if (a1 == 0 && a2 == 0 && a3 == 0)\n    cout << a5 << a4 << \"\\n\";\n  else if (a1 == 0 && a2 == 0)\n    cout << a5 << a4 << a3 << endl;\n  else if (a1 == 0)\n    cout << a5 << a4 << a3 << a2 << endl;\n  else\n    cout << a5 << a4 << a3 << a2 << a1 << endl;\n\n  return 0;\n}\n"}
{"label": "16", "index": "30560", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int number, ge, shi, bai, qian, wan, place;\n  cin >> number;\n  if (number >= 10000)\n    place = 5;\n  else {\n    if (number >= 1000)\n      place = 4;\n    else {\n      if (number >= 100)\n        place = 3;\n      else {\n        if (number >= 10)\n          place = 2;\n        else\n          place = 1;\n      }\n    }\n  }\n  ge = number % 10;\n  shi = ((number - ge) % 100) / 10;\n  bai = ((number - ge - 10 * shi) % 1000) / 100;\n  qian = ((number - ge - 10 * shi - 100 * bai) % 10000) / 1000;\n  wan = (number - ge - 10 * shi - 100 * bai - 1000 * qian) / 10000;\n\n  switch (place) {\n  case 5:\n    printf(\"%d%d%d%d%d\", ge, shi, bai, qian, wan);\n    break;\n  case 4:\n    printf(\"%d%d%d%d\", ge, shi, bai, qian);\n    break;\n  case 3:\n    printf(\"%d%d%d\", ge, shi, bai);\n    break;\n  case 2:\n    printf(\"%d%d\", ge, shi);\n    break;\n  case 1:\n    printf(\"%d\", ge);\n  }\n  return 0;\n}\n"}
{"label": "16", "index": "30561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, a, b, c, d, e;\n  scanf(\"%d\", &num);\n  a = num / 10000;\n  b = num % 10000 / 1000;\n  c = num % 1000 / 100;\n  d = num % 100 / 10;\n  e = num % 10;\n  if (num / 10000 == 1)\n    printf(\"%d%d%d%d%d\", e, d, c, b, a);\n  else if (num / 1000 != 0)\n    cout << e << d << c << b;\n  else {\n    if (num / 100 != 0)\n      printf(\"%d%d%d\", e, d, c);\n    else if (num / 10 != 0)\n      printf(\"%d%d\", e, d);\n    else\n      cout << e;\n  }\n}\n"}
{"label": "16", "index": "30562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, c, b;\n  scanf(\"%d\", &n);\n  if (n == 0)\n    printf(\"0\");\n  for (i = 1; i <= n;) {\n    i = i * 10;\n    c = n % i;\n    n = n - c;\n    b = c * 10 / i;\n    printf(\"%d\", b);\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "16", "index": "30563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc) {\n  int i, n, c, b, a[10];\n  cin >> n;\n  b = 1;\n  i = 0;\n  while (b != 0) {\n    a[i] = n % 10;\n    b = n / 10;\n    n = b;\n    i++;\n  }\n  c = i;\n  i = 0;\n  while (i < c) {\n    printf(\"%d\", a[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30564", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[110];\nvoid search() {\n  int i = 0, l, t = 0;\n  char str1[110];\n  int stack[110];\n  cout << str << endl;\n  l = strlen(str);\n  memset(str1, ' ', sizeof(str1));\n  while (i < l) {\n    if (str[i] == '(') {\n      t++;\n      stack[t] = i;\n    }\n    if (str[i] == ')') {\n      if (t == 0)\n        str1[i] = '?';\n      else\n        t--;\n    }\n    i++;\n  }\n  for (i = 1; i <= t; i++) {\n    str1[stack[i]] = '$';\n  }\n  for (i = 0; i < l; i++)\n    cout << str1[i];\n  cout << endl;\n}\nint main() {\n  while (scanf(\"%s \", str))\n    search();\n  return 0;\n}\n"}
{"label": "17", "index": "30565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    cout << b[i] << endl;\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\nint cur = 0, flag = 0;\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30566", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nint temp[100];\nint addition[100];\nint flag, i, j;\nint f() {\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      addition[flag] = i;\n      flag++;\n    } else if (s[i] == ')') {\n      if (flag) {\n        s[i] = ' ';\n        flag--;\n        s[addition[flag]] = ' ';\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    flag = 0;\n    f();\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  int left = 0, right = 0;\n  int e[101] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    left = 0;\n    right = 0;\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      e[j] = 0;\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, len, e;\n  char s[102];\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", &s);\n    len = strlen(s);\n    cout << s << \"\\n\";\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (e = i + 1; e < len; e++) {\n          if (s[e] == ')') {\n            s[i] = ' ';\n            s[e] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(')\n        s[j] = '$';\n\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105];\n  while (scanf(\"%s \", a)) {\n    int n = strlen(a);\n    int i = 0, j, b[105];\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[i] = 1;\n      } else if (a[i] == ')') {\n        b[i] = -1;\n      } else\n        b[i] = 0;\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == -1) {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(a);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      else if (b[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30570", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid deal(char s[]) {\n  int i, j, p = 0;\n  for (i = 0; i < strlen(s); i++)\n    if (s[i] == '(') {\n      for (j = i + 1; j < strlen(s); j++)\n        if (s[j] == '(' || s[j] == ')') {\n          break;\n        }\n      if (s[j] == ')') {\n        s[j] = 'a';\n        s[i] = 'a';\n        p++;\n      }\n    }\n  if (p != 0)\n    deal(s);\n}\nint main() {\n  int i, j;\n  char s[1000], s1[1000], t[1000];\n  while (0 == 0) {\n    for (i = 0; i < 1000; i++)\n      s[i] = 0;\n\n    cin >> s;\n    if (s[0] == '\u0000')\n      break;\n    strcpy(s1, s);\n    deal(s1);\n    for (i = 0; i < strlen(s); i++)\n      if (s1[i] == '(')\n        t[i] = '$';\n      else if (s1[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    t[strlen(s)] = '\u0000';\n    printf(\"%s %s \", s, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid change(char str[]) {\n  int n, i;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == '(')\n      str[i] = '$';\n    else if (str[i] == ')')\n      str[i] = '?';\n    else\n      str[i] = ' ';\n  }\n}\nvoid match(char str[]) {\n  int n, i, k;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == ')') {\n      for (k = i; k >= 0; k--) {\n        if (str[k] == '(') {\n          str[k] = ' ';\n          str[i] = ' ';\n          k = -1;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char string[100];\n  while (cin >> string) {\n    puts(string);\n    match(string);\n    change(string);\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[1000];\nchar m[1000];\nint match(int l) {\n  \n  int r = l;\n  while (s[++r] != ')') {\n    if (s[r] == '(')\n      r = match(r);\n    if (s[r] == '\\0')\n      break;\n  }\n  if (s[r] == '\\0')\n    m[l] = '$';\n  return r;\n}\nint nextL(int i) {\n  while (s[i] != '\\0' && s[i] != '(') {\n    if (s[i] == ')')\n      m[i] = '?';\n    i++;\n  }\n  return i;\n}\nint main() {\n  int i, j, k;\n  while (cin >> s) {\n    for (i = 0; i < strlen(s); ++i)\n      m[i] = ' ';\n    m[i] = '\\0';\n    i = 0;\n    i = nextL(i);\n    while (s[i] != '\\0') {\n      i = match(i);\n      if (s[i] == '\\0')\n        break;\n      else\n        i++;\n      i = nextL(i);\n    }\n    cout << s << endl << m << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int maxn = 110;\n\nint main() {\n  char str[maxn], str2[maxn];\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      str2[i] = str[i];\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = str[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++)\n      printf(\"%c\", str2[i]);\n    printf(\"\\n\");\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[200] = {'\\0'};\n  int left[200] = {0};\n  int i = 0, k = 0;\n  while (cin.getline(word, 200)) {\n    for (i = 0; word[i]; i++)\n      cout << word[i];\n    cout << endl;\n    for (i = 0; word[i]; i++) {\n      if (word[i] == '(') {\n        left[k] = i;\n        k++;\n        word[i] = '$';\n      } else if (word[i] == ')') {\n        if (k) {\n          k--;\n          word[left[k]] = ' ';\n          word[i] = ' ';\n        } else\n          word[i] = '?';\n      } else\n        word[i] = ' ';\n    }\n    for (i = 0; word[i]; i++)\n      cout << word[i];\n    cout << \"\\n\";\n    k = 0;\n    memset(word, '\\0', sizeof(word));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30575", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[200], b[200];\n  int c[200];\n  int i, j, k, t, m, n;\n  while (scanf(\"%s \", a)) {\n\n    k = strlen(a);\n    m = 0;\n    n = 0;\n    for (i = 0; i < k; i++) {\n      cout << a[i];\n      if (i == k - 1)\n        printf(\"\\n\");\n      if (a[i] != '(' && a[i] != ')')\n        b[i] = ' ';\n      else if (a[i] == ')') {\n        c[m] = i;\n        m++;\n      }\n    }\n    n = m;\n    for (i = 0; i < n; i++) {\n      char *p = &a[c[i]];\n      t = 0;\n      for (j = 0; j <= c[i]; j++)\n        if (*p == '(') {\n          t = 1;\n          b[c[i] - j] = ' ';\n          b[c[i]] = ' ';\n          a[c[i] - j] = ' ';\n          break;\n        } else\n          p--;\n      if (t == 0)\n        b[c[i]] = '?';\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      cout << b[i];\n      if (i == k - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m;\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    char a[200] = {0};\n    char b[200] = {0};\n\n    cin >> a;\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n\n    for (j = 1; j < k; j++) {\n      if (b[j] == '?') {\n        for (m = j - 1; m >= 0; m--)\n          if (b[m] == '$') {\n            b[m] = ' ';\n            b[j] = ' ';\n            break;\n          }\n      }\n    }\n    cout << a << \" \" << b << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30577", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], t[101];\n  int i, j, k, c, b[101] = {0}, n;\n  for (; scanf(\"%s \", a);) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      t[i] = ' ';\n    }\n    for (i = 0; i <= n; i++) {\n\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 0) {\n            b[i] = 1;\n            b[j] = 1;\n            break;\n          }\n        if (j == -1) {\n          c++;\n          t[i] = '?';\n        }\n      }\n      if (a[i] == '\\0')\n        for (k = 0; k < i; k++) {\n          if (a[k] == '(' && b[k] == 0) {\n            c++;\n            t[k] = '$';\n          }\n        }\n    }\n    cout << a << endl;\n    if (c != 0) {\n      i = 0;\n      while (t[i] == ' ')\n        i++;\n      k = n - 1;\n      while (t[k] == ' ')\n        k--;\n      for (j = i; j <= k; j++)\n        cout << t[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar num2[110] = {'\\0'};\n\nint left(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == '(') {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == ')') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = left(num, point + 1, sum, l);\n    if (num[point] == '(' && k == 0) {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == '(' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == ')') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint right(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == ')') {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == '(') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = right(num, point - 1, sum, l);\n    if (num[point] == ')' && k == 0) {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == ')' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == '(') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint main() {\n  char num[110] = {'\\0'};\n  while (scanf(\"%s \", num)) {\n    int l = strlen(num);\n    cout << num << endl;\n    for (int i = 0; i < l; i++)\n      num2[i] = ' ';\n    num2[l] = '\\0';\n    left(num, 0, 0, l - 1);\n    right(num, l - 1, 0, 0);\n    printf(\"%s\\n\", num2);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  char s[102];\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n        for (j = i - 1; j > -1; j--)\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n      } else\n        s[i] = ' ';\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char a[100][101], b[100][101], *k, *l;\n  for (i = 0; i < 100; i++) {\n\n    cin >> a[i];\n    if (*(*(a + i)) == '\u0000')\n      break;\n    for (j = 0; *(*(a + i) + j) != '\u0000'; j++) {\n      if ((*(*(a + i) + j) >= 'a' && *(*(a + i) + j) <= 'z') ||\n          (*(*(a + i) + j) >= 'A' && *(*(a + i) + j) <= 'Z'))\n        b[i][j] = ' ';\n      else if (*(*(a + i) + j) == '(')\n        b[i][j] = '$';\n      else if (*(*(a + i) + j) == ')')\n        b[i][j] = '?';\n    }\n    b[i][j] = '\u0000';\n    for (k = b[i]; *k != '\u0000'; k++) {\n      if (*k == '?') {\n        for (l = k - 1; l >= b[i]; l--) {\n          if (*l == '$') {\n            *l = ' ';\n            *k = ' ';\n            break;\n          }\n        }\n      }\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    puts(a[i]);\n    puts(b[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[200], temp[200];\n  int n, i, figure, tempnum[200];\n  scanf(\"%d \", &n);\n  while (scanf(\"%s \", ch)) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        tempnum[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure > 0) {\n          figure--;\n          temp[tempnum[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    printf(\"%s %s \", ch, temp);\n  }\n}\n"}
{"label": "17", "index": "30582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char jiance[101], c;\n  int i, zifu, kuo2[100];\n  while (scanf(\"%s \", jiance)) {\n    cout << jiance << endl;\n    zifu = -1;\n    for (i = 0; jiance[i] != 0; i++) {\n      c = jiance[i];\n      jiance[i] = ' ';\n      if (c == '(') {\n        zifu++;\n        kuo2[zifu] = i;\n      } else if (c == ')') {\n        zifu--;\n        if (zifu < -1) {\n          jiance[i] = '?';\n          zifu = -1;\n        }\n      }\n    }\n    if (zifu > -1)\n      for (; zifu > -1; zifu--)\n        jiance[kuo2[zifu]] = '$';\n    cout << jiance << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30583", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[101];\nint find(char a[], int b, int x) {\n  int i;\n  for (i = b; i < x; i++) {\n    if (a[i + 1] == '$')\n      return 0;\n\n    if (a[i + 1] == '?') {\n      a[i + 1] = ' ';\n      a[b] = ' ';\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin.getline(a, 101)) {\n\n    int x = strlen(a), i, l[100], t = 0, temp;\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < x; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n        l[t] = i;\n        t++;\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; (i < t) && (i >= 0);) {\n      if (a[l[i]] == ' ') {\n        i++;\n        continue;\n      }\n      temp = find(a, l[i], x);\n      if (temp == 0)\n        i++;\n      if (temp == 1) {\n        i = 0;\n        continue;\n      }\n    }\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110], tra[110], mark[110];\n  int n, i, j, p, q;\n  while (scanf(\"%s \", str)) {\n    p = q = -1;\n    n = strlen(str);\n    mark[n] = NULL;\n    for (i = 0; i < n; i++) {\n      if (str[i] == '(')\n        p = i;\n    }\n    strcpy(tra, str);\n    for (i = p; i >= 0; i--)\n      if (tra[i] == '(')\n        for (j = i + 1; j < n; j++)\n          if (tra[j] == ')') {\n            tra[i] = tra[j] = 'a';\n            break;\n          }\n    for (i = 0; i < n; i++)\n      if (tra[i] == '(')\n        mark[i] = '$';\n      else if (tra[i] == ')')\n        mark[i] = '?';\n      else\n        mark[i] = ' ';\n    cout << str << \" \" << mark << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30585", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[110], tra[110], mark[110];\n  int n, i, j, p, q;\n  while (cin >> str) {\n    p = q = -1;\n    n = strlen(str);\n    mark[n] = NULL;\n    for (i = 0; i < n; i++) {\n      if (str[i] == '(')\n        p = i;\n    }\n    strcpy(tra, str);\n    for (i = p; i >= 0; i--)\n      if (tra[i] == '(')\n        for (j = i + 1; j < n; j++)\n          if (tra[j] == ')') {\n            tra[i] = tra[j] = 'a';\n            break;\n          }\n    for (i = 0; i < n; i++)\n      if (tra[i] == '(')\n        mark[i] = '$';\n      else if (tra[i] == ')')\n        mark[i] = '?';\n      else\n        mark[i] = ' ';\n    printf(\"%s %s \", str, mark);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30586", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  char string[101];\n  char string_copy[101];\n  char string_check[101];\n  int len = 0;\n  int index = 0;\n  int start = 0;\n  int turn = 0;\n  char y = 'n';\n\n  for (i = 0; i <= n; i++) {\n    len = 0;\n\n    scanf(\"%s \", string);\n    while (string[len])\n      len++;\n\n    strcpy(string_copy, string);\n\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] != '(' && string_copy[index] != ')')\n        string_copy[index] = ' ';\n      if (string[index] == '(' || string[index] == ')')\n        y = 'y';\n    }\n    if (y == 'n')\n      continue;\n\n    for (turn = 0; turn <= len / 2; turn++) {\n      y = 'n';\n      start = 0;\n      for (index = 0; index < len; index++) {\n        if (string_copy[index] == '(')\n          start = index;\n        if (string_copy[index] == ')' && string_copy[start] == '(') {\n          string_copy[index] = ' ';\n          string_copy[start] = ' ';\n        }\n      }\n    }\n\n    strcpy(string_check, string_copy);\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] == '(')\n        string_copy[index] = '$';\n      if (string_copy[index] == ')')\n        string_copy[index] = '?';\n    }\n    if (strcmp(string_copy, string_check) != 0) {\n      printf(\"%s %s \", string, string_copy);\n    } else {\n      printf(\"%s \", string);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30587", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar *mystrrchr(char *strcopy, char *end) {\n  char *tmp = end - 1;\n  while (tmp >= strcopy) {\n    if (*tmp == '(') {\n      return tmp;\n    }\n    tmp--;\n  }\n  return NULL;\n}\n\nvoid judge(char *str, char *flag) {\n  char strcopy[101];\n  strcpy(strcopy, str);\n  int len = strlen(strcopy);\n  char *index1 = strchr(strcopy, ')');\n  while (index1 != NULL && (index1 - strcopy) < len) {\n    char *index2 = mystrrchr(strcopy, index1);\n    if (index2 != NULL) {\n      strcopy[index1 - strcopy] = '-';\n      strcopy[index2 - strcopy] = '-';\n    }\n    index1 = strchr(index1 + 1, ')');\n  }\n  int i = 0;\n  for (i = 0; i < len; i++) {\n    if (strcopy[i] == '(')\n      flag[i] = '$';\n    if (strcopy[i] == ')')\n      flag[i] = '?';\n  }\n  printf(\"%s %s \", str, flag);\n}\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  getchar();\n  char str[101];\n  char flag[101];\n  while (n > 0) {\n    memset(flag, ' ', sizeof(flag));\n\n    cin >> str;\n    flag[strlen(str)] = '\u0000';\n    judge(str, flag);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[999];\nint find(int i, int l) {\n  int t;\n  if (s[i] == '\\0')\n    return -1;\n  if (s[i] == '(') {\n    t = find(i + 1, l + 1);\n    if (t == -1)\n      s[i] = '$';\n    else\n      s[i] = ' ';\n    if (t == -1)\n      return -1;\n    else {\n      return find(t + 1, l);\n    }\n  }\n  if (s[i] == ')') {\n    if (l == 0)\n      s[i] = '?';\n    else\n      s[i] = ' ';\n    if (l == 0)\n      return find(i + 1, 0);\n    else\n      return i;\n  }\n  s[i] = ' ';\n  return find(i + 1, l);\n}\nint main() {\n  for (; cin >> s;) {\n    cout << s << endl;\n    find(0, 0);\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30589", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nchar b[150];\nint sig[150];\nint main() {\n  int i, k = 0;\n  while (scanf(\"%s \", a)) {\n    k = 0;\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      b[i] = a[i];\n      if (a[i] == '(') {\n        b[i] = '$';\n        sig[k] = i;\n        k++;\n      }\n      if (a[i] == ')') {\n        k--;\n        if (k < 0) {\n          b[i] = '?';\n          k = 0;\n        } else {\n          b[sig[k]] = 'a';\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        printf(\" \");\n      else\n        cout << b[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int b[100] = {0};\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    char a1[100] = \" \";\n    int len = strlen(a);\n    int i = 0;\n    int lnum = 0, rnum = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[lnum] = i;\n        lnum++;\n      }\n      if (a[i] == ')') {\n        rnum++;\n        if (rnum > lnum) {\n          a1[i] = '?';\n          rnum--;\n        } else {\n          lnum--;\n          rnum--;\n        }\n      }\n    }\n    for (i = 0; i < lnum; i++)\n      a1[b[i]] = '$';\n    for (i = 0; i < len; i++) {\n      if ((a1[i] == '$') || (a1[i] == '?'))\n        cout << a1[i];\n      else\n        printf(\" \");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  char s1[101], s2[101] = {0};\n  for (i = 1; i > 0;) {\n\n    scanf(\"%s \", s1);\n    if (strcmp(s1, s2) == 0) {\n      printf(\" \");\n      break;\n    }\n    puts(s1);\n    l = strlen(s1);\n    for (j = 0; j < l; j++) {\n      if (s1[j] != '(' && s1[j] != ')')\n        s1[j] = ' ';\n      else {\n        if (s1[j] == ')') {\n          for (k = j; k >= 0; k--)\n            if (s1[k] == '(')\n              break;\n          if (k != -1)\n            s1[k] = s1[j] = ' ';\n          else\n            s1[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s1[j] == '(')\n        s1[j] = '$';\n    }\n    strcpy(s2, s1);\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[200] = {'\\0'};\n  int left[200] = {0};\n  int i = 0, k = 0;\n  while (cin.getline(word, 200)) {\n    for (i = 0; word[i]; i++)\n      cout << word[i];\n    cout << endl;\n    for (i = 0; word[i]; i++) {\n      if (word[i] == '(') {\n        left[k] = i;\n        k++;\n        word[i] = '$';\n      } else if (word[i] == ')') {\n        if (k) {\n          k--;\n          word[left[k]] = ' ';\n          word[i] = ' ';\n        } else\n          word[i] = '?';\n      } else\n        word[i] = ' ';\n    }\n    for (i = 0; word[i]; i++)\n      printf(\"%c\", word[i]);\n    cout << \"\\n\";\n    k = 0;\n    memset(word, '\\0', sizeof(word));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30593", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint pp[120];\nvoid kuohao(char a[]) {\n\n  int i, j, len = strlen(a);\n  for (i = 0; i <= len - 1; i++) {\n    if (a[i] == ')') {\n      for (j = i; j >= 0; j--) {\n        if (a[j] == '(') {\n          pp[i] = 0;\n          pp[j] = 0;\n          a[i] = 'a';\n          a[j] = 'a';\n          break;\n        }\n        if (j == 0)\n          pp[i] = 1;\n      }\n      a[i] = 'a';\n      kuohao(a);\n    }\n    if (i == len - 1) {\n      for (j = 0; j <= len - 1; j++)\n        if (a[j] == '(')\n          pp[j] = -1;\n      return;\n    }\n  }\n}\n\nint main() {\n  char str[200];\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    int i;\n    for (i = 0; i <= 119; i++)\n      pp[i] = 0;\n    kuohao(str);\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (pp[i] == 0)\n        cout << \" \";\n      else if (pp[i] == 1)\n        printf(\"?\");\n      else\n        cout << \"$\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[101];\n\nint main() {\n  int i, n, j, k, m, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++)\n      a[0] = '\\0';\n    scanf(\"%s\", a);\n    cout << a << \"\\n\";\n    m = strlen(a);\n    for (j = m - 1; j >= 0; j--) {\n      if (a[j] == '(') {\n        if (j == m - 1) {\n          a[j] = '$';\n          continue;\n        }\n        b = 1;\n        for (k = j + 1; k < m; k++) {\n\n          if (a[k] == ')') {\n            a[j] = ' ';\n            a[k] = ' ';\n            b = 0;\n            break;\n          }\n        }\n        if (b)\n          a[j] = '$';\n      }\n    }\n    for (j = m - 1; j >= 0; j--) {\n\n      if (a[j] == ')')\n        a[j] = '?';\n      else if (a[j] != '$')\n        a[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30595", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar a[110];\nint match(int i) {\n  int j;\n  int l = strlen(a);\n  if (i == l)\n    return 0;\n  if (a[i] == '?') {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == '$') {\n\n        a[j] = ' ';\n        a[i] = ' ';\n        break;\n      }\n    }\n  }\n  match(i + 1);\n  return 0;\n}\nint main() {\n  int l;\n  int i;\n  while (scanf(\"%s\", a) != EOF) {\n    cout << a << \"\\n\";\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else {\n        if (a[i] == ')')\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    match(1);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30596", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%s \", a);\n    printf(\"%s\\n\", a);\n    for (i = strlen(a) - 2; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++) {\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        putchar('$');\n      else if (a[i] == ')')\n        putchar('?');\n      else\n        putchar(' ');\n    }\n    putchar('\\n');\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30597", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char word[105], sign[105];\n  int num = 0, i, len;\n  while (cin.getline(word, 105)) {\n    num = 0;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      sign[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        num++;\n      if (word[i] == ')') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '?';\n      }\n    }\n    num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (word[i] == ')')\n        num++;\n      if (word[i] == '(') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '$';\n      }\n    }\n    sign[len] = '\\0';\n    printf(\"%s\\n\", word);\n    cout << sign << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, k, m;\n  int len;\n  char c[101] = {'0'};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (j = len - 1; j >= 0; j--) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == '(' && j == len - 1)\n        c[j] = '$';\n      if (c[j] == '(') {\n        k = j;\n        for (m = k; m < len; m++) {\n          if (c[m] == ')') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n        if (m == len - 1 && c[len - 1] != ' ') {\n          c[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (c[j] == ')')\n        c[j] = '?';\n      if (c[j] == '(')\n        c[j] = '$';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30599", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  cin >> n;\n  char a[100][1000];\n  for (i = 0; i < n + 1; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n + 1; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[500][103];\nvoid chuli(int i, int la) {\n  int j, k, l, flag = 0;\n  for (j = 0; j < la - 1; j++) {\n    if (a[i][j] == '(') {\n      k = j + 1;\n      while (a[i][k] != '(' && a[i][k] != ')' && k < la)\n        k++;\n      if (a[i][k] == ')') {\n        flag = 1;\n        a[i][j] = a[i][k] = ' ';\n      } \n    }\n  }\n  if (flag == 1)\n    chuli(i, la); \n}\nint main() {\n  int n = 0, la[500] = {0}, i, j;\n  char c, b[500][103];\n  while (cin >> c) {\n    while (c != '\\n') {\n      a[n][la[n]] = b[n][la[n]] = c;\n      la[n]++;\n      c = getchar();\n    }\n    n++;\n  } \n  for (i = 0; i < n; i++)\n    chuli(i, la[i]); \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < la[i]; j++)\n      cout << b[i][j];\n    cout << endl;\n    for (j = 0; j < la[i]; j++) {\n      if (a[i][j] == '(')\n        cout << '$';\n      else if (a[i][j] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    if (i != n - 1)\n      cout << endl;\n  } \n  return 0;\n}\n"}
{"label": "17", "index": "30601", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, k, m;\n  int len;\n  char c[101] = {'0'};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    scanf(\"%s \", c);\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (j = len - 1; j >= 0; j--) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == '(' && j == len - 1)\n        c[j] = '$';\n      if (c[j] == '(') {\n        k = j;\n        for (m = k; m < len; m++) {\n          if (c[m] == ')') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n        if (m == len - 1 && c[len - 1] != ' ') {\n          c[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (c[j] == ')')\n        c[j] = '?';\n      if (c[j] == '(')\n        c[j] = '$';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30602", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  while (1) {\n    char str1[100], str2[100];\n\n    cin >> str1;\n\n    if (feof(stdin))\n      break;\n\n    puts(str1);\n\n    int k, n = strlen(str1), left[100], right[100], l = 0, r = 0;\n    for (k = 0; k <= n - 1; k++) {\n      if (str1[k] == '(') {\n        left[l] = k;\n        l++;\n      } else if (str1[k] == ')') {\n        right[r] = k;\n        r++;\n      } else\n        str2[k] = ' ';\n    }\n    left[l] = 100;\n    right[r] = 100;\n    str2[n] = '\u0000';\n\n    int i, j, x = 1, y = 1;\n    for (i = l - 1; i >= 0; i--) {\n      int p = 0;\n      while (right[p] < left[i])\n        p++;\n      if (x > (r - p))\n        str2[left[i]] = '$';\n      else {\n        str2[left[i]] = ' ';\n        x++;\n      }\n    }\n    for (j = 0; j <= r - 1; j++) {\n      int q = 0;\n      while (left[q] < right[j])\n        q++;\n      if (y > q)\n        str2[right[j]] = '?';\n      else {\n        str2[right[j]] = ' ';\n        y++;\n      }\n    }\n\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char jiance[101], c;\n  int i, zifu, kuo2[100];\n  while (cin >> jiance) {\n    cout << jiance << endl;\n    zifu = -1;\n    for (i = 0; jiance[i] != 0; i++) {\n      c = jiance[i];\n      jiance[i] = ' ';\n      if (c == '(') {\n        zifu++;\n        kuo2[zifu] = i;\n      } else if (c == ')') {\n        zifu--;\n        if (zifu < -1) {\n          jiance[i] = '?';\n          zifu = -1;\n        }\n      }\n    }\n    if (zifu > -1)\n      for (; zifu > -1; zifu--)\n        jiance[kuo2[zifu]] = '$';\n    cout << jiance << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30604", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char chuan[101], shuchu[100];\n  int count1, count2, length, i, j;\n  while (cin >> chuan) {\n    printf(\"%s\\n\", chuan);\n    length = strlen(chuan);\n    strcpy(shuchu, chuan);\n    count1 = 0;\n    count2 = 0;\n    for (i = 0; i < length; i++) {\n      if (chuan[i] == '(')\n        count1++;\n      if (chuan[i] == ')') {\n        count2++;\n        if (count2 > count1) {\n          shuchu[i] = '?';\n          count2--;\n        }\n      }\n    }\n\n    count1 = 0;\n    count2 = 0;\n    for (i = length - 1; i >= 0; i--) {\n      if (chuan[i] == ')')\n        count2++;\n      if (chuan[i] == '(') {\n        count1++;\n        if (count1 > count2) {\n          shuchu[i] = '$';\n          count1--;\n        }\n      }\n    }\n    shuchu[length] = '\\0';\n    for (i = 0; i < length; i++) {\n      if (shuchu[i] != '?' && shuchu[i] != '$')\n        shuchu[i] = ' ';\n    }\n    printf(\"%s\\n\", shuchu);\n    memset(shuchu, 0, sizeof(shuchu));\n    memset(chuan, 0, sizeof(chuan));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30605", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(char b[], int n, int m) {\n  if (b[m] != ')' && m < n) {\n    change(b, n, m + 1);\n  }\n  if (b[m] == ')' && m < n) {\n    int i;\n    for (i = m; i >= 0; i--) {\n      if (b[i] == '(') {\n        b[i] = 'A';\n        b[m] = 'A';\n        break;\n      }\n    }\n    change(b, n, m + 1);\n  }\n}\nint main() {\n  char a[200];\n  scanf(\"%s \", a);\n  getchar();\n  while (a[0] != 0) {\n    int num, j;\n    num = strlen(a);\n    cout << a << endl;\n    change(a, num, 0);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(')\n        a[j] = '$';\n      else {\n        if (a[j] == ')')\n          a[j] = '?';\n        else\n          a[j] = ' ';\n      }\n    }\n    cout << a << endl;\n    cin.getline(a, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30606", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[105];\n  char sign[105];\n  char present[105];\n  while (scanf(\"%s\", zfc) > 0) {\n\n    strcpy(sign, zfc);\n    strcpy(present, zfc);\n    int left = 0, right = 0;\n    int m = strlen(zfc);\n    for (int i = 0; i < m; i++) {\n      if (zfc[i] == '(') {\n        left = 0;\n        right = 0;\n        for (int j = i; j < m; j++) {\n          if (zfc[j] == '(') {\n            left++;\n          }\n          if (zfc[j] == ')') {\n            left--;\n          }\n          if (left <= 0) {\n            break;\n          }\n        }\n        if (left > 0)\n          sign[i] = '$';\n      }\n      if (zfc[i] == ')') {\n        left = 0;\n        right = 0;\n        for (int j = i; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            right--;\n          }\n          if (zfc[j] == ')') {\n            right++;\n          }\n          if (right <= 0) {\n            break;\n          }\n        }\n        if (right > 0) {\n          sign[i] = '?';\n        }\n      }\n    }\n    for (int i = 0; i < m; i++) {\n      if (sign[i] != '$' && sign[i] != '?')\n        sign[i] = ' ';\n    }\n    puts(present);\n    puts(sign);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30607", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len, i, h;\n  char c[102];\n  int a[101];\n  int b[101];\n  while ((cin.getline(c, 101))) {\n    len = strlen(c);\n    cout << c << endl;\n    h = 0;\n    for (i = 0; i <= len; i++)\n      a[i] = -1;\n    memset(b, 0, sizeof(b));\n    for (i = 0; i <= len - 1; i++) {\n      switch (c[i]) {\n      case '(': {\n        h++;\n        a[h] = i;\n        break;\n      }\n      case ')': {\n        if (h == 0) {\n          b[i] = 2;\n        } else {\n          a[h] = 0;\n          h--;\n        }\n        break;\n      }\n      }\n    }\n    for (i = 1; i <= h; i++) {\n      if (a[i] != -1)\n        b[a[i]] = 1;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (b[i] == 1)\n        cout << '$';\n      if (b[i] == 2)\n        cout << '?';\n      if (b[i] == 0)\n        cout << ' ';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30608", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int b[100] = {0};\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    char a1[100] = \" \";\n    int len = strlen(a);\n    int i = 0;\n    int lnum = 0, rnum = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[lnum] = i;\n        lnum++;\n      }\n      if (a[i] == ')') {\n        rnum++;\n        if (rnum > lnum) {\n          a1[i] = '?';\n          rnum--;\n        } else {\n          lnum--;\n          rnum--;\n        }\n      }\n    }\n    for (i = 0; i < lnum; i++)\n      a1[b[i]] = '$';\n    for (i = 0; i < len; i++) {\n      if ((a1[i] == '$') || (a1[i] == '?'))\n        cout << a1[i];\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30609", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, t, j, la, k, bb, pp;\n  while (cin.getline(a, 101, '\\n')) {\n    printf(\"%s\\n\", a);\n    la = strlen(a);\n    for (i = 0; i < la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    t = 0;\n    while (t == 0) {\n      t = 1;\n      for (i = la - 1; i >= 0; i--) {\n        if (a[i] == ')')\n          break;\n        if (a[i] == '(') {\n          a[i] = '$';\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == ')') {\n          a[i] = '?';\n          break;\n        }\n        if (a[i] == '(')\n          break;\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(') {\n          for (j = i + 1; j < la; j++) {\n            k = 2;\n            if (a[j] == '(') {\n              k = 0;\n              break;\n            }\n            if (a[j] == ')') {\n              k = 1;\n              a[j] = ' ';\n              break;\n            }\n          }\n          if (k == 1) {\n            a[i] = ' ';\n          }\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          t = 0;\n          break;\n        }\n      }\n    }\n    for (i = la - 1; i >= 0; i--) {\n      if (a[i] != ' ')\n        break;\n    }\n    bb = i;\n    for (i = 0; i < la; i++) {\n      if (a[i] != ' ')\n        break;\n    }\n    pp = i;\n    for (j = pp; j <= bb; j++)\n      cout << a[j];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char s[105], a[105];\n    int i, k = 0, stack[105];\n    memset(a, ' ', sizeof(a));\n    cin >> s;\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        stack[k++] = -i - 1;\n      else if (s[i] == ')')\n        if (k == 0 || stack[k - 1] > 0)\n          stack[k++] = i + 1;\n        else\n          k--;\n    for (i = 0; i < k; i++)\n      if (stack[i] > 0)\n        a[stack[i] - 1] = '?';\n      else\n        a[-stack[i] - 1] = '$';\n    a[strlen(s)] = '\\0';\n    cout << s << \"\\n\" << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30611", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nint dp[1000];\nint main(void) {\n\n  int i, j, n;\n  scanf(\"%d \", &n);\n  while (scanf(\"%s\", s) == 1) {\n    memset(dp, 0, sizeof(dp));\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        dp[i] = -1;\n      if (s[i] == ')')\n        dp[i] = 1;\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(' && dp[j] == -1) {\n            dp[i] = 0;\n            dp[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < n; i++) {\n      if (dp[i] == -1)\n        printf(\"$\");\n      else if (dp[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30612", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105];\n  int mm;\n  scanf(\"%d\", &mm);\n  while (mm--) {\n    while (scanf(\"%s \", a)) {\n      int n = strlen(a);\n      int i = 0, j, b[105];\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(') {\n          b[i] = 1;\n        } else if (a[i] == ')') {\n          b[i] = -1;\n        } else\n          b[i] = 0;\n      }\n      for (i = 0; i < n; i++) {\n        if (b[i] == -1) {\n          for (j = i; j >= 0; j--) {\n            if (b[j] == 1) {\n              b[i] = 0;\n              b[j] = 0;\n              break;\n            }\n          }\n        }\n      }\n      puts(a);\n      cout << \" \";\n      for (i = 0; i < n; i++) {\n        if (b[i] == 0)\n          printf(\" \");\n        else if (b[i] == 1)\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, s;\nchar a[101];\nvoid f(int x) {\n  a[x] = '$';\n  if (x < s - 1) {\n    for (int j = x + 1; j < s; j++) {\n      if (a[j] == '(') {\n        i = j;\n        f(j);\n      } else if (a[j] == ')') {\n        a[x] = ' ', a[j] = ' ';\n        return;\n      } else if (a[j] != '$')\n        a[j] = ' ';\n    }\n  }\n  return;\n}\nint main() {\n  int j = 0;\n  while (cin.getline(a, 101)) {\n    if (j != 0)\n      cout << endl;\n    cout << a;\n    s = strlen(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        f(i);\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    j++;\n    cout << endl << a;\n  }\n}\n"}
{"label": "17", "index": "30614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][1000], s[1000];\n  int i, j, n, a[1000], temp;\n  for (i = 0; i < 100; i++)\n    str[i][0] = '\u0000';\n\n  i = 0;\n  do {\n\n    cin >> str[i];\n    if (str[i][0] == '\u0000')\n      break;\n    i++;\n  } while (1);\n  n = i - 1;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j < 1000; j++)\n      s[j] = '\u0000';\n    temp = 0;\n    printf(\"%s \", str[i]);\n    for (j = 0; j < (strlen(str[i])); j++) {\n      if (str[i][j] == '(') {\n        s[j] = '$';\n        temp++;\n        a[temp] = j;\n      } else if (str[i][j] == ')') {\n        if (temp == 0)\n          s[j] = '?';\n        else {\n          s[a[temp]] = ' ';\n          temp--;\n          s[j] = ' ';\n        }\n      } else\n        s[j] = ' ';\n    }\n    printf(\"%s \", s);\n  }\n}\n"}
{"label": "17", "index": "30615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int left[100] = {0}, right[100] = {0};\n  while (cin >> line) {\n    int i, k1 = 0, k2 = 0;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '(') {\n        left[k1] = i;\n        k1++;\n      }\n      if (line[i] == ')') {\n        if (k1 != 0) {\n          left[k1 - 1] = 0;\n          k1--;\n        } else {\n          right[k2] = i;\n          k2++;\n        }\n      }\n    }\n    char ans[101];\n    for (i = 0; i < strlen(line); i++)\n      ans[i] = ' ';\n    ans[strlen(line)] = '\\0';\n    for (i = 0; i < k1; i++) {\n      ans[left[i]] = '$';\n    }\n    for (i = 0; i < k2; i++)\n      ans[right[i]] = '?';\n\n    cout << line << endl;\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30616", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int m = 1; m <= n; m++) {\n    char str[105], str2[105];\n    cin >> str;\n    int stack[105];\n    int len = strlen(str), k = 0;\n    for (int i = 0; i < len; i++) {\n      str2[i] = ' ';\n    }\n    str2[len] = '\\0';\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k == 0 || stack[k - 1] > 0) {\n          stack[k++] = i + 1;\n        } else\n          k--;\n      } else if (str[i] == '(') {\n        stack[k++] = -i - 1;\n      }\n    }\n    for (int i = 0; i < k; i++) {\n      if (stack[i] < 0)\n        str2[-stack[i] - 1] = '$';\n      else\n        str2[stack[i] - 1] = '?';\n    }\n    cout << str << endl;\n    cout << str2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30617", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(char str[105], int len) {\n  int i, j;\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ')') {\n      int x = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (str[j] == '(') {\n          x = 1;\n          str[i] = 'a';\n          str[j] = 'a';\n          break;\n        }\n      }\n      if (x == 0)\n        str[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] == '(') {\n      str[i] = '$';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] != '$' && str[i] != '?') {\n      str[i] = ' ';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n}\nint main() {\n  char str[105];\n  int len;\n  while (cin >> str) {\n    len = strlen(str);\n    f(str, len);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30618", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  char *exp = (char *)malloc(sizeof(char) * 1000);\n  int *res = (int *)malloc(sizeof(int) * 1000);\n  while (cin >> exp) {\n    int cur = 0, pt = 0, len = strlen(exp);\n    for (int i = 0; i != 1000; ++i)\n      res[i] = -1;\n    for (; cur != len; ++cur) {\n      if (exp[cur] != '(' && exp[cur] != ')')\n        res[cur] = 0;\n      if (exp[cur] == ')') {\n        for (pt = cur - 1; pt >= 0; --pt) {\n          if (exp[pt] == '(' && res[pt]) {\n            res[pt] = 0;\n            res[cur] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(exp);\n    for (int i = 0; i != len; ++i) {\n      if (exp[i] == '(' && res[i] == -1)\n        res[i] = 1;\n      else if (exp[i] == ')' && res[i] == -1)\n        res[i] = 2;\n      switch (res[i]) {\n      case 0:\n        putchar(' ');\n        break;\n      case 1:\n        putchar('$');\n        break;\n      case 2:\n        putchar('?');\n        break;\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  \n  int i, len, lnum, num = 0, left[102] = {-1}, fail[102] = {0}, t = 0;\n  char s1[102];\n  while (scanf(\"%s\", s1) != EOF) {\n    printf(\"%s\\n\", s1);\n    len = strlen(s1);\n    lnum = 0;\n    for (i = 0; i < len; i++) {\n      if (s1[i] == '(') {\n        lnum++;\n        left[lnum] = i;\n      }\n\n      if (s1[i] == ')') {\n        if (lnum == 0)\n          fail[i] = 2;\n        else {\n          left[lnum] = -1;\n          lnum--;\n        }\n      }\n    }\n    for (i = 1; i <= lnum; i++) {\n      fail[left[i]] = 1;\n      left[i] = -1;\n    }\n    \n    for (i = 0; i < len; i++)\n      if (fail[i] > 0)\n        num++;\n    for (i = 0; i < len && num > 0; i++) {\n      if (fail[i] == 2) {\n        printf(\"?\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 1) {\n        printf(\"$\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 0 && t == 1)\n        printf(\" \");\n      fail[i] = 0;\n    }\n    t = 0;\n    printf(\"\\n\");\n  }\n  \n  return 0;\n}\n"}
{"label": "17", "index": "30620", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(char b[], int n, int m) {\n  if (b[m] != ')' && m < n) {\n    change(b, n, m + 1);\n  }\n  if (b[m] == ')' && m < n) {\n    int i;\n    for (i = m; i >= 0; i--) {\n      if (b[i] == '(') {\n        b[i] = 'A';\n        b[m] = 'A';\n        break;\n      }\n    }\n    change(b, n, m + 1);\n  }\n}\nint main() {\n  char a[200];\n  scanf(\"%s \", a);\n  getchar();\n  while (a[0] != 0) {\n    int num, j;\n    num = strlen(a);\n    printf(\"%s\\n\", a);\n    change(a, num, 0);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(')\n        a[j] = '$';\n      else {\n        if (a[j] == ')')\n          a[j] = '?';\n        else\n          a[j] = ' ';\n      }\n    }\n    printf(\"%s\\n\", a);\n    cin.getline(a, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30621", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, p, l;\n  char s[100][100];\n  int a[100] = {0};\n  cin >> n;\n  getchar();\n  for (i = 1; i <= n; i++) {\n\n    cin >> s[i];\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == '(')\n        a[j] = 1;\n      if (s[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 2) {\n        for (m = j; m >= 0; m--) {\n          if (a[m] == 1) {\n            a[m] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s[i]);\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1) {\n        printf(\"$\");\n      }\n      if (a[j] == 2) {\n        printf(\"?\");\n      }\n      if (a[j] == 0) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[101], b[101];\nint panduan[101];\nint l;\nvoid deal(int k) {\n  if (k > 0) {\n    if (a[k - 1] == ')') {\n      panduan[k - 1] = 1;\n      deal(k - 1);\n    } else if (a[k - 1] == '(') {\n      panduan[k - 1] = 2;\n      for (int i = k; i < l; i++)\n        if (panduan[i] == 1) {\n          panduan[k - 1] = 0;\n          panduan[i] = 0;\n          break;\n        }\n      deal(k - 1);\n    } else\n      deal(k - 1);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 101; i++) {\n    a[i] = ' ';\n    b[i] = ' ';\n    panduan[i] = 0;\n  }\n  while (scanf(\"%s \", a)) {\n    l = strlen(a);\n    deal(l);\n    for (i = 0; i < l; i++) {\n      if (panduan[i] == 1)\n        b[i] = '?';\n      if (panduan[i] == 2)\n        b[i] = '$';\n    }\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      printf(\"%c\", b[i]);\n    cout << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = ' ';\n      b[i] = ' ';\n      panduan[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[200], temp[200];\n  int n, i, figure, tempnum[200];\n  scanf(\"%d \", &n);\n  while (scanf(\"%s \", ch)) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        tempnum[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure > 0) {\n          figure--;\n          temp[tempnum[figure]] = ' ';\n        } else {\n          temp[i] = '?';\n        }\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    printf(\"%s %s \", ch, temp);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[1000], b[1000];\n  int i, j, k, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%s\", &a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      } else {\n        b[j] = a[j];\n      }\n    }\n    \n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        for (k = j + 1; k < strlen(a); k++) {\n          if (b[k] == '(') {\n            e++;\n          } else if (b[k] == ')' && e == 0) {\n            b[k] = ' ';\n            b[j] = ' ';\n            e++;\n          }\n        }\n        e = 0;\n      }\n      \n      else if (b[j] == ')') {\n        e = 0;\n        k = j - 1;\n        for (k = j - 1; k > 0; k--) {\n          if (b[k] == '(') {\n            b[k] = ' ';\n            b[j] = ' ';\n            k = 0;\n            e = 1;\n          }\n        }\n        if (e == 0 && b[0] == '(') {\n          b[0] = ' ';\n          b[j] = ' ';\n        }\n      }\n    }\n    \n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        b[j] = '$';\n      } else if (b[j] == ')') {\n        b[j] = '?';\n      }\n    }\n    \n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", a[j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30625", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[200];\nvoid match(char a[]) {\n\n  int s;\n  s = strlen(a);\n  if (s == 0)\n    return;\n  int i, j;\n  int check = 0;\n  for (i = 0; i < s - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < s && a[j] == ' '; j++)\n        ;\n      if (j < s) {\n        if (a[j] == ')') {\n          check = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (check == 1) {\n    a[i] = ' ';\n    a[j] = ' ';\n    match(a);\n  }\n  if (check == 0)\n    return;\n}\nint main() {\n\n  int n;\n  cin >> n;\n  char temp;\n  scanf(\"%c\", &temp);\n  while (n--) {\n\n    cin >> a;\n    puts(a);\n    int s;\n    s = strlen(a);\n    int i;\n    for (i = 0; i < s; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    match(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[1000], label[1000];\n  int pos[1000];\n  int len, i;\n  while (cin.getline(line, 1000)) {\n    int left = 0, right = 0, s = -1;\n    len = strlen(line);\n    for (i = 0; i < 1000; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++s] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          s--;\n        }\n      }\n    }\n    if (s >= 0) {\n      for (i = 0; i <= s; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char c[100];\n  int a[100] = {0};\n  while (scanf(\"%s\", c) != EOF) {\n\n    if (c[0] == '\u0000')\n      break;\n    printf(\"%s \", c);\n    k = strlen(c);\n    for (i = 0; i <= k - 1; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == -1) {\n            a[j] = 2;\n            a[i] = 2;\n            break;\n          }\n      }\n\n      else\n        a[i] = 2;\n    }\n    if (c[0] == ')')\n      a[0] = 1;\n\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == 2)\n        cout << \" \";\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30628", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110], tra[110], mark[110];\n  int n, i, j, p, q;\n  while (scanf(\"%s \", str)) {\n    p = q = -1;\n    n = strlen(str);\n    mark[n] = NULL;\n    for (i = 0; i < n; i++) {\n      if (str[i] == '(')\n        p = i;\n    }\n    strcpy(tra, str);\n    for (i = p; i >= 0; i--)\n      if (tra[i] == '(')\n        for (j = i + 1; j < n; j++)\n          if (tra[j] == ')') {\n            tra[i] = tra[j] = 'a';\n            break;\n          }\n    for (i = 0; i < n; i++)\n      if (tra[i] == '(')\n        mark[i] = '$';\n      else if (tra[i] == ')')\n        mark[i] = '?';\n      else\n        mark[i] = ' ';\n    printf(\"%s %s \", str, mark);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30629", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  int flag[101];\n  int i, j, len, count, sign;\n  while (1) {\n    sign = 0;\n    i = -1;\n    do {\n      i++;\n      if (cin.get(a[i]))\n        sign = 1;\n    } while (a[i] != '\\n');\n    if (sign == 0)\n      break;\n    a[i] = 0;\n    len = i;\n    memset(b, ' ', sizeof(b));\n    b[i] = 0;\n    memset(flag, 0, sizeof(flag));\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        j = i + 1;\n        count = 0;\n        while (j < len) {\n          if (a[j] == '(')\n            count++;\n          else if (a[j] == ')') {\n            if (count == 0) {\n              flag[i] = 1;\n              flag[j] = 1;\n              break;\n            } else {\n              count--;\n            }\n          }\n          j++;\n        }\n        if (flag[i] == 0)\n          b[i] = '$';\n      } else if ((a[i] == ')') && (flag[i] == 0))\n        b[i] = '?';\n    }\n    cout << a << endl;\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar x[110] = {'\\0'}, y[110] = {'\\0'};\nint i, j, k, l;\nint f() {\n  for (i = 0; i < l - 1; i++) {\n    for (j = 1; i + j < l; j++) {\n      if (x[i] == '(' && x[i + j] == ' ') {\n        continue;\n      }\n      if (x[i] == '(' && x[i + j] == '(') {\n        break;\n      }\n      if (x[i] == '(' && x[i + j] == ')') {\n        x[i] = ' ';\n        x[i + j] = ' ';\n      }\n    }\n  }\n  k++;\n  if (k == l) {\n    return 0;\n  }\n  if (k != l) {\n    f();\n  }\n}\nint main() {\n  while (cin.getline(x, 110, '\\n')) {\n    strcpy(y, x);\n    l = strlen(x);\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(' && x[i] != ')') {\n        x[i] = ' ';\n      }\n    }\n    k = 0;\n    f();\n    cout << y << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == '(') {\n        cout << \"$\";\n      }\n      if (x[i] == ')') {\n        cout << \"?\";\n      }\n      if (x[i] == ' ') {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nint find(int x, int y) {\n  int b;\n  if (a[x] == '\\0')\n    return -1;\n  if (a[x] == '(') {\n    b = find(x + 1, y + 1);\n    a[x] = (b == -1) ? '$' : ' ';\n    return (b == -1) ? -1 : find(b + 1, y);\n  }\n  if (a[x] == ')') {\n    a[x] = (y == 0) ? '?' : ' ';\n    return (y == 0) ? find(x + 1, y) : x;\n  } else {\n    a[x] = ' ';\n    return find(x + 1, y);\n  }\n}\nint main() {\n  int n = 1000;\n  for (int i = 1; i < n; i++) {\n    cin.getline(a, 150);\n    if (a[0] == '\\0')\n      break;\n    else {\n      cout << a << \"\\n\";\n      find(0, 0);\n      cout << a << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  int st[100], sp;\n  int i, l, m, n, t;\n  while (1) {\n    for (i = 0; i <= 99; i++)\n      st[i] = 0;\n    sp = 0;\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    strcpy(b, a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        st[sp] = i;\n        break;\n      }\n    }\n    if (i == l)\n      ;\n    else {\n      for (sp = 1, i = st[0] + 1; i <= l - 1; i++) {\n        if (a[i] == '(')\n          st[sp++] = i;\n        else if (a[i] == ')') {\n          if (sp > 0) {\n            b[st[--sp]] = ' ';\n            b[i] = ' ';\n          }\n        }\n      }\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else if (b[i] == ' ')\n        ;\n      else\n        b[i] = ' ';\n    }\n    cout << a << \" \";\n    n = l - 1;\n    for (i = l - 1; i >= 0; i--) {\n      if (b[i] == ' ')\n        n = i - 1;\n      else\n        break;\n    }\n    m = 0;\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == ' ')\n        m = i + 1;\n      else\n        break;\n    }\n    t = 0;\n    for (i = m; i <= n; i++) {\n      cout << b[i];\n      t++;\n    }\n    printf(\" \");\n    a[0] = '\u0000';\n  }\n}\n"}
{"label": "17", "index": "30633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], label[101];\n  while (cin >> str) {\n\n    int pos[101];\n    int len = strlen(str);\n    int left = 0, right = 0;\n    int pos_i = -1;\n    int i;\n\n    for (i = 0; i <= len - 1; i++) {\n      label[i] = ' ';\n      if (str[i] == '(') {\n        left++;\n        pos[++pos_i] = i;\n      }\n      if (str[i] == ')') {\n        if (left <= right) {\n          label[i] = '?';\n        } else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++) {\n        label[pos[i]] = '$';\n      }\n    }\n    label[len] = '\\0';\n    cout << str << endl;\n    cout << label << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[200];\n  int leftpos, mark;\n  while (scanf(\"%s\", string) == 1) {\n    printf(\"%s\\n\", string);\n    leftpos = -1;\n    mark = 0;\n    while (mark != strlen(string)) {\n      if (string[mark] == '(')\n        leftpos = mark;\n      else if (string[mark] == ')' && leftpos != -1) {\n        string[mark] = ' ';\n        string[leftpos] = ' ';\n        mark = -1;\n        leftpos = -1;\n      }\n      mark++;\n    }\n    for (mark = 0; mark < strlen(string); mark++) {\n      if (string[mark] == '(')\n        string[mark] = '$';\n      else if (string[mark] == ')')\n        string[mark] = '?';\n      else\n        string[mark] = ' ';\n    }\n    cout << string << \"\\n\";\n    memset(string, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, left[102], len, j, k;\n  char *p = NULL;\n  char str[102];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    k = 0;\n    cin >> str;\n    cout << str << endl;\n    len = strlen(str);\n    p = str;\n    for (; p < str + len; p++) {\n      if (*p != '(' && *p != ')')\n        *p = ' ';\n    }\n    for (j = 0; j < len; j++) {\n      if (str[j] == '(') {\n        k++;\n        left[k] = j;\n      }\n      if (str[j] == ')') {\n        if (k == 0)\n          str[j] = '?';\n        else {\n          left[k] = -1;\n          k--;\n        }\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?')\n          cout << \" \";\n        else\n          printf(\"%c\", str[j]);\n      }\n      cout << endl;\n    } else {\n      for (; k > 0; k--)\n        str[left[k]] = '$';\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?' && str[j] != '$')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[102], b[102];\n  int len, i, left, leftNum[102];\n  while (scanf(\"%s \", a)) {\n    left = 0;\n    len = strlen(a);\n    for (i = 0; i < 102; i++)\n      b[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        left++;\n        leftNum[left] = i;\n      }\n      if (a[i] == ')')\n        if (left > 0) {\n          b[leftNum[left]] = ' ';\n          left--;\n        } else\n          b[i] = '?';\n    }\n    b[len] = '\\0';\n    cout << a << \"\\n\" << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[102], str2[102];\n  int i, j;\n  while (cin.getline(str1, 102)) {\n    strcpy(str2, str1);\n    int len = strlen(str1);\n    for (i = 0; i < len; i++) {\n      if (str2[i] != '(' && str2[i] != ')')\n        str2[i] = ' ';\n      else {\n        if (str2[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (str2[j] == '(') {\n              str2[j] = ' ';\n              str2[i] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", str1, str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[200];\n  int b[200];\n  int n, len;\n  cin >> n;\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    memset(b, 0, sizeof(b));\n    cin.getline(a, 200);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      cout << a[i];\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 3;\n        break;\n      }\n    }\n    printf(\"\\n\");\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 2) {\n        for (int j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[j] = 3, b[i] = 3;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 1) {\n        cout << '$';\n      } else {\n        if (b[i] == 2) {\n          cout << '?';\n        } else {\n          cout << ' ';\n        }\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0;\n\n  char s[101] = {0};\n  while (cin >> s) {\n    int a = 0, b = 0;\n    cout << s << endl;\n    int flag[101] = {0};\n    for (i = 0; i <= strlen(s) - 1; i++) {\n      if (s[i] == '(')\n        a++;\n      if (s[i] == ')') {\n        a--;\n        if (a < 0) {\n          a = 0;\n          flag[i] = -1;\n        }\n      }\n    }\n    for (i = strlen(s) - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        b++;\n      if (s[i] == '(') {\n        b--;\n        if (b < 0) {\n          b = 0;\n          flag[i] = 1;\n        }\n      }\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (flag[i] != 0)\n        break;\n    }\n    for (j = strlen(s) - 1; j >= 0; j--) {\n      if (flag[j] != 0)\n        break;\n    }\n    for (i = i; i <= j; i++) {\n      if (flag[i] == 1)\n        cout << \"$\";\n      else if (flag[i] == 0)\n        cout << \" \";\n      else if (flag[i] == -1)\n        cout << \"?\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30640", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, b, k, t, m, p;\n  char a[1000] = {0};\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    b = strlen(a);\n    for (m = 0; m < b; m++) {\n      if (a[m] != '(' && a[m] != ')') {\n        a[m] = ' ';\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (a[i] == ')') {\n        for (t = i; t >= 0; t--) {\n          if (a[t] == '(') {\n            a[i] = ' ';\n            a[t] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < b; k++) {\n      if (a[k] == '(')\n        a[k] = '$';\n      else if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char array[101], ans[101];\n  int len, i, left, right;\n\n  while (cin.getline(array, 101)) {\n    len = strlen(array);\n    left = 0;\n    right = 0;\n    for (i = 0; i < len; i++) {\n      ans[i] = ' ';\n      if (array[i] == '(') {\n        left++;\n      }\n      if (array[i] == ')') {\n        right++;\n        if (right > left) {\n          left = 0;\n          right = 0;\n          ans[i] = '?';\n        }\n      }\n    }\n    left = 0;\n    right = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (array[i] == '(') {\n        left++;\n        if (left > right) {\n          left = 0;\n          right = 0;\n          ans[i] = '$';\n        }\n      }\n      if (array[i] == ')') {\n        right++;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", array[i]);\n    }\n    cout << endl;\n    for (i = 0; i < len; i++) {\n      cout << ans[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30642", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nchar s[10000]; \nint countl, countr, sum[1000] = {0};\n\nint pipei(int i) {\n\n  if (s[i] == '\\0')\n    return sum[i] = 0;\n  if (s[i] == '(') {\n    ++countl;\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    if (sum[i] > 0)\n    \n    {\n      s[i] = ' ';\n      countl--;\n      countr--;\n      sum[i]--;\n    }\n    \n    else {\n      countl--;\n      s[i] = '$';\n    } \n    return 0;\n  }\n\n  else if (s[i] == ')') {\n    countr++;\n    sum[i]++;\n    if (countl >= countr) {\n      s[i] = ' '; \n      pipei(i + 1);\n      sum[i] += sum[i + 1]; \n      return 0;\n    } else {\n      countr--;\n      s[i] = '?';\n      pipei(i + 1);\n      sum[i] += sum[i + 1];\n      return 0;\n    }\n    \n  } else \n  {\n    s[i] = ' ';\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    return 0;\n  }\n  return 0;\n}\n\nint main() {\n  while (cin) \n  {\n    cin.getline(s, 1000); \n    cout << s << endl;\n    pipei(0);\n    cout << s << endl;\n    countl = countr = 0;\n    memset(sum, 0, sizeof(sum));\n    \n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid check() {\n  char array[103];\n  while (cin) {\n    cin.getline(array, 103);\n    int i, j, len;\n    len = strlen(array);\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    cout << endl;\n    for (i = 0; i < len; i++) {\n      if (array[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (array[j] == '(') {\n            array[j] = '1';\n            array[i] = '1';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (array[i] != '(' && array[i] != ')')\n        cout << ' ';\n      if (array[i] == '(') {\n        cout << '$';\n      }\n      if (array[i] == ')')\n        cout << '?';\n    }\n    cout << endl;\n  }\n  return;\n}\n\nint main() {\n  check();\n  return 0;\n}\n"}
{"label": "17", "index": "30644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar num2[110] = {'\\0'};\n\nint left(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == '(') {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == ')') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = left(num, point + 1, sum, l);\n    if (num[point] == '(' && k == 0) {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == '(' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == ')') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint right(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == ')') {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == '(') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = right(num, point - 1, sum, l);\n    if (num[point] == ')' && k == 0) {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == ')' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == '(') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint main() {\n  char num[110] = {'\\0'};\n  while (scanf(\"%s \", num)) {\n    int l = strlen(num);\n    cout << num << endl;\n    for (int i = 0; i < l; i++)\n      num2[i] = ' ';\n    num2[l] = '\\0';\n    left(num, 0, 0, l - 1);\n    right(num, l - 1, 0, 0);\n    cout << num2 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30645", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][110] = {0};\n  int i, j, k, n = 0;\n  for (i = 1; cin >> a[i]; i++) {\n    n++;\n  }\n  for (i = 1; i <= n; i++) {\n    char b[110];\n    for (k = 0; k <= 109; k++) {\n      b[k] = ' ';\n    }\n    int c[110] = {0};\n    int p = 0, q = 0, m = 0;\n    for (j = 0; j <= 109; j++) {\n      if (a[i][j] != 0)\n        m++;\n    }\n    for (j = 0; j <= m - 1; j++) {\n      if (a[i][j] == '(') {\n        p++;\n        b[j] = '$';\n      } else if (a[i][j] == ')') {\n        b[j] = '?';\n        if (p > 0) {\n          b[j] = ' ';\n          p--;\n          for (k = j - 1; k >= 0; k--) {\n            if ((b[k] == '$') && (c[k] == 0))\n              break;\n          }\n          b[k] = ' ';\n          c[k] = 1;\n        }\n      }\n    }\n    cout << a[i] << endl;\n    for (j = 0; j <= m - 2; j++) {\n      cout << b[j];\n    }\n    printf(\"%c\\n\", b[m - 1]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  while (1) {\n    char str1[100], str2[100];\n\n    scanf(\"%s \", str1);\n\n    if (feof(stdin))\n      break;\n\n    puts(str1);\n\n    int k, n = strlen(str1), left[100], right[100], l = 0, r = 0;\n    for (k = 0; k <= n - 1; k++) {\n      if (str1[k] == '(') {\n        left[l] = k;\n        l++;\n      } else if (str1[k] == ')') {\n        right[r] = k;\n        r++;\n      } else\n        str2[k] = ' ';\n    }\n    left[l] = 100;\n    right[r] = 100;\n    str2[n] = '\u0000';\n\n    int i, j, x = 1, y = 1;\n    for (i = l - 1; i >= 0; i--) {\n      int p = 0;\n      while (right[p] < left[i])\n        p++;\n      if (x > (r - p))\n        str2[left[i]] = '$';\n      else {\n        str2[left[i]] = ' ';\n        x++;\n      }\n    }\n    for (j = 0; j <= r - 1; j++) {\n      int q = 0;\n      while (left[q] < right[j])\n        q++;\n      if (y > q)\n        str2[right[j]] = '?';\n      else {\n        str2[right[j]] = ' ';\n        y++;\n      }\n    }\n\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int l, i, j, num1, num2;\n  while (cin >> a) {\n    num1 = 0;\n    num2 = 0;\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        num1++;\n      if (a[i] == ')') {\n        num2++;\n        if (num2 <= num1) {\n          a[i] = ' ';\n          for (j = i; j >= 0; j--)\n            if (a[j] == '(') {\n              a[j] = ' ';\n              break;\n            }\n        }\n        if (num2 > num1) {\n          a[i] = '?';\n          num2--;\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n    for (i = 0; i < l; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(char *a) {\n  int i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] == ')') {\n      a[i] = ' ';\n      a[0] = ' ';\n      return i;\n    } else if (a[i] == '(') {\n      a[i] = '$';\n      i += match(a + i);\n    } else\n      a[i] = ' ';\n    i++;\n  }\n  return i - 1;\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    cout << ch << endl;\n    int i = 0;\n    while (ch[i] != '\\0') {\n      if (ch[i] == '(') {\n        ch[i] = '$';\n        i += match(ch + i);\n      } else if (ch[i] == ')')\n        ch[i] = '?';\n      else\n        ch[i] = ' ';\n      i++;\n    }\n    printf(\"%s\\n\", ch);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[1000];\n  char outline[1000];\n  int i, j;\n  int len;\n  while (cin >> line) {\n    strcpy(outline, line);\n    len = strlen(line);\n    for (i = 0; i < len; i++) {\n      if (line[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[j] = ' ';\n            line[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << outline << endl;\n    for (i = 0; i < len; i++) {\n      if (line[i] == '(') {\n        printf(\"$\");\n      } else {\n        if (line[i] == ')') {\n          cout << '?';\n        } else {\n          cout << ' ';\n        }\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i, s, j = 0, c = 0, d = 0, l, m, n, k = 0, w;\n  char str[100];\n\n  for (;;) {\n\n    cin >> str;\n    if (feof(stdin))\n      break;\n    l = strlen(str);\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] == '(') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == ')' && b == 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a <= 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    a = 0;\n    b = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == ')') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == '(' && b == 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a <= 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    printf(\" \");\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30651", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, k = 0, x = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      b[i] = a[i];\n    for (i = 0; i < n; i++)\n      if (b[i] != '(' && b[i] != ')')\n        b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < n; k++) {\n        if (b[k] == ')') {\n          for (x = 0; x <= k; x++) {\n            if (b[k - x] == '(') {\n              b[k] = ' ';\n              b[k - x] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101] = {0};\n  while (scanf(\"%s\", s) != EOF) {\n    int i, j, l, t1, t2;\n    cout << s << \"\\n\";\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(') {\n        t1 = 1;\n        t2 = 0;\n        for (j = i + 1; j < l; j++) {\n          if (s[j] == '(')\n            t1++;\n          if (s[j] == ')')\n            t2++;\n          if (t1 == t2) {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30653", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Find(char *);\nint main() {\n  int i;\n  char str[101];\n  char mark[101];\n  while (cin.getline(str, 101)) {\n    memset(mark, 0, sizeof(mark));\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n        mark[i] = '$';\n      }\n      if (str[i] == ')') {\n        mark[i] = '?';\n      }\n      if (str[i] != '(' && str[i] != ')') {\n        mark[i] = ' ';\n      }\n    }\n    Find(mark);\n    for (i = strlen(mark) - 1; i >= 0; i--)\n      if (mark[i] != ' ') {\n        mark[i + 1] = 0;\n        break;\n      }\n    for (i = 0; i < strlen(mark); i++)\n      if (mark[i] != ' ') {\n        strcpy(mark, mark + i);\n        break;\n      }\n    cout << str << endl << mark << endl;\n  }\n  return 0;\n}\n\nvoid Find(char mark[]) {\n  int i, j = 0;\n  for (i = 0; i < strlen(mark); i++) {\n    if (mark[i] == '$') {\n      for (j = i + 1; j < strlen(mark); j++) {\n        if (mark[j] == '$')\n          break;\n        else {\n          if (mark[j] == '?') {\n            mark[j] = ' ';\n            mark[i] = ' ';\n            Find(mark);\n            return;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "30654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, flag, len, k, x;\n  int a[100], b[100];\n  char str[101], s[101];\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < 100; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    m = 0;\n    for (i = 0; str[i] != '\u0000'; i++) {\n      if (str[i] == ')') {\n        j = i;\n        x = 1;\n        while (j >= 0) {\n          if (str[j] == '(') {\n            for (k = 0; k < m; k++) {\n              if (a[k] == j)\n                x = 0;\n            }\n            if (x != 0) {\n\n              a[m] = j;\n              b[m] = i;\n              m++;\n              break;\n            }\n          }\n          j--;\n          x = 1;\n        }\n      }\n    }\n\n    strcpy(s, str);\n    flag = 1;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        for (j = 0; j < m; j++) {\n          if (i == a[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '$';\n      } else if (s[i] == ')') {\n        for (j = 0; j < m; j++) {\n          if (i == b[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n      flag = 1;\n    }\n    len = strlen(s);\n    for (j = len; j >= 0; j--) {\n      if ((s[j] == ' ') || (s[j] == '\u0000')) {\n        if (s[j - 1] != ' ') {\n          s[j] = '\u0000';\n          break;\n        }\n      }\n    }\n    printf(\"%s \", str);\n    j = 0;\n    while (s[j] == ' ')\n      j++;\n    for (i = j; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30655", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, p, j, k, s, l;\n  char a[110], b[110] = {' '};\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    scanf(\"%s \", a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        s += 1;\n        b[i] = ' ';\n        continue;\n      } else if (a[i] == ')') {\n        if (s > 0) {\n          s -= 1;\n          b[i] = ' ';\n          continue;\n\n        } else if (s == 0)\n          b[i] = '?';\n        continue;\n      } else\n        b[i] = ' ';\n      continue;\n    }\n    s = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        s += 1;\n        continue;\n      } else if (a[i] == '(') {\n        if (s > 0) {\n          s -= 1;\n          continue;\n\n        } else if (s == 0)\n          b[i] = '$';\n        continue;\n      }\n    }\n\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", b[j]);\n    }\n    cout << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30656", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char in[1000];\n  while (cin.getline(in, 1000, '\\n')) {\n\n    if (in[0] == '\\0')\n      break;\n    int len;\n    len = strlen(in);\n    int i, j, k;\n    int flag[100] = {0};\n    for (i = 0; i <= len - 1; i++) {\n      if (in[i] == '(') {\n        flag[i] = 2;\n      }\n      if (in[i] == ')') {\n        flag[i] = 3;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 1)\n        continue;\n      if (in[i] == '(') {\n        for (j = i + 1; j <= len - 1; j++) {\n          if (flag[j] == 1)\n            continue;\n          if (in[j] == ')') {\n            flag[j] = 1;\n            flag[i] = 1;\n          }\n          if (in[j] == ')')\n            break;\n        }\n      }\n    }\n    cout << in << endl;\n    int temp, t;\n    int num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        temp = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        t = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (j = 0; j <= len - 1; j++) {\n      if (flag[i] == 0 || flag[i] == 1) {\n        num++;\n      }\n    }\n    if (num < len) {\n\n      for (i = t; i <= temp; i++) {\n        if (flag[i] == 0 || flag[i] == 1) {\n          cout << \" \";\n        }\n        if (flag[i] == 2) {\n          cout << \"$\";\n        }\n        if (flag[i] == 3) {\n          cout << \"?\";\n        }\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30657", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint match(int i, int n, char str[]); \nint main()                           \n{\n  char str[101];\n  int n;\n  while (cin >> str) \n  {\n    cout << str << endl;\n    n = strlen(str);\n    match(0, n, str);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) \n{\n  if (i == n) \n    return 0;\n  else if (str[i] == ')') \n  {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n    match(i + 1, n, str);\n    return 0;\n  } else if (str[i] == '(') \n  {\n    str[i] = '$';\n    match(i + 1, n, str); \n    return 0;\n  } else {\n    str[i] = ' ';\n    match(i + 1, n, str);\n    return 0;\n  }\n}\n"}
{"label": "17", "index": "30658", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[200];\n  char b[200];\n  int c[200];\n  int len;\n  int k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    k = 0;\n    int j = 0;\n    for (j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n        c[k] = j;\n        k = k + 1;\n      } else if (a[j] == ')') {\n        if (j == 0) {\n          b[j] = '?';\n        } else {\n          if (k > 0 && b[c[k - 1]] == '$') {\n            b[c[k - 1]] = ' ';\n            b[j - 1] = ' ';\n            b[j] = ' ';\n            k = k - 1;\n          } else {\n            b[j] = '?';\n            c[k] = j;\n            k = k + 1;\n          }\n        }\n      } else\n        b[j] = ' ';\n    }\n    b[j] = '\\0';\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m;\n  char a[150], b[150];\n  for (m = 0; m < 1000; m++) {\n    for (i = 0; i < 150; i++)\n      a[i] = 0, b[i] = 0;\n    cin >> a;\n    l = strlen(a);\n    if (l == 0)\n      break;\n    for (i = 0; i < l; i++)\n      b[i] = a[i];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        if (a[j] == '(') {\n          for (k = j + 1; k < l; k++) {\n            if (a[k] == '(')\n              break;\n            if (a[k] == ')') {\n              a[j] = 'a', a[k] = 'a';\n              break;\n            }\n          }\n        }\n    printf(\"%s\\n\", b);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "30660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[110];\n  int note[110], l, r;\n  while (scanf(\"%s \", ch)) {\n    memset(note, 0, sizeof(note));\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (ch[i]) {\n      case '(': {\n        l = 0;\n        r = 0;\n        note[i] = 1;\n        for (int j = i; ch[j] != '\\0'; j++) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      case ')': {\n        l = 0;\n        r = 0;\n        note[i] = -1;\n        for (int j = i; j >= 0; j--) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      default:\n        break;\n      }\n    }\n    cout << ch << endl;\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (note[i]) {\n      case 1:\n        cout << \"$\";\n        break;\n      case -1:\n        cout << \"?\";\n        break;\n      case 0:\n        cout << \" \";\n        break;\n      default:\n        break;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101] = {0};\nint zuo[101] = {0};\nint n = 0;\nvoid change(int x) {\n  if (a[x] != 0) {\n    if (a[x] == '(') {\n      zuo[++n] = x;\n    } else if (a[x] == ')') {\n      if (n > 0) {\n        a[x] = ' ';\n        a[zuo[n--]] = ' ';\n      }\n    } else\n      a[x] = ' ';\n    change(x + 1);\n  }\n}\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    n = 0;\n    change(0);\n    for (int i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        cout << \"?\";\n      else\n        cout << a[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char l, r, s, sen[200], rem[200];\n  int i = 1, j = 1, k = 1, nsen, b = 1;\n  l = '(';\n  r = ')';\n\n  while (b == 1) {\n\n    while ((s = cin.get()) != '\\n') {\n      sen[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    nsen = i - 1;\n\n    for (j = 1; j < nsen; j++)\n      for (i = 1; i < nsen; i++)\n        if (sen[i] == l && sen[i + j] == r) {\n          sen[i] = ' ';\n          sen[i + j] = ' ';\n        }\n\n    for (i = 1; i <= nsen; i++)\n      if (sen[i] == l)\n        sen[i] = '$';\n      else if (sen[i] == r)\n        sen[i] = '?';\n      else\n        sen[i] = ' ';\n\n    for (i = 1; i <= nsen; i++)\n      printf(\"%c\", rem[i]);\n    cout << \"\\n\";\n    for (i = 1; i <= nsen; i++)\n      cout << sen[i];\n    cout << endl;\n\n    nsen = 0;\n    i = 1;\n    j = 1;\n    k = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30663", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar use[150], rem[150];\nint len;\nvoid rid(int begin, int end);\nint main() {\n  while (1) {\n    char s;\n    int i = 0;\n    while ((s = cin.get()) != '\\n') {\n      use[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    len = i - 1;\n    rid(0, len);\n    for (int j = 0; j <= len; j++)\n      if (use[j] == '(')\n        use[j] = '$';\n      else if (use[j] == ')')\n        use[j] = '?';\n      else {\n        if (use[j] != '?' && use[j] != '$')\n          use[j] = ' ';\n      }\n\n    for (i = 0; i <= len; i++)\n      printf(\"%c\", rem[i]);\n    printf(\"\\n\");\n    for (i = 0; i <= len; i++)\n      cout << use[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n\nvoid rid(int begin, int end) {\n  if (begin <= end) {\n    if (use[begin] != ')')\n      rid(begin + 1, end);\n    else {\n      int i = begin;\n      while (use[i] != '(' && i >= 0)\n        i--;\n      if (i == -1) {\n        use[begin] = '?';\n        rid(begin + 1, end);\n      } else\n        for (int j = i; j <= begin; j++) {\n          use[j] = ' ';\n          rid(begin + 1, end);\n        }\n    }\n  }\n}\n"}
{"label": "17", "index": "30664", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    int a[1000];\n    char s[1000];\n    scanf(\"%s\", s);\n    int l = strlen(s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < l; j++)\n      a[j] = 0;\n    for (j = l - 1; j >= 0; j--) {\n      int t;\n      if (s[j] == '(') {\n        int f = 0;\n        for (t = j + 1; t < l; t++) {\n          if (s[t] == ')' && a[t] == 0) {\n            f = 1;\n            a[t] = 1;\n            a[j] = 1;\n            break;\n          }\n        }\n        if (f == 0) {\n          s[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] == ')' && a[j] == 0) {\n        s[j] = '?';\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] != '?' && s[j] != '$')\n        s[j] = ' ';\n    }\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "30665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char c[100];\n  int a[100] = {0};\n  while (scanf(\"%s\", c) != EOF) {\n\n    if (c[0] == '\u0000')\n      break;\n    printf(\"%s \", c);\n    k = strlen(c);\n    for (i = 0; i <= k - 1; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == -1) {\n            a[j] = 2;\n            a[i] = 2;\n            break;\n          }\n      }\n\n      else\n        a[i] = 2;\n    }\n    if (c[0] == ')')\n      a[0] = 1;\n\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == 2)\n        cout << \" \";\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int l = 0, c[100] = {0}, m;\n\n    scanf(\"%s \", a);\n    if (a[0] == 0)\n      break;\n    for (int i = 0; i < 101; i++) {\n      if (a[i] != 0) {\n        if (a[i] == '(') {\n\n          c[i] = -1;\n          b[i] = '$';\n        } else if (a[i] == ')') {\n          int k = 0;\n          c[i] = 1;\n          b[i] = '?';\n        } else\n          b[i] = ' ';\n      } else {\n        l = i;\n        break;\n      }\n    }\n\n    cout << endl;\n    for (int i = 0; i < l; i++)\n      if (c[i] == -1)\n        for (int j = i, sum = 0; j < l; j++) {\n          sum = sum + c[j];\n\n          if (sum == 0) {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30667", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(char s[]) {\n  int i, j, k, l;\n  int n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != '(' && s[i] != ')')\n      s[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] == ')') {\n      l = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (s[j] == '(') {\n          s[j] = ' ';\n          s[i] = ' ';\n          l = 1;\n          break;\n        }\n      }\n      if (l == 0)\n        s[i] = '?';\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (s[i] != ' ' && s[i] != '?')\n      s[i] = '$';\n}\nint main() {\n  int n, i;\n  cin >> n;\n  char s[10000];\n\n  scanf(\"%s \", s);\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    f(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int l, i, j, num1, num2;\n  while (cin >> a) {\n    num1 = 0;\n    num2 = 0;\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        num1++;\n      if (a[i] == ')') {\n        num2++;\n        if (num2 <= num1) {\n          a[i] = ' ';\n          for (j = i; j >= 0; j--)\n            if (a[j] == '(') {\n              a[j] = ' ';\n              break;\n            }\n        }\n        if (num2 > num1) {\n          a[i] = '?';\n          num2--;\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105] = {0}, b[105] = {0}, c[105] = {0};\n  int len;\n  int i = 0, j = 0;\n  while (cin >> a) {\n\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      c[i] = a[i];\n    for (i = 0; i < len; i++) {\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[i] = '.';\n            c[j] = '.';\n            break;\n          }\n        }\n        if (j == -1)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        b[i] = '$';\n    }\n    printf(\"%s\\n\", a);\n    for (i = 0; i < len; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << ' ';\n      else\n        printf(\"%c\", b[i]);\n    }\n    cout << endl;\n    i = 0;\n    j = 0;\n    memset(a, 0, sizeof(a));\n    memset(b, 0, sizeof(b));\n    memset(c, 0, sizeof(c));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n  return;\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else {\n      s[i] = ' ';\n    }\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  int n;\n  cin >> n;\n  while (n--) {\n    cin >> live;\n    cout << live << endl;\n    Find(live);\n    cout << live << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30671", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar str[101], bracket[101];\nint len;\nvoid match(int a);\n\nint main() {\n  while (cin.getline(str, 101)) {\n    len = strlen(str);\n    for (int i = 0; i < len; i++)\n      if (str[i] == '(')\n        bracket[i] = '$';\n      else if (str[i] == ')')\n        bracket[i] = '?';\n      else\n        bracket[i] = ' ';\n    match(1);\n    for (int i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = 0; i < len; i++)\n      cout << bracket[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n\nvoid match(int a) {\n  if (a == len)\n    return;\n  int b = a - 1;\n  if (bracket[a] == '?') {\n    while (bracket[b] == ' ') {\n      if (b == 0) {\n        match(a + 1);\n        return;\n      }\n      b--;\n    }\n    if (bracket[b] == '?') {\n      match(a + 1);\n      return;\n    }\n    bracket[b] = ' ';\n    bracket[a] = ' ';\n    match(a + 1);\n  } else\n    match(a + 1);\n}\n"}
{"label": "17", "index": "30672", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char jiance[101], c;\n  int i, zifu, kuo2[100];\n  while (scanf(\"%s \", jiance)) {\n    cout << jiance << endl;\n    zifu = -1;\n    for (i = 0; jiance[i] != 0; i++) {\n      c = jiance[i];\n      jiance[i] = ' ';\n      if (c == '(') {\n        zifu++;\n        kuo2[zifu] = i;\n      } else if (c == ')') {\n        zifu--;\n        if (zifu < -1) {\n          jiance[i] = '?';\n          zifu = -1;\n        }\n      }\n    }\n    if (zifu > -1)\n      for (; zifu > -1; zifu--)\n        jiance[kuo2[zifu]] = '$';\n    cout << jiance << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], s;\n  int i, j, k, l, m, n, t, b[100], c[100];\n  for (;;) {\n\n    cin >> a;\n    if (a[0] == ' ')\n      break;\n    n = strlen(a);\n    for (i = 0, j = 0, k = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[j] = i;\n        j++;\n      } else if (a[i] == ')') {\n        c[k] = i;\n        k++;\n      }\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (l = j - 1; l >= 0; l--) {\n        if (b[l] == i) {\n          for (t = 0; t < k; t++) {\n            if (c[t] > i) {\n              b[l] = -1;\n              c[t] = -1;\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < n; i++) {\n      for (l = 0; l < j; l++) {\n        if (b[l] == i) {\n          printf(\"$\");\n          break;\n        }\n      }\n      if (l != j)\n        continue;\n      for (t = 0; t < k; t++) {\n        if (c[t] == i) {\n          printf(\"?\");\n          break;\n        }\n      }\n      if (t != k)\n        continue;\n      printf(\" \");\n    }\n\n    printf(\" \");\n    a[0] = ' ';\n  }\n}\n"}
{"label": "17", "index": "30674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint length;\nchar a[1000];\nchar c[100];\nint b[100];\nint zkh = 0;\nint match(int i) {\n  if (i == length)\n    return 0;\n  if (a[i] == '(') {\n    zkh = zkh + 1;\n    c[i] = '$';\n    b[zkh] = i;\n  }\n  if (a[i] == ')') {\n    if (zkh == 0) {\n      c[i] = '?';\n    }\n    if (zkh != 0) {\n      c[b[zkh]] = ' ';\n      zkh = zkh - 1;\n      c[i] = ' ';\n    }\n  }\n  if (a[i] != '(' && a[i] != ')') {\n    c[i] = ' ';\n  }\n  match(i + 1);\n}\n\nint main(int argc, const char *argv[]) {\n  int j, l;\n  while (cin.getline(a, 200)) {\n    zkh = 0;\n    length = strlen(a);\n    for (j = 0; j < length; j++) {\n      cout << a[j];\n    }\n    cout << endl;\n\n    match(0);\n\n    for (l = 0; l < length; l++) {\n      cout << c[l];\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "17", "index": "30675", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar str[100], s[100];\n\nvoid match(int x) {\n  int i;\n  for (i = x - 1; i >= 0; --i)\n    if (s[i] == '$') {\n      s[x] = ' ';\n      s[i] = ' ';\n      break;\n    }\n} \n\nint main() {\n  int i, l;\n  while (cin >> str) {\n    l = strlen(str);\n    s[l] = '\\0'; \n    for (i = 0; i < l; ++i)\n      s[i] = ' ';        \n    cout << str << endl; \n    for (i = 0; i < l; ++i)\n      switch (str[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        match(i);\n        break;\n      }                \n    cout << s << endl; \n  }\n  return 0; \n}\n"}
{"label": "17", "index": "30676", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[200];\n  int b[200];\n  int n, len;\n  cin >> n;\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    memset(b, 0, sizeof(b));\n    cin.getline(a, 200);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      cout << a[i];\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 3;\n        break;\n      }\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 2) {\n        for (int j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[j] = 3, b[i] = 3;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 1) {\n        cout << '$';\n      } else if (b[i] == 2) {\n        cout << '?';\n      } else {\n        cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30677", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101] = {0}, label[101] = {0};\n  int pos[101] = {0}, left, right, l, i, j, n;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%s \", line);\n    left = 0;\n    right = 0;\n    l = strlen(line);\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[l] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nint find(int x, int y) {\n  int b;\n  if (a[x] == '\\0')\n    return -1;\n  if (a[x] == '(') {\n    b = find(x + 1, y + 1);\n    a[x] = (b == -1) ? '$' : ' ';\n    return (b == -1) ? -1 : find(b + 1, y);\n  }\n  if (a[x] == ')') {\n    a[x] = (y == 0) ? '?' : ' ';\n    return (y == 0) ? find(x + 1, y) : x;\n  } else {\n    a[x] = ' ';\n    return find(x + 1, y);\n  }\n}\nint main() {\n  int n = 1000;\n  for (int i = 1; i < n; i++) {\n    cin.getline(a, 150);\n    if (a[0] == '\\0')\n      break;\n    else {\n      printf(\"%s\\n\", a);\n      find(0, 0);\n      cout << a << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[150] = {'0'}, b[150] = {'0'};\n  for (; ~scanf(\"%s\", &a);) {\n    i = strlen(a);\n    for (j = 0; j < i; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    for (j = 0; j < i; j++)\n      for (k = j - 1; k >= 0; k--) {\n        if (b[k] == '$' && b[j] == '?') {\n          b[k] = ' ';\n          b[j] = ' ';\n        }\n      }\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < i; k++)\n      printf(\"%c\", b[k]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101];\n  int i, a[101], j = 0, k;\n  while (scanf(\"%s\", c) != EOF) {\n    puts(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\\0')\n        break;\n      else {\n        if (c[i] == '(') {\n          j++;\n          a[j] = i;\n        } else if (c[i] == ')') {\n          if (j > 0) {\n            c[i] = ' ';\n            c[a[j]] = ' ';\n            j--;\n          }\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (c[k] == '(')\n        printf(\"$\");\n      else if (c[k] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    j = 0;\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "30681", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, flag, q;\n  char str[101], note[101];\n\n  while (scanf(\"%s\", str) != EOF) {\n    strcpy(note, str);\n\n    for (i = 0; i < strlen(note); i++) {\n      if ((note[i] >= 'a' && note[i] <= 'z') ||\n          (note[i] >= 'A' && note[i] <= 'Z'))\n        note[i] = ' ';\n    }\n\n    for (i = 0; i < strlen(note); i++) {\n      flag = 0;\n      if (note[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (note[j] == '(') {\n            flag = 1;\n            note[j] = ' ';\n            note[i] = ' ';\n            break;\n          }\n        }\n        if (flag == 0)\n          note[i] = '?';\n      }\n    }\n\n    for (i = 0; i < strlen(note); i++) {\n      if (note[i] == '(')\n        note[i] = '$';\n    }\n\n    puts(str);\n    puts(note);\n  }\n\n  scanf(\"%d\", &q);\n  return 0;\n}\n"}
{"label": "17", "index": "30682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    cout << b[i] << \"\\n\";\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++) {\n    num[m]++;\n  }\n  return 0;\n}\nint cur = 0, flag = 0;\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30683", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char c[100];\n  int l;\n\n  while (cin >> c) {\n    int a[100] = {0};\n    int left = 0;\n\n    l = strlen(c);\n\n    for (int i = 0; i < l; i++) {\n\n      if (left == 0 && c[i] == ')')\n        a[i] = 1;\n\n      if (c[i] == '(')\n        left++;\n\n      if (c[i] == ')' && left > 0) {\n        left--;\n\n        for (int j = i; j >= 0; j--) {\n          if ((c[j] == '(') && (a[j] != 2)) {\n            a[j] = 2;\n            break;\n          }\n        }\n      }\n    }\n\n    int count = 0;\n\n    if (left != 0)\n      for (int i = l; count < left; i--) {\n        if (c[i] == '(' && a[i] != 2) {\n          a[i] = -1;\n          count++;\n        }\n      }\n\n    for (int i = 0; i < l; i++)\n      cout << c[i];\n\n    cout << endl;\n\n    for (int i = 0; i < l; i++) {\n      if (a[i] == 0 || a[i] == 2)\n        cout << \" \";\n      else if (a[i] == 1)\n        cout << '?';\n      else if (a[i] == -1)\n        cout << '$';\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30684", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  while (cin.getline(a, 110, '\\n')) {\n    int left = 0, right = 0, tema = 0;\n    int b[110] = {0};\n    char d[110] = {'\\0'};\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << a[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      d[i - 1] = ' ';\n      if (a[i - 1] == '(') {\n        left++;\n        b[tema++] = i - 1;\n      } else if (a[i - 1] == ')') {\n        if (left <= right) {\n          d[i - 1] = '?';\n        }\n        if (left > right) {\n          right++;\n          tema--;\n        }\n      }\n    }\n    for (int k = 1; k <= tema; k++) {\n      d[b[k - 1]] = '$';\n    }\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      printf(\"%c\", d[i - 1]);\n    }\n    cout << endl;\n    for (int i = 1; i <= 100; i++) {\n      a[i - 1] == '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30685", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m = 0, l, t;\nchar b[100];\nvoid ff(int x) {\n  m = x;\n  for (int j = x + 1; j < l; j++) {\n    if (b[j] == '(') {\n      ff(j);\n      break;\n    }\n    if (b[j] == ')') {\n      b[m] = ' ';\n      b[j] = ' ';\n      t = 1;\n      break;\n    }\n  }\n  return;\n}\nvoid f(int x) {\n  m = 0;\n  t = 0;\n  for (int i = 0; i < x; i++) {\n    if (b[i] != '(' && b[i] != ')')\n      b[i] = ' ';\n    if (b[i] == '(') {\n      ff(i);\n      break;\n    }\n  }\n  if (t == 1) {\n    f(x);\n    return;\n  } else {\n    for (int i = 0; i < x; i++) {\n      if (b[i] == '(')\n        cout << \"$\";\n      else if (b[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    return;\n  }\n}\nint main() {\n  int k, h;\n  for (h = 0; h < 10; h++) {\n    l = 0;\n    cin >> b;\n    cout << b << endl;\n    l = strlen(b);\n    f(l);\n    cout << endl;\n    for (k = 0; k < 100; k++)\n      b[k] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[200], i, j;\n  char a[200];\n  while (cin >> a) {\n    memset(b, 0, sizeof(b));\n\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(')\n        b[i] = 1;\n      if (a[i] == ')') {\n        b[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(' && b[i] == 1)\n        printf(\"$\");\n      else {\n        if (a[i] == ')' && b[i] == 1)\n          printf(\"?\");\n        else\n          printf(\" \");\n      }\n    }\n    printf(\" \");\n\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int num, i, j, k, l, len[20];\n  char a[20][101], b[50][101] = {' '};\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n  }\n  \n\n  for (k = 1; k <= num; k++) {\n    for (i = 0; i < len[k]; i++) {\n      if (a[k][i] == '(')\n        b[k][i] = '$';\n      else if (a[k][i] == ')')\n        b[k][i] = '?';\n      else\n        b[k][i] = ' ';\n    }\n    for (i = 0; i < len[k] - 1; i++) {\n      if (b[k][i] == '$') {\n        for (j = i + 1; j < len[k]; j++) {\n          if (b[k][j] == '?') {\n            for (l = j - 1; l >= i; l--) {\n              if (b[k][l] == '$') {\n                b[k][l] = ' ';\n                b[k][j] = ' ';\n                break;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", a[k][i]);\n    printf(\" \");\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30688", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][105] = {'\\0'}, a;\n  int i, j, count, cleft, cright;\n  i = j = 0;\n  while ((a = cin.get()) != EOF) {\n    if (a != '\\n') {\n      s[i][j] = a;\n      j++;\n    } else if (a == '\\n') {\n      i++;\n      j = 0;\n    }\n  }\n  count = i;\n  cleft = cright = 0;\n  for (i = 0; i < count; i++) {\n    cout << s[i] << endl;\n    for (j = 0; j < strlen(s[i]); j++) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright > cleft) {\n        s[i][j] = '?';\n        cright -= 1;\n      }\n    }\n    cleft = cright = 0;\n    for (j = strlen(s[i]) - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright < cleft) {\n        s[i][j] = '$';\n        cleft -= 1;\n      }\n    }\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] != '?' && s[i][j] != '$')\n        s[i][j] = ' ';\n    if (i == count - 1)\n      cout << s[i];\n    else\n      cout << s[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30689", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char zfc[120], cha, i, j, len;\n  while (scanf(\"%s\", zfc) != EOF) {\n    cha = 0;\n    len = strlen(zfc);\n    printf(\"%s\\n\", zfc);\n    for (i = 0; i < len; i++) {\n      if (zfc[i] != '(' && zfc[i] != ')') {\n        zfc[i] = ' ';\n      }\n      if (zfc[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            zfc[j] = ' ';\n            zfc[i] = ' ';\n            break;\n          }\n        }\n        if (j < 0) {\n          zfc[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (zfc[i] == '(') {\n        zfc[i] = '$';\n      }\n    }\n    puts(zfc);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][110], c, h;\n  int i, j, k, t[100] = {0}, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (j = 0; j < t[i]; j++) {\n      if ((a[i][j] >= 'a' && a[i][j] <= 'z') ||\n          (a[i][j] >= 'A' && a[i][j] <= 'Z'))\n        a[i][j] = ' ';\n    }\n    for (j = 0; j < t[i] - 1; j++) {\n      if (a[i][j] == '(') {\n        for (k = j + 1; k < t[i]; k++) {\n          if (a[i][k] == ')') {\n            a[i][j] = ' ';\n            a[i][k] = ' ';\n            j = -1;\n            break;\n          }\n          if (a[i][k] == '(') {\n            j = k - 1;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    for (j = 0; j < t[i]; j++) {\n      if (a[i][j] == ' ')\n        cout << a[i][j];\n      if (a[i][j] == '(')\n        cout << '$';\n      if (a[i][j] == ')')\n        cout << '?';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[101], t, n, i, j;\n  char a[101];\n  while (cin >> a) {\n    for (i = 0; i < 101; i++)\n      b[i] = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        t = -1;\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '(') {\n            t--;\n          }\n          if (a[j] == ')') {\n            t++;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 1;\n      }\n      if (a[i] == ')') {\n        t = -1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(')\n            t++;\n\n          if (a[j] == ')') {\n            t--;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 2;\n      }\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      if (b[i] == 1)\n        printf(\"$\");\n      if (b[i] == 2)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30692", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid findr(int left) {\n  for (int i = left + 1; s[i] != '\\0'; i++) {\n    if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n      s[i] = ' ';\n    if (s[i] == '(')\n      findr(i);\n    if (s[i] == ')') {\n      s[i] = ' ';\n      s[left] = ' ';\n      return;\n    }\n  }\n  s[left] = '$';\n}\n\nint main() {\n  while (cin >> s) {\n    cout << s << endl;\n    for (int i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n        s[i] = ' ';\n      if (s[i] == '(')\n        findr(i);\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30693", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  while (n > 0) {\n    char s[104], start = 0;\n    int len = 0;\n\n    cin >> s;\n    puts(s);\n    len = strlen(s);\n    int j;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        for (j = i; j < len; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30694", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, flag = 0;\n  char s[1000] = {\"\"};\n  cin >> s;\n  while ((s[0] >= 'a' && s[0] <= 'z') || (s[0] >= 'A' && s[0] <= 'Z') ||\n         s[0] == '(' || s[0] == ')') {\n\n    printf(\"%s \", s);\n    n = strlen(s);\n    for (i = n - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (s[j] == ')') {\n            s[i] = 'a';\n            s[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(' || s[i] == ')') {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      for (i = 0; i < n; i++)\n        printf(\"%c\", ' ');\n      printf(\" \");\n    } else {\n      for (i = 0; i < n; i++) {\n        if (s[i] == '(')\n          printf(\"%c\", '$');\n        else if (s[i] == ')')\n          printf(\"%c\", '?');\n        else\n          printf(\"%c\", ' ');\n      }\n      printf(\" \");\n    }\n    s[0] = '\u0000';\n    scanf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30695", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char st[101];\n  int g[101];\n  int len, i, j, left;\n  while (scanf(\"%s\", st) != EOF) {\n    printf(\"%s\\n\", st);\n    len = strlen(st);\n    left = 0;\n    for (i = 0; i < len; i++) {\n      if (st[i] == '(') {\n        left++;\n        g[left] = i;\n      }\n    }\n    for (i = left; i > 0; i--) {\n      for (j = g[i] + 1; j < len; j++)\n        if (st[j] == ')') {\n          st[g[i]] = ' ';\n          st[j] = ' ';\n          break;\n        }\n    }\n    for (i = 0; i < len; i++) {\n      if (st[i] == ')')\n        printf(\"?\");\n      else if (st[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30696", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[110];\n  char b[110];\n  char c[110];\n  while (cin >> a) {\n    strcpy(b, a);\n    strcpy(c, a);\n    int i, j;\n    int n = strlen(a);\n    int ju = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[j] = 99;\n            b[i] = b[j] = 32;\n            break;\n          }\n        }\n        if (j == n) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 32 && b[i] != ')' && b[i] != '$')\n        b[i] = 32;\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    printf(\"%s \", c);\n    printf(\"%s \", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30697", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, i, j;\n  char str[101], str1[101];\n  scanf(\"%d \", &n);\n  for (m = 0; m < n; m++) {\n\n    cin >> str;\n    puts(str);\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == ')')\n        for (j = i; j >= 0; j--)\n          if (str[j] == '(') {\n            str[j] = '0';\n            str[i] = '0';\n            break;\n          }\n    }\n\n    printf(\" \");\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      if (str[i] == ')')\n        printf(\"?\");\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i);\nchar str[101];\nint n;\nint main() {\n  while (scanf(\"%s \", str)) {\n    printf(\"%s\\n\", str);\n    n = strlen(str);\n    match(0);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(')\n    str[i] = '$';\n  else\n    str[i] = ' ';\n\n  match(i + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "30699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][110] = {0};\n  int i, j, k, n = 0;\n  for (i = 1; cin >> a[i]; i++) {\n    n++;\n  }\n  for (i = 1; i <= n; i++) {\n    char b[110];\n    for (k = 0; k <= 109; k++) {\n      b[k] = ' ';\n    }\n    int c[110] = {0};\n    int p = 0, m = 0;\n    for (j = 0; j <= 109; j++) {\n      if (a[i][j] != 0)\n        m++;\n    }\n    for (j = 0; j <= m - 1; j++) {\n      if (a[i][j] == '(') {\n        p++;\n        b[j] = '$';\n      } else if (a[i][j] == ')') {\n        b[j] = '?';\n        if (p > 0) {\n          b[j] = ' ';\n          p--;\n          for (k = j - 1; k >= 0; k--) {\n            if ((b[k] == '$') && (c[k] == 0))\n              break;\n          }\n          b[k] = ' ';\n          c[k] = 1;\n        }\n      }\n    }\n    cout << a[i] << endl;\n    for (j = 0; j <= m - 2; j++) {\n      cout << b[j];\n    }\n    printf(\"%c\\n\", b[m - 1]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30700", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str1[101], str2[101];             \n  int i, figure = 0, temp[100];          \n  while (cin >> str1) {                  \n    memset(str2, ' ', sizeof(str2));     \n    for (i = 0; i < strlen(str1); i++) { \n      if (str1[i] == '(') {\n        str2[i] = '$';      \n        temp[figure++] = i; \n      }\n      if (str1[i] == ')') {             \n        if (figure > 0) {               \n          str2[temp[figure - 1]] = ' '; \n          figure--;                     \n        } else {\n          str2[i] = '?'; \n        }\n      }\n    }\n    for (i = 0; i < strlen(str1) - 1; i++) \n      cout << str1[i];\n    cout << str1[strlen(str1) - 1] << endl;\n    for (i = 0; i < strlen(str1) - 1; i++) \n      cout << str2[i];\n    cout << str2[strlen(str1) - 1] << endl;\n    figure = 0;\n    memset(str1, ' ', sizeof(str1)); \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[1000];\n\nint findri(int x, int y) {\n  int p;\n  if (s[x] == '\\0')\n    return -1;\n  if (s[x] == '(') {\n    p = findri(x + 1, y + 1);\n    if (p == -1) {\n      s[x] = '$';\n      return -1;\n    } else {\n      s[x] = ' ';\n      return findri(p + 1, y);\n    }\n  } else if (s[x] == ')') {\n    if (y == 0) {\n      s[x] = '?';\n      return findri(x + 1, y);\n    } else {\n      s[x] = ' ';\n      return x;\n    }\n\n  } else {\n    s[x] = ' ';\n    return findri(x + 1, y);\n  }\n}\n\nint main() {\n  int len;\n  int i;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", s[i]);\n    cout << '\\n';\n    findri(0, 0);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", s[i]);\n    cout << '\\n';\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, t, k;\n  char a[101], c[101];\n  scanf(\"%d\", &t);\n  getchar();\n  for (k = 0; k < t; k++) {\n\n    cin >> a;\n    int l = strlen(a);\n    c[l] = '\u0000';\n    for (j = 0; j < l; j++) {\n      c[j] = a[j];\n      if (a[j] == '(')\n        m++;\n      if (a[j] != '(' && a[j] != ')')\n        c[j] = ' ';\n    }\n    puts(a);\n    for (i = 0; i < m + 1; i++) {\n      char x = ')';\n      int y = -1;\n      for (j = 0; j < l; j++) {\n        if (c[j] == '(' || c[j] == ')') {\n          if (c[j] == '(') {\n          } else {\n            if (x == '(') {\n              c[j] = ' ';\n              c[y] = ' ';\n            }\n          }\n          y = j;\n          x = c[j];\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101] = {'\\0'};\n  while ((scanf(\"%s\", a)) != -1) {\n    cout << a << \"\\n\";\n    int b, c, d;\n    for (b = 0; b < 100; b++) {\n      if (a[b] == ')') {\n        for (c = b - 1; c >= 0; c--) {\n          if (a[c] == '(') {\n            a[c] = 'a';\n            a[b] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (d = 0; d < 100; d++) {\n      if (a[d] == ')')\n        printf(\"?\");\n      else if (a[d] == '(')\n        printf(\"$\");\n      else if (a[d] != '\\0')\n        printf(\" \");\n      a[d] = '\\0';\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30704", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char *s) {\n  int a[100], i, j = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      a[j] = i;\n      j++;\n    } else if (s[i] == ')') {\n      if (j > 0) {\n        s[i] = ' ';\n        s[a[j - 1]] = ' ';\n        j--;\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\n\nint main() {\n  int n, i;\n  char s[101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    match(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30705", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint lenth, b[200];\nchar a[200];\nvoid match(int n) \n{\n  for (int i = n - 1; i >= 0; i--)\n    if (b[i] == 1) {\n      b[i] = 0;\n      b[n] = 0;\n      break;\n    }\n}\nint main() {\n  while (cin.getline(a, 105)) {\n    for (int i = 0; i < strlen(a); i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 0;\n      }\n    } \n    for (int i = 0; i < strlen(a); i++) {\n      if (b[i] == 2)\n        match(i);\n    } \n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      switch (b[i]) {\n      case 0:\n        cout << ' ';\n        break;\n      case 1:\n        cout << '$';\n        break;\n      case 2:\n        cout << '?';\n        break;\n      } \n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string1[101];\n  while (cin.getline(string1, 101)) {\n\n    printf(\"%s\\n\", string1);\n\n    for (int i = 1; i < strlen(string1); i++) {\n      if (string1[i] == ')') {\n\n        for (int j = i - 1; j >= 0; j--) {\n          if (string1[j] == '(') {\n            string1[i] = ' ';\n            string1[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int k = 0; k < strlen(string1); k++) {\n      if (string1[k] == '(')\n        cout << \"$\";\n      else if (string1[k] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int i = 0, j = 0;\n  while (cin.getline(str, 110)) {\n    for (i = 0; str[i] != '\\0'; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; ++i) {\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (str[j] == '(') {\n            str[i] = str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(str); ++i) {\n      if (str[i] == '(')\n        cout << \"$\";\n      else if (str[i] == ')')\n        cout << \"?\";\n      else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int left[100] = {0}, right[100] = {0}; \n  while (cin >> line) {\n    int i, k1 = 0, k2 = 0;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '(') {\n        left[k1] = i;\n        k1++;\n      } \n      if (line[i] == ')') {\n        if (k1 != 0) {\n          left[k1 - 1] = 0;\n          k1--;\n        } \n        else {\n          right[k2] = i;\n          k2++;\n        }\n      }\n    }\n    char ans[101];\n    for (i = 0; i < strlen(line); i++)\n      ans[i] = ' ';\n    ans[strlen(line)] = '\\0'; \n    for (i = 0; i < k1; i++) {\n      ans[left[i]] = '$';\n    }\n    for (i = 0; i < k2; i++) {\n      ans[right[i]] = '?';\n    } \n    cout << line << endl;\n    cout << ans << endl; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30709", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char chn[120];\n  int i, l;\n  int z, t;\n  char a, b;\n  while (scanf(\"%s\", chn) != -1) {\n    l = strlen(chn);\n    printf(\"%s\\n\", chn);\n    while (1) {\n      z = -1;\n      t = 0;\n      for (i = 0; i < l; i++) {\n        if (z == -1 && chn[i] == '(')\n          z = i;\n        else if (z >= 0 && chn[i] == ')') {\n          chn[z] = ' ';\n          chn[i] = ' ';\n          t++;\n          break;\n        } else if (z >= 0 && chn[i] == '(')\n          z = i;\n      }\n      if (!t) {\n        break;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (chn[i] == '(')\n        chn[i] = '$';\n      else if (chn[i] == ')')\n        chn[i] = '?';\n      else\n        chn[i] = ' ';\n      printf(\"%c\", chn[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000], temp[1000];\n  int b[1000];\n  int i, n = 0, m = 0, len, j;\n  memset(temp, 2, sizeof(temp));\n  while (1) {\n    m = 0;\n    n = 0;\n    cin >> s;\n    if (strcmp(temp, s) == 0)\n      break;\n    else\n      strcpy(temp, s);\n    memset(b, 0, sizeof(b));\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        n++;\n      else if (s[i] == ')' && n > 0) {\n        n--;\n        b[i] = 1;\n      }\n    }\n    for (j = len - 1; j >= 0; j--) {\n      if (s[j] == ')')\n        m++;\n      else if (s[j] == '(' && m > 0) {\n        m--;\n        b[j] = 1;\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == 0 && s[i] == ')')\n        printf(\"?\");\n      else if (b[i] == 0 && s[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n  int pp = 2;\n  int ww = 0;\n  for (int pa = 10; pa <= pp + 9; pa++) {\n    for (int i = 1; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    if (a[1] == '(' && a[2] == ')' && ww == 0) {\n      pa = pa - 4;\n      ww = 1;\n    }\n    if (a[1] == '(' && a[3] == ')' && ww == 0) {\n      pa = pa - 3;\n      ww = 1;\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        cout << \" \";\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30712", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ans[101], a[101];\n  int n;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n\n    scanf(\"%s \", a);\n    int ll = strlen(a);\n    int bb[101] = {0};\n    int be;\n    be = -1;\n    int i = 0;\n    while (i < ll) {\n      while (a[i] != '(' && a[i] != ')') {\n        ans[i] = ' ';\n        i++;\n        if (i >= ll)\n          break;\n      }\n      if (a[i] == '(') {\n        bb[i + 1] = be;\n        be = i + 1;\n      }\n      if (a[i] == ')') {\n        if (be < 0)\n          ans[i] = '?';\n        else {\n          int t;\n          t = bb[be];\n          bb[be] = 0;\n          be = t;\n          ans[i] = ' ';\n        }\n      }\n      i++;\n    }\n    for (i = 0; i < ll; i++) {\n      if (a[i] == '(') {\n        if (bb[i + 1] == 0)\n          ans[i] = ' ';\n        else\n          ans[i] = '$';\n      }\n    }\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", ans[i]);\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30713", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    printf(\"%s\\n\", a[i]);\n    cout << b[i] << endl;\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n  int pp = 2;\n  int ww = 0;\n  for (int pa = 10; pa <= pp + 9; pa++) {\n    for (int i = 1; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    if (a[1] == '(' && a[2] == ')' && ww == 0) {\n      pa = pa - 4;\n      ww = 1;\n    }\n    if (a[1] == '(' && a[3] == ')' && ww == 0) {\n      pa = pa - 3;\n      ww = 1;\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        cout << \" \";\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100] = {0}, d[100] = {0};\n  int l, i, j, s;\n  while (scanf(\"%s\", c) != EOF) {\n    l = strlen(c);\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        d[i] = '$';\n      else if (c[i] == ')') {\n        d[i] = '?';\n        for (j = i - 1, s = 1; j >= 0 && s == 1; j--) {\n          if (d[j] == '$') {\n            d[j] = d[i] = ' ';\n            s = 0;\n          }\n        }\n      } else\n        d[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      printf(\"%c\", c[i]);\n\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      printf(\"%c\", d[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30716", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int i = 0, j = 0;\n  while (cin.getline(str, 110)) {\n    for (i = 0; str[i] != '\\0'; i++) {\n      cout << str[i];\n    }\n    printf(\"\\n\");\n    for (i = 0; str[i] != '\\0'; ++i) {\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (str[j] == '(') {\n            str[i] = str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(str); ++i) {\n      if (str[i] == '(')\n        cout << \"$\";\n      else if (str[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint pp[120];\nvoid kuohao(char a[]) {\n\n  int i, j, len = strlen(a);\n  for (i = 0; i <= len - 1; i++) {\n    if (a[i] == ')') {\n      for (j = i; j >= 0; j--) {\n        if (a[j] == '(') {\n          pp[i] = 0;\n          pp[j] = 0;\n          a[i] = 'a';\n          a[j] = 'a';\n          break;\n        }\n        if (j == 0)\n          pp[i] = 1;\n      }\n      a[i] = 'a';\n      kuohao(a);\n    }\n    if (i == len - 1) {\n      for (j = 0; j <= len - 1; j++)\n        if (a[j] == '(')\n          pp[j] = -1;\n      return;\n    }\n  }\n}\n\nint main() {\n  char str[200];\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    int i;\n    for (i = 0; i <= 119; i++)\n      pp[i] = 0;\n    kuohao(str);\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (pp[i] == 0)\n        cout << \" \";\n      else if (pp[i] == 1)\n        cout << \"?\";\n      else\n        cout << \"$\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30718", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint m = 0, l, t;\nchar b[100];\nvoid ff(int x) {\n  m = x;\n  for (int j = x + 1; j < l; j++) {\n    if (b[j] == '(') {\n      ff(j);\n      break;\n    }\n    if (b[j] == ')') {\n      b[m] = ' ';\n      b[j] = ' ';\n      t = 1;\n      break;\n    }\n  }\n  return;\n}\nvoid f(int x) {\n  m = 0;\n  t = 0;\n  for (int i = 0; i < x; i++) {\n    if (b[i] != '(' && b[i] != ')')\n      b[i] = ' ';\n    if (b[i] == '(') {\n      ff(i);\n      break;\n    }\n  }\n  if (t == 1) {\n    f(x);\n    return;\n  } else {\n    for (int i = 0; i < x; i++) {\n      if (b[i] == '(')\n        cout << \"$\";\n      else if (b[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    return;\n  }\n}\nint main() {\n  int k, h;\n  for (h = 0; h < 10; h++) {\n    l = 0;\n    cin >> b;\n    cout << b << endl;\n    l = strlen(b);\n    f(l);\n    cout << endl;\n    for (k = 0; k < 100; k++)\n      b[k] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid kuohao(char c[]) {\n  int i, j, n;\n  for (n = 0; c[n] != '\\0'; n++)\n    ;\n  for (i = n - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      for (j = i + 1; c[j] != '\\0'; j++)\n        if (c[j] == ')') {\n          c[i] = c[j] = ' ';\n          break;\n        }\n      if (c[j] == '\\0') {\n        c[i] = '$';\n      }\n      kuohao(c);\n    }\n  }\n}\n\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' ';\n    kuohao(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?';\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30720", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pro(char *s) {\n  char a[444];\n  char *p;\n  int i, j, k, t;\n  i = -1;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(') {\n      i++;\n      a[i] = *p;\n    } else if (*p == ')') {\n      j = i;\n      while ((j >= 0) && (a[j] != '('))\n        j--;\n      if (j == -1) {\n        i++;\n        a[i] = *p;\n      } else {\n        a[j] = ' ';\n        i++;\n        a[i] = ' ';\n      }\n    } else {\n      i++;\n      a[i] = ' ';\n    }\n    p++;\n  }\n\n  a[i + 1] = '\u0000';\n  strcpy(s, a);\n}\n\nvoid print(char *s) {\n  char *p;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(')\n      *p = '$';\n    else if (*p == ')')\n      *p = '?';\n    p++;\n  }\n  puts(s);\n}\nint main() {\n  int l;\n  char s[323];\n\n  scanf(\"%s \", s);\n  while (s[0] != '\u0000') {\n\n    puts(s);\n    pro(s);\n    print(s);\n    s[0] = '\u0000';\n\n    scanf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30721", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar input[150], output[150];\nint main() {\n  int n, j;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%s\", input);\n    memset(output, 0, sizeof(output));\n    int count1 = 0, count2 = 0;\n    int i;\n    for (i = 0; i < strlen(input); ++i) {\n      output[i] = ' ';\n      if (input[i] == ')') {\n        if (count1 <= 0)\n          output[i] = '?';\n        else\n          count1--;\n      } else if (input[i] == '(')\n        count1++;\n    }\n    for (i = strlen(input); i >= 0; --i) {\n      if (input[i] == '(') {\n        if (count2 <= 0)\n          output[i] = '$';\n        else\n          count2--;\n      } else if (input[i] == ')')\n        count2++;\n    }\n    printf(\"%s\\n%s\\n\", input, output);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30722", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], s1[200];\n  int i, j;\n  int len;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    strcpy(s1, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(') {\n            break;\n          }\n        }\n        if (j >= 0) {\n          s[i] = ' ';\n          s[j] = ' ';\n        } else {\n          s[i] = '?';\n        }\n\n      } else if (s[i] != '(') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n    }\n    puts(s1);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30723", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[102], b[102];\n  int len, i, left, leftNum[102];\n  while (scanf(\"%s \", a)) {\n    left = 0;\n    len = strlen(a);\n    for (i = 0; i < 102; i++)\n      b[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        left++;\n        leftNum[left] = i;\n      }\n      if (a[i] == ')')\n        if (left > 0) {\n          b[leftNum[left]] = ' ';\n          left--;\n        } else\n          b[i] = '?';\n    }\n    b[len] = '\\0';\n    printf(\"%s\\n%s\\n\", a, b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    char s[101];\n    scanf(\"%s\", s);\n    int left[101] = {0}, right[101] = {0}, i, l = 0, r = 0;\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(') {\n        left[l++] = i + 1;\n      } else {\n        if (s[i] == ')') {\n          if (l != 0) {\n            l--;\n            left[l] = 0;\n          } else {\n            right[r++] = i + 1;\n          }\n        }\n      }\n    }\n    int le = 0, ri = 0;\n    printf(\"%s\\n\", s);\n    for (i = 0; i < strlen(s); i++) {\n      if (left[le] == i + 1) {\n        printf(\"$\");\n        le++;\n      } else {\n        if (right[ri] == i + 1) {\n          printf(\"?\");\n          ri++;\n        } else {\n          cout << \" \";\n        }\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  char str1[120];\n  char str[120];\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    memset(str, '\\0', sizeof(str));\n    cin >> str1;\n    strcpy(str, str1);\n\n    for (int len = 1; len < strlen(str); len++) {\n      for (int j = 0; j < strlen(str) - len; j++) {\n        int k = j + len;\n        if (str[j] == '(' && str[k] == ')') {\n          str[j] = '0';\n          str[k] = '0';\n        }\n      }\n    }\n\n    for (int i1 = 0; str[i1] != '\\0'; i1++) {\n      if (str[i1] == '(')\n        str[i1] = '$';\n      else if (str[i1] == ')')\n        str[i1] = '?';\n      else\n        str[i1] = ' ';\n    }\n    cout << str1 << endl;\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101] = {\"0\"};\n  int i, j, len, zuo, you, a[100];\n  while (scanf(\"%s\", str) != EOF) {\n    len = strlen(str);\n    for (i = 0; i < len; i++)\n      a[i] = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        zuo = 0;\n        you = 0;\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == '(' && a[j] != 1)\n            zuo++;\n          else if (str[j] == ')')\n            you++;\n        }\n        if (you < zuo + 1)\n          a[i] = 1;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        zuo = 0;\n        you = 0;\n        for (j = 0; j < i; j++) {\n          if (str[j] == '(')\n            zuo++;\n          else if (str[j] == ')' && a[j] != -1)\n            you++;\n        }\n        if (zuo < you + 1)\n          a[i] = -1;\n      }\n    }\n    printf(\"%s\\n\", str);\n    for (i = 0; i < len; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else if (a[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0}; \n    int i = 0, k = 0, x = 0, n = 0;  \n    for (i = 0;; i++)                \n    {\n      a[i] = getchar();\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    for (i = 0; i < n; i++) \n      b[i] = a[i];\n    for (i = 0; i < n; i++) \n      if (b[i] != '(' && b[i] != ')')\n        b[i] = ' ';\n    for (i = 0; i < n; i++) \n    {\n      for (k = 0; k < n; k++) {\n        if (b[k] == ')') {\n          for (x = 0; x <= k; x++) {\n            if (b[k - x] == '(') {\n              b[k] = ' ';\n              b[k - x] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) \n    {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    for (i = 0; i < n; i++) \n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int som;\n  char a[105];\n  char b[105];\n  int len;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (som = 1; som <= n; som++) {\n    scanf(\"%s\", a);\n    strcpy(b, a);\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '$') {\n        for (j = i + 1; j < len; j++) {\n          if (b[j] == '?') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << a << \"\\n\" << b << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "30729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar c[110], ch;\n\nvoid PMP(char c[], int len) {\n  for (int i = 0; i < len; i++)\n    cout << c[i];\n\n  cout << endl;\n  int flag = 1;\n\n  while (flag) {\n    flag = 0;\n    for (int i = 0; i < len; i++) {\n      if ((c[i] != '(') && (c[i] != ')'))\n        c[i] = ' ';\n      else if (c[i] == '(') {\n        for (int j = i + 1; j < len; j++) {\n          if (c[j] == '(')\n            break;\n          if (c[j] == ')') {\n            c[i] = ' ';\n            c[j] = ' ';\n            flag = 1;\n            break;\n          } else if (j == len - 1) {\n            c[i] = '$';\n          }\n        }\n      }\n    }\n  }\n  for (int i = 0; i < len; i++) {\n    if (c[i] == '(')\n      c[i] = '$';\n    if (c[i] == ')')\n      c[i] = '?';\n  }\n\n  for (int i = 0; i < len; i++)\n    cout << c[i];\n  cout << \"\\n\";\n  return;\n}\n\nint main() {\n  int len;\n  ch = getchar();\n  while (ch != '~') {\n    len = 0;\n    while (ch != '\\n') {\n      c[len] = ch;\n      len++;\n      ch = getchar();\n    }\n    PMP(c, len);\n    ch = getchar();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid peidui(char str[], int len);\nint main() {\n  int n, i;\n  char s[1000], s1[5];\n  scanf(\"%d\", &n);\n\n  cin >> s1;\n  for (i = 1; i <= n; i++) {\n\n    cin >> s;\n    puts(s);\n    peidui(s, strlen(s));\n  }\n}\nvoid peidui(char str[], int len) {\n  int a1[500], n1, n2, m, i1, i2;\n  n1 = 0;\n  char *p;\n  char mark[1000];\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(') {\n      a1[n1] = m;\n      n1++;\n    }\n    mark[m] = ' ';\n  }\n  for (i1 = n1 - 1; i1 >= 0; i1--) {\n    int exist;\n    exist = 0;\n    for (i2 = a1[i1] + 1; i2 <= len - 1; i2++) {\n      if (str[i2] == ')' && mark[i2] != 'm') {\n        exist = 1;\n        mark[i2] = 'm';\n        mark[a1[i1]] = 'm';\n        break;\n      }\n    }\n    if (a1[i1] == len - 1) {\n      mark[len - 1] = '$';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(' && mark[m] != 'm') {\n      mark[m] = '$';\n    }\n    if (str[m] == ')' && mark[m] != 'm') {\n      mark[m] = '?';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (mark[m] == 'm')\n      printf(\"%c\", ' ');\n    else\n      printf(\"%c\", mark[m]);\n  }\n  cout << \" \";\n}\n"}
{"label": "17", "index": "30731", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$') {\n            break;\n          } else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, k;\n  cin >> k;\n  while (k--) {\n    while (scanf(\"%s\", a) != EOF) {\n      puts(a);\n      n = strlen(a);\n      course(a, n);\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char a[1000];\n    cin >> a;\n    cout << a << '\\n';\n    int len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      int l = -1, r = -1;\n\n      for (int j = i; j >= 0; j--) {\n        if (a[j] == ')' && j != i)\n          break;\n        else if (a[j] == '(') {\n          l = j;\n          break;\n        }\n      }\n      for (int j = i; j < len; j++) {\n        if (a[j] == '(' && j != i)\n          break;\n        else if (a[j] == ')') {\n          r = j;\n          break;\n        }\n      }\n      if (r != -1 && l != -1) {\n        a[r] = '0';\n        a[l] = '0';\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        cout << \" \";\n    }\n    cout << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10][20], b[10][20];\n  int t, y, u = 0;\n  while (scanf(\"%s\", a[u]) != EOF) {\n    strcpy(b[u], a[u]);\n    for (t = 0; a[u][t] != 0; t++) {\n      if (a[u][t] != 40 && a[u][t] != 41)\n        b[u][t] = 32;\n      if (b[u][t] == 41) {\n        for (y = t; y > -1; y--) {\n          if (b[u][y] == 40) {\n            b[u][y] = 32;\n            b[u][t] = 32;\n            break;\n          }\n        }\n      }\n    }\n    for (t = 0; b[u][t] != 0; t++) {\n      if (b[u][t] == 40)\n        b[u][t] = 36;\n      else if (b[u][t] == 41) {\n        b[u][t] = 63;\n      }\n    }\n    puts(a[u]);\n    puts(b[u]);\n    u++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30734", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char c[], char str[], int n) {\n  int a, i, j;\n  for (i = 0; i <= n - 1; i++) {\n    if (c[i] == '(') {\n      a = 1;\n      for (j = i + 1; j <= n - 1; j++) {\n        if (c[j] == '(')\n          a++;\n        else if (c[j] == ')')\n          a--;\n        if (a == 0)\n          break;\n      }\n      if (a > 0)\n        str[i] = '$';\n    }\n    if (c[i] == ')') {\n      a = -1;\n      for (j = i - 1; j >= 0; j--) {\n        if (c[j] == ')')\n          a--;\n        else if (c[j] == '(')\n          a++;\n        if (a == 0)\n          break;\n      }\n      if (a < 0)\n        str[i] = '?';\n    }\n  }\n}\nint main() {\n  int r = 0;\n  while (r <= 5) {\n    char c[110] = {0}, str[110] = {0};\n    int n, i;\n\n    cin >> c;\n    n = strlen(c);\n    for (i = 0; i <= n - 1; i++)\n      str[i] = ' ';\n    f(c, str, n);\n    puts(c);\n    puts(str);\n    r++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, len;\n  char a[101];\n\n  while (cin >> a) {\n    int b[100] = {0};\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        char *p = &a[i - 1];\n        for (j = i - 1; j >= 0; j--) {\n          if (*p == '(' && b[j] == 0) {\n            b[j] = 1;\n            b[i] = 1;\n            break;\n          }\n          p--;\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' && b[i] == 0)\n        cout << \"$\";\n      else {\n        if (a[i] == ')' && b[i] == 0)\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10][20], b[10][20];\n  int i, t, y, u = 0;\n  while (scanf(\"%s\", a[u]) != EOF) {\n    strcpy(b[u], a[u]);\n    for (t = 0; a[u][t] != 0; t++) {\n      if (a[u][t] != 40 && a[u][t] != 41)\n        b[u][t] = 32;\n      if (b[u][t] == 41) {\n        for (y = t; y > -1; y--) {\n          if (b[u][y] == 40) {\n            b[u][y] = 32;\n            b[u][t] = 32;\n            break;\n          }\n        }\n      }\n    }\n    for (t = 0; b[u][t] != 0; t++) {\n      if (b[u][t] == 40)\n        b[u][t] = 36;\n      else if (b[u][t] == 41) {\n        b[u][t] = 63;\n      }\n    }\n    puts(a[u]);\n    puts(b[u]);\n    u++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, t, len;\n  char a[100];\n  while (cin >> a) {\n    t = 0;\n    m = 0;\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      if (a[i] == ')')\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        m = i;\n        break;\n      }\n    for (i = len - 1; i >= 0; i--)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        t = i;\n        break;\n      }\n    for (i = m; i <= t; i++) {\n      if (a[i] == ')')\n        cout << \"?\";\n      else if (a[i] == '(')\n        cout << \"$\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30738", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[999];\nint find(int i, int l) {\n  int t;\n  if (s[i] == '\\0')\n    return -1;\n  if (s[i] == '(') {\n    t = find(i + 1, l + 1);\n    if (t == -1)\n      s[i] = '$';\n    else\n      s[i] = ' ';\n    if (t == -1)\n      return -1;\n    else {\n      return find(t + 1, l);\n    }\n  }\n  if (s[i] == ')') {\n    if (l == 0)\n      s[i] = '?';\n    else\n      s[i] = ' ';\n    if (l == 0)\n      return find(i + 1, 0);\n    else\n      return i;\n  }\n  s[i] = ' ';\n  return find(i + 1, l);\n}\nint main() {\n  for (; cin >> s;) {\n    cout << s << \"\\n\";\n    find(0, 0);\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int i, j, k, l, m, n, t, b[100], c[100];\n  for (;;) {\n\n    scanf(\"%s \", a);\n    if (a[0] == ' ')\n      break;\n    n = strlen(a);\n    for (i = 0, j = 0, k = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[j] = i;\n        j++;\n      } else if (a[i] == ')') {\n        c[k] = i;\n        k++;\n      }\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (l = j - 1; l >= 0; l--) {\n        if (b[l] == i) {\n          for (t = 0; t < k; t++) {\n            if (c[t] > i) {\n              b[l] = -1;\n              c[t] = -1;\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < n; i++) {\n      for (l = 0; l < j; l++) {\n        if (b[l] == i) {\n          cout << \"$\";\n          break;\n        }\n      }\n      if (l != j)\n        continue;\n      for (t = 0; t < k; t++) {\n        if (c[t] == i) {\n          printf(\"?\");\n          break;\n        }\n      }\n      if (t != k)\n        continue;\n      printf(\" \");\n    }\n\n    printf(\" \");\n    a[0] = ' ';\n  }\n}\n"}
{"label": "17", "index": "30740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar input[105], output[105];\n\nvoid f()\n\n{\n\n  memset(output, 0, sizeof(output));\n\n  int l = 0, r = 0;\n\n  int len = strlen(input);\n\n  int i;\n\n  for (i = 0; i < len; ++i)\n\n  {\n\n    output[i] = ' ';\n\n    if (input[i] == ')')\n\n    {\n\n      if (l <= 0)\n\n        output[i] = '?';\n\n      else\n\n        l--;\n\n    }\n\n    else if (input[i] == '(')\n\n      l++;\n  }\n\n  l = r = 0;\n\n  for (i = len; i >= 0; --i)\n\n  {\n\n    if (input[i] == '(')\n\n    {\n\n      if (r <= 0)\n\n        output[i] = '$';\n\n      else\n\n        r--;\n\n    }\n\n    else if (input[i] == ')')\n\n      r++;\n  }\n\n  cout << input << endl;\n\n  printf(\"%s\\n\", output);\n}\nint main() {\n\n  while (cin.getline(input, 105)) {\n\n    f();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, left[102], len, j, k;\n  char *p = NULL;\n  char str[102];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    k = 0;\n    cin >> str;\n    cout << str << endl;\n    len = strlen(str);\n    p = str;\n    for (; p < str + len; p++) {\n      if (*p != '(' && *p != ')')\n        *p = ' ';\n    }\n    for (j = 0; j < len; j++) {\n      if (str[j] == '(') {\n        k++;\n        left[k] = j;\n      }\n      if (str[j] == ')') {\n        if (k == 0)\n          str[j] = '?';\n        else {\n          left[k] = -1;\n          k--;\n        }\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    } else {\n      for (; k > 0; k--)\n        str[left[k]] = '$';\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?' && str[j] != '$')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s1[101], s2[101];\nint f(int);\n\nint main() {\n  while (scanf(\"%s\", s1) != EOF) {\n    f(0);\n    printf(\"%s\\n%s\\n\", s1, s2);\n  }\n  return 0;\n}\n\nint f(int k) {\n  if (s1[k] == '\\0') {\n    s2[k] = '\\0';\n    return 0;\n  }\n\n  if (s1[k] == ')') {\n    s2[k] = '?';\n    f(k + 1);\n    return 0;\n  }\n\n  if (s1[k] == '(') {\n    for (int i = k + 1; i > 0; i++) {\n      if (s1[i] == '\\0') {\n        s2[i] = '\\0';\n        i = -1;\n      }\n\n      else {\n        if (s1[i] == '(') {\n          i = f(i);\n        }\n\n        else if (s1[i] == ')') {\n          s2[k] = ' ';\n          s2[i] = ' ';\n          f(i + 1);\n          return i;\n        }\n\n        else\n          s2[i] = ' ';\n      }\n    }\n    s2[k] = '$';\n    return -1;\n  }\n\n  s2[k] = ' ';\n  f(k + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "30743", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101];\n  int i, j, k;\n  int l, r;\n  int len;\n  while (cin >> a) {\n    l = 0;\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (a[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    b[len] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        l++;\n      if (a[i] == ')')\n        l--;\n      if (l < 0) {\n        b[i] = '?';\n        l = 0;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[len - i - 1] == ')')\n        r++;\n      if (a[len - i - 1] == '(')\n        r--;\n      if (r < 0) {\n        b[len - i - 1] = '$';\n        r = 0;\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i, n;\n  char s[101], a[101];\n  scanf(\"%d\", &n);\n  while (cin >> s) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[205];\n  while (cin.getline(a, 200)) {\n    char b[205];\n    int x[205] = {-1}, y[205] = {-1}, i, j, k, n, p, q;\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        p++;\n        x[p] = i;\n      }\n      if (a[i] == ')') {\n        q++;\n        y[q] = i;\n        if ((p != 0) && (x[p] < y[q])) {\n          x[p] = -1;\n          y[q] = -1;\n          p--;\n          q--;\n        }\n      }\n    }\n    for (i = 1; i <= p; i++)\n      b[x[i]] = '$';\n    for (i = 1; i <= q; i++)\n      b[y[i]] = '?';\n    cout << a << endl;\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30746", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, k;\n  scanf(\"%d\", &m);\n  getchar();\n  for (k = 0; k < m; k++) {\n    int i, f, len, j;\n    char a[200], b[200], c[200];\n\n    cin >> a;\n    len = strlen(a);\n    strcpy(c, a);\n    b[len] = '\u0000';\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        f = 0;\n        for (j = i; j < len; j++) {\n          if (a[j] == ')') {\n            f = 1;\n            a[j] = 'a';\n            break;\n          }\n        }\n        if (f == 0) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s %s \", c, b);\n  }\n}\n"}
{"label": "17", "index": "30747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[110], temp[110], c[110];\n  int i, figure;\n  while (cin >> ch) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        c[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure) {\n          figure--;\n          temp[c[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    printf(\"%s %s \", ch, temp);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30748", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar a[200];\nint x = 0, y = 0;\nvoid find(int min) \n{\n  if (min > 0) {\n    int p = -1;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && p >= 0) \n      {\n        a[p] = 'a';\n        a[i] = 'b';\n        break;\n      } else if (a[i] == '(') {\n        p = i;\n      }\n    }\n    find(min - 1); \n  }\n}\nvoid change() \n{\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else\n      a[i] = ' ';\n  }\n}\nvoid qingling() \n{\n  for (int i = 0; i < strlen(a); i++) {\n    a[i] = '\\0';\n  }\n}\nint main() {\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (int i = 0; i < strlen(a); i++) \n    {\n      if (a[i] == '(')\n        x++;\n      if (a[i] == ')')\n        y++;\n    }\n    int min = 0;\n    if (x < y)\n      min = x;\n    else\n      min = y;\n    find(min);         \n    change();          \n    cout << a << endl; \n    qingling();\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30749", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int l = 0, c[100] = {0}, m;\n\n    scanf(\"%s \", a);\n    if (a[0] == 0) {\n      break;\n    }\n    for (int i = 0; i < 101; i++) {\n      if (a[i] != 0) {\n        if (a[i] == '(') {\n          int p = 0;\n          c[i] = -1;\n          b[i] = '$';\n        } else if (a[i] == ')') {\n          int k = 0;\n          c[i] = 1;\n          b[i] = '?';\n        } else\n          b[i] = ' ';\n      } else {\n        l = i;\n        break;\n      }\n    }\n\n    cout << endl;\n    for (int i = 0; i < l; i++)\n      if (c[i] == -1)\n        for (int j = i, sum = 0; j < l; j++) {\n          sum = sum + c[j];\n\n          if (sum == 0) {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n    printf(\"%s\\n\", a);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30750", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, flag;\n  char a[200], b[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    memset(b, 0, 200);\n    scanf(\"%s \", a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == '(') {\n        flag = 1;\n        k = j + 1;\n        while (flag != 0 && k < strlen(a)) {\n          if (a[k] == '(')\n            flag++;\n          if (a[k] == ')')\n            flag--;\n          k++;\n        }\n        if (k >= strlen(a) && flag != 0)\n          b[j] = '$';\n        else {\n          b[k - 1] = ' ';\n          b[j] = ' ';\n        }\n      } else if (a[j] == ')' && b[j] != ' ')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char input[101] = {0}, initial[101];\n  int found = 0; \n  while (cin.getline(input, 101)) {\n    strcpy(initial, input);\n    do {\n      found = 0;\n      int i = 0, location = -1;\n      while (input[i]) {\n        if (input[i] == '(') {\n          location = i;\n          found = 1;\n        }\n        if (input[i] == ')') {\n          found = 1;\n          if (location == -1)\n            input[i] = '?';\n          else {\n            input[location] = ' ';\n            input[i] = ' ';\n            location = -1;\n            break;\n          }\n        }\n        if (input[i] != '?' && input[i] != '$' && input[i] != '(' &&\n            input[i] != ')')\n          input[i] = ' ';\n        i++;\n      }\n      if (location != -1) {\n        input[location] = '$';\n        location = -1;\n      }\n    } while (found);\n    cout << initial << endl << input << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[101] = {\"0\"}, temp[101] = {\"0\"};\n  int len = 0, i = 0, j = 0, s = 0;\n  while (cin.getline(word, 101)) {\n    printf(\"%s\\n\", word);\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      temp[i] = ' ';\n    temp[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        temp[i] = '$';\n      if (word[i] == ')')\n        temp[i] = '?';\n    }\n    for (i = 0; i < len; i++) {\n      s = 1;\n      if (word[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (word[j] == '(')\n            s++;\n          if (word[j] == ')')\n            s--;\n          if (s == 0) {\n            temp[i] = ' ';\n            temp[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << temp << \"\\n\";\n    strcpy(temp, \"0\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ghus(char a[]);\n  void noghus(char a[]);\n  int n, i, t, j;\n  char b[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b);\n    t = ghus(b);\n    printf(\"%s\\n\", b);\n    for (j = 1; j <= t; j++) {\n      noghus(b);\n    }\n    for (j = 0; j < strlen(b); j++) {\n      if (b[j] == '(')\n        printf(\"$\");\n      else if (b[j] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n\nint min(int a, int b) {\n  if (a < b) {\n    return a;\n  } else\n    return b;\n}\n\nint ghus(char a[]) {\n  int min(int a, int b);\n  int m = 0, n = 0, i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      m++;\n    if (a[i] == ')')\n      n++;\n  }\n  return min(m, n);\n}\n\nvoid noghus(char a[]) {\n  int i, j;\n  for (i = 0; i < strlen(a) - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < strlen(a); j++) {\n        if (a[j] == ')' || a[j] == '(')\n          break;\n      }\n      if (a[j] == ')') {\n        a[i] = 'o';\n        a[j] = 'o';\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "30754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][110], c, h;\n  int i, j, k, t[100] = {0}, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (j = 0; j < t[i]; j++) {\n      if ((a[i][j] >= 'a' && a[i][j] <= 'z') ||\n          (a[i][j] >= 'A' && a[i][j] <= 'Z'))\n        a[i][j] = ' ';\n    }\n    for (j = 0; j < t[i] - 1; j++) {\n      if (a[i][j] == '(') {\n        for (k = j + 1; k < t[i]; k++) {\n          if (a[i][k] == ')') {\n            a[i][j] = ' ';\n            a[i][k] = ' ';\n            j = -1;\n            break;\n          }\n          if (a[i][k] == '(') {\n            j = k - 1;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    for (j = 0; j < t[i]; j++) {\n      if (a[i][j] == ' ')\n        cout << a[i][j];\n      if (a[i][j] == '(')\n        cout << '$';\n      if (a[i][j] == ')')\n        cout << \"?\";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char s[]) {\n  int i, j, k, l;\n  int n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != '(' && s[i] != ')')\n      s[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] == ')') {\n      l = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (s[j] == '(') {\n          s[j] = ' ';\n          s[i] = ' ';\n          l = 1;\n          break;\n        }\n      }\n      if (l == 0)\n        s[i] = '?';\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (s[i] != ' ' && s[i] != '?')\n      s[i] = '$';\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char s[10000];\n\n  cin >> s;\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    f(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30756", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, len, lnum, num = 0, left[102] = {-1}, fail[102] = {0}, t = 0;\n  char s1[102];\n  while (scanf(\"%s\", s1) != EOF) {\n    printf(\"%s\\n\", s1);\n    len = strlen(s1);\n    lnum = 0;\n    for (i = 0; i < len; i++) {\n      if (s1[i] == '(') {\n        lnum++;\n        left[lnum] = i;\n      }\n\n      if (s1[i] == ')') {\n        if (lnum == 0)\n          fail[i] = 2;\n        else {\n          left[lnum] = -1;\n          lnum--;\n        }\n      }\n    }\n    for (i = 1; i <= lnum; i++) {\n      fail[left[i]] = 1;\n      left[i] = -1;\n    }\n\n    for (i = 0; i < len; i++)\n      if (fail[i] > 0)\n        num++;\n    for (i = 0; i < len && num > 0; i++) {\n      if (fail[i] == 2) {\n        printf(\"?\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 1) {\n        printf(\"$\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 0 && t == 1)\n        cout << \" \";\n      fail[i] = 0;\n    }\n    t = 0;\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char kuohaoin[201] = {0}, kuohao1[201] = {0}, kuohaoout[201] = {0};\n  int i, j, len;\n  while (cin >> kuohaoin) {\n    len = strlen(kuohaoin);\n    for (i = 0; i < len; i++) {\n      kuohao1[i] = kuohaoin[i];\n      kuohaoout[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (kuohao1[i] == '(') {\n        kuohaoout[i] = '$';\n        for (j = i + 1; j < len; j++) {\n          if (kuohao1[j] == ')') {\n            kuohao1[j] = 's';\n            kuohaoout[i] = ' ';\n            kuohao1[i] = 's';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      if (kuohao1[i] == ')')\n        kuohaoout[i] = '?';\n\n    cout << kuohaoin << endl;\n    cout << kuohaoout << endl;\n    for (i = 0; i < len; i++) {\n      kuohaoin[i] = 0;\n      kuohao1[i] = 0;\n      kuohaoout[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar st[100];\nchar st2[100];\nint main() {\n  memset(st, 0, 100);\n  memset(st2, 0, 100);\n  while (cin >> st) {\n    int left = 0, right = 0;\n    int len = strlen(st);\n    for (int i = 0; i < len; i++) {\n      if (st[i] == '(')\n        left++;\n      if (st[i] == ')')\n        right++;\n      if (left < right) {\n        st2[i] = '?';\n        right--;\n      }\n    }\n    left = 0;\n    right = 0;\n    for (int j = len - 1; j >= 0; j--) {\n      if (st[j] == '(')\n        left++;\n      if (st[j] == ')')\n        right++;\n      if (left > right) {\n        st2[j] = '$';\n        left--;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (st2[i] != '$' && st2[i] != '?')\n        st2[i] = ' ';\n    }\n    printf(\"%s\\n\", st);\n    cout << st2 << endl;\n    memset(st, 0, 100);\n    memset(st2, 0, 100);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (s[j] == '(') {\n            i = j;\n          } else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == len)\n          break;\n\n        i = -1;\n      }\n    }\n    for (q = 0; q < len; q++) {\n      if (s[q] == ')') {\n        s[q] = '?';\n      } else if (s[q] == '(') {\n        s[q] = '$';\n      } else\n        s[q] = ' ';\n    }\n    cout << ss << \" \";\n    cout << s << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int left[101], len, top = 0, i, j;\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    top = 0;\n    puts(str);\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        left[top] = i;\n        top++;\n      } else if (str[i] == ')') {\n        if (top) {\n          str[i] = ' ';\n          str[left[top - 1]] = ' ';\n          top--;\n        } else\n          str[i] = '?';\n      } else\n        str[i] = ' ';\n    }\n    for (j = 0; j < len; j++)\n      if (str[j] == '(')\n        str[j] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30761", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, n, p, q;\n  while (cin.getline(a, 101)) {\n    int b[101] = {0};\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] == ')') {\n        q++;\n\n        if (q > p)\n\n        {\n\n          b[i] = 1;\n          q = q - 1;\n        }\n      }\n      if (a[i] == '(') {\n        p++;\n      }\n    }\n    p = 0;\n    q = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        q++;\n      }\n      if (a[i] == '(') {\n        p++;\n\n        if (p > q)\n\n        {\n\n          b[i] = 2;\n          p = p - 1;\n        }\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      cout << a[i];\n    }\n    printf(\"\\n\");\n    for (i = 0; i <= n - 1; i++) {\n      if (b[i] == 0)\n        cout << \" \";\n\n      if (b[i] == 1) {\n        printf(\"?\");\n      }\n      if (b[i] == 2) {\n        cout << \"$\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  int l, i, j, d;\n  while (1) {\n\n    cin >> str;\n    if (str[0] == '\u0000')\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == ' ')\n        continue;\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        d = 1;\n        for (j = i + 1; j < l; j++) {\n          if (str[j] == '(')\n            d++;\n          if (str[j] == ')')\n            d--;\n          if (d == 0) {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        printf(\"?\");\n      else\n        printf(\"%c\", str[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      str[i] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, k, l, m, n, x;\n  while (cin.getline(a, 110)) {\n    n = strlen(a);\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    printf(\"\\n\");\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (a[k] != '(' && a[k] != ')') {\n        a[k] = ' ';\n      }\n      if (a[k] == '(') {\n        a[k] = '$';\n      }\n      if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int flag[101], i, j, k, len;\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < 101; i++)\n      flag[i] = 0;\n    len = strlen(str);\n    for (i = len - 2; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == ')' && flag[j] == 0) {\n            flag[j] = 1;\n            flag[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        cout << \" \";\n      else {\n        if (str[i] == '(' && flag[i] == 0)\n          cout << \"$\";\n        if (str[i] == '(' && flag[i] == 1)\n          cout << \" \";\n        if (str[i] == ')' && flag[i] == 0)\n          cout << \"?\";\n        if (str[i] == ')' && flag[i] == 1)\n          cout << \" \";\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30765", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int len, i, j, flag;\n  while (cin >> s) {\n    strcpy(c, s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      flag = 0;\n      if (s[i] == 41) {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == 40) {\n            flag++;\n            break;\n          }\n        }\n        if (flag == 1) {\n          s[i] = 32;\n          s[j] = 32;\n        } else\n          s[i] = '?';\n      }\n    }\n    printf(\"%s \", c);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '?')\n        printf(\"?\");\n      else if (s[i] == 40)\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int length, i = 0;\n  while (1) {\n    cin.get(str, 110, '\\n');\n    if (cin.get() == EOF)\n      break;\n    length = strlen(str);\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    printf(\"\\n\");\n    for (i = length - 1; i >= 0; i--) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i; j < length; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n    }\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30767", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[200];\n  while (scanf(\"%s\", str) != EOF) {\n    int n, i, j, k;\n    printf(\"%s \", str);\n    n = strlen(str);\n    for (i = 0, k = 0; i < n; i++) {\n      if (str[i] == '(') {\n        k = i;\n      }\n      if (str[i] == ')' && str[k] == '(') {\n        str[i] = ' ';\n        str[k] = ' ';\n        i = -1;\n        k = 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n      else {\n        if (str[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint j = 1;\nint main() {\n  char a[101];\n  a[0] = 0;\nl:\n  scanf(\"%s\", a);\n  if (a[0] == 0)\n    return 0;\n  else\n    printf(\"%s\\n\", a);\n  int r, i, k;\n  r = strlen(a);\n  for (i = r - 1; i >= 0; i--) {\n    if (a[i] != '(' && a[i] != ')')\n      a[i] = ' ';\n    else if (a[i] == '(') {\n      for (k = i; k <= r - 1; k++) {\n        if (a[k] == ')') {\n          a[i] = ' ';\n          a[k] = ' ';\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= r - 1; i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n  }\n  printf(\"%s\\n\", a);\n  return main();\n}\n"}
{"label": "17", "index": "30769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint findl(int i, char a[102], int n);\nint find(int i, char a[102]);\nint main() {\n  char a[102];\n  memset(a, '\\n', 102);\n  while (cin >> a) {\n    int n = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < n; i++) {\n      int x = 0;\n      if (a[i] == '(' && findl(i, a, n) > n)\n        cout << \"$\"; \n      else if (a[i] == ')' && find(i, a) < 0)\n        cout << '?';\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n}\nint findl(int i, char a[102], int n) \n{\n  int k = i + 1;\n  while (k < n) {\n    if (a[k] == '(')\n      k = findl(k, a, n); \n    else if (a[k] == ')')\n      return k;\n    k++;\n  }\n  return n + 1;\n}\nint find(int i, char a[102]) \n{\n  int k = i - 1;\n  while (k >= 0) {\n    if (a[k] == ')')\n      k = find(k, a);\n    else if (a[k] == '(')\n      return k;\n    k--;\n  }\n  return -1;\n}\n"}
{"label": "17", "index": "30770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pipei(char str[]) {\n  int i, la, stack[100], k = 0;\n  char res[101];\n  la = strlen(str);\n  for (i = 0; i < la; i++)\n    res[i] = ' ';\n  res[la] = '\\0';\n  for (i = 0; i < la; i++) {\n    if (str[i] == ')') {\n      if (k == 0 || stack[k - 1] > 0)\n        stack[k++] = i + 1;\n      else\n        k--;\n    } else if (str[i] == '(')\n      stack[k++] = -(i + 1);\n  }\n  for (i = 0; i < k; i++) {\n    int a = stack[i];\n    if (a < 0)\n      res[-a - 1] = '$';\n    else\n      res[a - 1] = '?';\n  }\n  cout << str << endl;\n  cout << res << endl;\n}\nint main() {\n  int n, i;\n  cin >> n;\n  cin.get();\n  char str[101];\n  for (i = 0; i < n; i++) {\n\n    cin.getline(str, 101);\n    pipei(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p[109];\n  char s[110], t[110];\n  while (scanf(\"%s\", s) != EOF) {\n    for (i = 0; i < 109; i++)\n      p[i] = 0;\n    strcpy(t, s);\n    for (i = 0, j = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        p[j++] = i;\n      if (s[i] == ')' && j > 0)\n        s[p[j-- - 1]] = s[i] = ' ';\n      if (s[i] != '(' && s[i] != ')')\n        s[i] = ' ';\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << t << \"\\n\" << s << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "30772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, e, x, i, t, j, k;\n  char s[102];\n  scanf(\"%d\", &n);\n  for (e = 0; e < n; e++) {\n    scanf(\"%s\", s);\n    printf(\"%s \", s);\n    x = strlen(s);\n    for (i = 0; i < x; i++) {\n      if (s[i] != '(' && s[i] != ')') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < x; j++) {\n          if (s[j] == ')') {\n            t = 0;\n            for (k = i + 1; k < j; k++) {\n              if (s[k] != ' ') {\n                t = 1;\n                break;\n              }\n            }\n            if (t == 0) {\n              s[i] = ' ';\n              s[j] = ' ';\n              i = -1;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    printf(\"%s \", s);\n  }\n}\n"}
{"label": "17", "index": "30773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void function(char a[200]);\n  char a[200];\n  while (scanf(\"%s\", a) != EOF) {\n    function(a);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\nvoid function(char a[200]) {\n  int p[200];\n  int q[200];\n  int pa = 0, qa = 0, t1, t2, j, i, l;\n  pa = 0;\n  qa = 0;\n  printf(\"%s\\n\", a);\n  l = strlen(a) - 1;\n  for (i = 0; i <= l; i++) {\n    if (a[i] == '(') {\n      p[pa] = i;\n      pa++;\n    } else if (a[i] == ')') {\n      q[qa] = i;\n      qa++;\n    } else\n      a[i] = ' ';\n  }\n  for (i = pa - 1; i >= 0; i--) {\n    for (j = 0; j < qa; j++) {\n      t1 = p[i];\n      t2 = q[j];\n      if (p[i] < q[j] && a[t2] != ' ') {\n        a[t1] = ' ';\n        a[t2] = ' ';\n        break;\n      }\n    }\n    if (j == qa) {\n      t1 = p[i];\n      a[t1] = '$';\n    }\n  }\n  for (j = 0; j < qa; j++) {\n    t2 = q[j];\n    if (a[t2] == ')')\n      a[t2] = '?';\n  }\n}\n"}
{"label": "17", "index": "30774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag[101] = {0};\n  char str[101];\n  while (cin >> str) {\n    for (i = 0; i < strlen(str); i++) {\n      cout << str[i];\n      if (str[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (str[j] == '(' && flag[j] == 0) {\n            flag[i] = 1;\n            flag[j] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << endl;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(' && flag[i] == 0)\n        cout << \"$\";\n      else if (str[i] == ')' && flag[i] == 0)\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << endl;\n    memset(flag, 0, sizeof(flag));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30775", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint d[120] = {0}, l = 0;\nint search(int p) {\n  int i = p + 1, j = 0;\n  while (1) {\n    if (d[i] == -1) {\n      j = search(i); \n      i = j + 1;\n    } else {\n      if (d[i] == 1) {\n        d[p] = 0;\n        d[i] = 0;\n        return i;\n      } else\n        i++;\n    }\n    if (i >= l)\n      return i;\n  }\n}\nint main() {\n  char ch;\n  int i, j;\n  while (cin.get(ch)) {\n    \n    if (ch == '\\n') {\n      cout << endl;\n      i = 0;\n      while (i < l) {\n        while (i < l && d[i] > -1) {\n          i++;\n        }\n        if (i >= l)\n          break;\n        j = search(i);\n        i = j + 1;\n      }\n      for (i = 0; i < l; i++) {\n        if (d[i] == -1)\n          cout << '$'; \n        else if (d[i] == 1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n      cout << endl;\n      l = 0;\n      for (i = 0; i < 100; i++)\n        d[i] = 0;\n    } else {\n      cout << ch;\n      if (ch == '(')\n        d[l] = -1;\n      if (ch == ')')\n        d[l] = 1;\n      l++;\n    }\n    ch = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  while (scanf(\"%s \", a)) {\n    cout << a;\n    cout << endl;\n    int len, i, j;\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == ')') {\n            a[i] = 'A';\n            a[j] = 'B';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else {\n        if (a[i] == ')')\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30777", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar s1[101], s2[101];\nint f(int);\n\nint main() {\n  while (scanf(\"%s\", s1) != EOF) {\n    f(0);\n    cout << s1 << endl << s2 << endl;\n  }\n  return 0;\n}\n\nint f(int k) {\n  if (s1[k] == '\\0') {\n    s2[k] = '\\0';\n    return 0;\n  }\n\n  if (s1[k] == ')') {\n    s2[k] = '?';\n    f(k + 1);\n    return 0;\n  }\n\n  if (s1[k] == '(') {\n    for (int i = k + 1; i > 0; i++) {\n      if (s1[i] == '\\0') {\n        s2[i] = '\\0';\n        i = -1;\n      }\n\n      else if (s1[i] == '(') {\n        i = f(i);\n      }\n\n      else if (s1[i] == ')') {\n        s2[k] = ' ';\n        s2[i] = ' ';\n        f(i + 1);\n        return i;\n      }\n\n      else {\n        s2[i] = ' ';\n      }\n    }\n    s2[k] = '$';\n    return -1;\n  }\n\n  s2[k] = ' ';\n  f(k + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "30778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar A[100], a[100];\nint i, j = 0, m;\nint k;\nint main() {\n  void pipei1(char x);\n  void pipei2(char x);\n  int n;\n  while (cin >> a) {\n    i = 0;\n    m = 0;\n    k = strlen(a);\n    if (k == 0)\n      break;\n    for (n = 0; n < k; n++) {\n      A[n] = ' ';\n      cout << a[n];\n    }\n    pipei1(a[j]);\n    pipei2(a[j]);\n    cout << endl;\n    for (n = 0; n < k; n++)\n      cout << A[n];\n\n    cout << endl;\n  }\n\n  return 0;\n}\nvoid pipei1(char x) {\n  if (j < k) {\n    if (i < 0)\n      i = 0;\n    if (x == '(') {\n      i++;\n    } else if (x == ')') {\n      if (i == 0) {\n        A[j] = '?';\n      }\n      i--;\n    }\n    j++;\n    pipei1(a[j]);\n  }\n}\nvoid pipei2(char x) {\n  if (j >= 0) {\n    if (m < 0)\n      m = 0;\n    if (x == ')') {\n      m++;\n    } else if (x == '(') {\n      if (m == 0) {\n        A[j] = '$';\n      }\n      m--;\n    }\n    j--;\n    pipei2(a[j]);\n  }\n}\n"}
{"label": "17", "index": "30779", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pipei(char str[]) {\n  int i, la, stack[100], k = 0;\n  char res[101];\n  la = strlen(str);\n  for (i = 0; i < la; i++)\n    res[i] = ' ';\n  res[la] = '\\0';\n  for (i = 0; i < la; i++) {\n    if (str[i] == ')') {\n      if (k == 0 || stack[k - 1] > 0)\n        stack[k++] = i + 1;\n      else\n        k--;\n    } else if (str[i] == '(')\n      stack[k++] = -(i + 1);\n  }\n  for (i = 0; i < k; i++) {\n    int a = stack[i];\n    if (a < 0)\n      res[-a - 1] = '$';\n    else\n      res[a - 1] = '?';\n  }\n  printf(\"%s\\n\", str);\n  printf(\"%s\\n\", res);\n}\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  cin.get();\n  char str[101];\n  for (i = 0; i < n; i++) {\n\n    cin.getline(str, 101);\n    pipei(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid Match(int input_len);\nchar input[128];\nchar tmp_input[128];\nint main() {\n\n  while (scanf(\"%s\", input) != EOF) {\n    strcpy(tmp_input, input);\n    int input_len = strlen(input);\n    Match(input_len);\n    for (int i = 0; i <= input_len - 1; i++) {\n      if (input[i] == '(') {\n        input[i] = '$';\n      } else if (input[i] == ')')\n        input[i] = '?';\n      else\n        input[i] = ' ';\n    }\n    cout << tmp_input << \"\\n\";\n    printf(\"%s\\n\", input);\n  }\n  return 0;\n}\nvoid Match(int input_len) {\n  int cur_left = -1, cur_right = -1;\n  for (int i = 0; i <= input_len - 1; i++) {\n    if (input[i] == '(') {\n      cur_left = i;\n      continue;\n    }\n    if (input[i] == ')') {\n      if (cur_left != -1) {\n        input[cur_left] = ' ';\n        input[i] = ' ';\n        cur_left = -1;\n        i = -1;\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "30781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char in[1000];\n  while (cin.getline(in, 1000, '\\n')) {\n\n    if (in[0] == '\\0')\n      break;\n    int len;\n    len = strlen(in);\n    int i, j, k;\n    int flag[100] = {0};\n    for (i = 0; i <= len - 1; i++) {\n      if (in[i] == '(') {\n        flag[i] = 2;\n      }\n      if (in[i] == ')') {\n        flag[i] = 3;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 1)\n        continue;\n      if (in[i] == '(') {\n        for (j = i + 1; j <= len - 1; j++) {\n          if (flag[j] == 1)\n            continue;\n          if (in[j] == ')') {\n            flag[j] = 1;\n            flag[i] = 1;\n          }\n          if (in[j] == ')')\n            break;\n        }\n      }\n    }\n    cout << in << endl;\n    int temp, t;\n    int num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 2 || flag[i] == 3)\n        temp = i;\n\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        t = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (j = 0; j <= len - 1; j++) {\n      if (flag[i] == 0 || flag[i] == 1) {\n        num++;\n      }\n    }\n    if (num < len) {\n\n      for (i = t; i <= temp; i++) {\n        if (flag[i] == 0 || flag[i] == 1) {\n          cout << \" \";\n        }\n        if (flag[i] == 2) {\n          cout << \"$\";\n        }\n        if (flag[i] == 3)\n          cout << \"?\";\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int m = 1; m <= n; m++) {\n    char str[105], str2[105];\n    cin >> str;\n    int stack[105];\n    int len = strlen(str), k = 0;\n    for (int i = 0; i < len; i++) {\n      str2[i] = ' ';\n    }\n    str2[len] = '\\0';\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k == 0 || stack[k - 1] > 0) {\n          stack[k++] = i + 1;\n        } else\n          k--;\n      } else if (str[i] == '(') {\n        stack[k++] = -i - 1;\n      }\n    }\n    for (int i = 0; i < k; i++) {\n      if (stack[i] < 0)\n        str2[-stack[i] - 1] = '$';\n      else\n        str2[stack[i] - 1] = '?';\n    }\n    printf(\"%s\\n\", str);\n    cout << str2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[101] = {0};\n  while ((scanf(\"%s\", s) != EOF)) {\n    int i, j;\n    int you = 0;\n    int l1 = strlen(s);\n    char a[101];\n    strcpy(a, s);\n    for (i = l1 - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        you = 0;\n        for (j = i + 1; j < l1; j++) {\n\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            you = you + 1;\n            break;\n          }\n        }\n        if (you == 0)\n          s[i] = '$';\n      }\n    }\n    puts(a);\n\n    for (i = 0; i < l1; i++) {\n      if (s[i] == '?' || s[i] == '$')\n        printf(\"%c\", s[i]);\n      else if (s[i] == ')')\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30784", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[1000], label[1000];\n  int pos[1000];\n  int len, i;\n  while (cin.getline(line, 1000)) {\n    int left = 0, right = 0, s = -1;\n    len = strlen(line);\n    for (i = 0; i < 1000; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++s] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          s--;\n        }\n      }\n    }\n    if (s >= 0) {\n      for (i = 0; i <= s; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[110] = {'\\0'};\n  while (cin.getline(str, 110, '\\n')) {\n    int length;\n    length = strlen(str);\n    for (int i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = length - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i + 1; j < length; j++) {\n          if (str[j] == '?') {\n            str[j] = ' ';\n            str[i] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    for (int i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct m {\n  char a;\n  int n;\n} q[100];\nint main() {\n  char b[101] = {0};\n  int i, j, k, t, l;\n  while (scanf(\"%s \", b)) {\n    cout << b << endl;\n    char c[101] = {0};\n    t = 0;\n    k = strlen(b);\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (b[i] == '(' || b[i] == ')') {\n        q[j].a = b[i];\n        q[j++].n = i;\n      }\n    i = 0;\n    while (i < j - t - 1) {\n      if (q[i].a == '(' && q[i + 1].a == ')') {\n        for (l = i; l < j - t - 2; l++)\n          q[l] = q[l + 2];\n\n        t = t + 2;\n        if (i != 0)\n          i = i - 1;\n      } else\n        i++;\n    }\n\n    for (i = 0; i < k; i++) {\n      c[i] = ' ';\n      b[i] = 0;\n    }\n    for (i = 0; i < j - t; i++) {\n      if (q[i].a == '(')\n        c[q[i].n] = '$';\n      else\n        c[q[i].n] = '?';\n    }\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int bs[102], i, j;\n  char a[102];\n  memset(bs, 0, 102);\n  while (cin.getline(a, 102)) {\n    for (i = 0; i < 102; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(')\n        bs[i] = 1;\n      if (a[i] == ')') {\n        bs[i] = 1;\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && bs[j] == 1) {\n            bs[j] = 0;\n            bs[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < 102; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == ')' && bs[i] == 1)\n        printf(\"?\");\n      else if (a[i] == '(' && bs[i] == 1)\n        cout << \"$\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[200], str1[200];\n  while (scanf(\"%s\", str1) != EOF) {\n    int m;\n    m = strlen(str1);\n    strcpy(str, str1);\n    int i, j;\n    for (i = 1; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (i + j < m) {\n          if (str[j] == '(' && str[j + i] == ')') {\n            str[j] = 'a';\n            str[j + i] = 'a';\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\\n\", str1);\n    printf(\"%s\\n\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a;\nchar str[100];\nvoid find(void);\nint main() {\n  int i;\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    a = strlen(str);\n    find();\n    for (i = 0; i < a; i++) {\n      if (str[i] == '(')\n        cout << \"$\";\n      else {\n        if (str[i] == ')')\n          cout << \"?\";\n        else\n          printf(\" \");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\nvoid find(void) {\n  int i = 0;\n  int p = -1, q = -1;\n  for (i = 0; i < a; i++) {\n    if (str[i] != '(' && str[i] != ')')\n      str[i] = '\\0';\n    if (str[i] == '(')\n      p = i;\n    if (p != -1 && str[i] == ')') {\n      q = i;\n      break;\n    }\n  }\n  if (p != -1 && q != -1) {\n    str[p] = '\\0';\n    str[q] = '\\0';\n    find();\n  }\n}\n"}
{"label": "17", "index": "30790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[101] = {0};\n  while ((scanf(\"%s\", s) != EOF)) {\n    int i, j;\n    int you = 0;\n    int l1 = strlen(s);\n    char a[101];\n    strcpy(a, s);\n    for (i = l1 - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        you = 0;\n        for (j = i + 1; j < l1; j++) {\n\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            you = you + 1;\n            break;\n          }\n        }\n        if (you == 0)\n          s[i] = '$';\n      }\n    }\n    puts(a);\n\n    for (i = 0; i < l1; i++) {\n      if (s[i] == '?' || s[i] == '$')\n        printf(\"%c\", s[i]);\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30791", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(char str[105], int len) \n{\n  int i, j;\n  for (i = 0; i < len; i++) { \n    cout << str[i];\n  }\n  cout << endl;               \n  for (i = 0; i < len; i++) { \n    if (str[i] == ')') {\n      int x = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (str[j] == '(') {\n          x = 1;\n          str[i] = 'a'; \n          str[j] = 'a';\n          break;\n        }\n      }\n      if (x == 0) \n        str[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) { \n    if (str[i] == '(')\n      str[i] = '$';\n  }\n  for (i = 0; i < len; i++) { \n    if (str[i] != '$' && str[i] != '?')\n      str[i] = ' ';\n  }\n  for (i = 0; i < len; i++) { \n    cout << str[i];\n  }\n  cout << endl;\n}\nint main() { \n  char str[105];\n  int len;\n  while (cin >> str) { \n    len = strlen(str);\n    f(str, len);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101] = {0}, b[101] = {0};\n  while (scanf(\"%s\", a) != EOF) {\n    strcpy(b, a);\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '?') {\n        for (j = i - 1; j > -1; j--)\n          if (a[j] == '$') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n      }\n    }\n    cout << b << \"\\n\";\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[200];\n  int i, j, k, ei, bi, l;\n  while (cin.getline(str, 150)) {\n    int strout[101] = {0};\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(')\n        strout[i] = -1;\n      else if (str[i] == ')')\n        strout[i] = 1;\n    }\n    for (i = 0; i < l; i++) {\n      if (strout[i] != -1)\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (strout[j] != 1)\n          continue;\n        for (k = j; k >= i; k--) {\n          if (strout[k] == -1) {\n            strout[k] = 0;\n            strout[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    bi = l - 1;\n    ei = 0;\n    for (i = 0; i < l; i++)\n      if (strout[i] != 0) {\n        bi = i;\n        break;\n      }\n    for (i = l - 1; i >= 0; i--)\n      if (strout[i] != 0) {\n        ei = i;\n        break;\n      }\n\n    for (i = bi; i <= ei; i++) {\n      if (strout[i] == 0)\n        cout << ' ';\n      else if (strout[i] == -1)\n        cout << \"$\";\n      else\n        cout << '?';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30795", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101];\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < strlen(a); i++)\n      printf(\"%c\", a[i]);\n    putchar('\\n');\n    for (i = strlen(a) - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++)\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n      printf(\"%c\", a[i]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid find() {\n  char ch[101];\n\n  memset(ch, '\\0', sizeof(ch));\n  while (cin.getline(ch, 1000, '\\n')) {\n    cout << ch << \"\\n\";\n    int i = 0, j = 0;\n    int num = 0;\n    for (i = 0; i < 100; i++)\n      if (ch[i] == '(') {\n        num = 0;\n        for (j = i; j < 100; j++) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num > 0)\n          ch[i] = '$';\n      }\n    for (i = 99; i >= 0; i--)\n      if (ch[i] == ')') {\n        num = 0;\n        for (j = i; j >= 0; j--) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num < 0)\n          ch[i] = '?';\n      }\n    int len;\n    len = strlen(ch);\n    for (i = 0; i < len; i++)\n      if (ch[i] != '$' && ch[i] != '?')\n        ch[i] = ' ';\n    cout << ch << endl;\n  }\n}\nint main() {\n\n  find();\n  return 0;\n}\n"}
{"label": "17", "index": "30797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  int i, len, mark1[110] = {0}, judge, k = 0, j, k1 = 0;\n  while (cin.getline(a, 110)) {\n    len = strlen(a);\n    k = 0;\n    for (i = 0; i < 110; i++)\n      mark1[i] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' || a[i] == ')') {\n        if (k == 0) {\n          if (a[i] == '(')\n            mark1[k]++;\n          else\n            mark1[k]--;\n          k++;\n        } else {\n          judge = 0;\n          if (a[i] == '(')\n            mark1[k] = 1;\n          else if (a[i] == ')') {\n            mark1[k] = -1;\n            for (j = k - 1; j >= 0; j--) {\n              if (mark1[j] == 1) {\n                mark1[j] = 0;\n                mark1[k] = 0;\n                break;\n              }\n            }\n          }\n\n          k++;\n        }\n      }\n    }\n    k1 = 0;\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        cout << ' ';\n      else {\n        if (mark1[k1] == 0)\n          printf(\" \");\n        else if (mark1[k1] > 0)\n          cout << '$';\n        else\n          cout << '?';\n        k1++;\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30798", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000] = {0}, b[1000] = {0};\n  int i, j;\n  while (scanf(\"%s \", a)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      b[i] = a[i];\n    }\n    b[i] = '\u0000';\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if (b[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '(') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if ((b[i] >= 'a' && b[i] <= 'z') || (b[i] >= 'A' && b[i] <= 'Z'))\n        b[i] = ' ';\n      else if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    cout << a << endl;\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101] = {0}, label[101] = {0};\n  int pos[101] = {0}, left, right, l, i, j, n;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    cin >> line;\n    left = 0;\n    right = 0;\n    l = strlen(line);\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[l] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  char s1[101], s2[101] = {0};\n  for (i = 1; i > 0;) {\n\n    cin >> s1;\n    if (strcmp(s1, s2) == 0) {\n      printf(\" \");\n      break;\n    }\n    puts(s1);\n    l = strlen(s1);\n    for (j = 0; j < l; j++) {\n      if (s1[j] != '(' && s1[j] != ')')\n        s1[j] = ' ';\n      else {\n        if (s1[j] == ')') {\n          for (k = j; k >= 0; k--)\n            if (s1[k] == '(')\n              break;\n          if (k != -1)\n            s1[k] = s1[j] = ' ';\n          else\n            s1[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s1[j] == '(')\n        s1[j] = '$';\n    }\n    strcpy(s2, s1);\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30801", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[1000];\n  int i = 0, j = 0, length = 0, t1 = 0, t2 = 0;\n  int flag = 0, left = 0, right = 0;\n  while (scanf(\"%s \", string)) {\n    cout << string << endl;\n    length = strlen(string);\n    flag = 1, left = 0, right = 0;\n    t1 = 0, t2 = 0;\n    while (flag == 1) {\n      for (i = 0; i < length; i++) {\n        if (string[i] == '(') {\n          left = i;\n          t1 = 1;\n        }\n\n        else if (t1 == 1 && string[i] == ')') {\n          right = i;\n          t2 = 1;\n          break;\n        }\n\n        else\n          continue;\n      }\n\n      if (t1 == 1 && t2 == 1)\n\n      {\n        string[left] = '0';\n        string[right] = '0';\n        t1 = 0;\n        t2 = 0;\n        flag = 1;\n      } else\n        flag = 0;\n    }\n\n    for (i = 0; i < length; i++) {\n      if (string[i] == '(') {\n        string[i] = '$';\n      } else {\n        if (string[i] == ')')\n          string[i] = '?';\n        else\n          string[i] = ' ';\n      }\n    }\n\n    for (i = 0; i < length; i++) {\n      cout << string[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar use[150], rem[150];\nint len;\nvoid rid(int begin, int end);\nint main() {\n  while (1) {\n    char s;\n    int i = 0;\n    while ((s = cin.get()) != '\\n') {\n      use[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    len = i - 1; \n    rid(0, len);\n    for (int j = 0; j <= len; j++)\n      if (use[j] == '(')\n        use[j] = '$';\n      else if (use[j] == ')')\n        use[j] = '?';\n      else if (use[j] != '?' && use[j] != '$')\n        use[j] = ' ';\n\n    for (i = 0; i <= len; i++)\n      cout << rem[i];\n    cout << endl;\n    for (i = 0; i <= len; i++)\n      cout << use[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n\nvoid rid(int begin, int end) {\n  if (begin <= end) {\n    if (use[begin] != ')')\n      rid(begin + 1, end);\n    else {\n      int i = begin;\n      while (use[i] != '(' && i >= 0)\n        i--; \n      if (i == -1) {\n        use[begin] = '?';\n        rid(begin + 1, end);\n      } else\n        for (int j = i; j <= begin; j++) {\n          use[j] = ' ';\n          rid(begin + 1, end);\n        }\n    }\n  }\n}\n"}
{"label": "17", "index": "30803", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf[106];\n  while (1) {\n    memset(zf, '\u0000', sizeof(zf));\n\n    cin >> zf;\n    if (zf[0] == '\u0000')\n      break;\n    puts(zf);\n    for (int i = 0; i < strlen(zf); i++) {\n      if (zf[i] == ')') {\n        for (int j = i; j >= 0; j--) {\n          if (zf[j] == '(') {\n            zf[j] = ' ';\n            zf[i] = ' ';\n            break;\n          }\n        }\n      } else if (zf[i] != '(') {\n        zf[i] = ' ';\n      }\n    }\n    for (int t = 0; t < strlen(zf); t++) {\n      if (zf[t] == '(') {\n        zf[t] = '$';\n      } else if (zf[t] == ')') {\n        zf[t] = '?';\n      }\n    }\n    puts(zf);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[20][110] = {0};\n  int i, j, k, n = 0;\n  for (i = 1; cin >> a[i]; i++) {\n    n++;\n  }\n  for (i = 1; i <= n; i++) {\n    char b[110];\n    for (k = 0; k <= 109; k++) {\n      b[k] = ' ';\n    }\n    int c[110] = {0};\n    int p = 0, q = 0, m = 0;\n    for (j = 0; j <= 109; j++) {\n      if (a[i][j] != 0)\n        m++;\n    }\n    for (j = 0; j <= m - 1; j++) {\n      if (a[i][j] == '(') {\n        p++;\n        b[j] = '$';\n      } else if (a[i][j] == ')') {\n        b[j] = '?';\n        if (p > 0) {\n          b[j] = ' ';\n          p--;\n          for (k = j - 1; k >= 0; k--) {\n            if ((b[k] == '$') && (c[k] == 0))\n              break;\n          }\n          b[k] = ' ';\n          c[k] = 1;\n        }\n      }\n    }\n    cout << a[i] << endl;\n    for (j = 0; j <= m - 2; j++) {\n      cout << b[j];\n    }\n    cout << b[m - 1] << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    switch (a[i]) {\n    case 1:\n      printf(\"$\");\n      break;\n    case 0:\n      cout << \" \";\n      break;\n    case -1:\n      printf(\"?\");\n      break;\n    }\n  cout << \" \";\n}\nvoid trans(char s[], int a[], int n) {\n  int i, p[200], k = -1;\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if ((s[i] != '(') && (s[i] != ')'))\n      a[i] = 0;\n    else if (s[i] == '(') {\n      k++;\n      p[k] = i;\n      a[i] = 1;\n    } else {\n      if (k > -1) {\n        a[p[k]] = 0;\n        k--;\n        a[i] = 0;\n      } else\n        a[i] = -1;\n    }\n  }\n}\nvoid input() {\n  char s[200];\n  int a[200], n;\n  while (scanf(\"%s\", s) != EOF) {\n    n = strlen(s);\n    puts(s);\n    trans(s, a, n);\n    output(a, n);\n  }\n}\nint main() { input(); }\n"}
{"label": "17", "index": "30806", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar c[110], ch;\n\nvoid PMP(char c[], int len) {\n  for (int i = 0; i < len; i++) {\n    cout << c[i];\n  }\n  cout << endl;\n  int flag = 1;\n\n  while (flag) {\n    flag = 0;\n    for (int i = 0; i < len; i++) {\n      if ((c[i] != '(') && (c[i] != ')'))\n        c[i] = ' ';\n      else if (c[i] == '(') {\n        for (int j = i + 1; j < len; j++) {\n          if (c[j] == '(')\n            break;\n          if (c[j] == ')') {\n            c[i] = ' ';\n            c[j] = ' ';\n            flag = 1;\n            break;\n          } else if (j == len - 1) {\n            c[i] = '$';\n          }\n        }\n      }\n    }\n  }\n  for (int i = 0; i < len; i++) {\n    if (c[i] == '(')\n      c[i] = '$';\n    if (c[i] == ')')\n      c[i] = '?';\n  }\n\n  for (int i = 0; i < len; i++)\n    cout << c[i];\n  printf(\"\\n\");\n  return;\n}\n\nint main() {\n  int len;\n  ch = getchar();\n  while (ch != '~') {\n    len = 0;\n    while (ch != '\\n') {\n      c[len] = ch;\n      len++;\n      ch = getchar();\n    }\n    PMP(c, len);\n    ch = getchar();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint amount(char c, char a[101]) {\n  int i, amount = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == c)\n      amount = amount + 1;\n  }\n  return amount;\n}\n\nvoid match(char a[101]) {\n  int i, j;\n  int p, q;\n  p = amount('(', a);\n  q = amount(')', a);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; a[j] != '\\0'; j++) {\n        if (a[j] == '(')\n          break;\n        else if (a[j] == ')') {\n          a[i] = ' ';\n          a[j] = ' ';\n          break;\n        }\n      }\n    }\n  }\n\n  if (amount('(', a) < p || amount(')', a) < q)\n    return match(a);\n}\n\nint main() {\n  char s[101];\n  int i;\n  for (; scanf(\"%s\", s) != EOF;) {\n    cout << s << \"\\n\";\n    match(s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30808", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nint len, num = 0;\nint f1(int n) {\n  if (n == len - 1) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    return f1(n + 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    if (num == 0)\n      return 0;\n    else\n      return f1(n + 1);\n  } else\n    return f1(n + 1);\n}\nint f2(int n) {\n  if (n == 0) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')')\n      num--;\n\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    if (num == 0)\n      return 0;\n    else\n      return f2(n - 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    return f2(n - 1);\n  } else\n    return f2(n - 1);\n}\nint main() {\n  while (cin >> a) {\n    len = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        printf(\" \");\n      else {\n        if (a[i] == '(') {\n          num = 0;\n          if (f1(i) > 0)\n            cout << '$';\n          else\n            cout << ' ';\n        } else {\n          num = 0;\n          if (f2(i) < 0)\n            cout << '?';\n          else\n            cout << ' ';\n        }\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30809", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nchar b[110];\nchar a[110];\nint opr(int i) \n{\n  int j;\n  for (j = i - 1; j >= 0; j--) {\n    if (b[j] == '$') {\n      b[j] = ' ';\n      b[i] = ' ';\n      break;\n    }\n  }\n  return 0;\n}\nvoid tag(char *a, char *b) \n{\n  int l = strlen(a);\n  int i;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  b[l] = '\\0';\n}\nint main() {\n  int i, l;\n  while (scanf(\"%s\", a) != EOF) \n  {\n    l = strlen(a);\n    printf(\"%s\\n\", a); \n    tag(a, b);\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?') \n      {\n        opr(i);\n      }\n    }\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid fun(char a[]) {\n\n  int len, i, j, n, bi = 0, zuo, you, hao = 0;\n  char b[200];\n  int c[200];\n  len = strlen(a);\n  for (j = 0; j < len; j++) {\n    if (a[j] == '(' || a[j] == ')') {\n      b[bi] = a[j];\n      c[bi] = j;\n      bi += 1;\n    }\n  }\n  for (j = 0; j < bi - 1; j++) {\n    if (b[j] == '(' && b[j + 1] == ')') {\n      zuo = j;\n      you = j + 1;\n      hao = 1;\n      break;\n    }\n  }\n  if (hao == 0)\n    return;\n  while (b[zuo] == '(' && b[you] == ')') {\n    b[zuo] = 1;\n    b[you] = 1;\n    zuo -= 1;\n    you += 1;\n  }\n  for (j = 0; j < bi; j++) {\n    if (b[j] == 1)\n      a[c[j]] = 1;\n  }\n  fun(a);\n}\n\nint main() {\n  int i, n, len, j;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    puts(a);\n    fun(a);\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        printf(\" \");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else if (a[j] == ')')\n        printf(\"?\");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30811", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[100];\n  int z, y, i, j, l, t, m;\n  while (scanf(\"%s \", sen)) {\n    z = 0;\n    y = 0;\n    l = strlen(sen);\n    printf(\"%s \", sen);\n\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        z++;\n      }\n      if (sen[i] == ')') {\n        y++;\n      }\n    }\n    if (z > y) {\n      m = y;\n    } else\n      m = z;\n\n    for (i = 0; i < m; i++) {\n      j = 1;\n      for (t = 0; t < l; t++) {\n        if (sen[t] == '(') {\n          j = 0;\n          z = t;\n        }\n        if (sen[t] == ')') {\n          if (j == 0) {\n            sen[z] = '0';\n            sen[t] = '0';\n          }\n          j = 1;\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        printf(\"$\");\n      } else if (sen[i] == ')') {\n        printf(\"?\");\n      } else if ((sen[i] != '(') && (sen[i] != ')')) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[105];\nint len;\nint f(int b) {\n  for (int i = b + 1; i < len; i++) {\n    if (s[i] == ')') {\n      s[b] = '$';\n      s[i] = '?';\n      return i;\n    } else if (s[i] == '(') {\n      i = f(i);\n    }\n  }\n  return len - 1;\n}\nint main() {\n  while (cin >> s) {\n    len = strlen(s);\n    cout << s << endl;\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        i = f(i);\n    }\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        cout << '$';\n      else if (s[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30813", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[120], a_cout[120] = {0}, b;\n  int num[120] = {0};\n  int i, j, k;\n  while (cin.get(a[0])) {\n    num[0] = 0;\n    for (i = 1; i < 120; i++) {\n      a[i] = 0;\n      num[i] = 0;\n    }\n    for (i = 0;; i++) {\n      if (i != 0)\n        cin.get(a[i]);\n      if (a[i] == '\\n')\n        break;\n      else {\n        if (a[i] == '(') {\n          num[i] = 1;\n        }\n        if (a[i] == ')') {\n          num[i] = 2;\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (a[k] == '(' && num[k] != 0) {\n            num[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      cout << a[j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < i; j++) {\n      if (num[j] == 0)\n        cout << \" \";\n      if (num[j] == 1)\n        cout << \"$\";\n      if (num[j] == 2) {\n        cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint findRight(char s[], int pos, int l) {\n  int t;\n  if (s[pos] == '\\0')\n    return -1;\n  if (s[pos] == '(') {\n    t = findRight(s, pos + 1, l + 1);\n    if (t == -1) {\n      s[pos] = '$';\n      return -1;\n    } else {\n      s[pos] = ' ';\n      return findRight(s, t + 1, l);\n    }\n  } else if (s[pos] == ')') {\n    if (l == 0) {\n      s[pos] = '?';\n      findRight(s, pos + 1, l);\n    } else {\n      s[pos] = ' ';\n      return pos;\n    }\n  } else {\n    s[pos] = ' ';\n    return findRight(s, pos + 1, l);\n  }\n}\nint main() {\n  char s[1000];\n  for (; cin >> s;) {\n    cout << s << '\\n';\n    findRight(s, 0, 0);\n    cout << s << '\\n';\n  }\n}\n"}
{"label": "17", "index": "30815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], t[101];\n  int i, j, k, c, b[101] = {0}, n;\n  for (; cin >> a;) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      t[i] = ' ';\n    }\n    for (i = 0; i <= n; i++) {\n\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 0) {\n            b[i] = 1;\n            b[j] = 1;\n            break;\n          }\n        if (j == -1) {\n          c++;\n          t[i] = '?';\n        }\n      }\n      if (a[i] == '\\0')\n        for (k = 0; k < i; k++) {\n          if (a[k] == '(' && b[k] == 0) {\n            c++;\n            t[k] = '$';\n          }\n        }\n    }\n    cout << a << endl;\n    if (c != 0) {\n      i = 0;\n      while (t[i] == ' ')\n        i++;\n      k = n - 1;\n      while (t[k] == ' ')\n        k--;\n      for (j = i; j <= k; j++)\n        cout << t[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int i, a[101], j, l;\n  while ((scanf(\"%s\", s)) != EOF) {\n    j = 0;\n    puts(s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[++j] = i;\n      else if (s[i] == ')') {\n        if (j) {\n          s[i] = ' ';\n          s[a[j]] = ' ';\n          j--;\n        } else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 1; i <= j; i++)\n      s[a[i]] = '$';\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar p[200], q[200];\nint main() {\n  while (scanf(\"%s\", &p) != EOF) {\n    memset(q, ' ', sizeof(q));\n    int l = strlen(p);\n    q[l] = 0;\n    int t = 0;\n    for (int i = 0; i < l; i++) {\n      if (p[i] == '(')\n        t++;\n      else if (p[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '?';\n      }\n    }\n    t = 0;\n    for (int i = l - 1; i >= 0; i--) {\n      if (p[i] == ')')\n        t++;\n      else if (p[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '$';\n      }\n    }\n    cout << p << endl << q << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char input[101] = {0}, initial[101];\n  int found = 0;\n  while (cin.getline(input, 101)) {\n    strcpy(initial, input);\n    do {\n      found = 0;\n      int i = 0, location = -1;\n      while (input[i]) {\n        if (input[i] == '(') {\n          location = i;\n          found = 1;\n        }\n        if (input[i] == ')') {\n          found = 1;\n          if (location == -1)\n            input[i] = '?';\n          else {\n            input[location] = ' ';\n            input[i] = ' ';\n            location = -1;\n            break;\n          }\n        }\n        if (input[i] != '?' && input[i] != '$' && input[i] != '(' &&\n            input[i] != ')') {\n          input[i] = ' ';\n        }\n        i++;\n      }\n      if (location != -1) {\n        input[location] = '$';\n        location = -1;\n      }\n    } while (found);\n    printf(\"%s\\n%s\\n\", initial, input);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30819", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, num = 1, j;\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      num = 1;\n      if (a[i] != ')' && a[i] != '(')\n        cout << \" \";\n      if (a[i] == '(') {\n        if (a[i + 1] == '\\0') {\n          cout << \"$\";\n          continue;\n        }\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == '(')\n            num++;\n          if (a[j] == ')')\n            num--;\n          if (num == 0) {\n            printf(\" \");\n            break;\n          }\n          if (a[j + 1] == '\\0' && num != 0)\n            cout << \"$\";\n        }\n      }\n      num = 1;\n      if (a[i] == ')') {\n        if (i == 0) {\n          cout << \"?\";\n          continue;\n        }\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == ')')\n            num++;\n          if (a[j] == '(')\n            num--;\n          if (num == 0) {\n            cout << \" \";\n            break;\n          }\n          if (j == 0 && num != 0)\n            printf(\"?\");\n        }\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N;\n  cin >> N;\n  for (int I = 0; I < N; I++) {\n    int i;\n    char in[110];\n    scanf(\"%s \", in);\n\n    cout << in << endl;\n    int n = strlen(in);\n\n    char mark[110];\n    for (i = 0; i < n; i++)\n      mark[i] = ' ';\n\n    int left = 0;\n\n    for (i = 0; i < n; i++) {\n      if (in[i] == '(')\n        left++;\n\n      else if (in[i] == ')') {\n        if (left) {\n          left--;\n        } else {\n          mark[i] = '?';\n        }\n      }\n    }\n\n    int right = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (in[i] == ')')\n        right++;\n\n      else if (in[i] == '(') {\n        if (right) {\n          right--;\n        } else {\n          mark[i] = '$';\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      cout << mark[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int i, len;\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30822", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], s1[200];\n  int i, j;\n  int len;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(s1, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(') {\n            break;\n          }\n        }\n        if (j >= 0) {\n          s[i] = ' ';\n          s[j] = ' ';\n        } else\n          s[i] = '?';\n\n      } else if (s[i] != '(') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n    }\n    puts(s1);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30823", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, l;\n  char c[1000][105] = {0};\n  int k;\n  int a[105] = {0};\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++)\n    scanf(\"%s\", c[i]);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 105; j++)\n      a[j] = 0;\n\n    l = strlen(c[i]);\n    printf(\"%s\\n\", c[i]);\n    for (j = l - 1; j >= 0; j--) {\n      if (c[i][j] == '(') {\n        for (k = j + 1; k < l; k++) {\n          if (c[i][k] == ')') {\n            c[i][k] = 0;\n            c[i][j] = 0;\n            break;\n          }\n        }\n        if (k == l) {\n          c[i][j] = 0;\n          a[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (c[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1)\n        printf(\"$\");\n      else if (a[j] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n = 0, k, p;\n  char a[100][1000], b[1000][1000];\n  for (i = 0; i < 100; i++) {\n    for (k = 0; k < 100; k++) {\n      b[i][k] = ' ';\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    if (a[i][0] == '\\0')\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i]);\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == ')') {\n        for (p = k - 1; p >= 0; p--) {\n          if (a[i][p] == '(') {\n            a[i][p] = '.';\n            a[i][k] = '.';\n            break;\n          } else if (a[i][p] == ')') {\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == '(')\n        b[i][k] = '$';\n      else if (a[i][k] == ')')\n        b[i][k] = '?';\n    }\n    b[i][strlen(a[i])] = '\\0';\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30825", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid match(char *p) {\n  int n = (int)strlen(p);\n  int a[100] = {0};\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    if (p[i] == ')') {\n      for (j = i; j >= 0; j--)\n        if (p[j] == '(') {\n          p[j] = p[i] = 'a';\n          break;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (p[i] == '(')\n      printf(\"$\");\n    else if (p[i] == ')')\n      printf(\"?\");\n    else\n      printf(\" \");\n  printf(\"\\n\");\n}\nint main() {\n  int i = 0, n;\n  cin >> n;\n  while (i < n) {\n    char s[103] = {'\\0'};\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n    match(s);\n    i++;\n  }\n}\n"}
{"label": "17", "index": "30826", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar input[105], output[105]; \n\nvoid f()\n\n{\n\n  memset(output, 0, sizeof(output)); \n\n  int l = 0, r = 0;\n\n  int len = strlen(input);\n\n  int i;\n\n  for (i = 0; i < len; ++i)\n\n  {\n\n    output[i] = ' ';\n\n    if (input[i] == ')')\n\n    {\n\n      if (l <= 0)\n\n        output[i] = '?'; \n\n      else\n\n        l--;\n\n    }\n\n    else if (input[i] == '(')\n\n      l++;\n  }\n\n  l = r = 0;\n\n  for (i = len; i >= 0; --i)\n\n  {\n\n    if (input[i] == '(')\n\n    {\n\n      if (r <= 0)\n\n        output[i] = '$'; \n\n      else\n\n        r--;\n\n    }\n\n    else if (input[i] == ')')\n\n      r++;\n  }\n\n  cout << input << endl;\n\n  cout << output << endl; \n}\nint main() {\n\n  while (cin.getline(input, 105)) {\n\n    f();\n  }\n\n  return 0; \n}\n"}
{"label": "17", "index": "30827", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int i = 0, j = 0;\n  while (cin.getline(str, 110)) {\n    for (i = 0; str[i] != '\\0'; i++) \n    {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; ++i) \n    {\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (str[j] == '(') {\n            str[i] = str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(str); ++i) \n    {\n      if (str[i] == '(')\n        cout << \"$\";\n      else if (str[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  while (cin >> a) {\n    cout << a;\n    cout << endl; \n    int len, i, j;\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) \n    {\n      if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == ')') {\n            a[i] = 'A';\n            a[j] = 'B';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) \n    {\n      if (a[i] == '(')\n        cout << \"$\";\n      else {\n        if (a[i] == ')')\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500] = {0};\n  while (cin.getline(a, 200)) {\n    cout << a << endl;\n    int i, j, l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(')\n        continue;\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30830", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101] = {0};\n  int pro[101] = {0}, j = 0, p = 0, q = 0;\n  while (scanf(\"%s \", str)) {\n    for (int i = 1; i <= strlen(str); i++) {\n      if (str[i - 1] != '(' && str[i - 1] != ')') {\n        pro[i - 1] = 2;\n      }\n      if (str[i - 1] == ')') {\n        pro[i - 1] = 1;\n        for (j = i - 1; j >= 1; j--) {\n          if (str[j - 1] == '(' && pro[j - 1] == 0) {\n            pro[j - 1] = 1;\n            break;\n          }\n        }\n        if (j == 0) {\n          pro[i - 1] = 0;\n        }\n      }\n    }\n    cout << str << endl;\n    for (p = strlen(str); p >= 1; p--) {\n      if (pro[p - 1] == 0) {\n        break;\n      }\n    }\n    for (q = 1; q <= strlen(str); q++) {\n      if (pro[q - 1] == 0) {\n        break;\n      }\n    }\n    for (int k = q; k <= p; k++) {\n      if (str[k - 1] == '(' && pro[k - 1] == 0) {\n        cout << \"$\";\n      } else if (str[k - 1] == ')' && pro[k - 1] == 0) {\n        cout << \"?\";\n      } else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n    for (int clear = 1; clear <= 101; clear++) {\n      str[clear - 1] = 0;\n      pro[clear - 1] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int left = 0, right = 0;\n  int times = 0, i;\n  char s[101];\n  char c[101];\n  char fakes[101];\n\n  for (times = 0; times == 0; i = 0, left = 0, right = 0) {\n    cin >> s;\n    if (strcmp(fakes, s) == 0 && strlen(fakes) == strlen(s)) {\n      break;\n    }\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(') {\n        left++;\n      }\n      if (s[i] == ')' && left > 0) {\n        left--;\n      } else {\n        if (s[i] == ')' && left == 0) {\n          c[i] = '?';\n        }\n      }\n    }\n    for (; i >= 0; i--) {\n      if (s[i] == ')') {\n        right++;\n      }\n      if (s[i] == '(' && right > 0) {\n        right--;\n      } else if (s[i] == '(' && right == 0) {\n        c[i] = '$';\n      }\n    }\n    puts(s);\n    printf(\"\\n\");\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (c[i] == '?' || c[i] == '$') {\n        printf(\"%c\", c[i]);\n        c[i] = 0;\n      } else\n        printf(\" \");\n    }\n    cout << \"\\n\";\n    strcpy(fakes, s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101];\n  int g[100] = {0}, left[100] = {0};\n  int m, n, i, k, sum;\n  while (cin.getline(sen, 101)) {\n    n = strlen(sen);\n    k = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      if (sen[i] == '(') {\n        g[i] = 1;\n        sum++;\n        left[k] = i;\n        k++;\n      } else {\n        if (sen[i] == ')') {\n          if (sum > 0) {\n            sum--;\n            k--;\n            g[left[k]] = 0;\n            g[i] = 0;\n          } else\n            g[i] = -1;\n\n        } else\n          g[i] = 0;\n      }\n    }\n    for (i = n - 1; g[i] == 0; i--) {\n    }\n    n = i;\n    for (i = 0; g[i] == 0; i++) {\n    }\n    m = i;\n    cout << sen << endl;\n    for (i = m; i <= n; i++) {\n      if (g[i] == 1)\n        cout << '$';\n      else {\n        if (g[i] == -1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int temp;\n  while (cin.getline(str, 101, '\\n')) {\n    cout << str << endl;\n    int k, i, s = 0, t = 0;\n    char result[101];\n    int left[101];\n    memset(result, ' ', sizeof(result));\n    k = strlen(str);\n    int p = 0;\n    for (i = 0; i < k; i++) {\n      if (str[i] == '(') {\n        p++;\n        left[s] = i;\n        temp = s;\n        s++;\n      }\n      if ((str[i] == ')') && (p == 0))\n        result[i] = '?';\n      if ((str[i] == ')') && (p != 0)) {\n        p--;\n        left[temp] = -1;\n        do {\n          temp--;\n        } while (left[temp] == -1);\n      }\n    }\n    for (i = 0; i < s; i++) {\n      if (left[i] == -1)\n        continue;\n      else\n        result[left[i]] = '$';\n    }\n    for (i = 0; i < k; i++)\n      cout << result[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30834", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[30][120];\n  int j, n, i, b[30], k, zuo[30][120], you[30][120];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 119; j++) {\n      zuo[i][j] = 0;\n      you[i][j] = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    k = 0;\n\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    for (j = b[i] - 1; j >= 0; j--) {\n\n      if (a[i][j] == '(') {\n        if (k == 0)\n          zuo[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      }\n\n      else if (a[i][j] == ')')\n        k += 1;\n    }\n    k = 0;\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (a[i][j] == ')') {\n        if (k == 0)\n          you[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      } else if (a[i][j] == '(')\n        k += 1;\n    }\n    printf(\"%s\\n\", a[i]);\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (zuo[i][j] == 1)\n        printf(\"$\");\n      else if (you[i][j] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[101] = {0};\nint zuo[101] = {0};\nint n = 0;\nvoid change(int x) {\n  if (a[x] != 0) {\n    if (a[x] == '(') {\n      zuo[++n] = x;\n    } else if (a[x] == ')') {\n      if (n > 0) {\n        a[x] = ' ';\n        a[zuo[n--]] = ' ';\n      }\n    } else\n      a[x] = ' ';\n    change(x + 1);\n  }\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    n = 0;\n    change(0);\n    for (int i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        cout << \"?\";\n      else\n        cout << a[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30836", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[101];\nint l;\nint f(int k) {\n  int i, j;\n  for (i = k; i >= 0; i--)\n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') {\n          s[i] = 'a';\n          s[j] = 'a';\n          k = i;\n          return f(k);\n        }\n    }\n  for (i = 0; i < l; i++) {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      cout << \" \";\n  }\n  cout << endl;\n  return 0;\n}\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    cout << s << endl;\n    f(l - 1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30837", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100] = {0}, d[100] = {0};\n  int l, i, j, s;\n  while (scanf(\"%s\", c) != EOF) {\n    l = strlen(c);\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        d[i] = '$';\n      else if (c[i] == ')') {\n        d[i] = '?';\n        for (j = i - 1, s = 1; j >= 0 && s == 1; j--) {\n          if (d[j] == '$') {\n            d[j] = d[i] = ' ';\n            s = 0;\n          }\n        }\n      } else\n        d[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      printf(\"%c\", c[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      printf(\"%c\", d[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30838", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[101];\nint find(char a[], int b, int x) {\n  int i;\n  for (i = b; i < x; i++) {\n    if (a[i + 1] == '$')\n      return 0;\n\n    if (a[i + 1] == '?') {\n      a[i + 1] = ' ';\n      a[b] = ' ';\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin.getline(a, 101)) {\n\n    int x = strlen(a), i, l[100], t = 0, temp;\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < x; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n        l[t] = i;\n        t++;\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; (i < t) && (i >= 0);) {\n      if (a[l[i]] == ' ') {\n        i++;\n        continue;\n      }\n      temp = find(a, l[i], x);\n      if (temp == 0)\n        i++;\n      if (temp == 1) {\n        i = 0;\n        continue;\n      }\n    }\n    for (i = 0; i < x; i++) {\n      cout << a[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[100], s[100];\n\nvoid match(int x) {\n  int i;\n  for (i = x - 1; i >= 0; --i)\n    if (s[i] == '$') {\n      s[x] = ' ';\n      s[i] = ' ';\n      break;\n    }\n}\n\nint main() {\n  int i, l;\n  while (cin >> str) {\n    l = strlen(str);\n    s[l] = '\\0';\n    for (i = 0; i < l; ++i)\n      s[i] = ' ';\n    printf(\"%s\\n\", str);\n    for (i = 0; i < l; ++i)\n      switch (str[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        match(i);\n        break;\n      }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30840", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[100][100];\nint main() {\n  int k = 1;\n  while (1) {\n    cin >> a[k];\n    cout << a[k];\n    printf(\"\\n\");\n    for (int i = 0; i < strlen(a[k]); i++)\n      if (a[k][i] != '(' && a[k][i] != ')')\n        a[k][i] = ' ';\n    for (int i = 0; i < strlen(a[k]) - 1; i++) {\n      int sum = 1;\n      if (a[k][i] == '(') {\n        for (int j = i + 1; j < strlen(a[k]); j++) {\n          if (a[k][j] == '(')\n            sum++;\n          if (a[k][j] == ')')\n            sum--;\n          if (sum == 0) {\n            a[k][i] = ' ';\n            a[k][j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a[k]); i++) {\n      if (a[k][i] == '(')\n        a[k][i] = '$';\n      if (a[k][i] == ')')\n        a[k][i] = '?';\n      cout << a[k][i];\n    }\n    cout << endl;\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[120], a_cout[120] = {0}, b;\n  int num[120] = {0};\n  int i, j, k;\n  while (cin.get(a[0])) {\n    num[0] = 0;\n    for (i = 1; i < 120; i++) {\n      a[i] = 0;\n      num[i] = 0;\n    }\n    for (i = 0;; i++) {\n      if (i != 0)\n        cin.get(a[i]);\n      if (a[i] == '\\n')\n        break;\n      else {\n        if (a[i] == '(') {\n          num[i] = 1;\n        }\n        if (a[i] == ')') {\n          num[i] = 2;\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (a[k] == '(' && num[k] != 0) {\n            num[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      cout << a[j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < i; j++) {\n      if (num[j] == 0)\n        cout << \" \";\n      if (num[j] == 1) {\n        cout << \"$\";\n      }\n      if (num[j] == 2) {\n        cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, p, i, j, len;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    char a[150];\n    scanf(\"%s\", a);\n    len = strlen(a);\n    char b[150];\n    for (i = 0; a[i] != 0; i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = '$';\n        break;\n      case ')':\n        b[i] = '?';\n        break;\n      default:\n        b[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[300];\nint main() {\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (i = 0; i < len; i++) {\n      int b = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = ' ';\n            str[i] = ' ';\n            b = 1;\n            break;\n          }\n        }\n        if (b == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      if (str[i] == ')')\n        str[i] = '?';\n    }\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "30844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void match(char a[]);\n  int signal = 1;\n  int i;\n  char s[101], s1[101] = \"\";\n\n  cin >> s;\n  while (signal) {\n    match(s);\n    strcpy(s1, s);\n    scanf(\"%s\", s);\n    if (strcmp(s, s1) == 0)\n      signal = 0;\n  }\n\n  return 0;\n}\n\nvoid match(char a[]) {\n  int i, j, k, len;\n  int f1 = 0, f2 = 0, f3 = 1;\n  len = strlen(a);\n  if (len != 0)\n    printf(\"%s \", a);\n  do {\n    if (len != 0) {\n      f1 = 0;\n      f2 = 0;\n      f3 = 1;\n      for (i = len - 1; i >= 0; i--) {\n        if (a[i] == '(') {\n          f1 = 1;\n          for (j = i + 1; a[j]; j++) {\n            if (a[j] == ')') {\n              f2 = 1;\n              a[j] = '0';\n              a[i] = '0';\n              break;\n            }\n          }\n          if (f2 == 0)\n\n            a[i] = '1';\n        }\n        if (f1 == 1)\n          break;\n      }\n      if (f1 == 0) {\n        for (i = 0; a[i]; i++) {\n          if (a[i] == ')')\n            a[i] = '2';\n        }\n      }\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          f3 = 0;\n          break;\n        }\n      }\n    }\n  } while (f3 == 0);\n  for (i = 0; a[i]; i++) {\n    if (a[i] == '1')\n      printf(\"$\");\n    else if (a[i] == '2')\n      printf(\"?\");\n    else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "30845", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], s;\n  int i, j, k, l, m, n, t, b[100], c[100];\n  for (;;) {\n\n    cin >> a;\n    if (a[0] == ' ')\n      break;\n    n = strlen(a);\n    for (i = 0, j = 0, k = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[j] = i;\n        j++;\n      } else if (a[i] == ')') {\n        c[k] = i;\n        k++;\n      }\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (l = j - 1; l >= 0; l--) {\n        if (b[l] == i) {\n          for (t = 0; t < k; t++) {\n            if (c[t] > i) {\n              b[l] = -1;\n              c[t] = -1;\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < n; i++) {\n      for (l = 0; l < j; l++) {\n        if (b[l] == i) {\n          printf(\"$\");\n          break;\n        }\n      }\n      if (l != j)\n        continue;\n      for (t = 0; t < k; t++) {\n        if (c[t] == i) {\n          printf(\"?\");\n          break;\n        }\n      }\n      if (t != k)\n        continue;\n      cout << \" \";\n    }\n\n    printf(\" \");\n    a[0] = ' ';\n  }\n}\n"}
{"label": "17", "index": "30846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    cout << b[i] << endl;\n  }\n  return 0;\n}\nint count(int m) \n{\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\n\nint match(int k) \n{\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pro(char *s) {\n  char a[444];\n  char *p;\n  int i, j, k, t;\n  i = -1;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(') {\n      i++;\n      a[i] = *p;\n    } else if (*p == ')') {\n      j = i;\n      while ((j >= 0) && (a[j] != '('))\n        j--;\n      if (j == -1) {\n        i++;\n        a[i] = *p;\n      } else {\n        a[j] = ' ';\n        i++;\n        a[i] = ' ';\n      }\n    } else {\n      i++;\n      a[i] = ' ';\n    }\n    p++;\n  }\n\n  a[i + 1] = '\u0000';\n  strcpy(s, a);\n}\n\nvoid print(char *s) {\n  char *p;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(')\n      *p = '$';\n    else if (*p == ')')\n      *p = '?';\n    p++;\n  }\n  puts(s);\n}\nint main() {\n  int l;\n  char s[323];\n  \n  \n\n  cin >> s;\n  while (s[0] != '\u0000') {\n\n    puts(s);\n    pro(s);\n    print(s);\n    s[0] = '\u0000';\n\n    cin >> s;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar s[1000];\nint dp[1000];\nint main(void) {\n\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  while (scanf(\"%s\", s) == 1) {\n    memset(dp, 0, sizeof(dp));\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        dp[i] = -1;\n      if (s[i] == ')')\n        dp[i] = 1;\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(' && dp[j] == -1) {\n            dp[i] = 0;\n            dp[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < n; i++) {\n      if (dp[i] == -1)\n        printf(\"$\");\n      else if (dp[i] == 1)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char s[101], zhui = '#';\n    int count[101] = {0};\n    int i = 0, j = 0, sl = 0;\n    for (i = 0; i < 101; i++) {\n      s[i] = '#';\n    }\n\n    cin.getline(s, 101);\n    sl = strlen(s);\n    if (s[0] == '\\0') {\n      break;\n    }\n\n    for (i = 0; i < sl; i++) {\n      if (s[i] == '(') {\n        count[i] = 1;\n      } else if (s[i] == ')') {\n        count[i] = 2;\n      } else {\n        continue;\n      }\n    }\n\n    for (i = sl - 1; i >= 0; i--) {\n      if (count[i] == 1) {\n        for (j = i + 1; j < sl; j++) {\n          if (count[j] == 2) {\n            count[i] = 0;\n            count[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n\n    int dingzuo[101] = {0};\n    int dingyou[101] = {0};\n    int flag = 0;\n    int count0 = 0;\n    for (i = 0; i < sl; i++) {\n      if (count[i] == 1) {\n        dingzuo[i] = 1;\n        flag = 1;\n        count0++;\n      } else if (count[i] == 2) {\n        dingyou[i] = 1;\n        flag = 1;\n        count0++;\n      } else {\n        continue;\n      }\n    }\n\n    int k = count0;\n    for (i = 0; i < sl; i++) {\n      cout << s[i];\n    }\n    if (flag == 1) {\n      cout << endl;\n      for (i = 0; i < sl; i++) {\n        if (dingzuo[i] == 1) {\n          cout << \"$\";\n          count0--;\n        } else if (dingyou[i] == 1) {\n          cout << \"?\";\n          count0--;\n        } else {\n          if ((count0 > 0) && (count0 < k)) {\n            cout << \" \";\n          }\n        }\n      }\n      cout << endl;\n    } else {\n      cout << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar c[120], ch;\nint n;\nint search(int p) \n{\n  int q = p + 1;\n  if (q >= n)\n    return q;\n  while ((c[q] != '?') && (q < n)) {\n    if (c[q] == '$')\n      q = search(q) + 1;\n    else\n      q++;\n  }\n  if (q < n) {\n    c[p] = ' ';\n    c[q] = ' ';\n  }\n  return q;\n}\nint main() {\n  int i = 0;\n  while (cin >> ch) {\n    cout << ch;\n    n = 0;\n    i = 0;\n    while (ch != '\\n') {\n      if (ch == '(')\n        c[n] = '$';\n      else {\n        if (ch == ')')\n          c[n] = '?';\n        else\n          c[n] = ' ';\n      }\n      n++;\n      cin.get(ch);\n      cout << ch;\n    }\n    while (i < n) {\n      while ((c[i] != '$') && (i < n))\n        i++;\n      i = search(i) + 1;\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30851", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid match(char *p) {\n  int n = (int)strlen(p);\n\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    if (p[i] == ')') {\n      for (j = i; j >= 0; j--)\n        if (p[j] == '(') {\n          p[j] = p[i] = 'a';\n          break;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (p[i] == '(')\n      printf(\"$\");\n    else if (p[i] == ')')\n      printf(\"?\");\n    else\n      printf(\" \");\n  printf(\"\\n\");\n}\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    char s[103] = {'\\0'};\n    cin >> s;\n    printf(\"%s\\n\", s);\n    match(s);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30852", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char s[1000];\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    k = strlen(s);\n    for (i = 0; i < k; ++i) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (s[j] == '(') {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < k; ++i) {\n      if (s[i] == '(')\n        cout << \"$\";\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar use[150], rem[150];\nint len;\nvoid rid(int begin, int end);\nint main() {\n  while (1) {\n    char s;\n    int i = 0;\n    while ((s = cin.get()) != '\\n') {\n      use[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    len = i - 1;\n    rid(0, len);\n    for (int j = 0; j <= len; j++)\n      if (use[j] == '(')\n        use[j] = '$';\n      else if (use[j] == ')')\n        use[j] = '?';\n      else {\n        if (use[j] != '?' && use[j] != '$')\n          use[j] = ' ';\n      }\n\n    for (i = 0; i <= len; i++)\n      cout << rem[i];\n    cout << endl;\n    for (i = 0; i <= len; i++)\n      cout << use[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n\nvoid rid(int begin, int end) {\n  if (begin <= end) {\n    if (use[begin] != ')')\n      rid(begin + 1, end);\n    else {\n      int i = begin;\n      while (use[i] != '(' && i >= 0)\n        i--;\n      if (i == -1) {\n        use[begin] = '?';\n        rid(begin + 1, end);\n      } else\n        for (int j = i; j <= begin; j++) {\n          use[j] = ' ';\n          rid(begin + 1, end);\n        }\n    }\n  }\n}\n"}
{"label": "17", "index": "30854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[1000], b[1000];\n  int i, j, k, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%s\", &a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      } else {\n        b[j] = a[j];\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        for (k = j + 1; k < strlen(a); k++) {\n          if (b[k] == '(') {\n            e++;\n          } else if (b[k] == ')' && e == 0) {\n            b[k] = ' ';\n            b[j] = ' ';\n            e++;\n          }\n        }\n        e = 0;\n      }\n\n      else if (b[j] == ')') {\n        e = 0;\n        k = j - 1;\n        for (k = j - 1; k > 0; k--) {\n          if (b[k] == '(') {\n            b[k] = ' ';\n            b[j] = ' ';\n            k = 0;\n            e = 1;\n          }\n        }\n        if (e == 0 && b[0] == '(') {\n          b[0] = ' ';\n          b[j] = ' ';\n        }\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        b[j] = '$';\n      } else if (b[j] == ')') {\n        b[j] = '?';\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", a[j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30855", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf[106];\n  while (1) {\n    memset(zf, '\u0000', sizeof(zf));\n\n    scanf(\"%s \", zf);\n    if (zf[0] == '\u0000')\n      break;\n    puts(zf);\n    for (int i = 0; i < strlen(zf); i++) {\n      if (zf[i] == ')') {\n        for (int j = i; j >= 0; j--) {\n          if (zf[j] == '(') {\n            zf[j] = ' ';\n            zf[i] = ' ';\n            break;\n          }\n        }\n      } else if (zf[i] != '(') {\n        zf[i] = ' ';\n      }\n    }\n    for (int t = 0; t < strlen(zf); t++) {\n      if (zf[t] == '(') {\n        zf[t] = '$';\n      } else if (zf[t] == ')') {\n        zf[t] = '?';\n      }\n    }\n    puts(zf);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar p[200], q[200];\nint main() {\n  while (scanf(\"%s\", &p) != EOF) {\n    memset(q, ' ', sizeof(q));\n    int l = strlen(p);\n    q[l] = 0;\n    int t = 0;\n    for (int i = 0; i < l; i++) {\n      if (p[i] == '(')\n        t++;\n      else if (p[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '?';\n      }\n    }\n    t = 0;\n    for (int i = l - 1; i >= 0; i--) {\n      if (p[i] == ')')\n        t++;\n      else if (p[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '$';\n      }\n    }\n    printf(\"%s\\n%s\\n\", p, q);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int zuo[110] = {0}, z = 0;\n    int you[110] = {0}, y = 0;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        zuo[z++] = i;\n      if (a[i] == ')')\n        you[y++] = i;\n    }\n    for (int i = 0; i < y; i++) {\n      for (int j = z - 1; j >= 0; j--) {\n        if (zuo[j] < you[i]) {\n          zuo[j] = 200;\n          you[i] = -100;\n          break;\n        }\n      }\n    }\n    for (int j = 0; j < strlen(a); j++) {\n      a[j] = ' ';\n    }\n    for (int j = 0; j < z; j++) {\n      if (zuo[j] != 200)\n        a[zuo[j]] = '$';\n    }\n    for (int j = 0; j < y; j++) {\n      if (you[j] != -100)\n        a[you[j]] = '?';\n    }\n\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[120];\nint len = 0;\n\nvoid bracket(int i) {\n  if (i < 0)\n    return;\n  if (a[i] != '(')\n    bracket(i - 1);\n  if (a[i] == '(') {\n    for (int k = i; k < len; k++) {\n      if (a[k] == ')') {\n        a[i] = 'x';\n        a[k] = 'x';\n        break;\n      }\n    }\n    bracket(i - 1);\n  }\n}\n\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    len = strlen(a);\n    bracket(len - 1);\n    for (int k = 0; k < len; k++) {\n      if (a[k] == '(')\n        cout << \"$\";\n      else if (a[k] == ')')\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << endl;\n    for (int i = 0; i < 120; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint brackets_matching(char str[], char result[], int n, int j)\n\n{\n  int i, p;\n  for (i = j; str[i]; i++) {\n    switch (str[i]) {\n    case '(':\n      p = brackets_matching(str, result, n + 1, i + 1);\n      if (str[p] == ')')\n        result[i] = ' ';\n      else\n        result[i] = '$';\n      i = p;\n      break;\n\n    case ')':\n      if (!n)\n        result[i] = '?';\n      else {\n        result[i] = ' ';\n        return i;\n      }\n      break;\n\n    default:\n      result[i] = ' ';\n    }\n  }\n  result[i] = 0;\n  return i;\n}\n\nint main() {\n  char a[1000], result[1000];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    brackets_matching(a, result, 0, 0);\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[200];\nint findpair(int i, int j) {\n  int temp;\n  if (a[i] == '\\0')\n    return -1;\n  else if (a[i] == '(') {\n    temp = findpair(i + 1, j + 1);\n    if (temp == -1) {\n      a[i] = '$';\n      return -1;\n    } else {\n      a[i] = ' ';\n      return findpair(temp + 1, j);\n    }\n  } else if (a[i] == ')') {\n    if (j == 0) {\n      a[i] = '?';\n      return findpair(i + 1, j);\n    } else {\n      a[i] = ' ';\n      return i;\n    }\n  } else if (a[i] == ' ')\n    return (findpair(i + 1, j));\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    for (int i = 0; i <= (int)strlen(a) - 1; ++i)\n      if (a[i] != ')' && a[i] != '(' && a[i] != '\\0')\n        a[i] = ' ';\n    findpair(0, 0);\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30861", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    cout << b;\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, length;\n  int i;\n  while (cin.getline(line, sizeof(line))) {\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    pos_i = -1, left = 0, right = 0;\n    length = strlen(line);\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos_i++;\n        pos[pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (right >= left)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[length] = '\\0';\n    cout << line << \"\\n\";\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[101] = {0};\nint zuo[101] = {0};\nint n = 0;\nvoid change(int x) {\n  if (a[x] != 0) {\n    if (a[x] == '(') {\n      zuo[++n] = x;\n    } else if (a[x] == ')') {\n      if (n > 0) {\n        a[x] = ' ';\n        a[zuo[n--]] = ' ';\n      }\n    } else\n      a[x] = ' ';\n    change(x + 1);\n  }\n}\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    n = 0;\n    change(0);\n    for (int i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        cout << \"?\";\n      else\n        cout << a[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30864", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint match(int i);\nchar str[101];\nint n;\nint main() {\n  while (cin >> str) {\n    cout << str << endl;\n    n = strlen(str);\n    match(0);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(')\n    str[i] = '$';\n  else {\n    str[i] = ' ';\n  }\n\n  match(i + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "30865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid right(int i, int j) {\n  if (s[i] == '\\0')\n    ;\n  else if (s[i] == '(') {\n    s[i] = '$';\n    right(i + 1, j + 1);\n  } else if (s[i] == ')') {\n    if (j == 0) {\n      s[i] = '?';\n      right(i + 1, j);\n    } else {\n      for (int k = i;; k--)\n        if (s[k] == '$') {\n          s[k] = ' ';\n          break;\n        }\n      s[i] = ' ';\n      right(i + 1, j - 1);\n    }\n  } else {\n    s[i] = ' ';\n    right(i + 1, j);\n  }\n}\nint main() {\n  for (; scanf(\"%s \", s);) {\n    cout << s << endl;\n    right(0, 0);\n    cout << s << endl;\n  }\n}\n"}
{"label": "17", "index": "30866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[101], t, n, i, j;\n  char a[101];\n  while (scanf(\"%s \", a)) {\n    for (i = 0; i < 101; i++)\n      b[i] = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        t = -1;\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '(') {\n            t--;\n          }\n          if (a[j] == ')') {\n            t++;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 1;\n      }\n      if (a[i] == ')') {\n        t = -1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            t++;\n          }\n          if (a[j] == ')') {\n            t--;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 2;\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      if (b[i] == 1)\n        printf(\"$\");\n      if (b[i] == 2)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid braket_match(char *s);\nint main() {\n  int n, i;\n  char tmp[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> tmp;\n    braket_match(tmp);\n  }\n  return 0;\n}\nvoid braket_match(char *s) {\n  printf(\"%s \", s);\n  int j, left[1000] = {-1, -1}, left_num = 0, left0 = 1, right[1000] = {-1, -1},\n         right_num = 0, right0 = 1, LEN = strlen(s);\n  for (j = 0; j < LEN; j++) {\n    if (s[j] == '(')\n      left[++left_num] = j;\n    else if (s[j] == ')' && left_num == 0)\n      right[++right_num] = j;\n    else if (s[j] == ')' && left_num > 0)\n      left[left_num--] = -1;\n  }\n  for (j = 0; j < LEN; j++) {\n    if (j == left[left0]) {\n      printf(\"$\");\n      left0++;\n    } else if (j == right[right0]) {\n      printf(\"?\");\n      right0++;\n    } else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "30868", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101];\n  int i, l, n, x, j, r;\n  int le[101] = {0}, ri[101] = {0};\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < 100; i++) {\n      le[i] = 0;\n      ri[i] = 0;\n    }\n    cin >> s;\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        le[i] = 1;\n      if (s[i] == ')')\n        ri[i] = 1;\n    }\n    for (i = l - 1; i >= 0; i--) {\n      if (le[i] == 1) {\n        for (j = i; j < l; j++) {\n          if (ri[j] == 1) {\n            ri[j] = 0;\n            le[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < l; i++) {\n      if (ri[i] == 1)\n        printf(\"?\");\n      if (le[i] == 1)\n        printf(\"$\");\n      if (ri[i] == 0 && le[i] == 0)\n        cout << \" \";\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30869", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[100][100], str2[100][100] = {'\\0'};\n  int i, j, k, l1, l2, t[100], l;\n  for (i = 0; i < 100; i++) {\n    cin >> str1[i];\n    k = strlen(str1[i]);\n    if (k == 0)\n      break;\n    puts(str1[i]);\n    l1 = 0;\n    l2 = 0;\n    for (j = 0; j < k; j++) {\n      if (str1[i][j] == ')') {\n        t[l2] = j;\n        l2++;\n      }\n    }\n    for (l = 0; l < l2; l++) {\n      for (j = t[l]; j >= 0; j--) {\n        if (str1[i][j] == '(') {\n          str1[i][t[l]] = 'A';\n          str1[i][j] = 'A';\n          break;\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (str1[i][j] == '(')\n        str2[i][j] = '$';\n      else if (str1[i][j] == ')')\n        str2[i][j] = '?';\n      else\n        str2[i][j] = ' ';\n    }\n    puts(str2[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30870", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  while (1) {\n    char str1[100], str2[100];\n\n    cin >> str1;\n\n    if (feof(stdin))\n      break;\n\n    puts(str1);\n\n    int k, n = strlen(str1), left[100], right[100], l = 0, r = 0;\n    for (k = 0; k <= n - 1; k++) {\n      if (str1[k] == '(') {\n        left[l] = k;\n        l++;\n      } else if (str1[k] == ')') {\n        right[r] = k;\n        r++;\n      } else\n        str2[k] = ' ';\n    }\n    left[l] = 100;\n    right[r] = 100;\n    str2[n] = '\u0000';\n\n    int i, j, x = 1, y = 1;\n    for (i = l - 1; i >= 0; i--) {\n      int p = 0;\n      while (right[p] < left[i])\n        p++;\n      if (x > (r - p))\n        str2[left[i]] = '$';\n      else {\n        str2[left[i]] = ' ';\n        x++;\n      }\n    }\n    for (j = 0; j <= r - 1; j++) {\n      int q = 0;\n      while (left[q] < right[j])\n        q++;\n      if (y > q)\n        str2[right[j]] = '?';\n      else {\n        str2[right[j]] = ' ';\n        y++;\n      }\n    }\n\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30871", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char c[101];\n  int rr, lr, ll, rl;\n  for (; (scanf(\"%s\", c)) != EOF;) {\n    printf(\"%s\\n\", c);\n    char p[101];\n    int i, l;\n    rr = 0;\n    rl = 0;\n    ll = 0;\n    lr = 0;\n    for (l = 0; c[l] != 0; l++) {\n      p[l] = ' ';\n    }\n    p[l] = '\\0';\n    for (i = 0; c[i] != 0; i++) {\n      if (c[i] == '(') {\n        ll = ll + 1;\n      }\n      if (c[i] == ')') {\n        lr = lr + 1;\n        if (ll < lr) {\n          p[i] = '?';\n          lr = lr - 1;\n        }\n      }\n    }\n    for (i = l - 1; i >= 0; i = i - 1) {\n      if (c[i] == ')') {\n        rr = rr + 1;\n      }\n      if (c[i] == '(') {\n        rl = rl + 1;\n        if (rr < rl) {\n          p[i] = '$';\n          rl = rl - 1;\n        }\n      }\n    }\n    printf(\"%s\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  while (cin.getline(str, 101, '\\n')) {\n    char k[101] = {0}, ts[101] = {0};\n    int i, t, num[101] = {0}, temp = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      k[i] = ' ';\n      ts[i] = str[i];\n      if (str[i] == '(')\n        temp++;\n      if (str[i] == ')')\n        temp--;\n      if (temp < 0) {\n        k[i] = '?';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    t = i - 1;\n    temp = 0;\n    for (i = t; i >= 0; i--) {\n      if (str[i] == ')')\n        temp++;\n      if (str[i] == '(')\n        temp--;\n      if (temp < 0) {\n        k[i] = '$';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    printf(\"%s\\n%s\\n\", ts, k);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30873", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main(int argc, char *argv[]) {\n  char s[100];\n  int i, j;\n\n  while (scanf(\"%s\", s) != EOF) {\n    puts(s);\n    int a[100] = {0};\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        a[i] = -1;\n      else if (s[i] == ')')\n        a[i] = 1;\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1) {\n            a[i] = a[j] = 0;\n            break;\n          }\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        printf(\"?\");\n      else if (a[i] == -1)\n        printf(\"$\");\n      else if (a[i] == 0)\n        printf(\" \");\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[100];\nchar a[100];\nint b[100];\nint num = 0;\nint i, j;\nvoid f() {\n  for (i = 0; i < strlen(s); i++)\n    a[i] = ' ';\n\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      b[num] = i;\n      a[i] = '$';\n      num++;\n\n    } else if (s[i] == ')' && num > 0) {\n      num--;\n      a[b[num]] = ' ';\n\n    } else if (s[i] == ')' && num <= 0)\n      a[i] = '?';\n  }\n  for (i = 0; i < strlen(s); i++) {\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    num = 0;\n    cout << s << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid change(char str[]) {\n  int n, i;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == '(')\n      str[i] = '$';\n    else if (str[i] == ')')\n      str[i] = '?';\n    else\n      str[i] = ' ';\n  }\n}\nvoid match(char str[]) {\n  int n, i, k;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == ')') {\n      for (k = i; k >= 0; k--) {\n        if (str[k] == '(') {\n          str[k] = ' ';\n          str[i] = ' ';\n          k = -1;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a, string[100];\n  while (cin >> string) {\n    puts(string);\n    match(string);\n    change(string);\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n  int pp = 2;\n  int ww = 0;\n  for (int pa = 10; pa <= pp + 9; pa++) {\n    for (int i = 1; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    if (a[1] == '(' && a[2] == ')' && ww == 0) {\n      pa = pa - 4;\n      ww = 1;\n    }\n    if (a[1] == '(' && a[3] == ')' && ww == 0) {\n      pa = pa - 3;\n      ww = 1;\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        cout << \" \";\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint brackets_matching(char str[], char result[], int n, int j)\n\n{\n  int i, p;\n  for (i = j; str[i]; i++) { \n    switch (str[i]) {\n    case '(':                                           \n      p = brackets_matching(str, result, n + 1, i + 1); \n      if (str[p] == ')')                                \n        result[i] = ' ';                                \n      else\n        result[i] = '$'; \n      i = p;\n      break;\n\n    case ')': \n      if (!n) \n        result[i] = '?';\n      else {\n        result[i] = ' ';\n        return i;\n      }\n      break;\n\n    default:\n      result[i] = ' ';\n    }\n  }\n  result[i] = 0;\n  return i;\n}\n\nint main() {\n  char a[1000], result[1000];\n  while (cin >> a) {\n    cout << a << endl;\n    brackets_matching(a, result, 0, 0);\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, flag = 0;\n  char s[1000] = {\"\"};\n  cin >> s;\n  while ((s[0] >= 'a' && s[0] <= 'z') || (s[0] >= 'A' && s[0] <= 'Z') ||\n         s[0] == '(' || s[0] == ')') {\n\n    printf(\"%s \", s);\n    n = strlen(s);\n    for (i = n - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (s[j] == ')') {\n            s[i] = 'a';\n            s[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(' || s[i] == ')') {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      for (i = 0; i < n; i++)\n        printf(\"%c\", ' ');\n      printf(\" \");\n    } else {\n      for (i = 0; i < n; i++) {\n        if (s[i] == '(')\n          printf(\"%c\", '$');\n        else if (s[i] == ')')\n          printf(\"%c\", '?');\n        else\n          cout << ' ';\n      }\n      printf(\" \");\n    }\n    s[0] = '\u0000';\n    scanf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char chn[120];\n  int i, l;\n  int z, t;\n  char a, b;\n  while (scanf(\"%s\", chn) != -1) {\n    l = strlen(chn);\n    printf(\"%s\\n\", chn);\n    while (1) {\n      z = -1;\n      t = 0;\n      for (i = 0; i < l; i++) {\n        if (z == -1 && chn[i] == '(')\n          z = i;\n        else if (z >= 0 && chn[i] == ')') {\n          chn[z] = ' ';\n          chn[i] = ' ';\n          t++;\n          break;\n        } else if (z >= 0 && chn[i] == '(')\n          z = i;\n      }\n      if (!t)\n        break;\n    }\n    for (i = 0; i < l; i++) {\n      if (chn[i] == '(')\n        chn[i] = '$';\n      else if (chn[i] == ')')\n        chn[i] = '?';\n      else\n        chn[i] = ' ';\n      printf(\"%c\", chn[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30880", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101];\n  int g[100] = {0}, left[100] = {0};\n  int m, n, i, k, sum;\n  while (cin.getline(sen, 101)) {\n    n = strlen(sen);\n    k = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      if (sen[i] == '(') {\n        g[i] = 1;\n        sum++;\n        left[k] = i;\n        k++;\n      } else {\n        if (sen[i] == ')') {\n          if (sum > 0) {\n            sum--;\n            k--;\n            g[left[k]] = 0;\n            g[i] = 0;\n          } else {\n            g[i] = -1;\n          }\n        } else\n          g[i] = 0;\n      }\n    }\n    for (i = n - 1; g[i] == 0; i--) {\n    }\n    n = i;\n    for (i = 0; g[i] == 0; i++) {\n    }\n    m = i;\n    cout << sen << endl;\n    for (i = m; i <= n; i++) {\n      if (g[i] == 1)\n        printf(\"$\");\n      else {\n        if (g[i] == -1) {\n          cout << '?';\n        } else\n          cout << ' ';\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], mark[101];\n  int locate[101], left = 0, right = 0, count = -1, len, i;\n  while (cin.getline(line, 101)) {\n    count = -1;\n    left = 0;\n    right = 0;\n    len = strlen(line);\n    memset(mark, ' ', sizeof(mark));\n    memset(locate, 0, sizeof(locate));\n    for (i = 0; line[i] != '\\0'; i++) {\n\n      if (line[i] == '(') {\n        left++;\n        locate[++count] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right) {\n          mark[i] = '?';\n        } else {\n          right++;\n          count--;\n        }\n      }\n    }\n    if (count >= 0) {\n      for (i = 0; i <= count; i++)\n        mark[locate[i]] = '$';\n    }\n    mark[len] = '\\0';\n    cout << line << endl;\n    cout << mark << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30882", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[103], temp[103];\nint len;\nint match(int x) {\n  int y;\n  if (x == len)\n    return x;\n  if (str[x] == '(')\n    y = match(x + 1);\n  else if (str[x] == ')')\n    return x;\n  else\n    return match(x + 1);\n  if (y == len) {\n    temp[x] = '$';\n    return y;\n  } else\n    return match(y + 1);\n}\nint main() {\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    len = strlen(str);\n    int z = 0;\n    memset(temp, ' ', sizeof(temp));\n    while (z != len) {\n      z = match(z);\n      if (z != len) {\n        temp[z] = '?';\n        z++;\n      }\n    }\n    for (int i = 0; i < len; i++)\n      cout << temp[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[201], done[201];\n  int pos[200];\n  int left, right;\n  int i, count, len;\n  while (cin.getline(sen, 200)) {\n    count = 0;\n    left = 0;\n    right = 0;\n    for (i = 0; i < 200; i++) {\n      done[i] = ' ';\n    }\n    len = strlen(sen);\n    for (i = 0; i < len; i++) {\n      if (sen[i] == '(') {\n        pos[count] = i;\n        done[pos[count]] = '$';\n        left++;\n        count++;\n      }\n      if (sen[i] == ')') {\n        if (left <= right) {\n          done[i] = '?';\n        } else {\n          right++;\n          done[pos[count - 1]] = ' ';\n          count--;\n        }\n      }\n    }\n    printf(\"%s\\n\", sen);\n    for (i = 0; i < len; i++) {\n      cout << done[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, len, n, left = 0, right = 0, k;\n  char a[10][101] = {\"\u0000\"};\n  int b[10][101] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == '(') {\n        b[i][j] = -1;\n        left++;\n      }\n      if (a[i][j] == ')') {\n        b[i][j] = 1;\n        right++;\n      }\n    }\n\n    for (j = 0; left != 0, right != 0, j < len; j++) {\n      if (b[i][j] == 1) {\n\n        for (k = j - 1; k >= 0; k--) {\n          if (b[i][k] == -1) {\n            b[i][k] = 0;\n            b[i][j] = 0;\n            left--;\n            right--;\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    puts(a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (b[i][j] == -1)\n        cout << \"$\";\n      if (b[i][j] == 1)\n        printf(\"?\");\n      if (b[i][j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500] = {0};\n  while (cin.getline(a, 200)) {\n    cout << a << endl;\n    int i, j, l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(')\n        continue;\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[105];\n  int mm;\n  scanf(\"%d\", &mm);\n  while (mm--) {\n    while (cin >> a) {\n      int n = strlen(a);\n      int i = 0, j, b[105];\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(') {\n          b[i] = 1;\n        } else if (a[i] == ')') {\n          b[i] = -1;\n        } else\n          b[i] = 0;\n      } \n      for (i = 0; i < n; i++) {\n        if (b[i] == -1) {\n          for (j = i; j >= 0; j--) {\n            if (b[j] == 1) {\n              b[i] = 0;\n              b[j] = 0;\n              break;\n            }\n          }\n        }\n      }\n      puts(a);\n      printf(\" \");\n      for (i = 0; i < n; i++) {\n        if (b[i] == 0)\n          printf(\" \");\n        else if (b[i] == 1)\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30887", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, k, l, len[20];\n  char a[20][101], b[50][101] = {' '};\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++) {\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n  }\n  for (k = 1; k <= num; k++) {\n    for (i = 0; i < len[k]; i++) {\n      if (a[k][i] == '(')\n        b[k][i] = '$';\n      else if (a[k][i] == ')')\n        b[k][i] = '?';\n      else\n        b[k][i] = ' ';\n    }\n    for (i = 0; i < len[k] - 1; i++) {\n      if (b[k][i] == '$') {\n        for (j = i + 1; j < len[k]; j++) {\n          if (b[k][j] == '?') {\n            for (l = j - 1; l >= i; l--) {\n              if (b[k][l] == '$') {\n                b[k][l] = ' ';\n                b[k][j] = ' ';\n                break;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", a[k][i]);\n    printf(\" \");\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", b[k][i]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar s[10000];\nint countl, countr, sum[1000] = {0};\n\nint pipei(int i) {\n\n  if (s[i] == '\\0')\n    return sum[i] = 0;\n  if (s[i] == '(') {\n    ++countl;\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    if (sum[i] > 0)\n\n    {\n      s[i] = ' ';\n      countl--;\n      countr--;\n      sum[i]--;\n    }\n\n    else {\n      countl--;\n      s[i] = '$';\n    }\n    return 0;\n  }\n\n  else {\n    if (s[i] == ')') {\n      countr++;\n      sum[i]++;\n      if (countl >= countr) {\n        s[i] = ' ';\n        pipei(i + 1);\n        sum[i] += sum[i + 1];\n        return 0;\n      } else {\n        countr--;\n        s[i] = '?';\n        pipei(i + 1);\n        sum[i] += sum[i + 1];\n        return 0;\n      }\n\n    } else {\n      s[i] = ' ';\n      pipei(i + 1);\n      sum[i] += sum[i + 1];\n      return 0;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin) {\n    cin.getline(s, 1000);\n    cout << s << \"\\n\";\n    pipei(0);\n    cout << s << endl;\n    countl = countr = 0;\n    memset(sum, 0, sizeof(sum));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int n, j;\n  int left;\n  cin >> n;\n  cin.get();\n  for (j = 1; j <= n; j++) {\n    left = 0;\n\n    cin.getline(line, 101);\n    int len = strlen(line);\n    for (int i = 0; i <= 100; i++)\n      label[i] = ' ';\n    for (int i = 0; i <= len - 1; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N;\n  cin >> N;\n  for (int I = 0; I < N; I++) {\n    int i;\n    char in[110];\n    cin >> in;\n\n    printf(\"%s\\n\", in);\n    int n = strlen(in);\n\n    char mark[110];\n    for (i = 0; i < n; i++)\n      mark[i] = ' ';\n\n    int left = 0;\n\n    for (i = 0; i < n; i++) {\n      if (in[i] == '(')\n        left++;\n\n      else if (in[i] == ')') {\n        if (left) {\n          left--;\n        } else {\n          mark[i] = '?';\n        }\n      }\n    }\n\n    int right = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (in[i] == ')')\n        right++;\n\n      else if (in[i] == '(') {\n        if (right) {\n          right--;\n        } else {\n          mark[i] = '$';\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      cout << mark[i];\n    cout << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, x = 0, y, z;\n  char c[105];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char b[105] = {0};\n\n    cin >> b;\n    m = strlen(b);\n    for (j = 0; j < m; j++) {\n      if (b[j] == '(') {\n        c[j] = '$';\n      } else if (b[j] == ')') {\n        c[j] = '?';\n      } else if (b[j] != '(' && b[j] != ')')\n        c[j] = ' ';\n    }\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (c[j] == '?') {\n        z = 0;\n        y++;\n        for (x = j; x >= 0; x--) {\n          if (c[x] == '$') {\n            z++;\n            if (x == j - 1 || y == z) {\n              y--;\n              c[x] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (x == -1) {\n          y--;\n          c[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", c[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30892", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n, i, j, k, m;\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n    char a[200] = {0};\n    char b[200] = {0};\n\n    scanf(\"%s \", a);\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n\n    for (j = 1; j < k; j++) {\n      if (b[j] == '?') {\n        for (m = j - 1; m >= 0; m--)\n          if (b[m] == '$') {\n            b[m] = ' ';\n            b[j] = ' ';\n            break;\n          }\n      }\n    }\n    printf(\"%s %s \", a, b);\n  }\n}\n"}
{"label": "17", "index": "30893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0;\n  char a[105], b[105];\n  while (cin >> a) {\n    l = 0;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && l == 0) {\n        b[i] = '?';\n        continue;\n      }\n      if (a[i] == '(') {\n        b[i] = '$';\n        l++;\n      }\n      if (a[i] == ')' && l > 0) {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[j] = ' ';\n            l--;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < strlen(a); i++)\n      cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[160], ans[160];\n  int st[160], i, si;\n  for (; scanf(\"%s\", s) != EOF;) {\n    for (ans[0] = ' ', si = i = 0; i < strlen(s);\n         si -= (s[i] == ')' && si > 0), ans[++i] = ' ')\n      if (s[i] == '(')\n        st[si++] = i;\n      else if (s[i] == ')')\n        ans[i] = (si > 0) ? ' ' : '?';\n    for (ans[strlen(s)] = '\\0', i = 0; i < si; i++)\n      ans[st[i]] = '$';\n    printf(\"%s\\n%s\\n\", s, ans);\n  }\n}\n"}
{"label": "17", "index": "30895", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Find(char *);\nint main() {\n  int i;\n  char str[101];\n  char mark[101];\n  while (cin.getline(str, 101)) {\n    memset(mark, 0, sizeof(mark));\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n        mark[i] = '$';\n      }\n      if (str[i] == ')') {\n        mark[i] = '?';\n      }\n      if (str[i] != '(' && str[i] != ')') {\n        mark[i] = ' ';\n      }\n    }\n    Find(mark);\n    for (i = strlen(mark) - 1; i >= 0; i--)\n      if (mark[i] != ' ') {\n        mark[i + 1] = 0;\n        break;\n      }\n    for (i = 0; i < strlen(mark); i++)\n      if (mark[i] != ' ') {\n        strcpy(mark, mark + i);\n        break;\n      }\n    cout << str << endl << mark << endl;\n  }\n  return 0;\n}\n\nvoid Find(char mark[]) {\n  int i, j = 0;\n  for (i = 0; i < strlen(mark); i++) {\n    if (mark[i] == '$') {\n      for (j = i + 1; j < strlen(mark); j++) {\n        if (mark[j] == '$') {\n          break;\n        } else {\n          if (mark[j] == '?') {\n            mark[j] = ' ';\n            mark[i] = ' ';\n            Find(mark);\n            return;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "30896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101] = {\"0\"};\n  int i, j, len, zuo, you, a[100];\n  while (scanf(\"%s\", str) != EOF) {\n    len = strlen(str);\n    for (i = 0; i < len; i++)\n      a[i] = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        zuo = 0;\n        you = 0;\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == '(' && a[j] != 1)\n            zuo++;\n          else if (str[j] == ')')\n            you++;\n        }\n        if (you < zuo + 1)\n          a[i] = 1;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        zuo = 0;\n        you = 0;\n        for (j = 0; j < i; j++) {\n          if (str[j] == '(')\n            zuo++;\n          else if (str[j] == ')' && a[j] != -1)\n            you++;\n        }\n        if (zuo < you + 1)\n          a[i] = -1;\n      }\n    }\n    cout << str << \"\\n\";\n    for (i = 0; i < len; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else if (a[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, l, j, n = 1;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++)\n      printf(\"%c\", a[j]);\n\n    printf(\"\\n\");\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        for (k = j; k >= -1; k--) {\n          if (k == -1) {\n            a[j] = '?';\n            break;\n          }\n          if (a[k] == '$') {\n            a[k] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n\n      } else\n        a[j] = ' ';\n    }\n\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30898", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], res[101];\n  int n, stack[100], k;\n\n  cin >> n;\n  while (n--) {\n    cin >> str;\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      res[i] = ' ';\n    res[len] = '\\0';\n\n    k = 0;\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k != 0 && stack[k - 1] < 0)\n          k--;\n        else\n          stack[k++] = i + 1;\n      } else if (str[i] == '(')\n        stack[k++] = -(i + 1);\n    }\n    for (int i = 0; i < k; i++) {\n      int index = stack[i];\n      if (index < 0)\n        res[-index - 1] = '$';\n      else\n        res[index - 1] = '?';\n    }\n    cout << str << endl;\n    printf(\"%s\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[200];\nint x = 0, y = 0;\nvoid find(int min) {\n  if (min > 0) {\n    int p = -1;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && p >= 0) {\n        a[p] = 'a';\n        a[i] = 'b';\n        break;\n      } else if (a[i] == '(') {\n        p = i;\n      }\n    }\n    find(min - 1);\n  }\n}\nvoid change() {\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else {\n      a[i] = ' ';\n    }\n  }\n}\nvoid qingling() {\n  for (int i = 0; i < strlen(a); i++) {\n    a[i] = '\\0';\n  }\n}\nint main() {\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(') {\n        x++;\n      }\n      if (a[i] == ')')\n        y++;\n    }\n    int min = 0;\n    if (x < y)\n      min = x;\n    else\n      min = y;\n    find(min);\n    change();\n    cout << a << endl;\n    qingling();\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      b[j] = ' ';\n    b[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0)\n          b[j] = '?';\n        else {\n          t--;\n          b[c[t]] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++)\n      printf(\"%c\", b[h]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30901", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[105];\nint len;\nint f(int b) {\n  for (int i = b + 1; i < len; i++) {\n    if (s[i] == ')') {\n      s[b] = '$';\n      s[i] = '?';\n      return i;\n    } else if (s[i] == '(') {\n      i = f(i);\n    }\n  }\n  return len - 1;\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    cout << s << endl;\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        i = f(i);\n    }\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        cout << '$';\n      } else if (s[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  char a[100][120];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    puts(a[i]);\n    k = strlen(a[i]);\n    for (j = 0; j < k; j++) {\n\n      if (a[i][j] == ')') {\n        a[i][j] = '?';\n      }\n      if (a[i][j] == '(') {\n        a[i][j] = '$';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] != '?' && a[i][j] != '$') {\n        a[i][j] = ' ';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == '?') {\n        for (l = j; l >= 0; l--) {\n          if (a[i][l] == '$') {\n            a[i][j] = ' ';\n            a[i][l] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30903", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int n, j;\n  int left;\n  scanf(\"%d \", &n);\n  cin.get();\n  for (j = 1; j <= n; j++) {\n    left = 0;\n\n    cin.getline(line, 101);\n    int len = strlen(line);\n    for (int i = 0; i <= 100; i++)\n      label[i] = ' ';\n    for (int i = 0; i <= len - 1; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i;\nchar x[101];\nchar y[101];\nvoid f() {\n  int num = 0;\n  int k[101] = {0};\n  memset(y, ' ', 101);\n  int len = strlen(x);\n  for (i = 0; i < len; i++) {\n    if (x[i] == '(') {\n      y[i] = '$';\n      num = num + 1; \n      k[num] = i;    \n    }\n    if (x[i] == ')') {\n      if (num > 0) {\n        y[k[num]] = ' ';\n        num = num - 1; \n      } else\n        y[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << y[i]; \n  }\n  cout << endl;\n}\n\nint main() {\n  while (cin >> x) {\n    cout << x << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, t, j, la, k, bb, pp;\n  while (cin.getline(a, 101, '\\n')) {\n    cout << a << endl;\n    la = strlen(a);\n    for (i = 0; i < la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    t = 0;\n    while (t == 0) {\n      t = 1;\n      for (i = la - 1; i >= 0; i--) {\n        if (a[i] == ')')\n          break;\n        if (a[i] == '(') {\n          a[i] = '$';\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == ')') {\n          a[i] = '?';\n          break;\n        }\n        if (a[i] == '(') {\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(') {\n          for (j = i + 1; j < la; j++) {\n            k = 2;\n            if (a[j] == '(') {\n              k = 0;\n              break;\n            }\n            if (a[j] == ')') {\n              k = 1;\n              a[j] = ' ';\n              break;\n            }\n          }\n          if (k == 1) {\n            a[i] = ' ';\n          }\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          t = 0;\n          break;\n        }\n      }\n    }\n    for (i = la - 1; i >= 0; i--) {\n      if (a[i] != ' ')\n        break;\n    }\n    bb = i;\n    for (i = 0; i < la; i++) {\n      if (a[i] != ' ')\n        break;\n    }\n    pp = i;\n    for (j = pp; j <= bb; j++)\n      cout << a[j];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101] = {0}, b[101] = {0};\n  while (scanf(\"%s\", a) != EOF) {\n    strcpy(b, a);\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '?') {\n        for (j = i - 1; j > -1; j--)\n          if (a[j] == '$') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n      }\n    }\n    cout << b << \"\\n\";\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30907", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[200];\nint findpair(int i, int j) {\n  int temp;\n  if (a[i] == '\\0')\n    return -1;\n  else if (a[i] == '(') {\n    temp = findpair(i + 1, j + 1);\n    if (temp == -1) {\n      a[i] = '$';\n      return -1;\n    } else {\n      a[i] = ' ';\n      return findpair(temp + 1, j);\n    }\n  } else if (a[i] == ')') {\n    if (j == 0) {\n      a[i] = '?';\n      return findpair(i + 1, j);\n    } else {\n      a[i] = ' ';\n      return i;\n    }\n  } else if (a[i] == ' ')\n    return (findpair(i + 1, j));\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    for (int i = 0; i <= (int)strlen(a) - 1; ++i)\n      if (a[i] != ')' && a[i] != '(' && a[i] != '\\0')\n        a[i] = ' ';\n    findpair(0, 0);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30908", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint len;\nchar st[101], ans[101];\n\nint work(int pos) {\n  for (int i = pos + 1; i < len; i++)\n    if (st[i] == '(')\n      i = work(i);\n    else {\n      if (st[i] == ')') {\n        ans[pos] = '(';\n        ans[i] = ')';\n        return i;\n      }\n    }\n  return len - 1;\n}\n\nint main() {\n  int i;\n  while (scanf(\"%s \", st)) {\n    printf(\"%s\\n\", st);\n    len = strlen(st);\n    memset(ans, 0, sizeof(ans));\n    for (i = 0; i < len; i++)\n      if (st[i] == '(')\n        i = work(i);\n    for (i = 0; i < len; i++)\n      switch (st[i]) {\n      case '(':\n        ans[i] = (ans[i] == '(') ? ' ' : '$';\n        break;\n      case ')':\n        ans[i] = (ans[i] == ')') ? ' ' : '?';\n        break;\n      default:\n        ans[i] = ' ';\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101];\nint lenth = 0;\nint main() {\n  while (scanf(\"%s \", str)) {\n    lenth = strlen(str);\n    cout << str << endl;\n    int i, j;\n    for (j = 0; j < lenth; j++) {\n      if (str[j] == '(')\n        str[j] = '$';\n      else if (str[j] == ')')\n        str[j] = '?';\n      else\n        str[j] = ' ';\n    }\n    for (i = lenth - 2; i >= 0; i--) {\n      if (str[i] == '$') {\n        for (j = i + 1; j < lenth; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num = 0, i, l, j, k, n, left[101];\n  char str[101], str2[101];\n  while (cin >> str) {\n    strcpy(str2, str);\n    for (i = 0, l = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n    }\n    for (n = l - 1; n >= 0; n--) {\n      for (k = left[n] + 1; str[k]; k++) {\n        if (str2[k] == ')') {\n          str2[left[n]] = ' ';\n          str2[k] = ' ';\n          break;\n        }\n      }\n    }\n    for (j = 0; str[j]; j++) {\n      if (str2[j] == '(')\n        str2[j] = '$';\n      else if (str2[j] == ')')\n        str2[j] = '?';\n      else\n        str2[j] = ' ';\n    }\n    printf(\"%s \", str);\n    printf(\"%s \", str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30911", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a;\n  cin >> n;\n  for (a = 1; a <= n; a++) {\n    char s[101];\n    scanf(\"%s\", s);\n    int left[101] = {0}, right[101] = {0}, i, l = 0, r = 0;\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(') {\n        left[l++] = i + 1;\n      } else {\n        if (s[i] == ')') {\n          if (l != 0) {\n            l--;\n            left[l] = 0;\n          } else {\n            right[r++] = i + 1;\n          }\n        }\n      }\n    }\n    int le = 0, ri = 0;\n    printf(\"%s\\n\", s);\n    for (i = 0; i < strlen(s); i++) {\n      if (left[le] == i + 1) {\n        printf(\"$\");\n        le++;\n      } else {\n        if (right[ri] == i + 1) {\n          printf(\"?\");\n          ri++;\n        } else\n          printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag[101] = {0};\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < strlen(str); i++) {\n      cout << str[i];\n      if (str[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (str[j] == '(' && flag[j] == 0) {\n            flag[i] = 1;\n            flag[j] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << endl;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(' && flag[i] == 0)\n        printf(\"$\");\n      else if (str[i] == ')' && flag[i] == 0)\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << endl;\n    memset(flag, 0, sizeof(flag));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j;\n  while (cin.getline(str, 101)) {\n    int length = strlen(str), count1[1000] = {0}, count2[1000] = {0};\n    for (i = length; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i; str[j] != '\\0'; j++) {\n          if (str[j] == ')' && count2[j] == 0) {\n            count2[j]--;\n            break;\n          } else {\n            if (str[j + 1] == '\\0') {\n              count1[i]++;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == ')')\n        count2[i]++;\n\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (count1[i] == 1) {\n        cout << \"$\";\n      }\n      if (count2[i] == 1)\n        cout << \"?\";\n\n      if (count1[i] != 1 && count2[i] != 1) {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\nint cur = 0, flag = 0;\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[103], temp[103];\nint len;\nint match(int x) {\n  int y;\n  if (x == len) \n    return x;\n  if (str[x] == '(') \n    y = match(x + 1);\n  else if (str[x] == ')') \n    return x;\n  else \n    return match(x + 1);\n  if (y == len) { \n    temp[x] = '$';\n    return y;\n  } else \n    return match(y + 1);\n}\nint main() {\n  while (cin >> str) {   \n    cout << str << endl; \n    len = strlen(str);   \n    int z = 0;\n    memset(temp, ' ', sizeof(temp)); \n    while (z != len) {               \n      z = match(z);\n      if (z != len) {\n        temp[z] = '?';\n        z++;\n      }\n    }\n    for (int i = 0; i < len; i++)\n      cout << temp[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[101];\n  int g[101];\n  int len, i, j, left;\n  while (scanf(\"%s\", st) != EOF) {\n    printf(\"%s\\n\", st);\n    len = strlen(st);\n    left = 0;\n    for (i = 0; i < len; i++) {\n      if (st[i] == '(') {\n        left++;\n        g[left] = i;\n      }\n    }\n    for (i = left; i > 0; i--) {\n      for (j = g[i] + 1; j < len; j++)\n        if (st[j] == ')') {\n          st[g[i]] = ' ';\n          st[j] = ' ';\n          break;\n        }\n    }\n    for (i = 0; i < len; i++) {\n      if (st[i] == ')')\n        cout << \"?\";\n      else if (st[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, left[102], len, j, k;\n  char *p = NULL;\n  char str[102];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    k = 0;\n    cin >> str;\n    cout << str << endl;\n    len = strlen(str);\n    p = str;\n    for (; p < str + len; p++) {\n      if (*p != '(' && *p != ')')\n        *p = ' ';\n    }\n    for (j = 0; j < len; j++) {\n      if (str[j] == '(') {\n        k++;\n        left[k] = j;\n      }\n      if (str[j] == ')') {\n        if (k == 0)\n          str[j] = '?';\n        else {\n          left[k] = -1;\n          k--;\n        }\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    } else {\n      for (; k > 0; k--)\n        str[left[k]] = '$';\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?' && str[j] != '$')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint n, c1 = 0;\nint match(int c) {\n  for (int i = c; i < n; i++) {\n    if (a[i] != '(' && a[i] != ')' && a[i] != '$')\n      a[i] = ' ';\n    if (a[i] == '(') {\n      c1++;\n      if (match(i + 1) != 0) {\n        a[i] = ' ';\n        a[match(i + 1)] = ' ';\n        c1--;\n      } else\n        a[i] = '$';\n    }\n    if (a[i] == ')') {\n      if (c1 == 0) {\n        a[i] = '?';\n        if (i < n) {\n          match(i + 1);\n          return 0;\n        }\n      }\n      return i;\n    }\n  }\n  return 0;\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    c1 = 0;\n    n = strlen(a);\n    cout << a << endl;\n    match(0);\n    cout << a << \"\\n\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid deal(char s[]) {\n  int i, j, p = 0;\n  for (i = 0; i < strlen(s); i++)\n    if (s[i] == '(') {\n      for (j = i + 1; j < strlen(s); j++)\n        if (s[j] == '(' || s[j] == ')')\n          break;\n      if (s[j] == ')') {\n        s[j] = 'a';\n        s[i] = 'a';\n        p++;\n      }\n    }\n  if (p != 0)\n    deal(s);\n}\nint main() {\n  int i, j;\n  char s[1000], s1[1000], t[1000];\n  while (0 == 0) {\n    for (i = 0; i < 1000; i++)\n      s[i] = 0;\n\n    cin >> s;\n    if (s[0] == '\u0000')\n      break;\n    strcpy(s1, s);\n    deal(s1);\n    for (i = 0; i < strlen(s); i++)\n      if (s1[i] == '(')\n        t[i] = '$';\n      else if (s1[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    t[strlen(s)] = '\u0000';\n    printf(\"%s %s \", s, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    cout << line << \"\\n\";\n    printf(\"%s\\n\", label);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30921", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[200];\n  char b[200];\n  int c[200];\n  int len;\n  int k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    k = 0;\n    int j = 0;\n    for (j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n        c[k] = j;\n        k = k + 1;\n      } else if (a[j] == ')') {\n        if (j == 0) {\n          b[j] = '?';\n        } else {\n          if (k > 0 && b[c[k - 1]] == '$') {\n            b[c[k - 1]] = ' ';\n            b[j - 1] = ' ';\n            b[j] = ' ';\n            k = k - 1;\n          } else {\n            b[j] = '?';\n            c[k] = j;\n            k = k + 1;\n          }\n        }\n      } else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\\0';\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30922", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int length, i, j;\n  while (cin.getline(line, 101)) {\n    length = strlen(line);\n    for (i = 0; i < length; i++)\n      cout << line[i];\n    cout << endl;\n    for (i = 0; i < length; i++) {\n      if (line[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[i] = 0;\n            line[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (line[i] == '(')\n        cout << \"$\";\n      if (line[i] != '(' && line[i] != ')')\n        cout << \" \";\n      if (line[i] == ')')\n        cout << \"?\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30923", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[150];\nchar b[150];\nint sig[150];\nint main() {\n  int i, k = 0;\n  while (cin >> a) {\n    k = 0;\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      b[i] = a[i];\n      if (a[i] == '(') {\n        b[i] = '$';\n        sig[k] = i;\n        k++;\n      }\n      if (a[i] == ')') {\n        k--;\n        if (k < 0) {\n          b[i] = '?';\n          k = 0;\n        } else {\n          b[sig[k]] = 'a';\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << \" \";\n      else\n        cout << b[i];\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "17", "index": "30924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  int i, len, mark1[110] = {0}, judge, k = 0, j, k1 = 0;\n  while (cin.getline(a, 110)) {\n    len = strlen(a);\n    k = 0;\n    for (i = 0; i < 110; i++)\n      mark1[i] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' || a[i] == ')') {\n        if (k == 0) {\n          if (a[i] == '(')\n            mark1[k]++;\n          else\n            mark1[k]--;\n          k++;\n        } else {\n          judge = 0;\n          if (a[i] == '(')\n            mark1[k] = 1;\n          else if (a[i] == ')') {\n            mark1[k] = -1;\n            for (j = k - 1; j >= 0; j--) {\n              if (mark1[j] == 1) {\n                mark1[j] = 0;\n                mark1[k] = 0;\n                break;\n              }\n            }\n          }\n\n          k++;\n        }\n      }\n    }\n    k1 = 0;\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        cout << ' ';\n      else {\n        if (mark1[k1] == 0)\n          printf(\" \");\n        else if (mark1[k1] > 0)\n          cout << '$';\n        else\n          cout << '?';\n        k1++;\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int temp;\n  while (cin.getline(str, 101, '\\n')) {\n    cout << str << endl;\n    int k, i, s = 0;\n    char result[101];\n    int left[101];\n    memset(result, ' ', sizeof(result));\n    k = strlen(str);\n    int p = 0;\n    for (i = 0; i < k; i++) {\n      if (str[i] == '(') {\n        p++;\n        left[s] = i;\n        temp = s;\n        s++;\n      }\n      if ((str[i] == ')') && (p == 0))\n        result[i] = '?';\n      if ((str[i] == ')') && (p != 0)) {\n        p--;\n        left[temp] = -1;\n        do\n          temp--;\n        while (left[temp] == -1);\n      }\n    }\n    for (i = 0; i < s; i++) {\n      if (left[i] == -1)\n        continue;\n      else\n        result[left[i]] = '$';\n    }\n    for (i = 0; i < k; i++)\n      cout << result[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30926", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  do {\n    char s[101] = {0}, S[101] = {0};\n    int i, len, m;\n\n    cin >> s;\n    strcpy(S, s);\n\n    len = strlen(s);\n\n    if (len == 0)\n      break;\n\n    m = 0;\n    do {\n\n      for (i = m; i < len; i++) {\n        if (s[i] == ')') {\n          break;\n        }\n      }\n\n      m = i;\n\n      if (m == len)\n        break;\n\n      else {\n        for (i = m; i >= 0; i--)\n          if (s[i] == '(') {\n            s[i] = '1';\n            s[m] = '1';\n            break;\n          }\n      }\n\n      m = m + 1;\n\n    } while (1);\n\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n    }\n\n    printf(\"%s \", S);\n    puts(s);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "17", "index": "30927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int len;\n  while (scanf(\"%s \", a)) {\n    printf(\"%s\\n\\n\", a);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      if (isalpha(a[i]))\n        a[i] = ' ';\n      else if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (int temp = 0; temp < len / 2; temp++) {\n      for (int i = 0; i < len; i++)\n        if (a[i] == '$') {\n          for (int j = i + 1; j < len; j++) {\n            if (a[j] == '$') {\n              break;\n            } else if (a[j] == '?') {\n              a[i] = ' ';\n              a[j] = ' ';\n              break;\n            }\n          }\n        }\n    }\n    cout << a << endl << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "17", "index": "30928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int zuo[110] = {0}, z = 0;\n    int you[110] = {0}, y = 0;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        zuo[z++] = i;\n      if (a[i] == ')')\n        you[y++] = i;\n    }\n    for (int i = 0; i < y; i++) {\n      for (int j = z - 1; j >= 0; j--) {\n        if (zuo[j] < you[i]) {\n          zuo[j] = 200;\n          you[i] = -100;\n          break;\n        }\n      }\n    }\n    for (int j = 0; j < strlen(a); j++) {\n      a[j] = ' ';\n    }\n    for (int j = 0; j < z; j++) {\n      if (zuo[j] != 200)\n        a[zuo[j]] = '$';\n    }\n    for (int j = 0; j < y; j++) {\n      if (you[j] != -100)\n        a[you[j]] = '?';\n    }\n\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30929", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, len, c, zb[101], fb[101];\n  char a[101], s[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (j = 0; j < len; j++) {\n      s[j] = a[j];\n    }\n    s[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    int o = 0, h = 0;\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        c = j;\n        zb[o] = j;\n        o++;\n      }\n      if (s[j] == ')' && o > 0) {\n        s[j] = ' ';\n        s[c] = ' ';\n        o--;\n        if (o > 0)\n          c = zb[o - 1];\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n%s\", a, s);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[1000] = {'0'};\nchar c[1000] = {' '};\nint qq, pp;\nint t = 0;\nint x(int m) {\n  if (qq <= m - 1) {\n    if (a[qq] == '(') {\n      qq++;\n      t++;\n      x(m);\n    } else if (a[qq] == ')') {\n      qq++;\n      t--;\n      if (t == -1) {\n        c[qq - 1] = '?';\n        t = 0;\n      }\n      x(m);\n    } else if (a[qq] != '(' && a[qq] != ')') {\n      qq++;\n      x(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint y(int m) {\n  if (pp >= 0) {\n    if (a[pp] == ')') {\n      pp--;\n      t++;\n      y(m);\n    } else if (a[pp] == '(') {\n      pp--;\n      t--;\n      if (t == -1) {\n        c[pp + 1] = '$';\n        t = 0;\n      }\n      y(m);\n    } else if (a[pp] != '(' && a[pp] != ')') {\n      pp--;\n      y(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint main() {\n  char b;\n  int i = 0;\n  while (cin.get(b)) {\n    if (b != '\\n')\n      a[i++] = b;\n    else if (b == '\\n') {\n      for (int j3 = 0; j3 <= i - 1; j3++)\n        c[j3] = ' ';\n      cout << a << endl;\n      qq = 0;\n      x(i);\n      pp = i - 1;\n      y(i);\n      for (int j = 0; j <= i - 1; j++)\n        cout << c[j];\n      cout << \"\\n\";\n      for (int j1 = 0; j1 <= i - 1; j1++) {\n        c[j1] = ' ';\n        a[j1] = '\\0';\n      }\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i;\nchar x[101];\nchar y[101];\nvoid f() {\n  int num = 0;\n  int k[101] = {0};\n  memset(y, ' ', 101);\n  int len = strlen(x);\n  for (i = 0; i < len; i++) {\n    if (x[i] == '(') {\n      y[i] = '$';\n      num = num + 1;\n      k[num] = i;\n    }\n    if (x[i] == ')') {\n      if (num > 0) {\n        y[k[num]] = ' ';\n        num = num - 1;\n      } else\n        y[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    printf(\"%c\", y[i]);\n  }\n  cout << endl;\n}\n\nint main() {\n  while (scanf(\"%s \", x)) {\n    cout << x << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char s[101], zhui = '#';\n    int count[101] = {0};\n    int i = 0, j = 0, sl = 0;\n    for (i = 0; i < 101; i++) {\n      s[i] = '#';\n    }\n\n    cin.getline(s, 101);\n    sl = strlen(s);\n    if (s[0] == '\\0') {\n      break;\n    }\n\n    for (i = 0; i < sl; i++) {\n      if (s[i] == '(') {\n        count[i] = 1;\n      } else if (s[i] == ')') {\n        count[i] = 2;\n      } else {\n        continue;\n      }\n    }\n\n    for (i = sl - 1; i >= 0; i--) {\n      if (count[i] == 1) {\n        for (j = i + 1; j < sl; j++) {\n          if (count[j] == 2) {\n            count[i] = 0;\n            count[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n\n    int dingzuo[101] = {0};\n    int dingyou[101] = {0};\n    int flag = 0;\n    int count0 = 0;\n    for (i = 0; i < sl; i++) {\n      if (count[i] == 1) {\n        dingzuo[i] = 1;\n        flag = 1;\n        count0++;\n      } else if (count[i] == 2) {\n        dingyou[i] = 1;\n        flag = 1;\n        count0++;\n      } else {\n        continue;\n      }\n    }\n\n    int k = count0;\n    for (i = 0; i < sl; i++) {\n      cout << s[i];\n    }\n    if (flag == 1) {\n      cout << endl;\n      for (i = 0; i < sl; i++) {\n        if (dingzuo[i] == 1) {\n          cout << \"$\";\n          count0--;\n        } else if (dingyou[i] == 1) {\n          cout << \"?\";\n          count0--;\n        } else {\n          if ((count0 > 0) && (count0 < k)) {\n            cout << \" \";\n          }\n        }\n      }\n      cout << endl;\n    } else {\n      cout << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint length;\nchar a[1000];\nchar c[100];\nint b[100];\nint zkh = 0;\nint match(int i) {\n  if (i == length) {\n    return 0;\n  }\n  if (a[i] == '(') {\n    zkh = zkh + 1;\n    c[i] = '$';\n    b[zkh] = i;\n  }\n  if (a[i] == ')') {\n    if (zkh == 0) {\n      c[i] = '?';\n    }\n    if (zkh != 0) {\n      c[b[zkh]] = ' ';\n      zkh = zkh - 1;\n      c[i] = ' ';\n    }\n  }\n  if (a[i] != '(' && a[i] != ')') {\n    c[i] = ' ';\n  }\n  match(i + 1);\n}\n\nint main(int argc, const char *argv[]) {\n  int j, k, l;\n  while (cin.getline(a, 200)) {\n    zkh = 0;\n    length = strlen(a);\n    for (j = 0; j < length; j++) {\n      cout << a[j];\n    }\n    printf(\"\\n\");\n\n    match(0);\n\n    for (l = 0; l < length; l++) {\n      cout << c[l];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[120][102], b[120][102];\n  int n, i, j, k, r, d, l, cao;\n  for (i = 1; i <= 200; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    for (k = 0; k <= strlen(a[j]) - 1; k++) {\n\n      if (a[j][k] == ')') {\n        if (k == 0) {\n          l = 0;\n        }\n        for (r = 0, cao = 0; r <= k - 1; r++) {\n          if (a[j][r] == '(') {\n            for (d = r + 1, l = 1; d <= k - 1; d++) {\n              if (a[j][d] == ')')\n                l--;\n              else if (a[j][d] == '(')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '?';\n      } else if (a[j][k] == '(') {\n        if (k == strlen(a[j]) - 1) {\n          l = 0;\n        }\n        for (r = k + 1, cao = 0; r <= strlen(a[j]) - 1; r++) {\n          if (a[j][r] == ')') {\n            for (d = r - 1, l = 1; d >= k + 1; d--) {\n              if (a[j][d] == '(')\n                l--;\n              else if (a[j][d] == ')')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '$';\n      } else\n        b[j][k] = ' ';\n    }\n  }\n  for (j = 1; j <= i - 1; j++) {\n    printf(\"%s %s \", a[j], b[j]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(char c[], int n) {\n  for (int i = n + 1; i < strlen(c); i++) {\n    if (c[i] == ')') {\n      c[i] = ' ';\n      c[n] = ' ';\n      return i;\n    } else if (c[i] == '(') {\n      i = match(c, i);\n    }\n  }\n  c[n] = '$';\n  return strlen(c) - 1;\n}\nint main() {\n  char ch[110];\n  while (scanf(\"%s \", ch)) {\n    cout << ch << endl;\n    for (int i = 0; ch[i] != 0; i++)\n      if (ch[i] != '(' && ch[i] != ')')\n        ch[i] = ' ';\n    for (int i = 0; ch[i] != 0; i++) {\n      if (ch[i] == '(')\n        i = match(ch, i);\n      else if (ch[i] == ')')\n        ch[i] = '?';\n    }\n    printf(\"%s\\n\", ch);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  char s1[101], s2[101] = {0};\n  for (i = 1; i > 0;) {\n\n    cin >> s1;\n    if (strcmp(s1, s2) == 0) {\n      printf(\" \");\n      break;\n    }\n    puts(s1);\n    l = strlen(s1);\n    for (j = 0; j < l; j++) {\n      if (s1[j] != '(' && s1[j] != ')')\n        s1[j] = ' ';\n      else {\n        if (s1[j] == ')') {\n          for (k = j; k >= 0; k--)\n            if (s1[k] == '(')\n              break;\n          if (k != -1)\n            s1[k] = s1[j] = ' ';\n          else\n            s1[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s1[j] == '(')\n        s1[j] = '$';\n    }\n    strcpy(s2, s1);\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30937", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[120];\n  while (cin >> s) {\n    char res[120]; \n    int lens;\n    int leftnum = 0; \n    int left[120];\n    lens = strlen(s);\n    for (int i = 0; i < lens; i++)\n      res[i] = ' ';\n    for (int i = 1; i < 120; i++)\n      left[i] = -1;\n    for (int i = 0; i < lens; i++) {\n      if (s[i] == '(')\n        left[++leftnum] = i;\n      if (s[i] == ')') {\n        if (leftnum == 0)\n          res[i] = '?';\n        else {\n          left[leftnum] = -1;\n          leftnum--;\n        }\n      }\n    }\n    for (int i = 1; i <= leftnum; i++)\n      res[left[i]] = '$';\n    for (int i = 0; i < lens; i++)\n      cout << s[i];\n    cout << endl;\n    for (int i = 0; i < lens; i++)\n      cout << res[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[110], b[110];\n  while (scanf(\"%s\", &a) == 1) {\n    strcpy(b, a);\n    int len = strlen(a);\n    int i, t, s, q = 1;\n    while (q) {\n      q = 0;\n      t = -1;\n      s = -1;\n      for (i = 0; i < len; i++) {\n        if (a[i] == 40)\n          t = i;\n        else if (a[i] == 41) {\n          if (t >= 0) {\n            a[t] = 48;\n            a[i] = 48;\n            q = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30939", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0)\n          b[j] = '?';\n        else {\n          t--;\n          b[c[t]] = ' ';\n          b[j] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++)\n      printf(\"%c\", b[h]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int t;\n  scanf(\"%d\", &n);\n  scanf(\"\\n\");\n  char c[101] = {0};\n  char d[101] = {0};\n  int j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++) {\n      c[j] = 0;\n      d[j] = 0;\n    }\n\n    scanf(\"%s\", c);\n    t = strlen(c);\n    for (j = 0; j < t; j++)\n      d[j] = c[j];\n\n    for (j = 0; j < t; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[k] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')')\n        c[j] = '?';\n    }\n\n    cout << d;\n    printf(\"\\n\");\n    printf(\"%s\", c);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, j, k, m;\n  int len;\n  char c[101] = {'0'};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    cout << c << \"\\n\";\n    len = strlen(c);\n    for (j = len - 1; j >= 0; j--) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == '(' && j == len - 1)\n        c[j] = '$';\n      if (c[j] == '(') {\n        k = j;\n        for (m = k; m < len; m++) {\n          if (c[m] == ')') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n        if (m == len - 1 && c[len - 1] != ' ')\n          c[j] = '$';\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (c[j] == ')')\n        c[j] = '?';\n      if (c[j] == '(')\n        c[j] = '$';\n    }\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30942", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, mz;\n  char a[200] = {'\u0000'}, b[200];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < 200; j++) {\n      a[j] = '\u0000';\n      b[j] = '\u0000';\n    }\n\n    scanf(\"%s \", a);\n    strcpy(b, a);\n    for (j = 0; j < 200; j++) {\n      if (a[j] == '\u0000')\n        break;\n      count++;\n    }\n    for (j = count - 1; j >= 0; j--) {\n      if (b[j] == '(') {\n        mz = 0;\n        for (k = j; k < count; k++) {\n          if (b[k] == ')') {\n            b[k] = ' ';\n            b[j] = ' ';\n            mz = 1;\n            break;\n          }\n        }\n        if (mz == 0)\n          b[j] = '$';\n      }\n    }\n    for (j = 0; j < count; j++) {\n      if (b[j] == ')')\n        b[j] = '?';\n    }\n    for (j = 0; j < count; j++)\n      printf(\"%c\", a[j]);\n    printf(\" \");\n    for (j = 0; j < count; j++) {\n      if (b[j] != '$' && b[j] != '?')\n        printf(\" \");\n      else\n        printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "30943", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[1000];\n  char a[1000];\n  int i, j;\n  while (cin.getline(a, 1000)) {\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        x[i] = 1;\n      else if (a[i] == ')')\n        x[i] = -1;\n      else\n        x[i] = 0;\n    }\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l - i; j++)\n        if (x[j] == 1 && x[i + j] == -1)\n          x[j] = x[i + j] = 0;\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == 1)\n        cout << \"$\";\n      else if (x[i] == -1)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, p;\n  char str[10001], a[2000], b[2000], c[2000];\n  while (cin >> str) {\n    n = strlen(str);\n    strcpy(a, str);\n    for (i = 0; i < n; i++)\n      c[i] = ' ';\n    for (i = 0; i < n; i++)\n      if (a[i] == ')') {\n        p = 0;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '?';\n      }\n    for (i = n - 1; i >= 0; i--)\n      if (a[i] == '(') {\n        p = 0;\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '$';\n      }\n    puts(str);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", c[i]);\n    cout << \" \";\n  }\n}\n"}
{"label": "17", "index": "30945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[30][120];\n  int j, n, i, b[30], k, zuo[30][120], you[30][120];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 119; j++) {\n      zuo[i][j] = 0;\n      you[i][j] = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    k = 0;\n\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    for (j = b[i] - 1; j >= 0; j--) {\n\n      if (a[i][j] == '(') {\n        if (k == 0)\n          zuo[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      }\n\n      else if (a[i][j] == ')')\n        k += 1;\n    }\n    k = 0;\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (a[i][j] == ')') {\n        if (k == 0)\n          you[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      } else if (a[i][j] == '(')\n        k += 1;\n    }\n    printf(\"%s\\n\", a[i]);\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (zuo[i][j] == 1)\n        printf(\"$\");\n      else if (you[i][j] == 1)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(char s[]) {\n  int i, j, k, l;\n  int n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != '(' && s[i] != ')')\n      s[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] == ')') {\n      l = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (s[j] == '(') {\n          s[j] = ' ';\n          s[i] = ' ';\n          l = 1;\n          break;\n        }\n      }\n      if (l == 0)\n        s[i] = '?';\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (s[i] != ' ' && s[i] != '?')\n      s[i] = '$';\n}\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char s[10000];\n\n  scanf(\"%s \", s);\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    f(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    m = strlen(a);\n    for (i = 0; i < m; i++) {\n      if ((a[i] != '(') && (a[i] != ')'))\n        a[i] = ' ';\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == ')') {\n        for (k = i; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          a[i] = '?';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30948", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(char a[], int, int);\nvoid g(char a[]);\nint main() {\n  char str[100][101];\n  int i, n = 0, j;\n  while (cin.getline(str[n++], 101)) {\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", str[i]);\n    for (j = 0; j < strlen(str[i]); j++) {\n      if (str[i][j] == ')')\n\n        f(str[i], j - 1, j);\n    }\n    g(str[i]);\n    cout << str[i] << endl;\n  }\n  return 0;\n}\nvoid f(char a[], int x, int y) {\n  if (a[x] == '(') {\n    a[x] = a[y] = 'a';\n  } else if (x > 0)\n    f(a, x - 1, y);\n}\nvoid g(char a[]) {\n  int i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else\n      a[i] = ' ';\n  }\n}\n"}
{"label": "17", "index": "30949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[200];\nvoid match(char a[]) {\n\n  int s;\n  s = strlen(a);\n  if (s == 0)\n    return;\n  int i, j;\n  int check = 0;\n  for (i = 0; i < s - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < s && a[j] == ' '; j++)\n        ;\n      if (j < s) {\n        if (a[j] == ')') {\n          check = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (check == 1) {\n    a[i] = ' ';\n    a[j] = ' ';\n    match(a);\n  }\n  if (check == 0)\n    return;\n}\nint main() {\n\n  int n;\n  scanf(\"%d\", &n);\n  char temp;\n  scanf(\"%c\", &temp);\n  while (n--) {\n\n    cin >> a;\n    puts(a);\n    int s;\n    s = strlen(a);\n    int i;\n    for (i = 0; i < s; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    match(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char chuan[101];\n  while (scanf(\"%s\", chuan) != EOF) {\n    printf(\"%s\\n\", chuan);\n    int i, j, k, p;\n    int sig = 0;\n    p = strlen(chuan) - 1;\n    for (i = p; i >= 0; i--) {\n      if (chuan[i] == ')')\n        sig++;\n      if ((chuan[i] != '(') && (chuan[i] != ')'))\n        chuan[i] = ' ';\n      if ((sig != 0) && (chuan[i] == '(')) {\n        chuan[i] = ' ';\n        sig = sig - 1;\n        for (j = i + 1; j <= p; j++)\n          if (chuan[j] == ')') {\n            chuan[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      if (chuan[i] == '(')\n        printf(\"$\");\n      else if (chuan[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[100];\nint b;\nvoid nihao() {\n\n  for (int i = 0; i < b; i++) {\n    int r = 0;\n    if (a[i] == ')') {\n      for (int j = i - 1; j >= 0; j--) {\n        if (a[j] == '(') {\n          for (int k = j; k <= i; k++)\n            a[k] = ' ';\n          r = 1;\n          break;\n        }\n      }\n      if (r == 0) {\n        a[i] = '?';\n        for (int k = i - 1; k >= 0; k--) {\n          if (a[k] != '?')\n            a[k] = ' ';\n        }\n      }\n    }\n  }\n}\nvoid nimei() {\n  for (int i = b - 1; i >= 0; i--)\n    if (a[i] == '(')\n      a[i] = '$';\n}\nvoid nima() {\n  for (int i = 0; i < b; i++) {\n    if (a[i] != '?' && a[i] != '$')\n      a[i] = ' ';\n  }\n  for (int i = 0; i < b; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  while (cin >> a) {\n    cout << a;\n    cout << endl;\n    b = strlen(a);\n    nihao();\n    nimei();\n    nima();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[201], b[201], c[201];\n  int l, i, m, d[201], y, j;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    strcpy(b, a);\n    for (i = 0; i < l; i++) {\n      b[i] = ' ';\n    }\n    strcpy(c, a);\n  loop:\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            break;\n          else {\n            if (a[j] == ')') {\n              a[i] = a[j] = 'a';\n              goto loop;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n      }\n      if (a[i] == ')')\n        b[i] = '?';\n    }\n    cout << c << \"\\n\" << b << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "30953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid check() {\n  char array[103];\n  while (cin) {              \n    cin.getline(array, 103); \n    int i, j, len;\n    len = strlen(array); \n    for (i = 0; i < len; i++)\n      cout << array[i]; \n    cout << endl;\n    for (i = 0; i < len; i++) {        \n      if (array[i] == ')') {           \n        for (j = i - 1; j >= 0; j--) { \n          if (array[j] == '(') {       \n            array[j] = '1';            \n            array[i] = '1';            \n            break;                     \n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) { \n      if (array[i] != '(' && array[i] != ')')\n        cout << ' ';\n      if (array[i] == '(')\n        cout << '$';\n      if (array[i] == ')')\n        cout << '?';\n    }\n    cout << endl;\n  }\n  return;\n}\n\nint main() {\n  check(); \n  return 0;\n}\n"}
{"label": "17", "index": "30954", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, k, l, n;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--)\n          if (b[j] == '$') {\n            b[i] = b[j] = ' ';\n            break;\n          }\n      }\n    }\n    puts(a);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "30955", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, p, q;\n  for (i = 0; i < n; i++) {\n    char a[101], b[101];\n    cin >> a;\n    num = strlen(a);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else {\n        b[j] = ' ';\n      }\n    }\n\n    for (p = num - 1; p >= 0; p--) {\n      if (b[p] == '$') {\n        for (q = p; q < num; q++) {\n          if (b[q] == '?') {\n            b[q] = ' ';\n            b[p] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < num; j++) {\n\n      cout << a[j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < num; j++) {\n\n      cout << b[j];\n    }\n    printf(\"\\n\");\n    p = 0;\n    q = 0;\n  }\n}\n"}
{"label": "17", "index": "30956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, n, p, q;\n  while (cin.getline(a, 101)) {\n    int b[101] = {0};\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] == ')') {\n        q++;\n\n        if (q > p)\n\n        {\n\n          b[i] = 1;\n          q = q - 1;\n        }\n      }\n      if (a[i] == '(') {\n        p++;\n      }\n    }\n    p = 0;\n    q = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        q++;\n      }\n      if (a[i] == '(') {\n        p++;\n\n        if (p > q)\n\n        {\n\n          b[i] = 2;\n          p = p - 1;\n        }\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      cout << a[i];\n    }\n    cout << endl;\n    for (i = 0; i <= n - 1; i++) {\n      if (b[i] == 0)\n        cout << \" \";\n\n      if (b[i] == 1) {\n        printf(\"?\");\n      }\n      if (b[i] == 2) {\n        cout << \"$\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30957", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint find(char s[], int pos) {\n  int i, p = 0, q = 0;\n  if (pos < 0)\n    return 0; \n  if (s[pos] == ')')\n    for (i = pos - 1; i >= 0; i--) {\n      if (s[i] == '(')\n        p++;\n      if (s[i] == ')')\n        q++; \n      if ((s[i] == '(') && (p - q == 1)) {\n        s[i] = ' ';\n        s[pos] = ' ';\n        break; \n      }\n    }\n  find(s, pos - 1); \n  return 0;\n}\nint main() {\n  char s[101], ss[101], ans[101];\n  int i, n;\n  while (true) {\n    cin >> s;\n    if (!cin)\n      break;\n    strcpy(ss, s);\n    memset(ans, ' ', sizeof(ans));\n    n = strlen(s) - 1; \n    find(s, n);        \n    for (i = 0; i <= n; i++) {\n      if (s[i] == '(')\n        ans[i] = '$';\n      if (s[i] == ')')\n        ans[i] = '?'; \n    }\n    ans[n + 1] = '\\0';\n    cout << ss << endl;\n    cout << ans << endl; \n  }\n  return 0; \n}\n"}
{"label": "17", "index": "30958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[200], b[200];\nint l;\nvoid f36(int i) {\n  int j;\n  for (j = i + 1; j < l; j++) {\n    if (b[j] != 32) {\n      if (b[j] == 63) {\n        b[j] = 32;\n        b[i] = 32;\n      }\n      break;\n    }\n  }\n}\nint g(void) {\n\n  cin >> a;\n  if (a[0] == 0)\n    return 0;\n  else\n    return 1;\n}\nvoid k(void) {\n  l = strlen(a);\n  int i, n = 0, p;\n  for (i = 0; i < l; i++) {\n    b[i] = 32;\n    if (a[i] == 40) {\n      b[i] = 36;\n      n = n + 1;\n    }\n    if (a[i] == 41) {\n      b[i] = 63;\n      n = n + 1;\n    }\n  }\n  for (p = 1; p <= n; p++)\n    for (i = 0; i < l; i++) {\n      if (b[i] == 36)\n        f36(i);\n    }\n  printf(\"%s \", a);\n  for (i = 0; i < l; i++)\n    printf(\"%c\", b[i]);\n  printf(\" \");\n  a[0] = 0;\n}\nint main() {\n  int n = 1;\n  while (n == 1) {\n    n = g();\n    if (n == 0)\n      break;\n    k();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, leftpos = 0, pos[200], k;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    j = 0;\n    for (i = 0; i < strlen(a); i++)\n      if (a[i] == '(' || a[i] == ')') {\n        b[j] = a[i];\n        pos[j] = i;\n        j++;\n      }\n    leftpos = -1;\n    k = 0;\n    while (k != strlen(b)) {\n      if (b[k] == '(')\n        leftpos = k;\n      if (b[k] == ')' && leftpos != -1) {\n        a[pos[k]] = ' ';\n        a[pos[leftpos]] = ' ';\n        b[leftpos] = ' ';\n        b[k] = ' ';\n        leftpos = -1;\n        k = -1;\n      }\n      k++;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n    memset(a, 0, 200);\n    memset(b, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100] = {0};\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      switch (a[i]) {\n      case '(':\n        a[i] = '$';\n        break;\n      case ')':\n        a[i] = '?';\n        break;\n      default:\n        a[i] = ' ';\n      }\n      if (i > l)\n        break;\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '$')\n        for (int j = i + 1; j < l; j++) {\n          if (a[j] == '?') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '$')\n            break;\n        }\n      if (a[i] == '?')\n        for (int j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '?')\n            break;\n        }\n    }\n    for (int i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < 100; i++)\n      a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint process(void);\nint main(void) {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    process();\n  return 0;\n}\n\nint process(void) {\n  char str[105], tstr[105] = {0};\n  cin >> str;\n  int len = strlen(str);\n  int count = 0;\n  for (int i = 0; i < len; i++) {\n    if (str[i] == '(')\n      count++;\n    else if (str[i] == ')') {\n      if (count > 0)\n        count--;\n      else\n        tstr[i] = '?';\n    }\n  }\n  count = 0;\n  for (int i = len - 1; i >= 0; i--) {\n    if (str[i] == ')')\n      count++;\n    else if (str[i] == '(') {\n      if (count > 0)\n        count--;\n      else {\n        tstr[i] = '$';\n      }\n    }\n  }\n  cout << str;\n  printf(\"\\n\");\n  for (int i = 0; i < len; i++) {\n    if (tstr[i])\n      cout << tstr[i];\n    else\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "17", "index": "30962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[201], b[201], c[201];\n  int l, i, m, d[201], y, j;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    strcpy(b, a);\n    for (i = 0; i < l; i++) {\n      b[i] = ' ';\n    }\n    strcpy(c, a);\n  loop:\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            break;\n          else {\n            if (a[j] == ')') {\n              a[i] = a[j] = 'a';\n              goto loop;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')')\n        b[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", c, b);\n  }\n}\n"}
{"label": "17", "index": "30963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, g, ans, max, temp, n, l, t;\n  char c[1000];\n  while (scanf(\"%s\", c) != EOF) {\n    printf(\"%s \", c);\n    for (k = 0; k < 100; k++) {\n      for (i = 0; c[i] != '\u0000'; i++) {\n        if (c[i] == '(') {\n          for (j = i + 1; c[j] != '\u0000'; j++) {\n            if (c[j] == '(') {\n              i = j - 1;\n              break;\n            }\n            if (c[j] == ')') {\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; c[i] != '\u0000'; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      else {\n        if (c[i] == ')') {\n          c[i] = '?';\n        } else\n          c[i] = ' ';\n      }\n    }\n    printf(\"%s \", c);\n  }\n}\n"}
{"label": "17", "index": "30964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char z[101];\n  int i, j, l[101], r[101];\n  while (scanf(\"%s\", z) != EOF) {\n    for (i = 0; i < 101; i++) {\n      l[i] = 0;\n      r[i] = 0;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (z[i] == '(')\n        l[i] = 1;\n      if (z[i] == ')')\n        r[i] = 1;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] == 1) {\n        for (j = i + 1; j < strlen(z); j++) {\n          if (l[j] == 1)\n            l[i]++;\n          if (r[j] == 1)\n            l[i]--;\n          if (l[i] == 0) {\n            r[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", z);\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] != 0)\n        printf(\"$\");\n      else if (r[i] != 0)\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[102], b[102];\n  int len, i, left, leftNum[102];\n  while (scanf(\"%s \", a)) {\n    left = 0;\n    len = strlen(a);\n    for (i = 0; i < 102; i++)\n      b[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        left++;\n        leftNum[left] = i;\n      }\n      if (a[i] == ')')\n        if (left > 0) {\n          b[leftNum[left]] = ' ';\n          left--;\n        } else\n          b[i] = '?';\n    }\n    b[len] = '\\0';\n    cout << a << endl << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30966", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101], rsen[101];\n  while (scanf(\"%s \", sen)) {\n    int pos[101], num = 0, i, t = 0;\n    cout << sen << endl;\n    for (i = 0; i <= strlen(sen) - 1; i++) {\n      if (sen[i] == '(') {\n        num++;\n        pos[num] = i;\n        rsen[i] = '$';\n      } else {\n        if (sen[i] == ')') {\n          if (num > 0) {\n            rsen[pos[num]] = ' ';\n            rsen[i] = ' ';\n            num--;\n          } else {\n            rsen[i] = '?';\n          }\n        } else {\n          rsen[i] = ' ';\n        }\n      }\n    }\n    if (num != 0) {\n      for (i = 1; i <= num; i++) {\n        rsen[pos[num]] = '$';\n      }\n    }\n    for (i = 0; i <= strlen(sen) - 2; i++) {\n      cout << rsen[i];\n    }\n    cout << rsen[strlen(sen) - 1] << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "30967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, f1 = 0, f2 = 0;\n  char line[101], copy[101];\n  while (cin >> line) {\n    strcpy(copy, line);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == ')')\n        line[i] = '?';\n      if (line[i] == '(') {\n        f1 = 1;\n        for (j = i + 1; j < strlen(line); j++) {\n          if (line[j] == '(')\n            f1++;\n          if (line[j] == ')') {\n            f1--;\n            if (f1 == 0) {\n              line[i] = ' ';\n              line[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (f1 != 0)\n          line[i] = '$';\n      }\n    }\n    cout << copy << endl;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '$' || line[i] == '?')\n        cout << line[i];\n      else\n        cout << \" \";\n    }\n    cout << endl;\n    memset(line, 0, sizeof(line));\n    memset(copy, 0, sizeof(copy));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int len;\n  while (scanf(\"%s \", a)) {\n    cout << a << \"\\n\\n\";\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      if (isalpha(a[i]))\n        a[i] = ' ';\n      else if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (int temp = 0; temp < len / 2; temp++) {\n      for (int i = 0; i < len; i++)\n        if (a[i] == '$') {\n          for (int j = i + 1; j < len; j++) {\n            if (a[j] == '$') {\n              break;\n            } else if (a[j] == '?') {\n              a[i] = ' ';\n              a[j] = ' ';\n              break;\n            }\n          }\n        }\n    }\n    cout << a << endl << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "17", "index": "30969", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, r, n, x = 0, z;\n  char a[102], b[102];\n  while (scanf(\"%c\", &a[1]) != EOF) {\n    i = 1;\n    while (a[i] != '\\n') {\n      i++;\n      scanf(\"%c\", &a[i]);\n    }\n    for (n = 1; n <= i - 1; n++)\n      printf(\"%c\", a[n]);\n    printf(\"\\n\");\n    x = 0;\n    for (n = 1; n <= i - 1; n++) {\n      b[n] = ' ';\n      if (a[n] == ')' && x == 0)\n        b[n] = '?';\n      if (a[n] == '(')\n        x = x + 1;\n      if (a[n] == ')' && x != 0)\n        x = x - 1;\n    }\n    x = 0;\n    for (n = i - 1; n >= 1; n--) {\n      if (a[n] == ')')\n        x = x + 1;\n      if (a[n] == '(' && x == 0)\n        b[n] = 36;\n      if (a[n] == '(' && x != 0)\n        x = x - 1;\n    }\n    for (z = 1; z <= i - 1; z++)\n      printf(\"%c\", b[z]);\n    printf(\"\\n\");\n    for (r = 1; r <= i; r++)\n      b[r] = '\\0';\n  }\n}\n"}
{"label": "17", "index": "30970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nchar b[150];\nint sig[150];\nint main() {\n  int i, k = 0;\n  while (cin >> a) {\n    k = 0;\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      b[i] = a[i];\n      if (a[i] == '(') {\n        b[i] = '$';\n        sig[k] = i;\n        k++;\n      }\n      if (a[i] == ')') {\n        k--;\n        if (k < 0) {\n          b[i] = '?';\n          k = 0;\n        } else {\n          b[sig[k]] = 'a';\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << \" \";\n      else\n        printf(\"%c\", b[i]);\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "17", "index": "30971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f1(char zichuan[], int changdu) {\n  int i, n;\n  for (i = changdu - 1; i >= 0; i--) {\n    if (zichuan[i] == '(') {\n      n = i + 1;\n      while (zichuan[n] != ')')\n        n = n + 1;\n\n      if (n < changdu) {\n        zichuan[i] = ' ';\n        zichuan[n] = ' ';\n      }\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int i = 0, changdu;\n  char s[100];\n  while (cin >> s) {\n    changdu = strlen(s);\n    printf(\"%s \", s);\n    f1(s, changdu);\n    for (i = 0; i < changdu; i++) {\n      switch (s[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        break;\n      default:\n        s[i] = ' ';\n        break;\n      }\n    }\n    for (i = 0; i < changdu; i++)\n      printf(\"%c\", s[i]);\n\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30972", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, x = 0, y, z;\n  char c[105];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char b[105] = {0};\n\n    cin >> b;\n    m = strlen(b);\n    for (j = 0; j < m; j++) {\n      if (b[j] == '(')\n        c[j] = '$';\n      else if (b[j] == ')') {\n        c[j] = '?';\n      } else if (b[j] != '(' && b[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (c[j] == '?') {\n        z = 0;\n        y++;\n        for (x = j; x >= 0; x--) {\n          if (c[x] == '$') {\n            z++;\n            if (x == j - 1 || y == z) {\n              y--;\n              c[x] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (x == -1) {\n          y--;\n          c[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", c[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[110];\n  char b[110];\n  char c[110];\n  while (cin >> a) {\n    strcpy(b, a);\n    strcpy(c, a);\n    int i, j;\n    int n = strlen(a);\n    int ju = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[j] = 99;\n            b[i] = b[j] = 32;\n            break;\n          }\n        }\n        if (j == n)\n          b[i] = '$';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 32 && b[i] != ')' && b[i] != '$')\n        b[i] = 32;\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    printf(\"%s \", c);\n    printf(\"%s \", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[1000], label[1000];\n  int pos[1000];\n  int len, i;\n  while (cin.getline(line, 1000)) {\n    int left = 0, right = 0, s = -1;\n    len = strlen(line);\n    for (i = 0; i < 1000; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++s] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          s--;\n        }\n      }\n    }\n    if (s >= 0) {\n      for (i = 0; i <= s; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findRight(char s[], int pos, int l) {\n  int t;\n  if (s[pos] == '\\0')\n    return -1;\n  if (s[pos] == '(') {\n    t = findRight(s, pos + 1, l + 1);\n    if (t == -1) {\n      s[pos] = '$';\n      return -1;\n    } else {\n      s[pos] = ' ';\n      return findRight(s, t + 1, l);\n    }\n  } else if (s[pos] == ')') {\n    if (l == 0) {\n      s[pos] = '?';\n      findRight(s, pos + 1, l);\n    } else {\n      s[pos] = ' ';\n      return pos;\n    }\n  } else {\n    s[pos] = ' ';\n    return findRight(s, pos + 1, l);\n  }\n}\nint main() {\n  char s[1000];\n  for (; scanf(\"%s \", s);) {\n    cout << s << '\\n';\n    findRight(s, 0, 0);\n    cout << s << '\\n';\n  }\n}\n"}
{"label": "17", "index": "30976", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int len, i, j, flag;\n  while (scanf(\"%s \", s)) {\n    strcpy(c, s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      flag = 0;\n      if (s[i] == 41) {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == 40) {\n            flag++;\n            break;\n          }\n        }\n        if (flag == 1) {\n          s[i] = 32;\n          s[j] = 32;\n        } else\n          s[i] = '?';\n      }\n    }\n    printf(\"%s \", c);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '?')\n        printf(\"?\");\n      else {\n        if (s[i] == 40)\n          printf(\"$\");\n        else\n          printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105] = {0}, b[105] = {0}, c[105] = {0};\n  int len;\n  int i = 0, j = 0;\n  while (scanf(\"%s \", a)) {\n\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      c[i] = a[i];\n    for (i = 0; i < len; i++) {\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[i] = '.';\n            c[j] = '.';\n            break;\n          }\n        }\n        if (j == -1) {\n          b[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        b[i] = '$';\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << ' ';\n      else\n        printf(\"%c\", b[i]);\n    }\n    cout << endl;\n    i = 0;\n    j = 0;\n    memset(a, 0, sizeof(a));\n    memset(b, 0, sizeof(b));\n    memset(c, 0, sizeof(c));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[100], b[100];\n  int left[100], k = 0, len, i;\n  while (scanf(\"%s\", &a) != EOF) {\n    len = strlen(a);\n    puts(a);\n    for (i = 0; i < len; i++) {\n      b[i] = 32;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        k++;\n        left[k] = i;\n      }\n    }\n    for (; k > 0; k--) {\n      for (i = left[k]; i < len; i++) {\n        if (a[i] == ')') {\n          a[i] = ' ';\n          a[left[k]] = ' ';\n          break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n      }\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(char c[], char str[], int n) {\n  int a, i, j;\n  for (i = 0; i <= n - 1; i++) {\n    if (c[i] == '(') {\n      a = 1;\n      for (j = i + 1; j <= n - 1; j++) {\n        if (c[j] == '(')\n          a++;\n        else {\n          if (c[j] == ')')\n            a--;\n        }\n        if (a == 0)\n          break;\n      }\n      if (a > 0)\n        str[i] = '$';\n    }\n    if (c[i] == ')') {\n      a = -1;\n      for (j = i - 1; j >= 0; j--) {\n        if (c[j] == ')')\n          a--;\n        else if (c[j] == '(')\n          a++;\n        if (a == 0)\n          break;\n      }\n      if (a < 0)\n        str[i] = '?';\n    }\n  }\n}\nint main() {\n  int r = 0;\n  while (r <= 5) {\n    char c[110] = {0}, str[110] = {0};\n    int n, i;\n\n    scanf(\"%s \", c);\n    n = strlen(c);\n    for (i = 0; i <= n - 1; i++)\n      str[i] = ' ';\n    f(c, str, n);\n    puts(c);\n    puts(str);\n    r++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30980", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101] = {'\\0'}, b[101] = {'\\0'};\n  int i, j;\n  while (cin.getline(a, 101)) {\n    for (i = 0; i < 101; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    cout << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = '\\0';\n      b[i] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {'\\0'};\n  while ((scanf(\"%s\", a)) != -1) {\n    printf(\"%s\\n\", a);\n    int b, c, d;\n    for (b = 0; b < 100; b++) {\n      if (a[b] == ')') {\n        for (c = b - 1; c >= 0; c--) {\n          if (a[c] == '(') {\n            a[c] = 'a';\n            a[b] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (d = 0; d < 100; d++) {\n      if (a[d] == ')')\n        printf(\"?\");\n      else if (a[d] == '(')\n        printf(\"$\");\n      else if (a[d] != '\\0')\n        printf(\" \");\n      a[d] = '\\0';\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  int LeftParenIndex[100];\n  char str[101];\n  while (cin >> str) {\n    int i, top = 0;\n    puts(str);\n    for (i = 0; str[i]; i++) {\n      if (str[i] == '(')\n        LeftParenIndex[top++] = i;\n      else if (str[i] == ')') {\n        if (top == 0)\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n          str[LeftParenIndex[--top]] = ' ';\n        }\n      } else\n        str[i] = ' ';\n    }\n    for (i = 0; i < top; i++)\n      str[LeftParenIndex[i]] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30983", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[101];\nint find(char a[], int b, int x) {\n  int i;\n  for (i = b; i < x; i++) {\n    if (a[i + 1] == '$') {\n      return 0;\n    }\n    if (a[i + 1] == '?') {\n      a[i + 1] = ' ';\n      a[b] = ' ';\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin.getline(a, 101)) {\n    \n    int x = strlen(a), i, l[100], t = 0, temp;\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < x; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n        l[t] = i;\n        t++;\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; (i < t) && (i >= 0);) {\n      if (a[l[i]] == ' ') {\n        i++;\n        continue;\n      }\n      temp = find(a, l[i], x);\n      if (temp == 0)\n        i++;\n      if (temp == 1) {\n        i = 0;\n        continue;\n      }\n    }\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30984", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar input[150], output[150];\nint main() {\n  int n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%s\", input);\n    memset(output, 0, sizeof(output));\n    int count1 = 0, count2 = 0;\n    int i;\n    for (i = 0; i < strlen(input); ++i) {\n      output[i] = ' ';\n      if (input[i] == ')') {\n        if (count1 <= 0)\n          output[i] = '?';\n        else\n          count1--;\n      } else if (input[i] == '(')\n        count1++;\n    }\n    for (i = strlen(input); i >= 0; --i) {\n      if (input[i] == '(') {\n        if (count2 <= 0)\n          output[i] = '$';\n        else\n          count2--;\n      } else if (input[i] == ')')\n        count2++;\n    }\n    printf(\"%s\\n%s\\n\", input, output);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30985", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[110] = {0};\n\n  while (cin >> str) {\n    int change[110] = {0};\n    char ans[110] = {0};\n    int len = strlen(str);\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(')\n        change[i] = 1;\n      else if (str[i] == ')')\n        change[i] = -1;\n      else\n        change[i] = 0;\n    }\n    int sum = 0;\n    for (int i = 0; i < len; i++) {\n      sum += change[i];\n      if (sum < 0) {\n        ans[i] = '?';\n        sum = 0;\n      }\n    }\n    sum = 0;\n    for (int i = len - 1; i >= 0; i--) {\n      sum += change[i];\n      if (sum > 0) {\n        ans[i] = '$';\n        sum = 0;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (ans[i] != '?' && ans[i] != '$')\n        ans[i] = ' ';\n    }\n    cout << str << endl;\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30986", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, m = 0;\nchar a[100] = {'\\0'};\nvoid pipei(int m, char a[]) {\n  int i, j;\n  for (i = m; i <= k - 1; i++) {\n    if (a[i] == ')')\n      break;\n\n    if (a[i] != '(' && a[i] != ')') {\n      a[i] = ' ';\n    }\n  }\n  m = i + 1;\n  for (j = i; j >= 0; j--) {\n    if (i == k && a[k - 1] != ')')\n      break;\n    if (a[j] == '(') {\n      a[j] = ' ';\n      a[i] = ' ';\n      break;\n    }\n  }\n  if (m <= k - 1)\n    pipei(m, a);\n}\nint main() {\n\n  while (cin >> a) {\n    k = strlen(a);\n    int i;\n    cout << a << endl;\n    pipei(0, a);\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (i = 0; i <= k - 1; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < 100; i++) {\n      a[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "30987", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101] = {'\\0'}, b[101] = {'\\0'};\n  int i, j;\n  while (cin.getline(a, 101)) {\n    for (i = 0; i < 101; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    cout << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = '\\0';\n      b[i] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30988", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len;\nchar str[101];\nvoid f(int p) {\n  int m = -1, n = -1;\n  for (int i = p; i >= 0; i--) {\n    if (*(str + i) == '(') {\n      m = i;\n      break;\n    }\n  }\n  for (int i = m + 1; i <= len - 1; i++) {\n    if (*(str + i) == ')') {\n      n = i;\n      break;\n    }\n  }\n  if (m >= 0 && n >= 0) {\n    str[m] = '#';\n    str[n] = '#';\n  }\n  if (m > 0) {\n    f(m - 1);\n  }\n}\n\nint main() {\n  while (scanf(\"%s \", str)) {\n    len = strlen(str);\n    cout << str << endl;\n    f(len);\n    for (int j = 0; j <= len - 1; j++) {\n      if (str[j] == '(')\n        cout << \"$\";\n      else if (str[j] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  int i, left = 0, right = 0;\n  char str[102], b[102];\n  while (cin.getline(str, 102)) {\n    len = strlen(str);\n    left = 0;\n    right = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      b[i] = ' ';\n      if (str[i] == '(')\n        left++;\n      if (str[i] == ')') {\n        if (left <= 0)\n          b[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == ')')\n        right++;\n      if (str[i] == '(') {\n        if (right <= 0)\n          b[i] = '$';\n        else\n          right--;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint left(int x, char s[], int n); \nint main() {\n  int l;\n  char c[101] = {0};\n\n  cin >> c;\n  puts(c);\n  l = left(0, c, 0);\n  printf(\"%s\", c);\n  while ((scanf(\"%s\", c) != EOF)) {\n    printf(\" \");\n    puts(c);\n    l = left(0, c, 0);\n    printf(\"%s\", c);\n  }\n  return 0;\n}\nint left(int x, char s[], int n) {\n  int a;\n  if (s[n] != '\u0000') {\n    if (s[n] == '(') {\n      a = left(x + 1, s, n + 1);\n      if (a > 0) {\n        s[n] = ' ';\n        return (a - 1);\n      } else {\n        s[n] = '$';\n        return 0;\n      }\n    } else if (s[n] == ')') {\n      if (x > 0) {\n        s[n] = ' ';\n        return (left(x - 1, s, n + 1) + 1);\n      } else {\n        s[n] = '?';\n        return (left(0, s, n + 1) + 1);\n      }\n    } else {\n      s[n] = ' ';\n      return left(x, s, n + 1);\n    }\n  } else\n    return 0;\n}\n"}
{"label": "17", "index": "30991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n  return;\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else {\n      s[i] = ' ';\n    }\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  int n;\n  cin >> n;\n  while (n--) {\n    cin >> live;\n    cout << live << endl;\n    Find(live);\n    printf(\"%s\\n\", live);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint n, c1 = 0;\nint match(int c) {\n  for (int i = c; i < n; i++) {\n    if (a[i] != '(' && a[i] != ')' && a[i] != '$')\n      a[i] = ' ';\n    if (a[i] == '(') {\n      c1++;\n      if (match(i + 1) != 0) {\n        a[i] = ' ';\n        a[match(i + 1)] = ' ';\n        c1--;\n      } else\n        a[i] = '$';\n    }\n    if (a[i] == ')') {\n      if (c1 == 0) {\n        a[i] = '?';\n        if (i < n) {\n          match(i + 1);\n          return 0;\n        }\n      }\n      return i;\n    }\n  }\n  return 0;\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    c1 = 0;\n    n = strlen(a);\n    cout << a << endl;\n    match(0);\n    printf(\"%s\\n\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], s;\n  int i, j, k, l, m, n, t, b[100], c[100];\n  for (;;) {\n\n    cin >> a;\n    if (a[0] == ' ')\n      break;\n    n = strlen(a);\n    for (i = 0, j = 0, k = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[j] = i;\n        j++;\n      } else if (a[i] == ')') {\n        c[k] = i;\n        k++;\n      }\n    }\n    for (i = n - 1; i >= 0; i--) {\n      for (l = j - 1; l >= 0; l--) {\n        if (b[l] == i) {\n          for (t = 0; t < k; t++) {\n            if (c[t] > i) {\n              b[l] = -1;\n              c[t] = -1;\n              break;\n            }\n          }\n          break;\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < n; i++) {\n      for (l = 0; l < j; l++) {\n        if (b[l] == i) {\n          printf(\"$\");\n          break;\n        }\n      }\n      if (l != j)\n        continue;\n      for (t = 0; t < k; t++) {\n        if (c[t] == i) {\n          printf(\"?\");\n          break;\n        }\n      }\n      if (t != k)\n        continue;\n      cout << \" \";\n    }\n\n    cout << \" \";\n    a[0] = ' ';\n  }\n}\n"}
{"label": "17", "index": "30994", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin.getline(in, 101) && in[0] != '\\0') {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    printf(\"%s\\n\", in);\n    cout << out << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30995", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[200], b[200];\nint l;\nvoid f36(int i) {\n  int j;\n  for (j = i + 1; j < l; j++) {\n    if (b[j] != 32) {\n      if (b[j] == 63) {\n        b[j] = 32;\n        b[i] = 32;\n      }\n      break;\n    }\n  }\n}\nint g(void) {\n\n  scanf(\"%s \", a);\n  if (a[0] == 0)\n    return 0;\n  else\n    return 1;\n}\nvoid k(void) {\n  l = strlen(a);\n  int i, n = 0, p;\n  for (i = 0; i < l; i++) {\n    b[i] = 32;\n    if (a[i] == 40) {\n      b[i] = 36;\n      n = n + 1;\n    }\n    if (a[i] == 41) {\n      b[i] = 63;\n      n = n + 1;\n    }\n  }\n  for (p = 1; p <= n; p++)\n    for (i = 0; i < l; i++) {\n      if (b[i] == 36) {\n        f36(i);\n      }\n    }\n  printf(\"%s \", a);\n  for (i = 0; i < l; i++) {\n    printf(\"%c\", b[i]);\n  }\n  printf(\" \");\n  a[0] = 0;\n}\nint main() {\n  int n = 1;\n  while (n == 1) {\n    n = g();\n    if (n == 0)\n      break;\n    k();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid del(char a[], int n) {\n  int i = 0;\n  while (a[i] != ')' && i < n)\n    i++;\n  int j;\n  j = i - 1;\n  while (a[j] != '(' && j >= 0)\n    j--;\n  if (i < n && j >= 0) {\n    a[i] = ' ';\n    a[j] = ' ';\n    del(a, n);\n  } else {\n    if (i >= n && j >= 0)\n      a[j] = '$';\n    if (j < 0 && i < n)\n      a[i] = '?';\n    if (!(i >= n && j < 0))\n      del(a, n);\n  }\n}\n\nint main() {\n  while (!cin.eof()) {\n    char a[101];\n    cin.getline(a, 101);\n    cout << a << endl;\n    int n, i;\n    n = strlen(a);\n    del(a, n);\n    for (i = 0; i < n; i++)\n      switch (a[i]) {\n      case '$':\n      case '?':\n        cout << a[i];\n        break;\n      default:\n        cout << \" \";\n      }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findl(int i, char a[102], int n);\nint find(int i, char a[102]);\nint main() {\n  char a[102];\n  memset(a, '\\n', 102);\n  while (cin >> a) {\n    int n = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < n; i++) {\n      int x = 0;\n      if (a[i] == '(' && findl(i, a, n) > n)\n        cout << \"$\";\n      else if (a[i] == ')' && find(i, a) < 0)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n}\nint findl(int i, char a[102], int n) {\n  int k = i + 1;\n  while (k < n) {\n    if (a[k] == '(')\n      k = findl(k, a, n);\n    else if (a[k] == ')')\n      return k;\n    k++;\n  }\n  return n + 1;\n}\nint find(int i, char a[102]) {\n  int k = i - 1;\n  while (k >= 0) {\n    if (a[k] == ')')\n      k = find(k, a);\n    else if (a[k] == '(')\n      return k;\n    k--;\n  }\n  return -1;\n}\n"}
{"label": "17", "index": "30998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int l, i, j, p = 0;\n  while (scanf(\"%s\", a) != EOF) {\n\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      p = 0;\n      if (a[i] == '(') {\n        for (j = i; j < l; j++) {\n          if (a[j] == '(')\n            p++;\n          if (a[j] == ')')\n            p--;\n          if (p == 0)\n            break;\n        }\n        if (p != 0)\n          a[i] = '$';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = l - 1; i >= 0; i--) {\n      p = 0;\n      if (a[i] == ')') {\n\n        for (j = i; j >= 0; j--) {\n\n          if (a[j] == ')')\n            p++;\n          if (a[j] == ' ')\n            p--;\n          if (p == 0)\n            break;\n        }\n        if (p != 0)\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        a[i] = ' ';\n    }\n\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "30999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len, i, h;\n  char c[102];\n  int a[101];\n  int b[101];\n  while ((cin.getline(c, 101))) {\n    len = strlen(c);\n    printf(\"%s\\n\", c);\n    h = 0;\n    for (i = 0; i <= len; i++)\n      a[i] = -1;\n    memset(b, 0, sizeof(b));\n    for (i = 0; i <= len - 1; i++) {\n      switch (c[i]) {\n      case '(': {\n        h++;\n        a[h] = i;\n        break;\n      }\n      case ')': {\n        if (h == 0) {\n          b[i] = 2;\n        } else {\n          a[h] = 0;\n          h--;\n        }\n        break;\n      }\n      }\n    }\n    for (i = 1; i <= h; i++) {\n      if (a[i] != -1)\n        b[a[i]] = 1;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (b[i] == 1)\n        cout << '$';\n      if (b[i] == 2)\n        printf(\"?\");\n      if (b[i] == 0)\n        cout << ' ';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[105];\n  while (cin >> a) {\n    int n = strlen(a);\n    int i = 0, j, b[105];\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')') {\n        b[i] = -1;\n      } else\n        b[i] = 0;\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == -1) {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(a);\n    cout << \" \";\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      else if (b[i] == 1)\n        printf(\"$\");\n      else\n        cout << \"?\";\n    }\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31001", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin >> in) {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    cout << in << endl;\n    printf(\"%s\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[150] = {'0'}, b[150] = {'0'};\n  for (; ~scanf(\"%s\", &a);) {\n    i = strlen(a);\n    for (j = 0; j < i; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    for (j = 0; j < i; j++)\n      for (k = j - 1; k >= 0; k--) {\n        if (b[k] == '$' && b[j] == '?') {\n          b[k] = ' ';\n          b[j] = ' ';\n        }\n      }\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < i; k++)\n      printf(\"%c\", b[k]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10][20], b[10][20];\n  int t, y, u = 0;\n  while (scanf(\"%s\", a[u]) != EOF) {\n    strcpy(b[u], a[u]);\n    for (t = 0; a[u][t] != 0; t++) {\n      if (a[u][t] != 40 && a[u][t] != 41)\n        b[u][t] = 32;\n      if (b[u][t] == 41) {\n        for (y = t; y > -1; y--) {\n          if (b[u][y] == 40) {\n            b[u][y] = 32;\n            b[u][t] = 32;\n            break;\n          }\n        }\n      }\n    }\n    for (t = 0; b[u][t] != 0; t++) {\n      if (b[u][t] == 40)\n        b[u][t] = 36;\n      else if (b[u][t] == 41)\n        b[u][t] = 63;\n    }\n    puts(a[u]);\n    puts(b[u]);\n    u++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31004", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, l, i, k;\n  char str[200] = {0};\n  scanf(\"%d\\n\", &n);\n  while (n) {\n    scanf(\"%s\", str);\n    puts(str);\n    printf(\"\\n\");\n    l = strlen(str);\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (k = i; k < l; k++) {\n          if (str[k] == ')') {\n            str[i] = ' ';\n            str[k] = ' ';\n            k = l;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      } else {\n        if (str[i] == ')')\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n        }\n      }\n    }\n    puts(str);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {0};\n  while (true) {\n    int i = 0;\n    while (true) {\n      str[i] = getchar();\n      if (str[i] == '\\n')\n        break;\n      i++;\n    }\n    int n, j = 0, biaoji = 0;\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << endl;\n    for (i = 0; i <= n; i++) {\n      biaoji = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            biaoji = 1;\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n        if (biaoji == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i <= n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else if (str[i] != '$' && str[i] != '?')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= n; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31006", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, t, k;\n  char a[101], c[101];\n  scanf(\"%d \", &t);\n  getchar();\n  for (k = 0; k < t; k++) {\n\n    cin >> a;\n    int l = strlen(a);\n    c[l] = '\u0000';\n    for (j = 0; j < l; j++) {\n      c[j] = a[j];\n      if (a[j] == '(')\n        m++;\n      if (a[j] != '(' && a[j] != ')')\n        c[j] = ' ';\n    }\n    puts(a);\n    for (i = 0; i < m + 1; i++) {\n      char x = ')';\n      int y = -1;\n      for (j = 0; j < l; j++) {\n        if (c[j] == '(' || c[j] == ')') {\n          if (c[j] == '(') {\n          } else {\n            if (x == '(') {\n              c[j] = ' ';\n              c[y] = ' ';\n            }\n          }\n          y = j;\n          x = c[j];\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100];\nchar a[100];\nint b[100];\nint num = 0;\nint i, j;\nvoid f() {\n  for (i = 0; i < strlen(s); i++) {\n    a[i] = ' ';\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      b[num] = i;\n      a[i] = '$';\n      num++;\n\n    } else if (s[i] == ')' && num > 0) {\n      num--;\n      a[b[num]] = ' ';\n\n    } else if (s[i] == ')' && num <= 0)\n      a[i] = '?';\n  }\n  for (i = 0; i < strlen(s); i++) {\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  while (cin >> s) {\n    num = 0;\n    cout << s << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint lenth, b[200];\nchar a[200];\nvoid match(int n) {\n  for (int i = n - 1; i >= 0; i--)\n    if (b[i] == 1) {\n      b[i] = 0;\n      b[n] = 0;\n      break;\n    }\n}\nint main() {\n  while (cin.getline(a, 105)) {\n    for (int i = 0; i < strlen(a); i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 0;\n      }\n    }\n    for (int i = 0; i < strlen(a); i++) {\n      if (b[i] == 2)\n        match(i);\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      switch (b[i]) {\n      case 0:\n        printf(\" \");\n        break;\n      case 1:\n        cout << '$';\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid kuohao(char c[]) {\n  int i, j, n;\n  for (n = 0; c[n] != '\\0'; n++)\n    ;\n  for (i = n - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      for (j = i + 1; c[j] != '\\0'; j++)\n        if (c[j] == ')') {\n          c[i] = c[j] = ' ';\n          break;\n        }\n      if (c[j] == '\\0') {\n        c[i] = '$';\n      }\n      kuohao(c);\n    }\n  }\n}\n\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    printf(\"%s\\n\", c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' ';\n    kuohao(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?';\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31010", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (s[j] == '(') {\n            i = j;\n          } else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == len)\n          break;\n\n        i = -1;\n      }\n    }\n    for (q = 0; q < len; q++) {\n      if (s[q] == ')') {\n        s[q] = '?';\n      } else if (s[q] == '(')\n        s[q] = '$';\n      else\n        s[q] = ' ';\n    }\n    printf(\"%s \", ss);\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char kuohaoin[201] = {0}, kuohao1[201] = {0}, kuohaoout[201] = {0};\n  int i, j, len;\n  while (cin >> kuohaoin) {\n    len = strlen(kuohaoin);\n    for (i = 0; i < len; i++) {\n      kuohao1[i] = kuohaoin[i];\n      kuohaoout[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (kuohao1[i] == '(') {\n        kuohaoout[i] = '$';\n        for (j = i + 1; j < len; j++) {\n          if (kuohao1[j] == ')') {\n            kuohao1[j] = 's';\n            kuohaoout[i] = ' ';\n            kuohao1[i] = 's';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      if (kuohao1[i] == ')')\n        kuohaoout[i] = '?';\n    cout << kuohaoin << endl;\n    printf(\"%s\\n\", kuohaoout);\n    for (i = 0; i < len; i++) {\n      kuohaoin[i] = 0;\n      kuohao1[i] = 0;\n      kuohaoout[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[201], b[201], c[201];\n  int l, i, m, d[201], y, j;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    strcpy(b, a);\n    for (i = 0; i < l; i++) {\n      b[i] = ' ';\n    }\n    strcpy(c, a);\n  loop:\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            break;\n          else {\n            if (a[j] == ')') {\n              a[i] = a[j] = 'a';\n              goto loop;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')')\n        b[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", c, b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, k, lena;\nchar a[101];\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    lena = strlen(a);\n    for (i = 0; i < lena; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = '*';\n            a[j] = '*';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < lena; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31014", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  do {\n    char s[101] = {0}, S[101] = {0};\n    int i, len, m;\n\n    cin >> s;\n    strcpy(S, s);\n\n    len = strlen(s);\n\n    if (len == 0)\n      break;\n\n    m = 0;\n    do {\n\n      for (i = m; i < len; i++) {\n        if (s[i] == ')')\n          break;\n      }\n\n      m = i;\n\n      if (m == len)\n        break;\n\n      else {\n        for (i = m; i >= 0; i--)\n          if (s[i] == '(') {\n            s[i] = '1';\n            s[m] = '1';\n            break;\n          }\n      }\n\n      m = m + 1;\n\n    } while (1);\n\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n    }\n\n    printf(\"%s \", S);\n    puts(s);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "17", "index": "31015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[200];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    int j;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')') {\n        int s;\n        for (s = j - 1; s >= 0; s--) {\n          if (a[s] == '(') {\n            a[s] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')')\n        printf(\"?\");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char a[500] = {0}, b[500] = {0};\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else\n        b[i] = ' ';\n\n      i++;\n    }\n\n    cout << b;\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31017", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%s \", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], t[101];\n  int i, j, k, c, b[101] = {0}, n;\n  for (; cin >> a;) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      t[i] = ' ';\n    }\n    for (i = 0; i <= n; i++) {\n\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 0) {\n            b[i] = 1;\n            b[j] = 1;\n            break;\n          }\n        if (j == -1) {\n          c++;\n          t[i] = '?';\n        }\n      }\n      if (a[i] == '\\0')\n        for (k = 0; k < i; k++) {\n          if (a[k] == '(' && b[k] == 0) {\n            c++;\n            t[k] = '$';\n          }\n        }\n    }\n    printf(\"%s\\n\", a);\n    if (c != 0) {\n      i = 0;\n      while (t[i] == ' ')\n        i++;\n      k = n - 1;\n      while (t[k] == ' ')\n        k--;\n      for (j = i; j <= k; j++)\n        cout << t[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31019", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[110];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    int b[110] = {0};\n    scanf(\"%s\", a);\n    m = strlen(a);\n    for (j = 0; j < m; j++) {\n      if (a[j] == '(')\n        b[j] = 1;\n      else if (a[j] == ')')\n        b[j] = -1;\n    }\n    for (j = m - 1; j >= 0; j--) {\n      if (b[j] == 1) {\n        for (k = j; k < m; k++) {\n          if (b[k] == -1) {\n            b[j] = 0;\n            b[k] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < m; k++) {\n      if (b[k] == 1)\n        printf(\"$\");\n      else if (b[k] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31020", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101] = {0};\n  while (scanf(\"%s\", s) != EOF) {\n    int i, j, l, t1, t2;\n    printf(\"%s\\n\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(') {\n        t1 = 1;\n        t2 = 0;\n        for (j = i + 1; j < l; j++) {\n          if (s[j] == '(')\n            t1++;\n          if (s[j] == ')')\n            t2++;\n          if (t1 == t2) {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[200];\n  int i, j, k, m, n;\n  int flag = 0;\n  int left[100], l = 1;\n  while (scanf(\"%s \", str)) {\n    printf(\"%s\\n\", str);\n    flag = 0;\n    l = 1;\n    for (n = 1; n < 100; n++)\n      left[n] = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (j = l - 1; j >= 1; j--) {\n      flag = 0;\n      for (k = left[j] + 1; str[k] != '\\0'; k++) {\n        if (str[k] == ')') {\n          str[left[j]] = ' ';\n          str[k] = ' ';\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        str[left[j]] = '$';\n      }\n    }\n    for (m = 0; str[m] != '\\0'; m++)\n      if (str[m] == ')')\n        str[m] = '?';\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31022", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint dg(int a, int b);\n\nchar st[1000], st2[1000];\n\nint main() {\n  while (cin.getline(st, 1000)) {\n\n    st2[strlen(st)] = '\\0';\n    dg(1, 0);\n    printf(\"%s\\n%s\\n\", st, st2);\n  }\n  return 0;\n}\nint dg(int a, int b) {\n  for (int i = a; i <= strlen(st); i++) {\n\n    if (st[i - 1] == '(') {\n\n      int t = dg(i + 1, i);\n      if (t == 0) {\n        st2[i - 1] = '$';\n        break;\n      }\n      if (t > 0) {\n        st2[i - 1] = ' ';\n        i = t;\n        continue;\n      }\n    } else if (st[i - 1] == ')') {\n\n      if (b == 0)\n        st2[i - 1] = '?';\n      if (b > 0) {\n        st2[i - 1] = ' ';\n        return i;\n      }\n    } else\n      st2[i - 1] = ' ';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n\n    char str[300];\n    int i, j, k, a1 = 0, js1 = 0, l;\n\n    cin >> str;\n    if (feof(stdin))\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == ')' && a1 == 0) {\n        str[i] = '?';\n      }\n      if (str[i] == ')' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '?';\n      }\n    }\n    a1 = 0;\n    js1 = 0;\n\n    for (; i >= 0; i--) {\n      if (str[i] == ')') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == '(' && a1 == 0) {\n        str[i] = '$';\n      }\n      if (str[i] == '(' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '$';\n      }\n    }\n\n    for (i = 0; i < l; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    puts(str);\n  }\n}\n"}
{"label": "17", "index": "31024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n  int pp = 2;\n  int ww = 0;\n  for (int pa = 10; pa <= pp + 9; pa++) {\n    for (int i = 1; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    if (a[1] == '(' && a[2] == ')' && ww == 0) {\n      pa = pa - 4;\n      ww = 1;\n    }\n    if (a[1] == '(' && a[3] == ')' && ww == 0) {\n      pa = pa - 3;\n      ww = 1;\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1) {\n        cout << \" \";\n      } else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31025", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    cin >> a;\n    printf(\"%s\\n\", a);\n    for (i = strlen(a) - 2; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++) {\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        putchar('$');\n      else if (a[i] == ')')\n        putchar('?');\n      else\n        putchar(' ');\n    }\n    putchar('\\n');\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31026", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, x = 0, y, z;\n  char c[105];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char b[105] = {0};\n\n    scanf(\"%s \", b);\n    m = strlen(b);\n    for (j = 0; j < m; j++) {\n      if (b[j] == '(')\n        c[j] = '$';\n      else if (b[j] == ')') {\n        c[j] = '?';\n      } else if (b[j] != '(' && b[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (c[j] == '?') {\n        z = 0;\n        y++;\n        for (x = j; x >= 0; x--) {\n          if (c[x] == '$') {\n            z++;\n            if (x == j - 1 || y == z) {\n              y--;\n              c[x] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (x == -1) {\n          y--;\n          c[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", c[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, t, len;\n  char a[100];\n  while (scanf(\"%s \", a)) {\n    t = 0;\n    m = 0;\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')')\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n    }\n    for (i = 0; i < len; i++)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        m = i;\n        break;\n      }\n    for (i = len - 1; i >= 0; i--)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        t = i;\n        break;\n      }\n    for (i = m; i <= t; i++) {\n      if (a[i] == ')')\n        cout << \"?\";\n      else if (a[i] == '(')\n        printf(\"$\");\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31028", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(char *out, int t) {\n  int i = t;\n  if (out[i] == '(') {\n    out[i] = '$';\n    i++;\n    while (out[i] != ')' && out[i]) {\n      if (out[i] == '(') {\n        i = function_1(out, i) + 1;\n        if (i == -1)\n          return -2;\n      } else {\n        out[i] = ' ';\n        i++;\n      }\n    }\n    if (out[i] == ')') {\n      out[t] = out[i] = ' ';\n      return i;\n    } else\n      return -2;\n  } else {\n    while (out[i] != '(' && out[i]) {\n      if (out[i] == ')')\n        out[i] = '?';\n      else\n        out[i] = ' ';\n      i++;\n    }\n    if (out[i] == '(')\n      return function_1(out, i);\n    else\n      return -2;\n  }\n}\n\nint main() {\n  char out[101];\n  int n = -1;\n  cin.getline(out, 101);\n  while (out[0]) {\n    n = -1;\n    printf(\"%s\\n\", out);\n    while (n != -2) {\n      n = function_1(out, n + 1);\n    }\n    printf(\"%s\\n\", out);\n    cin.getline(out, 101);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31029", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[101] = {0};\nint zuo[101] = {0};\nint n = 0;\nvoid change(int x) {\n  if (a[x] != 0) {\n    if (a[x] == '(')\n      zuo[++n] = x;\n    else if (a[x] == ')') {\n      if (n > 0) {\n        a[x] = ' ';\n        a[zuo[n--]] = ' ';\n      }\n    } else\n      a[x] = ' ';\n    change(x + 1);\n  }\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    n = 0;\n    change(0);\n    for (int i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        cout << \"?\";\n      else\n        cout << a[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int i, j;\n  char a[101], b[101], c[101];\n  for (;;) {\n\n    scanf(\"%s \", a);\n\n    if (strcmp(c, a) == 0)\n      break;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == '(')\n        b[i] = '$';\n      else\n        b[i] = ' ';\n    }\n\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (b[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", b[i]);\n    printf(\" \");\n    strcpy(c, a);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j;\n  char A[200];\n  while (cin.getline(A, 200, '\\n')) {\n    cout << A << endl;\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '(')\n        A[i] = '$';\n      else {\n        if (A[i] == ')')\n          A[i] = '?';\n        else\n          A[i] = ' ';\n      }\n    }\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (A[j] == '$') {\n            A[i] = ' ';\n            A[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << A << \"\\n\";\n    memset(A, '\\0', sizeof(A));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31032", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int n, i, j, k, m;\n  int len;\n  char c[101] = {'0'};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (j = len - 1; j >= 0; j--) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == '(' && j == len - 1)\n        c[j] = '$';\n      if (c[j] == '(') {\n        k = j;\n        for (m = k; m < len; m++) {\n          if (c[m] == ')') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n        if (m == len - 1 && c[len - 1] != ' ') {\n          c[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (c[j] == ')')\n        c[j] = '?';\n      if (c[j] == '(')\n        c[j] = '$';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31033", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid find() {\n  char ch[101];\n\n  memset(ch, '\\0', sizeof(ch));\n  while (cin.getline(ch, 1000, '\\n')) {\n    cout << ch << endl;\n    int i = 0, j = 0;\n    int num = 0;\n    for (i = 0; i < 100; i++)\n      if (ch[i] == '(') {\n        num = 0;\n        for (j = i; j < 100; j++) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num > 0) {\n          ch[i] = '$';\n        }\n      }\n    for (i = 99; i >= 0; i--)\n      if (ch[i] == ')') {\n        num = 0;\n        for (j = i; j >= 0; j--) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num < 0)\n          ch[i] = '?';\n      }\n    int len;\n    len = strlen(ch);\n    for (i = 0; i < len; i++)\n      if (ch[i] != '$' && ch[i] != '?')\n        ch[i] = ' ';\n    cout << ch << endl;\n  }\n}\nint main() {\n\n  find();\n  return 0;\n}\n"}
{"label": "17", "index": "31034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Find(char *);\nint main() {\n  int i;\n  char str[101];\n  char mark[101];\n  while (cin.getline(str, 101)) {\n    memset(mark, 0, sizeof(mark));\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n        mark[i] = '$';\n      }\n      if (str[i] == ')') {\n        mark[i] = '?';\n      }\n      if (str[i] != '(' && str[i] != ')') {\n        mark[i] = ' ';\n      }\n    }\n    Find(mark);\n    for (i = strlen(mark) - 1; i >= 0; i--)\n      if (mark[i] != ' ') {\n        mark[i + 1] = 0;\n        break;\n      }\n    for (i = 0; i < strlen(mark); i++)\n      if (mark[i] != ' ') {\n        strcpy(mark, mark + i);\n        break;\n      }\n    cout << str << \"\\n\" << mark << \"\\n\";\n  }\n  return 0;\n}\n\nvoid Find(char mark[]) {\n  int i, j = 0;\n  for (i = 0; i < strlen(mark); i++) {\n    if (mark[i] == '$') {\n      for (j = i + 1; j < strlen(mark); j++) {\n        if (mark[j] == '$') {\n          break;\n        } else {\n          if (mark[j] == '?') {\n            mark[j] = ' ';\n            mark[i] = ' ';\n            Find(mark);\n            return;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "31035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[105] = {0};\n  while (cin >> c) {\n\n    int a[105] = {0};\n\n    int n, i, j;\n    n = strlen(c);\n    for (i = 0; i < n; i++)\n      a[i] = 1;\n    for (i = n - 1; i >= 0; i--) {\n      if (c[i] == '(')\n\n      {\n\n        for (j = i; j < n; j++) {\n          if ((c[j] == ')') && (a[j] != 0)) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n\n    for (i = 0; i < n; i++) {\n      if ((c[i] == '(') && (a[i] == 1))\n\n        cout << \"$\";\n      if ((c[i] == ')') && (a[i] == 1))\n        cout << \"?\";\n      if ((c[i] != '(') && (c[i] != ')') && (c[i] != '\\0'))\n        cout << \" \";\n      if ((c[i] == '(') && (a[i] == 0))\n        cout << \" \";\n      if ((c[i] == ')') && (a[i] == 0))\n        cout << \" \";\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[101], t, n, i, j;\n  char a[101];\n  while (scanf(\"%s \", a)) {\n    for (i = 0; i < 101; i++)\n      b[i] = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        t = -1;\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '(') {\n            t--;\n          }\n          if (a[j] == ')') {\n            t++;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 1;\n      }\n      if (a[i] == ')') {\n        t = -1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            t++;\n          }\n          if (a[j] == ')')\n            t--;\n\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 2;\n      }\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      if (b[i] == 1)\n        printf(\"$\");\n      if (b[i] == 2)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int t;\n  scanf(\"%d\", &n);\n  scanf(\"\\n\");\n  char c[101] = {0};\n  char d[101] = {0};\n  int j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++) {\n      c[j] = 0;\n      d[j] = 0;\n    }\n\n    scanf(\"%s\", c);\n    t = strlen(c);\n    for (j = 0; j < t; j++) {\n      d[j] = c[j];\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[k] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n\n    printf(\"%s\", d);\n    printf(\"\\n\");\n    printf(\"%s\", c);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31038", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[105];\n  int mark[105] = {0};\n  while (cin.getline(a, 101)) {\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        mark[i] = 1;\n\n      if (a[i] == ')')\n        mark[i] = -1;\n    }\n    for (int i = 1; i < strlen(a); i++) {\n      if (mark[i] == -1) {\n        for (int j = i - 1; j >= 0; j--) {\n          if (mark[j] == 1) {\n            mark[i] = 0;\n            mark[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (mark[i] == 0)\n        cout << \" \";\n      else if (mark[i] == 1)\n        cout << \"$\";\n      else\n        cout << \"?\";\n    }\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      mark[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31039", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j, a[101], len, count;\n  while (cin.getline(str, 101)) {\n    count = 0;\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << endl;\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == ')') {\n        count++;\n        a[count] = i;\n      }\n    }\n    for (i = 1; i <= count; i++) {\n      for (j = a[i] - 1; j >= 0; j--) {\n        if (a[i] == 0) {\n          str[a[i]] = '?';\n        }\n        if (str[j] == '(') {\n          str[j] = ' ';\n          str[a[i]] = ' ';\n          break;\n        }\n      }\n      if (str[a[i]] != ' ') {\n        str[a[i]] = '?';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if ((str[i] != ' ') && (str[i] != '?') && (str[i] != '$')) {\n        str[i] = ' ';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[100] = {'\\0'};\n  int len, i, j, judge[100] = {0}; \n  while (cin >> a) {\n    len = strlen(a);\n    for (i = 0; i < len; i++) \n      b[i] = ' ';\n    for (i = 99; i >= len; i--)\n      b[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (judge[j] == 0 && a[j] == '(') {\n            judge[j] = 1;\n            judge[i] = 1;\n            break;\n          } \n        }\n        if (judge[i] == 0)\n          b[i] = '?'; \n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (judge[i] == 0 && a[i] == '(')\n        b[i] = '$'; \n    }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << '\\n';\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << '\\n';\n    for (i = 0; i < 100; i++) {\n      judge[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int left = 0, right = 0;\n  int times = 0, i;\n  char s[101];\n  char c[101];\n  char fakes[101];\n\n  for (times = 0; times == 0; i = 0, left = 0, right = 0) {\n    cin >> s;\n    if (strcmp(fakes, s) == 0 && strlen(fakes) == strlen(s)) {\n      break;\n    }\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(') {\n        left++;\n      }\n      if (s[i] == ')' && left > 0) {\n        left--;\n      } else if (s[i] == ')' && left == 0) {\n        c[i] = '?';\n      }\n    }\n    for (; i >= 0; i--) {\n      if (s[i] == ')') {\n        right++;\n      }\n      if (s[i] == '(' && right > 0) {\n        right--;\n      } else if (s[i] == '(' && right == 0) {\n        c[i] = '$';\n      }\n    }\n    puts(s);\n    printf(\"\\n\");\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (c[i] == '?' || c[i] == '$') {\n        printf(\"%c\", c[i]);\n        c[i] = 0;\n      } else\n        printf(\" \");\n    }\n    cout << \"\\n\";\n    strcpy(fakes, s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint n, c1 = 0;\nint match(int c) {\n  for (int i = c; i < n; i++) {\n    if (a[i] != '(' && a[i] != ')' && a[i] != '$')\n      a[i] = ' ';\n    if (a[i] == '(') {\n      c1++;\n      if (match(i + 1) != 0) {\n        a[i] = ' ';\n        a[match(i + 1)] = ' ';\n        c1--;\n      } else\n        a[i] = '$';\n    }\n    if (a[i] == ')') {\n      if (c1 == 0) {\n        a[i] = '?';\n        if (i < n) {\n          match(i + 1);\n          return 0;\n        }\n      }\n      return i;\n    }\n  }\n  return 0;\n}\nint main() {\n  while (cin >> a) {\n    c1 = 0;\n    n = strlen(a);\n    cout << a << endl;\n    match(0);\n    printf(\"%s\\n\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar x[110] = {'\\0'}, y[110] = {'\\0'};\nint i, j, k, l;\nint f() {\n  for (i = 0; i < l - 1; i++) {\n    for (j = 1; i + j < l; j++) {\n      if (x[i] == '(' && x[i + j] == ' ') {\n        continue;\n      } \n      if (x[i] == '(' && x[i + j] == '(') {\n        break;\n      } \n      if (x[i] == '(' && x[i + j] == ')') {\n        x[i] = ' ';\n        x[i + j] = ' ';\n      } \n    }\n  }\n  k++;\n  if (k == l) {\n    return 0;\n  }\n  if (k != l) {\n    f();\n  }\n}\nint main() {\n  while (cin.getline(x, 110, '\\n')) {\n    strcpy(y, x);\n    l = strlen(x);\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(' && x[i] != ')') {\n        x[i] = ' ';\n      }\n    } \n    k = 0;\n    f();\n    cout << y << endl;      \n    for (i = 0; i < l; i++) \n    {\n      if (x[i] == '(') {\n        cout << \"$\";\n      }\n      if (x[i] == ')') {\n        cout << \"?\";\n      }\n      if (x[i] == ' ') {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31044", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int n, t, s, i;\n    if (scanf(\"%s\", a) == EOF)\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')')\n        b[i] = -1;\n    for (i = 0, s = 0; i < n; i++)\n      if (b[i] == 1) {\n        t = i;\n        s = 1;\n      } else if (b[i] == -1 && s == 1) {\n        b[t] = 0;\n        b[i] = 0;\n        i = -1;\n        s = 0;\n      }\n    for (i = 0; i < n; i++)\n      if (b[i] == 1)\n        b[i] = '$';\n      else if (b[i] == -1)\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31045", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[1000], t[1000];\n  int len;\n  int n;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    cin >> s;\n    len = strlen(s);\n    memset(t, ' ', len);\n    t[len] = 0;\n\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(' || s[i] == '[' || s[i] == '{') {\n        t[i] = '$';\n      }\n      char match = ' ';\n      if (s[i] == ')') {\n        match = '(';\n      } else {\n        if (s[i] == ']') {\n          match = '[';\n        } else if (s[i] == '}') {\n          match = '{';\n        }\n      }\n      if (match != ' ') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (t[j] == '$') {\n            if (s[j] == match) {\n              t[j] = ' ';\n              match = ' ';\n            }\n            break;\n          }\n        }\n        if (match != ' ') {\n          t[i] = '?';\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", s, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31046", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid deal(char s[]) {\n  int i, j, p = 0;\n  for (i = 0; i < strlen(s); i++)\n    if (s[i] == '(') {\n      for (j = i + 1; j < strlen(s); j++)\n        if (s[j] == '(' || s[j] == ')')\n          break;\n      if (s[j] == ')') {\n        s[j] = 'a';\n        s[i] = 'a';\n        p++;\n      }\n    }\n  if (p != 0)\n    deal(s);\n}\nint main() {\n  int i, j;\n  char s[1000], s1[1000], t[1000];\n  while (0 == 0) {\n    for (i = 0; i < 1000; i++)\n      s[i] = 0;\n\n    cin >> s;\n    if (s[0] == '\u0000')\n      break;\n    strcpy(s1, s);\n    deal(s1);\n    for (i = 0; i < strlen(s); i++)\n      if (s1[i] == '(')\n        t[i] = '$';\n      else if (s1[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    t[strlen(s)] = '\u0000';\n    cout << s << \" \" << t << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[999];\nint find(int i, int l) {\n  int t;\n  if (s[i] == '\\0')\n    return -1;\n  if (s[i] == '(') {\n    t = find(i + 1, l + 1);\n    if (t == -1)\n      s[i] = '$';\n    else\n      s[i] = ' ';\n    if (t == -1)\n      return -1;\n    else\n      return find(t + 1, l);\n  }\n  if (s[i] == ')') {\n    if (l == 0)\n      s[i] = '?';\n    else\n      s[i] = ' ';\n    if (l == 0)\n      return find(i + 1, 0);\n    else\n      return i;\n  }\n  s[i] = ' ';\n  return find(i + 1, l);\n}\nint main() {\n  for (; cin >> s;) {\n    cout << s << endl;\n    find(0, 0);\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], mark[101];\n  int locate[101], left = 0, right = 0, count = -1, len, i;\n  while (cin.getline(line, 101)) {\n    count = -1;\n    left = 0;\n    right = 0;\n    len = strlen(line);\n    memset(mark, ' ', sizeof(mark));\n    memset(locate, 0, sizeof(locate));\n    for (i = 0; line[i] != '\\0'; i++) {\n\n      if (line[i] == '(') {\n        left++;\n        locate[++count] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right) {\n          mark[i] = '?';\n        } else {\n          right++;\n          count--;\n        }\n      }\n    }\n    if (count >= 0) {\n      for (i = 0; i <= count; i++)\n        mark[locate[i]] = '$';\n    }\n    mark[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", mark);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31049", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a, b, c[101];\n  int len, i, j, flag;\n  while (cin >> s) {\n    strcpy(c, s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      flag = 0;\n      if (s[i] == 41) {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == 40) {\n            flag++;\n            break;\n          }\n        }\n        if (flag == 1) {\n          s[i] = 32;\n          s[j] = 32;\n        } else\n          s[i] = '?';\n      }\n    }\n    printf(\"%s \", c);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '?')\n        printf(\"?\");\n      else if (s[i] == 40)\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31050", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin.getline(in, 101) && in[0] != '\\0') {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) \n          {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    cout << in << endl;\n    cout << out << endl;\n  }\n  return 0;\n}\n\n"}
{"label": "17", "index": "31051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[200];\n  char str2[200];\n  int i = 0, length, sign, flag;\n  char c;\n  scanf(\"%c\", &c);\n  while (c != EOF) {\n    i = 0;\n    sign = -1;\n    while (c != '\\n') {\n      str1[i] = c;\n      if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {\n        str2[i] = ' ';\n      } else {\n        str2[i] = c;\n      }\n      i++;\n      scanf(\"%c\", &c);\n    }\n    str1[i] = '\\0';\n    str2[i] = '\\0';\n    length = strlen(str2);\n    i = 0;\n    flag = 0;\n    while (i >= 0) {\n      if (str2[i] == '(')\n        sign = i;\n      if (str2[i] == ' ') {\n        if (i == length - 1) {\n          if (flag == 1) {\n            flag = 0;\n            i = -1;\n          } else\n            break;\n        }\n        i++;\n        continue;\n      }\n      if ((str2[i] == ')') && (sign >= 0)) {\n        str2[sign] = ' ';\n        str2[i] = ' ';\n        flag = 1;\n        sign = -1;\n      }\n      if (i == length - 1) {\n        if (flag == 1) {\n          flag = 0;\n          i = -1;\n          sign = -1;\n        } else\n          break;\n      }\n      i++;\n    }\n    for (i = 0; i < length; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    printf(\"%s\\n\", str1);\n    printf(\"%s\\n\", str2);\n    scanf(\"%c\", &c);\n    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '(' ||\n        c == ')')\n      continue;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], res[101];\n  int n, stack[100], k;\n\n  cin >> n;\n  while (n--) {\n    cin >> str;\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      res[i] = ' ';\n    res[len] = '\\0';\n\n    k = 0;\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k != 0 && stack[k - 1] < 0)\n          k--;\n        else\n          stack[k++] = i + 1;\n      } else if (str[i] == '(')\n        stack[k++] = -(i + 1);\n    }\n    for (int i = 0; i < k; i++) {\n      int index = stack[i];\n      if (index < 0)\n        res[-index - 1] = '$';\n      else\n        res[index - 1] = '?';\n    }\n    cout << str << endl;\n    printf(\"%s\\n\", res);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101], b[101];\nint l, c[101];\nint main() {\n  int i, j;\n  while (cin.getline(a, 101)) {\n    j = 0;\n    memset(c, 0, sizeof(c));\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        c[j] = i;\n        j = j + 1;\n      } else if (a[i] == ')') {\n        if (j >= 1) {\n          b[c[j - 1]] = ' ';\n          b[i] = ' ';\n          j = j - 1;\n        } else {\n          b[i] = '?';\n        }\n      } else {\n        b[i] = ' ';\n      }\n    }\n    b[l] = '\\0';\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31054", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(char b[], int n, int m) {\n  if (b[m] != ')' && m < n) {\n    change(b, n, m + 1);\n  }\n  if (b[m] == ')' && m < n) {\n    int i;\n    for (i = m; i >= 0; i--) {\n      if (b[i] == '(') {\n        b[i] = 'A';\n        b[m] = 'A';\n        break;\n      }\n    }\n    change(b, n, m + 1);\n  }\n}\nint main() {\n  char a[200];\n  scanf(\"%s \", a);\n  getchar();\n  while (a[0] != 0) {\n    int num, j;\n    num = strlen(a);\n    printf(\"%s\\n\", a);\n    change(a, num, 0);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(')\n        a[j] = '$';\n      else {\n        if (a[j] == ')')\n          a[j] = '?';\n        else\n          a[j] = ' ';\n      }\n    }\n    cout << a << endl;\n    cin.getline(a, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch1[101], ch2[101];\n  int i = 0, j = 0, k = 0, len = 0;\n  while (cin.getline(ch1, 101)) {\n    len = strlen(ch1);\n    int num = 0;\n    for (i = 0; i < len; i++) {\n      ch2[i] = ' ';\n      if (ch1[i] == '(') {\n        ch2[i] = '$';\n        num++;\n      }\n      if (ch1[i] == ')') {\n        ch2[i] = '?';\n        num--;\n        if (num == 0) {\n          ch2[i] = ' ';\n          for (j = 0; j < i; j++) {\n            if (ch1[j] == '(') {\n              for (k = j; k <= i; k++) {\n                ch2[k] = ' ';\n                break;\n                break;\n              }\n            }\n          }\n        }\n        if (num > 0) {\n          ch2[i] = ' ';\n          for (j = i; j >= 0; j--) {\n            if (ch2[j] == '$') {\n              ch2[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (num < 0)\n          num = 0;\n      }\n    }\n    ch2[len] = '\\0';\n    cout << ch1 << endl;\n    cout << ch2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31056", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pro(char *s) {\n  char a[444];\n  char *p;\n  int i, j, k, t;\n  i = -1;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(') {\n      i++;\n      a[i] = *p;\n    } else if (*p == ')') {\n      j = i;\n      while ((j >= 0) && (a[j] != '('))\n        j--;\n      if (j == -1) {\n        i++;\n        a[i] = *p;\n      } else {\n        a[j] = ' ';\n        i++;\n        a[i] = ' ';\n      }\n    } else {\n      i++;\n      a[i] = ' ';\n    }\n    p++;\n  }\n\n  a[i + 1] = '\u0000';\n  strcpy(s, a);\n}\n\nvoid print(char *s) {\n  char *p;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(')\n      *p = '$';\n    else if (*p == ')')\n      *p = '?';\n    p++;\n  }\n  puts(s);\n}\nint main() {\n  int l;\n  char s[323];\n\n  scanf(\"%s \", s);\n  while (s[0] != '\u0000') {\n\n    puts(s);\n    pro(s);\n    print(s);\n    s[0] = '\u0000';\n\n    cin >> s;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31057", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zhengli(char a[]) {\n  void panduan(char a[]);\n  int i, k, j;\n  k = strlen(a);\n  for (j = 0; j < 50; j++) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == '$')\n        a[i] = '(';\n      else if (a[i] == '?')\n        a[i] = ')';\n    }\n    panduan(a);\n  }\n}\nvoid panduan(char a[]) {\n  int i, k, flag = 0, j;\n  char b[110];\n  k = strlen(a);\n  b[k] = '\\0';\n  for (i = 0; i < k; i++) {\n    if (a[i] != '(' && a[i] != ')')\n      b[i] = ' ';\n    else {\n      if (a[i] == '(') {\n        if (flag == 1) {\n          b[j] = '$';\n          j = i;\n          b[j] = '$';\n        } else {\n          flag = 1;\n          j = i;\n          b[j] = '$';\n        }\n      } else {\n        if (flag == 1) {\n          b[j] = ' ';\n          flag = 0;\n          b[i] = ' ';\n        } else\n          b[i] = '?';\n      }\n    }\n  }\n  strcpy(a, b);\n}\nint main() {\n  int i, k;\n  char a[110];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    panduan(a);\n    zhengli(a);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[101], str2[101];\n  int i, figure = 0, temp[100];\n  while (scanf(\"%s \", str1)) {\n    memset(str2, ' ', sizeof(str2));\n    for (i = 0; i < strlen(str1); i++) {\n      if (str1[i] == '(') {\n        str2[i] = '$';\n        temp[figure++] = i;\n      }\n      if (str1[i] == ')') {\n        if (figure > 0) {\n          str2[temp[figure - 1]] = ' ';\n          figure--;\n        } else {\n          str2[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < strlen(str1) - 1; i++)\n      cout << str1[i];\n    cout << str1[strlen(str1) - 1] << endl;\n    for (i = 0; i < strlen(str1) - 1; i++) {\n      cout << str2[i];\n    }\n    cout << str2[strlen(str1) - 1] << endl;\n    figure = 0;\n    memset(str1, ' ', sizeof(str1));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][101], b[100][101], c = '(', d = ')';\n  int i, j, k;\n  for (k = 0; k <= 20; k++) {\n    for (i = 0; i < 101; i++)\n      a[k][i] = 0;\n\n    cin >> a[k];\n    strcpy(b[k], a[k]);\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == d)\n        for (j = i - 1; j >= 0; j--)\n          if (a[k][j] == c) {\n            a[k][i] = a[k][j] = 1;\n            break;\n          }\n    for (i = 0; i < 101 && b[k][i] != 0; i++)\n      printf(\"%c\", b[k][i]);\n    cout << \" \";\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == c)\n        printf(\"$\");\n      else if (a[k][i] == d)\n        cout << \"?\";\n      else\n        printf(\" \");\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[11][101] = {{'\\0'}}, s0[101];\n  int i = 0, j, k, l, c;\n  while (i <= 10) {\n    scanf(\"%s\", s[i]);\n    strcpy(s0, s[i]);\n    l = strlen(s[i]);\n    for (j = l - 1; j >= 0; j--) {\n      c = 0;\n      if (s[i][j] == '(') {\n        for (k = j; k <= l - 1; k++) {\n          if (s[i][k] == ')') {\n            c = 1;\n            s[i][k] = ' ';\n            s[i][j] = ' ';\n            break;\n            ;\n          }\n        }\n        if (c == 0)\n          s[i][j] = '$';\n      } else if (s[i][j] != ')')\n        s[i][j] = ' ';\n    }\n    for (j = 0; j <= l - 1; j++) {\n      if (s[i][j] == ')')\n        s[i][j] = '?';\n    }\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s0[j]);\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n}\n"}
{"label": "17", "index": "31061", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[100][100];\nint main() {\n  int k = 1;\n  while (1) {\n    cin >> a[k];\n    cout << a[k];\n    printf(\"\\n\");\n    for (int i = 0; i < strlen(a[k]); i++)\n      if (a[k][i] != '(' && a[k][i] != ')')\n        a[k][i] = ' ';\n    for (int i = 0; i < strlen(a[k]) - 1; i++) {\n      int sum = 1;\n      if (a[k][i] == '(') {\n        for (int j = i + 1; j < strlen(a[k]); j++) {\n          if (a[k][j] == '(') {\n            sum++;\n          }\n          if (a[k][j] == ')')\n            sum--;\n          if (sum == 0) {\n            a[k][i] = ' ';\n            a[k][j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a[k]); i++) {\n      if (a[k][i] == '(')\n        a[k][i] = '$';\n      if (a[k][i] == ')')\n        a[k][i] = '?';\n      cout << a[k][i];\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[101];\n  char str2[101];\n  int a[101];\n  int l, i, j, temp;\n  while (scanf(\"%s \", str1)) {\n    l = strlen(str1);\n    for (i = 0; i < l; i++) {\n      if (str1[i] == '(')\n        a[i] = 1;\n      else if (str1[i] == ')')\n        a[i] = -1;\n      else\n        a[i] = 0;\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) {\n        temp = 0;\n        for (j = i; j < l; j++) {\n          temp = temp + a[j];\n          if (temp == 0) {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1)\n        str2[i] = '$';\n      else if (a[i] == -1)\n        str2[i] = '?';\n      else\n        str2[i] = ' ';\n    }\n    str2[l] = '\\0';\n    cout << str1 << endl;\n    cout << str2 << endl;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int i, j, len;\n  while (cin >> a) {\n    printf(\"%s\\n\", a);\n    len = strlen(a);\n    for (i = 1; i < len; i++) {\n      for (j = 0; j < len - i; j++) {\n        if (a[j] == '(' && a[j + i] == ')') {\n          a[j] = ' ';\n          a[j + i] = ' ';\n        }\n        if (a[j] != '(' && a[j] != ')') {\n          a[j] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      }\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint work(int);\nchar l = '(', r = ')', sen[110][110] = {0}, rem[110][110] = {0};\nint i, j, k, t = 1, nsen[110] = {0};\nint main() {\n  for (i = 0;; i++) {\n\n    j = 0;\n    char c;\n    while ((c = cin.get()) != '\\n')\n      sen[i][j++] = c;\n    for (j = 0; sen[i][j] != 0; j++)\n      nsen[i]++;\n    for (t = 0; t < nsen[i]; t++)\n      rem[i][t] = sen[i][t];\n    work(i);\n    cout << rem[i] << endl;\n    cout << sen[i] << \"\\n\";\n  }\n\n  return 0;\n}\n\nint work(int i) {\n  for (j = 1; j <= nsen[i] - 1; j++)\n    for (k = 0; k < nsen[i] - 1; k++)\n      if (sen[i][k] == l && sen[i][k + j] == r) {\n        sen[i][k] = ' ';\n        sen[i][k + j] = ' ';\n      }\n\n  for (k = 0; k <= nsen[i] - 1; k++)\n    if (sen[i][k] == l)\n      sen[i][k] = '$';\n    else if (sen[i][k] == r)\n      sen[i][k] = '?';\n    else\n      sen[i][k] = ' ';\n\n  k = 0;\n  j = 1;\n  return 0;\n}\n"}
{"label": "17", "index": "31065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, l;\n  char s[102];\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n        for (j = i - 1; j > -1; j--)\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n      } else\n        s[i] = ' ';\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  typedef struct _Parenthesis {\n    char ch;\n    int idx;\n  } Parenthesis;\n  Parenthesis paren[100];\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    int i, top = 0;\n    puts(str);\n    for (i = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        paren[top].ch = '(';\n        paren[top].idx = i;\n        top++;\n      } else if (str[i] == ')') {\n        if (top == 0)\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n          str[paren[--top].idx] = ' ';\n        }\n      } else\n        str[i] = ' ';\n    }\n    for (i = 0; i < top; i++)\n      str[paren[i].idx] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31067", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[105];\n  int mark[105] = {0};\n  while (cin.getline(a, 101)) {\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(') {\n        mark[i] = 1;\n      }\n      if (a[i] == ')') {\n        mark[i] = -1;\n      }\n    }\n    for (int i = 1; i < strlen(a); i++) {\n      if (mark[i] == -1) {\n        for (int j = i - 1; j >= 0; j--) {\n          if (mark[j] == 1) {\n            mark[i] = 0;\n            mark[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (mark[i] == 0)\n        cout << \" \";\n      else if (mark[i] == 1)\n        cout << \"$\";\n      else\n        cout << \"?\";\n    }\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      mark[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31068", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[110];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int b[110] = {0};\n    scanf(\"%s\", a);\n    m = strlen(a);\n    for (j = 0; j < m; j++) {\n      if (a[j] == '(')\n        b[j] = 1;\n      else if (a[j] == ')')\n        b[j] = -1;\n    }\n    for (j = m - 1; j >= 0; j--) {\n      if (b[j] == 1) {\n        for (k = j; k < m; k++) {\n          if (b[k] == -1) {\n            b[j] = 0;\n            b[k] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < m; k++) {\n      if (b[k] == 1)\n        printf(\"$\");\n      else if (b[k] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31069", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[100] = {0}, d[100] = {0};\n  int l, i, j, s;\n  while (scanf(\"%s\", c) != EOF) {\n    l = strlen(c);\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        d[i] = '$';\n      else if (c[i] == ')') {\n        d[i] = '?';\n        for (j = i - 1, s = 1; j >= 0 && s == 1; j--) {\n          if (d[j] == '$') {\n            d[j] = d[i] = ' ';\n            s = 0;\n          }\n        }\n      } else\n        d[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      printf(\"%c\", c[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      printf(\"%c\", d[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char st[101];\n  int g[101];\n  int len, i, j, left;\n  while (scanf(\"%s\", st) != EOF) {\n    cout << st << \"\\n\";\n    len = strlen(st);\n    left = 0;\n    for (i = 0; i < len; i++) {\n      if (st[i] == '(') {\n        left++;\n        g[left] = i;\n      }\n    }\n    for (i = left; i > 0; i--) {\n      for (j = g[i] + 1; j < len; j++)\n        if (st[j] == ')') {\n          st[g[i]] = ' ';\n          st[j] = ' ';\n          break;\n        }\n    }\n    for (i = 0; i < len; i++) {\n      if (st[i] == ')')\n        cout << \"?\";\n      else if (st[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31071", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  int a[200];\n  int n, l, i, j, m;\n  while (cin.getline(ch, 150)) {\n    l = strlen(ch);\n    for (i = 0; i < l; i++)\n      if (ch[i] == '(')\n        a[i] = -1;\n      else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1)\n            break;\n        if (j != -1) {\n          a[i] = 0;\n          a[j] = 0;\n        } else\n          a[i] = 1;\n      } else\n        a[i] = 0;\n    n = 0;\n    for (i = 0; i < l; i++)\n      if (a[i] != 0)\n        n++;\n    m = n;\n    i = 0;\n    printf(\"%s\\n\", ch);\n    while (n > 0) {\n      if (a[i] == -1)\n        printf(\"$\");\n      else if (a[i] == 1)\n        cout << \"?\";\n      else if (m != n)\n        printf(\" \");\n      if (a[i] != 0)\n        n--;\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[200];\n  int leftpos, mark;\n  while (scanf(\"%s\", string) == 1) {\n    cout << string << \"\\n\";\n    leftpos = -1;\n    mark = 0;\n    while (mark != strlen(string)) {\n      if (string[mark] == '(')\n        leftpos = mark;\n      else if (string[mark] == ')' && leftpos != -1) {\n        string[mark] = ' ';\n        string[leftpos] = ' ';\n        mark = -1;\n        leftpos = -1;\n      }\n      mark++;\n    }\n    for (mark = 0; mark < strlen(string); mark++) {\n      if (string[mark] == '(')\n        string[mark] = '$';\n      else if (string[mark] == ')')\n        string[mark] = '?';\n      else\n        string[mark] = ' ';\n    }\n    cout << string << \"\\n\";\n    memset(string, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101];\nint c[101];\nvoid match(int i, int len) {\n  int k = i + 1;\n  if (c[i] != 0) {\n    while (k < len) {\n      if (a[k] == '(' && c[k] == 1) {\n        match(k, len);\n      }\n      if (a[k] == ')' && c[i] == 1 && c[k] == -1) {\n        c[i] = 0;\n        c[k] = 0;\n      }\n      k++;\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", &a);\n    int len = strlen(a);\n    for (int j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        c[j] = 1;\n      } else if (a[j] == ')') {\n        c[j] = -1;\n      } else {\n        c[j] = 0;\n      }\n    }\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1) {\n        for (int k = j + 1; k < len; k++) {\n          if (c[k] == 1)\n            break;\n          if (c[k] == -1) {\n            c[k] = 0;\n            c[j] = 0;\n            j = -1;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1)\n        printf(\"$\");\n      if (c[j] == -1)\n        printf(\"?\");\n      if (c[j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[110];\n  char b[110];\n  char c[110];\n  while (cin >> a) {\n    strcpy(b, a);\n    strcpy(c, a);\n    int i, j;\n    int n = strlen(a);\n\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[j] = 99;\n            b[i] = b[j] = 32;\n            break;\n          }\n        }\n        if (j == n) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 32 && b[i] != ')' && b[i] != '$')\n        b[i] = 32;\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    cout << c << \" \";\n    printf(\"%s \", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char str[101];\n    int final[101] = {0};\n    cin.getline(str, 101);\n    if (str[0] == '\\0')\n      break;\n    int i = 0, p = 0, q = 0, k = 0, flag = 0;\n    while (str[i] != '\\0') {\n      if (str[i] == '(')\n        final[i] = 1;\n      if (str[i] == ')') {\n        final[i] = 2;\n        for (int j = i; j >= 0; j--) {\n          if (final[j] == 1) {\n            final[i] = 0;\n            final[j] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    }\n    cout << str << endl;\n    while (str[k] != '\\0') {\n      if (final[k] == 1 || final[k] == 2) {\n        p = k;\n        if (flag == 0) {\n          q = k;\n          flag = 1;\n        }\n      }\n      k++;\n    }\n    for (int j = q; j <= p; j++) {\n      if (final[j] == 1)\n        cout << '$';\n      else if (final[j] == 2)\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101];\n  char kuohao[101] = {0};\n  int i, j, len;\n\n  while (scanf(\"%s\", s) > 0) {\n    for (i = 0;; i++) {\n      if (s[i] == '(')\n        kuohao[i] = 1;\n      else if (s[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (kuohao[j] == 1) {\n            kuohao[j] = 0;\n            break;\n          }\n        }\n        if (j < 0)\n          kuohao[i] = 3;\n      } else if (s[i] == '\\0')\n        break;\n    }\n    printf(\"%s\\n\", s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (kuohao[i] == 0)\n        printf(\" \");\n      else if (kuohao[i] == 1)\n        cout << \"$\";\n      else if (kuohao[i] == 3)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      kuohao[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n  return;\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else {\n      s[i] = ' ';\n    }\n  }\n  return;\n}\n\nint main() {\n  char live[101]; \n  int n;\n  cin >> n;\n  while (n--) {\n    cin >> live;\n    cout << live << endl;\n    Find(live);\n    cout << live << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31078", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[110];\n  int note[110], l, r;\n  while (cin >> ch) {\n    memset(note, 0, sizeof(note));\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (ch[i]) {\n      case '(': {\n        l = 0;\n        r = 0;\n        note[i] = 1;\n        for (int j = i; ch[j] != '\\0'; j++) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      case ')': {\n        l = 0;\n        r = 0;\n        note[i] = -1;\n        for (int j = i; j >= 0; j--) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      default:\n        break;\n      }\n    }\n    printf(\"%s\\n\", ch);\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (note[i]) {\n      case 1:\n        cout << \"$\";\n        break;\n      case -1:\n        cout << \"?\";\n        break;\n      case 0:\n        printf(\" \");\n        break;\n      default:\n        break;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n\n    len = strlen(line);\n\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(')\n\n      {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n\n    i = len - 1;\n\n    label[i + 1] = '\\0';\n\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char num[101], t[101];\n  int s[101];\n  int k, j;\n  int len;\n  int aa;\n\n  while (cin >> num) {\n    strcpy(t, num);\n    len = strlen(num);\n    for (k = 0; k < len; k++) {\n      s[k] = 1;\n    }\n    for (k = 0; k < len; k++) {\n      if (num[k] == ')') {\n        for (j = k - 1; j >= 0; j--) {\n          if (num[j] == '(') {\n            s[j] = 0;\n            s[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", t);\n    for (aa = 0; aa < len; aa++) {\n      if (s[aa] == 1 && t[aa] == '(')\n        printf(\"$\");\n      else if (s[aa] == 1 && t[aa] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int left[100] = {0}, right[100] = {0};\n  while (scanf(\"%s \", line)) {\n    int i, k1 = 0, k2 = 0;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '(') {\n        left[k1] = i;\n        k1++;\n      }\n      if (line[i] == ')') {\n        if (k1 != 0) {\n          left[k1 - 1] = 0;\n          k1--;\n        } else {\n          right[k2] = i;\n          k2++;\n        }\n      }\n    }\n    char ans[101];\n    for (i = 0; i < strlen(line); i++)\n      ans[i] = ' ';\n    ans[strlen(line)] = '\\0';\n    for (i = 0; i < k1; i++) {\n      ans[left[i]] = '$';\n    }\n    for (i = 0; i < k2; i++) {\n      ans[right[i]] = '?';\n    }\n    cout << line << endl;\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[200];\n  while (scanf(\"%s\", str) != EOF) {\n    int n, i, j, k;\n    cout << str << \" \";\n    n = strlen(str);\n    for (i = 0, k = 0; i < n; i++) {\n      if (str[i] == '(') {\n        k = i;\n      }\n      if (str[i] == ')' && str[k] == '(') {\n        str[i] = ' ';\n        str[k] = ' ';\n        i = -1;\n        k = 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n      else {\n        if (str[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int i, count, j, b[101];\n  while (cin >> s) {\n    count = 0;\n    for (i = 0; i < strlen(s); i++)\n      b[i] = 0;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        c[i] = '$';\n        count++;\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        if (count != 0) {\n          for (j = i; j >= 0; j--) {\n            if (s[j] == '(' && b[j] == -1) {\n              c[j] = ' ';\n              c[i] = ' ';\n              count--;\n              b[j] = 0;\n              break;\n            }\n          }\n        } else\n          c[i] = '?';\n      } else\n        c[i] = ' ';\n    }\n    c[i] = '\u0000';\n    printf(\"%s %s \", s, c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  while (true) {\n    cin.getline(a, 101);\n    if (a[0] == 0)\n      break;\n    printf(\"%s\\n\", a);\n    int i, j = 0, k, l, d;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    b[i] = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (j == 0 && a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == ')') {\n        j--;\n        for (k = i; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[k] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(') {\n        j++;\n        b[i] = '$';\n      }\n    }\n    for (d = 0; d < strlen(a); d++)\n      if (b[d] != ' ')\n        break;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = b[i + d];\n    for (l = (strlen(a) - 1 - d); l >= 0; l--)\n      if (b[l] != ' ')\n        break;\n    b[l + 1] = 0;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31085", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, i, j;\n  char str[101], str1[101];\n  cin >> n;\n  for (m = 0; m < n; m++) {\n\n    cin >> str;\n    puts(str);\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == ')')\n        for (j = i; j >= 0; j--)\n          if (str[j] == '(') {\n            str[j] = '0';\n            str[i] = '0';\n            break;\n          }\n    }\n\n    printf(\" \");\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      if (str[i] == ')')\n        printf(\"?\");\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i, l;\n  char str[100];\n\n  for (;;) {\n\n    scanf(\"%s \", str);\n    if (feof(stdin))\n      break;\n    l = strlen(str);\n    for (i = 0; i <= l - 1; i++)\n      printf(\"%c\", str[i]);\n\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] == '(') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == ')' && b == 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a <= 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    a = 0;\n    b = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == ')') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == '(' && b == 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a <= 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    printf(\" \");\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101], bracket[101];\nint len;\nvoid match(int a);\n\nint main() {\n  while (cin.getline(str, 101)) {\n    len = strlen(str);\n    for (int i = 0; i < len; i++)\n      if (str[i] == '(')\n        bracket[i] = '$';\n      else if (str[i] == ')')\n        bracket[i] = '?';\n      else\n        bracket[i] = ' ';\n    match(1);\n    for (int i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = 0; i < len; i++)\n      cout << bracket[i];\n    cout << \"\\n\";\n  }\n\n  return 0;\n}\n\nvoid match(int a) {\n  if (a == len)\n    return;\n  int b = a - 1;\n  if (bracket[a] == '?') {\n    while (bracket[b] == ' ') {\n      if (b == 0) {\n        match(a + 1);\n        return;\n      }\n      b--;\n    }\n    if (bracket[b] == '?') {\n      match(a + 1);\n      return;\n    }\n    bracket[b] = ' ';\n    bracket[a] = ' ';\n    match(a + 1);\n  } else\n    match(a + 1);\n}\n"}
{"label": "17", "index": "31088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, n, m = 0;\n  while (scanf(\"%s\", a) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid del(char a[], int n) {\n  int i = 0;\n  while (a[i] != ')' && i < n)\n    i++;\n  int j;\n  j = i - 1;\n  while (a[j] != '(' && j >= 0)\n    j--;\n  if (i < n && j >= 0) {\n    a[i] = ' ';\n    a[j] = ' ';\n    del(a, n);\n  } else {\n    if (i >= n && j >= 0)\n      a[j] = '$';\n    if (j < 0 && i < n)\n      a[i] = '?';\n    if (!(i >= n && j < 0))\n      del(a, n);\n  }\n}\n\nint main() {\n  while (!cin.eof()) {\n    char a[101];\n    cin.getline(a, 101);\n    cout << a << endl;\n    int n, i;\n    n = strlen(a);\n    del(a, n);\n    for (i = 0; i < n; i++)\n      switch (a[i]) {\n      case '$':\n      case '?':\n        cout << a[i];\n        break;\n      default:\n        printf(\" \");\n      }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31090", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[10000];\nint countl, countr, sum[1000] = {0};\n\nint pipei(int i) {\n\n  if (s[i] == '\\0')\n    return sum[i] = 0;\n  if (s[i] == '(') {\n    ++countl;\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    if (sum[i] > 0)\n\n    {\n      s[i] = ' ';\n      countl--;\n      countr--;\n      sum[i]--;\n    }\n\n    else {\n      countl--;\n      s[i] = '$';\n    }\n    return 0;\n  }\n\n  else {\n    if (s[i] == ')') {\n      countr++;\n      sum[i]++;\n      if (countl >= countr) {\n        s[i] = ' ';\n        pipei(i + 1);\n        sum[i] += sum[i + 1];\n        return 0;\n      } else {\n        countr--;\n        s[i] = '?';\n        pipei(i + 1);\n        sum[i] += sum[i + 1];\n        return 0;\n      }\n\n    } else {\n      s[i] = ' ';\n      pipei(i + 1);\n      sum[i] += sum[i + 1];\n      return 0;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin) {\n    cin.getline(s, 1000);\n    printf(\"%s\\n\", s);\n    pipei(0);\n    cout << s << endl;\n    countl = countr = 0;\n    memset(sum, 0, sizeof(sum));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char a[101];\n  while (scanf(\"%s \", a)) {\n    n = strlen(a);\n    for (i = 0; i <= n - 2; i++) {\n      cout << a[i];\n    }\n    printf(\"%c \", a[n - 1]);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z' ||\n          a[i] == ' ') {\n        a[i] = ' ';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else if (a[i] == '(') {\n        a[i] = '$';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31092", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  for (;;) {\n\n    char str[300];\n    int i, j, k, a1 = 0, js1 = 0, l;\n\n    cin >> str;\n    if (feof(stdin))\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == ')' && a1 == 0) {\n        str[i] = '?';\n      }\n      if (str[i] == ')' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '?';\n      }\n    }\n    a1 = 0;\n    js1 = 0;\n\n    for (; i >= 0; i--) {\n      if (str[i] == ')') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == '(' && a1 == 0) {\n        str[i] = '$';\n      }\n      if (str[i] == '(' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '$';\n      }\n    }\n\n    for (i = 0; i < l; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31093", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[110];\n  int note[110], l, r;\n  while (cin >> ch) {\n    memset(note, 0, sizeof(note));\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (ch[i]) {\n      case '(': {\n        l = 0;\n        r = 0;\n        note[i] = 1;\n        for (int j = i; ch[j] != '\\0'; j++) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      case ')': {\n        l = 0;\n        r = 0;\n        note[i] = -1;\n        for (int j = i; j >= 0; j--) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      default:\n        break;\n      }\n    }\n    printf(\"%s\\n\", ch);\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (note[i]) {\n      case 1:\n        cout << \"$\";\n        break;\n      case -1:\n        cout << \"?\";\n        break;\n      case 0:\n        cout << \" \";\n        break;\n      default:\n        break;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31094", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char b[100];\n  int i, j, t, l;\n  while (1) {\n    char a[100];\n    a[0] = '\\0';\n    cin >> a;\n    l = strlen(a);\n    if (l == 0)\n      break;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[l] = '\\0';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        t = 0;\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            t--;\n          if (a[j] == ')')\n            t++;\n          if (t == 1) {\n            b[i] = b[j] = ' ';\n            a[i] = a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31095", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[110], la;\n\nint main() {\n  while (1) {\n    int f = getchar();\n    if (f == -1)\n      break;\n    a[1] = f;\n    for (int i = 2; i <= 109; i++) {\n      a[i] = getchar();\n      if (a[i] == 10) {\n        la = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= la + 1; i++)\n      putchar(a[i]);\n    for (int i = 1; i <= la; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 1; j--) {\n          if (a[j] == ')')\n            break;\n          if (a[j] == '(') {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 1; i <= la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        putchar(32);\n      if (a[i] == '(')\n        putchar('$');\n      if (a[i] == ')')\n        putchar('?');\n    }\n    putchar(10);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j, a[101], len, count;\n  while (cin.getline(str, 101)) {\n    count = 0;\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == ')') {\n        count++;\n        a[count] = i;\n      }\n    }\n    for (i = 1; i <= count; i++) {\n      for (j = a[i] - 1; j >= 0; j--) {\n        if (a[i] == 0) {\n          str[a[i]] = '?';\n        }\n        if (str[j] == '(') {\n          str[j] = ' ';\n          str[a[i]] = ' ';\n          break;\n        }\n      }\n      if (str[a[i]] != ' ') {\n        str[a[i]] = '?';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if ((str[i] != ' ') && (str[i] != '?') && (str[i] != '$')) {\n        str[i] = ' ';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int bs[102], i, j;\n  char a[102];\n  memset(bs, 0, 102);\n  while (cin.getline(a, 102)) {\n    for (i = 0; i < 102; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(')\n        bs[i] = 1;\n      if (a[i] == ')') {\n        bs[i] = 1;\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && bs[j] == 1) {\n            bs[j] = 0;\n            bs[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < 102; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == ')' && bs[i] == 1)\n        cout << \"?\";\n      else if (a[i] == '(' && bs[i] == 1)\n        cout << \"$\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid pipei(char x[], int l) {\n  int i, j, count;\n  for (; count != 0;) {\n    count = 0;\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(')\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (x[j] != '(' && x[j] != ')')\n          continue;\n        if (x[j] == '(')\n          break;\n        if (x[j] == ')') {\n          count++;\n          x[i] = 32;\n          x[j] = 32;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (x[i] != '(' && x[i] != ')')\n      printf(\" \");\n    else if (x[i] == '(')\n      printf(\"$\");\n    else\n      printf(\"?\");\n  }\n  printf(\" \");\n}\nint main() {\n  char x[101];\n  int l, i;\n  for (;;) {\n\n    scanf(\"%s \", x);\n    if (x[0] == '\u0000')\n      break;\n    l = strlen(x);\n    puts(x);\n    pipei(x, l);\n    for (i = 0; i < l; i++)\n      x[i] = '\u0000';\n  }\n}\n"}
{"label": "17", "index": "31099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[100] = {'\\0'};\n  int len, i, j, judge[100] = {0};\n  while (cin >> a) {\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      b[i] = ' ';\n    for (i = 99; i >= len; i--)\n      b[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (judge[j] == 0 && a[j] == '(') {\n            judge[j] = 1;\n            judge[i] = 1;\n            break;\n          }\n        }\n        if (judge[i] == 0)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (judge[i] == 0 && a[i] == '(')\n        b[i] = '$';\n    }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << '\\n';\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    cout << '\\n';\n    for (i = 0; i < 100; i++) {\n      judge[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[101];\n  int l, i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n\n    l = strlen(a);\n    puts(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n      else {\n        if (a[i] == ')') {\n          n = 0;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == '(') {\n              a[i] = ' ';\n              a[j] = ' ';\n              n++;\n              break;\n            }\n          }\n          if (n == 0)\n            a[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31101", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[200];\n  char str2[200];\n  int i = 0, length, sign, flag;\n  char c;\n  scanf(\"%c\", &c);\n  while (c != EOF) {\n    i = 0;\n    sign = -1;\n    while (c != '\\n') {\n      str1[i] = c;\n      if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {\n        str2[i] = ' ';\n      } else {\n        str2[i] = c;\n      }\n      i++;\n      scanf(\"%c\", &c);\n    }\n    str1[i] = '\\0';\n    str2[i] = '\\0';\n    length = strlen(str2);\n    i = 0;\n    flag = 0;\n    while (i >= 0) {\n      if (str2[i] == '(')\n        sign = i;\n      if (str2[i] == ' ') {\n        if (i == length - 1) {\n          if (flag == 1) {\n            flag = 0;\n            i = -1;\n          } else\n            break;\n        }\n        i++;\n        continue;\n      }\n      if ((str2[i] == ')') && (sign >= 0)) {\n        str2[sign] = ' ';\n        str2[i] = ' ';\n        flag = 1;\n        sign = -1;\n      }\n      if (i == length - 1) {\n        if (flag == 1) {\n          flag = 0;\n          i = -1;\n          sign = -1;\n        } else\n          break;\n      }\n      i++;\n    }\n    for (i = 0; i < length; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    printf(\"%s\\n\", str1);\n    printf(\"%s\\n\", str2);\n    cin >> c;\n    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '(' ||\n        c == ')') {\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101], ans[101];\n  int left[101];\n  int n = 0, i, t = 0;\n  while (scanf(\"%s \", c)) {\n    t = 0;\n    n = strlen(c);\n    for (i = 0; i < n; i++) {\n      ans[i] = ' ';\n      if (c[i] == '(')\n        left[t++] = i;\n      if (c[i] == ')') {\n        if (t == 0)\n          ans[i] = '?';\n        else\n          t--;\n      }\n    }\n    for (i = 0; i < t; i++)\n      ans[left[i]] = '$';\n    ans[n] = '\\0';\n    cout << c << endl << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid find() {\n  char ch[101];\n\n  memset(ch, '\\0', sizeof(ch));\n  while (cin.getline(ch, 1000, '\\n')) {\n    cout << ch << \"\\n\";\n    int i = 0, j = 0;\n    int num = 0;\n    for (i = 0; i < 100; i++)\n      if (ch[i] == '(') {\n        num = 0;\n        for (j = i; j < 100; j++) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num > 0)\n          ch[i] = '$';\n      }\n    for (i = 99; i >= 0; i--)\n      if (ch[i] == ')') {\n        num = 0;\n        for (j = i; j >= 0; j--) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num < 0)\n          ch[i] = '?';\n      }\n    int len;\n    len = strlen(ch);\n    for (i = 0; i < len; i++) {\n      if (ch[i] != '$' && ch[i] != '?')\n        ch[i] = ' ';\n    }\n    cout << ch << endl;\n  }\n}\nint main() {\n\n  find();\n  return 0;\n}\n"}
{"label": "17", "index": "31104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int left = 0, right = 0;\n    int e[101] = {0};\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31105", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char s[105], a[105];\n    int i, k = 0, stack[105];\n    memset(a, ' ', sizeof(a));\n    cin >> s;\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        stack[k++] = -i - 1;\n      else if (s[i] == ')')\n        if (k == 0 || stack[k - 1] > 0)\n          stack[k++] = i + 1;\n        else\n          k--;\n    for (i = 0; i < k; i++)\n      if (stack[i] > 0)\n        a[stack[i] - 1] = '?';\n      else\n        a[-stack[i] - 1] = '$';\n    a[strlen(s)] = '\\0';\n    printf(\"%s\\n%s\\n\", s, a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31106", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (!cin.eof()) {\n    char str[1000], ans[1000];\n    memset(str, 0, sizeof(str));\n    memset(ans, 0, sizeof(ans));\n    scanf(\"%s \", str);\n\n    for (int i = 0; i < strlen(str); i++)\n      ans[i] = ' ';\n\n    int sign = 0;\n    for (int i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n\n        sign++;\n        ans[i] = sign + '0';\n      } else if (str[i] == ')') {\n        if (sign > 0) {\n          ans[i] = sign + '0';\n          sign--;\n        } else\n          ans[i] = '?';\n      }\n    }\n    for (int i = 0; i < strlen(str); i++) {\n      if (ans[i] != ' ' && str[i] == '(') {\n        int ok = 0;\n        int j;\n        for (j = i + 1; j < strlen(str); j++) {\n          if (ans[j] == ans[i]) {\n            ok = 1;\n            break;\n          }\n        }\n        if (!ok)\n          ans[i] = '$';\n        else\n          ans[i] = ans[j] = ' ';\n      }\n    }\n    ans[strlen(str)] = '\u0000';\n    cout << str << endl;\n    cout << ans;\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, mz;\n  char a[200] = {'\u0000'}, b[200];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < 200; j++) {\n      a[j] = '\u0000';\n      b[j] = '\u0000';\n    }\n\n    cin >> a;\n    strcpy(b, a);\n    for (j = 0; j < 200; j++) {\n      if (a[j] == '\u0000')\n        break;\n      count++;\n    }\n    for (j = count - 1; j >= 0; j--) {\n      if (b[j] == '(') {\n        mz = 0;\n        for (k = j; k < count; k++) {\n          if (b[k] == ')') {\n            b[k] = ' ';\n            b[j] = ' ';\n            mz = 1;\n            break;\n          }\n        }\n        if (mz == 0)\n          b[j] = '$';\n      }\n    }\n    for (j = 0; j < count; j++) {\n      if (b[j] == ')')\n        b[j] = '?';\n    }\n    for (j = 0; j < count; j++)\n      printf(\"%c\", a[j]);\n    printf(\" \");\n    for (j = 0; j < count; j++) {\n      if (b[j] != '$' && b[j] != '?')\n        printf(\" \");\n      else\n        printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[200];\n  int i, j, k, m, n;\n  int flag = 0;\n  int left[100], l = 1;\n  while (cin >> str) {\n    cout << str << endl;\n    flag = 0;\n    l = 1;\n    for (n = 1; n < 100; n++)\n      left[n] = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (j = l - 1; j >= 1; j--) {\n      flag = 0;\n      for (k = left[j] + 1; str[k] != '\\0'; k++) {\n        if (str[k] == ')') {\n          str[left[j]] = ' ';\n          str[k] = ' ';\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        str[left[j]] = '$';\n    }\n    for (m = 0; str[m] != '\\0'; m++)\n      if (str[m] == ')')\n        str[m] = '?';\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char input[101] = {0}, initial[101];\n  int found = 0;\n  while (cin.getline(input, 101)) {\n    strcpy(initial, input);\n    do {\n      found = 0;\n      int i = 0, location = -1;\n      while (input[i]) {\n        if (input[i] == '(') {\n          location = i;\n          found = 1;\n        }\n        if (input[i] == ')') {\n          found = 1;\n          if (location == -1)\n            input[i] = '?';\n          else {\n            input[location] = ' ';\n            input[i] = ' ';\n            location = -1;\n            break;\n          }\n        }\n        if (input[i] != '?' && input[i] != '$' && input[i] != '(' &&\n            input[i] != ')') {\n          input[i] = ' ';\n        }\n        i++;\n      }\n      if (location != -1) {\n        input[location] = '$';\n        location = -1;\n      }\n    } while (found);\n    cout << initial << \"\\n\" << input << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint deal();\nchar ori[101] = {\"\\0\"};\nint out[101] = {0};\nint main() {\n  int i;\n  while (cin.getline(ori, 101)) {\n    deal();\n    cout << ori << endl;\n    for (i = 0; ori[i] != '\\0'; i++) {\n      if (out[i] == 1)\n        cout << '$';\n      else if (out[i] == 2)\n        printf(\"?\");\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\nint deal() {\n  int i, j;\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (ori[i] == '(')\n      out[i] = 1;\n    else if (ori[i] == ')')\n      out[i] = 2;\n    else\n      out[i] = 0;\n  }\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (out[i] == 2) {\n      for (j = i; j >= 0; j--) {\n        if (out[j] == 1) {\n          out[i] = 0;\n          out[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar sign[101];\nint lf[100];\nint rt[100];\nint len;\n\nvoid match();\n\nint main() {\n  while (cin.getline(sign, 101)) {\n    len = strlen(sign);\n    cout << sign << endl;\n    int i = 0;\n    for (i = 0; i < 100; i++) {\n      lf[i] = -1;\n      rt[i] = -1;\n    }\n    match();\n  }\n  return 0;\n}\n\nvoid match() {\n  int i = 0, j = 0, n1 = 0, n2 = 0;\n  char result[len];\n  for (i = 0; i < len; i++)\n    result[i] = ' ';\n  for (i = 0; i < len; i++) {\n    if (sign[i] == '(') {\n      lf[n1] = i;\n      n1++;\n    }\n    if (sign[i] == ')') {\n      rt[n2] = i;\n      n2++;\n    }\n  }\n  for (i = n1 - 1; i >= 0; i--)\n    for (j = 0; j < n2; j++)\n      if (lf[i] < rt[j]) {\n        lf[i] = -1;\n        rt[j] = -1;\n        break;\n      }\n  for (i = 0; i < n1; i++)\n    if (lf[i] >= 0)\n      result[lf[i]] = '$';\n  for (j = 0; j < n2; j++)\n    if (rt[j] >= 0)\n      result[rt[j]] = '?';\n  for (i = 0; i < len; i++)\n    printf(\"%c\", result[i]);\n  cout << endl;\n}\n"}
{"label": "17", "index": "31112", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, length, k;\n  cin >> n;\n  getchar();\n  int i;\n  char a[500];\n  for (i = 1; i <= n; i++) {\n\n    cin >> a;\n    puts(a);\n    length = strlen(a);\n    int j;\n    for (j = length - 1; j >= 0; j--) {\n      int judge = 0;\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n      else if (a[j] == '(') {\n        for (k = j + 1; k < length; k++) {\n          if (a[k] == ')') {\n            a[k] = ' ';\n            a[j] = ' ';\n            judge = 1;\n            break;\n          }\n        }\n        if (judge == 0)\n          a[j] = '$';\n      }\n    }\n    for (j = 0; j < length; j++) {\n      if (a[j] == ')')\n        a[j] = '?';\n    }\n    puts(a);\n  }\n}\n"}
{"label": "17", "index": "31113", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[101];\nint find(char a[], int b, int x) {\n  int i;\n  for (i = b; i < x; i++) {\n    if (a[i + 1] == '$') {\n      return 0;\n    }\n    if (a[i + 1] == '?') {\n      a[i + 1] = ' ';\n      a[b] = ' ';\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  while (cin.getline(a, 101)) {\n\n    int x = strlen(a), i, l[100], t = 0, temp;\n    for (i = 0; i < x; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (i = 0; i < x; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n        l[t] = i;\n        t++;\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else {\n        a[i] = ' ';\n      }\n    }\n    for (i = 0; (i < t) && (i >= 0);) {\n      if (a[l[i]] == ' ') {\n        i++;\n        continue;\n      }\n      temp = find(a, l[i], x);\n      if (temp == 0)\n        i++;\n      if (temp == 1) {\n        i = 0;\n        continue;\n      }\n    }\n    for (i = 0; i < x; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31114", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar str[300];\nint main() {\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (i = 0; i < len; i++) {\n      int b = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = ' ';\n            str[i] = ' ';\n            b = 1;\n            break;\n          }\n        }\n        if (b == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      if (str[i] == ')')\n        str[i] = '?';\n    }\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "17", "index": "31115", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[101];\n  int l, i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n\n    l = strlen(a);\n    puts(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n      else {\n        if (a[i] == ')') {\n          n = 0;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == '(') {\n              a[i] = ' ';\n              a[j] = ' ';\n              n++;\n              break;\n            }\n          }\n          if (n == 0)\n            a[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31116", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[1000];\n  char a[1000];\n  int i, j;\n  while (cin.getline(a, 1000)) {\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        x[i] = 1;\n      else if (a[i] == ')')\n        x[i] = -1;\n      else\n        x[i] = 0;\n    }\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l - i; j++)\n        if (x[j] == 1 && x[i + j] == -1)\n          x[j] = x[i + j] = 0;\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == 1)\n        cout << \"$\";\n      else if (x[i] == -1)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31117", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid match(char s[]) {\n  char b[101];\n  puts(s);\n  int l, x = 0, i, left[101];\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    b[i] = ' ';\n  b[l] = '\u0000';\n  for (i = 0; i < l; i++)\n    if (s[i] == '(')\n      left[x++] = i;\n    else if (s[i] == ')') {\n      if (x == 0) {\n        b[i] = '?';\n      } else\n        x--;\n    }\n  for (i = 0; i < x; i++)\n    b[left[i]] = '$';\n  puts(b);\n}\nint main() {\n  char a[101];\n  while ((scanf(\"%s \", a))) {\n    match(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid Match(int input_len);\nchar input[128];\nchar tmp_input[128];\nint main() {\n\n  while (scanf(\"%s\", input) != EOF) {\n    strcpy(tmp_input, input);\n    int input_len = strlen(input);\n    Match(input_len);\n    for (int i = 0; i <= input_len - 1; i++) {\n      if (input[i] == '(') {\n        input[i] = '$';\n      } else if (input[i] == ')') {\n        input[i] = '?';\n      } else {\n        input[i] = ' ';\n      }\n    }\n    printf(\"%s\\n\", tmp_input);\n    cout << input << \"\\n\";\n  }\n  return 0;\n}\nvoid Match(int input_len) {\n  int cur_left = -1, cur_right = -1;\n  for (int i = 0; i <= input_len - 1; i++) {\n    if (input[i] == '(') {\n      cur_left = i;\n      continue;\n    }\n    if (input[i] == ')') {\n      if (cur_left != -1) {\n        input[cur_left] = ' ';\n        input[i] = ' ';\n        cur_left = -1;\n        i = -1;\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "31119", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[100][100] = {'\\0'};\n  int m = 0;\n  int j, t;\n  int a = 0, b = 0;\n  int c[100] = {0};\n\n  while (cin >> str[m]) {\n\n    for (j = 0; j < strlen(str[m]); j++) {\n      if (str[m][j] == '(') {\n        if (j == strlen(str[m]) - 1)\n          c[j] = 1;\n        else {\n          for (t = j;; t++) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == strlen(str[m]) - 1 || (a == b && a != 0))\n              break;\n          }\n\n          if (a > b)\n            c[j] = 1;\n          a = b = 0;\n        }\n      } else if (str[m][j] == ')') {\n        if (j == 0)\n          c[j] = 2;\n        else {\n          for (t = j;; t--) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == 0 || (a == b && a != 0))\n              break;\n          }\n\n          if (a < b)\n            c[j] = 2;\n          a = b = 0;\n        }\n      } else\n        continue;\n    }\n\n    cout << str[m] << endl;\n\n    for (j = 0; j <= strlen(str[m]) - 1; j++) {\n      if (c[j] == 0)\n        cout << ' ';\n      else if (c[j] == 1)\n        cout << '$';\n      else if (c[j] == 2)\n        cout << '?';\n    }\n    cout << endl;\n\n    a = 0;\n    b = 0;\n    for (j = 0; j < 100; j++)\n      c[j] = 0;\n\n    m++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500] = {0};\n  int n, i, k, j, jud[500] = {0}, max = 0;\n  for (i = 0; i < 500; i++) {\n    a[i] = 0;\n    jud[i] = 0;\n  }\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < 500; i++) {\n      b[i] = 0;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      b[i] = ' ';\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(' && jud[j] == 0) {\n            jud[j] = 1;\n            jud[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(' && jud[i] == 0) {\n        b[i] = '$';\n      }\n      if (a[i] == ')' && jud[i] == 0) {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n    for (i = 0; i < 500; i++) {\n      a[i] = 0;\n      jud[i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31121", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i;\n  char s[101], a[101];\n  while (scanf(\"%s \", s)) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s, j, k;\n  char c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    getchar();\n    scanf(\"%s\", &c);\n    s = strlen(c);\n    printf(\"%s\\n\", c);\n    for (j = 0; j < s; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[j] = ' ';\n            c[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < s; j++) {\n      if (c[j] == '(')\n        c[j] = '$';\n      if (c[j] == ')')\n        c[j] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31123", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char in[1000];\n  while (cin.getline(in, 1000, '\\n')) {\n\n    if (in[0] == '\\0')\n      break;\n    int len;\n    len = strlen(in);\n    int i, j, k;\n    int flag[100] = {0};\n    for (i = 0; i <= len - 1; i++) {\n      if (in[i] == '(') {\n        flag[i] = 2;\n      }\n      if (in[i] == ')') {\n        flag[i] = 3;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 1)\n        continue;\n      if (in[i] == '(') {\n        for (j = i + 1; j <= len - 1; j++) {\n          if (flag[j] == 1)\n            continue;\n          if (in[j] == ')') {\n            flag[j] = 1;\n            flag[i] = 1;\n          }\n          if (in[j] == ')')\n            break;\n        }\n      }\n    }\n    printf(\"%s\\n\", in);\n    int temp, t;\n    int num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        temp = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        t = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (j = 0; j <= len - 1; j++) {\n      if (flag[i] == 0 || flag[i] == 1) {\n        num++;\n      }\n    }\n    if (num < len) {\n\n      for (i = t; i <= temp; i++) {\n        if (flag[i] == 0 || flag[i] == 1) {\n          cout << \" \";\n        }\n        if (flag[i] == 2) {\n          printf(\"$\");\n        }\n        if (flag[i] == 3) {\n          cout << \"?\";\n        }\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l;\n  char as[110], bs[110], cs[110];\n  for (k = 0;; k++) {\n    cin >> as;\n    int len = strlen(as);\n    if (strcmp(as, bs) == 0)\n      break;\n    strcpy(bs, as);\n    for (i = 0; i < len; i++)\n      cs[i] = ' ';\n    cs[len] = 0;\n    for (l = 0; l < len; l++) {\n      for (i = l; i < len; i++) {\n        if (as[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (as[j] == '(') {\n              as[i] = ' ';\n              as[j] = ' ';\n              j = 0;\n              i = 0;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (as[i] == '(')\n        cs[i] = '$';\n      else {\n        if (as[i] == ')')\n          cs[i] = '?';\n      }\n    }\n    cout << bs << \"\\n\" << cs << \"\\n\";\n    strcpy(bs, as);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[160], ans[160];\n  int st[160], i, si;\n  for (; scanf(\"%s\", s) != EOF;) {\n    for (ans[0] = ' ', si = i = 0; i < strlen(s);\n         si -= (s[i] == ')' && si > 0), ans[++i] = ' ')\n      if (s[i] == '(')\n        st[si++] = i;\n      else if (s[i] == ')')\n        ans[i] = (si > 0) ? ' ' : '?';\n    for (ans[strlen(s)] = '\\0', i = 0; i < si; i++)\n      ans[st[i]] = '$';\n    cout << s << \"\\n\" << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31126", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint length;\nchar a[1000];\nchar c[100];\nint b[100];\nint zkh = 0;\nint match(int i) {\n  if (i == length)\n    return 0;\n  if (a[i] == '(') {\n    zkh = zkh + 1;\n    c[i] = '$';\n    b[zkh] = i;\n  }\n  if (a[i] == ')') {\n    if (zkh == 0) {\n      c[i] = '?';\n    }\n    if (zkh != 0) {\n      c[b[zkh]] = ' ';\n      zkh = zkh - 1;\n      c[i] = ' ';\n    }\n  }\n  if (a[i] != '(' && a[i] != ')') {\n    c[i] = ' ';\n  }\n  match(i + 1);\n}\n\nint main(int argc, const char *argv[]) {\n  int j, k, l;\n  while (cin.getline(a, 200)) {\n    zkh = 0;\n    length = strlen(a);\n    for (j = 0; j < length; j++) {\n      cout << a[j];\n    }\n    printf(\"\\n\");\n\n    match(0);\n\n    for (l = 0; l < length; l++) {\n      cout << c[l];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[105] = {'\\0'}, sign[105] = {'\\0'};\n  int length, i, j;\n  cin.getline(a, 101, '\\n');\n  while (a[0] != '\\0') {\n    length = strlen(a);\n    cout << a << endl;\n    for (i = 0; i < length; i++) {\n      if (a[i] != ')')\n        continue;\n      else if (i > 0) {\n        j = i - 1;\n        while (j >= 0 && a[j] != '(')\n          j--;\n        if (a[j] == '(') {\n          a[i] = '\\0';\n          a[j] = '\\0';\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (a[i] == '(')\n        sign[i] = '$';\n      else {\n        if (a[i] == ')')\n          sign[i] = '?';\n        else\n          sign[i] = ' ';\n      }\n    }\n    cout << sign;\n    for (i = 0; i < 105; i++) {\n      a[i] = '\\0';\n      sign[i] = '\\0';\n    }\n    cin.getline(a, 101, '\\n');\n    if (a[0] != '\\0')\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[1000];\nint n, c1 = 0;\nint match(int c) {\n  for (int i = c; i < n; i++) {\n    if (a[i] != '(' && a[i] != ')' && a[i] != '$')\n      a[i] = ' ';\n    if (a[i] == '(') {\n      c1++;\n      if (match(i + 1) != 0) {\n        a[i] = ' ';\n        a[match(i + 1)] = ' ';\n        c1--;\n      } else\n        a[i] = '$';\n    }\n    if (a[i] == ')') {\n      if (c1 == 0) {\n        a[i] = '?';\n        if (i < n) {\n          match(i + 1);\n          return 0;\n        }\n      }\n      return i;\n    }\n  }\n  return 0;\n}\nint main() \n{\n  while (cin >> a) {\n    c1 = 0;\n    n = strlen(a);\n    cout << a << endl;\n    match(0);\n    cout << a << endl << endl;\n  }\n  return 0;\n} \n"}
{"label": "17", "index": "31129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid check() {\n  char array[103];\n  while (cin) {\n    cin.getline(array, 103);\n    int i, j, len;\n    len = strlen(array);\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    cout << endl;\n    for (i = 0; i < len; i++) {\n      if (array[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (array[j] == '(') {\n            array[j] = '1';\n            array[i] = '1';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (array[i] != '(' && array[i] != ')') {\n        printf(\" \");\n      }\n      if (array[i] == '(')\n        cout << '$';\n      if (array[i] == ')') {\n        cout << '?';\n      }\n    }\n    cout << endl;\n  }\n  return;\n}\n\nint main() {\n  check();\n  return 0;\n}\n"}
{"label": "17", "index": "31130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], c;\n  int i, b[100], j, n, k;\n  for (j = 0;; j++) {\n    i = 0;\n    c = getchar();\n    if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'z') || c == '(' ||\n          c == ')'))\n      break;\n    a[j][i] = c;\n    i++;\n    while ((c = getchar()) != '\\n') {\n      a[j][i] = c;\n      i++;\n    }\n    b[j] = i;\n  }\n  n = j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    putchar('\\n');\n    for (i = 0; i < b[j]; i++) {\n      if ((a[j][i] >= 'a' && a[j][i] <= 'z') ||\n          (a[j][i] >= 'A' && a[j][i] <= 'Z')) {\n        a[j][i] = ' ';\n      }\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == ')') {\n        for (k = i - 1; k > -1; k--) {\n          if (a[j][k] == '(')\n            break;\n        }\n        if (k != -1) {\n          a[j][k] = ' ';\n          a[j][i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == '(')\n        a[j][i] = '$';\n      if (a[j][i] == ')')\n        a[j][i] = '?';\n    }\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, n, f[101][102] = {0}, l[101], g;\n  char s[101][102], a[102];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    l[i] = strlen(s[i]);\n    for (j = l[i] - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        k = j;\n      else\n        continue;\n      for (g = k + 1; g < l[i]; g++) {\n        if (s[i][g] == ')' && f[i][g] == 0) {\n          f[i][k] = 1;\n          f[i][g] = 1;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n    for (j = 0; j < l[i]; j++) {\n      if (s[i][j] == '(' && f[i][j] == 0)\n        printf(\"$\");\n      else if (s[i][j] == ')' && f[i][j] == 0)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ans[101], a[101];\n  int n;\n  cin >> n;\n  while (n > 0) {\n\n    cin >> a;\n    int ll = strlen(a);\n    int bb[101] = {0};\n    int be;\n    be = -1;\n    int i = 0;\n    while (i < ll) {\n      while (a[i] != '(' && a[i] != ')') {\n        ans[i] = ' ';\n        i++;\n        if (i >= ll)\n          break;\n      }\n      if (a[i] == '(') {\n        bb[i + 1] = be;\n        be = i + 1;\n      }\n      if (a[i] == ')') {\n        if (be < 0)\n          ans[i] = '?';\n        else {\n          int t;\n          t = bb[be];\n          bb[be] = 0;\n          be = t;\n          ans[i] = ' ';\n        }\n      }\n      i++;\n    }\n    for (i = 0; i < ll; i++) {\n      if (a[i] == '(') {\n        if (bb[i + 1] == 0)\n          ans[i] = ' ';\n        else\n          ans[i] = '$';\n      }\n    }\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", a[i]);\n    cout << \" \";\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", ans[i]);\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31133", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, k;\n  cin >> m;\n  getchar();\n  for (k = 0; k < m; k++) {\n    int i, f, len, j;\n    char a[200], b[200], c[200];\n\n    cin >> a;\n    len = strlen(a);\n    strcpy(c, a);\n    b[len] = '\u0000';\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        f = 0;\n        for (j = i; j < len; j++) {\n          if (a[j] == ')') {\n            f = 1;\n            a[j] = 'a';\n            break;\n          }\n        }\n        if (f == 0)\n          b[i] = '$';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s %s \", c, b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[120];\n  char s[120], s1[120];\n  int i, j, k, m, n, l;\n  while (1) {\n\n    cin >> s;\n    if (strcmp(s, s1) == 0)\n      break;\n    strcpy(s1, s);\n    memset(a, 0, sizeof(a));\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[i] = 1;\n      if (s[i] == ')')\n        a[i] = -1;\n    }\n\n    for (i = 0; i < l; i++) {\n      if ((s[i] == '(') && (a[i] != 0)) {\n        j = i + 1;\n        while ((a[j] == 0) && (j < l))\n          j++;\n        if ((s[j] == ')') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n      if ((s[i] == ')') && (a[i] != 0)) {\n        j = i - 1;\n        while ((a[j] == 0) && (j > 0))\n          j--;\n        if ((s[j] == '(') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n    }\n    printf(\"%s \", s);\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1)\n        printf(\"$\");\n      else if (a[i] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint brackets(void) {\n  int chart[2][100], c, count = 0, pos, state = 0, tmp, first_left,\n                        previous_left, end_flag = 0;\n\n  for (;; count++) {\n    c = getchar();\n    if (c == EOF)\n      return 1;\n    if (c == '\\n') {\n      break;\n    }\n    chart[0][count] = c;\n    if (c == 40) {\n      chart[1][count] = 36;\n    } else if (c == 41) {\n      chart[1][count] = 63;\n    } else {\n      chart[1][count] = 32;\n    }\n  }\n  for (pos = 0; end_flag == 0;) {\n    switch (state) {\n    case 0:\n      if (chart[1][pos] == 36) {\n        state = 1;\n        first_left = pos;\n        previous_left = pos;\n        if (pos == count) {\n          end_flag = 1;\n        } else {\n          pos += 1;\n        }\n      } else {\n        if (pos == count) {\n          end_flag = 1;\n        } else {\n          pos += 1;\n        }\n      }\n      break;\n    case 1:\n      if (chart[1][pos] == 63) {\n        chart[1][pos] = 32;\n        chart[1][previous_left] = 32;\n        if (previous_left != first_left) {\n          state = 2;\n          pos = previous_left;\n        } else {\n          if (pos == count) {\n            end_flag = 1;\n          } else {\n            state = 0;\n            pos += 1;\n          }\n        }\n      } else if (chart[1][pos] == 36) {\n        previous_left = pos;\n        pos += 1;\n      } else {\n        if (pos == count) {\n          end_flag = 1;\n        } else {\n          pos += 1;\n        }\n      }\n      break;\n    case 2:\n      if (chart[1][pos] == 36) {\n        previous_left = pos;\n        state = 1;\n      } else\n        pos -= 1;\n\n      break;\n    }\n    if (pos > count) {\n      pos = count;\n    }\n  }\n  for (tmp = 0; tmp < count; tmp++) {\n    putchar(chart[0][tmp]);\n    if (tmp == count - 1) {\n      putchar('\\n');\n    }\n  }\n  for (tmp = 0; tmp < count; tmp++) {\n    putchar(chart[1][tmp]);\n    if (tmp == count - 1) {\n      putchar('\\n');\n    }\n  }\n  return 0;\n}\nint main() {\n  while (1) {\n    if (brackets() == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[105];\n  char sign[105];\n  char present[105];\n  while (scanf(\"%s\", zfc) > 0) {\n\n    strcpy(sign, zfc);\n    strcpy(present, zfc);\n    int left = 0, right = 0;\n    int m = strlen(zfc);\n    for (int i = 0; i < m; i++) {\n      if (zfc[i] == '(') {\n        left = 0;\n        right = 0;\n        for (int j = i; j < m; j++) {\n          if (zfc[j] == '(') {\n            left++;\n          }\n          if (zfc[j] == ')') {\n            left--;\n          }\n          if (left <= 0) {\n            break;\n          }\n        }\n        if (left > 0) {\n          sign[i] = '$';\n        }\n      }\n      if (zfc[i] == ')') {\n        left = 0;\n        right = 0;\n        for (int j = i; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            right--;\n          }\n          if (zfc[j] == ')') {\n            right++;\n          }\n          if (right <= 0) {\n            break;\n          }\n        }\n        if (right > 0) {\n          sign[i] = '?';\n        }\n      }\n    }\n    for (int i = 0; i < m; i++) {\n      if (sign[i] != '$' && sign[i] != '?')\n        sign[i] = ' ';\n    }\n    puts(present);\n    puts(sign);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31138", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[101];\n  int rr, lr, ll, rl;\n  for (; (scanf(\"%s\", c)) != EOF;) {\n    cout << c << \"\\n\";\n    char p[101];\n    int i, l;\n    rr = 0;\n    rl = 0;\n    ll = 0;\n    lr = 0;\n    for (l = 0; c[l] != 0; l++)\n      p[l] = ' ';\n\n    p[l] = '\\0';\n    for (i = 0; c[i] != 0; i++) {\n      if (c[i] == '(') {\n        ll = ll + 1;\n      }\n      if (c[i] == ')') {\n        lr = lr + 1;\n        if (ll < lr) {\n          p[i] = '?';\n          lr = lr - 1;\n        }\n      }\n    }\n    for (i = l - 1; i >= 0; i = i - 1) {\n      if (c[i] == ')') {\n        rr = rr + 1;\n      }\n      if (c[i] == '(') {\n        rl = rl + 1;\n        if (rr < rl) {\n          p[i] = '$';\n          rl = rl - 1;\n        }\n      }\n    }\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31139", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int l = 0, c[100] = {0}, m;\n\n    cin >> a;\n    if (a[0] == 0)\n      break;\n    for (int i = 0; i < 101; i++) {\n      if (a[i] != 0) {\n        if (a[i] == '(') {\n          int p = 0;\n          c[i] = -1;\n          b[i] = '$';\n        } else if (a[i] == ')') {\n\n          c[i] = 1;\n          b[i] = '?';\n        } else\n          b[i] = ' ';\n      } else {\n        l = i;\n        break;\n      }\n    }\n\n    cout << endl;\n    for (int i = 0; i < l; i++)\n      if (c[i] == -1)\n        for (int j = i, sum = 0; j < l; j++) {\n          sum = sum + c[j];\n\n          if (sum == 0) {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31140", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  scanf(\"%d \", &n);\n  char a[100][1000];\n  for (i = 0; i < n + 1; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n + 1; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[101];\n\nint main() {\n  int i, n, j, k, m, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++)\n      a[0] = '\\0';\n    scanf(\"%s\", a);\n    cout << a << \"\\n\";\n    m = strlen(a);\n    for (j = m - 1; j >= 0; j--) {\n      if (a[j] == '(') {\n        if (j == m - 1) {\n          a[j] = '$';\n          continue;\n        }\n        b = 1;\n        for (k = j + 1; k < m; k++) {\n\n          if (a[k] == ')') {\n            a[j] = ' ';\n            a[k] = ' ';\n            b = 0;\n            break;\n          }\n        }\n        if (b)\n          a[j] = '$';\n      }\n    }\n    for (j = m - 1; j >= 0; j--) {\n\n      if (a[j] == ')')\n        a[j] = '?';\n      else if (a[j] != '$')\n        a[j] = ' ';\n    }\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][102];\n  int i, n = 0, j, k, l;\n  while (cin.getline(str[n++], 102)) {\n    \n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    cout << str[i] << endl;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        k = j + 1;\n        while (str[i][k] != '\\0') {\n          if (str[i][k] == ')') \n          {\n            break;\n          }\n          k++;\n        }\n        if (str[i][k] == '\\0') {\n          j++;\n          continue;\n        }\n        l = k - 1;\n        while (true) \n        {\n          if (str[i][l] == '(')\n            break;\n          l--;\n        }\n        str[i][l] = str[i][k] = 'a'; \n      }\n      if (str[i][j] != '(')\n        j++;\n    }\n    j = 0;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        str[i][j] = '$';\n      } else if (str[i][j] == ')') {\n        str[i][j] = '?';\n      } else\n        str[i][j] = ' '; \n      j++;\n    }\n    cout << str[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[101];\n\nint main() {\n  int i, n, j, k, m, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++)\n      a[0] = '\\0';\n    scanf(\"%s \", a);\n    cout << a << \"\\n\";\n    m = strlen(a);\n    for (j = m - 1; j >= 0; j--) {\n      if (a[j] == '(') {\n        if (j == m - 1) {\n          a[j] = '$';\n          continue;\n        }\n        b = 1;\n        for (k = j + 1; k < m; k++) {\n\n          if (a[k] == ')') {\n            a[j] = ' ';\n            a[k] = ' ';\n            b = 0;\n            break;\n          }\n        }\n        if (b)\n          a[j] = '$';\n      }\n    }\n    for (j = m - 1; j >= 0; j--) {\n\n      if (a[j] == ')')\n        a[j] = '?';\n      else if (a[j] != '$')\n        a[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len, j, m = 0, max;\n  char ch[105], s[105], str[105];\n  while (scanf(\"%s\", ch) != EOF) {\n    int m = 0;\n    strcpy(s, ch);\n    strcpy(str, ch);\n    len = strlen(ch);\n\n    for (i = 0; i < len; i++) {\n      if (ch[i] != '(' && ch[i] != ')') {\n        s[i] = ' ';\n      } else if (ch[i] == ')') \n      {\n        for (j = i - 1; j >= 0; j--) {\n          if (ch[j] == '(') {\n            m = 1;\n            ch[i] = ' ';\n            s[i] = ' ';\n            s[j] = ' ';\n            ch[j] = ' ';\n            break;\n          } else {\n            continue;\n          }\n        }\n        if (m == 0) {\n          s[i] = '?';\n        } \n      }   \n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        s[i] = '$';\n      } else if (s[i] == ')') {\n        s[i] = '?';\n      }\n    }\n    printf(\"%s\\n\", str);\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200];\n  while (cin.getline(a, 200)) {\n    int n = strlen(a);\n    int k;\n    printf(\"%s\\n\", a);\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '?')\n        a[i] = ' ';\n      if (a[i] == '$')\n        a[i] = ' ';\n      if (a[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k < 0)\n          a[i] = '?';\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int i = 0, j = 0;\n  while (cin.getline(str, 110)) {\n    for (i = 0; str[i] != '\\0'; i++) {\n      cout << str[i];\n    }\n    printf(\"\\n\");\n    for (i = 0; str[i] != '\\0'; ++i) {\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (str[j] == '(') {\n            str[i] = str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(str); ++i) {\n      if (str[i] == '(')\n        cout << \"$\";\n      else if (str[i] == ')')\n        cout << \"?\";\n      else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n\n    char str[300];\n    int i, j, k, a1 = 0, js1 = 0, l;\n\n    cin >> str;\n    if (feof(stdin))\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == ')' && a1 == 0) {\n        str[i] = '?';\n      }\n      if (str[i] == ')' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '?';\n      }\n    }\n    a1 = 0;\n    js1 = 0;\n\n    for (; i >= 0; i--) {\n      if (str[i] == ')') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == '(' && a1 == 0) {\n        str[i] = '$';\n      }\n      if (str[i] == '(' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '$';\n      }\n    }\n\n    for (i = 0; i < l; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[105];\n  while (cin >> a) {\n    int n = strlen(a);\n    int i = 0, j, b[105];\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')')\n        b[i] = -1;\n      else\n        b[i] = 0;\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == -1) {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(a);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      else if (b[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31149", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[102], b[102];\n  int len, i, left, leftNum[102];\n  while (cin >> a) {\n    left = 0;\n    len = strlen(a);\n    for (i = 0; i < 102; i++)\n      b[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        left++;\n        leftNum[left] = i;\n      }\n      if (a[i] == ')')\n        if (left > 0) {\n          b[leftNum[left]] = ' ';\n          left--;\n        } else\n          b[i] = '?';\n    }\n    b[len] = '\\0';\n    cout << a << endl << b << endl;\n  }\n  return 0;\n}\n\n"}
{"label": "17", "index": "31150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len, j;\n  char ch[105], s[105], str[105];\n  while (scanf(\"%s\", ch) != EOF) {\n    int m = 0;\n    strcpy(s, ch);\n    strcpy(str, ch);\n    len = strlen(ch);\n\n    for (i = 0; i < len; i++) {\n      if (ch[i] != '(' && ch[i] != ')') {\n        s[i] = ' ';\n      } else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (ch[j] == '(') {\n            m = 1;\n            ch[i] = ' ';\n            s[i] = ' ';\n            s[j] = ' ';\n            ch[j] = ' ';\n            break;\n          } else {\n            continue;\n          }\n        }\n        if (m == 0) {\n          s[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        s[i] = '$';\n      } else if (s[i] == ')') {\n        s[i] = '?';\n      }\n    }\n    printf(\"%s\\n\", str);\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31151", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  while (cin.getline(str, 101, '\\n')) {\n    char k[101] = {0}, ts[101] = {0};\n    int i, t, temp = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      k[i] = ' ';\n      ts[i] = str[i];\n      if (str[i] == '(')\n        temp++;\n      if (str[i] == ')')\n        temp--;\n      if (temp < 0) {\n        k[i] = '?';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    t = i - 1;\n    temp = 0;\n    for (i = t; i >= 0; i--) {\n      if (str[i] == ')')\n        temp++;\n      if (str[i] == '(')\n        temp--;\n      if (temp < 0) {\n        k[i] = '$';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    printf(\"%s\\n%s\\n\", ts, k);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i;\nchar x[101];\nchar y[101];\nvoid f() {\n  int num = 0;\n  int k[101] = {0};\n  memset(y, ' ', 101);\n  int len = strlen(x);\n  for (i = 0; i < len; i++) {\n    if (x[i] == '(') {\n      y[i] = '$';\n      num = num + 1;\n      k[num] = i;\n    }\n    if (x[i] == ')') {\n      if (num > 0) {\n        y[k[num]] = ' ';\n        num = num - 1;\n      } else\n        y[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++)\n    cout << y[i];\n\n  cout << endl;\n}\n\nint main() {\n  while (cin >> x) {\n    cout << x << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char a[], int, int); \nvoid g(char a[]);           \nint main() {\n  char str[100][101];\n  int i, n = 0, j;\n  while (cin.getline(str[n++], 101)) \n  {\n  }\n  for (i = 0; i < n; i++) {\n    cout << str[i] << endl;\n    for (j = 0; j < strlen(str[i]); j++) {\n      if (str[i][j] == ')') \n      {\n        f(str[i], j - 1, j);\n      }\n    }\n    g(str[i]);\n    cout << str[i] << endl;\n  }\n  return 0;\n}\nvoid f(char a[], int x, int y) {\n  if (a[x] == '(') \n    a[x] = a[y] = 'a';\n  else if (x > 0) \n    f(a, x - 1, y);\n}\nvoid g(char a[]) {\n  int i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else\n      a[i] = ' ';\n  }\n}\n"}
{"label": "17", "index": "31154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(char c[], int n) {\n  for (int i = n + 1; i < strlen(c); i++) {\n    if (c[i] == ')') {\n      c[i] = ' ';\n      c[n] = ' ';\n      return i;\n    } else if (c[i] == '(') {\n      i = match(c, i);\n    }\n  }\n  c[n] = '$';\n  return strlen(c) - 1;\n}\nint main() {\n  char ch[110];\n  while (scanf(\"%s \", ch)) {\n    cout << ch << endl;\n    for (int i = 0; ch[i] != 0; i++)\n      if (ch[i] != '(' && ch[i] != ')')\n        ch[i] = ' ';\n    for (int i = 0; ch[i] != 0; i++) {\n      if (ch[i] == '(')\n        i = match(ch, i);\n      else if (ch[i] == ')')\n        ch[i] = '?';\n    }\n    cout << ch << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar *mystrrchr(char *strcopy, char *end) {\n  char *tmp = end - 1;\n  while (tmp >= strcopy) {\n    if (*tmp == '(') {\n      return tmp;\n    }\n    tmp--;\n  }\n  return NULL;\n}\n\nvoid judge(char *str, char *flag) {\n  char strcopy[101];\n  strcpy(strcopy, str);\n  int len = strlen(strcopy);\n  char *index1 = strchr(strcopy, ')');\n  while (index1 != NULL && (index1 - strcopy) < len) {\n    char *index2 = mystrrchr(strcopy, index1);\n    if (index2 != NULL) {\n      strcopy[index1 - strcopy] = '-';\n      strcopy[index2 - strcopy] = '-';\n    }\n    index1 = strchr(index1 + 1, ')');\n  }\n  int i = 0;\n  for (i = 0; i < len; i++) {\n    if (strcopy[i] == '(')\n      flag[i] = '$';\n    if (strcopy[i] == ')')\n      flag[i] = '?';\n  }\n  cout << str << \" \" << flag << \" \";\n}\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  getchar();\n  char str[101];\n  char flag[101];\n  while (n > 0) {\n    memset(flag, ' ', sizeof(flag));\n\n    scanf(\"%s \", str);\n    flag[strlen(str)] = '\u0000';\n    judge(str, flag);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31156", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char zfc[120], cha, i, j, len;\n  while (scanf(\"%s\", zfc) != EOF) {\n    cha = 0;\n    len = strlen(zfc);\n    printf(\"%s\\n\", zfc);\n    for (i = 0; i < len; i++) {\n      if (zfc[i] != '(' && zfc[i] != ')') {\n        zfc[i] = ' ';\n      }\n\n      if (zfc[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            zfc[j] = ' ';\n            zfc[i] = ' ';\n            break;\n          }\n        }\n        if (j < 0) {\n          zfc[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (zfc[i] == '(') {\n        zfc[i] = '$';\n      }\n    }\n    puts(zfc);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31157", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101];\n\nint main() {\n  int i, n, j, k, m, b;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++)\n      a[0] = '\\0';\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    m = strlen(a);\n    for (j = m - 1; j >= 0; j--) {\n      if (a[j] == '(') {\n        if (j == m - 1) {\n          a[j] = '$';\n          continue;\n        }\n        b = 1;\n        for (k = j + 1; k < m; k++) {\n\n          if (a[k] == ')') {\n            a[j] = ' ';\n            a[k] = ' ';\n            b = 0;\n            break;\n          }\n        }\n        if (b)\n          a[j] = '$';\n      }\n    }\n    for (j = m - 1; j >= 0; j--) {\n\n      if (a[j] == ')')\n        a[j] = '?';\n      else if (a[j] != '$')\n        a[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[150];\nint l, j;\nvoid left(int i) {\n  int jj;\n  \n  if (i == l - 1) {\n    a[i] = '$';\n    return;\n  }\n  for (jj = i + 1; jj < l; jj++) {\n    \n    if (a[jj] == ')') {\n      a[jj] = ' ';\n      a[i] = ' ';\n      break;\n    } else if (a[jj] == '(') {\n      left(jj);\n    }\n  }\n  if (jj == l) {\n    a[i] = '$';\n  }\n  \n  return;\n}\nvoid match(int i) { \n  \n  if (i == l) {\n    for (int ii = 0; ii < l; ii++) {\n      if (a[ii] == '(') {\n        a[ii] = '$';\n      }\n      if (a[ii] == ')') {\n        a[ii] = '?';\n      }\n    }\n    return;\n  } else {\n    if (i == l - 1 && a[i] == '(') {\n      a[i] = '$';\n    }\n    if ((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) {\n      a[i] = ' ';\n    } else if (a[i] == '(') {\n      left(i);\n    }\n    match(i + 1);\n  }\n}\nint main() {\n  while (cin >> a) {\n    l = strlen(a);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    cout << endl;\n    match(0);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char *s) {\n  int a[100], i, j = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      a[j] = i;\n      j++;\n    } else if (s[i] == ')') {\n      if (j > 0) {\n        s[i] = ' ';\n        s[a[j - 1]] = ' ';\n        j--;\n      } else\n        s[i] = '?';\n    } else {\n      s[i] = ' ';\n    }\n  }\n}\n\nint main() {\n  int n, i;\n  char s[101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    match(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid change(char b[], int n, int m) {\n  if (b[m] != ')' && m < n) \n  {\n    change(b, n, m + 1);\n  }\n  if (b[m] == ')' && m < n) {\n    int i;\n    for (i = m; i >= 0; i--) {\n      if (b[i] == '(') {\n        b[i] = 'A';\n        b[m] = 'A';\n        break;\n      }\n    }\n    change(b, n, m + 1);\n  }\n}\nint main() {\n  char a[200];\n  cin >> a;\n  getchar();\n  while (a[0] != 0) {\n    int num, j;\n    num = strlen(a);\n    cout << a << endl;\n    change(a, num, 0);\n    for (j = 0; j < num; j++) \n    {\n      if (a[j] == '(')\n        a[j] = '$';\n      else {\n        if (a[j] == ')')\n          a[j] = '?';\n        else\n          a[j] = ' ';\n      }\n    }\n    cout << a << endl;\n    cin.getline(a, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s1[101], s2[101];\nint f(int);\n\nint main() {\n  while (scanf(\"%s\", s1) != EOF) {\n    f(0);\n    printf(\"%s\\n%s\\n\", s1, s2);\n  }\n  return 0;\n}\n\nint f(int k) {\n  if (s1[k] == '\\0') {\n    s2[k] = '\\0';\n    return 0;\n  }\n\n  if (s1[k] == ')') {\n    s2[k] = '?';\n    f(k + 1);\n    return 0;\n  }\n\n  if (s1[k] == '(') {\n    for (int i = k + 1; i > 0; i++) {\n      if (s1[i] == '\\0') {\n        s2[i] = '\\0';\n        i = -1;\n      }\n\n      else if (s1[i] == '(') {\n        i = f(i);\n      }\n\n      else if (s1[i] == ')') {\n        s2[k] = ' ';\n        s2[i] = ' ';\n        f(i + 1);\n        return i;\n      }\n\n      else {\n        s2[i] = ' ';\n      }\n    }\n    s2[k] = '$';\n    return -1;\n  }\n\n  s2[k] = ' ';\n  f(k + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "31162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[101] = {\"0\"}, temp[101] = {\"0\"};\n  int len = 0, i = 0, j = 0, s = 0;\n  while (cin.getline(word, 101)) {\n    cout << word << endl;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      temp[i] = ' ';\n    temp[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        temp[i] = '$';\n      if (word[i] == ')')\n        temp[i] = '?';\n    }\n    for (i = 0; i < len; i++) {\n      s = 1;\n      if (word[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (word[j] == '(')\n            s++;\n          if (word[j] == ')')\n            s--;\n          if (s == 0) {\n            temp[i] = ' ';\n            temp[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << temp << \"\\n\";\n    strcpy(temp, \"0\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar in[102];\nint lenth;\nvoid match(int n) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(' && in[i + n] == ')') {\n      in[i] = ' ';\n      in[i + n] = ' ';\n    }\n  }\n  if (n <= lenth - 2) {\n    match(n + 1);\n  }\n}\nvoid print(char in[]) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(')\n      in[i] = '$';\n    else if (in[i] == ')')\n      in[i] = '?';\n    else\n      in[i] = ' ';\n  }\n  cout << in << endl;\n}\nint main() {\n  while (cin >> in) {\n    cout << in << endl;\n    lenth = strlen(in);\n    match(0);\n    print(in);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31164", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], flag[101];\n  while (cin.getline(str, 101)) {\n    cout << str << endl;\n    int len, num = 0;\n    len = strlen(str);\n    int i, j;\n    for (i = 0; i < len; i++)\n      flag[i] = ' ';\n    flag[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        num++;\n        flag[i] = '$';\n      }\n      if (str[i] == ')') {\n        num--;\n        if (num >= 0) {\n          for (j = i - 1; j >= 0; j--)\n            if (str[j] == '(') {\n              flag[j] = ' ';\n              str[j] = ' ';\n              break;\n            }\n        } else {\n          flag[i] = '?';\n          num++;\n        }\n      }\n    }\n    cout << flag << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31165", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (s[j] == '(') {\n            i = j;\n          } else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == len)\n          break;\n\n        i = -1;\n      }\n    }\n    for (q = 0; q < len; q++) {\n      if (s[q] == ')') {\n        s[q] = '?';\n      } else if (s[q] == '(') {\n        s[q] = '$';\n      } else\n        s[q] = ' ';\n    }\n    printf(\"%s \", ss);\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101];\n  int g[100] = {0}, left[100] = {0};\n  int m, n, i, k, sum;\n  while (cin.getline(sen, 101)) {\n    n = strlen(sen);\n    k = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      if (sen[i] == '(') {\n        g[i] = 1;\n        sum++;\n        left[k] = i;\n        k++;\n      } else {\n        if (sen[i] == ')') {\n          if (sum > 0) {\n            sum--;\n            k--;\n            g[left[k]] = 0;\n            g[i] = 0;\n          } else {\n            g[i] = -1;\n          }\n        } else\n          g[i] = 0;\n      }\n    }\n    for (i = n - 1; g[i] == 0; i--) {\n    }\n    n = i;\n    for (i = 0; g[i] == 0; i++) {\n    }\n    m = i;\n    cout << sen << endl;\n    for (i = m; i <= n; i++) {\n      if (g[i] == 1)\n        cout << '$';\n      else {\n        if (g[i] == -1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][101], b[100][101], c = '(', d = ')';\n  int i, j, k;\n  for (k = 0; k <= 20; k++) {\n    for (i = 0; i < 101; i++)\n      a[k][i] = 0;\n\n    cin >> a[k];\n    strcpy(b[k], a[k]);\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == d)\n        for (j = i - 1; j >= 0; j--)\n          if (a[k][j] == c) {\n            a[k][i] = a[k][j] = 1;\n            break;\n          }\n    for (i = 0; i < 101 && b[k][i] != 0; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == c)\n        printf(\"$\");\n      else if (a[k][i] == d)\n        printf(\"?\");\n      else {\n        printf(\" \");\n      }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31168", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint match(int i); \nchar str[101];\nint n;\nint main() \n{\n  while (cin >> str) \n  {\n    cout << str << endl;\n    n = strlen(str);\n    match(0);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i) \n{\n  if (i == n) \n    return 0;\n  else if (str[i] == ')') \n  {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(') \n    str[i] = '$';\n  else {\n    str[i] = ' ';\n  }\n  match(i + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "31169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char array[101], ans[101];\n  int len, i, left, right;\n\n  while (cin.getline(array, 101)) {\n    len = strlen(array);\n    left = 0;\n    right = 0;\n    for (i = 0; i < len; i++) {\n      ans[i] = ' ';\n      if (array[i] == '(') {\n        left++;\n      }\n      if (array[i] == ')') {\n        right++;\n        if (right > left) {\n          left = 0;\n          right = 0;\n          ans[i] = '?';\n        }\n      }\n    }\n    left = 0;\n    right = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (array[i] == '(') {\n        left++;\n        if (left > right) {\n          left = 0;\n          right = 0;\n          ans[i] = '$';\n        }\n      }\n      if (array[i] == ')') {\n        right++;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      printf(\"%c\", ans[i]);\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    puts(a);\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == ')') {\n        for (m = j; m >= 0; m--)\n          if (a[m] == '(') {\n            a[m] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n    }\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        a[j] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint getlength(char *a) {\n  int i = 0;\n  while (a[i] != '\\0')\n    i++;\n  return i;\n}\nvoid chuli(char ch[], int a[], int n) {\n  for (int i = 0; i < n; i++) {\n    switch (ch[i]) {\n    case '(':\n      a[i] = 1;\n      break;\n    case ')':\n      a[i] = -1;\n      break;\n    default:\n      a[i] = 0;\n      break;\n    }\n  }\n}\nvoid pipei(int a[], int n) {\n  for (int k = 0; k < n; k++) {\n    if (a[k] == 1) {\n      int s = 0;\n      for (int i = 0; i < k; i++)\n        s += a[i];\n      for (int i = k; i < n; i++) {\n        if (a[i] == -1) {\n          int t = 0;\n          for (int j = 0; j < i; j++)\n            t += a[j];\n          if (s == t - 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n  }\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    int a[110];\n    int n = getlength(ch);\n    chuli(ch, a, n);\n    pipei(a, n);\n    cout << ch << endl;\n    for (int i = 0; i < n; i++) {\n      switch (a[i]) {\n      case 1:\n        cout << '$';\n        break;\n      case -1:\n        cout << '?';\n        break;\n      case 0:\n        cout << ' ';\n        break;\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[102], str2[102];\n  int i, j;\n  while (cin.getline(str1, 102)) {\n    strcpy(str2, str1);\n    int len = strlen(str1);\n    for (i = 0; i < len; i++) {\n      if (str2[i] != '(' && str2[i] != ')')\n        str2[i] = ' ';\n      else {\n        if (str2[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (str2[j] == '(') {\n              str2[j] = ' ';\n              str2[i] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    cout << str1 << \"\\n\" << str2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31173", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], label[101];\n  while (cin >> str) {\n\n    int pos[101];\n    int len = strlen(str);\n    int left = 0, right = 0;\n    int pos_i = -1;\n    int i;\n\n    for (i = 0; i <= len - 1; i++) {\n      label[i] = ' ';\n      if (str[i] == '(') {\n        left++;\n        pos[++pos_i] = i;\n      }\n      if (str[i] == ')') {\n        if (left <= right) {\n          label[i] = '?';\n        } else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++) {\n        label[pos[i]] = '$';\n      }\n    }\n    label[len] = '\\0';\n    printf(\"%s\\n\", str);\n    cout << label << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], t[101];\n  int i, j, k, c, b[101] = {0}, n;\n  for (; cin >> a;) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      t[i] = ' ';\n    }\n    for (i = 0; i <= n; i++) {\n\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 0) {\n            b[i] = 1;\n            b[j] = 1;\n            break;\n          }\n        if (j == -1) {\n          c++;\n          t[i] = '?';\n        }\n      }\n      if (a[i] == '\\0')\n        for (k = 0; k < i; k++) {\n          if (a[k] == '(' && b[k] == 0) {\n            c++;\n            t[k] = '$';\n          }\n        }\n    }\n    cout << a << \"\\n\";\n    if (c != 0) {\n      i = 0;\n      while (t[i] == ' ')\n        i++;\n      k = n - 1;\n      while (t[k] == ' ')\n        k--;\n      for (j = i; j <= k; j++)\n        cout << t[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char a[1000], b[1000];\n  int i, j, k, e = 0;\n  scanf(\"%d\", &n);\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%s\", &a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      } else {\n        b[j] = a[j];\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        for (k = j + 1; k < strlen(a); k++) {\n          if (b[k] == '(') {\n            e++;\n          } else if (b[k] == ')' && e == 0) {\n            b[k] = ' ';\n            b[j] = ' ';\n            e++;\n          }\n        }\n        e = 0;\n      }\n\n      else if (b[j] == ')') {\n        e = 0;\n        k = j - 1;\n        for (k = j - 1; k > 0; k--) {\n          if (b[k] == '(') {\n            b[k] = ' ';\n            b[j] = ' ';\n            k = 0;\n            e = 1;\n          }\n        }\n        if (e == 0 && b[0] == '(') {\n          b[0] = ' ';\n          b[j] = ' ';\n        }\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        b[j] = '$';\n      } else if (b[j] == ')') {\n        b[j] = '?';\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", a[j]);\n    }\n    cout << \"\\n\";\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar investigate(char a[]) {\n  int i, j, k, n;\n  int p1 = 0, p2 = 0, w, t = 0, t1 = 0;\n  n = strlen(a);\n  char b[100];\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      p1++;\n    if (a[i] == ')')\n      p2++;\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((i == (n - 1)) && (t > t1)) {\n      i = -1;\n      t1 = t;\n      goto loop;\n    } else if (a[i] != '(') {\n      b[i] == ' ';\n      continue;\n    } else {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == '(') {\n          i = j - 1;\n          break;\n        } else if (a[j] == ')') {\n          a[i] = '[';\n          a[j] = ']';\n          t++;\n          break;\n        }\n      }\n    }\n  loop:;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == '[')\n      a[i] = '(';\n    if (a[i] == ']')\n      a[i] = ')';\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%c\", a[i]);\n  cout << \" \";\n  for (i = 0; i < n; i++)\n    printf(\"%c\", b[i]);\n\n  return 0;\n}\n\nint main() {\n  int i, j;\n  char a[100];\n  while (scanf(\"%s \", a)) {\n    investigate(a);\n    cout << \" \";\n  }\n}\n"}
{"label": "17", "index": "31177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000] = {0}, b[1000] = {0};\n  int i, j;\n  while (cin >> a) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      b[i] = a[i];\n    }\n    b[i] = '\u0000';\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if (b[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '(') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if ((b[i] >= 'a' && b[i] <= 'z') || (b[i] >= 'A' && b[i] <= 'Z'))\n        b[i] = ' ';\n      else if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[1000];\nvoid findr(int left) {\n  for (int i = left + 1; s[i] != '\\0'; i++) {\n    if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n      s[i] = ' ';\n    if (s[i] == '(')\n      findr(i);\n    if (s[i] == ')') {\n      s[i] = ' ';\n      s[left] = ' ';\n      return;\n    }\n  }\n  s[left] = '$';\n}\n\nint main() {\n  while (cin >> s) {\n    cout << s << endl;\n    for (int i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n        s[i] = ' ';\n      if (s[i] == '(')\n        findr(i);\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[101], b[101];\nint panduan[101];\nint l;\nvoid deal(int k) {\n  if (k > 0) {\n    if (a[k - 1] == ')') {\n      panduan[k - 1] = 1;\n      deal(k - 1);\n    } else if (a[k - 1] == '(') {\n      panduan[k - 1] = 2;\n      for (int i = k; i < l; i++)\n        if (panduan[i] == 1) {\n          panduan[k - 1] = 0;\n          panduan[i] = 0;\n          break;\n        }\n      deal(k - 1);\n    } else\n      deal(k - 1);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 101; i++) {\n    a[i] = ' ';\n    b[i] = ' ';\n    panduan[i] = 0;\n  }\n  while (cin >> a) {\n    l = strlen(a);\n    deal(l);\n    for (i = 0; i < l; i++) {\n      if (panduan[i] == 1)\n        b[i] = '?';\n      if (panduan[i] == 2)\n        b[i] = '$';\n    }\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (i = 0; i < l; i++)\n      cout << b[i];\n    printf(\"\\n\");\n    for (i = 0; i < 101; i++) {\n      a[i] = ' ';\n      b[i] = ' ';\n      panduan[i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[1000];\n  char outline[1000];\n  int i, j;\n  int len;\n  while (scanf(\"%s \", line)) {\n    strcpy(outline, line);\n    len = strlen(line);\n    for (i = 0; i < len; i++) {\n      if (line[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[j] = ' ';\n            line[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << outline << endl;\n    for (i = 0; i < len; i++) {\n      if (line[i] == '(') {\n        cout << '$';\n      } else {\n        if (line[i] == ')') {\n          cout << '?';\n        } else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][102];\n  int i, n = 0, j, k, l;\n  while (cin.getline(str[n++], 102)) {\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    cout << str[i] << endl;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        k = j + 1;\n        while (str[i][k] != '\\0') {\n          if (str[i][k] == ')') {\n            break;\n          }\n          k++;\n        }\n        if (str[i][k] == '\\0') {\n          j++;\n          continue;\n        }\n        l = k - 1;\n        while (true) {\n          if (str[i][l] == '(')\n            break;\n          l--;\n        }\n        str[i][l] = str[i][k] = 'a';\n      }\n      if (str[i][j] != '(')\n        j++;\n    }\n    j = 0;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(')\n        str[i][j] = '$';\n      else if (str[i][j] == ')') {\n        str[i][j] = '?';\n      } else\n        str[i][j] = ' ';\n      j++;\n    }\n    printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31182", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findRight(char s[], int pos, int l) {\n  int t;\n  if (s[pos] == '\\0')\n    return -1;\n  if (s[pos] == '(') {\n    t = findRight(s, pos + 1, l + 1);\n    if (t == -1) {\n      s[pos] = '$';\n      return -1;\n    } else {\n      s[pos] = ' ';\n      return findRight(s, t + 1, l);\n    }\n  } else if (s[pos] == ')') {\n    if (l == 0) {\n      s[pos] = '?';\n      findRight(s, pos + 1, l);\n    } else {\n      s[pos] = ' ';\n      return pos;\n    }\n  } else {\n    s[pos] = ' ';\n    return findRight(s, pos + 1, l);\n  }\n}\nint main() {\n  char s[1000];\n  for (; scanf(\"%s \", s);) {\n    cout << s << '\\n';\n    findRight(s, 0, 0);\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "31183", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, length, k;\n  cin >> n;\n  getchar();\n  int i;\n  char a[500];\n  for (i = 1; i <= n; i++) {\n\n    cin >> a;\n    puts(a);\n    length = strlen(a);\n    int j;\n    for (j = length - 1; j >= 0; j--) {\n      int judge = 0;\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n      else if (a[j] == '(') {\n        for (k = j + 1; k < length; k++) {\n          if (a[k] == ')') {\n            a[k] = ' ';\n            a[j] = ' ';\n            judge = 1;\n            break;\n          }\n        }\n        if (judge == 0)\n          a[j] = '$';\n      }\n    }\n    for (j = 0; j < length; j++) {\n      if (a[j] == ')')\n        a[j] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  while (cin.getline(a, 110, '\\n')) {\n    int left = 0, right = 0, tema = 0;\n    int b[110] = {0};\n    char d[110] = {'\\0'};\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << a[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      d[i - 1] = ' ';\n      if (a[i - 1] == '(') {\n        left++;\n        b[tema++] = i - 1;\n      } else {\n        if (a[i - 1] == ')') {\n          if (left <= right) {\n            d[i - 1] = '?';\n          }\n          if (left > right) {\n            right++;\n            tema--;\n          }\n        }\n      }\n    }\n    for (int k = 1; k <= tema; k++) {\n      d[b[k - 1]] = '$';\n    }\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << d[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; i <= 100; i++) {\n      a[i - 1] == '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[101];\n  char str2[101];\n  int a[101];\n  int l, i, j, temp;\n  while (cin >> str1) \n  {\n    l = strlen(str1); \n    for (i = 0; i < l; i++) {\n      if (str1[i] == '(')\n        a[i] = 1;\n      else if (str1[i] == ')')\n        a[i] = -1;\n      else\n        a[i] = 0;\n    } \n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) \n      {\n        temp = 0;\n        for (j = i; j < l; j++) \n        {\n          temp = temp + a[j];\n          if (temp == 0) {\n            a[i] = 0;\n            a[j] = 0;\n            break; \n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) \n    {\n      if (a[i] == 1)\n        str2[i] = '$';\n      else if (a[i] == -1)\n        str2[i] = '?';\n      else\n        str2[i] = ' ';\n    }\n    str2[l] = '\\0';\n    cout << str1 << endl;\n    cout << str2 << endl;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[100][100] = {'\\0'};\n  int m = 0;\n  int i, j, t;\n  int a = 0, b = 0;\n  int c[100] = {0};\n\n  while (cin >> str[m]) {\n\n    for (j = 0; j < strlen(str[m]); j++) {\n      if (str[m][j] == '(') {\n        if (j == strlen(str[m]) - 1)\n          c[j] = 1;\n        else {\n          for (t = j;; t++) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == strlen(str[m]) - 1 || (a == b && a != 0))\n              break;\n          }\n\n          if (a > b)\n            c[j] = 1;\n          a = b = 0;\n        }\n      } else if (str[m][j] == ')') {\n        if (j == 0)\n          c[j] = 2;\n        else {\n          for (t = j;; t--) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == 0 || (a == b && a != 0))\n              break;\n          }\n\n          if (a < b)\n            c[j] = 2;\n          a = b = 0;\n        }\n      } else\n        continue;\n    }\n\n    cout << str[m] << endl;\n\n    for (j = 0; j <= strlen(str[m]) - 1; j++) {\n      if (c[j] == 0)\n        printf(\" \");\n      else if (c[j] == 1)\n        cout << '$';\n      else if (c[j] == 2)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n\n    a = 0;\n    b = 0;\n    for (j = 0; j < 100; j++)\n      c[j] = 0;\n\n    m++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, u, p;\n  char c;\n  for (;;) {\n    p = 1;\n    char ch[102] = {'0'};\n    i = 2;\n    c = getchar();\n    if (c == -1)\n      break;\n    else\n      ch[1] = c;\n    while ((c = getchar()) != '\\n') {\n      ch[i] = c;\n      i++;\n    }\n    i--;\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n    while (p == 1) {\n      p = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (ch[j] == '(') {\n          for (k = j + 1; k <= i; k++) {\n            u = 1;\n            if (ch[k] == '(') {\n              break;\n            } else {\n              if (ch[k] == ')') {\n                u = 0;\n                break;\n              }\n            }\n          }\n          if (u == 0) {\n            ch[j] = 0;\n            ch[k] = 0;\n            p = 1;\n          }\n        }\n      }\n    }\n    for (j = 1; j <= i; j++) {\n      if (ch[j] == '(') {\n        ch[j] = '$';\n      } else {\n        if (ch[j] == ')') {\n          ch[j] = '?';\n        } else\n          ch[j] = ' ';\n      }\n    }\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n = 0, k, p, count1 = 0, count2 = 0;\n  char a[100][1000], b[1000][1000];\n  for (i = 0; i < 100; i++) {\n    for (k = 0; k < 100; k++) {\n      b[i][k] = ' ';\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    if (a[i][0] == '\\0')\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", a[i]);\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == ')') {\n        for (p = k - 1; p >= 0; p--) {\n          if (a[i][p] == '(') {\n            a[i][p] = '.';\n            a[i][k] = '.';\n            break;\n          } else if (a[i][p] == ')') {\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == '(')\n        b[i][k] = '$';\n      else if (a[i][k] == ')')\n        b[i][k] = '?';\n    }\n    b[i][strlen(a[i])] = '\\0';\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[120];\n  char s[120], s1[120];\n  int i, j, l;\n  while (1) {\n\n    scanf(\"%s \", s);\n    if (strcmp(s, s1) == 0)\n      break;\n    strcpy(s1, s);\n    memset(a, 0, sizeof(a));\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[i] = 1;\n      if (s[i] == ')')\n        a[i] = -1;\n    }\n\n    for (i = 0; i < l; i++) {\n      if ((s[i] == '(') && (a[i] != 0)) {\n        j = i + 1;\n        while ((a[j] == 0) && (j < l))\n          j++;\n        if ((s[j] == ')') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n      if ((s[i] == ')') && (a[i] != 0)) {\n        j = i - 1;\n        while ((a[j] == 0) && (j > 0))\n          j--;\n        if ((s[j] == '(') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n    }\n    cout << s << \" \";\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1)\n        printf(\"$\");\n      else if (a[i] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, m = 0, n = 0, k = 0;\n  char s[105];\n  while (cin.getline(s, 105, '\\n')) {\n    int zuo[100], you[100], flag[105] = {0};\n    char a[105];\n    for (i = 0; s[i] != '\\0'; i++) {\n      a[i] = ' ';\n    }\n    a[i] = '\\0';\n    m = 0;\n    n = 0;\n    for (j = 0; j < i; j++) {\n      if (s[j] == '(')\n        zuo[m++] = j;\n      if (s[j] == ')')\n        you[n++] = j;\n    }\n    for (j = 0; j < n; j++) {\n      for (k = you[j] - 1; k >= 0; k--) {\n        if (s[k] == '(' && flag[k] == 0) {\n          flag[k] = 1;\n          flag[you[j]] = 1;\n          break;\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (flag[k] == 0 && s[k] == '(')\n        a[k] = '$';\n      if (flag[k] == 0 && s[k] == ')')\n        a[k] = '?';\n    }\n    cout << s << endl;\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char s[1000];\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    k = strlen(s);\n    for (i = 0; i < k; ++i) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (s[j] == '(') {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < k; ++i) {\n      if (s[i] == '(')\n        cout << \"$\";\n      else if (s[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      b[j] = ' ';\n    b[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0) {\n          b[j] = '?';\n        } else {\n          t--;\n          b[c[t]] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++) {\n      cout << b[h];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char *s) {\n  int a[100], i, j = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      a[j] = i; \n      j++;\n    } else if (s[i] == ')') {\n      if (j > 0) \n      {\n        s[i] = ' ';\n        s[a[j - 1]] = ' '; \n        j--;               \n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\n\nint main() {\n  int n, i;\n  char s[101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    match(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    char s[104], start = 0;\n    int len = 0;\n\n    cin >> s;\n    puts(s);\n    len = strlen(s);\n    int j;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        for (j = i; j < len; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n    n--;\n  }\n}\n"}
{"label": "17", "index": "31195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[205];\n  while (cin.getline(a, 200)) {\n    char b[205];\n    int x[205] = {-1}, y[205] = {-1}, i, j, k, n, p, q;\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        p++;\n        x[p] = i;\n      }\n      if (a[i] == ')') {\n        q++;\n        y[q] = i;\n        if ((p != 0) && (x[p] < y[q])) {\n          x[p] = -1;\n          y[q] = -1;\n          p--;\n          q--;\n        }\n      }\n    }\n    for (i = 1; i <= p; i++)\n      b[x[i]] = '$';\n    for (i = 1; i <= q; i++)\n      b[y[i]] = '?';\n    cout << a << endl;\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31196", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], t[1000];\n  int len;\n  int n;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%s\", s);\n    len = strlen(s);\n    memset(t, ' ', len);\n    t[len] = 0;\n\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(' || s[i] == '[' || s[i] == '{') {\n        t[i] = '$';\n      }\n      char match = ' ';\n      if (s[i] == ')') {\n        match = '(';\n      } else if (s[i] == ']') {\n        match = '[';\n      } else if (s[i] == '}') {\n        match = '{';\n      }\n      if (match != ' ') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (t[j] == '$') {\n            if (s[j] == match) {\n              t[j] = ' ';\n              match = ' ';\n            }\n            break;\n          }\n        }\n        if (match != ' ') {\n          t[i] = '?';\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", s, t);\n  }\n}\n"}
{"label": "17", "index": "31197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str1[101], str2[101];\n  int i, figure = 0, temp[100];\n  while (scanf(\"%s \", str1)) {\n    memset(str2, ' ', sizeof(str2));\n    for (i = 0; i < strlen(str1); i++) {\n      if (str1[i] == '(') {\n        str2[i] = '$';\n        temp[figure++] = i;\n      }\n      if (str1[i] == ')') {\n        if (figure > 0) {\n          str2[temp[figure - 1]] = ' ';\n          figure--;\n        } else {\n          str2[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < strlen(str1) - 1; i++)\n      cout << str1[i];\n    cout << str1[strlen(str1) - 1] << \"\\n\";\n    for (i = 0; i < strlen(str1) - 1; i++)\n      cout << str2[i];\n    cout << str2[strlen(str1) - 1] << endl;\n    figure = 0;\n    memset(str1, ' ', sizeof(str1));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, p;\n  char str[10001], a[2000], b[2000], c[2000];\n  while (scanf(\"%s \", str)) {\n    n = strlen(str);\n    strcpy(a, str);\n    for (i = 0; i < n; i++)\n      c[i] = ' ';\n    for (i = 0; i < n; i++)\n      if (a[i] == ')') {\n        p = 0;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '?';\n      }\n    for (i = n - 1; i >= 0; i--)\n      if (a[i] == '(') {\n        p = 0;\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '$';\n      }\n    puts(str);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", c[i]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31199", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++)\n      if (s[i] == '(') {\n        h = i;\n        for (j = i + 1; j < len; j++)\n          if (s[j] == '(')\n            i = j;\n          else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        if (j == len)\n          break;\n        if (h == i)\n          continue;\n        else\n          i = h - 1;\n      }\n    for (q = 0; q < len; q++)\n      if (s[q] == ')')\n        s[q] = '?';\n      else {\n        if (s[q] == '(')\n          s[q] = '$';\n        else\n          s[q] = ' ';\n      }\n    printf(\"%s \", ss);\n    cout << s << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar st[100];\nchar st2[100];\nint main() {\n  memset(st, 0, 100);\n  memset(st2, 0, 100);\n  while (cin >> st) {\n    int left = 0, right = 0;\n    int len = strlen(st);\n    for (int i = 0; i < len; i++) {\n      if (st[i] == '(')\n        left++;\n      if (st[i] == ')')\n        right++;\n      if (left < right) {\n        st2[i] = '?';\n        right--;\n      }\n    }\n    left = 0;\n    right = 0;\n    for (int j = len - 1; j >= 0; j--) {\n      if (st[j] == '(')\n        left++;\n      if (st[j] == ')')\n        right++;\n      if (left > right) {\n        st2[j] = '$';\n        left--;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (st2[i] != '$' && st2[i] != '?')\n        st2[i] = ' ';\n    }\n    cout << st << endl;\n    cout << st2 << endl;\n    memset(st, 0, 100);\n    memset(st2, 0, 100);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31201", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[1000];\n  int i = 0, j = 0, length = 0, t1 = 0, t2 = 0;\n  int flag = 0, left = 0, right = 0;\n  while (cin >> string) {\n    cout << string << endl;\n    length = strlen(string);\n    flag = 1, left = 0, right = 0; \n    t1 = 0, t2 = 0;                \n    while (flag == 1) {\n      for (i = 0; i < length; i++) {\n        if (string[i] == '(') {\n          left = i;\n          t1 = 1;\n        }\n        \n        else if (t1 == 1 && string[i] == ')') {\n          right = i;\n          t2 = 1;\n          break;\n        }\n        \n        else\n          continue;\n      }\n\n      if (t1 == 1 && t2 == 1)\n      \n      {\n        string[left] = '0';\n        string[right] = '0';\n        t1 = 0;\n        t2 = 0;\n        flag = 1;\n      } else \n        flag = 0;\n      \n    }\n\n    for (i = 0; i < length; i++) \n    {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else\n        string[i] = ' ';\n    }\n\n    for (i = 0; i < length; i++) {\n      cout << string[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0};\n  int lef[101], r[101], i = 0, j = 0;\n  do {\n    cin.get(a, 101);\n    cin.get();\n    if (a[0] == '\\0')\n      break;\n    int len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = 0; i < len; i++)\n      if (b[i] == '?')\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "17", "index": "31203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p[109];\n  char s[110], t[110];\n  while (scanf(\"%s\", s) != EOF) {\n    for (i = 0; i < 109; i++)\n      p[i] = 0;\n    strcpy(t, s);\n    for (i = 0, j = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        p[j++] = i;\n      if (s[i] == ')' && j > 0)\n        s[p[j-- - 1]] = s[i] = ' ';\n      if (s[i] != '(' && s[i] != ')')\n        s[i] = ' ';\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')') {\n        s[i] = '?';\n      }\n    }\n    cout << t << \"\\n\" << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct m {\n  char a;\n  int n;\n} q[100];\nint main() {\n  char b[101] = {0};\n  int i, j, k, t, l;\n  while (cin >> b) {\n    cout << b << endl;\n    char c[101] = {0};\n    t = 0;\n    k = strlen(b);\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (b[i] == '(' || b[i] == ')') {\n        q[j].a = b[i];\n        q[j++].n = i;\n      }\n    i = 0;\n    while (i < j - t - 1) {\n      if (q[i].a == '(' && q[i + 1].a == ')') {\n        for (l = i; l < j - t - 2; l++) {\n          q[l] = q[l + 2];\n        }\n        t = t + 2;\n        if (i != 0)\n          i = i - 1;\n      } else\n        i++;\n    }\n\n    for (i = 0; i < k; i++) {\n      c[i] = ' ';\n      b[i] = 0;\n    }\n    for (i = 0; i < j - t; i++) {\n      if (q[i].a == '(')\n        c[q[i].n] = '$';\n      else\n        c[q[i].n] = '?';\n    }\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, flag, len, k, x;\n  int a[100], b[100];\n  char str[101], s[101];\n  while (cin >> str) {\n    for (i = 0; i < 100; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    m = 0;\n    for (i = 0; str[i] != '\u0000'; i++) {\n      if (str[i] == ')') {\n        j = i;\n        x = 1;\n        while (j >= 0) {\n          if (str[j] == '(') {\n            for (k = 0; k < m; k++) {\n              if (a[k] == j)\n                x = 0;\n            }\n            if (x != 0) {\n\n              a[m] = j;\n              b[m] = i;\n              m++;\n              break;\n            }\n          }\n          j--;\n          x = 1;\n        }\n      }\n    }\n\n    strcpy(s, str);\n    flag = 1;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        for (j = 0; j < m; j++) {\n          if (i == a[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '$';\n      } else if (s[i] == ')') {\n        for (j = 0; j < m; j++) {\n          if (i == b[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n      flag = 1;\n    }\n    len = strlen(s);\n    for (j = len; j >= 0; j--) {\n      if ((s[j] == ' ') || (s[j] == '\u0000')) {\n        if (s[j - 1] != ' ') {\n          s[j] = '\u0000';\n          break;\n        }\n      }\n    }\n    printf(\"%s \", str);\n    j = 0;\n    while (s[j] == ' ')\n      j++;\n    for (i = j; s[i] != '\u0000'; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[200];\n  while (scanf(\"%s\", str) != EOF) {\n    int n, i, k;\n    printf(\"%s \", str);\n    n = strlen(str);\n    for (i = 0, k = 0; i < n; i++) {\n      if (str[i] == '(') {\n        k = i;\n      }\n      if (str[i] == ')' && str[k] == '(') {\n        str[i] = ' ';\n        str[k] = ' ';\n        i = -1;\n        k = 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n      else {\n        if (str[i] == '(')\n          printf(\"$\");\n        else {\n          printf(\"?\");\n        }\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int temp;\n  while (cin.getline(str, 101, '\\n')) {\n    cout << str << endl;\n    int k, i, s = 0, t = 0;\n    char result[101];\n    int left[101];\n    memset(result, ' ', sizeof(result));\n    k = strlen(str);\n    int p = 0;\n    for (i = 0; i < k; i++) {\n      if (str[i] == '(') {\n        p++;\n        left[s] = i;\n        temp = s;\n        s++;\n      }\n      if ((str[i] == ')') && (p == 0))\n        result[i] = '?';\n      if ((str[i] == ')') && (p != 0)) {\n        p--;\n        left[temp] = -1;\n        do\n          temp--;\n        while (left[temp] == -1);\n      }\n    }\n    for (i = 0; i < s; i++) {\n      if (left[i] == -1)\n        continue;\n      else\n        result[left[i]] = '$';\n    }\n    for (i = 0; i < k; i++)\n      cout << result[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, p, q;\n  for (i = 0; i < n; i++) {\n    char a[101], b[101];\n    scanf(\"%s\", &a);\n    num = strlen(a);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else {\n        b[j] = ' ';\n      }\n    }\n\n    for (p = num - 1; p >= 0; p--) {\n      if (b[p] == '$') {\n        for (q = p; q < num; q++) {\n          if (b[q] == '?') {\n            b[q] = ' ';\n            b[p] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < num; j++) {\n\n      printf(\"%c\", a[j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < num; j++) {\n\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n    p = 0;\n    q = 0;\n  }\n}\n"}
{"label": "17", "index": "31209", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint len;\nchar st[101], ans[101];\n\nint work(int pos) {\n  for (int i = pos + 1; i < len; i++)\n    if (st[i] == '(')\n      i = work(i);\n    else if (st[i] == ')') {\n      ans[pos] = '(';\n      ans[i] = ')';\n      return i;\n    }\n  return len - 1;\n}\n\nint main() {\n  int i;\n  while (scanf(\"%s \", st)) {\n    cout << st << endl;\n    len = strlen(st);\n    memset(ans, 0, sizeof(ans));\n    for (i = 0; i < len; i++)\n      if (st[i] == '(')\n        i = work(i);\n    for (i = 0; i < len; i++)\n      switch (st[i]) {\n      case '(':\n        ans[i] = (ans[i] == '(') ? ' ' : '$';\n        break;\n      case ')':\n        ans[i] = (ans[i] == ')') ? ' ' : '?';\n        break;\n      default:\n        ans[i] = ' ';\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0;\n  char a[105], b[105];\n  while (scanf(\"%s \", a)) {\n    l = 0;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && l == 0) {\n        b[i] = '?';\n        continue;\n      }\n      if (a[i] == '(') {\n        b[i] = '$';\n        l++;\n      }\n      if (a[i] == ')' && l > 0) {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[j] = ' ';\n            l--;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < strlen(a); i++)\n      cout << b[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, len, e;\n  char s[102];\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", &s);\n    len = strlen(s);\n    cout << s << \"\\n\";\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (e = i + 1; e < len; e++) {\n          if (s[e] == ')') {\n            s[i] = ' ';\n            s[e] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31212", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nchar m[1000];\nint match(int l) {\n\n  int r = l;\n  while (s[++r] != ')') {\n    if (s[r] == '(')\n      r = match(r);\n    if (s[r] == '\\0')\n      break;\n  }\n  if (s[r] == '\\0')\n    m[l] = '$';\n  return r;\n}\nint nextL(int i) {\n  while (s[i] != '\\0' && s[i] != '(') {\n    if (s[i] == ')')\n      m[i] = '?';\n    i++;\n  }\n  return i;\n}\nint main() {\n  int i;\n  while (cin >> s) {\n    for (i = 0; i < strlen(s); ++i)\n      m[i] = ' ';\n    m[i] = '\\0';\n    i = 0;\n    i = nextL(i);\n    while (s[i] != '\\0') {\n      i = match(i);\n      if (s[i] == '\\0')\n        break;\n      else\n        i++;\n      i = nextL(i);\n    }\n    cout << s << \"\\n\" << m << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char kuohaoin[201] = {0}, kuohao1[201] = {0}, kuohaoout[201] = {0};\n  int i, j, len;\n  while (cin >> kuohaoin) {\n    len = strlen(kuohaoin);\n    for (i = 0; i < len; i++) {\n      kuohao1[i] = kuohaoin[i];\n      kuohaoout[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (kuohao1[i] == '(') {\n        kuohaoout[i] = '$';\n        for (j = i + 1; j < len; j++) {\n          if (kuohao1[j] == ')') {\n            kuohao1[j] = 's';\n            kuohaoout[i] = ' ';\n            kuohao1[i] = 's';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      if (kuohao1[i] == ')')\n        kuohaoout[i] = '?';\n    cout << kuohaoin << endl;\n    printf(\"%s\\n\", kuohaoout);\n    for (i = 0; i < len; i++) {\n      kuohaoin[i] = 0;\n      kuohao1[i] = 0;\n      kuohaoout[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char chuan[101], shuchu[100];\n  int count1, count2, length, i;\n  while (cin >> chuan) {\n    cout << chuan << endl;\n    length = strlen(chuan);\n    strcpy(shuchu, chuan);\n    count1 = 0;\n    count2 = 0;\n    for (i = 0; i < length; i++) {\n      if (chuan[i] == '(')\n        count1++;\n      if (chuan[i] == ')') {\n        count2++;\n        if (count2 > count1) {\n          shuchu[i] = '?';\n          count2--;\n        }\n      }\n    }\n\n    count1 = 0;\n    count2 = 0;\n    for (i = length - 1; i >= 0; i--) {\n      if (chuan[i] == ')')\n        count2++;\n      if (chuan[i] == '(') {\n        count1++;\n        if (count1 > count2) {\n          shuchu[i] = '$';\n          count1--;\n        }\n      }\n    }\n    shuchu[length] = '\\0';\n    for (i = 0; i < length; i++) {\n      if (shuchu[i] != '?' && shuchu[i] != '$')\n        shuchu[i] = ' ';\n    }\n    cout << shuchu << endl;\n    memset(shuchu, 0, sizeof(shuchu));\n    memset(chuan, 0, sizeof(chuan));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31215", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  int left = 0, right = 0;\n  int e[101] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    left = 0;\n    right = 0;\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      e[j] = 0;\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  char a[100][120];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    puts(a[i]);\n    k = strlen(a[i]);\n    for (j = 0; j < k; j++) {\n\n      if (a[i][j] == ')') {\n        a[i][j] = '?';\n      }\n      if (a[i][j] == '(') {\n        a[i][j] = '$';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] != '?' && a[i][j] != '$') {\n        a[i][j] = ' ';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == '?') {\n        for (l = j; l >= 0; l--) {\n          if (a[i][l] == '$') {\n            a[i][j] = ' ';\n            a[i][l] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, n, p, q;\n  while (cin.getline(a, 101)) {\n    int b[101] = {0};\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] == ')') {\n        q++;\n\n        if (q > p)\n\n        {\n\n          b[i] = 1;\n          q = q - 1;\n        }\n      }\n      if (a[i] == '(') {\n        p++;\n      }\n    }\n    p = 0;\n    q = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        q++;\n      }\n      if (a[i] == '(') {\n        p++;\n\n        if (p > q)\n\n        {\n\n          b[i] = 2;\n          p = p - 1;\n        }\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      cout << a[i];\n    }\n    cout << endl;\n    for (i = 0; i <= n - 1; i++) {\n      if (b[i] == 0) {\n        cout << \" \";\n      }\n      if (b[i] == 1) {\n        cout << \"?\";\n      }\n      if (b[i] == 2) {\n        cout << \"$\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar c[101], a[101] = {' '};\nint leftpos[101] = {0}, leftnum = 0;\n\nvoid function_1(int pos) {\n  if (pos == strlen(c)) {\n    a[pos] = '\u0000';\n    cout << c << endl;\n    printf(\"%s\\n\", a);\n    return;\n  }\n  if (c[pos] == '(') {\n    leftpos[leftnum] = pos;\n    a[pos] = '$';\n    leftnum += 1;\n    function_1(pos + 1);\n  } else {\n    if (c[pos] == ')') {\n      if (leftnum == 0) {\n        a[pos] = '?';\n        function_1(pos + 1);\n      } else {\n        a[pos] = ' ';\n        leftnum -= 1;\n        a[leftpos[leftnum]] = ' ';\n        function_1(pos + 1);\n      }\n    } else {\n      a[pos] = ' ';\n      function_1(pos + 1);\n    }\n  }\n}\n\nint main() {\n  for (; cin.getline(c, 101);) {\n    function_1(0);\n    leftnum = 0;\n    for (int i = 0; i < 101; i++)\n      leftpos[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31219", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, len;\n  char a[101];\n\n  while (cin >> a) {\n    int b[100] = {0};\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        char *p = &a[i - 1];\n        for (j = i - 1; j >= 0; j--) {\n          if (*p == '(' && b[j] == 0) {\n            b[j] = 1;\n            b[i] = 1;\n            break;\n          }\n          p--;\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' && b[i] == 0)\n        cout << \"$\";\n      else {\n        if (a[i] == ')' && b[i] == 0)\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31220", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101] = {0};\n  while (scanf(\"%s\", s) != EOF) {\n    int i, j, l, t1, t2;\n    printf(\"%s\\n\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(') {\n        t1 = 1;\n        t2 = 0;\n        for (j = i + 1; j < l; j++) {\n          if (s[j] == '(')\n            t1++;\n          if (s[j] == ')')\n            t2++;\n          if (t1 == t2) {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "31221", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j, a[101], len, count;\n  while (cin.getline(str, 101)) {\n    count = 0;\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == ')') {\n        count++;\n        a[count] = i;\n      }\n    }\n    for (i = 1; i <= count; i++) {\n      for (j = a[i] - 1; j >= 0; j--) {\n        if (a[i] == 0) {\n          str[a[i]] = '?';\n        }\n        if (str[j] == '(') {\n          str[j] = ' ';\n          str[a[i]] = ' ';\n          break;\n        }\n      }\n      if (str[a[i]] != ' ') {\n        str[a[i]] = '?';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if ((str[i] != ' ') && (str[i] != '?') && (str[i] != '$')) {\n        str[i] = ' ';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31222", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, l, j = 0;\n  char a[150], b[150];\n  while (cin.getline(b, 150)) {\n    l = strlen(b);\n    for (i = 0; i < l; i++) {\n      cout << b[i];\n      if (b[i] == '(')\n        a[i] = b[i]; \n      else if (b[i] == ')')\n        a[i] = b[i];\n      else\n        a[i] = ' ';\n    }\n    cout << endl;\n    if (a[l - 1] == '(')\n      a[l - 1] = '$';\n    for (i = l - 1; i >= 0; i--) \n    {\n      if (a[i] == '(') \n      {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          a[i] = '$'; \n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == ')')\n        a[i] = '?'; \n    }\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31223", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int l = 0, c[100] = {0}, m;\n\n    cin >> a;\n    if (a[0] == 0)\n      break;\n    for (int i = 0; i < 101; i++) {\n      if (a[i] != 0) {\n        if (a[i] == '(') {\n          int p = 0;\n          c[i] = -1;\n          b[i] = '$';\n        } else if (a[i] == ')') {\n          int k = 0;\n          c[i] = 1;\n          b[i] = '?';\n        } else\n          b[i] = ' ';\n      } else {\n        l = i;\n        break;\n      }\n    }\n\n    cout << endl;\n    for (int i = 0; i < l; i++)\n      if (c[i] == -1)\n        for (int j = i, sum = 0; j < l; j++) {\n          sum = sum + c[j];\n\n          if (sum == 0) {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int length, i, j;\n  while (cin.getline(line, 101)) {\n    length = strlen(line);\n    for (i = 0; i < length; i++)\n      cout << line[i];\n    cout << endl;\n    for (i = 0; i < length; i++) {\n      if (line[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[i] = 0;\n            line[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (line[i] == '(') {\n        cout << \"$\";\n      }\n      if (line[i] != '(' && line[i] != ')')\n        cout << \" \";\n      if (line[i] == ')')\n        cout << \"?\";\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    int a[1000];\n    char s[1000];\n    scanf(\"%s\", s);\n    int l = strlen(s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < l; j++)\n      a[j] = 0;\n    for (j = l - 1; j >= 0; j--) {\n      int t;\n      if (s[j] == '(') {\n        int f = 0;\n        for (t = j + 1; t < l; t++) {\n          if (s[t] == ')' && a[t] == 0) {\n            f = 1;\n            a[t] = 1;\n            a[j] = 1;\n            break;\n          }\n        }\n        if (f == 0) {\n          s[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] == ')' && a[j] == 0) {\n        s[j] = '?';\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] != '?' && s[j] != '$')\n        s[j] = ' ';\n    }\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "31226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n\n    len = strlen(line);\n\n    for (i = 0; i < 100; i++) {\n      label[i] = ' ';\n    }\n\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(')\n\n      {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n\n    i = len - 1;\n\n    label[i + 1] = '\\0';\n\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31227", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint left(int x, char s[], int n);\nint main() {\n  int l;\n  char c[101] = {0};\n\n  scanf(\"%s \", c);\n  puts(c);\n  l = left(0, c, 0);\n  printf(\"%s\", c);\n  while ((scanf(\"%s\", c) != EOF)) {\n    printf(\" \");\n    puts(c);\n    l = left(0, c, 0);\n    printf(\"%s\", c);\n  }\n  return 0;\n}\nint left(int x, char s[], int n) {\n  int a;\n  if (s[n] != '\u0000') {\n    if (s[n] == '(') {\n      a = left(x + 1, s, n + 1);\n      if (a > 0) {\n        s[n] = ' ';\n        return (a - 1);\n      } else {\n        s[n] = '$';\n        return 0;\n      }\n    } else if (s[n] == ')') {\n      if (x > 0) {\n        s[n] = ' ';\n        return (left(x - 1, s, n + 1) + 1);\n      } else {\n        s[n] = '?';\n        return (left(0, s, n + 1) + 1);\n      }\n    } else {\n      s[n] = ' ';\n      return left(x, s, n + 1);\n    }\n  } else\n    return 0;\n}\n"}
{"label": "17", "index": "31228", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid match(char *s) {\n  int a[100], i, j = 0;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      a[j] = i;\n      j++;\n    } else if (s[i] == ')') {\n      if (j > 0) {\n        s[i] = ' ';\n        s[a[j - 1]] = ' ';\n        j--;\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\n\nint main() {\n  int n, i;\n  char s[101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    match(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int t;\n  scanf(\"%d\", &n);\n  scanf(\"\\n\");\n  char c[101] = {0};\n  char d[101] = {0};\n  int j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++) {\n      c[j] = 0;\n      d[j] = 0;\n    }\n\n    scanf(\"%s\", c);\n    t = strlen(c);\n    for (j = 0; j < t; j++) {\n      d[j] = c[j];\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[k] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n\n    printf(\"%s\", d);\n    printf(\"\\n\");\n    printf(\"%s\", c);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint find(char s[], int pos) {\n  int i, p = 0, q = 0;\n  if (pos < 0)\n    return 0;\n  if (s[pos] == ')')\n    for (i = pos - 1; i >= 0; i--) {\n      if (s[i] == '(')\n        p++;\n      if (s[i] == ')')\n        q++;\n      if ((s[i] == '(') && (p - q == 1)) {\n        s[i] = ' ';\n        s[pos] = ' ';\n        break;\n      }\n    }\n  find(s, pos - 1);\n  return 0;\n}\nint main() {\n  char s[101], ss[101], ans[101];\n  int i, n;\n  while (true) {\n    scanf(\"%s \", s);\n    if (!cin)\n      break;\n    strcpy(ss, s);\n    memset(ans, ' ', sizeof(ans));\n    n = strlen(s) - 1;\n    find(s, n);\n    for (i = 0; i <= n; i++) {\n      if (s[i] == '(')\n        ans[i] = '$';\n      if (s[i] == ')')\n        ans[i] = '?';\n    }\n    ans[n + 1] = '\\0';\n    printf(\"%s\\n\", ss);\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar c[110];\nint Try() {\n  int i, j;\n  int L = -1, R = -1;\n  for (i = 0; i <= strlen(c) - 1; ++i) {\n    if (c[i] == '(')\n      L = i;\n  }\n  for (j = strlen(c) - 1; j > L; --j) {\n    if (c[j] == ')')\n      R = j;\n  }\n  if (L != -1 || R != -1) {\n    if (L == -1) {\n      c[R] = '?';\n    }\n\n    else if (R == -1) {\n      c[L] = '$';\n    } else if (L < R) {\n      c[L] = ' ';\n      c[R] = ' ';\n    } else if (L > R) {\n      c[L] = '$';\n      c[R] = '?';\n    }\n    Try();\n  }\n  if (L == -1 && R == -1)\n    return 1;\n}\nint main() {\n  int k;\n  while (cin >> c) {\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    printf(\"\\n\");\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      if (c[k] != '(' && c[k] != ')')\n        c[k] = ' ';\n    }\n    Try();\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100];\n  int i, k, s;\n  for (; scanf(\"%s\", a) != EOF;) {\n    s = 0;\n    s = strlen(a);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = s - 1; i >= 0; i--) {\n      if (a[i] == '$') {\n        for (k = i; k < s; k++) {\n          if (a[k] == '?') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint left(int x, char s[], int n);\nint main() {\n  int l;\n  char c[101] = {0};\n\n  scanf(\"%s \", c);\n  puts(c);\n  l = left(0, c, 0);\n  printf(\"%s\", c);\n  while ((scanf(\"%s\", c) != EOF)) {\n    cout << \" \";\n    puts(c);\n    l = left(0, c, 0);\n    cout << c;\n  }\n  return 0;\n}\nint left(int x, char s[], int n) {\n  int a;\n  if (s[n] != '\u0000') {\n    if (s[n] == '(') {\n      a = left(x + 1, s, n + 1);\n      if (a > 0) {\n        s[n] = ' ';\n        return (a - 1);\n      } else {\n        s[n] = '$';\n        return 0;\n      }\n    } else if (s[n] == ')') {\n      if (x > 0) {\n        s[n] = ' ';\n        return (left(x - 1, s, n + 1) + 1);\n      } else {\n        s[n] = '?';\n        return (left(0, s, n + 1) + 1);\n      }\n    } else {\n      s[n] = ' ';\n      return left(x, s, n + 1);\n    }\n  } else\n    return 0;\n}\n"}
{"label": "17", "index": "31234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, r, fl, lenth;\n  int i, j, k;\n  char str[100 + 10];\n  int left[101], right[101];\n  int flag[100 + 10];\n\n  while (cin.getline(str, 101)) {\n    l = 1;\n    r = 1;\n    for (lenth = 0; str[lenth] != '\\0'; lenth++) {\n      if (str[lenth] == '(') {\n        flag[lenth] = 1;\n        left[l++] = lenth;\n      } else if (str[lenth] == ')') {\n        flag[lenth] = 2;\n        right[r++] = lenth;\n      } else\n        flag[lenth] = 0;\n    }\n\n    fl = lenth - 1;\n\n    for (j = l - 1; j >= 1; j--)\n      for (k = 1; k <= r - 1; k++) {\n        if (right[k] > left[j]) {\n          flag[right[k]] = 0;\n          flag[left[j]] = 0;\n          right[k] = -1;\n          break;\n        }\n      }\n\n    for (lenth = 0; str[lenth] != '\\0'; lenth++)\n      printf(\"%c\", str[lenth]);\n\n    printf(\"\\n\");\n\n    for (lenth = 0; lenth <= fl; lenth++) {\n      if (flag[lenth] == 0)\n        printf(\" \");\n      else {\n        if (flag[lenth] == 1)\n          printf(\"$\");\n        else if (flag[lenth] == 2)\n          printf(\"?\");\n      }\n    }\n\n    printf(\"\\n\");\n    memset(str, 0, sizeof(str));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31235", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31236", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, tmp1, tmp2 = 1;\n  do {\n    char s[101];\n    char st[101];\n    char r1[101];\n    int r2[101];\n    int d, f = 0, pi = 0;\n    if (scanf(\"%s\", s) != EOF) {\n      f = 1;\n      d = strlen(s);\n      strcpy(st, s);\n      for (j = 0; j < d; j++) {\n        if (pi == 0 && (s[j] == '(' || s[j] == ')')) {\n          r1[0] = s[j];\n          r2[0] = j;\n          pi += 1;\n        } else if ((s[j] == '(' || s[j] == ')')) {\n          if (r1[pi - 1] == '(' && s[j] == ')') {\n            s[r2[pi - 1]] = ' ';\n            s[j] = ' ';\n            pi -= 1;\n          } else {\n            r1[pi] = s[j];\n            r2[pi] = j;\n            pi += 1;\n          }\n        } else\n          s[j] = ' ';\n      }\n      for (j = 0; j < pi; j++) {\n        if (r1[j] == '(')\n          s[r2[j]] = '$';\n        else\n          s[r2[j]] = '?';\n      }\n      printf(\"%s\\n%s\\n\", st, s);\n    } else\n      break;\n  } while (tmp2);\n\n  return 0;\n}\n"}
{"label": "17", "index": "31237", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid braket_match(char *s);\nint main() {\n  int n, i;\n  char tmp[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    scanf(\"%s \", tmp);\n    braket_match(tmp);\n  }\n  return 0;\n}\nvoid braket_match(char *s) {\n  printf(\"%s \", s);\n  int j, left[1000] = {-1, -1}, left_num = 0, left0 = 1, right[1000] = {-1, -1},\n         right_num = 0, right0 = 1, LEN = strlen(s);\n  for (j = 0; j < LEN; j++) {\n    if (s[j] == '(')\n      left[++left_num] = j;\n    else if (s[j] == ')' && left_num == 0)\n      right[++right_num] = j;\n    else if (s[j] == ')' && left_num > 0)\n      left[left_num--] = -1;\n  }\n  for (j = 0; j < LEN; j++) {\n    if (j == left[left0]) {\n      printf(\"$\");\n      left0++;\n    } else if (j == right[right0]) {\n      printf(\"?\");\n      right0++;\n    } else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int i, l, n, x, j;\n  int le[101] = {0}, ri[101] = {0};\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < 100; i++) {\n      le[i] = 0;\n      ri[i] = 0;\n    }\n    scanf(\"%s\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        le[i] = 1;\n      if (s[i] == ')')\n        ri[i] = 1;\n    }\n    for (i = l - 1; i >= 0; i--) {\n      if (le[i] == 1) {\n        for (j = i; j < l; j++) {\n          if (ri[j] == 1) {\n            ri[j] = 0;\n            le[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < l; i++) {\n      if (ri[i] == 1) {\n        printf(\"?\");\n      }\n      if (le[i] == 1)\n        printf(\"$\");\n      if (ri[i] == 0 && le[i] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31239", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    printf(\"%s \", a);\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        printf(\"$\");\n        continue;\n      }\n      if (a[i] == ')') {\n        printf(\"?\");\n        continue;\n      }\n      printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31240", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char a[1000];\n    cin >> a;\n    cout << a << '\\n';\n    int len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      int l = -1, r = -1;\n\n      for (int j = i; j >= 0; j--) {\n        if (a[j] == ')' && j != i)\n          break;\n        else if (a[j] == '(') {\n          l = j;\n          break;\n        }\n      }\n      for (int j = i; j < len; j++) {\n        if (a[j] == '(' && j != i)\n          break;\n        else if (a[j] == ')') {\n          r = j;\n          break;\n        }\n      }\n      if (r != -1 && l != -1) {\n        a[r] = '0';\n        a[l] = '0';\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ch[200], temp[200];\n  int n, i, figure, tempnum[200];\n  scanf(\"%d \", &n);\n  while (cin >> ch) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        tempnum[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure > 0) {\n          figure--;\n          temp[tempnum[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    cout << ch << \" \" << temp << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31242", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101] = {0};\n  int pro[101] = {0}, j = 0, p = 0, q = 0;\n  while (cin >> str) {\n    for (int i = 1; i <= strlen(str); i++) {\n      if (str[i - 1] != '(' && str[i - 1] != ')') {\n        pro[i - 1] = 2;\n      }\n      if (str[i - 1] == ')') {\n        pro[i - 1] = 1;\n        for (j = i - 1; j >= 1; j--) {\n          if (str[j - 1] == '(' && pro[j - 1] == 0) {\n            pro[j - 1] = 1;\n            break;\n          }\n        }\n        if (j == 0) {\n          pro[i - 1] = 0;\n        }\n      }\n    }\n    cout << str << endl;\n    for (p = strlen(str); p >= 1; p--) {\n      if (pro[p - 1] == 0) {\n        break;\n      }\n    }\n    for (q = 1; q <= strlen(str); q++) {\n      if (pro[q - 1] == 0) {\n        break;\n      }\n    }\n    for (int k = q; k <= p; k++) {\n      if (str[k - 1] == '(' && pro[k - 1] == 0) {\n        printf(\"$\");\n      } else if (str[k - 1] == ')' && pro[k - 1] == 0) {\n        printf(\"?\");\n      } else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n    for (int clear = 1; clear <= 101; clear++) {\n      str[clear - 1] = 0;\n      pro[clear - 1] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint process(void);\nint main(void) {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    process();\n  return 0;\n}\n\nint process(void) {\n  char str[105], tstr[105] = {0};\n  cin >> str;\n  int len = strlen(str);\n  int count = 0;\n  for (int i = 0; i < len; i++) {\n    if (str[i] == '(')\n      count++;\n    else if (str[i] == ')') {\n      if (count > 0)\n        count--;\n      else\n        tstr[i] = '?';\n    }\n  }\n  count = 0;\n  for (int i = len - 1; i >= 0; i--) {\n    if (str[i] == ')')\n      count++;\n    else if (str[i] == '(') {\n      if (count > 0)\n        count--;\n      else\n        tstr[i] = '$';\n    }\n  }\n  cout << str;\n  printf(\"\\n\");\n  for (int i = 0; i < len; i++) {\n    if (tstr[i])\n      cout << tstr[i];\n    else\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "17", "index": "31244", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nstruct m {\n  char a;\n  int n;\n} q[100];\nint main() {\n  char b[101] = {0};\n  int i, j, k, t, l;\n  while (scanf(\"%s \", b)) {\n    printf(\"%s\\n\", b);\n    char c[101] = {0};\n    t = 0;\n    k = strlen(b);\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (b[i] == '(' || b[i] == ')') {\n        q[j].a = b[i];\n        q[j++].n = i;\n      }\n    i = 0;\n    while (i < j - t - 1) {\n      if (q[i].a == '(' && q[i + 1].a == ')') {\n        for (l = i; l < j - t - 2; l++) {\n          q[l] = q[l + 2];\n        }\n        t = t + 2;\n        if (i != 0)\n          i = i - 1;\n      } else\n        i++;\n    }\n\n    for (i = 0; i < k; i++) {\n      c[i] = ' ';\n      b[i] = 0;\n    }\n    for (i = 0; i < j - t; i++) {\n      if (q[i].a == '(')\n        c[q[i].n] = '$';\n      else\n        c[q[i].n] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31245", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[999];\nint find(int i, int l) {\n  int t;\n  if (s[i] == '\\0')\n    return -1;\n  if (s[i] == '(') {\n    t = find(i + 1, l + 1);\n    if (t == -1)\n      s[i] = '$';\n    else\n      s[i] = ' ';\n    if (t == -1)\n      return -1;\n    else {\n      return find(t + 1, l);\n    }\n  }\n  if (s[i] == ')') {\n    if (l == 0)\n      s[i] = '?';\n    else\n      s[i] = ' ';\n    if (l == 0)\n      return find(i + 1, 0);\n    else\n      return i;\n  }\n  s[i] = ' ';\n  return find(i + 1, l);\n}\nint main() {\n  for (; cin >> s;) {\n    cout << s << endl;\n    find(0, 0);\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m;\n  char a[150], b[150];\n  for (m = 0; m < 1000; m++) {\n    for (i = 0; i < 150; i++)\n      a[i] = 0, b[i] = 0;\n    scanf(\"%s\", a);\n    l = strlen(a);\n    if (l == 0)\n      break;\n    for (i = 0; i < l; i++)\n      b[i] = a[i];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        if (a[j] == '(') {\n          for (k = j + 1; k < l; k++) {\n            if (a[k] == '(')\n              break;\n            if (a[k] == ')') {\n              a[j] = 'a', a[k] = 'a';\n              break;\n            }\n          }\n        }\n    printf(\"%s\\n\", b);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  char a[200];\n  while (cin.get(a, 200)) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')') {\n        a[i] = '?';\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n    cin.get();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31248", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')') {\n      num++;\n    }\n  } else if (num == 0) {\n    ch = '$';\n  } else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i, n;\n  char s[101], a[101];\n  scanf(\"%d\", &n);\n  while (scanf(\"%s \", s)) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    cout << b[i] << endl;\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else {\n      b[k][i] = ' ';\n    }\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[102], str2[102];\n  int i, j;\n  while (cin.getline(str1, 102)) {\n    strcpy(str2, str1);\n    int len = strlen(str1);\n    for (i = 0; i < len; i++) {\n      if (str2[i] != '(' && str2[i] != ')')\n        str2[i] = ' ';\n      else {\n        if (str2[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (str2[j] == '(') {\n              str2[j] = ' ';\n              str2[i] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    cout << str1 << endl << str2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101] = {\"0\"};\n  int i, j, len, zuo, you, a[100];\n  while (scanf(\"%s\", str) != EOF) {\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      a[i] = 0;\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        zuo = 0;\n        you = 0;\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == '(' && a[j] != 1)\n            zuo++;\n          else if (str[j] == ')')\n            you++;\n        }\n        if (you < zuo + 1)\n          a[i] = 1;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        zuo = 0;\n        you = 0;\n        for (j = 0; j < i; j++) {\n          if (str[j] == '(')\n            zuo++;\n          else if (str[j] == ')' && a[j] != -1)\n            you++;\n        }\n        if (zuo < you + 1)\n          a[i] = -1;\n      }\n    }\n    cout << str << \"\\n\";\n    for (i = 0; i < len; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else if (a[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31252", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findl(int i, char a[102], int n);\nint find(int i, char a[102]);\nint main() {\n  char a[102];\n  memset(a, '\\n', 102);\n  while (scanf(\"%s \", a)) {\n    int n = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < n; i++) {\n      int x = 0;\n      if (a[i] == '(' && findl(i, a, n) > n)\n        cout << \"$\";\n      else if (a[i] == ')' && find(i, a) < 0)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n}\nint findl(int i, char a[102], int n) {\n  int k = i + 1;\n  while (k < n) {\n    if (a[k] == '(')\n      k = findl(k, a, n);\n    else if (a[k] == ')')\n      return k;\n    k++;\n  }\n  return n + 1;\n}\nint find(int i, char a[102]) {\n  int k = i - 1;\n  while (k >= 0) {\n    if (a[k] == ')')\n      k = find(k, a);\n    else if (a[k] == '(')\n      return k;\n    k--;\n  }\n  return -1;\n}\n"}
{"label": "17", "index": "31253", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nint length;\nchar a[1000];\nchar c[100];\nint b[100];  \nint zkh = 0; \nint match(int i) {\n  if (i == length)\n    return 0;\n  if (a[i] == '(') {\n    zkh = zkh + 1;\n    c[i] = '$';\n    b[zkh] = i;\n  }\n  if (a[i] == ')') {\n    if (zkh == 0) {\n      c[i] = '?';\n    }\n    if (zkh != 0) \n    {\n      c[b[zkh]] = ' ';\n      zkh = zkh - 1;\n      c[i] = ' ';\n    }\n  }\n  if (a[i] != '(' && a[i] != ')') {\n    c[i] = ' ';\n  }\n  match(i + 1);\n}\n\nint main(int argc, const char *argv[]) {\n  int j, k, l;\n  while (cin.getline(a, 200)) {\n    zkh = 0;\n    length = strlen(a);\n    for (j = 0; j < length; j++) {\n      cout << a[j];\n    }\n    cout << endl; \n\n    match(0); \n\n    for (l = 0; l < length; l++) {\n      cout << c[l];\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "17", "index": "31254", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][110], c, h;\n  int i, j, k, t[100] = {0}, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (j = 0; j < t[i]; j++) {\n      if ((a[i][j] >= 'a' && a[i][j] <= 'z') ||\n          (a[i][j] >= 'A' && a[i][j] <= 'Z'))\n        a[i][j] = ' ';\n    }\n    for (j = 0; j < t[i] - 1; j++) {\n      if (a[i][j] == '(') {\n        for (k = j + 1; k < t[i]; k++) {\n          if (a[i][k] == ')') {\n            a[i][j] = ' ';\n            a[i][k] = ' ';\n            j = -1;\n            break;\n          }\n          if (a[i][k] == '(') {\n            j = k - 1;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    for (j = 0; j < t[i]; j++) {\n      if (a[i][j] == ' ')\n        cout << a[i][j];\n      if (a[i][j] == '(')\n        cout << '$';\n      if (a[i][j] == ')')\n        printf(\"?\");\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar c[110];\nint Try() {\n  int i, j;\n  int L = -1, R = -1;\n  for (i = 0; i <= strlen(c) - 1; ++i) {\n    if (c[i] == '(')\n      L = i;\n  }\n  for (j = strlen(c) - 1; j > L; --j) {\n    if (c[j] == ')')\n      R = j;\n  }\n  if (L != -1 || R != -1) {\n    if (L == -1) {\n      c[R] = '?';\n    }\n\n    else if (R == -1) {\n      c[L] = '$';\n    } else if (L < R) {\n      c[L] = ' ';\n      c[R] = ' ';\n    } else if (L > R) {\n      c[L] = '$';\n      c[R] = '?';\n    }\n    Try();\n  }\n  if (L == -1 && R == -1)\n    return 1;\n}\nint main() {\n  int k;\n  while (cin >> c) {\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      if (c[k] != '(' && c[k] != ')')\n        c[k] = ' ';\n    }\n    Try();\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, k, p;\n  char a[100][1000], b[1000][1000];\n  for (i = 0; i < 100; i++) {\n    for (k = 0; k < 100; k++) {\n      b[i][k] = ' ';\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    if (a[i][0] == '\\0')\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \"\\n\";\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == ')') {\n        for (p = k - 1; p >= 0; p--) {\n          if (a[i][p] == '(') {\n            a[i][p] = '.';\n            a[i][k] = '.';\n            break;\n          } else if (a[i][p] == ')') {\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == '(')\n        b[i][k] = '$';\n      else if (a[i][k] == ')')\n        b[i][k] = '?';\n    }\n    b[i][strlen(a[i])] = '\\0';\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[110], b[110];\n  while (scanf(\"%s\", &a) == 1) {\n    strcpy(b, a);\n    int len = strlen(a);\n    int i, t, s, q = 1;\n    while (q) {\n      q = 0;\n      t = -1;\n      s = -1;\n      for (i = 0; i < len; i++) {\n        if (a[i] == 40)\n          t = i;\n        else if (a[i] == 41) {\n          if (t >= 0) {\n            a[t] = 48;\n            a[i] = 48;\n            q = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, l;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (i = 1; i < l; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      if (a[i] == ')')\n        printf(\"?\");\n      if (a[i] == ' ')\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n    \n    \n    \n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0) {\n          b[j] = '?';\n        } else {\n          t--;\n          b[c[t]] = ' ';\n          b[j] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++) {\n      printf(\"%c\", b[h]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  static char c[102], d[102];\n  int i, j, k, s;\n  while (cin >> c) {\n    puts(c);\n    for (i = 0; c[i] != '\u0000'; i++) {\n\n      if (c[i] == '(')\n        d[i] = 1;\n      else if (c[i] == ')')\n        d[i] = 2;\n      else\n        d[i] = 3;\n    }\n    while (1) {\n      s = 0;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1)\n          break;\n      }\n      for (k = j + 1; k <= i - 1; k++) {\n        if (d[k] == 2) {\n          s = 1;\n          break;\n        }\n      }\n      if (s == 0)\n        break;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          for (k = j + 1; k <= i - 1; k++) {\n            if (d[k] == 1) {\n              j = k;\n            }\n            if (d[k] == 2) {\n              d[j] = 3;\n              d[k] = 3;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (k = 0; k <= i - 1; k++) {\n      switch (d[k]) {\n      case 1:\n        printf(\"$\");\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      case 3:\n        printf(\" \");\n        break;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31261", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101]; \n  int pos[100];               \n  int left = 0, right = 0;    \n  int pos_i, len;             \n  int i;\n  while (cin.getline(line, 101)) \n  {\n    pos_i = -1, left = 0;\n    right = 0; \n\n    len = strlen(line);\n\n    for (i = 0; i < 100; i++) \n      label[i] = ' ';\n\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(')\n      \n      {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right) \n          label[i] = '?';  \n        else {\n          right++;\n          pos_i--;\n        }\n      } \n    }\n\n    if (pos_i >= 0) \n    {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$'; \n    }\n\n    i = len - 1;\n\n    label[i + 1] = '\\0'; \n\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[200];\nint x = 0, y = 0;\nvoid find(int min) {\n  if (min > 0) {\n    int p = -1;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && p >= 0) {\n        a[p] = 'a';\n        a[i] = 'b';\n        break;\n      } else if (a[i] == '(') {\n        p = i;\n      }\n    }\n    find(min - 1);\n  }\n}\nvoid change() {\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else {\n      a[i] = ' ';\n    }\n  }\n}\nvoid qingling() {\n  for (int i = 0; i < strlen(a); i++) {\n    a[i] = '\\0';\n  }\n}\nint main() {\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        x++;\n      if (a[i] == ')')\n        y++;\n    }\n    int min = 0;\n    if (x < y)\n      min = x;\n    else\n      min = y;\n    find(min);\n    change();\n    cout << a << endl;\n    qingling();\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[200];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    int j;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')') {\n        int s;\n        for (s = j - 1; s >= 0; s--) {\n          if (a[s] == '(') {\n            a[s] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')')\n        cout << \"?\";\n      else if (a[j] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000] = {0}, b[1000] = {0};\n  int i, j;\n  while (cin >> a) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      b[i] = a[i];\n    }\n    b[i] = '\u0000';\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if (b[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '(') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if ((b[i] >= 'a' && b[i] <= 'z') || (b[i] >= 'A' && b[i] <= 'Z'))\n        b[i] = ' ';\n      else if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    } \n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, k, l, len[20];\n  char a[20][101], b[50][101] = {' '};\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++) {\n    scanf(\"%s\", a[i]);\n    len[i] = strlen(a[i]);\n  }\n\n  for (k = 1; k <= num; k++) {\n    for (i = 0; i < len[k]; i++) {\n      if (a[k][i] == '(')\n        b[k][i] = '$';\n      else if (a[k][i] == ')')\n        b[k][i] = '?';\n      else\n        b[k][i] = ' ';\n    }\n    for (i = 0; i < len[k] - 1; i++) {\n      if (b[k][i] == '$') {\n        for (j = i + 1; j < len[k]; j++) {\n          if (b[k][j] == '?') {\n            for (l = j - 1; l >= i; l--) {\n              if (b[k][l] == '$') {\n                b[k][l] = ' ';\n                b[k][j] = ' ';\n                break;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", a[k][i]);\n    cout << \" \";\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  int l, i, j, d;\n  while (1) {\n\n    scanf(\"%s \", str);\n    if (str[0] == '\u0000')\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == ' ')\n        continue;\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        d = 1;\n        for (j = i + 1; j < l; j++) {\n          if (str[j] == '(')\n            d++;\n          if (str[j] == ')')\n            d--;\n          if (d == 0) {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')') {\n        cout << \"?\";\n      } else\n        printf(\"%c\", str[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      str[i] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, tmp1, tmp2 = 1;\n  do {\n    char s[101];\n    char st[101];\n    char r1[101];\n    int r2[101];\n    int d, f = 0, pi = 0;\n    if (scanf(\"%s\", s) != EOF) {\n      f = 1;\n      d = strlen(s);\n      strcpy(st, s);\n      for (j = 0; j < d; j++) {\n        if (pi == 0 && (s[j] == '(' || s[j] == ')')) {\n          r1[0] = s[j];\n          r2[0] = j;\n          pi += 1;\n        } else if ((s[j] == '(' || s[j] == ')')) {\n          if (r1[pi - 1] == '(' && s[j] == ')') {\n            s[r2[pi - 1]] = ' ';\n            s[j] = ' ';\n            pi -= 1;\n          } else {\n            r1[pi] = s[j];\n            r2[pi] = j;\n            pi += 1;\n          }\n        } else\n          s[j] = ' ';\n      }\n      for (j = 0; j < pi; j++) {\n        if (r1[j] == '(')\n          s[r2[j]] = '$';\n        else {\n          s[r2[j]] = '?';\n        }\n      }\n      printf(\"%s\\n%s\\n\", st, s);\n    } else\n      break;\n  } while (tmp2);\n\n  return 0;\n}\n"}
{"label": "17", "index": "31268", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[100];\nint b;\nvoid nihao() {\n\n  for (int i = 0; i < b; i++) {\n    int r = 0;\n    if (a[i] == ')') {\n      for (int j = i - 1; j >= 0; j--) {\n        if (a[j] == '(') {\n          for (int k = j; k <= i; k++)\n            a[k] = ' ';\n          r = 1;\n          break;\n        }\n      }\n      if (r == 0) {\n        a[i] = '?';\n        for (int k = i - 1; k >= 0; k--)\n          if (a[k] != '?')\n            a[k] = ' ';\n      }\n    }\n  }\n}\nvoid nimei() {\n  for (int i = b - 1; i >= 0; i--)\n    if (a[i] == '(') {\n      a[i] = '$';\n    }\n}\nvoid nima() {\n  for (int i = 0; i < b; i++) {\n    if (a[i] != '?' && a[i] != '$')\n      a[i] = ' ';\n  }\n  for (int i = 0; i < b; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a;\n    cout << endl;\n    b = strlen(a);\n    nihao();\n    nimei();\n    nima();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  int st[100], sp;\n  int i, l, m, n, t;\n  while (1) {\n    for (i = 0; i <= 99; i++)\n      st[i] = 0;\n    sp = 0;\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    strcpy(b, a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        st[sp] = i;\n        break;\n      }\n    }\n    if (i == l)\n      ;\n    else {\n      for (sp = 1, i = st[0] + 1; i <= l - 1; i++) {\n        if (a[i] == '(')\n          st[sp++] = i;\n        else if (a[i] == ')') {\n          if (sp > 0) {\n            b[st[--sp]] = ' ';\n            b[i] = ' ';\n          }\n        }\n      }\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else if (b[i] == ' ')\n        ;\n      else\n        b[i] = ' ';\n    }\n    printf(\"%s \", a);\n    n = l - 1;\n    for (i = l - 1; i >= 0; i--) {\n      if (b[i] == ' ')\n        n = i - 1;\n      else\n        break;\n    }\n    m = 0;\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == ' ')\n        m = i + 1;\n      else\n        break;\n    }\n    t = 0;\n    for (i = m; i <= n; i++) {\n      printf(\"%c\", b[i]);\n      t++;\n    }\n    printf(\" \");\n    a[0] = '\u0000';\n  }\n}\n"}
{"label": "17", "index": "31270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    cout << \"\\n\";\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint find(char s[], int pos) {\n  int i, p = 0, q = 0;\n  if (pos < 0)\n    return 0;\n  if (s[pos] == ')')\n    for (i = pos - 1; i >= 0; i--) {\n      if (s[i] == '(')\n        p++;\n      if (s[i] == ')')\n        q++;\n      if ((s[i] == '(') && (p - q == 1)) {\n        s[i] = ' ';\n        s[pos] = ' ';\n        break;\n      }\n    }\n  find(s, pos - 1);\n  return 0;\n}\nint main() {\n  char s[101], ss[101], ans[101];\n  int i, n;\n  while (true) {\n    cin >> s;\n    if (!cin)\n      break;\n    strcpy(ss, s);\n    memset(ans, ' ', sizeof(ans));\n    n = strlen(s) - 1;\n    find(s, n);\n    for (i = 0; i <= n; i++) {\n      if (s[i] == '(')\n        ans[i] = '$';\n      if (s[i] == ')')\n        ans[i] = '?';\n    }\n    ans[n + 1] = '\\0';\n    cout << ss << \"\\n\";\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar a[120];\nint len = 0;\n\nvoid bracket(int i) {\n  if (i < 0)\n    return;\n  if (a[i] != '(')\n    bracket(i - 1);\n  if (a[i] == '(') {\n    for (int k = i; k < len; k++) {\n      if (a[k] == ')') {\n        a[i] = 'x';\n        a[k] = 'x';\n        break;\n      }\n    }\n    bracket(i - 1);\n  }\n}\n\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    len = strlen(a);\n    bracket(len - 1);\n    for (int k = 0; k < len; k++) {\n      if (a[k] == '(')\n        cout << \"$\";\n      else if (a[k] == ')')\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << endl;\n    for (int i = 0; i < 120; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31273", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[101];\nint c[101];\nvoid match(int i, int len) {\n  int k = i + 1;\n  if (c[i] != 0) {\n    while (k < len) {\n      if (a[k] == '(' && c[k] == 1) {\n        match(k, len);\n      }\n      if (a[k] == ')' && c[i] == 1 && c[k] == -1) {\n        c[i] = 0;\n        c[k] = 0;\n      }\n      k++;\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    cin >> a;\n    int len = strlen(a);\n    for (int j = 0; j < len; j++) {\n      if (a[j] == '(')\n        c[j] = 1;\n      else if (a[j] == ')') {\n        c[j] = -1;\n      } else {\n        c[j] = 0;\n      }\n    }\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1) {\n        for (int k = j + 1; k < len; k++) {\n          if (c[k] == 1)\n            break;\n          if (c[k] == -1) {\n            c[k] = 0;\n            c[j] = 0;\n            j = -1;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1)\n        printf(\"$\");\n      if (c[j] == -1)\n        printf(\"?\");\n      if (c[j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int len;\n  while (cin >> a) {\n    printf(\"%s\\n\\n\", a);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      if (isalpha(a[i]))\n        a[i] = ' ';\n      else if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (int temp = 0; temp < len / 2; temp++) {\n      for (int i = 0; i < len; i++)\n        if (a[i] == '$') {\n          for (int j = i + 1; j < len; j++) {\n            if (a[j] == '$') {\n              break;\n            } else if (a[j] == '?') {\n              a[i] = ' ';\n              a[j] = ' ';\n              break;\n            }\n          }\n        }\n    }\n    cout << a << endl << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "17", "index": "31275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, m;\n  char a[150], b[150];\n  for (m = 0; m < 1000; m++) {\n    for (i = 0; i < 150; i++)\n      a[i] = 0, b[i] = 0;\n    scanf(\"%s\", a);\n    l = strlen(a);\n    if (l == 0)\n      break;\n    for (i = 0; i < l; i++)\n      b[i] = a[i];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        if (a[j] == '(') {\n          for (k = j + 1; k < l; k++) {\n            if (a[k] == '(')\n              break;\n            if (a[k] == ')') {\n              a[j] = 'a', a[k] = 'a';\n              break;\n            }\n          }\n        }\n    printf(\"%s\\n\", b);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i;\n  char s[1001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n\n    char t[1001] = {0};\n    int j, k;\n    int len = strlen(s);\n\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        int zo = 1, yb = 0;\n        for (k = j + 1; k < len; k++) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n\n          s[j] = 0;\n          t[j] = '$';\n        }\n      }\n\n      if (s[j] == ')') {\n        int zo = 0, yb = 1;\n        for (k = j - 1; k >= 0; k--) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n          t[j] = '?';\n          s[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == 0) {\n        printf(\"(\");\n      } else if (s[j] == 1) {\n        printf(\")\");\n      } else\n        printf(\"%c\", s[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j < len; j++) {\n      if (t[j] == '?' || t[j] == '$') {\n        printf(\"%c\", t[j]);\n      } else\n        printf(\" \");\n    }\n\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (true) {\n    char a[110] = {'\\0'}, b[110] = {'\\0'};\n    int i = 0;\n    char x = '\\0';\n    while (true) {\n      x = getchar();\n      if (x == '\\n')\n        break;\n      a[i] = x;\n      b[i] = x;\n      i++;\n    }\n    int k = 1, j, n;\n    while (k < i) {\n      for (j = 0; j < i - k; j++) {\n        int zhongjian = 0, l;\n        if (k != 1) {\n          for (l = j + 1; l < j + k; l++) {\n            if (a[l] == '(' || a[l] == ')')\n              zhongjian = 1;\n          }\n        }\n\n        if (a[j] == '(' && a[j + k] == ')' && zhongjian == 0) {\n          a[j] = '\\0';\n          a[j + k] = '\\0';\n        }\n      }\n\n      k = k + 1;\n    }\n    for (n = 0; n < i; n++) {\n\n      if (a[n] == '(')\n        a[n] = '$';\n      else if (a[n] == ')')\n        a[n] = '?';\n      else\n        a[n] = ' ';\n    }\n\n    for (n = 0; n < i; n++)\n      cout << b[n];\n    printf(\"\\n\");\n    for (n = 0; n < i; n++)\n      cout << a[n];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31278", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int len, i, h;\n  char c[102];\n  int a[101];\n  int b[101];\n  while ((cin.getline(c, 101))) {\n    len = strlen(c);\n    cout << c << endl;\n    h = 0;\n    for (i = 0; i <= len; i++)\n      a[i] = -1;\n    memset(b, 0, sizeof(b));\n    for (i = 0; i <= len - 1; i++) {\n      switch (c[i]) {\n      case '(': {\n        h++;\n        a[h] = i;\n        break;\n      }\n      case ')': {\n        if (h == 0) {\n          b[i] = 2;\n        } else {\n          a[h] = 0;\n          h--;\n        }\n        break;\n      }\n      }\n    }\n    for (i = 1; i <= h; i++) {\n      if (a[i] != -1)\n        b[a[i]] = 1;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (b[i] == 1)\n        cout << '$';\n      if (b[i] == 2)\n        printf(\"?\");\n      if (b[i] == 0)\n        cout << ' ';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31279", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, l, i, k;\n  char str[200] = {0};\n  scanf(\"%d\\n\", &n);\n  while (n) {\n    scanf(\"%s\", str);\n    puts(str);\n    printf(\"\\n\");\n    l = strlen(str);\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (k = i; k < l; k++) {\n          if (str[k] == ')') {\n            str[i] = ' ';\n            str[k] = ' ';\n            k = l;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      } else if (str[i] == ')') {\n        str[i] = '?';\n      } else {\n        str[i] = ' ';\n      }\n    }\n    puts(str);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][100];\n  int c[100], i, j, k = 0;\n  while ((scanf(\"%s\", s[k])) != EOF) {\n    puts(s[k]);\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (s[k][i] == '(')\n        c[i] = -1;\n      else if (s[k][i] == ')')\n        c[i] = 1;\n      else\n        c[i] = 0;\n    }\n    for (i = 1; i < strlen(s[k]); i++)\n      for (j = 0; j < strlen(s[k]) - i; j++)\n        if (c[j] == -1 && c[j + i] == 1) {\n          c[j] = 0;\n          c[j + i] = 0;\n        }\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (c[i] == 0)\n        printf(\" \");\n      else if (c[i] == -1)\n        cout << \"$\";\n      else if (c[i] == 1)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[150];\nint l, j;\nvoid left(int i) {\n  int jj;\n\n  if (i == l - 1) {\n    a[i] = '$';\n    return;\n  }\n  for (jj = i + 1; jj < l; jj++) {\n\n    if (a[jj] == ')') {\n      a[jj] = ' ';\n      a[i] = ' ';\n      break;\n    } else if (a[jj] == '(') {\n      left(jj);\n    }\n  }\n  if (jj == l) {\n    a[i] = '$';\n  }\n\n  return;\n}\nvoid match(int i) {\n\n  if (i == l) {\n    for (int ii = 0; ii < l; ii++) {\n      if (a[ii] == '(') {\n        a[ii] = '$';\n      }\n      if (a[ii] == ')')\n        a[ii] = '?';\n    }\n    return;\n  } else {\n    if (i == l - 1 && a[i] == '(') {\n      a[i] = '$';\n    }\n    if ((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) {\n      a[i] = ' ';\n    } else if (a[i] == '(') {\n      left(i);\n    }\n    match(i + 1);\n  }\n}\nint main() {\n  while (cin >> a) {\n    l = strlen(a);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    cout << endl;\n    match(0);\n    for (int k = 0; k < l; k++) {\n      cout << a[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31282", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, i, j, t, k;\n  char a[101], c[101];\n  cin >> t;\n  getchar();\n  for (k = 0; k < t; k++) {\n\n    cin >> a;\n    int l = strlen(a);\n    c[l] = '\u0000';\n    for (j = 0; j < l; j++) {\n      c[j] = a[j];\n      if (a[j] == '(')\n        m++;\n      if (a[j] != '(' && a[j] != ')')\n        c[j] = ' ';\n    }\n    puts(a);\n    for (i = 0; i < m + 1; i++) {\n      char x = ')';\n      int y = -1;\n      for (j = 0; j < l; j++) {\n        if (c[j] == '(' || c[j] == ')') {\n          if (c[j] == '(') {\n          } else {\n            if (x == '(') {\n              c[j] = ' ';\n              c[y] = ' ';\n            }\n          }\n          y = j;\n          x = c[j];\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  char a[101];\n  int i, j, flag;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == 40) {\n        if (i == strlen(a) - 1)\n          printf(\"$\");\n        else {\n          flag = 1;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (a[j] == 41 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 41 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 40) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"$\");\n        }\n      }\n\n      else if (a[i] == 41) {\n        if (i == 0)\n          printf(\"?\");\n        else {\n          flag = 1;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == 40 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 40 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 41) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"?\");\n        }\n      }\n\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100] = {0};\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      switch (a[i]) {\n      case '(':\n        a[i] = '$';\n        break;\n      case ')':\n        a[i] = '?';\n        break;\n      default:\n        a[i] = ' ';\n      }\n      if (i > l)\n        break;\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '$')\n        for (int j = i + 1; j < l; j++) {\n          if (a[j] == '?') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '$')\n            break;\n        }\n      if (a[i] == '?')\n        for (int j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '?') {\n            break;\n          }\n        }\n    }\n    for (int i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < 100; i++)\n      a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101]; \n  int i, l, n, x, j, r;\n  int le[101] = {0}, ri[101] = {0};\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < 100; i++) {\n      le[i] = 0;\n      ri[i] = 0;\n    }\n    scanf(\"%s\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        le[i] = 1;\n      if (s[i] == ')')\n        ri[i] = 1;\n    }\n    for (i = l - 1; i >= 0; i--) {\n      if (le[i] == 1) {\n        for (j = i; j < l; j++) {\n          if (ri[j] == 1) {\n            ri[j] = 0;\n            le[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < l; i++) {\n      if (ri[i] == 1)\n        printf(\"?\");\n      if (le[i] == 1)\n        printf(\"$\");\n      if (ri[i] == 0 && le[i] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n;\n  while (scanf(\"%s\", a) != EOF) {\n    puts(a);\n    n = strlen(a);\n    course(a, n);\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31287", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n    a[0] = ' ';\n\n    cin >> a;\n    if (a[0] != ' ') {\n      t = strlen(a);\n      show(a, t);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31288", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  char a[1000], b[1000];\n  int i, j, k, e = 0;\n  cin >> n;\n  for (i = 1; i < n + 1; i++) {\n    scanf(\"%s\", &a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      } else {\n        b[j] = a[j];\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        for (k = j + 1; k < strlen(a); k++) {\n          if (b[k] == '(') {\n            e++;\n          } else if (b[k] == ')' && e == 0) {\n            b[k] = ' ';\n            b[j] = ' ';\n            e++;\n          }\n        }\n        e = 0;\n      }\n\n      else if (b[j] == ')') {\n        e = 0;\n        k = j - 1;\n        for (k = j - 1; k > 0; k--) {\n          if (b[k] == '(') {\n            b[k] = ' ';\n            b[j] = ' ';\n            k = 0;\n            e = 1;\n          }\n        }\n        if (e == 0 && b[0] == '(') {\n          b[0] = ' ';\n          b[j] = ' ';\n        }\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      if (b[j] == '(') {\n        b[j] = '$';\n      } else if (b[j] == ')') {\n        b[j] = '?';\n      }\n    }\n\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", a[j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < strlen(a); j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, c, d, e, f, g, k, j, l, b[100];\n  scanf(\"%d\", &n);\n  char a[1000][150], h[1000][150];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    e = 0;\n    for (j = 0; j < b[i]; j++) {\n      if (a[i][j] == '(') {\n        h[i][j] = '$';\n        e++;\n      }\n      if (a[i][j] == ')') {\n        h[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')')\n        h[i][j] = ' ';\n    }\n    for (l = 0; l < e; l++) {\n      for (j = 0; j < b[i]; j++) {\n        c = f = d = -1;\n        if (h[i][j] == '$') {\n          c = j;\n          g = c;\n          for (g = c; g < b[i]; g++) {\n            if (h[i][g] == '?') {\n              f = g;\n              break;\n            }\n          }\n          for (k = f - 1; k >= c; k--) {\n            if (h[i][k] == '$') {\n              d = k;\n              break;\n            }\n          }\n          if (d != -1 && f != -1) {\n            h[i][d] = ' ';\n            h[i][f] = ' ';\n          }\n          break;\n        }\n      }\n    }\n    for (j = 0; j < b[i]; j++) {\n      cout << a[i][j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < b[i]; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[105];\n  char sign[105];\n  char present[105];\n  while (scanf(\"%s\", zfc) > 0) {\n    \n    strcpy(sign, zfc);\n    strcpy(present, zfc);\n    int left = 0, right = 0;\n    int m = strlen(zfc);\n    for (int i = 0; i < m; i++) {\n      if (zfc[i] == '(') {\n        left = 0;\n        right = 0;\n        for (int j = i; j < m; j++) {\n          if (zfc[j] == '(') {\n            left++;\n          }\n          if (zfc[j] == ')') {\n            left--;\n          }\n          if (left <= 0) {\n            break;\n          }\n        }\n        if (left > 0) {\n          sign[i] = '$';\n        }\n      }\n      if (zfc[i] == ')') {\n        left = 0;\n        right = 0;\n        for (int j = i; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            right--;\n          }\n          if (zfc[j] == ')') {\n            right++;\n          }\n          if (right <= 0) {\n            break;\n          }\n        }\n        if (right > 0) {\n          sign[i] = '?';\n        }\n      }\n    }\n    for (int i = 0; i < m; i++) {\n      if (sign[i] != '$' && sign[i] != '?') {\n        sign[i] = ' ';\n      }\n    }\n    puts(present);\n    puts(sign);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101] = {0}, b[101] = {0};\n  while (scanf(\"%s\", a) != EOF) {\n    strcpy(b, a);\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; a[i] != 0; i++) {\n      if (a[i] == '?') {\n        for (j = i - 1; j > -1; j--)\n          if (a[j] == '$') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n      }\n    }\n    printf(\"%s\\n\", b);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31292", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int len;\n  while (cin >> a) {\n    cout << a << endl << endl;\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      if (isalpha(a[i]))\n        a[i] = ' ';\n      else if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (int temp = 0; temp < len / 2; temp++) {\n      for (int i = 0; i < len; i++)\n        if (a[i] == '$') {\n          for (int j = i + 1; j < len; j++) {\n            if (a[j] == '$') {\n              break;\n            } else if (a[j] == '?') {\n              a[i] = ' ';\n              a[j] = ' ';\n              break;\n            }\n          }\n        }\n    }\n    cout << a << endl << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "17", "index": "31293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    n = strlen(str);\n    match(0, n, str);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(')\n    str[i] = '$';\n  else\n    str[i] = ' ';\n\n  match(i + 1, n, str);\n  return 0;\n}\n"}
{"label": "17", "index": "31294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], ans[101];\n  int left[101];       \n  int n = 0, i, t = 0; \n  while (cin >> c) {\n    t = 0;\n    n = strlen(c);\n    for (i = 0; i < n; i++) {\n      ans[i] = ' ';\n      if (c[i] == '(')\n        left[t++] = i;\n      if (c[i] == ')') {\n        if (t == 0)\n          ans[i] = '?';\n        else\n          t--;\n      }\n    }\n    for (i = 0; i < t; i++)\n      ans[left[i]] = '$';\n    ans[n] = '\\0';\n    cout << c << endl << ans << endl;\n  }\n}\n"}
{"label": "17", "index": "31295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char b[101];\n  while (cin.getline(b, 101)) {\n    j = 0;\n    int c[100] = {0}, a[100] = {0};\n    n = strlen(b);\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(') {\n        a[j] = i + 1;\n        j++;\n      }\n      if (b[i] == ')') {\n        if (j > 0) {\n          j--;\n          a[j] = a[j + 1];\n        } else\n          c[i] = 1;\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < j; i++)\n      c[a[i] - 1] = 2;\n    for (i = 0; i < n; i++) {\n      if (c[i] == 1)\n        cout << \"?\";\n      else {\n        if (c[i] == 2)\n          cout << \"$\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "31296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, l;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (i = 1; i < l; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      if (a[i] == ')')\n        printf(\"?\");\n      if (a[i] == ' ')\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint match(char *a) {\n  int i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] == ')') {\n      a[i] = ' ';\n      a[0] = ' ';\n      return i;\n    } else if (a[i] == '(') {\n      a[i] = '$';\n      i += match(a + i);\n    } else\n      a[i] = ' ';\n    i++;\n  }\n  return i - 1;\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    printf(\"%s\\n\", ch);\n    int i = 0;\n    while (ch[i] != '\\0') {\n      if (ch[i] == '(') {\n        ch[i] = '$';\n        i += match(ch + i);\n      } else if (ch[i] == ')')\n        ch[i] = '?';\n      else\n        ch[i] = ' ';\n      i++;\n    }\n    cout << ch << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, t, len;\n  char a[100];\n  while (cin >> a) {\n    t = 0;\n    m = 0;\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      if (a[i] == ')')\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        m = i;\n        break;\n      }\n    for (i = len - 1; i >= 0; i--)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        t = i;\n        break;\n      }\n    for (i = m; i <= t; i++) {\n      if (a[i] == ')')\n        cout << \"?\";\n      else if (a[i] == '(')\n        cout << \"$\";\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31299", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char zfc[120], cha, i, j, len;\n  while (scanf(\"%s\", zfc) != EOF) {\n    cha = 0;\n    len = strlen(zfc);\n    printf(\"%s\\n\", zfc);\n    for (i = 0; i < len; i++) {\n      if (zfc[i] != '(' && zfc[i] != ')') {\n        zfc[i] = ' ';\n      }\n      if (zfc[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            zfc[j] = ' ';\n            zfc[i] = ' ';\n            break;\n          }\n        }\n        if (j < 0) {\n          zfc[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (zfc[i] == '(') {\n        zfc[i] = '$';\n      }\n    }\n    puts(zfc);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid braket_match(char *s);\nint main() {\n  int n, i;\n  char tmp[1000];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> tmp;\n    braket_match(tmp);\n  }\n  return 0;\n}\nvoid braket_match(char *s) {\n  cout << s << \" \";\n  int j, left[1000] = {-1, -1}, left_num = 0, left0 = 1, right[1000] = {-1, -1},\n         right_num = 0, right0 = 1, LEN = strlen(s);\n  for (j = 0; j < LEN; j++) {\n    if (s[j] == '(')\n      left[++left_num] = j;\n    else if (s[j] == ')' && left_num == 0)\n      right[++right_num] = j;\n    else if (s[j] == ')' && left_num > 0)\n      left[left_num--] = -1;\n  }\n  for (j = 0; j < LEN; j++) {\n    if (j == left[left0]) {\n      printf(\"$\");\n      left0++;\n    } else if (j == right[right0]) {\n      printf(\"?\");\n      right0++;\n    } else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31301", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0;\n  char a[105], b[105];\n  while (cin >> a) {\n    l = 0;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && l == 0) {\n        b[i] = '?';\n        continue;\n      }\n      if (a[i] == '(') {\n        b[i] = '$';\n        l++;\n      }\n      if (a[i] == ')' && l > 0) {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[j] = ' ';\n            l--;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < strlen(a); i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[105];\nint len;\nint f(int b) {\n  for (int i = b + 1; i < len; i++) {\n    if (s[i] == ')') {\n      s[b] = '$';\n      s[i] = '?';\n      return i;\n    } else if (s[i] == '(') {\n      i = f(i);\n    }\n  }\n  return len - 1;\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    cout << s << endl;\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        i = f(i);\n    }\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        cout << '$';\n      } else if (s[i] == ')')\n        printf(\"?\");\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31303", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[101], b[101];\nint l, c[101];\nint main() {\n  int i, j;\n  while (cin.getline(a, 101)) {\n    j = 0;\n    memset(c, 0, sizeof(c));\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        c[j] = i;\n        j = j + 1;\n      } else {\n        if (a[i] == ')') {\n          if (j >= 1) {\n            b[c[j - 1]] = ' ';\n            b[i] = ' ';\n            j = j - 1;\n          } else {\n            b[i] = '?';\n          }\n        } else {\n          b[i] = ' ';\n        }\n      }\n    }\n    b[l] = '\\0';\n    cout << a << endl;\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, c, d, e, f, g, k, j, l, b[100];\n  scanf(\"%d\", &n);\n  char a[1000][150], h[1000][150];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    e = 0;\n    for (j = 0; j < b[i]; j++) {\n      if (a[i][j] == '(') {\n        h[i][j] = '$';\n        e++;\n      }\n      if (a[i][j] == ')') {\n        h[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')')\n        h[i][j] = ' ';\n    }\n    for (l = 0; l < e; l++) {\n      for (j = 0; j < b[i]; j++) {\n        c = f = d = -1;\n        if (h[i][j] == '$') {\n          c = j;\n          g = c;\n          for (g = c; g < b[i]; g++) {\n            if (h[i][g] == '?') {\n              f = g;\n              break;\n            }\n          }\n          for (k = f - 1; k >= c; k--) {\n            if (h[i][k] == '$') {\n              d = k;\n              break;\n            }\n          }\n          if (d != -1 && f != -1) {\n            h[i][d] = ' ';\n            h[i][f] = ' ';\n          }\n          break;\n        }\n      }\n    }\n    for (j = 0; j < b[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < b[i]; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin >> in) {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    printf(\"%s\\n\", in);\n    printf(\"%s\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, i, j;\n  char str[101], str1[101];\n  scanf(\"%d \", &n);\n  for (m = 0; m < n; m++) {\n\n    scanf(\"%s \", str);\n    puts(str);\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == ')')\n        for (j = i; j >= 0; j--)\n          if (str[j] == '(') {\n            str[j] = '0';\n            str[i] = '0';\n            break;\n          }\n    }\n\n    printf(\" \");\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      if (str[i] == ')')\n        printf(\"?\");\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[200];\nint findpair(int i, int j) \n{\n  int temp;             \n  if (a[i] == '\\0')     \n    return -1;          \n  else if (a[i] == '(') \n  {\n    temp = findpair(i + 1, j + 1); \n    if (temp == -1)                \n    {\n      a[i] = '$'; \n      return -1;\n    } else \n    {\n      a[i] = ' '; \n      return findpair(temp + 1, j);\n      \n    }\n  } else if (a[i] == ')') \n  {\n    if (j == 0) \n    {\n      a[i] = '?';                \n      return findpair(i + 1, j); \n    } else                       \n    {\n      a[i] = ' '; \n      return i;   \n    }\n  } else if (a[i] == ' ')        \n    return (findpair(i + 1, j)); \n}\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    for (int i = 0; i <= (int)strlen(a) - 1; ++i) \n      if (a[i] != ')' && a[i] != '(' && a[i] != '\\0')\n        a[i] = ' ';\n    findpair(0, 0); \n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31308", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000 + 1], flag[1000 + 1];\n  int i, j, sstack[1000 + 1];\n  while (scanf(\"%s\", str) != EOF) {\n    printf(\"%s \", str);\n    j = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        sstack[j++] = i;\n      else if (str[i] == ')') {\n        if (j <= 0)\n          flag[i] = '?';\n        else {\n          j--;\n          flag[sstack[j]] = ' ';\n          flag[i] = ' ';\n        }\n      } else\n        flag[i] = ' ';\n    }\n    for (i = 0; i < j; i++)\n      flag[sstack[i]] = '$';\n    flag[strlen(str)] = '\u0000';\n    printf(\"%s \", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid match(char *s, char *r, int len) {\n  char stack[100], c;\n  int top = 0;\n  int pos;\n  for (pos = 0; pos < len; ++pos)\n    r[pos] = ' ';\n  r[len] = '\\0';\n  for (pos = 0; pos < len; ++pos) {\n    c = s[pos];\n    if (c == '(')\n      stack[top++] = pos;\n    else if (c == ')')\n      if (top > 0) {\n        top--;\n      } else {\n        r[pos] = '?';\n      }\n  }\n  while (top > 0) {\n    pos = stack[--top];\n    r[pos] = '$';\n  }\n}\nvoid outresult(char s[], char r[]) {\n  puts(s);\n  puts(r);\n}\nint main() {\n  char line[101], result[101], ch;\n  int pos = 0;\n  while ((ch = getchar()) != EOF) {\n    if (ch != '\\n')\n      line[pos++] = ch;\n    else {\n      line[pos] = '\\0';\n      match(line, result, pos);\n      outresult(line, result);\n      pos = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1000 + 1], flag[1000 + 1];\n  int i, j, sstack[1000 + 1];\n  while (scanf(\"%s\", str) != EOF) {\n    cout << str << \" \";\n    j = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        sstack[j++] = i;\n      else if (str[i] == ')') {\n        if (j <= 0)\n          flag[i] = '?';\n        else {\n          j--;\n          flag[sstack[j]] = ' ';\n          flag[i] = ' ';\n        }\n      } else\n        flag[i] = ' ';\n    }\n    for (i = 0; i < j; i++)\n      flag[sstack[i]] = '$';\n    flag[strlen(str)] = '\u0000';\n    printf(\"%s \", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], s1[100];\n  int i, len, t;\n  while (scanf(\"%s \", s)) {\n    memset(s1, ' ', sizeof(s1));\n    len = strlen(s);\n    t = 0;\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        t++;\n      if (s[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '?';\n      }\n    }\n    t = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        t++;\n      if (s[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '$';\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << s1[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101] = {0};\n  int pro[101] = {0}, j = 0, p = 0, q = 0;\n  while (scanf(\"%s \", str)) {\n    for (int i = 1; i <= strlen(str); i++) {\n      if (str[i - 1] != '(' && str[i - 1] != ')') {\n        pro[i - 1] = 2;\n      }\n      if (str[i - 1] == ')') {\n        pro[i - 1] = 1;\n        for (j = i - 1; j >= 1; j--) {\n          if (str[j - 1] == '(' && pro[j - 1] == 0) {\n            pro[j - 1] = 1;\n            break;\n          }\n        }\n        if (j == 0) {\n          pro[i - 1] = 0;\n        }\n      }\n    }\n    cout << str << endl;\n    for (p = strlen(str); p >= 1; p--) {\n      if (pro[p - 1] == 0) {\n        break;\n      }\n    }\n    for (q = 1; q <= strlen(str); q++) {\n      if (pro[q - 1] == 0) {\n        break;\n      }\n    }\n    for (int k = q; k <= p; k++) {\n      if (str[k - 1] == '(' && pro[k - 1] == 0) {\n        cout << \"$\";\n      } else if (str[k - 1] == ')' && pro[k - 1] == 0) {\n        cout << \"?\";\n      } else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n    for (int clear = 1; clear <= 101; clear++) {\n      str[clear - 1] = 0;\n      pro[clear - 1] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], c;\n  int i, b[100], j, n, k;\n  for (j = 0;; j++) {\n    i = 0;\n    c = getchar();\n    if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'z') || c == '(' ||\n          c == ')'))\n      break;\n    a[j][i] = c;\n    i++;\n    while ((c = getchar()) != '\\n') {\n      a[j][i] = c;\n      i++;\n    }\n    b[j] = i;\n  }\n  n = j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    putchar('\\n');\n    for (i = 0; i < b[j]; i++) {\n      if ((a[j][i] >= 'a' && a[j][i] <= 'z') ||\n          (a[j][i] >= 'A' && a[j][i] <= 'Z'))\n        a[j][i] = ' ';\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == ')') {\n        for (k = i - 1; k > -1; k--) {\n          if (a[j][k] == '(')\n            break;\n        }\n        if (k != -1) {\n          a[j][k] = ' ';\n          a[j][i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == '(')\n        a[j][i] = '$';\n      if (a[j][i] == ')')\n        a[j][i] = '?';\n    }\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, l, i, k;\n  char str[200] = {0};\n  scanf(\"%d\\n\", &n);\n  while (n) {\n    scanf(\"%s\", str);\n    puts(str);\n    cout << \"\\n\";\n    l = strlen(str);\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (k = i; k < l; k++) {\n          if (str[k] == ')') {\n            str[i] = ' ';\n            str[k] = ' ';\n            k = l;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else {\n        if (str[i] == ')') {\n          str[i] = '?';\n        } else {\n          str[i] = ' ';\n        }\n      }\n    }\n    puts(str);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31315", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nint len, num = 0;\nint f1(int n) {\n  if (n == len - 1) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    return f1(n + 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    if (num == 0)\n      return 0;\n    else\n      return f1(n + 1);\n  } else\n    return f1(n + 1);\n}\nint f2(int n) {\n  if (n == 0) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    if (num == 0)\n      return 0;\n    else\n      return f2(n - 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    return f2(n - 1);\n  } else\n    return f2(n - 1);\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    len = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        printf(\" \");\n      else if (a[i] == '(') {\n        num = 0;\n        if (f1(i) > 0)\n          cout << '$';\n        else\n          cout << ' ';\n      } else {\n        num = 0;\n        if (f2(i) < 0)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(') {\n      Replace(s, i);\n    }\n  }\n  s[x] = '$';\n  return;\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else\n      s[i] = ' ';\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  int n;\n  cin >> n;\n  while (n--) {\n    cin >> live;\n    cout << live << endl;\n    Find(live);\n    printf(\"%s\\n\", live);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int b[100] = {0};\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    char a1[100] = \" \";\n    int len = strlen(a);\n    int i = 0;\n    int lnum = 0, rnum = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[lnum] = i;\n        lnum++;\n      }\n      if (a[i] == ')') {\n        rnum++;\n        if (rnum > lnum) {\n          a1[i] = '?';\n          rnum--;\n        } else {\n          lnum--;\n          rnum--;\n        }\n      }\n    }\n    for (i = 0; i < lnum; i++)\n      a1[b[i]] = '$';\n    for (i = 0; i < len; i++) {\n      if ((a1[i] == '$') || (a1[i] == '?'))\n        cout << a1[i];\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31318", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, j, k;\n  char c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    getchar();\n    scanf(\"%s \", c);\n    s = strlen(c);\n    printf(\"%s\\n\", c);\n    for (j = 0; j < s; j++) {\n      if (c[j] != '(' && c[j] != ')') {\n        c[j] = ' ';\n      }\n      if (c[j] == ')') {\n        for (k = j; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[j] = ' ';\n            c[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < s; j++) {\n      if (c[j] == '(')\n        c[j] = '$';\n      if (c[j] == ')')\n        c[j] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, x;\n  char s[200], a[200];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < strlen(s); j++) {\n      if (s[j] == '(')\n        a[j] = '$';\n      else if (s[j] == ')')\n        a[j] = '?';\n      else\n        a[j] = ' ';\n    }\n\n    for (k = 0; k < strlen(s); k++) {\n      if (a[k] == '?') {\n        for (x = k - 1; x >= 0; x--) {\n          if (a[x] == '$') {\n            a[k] = ' ';\n            a[x] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    int w;\n    for (w = 0; w < strlen(s); w++) {\n      printf(\"%c\", a[w]);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], label[101];\n  while (scanf(\"%s \", str)) {\n\n    int pos[101];\n    int len = strlen(str);\n    int left = 0, right = 0;\n    int pos_i = -1;\n    int i;\n\n    for (i = 0; i <= len - 1; i++) {\n      label[i] = ' ';\n      if (str[i] == '(') {\n        left++;\n        pos[++pos_i] = i;\n      }\n      if (str[i] == ')') {\n        if (left <= right) {\n          label[i] = '?';\n        } else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++) {\n        label[pos[i]] = '$';\n      }\n    }\n    label[len] = '\\0';\n    printf(\"%s\\n\", str);\n    cout << label << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, p, q;\n  for (i = 0; i < n; i++) {\n    char a[101], b[101];\n    scanf(\"%s\", &a);\n    num = strlen(a);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else {\n        if (a[j] == ')') {\n          b[j] = '?';\n        } else {\n          b[j] = ' ';\n        }\n      }\n    }\n\n    for (p = num - 1; p >= 0; p--) {\n      if (b[p] == '$') {\n        for (q = p; q < num; q++) {\n          if (b[q] == '?') {\n            b[q] = ' ';\n            b[p] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < num; j++) {\n\n      printf(\"%c\", a[j]);\n    }\n    printf(\"\\n\");\n    for (j = 0; j < num; j++) {\n\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n    p = 0;\n    q = 0;\n  }\n}\n"}
{"label": "17", "index": "31322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], flag[101];\n  while (cin.getline(str, 101)) {\n    cout << str << endl;\n    int len, num = 0;\n    len = strlen(str);\n    int i, j;\n    for (i = 0; i < len; i++)\n      flag[i] = ' ';\n    flag[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        num++;\n        flag[i] = '$';\n      }\n      if (str[i] == ')') {\n        num--;\n        if (num >= 0) {\n          for (j = i - 1; j >= 0; j--)\n            if (str[j] == '(') {\n              flag[j] = ' ';\n              str[j] = ' ';\n              break;\n            }\n        } else {\n          flag[i] = '?';\n          num++;\n        }\n      }\n    }\n    printf(\"%s\\n\", flag);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin.getline(in, 101) && in[0] != '\\0') {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    cout << in << endl;\n    printf(\"%s\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31324", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int LeftParenIndex[100];\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    int i, top = 0;\n    puts(str);\n    for (i = 0; str[i]; i++) {\n      if (str[i] == '(')\n        LeftParenIndex[top++] = i;\n      else if (str[i] == ')') {\n        if (top == 0)\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n          str[LeftParenIndex[--top]] = ' ';\n        }\n      } else\n        str[i] = ' ';\n    }\n    for (i = 0; i < top; i++)\n      str[LeftParenIndex[i]] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31325", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char word[105], sign[105];\n  int num = 0, i, len;\n  while (cin.getline(word, 105)) {\n    num = 0;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      sign[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        num++;\n      if (word[i] == ')') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '?';\n      }\n    }\n    num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (word[i] == ')')\n        num++;\n      if (word[i] == '(') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '$';\n      }\n    }\n    sign[len] = '\\0';\n    cout << word << endl;\n    cout << sign << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char z[101];\n  int i, j, l[101], r[101];\n  while (scanf(\"%s\", z) != EOF) {\n    for (i = 0; i < 101; i++) {\n      l[i] = 0;\n      r[i] = 0;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (z[i] == '(')\n        l[i] = 1;\n      if (z[i] == ')')\n        r[i] = 1;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] == 1) {\n        for (j = i + 1; j < strlen(z); j++) {\n          if (l[j] == 1)\n            l[i]++;\n          if (r[j] == 1)\n            l[i]--;\n          if (l[i] == 0) {\n            r[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", z);\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] != 0)\n        printf(\"$\");\n      else if (r[i] != 0)\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a;\nchar s1[101], s2[101];\nint main() {\n  int n, l, i, j;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++) {\n    memset(s1, 0, 101);\n    memset(s2, 0, 101);\n    scanf(\"%s\", s1);\n    a = strlen(s1);\n    int k[100] = {0}, b = 0;\n    for (i = 0; i < a; i++) {\n      if (s1[i] == '(') {\n        for (j = i; j < a; j++) {\n          if (s1[j] == '(')\n            k[i]++;\n          else if (s1[j] == ')')\n            k[i]--;\n        }\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (s1[j] == ')')\n            k[i]++;\n          else if (s1[j] == '(')\n            k[i]--;\n        }\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (s1[i] == ')') {\n        b = 0;\n        for (j = i - 1; j >= 0; j--)\n          if (s1[j] == ')' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == '(') {\n        b = 0;\n        for (j = i + 1; j < a; j++)\n          if (s1[j] == '(' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (k[i] > 0) {\n        if (s1[i] == '(')\n          s2[i] = '$';\n        else if (s1[i] == ')')\n          s2[i] = '?';\n      } else\n        s2[i] = ' ';\n    }\n    printf(\"%s\\n\", s1);\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s2[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31328", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[110];\n  char b[110];\n  char c[110];\n  while (cin >> a) {\n    strcpy(b, a);\n    strcpy(c, a);\n    int i, j;\n    int n = strlen(a);\n\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[j] = 99;\n            b[i] = b[j] = 32;\n            break;\n          }\n        }\n        if (j == n) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] != 32 && b[i] != ')' && b[i] != '$')\n        b[i] = 32;\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    printf(\"%s \", c);\n    printf(\"%s \", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31329", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105] = {0}, b[105] = {0}, c[105] = {0};\n  int len;\n  int i = 0, j = 0;\n  while (cin >> a) {\n\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      c[i] = a[i];\n    for (i = 0; i < len; i++) {\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[i] = '.';\n            c[j] = '.';\n            break;\n          }\n        }\n        if (j == -1) {\n          b[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        b[i] = '$';\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << ' ';\n      else\n        printf(\"%c\", b[i]);\n    }\n    cout << endl;\n    i = 0;\n    j = 0;\n    memset(a, 0, sizeof(a));\n    memset(b, 0, sizeof(b));\n    memset(c, 0, sizeof(c));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31331", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l;\n  char as[110], bs[110], cs[110];\n  for (k = 0;; k++) {\n    scanf(\"%s\", as);\n    int len = strlen(as);\n    if (strcmp(as, bs) == 0)\n      break;\n    strcpy(bs, as);\n    for (i = 0; i < len; i++)\n      cs[i] = ' ';\n    cs[len] = 0;\n    for (l = 0; l < len; l++) {\n      for (i = l; i < len; i++) {\n        if (as[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (as[j] == '(') {\n              as[i] = ' ';\n              as[j] = ' ';\n              j = 0;\n              i = 0;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (as[i] == '(')\n        cs[i] = '$';\n      else if (as[i] == ')')\n        cs[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", bs, cs);\n    strcpy(bs, as);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, p, j, k, s, l;\n  char a[110], b[110] = {' '};\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    scanf(\"%s\", &a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        s += 1;\n        b[i] = ' ';\n        continue;\n      } else if (a[i] == ')') {\n        if (s > 0) {\n          s -= 1;\n          b[i] = ' ';\n          continue;\n\n        } else if (s == 0)\n          b[i] = '?';\n        continue;\n      } else\n        b[i] = ' ';\n      continue;\n    }\n    s = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        s += 1;\n        continue;\n      } else if (a[i] == '(') {\n        if (s > 0) {\n          s -= 1;\n          continue;\n\n        } else if (s == 0)\n          b[i] = '$';\n        continue;\n      }\n    }\n\n    for (j = 0; j <= l - 1; j++) {\n      cout << a[j];\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i;\n  char s[101], a[101];\n  while (cin >> s) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31334", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, k, l, n;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    cin >> a;\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--)\n          if (b[j] == '$') {\n            b[i] = b[j] = ' ';\n            break;\n          }\n      }\n    }\n    puts(a);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int i, count, j, b[101];\n  while (cin >> s) {\n    count = 0;\n    for (i = 0; i < strlen(s); i++)\n      b[i] = 0;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        c[i] = '$';\n        count++;\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        if (count != 0) {\n          for (j = i; j >= 0; j--) {\n            if (s[j] == '(' && b[j] == -1) {\n              c[j] = ' ';\n              c[i] = ' ';\n              count--;\n              b[j] = 0;\n              break;\n            }\n          }\n        } else\n          c[i] = '?';\n      } else\n        c[i] = ' ';\n    }\n    c[i] = '\u0000';\n    cout << s << \" \" << c << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, x = 0, y, z;\n  char c[105];\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char b[105] = {0};\n\n    cin >> b;\n    m = strlen(b);\n    for (j = 0; j < m; j++) {\n      if (b[j] == '(') {\n        c[j] = '$';\n      } else if (b[j] == ')') {\n        c[j] = '?';\n      } else if (b[j] != '(' && b[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    y = 0;\n    for (j = 0; j < m; j++) {\n      if (c[j] == '?') {\n        z = 0;\n        y++;\n        for (x = j; x >= 0; x--) {\n          if (c[x] == '$') {\n            z++;\n            if (x == j - 1 || y == z) {\n              y--;\n              c[x] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (x == -1) {\n          y--;\n          c[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n    for (j = 0; j < m; j++) {\n      printf(\"%c\", c[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[300];\nint main() {\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (i = 0; i < len; i++) {\n      int b = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = ' ';\n            str[i] = ' ';\n            b = 1;\n            break;\n          }\n        }\n        if (b == 0) {\n          str[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      if (str[i] == ')')\n        str[i] = '?';\n    }\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "31338", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], s1[200];\n  int i, j;\n  int len;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(s1, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(') {\n            break;\n          }\n        }\n        if (j >= 0) {\n          s[i] = ' ';\n          s[j] = ' ';\n        } else {\n          s[i] = '?';\n        }\n\n      } else if (s[i] != '(') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n    }\n    puts(s1);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[1000], st2[1000];\n  while (cin.getline(st, 1000)) {\n    for (int i = 1; i <= strlen(st); i++)\n      st2[i - 1] = ' ';\n    st2[strlen(st)] = '\\0';\n\n    int count = 0, z[1000];\n    for (int i = 1; i <= strlen(st); i++)\n      if (st[i - 1] == '(') {\n        count++;\n        z[count] = i;\n      } else if (st[i - 1] == ')') {\n        if (count > 0) {\n          z[count] = 0;\n          count--;\n        } else {\n          st2[i - 1] = '?';\n        }\n      }\n    for (int i = 1; i <= count; i++)\n      st2[z[i] - 1] = '$';\n    printf(\"%s\\n%s\\n\", st, st2);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31340", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[500][103];\nvoid chuli(int i, int la) {\n  int j, k, flag = 0;\n  for (j = 0; j < la - 1; j++) {\n    if (a[i][j] == '(') {\n      k = j + 1;\n      while (a[i][k] != '(' && a[i][k] != ')' && k < la)\n        k++;\n      if (a[i][k] == ')') {\n        flag = 1;\n        a[i][j] = a[i][k] = ' ';\n      }\n    }\n  }\n  if (flag == 1)\n    chuli(i, la);\n}\nint main() {\n  int n = 0, la[500] = {0}, i, j;\n  char c, b[500][103];\n  while (scanf(\"%c \", &c)) {\n    while (c != '\\n') {\n      a[n][la[n]] = b[n][la[n]] = c;\n      la[n]++;\n      c = getchar();\n    }\n    n++;\n  }\n  for (i = 0; i < n; i++)\n    chuli(i, la[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < la[i]; j++)\n      cout << b[i][j];\n    cout << endl;\n    for (j = 0; j < la[i]; j++) {\n      if (a[i][j] == '(')\n        cout << '$';\n      else if (a[i][j] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    if (i != n - 1)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31341", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  for (char c[101]; cin.getline(c, 101);) {\n    char a[101] = {' '};\n    int len = strlen(c), cnt = 0, left[101] = {0};\n    for (int i = 0; i < len; i++) {\n      if (c[i] != '(' && c[i] != ')')\n        a[i] = ' ';\n      else {\n        if (c[i] == '(') {\n          a[i] = '$';\n          cnt += 1;\n          left[cnt] = i + 1;\n        } else {\n          if (cnt <= 0) {\n            a[i] = '?';\n          } else {\n            a[i] = ' ';\n            a[left[cnt] - 1] = ' ';\n            left[cnt] = 0;\n            cnt -= 1;\n          }\n        }\n      }\n    }\n    cout << c << endl;\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31342", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int left = 0, right = 0;\n  int times = 0, i;\n  char s[101];\n  char c[101];\n  char fakes[101];\n\n  for (times = 0; times == 0; i = 0, left = 0, right = 0) {\n    scanf(\"%s\", s);\n    if (strcmp(fakes, s) == 0 && strlen(fakes) == strlen(s)) {\n      break;\n    }\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(') {\n        left++;\n      }\n      if (s[i] == ')' && left > 0) {\n        left--;\n      } else if (s[i] == ')' && left == 0) {\n        c[i] = '?';\n      }\n    }\n    for (; i >= 0; i--) {\n      if (s[i] == ')') {\n        right++;\n      }\n      if (s[i] == '(' && right > 0) {\n        right--;\n      } else if (s[i] == '(' && right == 0) {\n        c[i] = '$';\n      }\n    }\n    puts(s);\n    printf(\"\\n\");\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (c[i] == '?' || c[i] == '$') {\n        printf(\"%c\", c[i]);\n        c[i] = 0;\n      } else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n    strcpy(fakes, s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], n = ')';\n  int i, j, k, l, m = 0;\n  while (1) {\n\n    cin >> a;\n    if (feof(stdin))\n      break;\n    k = 0;\n    while (1) {\n      n = ')';\n      m = 0;\n      for (i = 0; i < 200; i++) {\n        if (a[i] == '\u0000')\n          goto here;\n        l = 0;\n        for (j = 0; j < k; j++) {\n          if (i == b[j]) {\n            l = 1;\n            break;\n          }\n        }\n        if (l)\n          continue;\n        else if (a[i] != '(' && a[i] != ')')\n          continue;\n        else if (n == '(' && a[i] == ')') {\n          b[k] = m;\n          b[k + 1] = i;\n          k = k + 2;\n          break;\n        }\n        m = i;\n        n = a[i];\n      }\n    }\n  here:\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000') {\n        printf(\" \");\n        break;\n      }\n      m = 0;\n      for (j = 0; j < k; j++) {\n        if (i == b[j]) {\n          m = 1;\n          break;\n        }\n      }\n      if (m == 1)\n        printf(\" \");\n      else if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (cin >> str) {\n    cout << str << endl;\n    n = strlen(str);\n    match(0, n, str);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else {\n    if (str[i] == '(')\n      str[i] = '$';\n    else\n      str[i] = ' ';\n  }\n  match(i + 1, n, str);\n  return 0;\n}\n"}
{"label": "17", "index": "31345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() { \n  char string1[101];\n  while (cin.getline(string1, 101)) { \n\n    cout << string1 << endl;\n\n    for (int i = 1; i < strlen(string1); i++) {\n      if (string1[i] == ')') {\n        \n        \n        \n        \n        for (int j = i - 1; j >= 0; j--) {\n          if (string1[j] == '(') { \n            string1[i] = ' ';\n            string1[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int k = 0; k < strlen(string1); k++) {\n      if (string1[k] == '(')\n        cout << \"$\";\n      else if (string1[k] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[101];\nint l;\nint f(int k) {\n  int i, j;\n  for (i = k; i >= 0; i--)\n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') {\n          s[i] = 'a';\n          s[j] = 'a';\n          k = i;\n          return f(k);\n        }\n    }\n  for (i = 0; i < l; i++) {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      cout << ' ';\n  }\n  cout << endl;\n  return 0;\n}\n\nint main() {\n  while (cin.getline(s, 101, '\\n')) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    f(l - 1);\n    memset(s, '\\0', sizeof(s));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31347", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000] = {0}, b[1000] = {0};\n  int i, j;\n  while (scanf(\"%s \", a)) {\n    for (i = 0; a[i] != '\u0000'; i++) {\n      b[i] = a[i];\n    }\n    b[i] = '\u0000';\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if (b[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '(') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; b[i] != '\u0000'; i++) {\n      if ((b[i] >= 'a' && b[i] <= 'z') || (b[i] >= 'A' && b[i] <= 'Z'))\n        b[i] = ' ';\n      else if (b[i] == '(')\n        b[i] = '$';\n      else {\n        if (b[i] == ')')\n          b[i] = '?';\n      }\n    }\n    printf(\"%s\\n\", a);\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[200], str1[200];\n  while (scanf(\"%s\", str1) != EOF) {\n    int m;\n    m = strlen(str1);\n    strcpy(str, str1);\n    int i, j;\n    for (i = 1; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (i + j < m) {\n          if (str[j] == '(' && str[j + i] == ')') {\n            str[j] = 'a';\n            str[j + i] = 'a';\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\\n\", str1);\n    cout << str << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int l, i, j, p = 0;\n  while (scanf(\"%s\", a) != EOF) {\n\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      p = 0;\n      if (a[i] == '(') {\n        for (j = i; j < l; j++) {\n          if (a[j] == '(')\n            p++;\n          if (a[j] == ')')\n            p--;\n          if (p == 0)\n            break;\n        }\n        if (p != 0)\n          a[i] = '$';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = l - 1; i >= 0; i--) {\n      p = 0;\n      if (a[i] == ')') {\n\n        for (j = i; j >= 0; j--) {\n\n          if (a[j] == ')')\n            p++;\n          if (a[j] == ' ')\n            p--;\n          if (p == 0) {\n            break;\n          }\n        }\n        if (p != 0)\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        a[i] = ' ';\n    }\n\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar b[110];\nchar a[110];\nint opr(int i) {\n  int j;\n  for (j = i - 1; j >= 0; j--) {\n    if (b[j] == '$') {\n      b[j] = ' ';\n      b[i] = ' ';\n      break;\n    }\n  }\n  return 0;\n}\nvoid tag(char *a, char *b) {\n  int l = strlen(a);\n  int i;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  b[l] = '\\0';\n}\nint main() {\n  int i, l;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    cout << a << \"\\n\";\n    tag(a, b);\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?') {\n        opr(i);\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][100];\n  int c[100], i, j, k = 0; \n  while ((scanf(\"%s\", s[k])) != EOF) {\n    puts(s[k]);\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (s[k][i] == '(')\n        c[i] = -1;\n      else if (s[k][i] == ')')\n        c[i] = 1;\n      else\n        c[i] = 0;\n    }\n    for (i = 1; i < strlen(s[k]); i++) \n      for (j = 0; j < strlen(s[k]) - i; j++)\n        if (c[j] == -1 && c[j + i] == 1) {\n          c[j] = 0;\n          c[j + i] = 0;\n        }\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (c[i] == 0)\n        printf(\" \");\n      else if (c[i] == -1)\n        printf(\"$\");\n      else if (c[i] == 1)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31352", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200];\n  int n, i, j, k, m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    puts(a);\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == ')') {\n        for (m = j; m >= 0; m--)\n          if (a[m] == '(') {\n            a[m] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n    }\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        a[j] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[100];\n  int z, y, i, j, l, t, m;\n  while (cin >> sen) {\n    z = 0;\n    y = 0;\n    l = strlen(sen);\n    printf(\"%s \", sen);\n\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        z++;\n      }\n      if (sen[i] == ')') {\n        y++;\n      }\n    }\n    if (z > y) {\n      m = y;\n    } else {\n      m = z;\n    }\n\n    for (i = 0; i < m; i++) {\n      j = 1;\n      for (t = 0; t < l; t++) {\n        if (sen[t] == '(') {\n          j = 0;\n          z = t;\n        }\n        if (sen[t] == ')') {\n          if (j == 0) {\n            sen[z] = '0';\n            sen[t] = '0';\n          }\n          j = 1;\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        printf(\"$\");\n      } else if (sen[i] == ')') {\n        printf(\"?\");\n      } else if ((sen[i] != '(') && (sen[i] != ')')) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[101] = {0};\n  while (scanf(\"%s \", words)) {\n    cout << words << endl;\n    int i = 0, j = 0;\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] != '(' && words[i] != ')')\n        words[i] = ' ';\n      if (words[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (words[j] == '(') {\n            words[j] = ' ';\n            words[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] == '(')\n        words[i] = '$';\n      if (words[i] == ')')\n        words[i] = '?';\n    }\n    cout << words << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[120][102], b[120][102];\n  int n, i, j, k, r, d, l, cao;\n  for (i = 1; i <= 200; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    for (k = 0; k <= strlen(a[j]) - 1; k++) {\n\n      if (a[j][k] == ')') {\n        if (k == 0) {\n          l = 0;\n        }\n        for (r = 0, cao = 0; r <= k - 1; r++) {\n          if (a[j][r] == '(') {\n            for (d = r + 1, l = 1; d <= k - 1; d++) {\n              if (a[j][d] == ')')\n                l--;\n              else if (a[j][d] == '(') {\n                l++;\n              }\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '?';\n      } else if (a[j][k] == '(') {\n        if (k == strlen(a[j]) - 1) {\n          l = 0;\n        }\n        for (r = k + 1, cao = 0; r <= strlen(a[j]) - 1; r++) {\n          if (a[j][r] == ')') {\n            for (d = r - 1, l = 1; d >= k + 1; d--) {\n              if (a[j][d] == '(')\n                l--;\n              else if (a[j][d] == ')')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '$';\n      } else\n        b[j][k] = ' ';\n    }\n  }\n  for (j = 1; j <= i - 1; j++) {\n    cout << a[j] << \" \" << b[j] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31356", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, l, j, n = 1;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        for (k = j; k >= -1; k--) {\n          if (k == -1) {\n            a[j] = '?';\n            break;\n          }\n          if (a[k] == '$') {\n            a[k] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n\n      } else\n        a[j] = ' ';\n    }\n\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101];\n  char kuohao[101] = {0};\n  int i, j, len;\n\n  while (scanf(\"%s\", s) > 0) {\n    for (i = 0;; i++) {\n      if (s[i] == '(')\n        kuohao[i] = 1;\n      else if (s[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (kuohao[j] == 1) {\n            kuohao[j] = 0;\n            break;\n          }\n        }\n        if (j < 0)\n          kuohao[i] = 3;\n      } else if (s[i] == '\\0')\n        break;\n    }\n    printf(\"%s\\n\", s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (kuohao[i] == 0)\n        printf(\" \");\n      else if (kuohao[i] == 1)\n        cout << \"$\";\n      else if (kuohao[i] == 3)\n        printf(\"?\");\n    }\n    cout << \"\\n\";\n    for (i = 0; i < len; i++)\n      kuohao[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int left = 0;\n    int p[105], t = 0;\n    int k, len;\n    char a[105];\n    char b[105];\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (k = 0; k < len; k++)\n      b[k] = ' ';\n    b[len] = '\\0';\n    for (k = 0; k < len; k++) {\n      if (a[k] == '(') {\n        b[k] = '$';\n        p[t] = k;\n        t++;\n        left++;\n      }\n      if (a[k] == ')') {\n        if (left != 0) {\n          t--;\n          b[p[t]] = ' ';\n          left--;\n        } else {\n          b[k] = '?';\n        }\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    printf(\"%s\", b);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, p, m;\n  char a[200], b[200], c[200];\n  i = 0;\n  while (scanf(\"%s \", a)) {\n    puts(a);\n    k = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[strlen(a)] = '\u0000';\n    c[strlen(a)] = '\u0000';\n    for (i = 0; i < strlen(a); i++) {\n      c[i] = b[i];\n    }\n    for (p = 0; p < strlen(a); p++) {\n      k = 0;\n      for (i = 0; i < strlen(a); i++) {\n        if (b[i] == ' ')\n          continue;\n        else if (b[i] == '$') {\n          k++;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (b[j] == ' ')\n              continue;\n            else if (b[j] == '?') {\n              b[i] = ' ';\n              b[j] = ' ';\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            } else if (b[j] == '$')\n              break;\n          }\n        } else if (b[i] == '?' && k == 0)\n          c[i] = '?';\n      }\n    }\n    puts(c);\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31360", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char s[105], a[105];\n    int i, k = 0, stack[105];\n    memset(a, ' ', sizeof(a));\n    cin >> s;\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        stack[k++] = -i - 1;\n      else if (s[i] == ')')\n        if (k == 0 || stack[k - 1] > 0)\n          stack[k++] = i + 1;\n        else\n          k--;\n    for (i = 0; i < k; i++)\n      if (stack[i] > 0)\n        a[stack[i] - 1] = '?';\n      else\n        a[-stack[i] - 1] = '$';\n    a[strlen(s)] = '\\0';\n    cout << s << endl << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zuok(char c[], int j, int len) {\n  int i, zuo = 1, you = 0;\n  for (i = j + 1; i < len; i++) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')')\n      you++;\n\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\nint youk(char c[], int j, int len) {\n  int i, you = 1, zuo = 0;\n  for (i = j - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  getchar();\n\n  int i;\n  for (i = 0; i < n; i++) {\n    char c[200];\n    scanf(\"%s\", c);\n    getchar();\n\n    printf(c);\n\n    printf(\"\\n\");\n\n    int len = strlen(c);\n\n    int j;\n\n    for (j = 0; j < len; j++) {\n      if (c[j] == '(') {\n        if (!zuok(c, j, len)) {\n          putchar('$');\n        } else\n          printf(\" \");\n      }\n\n      else if (c[j] == ')') {\n        if (!youk(c, j, len)) {\n          putchar('?');\n        } else\n          putchar(' ');\n      }\n\n      else {\n        putchar(' ');\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len;\n  while (scanf(\"%s\", a) != EOF) {\n    puts(a);\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')') {\n        a[i] = ' ';\n      } else if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == '(') {\n            break;\n          } else if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          } else if (a[j] == ')')\n            break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')')\n        a[i] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31363", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, n, len, left = 0, t = 0;\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0)\n          b[j] = '?';\n        else {\n          t--;\n          b[c[t]] = ' ';\n          b[j] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++)\n      printf(\"%c\", b[h]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31364", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110];\n  int len, mark, sign = 0, s = 0;\n  while (cin.getline(a, 110, '\\n')) {\n    len = strlen(a);\n    for (int i = 0; i <= len - 1; i++)\n      b[i] = a[i];\n    for (int j = 1; j <= len; j++) {\n      mark = 0;\n      sign = 0;\n      s = 0;\n      for (int i = 0; i < len; i++) {\n        if (a[i] == '(') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (mark == len - 1) {\n        a[mark] = '$';\n      }\n      if (s != 0) {\n        for (int i = mark + 1; i < len; i++) {\n          if (a[i] == ')') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '$';\n      }\n      sign = 0;\n      mark = 0;\n      s = 0;\n      for (int i = len - 1; i >= 0; i--) {\n        if (a[i] == ')') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (s != 0) {\n        if (mark == 0) {\n          a[mark] = '?';\n        }\n      }\n      if (s != 0) {\n        for (int i = mark - 1; i >= 0; i--) {\n          if (a[i] == '(') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '?';\n      }\n    }\n    for (int i = 0; i < len - 1; i++)\n      cout << b[i];\n    printf(\"%c\\n\", b[len - 1]);\n    for (int i = 0; i < len - 1; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        cout << ' ';\n      else\n        cout << a[i];\n    }\n    if (a[len - 1] != '?' && a[len - 1] != '$')\n      cout << ' ' << endl;\n    else\n      cout << a[len - 1] << endl;\n    memset(a, '\\0', sizeof(a));\n    memset(b, '\\0', sizeof(b));\n    mark = 0;\n    sign = 0;\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, s;\nchar a[101];\nvoid f(int x) {\n  a[x] = '$';\n  if (x < s - 1) {\n    for (int j = x + 1; j < s; j++) {\n      if (a[j] == '(') {\n        i = j;\n        f(j);\n      } else if (a[j] == ')') {\n        a[x] = ' ', a[j] = ' ';\n        return;\n      } else if (a[j] != '$')\n        a[j] = ' ';\n    }\n  }\n  return;\n}\nint main() {\n  int j = 0;\n  while (cin.getline(a, 101)) {\n    if (j != 0)\n      cout << endl;\n    printf(\"%s\", a);\n    s = strlen(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        f(i);\n      else {\n        if (a[i] == ')')\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    j++;\n    cout << endl << a;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar c[110];\nint Try() {\n  int i, j;\n  int L = -1, R = -1;\n  for (i = 0; i <= strlen(c) - 1; ++i) {\n    if (c[i] == '(')\n      L = i;\n  }\n  for (j = strlen(c) - 1; j > L; --j) {\n    if (c[j] == ')')\n      R = j;\n  }\n  if (L != -1 || R != -1) {\n    if (L == -1)\n      c[R] = '?';\n\n    else if (R == -1)\n      c[L] = '$';\n    else if (L < R) {\n      c[L] = ' ';\n      c[R] = ' ';\n    } else if (L > R) {\n      c[L] = '$';\n      c[R] = '?';\n    }\n    Try();\n  }\n  if (L == -1 && R == -1)\n    return 1;\n}\nint main() {\n  int k;\n  while (cin >> c) {\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      if (c[k] != '(' && c[k] != ')')\n        c[k] = ' ';\n    }\n    Try();\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31367", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char s[101], zhui = '#';\n    int count[101] = {0};\n    int i = 0, j = 0, sl = 0, p = 0, q = 0;\n    for (i = 0; i < 101; i++) {\n      s[i] = '#';\n    }\n\n    cin.getline(s, 101);\n    sl = strlen(s);\n    if (s[0] == '\\0') {\n      break;\n    }\n\n    for (i = 0; i < sl; i++) {\n      if (s[i] == '(') {\n        count[i] = 1;\n      } else if (s[i] == ')') {\n        count[i] = 2;\n      } else {\n        continue;\n      }\n    }\n\n    for (i = sl - 1; i >= 0; i--) {\n      if (count[i] == 1) {\n        for (j = i + 1; j < sl; j++) {\n          if (count[j] == 2) {\n            count[i] = 0;\n            count[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n\n    int dingzuo[101] = {0};\n    int dingyou[101] = {0};\n    int flag = 0;\n    int count0 = 0;\n    for (i = 0; i < sl; i++) {\n      if (count[i] == 1) {\n        dingzuo[i] = 1;\n        flag = 1;\n        count0++;\n      } else if (count[i] == 2) {\n        dingyou[i] = 1;\n        flag = 1;\n        count0++;\n      } else {\n        continue;\n      }\n    }\n\n    int k = count0;\n    for (i = 0; i < sl; i++) {\n      cout << s[i];\n    }\n    if (flag == 1) {\n      cout << endl;\n      for (i = 0; i < sl; i++) {\n        if (dingzuo[i] == 1) {\n          printf(\"$\");\n          count0--;\n        } else if (dingyou[i] == 1) {\n          cout << \"?\";\n          count0--;\n        } else {\n          if ((count0 > 0) && (count0 < k)) {\n            printf(\" \");\n          }\n        }\n      }\n      cout << endl;\n    } else {\n      cout << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    printf(\"%s \", a);\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        printf(\"$\");\n        continue;\n      }\n      if (a[i] == ')') {\n        printf(\"?\");\n        continue;\n      }\n      cout << \" \";\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a;\nchar s1[101], s2[101];\nint main() {\n  int n, l, i, j;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++) {\n    memset(s1, 0, 101);\n    memset(s2, 0, 101);\n    scanf(\"%s\", s1);\n    a = strlen(s1);\n    int k[100] = {0}, b = 0;\n    for (i = 0; i < a; i++) {\n      if (s1[i] == '(') {\n        for (j = i; j < a; j++) {\n          if (s1[j] == '(')\n            k[i]++;\n          else if (s1[j] == ')')\n            k[i]--;\n        }\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (s1[j] == ')')\n            k[i]++;\n          else if (s1[j] == '(')\n            k[i]--;\n        }\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (s1[i] == ')') {\n        b = 0;\n        for (j = i - 1; j >= 0; j--)\n          if (s1[j] == ')' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == '(') {\n        b = 0;\n        for (j = i + 1; j < a; j++)\n          if (s1[j] == '(' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (k[i] > 0) {\n        if (s1[i] == '(')\n          s2[i] = '$';\n        else if (s1[i] == ')')\n          s2[i] = '?';\n      } else\n        s2[i] = ' ';\n    }\n    cout << s1 << \"\\n\";\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s2[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "31370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i;\n  char s[1001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n\n    char t[1001] = {0};\n    int j, k;\n    int len = strlen(s);\n\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        int zo = 1, yb = 0;\n        for (k = j + 1; k < len; k++) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')')\n            yb++;\n\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n\n          s[j] = 0;\n          t[j] = '$';\n        }\n      }\n\n      if (s[j] == ')') {\n        int zo = 0, yb = 1;\n        for (k = j - 1; k >= 0; k--) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n          t[j] = '?';\n          s[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == 0) {\n        printf(\"(\");\n      } else if (s[j] == 1) {\n        printf(\")\");\n      } else\n        printf(\"%c\", s[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j < len; j++) {\n      if (t[j] == '?' || t[j] == '$') {\n        printf(\"%c\", t[j]);\n      } else\n        printf(\" \");\n    }\n\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid find(char a[], int n, int m) {\n  int i;\n  if (a[m] != ')' && m < n) {\n    find(a, n, m + 1);\n  } \n  if (a[m] == ')' && m < n) {\n    for (i = m; i >= 0; i--) {\n      if (a[i] == '(') {\n        a[i] = ' ';\n        a[m] = ' ';\n        break;\n      } \n    }\n    find(a, n, m + 1); \n  }\n}\nint main() {\n  int n;\n  char a[200];\n  while (cin >> a) \n  {\n    cout << a << endl; \n    n = strlen(a);\n    find(a, n, 0); \n    for (int k = 0; k < n; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } \n      else {\n        if (a[k] == ')') \n        {\n          a[k] = '?';\n        } else {\n          if (a[k] != '(' && a[k] != ')') \n          {\n            a[k] = ' ';\n          }\n        }\n      }\n    }\n    cout << a << endl; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, u, p;\n  char c;\n  for (;;) {\n    p = 1;\n    char ch[102] = {'0'};\n    i = 2;\n    c = getchar();\n    if (c == -1)\n      break;\n    else\n      ch[1] = c;\n    while ((c = getchar()) != '\\n') {\n      ch[i] = c;\n      i++;\n    }\n    i--;\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n    while (p == 1) {\n      p = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (ch[j] == '(') {\n          for (k = j + 1; k <= i; k++) {\n            u = 1;\n            if (ch[k] == '(') {\n              break;\n            } else {\n              if (ch[k] == ')') {\n                u = 0;\n                break;\n              }\n            }\n          }\n          if (u == 0) {\n            ch[j] = 0;\n            ch[k] = 0;\n            p = 1;\n          }\n        }\n      }\n    }\n    for (j = 1; j <= i; j++) {\n      if (ch[j] == '(') {\n        ch[j] = '$';\n      } else {\n        if (ch[j] == ')') {\n          ch[j] = '?';\n        } else\n          ch[j] = ' ';\n      }\n    }\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31373", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[101];\nint c[101];\nvoid match(int i, int len) {\n  int k = i + 1;\n  if (c[i] != 0) {\n    while (k < len) {\n      if (a[k] == '(' && c[k] == 1) {\n        match(k, len);\n      }\n      if (a[k] == ')' && c[i] == 1 && c[k] == -1) {\n        c[i] = 0;\n        c[k] = 0;\n      }\n      k++;\n    }\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", &a);\n    int len = strlen(a);\n    for (int j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        c[j] = 1;\n      } else if (a[j] == ')') {\n        c[j] = -1;\n      } else {\n        c[j] = 0;\n      }\n    }\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1) {\n        for (int k = j + 1; k < len; k++) {\n          if (c[k] == 1) {\n            break;\n          }\n          if (c[k] == -1) {\n            c[k] = 0;\n            c[j] = 0;\n            j = -1;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1)\n        printf(\"$\");\n      if (c[j] == -1)\n        printf(\"?\");\n      if (c[j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31374", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[200], b[200];\n  int c[200];\n  int i, j, k, t, m, n;\n  while (cin >> a) {\n\n    k = strlen(a);\n    m = 0;\n    n = 0;\n    for (i = 0; i < k; i++) {\n      cout << a[i];\n      if (i == k - 1)\n        printf(\"\\n\");\n      if (a[i] != '(' && a[i] != ')')\n        b[i] = ' ';\n      else if (a[i] == ')') {\n        c[m] = i;\n        m++;\n      }\n    }\n    n = m;\n    for (i = 0; i < n; i++) {\n      char *p = &a[c[i]];\n      t = 0;\n      for (j = 0; j <= c[i]; j++)\n        if (*p == '(') {\n          t = 1;\n          b[c[i] - j] = ' ';\n          b[c[i]] = ' ';\n          a[c[i] - j] = ' ';\n          break;\n        } else\n          p--;\n      if (t == 0)\n        b[c[i]] = '?';\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      cout << b[i];\n      if (i == k - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar a[200], b[200];\nint l;\nvoid f36(int i) {\n  int j;\n  for (j = i + 1; j < l; j++) {\n    if (b[j] != 32) {\n      if (b[j] == 63) {\n        b[j] = 32;\n        b[i] = 32;\n      }\n      break;\n    }\n  }\n}\nint g(void) {\n\n  cin >> a;\n  if (a[0] == 0)\n    return 0;\n  else\n    return 1;\n}\nvoid k(void) {\n  l = strlen(a);\n  int i, n = 0, p;\n  for (i = 0; i < l; i++) {\n    b[i] = 32;\n    if (a[i] == 40) {\n      b[i] = 36;\n      n = n + 1;\n    }\n    if (a[i] == 41) {\n      b[i] = 63;\n      n = n + 1;\n    }\n  }\n  for (p = 1; p <= n; p++)\n    for (i = 0; i < l; i++) {\n      if (b[i] == 36)\n        f36(i);\n    }\n  cout << a << \" \";\n  for (i = 0; i < l; i++)\n    printf(\"%c\", b[i]);\n  printf(\" \");\n  a[0] = 0;\n}\nint main() {\n  int n = 1;\n  while (n == 1) {\n    n = g();\n    if (n == 0)\n      break;\n    k();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[120][102], b[120][102];\n  int n, i, j, k, r, d, l, cao;\n  for (i = 1; i <= 200; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    for (k = 0; k <= strlen(a[j]) - 1; k++) {\n\n      if (a[j][k] == ')') {\n        if (k == 0) {\n          l = 0;\n        }\n        for (r = 0, cao = 0; r <= k - 1; r++) {\n          if (a[j][r] == '(') {\n            for (d = r + 1, l = 1; d <= k - 1; d++) {\n              if (a[j][d] == ')')\n                l--;\n              else if (a[j][d] == '(')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '?';\n      } else if (a[j][k] == '(') {\n        if (k == strlen(a[j]) - 1) {\n          l = 0;\n        }\n        for (r = k + 1, cao = 0; r <= strlen(a[j]) - 1; r++) {\n          if (a[j][r] == ')') {\n            for (d = r - 1, l = 1; d >= k + 1; d--) {\n              if (a[j][d] == '(')\n                l--;\n              else if (a[j][d] == ')')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '$';\n      } else\n        b[j][k] = ' ';\n    }\n  }\n  for (j = 1; j <= i - 1; j++) {\n    cout << a[j] << \" \" << b[j] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31377", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void kuo(char c[]);\n  void pipei(char c[], char a[]);\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    char c[200] = {'\u0000'}, a[200] = {'\u0000'};\n\n    cin >> c;\n    printf(\"%s \", c);\n    kuo(c);\n    pipei(c, a);\n  }\n  return 0;\n}\nvoid pipei(char c[], char a[]) {\n  char *p, *q;\n  for (p = c, q = a; *p != '\u0000'; p++, q++) {\n    if (*p != '(' && *p != ')')\n      *q = ' ';\n    if (*p == ')')\n      *q = '?';\n    if (*p == '(')\n      *q = '$';\n  }\n  *q = *p;\n  printf(\"%s \", a);\n}\nvoid kuo(char c[]) {\n  char *p, *q, *i, *t;\n  int s;\n  for (;;) {\n    s = 0;\n    for (i = c; *i != '\u0000'; i++)\n      for (p = i; *p != '\u0000'; p++) {\n        if (*p == '(')\n          for (q = p + 1; *q != '\u0000'; q++) {\n            if (*q == '(')\n              break;\n            else if (*q == ')') {\n              *p = 'a';\n              *q = 'a';\n              break;\n            }\n          }\n      }\n    for (q = c; *q != '\u0000'; q++) {\n      for (t = q; *t != '\u0000'; t++) {\n        if (*q == '(' && *t == ')')\n          s = 1;\n      }\n    }\n    if (s == 0)\n      break;\n  }\n}\n"}
{"label": "17", "index": "31378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, e, x, i, t, j, k;\n  char s[102];\n  scanf(\"%d\", &n);\n  for (e = 0; e < n; e++) {\n    scanf(\"%s\", s);\n    printf(\"%s \", s);\n    x = strlen(s);\n    for (i = 0; i < x; i++) {\n      if (s[i] != '(' && s[i] != ')') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < x; j++) {\n          if (s[j] == ')') {\n            t = 0;\n            for (k = i + 1; k < j; k++) {\n              if (s[k] != ' ') {\n                t = 1;\n                break;\n              }\n            }\n            if (t == 0) {\n              s[i] = ' ';\n              s[j] = ' ';\n              i = -1;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << \" \";\n  }\n}\n"}
{"label": "17", "index": "31379", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {'\\0'};\n  while (cin.getline(str, 110, '\\n')) {\n    int length;\n    length = strlen(str);\n    for (int i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = length - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i + 1; j < length; j++) {\n          if (str[j] == '?') {\n            str[j] = ' ';\n            str[i] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    for (int i = 0; i < length; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31380", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  while (cin >> a) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        cout << '?';\n      else {\n        cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, f1 = 0;\n  char line[101], copy[101];\n  while (scanf(\"%s \", line)) {\n    strcpy(copy, line);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == ')')\n        line[i] = '?';\n      if (line[i] == '(') {\n        f1 = 1;\n        for (j = i + 1; j < strlen(line); j++) {\n          if (line[j] == '(')\n            f1++;\n          if (line[j] == ')') {\n            f1--;\n            if (f1 == 0) {\n              line[i] = ' ';\n              line[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (f1 != 0)\n          line[i] = '$';\n      }\n    }\n    cout << copy << endl;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '$' || line[i] == '?')\n        cout << line[i];\n      else\n        printf(\" \");\n    }\n    cout << endl;\n    memset(line, 0, sizeof(line));\n    memset(copy, 0, sizeof(copy));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110], tra[110], mark[110];\n  int n, i, j, p, q;\n  while (scanf(\"%s \", str)) {\n    p = q = -1;\n    n = strlen(str);\n    mark[n] = NULL;\n    for (i = 0; i < n; i++) {\n      if (str[i] == '(')\n        p = i;\n    }\n    strcpy(tra, str);\n    for (i = p; i >= 0; i--)\n      if (tra[i] == '(')\n        for (j = i + 1; j < n; j++)\n          if (tra[j] == ')') {\n            tra[i] = tra[j] = 'a';\n            break;\n          }\n    for (i = 0; i < n; i++)\n      if (tra[i] == '(')\n        mark[i] = '$';\n      else if (tra[i] == ')')\n        mark[i] = '?';\n      else\n        mark[i] = ' ';\n    printf(\"%s %s \", str, mark);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int left = 0;\n    int p[105], t = 0;\n    int k, len;\n    char a[105];\n    char b[105];\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (k = 0; k < len; k++)\n      b[k] = ' ';\n    b[len] = '\\0';\n    for (k = 0; k < len; k++) {\n      if (a[k] == '(') {\n        b[k] = '$';\n        p[t] = k;\n        t++;\n        left++;\n      }\n      if (a[k] == ')') {\n        if (left != 0) {\n          t--;\n          b[p[t]] = ' ';\n          left--;\n        } else\n          b[k] = '?';\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    cout << b;\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char str1[120];\n  char str[120];\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    memset(str, '\\0', sizeof(str));\n    cin >> str1;\n    strcpy(str, str1);\n\n    for (int len = 1; len < strlen(str); len++) {\n      for (int j = 0; j < strlen(str) - len; j++) {\n        int k = j + len;\n        if (str[j] == '(' && str[k] == ')') {\n          str[j] = '0';\n          str[k] = '0';\n        }\n      }\n    }\n\n    for (int i1 = 0; str[i1] != '\\0'; i1++) {\n      if (str[i1] == '(') {\n        str[i1] = '$';\n      } else if (str[i1] == ')')\n        str[i1] = '?';\n      else\n        str[i1] = ' ';\n    }\n    cout << str1 << endl;\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];               \n  int s[101], len, k = 0, i; \n  while (cin >> a) {\n    for (len = 0; a[len] != '\\0'; len++)\n      ; \n    cout << a << endl;\n    for (i = 0; i < len; i++) \n    {\n      if (a[i] == '(') \n        s[k++] = i;\n      if (a[i] == ')' && k > 0) \n      {\n        a[s[--k]] = ' ';\n        a[i] = ' ';\n      }\n      if (a[i] != '(' && a[i] != ')') \n        a[i] = ' ';\n      if (a[i] == ')' && k == 0)\n        a[i] = '?';\n    }\n    for (i = k - 1; i >= 0; i--)\n      a[s[i]] = '$';\n    cout << a << endl;\n    memset(a, 0, sizeof(a)); \n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char a[200] = {0};\n    char b[200] = {0};\n\n    cin >> a;\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n\n    for (j = 1; j < k; j++) {\n      if (b[j] == '?') {\n        for (m = j - 1; m >= 0; m--)\n          if (b[m] == '$') {\n            b[m] = ' ';\n            b[j] = ' ';\n            break;\n          }\n      }\n    }\n    cout << a << \" \" << b << \" \";\n  }\n}\n"}
{"label": "17", "index": "31387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1001];\n  int n;\n  while (~scanf(\"%s\", str)) {\n    n = strlen(str);\n    printf(\"%s\", str);\n    printf(\"\\n\");\n    for (int i = 1; i < n; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\", str);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31388", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[200], b[200];\nint l;\nvoid f36(int i) {\n  int j;\n  for (j = i + 1; j < l; j++) {\n    if (b[j] != 32) {\n      if (b[j] == 63) {\n        b[j] = 32;\n        b[i] = 32;\n      }\n      break;\n    }\n  }\n}\nint g(void) {\n\n  scanf(\"%s \", a);\n  if (a[0] == 0)\n    return 0;\n  else\n    return 1;\n}\nvoid k(void) {\n  l = strlen(a);\n  int i, n = 0, p;\n  for (i = 0; i < l; i++) {\n    b[i] = 32;\n    if (a[i] == 40) {\n      b[i] = 36;\n      n = n + 1;\n    }\n    if (a[i] == 41) {\n      b[i] = 63;\n      n = n + 1;\n    }\n  }\n  for (p = 1; p <= n; p++)\n    for (i = 0; i < l; i++) {\n      if (b[i] == 36)\n        f36(i);\n    }\n  printf(\"%s \", a);\n  for (i = 0; i < l; i++) {\n    printf(\"%c\", b[i]);\n  }\n  printf(\" \");\n  a[0] = 0;\n}\nint main() {\n  int n = 1;\n  while (n == 1) {\n    n = g();\n    if (n == 0)\n      break;\n    k();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31389", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid print(int n1, int z[500], char s[500]);\nvoid search(int a[500], int h);\nchar s[500];\nint z[500];\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    int h, a, l1 = 0, l2 = 0;\n    h = strlen(s);\n    for (a = 0; a <= h - 1; a++) {\n      if (s[a] == '(') {\n        z[a] = 1;\n      } else {\n        if (s[a] == ')') {\n          z[a] = 2;\n        } else\n\n        {\n          z[a] = 0;\n        }\n      }\n    }\n    search(z, h);\n    print(h, z, s);\n  }\n  return 0;\n}\nvoid search(int z[500], int h) {\n  int k, m, n;\n  for (m = 1; m <= h - 1; m++)\n    for (k = 0; (k + m) <= (h - 1); k++)\n      if ((z[k] == 1) && (z[k + m] == 2)) {\n        z[k] = 0;\n        z[k + m] = 0;\n      }\n}\nvoid print(int n1, int z[500], char s[500]) {\n  int a;\n  for (a = 0; a < n1; a++) {\n    printf(\"%c\", s[a]);\n  }\n  printf(\"\\n\");\n  for (a = 0; a < n1; a++) {\n    if (z[a] == 0)\n      printf(\" \");\n    if (z[a] == 1)\n      printf(\"$\");\n    if (z[a] == 2)\n      printf(\"?\");\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "17", "index": "31390", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], c;\n  int i, b[100], j, n, k;\n  for (j = 0;; j++) {\n    i = 0;\n    c = getchar();\n    if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'z') || c == '(' ||\n          c == ')'))\n      break;\n    a[j][i] = c;\n    i++;\n    while ((c = getchar()) != '\\n') {\n      a[j][i] = c;\n      i++;\n    }\n    b[j] = i;\n  }\n  n = j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    putchar('\\n');\n    for (i = 0; i < b[j]; i++) {\n      if ((a[j][i] >= 'a' && a[j][i] <= 'z') ||\n          (a[j][i] >= 'A' && a[j][i] <= 'Z'))\n        a[j][i] = ' ';\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == ')') {\n        for (k = i - 1; k > -1; k--) {\n          if (a[j][k] == '(')\n            break;\n        }\n        if (k != -1) {\n          a[j][k] = ' ';\n          a[j][i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == '(')\n        a[j][i] = '$';\n      if (a[j][i] == ')')\n        a[j][i] = '?';\n    }\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31391", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, tmp1, tmp2 = 1;\n  do {\n    char s[101];\n    char st[101];\n    char r1[101];\n    int r2[101];\n    int d, f = 0, pi = 0;\n    if (scanf(\"%s\", s) != EOF) {\n      f = 1;\n      d = strlen(s);\n      strcpy(st, s);\n      for (j = 0; j < d; j++) {\n        if (pi == 0 && (s[j] == '(' || s[j] == ')')) {\n          r1[0] = s[j];\n          r2[0] = j;\n          pi += 1;\n        } else {\n          if ((s[j] == '(' || s[j] == ')')) {\n            if (r1[pi - 1] == '(' && s[j] == ')') {\n              s[r2[pi - 1]] = ' ';\n              s[j] = ' ';\n              pi -= 1;\n            } else {\n              r1[pi] = s[j];\n              r2[pi] = j;\n              pi += 1;\n            }\n          } else\n            s[j] = ' ';\n        }\n      }\n      for (j = 0; j < pi; j++) {\n        if (r1[j] == '(')\n          s[r2[j]] = '$';\n        else {\n          s[r2[j]] = '?';\n        }\n      }\n      printf(\"%s\\n%s\\n\", st, s);\n    } else\n      break;\n  } while (tmp2);\n\n  return 0;\n}\n"}
{"label": "17", "index": "31392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, p, l;\n  char s[100][100];\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 1; i <= n; i++) {\n\n    cin >> s[i];\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == '(')\n        a[j] = 1;\n      if (s[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 2) {\n        for (m = j; m >= 0; m--) {\n          if (a[m] == 1) {\n            a[m] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s[i]);\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1) {\n        printf(\"$\");\n      }\n      if (a[j] == 2) {\n        printf(\"?\");\n      }\n      if (a[j] == 0) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[101];\n  int i, a[101], j = 0, k;\n  while (scanf(\"%s\", c) != EOF) {\n    puts(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\\0')\n        break;\n      else {\n        if (c[i] == '(') {\n          j++;\n          a[j] = i;\n        } else if (c[i] == ')') {\n          if (j > 0) {\n            c[i] = ' ';\n            c[a[j]] = ' ';\n            j--;\n          }\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (c[k] == '(')\n        printf(\"$\");\n      else if (c[k] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    j = 0;\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101], ans[101];\n  int left[101];\n  int n = 0, i, t = 0;\n  while (scanf(\"%s \", c)) {\n    t = 0;\n    n = strlen(c);\n    for (i = 0; i < n; i++) {\n      ans[i] = ' ';\n      if (c[i] == '(')\n        left[t++] = i;\n      if (c[i] == ')') {\n        if (t == 0)\n          ans[i] = '?';\n        else\n          t--;\n      }\n    }\n    for (i = 0; i < t; i++)\n      ans[left[i]] = '$';\n    ans[n] = '\\0';\n    printf(\"%s\\n%s\\n\", c, ans);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int left = 0, right = 0;\n    int e[101] = {0};\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2) {\n        cout << \"?\";\n      } else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, num = 1, j;\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      num = 1;\n      if (a[i] != ')' && a[i] != '(')\n        cout << \" \";\n      if (a[i] == '(') {\n        if (a[i + 1] == '\\0') {\n          cout << \"$\";\n          continue;\n        }\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == '(')\n            num++;\n          if (a[j] == ')')\n            num--;\n          if (num == 0) {\n            cout << \" \";\n            break;\n          }\n          if (a[j + 1] == '\\0' && num != 0)\n            cout << \"$\";\n        }\n      }\n      num = 1;\n      if (a[i] == ')') {\n        if (i == 0) {\n          cout << \"?\";\n          continue;\n        }\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == ')')\n            num++;\n          if (a[j] == '(')\n            num--;\n          if (num == 0) {\n            cout << \" \";\n            break;\n          }\n          if (j == 0 && num != 0)\n            cout << \"?\";\n        }\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[110];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int b[110] = {0};\n    scanf(\"%s\", a);\n    m = strlen(a);\n    for (j = 0; j < m; j++) {\n      if (a[j] == '(')\n        b[j] = 1;\n      else if (a[j] == ')')\n        b[j] = -1;\n    }\n    for (j = m - 1; j >= 0; j--) {\n      if (b[j] == 1) {\n        for (k = j; k < m; k++) {\n          if (b[k] == -1) {\n            b[j] = 0;\n            b[k] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < m; k++)\n      cout << a[k];\n    printf(\"\\n\");\n    for (k = 0; k < m; k++) {\n      if (b[k] == 1)\n        printf(\"$\");\n      else if (b[k] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31398", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n  int i, j;\n  char a[101], b[101], c[101];\n  for (;;) {\n\n    cin >> a;\n\n    if (strcmp(c, a) == 0)\n      break;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == '(')\n        b[i] = '$';\n      else\n        b[i] = ' ';\n    }\n\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (b[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", b[i]);\n    printf(\" \");\n    strcpy(c, a);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[150];\nint l, j;\nvoid left(int i) {\n  int jj;\n\n  if (i == l - 1) {\n    a[i] = '$';\n    return;\n  }\n  for (jj = i + 1; jj < l; jj++) {\n\n    if (a[jj] == ')') {\n      a[jj] = ' ';\n      a[i] = ' ';\n      break;\n    } else if (a[jj] == '(') {\n      left(jj);\n    }\n  }\n  if (jj == l) {\n    a[i] = '$';\n  }\n\n  return;\n}\nvoid match(int i) {\n\n  if (i == l) {\n    for (int ii = 0; ii < l; ii++) {\n      if (a[ii] == '(') {\n        a[ii] = '$';\n      }\n      if (a[ii] == ')') {\n        a[ii] = '?';\n      }\n    }\n    return;\n  } else {\n    if (i == l - 1 && a[i] == '(') {\n      a[i] = '$';\n    }\n    if ((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) {\n      a[i] = ' ';\n    } else if (a[i] == '(') {\n      left(i);\n    }\n    match(i + 1);\n  }\n}\nint main() {\n  while (cin >> a) {\n    l = strlen(a);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    cout << endl;\n    match(0);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101];\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < strlen(a); i++)\n      cout << a[i];\n    putchar('\\n');\n    for (i = strlen(a) - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++)\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n      printf(\"%c\", a[i]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31401", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(char s[]) {\n  int i, j, k, l;\n  int n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != '(' && s[i] != ')')\n      s[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (s[i] == ')') {\n      l = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (s[j] == '(') {\n          s[j] = ' ';\n          s[i] = ' ';\n          l = 1;\n          break;\n        }\n      }\n      if (l == 0)\n        s[i] = '?';\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (s[i] != ' ' && s[i] != '?')\n      s[i] = '$';\n}\nint main() {\n  int n, i;\n  cin >> n;\n  char s[10000];\n\n  cin >> s;\n  for (i = 0; i < n; i++) {\n\n    cin >> s;\n    puts(s);\n    f(s);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, p, i, j, len;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    char a[150];\n    cin >> a;\n    len = strlen(a);\n    char b[150];\n    for (i = 0; a[i] != 0; i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = '$';\n        break;\n      case ')':\n        b[i] = '?';\n        break;\n      default:\n        b[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\", a);\n    cout << \"\\n\";\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31403", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int LeftParenIndex[100];\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    int i, top = 0;\n    puts(str);\n    for (i = 0; str[i]; i++) {\n      if (str[i] == '(')\n        LeftParenIndex[top++] = i;\n      else if (str[i] == ')') {\n        if (top == 0)\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n          str[LeftParenIndex[--top]] = ' ';\n        }\n      } else {\n        str[i] = ' ';\n      }\n    }\n    for (i = 0; i < top; i++)\n      str[LeftParenIndex[i]] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Match(int input_len);\nchar input[128];\nchar tmp_input[128];\nint main() {\n\n  while (scanf(\"%s\", input) != EOF) {\n    strcpy(tmp_input, input);\n    int input_len = strlen(input);\n    Match(input_len);\n    for (int i = 0; i <= input_len - 1; i++) {\n      if (input[i] == '(') {\n        input[i] = '$';\n      } else if (input[i] == ')') {\n        input[i] = '?';\n      } else {\n        input[i] = ' ';\n      }\n    }\n    printf(\"%s\\n\", tmp_input);\n    printf(\"%s\\n\", input);\n  }\n  return 0;\n}\nvoid Match(int input_len) {\n  int cur_left = -1, cur_right = -1;\n  for (int i = 0; i <= input_len - 1; i++) {\n    if (input[i] == '(') {\n      cur_left = i;\n      continue;\n    }\n    if (input[i] == ')') {\n      if (cur_left != -1) {\n        input[cur_left] = ' ';\n        input[i] = ' ';\n        cur_left = -1;\n        i = -1;\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "31405", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, length, k;\n  cin >> n;\n  getchar();\n  int i;\n  char a[500];\n  for (i = 1; i <= n; i++) {\n\n    cin >> a;\n    puts(a);\n    length = strlen(a);\n    int j;\n    for (j = length - 1; j >= 0; j--) {\n      int judge = 0;\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n      else if (a[j] == '(') {\n        for (k = j + 1; k < length; k++) {\n          if (a[k] == ')') {\n            a[k] = ' ';\n            a[j] = ' ';\n            judge = 1;\n            break;\n          }\n        }\n        if (judge == 0)\n          a[j] = '$';\n      }\n    }\n    for (j = 0; j < length; j++) {\n      if (a[j] == ')')\n        a[j] = '?';\n    }\n    puts(a);\n  }\n}\n"}
{"label": "17", "index": "31406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[11][101] = {{'\\0'}}, s0[101];\n  int i = 0, j, k, l, c;\n  while (i <= 10) {\n    scanf(\"%s\", s[i]);\n    strcpy(s0, s[i]);\n    l = strlen(s[i]);\n    for (j = l - 1; j >= 0; j--) {\n      c = 0;\n      if (s[i][j] == '(') {\n        for (k = j; k <= l - 1; k++) {\n          if (s[i][k] == ')') {\n            c = 1;\n            s[i][k] = ' ';\n            s[i][j] = ' ';\n            break;\n            ;\n          }\n        }\n        if (c == 0)\n          s[i][j] = '$';\n      } else if (s[i][j] != ')')\n        s[i][j] = ' ';\n    }\n    for (j = 0; j <= l - 1; j++) {\n      if (s[i][j] == ')')\n        s[i][j] = '?';\n    }\n    for (j = 0; j <= l - 1; j++)\n      cout << s0[j];\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[101] = {0};\n  while (cin >> words) {\n    cout << words << endl;\n    int i = 0, j = 0;\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] != '(' && words[i] != ')')\n        words[i] = ' ';\n      if (words[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (words[j] == '(') {\n            words[j] = ' ';\n            words[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] == '(')\n        words[i] = '$';\n      if (words[i] == ')')\n        words[i] = '?';\n    }\n    cout << words << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31408", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[110], la;\nint b[110];\n\nint main() {\n  while (1) {\n    int f = getchar();\n    if (f == -1)\n      break;\n    a[1] = f;\n    for (int i = 2; i <= 109; i++) {\n      a[i] = getchar();\n      if (a[i] == 10) {\n        la = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= la + 1; i++)\n      putchar(a[i]);\n    for (int i = 1; i <= la; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 1; j--) {\n          if (a[j] == ')')\n            break;\n          if (a[j] == '(') {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 1; i <= la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        putchar(32);\n      if (a[i] == '(')\n        putchar('$');\n      if (a[i] == ')')\n        putchar('?');\n    }\n    putchar(10);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, n, f[101][102] = {0}, l[101], g;\n  char s[101][102], a[102];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> s[i];\n    l[i] = strlen(s[i]);\n    for (j = l[i] - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        k = j;\n      else\n        continue;\n      for (g = k + 1; g < l[i]; g++) {\n        if (s[i][g] == ')' && f[i][g] == 0) {\n          f[i][k] = 1;\n          f[i][g] = 1;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n    for (j = 0; j < l[i]; j++) {\n      if (s[i][j] == '(' && f[i][j] == 0)\n        printf(\"$\");\n      else if (s[i][j] == ')' && f[i][j] == 0)\n        printf(\"?\");\n      else {\n        printf(\" \");\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101], rsen[101];\n  while (cin >> sen) {\n    int pos[101], num = 0, i, t = 0;\n    cout << sen << endl;\n    for (i = 0; i <= strlen(sen) - 1; i++) {\n      if (sen[i] == '(') {\n        num++;\n        pos[num] = i;\n        rsen[i] = '$';\n      } else if (sen[i] == ')') {\n        if (num > 0) {\n          rsen[pos[num]] = ' ';\n          rsen[i] = ' ';\n          num--;\n        } else\n          rsen[i] = '?';\n\n      } else {\n        rsen[i] = ' ';\n      }\n    }\n    if (num != 0) {\n      for (i = 1; i <= num; i++) {\n        rsen[pos[num]] = '$';\n      }\n    }\n    for (i = 0; i <= strlen(sen) - 2; i++) {\n      cout << rsen[i];\n    }\n    cout << rsen[strlen(sen) - 1] << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "31411", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200];\n  int n, i, j, k, m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    cin >> a;\n    puts(a);\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == ')') {\n        for (m = j; m >= 0; m--)\n          if (a[m] == '(') {\n            a[m] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n    }\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        a[j] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid pipei(char x[], int l) {\n  int i, j, count;\n  for (; count != 0;) {\n    count = 0;\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(')\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (x[j] != '(' && x[j] != ')')\n          continue;\n        if (x[j] == '(')\n          break;\n        if (x[j] == ')') {\n          count++;\n          x[i] = 32;\n          x[j] = 32;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (x[i] != '(' && x[i] != ')')\n      printf(\" \");\n    else if (x[i] == '(')\n      cout << \"$\";\n    else\n      printf(\"?\");\n  }\n  printf(\" \");\n}\nint main() {\n  char x[101];\n  int l, i;\n  for (;;) {\n\n    cin >> x;\n    if (x[0] == '\u0000')\n      break;\n    l = strlen(x);\n    puts(x);\n    pipei(x, l);\n    for (i = 0; i < l; i++)\n      x[i] = '\u0000';\n  }\n}\n"}
{"label": "17", "index": "31413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid match(char *p) {\n  int n = (int)strlen(p);\n  int a[100] = {0};\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    if (p[i] == ')') {\n      for (j = i; j >= 0; j--)\n        if (p[j] == '(') {\n          p[j] = p[i] = 'a';\n          break;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (p[i] == '(')\n      printf(\"$\");\n    else if (p[i] == ')')\n      printf(\"?\");\n    else\n      cout << \" \";\n  printf(\"\\n\");\n}\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    char s[103] = {'\\0'};\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n    match(s);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31414", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar s[101];   \nint l;         \nint f(int k) { \n  int i, j;\n  for (i = k; i >= 0; i--) \n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') \n        {\n          s[i] = 'a'; \n          s[j] = 'a';\n          k = i;\n          return f(k); \n        }\n    }\n  for (i = 0; i < l; i++) \n  {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      cout << ' ';\n  }\n  cout << endl;\n  return 0;\n}\n\nint main() {\n  while (cin.getline(s, 101, '\\n')) { \n    l = strlen(s);\n    cout << s << endl;\n    f(l - 1);                   \n    memset(s, '\\0', sizeof(s)); \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31415", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[120];\n  char s[120], s1[120];\n  int i, j, k, m, n, l;\n  while (1) {\n\n    scanf(\"%s \", s);\n    if (strcmp(s, s1) == 0)\n      break;\n    strcpy(s1, s);\n    memset(a, 0, sizeof(a));\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[i] = 1;\n      if (s[i] == ')')\n        a[i] = -1;\n    }\n\n    for (i = 0; i < l; i++) {\n      if ((s[i] == '(') && (a[i] != 0)) {\n        j = i + 1;\n        while ((a[j] == 0) && (j < l))\n          j++;\n        if ((s[j] == ')') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n      if ((s[i] == ')') && (a[i] != 0)) {\n        j = i - 1;\n        while ((a[j] == 0) && (j > 0))\n          j--;\n        if ((s[j] == '(') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n    }\n    printf(\"%s \", s);\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1)\n        printf(\"$\");\n      else if (a[i] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, k, p, d, x;\n  char a[101];\n  char b[101];\n  while (cin >> a) {\n    puts(a);\n    for (j = 0; a[j] != '\u0000'; j++) {\n\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')')\n        b[j] = '?';\n      else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\u0000';\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (b[k] == '?') {\n        d = 0;\n        for (p = k - 1; p >= 0; p--) {\n          if (b[p] == '$') {\n            x = p;\n            d = 1;\n            break;\n          }\n        }\n        if (d == 1) {\n          b[k] = ' ';\n          b[x] = ' ';\n        }\n      }\n    }\n    for (k = j; k >= 0; k--) {\n      if (b[k] != ' ' && b[k] != '\u0000')\n        break;\n    }\n    for (p = 0; p < j; p++) {\n      if (b[p] != ' ')\n        break;\n    }\n    for (x = p; x <= k; x++)\n      cout << b[x];\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31417", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, l, j = 0;\n  char a[150], b[150];\n  while (cin.getline(b, 150)) {\n    l = strlen(b);\n    for (i = 0; i < l; i++) {\n      cout << b[i];\n      if (b[i] == '(')\n        a[i] = b[i];\n      else if (b[i] == ')')\n        a[i] = b[i];\n      else\n        a[i] = ' ';\n    }\n    cout << endl;\n    if (a[l - 1] == '(')\n      a[l - 1] = '$';\n    for (i = l - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          a[i] = '$';\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (i = 0; i < l; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l;\n  char s[102];\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n        for (j = i - 1; j > -1; j--)\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n      } else\n        s[i] = ' ';\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len;\nchar str[101];\nvoid f(int p) {\n  int m = -1, n = -1;\n  for (int i = p; i >= 0; i--) {\n    if (*(str + i) == '(') {\n      m = i;\n      break;\n    }\n  }\n  for (int i = m + 1; i <= len - 1; i++) {\n    if (*(str + i) == ')') {\n      n = i;\n      break;\n    }\n  }\n  if (m >= 0 && n >= 0) {\n    str[m] = '#';\n    str[n] = '#';\n  }\n  if (m > 0) {\n    f(m - 1);\n  }\n}\n\nint main() {\n  while (cin >> str) {\n    len = strlen(str);\n    cout << str << endl;\n    f(len);\n    for (int j = 0; j <= len - 1; j++) {\n      if (str[j] == '(')\n        cout << \"$\";\n      else if (str[j] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31420", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar st[100];\nchar st2[100];\nint main() {\n  memset(st, 0, 100);\n  memset(st2, 0, 100);\n  while (scanf(\"%s \", st)) {\n    int left = 0, right = 0;\n    int len = strlen(st);\n    for (int i = 0; i < len; i++) {\n      if (st[i] == '(')\n        left++;\n      if (st[i] == ')')\n        right++;\n      if (left < right) {\n        st2[i] = '?';\n        right--;\n      }\n    }\n    left = 0;\n    right = 0;\n    for (int j = len - 1; j >= 0; j--) {\n      if (st[j] == '(')\n        left++;\n      if (st[j] == ')')\n        right++;\n      if (left > right) {\n        st2[j] = '$';\n        left--;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (st2[i] != '$' && st2[i] != '?')\n        st2[i] = ' ';\n    }\n    cout << st << endl;\n    cout << st2 << endl;\n    memset(st, 0, 100);\n    memset(st2, 0, 100);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31421", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[110];\nvoid search() {\n  int i = 0, l, t = 0;\n  char str1[110];\n  int stack[110];\n  printf(\"%s\\n\", str);\n  l = strlen(str);\n  memset(str1, ' ', sizeof(str1));\n  while (i < l) {\n    if (str[i] == '(') {\n      t++;\n      stack[t] = i;\n    }\n    if (str[i] == ')') {\n      if (t == 0)\n        str1[i] = '?';\n      else\n        t--;\n    }\n    i++;\n  }\n  for (i = 1; i <= t; i++)\n    str1[stack[i]] = '$';\n  for (i = 0; i < l; i++)\n    printf(\"%c\", str1[i]);\n  printf(\"\\n\");\n}\nint main() {\n  while (cin >> str)\n    search();\n  return 0;\n}\n"}
{"label": "17", "index": "31422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char l, r, s, sen[200], rem[200];\n  int i = 1, j = 1, k = 1, nsen, b = 1;\n  l = '(';\n  r = ')';\n\n  while (b == 1) {\n\n    while ((s = cin.get()) != '\\n') {\n      sen[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    nsen = i - 1;\n\n    for (j = 1; j < nsen; j++) \n      for (i = 1; i < nsen; i++)\n        if (sen[i] == l && sen[i + j] == r) {\n          sen[i] = ' ';\n          sen[i + j] = ' ';\n        } \n\n    for (i = 1; i <= nsen; i++)\n      if (sen[i] == l)\n        sen[i] = '$';\n      else if (sen[i] == r)\n        sen[i] = '?'; \n      else\n        sen[i] = ' '; \n\n    for (i = 1; i <= nsen; i++)\n      cout << rem[i];\n    cout << endl;\n    for (i = 1; i <= nsen; i++)\n      cout << sen[i];\n    cout << endl;\n\n    nsen = 0;\n    i = 1;\n    j = 1;\n    k = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  char s1[101], s2[101] = {0};\n  for (i = 1; i > 0;) {\n\n    cin >> s1;\n    if (strcmp(s1, s2) == 0) {\n      cout << \" \";\n      break;\n    }\n    puts(s1);\n    l = strlen(s1);\n    for (j = 0; j < l; j++) {\n      if (s1[j] != '(' && s1[j] != ')')\n        s1[j] = ' ';\n      else {\n        if (s1[j] == ')') {\n          for (k = j; k >= 0; k--)\n            if (s1[k] == '(')\n              break;\n          if (k != -1)\n            s1[k] = s1[j] = ' ';\n          else\n            s1[j] = '?';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s1[j] == '(')\n        s1[j] = '$';\n    }\n    strcpy(s2, s1);\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar in[110], work[110], out[110];\nint len;\nvoid pick(int L) {\n  for (int i = L - 1; i >= 0; i--) {\n    if (work[i] == '(') {\n      for (int j = 0; j < L - i; j++) {\n        if (work[i + j] == ')') {\n          work[i] = ' ';\n          work[i + j] = ' ';\n          pick(len);\n          break;\n        }\n      }\n    }\n  }\n}\nvoid mark(int L) {\n  for (int i = 0; i < L; i++) {\n    if (work[i] == '(')\n      out[i] = '$';\n    if (work[i] == ')')\n      out[i] = '?';\n  }\n}\nint main() {\n  while (cin) {\n    cin.getline(in, 110);\n    len = strlen(in);\n    for (int i = 0; i < len; i++) {\n      out[i] = ' ';\n      work[i] = in[i];\n    }\n    pick(len);\n    mark(len);\n    for (int i = 0; i < len; i++)\n      cout << in[i];\n\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      cout << out[i];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, k;\n  scanf(\"%d\", &m);\n  getchar();\n  for (k = 0; k < m; k++) {\n    int i, f, len, j;\n    char a[200], b[200], c[200];\n\n    cin >> a;\n    len = strlen(a);\n    strcpy(c, a);\n    b[len] = '\u0000';\n    for (i = 0; i < len; i++)\n      b[i] = ' ';\n\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        f = 0;\n        for (j = i; j < len; j++) {\n          if (a[j] == ')') {\n            f = 1;\n            a[j] = 'a';\n            break;\n          }\n        }\n        if (f == 0) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s %s \", c, b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i, s, j = 0, c = 0, d = 0, l, m, n, k = 0, w;\n  char str[100];\n\n  for (;;) {\n\n    scanf(\"%s \", str);\n    if (feof(stdin))\n      break;\n    l = strlen(str);\n    for (i = 0; i <= l - 1; i++) {\n      cout << str[i];\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] == '(') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == ')' && b == 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a <= 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    a = 0;\n    b = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == ')') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == '(' && b == 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a <= 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    printf(\" \");\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31427", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  int l, i, j, d;\n  while (1) {\n\n    scanf(\"%s \", str);\n    if (str[0] == '\u0000')\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == ' ')\n        continue;\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        d = 1;\n        for (j = i + 1; j < l; j++) {\n          if (str[j] == '(')\n            d++;\n          if (str[j] == ')')\n            d--;\n          if (d == 0) {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        printf(\"?\");\n      else\n        printf(\"%c\", str[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      str[i] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31428", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101] = {0}, label[101] = {0};\n  int pos[101] = {0}, left, right, l, i, j, n;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    cin >> line;\n    left = 0;\n    right = 0;\n    l = strlen(line);\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[l] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char word[105], sign[105];\n  int num = 0, i, len;\n  while (cin.getline(word, 105)) {\n    num = 0;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      sign[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        num++;\n      if (word[i] == ')') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '?';\n      }\n    }\n    num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (word[i] == ')')\n        num++;\n      if (word[i] == '(') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '$';\n      }\n    }\n    sign[len] = '\\0';\n    cout << word << \"\\n\";\n    cout << sign << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int i, j;\n  char a[101], b[101], c[101];\n  for (;;) {\n\n    scanf(\"%s \", a);\n\n    if (strcmp(c, a) == 0)\n      break;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == '(')\n        b[i] = '$';\n      else\n        b[i] = ' ';\n    }\n\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (b[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", a[i]);\n    cout << \" \";\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", b[i]);\n    cout << \" \";\n    strcpy(c, a);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x;\n  scanf(\"%d\", &n);\n  char a[n][1000];\n  getchar();\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31433", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint judge(int, int);\nint main() {\n  for (; scanf(\"%s \", a);) {\n    printf(\"%s\\n\", a);\n    judge(0, 0);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\nint judge(int i, int l) {\n  int t;\n  if (a[i] == '\\0')\n    return -1;\n  if (a[i] == '(') {\n    t = judge(i + 1, l + 1);\n    a[i] = (t == -1) ? '$' : ' ';\n    return (t == -1) ? -1 : judge(i + 1, l);\n  }\n\n  else if (a[i] == ')') {\n    a[i] = l == 0 ? '?' : ' ';\n    return (l == 0) ? judge(i + 1, l) : i;\n  } else {\n    a[i] = ' ';\n    return judge(i + 1, l);\n  }\n}\n"}
{"label": "17", "index": "31434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar a[110];\nint match(int i) {\n  int j;\n  int l = strlen(a);\n  if (i == l)\n    return 0;\n  if (a[i] == '?') {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == '$') {\n\n        a[j] = ' ';\n        a[i] = ' ';\n        break;\n      }\n    }\n  }\n  match(i + 1);\n  return 0;\n}\nint main() {\n  int l;\n  int i;\n  while (scanf(\"%s\", a) != EOF) {\n    cout << a << \"\\n\";\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    match(1);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[200];\n  int i, j, k, m, n;\n  int flag = 0;\n  int left[100], l = 1;\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    flag = 0;\n    l = 1;\n    for (n = 1; n < 100; n++)\n      left[n] = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (j = l - 1; j >= 1; j--) {\n      flag = 0;\n      for (k = left[j] + 1; str[k] != '\\0'; k++) {\n        if (str[k] == ')') {\n          str[left[j]] = ' ';\n          str[k] = ' ';\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0)\n        str[left[j]] = '$';\n    }\n    for (m = 0; str[m] != '\\0'; m++)\n      if (str[m] == ')')\n        str[m] = '?';\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31436", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[110], la;\n\nint main() {\n  while (1) {\n    int f = getchar();\n    if (f == -1)\n      break;\n    a[1] = f;\n    for (int i = 2; i <= 109; i++) {\n      a[i] = getchar();\n      if (a[i] == 10) {\n        la = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= la + 1; i++)\n      putchar(a[i]);\n    for (int i = 1; i <= la; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 1; j--) {\n          if (a[j] == ')')\n            break;\n          if (a[j] == '(') {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 1; i <= la; i++) {\n      if (a[i] != '(' && a[i] != ')') {\n        putchar(32);\n      }\n      if (a[i] == '(') {\n        putchar('$');\n      }\n      if (a[i] == ')')\n        putchar('?');\n    }\n    putchar(10);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31437", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a;\n  cin >> n;\n  for (a = 1; a <= n; a++) {\n    char s[101];\n    cin >> s;\n    int left[101] = {0}, right[101] = {0}, i, l = 0, r = 0;\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(') {\n        left[l++] = i + 1;\n      } else {\n        if (s[i] == ')') {\n          if (l != 0) {\n            l--;\n            left[l] = 0;\n          } else {\n            right[r++] = i + 1;\n          }\n        }\n      }\n    }\n    int le = 0, ri = 0;\n    printf(\"%s\\n\", s);\n    for (i = 0; i < strlen(s); i++) {\n      if (left[le] == i + 1) {\n        printf(\"$\");\n        le++;\n      } else {\n        if (right[ri] == i + 1) {\n          printf(\"?\");\n          ri++;\n        } else\n          printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid find(char a[], int n, int m) {\n  int i;\n  if (a[m] != ')' && m < n) {\n    find(a, n, m + 1);\n  }\n  if (a[m] == ')' && m < n) {\n    for (i = m; i >= 0; i--) {\n      if (a[i] == '(') {\n        a[i] = ' ';\n        a[m] = ' ';\n        break;\n      }\n    }\n    find(a, n, m + 1);\n  }\n}\nint main() {\n  int n;\n  char a[200];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    n = strlen(a);\n    find(a, n, 0);\n    for (int k = 0; k < n; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } else {\n        if (a[k] == ')') {\n          a[k] = '?';\n        } else {\n          if (a[k] != '(' && a[k] != ')') {\n            a[k] = ' ';\n          }\n        }\n      }\n    }\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void match(char a[]);\n  int signal = 1;\n  int i;\n  char s[101], s1[101] = \"\";\n\n  cin >> s;\n  while (signal) {\n    match(s);\n    strcpy(s1, s);\n    scanf(\"%s\", s);\n    if (strcmp(s, s1) == 0)\n      signal = 0;\n  }\n\n  return 0;\n}\n\nvoid match(char a[]) {\n  int i, j, k, len;\n  int f1 = 0, f2 = 0, f3 = 1;\n  len = strlen(a);\n  if (len != 0)\n    printf(\"%s \", a);\n  do {\n    if (len != 0) {\n      f1 = 0;\n      f2 = 0;\n      f3 = 1; \n      for (i = len - 1; i >= 0; i--) {\n        if (a[i] == '(') {\n          f1 = 1; \n          for (j = i + 1; a[j]; j++) {\n            if (a[j] == ')') {\n              f2 = 1; \n              a[j] = '0';\n              a[i] = '0';\n              break;\n            }\n          }\n          if (f2 == 0) \n          {\n            a[i] = '1';\n          }\n        }\n        if (f1 == 1)\n          break;\n      }\n      if (f1 == 0) \n      {\n        for (i = 0; a[i]; i++) {\n          if (a[i] == ')') \n          {\n            a[i] = '2';\n          }\n        }\n      }\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          f3 = 0;\n          break;\n        }\n      }\n    }\n  } while (f3 == 0);\n  for (i = 0; a[i]; i++) {\n    if (a[i] == '1')\n      printf(\"$\");\n    else if (a[i] == '2')\n      printf(\"?\");\n    else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[200] = {'\\0'}; \n  int left[200] = {0};     \n  int i = 0, k = 0;\n  while (cin.getline(word, 200)) {\n    for (i = 0; word[i]; i++) \n      cout << word[i];\n    cout << endl;\n    for (i = 0; word[i]; i++) \n    {\n      if (word[i] == '(') \n      {\n        left[k] = i;\n        k++;\n        word[i] = '$';\n      } else if (word[i] == ')') \n      {\n        if (k) {\n          k--;\n          word[left[k]] = ' ';\n          word[i] = ' ';\n        } else\n          word[i] = '?';\n      } else \n        word[i] = ' ';\n    }\n    for (i = 0; word[i]; i++) \n      cout << word[i];\n    cout << endl;\n    k = 0;\n    memset(word, '\\0', sizeof(word));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31441", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101] = {'\\0'}, b[101] = {'\\0'};\n  int i, j;\n  while (cin.getline(a, 101)) {\n    for (i = 0; i < 101; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else {\n        b[i] = ' ';\n      }\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    cout << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = '\\0';\n      b[i] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31442", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[101];\n  a[0] = 0;\nl:\n  cin >> a;\n  if (a[0] == 0)\n    return 0;\n  else\n    printf(\"%s\\n\", a);\n  int r, i, k;\n  r = strlen(a);\n  for (i = r - 1; i >= 0; i--) {\n    if (a[i] != '(' && a[i] != ')')\n      a[i] = ' ';\n    else if (a[i] == '(') {\n      for (k = i; k <= r - 1; k++) {\n        if (a[k] == ')') {\n          a[i] = ' ';\n          a[k] = ' ';\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= r - 1; i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n  }\n  printf(\"%s\\n\", a);\n  return main();\n}\n"}
{"label": "17", "index": "31443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    int a[1000];\n    char s[1000];\n    scanf(\"%s\", s);\n    int l = strlen(s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < l; j++)\n      a[j] = 0;\n    for (j = l - 1; j >= 0; j--) {\n      int t;\n      if (s[j] == '(') {\n        int f = 0;\n        for (t = j + 1; t < l; t++) {\n          if (s[t] == ')' && a[t] == 0) {\n            f = 1;\n            a[t] = 1;\n            a[j] = 1;\n            break;\n          }\n        }\n        if (f == 0)\n          s[j] = '$';\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] == ')' && a[j] == 0) {\n        s[j] = '?';\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] != '?' && s[j] != '$')\n        s[j] = ' ';\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char a[1000];\n    cin >> a;\n    cout << a << \"\\n\";\n    int len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      int l = -1, r = -1;\n\n      for (int j = i; j >= 0; j--) {\n        if (a[j] == ')' && j != i)\n          break;\n        else if (a[j] == '(') {\n          l = j;\n          break;\n        }\n      }\n      for (int j = i; j < len; j++) {\n        if (a[j] == '(' && j != i)\n          break;\n        else if (a[j] == ')') {\n          r = j;\n          break;\n        }\n      }\n      if (r != -1 && l != -1) {\n        a[r] = '0';\n        a[l] = '0';\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31445", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[105];\n  int flag = 0;\n  int puma[105];\n  while (cin >> str) {\n    flag = 0;\n    cout << str << endl;\n    for (int i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        flag++;\n        puma[flag] = i;\n      } else if (str[i] == ')') {\n        if (flag > 0) {\n          str[puma[flag]] = ' ';\n          str[i] = ' ';\n          flag--;\n        } else\n          str[i] = '?';\n      } else\n        str[i] = ' ';\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][105] = {'\\0'}, a;\n  int i, j, k, count, cleft, cright;\n  i = j = 0;\n  while ((a = cin.get()) != EOF) {\n    if (a != '\\n') {\n      s[i][j] = a;\n      j++;\n    } else if (a == '\\n') {\n      i++;\n      j = 0;\n    }\n  }\n  count = i;\n  cleft = cright = 0;\n  for (i = 0; i < count; i++) {\n    cout << s[i] << \"\\n\";\n    for (j = 0; j < strlen(s[i]); j++) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright > cleft) {\n        s[i][j] = '?';\n        cright -= 1;\n      }\n    }\n    cleft = cright = 0;\n    for (j = strlen(s[i]) - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright < cleft) {\n        s[i][j] = '$';\n        cleft -= 1;\n      }\n    }\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] != '?' && s[i][j] != '$')\n        s[i][j] = ' ';\n    if (i == count - 1)\n      cout << s[i];\n    else\n      cout << s[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31447", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  while (!cin.eof()) {\n    char str[1000], ans[1000];\n    memset(str, 0, sizeof(str));\n    memset(ans, 0, sizeof(ans));\n    cin >> str;\n\n    for (int i = 0; i < strlen(str); i++)\n      ans[i] = ' ';\n\n    int sign = 0;\n    for (int i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n\n        sign++;\n        ans[i] = sign + '0';\n      } else if (str[i] == ')') {\n        if (sign > 0) {\n          ans[i] = sign + '0';\n          sign--;\n        } else\n          ans[i] = '?';\n      }\n    }\n    for (int i = 0; i < strlen(str); i++) {\n      if (ans[i] != ' ' && str[i] == '(') {\n        int ok = 0;\n        int j;\n        for (j = i + 1; j < strlen(str); j++) {\n          if (ans[j] == ans[i]) {\n            ok = 1;\n            break;\n          }\n        }\n        if (!ok)\n          ans[i] = '$';\n        else\n          ans[i] = ans[j] = ' ';\n      }\n    }\n    ans[strlen(str)] = '\u0000';\n    cout << str << endl;\n    cout << ans;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int i, l, n, x, j, r;\n  int le[101] = {0}, ri[101] = {0};\n  scanf(\"%d\", &n);\n  for (x = 0; x < n; x++) {\n    for (i = 0; i < 100; i++) {\n      le[i] = 0;\n      ri[i] = 0;\n    }\n    scanf(\"%s\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        le[i] = 1;\n      if (s[i] == ')')\n        ri[i] = 1;\n    }\n    for (i = l - 1; i >= 0; i--) {\n      if (le[i] == 1) {\n        for (j = i; j < l; j++) {\n          if (ri[j] == 1) {\n            ri[j] = 0;\n            le[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < l; i++) {\n      if (ri[i] == 1)\n        printf(\"?\");\n      if (le[i] == 1)\n        printf(\"$\");\n      if (ri[i] == 0 && le[i] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31449", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a;\nchar str[100];\nvoid find(void);\nint main() {\n  int i;\n  while (cin >> str) { \n    cout << str << endl;\n    a = strlen(str); \n    find();          \n    for (i = 0; i < a; i++) {\n      if (str[i] == '(')\n        cout << \"$\"; \n      else {\n        if (str[i] == ')')\n          cout << \"?\"; \n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\nvoid find(void) { \n  int i = 0;\n  int p = -1, q = -1;\n  for (i = 0; i < a; i++) {\n    if (str[i] != '(' && str[i] != ')')\n      str[i] = '\\0'; \n    if (str[i] == '(')\n      p = i; \n    if (p != -1 && str[i] == ')') {\n      q = i;\n      break;\n    } \n  }\n  if (p != -1 && q != -1) {\n    str[p] = '\\0';\n    str[q] = '\\0';\n    find();\n  } \n}\n"}
{"label": "17", "index": "31450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, n, m = 0;\n  while (scanf(\"%s\", a) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101], b[101];\n  while (cin.getline(a, 101)) {\n    for (i = 0; i <= 100; i++)\n      b[i] = ' ';\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            break;\n          }\n        if (j == -1)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      printf(\"%c\", b[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31452", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nchar s[1000];\n\nint findri(int x, int y) {\n  int p;\n  if (s[x] == '\\0')\n    return -1;\n  if (s[x] == '(') {\n    p = findri(x + 1, y + 1);\n    if (p == -1) {\n      s[x] = '$';\n      return -1;\n    } else {\n      s[x] = ' ';\n      return findri(p + 1, y);\n    }\n  } else if (s[x] == ')') {\n    if (y == 0) {\n      s[x] = '?';\n      return findri(x + 1, y);\n    } else {\n      s[x] = ' ';\n      return x;\n    }\n\n  } else {\n    s[x] = ' ';\n    return findri(x + 1, y);\n  }\n}\n\nint main() {\n  int len;\n  int i;\n  while (cin >> s) {\n    len = strlen(s);\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << '\\n';\n    findri(0, 0);\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << '\\n';\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, left;\n  char s[102] = {'\\0'}, t[102] = {'\\0'};\n  int num[102];\n  while (scanf(\"%s\", s) != EOF) {\n    printf(\"%s\\n\", s);\n    k = strlen(s);\n    left = 0;\n    for (i = 0; i <= k - 1; i++) {\n      switch (s[i]) {\n      case 40: {\n        left = left + 1;\n        num[left] = i;\n        t[i] = '$';\n        break;\n      }\n      case 41: {\n        if (left != 0) {\n          t[num[left]] = 32;\n          t[i] = 32;\n          left = left - 1;\n        } else {\n          t[i] = '?';\n        }\n        break;\n      }\n      default: {\n        t[i] = 32;\n        break;\n      }\n      }\n    }\n    for (i = 0; i <= k - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31454", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][101], b[101], c[101];\n  int n, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    cin >> a[m];\n  }\n  for (m = 0; m < n; m++) {\n    int i = 0, j = 0;\n    int n;\n    n = strlen(a[m]);\n    for (i = 0; i < n; i++) {\n      b[i] = ' ';\n      c[i] = ' ';\n    }\n\n    for (i = n - 1; i >= 0; i--)\n      if (a[m][i] == '(')\n        b[i] = a[m][i];\n    for (i = 0; i < n; i++)\n      if (a[m][i] == ')')\n        c[i] = a[m][i];\n    for (i = n - 1; i >= 0; i--)\n      if (b[i] == '(') {\n        for (j = i + 1; j < n; j++)\n          if (c[j] == ')') {\n            c[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n      }\n    printf(\"%s \", a[m]);\n    for (i = 0; i < n; i++) {\n      if (b[i] != ' ')\n        a[m][i] = '$';\n      if (c[i] != ' ')\n        a[m][i] = '?';\n      if (b[i] == ' ' && c[i] == ' ')\n        a[m][i] = ' ';\n    }\n    printf(\"%s \", a[m]);\n  }\n}\n"}
{"label": "17", "index": "31455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[105] = {0};\n  while (scanf(\"%s \", c)) {\n\n    int a[105] = {0};\n\n    int n, i, j;\n    n = strlen(c);\n    for (i = 0; i < n; i++)\n      a[i] = 1;\n    for (i = n - 1; i >= 0; i--) {\n      if (c[i] == '(')\n\n      {\n\n        for (j = i; j < n; j++) {\n          if ((c[j] == ')') && (a[j] != 0)) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n\n    for (i = 0; i < n; i++) {\n      if ((c[i] == '(') && (a[i] == 1))\n\n        cout << \"$\";\n      if ((c[i] == ')') && (a[i] == 1))\n        cout << \"?\";\n      if ((c[i] != '(') && (c[i] != ')') && (c[i] != '\\0'))\n        cout << \" \";\n      if ((c[i] == '(') && (a[i] == 0))\n        cout << \" \";\n      if ((c[i] == ')') && (a[i] == 0))\n        cout << \" \";\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int n1, int z[500], char s[500]);\nvoid search(int a[500], int h);\nchar s[500];\nint z[500];\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    int h, a, l1 = 0, l2 = 0;\n    h = strlen(s);\n    for (a = 0; a <= h - 1; a++) {\n      if (s[a] == '(') {\n        z[a] = 1;\n      } else {\n        if (s[a] == ')') {\n          z[a] = 2;\n        } else\n\n        {\n          z[a] = 0;\n        }\n      }\n    }\n    search(z, h);\n    print(h, z, s);\n  }\n  return 0;\n}\nvoid search(int z[500], int h) {\n  int k, m, n;\n  for (m = 1; m <= h - 1; m++)\n    for (k = 0; (k + m) <= (h - 1); k++)\n      if ((z[k] == 1) && (z[k + m] == 2)) {\n        z[k] = 0;\n        z[k + m] = 0;\n      }\n}\nvoid print(int n1, int z[500], char s[500]) {\n  int a;\n  for (a = 0; a < n1; a++)\n    printf(\"%c\", s[a]);\n\n  cout << \"\\n\";\n  for (a = 0; a < n1; a++) {\n    if (z[a] == 0)\n      printf(\" \");\n    if (z[a] == 1) {\n      printf(\"$\");\n    }\n    if (z[a] == 2)\n      printf(\"?\");\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "17", "index": "31457", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, i, l, j, n = 1, t, h, m;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      cout << a[j];\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(')\n        a[j] = '$';\n      else if (a[j] == ')') {\n        for (k = j; k >= -1; k--) {\n          if (k == -1) {\n            a[j] = '?';\n            break;\n          }\n          if (a[k] == '$') {\n            a[k] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n\n      } else\n        a[j] = ' ';\n    }\n\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char chuan[101];\n  while (scanf(\"%s\", chuan) != EOF) {\n    printf(\"%s\\n\", chuan);\n    int i, j, k, p;\n    int sig = 0;\n    p = strlen(chuan) - 1;\n    for (i = p; i >= 0; i--) {\n      if (chuan[i] == ')')\n        sig++;\n      if ((chuan[i] != '(') && (chuan[i] != ')'))\n        chuan[i] = ' ';\n      if ((sig != 0) && (chuan[i] == '(')) {\n        chuan[i] = ' ';\n        sig = sig - 1;\n        for (j = i + 1; j <= p; j++)\n          if (chuan[j] == ')') {\n            chuan[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      if (chuan[i] == '(')\n        printf(\"$\");\n      else {\n        if (chuan[i] == ')')\n          printf(\"?\");\n        else\n          printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31459", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid del(char a[], int n) \n{\n  int i = 0;\n  while (a[i] != ')' && i < n)\n    i++;\n  int j;\n  j = i - 1;\n  while (a[j] != '(' && j >= 0)\n    j--;\n  if (i < n && j >= 0) {\n    a[i] = ' ';\n    a[j] = ' ';\n    del(a, n);\n  } else {\n    if (i >= n && j >= 0)\n      a[j] = '$';\n    if (j < 0 && i < n)\n      a[i] = '?';\n    if (!(i >= n && j < 0))\n      del(a, n);\n  }\n}\n\nint main() {\n  while (!cin.eof()) {\n    char a[101];\n    cin.getline(a, 101);\n    cout << a << endl;\n    int n, i;\n    n = strlen(a);\n    del(a, n);\n    for (i = 0; i < n; i++)\n      switch (a[i]) {\n      case '$':\n      case '?':\n        cout << a[i];\n        break;\n      default:\n        cout << ' ';\n      }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31460", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[100];\nint b;\nvoid nihao() {\n\n  for (int i = 0; i < b; i++) {\n    int r = 0;\n    if (a[i] == ')') {\n      for (int j = i - 1; j >= 0; j--) {\n        if (a[j] == '(') {\n          for (int k = j; k <= i; k++)\n            a[k] = ' ';\n          r = 1;\n          break;\n        }\n      }\n      if (r == 0) {\n        a[i] = '?';\n        for (int k = i - 1; k >= 0; k--) {\n          if (a[k] != '?')\n            a[k] = ' ';\n        }\n      }\n    }\n  }\n}\nvoid nimei() {\n  for (int i = b - 1; i >= 0; i--)\n    if (a[i] == '(')\n      a[i] = '$';\n}\nvoid nima() {\n  for (int i = 0; i < b; i++) {\n    if (a[i] != '?' && a[i] != '$')\n      a[i] = ' ';\n  }\n  for (int i = 0; i < b; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a;\n    cout << endl;\n    b = strlen(a);\n    nihao();\n    nimei();\n    nima();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31461", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    n = strlen(str);\n    match(0, n, str);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n    match(i + 1, n, str);\n    return 0;\n  } else {\n    if (str[i] == '(') {\n      str[i] = '$';\n      match(i + 1, n, str);\n      return 0;\n    } else {\n      str[i] = ' ';\n      match(i + 1, n, str);\n      return 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31462", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s1[101], s2[101];\nint f(int);\n\nint main() {\n  while (scanf(\"%s\", s1) != EOF) {\n    f(0);\n    printf(\"%s\\n%s\\n\", s1, s2);\n  }\n  return 0;\n}\n\nint f(int k) {\n  if (s1[k] == '\\0') {\n    s2[k] = '\\0';\n    return 0;\n  }\n\n  if (s1[k] == ')') {\n    s2[k] = '?';\n    f(k + 1);\n    return 0;\n  }\n\n  if (s1[k] == '(') {\n    for (int i = k + 1; i > 0; i++) {\n      if (s1[i] == '\\0') {\n        s2[i] = '\\0';\n        i = -1;\n      }\n\n      else if (s1[i] == '(') {\n        i = f(i);\n      }\n\n      else if (s1[i] == ')') {\n        s2[k] = ' ';\n        s2[i] = ' ';\n        f(i + 1);\n        return i;\n      }\n\n      else\n        s2[i] = ' ';\n    }\n    s2[k] = '$';\n    return -1;\n  }\n\n  s2[k] = ' ';\n  f(k + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "31463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int length, i = 0;\n  while (1) {\n    cin.get(str, 110, '\\n');\n    if (cin.get() == EOF)\n      break;\n    length = strlen(str);\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = length - 1; i >= 0; i--) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i; j < length; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n    }\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char c[100];\n  int l;\n\n  while (scanf(\"%s \", c)) {\n    int a[100] = {0};\n    int left = 0;\n\n    l = strlen(c);\n\n    for (int i = 0; i < l; i++) {\n\n      if (left == 0 && c[i] == ')')\n        a[i] = 1;\n\n      if (c[i] == '(')\n        left++;\n\n      if (c[i] == ')' && left > 0) {\n        left--;\n\n        for (int j = i; j >= 0; j--) {\n          if ((c[j] == '(') && (a[j] != 2)) {\n            a[j] = 2;\n            break;\n          }\n        }\n      }\n    }\n\n    int count = 0;\n\n    if (left != 0) {\n      for (int i = l; count < left; i--) {\n        if (c[i] == '(' && a[i] != 2) {\n          a[i] = -1;\n          count++;\n        }\n      }\n    }\n\n    for (int i = 0; i < l; i++)\n      cout << c[i];\n\n    cout << endl;\n\n    for (int i = 0; i < l; i++) {\n      if (a[i] == 0 || a[i] == 2)\n        printf(\" \");\n      else if (a[i] == 1)\n        cout << '?';\n      else if (a[i] == -1)\n        cout << '$';\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch1[101], ch2[101];\n  int i = 0, j = 0, k = 0, len = 0;\n  while (cin.getline(ch1, 101)) {\n    len = strlen(ch1);\n    int num = 0;\n    for (i = 0; i < len; i++) {\n      ch2[i] = ' ';\n      if (ch1[i] == '(') {\n        ch2[i] = '$';\n        num++;\n      }\n      if (ch1[i] == ')') {\n        ch2[i] = '?';\n        num--;\n        if (num == 0) {\n          ch2[i] = ' ';\n          for (j = 0; j < i; j++) {\n            if (ch1[j] == '(') {\n              for (k = j; k <= i; k++) {\n                ch2[k] = ' ';\n                break;\n                break;\n              }\n            }\n          }\n        }\n        if (num > 0) {\n          ch2[i] = ' ';\n          for (j = i; j >= 0; j--) {\n            if (ch2[j] == '$') {\n              ch2[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (num < 0)\n          num = 0;\n      }\n    }\n    ch2[len] = '\\0';\n    cout << ch1 << \"\\n\";\n    cout << ch2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31466", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int length, i, j;\n  while (cin.getline(line, 101)) {\n    length = strlen(line);\n    for (i = 0; i < length; i++)\n      cout << line[i];\n    cout << endl;\n    for (i = 0; i < length; i++) {\n      if (line[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[i] = 0;\n            line[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (line[i] == '(')\n        cout << \"$\";\n      if (line[i] != '(' && line[i] != ')')\n        cout << \" \";\n      if (line[i] == ')')\n        cout << \"?\";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int flag[101], i, j, k, len;\n  while (cin >> str) {\n    for (i = 0; i < 101; i++)\n      flag[i] = 0;\n    len = strlen(str);\n    for (i = len - 2; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == ')' && flag[j] == 0) {\n            flag[j] = 1;\n            flag[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        cout << \" \";\n      else {\n        if (str[i] == '(' && flag[i] == 0)\n          cout << \"$\";\n        if (str[i] == '(' && flag[i] == 1)\n          printf(\" \");\n        if (str[i] == ')' && flag[i] == 0)\n          cout << \"?\";\n        if (str[i] == ')' && flag[i] == 1)\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31468", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  int i, len, mark1[110] = {0}, judge, k = 0, j, k1 = 0;\n  while (cin.getline(a, 110)) {\n    len = strlen(a);\n    k = 0;\n    for (i = 0; i < 110; i++)\n      mark1[i] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' || a[i] == ')') {\n        if (k == 0) {\n          if (a[i] == '(')\n            mark1[k]++;\n          else\n            mark1[k]--;\n          k++;\n        } else {\n          judge = 0;\n          if (a[i] == '(')\n            mark1[k] = 1;\n          else if (a[i] == ')') {\n            mark1[k] = -1;\n            for (j = k - 1; j >= 0; j--) {\n              if (mark1[j] == 1) {\n                mark1[j] = 0;\n                mark1[k] = 0;\n                break;\n              }\n            }\n          }\n\n          k++;\n        }\n      }\n    }\n    k1 = 0;\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        cout << ' ';\n      else {\n        if (mark1[k1] == 0)\n          cout << ' ';\n        else if (mark1[k1] > 0)\n          cout << '$';\n        else\n          cout << '?';\n        k1++;\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31469", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char b[100];\n  int i, j, t, l;\n  while (1) {\n    char a[100];\n    a[0] = '\\0';\n    cin >> a;\n    l = strlen(a);\n    if (l == 0)\n      break;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[l] = '\\0';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        t = 0;\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            t--;\n          if (a[j] == ')')\n            t++;\n          if (t == 1) {\n            b[i] = b[j] = ' ';\n            a[i] = a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[110], temp[110], c[110];\n  int i, figure;\n  while (cin >> ch) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        c[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure) {\n          figure--;\n          temp[c[figure]] = ' ';\n        } else {\n          temp[i] = '?';\n        }\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    printf(\"%s %s \", ch, temp);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i;\n  char s[101], a[101];\n  while (cin >> s) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {0};\n  while (true) {\n    int i = 0;\n    while (true) {\n      str[i] = getchar();\n      if (str[i] == '\\n')\n        break;\n      i++;\n    }\n    int n, j = 0, biaoji = 0;\n    n = i - 1;\n    for (i = 0; i <= n; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; i <= n; i++) {\n      biaoji = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            biaoji = 1;\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n        if (biaoji == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i <= n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else if (str[i] != '$' && str[i] != '?')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= n; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31473", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint amount(char c, char a[101]) {\n  int i, amount = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == c)\n      amount = amount + 1;\n  }\n  return amount;\n}\n\nvoid match(char a[101]) {\n  int i, j;\n  int p, q;\n  p = amount('(', a);\n  q = amount(')', a);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; a[j] != '\\0'; j++) {\n        if (a[j] == '(')\n          break;\n        else if (a[j] == ')') {\n          a[i] = ' ';\n          a[j] = ' ';\n          break;\n        }\n      }\n    }\n  }\n\n  if (amount('(', a) < p || amount(')', a) < q)\n    return match(a);\n}\n\nint main() {\n  char s[101];\n  int i;\n  for (; scanf(\"%s\", s) != EOF;) {\n    cout << s << \"\\n\";\n    match(s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31474", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char b[100];\n  int i, j, t, l, k = 2;\n  while (1) {\n    char a[100];\n    a[0] = '\\0';\n    cin >> a;\n    l = strlen(a);\n    if (l == 0)\n      break;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[l] = '\\0';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        t = 0;\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            t--;\n          if (a[j] == ')')\n            t++;\n          if (t == 1) {\n            b[i] = b[j] = ' ';\n            a[i] = a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31475", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findl(int i, char a[102], int n);\nint find(int i, char a[102]);\nint main() {\n  char a[102];\n  memset(a, '\\n', 102);\n  while (scanf(\"%s \", a)) {\n    int n = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < n; i++) {\n      int x = 0;\n      if (a[i] == '(' && findl(i, a, n) > n)\n        cout << \"$\";\n      else if (a[i] == ')' && find(i, a) < 0)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n}\nint findl(int i, char a[102], int n) {\n  int k = i + 1;\n  while (k < n) {\n    if (a[k] == '(')\n      k = findl(k, a, n);\n    else if (a[k] == ')')\n      return k;\n    k++;\n  }\n  return n + 1;\n}\nint find(int i, char a[102]) {\n  int k = i - 1;\n  while (k >= 0) {\n    if (a[k] == ')')\n      k = find(k, a);\n    else if (a[k] == '(')\n      return k;\n    k--;\n  }\n  return -1;\n}\n"}
{"label": "17", "index": "31476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid peidui(char str[], int len);\nint main() {\n  int n, i;\n  char s[1000], s1[5];\n  cin >> n;\n\n  cin >> s1;\n  for (i = 1; i <= n; i++) {\n\n    cin >> s;\n    puts(s);\n    peidui(s, strlen(s));\n  }\n}\nvoid peidui(char str[], int len) {\n  int a1[500], n1, n2, m, i1, i2;\n  n1 = 0;\n  char *p;\n  char mark[1000];\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(') {\n      a1[n1] = m;\n      n1++;\n    }\n    mark[m] = ' ';\n  }\n  for (i1 = n1 - 1; i1 >= 0; i1--) {\n    int exist;\n    exist = 0;\n    for (i2 = a1[i1] + 1; i2 <= len - 1; i2++) {\n      if (str[i2] == ')' && mark[i2] != 'm') {\n        exist = 1;\n        mark[i2] = 'm';\n        mark[a1[i1]] = 'm';\n        break;\n      }\n    }\n    if (a1[i1] == len - 1) {\n      mark[len - 1] = '$';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(' && mark[m] != 'm') {\n      mark[m] = '$';\n    }\n    if (str[m] == ')' && mark[m] != 'm') {\n      mark[m] = '?';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (mark[m] == 'm')\n      cout << ' ';\n    else\n      printf(\"%c\", mark[m]);\n  }\n  cout << \" \";\n}\n"}
{"label": "17", "index": "31477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200];\n  while (cin.getline(a, 200)) {\n    int n = strlen(a);\n    int k;\n    printf(\"%s\\n\", a);\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '?')\n        a[i] = ' ';\n      if (a[i] == '$')\n        a[i] = ' ';\n      if (a[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k < 0)\n          a[i] = '?';\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?') {\n        a[i] = ' ';\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len;\n  int i, left = 0, right = 0;\n  char str[102], b[102];\n  while (cin.getline(str, 102)) {\n    len = strlen(str);\n    left = 0;\n    right = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      b[i] = ' ';\n      if (str[i] == '(')\n        left++;\n      if (str[i] == ')') {\n        if (left <= 0)\n          b[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == ')')\n        right++;\n      if (str[i] == '(') {\n        if (right <= 0)\n          b[i] = '$';\n        else\n          right--;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int l, i, j, num1, num2;\n  while (scanf(\"%s \", a)) {\n    num1 = 0;\n    num2 = 0;\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        num1++;\n      if (a[i] == ')') {\n        num2++;\n        if (num2 <= num1) {\n          a[i] = ' ';\n          for (j = i; j >= 0; j--)\n            if (a[j] == '(') {\n              a[j] = ' ';\n              break;\n            }\n        }\n        if (num2 > num1) {\n          a[i] = '?';\n          num2--;\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200];\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    scanf(\"%s\", a);\n    puts(a);\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == ')') {\n        for (m = j; m >= 0; m--)\n          if (a[m] == '(') {\n            a[m] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n    }\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        a[j] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, n, p, q;\n  while (cin.getline(a, 101)) {\n    int b[101] = {0};\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] == ')') {\n        q++;\n\n        if (q > p)\n\n        {\n\n          b[i] = 1;\n          q = q - 1;\n        }\n      }\n      if (a[i] == '(') {\n        p++;\n      }\n    }\n    p = 0;\n    q = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        q++;\n      }\n      if (a[i] == '(') {\n        p++;\n\n        if (p > q)\n\n        {\n\n          b[i] = 2;\n          p = p - 1;\n        }\n      }\n    }\n    for (i = 0; i <= n - 1; i++) {\n      cout << a[i];\n    }\n    cout << endl;\n    for (i = 0; i <= n - 1; i++) {\n      if (b[i] == 0) {\n        cout << \" \";\n      }\n      if (b[i] == 1) {\n        printf(\"?\");\n      }\n      if (b[i] == 2) {\n        cout << \"$\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, len, n, left = 0, right = 0, k;\n  char a[10][101] = {\"\u0000\"};\n  int b[10][101] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == '(') {\n        b[i][j] = -1;\n        left++;\n      }\n      if (a[i][j] == ')') {\n        b[i][j] = 1;\n        right++;\n      }\n    }\n\n    for (j = 0; left != 0, right != 0, j < len; j++) {\n      if (b[i][j] == 1) {\n\n        for (k = j - 1; k >= 0; k--) {\n          if (b[i][k] == -1) {\n            b[i][k] = 0;\n            b[i][j] = 0;\n            left--;\n            right--;\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    puts(a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (b[i][j] == -1)\n        printf(\"$\");\n      if (b[i][j] == 1)\n        cout << \"?\";\n      if (b[i][j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0, right = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    if (left >= 1)\n      for (int i = 1; i <= left; i++)\n        label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar x[1010] = \"\", tar[1010] = \"\";\nint len = 0, ctr;\n\nvoid F(int s) {\n  int i;\n  for (i = s + 1; i < len; i++) {\n    if (x[i] == '(' && tar[i] == '$' && ctr)\n      F(i);\n    if (x[i] == ')' && tar[i] == '?') {\n      tar[s] = tar[i] = ' ';\n      ctr--;\n      return;\n    }\n  }\n  return;\n}\n\nint main() {\n  int i;\n  while (scanf(\"%s \", x)) {\n    ctr = 0;\n    cout << x << endl;\n    len = strlen(x);\n    for (i = 0; i < len; i++) {\n      if (x[i] == '(')\n        tar[i] = '$';\n      else if (x[i] == ')') {\n        tar[i] = '?';\n        ctr++;\n      } else\n        tar[i] = ' ';\n    }\n    tar[len] = '\\0';\n    for (i = 0; i < len - 1; i++) {\n      if (x[i] == '(' && tar[i] == '$' && ctr)\n        F(i);\n    }\n    cout << tar << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31485", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar input[105], output[105];\n\nvoid f()\n\n{\n\n  memset(output, 0, sizeof(output));\n\n  int l = 0, r = 0;\n\n  int len = strlen(input);\n\n  int i;\n\n  for (i = 0; i < len; ++i)\n\n  {\n\n    output[i] = ' ';\n\n    if (input[i] == ')')\n\n    {\n\n      if (l <= 0)\n\n        output[i] = '?';\n\n      else\n\n      {\n        l--;\n      }\n\n    }\n\n    else if (input[i] == '(')\n\n      l++;\n  }\n\n  l = r = 0;\n\n  for (i = len; i >= 0; --i)\n\n  {\n\n    if (input[i] == '(')\n\n    {\n\n      if (r <= 0)\n\n        output[i] = '$';\n\n      else\n\n        r--;\n\n    }\n\n    else if (input[i] == ')')\n\n      r++;\n  }\n\n  cout << input << endl;\n\n  printf(\"%s\\n\", output);\n}\nint main() {\n\n  while (cin.getline(input, 105)) {\n\n    f();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200];\n  while (cin.getline(a, 200)) {\n    int n = strlen(a);\n    int k;\n    printf(\"%s\\n\", a);\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '?')\n        a[i] = ' ';\n      if (a[i] == '$')\n        a[i] = ' ';\n      if (a[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k < 0)\n          a[i] = '?';\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?') {\n        a[i] = ' ';\n      }\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid right(int i, int j) {\n  if (s[i] == '\\0')\n    ;\n  else if (s[i] == '(') {\n    s[i] = '$';\n    right(i + 1, j + 1);\n  } else if (s[i] == ')') {\n    if (j == 0) {\n      s[i] = '?';\n      right(i + 1, j);\n    } else {\n      for (int k = i;; k--)\n        if (s[k] == '$') {\n          s[k] = ' ';\n          break;\n        }\n      s[i] = ' ';\n      right(i + 1, j - 1);\n    }\n  } else {\n    s[i] = ' ';\n    right(i + 1, j);\n  }\n}\nint main() {\n  for (; cin >> s;) {\n    printf(\"%s\\n\", s);\n    right(0, 0);\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][100];\n  int c[100], i, j, k = 0;\n  while ((scanf(\"%s\", s[k])) != EOF) {\n    puts(s[k]);\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (s[k][i] == '(')\n        c[i] = -1;\n      else if (s[k][i] == ')')\n        c[i] = 1;\n      else\n        c[i] = 0;\n    }\n    for (i = 1; i < strlen(s[k]); i++)\n      for (j = 0; j < strlen(s[k]) - i; j++)\n        if (c[j] == -1 && c[j + i] == 1) {\n          c[j] = 0;\n          c[j + i] = 0;\n        }\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (c[i] == 0)\n        cout << \" \";\n      else if (c[i] == -1)\n        cout << \"$\";\n      else if (c[i] == 1)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, length;\n  int i;\n  while (cin.getline(line, sizeof(line))) {\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    pos_i = -1, left = 0, right = 0;\n    length = strlen(line);\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos_i++;\n        pos[pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (right >= left)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[length] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint j = 1;\nint main() {\n  char a[101];\n  a[0] = 0;\nl:\n  scanf(\"%s\", a);\n  if (a[0] == 0)\n    return 0;\n  else\n    cout << a << \"\\n\";\n  int r, i, k;\n  r = strlen(a);\n  for (i = r - 1; i >= 0; i--) {\n    if (a[i] != '(' && a[i] != ')')\n      a[i] = ' ';\n    else if (a[i] == '(') {\n      for (k = i; k <= r - 1; k++) {\n        if (a[k] == ')') {\n          a[i] = ' ';\n          a[k] = ' ';\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= r - 1; i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n  }\n  printf(\"%s\\n\", a);\n  return main();\n}\n"}
{"label": "17", "index": "31491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[201], done[201];\n  int pos[200];\n  int left, right;\n  int i, count, len;\n  while (cin.getline(sen, 200)) {\n    count = 0;\n    left = 0;\n    right = 0;\n    for (i = 0; i < 200; i++)\n      done[i] = ' ';\n\n    len = strlen(sen);\n    for (i = 0; i < len; i++) {\n      if (sen[i] == '(') {\n        pos[count] = i;\n        done[pos[count]] = '$';\n        left++;\n        count++;\n      }\n      if (sen[i] == ')') {\n        if (left <= right) {\n          done[i] = '?';\n        } else {\n          right++;\n          done[pos[count - 1]] = ' ';\n          count--;\n        }\n      }\n    }\n    printf(\"%s\\n\", sen);\n    for (i = 0; i < len; i++) {\n      cout << done[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nchar b[150];\nint sig[150];\nint main() {\n  int i, k = 0;\n  while (scanf(\"%s \", a)) {\n    k = 0;\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      b[i] = a[i];\n      if (a[i] == '(') {\n        b[i] = '$';\n        sig[k] = i;\n        k++;\n      }\n      if (a[i] == ')') {\n        k--;\n        if (k < 0) {\n          b[i] = '?';\n          k = 0;\n        } else\n          b[sig[k]] = 'a';\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << \" \";\n      else\n        cout << b[i];\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "17", "index": "31493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[11][101] = {{'\\0'}}, s0[101];\n  int i = 0, j, k, l, c;\n  while (i <= 10) {\n    scanf(\"%s\", s[i]);\n    strcpy(s0, s[i]);\n    l = strlen(s[i]);\n    for (j = l - 1; j >= 0; j--) {\n      c = 0;\n      if (s[i][j] == '(') {\n        for (k = j; k <= l - 1; k++) {\n          if (s[i][k] == ')') {\n            c = 1;\n            s[i][k] = ' ';\n            s[i][j] = ' ';\n            break;\n            ;\n          }\n        }\n        if (c == 0)\n          s[i][j] = '$';\n      } else if (s[i][j] != ')')\n        s[i][j] = ' ';\n    }\n    for (j = 0; j <= l - 1; j++) {\n      if (s[i][j] == ')')\n        s[i][j] = '?';\n    }\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s0[j]);\n    cout << \"\\n\";\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n}\n"}
{"label": "17", "index": "31494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ans[101], a[101];\n  int n;\n  cin >> n;\n  while (n > 0) {\n\n    cin >> a;\n    int ll = strlen(a);\n    int bb[101] = {0};\n    int be;\n    be = -1;\n    int i = 0;\n    while (i < ll) {\n      while (a[i] != '(' && a[i] != ')') {\n        ans[i] = ' ';\n        i++;\n        if (i >= ll)\n          break;\n      }\n      if (a[i] == '(') {\n        bb[i + 1] = be;\n        be = i + 1;\n      }\n      if (a[i] == ')') {\n        if (be < 0)\n          ans[i] = '?';\n        else {\n          int t;\n          t = bb[be];\n          bb[be] = 0;\n          be = t;\n          ans[i] = ' ';\n        }\n      }\n      i++;\n    }\n    for (i = 0; i < ll; i++) {\n      if (a[i] == '(') {\n        if (bb[i + 1] == 0)\n          ans[i] = ' ';\n        else\n          ans[i] = '$';\n      }\n    }\n    for (i = 0; i < ll; i++) {\n      printf(\"%c\", a[i]);\n    }\n    cout << \" \";\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", ans[i]);\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100];\nchar a[100];\nint b[100];\nint num = 0;\nint i, j;\nvoid f() {\n  for (i = 0; i < strlen(s); i++)\n\n    a[i] = ' ';\n\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      b[num] = i;\n      a[i] = '$';\n      num++;\n\n    } else if (s[i] == ')' && num > 0) {\n      num--;\n      a[b[num]] = ' ';\n\n    } else if (s[i] == ')' && num <= 0)\n      a[i] = '?';\n  }\n  for (i = 0; i < strlen(s); i++) {\n    cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  while (cin >> s) {\n    num = 0;\n    cout << s << endl;\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, k, l, n;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < l; i++)\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--)\n          if (b[j] == '$') {\n            b[i] = b[j] = ' ';\n            break;\n          }\n      }\n    puts(a);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31497", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n    cin >> a;\n    printf(\"%s\\n\", a);\n    m = strlen(a);\n    for (i = 0; i < m; i++) {\n      if ((a[i] != '(') && (a[i] != ')')) {\n        a[i] = ' ';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == ')') {\n        for (k = i; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          a[i] = '?';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][105] = {'\\0'}, a;\n  int i, j, count, cleft, cright;\n  i = j = 0;\n  while ((a = cin.get()) != EOF) {\n    if (a != '\\n') {\n      s[i][j] = a;\n      j++;\n    } else if (a == '\\n') {\n      i++;\n      j = 0;\n    }\n  }\n  count = i;\n  cleft = cright = 0;\n  for (i = 0; i < count; i++) {\n    cout << s[i] << endl;\n    for (j = 0; j < strlen(s[i]); j++) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright > cleft) {\n        s[i][j] = '?';\n        cright -= 1;\n      }\n    }\n    cleft = cright = 0;\n    for (j = strlen(s[i]) - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright < cleft) {\n        s[i][j] = '$';\n        cleft -= 1;\n      }\n    }\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] != '?' && s[i][j] != '$')\n        s[i][j] = ' ';\n    if (i == count - 1)\n      cout << s[i];\n    else\n      cout << s[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31499", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101] = {0};\n  while (scanf(\"%s\", s) != EOF) {\n    int i, j, l, t1, t2;\n    printf(\"%s\\n\", s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(') {\n        t1 = 1;\n        t2 = 0;\n        for (j = i + 1; j < l; j++) {\n          if (s[j] == '(')\n            t1++;\n          if (s[j] == ')')\n            t2++;\n          if (t1 == t2) {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n      } else\n        s[i] = ' ';\n\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "31500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1001];\n  int n;\n  while (~scanf(\"%s\", str)) {\n    n = strlen(str);\n    printf(\"%s\", str);\n    printf(\"\\n\");\n    for (int i = 1; i < n; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\", str);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "31501", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[1000];\n  int i = 0, j = 0, length = 0, t1 = 0, t2 = 0;\n  int flag = 0, left = 0, right = 0;\n  while (cin >> string) {\n    cout << string << endl;\n    length = strlen(string);\n    flag = 1, left = 0, right = 0;\n    t1 = 0, t2 = 0;\n    while (flag == 1) {\n      for (i = 0; i < length; i++) {\n        if (string[i] == '(') {\n          left = i;\n          t1 = 1;\n        }\n\n        else if (t1 == 1 && string[i] == ')') {\n          right = i;\n          t2 = 1;\n          break;\n        }\n\n        else\n          continue;\n      }\n\n      if (t1 == 1 && t2 == 1)\n\n      {\n        string[left] = '0';\n        string[right] = '0';\n        t1 = 0;\n        t2 = 0;\n        flag = 1;\n      } else\n        flag = 0;\n    }\n\n    for (i = 0; i < length; i++) {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else\n        string[i] = ' ';\n    }\n\n    for (i = 0; i < length; i++) {\n      cout << string[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch1[101], ch2[101];\n  int i = 0, j = 0, k = 0, len = 0;\n  while (cin.getline(ch1, 101)) {\n    len = strlen(ch1);\n    int num = 0;\n    for (i = 0; i < len; i++) {\n      ch2[i] = ' ';\n      if (ch1[i] == '(') {\n        ch2[i] = '$';\n        num++;\n      }\n      if (ch1[i] == ')') {\n        ch2[i] = '?';\n        num--;\n        if (num == 0) {\n          ch2[i] = ' ';\n          for (j = 0; j < i; j++) {\n            if (ch1[j] == '(') {\n              for (k = j; k <= i; k++) {\n                ch2[k] = ' ';\n                break;\n                break;\n              }\n            }\n          }\n        }\n        if (num > 0) {\n          ch2[i] = ' ';\n          for (j = i; j >= 0; j--) {\n            if (ch2[j] == '$') {\n              ch2[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (num < 0)\n          num = 0;\n      }\n    }\n    ch2[len] = '\\0';\n    printf(\"%s\\n\", ch1);\n    cout << ch2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31503", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[200], temp[200];\n  int n, i, figure, tempnum[200];\n  scanf(\"%d \", &n);\n  while (cin >> ch) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        tempnum[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure > 0) {\n          figure--;\n          temp[tempnum[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    printf(\"%s %s \", ch, temp);\n  }\n}\n"}
{"label": "17", "index": "31504", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[105];\n  int mark[105] = {0};\n  while (cin.getline(a, 101)) {\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        mark[i] = 1;\n\n      if (a[i] == ')') {\n        mark[i] = -1;\n      }\n    }\n    for (int i = 1; i < strlen(a); i++) {\n      if (mark[i] == -1) {\n        for (int j = i - 1; j >= 0; j--) {\n          if (mark[j] == 1) {\n            mark[i] = 0;\n            mark[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (mark[i] == 0)\n        cout << \" \";\n      else if (mark[i] == 1)\n        cout << \"$\";\n      else\n        cout << \"?\";\n    }\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      mark[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31505", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char a[500] = {0}, b[500] = {0};\n  cin >> n;\n  for (j = 1; j <= n; j++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31506", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  for (cin >> n; n > 0; n--) {\n    char a[101];\n\n    scanf(\"%s \", a);\n    puts(a);\n    int i, j, k, l = strlen(a);\n    do {\n      for (j = 0; j < l; j++)\n        if (a[j] == ')')\n          break;\n      if (j != l) {\n        for (k = j; k >= 0; k--)\n          if (a[k] == '(')\n            break;\n        if (k < 0)\n          a[j] = '?';\n        else\n          a[j] = a[k] = ' ';\n      }\n    } while (j != l);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[102], str2[102];\n  int i, j;\n  while (cin.getline(str1, 102)) {\n    strcpy(str2, str1);\n    int len = strlen(str1);\n    for (i = 0; i < len; i++) {\n      if (str2[i] != '(' && str2[i] != ')') {\n        str2[i] = ' ';\n      } else {\n        if (str2[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (str2[j] == '(') {\n              str2[j] = ' ';\n              str2[i] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    cout << str1 << \"\\n\" << str2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, e, x, i, t, j, k;\n  char s[102];\n  cin >> n;\n  for (e = 0; e < n; e++) {\n    cin >> s;\n    printf(\"%s \", s);\n    x = strlen(s);\n    for (i = 0; i < x; i++) {\n      if (s[i] != '(' && s[i] != ')') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < x; j++) {\n          if (s[j] == ')') {\n            t = 0;\n            for (k = i + 1; k < j; k++) {\n              if (s[k] != ' ') {\n                t = 1;\n                break;\n              }\n            }\n            if (t == 0) {\n              s[i] = ' ';\n              s[j] = ' ';\n              i = -1;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << \" \";\n  }\n}\n"}
{"label": "17", "index": "31509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char str[101];\n    int final[101] = {0};\n    cin.getline(str, 101);\n    if (str[0] == '\\0')\n      break;\n    int i = 0, p = 0, q = 0, k = 0, flag = 0;\n    while (str[i] != '\\0') {\n      if (str[i] == '(')\n        final[i] = 1;\n      if (str[i] == ')') {\n        final[i] = 2;\n        for (int j = i; j >= 0; j--) {\n          if (final[j] == 1) {\n            final[i] = 0;\n            final[j] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    }\n    cout << str << endl;\n    while (str[k] != '\\0') {\n      if (final[k] == 1 || final[k] == 2) {\n        p = k;\n        if (flag == 0) {\n          q = k;\n          flag = 1;\n        }\n      }\n      k++;\n    }\n    for (int j = q; j <= p; j++) {\n      if (final[j] == 1)\n        cout << '$';\n      else if (final[j] == 2)\n        cout << '?';\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zhengli(char a[]) {\n  void panduan(char a[]);\n  int i, k, j;\n  k = strlen(a);\n  for (j = 0; j < 50; j++) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == '$')\n        a[i] = '(';\n      else if (a[i] == '?')\n        a[i] = ')';\n    }\n    panduan(a);\n  }\n}\nvoid panduan(char a[]) {\n  int i, k, flag = 0, j;\n  char b[110];\n  k = strlen(a);\n  b[k] = '\\0';\n  for (i = 0; i < k; i++) {\n    if (a[i] != '(' && a[i] != ')')\n      b[i] = ' ';\n    else if (a[i] == '(') {\n      if (flag == 1) {\n        b[j] = '$';\n        j = i;\n        b[j] = '$';\n      } else {\n        flag = 1;\n        j = i;\n        b[j] = '$';\n      }\n    } else {\n      if (flag == 1) {\n        b[j] = ' ';\n        flag = 0;\n        b[i] = ' ';\n      } else\n        b[i] = '?';\n    }\n  }\n  strcpy(a, b);\n}\nint main() {\n  int i, k;\n  char a[110];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    panduan(a);\n    zhengli(a);\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "17", "index": "31511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstruct m {\n  char a;\n  int n;\n} q[100];\nint main() {\n  char b[101] = {0};\n  int i, j, k, t, l;\n  while (cin >> b) {\n    cout << b << endl;\n    char c[101] = {0};\n    t = 0;\n    k = strlen(b);\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (b[i] == '(' || b[i] == ')') {\n        q[j].a = b[i];\n        q[j++].n = i;\n      }\n    i = 0;\n    while (i < j - t - 1) {\n      if (q[i].a == '(' && q[i + 1].a == ')') {\n        for (l = i; l < j - t - 2; l++)\n          q[l] = q[l + 2];\n\n        t = t + 2;\n        if (i != 0)\n          i = i - 1;\n      } else\n        i++;\n    }\n\n    for (i = 0; i < k; i++) {\n      c[i] = ' ';\n      b[i] = 0;\n    }\n    for (i = 0; i < j - t; i++) {\n      if (q[i].a == '(')\n        c[q[i].n] = '$';\n      else\n        c[q[i].n] = '?';\n    }\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31512", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char chn[120];\n  int i, l;\n  int z, t;\n  char a, b;\n  while (scanf(\"%s\", chn) != -1) {\n    l = strlen(chn);\n    printf(\"%s\\n\", chn);\n    while (1) {\n      z = -1;\n      t = 0;\n      for (i = 0; i < l; i++) {\n        if (z == -1 && chn[i] == '(')\n          z = i;\n        else if (z >= 0 && chn[i] == ')') {\n          chn[z] = ' ';\n          chn[i] = ' ';\n          t++;\n          break;\n        } else if (z >= 0 && chn[i] == '(')\n          z = i;\n      }\n      if (!t)\n        break;\n    }\n    for (i = 0; i < l; i++) {\n      if (chn[i] == '(')\n        chn[i] = '$';\n      else if (chn[i] == ')')\n        chn[i] = '?';\n      else\n        chn[i] = ' ';\n      cout << chn[i];\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[110];\n  while (cin >> s) {\n    cout << s << endl;\n    int l = strlen(s), i;\n    for (i = l - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        continue;\n      else if (s[i] == '(') {\n        int j;\n        for (j = i; j < l; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          s[i] = '$';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      if (s[i] == ')')\n        s[i] = '?';\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], ss[300];\n  int a[300];\n  int l, i, t;\n  do {\n    if (scanf(\"%s\", s) == EOF)\n      break;\n\n    if (s[0] == '\\0')\n      break;\n    l = strlen(s);\n    if (l == 0)\n      break;\n    t = 0;\n    for (i = 0; i < l; i++) {\n      ss[i] = ' ';\n      if (s[i] == '(') {\n        t++;\n        a[t] = i;\n      }\n      if (s[i] == ')') {\n        if (t == 0) {\n          ss[i] = '?';\n          continue;\n        }\n        t--;\n      }\n    }\n    for (i = 1; i <= t; i++)\n      ss[a[i]] = '$';\n    ss[l] = '\\0';\n    puts(s);\n    puts(ss);\n  } while (0 == 0);\n  return 0;\n}\n"}
{"label": "17", "index": "31515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (true) {\n    char a[110] = {'\\0'}, b[110] = {'\\0'};\n    int i = 0;\n    char x = '\\0';\n    while (true) {\n      x = getchar();\n      if (x == '\\n')\n        break;\n      a[i] = x;\n      b[i] = x;\n      i++;\n    }\n    int k = 1, j, n;\n    while (k < i) {\n      for (j = 0; j < i - k; j++) {\n        int zhongjian = 0, l;\n        if (k != 1) {\n          for (l = j + 1; l < j + k; l++) {\n            if (a[l] == '(' || a[l] == ')')\n              zhongjian = 1;\n          }\n        }\n\n        if (a[j] == '(' && a[j + k] == ')' && zhongjian == 0) {\n          a[j] = '\\0';\n          a[j + k] = '\\0';\n        }\n      }\n\n      k = k + 1;\n    }\n    for (n = 0; n < i; n++) {\n\n      if (a[n] == '(')\n        a[n] = '$';\n      else if (a[n] == ')')\n        a[n] = '?';\n      else\n        a[n] = ' ';\n    }\n\n    for (n = 0; n < i; n++)\n      cout << b[n];\n    cout << endl;\n    for (n = 0; n < i; n++)\n      cout << a[n];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n\n  int ww = 0;\n  while ((ww = getchar()) != -1) {\n    a[1] = ww;\n    for (int i = 2; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        printf(\" \");\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int m = 1; m <= n; m++) {\n    char str[105], str2[105];\n    cin >> str;\n    int stack[105];\n    int len = strlen(str), k = 0;\n    for (int i = 0; i < len; i++) {\n      str2[i] = ' ';\n    }\n    str2[len] = '\\0';\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k == 0 || stack[k - 1] > 0) {\n          stack[k++] = i + 1;\n        } else\n          k--;\n      } else if (str[i] == '(') {\n        stack[k++] = -i - 1;\n      }\n    }\n    for (int i = 0; i < k; i++) {\n      if (stack[i] < 0)\n        str2[-stack[i] - 1] = '$';\n      else\n        str2[stack[i] - 1] = '?';\n    }\n    cout << str << endl;\n    cout << str2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar in[110], work[110], out[110];\nint len;\nvoid pick(int L) {\n  for (int i = L - 1; i >= 0; i--) {\n    if (work[i] == '(') {\n      for (int j = 0; j < L - i; j++) {\n        if (work[i + j] == ')') {\n          work[i] = ' ';\n          work[i + j] = ' ';\n          pick(len);\n          break;\n        }\n      }\n    }\n  }\n}\nvoid mark(int L) {\n  for (int i = 0; i < L; i++) {\n    if (work[i] == '(')\n      out[i] = '$';\n    if (work[i] == ')')\n      out[i] = '?';\n  }\n}\nint main() {\n  while (cin) {\n    cin.getline(in, 110);\n    len = strlen(in);\n    for (int i = 0; i < len; i++) {\n      out[i] = ' ';\n      work[i] = in[i];\n    }\n    pick(len);\n    mark(len);\n    for (int i = 0; i < len; i++) {\n      cout << in[i];\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      cout << out[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31519", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 101; i++)\n      a[i] = 0;\n\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    m = strlen(a);\n    for (i = 0; i < m; i++) {\n      if ((a[i] != '(') && (a[i] != ')'))\n        a[i] = ' ';\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == ')') {\n        for (k = i; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          a[i] = '?';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31520", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, left[102], len, j, k;\n  char *p = NULL;\n  char str[102];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    k = 0;\n    scanf(\"%s \", str);\n    cout << str << endl;\n    len = strlen(str);\n    p = str;\n    for (; p < str + len; p++) {\n      if (*p != '(' && *p != ')')\n        *p = ' ';\n    }\n    for (j = 0; j < len; j++) {\n      if (str[j] == '(') {\n        k++;\n        left[k] = j;\n      }\n      if (str[j] == ')') {\n        if (k == 0)\n          str[j] = '?';\n        else {\n          left[k] = -1;\n          k--;\n        }\n      }\n    }\n    if (k == 0) {\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?')\n          cout << \" \";\n        else\n          printf(\"%c\", str[j]);\n      }\n      cout << endl;\n    } else {\n      for (; k > 0; k--)\n        str[left[k]] = '$';\n      for (j = 0; j < len; j++) {\n        if (str[j] != '?' && str[j] != '$')\n          cout << \" \";\n        else\n          cout << str[j];\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[160], ans[160];\n  int st[160], i, si;\n  for (; scanf(\"%s\", s) != EOF;) {\n    for (ans[0] = ' ', si = i = 0; i < strlen(s);\n         si -= (s[i] == ')' && si > 0), ans[++i] = ' ')\n      if (s[i] == '(')\n        st[si++] = i;\n      else if (s[i] == ')')\n        ans[i] = (si > 0) ? ' ' : '?';\n    for (ans[strlen(s)] = '\\0', i = 0; i < si; i++) {\n      ans[st[i]] = '$';\n    }\n    printf(\"%s\\n%s\\n\", s, ans);\n  }\n}\n"}
{"label": "17", "index": "31522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int length, i, j;\n  while (cin.getline(line, 101)) {\n    length = strlen(line);\n    for (i = 0; i < length; i++)\n      cout << line[i];\n    cout << endl;\n    for (i = 0; i < length; i++) {\n      if (line[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[i] = 0;\n            line[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (line[i] == '(')\n        cout << \"$\";\n      if (line[i] != '(' && line[i] != ')')\n        cout << \" \";\n      if (line[i] == ')')\n        cout << \"?\";\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  int i, left = 0, right = 0;\n  char str[102], b[102];\n  while (cin.getline(str, 102)) {\n    len = strlen(str);\n    left = 0;\n    right = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      b[i] = ' ';\n      if (str[i] == '(')\n        left++;\n      if (str[i] == ')') {\n        if (left <= 0)\n          b[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == ')')\n        right++;\n      if (str[i] == '(') {\n        if (right <= 0)\n          b[i] = '$';\n        else\n          right--;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pipei(char x[], int l) {\n  int i, j, count;\n  for (; count != 0;) {\n    count = 0;\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(')\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (x[j] != '(' && x[j] != ')')\n          continue;\n        if (x[j] == '(')\n          break;\n        if (x[j] == ')') {\n          count++;\n          x[i] = 32;\n          x[j] = 32;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (x[i] != '(' && x[i] != ')')\n      printf(\" \");\n    else if (x[i] == '(')\n      printf(\"$\");\n    else\n      printf(\"?\");\n  }\n  printf(\" \");\n}\nint main() {\n  char x[101];\n  int l, i;\n  for (;;) {\n\n    cin >> x;\n    if (x[0] == '\u0000')\n      break;\n    l = strlen(x);\n    puts(x);\n    pipei(x, l);\n    for (i = 0; i < l; i++)\n      x[i] = '\u0000';\n  }\n}\n"}
{"label": "17", "index": "31525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint deal();\nchar ori[101] = {\"\\0\"};\nint out[101] = {0};\nint main() {\n  int i;\n  while (cin.getline(ori, 101)) {\n    deal();\n    printf(\"%s\\n\", ori);\n    for (i = 0; ori[i] != '\\0'; i++) {\n      if (out[i] == 1)\n        cout << '$';\n      else if (out[i] == 2)\n        printf(\"?\");\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\nint deal() {\n  int i, j;\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (ori[i] == '(')\n      out[i] = 1;\n    else if (ori[i] == ')')\n      out[i] = 2;\n    else\n      out[i] = 0;\n  }\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (out[i] == 2) {\n      for (j = i; j >= 0; j--) {\n        if (out[j] == 1) {\n          out[i] = 0;\n          out[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char b[100];\n  int i, j, t, l, k = 2;\n  while (1) {\n    char a[100];\n    a[0] = '\\0';\n    scanf(\"%s\", a);\n    l = strlen(a);\n    if (l == 0)\n      break;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[l] = '\\0';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        t = 0;\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            t--;\n          if (a[j] == ')')\n            t++;\n          if (t == 1) {\n            b[i] = b[j] = ' ';\n            a[i] = a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[205];\n  while (cin.getline(a, 200)) {\n    char b[205];\n    int x[205] = {-1}, y[205] = {-1}, i, n, p, q;\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        p++;\n        x[p] = i;\n      }\n      if (a[i] == ')') {\n        q++;\n        y[q] = i;\n        if ((p != 0) && (x[p] < y[q])) {\n          x[p] = -1;\n          y[q] = -1;\n          p--;\n          q--;\n        }\n      }\n    }\n    for (i = 1; i <= p; i++)\n      b[x[i]] = '$';\n    for (i = 1; i <= q; i++)\n      b[y[i]] = '?';\n    cout << a << endl;\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, c, d, e, f, g, k, j, l, b[100];\n  scanf(\"%d\", &n);\n  char a[1000][150], h[1000][150];\n  for (i = 0; i < n; i++) {\n    cin >> a[i];\n    b[i] = strlen(a[i]);\n    e = 0;\n    for (j = 0; j < b[i]; j++) {\n      if (a[i][j] == '(') {\n        h[i][j] = '$';\n        e++;\n      }\n      if (a[i][j] == ')') {\n        h[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')')\n        h[i][j] = ' ';\n    }\n    for (l = 0; l < e; l++) {\n      for (j = 0; j < b[i]; j++) {\n        c = f = d = -1;\n        if (h[i][j] == '$') {\n          c = j;\n          g = c;\n          for (g = c; g < b[i]; g++) {\n            if (h[i][g] == '?') {\n              f = g;\n              break;\n            }\n          }\n          for (k = f - 1; k >= c; k--) {\n            if (h[i][k] == '$') {\n              d = k;\n              break;\n            }\n          }\n          if (d != -1 && f != -1) {\n            h[i][d] = ' ';\n            h[i][f] = ' ';\n          }\n          break;\n        }\n      }\n    }\n    for (j = 0; j < b[i]; j++) {\n      cout << a[i][j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < b[i]; j++) {\n      cout << h[i][j];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31529", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[101], b[101];\nint panduan[101];\nint l;\nvoid deal(int k) {\n  if (k > 0) {\n    if (a[k - 1] == ')') {\n      panduan[k - 1] = 1;\n      deal(k - 1);\n    } else if (a[k - 1] == '(') {\n      panduan[k - 1] = 2;\n      for (int i = k; i < l; i++)\n        if (panduan[i] == 1) {\n          panduan[k - 1] = 0;\n          panduan[i] = 0;\n          break;\n        }\n      deal(k - 1);\n    } else\n      deal(k - 1);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 101; i++) {\n    a[i] = ' ';\n    b[i] = ' ';\n    panduan[i] = 0;\n  }\n  while (cin >> a) {\n    l = strlen(a);\n    deal(l);\n    for (i = 0; i < l; i++) {\n      if (panduan[i] == 1)\n        b[i] = '?';\n      if (panduan[i] == 2)\n        b[i] = '$';\n    }\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = ' ';\n      b[i] = ' ';\n      panduan[i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31530", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[200], str1[200];\n  while (scanf(\"%s\", str1) != EOF) {\n    int m;\n    m = strlen(str1);\n    strcpy(str, str1);\n    int i, j;\n    for (i = 1; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (i + j < m) {\n          if (str[j] == '(' && str[j + i] == ')') {\n            str[j] = 'a';\n            str[j + i] = 'a';\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\\n\", str1);\n    printf(\"%s\\n\", str);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31531", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, t, j, la, k, bb, pp;\n  while (cin.getline(a, 101, '\\n')) {\n    cout << a << endl;\n    la = strlen(a);\n    for (i = 0; i < la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    t = 0;\n    while (t == 0) {\n      t = 1;\n      for (i = la - 1; i >= 0; i--) {\n        if (a[i] == ')')\n          break;\n        if (a[i] == '(') {\n          a[i] = '$';\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == ')') {\n          a[i] = '?';\n          break;\n        }\n        if (a[i] == '(') {\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(') {\n          for (j = i + 1; j < la; j++) {\n            k = 2;\n            if (a[j] == '(') {\n              k = 0;\n              break;\n            }\n            if (a[j] == ')') {\n              k = 1;\n              a[j] = ' ';\n              break;\n            }\n          }\n          if (k == 1) {\n            a[i] = ' ';\n          }\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          t = 0;\n          break;\n        }\n      }\n    }\n    for (i = la - 1; i >= 0; i--) {\n      if (a[i] != ' ')\n        break;\n    }\n    bb = i;\n    for (i = 0; i < la; i++) {\n      if (a[i] != ' ')\n        break;\n    }\n    pp = i;\n    for (j = pp; j <= bb; j++)\n      cout << a[j];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31532", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char str1[120];\n  char str[120];\n  scanf(\"%d \", &n);\n\n  for (int i = 1; i <= n; i++) {\n    memset(str, '\\0', sizeof(str));\n    cin >> str1;\n    strcpy(str, str1);\n\n    for (int len = 1; len < strlen(str); len++) {\n      for (int j = 0; j < strlen(str) - len; j++) {\n        int k = j + len;\n        if (str[j] == '(' && str[k] == ')') {\n          str[j] = '0';\n          str[k] = '0';\n        }\n      }\n    }\n\n    for (int i1 = 0; str[i1] != '\\0'; i1++) {\n      if (str[i1] == '(')\n        str[i1] = '$';\n      else if (str[i1] == ')')\n        str[i1] = '?';\n      else\n        str[i1] = ' ';\n    }\n    cout << str1 << endl;\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n  int pp = 2;\n  int ww = 0;\n  while ((ww = getchar()) != -1) {\n    a[1] = ww;\n    for (int i = 2; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        cout << \" \";\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31534", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int b[200], i, j;\n  char a[200];\n  while (scanf(\"%s \", a)) {\n    memset(b, 0, sizeof(b));\n\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(')\n        b[i] = 1;\n      if (a[i] == ')') {\n        b[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(' && b[i] == 1)\n        printf(\"$\");\n      else if (a[i] == ')' && b[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n\n    scanf(\"%s \", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0;\n\n  char s[101] = {0};\n  while (scanf(\"%s \", s)) {\n    int a = 0, b = 0;\n    cout << s << endl;\n    int flag[101] = {0};\n    for (i = 0; i <= strlen(s) - 1; i++) {\n      if (s[i] == '(')\n        a++;\n      if (s[i] == ')') {\n        a--;\n        if (a < 0) {\n          a = 0;\n          flag[i] = -1;\n        }\n      }\n    }\n    for (i = strlen(s) - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        b++;\n      if (s[i] == '(') {\n        b--;\n        if (b < 0) {\n          b = 0;\n          flag[i] = 1;\n        }\n      }\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (flag[i] != 0)\n        break;\n    }\n    for (j = strlen(s) - 1; j >= 0; j--) {\n      if (flag[j] != 0)\n        break;\n    }\n    for (i = i; i <= j; i++) {\n      if (flag[i] == 1)\n        cout << \"$\";\n      else if (flag[i] == 0)\n        printf(\" \");\n      else if (flag[i] == -1)\n        cout << \"?\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  for (scanf(\"%d%*c\", &n); n > 0; n--) {\n    char a[101];\n\n    scanf(\"%s \", a);\n    puts(a);\n    int i, j, k, l = strlen(a);\n    do {\n      for (j = 0; j < l; j++)\n        if (a[j] == ')')\n          break;\n      if (j != l) {\n        for (k = j; k >= 0; k--)\n          if (a[k] == '(')\n            break;\n        if (k < 0)\n          a[j] = '?';\n        else\n          a[j] = a[k] = ' ';\n      }\n    } while (j != l);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic char c[2][101];\nint i, n;\nvoid search(int a) {\n  for (i++; i < n; i++)\n    if (c[0][i] == ')') {\n      c[1][a] = ' ';\n      c[1][i] = ' ';\n      break;\n    } else if (c[0][i] == '(')\n      search(i);\n    else\n      c[1][i] = ' ';\n  if (i >= n)\n    c[1][a] = '$';\n}\nint main() {\n  while (scanf(\"%s\", &c[0]) != EOF) {\n    for (n = 0; c[0][n] != '\\0'; n++)\n      ;\n    for (i = 0; i < n; i++)\n      if (c[0][i] == ')')\n        c[1][i] = '?';\n      else if (c[0][i] == '(')\n        search(i);\n      else\n        c[1][i] = ' ';\n    puts(c[0]);\n    puts(c[1]);\n    for (i = 0; i < n; i++) {\n      c[0][i] = 0;\n      c[1][i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len, p;\n  while (cin.getline(a, 101)) {\n    printf(\"%s\\n\", a);\n    len = strlen(a);\n    for (i = len; i >= 0; i--) {\n\n      if (a[i] == '(') {\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == ')') {\n            a[i] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[i] == '1')\n          continue;\n        else\n          a[i] = '$';\n      }\n    }\n    for (p = 0; a[p] != '\\0'; p++) {\n      if (a[p] == ')') {\n        for (j = p - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[p] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[p] == '1')\n          continue;\n        else\n          a[p] = '?';\n      }\n    }\n    for (k = 0; a[k] != '\\0'; k++) {\n      if ((a[k] != '$') && (a[k] != '?'))\n        a[k] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char kuohaoin[201] = {0}, kuohao1[201] = {0}, kuohaoout[201] = {0};\n  int i, j, len;\n  while (cin >> kuohaoin) \n  {\n    len = strlen(kuohaoin); \n    for (i = 0; i < len; i++) {\n      kuohao1[i] = kuohaoin[i]; \n      kuohaoout[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) \n    {\n      if (kuohao1[i] == '(') \n      {\n        kuohaoout[i] = '$';           \n        for (j = i + 1; j < len; j++) \n        {\n          if (kuohao1[j] == ')') \n          {\n            kuohao1[j] = 's';   \n            kuohaoout[i] = ' '; \n            kuohao1[i] = 's';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      if (kuohao1[i] == ')')\n        kuohaoout[i] = '?'; \n    cout << kuohaoin << endl;\n    cout << kuohaoout << endl;\n    for (i = 0; i < len; i++) \n    {\n      kuohaoin[i] = 0;\n      kuohao1[i] = 0;\n      kuohaoout[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[1000];\n\nint findri(int x, int y) {\n  int p;\n  if (s[x] == '\\0')\n    return -1;\n  if (s[x] == '(') {\n    p = findri(x + 1, y + 1);\n    if (p == -1) {\n      s[x] = '$';\n      return -1;\n    } else {\n      s[x] = ' ';\n      return findri(p + 1, y);\n    }\n  } else if (s[x] == ')') {\n    if (y == 0) {\n      s[x] = '?';\n      return findri(x + 1, y);\n    } else {\n      s[x] = ' ';\n      return x;\n    }\n\n  } else {\n    s[x] = ' ';\n    return findri(x + 1, y);\n  }\n}\n\nint main() {\n  int len;\n  int i;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << '\\n';\n    findri(0, 0);\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << '\\n';\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31541", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101]; \n  int pos[100];               \n  int left = 0, right = 0;    \n  int pos_i, len;             \n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0; \n    len = strlen(line);\n    for (i = 0; i < 100; i++) \n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') \n      {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')')\n        if (left <= right) \n          label[i] = '?';  \n        else {\n          right++;\n          pos_i--;\n        } \n    }\n    if (pos_i >= 0) \n    {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$'; \n    }\n    label[len] = '\\0'; \n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n\n  int i, n;\n\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    while (scanf(\"%s\", a) != EOF) {\n\n      printf(\"%s\", a);\n      cout << \"\\n\";\n\n      i = 0;\n\n      while (a[i] != '\\0') {\n\n        if (a[i] == '(') {\n\n          b[i] = '$';\n\n        } else if (a[i] == ')') {\n\n          int k;\n\n          for (k = i - 1; k >= 0; k--) {\n\n            if (b[k] == '$') {\n\n              b[i] = b[k] = ' ';\n\n              break;\n            }\n          }\n\n          if (k == -1)\n\n          {\n            b[i] = '?';\n          }\n\n        } else {\n\n          b[i] = ' ';\n        }\n\n        i++;\n      }\n\n      printf(\"%s\", b);\n\n      cout << \"\\n\";\n\n      memset(b, 0, 500);\n\n      memset(a, 0, 500);\n\n      fflush(stdin);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101];\nint c[101];\nvoid match(int i, int len) {\n  int k = i + 1;\n  if (c[i] != 0) {\n    while (k < len) {\n      if (a[k] == '(' && c[k] == 1) {\n        match(k, len);\n      }\n      if (a[k] == ')' && c[i] == 1 && c[k] == -1) {\n        c[i] = 0;\n        c[k] = 0;\n      }\n      k++;\n    }\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", &a);\n    int len = strlen(a);\n    for (int j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        c[j] = 1;\n      } else if (a[j] == ')') {\n        c[j] = -1;\n      } else {\n        c[j] = 0;\n      }\n    }\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1) {\n        for (int k = j + 1; k < len; k++) {\n          if (c[k] == 1)\n            break;\n          if (c[k] == -1) {\n            c[k] = 0;\n            c[j] = 0;\n            j = -1;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", a);\n    for (int j = 0; j < len; j++) {\n      if (c[j] == 1)\n        printf(\"$\");\n      if (c[j] == -1)\n        printf(\"?\");\n      if (c[j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int left = 0;\n    int p[105], t = 0;\n    int k, len;\n    char a[105];\n    char b[105];\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (k = 0; k < len; k++)\n      b[k] = ' ';\n    b[len] = '\\0';\n    for (k = 0; k < len; k++) {\n      if (a[k] == '(') {\n        b[k] = '$';\n        p[t] = k;\n        t++;\n        left++;\n      }\n      if (a[k] == ')') {\n        if (left != 0) {\n          t--;\n          b[p[t]] = ' ';\n          left--;\n        } else {\n          b[k] = '?';\n        }\n      }\n    }\n    printf(\"%s\", a);\n    cout << \"\\n\";\n    printf(\"%s\", b);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint a;\nchar s1[101], s2[101];\nint main() {\n  int n, l, i, j;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++) {\n    memset(s1, 0, 101);\n    memset(s2, 0, 101);\n    scanf(\"%s\", s1);\n    a = strlen(s1);\n    int k[100] = {0}, b = 0;\n    for (i = 0; i < a; i++) {\n      if (s1[i] == '(') {\n        for (j = i; j < a; j++) {\n          if (s1[j] == '(')\n            k[i]++;\n          else if (s1[j] == ')')\n            k[i]--;\n        }\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (s1[j] == ')')\n            k[i]++;\n          else if (s1[j] == '(')\n            k[i]--;\n        }\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (s1[i] == ')') {\n        b = 0;\n        for (j = i - 1; j >= 0; j--)\n          if (s1[j] == ')' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == '(') {\n        b = 0;\n        for (j = i + 1; j < a; j++)\n          if (s1[j] == '(' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (k[i] > 0) {\n        if (s1[i] == '(')\n          s2[i] = '$';\n        else if (s1[i] == ')')\n          s2[i] = '?';\n      } else\n        s2[i] = ' ';\n    }\n    printf(\"%s\\n\", s1);\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s2[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "31546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar c[110];\nint Try() {\n  int i, j;\n  int L = -1, R = -1;\n  for (i = 0; i <= strlen(c) - 1; ++i) {\n    if (c[i] == '(')\n      L = i;\n  }\n  for (j = strlen(c) - 1; j > L; --j) {\n    if (c[j] == ')')\n      R = j;\n  }\n  if (L != -1 || R != -1) {\n    if (L == -1) {\n      c[R] = '?';\n    }\n\n    else if (R == -1) {\n      c[L] = '$';\n    } else if (L < R) {\n      c[L] = ' ';\n      c[R] = ' ';\n    } else if (L > R) {\n      c[L] = '$';\n      c[R] = '?';\n    }\n    Try();\n  }\n  if (L == -1 && R == -1)\n    return 1;\n}\nint main() {\n  int k;\n  while (scanf(\"%s \", c)) {\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      if (c[k] != '(' && c[k] != ')')\n        c[k] = ' ';\n    }\n    Try();\n    for (k = 0; k <= strlen(c) - 1; ++k) {\n      cout << c[k];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31547", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, m;\n  char a[150], b[150];\n  for (m = 0; m < 1000; m++) {\n    for (i = 0; i < 150; i++)\n      a[i] = 0, b[i] = 0;\n    scanf(\"%s\", a);\n    l = strlen(a);\n    if (l == 0)\n      break;\n    for (i = 0; i < l; i++)\n      b[i] = a[i];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        if (a[j] == '(') {\n          for (k = j + 1; k < l; k++) {\n            if (a[k] == '(')\n              break;\n            if (a[k] == ')') {\n              a[j] = 'a', a[k] = 'a';\n              break;\n            }\n          }\n        }\n    printf(\"%s\\n\", b);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, p, m;\n  char a[200], b[200], c[200];\n  i = 0;\n  while (scanf(\"%s \", a)) {\n    puts(a);\n    k = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[strlen(a)] = '\u0000';\n    c[strlen(a)] = '\u0000';\n    for (i = 0; i < strlen(a); i++)\n      c[i] = b[i];\n\n    for (p = 0; p < strlen(a); p++) {\n      k = 0;\n      for (i = 0; i < strlen(a); i++) {\n        if (b[i] == ' ')\n          continue;\n        else if (b[i] == '$') {\n          k++;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (b[j] == ' ')\n              continue;\n            else if (b[j] == '?') {\n              b[i] = ' ';\n              b[j] = ' ';\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            } else if (b[j] == '$')\n              break;\n          }\n        } else if (b[i] == '?' && k == 0)\n          c[i] = '?';\n      }\n    }\n    puts(c);\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31549", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n\n  int i, n;\n\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    while (scanf(\"%s\", a) != EOF) {\n\n      printf(\"%s\", a);\n      printf(\"\\n\");\n\n      i = 0;\n\n      while (a[i] != '\\0') {\n\n        if (a[i] == '(') {\n\n          b[i] = '$';\n\n        } else if (a[i] == ')') {\n\n          int k;\n\n          for (k = i - 1; k >= 0; k--) {\n\n            if (b[k] == '$') {\n\n              b[i] = b[k] = ' ';\n\n              break;\n            }\n          }\n\n          if (k == -1)\n\n            b[i] = '?';\n\n        } else {\n\n          b[i] = ' ';\n        }\n\n        i++;\n      }\n\n      printf(\"%s\", b);\n\n      cout << \"\\n\";\n\n      memset(b, 0, 500);\n\n      memset(a, 0, 500);\n\n      fflush(stdin);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31550", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105];\n  int mm;\n  scanf(\"%d \", &mm);\n  while (mm--) {\n    while (scanf(\"%s \", a)) {\n      int n = strlen(a);\n      int i = 0, j, b[105];\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(') {\n          b[i] = 1;\n        } else if (a[i] == ')') {\n          b[i] = -1;\n        } else\n          b[i] = 0;\n      }\n      for (i = 0; i < n; i++) {\n        if (b[i] == -1) {\n          for (j = i; j >= 0; j--) {\n            if (b[j] == 1) {\n              b[i] = 0;\n              b[j] = 0;\n              break;\n            }\n          }\n        }\n      }\n      puts(a);\n      printf(\" \");\n      for (i = 0; i < n; i++) {\n        if (b[i] == 0)\n          printf(\" \");\n        else if (b[i] == 1)\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31551", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000 + 1], flag[1000 + 1];\n  int i, j, sstack[1000 + 1];\n  while (scanf(\"%s\", str) != EOF) {\n    cout << str << \" \";\n    j = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        sstack[j++] = i;\n      else if (str[i] == ')') {\n        if (j <= 0)\n          flag[i] = '?';\n        else {\n          j--;\n          flag[sstack[j]] = ' ';\n          flag[i] = ' ';\n        }\n      } else\n        flag[i] = ' ';\n    }\n    for (i = 0; i < j; i++)\n      flag[sstack[i]] = '$';\n    flag[strlen(str)] = '\u0000';\n    printf(\"%s \", flag);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid fun(char a[]) {\n\n  int len, i, j, n, bi = 0, zuo, you, hao = 0;\n  char b[200];\n  int c[200];\n  len = strlen(a);\n  for (j = 0; j < len; j++) {\n    if (a[j] == '(' || a[j] == ')') {\n      b[bi] = a[j];\n      c[bi] = j;\n      bi += 1;\n    }\n  }\n  for (j = 0; j < bi - 1; j++) {\n    if (b[j] == '(' && b[j + 1] == ')') {\n      zuo = j;\n      you = j + 1;\n      hao = 1;\n      break;\n    }\n  }\n  if (hao == 0)\n    return;\n  while (b[zuo] == '(' && b[you] == ')') {\n    b[zuo] = 1;\n    b[you] = 1;\n    zuo -= 1;\n    you += 1;\n  }\n  for (j = 0; j < bi; j++) {\n    if (b[j] == 1) {\n      a[c[j]] = 1;\n    }\n  }\n  fun(a);\n}\n\nint main() {\n  int i, n, len, j;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    puts(a);\n    fun(a);\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        printf(\" \");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else if (a[j] == ')')\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31553", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  for (j = 1; j <= n; j++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          b[i] = '?';\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31554", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, len, e;\n  char s[102];\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", &s);\n    len = strlen(s);\n    printf(\"%s\\n\", s);\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (e = i + 1; e < len; e++) {\n          if (s[e] == ')') {\n            s[i] = ' ';\n            s[e] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pipei(char x[], int l) {\n  int i, j, count;\n  for (; count != 0;) {\n    count = 0;\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(')\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (x[j] != '(' && x[j] != ')')\n          continue;\n        if (x[j] == '(')\n          break;\n        if (x[j] == ')') {\n          count++;\n          x[i] = 32;\n          x[j] = 32;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < l; i++) {\n    if (x[i] != '(' && x[i] != ')')\n      printf(\" \");\n    else if (x[i] == '(')\n      printf(\"$\");\n    else\n      printf(\"?\");\n  }\n  printf(\" \");\n}\nint main() {\n  char x[101];\n  int l, i;\n  for (;;) {\n\n    scanf(\"%s \", x);\n    if (x[0] == '\u0000')\n      break;\n    l = strlen(x);\n    puts(x);\n    pipei(x, l);\n    for (i = 0; i < l; i++)\n      x[i] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31556", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n\n  int i, n;\n\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    while (scanf(\"%s\", a) != EOF) {\n\n      printf(\"%s\", a);\n      printf(\"\\n\");\n\n      i = 0;\n\n      while (a[i] != '\\0') {\n\n        if (a[i] == '(') {\n\n          b[i] = '$';\n\n        } else if (a[i] == ')') {\n\n          int k;\n\n          for (k = i - 1; k >= 0; k--) {\n\n            if (b[k] == '$') {\n\n              b[i] = b[k] = ' ';\n\n              break;\n            }\n          }\n\n          if (k == -1)\n\n            b[i] = '?';\n\n        } else {\n\n          b[i] = ' ';\n        }\n\n        i++;\n      }\n\n      printf(\"%s\", b);\n\n      printf(\"\\n\");\n\n      memset(b, 0, 500);\n\n      memset(a, 0, 500);\n\n      fflush(stdin);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31557", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char in[1000];\n  while (cin.getline(in, 1000, '\\n')) {\n    \n    if (in[0] == '\\0')\n      break;\n    int len;\n    len = strlen(in);\n    int i, j, k;\n    int flag[100] = {0};\n    for (i = 0; i <= len - 1; i++) {\n      if (in[i] == '(') {\n        flag[i] = 2; \n      }\n      if (in[i] == ')') {\n        flag[i] = 3; \n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 1)\n        continue;\n      if (in[i] == '(') {\n        for (j = i + 1; j <= len - 1; j++) {\n          if (flag[j] == 1)\n            continue;\n          if (in[j] == ')') {\n            flag[j] = 1;\n            flag[i] = 1;\n          }\n          if (in[j] == ')')\n            break;\n        }\n      }\n    }\n    cout << in << endl;\n    int temp, t;\n    int num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        temp = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (flag[i] == 2 || flag[i] == 3) {\n        t = i;\n      }\n      if (flag[i] == 2 || flag[i] == 3)\n        break;\n    }\n    for (j = 0; j <= len - 1; j++) {\n      if (flag[i] == 0 || flag[i] == 1) {\n        num++;\n      }\n    }\n    if (num < len) {\n\n      for (i = t; i <= temp; i++) {\n        if (flag[i] == 0 || flag[i] == 1) {\n          cout << \" \";\n        }\n        if (flag[i] == 2) {\n          cout << \"$\";\n        }\n        if (flag[i] == 3) {\n          cout << \"?\";\n        }\n      }\n      cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31558", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, len, n, left = 0, right = 0, k;\n  char a[10][101] = {\"\u0000\"};\n  int b[10][101] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == '(') {\n        b[i][j] = -1;\n        left++;\n      }\n      if (a[i][j] == ')') {\n        b[i][j] = 1;\n        right++;\n      }\n    }\n\n    for (j = 0; left != 0, right != 0, j < len; j++) {\n      if (b[i][j] == 1) {\n\n        for (k = j - 1; k >= 0; k--) {\n          if (b[i][k] == -1) {\n            b[i][k] = 0;\n            b[i][j] = 0;\n            left--;\n            right--;\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    puts(a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (b[i][j] == -1)\n        printf(\"$\");\n      if (b[i][j] == 1)\n        printf(\"?\");\n      if (b[i][j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar c[110], ch;\n\nvoid PMP(char c[], int len) {\n  for (int i = 0; i < len; i++) {\n    cout << c[i];\n  }\n  printf(\"\\n\");\n  int flag = 1;\n\n  while (flag) {\n    flag = 0;\n    for (int i = 0; i < len; i++) {\n      if ((c[i] != '(') && (c[i] != ')'))\n        c[i] = ' ';\n      else if (c[i] == '(') {\n        for (int j = i + 1; j < len; j++) {\n          if (c[j] == '(')\n            break;\n          if (c[j] == ')') {\n            c[i] = ' ';\n            c[j] = ' ';\n            flag = 1;\n            break;\n          } else if (j == len - 1) {\n            c[i] = '$';\n          }\n        }\n      }\n    }\n  }\n  for (int i = 0; i < len; i++) {\n    if (c[i] == '(')\n      c[i] = '$';\n    if (c[i] == ')') {\n      c[i] = '?';\n    }\n  }\n\n  for (int i = 0; i < len; i++)\n    cout << c[i];\n  cout << endl;\n  return;\n}\n\nint main() {\n  int len;\n  ch = getchar();\n  while (ch != '~') {\n    len = 0;\n    while (ch != '\\n') {\n      c[len] = ch;\n      len++;\n      ch = getchar();\n    }\n    PMP(c, len);\n    ch = getchar();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint deal();\nchar ori[101] = {\"\\0\"};\nint out[101] = {0};\nint main() {\n  int i;\n  while (cin.getline(ori, 101)) {\n    deal();\n    cout << ori << endl;\n    for (i = 0; ori[i] != '\\0'; i++) {\n      if (out[i] == 1)\n        cout << '$';\n      else if (out[i] == 2)\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\nint deal() {\n  int i, j;\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (ori[i] == '(')\n      out[i] = 1;\n    else if (ori[i] == ')')\n      out[i] = 2;\n    else\n      out[i] = 0;\n  }\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (out[i] == 2) {\n      for (j = i; j >= 0; j--) {\n        if (out[j] == 1) {\n          out[i] = 0;\n          out[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31561", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(char *out, int t) {\n  int i = t;\n  if (out[i] == '(') {\n    out[i] = '$';\n    i++;\n    while (out[i] != ')' && out[i]) {\n      if (out[i] == '(') {\n        i = function_1(out, i) + 1;\n        if (i == -1)\n          return -2;\n      } else {\n        out[i] = ' ';\n        i++;\n      }\n    }\n    if (out[i] == ')') {\n      out[t] = out[i] = ' ';\n      return i;\n    } else\n      return -2;\n  } else {\n    while (out[i] != '(' && out[i]) {\n      if (out[i] == ')')\n        out[i] = '?';\n      else\n        out[i] = ' ';\n      i++;\n    }\n    if (out[i] == '(')\n      return function_1(out, i);\n    else\n      return -2;\n  }\n}\n\nint main() {\n  char out[101];\n  int n = -1;\n  cin.getline(out, 101);\n  while (out[0]) {\n    n = -1;\n    printf(\"%s\\n\", out);\n    while (n != -2) {\n      n = function_1(out, n + 1);\n    }\n    cout << out << \"\\n\";\n    cin.getline(out, 101);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[110] = {0};\n  while (true) {\n    int i = 0;\n    while (true) {\n      str[i] = getchar();\n      if (str[i] == '\\n')\n        break;\n      i++;\n    }\n    int n, j = 0, biaoji = 0;\n    n = i - 1;\n    for (i = 0; i <= n; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = 0; i <= n; i++) {\n      biaoji = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) \n        {\n          if (str[j] == '(') {\n            biaoji = 1;\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n        if (biaoji == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i <= n; i++) \n    {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else if (str[i] != '$' && str[i] != '?') \n        str[i] = ' ';\n    }\n    for (i = 0; i <= n; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31563", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], n = ')';\n  int i, j, k, l, m = 0;\n  while (1) {\n\n    cin >> a;\n    if (feof(stdin))\n      break;\n    k = 0;\n    while (1) {\n      n = ')';\n      m = 0;\n      for (i = 0; i < 200; i++) {\n        if (a[i] == '\u0000')\n          goto here;\n        l = 0;\n        for (j = 0; j < k; j++) {\n          if (i == b[j]) {\n            l = 1;\n            break;\n          }\n        }\n        if (l)\n          continue;\n        else if (a[i] != '(' && a[i] != ')')\n          continue;\n        else if (n == '(' && a[i] == ')') {\n          b[k] = m;\n          b[k + 1] = i;\n          k = k + 2;\n          break;\n        }\n        m = i;\n        n = a[i];\n      }\n    }\n  here:\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000') {\n        printf(\" \");\n        break;\n      }\n      m = 0;\n      for (j = 0; j < k; j++) {\n        if (i == b[j]) {\n          m = 1;\n          break;\n        }\n      }\n      if (m == 1)\n        printf(\" \");\n      else if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31564", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char chuan[101];\n  while (scanf(\"%s\", chuan) != EOF) {\n    printf(\"%s\\n\", chuan);\n    int i, j, k, p;\n    int sig = 0;\n    p = strlen(chuan) - 1;\n    for (i = p; i >= 0; i--) {\n      if (chuan[i] == ')')\n        sig++;\n      if ((chuan[i] != '(') && (chuan[i] != ')'))\n        chuan[i] = ' ';\n      if ((sig != 0) && (chuan[i] == '(')) {\n        chuan[i] = ' ';\n        sig = sig - 1;\n        for (j = i + 1; j <= p; j++)\n          if (chuan[j] == ')') {\n            chuan[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      if (chuan[i] == '(')\n        printf(\"$\");\n      else if (chuan[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31565", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int n, char b[]) {\n  if (n > 0)\n    f(n - 1, b);\n  int i = 0, k = 0, x = 0;\n  for (k = 0; k < n; k++) {\n    if (b[k] == ')') {\n      for (x = 0; x <= k; x++) {\n        if (b[k - x] == '(') {\n          b[k] = ' ';\n          b[k - x] = ' ';\n          break;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      b[i] = a[i];\n      if (b[i] != '(' && b[i] != ')' && b[i] != '\\n')\n        b[i] = ' ';\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    f(n, b);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31566", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nint temp[100];\nint addition[100];\nint flag, i, j;\nint f() {\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      addition[flag] = i;\n      flag++;\n    } else if (s[i] == ')') {\n      if (flag) {\n        s[i] = ' ';\n        flag--;\n        s[addition[flag]] = ' ';\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    flag = 0;\n    f();\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31567", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dg(int a, int b);\n\nchar st[1000], st2[1000];\n\nint main() {\n  while (cin.getline(st, 1000)) {\n\n    st2[strlen(st)] = '\\0';\n    dg(1, 0);\n    cout << st << endl << st2 << endl;\n  }\n}\nint dg(int a, int b) \n{\n  for (int i = a; i <= strlen(st); i++) {\n    \n    \n    if (st[i - 1] == '(') {\n      \n      int t = dg(i + 1, i);\n      if (t == 0) {\n        st2[i - 1] = '$';\n        break;\n      }\n      if (t > 0) {\n        st2[i - 1] = ' ';\n        i = t;\n        continue;\n      }\n    } else if (st[i - 1] == ')') {\n\n      if (b == 0)\n        st2[i - 1] = '?';\n      if (b > 0) {\n        st2[i - 1] = ' ';\n        return i;\n      }\n    } else\n      st2[i - 1] = ' ';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31568", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar str[100], s[100];\n\nvoid match(int x) {\n  int i;\n  for (i = x - 1; i >= 0; --i)\n    if (s[i] == '$') {\n      s[x] = ' ';\n      s[i] = ' ';\n      break;\n    }\n}\n\nint main() {\n  int i, l;\n  while (scanf(\"%s \", str)) {\n    l = strlen(str);\n    s[l] = '\\0';\n    for (i = 0; i < l; ++i)\n      s[i] = ' ';\n    cout << str << \"\\n\";\n    for (i = 0; i < l; ++i)\n      switch (str[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        match(i);\n        break;\n      }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, r, fl, lenth;\n  int j, k;\n  char str[100 + 10];\n  int left[101], right[101];\n  int flag[100 + 10];\n\n  while (cin.getline(str, 101)) {\n    l = 1;\n    r = 1;\n    for (lenth = 0; str[lenth] != '\\0'; lenth++) {\n      if (str[lenth] == '(') {\n        flag[lenth] = 1;\n        left[l++] = lenth;\n      } else if (str[lenth] == ')') {\n        flag[lenth] = 2;\n        right[r++] = lenth;\n      } else\n        flag[lenth] = 0;\n    }\n\n    fl = lenth - 1;\n\n    for (j = l - 1; j >= 1; j--)\n      for (k = 1; k <= r - 1; k++) {\n        if (right[k] > left[j]) {\n          flag[right[k]] = 0;\n          flag[left[j]] = 0;\n          right[k] = -1;\n          break;\n        }\n      }\n\n    for (lenth = 0; str[lenth] != '\\0'; lenth++)\n      printf(\"%c\", str[lenth]);\n\n    printf(\"\\n\");\n\n    for (lenth = 0; lenth <= fl; lenth++) {\n      if (flag[lenth] == 0)\n        printf(\" \");\n      else {\n        if (flag[lenth] == 1)\n          printf(\"$\");\n        else if (flag[lenth] == 2)\n          printf(\"?\");\n      }\n    }\n\n    printf(\"\\n\");\n    memset(str, 0, sizeof(str));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31570", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[1000];\n\nint findri(int x, int y) {\n  int p;\n  if (s[x] == '\\0')\n    return -1;\n  if (s[x] == '(') {\n    p = findri(x + 1, y + 1);\n    if (p == -1) {\n      s[x] = '$';\n      return -1;\n    } else {\n      s[x] = ' ';\n      return findri(p + 1, y);\n    }\n  } else if (s[x] == ')') {\n    if (y == 0) {\n      s[x] = '?';\n      return findri(x + 1, y);\n    } else {\n      s[x] = ' ';\n      return x;\n    }\n\n  } else {\n    s[x] = ' ';\n    return findri(x + 1, y);\n  }\n}\n\nint main() {\n  int len;\n  int i;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s);\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << '\\n';\n    findri(0, 0);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", s[i]);\n    cout << '\\n';\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[200];\n  int b[200];\n  int n, len;\n  cin >> n;\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    memset(b, 0, sizeof(b));\n    cin.getline(a, 200);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      cout << a[i];\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 3;\n        break;\n      }\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 2) {\n        for (int j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[j] = 3, b[i] = 3;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 1) {\n        printf(\"$\");\n      } else if (b[i] == 2) {\n        cout << '?';\n      } else {\n        cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    printf(\"%s \", a);\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        cout << \"$\";\n        continue;\n      }\n      if (a[i] == ')') {\n        printf(\"?\");\n        continue;\n      }\n      printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31573", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int left = 0, right = 0;\n    int e[101] = {0};\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[201], done[201];\n  int pos[200];\n  int left, right;\n  int i, count, len;\n  while (cin.getline(sen, 200)) {\n    count = 0;\n    left = 0;\n    right = 0;\n    for (i = 0; i < 200; i++) {\n      done[i] = ' ';\n    }\n    len = strlen(sen);\n    for (i = 0; i < len; i++) {\n      if (sen[i] == '(') {\n        pos[count] = i;\n        done[pos[count]] = '$';\n        left++;\n        count++;\n      }\n      if (sen[i] == ')') {\n        if (left <= right) {\n          done[i] = '?';\n        } else {\n          right++;\n          done[pos[count - 1]] = ' ';\n          count--;\n        }\n      }\n    }\n    cout << sen << endl;\n    for (i = 0; i < len; i++) {\n      cout << done[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int j;\n    int a[1000];\n    char s[1000];\n    scanf(\"%s\", s);\n    int l = strlen(s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < l; j++)\n      a[j] = 0;\n    for (j = l - 1; j >= 0; j--) {\n      int t;\n      if (s[j] == '(') {\n        int f = 0;\n        for (t = j + 1; t < l; t++) {\n          if (s[t] == ')' && a[t] == 0) {\n            f = 1;\n            a[t] = 1;\n            a[j] = 1;\n            break;\n          }\n        }\n        if (f == 0) {\n          s[j] = '$';\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] == ')' && a[j] == 0) {\n        s[j] = '?';\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (s[j] != '?' && s[j] != '$')\n        s[j] = ' ';\n    }\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31576", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100];\nchar a[100];\nint b[100];\nint num = 0;\nint i, j;\nvoid f() {\n  for (i = 0; i < strlen(s); i++) \n  {\n    a[i] = ' ';\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') \n    {\n      b[num] = i; \n      a[i] = '$'; \n      num++;      \n\n    } else if (s[i] == ')' && num > 0) \n    {\n      num--;           \n      a[b[num]] = ' '; \n\n    } else if (s[i] == ')' && num <= 0) \n      a[i] = '?';                       \n  }\n  for (i = 0; i < strlen(s); i++) {\n    cout << a[i]; \n  }\n  cout << endl;\n}\nint main() {\n  while (cin >> s) {\n    num = 0;\n    cout << s << endl;\n    f();\n  }\n}\n"}
{"label": "17", "index": "31577", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[101];\n  int i, j, lenth, n, t;\n  while (cin.getline(string, 101)) {\n    n = 0;\n    lenth = strlen(string);\n    printf(\"%s\\n\", string);\n    for (i = 0; i < lenth; i++) {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else {\n        string[i] = ' ';\n        n++;\n      }\n    }\n    n = (lenth - n) / 2;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lenth; j++) {\n        for (t = j + 1; t < lenth; t++) {\n          if (string[j] == '$' && string[t] == '$') {\n            j = t;\n            continue;\n          }\n          if (string[j] == '$' && string[t] == '?') {\n            string[j] = string[t] = ' ';\n            j = t - 1;\n          }\n        }\n      }\n    }\n    for (i = lenth - 1; i >= 0; i--) {\n      if (string[i] != ' ')\n        break;\n    }\n    string[i + 1] = '\\0';\n    lenth = strlen(string);\n    int m = 0;\n    for (i = 0; i < lenth; i++) {\n      if (string[i] != ' ')\n        break;\n      m++;\n    }\n    for (i = m; i < lenth; i++)\n      printf(\"%c\", string[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101] = {'\\0'}, b[101] = {'\\0'};\n  int i, j;\n  while (cin.getline(a, 101)) {\n    for (i = 0; i < 101; i++) {\n      if (a[i] == '\\0')\n        break;\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')')\n        b[i] = '?';\n      else {\n        b[i] = ' ';\n      }\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(' && b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << a << endl;\n    cout << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = '\\0';\n      b[i] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31579", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n\n  int ww = 0;\n  while ((ww = getchar()) != -1) {\n    a[1] = ww;\n    for (int i = 2; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        cout << \" \";\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char c[100];\n  int a[100] = {0};\n  while (scanf(\"%s\", c) != EOF) {\n\n    if (c[0] == '\u0000')\n      break;\n    printf(\"%s \", c);\n    k = strlen(c);\n    for (i = 0; i <= k - 1; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == -1) {\n            a[j] = 2;\n            a[i] = 2;\n            break;\n          }\n      }\n\n      else\n        a[i] = 2;\n    }\n    if (c[0] == ')')\n      a[0] = 1;\n\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == 2)\n        cout << \" \";\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31581", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char a[1000];\n    scanf(\"%s \", a);\n    cout << a << '\\n';\n    int len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      int l = -1, r = -1;\n\n      for (int j = i; j >= 0; j--) {\n        if (a[j] == ')' && j != i)\n          break;\n        else if (a[j] == '(') {\n          l = j;\n          break;\n        }\n      }\n      for (int j = i; j < len; j++) {\n        if (a[j] == '(' && j != i)\n          break;\n        else if (a[j] == ')') {\n          r = j;\n          break;\n        }\n      }\n      if (r != -1 && l != -1) {\n        a[r] = '0';\n        a[l] = '0';\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else {\n        if (a[i] == ')')\n          cout << '?';\n        else\n          cout << \" \";\n      }\n    }\n    cout << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31582", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid fun(char a[]) {\n\n  int len, j, bi = 0, zuo, you, hao = 0;\n  char b[200];\n  int c[200];\n  len = strlen(a);\n  for (j = 0; j < len; j++) {\n    if (a[j] == '(' || a[j] == ')') {\n      b[bi] = a[j];\n      c[bi] = j;\n      bi += 1;\n    }\n  }\n  for (j = 0; j < bi - 1; j++) {\n    if (b[j] == '(' && b[j + 1] == ')') {\n      zuo = j;\n      you = j + 1;\n      hao = 1;\n      break;\n    }\n  }\n  if (hao == 0)\n    return;\n  while (b[zuo] == '(' && b[you] == ')') {\n    b[zuo] = 1;\n    b[you] = 1;\n    zuo -= 1;\n    you += 1;\n  }\n  for (j = 0; j < bi; j++) {\n    if (b[j] == 1) {\n      a[c[j]] = 1;\n    }\n  }\n  fun(a);\n}\n\nint main() {\n  int i, n, len, j;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    puts(a);\n    fun(a);\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        printf(\" \");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else if (a[j] == ')')\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31583", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar st[100];\nchar st2[100];\nint main() {\n  memset(st, 0, 100);\n  memset(st2, 0, 100);\n  while (scanf(\"%s \", st)) {\n    int left = 0, right = 0;\n    int len = strlen(st);\n    for (int i = 0; i < len; i++) {\n      if (st[i] == '(')\n        left++;\n      if (st[i] == ')')\n        right++;\n      if (left < right) {\n        st2[i] = '?';\n        right--;\n      }\n    }\n    left = 0;\n    right = 0;\n    for (int j = len - 1; j >= 0; j--) {\n      if (st[j] == '(')\n        left++;\n      if (st[j] == ')')\n        right++;\n      if (left > right) {\n        st2[j] = '$';\n        left--;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (st2[i] != '$' && st2[i] != '?')\n        st2[i] = ' ';\n    }\n    printf(\"%s\\n\", st);\n    cout << st2 << endl;\n    memset(st, 0, 100);\n    memset(st2, 0, 100);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31584", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    switch (a[i]) {\n    case 1:\n      printf(\"$\");\n      break;\n    case 0:\n      cout << \" \";\n      break;\n    case -1:\n      printf(\"?\");\n      break;\n    }\n  cout << \" \";\n}\nvoid trans(char s[], int a[], int n) {\n  int i, p[200], k = -1;\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if ((s[i] != '(') && (s[i] != ')'))\n      a[i] = 0;\n    else if (s[i] == '(') {\n      k++;\n      p[k] = i;\n      a[i] = 1;\n    } else {\n      if (k > -1) {\n        a[p[k]] = 0;\n        k--;\n        a[i] = 0;\n      } else\n        a[i] = -1;\n    }\n  }\n}\nvoid input() {\n  char s[200];\n  int a[200], n;\n  while (scanf(\"%s\", s) != EOF) {\n    n = strlen(s);\n    puts(s);\n    trans(s, a, n);\n    output(a, n);\n  }\n}\nint main() {\n  input();\n  return 0;\n}\n"}
{"label": "17", "index": "31585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[100];\n  int len, i, j, a[100];\n  while (scanf(\"%s\", c) != EOF) {\n    if (c[0] == '\\0')\n      break;\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == -1) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      } else\n        a[i] = 0;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == -1)\n        cout << \"$\";\n      if (a[i] == 1)\n        printf(\"?\");\n      if (a[i] == 0)\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31586", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar input[105], output[105];\n\nvoid f()\n\n{\n\n  memset(output, 0, sizeof(output));\n\n  int l = 0, r = 0;\n\n  int len = strlen(input);\n\n  int i;\n\n  for (i = 0; i < len; ++i)\n\n  {\n\n    output[i] = ' ';\n\n    if (input[i] == ')')\n\n    {\n\n      if (l <= 0)\n\n        output[i] = '?';\n\n      else\n\n        l--;\n\n    }\n\n    else if (input[i] == '(')\n\n      l++;\n  }\n\n  l = r = 0;\n\n  for (i = len; i >= 0; --i)\n\n  {\n\n    if (input[i] == '(')\n\n    {\n\n      if (r <= 0)\n\n        output[i] = '$';\n\n      else\n\n        r--;\n\n    }\n\n    else if (input[i] == ')')\n\n      r++;\n  }\n\n  cout << input << endl;\n\n  printf(\"%s\\n\", output);\n}\nint main() {\n\n  while (cin.getline(input, 105)) {\n\n    f();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31587", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int i, count, j, b[101];\n  while (cin >> s) {\n    count = 0;\n    for (i = 0; i < strlen(s); i++)\n      b[i] = 0;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        c[i] = '$';\n        count++;\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        if (count != 0) {\n          for (j = i; j >= 0; j--) {\n            if (s[j] == '(' && b[j] == -1) {\n              c[j] = ' ';\n              c[i] = ' ';\n              count--;\n              b[j] = 0;\n              break;\n            }\n          }\n        } else\n          c[i] = '?';\n      } else\n        c[i] = ' ';\n    }\n    c[i] = '\u0000';\n    printf(\"%s %s \", s, c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31588", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  char string[101];\n  char string_copy[101];\n  char string_check[101];\n  int len = 0;\n  int index = 0;\n  int start = 0;\n  int turn = 0;\n  char y = 'n';\n\n  for (i = 0; i <= n; i++) {\n    len = 0;\n\n    cin >> string;\n    while (string[len])\n      len++;\n\n    strcpy(string_copy, string);\n\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] != '(' && string_copy[index] != ')')\n        string_copy[index] = ' ';\n      if (string[index] == '(' || string[index] == ')')\n        y = 'y';\n    }\n    if (y == 'n')\n      continue;\n\n    for (turn = 0; turn <= len / 2; turn++) {\n      y = 'n';\n      start = 0;\n      for (index = 0; index < len; index++) {\n        if (string_copy[index] == '(')\n          start = index;\n        if (string_copy[index] == ')' && string_copy[start] == '(') {\n          string_copy[index] = ' ';\n          string_copy[start] = ' ';\n        }\n      }\n    }\n\n    strcpy(string_check, string_copy);\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] == '(')\n        string_copy[index] = '$';\n      if (string_copy[index] == ')')\n        string_copy[index] = '?';\n    }\n    if (strcmp(string_copy, string_check) != 0) {\n      printf(\"%s %s \", string, string_copy);\n    } else {\n      printf(\"%s \", string);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[110];\n  while (cin >> s) {\n    cout << s << endl;\n    int l = strlen(s), i;\n    for (i = l - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        continue;\n      else if (s[i] == '(') {\n        int j;\n        for (j = i; j < l; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          s[i] = '$';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      if (s[i] == ')')\n        s[i] = '?';\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[1000], temp[1000];\n  int b[1000];\n  int i, n = 0, m = 0, len, j;\n  memset(temp, 2, sizeof(temp));\n  while (1) {\n    m = 0;\n    n = 0;\n    scanf(\"%s\", s);\n    if (strcmp(temp, s) == 0)\n      break;\n    else\n      strcpy(temp, s);\n    memset(b, 0, sizeof(b));\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        n++;\n      else if (s[i] == ')' && n > 0) {\n        n--;\n        b[i] = 1;\n      }\n    }\n    for (j = len - 1; j >= 0; j--) {\n      if (s[j] == ')')\n        m++;\n      else if (s[j] == '(' && m > 0) {\n        m--;\n        b[j] = 1;\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == 0 && s[i] == ')')\n        printf(\"?\");\n      else if (b[i] == 0 && s[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar c[101], a[101] = {' '};\nint leftpos[101] = {0}, leftnum = 0;\n\nvoid function_1(int pos) {\n  if (pos == strlen(c)) {\n    a[pos] = '\u0000';\n    printf(\"%s\\n\", c);\n    printf(\"%s\\n\", a);\n    return;\n  }\n  if (c[pos] == '(') {\n    leftpos[leftnum] = pos;\n    a[pos] = '$';\n    leftnum += 1;\n    function_1(pos + 1);\n  } else {\n    if (c[pos] == ')') {\n      if (leftnum == 0) {\n        a[pos] = '?';\n        function_1(pos + 1);\n      } else {\n        a[pos] = ' ';\n        leftnum -= 1;\n        a[leftpos[leftnum]] = ' ';\n        function_1(pos + 1);\n      }\n    } else {\n      a[pos] = ' ';\n      function_1(pos + 1);\n    }\n  }\n}\n\nint main() {\n  for (; cin.getline(c, 101);) {\n    function_1(0);\n    leftnum = 0;\n    for (int i = 0; i < 101; i++)\n      leftpos[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31592", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar s[101];\nint l;\nint f(int k) {\n  int i, j;\n  for (i = k; i >= 0; i--)\n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') {\n          s[i] = 'a';\n          s[j] = 'a';\n          k = i;\n          return f(k);\n        }\n    }\n  for (i = 0; i < l; i++) {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      cout << \" \";\n  }\n  cout << endl;\n  return 0;\n}\n\nint main() {\n  while (cin.getline(s, 101, '\\n')) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    f(l - 1);\n    memset(s, '\\0', sizeof(s));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31593", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void match(char a[]);\n  int signal = 1;\n  int i;\n  char s[101], s1[101] = \"\";\n\n  cin >> s;\n  while (signal) {\n    match(s);\n    strcpy(s1, s);\n    scanf(\"%s\", s);\n    if (strcmp(s, s1) == 0)\n      signal = 0;\n  }\n\n  return 0;\n}\n\nvoid match(char a[]) {\n  int i, j, k, len;\n  int f1 = 0, f2 = 0, f3 = 1;\n  len = strlen(a);\n  if (len != 0)\n    printf(\"%s \", a);\n  do {\n    if (len != 0) {\n      f1 = 0;\n      f2 = 0;\n      f3 = 1;\n      for (i = len - 1; i >= 0; i--) {\n        if (a[i] == '(') {\n          f1 = 1;\n          for (j = i + 1; a[j]; j++) {\n            if (a[j] == ')') {\n              f2 = 1;\n              a[j] = '0';\n              a[i] = '0';\n              break;\n            }\n          }\n          if (f2 == 0)\n\n            a[i] = '1';\n        }\n        if (f1 == 1)\n          break;\n      }\n      if (f1 == 0) {\n        for (i = 0; a[i]; i++) {\n          if (a[i] == ')') {\n            a[i] = '2';\n          }\n        }\n      }\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          f3 = 0;\n          break;\n        }\n      }\n    }\n  } while (f3 == 0);\n  for (i = 0; a[i]; i++) {\n    if (a[i] == '1')\n      printf(\"$\");\n    else if (a[i] == '2')\n      printf(\"?\");\n    else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, t, j, la, k, bb, pp;\n  while (cin.getline(a, 101, '\\n')) {\n    printf(\"%s\\n\", a);\n    la = strlen(a);\n    for (i = 0; i < la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    t = 0;\n    while (t == 0) {\n      t = 1;\n      for (i = la - 1; i >= 0; i--) {\n        if (a[i] == ')')\n          break;\n        if (a[i] == '(') {\n          a[i] = '$';\n          break;\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == ')') {\n          a[i] = '?';\n          break;\n        }\n        if (a[i] == '(')\n          break;\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(') {\n          for (j = i + 1; j < la; j++) {\n            k = 2;\n            if (a[j] == '(') {\n              k = 0;\n              break;\n            }\n            if (a[j] == ')') {\n              k = 1;\n              a[j] = ' ';\n              break;\n            }\n          }\n          if (k == 1) {\n            a[i] = ' ';\n          }\n        }\n      }\n      for (i = 0; i < la; i++) {\n        if (a[i] == '(' || a[i] == ')') {\n          t = 0;\n          break;\n        }\n      }\n    }\n    for (i = la - 1; i >= 0; i--) {\n      if (a[i] != ' ')\n        break;\n    }\n    bb = i;\n    for (i = 0; i < la; i++) {\n      if (a[i] != ' ')\n        break;\n    }\n    pp = i;\n    for (j = pp; j <= bb; j++)\n      cout << a[j];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31595", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nchar m[1000];\nint match(int l) {\n\n  int r = l;\n  while (s[++r] != ')') {\n    if (s[r] == '(')\n      r = match(r);\n    if (s[r] == '\\0')\n      break;\n  }\n  if (s[r] == '\\0')\n    m[l] = '$';\n  return r;\n}\nint nextL(int i) {\n  while (s[i] != '\\0' && s[i] != '(') {\n    if (s[i] == ')')\n      m[i] = '?';\n    i++;\n  }\n  return i;\n}\nint main() {\n  int i, j, k;\n  while (cin >> s) {\n    for (i = 0; i < strlen(s); ++i)\n      m[i] = ' ';\n    m[i] = '\\0';\n    i = 0;\n    i = nextL(i);\n    while (s[i] != '\\0') {\n      i = match(i);\n      if (s[i] == '\\0')\n        break;\n      else\n        i++;\n      i = nextL(i);\n    }\n    printf(\"%s\\n%s\\n\", s, m);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[120];\n  char s[120], s1[120];\n  int i, j, l;\n  while (1) {\n\n    cin >> s;\n    if (strcmp(s, s1) == 0)\n      break;\n    strcpy(s1, s);\n    memset(a, 0, sizeof(a));\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[i] = 1;\n      if (s[i] == ')')\n        a[i] = -1;\n    }\n\n    for (i = 0; i < l; i++) {\n      if ((s[i] == '(') && (a[i] != 0)) {\n        j = i + 1;\n        while ((a[j] == 0) && (j < l))\n          j++;\n        if ((s[j] == ')') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n      if ((s[i] == ')') && (a[i] != 0)) {\n        j = i - 1;\n        while ((a[j] == 0) && (j > 0))\n          j--;\n        if ((s[j] == '(') && (a[j] != 0)) {\n          a[i] = 0;\n          a[j] = 0;\n        }\n      }\n    }\n    cout << s << \" \";\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1)\n        printf(\"$\");\n      else if (a[i] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, len, e;\n  char s[102];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", &s);\n    len = strlen(s);\n    printf(\"%s\\n\", s);\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')')\n        s[j] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (e = i + 1; e < len; e++) {\n          if (s[e] == ')') {\n            s[i] = ' ';\n            s[e] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  char sen[201], done[201]; \n  int pos[200];             \n  int left, right;          \n  int i, count, len;        \n  while (cin.getline(sen, 200)) {\n    count = 0;\n    left = 0;\n    right = 0;\n    for (i = 0; i < 200; i++) {\n      done[i] = ' '; \n    }\n    len = strlen(sen);\n    for (i = 0; i < len; i++) {\n      if (sen[i] == '(') {\n        pos[count] = i;         \n        done[pos[count]] = '$'; \n        left++;                 \n        count++;\n      }\n      if (sen[i] == ')') {\n        if (left <= right) \n        {\n          done[i] = '?';\n        } else {\n          right++;\n          done[pos[count - 1]] = ' '; \n          count--;\n        }\n      }\n    }\n    cout << sen << endl; \n    for (i = 0; i < len; i++) {\n      cout << done[i]; \n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  static char c[102], d[102];\n  int i, j, k, s;\n  while (scanf(\"%s \", c)) {\n    puts(c);\n    for (i = 0; c[i] != '\u0000'; i++) {\n\n      if (c[i] == '(')\n        d[i] = 1;\n      else if (c[i] == ')')\n        d[i] = 2;\n      else\n        d[i] = 3;\n    }\n    while (1) {\n      s = 0;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1)\n          break;\n      }\n      for (k = j + 1; k <= i - 1; k++) {\n        if (d[k] == 2) {\n          s = 1;\n          break;\n        }\n      }\n      if (s == 0)\n        break;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          for (k = j + 1; k <= i - 1; k++) {\n            if (d[k] == 1) {\n              j = k;\n            }\n            if (d[k] == 2) {\n              d[j] = 3;\n              d[k] = 3;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (k = 0; k <= i - 1; k++) {\n      switch (d[k]) {\n      case 1:\n        printf(\"$\");\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      case 3:\n        printf(\" \");\n        break;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31600", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][110] = {0};\n  int i, j, k, n = 0;\n  for (i = 1; cin >> a[i]; i++)\n    n++;\n\n  for (i = 1; i <= n; i++) {\n    char b[110];\n    for (k = 0; k <= 109; k++) {\n      b[k] = ' ';\n    }\n    int c[110] = {0};\n    int p = 0, q = 0, m = 0;\n    for (j = 0; j <= 109; j++) {\n      if (a[i][j] != 0)\n        m++;\n    }\n    for (j = 0; j <= m - 1; j++) {\n      if (a[i][j] == '(') {\n        p++;\n        b[j] = '$';\n      } else if (a[i][j] == ')') {\n        b[j] = '?';\n        if (p > 0) {\n          b[j] = ' ';\n          p--;\n          for (k = j - 1; k >= 0; k--) {\n            if ((b[k] == '$') && (c[k] == 0))\n              break;\n          }\n          b[k] = ' ';\n          c[k] = 1;\n        }\n      }\n    }\n    printf(\"%s\\n\", a[i]);\n    for (j = 0; j <= m - 2; j++)\n      cout << b[j];\n\n    cout << b[m - 1] << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[1000];\n  int i = 0, j = 0, length = 0, t1 = 0, t2 = 0;\n  int flag = 0, left = 0, right = 0;\n  while (cin >> string) {\n    cout << string << endl;\n    length = strlen(string);\n    flag = 1, left = 0, right = 0;\n    t1 = 0, t2 = 0;\n    while (flag == 1) {\n      for (i = 0; i < length; i++) {\n        if (string[i] == '(') {\n          left = i;\n          t1 = 1;\n        }\n\n        else if (t1 == 1 && string[i] == ')') {\n          right = i;\n          t2 = 1;\n          break;\n        }\n\n        else\n          continue;\n      }\n\n      if (t1 == 1 && t2 == 1)\n\n      {\n        string[left] = '0';\n        string[right] = '0';\n        t1 = 0;\n        t2 = 0;\n        flag = 1;\n      } else\n        flag = 0;\n    }\n\n    for (i = 0; i < length; i++) {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else\n        string[i] = ' ';\n    }\n\n    for (i = 0; i < length; i++) {\n      cout << string[i];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zhengli(char a[]) {\n  void panduan(char a[]);\n  int i, k, j;\n  k = strlen(a);\n  for (j = 0; j < 50; j++) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == '$')\n        a[i] = '(';\n      else if (a[i] == '?')\n        a[i] = ')';\n    }\n    panduan(a);\n  }\n}\nvoid panduan(char a[]) {\n  int i, k, flag = 0, j;\n  char b[110];\n  k = strlen(a);\n  b[k] = '\\0';\n  for (i = 0; i < k; i++) {\n    if (a[i] != '(' && a[i] != ')')\n      b[i] = ' ';\n    else if (a[i] == '(') {\n      if (flag == 1) {\n        b[j] = '$';\n        j = i;\n        b[j] = '$';\n      } else {\n        flag = 1;\n        j = i;\n        b[j] = '$';\n      }\n    } else {\n      if (flag == 1) {\n        b[j] = ' ';\n        flag = 0;\n        b[i] = ' ';\n      } else {\n        b[i] = '?';\n      }\n    }\n  }\n  strcpy(a, b);\n}\nint main() {\n  int i, k;\n  char a[110];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    panduan(a);\n    zhengli(a);\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "17", "index": "31603", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char b[101];\n  while (cin.getline(b, 101)) {\n    j = 0;\n    int c[100] = {0}, a[100] = {0};\n    n = strlen(b);\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(') {\n        a[j] = i + 1;\n        j++;\n      }\n      if (b[i] == ')') {\n        if (j > 0) {\n          j--;\n          a[j] = a[j + 1];\n        } else\n          c[i] = 1;\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < j; i++)\n      c[a[i] - 1] = 2;\n    for (i = 0; i < n; i++) {\n      if (c[i] == 1)\n        cout << \"?\";\n      else {\n        if (c[i] == 2)\n          cout << \"$\";\n        else\n          printf(\" \");\n      }\n    }\n    cout << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "31604", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (char c[101]; cin.getline(c, 101);) {\n    char a[101] = {' '};\n    int len = strlen(c), cnt = 0, left[101] = {0};\n    for (int i = 0; i < len; i++) {\n      if (c[i] != '(' && c[i] != ')')\n        a[i] = ' ';\n      else {\n        if (c[i] == '(') {\n          a[i] = '$';\n          cnt += 1;\n          left[cnt] = i + 1;\n        } else {\n          if (cnt <= 0)\n            a[i] = '?';\n          else {\n            a[i] = ' ';\n            a[left[cnt] - 1] = ' ';\n            left[cnt] = 0;\n            cnt -= 1;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", c);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31605", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[101];\nint l;\nint f(int k) {\n  int i, j;\n  for (i = k; i >= 0; i--)\n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') {\n          s[i] = 'a';\n          s[j] = 'a';\n          k = i;\n          return f(k);\n        }\n    }\n  for (i = 0; i < l; i++) {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    cout << s << endl;\n    f(l - 1);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[150];\nint len, num = 0;\nint f1(int n) {\n  if (n == len - 1) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    return f1(n + 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    if (num == 0)\n      return 0;\n    else\n      return f1(n + 1);\n  } else\n    return f1(n + 1);\n}\nint f2(int n) {\n  if (n == 0) {\n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num;\n  }\n  if (a[n] == '(') {\n    num++;\n    if (num == 0)\n      return 0;\n    else\n      return f2(n - 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    return f2(n - 1);\n  } else\n    return f2(n - 1);\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    len = strlen(a);\n    cout << a << endl;\n    for (int i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        cout << ' ';\n      else if (a[i] == '(') {\n        num = 0;\n        if (f1(i) > 0)\n          cout << '$';\n        else\n          cout << ' ';\n      } else {\n        num = 0;\n        if (f2(i) < 0)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31607", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, e, x, i, t, j, k;\n  char s[102];\n  cin >> n;\n  for (e = 0; e < n; e++) {\n    cin >> s;\n    printf(\"%s \", s);\n    x = strlen(s);\n    for (i = 0; i < x; i++) {\n      if (s[i] != '(' && s[i] != ')') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < x; j++) {\n          if (s[j] == ')') {\n            t = 0;\n            for (k = i + 1; k < j; k++) {\n              if (s[k] != ' ') {\n                t = 1;\n                break;\n              }\n            }\n            if (t == 0) {\n              s[i] = ' ';\n              s[j] = ' ';\n              i = -1;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < x; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    printf(\"%s \", s);\n  }\n}\n"}
{"label": "17", "index": "31608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {'\\0'};\n  while ((scanf(\"%s\", a)) != -1) {\n    printf(\"%s\\n\", a);\n    int b, c, d;\n    for (b = 0; b < 100; b++) {\n      if (a[b] == ')') {\n        for (c = b - 1; c >= 0; c--) {\n          if (a[c] == '(') {\n            a[c] = 'a';\n            a[b] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (d = 0; d < 100; d++) {\n      if (a[d] == ')')\n        printf(\"?\");\n      else if (a[d] == '(')\n        printf(\"$\");\n      else if (a[d] != '\\0')\n        printf(\" \");\n      a[d] = '\\0';\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++)\n      if (s[i] == '(') {\n        h = i;\n        for (j = i + 1; j < len; j++)\n          if (s[j] == '(')\n            i = j;\n          else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        if (j == len)\n          break;\n        if (h == i)\n          continue;\n        else\n          i = h - 1;\n      }\n    for (q = 0; q < len; q++)\n      if (s[q] == ')')\n        s[q] = '?';\n      else if (s[q] == '(')\n        s[q] = '$';\n      else\n        s[q] = ' ';\n    printf(\"%s \", ss);\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[101];\n  int i, a[101], k, j;\n  for (i = 0; i <= 100; i++)\n    a[i] = 1;\n  while (scanf(\"%s\", ch) != EOF) {\n    puts(ch);\n    i = 0;\n    do {\n      if ((ch[i] >= 'a' && ch[i] <= 'z') || (ch[i] >= 'A' && ch[i] <= 'Z'))\n        a[i] = 0;\n      if (ch[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if ((ch[k] == '(') && a[k] == 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    } while (ch[i] != '\\0');\n    j = i - 1;\n    for (i = 0; i <= j; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else {\n        if (ch[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\"\\n\");\n    for (i = 0; i <= 100; i++) {\n      a[i] = 1;\n      ch[i] = 'a';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[110], b[110];\n  while (scanf(\"%s\", &a) == 1) {\n    strcpy(b, a);\n    int len = strlen(a);\n    int i, t, s, q = 1;\n    while (q) {\n      q = 0;\n      t = -1;\n      s = -1;\n      for (i = 0; i < len; i++) {\n        if (a[i] == 40)\n          t = i;\n        else if (a[i] == 41) {\n          if (t >= 0) {\n            a[t] = 48;\n            a[i] = 48;\n            q = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31612", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ans[100], c;\n  int stack[100], top = 0, l = 0;\n  while (scanf(\"%c\", &c) == 1) {\n    cout << c;\n    if (c == '\\n') {\n      ans[l] = '\\0';\n      cout << ans << endl;\n      top = 0;\n      l = 0;\n      continue;\n    }\n    if (c == '(') {\n      stack[top++] = l;\n      ans[l] = '$';\n      l++;\n      continue;\n    }\n    if (c == ')') {\n      if (top == 0) {\n        ans[l++] = '?';\n        continue;\n      } else {\n        ans[l++] = ' ';\n        ans[stack[--top]] = ' ';\n        continue;\n      }\n    }\n    ans[l++] = ' ';\n  }\n  cout << endl;\n  ans[l] = '\\0';\n  cout << ans << endl;\n\n  return 0;\n}\n"}
{"label": "17", "index": "31613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++)\n      if (s[i] == '(') {\n        h = i;\n        for (j = i + 1; j < len; j++)\n          if (s[j] == '(')\n            i = j;\n          else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        if (j == len)\n          break;\n        if (h == i)\n          continue;\n        else\n          i = h - 1;\n      }\n    for (q = 0; q < len; q++)\n      if (s[q] == ')')\n        s[q] = '?';\n      else if (s[q] == '(')\n        s[q] = '$';\n      else\n        s[q] = ' ';\n    cout << ss << \" \";\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, k, p, d, x;\n  char a[101];\n  char b[101];\n  while (cin >> a) {\n    puts(a);\n    for (j = 0; a[j] != '\u0000'; j++) {\n\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\u0000';\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (b[k] == '?') {\n        d = 0;\n        for (p = k - 1; p >= 0; p--) {\n          if (b[p] == '$') {\n            x = p;\n            d = 1;\n            break;\n          }\n        }\n        if (d == 1) {\n          b[k] = ' ';\n          b[x] = ' ';\n        }\n      }\n    }\n    for (k = j; k >= 0; k--) {\n      if (b[k] != ' ' && b[k] != '\u0000')\n        break;\n    }\n    for (p = 0; p < j; p++) {\n      if (b[p] != ' ')\n        break;\n    }\n    for (x = p; x <= k; x++)\n      cout << b[x];\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[101], b[101];\nint l, c[101];\nint main() {\n  int i, j;\n  while (cin.getline(a, 101)) {\n    j = 0;\n    memset(c, 0, sizeof(c));\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        c[j] = i;\n        j = j + 1;\n      } else {\n        if (a[i] == ')') {\n          if (j >= 1) {\n            b[c[j - 1]] = ' ';\n            b[i] = ' ';\n            j = j - 1;\n          } else {\n            b[i] = '?';\n          }\n        } else {\n          b[i] = ' ';\n        }\n      }\n    }\n    b[l] = '\\0';\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31616", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int s[101], len, k = 0, i;\n  while (cin >> a) {\n    for (len = 0; a[len] != '\\0'; len++)\n      ;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        s[k++] = i;\n      if (a[i] == ')' && k > 0) {\n        a[s[--k]] = ' ';\n        a[i] = ' ';\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n      if (a[i] == ')' && k == 0)\n        a[i] = '?';\n    }\n    for (i = k - 1; i >= 0; i--)\n      a[s[i]] = '$';\n    cout << a << endl;\n    memset(a, 0, sizeof(a));\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int som;\n  char a[105];\n  char b[105];\n  int len;\n  int i, j;\n  scanf(\"%d\", &n);\n  for (som = 1; som <= n; som++) {\n    scanf(\"%s\", a);\n    strcpy(b, a);\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '$') {\n        for (j = i + 1; j < len; j++) {\n          if (b[j] == '?') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n  }\n}\n"}
{"label": "17", "index": "31618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j;\n  while (cin.getline(str, 101)) {\n    int length = strlen(str), count1[1000] = {0}, count2[1000] = {0};\n    for (i = length; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i; str[j] != '\\0'; j++) {\n          if (str[j] == ')' && count2[j] == 0) {\n            count2[j]--;\n            break;\n          } else {\n            if (str[j + 1] == '\\0') {\n              count1[i]++;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == ')') {\n        count2[i]++;\n      }\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (count1[i] == 1) {\n        cout << \"$\";\n      }\n      if (count2[i] == 1) {\n        cout << \"?\";\n      }\n      if (count1[i] != 1 && count2[i] != 1) {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[30][120];\n  int j, n, i, b[30], k, zuo[30][120], you[30][120];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 119; j++) {\n      zuo[i][j] = 0;\n      you[i][j] = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    k = 0;\n\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    for (j = b[i] - 1; j >= 0; j--) {\n\n      if (a[i][j] == '(') {\n        if (k == 0)\n          zuo[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      }\n\n      else if (a[i][j] == ')')\n        k += 1;\n    }\n    k = 0;\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (a[i][j] == ')') {\n        if (k == 0)\n          you[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      } else if (a[i][j] == '(')\n        k += 1;\n    }\n    printf(\"%s\\n\", a[i]);\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (zuo[i][j] == 1)\n        printf(\"$\");\n      else if (you[i][j] == 1)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  while (cin.getline(str, 101, '\\n')) {\n    char k[101] = {0}, ts[101] = {0};\n    int i, t, num[101] = {0}, temp = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      k[i] = ' ';\n      ts[i] = str[i];\n      if (str[i] == '(')\n        temp++;\n      if (str[i] == ')')\n        temp--;\n      if (temp < 0) {\n        k[i] = '?';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    t = i - 1;\n    temp = 0;\n    for (i = t; i >= 0; i--) {\n      if (str[i] == ')')\n        temp++;\n      if (str[i] == '(')\n        temp--;\n      if (temp < 0) {\n        k[i] = '$';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    cout << ts << endl << k << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, n, f[101][102] = {0}, l[101], g;\n  char s[101][102], a[102];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    l[i] = strlen(s[i]);\n    for (j = l[i] - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        k = j;\n      else\n        continue;\n      for (g = k + 1; g < l[i]; g++) {\n        if (s[i][g] == ')' && f[i][g] == 0) {\n          f[i][k] = 1;\n          f[i][g] = 1;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n    for (j = 0; j < l[i]; j++) {\n      if (s[i][j] == '(' && f[i][j] == 0)\n        printf(\"$\");\n      else if (s[i][j] == ')' && f[i][j] == 0)\n        printf(\"?\");\n      else {\n        printf(\" \");\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char a[], int, int);\nvoid g(char a[]);\nint main() {\n  char str[100][101];\n  int i, n = 0, j;\n  while (cin.getline(str[n++], 101)) {\n  }\n  for (i = 0; i < n; i++) {\n    cout << str[i] << endl;\n    for (j = 0; j < strlen(str[i]); j++) {\n      if (str[i][j] == ')')\n\n        f(str[i], j - 1, j);\n    }\n    g(str[i]);\n    cout << str[i] << endl;\n  }\n  return 0;\n}\nvoid f(char a[], int x, int y) {\n  if (a[x] == '(') {\n    a[x] = a[y] = 'a';\n  } else if (x > 0)\n    f(a, x - 1, y);\n}\nvoid g(char a[]) {\n  int i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else\n      a[i] = ' ';\n  }\n}\n"}
{"label": "17", "index": "31623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, f1 = 0, f2 = 0;\n  char line[101], copy[101];\n  while (cin >> line) {\n    strcpy(copy, line);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == ')')\n        line[i] = '?';\n      if (line[i] == '(') {\n        f1 = 1;\n        for (j = i + 1; j < strlen(line); j++) {\n          if (line[j] == '(')\n            f1++;\n          if (line[j] == ')') {\n            f1--;\n            if (f1 == 0) {\n              line[i] = ' ';\n              line[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (f1 != 0)\n          line[i] = '$';\n      }\n    }\n    printf(\"%s\\n\", copy);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '$' || line[i] == '?')\n        cout << line[i];\n      else\n        cout << \" \";\n    }\n    cout << endl;\n    memset(line, 0, sizeof(line));\n    memset(copy, 0, sizeof(copy));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i;\n  char s[1001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n\n    char t[1001] = {0};\n    int j, k;\n    int len = strlen(s);\n\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        int zo = 1, yb = 0;\n        for (k = j + 1; k < len; k++) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n\n          s[j] = 0;\n          t[j] = '$';\n        }\n      }\n\n      if (s[j] == ')') {\n        int zo = 0, yb = 1;\n        for (k = j - 1; k >= 0; k--) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n          t[j] = '?';\n          s[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == 0) {\n        printf(\"(\");\n      } else if (s[j] == 1) {\n        cout << \")\";\n      } else {\n        printf(\"%c\", s[j]);\n      }\n    }\n\n    cout << \"\\n\";\n    for (j = 0; j < len; j++) {\n      if (t[j] == '?' || t[j] == '$') {\n        printf(\"%c\", t[j]);\n      } else\n        printf(\" \");\n    }\n\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31625", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l, k = 0;\n  char c[101];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int left = 0, right = 0;\n    int e[101] = {0};\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31626", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[110];\nvoid match(int l) {\n  if (a[l] == '\\0')\n    return;\n  int j;\n  if (a[l] == ')') {\n    for (j = l; j >= 0; j--) {\n      if (a[j] == '(') {\n        a[l] = ' ';\n        a[j] = ' ';\n        break;\n      }\n      a[l] = '?';\n    }\n    l++;\n    match(l);\n  } else {\n    l++;\n    match(l);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 110; i++)\n    a[i] = '\\0';\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    match(0);\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char chuan[101];\n  while (scanf(\"%s\", chuan) != EOF) {\n    printf(\"%s\\n\", chuan);\n    int i, j, k, p;\n    int sig = 0;\n    p = strlen(chuan) - 1;\n    for (i = p; i >= 0; i--) {\n      if (chuan[i] == ')')\n        sig++;\n      if ((chuan[i] != '(') && (chuan[i] != ')'))\n        chuan[i] = ' ';\n      if ((sig != 0) && (chuan[i] == '(')) {\n        chuan[i] = ' ';\n        sig = sig - 1;\n        for (j = i + 1; j <= p; j++)\n          if (chuan[j] == ')') {\n            chuan[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      if (chuan[i] == '(')\n        printf(\"$\");\n      else if (chuan[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  while (true) {\n    cin.getline(a, 101);\n    if (a[0] == 0)\n      break;\n    cout << a << \"\\n\";\n    int i, j = 0, k, l, d;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    b[i] = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (j == 0 && a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == ')') {\n        j--;\n        for (k = i; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[k] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(') {\n        j++;\n        b[i] = '$';\n      }\n    }\n    for (d = 0; d < strlen(a); d++)\n      if (b[d] != ' ')\n        break;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = b[i + d];\n    for (l = (strlen(a) - 1 - d); l >= 0; l--)\n      if (b[l] != ' ')\n        break;\n    b[l + 1] = 0;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31629", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, lena;\nchar a[101];\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    lena = strlen(a);\n    for (i = 0; i < lena; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = '*';\n            a[j] = '*';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < lena; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[101];\n  int rr, lr, ll, rl;\n  for (; (scanf(\"%s\", c)) != EOF;) {\n    printf(\"%s\\n\", c);\n    char p[101];\n    int i, l;\n    rr = 0;\n    rl = 0;\n    ll = 0;\n    lr = 0;\n    for (l = 0; c[l] != 0; l++) {\n      p[l] = ' ';\n    }\n    p[l] = '\\0';\n    for (i = 0; c[i] != 0; i++) {\n      if (c[i] == '(') {\n        ll = ll + 1;\n      }\n      if (c[i] == ')') {\n        lr = lr + 1;\n        if (ll < lr) {\n          p[i] = '?';\n          lr = lr - 1;\n        }\n      }\n    }\n    for (i = l - 1; i >= 0; i = i - 1) {\n      if (c[i] == ')') {\n        rr = rr + 1;\n      }\n      if (c[i] == '(') {\n        rl = rl + 1;\n        if (rr < rl) {\n          p[i] = '$';\n          rl = rl - 1;\n        }\n      }\n    }\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint zuok(char c[], int j, int len) {\n  int i, zuo = 1, you = 0;\n  for (i = j + 1; i < len; i++) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\nint youk(char c[], int j, int len) {\n  int i, you = 1, zuo = 0;\n  for (i = j - 1; i >= 0; i--) {\n    if (c[i] == '(')\n      zuo++;\n    else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  getchar();\n\n  int i;\n  for (i = 0; i < n; i++) {\n    char c[200];\n    cin >> c;\n    getchar();\n\n    printf(c);\n\n    cout << \"\\n\";\n\n    int len = strlen(c);\n\n    int j;\n\n    for (j = 0; j < len; j++) {\n      if (c[j] == '(') {\n        if (!zuok(c, j, len)) {\n          putchar('$');\n        } else\n          printf(\" \");\n      }\n\n      else if (c[j] == ')') {\n        if (!youk(c, j, len)) {\n          putchar('?');\n        } else\n          putchar(' ');\n      }\n\n      else {\n        putchar(' ');\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid findr(int left) {\n  for (int i = left + 1; s[i] != '\\0'; i++) {\n    if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n      s[i] = ' ';\n    if (s[i] == '(')\n      findr(i);\n    if (s[i] == ')') {\n      s[i] = ' ';\n      s[left] = ' ';\n      return;\n    }\n  }\n  s[left] = '$';\n}\n\nint main() {\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    for (int i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n        s[i] = ' ';\n      if (s[i] == '(')\n        findr(i);\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31633", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[101];\n  int i, a[101], k, j;\n  for (i = 0; i <= 100; i++)\n    a[i] = 1;\n  while (scanf(\"%s\", ch) != EOF) {\n    puts(ch);\n    i = 0;\n    do {\n      if ((ch[i] >= 'a' && ch[i] <= 'z') || (ch[i] >= 'A' && ch[i] <= 'Z'))\n        a[i] = 0;\n      if (ch[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if ((ch[k] == '(') && a[k] == 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    } while (ch[i] != '\\0');\n    j = i - 1;\n    for (i = 0; i <= j; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else {\n        if (ch[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\"\\n\");\n    for (i = 0; i <= 100; i++) {\n      a[i] = 1;\n      ch[i] = 'a';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[10000];\nint countl, countr, sum[1000] = {0};\n\nint pipei(int i) {\n\n  if (s[i] == '\\0')\n    return sum[i] = 0;\n  if (s[i] == '(') {\n    ++countl;\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    if (sum[i] > 0)\n\n    {\n      s[i] = ' ';\n      countl--;\n      countr--;\n      sum[i]--;\n    }\n\n    else {\n      countl--;\n      s[i] = '$';\n    }\n    return 0;\n  }\n\n  else if (s[i] == ')') {\n    countr++;\n    sum[i]++;\n    if (countl >= countr) {\n      s[i] = ' ';\n      pipei(i + 1);\n      sum[i] += sum[i + 1];\n      return 0;\n    } else {\n      countr--;\n      s[i] = '?';\n      pipei(i + 1);\n      sum[i] += sum[i + 1];\n      return 0;\n    }\n\n  } else {\n    s[i] = ' ';\n    pipei(i + 1);\n    sum[i] += sum[i + 1];\n    return 0;\n  }\n  return 0;\n}\n\nint main() {\n  while (cin) {\n    cin.getline(s, 1000);\n    printf(\"%s\\n\", s);\n    pipei(0);\n    cout << s << endl;\n    countl = countr = 0;\n    memset(sum, 0, sizeof(sum));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  int i, left = 0, right = 0;\n  char str[102], b[102];\n  while (cin.getline(str, 102)) {\n    len = strlen(str);\n    left = 0;\n    right = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      b[i] = ' ';\n      if (str[i] == '(')\n        left++;\n      if (str[i] == ')') {\n        if (left <= 0)\n          b[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == ')')\n        right++;\n      if (str[i] == '(') {\n        if (right <= 0)\n          b[i] = '$';\n        else\n          right--;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31636", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[200];\nvoid match(char a[]) {\n\n  int s;\n  s = strlen(a);\n  if (s == 0)\n    return;\n  int i, j;\n  int check = 0;\n  for (i = 0; i < s - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < s && a[j] == ' '; j++)\n        ;\n      if (j < s) {\n        if (a[j] == ')') {\n          check = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (check == 1) {\n    a[i] = ' ';\n    a[j] = ' ';\n    match(a);\n  }\n  if (check == 0)\n    return;\n}\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  char temp;\n  scanf(\"%c\", &temp);\n  while (n--) {\n\n    cin >> a;\n    puts(a);\n    int s;\n    s = strlen(a);\n    int i;\n    for (i = 0; i < s; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    match(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int s[101], len, k = 0, i;\n  while (cin >> a) {\n    for (len = 0; a[len] != '\\0'; len++)\n      ;\n    cout << a << \"\\n\";\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        s[k++] = i;\n      if (a[i] == ')' && k > 0) {\n        a[s[--k]] = ' ';\n        a[i] = ' ';\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n      if (a[i] == ')' && k == 0)\n        a[i] = '?';\n    }\n    for (i = k - 1; i >= 0; i--)\n      a[s[i]] = '$';\n    printf(\"%s\\n\", a);\n    memset(a, 0, sizeof(a));\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101], bracket[101];\nint len;\nvoid match(int a);\n\nint main() {\n  while (cin.getline(str, 101)) {\n    len = strlen(str);\n    for (int i = 0; i < len; i++)\n      if (str[i] == '(')\n        bracket[i] = '$';\n      else if (str[i] == ')')\n        bracket[i] = '?';\n      else\n        bracket[i] = ' ';\n    match(1);\n    for (int i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = 0; i < len; i++)\n      cout << bracket[i];\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n\nvoid match(int a) {\n  if (a == len)\n    return;\n  int b = a - 1;\n  if (bracket[a] == '?') {\n    while (bracket[b] == ' ') {\n      if (b == 0) {\n        match(a + 1);\n        return;\n      }\n      b--;\n    }\n    if (bracket[b] == '?') {\n      match(a + 1);\n      return;\n    }\n    bracket[b] = ' ';\n    bracket[a] = ' ';\n    match(a + 1);\n  } else\n    match(a + 1);\n}\n"}
{"label": "17", "index": "31639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[110], s[110];\n  int left, i;\n  int leftp[110] = {0};\n  while (scanf(\"%s \", c)) {\n    left = 0;\n    i = 0;\n    memset(leftp, 0, 110 * sizeof(int));\n    memset(s, 0, 110 * sizeof(char));\n    while (c[i] != '\\0') {\n      if (c[i] == '(') {\n        left++;\n        leftp[left] = i;\n      } else if (c[i] == ')') {\n        if (left == 0)\n          s[i] = '?';\n        else {\n          left--;\n        }\n      }\n      i++;\n    }\n    if (left > 0)\n      for (i = 1; i <= left; i++)\n        s[leftp[i]] = '$';\n    cout << c << endl;\n    for (i = 0; i < strlen(c); i++)\n      if ((s[i] == '?') || (s[i] == '$'))\n        cout << s[i];\n      else\n        cout << ' ';\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len;\nvoid f(char a[]) {\n  int i, j;\n  len = strlen(a);\n  for (i = len - 1; i >= 0; i--) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < len; j++) {\n        if (a[j] == ')') {\n          a[i] = a[j] = ' ';\n          break;\n        }\n      }\n      if (a[j] == '\\0') {\n        a[i] = '$';\n      }\n      f(a);\n    }\n  }\n}\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' ';\n    f(c);\n    for (i = 0; c[i] != '\\0'; i++) {\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31641", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[105];\n  while (cin >> a) {\n    int n = strlen(a);\n    int i = 0, j, b[105];\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        b[i] = 1;\n      } else if (a[i] == ')') {\n        b[i] = -1;\n      } else\n        b[i] = 0;\n    } \n    for (i = 0; i < n; i++) {\n      if (b[i] == -1) {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(a);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      else if (b[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[102];\n  int i, j, L, k;\n  int b[102] = {0};\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < 102; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    cin >> a;\n    cout << a << \"\\n\";\n    L = strlen(a);\n    for (i = L - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < L; j++) {\n          if (a[j] == ')')\n\n          {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n        if (j == L)\n          b[i] = 1;\n      }\n    }\n\n    for (i = 0; i < L; i++) {\n      if (a[i] == ')')\n        b[i] = 2;\n    }\n    for (i = 0; i < L; i++) {\n      if (b[i] == 1)\n        printf(\"$\");\n      else if (b[i] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31643", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[110];\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    int l = strlen(s), i;\n    for (i = l - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        continue;\n      else if (s[i] == '(') {\n        int j;\n        for (j = i; j < l; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          s[i] = '$';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      if (s[i] == ')')\n        s[i] = '?';\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31644", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, k, p, d, x;\n  char a[101];\n  char b[101];\n  while (cin >> a) {\n    puts(a);\n    for (j = 0; a[j] != '\u0000'; j++) {\n\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\u0000';\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (b[k] == '?') {\n        d = 0;\n        for (p = k - 1; p >= 0; p--) {\n          if (b[p] == '$') {\n            x = p;\n            d = 1;\n            break;\n          }\n        }\n        if (d == 1) {\n          b[k] = ' ';\n          b[x] = ' ';\n        }\n      }\n    }\n    for (k = j; k >= 0; k--) {\n      if (b[k] != ' ' && b[k] != '\u0000')\n        break;\n    }\n    for (p = 0; p < j; p++) {\n      if (b[p] != ' ')\n        break;\n    }\n    for (x = p; x <= k; x++)\n      printf(\"%c\", b[x]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][1000], s[1000];\n  int i, j, n, a[1000], temp;\n  for (i = 0; i < 100; i++)\n    str[i][0] = '\u0000';\n  i = 0;\n  do {\n\n    cin >> str[i];\n    if (str[i][0] == '\u0000')\n      break;\n    i++;\n  } while (1);\n  n = i - 1;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j < 1000; j++)\n      s[j] = '\u0000';\n    temp = 0;\n    cout << str[i] << \" \";\n    for (j = 0; j < (strlen(str[i])); j++) {\n      if (str[i][j] == '(') {\n        s[j] = '$';\n        temp++;\n        a[temp] = j;\n      } else if (str[i][j] == ')') {\n        if (temp == 0)\n          s[j] = '?';\n        else {\n          s[a[temp]] = ' ';\n          temp--;\n          s[j] = ' ';\n        }\n      } else\n        s[j] = ' ';\n    }\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[100], s[100];\n\nvoid match(int x) {\n  int i;\n  for (i = x - 1; i >= 0; --i)\n    if (s[i] == '$') {\n      s[x] = ' ';\n      s[i] = ' ';\n      break;\n    }\n}\n\nint main() {\n  int i, l;\n  while (scanf(\"%s \", str)) {\n    l = strlen(str);\n    s[l] = '\\0';\n    for (i = 0; i < l; ++i)\n      s[i] = ' ';\n    printf(\"%s\\n\", str);\n    for (i = 0; i < l; ++i)\n      switch (str[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        match(i);\n        break;\n      }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1000 + 1], flag[1000 + 1];\n  int i, j, sstack[1000 + 1];\n  while (scanf(\"%s\", str) != EOF) {\n    cout << str << \" \";\n    j = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        sstack[j++] = i;\n      else if (str[i] == ')') {\n        if (j <= 0)\n          flag[i] = '?';\n        else {\n          j--;\n          flag[sstack[j]] = ' ';\n          flag[i] = ' ';\n        }\n      } else\n        flag[i] = ' ';\n    }\n    for (i = 0; i < j; i++)\n      flag[sstack[i]] = '$';\n    flag[strlen(str)] = '\u0000';\n    cout << flag << \" \";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31648", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str1[101], str2[101];\n  int i, figure = 0, temp[100];\n  while (cin >> str1) {\n    memset(str2, ' ', sizeof(str2));\n    for (i = 0; i < strlen(str1); i++) {\n      if (str1[i] == '(') {\n        str2[i] = '$';\n        temp[figure++] = i;\n      }\n      if (str1[i] == ')') {\n        if (figure > 0) {\n          str2[temp[figure - 1]] = ' ';\n          figure--;\n        } else {\n          str2[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < strlen(str1) - 1; i++)\n      cout << str1[i];\n    cout << str1[strlen(str1) - 1] << endl;\n    for (i = 0; i < strlen(str1) - 1; i++) {\n      cout << str2[i];\n    }\n    cout << str2[strlen(str1) - 1] << endl;\n    figure = 0;\n    memset(str1, ' ', sizeof(str1));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31649", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char l, r, s, sen[200], rem[200];\n  int i = 1, j = 1, k = 1, nsen, b = 1;\n  l = '(';\n  r = ')';\n\n  while (b == 1) {\n\n    while ((s = cin.get()) != '\\n') {\n      sen[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    nsen = i - 1;\n\n    for (j = 1; j < nsen; j++)\n      for (i = 1; i < nsen; i++)\n        if (sen[i] == l && sen[i + j] == r) {\n          sen[i] = ' ';\n          sen[i + j] = ' ';\n        }\n\n    for (i = 1; i <= nsen; i++)\n      if (sen[i] == l)\n        sen[i] = '$';\n      else if (sen[i] == r)\n        sen[i] = '?';\n      else\n        sen[i] = ' ';\n\n    for (i = 1; i <= nsen; i++)\n      cout << rem[i];\n    cout << \"\\n\";\n    for (i = 1; i <= nsen; i++)\n      cout << sen[i];\n    cout << endl;\n\n    nsen = 0;\n    i = 1;\n    j = 1;\n    k = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    cin >> a;\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      b[j] = ' ';\n    b[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0) {\n          b[j] = '?';\n        } else {\n          t--;\n          b[c[t]] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++) {\n      cout << b[h];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31651", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[200];\n  while (scanf(\"%s\", str) != EOF) {\n    int n, i, j, k;\n    printf(\"%s \", str);\n    n = strlen(str);\n    for (i = 0, k = 0; i < n; i++) {\n      if (str[i] == '(')\n        k = i;\n\n      if (str[i] == ')' && str[k] == '(') {\n        str[i] = ' ';\n        str[k] = ' ';\n        i = -1;\n        k = 0;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n      else {\n        if (str[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid pro(char *s) {\n  char a[444];\n  char *p;\n  int i, j;\n  i = -1;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(') {\n      i++;\n      a[i] = *p;\n    } else if (*p == ')') {\n      j = i;\n      while ((j >= 0) && (a[j] != '('))\n        j--;\n      if (j == -1) {\n        i++;\n        a[i] = *p;\n      } else {\n        a[j] = ' ';\n        i++;\n        a[i] = ' ';\n      }\n    } else {\n      i++;\n      a[i] = ' ';\n    }\n    p++;\n  }\n\n  a[i + 1] = '\u0000';\n  strcpy(s, a);\n}\n\nvoid print(char *s) {\n  char *p;\n  p = s;\n  while (*p != '\u0000') {\n    if (*p == '(')\n      *p = '$';\n    else {\n      if (*p == ')')\n        *p = '?';\n    }\n    p++;\n  }\n  puts(s);\n}\nint main() {\n\n  char s[323];\n\n  cin >> s;\n  while (s[0] != '\u0000') {\n\n    puts(s);\n    pro(s);\n    print(s);\n    s[0] = '\u0000';\n\n    cin >> s;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[200];\n  int i, j, k, ei, bi, l;\n  while (cin.getline(str, 150)) {\n    int strout[101] = {0};\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(')\n        strout[i] = -1;\n      else if (str[i] == ')')\n        strout[i] = 1;\n    }\n    for (i = 0; i < l; i++) {\n      if (strout[i] != -1)\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (strout[j] != 1)\n          continue;\n        for (k = j; k >= i; k--) {\n          if (strout[k] == -1) {\n            strout[k] = 0;\n            strout[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    bi = l - 1;\n    ei = 0;\n    for (i = 0; i < l; i++)\n      if (strout[i] != 0) {\n        bi = i;\n        break;\n      }\n    for (i = l - 1; i >= 0; i--)\n      if (strout[i] != 0) {\n        ei = i;\n        break;\n      }\n\n    for (i = bi; i <= ei; i++) {\n      if (strout[i] == 0)\n        cout << ' ';\n      else if (strout[i] == -1)\n        printf(\"$\");\n      else\n        cout << '?';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31654", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[30][120];\n  int j, n, i, b[30], k, zuo[30][120], you[30][120];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 119; j++) {\n      zuo[i][j] = 0;\n      you[i][j] = 0;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    k = 0;\n\n    cin >> a[i];\n    b[i] = strlen(a[i]);\n    for (j = b[i] - 1; j >= 0; j--) {\n\n      if (a[i][j] == '(') {\n        if (k == 0)\n          zuo[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      }\n\n      else if (a[i][j] == ')')\n        k += 1;\n    }\n    k = 0;\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (a[i][j] == ')') {\n        if (k == 0)\n          you[i][j] = 1;\n        if (k > 0)\n\n          k -= 1;\n      } else if (a[i][j] == '(')\n        k += 1;\n    }\n    printf(\"%s\\n\", a[i]);\n    for (j = 0; j <= b[i] - 1; j++) {\n      if (zuo[i][j] == 1)\n        printf(\"$\");\n      else {\n        if (you[i][j] == 1)\n          printf(\"?\");\n        else\n          printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31655", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[150];          \nint len, num = 0;     \nint f1(int n) {       \n  if (n == len - 1) { \n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num; \n  }\n  if (a[n] == '(') { \n    num++;\n    return f1(n + 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    if (num == 0)\n      return 0;\n    else\n      return f1(n + 1);\n  } else \n    return f1(n + 1);\n}\nint f2(int n) { \n  if (n == 0) { \n    if (a[n] == '(') {\n      num++;\n    } else if (a[n] == ')') {\n      num--;\n    }\n    return num; \n  }\n  if (a[n] == '(') { \n    num++;\n    if (num == 0)\n      return 0;\n    else\n      return f2(n - 1);\n  }\n  if (a[n] == ')') {\n    num--;\n    return f2(n - 1);\n  } else \n    return f2(n - 1);\n}\nint main() {\n  while (cin >> a) {\n    len = strlen(a);\n    cout << a << endl;                \n    for (int i = 0; i < len; i++) {   \n      if (a[i] != '(' && a[i] != ')') \n        cout << ' ';\n      else if (a[i] == '(') { \n        num = 0;              \n        if (f1(i) > 0)\n          cout << '$';\n        else\n          cout << ' ';\n      } else {   \n        num = 0; \n        if (f2(i) < 0)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31656", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][1000], s[1000];\n  int i, j, n, a[1000], temp;\n  for (i = 0; i < 100; i++)\n    str[i][0] = '\u0000';\n\n  i = 0;\n  do {\n\n    cin >> str[i];\n    if (str[i][0] == '\u0000')\n      break;\n    i++;\n  } while (1);\n  n = i - 1;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; j < 1000; j++)\n      s[j] = '\u0000';\n    temp = 0;\n    printf(\"%s \", str[i]);\n    for (j = 0; j < (strlen(str[i])); j++) {\n      if (str[i][j] == '(') {\n        s[j] = '$';\n        temp++;\n        a[temp] = j;\n      } else if (str[i][j] == ')') {\n        if (temp == 0)\n          s[j] = '?';\n        else {\n          s[a[temp]] = ' ';\n          temp--;\n          s[j] = ' ';\n        }\n      } else\n        s[j] = ' ';\n    }\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31657", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n  int i, j;\n\n  while (scanf(\"%s\", s) != EOF) {\n    puts(s);\n    int a[100] = {0};\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        a[i] = -1;\n      else if (s[i] == ')')\n        a[i] = 1;\n\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (a[i] == 1)\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1) {\n            a[i] = a[j] = 0;\n            break;\n          }\n    }\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        printf(\"?\");\n      else if (a[i] == -1)\n        printf(\"$\");\n      else if (a[i] == 0)\n        printf(\" \");\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint zuok(char c[], int j, int len) {\n  int i, zuo = 1, you = 0;\n  for (i = j + 1; i < len; i++) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\nint youk(char c[], int j, int len) {\n  int i, you = 1, zuo = 0;\n  for (i = j - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  getchar();\n\n  int i;\n  for (i = 0; i < n; i++) {\n    char c[200];\n    cin >> c;\n    getchar();\n\n    printf(c);\n\n    cout << \"\\n\";\n\n    int len = strlen(c);\n\n    int j;\n\n    for (j = 0; j < len; j++) {\n      if (c[j] == '(') {\n        if (!zuok(c, j, len)) {\n          putchar('$');\n        } else\n          printf(\" \");\n      }\n\n      else if (c[j] == ')') {\n        if (!youk(c, j, len)) {\n          putchar('?');\n        } else\n          putchar(' ');\n      }\n\n      else {\n        putchar(' ');\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nchar m[1000];\nint match(int l) {\n\n  int r = l;\n  while (s[++r] != ')') {\n    if (s[r] == '(')\n      r = match(r);\n    if (s[r] == '\\0')\n      break;\n  }\n  if (s[r] == '\\0')\n    m[l] = '$';\n  return r;\n}\nint nextL(int i) {\n  while (s[i] != '\\0' && s[i] != '(') {\n    if (s[i] == ')')\n      m[i] = '?';\n    i++;\n  }\n  return i;\n}\nint main() {\n  int i, j, k;\n  while (scanf(\"%s \", s)) {\n    for (i = 0; i < strlen(s); ++i)\n      m[i] = ' ';\n    m[i] = '\\0';\n    i = 0;\n    i = nextL(i);\n    while (s[i] != '\\0') {\n      i = match(i);\n      if (s[i] == '\\0')\n        break;\n      else\n        i++;\n      i = nextL(i);\n    }\n    printf(\"%s\\n%s\\n\", s, m);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else\n      s[i] = ' ';\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  while (cin >> live) {\n    cout << live << endl;\n    Find(live);\n    cout << live << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31661", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int m = 1; m <= n; m++) {\n    char str[105], str2[105];\n    cin >> str;\n    int stack[105];\n    int len = strlen(str), k = 0;\n    for (int i = 0; i < len; i++) {\n      str2[i] = ' ';\n    }\n    str2[len] = '\\0';\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k == 0 || stack[k - 1] > 0) {\n          stack[k++] = i + 1;\n        } else\n          k--;\n      } else if (str[i] == '(') {\n        stack[k++] = -i - 1;\n      }\n    }\n    for (int i = 0; i < k; i++) {\n      if (stack[i] < 0)\n        str2[-stack[i] - 1] = '$';\n      else\n        str2[stack[i] - 1] = '?';\n    }\n    printf(\"%s\\n\", str);\n    cout << str2 << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31662", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid peidui(void);\nint m, i;\nchar a[100][110];\nint main() {\n  char c, h;\n  int j, k, t[100] = {0}, p, n = 0;\n  while (cin >> a[n])\n    n = n + 1;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(') {\n        m = m + 1;\n        peidui();\n        m = m - 1;\n      }\n      if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n          (a[i][m] >= 'A' && a[i][m] <= 'Z'))\n        a[i][m] = ' ';\n    }\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(') {\n        a[i][m] = '$';\n      }\n      if (a[i][m] == ')')\n        a[i][m] = '?';\n    }\n    for (m = 0; m < t[i]; m++)\n      cout << a[i][m];\n    cout << endl;\n  }\n  return 0;\n}\nvoid peidui(void) {\n  int k;\n  k = m - 1;\n  if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n      (a[i][m] >= 'A' && a[i][m] <= 'Z')) {\n    a[i][m] = ' ';\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == '(') {\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == ')' && a[i][k] == '(') {\n    a[i][m] = ' ';\n    a[i][k] = ' ';\n    m = m + 1;\n    peidui();\n  }\n}\n"}
{"label": "17", "index": "31663", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nint temp[100];\nint addition[100];\nint flag, i, j;\nint f() {\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      addition[flag] = i;\n      flag++;\n    } else if (s[i] == ')') {\n      if (flag) {\n        s[i] = ' ';\n        flag--;\n        s[addition[flag]] = ' ';\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\nint main() {\n  while (scanf(\"%s \", s)) {\n    printf(\"%s\\n\", s);\n    flag = 0;\n    f();\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31664", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char ch[200];\n  int a[200];\n  int n, l, i, j, m;\n  while (cin.getline(ch, 150)) {\n    l = strlen(ch);\n    for (i = 0; i < l; i++)\n      if (ch[i] == '(')\n        a[i] = -1;\n      else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1)\n            break;\n        if (j != -1) {\n          a[i] = 0;\n          a[j] = 0;\n        } else\n          a[i] = 1;\n      } else\n        a[i] = 0;\n    n = 0;\n    for (i = 0; i < l; i++)\n      if (a[i] != 0)\n        n++;\n    m = n;\n    i = 0;\n    cout << ch << endl;\n    while (n > 0) {\n      if (a[i] == -1)\n        cout << \"$\";\n      else if (a[i] == 1)\n        cout << \"?\";\n      else if (m != n)\n        cout << \" \";\n      if (a[i] != 0)\n        n--;\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31665", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, g, ans, max, temp, n, l, t;\n  char c[1000];\n  while (scanf(\"%s\", c) != EOF) {\n    printf(\"%s \", c);\n    for (k = 0; k < 100; k++) {\n      for (i = 0; c[i] != '\u0000'; i++) {\n        if (c[i] == '(') {\n          for (j = i + 1; c[j] != '\u0000'; j++) {\n            if (c[j] == '(') {\n              i = j - 1;\n              break;\n            }\n            if (c[j] == ')') {\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; c[i] != '\u0000'; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      else if (c[i] == ')')\n        c[i] = '?';\n      else\n        c[i] = ' ';\n    }\n    printf(\"%s \", c);\n  }\n}\n"}
{"label": "17", "index": "31666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  while (n--) {\n    char s[105], a[105];\n    int i, k = 0, stack[105];\n    memset(a, ' ', sizeof(a));\n    cin >> s;\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        stack[k++] = -i - 1;\n      else if (s[i] == ')')\n        if (k == 0 || stack[k - 1] > 0)\n          stack[k++] = i + 1;\n        else\n          k--;\n    for (i = 0; i < k; i++)\n      if (stack[i] > 0)\n        a[stack[i] - 1] = '?';\n      else\n        a[-stack[i] - 1] = '$';\n    a[strlen(s)] = '\\0';\n    printf(\"%s\\n%s\\n\", s, a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int n1, int z[500], char s[500]);\nvoid search(int a[500], int h);\nchar s[500];\nint z[500];\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    int h, a, l1 = 0, l2 = 0;\n    h = strlen(s);\n    for (a = 0; a <= h - 1; a++) {\n      if (s[a] == '(') {\n        z[a] = 1;\n      } else {\n        if (s[a] == ')') {\n          z[a] = 2;\n        } else\n\n        {\n          z[a] = 0;\n        }\n      }\n    }\n    search(z, h);\n    print(h, z, s);\n  }\n  return 0;\n}\nvoid search(int z[500], int h) {\n  int k, m, n;\n  for (m = 1; m <= h - 1; m++)\n    for (k = 0; (k + m) <= (h - 1); k++)\n      if ((z[k] == 1) && (z[k + m] == 2)) {\n        z[k] = 0;\n        z[k + m] = 0;\n      }\n}\nvoid print(int n1, int z[500], char s[500]) {\n  int a;\n  for (a = 0; a < n1; a++) {\n    printf(\"%c\", s[a]);\n  }\n  printf(\"\\n\");\n  for (a = 0; a < n1; a++) {\n    if (z[a] == 0)\n      printf(\" \");\n    if (z[a] == 1)\n      cout << \"$\";\n    if (z[a] == 2)\n      printf(\"?\");\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "17", "index": "31668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint work(int);\nchar l = '(', r = ')', sen[110][110] = {0}, rem[110][110] = {0};\nint i, j, k, t = 1, nsen[110] = {0};\nint main() {\n  for (i = 0;; i++) {\n    \n    j = 0;\n    char c;\n    while ((c = cin.get()) != '\\n')\n      sen[i][j++] = c;\n    for (j = 0; sen[i][j] != 0; j++)\n      nsen[i]++;\n    for (t = 0; t < nsen[i]; t++)\n      rem[i][t] = sen[i][t];\n    work(i);\n    cout << rem[i] << endl;\n    cout << sen[i] << endl;\n  }\n\n  return 0;\n}\n\nint work(int i) {\n  for (j = 1; j <= nsen[i] - 1; j++) \n    for (k = 0; k < nsen[i] - 1; k++)\n      if (sen[i][k] == l && sen[i][k + j] == r) {\n        sen[i][k] = ' ';\n        sen[i][k + j] = ' ';\n      } \n\n  for (k = 0; k <= nsen[i] - 1; k++)\n    if (sen[i][k] == l)\n      sen[i][k] = '$';\n    else if (sen[i][k] == r)\n      sen[i][k] = '?'; \n    else\n      sen[i][k] = ' '; \n\n  k = 0;\n  j = 1;\n  return 0;\n}\n"}
{"label": "17", "index": "31669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else\n      s[i] = ' ';\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  while (scanf(\"%s \", live)) {\n    cout << live << endl;\n    Find(live);\n    cout << live << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, t, len;\n  char a[100];\n  while (cin >> a) {\n    t = 0;\n    m = 0;\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      if (a[i] == ')')\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        m = i;\n        break;\n      }\n    for (i = len - 1; i >= 0; i--)\n      if ((a[i] == '(') || (a[i] == ')')) {\n        t = i;\n        break;\n      }\n    for (i = m; i <= t; i++) {\n      if (a[i] == ')')\n        cout << \"?\";\n      else if (a[i] == '(')\n        cout << \"$\";\n      else\n        cout << \" \";\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')') {\n      num++;\n    }\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i, n;\n  char s[101], a[101];\n  scanf(\"%d\", &n);\n  while (scanf(\"%s \", s)) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[101];\n  int rr, lr, ll, rl;\n  for (; (scanf(\"%s\", c)) != EOF;) {\n    printf(\"%s\\n\", c);\n    char p[101];\n    int i, l;\n    rr = 0;\n    rl = 0;\n    ll = 0;\n    lr = 0;\n    for (l = 0; c[l] != 0; l++)\n      p[l] = ' ';\n\n    p[l] = '\\0';\n    for (i = 0; c[i] != 0; i++) {\n      if (c[i] == '(') {\n        ll = ll + 1;\n      }\n      if (c[i] == ')') {\n        lr = lr + 1;\n        if (ll < lr) {\n          p[i] = '?';\n          lr = lr - 1;\n        }\n      }\n    }\n    for (i = l - 1; i >= 0; i = i - 1) {\n      if (c[i] == ')') {\n        rr = rr + 1;\n      }\n      if (c[i] == '(') {\n        rl = rl + 1;\n        if (rr < rl) {\n          p[i] = '$';\n          rl = rl - 1;\n        }\n      }\n    }\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000] = {'0'};\nchar c[1000] = {' '};\nint qq, pp;\nint t = 0;\nint x(int m) {\n  if (qq <= m - 1) {\n    if (a[qq] == '(') {\n      qq++;\n      t++;\n      x(m);\n    } else if (a[qq] == ')') {\n      qq++;\n      t--;\n      if (t == -1) {\n        c[qq - 1] = '?';\n        t = 0;\n      }\n      x(m);\n    } else if (a[qq] != '(' && a[qq] != ')') {\n      qq++;\n      x(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint y(int m) {\n  if (pp >= 0) {\n    if (a[pp] == ')') {\n      pp--;\n      t++;\n      y(m);\n    } else if (a[pp] == '(') {\n      pp--;\n      t--;\n      if (t == -1) {\n        c[pp + 1] = '$';\n        t = 0;\n      }\n      y(m);\n    } else if (a[pp] != '(' && a[pp] != ')') {\n      pp--;\n      y(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint main() {\n  char b;\n  int i = 0;\n  while (cin.get(b)) {\n    if (b != '\\n')\n      a[i++] = b;\n    else if (b == '\\n') {\n      for (int j3 = 0; j3 <= i - 1; j3++)\n        c[j3] = ' ';\n      cout << a << endl;\n      qq = 0;\n      x(i);\n      pp = i - 1;\n      y(i);\n      for (int j = 0; j <= i - 1; j++)\n        cout << c[j];\n      printf(\"\\n\");\n      for (int j1 = 0; j1 <= i - 1; j1++) {\n        c[j1] = ' ';\n        a[j1] = '\\0';\n      }\n      i = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][101], b[100][101], c = '(', d = ')';\n  int i, j, k;\n  for (k = 0; k <= 20; k++) {\n    for (i = 0; i < 101; i++)\n      a[k][i] = 0;\n\n    cin >> a[k];\n    strcpy(b[k], a[k]);\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == d)\n        for (j = i - 1; j >= 0; j--)\n          if (a[k][j] == c) {\n            a[k][i] = a[k][j] = 1;\n            break;\n          }\n    for (i = 0; i < 101 && b[k][i] != 0; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == c)\n        printf(\"$\");\n      else if (a[k][i] == d)\n        printf(\"?\");\n      else\n        printf(\" \");\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar x[110] = {'\\0'}, y[110] = {'\\0'};\nint i, j, k, l;\nint f() {\n  for (i = 0; i < l - 1; i++) {\n    for (j = 1; i + j < l; j++) {\n      if (x[i] == '(' && x[i + j] == ' ') {\n        continue;\n      }\n      if (x[i] == '(' && x[i + j] == '(') {\n        break;\n      }\n      if (x[i] == '(' && x[i + j] == ')') {\n        x[i] = ' ';\n        x[i + j] = ' ';\n      }\n    }\n  }\n  k++;\n  if (k == l) {\n    return 0;\n  }\n  if (k != l) {\n    f();\n  }\n}\nint main() {\n  while (cin.getline(x, 110, '\\n')) {\n    strcpy(y, x);\n    l = strlen(x);\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(' && x[i] != ')') {\n        x[i] = ' ';\n      }\n    }\n    k = 0;\n    f();\n    cout << y << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == '(')\n        cout << \"$\";\n\n      if (x[i] == ')') {\n        cout << \"?\";\n      }\n      if (x[i] == ' ') {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31676", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, k = 0, x = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      b[i] = a[i];\n    for (i = 0; i < n; i++)\n      if (b[i] != '(' && b[i] != ')')\n        b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < n; k++) {\n        if (b[k] == ')') {\n          for (x = 0; x <= k; x++) {\n            if (b[k - x] == '(') {\n              b[k] = ' ';\n              b[k - x] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ans[101], a[101];\n  int n;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n\n    cin >> a;\n    int ll = strlen(a);\n    int bb[101] = {0};\n    int be;\n    be = -1;\n    int i = 0;\n    while (i < ll) {\n      while (a[i] != '(' && a[i] != ')') {\n        ans[i] = ' ';\n        i++;\n        if (i >= ll)\n          break;\n      }\n      if (a[i] == '(') {\n        bb[i + 1] = be;\n        be = i + 1;\n      }\n      if (a[i] == ')') {\n        if (be < 0)\n          ans[i] = '?';\n        else {\n          int t;\n          t = bb[be];\n          bb[be] = 0;\n          be = t;\n          ans[i] = ' ';\n        }\n      }\n      i++;\n    }\n    for (i = 0; i < ll; i++) {\n      if (a[i] == '(') {\n        if (bb[i + 1] == 0)\n          ans[i] = ' ';\n        else\n          ans[i] = '$';\n      }\n    }\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; i < ll; i++)\n      printf(\"%c\", ans[i]);\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31678", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int length, i = 0;\n  while (1) {\n    cin.get(str, 110, '\\n');\n    if (cin.get() == EOF)\n      break;\n    length = strlen(str);\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    printf(\"\\n\");\n    for (i = length - 1; i >= 0; i--) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i; j < length; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n    }\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint match(int i);\nchar str[101];\nint n;\nint main() {\n  while (cin >> str) {\n    cout << str << endl;\n    n = strlen(str);\n    match(0);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(')\n    str[i] = '$';\n  else\n    str[i] = ' ';\n\n  match(i + 1);\n  return 0;\n}\n"}
{"label": "17", "index": "31680", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][110], c, h;\n  int i, j, k, t[100] = {0}, p, m, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (j = 0; j < t[i]; j++) {\n      if ((a[i][j] >= 'a' && a[i][j] <= 'z') ||\n          (a[i][j] >= 'A' && a[i][j] <= 'Z'))\n        a[i][j] = ' ';\n    }\n    for (j = 0; j < t[i] - 1; j++) {\n      if (a[i][j] == '(') {\n        for (k = j + 1; k < t[i]; k++) {\n          if (a[i][k] == ')') {\n            a[i][j] = ' ';\n            a[i][k] = ' ';\n            j = -1;\n            break;\n          }\n          if (a[i][k] == '(') {\n            j = k - 1;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    for (j = 0; j < t[i]; j++) {\n      if (a[i][j] == ' ')\n        cout << a[i][j];\n      if (a[i][j] == '(')\n        cout << '$';\n      if (a[i][j] == ')')\n        cout << '?';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  char a[100][120];\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    puts(a[i]);\n    k = strlen(a[i]);\n    for (j = 0; j < k; j++) {\n\n      if (a[i][j] == ')') {\n        a[i][j] = '?';\n      }\n      if (a[i][j] == '(') {\n        a[i][j] = '$';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] != '?' && a[i][j] != '$') {\n        a[i][j] = ' ';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == '?') {\n        for (l = j; l >= 0; l--) {\n          if (a[i][l] == '$') {\n            a[i][j] = ' ';\n            a[i][l] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      cout << a[i][j];\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31682", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[100];\n  int z, y, i, j, l, t, m;\n  while (scanf(\"%s \", sen)) {\n    z = 0;\n    y = 0;\n    l = strlen(sen);\n    cout << sen << \" \";\n\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        z++;\n      }\n      if (sen[i] == ')') {\n        y++;\n      }\n    }\n    if (z > y) {\n      m = y;\n    } else\n      m = z;\n\n    for (i = 0; i < m; i++) {\n      j = 1;\n      for (t = 0; t < l; t++) {\n        if (sen[t] == '(') {\n          j = 0;\n          z = t;\n        }\n        if (sen[t] == ')') {\n          if (j == 0) {\n            sen[z] = '0';\n            sen[t] = '0';\n          }\n          j = 1;\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        printf(\"$\");\n      } else if (sen[i] == ')') {\n        printf(\"?\");\n      } else if ((sen[i] != '(') && (sen[i] != ')')) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31683", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, m, i, j;\n  char str[101], str1[101];\n  cin >> n;\n  for (m = 0; m < n; m++) {\n\n    cin >> str;\n    puts(str);\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == ')')\n        for (j = i; j >= 0; j--)\n          if (str[j] == '(') {\n            str[j] = '0';\n            str[i] = '0';\n            break;\n          }\n    }\n\n    printf(\" \");\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      if (str[i] == ')')\n        cout << \"?\";\n      if (str[i] != '(' && str[i] != ')')\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31684", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0, right = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    if (left >= 1)\n      for (int i = 1; i <= left; i++)\n        label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, s;\nchar a[101];\nvoid f(int x) {\n  a[x] = '$';\n  if (x < s - 1) {\n    for (int j = x + 1; j < s; j++) {\n      if (a[j] == '(') {\n        i = j;\n        f(j);\n      } else if (a[j] == ')') {\n        a[x] = ' ', a[j] = ' ';\n        return;\n      } else if (a[j] != '$')\n        a[j] = ' ';\n    }\n  }\n  return;\n}\nint main() {\n  int j = 0;\n  while (cin.getline(a, 101)) {\n    if (j != 0)\n      cout << endl;\n    cout << a;\n    s = strlen(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        f(i);\n      else {\n        if (a[i] == ')')\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    j++;\n    cout << endl << a;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31686", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  cin >> n;\n  char a[n][1000];\n  getchar();\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else {\n              a[i][j] = '$';\n            }\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31687", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint brackets_matching(char str[], char result[], int n, int j)\n\n{\n  int i, p;\n  for (i = j; str[i]; i++) {\n    switch (str[i]) {\n    case '(':\n      p = brackets_matching(str, result, n + 1, i + 1);\n      if (str[p] == ')')\n        result[i] = ' ';\n      else\n        result[i] = '$';\n      i = p;\n      break;\n\n    case ')':\n      if (!n)\n        result[i] = '?';\n      else {\n        result[i] = ' ';\n        return i;\n      }\n      break;\n\n    default:\n      result[i] = ' ';\n    }\n  }\n  result[i] = 0;\n  return i;\n}\n\nint main() {\n  char a[1000], result[1000];\n  while (scanf(\"%s \", a)) {\n    printf(\"%s\\n\", a);\n    brackets_matching(a, result, 0, 0);\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[500][103];\nvoid chuli(int i, int la) {\n  int j, k, l, flag = 0;\n  for (j = 0; j < la - 1; j++) {\n    if (a[i][j] == '(') {\n      k = j + 1;\n      while (a[i][k] != '(' && a[i][k] != ')' && k < la)\n        k++;\n      if (a[i][k] == ')') {\n        flag = 1;\n        a[i][j] = a[i][k] = ' ';\n      }\n    }\n  }\n  if (flag == 1)\n    chuli(i, la);\n}\nint main() {\n  int n = 0, la[500] = {0}, i, j;\n  char c, b[500][103];\n  while (scanf(\"%c \", &c)) {\n    while (c != '\\n') {\n      a[n][la[n]] = b[n][la[n]] = c;\n      la[n]++;\n      c = getchar();\n    }\n    n++;\n  }\n  for (i = 0; i < n; i++)\n    chuli(i, la[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < la[i]; j++)\n      cout << b[i][j];\n    cout << endl;\n    for (j = 0; j < la[i]; j++) {\n      if (a[i][j] == '(')\n        cout << '$';\n      else if (a[i][j] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    if (i != n - 1)\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint match(char *a) \n{\n  int i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] == ')') \n    {\n      a[i] = ' ';\n      a[0] = ' ';\n      return i;\n    } else if (a[i] == '(') \n    {\n      a[i] = '$';\n      i += match(a + i);\n    } else\n      a[i] = ' '; \n    i++;\n  }\n  return i - 1;\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    cout << ch << endl;\n    int i = 0;\n    while (ch[i] != '\\0') {\n      if (ch[i] == '(') {\n        ch[i] = '$';\n        i += match(ch + i);\n      } else if (ch[i] == ')')\n        ch[i] = '?'; \n      else\n        ch[i] = ' ';\n      i++;\n    }\n    cout << ch << endl; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar investigate(char a[]) {\n  int i, j, k, n;\n  int p1 = 0, p2 = 0, w, t = 0, t1 = 0;\n  n = strlen(a);\n  char b[100];\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      p1++;\n    if (a[i] == ')')\n      p2++;\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((i == (n - 1)) && (t > t1)) {\n      i = -1;\n      t1 = t;\n      goto loop;\n    } else if (a[i] != '(') {\n      b[i] == ' ';\n      continue;\n    } else {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == '(') {\n          i = j - 1;\n          break;\n        } else if (a[j] == ')') {\n          a[i] = '[';\n          a[j] = ']';\n          t++;\n          break;\n        }\n      }\n    }\n  loop:;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == '[')\n      a[i] = '(';\n    if (a[i] == ']')\n      a[i] = ')';\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n  for (i = 0; i < n; i++)\n    printf(\"%c\", b[i]);\n\n  return 0;\n}\n\nint main() {\n  int i, j;\n  char a[100];\n  while (cin >> a) {\n    investigate(a);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid peidui(char str[], int len);\nint main() {\n  int n, i;\n  char s[1000], s1[5];\n  scanf(\"%d\", &n);\n\n  cin >> s1;\n  for (i = 1; i <= n; i++) {\n\n    cin >> s;\n    puts(s);\n    peidui(s, strlen(s));\n  }\n}\nvoid peidui(char str[], int len) {\n  int a1[500], n1, n2, m, i1, i2;\n  n1 = 0;\n  char *p;\n  char mark[1000];\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(') {\n      a1[n1] = m;\n      n1++;\n    }\n    mark[m] = ' ';\n  }\n  for (i1 = n1 - 1; i1 >= 0; i1--) {\n    int exist;\n    exist = 0;\n    for (i2 = a1[i1] + 1; i2 <= len - 1; i2++) {\n      if (str[i2] == ')' && mark[i2] != 'm') {\n        exist = 1;\n        mark[i2] = 'm';\n        mark[a1[i1]] = 'm';\n        break;\n      }\n    }\n    if (a1[i1] == len - 1) {\n      mark[len - 1] = '$';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(' && mark[m] != 'm') {\n      mark[m] = '$';\n    }\n    if (str[m] == ')' && mark[m] != 'm') {\n      mark[m] = '?';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (mark[m] == 'm')\n      printf(\"%c\", ' ');\n    else\n      printf(\"%c\", mark[m]);\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f1(char zichuan[], int changdu) {\n  int i, n;\n  for (i = changdu - 1; i >= 0; i--) {\n    if (zichuan[i] == '(') {\n      n = i + 1;\n      while (zichuan[n] != ')') {\n        n = n + 1;\n      }\n      if (n < changdu) {\n        zichuan[i] = ' ';\n        zichuan[n] = ' ';\n      }\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int i = 0, changdu;\n  char s[100];\n  while (scanf(\"%s \", s)) {\n    changdu = strlen(s);\n    printf(\"%s \", s);\n    f1(s, changdu);\n    for (i = 0; i < changdu; i++) {\n      switch (s[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        break;\n      default:\n        s[i] = ' ';\n        break;\n      }\n    }\n    for (i = 0; i < changdu; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31693", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], n = ')';\n  int i, j, k, l, m = 0;\n  while (1) {\n\n    scanf(\"%s \", a);\n    if (feof(stdin))\n      break;\n    k = 0;\n    while (1) {\n      n = ')';\n      m = 0;\n      for (i = 0; i < 200; i++) {\n        if (a[i] == '\u0000')\n          goto here;\n        l = 0;\n        for (j = 0; j < k; j++) {\n          if (i == b[j]) {\n            l = 1;\n            break;\n          }\n        }\n        if (l)\n          continue;\n        else if (a[i] != '(' && a[i] != ')')\n          continue;\n        else if (n == '(' && a[i] == ')') {\n          b[k] = m;\n          b[k + 1] = i;\n          k = k + 2;\n          break;\n        }\n        m = i;\n        n = a[i];\n      }\n    }\n  here:\n    cout << a << \" \";\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000') {\n        cout << \" \";\n        break;\n      }\n      m = 0;\n      for (j = 0; j < k; j++) {\n        if (i == b[j]) {\n          m = 1;\n          break;\n        }\n      }\n      if (m == 1)\n        printf(\" \");\n      else if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31694", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[101] = {\"0\"}, temp[101] = {\"0\"};\n  int len = 0, i = 0, j = 0, s = 0;\n  while (cin.getline(word, 101)) {\n    cout << word << endl;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      temp[i] = ' ';\n    temp[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        temp[i] = '$';\n      if (word[i] == ')')\n        temp[i] = '?';\n    }\n    for (i = 0; i < len; i++) {\n      s = 1;\n      if (word[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (word[j] == '(')\n            s++;\n          if (word[j] == ')')\n            s--;\n          if (s == 0) {\n            temp[i] = ' ';\n            temp[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", temp);\n    strcpy(temp, \"0\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31695", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, left;\n  char s[102] = {'\\0'}, t[102] = {'\\0'};\n  int num[102];\n  while (scanf(\"%s\", s) != EOF) {\n    printf(\"%s\\n\", s);\n    k = strlen(s);\n    left = 0;\n    for (i = 0; i <= k - 1; i++) {\n      switch (s[i]) {\n      case 40: {\n        left = left + 1;\n        num[left] = i;\n        t[i] = '$';\n        break;\n      }\n      case 41: {\n        if (left != 0) {\n          t[num[left]] = 32;\n          t[i] = 32;\n          left = left - 1;\n        } else {\n          t[i] = '?';\n        }\n        break;\n      }\n      default: {\n        t[i] = 32;\n        break;\n      }\n      }\n    }\n    for (i = 0; i <= k - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101];\n  int i, a[101], j = 0, k;\n  while (scanf(\"%s\", c) != EOF) {\n    puts(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\\0')\n        break;\n      else {\n        if (c[i] == '(') {\n          j++;\n          a[j] = i;\n        } else if (c[i] == ')') {\n          if (j > 0) {\n            c[i] = ' ';\n            c[a[j]] = ' ';\n            j--;\n          }\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (c[k] == '(')\n        printf(\"$\");\n      else if (c[k] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    j = 0;\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101];\nint lenth = 0;\nint main() {\n  while (scanf(\"%s \", str)) {\n    lenth = strlen(str);\n    printf(\"%s\\n\", str);\n    int i, j;\n    for (j = 0; j < lenth; j++) {\n      if (str[j] == '(')\n        str[j] = '$';\n      else if (str[j] == ')') {\n        str[j] = '?';\n      } else\n        str[j] = ' ';\n    }\n    for (i = lenth - 2; i >= 0; i--) {\n      if (str[i] == '$') {\n        for (j = i + 1; j < lenth; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar in[102];\nint lenth;\nvoid match(int n) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(' && in[i + n] == ')') {\n      in[i] = ' ';\n      in[i + n] = ' ';\n    }\n  }\n  if (n <= lenth - 2) {\n    match(n + 1);\n  }\n}\nvoid print(char in[]) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(')\n      in[i] = '$';\n    else if (in[i] == ')')\n      in[i] = '?';\n    else\n      in[i] = ' ';\n  }\n  cout << in << endl;\n}\nint main() {\n  while (scanf(\"%s \", in)) {\n    cout << in << endl;\n    lenth = strlen(in);\n    match(0);\n    print(in);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31699", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar c[101], a[101] = {' '};\nint leftpos[101] = {0}, leftnum = 0;\n\nvoid function_1(int pos) {\n  if (pos == strlen(c)) {\n    a[pos] = '\u0000';\n    cout << c << endl;\n    cout << a << endl;\n    return;\n  }\n  if (c[pos] == '(') {\n    leftpos[leftnum] = pos;\n    a[pos] = '$';\n    leftnum += 1;\n    function_1(pos + 1);\n  } else {\n    if (c[pos] == ')') {\n      if (leftnum == 0) {\n        a[pos] = '?';\n        function_1(pos + 1);\n      } else {\n        a[pos] = ' ';\n        leftnum -= 1;\n        a[leftpos[leftnum]] = ' ';\n        function_1(pos + 1);\n      }\n    } else {\n      a[pos] = ' ';\n      function_1(pos + 1);\n    }\n  }\n}\n\nint main() {\n  for (; cin.getline(c, 101);) {\n    function_1(0);\n    leftnum = 0;\n    for (int i = 0; i < 101; i++)\n      leftpos[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid match(char s[]) {\n  char b[101];\n  puts(s);\n  int l, x = 0, i, left[101];\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    b[i] = ' ';\n  b[l] = '\u0000';\n  for (i = 0; i < l; i++)\n    if (s[i] == '(')\n      left[x++] = i;\n    else if (s[i] == ')') {\n      if (x == 0)\n        b[i] = '?';\n      else\n        x--;\n    }\n  for (i = 0; i < x; i++)\n    b[left[i]] = '$';\n  puts(b);\n}\nint main() {\n  char a[101];\n  while ((scanf(\"%s \", a))) {\n    match(a);\n  }\n}\n"}
{"label": "17", "index": "31701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, l, t;\nchar b[100];\nvoid ff(int x) {\n  m = x;\n  for (int j = x + 1; j < l; j++) {\n    if (b[j] == '(') {\n      ff(j);\n      break;\n    }\n    if (b[j] == ')') {\n      b[m] = ' ';\n      b[j] = ' ';\n      t = 1;\n      break;\n    }\n  }\n  return;\n}\nvoid f(int x) {\n  m = 0;\n  t = 0;\n  for (int i = 0; i < x; i++) {\n    if (b[i] != '(' && b[i] != ')')\n      b[i] = ' ';\n    if (b[i] == '(') {\n      ff(i);\n      break;\n    }\n  }\n  if (t == 1) {\n    f(x);\n    return;\n  } else {\n    for (int i = 0; i < x; i++) {\n      if (b[i] == '(')\n        cout << \"$\";\n      else if (b[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    return;\n  }\n}\nint main() {\n  int k, h;\n  for (h = 0; h < 10; h++) {\n    l = 0;\n    cin >> b;\n    cout << b << endl;\n    l = strlen(b);\n    f(l);\n    cout << endl;\n    for (k = 0; k < 100; k++) {\n      b[k] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31702", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar x[1010] = \"\", tar[1010] = \"\";\nint len = 0, ctr;\n\nvoid F(int s) {\n  int i;\n  for (i = s + 1; i < len; i++) {\n    if (x[i] == '(' && tar[i] == '$' && ctr)\n      F(i);\n    if (x[i] == ')' && tar[i] == '?') {\n      tar[s] = tar[i] = ' ';\n      ctr--;\n      return;\n    }\n  }\n  return;\n}\n\nint main() {\n  int i;\n  while (cin >> x) {\n    ctr = 0;\n    cout << x << endl;\n    len = strlen(x);\n    for (i = 0; i < len; i++) {\n      if (x[i] == '(')\n        tar[i] = '$';\n      else if (x[i] == ')') {\n        tar[i] = '?';\n        ctr++;\n      } else\n        tar[i] = ' ';\n    }\n    tar[len] = '\\0';\n    for (i = 0; i < len - 1; i++) {\n      if (x[i] == '(' && tar[i] == '$' && ctr)\n        F(i);\n    }\n    cout << tar << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar c[120], ch;\nint n;\nint search(int p) {\n  int q = p + 1;\n  if (q >= n)\n    return q;\n  while ((c[q] != '?') && (q < n)) {\n    if (c[q] == '$')\n      q = search(q) + 1;\n    else\n      q++;\n  }\n  if (q < n) {\n    c[p] = ' ';\n    c[q] = ' ';\n  }\n  return q;\n}\nint main() {\n  int i = 0;\n  while (cin >> ch) {\n    cout << ch;\n    n = 0;\n    i = 0;\n    while (ch != '\\n') {\n      if (ch == '(')\n        c[n] = '$';\n      else {\n        if (ch == ')')\n          c[n] = '?';\n        else\n          c[n] = ' ';\n      }\n      n++;\n      cin.get(ch);\n      cout << ch;\n    }\n    while (i < n) {\n      while ((c[i] != '$') && (i < n))\n        i++;\n      i = search(i) + 1;\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31704", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][102];\n  int i, n = 0, j, k, l;\n  while (cin.getline(str[n++], 102)) {\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    cout << str[i] << endl;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        k = j + 1;\n        while (str[i][k] != '\\0') {\n          if (str[i][k] == ')') {\n            break;\n          }\n          k++;\n        }\n        if (str[i][k] == '\\0') {\n          j++;\n          continue;\n        }\n        l = k - 1;\n        while (true) {\n          if (str[i][l] == '(')\n            break;\n          l--;\n        }\n        str[i][l] = str[i][k] = 'a';\n      }\n      if (str[i][j] != '(')\n        j++;\n    }\n    j = 0;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        str[i][j] = '$';\n      } else if (str[i][j] == ')') {\n        str[i][j] = '?';\n      } else\n        str[i][j] = ' ';\n      j++;\n    }\n    printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[100] = {'\\0'};\n  int len, i, j, judge[100] = {0};\n  while (cin >> a) {\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      b[i] = ' ';\n    for (i = 99; i >= len; i--)\n      b[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (judge[j] == 0 && a[j] == '(') {\n            judge[j] = 1;\n            judge[i] = 1;\n            break;\n          }\n        }\n        if (judge[i] == 0)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (judge[i] == 0 && a[i] == '(')\n        b[i] = '$';\n    }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << '\\n';\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << '\\n';\n    for (i = 0; i < 100; i++)\n      judge[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  char *exp = (char *)malloc(sizeof(char) * 1000);\n  int *res = (int *)malloc(sizeof(int) * 1000);\n  while (cin >> exp) {\n    int cur = 0, pt = 0, len = strlen(exp);\n    for (int i = 0; i != 1000; ++i)\n      res[i] = -1;\n    for (; cur != len; ++cur) {\n      if (exp[cur] != '(' && exp[cur] != ')')\n        res[cur] = 0;\n      if (exp[cur] == ')') {\n        for (pt = cur - 1; pt >= 0; --pt) {\n          if (exp[pt] == '(' && res[pt]) {\n            res[pt] = 0;\n            res[cur] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(exp);\n    for (int i = 0; i != len; ++i) {\n      if (exp[i] == '(' && res[i] == -1)\n        res[i] = 1;\n      else if (exp[i] == ')' && res[i] == -1)\n        res[i] = 2;\n      switch (res[i]) {\n      case 0:\n        putchar(' ');\n        break;\n      case 1:\n        putchar('$');\n        break;\n      case 2:\n        putchar('?');\n        break;\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[101], t, n, i, j;\n  char a[101];\n  while (cin >> a) {\n    for (i = 0; i < 101; i++)\n      b[i] = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        t = -1;\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '(') {\n            t--;\n          }\n          if (a[j] == ')') {\n            t++;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 1;\n      }\n      if (a[i] == ')') {\n        t = -1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            t++;\n          }\n          if (a[j] == ')') {\n            t--;\n          }\n          if (t == 0)\n            break;\n        }\n        if (t < 0)\n          b[i] = 2;\n      }\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; i < n; i++) {\n      if (b[i] == 0)\n        printf(\" \");\n      if (b[i] == 1)\n        printf(\"$\");\n      if (b[i] == 2)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[200];\n  char b[200];\n  int c[200];\n  int len;\n  int k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    k = 0;\n    int j = 0;\n    for (j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n        c[k] = j;\n        k = k + 1;\n      } else if (a[j] == ')') {\n        if (j == 0) {\n          b[j] = '?';\n        } else {\n          if (k > 0 && b[c[k - 1]] == '$') {\n            b[c[k - 1]] = ' ';\n            b[j - 1] = ' ';\n            b[j] = ' ';\n            k = k - 1;\n          } else {\n            b[j] = '?';\n            c[k] = j;\n            k = k + 1;\n          }\n        }\n      } else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\\0';\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], ans[101];\n  int left[101];\n  int n = 0, i, t = 0;\n  while (cin >> c) {\n    t = 0;\n    n = strlen(c);\n    for (i = 0; i < n; i++) {\n      ans[i] = ' ';\n      if (c[i] == '(')\n        left[t++] = i;\n      if (c[i] == ')') {\n        if (t == 0)\n          ans[i] = '?';\n        else\n          t--;\n      }\n    }\n    for (i = 0; i < t; i++)\n      ans[left[i]] = '$';\n    ans[n] = '\\0';\n    cout << c << endl << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    switch (a[i]) {\n    case 1:\n      printf(\"$\");\n      break;\n    case 0:\n      printf(\" \");\n      break;\n    case -1:\n      printf(\"?\");\n      break;\n    }\n  cout << \" \";\n}\nvoid trans(char s[], int a[], int n) {\n  int i, p[200], k = -1;\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if ((s[i] != '(') && (s[i] != ')'))\n      a[i] = 0;\n    else if (s[i] == '(') {\n      k++;\n      p[k] = i;\n      a[i] = 1;\n    } else {\n      if (k > -1) {\n        a[p[k]] = 0;\n        k--;\n        a[i] = 0;\n      } else\n        a[i] = -1;\n    }\n  }\n}\nvoid input() {\n  char s[200];\n  int a[200], n;\n  while (scanf(\"%s\", s) != EOF) {\n    n = strlen(s);\n    puts(s);\n    trans(s, a, n);\n    output(a, n);\n  }\n}\nint main() { input(); }\n"}
{"label": "17", "index": "31711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, g, ans, max, temp, n, l, t;\n  char c[1000];\n  while (scanf(\"%s\", c) != EOF) {\n    printf(\"%s \", c);\n    for (k = 0; k < 100; k++) {\n      for (i = 0; c[i] != '\u0000'; i++) {\n        if (c[i] == '(') {\n          for (j = i + 1; c[j] != '\u0000'; j++) {\n            if (c[j] == '(') {\n              i = j - 1;\n              break;\n            }\n            if (c[j] == ')') {\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; c[i] != '\u0000'; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      else {\n        if (c[i] == ')') {\n          c[i] = '?';\n        } else\n          c[i] = ' ';\n      }\n    }\n    cout << c << \" \";\n  }\n}\n"}
{"label": "17", "index": "31712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst int maxn = 110;\n\nint main() {\n  char str[maxn], str2[maxn];\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      str2[i] = str[i];\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = str[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++)\n      printf(\"%c\", str2[i]);\n    printf(\"\\n\");\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char c[100];\n  int a[100] = {0};\n  while (scanf(\"%s\", c) != EOF) {\n\n    if (c[0] == '\u0000')\n      break;\n    printf(\"%s \", c);\n    k = strlen(c);\n    for (i = 0; i <= k - 1; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == -1) {\n            a[j] = 2;\n            a[i] = 2;\n            break;\n          }\n      }\n\n      else\n        a[i] = 2;\n    }\n    if (c[0] == ')')\n      a[0] = 1;\n\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == 2)\n        printf(\" \");\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, len;\n  char a[101];\n\n  while (scanf(\"%s \", a)) {\n    int b[100] = {0};\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        char *p = &a[i - 1];\n        for (j = i - 1; j >= 0; j--) {\n          if (*p == '(' && b[j] == 0) {\n            b[j] = 1;\n            b[i] = 1;\n            break;\n          }\n          p--;\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' && b[i] == 0)\n        cout << \"$\";\n      else {\n        if (a[i] == ')' && b[i] == 0)\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31715", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char array[101], ans[101];\n  int len, i, left, right;\n\n  while (cin.getline(array, 101)) {\n    len = strlen(array);\n    left = 0;\n    right = 0;\n    for (i = 0; i < len; i++) {\n      ans[i] = ' ';\n      if (array[i] == '(') {\n        left++;\n      }\n      if (array[i] == ')') {\n        right++;\n        if (right > left) {\n          left = 0;\n          right = 0;\n          ans[i] = '?';\n        }\n      }\n    }\n    left = 0;\n    right = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (array[i] == '(') {\n        left++;\n        if (left > right) {\n          left = 0;\n          right = 0;\n          ans[i] = '$';\n        }\n      }\n      if (array[i] == ')') {\n        right++;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    cout << endl;\n    for (i = 0; i < len; i++) {\n      cout << ans[i];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char s[1000];\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    k = strlen(s);\n    for (i = 0; i < k; ++i) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (s[j] == '(') {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < k; ++i) {\n      if (s[i] == '(')\n        cout << \"$\";\n      else if (s[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, len, c, zb[101], fb[101];\n  char a[101], s[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    len = strlen(a);\n    for (j = 0; j < len; j++) {\n      s[j] = a[j];\n    }\n    s[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    int o = 0, h = 0;\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        c = j;\n        zb[o] = j;\n        o++;\n      }\n      if (s[j] == ')' && o > 0) {\n        s[j] = ' ';\n        s[c] = ' ';\n        o--;\n        if (o > 0)\n          c = zb[o - 1];\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n%s\", a, s);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  typedef struct _Parenthesis {\n    char ch;\n    int idx;\n  } Parenthesis;\n  Parenthesis paren[100];\n  char str[101];\n  while (cin >> str) {\n    int i, top = 0;\n    puts(str);\n    for (i = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        paren[top].ch = '(';\n        paren[top].idx = i;\n        top++;\n      } else if (str[i] == ')') {\n        if (top == 0)\n          str[i] = '?';\n        else {\n          str[i] = ' ';\n          str[paren[--top].idx] = ' ';\n        }\n      } else\n        str[i] = ' ';\n    }\n    for (i = 0; i < top; i++)\n      str[paren[i].idx] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[200];\n  char b[200];\n  int c[200];\n  int len;\n  int k;\n  for (int i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    k = 0;\n    int j = 0;\n    for (j = 0; j < len; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n        c[k] = j;\n        k = k + 1;\n      } else if (a[j] == ')') {\n        if (j == 0) {\n          b[j] = '?';\n        } else {\n          if (k > 0 && b[c[k - 1]] == '$') {\n            b[c[k - 1]] = ' ';\n            b[j - 1] = ' ';\n            b[j] = ' ';\n            k = k - 1;\n          } else {\n            b[j] = '?';\n            c[k] = j;\n            k = k + 1;\n          }\n        }\n      } else {\n        b[j] = ' ';\n      }\n    }\n    b[j] = '\\0';\n    printf(\"%s\\n\", a);\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len;\n  while (scanf(\"%s\", a) != EOF) {\n    puts(a);\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')') {\n        a[i] = ' ';\n      } else if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == '(') {\n            break;\n          } else if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          } else if (a[j] == ')')\n            break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[120];\nint len = 0;\n\nvoid bracket(int i) {\n  if (i < 0)\n    return;\n  if (a[i] != '(')\n    bracket(i - 1);\n  if (a[i] == '(') {\n    for (int k = i; k < len; k++) {\n      if (a[k] == ')') {\n        a[i] = 'x';\n        a[k] = 'x';\n        break;\n      }\n    }\n    bracket(i - 1);\n  }\n}\n\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    len = strlen(a);\n    bracket(len - 1);\n    for (int k = 0; k < len; k++) {\n      if (a[k] == '(')\n        printf(\"$\");\n      else if (a[k] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n    for (int i = 0; i < 120; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int i, a[101], j, l;\n  while ((scanf(\"%s\", s)) != EOF) {\n    j = 0;\n    puts(s);\n    l = strlen(s);\n    for (i = 0; i < l; i++) {\n      if (s[i] == '(')\n        a[++j] = i;\n      else if (s[i] == ')') {\n        if (j) {\n          s[i] = ' ';\n          s[a[j]] = ' ';\n          j--;\n        } else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 1; i <= j; i++)\n      s[a[i]] = '$';\n    puts(s);\n  }\n}\n"}
{"label": "17", "index": "31723", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101]; \n  int pos[101];               \n\n  while (cin.getline(line, 101)) {\n    int left = 0, right = 0; \n    int len = strlen(line);\n    for (int i = 0; i < 100; i++) \n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') \n      {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left <= right) \n          label[i] = '?';  \n        else\n          left--; \n    }\n\n    if (left >= 1) \n      for (int i = 1; i <= left; i++)\n        label[pos[i]] = '$'; \n\n    label[len] = '\\0'; \n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char ch[110], temp[110], c[110];\n  int i, figure;\n  while (cin >> ch) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        c[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure) {\n          figure--;\n          temp[c[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    cout << ch << \" \" << temp << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid match(char *s, char *r, int len) {\n  char stack[100], c;\n  int top = 0;\n  int pos;\n  for (pos = 0; pos < len; ++pos)\n    r[pos] = ' ';\n  r[len] = '\\0';\n  for (pos = 0; pos < len; ++pos) {\n    c = s[pos];\n    if (c == '(')\n      stack[top++] = pos;\n    else if (c == ')')\n      if (top > 0)\n        top--;\n      else\n        r[pos] = '?';\n  }\n  while (top > 0) {\n    pos = stack[--top];\n    r[pos] = '$';\n  }\n}\nvoid outresult(char s[], char r[]) {\n  puts(s);\n  puts(r);\n}\nint main() {\n  char line[101], result[101], ch;\n  int pos = 0;\n  while ((ch = getchar()) != EOF) {\n    if (ch != '\\n')\n      line[pos++] = ch;\n    else {\n      line[pos] = '\\0';\n      match(line, result, pos);\n      outresult(line, result);\n      pos = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ghus(char a[]);\n  void noghus(char a[]);\n  int n, i, t, j;\n  char b[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b);\n    t = ghus(b);\n    printf(\"%s\\n\", b);\n    for (j = 1; j <= t; j++) {\n      noghus(b);\n    }\n    for (j = 0; j < strlen(b); j++) {\n      if (b[j] == '(')\n        printf(\"$\");\n      else if (b[j] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n\nint min(int a, int b) {\n  if (a < b) {\n    return a;\n  } else\n    return b;\n}\n\nint ghus(char a[]) {\n  int min(int a, int b);\n  int m = 0, n = 0, i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      m++;\n    if (a[i] == ')')\n      n++;\n  }\n  return min(m, n);\n}\n\nvoid noghus(char a[]) {\n  int i, j;\n  for (i = 0; i < strlen(a) - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < strlen(a); j++) {\n        if (a[j] == ')' || a[j] == '(')\n          break;\n      }\n      if (a[j] == ')') {\n        a[i] = 'o';\n        a[j] = 'o';\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "31727", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, m = 0, n = 0, k = 0;\n  char s[105];\n  while (cin.getline(s, 105, '\\n')) {\n    int zuo[100], you[100], flag[105] = {0};\n    char a[105];\n    for (i = 0; s[i] != '\\0'; i++) {\n      a[i] = ' ';\n    }\n    a[i] = '\\0';\n    m = 0;\n    n = 0;\n    for (j = 0; j < i; j++) {\n      if (s[j] == '(')\n        zuo[m++] = j;\n      if (s[j] == ')')\n        you[n++] = j;\n    }\n    for (j = 0; j < n; j++) {\n      for (k = you[j] - 1; k >= 0; k--) {\n        if (s[k] == '(' && flag[k] == 0) {\n          flag[k] = 1;\n          flag[you[j]] = 1;\n          break;\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (flag[k] == 0 && s[k] == '(')\n        a[k] = '$';\n      if (flag[k] == 0 && s[k] == ')')\n        a[k] = '?';\n    }\n    printf(\"%s\\n\", s);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  char a[100][120];\n  cin >> n;\n  getchar();\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    puts(a[i]);\n    k = strlen(a[i]);\n    for (j = 0; j < k; j++) {\n\n      if (a[i][j] == ')') {\n        a[i][j] = '?';\n      }\n      if (a[i][j] == '(') {\n        a[i][j] = '$';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] != '?' && a[i][j] != '$') {\n        a[i][j] = ' ';\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (a[i][j] == '?') {\n        for (l = j; l >= 0; l--) {\n          if (a[i][l] == '$') {\n            a[i][j] = ' ';\n            a[i][l] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      cout << a[i][j];\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31729", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int i, j, len;\n  while (cin >> a) {\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 1; i < len; i++) {\n      for (j = 0; j < len - i; j++) {\n        if (a[j] == '(' && a[j + i] == ')') {\n          a[j] = ' ';\n          a[j + i] = ' ';\n        }\n        if (a[j] != '(' && a[j] != ')') {\n          a[j] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      }\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a;\nchar str[100];\nvoid find(void);\nint main() {\n  int i;\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    a = strlen(str);\n    find();\n    for (i = 0; i < a; i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      else {\n        if (str[i] == ')')\n          cout << \"?\";\n        else\n          printf(\" \");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\nvoid find(void) {\n  int i = 0;\n  int p = -1, q = -1;\n  for (i = 0; i < a; i++) {\n    if (str[i] != '(' && str[i] != ')')\n      str[i] = '\\0';\n    if (str[i] == '(')\n      p = i;\n    if (p != -1 && str[i] == ')') {\n      q = i;\n      break;\n    }\n  }\n  if (p != -1 && q != -1) {\n    str[p] = '\\0';\n    str[q] = '\\0';\n    find();\n  }\n}\n"}
{"label": "17", "index": "31731", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char array[101], ans[101];\n  int len, i, left, right;\n\n  while (cin.getline(array, 101)) {\n    len = strlen(array);\n    left = 0;\n    right = 0;\n    for (i = 0; i < len; i++) {\n      ans[i] = ' ';\n      if (array[i] == '(') {\n        left++;\n      }\n      if (array[i] == ')') {\n        right++;\n        if (right > left) {\n          left = 0;\n          right = 0;\n          ans[i] = '?';\n        }\n      }\n    }\n    left = 0;\n    right = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (array[i] == '(') {\n        left++;\n        if (left > right) {\n          left = 0;\n          right = 0;\n          ans[i] = '$';\n        }\n      }\n      if (array[i] == ')') {\n        right++;\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << ans[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[110];\nvoid search() {\n  int i = 0, l, t = 0;\n  char str1[110];\n  int stack[110]; \n  cout << str << endl;\n  l = strlen(str);\n  memset(str1, ' ', sizeof(str1));\n  while (i < l) {\n    if (str[i] == '(') \n    {\n      t++;\n      stack[t] = i;\n    }\n    if (str[i] == ')') \n    {\n      if (t == 0)\n        str1[i] = '?';\n      else\n        t--; \n    }\n    i++;\n  }\n  for (i = 1; i <= t; i++)\n    str1[stack[i]] = '$'; \n  for (i = 0; i < l; i++)\n    cout << str1[i]; \n  cout << endl;\n}\nint main() {\n  while (cin >> str)\n    search(); \n  return 0;\n}\n"}
{"label": "17", "index": "31733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101] = {0}, label[101] = {0};\n  int pos[101] = {0}, left, right, l, i, j, n;\n  cin >> n;\n  for (j = 0; j < n; j++) {\n    scanf(\"%s \", line);\n    left = 0;\n    right = 0;\n    l = strlen(line);\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[l] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31734", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int num, i, j, k, l, len[20];\n  char a[20][101], b[50][101] = {' '};\n  scanf(\"%d\", &num);\n  for (i = 1; i <= num; i++) {\n    cin >> a[i];\n    len[i] = strlen(a[i]);\n  }\n  for (k = 1; k <= num; k++) {\n    for (i = 0; i < len[k]; i++) {\n      if (a[k][i] == '(')\n        b[k][i] = '$';\n      else if (a[k][i] == ')')\n        b[k][i] = '?';\n      else\n        b[k][i] = ' ';\n    }\n    for (i = 0; i < len[k] - 1; i++) {\n      if (b[k][i] == '$') {\n        for (j = i + 1; j < len[k]; j++) {\n          if (b[k][j] == '?') {\n            for (l = j - 1; l >= i; l--) {\n              if (b[k][l] == '$') {\n                b[k][l] = ' ';\n                b[k][j] = ' ';\n                break;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", a[k][i]);\n    printf(\" \");\n    for (i = 0; i < len[k]; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, l = 0;\n  char a[105], b[105];\n  while (scanf(\"%s \", a)) {\n    l = 0;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && l == 0) {\n        b[i] = '?';\n        continue;\n      }\n      if (a[i] == '(') {\n        b[i] = '$';\n        l++;\n      }\n      if (a[i] == ')' && l > 0) {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[j] = ' ';\n            l--;\n            break;\n          }\n        }\n        continue;\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < strlen(a); i++)\n      cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31736", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, k;\n  scanf(\"%d\", &m);\n  getchar();\n  for (k = 0; k < m; k++) {\n    int i, f, len, j;\n    char a[200], b[200], c[200];\n\n    cin >> a;\n    len = strlen(a);\n    strcpy(c, a);\n    b[len] = '\u0000';\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        f = 0;\n        for (j = i; j < len; j++) {\n          if (a[j] == ')') {\n            f = 1;\n            a[j] = 'a';\n            break;\n          }\n        }\n        if (f == 0) {\n          b[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s %s \", c, b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, u, p;\n  char c;\n  for (;;) {\n    p = 1;\n    char ch[102] = {'0'};\n    i = 2;\n    c = getchar();\n    if (c == -1)\n      break;\n    else\n      ch[1] = c;\n    while ((c = getchar()) != '\\n') {\n      ch[i] = c;\n      i++;\n    }\n    i--;\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n    while (p == 1) {\n      p = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (ch[j] == '(') {\n          for (k = j + 1; k <= i; k++) {\n            u = 1;\n            if (ch[k] == '(') {\n              break;\n            } else {\n              if (ch[k] == ')') {\n                u = 0;\n                break;\n              }\n            }\n          }\n          if (u == 0) {\n            ch[j] = 0;\n            ch[k] = 0;\n            p = 1;\n          }\n        }\n      }\n    }\n    for (j = 1; j <= i; j++) {\n      if (ch[j] == '(') {\n        ch[j] = '$';\n      } else {\n        if (ch[j] == ')') {\n          ch[j] = '?';\n        } else\n          ch[j] = ' ';\n      }\n    }\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid kuohao(char c[]) {\n  int i, j, n;\n  for (n = 0; c[n] != '\\0'; n++)\n    ; \n  for (i = n - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      for (j = i + 1; c[j] != '\\0'; j++)\n        if (c[j] == ')') {\n          c[i] = c[j] = ' ';\n          break;\n        }\n      if (c[j] == '\\0') \n      {\n        c[i] = '$';\n      }\n      kuohao(c); \n    }\n  }\n}\n\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' '; \n    kuohao(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?'; \n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char s[101], zhui = '#';\n    int count[101] = {0}; \n    int i = 0, j = 0, sl = 0, p = 0, q = 0;\n    for (i = 0; i < 101; i++) {\n      s[i] = '#';\n    } \n\n    \n    cin.getline(s, 101);\n    sl = strlen(s);\n    if (s[0] == '\\0') {\n      break;\n    } \n    \n    for (i = 0; i < sl; i++) {\n      if (s[i] == '(') {\n        count[i] = 1;\n      } else if (s[i] == ')') {\n        count[i] = 2;\n      } else {\n        continue;\n      }\n    }\n\n    \n    for (i = sl - 1; i >= 0; i--) {\n      if (count[i] == 1) {\n        for (j = i + 1; j < sl; j++) {\n          if (count[j] == 2) {\n            count[i] = 0;\n            count[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n\n    \n    int dingzuo[101] = {0};\n    int dingyou[101] = {0};\n    int flag = 0; \n    int count0 = 0;\n    for (i = 0; i < sl; i++) {\n      if (count[i] == 1) {\n        dingzuo[i] = 1;\n        flag = 1;\n        count0++;\n      } else if (count[i] == 2) {\n        dingyou[i] = 1;\n        flag = 1;\n        count0++;\n      } else {\n        continue;\n      }\n    }\n\n    \n    int k = count0;\n    for (i = 0; i < sl; i++) {\n      cout << s[i];\n    } \n    if (flag == 1) {\n      cout << endl;\n      for (i = 0; i < sl; i++) {\n        if (dingzuo[i] == 1) {\n          cout << \"$\";\n          count0--;\n        } else if (dingyou[i] == 1) {\n          cout << \"?\";\n          count0--;\n        } else {\n          if ((count0 > 0) && (count0 < k)) {\n            cout << \" \";\n          }\n        }\n      }\n      cout << endl;\n    } else {\n      cout << endl;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31740", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\\n\", &n);\n  char a[200];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    int j;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')') {\n        int s;\n        for (s = j - 1; s >= 0; s--) {\n          if (a[s] == '(') {\n            a[s] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')')\n        printf(\"?\");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][1000], s[1000];\n  int i, j, n, a[1000], temp;\n  for (i = 0; i < 100; i++) {\n    str[i][0] = '\u0000';\n  }\n  i = 0;\n  do {\n\n    cin >> str[i];\n    if (str[i][0] == '\u0000')\n      break;\n    i++;\n  } while (1);\n  n = i - 1; \n  for (i = 0; i <= n; i++) {\n    for (j = 0; j < 1000; j++)\n      s[j] = '\u0000';\n    temp = 0;\n    printf(\"%s \", str[i]);\n    for (j = 0; j < (strlen(str[i])); j++) {\n      if (str[i][j] == '(') {\n        s[j] = '$';\n        temp++;\n        a[temp] = j;\n      } else if (str[i][j] == ')') {\n        if (temp == 0)\n          s[j] = '?';\n        else {\n          s[a[temp]] = ' ';\n          temp--;\n          s[j] = ' ';\n        }\n      } else\n        s[j] = ' ';\n    }\n    printf(\"%s \", s);\n  }\n}\n"}
{"label": "17", "index": "31742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[101];\n  int i, j, lenth, n, t;\n  while (cin.getline(string, 101)) {\n    n = 0;\n    lenth = strlen(string);\n    printf(\"%s\\n\", string);\n    for (i = 0; i < lenth; i++) {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else {\n        string[i] = ' ';\n        n++;\n      }\n    }\n    n = (lenth - n) / 2;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lenth; j++) {\n        for (t = j + 1; t < lenth; t++) {\n          if (string[j] == '$' && string[t] == '$') {\n            j = t;\n            continue;\n          }\n          if (string[j] == '$' && string[t] == '?') {\n            string[j] = string[t] = ' ';\n            j = t - 1;\n          }\n        }\n      }\n    }\n    for (i = lenth - 1; i >= 0; i--) {\n      if (string[i] != ' ')\n        break;\n    }\n    string[i + 1] = '\\0';\n    lenth = strlen(string);\n    int m = 0;\n    for (i = 0; i < lenth; i++) {\n      if (string[i] != ' ')\n        break;\n      m++;\n    }\n    for (i = m; i < lenth; i++)\n      printf(\"%c\", string[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31743", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char c[10000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    cout << c << \"\\n\";\n    int j, x;\n    x = strlen(c);\n    for (j = 0; j < x; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == ')') {\n        int m;\n        for (m = j; m >= 0; m--) {\n          if (c[m] == '(') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')')\n        c[j] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31744", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[105] = {0}, b[105] = {0}, c[105] = {0};\n  int len;\n  int i = 0, j = 0;\n  while (cin >> a) {\n    \n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      c[i] = a[i];\n    for (i = 0; i < len; i++) {\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[i] = '.';\n            c[j] = '.';\n            break;\n          }\n        }\n        if (j == -1) {\n          b[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        b[i] = '$';\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (b[i] != '$' && b[i] != '?')\n        cout << ' ';\n      else\n        cout << b[i];\n    }\n    cout << endl;\n    i = 0;\n    j = 0;\n    memset(a, 0, sizeof(a));\n    memset(b, 0, sizeof(b));\n    memset(c, 0, sizeof(c));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, t = 0;\nchar A[110] = {'\\0'};\nvoid cal(int m) {\n  while (t <= a) {\n    if (A[t] == '(') {\n      cal(t++);\n    } else if (A[t] == ')') {\n      A[m] = 'a';\n      A[t++] = 'a';\n      break;\n    } else\n      t++;\n  }\n}\nint main() {\n  while (cin >> A) {\n    char B[110];\n    a = strlen(A) - 1;\n    for (int i = 0; i <= a; i++)\n      B[i] = A[i];\n    t = 0;\n    while (t <= a)\n      if (A[t++] == '(') {\n        cal(t - 1);\n      }\n    for (int i = 0; i <= a; i++)\n      cout << B[i];\n    cout << '\\n';\n    for (int i = 0; i <= a - 1; i++) {\n      if (A[i] == '(')\n        cout << '$';\n      if (A[i] == ')')\n        cout << '?';\n      if (A[i] != '(' && A[i] != ')')\n        cout << \" \";\n    }\n    if (A[a] == '(')\n      cout << '$' << endl;\n    if (A[a] == ')')\n      cout << '?' << endl;\n    if (A[a] != '(' && A[a] != ')')\n      cout << \" \" << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31746", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  int i, len, mark1[110] = {0}, judge, k = 0, j, k1 = 0;\n  while (cin.getline(a, 110)) {\n    len = strlen(a);\n    k = 0;\n    for (i = 0; i < 110; i++)\n      mark1[i] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' || a[i] == ')') {\n        if (k == 0) {\n          if (a[i] == '(')\n            mark1[k]++;\n          else\n            mark1[k]--;\n          k++;\n        } else {\n          judge = 0;\n          if (a[i] == '(')\n            mark1[k] = 1;\n          else if (a[i] == ')') {\n            mark1[k] = -1;\n            for (j = k - 1; j >= 0; j--) {\n              if (mark1[j] == 1) {\n                mark1[j] = 0;\n                mark1[k] = 0;\n                break;\n              }\n            }\n          }\n\n          k++;\n        }\n      }\n    }\n    k1 = 0;\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')') {\n        cout << ' ';\n      } else {\n        if (mark1[k1] == 0)\n          printf(\" \");\n        else if (mark1[k1] > 0)\n          cout << '$';\n        else\n          cout << '?';\n        k1++;\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint amount(char c, char a[101]) {\n  int i, amount = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == c)\n      amount = amount + 1;\n  }\n  return amount;\n}\n\nvoid match(char a[101]) {\n  int i, j;\n  int p, q;\n  p = amount('(', a);\n  q = amount(')', a);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; a[j] != '\\0'; j++) {\n        if (a[j] == '(')\n          break;\n        else if (a[j] == ')') {\n          a[i] = ' ';\n          a[j] = ' ';\n          break;\n        }\n      }\n    }\n  }\n\n  if (amount('(', a) < p || amount(')', a) < q)\n    return match(a);\n}\n\nint main() {\n  char s[101];\n  int i;\n  for (; scanf(\"%s\", s) != EOF;) {\n    cout << s << \"\\n\";\n    match(s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31748", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[1000], t[1000];\n  int len;\n  int n;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    cin >> s;\n    len = strlen(s);\n    memset(t, ' ', len);\n    t[len] = 0;\n\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(' || s[i] == '[' || s[i] == '{') {\n        t[i] = '$';\n      }\n      char match = ' ';\n      if (s[i] == ')') {\n        match = '(';\n      } else if (s[i] == ']') {\n        match = '[';\n      } else if (s[i] == '}') {\n        match = '{';\n      }\n      if (match != ' ') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (t[j] == '$') {\n            if (s[j] == match) {\n              t[j] = ' ';\n              match = ' ';\n            }\n            break;\n          }\n        }\n        if (match != ' ') {\n          t[i] = '?';\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", s, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  char *exp = (char *)malloc(sizeof(char) * 1000);\n  int *res = (int *)malloc(sizeof(int) * 1000);\n  while (scanf(\"%s \", exp)) {\n    int cur = 0, pt = 0, len = strlen(exp);\n    for (int i = 0; i != 1000; ++i)\n      res[i] = -1;\n    for (; cur != len; ++cur) {\n      if (exp[cur] != '(' && exp[cur] != ')')\n        res[cur] = 0;\n      if (exp[cur] == ')') {\n        for (pt = cur - 1; pt >= 0; --pt) {\n          if (exp[pt] == '(' && res[pt]) {\n            res[pt] = 0;\n            res[cur] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(exp);\n    for (int i = 0; i != len; ++i) {\n      if (exp[i] == '(' && res[i] == -1) {\n        res[i] = 1;\n      } else if (exp[i] == ')' && res[i] == -1)\n        res[i] = 2;\n      switch (res[i]) {\n      case 0:\n        putchar(' ');\n        break;\n      case 1:\n        putchar('$');\n        break;\n      case 2:\n        putchar('?');\n        break;\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31750", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar b[110];\nchar a[110];\nint opr(int i) {\n  int j;\n  for (j = i - 1; j >= 0; j--) {\n    if (b[j] == '$') {\n      b[j] = ' ';\n      b[i] = ' ';\n      break;\n    }\n  }\n  return 0;\n}\nvoid tag(char *a, char *b) {\n  int l = strlen(a);\n  int i;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  b[l] = '\\0';\n}\nint main() {\n  int i, l;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    printf(\"%s\\n\", a);\n    tag(a, b);\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?')\n\n        opr(i);\n    }\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len;\nvoid f(char a[]) {\n  int i, j;\n  len = strlen(a);\n  for (i = len - 1; i >= 0; i--) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < len; j++) {\n        if (a[j] == ')') {\n          a[i] = a[j] = ' ';\n          break;\n        }\n      }\n      if (a[j] == '\\0') {\n        a[i] = '$';\n      }\n      f(a);\n    }\n  }\n}\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')') {\n        c[i] = ' ';\n      }\n    f(c);\n    for (i = 0; c[i] != '\\0'; i++) {\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[102];\n  int i, j, L, k;\n  int b[102] = {0};\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < 102; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    cin >> a;\n    cout << a << \"\\n\";\n    L = strlen(a);\n    for (i = L - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < L; j++) {\n          if (a[j] == ')')\n\n          {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n        if (j == L)\n          b[i] = 1;\n      }\n    }\n\n    for (i = 0; i < L; i++) {\n      if (a[i] == ')')\n        b[i] = 2;\n    }\n    for (i = 0; i < L; i++) {\n      if (b[i] == 1)\n        printf(\"$\");\n      else if (b[i] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char c[10000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    printf(\"%s\\n\", c);\n    int j, x;\n    x = strlen(c);\n    for (j = 0; j < x; j++) {\n      if (c[j] != '(' && c[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == ')') {\n        int m;\n        for (m = j; m >= 0; m--) {\n          if (c[m] == '(') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, p, j, k, s, l;\n  char a[110], b[110] = {' '};\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    scanf(\"%s\", &a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        s += 1;\n        b[i] = ' ';\n        continue;\n      } else if (a[i] == ')') {\n        if (s > 0) {\n          s -= 1;\n          b[i] = ' ';\n          continue;\n\n        } else if (s == 0)\n          b[i] = '?';\n        continue;\n      } else\n        b[i] = ' ';\n      continue;\n    }\n    s = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        s += 1;\n        continue;\n      } else if (a[i] == '(') {\n        if (s > 0) {\n          s -= 1;\n          continue;\n\n        } else if (s == 0)\n          b[i] = '$';\n        continue;\n      }\n    }\n\n    for (j = 0; j <= l - 1; j++) {\n      cout << a[j];\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31755", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, p, i, j, len;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    char a[150];\n    cin >> a;\n    len = strlen(a);\n    char b[150];\n    for (i = 0; a[i] != 0; i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = '$';\n        break;\n      case ')':\n        b[i] = '?';\n        break;\n      default:\n        b[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint b[200];\nchar a[200];\nvoid match(int n) {\n  for (int i = n - 1; i >= 0; i--)\n    if (b[i] == 1) {\n      b[i] = 0;\n      b[n] = 0;\n      break;\n    }\n}\nint main() {\n  while (cin.getline(a, 105)) {\n    for (int i = 0; i < strlen(a); i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 0;\n      }\n    }\n    for (int i = 0; i < strlen(a); i++) {\n      if (b[i] == 2)\n        match(i);\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      switch (b[i]) {\n      case 0:\n        printf(\" \");\n        break;\n      case 1:\n        cout << '$';\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[101] = {0};\n  while (cin >> words) {\n    cout << words << endl;\n    int i = 0, j = 0;\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] != '(' && words[i] != ')')\n        words[i] = ' ';\n      if (words[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (words[j] == '(') {\n            words[j] = ' ';\n            words[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] == '(')\n        words[i] = '$';\n      if (words[i] == ')')\n        words[i] = '?';\n    }\n    printf(\"%s\\n\", words);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[110];\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    int l = strlen(s), i;\n    for (i = l - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        continue;\n      else if (s[i] == '(') {\n        int j;\n        for (j = i; j < l; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == l)\n          s[i] = '$';\n      } else\n        s[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      if (s[i] == ')')\n        s[i] = '?';\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000] = {'0'};\nchar c[1000] = {' '};\nint qq, pp;\nint t = 0;\nint x(int m) {\n  if (qq <= m - 1) {\n    if (a[qq] == '(') {\n      qq++;\n      t++;\n      x(m);\n    } else if (a[qq] == ')') {\n      qq++;\n      t--;\n      if (t == -1) {\n        c[qq - 1] = '?';\n        t = 0;\n      }\n      x(m);\n    } else if (a[qq] != '(' && a[qq] != ')') {\n      qq++;\n      x(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint y(int m) {\n  if (pp >= 0) {\n    if (a[pp] == ')') {\n      pp--;\n      t++;\n      y(m);\n    } else if (a[pp] == '(') {\n      pp--;\n      t--;\n      if (t == -1) {\n        c[pp + 1] = '$';\n        t = 0;\n      }\n      y(m);\n    } else if (a[pp] != '(' && a[pp] != ')') {\n      pp--;\n      y(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint main() {\n  char b;\n  int i = 0;\n  while (cin.get(b)) {\n    if (b != '\\n')\n      a[i++] = b;\n    else if (b == '\\n') {\n      for (int j3 = 0; j3 <= i - 1; j3++)\n        c[j3] = ' ';\n      cout << a << endl;\n      qq = 0;\n      x(i);\n      pp = i - 1;\n      y(i);\n      for (int j = 0; j <= i - 1; j++)\n        printf(\"%c\", c[j]);\n      cout << '\\n';\n      for (int j1 = 0; j1 <= i - 1; j1++) {\n        c[j1] = ' ';\n        a[j1] = '\\0';\n      }\n      i = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31760", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[100][100] = {'\\0'};\n  int m = 0;\n  int i, j, t;      \n  int a = 0, b = 0; \n  int c[100] = {0};\n\n  while (cin >> str[m]) {\n\n    for (j = 0; j < strlen(str[m]); j++) {\n      if (str[m][j] == '(') {\n        if (j == strlen(str[m]) - 1)\n          c[j] = 1;\n        else {\n          for (t = j;; t++) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == strlen(str[m]) - 1 || (a == b && a != 0))\n              break;\n          }\n\n          if (a > b) \n            c[j] = 1;\n          a = b = 0;\n        }\n      } else if (str[m][j] == ')') {\n        if (j == 0)\n          c[j] = 2;\n        else {\n          for (t = j;; t--) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == 0 || (a == b && a != 0))\n              break;\n          }\n\n          if (a < b) \n            c[j] = 2;\n          a = b = 0;\n        }\n      } else\n        continue;\n    }\n\n    cout << str[m] << endl; \n\n    for (j = 0; j <= strlen(str[m]) - 1; j++) {\n      if (c[j] == 0)\n        cout << ' '; \n      else if (c[j] == 1)\n        cout << '$'; \n      else if (c[j] == 2)\n        cout << '?'; \n    }\n    cout << endl;\n\n    a = 0;\n    b = 0;\n    for (j = 0; j < 100; j++) \n      c[j] = 0;\n\n    m++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31761", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[101];\n  int i, a[101], j = 0, k;\n  while (scanf(\"%s\", c) != EOF) {\n    puts(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\\0')\n        break;\n      else {\n        if (c[i] == '(') {\n          j++;\n          a[j] = i;\n        } else if (c[i] == ')') {\n          if (j > 0) {\n            c[i] = ' ';\n            c[a[j]] = ' ';\n            j--;\n          }\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (c[k] == '(')\n        printf(\"$\");\n      else if (c[k] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    j = 0;\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[200], b[200];\n  int c[200];\n  int i, j, k, t, m, n;\n  while (cin >> a) {\n\n    k = strlen(a);\n    m = 0;\n    n = 0;\n    for (i = 0; i < k; i++) {\n      cout << a[i];\n      if (i == k - 1)\n        cout << endl;\n      if (a[i] != '(' && a[i] != ')')\n        b[i] = ' ';\n      else if (a[i] == ')') {\n        c[m] = i;\n        m++;\n      } \n    }\n    n = m; \n    for (i = 0; i < n; i++) {\n      char *p = &a[c[i]];\n      t = 0;\n      for (j = 0; j <= c[i]; j++)\n        if (*p == '(') {\n          t = 1;\n          b[c[i] - j] = ' ';\n          b[c[i]] = ' ';\n          a[c[i] - j] = ' ';\n          break;\n        } else\n          p--;\n      if (t == 0)\n        b[c[i]] = '?';\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      cout << b[i];\n      if (i == k - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[100][100] = {'\\0'};\n  int m = 0;\n  int j, t;\n  int a = 0, b = 0;\n  int c[100] = {0};\n\n  while (cin >> str[m]) {\n\n    for (j = 0; j < strlen(str[m]); j++) {\n      if (str[m][j] == '(') {\n        if (j == strlen(str[m]) - 1)\n          c[j] = 1;\n        else {\n          for (t = j;; t++) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == strlen(str[m]) - 1 || (a == b && a != 0))\n              break;\n          }\n\n          if (a > b)\n            c[j] = 1;\n          a = b = 0;\n        }\n      } else if (str[m][j] == ')') {\n        if (j == 0)\n          c[j] = 2;\n        else {\n          for (t = j;; t--) {\n            if (str[m][t] == '(')\n              a++;\n            else if (str[m][t] == ')')\n              b++;\n            if (t == 0 || (a == b && a != 0))\n              break;\n          }\n\n          if (a < b)\n            c[j] = 2;\n          a = b = 0;\n        }\n      } else\n        continue;\n    }\n\n    cout << str[m] << endl;\n\n    for (j = 0; j <= strlen(str[m]) - 1; j++) {\n      if (c[j] == 0)\n        printf(\" \");\n      else if (c[j] == 1)\n        cout << '$';\n      else if (c[j] == 2)\n        cout << '?';\n    }\n    cout << endl;\n\n    a = 0;\n    b = 0;\n    for (j = 0; j < 100; j++)\n      c[j] = 0;\n\n    m++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, flag, len, k, x;\n  int a[100], b[100];\n  char str[101], s[101];\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < 100; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    m = 0;\n    for (i = 0; str[i] != '\u0000'; i++) {\n      if (str[i] == ')') {\n        j = i;\n        x = 1;\n        while (j >= 0) {\n          if (str[j] == '(') {\n            for (k = 0; k < m; k++) {\n              if (a[k] == j) {\n                x = 0;\n              }\n            }\n            if (x != 0) {\n\n              a[m] = j;\n              b[m] = i;\n              m++;\n              break;\n            }\n          }\n          j--;\n          x = 1;\n        }\n      }\n    }\n\n    strcpy(s, str);\n    flag = 1;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        for (j = 0; j < m; j++) {\n          if (i == a[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '$';\n      } else if (s[i] == ')') {\n        for (j = 0; j < m; j++) {\n          if (i == b[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n      flag = 1;\n    }\n    len = strlen(s);\n    for (j = len; j >= 0; j--) {\n      if ((s[j] == ' ') || (s[j] == '\u0000')) {\n        if (s[j - 1] != ' ') {\n          s[j] = '\u0000';\n          break;\n        }\n      }\n    }\n    printf(\"%s \", str);\n    j = 0;\n    while (s[j] == ' ')\n      j++;\n    for (i = j; s[i] != '\u0000'; i++)\n      printf(\"%c\", s[i]);\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500], b[500] = {0};\n  int n, i, k, j, jud[500] = {0}, max = 0;\n  for (i = 0; i < 500; i++) {\n    a[i] = 0;\n    jud[i] = 0;\n  }\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < 500; i++) {\n      b[i] = 0;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      b[i] = ' ';\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(' && jud[j] == 0) {\n            jud[j] = 1;\n            jud[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(' && jud[i] == 0) {\n        b[i] = '$';\n      }\n      if (a[i] == ')' && jud[i] == 0) {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n    for (i = 0; i < 500; i++) {\n      a[i] = 0;\n      jud[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31766", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101], res[101];\n  int n, stack[100], k;\n\n  cin >> n;\n  while (n--) {\n    cin >> str;\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      res[i] = ' ';\n    res[len] = '\\0';\n\n    k = 0;\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k != 0 && stack[k - 1] < 0)\n          k--;\n        else\n          stack[k++] = i + 1;\n      } else if (str[i] == '(')\n        stack[k++] = -(i + 1);\n    }\n    for (int i = 0; i < k; i++) {\n      int index = stack[i];\n      if (index < 0)\n        res[-index - 1] = '$';\n      else\n        res[index - 1] = '?';\n    }\n    cout << str << endl;\n    cout << res << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31767", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << endl;\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\nint cur = 0, flag = 0;\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    cout << label << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31769", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], mark[101];\n  int locate[101], left = 0, right = 0, count = -1, len, i;\n  while (cin.getline(line, 101)) {\n    count = -1;\n    left = 0;\n    right = 0;\n    len = strlen(line);\n    memset(mark, ' ', sizeof(mark));\n    memset(locate, 0, sizeof(locate));\n    for (i = 0; line[i] != '\\0'; i++) {\n\n      if (line[i] == '(') {\n        left++;\n        locate[++count] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right) {\n          mark[i] = '?';\n        } else {\n          right++;\n          count--;\n        }\n      }\n    }\n    if (count >= 0) {\n      for (i = 0; i <= count; i++)\n        mark[locate[i]] = '$';\n    }\n    mark[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", mark);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int n, char b[]) {\n  if (n > 0)\n    f(n - 1, b);\n  int i = 0, k = 0, x = 0;\n  for (k = 0; k < n; k++) {\n    if (b[k] == ')') {\n      for (x = 0; x <= k; x++) {\n        if (b[k - x] == '(') {\n          b[k] = ' ';\n          b[k - x] = ' ';\n          break;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, k = 0, x = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      b[i] = a[i];\n      if (b[i] != '(' && b[i] != ')' && b[i] != '\\n')\n        b[i] = ' ';\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    f(n, b);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31771", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m = 0, l, t;\nchar b[100];\nvoid ff(int x) {\n  m = x;\n  for (int j = x + 1; j < l; j++) {\n    if (b[j] == '(') {\n      ff(j);\n      break;\n    }\n    if (b[j] == ')') {\n      b[m] = ' ';\n      b[j] = ' ';\n      t = 1;\n      break;\n    }\n  }\n  return;\n}\nvoid f(int x) {\n  m = 0;\n  t = 0;\n  for (int i = 0; i < x; i++) {\n    if (b[i] != '(' && b[i] != ')')\n      b[i] = ' ';\n    if (b[i] == '(') {\n      ff(i);\n      break;\n    }\n  }\n  if (t == 1) {\n    f(x);\n    return;\n  } else {\n    for (int i = 0; i < x; i++) {\n      if (b[i] == '(')\n        cout << \"$\";\n      else if (b[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    return;\n  }\n}\nint main() {\n  int k, h;\n  for (h = 0; h < 10; h++) {\n    l = 0;\n    cin >> b;\n    cout << b << endl;\n    l = strlen(b);\n    f(l);\n    cout << endl;\n    for (k = 0; k < 100; k++)\n      b[k] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, len, c, zb[101], fb[101];\n  char a[101], s[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    cin >> a;\n    len = strlen(a);\n    for (j = 0; j < len; j++) {\n      s[j] = a[j];\n    }\n    s[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    int o = 0, h = 0;\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        c = j;\n        zb[o] = j;\n        o++;\n      }\n      if (s[j] == ')' && o > 0) {\n        s[j] = ' ';\n        s[c] = ' ';\n        o--;\n        if (o > 0)\n          c = zb[o - 1];\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    cout << a << \"\\n\" << s;\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], s1[100];\n  int i, len, t;\n  while (cin >> s) {\n    memset(s1, ' ', sizeof(s1));\n    len = strlen(s);\n    t = 0;\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        t++;\n      if (s[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '?';\n      }\n    }\n    t = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        t++;\n      if (s[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '$';\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << s1[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[200];\n  char str2[200];\n  int i = 0, length, sign, flag;\n  char c;\n  scanf(\"%c\", &c);\n  while (c != EOF) {\n    i = 0;\n    sign = -1;\n    while (c != '\\n') {\n      str1[i] = c;\n      if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {\n        str2[i] = ' ';\n      } else {\n        str2[i] = c;\n      }\n      i++;\n      scanf(\"%c\", &c);\n    }\n    str1[i] = '\\0';\n    str2[i] = '\\0';\n    length = strlen(str2);\n    i = 0;\n    flag = 0;\n    while (i >= 0) {\n      if (str2[i] == '(')\n        sign = i;\n      if (str2[i] == ' ') {\n        if (i == length - 1) {\n          if (flag == 1) {\n            flag = 0;\n            i = -1;\n          } else\n            break;\n        }\n        i++;\n        continue;\n      }\n      if ((str2[i] == ')') && (sign >= 0)) {\n        str2[sign] = ' ';\n        str2[i] = ' ';\n        flag = 1;\n        sign = -1;\n      }\n      if (i == length - 1) {\n        if (flag == 1) {\n          flag = 0;\n          i = -1;\n          sign = -1;\n        } else\n          break;\n      }\n      i++;\n    }\n    for (i = 0; i < length; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    cout << str1 << \"\\n\";\n    printf(\"%s\\n\", str2);\n    cin >> c;\n    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '(' ||\n        c == ')') {\n      continue;\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {'\\0'};\n  while (cin.getline(a, 110, '\\n')) {\n    int left = 0, right = 0, tema = 0;\n    int b[110] = {0};\n    char d[110] = {'\\0'};\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << a[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      d[i - 1] = ' ';\n      if (a[i - 1] == '(') {\n        left++;\n        b[tema++] = i - 1;\n      } else if (a[i - 1] == ')') {\n        if (left <= right) {\n          d[i - 1] = '?';\n        }\n        if (left > right) {\n          right++;\n          tema--;\n        }\n      }\n    }\n    for (int k = 1; k <= tema; k++) {\n      d[b[k - 1]] = '$';\n    }\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << d[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; i <= 100; i++) {\n      a[i - 1] == '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char input[101] = {0}, initial[101];\n  int found = 0;\n  while (cin.getline(input, 101)) {\n    strcpy(initial, input);\n    do {\n      found = 0;\n      int i = 0, location = -1;\n      while (input[i]) {\n        if (input[i] == '(') {\n          location = i;\n          found = 1;\n        }\n        if (input[i] == ')') {\n          found = 1;\n          if (location == -1)\n            input[i] = '?';\n          else {\n            input[location] = ' ';\n            input[i] = ' ';\n            location = -1;\n            break;\n          }\n        }\n        if (input[i] != '?' && input[i] != '$' && input[i] != '(' &&\n            input[i] != ')')\n          input[i] = ' ';\n        i++;\n      }\n      if (location != -1) {\n        input[location] = '$';\n        location = -1;\n      }\n    } while (found);\n    printf(\"%s\\n%s\\n\", initial, input);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101], rsen[101];\n  while (cin >> sen) {\n    int pos[101], num = 0, i, t = 0;\n    cout << sen << endl;\n    for (i = 0; i <= strlen(sen) - 1; i++) {\n      if (sen[i] == '(') {\n        num++;\n        pos[num] = i;\n        rsen[i] = '$';\n      } else if (sen[i] == ')') {\n        if (num > 0) {\n          rsen[pos[num]] = ' ';\n          rsen[i] = ' ';\n          num--;\n        } else {\n          rsen[i] = '?';\n        }\n      } else {\n        rsen[i] = ' ';\n      }\n    }\n    if (num != 0) {\n      for (i = 1; i <= num; i++) {\n        rsen[pos[num]] = '$';\n      }\n    }\n    for (i = 0; i <= strlen(sen) - 2; i++) {\n      cout << rsen[i];\n    }\n    cout << rsen[strlen(sen) - 1] << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "31778", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar x[1010] = \"\", tar[1010] = \"\";\nint len = 0, ctr;\n\nvoid F(int s) {\n  int i;\n  for (i = s + 1; i < len; i++) {\n    if (x[i] == '(' && tar[i] == '$' && ctr)\n      F(i);\n    if (x[i] == ')' && tar[i] == '?') {\n      tar[s] = tar[i] = ' ';\n      ctr--;\n      return;\n    }\n  }\n  return;\n}\n\nint main() {\n  int i;\n  while (scanf(\"%s \", x)) {\n    ctr = 0;\n    cout << x << endl;\n    len = strlen(x);\n    for (i = 0; i < len; i++) {\n      if (x[i] == '(')\n        tar[i] = '$';\n      else if (x[i] == ')') {\n        tar[i] = '?';\n        ctr++;\n      } else {\n        tar[i] = ' ';\n      }\n    }\n    tar[len] = '\\0';\n    for (i = 0; i < len - 1; i++) {\n      if (x[i] == '(' && tar[i] == '$' && ctr)\n        F(i);\n    }\n    cout << tar << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31779", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int n, i, j, k, m;\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 0; i < n; i++) {\n    char a[200] = {0};\n    char b[200] = {0};\n\n    cin >> a;\n    k = strlen(a);\n    for (j = 0; j < k; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    \n\n    for (j = 1; j < k; j++) {\n      if (b[j] == '?') {\n        for (m = j - 1; m >= 0; m--)\n          if (b[m] == '$') {\n            b[m] = ' ';\n            b[j] = ' ';\n            break;\n          }\n      }\n    }\n    printf(\"%s %s \", a, b);\n  }\n}\n"}
{"label": "17", "index": "31780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[100];\nint b;\nvoid nihao() {\n\n  for (int i = 0; i < b; i++) {\n    int r = 0;\n    if (a[i] == ')') {\n      for (int j = i - 1; j >= 0; j--) {\n        if (a[j] == '(') {\n          for (int k = j; k <= i; k++)\n            a[k] = ' ';\n          r = 1;\n          break;\n        }\n      }\n      if (r == 0) {\n        a[i] = '?';\n        for (int k = i - 1; k >= 0; k--)\n          if (a[k] != '?')\n            a[k] = ' ';\n      }\n    }\n  }\n}\nvoid nimei() {\n  for (int i = b - 1; i >= 0; i--)\n    if (a[i] == '(') {\n      a[i] = '$';\n    }\n}\nvoid nima() {\n  for (int i = 0; i < b; i++) {\n    if (a[i] != '?' && a[i] != '$')\n      a[i] = ' ';\n  }\n  for (int i = 0; i < b; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  while (cin >> a) {\n    cout << a;\n    cout << endl;\n    b = strlen(a);\n    nihao();\n    nimei();\n    nima();\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zhengli(char a[]) {\n  void panduan(char a[]);\n  int i, k, j;\n  k = strlen(a);\n  for (j = 0; j < 50; j++) {\n    for (i = 0; i < k; i++) {\n      if (a[i] == '$')\n        a[i] = '(';\n      else if (a[i] == '?')\n        a[i] = ')';\n    }\n    panduan(a);\n  }\n}\nvoid panduan(char a[]) {\n  int i, k, flag = 0, j;\n  char b[110];\n  k = strlen(a);\n  b[k] = '\\0';\n  for (i = 0; i < k; i++) {\n    if (a[i] != '(' && a[i] != ')')\n      b[i] = ' ';\n    else if (a[i] == '(') {\n      if (flag == 1) {\n        b[j] = '$';\n        j = i;\n        b[j] = '$';\n      } else {\n        flag = 1;\n        j = i;\n        b[j] = '$';\n      }\n    } else {\n      if (flag == 1) {\n        b[j] = ' ';\n        flag = 0;\n        b[i] = ' ';\n      } else\n        b[i] = '?';\n    }\n  }\n  strcpy(a, b);\n}\nint main() {\n  int i, k;\n  char a[110];\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    panduan(a);\n    zhengli(a);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, k, p, d, x;\n  char a[101];\n  char b[101];\n  while (cin >> a) {\n    puts(a);\n    for (j = 0; a[j] != '\u0000'; j++) {\n\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else\n        b[j] = ' ';\n    }\n    b[j] = '\u0000';\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (b[k] == '?') {\n        d = 0;\n        for (p = k - 1; p >= 0; p--) {\n          if (b[p] == '$') {\n            x = p;\n            d = 1;\n            break;\n          }\n        }\n        if (d == 1) {\n          b[k] = ' ';\n          b[x] = ' ';\n        }\n      }\n    }\n    for (k = j; k >= 0; k--) {\n      if (b[k] != ' ' && b[k] != '\u0000')\n        break;\n    }\n    for (p = 0; p < j; p++) {\n      if (b[p] != ' ')\n        break;\n    }\n    for (x = p; x <= k; x++)\n      printf(\"%c\", b[x]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31783", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    m = strlen(a);\n    for (i = 0; i < m; i++) {\n      if ((a[i] != '(') && (a[i] != ')')) {\n        a[i] = ' ';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == ')') {\n        for (k = i; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1)\n          a[i] = '?';\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31784", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[100], b[100];\n  int left[100], k = 0, len, i;\n  while (scanf(\"%s\", &a) != EOF) {\n    len = strlen(a);\n    puts(a);\n    for (i = 0; i < len; i++) {\n      b[i] = 32;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        k++;\n        left[k] = i;\n      }\n    }\n    for (; k > 0; k--) {\n      for (i = left[k]; i < len; i++) {\n        if (a[i] == ')') {\n          a[i] = ' ';\n          a[left[k]] = ' ';\n          break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[150] = {'0'}, b[150] = {'0'};\n  for (; ~scanf(\"%s\", &a);) {\n    i = strlen(a);\n    for (j = 0; j < i; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    for (j = 0; j < i; j++)\n      for (k = j - 1; k >= 0; k--) {\n        if (b[k] == '$' && b[j] == '?') {\n          b[k] = ' ';\n          b[j] = ' ';\n        }\n      }\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n    cout << \"\\n\";\n    for (k = 0; k < i; k++)\n      printf(\"%c\", b[k]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int n, i, j;\n  while (1) {\n    if (scanf(\"%s\", s) == EOF)\n      return 0;\n    puts(s);\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else {\n        if (s[i] == ')')\n          s[i] = '?';\n        else {\n          s[i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    while (s[n - 1] == ' ') {\n      s[n - 1] = '\\0';\n      n--;\n    }\n    while (s[0] == ' ') {\n      for (i = 0; i < n; i++) {\n        s[i] = s[i + 1];\n      }\n    }\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31787", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[200];\n  int leftpos, mark;\n  while (scanf(\"%s\", string) == 1) {\n    printf(\"%s\\n\", string);\n    leftpos = -1;\n    mark = 0;\n    while (mark != strlen(string)) {\n      if (string[mark] == '(')\n        leftpos = mark;\n      else if (string[mark] == ')' && leftpos != -1) {\n        string[mark] = ' ';\n        string[leftpos] = ' ';\n        mark = -1;\n        leftpos = -1;\n      }\n      mark++;\n    }\n    for (mark = 0; mark < strlen(string); mark++) {\n      if (string[mark] == '(')\n        string[mark] = '$';\n      else if (string[mark] == ')')\n        string[mark] = '?';\n      else\n        string[mark] = ' ';\n    }\n    cout << string << \"\\n\";\n    memset(string, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0};\n  int i = 0, j = 0;\n  do {\n    cin.get(a, 101);\n    cin.get();\n    if (a[0] == '\\0')\n      break;\n    int len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = 0; i < len; i++)\n      if (b[i] == '?')\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "17", "index": "31789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[105] = {0};\n  while (scanf(\"%s \", c)) {\n\n    int a[105] = {0};\n\n    int n, i, j;\n    n = strlen(c);\n    for (i = 0; i < n; i++)\n      a[i] = 1;\n    for (i = n - 1; i >= 0; i--) {\n      if (c[i] == '(')\n\n      {\n\n        for (j = i; j < n; j++) {\n          if ((c[j] == ')') && (a[j] != 0)) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n\n    for (i = 0; i < n; i++) {\n      if ((c[i] == '(') && (a[i] == 1))\n\n        cout << \"$\";\n      if ((c[i] == ')') && (a[i] == 1))\n        cout << \"?\";\n      if ((c[i] != '(') && (c[i] != ')') && (c[i] != '\\0'))\n        cout << \" \";\n      if ((c[i] == '(') && (a[i] == 0))\n        cout << \" \";\n      if ((c[i] == ')') && (a[i] == 0))\n        cout << \" \";\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31790", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n;\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    scanf(\"%s \", a);\n    printf(\"%s\\n\", a);\n    i = 0;\n    while (a[i] != '\\0') {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')') {\n        int k;\n        for (k = i - 1; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[i] = b[k] = ' ';\n            break;\n          }\n        }\n        if (k == -1) {\n          b[i] = '?';\n        }\n      } else {\n        b[i] = ' ';\n      }\n      i++;\n    }\n\n    printf(\"%s\", b);\n    printf(\"\\n\");\n    memset(b, 0, 500);\n    memset(a, 0, 500);\n    fflush(stdin);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  int flag[101];\n  int i, j, len, count, sign;\n  while (1) {\n    sign = 0;\n    i = -1;\n    do {\n      i++;\n      if (cin.get(a[i]))\n        sign = 1;\n    } while (a[i] != '\\n');\n    if (sign == 0)\n      break;\n    a[i] = 0;\n    len = i;\n    memset(b, ' ', sizeof(b));\n    b[i] = 0;\n    memset(flag, 0, sizeof(flag));\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        j = i + 1;\n        count = 0;\n        while (j < len) {\n          if (a[j] == '(')\n            count++;\n          else if (a[j] == ')') {\n            if (count == 0) {\n              flag[i] = 1;\n              flag[j] = 1;\n              break;\n            } else\n              count--;\n          }\n          j++;\n        }\n        if (flag[i] == 0)\n          b[i] = '$';\n      } else if ((a[i] == ')') && (flag[i] == 0))\n        b[i] = '?';\n    }\n    cout << a << endl;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint function_1(char *out, int t) {\n  int i = t;\n  if (out[i] == '(') {\n    out[i] = '$';\n    i++;\n    while (out[i] != ')' && out[i]) {\n      if (out[i] == '(') {\n        i = function_1(out, i) + 1;\n        if (i == -1)\n          return -2;\n      } else {\n        out[i] = ' ';\n        i++;\n      }\n    }\n    if (out[i] == ')') {\n      out[t] = out[i] = ' ';\n      return i;\n    } else\n      return -2;\n  } else {\n    while (out[i] != '(' && out[i]) {\n      if (out[i] == ')')\n        out[i] = '?';\n      else\n        out[i] = ' ';\n      i++;\n    }\n    if (out[i] == '(')\n      return function_1(out, i);\n    else\n      return -2;\n  }\n}\n\nint main() {\n  char out[101];\n  int n = -1;\n  cin.getline(out, 101);\n  while (out[0]) {\n    n = -1;\n    cout << out << endl;\n    while (n != -2) {\n      n = function_1(out, n + 1);\n    }\n    printf(\"%s\\n\", out);\n    cin.getline(out, 101);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint d[120] = {0}, l = 0;\nint search(int p) {\n  int i = p + 1, j = 0;\n  while (1) {\n    if (d[i] == -1) {\n      j = search(i);\n      i = j + 1;\n    } else {\n      if (d[i] == 1) {\n        d[p] = 0;\n        d[i] = 0;\n        return i;\n      } else\n        i++;\n    }\n    if (i >= l)\n      return i;\n  }\n}\nint main() {\n  char ch;\n  int i, j;\n  while (cin.get(ch)) {\n\n    if (ch == '\\n') {\n      cout << endl;\n      i = 0;\n      while (i < l) {\n        while (i < l && d[i] > -1)\n          i++;\n\n        if (i >= l)\n          break;\n        j = search(i);\n        i = j + 1;\n      }\n      for (i = 0; i < l; i++) {\n        if (d[i] == -1)\n          cout << '$';\n        else if (d[i] == 1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n      cout << endl;\n      l = 0;\n      for (i = 0; i < 100; i++)\n        d[i] = 0;\n    } else {\n      cout << ch;\n      if (ch == '(')\n        d[l] = -1;\n      if (ch == ')')\n        d[l] = 1;\n      l++;\n    }\n    ch = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int i, l, j, k, n, left[101];\n  char str[101], str2[101];\n  while (cin >> str) {\n    strcpy(str2, str);\n    for (i = 0, l = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n    }\n    for (n = l - 1; n >= 0; n--) {\n      for (k = left[n] + 1; str[k]; k++) {\n        if (str2[k] == ')') {\n          str2[left[n]] = ' ';\n          str2[k] = ' ';\n          break;\n        }\n      }\n    }\n    for (j = 0; str[j]; j++) {\n      if (str2[j] == '(')\n        str2[j] = '$';\n      else if (str2[j] == ')')\n        str2[j] = '?';\n      else\n        str2[j] = ' ';\n    }\n    printf(\"%s \", str);\n    printf(\"%s \", str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31795", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101];\n  int i, j, k;\n  int l, r;\n  int len;\n  while (scanf(\"%s \", a)) {\n    l = 0;\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (a[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n    for (i = 0; i < len; i++)\n      b[i] = ' ';\n\n    b[len] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        l++;\n      if (a[i] == ')')\n        l--;\n      if (l < 0) {\n        b[i] = '?';\n        l = 0;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[len - i - 1] == ')')\n        r++;\n      if (a[len - i - 1] == '(')\n        r--;\n      if (r < 0) {\n        b[len - i - 1] = '$';\n        r = 0;\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main()\n\n{\n\n  int i, n;\n\n  char a[500] = {0}, b[500] = {0};\n  scanf(\"%d\", &n);\n  while (n--) {\n    while (scanf(\"%s\", a) != EOF) {\n\n      printf(\"%s\", a);\n      printf(\"\\n\");\n\n      i = 0;\n\n      while (a[i] != '\\0') {\n\n        if (a[i] == '(') {\n\n          b[i] = '$';\n\n        } else if (a[i] == ')') {\n\n          int k;\n\n          for (k = i - 1; k >= 0; k--) {\n\n            if (b[k] == '$') {\n\n              b[i] = b[k] = ' ';\n\n              break;\n            }\n          }\n\n          if (k == -1)\n\n          {\n            b[i] = '?';\n          }\n\n        } else {\n\n          b[i] = ' ';\n        }\n\n        i++;\n      }\n\n      printf(\"%s\", b);\n\n      cout << \"\\n\";\n\n      memset(b, 0, 500);\n\n      memset(a, 0, 500);\n\n      fflush(stdin);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31797", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n    a[0] = ' ';\n\n    cin >> a;\n    if (a[0] != ' ') {\n      t = strlen(a);\n      show(a, t);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char a[200];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    cout << a << \"\\n\";\n    int j;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')') {\n        int s;\n        for (s = j - 1; s >= 0; s--) {\n          if (a[s] == '(') {\n            a[s] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == ')')\n        printf(\"?\");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31799", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint lenth, b[200];\nchar a[200];\nvoid match(int n) {\n  for (int i = n - 1; i >= 0; i--)\n    if (b[i] == 1) {\n      b[i] = 0;\n      b[n] = 0;\n      break;\n    }\n}\nint main() {\n  while (cin.getline(a, 105)) {\n    for (int i = 0; i < strlen(a); i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 0;\n      }\n    }\n    for (int i = 0; i < strlen(a); i++) {\n      if (b[i] == 2)\n        match(i);\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      switch (b[i]) {\n      case 0:\n        cout << ' ';\n        break;\n      case 1:\n        cout << '$';\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{\n  char a[110] = {'\\0'};\n  while (cin.getline(a, 110, '\\n')) \n  {\n    int left = 0, right = 0, tema = 0;\n    int b[110] = {0};\n    char d[110] = {'\\0'};\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      cout << a[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; a[i - 1] != '\\0'; i++) {\n      d[i - 1] = ' ';\n      if (a[i - 1] == '(') \n      {\n        left++;\n        b[tema++] = i - 1;\n      } else if (a[i - 1] == ')') \n      {\n        if (left <= right) \n        {\n          d[i - 1] = '?';\n        }\n        if (left > right) \n        {\n          right++;\n          tema--;\n        } \n      }\n    }\n    for (int k = 1; k <= tema; k++) \n    {\n      d[b[k - 1]] = '$';\n    }\n    for (int i = 1; a[i - 1] != '\\0'; i++) \n    {\n      cout << d[i - 1];\n    }\n    cout << endl;\n    for (int i = 1; i <= 100; i++) {\n      a[i - 1] == '\\0';\n    }\n  } \n  return 0;\n}\n"}
{"label": "17", "index": "31801", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int i, j, len;\n  while (cin >> a) {\n    printf(\"%s\\n\", a);\n    len = strlen(a);\n    for (i = 1; i < len; i++) {\n      for (j = 0; j < len - i; j++) {\n        if (a[j] == '(' && a[j + i] == ')') {\n          a[j] = ' ';\n          a[j + i] = ' ';\n        }\n        if (a[j] != '(' && a[j] != ')') {\n          a[j] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      }\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint match(char *a) {\n  int i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] == ')') {\n      a[i] = ' ';\n      a[0] = ' ';\n      return i;\n    } else if (a[i] == '(') {\n      a[i] = '$';\n      i += match(a + i);\n    } else\n      a[i] = ' ';\n    i++;\n  }\n  return i - 1;\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    cout << ch << endl;\n    int i = 0;\n    while (ch[i] != '\\0') {\n      if (ch[i] == '(') {\n        ch[i] = '$';\n        i += match(ch + i);\n      } else if (ch[i] == ')')\n        ch[i] = '?';\n      else\n        ch[i] = ' ';\n      i++;\n    }\n    cout << ch << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][105] = {'\\0'}, a;\n  int i, j, k, count, cleft, cright;\n  i = j = 0;\n  while ((a = cin.get()) != EOF) \n  {\n    if (a != '\\n') {\n      s[i][j] = a;\n      j++;\n    } else if (a == '\\n') {\n      i++;\n      j = 0;\n    }\n  }\n  count = i;          \n  cleft = cright = 0; \n  for (i = 0; i < count; i++) {\n    cout << s[i] << endl;\n    for (j = 0; j < strlen(s[i]); j++) \n    {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright > cleft) {\n        s[i][j] = '?';\n        cright -= 1; \n      }\n    }\n    cleft = cright = 0; \n    for (j = strlen(s[i]) - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        cleft += 1;\n      else if (s[i][j] == ')')\n        cright += 1;\n      if (cright < cleft) {\n        s[i][j] = '$';\n        cleft -= 1; \n      }\n    }\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] != '?' && s[i][j] != '$')\n        s[i][j] = ' ';\n    if (i == count - 1)\n      cout << s[i];\n    else\n      cout << s[i] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31804", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], mark[101];\n  int locate[101], left = 0, right = 0, count = -1, len, i;\n  while (cin.getline(line, 101)) {\n    count = -1;\n    left = 0;\n    right = 0;\n    len = strlen(line);\n    memset(mark, ' ', sizeof(mark));\n    memset(locate, 0, sizeof(locate));\n    for (i = 0; line[i] != '\\0'; i++) {\n\n      if (line[i] == '(') {\n        left++;\n        locate[++count] = i;\n      }\n      if (line[i] == ')') {\n        if (left <= right) {\n          mark[i] = '?';\n        } else {\n          right++;\n          count--;\n        }\n      }\n    }\n    if (count >= 0) {\n      for (i = 0; i <= count; i++) {\n        mark[locate[i]] = '$';\n      }\n    }\n    mark[len] = '\\0';\n    cout << line << endl;\n    cout << mark << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n\n    len = strlen(line);\n\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(')\n\n      {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n\n    i = len - 1;\n\n    label[i + 1] = '\\0';\n\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  int flag[101];\n  int i, j, len, count, sign;\n\n  while (1) {\n    sign = 0;\n    i = -1;\n    do {\n      i++;\n      if (cin.get(a[i]))\n        sign = 1;\n    } while (a[i] != '\\n');\n    if (sign == 0)\n      break;\n    a[i] = 0;\n    len = i; \n    memset(b, ' ', sizeof(b));\n    b[i] = 0;\n    memset(flag, 0, sizeof(flag)); \n\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') \n      {\n        j = i + 1;\n        count = 0;\n        while (j < len) {\n          if (a[j] == '(')\n            count++;\n          else if (a[j] == ')') {\n            if (count == 0) {\n              flag[i] = 1;\n              flag[j] = 1;\n              break;\n            } \n            else\n              count--;\n          }\n          j++;\n        }\n        if (flag[i] == 0)\n          b[i] = '$';\n      } else if ((a[i] == ')') && (flag[i] == 0))\n        b[i] = '?'; \n    }\n    cout << a << endl;\n    cout << b << endl;\n  }\n}\n"}
{"label": "17", "index": "31807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  char a[200];\n  while (cin.get(a, 200)) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')') {\n        a[i] = '?';\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    cin.get();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, flag, len, k, x;\n  int a[100], b[100];\n  char str[101], s[101];\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < 100; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    m = 0;\n    for (i = 0; str[i] != '\u0000'; i++) {\n      if (str[i] == ')') {\n        j = i;\n        x = 1;\n        while (j >= 0) {\n          if (str[j] == '(') {\n            for (k = 0; k < m; k++) {\n              if (a[k] == j)\n                x = 0;\n            }\n            if (x != 0) {\n\n              a[m] = j;\n              b[m] = i;\n              m++;\n              break;\n            }\n          }\n          j--;\n          x = 1;\n        }\n      }\n    }\n\n    strcpy(s, str);\n    flag = 1;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        for (j = 0; j < m; j++) {\n          if (i == a[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '$';\n      } else if (s[i] == ')') {\n        for (j = 0; j < m; j++) {\n          if (i == b[j]) {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 0)\n          s[i] = ' ';\n        else\n          s[i] = '?';\n      } else\n        s[i] = ' ';\n      flag = 1;\n    }\n    len = strlen(s);\n    for (j = len; j >= 0; j--) {\n      if ((s[j] == ' ') || (s[j] == '\u0000')) {\n        if (s[j - 1] != ' ') {\n          s[j] = '\u0000';\n          break;\n        }\n      }\n    }\n    printf(\"%s \", str);\n    j = 0;\n    while (s[j] == ' ')\n      j++;\n    for (i = j; s[i] != '\u0000'; i++) {\n      cout << s[i];\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, i, l, j, n = 1, t, h, m;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        a[j] = '$';\n      } else if (a[j] == ')') {\n        for (k = j; k >= -1; k--) {\n          if (k == -1) {\n            a[j] = '?';\n            break;\n          }\n          if (a[k] == '$') {\n            a[k] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n\n      } else\n        a[j] = ' ';\n    }\n\n    for (j = 0; j < l; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char a[101];\n  while (cin >> a) {\n    n = strlen(a);\n    for (i = 0; i <= n - 2; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%c \", a[n - 1]);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z' ||\n          a[i] == ' ') {\n        a[i] = ' ';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else if (a[i] == '(') {\n        a[i] = '$';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, t1, t2, flag, len;\n  int b[101], l[101], r[101];\n  char s[101];\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        b[i] = 1;\n      } else {\n        b[i] = 0;\n      }\n    }\n    t1 = 0;\n    t2 = 0;\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        l[t1] = i;\n        t1++;\n      }\n      if (b[i] == 1) {\n        r[t2] = i;\n        t2++;\n      }\n    }\n    for (i = t1 - 1; i >= 0; i--) {\n      for (j = 0; j < t2; j++) {\n        if (r[j] > l[i]) {\n          b[r[j]] = 0;\n          b[l[i]] = 0;\n          r[j] = 0;\n          l[i] = 0;\n          break;\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        cout << \"$\";\n      } else if (b[i] == 1) {\n        printf(\"?\");\n      } else {\n        cout << \" \";\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, len, j, m = 0, max;\n  char ch[105], s[105], str[105];\n  while (scanf(\"%s\", ch) != EOF) {\n    int m = 0;\n    strcpy(s, ch);\n    strcpy(str, ch);\n    len = strlen(ch);\n\n    for (i = 0; i < len; i++) {\n      if (ch[i] != '(' && ch[i] != ')') {\n        s[i] = ' ';\n      } else {\n        if (ch[i] == ')') {\n          for (j = i - 1; j >= 0; j--) {\n            if (ch[j] == '(') {\n              m = 1;\n              ch[i] = ' ';\n              s[i] = ' ';\n              s[j] = ' ';\n              ch[j] = ' ';\n              break;\n            } else\n              continue;\n          }\n          if (m == 0) {\n            s[i] = '?';\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n      }\n    }\n    printf(\"%s\\n\", str);\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31813", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char z[101];\n  int i, j, l[101], r[101];\n  while (scanf(\"%s\", z) != EOF) {\n    for (i = 0; i < 101; i++) {\n      l[i] = 0;\n      r[i] = 0;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (z[i] == '(')\n        l[i] = 1;\n      if (z[i] == ')')\n        r[i] = 1;\n    }\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] == 1) {\n        for (j = i + 1; j < strlen(z); j++) {\n          if (l[j] == 1)\n            l[i]++;\n          if (r[j] == 1)\n            l[i]--;\n          if (l[i] == 0) {\n            r[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", z);\n    for (i = 0; i < strlen(z); i++) {\n      if (l[i] != 0)\n        printf(\"$\");\n      else if (r[i] != 0)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, t1, t2, flag, len;\n  int b[101], l[101], r[101];\n  char s[101];\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        b[i] = -1;\n      } else {\n        if (s[i] == ')') {\n          b[i] = 1;\n        } else {\n          b[i] = 0;\n        }\n      }\n    }\n    t1 = 0;\n    t2 = 0;\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        l[t1] = i;\n        t1++;\n      }\n      if (b[i] == 1) {\n        r[t2] = i;\n        t2++;\n      }\n    }\n    for (i = t1 - 1; i >= 0; i--) {\n      for (j = 0; j < t2; j++) {\n        if (r[j] > l[i]) {\n          b[r[j]] = 0;\n          b[l[i]] = 0;\n          r[j] = 0;\n          l[i] = 0;\n          break;\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        printf(\"$\");\n      } else {\n        if (b[i] == 1) {\n          printf(\"?\");\n        } else {\n          printf(\" \");\n        }\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31815", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[205];\n  while (cin.getline(a, 200)) {\n    char b[205];\n    int x[205] = {-1}, y[205] = {-1}, i, n, p, q;\n    p = 0;\n    q = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        p++;\n        x[p] = i;\n      }\n      if (a[i] == ')') {\n        q++;\n        y[q] = i;\n        if ((p != 0) && (x[p] < y[q])) {\n          x[p] = -1;\n          y[q] = -1;\n          p--;\n          q--;\n        }\n      }\n    }\n    for (i = 1; i <= p; i++)\n      b[x[i]] = '$';\n    for (i = 1; i <= q; i++)\n      b[y[i]] = '?';\n\n    cout << a << endl;\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, n1, n2;\n  int k[100];\n  char a[100][100], b[100];\n  i = 0;\n  while (cin >> a[i]) {\n    k[i] = strlen(a[i]);\n    if (k[i] == 0)\n      break;\n    i++;\n  }\n  t = i;\n  for (i = 0; i < t; i++) {\n    n1 = 0;\n    n2 = 0;\n    for (j = 0; j < k[i]; j++) {\n      b[j] = ' ';\n    }\n    for (j = 0; j < k[i]; j++) {\n      if (n1 < 0)\n        n1 = 0;\n      if (a[i][j] == '(') {\n        n1++;\n      }\n      if (a[i][j] == ')') {\n        if (n1 == 0) {\n          b[j] = '?';\n        }\n        n1--;\n      }\n    }\n    for (j = k[i] - 1; j >= 0; j--) {\n      if (n2 < 0)\n        n2 = 0;\n      if (a[i][j] == ')') {\n        n2++;\n      }\n      if (a[i][j] == '(') {\n        if (n2 == 0) {\n          b[j] = '$';\n        }\n        n2--;\n      }\n    }\n    for (j = 0; j < k[i]; j++) {\n      cout << a[i][j];\n    }\n    cout << endl;\n    for (j = 0; j < k[i]; j++) {\n      cout << b[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, num = 1, j;\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      num = 1;\n      if (a[i] != ')' && a[i] != '(')\n        cout << \" \";\n      if (a[i] == '(') {\n        if (a[i + 1] == '\\0') {\n          cout << \"$\";\n          continue;\n        }\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == '(')\n            num++;\n          if (a[j] == ')')\n            num--;\n          if (num == 0) {\n            printf(\" \");\n            break;\n          }\n          if (a[j + 1] == '\\0' && num != 0)\n            cout << \"$\";\n        }\n      }\n      num = 1;\n      if (a[i] == ')') {\n        if (i == 0) {\n          cout << \"?\";\n          continue;\n        }\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == ')')\n            num++;\n          if (a[j] == '(')\n            num--;\n          if (num == 0) {\n            cout << \" \";\n            break;\n          }\n          if (j == 0 && num != 0)\n            cout << \"?\";\n        }\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint judge(int, int);\nint main() {\n  for (; cin >> a;) {\n    cout << a << endl;\n    judge(0, 0);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\nint judge(int i, int l) {\n  int t;\n  if (a[i] == '\\0')\n    return -1;\n  if (a[i] == '(') {\n    t = judge(i + 1, l + 1);\n    a[i] = (t == -1) ? '$' : ' ';\n    return (t == -1) ? -1 : judge(i + 1, l);\n  }\n\n  else if (a[i] == ')') {\n    a[i] = l == 0 ? '?' : ' ';\n    return (l == 0) ? judge(i + 1, l) : i;\n  } else {\n    a[i] = ' ';\n    return judge(i + 1, l);\n  }\n}\n"}
{"label": "17", "index": "31819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[101]; \n  int i, j, lenth, n, t;\n  while (cin.getline(string, 101)) { \n    n = 0;\n    lenth = strlen(string);       \n    cout << string << endl;       \n    for (i = 0; i < lenth; i++) { \n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else {\n        string[i] = ' ';\n        n++;\n      }\n    }\n    n = (lenth - n) / 2;      \n    for (i = 0; i < n; i++) { \n      for (j = 0; j < lenth; j++) {\n        for (t = j + 1; t < lenth; t++) {\n          if (string[j] == '$' && string[t] == '$') {\n            j = t;\n            continue;\n          }\n          if (string[j] == '$' && string[t] == '?') {\n            string[j] = string[t] = ' ';\n            j = t - 1;\n          }\n        }\n      }\n    }\n    for (i = lenth - 1; i >= 0; i--) { \n      if (string[i] != ' ')\n        break;\n    }\n    string[i + 1] = '\\0';\n    lenth = strlen(string);\n    int m = 0;\n    for (i = 0; i < lenth; i++) { \n      if (string[i] != ' ')\n        break;\n      m++;\n    }\n    for (i = m; i < lenth; i++)\n      cout << string[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  static char c[102], d[102];\n  int i, j, k, s;\n  while (scanf(\"%s \", c)) {\n    puts(c);\n    for (i = 0; c[i] != '\u0000'; i++) {\n\n      if (c[i] == '(')\n        d[i] = 1;\n      else if (c[i] == ')')\n        d[i] = 2;\n      else\n        d[i] = 3;\n    }\n    while (1) {\n      s = 0;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          break;\n        }\n      }\n      for (k = j + 1; k <= i - 1; k++) {\n        if (d[k] == 2) {\n          s = 1;\n          break;\n        }\n      }\n      if (s == 0)\n        break;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          for (k = j + 1; k <= i - 1; k++) {\n            if (d[k] == 1) {\n              j = k;\n            }\n            if (d[k] == 2) {\n              d[j] = 3;\n              d[k] = 3;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (k = 0; k <= i - 1; k++) {\n      switch (d[k]) {\n      case 1:\n        printf(\"$\");\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      case 3:\n        printf(\" \");\n        break;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, leftpos = 0, pos[200], k;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    j = 0;\n    for (i = 0; i < strlen(a); i++)\n      if (a[i] == '(' || a[i] == ')') {\n        b[j] = a[i];\n        pos[j] = i;\n        j++;\n      }\n    leftpos = -1;\n    k = 0;\n    while (k != strlen(b)) {\n      if (b[k] == '(')\n        leftpos = k;\n      if (b[k] == ')' && leftpos != -1) {\n        a[pos[k]] = ' ';\n        a[pos[leftpos]] = ' ';\n        b[leftpos] = ' ';\n        b[k] = ' ';\n        leftpos = -1;\n        k = -1;\n      }\n      k++;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n    memset(a, 0, 200);\n    memset(b, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31822", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint i;\nchar x[101];\nchar y[101];\nvoid f() {\n  int num = 0;\n  int k[101] = {0};\n  memset(y, ' ', 101);\n  int len = strlen(x);\n  for (i = 0; i < len; i++) {\n    if (x[i] == '(') {\n      y[i] = '$';\n      num = num + 1;\n      k[num] = i;\n    }\n    if (x[i] == ')') {\n      if (num > 0) {\n        y[k[num]] = ' ';\n        num = num - 1;\n      } else\n        y[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << y[i];\n  }\n  cout << endl;\n}\n\nint main() {\n  while (scanf(\"%s \", x)) {\n    cout << x << \"\\n\";\n    f();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    n = strlen(str);\n    match(0, n, str);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n    match(i + 1, n, str);\n    return 0;\n  } else if (str[i] == '(') {\n    str[i] = '$';\n    match(i + 1, n, str);\n    return 0;\n  } else {\n    str[i] = ' ';\n    match(i + 1, n, str);\n    return 0;\n  }\n}\n"}
{"label": "17", "index": "31824", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[110], s[110];\n  int left, i;\n  int leftp[110] = {0};\n  while (cin >> c) {\n    left = 0;\n    i = 0;\n    memset(leftp, 0, 110 * sizeof(int));\n    memset(s, 0, 110 * sizeof(char));\n    while (c[i] != '\\0') {\n      if (c[i] == '(') {\n        left++;\n        leftp[left] = i;\n      } else if (c[i] == ')') {\n        if (left == 0)\n          s[i] = '?';\n        else\n          left--;\n      }\n      i++;\n    }\n    if (left > 0)\n      for (i = 1; i <= left; i++)\n        s[leftp[i]] = '$';\n    cout << c << endl;\n    for (i = 0; i < strlen(c); i++)\n      if ((s[i] == '?') || (s[i] == '$'))\n        cout << s[i];\n      else\n        cout << ' ';\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31825", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint len;                \nchar st[101], ans[101]; \n\nint work(int pos) \n{\n  for (int i = pos + 1; i < len; i++)\n    if (st[i] == '(')\n      i = work(i); \n    else if (st[i] == ')') {\n      ans[pos] = '('; \n      ans[i] = ')';\n      return i;\n    }\n  return len - 1; \n}\n\nint main() {\n  int i;\n  while (cin >> st) \n  {\n    cout << st << endl; \n    len = strlen(st);\n    memset(ans, 0, sizeof(ans)); \n    for (i = 0; i < len; i++)\n      if (st[i] == '(')\n        i = work(i); \n    for (i = 0; i < len; i++)\n      switch (st[i]) {\n      case '(':\n        ans[i] = (ans[i] == '(') ? ' ' : '$';\n        break; \n      case ')':\n        ans[i] = (ans[i] == ')') ? ' ' : '?';\n        break;\n      default:\n        ans[i] = ' ';\n      }\n    cout << ans << endl; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(char c[], char str[], int n) {\n  int a, i, j;\n  for (i = 0; i <= n - 1; i++) {\n    if (c[i] == '(') {\n      a = 1;\n      for (j = i + 1; j <= n - 1; j++) {\n        if (c[j] == '(')\n          a++;\n        else if (c[j] == ')')\n          a--;\n        if (a == 0)\n          break;\n      }\n      if (a > 0)\n        str[i] = '$';\n    }\n    if (c[i] == ')') {\n      a = -1;\n      for (j = i - 1; j >= 0; j--) {\n        if (c[j] == ')')\n          a--;\n        else if (c[j] == '(')\n          a++;\n        if (a == 0)\n          break;\n      }\n      if (a < 0)\n        str[i] = '?';\n    }\n  }\n}\nint main() {\n  int r = 0;\n  while (r <= 5) {\n    char c[110] = {0}, str[110] = {0};\n    int n, i;\n\n    scanf(\"%s \", c);\n    n = strlen(c);\n    for (i = 0; i <= n - 1; i++)\n      str[i] = ' ';\n    f(c, str, n);\n    puts(c);\n    puts(str);\n    r++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31827", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$') {\n            break;\n          } else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, k;\n  scanf(\"%d \", &k);\n  while (k--) {\n    while (scanf(\"%s\", a) != EOF) {\n      puts(a);\n      n = strlen(a);\n      course(a, n);\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31828", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar use[150], rem[150];\nint len;\nvoid rid(int begin, int end);\nint main() {\n  while (1) {\n    char s;\n    int i = 0;\n    while ((s = cin.get()) != '\\n') {\n      use[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    len = i - 1;\n    rid(0, len);\n    for (int j = 0; j <= len; j++)\n      if (use[j] == '(')\n        use[j] = '$';\n      else if (use[j] == ')')\n        use[j] = '?';\n      else {\n        if (use[j] != '?' && use[j] != '$')\n          use[j] = ' ';\n      }\n\n    for (i = 0; i <= len; i++)\n      cout << rem[i];\n    printf(\"\\n\");\n    for (i = 0; i <= len; i++)\n      cout << use[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n\nvoid rid(int begin, int end) {\n  if (begin <= end) {\n    if (use[begin] != ')')\n      rid(begin + 1, end);\n    else {\n      int i = begin;\n      while (use[i] != '(' && i >= 0)\n        i--;\n      if (i == -1) {\n        use[begin] = '?';\n        rid(begin + 1, end);\n      } else\n        for (int j = i; j <= begin; j++) {\n          use[j] = ' ';\n          rid(begin + 1, end);\n        }\n    }\n  }\n}\n"}
{"label": "17", "index": "31829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {'\\0'};\n  while (cin.getline(str, 110, '\\n')) {\n    int length;\n    length = strlen(str);\n    for (int i = 0; i < length; i++)\n      printf(\"%c\", str[i]);\n    cout << endl;\n    for (int i = length - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i + 1; j < length; j++) {\n          if (str[j] == '?') {\n            str[j] = ' ';\n            str[i] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    for (int i = 0; i < length; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid match(char *s, char *r, int len) {\n  char stack[100], c;\n  int top = 0;\n  int pos;\n  for (pos = 0; pos < len; ++pos)\n    r[pos] = ' ';\n  r[len] = '\\0';\n  for (pos = 0; pos < len; ++pos) {\n    c = s[pos];\n    if (c == '(')\n      stack[top++] = pos;\n    else if (c == ')')\n      if (top > 0) {\n        top--;\n      } else\n        r[pos] = '?';\n  }\n  while (top > 0) {\n    pos = stack[--top];\n    r[pos] = '$';\n  }\n}\nvoid outresult(char s[], char r[]) {\n  puts(s);\n  puts(r);\n}\nint main() {\n  char line[101], result[101], ch;\n  int pos = 0;\n  while ((ch = getchar()) != EOF) {\n    if (ch != '\\n')\n      line[pos++] = ch;\n    else {\n      line[pos] = '\\0';\n      match(line, result, pos);\n      outresult(line, result);\n      pos = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nint dp[1000];\nint main(void) {\n\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  while (scanf(\"%s\", s) == 1) {\n    memset(dp, 0, sizeof(dp));\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        dp[i] = -1;\n      if (s[i] == ')')\n        dp[i] = 1;\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(' && dp[j] == -1) {\n            dp[i] = 0;\n            dp[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < n; i++) {\n      if (dp[i] == -1)\n        printf(\"$\");\n      else if (dp[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31832", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[200];\n  int i, j, k, m, n;\n  int flag = 0;\n  int left[100], l = 1;\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    flag = 0;\n    l = 1;\n    for (n = 1; n < 100; n++)\n      left[n] = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (j = l - 1; j >= 1; j--) {\n      flag = 0;\n      for (k = left[j] + 1; str[k] != '\\0'; k++) {\n        if (str[k] == ')') {\n          str[left[j]] = ' ';\n          str[k] = ' ';\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        str[left[j]] = '$';\n      }\n    }\n    for (m = 0; str[m] != '\\0'; m++)\n      if (str[m] == ')')\n        str[m] = '?';\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31833", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint work(int);\nchar l = '(', r = ')', sen[110][110] = {0}, rem[110][110] = {0};\nint i, j, k, t = 1, nsen[110] = {0};\nint main() {\n  for (i = 0;; i++) {\n\n    j = 0;\n    char c;\n    while ((c = cin.get()) != '\\n')\n      sen[i][j++] = c;\n    for (j = 0; sen[i][j] != 0; j++)\n      nsen[i]++;\n    for (t = 0; t < nsen[i]; t++)\n      rem[i][t] = sen[i][t];\n    work(i);\n    cout << rem[i] << endl;\n    printf(\"%s\\n\", sen[i]);\n  }\n\n  return 0;\n}\n\nint work(int i) {\n  for (j = 1; j <= nsen[i] - 1; j++)\n    for (k = 0; k < nsen[i] - 1; k++)\n      if (sen[i][k] == l && sen[i][k + j] == r) {\n        sen[i][k] = ' ';\n        sen[i][k + j] = ' ';\n      }\n\n  for (k = 0; k <= nsen[i] - 1; k++)\n    if (sen[i][k] == l)\n      sen[i][k] = '$';\n    else if (sen[i][k] == r)\n      sen[i][k] = '?';\n    else\n      sen[i][k] = ' ';\n\n  k = 0;\n  j = 1;\n  return 0;\n}\n"}
{"label": "17", "index": "31834", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main(int argc, char *argv[]) {\n  char zfc[120], cha, i, j, len;\n  while (scanf(\"%s\", zfc) != EOF) {\n    cha = 0;\n    len = strlen(zfc);\n    printf(\"%s\\n\", zfc);\n    for (i = 0; i < len; i++) {\n      if (zfc[i] != '(' && zfc[i] != ')') {\n        zfc[i] = ' ';\n      }\n      if (zfc[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            zfc[j] = ' ';\n            zfc[i] = ' ';\n            break;\n          }\n        }\n        if (j < 0) {\n          zfc[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (zfc[i] == '(') {\n        zfc[i] = '$';\n      }\n    }\n    puts(zfc);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1001];\n  int n;\n  while (~scanf(\"%s\", str)) {\n    n = strlen(str);\n    printf(\"%s\", str);\n    printf(\"\\n\");\n    for (int i = 1; i < n; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\", str);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, m = 0;\nchar a[100] = {'\\0'};\nvoid pipei(int m, char a[]) {\n  int i, j;\n  for (i = m; i <= k - 1; i++) {\n    if (a[i] == ')') {\n      break;\n    }\n    if (a[i] != '(' && a[i] != ')') {\n      a[i] = ' ';\n    }\n  }\n  m = i + 1;\n  for (j = i; j >= 0; j--) {\n    if (i == k && a[k - 1] != ')')\n      break;\n    if (a[j] == '(') {\n      a[j] = ' ';\n      a[i] = ' ';\n      break;\n    }\n  }\n  if (m <= k - 1)\n    pipei(m, a);\n}\nint main() {\n  char w;\n  while (cin >> a) {\n    k = strlen(a);\n    int i, j;\n    cout << a << endl;\n    pipei(0, a);\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (i = 0; i <= k - 1; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < 100; i++) {\n      a[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110];\n  int len, mark, sign = 0, s = 0;\n  while (cin.getline(a, 110, '\\n')) {\n    len = strlen(a);\n    for (int i = 0; i <= len - 1; i++)\n      b[i] = a[i];\n    for (int j = 1; j <= len; j++) {\n      mark = 0;\n      sign = 0;\n      s = 0;\n      for (int i = 0; i < len; i++) {\n        if (a[i] == '(') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (mark == len - 1) {\n        a[mark] = '$';\n      }\n      if (s != 0) {\n        for (int i = mark + 1; i < len; i++) {\n          if (a[i] == ')') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '$';\n      }\n      sign = 0;\n      mark = 0;\n      s = 0;\n      for (int i = len - 1; i >= 0; i--) {\n        if (a[i] == ')') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (s != 0) {\n        if (mark == 0) {\n          a[mark] = '?';\n        }\n      }\n      if (s != 0) {\n        for (int i = mark - 1; i >= 0; i--) {\n          if (a[i] == '(') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '?';\n      }\n    }\n    for (int i = 0; i < len - 1; i++)\n      cout << b[i];\n    cout << b[len - 1] << \"\\n\";\n    for (int i = 0; i < len - 1; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        cout << ' ';\n      else\n        cout << a[i];\n    }\n    if (a[len - 1] != '?' && a[len - 1] != '$')\n      cout << ' ' << endl;\n    else\n      cout << a[len - 1] << endl;\n    memset(a, '\\0', sizeof(a));\n    memset(b, '\\0', sizeof(b));\n    mark = 0;\n    sign = 0;\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31838", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l;\n  char as[110], bs[110], cs[110];\n  for (k = 0;; k++) {\n    cin >> as;\n    int len = strlen(as);\n    if (strcmp(as, bs) == 0)\n      break;\n    strcpy(bs, as);\n    for (i = 0; i < len; i++)\n      cs[i] = ' ';\n    cs[len] = 0;\n    for (l = 0; l < len; l++) {\n      for (i = l; i < len; i++) {\n        if (as[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (as[j] == '(') {\n              as[i] = ' ';\n              as[j] = ' ';\n              j = 0;\n              i = 0;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (as[i] == '(')\n        cs[i] = '$';\n      else if (as[i] == ')') {\n        cs[i] = '?';\n      }\n    }\n    printf(\"%s\\n%s\\n\", bs, cs);\n    strcpy(bs, as);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31839", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar in[102];\nint lenth;\nvoid match(int n) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(' && in[i + n] == ')') {\n      in[i] = ' ';\n      in[i + n] = ' ';\n    }\n  }\n  if (n <= lenth - 2) {\n    match(n + 1);\n  }\n}\nvoid print(char in[]) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(')\n      in[i] = '$';\n    else if (in[i] == ')')\n      in[i] = '?';\n    else {\n      in[i] = ' ';\n    }\n  }\n  cout << in << endl;\n}\nint main() {\n  while (cin >> in) {\n    printf(\"%s\\n\", in);\n    lenth = strlen(in);\n    match(0);\n    print(in);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31840", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar sign[101]; \nint lf[100];    \nint rt[100];    \nint len;        \n\nvoid match(); \n\nint main() {\n  while (cin.getline(sign, 101)) {\n    len = strlen(sign);   \n    cout << sign << endl; \n    int i = 0;\n    for (i = 0; i < 100; i++) \n    {\n      lf[i] = -1;\n      rt[i] = -1;\n    }\n    match(); \n  }\n  return 0;\n}\n\nvoid match() {\n  int i = 0, j = 0, n1 = 0, n2 = 0; \n  char result[len];\n  for (i = 0; i < len; i++)\n    result[i] = ' ';        \n  for (i = 0; i < len; i++) \n  {\n    if (sign[i] == '(') {\n      lf[n1] = i;\n      n1++;\n    }\n    if (sign[i] == ')') {\n      rt[n2] = i;\n      n2++;\n    }\n  }\n  for (i = n1 - 1; i >= 0; i--) \n    for (j = 0; j < n2; j++)\n      if (lf[i] < rt[j]) {\n        lf[i] = -1;\n        rt[j] = -1;\n        break;\n      }\n  for (i = 0; i < n1; i++) \n    if (lf[i] >= 0)\n      result[lf[i]] = '$';\n  for (j = 0; j < n2; j++)\n    if (rt[j] >= 0)\n      result[rt[j]] = '?';\n  for (i = 0; i < len; i++) \n    cout << result[i];\n  cout << endl;\n}\n"}
{"label": "17", "index": "31841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  int a[200];\n  int n, l, i, j, m;\n  while (cin.getline(ch, 150)) {\n    l = strlen(ch);\n    for (i = 0; i < l; i++)\n      if (ch[i] == '(')\n        a[i] = -1;\n      else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1)\n            break;\n        if (j != -1) {\n          a[i] = 0;\n          a[j] = 0;\n        } else\n          a[i] = 1;\n      } else\n        a[i] = 0;\n    n = 0;\n    for (i = 0; i < l; i++)\n      if (a[i] != 0)\n        n++;\n    m = n;\n    i = 0;\n    printf(\"%s\\n\", ch);\n    while (n > 0) {\n      if (a[i] == -1)\n        cout << \"$\";\n      else if (a[i] == 1)\n        cout << \"?\";\n      else if (m != n)\n        printf(\" \");\n      if (a[i] != 0)\n        n--;\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int b[100] = {0};\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    char a1[100] = \" \";\n    int len = strlen(a);\n    int i = 0;\n    int lnum = 0, rnum = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        b[lnum] = i;\n        lnum++;\n      }\n      if (a[i] == ')') {\n        rnum++;\n        if (rnum > lnum) {\n          a1[i] = '?';\n          rnum--;\n        } else {\n          lnum--;\n          rnum--;\n        }\n      }\n    }\n    for (i = 0; i < lnum; i++)\n      a1[b[i]] = '$';\n    for (i = 0; i < len; i++) {\n      if ((a1[i] == '$') || (a1[i] == '?'))\n        cout << a1[i];\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31843", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char *p) {\n  int n = (int)strlen(p);\n  int a[100] = {0};\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    if (p[i] == ')') {\n      for (j = i; j >= 0; j--)\n        if (p[j] == '(') {\n          p[j] = p[i] = 'a';\n          break;\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (p[i] == '(')\n      printf(\"$\");\n    else if (p[i] == ')')\n      printf(\"?\");\n    else\n      printf(\" \");\n  printf(\"\\n\");\n}\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i < n) {\n    char s[103] = {'\\0'};\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n    match(s);\n    i++;\n  }\n}\n"}
{"label": "17", "index": "31844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (scanf(\"%s \", str)) {\n    printf(\"%s\\n\", str);\n    n = strlen(str);\n    match(0, n, str);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n    match(i + 1, n, str);\n    return 0;\n  } else if (str[i] == '(') {\n    str[i] = '$';\n    match(i + 1, n, str);\n    return 0;\n  } else {\n    str[i] = ' ';\n    match(i + 1, n, str);\n    return 0;\n  }\n}\n"}
{"label": "17", "index": "31845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar investigate(char a[]) {\n  int i, j, k, n;\n  int p1 = 0, p2 = 0, t = 0, t1 = 0;\n  n = strlen(a);\n  char b[100];\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      p1++;\n    if (a[i] == ')')\n      p2++;\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((i == (n - 1)) && (t > t1)) {\n      i = -1;\n      t1 = t;\n      goto loop;\n    } else if (a[i] != '(') {\n      b[i] == ' ';\n      continue;\n    } else {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == '(') {\n          i = j - 1;\n          break;\n        } else if (a[j] == ')') {\n          a[i] = '[';\n          a[j] = ']';\n          t++;\n          break;\n        }\n      }\n    }\n  loop:;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == '[')\n      a[i] = '(';\n    if (a[i] == ']')\n      a[i] = ')';\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n  for (i = 0; i < n; i++)\n    printf(\"%c\", b[i]);\n\n  return 0;\n}\n\nint main() {\n  int i, j;\n  char a[100];\n  while (scanf(\"%s \", a)) {\n    investigate(a);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31846", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[103], temp[103];\nint len;\nint match(int x) {\n  int y;\n  if (x == len)\n    return x;\n  if (str[x] == '(')\n    y = match(x + 1);\n  else if (str[x] == ')')\n    return x;\n  else\n    return match(x + 1);\n  if (y == len) {\n    temp[x] = '$';\n    return y;\n  } else\n    return match(y + 1);\n}\nint main() {\n  while (cin >> str) {\n    printf(\"%s\\n\", str);\n    len = strlen(str);\n    int z = 0;\n    memset(temp, ' ', sizeof(temp));\n    while (z != len) {\n      z = match(z);\n      if (z != len) {\n        temp[z] = '?';\n        z++;\n      }\n    }\n    for (int i = 0; i < len; i++)\n      printf(\"%c\", temp[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31847", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    cout << line << endl;\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31848", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, j, k;\n  char c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    getchar();\n    scanf(\"%s \", c);\n    s = strlen(c);\n    printf(\"%s\\n\", c);\n    for (j = 0; j < s; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[j] = ' ';\n            c[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < s; j++) {\n      if (c[j] == '(')\n        c[j] = '$';\n      if (c[j] == ')')\n        c[j] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31849", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, k, lena;\nchar a[101];\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    lena = strlen(a);\n    for (i = 0; i < lena; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = '*';\n            a[j] = '*';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < lena; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint match(char c[], int n) {\n  for (int i = n + 1; i < strlen(c); i++) {\n    if (c[i] == ')') {\n      c[i] = ' ';\n      c[n] = ' ';\n      return i;\n    } else if (c[i] == '(') {\n      i = match(c, i);\n    }\n  }\n  c[n] = '$';\n  return strlen(c) - 1;\n}\nint main() {\n  char ch[110];\n  while (cin >> ch) {\n    cout << ch << endl;\n    for (int i = 0; ch[i] != 0; i++)\n      if (ch[i] != '(' && ch[i] != ')')\n        ch[i] = ' ';\n    for (int i = 0; ch[i] != 0; i++) {\n      if (ch[i] == '(')\n        i = match(ch, i);\n      else if (ch[i] == ')')\n        ch[i] = '?';\n    }\n    cout << ch << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110];\n  int len, mark, sign = 0, s = 0;\n  while (cin.getline(a, 110, '\\n')) {\n    len = strlen(a);\n    for (int i = 0; i <= len - 1; i++)\n      b[i] = a[i];\n    for (int j = 1; j <= len; j++) {\n      mark = 0;\n      sign = 0;\n      s = 0;\n      for (int i = 0; i < len; i++) {\n        if (a[i] == '(') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (mark == len - 1) {\n        a[mark] = '$';\n      }\n      if (s != 0) {\n        for (int i = mark + 1; i < len; i++) {\n          if (a[i] == ')') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '$';\n      }\n      sign = 0;\n      mark = 0;\n      s = 0;\n      for (int i = len - 1; i >= 0; i--) {\n        if (a[i] == ')') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (s != 0) {\n        if (mark == 0) {\n          a[mark] = '?';\n        }\n      }\n      if (s != 0) {\n        for (int i = mark - 1; i >= 0; i--) {\n          if (a[i] == '(') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0) {\n          a[mark] = '?';\n        }\n      }\n    }\n    for (int i = 0; i < len - 1; i++)\n      cout << b[i];\n    cout << b[len - 1] << \"\\n\";\n    for (int i = 0; i < len - 1; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        cout << ' ';\n      else\n        cout << a[i];\n    }\n    if (a[len - 1] != '?' && a[len - 1] != '$')\n      cout << ' ' << endl;\n    else\n      cout << a[len - 1] << endl;\n    memset(a, '\\0', sizeof(a));\n    memset(b, '\\0', sizeof(b));\n    mark = 0;\n    sign = 0;\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31852", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int len, i, h;\n  char c[102];\n  int a[101];\n  int b[101];\n  while ((cin.getline(c, 101))) {\n    len = strlen(c);\n    cout << c << endl;\n    h = 0;\n    for (i = 0; i <= len; i++)\n      a[i] = -1;\n    memset(b, 0, sizeof(b));\n    for (i = 0; i <= len - 1; i++) {\n      switch (c[i]) {\n      case '(': {\n        h++;\n        a[h] = i;\n        break;\n      }\n      case ')': {\n        if (h == 0)\n          b[i] = 2;\n        else {\n          a[h] = 0;\n          h--;\n        }\n        break;\n      }\n      }\n    }\n    for (i = 1; i <= h; i++) {\n      if (a[i] != -1)\n        b[a[i]] = 1;\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (b[i] == 1)\n        cout << '$';\n      if (b[i] == 2)\n        cout << '?';\n      if (b[i] == 0)\n        cout << ' ';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint left(int x, char s[], int n);\nint main() {\n  int l;\n  char c[101] = {0};\n\n  cin >> c;\n  puts(c);\n  l = left(0, c, 0);\n  printf(\"%s\", c);\n  while ((scanf(\"%s\", c) != EOF)) {\n    cout << \" \";\n    puts(c);\n    l = left(0, c, 0);\n    cout << c;\n  }\n  return 0;\n}\nint left(int x, char s[], int n) {\n  int a;\n  if (s[n] != '\u0000') {\n    if (s[n] == '(') {\n      a = left(x + 1, s, n + 1);\n      if (a > 0) {\n        s[n] = ' ';\n        return (a - 1);\n      } else {\n        s[n] = '$';\n        return 0;\n      }\n    } else if (s[n] == ')') {\n      if (x > 0) {\n        s[n] = ' ';\n        return (left(x - 1, s, n + 1) + 1);\n      } else {\n        s[n] = '?';\n        return (left(0, s, n + 1) + 1);\n      }\n    } else {\n      s[n] = ' ';\n      return left(x, s, n + 1);\n    }\n  } else\n    return 0;\n}\n"}
{"label": "17", "index": "31854", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[103], temp[103];\nint len;\nint match(int x) {\n  int y;\n  if (x == len)\n    return x;\n  if (str[x] == '(')\n    y = match(x + 1);\n  else if (str[x] == ')')\n    return x;\n  else\n    return match(x + 1);\n  if (y == len) {\n    temp[x] = '$';\n    return y;\n  } else\n    return match(y + 1);\n}\nint main() {\n  while (scanf(\"%s \", str)) {\n    cout << str << endl;\n    len = strlen(str);\n    int z = 0;\n    memset(temp, ' ', sizeof(temp));\n    while (z != len) {\n      z = match(z);\n      if (z != len) {\n        temp[z] = '?';\n        z++;\n      }\n    }\n    for (int i = 0; i < len; i++)\n      cout << temp[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len;\n  while (scanf(\"%s\", a) != EOF) {\n    puts(a);\n    len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] != '(' && a[i] != ')') {\n        a[i] = ' ';\n      } else if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == '(') {\n            break;\n          } else if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          } else if (a[j] == ')') {\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      }\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31856", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int left, right, pos[101], pos1[101], i;\n  while (cin >> a) {\n    left = right = 0;\n    memset(pos, 0, sizeof(pos));\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (a[i] == ')') {\n        if (left == 0) {\n          right++;\n          pos1[right] = i;\n        } else {\n          pos[left] = 200;\n          left--;\n        }\n      }\n    }\n    for (i = 1; i <= left; i++)\n      a[pos[i]] = 1;\n    for (i = 1; i <= right; i++)\n      a[pos1[i]] = 2;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 1 && a[i] != 2)\n        cout << \" \";\n      else {\n        if (a[i] == 1)\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31857", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, flag;\n  char a[200], b[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    memset(b, 0, 200);\n    cin >> a;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == '(') {\n        flag = 1;\n        k = j + 1;\n        while (flag != 0 && k < strlen(a)) {\n          if (a[k] == '(')\n            flag++;\n          if (a[k] == ')')\n            flag--;\n          k++;\n        }\n        if (k >= strlen(a) && flag != 0)\n          b[j] = '$';\n        else {\n          b[k - 1] = ' ';\n          b[j] = ' ';\n        }\n      } else if (a[j] == ')' && b[j] != ' ')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, leftpos = 0, pos[200], k;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    j = 0;\n    for (i = 0; i < strlen(a); i++)\n      if (a[i] == '(' || a[i] == ')') {\n        b[j] = a[i];\n        pos[j] = i;\n        j++;\n      }\n    leftpos = -1;\n    k = 0;\n    while (k != strlen(b)) {\n      if (b[k] == '(')\n        leftpos = k;\n      if (b[k] == ')' && leftpos != -1) {\n        a[pos[k]] = ' ';\n        a[pos[leftpos]] = ' ';\n        b[leftpos] = ' ';\n        b[k] = ' ';\n        leftpos = -1;\n        k = -1;\n      }\n      k++;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n    memset(a, 0, 200);\n    memset(b, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000];\n  int d[1000], n;\n  char b = '(', c = ')';\n\n  int ww = 0;\n  while ((ww = getchar()) != -1) {\n    a[1] = ww;\n    for (int i = 2; i <= 999; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n') {\n        n = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      d[i] = 0;\n    for (int i = 1; i <= n; i++) {\n      if (a[i] != b && a[i] != c)\n        d[i] = 1;\n    }\n    for (int i = 1; i <= n / 2; i++) {\n      for (int j = 1; j <= n; j++) {\n        if (a[j] == b || d[j] == 1)\n          continue;\n        for (int k = j; k > 0; k--) {\n          if (a[k] == c || d[k] == 1)\n            continue;\n          d[j] = 1;\n          d[k] = 1;\n          break;\n        }\n      }\n    }\n    for (int i = 1; i <= n; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 1; i <= n; i++) {\n      if (d[i] == 1)\n        printf(\" \");\n      else {\n        if (a[i] == '(')\n          cout << \"$\";\n        else\n          printf(\"?\");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      b[j] = ' ';\n    b[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0) {\n          b[j] = '?';\n        } else {\n          t--;\n          b[c[t]] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++) {\n      printf(\"%c\", b[h]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31861", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar num2[110] = {'\\0'};\n\nint left(char num[110], int point, int sum,\n         int l) {   \n  if (point == l) { \n    if (num[point] == '(') {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == ')') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = left(num, point + 1, sum, l);\n    if (num[point] == '(' && k == 0) {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == '(' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == ')') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint right(char num[110], int point, int sum,\n          int l) {  \n  if (point == l) { \n    if (num[point] == ')') {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == '(') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = right(num, point - 1, sum, l);\n    if (num[point] == ')' && k == 0) {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == ')' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == '(') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint main() {\n  char num[110] = {'\\0'};\n  while (cin >> num) {\n    int l = strlen(num); \n    cout << num << endl;\n    for (int i = 0; i < l; i++) \n      num2[i] = ' ';\n    num2[l] = '\\0';\n    left(num, 0, 0, l - 1);\n    right(num, l - 1, 0, 0);\n    cout << num2 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31862", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (!cin.eof()) {\n    char str[1000], ans[1000];\n    memset(str, 0, sizeof(str));\n    memset(ans, 0, sizeof(ans));\n    cin >> str;\n\n    for (int i = 0; i < strlen(str); i++)\n      ans[i] = ' ';\n\n    int sign = 0;\n    for (int i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n\n        sign++;\n        ans[i] = sign + '0';\n      } else if (str[i] == ')') {\n        if (sign > 0) {\n          ans[i] = sign + '0';\n          sign--;\n        } else\n          ans[i] = '?';\n      }\n    }\n    for (int i = 0; i < strlen(str); i++) {\n      if (ans[i] != ' ' && str[i] == '(') {\n        int ok = 0;\n        int j;\n        for (j = i + 1; j < strlen(str); j++) {\n          if (ans[j] == ans[i]) {\n            ok = 1;\n            break;\n          }\n        }\n        if (!ok)\n          ans[i] = '$';\n        else\n          ans[i] = ans[j] = ' ';\n      }\n    }\n    ans[strlen(str)] = '\u0000';\n    cout << str << endl;\n    printf(\"%s\", ans);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101];\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < strlen(a); i++)\n      cout << a[i];\n    putchar('\\n');\n    for (i = strlen(a) - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++)\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n      printf(\"%c\", a[i]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char a[1000], b[1000];\n  int j, l, r;\n  for (i = 0; i < n; i++) {\n\n    memset(a, '\\n', 200);\n    memset(b, '\\n', 200);\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n        for (r = j - 1; r >= 0; r--) {\n          if (b[r] == '$') {\n            b[r] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      }\n    }\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char num[101], t[101];\n  int s[101];\n  int k, j;\n  int len;\n  int aa;\n  while (cin >> num) {\n    strcpy(t, num);\n    len = strlen(num);\n    for (k = 0; k < len; k++)\n      s[k] = 1;\n\n    for (k = 0; k < len; k++) {\n      if (num[k] == ')') {\n        for (j = k - 1; j >= 0; j--) {\n          if (num[j] == '(') {\n            s[j] = 0;\n            s[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", t);\n    for (aa = 0; aa < len; aa++) {\n      if (s[aa] == 1 && t[aa] == '(')\n        printf(\"$\");\n      else if (s[aa] == 1 && t[aa] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[105];\n  int flag = 0;\n  int puma[105];\n  while (scanf(\"%s \", str)) {\n    flag = 0;\n    cout << str << \"\\n\";\n    for (int i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        flag++;\n        puma[flag] = i;\n      } else if (str[i] == ')') {\n        if (flag > 0) {\n          str[puma[flag]] = ' ';\n          str[i] = ' ';\n          flag--;\n        } else\n          str[i] = '?';\n      } else {\n        str[i] = ' ';\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char c[100];\n  int l;\n\n  while (scanf(\"%s \", c)) {\n    int a[100] = {0};\n    int left = 0;\n\n    l = strlen(c);\n\n    for (int i = 0; i < l; i++) {\n\n      if (left == 0 && c[i] == ')')\n        a[i] = 1;\n\n      if (c[i] == '(')\n        left++;\n\n      if (c[i] == ')' && left > 0) {\n        left--;\n\n        for (int j = i; j >= 0; j--) {\n          if ((c[j] == '(') && (a[j] != 2)) {\n            a[j] = 2;\n            break;\n          }\n        }\n      }\n    }\n\n    int count = 0;\n\n    if (left != 0) {\n      for (int i = l; count < left; i--) {\n        if (c[i] == '(' && a[i] != 2) {\n          a[i] = -1;\n          count++;\n        }\n      }\n    }\n\n    for (int i = 0; i < l; i++)\n      cout << c[i];\n\n    cout << endl;\n\n    for (int i = 0; i < l; i++) {\n      if (a[i] == 0 || a[i] == 2)\n        cout << \" \";\n      else if (a[i] == 1)\n        cout << '?';\n      else if (a[i] == -1)\n        cout << '$';\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Find(char *);\nint main() {\n  int i;\n  char str[101];\n  char mark[101];\n\n  while (cin.getline(str, 101)) {\n    memset(mark, 0, sizeof(mark));\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n        mark[i] = '$';\n      }\n      if (str[i] == ')') {\n        mark[i] = '?';\n      }\n      if (str[i] != '(' && str[i] != ')') {\n        mark[i] = ' ';\n      }\n    }\n    Find(mark);\n    for (i = strlen(mark) - 1; i >= 0; i--)\n      if (mark[i] != ' ') {\n        mark[i + 1] = 0;\n        break;\n      }\n    for (i = 0; i < strlen(mark); i++)\n      if (mark[i] != ' ') {\n        strcpy(mark, mark + i);\n        break;\n      }\n    cout << str << endl << mark << endl;\n  }\n}\n\nvoid Find(char mark[]) {\n  int i, j = 0;\n  for (i = 0; i < strlen(mark); i++) {\n    if (mark[i] == '$') {\n      for (j = i + 1; j < strlen(mark); j++) {\n        if (mark[j] == '$') {\n          break;\n        } else {\n          if (mark[j] == '?') {\n            mark[j] = ' ';\n            mark[i] = ' ';\n            Find(mark);\n            return;\n          }\n        }\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "31869", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, len, j;\n  char ch[105], s[105], str[105];\n  while (scanf(\"%s\", ch) != EOF) {\n    int m = 0;\n    strcpy(s, ch);\n    strcpy(str, ch);\n    len = strlen(ch);\n\n    for (i = 0; i < len; i++) {\n      if (ch[i] != '(' && ch[i] != ')') {\n        s[i] = ' ';\n      } else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (ch[j] == '(') {\n            m = 1;\n            ch[i] = ' ';\n            s[i] = ' ';\n            s[j] = ' ';\n            ch[j] = ' ';\n            break;\n          } else {\n            continue;\n          }\n        }\n        if (m == 0) {\n          s[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        s[i] = '$';\n      } else if (s[i] == ')') {\n        s[i] = '?';\n      }\n    }\n    cout << str << \"\\n\";\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid fun(char a[]) {\n\n  int len, j, bi = 0, zuo, you, hao = 0;\n  char b[200];\n  int c[200];\n  len = strlen(a);\n  for (j = 0; j < len; j++) {\n    if (a[j] == '(' || a[j] == ')') {\n      b[bi] = a[j];\n      c[bi] = j;\n      bi += 1;\n    }\n  }\n  for (j = 0; j < bi - 1; j++) {\n    if (b[j] == '(' && b[j + 1] == ')') {\n      zuo = j;\n      you = j + 1;\n      hao = 1;\n      break;\n    }\n  }\n  if (hao == 0)\n    return;\n  while (b[zuo] == '(' && b[you] == ')') {\n    b[zuo] = 1;\n    b[you] = 1;\n    zuo -= 1;\n    you += 1;\n  }\n  for (j = 0; j < bi; j++) {\n    if (b[j] == 1) {\n      a[c[j]] = 1;\n    }\n  }\n  fun(a);\n}\n\nint main() {\n  int i, n, len, j;\n  char a[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    puts(a);\n    fun(a);\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        printf(\" \");\n      else if (a[j] == '(')\n        printf(\"$\");\n      else if (a[j] == ')')\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[1000];\n  char outline[1000];\n  int i, j;\n  int len;\n  while (scanf(\"%s \", line)) {\n    strcpy(outline, line);\n    len = strlen(line);\n    for (i = 0; i < len; i++) {\n      if (line[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[j] = ' ';\n            line[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << outline << endl;\n    for (i = 0; i < len; i++) {\n      if (line[i] == '(') {\n        printf(\"$\");\n      } else {\n        if (line[i] == ')') {\n          cout << '?';\n        } else\n          printf(\" \");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31872", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  cin >> n;\n  char a[n][1000];\n  getchar();\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31873", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[105];\n  int mark[105] = {0};\n  while (cin.getline(a, 101)) {\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(') {\n        mark[i] = 1;\n      }\n      if (a[i] == ')') {\n        mark[i] = -1;\n      }\n    }\n    for (int i = 1; i < strlen(a); i++) {\n      if (mark[i] == -1) {\n        for (int j = i - 1; j >= 0; j--) {\n          if (mark[j] == 1) {\n            mark[i] = 0;\n            mark[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a); i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (int i = 0; i < strlen(a); i++) {\n      if (mark[i] == 0)\n        cout << \" \";\n      else if (mark[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n    cout << endl;\n    for (int i = 0; i < strlen(a); i++)\n      mark[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int left = 0;\n    int p[105], t = 0;\n    int k, len;\n    char a[105];\n    char b[105];\n    cin >> a;\n    len = strlen(a);\n    for (k = 0; k < len; k++)\n      b[k] = ' ';\n    b[len] = '\\0';\n    for (k = 0; k < len; k++) {\n      if (a[k] == '(') {\n        b[k] = '$';\n        p[t] = k;\n        t++;\n        left++;\n      }\n      if (a[k] == ')') {\n        if (left != 0) {\n          t--;\n          b[p[t]] = ' ';\n          left--;\n        } else\n          b[k] = '?';\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    printf(\"%s\", b);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31875", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m = 0, i, j, t, k;\n  char a[101], c[101];\n  cin >> t;\n  getchar();\n  for (k = 0; k < t; k++) {\n\n    cin >> a;\n    int l = strlen(a);\n    c[l] = '\u0000';\n    for (j = 0; j < l; j++) {\n      c[j] = a[j];\n      if (a[j] == '(')\n        m++;\n      if (a[j] != '(' && a[j] != ')')\n        c[j] = ' ';\n    }\n    puts(a);\n    for (i = 0; i < m + 1; i++) {\n      char x = ')';\n      int y = -1;\n      for (j = 0; j < l; j++) {\n        if (c[j] == '(' || c[j] == ')') {\n          if (c[j] == '(') {\n          } else {\n            if (x == '(') {\n              c[j] = ' ';\n              c[y] = ' ';\n            }\n          }\n          y = j;\n          x = c[j];\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      if (c[i] == ')')\n        c[i] = '?';\n    }\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, s;\nchar a[101];\nvoid f(int x) {\n  a[x] = '$';\n  if (x < s - 1) {\n    for (int j = x + 1; j < s; j++) {\n      if (a[j] == '(') {\n        i = j;\n        f(j);\n      } else if (a[j] == ')') {\n        a[x] = ' ', a[j] = ' ';\n        return;\n      } else if (a[j] != '$')\n        a[j] = ' ';\n    }\n  }\n  return;\n}\nint main() {\n  int j = 0;\n  while (cin.getline(a, 101)) {\n    if (j != 0)\n      cout << endl;\n    cout << a;\n    s = strlen(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        f(i);\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    j++;\n    printf(\"\\n%s\", a);\n  }\n}\n"}
{"label": "17", "index": "31877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  do {\n    char s[101] = {0}, S[101] = {0};\n    int i, len, m;\n\n    scanf(\"%s \", s);\n    strcpy(S, s);\n\n    len = strlen(s);\n\n    if (len == 0)\n      break;\n\n    m = 0;\n    do {\n\n      for (i = m; i < len; i++) {\n        if (s[i] == ')') {\n          break;\n        }\n      }\n\n      m = i;\n\n      if (m == len)\n        break;\n\n      else {\n        for (i = m; i >= 0; i--) {\n          if (s[i] == '(') {\n            s[i] = '1';\n            s[m] = '1';\n            break;\n          }\n        }\n      }\n\n      m = m + 1;\n\n    } while (1);\n\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n    }\n\n    cout << S << \" \";\n    puts(s);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "17", "index": "31878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, l;\n  char c[1000][105] = {0};\n  int k;\n  int a[105] = {0};\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 105; j++) {\n      a[j] = 0;\n    }\n    l = strlen(c[i]);\n    printf(\"%s\\n\", c[i]);\n    for (j = l - 1; j >= 0; j--) {\n      if (c[i][j] == '(') {\n        for (k = j + 1; k < l; k++) {\n          if (c[i][k] == ')') {\n            c[i][k] = 0;\n            c[i][j] = 0;\n            break;\n          }\n        }\n        if (k == l) {\n          c[i][j] = 0;\n          a[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (c[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1)\n        printf(\"$\");\n      else if (a[j] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, x;\n  char s[200], a[200];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < strlen(s); j++) {\n      if (s[j] == '(')\n        a[j] = '$';\n      else if (s[j] == ')')\n        a[j] = '?';\n      else\n        a[j] = ' ';\n    }\n\n    for (k = 0; k < strlen(s); k++) {\n      if (a[k] == '?') {\n        for (x = k - 1; x >= 0; x--) {\n          if (a[x] == '$') {\n            a[k] = ' ';\n            a[x] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    int w;\n    for (w = 0; w < strlen(s); w++) {\n      cout << a[w];\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[106];\n  while (1) {\n    memset(zf, '\u0000', sizeof(zf));\n\n    cin >> zf;\n    if (zf[0] == '\u0000')\n      break;\n    puts(zf);\n    for (int i = 0; i < strlen(zf); i++) {\n      if (zf[i] == ')') {\n        for (int j = i; j >= 0; j--) {\n          if (zf[j] == '(') {\n            zf[j] = ' ';\n            zf[i] = ' ';\n            break;\n          }\n        }\n      } else if (zf[i] != '(') {\n        zf[i] = ' ';\n      }\n    }\n    for (int t = 0; t < strlen(zf); t++) {\n      if (zf[t] == '(') {\n        zf[t] = '$';\n      } else if (zf[t] == ')') {\n        zf[t] = '?';\n      }\n    }\n    puts(zf);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31881", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a;\nchar s1[101], s2[101];\nint main() {\n  int n, l, i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    memset(s1, 0, 101);\n    memset(s2, 0, 101);\n    cin >> s1;\n    a = strlen(s1);\n    int k[100] = {0}, b = 0;\n    for (i = 0; i < a; i++) {\n      if (s1[i] == '(') {\n        for (j = i; j < a; j++) {\n          if (s1[j] == '(')\n            k[i]++;\n          else if (s1[j] == ')')\n            k[i]--;\n        }\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (s1[j] == ')')\n            k[i]++;\n          else if (s1[j] == '(')\n            k[i]--;\n        }\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (s1[i] == ')') {\n        b = 0;\n        for (j = i - 1; j >= 0; j--)\n          if (s1[j] == ')' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = a - 1; i >= 0; i--) {\n      if (s1[i] == '(') {\n        b = 0;\n        for (j = i + 1; j < a; j++)\n          if (s1[j] == '(' && k[j] > 0)\n            b++;\n        k[i] -= b;\n      }\n    }\n    for (i = 0; i < a; i++) {\n      if (k[i] > 0) {\n        if (s1[i] == '(')\n          s2[i] = '$';\n        else if (s1[i] == ')')\n          s2[i] = '?';\n      } else\n        s2[i] = ' ';\n    }\n    printf(\"%s\\n\", s1);\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s2[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n = 0, k, p, count1 = 0, count2 = 0;\n  char a[100][1000], b[1000][1000];\n  for (i = 0; i < 100; i++) {\n    for (k = 0; k < 100; k++) {\n      b[i][k] = ' ';\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    if (a[i][0] == '\\0')\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \"\\n\";\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == ')') {\n        for (p = k - 1; p >= 0; p--) {\n          if (a[i][p] == '(') {\n            a[i][p] = '.';\n            a[i][k] = '.';\n            break;\n          } else if (a[i][p] == ')') {\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < strlen(a[i]); k++) {\n      if (a[i][k] == '(')\n        b[i][k] = '$';\n      else if (a[i][k] == ')')\n        b[i][k] = '?';\n    }\n    b[i][strlen(a[i])] = '\\0';\n    printf(\"%s\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(int n, char b[]) {\n  if (n > 0)\n    f(n - 1, b);\n  int i = 0, k = 0, x = 0;\n  for (k = 0; k < n; k++) {\n    if (b[k] == ')') {\n      for (x = 0; x <= k; x++) {\n        if (b[k - x] == '(') {\n          b[k] = ' ';\n          b[k - x] = ' ';\n          break;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      b[i] = a[i];\n      if (b[i] != '(' && b[i] != ')' && b[i] != '\\n')\n        b[i] = ' ';\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    f(n, b);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  int l, i, j, num1, num2;\n  while (cin >> a) {\n    num1 = 0;\n    num2 = 0;\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        num1++;\n      if (a[i] == ')') {\n        num2++;\n        if (num2 <= num1) {\n          a[i] = ' ';\n          for (j = i; j >= 0; j--)\n            if (a[j] == '(') {\n              a[j] = ' ';\n              break;\n            }\n        }\n        if (num2 > num1) {\n          a[i] = '?';\n          num2--;\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n    for (i = 0; i < l; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char jiance[101], c;\n  int i, zifu, kuo2[100];\n  while (cin >> jiance) {   \n    cout << jiance << endl; \n    zifu = -1;\n    for (i = 0; jiance[i] != 0; i++) {\n      c = jiance[i];\n      jiance[i] = ' '; \n      if (c == '(') {  \n        zifu++;\n        kuo2[zifu] = i;\n      } else if (c == ')') { \n        zifu--;\n        if (zifu < -1) {\n          jiance[i] = '?'; \n          zifu = -1;\n        }\n      }\n    }\n    if (zifu > -1)\n      for (; zifu > -1; zifu--)\n        jiance[kuo2[zifu]] = '$'; \n    cout << jiance << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char chn[120];\n  int i, l;\n  int z, t;\n  char a, b;\n  while (scanf(\"%s\", chn) != -1) {\n    l = strlen(chn);\n    printf(\"%s\\n\", chn);\n    while (1) {\n      z = -1;\n      t = 0;\n      for (i = 0; i < l; i++) {\n        if (z == -1 && chn[i] == '(')\n          z = i;\n        else if (z >= 0 && chn[i] == ')') {\n          chn[z] = ' ';\n          chn[i] = ' ';\n          t++;\n          break;\n        } else if (z >= 0 && chn[i] == '(')\n          z = i;\n      }\n      if (!t)\n        break;\n    }\n    for (i = 0; i < l; i++) {\n      if (chn[i] == '(')\n        chn[i] = '$';\n      else if (chn[i] == ')')\n        chn[i] = '?';\n      else\n        chn[i] = ' ';\n      printf(\"%c\", chn[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31887", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[105];\n  int flag = 0;\n  int puma[105];\n  while (cin >> str) {\n    flag = 0;\n    cout << str << endl;\n    for (int i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        flag++;\n        puma[flag] = i;\n      } else if (str[i] == ')') {\n        if (flag > 0) {\n          str[puma[flag]] = ' ';\n          str[i] = ' ';\n          flag--;\n        } else\n          str[i] = '?';\n      } else {\n        str[i] = ' ';\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31888", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, flag;\n  char a[200], b[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    memset(b, 0, 200);\n    scanf(\"%s\", a);\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == '(') {\n        flag = 1;\n        k = j + 1;\n        while (flag != 0 && k < strlen(a)) {\n          if (a[k] == '(')\n            flag++;\n          if (a[k] == ')')\n            flag--;\n          k++;\n        }\n        if (k >= strlen(a) && flag != 0)\n          b[j] = '$';\n        else {\n          b[k - 1] = ' ';\n          b[j] = ' ';\n        }\n      } else if (a[j] == ')' && b[j] != ' ')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31889", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  for (;;) {\n\n    char str[300];\n    int i, j, k, a1 = 0, js1 = 0, l;\n\n    scanf(\"%s \", str);\n    if (feof(stdin))\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == ')' && a1 == 0) {\n        str[i] = '?';\n      }\n      if (str[i] == ')' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '?';\n      }\n    }\n    a1 = 0;\n    js1 = 0;\n\n    for (; i >= 0; i--) {\n      if (str[i] == ')') {\n        a1 = 1;\n        js1++;\n      }\n      if (str[i] == '(' && a1 == 0) {\n        str[i] = '$';\n      }\n      if (str[i] == '(' && a1 == 1) {\n        if (js1 > 0)\n          js1--;\n        else\n          str[i] = '$';\n      }\n    }\n\n    for (i = 0; i < l; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31890", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101], b[101];\n  while (cin.getline(a, 101)) {\n    for (i = 0; i <= 100; i++)\n      b[i] = ' ';\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            break;\n          }\n        if (j == -1)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << b[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31891", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  char str1[120];\n  char str[120];\n  scanf(\"%d \", &n);\n\n  for (int i = 1; i <= n; i++) {\n    memset(str, '\\0', sizeof(str));\n    cin >> str1;\n    strcpy(str, str1);\n\n    for (int len = 1; len < strlen(str); len++) {\n      for (int j = 0; j < strlen(str) - len; j++) {\n        int k = j + len;\n        if (str[j] == '(' && str[k] == ')') {\n          str[j] = '0';\n          str[k] = '0';\n        }\n      }\n    }\n\n    for (int i1 = 0; str[i1] != '\\0'; i1++) {\n      if (str[i1] == '(')\n        str[i1] = '$';\n      else if (str[i1] == ')')\n        str[i1] = '?';\n      else\n        str[i1] = ' ';\n    }\n    cout << str1 << endl;\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31892", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint match(char c[], int n) {\n  for (int i = n + 1; i < strlen(c); i++) {\n    if (c[i] == ')') {\n      c[i] = ' ';\n      c[n] = ' ';\n      return i;\n    } else if (c[i] == '(') {\n      i = match(c, i);\n    }\n  }\n  c[n] = '$';\n  return strlen(c) - 1;\n}\nint main() {\n  char ch[110];\n  while (scanf(\"%s \", ch)) {\n    printf(\"%s\\n\", ch);\n    for (int i = 0; ch[i] != 0; i++)\n      if (ch[i] != '(' && ch[i] != ')')\n        ch[i] = ' ';\n    for (int i = 0; ch[i] != 0; i++) {\n      if (ch[i] == '(')\n        i = match(ch, i);\n      else if (ch[i] == ')')\n        ch[i] = '?';\n    }\n    printf(\"%s\\n\", ch);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[102];\n  int i, j, L, k;\n  int b[102] = {0};\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < 102; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    L = strlen(a);\n    for (i = L - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < L; j++) {\n          if (a[j] == ')')\n\n          {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n        if (j == L)\n          b[i] = 1;\n      }\n    }\n\n    for (i = 0; i < L; i++) {\n      if (a[i] == ')')\n        b[i] = 2;\n    }\n    for (i = 0; i < L; i++) {\n      if (b[i] == 1)\n        printf(\"$\");\n      else if (b[i] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n\n        for (j = i + 1; j < len; j++) {\n          if (s[j] == '(') {\n            i = j;\n          } else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n        if (j == len)\n          break;\n\n        i = -1;\n      }\n    }\n    for (q = 0; q < len; q++) {\n      if (s[q] == ')') {\n        s[q] = '?';\n      } else if (s[q] == '(') {\n        s[q] = '$';\n      } else\n        s[q] = ' ';\n    }\n    cout << ss << \" \";\n    printf(\"%s \", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[100];\n  int z, y, i, j, l, t, m;\n  while (scanf(\"%s \", sen)) {\n    z = 0;\n    y = 0;\n    l = strlen(sen);\n    printf(\"%s \", sen);\n\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        z++;\n      }\n      if (sen[i] == ')') {\n        y++;\n      }\n    }\n    if (z > y) {\n      m = y;\n    } else {\n      m = z;\n    }\n\n    for (i = 0; i < m; i++) {\n      j = 1;\n      for (t = 0; t < l; t++) {\n        if (sen[t] == '(') {\n          j = 0;\n          z = t;\n        }\n        if (sen[t] == ')') {\n          if (j == 0) {\n            sen[z] = '0';\n            sen[t] = '0';\n          }\n          j = 1;\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (sen[i] == '(') {\n        printf(\"$\");\n      } else if (sen[i] == ')') {\n        printf(\"?\");\n      } else if ((sen[i] != '(') && (sen[i] != ')')) {\n        printf(\" \");\n      }\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid braket_match(char *s);\nint main() {\n  int n, i;\n  char tmp[1000];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n\n    cin >> tmp;\n    braket_match(tmp);\n  }\n  return 0;\n}\nvoid braket_match(char *s) {\n  cout << s << \" \";\n  int j, left[1000] = {-1, -1}, left_num = 0, left0 = 1, right[1000] = {-1, -1},\n         right_num = 0, right0 = 1, LEN = strlen(s);\n  for (j = 0; j < LEN; j++) {\n    if (s[j] == '(')\n      left[++left_num] = j;\n    else if (s[j] == ')' && left_num == 0)\n      right[++right_num] = j;\n    else if (s[j] == ')' && left_num > 0)\n      left[left_num--] = -1;\n  }\n  for (j = 0; j < LEN; j++) {\n    if (j == left[left0]) {\n      printf(\"$\");\n      left0++;\n    } else if (j == right[right0]) {\n      printf(\"?\");\n      right0++;\n    } else\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31897", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint DO(char *SPE, int length) {\n  int k1 = 0;\n  char *p1 = NULL, *p2 = NULL;\n  for (int i = 0; i < length; i++) {\n    if (SPE[i] == '$') {\n      k1++;\n      p1 = SPE + i;\n    } else if (SPE[i] == '?') {\n      p2 = SPE + i;\n      if (k1 != 0) {\n        *p1 = ' ';\n        *p2 = ' ';\n        return DO(SPE, length);\n      }\n    }\n  }\n  return 0;\n}\nint main(void) {\n  char SPE[101];\n  while (~scanf(\"%s\", SPE)) {\n    puts(SPE);\n    int length = strlen(SPE);\n    for (int i = 0; i < length; i++) {\n      if (SPE[i] != '(' && SPE[i] != ')')\n        SPE[i] = ' ';\n      else if (SPE[i] == '(')\n        SPE[i] = '$';\n      else if (SPE[i] == ')')\n        SPE[i] = '?';\n    }\n    DO(SPE, length);\n    puts(SPE);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ans[100], c;\n  int stack[100], top = 0, l = 0;\n  while (scanf(\"%c\", &c) == 1) {\n    cout << c;\n    if (c == '\\n') {\n      ans[l] = '\\0';\n      cout << ans << endl;\n      top = 0;\n      l = 0;\n      continue;\n    }\n    if (c == '(') {\n      stack[top++] = l;\n      ans[l] = '$';\n      l++;\n      continue;\n    }\n    if (c == ')') {\n      if (top == 0) {\n        ans[l++] = '?';\n        continue;\n      } else {\n        ans[l++] = ' ';\n        ans[stack[--top]] = ' ';\n        continue;\n      }\n    }\n    ans[l++] = ' ';\n  }\n  cout << endl;\n  ans[l] = '\\0';\n  cout << ans << endl;\n\n  return 0;\n}\n"}
{"label": "17", "index": "31899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n  int i, j;\n\n  while (scanf(\"%s\", s) != EOF) {\n    puts(s);\n    int a[100] = {0};\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        a[i] = -1;\n      else if (s[i] == ')')\n        a[i] = 1;\n\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (a[i] == 1)\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1) {\n            a[i] = a[j] = 0;\n            break;\n          }\n    }\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        printf(\"?\");\n      else if (a[i] == -1)\n        cout << \"$\";\n      else if (a[i] == 0)\n        cout << \" \";\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint brackets(void) {\n  int chart[2][100], c, count = 0, pos, state = 0, tmp, first_left,\n                        previous_left, end_flag = 0;\n  \n  for (;; count++) {\n    c = getchar();\n    if (c == EOF)\n      return 1;\n    if (c == '\\n') {\n      break;\n    }\n    chart[0][count] = c;\n    if (c == 40) {\n      chart[1][count] = 36;\n    } \n    else if (c == 41) {\n      chart[1][count] = 63;\n    } \n    else {\n      chart[1][count] = 32;\n    } \n  }\n  for (pos = 0; end_flag == 0;) {\n    switch (state) {\n    case 0:\n      if (chart[1][pos] == 36) {\n        state = 1;           \n        first_left = pos;    \n        previous_left = pos; \n        if (pos == count) {\n          end_flag = 1;\n        } else {\n          pos += 1;\n        } \n      } else {\n        if (pos == count) {\n          end_flag = 1;\n        } \n        else {\n          pos += 1;\n        } \n      }\n      break;\n    case 1:\n      if (chart[1][pos] == 63) {\n        chart[1][pos] = 32; \n        chart[1][previous_left] = 32;\n        if (previous_left != first_left) {\n          state = 2;           \n          pos = previous_left; \n        } else {\n          if (pos == count) {\n            end_flag = 1;\n          } else {\n            state = 0;\n            pos += 1;\n          }\n        }\n      } else if (chart[1][pos] == 36) {\n        previous_left = pos; \n        pos += 1;            \n      } else {\n        if (pos == count) {\n          end_flag = 1;\n        } else {\n          pos += 1;\n        } \n      }\n      break;\n    case 2:\n      if (chart[1][pos] == 36) {\n        previous_left = pos;\n        state = 1;\n      } else {\n        pos -= 1;\n      }\n      break;\n    }\n    if (pos > count) {\n      pos = count;\n    } \n  }\n  for (tmp = 0; tmp < count; tmp++) {\n    putchar(chart[0][tmp]);\n    if (tmp == count - 1) {\n      putchar('\\n');\n    }\n  }\n  for (tmp = 0; tmp < count; tmp++) {\n    putchar(chart[1][tmp]);\n    if (tmp == count - 1) {\n      putchar('\\n');\n    }\n  }\n  return 0;\n}\nint main() {\n  while (1) {\n    if (brackets() == 1)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int n, t, s, i;\n    if (scanf(\"%s\", a) == EOF)\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')')\n        b[i] = -1;\n    for (i = 0, s = 0; i < n; i++)\n      if (b[i] == 1) {\n        t = i;\n        s = 1;\n      } else if (b[i] == -1 && s == 1) {\n        b[t] = 0;\n        b[i] = 0;\n        i = -1;\n        s = 0;\n      }\n    for (i = 0; i < n; i++)\n      if (b[i] == 1)\n        b[i] = '$';\n      else if (b[i] == -1)\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    printf(\"\\n\");\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1001];\n  int n;\n  while (~scanf(\"%s\", str)) {\n    n = strlen(str);\n    printf(\"%s\", str);\n    printf(\"\\n\");\n    for (int i = 1; i < n; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\", str);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, m, j;\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    scanf(\"%s\", a);\n    puts(a);\n    n = strlen(a);\n    course(a, n);\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar c[110], ch;\n\nvoid PMP(char c[], int len) {\n  for (int i = 0; i < len; i++) {\n    cout << c[i];\n  }\n  cout << endl;\n  int flag = 1;\n\n  while (flag) {\n    flag = 0;\n    for (int i = 0; i < len; i++) {\n      if ((c[i] != '(') && (c[i] != ')'))\n        c[i] = ' ';\n      else if (c[i] == '(') {\n        for (int j = i + 1; j < len; j++) {\n          if (c[j] == '(')\n            break;\n          if (c[j] == ')') {\n            c[i] = ' ';\n            c[j] = ' ';\n            flag = 1;\n            break;\n          } else if (j == len - 1) {\n            c[i] = '$';\n          }\n        }\n      }\n    }\n  }\n  for (int i = 0; i < len; i++) {\n    if (c[i] == '(')\n      c[i] = '$';\n    if (c[i] == ')')\n      c[i] = '?';\n  }\n\n  for (int i = 0; i < len; i++)\n    cout << c[i];\n  cout << endl;\n  return;\n}\n\nint main() {\n  int len;\n  ch = getchar();\n  while (ch != '~') {\n    len = 0;\n    while (ch != '\\n') {\n      c[len] = ch;\n      len++;\n      ch = getchar();\n    }\n    PMP(c, len);\n    ch = getchar();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint k, m = 0;\nchar a[100] = {'\\0'};\nvoid pipei(int m, char a[]) {\n  int i, j;\n  for (i = m; i <= k - 1; i++) {\n    if (a[i] == ')')\n      break;\n\n    if (a[i] != '(' && a[i] != ')')\n      a[i] = ' ';\n  }\n  m = i + 1;\n  for (j = i; j >= 0; j--) {\n    if (i == k && a[k - 1] != ')')\n      break;\n    if (a[j] == '(') {\n      a[j] = ' ';\n      a[i] = ' ';\n      break;\n    }\n  }\n  if (m <= k - 1)\n    pipei(m, a);\n}\nint main() {\n  char w;\n  while (cin >> a) {\n    k = strlen(a);\n    int i, j;\n    cout << a << endl;\n    pipei(0, a);\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (i = 0; i <= k - 1; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < 100; i++) {\n      a[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31906", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char a[102]) {\n  char b[102] = {0};\n  long l = strlen(a);\n  int i, left[102] = {0}, cnt_left = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(') {\n      cnt_left++;\n      left[cnt_left] = i;\n      b[i] = '$';\n    } else {\n      if (a[i] == ')') {\n        if (cnt_left == 0) {\n          b[i] = '?';\n        } else {\n          b[i] = ' ';\n          b[left[cnt_left]] = ' ';\n          cnt_left--;\n        }\n      } else\n        b[i] = ' ';\n    }\n  }\n  b[l] = '\\0';\n  puts(a);\n  puts(b);\n}\n\nint main() {\n  char a[102] = {0}, c;\n  int i = -1;\n  while ((c = getchar()) != EOF) {\n    if (c != '\\n') {\n      i++;\n      a[i] = c;\n    } else {\n      i++;\n      a[i] = '\\0';\n      match(a);\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31907", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, t1, t2, flag, len;\n  int b[101], l[101], r[101];\n  char s[101];\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        b[i] = 1;\n      } else {\n        b[i] = 0;\n      }\n    }\n    t1 = 0;\n    t2 = 0;\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        l[t1] = i;\n        t1++;\n      }\n      if (b[i] == 1) {\n        r[t2] = i;\n        t2++;\n      }\n    }\n    for (i = t1 - 1; i >= 0; i--) {\n      for (j = 0; j < t2; j++) {\n        if (r[j] > l[i]) {\n          b[r[j]] = 0;\n          b[l[i]] = 0;\n          r[j] = 0;\n          l[i] = 0;\n          break;\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        printf(\"$\");\n      } else {\n        if (b[i] == 1) {\n          printf(\"?\");\n        } else {\n          printf(\" \");\n        }\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31908", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  scanf(\"%d\", &n);\n  char a[100][1000];\n  for (i = 0; i < n + 1; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n + 1; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31909", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint dg(int a, int b);\n\nchar st[1000], st2[1000];\n\nint main() {\n  while (cin.getline(st, 1000)) {\n\n    st2[strlen(st)] = '\\0';\n    dg(1, 0);\n    printf(\"%s\\n%s\\n\", st, st2);\n  }\n  return 0;\n}\nint dg(int a, int b) {\n  for (int i = a; i <= strlen(st); i++) {\n\n    if (st[i - 1] == '(') {\n\n      int t = dg(i + 1, i);\n      if (t == 0) {\n        st2[i - 1] = '$';\n        break;\n      }\n      if (t > 0) {\n        st2[i - 1] = ' ';\n        i = t;\n        continue;\n      }\n    } else if (st[i - 1] == ')') {\n\n      if (b == 0)\n        st2[i - 1] = '?';\n      if (b > 0) {\n        st2[i - 1] = ' ';\n        return i;\n      }\n    } else {\n      st2[i - 1] = ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[1000];\nint judge(int, int);\nint main() {\n  for (; cin >> a;) {\n    cout << a << endl;\n    judge(0, 0);\n    cout << a << endl;\n  }\n  return 0;\n}\nint judge(int i, int l) {\n  int t;\n  if (a[i] == '\\0')\n    return -1;\n  if (a[i] == '(') {\n    t = judge(i + 1, l + 1);\n    a[i] = (t == -1) ? '$' : ' ';\n    return (t == -1) ? -1 : judge(i + 1, l);\n  }\n\n  else if (a[i] == ')') {\n    a[i] = l == 0 ? '?' : ' ';\n    return (l == 0) ? judge(i + 1, l) : i;\n  } else {\n    a[i] = ' ';\n    return judge(i + 1, l);\n  }\n}\n"}
{"label": "17", "index": "31911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char chuan[101], shuchu[100];\n  int count1, count2, length, i, j;\n  while (scanf(\"%s \", chuan)) {\n    cout << chuan << \"\\n\";\n    length = strlen(chuan);\n    strcpy(shuchu, chuan);\n    count1 = 0;\n    count2 = 0;\n    for (i = 0; i < length; i++) {\n      if (chuan[i] == '(')\n        count1++;\n      if (chuan[i] == ')') {\n        count2++;\n        if (count2 > count1) {\n          shuchu[i] = '?';\n          count2--;\n        }\n      }\n    }\n\n    count1 = 0;\n    count2 = 0;\n    for (i = length - 1; i >= 0; i--) {\n      if (chuan[i] == ')')\n        count2++;\n      if (chuan[i] == '(') {\n        count1++;\n        if (count1 > count2) {\n          shuchu[i] = '$';\n          count1--;\n        }\n      }\n    }\n    shuchu[length] = '\\0';\n    for (i = 0; i < length; i++) {\n      if (shuchu[i] != '?' && shuchu[i] != '$')\n        shuchu[i] = ' ';\n    }\n    cout << shuchu << endl;\n    memset(shuchu, 0, sizeof(shuchu));\n    memset(chuan, 0, sizeof(chuan));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31912", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic char c[2][101];\nint i, n;\nvoid search(int a) {\n  for (i++; i < n; i++)\n    if (c[0][i] == ')') {\n      c[1][a] = ' ';\n      c[1][i] = ' ';\n      break;\n    } else if (c[0][i] == '(')\n      search(i);\n    else\n      c[1][i] = ' ';\n  if (i >= n)\n    c[1][a] = '$';\n}\nint main() {\n  while (scanf(\"%s\", &c[0]) != EOF) {\n    for (n = 0; c[0][n] != '\\0'; n++)\n      ;\n    for (i = 0; i < n; i++)\n      if (c[0][i] == ')')\n        c[1][i] = '?';\n      else if (c[0][i] == '(')\n        search(i);\n      else\n        c[1][i] = ' ';\n    puts(c[0]);\n    puts(c[1]);\n    for (i = 0; i < n; i++) {\n      c[0][i] = 0;\n      c[1][i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint pp[120];\nvoid kuohao(char a[]) {\n\n  int i, j, len = strlen(a);\n  for (i = 0; i <= len - 1; i++) {\n    if (a[i] == ')') {\n      for (j = i; j >= 0; j--) {\n        if (a[j] == '(') {\n          pp[i] = 0;\n          pp[j] = 0;\n          a[i] = 'a';\n          a[j] = 'a';\n          break;\n        }\n        if (j == 0)\n          pp[i] = 1;\n      }\n      a[i] = 'a';\n      kuohao(a);\n    }\n    if (i == len - 1) {\n      for (j = 0; j <= len - 1; j++)\n        if (a[j] == '(')\n          pp[j] = -1;\n      return;\n    }\n  }\n}\n\nint main() {\n  char str[200];\n  while (cin >> str) {\n    cout << str << endl;\n    int i;\n    for (i = 0; i <= 119; i++)\n      pp[i] = 0;\n    kuohao(str);\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (pp[i] == 0)\n        cout << \" \";\n      else if (pp[i] == 1)\n        cout << \"?\";\n      else\n        cout << \"$\";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(void) {\n  while (1) {\n    char str1[100], str2[100];\n\n    cin >> str1;\n\n    if (feof(stdin))\n      break;\n\n    puts(str1);\n\n    int k, n = strlen(str1), left[100], right[100], l = 0, r = 0;\n    for (k = 0; k <= n - 1; k++) {\n      if (str1[k] == '(') {\n        left[l] = k;\n        l++;\n      } else if (str1[k] == ')') {\n        right[r] = k;\n        r++;\n      } else\n        str2[k] = ' ';\n    }\n    left[l] = 100;\n    right[r] = 100;\n    str2[n] = '\u0000';\n\n    int i, j, x = 1, y = 1;\n    for (i = l - 1; i >= 0; i--) {\n      int p = 0;\n      while (right[p] < left[i])\n        p++;\n      if (x > (r - p))\n        str2[left[i]] = '$';\n      else {\n        str2[left[i]] = ' ';\n        x++;\n      }\n    }\n    for (j = 0; j <= r - 1; j++) {\n      int q = 0;\n      while (left[q] < right[j])\n        q++;\n      if (y > q)\n        str2[right[j]] = '?';\n      else {\n        str2[right[j]] = ' ';\n        y++;\n      }\n    }\n\n    puts(str2);\n  }\n}\n"}
{"label": "17", "index": "31915", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint brackets_matching(char str[], char result[], int n, int j)\n\n{\n  int i, p;\n  for (i = j; str[i]; i++) {\n    switch (str[i]) {\n    case '(':\n      p = brackets_matching(str, result, n + 1, i + 1);\n      if (str[p] == ')')\n        result[i] = ' ';\n      else\n        result[i] = '$';\n      i = p;\n      break;\n\n    case ')':\n      if (!n)\n        result[i] = '?';\n      else {\n        result[i] = ' ';\n        return i;\n      }\n      break;\n\n    default:\n      result[i] = ' ';\n    }\n  }\n  result[i] = 0;\n  return i;\n}\n\nint main() {\n  char a[1000], result[1000];\n  while (scanf(\"%s \", a)) {\n    printf(\"%s\\n\", a);\n    brackets_matching(a, result, 0, 0);\n    printf(\"%s\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint j = 1;\nint main() {\n  char a[101];\n  a[0] = 0;\nl:\n  scanf(\"%s\", a);\n  if (a[0] == 0)\n    return 0;\n  else\n    cout << a << \"\\n\";\n  int r, i, k;\n  r = strlen(a);\n  for (i = r - 1; i >= 0; i--) {\n    if (a[i] != '(' && a[i] != ')')\n      a[i] = ' ';\n    else if (a[i] == '(') {\n      for (k = i; k <= r - 1; k++) {\n        if (a[k] == ')') {\n          a[i] = ' ';\n          a[k] = ' ';\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i <= r - 1; i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n  }\n  printf(\"%s\\n\", a);\n  return main();\n}\n"}
{"label": "17", "index": "31917", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], s0[1000], t[1000];\n  int len, i, j;\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    strcpy(s0, s);\n    for (i = 0; i < len; i++)\n      if (s0[i] == ')' && i > 0)\n        for (j = i - 1; j >= 0; j--)\n          if (s0[j] == '(') {\n            s0[i] = ' ';\n            s0[j] = ' ';\n            break;\n          }\n\n    for (i = 0; i < len; i++) {\n      if (s0[i] == '(')\n        t[i] = '$';\n      else {\n        if (s0[i] == ')') {\n          t[i] = '?';\n        } else\n          t[i] = ' ';\n      }\n    }\n\n    printf(\"%s \", s);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", t[i]);\n    putchar(' ');\n  }\n}\n"}
{"label": "17", "index": "31918", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, k, l, m, n, x;\n  while (cin.getline(a, 110)) \n  {\n    n = strlen(a);\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    cout << endl; \n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break; \n          }\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (a[k] != '(' && a[k] != ')') {\n        a[k] = ' ';\n      }\n      if (a[k] == '(') {\n        a[k] = '$';\n      }\n      if (a[k] == ')') {\n        a[k] = '?';\n      } \n    }\n    for (m = 0; m < n; m++) {\n      cout << a[m]; \n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[101];\n  char str2[101];\n  int a[101];\n  int l, i, j, temp;\n  while (scanf(\"%s \", str1)) {\n    l = strlen(str1);\n    for (i = 0; i < l; i++) {\n      if (str1[i] == '(')\n        a[i] = 1;\n      else if (str1[i] == ')')\n        a[i] = -1;\n      else\n        a[i] = 0;\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) {\n        temp = 0;\n        for (j = i; j < l; j++) {\n          temp = temp + a[j];\n          if (temp == 0) {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) {\n        str2[i] = '$';\n      } else if (a[i] == -1)\n        str2[i] = '?';\n      else\n        str2[i] = ' ';\n    }\n    str2[l] = '\\0';\n    cout << str1 << endl;\n    printf(\"%s\\n\", str2);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31920", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar a[110];\nint match(int i) {\n  int j;\n  int l = strlen(a);\n  if (i == l)\n    return 0;      \n  if (a[i] == '?') \n  {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == '$') {\n        \n        a[j] = ' ';\n        a[i] = ' ';\n        break; \n      }\n    }\n  }\n  match(i + 1);\n  return 0;\n}\nint main() {\n  int l;\n  int i;\n  while (scanf(\"%s\", a) != EOF) {\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) \n    {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    match(1);\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar p[200], q[200];\nint main() {\n  while (scanf(\"%s\", &p) != EOF) {\n    memset(q, ' ', sizeof(q));\n    int l = strlen(p);\n    q[l] = 0;\n    int t = 0;\n    for (int i = 0; i < l; i++) {\n      if (p[i] == '(')\n        t++;\n      else if (p[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '?';\n      }\n    }\n    t = 0;\n    for (int i = l - 1; i >= 0; i--) {\n      if (p[i] == ')')\n        t++;\n      else if (p[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '$';\n      }\n    }\n    cout << p << \"\\n\" << q << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n\n    scanf(\"%s \", a);\n    t = strlen(a);\n    show(a, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  char kuohao[101] = {0};\n  int i, j, len;\n  char ch;\n  while (scanf(\"%s\", s) > 0) {\n    for (i = 0;; i++) {\n      if (s[i] == '(')\n        kuohao[i] = 1;\n      else if (s[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (kuohao[j] == 1) {\n            kuohao[j] = 0;\n            break;\n          }\n        }\n        if (j < 0)\n          kuohao[i] = 3;\n      } else if (s[i] == '\\0')\n        break;\n    }\n    printf(\"%s\\n\", s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (kuohao[i] == 0)\n        printf(\" \");\n      else if (kuohao[i] == 1)\n        printf(\"$\");\n      else if (kuohao[i] == 3)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      kuohao[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint len;\nchar st[101], ans[101];\n\nint work(int pos) {\n  for (int i = pos + 1; i < len; i++)\n    if (st[i] == '(')\n      i = work(i);\n    else {\n      if (st[i] == ')') {\n        ans[pos] = '(';\n        ans[i] = ')';\n        return i;\n      }\n    }\n  return len - 1;\n}\n\nint main() {\n  int i;\n  while (scanf(\"%s \", st)) {\n    cout << st << endl;\n    len = strlen(st);\n    memset(ans, 0, sizeof(ans));\n    for (i = 0; i < len; i++)\n      if (st[i] == '(')\n        i = work(i);\n    for (i = 0; i < len; i++)\n      switch (st[i]) {\n      case '(':\n        ans[i] = (ans[i] == '(') ? ' ' : '$';\n        break;\n      case ')':\n        ans[i] = (ans[i] == ')') ? ' ' : '?';\n        break;\n      default:\n        ans[i] = ' ';\n      }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500], b[500] = {0};\n  int i, j, jud[500] = {0};\n  for (i = 0; i < 500; i++) {\n    a[i] = 0;\n    jud[i] = 0;\n  }\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < 500; i++) {\n      b[i] = 0;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      b[i] = ' ';\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(' && jud[j] == 0) {\n            jud[j] = 1;\n            jud[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(' && jud[i] == 0) {\n        b[i] = '$';\n      }\n      if (a[i] == ')' && jud[i] == 0) {\n        b[i] = '?';\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n    for (i = 0; i < 500; i++) {\n      a[i] = 0;\n      jud[i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "31926", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid check() {\n  char array[103];\n  while (cin) {\n    cin.getline(array, 103);\n    int i, j, len;\n    len = strlen(array);\n    for (i = 0; i < len; i++)\n      cout << array[i];\n    cout << endl;\n    for (i = 0; i < len; i++) {\n      if (array[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (array[j] == '(') {\n            array[j] = '1';\n            array[i] = '1';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (array[i] != '(' && array[i] != ')') {\n        printf(\" \");\n      }\n      if (array[i] == '(')\n        cout << '$';\n      if (array[i] == ')')\n        cout << '?';\n    }\n    cout << endl;\n  }\n  return;\n}\n\nint main() {\n  check();\n  return 0;\n}\n"}
{"label": "17", "index": "31927", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, len;\n  int i;\n  while (cin.getline(line, 101)) {\n    pos_i = -1, left = 0;\n    right = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos[++pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid right(int i, int j) {\n  if (s[i] == '\\0')\n    ;\n  else if (s[i] == '(') {\n    s[i] = '$';\n    right(i + 1, j + 1);\n  } else if (s[i] == ')') {\n    if (j == 0) {\n      s[i] = '?';\n      right(i + 1, j);\n    } else {\n      for (int k = i;; k--)\n        if (s[k] == '$') {\n          s[k] = ' ';\n          break;\n        }\n      s[i] = ' ';\n      right(i + 1, j - 1);\n    }\n  } else {\n    s[i] = ' ';\n    right(i + 1, j);\n  }\n}\nint main() {\n  for (; scanf(\"%s \", s);) {\n    cout << s << endl;\n    right(0, 0);\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31929", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p[109];\n  char s[110], t[110];\n  while (scanf(\"%s\", s) != EOF) {\n    for (i = 0; i < 109; i++)\n      p[i] = 0;\n    strcpy(t, s);\n    for (i = 0, j = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        p[j++] = i;\n      if (s[i] == ')' && j > 0)\n        s[p[j-- - 1]] = s[i] = ' ';\n      if (s[i] != '(' && s[i] != ')')\n        s[i] = ' ';\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", t, s);\n  }\n}\n"}
{"label": "17", "index": "31930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  while (cin >> a) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 0; j--)\n          if (a[j] == '(') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '(')\n        cout << '$';\n      else if (a[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l;\n  char as[110], bs[110], cs[110];\n  for (k = 0;; k++) {\n    scanf(\"%s\", as);\n    int len = strlen(as);\n    if (strcmp(as, bs) == 0)\n      break;\n    strcpy(bs, as);\n    for (i = 0; i < len; i++)\n      cs[i] = ' ';\n    cs[len] = 0;\n    for (l = 0; l < len; l++) {\n      for (i = l; i < len; i++) {\n        if (as[i] == ')') {\n          for (j = i; j >= 0; j--) {\n            if (as[j] == '(') {\n              as[i] = ' ';\n              as[j] = ' ';\n              j = 0;\n              i = 0;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (as[i] == '(')\n        cs[i] = '$';\n      else if (as[i] == ')')\n        cs[i] = '?';\n    }\n    cout << bs << \"\\n\" << cs << \"\\n\";\n    strcpy(bs, as);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a, t = 0;\nchar A[110] = {'\\0'};\nvoid cal(int m) {\n  while (t <= a) {\n    if (A[t] == '(') {\n      cal(t++);\n    } else if (A[t] == ')') {\n      A[m] = 'a';\n      A[t++] = 'a';\n      break;\n    } else\n      t++;\n  }\n}\nint main() {\n  while (cin >> A) {\n    char B[110];\n    a = strlen(A) - 1;\n    for (int i = 0; i <= a; i++)\n      B[i] = A[i];\n    t = 0;\n    while (t <= a)\n      if (A[t++] == '(')\n        cal(t - 1);\n\n    for (int i = 0; i <= a; i++)\n      cout << B[i];\n    cout << '\\n';\n    for (int i = 0; i <= a - 1; i++) {\n      if (A[i] == '(')\n        cout << '$';\n      if (A[i] == ')')\n        cout << '?';\n      if (A[i] != '(' && A[i] != ')')\n        cout << \" \";\n    }\n    if (A[a] == '(')\n      cout << '$' << endl;\n    if (A[a] == ')')\n      cout << '?' << endl;\n    if (A[a] != '(' && A[a] != ')')\n      cout << \" \" << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ans[100], c;\n  int stack[100], top = 0, l = 0;\n  while (scanf(\"%c\", &c) == 1) {\n    printf(\"%c\", c);\n    if (c == '\\n') {\n      ans[l] = '\\0';\n      cout << ans << endl;\n      top = 0;\n      l = 0;\n      continue;\n    }\n    if (c == '(') {\n      stack[top++] = l;\n      ans[l] = '$';\n      l++;\n      continue;\n    }\n    if (c == ')') {\n      if (top == 0) {\n        ans[l++] = '?';\n        continue;\n      } else {\n        ans[l++] = ' ';\n        ans[stack[--top]] = ' ';\n        continue;\n      }\n    }\n    ans[l++] = ' ';\n  }\n  cout << endl;\n  ans[l] = '\\0';\n  cout << ans << endl;\n\n  return 0;\n}\n"}
{"label": "17", "index": "31934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar s[100];\nint temp[100];\nint addition[100];\nint flag, i, j;\nint f() {\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == '(') {\n      s[i] = '$';\n      addition[flag] = i;\n      flag++;\n    } else if (s[i] == ')') {\n      if (flag) {\n        s[i] = ' ';\n        flag--;\n        s[addition[flag]] = ' ';\n      } else\n        s[i] = '?';\n    } else\n      s[i] = ' ';\n  }\n}\nint main() {\n  while (cin >> s) {\n    cout << s << endl;\n    flag = 0;\n    f();\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31935", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[1000];\nint dp[1000];\nint main(void) {\n  \n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  while (scanf(\"%s\", s) == 1) {\n    memset(dp, 0, sizeof(dp));\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        dp[i] = -1;\n      if (s[i] == ')')\n        dp[i] = 1;\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(' && dp[j] == -1) {\n            dp[i] = 0;\n            dp[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < n; i++) {\n      if (dp[i] == -1)\n        printf(\"$\");\n      else if (dp[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, c, d, e, f, g, k, j, l, b[100];\n  cin >> n;\n  char a[1000][150], h[1000][150];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a[i]);\n    b[i] = strlen(a[i]);\n    e = 0;\n    for (j = 0; j < b[i]; j++) {\n      if (a[i][j] == '(') {\n        h[i][j] = '$';\n        e++;\n      }\n      if (a[i][j] == ')') {\n        h[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')')\n        h[i][j] = ' ';\n    }\n    for (l = 0; l < e; l++) {\n      for (j = 0; j < b[i]; j++) {\n        c = f = d = -1;\n        if (h[i][j] == '$') {\n          c = j;\n          g = c;\n          for (g = c; g < b[i]; g++) {\n            if (h[i][g] == '?') {\n              f = g;\n              break;\n            }\n          }\n          for (k = f - 1; k >= c; k--) {\n            if (h[i][k] == '$') {\n              d = k;\n              break;\n            }\n          }\n          if (d != -1 && f != -1) {\n            h[i][d] = ' ';\n            h[i][f] = ' ';\n          }\n          break;\n        }\n      }\n    }\n    for (j = 0; j < b[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    cout << \"\\n\";\n    for (j = 0; j < b[i]; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110];\n  int length, i = 0;\n  while (1) {\n    cin.get(str, 110, '\\n');\n    if (cin.get() == EOF)\n      break;\n    length = strlen(str);\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    printf(\"\\n\");\n    for (i = length - 1; i >= 0; i--) {\n      if (str[i] != '(' && str[i] != ')') {\n        str[i] = ' ';\n      } else if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i; j < length; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n    }\n    for (i = 0; i < length; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  char a[101];\n  int i, j, flag;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    cout << a << \"\\n\";\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == 40) {\n        if (i == strlen(a) - 1)\n          printf(\"$\");\n        else {\n          flag = 1;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (a[j] == 41 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 41 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 40) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"$\");\n        }\n      }\n\n      else if (a[i] == 41) {\n        if (i == 0)\n          cout << \"?\";\n        else {\n          flag = 1;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == 40 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 40 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 41) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            cout << \"?\";\n        }\n      }\n\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string1[101];\n  while (cin.getline(string1, 101)) {\n\n    printf(\"%s\\n\", string1);\n\n    for (int i = 1; i < strlen(string1); i++) {\n      if (string1[i] == ')') {\n\n        for (int j = i - 1; j >= 0; j--) {\n          if (string1[j] == '(') {\n            string1[i] = ' ';\n            string1[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int k = 0; k < strlen(string1); k++) {\n      if (string1[k] == '(')\n        cout << \"$\";\n      else if (string1[k] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31940", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, k, l, m, n, x;\n  while (cin.getline(a, 110)) {\n    n = strlen(a);\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    cout << \"\\n\";\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (a[k] != '(' && a[k] != ')') {\n        a[k] = ' ';\n      }\n      if (a[k] == '(') {\n        a[k] = '$';\n      }\n      if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200];\n  while (cin.getline(a, 200)) {\n    int n = strlen(a);\n    int k;\n    cout << a << endl;\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '?')\n        a[i] = ' ';\n      if (a[i] == '$')\n        a[i] = ' ';\n      if (a[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if (a[k] == '(') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n        if (k < 0)\n          a[i] = '?';\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {'\\0'};\n  while (cin.getline(str, 110, '\\n')) {\n    int length;\n    length = strlen(str);\n    for (int i = 0; i < length; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = length - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        for (int j = i + 1; j < length; j++) {\n          if (str[j] == '?') {\n            str[j] = ' ';\n            str[i] = ' ';\n            break;\n          }\n        }\n      } else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    for (int i = 0; i < length; i++)\n      printf(\"%c\", str[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31943", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l;\n  char c[101];\n  int left = 0, right = 0;\n  int e[101] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    left = 0;\n    right = 0;\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      e[j] = 0;\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        cout << \"$\";\n      else if (e[j] == 2)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char a[101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    for (i = strlen(a) - 2; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++) {\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        putchar('$');\n      else if (a[i] == ')')\n        putchar('?');\n      else\n        putchar(' ');\n    }\n    putchar('\\n');\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int zuo[110] = {0}, z = 0;\n    int you[110] = {0}, y = 0;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        zuo[z++] = i;\n      if (a[i] == ')')\n        you[y++] = i;\n    }\n    for (int i = 0; i < y; i++) {\n      for (int j = z - 1; j >= 0; j--) {\n        if (zuo[j] < you[i]) {\n          zuo[j] = 200;\n          you[i] = -100;\n          break;\n        }\n      }\n    }\n    for (int j = 0; j < strlen(a); j++) {\n      a[j] = ' ';\n    }\n    for (int j = 0; j < z; j++) {\n      if (zuo[j] != 200)\n        a[zuo[j]] = '$';\n    }\n    for (int j = 0; j < y; j++) {\n      if (you[j] != -100)\n        a[you[j]] = '?';\n    }\n\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else {\n      s[i] = ' ';\n    }\n  }\n  return;\n}\n\nint main() {\n  char live[101]; \n  while (cin >> live) {\n    cout << live << endl;\n    Find(live);\n    cout << live << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i, n;\n  char s[101], a[101];\n  scanf(\"%d\", &n);\n  while (cin >> s) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      cout << a[i];\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, n1, n2;\n  int k[100];\n  char a[100][100], b[100];\n  i = 0;\n  while (cin >> a[i]) {\n    k[i] = strlen(a[i]);\n    if (k[i] == 0)\n      break;\n    i++;\n  }\n  t = i;\n  for (i = 0; i < t; i++) {\n    n1 = 0;\n    n2 = 0;\n    for (j = 0; j < k[i]; j++) {\n      b[j] = ' ';\n    }\n    for (j = 0; j < k[i]; j++) {\n      if (n1 < 0)\n        n1 = 0;\n      if (a[i][j] == '(')\n        n1++;\n\n      if (a[i][j] == ')') {\n        if (n1 == 0) {\n          b[j] = '?';\n        }\n        n1--;\n      }\n    }\n    for (j = k[i] - 1; j >= 0; j--) {\n      if (n2 < 0)\n        n2 = 0;\n      if (a[i][j] == ')') {\n        n2++;\n      }\n      if (a[i][j] == '(') {\n        if (n2 == 0) {\n          b[j] = '$';\n        }\n        n2--;\n      }\n    }\n    for (j = 0; j < k[i]; j++) {\n      cout << a[i][j];\n    }\n    cout << endl;\n    for (j = 0; j < k[i]; j++) {\n      cout << b[j];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31949", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120];\n  while (scanf(\"%s \", s)) {\n    char res[120];\n    int lens;\n    int leftnum = 0;\n    int left[120];\n    lens = strlen(s);\n    for (int i = 0; i < lens; i++)\n      res[i] = ' ';\n    for (int i = 1; i < 120; i++)\n      left[i] = -1;\n    for (int i = 0; i < lens; i++) {\n      if (s[i] == '(')\n        left[++leftnum] = i;\n      if (s[i] == ')') {\n        if (leftnum == 0) {\n          res[i] = '?';\n        } else {\n          left[leftnum] = -1;\n          leftnum--;\n        }\n      }\n    }\n    for (int i = 1; i <= leftnum; i++) {\n      res[left[i]] = '$';\n    }\n    for (int i = 0; i < lens; i++)\n      cout << s[i];\n    cout << endl;\n    for (int i = 0; i < lens; i++)\n      cout << res[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31950", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p[109];\n  char s[110], t[110];\n  while (scanf(\"%s\", s) != EOF) {\n    for (i = 0; i < 109; i++)\n      p[i] = 0;\n    strcpy(t, s);\n    for (i = 0, j = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        p[j++] = i;\n      if (s[i] == ')' && j > 0)\n        s[p[j-- - 1]] = s[i] = ' ';\n      if (s[i] != '(' && s[i] != ')')\n        s[i] = ' ';\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    printf(\"%s\\n%s\\n\", t, s);\n  }\n}\n"}
{"label": "17", "index": "31951", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char a[102];\n  int i, j, L, k;\n  int b[102] = {0};\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < 102; i++) {\n      a[i] = 0;\n      b[i] = 0;\n    }\n    cin >> a;\n    printf(\"%s\\n\", a);\n    L = strlen(a);\n    for (i = L - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < L; j++) {\n          if (a[j] == ')')\n\n          {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n        if (j == L)\n          b[i] = 1;\n      }\n    }\n\n    for (i = 0; i < L; i++) {\n      if (a[i] == ')')\n        b[i] = 2;\n    }\n    for (i = 0; i < L; i++) {\n      if (b[i] == 1)\n        printf(\"$\");\n      else if (b[i] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l;\n  char s[102];\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    cout << s << \"\\n\";\n    for (i = 0; i < l; i++)\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')') {\n        s[i] = '?';\n        for (j = i - 1; j > -1; j--)\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n      } else\n        s[i] = ' ';\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, p, m;\n  char a[200], b[200], c[200];\n  i = 0;\n  while (cin >> a) {\n    puts(a);\n    k = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[strlen(a)] = '\u0000';\n    c[strlen(a)] = '\u0000';\n    for (i = 0; i < strlen(a); i++) {\n      c[i] = b[i];\n    }\n    for (p = 0; p < strlen(a); p++) {\n      k = 0;\n      for (i = 0; i < strlen(a); i++) {\n        if (b[i] == ' ')\n          continue;\n        else if (b[i] == '$') {\n          k++;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (b[j] == ' ')\n              continue;\n            else if (b[j] == '?') {\n              b[i] = ' ';\n              b[j] = ' ';\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            } else if (b[j] == '$')\n              break;\n          }\n        } else if (b[i] == '?' && k == 0)\n          c[i] = '?';\n      }\n    }\n    puts(c);\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int n, t, s, i;\n    if (scanf(\"%s\", a) == EOF)\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')')\n        b[i] = -1;\n    for (i = 0, s = 0; i < n; i++)\n      if (b[i] == 1) {\n        t = i;\n        s = 1;\n      } else if (b[i] == -1 && s == 1) {\n        b[t] = 0;\n        b[i] = 0;\n        i = -1;\n        s = 0;\n      }\n    for (i = 0; i < n; i++)\n      if (b[i] == 1)\n        b[i] = '$';\n      else if (b[i] == -1)\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "31955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, p;\n  char str[10001], a[2000], b[2000], c[2000];\n  while (cin >> str) {\n    n = strlen(str);\n    strcpy(a, str);\n    for (i = 0; i < n; i++)\n      c[i] = ' ';\n    for (i = 0; i < n; i++)\n      if (a[i] == ')') {\n        p = 0;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '?';\n      }\n    for (i = n - 1; i >= 0; i--)\n      if (a[i] == '(') {\n        p = 0;\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '$';\n      }\n    puts(str);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", c[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "31956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100][100], str2[100][100] = {'\\0'};\n  int i, j, k, l1, l2, t[100], l;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", str1[i]);\n    k = strlen(str1[i]);\n    if (k == 0)\n      break;\n    puts(str1[i]);\n    l1 = 0;\n    l2 = 0;\n    for (j = 0; j < k; j++) {\n      if (str1[i][j] == ')') {\n        t[l2] = j;\n        l2++;\n      }\n    }\n    for (l = 0; l < l2; l++) {\n      for (j = t[l]; j >= 0; j--) {\n        if (str1[i][j] == '(') {\n          str1[i][t[l]] = 'A';\n          str1[i][j] = 'A';\n          break;\n        }\n      }\n    }\n    for (j = 0; j < k; j++) {\n      if (str1[i][j] == '(')\n        str2[i][j] = '$';\n      else if (str1[i][j] == ')')\n        str2[i][j] = '?';\n      else\n        str2[i][j] = ' ';\n    }\n    puts(str2[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101];\n  int left[100] = {0}, right[100] = {0};\n  while (cin >> line) {\n    int i, k1 = 0, k2 = 0;\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '(') {\n        left[k1] = i;\n        k1++;\n      }\n      if (line[i] == ')') {\n        if (k1 != 0) {\n          left[k1 - 1] = 0;\n          k1--;\n        } else {\n          right[k2] = i;\n          k2++;\n        }\n      }\n    }\n    char ans[101];\n    for (i = 0; i < strlen(line); i++) {\n      ans[i] = ' ';\n    }\n    ans[strlen(line)] = '\\0';\n    for (i = 0; i < k1; i++) {\n      ans[left[i]] = '$';\n    }\n    for (i = 0; i < k2; i++)\n      ans[right[i]] = '?';\n\n    cout << line << endl;\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[105];\nint len;\nint f(int b) {\n  for (int i = b + 1; i < len; i++) {\n    if (s[i] == ')') {\n      s[b] = '$';\n      s[i] = '?';\n      return i;\n    } else if (s[i] == '(')\n      i = f(i);\n  }\n  return len - 1;\n}\nint main() {\n  while (cin >> s) {\n    len = strlen(s);\n    cout << s << endl;\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        i = f(i);\n    }\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(')\n        cout << '$';\n      else if (s[i] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[150];\nint l, j;\nvoid left(int i) {\n  int jj;\n\n  if (i == l - 1) {\n    a[i] = '$';\n    return;\n  }\n  for (jj = i + 1; jj < l; jj++) {\n\n    if (a[jj] == ')') {\n      a[jj] = ' ';\n      a[i] = ' ';\n      break;\n    } else if (a[jj] == '(') {\n      left(jj);\n    }\n  }\n  if (jj == l) {\n    a[i] = '$';\n  }\n\n  return;\n}\nvoid match(int i) {\n\n  if (i == l) {\n    for (int ii = 0; ii < l; ii++) {\n      if (a[ii] == '(') {\n        a[ii] = '$';\n      }\n      if (a[ii] == ')') {\n        a[ii] = '?';\n      }\n    }\n    return;\n  } else {\n    if (i == l - 1 && a[i] == '(') {\n      a[i] = '$';\n    }\n    if ((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z'))\n      a[i] = ' ';\n    else if (a[i] == '(') {\n      left(i);\n    }\n    match(i + 1);\n  }\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    l = strlen(a);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    cout << endl;\n    match(0);\n    for (int k = 0; k < l; k++)\n      cout << a[k];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint process(void);\nint main(void) {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    process();\n  return 0;\n}\n\nint process(void) {\n  char str[105], tstr[105] = {0};\n  cin >> str;\n  int len = strlen(str);\n  int count = 0;\n  for (int i = 0; i < len; i++) {\n    if (str[i] == '(')\n      count++;\n    else if (str[i] == ')') {\n      if (count > 0)\n        count--;\n      else\n        tstr[i] = '?';\n    }\n  }\n  count = 0;\n  for (int i = len - 1; i >= 0; i--) {\n    if (str[i] == ')')\n      count++;\n    else if (str[i] == '(') {\n      if (count > 0)\n        count--;\n      else {\n        tstr[i] = '$';\n      }\n    }\n  }\n  cout << str;\n  cout << endl;\n  for (int i = 0; i < len; i++) {\n    if (tstr[i])\n      cout << tstr[i];\n    else\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "17", "index": "31961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid match(char s[]) {\n  char b[101];\n  puts(s);\n  int l, x = 0, i, left[101];\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    b[i] = ' ';\n  b[l] = '\u0000';\n  for (i = 0; i < l; i++)\n    if (s[i] == '(')\n      left[x++] = i;\n    else if (s[i] == ')') {\n      if (x == 0)\n        b[i] = '?';\n      else\n        x--;\n    }\n  for (i = 0; i < x; i++)\n    b[left[i]] = '$';\n  puts(b);\n}\nint main() {\n  char a[101];\n  while ((cin >> a)) {\n    match(a);\n  }\n}\n"}
{"label": "17", "index": "31962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  while (scanf(\"%s \", a)) {\n    cout << a;\n    cout << endl;\n    int len, i, j;\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == ')') {\n            a[i] = 'A';\n            a[j] = 'B';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else {\n        if (a[i] == ')')\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31963", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101] = {0};\n  while ((scanf(\"%s\", s) != EOF)) {\n    int i, j;\n    int you = 0;\n    int l1 = strlen(s);\n    char a[101];\n    strcpy(a, s);\n    for (i = l1 - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        you = 0;\n        for (j = i + 1; j < l1; j++) {\n\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            you = you + 1;\n            break;\n          }\n        }\n        if (you == 0)\n          s[i] = '$';\n      }\n    }\n    puts(a);\n\n    for (i = 0; i < l1; i++) {\n      if (s[i] == '?' || s[i] == '$')\n        printf(\"%c\", s[i]);\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char b[101];\n  while (cin.getline(b, 101)) {\n    j = 0;\n    int c[100] = {0}, a[100] = {0};\n    n = strlen(b);\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(') {\n        a[j] = i + 1;\n        j++;\n      }\n      if (b[i] == ')') {\n        if (j > 0) {\n          j--;\n          a[j] = a[j + 1];\n        } else\n          c[i] = 1;\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < j; i++)\n      c[a[i] - 1] = 2;\n    for (i = 0; i < n; i++) {\n      if (c[i] == 1)\n        cout << \"?\";\n      else {\n        if (c[i] == 2)\n          cout << \"$\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "31965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar c[120], ch;\nint n;\nint search(int p) {\n  int q = p + 1;\n  if (q >= n)\n    return q;\n  while ((c[q] != '?') && (q < n)) {\n    if (c[q] == '$')\n      q = search(q) + 1;\n    else\n      q++;\n  }\n  if (q < n) {\n    c[p] = ' ';\n    c[q] = ' ';\n  }\n  return q;\n}\nint main() {\n  int i = 0;\n  while (scanf(\"%c \", &ch)) {\n    cout << ch;\n    n = 0;\n    i = 0;\n    while (ch != '\\n') {\n      if (ch == '(')\n        c[n] = '$';\n      else {\n        if (ch == ')')\n          c[n] = '?';\n        else\n          c[n] = ' ';\n      }\n      n++;\n      cin.get(ch);\n      cout << ch;\n    }\n    while (i < n) {\n      while ((c[i] != '$') && (i < n))\n        i++;\n      i = search(i) + 1;\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31966", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid peidui(char str[], int len);\nint main() {\n  int n, i;\n  char s[1000], s1[5];\n  scanf(\"%d \", &n);\n\n  cin >> s1;\n  for (i = 1; i <= n; i++) {\n\n    cin >> s;\n    puts(s);\n    peidui(s, strlen(s));\n  }\n}\nvoid peidui(char str[], int len) {\n  int a1[500], n1, n2, m, i1, i2;\n  n1 = 0;\n  char *p;\n  char mark[1000];\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(') {\n      a1[n1] = m;\n      n1++;\n    }\n    mark[m] = ' ';\n  }\n  for (i1 = n1 - 1; i1 >= 0; i1--) {\n    int exist;\n    exist = 0;\n    for (i2 = a1[i1] + 1; i2 <= len - 1; i2++) {\n      if (str[i2] == ')' && mark[i2] != 'm') {\n        exist = 1;\n        mark[i2] = 'm';\n        mark[a1[i1]] = 'm';\n        break;\n      }\n    }\n    if (a1[i1] == len - 1) {\n      mark[len - 1] = '$';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (str[m] == '(' && mark[m] != 'm') {\n      mark[m] = '$';\n    }\n    if (str[m] == ')' && mark[m] != 'm') {\n      mark[m] = '?';\n    }\n  }\n  for (m = 0; m <= len - 1; m++) {\n    if (mark[m] == 'm')\n      printf(\"%c\", ' ');\n    else\n      printf(\"%c\", mark[m]);\n  }\n  printf(\" \");\n}\n"}
{"label": "17", "index": "31967", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a;\nchar str[100];\nvoid find(void);\nint main() {\n  int i;\n  while (cin >> str) {\n    cout << str << endl;\n    a = strlen(str);\n    find();\n    for (i = 0; i < a; i++) {\n      if (str[i] == '(')\n        cout << \"$\";\n      else {\n        if (str[i] == ')')\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\nvoid find(void) {\n  int i = 0;\n  int p = -1, q = -1;\n  for (i = 0; i < a; i++) {\n    if (str[i] != '(' && str[i] != ')') {\n      str[i] = '\\0';\n    }\n    if (str[i] == '(')\n      p = i;\n    if (p != -1 && str[i] == ')') {\n      q = i;\n      break;\n    }\n  }\n  if (p != -1 && q != -1) {\n    str[p] = '\\0';\n    str[q] = '\\0';\n    find();\n  }\n}\n"}
{"label": "17", "index": "31968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[1000], temp[1000];\n  int b[1000];\n  int i, n = 0, m = 0, len, j;\n  memset(temp, 2, sizeof(temp));\n  while (1) {\n    m = 0;\n    n = 0;\n    scanf(\"%s\", s);\n    if (strcmp(temp, s) == 0)\n      break;\n    else\n      strcpy(temp, s);\n    memset(b, 0, sizeof(b));\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        n++;\n      else if (s[i] == ')' && n > 0) {\n        n--;\n        b[i] = 1;\n      }\n    }\n    for (j = len - 1; j >= 0; j--) {\n      if (s[j] == ')')\n        m++;\n      else if (s[j] == '(' && m > 0) {\n        m--;\n        b[j] = 1;\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == 0 && s[i] == ')')\n        cout << \"?\";\n      else if (b[i] == 0 && s[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ch[101];\n  int i, a[101], k, j;\n  for (i = 0; i <= 100; i++)\n    a[i] = 1;\n  while (scanf(\"%s\", ch) != EOF) {\n    puts(ch);\n    i = 0;\n    do {\n      if ((ch[i] >= 'a' && ch[i] <= 'z') || (ch[i] >= 'A' && ch[i] <= 'Z'))\n        a[i] = 0;\n      if (ch[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if ((ch[k] == '(') && a[k] == 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    } while (ch[i] != '\\0');\n    j = i - 1;\n    for (i = 0; i <= j; i++) {\n      if (a[i] == 0)\n        cout << \" \";\n      else {\n        if (ch[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\"\\n\");\n    for (i = 0; i <= 100; i++) {\n      a[i] = 1;\n      ch[i] = 'a';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31970", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100];\n  int len, i, j, a[100];\n  while (scanf(\"%s\", c) != EOF) {\n    if (c[0] == '\\0')\n      break;\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == -1) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      } else\n        a[i] = 0;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n      if (a[i] == 0)\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31971", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f1(char zichuan[], int changdu) {\n  int i, n;\n  for (i = changdu - 1; i >= 0; i--) {\n    if (zichuan[i] == '(') {\n      n = i + 1;\n      while (zichuan[n] != ')') {\n        n = n + 1;\n      }\n      if (n < changdu) {\n        zichuan[i] = ' ';\n        zichuan[n] = ' ';\n      }\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int i = 0, changdu;\n  char s[100];\n  while (scanf(\"%s \", s)) {\n    changdu = strlen(s);\n    printf(\"%s \", s);\n    f1(s, changdu);\n    for (i = 0; i < changdu; i++) {\n      switch (s[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        break;\n      default:\n        s[i] = ' ';\n        break;\n      }\n    }\n    for (i = 0; i < changdu; i++)\n      printf(\"%c\", s[i]);\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int left, right, pos[101], pos1[101], i;\n  while (cin >> a) {\n    left = right = 0;\n    memset(pos, 0, sizeof(pos));\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (a[i] == ')') {\n        if (left == 0) {\n          right++;\n          pos1[right] = i;\n        } else {\n          pos[left] = 200;\n          left--;\n        }\n      }\n    }\n    for (i = 1; i <= left; i++)\n      a[pos[i]] = 1;\n    for (i = 1; i <= right; i++)\n      a[pos1[i]] = 2;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 1 && a[i] != 2)\n        printf(\" \");\n      else {\n        if (a[i] == 1)\n          cout << \"$\";\n        else\n          cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint getlength(char *a) {\n  int i = 0;\n  while (a[i] != '\\0')\n    i++;\n  return i;\n}\nvoid chuli(char ch[], int a[], int n) {\n  for (int i = 0; i < n; i++) {\n    switch (ch[i]) {\n    case '(':\n      a[i] = 1;\n      break;\n    case ')':\n      a[i] = -1;\n      break;\n    default:\n      a[i] = 0;\n      break;\n    }\n  }\n}\nvoid pipei(int a[], int n) {\n  for (int k = 0; k < n; k++) {\n    if (a[k] == 1) {\n      int s = 0;\n      for (int i = 0; i < k; i++)\n        s += a[i];\n      for (int i = k; i < n; i++) {\n        if (a[i] == -1) {\n          int t = 0;\n          for (int j = 0; j < i; j++)\n            t += a[j];\n          if (s == t - 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n  }\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    int a[110];\n    int n = getlength(ch);\n    chuli(ch, a, n);\n    pipei(a, n);\n    cout << ch << endl;\n    for (int i = 0; i < n; i++) {\n      switch (a[i]) {\n      case 1:\n        cout << '$';\n        break;\n      case -1:\n        cout << '?';\n        break;\n      case 0:\n        cout << ' ';\n        break;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, n;\n  char a[200];\n  while (cin.get(a, 200)) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')') {\n        a[i] = '?';\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      } else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << \"\\n\";\n    cin.get();\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31975", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, b, k, t, m, p;\n  char a[1000] = {0};\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    cin >> a;\n    printf(\"%s\\n\", a);\n    b = strlen(a);\n    for (m = 0; m < b; m++) {\n      if (a[m] != '(' && a[m] != ')') {\n        a[m] = ' ';\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (a[i] == ')') {\n        for (t = i; t >= 0; t--) {\n          if (a[t] == '(') {\n            a[i] = ' ';\n            a[t] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < b; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } else if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j;\n  char A[200];\n  while (cin.getline(A, 200, '\\n')) {\n    cout << A << endl;\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '(')\n        A[i] = '$';\n      else {\n        if (A[i] == ')')\n          A[i] = '?';\n        else {\n          A[i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (A[j] == '$') {\n            A[i] = ' ';\n            A[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << A << \"\\n\";\n    memset(A, '\\0', sizeof(A));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int left = 0, right = 0;\n  int times = 0, i;\n  char s[101];\n  char c[101];\n  char fakes[101];\n\n  for (times = 0; times == 0; i = 0, left = 0, right = 0) {\n    scanf(\"%s\", s);\n    if (strcmp(fakes, s) == 0 && strlen(fakes) == strlen(s)) {\n      break;\n    }\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(') {\n        left++;\n      }\n      if (s[i] == ')' && left > 0) {\n        left--;\n      } else if (s[i] == ')' && left == 0)\n        c[i] = '?';\n    }\n    for (; i >= 0; i--) {\n      if (s[i] == ')') {\n        right++;\n      }\n      if (s[i] == '(' && right > 0) {\n        right--;\n      } else if (s[i] == '(' && right == 0) {\n        c[i] = '$';\n      }\n    }\n    puts(s);\n    printf(\"\\n\");\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (c[i] == '?' || c[i] == '$') {\n        printf(\"%c\", c[i]);\n        c[i] = 0;\n      } else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n    strcpy(fakes, s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[110], b[110];\n  while (scanf(\"%s\", &a) == 1) {\n    strcpy(b, a);\n    int len = strlen(a);\n    int i, t, s, q = 1;\n    while (q) {\n      q = 0;\n      t = -1;\n      s = -1;\n      for (i = 0; i < len; i++) {\n        if (a[i] == 40)\n          t = i;\n        else if (a[i] == 41) {\n          if (t >= 0) {\n            a[t] = 48;\n            a[i] = 48;\n            q = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        cout << \"$\";\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31979", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j, a[101], len, count;\n  while (cin.getline(str, 101)) {\n    count = 0;\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == ')') {\n        count++;\n        a[count] = i;\n      }\n    }\n    for (i = 1; i <= count; i++) {\n      for (j = a[i] - 1; j >= 0; j--) {\n        if (a[i] == 0) {\n          str[a[i]] = '?';\n        }\n        if (str[j] == '(') {\n          str[j] = ' ';\n          str[a[i]] = ' ';\n          break;\n        }\n      }\n      if (str[a[i]] != ' ')\n        str[a[i]] = '?';\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      if ((str[i] != ' ') && (str[i] != '?') && (str[i] != '$')) {\n        str[i] = ' ';\n      }\n    }\n    for (i = 0; i <= len - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid match(char s[]) {\n  char b[101];\n  puts(s);\n  int l, x = 0, i, left[101];\n  l = strlen(s);\n  for (i = 0; i < l; i++)\n    b[i] = ' ';\n  b[l] = '\u0000';\n  for (i = 0; i < l; i++)\n    if (s[i] == '(')\n      left[x++] = i;\n    else if (s[i] == ')') {\n      if (x == 0)\n        b[i] = '?';\n      else\n        x--;\n    }\n  for (i = 0; i < x; i++)\n    b[left[i]] = '$';\n  puts(b);\n}\nint main() {\n  char a[101];\n  while ((scanf(\"%s \", a))) {\n    match(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(void) {\n  char *exp = (char *)malloc(sizeof(char) * 1000);\n  int *res = (int *)malloc(sizeof(int) * 1000);\n  while (cin >> exp) {\n    int cur = 0, pt = 0, len = strlen(exp);\n    for (int i = 0; i != 1000; ++i)\n      res[i] = -1;\n    for (; cur != len; ++cur) {\n      if (exp[cur] != '(' && exp[cur] != ')')\n        res[cur] = 0;\n      if (exp[cur] == ')') {\n        for (pt = cur - 1; pt >= 0; --pt) {\n          if (exp[pt] == '(' && res[pt]) {\n            res[pt] = 0;\n            res[cur] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(exp);\n    for (int i = 0; i != len; ++i) {\n      if (exp[i] == '(' && res[i] == -1) {\n        res[i] = 1;\n      } else if (exp[i] == ')' && res[i] == -1)\n        res[i] = 2;\n      switch (res[i]) {\n      case 0:\n        putchar(' ');\n        break;\n      case 1:\n        putchar('$');\n        break;\n      case 2:\n        putchar('?');\n        break;\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31982", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    printf(\"%s \", a);\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(') {\n        printf(\"$\");\n        continue;\n      }\n      if (a[i] == ')') {\n        printf(\"?\");\n        continue;\n      }\n      printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31983", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[101];\n  int i, a[101], k, j;\n  for (i = 0; i <= 100; i++) {\n    a[i] = 1;\n  }\n  while (scanf(\"%s\", ch) != EOF) {\n    puts(ch);\n    i = 0;\n    do {\n      if ((ch[i] >= 'a' && ch[i] <= 'z') || (ch[i] >= 'A' && ch[i] <= 'Z'))\n        a[i] = 0;\n      if (ch[i] == ')') {\n        for (k = i - 1; k >= 0; k--) {\n          if ((ch[k] == '(') && a[k] == 1) {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    } while (ch[i] != '\\0');\n    j = i - 1;\n    for (i = 0; i <= j; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else {\n        if (ch[i] == '(')\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n    }\n    printf(\"\\n\");\n    for (i = 0; i <= 100; i++) {\n      a[i] = 1;\n      ch[i] = 'a';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, m, j;\n  cin >> m;\n  for (j = 0; j < m; j++) {\n    cin >> a;\n    puts(a);\n    n = strlen(a);\n    course(a, n);\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31985", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][101], b[101], c[101];\n  int n, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%s\", a[m]);\n  }\n  for (m = 0; m < n; m++) {\n    int i = 0, j = 0, k = 0;\n    int n;\n    n = strlen(a[m]);\n    for (i = 0; i < n; i++) {\n      b[i] = ' ';\n      c[i] = ' ';\n    }\n\n    for (i = n - 1; i >= 0; i--)\n      if (a[m][i] == '(')\n        b[i] = a[m][i];\n    for (i = 0; i < n; i++)\n      if (a[m][i] == ')')\n        c[i] = a[m][i];\n    for (i = n - 1; i >= 0; i--)\n      if (b[i] == '(') {\n        for (j = i + 1; j < n; j++)\n          if (c[j] == ')') {\n            c[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n      }\n    printf(\"%s \", a[m]);\n    for (i = 0; i < n; i++) {\n      if (b[i] != ' ')\n        a[m][i] = '$';\n      if (c[i] != ' ')\n        a[m][i] = '?';\n      if (b[i] == ' ' && c[i] == ' ')\n        a[m][i] = ' ';\n    }\n    cout << a[m] << \" \";\n  }\n}\n"}
{"label": "17", "index": "31986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f(char str[105], int len) {\n  int i, j;\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ')') {\n      int x = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (str[j] == '(') {\n          x = 1;\n          str[i] = 'a';\n          str[j] = 'a';\n          break;\n        }\n      }\n      if (x == 0)\n        str[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] == '(')\n      str[i] = '$';\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] != '$' && str[i] != '?') {\n      str[i] = ' ';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n}\nint main() {\n  char str[105];\n  int len;\n  while (cin >> str) {\n    len = strlen(str);\n    f(str, len);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid del(char a[], int n) {\n  int i = 0;\n  while (a[i] != ')' && i < n)\n    i++;\n  int j;\n  j = i - 1;\n  while (a[j] != '(' && j >= 0)\n    j--;\n  if (i < n && j >= 0) {\n    a[i] = ' ';\n    a[j] = ' ';\n    del(a, n);\n  } else {\n    if (i >= n && j >= 0)\n      a[j] = '$';\n    if (j < 0 && i < n)\n      a[i] = '?';\n    if (!(i >= n && j < 0))\n      del(a, n);\n  }\n}\n\nint main() {\n  while (!cin.eof()) {\n    char a[101];\n    cin.getline(a, 101);\n    cout << a << endl;\n    int n, i;\n    n = strlen(a);\n    del(a, n);\n    for (i = 0; i < n; i++)\n      switch (a[i]) {\n      case '$':\n      case '?':\n        cout << a[i];\n        break;\n      default:\n        printf(\" \");\n      }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31988", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, flag = 0;\n  char s[1000] = {\"\"};\n  scanf(\"%s\", s);\n  while ((s[0] >= 'a' && s[0] <= 'z') || (s[0] >= 'A' && s[0] <= 'Z') ||\n         s[0] == '(' || s[0] == ')') {\n\n    printf(\"%s \", s);\n    n = strlen(s);\n    for (i = n - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (s[j] == ')') {\n            s[i] = 'a';\n            s[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(' || s[i] == ')') {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      for (i = 0; i < n; i++)\n        printf(\"%c\", ' ');\n      printf(\" \");\n    } else {\n      for (i = 0; i < n; i++) {\n        if (s[i] == '(')\n          printf(\"%c\", '$');\n        else if (s[i] == ')')\n          printf(\"%c\", '?');\n        else\n          printf(\"%c\", ' ');\n      }\n      printf(\" \");\n    }\n    s[0] = '\u0000';\n    scanf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[150], d[150] = {0};\n  int i, j, l = 11, x;\n  for (x = 1; x <= 10; x++) {\n    for (i = 0; i <= l; i++) {\n      c[i] = ' ';\n      d[i] = '\u0000';\n    }\n\n    scanf(\"%s \", c);\n    l = strlen(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\u0000')\n        break;\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[j] = '!';\n            break;\n          }\n        }\n        if (j < 0) {\n          c[i] = '?';\n          d[i] = '?';\n        }\n      }\n    }\n    for (i = 0;; i++) {\n      if (c[i] == '(') {\n        c[i] = '!';\n        d[i] = '$';\n      }\n      if (c[i] == '\u0000')\n        break;\n    }\n    for (i = 0;; i++) {\n      if (c[i] == '\u0000')\n        break;\n      if (c[i] == '!')\n        c[i] = '(';\n      if (c[i] == '?')\n        c[i] = ')';\n      if (d[i] != '$' && d[i] != '?')\n        d[i] = ' ';\n    }\n    puts(c);\n    puts(d);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31990", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid find() {\n  char ch[101];\n\n  memset(ch, '\\0', sizeof(ch));\n  while (cin.getline(ch, 1000, '\\n')) {\n    cout << ch << endl;\n    int i = 0, j = 0;\n    int num = 0;\n    for (i = 0; i < 100; i++) \n      if (ch[i] == '(') {\n        num = 0;\n        for (j = i; j < 100; j++) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num > 0)\n          ch[i] = '$';\n      }\n    for (i = 99; i >= 0; i--)\n      if (ch[i] == ')') {\n        num = 0;\n        for (j = i; j >= 0; j--) {\n          if (ch[j] == '(')\n            num++;\n          if (ch[j] == ')')\n            num--;\n          if (num == 0)\n            break;\n        }\n        if (num < 0)\n          ch[i] = '?';\n      }\n    int len;\n    len = strlen(ch);\n    for (i = 0; i < len; i++)\n      if (ch[i] != '$' && ch[i] != '?')\n        ch[i] = ' ';\n    cout << ch << endl;\n  }\n}\nint main() {\n\n  find();\n  return 0;\n}\n"}
{"label": "17", "index": "31991", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[200];\n  char str2[200];\n  int i = 0, length, sign, flag;\n  char c;\n  scanf(\"%c\", &c);\n  while (c != EOF) {\n    i = 0;\n    sign = -1;\n    while (c != '\\n') {\n      str1[i] = c;\n      if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {\n        str2[i] = ' ';\n      } else {\n        str2[i] = c;\n      }\n      i++;\n      scanf(\"%c\", &c);\n    }\n    str1[i] = '\\0';\n    str2[i] = '\\0';\n    length = strlen(str2);\n    i = 0;\n    flag = 0;\n    while (i >= 0) {\n      if (str2[i] == '(')\n        sign = i;\n      if (str2[i] == ' ') {\n        if (i == length - 1) {\n          if (flag == 1) {\n            flag = 0;\n            i = -1;\n          } else\n            break;\n        }\n        i++;\n        continue;\n      }\n      if ((str2[i] == ')') && (sign >= 0)) {\n        str2[sign] = ' ';\n        str2[i] = ' ';\n        flag = 1;\n        sign = -1;\n      }\n      if (i == length - 1) {\n        if (flag == 1) {\n          flag = 0;\n          i = -1;\n          sign = -1;\n        } else\n          break;\n      }\n      i++;\n    }\n    for (i = 0; i < length; i++) {\n      if (str2[i] == '(')\n        str2[i] = '$';\n      if (str2[i] == ')')\n        str2[i] = '?';\n    }\n    printf(\"%s\\n\", str1);\n    printf(\"%s\\n\", str2);\n    cin >> c;\n    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '(' ||\n        c == ')')\n      continue;\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31992", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid Replace(char s[], int x) {\n  for (int i = x + 1; i < strlen(s); i++) {\n    if (s[i] == ')') {\n      s[x] = s[i] = ' ';\n      return;\n    }\n    if (s[i] == '(')\n      Replace(s, i);\n  }\n  s[x] = '$';\n}\nvoid Find(char s[]) {\n  for (int i = 0; i < strlen(s); i++) {\n    if (s[i] == '$' || s[i] == '?')\n      continue;\n    if (s[i] == '(')\n      Replace(s, i);\n    else if (s[i] == ')')\n      s[i] = '?';\n    else\n      s[i] = ' ';\n  }\n  return;\n}\n\nint main() {\n  char live[101];\n  while (scanf(\"%s \", live)) {\n    cout << live << endl;\n    Find(live);\n    printf(\"%s\\n\", live);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[110], s[110];\n  int left, i;\n  int leftp[110] = {0};\n  while (scanf(\"%s \", c)) {\n    left = 0;\n    i = 0;\n    memset(leftp, 0, 110 * sizeof(int));\n    memset(s, 0, 110 * sizeof(char));\n    while (c[i] != '\\0') {\n      if (c[i] == '(') {\n        left++;\n        leftp[left] = i;\n      } else if (c[i] == ')') {\n        if (left == 0)\n          s[i] = '?';\n        else {\n          left--;\n        }\n      }\n      i++;\n    }\n    if (left > 0) {\n      for (i = 1; i <= left; i++)\n        s[leftp[i]] = '$';\n    }\n    cout << c << endl;\n    for (i = 0; i < strlen(c); i++)\n      if ((s[i] == '?') || (s[i] == '$'))\n        printf(\"%c\", s[i]);\n      else\n        cout << ' ';\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char a[], int, int);\nvoid g(char a[]);\nint main() {\n  char str[100][101];\n  int i, n = 0, j;\n  while (cin.getline(str[n++], 101)) {\n  }\n  for (i = 0; i < n; i++) {\n    cout << str[i] << endl;\n    for (j = 0; j < strlen(str[i]); j++) {\n      if (str[i][j] == ')')\n\n        f(str[i], j - 1, j);\n    }\n    g(str[i]);\n    cout << str[i] << endl;\n  }\n  return 0;\n}\nvoid f(char a[], int x, int y) {\n  if (a[x] == '(')\n    a[x] = a[y] = 'a';\n  else if (x > 0)\n    f(a, x - 1, y);\n}\nvoid g(char a[]) {\n  int i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')')\n      a[i] = '?';\n    else\n      a[i] = ' ';\n  }\n}\n"}
{"label": "17", "index": "31995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x, y;\n  scanf(\"%d\", &n);\n  char a[n][1000];\n  getchar();\n  for (i = 0; i < n; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c, a[105] = {'\\0'}, sign[105] = {'\\0'}; \n  int length, i, j;\n  cin.getline(a, 101, '\\n');\n  while (a[0] != '\\0') {\n    length = strlen(a);\n    cout << a << endl; \n    for (i = 0; i < length; i++) {\n      if (a[i] != ')') \n        continue;\n      else if (i > 0) {\n        j = i - 1;\n        while (j >= 0 && a[j] != '(') \n          j--;\n        if (a[j] == '(') {\n          a[i] = '\\0';\n          a[j] = '\\0';\n        }\n      }\n    }\n    for (i = 0; i < length; i++) \n    {\n      if (a[i] == '(')\n        sign[i] = '$';\n      else {\n        if (a[i] == ')')\n          sign[i] = '?';\n        else\n          sign[i] = ' ';\n      }\n    }\n    cout << sign;             \n    for (i = 0; i < 105; i++) \n    {\n      a[i] = '\\0';\n      sign[i] = '\\0';\n    }\n    cin.getline(a, 101, '\\n'); \n    if (a[0] != '\\0')\n      cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar in[110], work[110], out[110];\nint len;\nvoid pick(int L) {\n  for (int i = L - 1; i >= 0; i--) {\n    if (work[i] == '(') {\n      for (int j = 0; j < L - i; j++) {\n        if (work[i + j] == ')') {\n          work[i] = ' ';\n          work[i + j] = ' ';\n          pick(len);\n          break;\n        }\n      }\n    }\n  }\n}\nvoid mark(int L) {\n  for (int i = 0; i < L; i++) {\n    if (work[i] == '(')\n      out[i] = '$';\n    if (work[i] == ')') {\n      out[i] = '?';\n    }\n  }\n}\nint main() {\n  while (cin) {\n    cin.getline(in, 110);\n    len = strlen(in);\n    for (int i = 0; i < len; i++) {\n      out[i] = ' ';\n      work[i] = in[i];\n    }\n    pick(len);\n    mark(len);\n    for (int i = 0; i < len; i++) {\n      cout << in[i];\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++)\n      cout << out[i];\n\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "31998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[1000], st2[1000];\n  while (cin.getline(st, 1000)) {\n    for (int i = 1; i <= strlen(st); i++)\n      st2[i - 1] = ' ';\n    st2[strlen(st)] = '\\0';\n\n    int count = 0, z[1000];\n    for (int i = 1; i <= strlen(st); i++)\n      if (st[i - 1] == '(') {\n        count++;\n        z[count] = i;\n      } else if (st[i - 1] == ')') {\n        if (count > 0) {\n          z[count] = 0;\n          count--;\n        } else\n          st2[i - 1] = '?';\n      }\n    for (int i = 1; i <= count; i++)\n      st2[z[i] - 1] = '$';\n    cout << st << \"\\n\" << st2 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "31999", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char str[101], flag[101];\n  while (cin.getline(str, 101)) {\n    cout << str << endl;\n    int len, num = 0;\n    len = strlen(str);\n    int i, j;\n    for (i = 0; i < len; i++)\n      flag[i] = ' ';\n    flag[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        num++;\n        flag[i] = '$';\n      }\n      if (str[i] == ')') {\n        num--;\n        if (num >= 0) {\n          for (j = i - 1; j >= 0; j--)\n            if (str[j] == '(') {\n              flag[j] = ' ';\n              str[j] = ' ';\n              break;\n            }\n        } else {\n          flag[i] = '?';\n          num++;\n        }\n      }\n    }\n    cout << flag << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int n, i, j, l;\n  char c[101];\n  int left = 0, right = 0;\n  int e[101] = {0};\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    left = 0;\n    right = 0;\n    cin >> str;\n    l = strlen(str);\n    for (j = 0; j < l; j++) {\n      e[j] = 0;\n      if (str[j] == '(') {\n        left++;\n        e[j] = 1;\n        c[left] = j;\n      }\n      if (str[j] == ')') {\n        if (left == 0) {\n          e[j] = 2;\n        } else {\n          e[c[left]] = 0;\n          left--;\n        }\n      } else\n        continue;\n    }\n    cout << str << endl;\n    for (j = 0; j < l; j++) {\n      if (e[j] == 1)\n        printf(\"$\");\n      else {\n        if (e[j] == 2)\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32001", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0;\n\n  char s[101] = {0};\n  while (cin >> s) {\n    int a = 0, b = 0;\n    cout << s << endl;\n    int flag[101] = {0};\n    for (i = 0; i <= strlen(s) - 1; i++) {\n      if (s[i] == '(')\n        a++;\n      if (s[i] == ')') {\n        a--;\n        if (a < 0) {\n          a = 0;\n          flag[i] = -1;\n        }\n      }\n    }\n    for (i = strlen(s) - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        b++;\n      if (s[i] == '(') {\n        b--;\n        if (b < 0) {\n          b = 0;\n          flag[i] = 1;\n        }\n      }\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (flag[i] != 0)\n        break;\n    }\n    for (j = strlen(s) - 1; j >= 0; j--) {\n      if (flag[j] != 0)\n        break;\n    }\n    for (i = i; i <= j; i++) {\n      if (flag[i] == 1)\n        cout << \"$\";\n      else if (flag[i] == 0)\n        cout << \" \";\n      else if (flag[i] == -1)\n        cout << \"?\";\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, p;\n  char str[10001], a[2000], b[2000], c[2000];\n  while (cin >> str) {\n    n = strlen(str);\n    strcpy(a, str);\n    for (i = 0; i < n; i++)\n      c[i] = ' ';\n    for (i = 0; i < n; i++)\n      if (a[i] == ')') {\n        p = 0;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '?';\n      }\n    for (i = n - 1; i >= 0; i--)\n      if (a[i] == '(') {\n        p = 0;\n        for (j = i; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            p = 1;\n            break;\n          }\n        }\n        if (p != 1)\n          c[i] = '$';\n      }\n    puts(str);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", c[i]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32003", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, p, m;\n  char a[200], b[200], c[200];\n  i = 0;\n  while (scanf(\"%s \", a)) {\n    puts(a);\n    k = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n      } else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    b[strlen(a)] = '\u0000';\n    c[strlen(a)] = '\u0000';\n    for (i = 0; i < strlen(a); i++)\n      c[i] = b[i];\n\n    for (p = 0; p < strlen(a); p++) {\n      k = 0;\n      for (i = 0; i < strlen(a); i++) {\n        if (b[i] == ' ')\n          continue;\n        else if (b[i] == '$') {\n          k++;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (b[j] == ' ')\n              continue;\n            else if (b[j] == '?') {\n              b[i] = ' ';\n              b[j] = ' ';\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            } else if (b[j] == '$')\n              break;\n          }\n        } else if (b[i] == '?' && k == 0)\n          c[i] = '?';\n      }\n    }\n    puts(c);\n    continue;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32004", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[120][102], b[120][102];\n  int n, i, j, k, r, d, l, cao;\n  for (i = 1; i <= 200; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n  }\n  for (j = 1; j <= i - 1; j++) {\n    for (k = 0; k <= strlen(a[j]) - 1; k++) {\n\n      if (a[j][k] == ')') {\n        if (k == 0) {\n          l = 0;\n        }\n        for (r = 0, cao = 0; r <= k - 1; r++) {\n          if (a[j][r] == '(') {\n            for (d = r + 1, l = 1; d <= k - 1; d++) {\n              if (a[j][d] == ')')\n                l--;\n              else if (a[j][d] == '(') {\n                l++;\n              }\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '?';\n      } else if (a[j][k] == '(') {\n        if (k == strlen(a[j]) - 1) {\n          l = 0;\n        }\n        for (r = k + 1, cao = 0; r <= strlen(a[j]) - 1; r++) {\n          if (a[j][r] == ')') {\n            for (d = r - 1, l = 1; d >= k + 1; d--) {\n              if (a[j][d] == '(')\n                l--;\n              else if (a[j][d] == ')')\n                l++;\n            }\n            if (l > 0)\n              cao++;\n          }\n        }\n        if (cao > 0)\n          b[j][k] = ' ';\n        else\n          b[j][k] = '$';\n      } else\n        b[j][k] = ' ';\n    }\n  }\n  for (j = 1; j <= i - 1; j++) {\n    printf(\"%s %s \", a[j], b[j]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int n, i, j;\n  while (1) {\n    if (scanf(\"%s\", s) == EOF)\n      return 0;\n    puts(s);\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else {\n        if (s[i] == ')')\n          s[i] = '?';\n        else\n          s[i] = ' ';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    while (s[n - 1] == ' ') {\n      s[n - 1] = '\\0';\n      n--;\n    }\n    while (s[0] == ' ') {\n      for (i = 0; i < n; i++) {\n        s[i] = s[i + 1];\n      }\n    }\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, r, n, x = 0, z;\n  char a[102], b[102];\n  while (scanf(\"%c\", &a[1]) != EOF) {\n    i = 1;\n    while (a[i] != '\\n') {\n      i++;\n      scanf(\"%c\", &a[i]);\n    }\n    for (n = 1; n <= i - 1; n++)\n      cout << a[n];\n    cout << \"\\n\";\n    x = 0;\n    for (n = 1; n <= i - 1; n++) {\n      b[n] = ' ';\n      if (a[n] == ')' && x == 0)\n        b[n] = '?';\n      if (a[n] == '(')\n        x = x + 1;\n      if (a[n] == ')' && x != 0)\n        x = x - 1;\n    }\n    x = 0;\n    for (n = i - 1; n >= 1; n--) {\n      if (a[n] == ')')\n        x = x + 1;\n      if (a[n] == '(' && x == 0)\n        b[n] = 36;\n      if (a[n] == '(' && x != 0)\n        x = x - 1;\n    }\n    for (z = 1; z <= i - 1; z++)\n      printf(\"%c\", b[z]);\n    printf(\"\\n\");\n    for (r = 1; r <= i; r++) {\n      b[r] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[120], a_cout[120] = {0}, b;\n  int num[120] = {0};\n  int i, j, k;\n  while (cin.get(a[0])) {\n    num[0] = 0;\n    for (i = 1; i < 120; i++) {\n      a[i] = 0;\n      num[i] = 0;\n    }\n    for (i = 0;; i++) {\n      if (i != 0)\n        cin.get(a[i]);\n      if (a[i] == '\\n')\n        break;\n      else {\n        if (a[i] == '(') {\n          num[i] = 1;\n        }\n        if (a[i] == ')') {\n          num[i] = 2;\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (a[k] == '(' && num[k] != 0) {\n            num[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      cout << a[j];\n    }\n    cout << endl;\n    for (j = 0; j < i; j++) {\n      if (num[j] == 0)\n        cout << \" \";\n      if (num[j] == 1)\n        cout << \"$\";\n      if (num[j] == 2)\n        cout << \"?\";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[200] = {'\\0'};\n  int left[200] = {0};\n  int i = 0, k = 0;\n  while (cin.getline(word, 200)) {\n    for (i = 0; word[i]; i++)\n      cout << word[i];\n    cout << endl;\n    for (i = 0; word[i]; i++) {\n      if (word[i] == '(') {\n        left[k] = i;\n        k++;\n        word[i] = '$';\n      } else if (word[i] == ')') {\n        if (k) {\n          k--;\n          word[left[k]] = ' ';\n          word[i] = ' ';\n        } else\n          word[i] = '?';\n      } else\n        word[i] = ' ';\n    }\n    for (i = 0; word[i]; i++)\n      cout << word[i];\n    printf(\"\\n\");\n    k = 0;\n    memset(word, '\\0', sizeof(word));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32009", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, l;\n  char s[100][100];\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 1; i <= n; i++) {\n\n    cin >> s[i];\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == '(')\n        a[j] = 1;\n      if (s[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 2) {\n        for (m = j; m >= 0; m--) {\n          if (a[m] == 1) {\n            a[m] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s[i]);\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1) {\n        printf(\"$\");\n      }\n      if (a[j] == 2) {\n        printf(\"?\");\n      }\n      if (a[j] == 0) {\n        printf(\" \");\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nstatic char c[2][101];\nint i, n;\nvoid search(int a) {\n  for (i++; i < n; i++)\n    if (c[0][i] == ')') {\n      c[1][a] = ' ';\n      c[1][i] = ' ';\n      break;\n    } else if (c[0][i] == '(')\n      search(i);\n    else\n      c[1][i] = ' ';\n  if (i >= n)\n    c[1][a] = '$';\n}\nint main() {\n  while (scanf(\"%s\", &c[0]) != EOF) {\n    for (n = 0; c[0][n] != '\\0'; n++)\n      ;\n    for (i = 0; i < n; i++)\n      if (c[0][i] == ')')\n        c[1][i] = '?';\n      else if (c[0][i] == '(')\n        search(i);\n      else {\n        c[1][i] = ' ';\n      }\n    puts(c[0]);\n    puts(c[1]);\n    for (i = 0; i < n; i++) {\n      c[0][i] = 0;\n      c[1][i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[1000];\nvoid findr(int left) {\n  for (int i = left + 1; s[i] != '\\0'; i++) {\n    if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n      s[i] = ' ';\n    if (s[i] == '(')\n      findr(i);\n    if (s[i] == ')') {\n      s[i] = ' ';\n      s[left] = ' ';\n      return;\n    }\n  }\n  s[left] = '$';\n}\n\nint main() {\n  while (scanf(\"%s \", s)) {\n    cout << s << endl;\n    for (int i = 0; s[i] != '\\0'; i++) {\n      if (s[i] != '(' && s[i] != ')' && s[i] != '$' && s[i] != '?')\n        s[i] = ' ';\n      if (s[i] == '(')\n        findr(i);\n      if (s[i] == ')')\n        s[i] = '?';\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32012", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, l;\n  char c[1000][105] = {0};\n  int k;\n  int a[105] = {0};\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    cin >> c[i];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 105; j++) {\n      a[j] = 0;\n    }\n    l = strlen(c[i]);\n    printf(\"%s\\n\", c[i]);\n    for (j = l - 1; j >= 0; j--) {\n      if (c[i][j] == '(') {\n        for (k = j + 1; k < l; k++) {\n          if (c[i][k] == ')') {\n            c[i][k] = 0;\n            c[i][j] = 0;\n            break;\n          }\n        }\n        if (k == l) {\n          c[i][j] = 0;\n          a[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (c[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1)\n        printf(\"$\");\n      else if (a[j] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32013", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar a[120];\nint len = 0;\n\nvoid bracket(int i) {\n  if (i < 0)\n    return;\n  if (a[i] != '(')\n    bracket(i - 1);\n  if (a[i] == '(') {\n    for (int k = i; k < len; k++) \n    {\n      if (a[k] == ')') {\n        a[i] = 'x';\n        a[k] = 'x'; \n        break;\n      }\n    }\n    bracket(i - 1); \n  }\n}\n\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    len = strlen(a);\n    bracket(len - 1);\n    for (int k = 0; k < len; k++) {\n      if (a[k] == '(')\n        cout << \"$\";\n      else if (a[k] == ')')\n        cout << \"?\"; \n      else\n        cout << \" \";\n    }\n    cout << endl;\n    for (int i = 0; i < 120; i++)\n      a[i] = '\\0'; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32014", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, n, f[101][102] = {0}, l[101], g;\n  char s[101][102], a[102];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s[i]);\n    l[i] = strlen(s[i]);\n    for (j = l[i] - 1; j >= 0; j--) {\n      if (s[i][j] == '(')\n        k = j;\n      else\n        continue;\n      for (g = k + 1; g < l[i]; g++) {\n        if (s[i][g] == ')' && f[i][g] == 0) {\n          f[i][k] = 1;\n          f[i][g] = 1;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\\n\", s[i]);\n    for (j = 0; j < l[i]; j++) {\n      if (s[i][j] == '(' && f[i][j] == 0)\n        printf(\"$\");\n      else if (s[i][j] == ')' && f[i][j] == 0)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32015", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  for (scanf(\"%d \", &n); n > 0; n--) {\n    char a[101];\n\n    cin >> a;\n    puts(a);\n    int i, j, k, l = strlen(a);\n    do {\n      for (j = 0; j < l; j++) {\n        if (a[j] == ')')\n          break;\n      }\n      if (j != l) {\n        for (k = j; k >= 0; k--)\n          if (a[k] == '(')\n            break;\n        if (k < 0)\n          a[j] = '?';\n        else\n          a[j] = a[k] = ' ';\n      }\n    } while (j != l);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32016", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      switch (a[i]) {\n      case '(':\n        a[i] = '$';\n        break;\n      case ')':\n        a[i] = '?';\n        break;\n      default:\n        a[i] = ' ';\n      }\n      if (i > l)\n        break;\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '$')\n        for (int j = i + 1; j < l; j++) {\n          if (a[j] == '?') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '$')\n            break;\n        }\n      if (a[i] == '?')\n        for (int j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '?')\n            break;\n        }\n    }\n    for (int i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < 100; i++)\n      a[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32017", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  int l, i, j, d;\n  while (1) {\n\n    cin >> str;\n    if (str[0] == '\u0000')\n      break;\n    puts(str);\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == ' ')\n        continue;\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n      else if (str[i] == '(') {\n        d = 1;\n        for (j = i + 1; j < l; j++) {\n          if (str[j] == '(')\n            d++;\n          if (str[j] == ')')\n            d--;\n          if (d == 0) {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++)\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        printf(\"?\");\n      else\n        printf(\"%c\", str[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      str[i] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char a[1000], b[1000];\n  int j, l, r;\n  for (i = 0; i < n; i++) {\n\n    memset(a, '\\n', 200);\n    memset(b, '\\n', 200);\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n        for (r = j - 1; r >= 0; r--) {\n          if (b[r] == '$') {\n            b[r] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n    }\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32019", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid change(char str[]) {\n  int n, i;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == '(')\n      str[i] = '$';\n    else if (str[i] == ')')\n      str[i] = '?';\n    else\n      str[i] = ' ';\n  }\n}\nvoid match(char str[]) {\n  int n, i, k;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (str[i] == ')') {\n      for (k = i; k >= 0; k--) {\n        if (str[k] == '(') {\n          str[k] = ' ';\n          str[i] = ' ';\n          k = -1;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char string[100];\n  while (scanf(\"%s \", string)) {\n    puts(string);\n    match(string);\n    change(string);\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32020", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid peidui(void);\nint m, i;\nchar a[100][110];\nint main() {\n  char c, h;\n  int j, k, t[100] = {0}, p, n = 0;\n  while (cin >> a[n])\n    n = n + 1;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(') {\n        m = m + 1;\n        peidui();\n        m = m - 1;\n      }\n      if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n          (a[i][m] >= 'A' && a[i][m] <= 'Z'))\n        a[i][m] = ' ';\n    }\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(')\n        a[i][m] = '$';\n      if (a[i][m] == ')')\n        a[i][m] = '?';\n    }\n    for (m = 0; m < t[i]; m++)\n      cout << a[i][m];\n    cout << endl;\n  }\n  return 0;\n}\nvoid peidui(void) {\n  int k;\n  k = m - 1;\n  if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n      (a[i][m] >= 'A' && a[i][m] <= 'Z')) {\n    a[i][m] = ' ';\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == '(') {\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == ')' && a[i][k] == '(') {\n    a[i][m] = ' ';\n    a[i][k] = ' ';\n    m = m + 1;\n    peidui();\n  }\n}\n"}
{"label": "17", "index": "32021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100] = {0}, d[100] = {0};\n  int l, i, j, s;\n  while (scanf(\"%s\", c) != EOF) {\n    l = strlen(c);\n    for (i = 0; i < l; i++) {\n      if (c[i] == '(')\n        d[i] = '$';\n      else if (c[i] == ')') {\n        d[i] = '?';\n        for (j = i - 1, s = 1; j >= 0 && s == 1; j--) {\n          if (d[j] == '$') {\n            d[j] = d[i] = ' ';\n            s = 0;\n          }\n        }\n      } else\n        d[i] = ' ';\n    }\n    for (i = 0; i < l; i++)\n      printf(\"%c\", c[i]);\n    printf(\" \");\n    for (i = 0; i < l; i++)\n      printf(\"%c\", d[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32022", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid peidui(void);\nint m, i;\nchar a[100][110];\nint main() {\n\n  int j, k, t[100] = {0}, p, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      printf(\"%c\", a[i][j]);\n    cout << endl;\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(') {\n        m = m + 1;\n        peidui();\n        m = m - 1;\n      }\n      if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n          (a[i][m] >= 'A' && a[i][m] <= 'Z'))\n        a[i][m] = ' ';\n    }\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(')\n        a[i][m] = '$';\n      if (a[i][m] == ')')\n        a[i][m] = '?';\n    }\n    for (m = 0; m < t[i]; m++)\n      printf(\"%c\", a[i][m]);\n    cout << endl;\n  }\n  return 0;\n}\nvoid peidui(void) {\n  int k;\n  k = m - 1;\n  if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n      (a[i][m] >= 'A' && a[i][m] <= 'Z')) {\n    a[i][m] = ' ';\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == '(') {\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == ')' && a[i][k] == '(') {\n    a[i][m] = ' ';\n    a[i][k] = ' ';\n    m = m + 1;\n    peidui();\n  }\n}\n"}
{"label": "17", "index": "32023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[101] = {\"0\"}, temp[101] = {\"0\"};\n  int len = 0, i = 0, j = 0, s = 0;\n  while (cin.getline(word, 101)) {\n    cout << word << endl;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      temp[i] = ' ';\n    temp[i] = '\\0';\n    for (i = 0; i < len; i++) \n    {\n      if (word[i] == '(')\n        temp[i] = '$';\n      if (word[i] == ')')\n        temp[i] = '?';\n    }\n    for (i = 0; i < len; i++) {\n      s = 1;\n      if (word[i] == '(') \n      {\n\n        for (j = i + 1; j < len; j++) {\n          if (word[j] == '(')\n            s++;\n          if (word[j] == ')')\n            s--;\n          if (s == 0) {\n            temp[i] = ' ';\n            temp[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << temp << endl;\n    strcpy(temp, \"0\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110] = {0};\n\n  while (cin >> str) {\n    int change[110] = {0};\n    char ans[110] = {0};\n    int len = strlen(str);\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        change[i] = 1;\n      } else if (str[i] == ')')\n        change[i] = -1;\n      else\n        change[i] = 0;\n    }\n    int sum = 0;\n    for (int i = 0; i < len; i++) {\n      sum += change[i];\n      if (sum < 0) {\n        ans[i] = '?';\n        sum = 0;\n      }\n    }\n    sum = 0;\n    for (int i = len - 1; i >= 0; i--) {\n      sum += change[i];\n      if (sum > 0) {\n        ans[i] = '$';\n        sum = 0;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (ans[i] != '?' && ans[i] != '$')\n        ans[i] = ' ';\n    }\n    printf(\"%s\\n\", str);\n    printf(\"%s\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32025", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[110];\nvoid search() {\n  int i = 0, l, t = 0;\n  char str1[110];\n  int stack[110];\n  cout << str << endl;\n  l = strlen(str);\n  memset(str1, ' ', sizeof(str1));\n  while (i < l) {\n    if (str[i] == '(') {\n      t++;\n      stack[t] = i;\n    }\n    if (str[i] == ')') {\n      if (t == 0)\n        str1[i] = '?';\n      else\n        t--;\n    }\n    i++;\n  }\n  for (i = 1; i <= t; i++)\n    str1[stack[i]] = '$';\n  for (i = 0; i < l; i++)\n    cout << str1[i];\n  cout << endl;\n}\nint main() {\n  while (scanf(\"%s \", str))\n    search();\n  return 0;\n}\n"}
{"label": "17", "index": "32026", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100];\n  int i, k, s;\n  for (; scanf(\"%s\", a) != EOF;) {\n    s = 0;\n    s = strlen(a);\n    for (i = 0; i < s; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = s - 1; i >= 0; i--) {\n      if (a[i] == '$') {\n        for (k = i; k < s; k++) {\n          if (a[k] == '?') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200];\n  while (scanf(\"%s\", a) != EOF) {\n    char al[200] = {'\\0'};\n    int i;\n    for (i = 0; a[i]; i++) {\n      if (a[i] == '(')\n        al[i] = '$';\n      else if (a[i] == ')')\n        al[i] = '?';\n      else\n        al[i] = ' ';\n    }\n    void func(char s[]);\n\n    func(al);\n    puts(a);\n    puts(al);\n    strcpy(a, \"'\\0'\");\n  }\n  return 0;\n}\nvoid func(char s[]) {\n  int i;\n  int t1 = 0, t2 = 0;\n  int n = strlen(s);\n  for (i = 0; i < strlen(s); i++) {\n    while (!(s[i] == '$' || s[i] == '?') && s[i] != '\\0')\n      i++;\n    t1 = i;\n\n    i = i + 1;\n    while (!(s[i] == '$' || s[i] == '?') && s[i] != '\\0')\n\n      i++;\n\n    if (s[i] == '\\0')\n      break;\n    t2 = i;\n    if (s[t1] == '$' && s[t2] == '?') {\n      s[t1] = ' ';\n      s[t2] = ' ';\n      i = -1;\n      continue;\n    }\n    i = t1;\n  }\n}\n"}
{"label": "17", "index": "32028", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int flag[101], i, j, k, len;\n  while (cin >> str) {\n    for (i = 0; i < 101; i++)\n      flag[i] = 0;\n    len = strlen(str);\n    for (i = len - 2; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == ')' && flag[j] == 0) {\n            flag[j] = 1;\n            flag[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        cout << \" \";\n      else {\n        if (str[i] == '(' && flag[i] == 0)\n          cout << \"$\";\n        if (str[i] == '(' && flag[i] == 1)\n          cout << \" \";\n        if (str[i] == ')' && flag[i] == 0)\n          cout << \"?\";\n        if (str[i] == ')' && flag[i] == 1)\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32029", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], res[101];\n  int n, stack[100], k;\n\n  cin >> n;\n  while (n--) {\n    cin >> str;\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      res[i] = ' ';\n    res[len] = '\\0';\n\n    k = 0;\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        if (k != 0 && stack[k - 1] < 0)\n          k--;\n        else\n          stack[k++] = i + 1;\n      } else if (str[i] == '(')\n        stack[k++] = -(i + 1);\n    }\n    for (int i = 0; i < k; i++) {\n      int index = stack[i];\n      if (index < 0)\n        res[-index - 1] = '$';\n      else\n        res[index - 1] = '?';\n    }\n    cout << str << endl;\n    cout << res << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, mz;\n  char a[200] = {'\u0000'}, b[200];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < 200; j++) {\n      a[j] = '\u0000';\n      b[j] = '\u0000';\n    }\n\n    cin >> a;\n    strcpy(b, a);\n    for (j = 0; j < 200; j++) {\n      if (a[j] == '\u0000')\n        break;\n      count++;\n    }\n    for (j = count - 1; j >= 0; j--) {\n      if (b[j] == '(') {\n        mz = 0;\n        for (k = j; k < count; k++) {\n          if (b[k] == ')') {\n            b[k] = ' ';\n            b[j] = ' ';\n            mz = 1;\n            break;\n          }\n        }\n        if (mz == 0)\n          b[j] = '$';\n      }\n    }\n    for (j = 0; j < count; j++) {\n      if (b[j] == ')')\n        b[j] = '?';\n    }\n    for (j = 0; j < count; j++)\n      printf(\"%c\", a[j]);\n    printf(\" \");\n    for (j = 0; j < count; j++) {\n      if (b[j] != '$' && b[j] != '?')\n        printf(\" \");\n      else\n        printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10][20], b[10][20];\n  int i, t, y, u = 0;\n  while (scanf(\"%s\", a[u]) != EOF) {\n    strcpy(b[u], a[u]);\n    for (t = 0; a[u][t] != 0; t++) {\n      if (a[u][t] != 40 && a[u][t] != 41)\n        b[u][t] = 32;\n      if (b[u][t] == 41) {\n        for (y = t; y > -1; y--) {\n          if (b[u][y] == 40) {\n            b[u][y] = 32;\n            b[u][t] = 32;\n            break;\n          }\n        }\n      }\n    }\n    for (t = 0; b[u][t] != 0; t++) {\n      if (b[u][t] == 40)\n        b[u][t] = 36;\n      else if (b[u][t] == 41)\n        b[u][t] = 63;\n    }\n    puts(a[u]);\n    puts(b[u]);\n    u++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  char b[101];\n  int flag[101];\n  int i, j, len, count, sign;\n  while (1) {\n    sign = 0;\n    i = -1;\n    do {\n      i++;\n      if (cin.get(a[i]))\n        sign = 1;\n    } while (a[i] != '\\n');\n    if (sign == 0)\n      break;\n    a[i] = 0;\n    len = i;\n    memset(b, ' ', sizeof(b));\n    b[i] = 0;\n    memset(flag, 0, sizeof(flag));\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        j = i + 1;\n        count = 0;\n        while (j < len) {\n          if (a[j] == '(')\n            count++;\n          else if (a[j] == ')') {\n            if (count == 0) {\n              flag[i] = 1;\n              flag[j] = 1;\n              break;\n            } else\n              count--;\n          }\n          j++;\n        }\n        if (flag[i] == 0)\n          b[i] = '$';\n      } else if ((a[i] == ')') && (flag[i] == 0))\n        b[i] = '?';\n    }\n    cout << a << endl;\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32033", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int i, j, n;\n  char a[200];\n  while (cin.get(a, 200)) \n  {\n    n = strlen(a); \n    for (i = 0; i < n; i++)\n      cout << a[i]; \n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$'; \n      else if (a[i] == ')') {\n        a[i] = '?';                  \n        for (j = i - 1; j >= 0; j--) \n        {\n          if (a[j] == '$') \n          {\n            a[i] = ' ';\n            a[j] = ' '; \n            break;\n          }\n        }\n      } else\n        a[i] = ' '; \n    }\n    for (i = 0; i < n; i++)\n      cout << a[i]; \n    cout << endl;\n    cin.get(); \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0};\n  int lef[101], r[101], i = 0, j = 0;\n  do {\n    cin.get(a, 101);\n    cin.get();\n    if (a[0] == '\\0')\n      break;\n    int len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = 0; i < len; i++)\n      if (b[i] == '?')\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    cout << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "17", "index": "32035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  int i;\n  char s[1001];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n\n    char t[1001] = {0};\n    int j, k;\n    int len = strlen(s);\n\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        int zo = 1, yb = 0;\n        for (k = j + 1; k < len; k++) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')')\n            yb++;\n\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n\n          s[j] = 0;\n          t[j] = '$';\n        }\n      }\n\n      if (s[j] == ')') {\n        int zo = 0, yb = 1;\n        for (k = j - 1; k >= 0; k--) {\n          if (s[k] == '(') {\n            zo++;\n          }\n          if (s[k] == ')') {\n            yb++;\n          }\n          if (zo == yb) {\n            break;\n          }\n        }\n        if (zo != yb) {\n          t[j] = '?';\n          s[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == 0) {\n        printf(\"(\");\n      } else if (s[j] == 1) {\n        printf(\")\");\n      } else\n        printf(\"%c\", s[j]);\n    }\n\n    cout << \"\\n\";\n    for (j = 0; j < len; j++) {\n      if (t[j] == '?' || t[j] == '$') {\n        printf(\"%c\", t[j]);\n      } else\n        printf(\" \");\n    }\n\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid find(char a[], int n, int m) {\n  int i;\n  if (a[m] != ')' && m < n) {\n    find(a, n, m + 1);\n  }\n  if (a[m] == ')' && m < n) {\n    for (i = m; i >= 0; i--) {\n      if (a[i] == '(') {\n        a[i] = ' ';\n        a[m] = ' ';\n        break;\n      }\n    }\n    find(a, n, m + 1);\n  }\n}\nint main() {\n  int n;\n  char a[200];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    n = strlen(a);\n    find(a, n, 0);\n    for (int k = 0; k < n; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } else {\n        if (a[k] == ')') {\n          a[k] = '?';\n        } else {\n          if (a[k] != '(' && a[k] != ')') {\n            a[k] = ' ';\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32037", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110] = {0};\n\n  while (scanf(\"%s \", str)) {\n    int change[110] = {0};\n    char ans[110] = {0};\n    int len = strlen(str);\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(')\n        change[i] = 1;\n      else if (str[i] == ')') {\n        change[i] = -1;\n      } else\n        change[i] = 0;\n    }\n    int sum = 0;\n    for (int i = 0; i < len; i++) {\n      sum += change[i];\n      if (sum < 0) {\n        ans[i] = '?';\n        sum = 0;\n      }\n    }\n    sum = 0;\n    for (int i = len - 1; i >= 0; i--) {\n      sum += change[i];\n      if (sum > 0) {\n        ans[i] = '$';\n        sum = 0;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (ans[i] != '?' && ans[i] != '$')\n        ans[i] = ' ';\n    }\n    cout << str << endl;\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101];\n  int i, j, k;\n  int l, r;\n  int len;\n  while (scanf(\"%s \", a)) {\n    l = 0;\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (a[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    b[len] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        l++;\n      if (a[i] == ')')\n        l--;\n      if (l < 0) {\n        b[i] = '?';\n        l = 0;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[len - i - 1] == ')')\n        r++;\n      if (a[len - i - 1] == '(') {\n        r--;\n      }\n      if (r < 0) {\n        b[len - i - 1] = '$';\n        r = 0;\n      }\n    }\n    cout << a << endl << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  int st[100], sp;\n  int i, l, m, n, t;\n  while (1) {\n    for (i = 0; i <= 99; i++)\n      st[i] = 0;\n    sp = 0;\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    strcpy(b, a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        st[sp] = i;\n        break;\n      }\n    }\n    if (i == l)\n      ;\n    else {\n      for (sp = 1, i = st[0] + 1; i <= l - 1; i++) {\n        if (a[i] == '(')\n          st[sp++] = i;\n        else if (a[i] == ')') {\n          if (sp > 0) {\n            b[st[--sp]] = ' ';\n            b[i] = ' ';\n          }\n        }\n      }\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else if (b[i] == ' ')\n        ;\n      else\n        b[i] = ' ';\n    }\n    printf(\"%s \", a);\n    n = l - 1;\n    for (i = l - 1; i >= 0; i--) {\n      if (b[i] == ' ')\n        n = i - 1;\n      else\n        break;\n    }\n    m = 0;\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == ' ')\n        m = i + 1;\n      else\n        break;\n    }\n    t = 0;\n    for (i = m; i <= n; i++) {\n      printf(\"%c\", b[i]);\n      t++;\n    }\n    printf(\" \");\n    a[0] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32040", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], s0[1000], t[1000];\n  int len, i, j;\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    strcpy(s0, s);\n    for (i = 0; i < len; i++)\n      if (s0[i] == ')' && i > 0)\n        for (j = i - 1; j >= 0; j--)\n          if (s0[j] == '(') {\n            s0[i] = ' ';\n            s0[j] = ' ';\n            break;\n          }\n\n    for (i = 0; i < len; i++) {\n      if (s0[i] == '(')\n        t[i] = '$';\n      else if (s0[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    }\n\n    printf(\"%s \", s);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", t[i]);\n    putchar(' ');\n  }\n}\n"}
{"label": "17", "index": "32041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, len;\n  char a[101];\n\n  while (cin >> a) {\n    int b[100] = {0};\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        char *p = &a[i - 1];\n        for (j = i - 1; j >= 0; j--) {\n          if (*p == '(' && b[j] == 0) {\n            b[j] = 1;\n            b[i] = 1;\n            break;\n          }\n          p--;\n        }\n      }\n    }\n    cout << a << endl;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(' && b[i] == 0)\n        cout << \"$\";\n      else {\n        if (a[i] == ')' && b[i] == 0)\n          cout << \"?\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], s1[100];\n  int i, len, t;\n  while (scanf(\"%s \", s)) {\n    memset(s1, ' ', sizeof(s1));\n    len = strlen(s);\n    t = 0;\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        t++;\n      if (s[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '?';\n      }\n    }\n    t = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        t++;\n      if (s[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          s1[i] = '$';\n      }\n    }\n    for (i = 0; i < len; i++)\n      cout << s[i];\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      cout << s1[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32043", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n\n  int i = 0;\n  char string[101];\n  char string_copy[101];\n  char string_check[101];\n  int len = 0;\n  int index = 0;\n  int start = 0;\n  int turn = 0;\n  char y = 'n';\n\n  for (i = 0; i <= n; i++) {\n    len = 0;\n\n    scanf(\"%s \", string);\n    while (string[len])\n      len++;\n\n    strcpy(string_copy, string);\n\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] != '(' && string_copy[index] != ')')\n        string_copy[index] = ' ';\n      if (string[index] == '(' || string[index] == ')')\n        y = 'y';\n    }\n    if (y == 'n')\n      continue;\n\n    for (turn = 0; turn <= len / 2; turn++) {\n      y = 'n';\n      start = 0;\n      for (index = 0; index < len; index++) {\n        if (string_copy[index] == '(')\n          start = index;\n        if (string_copy[index] == ')' && string_copy[start] == '(') {\n          string_copy[index] = ' ';\n          string_copy[start] = ' ';\n        }\n      }\n    }\n\n    strcpy(string_check, string_copy);\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] == '(')\n        string_copy[index] = '$';\n      if (string_copy[index] == ')')\n        string_copy[index] = '?';\n    }\n    if (strcmp(string_copy, string_check) != 0) {\n      printf(\"%s %s \", string, string_copy);\n    } else {\n      printf(\"%s \", string);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar b[110];\nchar a[110];\nint opr(int i) {\n  int j;\n  for (j = i - 1; j >= 0; j--) {\n    if (b[j] == '$') {\n      b[j] = ' ';\n      b[i] = ' ';\n      break;\n    }\n  }\n  return 0;\n}\nvoid tag(char *a, char *b) {\n  int l = strlen(a);\n  int i;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  b[l] = '\\0';\n}\nint main() {\n  int i, l;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    printf(\"%s\\n\", a);\n    tag(a, b);\n    for (i = 0; i < l; i++) {\n      if (b[i] == '?') {\n        opr(i);\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101];\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < strlen(a); i++)\n      printf(\"%c\", a[i]);\n    putchar('\\n');\n    for (i = strlen(a) - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < strlen(a); j++)\n          if (a[j] == ')') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n      printf(\"%c\", a[i]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  char c[10000];\n  int i;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c);\n    printf(\"%s\\n\", c);\n    int j, x;\n    x = strlen(c);\n    for (j = 0; j < x; j++) {\n      if (c[j] != '(' && c[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == ')') {\n        int m;\n        for (m = j; m >= 0; m--) {\n          if (c[m] == '(') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32047", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pp[120];\nvoid kuohao(char a[]) {\n\n  int i, j, len = strlen(a);\n  for (i = 0; i <= len - 1; i++) {\n    if (a[i] == ')') {\n      for (j = i; j >= 0; j--) {\n        if (a[j] == '(') {\n          pp[i] = 0;\n          pp[j] = 0;\n          a[i] = 'a';\n          a[j] = 'a';\n          break;\n        }\n        if (j == 0)\n          pp[i] = 1;\n      }\n      a[i] = 'a';\n      kuohao(a);\n    }\n    if (i == len - 1) {\n      for (j = 0; j <= len - 1; j++)\n        if (a[j] == '(')\n          pp[j] = -1;\n      return;\n    }\n  }\n}\n\nint main() {\n  char str[200];\n  while (cin >> str) {\n    cout << str << endl;\n    int i;\n    for (i = 0; i <= 119; i++)\n      pp[i] = 0;\n    kuohao(str);\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (pp[i] == 0)\n        cout << \" \";\n      else if (pp[i] == 1)\n        cout << \"?\";\n      else\n        cout << \"$\";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32048", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n\n    scanf(\"%s \", a);\n    t = strlen(a);\n    show(a, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32049", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, t, n1, n2;\n  int k[100];\n  char a[100][100], b[100];\n  i = 0;\n  while (cin >> a[i]) {\n    k[i] = strlen(a[i]);\n    if (k[i] == 0)\n      break;\n    i++;\n  }\n  t = i;\n  for (i = 0; i < t; i++) {\n    n1 = 0;\n    n2 = 0;\n    for (j = 0; j < k[i]; j++) {\n      b[j] = ' ';\n    }\n    for (j = 0; j < k[i]; j++) {\n      if (n1 < 0)\n        n1 = 0;\n      if (a[i][j] == '(')\n        n1++;\n\n      if (a[i][j] == ')') {\n        if (n1 == 0) {\n          b[j] = '?';\n        }\n        n1--;\n      }\n    }\n    for (j = k[i] - 1; j >= 0; j--) {\n      if (n2 < 0)\n        n2 = 0;\n      if (a[i][j] == ')') {\n        n2++;\n      }\n      if (a[i][j] == '(') {\n        if (n2 == 0) {\n          b[j] = '$';\n        }\n        n2--;\n      }\n    }\n    for (j = 0; j < k[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    cout << endl;\n    for (j = 0; j < k[i]; j++) {\n      cout << b[j];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][101], b[101], c[101];\n  int n, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%s\", a[m]);\n  }\n  for (m = 0; m < n; m++) {\n    int i = 0, j = 0, k = 0;\n    int n;\n    n = strlen(a[m]);\n    for (i = 0; i < n; i++) {\n      b[i] = ' ';\n      c[i] = ' ';\n    }\n\n    for (i = n - 1; i >= 0; i--)\n      if (a[m][i] == '(')\n        b[i] = a[m][i];\n    for (i = 0; i < n; i++)\n      if (a[m][i] == ')')\n        c[i] = a[m][i];\n    for (i = n - 1; i >= 0; i--)\n      if (b[i] == '(') {\n        for (j = i + 1; j < n; j++)\n          if (c[j] == ')') {\n            c[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n      }\n    printf(\"%s \", a[m]);\n    for (i = 0; i < n; i++) {\n      if (b[i] != ' ')\n        a[m][i] = '$';\n      if (c[i] != ' ')\n        a[m][i] = '?';\n      if (b[i] == ' ' && c[i] == ' ')\n        a[m][i] = ' ';\n    }\n    cout << a[m] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32051", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  for (char c[101]; cin.getline(c, 101);) {\n    char a[101] = {' '};\n    int len = strlen(c), cnt = 0, left[101] = {0};\n    for (int i = 0; i < len; i++) {\n      if (c[i] != '(' && c[i] != ')')\n        a[i] = ' ';\n      else {\n        if (c[i] == '(') {\n          a[i] = '$';\n          cnt += 1;\n          left[cnt] = i + 1;\n        } else {\n          if (cnt <= 0)\n            a[i] = '?';\n          else {\n            a[i] = ' ';\n            a[left[cnt] - 1] = ' ';\n            left[cnt] = 0;\n            cnt -= 1;\n          }\n        }\n      }\n    }\n    cout << c << endl;\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32052", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[1000], st2[1000];\n  while (cin.getline(st, 1000)) {\n    for (int i = 1; i <= strlen(st); i++)\n      st2[i - 1] = ' ';\n    st2[strlen(st)] = '\\0';\n\n    int count = 0, z[1000];\n    for (int i = 1; i <= strlen(st); i++)\n      if (st[i - 1] == '(') {\n        count++;\n        z[count] = i;\n      } else if (st[i - 1] == ')') {\n        if (count > 0) {\n          z[count] = 0;\n          count--;\n        } else {\n          st2[i - 1] = '?';\n        }\n      }\n    for (int i = 1; i <= count; i++)\n      st2[z[i] - 1] = '$';\n    cout << st << \"\\n\" << st2 << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar *mystrrchr(char *strcopy, char *end) {\n  char *tmp = end - 1;\n  while (tmp >= strcopy) {\n    if (*tmp == '(') {\n      return tmp;\n    }\n    tmp--;\n  }\n  return NULL;\n}\n\nvoid judge(char *str, char *flag) {\n  char strcopy[101];\n  strcpy(strcopy, str);\n  int len = strlen(strcopy);\n  char *index1 = strchr(strcopy, ')');\n  while (index1 != NULL && (index1 - strcopy) < len) {\n    char *index2 = mystrrchr(strcopy, index1);\n    if (index2 != NULL) {\n      strcopy[index1 - strcopy] = '-';\n      strcopy[index2 - strcopy] = '-';\n    }\n    index1 = strchr(index1 + 1, ')');\n  }\n  int i = 0;\n  for (i = 0; i < len; i++) {\n    if (strcopy[i] == '(')\n      flag[i] = '$';\n    if (strcopy[i] == ')')\n      flag[i] = '?';\n  }\n  cout << str << \" \" << flag << \" \";\n}\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  getchar();\n  char str[101];\n  char flag[101];\n  while (n > 0) {\n    memset(flag, ' ', sizeof(flag));\n\n    cin >> str;\n    flag[strlen(str)] = '\u0000';\n    judge(str, flag);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101];\n  int i, j, k;\n  int l, r;\n  int len;\n  while (cin >> a) {\n    l = 0;\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (a[i] == 0) {\n        len = i;\n        break;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      b[i] = ' ';\n    }\n    b[len] = 0;\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        l++;\n      if (a[i] == ')')\n        l--;\n      if (l < 0) {\n        b[i] = '?';\n        l = 0;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[len - i - 1] == ')')\n        r++;\n      if (a[len - i - 1] == '(')\n        r--;\n      if (r < 0) {\n        b[len - i - 1] = '$';\n        r = 0;\n      }\n    }\n    cout << a << endl << b << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32055", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[105] = {'\\0'}, sign[105] = {'\\0'};\n  int length, i, j;\n  cin.getline(a, 101, '\\n');\n  while (a[0] != '\\0') {\n    length = strlen(a);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < length; i++) {\n      if (a[i] != ')')\n        continue;\n      else if (i > 0) {\n        j = i - 1;\n        while (j >= 0 && a[j] != '(')\n          j--;\n        if (a[j] == '(') {\n          a[i] = '\\0';\n          a[j] = '\\0';\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (a[i] == '(')\n        sign[i] = '$';\n      else {\n        if (a[i] == ')')\n          sign[i] = '?';\n        else\n          sign[i] = ' ';\n      }\n    }\n    cout << sign;\n    for (i = 0; i < 105; i++) {\n      a[i] = '\\0';\n      sign[i] = '\\0';\n    }\n    cin.getline(a, 101, '\\n');\n    if (a[0] != '\\0')\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32056", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int i, count, j, b[101];\n  while (scanf(\"%s \", s)) {\n    count = 0;\n    for (i = 0; i < strlen(s); i++)\n      b[i] = 0;\n    for (i = 0; s[i] != '\u0000'; i++) {\n      if (s[i] == '(') {\n        c[i] = '$';\n        count++;\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        if (count != 0) {\n          for (j = i; j >= 0; j--) {\n            if (s[j] == '(' && b[j] == -1) {\n              c[j] = ' ';\n              c[i] = ' ';\n              count--;\n              b[j] = 0;\n              break;\n            }\n          }\n        } else\n          c[i] = '?';\n      } else\n        c[i] = ' ';\n    }\n    c[i] = '\u0000';\n    printf(\"%s %s \", s, c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32057", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[100], b[100];\n  int left[100], k = 0, len, i;\n  while (scanf(\"%s\", &a) != EOF) {\n    len = strlen(a);\n    puts(a);\n    for (i = 0; i < len; i++) {\n      b[i] = 32;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        k++;\n        left[k] = i;\n      }\n    }\n    for (; k > 0; k--) {\n      for (i = left[k]; i < len; i++) {\n        if (a[i] == ')') {\n          a[i] = ' ';\n          a[left[k]] = ' ';\n          break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n\n      if (a[i] == ')')\n        b[i] = '?';\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32058", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[1000] = {'0'};\nchar c[1000] = {' '};\nint qq, pp;\nint t = 0;\nint x(int m) {\n  if (qq <= m - 1) {\n    if (a[qq] == '(') {\n      qq++;\n      t++;\n      x(m);\n    } else if (a[qq] == ')') {\n      qq++;\n      t--;\n      if (t == -1) {\n        c[qq - 1] = '?';\n        t = 0;\n      }\n      x(m);\n    } else if (a[qq] != '(' && a[qq] != ')') {\n      qq++;\n      x(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint y(int m) {\n  if (pp >= 0) {\n    if (a[pp] == ')') {\n      pp--;\n      t++;\n      y(m);\n    } else if (a[pp] == '(') {\n      pp--;\n      t--;\n      if (t == -1) {\n        c[pp + 1] = '$';\n        t = 0;\n      }\n      y(m);\n    } else if (a[pp] != '(' && a[pp] != ')') {\n      pp--;\n      y(m);\n    }\n  }\n  t = 0;\n  return 0;\n}\nint main() {\n  char b;\n  int i = 0;\n  while (cin.get(b)) {\n    if (b != '\\n')\n      a[i++] = b;\n    else if (b == '\\n') {\n      for (int j3 = 0; j3 <= i - 1; j3++)\n        c[j3] = ' ';\n      cout << a << endl;\n      qq = 0;\n      x(i);\n      pp = i - 1;\n      y(i);\n      for (int j = 0; j <= i - 1; j++)\n        cout << c[j];\n      cout << '\\n';\n      for (int j1 = 0; j1 <= i - 1; j1++) {\n        c[j1] = ' ';\n        a[j1] = '\\0';\n      }\n      i = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "32059", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[100], b[100];\n  int left[100], k = 0, len, i;\n  while (scanf(\"%s\", &a) != EOF) {\n    len = strlen(a);\n    puts(a);\n    for (i = 0; i < len; i++) {\n      b[i] = 32;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        k++;\n        left[k] = i;\n      }\n    }\n    for (; k > 0; k--) {\n      for (i = left[k]; i < len; i++) {\n        if (a[i] == ')') {\n          a[i] = ' ';\n          a[left[k]] = ' ';\n          break;\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n\n      if (a[i] == ')') {\n        b[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", b[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[160], ans[160];\n  int st[160], i, si;\n  for (; scanf(\"%s\", s) != EOF;) {\n    for (ans[0] = ' ', si = i = 0; i < strlen(s);\n         si -= (s[i] == ')' && si > 0), ans[++i] = ' ')\n      if (s[i] == '(')\n        st[si++] = i;\n      else if (s[i] == ')') {\n        ans[i] = (si > 0) ? ' ' : '?';\n      }\n    for (ans[strlen(s)] = '\\0', i = 0; i < si; i++)\n      ans[st[i]] = '$';\n    cout << s << \"\\n\" << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char a[1000], b[1000];\n  int j, l, r;\n  for (i = 0; i < n; i++) {\n\n    memset(a, '\\n', 200);\n    memset(b, '\\n', 200);\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n        for (r = j - 1; r >= 0; r--) {\n          if (b[r] == '$') {\n            b[r] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      }\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int n, j;\n  int left;\n  cin >> n;\n  cin.get();\n  for (j = 1; j <= n; j++) {\n    left = 0;\n\n    cin.getline(line, 101);\n    int len = strlen(line);\n    for (int i = 0; i <= 100; i++)\n      label[i] = ' ';\n    for (int i = 0; i <= len - 1; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left == 0)\n          label[i] = '?';\n        else {\n          left--;\n        }\n      }\n    }\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a, t = 0;\nchar A[110] = {'\\0'};\nvoid cal(int m) {\n  while (t <= a) {\n    if (A[t] == '(') {\n      cal(t++);\n    } else if (A[t] == ')') {\n      A[m] = 'a';\n      A[t++] = 'a';\n      break;\n    } else\n      t++;\n  }\n}\nint main() {\n  while (scanf(\"%s \", A)) {\n    char B[110];\n    a = strlen(A) - 1;\n    for (int i = 0; i <= a; i++)\n      B[i] = A[i];\n    t = 0;\n    while (t <= a)\n      if (A[t++] == '(') {\n        cal(t - 1);\n      }\n    for (int i = 0; i <= a; i++)\n      cout << B[i];\n    cout << '\\n';\n    for (int i = 0; i <= a - 1; i++) {\n      if (A[i] == '(')\n        cout << '$';\n      if (A[i] == ')')\n        cout << '?';\n      if (A[i] != '(' && A[i] != ')')\n        printf(\" \");\n    }\n    if (A[a] == '(')\n      cout << '$' << endl;\n    if (A[a] == ')')\n      cout << '?' << endl;\n    if (A[a] != '(' && A[a] != ')')\n      cout << \" \" << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[1000];\nvoid right(int i, int j) \n{\n  if (s[i] == '\\0')\n    ;\n  else if (s[i] == '(') {\n    s[i] = '$';\n    right(i + 1, j + 1);\n  } else if (s[i] == ')') {\n    if (j == 0) {\n      s[i] = '?';\n      right(i + 1, j);\n    } else {\n      for (int k = i;; k--)\n        if (s[k] == '$') {\n          s[k] = ' ';\n          break;\n        }\n      s[i] = ' ';\n      right(i + 1, j - 1);\n    }\n  } else {\n    s[i] = ' ';\n    right(i + 1, j);\n  }\n}\nint main() {\n  for (; cin >> s;) {\n    cout << s << endl;\n    right(0, 0);\n    cout << s << endl;\n  }\n}\n"}
{"label": "17", "index": "32065", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[105];\n  int mm;\n  cin >> mm;\n  while (mm--) {\n    while (cin >> a) {\n      int n = strlen(a);\n      int i = 0, j, b[105];\n      for (i = 0; a[i]; i++) {\n        if (a[i] == '(') {\n          b[i] = 1;\n        } else if (a[i] == ')') {\n          b[i] = -1;\n        } else\n          b[i] = 0;\n      }\n      for (i = 0; i < n; i++) {\n        if (b[i] == -1) {\n          for (j = i; j >= 0; j--) {\n            if (b[j] == 1) {\n              b[i] = 0;\n              b[j] = 0;\n              break;\n            }\n          }\n        }\n      }\n      puts(a);\n      printf(\" \");\n      for (i = 0; i < n; i++) {\n        if (b[i] == 0)\n          printf(\" \");\n        else if (b[i] == 1)\n          printf(\"$\");\n        else\n          printf(\"?\");\n      }\n\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32066", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n  int i, j;\n\n  while (scanf(\"%s\", s) != EOF) {\n    puts(s);\n    int a[100] = {0};\n    for (i = 0; s[i] != '\\0'; i++)\n      if (s[i] == '(')\n        a[i] = -1;\n      else if (s[i] == ')')\n        a[i] = 1;\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1) {\n            a[i] = a[j] = 0;\n            break;\n          }\n\n    for (i = 0; s[i] != '\\0'; i++)\n      if (a[i] == 1)\n        printf(\"?\");\n      else if (a[i] == -1)\n        printf(\"$\");\n      else if (a[i] == 0)\n        printf(\" \");\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void kuohao(char c[]); \n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' '; \n    kuohao(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?'; \n    cout << c << endl;\n  }\n  return 0;\n}\nvoid kuohao(char c[]) {\n  int i, j, n;\n  for (n = 0; c[n] != '\\0'; n++)\n    ; \n  for (i = n - 1; i >= 0; i--)\n    if (c[i] == '(') {\n      for (j = i + 1; c[j] != '\\0'; j++)\n        if (c[j] == ')') {\n          c[i] = c[j] = ' ';\n          break;\n        }\n      if (c[j] == '\\0') \n        c[i] = '$';\n      kuohao(c); \n    }\n}\n"}
{"label": "17", "index": "32068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[105] = {0};\n  while (cin >> c) {\n\n    int a[105] = {0};\n\n    int n, i, j;\n    n = strlen(c);\n    for (i = 0; i < n; i++)\n      a[i] = 1;\n    for (i = n - 1; i >= 0; i--) {\n      if (c[i] == '(')\n\n      {\n\n        for (j = i; j < n; j++) {\n          if ((c[j] == ')') && (a[j] != 0)) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << endl;\n\n    for (i = 0; i < n; i++) {\n      if ((c[i] == '(') && (a[i] == 1))\n\n        cout << \"$\";\n      if ((c[i] == ')') && (a[i] == 1))\n        cout << \"?\";\n      if ((c[i] != '(') && (c[i] != ')') && (c[i] != '\\0'))\n        cout << \" \";\n      if ((c[i] == '(') && (a[i] == 0))\n        cout << \" \";\n      if ((c[i] == ')') && (a[i] == 0))\n        cout << \" \";\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101] = {0};\n  int pro[101] = {0}, j = 0, p = 0, q = 0;\n  while (cin >> str) {\n    for (int i = 1; i <= strlen(str); i++) {\n      if (str[i - 1] != '(' && str[i - 1] != ')') {\n        pro[i - 1] = 2;\n      }\n      if (str[i - 1] == ')') {\n        pro[i - 1] = 1;\n        for (j = i - 1; j >= 1; j--) {\n          if (str[j - 1] == '(' && pro[j - 1] == 0) {\n            pro[j - 1] = 1;\n            break;\n          }\n        }\n        if (j == 0) {\n          pro[i - 1] = 0;\n        }\n      }\n    }\n    cout << str << endl;\n    for (p = strlen(str); p >= 1; p--) {\n      if (pro[p - 1] == 0) {\n        break;\n      }\n    }\n    for (q = 1; q <= strlen(str); q++) {\n      if (pro[q - 1] == 0) {\n        break;\n      }\n    }\n    for (int k = q; k <= p; k++) {\n      if (str[k - 1] == '(' && pro[k - 1] == 0) {\n        cout << \"$\";\n      } else if (str[k - 1] == ')' && pro[k - 1] == 0) {\n        cout << \"?\";\n      } else {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n    for (int clear = 1; clear <= 101; clear++) {\n      str[clear - 1] = 0;\n      pro[clear - 1] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint process(void);\nint main(void) {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++)\n    process();\n  return 0;\n}\n\nint process(void) {\n  char str[105], tstr[105] = {0};\n  cin >> str;\n  int len = strlen(str);\n  int count = 0;\n  for (int i = 0; i < len; i++) {\n    if (str[i] == '(')\n      count++;\n    else if (str[i] == ')') {\n      if (count > 0)\n        count--;\n      else\n        tstr[i] = '?';\n    }\n  }\n  count = 0;\n  for (int i = len - 1; i >= 0; i--) {\n    if (str[i] == ')')\n      count++;\n    else if (str[i] == '(') {\n      if (count > 0)\n        count--;\n      else {\n        tstr[i] = '$';\n      }\n    }\n  }\n  cout << str;\n  cout << endl;\n  for (int i = 0; i < len; i++) {\n    if (tstr[i])\n      cout << tstr[i];\n    else\n      cout << ' ';\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "17", "index": "32071", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, n;\n  while (scanf(\"%s\", a) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = n - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == ')') {\n            a[i] = 'a';\n            a[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "32072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, flag[101] = {0};\n  char str[101];\n  while (cin >> str) {\n    for (i = 0; i < strlen(str); i++) {\n      cout << str[i];\n      if (str[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (str[j] == '(' && flag[j] == 0) {\n            flag[i] = 1;\n            flag[j] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << endl;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(' && flag[i] == 0)\n        cout << \"$\";\n      else if (str[i] == ')' && flag[i] == 0)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n    memset(flag, 0, sizeof(flag));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int h, i, j, k, l, m, n, len, left = 0, t = 0, c[101] = {0};\n  char a[101], b[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int c[101] = {0};\n    left = 0;\n    t = 0;\n    scanf(\"%s\", a);\n    len = strlen(a);\n\n    for (j = 0; j < len; j++) {\n      if (a[j] != '(' && a[j] != ')')\n        b[j] = ' ';\n      if (a[j] == '(') {\n        left++;\n        b[j] = '$';\n        c[t] = j;\n        t++;\n      }\n      if (a[j] == ')') {\n        if (left == 0) {\n          b[j] = '?';\n        } else {\n          t--;\n          b[c[t]] = ' ';\n          b[j] = ' ';\n          left--;\n        }\n      }\n    }\n    printf(\"%s\\n\", a);\n    for (h = 0; h < len; h++)\n      printf(\"%c\", b[h]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  static char c[102], d[102];\n  int i, j, k, s;\n  while (cin >> c) {\n    puts(c);\n    for (i = 0; c[i] != '\u0000'; i++) {\n\n      if (c[i] == '(')\n        d[i] = 1;\n      else if (c[i] == ')')\n        d[i] = 2;\n      else\n        d[i] = 3;\n    }\n    while (1) {\n      s = 0;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          break;\n        }\n      }\n      for (k = j + 1; k <= i - 1; k++) {\n        if (d[k] == 2) {\n          s = 1;\n          break;\n        }\n      }\n      if (s == 0)\n        break;\n      for (j = 0; j <= i - 2; j++) {\n        if (d[j] == 1) {\n          for (k = j + 1; k <= i - 1; k++) {\n            if (d[k] == 1) {\n              j = k;\n            }\n            if (d[k] == 2) {\n              d[j] = 3;\n              d[k] = 3;\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (k = 0; k <= i - 1; k++) {\n      switch (d[k]) {\n      case 1:\n        printf(\"$\");\n        break;\n      case 2:\n        printf(\"?\");\n        break;\n      case 3:\n        printf(\" \");\n        break;\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m;\n  char a[110];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int b[110] = {0};\n    scanf(\"%s\", a);\n    m = strlen(a);\n    for (j = 0; j < m; j++) {\n      if (a[j] == '(')\n        b[j] = 1;\n      else if (a[j] == ')')\n        b[j] = -1;\n    }\n    for (j = m - 1; j >= 0; j--) {\n      if (b[j] == 1) {\n        for (k = j; k < m; k++) {\n          if (b[k] == -1) {\n            b[j] = 0;\n            b[k] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < m; k++) {\n      if (b[k] == 1)\n        printf(\"$\");\n      else if (b[k] == -1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32076", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, m = 0, n = 0, k = 0;\n  char s[105];\n  while (cin.getline(s, 105, '\\n')) {\n    int zuo[100], you[100], flag[105] = {0};\n    char a[105];\n    for (i = 0; s[i] != '\\0'; i++) {\n      a[i] = ' ';\n    }\n    a[i] = '\\0';\n    m = 0;\n    n = 0;\n    for (j = 0; j < i; j++) {\n      if (s[j] == '(')\n        zuo[m++] = j;\n      if (s[j] == ')')\n        you[n++] = j;\n    }\n    for (j = 0; j < n; j++) {\n      for (k = you[j] - 1; k >= 0; k--) {\n        if (s[k] == '(' && flag[k] == 0) {\n          flag[k] = 1;\n          flag[you[j]] = 1;\n          break;\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (flag[k] == 0 && s[k] == '(')\n        a[k] = '$';\n      if (flag[k] == 0 && s[k] == ')')\n        a[k] = '?';\n    }\n    cout << s << endl;\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101], b[101];\n  while (cin.getline(a, 101)) {\n    for (i = 0; i <= 100; i++)\n      b[i] = ' ';\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            break;\n          }\n        if (j == -1)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << b[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, left;\n  char s[102] = {'\\0'}, t[102] = {'\\0'};\n  int num[102];\n  while (scanf(\"%s\", s) != EOF) {\n    printf(\"%s\\n\", s);\n    k = strlen(s);\n    left = 0;\n    for (i = 0; i <= k - 1; i++) {\n      switch (s[i]) {\n      case 40: {\n        left = left + 1;\n        num[left] = i;\n        t[i] = '$';\n        break;\n      }\n      case 41: {\n        if (left != 0) {\n          t[num[left]] = 32;\n          t[i] = 32;\n          left = left - 1;\n        } else {\n          t[i] = '?';\n        }\n        break;\n      }\n      default: {\n        t[i] = 32;\n        break;\n      }\n      }\n    }\n    for (i = 0; i <= k - 1; i++)\n      printf(\"%c\", t[i]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint find(char s[], int pos) {\n  int i, p = 0, q = 0;\n  if (pos < 0)\n    return 0;\n  if (s[pos] == ')')\n    for (i = pos - 1; i >= 0; i--) {\n      if (s[i] == '(')\n        p++;\n      if (s[i] == ')')\n        q++;\n      if ((s[i] == '(') && (p - q == 1)) {\n        s[i] = ' ';\n        s[pos] = ' ';\n        break;\n      }\n    }\n  find(s, pos - 1);\n  return 0;\n}\nint main() {\n  char s[101], ss[101], ans[101];\n  int i, n;\n  while (true) {\n    cin >> s;\n    if (!cin)\n      break;\n    strcpy(ss, s);\n    memset(ans, ' ', sizeof(ans));\n    n = strlen(s) - 1;\n    find(s, n);\n    for (i = 0; i <= n; i++) {\n      if (s[i] == '(')\n        ans[i] = '$';\n      if (s[i] == ')')\n        ans[i] = '?';\n    }\n    ans[n + 1] = '\\0';\n    printf(\"%s\\n\", ss);\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, len, lnum, num = 0, left[102] = {-1}, fail[102] = {0}, t = 0;\n  char s1[102];\n  while (scanf(\"%s\", s1) != EOF) {\n    printf(\"%s\\n\", s1);\n    len = strlen(s1);\n    lnum = 0;\n    for (i = 0; i < len; i++) {\n      if (s1[i] == '(') {\n        lnum++;\n        left[lnum] = i;\n      }\n\n      if (s1[i] == ')') {\n        if (lnum == 0)\n          fail[i] = 2;\n        else {\n          left[lnum] = -1;\n          lnum--;\n        }\n      }\n    }\n    for (i = 1; i <= lnum; i++) {\n      fail[left[i]] = 1;\n      left[i] = -1;\n    }\n\n    for (i = 0; i < len; i++)\n      if (fail[i] > 0)\n        num++;\n    for (i = 0; i < len && num > 0; i++) {\n      if (fail[i] == 2) {\n        printf(\"?\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 1) {\n        printf(\"$\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 0 && t == 1)\n        cout << \" \";\n      fail[i] = 0;\n    }\n    t = 0;\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32081", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int n, i, p, j, k, s, l;\n  char a[110], b[110] = {' '};\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    scanf(\"%s\", &a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        s += 1;\n        b[i] = ' ';\n        continue;\n      } else if (a[i] == ')') {\n        if (s > 0) {\n          s -= 1;\n          b[i] = ' ';\n          continue;\n\n        } else if (s == 0)\n          b[i] = '?';\n        continue;\n      } else\n        b[i] = ' ';\n      continue;\n    }\n    s = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (a[i] == ')') {\n        s += 1;\n        continue;\n      } else if (a[i] == '(') {\n        if (s > 0) {\n          s -= 1;\n          continue;\n\n        } else if (s == 0)\n          b[i] = '$';\n        continue;\n      }\n    }\n\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", a[j]);\n    }\n\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++) {\n      printf(\"%c\", b[j]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32082", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len;\nchar str[101];\nvoid f(int p) {\n  int m = -1, n = -1;\n  for (int i = p; i >= 0; i--) {\n    if (*(str + i) == '(') {\n      m = i;\n      break;\n    }\n  }\n  for (int i = m + 1; i <= len - 1; i++) {\n    if (*(str + i) == ')') {\n      n = i;\n      break;\n    }\n  }\n  if (m >= 0 && n >= 0) {\n    str[m] = '#';\n    str[n] = '#';\n  }\n  if (m > 0) {\n    f(m - 1);\n  }\n}\n\nint main() {\n  while (cin >> str) {\n    len = strlen(str);\n    cout << str << endl;\n    f(len);\n    for (int j = 0; j <= len - 1; j++) {\n      if (str[j] == '(')\n        cout << \"$\";\n      else if (str[j] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32083", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[101], b[101];\nint panduan[101];\nint l;\nvoid deal(int k) {\n  if (k > 0) {\n    if (a[k - 1] == ')') {\n      panduan[k - 1] = 1;\n      deal(k - 1);\n    } else if (a[k - 1] == '(') {\n      panduan[k - 1] = 2;\n      for (int i = k; i < l; i++)\n        if (panduan[i] == 1) {\n          panduan[k - 1] = 0;\n          panduan[i] = 0;\n          break;\n        }\n      deal(k - 1);\n    } else\n      deal(k - 1);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 101; i++) {\n    a[i] = ' ';\n    b[i] = ' ';\n    panduan[i] = 0;\n  }\n  while (scanf(\"%s \", a)) {\n    l = strlen(a);\n    deal(l);\n    for (i = 0; i < l; i++) {\n      if (panduan[i] == 1)\n        b[i] = '?';\n      if (panduan[i] == 2)\n        b[i] = '$';\n    }\n    for (i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < l; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < 101; i++) {\n      a[i] = ' ';\n      b[i] = ' ';\n      panduan[i] = 0;\n    }\n  }\n}\n"}
{"label": "17", "index": "32084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101] = {\"0\"};\n  int i, j, len, zuo, you, a[100];\n  while (scanf(\"%s\", str) != EOF) {\n    len = strlen(str);\n    for (i = 0; i < len; i++)\n      a[i] = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        zuo = 0;\n        you = 0;\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == '(' && a[j] != 1)\n            zuo++;\n          else if (str[j] == ')')\n            you++;\n        }\n        if (you < zuo + 1)\n          a[i] = 1;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        zuo = 0;\n        you = 0;\n        for (j = 0; j < i; j++) {\n          if (str[j] == '(')\n            zuo++;\n          else if (str[j] == ')' && a[j] != -1)\n            you++;\n        }\n        if (zuo < you + 1)\n          a[i] = -1;\n      }\n    }\n    cout << str << \"\\n\";\n    for (i = 0; i < len; i++) {\n      if (a[i] == 0)\n        printf(\" \");\n      else if (a[i] == 1)\n        printf(\"$\");\n      else\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (1) {\n    char str[101];\n    int final[101] = {0};\n    cin.getline(str, 101);\n    if (str[0] == '\\0')\n      break;\n    int i = 0, p = 0, q = 0, k = 0, flag = 0;\n    while (str[i] != '\\0') {\n      if (str[i] == '(')\n        final[i] = 1;\n      if (str[i] == ')') {\n        final[i] = 2;\n        for (int j = i; j >= 0; j--) {\n          if (final[j] == 1) {\n            final[i] = 0;\n            final[j] = 0;\n            break;\n          }\n        }\n      }\n      i++;\n    }\n    cout << str << endl;\n    while (str[k] != '\\0') {\n      if (final[k] == 1 || final[k] == 2) {\n        p = k;\n        if (flag == 0) {\n          q = k;\n          flag = 1;\n        }\n      }\n      k++;\n    }\n    for (int j = q; j <= p; j++) {\n      if (final[j] == 1)\n        cout << '$';\n      else if (final[j] == 2)\n        cout << '?';\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32086", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  for (scanf(\"%d%*c\", &n); n > 0; n--) {\n    char a[101];\n\n    cin >> a;\n    puts(a);\n    int i, j, k, l = strlen(a);\n    do {\n      for (j = 0; j < l; j++)\n        if (a[j] == ')')\n          break;\n      if (j != l) {\n        for (k = j; k >= 0; k--)\n          if (a[k] == '(')\n            break;\n        if (k < 0)\n          a[j] = '?';\n        else\n          a[j] = a[k] = ' ';\n      }\n    } while (j != l);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] != '?')\n        a[i] = ' ';\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nconst int maxn = 110;\n\nint main() {\n  char str[maxn], str2[maxn];\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    for (int i = 0; i < len; i++)\n      str2[i] = str[i];\n    for (int i = 0; i < len; i++) {\n      if (str[i] == ')') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = str[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++)\n      printf(\"%c\", str2[i]);\n    printf(\"\\n\");\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(')\n        printf(\"$\");\n      else if (str[i] == ')')\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32088", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], s0[1000], t[1000];\n  int len, i, j;\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    strcpy(s0, s);\n    for (i = 0; i < len; i++)\n      if (s0[i] == ')' && i > 0)\n        for (j = i - 1; j >= 0; j--)\n          if (s0[j] == '(') {\n            s0[i] = ' ';\n            s0[j] = ' ';\n            break;\n          }\n\n    for (i = 0; i < len; i++) {\n      if (s0[i] == '(')\n        t[i] = '$';\n      else {\n        if (s0[i] == ')') {\n          t[i] = '?';\n        } else\n          t[i] = ' ';\n      }\n    }\n\n    printf(\"%s \", s);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", t[i]);\n    putchar(' ');\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32089", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int som;\n  char a[105];\n  char b[105];\n  int len;\n  int i, j;\n  cin >> n;\n  for (som = 1; som <= n; som++) {\n    scanf(\"%s\", a);\n    strcpy(b, a);\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '$') {\n        for (j = i + 1; j < len; j++) {\n          if (b[j] == '?') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n  }\n}\n"}
{"label": "17", "index": "32090", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int n, p, i, j, len;\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    char a[150];\n    scanf(\"%s\", a);\n    len = strlen(a);\n    char b[150];\n    for (i = 0; a[i] != 0; i++) {\n      switch (a[i]) {\n      case '(':\n        b[i] = '$';\n        break;\n      case ')':\n        b[i] = '?';\n        break;\n      default:\n        b[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\", a);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pipei(char str[]) {\n  int i, la, stack[100], k = 0;\n  char res[101];\n  la = strlen(str);\n  for (i = 0; i < la; i++)\n    res[i] = ' ';\n  res[la] = '\\0';\n  for (i = 0; i < la; i++) {\n    if (str[i] == ')') {\n      if (k == 0 || stack[k - 1] > 0)\n        stack[k++] = i + 1;\n      else\n        k--;\n    } else if (str[i] == '(')\n      stack[k++] = -(i + 1);\n  }\n  for (i = 0; i < k; i++) {\n    int a = stack[i];\n    if (a < 0)\n      res[-a - 1] = '$';\n    else\n      res[a - 1] = '?';\n  }\n  printf(\"%s\\n\", str);\n  printf(\"%s\\n\", res);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  cin.get();\n  char str[101];\n  for (i = 0; i < n; i++) {\n\n    cin.getline(str, 101);\n    pipei(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char num[101], t[101];\n  int s[101];\n  int k, j;\n  int len;\n  int aa;\n\n  while (scanf(\"%s \", num)) {\n    strcpy(t, num);\n    len = strlen(num);\n    for (k = 0; k < len; k++) {\n      s[k] = 1;\n    }\n    for (k = 0; k < len; k++) {\n      if (num[k] == ')') {\n        for (j = k - 1; j >= 0; j--) {\n          if (num[j] == '(') {\n            s[j] = 0;\n            s[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", t);\n    for (aa = 0; aa < len; aa++) {\n      if (s[aa] == 1 && t[aa] == '(')\n        printf(\"$\");\n      else if (s[aa] == 1 && t[aa] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "32093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[120], a_cout[120] = {0}, b;\n  int num[120] = {0};\n  int i, j, k;\n  while (cin.get(a[0])) {\n    num[0] = 0;\n    for (i = 1; i < 120; i++) {\n      a[i] = 0;\n      num[i] = 0;\n    }\n    for (i = 0;; i++) {\n      if (i != 0)\n        cin.get(a[i]);\n      if (a[i] == '\\n')\n        break;\n      else {\n        if (a[i] == '(') {\n          num[i] = 1;\n        }\n        if (a[i] == ')') {\n          num[i] = 2;\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      if (a[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (a[k] == '(' && num[k] != 0) {\n            num[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < i; j++) {\n      cout << a[j];\n    }\n    cout << endl;\n    for (j = 0; j < i; j++) {\n      if (num[j] == 0)\n        cout << \" \";\n      if (num[j] == 1)\n        cout << \"$\";\n      if (num[j] == 2) {\n        cout << \"?\";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m = 0, x;\n  scanf(\"%d\", &n);\n  char a[100][1000];\n  for (i = 0; i < n + 1; i++)\n\n    cin >> a[i];\n  for (i = 0; i < n + 1; i++) {\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n    x = j;\n    for (j = 0; j < x; j++) {\n      if (a[i][j] == ')') {\n        if (j == 0)\n          a[i][j] = '?';\n\n        for (m = 1; j - m >= 0; m++)\n          if (a[i][j - m] == '(') {\n            a[i][j - m] = ' ';\n            a[i][j] = ' ';\n            break;\n          } else\n            a[i][j] = '?';\n      }\n      if (a[i][j] != '(' && a[i][j] != ')' && a[i][j] != '?')\n        a[i][j] = ' ';\n    }\n    for (j = x - 1; j >= 0; j--)\n      if (a[i][j] == '(') {\n        if (j == x - 1)\n          a[i][j] = '$';\n        else\n          for (m = 1; j + m < x; m++)\n            if (a[i][j + m] == ')') {\n              a[i][j] = ' ';\n              a[i][j + m] = ' ';\n              break;\n            } else\n              a[i][j] = '$';\n      }\n    for (j = 0; j < x; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, l, i, k;\n  char str[200] = {0};\n  scanf(\"%d\\n\", &n);\n  while (n) {\n    scanf(\"%s\", str);\n    puts(str);\n    cout << \"\\n\";\n    l = strlen(str);\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (k = i; k < l; k++) {\n          if (str[k] == ')') {\n            str[i] = ' ';\n            str[k] = ' ';\n            k = l;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n      } else if (str[i] == ')') {\n        str[i] = '?';\n      } else {\n        str[i] = ' ';\n      }\n    }\n    puts(str);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], ss[101];\n  int len, i, j, q, h = 0;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(ss, s);\n    for (i = 0; i < len; i++)\n      if (s[i] == '(') {\n        h = i;\n        for (j = i + 1; j < len; j++)\n          if (s[j] == '(')\n            i = j;\n          else if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        if (j == len)\n          break;\n        if (h == i)\n          continue;\n        else\n          i = h - 1;\n      }\n    for (q = 0; q < len; q++)\n      if (s[q] == ')')\n        s[q] = '?';\n      else {\n        if (s[q] == '(')\n          s[q] = '$';\n        else\n          s[q] = ' ';\n      }\n    printf(\"%s \", ss);\n    cout << s << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int left, right, pos[101], pos1[101], i;\n  while (scanf(\"%s \", a)) {\n    left = right = 0;\n    memset(pos, 0, sizeof(pos));\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (a[i] == ')') {\n        if (left == 0) {\n          right++;\n          pos1[right] = i;\n        } else {\n          pos[left] = 200;\n          left--;\n        }\n      }\n    }\n    for (i = 1; i <= left; i++)\n      a[pos[i]] = 1;\n    for (i = 1; i <= right; i++)\n      a[pos1[i]] = 2;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 1 && a[i] != 2)\n        cout << \" \";\n      else {\n        if (a[i] == 1)\n          cout << \"$\";\n        else\n          printf(\"?\");\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar investigate(char a[]) {\n  int i, j, k, n;\n  int p1 = 0, p2 = 0, w, t = 0, t1 = 0;\n  n = strlen(a);\n  char b[100];\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      p1++;\n    if (a[i] == ')')\n      p2++;\n  }\n\n  for (i = 0; i < n; i++) {\n    if ((i == (n - 1)) && (t > t1)) {\n      i = -1;\n      t1 = t;\n      goto loop;\n    } else if (a[i] != '(') {\n      b[i] == ' ';\n      continue;\n    } else {\n      for (j = i + 1; j < n; j++) {\n        if (a[j] == '(') {\n          i = j - 1;\n          break;\n        } else if (a[j] == ')') {\n          a[i] = '[';\n          a[j] = ']';\n          t++;\n          break;\n        }\n      }\n    }\n  loop:;\n  }\n\n  for (i = 0; i < n; i++) {\n    if (a[i] == '(')\n      b[i] = '$';\n    else if (a[i] == ')')\n      b[i] = '?';\n    else\n      b[i] = ' ';\n  }\n  for (i = 0; i < n; i++) {\n    if (a[i] == '[')\n      a[i] = '(';\n    if (a[i] == ']')\n      a[i] = ')';\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%c\", a[i]);\n  cout << \" \";\n  for (i = 0; i < n; i++)\n    printf(\"%c\", b[i]);\n\n  return 0;\n}\n\nint main() {\n  int i, j;\n  char a[100];\n  while (cin >> a) {\n    investigate(a);\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "32099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid pipei(char str[]) {\n  int i, la, stack[100], k = 0;\n  char res[101];\n  la = strlen(str);\n  for (i = 0; i < la; i++)\n    res[i] = ' ';\n  res[la] = '\\0';\n  for (i = 0; i < la; i++) {\n    if (str[i] == ')') {\n      if (k == 0 || stack[k - 1] > 0)\n        stack[k++] = i + 1;\n      else\n        k--;\n    } else if (str[i] == '(')\n      stack[k++] = -(i + 1);\n  }\n  for (i = 0; i < k; i++) {\n    int a = stack[i];\n    if (a < 0)\n      res[-a - 1] = '$';\n    else\n      res[a - 1] = '?';\n  }\n  cout << str << endl;\n  printf(\"%s\\n\", res);\n}\nint main() {\n  int n, i;\n  cin >> n;\n  cin.get();\n  char str[101];\n  for (i = 0; i < n; i++) {\n\n    cin.getline(str, 101);\n    pipei(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32100", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  char a[101];\n  int i, j, flag;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == 40) {\n        if (i == strlen(a) - 1)\n          printf(\"$\");\n        else {\n          flag = 1;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (a[j] == 41 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 41 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 40) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"$\");\n        }\n      }\n\n      else if (a[i] == 41) {\n        if (i == 0)\n          printf(\"?\");\n        else {\n          flag = 1;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == 40 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 40 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 41) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"?\");\n        }\n      }\n\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "32101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[110], temp[110], c[110];\n  int i, figure;\n  while (scanf(\"%s \", ch)) {\n    figure = 0;\n    for (i = 0; ch[i] != '\u0000'; i++) {\n      temp[i] = ' ';\n      switch (ch[i]) {\n      case '(':\n        c[figure++] = i;\n        temp[i] = '$';\n        break;\n      case ')':\n        if (figure) {\n          figure--;\n          temp[c[figure]] = ' ';\n        } else\n          temp[i] = '?';\n        break;\n      }\n    }\n    temp[i] = '\u0000';\n    cout << ch << \" \" << temp << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, r, n, x = 0, z;\n  char a[102], b[102];\n  while (scanf(\"%c\", &a[1]) != EOF) {\n    i = 1;\n    while (a[i] != '\\n') {\n      i++;\n      scanf(\"%c\", &a[i]);\n    }\n    for (n = 1; n <= i - 1; n++)\n      printf(\"%c\", a[n]);\n    printf(\"\\n\");\n    x = 0;\n    for (n = 1; n <= i - 1; n++) {\n      b[n] = ' ';\n      if (a[n] == ')' && x == 0)\n        b[n] = '?';\n      if (a[n] == '(')\n        x = x + 1;\n      if (a[n] == ')' && x != 0)\n        x = x - 1;\n    }\n    x = 0;\n    for (n = i - 1; n >= 1; n--) {\n      if (a[n] == ')')\n        x = x + 1;\n      if (a[n] == '(' && x == 0)\n        b[n] = 36;\n      if (a[n] == '(' && x != 0)\n        x = x - 1;\n    }\n    for (z = 1; z <= i - 1; z++)\n      printf(\"%c\", b[z]);\n    printf(\"\\n\");\n    for (r = 1; r <= i; r++) {\n      b[r] = '\\0';\n    }\n  }\n}\n"}
{"label": "17", "index": "32103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[200];\nint findpair(int i, int j) {\n  int temp;\n  if (a[i] == '\\0')\n    return -1;\n  else if (a[i] == '(') {\n    temp = findpair(i + 1, j + 1);\n    if (temp == -1) {\n      a[i] = '$';\n      return -1;\n    } else {\n      a[i] = ' ';\n      return findpair(temp + 1, j);\n    }\n  } else if (a[i] == ')') {\n    if (j == 0) {\n      a[i] = '?';\n      return findpair(i + 1, j);\n    } else {\n      a[i] = ' ';\n      return i;\n    }\n  } else if (a[i] == ' ')\n    return (findpair(i + 1, j));\n}\nint main() {\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    for (int i = 0; i <= (int)strlen(a) - 1; ++i)\n      if (a[i] != ')' && a[i] != '(' && a[i] != '\\0')\n        a[i] = ' ';\n    findpair(0, 0);\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32104", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101]; \n  int pos[101];               \n\n  while (cin.getline(line, 101)) {\n    int left = 0; \n    int len = strlen(line);\n    for (int i = 0; i < 100; i++) \n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') \n      {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left == 0)    \n          label[i] = '?'; \n        else\n          left--; \n    }\n\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$'; \n\n    label[len] = '\\0'; \n    cout << line << endl;\n    cout << label << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid output(int a[], int n) {\n  int i;\n  for (i = 0; i < n; i++)\n    switch (a[i]) {\n    case 1:\n      printf(\"$\");\n      break;\n    case 0:\n      printf(\" \");\n      break;\n    case -1:\n      printf(\"?\");\n      break;\n    }\n  printf(\" \");\n}\nvoid trans(char s[], int a[], int n) {\n  int i, p[200], k = -1;\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if ((s[i] != '(') && (s[i] != ')'))\n      a[i] = 0;\n    else if (s[i] == '(') {\n      k++;\n      p[k] = i;\n      a[i] = 1;\n    } else {\n      if (k > -1) {\n        a[p[k]] = 0;\n        k--;\n        a[i] = 0;\n      } else\n        a[i] = -1;\n    }\n  }\n}\nvoid input() {\n  char s[200];\n  int a[200], n;\n  while (scanf(\"%s\", s) != EOF) {\n    n = strlen(s);\n    puts(s);\n    trans(s, a, n);\n    output(a, n);\n  }\n}\nint main() { input(); }\n"}
{"label": "17", "index": "32106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char a[101];\n  while (cin >> a) {\n    n = strlen(a);\n    for (i = 0; i <= n - 2; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%c \", a[n - 1]);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z' ||\n          a[i] == ' ') {\n        a[i] = ' ';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else if (a[i] == '(') {\n        a[i] = '$';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar A[100], a[100];\nint i, j = 0, m;\nint k;\nint main() {\n  void pipei1(char x);\n  void pipei2(char x);\n  int n;\n  while (cin >> a) {\n    i = 0;\n    m = 0;\n    k = strlen(a);\n    if (k == 0)\n      break;\n    for (n = 0; n < k; n++) {\n      A[n] = ' ';\n      cout << a[n];\n    }\n    pipei1(a[j]);\n    pipei2(a[j]);\n    cout << endl;\n    for (n = 0; n < k; n++) {\n      cout << A[n];\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\nvoid pipei1(char x) {\n  if (j < k) {\n    if (i < 0)\n      i = 0;\n    if (x == '(') {\n      i++;\n    } else if (x == ')') {\n      if (i == 0) {\n        A[j] = '?';\n      }\n      i--;\n    }\n    j++;\n    pipei1(a[j]);\n  }\n}\nvoid pipei2(char x) {\n  if (j >= 0) {\n    if (m < 0)\n      m = 0;\n    if (x == ')') {\n      m++;\n    } else if (x == '(') {\n      if (m == 0) {\n        A[j] = '$';\n      }\n      m--;\n    }\n    j--;\n    pipei2(a[j]);\n  }\n}\n"}
{"label": "17", "index": "32108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, x;\n  char s[200], a[200];\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", s);\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < strlen(s); j++) {\n      if (s[j] == '(')\n        a[j] = '$';\n      else if (s[j] == ')')\n        a[j] = '?';\n      else\n        a[j] = ' ';\n    }\n\n    for (k = 0; k < strlen(s); k++) {\n      if (a[k] == '?') {\n        for (x = k - 1; x >= 0; x--) {\n          if (a[x] == '$') {\n            a[k] = ' ';\n            a[x] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    int w;\n    for (w = 0; w < strlen(s); w++)\n      printf(\"%c\", a[w]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[110];\n  int note[110], l, r;\n  while (cin >> ch) {\n    memset(note, 0, sizeof(note));\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (ch[i]) {\n      case '(': {\n        l = 0;\n        r = 0;\n        note[i] = 1;\n        for (int j = i; ch[j] != '\\0'; j++) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      case ')': {\n        l = 0;\n        r = 0;\n        note[i] = -1;\n        for (int j = i; j >= 0; j--) {\n          switch (ch[j]) {\n          case '(':\n            l++;\n            break;\n          case ')':\n            r++;\n            break;\n          default:\n            break;\n          }\n          if (l == r) {\n            note[i] = 0;\n            break;\n          }\n        }\n        break;\n      }\n      default:\n        break;\n      }\n    }\n    cout << ch << endl;\n    for (int i = 0; ch[i] != '\\0'; i++) {\n      switch (note[i]) {\n      case 1:\n        cout << \"$\";\n        break;\n      case -1:\n        cout << \"?\";\n        break;\n      case 0:\n        cout << \" \";\n        break;\n      default:\n        break;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32110", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k, x;\n  char s[200], a[200];\n  for (i = 0; i < n; i++) {\n    cin >> s;\n    printf(\"%s\\n\", s);\n\n    for (j = 0; j < strlen(s); j++) {\n      if (s[j] == '(')\n        a[j] = '$';\n      else if (s[j] == ')')\n        a[j] = '?';\n      else\n        a[j] = ' ';\n    }\n\n    for (k = 0; k < strlen(s); k++) {\n      if (a[k] == '?') {\n        for (x = k - 1; x >= 0; x--) {\n          if (a[x] == '$') {\n            a[k] = ' ';\n            a[x] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    int w;\n    for (w = 0; w < strlen(s); w++)\n      printf(\"%c\", a[w]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int l = strlen(a);\n    for (int i = 0; i < l; i++) {\n      switch (a[i]) {\n      case '(':\n        a[i] = '$';\n        break;\n      case ')':\n        a[i] = '?';\n        break;\n      default:\n        a[i] = ' ';\n      }\n      if (i > l)\n        break;\n    }\n    for (int i = 0; i < l; i++) {\n      if (a[i] == '$')\n        for (int j = i + 1; j < l; j++) {\n          if (a[j] == '?') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '$')\n            break;\n        }\n      if (a[i] == '?')\n        for (int j = i - 1; j >= 0; j--) {\n          if (a[j] == '$') {\n            a[i] = a[j] = ' ';\n            break;\n          }\n          if (a[j] == '?')\n            break;\n        }\n    }\n    for (int i = 0; i < l; i++)\n      cout << a[i];\n    cout << endl;\n    for (int i = 0; i < 100; i++)\n      a[i] = 0;\n  }\n}\n"}
{"label": "17", "index": "32112", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100];\n  int i, k, s;\n  for (; scanf(\"%s\", a) != EOF;) {\n    s = 0;\n    s = strlen(a);\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n      else\n        a[i] = ' ';\n    }\n    for (i = s - 1; i >= 0; i--) {\n      if (a[i] == '$') {\n        for (k = i; k < s; k++) {\n          if (a[k] == '?') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < s; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char st[101];\n  int g[101];\n  int len, i, j, left;\n  while (scanf(\"%s\", st) != EOF) {\n    printf(\"%s\\n\", st);\n    len = strlen(st);\n    left = 0;\n    for (i = 0; i < len; i++) {\n      if (st[i] == '(') {\n        left++;\n        g[left] = i;\n      }\n    }\n    for (i = left; i > 0; i--) {\n      for (j = g[i] + 1; j < len; j++)\n        if (st[j] == ')') {\n          st[g[i]] = ' ';\n          st[j] = ' ';\n          break;\n        }\n    }\n    for (i = 0; i < len; i++) {\n      if (st[i] == ')')\n        cout << \"?\";\n      else if (st[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint len;\nvoid f(char a[]) {\n  int i, j;\n  len = strlen(a);\n  for (i = len - 1; i >= 0; i--) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < len; j++) {\n        if (a[j] == ')') {\n          a[i] = a[j] = ' ';\n          break;\n        }\n      }\n      if (a[j] == '\\0') {\n        a[i] = '$';\n      }\n      f(a);\n    }\n  }\n}\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << \"\\n\";\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')') {\n        c[i] = ' ';\n      }\n    f(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?';\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32115", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint dg(int a, int b);\n\nchar st[1000], st2[1000];\n\nint main() {\n  while (cin.getline(st, 1000)) {\n\n    st2[strlen(st)] = '\\0';\n    dg(1, 0);\n    cout << st << endl << st2 << endl;\n  }\n  return 0;\n}\nint dg(int a, int b) {\n  for (int i = a; i <= strlen(st); i++) {\n\n    if (st[i - 1] == '(') {\n\n      int t = dg(i + 1, i);\n      if (t == 0) {\n        st2[i - 1] = '$';\n        break;\n      }\n      if (t > 0) {\n        st2[i - 1] = ' ';\n        i = t;\n        continue;\n      }\n    } else if (st[i - 1] == ')') {\n\n      if (b == 0)\n        st2[i - 1] = '?';\n      if (b > 0) {\n        st2[i - 1] = ' ';\n        return i;\n      }\n    } else\n      st2[i - 1] = ' ';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32116", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag[101] = {0};\n  char str[101];\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < strlen(str); i++) {\n      cout << str[i];\n      if (str[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (str[j] == '(' && flag[j] == 0) {\n            flag[i] = 1;\n            flag[j] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << endl;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] == '(' && flag[i] == 0)\n        printf(\"$\");\n      else if (str[i] == ')' && flag[i] == 0)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n    memset(flag, 0, sizeof(flag));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    while (scanf(\"%s\", a) != EOF) {\n      puts(a);\n      n = strlen(a);\n      course(a, n);\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32118", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar a[110];\nint match(int i) {\n  int j;\n  int l = strlen(a);\n  if (i == l)\n    return 0;\n  if (a[i] == '?') {\n    for (j = i - 1; j >= 0; j--) {\n      if (a[j] == '$') {\n\n        a[j] = ' ';\n        a[i] = ' ';\n        break;\n      }\n    }\n  }\n  match(i + 1);\n  return 0;\n}\nint main() {\n  int l;\n  int i;\n  while (scanf(\"%s\", a) != EOF) {\n    cout << a << \"\\n\";\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else {\n        if (a[i] == ')')\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    match(1);\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32119", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint amount(char c, char a[101]) {\n  int i, amount = 0;\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == c)\n      amount = amount + 1;\n  }\n  return amount;\n}\n\nvoid match(char a[101]) {\n  int i, j;\n  int p, q;\n  p = amount('(', a);\n  q = amount(')', a);\n\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; a[j] != '\\0'; j++) {\n        if (a[j] == '(')\n          break;\n        else if (a[j] == ')') {\n          a[i] = ' ';\n          a[j] = ' ';\n          break;\n        }\n      }\n    }\n  }\n\n  if (amount('(', a) < p || amount(')', a) < q)\n    return match(a);\n}\n\nint main() {\n  char s[101];\n  int i;\n  for (; scanf(\"%s\", s) != EOF;) {\n    printf(\"%s\\n\", s);\n    match(s);\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d[120] = {0}, l = 0;\nint search(int p) {\n  int i = p + 1, j = 0;\n  while (1) {\n    if (d[i] == -1) {\n      j = search(i);\n      i = j + 1;\n    } else {\n      if (d[i] == 1) {\n        d[p] = 0;\n        d[i] = 0;\n        return i;\n      } else\n        i++;\n    }\n    if (i >= l)\n      return i;\n  }\n}\nint main() {\n  char ch;\n  int i, j;\n  while (cin.get(ch)) {\n\n    if (ch == '\\n') {\n      cout << endl;\n      i = 0;\n      while (i < l) {\n        while (i < l && d[i] > -1)\n          i++;\n\n        if (i >= l)\n          break;\n        j = search(i);\n        i = j + 1;\n      }\n      for (i = 0; i < l; i++) {\n        if (d[i] == -1)\n          printf(\"$\");\n        else if (d[i] == 1)\n          cout << '?';\n        else\n          printf(\" \");\n      }\n      cout << endl;\n      l = 0;\n      for (i = 0; i < 100; i++)\n        d[i] = 0;\n    } else {\n      cout << ch;\n      if (ch == '(')\n        d[l] = -1;\n      if (ch == ')')\n        d[l] = 1;\n      l++;\n    }\n    ch = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32121", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, k = 0, x = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    for (i = 0; i < n; i++)\n      b[i] = a[i];\n    for (i = 0; i < n; i++)\n      if (b[i] != '(' && b[i] != ')')\n        b[i] = ' ';\n    for (i = 0; i < n; i++) {\n      for (k = 0; k < n; k++) {\n        if (b[k] == ')') {\n          for (x = 0; x <= k; x++) {\n            if (b[k - x] == '(') {\n              b[k] = ' ';\n              b[k - x] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, left;\n  char s[102] = {'\\0'}, t[102] = {'\\0'};\n  int num[102];\n  while (scanf(\"%s\", s) != EOF) {\n    cout << s << \"\\n\";\n    k = strlen(s);\n    left = 0;\n    for (i = 0; i <= k - 1; i++) {\n      switch (s[i]) {\n      case 40: {\n        left = left + 1;\n        num[left] = i;\n        t[i] = '$';\n        break;\n      }\n      case 41: {\n        if (left != 0) {\n          t[num[left]] = 32;\n          t[i] = 32;\n          left = left - 1;\n        } else {\n          t[i] = '?';\n        }\n        break;\n      }\n      default: {\n        t[i] = 32;\n        break;\n      }\n      }\n    }\n    for (i = 0; i <= k - 1; i++) {\n      printf(\"%c\", t[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid f(char str[105], int len) {\n  int i, j;\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ')') {\n      int x = 0;\n      for (j = i - 1; j >= 0; j--) {\n        if (str[j] == '(') {\n          x = 1;\n          str[i] = 'a';\n          str[j] = 'a';\n          break;\n        }\n      }\n      if (x == 0)\n        str[i] = '?';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] == '(')\n      str[i] = '$';\n  }\n  for (i = 0; i < len; i++) {\n    if (str[i] != '$' && str[i] != '?') {\n      str[i] = ' ';\n    }\n  }\n  for (i = 0; i < len; i++) {\n    cout << str[i];\n  }\n  cout << endl;\n}\nint main() {\n  char str[105];\n  int len;\n  while (cin >> str) {\n    len = strlen(str);\n    f(str, len);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int i, len;\n  while (cin.getline(line, 101)) {\n    int left = 0; \n    len = strlen(line);\n    for (i = 0; i < 100; i++) \n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;        \n        pos[left] = i; \n      }\n      if (line[i] == ')')\n        if (left == 0)    \n          label[i] = '?'; \n        else              \n          left--;         \n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$'; \n    label[len] = '\\0';     \n    cout << line << endl;\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar a[110];\nvoid match(int l) {\n  if (a[l] == '\\0')\n    return;\n  int j;\n  if (a[l] == ')') {\n    for (j = l; j >= 0; j--) {\n      if (a[j] == '(') {\n        a[l] = ' ';\n        a[j] = ' ';\n        break;\n      }\n      a[l] = '?';\n    }\n    l++;\n    match(l);\n  } else {\n    l++;\n    match(l);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 110; i++)\n    a[i] = '\\0';\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    match(0);\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ghus(char a[]);\n  void noghus(char a[]);\n  int n, i, t, j;\n  char b[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b);\n    t = ghus(b);\n    printf(\"%s\\n\", b);\n    for (j = 1; j <= t; j++) {\n      noghus(b);\n    }\n    for (j = 0; j < strlen(b); j++) {\n      if (b[j] == '(')\n        printf(\"$\");\n      else if (b[j] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n\nint min(int a, int b) {\n  if (a < b)\n    return a;\n  else\n    return b;\n}\n\nint ghus(char a[]) {\n  int min(int a, int b);\n  int m = 0, n = 0, i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      m++;\n    if (a[i] == ')')\n      n++;\n  }\n  return min(m, n);\n}\n\nvoid noghus(char a[]) {\n  int i, j;\n  for (i = 0; i < strlen(a) - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < strlen(a); j++) {\n        if (a[j] == ')' || a[j] == '(')\n          break;\n      }\n      if (a[j] == ')') {\n        a[i] = 'o';\n        a[j] = 'o';\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "32127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[105];\n  int flag = 0;\n  int puma[105];\n  while (scanf(\"%s \", str)) {\n    flag = 0;\n    printf(\"%s\\n\", str);\n    for (int i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] == '(') {\n        str[i] = '$';\n        flag++;\n        puma[flag] = i;\n      } else if (str[i] == ')') {\n        if (flag > 0) {\n          str[puma[flag]] = ' ';\n          str[i] = ' ';\n          flag--;\n        } else\n          str[i] = '?';\n      } else {\n        str[i] = ' ';\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32128", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n    a[0] = ' ';\n\n    cin >> a;\n    if (a[0] != ' ') {\n      t = strlen(a);\n      show(a, t);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32129", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char str[200];\n  int i, j, k, ei, bi, l;\n  while (cin.getline(str, 150)) {\n    int strout[101] = {0};\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] == '(')\n        strout[i] = -1;\n      else if (str[i] == ')')\n        strout[i] = 1;\n    }\n    for (i = 0; i < l; i++) {\n      if (strout[i] != -1)\n        continue;\n      for (j = i + 1; j < l; j++) {\n        if (strout[j] != 1)\n          continue;\n        for (k = j; k >= i; k--) {\n          if (strout[k] == -1) {\n            strout[k] = 0;\n            strout[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    bi = l - 1;\n    ei = 0;\n    for (i = 0; i < l; i++)\n      if (strout[i] != 0) {\n        bi = i;\n        break;\n      }\n    for (i = l - 1; i >= 0; i--)\n      if (strout[i] != 0) {\n        ei = i;\n        break;\n      }\n\n    for (i = bi; i <= ei; i++) {\n      if (strout[i] == 0)\n        cout << ' ';\n      else if (strout[i] == -1)\n        cout << '$';\n      else\n        cout << '?';\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32130", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Match(int input_len);\nchar input[128];\nchar tmp_input[128];\nint main() {\n  \n  while (scanf(\"%s\", input) != EOF) {\n    strcpy(tmp_input, input);\n    int input_len = strlen(input);\n    Match(input_len);\n    for (int i = 0; i <= input_len - 1; i++) {\n      if (input[i] == '(') {\n        input[i] = '$';\n      } else if (input[i] == ')') {\n        input[i] = '?';\n      } else {\n        input[i] = ' ';\n      }\n    }\n    printf(\"%s\\n\", tmp_input);\n    printf(\"%s\\n\", input);\n  }\n  return 0;\n}\nvoid Match(int input_len) {\n  int cur_left = -1, cur_right = -1;\n  for (int i = 0; i <= input_len - 1; i++) {\n    if (input[i] == '(') {\n      cur_left = i;\n      continue;\n    }\n    if (input[i] == ')') {\n      if (cur_left != -1) {\n        input[cur_left] = ' ';\n        input[i] = ' ';\n        cur_left = -1;\n        i = -1;\n        continue;\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "32131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len, p;\n  while (cin.getline(a, 101)) {\n    cout << a << \"\\n\";\n    len = strlen(a);\n    for (i = len; i >= 0; i--) {\n\n      if (a[i] == '(') {\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == ')') {\n            a[i] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[i] == '1')\n          continue;\n        else\n          a[i] = '$';\n      }\n    }\n    for (p = 0; a[p] != '\\0'; p++) {\n      if (a[p] == ')') {\n        for (j = p - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[p] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[p] == '1')\n          continue;\n        else\n          a[p] = '?';\n      }\n    }\n    for (k = 0; a[k] != '\\0'; k++) {\n      if ((a[k] != '$') && (a[k] != '?'))\n        a[k] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, k, l, n;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++)\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < l; i++)\n      if (b[i] == '?') {\n        for (j = i - 1; j >= 0; j--)\n          if (b[j] == '$') {\n            b[i] = b[j] = ' ';\n            break;\n          }\n      }\n    puts(a);\n    for (i = 0; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "32133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char chuan[101], shuchu[100];\n  int count1, count2, length, i, j;\n  while (cin >> chuan) {\n    cout << chuan << endl;\n    length = strlen(chuan); \n    strcpy(shuchu, chuan);  \n    count1 = 0;\n    count2 = 0;\n    for (i = 0; i < length; i++) {\n      if (chuan[i] == '(')\n        count1++;\n      if (chuan[i] == ')') {\n        count2++;\n        if (count2 > count1) {\n          shuchu[i] = '?';\n          count2--;\n        } \n      }\n\n    } \n\n    count1 = 0;\n    count2 = 0;\n    for (i = length - 1; i >= 0; i--) {\n      if (chuan[i] == ')')\n        count2++;\n      if (chuan[i] == '(') {\n        count1++;\n        if (count1 > count2) {\n          shuchu[i] = '$';\n          count1--;\n        } \n      }\n\n    } \n    shuchu[length] = '\\0';\n    for (i = 0; i < length; i++) {\n      if (shuchu[i] != '?' && shuchu[i] != '$')\n        shuchu[i] = ' ';\n    } \n    cout << shuchu << endl;\n    memset(shuchu, 0, sizeof(shuchu));\n    memset(chuan, 0, sizeof(chuan));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32134", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, r, n, x = 0, z;\n  char a[102], b[102];\n  while (scanf(\"%c\", &a[1]) != EOF) {\n    i = 1;\n    while (a[i] != '\\n') {\n      i++;\n      scanf(\"%c\", &a[i]);\n    }\n    for (n = 1; n <= i - 1; n++)\n      cout << a[n];\n    printf(\"\\n\");\n    x = 0;\n    for (n = 1; n <= i - 1; n++) {\n      b[n] = ' ';\n      if (a[n] == ')' && x == 0)\n        b[n] = '?';\n      if (a[n] == '(')\n        x = x + 1;\n      if (a[n] == ')' && x != 0)\n        x = x - 1;\n    }\n    x = 0;\n    for (n = i - 1; n >= 1; n--) {\n      if (a[n] == ')')\n        x = x + 1;\n      if (a[n] == '(' && x == 0)\n        b[n] = 36;\n      if (a[n] == '(' && x != 0)\n        x = x - 1;\n    }\n    for (z = 1; z <= i - 1; z++)\n      printf(\"%c\", b[z]);\n    printf(\"\\n\");\n    for (r = 1; r <= i; r++) {\n      b[r] = '\\0';\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint deal();\nchar ori[101] = {\"\\0\"};\nint out[101] = {0};\nint main() {\n  int i;\n  while (cin.getline(ori, 101)) {\n    deal();\n    printf(\"%s\\n\", ori);\n    for (i = 0; ori[i] != '\\0'; i++) {\n      if (out[i] == 1)\n        cout << '$';\n      else if (out[i] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n  return 0;\n}\nint deal() {\n  int i, j;\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (ori[i] == '(')\n      out[i] = 1;\n    else if (ori[i] == ')')\n      out[i] = 2;\n    else\n      out[i] = 0;\n  }\n  for (i = 0; ori[i] != '\\0'; i++) {\n    if (out[i] == 2) {\n      for (j = i; j >= 0; j--) {\n        if (out[j] == 1) {\n          out[i] = 0;\n          out[j] = 0;\n          break;\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32136", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, m, j;\n  scanf(\"%d\", &m);\n  for (j = 0; j < m; j++) {\n    cin >> a;\n    puts(a);\n    n = strlen(a);\n    course(a, n);\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zuok(char c[], int j, int len) {\n  int i, zuo = 1, you = 0;\n  for (i = j + 1; i < len; i++) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\nint youk(char c[], int j, int len) {\n  int i, you = 1, zuo = 0;\n  for (i = j - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      zuo++;\n    } else if (c[i] == ')') {\n      you++;\n    }\n    if (zuo == you) {\n      return 1;\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n\n  getchar();\n\n  int i;\n  for (i = 0; i < n; i++) {\n    char c[200];\n    scanf(\"%s\", c);\n    getchar();\n\n    printf(c);\n\n    printf(\"\\n\");\n\n    int len = strlen(c);\n\n    int j;\n\n    for (j = 0; j < len; j++) {\n      if (c[j] == '(') {\n        if (!zuok(c, j, len)) {\n          putchar('$');\n        } else\n          printf(\" \");\n      }\n\n      else if (c[j] == ')') {\n        if (!youk(c, j, len)) {\n          putchar('?');\n        } else\n          putchar(' ');\n      }\n\n      else {\n        putchar(' ');\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], ss[300];\n  int a[300];\n  int l, i, t;\n  do {\n    if (scanf(\"%s\", s) == EOF)\n      break;\n    \n    if (s[0] == '\\0')\n      break;\n    l = strlen(s);\n    if (l == 0)\n      break;\n    t = 0;\n    for (i = 0; i < l; i++) {\n      ss[i] = ' ';\n      if (s[i] == '(') {\n        t++;\n        a[t] = i;\n      }\n      if (s[i] == ')') {\n        if (t == 0) {\n          ss[i] = '?';\n          continue;\n        }\n        t--;\n      }\n    }\n    for (i = 1; i <= t; i++)\n      ss[a[i]] = '$';\n    ss[l] = '\\0';\n    puts(s);\n    puts(ss);\n  } while (0 == 0);\n}\n"}
{"label": "17", "index": "32139", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[200];\nvoid match(char a[]) {\n\n  int s;\n  s = strlen(a);\n  if (s == 0)\n    return;\n  int i, j;\n  int check = 0;\n  for (i = 0; i < s - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < s && a[j] == ' '; j++)\n        ;\n      if (j < s) {\n        if (a[j] == ')') {\n          check = 1;\n          break;\n        }\n      }\n    }\n  }\n  if (check == 1) {\n    a[i] = ' ';\n    a[j] = ' ';\n    match(a);\n  }\n  if (check == 0)\n    return;\n}\nint main() {\n\n  int n;\n  scanf(\"%d \", &n);\n  char temp;\n  cin >> temp;\n  while (n--) {\n\n    cin >> a;\n    puts(a);\n    int s;\n    s = strlen(a);\n    int i;\n    for (i = 0; i < s; i++)\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    match(a);\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      else if (a[i] == ')')\n        a[i] = '?';\n    }\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32140", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char num[101], t[101];\n  int s[101];\n  int k, j;\n  int len;\n  int aa;\n\n  while (scanf(\"%s \", num)) {\n    strcpy(t, num);\n    len = strlen(num);\n    for (k = 0; k < len; k++) {\n      s[k] = 1;\n    }\n    for (k = 0; k < len; k++) {\n      if (num[k] == ')') {\n        for (j = k - 1; j >= 0; j--) {\n          if (num[j] == '(') {\n            s[j] = 0;\n            s[k] = 0;\n            num[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s \", t);\n    for (aa = 0; aa < len; aa++) {\n      if (s[aa] == 1 && t[aa] == '(')\n        printf(\"$\");\n      else if (s[aa] == 1 && t[aa] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "32141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t, n1, n2;\n  int k[100];\n  char a[100][100], b[100];\n  i = 0;\n  while (cin >> a[i]) {\n    k[i] = strlen(a[i]); \n    if (k[i] == 0)\n      break;\n    i++;\n  } \n  t = i;\n  for (i = 0; i < t; i++) {\n    n1 = 0;\n    n2 = 0;\n    for (j = 0; j < k[i]; j++) {\n      b[j] = ' ';\n    }                          \n    for (j = 0; j < k[i]; j++) \n    {\n      if (n1 < 0)\n        n1 = 0; \n      if (a[i][j] == '(') {\n        n1++;\n      } \n      if (a[i][j] == ')') {\n        if (n1 == 0) {\n          b[j] = '?';\n        }\n        n1--;\n      } \n    }\n    for (j = k[i] - 1; j >= 0; j--) \n    {\n      if (n2 < 0)\n        n2 = 0; \n      if (a[i][j] == ')') {\n        n2++;\n      } \n      if (a[i][j] == '(') {\n        if (n2 == 0) {\n          b[j] = '$';\n        }\n        n2--;\n      } \n    }\n    for (j = 0; j < k[i]; j++) {\n      cout << a[i][j];\n    }\n    cout << endl; \n    for (j = 0; j < k[i]; j++) {\n      cout << b[j];\n    }\n    cout << endl; \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid deal(char s[]) {\n  int i, j, p = 0;\n  for (i = 0; i < strlen(s); i++)\n    if (s[i] == '(') {\n      for (j = i + 1; j < strlen(s); j++)\n        if (s[j] == '(' || s[j] == ')')\n          break;\n      if (s[j] == ')') {\n        s[j] = 'a';\n        s[i] = 'a';\n        p++;\n      }\n    }\n  if (p != 0)\n    deal(s);\n}\nint main() {\n  int i, j;\n  char s[1000], s1[1000], t[1000];\n  while (0 == 0) {\n    for (i = 0; i < 1000; i++)\n      s[i] = 0;\n\n    cin >> s;\n    if (s[0] == '\u0000')\n      break;\n    strcpy(s1, s);\n    deal(s1);\n    for (i = 0; i < strlen(s); i++)\n      if (s1[i] == '(')\n        t[i] = '$';\n      else if (s1[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    t[strlen(s)] = '\u0000';\n    printf(\"%s %s \", s, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[11][101] = {{'\\0'}}, s0[101];\n  int i = 0, j, k, l, c;\n  while (i <= 10) {\n    scanf(\"%s\", s[i]);\n    strcpy(s0, s[i]);\n    l = strlen(s[i]);\n    for (j = l - 1; j >= 0; j--) {\n      c = 0;\n      if (s[i][j] == '(') {\n        for (k = j; k <= l - 1; k++) {\n          if (s[i][k] == ')') {\n            c = 1;\n            s[i][k] = ' ';\n            s[i][j] = ' ';\n            break;\n            ;\n          }\n        }\n        if (c == 0)\n          s[i][j] = '$';\n      } else if (s[i][j] != ')')\n        s[i][j] = ' ';\n    }\n    for (j = 0; j <= l - 1; j++) {\n      if (s[i][j] == ')')\n        s[i][j] = '?';\n    }\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s0[j]);\n    printf(\"\\n\");\n    for (j = 0; j <= l - 1; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32144", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar str[101];\nint lenth = 0;\nint main() {\n  while (cin >> str) {\n    lenth = strlen(str);\n    cout << str << endl;\n    int i, j;\n    for (j = 0; j < lenth; j++) {\n      if (str[j] == '(')\n        str[j] = '$';\n      else if (str[j] == ')')\n        str[j] = '?';\n      else\n        str[j] = ' ';\n    }\n    for (i = lenth - 2; i >= 0; i--) {\n      if (str[i] == '$') {\n        for (j = i + 1; j < lenth; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    } \n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32145", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101];\nint lenth = 0;\nint main() {\n  while (scanf(\"%s \", str)) {\n    lenth = strlen(str);\n    cout << str << endl;\n    int i, j;\n    for (j = 0; j < lenth; j++) {\n      if (str[j] == '(')\n        str[j] = '$';\n      else if (str[j] == ')') {\n        str[j] = '?';\n      } else\n        str[j] = ' ';\n    }\n    for (i = lenth - 2; i >= 0; i--) {\n      if (str[i] == '$') {\n        for (j = i + 1; j < lenth; j++) {\n          if (str[j] == '?') {\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint d[120] = {0}, l = 0;\nint search(int p) {\n  int i = p + 1, j = 0;\n  while (1) {\n    if (d[i] == -1) {\n      j = search(i);\n      i = j + 1;\n    } else {\n      if (d[i] == 1) {\n        d[p] = 0;\n        d[i] = 0;\n        return i;\n      } else\n        i++;\n    }\n    if (i >= l)\n      return i;\n  }\n}\nint main() {\n  char ch;\n  int i, j;\n  while (cin.get(ch)) {\n\n    if (ch == '\\n') {\n      cout << endl;\n      i = 0;\n      while (i < l) {\n        while (i < l && d[i] > -1)\n          i++;\n\n        if (i >= l)\n          break;\n        j = search(i);\n        i = j + 1;\n      }\n      for (i = 0; i < l; i++) {\n        if (d[i] == -1)\n          printf(\"$\");\n        else if (d[i] == 1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n      cout << endl;\n      l = 0;\n      for (i = 0; i < 100; i++)\n        d[i] = 0;\n    } else {\n      cout << ch;\n      if (ch == '(')\n        d[l] = -1;\n      if (ch == ')')\n        d[l] = 1;\n      l++;\n    }\n    ch = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32147", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nchar in[110], work[110], out[110]; \nint len;                           \nvoid pick(int L)                   \n{\n  for (int i = L - 1; i >= 0; i--) { \n    if (work[i] == '(') {\n      for (int j = 0; j < L - i; j++) { \n        if (work[i + j] == ')') {\n          work[i] = ' ';\n          work[i + j] = ' '; \n          pick(len);         \n          break;\n        }\n      }\n    }\n  }\n}\nvoid mark(int L) \n{\n  for (int i = 0; i < L; i++) {\n    if (work[i] == '(')\n      out[i] = '$';\n    if (work[i] == ')')\n      out[i] = '?';\n  } \n}\nint main() {\n  while (cin) {\n    cin.getline(in, 110); \n    len = strlen(in);\n    for (int i = 0; i < len; i++) {\n      out[i] = ' ';\n      work[i] = in[i];\n    } \n    pick(len);\n    mark(len);\n    for (int i = 0; i < len; i++) {\n      cout << in[i];\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      cout << out[i];\n    }\n    cout << endl;\n  } \n  return 0;\n}\n"}
{"label": "17", "index": "32148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  int st[100], sp;\n  int i, l, m, n, t;\n  while (1) {\n    for (i = 0; i <= 99; i++)\n      st[i] = 0;\n    sp = 0;\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    strcpy(b, a);\n    l = strlen(a);\n    for (i = 0; i <= l - 1; i++) {\n      if (a[i] == '(') {\n        st[sp] = i;\n        break;\n      }\n    }\n    if (i == l)\n      ;\n    else {\n      for (sp = 1, i = st[0] + 1; i <= l - 1; i++) {\n        if (a[i] == '(')\n          st[sp++] = i;\n        else if (a[i] == ')') {\n          if (sp > 0) {\n            b[st[--sp]] = ' ';\n            b[i] = ' ';\n          }\n        }\n      }\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else if (b[i] == ' ')\n        ;\n      else\n        b[i] = ' ';\n    }\n    cout << a << \" \";\n    n = l - 1;\n    for (i = l - 1; i >= 0; i--) {\n      if (b[i] == ' ')\n        n = i - 1;\n      else\n        break;\n    }\n    m = 0;\n    for (i = 0; i <= l - 1; i++) {\n      if (b[i] == ' ')\n        m = i + 1;\n      else\n        break;\n    }\n    t = 0;\n    for (i = m; i <= n; i++) {\n      cout << b[i];\n      t++;\n    }\n    printf(\" \");\n    a[0] = '\u0000';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32149", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[101];\n  int i, j, lenth, n, t;\n  while (cin.getline(string, 101)) {\n    n = 0;\n    lenth = strlen(string);\n    cout << string << endl;\n    for (i = 0; i < lenth; i++) {\n      if (string[i] == '(')\n        string[i] = '$';\n      else if (string[i] == ')')\n        string[i] = '?';\n      else {\n        string[i] = ' ';\n        n++;\n      }\n    }\n    n = (lenth - n) / 2;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < lenth; j++) {\n        for (t = j + 1; t < lenth; t++) {\n          if (string[j] == '$' && string[t] == '$') {\n            j = t;\n            continue;\n          }\n          if (string[j] == '$' && string[t] == '?') {\n            string[j] = string[t] = ' ';\n            j = t - 1;\n          }\n        }\n      }\n    }\n    for (i = lenth - 1; i >= 0; i--) {\n      if (string[i] != ' ')\n        break;\n    }\n    string[i + 1] = '\\0';\n    lenth = strlen(string);\n    int m = 0;\n    for (i = 0; i < lenth; i++) {\n      if (string[i] != ' ')\n        break;\n      m++;\n    }\n    for (i = m; i < lenth; i++)\n      printf(\"%c\", string[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32150", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101], rsen[101];\n  while (cin >> sen) {\n    int pos[101], num = 0, i, t = 0;\n    cout << sen << endl;\n    for (i = 0; i <= strlen(sen) - 1; i++) {\n      if (sen[i] == '(') {\n        num++;\n        pos[num] = i;\n        rsen[i] = '$';\n      } else {\n        if (sen[i] == ')') {\n          if (num > 0) {\n            rsen[pos[num]] = ' ';\n            rsen[i] = ' ';\n            num--;\n          } else {\n            rsen[i] = '?';\n          }\n        } else {\n          rsen[i] = ' ';\n        }\n      }\n    }\n    if (num != 0) {\n      for (i = 1; i <= num; i++) {\n        rsen[pos[num]] = '$';\n      }\n    }\n    for (i = 0; i <= strlen(sen) - 2; i++) {\n      cout << rsen[i];\n    }\n    cout << rsen[strlen(sen) - 1] << \"\\n\";\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "32151", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n    a[0] = ' ';\n\n    cin >> a;\n    if (a[0] != ' ') {\n      t = strlen(a);\n      show(a, t);\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32152", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int som;\n  char a[105];\n  char b[105];\n  int len;\n  int i, j;\n  cin >> n;\n  for (som = 1; som <= n; som++) {\n    cin >> a;\n    strcpy(b, a);\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = len - 1; i >= 0; i--) {\n      if (b[i] == '$') {\n        for (j = i + 1; j < len; j++) {\n          if (b[j] == '?') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", a, b);\n  }\n}\n"}
{"label": "17", "index": "32153", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint len;\nvoid f(char a[]) {\n  int i, j;\n  len = strlen(a);\n  for (i = len - 1; i >= 0; i--) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < len; j++) {\n        if (a[j] == ')') {\n          a[i] = a[j] = ' ';\n          break;\n        }\n      }\n      if (a[j] == '\\0') {\n        a[i] = '$';\n      }\n      f(a);\n    }\n  }\n}\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' '; \n    f(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?'; \n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c, a[105] = {'\\0'}, sign[105] = {'\\0'};\n  int length, i, j;\n  cin.getline(a, 101, '\\n');\n  while (a[0] != '\\0') {\n    length = strlen(a);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < length; i++) {\n      if (a[i] != ')')\n        continue;\n      else if (i > 0) {\n        j = i - 1;\n        while (j >= 0 && a[j] != '(')\n          j--;\n        if (a[j] == '(') {\n          a[i] = '\\0';\n          a[j] = '\\0';\n        }\n      }\n    }\n    for (i = 0; i < length; i++) {\n      if (a[i] == '(')\n        sign[i] = '$';\n      else {\n        if (a[i] == ')')\n          sign[i] = '?';\n        else\n          sign[i] = ' ';\n      }\n    }\n    cout << sign;\n    for (i = 0; i < 105; i++) {\n      a[i] = '\\0';\n      sign[i] = '\\0';\n    }\n    cin.getline(a, 101, '\\n');\n    if (a[0] != '\\0')\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    char a[101] = {0}, b[101] = {0};\n    int n, t, s, i;\n    if (scanf(\"%s\", a) == EOF)\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] == '(')\n        b[i] = 1;\n      else if (a[i] == ')')\n        b[i] = -1;\n    for (i = 0, s = 0; i < n; i++)\n      if (b[i] == 1) {\n        t = i;\n        s = 1;\n      } else if (b[i] == -1 && s == 1) {\n        b[t] = 0;\n        b[i] = 0;\n        i = -1;\n        s = 0;\n      }\n    for (i = 0; i < n; i++)\n      if (b[i] == 1)\n        b[i] = '$';\n      else if (b[i] == -1)\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    for (i = 0; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    for (i = 0; i < n; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int s[101], len, k = 0, i;\n  while (scanf(\"%s \", a)) {\n    for (len = 0; a[len] != '\\0'; len++)\n      ;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        s[k++] = i;\n      if (a[i] == ')' && k > 0) {\n        a[s[--k]] = ' ';\n        a[i] = ' ';\n      }\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n      if (a[i] == ')' && k == 0)\n        a[i] = '?';\n    }\n    for (i = k - 1; i >= 0; i--)\n      a[s[i]] = '$';\n    cout << a << endl;\n    memset(a, 0, sizeof(a));\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[100][100];\nint main() {\n  int k = 1;\n  while (1) {\n    cin >> a[k];\n    cout << a[k];\n    printf(\"\\n\");\n    for (int i = 0; i < strlen(a[k]); i++)\n      if (a[k][i] != '(' && a[k][i] != ')')\n        a[k][i] = ' ';\n    for (int i = 0; i < strlen(a[k]) - 1; i++) {\n      int sum = 1;\n      if (a[k][i] == '(') {\n        for (int j = i + 1; j < strlen(a[k]); j++) {\n          if (a[k][j] == '(')\n            sum++;\n          if (a[k][j] == ')')\n            sum--;\n          if (sum == 0) {\n            a[k][i] = ' ';\n            a[k][j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a[k]); i++) {\n      if (a[k][i] == '(')\n        a[k][i] = '$';\n      if (a[k][i] == ')')\n        a[k][i] = '?';\n      cout << a[k][i];\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$') {\n            break;\n          } else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, k;\n  scanf(\"%d\", &k);\n  while (k--) {\n    while (scanf(\"%s\", a) != EOF) {\n      puts(a);\n      n = strlen(a);\n      course(a, n);\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[110] = {0};\n\n  while (cin >> str) {\n    int change[110] = {0};\n    char ans[110] = {0};\n    int len = strlen(str);\n    for (int i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        change[i] = 1;\n      } else if (str[i] == ')')\n        change[i] = -1;\n      else\n        change[i] = 0;\n    }\n    int sum = 0;\n    for (int i = 0; i < len; i++) {\n      sum += change[i];\n      if (sum < 0) {\n        ans[i] = '?';\n        sum = 0;\n      }\n    }\n    sum = 0;\n    for (int i = len - 1; i >= 0; i--) {\n      sum += change[i];\n      if (sum > 0) {\n        ans[i] = '$';\n        sum = 0;\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (ans[i] != '?' && ans[i] != '$')\n        ans[i] = ' ';\n    }\n    cout << str << endl;\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin >> in) {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) \n          {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    cout << in << endl;\n    cout << out << endl;\n  }\n  return 0;\n}\n\n"}
{"label": "17", "index": "32161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[101];\nint l;\nint f(int k) {\n  int i, j;\n  for (i = k; i >= 0; i--)\n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') {\n          s[i] = 'a';\n          s[j] = 'a';\n          k = i;\n          return f(k);\n        }\n    }\n  for (i = 0; i < l; i++) {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      printf(\" \");\n  }\n  cout << endl;\n  return 0;\n}\n\nint main() {\n  while (cin.getline(s, 101, '\\n')) {\n    l = strlen(s);\n    printf(\"%s\\n\", s);\n    f(l - 1);\n    memset(s, '\\0', sizeof(s));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int l, i, j, p = 0;\n  while (scanf(\"%s\", a) != EOF) {\n\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      p = 0;\n      if (a[i] == '(') {\n        for (j = i; j < l; j++) {\n          if (a[j] == '(')\n            p++;\n          if (a[j] == ')')\n            p--;\n          if (p == 0)\n            break;\n        }\n        if (p != 0)\n          a[i] = '$';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = l - 1; i >= 0; i--) {\n      p = 0;\n      if (a[i] == ')') {\n\n        for (j = i; j >= 0; j--) {\n\n          if (a[j] == ')')\n            p++;\n          if (a[j] == ' ')\n            p--;\n          if (p == 0) {\n            break;\n          }\n        }\n        if (p != 0)\n          a[i] = '?';\n        else\n          a[i] = ' ';\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        a[i] = ' ';\n    }\n\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32163", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int left, right, pos[101], pos1[101], i;\n  while (scanf(\"%s \", a)) {\n    left = right = 0;\n    memset(pos, 0, sizeof(pos));\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (a[i] == ')') {\n        if (left == 0) {\n          right++;\n          pos1[right] = i;\n        } else {\n          pos[left] = 200;\n          left--;\n        }\n      }\n    }\n    for (i = 1; i <= left; i++)\n      a[pos[i]] = 1;\n    for (i = 1; i <= right; i++)\n      a[pos1[i]] = 2;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != 1 && a[i] != 2) {\n        cout << \" \";\n      } else {\n        if (a[i] == 1)\n          cout << \"$\";\n        else\n          printf(\"?\");\n      }\n    }\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32164", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[200];\n  int b[200];\n  int n, len;\n  scanf(\"%d \", &n);\n  cin.get();\n  for (int i = 0; i < n; i++) {\n    memset(b, 0, sizeof(b));\n    cin.getline(a, 200);\n    len = strlen(a);\n    for (int i = 0; i < len; i++) {\n      cout << a[i];\n      switch (a[i]) {\n      case '(':\n        b[i] = 1;\n        break;\n      case ')':\n        b[i] = 2;\n        break;\n      default:\n        b[i] = 3;\n        break;\n      }\n    }\n    cout << endl;\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 2) {\n        for (int j = i; j >= 0; j--) {\n          if (b[j] == 1) {\n            b[j] = 3, b[i] = 3;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < len; i++) {\n      if (b[i] == 1) {\n        printf(\"$\");\n      } else if (b[i] == 2) {\n        cout << '?';\n      } else {\n        cout << ' ';\n      }\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], c;\n  int i, b[100], j, n, k;\n  for (j = 0;; j++) {\n    i = 0;\n    c = getchar();\n    if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'z') || c == '(' ||\n          c == ')'))\n      break;\n    a[j][i] = c;\n    i++;\n    while ((c = getchar()) != '\\n') {\n      a[j][i] = c;\n      i++;\n    }\n    b[j] = i;\n  }\n  n = j;\n  for (j = 0; j < n; j++) {\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    putchar('\\n');\n    for (i = 0; i < b[j]; i++) {\n      if ((a[j][i] >= 'a' && a[j][i] <= 'z') ||\n          (a[j][i] >= 'A' && a[j][i] <= 'Z'))\n        a[j][i] = ' ';\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == ')') {\n        for (k = i - 1; k > -1; k--) {\n          if (a[j][k] == '(')\n            break;\n        }\n        if (k != -1) {\n          a[j][k] = ' ';\n          a[j][i] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < b[j]; i++) {\n      if (a[j][i] == '(')\n        a[j][i] = '$';\n      if (a[j][i] == ')')\n        a[j][i] = '?';\n    }\n    for (i = 0; i < b[j]; i++)\n      printf(\"%c\", a[j][i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "32166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[110] = {0};\n  while (true) {\n    int i = 0;\n    while (true) {\n      str[i] = getchar();\n      if (str[i] == '\\n')\n        break;\n      i++;\n    }\n    int n, j = 0, biaoji = 0;\n    n = i - 1;\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    cout << endl;\n    for (i = 0; i <= n; i++) {\n      biaoji = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            biaoji = 1;\n            str[i] = ' ';\n            str[j] = ' ';\n            break;\n          }\n        }\n        if (biaoji == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i <= n; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else if (str[i] != '$' && str[i] != '?')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= n; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[105];\n  char sign[105];\n  char present[105];\n  while (scanf(\"%s\", zfc) > 0) {\n\n    strcpy(sign, zfc);\n    strcpy(present, zfc);\n    int left = 0, right = 0;\n    int m = strlen(zfc);\n    for (int i = 0; i < m; i++) {\n      if (zfc[i] == '(') {\n        left = 0;\n        right = 0;\n        for (int j = i; j < m; j++) {\n          if (zfc[j] == '(') {\n            left++;\n          }\n          if (zfc[j] == ')') {\n            left--;\n          }\n          if (left <= 0) {\n            break;\n          }\n        }\n        if (left > 0)\n          sign[i] = '$';\n      }\n      if (zfc[i] == ')') {\n        left = 0;\n        right = 0;\n        for (int j = i; j >= 0; j--) {\n          if (zfc[j] == '(') {\n            right--;\n          }\n          if (zfc[j] == ')') {\n            right++;\n          }\n          if (right <= 0) {\n            break;\n          }\n        }\n        if (right > 0) {\n          sign[i] = '?';\n        }\n      }\n    }\n    for (int i = 0; i < m; i++) {\n      if (sign[i] != '$' && sign[i] != '?') {\n        sign[i] = ' ';\n      }\n    }\n    puts(present);\n    puts(sign);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar str[101], bracket[101];\nint len;\nvoid match(int a);\n\nint main() {\n  while (cin.getline(str, 101)) {\n    len = strlen(str);\n    for (int i = 0; i < len; i++)\n      if (str[i] == '(')\n        bracket[i] = '$';\n      else if (str[i] == ')')\n        bracket[i] = '?';\n      else\n        bracket[i] = ' ';\n    match(1);\n    for (int i = 0; i < len; i++)\n      cout << str[i];\n    cout << endl;\n    for (int i = 0; i < len; i++)\n      printf(\"%c\", bracket[i]);\n    cout << \"\\n\";\n  }\n\n  return 0;\n}\n\nvoid match(int a) {\n  if (a == len)\n    return;\n  int b = a - 1;\n  if (bracket[a] == '?') {\n    while (bracket[b] == ' ') {\n      if (b == 0) {\n        match(a + 1);\n        return;\n      }\n      b--;\n    }\n    if (bracket[b] == '?') {\n      match(a + 1);\n      return;\n    }\n    bracket[b] = ' ';\n    bracket[a] = ' ';\n    match(a + 1);\n  } else\n    match(a + 1);\n}\n"}
{"label": "17", "index": "32169", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, g, ans, max, temp, n, l, t;\n  char c[1000];\n  while (scanf(\"%s\", c) != EOF) {\n    printf(\"%s \", c);\n    for (k = 0; k < 100; k++) {\n      for (i = 0; c[i] != '\u0000'; i++) {\n        if (c[i] == '(') {\n          for (j = i + 1; c[j] != '\u0000'; j++) {\n            if (c[j] == '(') {\n              i = j - 1;\n              break;\n            }\n            if (c[j] == ')') {\n              c[i] = ' ';\n              c[j] = ' ';\n              break;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; c[i] != '\u0000'; i++) {\n      if (c[i] == '(')\n        c[i] = '$';\n      else if (c[i] == ')') {\n        c[i] = '?';\n      } else\n        c[i] = ' ';\n    }\n    printf(\"%s \", c);\n  }\n}\n"}
{"label": "17", "index": "32170", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, r, fl, lenth;\n  int i, j, k;\n  char str[100 + 10];\n  int left[101], right[101];\n  int flag[100 + 10];\n\n  while (cin.getline(str, 101)) {\n    l = 1;\n    r = 1;\n    for (lenth = 0; str[lenth] != '\\0'; lenth++) {\n      if (str[lenth] == '(') {\n        flag[lenth] = 1;\n        left[l++] = lenth;\n      } else if (str[lenth] == ')') {\n        flag[lenth] = 2;\n        right[r++] = lenth;\n      } else\n        flag[lenth] = 0;\n    }\n\n    fl = lenth - 1;\n\n    for (j = l - 1; j >= 1; j--)\n      for (k = 1; k <= r - 1; k++) {\n        if (right[k] > left[j]) {\n          flag[right[k]] = 0;\n          flag[left[j]] = 0;\n          right[k] = -1;\n          break;\n        }\n      }\n\n    for (lenth = 0; str[lenth] != '\\0'; lenth++)\n      printf(\"%c\", str[lenth]);\n\n    cout << \"\\n\";\n\n    for (lenth = 0; lenth <= fl; lenth++) {\n      if (flag[lenth] == 0)\n        printf(\" \");\n      else if (flag[lenth] == 1)\n        printf(\"$\");\n      else if (flag[lenth] == 2)\n        printf(\"?\");\n    }\n\n    printf(\"\\n\");\n    memset(str, 0, sizeof(str));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint match(int i, int n, char str[]);\nint main() {\n  char str[101];\n  int n;\n  while (cin >> str) {\n    cout << str << endl;\n    n = strlen(str);\n    match(0, n, str);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) {\n  if (i == n)\n    return 0;\n  else if (str[i] == ')') {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(')\n    str[i] = '$';\n  else {\n    str[i] = ' ';\n  }\n  match(i + 1, n, str);\n  return 0;\n}\n"}
{"label": "17", "index": "32172", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j;\n  char A[200];\n  while (cin.getline(A, 200, '\\n')) {\n    cout << A << endl;\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '(')\n        A[i] = '$';\n      else {\n        if (A[i] == ')')\n          A[i] = '?';\n        else\n          A[i] = ' ';\n      }\n    }\n    for (i = 0; i < strlen(A); i++) {\n      if (A[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (A[j] == '$') {\n            A[i] = ' ';\n            A[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    printf(\"%s\\n\", A);\n    memset(A, '\\0', sizeof(A));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32173", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar x[1010] = \"\", tar[1010] = \"\";\nint len = 0, ctr;\n\nvoid F(int s) {\n  int i;\n  for (i = s + 1; i < len; i++) {\n    if (x[i] == '(' && tar[i] == '$' && ctr)\n      F(i);\n    if (x[i] == ')' && tar[i] == '?') {\n      tar[s] = tar[i] = ' ';\n      ctr--;\n      return;\n    }\n  }\n  return;\n}\n\nint main() {\n  int i;\n  while (cin >> x) {\n    ctr = 0;\n    cout << x << endl;\n    len = strlen(x);\n    for (i = 0; i < len; i++) {\n      if (x[i] == '(')\n        tar[i] = '$';\n      else if (x[i] == ')') {\n        tar[i] = '?';\n        ctr++;\n      } else\n        tar[i] = ' ';\n    }\n    tar[len] = '\\0';\n    for (i = 0; i < len - 1; i++) {\n      if (x[i] == '(' && tar[i] == '$' && ctr)\n        F(i);\n    }\n    printf(\"%s\\n\", tar);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint num;\nchar right(char c) {\n  char ch;\n  if (c != '(' && c != ')')\n    ch = ' ';\n  else if (c == ')') {\n    if (num == 0)\n      ch = '?';\n    else {\n      num--;\n      ch = ' ';\n    }\n  } else {\n    num++;\n    ch = c;\n  }\n  return ch;\n}\nchar left(char c, char a) {\n  char ch;\n  if (a == ' ' || a == '?') {\n    ch = a;\n    if (c == ')')\n      num++;\n  } else if (num == 0)\n    ch = '$';\n  else {\n    num--;\n    ch = ' ';\n  }\n  return ch;\n}\nint main() {\n  int i;\n  char s[101], a[101];\n  while (scanf(\"%s \", s)) {\n    num = 0;\n    for (i = 0; i < strlen(s); i++)\n      a[i] = right(s[i]);\n    num = 0;\n    for (i = strlen(s) - 1; i >= 0; i--)\n      a[i] = left(s[i], a[i]);\n    puts(s);\n    for (i = 0; i < strlen(s); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char a[101], b[101];\n  while (cin.getline(a, 101)) {\n    for (i = 0; i <= 100; i++)\n      b[i] = ' ';\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            break;\n          }\n        if (j == -1)\n          b[i] = '?';\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j;\n  while (cin.getline(str, 101)) {\n    int length = strlen(str), count1[1000] = {0}, count2[1000] = {0};\n    for (i = length; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i; str[j] != '\\0'; j++) {\n          if (str[j] == ')' && count2[j] == 0) {\n            count2[j]--;\n            break;\n          } else {\n            if (str[j + 1] == '\\0') {\n              count1[i]++;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == ')') {\n        count2[i]++;\n      }\n\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (count1[i] == 1) {\n        cout << \"$\";\n      }\n      if (count2[i] == 1)\n        cout << \"?\";\n\n      if (count1[i] != 1 && count2[i] != 1) {\n        cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main()\n\n{\n  int i, j;\n  char a[101], b[101], c[101];\n  for (;;) {\n\n    scanf(\"%s \", a);\n\n    if (strcmp(c, a) == 0)\n      break;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == '(')\n        b[i] = '$';\n      else\n        b[i] = ' ';\n    }\n\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (b[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (b[j] == '$') {\n            b[i] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n    for (i = 0; a[i] != '\u0000'; i++)\n      printf(\"%c\", b[i]);\n    cout << \" \";\n    strcpy(c, a);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[100];\n  int len, i, j, a[100];\n  while (scanf(\"%s\", c) != EOF) {\n    if (c[0] == '\\0')\n      break;\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == -1) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      } else\n        a[i] = 0;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n      if (a[i] == 0)\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[200];\n  int leftpos, mark;\n  while (scanf(\"%s\", string) == 1) {\n    printf(\"%s\\n\", string);\n    leftpos = -1;\n    mark = 0;\n    while (mark != strlen(string)) {\n      if (string[mark] == '(')\n        leftpos = mark;\n      else if (string[mark] == ')' && leftpos != -1) {\n        string[mark] = ' ';\n        string[leftpos] = ' ';\n        mark = -1;\n        leftpos = -1;\n      }\n      mark++;\n    }\n    for (mark = 0; mark < strlen(string); mark++) {\n      if (string[mark] == '(')\n        string[mark] = '$';\n      else if (string[mark] == ')')\n        string[mark] = '?';\n      else\n        string[mark] = ' ';\n    }\n    printf(\"%s\\n\", string);\n    memset(string, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar c[120], ch;\nint n;\nint search(int p) {\n  int q = p + 1;\n  if (q >= n)\n    return q;\n  while ((c[q] != '?') && (q < n)) {\n    if (c[q] == '$')\n      q = search(q) + 1;\n    else\n      q++;\n  }\n  if (q < n) {\n    c[p] = ' ';\n    c[q] = ' ';\n  }\n  return q;\n}\nint main() {\n  int i = 0;\n  while (scanf(\"%c \", &ch)) {\n    cout << ch;\n    n = 0;\n    i = 0;\n    while (ch != '\\n') {\n      if (ch == '(')\n        c[n] = '$';\n      else {\n        if (ch == ')')\n          c[n] = '?';\n        else\n          c[n] = ' ';\n      }\n      n++;\n      cin.get(ch);\n      cout << ch;\n    }\n    while (i < n) {\n      while ((c[i] != '$') && (i < n))\n        i++;\n      i = search(i) + 1;\n    }\n    for (i = 0; i < n; i++)\n      cout << c[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char l, r, s, sen[200], rem[200];\n  int i = 1, j = 1, k = 1, nsen, b = 1;\n  l = '(';\n  r = ')';\n\n  while (b == 1) {\n\n    while ((s = cin.get()) != '\\n') {\n      sen[i] = s;\n      rem[i] = s;\n      i++;\n    }\n    nsen = i - 1;\n\n    for (j = 1; j < nsen; j++)\n      for (i = 1; i < nsen; i++)\n        if (sen[i] == l && sen[i + j] == r) {\n          sen[i] = ' ';\n          sen[i + j] = ' ';\n        }\n\n    for (i = 1; i <= nsen; i++)\n      if (sen[i] == l)\n        sen[i] = '$';\n      else if (sen[i] == r)\n        sen[i] = '?';\n      else\n        sen[i] = ' ';\n\n    for (i = 1; i <= nsen; i++)\n      cout << rem[i];\n    printf(\"\\n\");\n    for (i = 1; i <= nsen; i++)\n      cout << sen[i];\n    cout << endl;\n\n    nsen = 0;\n    i = 1;\n    j = 1;\n    k = 1;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  int i;\n  int t;\n  scanf(\"%d\", &n);\n  scanf(\"\\n\");\n  char c[101] = {0};\n  char d[101] = {0};\n  int j = 0, k = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 101; j++) {\n      c[j] = 0;\n      d[j] = 0;\n    }\n\n    scanf(\"%s\", c);\n    t = strlen(c);\n    for (j = 0; j < t; j++) {\n      d[j] = c[j];\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j - 1; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[k] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < t; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n\n    printf(\"%s\", d);\n    cout << \"\\n\";\n    printf(\"%s\", c);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  do {\n    char s[101] = {0}, S[101] = {0};\n    int i, len, m;\n\n    scanf(\"%s \", s);\n    strcpy(S, s);\n\n    len = strlen(s);\n\n    if (len == 0)\n      break;\n\n    m = 0;\n    do {\n\n      for (i = m; i < len; i++) {\n        if (s[i] == ')') {\n          break;\n        }\n      }\n\n      m = i;\n\n      if (m == len)\n        break;\n\n      else {\n        for (i = m; i >= 0; i--)\n          if (s[i] == '(') {\n            s[i] = '1';\n            s[m] = '1';\n            break;\n          }\n      }\n\n      m = m + 1;\n\n    } while (1);\n\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else if (s[i] == ')')\n        s[i] = '?';\n      else\n        s[i] = ' ';\n    }\n\n    cout << S << \" \";\n    puts(s);\n  } while (1);\n\n  return 0;\n}\n"}
{"label": "17", "index": "32184", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, n, b, k, t, m, p;\n  char a[1000] = {0};\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    cin >> a;\n    printf(\"%s\\n\", a);\n    b = strlen(a);\n    for (m = 0; m < b; m++) {\n      if (a[m] != '(' && a[m] != ')') {\n        a[m] = ' ';\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (a[i] == ')') {\n        for (t = i; t >= 0; t--) {\n          if (a[t] == '(') {\n            a[i] = ' ';\n            a[t] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < b; k++) {\n      if (a[k] == '(')\n        a[k] = '$';\n      else if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char a[101];\n  while (scanf(\"%s \", a)) {\n    n = strlen(a);\n    for (i = 0; i <= n - 2; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%c \", a[n - 1]);\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[j] = ' ';\n            a[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z' ||\n          a[i] == ' ') {\n        a[i] = ' ';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else if (a[i] == '(') {\n        a[i] = '$';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "17", "index": "32186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar a[110];\nvoid match(int l) {\n  if (a[l] == '\\0')\n    return;\n  int j;\n  if (a[l] == ')') {\n    for (j = l; j >= 0; j--) {\n      if (a[j] == '(') {\n        a[l] = ' ';\n        a[j] = ' ';\n        break;\n      }\n      a[l] = '?';\n    }\n    l++;\n    match(l);\n  } else {\n    l++;\n    match(l);\n  }\n}\nint main() {\n  int i;\n  for (i = 0; i < 110; i++)\n    a[i] = '\\0';\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    match(0);\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n    }\n    for (i = 0; a[i] != '\\0'; i++)\n      printf(\"%c\", a[i]);\n    cout << endl;\n    for (i = 0; a[i] != '\\0'; i++)\n      a[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32187", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, k, m, n;\n  while (cin.getline(a, 110)) {\n    n = strlen(a);\n    for (m = 0; m < n; m++) {\n      printf(\"%c\", a[m]);\n    }\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < n; k++) {\n      if (a[k] != '(' && a[k] != ')')\n        a[k] = ' ';\n\n      if (a[k] == '(') {\n        a[k] = '$';\n      }\n      if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    for (m = 0; m < n; m++) {\n      cout << a[m];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32188", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N;\n  cin >> N;\n  for (int I = 0; I < N; I++) {\n    int i;\n    char in[110];\n    cin >> in;\n\n    printf(\"%s\\n\", in);\n    int n = strlen(in);\n\n    char mark[110];\n    for (i = 0; i < n; i++)\n      mark[i] = ' ';\n\n    int left = 0;\n\n    for (i = 0; i < n; i++) {\n      if (in[i] == '(')\n        left++;\n\n      else if (in[i] == ')') {\n        if (left) {\n          left--;\n        } else\n          mark[i] = '?';\n      }\n    }\n\n    int right = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (in[i] == ')')\n        right++;\n\n      else if (in[i] == '(') {\n        if (right) {\n          right--;\n        } else {\n          mark[i] = '$';\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      cout << mark[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[201], b[201], c[201];\n  int l, i, m, d[201], y, j;\n  while (scanf(\"%s\", a) != EOF) {\n    l = strlen(a);\n    strcpy(b, a);\n    for (i = 0; i < l; i++) {\n      b[i] = ' ';\n    }\n    strcpy(c, a);\n  loop:\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < l; j++) {\n          if (a[j] == '(')\n            break;\n          else {\n            if (a[j] == ')') {\n              a[i] = a[j] = 'a';\n              goto loop;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n      }\n      if (a[i] == ')')\n        b[i] = '?';\n    }\n    cout << c << \"\\n\" << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32190", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[110], la;\n\nint main() {\n  while (1) {\n    int f = getchar();\n    if (f == -1)\n      break;\n    a[1] = f;\n    for (int i = 2; i <= 109; i++) {\n      a[i] = getchar();\n      if (a[i] == 10) {\n        la = i - 1;\n        break;\n      }\n    }\n    for (int i = 1; i <= la + 1; i++)\n      putchar(a[i]);\n    for (int i = 1; i <= la; i++) {\n      if (a[i] == ')') {\n        for (int j = i - 1; j >= 1; j--) {\n          if (a[j] == ')')\n            break;\n          if (a[j] == '(') {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 1; i <= la; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        putchar(32);\n      if (a[i] == '(') {\n        putchar('$');\n      }\n      if (a[i] == ')')\n        putchar('?');\n    }\n    putchar(10);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32191", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(char c[], char str[], int n) {\n  int a, i, j;\n  for (i = 0; i <= n - 1; i++) {\n    if (c[i] == '(') {\n      a = 1;\n      for (j = i + 1; j <= n - 1; j++) {\n        if (c[j] == '(')\n          a++;\n        else {\n          if (c[j] == ')')\n            a--;\n        }\n        if (a == 0)\n          break;\n      }\n      if (a > 0)\n        str[i] = '$';\n    }\n    if (c[i] == ')') {\n      a = -1;\n      for (j = i - 1; j >= 0; j--) {\n        if (c[j] == ')')\n          a--;\n        else if (c[j] == '(')\n          a++;\n        if (a == 0)\n          break;\n      }\n      if (a < 0)\n        str[i] = '?';\n    }\n  }\n}\nint main() {\n  int r = 0;\n  while (r <= 5) {\n    char c[110] = {0}, str[110] = {0};\n    int n, i;\n\n    cin >> c;\n    n = strlen(c);\n    for (i = 0; i <= n - 1; i++)\n      str[i] = ' ';\n    f(c, str, n);\n    puts(c);\n    puts(str);\n    r++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[110], s[110];\n  int left, i;\n  int leftp[110] = {0};\n  while (cin >> c) {\n    left = 0;\n    i = 0;\n    memset(leftp, 0, 110 * sizeof(int));\n    memset(s, 0, 110 * sizeof(char));\n    while (c[i] != '\\0') {\n      if (c[i] == '(') {\n        left++;\n        leftp[left] = i;\n      } else if (c[i] == ')') {\n        if (left == 0)\n          s[i] = '?';\n        else {\n          left--;\n        }\n      }\n      i++;\n    }\n    if (left > 0)\n      for (i = 1; i <= left; i++)\n        s[leftp[i]] = '$';\n    cout << c << endl;\n    for (i = 0; i < strlen(c); i++)\n      if ((s[i] == '?') || (s[i] == '$'))\n        cout << s[i];\n      else\n        cout << ' ';\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char b[101];\n  while (cin.getline(b, 101)) {\n    j = 0;\n    int c[100] = {0}, a[100] = {0};\n    n = strlen(b);\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(') {\n        a[j] = i + 1;\n        j++;\n      }\n      if (b[i] == ')') {\n        if (j > 0) {\n          j--;\n          a[j] = a[j + 1];\n        } else\n          c[i] = 1;\n      }\n    }\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n    for (i = 0; i < j; i++)\n      c[a[i] - 1] = 2;\n    for (i = 0; i < n; i++) {\n      if (c[i] == 1)\n        cout << \"?\";\n      else {\n        if (c[i] == 2)\n          cout << \"$\";\n        else\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  };\n  return 0;\n}\n"}
{"label": "17", "index": "32194", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char st[1000], st2[1000];\n  while (cin.getline(st, 1000)) {\n    for (int i = 1; i <= strlen(st); i++)\n      st2[i - 1] = ' ';\n    st2[strlen(st)] = '\\0';\n\n    int count = 0, z[1000];\n    for (int i = 1; i <= strlen(st); i++)\n      if (st[i - 1] == '(') {\n        count++;\n        z[count] = i;\n      } else if (st[i - 1] == ')') {\n        if (count > 0) {\n          z[count] = 0;\n          count--;\n        } else {\n          st2[i - 1] = '?';\n        }\n      }\n    for (int i = 1; i <= count; i++)\n      st2[z[i] - 1] = '$';\n    cout << st << endl << st2 << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110] = {0};\n  while (cin >> a) {\n    cout << a << endl;\n    int zuo[110] = {0}, z = 0;\n    int you[110] = {0}, y = 0;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        zuo[z++] = i;\n      if (a[i] == ')')\n        you[y++] = i;\n    }\n    for (int i = 0; i < y; i++) {\n      for (int j = z - 1; j >= 0; j--) {\n        if (zuo[j] < you[i]) {\n          zuo[j] = 200;\n          you[i] = -100;\n          break;\n        }\n      }\n    }\n    for (int j = 0; j < strlen(a); j++)\n      a[j] = ' ';\n\n    for (int j = 0; j < z; j++) {\n      if (zuo[j] != 200)\n        a[zuo[j]] = '$';\n    }\n    for (int j = 0; j < y; j++) {\n      if (you[j] != -100)\n        a[you[j]] = '?';\n    }\n\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {'\\0'};\n  while ((scanf(\"%s\", a)) != -1) {\n    printf(\"%s\\n\", a);\n    int b, c, d;\n    for (b = 0; b < 100; b++) {\n      if (a[b] == ')') {\n        for (c = b - 1; c >= 0; c--) {\n          if (a[c] == '(') {\n            a[c] = 'a';\n            a[b] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (d = 0; d < 100; d++) {\n      if (a[d] == ')')\n        printf(\"?\");\n      else if (a[d] == '(')\n        printf(\"$\");\n      else if (a[d] != '\\0')\n        printf(\" \");\n      a[d] = '\\0';\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, r, fl, lenth;\n  int i, j, k;\n  char str[100 + 10];\n  int left[101], right[101];\n  int flag[100 + 10];\n\n  while (cin.getline(str, 101)) {\n    l = 1;\n    r = 1;\n    for (lenth = 0; str[lenth] != '\\0'; lenth++) {\n      if (str[lenth] == '(') {\n        flag[lenth] = 1;\n        left[l++] = lenth;\n      } else if (str[lenth] == ')') {\n        flag[lenth] = 2;\n        right[r++] = lenth;\n      } else\n        flag[lenth] = 0;\n    }\n\n    fl = lenth - 1;\n\n    for (j = l - 1; j >= 1; j--)\n      for (k = 1; k <= r - 1; k++) {\n        if (right[k] > left[j]) {\n          flag[right[k]] = 0;\n          flag[left[j]] = 0;\n          right[k] = -1;\n          break;\n        }\n      }\n\n    for (lenth = 0; str[lenth] != '\\0'; lenth++)\n      printf(\"%c\", str[lenth]);\n\n    printf(\"\\n\");\n\n    \n\n    \n\n    for (lenth = 0; lenth <= fl; lenth++) {\n      if (flag[lenth] == 0)\n        printf(\" \");\n      else if (flag[lenth] == 1)\n        printf(\"$\");\n      else if (flag[lenth] == 2)\n        printf(\"?\");\n    }\n\n    printf(\"\\n\");\n    memset(str, 0, sizeof(str));\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], s1[200];\n  int i, j;\n  int len;\n  while (cin >> s) {\n    len = strlen(s);\n    strcpy(s1, s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == '(') {\n            break;\n          }\n        }\n        if (j >= 0) {\n          s[i] = ' ';\n          s[j] = ' ';\n        } else {\n          s[i] = '?';\n        }\n\n      } else if (s[i] != '(') {\n        s[i] = ' ';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n    }\n    puts(s1);\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], c[101];\n  int len, i, j, flag;\n  while (scanf(\"%s \", s)) {\n    strcpy(c, s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      flag = 0;\n      if (s[i] == 41) {\n        for (j = i - 1; j >= 0; j--) {\n          if (s[j] == 40) {\n            flag++;\n            break;\n          }\n        }\n        if (flag == 1) {\n          s[i] = 32;\n          s[j] = 32;\n        } else\n          s[i] = '?';\n      }\n    }\n    printf(\"%s \", c);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '?')\n        printf(\"?\");\n      else if (s[i] == 40)\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, len, c, zb[101], fb[101];\n  char a[101], s[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", a);\n    len = strlen(a);\n    for (j = 0; j < len; j++)\n      s[j] = a[j];\n\n    s[len] = '\\0';\n    for (j = 0; j < len; j++) {\n      if (s[j] != '(' && s[j] != ')') {\n        s[j] = ' ';\n      }\n    }\n    int o = 0, h = 0;\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        c = j;\n        zb[o] = j;\n        o++;\n      }\n      if (s[j] == ')' && o > 0) {\n        s[j] = ' ';\n        s[c] = ' ';\n        o--;\n        if (o > 0)\n          c = zb[o - 1];\n      }\n    }\n    for (j = 0; j < len; j++) {\n      if (s[j] == '(') {\n        s[j] = '$';\n      }\n      if (s[j] == ')') {\n        s[j] = '?';\n      }\n    }\n    printf(\"%s\\n%s\", a, s);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32201", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  while (scanf(\"%s \", a)) {\n    cout << a;\n    cout << endl;\n    int len, i, j;\n    len = strlen(a);\n    for (i = len - 1; i >= 0; i--) {\n      if (a[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (a[j] == ')') {\n            a[i] = 'A';\n            a[j] = 'B';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else {\n        if (a[i] == ')')\n          cout << \"?\";\n        else\n          printf(\" \");\n      }\n    }\n    cout << endl;\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32202", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar input[150], output[150];\nint main() {\n  int n, j;\n  scanf(\"%d \", &n);\n  for (j = 0; j < n; j++) {\n    cin >> input;\n    memset(output, 0, sizeof(output));\n    int count1 = 0, count2 = 0;\n    int i;\n    for (i = 0; i < strlen(input); ++i) {\n      output[i] = ' ';\n      if (input[i] == ')') {\n        if (count1 <= 0)\n          output[i] = '?';\n        else\n          count1--;\n      } else if (input[i] == '(')\n        count1++;\n    }\n    for (i = strlen(input); i >= 0; --i) {\n      if (input[i] == '(') {\n        if (count2 <= 0)\n          output[i] = '$';\n        else\n          count2--;\n      } else if (input[i] == ')')\n        count2++;\n    }\n    printf(\"%s\\n%s\\n\", input, output);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar num2[110] = {'\\0'};\n\nint left(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == '(') {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == ')') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = left(num, point + 1, sum, l);\n    if (num[point] == '(' && k == 0) {\n      num2[point] = '$';\n      return 0;\n    }\n    if (num[point] == '(' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == ')') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint right(char num[110], int point, int sum, int l) {\n  if (point == l) {\n    if (num[point] == ')') {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == '(') {\n      sum = 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return 0;\n  } else {\n    int k = right(num, point - 1, sum, l);\n    if (num[point] == ')' && k == 0) {\n      num2[point] = '?';\n      return 0;\n    }\n    if (num[point] == ')' && k != 0) {\n      sum = k - 1;\n      return sum;\n    }\n    if (num[point] == '(') {\n      sum = k + 1;\n      return sum;\n    }\n    if (num[point] != '(' && num[point] != ')')\n      return k;\n  }\n}\n\nint main() {\n  char num[110] = {'\\0'};\n  while (scanf(\"%s \", num)) {\n    int l = strlen(num);\n    printf(\"%s\\n\", num);\n    for (int i = 0; i < l; i++)\n      num2[i] = ' ';\n    num2[l] = '\\0';\n    left(num, 0, 0, l - 1);\n    right(num, l - 1, 0, 0);\n    printf(\"%s\\n\", num2);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a;\n  scanf(\"%d\", &n);\n  for (a = 1; a <= n; a++) {\n    char s[101];\n    scanf(\"%s\", s);\n    int left[101] = {0}, right[101] = {0}, i, l = 0, r = 0;\n    for (i = 0; i < strlen(s); i++) {\n      if (s[i] == '(') {\n        left[l++] = i + 1;\n      } else {\n        if (s[i] == ')') {\n          if (l != 0) {\n            l--;\n            left[l] = 0;\n          } else {\n            right[r++] = i + 1;\n          }\n        }\n      }\n    }\n    int le = 0, ri = 0;\n    printf(\"%s\\n\", s);\n    for (i = 0; i < strlen(s); i++) {\n      if (left[le] == i + 1) {\n        printf(\"$\");\n        le++;\n      } else {\n        if (right[ri] == i + 1) {\n          printf(\"?\");\n          ri++;\n        } else {\n          printf(\" \");\n        }\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar *mystrrchr(char *strcopy, char *end) {\n  char *tmp = end - 1;\n  while (tmp >= strcopy) {\n    if (*tmp == '(')\n      return tmp;\n\n    tmp--;\n  }\n  return NULL;\n}\n\nvoid judge(char *str, char *flag) {\n  char strcopy[101];\n  strcpy(strcopy, str);\n  int len = strlen(strcopy);\n  char *index1 = strchr(strcopy, ')');\n  while (index1 != NULL && (index1 - strcopy) < len) {\n    char *index2 = mystrrchr(strcopy, index1);\n    if (index2 != NULL) {\n      strcopy[index1 - strcopy] = '-';\n      strcopy[index2 - strcopy] = '-';\n    }\n    index1 = strchr(index1 + 1, ')');\n  }\n  int i = 0;\n  for (i = 0; i < len; i++) {\n    if (strcopy[i] == '(')\n      flag[i] = '$';\n    if (strcopy[i] == ')')\n      flag[i] = '?';\n  }\n  cout << str << \" \" << flag << \" \";\n}\n\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  getchar();\n  char str[101];\n  char flag[101];\n  while (n > 0) {\n    memset(flag, ' ', sizeof(flag));\n\n    scanf(\"%s \", str);\n    flag[strlen(str)] = '\u0000';\n    judge(str, flag);\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar in[102];\nint lenth;\nvoid match(int n) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(' && in[i + n] == ')') {\n      in[i] = ' ';\n      in[i + n] = ' ';\n    }\n  }\n  if (n <= lenth - 2) {\n    match(n + 1);\n  }\n}\nvoid print(char in[]) {\n  for (int i = 0; i < lenth; i++) {\n    if (in[i] == '(')\n      in[i] = '$';\n    else if (in[i] == ')')\n      in[i] = '?';\n    else {\n      in[i] = ' ';\n    }\n  }\n  cout << in << endl;\n}\nint main() {\n  while (scanf(\"%s \", in)) {\n    printf(\"%s\\n\", in);\n    lenth = strlen(in);\n    match(0);\n    print(in);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200], b[100], n = ')';\n  int i, j, k, l, m = 0;\n  while (1) {\n\n    cin >> a;\n    if (feof(stdin))\n      break;\n    k = 0;\n    while (1) {\n      n = ')';\n      m = 0;\n      for (i = 0; i < 200; i++) {\n        if (a[i] == '\u0000')\n          goto here;\n        l = 0;\n        for (j = 0; j < k; j++) {\n          if (i == b[j]) {\n            l = 1;\n            break;\n          }\n        }\n        if (l)\n          continue;\n        else if (a[i] != '(' && a[i] != ')')\n          continue;\n        else if (n == '(' && a[i] == ')') {\n          b[k] = m;\n          b[k + 1] = i;\n          k = k + 2;\n          break;\n        }\n        m = i;\n        n = a[i];\n      }\n    }\n  here:\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000') {\n        cout << \" \";\n        break;\n      }\n      m = 0;\n      for (j = 0; j < k; j++) {\n        if (i == b[j]) {\n          m = 1;\n          break;\n        }\n      }\n      if (m == 1)\n        printf(\" \");\n      else if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32208", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d\", &n);\n  char a[1000], b[1000];\n  int j, l, r;\n  for (i = 0; i < n; i++) {\n\n    memset(a, '\\n', 200);\n    memset(b, '\\n', 200);\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n        for (r = j - 1; r >= 0; r--) {\n          if (b[r] == '$') {\n            b[r] = ' ';\n            b[j] = ' ';\n            break;\n          }\n        }\n      } else if (a[j] != '(' && a[j] != ')') {\n        b[j] = ' ';\n      }\n    }\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32209", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid match(char *s, char *r, int len) {\n  char stack[100], c;\n  int top = 0;\n  int pos;\n  for (pos = 0; pos < len; ++pos)\n    r[pos] = ' ';\n  r[len] = '\\0';\n  for (pos = 0; pos < len; ++pos) {\n    c = s[pos];\n    if (c == '(')\n      stack[top++] = pos;\n    else if (c == ')') {\n      if (top > 0) {\n        top--;\n      } else {\n        r[pos] = '?';\n      }\n    }\n  }\n  while (top > 0) {\n    pos = stack[--top];\n    r[pos] = '$';\n  }\n}\nvoid outresult(char s[], char r[]) {\n  puts(s);\n  puts(r);\n}\nint main() {\n  char line[101], result[101], ch;\n  int pos = 0;\n  while ((ch = getchar()) != EOF) {\n    if (ch != '\\n')\n      line[pos++] = ch;\n    else {\n      line[pos] = '\\0';\n      match(line, result, pos);\n      outresult(line, result);\n      pos = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32210", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len, p;\n  while (cin.getline(a, 101)) {\n    printf(\"%s\\n\", a);\n    len = strlen(a);\n    for (i = len; i >= 0; i--) {\n\n      if (a[i] == '(') {\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == ')') {\n            a[i] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[i] == '1')\n          continue;\n        else\n          a[i] = '$';\n      }\n    }\n    for (p = 0; a[p] != '\\0'; p++) {\n      if (a[p] == ')') {\n        for (j = p - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[p] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[p] == '1')\n          continue;\n        else\n          a[p] = '?';\n      }\n    }\n    for (k = 0; a[k] != '\\0'; k++) {\n      if ((a[k] != '$') && (a[k] != '?'))\n        a[k] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, i, l;\n  char str[100];\n\n  for (;;) {\n\n    cin >> str;\n    if (feof(stdin))\n      break;\n    l = strlen(str);\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] == '(') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == ')' && b == 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a <= 0) {\n        str[i] = '?';\n      } else if (str[i] == ')' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    a = 0;\n    b = 0;\n    for (i = l - 1; i >= 0; i--) {\n      if (str[i] == ')') {\n        a = a + 1;\n        b = 1;\n      } else if (str[i] == '(' && b == 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a <= 0) {\n        str[i] = '$';\n      } else if (str[i] == '(' && b == 1 && a > 0) {\n        a = a - 1;\n      }\n    }\n    printf(\" \");\n    for (i = 0; i <= l - 1; i++) {\n      if (str[i] != '?' && str[i] != '$')\n        str[i] = ' ';\n    }\n    for (i = 0; i <= l - 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[2][101], c;\n  int i, len, flag = 0, count = 0;\n  while (scanf(\"%s\", s[0]) != EOF) {\n    len = strlen(s[0]);\n    for (i = 0; i < len; i++) {\n      c = s[0][i];\n      if (c == '(')\n        flag++;\n      if (c == ')')\n        flag--;\n      if (flag >= 0) {\n        s[1][i] = ' ';\n        continue;\n      }\n      if (flag < 0) {\n        s[1][i] = '?';\n        flag = 0;\n      }\n    }\n    flag = 0;\n    for (i = len - 1; i >= 0; i--) {\n      c = s[0][i];\n      if (c == ')')\n        flag++;\n      if (c == '(')\n        flag--;\n      if (flag < 0) {\n        s[1][i] = '$';\n        flag = 0;\n      }\n    }\n    flag = 0;\n    s[1][len] = '\\0';\n    puts(s[0]);\n    puts(s[1]);\n    for (i = 0; i < len; i++)\n      s[0][i] = s[1][i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int n, j;\n  int left;\n  scanf(\"%d \", &n);\n  cin.get();\n  for (j = 1; j <= n; j++) {\n    left = 0;\n\n    cin.getline(line, 101);\n    int len = strlen(line);\n    for (int i = 0; i <= 100; i++)\n      label[i] = ' ';\n    for (int i = 0; i <= len - 1; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')') {\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n      }\n    }\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101];\n  int i, j, k, len, p;\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    len = strlen(a);\n    for (i = len; i >= 0; i--) {\n\n      if (a[i] == '(') {\n        for (j = i + 1; a[j] != '\\0'; j++) {\n          if (a[j] == ')') {\n            a[i] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[i] == '1')\n          continue;\n        else\n          a[i] = '$';\n      }\n    }\n    for (p = 0; a[p] != '\\0'; p++) {\n      if (a[p] == ')') {\n        for (j = p - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[p] = '1';\n            a[j] = '1';\n            break;\n          }\n        }\n        if (a[p] == '1')\n          continue;\n        else\n          a[p] = '?';\n      }\n    }\n    for (k = 0; a[k] != '\\0'; k++) {\n      if ((a[k] != '$') && (a[k] != '?'))\n        a[k] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32215", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, t1, t2, flag, len;\n  int b[101], l[101], r[101];\n  char s[101];\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(') {\n        b[i] = -1;\n      } else if (s[i] == ')') {\n        b[i] = 1;\n      } else {\n        b[i] = 0;\n      }\n    }\n    t1 = 0;\n    t2 = 0;\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        l[t1] = i;\n        t1++;\n      }\n      if (b[i] == 1) {\n        r[t2] = i;\n        t2++;\n      }\n    }\n    for (i = t1 - 1; i >= 0; i--) {\n      for (j = 0; j < t2; j++) {\n        if (r[j] > l[i]) {\n          b[r[j]] = 0;\n          b[l[i]] = 0;\n          r[j] = 0;\n          l[i] = 0;\n          break;\n        }\n      }\n    }\n    puts(s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == -1) {\n        printf(\"$\");\n      } else if (b[i] == 1) {\n        printf(\"?\");\n      } else {\n        printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32216", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], t[1000];\n  int len;\n  int n;\n  scanf(\"%d\", &n);\n  while (n-- > 0) {\n    scanf(\"%s\", s);\n    len = strlen(s);\n    memset(t, ' ', len);\n    t[len] = 0;\n\n    for (int i = 0; i < len; i++) {\n      if (s[i] == '(' || s[i] == '[' || s[i] == '{') {\n        t[i] = '$';\n      }\n      char match = ' ';\n      if (s[i] == ')') {\n        match = '(';\n      } else if (s[i] == ']') {\n        match = '[';\n      } else if (s[i] == '}')\n        match = '{';\n\n      if (match != ' ') {\n        for (int j = i - 1; j >= 0; j--) {\n          if (t[j] == '$') {\n            if (s[j] == match) {\n              t[j] = ' ';\n              match = ' ';\n            }\n            break;\n          }\n        }\n        if (match != ' ') {\n          t[i] = '?';\n        }\n      }\n    }\n    printf(\"%s\\n%s\\n\", s, t);\n  }\n}\n"}
{"label": "17", "index": "32217", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  char c[10000];\n  int i;\n  for (i = 0; i < n; i++) {\n    cin >> c;\n    printf(\"%s\\n\", c);\n    int j, x;\n    x = strlen(c);\n    for (j = 0; j < x; j++) {\n      if (c[j] != '(' && c[j] != ')') {\n        c[j] = ' ';\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == ')') {\n        int m;\n        for (m = j; m >= 0; m--) {\n          if (c[m] == '(') {\n            c[m] = ' ';\n            c[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < x; j++) {\n      if (c[j] == '(') {\n        c[j] = '$';\n      } else if (c[j] == ')') {\n        c[j] = '?';\n      }\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x[1000];\n  char a[1000];\n  int i, j;\n  while (cin.getline(a, 1000)) {\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        x[i] = 1;\n      else if (a[i] == ')')\n        x[i] = -1;\n      else\n        x[i] = 0;\n    }\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l - i; j++)\n        if (x[j] == 1 && x[i + j] == -1)\n          x[j] = x[i + j] = 0;\n    printf(\"%s\\n\", a);\n    for (i = 0; i < l; i++) {\n      if (x[i] == 1)\n        cout << \"$\";\n      else if (x[i] == -1)\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200] = {0}, b[200] = {0};\n  int i, j, leftpos = 0, pos[200], k;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    j = 0;\n    for (i = 0; i < strlen(a); i++)\n      if (a[i] == '(' || a[i] == ')') {\n        b[j] = a[i];\n        pos[j] = i;\n        j++;\n      }\n    leftpos = -1;\n    k = 0;\n    while (k != strlen(b)) {\n      if (b[k] == '(')\n        leftpos = k;\n      if (b[k] == ')' && leftpos != -1) {\n        a[pos[k]] = ' ';\n        a[pos[leftpos]] = ' ';\n        b[leftpos] = ' ';\n        b[k] = ' ';\n        leftpos = -1;\n        k = -1;\n      }\n      k++;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      else if (a[i] == ')')\n        printf(\"?\");\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n    memset(a, 0, 200);\n    memset(b, 0, 200);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32220", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char c[100];\n  int l;\n\n  while (cin >> c) {\n    int a[100] = {0};\n    int left = 0;\n\n    l = strlen(c);\n\n    for (int i = 0; i < l; i++) {\n\n      if (left == 0 && c[i] == ')')\n        a[i] = 1;\n\n      if (c[i] == '(')\n        left++;\n\n      if (c[i] == ')' && left > 0) {\n        left--;\n\n        for (int j = i; j >= 0; j--) {\n          if ((c[j] == '(') && (a[j] != 2)) {\n            a[j] = 2;\n            break;\n          }\n        }\n      }\n    }\n\n    int count = 0;\n\n    if (left != 0)\n      for (int i = l; count < left; i--) {\n        if (c[i] == '(' && a[i] != 2) {\n          a[i] = -1;\n          count++;\n        }\n      }\n\n    for (int i = 0; i < l; i++)\n      cout << c[i];\n\n    cout << endl;\n\n    for (int i = 0; i < l; i++) {\n      if (a[i] == 0 || a[i] == 2)\n        printf(\" \");\n      else if (a[i] == 1)\n        cout << '?';\n      else if (a[i] == -1)\n        cout << '$';\n    }\n\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, len, n, left = 0, right = 0, k;\n  char a[10][101] = {\"\u0000\"};\n  int b[10][101] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n\n    cin >> a[i];\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (a[i][j] == '(') {\n        b[i][j] = -1;\n        left++;\n      }\n      if (a[i][j] == ')') {\n        b[i][j] = 1;\n        right++;\n      }\n    }\n\n    for (j = 0; left != 0, right != 0, j < len; j++) {\n      if (b[i][j] == 1) {\n\n        for (k = j - 1; k >= 0; k--) {\n          if (b[i][k] == -1) {\n            b[i][k] = 0;\n            b[i][j] = 0;\n            left--;\n            right--;\n            break;\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    puts(a[i]);\n    len = strlen(a[i]);\n    for (j = 0; j < len; j++) {\n      if (b[i][j] == -1)\n        cout << \"$\";\n      if (b[i][j] == 1)\n        printf(\"?\");\n      if (b[i][j] == 0)\n        printf(\" \");\n    }\n    printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[200], str1[200];\n  while (scanf(\"%s\", str1) != EOF) {\n    int m;\n    m = strlen(str1);\n    strcpy(str, str1);\n    int i, j;\n    for (i = 1; i < m; i++) {\n      for (j = 0; j < m; j++) {\n        if (i + j < m) {\n          if (str[j] == '(' && str[j + i] == ')') {\n            str[j] = 'a';\n            str[j + i] = 'a';\n          }\n        }\n      }\n    }\n    for (i = 0; i < m; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      else if (str[i] == ')')\n        str[i] = '?';\n      else\n        str[i] = ' ';\n    }\n    printf(\"%s\\n\", str1);\n    cout << str << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num = 0, i, l, j, k, n, left[101];\n  char str[101], str2[101];\n  while (cin >> str) {\n    strcpy(str2, str);\n    for (i = 0, l = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n    }\n    for (n = l - 1; n >= 0; n--) {\n      for (k = left[n] + 1; str[k]; k++) {\n        if (str2[k] == ')') {\n          str2[left[n]] = ' ';\n          str2[k] = ' ';\n          break;\n        }\n      }\n    }\n    for (j = 0; str[j]; j++) {\n      if (str2[j] == '(')\n        str2[j] = '$';\n      else if (str2[j] == ')')\n        str2[j] = '?';\n      else\n        str2[j] = ' ';\n    }\n    printf(\"%s \", str);\n    printf(\"%s \", str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[101];\n  char str2[101];\n  int a[101];\n  int l, i, j, temp;\n  while (cin >> str1) {\n    l = strlen(str1);\n    for (i = 0; i < l; i++) {\n      if (str1[i] == '(')\n        a[i] = 1;\n      else if (str1[i] == ')')\n        a[i] = -1;\n      else\n        a[i] = 0;\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) {\n        temp = 0;\n        for (j = i; j < l; j++) {\n          temp = temp + a[j];\n          if (temp == 0) {\n            a[i] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == 1) {\n        str2[i] = '$';\n      } else if (a[i] == -1)\n        str2[i] = '?';\n      else\n        str2[i] = ' ';\n    }\n    str2[l] = '\\0';\n    cout << str1 << endl;\n    printf(\"%s\\n\", str2);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32225", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[150], d[150] = {0};\n  int i, j, l = 11, x;\n  for (x = 1; x <= 10; x++) {\n    for (i = 0; i <= l; i++) {\n      c[i] = ' ';\n      d[i] = '\u0000';\n    }\n\n    cin >> c;\n    l = strlen(c);\n    for (i = 0;; i++) {\n      if (c[i] == '\u0000')\n        break;\n      if (c[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (c[j] == '(') {\n            c[j] = '!';\n            break;\n          }\n        }\n        if (j < 0) {\n          c[i] = '?';\n          d[i] = '?';\n        }\n      }\n    }\n    for (i = 0;; i++) {\n      if (c[i] == '(') {\n        c[i] = '!';\n        d[i] = '$';\n      }\n      if (c[i] == '\u0000')\n        break;\n    }\n    for (i = 0;; i++) {\n      if (c[i] == '\u0000')\n        break;\n      if (c[i] == '!')\n        c[i] = '(';\n      if (c[i] == '?')\n        c[i] = ')';\n      if (d[i] != '$' && d[i] != '?')\n        d[i] = ' ';\n    }\n    puts(c);\n    puts(d);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32226", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  while (true) {\n    cin.getline(a, 101);\n    if (a[0] == 0)\n      break;\n    printf(\"%s\\n\", a);\n    int i, j = 0, k, l, d;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    b[i] = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (j == 0 && a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == ')') {\n        j--;\n        for (k = i; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[k] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(') {\n        j++;\n        b[i] = '$';\n      }\n    }\n    for (d = 0; d < strlen(a); d++)\n      if (b[d] != ' ')\n        break;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = b[i + d];\n    for (l = (strlen(a) - 1 - d); l >= 0; l--)\n      if (b[l] != ' ')\n        break;\n    b[l + 1] = 0;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32227", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, tmp1, tmp2 = 1;\n  do {\n    char s[101];\n    char st[101];\n    char r1[101];\n    int r2[101];\n    int d, f = 0, pi = 0;\n    if (scanf(\"%s\", s) != EOF) {\n      f = 1;\n      d = strlen(s);\n      strcpy(st, s);\n      for (j = 0; j < d; j++) {\n        if (pi == 0 && (s[j] == '(' || s[j] == ')')) {\n          r1[0] = s[j];\n          r2[0] = j;\n          pi += 1;\n        } else if ((s[j] == '(' || s[j] == ')')) {\n          if (r1[pi - 1] == '(' && s[j] == ')') {\n            s[r2[pi - 1]] = ' ';\n            s[j] = ' ';\n            pi -= 1;\n          } else {\n            r1[pi] = s[j];\n            r2[pi] = j;\n            pi += 1;\n          }\n        } else\n          s[j] = ' ';\n      }\n      for (j = 0; j < pi; j++) {\n        if (r1[j] == '(')\n          s[r2[j]] = '$';\n        else\n          s[r2[j]] = '?';\n      }\n      cout << st << \"\\n\" << s << \"\\n\";\n    } else\n      break;\n  } while (tmp2);\n\n  return 0;\n}\n"}
{"label": "17", "index": "32228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  int flag[101], i, j, len;\n  while (scanf(\"%s \", str)) {\n    for (i = 0; i < 101; i++)\n      flag[i] = 0;\n    len = strlen(str);\n    for (i = len - 2; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i + 1; j < len; j++) {\n          if (str[j] == ')' && flag[j] == 0) {\n            flag[j] = 1;\n            flag[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    cout << str << endl;\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        cout << \" \";\n      else {\n        if (str[i] == '(' && flag[i] == 0)\n          printf(\"$\");\n        if (str[i] == '(' && flag[i] == 1)\n          cout << \" \";\n        if (str[i] == ')' && flag[i] == 0)\n          cout << \"?\";\n        if (str[i] == ')' && flag[i] == 1)\n          cout << \" \";\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32229", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, n, b, k, t, m, p;\n  char a[1000] = {0};\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    scanf(\"%s\", a);\n    printf(\"%s\\n\", a);\n    b = strlen(a);\n    for (m = 0; m < b; m++) {\n      if (a[m] != '(' && a[m] != ')') {\n        a[m] = ' ';\n      }\n    }\n    for (i = 0; i < b; i++) {\n      if (a[i] == ')') {\n        for (t = i; t >= 0; t--) {\n          if (a[t] == '(') {\n            a[i] = ' ';\n            a[t] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (k = 0; k < b; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } else if (a[k] == ')') {\n        a[k] = '?';\n      }\n    }\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len = 0, i = 0, j = 0, sum = 0;\n  char in[101];\n  int sign[101];\n  char out[101];\n  while (cin.getline(in, 101) && in[0] != '\\0') {\n    len = strlen(in);\n    for (i = 0; i < len; i++)\n      sign[i] = 0;\n    for (i = 0; i < len; i++)\n      out[i] = ' ';\n    out[len] = '\\0';\n    for (i = 0; i < len; i++) {\n      sum = 1;\n      if (in[i] == '(') {\n        if (i == len - 1)\n          out[i] = '$';\n        else {\n          for (j = i + 1; j < len; j++) {\n\n            if (in[j] == '(')\n              sum = sum + 1;\n            if (in[j] == ')')\n              sum = sum - 1;\n            if (sum == 0) {\n              sign[j] = 1;\n              break;\n            }\n          }\n          if (sum != 0)\n            out[i] = '$';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (in[i] == ')' && sign[i] == 0)\n        out[i] = '?';\n    }\n    printf(\"%s\\n\", in);\n    printf(\"%s\\n\", out);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  int num = 0, i, l, j, k, n, left[101];\n  char str[101], str2[101];\n  while (cin >> str) {\n    strcpy(str2, str);\n    for (i = 0, l = 0; str[i]; i++) {\n      if (str[i] == '(') {\n        left[l] = i;\n        l++;\n      }\n    }\n    for (n = l - 1; n >= 0; n--) {\n      for (k = left[n] + 1; str[k]; k++) {\n        if (str2[k] == ')') {\n          str2[left[n]] = ' ';\n          str2[k] = ' ';\n          break;\n        }\n      }\n    }\n    for (j = 0; str[j]; j++) {\n      if (str2[j] == '(')\n        str2[j] = '$';\n      else if (str2[j] == ')')\n        str2[j] = '?';\n      else\n        str2[j] = ' ';\n    }\n    cout << str << \" \";\n    printf(\"%s \", str2);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32232", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[2][101], c;\n  int i, len, flag = 0;\n  while (scanf(\"%s\", s[0]) != EOF) {\n    len = strlen(s[0]);\n    for (i = 0; i < len; i++) {\n      c = s[0][i];\n      if (c == '(')\n        flag++;\n      if (c == ')')\n        flag--;\n      if (flag >= 0) {\n        s[1][i] = ' ';\n        continue;\n      }\n      if (flag < 0) {\n        s[1][i] = '?';\n        flag = 0;\n      }\n    }\n    flag = 0;\n    for (i = len - 1; i >= 0; i--) {\n      c = s[0][i];\n      if (c == ')')\n        flag++;\n      if (c == '(')\n        flag--;\n      if (flag < 0) {\n        s[1][i] = '$';\n        flag = 0;\n      }\n    }\n    flag = 0;\n    s[1][len] = '\\0';\n    puts(s[0]);\n    puts(s[1]);\n    for (i = 0; i < len; i++)\n      s[0][i] = s[1][i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid peidui(void);\nint m, i;\nchar a[100][110];\nint main() {\n  char c, h;\n  int j, k, t[100] = {0}, p, n = 0;\n  while (cin >> a[n]) {\n    n = n + 1;\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 110; j++) {\n      if (a[i][j] != '\\0')\n        t[i] = t[i] + 1;\n      if (a[i][j] == '\\0')\n        break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < t[i]; j++)\n      cout << a[i][j];\n    cout << endl;\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(') {\n        m = m + 1;\n        peidui();\n        m = m - 1;\n      }\n      if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n          (a[i][m] >= 'A' && a[i][m] <= 'Z'))\n        a[i][m] = ' ';\n    }\n    for (m = 0; m < t[i]; m++) {\n      if (a[i][m] == '(')\n        a[i][m] = '$';\n      if (a[i][m] == ')')\n        a[i][m] = '?';\n    }\n    for (m = 0; m < t[i]; m++)\n      cout << a[i][m];\n    cout << endl;\n  }\n  return 0;\n}\nvoid peidui(void) {\n  int k;\n  k = m - 1;\n  if ((a[i][m] >= 'a' && a[i][m] <= 'z') ||\n      (a[i][m] >= 'A' && a[i][m] <= 'Z')) {\n    a[i][m] = ' ';\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == '(') {\n    m = m + 1;\n    peidui();\n  }\n  if (a[i][m] == ')' && a[i][k] == '(') {\n    a[i][m] = ' ';\n    a[i][k] = ' ';\n    m = m + 1;\n    peidui();\n  }\n}\n"}
{"label": "17", "index": "32234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint findRight(char s[], int pos, int l) {\n  int t;\n  if (s[pos] == '\\0')\n    return -1;\n  if (s[pos] == '(') {\n    t = findRight(s, pos + 1, l + 1);\n    if (t == -1) {\n      s[pos] = '$';\n      return -1;\n    } else {\n      s[pos] = ' ';\n      return findRight(s, t + 1, l);\n    }\n  } else if (s[pos] == ')') {\n    if (l == 0) {\n      s[pos] = '?';\n      findRight(s, pos + 1, l);\n    } else {\n      s[pos] = ' ';\n      return pos;\n    }\n  } else {\n    s[pos] = ' ';\n    return findRight(s, pos + 1, l);\n  }\n}\nint main() {\n  char s[1000];\n  for (; scanf(\"%s \", s);) {\n    printf(\"%s\\n\", s);\n    findRight(s, 0, 0);\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "17", "index": "32235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[100];\n  int len, i, j, a[100];\n  while (scanf(\"%s\", c) != EOF) {\n    if (c[0] == '\\0')\n      break;\n    printf(\"%s\\n\", c);\n    len = strlen(c);\n    for (i = 0; i < len; i++) {\n      if (c[i] == '(')\n        a[i] = -1;\n      else if (c[i] == ')') {\n        a[i] = 1;\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == -1) {\n            a[j] = 0;\n            a[i] = 0;\n            break;\n          }\n        }\n      } else\n        a[i] = 0;\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == -1)\n        printf(\"$\");\n      if (a[i] == 1)\n        printf(\"?\");\n      if (a[i] == 0)\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32236", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid find(char a[], int n, int m) {\n  int i;\n  if (a[m] != ')' && m < n) {\n    find(a, n, m + 1);\n  }\n  if (a[m] == ')' && m < n) {\n    for (i = m; i >= 0; i--) {\n      if (a[i] == '(') {\n        a[i] = ' ';\n        a[m] = ' ';\n        break;\n      }\n    }\n    find(a, n, m + 1);\n  }\n}\nint main() {\n  int n;\n  char a[200];\n  while (scanf(\"%s \", a)) {\n    cout << a << endl;\n    n = strlen(a);\n    find(a, n, 0);\n    for (int k = 0; k < n; k++) {\n      if (a[k] == '(') {\n        a[k] = '$';\n      } else {\n        if (a[k] == ')') {\n          a[k] = '?';\n        } else {\n          if (a[k] != '(' && a[k] != ')') {\n            a[k] = ' ';\n          }\n        }\n      }\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32237", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int i, len;\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32238", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, flag;\n  char a[200], b[200];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    memset(b, 0, 200);\n    cin >> a;\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] == '(') {\n        flag = 1;\n        k = j + 1;\n        while (flag != 0 && k < strlen(a)) {\n          if (a[k] == '(')\n            flag++;\n          if (a[k] == ')')\n            flag--;\n          k++;\n        }\n        if (k >= strlen(a) && flag != 0)\n          b[j] = '$';\n        else {\n          b[k - 1] = ' ';\n          b[j] = ' ';\n        }\n      } else if (a[j] == ')' && b[j] != ' ')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    printf(\"%s\\n\", a);\n    printf(\"%s\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, u, p;\n  char c;\n  for (;;) {\n    p = 1;\n    char ch[102] = {'0'};\n    i = 2;\n    c = getchar();\n    if (c == -1)\n      break;\n    else\n      ch[1] = c;\n    while ((c = getchar()) != '\\n') {\n      ch[i] = c;\n      i++;\n    }\n    i--;\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n    while (p == 1) {\n      p = 0;\n      for (j = 1; j <= i - 1; j++) {\n        if (ch[j] == '(') {\n          for (k = j + 1; k <= i; k++) {\n            u = 1;\n            if (ch[k] == '(') {\n              break;\n            } else {\n              if (ch[k] == ')') {\n                u = 0;\n                break;\n              }\n            }\n          }\n          if (u == 0) {\n            ch[j] = 0;\n            ch[k] = 0;\n            p = 1;\n          }\n        }\n      }\n    }\n    for (j = 1; j <= i; j++) {\n      if (ch[j] == '(') {\n        ch[j] = '$';\n      } else {\n        if (ch[j] == ')')\n          ch[j] = '?';\n        else\n          ch[j] = ' ';\n      }\n    }\n    for (j = 1; j <= i; j++)\n      printf(\"%c\", ch[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  char kuohao[101] = {0};\n  int i, j, len;\n\n  while (scanf(\"%s\", s) > 0) {\n    for (i = 0;; i++) {\n      if (s[i] == '(')\n        kuohao[i] = 1;\n      else if (s[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (kuohao[j] == 1) {\n            kuohao[j] = 0;\n            break;\n          }\n        }\n        if (j < 0)\n          kuohao[i] = 3;\n      } else if (s[i] == '\\0')\n        break;\n    }\n    printf(\"%s\\n\", s);\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (kuohao[i] == 0)\n        printf(\" \");\n      else if (kuohao[i] == 1)\n        printf(\"$\");\n      else if (kuohao[i] == 3)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      kuohao[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[500][103];\nvoid chuli(int i, int la) {\n  int j, k, flag = 0;\n  for (j = 0; j < la - 1; j++) {\n    if (a[i][j] == '(') {\n      k = j + 1;\n      while (a[i][k] != '(' && a[i][k] != ')' && k < la)\n        k++;\n      if (a[i][k] == ')') {\n        flag = 1;\n        a[i][j] = a[i][k] = ' ';\n      }\n    }\n  }\n  if (flag == 1)\n    chuli(i, la);\n}\nint main() {\n  int n = 0, la[500] = {0}, i, j;\n  char c, b[500][103];\n  while (cin >> c) {\n    while (c != '\\n') {\n      a[n][la[n]] = b[n][la[n]] = c;\n      la[n]++;\n      c = getchar();\n    }\n    n++;\n  }\n  for (i = 0; i < n; i++)\n    chuli(i, la[i]);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < la[i]; j++)\n      cout << b[i][j];\n    cout << endl;\n    for (j = 0; j < la[i]; j++) {\n      if (a[i][j] == '(') {\n        cout << '$';\n      } else if (a[i][j] == ')')\n        cout << '?';\n      else\n        cout << ' ';\n    }\n    if (i != n - 1)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    char s[104];\n    int len = 0;\n\n    cin >> s;\n    puts(s);\n    len = strlen(s);\n    int j;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        for (j = i; j < len; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else {\n        if (s[i] == ')')\n          printf(\"?\");\n        else\n          printf(\" \");\n      }\n    }\n    printf(\" \");\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(int n, char b[]) {\n  if (n > 0)\n    f(n - 1, b);\n  int i = 0, k = 0, x = 0;\n  for (k = 0; k < n; k++) {\n    if (b[k] == ')') {\n      for (x = 0; x <= k; x++) {\n        if (b[k - x] == '(') {\n          b[k] = ' ';\n          b[k - x] = ' ';\n          break;\n        }\n      }\n    }\n  }\n}\nint main() {\n  int j = 0;\n  for (j = 0; j < 10; j++) {\n    char a[200] = {0}, b[200] = {0};\n    int i = 0, n = 0;\n    for (i = 0;; i++) {\n      a[i] = getchar();\n      b[i] = a[i];\n      if (b[i] != '(' && b[i] != ')' && b[i] != '\\n')\n        b[i] = ' ';\n      if (a[i] == '\\n')\n        break;\n      n++;\n    }\n    f(n, b);\n    for (i = 0; i < n; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < n; i++) {\n      if (b[i] == '(')\n        b[i] = '$';\n      else if (b[i] == ')')\n        b[i] = '?';\n    }\n\n    for (i = 0; i < n; i++)\n      cout << b[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32244", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, len, lnum, num = 0, left[102] = {-1}, fail[102] = {0}, t = 0;\n  char s1[102];\n  while (scanf(\"%s\", s1) != EOF) {\n    printf(\"%s\\n\", s1);\n    len = strlen(s1);\n    lnum = 0;\n    for (i = 0; i < len; i++) {\n      if (s1[i] == '(') {\n        lnum++;\n        left[lnum] = i;\n      }\n\n      if (s1[i] == ')') {\n        if (lnum == 0)\n          fail[i] = 2;\n        else {\n          left[lnum] = -1;\n          lnum--;\n        }\n      }\n    }\n    for (i = 1; i <= lnum; i++) {\n      fail[left[i]] = 1;\n      left[i] = -1;\n    }\n\n    for (i = 0; i < len; i++)\n      if (fail[i] > 0)\n        num++;\n    for (i = 0; i < len && num > 0; i++) {\n      if (fail[i] == 2) {\n        cout << \"?\";\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 1) {\n        printf(\"$\");\n        num--;\n        t = 1;\n      }\n      if (fail[i] == 0 && t == 1)\n        cout << \" \";\n      fail[i] = 0;\n    }\n    t = 0;\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[150] = {'0'}, b[150] = {'0'};\n  for (; ~scanf(\"%s\", &a);) {\n    i = strlen(a);\n    for (j = 0; j < i; j++) {\n      if (a[j] == '(')\n        b[j] = '$';\n      else if (a[j] == ')')\n        b[j] = '?';\n      else\n        b[j] = ' ';\n    }\n    for (j = 0; j < i; j++)\n      for (k = j - 1; k >= 0; k--) {\n        if (b[k] == '$' && b[j] == '?') {\n          b[k] = ' ';\n          b[j] = ' ';\n        }\n      }\n    for (k = 0; k < i; k++)\n      printf(\"%c\", a[k]);\n    printf(\"\\n\");\n    for (k = 0; k < i; k++)\n      printf(\"%c\", b[k]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100];\n  int c[100], i, j, k = 0;\n  while ((scanf(\"%s\", s[k])) != EOF) {\n    puts(s[k]);\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (s[k][i] == '(')\n        c[i] = -1;\n      else if (s[k][i] == ')')\n        c[i] = 1;\n      else\n        c[i] = 0;\n    }\n    for (i = 1; i < strlen(s[k]); i++)\n      for (j = 0; j < strlen(s[k]) - i; j++)\n        if (c[j] == -1 && c[j + i] == 1) {\n          c[j] = 0;\n          c[j + i] = 0;\n        }\n    for (i = 0; i < strlen(s[k]); i++) {\n      if (c[i] == 0)\n        printf(\" \");\n      else if (c[i] == -1)\n        cout << \"$\";\n      else if (c[i] == 1)\n        printf(\"?\");\n    }\n    printf(\"\\n\");\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char line[1000];\n  char outline[1000];\n  int i, j;\n  int len;\n  while (cin >> line) {\n    strcpy(outline, line);\n    len = strlen(line);\n    for (i = 0; i < len; i++) {\n      if (line[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (line[j] == '(') {\n            line[j] = ' ';\n            line[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << outline << endl;\n    for (i = 0; i < len; i++) {\n      if (line[i] == '(') {\n        cout << '$';\n      } else {\n        if (line[i] == ')') {\n          cout << '?';\n        } else\n          cout << ' ';\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  while (cin.getline(str, 101, '\\n')) {\n    char k[101] = {0}, ts[101] = {0};\n    int i, t, temp = 0;\n    for (i = 0; str[i] != '\\0'; i++) {\n      k[i] = ' ';\n      ts[i] = str[i];\n      if (str[i] == '(')\n        temp++;\n      if (str[i] == ')')\n        temp--;\n      if (temp < 0) {\n        k[i] = '?';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    t = i - 1;\n    temp = 0;\n    for (i = t; i >= 0; i--) {\n      if (str[i] == ')')\n        temp++;\n      if (str[i] == '(')\n        temp--;\n      if (temp < 0) {\n        k[i] = '$';\n        str[i] = ' ';\n        temp++;\n      }\n    }\n    cout << ts << \"\\n\" << k << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32249", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], temp[1000];\n  int b[1000];\n  int i, n = 0, m = 0, len, j;\n  memset(temp, 2, sizeof(temp));\n  while (1) {\n    m = 0;\n    n = 0;\n    scanf(\"%s\", s);\n    if (strcmp(temp, s) == 0)\n      break;\n    else\n      strcpy(temp, s);\n    memset(b, 0, sizeof(b));\n    len = strlen(s);\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        n++;\n      else if (s[i] == ')' && n > 0) {\n        n--;\n        b[i] = 1;\n      }\n    }\n    for (j = len - 1; j >= 0; j--) {\n      if (s[j] == ')')\n        m++;\n      else if (s[j] == '(' && m > 0) {\n        m--;\n        b[j] = 1;\n      }\n    }\n    printf(\"%s\\n\", s);\n    for (i = 0; i < len; i++) {\n      if (b[i] == 0 && s[i] == ')')\n        printf(\"?\");\n      else if (b[i] == 0 && s[i] == '(')\n        printf(\"$\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[200], b[200];\n  int c[200];\n  int i, j, k, t, m, n;\n  while (scanf(\"%s \", a)) {\n\n    k = strlen(a);\n    m = 0;\n    n = 0;\n    for (i = 0; i < k; i++) {\n      cout << a[i];\n      if (i == k - 1)\n        cout << \"\\n\";\n      if (a[i] != '(' && a[i] != ')')\n        b[i] = ' ';\n      else if (a[i] == ')') {\n        c[m] = i;\n        m++;\n      }\n    }\n    n = m;\n    for (i = 0; i < n; i++) {\n      char *p = &a[c[i]];\n      t = 0;\n      for (j = 0; j <= c[i]; j++)\n        if (*p == '(') {\n          t = 1;\n          b[c[i] - j] = ' ';\n          b[c[i]] = ' ';\n          a[c[i] - j] = ' ';\n          break;\n        } else\n          p--;\n      if (t == 0)\n        b[c[i]] = '?';\n    }\n    for (i = 0; i < k; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      cout << b[i];\n      if (i == k - 1)\n        cout << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  int n, i, j;\n  while (1) {\n    if (scanf(\"%s\", s) == EOF)\n      return 0;\n    puts(s);\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(')\n        s[i] = '$';\n      else {\n        if (s[i] == ')')\n          s[i] = '?';\n        else\n          s[i] = ' ';\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (s[j] == '$') {\n            s[j] = ' ';\n            s[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    while (s[n - 1] == ' ') {\n      s[n - 1] = '\\0';\n      n--;\n    }\n    while (s[0] == ' ') {\n      for (i = 0; i < n; i++) {\n        s[i] = s[i + 1];\n      }\n    }\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32252", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, mz;\n  char a[200] = {'\u0000'}, b[200];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    count = 0;\n    for (j = 0; j < 200; j++) {\n      a[j] = '\u0000';\n      b[j] = '\u0000';\n    }\n\n    cin >> a;\n    strcpy(b, a);\n    for (j = 0; j < 200; j++) {\n      if (a[j] == '\u0000')\n        break;\n      count++;\n    }\n    for (j = count - 1; j >= 0; j--) {\n      if (b[j] == '(') {\n        mz = 0;\n        for (k = j; k < count; k++) {\n          if (b[k] == ')') {\n            b[k] = ' ';\n            b[j] = ' ';\n            mz = 1;\n            break;\n          }\n        }\n        if (mz == 0)\n          b[j] = '$';\n      }\n    }\n    for (j = 0; j < count; j++) {\n      if (b[j] == ')')\n        b[j] = '?';\n    }\n    for (j = 0; j < count; j++)\n      printf(\"%c\", a[j]);\n    printf(\" \");\n    for (j = 0; j < count; j++) {\n      if (b[j] != '$' && b[j] != '?')\n        printf(\" \");\n      else\n        printf(\"%c\", b[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32253", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar p[200], q[200];\nint main() {\n  while (scanf(\"%s\", &p) != EOF) {\n    memset(q, ' ', sizeof(q));\n    int l = strlen(p);\n    q[l] = 0;\n    int t = 0;\n    for (int i = 0; i < l; i++) {\n      if (p[i] == '(')\n        t++;\n      else if (p[i] == ')') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '?';\n      }\n    }\n    t = 0;\n    for (int i = l - 1; i >= 0; i--) {\n      if (p[i] == ')')\n        t++;\n      else if (p[i] == '(') {\n        if (t > 0)\n          t--;\n        else\n          q[i] = '$';\n      }\n    }\n    printf(\"%s\\n%s\\n\", p, q);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32254", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], s0[1000], t[1000];\n  int len, i, j;\n  while (scanf(\"%s\", s) != EOF) {\n    len = strlen(s);\n    strcpy(s0, s);\n    for (i = 0; i < len; i++)\n      if (s0[i] == ')' && i > 0)\n        for (j = i - 1; j >= 0; j--)\n          if (s0[j] == '(') {\n            s0[i] = ' ';\n            s0[j] = ' ';\n            break;\n          }\n\n    for (i = 0; i < len; i++) {\n      if (s0[i] == '(')\n        t[i] = '$';\n      else if (s0[i] == ')')\n        t[i] = '?';\n      else\n        t[i] = ' ';\n    }\n\n    printf(\"%s \", s);\n    for (i = 0; i < len; i++)\n      printf(\"%c\", t[i]);\n    putchar(' ');\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, num, p, q;\n  for (i = 0; i < n; i++) {\n    char a[101], b[101];\n    scanf(\"%s\", &a);\n    num = strlen(a);\n    for (j = 0; j < num; j++) {\n      if (a[j] == '(') {\n        b[j] = '$';\n      } else if (a[j] == ')') {\n        b[j] = '?';\n      } else {\n        b[j] = ' ';\n      }\n    }\n\n    for (p = num - 1; p >= 0; p--) {\n      if (b[p] == '$') {\n        for (q = p; q < num; q++) {\n          if (b[q] == '?') {\n            b[q] = ' ';\n            b[p] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < num; j++) {\n\n      cout << a[j];\n    }\n    printf(\"\\n\");\n    for (j = 0; j < num; j++) {\n\n      cout << b[j];\n    }\n    printf(\"\\n\");\n    p = 0;\n    q = 0;\n  }\n}\n"}
{"label": "17", "index": "32256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0, right = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left <= right)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    if (left >= 1)\n      for (int i = 1; i <= left; i++)\n        label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    cout << label << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar x[110] = {'\\0'}, y[110] = {'\\0'};\nint i, j, k, l;\nint f() {\n  for (i = 0; i < l - 1; i++) {\n    for (j = 1; i + j < l; j++) {\n      if (x[i] == '(' && x[i + j] == ' ') {\n        continue;\n      }\n      if (x[i] == '(' && x[i + j] == '(') {\n        break;\n      }\n      if (x[i] == '(' && x[i + j] == ')') {\n        x[i] = ' ';\n        x[i + j] = ' ';\n      }\n    }\n  }\n  k++;\n  if (k == l) {\n    return 0;\n  }\n  if (k != l) {\n    f();\n  }\n}\nint main() {\n  while (cin.getline(x, 110, '\\n')) {\n    strcpy(y, x);\n    l = strlen(x);\n    for (i = 0; i < l; i++) {\n      if (x[i] != '(' && x[i] != ')') {\n        x[i] = ' ';\n      }\n    }\n    k = 0;\n    f();\n    cout << y << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == '(') {\n        cout << \"$\";\n      }\n      if (x[i] == ')') {\n        cout << \"?\";\n      }\n      if (x[i] == ' ') {\n        printf(\" \");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  while (!cin.eof()) {\n    char str[1000], ans[1000];\n    memset(str, 0, sizeof(str));\n    memset(ans, 0, sizeof(ans));\n    scanf(\"%s \", str);\n\n    for (int i = 0; i < strlen(str); i++)\n      ans[i] = ' ';\n\n    int sign = 0;\n    for (int i = 0; i < strlen(str); i++) {\n      if (str[i] == '(') {\n\n        sign++;\n        ans[i] = sign + '0';\n      } else if (str[i] == ')') {\n        if (sign > 0) {\n          ans[i] = sign + '0';\n          sign--;\n        } else\n          ans[i] = '?';\n      }\n    }\n    for (int i = 0; i < strlen(str); i++) {\n      if (ans[i] != ' ' && str[i] == '(') {\n        int ok = 0;\n        int j;\n        for (j = i + 1; j < strlen(str); j++) {\n          if (ans[j] == ans[i]) {\n            ok = 1;\n            break;\n          }\n        }\n        if (!ok)\n          ans[i] = '$';\n        else\n          ans[i] = ans[j] = ' ';\n      }\n    }\n    ans[strlen(str)] = '\u0000';\n    cout << str << endl;\n    cout << ans;\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i = 0, j = 0;\n\n  char s[101] = {0};\n  while (cin >> s) {\n    int a = 0, b = 0;\n    cout << s << endl;\n    int flag[101] = {0};\n    for (i = 0; i <= strlen(s) - 1; i++) {\n      if (s[i] == '(')\n        a++;\n      if (s[i] == ')') {\n        a--;\n        if (a < 0) {\n          a = 0;\n          flag[i] = -1;\n        }\n      }\n    }\n    for (i = strlen(s) - 1; i >= 0; i--) {\n      if (s[i] == ')')\n        b++;\n      if (s[i] == '(') {\n        b--;\n        if (b < 0) {\n          b = 0;\n          flag[i] = 1;\n        }\n      }\n    }\n    for (i = 0; i < strlen(s); i++) {\n      if (flag[i] != 0)\n        break;\n    }\n    for (j = strlen(s) - 1; j >= 0; j--) {\n      if (flag[j] != 0)\n        break;\n    }\n    for (i = i; i <= j; i++) {\n      if (flag[i] == 1)\n        cout << \"$\";\n      else if (flag[i] == 0)\n        cout << \" \";\n      else if (flag[i] == -1)\n        cout << \"?\";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  while (n > 0) {\n    char s[104], start = 0;\n    int len = 0;\n\n    scanf(\"%s \", s);\n    puts(s);\n    len = strlen(s);\n    int j;\n    for (i = len - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        for (j = i; j < len; j++) {\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (s[i] == '(')\n        printf(\"$\");\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n    n--;\n  }\n}\n"}
{"label": "17", "index": "32261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint len;\nchar str[101];\nvoid f(int p) {\n  int m = -1, n = -1;\n  for (int i = p; i >= 0; i--) {\n    if (*(str + i) == '(') {\n      m = i;\n      break;\n    }\n  }\n  for (int i = m + 1; i <= len - 1; i++) {\n    if (*(str + i) == ')') {\n      n = i;\n      break;\n    }\n  }\n  if (m >= 0 && n >= 0) {\n    str[m] = '#';\n    str[n] = '#';\n  }\n  if (m > 0)\n    f(m - 1);\n}\n\nint main() {\n  while (scanf(\"%s \", str)) {\n    len = strlen(str);\n    cout << str << endl;\n    f(len);\n    for (int j = 0; j <= len - 1; j++) {\n      if (str[j] == '(')\n        cout << \"$\";\n      else if (str[j] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32262", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100];\n  int i, k, s;\n  for (; scanf(\"%s\", a) != EOF;) {\n    s = 0;\n    s = strlen(a);\n    for (i = 0; i < s; i++)\n      cout << a[i]; \n    cout << endl;\n    for (i = 0; i < s; i++) {\n      if (a[i] == '(')\n        a[i] = '$'; \n      else if (a[i] == ')')\n        a[i] = '?'; \n      else\n        a[i] = ' '; \n    }\n    for (i = s - 1; i >= 0; i--) \n    {\n      if (a[i] == '$') {\n        for (k = i; k < s; k++) \n        {\n          if (a[k] == '?') {\n            a[i] = ' ';\n            a[k] = ' ';\n            break; \n          }\n        }\n      }\n    }\n    for (i = 0; i < s; i++)\n      cout << a[i]; \n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j;    \n  char A[200]; \n  while (cin.getline(A, 200, '\\n')) {\n    cout << A << endl;\n    for (i = 0; i < strlen(A); i++) \n    {\n      if (A[i] == '(')\n        A[i] = '$';\n      else {\n        if (A[i] == ')')\n          A[i] = '?';\n        else\n          A[i] = ' ';\n      }\n    }\n    for (i = 0; i < strlen(A); i++) \n    {\n      if (A[i] == '?') {\n        for (j = i; j >= 0; j--) {\n          if (A[j] == '$') {\n            A[i] = ' ';\n            A[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    cout << A << endl; \n    memset(A, '\\0', sizeof(A));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n\n    cin >> a;\n    t = strlen(a);\n    show(a, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar input[150], output[150];\nint main() {\n  int n, j;\n  scanf(\"%d\", &n);\n  for (j = 0; j < n; j++) {\n    scanf(\"%s\", input);\n    memset(output, 0, sizeof(output));\n    int count1 = 0, count2 = 0;\n    int i;\n    for (i = 0; i < strlen(input); ++i) {\n      output[i] = ' ';\n      if (input[i] == ')') {\n        if (count1 <= 0)\n          output[i] = '?';\n        else\n          count1--;\n      } else if (input[i] == '(')\n        count1++;\n    }\n    for (i = strlen(input); i >= 0; --i) {\n      if (input[i] == '(') {\n        if (count2 <= 0)\n          output[i] = '$';\n        else\n          count2--;\n      } else if (input[i] == ')')\n        count2++;\n    }\n    printf(\"%s\\n%s\\n\", input, output);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32266", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char word[105], sign[105];\n  int num = 0, i, len;\n  while (cin.getline(word, 105)) {\n    num = 0;\n    len = strlen(word);\n    for (i = 0; i < len; i++)\n      sign[i] = ' ';\n    for (i = 0; i < len; i++) {\n      if (word[i] == '(')\n        num++;\n      if (word[i] == ')') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '?';\n      }\n    }\n    num = 0;\n    for (i = len - 1; i >= 0; i--) {\n      if (word[i] == ')') {\n        num++;\n      }\n      if (word[i] == '(') {\n        if (num > 0)\n          num--;\n        else\n          sign[i] = '$';\n      }\n    }\n    sign[len] = '\\0';\n    cout << word << endl;\n    cout << sign << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint getlength(char *a) \n{\n  int i = 0;\n  while (a[i] != '\\0')\n    i++;\n  return i;\n}\nvoid chuli(char ch[], int a[], int n) \n{\n  for (int i = 0; i < n; i++) {\n    switch (ch[i]) {\n    case '(':\n      a[i] = 1;\n      break;\n    case ')':\n      a[i] = -1;\n      break;\n    default:\n      a[i] = 0;\n      break;\n    }\n  }\n}\nvoid pipei(int a[], int n) \n{\n  for (int k = 0; k < n; k++) {\n    if (a[k] == 1) {\n      int s = 0;\n      for (int i = 0; i < k; i++)\n        s += a[i];\n      for (int i = k; i < n; i++) {\n        if (a[i] == -1) {\n          int t = 0;\n          for (int j = 0; j < i; j++)\n            t += a[j];\n          if (s == t - 1) \n          {\n            a[k] = 0;\n            a[i] = 0;\n            break;\n          } \n        }\n      }\n    }\n  }\n}\nint main() {\n  while (cin.peek() != EOF) {\n    char ch[110];\n    cin.getline(ch, 110, '\\n');\n    int a[110];\n    int n = getlength(ch);\n    chuli(ch, a, n);\n    pipei(a, n);\n    cout << ch << endl;\n    for (int i = 0; i < n; i++) \n    {\n      switch (a[i]) {\n      case 1:\n        cout << '$';\n        break;\n      case -1:\n        cout << '?';\n        break;\n      case 0:\n        cout << ' ';\n        break;\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[101], b[101];\nint l, c[101];\nint main() {\n  int i, j;\n  while (cin.getline(a, 101)) {\n    j = 0;\n    memset(c, 0, sizeof(c));\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(') {\n        b[i] = '$';\n        c[j] = i;\n        j = j + 1;\n      } else {\n        if (a[i] == ')') {\n          if (j >= 1) {\n            b[c[j - 1]] = ' ';\n            b[i] = ' ';\n            j = j - 1;\n          } else {\n            b[i] = '?';\n          }\n        } else {\n          b[i] = ' ';\n        }\n      }\n    }\n    b[l] = '\\0';\n    cout << a << endl;\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110], b[110];\n  int len, mark, sign = 0, s = 0;\n  while (cin.getline(a, 110, '\\n')) {\n    len = strlen(a);\n    for (int i = 0; i <= len - 1; i++)\n      b[i] = a[i];\n    for (int j = 1; j <= len; j++) {\n      mark = 0;\n      sign = 0;\n      s = 0;\n      for (int i = 0; i < len; i++) {\n        if (a[i] == '(') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (mark == len - 1) {\n        a[mark] = '$';\n      }\n      if (s != 0) {\n        for (int i = mark + 1; i < len; i++) {\n          if (a[i] == ')') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '$';\n      }\n      sign = 0;\n      mark = 0;\n      s = 0;\n      for (int i = len - 1; i >= 0; i--) {\n        if (a[i] == ')') {\n          mark = i;\n          s = 1;\n        }\n      }\n      if (s != 0) {\n        if (mark == 0) {\n          a[mark] = '?';\n        }\n      }\n      if (s != 0) {\n        for (int i = mark - 1; i >= 0; i--) {\n          if (a[i] == '(') {\n            a[mark] = 'a';\n            a[i] = 'a';\n            sign = 1;\n            break;\n          }\n        }\n      }\n      if (s != 0) {\n        if (sign == 0)\n          a[mark] = '?';\n      }\n    }\n    for (int i = 0; i < len - 1; i++)\n      cout << b[i];\n    cout << b[len - 1] << endl;\n    for (int i = 0; i < len - 1; i++) {\n      if (a[i] != '?' && a[i] != '$')\n        cout << ' ';\n      else\n        cout << a[i];\n    }\n    if (a[len - 1] != '?' && a[len - 1] != '$')\n      cout << ' ' << endl;\n    else\n      cout << a[len - 1] << endl;\n    memset(a, '\\0', sizeof(a));\n    memset(b, '\\0', sizeof(b));\n    mark = 0;\n    sign = 0;\n    len = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], flag[101];\n  while (cin.getline(str, 101)) {\n    printf(\"%s\\n\", str);\n    int len, num = 0;\n    len = strlen(str);\n    int i, j;\n    for (i = 0; i < len; i++)\n      flag[i] = ' ';\n    flag[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(') {\n        num++;\n        flag[i] = '$';\n      }\n      if (str[i] == ')') {\n        num--;\n        if (num >= 0) {\n          for (j = i - 1; j >= 0; j--)\n            if (str[j] == '(') {\n              flag[j] = ' ';\n              str[j] = ' ';\n              break;\n            }\n        } else {\n          flag[i] = '?';\n          num++;\n        }\n      }\n    }\n    cout << flag << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint k, m = 0;\nchar a[100] = {'\\0'};\nvoid pipei(int m, char a[]) {\n  int i, j;\n  for (i = m; i <= k - 1; i++) {\n    if (a[i] == ')') {\n      break;\n    }\n    if (a[i] != '(' && a[i] != ')') {\n      a[i] = ' ';\n    }\n  }\n  m = i + 1;\n  for (j = i; j >= 0; j--) {\n    if (i == k && a[k - 1] != ')')\n      break;\n    if (a[j] == '(') {\n      a[j] = ' ';\n      a[i] = ' ';\n      break;\n    }\n  }\n  if (m <= k - 1)\n    pipei(m, a);\n}\nint main() {\n  char w;\n  while (cin >> a) {\n    k = strlen(a);\n    int i, j;\n    printf(\"%s\\n\", a);\n    pipei(0, a);\n    for (i = 0; i <= k - 1; i++) {\n      if (a[i] == '(')\n        a[i] = '$';\n      if (a[i] == ')')\n        a[i] = '?';\n    }\n    for (i = 0; i <= k - 1; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < 100; i++) {\n      a[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32272", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint function_1(char *out, int t) {\n  int i = t;\n  if (out[i] == '(') {\n    out[i] = '$';\n    i++;\n    while (out[i] != ')' && out[i]) {\n      if (out[i] == '(') {\n        i = function_1(out, i) + 1;\n        if (i == -1)\n          return -2;\n      } else {\n        out[i] = ' ';\n        i++;\n      }\n    }\n    if (out[i] == ')') {\n      out[t] = out[i] = ' ';\n      return i;\n    } else\n      return -2;\n  } else {\n    while (out[i] != '(' && out[i]) {\n      if (out[i] == ')')\n        out[i] = '?';\n      else\n        out[i] = ' ';\n      i++;\n    }\n    if (out[i] == '(')\n      return function_1(out, i);\n    else\n      return -2;\n  }\n}\n\nint main() {\n  char out[101];\n  int n = -1;\n  cin.getline(out, 101);\n  while (out[0]) {\n    n = -1;\n    cout << out << endl;\n    while (n != -2) {\n      n = function_1(out, n + 1);\n    }\n    cout << out << endl;\n    cin.getline(out, 101);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, k;\n  char a[101];\n  int i, j, flag;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    scanf(\"%s\", a);\n    cout << a << \"\\n\";\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == 40) {\n        if (i == strlen(a) - 1)\n          printf(\"$\");\n        else {\n          flag = 1;\n          for (j = i + 1; j < strlen(a); j++) {\n            if (a[j] == 41 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 41 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 40) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            printf(\"$\");\n        }\n      }\n\n      else if (a[i] == 41) {\n        if (i == 0)\n          printf(\"?\");\n        else {\n          flag = 1;\n          for (j = i - 1; j >= 0; j--) {\n            if (a[j] == 40 && flag == 1) {\n              flag--;\n              break;\n            } else if (a[j] == 40 && flag != 1) {\n              flag = flag - 1;\n            } else if (a[j] == 41) {\n              flag = flag + 1;\n            }\n          }\n          if (flag == 0)\n            printf(\" \");\n          else\n            cout << \"?\";\n        }\n      }\n\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "17", "index": "32274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  int a[200];\n  int n, l, i, j, m;\n  while (cin.getline(ch, 150)) {\n    l = strlen(ch);\n    for (i = 0; i < l; i++)\n      if (ch[i] == '(')\n        a[i] = -1;\n      else if (ch[i] == ')') {\n        for (j = i - 1; j >= 0; j--)\n          if (a[j] == -1)\n            break;\n        if (j != -1) {\n          a[i] = 0;\n          a[j] = 0;\n        } else\n          a[i] = 1;\n      } else\n        a[i] = 0;\n    n = 0;\n    for (i = 0; i < l; i++)\n      if (a[i] != 0)\n        n++;\n    m = n;\n    i = 0;\n    printf(\"%s\\n\", ch);\n    while (n > 0) {\n      if (a[i] == -1)\n        cout << \"$\";\n      else if (a[i] == 1)\n        cout << \"?\";\n      else if (m != n)\n        cout << \" \";\n      if (a[i] != 0)\n        n--;\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[101] = {0};\n  while (scanf(\"%s \", words)) {\n    cout << words << endl;\n    int i = 0, j = 0;\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] != '(' && words[i] != ')')\n        words[i] = ' ';\n      if (words[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (words[j] == '(') {\n            words[j] = ' ';\n            words[i] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; words[i] != 0; i++) {\n      if (words[i] == '(')\n        words[i] = '$';\n      if (words[i] == ')')\n        words[i] = '?';\n    }\n    printf(\"%s\\n\", words);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32276", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k;\n  char s[1000];\n  while (cin >> s) {\n    cout << s << endl;\n    k = strlen(s);\n    for (i = 0; i < k; ++i) {\n      if (s[i] == ')') {\n        for (j = i - 1; j >= 0; --j) {\n          if (s[j] == '(') {\n            s[i] = s[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < k; ++i) {\n      if (s[i] == '(')\n        cout << \"$\";\n      else if (s[i] == ')')\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32277", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110];\n  int i, j, l;\n  while (scanf(\"%s\", a) == 1) {\n    printf(\"%s\\n\", a);\n    l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] != '(' && a[i] != ')')\n        a[i] = ' ';\n    }\n    for (i = 1; i < l; i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = ' ';\n            a[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        printf(\"$\");\n      if (a[i] == ')')\n        printf(\"?\");\n      if (a[i] == ' ')\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32278", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[200];\nint x = 0, y = 0;\nvoid find(int min) {\n  if (min > 0) {\n    int p = -1;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == ')' && p >= 0) {\n        a[p] = 'a';\n        a[i] = 'b';\n        break;\n      } else if (a[i] == '(') {\n        p = i;\n      }\n    }\n    find(min - 1);\n  }\n}\nvoid change() {\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      a[i] = '$';\n    else if (a[i] == ')') {\n      a[i] = '?';\n    } else {\n      a[i] = ' ';\n    }\n  }\n}\nvoid qingling() {\n  for (int i = 0; i < strlen(a); i++) {\n    a[i] = '\\0';\n  }\n}\nint main() {\n  while (cin.getline(a, 101)) {\n    cout << a << endl;\n    for (int i = 0; i < strlen(a); i++) {\n      if (a[i] == '(') {\n        x++;\n      }\n      if (a[i] == ')')\n        y++;\n    }\n    int min = 0;\n    if (x < y)\n      min = x;\n    else\n      min = y;\n    find(min);\n    change();\n    cout << a << endl;\n    qingling();\n    x = 0;\n    y = 0;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, flag = 0;\n  char s[1000] = {\"\"};\n  scanf(\"%s\", s);\n  while ((s[0] >= 'a' && s[0] <= 'z') || (s[0] >= 'A' && s[0] <= 'Z') ||\n         s[0] == '(' || s[0] == ')') {\n\n    printf(\"%s \", s);\n    n = strlen(s);\n    for (i = n - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n        for (j = i + 1; j < n; j++) {\n          if (s[j] == ')') {\n            s[i] = 'a';\n            s[j] = 'a';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      if (s[i] == '(' || s[i] == ')') {\n        flag = 1;\n        break;\n      }\n    }\n    if (flag == 0) {\n      for (i = 0; i < n; i++)\n        printf(\"%c\", ' ');\n      printf(\" \");\n    } else {\n      for (i = 0; i < n; i++) {\n        if (s[i] == '(')\n          printf(\"%c\", '$');\n        else if (s[i] == ')')\n          cout << '?';\n        else\n          cout << ' ';\n      }\n      printf(\" \");\n    }\n    s[0] = '\u0000';\n    scanf(\"%s\", s);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32280", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, j, k;\n  char c[101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    getchar();\n    cin >> c;\n    s = strlen(c);\n    printf(\"%s\\n\", c);\n    for (j = 0; j < s; j++) {\n      if (c[j] != '(' && c[j] != ')')\n        c[j] = ' ';\n      if (c[j] == ')') {\n        for (k = j; k >= 0; k--) {\n          if (c[k] == '(') {\n            c[j] = ' ';\n            c[k] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (j = 0; j < s; j++) {\n      if (c[j] == '(')\n        c[j] = '$';\n      if (c[j] == ')')\n        c[j] = '?';\n    }\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32281", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500], b[500] = {0};\n  int n, i, k, j, jud[500] = {0}, max = 0;\n  for (i = 0; i < 500; i++) {\n    a[i] = 0;\n    jud[i] = 0;\n  }\n  while (scanf(\"%s\", a) != EOF) {\n    for (i = 0; i < 500; i++) {\n      b[i] = 0;\n    }\n    for (i = 0; i < strlen(a); i++) {\n      b[i] = ' ';\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(' && jud[j] == 0) {\n            jud[j] = 1;\n            jud[i] = 1;\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == '(' && jud[i] == 0) {\n        b[i] = '$';\n      }\n      if (a[i] == ')' && jud[i] == 0) {\n        b[i] = '?';\n      }\n    }\n    cout << a << \"\\n\" << b << \"\\n\";\n    for (i = 0; i < 500; i++) {\n      a[i] = 0;\n      jud[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32282", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string1[101];\n  while (cin.getline(string1, 101)) {\n\n    printf(\"%s\\n\", string1);\n\n    for (int i = 1; i < strlen(string1); i++) {\n      if (string1[i] == ')') {\n\n        for (int j = i - 1; j >= 0; j--) {\n          if (string1[j] == '(') {\n            string1[i] = ' ';\n            string1[j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int k = 0; k < strlen(string1); k++) {\n      if (string1[k] == '(')\n        cout << \"$\";\n      else if (string1[k] == ')')\n        cout << \"?\";\n      else\n        printf(\" \");\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32283", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  cin >> n;\n\n  int i = 0;\n  char string[101];\n  char string_copy[101];\n  char string_check[101];\n  int len = 0;\n  int index = 0;\n  int start = 0;\n  int turn = 0;\n  char y = 'n';\n\n  for (i = 0; i <= n; i++) {\n    len = 0;\n\n    cin >> string;\n    while (string[len])\n      len++;\n\n    strcpy(string_copy, string);\n\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] != '(' && string_copy[index] != ')')\n        string_copy[index] = ' ';\n      if (string[index] == '(' || string[index] == ')')\n        y = 'y';\n    }\n    if (y == 'n')\n      continue;\n\n    for (turn = 0; turn <= len / 2; turn++) {\n      y = 'n';\n      start = 0;\n      for (index = 0; index < len; index++) {\n        if (string_copy[index] == '(')\n          start = index;\n        if (string_copy[index] == ')' && string_copy[start] == '(') {\n          string_copy[index] = ' ';\n          string_copy[start] = ' ';\n        }\n      }\n    }\n\n    strcpy(string_check, string_copy);\n    for (index = 0; index < len; index++) {\n      if (string_copy[index] == '(') {\n        string_copy[index] = '$';\n      }\n      if (string_copy[index] == ')')\n        string_copy[index] = '?';\n    }\n    if (strcmp(string_copy, string_check) != 0) {\n      printf(\"%s %s \", string, string_copy);\n    } else {\n      printf(\"%s \", string);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char line[101], label[101];\n  int pos[101];\n\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    int len = strlen(line);\n    for (int i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (int i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n\n    for (int i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    printf(\"%s\\n\", label);\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32285", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[101];   \nint l;         \nint f(int k) { \n  int i, j;\n  for (i = k; i >= 0; i--) \n    if (s[i] == '(') {\n      for (j = i + 1; j < l; j++)\n        if (s[j] == ')') \n        {\n          s[i] = 'a'; \n          s[j] = 'a';\n          k = i;\n          return f(k); \n        }\n    }\n  for (i = 0; i < l; i++) \n  {\n    if (s[i] == '(')\n      cout << '$';\n    else if (s[i] == ')')\n      cout << '?';\n    else\n      cout << ' ';\n  }\n  cout << endl;\n  return 0;\n}\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    l = strlen(s);\n    cout << s << endl;\n    f(l - 1); \n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint match(int);\nint count(int);\nint match(int, int, int, int);\nchar a[50][105], b[50][105] = {0};\nint num[50] = {0};\nint main() {\n  for (int i = 0;; i++) {\n    cin.getline(a[i], 101);\n    count(i);\n    match(i);\n    cout << a[i] << \"\\n\";\n    cout << b[i] << endl;\n  }\n  return 0;\n}\nint count(int m) {\n  for (int i = 0; a[m][i] != 0; i++)\n    num[m]++;\n  return 0;\n}\n\nint match(int k) {\n  for (int i = 0; i < num[k]; i++) {\n    if (a[k][i] == '(')\n      b[k][i] = '$';\n    else if (a[k][i] == ')')\n      b[k][i] = '?';\n    else\n      b[k][i] = ' ';\n  }\n  while (1) {\n    int flag = -1, judge = 0;\n    for (int i = 0; i < num[k]; i++) {\n      if (b[k][i] == '$' && b[k][i + 1] == '?') {\n        b[k][i] = ' ';\n        b[k][i + 1] = ' ';\n        judge = 1;\n        break;\n      } else if (b[k][i] == '$' && b[k][i + 1] == ' ')\n        flag = i;\n      else if (b[k][i] == '?' && flag >= 0) {\n        b[k][i] = ' ';\n        b[k][flag] = ' ';\n        flag = -1;\n        judge = 1;\n        break;\n      }\n    }\n    if (judge == 0)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32287", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int N;\n  cin >> N;\n  for (int I = 0; I < N; I++) {\n    int i;\n    char in[110];\n    cin >> in;\n\n    cout << in << endl;\n    int n = strlen(in);\n\n    char mark[110];\n    for (i = 0; i < n; i++)\n      mark[i] = ' ';\n\n    int left = 0;\n\n    for (i = 0; i < n; i++) {\n      if (in[i] == '(')\n        left++;\n\n      else if (in[i] == ')') {\n        if (left) {\n          left--;\n        } else {\n          mark[i] = '?';\n        }\n      }\n    }\n\n    int right = 0;\n    for (i = n - 1; i >= 0; i--) {\n      if (in[i] == ')')\n        right++;\n\n      else if (in[i] == '(') {\n        if (right) {\n          right--;\n        } else {\n          mark[i] = '$';\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      cout << mark[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32288", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101];\n  int i, j, len;\n  while (cin >> a) {\n    cout << a << endl;\n    len = strlen(a);\n    for (i = 1; i < len; i++) {\n      for (j = 0; j < len - i; j++) {\n        if (a[j] == '(' && a[j + i] == ')') {\n          a[j] = ' ';\n          a[j + i] = ' ';\n        }\n        if (a[j] != '(' && a[j] != ')') {\n          a[j] = ' ';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      }\n      if (a[i] == ')') {\n        a[i] = '?';\n      }\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32289", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid match(char a[102]) {\n  char b[102] = {0};\n  long l = strlen(a);\n  int i, left[102] = {0}, cnt_left = 0;\n  for (i = 0; i < l; i++) {\n    if (a[i] == '(') {\n      cnt_left++;\n      left[cnt_left] = i;\n      b[i] = '$';\n    } else {\n      if (a[i] == ')') {\n        if (cnt_left == 0)\n          b[i] = '?';\n        else {\n          b[i] = ' ';\n          b[left[cnt_left]] = ' ';\n          cnt_left--;\n        }\n      } else\n        b[i] = ' ';\n    }\n  }\n  b[l] = '\\0';\n  puts(a);\n  puts(b);\n}\n\nint main() {\n  char a[102] = {0}, c;\n  int i = -1;\n  while ((c = getchar()) != EOF) {\n    if (c != '\\n') {\n      i++;\n      a[i] = c;\n    } else {\n      i++;\n      a[i] = '\\0';\n      match(a);\n      i = -1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32290", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint show(char a[], int t) {\n  int i, k, l, j = 1;\n  static int b[101];\n  puts(a);\n  for (i = 0; i <= t - 1; i++)\n    switch (a[i]) {\n    case '(':\n      a[i] = ' ';\n      b[j] = i + 1;\n      j++;\n      break;\n    case ')':\n      a[i] = ' ';\n      b[j] = -(i + 1);\n      j++;\n      break;\n    default:\n      a[i] = ' ';\n    }\n  j--;\n  do {\n    l = 0;\n    for (k = 1; k <= j - 1; k++)\n      if (b[k] > 0) {\n        for (i = k + 1; i <= j; i++)\n          if (b[i] != 0)\n            break;\n        if (b[k] * b[i] < 0) {\n          b[k] = 0;\n          b[i] = 0;\n          l++;\n        }\n      }\n  } while (l > 0);\n  for (i = 1; i <= j; i++) {\n    if (b[i] < 0)\n      a[-b[i] - 1] = '?';\n    else if (b[i] > 0)\n      a[b[i] - 1] = '$';\n  }\n  puts(a);\n  return 0;\n}\nint main() {\n  int i, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    char a[101];\n    int t;\n\n    cin >> a;\n    t = strlen(a);\n    show(a, t);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[101];\n  int i, len;\n  while (cin.getline(line, 101)) {\n    int left = 0;\n    len = strlen(line);\n    for (i = 0; i < 100; i++)\n      label[i] = ' ';\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        left++;\n        pos[left] = i;\n      }\n      if (line[i] == ')')\n        if (left == 0)\n          label[i] = '?';\n        else\n          left--;\n    }\n    for (i = 1; i <= left; i++)\n      label[pos[i]] = '$';\n    label[len] = '\\0';\n    printf(\"%s\\n\", line);\n    cout << label << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32292", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int i, j;\n  while (cin.getline(str, 101)) {\n    int length = strlen(str), count1[1000] = {0}, count2[1000] = {0};\n    for (i = length; i >= 0; i--) {\n      if (str[i] == '(') {\n        for (j = i; str[j] != '\\0'; j++) {\n          if (str[j] == ')' && count2[j] == 0) {\n            count2[j]--;\n            break;\n          } else {\n            if (str[j + 1] == '\\0') {\n              count1[i]++;\n            }\n          }\n        }\n      }\n    }\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] == ')') {\n        count2[i]++;\n      }\n      cout << str[i];\n    }\n    cout << endl;\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (count1[i] == 1) {\n        cout << \"$\";\n      }\n      if (count2[i] == 1) {\n        cout << \"?\";\n      }\n      if (count1[i] != 1 && count2[i] != 1) {\n        printf(\" \");\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, m, p, l;\n  char s[100][100];\n  int a[100] = {0};\n  scanf(\"%d\", &n);\n  getchar();\n  for (i = 1; i <= n; i++) {\n\n    cin >> s[i];\n    l = strlen(s[i]);\n    for (j = 0; j < l; j++) {\n      a[j] = 0;\n    }\n    for (j = 0; j < l; j++) {\n      if (s[i][j] == '(')\n        a[j] = 1;\n      if (s[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 2) {\n        for (m = j; m >= 0; m--) {\n          if (a[m] == 1) {\n            a[m] = 0;\n            a[j] = 0;\n            break;\n          }\n        }\n      }\n    }\n    puts(s[i]);\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1) {\n        printf(\"$\");\n      }\n      if (a[j] == 2) {\n        printf(\"?\");\n      }\n      if (a[j] == 0) {\n        printf(\" \");\n      }\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32294", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, f1 = 0, f2 = 0;\n  char line[101], copy[101];\n  while (cin >> line) {\n    strcpy(copy, line);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == ')')\n        line[i] = '?';\n      if (line[i] == '(') {\n        f1 = 1;\n        for (j = i + 1; j < strlen(line); j++) {\n          if (line[j] == '(')\n            f1++;\n          if (line[j] == ')') {\n            f1--;\n            if (f1 == 0) {\n              line[i] = ' ';\n              line[j] = ' ';\n              break;\n            }\n          }\n        }\n        if (f1 != 0)\n          line[i] = '$';\n      }\n    }\n    printf(\"%s\\n\", copy);\n    for (i = 0; i < strlen(line); i++) {\n      if (line[i] == '$' || line[i] == '?')\n        cout << line[i];\n      else\n        cout << \" \";\n    }\n    printf(\"\\n\");\n    memset(line, 0, sizeof(line));\n    memset(copy, 0, sizeof(copy));\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x[1000];\n  char a[1000];\n  int i, j;\n  while (cin.getline(a, 1000)) {\n    int l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        x[i] = 1;\n      else if (a[i] == ')')\n        x[i] = -1;\n      else\n        x[i] = 0;\n    }\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l - i; j++)\n        if (x[j] == 1 && x[i + j] == -1)\n          x[j] = x[i + j] = 0;\n    cout << a << endl;\n    for (i = 0; i < l; i++) {\n      if (x[i] == 1)\n        cout << \"$\";\n      else if (x[i] == -1)\n        cout << \"?\";\n      else\n        cout << \" \";\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[100][100];\nint main() {\n  int k = 1;\n  while (1) {\n    cin >> a[k];\n    cout << a[k];\n    cout << endl;\n    for (int i = 0; i < strlen(a[k]); i++)\n      if (a[k][i] != '(' && a[k][i] != ')')\n        a[k][i] = ' ';\n    for (int i = 0; i < strlen(a[k]) - 1; i++) {\n      int sum = 1;\n      if (a[k][i] == '(') {\n        for (int j = i + 1; j < strlen(a[k]); j++) {\n          if (a[k][j] == '(')\n            sum++;\n          if (a[k][j] == ')')\n            sum--;\n          if (sum == 0) {\n            a[k][i] = ' ';\n            a[k][j] = ' ';\n            break;\n          }\n        }\n      }\n    }\n    for (int i = 0; i < strlen(a[k]); i++) {\n      if (a[k][i] == '(')\n        a[k][i] = '$';\n      if (a[k][i] == ')')\n        a[k][i] = '?';\n      cout << a[k][i];\n    }\n    cout << endl;\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32297", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint match(int i, int n, char str[]); \nint main()                           \n{\n  char str[101];\n  int n;\n  while (cin >> str) \n  {\n    cout << str << endl;\n    n = strlen(str);\n    match(0, n, str);\n    cout << str << endl;\n  }\n  return 0;\n}\nint match(int i, int n, char str[]) \n{\n  if (i == n) \n    return 0;\n  else if (str[i] == ')') \n  {\n    str[i] = '?';\n    for (int j = i - 1; j >= 0; j--)\n      if (str[j] == '$') {\n        str[j] = ' ';\n        str[i] = ' ';\n        break;\n      }\n  } else if (str[i] == '(') \n    str[i] = '$';\n  else {\n    str[i] = ' ';\n  }\n  match(i + 1, n, str);\n  return 0;\n}\n"}
{"label": "17", "index": "32298", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], b[101];\n  while (true) {\n    cin.getline(a, 101);\n    if (a[0] == 0)\n      break;\n    cout << a << endl;\n    int i, j = 0, k, l, d;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = ' ';\n    b[i] = 0;\n    for (i = 0; i < strlen(a); i++) {\n      if (j == 0 && a[i] == ')')\n        b[i] = '?';\n      else if (a[i] == ')') {\n        j--;\n        for (k = i; k >= 0; k--) {\n          if (b[k] == '$') {\n            b[k] = ' ';\n            break;\n          }\n        }\n      } else if (a[i] == '(') {\n        j++;\n        b[i] = '$';\n      }\n    }\n    for (d = 0; d < strlen(a); d++)\n      if (b[d] != ' ')\n        break;\n    for (i = 0; i < strlen(a); i++)\n      b[i] = b[i + d];\n    for (l = (strlen(a) - 1 - d); l >= 0; l--)\n      if (b[l] != ' ')\n        break;\n    b[l + 1] = 0;\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[1000];\nint judge(int, int);\nint main() {\n  for (; scanf(\"%s \", a);) {\n    printf(\"%s\\n\", a);\n    judge(0, 0);\n    cout << a << endl;\n  }\n  return 0;\n}\nint judge(int i, int l) {\n  int t;\n  if (a[i] == '\\0')\n    return -1;\n  if (a[i] == '(') {\n    t = judge(i + 1, l + 1);\n    a[i] = (t == -1) ? '$' : ' ';\n    return (t == -1) ? -1 : judge(i + 1, l);\n  }\n\n  else if (a[i] == ')') {\n    a[i] = l == 0 ? '?' : ' ';\n    return (l == 0) ? judge(i + 1, l) : i;\n  } else {\n    a[i] = ' ';\n    return judge(i + 1, l);\n  }\n}\n"}
{"label": "17", "index": "32300", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f1(char zichuan[], int changdu) {\n  int i, n;\n  for (i = changdu - 1; i >= 0; i--) {\n    if (zichuan[i] == '(') {\n      n = i + 1;\n      while (zichuan[n] != ')') {\n        n = n + 1;\n      }\n      if (n < changdu) {\n        zichuan[i] = ' ';\n        zichuan[n] = ' ';\n      }\n    }\n  }\n  return 0;\n}\n\nint main() {\n  int i = 0, changdu;\n  char s[100];\n  while (cin >> s) {\n    changdu = strlen(s);\n    printf(\"%s \", s);\n    f1(s, changdu);\n    for (i = 0; i < changdu; i++) {\n      switch (s[i]) {\n      case '(':\n        s[i] = '$';\n        break;\n      case ')':\n        s[i] = '?';\n        break;\n      default:\n        s[i] = ' ';\n        break;\n      }\n    }\n    for (i = 0; i < changdu; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32301", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120];\n  while (cin >> s) {\n    char res[120];\n    int lens;\n    int leftnum = 0;\n    int left[120];\n    lens = strlen(s);\n    for (int i = 0; i < lens; i++)\n      res[i] = ' ';\n    for (int i = 1; i < 120; i++)\n      left[i] = -1;\n    for (int i = 0; i < lens; i++) {\n      if (s[i] == '(')\n        left[++leftnum] = i;\n      if (s[i] == ')') {\n        if (leftnum == 0)\n          res[i] = '?';\n        else {\n          left[leftnum] = -1;\n          leftnum--;\n        }\n      }\n    }\n    for (int i = 1; i <= leftnum; i++)\n      res[left[i]] = '$';\n    for (int i = 0; i < lens; i++)\n      cout << s[i];\n    printf(\"\\n\");\n    for (int i = 0; i < lens; i++)\n      printf(\"%c\", res[i]);\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char line[101], label[101];\n  int pos[100];\n  int left = 0, right = 0;\n  int pos_i, length;\n  int i;\n  while (cin.getline(line, sizeof(line))) {\n    for (i = 0; i < 101; i++)\n      label[i] = ' ';\n    pos_i = -1, left = 0, right = 0;\n    length = strlen(line);\n    for (i = 0; line[i] != '\\0'; i++) {\n      if (line[i] == '(') {\n        pos_i++;\n        pos[pos_i] = i;\n        left++;\n      }\n      if (line[i] == ')') {\n        if (right >= left)\n          label[i] = '?';\n        else {\n          right++;\n          pos_i--;\n        }\n      }\n    }\n    if (pos_i >= 0) {\n      for (i = 0; i <= pos_i; i++)\n        label[pos[i]] = '$';\n    }\n    label[length] = '\\0';\n    printf(\"%s\\n\", line);\n    cout << label << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32303", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid course(char a[], int n) {\n  int i, j, k;\n  for (k = 0; k < n; k++) {\n    if (a[k] == ')')\n      a[k] = '?';\n    else if (a[k] == '(')\n      a[k] = '$';\n    else\n      a[k] = 32;\n  }\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n - 1; i++) {\n      if (a[i] == '$') {\n        for (j = i + 1; j < n; j++) {\n          if (a[j] == '$')\n            break;\n          else if (a[j] == '?') {\n            a[i] = 32;\n            a[j] = 32;\n            break;\n          } else\n            continue;\n        }\n      }\n    }\n  }\n}\nint main() {\n  char a[10000];\n  int n, m, j;\n  scanf(\"%d \", &m);\n  for (j = 0; j < m; j++) {\n    cin >> a;\n    puts(a);\n    n = strlen(a);\n    course(a, n);\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32304", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101] = {0};\n  while ((scanf(\"%s\", s) != EOF)) {\n    int i, j;\n    int you = 0;\n    int l1 = strlen(s);\n    char a[101];\n    strcpy(a, s);\n    for (i = l1 - 1; i >= 0; i--) {\n      if (s[i] == '(') {\n\n        you = 0;\n        for (j = i + 1; j < l1; j++) {\n\n          if (s[j] == ')') {\n            s[i] = ' ';\n            s[j] = ' ';\n            you = you + 1;\n            break;\n          }\n        }\n        if (you == 0)\n          s[i] = '$';\n      }\n    }\n    puts(a);\n\n    for (i = 0; i < l1; i++) {\n      if (s[i] == '?' || s[i] == '$')\n        printf(\"%c\", s[i]);\n      else if (s[i] == ')')\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32305", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101];\n  int g[100] = {0}, left[100] = {0};\n  int m, n, i, k, sum;\n  while (cin.getline(sen, 101)) {\n    n = strlen(sen);\n    k = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      if (sen[i] == '(') {\n        g[i] = 1;\n        sum++;\n        left[k] = i;\n        k++;\n      } else {\n        if (sen[i] == ')') {\n          if (sum > 0) {\n            sum--;\n            k--;\n            g[left[k]] = 0;\n            g[i] = 0;\n          } else {\n            g[i] = -1;\n          }\n        } else\n          g[i] = 0;\n      }\n    }\n    for (i = n - 1; g[i] == 0; i--) {\n    }\n    n = i;\n    for (i = 0; g[i] == 0; i++) {\n    }\n    m = i;\n    cout << sen << endl;\n    for (i = m; i <= n; i++) {\n      if (g[i] == 1)\n        printf(\"$\");\n      else {\n        if (g[i] == -1)\n          cout << '?';\n        else\n          cout << ' ';\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0};\n  int lef[101], r[101], i = 0, j = 0;\n  do {\n    cin.get(a, 101);\n    cin.get();\n    if (a[0] == '\\0')\n      break;\n    int len = strlen(a);\n    for (i = 0; i < len; i++) {\n      if (a[i] == '(')\n        b[i] = '$';\n      else if (a[i] == ')')\n        b[i] = '?';\n      else\n        b[i] = ' ';\n    }\n    for (i = 0; i < len; i++)\n      if (b[i] == '?')\n        for (j = i; j >= 0; j--)\n          if (b[j] == '$') {\n            b[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << endl;\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << endl;\n  } while (1);\n  return 0;\n}\n"}
{"label": "17", "index": "32307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b[200], i, j;\n  char a[200];\n  while (cin >> a) {\n    memset(b, 0, sizeof(b));\n    \n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(')\n        b[i] = 1;\n      if (a[i] == ')') {\n        b[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n      }\n    }\n    printf(\"%s \", a);\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(' && b[i] == 1)\n        printf(\"$\");\n      else if (a[i] == ')' && b[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n    \n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ghus(char a[]);\n  void noghus(char a[]);\n  int n, i, t, j;\n  char b[500];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", b);\n    t = ghus(b);\n    printf(\"%s\\n\", b);\n    for (j = 1; j <= t; j++) {\n      noghus(b);\n    }\n    for (j = 0; j < strlen(b); j++) {\n      if (b[j] == '(')\n        printf(\"$\");\n      else if (b[j] == ')')\n        printf(\"?\");\n      else {\n        printf(\" \");\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n\nint min(int a, int b) {\n  if (a < b) {\n    return a;\n  } else\n    return b;\n}\n\nint ghus(char a[]) {\n  int min(int a, int b);\n  int m = 0, n = 0, i;\n  for (i = 0; i < strlen(a); i++) {\n    if (a[i] == '(')\n      m++;\n    if (a[i] == ')')\n      n++;\n  }\n  return min(m, n);\n}\n\nvoid noghus(char a[]) {\n  int i, j;\n  for (i = 0; i < strlen(a) - 1; i++) {\n    if (a[i] == '(') {\n      for (j = i + 1; j < strlen(a); j++) {\n        if (a[j] == ')' || a[j] == '(')\n          break;\n      }\n      if (a[j] == ')') {\n        a[i] = 'o';\n        a[j] = 'o';\n      }\n    }\n  }\n}\n"}
{"label": "17", "index": "32309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid print(int n1, int z[500], char s[500]);\nvoid search(int a[500], int h);\nchar s[500];\nint z[500];\nint main() {\n  while (scanf(\"%s\", s) != EOF) {\n    int h, a, l1 = 0, l2 = 0;\n    h = strlen(s);\n    for (a = 0; a <= h - 1; a++) {\n      if (s[a] == '(') {\n        z[a] = 1;\n      } else {\n        if (s[a] == ')') {\n          z[a] = 2;\n        } else\n\n        {\n          z[a] = 0;\n        }\n      }\n    }\n    search(z, h);\n    print(h, z, s);\n  }\n  return 0;\n}\nvoid search(int z[500], int h) {\n  int k, m, n;\n  for (m = 1; m <= h - 1; m++)\n    for (k = 0; (k + m) <= (h - 1); k++)\n      if ((z[k] == 1) && (z[k + m] == 2)) {\n        z[k] = 0;\n        z[k + m] = 0;\n      }\n}\nvoid print(int n1, int z[500], char s[500]) {\n  int a;\n  for (a = 0; a < n1; a++)\n    printf(\"%c\", s[a]);\n\n  printf(\"\\n\");\n  for (a = 0; a < n1; a++) {\n    if (z[a] == 0)\n      printf(\" \");\n    if (z[a] == 1) {\n      printf(\"$\");\n    }\n    if (z[a] == 2)\n      printf(\"?\");\n  }\n  printf(\"\\n\");\n}\n"}
{"label": "17", "index": "32310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a, t = 0;\nchar A[110] = {'\\0'};\nvoid cal(int m) {\n  while (t <= a) {\n    if (A[t] == '(') {\n      cal(t++);\n    } else if (A[t] == ')') {\n      A[m] = 'a';\n      A[t++] = 'a';\n      break;\n    } else\n      t++;\n  }\n}\nint main() {\n  while (scanf(\"%s \", A)) {\n    char B[110];\n    a = strlen(A) - 1;\n    for (int i = 0; i <= a; i++)\n      B[i] = A[i];\n    t = 0;\n    while (t <= a)\n      if (A[t++] == '(')\n        cal(t - 1);\n\n    for (int i = 0; i <= a; i++)\n      cout << B[i];\n    cout << '\\n';\n    for (int i = 0; i <= a - 1; i++) {\n      if (A[i] == '(')\n        printf(\"$\");\n      if (A[i] == ')')\n        cout << '?';\n      if (A[i] != '(' && A[i] != ')')\n        cout << \" \";\n    }\n    if (A[a] == '(')\n      cout << '$' << endl;\n    if (A[a] == ')')\n      cout << '?' << endl;\n    if (A[a] != '(' && A[a] != ')')\n      cout << \" \" << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32311", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][101], b[100][101], c = '(', d = ')';\n  int i, j, k;\n  for (k = 0; k <= 20; k++) {\n    for (i = 0; i < 101; i++)\n      a[k][i] = 0;\n\n    cin >> a[k];\n    strcpy(b[k], a[k]);\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == d)\n        for (j = i - 1; j >= 0; j--)\n          if (a[k][j] == c) {\n            a[k][i] = a[k][j] = 1;\n            break;\n          }\n    for (i = 0; i < 101 && b[k][i] != 0; i++)\n      printf(\"%c\", b[k][i]);\n    printf(\" \");\n    for (i = 0; i < 101 && a[k][i] != 0; i++)\n      if (a[k][i] == c)\n        printf(\"$\");\n      else if (a[k][i] == d)\n        printf(\"?\");\n      else\n        printf(\" \");\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint i, j, k, lena;\nchar a[101];\nint main() {\n  while (cin >> a) {\n    cout << a << endl;\n    lena = strlen(a);\n    for (i = 0; i < lena; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (a[j] == '(') {\n            a[i] = '*';\n            a[j] = '*';\n            break;\n          }\n        }\n      }\n    }\n    for (i = 0; i < lena; i++) {\n      if (a[i] == '(') {\n        a[i] = '$';\n      } else if (a[i] == ')') {\n        a[i] = '?';\n      } else\n        a[i] = ' ';\n    }\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid kuohao(char c[]) {\n  int i, j, n;\n  for (n = 0; c[n] != '\\0'; n++)\n    ;\n  for (i = n - 1; i >= 0; i--) {\n    if (c[i] == '(') {\n      for (j = i + 1; c[j] != '\\0'; j++)\n        if (c[j] == ')') {\n          c[i] = c[j] = ' ';\n          break;\n        }\n      if (c[j] == '\\0')\n\n        c[i] = '$';\n\n      kuohao(c);\n    }\n  }\n}\n\nint main() {\n  char c[110] = {'\\0'};\n  int i;\n  while (cin.getline(c, 101)) {\n    cout << c << endl;\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] != '(' && c[i] != ')')\n        c[i] = ' ';\n    kuohao(c);\n    for (i = 0; c[i] != '\\0'; i++)\n      if (c[i] == ')')\n        c[i] = '?';\n    cout << c << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[300];\nint main() {\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    int len = strlen(str);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < len; i++) {\n      if (str[i] != '(' && str[i] != ')')\n        str[i] = ' ';\n    }\n    for (i = 0; i < len; i++) {\n      int b = 0;\n      if (str[i] == ')') {\n        for (j = i - 1; j >= 0; j--) {\n          if (str[j] == '(') {\n            str[j] = ' ';\n            str[i] = ' ';\n            b = 1;\n            break;\n          }\n        }\n        if (b == 0)\n          str[i] = '?';\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == '(')\n        str[i] = '$';\n      if (str[i] == ')')\n        str[i] = '?';\n    }\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "17", "index": "32315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500] = {0};\n  while (cin.getline(a, 200)) \n  {\n    cout << a << endl; \n    int i, j, l = strlen(a);\n    for (i = 0; i < l; i++) {\n      if (a[i] == ')') \n      {\n        for (j = i - 1; j >= 0; j--) {\n          if (a[j] == '(') \n          {\n            a[i] = a[j] = ' ';\n            break;\n          } \n        }\n      } else if (a[i] == '(')\n        continue; \n      else\n        a[i] = ' '; \n    }\n    for (i = 0; i < l; i++) {\n      if (a[i] == '(')\n        cout << '$'; \n      else if (a[i] == ')')\n        cout << '?'; \n      else\n        cout << ' ';\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[100] = {'\\0'};\n  int len, i, j, judge[100] = {0};\n  while (scanf(\"%s \", a)) {\n    len = strlen(a);\n    for (i = 0; i < len; i++)\n      b[i] = ' ';\n    for (i = 99; i >= len; i--)\n      b[i] = '\\0';\n    for (i = 0; i < len; i++) {\n      if (a[i] == ')') {\n        for (j = i; j >= 0; j--) {\n          if (judge[j] == 0 && a[j] == '(') {\n            judge[j] = 1;\n            judge[i] = 1;\n            break;\n          }\n        }\n        if (judge[i] == 0) {\n          b[i] = '?';\n        }\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (judge[i] == 0 && a[i] == '(')\n        b[i] = '$';\n    }\n    for (i = 0; i < len; i++)\n      cout << a[i];\n    cout << '\\n';\n    for (i = 0; i < len; i++)\n      cout << b[i];\n    cout << '\\n';\n    for (i = 0; i < 100; i++) {\n      judge[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32317", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar a[150];\nint find(int x, int y) \n{\n  int b; \n  if (a[x] == '\\0')\n    return -1;\n  if (a[x] == '(') {\n    b = find(x + 1, y + 1);                 \n    a[x] = (b == -1) ? '$' : ' ';           \n    return (b == -1) ? -1 : find(b + 1, y); \n  }\n  if (a[x] == ')') {\n    a[x] = (y == 0) ? '?' : ' ';          \n    return (y == 0) ? find(x + 1, y) : x; \n  } else                                  \n  {\n    a[x] = ' ';\n    return find(x + 1, y);\n  }\n}\nint main() {\n  int n = 1000;\n  for (int i = 1; i < n; i++) {\n    cin.getline(a, 150);\n    if (a[0] == '\\0')\n      break;\n    else {\n      cout << a << endl; \n      find(0, 0);        \n      cout << a << endl; \n    }\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32318", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][102];\n  int i, n = 0, j, k, l;\n  while (cin.getline(str[n++], 102)) {\n  }\n  for (i = 0; i < n; i++) {\n    j = 0;\n    printf(\"%s\\n\", str[i]);\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(') {\n        k = j + 1;\n        while (str[i][k] != '\\0') {\n          if (str[i][k] == ')') {\n            break;\n          }\n          k++;\n        }\n        if (str[i][k] == '\\0') {\n          j++;\n          continue;\n        }\n        l = k - 1;\n        while (true) {\n          if (str[i][l] == '(')\n            break;\n          l--;\n        }\n        str[i][l] = str[i][k] = 'a';\n      }\n      if (str[i][j] != '(')\n        j++;\n    }\n    j = 0;\n    while (str[i][j] != '\\0') {\n      if (str[i][j] == '(')\n        str[i][j] = '$';\n      else if (str[i][j] == ')') {\n        str[i][j] = '?';\n      } else\n        str[i][j] = ' ';\n      j++;\n    }\n    printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[106];\n  while (1) {\n    memset(zf, '\u0000', sizeof(zf));\n\n    cin >> zf;\n    if (zf[0] == '\u0000')\n      break;\n    puts(zf);\n    for (int i = 0; i < strlen(zf); i++) {\n      if (zf[i] == ')') {\n        for (int j = i; j >= 0; j--) {\n          if (zf[j] == '(') {\n            zf[j] = ' ';\n            zf[i] = ' ';\n            break;\n          }\n        }\n      } else if (zf[i] != '(')\n        zf[i] = ' ';\n    }\n    for (int t = 0; t < strlen(zf); t++) {\n      if (zf[t] == '(')\n        zf[t] = '$';\n      else if (zf[t] == ')')\n        zf[t] = '?';\n    }\n    puts(zf);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int left[101], len, top = 0, i, j;\n  char str[101];\n  while (cin >> str) {\n    top = 0;\n    puts(str);\n    len = strlen(str);\n    for (i = 0; i < len; i++) \n    {\n      if (str[i] == '(') {\n        left[top] = i;\n        top++;\n      } else if (str[i] == ')') {\n        if (top) {\n          str[i] = ' ';\n          str[left[top - 1]] = ' '; \n          top--;                    \n        } else\n          str[i] = '?';\n      } else\n        str[i] = ' ';\n    }\n    for (j = 0; j < len; j++)\n      if (str[j] == '(')\n        str[j] = '$';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32321", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, length, k;\n  scanf(\"%d\", &n);\n  getchar();\n  int i;\n  char a[500];\n  for (i = 1; i <= n; i++) {\n\n    cin >> a;\n    puts(a);\n    length = strlen(a);\n    int j;\n    for (j = length - 1; j >= 0; j--) {\n      int judge = 0;\n      if (a[j] != '(' && a[j] != ')')\n        a[j] = ' ';\n      else if (a[j] == '(') {\n        for (k = j + 1; k < length; k++) {\n          if (a[k] == ')') {\n            a[k] = ' ';\n            a[j] = ' ';\n            judge = 1;\n            break;\n          }\n        }\n        if (judge == 0)\n          a[j] = '$';\n      }\n    }\n    for (j = 0; j < length; j++) {\n      if (a[j] == ')')\n        a[j] = '?';\n    }\n    puts(a);\n  }\n}\n"}
{"label": "17", "index": "32322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int b[200], i, j;\n  char a[200];\n  while (cin >> a) {\n    memset(b, 0, sizeof(b));\n\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(')\n        b[i] = 1;\n      if (a[i] == ')') {\n        b[i] = 1;\n        for (j = i; j >= 0; j--)\n          if (a[j] == '(' && b[j] == 1) {\n            b[i] = 0;\n            b[j] = 0;\n            break;\n          }\n      }\n    }\n    cout << a << \" \";\n    for (i = 0; i < 200; i++) {\n      if (a[i] == '\u0000')\n        break;\n      if (a[i] == '(' && b[i] == 1)\n        printf(\"$\");\n      else if (a[i] == ')' && b[i] == 1)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\" \");\n\n    cin >> a;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, m = 0, n = 0, k = 0;\n  char s[105];\n  while (cin.getline(s, 105, '\\n')) {\n    int zuo[100], you[100], flag[105] = {0};\n    char a[105];\n    for (i = 0; s[i] != '\\0'; i++)\n      a[i] = ' ';\n\n    a[i] = '\\0';\n    m = 0;\n    n = 0;\n    for (j = 0; j < i; j++) {\n      if (s[j] == '(')\n        zuo[m++] = j;\n      if (s[j] == ')') {\n        you[n++] = j;\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = you[j] - 1; k >= 0; k--) {\n        if (s[k] == '(' && flag[k] == 0) {\n          flag[k] = 1;\n          flag[you[j]] = 1;\n          break;\n        }\n      }\n    }\n    for (k = 0; k < i; k++) {\n      if (flag[k] == 0 && s[k] == '(')\n        a[k] = '$';\n      if (flag[k] == 0 && s[k] == ')')\n        a[k] = '?';\n    }\n    printf(\"%s\\n\", s);\n    cout << a << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  for (char c[101]; cin.getline(c, 101);) {\n    char a[101] = {' '};\n    int len = strlen(c), cnt = 0, left[101] = {0};\n    for (int i = 0; i < len; i++) {\n      if (c[i] != '(' && c[i] != ')')\n        a[i] = ' ';\n      else {\n        if (c[i] == '(') {\n          a[i] = '$';\n          cnt += 1;\n          left[cnt] = i + 1;\n        } else {\n          if (cnt <= 0) {\n            a[i] = '?';\n          } else {\n            a[i] = ' ';\n            a[left[cnt] - 1] = ' ';\n            left[cnt] = 0;\n            cnt -= 1;\n          }\n        }\n      }\n    }\n    cout << c << endl;\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, l;\n  char c[1000][105] = {0};\n  int k;\n  int a[105] = {0};\n  scanf(\"%d\", &n);\n  int i, j;\n  for (i = 0; i < n; i++) {\n    scanf(\"%s\", c[i]);\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < 105; j++) {\n      a[j] = 0;\n    }\n    l = strlen(c[i]);\n    printf(\"%s\\n\", c[i]);\n    for (j = l - 1; j >= 0; j--) {\n      if (c[i][j] == '(') {\n        for (k = j + 1; k < l; k++) {\n          if (c[i][k] == ')') {\n            c[i][k] = 0;\n            c[i][j] = 0;\n            break;\n          }\n        }\n        if (k == l) {\n          c[i][j] = 0;\n          a[j] = 1;\n        }\n      }\n    }\n    for (j = 0; j < l; j++) {\n      if (c[i][j] == ')')\n        a[j] = 2;\n    }\n    for (j = 0; j < l; j++) {\n      if (a[j] == 1)\n        printf(\"$\");\n      else if (a[j] == 2)\n        printf(\"?\");\n      else\n        printf(\" \");\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "17", "index": "32326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  int temp;\n  while (cin.getline(str, 101, '\\n')) {\n    cout << str << endl;\n    int k, i, s = 0;\n    char result[101];\n    int left[101];\n    memset(result, ' ', sizeof(result));\n    k = strlen(str);\n    int p = 0;\n    for (i = 0; i < k; i++) {\n      if (str[i] == '(') {\n        p++;\n        left[s] = i;\n        temp = s;\n        s++;\n      }\n      if ((str[i] == ')') && (p == 0)) {\n        result[i] = '?';\n      }\n      if ((str[i] == ')') && (p != 0)) {\n        p--;\n        left[temp] = -1;\n        do\n          temp--;\n        while (left[temp] == -1);\n      }\n    }\n    for (i = 0; i < s; i++) {\n      if (left[i] == -1)\n        continue;\n      else\n        result[left[i]] = '$';\n    }\n    for (i = 0; i < k; i++)\n      cout << result[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "17", "index": "32327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][101], b[101], c[101];\n  int n, m;\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    scanf(\"%s\", a[m]);\n  }\n  for (m = 0; m < n; m++) {\n    int i = 0, j = 0, k = 0;\n    int n;\n    n = strlen(a[m]);\n    for (i = 0; i < n; i++) {\n      b[i] = ' ';\n      c[i] = ' ';\n    }\n\n    for (i = n - 1; i >= 0; i--)\n      if (a[m][i] == '(')\n        b[i] = a[m][i];\n    for (i = 0; i < n; i++)\n      if (a[m][i] == ')')\n        c[i] = a[m][i];\n    for (i = n - 1; i >= 0; i--)\n      if (b[i] == '(') {\n        for (j = i + 1; j < n; j++)\n          if (c[j] == ')') {\n            c[j] = ' ';\n            b[i] = ' ';\n            break;\n          }\n      }\n    printf(\"%s \", a[m]);\n    for (i = 0; i < n; i++) {\n      if (b[i] != ' ')\n        a[m][i] = '$';\n      if (c[i] != ' ')\n        a[m][i] = '?';\n      if (b[i] == ' ' && c[i] == ' ')\n        a[m][i] = ' ';\n    }\n    printf(\"%s \", a[m]);\n  }\n}\n"}
{"label": "17", "index": "32328", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120];\n  while (scanf(\"%s \", s)) {\n    char res[120];\n    int lens;\n    int leftnum = 0;\n    int left[120];\n    lens = strlen(s);\n    for (int i = 0; i < lens; i++)\n      res[i] = ' ';\n    for (int i = 1; i < 120; i++)\n      left[i] = -1;\n    for (int i = 0; i < lens; i++) {\n      if (s[i] == '(')\n        left[++leftnum] = i;\n      if (s[i] == ')') {\n        if (leftnum == 0)\n          res[i] = '?';\n        else {\n          left[leftnum] = -1;\n          leftnum--;\n        }\n      }\n    }\n    for (int i = 1; i <= leftnum; i++)\n      res[left[i]] = '$';\n    for (int i = 0; i < lens; i++)\n      cout << s[i];\n    cout << endl;\n    for (int i = 0; i < lens; i++)\n      cout << res[i];\n    cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32329", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, sum, min, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 2; j < m; j++)\n          a[i][j - 1] = a[i][j];\n      for (j = 0; j < m; j++)\n        for (i = 2; i < m; i++)\n          a[i - 1][j] = a[i][j];\n      m--;\n    }\n    printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32330", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[200][200], temp, sum[200];\n\nvoid zero(int i) {\n  int mi = 1000;\n  for (int j = i; j <= n; j++) {\n    for (int k = i; k <= n; k++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int k = i; k <= n; k++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n  mi = 1000;\n  for (int k = i; k <= n; k++) {\n    for (int j = i; j <= n; j++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int j = i; j <= n; j++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n}\n\nint main() {\n  cin >> n;\n  for (int l = 1; l <= n; l++) {\n    sum[l] = 0;\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> *(*(a + j) + k);\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + 1) + i);\n      *(*(a + 1) + i) = *(*(a + 2) + i);\n      *(*(a + 2) + i) = temp;\n    }\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + i) + 1);\n      *(*(a + i) + 1) = *(*(a + i) + 2);\n      *(*(a + i) + 2) = temp;\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      zero(i);\n      sum[l] += *(*(a + i) + i);\n      for (int k = i + 1; k <= n; k++) {\n        temp = *(*(a + i + 1) + k);\n        *(*(a + i + 1) + k) = *(*(a + i + 2) + k);\n        *(*(a + i + 2) + k) = temp;\n      }\n      for (int j = i + 1; j <= n; j++) {\n        temp = *(*(a + j) + i + 1);\n        *(*(a + j) + i + 1) = *(*(a + j) + i + 2);\n        *(*(a + j) + i + 2) = temp;\n      }\n    }\n    printf(\"%d\\n\", sum[l]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32331", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[102][102], i, k, j, l, n, s, (*p)[102], (*q)[102], min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0, s = 0, p = &a[0]; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0, p = &a[0], q = &a[n]; i < n; i++)\n      *(*q + i) = *(*p + i);\n    for (i = 0, p = &a[1]; i < n; i++)\n      *(*(p + i) + n) = **(p + i);\n    for (l = 1; l < n; l++) {\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + i) + l); j <= n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = l; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + l) + i); j <= n; j++)\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        for (j = l; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      s += *(*(p + l) + l);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32332", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, p, ans;\n  int a[101][101], g;\n  scanf(\"%d \", &n);\n  k = n;\n\n  while (k--) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    p = n;\n    while (p-- > 1) {\n      for (i = 0; i <= p; i++) {\n        g = *(*(a + i));\n        for (j = 0; j <= p; j++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (j = 0; j <= p; j++)\n          *(*(a + i) + j) -= g;\n      }\n      for (j = 0; j <= p; j++) {\n        g = *(*(a) + j);\n        for (i = 0; i <= p; i++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (i = 0; i <= p; i++)\n          *(*(a + i) + j) -= g;\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 2; i <= p; i++)\n        *(*(a + i - 1)) = *(*(a + i));\n      for (j = 2; j <= p; j++)\n        *(*(a) + j - 1) = *(*(a) + j);\n      for (i = 2; i <= p; i++)\n        for (j = 2; j <= p; j++)\n          *(*(a + i - 1) + j - 1) = *(*(a + i) + j);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid gl(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 1; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < m; i++) {\n    int min = a[0][i];\n    for (j = 1; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n}\n\nvoid xj(int m) {\n  int i, j;\n  for (i = 2; i < m; i++)\n    a[0][i - 1] = a[0][i];\n  for (i = 2; i < m; i++)\n    a[i - 1][0] = a[i][0];\n  for (i = 2; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    int sum = 0;\n    for (i = n; i > 1; i--) {\n      gl(i);\n      sum += a[1][1];\n      xj(i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nn, n, i, j, k, min[100], maze[100][100], sum;\n  cin >> nn;\n  for (k = 0; k < nn; k++) {\n    sum = 0;\n    n = nn;\n    for (i = 0; i < nn; i++)\n      for (j = 0; j < nn; j++)\n        cin >> maze[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min[i] = maze[i][0];\n        for (j = 1; j < n; j++)\n          min[i] = min[i] < maze[i][j] ? min[i] : maze[i][j];\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          maze[i][j] -= min[i];\n      for (j = 0; j < n; j++) {\n        min[j] = maze[0][j];\n        for (i = 1; i < n; i++)\n          min[j] = min[j] < maze[i][j] ? min[j] : maze[i][j];\n      }\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++)\n          maze[i][j] -= min[j];\n      sum += maze[1][1];\n      for (i = 1; i < n - 1; i++)\n        maze[i][0] = maze[i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        maze[0][j] = maze[0][j + 1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          maze[i][j] = maze[i + 1][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32335", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\n\nint hanshu(int n);\n\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    printf(\"%d\\n\", hanshu(n));\n  }\n\n  return 0;\n}\n\nint hanshu(int n) {\n  int min, sum = 0, i, j;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 1; i <= n; i++) {\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= n; j++) {\n      min = 10000;\n      for (i = 1; i <= n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (i = 1; i <= n; i++)\n        a[i][j] -= min;\n    }\n    sum = a[2][2];\n    for (i = 1; i <= n; i++)\n      for (j = 2; j < n; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 1; j < n; j++)\n      for (i = 2; i < n; i++)\n        a[i][j] = a[i + 1][j];\n    return sum + hanshu(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32336", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p, s = 0, sum;\n  cin >> n;\n  int a[n][n];\n\n  for (s = 0; s < n; s++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        p = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] <= p)\n            p = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - p;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        p = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] <= p) {\n            p = a[i][j];\n          }\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - p;\n      }\n      sum = a[1][1] + sum;\n      for (i = 1; i < n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - k - 1; j++)\n        for (i = 0; i < n - k - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    if (sum == 199)\n      printf(\"%d\\n\", sum - 1);\n    else\n      cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32337", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a[100][100], min = 0, sum[100];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) \n  {\n    sum[k] = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (l = 1; l <= n - 1; l++) \n    {\n      for (i = 0; i <= n - l; i++) \n      {\n        min = a[i][0];\n        for (j = 1; j <= n - l; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j <= n - l; j++) \n      {\n        min = a[0][j];\n        for (i = 1; i <= n - l; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n\n      {\n        for (j = 0; j <= n - l; j++) {\n          for (i = 1; i <= n - l - 1; i++)\n            a[i][j] = a[i + 1][j];\n        }\n        for (i = 0; i <= n - l - 1; i++) {\n          for (j = 1; j <= n - l - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n  }\n  for (k = 1; k <= n; k++)\n    printf(\"%d\\n\", sum[k]);\n  return 0;\n}\n"}
{"label": "18", "index": "32338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num, i, j, sum;\n  scanf(\"%d \", &num);\n  int n = num, min, t = num;\n  while (num > 0) {\n    n = t;\n    int a[n][n];\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < n; i++) {\n        min = a[0][i];\n        for (j = 0; j < n; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - min;\n      }\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[i][j] = a[i][j + 1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[j][i] = a[j + 1][i];\n      n--;\n    }\n    cout << sum << endl;\n    num--;\n  }\n}\n"}
{"label": "18", "index": "32339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int n, int a[][101]);\nint Delete(int n, int a[][101]);\nint min(int a, int b);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n\n    Sum[i] = GL(n, a);\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", Sum[i]);\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = a[i][0];\n    for (j = 1; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = a[0][j];\n    for (i = 1; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  Sum = a[1][1];\n\n  if (n != 2) {\n    Delete(n, a);\n    Sum = Sum + GL(n - 1, a);\n    return Sum;\n  }\n\n  else\n    return Sum;\n}\n\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, i, j, k, rec, sum;\nint x[150][150];\n\nvoid F() {\n  int p, q, min;\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + p) + 1));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + p) + q)) < min) ? (*(*(x + p) + q)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + p) + q)) -= min;\n  }\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + 1) + p));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + q) + p)) < min) ? (*(*(x + q) + p)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + q) + p)) -= min;\n  }\n  sum += (*(*(x + 2) + 2));\n  for (p = 2; p < rec; p++)\n    (*(*(x + 1) + p)) = (*(*(x + 1) + p + 1));\n  for (p = 2; p < rec; p++)\n    (*(*(x + p) + 1)) = (*(*(x + p + 1) + 1));\n  for (p = 2; p < rec; p++) {\n    for (q = 2; q < rec; q++)\n      (*(*(x + p) + q)) = (*(*(x + p + 1) + q + 1));\n  }\n  return;\n}\n\nint main() {\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    rec = n;\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> (*(*(x + i) + j));\n    while (rec > 1) {\n      F();\n      rec--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint board[100][100];\nvoid Subduction(int);\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1) {\n    cout << sum << endl;\n  } else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    for (q = 1; q <= m - 2; q++) {\n      board[0][q] = board[0][q + 1];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      board[p][0] = board[p + 1][0];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      for (q = 1; q <= m - 2; q++) {\n        board[p][q] = board[p + 1][q + 1];\n      }\n    }\n    Subduction(m - 1);\n  }\n}\n"}
{"label": "18", "index": "32342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nvoid q(int l) {\n  for (int g = 0; g < l; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[g][h] = a[g][h + 1];\n  for (int g = 0; g < l - 1; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[h][g] = a[h + 1][g];\n}\nint f(int y) {\n  int min, now;\n  if (y == 1)\n    return 0;\n  for (int g = 0; g < y; g++) {\n    min = a[g][0];\n    for (int h = 1; h < y; h++)\n      if (a[g][h] < min)\n        min = a[g][h];\n    for (int h = 0; h < y; h++)\n      a[g][h] -= min;\n  }\n  for (int g = 0; g < y; g++) {\n    min = a[0][g];\n    for (int h = 1; h < y; h++)\n      if (a[h][g] < min)\n        min = a[h][g];\n    for (int h = 0; h < y; h++)\n      a[h][g] -= min;\n  }\n  now = a[1][1];\n  q(y);\n  return now + f(y - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << endl << f(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, size, t, i, j, round, a[101][101], s[101], minx[101], miny[101];\n  memset(s, 0, sizeof(s));\n  cin >> n;\n  size = n;\n\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    size = n;\n    for (round = 1; round <= n - 1; round++) {\n      for (i = 1; i <= size; i++) {\n        minx[i] = a[i][1];\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          if (a[i][j] < minx[i]) {\n            minx[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - minx[i];\n        }\n      }\n      for (j = 1; j <= size; j++) {\n        miny[j] = a[1][j];\n      }\n      for (j = 1; j <= size; j++) {\n        for (i = 1; i <= size; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - miny[j];\n        }\n      }\n\n      s[t] = s[t] + a[2][2];\n      for (j = 2; j <= size - 1; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        for (j = 2; j <= size - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      size--;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << s[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint f(int n, int a[][100]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0) {\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 1; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n  }\n  int z = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  if (n == 2)\n    return z;\n  else\n    return z + f(n - 1, a);\n}\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << f(n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32345", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int step, int *sum) {\n  int i, j, min, g;\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[i][j] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[i][j];\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[j][i] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[j][i];\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[j][i] -= min;\n    }\n  }\n  *sum += a[step][step];\n  return;\n}\n\nint main() {\n  int n, i, j, k, a[100][100], sum;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, 0, 40000);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j < n; j++) {\n      change(a, n, j, &sum);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32346", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110], b[110];\n  int(*ju)[110] = a;\n  int num1, num, i, j, m, sum = 0, *min = b;\n  cin >> num1;\n  for (m = 0; m < num1; m++) {\n    num = num1;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++)\n        cin >> *(*(ju + i) + j);\n    while (num > 1) {\n\n      for (i = 0; i < num; i++) {\n        *(min + i) = 10000;\n        for (j = 0; j < num; j++)\n          if (*(*(ju + i) + j) < *(min + i))\n            *(min + i) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + i);\n\n      for (j = 0; j < num; j++) {\n        *(min + j) = 10000;\n        for (i = 0; i < num; i++)\n          if (*(*(ju + i) + j) < *(min + j))\n            *(min + j) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + j);\n\n      sum = sum + *(*(ju + 1) + 1);\n\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num - 1; j++) {\n          if (j >= 1)\n            *(*(ju + i) + j) = *(*(ju + i) + j + 1);\n        }\n      }\n\n      for (j = 0; j < num - 1; j++) {\n        for (i = 0; i < num - 1; i++) {\n          if (i >= 1)\n            *(*(ju + i) + j) = *(*(ju + i + 1) + j);\n        }\n      }\n\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, range;\n  cin >> range;\n  n = range;\n  int a[102][102], (*p)[102] = a;\n  int i, j, k, q, sum = 0;\n  for (i = 0; i < range; i++) {\n    sum = 0;\n    n = range;\n    int minrow = 999999, mincol = 999999;\n    for (j = 0; j < n; j++) \n      for (k = 0; k < n; k++)\n        cin >> *(*(p + j) + k);\n    for (; n > 1;) {\n\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (*(*(p + j) + k) < minrow)\n            minrow = *(*(p + j) + k);\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j) + k) - minrow;\n        minrow = 999999;\n      } \n      \n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++)\n          if (*(*(p + j) + k) < mincol)\n            mincol = *(*(p + j) + k);\n        for (j = 0; j < n; j++)\n          *(*(p + j) + k) = *(*(p + j) + k) - mincol;\n        mincol = 999999;\n      } \n      \n      sum += *(*(p + 1) + 1);\n      \n      if (n == 2)\n        break;\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j + 1) + k);\n      }\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      }\n      n--;\n      \n      \n      \n      \n    } \n    \n    cout << sum << endl;\n\n  } \n  return 0;\n}\n"}
{"label": "18", "index": "32348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n  int num;\n  scanf(\"%d \", &num);\n  int an[100][100];\n  for (int c = 0; c < num; c++) {\n\n    for (int i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> *(*(an + i) + j);\n    }\n    int sum = 0;\n    int hang;\n    for (hang = num; hang > 1; hang--) {\n      int a = 0, b = 0;\n      for (m = 0; m < hang; m++) {\n        a = *(*(an + m) + 0);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + m) + n) < a) {\n            a = *(*(an + m) + n);\n          }\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + m) + n) = *(*(an + m) + n) - a;\n      }\n\n      for (m = 0; m < hang; m++) {\n        b = *(*(an + 0) + m);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + n) + m) < b)\n            b = *(*(an + n) + m);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + n) + m) = *(*(an + n) + m) - b;\n      }\n      sum = sum + an[1][1];\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + i) + j) = *(*(an + i) + j + 1);\n      }\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + j) + i) = *(*(an + j + 1) + i);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int num = 0;\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - num; i++) {\n        int rowm = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (a[i][j] < rowm)\n            rowm = a[i][j];\n        }\n        for (j = 0; j < n - num; j++) {\n          a[i][j] = a[i][j] - rowm;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        int colm = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (a[i][j] < colm)\n            colm = a[i][j];\n        }\n        for (i = 0; i < n - num; i++) {\n          a[i][j] = a[i][j] - colm;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i - 1][j] = a[i][j];\n      }\n\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++)\n          a[i][j - 1] = a[i][j];\n      }\n      num++;\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32350", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n;\n  m = n;\n  int sum = 0;\n  for (int i = 0; i < m; i++) {\n    n = m;\n    int a[100][100];\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    while (n > 1) {\n      for (int j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        int min = a[0][j];\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int k = 0; k < n; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], b[100], c[100], i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int sum = n, l = 0;\n    while (sum > 1) {\n      for (i = 0; i < sum; i++) {\n        b[i] = a[i][0];\n        for (j = 0; j < sum; j++) {\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n        }\n        for (j = 0; j < sum; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (j = 0; j < sum; j++) {\n        c[j] = a[0][j];\n        for (i = 0; i < sum; i++) {\n          if (a[i][j] < c[j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < sum; i++)\n          a[i][j] = a[i][j] - c[j];\n      }\n      l = l + a[1][1];\n      for (i = 0; i < sum; i++) {\n        for (j = 1; j < sum - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < sum; j++) {\n        for (i = 1; i < sum - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      sum--;\n    }\n    cout << l << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32352", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, min, sum = 0;\n  int i, j, k, q;\n  scanf(\"%d\", &n);\n  int **a = (int **)calloc(n, sizeof(int *));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      a[i] = (int *)calloc(n, sizeof(int));\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] > m)\n          m = a[i][j];\n      }\n    }\n    min = m;\n    for (q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i][j] - min;\n\n        min = m;\n      }\n      for (j = 0; j < n - q; j++) {\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - q; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      sum = a[1][1] + sum;\n      for (i = 0; i < n - q; i++) {\n        for (j = 1; j < n - q - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 1; i < n - q - 1; i++) {\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d \", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint f(int n) {\n  int i, j;\n  int r = 0, l = 0;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      r = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (r > a[i][j])\n          r = a[i][j];\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - r;\n      }\n    }\n    for (j = 0; j < n; j++) {\n      l = a[0][j];\n      for (i = 1; i < n; i++) {\n        if (l > a[i][j])\n          l = a[i][j];\n      }\n      for (i = 0; i < n; i++) {\n        a[i][j] = a[i][j] - l;\n      }\n    }\n    int m;\n    m = a[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 0; j < n; j++)\n      for (i = 1; i < n - 1; i++)\n        a[i][j] = a[i + 1][j];\n    return m + f(n - 1);\n  }\n}\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    int sum = 0;\n    sum = f(n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32354", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b, j, k, a, su[100][100], result;\n  cin >> n;\n  b = n;\n  for (i = 0; i < n; i++) {\n    result = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &su[j][k]);\n\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        a = su[j][0];\n        for (k = 0; k < n; k++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          su[j][k] -= a;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        a = su[0][k];\n        for (j = 0; j < n; j++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          su[j][k] -= a;\n        }\n      }\n      result += su[1][1];\n      for (j = 0; j < n - 1; j++) {\n        for (k = 0; k < n - 1; k++) {\n          if (j == 0 && k > 0)\n            su[j][k] = su[j][k + 1];\n          else if (k == 0 && j > 0)\n            su[j][k] = su[j + 1][k];\n          else if (j > 0 && k > 0)\n            su[j][k] = su[j + 1][k + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", result);\n    n = b;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32355", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, mat[101][101], tp[101][101], sum = 0;\nvoid cut(int x) {\n  int min;\n  if (x == n - 1)\n    return;\n  else {\n    for (int i = 0; i < n - x; i++) {\n      min = mat[i][0];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[i][j] <= min) {\n          min = mat[i][j];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[i][j] -= min;\n    }\n    for (int i = 0; i < n - x; i++) {\n      min = mat[0][i];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[j][i] <= min) {\n          min = mat[j][i];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[j][i] -= min;\n    }\n    sum += mat[1][1];\n\n    for (int i = 0; i < n - x; i++)\n      mat[1][i] = -1;\n    for (int i = 0; i < n - x; i++)\n      mat[i][1] = -1;\n    tp[0][0] = mat[0][0];\n    for (int i = 2; i < n - x; i++)\n      tp[0][i - 1] = mat[0][i];\n    for (int i = 2; i < n - x; i++) {\n      tp[i - 1][0] = mat[i][0];\n      for (int j = 2; j < n - x; j++)\n        tp[i - 1][j - 1] = mat[i][j];\n    }\n\n    for (int i = 0; i < n - x - 1; i++) {\n      for (int j = 0; j < n - x - 1; j++)\n        mat[i][j] = tp[i][j];\n    }\n\n    cut(x + 1);\n  }\n}\nvoid ope() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> mat[i][j];\n    }\n  }\n  sum = 0;\n  cut(0);\n  cout << sum << endl;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    ope();\n  return 0;\n}\n"}
{"label": "18", "index": "32356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int n = 0, i, j, k, q = 0, l, m, s = 0;\n  cin >> n;\n  k = n;\n  while (q < k) {\n    s = 0;\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    n = k;\n    for (m = 1; m <= k - 1; m++) {\n      for (i = 0; i < n; i++) {\n        l = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (l > a[i][j])\n            l = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - l;\n      }\n      for (i = 0; i < n; i++) {\n        l = a[0][i];\n        for (j = 0; j < n; j++) {\n          if (l > a[j][i])\n            l = a[j][i];\n        }\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - l;\n      }\n      s = a[1][1] + s;\n\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n - 1; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << s << endl;\n    q++;\n  }\n\n  return (0);\n}\n"}
{"label": "18", "index": "32357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[100][100], int n);\n  int n, a[100][100], i, j, k, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    s = f(a, n);\n    printf(\"%d\\n\", s);\n  }\n}\n\nint f(int a[100][100], int n) {\n  int i, j, k, min[100], s = 0;\n  for (i = 0; i < n; i++) {\n    min[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j];\n    }\n  }\n  if (n == 2) {\n    s = a[1][1];\n  } else {\n    k = a[1][1];\n    for (j = 1; j < n - 1; j++)\n      a[0][j] = a[0][j + 1];\n    for (i = 1; i < n - 1; i++)\n      a[i][0] = a[i + 1][0];\n    for (i = 1; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i + 1][j + 1];\n    s = k + f(a, n - 1);\n  }\n  return s;\n}\n"}
{"label": "18", "index": "32358", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], mini = INT_MAX, sum = 0;\n  cin >> n;\n  for (int c = 1; c <= n; c++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++)\n          mini = min(mini, a[i][j]);\n\n        for (int l = 0; l <= n - k; l++) {\n          a[i][l] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[j][i]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[l][i] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      sum += a[1][1];\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 1; j <= n - k - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (int j = 0; j <= n - k - 1; j++) {\n        for (int i = 1; i <= n - k - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n);\nint main() {\n  int n;\n  cin >> n;\n  int k, i, j;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j;\n  int min;\n  int num;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  num = a[1][1];\n  if (n == 2)\n    return num;\n  else {\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[i][j - 1] = a[i][j];\n    return num + sum(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32360", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[200][200] = {{0}, {0}}, i, j = 0, sum, q = 0, k, n, m, s;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    for (s = 0; s < n; s++) {\n\n      for (i = 1; i <= n - s; i++) {\n        m = a[i][1];\n        for (j = 1; j <= n - s; j++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (j = 1; j <= n - s; j++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      for (j = 1; j <= n - s; j++) {\n        m = a[1][j];\n        for (i = 1; i <= n - s; i++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (i = 1; i <= n - s; i++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - s; i++) {\n        for (j = 2; j <= n; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (j = 1; j <= n - s; j++) {\n        for (i = 2; i <= n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32361", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid xj(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n}\n\nvoid gl(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 1; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    xj(n);\n    gl(n - 1);\n  } else\n    return;\n}\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    gl(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p, s = 0, sum;\n  scanf(\"%d \", &n);\n  int a[n][n];\n\n  for (s = 0; s < n; s++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        p = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] <= p)\n            p = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - p;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        p = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] <= p) {\n            p = a[i][j];\n          }\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - p;\n      }\n      sum = a[1][1] + sum;\n      for (i = 1; i < n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - k - 1; j++)\n        for (i = 0; i < n - k - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    if (sum == 199)\n      cout << sum - 1 << endl;\n    else {\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32363", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[101][101];\n\nint hanshu(int n);\n\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    cout << hanshu(n) << endl;\n  }\n\n  return 0;\n}\n\nint hanshu(int n) {\n  int min, sum = 0, i, j;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 1; i <= n; i++) {\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= n; j++) {\n      min = 10000;\n      for (i = 1; i <= n; i++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (i = 1; i <= n; i++) {\n        a[i][j] -= min;\n      }\n    }\n    sum = a[2][2];\n    for (i = 1; i <= n; i++)\n      for (j = 2; j < n; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 1; j < n; j++)\n      for (i = 2; i < n; i++)\n        a[i][j] = a[i + 1][j];\n    return sum + hanshu(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid diminish(int a[105][105], int stair) {\n  int i, j, min[105];\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[i][1];\n    for (j = 1; j <= stair; j++) {\n      if (a[i][j] < min[i]) {\n        min[i] = a[i][j];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[1][i];\n    for (j = 1; j <= stair; j++) {\n      if (a[j][i] < min[i]) {\n        min[i] = a[j][i];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[j][i] -= min[i];\n    }\n  }\n}\nvoid lowerstair(int a[105][105], int stair) {\n  int i, j;\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint deal(int a[105][105], int stair) {\n  int result = 0;\n  while (stair >= 2) {\n    diminish(a, stair);\n    result += a[2][2];\n    lowerstair(a, stair);\n    stair--;\n  }\n  return result;\n}\nint main() {\n  int n, i, j, k, stair, sum, a[105][105];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    stair = n;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = deal(a, stair);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint Matrix(int a[][100], int sum, int n);\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    Matrix(a, sum, n);\n  }\n  return 0;\n}\n\nint Matrix(int a[][100], int sum, int n) {\n  int i, j, min;\n  if (n == 1) {\n    printf(\"%d\\n\", sum);\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      a[j - 1][i] = a[j][i];\n  Matrix(a, sum, n - 1);\n  return 0;\n}\n"}
{"label": "18", "index": "32366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fa(int a[][101], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min, t;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 2; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 1; i <= n; i++) {\n    {\n      min = a[1][i];\n      for (j = 2; j <= n; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (j = 1; j <= n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n  }\n  t = a[2][2];\n  for (i = 2; i < n; i++) {\n    a[1][i] = a[1][i + 1];\n    a[i][1] = a[i + 1][1];\n    for (j = 2; j < n; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return t + fa(a, n - 1);\n}\nint main() {\n  int n, k, i, j, a[101][101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"%d \", fa(a, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\nint n;\n\nvoid scan(int m) {\n  int i, j;\n  for (i = 0; i <= m - 1; ++i) {\n    for (j = 0; j <= m - 1; ++j) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n}\n\nint minofc(int m) {\n  int i, min = a[m][0];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  return min;\n}\n\nint minofr(int m) {\n  int i, min = a[0][m];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  return min;\n}\n\nvoid tozero() {\n  int i, j;\n  for (i = 0; i <= n - 1; ++i) {\n    int min = minofc(i);\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    int min = minofr(j);\n    for (i = 0; i <= n - 1; ++i) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n}\n\nvoid eliminate() {\n  int i, j;\n  for (i = 1; i <= n - 2; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  int p = n;\n  int i;\n  for (i = 1; i <= n; ++i) {\n    int sum = 0;\n    scan(n);\n    do {\n      tozero();\n      sum = sum + a[1][1];\n      eliminate();\n      n--;\n    } while (n > 1);\n    cout << sum << \"\\n\";\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32368", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, rec, sum;\nint x[150][150];\n\nvoid F() {\n  int p, q, min;\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + p) + 1));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + p) + q)) < min) ? (*(*(x + p) + q)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + p) + q)) -= min;\n  }\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + 1) + p));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + q) + p)) < min) ? (*(*(x + q) + p)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + q) + p)) -= min;\n  }\n  sum += (*(*(x + 2) + 2));\n  for (p = 2; p < rec; p++)\n    (*(*(x + 1) + p)) = (*(*(x + 1) + p + 1));\n  for (p = 2; p < rec; p++)\n    (*(*(x + p) + 1)) = (*(*(x + p + 1) + 1));\n  for (p = 2; p < rec; p++) {\n    for (q = 2; q < rec; q++)\n      (*(*(x + p) + q)) = (*(*(x + p + 1) + q + 1));\n  }\n  return;\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    rec = n;\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> (*(*(x + i) + j));\n    while (rec > 1) {\n      F();\n      rec--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32369", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, sum = 0, a[100][100], k = 0;\n  int t = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        t = a[i][0];\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - q; j++) {\n        t = a[0][j];\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - q - 1; i++)\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - q - 1; j++)\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, min, sum = 0;\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (int k = n; k > 1; k--) {\n      for (int i = 0; i < k; i++) {\n        min = **(p + i);\n        for (int j = 1; j < k; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (int j = 0; j < k; j++) {\n        min = *(*p + j);\n        for (int i = 1; i < k; i++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int i = 0; i < k; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (int i = 1; i < k; i++)\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (int j = 1; j < k; j++)\n        for (int i = 0; i < k; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32371", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[200][200], temp, sum[200];\n\nvoid zero(int i) {\n  int mi = 1000;\n  for (int j = i; j <= n; j++) {\n    for (int k = i; k <= n; k++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int k = i; k <= n; k++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n  mi = 1000;\n  for (int k = i; k <= n; k++) {\n    for (int j = i; j <= n; j++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int j = i; j <= n; j++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n}\n\nint main() {\n  cin >> n;\n  for (int l = 1; l <= n; l++) {\n    sum[l] = 0;\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> *(*(a + j) + k);\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + 1) + i);\n      *(*(a + 1) + i) = *(*(a + 2) + i);\n      *(*(a + 2) + i) = temp;\n    }\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + i) + 1);\n      *(*(a + i) + 1) = *(*(a + i) + 2);\n      *(*(a + i) + 2) = temp;\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      zero(i);\n      sum[l] += *(*(a + i) + i);\n      for (int k = i + 1; k <= n; k++) {\n        temp = *(*(a + i + 1) + k);\n        *(*(a + i + 1) + k) = *(*(a + i + 2) + k);\n        *(*(a + i + 2) + k) = temp;\n      }\n      for (int j = i + 1; j <= n; j++) {\n        temp = *(*(a + j) + i + 1);\n        *(*(a + j) + i + 1) = *(*(a + j) + i + 2);\n        *(*(a + j) + i + 2) = temp;\n      }\n    }\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32372", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101][101], i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    int ti = 2, sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ti = 2; ti <= n; ti++) {\n      int mins[101], minl[101];\n      for (int p = 1; p <= n; p++) {\n        mins[p] = 10000;\n        minl[p] = 10000;\n      }\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (a[i][j] >= 0 && a[i][j] <= mins[i])\n            mins[i] = a[i][j];\n        }\n        for (j = 1; j <= n; j++)\n          a[i][j] = a[i][j] - mins[i];\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          if (a[i][j] >= 0 && a[i][j] <= minl[j])\n            minl[j] = a[i][j];\n        }\n\n        for (i = 1; i <= n; i++)\n          a[i][j] = a[i][j] - minl[j];\n      }\n      sum = sum + a[ti][ti];\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (i == ti || j == ti)\n            a[i][j] = -1;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32373", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0, n;\nvoid GuiLing(int num[][100], int n, int move);\nvoid XiaoJian(int num[][100], int move);\nint main() {\n  int i, j, t, num[100][100];\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    XiaoJian(num, 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid XiaoJian(int num[][100], int move) {\n  if (move == n - 1) {\n    ;\n  } else {\n    GuiLing(num, n, move);\n    sum = sum + num[move + 1][move + 1];\n    XiaoJian(num, move + 1);\n  }\n}\nvoid GuiLing(int num[][100], int n, int move) {\n  int i, j, min;\n\n  for (i = 0; i < n; i++) {\n    if ((move != 0) && ((i >= 1) && (i <= move)))\n      continue;\n    min = num[i][0];\n    for (j = 1; j < n; j++) {\n      if ((move != 0) && ((j >= 1) && (j <= move)))\n        continue;\n      if (num[i][j] < min) {\n        min = num[i][j];\n      }\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++) {\n        if ((move != 0) && ((j >= 1) && (j <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    if ((move != 0) && ((j >= 1) && (j <= move)))\n      continue;\n    min = num[0][j];\n    for (i = 1; i < n; i++) {\n      if ((move != 0) && ((i >= 1) && (i <= move)))\n        continue;\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++) {\n        if ((move != 0) && ((i >= 1) && (i <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "32374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[100][100], sum = 0, min_1 = 1000, rst[100];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &map_1[j][k]);\n    for (t = n; t > 1; t--) \n    {\n      for (j = 0; j < t; j++) \n      {\n        for (k = 0; k < t; k++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (k = 0; k < t; k++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n        min_1 = 1000;\n      }\n\n      min_1 = 1000;\n      for (k = 0; k < t; k++) \n      {\n        for (j = 0; j < t; j++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (j = 0; j < t; j++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n\n        min_1 = 1000;\n      }\n      sum = sum + map_1[1][1]; \n\n      for (k = 1; k < t - 1; k++)\n        map_1[0][k] = map_1[0][k + 1];\n      for (j = 1; j < t - 1; j++)\n        map_1[j][0] = map_1[j + 1][0];\n      for (j = 1; j < t - 1; j++)\n        for (k = 1; k < t - 1; k++)\n          map_1[j][k] = map_1[j + 1][k + 1];\n\n      min_1 = 1000;\n    }\n    rst[i] = sum;\n    sum = 0;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\", rst[i]);\n}\n"}
{"label": "18", "index": "32375", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k < n; k++) {\n    int i, j, l;\n    int a[100][100];\n    int s[100];\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n\n    for (l = 0; l < n - 1; l++) {\n      int minh[100] = {0};\n      for (i = 0; i < n; i++) {\n\n        if (a[i][0] >= 0) {\n          minh[i] = a[i][0];\n          for (j = 0; j < n; j++) {\n            if (a[i][j] < minh[i] && a[i][j] >= 0)\n              minh[i] = a[i][j];\n          }\n          for (j = 0; j < n; j++) {\n            a[i][j] = a[i][j] - minh[i];\n          }\n        }\n      }\n      int minl[100] = {0};\n      for (i = 0; i < n; i++) {\n        if (a[0][i] >= 0)\n\n        {\n          minl[i] = a[0][i];\n          for (j = 0; j < n; j++) {\n            if (a[j][i] < minl[i] && a[i][j] >= 0)\n              minl[i] = a[j][i];\n          }\n          for (j = 0; j < n; j++) {\n            a[j][i] = a[j][i] - minl[i];\n          }\n        }\n      }\n      s[l] = a[l + 1][l + 1];\n\n      for (i = 0; i < n; i++) {\n        a[l + 1][i] = -1;\n        a[i][l + 1] = -1;\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < n - 1; i++) {\n      sum = sum + s[i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32376", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000], n;\n\nvoid sub_to_zero() {\n  int m;\n  for (int i = 0; i < n; i++) {\n    m = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < m)\n        m = a[i][j];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[i][j] -= m;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    m = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < m) {\n        m = a[j][i];\n      }\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[j][i] -= m;\n    }\n  }\n}\n\nvoid delimination() {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 2; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  --n;\n}\n\nint calcMatrix() {\n  int sum = 0;\n  while (n > 1) {\n    sub_to_zero();\n    sum += a[1][1];\n    delimination();\n  }\n  return sum;\n}\n\nint main() {\n  int nMatrix;\n  cin >> nMatrix;\n  for (int i = 0; i < nMatrix; i++) {\n    n = nMatrix;\n    for (int j = 0; j < nMatrix; j++)\n      for (int k = 0; k < nMatrix; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", calcMatrix());\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32377", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[200][200][200];\n\nint main() {\n  int n, sum[200];\n  int p, k, i, j;\n  int min;\n\n  cin >> n;\n\n  for (p = 0; p < n; p++) {\n    sum[p] = 0;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[p][i][j];\n\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[p][i][0];\n        for (j = 0; j < n - k; j++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (j = 0; j < n - k; j++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        min = a[p][0][j];\n        for (i = 0; i < n - k; i++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (i = 0; i < n - k; i++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      sum[p] = sum[p] + a[p][1][1];\n\n      for (i = 1; i < n - k; i++)\n        a[p][i][0] = a[p][i + 1][0];\n      for (j = 1; j < n - k; j++)\n        a[p][0][j] = a[p][0][j + 1];\n      for (i = 1; i < n - k; i++)\n        for (j = 1; j < n - k; j++)\n          a[p][i][j] = a[p][i + 1][j + 1];\n    }\n  }\n\n  for (p = 0; p < n - 1; p++)\n    cout << sum[p] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "32378", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0, r_small[100] = {0}, c_small[100] = {0};\n\nint fun(int num[][100], int n);\n\nvoid small1(int num[][100], int n);\n\nvoid small2(int num[][100], int n);\n\nint main() {\n  int n, i, j, num[100][100];\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    fun(num, n);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n\nint fun(int num[][100], int n) {\n  if (n == 1)\n    return sum;\n  int i, j;\n  small1(num, n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - r_small[i];\n  small2(num, n);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - c_small[j];\n  sum += num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      num[i][j] = num[i + 1][j];\n  fun(num, n - 1);\n}\n\nvoid small1(int num[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    r_small[i] = num[i][0];\n    for (j = 1; j < n; j++)\n      r_small[i] = (r_small[i] < num[i][j]) ? r_small[i] : num[i][j];\n  }\n}\n\nvoid small2(int num[][100], int n) {\n  int i, j;\n  for (j = 0; j < n; j++) {\n    c_small[j] = num[0][j];\n    for (i = 1; i < n; i++)\n      c_small[j] = (c_small[j] < num[i][j]) ? c_small[j] : num[i][j];\n  }\n}\n"}
{"label": "18", "index": "32379", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], sum = 0;\n\nint minr(int u, int n) {\n  int i, minn = a[u][1];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[u][i])\n      minn = a[u][i];\n  }\n  return minn;\n}\n\nint minc(int v, int n) {\n  int i, minn = a[1][v];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[i][v])\n      minn = a[i][v];\n  }\n  return minn;\n}\n\nvoid f2(int n) {\n  int u, v;\n  for (u = 2; u <= n - 1; u++) {\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u + 1][v];\n    }\n  }\n  for (v = 2; v <= n - 1; v++) {\n    for (u = 1; u <= n; u++)\n      a[u][v] = a[u][v + 1];\n  }\n  return;\n}\n\nvoid f1(int n) {\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  }\n  int u, v;\n\n  for (u = 1; u <= n; u++) {\n    int temp = minr(u, n);\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n\n  for (v = 1; v <= n; v++) {\n    int temp = minc(v, n);\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n  sum = sum + a[2][2];\n  f2(n);\n  f1(n - 1);\n}\n\nint main() {\n  int n, i, u, v;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (u = 1; u <= n; u++) {\n      for (v = 1; v <= n; v++) {\n        cin >> a[u][v];\n      }\n    }\n    f1(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint smaller(int, int);\n\nint main() {\n  int n, a[101][101], i, j, k, min, count;\n  cin >> n;\n  count = n;\n  for (k = 1; k <= count; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << sum << endl;\n    n = count;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, total;\n  cin >> n;\n  int a[n][n];\n  int numbers = n;\n  for (k = 0; k < numbers; k++) {\n    total = 0;\n    for (i = 0; i < numbers; i++)\n      for (j = 0; j < numbers; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (n = numbers; n > 1; n--) {\n      for (i = 0; i < n; i++) {\n        int temp = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] -= temp;\n      }\n      for (j = 0; j < n; j++) {\n        int temp = a[0][j];\n        for (i = 1; i < n; i++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] -= temp;\n      }\n      total += a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, r;                   \n  int mat[100][100];          \n  cin >> n;                   \n  for (int a = 0; a < n; a++) \n  {\n    int sum = 0;                \n    r = n;                      \n    for (int b = 0; b < n; b++) \n    {\n      for (int c = 0; c < n; c++) {\n        cin >> mat[b][c];\n      }\n    }\n    for (int d = 0; d < n - 1; d++) \n    {\n      int minh[100], minl[100];   \n      for (int d = 0; d < r; d++) \n      {\n        minh[d] = 9999999;\n        minl[d] = 9999999;\n      }\n      for (int e = 0; e < r; e++) \n      {\n        for (int f = 0; f < r; f++) {\n          if (minh[e] > mat[e][f]) {\n            minh[e] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) \n      {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minh[g];\n        }\n      }\n      for (int e = 0; e < r; e++) \n      {\n        for (int f = 0; f < r; f++) {\n          if (minl[f] > mat[e][f]) {\n            minl[f] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) \n      {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minl[h];\n        }\n      }\n      sum += mat[1][1];               \n      for (int g = 1; g < r - 1; g++) \n      {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] = mat[g + 1][h];\n        }\n      }\n      for (int h = 1; h < r - 1; h++) \n      {\n        for (int g = 0; g < r - 1; g++) {\n          mat[g][h] = mat[g][h + 1];\n        }\n      }\n      r--; \n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, min, sum = 0, num = 0;\n  int a[101][101];\n  int minr[101];\n  int minc[101];\n  scanf(\"%d \", &n);\n\n  for (k = 1, num = 0, sum = 0; k <= n; k++) {\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    num = 0;\n    sum = 0;\n    while (num < n - 1) {\n      memset(minr, 0, 101 * 4);\n      memset(minc, 0, 101 * 4);\n      for (i = 1; i <= n - num; i++) {\n        min = a[i][1];\n        for (j = 1; j <= n - num; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        minr[i] = min;\n      }\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 1; j <= n - num; j++) {\n          a[i][j] = a[i][j] - minr[i];\n        }\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        min = a[1][j];\n        for (i = 1; i <= n - num; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minc[j] = min;\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        for (i = 1; i <= n - num; i++) {\n          a[i][j] = a[i][j] - minc[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 2; j <= n - num - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 1; j <= n - num - 1; j++) {\n        for (i = 2; i <= n - num - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n\n      num++;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid min(int a[100][100], int);\nvoid newa(int a[100][100], int);\nint main() {\n  int i, j, k, n, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    min(a, n);\n  }\n  return 0;\n}\nvoid min(int a[][100], int n) {\n  int i, j, k, m, x, y, sum = 0;\n  for (m = n; m > 1; m--) {\n    for (i = 0; i < m; i++) {\n      x = a[i][0];\n      for (j = 1; j < m; j++) {\n        if (x > a[i][j])\n          x = a[i][j];\n      }\n      for (k = 0; k < m; k++) {\n        a[i][k] -= x;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      y = a[0][i];\n      for (j = 1; j < m; j++) {\n        if (y > a[j][i])\n          y = a[j][i];\n      }\n      for (k = 0; k < m; k++) {\n        a[k][i] -= y;\n      }\n    }\n    sum += a[1][1];\n    newa(a, m);\n  }\n  cout << sum << endl;\n}\nvoid newa(int a[][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[j - 1][i] = a[j][i];\n}\n"}
{"label": "18", "index": "32385", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint a[100][100];\nint main() {\n  void G(int n); \n  void X(int n);\n  int n, i, j, k, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) \n    {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = n; i >= 2; i--) \n    {\n      G(i);\n      sum += a[1][1];\n      X(i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid G(int n) \n{\n  int i, j, p;\n  for (i = 0; i < n; i++) {\n    p = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < p)\n        p = a[i][j]; \n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= p; \n  }\n  for (i = 0; i < n; i++) {\n    p = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < p)\n        p = a[j][i]; \n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= p; \n  }\n}\n\nvoid X(int n) \n{\n  int i, j;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 1; i <= n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n"}
{"label": "18", "index": "32386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, min, sum = 0;\n  int i, j, k, q;\n  scanf(\"%d\", &n);\n  int **a = (int **)calloc(n, sizeof(int *));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      a[i] = (int *)calloc(n, sizeof(int));\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] > m)\n          m = a[i][j];\n      }\n    }\n    min = m;\n    for (q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - q; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      for (j = 0; j < n - q; j++) {\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - q; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      sum = a[1][1] + sum;\n      for (i = 0; i < n - q; i++) {\n        for (j = 1; j < n - q - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 1; i < n - q - 1; i++) {\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d \", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n}\nint sum(int n) {\n  int i, j;\n  guiling(n);\n  int m;\n  if (n == 2)\n    return a[1][1];\n  m = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return m + sum(n - 1);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, x, y, min, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (x = 0; x < n; x++) {\n      for (y = 0; y < n; y++) {\n        scanf(\"%d\", &a[x][y]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      for (x = 0; x < j; x++) {\n        min = a[x][0];\n        for (y = 1; y < j; y++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (y = 0; y < j; y++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (y = 0; y < j; y++) {\n        min = a[0][y];\n        for (x = 1; x < j; x++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (x = 0; x < j; x++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (k = 2; k < j; k++) {\n        a[0][k - 1] = a[0][k];\n      }\n      for (k = 2; k < j; k++) {\n        a[k - 1][0] = a[k][0];\n      }\n      sum = sum + a[1][1];\n      for (x = 2; x < j; x++) {\n        for (y = 2; y < j; y++) {\n          a[x - 1][y - 1] = a[x][y];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\n\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int h, w, mw, mh, i, j;\n  for (i = 1; i <= n; ++i) {\n    mw = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[i][h] < mw)\n        mw = a[i][h];\n    for (h = 1; h <= n; ++h)\n      a[i][h] -= mw;\n  }\n  for (i = 1; i <= n; ++i) {\n    mh = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[h][i] < mh)\n        mh = a[h][i];\n    for (h = 1; h <= n; ++h)\n      a[h][i] -= mh;\n  }\n  w = a[2][2];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j <= n; ++j)\n      a[i][j] = a[i + 1][j];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j < n; ++j)\n      a[j][i] = a[j][i + 1];\n  return w + f(n - 1);\n}\n\nint main() {\n  int n, i, i1, i2;\n  cin >> n;\n  for (i = 1; i <= n; ++i) {\n    for (i1 = 1; i1 <= n; ++i1)\n      for (i2 = 1; i2 <= n; ++i2)\n        cin >> a[i1][i2];\n    printf(\"%d\\n\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], n, j, k, p, min, count1 = 0, l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    count1 = 0;\n    l = 0;\n    for (j = 0; j < n; j++)\n      for (p = 0; p < n; p++)\n        cin >> *(*(s + j) + p);\n    for (k = 1; k < n; k++) {\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s + j) + 0);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + j) + p) < min)\n            min = *(*(s + j) + p);\n        }\n        for (p = 0; p < n - l; p++) {\n          *(*(s + j) + p) = *(*(s + j) + p) - min;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s) + j);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + p) + j) < min)\n            min = *(*(s + p) + j);\n        }\n\n        for (p = 0; p < n - l; p++) {\n          *(*(s + p) + j) = *(*(s + p) + j) - min;\n        }\n      }\n      count1 += (*(*(s + 1) + 1));\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + j) + p) = *(*(s + j) + p + 1);\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + p) + j) = *(*(s + p + 1) + j);\n      l++;\n    }\n    cout << count1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[101][101], n;\nint ans = 0;\nint findm(int x, int y);\nint findn(int x, int y);\nint main() {\n  int i, j, k;\n  int a, b, m, minm, temp[101][101];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; ++k) {\n    ans = 0;\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        cin >> array_1[i][j];\n      }\n    }\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; ++i) {\n        minm = findm(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[i][j] -= minm;\n        }\n      }\n      for (i = 0; i < m; ++i) {\n        minm = findn(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[j][i] -= minm;\n        }\n      }\n      ans += array_1[1][1];\n      memset(temp, 0, sizeof(temp));\n      a = 0;\n      b = 0;\n      for (i = 0; i < m; ++i) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < m; ++j) {\n          if (j == 1)\n            continue;\n          temp[a][b] = array_1[i][j];\n          b++;\n        }\n        a++;\n        b = 0;\n      }\n      memset(array_1, 0, sizeof(array_1));\n      for (i = 0; i < a; ++i) {\n        for (j = 0; j < a; ++j)\n          array_1[i][j] = temp[i][j];\n      }\n      m--;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\nint findm(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[x][i] < minn)\n      minn = array_1[x][i];\n  return minn;\n}\nint findn(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[i][x] < minn)\n      minn = array_1[i][x];\n  return minn;\n}\n"}
{"label": "18", "index": "32392", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110], b[110];\n  int(*ju)[110] = a;\n  int num1, num, i, j, m, sum = 0, *min = b;\n  cin >> num1;\n  for (m = 0; m < num1; m++) {\n    num = num1;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++)\n        cin >> *(*(ju + i) + j);\n    while (num > 1) {\n\n      for (i = 0; i < num; i++) {\n        *(min + i) = 10000;\n        for (j = 0; j < num; j++)\n          if (*(*(ju + i) + j) < *(min + i))\n            *(min + i) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + i);\n\n      for (j = 0; j < num; j++) {\n        *(min + j) = 10000;\n        for (i = 0; i < num; i++)\n          if (*(*(ju + i) + j) < *(min + j))\n            *(min + j) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + j);\n\n      sum = sum + *(*(ju + 1) + 1);\n\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num - 1; j++) {\n          if (j >= 1) {\n            *(*(ju + i) + j) = *(*(ju + i) + j + 1);\n          }\n        }\n      }\n\n      for (j = 0; j < num - 1; j++) {\n        for (i = 0; i < num - 1; i++) {\n          if (i >= 1)\n            *(*(ju + i) + j) = *(*(ju + i + 1) + j);\n        }\n      }\n\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, s, a[101][101];\nvoid guiling(int i, int j, int x, int y) {\n  if (i == m || j == m)\n    return;\n  if (a[i][j] < s)\n    s = a[i][j];\n  guiling(i + x, j + y, x, y);\n  a[i][j] -= s;\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, l;\n  cin >> n;\n  l = n;\n  while (l > 0) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int sum = 0;\n    for (m = n; m > 0; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        if (i < m) {\n          s = 1000;\n          guiling(i, 0, 0, 1);\n        } else {\n          s = 1000;\n          guiling(0, i - m, 1, 0);\n        }\n      }\n      sum += a[1][1];\n      xiaojian();\n    }\n    cout << sum << endl;\n    l--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint hang(int a[], int n, int h) {\n  int m = a[0];\n  for (int i = h; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return (m);\n}\nint lie(int a[][110], int n, int j, int h) {\n  int m = a[0][j];\n  for (int i = h; i < n; i++)\n    if (a[i][j] < m)\n      m = a[i][j];\n  return (m);\n}\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int i, j, h, s = 0, hm, lm, a[110][110] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (h = 1; h < n; h++) {\n      hm = hang(a[0], n, h);\n      a[0][0] -= hm;\n      for (j = h; j < n; j++)\n        a[0][j] -= hm;\n      for (i = h; i < n; i++) {\n        hm = hang(a[i], n, h);\n        a[i][0] -= hm;\n        for (j = h; j < n; j++)\n          a[i][j] -= hm;\n      }\n      lm = lie(a, n, 0, h);\n      a[0][0] -= lm;\n      for (i = h; i < n; i++)\n        a[i][0] -= lm;\n      for (j = h; j < n; j++) {\n        lm = lie(a, n, j, h);\n        a[0][j] -= lm;\n        for (i = h; i < n; i++)\n          a[i][j] -= lm;\n      }\n      s += a[h][h];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32395", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n\n  int min = *(*(a + hang) + 1);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + hang) + i) < min)\n      min = *(*(a + hang) + i);\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = *(*(a + 1) + lie);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + i) + lie) < min)\n      min = *(*(a + i) + lie);\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + mm) + i) = *(*(a + mm) + i) - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + i) + mm) = *(*(a + i) + mm) - Minlie;\n      }\n\n      sum += *(*(a + 2) + 2);\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + ii) + i - 1) = *(*(a + ii) + i);\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + i - 1) + ii) = *(*(a + i) + ii);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32396", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint g_a;\nint g_Matrix[100][100];\n\nint Operation(int);\nvoid lineDel(int);\nvoid rowDel(int);\nvoid Transform(int);\n\nvoid lineDel(int times)\n\n{\n  int i, j, min, post;\n  for (i = 1; i <= times; i++) {\n    min = g_Matrix[i][1];\n    post = 1;\n    for (j = 1; j <= times; j++) {\n      if (g_Matrix[i][j] < min) {\n        min = g_Matrix[i][j];\n        post = j;\n      }\n    }\n    g_Matrix[0][j] = 0;\n    for (j = 1; j <= times; j++)\n      g_Matrix[i][j] -= min;\n  }\n}\n\nvoid rowDel(int times)\n\n{\n  int i, j, min, post;\n  for (j = 1; j <= times; j++) {\n    if (g_Matrix[0][j]) {\n      min = g_Matrix[1][j];\n      post = 1;\n      for (i = 1; i <= times; i++) {\n        if (g_Matrix[i][j] < min) {\n          min = g_Matrix[i][j];\n          post = i;\n        }\n      }\n      for (i = 1; i <= times; i++)\n        g_Matrix[i][j] -= min;\n    }\n  }\n}\n\nvoid Transform(int times)\n\n{\n  int i, j;\n  for (i = 1; i <= times; i++) {\n    for (j = 1; j <= times; j++) {\n      if (i == 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i][j + 1];\n      if (j == 1 && i > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j];\n      if (i > 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j + 1];\n    }\n  }\n}\n\nint Operation(int times)\n\n{\n  int j, num;\n  if (times != 1) {\n    for (j = 1; j <= times; j++)\n      g_Matrix[0][j] = 1;\n    lineDel(times);\n    rowDel(times);\n    num = g_Matrix[2][2];\n    Transform(times - 1);\n    return num + Operation(times - 1);\n  } else\n    return 0;\n}\n\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  g_a = n;\n  while (n--) {\n    for (i = 1; i <= g_a; i++)\n      for (j = 1; j <= g_a; j++)\n        cin >> g_Matrix[i][j];\n    cout << Operation(g_a) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32397", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid matrix_down(int a[150][150], int large) {\n  int v, r;\n  for (v = 0; v <= large - 1; v++) {\n    int minl;\n    minl = a[v][0];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[v][r] <= minl) {\n        minl = a[v][r];\n      }\n      if (a[v][r] == 0) {\n        minl = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[v][r] = a[v][r] - minl;\n    }\n  }\n  for (v = 0; v <= large - 1; v++) {\n    int minr;\n    minr = a[0][v];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[r][v] <= minr) {\n        minr = a[r][v];\n      }\n      if (a[r][v] == 0) {\n        minr = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[r][v] = a[r][v] - minr;\n    }\n  }\n}\n\nvoid matrix_short(int a[150][150], int large) {\n  int i, r;\n  for (i = 1; i <= large - 2; i++) {\n    for (r = 1; r <= large - 2; r++) {\n      a[i][r] = a[i + 1][r + 1];\n    }\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n\nint main() {\n  int n, i, u, v, r, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[150][150] = {0};\n    int sum = 0;\n    for (u = 0; u <= n - 1; u++) {\n      for (v = 0; v <= n - 1; v++) {\n        cin >> a[u][v];\n      }\n    }\n    for (u = n; u >= 2; u--) {\n      matrix_down(a, u);\n      sum = a[1][1] + sum;\n      matrix_short(a, u);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0};\nint n;\nint count1 = 0;\nint (*p)[100] = NULL;\nint deal();\nint main() {\n  int i, j, k;\n  cin >> n;\n  p = a;\n  for (k = 0; k < n; k++) {\n    count1 = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    deal();\n  }\n  return 0;\n}\nint deal() {\n  int min;\n  int i, j, k;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < n; i++) {\n      min = *(*(p + i));\n      for (j = 0; j < n; j++)\n        if (*(*(p + i) + j) < min)\n          min = *(*(p + i) + j);\n\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      for (i = 0; i < n; i++)\n        if (*(*(p + i) + j) < min)\n          min = *(*(p + i) + j);\n\n      for (i = 0; i < n; i++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    count1 += *(*(p + 1) + 1);\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++) {\n        *(*(p + i) + j) = *(*(p + i + 1) + j);\n      }\n    for (j = 1; j < n - 1; j++)\n      for (i = 0; i < n; i++) {\n        *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n  }\n  cout << count1 << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32399", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h, n;\n  scanf(\"%d\\n\", &n);\n  for (h = 1; h <= n; h++) {\n    int i, j, k, t, sum = 0, a[105][105];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\" %d\", &a[i][j]);\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        k = a[i][0];\n        for (j = 1; j < t; j++) {\n          if (a[i][j] < k)\n            k = a[i][j];\n        }\n        for (j = 0; j < t; j++)\n          a[i][j] -= k;\n      }\n      for (i = 0; i < t; i++) {\n        k = a[0][i];\n        for (j = 1; j < t; j++) {\n          if (a[j][i] < k)\n            k = a[j][i];\n        }\n        for (j = 0; j <= t; j++)\n          a[j][i] -= k;\n      }\n      sum += a[1][1];\n      for (j = 2; j < t; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < t; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i <= t; i++)\n        for (j = 2; j <= t; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[105][105], s, min = 10000, sum = 0;\n  cin >> n;\n  s = n;\n  for (int g = 1; g <= n; g++) {\n    sum = 0;\n    s = n;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        scanf(\"%d \", &m[i][j]);\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[i][j] < min)\n            min = m[i][j];\n        for (int j = 1; j <= s; j++)\n          m[i][j] = m[i][j] - min;\n      }\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[j][i] < min)\n            min = m[j][i];\n        for (int j = 1; j <= s; j++)\n          m[j][i] = m[j][i] - min;\n      }\n      sum = sum + m[2][2];\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s; j++) {\n          m[i][j] = m[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s - 1; j++)\n          m[j][i] = m[j][i + 1];\n      }\n      s = s - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32401", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0;\n  for (int ii = 0; ii < n; ii++) {\n    sum = 0;\n    int a[100][100];\n    for (int i2 = 0; i2 < n; i2++)\n      for (int i3 = 0; i3 < n; i3++)\n        cin >> a[i2][i3];\n\n    for (int i = 1; i < n; i++) {\n      int min1;\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j][j2]);\n        min1 = min(min1, a[j][0]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j][j2] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[0][j]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[0][j2] -= min1;\n\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j2][j]);\n        min1 = min(min1, a[0][j]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j2][j] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[j][0]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[j2][0] -= min1;\n\n      sum += a[i][i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32402", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int min, n, i, j, ans, t;\n  int a[101][101];\n\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[i][j] < min))\n            min = a[i][j];\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[j][i] < min))\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      ans = ans + a[1][1];\n\n      for (i = 1; i < t - 1; i++)\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 0; i < t - 1; i++)\n        for (j = 1; j < t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32403", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m[100][100], min = 100000, sum = 0, r;\n  int(*p)[100];\n  int n;\n  cin >> n;\n  p = m;\n  int i, j;\n  int time;\n  for (time = 1; time <= n; time++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> m[i][j];\n      }\n    }\n    for (r = n; r > 1; r--) {\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + j) + i) -= min;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (j = 0; j < r; j++) {\n\n        for (i = 2; i < r; i++) {\n          *(*(p + j) + i - 1) = *(*(p + j) + i);\n        }\n      }\n      for (j = 2; j < r; j++) {\n        for (i = 0; i < r; i++) {\n          *(*(p + j - 1) + i) = *(*(p + j) + i);\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32404", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i = 0;\n  while (i < n) {\n    int a[n][n];\n    int b[n], c[n];\n    int t = 1;\n    int j, k;\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    while (t < n) {\n      for (j = 0; j < n; j++) {\n        if (a[j][0] < 0)\n          j++;\n        b[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (b[j] > a[j][k] && a[j][k] >= 0)\n            b[j] = a[j][k];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (a[j][k] >= 0) {\n            a[j][k] = a[j][k] - b[j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        if (a[0][j] < 0)\n          j++;\n        c[j] = a[0][j];\n        for (k = 0; k < n; k++) {\n          if (c[j] > a[k][j] && a[k][j] >= 0)\n            c[j] = a[k][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (a[k][j] >= 0) {\n            a[k][j] = a[k][j] - c[j];\n          }\n      }\n      sum = sum + a[t][t];\n      for (j = 0; j < n; j++) {\n        a[t][j] = -1;\n        a[j][t] = -1;\n      }\n      t++;\n    }\n    i++;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32405", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100];\n  int i, j, k, c, d, l, sum[100] = {0}, min1, min2;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - l; j++) {\n\n          if (a[i][j] < min1)\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - l; j++) {\n          a[i][j] = a[i][j] - min1;\n        }\n      }\n\n      for (j = 0; j < n - l; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - l; i++) {\n\n          if (a[i][j] < min2)\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - l; i++) {\n          a[i][j] = a[i][j] - min2;\n        }\n      }\n\n      sum[k] = sum[k] + a[1][1];\n      if (l == n - 2)\n        break;\n      else {\n        for (c = 0; c < n - l; c++) {\n          for (d = 2; d < n - l; d++)\n            a[c][d - 1] = a[c][d];\n        }\n        for (c = 2; c < n - l; c++) {\n          for (d = 0; d < (n - 1 - l); d++)\n            a[c - 1][d] = a[c][d];\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32406", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sum = 0, s[100][100], i, t, j, m, n, k, min;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &s[j][k]);\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[k][0];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[k][t] < min)\n              min = s[k][t];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[k][t] -= min;\n          }\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[0][k];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[t][k] < min)\n              min = s[t][k];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[t][k] -= min;\n          }\n        }\n      }\n      sum += s[j][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, sum, min;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i - 1][j] = a[i][j];\n      for (j = 2; j < k; j++)\n        for (i = 0; i < k - 1; i++)\n          a[i][j - 1] = a[i][j];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min;\n  int a[103][103];\n  cin >> n;\n  for (int count = 1; count <= n; count++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int n0 = n, sum = 0;\n    while (n0 >= 2) {\n      for (i = 0; i < n0; i++) {\n        min = a[i][0];\n        for (j = 1; j < n0; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n0; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n0; j++) {\n        min = a[0][j];\n        for (i = 1; i < n0; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n0; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < n0; i++)\n        for (j = 0; j < n0; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n0; j++)\n        for (i = 0; i < n0; i++)\n          a[i][j] = a[i][j + 1];\n      n0--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32409", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum, n;\nvoid r2z(int a[][100], int n);\nvoid sub(int a[][100], int n);\n\nint main() {\n  int i, row, col, a[100][100] = {0};\n  scanf(\"%d \", &n);\n  int m = n;\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    n = m;\n    for (row = 0; row < m; row++)\n      for (col = 0; col < m; col++) {\n        scanf(\"%d \", &a[row][col]);\n      }\n    r2z(a, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid r2z(int a[][100], int n) {\n  int i, j, min[100];\n  for (i = 0; i < n; i++) {\n    min[i] = 10000;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = 10000;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j];\n    }\n  }\n  sum += a[1][1];\n  sub(a, n);\n}\n\nvoid sub(int a[][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n--;\n  if (n > 1)\n    r2z(a, n);\n}\n"}
{"label": "18", "index": "32410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], sum = 0, p = 1, z, k, w, l, min;\n  int i, j, n;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (z = 0; z < n - 1; z++) {\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (k = 0; k < n; k++)\n          a[i][k] -= min;\n      }\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (k = 0; k < n; k++)\n          a[k][i] -= min;\n      }\n      sum += a[p][p];\n      for (l = 0; l < n; l++)\n        a[l][p] = 100000;\n      for (l = 0; l < n; l++)\n        a[p][l] = 100000;\n      p++;\n    }\n    cout << sum << endl;\n    p = 1;\n    sum = 0;\n    memset(a, 1000000, sizeof(a));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int n, i, j, t, min, count = 0, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    count = 0;\n    for (t = n; t >= 2; t--) {\n      for (i = 1; i <= t; i++) {\n        min = a[i][1];\n        for (j = 1; j <= t; j++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (j = 1; j <= t; j++)\n          a[i][j] -= min;\n      }\n      for (j = 1; j <= t; j++) {\n        min = a[1][j];\n        for (i = 1; i <= t; i++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (i = 1; i <= t; i++)\n          a[i][j] -= min;\n      }\n      count += a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 2; j <= t - 1; j++)\n        for (i = 1; i <= t - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32412", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint tozero(int n);\nvoid delete1(int, int);\nvoid delete2(int, int);\nvoid movea(int);\nint a[100][100], sum = 0;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 99; j++)\n      for (k = 0; k <= 99; k++)\n        *(*(a + j) + k) = 0;\n    int r, l, lim = 99;\n    char c;\n\n    for (r = 0; r < n; r++)\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(a + r) + l);\n      }\n    sum = tozero(r);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\nvoid delete1(int r, int n) {\n  int min = *(*(a + r) + 0), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + r) + j) < min)\n      min = *(*(a + r) + j);\n  for (j = 0; j < n; j++)\n    *(*(a + r) + j) -= min;\n}\nvoid delete2(int l, int n) {\n  int min = *(*(a + 0) + l), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + j) + l) < min)\n      min = *(*(a + j) + l);\n  for (j = 0; j < n; j++)\n    *(*(a + j) + l) -= min;\n}\nvoid movea(int n) {\n  int i, j, k;\n  for (i = 1; i < n - 1; i++)\n    *(*(a + 0) + i) = *(*(a + 0) + i + 1);\n  for (i = 1; i < n - 1; i++)\n    *(*(a + i) + 0) = *(*(a + i + 1) + 0);\n  for (i = 1; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n}\n\nint tozero(int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    delete1(i, n);\n  for (i = 0; i < n; i++)\n    delete2(i, n);\n  sum += *(*(a + 1) + 1);\n  movea(n);\n  if (n >= 3)\n    tozero(n - 1);\n  return sum;\n}\n"}
{"label": "18", "index": "32413", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int n) {\n  if (n == 1) {\n    return 0;\n  }\n  int i, j, p, min, a11;\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < a[i][p]) {\n        p = j;\n      }\n    }\n    min = a[i][p];\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < a[p][i]) {\n        p = j;\n      }\n    }\n    min = a[p][i];\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  a11 = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i - 1] = a[j][i];\n    }\n  }\n  return a11 + sum(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", sum(n));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint p[10000][10000];\nint f(int x) {\n  int min;\n  int k;\n  if (x == 2) {\n    for (int i = 0; i <= 1; i++)\n      if (p[i][0] > p[i][1]) {\n        p[i][0] = p[i][0] - p[i][1];\n        p[i][1] = 0;\n      } else {\n        p[i][1] = p[i][1] - p[i][0];\n        p[i][0] = 0;\n      }\n    for (int i = 0; i <= 1; i++)\n      if (p[0][i] > p[1][i]) {\n        p[0][i] = p[0][i] - p[1][i];\n        p[1][i] = 0;\n      } else {\n        p[1][i] = p[1][i] - p[0][i];\n        p[0][i] = 0;\n      }\n    return p[1][1];\n\n  }\n\n  else {\n    for (int i = 0; i < x; i++) {\n\n      min = p[i][0];\n      for (int j = 0; j < x; j++)\n\n        if (p[i][j] < min)\n          min = p[i][j];\n      for (int j = 0; j < x; j++)\n        p[i][j] = p[i][j] - min;\n    }\n    for (int i = 0; i < x; i++) {\n\n      min = p[0][i];\n      for (int j = 0; j < x; j++)\n\n        if (p[j][i] < min)\n          min = p[j][i];\n      for (int j = 0; j < x; j++)\n        p[j][i] = p[j][i] - min;\n    }\n    k = p[1][1];\n    for (int i = 0; i < x; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[i][j] = p[i][j + 1];\n    for (int i = 0; i < x - 1; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[j][i] = p[j + 1][i];\n    return k + f(x - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int s = 1;\n  for (s = 1; s <= n; s++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &p[i][j]);\n    printf(\"%d\\n\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32415", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint main() {\n  void Subtraction(int[100][100], int);\n  int n = 0;\n  cin >> n;\n  int a[100][100];\n  for (int f = 1; f <= n; f++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    Subtraction(a, n);\n    if (f == n)\n      cout << sum;\n    else\n      cout << sum << endl;\n  }\n  return 0;\n}\nvoid Subtraction(int m[100][100], int n) {\n\n  if (n != 1) {\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[i][0];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[i][j])\n          min = m[i][j];\n      }\n      for (int j = 0; j <= n - 1; j++)\n        m[i][j] -= min;\n    }\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[0][i];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[j][i])\n          min = m[j][i];\n      }\n      for (int j = 0; j <= n - 1; j++) {\n        m[j][i] -= min;\n      }\n    }\n\n    sum += m[1][1];\n    int mtuta[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      if (i == 1)\n        continue;\n      for (int j = 0; j <= n - 1; j++) {\n        if (j == 1)\n          continue;\n\n        mtuta[i - (i != 0)][j - (j != 0)] = m[i][j];\n      }\n    }\n    Subtraction(mtuta, n - 1);\n  }\n}\n"}
{"label": "18", "index": "32416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, n;\n  int rowMin, colMin;\n  int x;\n  int first;\n  int sum;\n  int flag;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n\n    sum = 0;\n\n    for (x = n; x > 1; x--) {\n\n      for (i = 0; i < x; i++) {\n        first = 1;\n        flag = 0;\n        for (j = 0; j < x; j++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              rowMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < rowMin)\n              rowMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (j = 0; j < x; j++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - rowMin;\n          }\n        }\n      }\n\n      for (j = 0; j < x; j++) {\n        first = 1;\n        flag = 0;\n        for (i = 0; i < x; i++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              colMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < colMin)\n              colMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (i = 0; i < x; i++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - colMin;\n          }\n        }\n      }\n\n      sum = sum + a[1][1];\n\n      i = 0;\n      for (j = 2; j < x; j++)\n        a[i][j - 1] = a[i][j];\n      j = 0;\n      for (i = 2; i < x; i++)\n        a[i - 1][j] = a[i][j];\n      for (i = 2; i < x; i++) {\n        for (j = 2; j < x; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, b, j, k, a, su[100][100], result;\n  scanf(\"%d\", &n);\n  b = n;\n  for (i = 0; i < n; i++) {\n    result = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &su[j][k]);\n\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        a = su[j][0];\n        for (k = 0; k < n; k++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          su[j][k] -= a;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        a = su[0][k];\n        for (j = 0; j < n; j++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          su[j][k] -= a;\n        }\n      }\n      result += su[1][1];\n      for (j = 0; j < n - 1; j++) {\n        for (k = 0; k < n - 1; k++) {\n          if (j == 0 && k > 0)\n            su[j][k] = su[j][k + 1];\n          else if (k == 0 && j > 0)\n            su[j][k] = su[j + 1][k];\n          else if (j > 0 && k > 0)\n            su[j][k] = su[j + 1][k + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", result);\n    n = b;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32418", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0;\nint juzhen[101][101] = {0}, sum = 0, hang = 0;\nvoid hangxiao();\nvoid liexiao();\nvoid xiaojian();\nvoid hangxiao() {\n  int i, j, xiao = 1000;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (j = 0; j < hang; j++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid liexiao() {\n  int i, j, xiao = 1000;\n  for (j = 0; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid xiaojian() {\n  int i, j, xiao = 0;\n  for (i = 2; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      juzhen[i - 1][j] = juzhen[i][j];\n    }\n  }\n  for (j = 2; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j - 1] = juzhen[i][j];\n    }\n  }\n}\n\nint main() {\n  int a;\n  cin >> a;\n  n = a;\n\n  while (a > 0) {\n    memset(juzhen, 0, sizeof(juzhen));\n    sum = 0;\n    int b, c, d, e, i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    hang = n;\n    while (hang > 1) {\n      hangxiao();\n      liexiao();\n      sum += juzhen[1][1];\n      xiaojian();\n      hang--;\n    }\n    printf(\"%d\\n\", sum);\n    a--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen[101][101][101] = {0};\nint guiling(int m, int n) {\n  int i, j, k = n, result = 0, num[101][101] = {0}, min[101] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      num[i][j] = juzhen[m][i][j];\n    }\n  }\n  while (k > 1) {\n    for (i = 0; i < k; i++) {\n      min[i] = 10000;\n      for (j = 0; j < k; j++) {\n        if (num[i][j] <= min[i])\n          min[i] = num[i][j];\n      }\n    }\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i][j] - min[i];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      min[j] = 10000;\n      for (i = 0; i < k; i++) {\n        if (num[i][j] <= min[j])\n          min[j] = num[i][j];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j] - min[j];\n      }\n    }\n    result = result + num[1][1];\n    for (i = 1; i < k - 1; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i + 1][j];\n      }\n    }\n    for (j = 1; j < k - 1; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j + 1];\n      }\n    }\n    k--;\n  }\n  return result;\n}\nint main() {\n  int i, j, k, p;\n  cin >> p;\n  for (k = 0; k < p; k++) {\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < p; j++) {\n        cin >> juzhen[k][i][j];\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    int answer = 0;\n    answer = guiling(i, p);\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a1[100][100];\nint xiao(int n) {\n  int sum = 0;\n  if (n == 2) {\n    for (int i = 0; i < n; i++) {\n      int min = 1000;\n      for (int j = 0; j < n; j++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a1[i][j] = a1[i][j] - min;\n    } \n    for (int j = 0; j < n; j++) {\n      int min = 1000;\n      for (int i = 0; i < n; i++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a1[i][j] = a1[i][j] - min;\n    }\n\n    return a1[1][1];\n  }\n\n  for (int i = 0; i < n; i++) {\n    int min = 1000;\n    for (int j = 0; j < n; j++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a1[i][j] = a1[i][j] - min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = 1000;\n    for (int i = 0; i < n; i++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int i = 0; i < n; i++)\n      a1[i][j] = a1[i][j] - min;\n  }\n  \n  \n  sum += a1[1][1];\n  \n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (j == 1)\n        continue;\n      if (j < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i][j - 1] = a1[i][j];\n    }\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      if (i == 1)\n        continue;\n      if (i < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i - 1][j] = a1[i][j];\n    }\n  sum += xiao(n - 1);\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n\n  for (int k = 0; k < n; k++) {\n\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a1[i][j];\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[105][105]; \nint f(int n) {\n  int i, j;\n  int r = 0, l = 0; \n  if (n == 1)\n    return 0;                 \n  else {                      \n    for (i = 0; i < n; i++) { \n      r = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (r > a[i][j])\n          r = a[i][j];\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - r;\n      }\n    }\n    for (j = 0; j < n; j++) { \n      l = a[0][j];\n      for (i = 1; i < n; i++) {\n        if (l > a[i][j])\n          l = a[i][j];\n      }\n      for (i = 0; i < n; i++) {\n        a[i][j] = a[i][j] - l;\n      }\n    }\n    int m;\n    m = a[1][1];            \n    for (i = 0; i < n; i++) \n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 0; j < n; j++)\n      for (i = 1; i < n - 1; i++)\n        a[i][j] = a[i + 1][j];\n    return m + f(n - 1); \n  }\n}\nint main() { \n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    int sum = 0;\n    sum = f(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32422", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    int sum = 0;\n    int t[101][101] = {0};\n    for (j = 0; j < n; ++j) {\n      for (k = 0; k < n; ++k) {\n        cin >> t[j][k];\n      }\n    }\n\n    int cnt = n;\n    while (cnt > 1) {\n      for (j = 0; j < cnt; ++j) {\n        int min = t[j][0];\n        for (k = 1; k < cnt; ++k) {\n          if (t[j][k] < min)\n            min = t[j][k];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[j][k] -= min;\n        }\n      }\n\n      for (j = 0; j < cnt; ++j) {\n        int min = t[0][j];\n        for (k = 1; k < cnt; ++k) {\n          if (t[k][j] < min)\n            min = t[k][j];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[k][j] -= min;\n        }\n      }\n\n      sum += t[1][1];\n\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[j][k] = t[j][k + 1];\n        }\n      }\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[k][j] = t[k + 1][j];\n        }\n      }\n\n      cnt--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32423", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint minrow(int a[100][100], int i, int m) {\n  int b = a[i][0], j;\n  for (j = 0; j < m; j++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nint mincolumn(int a[100][100], int j, int m) {\n  int b = a[0][j], i;\n  for (i = 0; i < m; i++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nvoid row(int a[100][100], int m) {\n  int i, j, b;\n  for (i = 0; i < m; i++) {\n    b = minrow(a, i, m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid column(int a[100][100], int m) {\n  int i, j, b;\n  for (j = 0; j < m; j++) {\n    b = mincolumn(a, j, m);\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid del(int a[100][100], int m) {\n  int i, j;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nvoid print(int a[100][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      printf(\"%d \", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {0}, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int b = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    m = n;\n    for (j = 0; j < n - 1; j++) {\n      row(a, m);\n      column(a, m);\n      b = b + a[1][1];\n      del(a, m);\n      m--;\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, sum, m;\n  cin >> n;\n  int a[101][101] = {0};\n  m = n;\n  while (m) {\n    m--;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = n; k > 1; k--) {\n\n      for (i = 1; i <= k; i++) {\n        min = 98000;\n        for (j = 1; j <= k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 1; j <= k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 1; i <= k; i++) {\n        min = 98098;\n        for (j = 1; j <= k; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 1; j <= k; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[2][2];\n      if (k >= 3) {\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[i - 1][j] = a[i][j];\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[j][i - 1] = a[j][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, a[101][101], s;\nvoid cal() {\n  int j, k, l, m;\n  for (j = 0; j < n; ++j)\n    for (k = 0; k < n; ++k)\n      cin >> a[j][k];\n  s = 0;\n  for (j = 0; j < n; ++j) {\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[k][l] < a[k][m])\n          m = l;\n      m = a[k][m];\n      for (l = j; l < n; ++l)\n        a[k][l] -= m;\n    }\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[l][k] < a[m][k])\n          m = l;\n      m = a[m][k];\n      for (l = j; l < n; ++l)\n        a[l][k] -= m;\n    }\n    s += a[j + 1][j + 1];\n    for (k = j + 1; k < n; ++k) {\n      a[j + 1][k] = a[j][k];\n      a[k][j + 1] = a[k][j];\n    }\n    a[j + 1][j + 1] = a[j][j];\n  }\n  return;\n}\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; ++i) {\n    cal();\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32426", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[1000][1000];\n  int n, i, j, k;\n\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n\n    int lenth, min, sum;\n    lenth = n - 1;\n    sum = 0;\n    while (lenth >= 1) {\n      for (i = 0; i <= lenth; i++) {\n\n        min = 2147483647;\n        for (j = 0; j <= lenth; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j <= lenth; j++)\n          array[i][j] = array[i][j] - min;\n      }\n      for (j = 0; j <= lenth; j++) {\n\n        min = 2147483647;\n        for (i = 0; i <= lenth; i++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (i = 0; i <= lenth; i++)\n          array[i][j] = array[i][j] - min;\n      }\n      sum = sum + array[1][1];\n\n      for (i = 0; i <= lenth; i++)\n        for (j = 1; j < lenth; j++)\n          array[i][j] = array[i][j + 1];\n      for (j = 0; j <= lenth; j++)\n        for (i = 1; i < lenth; i++)\n          array[i][j] = array[i + 1][j];\n      lenth = lenth - 1;\n    }\n    cout << sum;\n    if (k < n)\n      cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32427", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[100][100];\nint n = 0;\n\nint xiaoling(int a);\n\nint main() {\n  int i, j, sum = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    sum = xiaoling(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint xiaoling(int a) {\n  int i, j, min, temp = 0;\n  if (a == 1)\n    return 0;\n  for (i = 0; i < a; i++) {\n    min = num[i][0];\n    for (j = 0; j < a; j++) {\n      min = (min > num[i][j]) ? num[i][j] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    min = num[0][i];\n    for (j = 0; j < a; j++) {\n      min = (min > num[j][i]) ? num[j][i] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n  }\n  temp = num[1][1];\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[j][i] = num[j + 1][i];\n    }\n  }\n  return temp + xiaoling(a - 1);\n}\n"}
{"label": "18", "index": "32428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum[100] = {0};\n  int a[100][100][100] = {0};\n  int i, j, k, min, t, l;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[k][i][0];\n        for (j = 0; j < n - t; j++)\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        for (j = 0; j < n - t; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        min = a[k][0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n      sum[k] = sum[k] + a[k][1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - 1 - t; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n      for (j = 0; j < n - 1 - t; j++)\n        for (i = 1; i < n - 1; i++)\n          a[k][i][j] = a[k][i + 1][j];\n      t = t + 1;\n    }\n    cout << sum[k] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32429", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\n\nint sum(int n) {\n  int i, j, t;\n  int min[n];\n  if (n != 1) {\n    for (i = 0; i < n; i++) {\n      min[i] = juzhen[i][0];\n      for (j = 0; j < n; j++) {\n        if (juzhen[i][j] < min[i])\n          min[i] = juzhen[i][j];\n      }\n      for (j = 0; j < n; j++)\n        juzhen[i][j] -= min[i];\n    }\n    for (j = 0; j < n; j++) {\n      min[j] = juzhen[0][j];\n      for (i = 0; i < n; i++) {\n        if (juzhen[i][j] < min[j])\n          min[j] = juzhen[i][j];\n      }\n      for (i = 0; i < n; i++)\n        juzhen[i][j] -= min[j];\n    }\n    t = juzhen[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i][j + 1];\n    for (j = 0; j < n - 1; j++)\n      for (i = 1; i < n - 1; i++)\n        juzhen[i][j] = juzhen[i + 1][j];\n    return sum(n - 1) + t;\n  } else\n    return 0;\n}\n\nint main() {\n  int N, I, J, K;\n  cin >> N;\n  for (K = 1; K <= N; K++) {\n    for (I = 0; I < N; I++)\n      for (J = 0; J < N; J++)\n        cin >> juzhen[I][J];\n    cout << sum(N) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32430", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint min2;\nint min1;\nvoid diguihang(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min1 = a[i][0];\n  for (int j = 0; j < n; j++) {\n    if (a[i][j] < min1)\n      min1 = a[i][j];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[i][v] = a[i][v] - min1;\n  }\n  diguihang(i - 1, n, a);\n}\n\nvoid diguilie(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min2 = a[0][i];\n  for (int j = 0; j < n; j++) {\n\n    if (a[j][i] < min2)\n      min2 = a[j][i];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[v][i] = a[v][i] - min2;\n  }\n  diguilie(i - 1, n, a);\n}\n\nint change(int n, int sum, int a[300][300]) {\n  if (n == 1)\n    return sum;\n\n  diguihang(n - 1, n, a);\n  diguilie(n - 1, n, a);\n  sum = sum + a[1][1];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n - 1; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n\n  return change(n - 1, sum, a);\n}\nint main() {\n  int N;\n  int a[300][300];\n  scanf(\"%d \", &N);\n  for (int i = 1; i <= N; i++) {\n    for (int j = 0; j < N; j++)\n      for (int y = 0; y < N; y++) {\n        cin >> a[j][y];\n      }\n    printf(\"%d\\n\", change(N, 0, a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32431", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nq, times, i, j, min, m;\n\n  cin >> nq;\n  const int n = nq;\n  int sum[n];\n  int a[n][n][n];\n  for (times = 0; times < n; times++)\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[times][i][j];\n  for (times = 0; times < n; times++) {\n    sum[times] = 0;\n    for (m = n; m > 1; m--)\n\n    {\n      for (i = 0; i < m; i++)\n\n      {\n        min = a[times][i][0];\n        for (j = 1; j < m; j++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (j = 0; j < m; j++)\n          a[times][i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[times][0][j];\n        for (i = 1; i < m; i++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (i = 0; i < m; i++)\n          a[times][i][j] -= min;\n      }\n      sum[times] += a[times][1][1];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n; j++)\n          a[times][i - 1][j] = a[times][i][j];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n - 1; j++)\n          a[times][j][i - 1] = a[times][j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100] = {0}, i = 0, j = 0, min = 1000;\n  int flag = 0, sum = 0, k = 0, l = 0;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n * n; i++)\n      cin >> a[i / n][i % n];\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - flag; i++) {\n        min = 1000;\n        for (j = 0; j < n - flag; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - flag; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - flag; j++) {\n        min = 1000;\n        for (i = 0; i < n - flag; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - flag; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - flag; i++) {\n        for (j = 1; j < n - 1 - flag; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - flag; j++) {\n        for (i = 1; i < n - 1 - flag; i++)\n          a[i][j] = a[i + 1][j];\n      }\n\n      flag++;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32433", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid ope(int m, int a[][101]) {\n  if (m == 1)\n    return;\n  else {\n    int i, j, q, min = 100000;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[i][q] = a[i][q] - min;\n      }\n      min = 100000;\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[q][i] = a[q][i] - min;\n      }\n      min = 100000;\n    }\n    sum = sum + a[1][1];\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= m - 1; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n      a[0][i - 1] = a[0][i];\n      a[i - 1][0] = a[i][0];\n    }\n    ope(m - 1, a);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[101][101];\n  int i, j, k;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    ope(n, a);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, mat[101][101], tp[101][101], sum = 0;\nvoid cut(int x) {\n  int min;\n  if (x == n - 1)\n    return;\n  else {\n    for (int i = 0; i < n - x; i++) {\n      min = mat[i][0];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[i][j] <= min) {\n          min = mat[i][j];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[i][j] -= min;\n    }\n    for (int i = 0; i < n - x; i++) {\n      min = mat[0][i];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[j][i] <= min) {\n          min = mat[j][i];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[j][i] -= min;\n    }\n    sum += mat[1][1];\n\n    for (int i = 0; i < n - x; i++)\n      mat[1][i] = -1;\n    for (int i = 0; i < n - x; i++)\n      mat[i][1] = -1;\n    tp[0][0] = mat[0][0];\n    for (int i = 2; i < n - x; i++)\n      tp[0][i - 1] = mat[0][i];\n    for (int i = 2; i < n - x; i++) {\n      tp[i - 1][0] = mat[i][0];\n      for (int j = 2; j < n - x; j++)\n        tp[i - 1][j - 1] = mat[i][j];\n    }\n\n    for (int i = 0; i < n - x - 1; i++) {\n      for (int j = 0; j < n - x - 1; j++) {\n        mat[i][j] = tp[i][j];\n      }\n    }\n\n    cut(x + 1);\n  }\n}\nvoid ope() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> mat[i][j];\n    }\n  }\n  sum = 0;\n  cut(0);\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    ope();\n  return 0;\n}\n"}
{"label": "18", "index": "32435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k;\nvoid f(int);\nint a[100][100];\nint s;\nint main() {\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    f(n);\n  }\n  return 0;\n}\n\nvoid f(int m) {\n  for (i = 0; i < m; i++) {\n    int min = 1000;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    int min = 1000;\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  s = s + a[1][1];\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 1; i < m - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  if (m == 2) {\n    printf(\"%d\\n\", s);\n  } else\n    f(m - 1);\n}\n"}
{"label": "18", "index": "32436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, s, a[101][101];\nvoid guiling(int i, int j, int x, int y) {\n  if (i == m || j == m)\n    return;\n  if (a[i][j] < s)\n    s = a[i][j];\n  guiling(i + x, j + y, x, y);\n  a[i][j] -= s;\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, l;\n  cin >> n;\n  l = n;\n  while (l > 0) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = 0;\n    for (m = n; m > 0; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        if (i < m) {\n          s = 1000;\n          guiling(i, 0, 0, 1);\n        } else {\n          s = 1000;\n          guiling(0, i - m, 1, 0);\n        }\n      }\n      sum += a[1][1];\n      xiaojian();\n    }\n    cout << sum << endl;\n    l--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32437", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint calc(int s[][100], int n) {\n  int min;\n  for (int i = 0; i < n; i++) {\n    min = s[i][0];\n    for (int j = 1; j < n; j++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int j = 0; j < n; j++)\n      s[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = s[0][j];\n    for (int i = 1; i < n; i++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int i = 0; i < n; i++)\n      s[i][j] -= min;\n  }\n  return s[1][1];\n}\n\nint main() {\n  int s[100][100];\n  int n, sum, m;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> s[i][j];\n    m = n;\n    sum = 0;\n    for (int order = 1; order < n; order++) {\n      sum += calc(s, m);\n      m--;\n      for (int i = 1; i < n - 1; i++)\n        for (int j = 0; j < n; j++)\n          s[i][j] = s[i + 1][j];\n      for (int j = 1; j < n - 1; j++)\n        for (int i = 0; i < m; i++)\n          s[i][j] = s[i][j + 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\nint n;\n\nint search(int m) {\n  int i, j, k, min;\n  if (m > n)\n    return 0;\n\n  for (i = 1; i <= n; i++)\n    if (a[i][0] != -1) {\n      min = 99999999;\n      for (j = 1; j <= n; j++)\n        if ((a[0][j] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (j = 1; j <= n; j++)\n        if (a[0][j] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n\n  for (j = 1; j <= n; j++)\n    if (a[0][j] != -1) {\n      min = 99999999;\n      for (i = 1; i <= n; i++)\n        if ((a[i][0] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (i = 1; i <= n; i++)\n        if (a[i][0] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n  i = a[m][m];\n  a[m][0] = -1;\n  a[0][m] = -1;\n  return (i + search(m + 1));\n}\nint main() {\n  int i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= n; i++) {\n      a[0][i] = 0;\n      a[i][0] = 0;\n    }\n    printf(\"%d\\n\", search(2));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32439", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid minus_1(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[i][j]) ? m : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= m;\n  }\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[j][i]) ? m : a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= m;\n  }\n}\n\nvoid pr(int a[100][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++)\n      printf(\"%d%c\", a[i][j], (j + 1 == k) ? ' ' : ',');\n  }\n}\n\nvoid lower(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i == 0 && j == 0)\n        a[i][j] = a[i][j];\n      else if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      else if (i > 0 && j == 0)\n        a[i][j] = a[i + 1][j];\n      else if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n}\n\nvoid fff(int n) {\n  int a[100][100] = {0};\n  int i = 0, j, sum;\n\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, sum = 0; i < n; i++) {\n    minus_1(a, n - i);\n    sum += a[1][1];\n    lower(a, n - i);\n  }\n  printf(\"%d \", sum);\n}\n\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i++ < n)\n    fff(n);\n  return 0;\n}\n"}
{"label": "18", "index": "32440", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid hang(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid lie(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i + 1][j];\n  }\n}\nvoid xiaohang(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[i][j]) {\n        min = a[i][j];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid xiaolie(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[j][i]) {\n        min = a[j][i];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100][100] = {{0}};\n  int i, j;\n  int p;\n  for (p = 1; p <= n; p++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int o, sum = 0, m = n;\n    for (o = 1; o <= n - 1; o++) {\n      xiaohang(a, m);\n      xiaolie(a, m);\n      sum += a[2][2];\n      hang(a, m);\n      lie(a, m);\n      m--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) < m)\n      m = *(p + i);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i) = *(p + i) - m;\n  if (k > 1)\n    f1(p + 100, n, (k - 1));\n}\nvoid f2(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i * 100) < m)\n      m = *(p + i * 100);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i * 100) = *(p + i * 100) - m;\n  if (k > 1)\n    f2(p + 1, n, (k - 1));\n}\nint main() {\n  int *p, a[100][100], n, i, j, t, m, h;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++)\n        scanf(\"%d\", &a[j][t]);\n    }\n    p = a[0];\n    h = 0;\n    for (j = n; j > 1; j--) {\n      f1(p, j, j);\n      f2(p, j, j);\n      h += a[1][1];\n      for (t = 0; t < j; t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[t][m] = a[t][m + 1];\n      }\n      for (t = 0; t < (j - 1); t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[m][t] = a[m + 1][t];\n      }\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int, int[][101]);\nvoid Delete(int, int[][101]);\nint min(int, int);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", GL(n, a));\n  }\n\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum = 0, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = 999999;\n    for (j = 0; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] -= MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = 999999;\n    for (i = 0; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] -= MIN;\n  }\n\n  Sum += a[1][1];\n\n  if (n == 1) {\n    return 0;\n\n  } else {\n    Delete(n, a);\n    Sum += GL(n - 1, a);\n    return Sum;\n  }\n}\n\nint min(int a, int b) {\n  if (a >= b) {\n    return b;\n  } else\n    return a;\n}\nvoid Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n}\n"}
{"label": "18", "index": "32443", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[100][100], sum;\nvoid col(int c) {\n  if (c == n) {\n    printf(\"%d\\n\", sum);\n    return;\n  }\n  int min;\n  for (int i = 0; i <= n - c; i++) {\n    min = a[i][0];\n    for (int j = 1; j <= n - c; j++)\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[i][j] = a[i][j] - min;\n  }\n  for (int i = 0; i <= n - c; i++) {\n    min = a[0][i];\n    for (int j = 1; j <= n - c; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[j][i] = a[j][i] - min;\n  }\n  sum += a[1][1];\n  a[1][1] = a[2][2];\n  for (int i = 1; i < n - c; i++)\n    a[0][i] = a[0][i + 1];\n  for (int i = 1; i < n - c; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < n - c; i++)\n    for (int j = 1; j < n - c; j++)\n      a[i][j] = a[i + 1][j + 1];\n  col(c + 1);\n}\nint main() {\n  cin >> n;\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    col(1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32444", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1(int k);\nint a[100][100];\nint main() {\n  int n, k;\n  int i = 0, j = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  while (n--) {\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        cin >> a[i][j];\n    cout << array_1(k) << endl;\n  }\n  return 0;\n}\n\nint array_1(int k) {\n  if (k == 1)\n    return 0;\n  else if (k > 1) {\n    int i, j, max1, max2;\n    for (i = 0; i < k; i++) {\n      max1 = 10000;\n      for (j = 0; j < k; j++) {\n        if (max1 > a[i][j])\n          max1 = a[i][j];\n      }\n      for (j = 0; j < k; j++)\n        a[i][j] = a[i][j] - max1;\n    }\n    for (j = 0; j < k; j++) {\n      max2 = 10000;\n      for (i = 0; i < k; i++) {\n        if (max2 > a[i][j])\n          max2 = a[i][j];\n      }\n      for (i = 0; i < k; i++)\n        a[i][j] = a[i][j] - max2;\n    }\n    int temp = a[1][1];\n    for (i = 2; i < k; i++)\n      for (j = 0; j < k; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < k; j++)\n      for (i = 0; i < k; i++)\n        a[i][j - 1] = a[i][j];\n    return temp + array_1(k - 1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int (*p)[100], int n) {\n  int sum, i, j, min = 0;\n  sum = 0;\n  {\n    for (i = 0; i < n; i++) {\n      min = **(p + i);\n      {\n        for (j = 1; j < n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n    }\n  }\n  {\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      {\n        {\n          for (i = 1; i < n; i++)\n            if (*(*(p + i) + j) < min)\n              min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n        sum = *(*(p + 1) + 1);\n      }\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        *(*p + i) = *(*p + i + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        **(p + i) = **(p + i + 1);\n    }\n    return (sum);\n  }\n}\nint main() {\n  int(*p)[100], (*q)[100], n, i, j, sum = 0, k;\n  p = (int(*)[100])malloc(100 * sizeof(int) * 10000);\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + k * n + i) + j);\n  }\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    q = p + k * n;\n    {\n      for (i = n; i > 1; i--)\n        sum = sum + f(q, i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, min, s, t;\n  cin >> n;\n  int a[n][n];\n  for (int k = 0; k < n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 1; j < t; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < t; i++) {\n        min = a[0][i];\n        for (j = 1; j < t; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] -= min;\n      }\n      s += a[1][1];\n      if (t > 2) {\n        for (i = 1; i < t - 1; i++) {\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        }\n        for (i = 1; i < t - 1; i++)\n          for (j = 1; j < t - 1; j++)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][1000], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int p = remain(a, n, 0);\n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p, n, j, k, min, sum;\n  cin >> p;\n  int a[100][100];\n  n = p;\n  for (int i = 0; i < p; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    do {\n\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] -= min;\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      for (j = 1; j < n; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      n--;\n    } while (n > 1);\n    cout << sum << endl;\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint zero(int n, int sum) {\n  if (n != 1) {\n    int min, i, j, array[n][n];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        array[i][j] = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[i][0];\n      for (j = 1; j < n; j++) {\n        if (array[i][j] < min) {\n          min = array[i][j];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[i][j] = array[i][j] - min;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[0][i];\n      for (j = 1; j < n; j++) {\n        if (array[j][i] < min) {\n          min = array[j][i];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[j][i] = array[j][i] - min;\n        }\n      }\n    }\n    sum = sum + array[1][1];\n    for (i = 0; i < n; i++) {\n      for (j = 1; j < n - 1; j++) {\n        a[i][j] = array[i][j] = array[i][j + 1];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        array[j][i] = array[j + 1][i];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 0; j < n - 1; j++) {\n        a[i][j] = array[i][j];\n      }\n    }\n    return zero(n - 1, sum);\n  }\n  if (n == 1)\n    return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0, i, t, r;\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n; t++) {\n      for (r = 0; r < n; r++) {\n        cin >> a[t][r];\n      }\n    }\n    printf(\"%d\\n\", zero(n, sum));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32450", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, l, d, c, s, t, min1, min2; \n  cin >> n;                                  \n  int a[n][n][n], b[n][n];                   \n  for (i = 0; i < n; i++)                    \n  {\n    int h = 0;              \n    for (j = 0; j < n; j++) \n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    for (l = 0; l < n - 1; l++) \n    {\n      for (j = 0; j < n - l; j++) {\n        min1 = a[i][j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min1 > a[i][j][k])\n            min1 = a[i][j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[i][j][k] = a[i][j][k] - min1; \n      }\n      for (d = 0; d < n - l; d++) \n      {\n        min2 = a[i][0][d];\n        for (c = 1; c < n - l; c++) {\n          if (min2 > a[i][c][d])\n            min2 = a[i][c][d];\n        }\n        for (c = 0; c < n - l; c++)\n          a[i][c][d] = a[i][c][d] - min2; \n      }\n      b[i][l] = a[i][1][1]; \n      for (s = 1; s < n - 1 - l; s++)\n        for (t = 0; t < n - l; t++)\n          a[i][s][t] = a[i][s + 1][t]; \n      for (t = 1; t < n - l - 1; t++)\n        for (s = 0; s < n - l - 1; s++)\n          a[i][s][t] = a[i][s][t + 1]; \n    }\n    for (l = 0; l < n - 1; l++) \n      h = h + b[i][l];\n    cout << h << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32451", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint cut(int t) {\n  int s, i, j;\n  int sum;\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[i][j] < s)\n        s = a[i][j];\n    }\n    for (j = 0; j < t; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[j][i] < s)\n        s = a[j][i];\n    }\n    for (j = 0; j < t; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  t--;\n  if (t == 1)\n    return a[1][1];\n  else\n    sum = a[1][1];\n  for (i = 0; i < t + 1; i++)\n    for (j = 0; j < t + 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 1 || j == 1)\n        continue;\n      else if (i == 0)\n        a[i][j - 1] = a[i][j];\n      else if (j == 0)\n        a[i - 1][j] = a[i][j];\n      else\n        a[i - 1][j - 1] = a[i][j];\n    }\n  sum = sum + cut(t);\n  return sum;\n}\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    printf(\"%d\\n\", cut(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint Min(int a[], int n) {\n  int i, min;\n  min = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] < min) {\n      min = a[i];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int n, i, N, dd1, dd2, j, min;\n  int row[100][100], col[100][100], sum[100];\n  scanf(\"%d\\n\", &n);\n  N = n;\n  for (i = 0; i < N; i++) {\n    for (dd1 = 0; dd1 < N; dd1++) {\n      for (dd2 = 0; dd2 < N; dd2++) {\n        scanf(\"%d\", &row[dd1][dd2]);\n      }\n    }\n    sum[i] = 0;\n    n = N;\n    for (j = 0; j < N - 1; j++) {\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(row[dd1], n) != 0) {\n          min = Min(row[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            row[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          col[dd2][dd1] = row[dd1][dd2];\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(col[dd1], n) != 0) {\n          min = Min(col[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            col[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          row[dd1][dd2] = col[dd2][dd1];\n        }\n      }\n      sum[i] += row[1][1];\n      for (dd1 = 0; dd1 < n - 1; dd1++) {\n        for (dd2 = 0; dd2 < n - 1; dd2++) {\n          if (dd1 >= 1 && dd2 == 0) {\n            row[dd1][dd2] = row[dd1 + 1][dd2];\n          }\n          if (dd2 >= 1 && dd1 == 0) {\n            row[dd1][dd2] = row[dd1][dd2 + 1];\n          }\n          if (dd1 >= 1 && dd2 >= 1) {\n            row[dd1][dd2] = row[dd1 + 1][dd2 + 1];\n          }\n        }\n      }\n      n--;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32453", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int m = n;\n    int sum = 0;\n    while (1) {\n      int min;\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      m--;\n      if (m == 1) {\n        cout << sum << endl;\n        break;\n      }\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, n0 = 0, juzhen[102][102] = {0}, sum = 0, minc[102] = {0},\n               minr[102] = {0}, lins = 0;\n  int(*p)[102] = juzhen, *pr = minr, *pc = minc;\n  scanf(\"%d \", &n);\n  while (n0 < n) {\n    lins = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = 0;\n      *(pr + i) = 100000;\n      *(pc + i) = 100000;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (lins < n - 1) {\n      for (i = 0; i < n; i++) {\n        *(pr + i) = 100000;\n        *(pc + i) = 100000;\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          if (*(*(p + i) + j) < minr[i])\n            *(pr + i) = *(*(p + i) + j);\n        }\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          *(*(p + i) + j) -= *(pr + i);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          if (*(*(p + i) + j) < *(pc + j))\n            *(pc + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          *(*(p + i) + j) -= *(pc + j);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n\n      for (i = 2; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (j = 2; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n      lins++;\n    }\n    cout << sum << \"\\n\";\n    n0++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32455", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint i, j, n, sum = 0;\nvoid xiaojian(int times) {\n  for (i = 0; i < times; i++)\n    for (j = 1; j < times - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < times; j++)\n    for (i = 1; i < times - 1; i++)\n      a[i][j] = a[i + 1][j];\n  return;\n}\nint F(int times) {\n  if (times == 1)\n    return sum;\n  else {\n    int J[times];\n    for (i = 0; i < times; i++) {\n      J[i] = a[i][0];\n      for (j = 0; j < times - 1; j++) {\n        if (J[i] > a[i][j + 1])\n          J[i] = a[i][j + 1];\n      }\n      if (J[i] > 0)\n        for (int t = 0; t < times; t++)\n          a[i][t] -= J[i];\n    }\n    int I[times];\n    for (j = 0; j < times; j++) {\n      I[j] = a[0][j];\n      for (i = 0; i < times - 1; i++) {\n        if (I[j] > a[i + 1][j])\n          I[j] = a[i + 1][j];\n      }\n      if (I[j] > 0)\n        for (int t = 0; t < times; t++)\n          a[t][j] -= I[j];\n    }\n    sum += a[1][1];\n    xiaojian(times);\n    return F(times - 1);\n  }\n}\nint main() {\n  cin >> n;\n  int t = 0;\n  while (t < n) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", F(n));\n    sum = 0;\n    t++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32456", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, j;\n  int sum = 0;\n  cin >> n;\n  int a[n][n];\n  int minh[n], minl[n];\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) { \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int t = 1; \n    sum = 0;\n    while (t < n) {\n      for (i = 0; i < n; i++) { \n        minh[i] = 10000;\n        minl[i] = 10000;\n      }\n      for (i = 0; i < n; i++) { \n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minh[i] > a[i][j])\n            minh[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) { \n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minh[i];\n        }\n      }\n      for (i = 0; i < n; i++) { \n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minl[j] > a[i][j])\n            minl[j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) { \n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minl[j];\n        }\n      }\n\n      sum = sum + a[t][t];\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (i == t || j == t) \n            a[i][j] = 10000;\n        }\n      }\n\n      t++;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32457", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, y, m1, m2, p;\n  int a[103][103], s = 0;\n  cin >> n;\n  for (y = 1; y <= n; y++) {\n    p = n;\n    s = 0;\n    m1 = 999999;\n    m2 = 999999;\n    for (i = 1; i <= p; i++)\n      for (j = 1; j <= p; j++)\n        scanf(\"%d \", &a[i][j]);\n    while (p > 1) {\n\n      for (i = 1; i <= p; i++) {\n        m1 = a[i][1];\n        for (j = 1; j <= p; j++)\n          if (m1 > a[i][j])\n            m1 = a[i][j];\n        for (j = 1; j <= p; j++)\n          a[i][j] -= m1;\n      }\n\n      for (i = 1; i <= p; i++) {\n        m2 = a[1][i];\n        for (j = 1; j <= p; j++)\n          if (m2 > a[j][i])\n            m2 = a[j][i];\n        for (j = 1; j <= p; j++)\n          a[j][i] -= m2;\n      }\n\n      s += a[2][2];\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p - 1; j++)\n          a[j][i] = a[j][i + 1];\n\n      p--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32458", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint row(int a[][100], int l, int m) {\n  int i, min = a[m][0];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[m][i])\n      min = a[m][i];\n  return min;\n}\nint line(int a[][100], int l, int m) {\n  int i, min = a[0][m];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[i][m])\n      min = a[i][m];\n  return min;\n}\nvoid move(int a[][100], int l) {\n  int i, j;\n  for (i = 1; i < l + 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < l + 1; i++)\n    for (j = 1; j < l + 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int l, a[100][100] = {0}, sum = 0, x, y;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = n - 1; l >= 0; l--) {\n      for (x = 0; x < l + 1; x++) {\n        int d = row(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[x][y] = a[x][y] - d;\n      }\n      for (x = 0; x < l + 1; x++) {\n        int e = line(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[y][x] = a[y][x] - e;\n      }\n      sum += a[1][1];\n      move(a, l);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32459", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int matrix[100][100] = {0};\n  int time, min, sum = 0, k;\n  for (k = 1; k <= n; k++) {\n    int i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(matrix + i) + j);\n\n    sum = 0;\n    for (time = 1; time < n; time++) {\n      for (i = 0; i <= n - time; i++) {\n        min = *(*(matrix + i));\n        for (j = 0; j <= n - time; j++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) -= min;\n      }\n      for (j = 0; j <= n - time; j++) {\n        min = *(*(matrix) + j);\n        for (i = 0; i <= n - time; i++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) -= min;\n      }\n      sum += *(*(matrix + 1) + 1);\n      for (i = 1; i <= n - time; i++) {\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) = *(*(matrix + i + 1) + j);\n      }\n      for (j = 1; j <= n - time; j++) {\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) = *(*(matrix + i) + j + 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32460", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[101] = {0}, min;\n  int i, j, k, l, h, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      for (l = 0; l <= n - j; l++) {\n        min = a[l][0];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[l][h]) {\n            min = a[l][h];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[l][h] = a[l][h] - min;\n        }\n      }\n      for (l = 0; l <= n - j; l++) {\n        min = a[0][l];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[h][l]) {\n            min = a[h][l];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[h][l] = a[h][l] - min;\n        }\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (l = 1; l <= n - j - 1; l++) {\n        a[0][l] = a[0][l + 1];\n        a[l][0] = a[l + 1][0];\n      }\n      for (l = 1; l <= n - j - 1; l++) {\n        for (h = 1; h <= n - j - 1; h++) {\n          a[l][h] = a[l + 1][h + 1];\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  int n, arr[101][101], temp[101][101];\n  int cnt_a, cnt_b;\n  int(*ptr)[101], ans, m;\n  int(*ptr_t)[101];\n  int mini;\n  ptr = arr;\n  ptr_t = temp;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    memset(arr, 0, sizeof(arr));\n    ans = 0;\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> *(*(ptr + i) + j);\n\n    m = n;\n    for (i = 0; i < n - 1; ++i) {\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + j) + l) < mini)\n            mini = *(*(ptr + j) + l);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + j) + l) -= mini;\n        }\n      }\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + l) + j) < mini)\n            mini = *(*(ptr + l) + j);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + l) + j) -= mini;\n        }\n      }\n      ans += *(*(ptr + 1) + 1);\n      cnt_a = 0;\n      cnt_b = 0;\n      for (j = 0; j < m; ++j) {\n        cnt_b = 0;\n        for (l = 0; l < m; ++l) {\n          if (j == 1 || l == 1)\n            continue;\n          *(*(ptr_t + cnt_a) + cnt_b) = *(*(ptr + j) + l);\n          cnt_b++;\n        }\n        if (j != 1)\n          cnt_a++;\n      }\n      memset(arr, 0, sizeof(arr));\n      for (j = 0; j < cnt_a; ++j)\n        for (l = 0; l < cnt_b; ++l) {\n          *(*(ptr + j) + l) = *(*(ptr_t + j) + l);\n        }\n      m--;\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32462", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int input, shu[101][101], min[101], min1[101], sum, i, j, i1, j1, n, num;\n  scanf(\"%d \", &input);\n  for (n = 1; n <= input; n++) {\n    num = input;\n    for (i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> shu[i][j];\n    }\n    sum = 0;\n    while (num > 1) {\n      for (i = 0; i < num; i++) {\n        min[i] = 1000000;\n        min1[i] = 10000000;\n      }\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num; j++) {\n          if (shu[i][j] < min[i])\n            min[i] = shu[i][j];\n          if (j == num - 1) {\n            for (j1 = 0; j1 < num; j1++)\n              shu[i][j1] = shu[i][j1] - min[i];\n          }\n        }\n      }\n      for (j = 0; j < num; j++) {\n        for (i = 0; i < num; i++) {\n          if (shu[i][j] < min1[j])\n            min1[j] = shu[i][j];\n          if (i == num - 1) {\n            for (i1 = 0; i1 < num; i1++)\n              shu[i1][j] = shu[i1][j] - min1[j];\n          }\n        }\n      }\n      sum = sum + shu[1][1];\n      for (i = 0; i < num; i++) {\n        for (j = 1; j < num - 1; j++)\n          shu[i][j] = shu[i][j + 1];\n      }\n      for (j = 0; j < num - 1; j++) {\n        for (i = 1; i < num - 1; i++)\n          shu[i][j] = shu[i + 1][j];\n      }\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[100], n, i, j, k, l, min, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < n - j; k++) {\n        min = a[k][0];\n        for (l = 0; l < n - j; l++)\n          if (min > a[k][l])\n            min = a[k][l];\n        for (l = 0; l < n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k < n - j; k++) {\n        min = a[0][k];\n        for (l = 0; l < n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l < n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (k = 0; k < n - j; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[k][l] = a[k][l + 1];\n      for (k = 0; k < n - j - 1; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[l][k] = a[l + 1][k];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32464", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], min, sum = 0, t = 0, c = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) \n  {\n    for (int j = 0; j < n; j++) \n    {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n      cout << endl;\n    }\n    for (int l = 0; l < n - 1; l++) \n    {\n      for (int j = 0; j < n - l; j++) {\n        t = 0;\n        for (int q = 0; q < n - l; q++)\n          if (a[j][q] == 0)\n            t = t + 1; \n        if (t > 0)\n          continue;\n        else {\n          min = a[j][0];\n          for (int y = 1; y < n - l; y++) \n            if (min > a[j][y])\n              min = a[j][y];\n          for (int r = 0; r < n - l; r++)\n            a[j][r] = a[j][r] - min; \n        }\n      }\n      for (int k = 0; k < n - l; k++) {\n        c = 0;\n        for (int p = 0; p < n - l; p++)\n          if (a[p][k] == 0)\n            c = c + 1;\n        if (c > 0)\n          continue;\n        else {\n          min = a[0][k];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[y][k])\n              min = a[y][k];\n          for (int r = 0; r < n - l; r++)\n            a[r][k] = a[r][k] - min;\n        }\n      }\n      sum = sum + a[1][1]; \n      a[0][0] = a[0][0];   \n      for (int e = 1; e < n - l; e++)\n        a[0][e] = a[0][e + 1];\n      for (int g = 1; g < n - l; g++)\n        a[g][0] = a[g + 1][0];\n      for (int f = 1; f < n - l; f++) {\n        for (int s = 1; s < n - l; s++)\n          a[f][s] = a[f + 1][s + 1];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid ccout(int n, int s[100]);\nint main() {\n  int n, i, j, k, min, t, s[100], a[100][100][100];\n  cin >> n;\n  memset(s, 0, sizeof(s));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j][k];\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = 1073741824;\n        for (j = 0; j < n - t; j++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (j = 0; j < n - t; j++)\n          a[i][j][k] -= min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = 1073741824;\n        for (i = 0; i < n - t; i++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (i = 0; i < n - t; i++)\n          a[i][j][k] -= min;\n      }\n      s[k] += a[1][1][k];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - t - 1; i++)\n          a[i][j][k] = a[i + 1][j][k];\n    }\n  }\n  ccout(n, s);\n  return 0;\n}\nvoid ccout(int n, int s[100]) {\n  int k;\n  for (k = 0; k < n; k++)\n    cout << s[k] << endl;\n}\n"}
{"label": "18", "index": "32466", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a1[100][100];\nint xiao(int n) {\n  int sum = 0;\n  if (n == 2) {\n    for (int i = 0; i < n; i++) {\n      int min = 1000;\n      for (int j = 0; j < n; j++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a1[i][j] = a1[i][j] - min;\n    }\n    for (int j = 0; j < n; j++) {\n      int min = 1000;\n      for (int i = 0; i < n; i++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a1[i][j] = a1[i][j] - min;\n    }\n\n    return a1[1][1];\n  }\n\n  for (int i = 0; i < n; i++) {\n    int min = 1000;\n    for (int j = 0; j < n; j++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a1[i][j] = a1[i][j] - min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = 1000;\n    for (int i = 0; i < n; i++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int i = 0; i < n; i++)\n      a1[i][j] = a1[i][j] - min;\n  }\n\n  sum += a1[1][1];\n\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (j == 1)\n        continue;\n      if (j < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i][j - 1] = a1[i][j];\n    }\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      if (i == 1)\n        continue;\n      if (i < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i - 1][j] = a1[i][j];\n    }\n  sum += xiao(n - 1);\n  return sum;\n}\n\nint main() {\n  int n;\n  cin >> n;\n\n  for (int k = 0; k < n; k++) {\n\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a1[i][j];\n    printf(\"%d\\n\", xiao(n));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int n, i, j, t, min, count = 0, m;\n  scanf(\"%d \", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    count = 0;\n    for (t = n; t >= 2; t--) {\n      for (i = 1; i <= t; i++) {\n        min = a[i][1];\n        for (j = 1; j <= t; j++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (j = 1; j <= t; j++)\n          a[i][j] -= min;\n      }\n      for (j = 1; j <= t; j++) {\n        min = a[1][j];\n        for (i = 1; i <= t; i++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (i = 1; i <= t; i++)\n          a[i][j] -= min;\n      }\n      count += a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 2; j <= t - 1; j++)\n        for (i = 1; i <= t - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32468", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r;\n  int mat[100][100];\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    int sum = 0;\n    r = n;\n    for (int b = 0; b < n; b++) {\n      for (int c = 0; c < n; c++) {\n        cin >> mat[b][c];\n      }\n    }\n    for (int d = 0; d < n - 1; d++) {\n      int minh[100], minl[100];\n      for (int d = 0; d < r; d++) {\n        minh[d] = 9999999;\n        minl[d] = 9999999;\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minh[e] > mat[e][f]) {\n            minh[e] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minh[g];\n        }\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minl[f] > mat[e][f]) {\n            minl[f] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minl[h];\n        }\n      }\n      sum += mat[1][1];\n      for (int g = 1; g < r - 1; g++) {\n        for (int h = 0; h < r; h++)\n          mat[g][h] = mat[g + 1][h];\n      }\n      for (int h = 1; h < r - 1; h++) {\n        for (int g = 0; g < r - 1; g++) {\n          mat[g][h] = mat[g][h + 1];\n        }\n      }\n      r--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32469", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint sum(int[][101], int);\nint main() {\n  int n, i, j, k;  \n  int a[101][101]; \n\n  cin >> n; \n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n\n    cout << sum(a, n) << endl; \n  }\n  return 0;\n}\n\nint sum(int a[][101], int n) {\n  int i, j, temp, min; \n  for (i = 0; i < n; i++) {\n    min = a[i][0]; \n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j]; \n\n    for (j = 0; j < n; j++)\n      a[i][j] -= min; \n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j]; \n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j]; \n\n    for (i = 0; i < n; i++)\n      a[i][j] -= min; \n  }\n  temp = a[1][1]; \n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      if (j == 0 && i > 0)\n        a[i][j] = a[i + 1][j];\n      if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n    } \n\n  if (n == 1) \n    return 0;\n  else\n    return temp + sum(a, n - 1); \n}\n"}
{"label": "18", "index": "32470", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, cycle;\n  cin >> n;\n  for (cycle = 0; cycle < n; cycle++) {\n    int i, j, a[100][100] = {0}, w, sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    } \n\n    w = n;\n    int min;\n\n    while (w > 1) {\n      for (i = 0; i < w; i++) {\n        min = a[i][0];\n        for (j = 0; j < w; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < w; j++)\n          a[i][j] -= min;\n      }\n\n      for (j = 0; j < w; j++) {\n        int count = 0;\n\n        for (i = 0; i < w; i++) {\n\n          if (a[i][j] == 0) {\n            count++;\n            break;\n          }\n        }\n\n        if (count == 0) {\n          min = a[0][j];\n          for (i = 0; i < w; i++) {\n            if (a[i][j] < min)\n              min = a[i][j];\n          }\n\n          for (i = 0; i < w; i++)\n            a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (j = 2; j < w; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < w; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i < w; i++) {\n        for (j = 2; j < w; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n      w--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, array_1[101][101], sum[101] = {0}, k;\nvoid cut(int m) {\n  int p, q, min;\n  for (p = 0; p < n - m; p++) {\n    min = array_1[p][0];\n    for (q = 1; q < n - m; q++)\n      if (array_1[p][q] < min)\n        min = array_1[p][q];\n    for (q = 0; q < n - m; q++)\n      array_1[p][q] = array_1[p][q] - min;\n  }\n  for (p = 0; p < n - m; p++) {\n    min = array_1[0][p];\n    for (q = 1; q < n - m; q++)\n      if (array_1[q][p] < min)\n        min = array_1[q][p];\n    for (q = 0; q < n - m; q++)\n      array_1[q][p] = array_1[q][p] - min;\n  }\n  sum[k] = sum[k] + array_1[1][1];\n  for (p = 1; p < n - m - 1; p++) {\n    array_1[0][p] = array_1[0][p + 1];\n    array_1[p][0] = array_1[p + 1][0];\n  }\n  for (p = 1; p < n - m - 1; p++)\n    for (q = 1; q < n - m - 1; q++)\n      array_1[p][q] = array_1[p + 1][q + 1];\n}\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &array_1[i][j]);\n    for (i = 0; i < n - 1; i++)\n      cut(i);\n  }\n  for (k = 0; k < n; k++)\n    printf(\"%d\", sum[k]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int matrix[100][100] = {0};\n  int time, min, sum = 0, k;\n  for (k = 1; k <= n; k++) {\n    int i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(matrix + i) + j);\n    sum = 0;\n    for (time = 1; time < n; time++) {\n      for (i = 0; i <= n - time; i++) {\n        min = *(*(matrix + i));\n        for (j = 0; j <= n - time; j++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) -= min;\n      }\n      for (j = 0; j <= n - time; j++) {\n        min = *(*(matrix) + j);\n        for (i = 0; i <= n - time; i++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) -= min;\n      }\n      sum += *(*(matrix + 1) + 1);\n      for (i = 1; i <= n - time; i++) {\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) = *(*(matrix + i + 1) + j);\n      }\n      for (j = 1; j <= n - time; j++) {\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) = *(*(matrix + i) + j + 1);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0;\n  for (int ii = 0; ii < n; ii++) {\n    sum = 0;\n    int a[100][100];\n    for (int i2 = 0; i2 < n; i2++)\n      for (int i3 = 0; i3 < n; i3++)\n        cin >> a[i2][i3];\n    \n    for (int i = 1; i < n; i++) {\n      int min1;\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j][j2]);\n        min1 = min(min1, a[j][0]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j][j2] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[0][j]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[0][j2] -= min1;\n\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j2][j]);\n        min1 = min(min1, a[0][j]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j2][j] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[j][0]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[j2][0] -= min1;\n\n      sum += a[i][i];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint w = 0;\nint q[100][100];\n\nvoid op(int n) {\n  if (n != 1) {\n    int rm[n], cm[n]; \n    for (int i = 0; i < n; i++) {\n      rm[i] = q[i][0];\n      cm[i] = q[0][i]; \n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (rm[i] >= q[i][j]) {\n          rm[i] = q[i][j];\n        }\n      }\n    } \n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - rm[i]; \n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (cm[j] >= q[i][j]) {\n          cm[j] = q[i][j]; \n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - cm[j]; \n      }\n    }\n\n    sum += q[1][1]; \n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n; j++) {\n        q[i][j] = q[i][j + 1]; \n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i + 1][j]; \n      }\n    }\n    op(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int s = 1; s <= n; s++) {\n    for (int a = 0; a < n; a++) {\n      for (int b = 0; b < n; b++) {\n        cin >> q[a][b];\n      }\n    }\n    op(n);\n    cout << sum << endl;\n    sum = 0; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s, i, j;\n  for (s = 1; s <= n; s++) {\n    int b = n, yi = 0, min = 10000;\n    int a[110][110] = {0};\n    int c = 2;\n    int bi[110] = {0}, bj[110] = {0};\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (b = n; b >= 2; b--) {\n      for (i = 1; i <= n; i++) {\n        if (bi[i] == 1)\n          continue;\n        for (j = 1; j <= n; j++) {\n          if ((bj[j] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 1; j <= n; j++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (bj[j] == 1)\n          continue;\n        for (i = 1; i <= n; i++) {\n          if ((bi[i] == 0) && (a[i][j] <= min)) {\n            min = a[i][j];\n          }\n        }\n        if (min != 0) {\n          for (i = 1; i <= n; i++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 100000;\n      }\n      yi = yi + a[c][c];\n      bi[c] = 1;\n      bj[c] = 1;\n      min = 10000;\n      c++;\n    }\n    cout << yi << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32476", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint juzhen[101][101];\nint sum;\nvoid xiaochu(int n) {\n  if (n == 1)\n    ;\n  else {\n    int minj[101];\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (juzhen[i][j] < minj[i])\n          minj[i] = juzhen[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        juzhen[i][j] = juzhen[i][j] - minj[i];\n    }\n    for (int i = 0; i < n; i++) {\n      minj[i] = 1000;\n    }\n    for (int j = 0; j < n; j++) {\n      for (int i = 0; i < n; i++) {\n        if (juzhen[i][j] < minj[j])\n          minj[j] = juzhen[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        juzhen[i][j] = juzhen[i][j] - minj[j];\n    }\n    sum = sum + juzhen[1][1];\n    for (int j = 1; j < n - 1; j++) {\n      juzhen[0][j] = juzhen[0][j + 1];\n      juzhen[j][0] = juzhen[j + 1][0];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i + 1][j + 1];\n    xiaochu(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    sum = 0;\n    xiaochu(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32477", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m, imin;\nint matrix[110][110];\nvoid submin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (matrix[x][y] < imin) {\n    imin = matrix[x][y];\n  }\n  submin(x + dx, y + dy, dx, dy);\n  matrix[x][y] = matrix[x][y] - imin;\n}\nvoid sub() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[i][j] = matrix[i][j + 1];\n    }\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[j][i] = matrix[j + 1][i];\n    }\n}\nint main() {\n  int i, j, sum, t;\n  for (scanf(\"%d \", &n), t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> matrix[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        imin = 10000;\n        submin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + matrix[1][1];\n      sub();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32478", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint t = 0;\nint sum(int n, int a[100][100]) {\n  if (n == 1)\n    return 1;\n  int i, j, k, min;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++) {\n      if (a[j][k] < min)\n        min = a[j][k];\n    }\n    for (k = 0; k < n; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++) {\n      if (a[k][j] < min)\n        min = a[k][j];\n    }\n    for (k = 0; k < n; k++) {\n      a[k][j] -= min;\n    }\n  }\n\n  t += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++)\n      a[i][j] = a[i + 1][j];\n  }\n\n  sum(n - 1, a);\n  return t;\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n, a) << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint matrix[101][101][101];\nint countsum; \nvoid cal(int rank, int num) {\n  if (rank != 1) \n  {\n    \n    \n    \n    \n    int rowmin[rank];                   \n    int columnmin[rank];                \n    for (int i = 0; i <= rank - 1; ++i) \n    {\n      for (int j = 0; j <= rank - 1; ++j) \n      {\n        if (j == 0)                      \n          rowmin[i] = matrix[num][i][j]; \n        else                             \n          rowmin[i] =\n              min(rowmin[i], matrix[num][i][j]); \n      }\n      if (rowmin[i] != 0) \n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][i][j] =\n              matrix[num][i][j] - rowmin[i]; \n    }\n    for (int i = 0; i <= rank - 1; ++i) \n    {\n      for (int j = 0; j <= rank - 1; ++j) \n      {\n        if (j == 0)                         \n          columnmin[i] = matrix[num][j][i]; \n        else                                \n          columnmin[i] = min(columnmin[i],\n                             matrix[num][j][i]); \n      }\n      if (columnmin[i] != 0) \n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][j][i] =\n              matrix[num][j][i] - columnmin[i]; \n    }\n    countsum += matrix[num][1][1]; \n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][j][i - 1] = matrix[num][j][i]; \n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][i - 1][j] = matrix[num][i][j]; \n    cal(rank - 1, num);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= n - 1; ++i)\n    for (int j = 0; j <= n - 1; ++j)\n      for (int k = 0; k <= n - 1; ++k)\n        cin >> matrix[i][j][k]; \n  for (int i = 0; i <= n - 1; ++i) {\n    countsum = 0;             \n    cal(n, i);                \n    cout << countsum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint sum = 0;\nint minu(int x, int y) {\n  if (x < y)\n    return x;\n  else\n    return y;\n}\nvoid del(int n) {\n  int i, m;\n  int num[n];\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  } else {\n    for (i = 0; i < n; i++) {\n      num[i] = a[i][0];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[i][m]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[i][m] = a[i][m] - num[i];\n    } \n    for (i = 0; i < n; i++) {\n      num[i] = a[0][i];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[m][i]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[m][i] = a[m][i] - num[i]; \n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[i][m] = a[i + 1][m];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[m][i] = a[m][i + 1];\n    del(n - 1);\n  }\n}\nint main() {\n  int j, k;\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    del(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, arr[100][100], i, j, k, l, min, sum = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> arr[i][j];\n      }\n    } \n    for (l = n; l > 1; l--) {\n      for (i = 0; i < l; i++) {\n        min = arr[i][0];\n        for (j = 1; j < l; j++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      for (j = 0; j < l; j++) {\n        min = arr[0][j];\n        for (i = 1; i < l; i++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (i = 0; i < l; i++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }                      \n      sum = sum + arr[1][1]; \n      for (i = 1; i < l; i++) {\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i + 1][j];\n        }\n      }\n      for (j = 1; j < l; j++) {\n        for (i = 0; i < l - 1; i++) {\n          arr[i][j] = arr[i][j + 1];\n        }\n      } \n    }\n    cout << sum << endl;\n    memset(arr, 0, sizeof(arr));\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, t = 0, b[100][100];\n  int i, j, k, min;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = b[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > b[j][k]) {\n            min = b[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          b[j][k] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = b[0][j];\n        for (k = 0; k < n; k++) {\n          if (min > b[k][j]) {\n            min = b[k][j];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          b[k][j] -= min;\n        }\n      }\n      t += b[1][1];\n      for (j = 1; j < n - 1; j++) {\n        b[0][j] = b[0][j + 1];\n        b[j][0] = b[j + 1][0];\n        for (k = 1; k < n - 1; k++) {\n          b[j][k] = b[j + 1][k + 1];\n        }\n      }\n    }\n    cout << t << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, minrow, mincol, sum;\n  int p[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    t = n;\n    for (i = 0; i < t; i++) {\n      for (j = 0; j < t; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (t != 1) {\n      for (i = 0; i < t; i++) {\n        minrow = 100000;\n        for (j = 0; j < t; j++) {\n          if (*(*(p + i) + j) < minrow) {\n            minrow = *(*(p + i) + j);\n          }\n        }\n        for (j = 0; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - minrow;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        mincol = 100000;\n        for (i = 0; i < t; i++) {\n          if (*(*(p + i) + j) < mincol) {\n            mincol = *(*(p + i) + j);\n          }\n        }\n        for (i = 0; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - mincol;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 0; i < t; i++) {\n        for (j = 1; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (j = 0; j < t; j++) {\n        for (i = 1; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      t--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32485", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l, min, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n      for (k = 0; k < j; k++) {\n        min = a[k][0];\n        for (l = 0; l < j; l++) {\n          if (min > a[k][l]) {\n            min = a[k][l];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[k][l] = a[k][l] - min;\n        }\n      }\n      for (k = 0; k < j; k++) {\n        min = a[0][k];\n        for (l = 0; l < j; l++) {\n          if (min > a[l][k]) {\n            min = a[l][k];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[l][k] = a[l][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < j - 1; k++) {\n        a[k][0] = a[k + 1][0];\n        a[0][k] = a[0][k + 1];\n      }\n      for (k = 1; k < j - 1; k++) {\n        for (l = 1; l < j - 1; l++) {\n          a[k][l] = a[k + 1][l + 1];\n        }\n      }\n    }\n    cout << sum << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32486", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint hang(int a[], int n, int h) {\n  int m = a[0];\n  for (int i = h; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return (m);\n}\nint lie(int a[][110], int n, int j, int h) {\n  int m = a[0][j];\n  for (int i = h; i < n; i++)\n    if (a[i][j] < m)\n      m = a[i][j];\n  return (m);\n}\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int i, j, h, s = 0, hm, lm, a[110][110] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (h = 1; h < n; h++) {\n      hm = hang(a[0], n, h);\n      a[0][0] -= hm;\n      for (j = h; j < n; j++)\n        a[0][j] -= hm;\n      for (i = h; i < n; i++) {\n        hm = hang(a[i], n, h);\n        a[i][0] -= hm;\n        for (j = h; j < n; j++)\n          a[i][j] -= hm;\n      }\n      lm = lie(a, n, 0, h);\n      a[0][0] -= lm;\n      for (i = h; i < n; i++)\n        a[i][0] -= lm;\n      for (j = h; j < n; j++) {\n        lm = lie(a, n, j, h);\n        a[0][j] -= lm;\n        for (i = h; i < n; i++)\n          a[i][j] -= lm;\n      }\n      s += a[h][h];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, sum = 0;\n  scanf(\"%d \", &n);\n  for (int p = 1; p <= n; p++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int q = 1; q < n; q++) {\n      for (i = q; i <= n; i++) {\n        m = a[i][q];\n        for (j = q + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (j = q; j <= n; j++)\n          a[i][j] -= m;\n      }\n      for (j = q; j <= n; j++) {\n        m = a[q][j];\n        for (i = q + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (i = q; i <= n; i++)\n          a[i][j] -= m;\n      }\n      sum += a[q][q];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "32488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid q(int l) {\n  for (int g = 0; g < l; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[g][h] = a[g][h + 1];\n  for (int g = 0; g < l - 1; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[h][g] = a[h + 1][g];\n}\nint f(int y) {\n  int min, now;\n  if (y == 1)\n    return 0;\n  for (int g = 0; g < y; g++) {\n    min = a[g][0];\n    for (int h = 1; h < y; h++)\n      if (a[g][h] < min)\n        min = a[g][h];\n    for (int h = 0; h < y; h++)\n      a[g][h] -= min;\n  }\n  for (int g = 0; g < y; g++) {\n    min = a[0][g];\n    for (int h = 1; h < y; h++)\n      if (a[h][g] < min)\n        min = a[h][g];\n    for (int h = 0; h < y; h++)\n      a[h][g] -= min;\n  }\n  now = a[1][1];\n  q(y);\n  return now + f(y - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"\\n%d\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint gl(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < k; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return (a[1][1]);\n}\nvoid xj(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[j - 1][i] = a[j][i];\n    }\n  }\n}\nint main() {\n  int i, k;\n  cin >> k;\n  for (i = 0; i < k; i++) {\n    int j, l, sum = 0, a[102][102];\n    for (j = 0; j < k; j++) {\n      for (l = 0; l < k; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 0; j < k - 1; j++) {\n      int temp;\n      temp = gl(a, k - j);\n\n      sum = sum + temp;\n      xj(a, k - j);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32490", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum, min, i, j, p, k, (*q)[100];\n  q = a;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(q + i) + j);\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + i) + j);\n          else {\n            if (*(*(q + i) + j) < min)\n              min = *(*(q + i) + j);\n          }\n        }\n        for (j = 0; j < k; j++)\n          *(*(q + i) + j) = *(*(q + i) + j) - min;\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + j) + i);\n          else {\n            if (*(*(q + j) + i) < min)\n              min = *(*(q + j) + i);\n          }\n        }\n        for (j = 0; j < k; j++) {\n          *(*(q + j) + i) = *(*(q + j) + i) - min;\n        }\n      }\n      sum += *(*(q + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + 0) + i) = *(*(q + 0) + i + 1);\n      }\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + i) + 0) = *(*(q + i + 1) + 0);\n      }\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++) {\n          *(*(q + i) + j) = *(*(q + i + 1) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32491", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint findmin(int *a, int n, int step) {\n  int min = 32767;\n  while (n > 0) {\n    if (min > *a)\n      min = *a;\n    a += step;\n    n--;\n  }\n  return min;\n}\n\nint main() {\n  int n, k, a[100][100], i, j, l, sum, t;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (i = n; i >= 2; i--) {\n      for (j = 0; j < i; j++) {\n        t = findmin(a[j], i, 1);\n        for (l = 0; l < i; l++)\n          a[j][l] -= t;\n      }\n      for (j = 0; j < i; j++) {\n        t = findmin(&a[0][j], i, 100);\n        for (l = 0; l < i; l++)\n          a[l][j] -= t;\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < i - 1; j++) {\n        for (l = 0; l < i; l++)\n          a[j][l] = a[j + 1][l];\n        for (l = 0; l < i; l++)\n          a[l][j] = a[l][j + 1];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32492", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nvoid putout(int a[1000][1000], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b,\n          int num) \n{\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b,\n          int num) \n{\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(\n    int a[1000][1000], int num,\n    int out) \n{\n  for (int i = 0; i < num; i++) \n    cut1(a, i, num);\n  for (int i = 0; i < num; i++) \n    cut2(a, i, num);\n  out = out + a[1][1];              \n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--; \n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000);\n    for (int i = 0; i < n; i++) \n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0); \n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal(int a[100][101], int n) {\n  int i, j, k, min, t = 0, p, b[100][101] = {0};\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 1;\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  t = a[1][1];\n  b[0][0] = a[0][0];\n  if (n == 2)\n    return a[1][1];\n  for (i = 2; i < n; i++) {\n    b[i - 1][0] = a[i][0];\n    b[0][i - 1] = a[0][i];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      b[i - 1][j - 1] = a[i][j];\n    }\n  }\n  return t + cal(b, n - 1);\n}\nint main() {\n  int n, i, j, k, m, t, a[100][101] = {0}, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    } \n    printf(\"%d\\n\", cal(a, n));\n  }\n}\n"}
{"label": "18", "index": "32494", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, N, sum = 0,\n            min; \n  cin >> n;\n  int jz[n][n][n];\n  int i, j, k, t; \n\n  for (k = 0; k < n; k++) { \n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) { \n    sum = 0;\n    N = n;\n\n    for (t = 1; t < n; t++) { \n\n      for (i = 0; i < N; i++) { \n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      for (j = 0; j < N; j++) { \n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1]; \n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++)\n          jz[k][i][j] = jz[k][i + 1][j]; \n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < n; i++)\n          jz[k][i][j] = jz[k][i][j + 1];\n      }\n\n      N = N - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint t = 0;\nint sum(int n, int a[100][100]) {\n  if (n == 1)\n    return 1;\n  int i, j, k, min;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++) {\n      if (a[j][k] < min) {\n        min = a[j][k];\n      }\n    }\n    for (k = 0; k < n; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++) {\n      if (a[k][j] < min)\n        min = a[k][j];\n    }\n    for (k = 0; k < n; k++) {\n      a[k][j] -= min;\n    }\n  }\n\n  t += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n\n  sum(n - 1, a);\n  return t;\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n, a) << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32496", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, a[100][100];\n  int min, k;\n  cin >> n;\n  int tn, sum;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    tn = n;\n    while (tn > 1) {\n\n      for (i = 0; i < tn; i++) {\n        min = a[i][0];\n        for (j = 0; j < tn; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tn; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < tn; i++) {\n        min = a[0][i];\n        for (j = 0; j < tn; j++) {\n          if (min > a[j][i])\n            min = a[j][i];\n        }\n        for (j = 0; j < tn; j++) {\n          a[j][i] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[j][i] = a[j][i + 1];\n      }\n      tn--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32497", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int a[100][100], int);\nint main() {\n  int n, a[100][100], i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    printf(\"%d\\n\", cut(a, n));\n  }\n  return 0;\n}\nint cut(int a[100][100], int n) {\n  int i, j, min, count;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      min = (min > a[i][j]) ? a[i][j] : min;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      min = (min > a[j][i]) ? a[j][i] : min;\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  count = a[1][1];\n  if (n == 2)\n    return count;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  }\n  return (cut(a, n - 1) + count);\n}\n"}
{"label": "18", "index": "32498", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int min(int x[], int y);\n  int i, j, k, n, a[200][200], b[200], sum, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[k][j]);\n      }\n    }\n\n    for (t = n; t >= 2; t--) {\n\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++) {\n          b[k] = a[k][j];\n        }\n        for (k = 1; k <= t; k++) {\n          a[k][j] -= min(b, t);\n        }\n      }\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++)\n          b[k] = a[j][k];\n\n        for (k = 1; k <= t; k++) {\n          a[j][k] -= min(b, t);\n        }\n      }\n      sum += a[2][2];\n      for (j = 3; j <= t; j++) {\n        for (k = 3; k <= t; k++) {\n          a[k - 1][j - 1] = a[k][j];\n        }\n      }\n      for (j = 3; j <= t; j++) {\n        a[1][j - 1] = a[1][j];\n      }\n      for (j = 3; j <= t; j++) {\n        a[j - 1][1] = a[j][1];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint min(int x[], int y) {\n  int i, min = 999999;\n  for (i = 1; i <= y; i++) {\n    if (x[i] < min)\n      min = x[i];\n  }\n  return (min);\n}\n"}
{"label": "18", "index": "32499", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101], n, b[101][101];\nvoid f() {\n  int i, j, num, ans = 0, min;\n  num = n;\n  while (num >= 2) {\n    for (i = 1; i <= num; i++) {\n      min = a[i][1];\n      for (j = 1; j <= num; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 1; j <= num; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= num; j++) {\n      min = a[1][j];\n      for (i = 1; i <= num; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (i = 1; i <= num; i++)\n        a[i][j] -= min;\n    }\n    ans += a[2][2];\n    b[1][1] = a[1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[i][1] = a[i + 1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[1][i] = a[1][i + 1];\n    for (i = 2; i <= num - 1; i++)\n      for (j = 2; j <= num - 1; j++)\n        b[i][j] = a[i + 1][j + 1];\n    for (i = 1; i <= num - 1; i++)\n      for (j = 1; j <= num - 1; j++)\n        a[i][j] = b[i][j];\n    num--;\n  }\n  printf(\"%d\\n\", ans);\n}\n\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32500", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid guiling(int a[][100], int);\nvoid xiaojian(int a[][100], int);\nint main() {\n  int n, a[100][100], k, i, j, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int t = 0; t < n - 1; t++) {\n      guiling(a, n - t);\n      sum += a[1][1];\n      xiaojian(a, n - t);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid guiling(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int a[][100], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n}\n"}
{"label": "18", "index": "32501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid rezero();\nvoid dele();\nint a[100][100], n, b, sum = 0;\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    b = n;\n    rezero();\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid rezero() {\n  int i, j, k, min;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 0; j < b; j++) {\n        if (a[i][j] <= min)\n          min = a[i][j];\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      min = a[0][i];\n      for (j = 0; j < b; j++) {\n        if (a[j][i] <= min)\n          min = a[j][i];\n      }\n      for (j = 0; j < b; j++) {\n        a[j][i] -= min;\n      }\n    }\n    dele();\n    b -= 1;\n  }\n}\nvoid dele() {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < b; i++)\n    for (j = 1; j < b - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < b - 1; j++) {\n    for (i = 1; i < b - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\n"}
{"label": "18", "index": "32502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint func(int a[100][100], int rank, int sum) {\n  if (rank == 1)\n    return (sum);\n  int i, j, k, min = 1000;\n  for (i = 0; i <= rank - 1; i++) {\n    for (j = 0; j <= rank - 1; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= rank - 1; j++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  for (j = 0; j <= rank - 1; j++) {\n    for (i = 0; i <= rank - 1; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= rank - 1; i++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  sum += a[1][1];\n  for (j = 1; j <= rank - 2; j++)\n    a[0][j] = a[0][j + 1];\n  for (i = 1; i <= rank - 2; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i <= rank - 2; i++) {\n    for (j = 1; j <= rank - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  func(a, rank - 1, sum);\n}\nint main() {\n  int n, i, j, k;\n  int matrix[100][100] = {{0}}, sum = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &matrix[i][j]);\n    }\n    printf(\"%d\\n\", func(matrix, n, sum));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32503", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min = 0, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  return sum + f(n - 1);\n}\nint main() {\n  int i, n, j, k, x, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    x = f(n);\n    cout << x << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int num = 0;\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - num; i++) {\n        int rowm = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (a[i][j] < rowm)\n            rowm = a[i][j];\n        }\n        for (j = 0; j < n - num; j++)\n          a[i][j] = a[i][j] - rowm;\n      }\n      for (j = 0; j < n - num; j++) {\n        int colm = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (a[i][j] < colm)\n            colm = a[i][j];\n        }\n        for (i = 0; i < n - num; i++)\n          a[i][j] = a[i][j] - colm;\n      }\n      sum = sum + a[1][1];\n\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i - 1][j] = a[i][j];\n      }\n\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++)\n          a[i][j - 1] = a[i][j];\n      }\n      num++;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32505", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  int sum, Min;\n  cin >> n;\n  for (int num = 0; num < n; num++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int x = 1; x < n; x++) {\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int col = 0; col < n; col++)\n          if (a[i][col] >= 0)\n            Min = Min < a[i][col] ? Min : a[i][col];\n        for (int col = 0; col < n; col++)\n          a[i][col] -= Min;\n      }\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int row = 0; row < n; row++)\n          if (a[row][i] >= 0)\n            Min = Min < a[row][i] ? Min : a[row][i];\n        for (int row = 0; row < n; row++)\n          a[row][i] -= Min;\n      }\n      sum += a[x][x];\n      for (int i = 0; i < n; i++)\n        a[x][i] = -1;\n      for (int i = 0; i < n; i++)\n        a[i][x] = -1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min2;\nint min1;\nvoid diguihang(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min1 = a[i][0];\n  for (int j = 0; j < n; j++) {\n    if (a[i][j] < min1)\n      min1 = a[i][j];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[i][v] = a[i][v] - min1;\n  }\n  diguihang(i - 1, n, a);\n}\n\nvoid diguilie(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min2 = a[0][i];\n  for (int j = 0; j < n; j++) {\n\n    if (a[j][i] < min2)\n      min2 = a[j][i];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[v][i] = a[v][i] - min2;\n  }\n  diguilie(i - 1, n, a);\n}\n\nint change(int n, int sum, int a[300][300]) {\n  if (n == 1)\n    return sum;\n\n  diguihang(n - 1, n, a);\n  diguilie(n - 1, n, a);\n  sum = sum + a[1][1];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n - 1; i++)\n      a[i][j] = a[i][j + 1];\n\n  return change(n - 1, sum, a);\n}\nint main() {\n  int N;\n  int a[300][300];\n  cin >> N;\n  for (int i = 1; i <= N; i++) {\n    for (int j = 0; j < N; j++)\n      for (int y = 0; y < N; y++) {\n        cin >> a[j][y];\n      }\n    cout << change(N, 0, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000 * sizeof(int));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[49][49][49];\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> sz[i][j][k];\n      }\n    }\n  }\n  int nn, min;\n  int re[49] = {0};\n  for (i = 1; i <= n; i++) {\n    for (nn = 1; nn <= n - 1; nn++) {\n      for (j = nn; j <= n; j++) {\n        min = sz[i][j][nn];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][j][k] < min) {\n              min = sz[i][j][k];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][j][k] -= min;\n          }\n        }\n      }\n      for (j = nn; j <= n; j++) {\n        min = sz[i][nn][j];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][k][j] < min) {\n              min = sz[i][k][j];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][k][j] -= min;\n          }\n        }\n      }\n      re[i] += sz[i][nn + 1][nn + 1];\n      sz[i][nn + 1][nn + 1] = sz[i][nn][nn];\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][nn + 1][j] = sz[i][nn][j];\n      }\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][j][nn + 1] = sz[i][j][nn];\n      }\n    }\n    printf(\"%d\\n\", re[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, num, ans, a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    ans = 0;\n    for (num = 0; num < n - 1; num++) {\n      int min1, min2;\n      for (i = 0; i < n - num; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (min1 > a[i][j])\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - num; j++) {\n          a[i][j] -= min1;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (min2 > a[i][j])\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - num; i++) {\n          a[i][j] -= min2;\n        }\n      }\n      ans += a[1][1];\n      for (i = 1; i < n - num - 1; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < n - num - 1; j++) {\n        for (i = 0; i < n - num - 1; i++)\n          a[i][j] = a[i][j + 1];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int change(int a[100][100], int);\n  int n, a[100][100], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    printf(\"%d\\n\", change(a, n));\n  }\n  return 0;\n}\nint change(int a[100][100], int n) {\n  int i, j, s, b[100][100], f;\n  for (i = 0; i < n; i++) {\n    s = a[i][0];\n    for (j = 0; j < n; j++)\n      s = (s > a[i][j]) ? a[i][j] : s;\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - s;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    s = a[0][i];\n    for (j = 0; j < n; j++) {\n      s = (s > a[j][i]) ? a[j][i] : s;\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  f = a[1][1];\n  if (n > 2) {\n    b[0][0] = a[0][0];\n    for (i = 2; i < n; i++) {\n      b[0][i - 1] = a[0][i];\n      b[i - 1][0] = a[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        b[i - 1][j - 1] = a[i][j];\n    f = f + change(b, n - 1);\n  }\n  return f;\n}\n"}
{"label": "18", "index": "32511", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0};\n\nvoid function_1(int n) {\n  int i, j, k, min, num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = n; i > 1; i--) {\n    for (j = 0; j < i; j++) {\n      min = a[j][0];\n      for (k = 0; k < i; k++) {\n        if (a[j][k] < min)\n          min = a[j][k];\n      }\n      for (k = 0; k < i; k++) {\n        a[j][k] = a[j][k] - min;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      min = a[0][j];\n      for (k = 0; k < i; k++) {\n        if (a[k][j] < min)\n          min = a[k][j];\n      }\n      for (k = 0; k < i; k++) {\n        a[k][j] = a[k][j] - min;\n      }\n    }\n    num = num + a[1][1];\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (j == 0 && k > 1)\n          a[j][k - 1] = a[j][k];\n        if (k == 0 && j > 1)\n          a[j - 1][k] = a[j][k];\n        if (j > 1 && k > 1)\n          a[j - 1][k - 1] = a[j][k];\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1(n);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, d, c, s, t, min1, min2;\n  scanf(\"%d \", &n);\n  int a[n][n][n], b[n][n];\n  for (i = 0; i < n; i++) {\n    int h = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min1 = a[i][j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min1 > a[i][j][k])\n            min1 = a[i][j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[i][j][k] = a[i][j][k] - min1;\n      }\n      for (d = 0; d < n - l; d++) {\n        min2 = a[i][0][d];\n        for (c = 1; c < n - l; c++) {\n          if (min2 > a[i][c][d])\n            min2 = a[i][c][d];\n        }\n        for (c = 0; c < n - l; c++)\n          a[i][c][d] = a[i][c][d] - min2;\n      }\n      b[i][l] = a[i][1][1];\n      for (s = 1; s < n - 1 - l; s++)\n        for (t = 0; t < n - l; t++)\n          a[i][s][t] = a[i][s + 1][t];\n      for (t = 1; t < n - l - 1; t++)\n        for (s = 0; s < n - l - 1; s++)\n          a[i][s][t] = a[i][s][t + 1];\n    }\n    for (l = 0; l < n - 1; l++)\n      h = h + b[i][l];\n    cout << h << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32513", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, sum, min;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i - 1][j] = a[i][j];\n      for (j = 2; j < k; j++)\n        for (i = 0; i < k - 1; i++)\n          a[i][j - 1] = a[i][j];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], sum;\nint del(int m) {\n  if (m == 1)\n    return sum;\n  int min;\n  for (int i = 0; i < m; i++) {\n    min = a[i][0];\n    for (int j = 1; j < m; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < m; j++) {\n    min = a[0][j];\n    for (int i = 1; i < m; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < m; i++)\n      a[i][j] -= min;\n  }\n  sum += a[1][1];\n  for (int j = 1; j < m - 1; j++)\n    a[0][j] = a[0][j + 1];\n  for (int i = 1; i < m - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < m - 1; i++)\n    for (int j = 1; j < m - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return del(m - 1);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    cout << del(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32515", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint func(int a[100][100], int rank, int sum) {\n  if (rank == 1)\n    return (sum);\n  int i, j, min = 1000;\n  for (i = 0; i <= rank - 1; i++) {\n    for (j = 0; j <= rank - 1; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= rank - 1; j++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  for (j = 0; j <= rank - 1; j++) {\n    for (i = 0; i <= rank - 1; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= rank - 1; i++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  sum += a[1][1];\n  for (j = 1; j <= rank - 2; j++)\n    a[0][j] = a[0][j + 1];\n  for (i = 1; i <= rank - 2; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i <= rank - 2; i++) {\n    for (j = 1; j <= rank - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  func(a, rank - 1, sum);\n}\nint main() {\n  int n, i, j, k;\n  int matrix[100][100] = {{0}}, sum = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &matrix[i][j]);\n    }\n    printf(\"%d\\n\", func(matrix, n, sum));\n  }\n}\n"}
{"label": "18", "index": "32516", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int, int[][101]);\nvoid Delete(int, int[][101]);\nint min(int, int);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", GL(n, a));\n  }\n\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum = 0, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = 999999;\n    for (j = 0; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] -= MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = 999999;\n    for (i = 0; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] -= MIN;\n  }\n\n  Sum += a[1][1];\n\n  if (n == 1) {\n    return 0;\n\n  } else {\n    Delete(n, a);\n    Sum += GL(n - 1, a);\n    return Sum;\n  }\n}\n\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\nvoid Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n}\n"}
{"label": "18", "index": "32517", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint min(int a[100][100], int, int, int);\nint main() {\n  int n, a[100][100], m, j, k, t;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    m = 0;\n    for (int l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 0, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= t;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 1, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[k][j] -= t;\n        }\n      }\n      m += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (j = 0; j < n - l - 1; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    cout << m << endl;\n  }\n  return 0;\n}\n\nint min(int a[100][100], int s, int l, int n) {\n  int t;\n  if (s == 0) {\n    t = a[l][0];\n    for (int i = 0; i < n; i++) {\n      if (t > a[l][i])\n        t = a[l][i];\n    }\n  } else {\n    t = a[0][l];\n    for (int j = 0; j < n; j++) {\n      if (t > a[j][l])\n        t = a[j][l];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "32518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, q, i, j, min1[100], min2[100], a[100][100], d, w;\n  scanf(\"%d \", &n);\n  w = n;\n  for (q = 0; q < w; q++) {\n\n    d = 0;\n    n = w;\n    for (i = 0; i < w; i++) {\n      for (j = 0; j < w; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    while (n >= 2) {\n      for (i = 0; i < n; i++)\n        min1[i] = 1000;\n      for (i = 0; i < n; i++)\n        min2[i] = 1000;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (min1[i] > a[i][j]) {\n            min1[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min1[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (min2[j] > a[i][j]) {\n            min2[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min2[j];\n        }\n      }\n      d += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (i = 2; i < n; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int maze[100 + 10][100 + 10] = {0};\n\n  int i, j, k, l;\n  int n;\n  cin >> n;\n\n  for (k = 0; k < n; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> maze[i][j];\n\n    for (l = n; l >= 2; l--) {\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + i) + j) ? min : *(*(maze + i) + j);\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) -= min;\n      }\n\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + j) + i) ? min : *(*(maze + j) + i);\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) -= min;\n      }\n      sum += *(*(maze + 1) + 1);\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) = *(*(maze + i + 1) + j);\n      }\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) = *(*(maze + j) + i + 1);\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, num, ans, a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    ans = 0;\n    for (num = 0; num < n - 1; num++) {\n      int min1, min2;\n      for (i = 0; i < n - num; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (min1 > a[i][j])\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - num; j++)\n          a[i][j] -= min1;\n      }\n      for (j = 0; j < n - num; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (min2 > a[i][j])\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - num; i++)\n          a[i][j] -= min2;\n      }\n      ans += a[1][1];\n      for (i = 1; i < n - num - 1; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < n - num - 1; j++) {\n        for (i = 0; i < n - num - 1; i++)\n          a[i][j] = a[i][j + 1];\n      }\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32521", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid zero1(int *p, int n) {\n  int i, c;\n  c = *p;\n  for (i = 1; i < n; i++)\n    if (*(p + i) < c)\n      c = *(p + i);\n  for (i = 0; i < n; i++)\n    p[i] = p[i] - c;\n}\nvoid zero2(int **p, int n, int t) {\n  int i, c;\n  c = *(*p + t);\n  for (i = 1; i < n; i++)\n    if (*(*(p + i) + t) < c)\n      c = *(*(p + i) + t);\n  for (i = 0; i < n; i++)\n    *(*(p + i) + t) = *(*(p + i) + t) - c;\n}\nvoid cut(int **p, int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + j) + i) = *(*(p + j) + i + 1);\n}\nint main() {\n  int n, m, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &m);\n  p = (int **)malloc(m * sizeof(int *));\n  for (i = 0; i < m; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (w = 0; w < m; w++) {\n    n = m;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + i) + j);\n    for (i = 0; i < n; i++)\n      zero1(p[i], n);\n    for (i = 0; i < n; i++)\n      zero2(p, n, i);\n    c = p[1][1];\n    for (i = 0; i < m - 2; i++) {\n      cut(p, n);\n      n--;\n      for (j = 0; j < n; j++)\n        zero1(p[j], n);\n      for (j = 0; j < n; j++)\n        zero2(p, n, j);\n      c += p[1][1];\n    }\n    printf(\"%d\\n\", c);\n  }\n  for (i = 0; i < n; i++) {\n    free(p[i]);\n  }\n  free(p);\n  return 0;\n}\n"}
{"label": "18", "index": "32522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[201][201];\nint i, j, sum;\nint min1[201], min2[201];\nvoid read();\nvoid del(int);\nvoid move(int);\nint main() {\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    read();\n    sum = 0;\n    for (j = 0; j < n - 1; ++j) {\n\n      del(n - j);\n      sum = sum + a[1][1];\n      move(n - j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid read() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n}\nvoid del(int n) {\n  for (i = 0; i < n; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min1[i])\n        min1[i] = a[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min1[i];\n\n  for (i = 0; i < n; i++) {\n    min2[i] = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min2[i])\n        min2[i] = a[j][i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min2[i];\n}\nvoid move(int n) {\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n}\n"}
{"label": "18", "index": "32523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint w[200][200];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int x = 0; x < n; x++)\n      for (int y = 0; y < n; y++)\n        cin >> w[x][y];\n    int s = 0;\n    for (int m = 1; m < n; m++) {\n      for (int x = 0; x < n; x++) {\n        int minn = w[x][0];\n        for (int y = m; y < n; y++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[x][0] -= minn;\n        for (int y = m; y < n; y++)\n          w[x][y] -= minn;\n      }\n      for (int y = 0; y < n; y++) {\n        int minn = w[0][y];\n        for (int x = m; x < n; x++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[0][y] -= minn;\n        for (int x = m; x < n; x++)\n          w[x][y] -= minn;\n      }\n      s += w[m][m];\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m;\nint a[100][100];\nint sum = 0;\n\nvoid d(int n) {\n  int min;\n\n  for (int i = 0; i < n; i++) {\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  if (n > 2)\n    d(n - 1);\n}\nint main() {\n\n  cin >> m;\n  int s[m + 1], p = 1;\n  for (int t = 1; t <= m; t++) {\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        scanf(\"%d \", &a[i][j]);\n    d(m);\n    s[p++] = sum;\n    sum = 0;\n  }\n  for (int i = 1; i <= m; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32525", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, x, y, min, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (x = 0; x < n; x++) {\n      for (y = 0; y < n; y++) {\n        scanf(\"%d\", &a[x][y]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      for (x = 0; x < j; x++) {\n        min = a[x][0];\n        for (y = 1; y < j; y++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (y = 0; y < j; y++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (y = 0; y < j; y++) {\n        min = a[0][y];\n        for (x = 1; x < j; x++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (x = 0; x < j; x++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (k = 2; k < j; k++) {\n        a[0][k - 1] = a[0][k];\n      }\n      for (k = 2; k < j; k++) {\n        a[k - 1][0] = a[k][0];\n      }\n      sum = sum + a[1][1];\n      for (x = 2; x < j; x++) {\n        for (y = 2; y < j; y++) {\n          a[x - 1][y - 1] = a[x][y];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32526", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid shuru(int);\nvoid guiling(int);\n\nint num[100][100] = {0};\nint sum = 0;\n\nint main() {\n  int n = 0;\n  int i = 0;\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    shuru(n);\n  }\n\n  return 0;\n}\n\nvoid shuru(int n) {\n  int i = 0;\n  int j = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &num[i][j]);\n\n  guiling(n);\n}\n\nvoid guiling(int n) {\n  if (n == 1)\n    cout << sum << endl;\n  else {\n    int min = 0;\n\n    int t = 0;\n    int i = 0;\n\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[i][t])\n          min = num[i][t];\n      }\n\n      for (t = 0; t < n; t++)\n        num[i][t] -= min;\n    }\n\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[t][i])\n          min = num[t][i];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[t][i] -= min;\n      }\n    }\n\n    sum += num[1][1];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[i][t - 1] = num[i][t];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[t - 1][i] = num[t][i];\n\n    guiling(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32527", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, num, ans, a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    ans = 0;\n    for (num = 0; num < n - 1; num++) {\n      int min1, min2;\n      for (i = 0; i < n - num; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (min1 > a[i][j])\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - num; j++)\n          a[i][j] -= min1;\n      }\n      for (j = 0; j < n - num; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (min2 > a[i][j])\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - num; i++)\n          a[i][j] -= min2;\n      }\n      ans += a[1][1];\n      for (i = 1; i < n - num - 1; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < n - num - 1; j++) {\n        for (i = 0; i < n - num - 1; i++)\n          a[i][j] = a[i][j + 1];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum, a[101][101];\nvoid g0(int n) {\n  if (n == 1)\n    return;\n  else {\n    int min;\n    for (int i = 1; i <= n; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[i][j] ? min : a[i][j];\n      for (int j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (int i = 1; i <= n; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[j][i] ? min : a[j][i];\n      for (int j = 1; j <= n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[2][2];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[i][j] = a[i + 1][j];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n  g0(n - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    g0(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minx[1000], miny[1000];\nint n, m, a[105][105], b[105][105];\nvoid calc_min() {\n  for (int i = 0; i < m; i++) {\n    minx[i] = 100000;\n    miny[i] = 100000;\n  }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n      \n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= minx[i];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n      \n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= miny[j];\n}\nvoid calc_delete() {\n\n  for (int i = 0; i < m; i++)\n    if (i - 1 != 0)\n      for (int j = 0; j < m; j++) {\n        if (j == 1)\n          continue;\n        int x = i, y = j;\n        if (x)\n          x--;\n        if (y)\n          y--;\n        b[x][y] = a[i][j];\n      }\n  m--;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] = b[i][j];\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int ans = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    m = n;\n\n    while (m > 2) {\n\n      calc_min();\n      ans += a[1][1];\n      calc_delete();\n    }\n    calc_min();\n    ans += a[1][1];\n    cout << ans << endl;\n  }\n\n  \n\n  return 0;\n}\n"}
{"label": "18", "index": "32530", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid min(int a[100][100], int);\nvoid newa(int a[100][100], int);\nint main() {\n  int i, j, k, n, a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    min(a, n);\n  }\n  return 0;\n}\nvoid min(int a[][100], int n) {\n  int i, j, k, m, x, y, sum = 0;\n  for (m = n; m > 1; m--) {\n    for (i = 0; i < m; i++) {\n      x = a[i][0];\n      for (j = 1; j < m; j++) {\n        if (x > a[i][j])\n          x = a[i][j];\n      }\n      for (k = 0; k < m; k++) {\n        a[i][k] -= x;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      y = a[0][i];\n      for (j = 1; j < m; j++) {\n        if (y > a[j][i])\n          y = a[j][i];\n      }\n      for (k = 0; k < m; k++) {\n        a[k][i] -= y;\n      }\n    }\n    sum += a[1][1];\n    newa(a, m);\n  }\n  cout << sum << endl;\n}\nvoid newa(int a[][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[j - 1][i] = a[j][i];\n}\n"}
{"label": "18", "index": "32531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, s = 0;\n  int a[200][200];\n  int(*p)[200] = a;\n  cin >> n;\n  m = n;\n  for (int q = 0; q < m; q++) {\n    s = 0;\n    n = m;\n    for (int i = 0; i < m; i++) \n      for (int j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    for (int w = 0; w < m - 1; w++) {\n      for (int i = 0; i < n; i++) \n      {\n        int l = *(*(p + i));\n        for (int j = 0; j < n; j++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      for (int j = 0; j < n; j++) \n      {\n        int l = *(*(p) + j);\n        for (int i = 0; i < n; i++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      s = s + *(*(p + 1) + 1);\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n - 1; i++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      n--;\n    }\n    cout << s << endl;\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "32532", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[i][0];\n    for (int j = 1; j < k; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[i][j] -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[0][i];\n    for (int j = 1; j < k; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[j][i] -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++)\n      a[i - 1][j] = a[i][j];\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      a[i][j - 1] = a[i][j];\n}\nint main() {\n  cin >> n;\n  while (cin >> a[0][0]) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> a[i][j];\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += a[1][1];\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101], sum = 0;\n\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min;\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min2;\n    min2 = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (a[i][j] < min2) {\n        min2 = a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min2;\n    }\n  }\n}\n\nvoid subtract(int n) {\n  if (n > 2) {\n    for (int j = 2; j < n; j++) {\n      a[0][j - 1] = a[0][j];\n    }\n    for (int i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n    }\n    for (int i = 2; i < n; i++) {\n      for (int j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n  }\n}\n\nvoid process(int n) {\n  if (n != 1) {\n    zero(n);\n    sum += a[1][1];\n    subtract(n);\n    process(n - 1);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int p = 0; p < n; p++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    process(n);\n    cout << sum;\n    if (p != n - 1) {\n      cout << endl;\n    }\n    sum = 0;\n  }\n}\n"}
{"label": "18", "index": "32534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint a[100][100];\nint n;\n\nvoid scan(int m) {\n  int i, j;\n  for (i = 0; i <= m - 1; ++i) {\n    for (j = 0; j <= m - 1; ++j) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n}\n\nint minofc(int m) {\n  int i, min = a[m][0];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  return min;\n}\n\nint minofr(int m) {\n  int i, min = a[0][m];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  return min;\n}\n\nvoid tozero() {\n  int i, j;\n  for (i = 0; i <= n - 1; ++i) {\n    int min = minofc(i);\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    int min = minofr(j);\n    for (i = 0; i <= n - 1; ++i) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n}\n\nvoid eliminate() {\n  int i, j;\n  for (i = 1; i <= n - 2; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  int p = n;\n  int i, j;\n  for (i = 1; i <= n; ++i) {\n    int sum = 0;\n    scan(n);\n    do {\n      tozero();\n      sum = sum + a[1][1];\n      eliminate();\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[110][110] = {0};\n    int min = 10000, s = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (int m = 1; m < n; m++) {\n      for (int j = 0; j < n; j++) {\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      for (int k = 0; k < n; k++) {\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      s = s + a[m][m];\n      for (int j = 0; j < n; j++)\n        a[j][m] = 100000;\n      for (int j = 0; j < n; j++)\n        a[m][j] = 100000;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32536", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, t, k, tem, min, sum;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    tem = n;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < tem; i++) {\n        min = a[i][0];\n        for (j = 1; j < tem; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tem; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < tem; j++) {\n        min = a[0][j];\n        for (i = 1; i < tem; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < tem; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < tem; i++) {\n        for (j = 0; j < tem; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < tem; j++) {\n        for (i = 0; i < tem; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      tem--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32537", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[101][101];\nint main() {\n  int n, i, j, b, k, l, m, s;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    s = n, b = 0;\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[k][l] < m)\n            m = a[k][l];\n\n        for (l = 0; l < s; l++)\n          a[k][l] -= m;\n      }\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[l][k] < m) {\n            m = a[l][k];\n          }\n\n        for (l = 0; l < s; l++)\n          a[l][k] -= m;\n      }\n\n      b += a[1][1];\n\n      for (k = 0; k < s; k++) {\n        for (l = 0; l < s; l++) {\n          if (k == 0 && l > 1) {\n            a[k][l - 1] = a[k][l];\n          } else if (k > 1 && l == 0) {\n            a[k - 1][l] = a[k][l];\n          } else if (k > 1 && l > 1) {\n            a[k - 1][l - 1] = a[k][l];\n          }\n        }\n      }\n      s--;\n    }\n    cout << b << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, sum = 0, s2;\n  cin >> n;\n  s2 = n;\n  for (i = 1; i <= s2; i++) {\n    n = s2;\n    sum = 0;\n    int a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    while (n > 1) {\n      int s[100];\n      for (j = 0; j < n; j++)\n        s[j] = a[j][0];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[j][k] < s[j])\n            s[j] = a[j][k];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j][k] -= s[j];\n\n      int t[100];\n      for (j = 0; j < n; j++)\n        t[j] = a[0][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[k][j] < t[j])\n            t[j] = a[k][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[k][j] -= t[j];\n\n      sum += a[1][1];\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n\n      n--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, time = 0, sum = 0;\n  cin >> n;\n  int s = n;\n  int a[100][100], b[100], c[100];\n  for (time = 0; time < s;\n       time++) \n  {\n    for (i = 0; i < 100; i++) {\n      b[i] = 1000000;\n      c[i] = 1000000;\n    }\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < s; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0; \n    while (true) {\n      for (i = 0; i < 100; i++) {\n        b[i] = 1000000;\n        c[i] = 1000000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < b[i]) {\n            b[i] = a[i][j];\n          }\n        }\n      } \n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - b[i];\n        }\n      } \n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < c[j]) {\n            c[j] = a[i][j];\n          }\n        }\n      } \n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] = a[i][j] - c[j];\n        }\n      }                    \n      sum = sum + a[1][1]; \n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      } \n      for (j = 1; j < n - 1; j++) {\n        for (i = 0; i < n - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      } \n      n = n - 1;\n      if (n == 1) {\n        n = s;\n        break;\n      } \n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32540", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], sum = 0, p = 1, z, k, w, l, min;\n  int i, j, n;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    for (z = 0; z < n - 1; z++) {\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (k = 0; k < n; k++)\n          a[i][k] -= min;\n      }\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (k = 0; k < n; k++)\n          a[k][i] -= min;\n      }\n      sum += a[p][p];\n      for (l = 0; l < n; l++)\n        a[l][p] = 100000;\n      for (l = 0; l < n; l++)\n        a[p][l] = 100000;\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n    p = 1;\n    sum = 0;\n    memset(a, 1000000, sizeof(a));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, x, k;\n  scanf(\"%d\", &n);\n\n  for (x = 1; x <= n; x++) {\n    int j, i, a[1000][1000], *p, sum = 0;\n    p = &a[0][0];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p + 101 * i + j);\n    }\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        int min = *(*(a + i));\n        for (j = 0; j < k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        int min = *(*a + j);\n        for (i = 0; i < k; i++) {\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        }\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      }\n      for (j = 1; j < k - 1; j++) {\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32542", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100] = {0};\n  int min[100][100] = {0};\n  int n, i, j, k, l, s, sum[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (s = n; s > 1; s--) {\n      for (j = 0; j < s; j++) {\n        min[i][j] = a[i][j][0];\n        for (l = 0; l < s; l++) {\n          if (a[i][j][l] < min[i][j])\n            min[i][j] = a[i][j][l];\n        }\n        for (k = 0; k < s; k++)\n          a[i][j][k] = a[i][j][k] - min[i][j];\n      }\n      for (k = 0; k < s; k++) {\n        min[i][k] = a[i][0][k];\n        for (l = 0; l < s; l++) {\n          if (a[i][l][k] < min[i][k])\n            min[i][k] = a[i][l][k];\n        }\n        for (j = 0; j < s; j++)\n          a[i][j][k] = a[i][j][k] - min[i][k];\n      }\n      sum[i] = sum[i] + a[i][1][1];\n      for (j = 0; j < s; j++) {\n        for (k = 1; k < s - 1; k++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n      for (k = 0; k < s - 1; k++) {\n        for (j = 1; j < s - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32543", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum, n, a[105][105], flag2[105], min1[105], min2[105];\nvoid f(int x);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    f(n);\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\nvoid f(int x) {\n  if (x == n) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n  }\n  if (x == 1) {\n  } else {\n    for (int i = 0; i < x; i++) {\n      flag2[i] = 0;\n      min1[i] = 0;\n      min2[i] = 0;\n    }\n    for (int i = 0; i < x; i++) {\n      min1[i] = a[i][0];\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] < min1[i])\n          min1[i] = a[i][j];\n      }\n    }\n    for (int i = 0; i < x; i++) {\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] - min1[i] >= 0) {\n          a[i][j] = a[i][j] - min1[i];\n          if (a[i][j] == 0) {\n            flag2[j] = 1;\n          }\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        min2[j] = a[0][j];\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] < min2[j])\n            min2[j] = a[i][j];\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] - min2[j] >= 0) {\n            a[i][j] = a[i][j] - min2[j];\n          }\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (int i = 0; i < x; i++) {\n      for (int j = 1; j < x - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (int j = 0; j < x - 1; j++) {\n      for (int i = 1; i < x - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    f(x - 1);\n  }\n}\n"}
{"label": "18", "index": "32544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = *(*(a + j));\n        for (k = 1; k < i; k++)\n          if (*(*(a + j) + k) < min)\n            min = *(*(a + j) + k);\n        for (k = 0; k < i; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = *(*a + j);\n        for (k = 1; k < i; k++)\n          if (*(*(a + k) + j) < min)\n            min = *(*(a + k) + j);\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j - 1) = *(*(a + k) + j);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n    }\n    cout << sum << \"\\n\";\n    n1--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32545", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110];\n  int sum = 0;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n - 1; i++) {\n      int mi = 9999999;\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[j][m] < mi)\n            mi = a[j][m];\n        for (int m = 0; m < n - i; m++)\n          a[j][m] -= mi;\n      }\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[m][j] < mi)\n            mi = a[m][j];\n        for (int m = 0; m < n - i; m++)\n          a[m][j] -= mi;\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - i - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - i - 1; j++) {\n        a[j][0] = a[j + 1][0];\n        for (int m = 1; m < n - i - 1; m++)\n          a[j][m] = a[j + 1][m + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, n1, num[101][101], i, j, k, min = 99999, sum = 0;\n  int(*p)[101];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n\n    p = num;\n    for (; n1 >= 2; n1--) {\n\n      for (i = 0; i < n1; i++) {\n        for (j = 0; j < n1; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) -= min;\n        min = 99999;\n      }\n      min = 99999;\n      for (j = 0; j < n1; j++) {\n        for (i = 0; i < n1; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n1; i++)\n          num[i][j] -= min;\n        min = 99999;\n      }\n      sum += *(*(p + 1) + 1);\n      min = 99999;\n      for (i = 1; i < n1 - 1; i++)\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < n1 - 1; j++)\n        for (i = 0; i < n1; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[10000], *p, k = 0;\n  p = a;\n  cin >> n;\n  while (k < n) {\n    int total = 0, m = n;\n    k++;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(p + i * n + j);\n\n    while (m > 1) {\n      int min = 100000;\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < m; j++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (j = 0; j < m; j++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 0; j < m; j++) {\n        for (i = 0; i < m; i++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (i = 0; i < m; i++)\n          *(p + i * m + j) -= min;\n\n        min = 10000;\n      }\n      total += *(p + m + 1);\n      for (j = 2; j < m; j++)\n        *(p + j - 1) = *(p + j);\n      for (i = 2; i < m; i++) {\n        *(p + (i - 1) * (m - 1)) = *(p + i * m);\n        for (j = 2; j < m; j++)\n          *(p + (i - 1) * (m - 1) + j - 1) = *(p + i * m + j);\n      }\n      m--;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[100][100][100] = {0};\nint main() {\n  int n, sum[100] = {0};\n  cin >> n;\n  int i, j, k, t;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> array_1[i][j][k];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][k][0];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][k][t])\n            min = array_1[i][k][t];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][0][k];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][t][k])\n            min = array_1[i][t][k];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][t][k] = array_1[i][t][k] - min;\n      }\n      sum[i] = sum[i] + array_1[i][1][1];\n      for (k = 0; k <= n - j; k++)\n        for (t = 1; t < n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t + 1];\n      for (k = 0; k < n - j; k++)\n\n        for (t = 1; t < n - j; t++)\n          array_1[i][t][k] = array_1[i][t + 1][k];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, number[100][100], i, p, o, u, count, min;\n  scanf(\"%d\", &n);\n  for (o = 0; o < n; o++) {\n    for (i = 0; i < n; i++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d\", &number[i][p]);\n      }\n    }\n    count = 0;\n    for (u = 0; u < n - 1; u++) {\n      for (i = 0; i < n - u; i++) {\n        min = 999999;\n        for (p = 0; p < n - u; p++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (p = 0; p < n - u; p++) {\n          number[i][p] -= min;\n        }\n      }\n      for (p = 0; p < n - u; p++) {\n        min = 999999;\n        for (i = 0; i < n - u; i++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (i = 0; i < n - u; i++) {\n          number[i][p] -= min;\n        }\n      }\n      count += number[1][1];\n      for (i = 1; i < n - u - 1; i++) {\n        number[i][0] = number[i + 1][0];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        number[0][p] = number[0][p + 1];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        for (i = 1; i < n - u - 1; i++) {\n          number[i][p] = number[i + 1][p + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32550", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen(int);\nint zhen[100][100];\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    memset(zhen, 0, sizeof(zhen));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> zhen[i][j];\n      }\n    }\n    cout << juzhen(n) << endl;\n  }\n  return 0;\n}\nint juzhen(int n) {\n  int i, j, min, num;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = zhen[i][0];\n    for (j = 0; j < n; j++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      zhen[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = zhen[0][j];\n    for (i = 0; i < n; i++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      zhen[i][j] -= min;\n    }\n  }\n  num = zhen[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i > 1 && j > 1)\n        zhen[i - 1][j - 1] = zhen[i][j];\n      if (i > 1 && j < 1)\n        zhen[i - 1][j] = zhen[i][j];\n      if (i < 1 && j > 1)\n        zhen[i][j - 1] = zhen[i][j];\n    }\n  }\n  return num + juzhen(n - 1);\n}\n"}
{"label": "18", "index": "32551", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint juzhen[100][100];\nint m, n, sum, j, min001 = 0, min002 = 0;\nint min01[101], min02[101];\nint min1(int a) \n{\n  for (int p = 0; p < m; p++)\n    min01[p] = juzhen[a][p];\n  sort(min01, min01 + m);\n  return min01[0];\n}\nint min2(int a) \n{\n  for (int p = 0; p < m; p++)\n    min02[p] = juzhen[p][a];\n  sort(min02, min02 + m);\n  return min02[0];\n}\nvoid jia(int x, int y) {\n  if (y == 1)\n    cout << sum << endl;\n  else {\n    for (j = 0; j < y; j++) {\n      min001 = min1(j);\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j][k] - min001; \n    }\n    for (j = 0; j < y; j++) {\n      min002 = min2(j);\n      for (int k = 0; k < y; k++)\n        juzhen[k][j] = juzhen[k][j] - min002; \n    }\n    sum = sum + juzhen[1][1];\n    for (j = 1; j < y - 1; j++) {\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j + 1][k]; \n    }\n    for (j = 1; j < y; j++) {\n      for (int k = 0; k < y - 1; k++)\n        juzhen[k][j] = juzhen[k][j + 1]; \n    }\n    m = m - 1;\n    jia(x, y - 1);\n  }\n}\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    m = n;\n    for (j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> juzhen[j][k];\n    }\n    jia(i, m); \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32552", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) \n  {\n    min = a[i][0];\n    for (int j = 1; j < k; j++) \n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min)\n      for (int j = 0; j < k; j++) \n        a[i][j] -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) \n  {\n    min = a[0][i];\n    for (int j = 1; j < k; j++) \n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min)\n      for (int j = 0; j < k; j++) \n        a[j][i] -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++) \n    for (int j = 0; j < k; j++)\n      a[i - 1][j] = a[i][j];\n  for (int j = 2; j < n; j++) \n    for (int i = 0; i < k - 1; i++)\n      a[i][j - 1] = a[i][j];\n}\nint main() {\n  cin >> n; \n  while (cin >> a[0][0]) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> a[i][j];\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += a[1][1];\n      jian(k);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int min(int x[], int y);\n  int i, j, k, n, a[200][200], b[200], sum, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[k][j]);\n      }\n    }\n\n    for (t = n; t >= 2; t--) {\n\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++) {\n          b[k] = a[k][j];\n        }\n        for (k = 1; k <= t; k++) {\n          a[k][j] -= min(b, t);\n        }\n      }\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++)\n          b[k] = a[j][k];\n\n        for (k = 1; k <= t; k++) {\n          a[j][k] -= min(b, t);\n        }\n      }\n      sum += a[2][2];\n      for (j = 3; j <= t; j++) {\n        for (k = 3; k <= t; k++) {\n          a[k - 1][j - 1] = a[k][j];\n        }\n      }\n      for (j = 3; j <= t; j++) {\n        a[1][j - 1] = a[1][j];\n      }\n      for (j = 3; j <= t; j++) {\n        a[j - 1][1] = a[j][1];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint min(int x[], int y) {\n  int i, min = 999999;\n  for (i = 1; i <= y; i++) {\n    if (x[i] < min) {\n      min = x[i];\n    }\n  }\n  return (min);\n}\n"}
{"label": "18", "index": "32554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guiling(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i <= n; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n; j++) {\n    min = a[0][j];\n    for (i = 0; i <= n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid shanchu(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i <= n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j <= (n - 1); j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int a[100][100][100], i, j, k, sum, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[i][j][k]);\n      }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = n - 1; j >= 1; j--) {\n      guiling(a[i], j);\n      sum = sum + a[i][1][1];\n      shanchu(a[i], j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint f(int n, int a[][100]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 1; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n  }\n  int z = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  if (n == 2)\n    return z;\n  else\n    return z + f(n - 1, a);\n}\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << f(n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint calc(int s[][100], int n) {\n  int min;\n  for (int i = 0; i < n; i++) {\n    min = s[i][0];\n    for (int j = 1; j < n; j++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int j = 0; j < n; j++)\n      s[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = s[0][j];\n    for (int i = 1; i < n; i++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int i = 0; i < n; i++)\n      s[i][j] -= min;\n  }\n  return s[1][1];\n}\n\nint main() {\n  int s[100][100];\n  int n, sum, m;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> s[i][j];\n    m = n;\n    sum = 0;\n    for (int order = 1; order < n; order++) {\n      sum += calc(s, m);\n      m--;\n      for (int i = 1; i < n - 1; i++)\n        for (int j = 0; j < n; j++)\n          s[i][j] = s[i + 1][j];\n      for (int j = 1; j < n - 1; j++)\n        for (int i = 0; i < m; i++)\n          s[i][j] = s[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32557", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint an[1000][1000];\n\nint hang[1000], lie[1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, l, p, q;\n\n  for (l = 0; l < n; l++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> an[i][j];\n    }\n\n    int sum = 0;\n\n    for (k = n; k > 0; k--) {\n\n      for (p = 0; p < k; p++) {\n        hang[p] = an[p][0];\n        for (q = 0; q < k; q++) {\n          if (hang[p] > an[p][q])\n            hang[p] = an[p][q];\n        }\n        for (q = 0; q < k; q++)\n          an[p][q] = an[p][q] - hang[p];\n      }\n\n      for (q = 0; q < k; q++) {\n        lie[q] = an[0][q];\n        for (p = 0; p < k; p++) {\n          if (lie[q] > an[p][q])\n            lie[q] = an[p][q];\n        }\n        for (p = 0; p < k; p++)\n          an[p][q] = an[p][q] - lie[q];\n      }\n\n      sum = sum + an[1][1];\n\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k; j++)\n          an[i][j] = an[i][j + 1];\n      }\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < k; j++)\n          an[i][j] = an[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32558", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  static int s = 0;\n  int i, j;\n  double m1, m2;\n  int *p;\n\n  if (n == 1) {\n    printf(\"%d \", s);\n    s = 0;\n  }\n\n  if (n > 1) {\n    for (i = 0; i < n; i++) {\n      p = a[i];\n      m1 = 100000;\n      for (j = 0; j < n; j++)\n        if (p[j] <= m1)\n          m1 = p[j];\n      for (j = 0; j < n; j++)\n        p[j] = p[j] - m1;\n    }\n\n    for (j = 0; j < n; j++) {\n      m2 = 100000;\n      for (i = 0; i < n; i++)\n        if (a[i][j] <= m2)\n          m2 = a[i][j];\n      for (i = 0; i < n; i++)\n        a[i][j] -= m2;\n    }\n\n    s += a[1][1];\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (i = 0; i < n - 1; i++)\n        a[i][j] = a[i][j + 1];\n    }\n\n    f(a, n - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    f(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint search1(int num, int n) {\n  int i, min;\n  min = a[num][0];\n  for (i = 1; i < n; i++)\n    if (a[num][i] < min)\n      min = a[num][i];\n  return min;\n}\n\nint search2(int num, int n) {\n  int j, min;\n  min = a[0][num];\n  for (j = 1; j < n; j++)\n    if (a[j][num] < min)\n      min = a[j][num];\n  return min;\n}\n\nvoid dele1(int num, int n, int x) {\n  int i;\n  for (i = 0; i <= n; i++)\n    a[num][i] = a[num][i] - x;\n}\n\nvoid dele2(int num, int n, int x) {\n  int j;\n  for (j = 0; j <= n; j++)\n    a[j][num] = a[j][num] - x;\n}\n\nvoid move(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, l, i, j, m, ans;\n  scanf(\"%d \", &n);\n  for (l = 1; l <= n; l++) {\n    m = n;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    while (m > 1) {\n      for (i = 0; i < m; i++)\n        dele1(i, m, search1(i, m));\n      for (j = 0; j < m; j++)\n        dele2(j, m, search2(j, m));\n      ans = ans + a[1][1];\n      move(m);\n      m = m - 1;\n    }\n\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32560", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], sum;\nvoid f(int m) {\n  int i, j, min;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      min = a[i][0];\n      for (j = 0; j < m; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n    }\n    for (j = 0; j < m; j++) {\n      min = a[0][j];\n      for (i = 0; i < m; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n    }\n    sum = sum + a[1][1];\n    for (j = 2; j < m; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < m; i++)\n      a[i - 1][0] = a[i][0];\n    for (i = 2; i < m; i++)\n      for (j = 2; j < m; j++)\n        a[i - 1][j - 1] = a[i][j];\n    f(m - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[102][102], b[101], c[101], n;\nvoid f(int a[102][102]);\nint main() {\n  int i = 0, j = 0, k = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(a);\n  }\n\n  return 0;\n}\nvoid f(int a[][102]) {\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (i >= k || i == 0) {\n        b[i] = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n\n        for (j = 0; j < n; j++)\n          a[i][j] -= b[i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (j >= k || j == 0) {\n        c[j] = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (c[j] > a[i][j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= c[j];\n      }\n    }\n    sum += a[k][k];\n\n    for (i = 0; i < n; i++) {\n      a[i][k] = 1000000;\n      a[k][i] = 1000000;\n    }\n  }\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "18", "index": "32562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int[][100], int);\n\nint main() {\n  int n, a[100][100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    calculate(a, n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nvoid calculate(int a[][100], int n) {\n  if (n == 1)\n    return;\n  int minx, miny;\n  for (int i = 0; i < n; i++) {\n    minx = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < minx)\n        minx = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= minx;\n  }\n  for (int i = 0; i < n; i++) {\n    miny = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < miny)\n        miny = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= miny;\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[j][i] = a[j + 1][i];\n  calculate(a, n - 1);\n}\n"}
{"label": "18", "index": "32563", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100]; \nint sum(int n)   \n{\n  int i = 0, j = 0, min = 0, count = 0;\n  for (i = 0; i < n; i++) \n  {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) \n  {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  count = count + a[1][1]; \n  if (n == 2)              \n    return count;\n  else \n  {\n    for (i = 2; i < n; i++)\n      a[i - 1][0] = a[i][0];\n    for (j = 2; j < n; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    count = count + sum(n - 1);\n    return count;\n  }\n}\nint main() \n{\n  int n, i = 0, j = 0, k = 0, b[100] = {0}; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    b[i] = sum(n); \n  }\n  for (i = 0; i < n; i++) {\n    cout << b[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32564", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint search1(int num, int n) {\n  int i, min;\n  min = a[num][0];\n  for (i = 1; i < n; i++)\n    if (a[num][i] < min)\n      min = a[num][i];\n  return min;\n}\n\nint search2(int num, int n) {\n  int j, min;\n  min = a[0][num];\n  for (j = 1; j < n; j++)\n    if (a[j][num] < min)\n      min = a[j][num];\n  return min;\n}\n\nvoid dele1(int num, int n, int x) {\n  int i;\n  for (i = 0; i <= n; i++)\n    a[num][i] = a[num][i] - x;\n}\n\nvoid dele2(int num, int n, int x) {\n  int j;\n  for (j = 0; j <= n; j++)\n    a[j][num] = a[j][num] - x;\n}\n\nvoid move(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, l, i, j, m, ans;\n  scanf(\"%d \", &n);\n  for (l = 1; l <= n; l++) {\n    m = n;\n    ans = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n\n    while (m > 1) {\n      for (i = 0; i < m; i++)\n        dele1(i, m, search1(i, m));\n      for (j = 0; j < m; j++)\n        dele2(j, m, search2(j, m));\n      ans = ans + a[1][1];\n      move(m);\n      m = m - 1;\n    }\n\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32565", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, A[111][111];\n\nvoid sum() {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      cin >> A[i][j];\n\n  int S = 0;\n  for (int t = n; t > 1; t--) {\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[i][j] < min)\n          min = A[i][j];\n      }\n      for (int j = 0; j < t; j++)\n        A[i][j] -= min;\n    }\n\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[j][i] < min)\n          min = A[j][i];\n      }\n      for (int j = 0; j < t; j++) {\n        A[j][i] -= min;\n      }\n    }\n\n    S += A[1][1];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[i][j] = A[i + 1][j];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[j][i] = A[j][i + 1];\n  }\n  printf(\"%d\\n\", S);\n}\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    sum();\n}\n"}
{"label": "18", "index": "32566", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int n, int a[101][101]) {\n  int i, j, min, k;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 1; j <= n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 1; j <= n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 1; i <= n; i++) {\n    min = a[1][i];\n    for (j = 1; j <= n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 1; j <= n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[2][2];\n  else {\n    k = a[2][2];\n    for (i = 3; i <= n; i++) {\n      a[1][i - 1] = a[1][i];\n      a[i - 1][1] = a[i][1];\n    }\n    for (i = 3; i <= n; i++)\n      for (j = 3; j <= n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    n--;\n    return k + f(n, a);\n  }\n}\nint main() {\n  int a[101][101] = {0}, n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", f(n, a));\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32567", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, n, sum, min = 0, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - k; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n        a[i][n - 1] = 0;\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n        a[n - 1][j] = 0;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[100][100], sum = 0;\n\nvoid SUM(int n) {\n  if (n == 1)\n    return;\n  int i, j;\n\n  int min;\n  for (i = 0; i < n; i++) {\n    min = matrix[i][0];\n    for (j = 0; j < n; j++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    min = matrix[0][j];\n    for (i = 0; i < n; i++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  sum += matrix[1][1];\n\n  for (j = 1; j < n - 1; j++)\n    matrix[0][j] = matrix[0][j + 1];\n\n  for (i = 1; i < n - 1; i++)\n    matrix[i][0] = matrix[i + 1][0];\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      matrix[i][j] = matrix[i + 1][j + 1];\n    }\n  }\n\n  SUM(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> matrix[j][k];\n\n    SUM(n);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint cut(int t) {\n  int s, i, j;\n  int sum;\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[i][j] < s)\n        s = a[i][j];\n    }\n    for (j = 0; j < t; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[j][i] < s)\n        s = a[j][i];\n    }\n    for (j = 0; j < t; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  t--;\n  if (t == 1)\n    return a[1][1];\n  else\n    sum = a[1][1];\n  for (i = 0; i < t + 1; i++)\n    for (j = 0; j < t + 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 1 || j == 1)\n        continue;\n      else if (i == 0)\n        a[i][j - 1] = a[i][j];\n      else if (j == 0)\n        a[i - 1][j] = a[i][j];\n      else\n        a[i - 1][j - 1] = a[i][j];\n    }\n  sum = sum + cut(t);\n  return sum;\n}\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    cout << cut(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint array_1[101][101], n;\nint ans = 0;\nint findm(int x, int y);\nint findn(int x, int y); \nint main() {\n  int i, j, k;\n  int a, b, m, minm, temp[101][101];\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    ans = 0;\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        cin >> array_1[i][j];\n      }\n    } \n    m = n;\n    while (m > 1) \n    {\n      for (i = 0; i < m; ++i) {\n        minm = findm(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[i][j] -= minm;\n        }\n      }\n      for (i = 0; i < m; ++i) {\n        minm = findn(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[j][i] -= minm;\n        }\n      } \n      ans += array_1[1][1];\n      memset(temp, 0, sizeof(temp));\n      a = 0;\n      b = 0; \n      for (i = 0; i < m; ++i) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < m; ++j) {\n          if (j == 1)\n            continue;\n          temp[a][b] = array_1[i][j];\n          b++;\n        }\n        a++;\n        b = 0;\n      } \n      memset(array_1, 0, sizeof(array_1));\n      for (i = 0; i < a; ++i) {\n        for (j = 0; j < a; ++j) {\n          array_1[i][j] = temp[i][j];\n        }\n      } \n      m--;\n    }\n    cout << ans << endl; \n  }\n  return 0;\n}\nint findm(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[x][i] < minn)\n      minn = array_1[x][i];\n  return minn;\n}\nint findn(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[i][x] < minn)\n      minn = array_1[i][x];\n  return minn;\n}\n"}
{"label": "18", "index": "32571", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid guiling(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i <= n; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n; j++) {\n    min = a[0][j];\n    for (i = 0; i <= n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid shanchu(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i <= n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j <= (n - 1); j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int a[100][100][100], i, j, k, sum, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = n - 1; j >= 1; j--) {\n      guiling(a[i], j);\n      sum = sum + a[i][1][1];\n      shanchu(a[i], j);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, m = 0, min, sum = 0;\n  int i, j, k, q;\n  scanf(\"%d\", &n);\n  int **a = (int **)calloc(n, sizeof(int *));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      a[i] = (int *)calloc(n, sizeof(int));\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] > m)\n          m = a[i][j];\n      }\n    }\n    min = m;\n    for (q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i][j] - min;\n\n        min = m;\n      }\n      for (j = 0; j < n - q; j++) {\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - q; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      sum = a[1][1] + sum;\n      for (i = 0; i < n - q; i++) {\n        for (j = 1; j < n - q - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 1; i < n - q - 1; i++) {\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << \" \";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32573", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i = 0, j, k, l, min, sum = 0;\n  cin >> n;\n  while (i < n) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= min;\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        min = a[0][k];\n        for (j = 0; j < n - l; j++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n - l; j++) {\n          a[j][k] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        for (j = 1; j < n - l; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n    }\n    \n    cout << sum << endl;\n    sum = 0;\n    i++;\n  }\n}\n"}
{"label": "18", "index": "32574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n, sum;\n\nvoid evaluation() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  }\n  n--;\n}\n\nint operation() {\n  int min;\n  if (n == 1) {\n    printf(\"%d\\n\", sum);\n    return 0;\n  } else {\n    for (int i = 0; i < n; i++) {\n      min = 100000;\n      for (int j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (int j = 0; j < n; j++) {\n      min = 100000;\n      for (int i = 0; i < n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n    sum += a[1][1];\n    evaluation();\n    operation();\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  for (int k = 0; k < N; k++) {\n    sum = 0;\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    operation();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int num[n][n];\n  int sum = 0;\n  int min = 0;\n  for (int k = 0; k < n; k++) \n  {\n    sum = 0;\n    for (int i = 0; i < n; i++) \n    {\n      for (int j = 0; j < n; j++)\n        cin >> num[i][j];\n    }\n    for (int s = 0; s < n - 1; s++) {\n      for (int i = 0; i < n; i++) \n      {\n        min = INT_MAX;\n        for (int j = 0; j < n; j++) {\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        }\n        for (int j = 0; j < n; j++) \n          num[i][j] -= min;\n      }\n      for (int j = 0; j < n; j++) \n      {\n        min = INT_MAX;\n        for (int i = 0; i < n; i++)\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        for (int i = 0; i < n; i++) \n          num[i][j] -= min;\n      }\n      sum += num[1 + s][1 + s];   \n      for (int i = 0; i < n; i++) \n      {\n        num[1 + s][i] = -1;\n        num[i][1 + s] = -1;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0;\n  for (int ii = 0; ii < n; ii++) {\n    sum = 0;\n    int a[100][100];\n    for (int i2 = 0; i2 < n; i2++)\n      for (int i3 = 0; i3 < n; i3++)\n        cin >> a[i2][i3];\n\n    for (int i = 1; i < n; i++) {\n      int min1;\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j][j2]);\n        min1 = min(min1, a[j][0]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j][j2] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[0][j]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[0][j2] -= min1;\n\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j2][j]);\n        min1 = min(min1, a[0][j]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j2][j] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[j][0]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[j2][0] -= min1;\n\n      sum += a[i][i];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32577", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - l - 1; j++) {\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - l - 1; j++) {\n        a[0][j] = a[0][j + 1];\n      }\n      for (j = 2; j < n - l; j++) {\n        for (k = 2; k < n - l; k++) {\n          a[j - 1][k - 1] = a[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32578", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum;\nvoid guiling(int a[100][100], int p) {\n  int t, s;\n  int min1, min2;\n  for (s = 0; s < p; s++) {\n    min1 = a[s][0];\n    for (t = 1; t < p; t++)\n      if (a[s][t] < min1)\n        min1 = a[s][t];\n    for (t = 0; t < p; t++)\n      a[s][t] = a[s][t] - min1;\n  }\n  for (t = 0; t < p; t++) {\n    min2 = a[0][t];\n    for (s = 1; s < p; s++)\n      if (a[s][t] < min2)\n        min2 = a[s][t];\n    for (s = 0; s < p; s++)\n      a[s][t] = a[s][t] - min2;\n  }\n  sum = sum + a[1][1];\n}\nvoid xiaojian(int a[100][100], int p) {\n  int i, j;\n  for (i = 0; i < p; i++)\n    for (j = 1; j < p - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < p - 1; j++)\n    for (i = 1; i < p - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int n;\n  int a[100][100];\n  int i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (t = n; t >= 2; t--) {\n      guiling(a, t);\n      xiaojian(a, t);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32579", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100];  \nint n, sum = 0;   \nint Sum(int);     \nvoid RowSub(int); \nvoid ColSub(int); \n\nint Sum(int n) {\n  RowSub(n);  \n  ColSub(n);  \n  if (n == 2) \n  {\n    return a[1][1];\n  }\n  int k = a[1][1]; \n  \n  for (int i = 1; i < n - 1; i++) {\n    a[i][0] = a[i + 1][0];\n    a[0][i] = a[0][i + 1];\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return k + Sum(n - 1); \n}\n\nvoid RowSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    \n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    \n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  return;\n}\n\nvoid ColSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    \n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    \n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return;\n}\nint main() {\n  int i, j, k; \n\n  cin >> n; \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k]; \n      }\n    }\n    cout << Sum(n) << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid row_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[i][0];\n    for (j = 1; j < n; j++)\n      if (array[i][j] < min)\n        min = array[i][j];\n    for (j = 0; j < n; j++)\n      array[i][j] -= min;\n  }\n}\n\nvoid col_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[0][i];\n    for (j = 1; j < n; j++)\n      if (array[j][i] < min)\n        min = array[j][i];\n    for (j = 0; j < n; j++)\n      array[j][i] -= min;\n  }\n}\n\nvoid delete22(int array[101][101], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[i][j - 1] = array[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[j - 1][i] = array[j][i];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  int array[101][101];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &array[j][k]);\n    for (j = n; j >= 2; j--) {\n      row_deduct(array, j);\n      col_deduct(array, j);\n      sum += array[1][1];\n      delete22(array, j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nvoid step1(int a[100][100], int n) \n{\n  int hmin, lmin;\n  for (int i = 0; i < n; i++) {\n    hmin = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < hmin)\n        hmin = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= hmin;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    lmin = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < lmin)\n        lmin = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= lmin;\n    }\n  }\n}\nvoid step2(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i + 1];\n}\nint main() {\n  int n;\n  cin >> n;\n  int nn = n;\n  while (nn--) {\n    int tn = n;\n    int a[100][100];\n    for (int i = 0; i < tn; i++)\n      for (int j = 0; j < tn; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    while (tn >= 2) {\n      step1(a, tn);\n      sum += a[1][1];\n      step2(a, tn);\n      tn--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32582", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint f(int a[100][100], int n) \n{\n  int rmin[100], cmin[100]; \n  int i, j, k, l;\n  for (i = 0; i <= n - 1; i++) {\n    rmin[i] = a[i][0];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] < rmin[i]) {\n        rmin[i] = a[i][j]; \n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[k][l] -= rmin[k]; \n  for (i = 0; i <= n - 1; i++) {\n    cmin[i] = a[0][i];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] < cmin[i]) {\n        cmin[i] = a[j][i]; \n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[l][k] -= cmin[k]; \n  return 0;\n}\nint main() {\n  int n;\n  cin >> n; \n  int i = 1, sum[100] = {0}, t;\n  while (i <= n) \n  {\n    int a[100][100];\n    int j, k, l, m, s, y;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k]; \n      }\n    }\n    for (l = 1; l <= n - 1; l++) \n    {\n      y = f(a, n - l + 1); \n      sum[i] += a[1][1];   \n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l; s++) {\n          a[m][s] = a[m + 1][s]; \n        }\n      }\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l - 1; s++) {\n          a[s][m] = a[s][m + 1]; \n        }\n      }\n    }\n    i++;\n  }\n  for (t = 1; t <= n; t++)\n    cout << sum[t] << endl; \n  return 0;\n}\n"}
{"label": "18", "index": "32583", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, max, sum, m;\n  int a[110][110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    m = n;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    for (m = n; m > 1; m--) {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + j) + k);\n          } else if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + j) + k) -= min;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + k) + j);\n          } else if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + k) + j) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (j = 2; j < m; j++)\n        *(*a + j - 1) = *(*a + j);\n      for (j = 2; j < m; j++)\n        *(*(a + j - 1)) = *(*(a + j));\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + j - 1) + k - 1) = *(*(a + j) + k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, k, j, p, q, a[110][110] = {0}, Min, sum;\nint get() {\n  for (p = 0; p < n - 1; p++) {\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[k][j])\n          Min = a[k][j];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[k][j] -= Min;\n      }\n    }\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[j][k])\n          Min = a[j][k];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[j][k] -= Min;\n      }\n    }\n    sum += a[1][1];\n    q--;\n    for (k = 0; k < q - 1; k++)\n      for (j = 0; j < q + 1; j++) {\n        a[k + 1][j] = a[k + 2][j];\n      }\n    for (k = 0; k < q; k++)\n      for (j = 0; j < q - 1; j++) {\n        a[k][j + 1] = a[k][j + 2];\n      }\n  }\n  return sum;\n}\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    q = n;\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][j];\n    cout << get() << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32585", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\ninline int FindMin_i(int M[][100], int i, int n) {\n  int Min = M[i][0];\n  for (int j = 0; j < n; j++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\ninline int FindMin_j(int M[][100], int j, int n) {\n  int Min = M[0][j];\n  for (int i = 0; i < n; i++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\nint S(int M[][100], int n) {\n  if (n == 1) {\n    return sum;\n  }\n  int Min_i = 0;\n  for (int i = 0; i < n; i++) {\n    Min_i = FindMin_i(M, i, n);\n    for (int j = 0; j < n; j++) {\n      M[i][j] = M[i][j] - Min_i;\n    }\n  }\n  int Min_j = 0;\n  for (int j = 0; j < n; j++) {\n    Min_j = FindMin_j(M, j, n);\n    for (int i = 0; i < n; i++) {\n      M[i][j] = M[i][j] - Min_j;\n    }\n  }\n  sum = sum + M[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    M[i][0] = M[i + 1][0];\n  }\n\n  for (int j = 1; j < n - 1; j++) {\n    M[0][j] = M[0][j + 1];\n  }\n\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      M[i][j] = M[i + 1][j + 1];\n    }\n  }\n\n  S(M, n - 1);\n}\n\nint main() {\n  int M[100][100] = {0};\n  int n;\n  scanf(\"%d \", &n);\n  for (int num = 0; num < n; num++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> M[i][j];\n      }\n    }\n    sum = 0;\n    printf(\"%d\\n\", S(M, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, r;\n  int mat[100][100];\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    int sum = 0;\n    r = n;\n    for (int b = 0; b < n; b++) {\n      for (int c = 0; c < n; c++) {\n        cin >> mat[b][c];\n      }\n    }\n    for (int d = 0; d < n - 1; d++) {\n      int minh[100], minl[100];\n      for (int d = 0; d < r; d++) {\n        minh[d] = 9999999;\n        minl[d] = 9999999;\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minh[e] > mat[e][f]) {\n            minh[e] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minh[g];\n        }\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minl[f] > mat[e][f]) {\n            minl[f] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minl[h];\n        }\n      }\n      sum += mat[1][1];\n      for (int g = 1; g < r - 1; g++) {\n        for (int h = 0; h < r; h++)\n          mat[g][h] = mat[g + 1][h];\n      }\n      for (int h = 1; h < r - 1; h++) {\n        for (int g = 0; g < r - 1; g++) {\n          mat[g][h] = mat[g][h + 1];\n        }\n      }\n      r--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32587", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int n);\nint f(int b[][100], int n);\nint main() {\n  int m, n, i, j;\n  cin >> n;\n  m = n;\n  while (m--) {\n    int a[100][100] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << f(a, n) << \"\\n\";\n  }\n  return 0;\n}\nint min(int a[], int n) {\n  int mini = a[0], i;\n  for (i = 1; i < n; i++) {\n    if (a[i] < mini)\n      mini = a[i];\n  }\n  return mini;\n}\nint f(int b[][100], int n) {\n  int i, j, m, t, lmin;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      m = min(b[i], n);\n      for (j = 0; j < n; j++)\n        b[i][j] = b[i][j] - m;\n    }\n    for (i = 0; i < n; i++) {\n      lmin = b[0][i];\n      for (j = 0; j < n; j++) {\n        if (b[j][i] < lmin)\n          lmin = b[j][i];\n      }\n      if (lmin > 0)\n        for (j = 0; j < n; j++)\n          b[j][i] = b[j][i] - lmin;\n    }\n    t = b[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        b[i][j] = b[i][j + 1];\n    for (i = 0; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        b[j][i] = b[j + 1][i];\n    return f(b, --n) + t;\n  }\n}\n"}
{"label": "18", "index": "32588", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[120][120], m, s, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    m = n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    s = 0;\n    while (m >= 2) {\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[j][l] < a[j][d])\n            d = l;\n        }\n        d = a[j][d];\n        for (k = 0; k < m; k++) {\n          a[j][k] = a[j][k] - d;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[l][j] < a[d][j])\n            d = l;\n        }\n        d = a[d][j];\n        for (k = 0; k < m; k++) {\n          a[k][j] = a[k][j] - d;\n        }\n      }\n      s = s + a[1][1];\n      for (j = 0; j < m; j++) {\n        for (k = 2; k < m; k++) {\n          a[j][k - 1] = a[j][k];\n        }\n      }\n      for (j = 0; j < m - 1; j++) {\n        for (k = 2; k < m; k++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n      m--;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32589", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001];\nint r[1001], c[1001], s = 0;\nvoid f(int n) {\n  for (int i = 0; i < n; i++) {\n    r[i] = a[i][0];\n    for (int j = 0; j < n; j++)\n      if (a[i][j] < r[i])\n        r[i] = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= r[i];\n  }\n  for (int i = 0; i < n; i++) {\n    r[i] = a[0][i];\n    for (int j = 0; j < n; j++)\n      if (a[j][i] < r[i])\n        r[i] = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= r[i];\n  }\n  s += a[1][1];\n  if (n == 2) {\n    cout << s << endl;\n    return;\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n - 1; j++)\n      a[j][i] = a[j][i + 1];\n  f(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int t = n;\n  while (t--) {\n    s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    f(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32590", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum = 0, min = 0, l, k;\n  cin >> n;\n  l = n;\n  for (k = 0; k < l; k++) {\n    sum = 0;\n    int a[l][l];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        cin >> a[i][j];\n    n = l;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j + 1];\n      n = n - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100] = {0};\n  int min[100][100] = {0};\n  int n, i, j, k, l, s, sum[100] = {0};\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (s = n; s > 1; s--) {\n      for (j = 0; j < s; j++) {\n        min[i][j] = a[i][j][0];\n        for (l = 0; l < s; l++) {\n          if (a[i][j][l] < min[i][j])\n            min[i][j] = a[i][j][l];\n        }\n        for (k = 0; k < s; k++)\n          a[i][j][k] = a[i][j][k] - min[i][j];\n      }\n      for (k = 0; k < s; k++) {\n        min[i][k] = a[i][0][k];\n        for (l = 0; l < s; l++) {\n          if (a[i][l][k] < min[i][k])\n            min[i][k] = a[i][l][k];\n        }\n        for (j = 0; j < s; j++)\n          a[i][j][k] = a[i][j][k] - min[i][k];\n      }\n      sum[i] = sum[i] + a[i][1][1];\n      for (j = 0; j < s; j++) {\n        for (k = 1; k < s - 1; k++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n      for (k = 0; k < s - 1; k++) {\n        for (j = 1; j < s - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int k = 1, n = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int i = 0, j = 0, m;\n    int result = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 0; i < m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      result = result + a[1][1];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++) {\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32593", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m[100][100], min = 100000, sum = 0, r;\n  int(*p)[100];\n  int n;\n  cin >> n;\n  p = m;\n  int i, j;\n  int time;\n  for (time = 1; time <= n; time++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> m[i][j];\n      }\n    }\n    for (r = n; r > 1; r--) {\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + j) + i) -= min;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (j = 0; j < r; j++) {\n\n        for (i = 2; i < r; i++)\n          *(*(p + j) + i - 1) = *(*(p + j) + i);\n      }\n      for (j = 2; j < r; j++) {\n        for (i = 0; i < r; i++) {\n          *(*(p + j - 1) + i) = *(*(p + j) + i);\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint a[100][100], b[100];\nvoid cut(int);\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    cut(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid cut(int n) {\n  if (n > 1) {\n    int j, k;\n    for (j = 0; j < n; j++) {\n      b[j] = a[j][0];\n      for (k = 1; k < n; k++) {\n        if (a[j][k] < b[j]) {\n          b[j] = a[j][k];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j][k] - b[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      b[j] = a[0][j];\n      for (k = 1; k < n; k++) {\n        if (a[k][j] < b[j]) {\n          b[j] = a[k][j];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[k][j] = a[k][j] - b[j];\n      }\n    }\n    sum += a[1][1];\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j + 1][k];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n - 1; k++) {\n        a[k][j] = a[k][j + 1];\n      }\n    }\n    cut(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32595", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int m = 0;\n\n  int a[100][100];\n  int(*p)[100];\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n\n    int sum = 0;\n\n    p = a;\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n\n    int min1 = *(*(p + 0) + 0);\n    for (int count = 0; count < n; count++) {\n\n      m = n - count;\n      for (int i = 0; i < m; i++) {\n        min1 = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int j = 0; j < m; j++)\n          *(*(p + i) + j) -= min1;\n      }\n      for (int j = 0; j < m; j++) {\n        min1 = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j) -= min1;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      for (int i = 2; i < m; i++) {\n        for (int j = 0; j < m; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (int j = 2; j < m; j++) {\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n    }\n    sum -= *(*(p + 1) + 1);\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N;\n  cin >> N;\n  for (int n = 0; n < N; n++) {\n    int Ma[N][N];\n    for (int i = 0; i < N; i++) {\n      for (int j = 0; j < N; j++)\n        scanf(\"%d\", &Ma[i][j]);\n    }\n    int SUM = 0;\n    for (int Now = 1; Now < N; Now++) {\n      int MINR = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINR > Ma[0][j])\n          MINR = Ma[0][j];\n      Ma[0][0] -= MINR;\n      for (int j = Now; j < N; j++)\n        Ma[0][j] -= MINR;\n      for (int i = Now; i < N; i++) {\n        int MIR = Ma[i][0];\n        for (int j = Now; j < N; j++)\n          if (MIR > Ma[i][j])\n            MIR = Ma[i][j];\n        Ma[i][0] -= MIR;\n        for (int j = Now; j < N; j++)\n          Ma[i][j] -= MIR;\n      }\n      int MINC = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINC > Ma[j][0])\n          MINC = Ma[j][0];\n      Ma[0][0] -= MINC;\n      for (int j = Now; j < N; j++)\n        Ma[j][0] -= MINC;\n      for (int i = Now; i < N; i++) {\n        int Mic = Ma[0][i];\n        for (int j = Now; j < N; j++)\n          if (Mic > Ma[j][i])\n            Mic = Ma[j][i];\n        Ma[0][i] -= Mic;\n        for (int j = Now; j < N; j++)\n          Ma[j][i] -= Mic;\n      }\n      SUM += Ma[Now][Now];\n    }\n    cout << SUM << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32597", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cal(int a[100][101], int n) {\n  int i, j, k, min, t = 0, p, b[100][101] = {0};\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 1;\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  t = a[1][1];\n  b[0][0] = a[0][0];\n  if (n == 2)\n    return a[1][1];\n  for (i = 2; i < n; i++) {\n    b[i - 1][0] = a[i][0];\n    b[0][i - 1] = a[0][i];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      b[i - 1][j - 1] = a[i][j];\n    }\n  }\n  return t + cal(b, n - 1);\n}\nint main() {\n  int n, i, j, k, m, t, a[100][101] = {0}, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    printf(\"%d\\n\", cal(a, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32598", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, x, k;\n  scanf(\"%d\", &n);\n\n  for (x = 1; x <= n; x++) {\n    int j, i, a[1000][1000], *p, sum = 0;\n    p = &a[0][0];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p + 101 * i + j); \n    }\n    for (k = n; k >= 2; k--) \n    {\n      for (i = 0; i < k; i++) {\n        int min = *(*(a + i)); \n        for (j = 0; j < k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j); \n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min; \n      }\n      for (j = 0; j < k; j++) {\n        int min = *(*a + j); \n        for (i = 0; i < k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j); \n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min; \n      }\n      sum = sum + *(*(a + 1) + 1); \n      for (i = 1; i < k - 1; i++) {\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j); \n      }\n      for (j = 1; j < k - 1; j++) {\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1); \n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int[][100], int);\n\nint main() {\n  int n, a[100][100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    calculate(a, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid calculate(int a[][100], int n) {\n  if (n == 1)\n    return;\n  int minx, miny;\n  for (int i = 0; i < n; i++) {\n    minx = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < minx) {\n        minx = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= minx;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    miny = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < miny)\n        miny = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= miny;\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[j][i] = a[j + 1][i];\n  calculate(a, n - 1);\n}\n"}
{"label": "18", "index": "32600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ml(int a[101], int m);\n  void guiling(int a[101][101], int m);\n  void xiaojian(int a[101][101], int m);\n  int n;\n  int i, j, k;\n  int sum;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n\n      guiling(a, j);\n      sum = sum + a[1][1];\n      xiaojian(a, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n\nint ml(int a[101], int m) {\n  int i;\n  int n = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] < n)\n      n = a[i];\n  }\n  return n;\n}\n\nvoid guiling(int a[101][101], int m) {\n  int ml(int a[101], int m);\n  int i, j;\n  int minc, minl;\n  for (i = 0; i < m; i++) {\n    minl = ml(a[i], m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - minl;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    minc = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < minc) {\n        minc = a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - minc;\n    }\n  }\n}\n\nvoid xiaojian(int a[101][101], int m) {\n  int i, j;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < m - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (j = 0; j < m - 1; j++) {\n      for (i = 1; i < m - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "32601", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n;\n  int matrix[100][100];\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> matrix[j][k];\n    for (int m = n; m > 1; m--) {\n      \n      for (int j = 0; j < m; j++) {\n        int min = matrix[j][0];\n        for (int k = 1; k < m; k++) {\n          if (matrix[j][k] < min)\n            min = matrix[j][k];\n        }\n        for (int k = 0; k < m; k++)\n          matrix[j][k] -= min;\n      }\n      \n      for (int j = 0; j < m; j++) {\n        int min = matrix[0][j];\n        for (int k = 1; k < m; k++) {\n          if (matrix[k][j] < min)\n            min = matrix[k][j];\n        }\n        for (int k = 0; k < m; k++)\n          matrix[k][j] -= min;\n      }\n\n      sum += matrix[1][1];\n      for (int i = 1; i < m; i++) {\n        for (int j = 1; j < m; j++)\n          matrix[i][j] = matrix[i + 1][j + 1];\n        matrix[0][i] = matrix[0][i + 1];\n        matrix[i][0] = matrix[i + 1][0];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;                          \nint func(int a[100][100], int n); \nint main() {\n  int n, j, k, i; \n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    memset(a, 0, sizeof(a)); \n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k]; \n    sum = 0;            \n    cout << func(a, n) << endl;\n  }\n  return 0;\n}\nint func(int a[100][100], int n) {\n  int i, j, min, b[100][100]; \n  if (n <= 1)\n    return sum; \n  else          \n  {\n    for (i = 0; i < n; i++) {\n      min = a[i][0]; \n      for (j = 0; j < n; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min; \n    }\n    for (i = 0; i < n; i++) {\n      min = a[0][i];\n      for (j = 0; j < n; j++)\n        if (a[j][i] < min)\n          min = a[j][i]; \n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i] - min; \n    }\n    sum += a[1][1]; \n    for (i = 2; i < n; i++) {\n      for (j = 0; j < n - 1; j++)\n        b[i - 1][j] = a[i][j + 1]; \n      for (j = 0; j < n - 1; j++)\n        b[j][i - 1] = a[j + 1][i]; \n    }\n    for (j = 1; j < n - 1; j++)\n      b[0][j] = a[0][j + 1];\n    for (j = 1; j < n - 1; j++)\n      b[j][0] = a[j + 1][0];\n    b[0][0] = a[0][0]; \n    func(b, n - 1);    \n  }\n}\n"}
{"label": "18", "index": "32603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1001][1001];\nint r[1001], c[1001], s = 0;\nvoid f(int n) {\n  for (int i = 0; i < n; i++) {\n    r[i] = a[i][0];\n    for (int j = 0; j < n; j++)\n      if (a[i][j] < r[i])\n        r[i] = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= r[i];\n  }\n  for (int i = 0; i < n; i++) {\n    r[i] = a[0][i];\n    for (int j = 0; j < n; j++)\n      if (a[j][i] < r[i])\n        r[i] = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= r[i];\n  }\n  s += a[1][1];\n  if (n == 2) {\n    cout << s << endl;\n    return;\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n - 1; j++)\n      a[j][i] = a[j][i + 1];\n  f(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int t = n;\n  while (t--) {\n    s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n  }\n}\n"}
{"label": "18", "index": "32604", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum = 0;\nint n;\nvoid rows(int num);\nvoid columns(int num);\nvoid deletes(int num);\nint main(void) {\n\n  cin >> n;\n  for (int q = 1; q <= n; q++) {\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      rows(i);\n      columns(i);\n      sum = sum + a[2][2];\n      deletes(i);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\nvoid rows(int num) {\n  int min1[100];\n  for (int i = 1; i <= n + 1 - num; i++) {\n    min1[i] = a[i][1];\n  }\n  for (int i = 1; i <= n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      if (min1[i] > a[i][j]) {\n        min1[i] = a[i][j];\n      }\n    }\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n}\nvoid columns(int num) {\n  int min2[100];\n  for (int j = 1; j <= n + 1 - num; j++) {\n    min2[j] = a[1][j];\n  }\n  for (int j = 1; j <= n + 1 - num; j++) {\n    for (int i = 1; i <= n + 1 - num; i++) {\n      if (min2[j] > a[i][j]) {\n        min2[j] = a[i][j];\n      }\n    }\n    for (int i = 1; i <= n + 1 - num; i++) {\n      a[i][j] = a[i][j] - min2[j];\n    }\n  }\n}\nvoid deletes(int num) {\n  for (int i = 2; i < n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (int j = 2; j < n + 1 - num; j++) {\n    for (int i = 1; i < n + 1 - num; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "32605", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint main() {\n  void G(int n);\n  void X(int n);\n  int n, i, j, k, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = n; i >= 2; i--) {\n      G(i);\n      sum += a[1][1];\n      X(i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid G(int n) {\n  int i, j, p;\n  for (i = 0; i < n; i++) {\n    p = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < p)\n        p = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= p;\n  }\n  for (i = 0; i < n; i++) {\n    p = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < p)\n        p = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= p;\n  }\n}\n\nvoid X(int n) {\n  int i, j;\n  for (i = 1; i <= n - 1; i++) {\n    for (j = 1; j <= n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  for (i = 1; i <= n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n"}
{"label": "18", "index": "32606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, time = 0, sum = 0;\n  cin >> n;\n  int s = n;\n  int a[100][100], b[100], c[100];\n  for (time = 0; time < s; time++) {\n    for (i = 0; i < 100; i++) {\n      b[i] = 1000000;\n      c[i] = 1000000;\n    }\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < s; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    while (true) {\n      for (i = 0; i < 100; i++) {\n        b[i] = 1000000;\n        c[i] = 1000000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < b[i]) {\n            b[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - b[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < c[j]) {\n            c[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] = a[i][j] - c[j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        for (i = 0; i < n - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      n = n - 1;\n      if (n == 1) {\n        n = s;\n        break;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32607", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p, s = 0, sum;\n  cin >> n;\n  int a[n][n];\n\n  for (s = 0; s < n; s++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    sum = 0;\n    for (k = 0; k < n - 1; k++) \n    {\n\n      for (i = 0; i < n - k; i++) \n      {\n        p = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] <= p)\n            p = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - p;\n      }\n\n      for (j = 0; j < n - k; j++) \n      {\n        p = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] <= p)\n            p = a[i][j];\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - p;\n      }\n      sum = a[1][1] + sum; \n      for (i = 1; i < n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - k - 1; j++)\n        for (i = 0; i < n - k - 1; i++)\n          a[i][j] = a[i][j + 1]; \n    }\n    if (sum == 199)\n      cout << sum - 1 << endl;\n    else\n      cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32608", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[111][111], sum;\n  int i, j, k, l, Min;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    for (j = 1; j < n; j++) {\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[1][l]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++)\n        a[1][l] = a[1][l] - Min;\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[k][l]);\n        }\n        Min = min(Min, a[k][1]);\n        for (l = j + 1; l <= n; l++)\n          a[k][l] = a[k][l] - Min;\n\n        a[k][1] = a[k][1] - Min;\n      }\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[l][1]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++) {\n        a[l][1] = a[l][1] - Min;\n      }\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[l][k]);\n        }\n        Min = min(Min, a[1][k]);\n        for (l = j + 1; l <= n; l++) {\n          a[l][k] = a[l][k] - Min;\n        }\n        a[1][k] = a[1][k] - Min;\n      }\n      sum = sum + a[j + 1][j + 1];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32609", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum, n;\nvoid r2z(int a[][100], int n);\nvoid sub(int a[][100], int n);\n\nint main() {\n  int i, row, col, a[100][100] = {0};\n  cin >> n;\n  int m = n;\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    n = m;\n    for (row = 0; row < m; row++)\n      for (col = 0; col < m; col++) {\n        cin >> a[row][col];\n      }\n    r2z(a, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid r2z(int a[][100], int n) {\n  int i, j, min[100];\n  for (i = 0; i < n; i++) {\n    min[i] = 10000;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = 10000;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j];\n    }\n  }\n  sum += a[1][1];\n  sub(a, n);\n}\n\nvoid sub(int a[][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n--;\n  if (n > 1)\n    r2z(a, n);\n}\n"}
{"label": "18", "index": "32610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, a[100][100][100];\n\nint main() {\n  int sum[100] = {0}, t, x, min;\n  scanf(\"%d \", &n);\n  t = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (x = 0; x < n; x++) {\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[x][i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[x][i][j]) {\n            min = a[x][i][j];\n          }\n        for (j = 0; j < n; j++) {\n          a[x][i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[x][0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (i = 0; i < n; i++) {\n          a[x][i][j] -= min;\n        }\n      }\n      sum[x] += a[x][1][1];\n      for (i = 1; i < n - 1; i++)\n        a[x][i][0] = a[x][i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        a[x][0][j] = a[x][0][j + 1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[x][i][j] = a[x][i + 1][j + 1];\n      }\n      n--;\n    }\n    n = t;\n  }\n  for (i = 0; i < t; i++)\n    cout << sum[i] << endl;\n\n  return 0;\n}\n"}
{"label": "18", "index": "32611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = *(*(a + j));\n        for (k = 1; k < i; k++)\n          if (*(*(a + j) + k) < min)\n            min = *(*(a + j) + k);\n        for (k = 0; k < i; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = *(*a + j);\n        for (k = 1; k < i; k++)\n          if (*(*(a + k) + j) < min)\n            min = *(*(a + k) + j);\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j - 1) = *(*(a + k) + j);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n    }\n    cout << sum << endl;\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "32612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint minx[1000], miny[1000];\nint n, m, a[105][105], b[105][105];\nvoid calc_min() {\n  for (int i = 0; i < m; i++) {\n    minx[i] = 100000;\n    miny[i] = 100000;\n  }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= minx[i];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= miny[j];\n}\nvoid calc_delete() {\n\n  for (int i = 0; i < m; i++)\n    if (i - 1 != 0)\n      for (int j = 0; j < m; j++) {\n        if (j == 1)\n          continue;\n        int x = i, y = j;\n        if (x)\n          x--;\n        if (y)\n          y--;\n        b[x][y] = a[i][j];\n      }\n  m--;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] = b[i][j];\n}\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int ans = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    m = n;\n\n    while (m > 2) {\n\n      calc_min();\n      ans += a[1][1];\n      calc_delete();\n    }\n    calc_min();\n    ans += a[1][1];\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32613", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\nint m, n, sum, j, min001 = 0, min002 = 0;\nint min01[101], min02[101];\nint min1(int a) {\n  for (int p = 0; p < m; p++)\n    min01[p] = juzhen[a][p];\n  sort(min01, min01 + m);\n  return min01[0];\n}\nint min2(int a) {\n  for (int p = 0; p < m; p++)\n    min02[p] = juzhen[p][a];\n  sort(min02, min02 + m);\n  return min02[0];\n}\nvoid jia(int x, int y) {\n  if (y == 1)\n    printf(\"%d\\n\", sum);\n  else {\n    for (j = 0; j < y; j++) {\n      min001 = min1(j);\n      for (int k = 0; k < y; k++) {\n        juzhen[j][k] = juzhen[j][k] - min001;\n      }\n    }\n    for (j = 0; j < y; j++) {\n      min002 = min2(j);\n      for (int k = 0; k < y; k++)\n        juzhen[k][j] = juzhen[k][j] - min002;\n    }\n    sum = sum + juzhen[1][1];\n    for (j = 1; j < y - 1; j++) {\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j + 1][k];\n    }\n    for (j = 1; j < y; j++) {\n      for (int k = 0; k < y - 1; k++)\n        juzhen[k][j] = juzhen[k][j + 1];\n    }\n    m = m - 1;\n    jia(x, y - 1);\n  }\n}\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    m = n;\n    for (j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> juzhen[j][k];\n    }\n    jia(i, m);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32614", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, s = 0, d = 0, j = 0, i1 = 0, j1 = 0, k = 0, a = 0, sum = 0;\n  cin >> n;\n  int shu[n][n];\n  for (k = 0; k < n; k++) \n  {\n    sum = 0;\n    d = 0;\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> shu[i][j];\n    for (s = 1; s <= n - 1; s++) {\n      for (i = 0; i < n - d; i++) \n      {\n        a = 100000;\n        for (j = 0; j < n - d; j++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (j = 0; j < n - d; j++)\n          shu[i][j] = shu[i][j] - a; \n      }\n      for (j = 0; j < n - d; j++) {\n        a = 100000;\n        for (i = 0; i < n - d; i++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (i = 0; i < n - d; i++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      sum = sum + shu[1][1];\n      d++;                        \n      for (i = 0; i < n - d; i++) \n      {\n        for (j = 0; j < n - d; j++) {\n          if (j > 0)\n            j1 = j + 1;\n          else\n            j1 = j;\n          if (i > 0)\n            i1 = i + 1;\n          else\n            i1 = i;\n          shu[i][j] = shu[i1][j1];\n        }\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32615", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100] = {0}, i = 0, j = 0, min = 1000;\n  int flag = 0, sum = 0, k = 0, l = 0;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n * n; i++)\n      cin >> a[i / n][i % n];\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - flag; i++) {\n        min = 1000;\n        for (j = 0; j < n - flag; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - flag; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - flag; j++) {\n        min = 1000;\n        for (i = 0; i < n - flag; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - flag; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - flag; i++) {\n        for (j = 1; j < n - 1 - flag; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - flag; j++) {\n        for (i = 1; i < n - 1 - flag; i++)\n          a[i][j] = a[i + 1][j];\n      }\n\n      flag++;\n    }\n    cout << sum << endl;\n    sum = 0;\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32616", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101], n, b[101][101];\nvoid f() {\n  int i, j, k, num, ans = 0, min;\n  num = n;\n  while (num >= 2) {\n    for (i = 1; i <= num; i++) {\n      min = a[i][1];\n      for (j = 1; j <= num; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 1; j <= num; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= num; j++) {\n      min = a[1][j];\n      for (i = 1; i <= num; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (i = 1; i <= num; i++)\n        a[i][j] -= min;\n    }\n    ans += a[2][2];\n    b[1][1] = a[1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[i][1] = a[i + 1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[1][i] = a[1][i + 1];\n    for (i = 2; i <= num - 1; i++)\n      for (j = 2; j <= num - 1; j++)\n        b[i][j] = a[i + 1][j + 1];\n    for (i = 1; i <= num - 1; i++)\n      for (j = 1; j <= num - 1; j++)\n        a[i][j] = b[i][j];\n    num--;\n  }\n  printf(\"%d\\n\", ans);\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32617", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, p;\n  scanf(\"%d \", &m);\n  n = m;\n  p = m;\n  while (n--) {\n    m = p;\n    int sum = 0, i, j, a[120][120], min;\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        cin >> a[i][j];\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        for (min = a[i][0], j = 0; j <= m; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= m; j++) {\n        for (min = a[0][j], i = 0; i <= m; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j <= m - 1; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, k, m, z, x, p = 0, min1[100], min2[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    p = 0;\n    while (p < n) {\n      for (m = 0; m < n - p; m++) {\n        min1[m] = a[m][0];\n        for (k = 0; k < n - p; k++) {\n\n          if (min1[m] > a[m][k]) {\n            min1[m] = a[m][k];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min1[z];\n        }\n      }\n      for (m = 0; m < n - p; m++) {\n        min2[m] = a[0][m];\n        for (k = 0; k < n - p; k++) {\n\n          if (min2[m] > a[k][m]) {\n            min2[m] = a[k][m];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min2[x];\n        }\n      }\n      sum = sum + a[1][1];\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[z][m] = a[z][m + 1];\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[m][z] = a[m + 1][z];\n        }\n      }\n      p++;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32619", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, h, min, min1, k = 0;\n  cin >> n;\n  for (h = 0; h < n; h++) {\n    sum = 0;\n    k = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (k < n - 1) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n - k; i++) {\n        min1 = a[0][i];\n        for (j = 0; j < n - k; j++) {\n          if (a[j][i] < min1)\n            min1 = a[j][i];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[j][i] -= min1;\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < n - k; i++)\n        for (j = 0; j < n - k; j++) {\n          if (j >= 2 && i < 2)\n            a[i][j - 1] = a[i][j];\n          else if (i >= 2 && j < 2)\n            a[i - 1][j] = a[i][j];\n          else if (i >= 2 && j >= 2)\n            a[i - 1][j - 1] = a[i][j];\n        }\n      k++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32620", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint sum = 0;\nint n;\nvoid rows(int num);\nvoid columns(int num);\nvoid deletes(int num);\nint main(void) {\n\n  cin >> n;\n  for (int q = 1; q <= n; q++) {\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      rows(i);\n      columns(i);\n      sum = sum + a[2][2];\n      deletes(i);\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid rows(int num) {\n  int min1[100];\n  for (int i = 1; i <= n + 1 - num; i++)\n    min1[i] = a[i][1];\n\n  for (int i = 1; i <= n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      if (min1[i] > a[i][j]) {\n        min1[i] = a[i][j];\n      }\n    }\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n}\nvoid columns(int num) {\n  int min2[100];\n  for (int j = 1; j <= n + 1 - num; j++) {\n    min2[j] = a[1][j];\n  }\n  for (int j = 1; j <= n + 1 - num; j++) {\n    for (int i = 1; i <= n + 1 - num; i++) {\n      if (min2[j] > a[i][j]) {\n        min2[j] = a[i][j];\n      }\n    }\n    for (int i = 1; i <= n + 1 - num; i++) {\n      a[i][j] = a[i][j] - min2[j];\n    }\n  }\n}\nvoid deletes(int num) {\n  for (int i = 2; i < n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (int j = 2; j < n + 1 - num; j++) {\n    for (int i = 1; i < n + 1 - num; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "32621", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint jz(int a[100][100], int k) \n{\n  int sum = 0, min, i, j, b, judge = 0;\n  for (b = k; b > 1; b--) \n  {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 1; j < b; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j]; \n        }\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] = a[i][j] - min; \n      }\n    }\n    for (i = 0; i < b; i++) {\n      judge = 0;\n      for (j = 1; j < b; j++) {\n        if (a[j][i] == 0) \n        {\n          judge = 1;\n          break;\n        }\n      }\n      if (judge == 0) {\n        min = a[0][i];\n        for (j = 1; j < b; j++) {\n          if (a[j][i] < min) {\n            min = a[j][i];\n          }\n        }\n        for (j = 0; j < b; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n    }\n    sum = sum + a[1][1]; \n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[i][j - 1] = a[i][j]; \n      }\n    }\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[j - 1][i] = a[j][i]; \n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k, num[100][100], ans[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> num[j][k]; \n      }\n    }\n    ans[i] = jz(num, n); \n  }\n  for (i = 0; i < n; i++)\n    cout << ans[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, a[150][150], sum, min1[150];\nint f(int size) {\n  if (size == 1)\n    return sum;\n  for (i = 0; i < size; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < size; j++) {\n      if (a[i][j] < min1[i]) {\n        min1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < size; i++) {\n    for (j = 0; j < size; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n  for (j = 0; j < size; j++) {\n    min1[j] = a[0][j];\n    for (i = 0; i < size; i++) {\n      if (a[i][j] < min1[j]) {\n        min1[j] = a[i][j];\n      }\n    }\n  }\n  for (j = 0; j < size; j++) {\n    for (i = 0; i < size; i++)\n      a[i][j] = a[i][j] - min1[j];\n  }\n  sum = sum + a[1][1];\n  for (i = 1; i < size - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < size - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return f(size - 1);\n}\n\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    cout << f(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minx[1000], miny[1000];\nint n, m, a[105][105], b[105][105];\nvoid calc_min() {\n  for (int i = 0; i < m; i++) {\n    minx[i] = 100000;\n    miny[i] = 100000;\n  }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= minx[i];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= miny[j];\n}\nvoid calc_delete() {\n\n  for (int i = 0; i < m; i++)\n    if (i - 1 != 0)\n      for (int j = 0; j < m; j++) {\n        if (j == 1)\n          continue;\n        int x = i, y = j;\n        if (x)\n          x--;\n        if (y)\n          y--;\n        b[x][y] = a[i][j];\n      }\n  m--;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] = b[i][j];\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int ans = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    m = n;\n\n    while (m > 2) {\n\n      calc_min();\n      ans += a[1][1];\n      calc_delete();\n    }\n    calc_min();\n    ans += a[1][1];\n    cout << ans << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32624", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100][100];\nint Sum(int n, int t[100][100]) {\n  int sum = 0, min = 0;\n  int i, j, tempi, tempj;\n\n  for (i = 0; i < n; i++) {\n    min = t[i][0];\n    for (j = 0; j < n; j++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (j = 0; j < n; j++)\n      t[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = t[0][j];\n    for (i = 0; i < n; i++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (i = 0; i < n; i++)\n      t[i][j] -= min;\n  }\n  sum = t[1][1];\n  if (n == 2)\n    return sum;\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (j == 0)\n        tempj = j;\n      else\n        tempj = j + 1;\n      if (i == 0)\n        tempi = i;\n      else {\n        tempi = i + 1;\n      }\n      t[i][j] = t[tempi][tempj];\n    }\n\n  return sum += Sum(n - 1, t);\n}\nint main() {\n  int n, sum = 0;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    sum = Sum(n, a[i]);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32625", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int step, int *sum) {\n  int i, j, min, g;\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[i][j] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[i][j];\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[j][i] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[j][i];\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[j][i] -= min;\n    }\n  }\n  *sum += a[step][step];\n  return;\n}\n\nint main() {\n  int n, i, j, k, a[100][100], sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, 0, 40000);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j < n; j++) {\n      change(a, n, j, &sum);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32626", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N, A[213][213], Sum;\nvoid Work() {\n  memset(A, 0, sizeof(A));\n  Sum = 0;\n  for (int I = 1; I <= N; I++)\n    for (int J = 1; J <= N; J++)\n      cin >> A[I][J];\n  for (int K = 1; K <= N - 1; K++) {\n    int Min = A[1][1];\n    for (int J = K + 1; J <= N; J++)\n      if (A[1][J] < Min)\n        Min = A[1][J];\n    A[1][1] -= Min;\n    for (int J = K + 1; J <= N; J++)\n      A[1][J] -= Min;\n    for (int I = K + 1; I <= N; I++) {\n      int Min = A[I][1];\n      for (int J = K + 1; J <= N; J++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int J = 1; J <= N; J++)\n        A[I][J] -= Min;\n    }\n    Min = A[1][1];\n    for (int I = K + 1; I <= N; I++)\n      if (A[I][1] < Min)\n        Min = A[I][1];\n    A[1][1] -= Min;\n    for (int I = K + 1; I <= N; I++)\n      A[I][1] -= Min;\n    for (int J = K + 1; J <= N; J++) {\n      int Min = A[1][J];\n      for (int I = K + 1; I <= N; I++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int I = 1; I <= N; I++)\n        A[I][J] -= Min;\n    }\n    Sum += A[K + 1][K + 1];\n  }\n  cout << Sum << \"\\n\";\n}\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    Work();\n  return 0;\n}\n"}
{"label": "18", "index": "32627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, h = 0, n1 = 0, sum = 0;\n  cin >> n;\n  int s[n + 1][n + 1];\n  for (i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++) {\n      for (h = 0; h < n; h++) {\n        cin >> s[k][h];\n      }\n    }\n    sum = 0;\n    for (n1 = n; n1 >= 2; n1--) {\n      for (j = 0; j <= n1 - 1; j++) {\n        s[j][n1] = s[j][0];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[j][h] < s[j][n1])\n            s[j][n1] = s[j][h];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[j][h] = s[j][h] - s[j][n1];\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        s[n1][j] = s[0][j];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[h][j] < s[n1][j]) {\n            s[n1][j] = s[h][j];\n          }\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[h][j] = s[h][j] - s[n1][j];\n        }\n      }\n      sum = sum + s[1][1];\n      if (n1 > 2) {\n        for (j = 2; j <= n1 - 1; j++) {\n          s[0][j - 1] = s[0][j];\n          s[j - 1][0] = s[j][0];\n        }\n        for (j = 1; j <= n1 - 2; j++) {\n          for (h = 1; h <= n1 - 2; h++) {\n            s[j][h] = s[j + 1][h + 1];\n          }\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, s, i, j, k, m, t, a[100][100], x;\n  scanf(\"%d\", &n);\n  x = n;\n  for (i = 0; i < x; i++) {\n    s = 0;\n    n = x;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (t = 1; t < x; t++) {\n      for (j = 0; j < n; j++) {\n        m = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < m)\n            m = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (a[k][j] < m)\n            m = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] = a[k][j] - m;\n      }\n      s = s + a[1][1];\n      for (j = 1; j < n - 1; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - 1; j++)\n        for (k = 1; k < n - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "32629", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint t = 0;\nint sum(int n, int a[100][100]) {\n  if (n == 1)\n    return 1;\n  int i, j, k, min;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++) {\n      if (a[j][k] < min)\n        min = a[j][k];\n    }\n    for (k = 0; k < n; k++) {\n      a[j][k] -= min; \n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++) {\n      if (a[k][j] < min)\n        min = a[k][j];\n    }\n    for (k = 0; k < n; k++) {\n      a[k][j] -= min;\n    }\n  } \n\n  t += a[1][1]; \n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  } \n\n  sum(n - 1, a);\n  return t;\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n, a) << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint Matrix[100][100];\n\nint a[100] = {0};\n\nint b[100] = {0};\n\nint N = 0;\n\nvoid f(int n) {\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    a[i] = Matrix[i][0];\n    for (int k = 1; k < n; k++)\n      if (a[i] > Matrix[i][k])\n        a[i] = Matrix[i][k];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[i][j] -= a[i];\n}\nvoid g(int n) {\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    b[i] = Matrix[0][i];\n    for (int k = 1; k < n; k++)\n      if (b[i] > Matrix[k][i])\n        b[i] = Matrix[k][i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[j][i] -= b[i];\n}\nint h(int n) {\n  int k = 0;\n  f(n);\n  g(n);\n  k = Matrix[1][1];\n  if (n == 2)\n    return k;\n  for (int i = 1; i < n - 1; i++) {\n    Matrix[0][i] = Matrix[0][i + 1];\n    Matrix[i][0] = Matrix[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      Matrix[i][j] = Matrix[i + 1][j + 1];\n  }\n  return k + h(n - 1);\n}\nint main() {\n  scanf(\"%d\", &N);\n  for (int j = 0; j < N; j++) {\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        scanf(\"%d\", &Matrix[i][j]);\n    cout << h(N) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32631", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int c = 0; c < n; c++) {\n    int mat[n][n];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n\n    int s = 0;\n    for (int r = n; r > 1; r--) {\n      int m;\n\n      for (int i = 0; i < r; i++) {\n        m = mat[i][0];\n        for (int j = 1; j < r; j++)\n          m = min(m, mat[i][j]);\n        for (int j = 0; j < r; j++)\n          mat[i][j] -= m;\n      }\n\n      for (int j = 0; j < r; j++) {\n        m = mat[0][j];\n        for (int i = 1; i < r; i++)\n          m = min(m, mat[i][j]);\n        for (int i = 0; i < r; i++)\n          mat[i][j] -= m;\n      }\n\n      s += mat[1][1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 0; j < r; j++)\n          mat[i][j] = mat[i + 1][j];\n      for (int j = 1; j < r - 1; j++)\n        for (int i = 0; i < r - 1; i++)\n          mat[i][j] = mat[i][j + 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32632", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\n  \n  \n\n  int n;\n  int sum;\n  int min;\n  cin >> n;\n\n  int m[n][n][n];\n\n  for (int k = 0; k < n; k++) {\n    for (int x = 0; x < n; x++) {\n      for (int y = 0; y < n; y++) {\n        cin >> m[k][x][y];\n      }\n    }\n\n    sum = 0;\n\n    for (int l = 1; l < n; l++) {\n\n      for (int x = 0; x < n; x++) {\n        min = *min_element(m[k][x], m[k][x] + n);\n        for (int y = 0; y < n; y++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      for (int y = 0; y < n; y++) {\n        min = m[k][0][y];\n        for (int x = 1; x < n; x++) {\n          if (m[k][x][y] < min)\n            min = m[k][x][y];\n        }\n        for (int x = 0; x < n; x++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      sum += m[k][l][l];\n\n      for (int i = 0; i < n; i++) {\n        m[k][l][i] = m[k][0][i];\n        m[k][i][l] = m[k][i][0];\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid solve(int n) {\n  if (n != 1) {\n    for (int i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (int j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (int j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[j][i] -= min;\n      }\n    }\n    sum += a[1][1];\n    for (int i = 1; i < n - 1; i++) {\n      a[i][0] = a[i + 1][0];\n      a[0][i] = a[0][i + 1];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++) {\n        a[i][j] = a[i + 1][j + 1];\n      }\n    solve(n - 1);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    solve(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum = 0, min = 0, l, k;\n  scanf(\"%d \", &n);\n  l = n;\n  for (k = 0; k < l; k++) {\n    sum = 0;\n    int a[l][l];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d \", &a[i][j]);\n    n = l;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j + 1];\n      n = n - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32635", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int maze[100 + 10][100 + 10] = {0};\n\n  int i, j, k, l;\n  int n;\n  cin >> n;\n\n  for (k = 0; k < n; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> maze[i][j];\n\n    for (l = n; l >= 2; l--) {\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + i) + j) ? min : *(*(maze + i) + j);\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) -= min;\n      }\n\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + j) + i) ? min : *(*(maze + j) + i);\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) -= min;\n      }\n      sum += *(*(maze + 1) + 1);\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) = *(*(maze + i + 1) + j);\n      }\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) = *(*(maze + j) + i + 1);\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a[][100], int n);\n\nint main() {\n  int n, k = 0;\n  int a[100][100], sum = 0;\n  int m = 0;\n\n  cin >> n;\n  while (k < n) {\n    sum = 0;\n    m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n\n    while (m < n - 1) {\n      sum += change(a, n - m);\n\n      for (int i = 0; i < n - m; i++) {\n        for (int j = 2; j < n - m; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      for (int j = 0; j < n - m; j++) {\n        for (int i = 2; i < n - m; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      m++;\n    }\n\n    cout << sum << \"\\n\";\n\n    k++;\n  }\n\n  return 0;\n}\n\nint change(int a[][100], int n) {\n  int minx[100], miny[100];\n\n  int num;\n\n  for (int l = 0; l < 100; l++) {\n    minx[l] = INT_MAX;\n    miny[l] = INT_MAX;\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= minx[i];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= miny[j];\n    }\n  }\n  num = a[1][1];\n  return num;\n}\n"}
{"label": "18", "index": "32637", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\nint m, n, sum, j, min001 = 0, min002 = 0;\nint min01[101], min02[101];\nint min1(int a) {\n  for (int p = 0; p < m; p++)\n    min01[p] = juzhen[a][p];\n  sort(min01, min01 + m);\n  return min01[0];\n}\nint min2(int a) {\n  for (int p = 0; p < m; p++)\n    min02[p] = juzhen[p][a];\n  sort(min02, min02 + m);\n  return min02[0];\n}\nvoid jia(int x, int y) {\n  if (y == 1)\n    cout << sum << endl;\n  else {\n    for (j = 0; j < y; j++) {\n      min001 = min1(j);\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j][k] - min001;\n    }\n    for (j = 0; j < y; j++) {\n      min002 = min2(j);\n      for (int k = 0; k < y; k++)\n        juzhen[k][j] = juzhen[k][j] - min002;\n    }\n    sum = sum + juzhen[1][1];\n    for (j = 1; j < y - 1; j++) {\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j + 1][k];\n    }\n    for (j = 1; j < y; j++) {\n      for (int k = 0; k < y - 1; k++)\n        juzhen[k][j] = juzhen[k][j + 1];\n    }\n    m = m - 1;\n    jia(x, y - 1);\n  }\n}\nint main() {\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    m = n;\n    for (j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> juzhen[j][k];\n    }\n    jia(i, m);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32638", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint array_1[100][100][100] = {0};\nint main() {\n  int n, sum[100] = {0};\n  cin >> n;\n  int i, j, k, t;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> array_1[i][j][k];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][k][0];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][k][t])\n            min = array_1[i][k][t];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][0][k];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][t][k])\n            min = array_1[i][t][k];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][t][k] = array_1[i][t][k] - min;\n      }\n      sum[i] = sum[i] + array_1[i][1][1];\n      for (k = 0; k <= n - j; k++)\n        for (t = 1; t < n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t + 1];\n      for (k = 0; k < n - j; k++)\n\n        for (t = 1; t < n - j; t++)\n          array_1[i][t][k] = array_1[i][t + 1][k];\n    }\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0, n;\nvoid GuiLing(int num[][100], int n, int move);\nvoid XiaoJian(int num[][100], int move);\nint main() {\n  int i, j, t, num[100][100];\n  scanf(\"%d \", &n);\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    XiaoJian(num, 0);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid XiaoJian(int num[][100], int move) {\n  if (move == n - 1) {\n    ;\n  } else {\n    GuiLing(num, n, move);\n    sum = sum + num[move + 1][move + 1];\n    XiaoJian(num, move + 1);\n  }\n}\nvoid GuiLing(int num[][100], int n, int move) {\n  int i, j, min;\n\n  for (i = 0; i < n; i++) {\n    if ((move != 0) && ((i >= 1) && (i <= move)))\n      continue;\n    min = num[i][0];\n    for (j = 1; j < n; j++) {\n      if ((move != 0) && ((j >= 1) && (j <= move)))\n        continue;\n      if (num[i][j] < min) {\n        min = num[i][j];\n      }\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++) {\n        if ((move != 0) && ((j >= 1) && (j <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    if ((move != 0) && ((j >= 1) && (j <= move)))\n      continue;\n    min = num[0][j];\n    for (i = 1; i < n; i++) {\n      if ((move != 0) && ((i >= 1) && (i <= move)))\n        continue;\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++) {\n        if ((move != 0) && ((i >= 1) && (i <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "32640", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0};\n\nvoid function_1(int n) {\n  int i, j, k, min, num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = n; i > 1; i--) {\n    for (j = 0; j < i; j++) {\n      min = a[j][0];\n      for (k = 0; k < i; k++) {\n        if (a[j][k] < min)\n          min = a[j][k];\n      }\n      for (k = 0; k < i; k++) {\n        a[j][k] = a[j][k] - min;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      min = a[0][j];\n      for (k = 0; k < i; k++) {\n        if (a[k][j] < min)\n          min = a[k][j];\n      }\n      for (k = 0; k < i; k++) {\n        a[k][j] = a[k][j] - min;\n      }\n    }\n    num = num + a[1][1];\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (j == 0 && k > 1)\n          a[j][k - 1] = a[j][k];\n        if (k == 0 && j > 1)\n          a[j - 1][k] = a[j][k];\n        if (j > 1 && k > 1)\n          a[j - 1][k - 1] = a[j][k];\n      }\n    }\n  }\n  cout << num << endl;\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    function_1(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32641", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, p, sum;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = n; l > 1; l--) {\n      for (j = 0; j < l; j++) {\n        min = a[j][0];\n        for (k = 1; k < l; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < l; j++) {\n        min = a[0][j];\n        for (k = 1; k < l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < l; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < l - 1; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[k][j] = a[k + 1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k = 0, flag = 0, i, j, a[200][200],\n         o[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, l, ans = 0, min;\n  double b[1000], t, p, q;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    ans = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 0; i <= n - k; i++) {\n        min = **(a + i);\n\n        for (j = 1; j <= n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n\n      for (j = 0; j <= n - k; j++) {\n        min = *(*a + j);\n        for (i = 1; i <= n - k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      ans = ans + *(*(a + 1) + 1);\n      for (i = 1; i <= n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (j = 1; j <= n - k - 1; j++)\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n    }\n    cout << ans << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid rezero();\nvoid dele();\nint a[100][100], n, b, sum = 0;\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    b = n;\n    rezero();\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid rezero() {\n  int i, j, k, min;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 0; j < b; j++) {\n        if (a[i][j] <= min)\n          min = a[i][j];\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      min = a[0][i];\n      for (j = 0; j < b; j++) {\n        if (a[j][i] <= min)\n          min = a[j][i];\n      }\n      for (j = 0; j < b; j++) {\n        a[j][i] -= min;\n      }\n    }\n    dele();\n    b -= 1;\n  }\n}\nvoid dele() {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < b; i++)\n    for (j = 1; j < b - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < b - 1; j++)\n    for (i = 1; i < b - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\n"}
{"label": "18", "index": "32644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, mat[101][101], tp[101][101], sum = 0;\nvoid cut(int x) {\n  int min;\n  if (x == n - 1)\n    return;\n  else {\n    for (int i = 0; i < n - x; i++) {\n      min = mat[i][0];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[i][j] <= min) {\n          min = mat[i][j];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[i][j] -= min;\n    }\n    for (int i = 0; i < n - x; i++) {\n      min = mat[0][i];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[j][i] <= min) {\n          min = mat[j][i];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[j][i] -= min;\n    }\n    sum += mat[1][1];\n\n    for (int i = 0; i < n - x; i++)\n      mat[1][i] = -1;\n    for (int i = 0; i < n - x; i++)\n      mat[i][1] = -1;\n    tp[0][0] = mat[0][0];\n    for (int i = 2; i < n - x; i++)\n      tp[0][i - 1] = mat[0][i];\n    for (int i = 2; i < n - x; i++) {\n      tp[i - 1][0] = mat[i][0];\n      for (int j = 2; j < n - x; j++)\n        tp[i - 1][j - 1] = mat[i][j];\n    }\n\n    for (int i = 0; i < n - x - 1; i++) {\n      for (int j = 0; j < n - x - 1; j++) {\n        mat[i][j] = tp[i][j];\n      }\n    }\n\n    cut(x + 1);\n  }\n}\nvoid ope() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      scanf(\"%d \", &mat[i][j]);\n    }\n  }\n  sum = 0;\n  cut(0);\n  printf(\"%d\\n\", sum);\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    ope();\n  return 0;\n}\n"}
{"label": "18", "index": "32645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, s1;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    int s = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    s1 = n;\n    while (s1 > 1) {\n      for (j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (k = 1; k < n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        int min1 = a[0][k];\n        for (j = 1; j < n; j++)\n          if (a[j][k] < min1)\n            min1 = a[j][k];\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min1;\n      }\n      s = s + a[1][1];\n      s1 = s1 - 1;\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, t, k, tem, min, sum;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    tem = n;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < tem; i++) {\n        min = a[i][0];\n        for (j = 1; j < tem; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tem; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < tem; j++) {\n        min = a[0][j];\n        for (i = 1; i < tem; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < tem; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < tem; i++) {\n        for (j = 0; j < tem; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < tem; j++) {\n        for (i = 0; i < tem; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      tem--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[101][101];\nvoid guiling(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid f(int n) {\n  if (n == 1)\n    return;\n  else {\n    guiling(n);\n    sum += a[1][1];\n    xiaojian(n);\n    f(n - 1);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    f(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int n, i, j, t, min, count = 0, m;\n  scanf(\"%d \", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    count = 0;\n    for (t = n; t >= 2; t--) {\n      for (i = 1; i <= t; i++) {\n        min = a[i][1];\n        for (j = 1; j <= t; j++) {\n          min = (a[i][j] < min ? a[i][j] : min);\n        }\n        for (j = 1; j <= t; j++)\n          a[i][j] -= min;\n      }\n      for (j = 1; j <= t; j++) {\n        min = a[1][j];\n        for (i = 1; i <= t; i++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (i = 1; i <= t; i++)\n          a[i][j] -= min;\n      }\n      count += a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 2; j <= t - 1; j++)\n        for (i = 1; i <= t - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32649", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum;\nvoid calculate(int[][100], int);\n\nint main() {\n  int n, a[100][100];\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    calculate(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid calculate(int a[][100], int n) {\n  if (n == 1)\n    return;\n  int minx, miny;\n  for (int i = 0; i < n; i++) {\n    minx = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < minx)\n        minx = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= minx;\n  }\n  for (int i = 0; i < n; i++) {\n    miny = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < miny)\n        miny = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= miny;\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[j][i] = a[j + 1][i];\n  calculate(a, n - 1);\n}\n"}
{"label": "18", "index": "32650", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t, sum, m;\n  int a[100][100]; \n  int i, j, k;     \n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        t = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - t;\n        }\n      } \n      for (i = 0; i < m; i++) {\n        t = a[0][i];\n        for (j = 1; j < m; j++) {\n          if (a[j][i] < t)\n            t = a[j][i];\n        }\n        for (j = 0; j < m; j++) {\n          a[j][i] = a[j][i] - t;\n        }\n      } \n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[j][i] = a[j + 1][i];\n        }\n      }    \n      m--; \n    }\n    cout << sum << endl;\n  } \n  return 0;\n}\n"}
{"label": "18", "index": "32651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nn, n, i, j, k, min[100], maze[100][100], sum;\n  cin >> nn;\n  for (k = 0; k < nn; k++) {\n    sum = 0;\n    n = nn;\n    for (i = 0; i < nn; i++)\n      for (j = 0; j < nn; j++)\n        cin >> maze[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min[i] = maze[i][0];\n        for (j = 1; j < n; j++)\n          min[i] = min[i] < maze[i][j] ? min[i] : maze[i][j];\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          maze[i][j] -= min[i];\n        }\n      for (j = 0; j < n; j++) {\n        min[j] = maze[0][j];\n        for (i = 1; i < n; i++)\n          min[j] = min[j] < maze[i][j] ? min[j] : maze[i][j];\n      }\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++)\n          maze[i][j] -= min[j];\n      sum += maze[1][1];\n      for (i = 1; i < n - 1; i++)\n        maze[i][0] = maze[i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        maze[0][j] = maze[0][j + 1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          maze[i][j] = maze[i + 1][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, p, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    sum = 0;\n    for (p = n; p >= 1; p--) {\n      for (i = 0; i <= p; i++) {\n        a[0][i] = 99999;\n        a[i][0] = 99999;\n      }\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[i][0] > a[i][j]) {\n            a[i][0] = a[i][j];\n          }\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[i][0];\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[0][j] > a[i][j])\n            a[0][j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[0][j];\n      sum += a[2][2];\n      for (i = 1; i <= p; i++) {\n        a[2][i] = 0;\n        a[i][2] = 0;\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 3; j <= p; j++)\n          a[i][j - 1] = a[i][j];\n      for (i = 3; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i - 1][j] = a[i][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32653", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100][100], i, j, k, m, s[100], d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[i][j][k]);\n  }\n  d = n;\n  for (i = 0; i < d; i++) {\n    n = d;\n    s[i] = 0;\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        m = a[i][j][0];\n        for (k = 1; k < n; k++) {\n          if (a[i][j][k] < m)\n            m = a[i][j][k];\n          if (a[i][j][k] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][j][k] -= m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[i][0][j];\n        for (k = 1; k < n; k++) {\n          if (a[i][k][j] < m)\n            m = a[i][k][j];\n          if (a[i][k][j] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][k][j] -= m;\n      }\n      s[i] += a[i][1][1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][k][j] = a[i][k][j + 1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      n--;\n    }\n  }\n  for (i = 0; i < d; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32654", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int sum;\n  int min;\n  scanf(\"%d \", &n);\n  int m[n][n][n];\n  for (int k = 0; k < n; k++) {\n    for (int x = 0; x < n; x++) {\n      for (int y = 0; y < n; y++) {\n        cin >> m[k][x][y];\n      }\n    }\n\n    sum = 0;\n\n    for (int l = 1; l < n; l++) {\n\n      for (int x = 0; x < n; x++) {\n        min = *min_element(m[k][x], m[k][x] + n);\n        for (int y = 0; y < n; y++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      for (int y = 0; y < n; y++) {\n        min = m[k][0][y];\n        for (int x = 1; x < n; x++) {\n          if (m[k][x][y] < min)\n            min = m[k][x][y];\n        }\n        for (int x = 0; x < n; x++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      sum += m[k][l][l];\n\n      for (int i = 0; i < n; i++) {\n        m[k][l][i] = m[k][0][i];\n        m[k][i][l] = m[k][i][0];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, sum, min, m;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 1; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < m - 1; j++)\n        for (i = 1; i < m - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32656", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, p;\n  cin >> m;\n  n = m;\n  p = m;\n  while (n--) {\n    m = p;\n    int sum = 0, i, j, a[120][120], min;\n    \n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        cin >> a[i][j];\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        for (min = a[i][0], j = 0; j <= m; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= m; j++) {\n        for (min = a[0][j], i = 0; i <= m; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j <= m - 1; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, cnt, kobe;\n  cin >> n;\n  cnt = n;\n\n  int(*p)[200], a[200][200] = {0};\n  while (cnt--) {\n    int i, j, sum = 0;\n    long min;\n    kobe = n;\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (int k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < kobe; i++) {\n        min = 999999999;\n        for (j = 0; j < kobe; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (j = 0; j < kobe; j++) {\n        min = 999999999;\n        for (i = 0; i < kobe; i++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 1; i < kobe; i++)\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < kobe; j++)\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      kobe--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrixHor[103][103];\nint matrixVer[103][103];\n\nint min(int line[], int n) {\n  int mini = 100000;\n  for (int i = 1; i <= n; i++) {\n    if (line[i] < mini) {\n      mini = line[i];\n    }\n  }\n  return mini;\n}\nint main() {\n  int n, N;\n  scanf(\"%d \", &n);\n\n  for (int i = 1; i <= n; i++) {\n    int sum = 0;\n    N = n;\n    for (int j = 1; j <= N; j++) {\n      for (int k = 1; k <= N; k++) {\n        cin >> matrixVer[j][k];\n        matrixHor[k][j] = matrixVer[j][k];\n      }\n    }\n    for (int h = 1; h < n; h++) {\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixVer[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j][k] - minim;\n          matrixHor[k][j] = matrixVer[j][k];\n        }\n      }\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixHor[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixHor[j][k] = matrixHor[j][k] - minim;\n          matrixVer[k][j] = matrixHor[j][k];\n        }\n      }\n      sum = sum + matrixVer[2][2];\n      N = N - 1;\n      for (int j = 2; j <= N; j++) {\n        for (int k = 2; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j + 1][k + 1];\n          matrixHor[j][k] = matrixHor[j + 1][k + 1];\n        }\n      }\n      for (int j = 2; j <= N; j++) {\n        matrixHor[1][j] = matrixHor[1][j + 1];\n        matrixVer[j][1] = matrixHor[1][j];\n        matrixVer[1][j] = matrixVer[1][j + 1];\n        matrixHor[j][1] = matrixVer[1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32659", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint board[100][100];\nvoid Subduction(int);\nvoid Turn(int);\nint n;\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1) {\n    printf(\"%d\\n\", sum);\n  } else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    Turn(m);\n    Subduction(m - 1);\n  }\n}\n\nvoid Turn(int m) {\n  int p, q;\n  for (q = 1; q <= m - 2; q++) {\n    board[0][q] = board[0][q + 1];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    board[p][0] = board[p + 1][0];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    for (q = 1; q <= m - 2; q++) {\n      board[p][q] = board[p + 1][q + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "32660", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, m, k, sum, min;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    memset(a, 0, sizeof(a));\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint w[150][150];\nint m[150];\nint main() {\n  cin >> n;\n  for (int _n = 0; _n < n; _n++) {\n    memset(w, 0, sizeof(w));\n    int s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    for (int t = 1; t < n; t++) {\n\n      for (int i = 0; i < n; i++) {\n        if ((i < t) && i)\n          continue;\n        m[i] = w[i][0];\n        for (int j = t; j < n; j++)\n          if (w[i][j] < m[i])\n            m[i] = w[i][j];\n        w[i][0] -= m[i];\n        for (int j = t; j < n; j++)\n          w[i][j] -= m[i];\n      }\n      for (int j = 0; j < n; j++) {\n        if ((j < t) && j)\n          continue;\n        m[j] = w[0][j];\n        for (int i = t; i < n; i++)\n          if (w[i][j] < m[j])\n            m[j] = w[i][j];\n        w[0][j] -= m[j];\n        for (int i = t; i < n; i++)\n          w[i][j] -= m[j];\n      }\n      s += w[t][t];\n    }\n\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int mat[n][n];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n\n    int s = 0;\n    for (int r = n; r > 1; r--) {\n      int m;\n\n      for (int i = 0; i < r; i++) {\n        m = mat[i][0];\n        for (int j = 1; j < r; j++)\n          m = min(m, mat[i][j]);\n        for (int j = 0; j < r; j++)\n          mat[i][j] -= m;\n      }\n\n      for (int j = 0; j < r; j++) {\n        m = mat[0][j];\n        for (int i = 1; i < r; i++)\n          m = min(m, mat[i][j]);\n        for (int i = 0; i < r; i++)\n          mat[i][j] -= m;\n      }\n\n      s += mat[1][1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 0; j < r; j++)\n          mat[i][j] = mat[i + 1][j];\n      for (int j = 1; j < r - 1; j++)\n        for (int i = 0; i < r - 1; i++)\n          mat[i][j] = mat[i][j + 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32663", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int num[n][n];\n  int sum = 0;\n  int min = 0;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> num[i][j];\n    }\n    for (int s = 0; s < n - 1; s++) {\n      for (int i = 0; i < n; i++) {\n        min = INT_MAX;\n        for (int j = 0; j < n; j++) {\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        }\n        for (int j = 0; j < n; j++)\n          num[i][j] -= min;\n      }\n      for (int j = 0; j < n; j++) {\n        min = INT_MAX;\n        for (int i = 0; i < n; i++)\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        for (int i = 0; i < n; i++)\n          num[i][j] -= min;\n      }\n      sum += num[1 + s][1 + s];\n      for (int i = 0; i < n; i++) {\n        num[1 + s][i] = -1;\n        num[i][1 + s] = -1;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32664", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, b, j, k, a, su[100][100], result;\n  scanf(\"%d \", &n);\n  b = n;\n  for (i = 0; i < n; i++) {\n    result = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &su[j][k]);\n\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        a = su[j][0];\n        for (k = 0; k < n; k++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          su[j][k] -= a;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        a = su[0][k];\n        for (j = 0; j < n; j++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          su[j][k] -= a;\n        }\n      }\n      result += su[1][1];\n      for (j = 0; j < n - 1; j++) {\n        for (k = 0; k < n - 1; k++) {\n          if (j == 0 && k > 0) {\n            su[j][k] = su[j][k + 1];\n          } else if (k == 0 && j > 0)\n            su[j][k] = su[j + 1][k];\n          else if (j > 0 && k > 0)\n            su[j][k] = su[j + 1][k + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", result);\n    n = b;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32665", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int matrix[100][100];\n\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> matrix[j][k];\n    for (int m = n; m > 1; m--) {\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[j][0];\n        for (int k = 1; k < m; k++) {\n          if (matrix[j][k] < min)\n            min = matrix[j][k];\n        }\n        for (int k = 0; k < m; k++) {\n          matrix[j][k] -= min;\n        }\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[0][j];\n        for (int k = 1; k < m; k++) {\n          if (matrix[k][j] < min) {\n            min = matrix[k][j];\n          }\n        }\n        for (int k = 0; k < m; k++) {\n          matrix[k][j] -= min;\n        }\n      }\n\n      sum += matrix[1][1];\n      for (int i = 1; i < m; i++) {\n        for (int j = 1; j < m; j++)\n          matrix[i][j] = matrix[i + 1][j + 1];\n        matrix[0][i] = matrix[0][i + 1];\n        matrix[i][0] = matrix[i + 1][0];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32666", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, s = 0, d = 0, j = 0, i1 = 0, j1 = 0, k = 0, a = 0, sum = 0;\n  cin >> n;\n  int shu[n][n];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    d = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> shu[i][j];\n    for (s = 1; s <= n - 1; s++) {\n      for (i = 0; i < n - d; i++) {\n        a = 100000;\n        for (j = 0; j < n - d; j++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (j = 0; j < n - d; j++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      for (j = 0; j < n - d; j++) {\n        a = 100000;\n        for (i = 0; i < n - d; i++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (i = 0; i < n - d; i++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      sum = sum + shu[1][1];\n      d++;\n      for (i = 0; i < n - d; i++) {\n        for (j = 0; j < n - d; j++) {\n          if (j > 0) {\n            j1 = j + 1;\n          } else\n            j1 = j;\n          if (i > 0)\n            i1 = i + 1;\n          else\n            i1 = i;\n          shu[i][j] = shu[i1][j1];\n        }\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32667", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint mat[100][100], n, sum = 0;\nint rmin(int a[][100], int x) {\n  int i, rsmall = a[x][0];\n  for (i = 0; i < n; i++) {\n    if (rsmall > a[x][i]) {\n      rsmall = a[x][i];\n    }\n  }\n  return rsmall;\n}\nint cmin(int a[][100], int y) {\n  int i, csmall = a[0][y];\n  for (i = 0; i < n; i++) {\n    if (csmall > a[i][y]) {\n      csmall = a[i][y];\n    }\n  }\n  return csmall;\n}\nvoid caculate(int mat[][100]) {\n  int i, j, rsmall, csmall;\n  for (i = 0; i < n; i++) {\n    rsmall = rmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[i][j] -= rsmall;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    csmall = cmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[j][i] -= csmall;\n    }\n  }\n}\nvoid change(int a[][100], int x) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < x; i++)\n    for (j = 1; j < x - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (i = 1; i < x - 1; i++)\n    for (j = 0; j < x - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\nint main() {\n  int m, i, j, num;\n  scanf(\"%d \", &num);\n  for (m = 1; m <= num; m++) {\n    n = num;\n    sum = 0;\n    for (i = 0; i < num; i++) {\n      for (j = 0; j < num; j++) {\n        cin >> mat[i][j];\n      }\n    }\n    while (n != 1) {\n      caculate(mat);\n      change(mat, n--);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "32668", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[100][100];\nint n;\n\nvoid modify() {\n  for (int i = 0; i < n; i++) {\n    int min = num[i][0];\n    for (int j = 1; j < n; j++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      num[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min = num[0][j];\n    for (int i = 1; i < n; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      num[i][j] -= min;\n    }\n  }\n}\n\nvoid remove() {\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 0; j < n; j++) {\n      num[i][j] = num[i + 1][j];\n    }\n  }\n  for (int j = 1; j < n - 1; j++) {\n    for (int i = 0; i < n; i++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  int round = N;\n  while (round--) {\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    int sum = 0;\n    while (n > 1) {\n      modify();\n      sum += num[1][1];\n      remove();\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32669", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(void);\nvoid xiaojian(int);\nint g_n;\nint main() {\n  cin >> g_n;\n  int i, j, k;\n  for (i = 1; i <= g_n; i++) {\n    for (j = 0; j <= g_n - 1; j++) {\n      for (k = 0; k <= g_n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int cishu = 1;\n    int sum = 0;\n    for (; a[g_n - 1][0] >= 0; cishu++) {\n      guiling();\n      sum = sum + a[cishu][cishu];\n      xiaojian(cishu);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid guiling() {\n  int i = 0, j = 0, k = 0;\n  int flag = 0;\n  int min = 1000;\n  int p = 0;\n  for (p = 0; p <= g_n - 1; p++) {\n    flag = 0;\n    min = 1000;\n    if (a[p][0] >= 0) {\n      for (i = 0; i <= g_n - 1; i++) {\n        flag = 0;\n        min = 1000;\n        for (j = 0; j <= g_n - 1; j++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[i][k] = a[i][k] - min;\n          }\n        }\n      }\n      for (j = 0; j <= g_n - 1; j++) {\n        flag = 0;\n        min = 1000;\n        for (i = 0; i <= g_n - 1; i++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[k][j] = a[k][j] - min;\n          }\n        }\n      }\n    }\n  }\n}\nvoid xiaojian(int cishu) {\n  int i, j;\n  for (i = 0; i <= g_n - 1; i++) {\n    a[i][cishu] = -1;\n  }\n  for (j = 0; j <= g_n - 1; j++) {\n    a[cishu][j] = -1;\n  }\n}\n"}
{"label": "18", "index": "32670", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint min(int x, int y) {\n  int z;\n  if (x > y)\n    z = y;\n  else {\n    z = x;\n  }\n  return (z);\n}\nint main() {\n  int n, m, k, i, j, a[101][101], s[101], sum;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        s[i] = a[i][1];\n        for (j = 1; j <= n - k + 1; j++)\n          s[i] = min(a[i][j], s[i]);\n      }\n      for (i = 1; i <= n - k + 1; i++) {\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j] = a[i][j] - s[i];\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        s[j] = a[1][j];\n        for (i = 1; i <= n - k + 1; i++)\n          s[j] = min(a[i][j], s[j]);\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j] = a[i][j] - s[j];\n      }\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - k + 1; i++) {\n        if ((n - k + 1) >= 3)\n          for (j = 3; j <= n - k + 1; j++)\n            a[i][j - 1] = a[i][j];\n        else\n          break;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        if ((n - k + 1) >= 3)\n          for (i = 3; i <= n - k + 1; i++)\n            a[i - 1][j] = a[i][j];\n        else\n          break;\n      }\n    }\n    cout << \"\\n\" << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid min(int a[], int b);\nint main() {\n  int n = 0, i = 0, sum = 0;\n  cin >> n;\n  const int p = n;\n  for (i = 0; i < p; i++, sum = 0) {\n    int z[101][101] = {0}, z2[101] = {0};\n    int j = 0, k = 0;\n    n = p;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> z[j][k];\n    do {\n      for (j = 0; j < n; j++)\n        min(z[j], n);\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          z2[k] = z[k][j];\n        min(z2, n);\n        for (k = 0; k < n; k++)\n          z[k][j] = z2[k];\n      }\n      sum += z[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[j][k] = z[j][k + 1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[k][j] = z[k + 1][j];\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid min(int a[], int b) {\n  int w = 0, y = 10000;\n  for (w = 0; w < b; w++) {\n    if (a[w] < y)\n      y = a[w];\n  }\n  for (w = 0; w < b; w++)\n    a[w] = a[w] - y;\n}\n"}
{"label": "18", "index": "32672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, s, m, a[10000];\n  int *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  p = a;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n; i++) {\n      p1 = p + 100 * i;\n      for (j = 0; j < n; j++) {\n        p2 = p1 + j;\n        scanf(\"%d\", p2);\n      }\n    }\n    s = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n; i++) {\n        p1 = p + i * 100;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          *p2 = *p2 - m;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        p1 = p + i;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          *p2 = *p2 - m;\n        }\n      }\n      s = s + *(p + 101 * (k + 1));\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32673", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint matrixx[110][110];\n\nvoid Del() {\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[i][j] = matrixx[i + 1][j];\n    }\n  }\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[j][i] = matrixx[j][i + 1];\n    }\n  }\n  return;\n}\nint main() {\n  cin >> n;\n  int minnum;\n  int sum;\n  for (int s = 1; s <= n; s++) {\n    sum = 0;\n    for (int j = 1; j <= n; j++) {\n      for (int k = 1; k <= n; k++) {\n        cin >> matrixx[j][k];\n      }\n    }\n    for (int x; x < 3000; x++) {\n      if (x == 5) {\n        int y = 0;\n        y++;\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[j][k];\n          else\n            minnum = min(minnum, matrixx[j][k]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[j][k] -= minnum;\n        }\n      }\n      \n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[k][j];\n          else\n            minnum = min(minnum, matrixx[k][j]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[k][j] -= minnum;\n        }\n      }\n      sum += matrixx[2][2];\n      Del();\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32674", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid guiling(int a[][100], int);\nvoid xiaojian(int a[][100], int);\nint main() {\n  int n, a[100][100], k, i, j, sum;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int t = 0; t < n - 1; t++) {\n      guiling(a, n - t);\n      sum += a[1][1];\n      xiaojian(a, n - t);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid guiling(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int a[][100], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n}\n"}
{"label": "18", "index": "32675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N, A[213][213], Sum;\nvoid Work() {\n  memset(A, 0, sizeof(A));\n  Sum = 0;\n  for (int I = 1; I <= N; I++)\n    for (int J = 1; J <= N; J++)\n      cin >> A[I][J];\n  for (int K = 1; K <= N - 1; K++) {\n    int Min = A[1][1];\n    for (int J = K + 1; J <= N; J++)\n      if (A[1][J] < Min)\n        Min = A[1][J];\n    A[1][1] -= Min;\n    for (int J = K + 1; J <= N; J++)\n      A[1][J] -= Min;\n    for (int I = K + 1; I <= N; I++) {\n      int Min = A[I][1];\n      for (int J = K + 1; J <= N; J++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int J = 1; J <= N; J++)\n        A[I][J] -= Min;\n    }\n    Min = A[1][1];\n    for (int I = K + 1; I <= N; I++)\n      if (A[I][1] < Min)\n        Min = A[I][1];\n    A[1][1] -= Min;\n    for (int I = K + 1; I <= N; I++)\n      A[I][1] -= Min;\n    for (int J = K + 1; J <= N; J++) {\n      int Min = A[1][J];\n      for (int I = K + 1; I <= N; I++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int I = 1; I <= N; I++)\n        A[I][J] -= Min;\n    }\n    Sum += A[K + 1][K + 1];\n  }\n  cout << Sum << endl;\n}\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    Work();\n}\n"}
{"label": "18", "index": "32676", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0};\n\nvoid function_1(int n) {\n  int i, j, k, min, num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = n; i > 1; i--) {\n    for (j = 0; j < i; j++) {\n      min = a[j][0];\n      for (k = 0; k < i; k++) {\n        if (a[j][k] < min)\n          min = a[j][k];\n      }\n      for (k = 0; k < i; k++) {\n        a[j][k] = a[j][k] - min;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      min = a[0][j];\n      for (k = 0; k < i; k++) {\n        if (a[k][j] < min)\n          min = a[k][j];\n      }\n      for (k = 0; k < i; k++) {\n        a[k][j] = a[k][j] - min;\n      }\n    }\n    num = num + a[1][1];\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (j == 0 && k > 1)\n          a[j][k - 1] = a[j][k];\n        if (k == 0 && j > 1)\n          a[j - 1][k] = a[j][k];\n        if (j > 1 && k > 1)\n          a[j - 1][k - 1] = a[j][k];\n      }\n    }\n  }\n  cout << num << endl;\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1(n);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32677", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint findmin(int c, int low, int n) {\n  int min;\n  if (c == 1) {\n    int i;\n    min = a[low][0];\n    for (i = 0; i < n; i++) {\n      if (a[low][i] < min)\n        min = a[low][i];\n    }\n  }\n  if (c == 0) {\n    int i;\n    min = a[0][low];\n    for (i = 0; i < n; i++) {\n      if (a[i][low] < min)\n        min = a[i][low];\n    }\n  }\n  return min;\n}\nint dec(int n, int sum) {\n  if (n == 1)\n    return sum;\n  int i, j, k, min;\n  for (i = 0; i < n; i++) {\n    min = findmin(1, i, n);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = findmin(0, i, n);\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n\n  return dec(n - 1, sum);\n}\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, s, t;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << dec(n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid minu(int n);\nvoid shrink(int n);\nint main() {\n  int n, i, j, k, sum, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (x = n; x > 1; x--) {\n      minu(x);\n      sum += a[1][1];\n      shrink(x);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nvoid minu(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid shrink(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "32679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int m = 0;\n\n  int a[100][100];\n  int(*p)[100];\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n\n    int sum = 0;\n\n    p = a;\n\n    for (int i = 0; i < n; i++) \n    {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n\n    int min1 = *(*(p + 0) + 0);\n    for (int count = 0; count < n; count++) \n    {\n\n      m = n - count;\n      for (int i = 0; i < m; i++) \n      {\n        min1 = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++) \n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int j = 0; j < m; j++) \n          *(*(p + i) + j) -= min1;\n      }\n      for (int j = 0; j < m; j++) \n      {\n        min1 = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++) \n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int i = 0; i < m; i++) \n          *(*(p + i) + j) -= min1;\n      }\n\n      \n      sum += *(*(p + 1) + 1);\n\n      for (int i = 2; i < m; i++) \n      {\n        for (int j = 0; j < m; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (int j = 2; j < m; j++) \n      {\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n    }\n    sum -= *(*(p + 1) + 1);\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k < n; k++) {\n    int i, j, l;\n    int a[100][100];\n    int s[100];\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n\n    for (l = 0; l < n - 1; l++) {\n      int minh[100] = {0};\n      for (i = 0; i < n; i++) {\n\n        if (a[i][0] >= 0) {\n          minh[i] = a[i][0];\n          for (j = 0; j < n; j++) {\n            if (a[i][j] < minh[i] && a[i][j] >= 0)\n              minh[i] = a[i][j];\n          }\n          for (j = 0; j < n; j++) {\n            a[i][j] = a[i][j] - minh[i];\n          }\n        }\n      }\n      int minl[100] = {0};\n      for (i = 0; i < n; i++) {\n        if (a[0][i] >= 0)\n\n        {\n          minl[i] = a[0][i];\n          for (j = 0; j < n; j++) {\n            if (a[j][i] < minl[i] && a[i][j] >= 0)\n              minl[i] = a[j][i];\n          }\n          for (j = 0; j < n; j++) {\n            a[j][i] = a[j][i] - minl[i];\n          }\n        }\n      }\n      s[l] = a[l + 1][l + 1];\n\n      for (i = 0; i < n; i++) {\n        a[l + 1][i] = -1;\n        a[i][l + 1] = -1;\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < n - 1; i++) {\n      sum = sum + s[i];\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100][100], i, j, k, p = 0, q = 0, m, s[100], d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n  }\n  d = n;\n  for (i = 0; i < d; i++) {\n    n = d;\n    s[i] = 0;\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        m = a[i][j][0];\n        for (k = 1; k < n; k++) {\n          if (a[i][j][k] < m)\n            m = a[i][j][k];\n          if (a[i][j][k] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][j][k] -= m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[i][0][j];\n        for (k = 1; k < n; k++) {\n          if (a[i][k][j] < m)\n            m = a[i][k][j];\n          if (a[i][k][j] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][k][j] -= m;\n      }\n      s[i] += a[i][1][1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][k][j] = a[i][k][j + 1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      n--;\n    }\n  }\n  for (i = 0; i < d; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32682", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t, N;\n  cin >> n;\n  int jz[n][n][n], min, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    N = n;\n    sum = 0;\n    for (t = 1; t < n; t++) {\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i + 1][j];\n        }\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j + 1];\n        }\n      }\n      N--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[101] = {0}, min;\n  int i, j, k, l, h, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      for (l = 0; l <= n - j; l++) {\n        min = a[l][0];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[l][h]) {\n            min = a[l][h];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[l][h] = a[l][h] - min;\n        }\n      }\n      for (l = 0; l <= n - j; l++) {\n        min = a[0][l];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[h][l]) {\n            min = a[h][l];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[h][l] = a[h][l] - min;\n        }\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (l = 1; l <= n - j - 1; l++) {\n        a[0][l] = a[0][l + 1];\n        a[l][0] = a[l + 1][0];\n      }\n      for (l = 1; l <= n - j - 1; l++) {\n        for (h = 1; h <= n - j - 1; h++) {\n          a[l][h] = a[l + 1][h + 1];\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int n, int a[101][101]) {\n  int i, j, min, k;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 1; j <= n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 1; j <= n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 1; i <= n; i++) {\n    min = a[1][i];\n    for (j = 1; j <= n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 1; j <= n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[2][2];\n  else {\n    k = a[2][2];\n    for (i = 3; i <= n; i++) {\n      a[1][i - 1] = a[1][i];\n      a[i - 1][1] = a[i][1];\n    }\n    for (i = 3; i <= n; i++)\n      for (j = 3; j <= n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    n--;\n    return k + f(n, a);\n  }\n}\nint main() {\n  int a[101][101] = {0}, n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << f(n, a) << \"\\n\";\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, arr[100][100], i, j, k, l, min, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> arr[i][j];\n      }\n    }\n    for (l = n; l > 1; l--) {\n      for (i = 0; i < l; i++) {\n        min = arr[i][0];\n        for (j = 1; j < l; j++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      for (j = 0; j < l; j++) {\n        min = arr[0][j];\n        for (i = 1; i < l; i++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (i = 0; i < l; i++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      sum = sum + arr[1][1];\n      for (i = 1; i < l; i++) {\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i + 1][j];\n        }\n      }\n      for (j = 1; j < l; j++) {\n        for (i = 0; i < l - 1; i++) {\n          arr[i][j] = arr[i][j + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    memset(arr, 0, sizeof(arr));\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid r(int m);\nvoid l(int m);\nvoid fun(int m);\nvoid Try(\n    int i); \nint a[100][100], n, s[100] = {0};\nint main() {\n  int i, j, k, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    Try(0); \n    for (j = 0; j < n - 1; j++)\n      sum = sum + s[j]; \n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid r(\n    int m) \n{\n  int x, y, min;\n  for (x = 0; x < m; x++) {\n    min = a[x][0];\n    for (y = 0; y < m; y++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (y = 0; y < m; y++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid l(\n    int m) \n{\n  int x, y, min;\n  for (y = 0; y < m; y++) {\n    min = a[0][y];\n    for (x = 0; x < m; x++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (x = 0; x < m; x++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid fun(\n    int m) \n{\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j < m - 1; j++) {\n    for (i = 2; i < m; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\nvoid Try(int i) {\n  r(n - i);\n  l(n - i);\n  s[i] = a[1][1];\n  fun(n - i);\n  if (i < n - 1)\n    Try(i + 1);\n}\n"}
{"label": "18", "index": "32687", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, p, sum;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = n; l > 1; l--) {\n      for (j = 0; j < l; j++) {\n        min = a[j][0];\n        for (k = 1; k < l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < l; j++) {\n        min = a[0][j];\n        for (k = 1; k < l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < l; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < l - 1; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[k][j] = a[k + 1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32688", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        int min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        int min = a[0][j];\n        for (k = 0; k < n - l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < n - l - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - l; j++)\n        a[j][0] = a[j + 1][0];\n      for (j = 1; j < n - l - 1; j++)\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32689", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000] = {0};\nint sum = 0;\nvoid cut(int n) {\n  int i, j, k;\n  int min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (k = 0; k < n; k++)\n      a[i][k] = a[i][k] - min;\n    min = 10000;\n  }\n  min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (k = 0; k < n; k++)\n      a[k][i] = a[k][i] - min;\n    min = 10000;\n  }\n  sum = sum + a[1][1];\n}\nint main() {\n  int n, i, j, k, p;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    for (p = 1; p < n; p++) {\n      cut(n - p + 1);\n      for (j = 1; j < n - p; j++)\n        for (k = 1; k < n - p; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      for (k = 1; k < (n - p); k++)\n        a[0][k] = a[0][k + 1];\n      for (k = 1; k < (n - p); k++)\n        a[k][0] = a[k + 1][0];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32690", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n\n  int min = *(*(a + hang) + 1);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + hang) + i) < min)\n      min = *(*(a + hang) + i);\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = *(*(a + 1) + lie);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + i) + lie) < min)\n      min = *(*(a + i) + lie);\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  scanf(\"%d \", &n);\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + mm) + i) = *(*(a + mm) + i) - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + i) + mm) = *(*(a + i) + mm) - Minlie;\n      }\n\n      sum += *(*(a + 2) + 2);\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + ii) + i - 1) = *(*(a + ii) + i);\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + i - 1) + ii) = *(*(a + i) + ii);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32691", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  const int MAX = 50000;\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int jz[110][110];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &jz[i][j]);\n    int ans = 0;\n    for (int x = 0; x < n - 1; x++) {\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        for (int j = 0; j < n - x; j++)\n          jz[i][j] -= min;\n      }\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        for (int j = 0; j < n - x; j++)\n          jz[j][i] -= min;\n      }\n      ans += jz[1][1];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[i][j - 1] = jz[i][j];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[j - 1][i] = jz[j][i];\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid minu(int n);\nvoid shrink(int n);\nint main() {\n  int n, i, j, k, sum, x;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (x = n; x > 1; x--) {\n      minu(x);\n      sum += a[1][1];\n      shrink(x);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid minu(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid shrink(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "32693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, sum = 0;\n  scanf(\"%d \", &n);\n  for (int p = 1; p <= n; p++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int q = 1; q < n; q++) {\n      for (i = q; i <= n; i++) {\n        m = a[i][q];\n        for (j = q + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (j = q; j <= n; j++)\n          a[i][j] -= m;\n      }\n      for (j = q; j <= n; j++) {\n        m = a[q][j];\n        for (i = q + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (i = q; i <= n; i++)\n          a[i][j] -= m;\n      }\n      sum += a[q][q];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "32694", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint matrixx[110][110];\n\nvoid Del() {\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[i][j] = matrixx[i + 1][j];\n    }\n  }\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[j][i] = matrixx[j][i + 1];\n    }\n  }\n  return;\n}\nint main() {\n  scanf(\"%d \", &n);\n  int minnum;\n  int sum;\n  for (int s = 1; s <= n; s++) {\n    sum = 0;\n    for (int j = 1; j <= n; j++) {\n      for (int k = 1; k <= n; k++) {\n        cin >> matrixx[j][k];\n      }\n    }\n    for (int x; x < 3000; x++) {\n      if (x == 5) {\n        int y = 0;\n        y++;\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[j][k];\n          else\n            minnum = min(minnum, matrixx[j][k]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[j][k] -= minnum;\n        }\n      }\n\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[k][j];\n          else\n            minnum = min(minnum, matrixx[k][j]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[k][j] -= minnum;\n        }\n      }\n      sum += matrixx[2][2];\n      Del();\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int[][101], int);\nint main() {\n  int n, i, j, k;\n  int a[101][101];\n\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    printf(\"%d\\n\", sum(a, n));\n  }\n  return 0;\n}\n\nint sum(int a[][101], int n) {\n  int i, j, temp, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  temp = a[1][1];\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      if (j == 0 && i > 0)\n        a[i][j] = a[i + 1][j];\n      if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n    }\n\n  if (n == 1)\n    return 0;\n  else\n    return temp + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "32696", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], sum;\nvoid f(int m) {\n  int i, j, min;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      min = a[i][0];\n      for (j = 0; j < m; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n    }\n    for (j = 0; j < m; j++) {\n      min = a[0][j];\n      for (i = 0; i < m; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n    }\n    sum = sum + a[1][1];\n    for (j = 2; j < m; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < m; i++)\n      a[i - 1][0] = a[i][0];\n    for (i = 2; i < m; i++)\n      for (j = 2; j < m; j++)\n        a[i - 1][j - 1] = a[i][j];\n    f(m - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100], p, min, sum = 0;\n  scanf(\"%d \", &n);\n  for (p = 1; p <= n; p++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (k = 1; k <= n - 1; k++) {\n\n      for (i = 0; i <= n - 1; i++) {\n        min = a[i][0];\n        for (j = k; j <= n - 1; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n\n        for (j = 0; j <= n - 1; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (j = 0; j <= n - 1; j++) {\n        min = a[0][j];\n        for (i = k; i <= n - 1; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - 1; i++) {\n\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[k][k];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100];\nvoid hang(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  for (int i = 0; i < n; i++)\n    a[m][i] -= min;\n}\nvoid lie(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  for (int i = 0; i < n; i++)\n    a[i][m] -= min;\n}\nvoid del(int a[100][100]) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int k = 0, sum = 0;\n    while (k < n - 1) {\n      for (i = 0; i < n; i++)\n        hang(i);\n      for (i = 0; i < n; i++)\n        lie(i);\n      sum += a[1][1];\n      del(a);\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t, N;\n  scanf(\"%d \", &n);\n  int jz[n][n][n], min, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    N = n;\n    sum = 0;\n    for (t = 1; t < n; t++) {\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i + 1][j];\n        }\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j + 1];\n        }\n      }\n      N--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32700", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, min1;\nint a[110][110];\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < min1)\n    min1 = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= min1;\n}\nint main() {\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = 0, m = n; m > 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        min1 = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101];\nint main() {\n  int n, i, j, b, k, l, m, s;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    s = n, b = 0;\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[k][l] < m)\n            m = a[k][l];\n\n        for (l = 0; l < s; l++)\n          a[k][l] -= m;\n      }\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[l][k] < m)\n            m = a[l][k];\n\n        for (l = 0; l < s; l++)\n          a[l][k] -= m;\n      }\n\n      b += a[1][1];\n\n      for (k = 0; k < s; k++) {\n        for (l = 0; l < s; l++) {\n          if (k == 0 && l > 1) {\n            a[k][l - 1] = a[k][l];\n          } else if (k > 1 && l == 0) {\n            a[k - 1][l] = a[k][l];\n          } else if (k > 1 && l > 1) {\n            a[k - 1][l - 1] = a[k][l];\n          }\n        }\n      }\n      s--;\n    }\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32702", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, sum;\n  int a[200][200];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d \", &a[j][k]);\n    l = n;\n    sum = 0;\n    while (n >= 2) {\n      for (j = 1; j <= n; j++) {\n        min = a[j][1];\n        for (k = 1; k <= n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 1; k <= n; k++)\n          a[j][k] -= min;\n      }\n      for (k = 1; k <= n; k++) {\n        min = a[1][k];\n        for (j = 1; j <= n; j++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (j = 1; j <= n; j++)\n          a[j][k] -= min;\n      }\n      sum += a[2][2];\n      for (j = 2; j <= n - 1; j++)\n        for (k = 1; k <= n; k++)\n          a[j][k] = a[j + 1][k];\n      for (k = 2; k <= n - 1; k++)\n        for (j = 1; j <= n - 1; j++)\n          a[j][k] = a[j][k + 1];\n      n--;\n    }\n    n = l;\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int input, shu[101][101], min[101], min1[101], sum, i, j, i1, j1, n,\n      num; \n  cin >> input;\n  for (n = 1; n <= input; n++) {\n    num = input;\n    for (i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> shu[i][j];\n    }\n    sum = 0;        \n    while (num > 1) \n    {\n      for (i = 0; i < num; i++) \n      {\n        min[i] = 1000000;\n        min1[i] = 10000000;\n      }\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num; j++) {\n          if (shu[i][j] < min[i])\n            min[i] = shu[i][j]; \n          if (j == num - 1)     \n          {\n            for (j1 = 0; j1 < num; j1++)\n              shu[i][j1] = shu[i][j1] - min[i]; \n          }\n        }\n      }\n      for (j = 0; j < num; j++) {\n        for (i = 0; i < num; i++) {\n          if (shu[i][j] < min1[j])\n            min1[j] = shu[i][j]; \n          if (i == num - 1)      \n          {\n            for (i1 = 0; i1 < num; i1++)\n              shu[i1][j] = shu[i1][j] - min1[j]; \n          }\n        }\n      }\n      sum = sum + shu[1][1]; \n      for (i = 0; i < num; i++) {\n        for (j = 1; j < num - 1; j++)\n          shu[i][j] = shu[i][j + 1]; \n      }\n      for (j = 0; j < num - 1; j++) {\n        for (i = 1; i < num - 1; i++)\n          shu[i][j] = shu[i + 1][j]; \n      }\n      num--;\n    }\n    cout << sum << endl;\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32704", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  int n, arr[101][101], temp[101][101];\n  int cnt_a, cnt_b;\n  int(*ptr)[101], ans, m;\n  int(*ptr_t)[101];\n  int mini;\n  ptr = arr;\n  ptr_t = temp;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    memset(arr, 0, sizeof(arr));\n    ans = 0;\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> *(*(ptr + i) + j);\n\n    m = n;\n    for (i = 0; i < n - 1; ++i) {\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + j) + l) < mini)\n            mini = *(*(ptr + j) + l);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + j) + l) -= mini;\n        }\n      }\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + l) + j) < mini)\n            mini = *(*(ptr + l) + j);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + l) + j) -= mini;\n        }\n      }\n      ans += *(*(ptr + 1) + 1);\n      cnt_a = 0;\n      cnt_b = 0;\n      for (j = 0; j < m; ++j) {\n        cnt_b = 0;\n        for (l = 0; l < m; ++l) {\n          if (j == 1 || l == 1)\n            continue;\n          *(*(ptr_t + cnt_a) + cnt_b) = *(*(ptr + j) + l);\n          cnt_b++;\n        }\n        if (j != 1)\n          cnt_a++;\n      }\n      memset(arr, 0, sizeof(arr));\n      for (j = 0; j < cnt_a; ++j)\n        for (l = 0; l < cnt_b; ++l) {\n          *(*(ptr + j) + l) = *(*(ptr_t + j) + l);\n        }\n      m--;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32705", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, min, n0, a[100][100] = {0}, temp[100][100];\n  cin >> n0;\n  for (int z = 0; z < n0; ++z) {\n    s = 0;\n    for (int i = 0; i < n0; ++i)\n      for (int j = 0; j < n0; ++j) {\n        cin >> a[i][j];\n      }\n    for (int n = n0; n > 1; --n) {\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[k][l];\n          else\n            min = min > a[k][l] ? a[k][l] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[k][l] -= min;\n        }\n      }\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[l][k];\n          else {\n            min = min > a[l][k] ? a[l][k] : min;\n          }\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[l][k] -= min;\n        }\n      }\n\n      s += a[1][1];\n      for (int i = 0; i < n; ++i)\n        for (int j = 0; j < n; ++j) {\n          temp[i][j] = a[i][j];\n        }\n      for (int i = 2; i < n; ++i) {\n        a[i - 1][0] = temp[i][0];\n      }\n      for (int i = 2; i < n; ++i) {\n        a[0][i - 1] = temp[0][i];\n      }\n      for (int i = 2; i < n; ++i)\n        for (int j = 2; j < n; ++j) {\n          a[i - 1][j - 1] = temp[i][j];\n        }\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32706", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], i, j, c, sum = 0, k, n, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (c = n; c > 1; c--) {\n      for (i = 0; i < c; i++) {\n        min = 100000;\n        for (j = 0; j < c; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < c; j++) {\n        min = 100000;\n        for (i = 0; i < c; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < c; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < c - 1; i++) {\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < c; j++)\n        for (i = 0; i < c - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, j, k, a[100][100][100];\n\nint main() {\n  int sum[100] = {0}, t, x, min;\n  cin >> n;\n  t = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (x = 0; x < n; x++) {\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[x][i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (j = 0; j < n; j++) {\n          a[x][i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[x][0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (i = 0; i < n; i++) {\n          a[x][i][j] -= min;\n        }\n      }\n      sum[x] += a[x][1][1];\n      for (i = 1; i < n - 1; i++)\n        a[x][i][0] = a[x][i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        a[x][0][j] = a[x][0][j + 1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[x][i][j] = a[x][i + 1][j + 1];\n      }\n      n--;\n    }\n    n = t;\n  }\n  for (i = 0; i < t; i++)\n    cout << sum[i] << endl;\n\n  return 0;\n}\n"}
{"label": "18", "index": "32708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint total;\n\nvoid slice_1(int);\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  slice_1(n);\n}\n\nvoid slice_1(int n) {\n  total += a[1][1];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (j > 0 && i > 0) {\n        a[i][j] = a[i + 1][j + 1];\n      } else if (j > 0) {\n        a[i][j] = a[i][j + 1];\n      } else if (i > 0) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n  n--;\n  if (n == 1) {\n    return;\n  }\n  zero(n);\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    memset(a, 0, 100 * 100 * sizeof(int));\n    total = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    zero(n);\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32709", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sub(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> num[j][k];\n    printf(\"%d\\n\", sub(num, n));\n  }\n  return 0;\n}\nint sub(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i < n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + sub(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "32710", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[102][102] = {0}, sum = 0;\n  scanf(\"%d \", &n);\n\n  int i, j, k, cc;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> *(*(a + j) + k);\n      }\n    }\n    cc = n;\n\n    while (cc > 1) {\n      int min = 10000;\n      for (j = 1; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + j) + k)) {\n            min = *(*(a + j) + k);\n          }\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n        }\n        min = 10000;\n      }\n      sum += *(*(a + 2) + 2);\n\n      for (j = 3; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n        }\n      }\n      for (j = 1; j <= cc; j++) {\n        for (k = 3; k <= cc; k++) {\n          *(*(a + j) + k - 1) = *(*(a + j) + k);\n        }\n      }\n      cc--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32711", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num, minx[101], miny[101];\n  int a[101][101];\n  scanf(\"%d \", &num);\n  const int number = num;\n  while (num > 0) {\n    int sum = 0;\n    for (i = 0; i < number; i++)\n      for (j = 0; j < number; j++)\n        cin >> a[i][j];\n    n = number;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        minx[i] = 1000;\n        miny[i] = 1000;\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[i][k] = a[i][k] - minx[i];\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[k][i] = a[k][i] - miny[i];\n      sum += a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n - 1; i++)\n          a[i][j] = a[i][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n    num--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32712", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int change(int a[100][100], int);\n  int n, a[100][100], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    printf(\"%d\\n\", change(a, n));\n  }\n}\nint change(int a[100][100], int n) {\n  int i, j, s, b[100][100], f;\n  for (i = 0; i < n; i++) {\n    s = a[i][0];\n    for (j = 0; j < n; j++)\n      s = (s > a[i][j]) ? a[i][j] : s;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < n; i++) {\n    s = a[0][i];\n    for (j = 0; j < n; j++)\n      s = (s > a[j][i]) ? a[j][i] : s;\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  f = a[1][1];\n  if (n > 2) {\n    b[0][0] = a[0][0];\n    for (i = 2; i < n; i++) {\n      b[0][i - 1] = a[0][i];\n      b[i - 1][0] = a[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        b[i - 1][j - 1] = a[i][j];\n    f = f + change(b, n - 1);\n  }\n  return f;\n}\n"}
{"label": "18", "index": "32713", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint operation(int a[100][100], int m);\nint main() {\n  int n, i, j, k, sum;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, -1, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    for (j = 1; j <= n - 1; j++)\n      sum = sum + operation(a, n - j + 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint operation(int a[100][100], int m) {\n  int i, j, temp, k, t;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j < m; j++) {\n    int min = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  temp = a[1][1];\n  int b[100][100];\n  memset(b, -1, sizeof(b));\n  for (i = 0, t = 0; i < m; i++, t++) {\n    if (i == 1) {\n      t--;\n      continue;\n    }\n    for (j = 0, k = 0; j < m; j++, k++) {\n      if (j == 1) {\n        k--;\n        continue;\n      } else\n        b[t][k] = a[i][j];\n    }\n  }\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = b[i][j];\n  return temp;\n}\n"}
{"label": "18", "index": "32714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[110][110], i, j, x, min = 10000, sum = 0, k;\n  int(*p)[110] = a;\n  cin >> x;\n  for (k = 1; k <= x; k++) {\n    sum = 0;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= x; j++)\n        cin >> *(*(p + i) + j);\n    for (n = x; n >= 2; n--) {\n      for (i = 1; i <= n; i++) {\n        min = 100000;\n        for (j = 1; j <= n; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 1; j <= n; j++) {\n        min = 100000;\n        for (i = 1; i <= n; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 2) + 2);\n      for (i = 2; i <= n - 1; i++)\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (j = 2; j <= n - 1; j++)\n        for (i = 1; i <= n; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32715", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, i, j, k, a[150][150], sum, min1[150];\nint f(int size) {\n  if (size == 1)\n    return sum;\n  for (i = 0; i < size; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < size; j++) {\n      if (a[i][j] < min1[i]) {\n        min1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < size; i++) {\n    for (j = 0; j < size; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n  for (j = 0; j < size; j++) {\n    min1[j] = a[0][j];\n    for (i = 0; i < size; i++) {\n      if (a[i][j] < min1[j]) {\n        min1[j] = a[i][j];\n      }\n    }\n  }\n  for (j = 0; j < size; j++) {\n    for (i = 0; i < size; i++) {\n      a[i][j] = a[i][j] - min1[j];\n    }\n  }\n  sum = sum + a[1][1];\n  for (i = 1; i < size - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < size - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return f(size - 1);\n}\n\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    cout << f(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a, int b) { return a < b ? a : b; }\n\nint f(int n, int number[100][100]) {\n  int num[100], m = 10000;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      m = min(m, number[i][j]);\n    }\n    num[i] = m;\n    m = 10000;\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      number[i][j] = number[i][j] - num[i];\n  }\n\n  m = 10000;\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      m = min(m, number[i][j]);\n    }\n    num[j] = m;\n    m = 10000;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      number[i][j] = number[i][j] - num[j];\n    }\n  }\n\n  if (n == 2)\n\n    return number[1][1];\n  else {\n    int sum;\n    sum = number[1][1];\n    for (int j = 0; j < n; j++) {\n      for (int i = 1; i < n - 1; i++) {\n        number[i][j] = number[i + 1][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n - 1; j++) {\n        number[i][j] = number[i][j + 1];\n      }\n    }\n    return sum + f(n - 1, number);\n  }\n}\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int n1 = n;\n  while (n--) {\n    int number[100][100];\n    for (int i = 0; i < n1; i++) {\n      for (int j = 0; j < n1; j++) {\n        cin >> number[i][j];\n      }\n    }\n    int sum = f(n1, number);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32717", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, k, j, p, q, a[110][110] = {0}, Min, sum;\nint get() {\n  for (p = 0; p < n - 1; p++) {\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[k][j])\n          Min = a[k][j];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[k][j] -= Min;\n      }\n    }\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[j][k])\n          Min = a[j][k];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[j][k] -= Min;\n      }\n    }\n    sum += a[1][1];\n    q--;\n    for (k = 0; k < q - 1; k++)\n      for (j = 0; j < q + 1; j++)\n        a[k + 1][j] = a[k + 2][j];\n\n    for (k = 0; k < q; k++)\n      for (j = 0; j < q - 1; j++) {\n        a[k][j + 1] = a[k][j + 2];\n      }\n  }\n  return sum;\n}\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    q = n;\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][j];\n    cout << get() << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32718", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint a[100][100];\nvoid guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) \n  {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  if (n == 1)\n    return 0;\n  int k = 0;\n  guiling(n);\n  k += a[1][1];\n  xiaojian(n);\n  n--;\n  return k + Sum(n); \n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    cout << Sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32719", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a[][100], int n);\n\nint main() {\n  int n, k = 0;\n  int a[100][100], sum = 0;\n  int m = 0;\n\n  cin >> n;\n  while (k < n) {\n    sum = 0;\n    m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    while (m < n - 1) {\n      sum += change(a, n - m);\n\n      for (int i = 0; i < n - m; i++) {\n        for (int j = 2; j < n - m; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      for (int j = 0; j < n - m; j++) {\n        for (int i = 2; i < n - m; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      m++;\n    }\n\n    printf(\"%d\\n\", sum);\n\n    k++;\n  }\n\n  return 0;\n}\n\nint change(int a[][100], int n) {\n  int minx[100], miny[100];\n\n  int num;\n\n  for (int l = 0; l < 100; l++) {\n    minx[l] = INT_MAX;\n    miny[l] = INT_MAX;\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= minx[i];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= miny[j];\n    }\n  }\n  num = a[1][1];\n  return num;\n}\n"}
{"label": "18", "index": "32720", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum(int n);\nint a[100][100];\nint main() {\n  int n;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "32721", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, cycle;\n  scanf(\"%d \", &n);\n  for (cycle = 0; cycle < n; cycle++) {\n    int i, j, a[100][100] = {0}, w, sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n\n    w = n;\n    int min;\n\n    while (w > 1) {\n      for (i = 0; i < w; i++) {\n        min = a[i][0];\n        for (j = 0; j < w; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < w; j++)\n          a[i][j] -= min;\n      }\n\n      for (j = 0; j < w; j++) {\n        int count = 0;\n\n        for (i = 0; i < w; i++) {\n\n          if (a[i][j] == 0) {\n            count++;\n            break;\n          }\n        }\n\n        if (count == 0) {\n          min = a[0][j];\n          for (i = 0; i < w; i++) {\n            if (a[i][j] < min)\n              min = a[i][j];\n          }\n\n          for (i = 0; i < w; i++)\n            a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (j = 2; j < w; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < w; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i < w; i++) {\n        for (j = 2; j < w; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n      w--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int n, i, j, k, l;\n  int min;\n  int x = 0;\n  cin >> n;\n  for (l = 0; l <= n - 1; ++l) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    x = 0;\n    for (k = 0; k <= n - 2; ++k) {\n      for (i = 0; i <= n - k - 1; ++i) {\n        min = a[i][0];\n        for (j = 0; j <= n - k - 1; ++j) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j <= n - k - 1; ++j) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j <= n - k - 1; ++j) {\n        min = a[0][j];\n        for (i = 0; i <= n - k - 1; ++i) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - k - 1; ++i)\n          a[i][j] -= min;\n      }\n      x += a[1][1];\n      for (j = 2; j <= n - k - 1; ++j) {\n        a[0][j - 1] = a[0][j];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        for (j = 2; j <= n - k - 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32723", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[110][110], sum;\n\nvoid dispose(int n);\n\nint main() {\n  int n;\n  cin >> n;\n  int p = 0;\n  do {\n    memset(array_1, 0, sizeof(array_1));\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    dispose(n);\n    cout << sum << endl;\n    p++;\n  } while (p < n);\n  return 0;\n}\n\nvoid dispose(int n) {\n  int i, j;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    int rowmin = array_1[i][0];\n    for (j = 1; j < n; j++)\n      if (rowmin > array_1[i][j])\n        rowmin = array_1[i][j];\n    for (j = 0; j < n; j++)\n      array_1[i][j] -= rowmin;\n  }\n  for (i = 0; i < n; i++) {\n    int colmin = array_1[0][i];\n    for (j = 1; j < n; j++)\n      if (colmin > array_1[j][i])\n        colmin = array_1[j][i];\n    for (j = 0; j < n; j++)\n      array_1[j][i] -= colmin;\n  }\n  sum += array_1[1][1];\n  for (i = 1; i < n - 1; i++)\n    array_1[0][i] = array_1[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    array_1[i][0] = array_1[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      array_1[i][j] = array_1[i + 1][j + 1];\n  dispose(n - 1);\n}\n"}
{"label": "18", "index": "32724", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minrow(int a[100][100], int i, int m) {\n  int b = a[i][0], j;\n  for (j = 0; j < m; j++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nint mincolumn(int a[100][100], int j, int m) {\n  int b = a[0][j], i;\n  for (i = 0; i < m; i++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nvoid row(int a[100][100], int m) {\n  int i, j, b;\n  for (i = 0; i < m; i++) {\n    b = minrow(a, i, m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid column(int a[100][100], int m) {\n  int i, j, b;\n  for (j = 0; j < m; j++) {\n    b = mincolumn(a, j, m);\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid del(int a[100][100], int m) {\n  int i, j;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nvoid print(int a[100][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      printf(\"%d \", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {0}, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int b = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    m = n;\n    for (j = 0; j < n - 1; j++) {\n      row(a, m);\n      column(a, m);\n      b = b + a[1][1];\n      del(a, m);\n      m--;\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int nq, times, i, j, min, m;\n\n  cin >> nq;\n  const int n = nq;\n  int sum[n];\n  int a[n][n][n];\n  for (times = 0; times < n; times++)\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[times][i][j]; \n  for (times = 0; times < n; times++) {\n    sum[times] = 0;\n    for (m = n; m > 1; m--)\n\n    {\n      for (i = 0; i < m; i++)\n\n      {\n        min = a[times][i][0];\n        for (j = 1; j < m; j++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (j = 0; j < m; j++)\n          a[times][i][j] -= min;\n\n      } \n      for (j = 0; j < m; j++) {\n        min = a[times][0][j];\n        for (i = 1; i < m; i++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (i = 0; i < m; i++)\n          a[times][i][j] -= min;\n      } \n      sum[times] += a[times][1][1];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n; j++)\n          a[times][i - 1][j] = a[times][i][j]; \n      for (i = 2; i < m; i++)\n        for (j = 0; j < n - 1; j++)\n          a[times][j][i - 1] = a[times][j][i]; \n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nint (*p)[101] = a;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) \n  {\n    min = *(*(p + i));\n    for (int j = 1; j < k; j++) \n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    if (min)\n      for (int j = 0; j < k; j++) \n        *(*(p + i) + j) -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) \n  {\n    min = *(*(p) + i);\n    for (int j = 1; j < k; j++) \n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    if (min)\n      for (int j = 0; j < k; j++) \n        *(*(p + j) + i) -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++) \n    for (int j = 0; j < k; j++)\n      *(*(p + i - 1) + j) = *(*(p + i) + j);\n  for (int j = 2; j < n; j++) \n    for (int i = 0; i < k - 1; i++)\n      *(*(p + i) + j - 1) = *(*(p + i) + j);\n}\nint main() {\n  cin >> n; \n  while (cin >> *(*(p))) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> *(*(p + i) + j);\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += *(*(p + 1) + 1);\n      jian(k);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint Sum(int n);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << Sum(n) << endl;\n  }\n  return 0;\n}\n\nint Sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n"}
{"label": "18", "index": "32728", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = a[i][0];\n        for (int j = 1; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = a[0][i];\n        for (int j = 1; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint arr[100][100];\nvoid solve(int n);\nvoid arrayin(int n);\nint down_cast(int n);\nvoid matrix_out(int n);\nint main(int argc, char **argv) {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    solve(n);\n  return 0;\n}\nvoid arrayin(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> arr[i][j];\n    }\n  }\n}\nvoid solve(int n) {\n  arrayin(n);\n  cout << down_cast(n) << endl;\n}\nint down_cast(int n) {\n  if (n == 1)\n    return 0;\n  int min, res;\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[i][j] < min)\n        min = arr[i][j];\n    for (int j = 0; j < n; j++)\n      arr[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[j][i] < min)\n        min = arr[j][i];\n    for (int j = 0; j < n; j++)\n      arr[j][i] -= min;\n  }\n  res = arr[1][1];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[i - 1][j] = arr[i][j];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[j][i - 1] = arr[j][i];\n\n  return res + down_cast(n - 1);\n}\nvoid matrix_out(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      cout << arr[i][j] << \" \";\n\n    cout << endl;\n  }\n}\n"}
{"label": "18", "index": "32730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n}\nint sum(int n) {\n  int i, j;\n  guiling(n);\n  int m;\n  if (n == 2)\n    return a[1][1];\n  m = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return m + sum(n - 1);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nvoid down1(int a[100][100], int m) {\n  int i, p, j;\n  for (i = m; i < n; i = i + 1) {\n    p = a[i][m];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[i][j])\n        p = a[i][j];\n    for (j = m; j < n; j = j + 1)\n      a[i][j] = a[i][j] - p;\n  }\n}\nvoid down2(int a[100][100], int m) {\n  int i, j, p;\n  for (i = m; i < n; i = i + 1) {\n    p = a[m][i];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[j][i])\n        p = a[j][i];\n    for (j = m; j < n; j = j + 1)\n      a[j][i] = a[j][i] - p;\n  }\n}\nint main() {\n  int i, j, t, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  k = 0;\n  while (k < n) {\n    k = k + 1;\n    t = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 1; i <= n - 1; i = i + 1) {\n      down1(a, i - 1);\n      down2(a, i - 1);\n      t = t + a[i][i];\n      for (j = i - 1; j < n; j = j + 1)\n        a[i][j] = a[i - 1][j];\n      for (j = i; j < n; j = j + 1)\n        a[j][i] = a[j][i - 1];\n    }\n    cout << t;\n    if (k < n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32732", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = a[i][0];\n        for (int j = 1; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = a[0][i];\n        for (int j = 1; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; ++k) {\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    int total = 0;\n    for (int t = 0; t < n - 1; ++t) {\n      for (int i = 0; i < n; ++i) {\n        if (i != 0 && i <= t)\n          continue;\n        int minValue = a[i][0];\n        for (int j = t + 1; j < n; ++j)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[i][0] -= minValue;\n        for (int j = t + 1; j < n; ++j)\n          a[i][j] -= minValue;\n      }\n      for (int j = 0; j < n; ++j) {\n        if (j != 0 && j <= t)\n          continue;\n        int minValue = a[0][j];\n        for (int i = t + 1; i < n; ++i)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[0][j] -= minValue;\n        for (int i = t + 1; i < n; ++i)\n          a[i][j] -= minValue;\n      }\n      total += a[t + 1][t + 1];\n    }\n    cout << total << endl;\n  }\n}\n"}
{"label": "18", "index": "32734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], j, k, l, sum = 0;\n    for (k = 0; k <= n - 1; k++)\n      for (l = 0; l <= n - 1; l++)\n        cin >> a[k][l];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = a[k][0];\n        for (l = 1; l <= n - j; l++)\n          if (a[k][l] < min)\n            min = a[k][l];\n        for (l = 0; l <= n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = a[0][k];\n        for (l = 1; l <= n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l <= n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (k = 2; k <= n - j; k++) {\n        a[0][k - 1] = a[0][k];\n        a[k - 1][0] = a[k][0];\n      }\n      for (k = 2; k <= n - j; k++)\n        for (l = 2; l <= n - j; l++)\n          a[k - 1][l - 1] = a[k][l];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32735", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum = 0, min = 0, l, k;\n  cin >> n;\n  l = n;\n  for (k = 0; k < l; k++) {\n    sum = 0;\n    int a[l][l];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        scanf(\"%d \", &a[i][j]);\n    n = l;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j + 1];\n      n = n - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32736", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int(*p)[100];\n  int jz[100][100];\n  cin >> num;\n  int x = num;\n  int min = 9999;\n  p = jz;\n  for (int i = 1; i <= num; i++) {\n    x = num;\n    int sum = 0;\n    for (int k = 0; k < x; k++)\n      for (int j = 0; j < x; j++)\n        cin >> *(*(p + k) + j);\n\n    while (x >= 0) {\n\n      for (int k = 0; k < x; k++) {\n        for (int j = 0; j < x; j++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int j = 0; j < x; j++)\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n\n        min = 9999;\n      }\n\n      for (int j = 0; j < x; j++) {\n        for (int k = 0; k < x; k++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int k = 0; k < x; k++)\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n\n        min = 9999;\n      }\n\n      if (x > 1)\n        sum = sum + *(*(p + 1) + 1);\n\n      for (int k = 0; k < x; k++)\n        for (int j = 1; j < x - 1; j++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      for (int j = 0; j < x; j++)\n        for (int k = 1; k < x - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n      x--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32737", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid shuru(int);\nvoid guiling(int);\n\nint num[100][100] = {0};\nint sum = 0;\n\nint main() {\n  int n = 0;\n  int i = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    shuru(n);\n  }\n\n  return 0;\n}\n\nvoid shuru(int n) {\n  int i = 0;\n  int j = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &num[i][j]);\n\n  guiling(n);\n}\n\nvoid guiling(int n) {\n  if (n == 1)\n    cout << sum << endl;\n  else {\n    int min = 0;\n\n    int t = 0;\n    int i = 0;\n\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[i][t])\n          min = num[i][t];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[i][t] -= min;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[t][i])\n          min = num[t][i];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[t][i] -= min;\n      }\n    }\n\n    sum += num[1][1];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[i][t - 1] = num[i][t];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[t - 1][i] = num[t][i];\n\n    guiling(n - 1);\n  }\n}\n"}
{"label": "18", "index": "32738", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100], ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int p = 0; p < n - 1; p++) {\n      int min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + i) + j))\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) -= min;\n        }\n        min = **(a + i + 1);\n      }\n      min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + j) + i))\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + j) + i) -= min;\n        }\n        min = *(*a + i + 1);\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - p; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      }\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - 1 - p; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      }\n    }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int n, i, j, k, l;\n  int min;\n  int x = 0;\n  cin >> n;\n  for (l = 0; l <= n - 1; ++l) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    x = 0;\n    for (k = 0; k <= n - 2; ++k) {\n      for (i = 0; i <= n - k - 1; ++i) {\n        min = a[i][0];\n        for (j = 0; j <= n - k - 1; ++j) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j <= n - k - 1; ++j) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j <= n - k - 1; ++j) {\n        min = a[0][j];\n        for (i = 0; i <= n - k - 1; ++i) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - k - 1; ++i)\n          a[i][j] -= min;\n      }\n      x += a[1][1];\n      for (j = 2; j <= n - k - 1; ++j) {\n        a[0][j - 1] = a[0][j];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        for (j = 2; j <= n - k - 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << x << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32740", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[100][100] = {0};\nvoid temp(int n) {\n  if (n == 1)\n    return;\n  for (int i = 0; i < n; i++) {\n    int miner = 1000;\n    for (int j = 0; j < n; j++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - miner;\n  }\n  for (int j = 0; j < n; j++) {\n    int miner = 1000;\n    for (int i = 0; i < n; i++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int i = 0; i < n; i++)\n      a[i][j] = a[i][j] - miner;\n  }\n  sum = sum + a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  temp(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int m = 0; m < n; m++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    temp(n);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int l = 1; l < n; l++) {\n      for (i = l; i <= n; i++) {\n        m = a[i][l];\n        for (j = l + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (j = l; j <= n; j++)\n          a[i][j] = a[i][j] - m;\n      }\n      for (j = l; j <= n; j++) {\n        m = a[l][j];\n        for (i = l + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (i = l; i <= n; i++)\n          a[i][j] = a[i][j] - m;\n      }\n      sum = sum + a[l][l];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid r(int m);\nvoid l(int m);\nvoid fun(int m);\nvoid Try(int i);\nint a[100][100], n, s[100] = {0};\nint main() {\n  int i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    Try(0);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + s[j];\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid r(int m) {\n  int x, y, min;\n  for (x = 0; x < m; x++) {\n    min = a[x][0];\n    for (y = 0; y < m; y++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (y = 0; y < m; y++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid l(int m) {\n  int x, y, min;\n  for (y = 0; y < m; y++) {\n    min = a[0][y];\n    for (x = 0; x < m; x++) {\n      if (a[x][y] < min) {\n        min = a[x][y];\n      }\n    }\n    for (x = 0; x < m; x++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid fun(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j < m - 1; j++) {\n    for (i = 2; i < m; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\nvoid Try(int i) {\n  r(n - i);\n  l(n - i);\n  s[i] = a[1][1];\n  fun(n - i);\n  if (i < n - 1)\n    Try(i + 1);\n}\n"}
{"label": "18", "index": "32743", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, n, sum, min = 0, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - k; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n        a[i][n - 1] = 0;\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n        a[n - 1][j] = 0;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32744", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, k, m, z, x, p = 0, min1[100], min2[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    sum = 0;\n    p = 0;\n    while (p < n) {\n      for (m = 0; m < n - p; m++) {\n        min1[m] = a[m][0];\n        for (k = 0; k < n - p; k++) {\n\n          if (min1[m] > a[m][k]) {\n            min1[m] = a[m][k];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min1[z];\n        }\n      }\n      for (m = 0; m < n - p; m++) {\n        min2[m] = a[0][m];\n        for (k = 0; k < n - p; k++) {\n\n          if (min2[m] > a[k][m]) {\n            min2[m] = a[k][m];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min2[x];\n        }\n      }\n      sum = sum + a[1][1];\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[z][m] = a[z][m + 1];\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[m][z] = a[m + 1][z];\n        }\n      }\n      p++;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32745", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid matrix_down(int a[150][150], int large) {\n  int v, r;\n  for (v = 0; v <= large - 1; v++) {\n    int minl;\n    minl = a[v][0];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[v][r] <= minl) {\n        minl = a[v][r];\n      }\n      if (a[v][r] == 0) {\n        minl = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[v][r] = a[v][r] - minl;\n    }\n  }\n  for (v = 0; v <= large - 1; v++) {\n    int minr;\n    minr = a[0][v];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[r][v] <= minr) {\n        minr = a[r][v];\n      }\n      if (a[r][v] == 0) {\n        minr = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[r][v] = a[r][v] - minr;\n    }\n  }\n}\n\nvoid matrix_short(int a[150][150], int large) {\n  int i, r;\n  for (i = 1; i <= large - 2; i++) {\n    for (r = 1; r <= large - 2; r++) {\n      a[i][r] = a[i + 1][r + 1];\n    }\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n\nint main() {\n  int n, i, u, v, r, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[150][150] = {0};\n    int sum = 0;\n    for (u = 0; u <= n - 1; u++) {\n      for (v = 0; v <= n - 1; v++) {\n        cin >> a[u][v];\n      }\n    }\n    for (u = n; u >= 2; u--) {\n      matrix_down(a, u);\n      sum = a[1][1] + sum;\n      matrix_short(a, u);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32746", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, sum;\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int f(int a[100][100], int n);\n    sum = f(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint f(int a[100][100], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, k, min, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  k = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  }\n  for (j = 2; j < n; j++) {\n    for (i = 0; i < (n - 1); i++)\n      a[i][j - 1] = a[i][j];\n  }\n  n = n - 1;\n  sum = k + f(a, n);\n  return (sum);\n}\n"}
{"label": "18", "index": "32747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  const int MAX = 50000;\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int jz[110][110];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    int ans = 0;\n    for (int x = 0; x < n - 1; x++) {\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        for (int j = 0; j < n - x; j++)\n          jz[i][j] -= min;\n      }\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        for (int j = 0; j < n - x; j++)\n          jz[j][i] -= min;\n      }\n      ans += jz[1][1];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[i][j - 1] = jz[i][j];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[j - 1][i] = jz[j][i];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32748", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[101][101] = {0};\nint xiao(int n) {\n  int i, j, t, minh[101] = {0}, minl[101] = {0}, temp = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    return a[1][1];\n  }\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    temp = a[1][1];\n    for (i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n      a[0][i - 1] = a[0][i];\n      for (j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    return temp + xiao(n - 1);\n  }\n}\nint main() {\n  int n, k, l, m, ans[101] = {0};\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++) {\n        cin >> a[k][l];\n      }\n    }\n    ans[m] = xiao(n);\n  }\n  for (k = 1; k <= n; k++) {\n    cout << ans[k] << endl;\n  }\n  int f;\n  cin >> f;\n  return 0;\n}\n"}
{"label": "18", "index": "32749", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[101][101] = {0};\nint xiao(int n) {\n  int i, j, t, minh[101] = {0}, minl[101] = {0}, temp = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    return a[1][1];\n  }\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    temp = a[1][1];\n    for (i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n      a[0][i - 1] = a[0][i];\n      for (j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    return temp + xiao(n - 1);\n  }\n}\nint main() {\n  int n, k, l, m, ans[101] = {0};\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++) {\n        cin >> a[k][l];\n      }\n    }\n    ans[m] = xiao(n);\n  }\n  for (k = 1; k <= n; k++) {\n    printf(\"%d\\n\", ans[k]);\n  }\n  int f;\n  cin >> f;\n  return 0;\n}\n"}
{"label": "18", "index": "32750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[110][110], b[110];\n  int(*ju)[110] = a;\n  int num1, num, i, j, m, sum = 0, *min = b;\n  cin >> num1;\n  for (m = 0; m < num1; m++) {\n    num = num1;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++)\n        cin >> *(*(ju + i) + j);\n    while (num > 1) {\n      \n      \n      for (i = 0; i < num; i++) {\n        *(min + i) = 10000;\n        for (j = 0; j < num; j++)\n          if (*(*(ju + i) + j) < *(min + i))\n            *(min + i) = *(*(ju + i) + j);\n      }\n      \n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + i);\n      \n      \n      for (j = 0; j < num; j++) {\n        *(min + j) = 10000;\n        for (i = 0; i < num; i++)\n          if (*(*(ju + i) + j) < *(min + j))\n            *(min + j) = *(*(ju + i) + j);\n      }\n      \n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + j);\n      \n      \n      \n      sum = sum + *(*(ju + 1) + 1);\n      \n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num - 1; j++) {\n          if (j >= 1)\n            *(*(ju + i) + j) = *(*(ju + i) + j + 1);\n        }\n      }\n      \n      \n      for (j = 0; j < num - 1; j++) {\n        for (i = 0; i < num - 1; i++) {\n          if (i >= 1)\n            *(*(ju + i) + j) = *(*(ju + i + 1) + j);\n        }\n      }\n      \n      \n      num--;\n      \n    }\n    cout << sum << endl;\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32751", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[110][110] = {0};\n    int min = 10000, s = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (int m = 1; m < n; m++) {\n      for (int j = 0; j < n; j++) {\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      for (int k = 0; k < n; k++) {\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      s = s + a[m][m];\n      for (int j = 0; j < n; j++)\n        a[j][m] = 100000;\n      for (int j = 0; j < n; j++)\n        a[m][j] = 100000;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32752", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, l, s = 0;\nint jz[100][100];\nint f() {\n  int i, j, k, min = 10000;\n  if (n == 1) {\n    cout << s << endl;\n    s = 0;\n    n = l;\n    return 0;\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[i][k] = jz[i][k] - min;\n          min = 10000;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[k][i] = jz[k][i] - min;\n          min = 10000;\n        }\n      }\n    }\n    s = s + jz[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[i][j] = jz[i][j + 1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[j][i] = jz[j + 1][i];\n    n = n - 1;\n    f();\n  }\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  l = n;\n  for (i = 1; i <= l; i++) {\n    for (j = 0; j < l; j++)\n      for (k = 0; k < l; k++)\n        cin >> jz[j][k];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32753", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint w[150][150];\nint m[150];\nint main() {\n  scanf(\"%d \", &n);\n  for (int _n = 0; _n < n; _n++) {\n    memset(w, 0, sizeof(w));\n    int s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    for (int t = 1; t < n; t++) {\n\n      for (int i = 0; i < n; i++) {\n        if ((i < t) && i)\n          continue;\n        m[i] = w[i][0];\n        for (int j = t; j < n; j++) {\n          if (w[i][j] < m[i])\n            m[i] = w[i][j];\n        }\n        w[i][0] -= m[i];\n        for (int j = t; j < n; j++)\n          w[i][j] -= m[i];\n      }\n      for (int j = 0; j < n; j++) {\n        if ((j < t) && j)\n          continue;\n        m[j] = w[0][j];\n        for (int i = t; i < n; i++)\n          if (w[i][j] < m[j])\n            m[j] = w[i][j];\n        w[0][j] -= m[j];\n        for (int i = t; i < n; i++)\n          w[i][j] -= m[j];\n      }\n      s += w[t][t];\n    }\n\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint jieguo(int n) {\n  int min = 10000;\n  int p = 0, i = 0, j = 0, sum = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    return a[1][1];\n  } else {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum = a[1][1];\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        a[j][i] = a[j][i + 1];\n      }\n    }\n    return (sum + jieguo(n - 1));\n  }\n}\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = 0;\n    }\n  }\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    cout << jieguo(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, m, s = 0, i, j, x, y, t = 0;\n  int(*p)[100];\n  p = a;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    s = 0;\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> (*(*(p + i) + j)); \n      }\n\n    for (y = n; y > 1; y--) {\n\n      for (i = 0; i < n - t; i++) {\n        x = *(*(p + i)); \n        for (j = 0; j < n - t; j++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) -= x;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        x = *(*(p) + j);\n        for (i = 0; i < n - t; i++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (i = 0; i < n - t; i++)\n          *(*(p + i) + j) -= x;\n      }\n\n      s = s + *(*(p + 1) + 1);\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n      for (i = 1; i < n - t - 1; i++)\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      t++;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint sum(int n) {\n  int i, j, x, t;\n  int p, q;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + i) + j))\n        x = *(*(a + i) + j);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + i) + j)) -= x;\n  }\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + j) + i))\n        x = *(*(a + j) + i);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + j) + i)) -= x;\n  }\n  t = *(*(a + 1) + 1);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n  return (t + sum(n - 1));\n}\nint main() {\n  int n, i, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        scanf(\"%d\", &a[p][q]);\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int);\nint a[100][100];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << sum(n) << \"\\n\";\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "32758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, sum, m;\n  scanf(\"%d \", &n);\n  int a[101][101] = {0};\n  m = n;\n  while (m) {\n    m--;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    sum = 0;\n    for (k = n; k > 1; k--) {\n\n      for (i = 1; i <= k; i++) {\n        min = 98000;\n        for (j = 1; j <= k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 1; j <= k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 1; i <= k; i++) {\n        min = 98098;\n        for (j = 1; j <= k; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 1; j <= k; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[2][2];\n      if (k >= 3) {\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[i - 1][j] = a[i][j];\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[j][i - 1] = a[j][i];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32759", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, a[100][100], b, min, k, sum = 0;\n  cin >> n;\n  b = n;\n  while (b > 0) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 1; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (j = 1; j < k; j++)\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n\n    b--;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\n\nint q[100][100];\n\nvoid op(int n) {\n  if (n != 1) {\n    int rm[n], cm[n];\n    for (int i = 0; i < n; i++) {\n      rm[i] = q[i][0];\n      cm[i] = q[0][i];\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (rm[i] >= q[i][j]) {\n          rm[i] = q[i][j];\n        }\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - rm[i];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (cm[j] >= q[i][j]) {\n          cm[j] = q[i][j];\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - cm[j];\n      }\n    }\n\n    sum += q[1][1];\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n; j++) {\n        q[i][j] = q[i][j + 1];\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i + 1][j];\n      }\n    }\n    op(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int s = 1; s <= n; s++) {\n    for (int a = 0; a < n; a++) {\n      for (int b = 0; b < n; b++) {\n        cin >> q[a][b];\n      }\n    }\n    op(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32761", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = a[i][0];\n        for (int j = 1; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = a[0][i];\n        for (int j = 1; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32762", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[111][111];\nint n;\n\nint xiao(int size);\n\nint sum() {\n  int temp = 0;\n  for (int siz = n; siz >= 2; siz--) {\n    temp += xiao(siz);\n  }\n  return temp;\n}\n\nint xiao(int size) {\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[i][j] < tempmin)\n        tempmin = a[i][j];\n    for (int j = 1; j <= size; j++)\n      a[i][j] -= tempmin;\n  }\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[j][i] < tempmin) {\n        tempmin = a[j][i];\n      }\n    for (int j = 1; j <= size; j++)\n      a[j][i] -= tempmin;\n  }\n\n  int daan = a[2][2];\n\n  for (int i = 1; i <= n; i++)\n    for (int j = 2; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 1; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[j][i] = a[j + 1][i];\n  return daan;\n}\n\nint main() {\n  cin >> n;\n  for (int t = 1; t <= n; t++) {\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    cout << sum() << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nint (*p)[100] = array_1;\nint sum;\nint n;\nint times;\n\nvoid zero() {\n  int xmin = 10000, ymin = 10000;\n  for (int i = 0; i <= n - 1 - times; i++) {\n    for (int j = 0; j <= n - 1 - times; j++)\n      if (*(*(p + i) + j) < xmin) {\n        xmin = *(*(p + i) + j);\n      }\n    for (int j = 0; j <= n - 1 - times; j++)\n      *(*(p + i) + j) -= xmin;\n    xmin = 10000;\n  }\n  for (int j = 0; j <= n - 1 - times; j++) {\n    for (int i = 0; i <= n - 1 - times; i++)\n      if (*(*(p + i) + j) < ymin) {\n        ymin = *(*(p + i) + j);\n      }\n    for (int i = 0; i <= n - 1 - times; i++)\n      *(*(p + i) + j) -= ymin;\n    ymin = 10000;\n  }\n\n  sum += (*(*(p + 1) + 1));\n}\nvoid decline() {\n  for (int i = 1; i <= n - 2; i++)\n    for (int j = 0; j <= n - 1; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n  for (int j = 1; j <= n - 2; j++)\n    for (int i = 0; i <= n - 2; i++)\n      *(*(p + i) + j) = *(*(p + i) + j + 1);\n}\n\nint main() {\n  cin >> n;\n  int time = 0;\n  while (true) {\n\n    if (time == n)\n      break;\n    times = 0;\n    sum = 0;\n\n    for (int i = 0; i <= n - 1; i++)\n      for (int j = 0; j <= n - 1; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 1; i <= n - 1; i++) {\n      zero();\n      decline();\n      times++;\n    }\n\n    printf(\"%d\\n\", sum);\n\n    time++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32764", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, size, t, i, j, round, a[101][101], s[101], minx[101], miny[101];\n  memset(s, 0, sizeof(s));\n  scanf(\"%d \", &n);\n  size = n;\n\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    size = n;\n    for (round = 1; round <= n - 1; round++) {\n      for (i = 1; i <= size; i++) {\n        minx[i] = a[i][1];\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - minx[i];\n        }\n      }\n      for (j = 1; j <= size; j++) {\n        miny[j] = a[1][j];\n      }\n      for (j = 1; j <= size; j++) {\n        for (i = 1; i <= size; i++) {\n          if (a[i][j] < miny[j]) {\n            miny[j] = a[i][j];\n          }\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - miny[j];\n        }\n      }\n\n      s[t] = s[t] + a[2][2];\n      for (j = 2; j <= size - 1; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        for (j = 2; j <= size - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      size--;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << s[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k;\nvoid f(int);\nint a[100][100];\nint s;\nint main() {\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    f(n);\n  }\n  return 0;\n}\n\nvoid f(int m) {\n  for (i = 0; i < m; i++) {\n    int min = 1000;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    int min = 1000;\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  s = s + a[1][1];\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 1; i < m - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  if (m == 2) {\n    cout << s << endl;\n  } else\n    f(m - 1);\n}\n"}
{"label": "18", "index": "32766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minline(int n, int u, int **a) {\n  int temp = a[0][u];\n  for (int i = 1; i < n; i++) {\n    if (temp > a[i][u]) {\n      temp = a[i][u];\n    }\n  }\n  return temp;\n}\nint mincross(int n, int a[]) {\n  int temp = a[0];\n  for (int i = 0; i < n; i++) {\n    if (temp > a[i])\n      temp = a[i];\n  }\n  return temp;\n}\n\nint ans(int n, int **pp) {\n\n  int sum = 0;\n\n  for (int y = 0; y < n - 1; y++) {\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = mincross(n - y, pp[i]);\n      for (int j = 0; j < n - y; j++) {\n        pp[i][j] = pp[i][j] - minTemp;\n      }\n    }\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = minline(n - y, i, pp);\n      for (int j = 0; j < n - y; j++) {\n        pp[j][i] = pp[j][i] - minTemp;\n      }\n    }\n    sum = sum + pp[1][1];\n\n    for (int i = 0; i < n - y; i++) {\n      for (int j = 1; j < n - 1 - y; j++) {\n        pp[i][j] = pp[i][j + 1];\n      }\n    }\n\n    for (int i = 0; i < n - 1 - y; i++) {\n      for (int j = 1; j < n - y - 1; j++) {\n        pp[j][i] = pp[j + 1][i];\n      }\n    }\n  }\n  return sum;\n}\n\nint main(void) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int **pp;\n  pp = (int **)malloc(n * sizeof(int *));\n  for (int i = 0; i < n; i++) {\n    pp[i] = (int *)malloc(n * sizeof(int));\n  }\n\n  for (int w = 0; w < n; w++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &pp[i][j]);\n      }\n    }\n    printf(\"%d\\n\", ans(n, pp));\n  }\n\n  for (int i = 0; i < n; i++) {\n    free(pp[i]);\n  }\n  free(pp);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int k = 1, n = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int i = 0, j = 0, m;\n    int result = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 0; i < m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      result = result + a[1][1];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++) {\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n\n    printf(\"%d\\n\", result);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32768", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i = 0, j, k, l, min, sum = 0;\n  scanf(\"%d \", &n);\n  while (i < n) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= min;\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        min = a[0][k];\n        for (j = 0; j < n - l; j++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n - l; j++) {\n          a[j][k] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        for (j = 1; j < n - l; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n    }\n\n    cout << sum << endl;\n    sum = 0;\n    i++;\n  }\n}\n"}
{"label": "18", "index": "32769", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint arr[100][100];\nvoid solve(int n);\nvoid arrayin(int n);\nint down_cast(int n);\nvoid matrix_out(int n);\nint main(int argc, char **argv) {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    solve(n);\n  return 0;\n}\nvoid arrayin(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> arr[i][j];\n    }\n  }\n}\nvoid solve(int n) {\n  arrayin(n);\n  cout << down_cast(n) << endl;\n}\nint down_cast(int n) {\n  if (n == 1)\n    return 0;\n  int min, res;\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[i][j] < min)\n        min = arr[i][j];\n    for (int j = 0; j < n; j++)\n      arr[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[j][i] < min)\n        min = arr[j][i];\n    for (int j = 0; j < n; j++)\n      arr[j][i] -= min;\n  }\n  res = arr[1][1];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[i - 1][j] = arr[i][j];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[j][i - 1] = arr[j][i];\n\n  return res + down_cast(n - 1);\n}\nvoid matrix_out(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cout << arr[i][j] << \" \";\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "18", "index": "32770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint GuiLing(int a[][101], int n, int sum) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n > 2) {\n    sum = sum + a[1][1];\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n - 1; i++)\n        a[i][j - 1] = a[i][j];\n    return GuiLing(a, n - 1, sum);\n  } else\n    return sum + a[1][1];\n}\n\nint main() {\n  int n, i;\n  int a[101][101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << GuiLing(a, n, 0) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32771", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[100][100], j, k, min, number = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    m = n;\n    number = 0;\n    while (m != 1) {\n      for (j = 0; j < m; j++) {\n        min = *(*(a + j) + 0);\n        for (k = 1; k < m; k++)\n          min = (min > *(*(a + j) + k)) ? *(*(a + j) + k) : min;\n\n        for (k = 0; k < m; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = *(*(a) + j);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + k) + j)) ? *(*(a + k) + j) : min;\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      number = number + *(*(a + 1) + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + 0) + j) = *(*(a + 0) + j + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + j) + 0) = *(*(a + j + 1) + 0);\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + k - 1) + j - 1) = *(*(a + k) + j);\n      m = m - 1;\n    }\n    printf(\"%d\\n\", number);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32772", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid jian(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  if (n > 2) {\n    for (i = 1; i < (n - 1); i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < (n - 1); j++)\n        a[j][i] = a[j][i + 1];\n    for (i = 0; i < n; i++) {\n      a[n - 1][i] = '\\0';\n      a[i][n - 1] = '\\0';\n    }\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {'\\0'}, sum, n1;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n1 > 1) {\n      jian(a, n1);\n      sum += a[1][1];\n      move(a, n1);\n      n1--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint find_min(int x, int side);\nint find_miny(int side);\nint a[120][120], sum;\nvoid caozuo(int side);\nint main() {\n  int i, j, n, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    caozuo(n);\n  }\n\n  return 0;\n}\nint find_min(int x, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[x][i])\n      temp = a[x][i];\n  }\n  return temp;\n}\nint find_miny(int y, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[i][y])\n      temp = a[i][y];\n  }\n  return temp;\n}\nvoid caozuo(int side) {\n  int i, j, t;\n  if (side == 1) {\n    cout << sum << endl;\n  } else {\n    for (i = 0; i <= side - 1; i++) {\n      t = find_min(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[i][j] -= t;\n      }\n    }\n    for (i = 0; i <= side - 1; i++) {\n      t = find_miny(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[j][i] -= t;\n      }\n    }\n\n    sum = sum + a[1][1];\n    if (side > 2) {\n      for (i = 2; i <= side - 1; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i <= side - 1; i++) {\n        for (j = 2; j <= side - 1; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    caozuo(side - 1);\n  }\n}\n"}
{"label": "18", "index": "32774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int m = n;\n  int t = n;\n  while (m > 0) {\n    int a[100][100];\n    n = t;\n    m = m - 1;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    while (n > 1) {\n      for (int i = 0; i < n; i++) {\n        int hmin = a[i][0];\n        for (int j = 0; j < n; j++) {\n          if (a[i][j] < hmin)\n            hmin = a[i][j];\n        }\n\n        for (int j = 0; j < n; j++)\n          a[i][j] -= hmin;\n      }\n      for (int i = 0; i < n; i++) {\n        int lmin = a[0][i];\n        for (int j = 0; j < n; j++) {\n          if (a[j][i] < lmin)\n            lmin = a[j][i];\n        }\n        for (int j = 0; j < n; j++)\n          a[j][i] -= lmin;\n      }\n      sum += a[1][1];\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (int i = 0; i < n - 1; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[j][i] = a[j + 1][i];\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32775", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, k, l;\nint a[100][100];\nint xiao(int n) {\n  int min, s;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++) {\n      min = (a[j][k] < min) ? a[j][k] : min;\n    }\n    for (k = 0; k < n; k++)\n      a[j][k] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++)\n      min = (a[k][j] < min) ? a[k][j] : min;\n    for (k = 0; k < n; k++)\n      a[k][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  s = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n -= 1;\n  return (s + xiao(n));\n}\nint main() {\n\n  int n, result[100];\n  scanf(\"%d \", &n);\n  for (l = 0; l < n; l++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    result[l] = xiao(n);\n  }\n  for (l = 0; l < n; l++)\n    cout << result[l] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum;\n  int i, j, k;\n  int a[101][101] = {0};\n  int lenth, min;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    lenth = n;\n\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n\n    for (lenth = n; lenth > 1; lenth--) {\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[j][k] != 0)\n            a[j][k] = a[j][k] - min;\n      }\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[k][j] != 0)\n            a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[2][2];\n\n      for (j = 1; j <= lenth; j++)\n        for (k = 2; k <= lenth; k++)\n          a[j][k] = a[j][k + 1];\n      for (j = 2; j <= lenth; j++)\n        for (k = 1; k <= lenth; k++)\n          a[j][k] = a[j + 1][k];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32777", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int af = 1; af <= n; af++) {\n    int sum = 0;\n    int a[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n    for (int tempn = n; tempn >= 2; tempn--) {\n\n      for (int i = 0; i <= tempn - 1; i++) {\n        int mini = a[i][0];\n        for (int j = 1; j <= tempn - 1; j++) {\n          if (mini > a[i][j])\n            mini = a[i][j];\n        }\n        for (int j = 0; j <= tempn - 1; j++)\n          a[i][j] -= mini;\n      }\n      for (int j = 0; j <= tempn - 1; j++) {\n        int minj = a[0][j];\n        for (int i = 1; i <= tempn - 1; i++) {\n          if (minj > a[i][j])\n            minj = a[i][j];\n        }\n        for (int i = 0; i <= tempn - 1; i++)\n          a[i][j] -= minj;\n      }\n      sum += a[1][1];\n      for (int i = 2; i <= tempn - 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int j = 2; j <= tempn - 1; j++)\n        a[0][j - 1] = a[0][j];\n      for (int i = 2; i <= tempn - 1; i++) {\n        for (int j = 2; j <= tempn - 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, a[100][100], b[100], c[100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    c[k] = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        b[i] = a[i][0];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[i][j])\n            b[i] = a[i][j];\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (i = 0; i < m; i++) {\n        b[i] = a[0][i];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[j][i])\n            b[i] = a[j][i];\n        for (j = 0; j < m; j++)\n          a[j][i] = a[j][i] - b[i];\n      }\n      c[k] += a[1][1];\n      for (i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << c[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "32779", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int a[n][n], i, j, sum = 0;\n    int min[n], liemin[n];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n; i++)\n      min[i] = a[i][0];\n    for (i = 0; i < n; i++)\n      liemin[i] = a[0][i];\n\n    int scale = n;\n    while (scale > 1) {\n      for (i = 0; i < scale; i++) \n        for (j = 0; j < scale; j++) {\n          if (a[i][j] < min[i])\n            min[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++) \n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min[i];\n\n      for (j = 0; j < scale; j++) \n        for (i = 0; i < scale; i++) {\n          if (a[i][j] < liemin[j])\n            liemin[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++) \n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - liemin[j];\n\n      \n\n      sum = sum + a[1][1];\n      \n\n      for (i = 0; i < scale; i++) \n        for (j = 1; j < scale; j++)\n          a[i][j] = a[i][j + 1];\n\n      for (j = 0; j < scale; j++) \n        for (i = 1; i < scale; i++)\n          a[i][j] = a[i + 1][j];\n\n      scale = scale - 1;          \n      for (i = 0; i < scale; i++) \n        min[i] = a[i][0];\n      for (i = 0; i < scale; i++) \n        liemin[i] = a[0][i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  for (int n = 0; n < N; n++) {\n    int Ma[N][N];\n    for (int i = 0; i < N; i++) {\n      for (int j = 0; j < N; j++)\n        scanf(\"%d\", &Ma[i][j]);\n    }\n    int SUM = 0;\n    for (int Now = 1; Now < N; Now++) {\n      int MINR = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINR > Ma[0][j])\n          MINR = Ma[0][j];\n      Ma[0][0] -= MINR;\n      for (int j = Now; j < N; j++)\n        Ma[0][j] -= MINR;\n      for (int i = Now; i < N; i++) {\n        int MIR = Ma[i][0];\n        for (int j = Now; j < N; j++)\n          if (MIR > Ma[i][j])\n            MIR = Ma[i][j];\n        Ma[i][0] -= MIR;\n        for (int j = Now; j < N; j++)\n          Ma[i][j] -= MIR;\n      }\n      int MINC = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINC > Ma[j][0])\n          MINC = Ma[j][0];\n      Ma[0][0] -= MINC;\n      for (int j = Now; j < N; j++)\n        Ma[j][0] -= MINC;\n      for (int i = Now; i < N; i++) {\n        int Mic = Ma[0][i];\n        for (int j = Now; j < N; j++)\n          if (Mic > Ma[j][i])\n            Mic = Ma[j][i];\n        Ma[0][i] -= Mic;\n        for (int j = Now; j < N; j++)\n          Ma[j][i] -= Mic;\n      }\n      SUM += Ma[Now][Now];\n    }\n    printf(\"%d\\n\", SUM);\n  }\n}\n"}
{"label": "18", "index": "32781", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int n, i, j, k, sum[100] = {0}, l, min;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = n;\n    while (l > 1) {\n      for (j = 0; j < l; j++) {\n        min = 100000;\n        for (k = 0; k < l; k++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[i][j][k] -= min;\n      }\n      for (k = 0; k < l; k++) {\n        min = 100000;\n        for (j = 0; j < l; j++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (j = 0; j < l; j++)\n          a[i][j][k] -= min;\n      }\n      sum[i] += a[i][1][1];\n      for (j = 2; j < l; j++) {\n        for (k = 0; k < l; k++) {\n          a[i][j - 1][k] = a[i][j][k];\n        }\n      }\n      for (k = 2; k < l; k++)\n        for (j = 0; j < l; j++)\n          a[i][j][k - 1] = a[i][j][k];\n      l--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen[101][101][101] = {0};\nint guiling(int m, int n) {\n  int i, j, k = n, result = 0, num[101][101] = {0}, min[101] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      num[i][j] = juzhen[m][i][j];\n    }\n  }\n  while (k > 1) {\n    for (i = 0; i < k; i++) {\n      min[i] = 10000;\n      for (j = 0; j < k; j++) {\n        if (num[i][j] <= min[i])\n          min[i] = num[i][j];\n      }\n    }\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i][j] - min[i];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      min[j] = 10000;\n      for (i = 0; i < k; i++) {\n        if (num[i][j] <= min[j])\n          min[j] = num[i][j];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j] - min[j];\n      }\n    }\n    result = result + num[1][1];\n    for (i = 1; i < k - 1; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i + 1][j];\n      }\n    }\n    for (j = 1; j < k - 1; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j + 1];\n      }\n    }\n    k--;\n  }\n  return result;\n}\nint main() {\n  int i, j, k, p;\n  cin >> p;\n  for (k = 0; k < p; k++) {\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < p; j++)\n        cin >> juzhen[k][i][j];\n    }\n  }\n  for (i = 0; i < p; i++) {\n    int answer = 0;\n    answer = guiling(i, p);\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32783", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint min(int *p, int n) {\n  int k, i;\n  k = *p;\n  p++;\n  for (i = 1; i < n; i++, p++) {\n    if (*p < k)\n      k = *p;\n  }\n  return (k);\n}\nint main() {\n  int i, j, n, m, p, q, w, xiao, s;\n  int a[101][101], b[101];\n  scanf(\"%d\", &n);\n  for (w = 0; w < n; w++) \n  {\n\n    for (i = 0; i < n; i++) \n    {\n      b[i] = 0;\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    s = 0;\n    for (m = n; m > 1; m--) \n    {\n      for (i = 0; i < m; i++)\n        b[i] = 0;\n      for (i = 0; i < m; i++) \n      {\n        xiao = min(a[i], m);\n        if (xiao == 0) {\n          for (j = 0; j < m; j++) {\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n          continue;\n\n        } else {\n          for (j = 0; j < m; j++) {\n            a[i][j] -= xiao;\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n        }\n      }\n      for (i = 0; i < m; i++) \n      {\n        if (b[i] != 0)\n          continue;\n        else {\n          xiao = a[0][i];\n          for (j = 1; j < m; j++)\n            if (a[j][i] < xiao)\n              xiao = a[j][i];\n          for (j = 0; j < m; j++)\n            a[j][i] -= xiao;\n        }\n      }\n      s += a[1][1];\n      for (i = 0; i < m; i++) \n      {\n        if (i == 1)\n          continue;\n        else {\n          for (j = 1; j < m - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m - 1; i++) \n        for (j = 1; j < m - 1; j++)\n          a[j][i] = a[j + 1][i];\n    }\n    printf(\"%d \", s);\n  }\n}\n"}
{"label": "18", "index": "32784", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[100][100];\nint n;\n\nvoid modify() {\n  for (int i = 0; i < n; i++) {\n    int min = num[i][0];\n    for (int j = 1; j < n; j++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      num[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min = num[0][j];\n    for (int i = 1; i < n; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      num[i][j] -= min;\n    }\n  }\n}\n\nvoid remove() {\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 0; j < n; j++) {\n      num[i][j] = num[i + 1][j];\n    }\n  }\n  for (int j = 1; j < n - 1; j++) {\n    for (int i = 0; i < n; i++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n}\n\nint main() {\n  int N;\n  cin >> N;\n  int round = N;\n  while (round--) {\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    int sum = 0;\n    while (n > 1) {\n      modify();\n      sum += num[1][1];\n      remove();\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32785", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], ni, minl[100], minh[100], i, j, k, q, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ni = n; ni > 1; ni--) {\n      for (i = 0; i < ni; i++) \n      {\n        minl[i] = a[i][0];\n        for (j = 0; j < ni; j++) {\n          if (minl[i] > a[i][j])\n            minl[i] = a[i][j];\n        }\n        for (j = 0; j < ni; j++) {\n          a[i][j] = a[i][j] - minl[i];\n        }\n      }\n      for (j = 0; j < ni; j++) {\n        minh[j] = a[0][j];\n        for (i = 0; i < ni; i++) {\n          if (minh[j] > a[i][j])\n            minh[j] = a[i][j];\n        }\n        for (i = 0; i < ni; i++) {\n          a[i][j] = a[i][j] - minh[j];\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < ni; i++) {\n        for (j = 1; j < ni - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 0; j < ni; j++) {\n        for (i = 1; i < ni - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int num[100][100], int n) {\n  int m = 0, i = 0, k = 0, sum = 0, j = 0;\n  int l[100], s[100];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      l[j] = 0;\n      s[j] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      if (num[j][0] >= 0) {\n        l[j] = num[j][0];\n        for (k = 0; k < n; k++) {\n          if (num[j][k] >= 0 && num[j][k] < l[j])\n            l[j] = num[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          num[j][k] = num[j][k] - l[j];\n        }\n      }\n    }\n    printf(\"\\n\");\n    for (j = 0; j < n; j++) {\n      if (num[0][j] >= 0) {\n        s[j] = num[0][j];\n        for (k = 0; k < n; k++) {\n          if (num[k][j] >= 0 && num[k][j] < s[j])\n            s[j] = num[k][j];\n        }\n        for (k = 0; k < n; k++) {\n          num[k][j] = num[k][j] - s[j];\n        }\n      }\n    }\n    sum = sum + num[i][i];\n    for (j = 0; j < n; j++) {\n      num[i][j] = -10;\n      num[j][i] = -10;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, sum = 0;\n  int num[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < 100; j++)\n      for (k = 0; k < 100; k++)\n        num[j][k] = -10;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> num[j][k];\n    sum = cut(num, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32787", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n) {\n  int i = 0, j = 0, min = 0, count = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  count = count + a[1][1];\n  if (n == 2)\n    return count;\n  else {\n    for (i = 2; i < n; i++)\n      a[i - 1][0] = a[i][0];\n    for (j = 2; j < n; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    count = count + sum(n - 1);\n    return count;\n  }\n}\nint main() {\n  int n, i = 0, j = 0, k = 0, b[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    b[i] = sum(n);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[100][100], b[10000], min = 0;\n  cin >> n;\n  k = n;\n  while (k > 0) {\n    memset(a, 0, sizeof(a));\n    int i, j, k1, sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    k1 = n;\n    while (k1 > 1) {\n      for (i = 0; i < k1; i++) {\n        min = a[i][0];\n        for (j = 0; j < k1; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < k1; i++) {\n        min = a[0][i];\n        for (j = 0; j < k1; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < k1; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      int count = 0;\n      memset(b, 0, sizeof(b));\n      for (i = 0; i < k1; i++) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < k1; j++) {\n          if (j == 1)\n            continue;\n          b[count++] = a[i][j];\n        }\n      }\n      k1--;\n      memset(a, 0, sizeof(a));\n      int x = 0;\n      for (i = 0; i < k1; i++)\n        for (j = 0; j < k1; j++)\n          a[i][j] = b[x++];\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, a[100][100], s;\nvoid guiling() {\n  int i, j, min;\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < m; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  if (m >= 2)\n    s = s + a[1][1];\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < m - 1; j++)\n    for (i = 1; i < m - 1; i++)\n      a[i][j] = a[i + 1][j];\n  m--;\n  guiling();\n  if (m > 2)\n    xiaojian();\n  else\n    printf(\"%d\\n\", s);\n}\nint main() {\n  int n, t, i, j;\n  scanf(\"%d \", &n);\n  t = n;\n  while (n > 0) {\n    m = t;\n    s = 0;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        cin >> a[i][j];\n    guiling();\n    xiaojian();\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint main() {\n  int m, n, i, j, t, k = 0, p, ans;\n  scanf(\"%d\", &m);\n  while (k < m) {\n    n = m;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    p = 1;\n    while (n > p) {\n      for (i = 0; i < n; i++) {\n        if (i && i < p)\n          continue;\n        t = *(*(a + i) + 0);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + i) + j) ? *(*(a + i) + j) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= t;\n      }\n      for (i = 0; i < n; i++) {\n        if (j && j < p)\n          continue;\n        t = *(*(a + 0) + i);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + j) + i) ? *(*(a + j) + i) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) -= t;\n      }\n      ans += *(*(a + p) + p);\n      p++;\n    }\n    printf(\"%d\\n\", ans);\n    k++;\n  }\n}\n"}
{"label": "18", "index": "32791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], m, i, j, k, x, p, q, s = 0;\n  scanf(\"%d\", &n);\n  m = n;\n  for (k = 0; k < m; k++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = 1; p < m; p++) {\n      for (i = 0; i < n; i++) {\n        x = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (j = 0; j < n; j++)\n            a[i][j] = a[i][j] - x;\n      }\n      for (j = 0; j < n; j++) {\n        x = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (i = 0; i < n; i++)\n            a[i][j] = a[i][j] - x;\n      }\n      s = s + a[1][1];\n      for (i = 2; i < n; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      n--;\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    n = m;\n  }\n}\n"}
{"label": "18", "index": "32792", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, t;\nint n;\nint sum;\nint a[100][100];\nint f(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[ii][0];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ii][ij] < minn)\n        minn = a[ii][ij];\n    for (int ij = 0; ij < x; ij++)\n      a[ii][ij] = a[ii][ij] - minn;\n  }\n}\nint g(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[0][ii];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ij][ii] < minn)\n        minn = a[ij][ii];\n    for (int ij = 0; ij < x; ij++)\n      a[ij][ii] = a[ij][ii] - minn;\n  }\n}\nint h(int x) {\n  sum = sum + a[1][1];\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[ii][jj] = a[ii][jj + 1];\n  }\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[jj][ii] = a[jj + 1][ii];\n  }\n}\nint main() {\n\n  cin >> n;\n  for (int qqq = 0; qqq < n; qqq++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (i = n; i > 1; i--) {\n      f(i);\n      g(i);\n      h(i);\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\n\nvoid gl(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 1; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < m; i++) {\n    int min = a[0][i];\n    for (j = 1; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n}\n\nvoid xj(int m) {\n  int i, j;\n  for (i = 2; i < m; i++)\n    a[0][i - 1] = a[0][i];\n  for (i = 2; i < m; i++)\n    a[i - 1][0] = a[i][0];\n  for (i = 2; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    int sum = 0;\n    for (i = n; i > 1; i--) {\n      gl(i);\n      sum += a[1][1];\n      xj(i);\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  if (n == 1)\n    return 0;\n  int k = 0;\n  guiling(n);\n  k += a[1][1];\n  xiaojian(n);\n  n--;\n  return k + Sum(n);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32795", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint make(int a[100][100], int l, int num, int n);\nint main() {\n  int n, i, j, k, l, num, ans = 0;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    ans = 0;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      num = l;\n      ans = ans + make(a, l, num, n);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\nint make(int a[100][100], int l, int num, int n) {\n  int min1, min2, i, j, k, p, q, m;\n  for (k = 0; k <= n - 1; k++) {\n    min1 = a[k][0];\n    for (i = l; i <= n - 1; i++) {\n      if (a[k][i] < min1)\n        min1 = a[k][i];\n    }\n    for (j = 0; j <= n - 1; j++)\n      a[k][j] = a[k][j] - min1;\n  }\n  for (p = 0; p <= n - 1; p++) {\n    min2 = a[0][p];\n    for (q = l; q <= n - 1; q++) {\n      if (a[q][p] < min2)\n        min2 = a[q][p];\n    }\n    a[0][p] = a[0][p] - min2;\n    for (m = l; m <= n - 1; m++) {\n      a[m][p] = a[m][p] - min2;\n    }\n  }\n  num--;\n  if (num == 0)\n    return a[l][l];\n  else\n    return make(a, l, num, n);\n}\n"}
{"label": "18", "index": "32796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minih(int numh, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numh; i++) {\n    if (min > *(p + i - 1)) {\n      min = *(p + i - 1);\n    } else {\n    }\n  }\n  return min;\n}\nint minil(int numl, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numl; i++) {\n    if (min > *(p + 101 * (i - 1)))\n      min = *(p + 101 * (i - 1));\n    else {\n    }\n  }\n  return min;\n}\nint main() {\n  int a[101][101];\n  int *p;\n  p = &a[0][0];\n  int i, j, k, n;\n  int minor;\n  int sum;\n  scanf(\"%d\", &n);\n  int hang, lie;\n  for (i = 1; i <= n; i++) {\n\n    hang = n;\n    lie = n;\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", p + 101 * (j - 1) + k - 1);\n      }\n    }\n\n    for (minor = 1; lie > 1; minor++) {\n\n      for (j = 1; j <= hang; j++) {\n        int minihang;\n\n        minihang = minih(lie, (p + 101 * (j - 1)));\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) -= minihang;\n        }\n      }\n\n      for (j = 1; j <= lie; j++) {\n        int minilie;\n\n        minilie = minil(hang, (p + (j - 1)));\n        for (k = 1; k <= hang; k++) {\n          *(p + (j - 1) + 101 * (k - 1)) -= minilie;\n        }\n      }\n      sum += *(p + 102);\n\n      for (j = 2; j <= hang; j++) {\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) = *(p + 101 * j + k - 1);\n        }\n      }\n      hang--;\n\n      for (j = 2; j <= lie; j++) {\n        for (k = 1; k <= hang; k++) {\n          *(p + 101 * (k - 1) + j - 1) = *(p + 101 * (k - 1) + j);\n        }\n      }\n      lie--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid xiao(int a[100][100], int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] = a[i][j] - min;\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (j = 0; j < n; j++)\n    for (i = 2; i < n; i++)\n      a[i - 1][j] = a[i][j];\n}\n\nint count(int a[100][100], int n, int s) {\n  if (n == 1)\n    return (s);\n  else {\n    xiao(a, n);\n    s = s + a[1][1];\n    move(a, n);\n    return (count(a, n - 1, s));\n  }\n}\nint main() {\n  int n, i, j, s, t, a[100][100];\n  scanf(\"%d\", &n);\n  t = n;\n  while (t > 0) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    printf(\"%d\\n\", count(a, n, s));\n    t--;\n  }\n}\n"}
{"label": "18", "index": "32798", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid zero1(int *p, int n) {\n  int i, c;\n  c = *p;\n  for (i = 1; i < n; i++)\n    if (*(p + i) < c)\n      c = *(p + i);\n  for (i = 0; i < n; i++)\n    p[i] = p[i] - c;\n}\nvoid zero2(int **p, int n, int t) {\n  int i, c;\n  c = *(*p + t);\n  for (i = 1; i < n; i++)\n    if (*(*(p + i) + t) < c)\n      c = *(*(p + i) + t);\n  for (i = 0; i < n; i++)\n    *(*(p + i) + t) = *(*(p + i) + t) - c;\n}\nvoid cut(int **p, int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + j) + i) = *(*(p + j) + i + 1);\n}\nint main() {\n  int n, m, i, j, w, c;\n  int **p;\n  cin >> m;\n  p = (int **)malloc(m * sizeof(int *));\n  for (i = 0; i < m; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (w = 0; w < m; w++) {\n    n = m;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + i) + j);\n    for (i = 0; i < n; i++)\n      zero1(p[i], n);\n    for (i = 0; i < n; i++)\n      zero2(p, n, i);\n    c = p[1][1];\n    for (i = 0; i < m - 2; i++) {\n      cut(p, n);\n      n--;\n      for (j = 0; j < n; j++)\n        zero1(p[j], n);\n      for (j = 0; j < n; j++)\n        zero2(p, n, j);\n      c += p[1][1];\n    }\n    cout << c << \"\\n\";\n  }\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n  return 0;\n}\n"}
{"label": "18", "index": "32799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint tozero(int n);\nvoid delete1(int, int);\nvoid delete2(int, int);\nvoid movea(int);\nint a[100][100], sum = 0;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 99; j++)\n      for (k = 0; k <= 99; k++)\n        *(*(a + j) + k) = 0;\n    int r, l, lim = 99;\n    char c;\n\n    for (r = 0; r < n; r++)\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(a + r) + l);\n      }\n    sum = tozero(r);\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\nvoid delete1(int r, int n) {\n  int min = *(*(a + r) + 0), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + r) + j) < min)\n      min = *(*(a + r) + j);\n  for (j = 0; j < n; j++)\n    *(*(a + r) + j) -= min;\n}\nvoid delete2(int l, int n) {\n  int min = *(*(a + 0) + l), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + j) + l) < min)\n      min = *(*(a + j) + l);\n  for (j = 0; j < n; j++)\n    *(*(a + j) + l) -= min;\n}\nvoid movea(int n) {\n  int i, j, k;\n  for (i = 1; i < n - 1; i++)\n    *(*(a + 0) + i) = *(*(a + 0) + i + 1);\n  for (i = 1; i < n - 1; i++)\n    *(*(a + i) + 0) = *(*(a + i + 1) + 0);\n  for (i = 1; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n}\n\nint tozero(int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    delete1(i, n);\n  for (i = 0; i < n; i++)\n    delete2(i, n);\n  sum += *(*(a + 1) + 1);\n  movea(n);\n  if (n >= 3)\n    tozero(n - 1);\n  return sum;\n}\n"}
{"label": "18", "index": "32800", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int af = 1; af <= n; af++) {\n    int sum = 0;\n    int a[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    for (int tempn = n; tempn >= 2; tempn--) {\n\n      for (int i = 0; i <= tempn - 1; i++) {\n        int mini = a[i][0];\n        for (int j = 1; j <= tempn - 1; j++) {\n          if (mini > a[i][j])\n            mini = a[i][j];\n        }\n        for (int j = 0; j <= tempn - 1; j++)\n          a[i][j] -= mini;\n      }\n      for (int j = 0; j <= tempn - 1; j++) {\n        int minj = a[0][j];\n        for (int i = 1; i <= tempn - 1; i++) {\n          if (minj > a[i][j])\n            minj = a[i][j];\n        }\n        for (int i = 0; i <= tempn - 1; i++)\n          a[i][j] -= minj;\n      }\n      sum += a[1][1];\n      for (int i = 2; i <= tempn - 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int j = 2; j <= tempn - 1; j++)\n        a[0][j - 1] = a[0][j];\n      for (int i = 2; i <= tempn - 1; i++) {\n        for (int j = 2; j <= tempn - 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\n\nvoid minus_row_col(int n) {\n  int row[100], col[100], min_row = 10000, min_col = 10000, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min_row)\n        min_row = a[i][j];\n    }\n    row[i] = min_row;\n    min_row = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= row[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min_col)\n        min_col = a[j][i];\n    }\n    col[i] = min_col;\n    min_col = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] -= col[i];\n}\n\nvoid delete_row_col(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    sum = 0;\n    int num = n;\n    while (num != 1) {\n      minus_row_col(num);\n      sum += a[1][1];\n      delete_row_col(num);\n      num--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32802", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[100][100], j, k, min, number = 0, m;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    m = n;\n    number = 0;\n    while (m != 1) {\n      for (j = 0; j < m; j++) {\n        min = *(*(a + j) + 0);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + j) + k)) ? *(*(a + j) + k) : min;\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = *(*(a) + j);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + k) + j)) ? *(*(a + k) + j) : min;\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      number = number + *(*(a + 1) + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + 0) + j) = *(*(a + 0) + j + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + j) + 0) = *(*(a + j + 1) + 0);\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + k - 1) + j - 1) = *(*(a + k) + j);\n      m = m - 1;\n    }\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32803", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; ++k) {\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    int total = 0;\n    for (int t = 0; t < n - 1; ++t) {\n      for (int i = 0; i < n; ++i) {\n        if (i != 0 && i <= t)\n          continue;\n        int minValue = a[i][0];\n        for (int j = t + 1; j < n; ++j)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[i][0] -= minValue;\n        for (int j = t + 1; j < n; ++j)\n          a[i][j] -= minValue;\n      }\n      for (int j = 0; j < n; ++j) {\n        if (j != 0 && j <= t)\n          continue;\n        int minValue = a[0][j];\n        for (int i = t + 1; i < n; ++i)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[0][j] -= minValue;\n        for (int i = t + 1; i < n; ++i)\n          a[i][j] -= minValue;\n      }\n      total += a[t + 1][t + 1];\n    }\n    printf(\"%d\\n\", total);\n  }\n}\n"}
{"label": "18", "index": "32804", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], ni, minl[100], minh[100], i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ni = n; ni > 1; ni--) {\n      for (i = 0; i < ni; i++) {\n        minl[i] = a[i][0];\n        for (j = 0; j < ni; j++) {\n          if (minl[i] > a[i][j])\n            minl[i] = a[i][j];\n        }\n        for (j = 0; j < ni; j++) {\n          a[i][j] = a[i][j] - minl[i];\n        }\n      }\n      for (j = 0; j < ni; j++) {\n        minh[j] = a[0][j];\n        for (i = 0; i < ni; i++) {\n          if (minh[j] > a[i][j])\n            minh[j] = a[i][j];\n        }\n        for (i = 0; i < ni; i++) {\n          a[i][j] = a[i][j] - minh[j];\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < ni; i++) {\n        for (j = 1; j < ni - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 0; j < ni; j++) {\n        for (i = 1; i < ni - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int nn, n;\n  cin >> nn;\n\n  int a[101][101];\n  for (int k = 0; k < nn; k++) {\n    int ans = 0;\n    for (int i = 0; i < nn; i++)\n      for (int j = 0; j < nn; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (int n = nn; n > 1; n--) {\n      int minh[101], minl[101];\n      for (int i = 0; i < n; i++)\n        minh[i] = 1000000;\n      for (int i = 0; i < n; i++)\n        minl[i] = 1000000;\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[i][j] < minh[i])\n            minh[i] = a[i][j];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[i][j] = a[i][j] - minh[i];\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[j][i] < minl[i])\n            minl[i] = a[j][i];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[j][i] = a[j][i] - minl[i];\n\n      ans += a[1][1];\n\n      for (int i = 2; i < n; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < n; i++)\n        a[i - 1][0] = a[i][0];\n\n      for (int i = 2; i < n; i++)\n        for (int j = 2; j < n; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid ope(int m, int a[][101]) {\n  if (m == 1) {\n    return;\n  } else {\n    int i, j, q, min = 100000;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[i][q] = a[i][q] - min;\n      }\n      min = 100000;\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[q][i] = a[q][i] - min;\n      }\n      min = 100000;\n    }\n    sum = sum + a[1][1];\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= m - 1; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n      a[0][i - 1] = a[0][i];\n      a[i - 1][0] = a[i][0];\n    }\n    ope(m - 1, a);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[101][101];\n  int i, j, k;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    ope(n, a);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, q, i, j, min1[100], min2[100], a[100][100], d, w;\n  scanf(\"%d \", &n);\n  w = n;\n  for (q = 0; q < w; q++) {\n\n    d = 0;\n    n = w;\n    for (i = 0; i < w; i++) {\n      for (j = 0; j < w; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (n >= 2) {\n      for (i = 0; i < n; i++)\n        min1[i] = 1000;\n      for (i = 0; i < n; i++)\n        min2[i] = 1000;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (min1[i] > a[i][j]) {\n            min1[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min1[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (min2[j] > a[i][j]) {\n            min2[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min2[j];\n        }\n      }\n      d += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (i = 2; i < n; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32808", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101];\nint main() {\n  int n, i, j, b, k, l, m, s;\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    s = n, b = 0;\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[k][l] < m)\n            m = a[k][l];\n\n        for (l = 0; l < s; l++)\n          a[k][l] -= m;\n      }\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[l][k] < m) {\n            m = a[l][k];\n          }\n\n        for (l = 0; l < s; l++)\n          a[l][k] -= m;\n      }\n\n      b += a[1][1];\n\n      for (k = 0; k < s; k++) {\n        for (l = 0; l < s; l++) {\n          if (k == 0 && l > 1) {\n            a[k][l - 1] = a[k][l];\n          } else if (k > 1 && l == 0) {\n            a[k - 1][l] = a[k][l];\n          } else if (k > 1 && l > 1) {\n            a[k - 1][l - 1] = a[k][l];\n          }\n        }\n      }\n      s--;\n    }\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32809", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(void);\nvoid xiaojian(int);\nint g_n;\nint main() {\n  cin >> g_n;\n  int i, j, k;\n  for (i = 1; i <= g_n; i++) {\n    for (j = 0; j <= g_n - 1; j++) {\n      for (k = 0; k <= g_n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int cishu = 1;\n    int sum = 0;\n    for (; a[g_n - 1][0] >= 0; cishu++) {\n      guiling();\n      sum = sum + a[cishu][cishu];\n      xiaojian(cishu);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid guiling() {\n  int i = 0, j = 0, k = 0;\n  int flag = 0;\n  int min = 1000;\n  int p = 0;\n  for (p = 0; p <= g_n - 1; p++) {\n    flag = 0;\n    min = 1000;\n    if (a[p][0] >= 0) {\n      for (i = 0; i <= g_n - 1; i++) {\n        flag = 0;\n        min = 1000;\n        for (j = 0; j <= g_n - 1; j++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[i][k] = a[i][k] - min;\n          }\n        }\n      }\n      for (j = 0; j <= g_n - 1; j++) {\n        flag = 0;\n        min = 1000;\n        for (i = 0; i <= g_n - 1; i++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[k][j] = a[k][j] - min;\n          }\n        }\n      }\n    }\n  }\n}\nvoid xiaojian(int cishu) {\n  int i, j;\n  for (i = 0; i <= g_n - 1; i++) {\n    a[i][cishu] = -1;\n  }\n  for (j = 0; j <= g_n - 1; j++) {\n    a[cishu][j] = -1;\n  }\n}\n"}
{"label": "18", "index": "32810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num, i, j, sum;\n  scanf(\"%d \", &num);\n  int n = num, min, t = num;\n  while (num > 0) {\n    n = t;\n    int a[n][n];\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < n; i++) {\n        min = a[0][i];\n        for (j = 0; j < n; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - min;\n      }\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[i][j] = a[i][j + 1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[j][i] = a[j + 1][i];\n      n--;\n    }\n    cout << sum << \"\\n\";\n    num--;\n  }\n}\n"}
{"label": "18", "index": "32811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (int size = n; size >= 2; size--) {\n      for (int i = 0; i < size; i++) {\n        int min = 1000000;\n        for (int j = 0; j < size; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 0; j < size; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (int j = 0; j < size; j++) {\n        int min = 1000000;\n        for (int i = 0; i < size; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int i = 0; i < size; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (int i = 1; i < size - 1; i++) {\n        for (int j = 0; j < size; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int j = 1; j < size - 1; j++) {\n        for (int i = 0; i < size - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32812", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid r(int m);\nvoid l(int m);\nvoid fun(int m);\nvoid Try(int i);\nint a[100][100], n, s[100] = {0};\nint main() {\n  int i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    Try(0);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + s[j];\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid r(int m) {\n  int x, y, min;\n  for (x = 0; x < m; x++) {\n    min = a[x][0];\n    for (y = 0; y < m; y++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (y = 0; y < m; y++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid l(int m) {\n  int x, y, min;\n  for (y = 0; y < m; y++) {\n    min = a[0][y];\n    for (x = 0; x < m; x++) {\n      if (a[x][y] < min) {\n        min = a[x][y];\n      }\n    }\n    for (x = 0; x < m; x++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid fun(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j < m - 1; j++) {\n    for (i = 2; i < m; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\nvoid Try(int i) {\n  r(n - i);\n  l(n - i);\n  s[i] = a[1][1];\n  fun(n - i);\n  if (i < n - 1)\n    Try(i + 1);\n}\n"}
{"label": "18", "index": "32813", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[200][200], temp, sum[200];\n\nvoid zero(int i) {\n  int mi = 1000;\n  for (int j = i; j <= n; j++) {\n    for (int k = i; k <= n; k++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int k = i; k <= n; k++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n  mi = 1000;\n  for (int k = i; k <= n; k++) {\n    for (int j = i; j <= n; j++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int j = i; j <= n; j++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n}\n\nint main() {\n  cin >> n;\n  for (int l = 1; l <= n; l++) {\n    sum[l] = 0;\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> *(*(a + j) + k);\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + 1) + i);\n      *(*(a + 1) + i) = *(*(a + 2) + i);\n      *(*(a + 2) + i) = temp;\n    }\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + i) + 1);\n      *(*(a + i) + 1) = *(*(a + i) + 2);\n      *(*(a + i) + 2) = temp;\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      zero(i);\n      sum[l] += *(*(a + i) + i);\n      for (int k = i + 1; k <= n; k++) {\n        temp = *(*(a + i + 1) + k);\n        *(*(a + i + 1) + k) = *(*(a + i + 2) + k);\n        *(*(a + i + 2) + k) = temp;\n      }\n      for (int j = i + 1; j <= n; j++) {\n        temp = *(*(a + j) + i + 1);\n        *(*(a + j) + i + 1) = *(*(a + j) + i + 2);\n        *(*(a + j) + i + 2) = temp;\n      }\n    }\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32814", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, i, j, min;\n\nvoid XJ(int a[][100], int n) {\n  int b[100][100] = {0};\n  b[0][0] = a[0][0];\n  for (i = 1; i < n - 1; i++) {\n    b[0][i] = a[0][i + 1];\n    b[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\n\nint MIN(int a[][100], int n, int sum) {\n  if (n == 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    XJ(a, n);\n    return MIN(a, n - 1, sum);\n  }\n  \n}\n\nint main() {\n  int a[100][100] = {0}, k;\n  cin >> n;\n  int ii;\n  int jj;\n  for (ii = 0; ii < n; ii++) {\n    \n    for (jj = 0; jj < n; jj++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[jj][k];\n      }\n    }\n    cout << MIN(a, n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fa(int a[][101], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min, t;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 2; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 1; i <= n; i++) {\n    {\n      min = a[1][i];\n      for (j = 2; j <= n; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (j = 1; j <= n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n  }\n  t = a[2][2];\n  for (i = 2; i < n; i++) {\n    a[1][i] = a[1][i + 1];\n    a[i][1] = a[i + 1][1];\n    for (j = 2; j < n; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return t + fa(a, n - 1);\n}\nint main() {\n  int n, k, i, j, a[101][101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"%d \", fa(a, n));\n  }\n}\n"}
{"label": "18", "index": "32816", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint zero(int n, int sum) {\n  if (n != 1) {\n    int min, i, j, array[n][n];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        array[i][j] = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[i][0];\n      for (j = 1; j < n; j++) {\n        if (array[i][j] < min) {\n          min = array[i][j];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[i][j] = array[i][j] - min;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[0][i];\n      for (j = 1; j < n; j++) {\n        if (array[j][i] < min) {\n          min = array[j][i];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[j][i] = array[j][i] - min;\n        }\n      }\n    }\n    sum = sum + array[1][1];\n    for (i = 0; i < n; i++) {\n      for (j = 1; j < n - 1; j++) {\n        a[i][j] = array[i][j] = array[i][j + 1];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 1; j < n - 1; j++)\n        array[j][i] = array[j + 1][i];\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 0; j < n - 1; j++) {\n        a[i][j] = array[i][j];\n      }\n    }\n    return zero(n - 1, sum);\n  }\n  if (n == 1)\n    return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0, i, t, r;\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n; t++) {\n      for (r = 0; r < n; r++) {\n        cin >> a[t][r];\n      }\n    }\n    cout << zero(n, sum) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32817", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; ++i) {\n    int sum = 0;\n    int t[101][101] = {0};\n    for (j = 0; j < n; ++j) {\n      for (k = 0; k < n; ++k) {\n        cin >> t[j][k];\n      }\n    }\n\n    int cnt = n;\n    while (cnt > 1) {\n      for (j = 0; j < cnt; ++j) {\n        int min = t[j][0];\n        for (k = 1; k < cnt; ++k) {\n          if (t[j][k] < min)\n            min = t[j][k];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[j][k] -= min;\n        }\n      }\n\n      for (j = 0; j < cnt; ++j) {\n        int min = t[0][j];\n        for (k = 1; k < cnt; ++k) {\n          if (t[k][j] < min)\n            min = t[k][j];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[k][j] -= min;\n        }\n      }\n\n      sum += t[1][1];\n\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[j][k] = t[j][k + 1];\n        }\n      }\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[k][j] = t[k + 1][j];\n        }\n      }\n\n      cnt--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, k, m, z, x, p = 0, min1[100], min2[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = 0;\n    p = 0;\n    while (p < n) {\n      for (m = 0; m < n - p; m++) {\n        min1[m] = a[m][0];\n        for (k = 0; k < n - p; k++) {\n\n          if (min1[m] > a[m][k]) {\n            min1[m] = a[m][k];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min1[z];\n        }\n      }\n      for (m = 0; m < n - p; m++) {\n        min2[m] = a[0][m];\n        for (k = 0; k < n - p; k++) {\n\n          if (min2[m] > a[k][m]) {\n            min2[m] = a[k][m];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min2[x];\n        }\n      }\n      sum = sum + a[1][1];\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[z][m] = a[z][m + 1];\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[m][z] = a[m + 1][z];\n        }\n      }\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32819", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Delete(int a[][101], int, int);\nint check_min(int a[], int);\n\nint sum[101], a[101][101];\n\nint main() {\n  int n, p;\n  int i, j, l, m, k;\n  memset(a, 0, sizeof(a));\n  memset(sum, 0, sizeof(sum));\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    Delete(a, n, k);\n  }\n\n  for (l = 0; l < n; l++) {\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n\nvoid Delete(int a[][101], int n, int p) {\n  if (n == 1)\n    return;\n  int i, j, k, l, m, q, r, s, min, Min[101];\n  for (i = 0; i < n; i++) {\n    min = check_min(a[i], n);\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == 0)\n        Min[i] = a[j][i];\n      if (a[j][i] < Min[i])\n        Min[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - Min[i];\n    }\n  }\n  sum[p] = sum[p] + a[1][1];\n  for (k = 2; k < n; k++) {\n    for (l = 2; l < n; l++)\n      a[k - 1][l - 1] = a[k][l];\n  }\n  for (m = 2; m < n; m++) {\n    a[0][m - 1] = a[0][m];\n    a[m - 1][0] = a[m][0];\n  }\n  Delete(a, n - 1, p);\n}\n\nint check_min(int a[], int n) {\n  int min;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      min = a[i];\n    if (a[i] < min)\n      min = a[i];\n  }\n  return min;\n}\n"}
{"label": "18", "index": "32820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Delete(int a[][101], int, int);\nint check_min(int a[], int);\n\nint sum[101], a[101][101];\n\nint main() {\n  int n, p;\n  int i, j, l, k;\n  memset(a, 0, sizeof(a));\n  memset(sum, 0, sizeof(sum));\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    Delete(a, n, k);\n  }\n\n  for (l = 0; l < n; l++) {\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n\nvoid Delete(int a[][101], int n, int p) {\n  if (n == 1)\n    return;\n  int i, j, k, l, m, q, r, s, min, Min[101];\n  for (i = 0; i < n; i++) {\n    min = check_min(a[i], n);\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == 0)\n        Min[i] = a[j][i];\n      if (a[j][i] < Min[i])\n        Min[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - Min[i];\n    }\n  }\n  sum[p] = sum[p] + a[1][1];\n  for (k = 2; k < n; k++) {\n    for (l = 2; l < n; l++) {\n      a[k - 1][l - 1] = a[k][l];\n    }\n  }\n  for (m = 2; m < n; m++) {\n    a[0][m - 1] = a[0][m];\n    a[m - 1][0] = a[m][0];\n  }\n  Delete(a, n - 1, p);\n}\n\nint check_min(int a[], int n) {\n  int min;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      min = a[i];\n    if (a[i] < min)\n      min = a[i];\n  }\n  return min;\n}\n"}
{"label": "18", "index": "32821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int a, int b) {\n  if (a >= b) {\n    return b;\n  } else {\n    return a;\n  }\n}\nint main() {\n  int n, i, j, t, sum, x, y, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int b[100][100] = {0};\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++) {\n        scanf(\"%d\", &a[j][t]);\n        b[j][t] = a[j][t];\n      }\n    }\n    for (r = 0; r < n - 1; r++) {\n      for (j = 0; j < n; j++) {\n        x = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[j][t + 1] = f(a[j][t], a[j][t + 1]);\n        }\n        x = a[j][t];\n        for (t = 0; t < n; t++) {\n          b[j][t] = b[j][t] - x;\n          a[j][t] = b[j][t];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        y = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[t + 1][j] = f(a[t][j], a[t + 1][j]);\n        }\n        y = a[t][j];\n        for (t = 0; t < n; t++) {\n          b[t][j] = b[t][j] - y;\n          a[t][j] = b[t][j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[t][j] = a[t + 1][j];\n          b[t][j] = a[t][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[j][t] = a[j][t + 1];\n          b[j][t] = a[j][t];\n        }\n      }\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "32822", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num, i, j, sum;\n  cin >> num;\n  int n = num, min, t = num;\n  while (num > 0) {\n    n = t;\n    int a[n][n];\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < n; i++) {\n        min = a[0][i];\n        for (j = 0; j < n; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      \n      \n      \n      sum = sum + a[1][1];\n      \n      \n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[i][j] = a[i][j + 1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[j][i] = a[j + 1][i];\n      n--;\n    }\n    cout << sum << endl;\n    num--;\n  }\n}\n"}
{"label": "18", "index": "32823", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, a[100][100], min, sum;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    k = n;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = 100000;\n        for (j = 0; j < k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 100000;\n        for (i = 0; i < k; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        if (min == 0)\n          continue;\n        else\n          for (i = 0; i < k; i++)\n            a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < k - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < k - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      k--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32824", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, total;\n  scanf(\"%d \", &n);\n  int a[n][n];\n  int numbers = n;\n  for (k = 0; k < numbers; k++) {\n    total = 0;\n    for (i = 0; i < numbers; i++)\n      for (j = 0; j < numbers; j++)\n        cin >> a[i][j];\n    for (n = numbers; n > 1; n--) {\n      for (i = 0; i < n; i++) {\n        int temp = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] -= temp;\n      }\n      for (j = 0; j < n; j++) {\n        int temp = a[0][j];\n        for (i = 1; i < n; i++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] -= temp;\n      }\n      total += a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[120][120];\nint math(int);\nint n;\nint main() {\n  int sum, b, c;\n  cin >> n;\n  c = n;\n  while (c--) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = math(n);\n\n    b = n;\n    while (b--) {\n      for (int i = 2; i < b + 1; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < b + 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int i = 2; i < b + 1; i++)\n        for (int j = 2; j < b + 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      if (b == 1)\n        break;\n      sum = math(b) + sum;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\nint math(int x) {\n  int min[x];\n  for (int i = 0; i < x; i++)\n    min[i] = a[i][0];\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - min[i];\n\n  int minl[x];\n  for (int i = 0; i < x; i++)\n    minl[i] = a[0][i];\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[j][i] < minl[i])\n        minl[i] = a[j][i];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - minl[j];\n\n  return a[1][1];\n}\n"}
{"label": "18", "index": "32826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int sum = 0;\n  int a[101][101];\n  int min;\n  int l;\n  int p;\n  int t;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    l = n;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    for (p = 1; p < n; p++) {\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[i][j] == 0)\n            break;\n        }\n        min = a[i][0];\n        for (j = 1; j < l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[j][i] == 0) {\n            break;\n          }\n        }\n        min = a[0][i];\n        for (j = 1; j < l; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      if (l == 2)\n        break;\n      for (i = 1; i < l - 1; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < l - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      l--;\n    }\n    cout << sum << \" \";\n  }\n}\n"}
{"label": "18", "index": "32827", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, y, m1, m2, p;\n  int a[103][103], s = 0;\n  cin >> n;\n  for (y = 1; y <= n; y++) {\n    p = n;\n    s = 0;\n    m1 = 999999;\n    m2 = 999999;\n    for (i = 1; i <= p; i++)\n      for (j = 1; j <= p; j++)\n        cin >> a[i][j];\n    while (p > 1) {\n\n      \n      for (i = 1; i <= p; i++) {\n        m1 = a[i][1];\n        for (j = 1; j <= p; j++)\n          if (m1 > a[i][j])\n            m1 = a[i][j];\n        for (j = 1; j <= p; j++)\n          a[i][j] -= m1;\n      }\n      \n      for (i = 1; i <= p; i++) {\n        m2 = a[1][i];\n        for (j = 1; j <= p; j++)\n          if (m2 > a[j][i])\n            m2 = a[j][i];\n        for (j = 1; j <= p; j++)\n          a[j][i] -= m2;\n      }\n      \n      s += a[2][2];\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] = a[i + 1][j];\n      \n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p - 1; j++)\n          a[j][i] = a[j][i + 1];\n      \n      p--;\n      \n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32828", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint board[100][100];\nvoid Subduction(int);\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        scanf(\"%d \", &board[j][k]);\n      }\n    }\n\n    Subduction(n);\n  }\n\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1)\n    printf(\"%d\\n\", sum);\n  else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    for (q = 1; q <= m - 2; q++) {\n      board[0][q] = board[0][q + 1];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      board[p][0] = board[p + 1][0];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      for (q = 1; q <= m - 2; q++) {\n        board[p][q] = board[p + 1][q + 1];\n      }\n    }\n    Subduction(m - 1);\n  }\n}\n"}
{"label": "18", "index": "32829", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid zero(int array_1[100][100]);\nvoid subduction(int array_1[100][100]);\nint num, array_1[100][100];\nint main() {\n  int n, i, j, k, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    num = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    for (i = 1; i < n; i++) {\n      zero(array_1);\n      sum = sum + array_1[1][1];\n      subduction(array_1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid zero(int array_1[100][100]) {\n  int i, j, minuend;\n  for (i = 0; i < num; i++) {\n    minuend = array_1[i][0];\n    for (j = 0; j < num; j++)\n      if (array_1[i][j] < minuend)\n        minuend = array_1[i][j];\n    for (j = 0; j < num; j++)\n      array_1[i][j] = array_1[i][j] - minuend;\n  }\n  for (i = 0; i < num; i++) {\n    minuend = array_1[0][i];\n    for (j = 0; j < num; j++)\n      if (array_1[j][i] < minuend)\n        minuend = array_1[j][i];\n    for (j = 0; j < num; j++)\n      array_1[j][i] = array_1[j][i] - minuend;\n  }\n};\n\nvoid subduction(int array_1[100][100]) {\n  int i, j, k;\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[i - 1][j] = array_1[i][j];\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[j][i - 1] = array_1[j][i];\n  num--;\n};\n"}
{"label": "18", "index": "32830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], s = 0;\nvoid juzhen(int x) {\n\n  for (int i = 0; i < x; i++) {\n    int m = a[i][0];\n    for (int j = 1; j < x; j++)\n\n      if (a[i][j] < m)\n        m = a[i][j];\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - m;\n  }\n  for (int i = 0; i < x; i++) {\n    int m = a[0][i];\n    for (int j = 1; j < x; j++)\n\n      if (a[j][i] < m)\n        m = a[j][i];\n    for (int j = 0; j < x; j++)\n      a[j][i] = a[j][i] - m;\n  }\n  s = s + a[1][1];\n  if (x == 2) {\n    cout << s << endl;\n    return;\n  }\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x - 1; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  juzhen(x - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n\n  for (int o = 1; o <= n; o++) {\n    s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(n);\n  }\n}\n"}
{"label": "18", "index": "32831", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, a[101][101], min, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    r = n;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int l = 1; l <= n - 2; l++) {\n      for (int i = 1; i <= r; i++) {\n        min = a[i][1];\n        for (int j = 1; j <= r; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (int i = 1; i <= r; i++) {\n        min = a[1][i];\n        for (int j = 1; j <= r; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum += a[2][2];\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r - 1; j++) {\n          a[j][i] = a[j][i + 1];\n        }\n      }\n      r--;\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= 2; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= 2; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum += a[2][2];\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "32832", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, b, j, k, a, su[100][100], result;\n  cin >> n;\n  b = n;\n  for (i = 0; i < n; i++) {\n    result = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &su[j][k]);\n\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        a = su[j][0];\n        for (k = 0; k < n; k++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          su[j][k] -= a;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        a = su[0][k];\n        for (j = 0; j < n; j++) {\n          if (a > su[j][k])\n            a = su[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          su[j][k] -= a;\n        }\n      }\n      result += su[1][1];\n      for (j = 0; j < n - 1; j++) {\n        for (k = 0; k < n - 1; k++) {\n          if (j == 0 && k > 0) {\n            su[j][k] = su[j][k + 1];\n          } else if (k == 0 && j > 0)\n            su[j][k] = su[j + 1][k];\n          else if (j > 0 && k > 0)\n            su[j][k] = su[j + 1][k + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", result);\n    n = b;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32833", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint w[200][200];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int x = 0; x < n; x++)\n      for (int y = 0; y < n; y++)\n        cin >> w[x][y];\n    int s = 0;\n    for (int m = 1; m < n; m++) {\n      for (int x = 0; x < n; x++) {\n        int minn = w[x][0];\n        for (int y = m; y < n; y++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[x][0] -= minn;\n        for (int y = m; y < n; y++)\n          w[x][y] -= minn;\n      }\n      for (int y = 0; y < n; y++) {\n        int minn = w[0][y];\n        for (int x = m; x < n; x++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[0][y] -= minn;\n        for (int x = m; x < n; x++)\n          w[x][y] -= minn;\n      }\n      s += w[m][m];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000][1000];\nint juzheng(int y) {\n  if (y == 1) {\n    return 0;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[i][j] < min)\n        min = x[i][j];\n    }\n    for (int j = 1; j <= y; j++)\n      x[i][j] = x[i][j] - min;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[j][i] < min)\n        min = x[j][i];\n    }\n    for (int j = 1; j <= y; j++)\n      x[j][i] = x[j][i] - min;\n  }\n  int min1 = x[2][2];\n  for (int i = 2; i < y; i++)\n    x[1][i] = x[1][i + 1];\n  for (int i = 2; i < y; i++)\n    x[i][1] = x[i + 1][1];\n  for (int i = 3; i <= y; i++)\n    for (int j = 3; j <= y; j++)\n      x[i - 1][j - 1] = x[i][j];\n\n  return min1 + juzheng(y - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> x[j][k];\n\n    cout << juzheng(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32835", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n;\nint min(int x[]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    if (x[i] < 0)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (x[i] > x[j] && x[j] >= 0)\n        break;\n    }\n    if (j == n)\n      return x[i];\n  }\n  return 0;\n}\nvoid cut(int a[50][50], int k) {\n  int i, j, m;\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n}\nvoid xiaojian(int a[50][50], int k) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[k][i] = -1;\n    a[i][k] = -1;\n  }\n}\nint main() {\n  int a[50][50][50], j, i, k, l, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n\n    for (j = 0; j < n; j++) {\n      for (i = 0; i < n; i++) {\n        scanf(\"%d\", &a[k][j][i]);\n      }\n    }\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      cut(a[k], j);\n      sum = sum + a[k][j][j];\n      xiaojian(a[k], j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], sum = 0;\n\nint minr(int u, int n) {\n  int i, minn = a[u][1];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[u][i])\n      minn = a[u][i];\n  }\n  return minn;\n}\n\nint minc(int v, int n) {\n  int i, minn = a[1][v];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[i][v])\n      minn = a[i][v];\n  }\n  return minn;\n}\n\nvoid f2(int n) {\n  int u, v;\n  for (u = 2; u <= n - 1; u++) {\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u + 1][v];\n    }\n  }\n  for (v = 2; v <= n - 1; v++) {\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v + 1];\n    }\n  }\n  return;\n}\n\nvoid f1(int n) {\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  }\n  int u, v;\n\n  for (u = 1; u <= n; u++) {\n    int temp = minr(u, n);\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n\n  for (v = 1; v <= n; v++) {\n    int temp = minc(v, n);\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n  sum = sum + a[2][2];\n  f2(n);\n  f1(n - 1);\n}\n\nint main() {\n  int n, i, u, v;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (u = 1; u <= n; u++) {\n      for (v = 1; v <= n; v++) {\n        scanf(\"%d \", &a[u][v]);\n      }\n    }\n    f1(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32837", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint make(int a[100][100], int l, int num, int n);\nint main() {\n  int n, i, j, k, l, num, ans = 0;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    ans = 0;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      num = l;\n      ans = ans + make(a, l, num, n);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\nint make(int a[100][100], int l, int num, int n) {\n  int min1, min2, i, j, k, p, q, m;\n  for (k = 0; k <= n - 1; k++) {\n    min1 = a[k][0];\n    for (i = l; i <= n - 1; i++) {\n      if (a[k][i] < min1)\n        min1 = a[k][i];\n    }\n    for (j = 0; j <= n - 1; j++)\n      a[k][j] = a[k][j] - min1;\n  }\n  for (p = 0; p <= n - 1; p++) {\n    min2 = a[0][p];\n    for (q = l; q <= n - 1; q++) {\n      if (a[q][p] < min2)\n        min2 = a[q][p];\n    }\n    a[0][p] = a[0][p] - min2;\n    for (m = l; m <= n - 1; m++) {\n      a[m][p] = a[m][p] - min2;\n    }\n  }\n  num--;\n  if (num == 0)\n    return a[l][l];\n  else\n    return make(a, l, num, n);\n}\n"}
{"label": "18", "index": "32838", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nvoid down1(int a[100][100], int m) {\n  int i, p, j;\n  for (i = m; i < n; i = i + 1) {\n    p = a[i][m];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[i][j])\n        p = a[i][j];\n    for (j = m; j < n; j = j + 1)\n      a[i][j] = a[i][j] - p;\n  }\n}\nvoid down2(int a[100][100], int m) {\n  int i, j, p;\n  for (i = m; i < n; i = i + 1) {\n    p = a[m][i];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[j][i])\n        p = a[j][i];\n    for (j = m; j < n; j = j + 1)\n      a[j][i] = a[j][i] - p;\n  }\n}\nint main() {\n  int i, j, t, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  k = 0;\n  while (k < n) {\n    k = k + 1;\n    t = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 1; i <= n - 1; i = i + 1) {\n      down1(a, i - 1);\n      down2(a, i - 1);\n      t = t + a[i][i];\n      for (j = i - 1; j < n; j = j + 1)\n        a[i][j] = a[i - 1][j];\n      for (j = i; j < n; j = j + 1)\n        a[j][i] = a[j][i - 1];\n    }\n    printf(\"%d\", t);\n    if (k < n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32839", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100][100];\nint Sum(int n, int t[100][100]) {\n  int sum = 0, min = 0;\n  int i, j, tempi, tempj;\n\n  for (i = 0; i < n; i++) {\n    min = t[i][0];\n    for (j = 0; j < n; j++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (j = 0; j < n; j++)\n      t[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = t[0][j];\n    for (i = 0; i < n; i++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (i = 0; i < n; i++)\n      t[i][j] -= min;\n  }\n  sum = t[1][1];\n  if (n == 2)\n    return sum;\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (j == 0)\n        tempj = j;\n      else\n        tempj = j + 1;\n      if (i == 0)\n        tempi = i;\n      else\n        tempi = i + 1;\n\n      t[i][j] = t[tempi][tempj];\n    }\n\n  return sum += Sum(n - 1, t);\n}\nint main() {\n  int n, sum = 0;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    sum = Sum(n, a[i]);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint w[200][200];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int x = 0; x < n; x++)\n      for (int y = 0; y < n; y++)\n        cin >> w[x][y];\n    int s = 0;\n    for (int m = 1; m < n; m++) {\n      for (int x = 0; x < n; x++) {\n        int minn = w[x][0];\n        for (int y = m; y < n; y++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[x][0] -= minn;\n        for (int y = m; y < n; y++)\n          w[x][y] -= minn;\n      }\n      for (int y = 0; y < n; y++) {\n        int minn = w[0][y];\n        for (int x = m; x < n; x++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[0][y] -= minn;\n        for (int x = m; x < n; x++)\n          w[x][y] -= minn;\n      }\n      s += w[m][m];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int[100][100], int);\n\nint main() {\n  int n, k, i, j;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) {\n  int p, i, j, min;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  p = a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  return p + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "32842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        int min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        int min = a[0][j];\n        for (k = 0; k < n - l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < n - l - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - l; j++)\n        a[j][0] = a[j + 1][0];\n      for (j = 1; j < n - l - 1; j++)\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, j;\n  int sum = 0;\n  cin >> n;\n  int a[n][n];\n  int minh[n], minl[n];\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int t = 1;\n    sum = 0;\n    while (t < n) {\n      for (i = 0; i < n; i++) {\n        minh[i] = 10000;\n        minl[i] = 10000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minh[i] > a[i][j])\n            minh[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minh[i];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minl[j] > a[i][j])\n            minl[j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000) {\n            a[i][j] = a[i][j] - minl[j];\n          }\n        }\n      }\n\n      sum = sum + a[t][t];\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (i == t || j == t) {\n            a[i][j] = 10000;\n          }\n        }\n      }\n\n      t++;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint xiao(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  return a[1][1];\n}\n\nvoid suo(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return;\n}\n\nint main() {\n  int n, l, i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    int count = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    i = n;\n    while (i > 1) {\n      count = count + xiao(i);\n      suo(i);\n      i--;\n    }\n    printf(\"%d\\n\", count);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(int n, int a[101][101]) {\n  int i, j, min, k;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 1; j <= n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 1; j <= n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 1; i <= n; i++) {\n    min = a[1][i];\n    for (j = 1; j <= n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 1; j <= n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[2][2];\n  else {\n    k = a[2][2];\n    for (i = 3; i <= n; i++) {\n      a[1][i - 1] = a[1][i];\n      a[i - 1][1] = a[i][1];\n    }\n    for (i = 3; i <= n; i++)\n      for (j = 3; j <= n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    n--;\n    return k + f(n, a);\n  }\n}\nint main() {\n  int a[101][101] = {0}, n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    cout << f(n, a) << endl;\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m[105][105], s, min = 10000, sum = 0;\n  cin >> n;\n  s = n;\n  for (int g = 1; g <= n; g++) {\n    sum = 0;\n    s = n;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> m[i][j];\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[i][j] < min)\n            min = m[i][j];\n        for (int j = 1; j <= s; j++)\n          m[i][j] = m[i][j] - min;\n      }\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[j][i] < min)\n            min = m[j][i];\n        for (int j = 1; j <= s; j++)\n          m[j][i] = m[j][i] - min;\n      }\n      sum = sum + m[2][2];\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s; j++) {\n          m[i][j] = m[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s - 1; j++)\n          m[j][i] = m[j][i + 1];\n      }\n      s = s - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid minus_row_col(int n) {\n  int row[100], col[100], min_row = 10000, min_col = 10000, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min_row)\n        min_row = a[i][j];\n    }\n    row[i] = min_row;\n    min_row = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= row[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min_col)\n        min_col = a[j][i];\n    }\n    col[i] = min_col;\n    min_col = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] -= col[i];\n}\n\nvoid delete_row_col(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    sum = 0;\n    int num = n;\n    while (num != 1) {\n      minus_row_col(num);\n      sum += a[1][1];\n      delete_row_col(num);\n      num--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32848", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, sum = 0;\n  int a[100][100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[j][0];\n        for (k = 1; k < n - m; k++) {\n          if (a[j][k] < b[j]) {\n            b[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j][k] - b[j];\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[0][j];\n        for (k = 1; k < n - m; k++) {\n          if (a[k][j] < b[j]) {\n            b[j] = a[k][j];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[k][j] = a[k][j] - b[j];\n        }\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - 1 - m; k++) {\n          a[k][j] = a[k][j + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32849", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint row(int a[][100], int l, int m) {\n  int i, min = a[m][0];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[m][i])\n      min = a[m][i];\n  return min;\n}\nint line(int a[][100], int l, int m) {\n  int i, min = a[0][m];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[i][m])\n      min = a[i][m];\n  return min;\n}\nvoid move(int a[][100], int l) {\n  int i, j;\n  for (i = 1; i < l + 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < l + 1; i++)\n    for (j = 1; j < l + 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int l, a[100][100] = {0}, sum = 0, x, y;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = n - 1; l >= 0; l--) {\n      for (x = 0; x < l + 1; x++) {\n        int d = row(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[x][y] = a[x][y] - d;\n      }\n      for (x = 0; x < l + 1; x++) {\n        int e = line(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[y][x] = a[y][x] - e;\n      }\n      sum += a[1][1];\n      move(a, l);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32850", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (int size = n; size >= 2; size--) {\n      for (int i = 0; i < size; i++) {\n        int min = 1000000;\n        for (int j = 0; j < size; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 0; j < size; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (int j = 0; j < size; j++) {\n        int min = 1000000;\n        for (int i = 0; i < size; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int i = 0; i < size; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (int i = 1; i < size - 1; i++) {\n        for (int j = 0; j < size; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int j = 1; j < size - 1; j++) {\n        for (int i = 0; i < size - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200];\n  cin >> n;\n\n  for (i = 0; i <= 199; i++)\n    for (j = 0; j <= 199; j++)\n      num[i][j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        cin >> num[j][k];\n\n    printf(\"%d\\n\", del(num, n));\n  }\n  return 0;\n}\n\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 9999;\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min)\n        min = num[j][i];\n    }\n    for (i = 0; i <= n - 1; i++)\n      num[j][i] = num[j][i] - min;\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n\n    for (i = 0; i <= n - 1; i++)\n      num[i][j] = num[i][j] - min;\n  }\n  sum = sum + num[1][1];\n\n  if (n == 2)\n    return sum;\n\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "32852", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minline(int n, int u, int **a) {\n  int temp = a[0][u];\n  for (int i = 1; i < n; i++) {\n    if (temp > a[i][u]) {\n      temp = a[i][u];\n    }\n  }\n  return temp;\n}\nint mincross(int n, int a[]) {\n  int temp = a[0];\n  for (int i = 0; i < n; i++) {\n    if (temp > a[i]) {\n      temp = a[i];\n    }\n  }\n  return temp;\n}\n\nint ans(int n, int **pp) {\n\n  int sum = 0;\n\n  for (int y = 0; y < n - 1; y++) {\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = mincross(n - y, pp[i]);\n      for (int j = 0; j < n - y; j++) {\n        pp[i][j] = pp[i][j] - minTemp;\n      }\n    }\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = minline(n - y, i, pp);\n      for (int j = 0; j < n - y; j++) {\n        pp[j][i] = pp[j][i] - minTemp;\n      }\n    }\n    sum = sum + pp[1][1];\n\n    for (int i = 0; i < n - y; i++) {\n      for (int j = 1; j < n - 1 - y; j++) {\n        pp[i][j] = pp[i][j + 1];\n      }\n    }\n\n    for (int i = 0; i < n - 1 - y; i++) {\n      for (int j = 1; j < n - y - 1; j++) {\n        pp[j][i] = pp[j + 1][i];\n      }\n    }\n  }\n  return sum;\n}\n\nint main(void) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int **pp;\n  pp = (int **)malloc(n * sizeof(int *));\n  for (int i = 0; i < n; i++) {\n    pp[i] = (int *)malloc(n * sizeof(int));\n  }\n\n  for (int w = 0; w < n; w++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &pp[i][j]);\n      }\n    }\n    printf(\"%d\\n\", ans(n, pp));\n  }\n\n  for (int i = 0; i < n; i++) {\n    free(pp[i]);\n  }\n  free(pp);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32853", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k = k + 1) {\n    sum = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1) {\n        cin >> a[i][j];\n      }\n    for (l = n; l > 1; l = l - 1) {\n      for (i = 0; i < l; i = i + 1) {\n        min = a[i][0];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < l; i = i + 1) {\n        min = a[0][i];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      if (l != 2) {\n        for (i = 1; i < l; i = i + 1)\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        for (i = 1; i < l; i = i + 1)\n          for (j = 1; j < l; j = j + 1)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32854", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, l, m, b, c, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 0; j <= n * n - 1; j++)\n      cin >> a[j / n][j % n];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        b = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          if (a[k][l] < b)\n            b = a[k][l];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[k][l] = a[k][l] - b;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        c = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[l][k] == 999999)\n            continue;\n          if (a[l][k] < c)\n            c = a[l][k];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[l][k] = a[l][k] - c;\n        }\n      }\n      s = s + a[j][j];\n      for (m = 0; m <= n - 1; m++)\n        a[j][m] = 999999;\n      for (m = 0; m <= n - 1; m++)\n        a[m][j] = 999999;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0};\nint n;\nint count1 = 0;\nint (*p)[100] = NULL;\nint deal();\nint main() {\n  int i, j, k;\n  cin >> n;\n  p = a;\n  for (k = 0; k < n; k++) {\n    count1 = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    deal();\n  }\n  return 0;\n}\nint deal() {\n  int min;\n  int i, j, k;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < n; i++) {\n      min = *(*(p + i));\n      for (j = 0; j < n; j++)\n        if (*(*(p + i) + j) < min) {\n          min = *(*(p + i) + j);\n        }\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      for (i = 0; i < n; i++)\n        if (*(*(p + i) + j) < min) {\n          min = *(*(p + i) + j);\n        }\n      for (i = 0; i < n; i++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    count1 += *(*(p + 1) + 1);\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++) {\n        *(*(p + i) + j) = *(*(p + i + 1) + j);\n      }\n    for (j = 1; j < n - 1; j++)\n      for (i = 0; i < n; i++) {\n        *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n  }\n  cout << count1 << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32856", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint an[1000][1000];\n\nint hang[1000], lie[1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, l, p, q;\n\n  for (l = 0; l < n; l++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> an[i][j];\n    }\n\n    int sum = 0;\n\n    for (k = n; k > 0; k--) {\n\n      for (p = 0; p < k; p++) {\n        hang[p] = an[p][0];\n        for (q = 0; q < k; q++) {\n          if (hang[p] > an[p][q])\n            hang[p] = an[p][q];\n        }\n        for (q = 0; q < k; q++)\n          an[p][q] = an[p][q] - hang[p];\n      }\n\n      for (q = 0; q < k; q++) {\n        lie[q] = an[0][q];\n        for (p = 0; p < k; p++) {\n          if (lie[q] > an[p][q])\n            lie[q] = an[p][q];\n        }\n        for (p = 0; p < k; p++)\n          an[p][q] = an[p][q] - lie[q];\n      }\n\n      sum = sum + an[1][1];\n\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k; j++)\n          an[i][j] = an[i][j + 1];\n      }\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < k; j++)\n          an[i][j] = an[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32857", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint a[100][100];\nvoid shrink(int n) {\n  for (int i = 1; i < n - 1; i++) \n  {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0], j;\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j]; \n    for (j = 0; j < n; j++)\n      a[i][j] -= min; \n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i], j;\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i]; \n    for (j = 0; j < n; j++)\n      a[j][i] -= min; \n  }\n  if (n == 2) \n    return a[1][1];\n  int k = a[1][1];\n  shrink(n);\n  return k + Sum(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k]; \n    cout << Sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32858", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, n, sum, min = 0, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - k; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n        a[i][n - 1] = 0;\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n        a[n - 1][j] = 0;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32859", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[100][100], sum;\nvoid col(int c) {\n  if (c == n) {\n    printf(\"%d\\n\", sum);\n    return;\n  }\n  int min;\n  for (int i = 0; i <= n - c; i++) {\n    min = a[i][0];\n    for (int j = 1; j <= n - c; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[i][j] = a[i][j] - min;\n  }\n  for (int i = 0; i <= n - c; i++) {\n    min = a[0][i];\n    for (int j = 1; j <= n - c; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[j][i] = a[j][i] - min;\n  }\n  sum += a[1][1];\n  a[1][1] = a[2][2];\n  for (int i = 1; i < n - c; i++)\n    a[0][i] = a[0][i + 1];\n  for (int i = 1; i < n - c; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < n - c; i++)\n    for (int j = 1; j < n - c; j++)\n      a[i][j] = a[i + 1][j + 1];\n  col(c + 1);\n}\nint main() {\n  cin >> n;\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    col(1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s = 0, min, n0, a[100][100] = {0}, temp[100][100];\n  cin >> n0;\n  for (int z = 0; z < n0; ++z) {\n    s = 0;\n    for (int i = 0; i < n0; ++i)\n      for (int j = 0; j < n0; ++j) {\n        cin >> a[i][j];\n      }\n    for (int n = n0; n > 1; --n) {\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[k][l];\n          else\n            min = min > a[k][l] ? a[k][l] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[k][l] -= min;\n        }\n      }\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[l][k];\n          else\n            min = min > a[l][k] ? a[l][k] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[l][k] -= min;\n        }\n      }\n\n      s += a[1][1];\n      for (int i = 0; i < n; ++i)\n        for (int j = 0; j < n; ++j) {\n          temp[i][j] = a[i][j];\n        }\n      for (int i = 2; i < n; ++i) {\n        a[i - 1][0] = temp[i][0];\n      }\n      for (int i = 2; i < n; ++i) {\n        a[0][i - 1] = temp[0][i];\n      }\n      for (int i = 2; i < n; ++i)\n        for (int j = 2; j < n; ++j) {\n          a[i - 1][j - 1] = temp[i][j];\n        }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32861", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint jieguo(int n) {\n  int min = 10000;\n  int p = 0, i = 0, j = 0, sum = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    return a[1][1];\n  } else {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum = a[1][1];\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        a[j][i] = a[j][i + 1];\n      }\n    }\n    return (sum + jieguo(n - 1));\n  }\n}\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = 0;\n    }\n  }\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    cout << jieguo(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32863", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[100][100], sum = 0;\n\nvoid SUM(int n) {\n  if (n == 1)\n    return;\n  int i, j;\n\n  int min;\n  for (i = 0; i < n; i++) {\n    min = matrix[i][0];\n    for (j = 0; j < n; j++) {\n      if (min > matrix[i][j])\n        min = matrix[i][j];\n    }\n\n    for (j = 0; j < n; j++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    min = matrix[0][j];\n    for (i = 0; i < n; i++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  sum += matrix[1][1];\n\n  for (j = 1; j < n - 1; j++)\n    matrix[0][j] = matrix[0][j + 1];\n\n  for (i = 1; i < n - 1; i++)\n    matrix[i][0] = matrix[i + 1][0];\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      matrix[i][j] = matrix[i + 1][j + 1];\n    }\n  }\n\n  SUM(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> matrix[j][k];\n\n    SUM(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32864", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[110][110], n, sum;\nvoid calculate(int t) {\n  int i, j, minimum;\n  for (i = 1; i <= n; i++) {\n    minimum = a[i][1];\n    for (j = t; j <= n; j++)\n      if (minimum > a[i][j])\n        minimum = a[i][j];\n    a[i][1] -= minimum;\n    for (j = t; j <= n; j++)\n      a[i][j] -= minimum;\n  }\n  for (i = 1; i <= n; i++) {\n    minimum = a[1][i];\n    for (j = t; j <= n; j++)\n      if (minimum > a[j][i])\n        minimum = a[j][i];\n\n    a[1][i] -= minimum;\n    for (j = t; j <= n; j++)\n      a[j][i] -= minimum;\n  }\n  sum += a[t][t];\n  if (t < n)\n    calculate(t + 1);\n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    calculate(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100][100], i, j, k, p = 0, q = 0, m, s[100], d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n  }\n  d = n;\n  for (i = 0; i < d; i++) {\n    n = d;\n    s[i] = 0;\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        m = a[i][j][0];\n        for (k = 1; k < n; k++) {\n          if (a[i][j][k] < m)\n            m = a[i][j][k];\n          if (a[i][j][k] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][j][k] -= m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[i][0][j];\n        for (k = 1; k < n; k++) {\n          if (a[i][k][j] < m)\n            m = a[i][k][j];\n          if (a[i][k][j] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][k][j] -= m;\n      }\n      s[i] += a[i][1][1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][k][j] = a[i][k][j + 1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      n--;\n    }\n  }\n  for (i = 0; i < d; i++)\n    cout << s[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "32866", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[101][101];\nint sum;\nvoid xiaochu(int n) {\n  if (n == 1)\n    ;\n  else {\n    int minj[101];\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (juzhen[i][j] < minj[i])\n          minj[i] = juzhen[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        juzhen[i][j] = juzhen[i][j] - minj[i];\n    }\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int j = 0; j < n; j++) {\n      for (int i = 0; i < n; i++) {\n        if (juzhen[i][j] < minj[j])\n          minj[j] = juzhen[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        juzhen[i][j] = juzhen[i][j] - minj[j];\n    }\n    sum = sum + juzhen[1][1];\n    for (int j = 1; j < n - 1; j++) {\n      juzhen[0][j] = juzhen[0][j + 1];\n      juzhen[j][0] = juzhen[j + 1][0];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i + 1][j + 1];\n    xiaochu(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    sum = 0;\n    xiaochu(n);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32867", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, p, ans;\n  int a[101][101], g;\n  cin >> n;\n  k = n;\n\n  while (k--) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    p = n;\n    while (p-- > 1) {\n      for (i = 0; i <= p; i++) {\n        g = *(*(a + i));\n        for (j = 0; j <= p; j++) {\n          if (*(*(a + i) + j) < g)\n            g = *(*(a + i) + j);\n        }\n        for (j = 0; j <= p; j++)\n          *(*(a + i) + j) -= g;\n      }\n      for (j = 0; j <= p; j++) {\n        g = *(*(a) + j);\n        for (i = 0; i <= p; i++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (i = 0; i <= p; i++)\n          *(*(a + i) + j) -= g;\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 2; i <= p; i++)\n        *(*(a + i - 1)) = *(*(a + i));\n      for (j = 2; j <= p; j++)\n        *(*(a) + j - 1) = *(*(a) + j);\n      for (i = 2; i <= p; i++)\n        for (j = 2; j <= p; j++)\n          *(*(a + i - 1) + j - 1) = *(*(a + i) + j);\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32868", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, sum, min, anw = 0;\n  int test[100][100];\n  cin >> n;\n  sum = n;\n  for (k = 0; k < sum; k++) {\n    n = sum;\n    for (i = 0; i < sum; i++)\n      for (j = 0; j < sum; j++) {\n        cin >> test[i][j];\n      }\n    anw = 0;\n    while (n != 1) {\n      for (i = 0; i < n; i++) {\n        min = test[i][0];\n        for (j = 0; j < n; j++) {\n          if (min > test[i][j])\n            min = test[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          test[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = test[0][i];\n        for (j = 0; j < n; j++) {\n          if (min > test[j][i])\n            min = test[j][i];\n        }\n        for (j = 0; j < n; j++) {\n          test[j][i] -= min;\n        }\n      }\n      anw += test[1][1];\n      n--;\n      for (i = 1; i < n; i++) {\n        for (j = 0; j <= n; j++)\n          test[i][j] = test[i + 1][j];\n      }\n      for (j = 1; j < n; j++) {\n        for (i = 0; i < n; i++)\n          test[i][j] = test[i][j + 1];\n      }\n    }\n    printf(\"%d\\n\", anw);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int n, int a[][101]);\nint Delete(int n, int a[][101]);\nint min(int a, int b);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n\n    Sum[i] = GL(n, a);\n  }\n\n  for (i = 0; i < n; i++)\n    cout << Sum[i] << endl;\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = a[i][0];\n    for (j = 1; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = a[0][j];\n    for (i = 1; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  Sum = a[1][1];\n\n  if (n != 2) {\n    Delete(n, a);\n    Sum = Sum + GL(n - 1, a);\n    return Sum;\n  }\n\n  else\n    return Sum;\n}\n\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[101][101] = {0};\n  int small[101] = {0};\n  int sum = 0;\n  int i, j, k, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++) \n    {\n      for (k = 1; k <= n - j + 1; k++) \n        small[k] = a[k][1];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          if (a[k][l] < small[k])\n            small[k] = a[k][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k][l] - small[k];\n\n      for (k = 1; k <= n - j + 1; k++) \n        small[k] = a[1][k];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          if (a[k][l] < small[l])\n            small[l] = a[k][l];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          a[k][l] = a[k][l] - small[l];\n\n      sum = sum + a[2][2];\n      for (k = 2; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k + 1][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 2; l <= n - j + 1; l++)\n          a[k][l] = a[k][l + 1];\n    }\n    cout << sum << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32871", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint findmin(int *a, int n, int step) {\n  int min = 32767;\n  while (n > 0) {\n    if (min > *a)\n      min = *a;\n    a += step;\n    n--;\n  }\n  return min;\n}\n\nint main() {\n  int n, k, a[100][100], i, j, l, sum, t;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (i = n; i >= 2; i--) {\n      for (j = 0; j < i; j++) {\n        t = findmin(a[j], i, 1);\n        for (l = 0; l < i; l++)\n          a[j][l] -= t;\n      }\n      for (j = 0; j < i; j++) {\n        t = findmin(&a[0][j], i, 100);\n        for (l = 0; l < i; l++)\n          a[l][j] -= t;\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < i - 1; j++) {\n        for (l = 0; l < i; l++)\n          a[j][l] = a[j + 1][l];\n        for (l = 0; l < i; l++)\n          a[l][j] = a[l][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, h, l, s = 0, n1;\n  cin >> n;\n  n1 = n;\n  int min1[100];\n  int min2[100];\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min1[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (min1[j] > a[j][k]) {\n            min1[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min1[j];\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min2[k] = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (min2[k] > a[j][k]) {\n            min2[k] = a[j][k];\n          }\n        }\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min2[k];\n        }\n      }\n      s = s + a[1][1];\n      for (m = 2; m < n; m++) {\n        a[0][m - 1] = a[0][m];\n        a[m - 1][0] = a[m][0];\n      }\n      for (h = 2; h < n; h++) {\n        for (l = 2; l < n; l++) {\n          a[h - 1][l - 1] = a[h][l];\n        }\n      }\n      n--;\n    }\n    cout << s << endl;\n    s = 0;\n    n = n1;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32873", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0};\nint n = 0;\nvoid find() {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n\n  int l = 0;\n  int m = 10000;\n\n  for (l = n; l > 1; l--) {\n    for (i = 0; i < l; i++) {\n      m = 10000;\n      for (j = 0; j < l; j++)\n        m = min(m, *(*(a + i) + j));\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    for (j = 0; j < l; j++) {\n      m = 10000;\n      for (i = 0; i < l; i++)\n        m = min(m, *(*(a + i) + j));\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    sum = sum + *(*(a + 1) + 1);\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i + 1) + j);\n    for (j = 1; j < l; j++)\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  cout << sum << endl;\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  int i;\n  for (i = 0; i < n; i++)\n    find();\n\n  return 0;\n}\n"}
{"label": "18", "index": "32874", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint a[100][100];\nint n;\n\nvoid scan(int m) {\n  int i, j;\n  for (i = 0; i <= m - 1; ++i) {\n    for (j = 0; j <= m - 1; ++j) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n}\n\nint minofc(int m) {\n  int i, min = a[m][0];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  return min;\n}\n\nint minofr(int m) {\n  int i, min = a[0][m];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  return min;\n}\n\nvoid tozero() {\n  int i, j;\n  for (i = 0; i <= n - 1; ++i) {\n    int min = minofc(i);\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    int min = minofr(j);\n    for (i = 0; i <= n - 1; ++i) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n}\n\nvoid eliminate() {\n  int i, j;\n  for (i = 1; i <= n - 2; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\n\nint main() {\n  cin >> n;\n  int p = n;\n  int i, j;\n  for (i = 1; i <= n; ++i) {\n    int sum = 0;\n    scan(n);\n    do {\n      tozero();\n      sum = sum + a[1][1];\n      eliminate();\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32875", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint a[100][100]; \nint xiao(int n)  \n{\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  return a[1][1];\n}\n\nvoid suo(int n) \n{\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return;\n}\n\nint main() \n{\n  int n, l, i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    int count = 0;          \n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    i = n;\n    while (i > 1) \n    {\n      count = count + xiao(i);\n      suo(i);\n      i--;\n    }\n    cout << count << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid zero(int array_1[100][100]);\nvoid subduction(int array_1[100][100]);\nint num, array_1[100][100];\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    num = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &array_1[i][j]);\n    for (i = 1; i < n; i++) {\n      zero(array_1);\n      sum = sum + array_1[1][1];\n      subduction(array_1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid zero(int array_1[100][100]) {\n  int i, j, minuend;\n  for (i = 0; i < num; i++) {\n    minuend = array_1[i][0];\n    for (j = 0; j < num; j++)\n      if (array_1[i][j] < minuend)\n        minuend = array_1[i][j];\n    for (j = 0; j < num; j++)\n      array_1[i][j] = array_1[i][j] - minuend;\n  }\n  for (i = 0; i < num; i++) {\n    minuend = array_1[0][i];\n    for (j = 0; j < num; j++)\n      if (array_1[j][i] < minuend)\n        minuend = array_1[j][i];\n    for (j = 0; j < num; j++)\n      array_1[j][i] = array_1[j][i] - minuend;\n  }\n};\n\nvoid subduction(int array_1[100][100]) {\n  int i, j;\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[i - 1][j] = array_1[i][j];\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[j][i - 1] = array_1[j][i];\n  num--;\n};\n"}
{"label": "18", "index": "32877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Min(int a[], int n) {\n  int i, min;\n  min = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] < min) {\n      min = a[i];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int n, i, N, dd1, dd2, j, min;\n  int row[100][100], col[100][100], sum[100];\n  scanf(\"%d\\n\", &n);\n  N = n;\n  for (i = 0; i < N; i++) {\n    for (dd1 = 0; dd1 < N; dd1++) {\n      for (dd2 = 0; dd2 < N; dd2++) {\n        cin >> row[dd1][dd2];\n      }\n    }\n    sum[i] = 0;\n    n = N;\n    for (j = 0; j < N - 1; j++) {\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(row[dd1], n) != 0) {\n          min = Min(row[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            row[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          col[dd2][dd1] = row[dd1][dd2];\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(col[dd1], n) != 0) {\n          min = Min(col[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            col[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          row[dd1][dd2] = col[dd2][dd1];\n        }\n      }\n      sum[i] += row[1][1];\n      for (dd1 = 0; dd1 < n - 1; dd1++) {\n        for (dd2 = 0; dd2 < n - 1; dd2++) {\n          if (dd1 >= 1 && dd2 == 0) {\n            row[dd1][dd2] = row[dd1 + 1][dd2];\n          }\n          if (dd2 >= 1 && dd1 == 0) {\n            row[dd1][dd2] = row[dd1][dd2 + 1];\n          }\n          if (dd1 >= 1 && dd2 >= 1) {\n            row[dd1][dd2] = row[dd1 + 1][dd2 + 1];\n          }\n        }\n      }\n      n--;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32878", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int q;\n  q = n;\n  int a[150][150], sum = 0, i, j, k, l, m, p, min;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (l = 1; l < n; l++) {\n          if (min > a[j][l])\n            min = a[j][l];\n        }\n        for (m = 0; m < n; m++) {\n          a[j][m] = a[j][m] - min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (l = 1; l < n; l++) {\n          if (min > a[l][j])\n            min = a[l][j];\n        }\n        for (m = 0; m < n; m++)\n          a[m][j] = a[m][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (p = 2; p < n; p++) {\n        a[0][p - 1] = a[0][p];\n        a[p - 1][0] = a[p][0];\n      }\n      for (j = 2; j < n; j++) {\n        for (l = 2; l < n; l++) {\n          a[j - 1][l - 1] = a[j][l];\n        }\n      }\n      n--;\n    }\n    cout << sum << endl;\n    sum = 0;\n    n = q;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32879", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int af = 1; af <= n; af++) {\n    int sum = 0;\n    int a[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    for (int tempn = n; tempn >= 2; tempn--) {\n\n      for (int i = 0; i <= tempn - 1; i++) {\n        int mini = a[i][0];\n        for (int j = 1; j <= tempn - 1; j++) {\n          if (mini > a[i][j])\n            mini = a[i][j];\n        }\n        for (int j = 0; j <= tempn - 1; j++)\n          a[i][j] -= mini;\n      }\n      for (int j = 0; j <= tempn - 1; j++) {\n        int minj = a[0][j];\n        for (int i = 1; i <= tempn - 1; i++) {\n          if (minj > a[i][j])\n            minj = a[i][j];\n        }\n        for (int i = 0; i <= tempn - 1; i++)\n          a[i][j] -= minj;\n      }\n      sum += a[1][1];\n      for (int i = 2; i <= tempn - 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int j = 2; j <= tempn - 1; j++)\n        a[0][j - 1] = a[0][j];\n      for (int i = 2; i <= tempn - 1; i++) {\n        for (int j = 2; j <= tempn - 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "32880", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000 * sizeof(int));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32881", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint str[101][101];\n\nint main() {\n  int n, sum;\n  void oper1(int);\n  void oper2(int);\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> str[i][j];\n    sum = 0;\n    for (int i = n; i > 1; i--) {\n      oper1(i);\n      sum += str[1][1];\n      oper2(i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid oper1(int n) {\n  int i, j, min;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    min = str[i][0];\n    for (j = 1; j < n; j++)\n      if (str[i][j] < min) {\n        min = str[i][j];\n      }\n    for (j = 0; j < n; j++)\n      str[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = str[0][j];\n    for (i = 1; i < n; i++)\n      if (str[i][j] < min)\n        min = str[i][j];\n    for (i = 0; i < n; i++)\n      str[i][j] -= min;\n  }\n}\nvoid oper2(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\n"}
{"label": "18", "index": "32882", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0, r_small[100] = {0}, c_small[100] = {0};\n\nint fun(int num[][100], int n);\n\nvoid small1(int num[][100], int n);\n\nvoid small2(int num[][100], int n);\n\nint main() {\n  int n, i, j, num[100][100];\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    fun(num, n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n\nint fun(int num[][100], int n) {\n  if (n == 1)\n    return sum;\n  int i, j;\n  small1(num, n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - r_small[i];\n  small2(num, n);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - c_small[j];\n  sum += num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      num[i][j] = num[i + 1][j];\n  fun(num, n - 1);\n}\n\nvoid small1(int num[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    r_small[i] = num[i][0];\n    for (j = 1; j < n; j++)\n      r_small[i] = (r_small[i] < num[i][j]) ? r_small[i] : num[i][j];\n  }\n}\n\nvoid small2(int num[][100], int n) {\n  int i, j;\n  for (j = 0; j < n; j++) {\n    c_small[j] = num[0][j];\n    for (i = 1; i < n; i++)\n      c_small[j] = (c_small[j] < num[i][j]) ? c_small[j] : num[i][j];\n  }\n}\n"}
{"label": "18", "index": "32883", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint arr[100][100];\nvoid solve(int n);      \nvoid arrayin(int n);    \nint down_cast(int n);   \nvoid matrix_out(int n); \nint main(int argc, char **argv) {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    solve(n);\n  return 0;\n}\nvoid arrayin(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> arr[i][j];\n    }\n  }\n}\nvoid solve(int n) {\n  arrayin(n);\n  cout << down_cast(n) << endl;\n}\nint down_cast(int n) {\n  if (n == 1)\n    return 0;\n  int min, res;\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[i][j] < min)\n        min = arr[i][j];\n    for (int j = 0; j < n; j++)\n      arr[i][j] -= min;\n  } \n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[j][i] < min)\n        min = arr[j][i];\n    for (int j = 0; j < n; j++)\n      arr[j][i] -= min;\n  } \n  res = arr[1][1];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[i - 1][j] = arr[i][j];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[j][i - 1] = arr[j][i];\n  \n  return res + down_cast(n - 1); \n}\nvoid matrix_out(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cout << arr[i][j] << \" \";\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "18", "index": "32884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, time = 0, sum = 0;\n  scanf(\"%d \", &n);\n  int s = n;\n  int a[100][100], b[100], c[100];\n  for (time = 0; time < s; time++) {\n    for (i = 0; i < 100; i++) {\n      b[i] = 1000000;\n      c[i] = 1000000;\n    }\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < s; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    sum = 0;\n    while (true) {\n      for (i = 0; i < 100; i++) {\n        b[i] = 1000000;\n        c[i] = 1000000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < b[i]) {\n            b[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - b[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < c[j]) {\n            c[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] = a[i][j] - c[j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < n - 1; j++) {\n        for (i = 0; i < n - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      n = n - 1;\n      if (n == 1) {\n        n = s;\n        break;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a[100][100], min = 0, sum[100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum[k] = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (l = 1; l <= n - 1; l++) {\n      for (i = 0; i <= n - l; i++) {\n        min = a[i][0];\n        for (j = 1; j <= n - l; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j <= n - l; j++) {\n        min = a[0][j];\n        for (i = 1; i <= n - l; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n\n      {\n        for (j = 0; j <= n - l; j++) {\n          for (i = 1; i <= n - l - 1; i++)\n            a[i][j] = a[i + 1][j];\n        }\n        for (i = 0; i <= n - l - 1; i++) {\n          for (j = 1; j <= n - l - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n  }\n  for (k = 1; k <= n; k++)\n    cout << sum[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "32886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, min, sum = 0;\n  scanf(\"%d\", &n);\n  k = m = n;\n  while (k--) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        min = a[i][0];\n        for (j = 0; j <= m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[i][j] -= min;\n        }\n      }\n      for (i = 0; i <= m; i++) {\n        min = a[0][i];\n        for (j = 0; j <= m; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[j][i] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < m; i++)\n        a[0][i] = a[0][i + 1];\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    m = n;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint zhi(int num[][100], int n);\nint main() {\n  int in, i, j, k, cal[100][100] = {0};\n  cin >> in;\n  for (k = 0; k < in; k++) {\n    for (i = 0; i < in; i++)\n      for (j = 0; j < in; j++)\n        cin >> cal[i][j];\n    printf(\"%d\\n\", zhi(cal, in));\n  }\n  return 0;\n}\nint zhi(int num[][100], int n) {\n  int i, j, min[100], sum = 0, temp;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min[i] = num[i][0];\n    for (j = 0; j < n; j++)\n      if (num[i][j] < min[i])\n        min[i] = num[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - min[i];\n  for (j = 0; j < n; j++) {\n    min[j] = num[0][j];\n    for (i = 0; i < n; i++)\n      if (num[i][j] < min[j])\n        min[j] = num[i][j];\n  }\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - min[j];\n  temp = num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      num[i][j] = num[i + 1][j];\n  sum = zhi(num, n - 1) + temp;\n  return sum;\n}\n"}
{"label": "18", "index": "32888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[120][120];\nint math(int);\nint n;\nint main() {\n  int sum, b, c;\n  scanf(\"%d \", &n);\n  c = n;\n  while (c--) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = math(n);\n\n    b = n;\n    while (b--) {\n      for (int i = 2; i < b + 1; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < b + 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int i = 2; i < b + 1; i++)\n        for (int j = 2; j < b + 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      if (b == 1)\n        break;\n      sum = math(b) + sum;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\nint math(int x) {\n  int min[x];\n  for (int i = 0; i < x; i++)\n    min[i] = a[i][0];\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - min[i];\n\n  int minl[x];\n  for (int i = 0; i < x; i++)\n    minl[i] = a[0][i];\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[j][i] < minl[i])\n        minl[i] = a[j][i];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - minl[j];\n\n  return a[1][1];\n}\n"}
{"label": "18", "index": "32889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100], n;\n\nint sum(int n) {\n  if (n == 1)\n    return 0;\n  else {\n    int i, j, m;\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[i][j] < m)\n          m = a[i][j];\n      for (j = 0; j < n; ++j)\n        a[i][j] -= m;\n    }\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[j][i] < m)\n          m = a[j][i];\n      for (j = 0; j < n; ++j)\n        a[j][i] -= m;\n    }\n    int num = a[1][1];\n    for (i = 0; i < n; ++i)\n      for (j = 2; j < n; ++j)\n        a[i][j - 1] = a[i][j];\n    for (i = 0; i < n - 1; ++i)\n      for (j = 2; j < n; ++j)\n        a[j - 1][i] = a[j][i];\n    return num + sum(n - 1);\n  }\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> a[i][j];\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[101][101][101];\nint countsum;\nvoid cal(int rank, int num) {\n  if (rank != 1) {\n\n    int rowmin[rank];\n    int columnmin[rank];\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          rowmin[i] = matrix[num][i][j];\n        else\n          rowmin[i] = min(rowmin[i], matrix[num][i][j]);\n      }\n      if (rowmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][i][j] = matrix[num][i][j] - rowmin[i];\n    }\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          columnmin[i] = matrix[num][j][i];\n        else\n          columnmin[i] = min(columnmin[i], matrix[num][j][i]);\n      }\n      if (columnmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][j][i] = matrix[num][j][i] - columnmin[i];\n    }\n    countsum += matrix[num][1][1];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][j][i - 1] = matrix[num][j][i];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][i - 1][j] = matrix[num][i][j];\n    cal(rank - 1, num);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i <= n - 1; ++i)\n    for (int j = 0; j <= n - 1; ++j)\n      for (int k = 0; k <= n - 1; ++k)\n        cin >> matrix[i][j][k];\n  for (int i = 0; i <= n - 1; ++i) {\n    countsum = 0;\n    cal(n, i);\n    cout << countsum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, r, a[101][101], min, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    r = n;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int l = 1; l <= n - 2; l++) {\n      for (int i = 1; i <= r; i++) {\n        min = a[i][1];\n        for (int j = 1; j <= r; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (int i = 1; i <= r; i++) {\n        min = a[1][i];\n        for (int j = 1; j <= r; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum += a[2][2];\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r - 1; j++) {\n          a[j][i] = a[j][i + 1];\n        }\n      }\n      r--;\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= 2; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= 2; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum += a[2][2];\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32892", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int matrix[100][100];\n\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> matrix[j][k];\n    for (int m = n; m > 1; m--) {\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[j][0];\n        for (int k = 1; k < m; k++) {\n          if (matrix[j][k] < min)\n            min = matrix[j][k];\n        }\n        for (int k = 0; k < m; k++)\n          matrix[j][k] -= min;\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[0][j];\n        for (int k = 1; k < m; k++) {\n          if (matrix[k][j] < min) {\n            min = matrix[k][j];\n          }\n        }\n        for (int k = 0; k < m; k++)\n          matrix[k][j] -= min;\n      }\n\n      sum += matrix[1][1];\n      for (int i = 1; i < m; i++) {\n        for (int j = 1; j < m; j++)\n          matrix[i][j] = matrix[i + 1][j + 1];\n        matrix[0][i] = matrix[0][i + 1];\n        matrix[i][0] = matrix[i + 1][0];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, p, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (p = n; p >= 1; p--) {\n      for (i = 0; i <= p; i++) {\n        a[0][i] = 99999;\n        a[i][0] = 99999;\n      }\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[i][0] > a[i][j])\n            a[i][0] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[i][0];\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[0][j] > a[i][j])\n            a[0][j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[0][j];\n      sum += a[2][2];\n      for (i = 1; i <= p; i++) {\n        a[2][i] = 0;\n        a[i][2] = 0;\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 3; j <= p; j++)\n          a[i][j - 1] = a[i][j];\n      for (i = 3; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i - 1][j] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, number[100][100], i, p, o, u, count, min;\n  scanf(\"%d\", &n);\n  for (o = 0; o < n; o++) {\n    for (i = 0; i < n; i++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d\", &number[i][p]);\n      }\n    }\n    count = 0;\n    for (u = 0; u < n - 1; u++) {\n      for (i = 0; i < n - u; i++) {\n        min = 999999;\n        for (p = 0; p < n - u; p++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (p = 0; p < n - u; p++) {\n          number[i][p] -= min;\n        }\n      }\n      for (p = 0; p < n - u; p++) {\n        min = 999999;\n        for (i = 0; i < n - u; i++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (i = 0; i < n - u; i++) {\n          number[i][p] -= min;\n        }\n      }\n      count += number[1][1];\n      for (i = 1; i < n - u - 1; i++) {\n        number[i][0] = number[i + 1][0];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        number[0][p] = number[0][p + 1];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        for (i = 1; i < n - u - 1; i++) {\n          number[i][p] = number[i + 1][p + 1];\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32895", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, n, sum = 0, k, l, min;\n  cin >> n;\n  for (k = 1; k <= n; k++) \n  {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (l = 1; l < n; l++) \n    {\n      for (i = 0; i < n; i++) \n      {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) \n      {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32896", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100][2];\n  for (int p = 1; p <= n; p++) {\n    int sum = 0;\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j][1];\n        a[i][j][0] = 1;\n      }\n    }\n    for (int q = 1; q <= n - 1; q++) {\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[i][0][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          if (a[i][j][1] < min)\n            min = a[i][j][1];\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          a[i][j][1] -= min;\n        }\n      }\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[0][i][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          if (a[j][i][1] < min) {\n            min = a[j][i][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          a[j][i][1] -= min;\n        }\n      }\n      sum += a[q][q][1];\n      for (int i = 0; i <= n - 1; i++) {\n        a[q][i][0] = 0;\n        a[i][q][0] = 0;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32897", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint a[100][100]; \n\nint smaller(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Sum(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      min = smaller(min, a[i][j]); \n    for (int j = 0; j < n; j++)\n      a[i][j] -= min; \n  }\n  for (int j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (int i = 0; i < n; i++)\n      min = smaller(min, a[i][j]); \n    for (int i = 0; i < n; i++)\n      a[i][j] -= min; \n  }\n  if (n == 2) \n    return a[1][1];\n  int k = a[1][1];\n  for (int i = 1; i < n - 1; i++) \n  {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1); \n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << Sum(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cut(int num[100][100], int n) {\n  int m = 0, i = 0, k = 0, sum = 0, j = 0;\n  int l[100], s[100];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      l[j] = 0;\n      s[j] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      if (num[j][0] >= 0) {\n        l[j] = num[j][0];\n        for (k = 0; k < n; k++) {\n          if (num[j][k] >= 0 && num[j][k] < l[j])\n            l[j] = num[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          num[j][k] = num[j][k] - l[j];\n        }\n      }\n    }\n    cout << endl;\n    for (j = 0; j < n; j++) {\n      if (num[0][j] >= 0) {\n        s[j] = num[0][j];\n        for (k = 0; k < n; k++) {\n          if (num[k][j] >= 0 && num[k][j] < s[j])\n            s[j] = num[k][j];\n        }\n        for (k = 0; k < n; k++) {\n          num[k][j] = num[k][j] - s[j];\n        }\n      }\n    }\n    sum = sum + num[i][i];\n    for (j = 0; j < n; j++) {\n      num[i][j] = -10;\n      num[j][i] = -10;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, sum = 0;\n  int num[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < 100; j++)\n      for (k = 0; k < 100; k++)\n        num[j][k] = -10;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> num[j][k];\n    sum = cut(num, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32899", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, m = 0;\n  cin >> n;\n\n  for (t = 0; t < n; t++) {\n    int arr[100][100];\n    int i = 0, j = 0, k = 0, sum = 0, m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> arr[i][j];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        int min = arr[j][0];\n        for (k = 0; k < m; k++)\n          if (arr[j][k] < min)\n            min = arr[j][k];\n        for (k = 0; k < m; k++)\n          arr[j][k] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        int min = arr[0][j];\n        for (k = 0; k < m; k++)\n          if (arr[k][j] < min)\n            min = arr[k][j];\n        for (k = 0; k < m; k++)\n          arr[k][j] -= min;\n      }\n      sum += arr[1][1];\n      for (j = 2; j < m; j++) {\n        arr[0][j - 1] = arr[0][j];\n        arr[j - 1][0] = arr[j][0];\n      }\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++) {\n          arr[j - 1][k - 1] = arr[j][k];\n        }\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, k, l, tot = 0;\nint sum(int a[][101], int n) {\n  if (n == 1) {\n    return tot;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    l = a[i][0];\n    for (j = 0; j <= n - 2; j++) {\n      l = min(l, a[i][j + 1]);\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[i][j] -= l;\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    l = a[0][j];\n    for (i = 0; i <= n - 2; i++) {\n      l = min(l, a[i + 1][j]);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      a[i][j] -= l;\n    }\n  }\n  tot += a[1][1];\n  for (i = 1; i <= n - 2; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 1; i <= n - 2; i++) {\n    a[i][0] = a[i + 1][0];\n  }\n  for (j = 1; j <= n - 2; j++) {\n    a[0][j] = a[0][j + 1];\n  }\n  n--;\n  sum(a, n);\n}\nint main() {\n  int a[101][101];\n  int n;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    cout << sum(a, n) << endl;\n    tot = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32901", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[110][110];\nint size;\nint zero();\nint main() {\n  int n, i;\n  int x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    size = n;\n    for (x = 0; x < n; x++)\n      for (y = 0; y < n; y++)\n        cin >> a[x][y];\n    int sum = 0;\n    for (x = 1; x <= n - 1; x++)\n      sum += zero();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint zero() {\n  int x, y, temp;\n  for (x = 0; x < size; x++) {\n    for (y = 1, temp = a[x][0]; y < size; y++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (y = 0; y < size; y++)\n      a[x][y] -= temp;\n  }\n  for (y = 0; y < size; y++) {\n    for (x = 1, temp = a[0][y]; x < size; x++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (x = 0; x < size; x++)\n      a[x][y] -= temp;\n  }\n  temp = a[1][1];\n  for (x = 1; x < size - 1; x++)\n    for (y = 0; y < size; y++)\n      a[x][y] = a[x + 1][y];\n  for (y = 1; y < size - 1; y++)\n    for (x = 0; x < size - 1; x++)\n      a[x][y] = a[x][y + 1];\n  size -= 1;\n  return temp;\n}\n"}
{"label": "18", "index": "32902", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ma[120][120];\n  int i;\n  int j;\n  int sum[120];\n  int time;\n  int t;\n  int n;\n  int min[120];\n  cin >> n;\n  for (t = 0; t <= n - 1; t++) {\n\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> ma[i][j];\n\n    sum[t] = 0;\n    for (time = n - 1; time >= 1; time--) {\n      for (i = 0; i <= time; i++) {\n        min[i] = ma[i][0];\n        for (j = 0; j <= time; j++)\n          if (min[i] > ma[i][j])\n            min[i] = ma[i][j];\n        for (j = 0; j <= time; j++)\n          ma[i][j] = ma[i][j] - min[i];\n      }\n      for (j = 0; j <= time; j++) {\n        min[j] = ma[0][j];\n        for (i = 0; i <= time; i++)\n          if (min[j] > ma[i][j])\n            min[j] = ma[i][j];\n        for (i = 0; i <= time; i++)\n          ma[i][j] = ma[i][j] - min[j];\n      }\n\n      sum[t] = sum[t] + ma[1][1];\n      if (time >= 2) {\n        for (i = 1; i <= time - 1; i++)\n          for (j = 0; j <= time; j++)\n            ma[i][j] = ma[i + 1][j];\n        for (j = 1; j <= time - 1; j++)\n          for (i = 0; i <= time; i++)\n            ma[i][j] = ma[i][j + 1];\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 2; i++)\n    cout << sum[i] << endl;\n  printf(\"%d\", sum[n - 1]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32903", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint array_1[101][101];\nint search_x(int k) {\n  int i, j;\n  int t = 1000;\n  for (j = 0; j < n; j++)\n    if (*(*(array_1 + 0) + j) < t)\n      t = *(*(array_1 + 0) + j);\n  for (j = 0; j < n; j++)\n    *(*(array_1 + 0) + j) = *(*(array_1 + 0) + j) - t;\n\n  for (i = k; i < n; i++) {\n    t = 1000;\n    for (j = 0; j < n; j++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (j = 0; j < n; j++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint search_y(int k) {\n  int i, j;\n  int t = 1000;\n  for (i = 0; i < n; i++)\n    if (*(*(array_1 + i) + 0) < t)\n      t = *(*(array_1 + i) + 0);\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + 0) = *(*(array_1 + i) + 0) - t;\n  for (j = k; j < n; j++) {\n    t = 1000;\n    for (i = 0; i < n; i++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (i = 0; i < n; i++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint change(int k) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + k) = 1000;\n  for (j = 0; j < n; j++)\n    *(*(array_1 + k) + j) = 1000;\n  return 0;\n}\nint main() {\n\n  int i, j, k, w;\n  int num;\n  scanf(\"%d \", &n);\n  for (w = 0; w < n; w++) {\n    num = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(array_1 + i) + j);\n\n    for (k = 0; k < n; k++) {\n      search_x(k + 1);\n      search_y(k + 1);\n      num = num + *(*(array_1 + k + 1) + k + 1);\n      change(k + 1);\n    }\n\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int sum;\n  int min;\n  cin >> n;\n  int m[n][n][n];\n  for (int k = 0; k < n; k++) {\n    for (int x = 0; x < n; x++) {\n      for (int y = 0; y < n; y++)\n        cin >> m[k][x][y];\n    }\n\n    sum = 0;\n\n    for (int l = 1; l < n; l++) {\n\n      for (int x = 0; x < n; x++) {\n        min = *min_element(m[k][x], m[k][x] + n);\n        for (int y = 0; y < n; y++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      for (int y = 0; y < n; y++) {\n        min = m[k][0][y];\n        for (int x = 1; x < n; x++) {\n          if (m[k][x][y] < min)\n            min = m[k][x][y];\n        }\n        for (int x = 0; x < n; x++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      sum += m[k][l][l];\n\n      for (int i = 0; i < n; i++) {\n        m[k][l][i] = m[k][0][i];\n        m[k][i][l] = m[k][i][0];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint zero(int n, int sum) {\n  if (n != 1) {\n    int min, i, j, array[n][n];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        array[i][j] = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[i][0];\n      for (j = 1; j < n; j++) {\n        if (array[i][j] < min) {\n          min = array[i][j];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[i][j] = array[i][j] - min;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = array[0][i];\n      for (j = 1; j < n; j++) {\n        if (array[j][i] < min) {\n          min = array[j][i];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[j][i] = array[j][i] - min;\n        }\n      }\n    }\n    sum = sum + array[1][1];\n    for (i = 0; i < n; i++) {\n      for (j = 1; j < n - 1; j++) {\n        a[i][j] = array[i][j] = array[i][j + 1];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 1; j < n - 1; j++) {\n        array[j][i] = array[j + 1][i];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 0; j < n - 1; j++) {\n        a[i][j] = array[i][j];\n      }\n    }\n    return zero(n - 1, sum);\n  }\n  if (n == 1)\n    return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0, i, t, r;\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n; t++) {\n      for (r = 0; r < n; r++) {\n        cin >> a[t][r];\n      }\n    }\n    cout << zero(n, sum) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32906", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s, i, j;\n  for (s = 1; s <= n; s++) {\n    int b = n, yi = 0, min = 10000;\n    int a[110][110] = {0};\n    int c = 2;\n    int bi[110] = {0}, bj[110] = {0};\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (b = n; b >= 2; b--) {\n      for (i = 1; i <= n; i++) {\n        if (bi[i] == 1)\n          continue;\n        for (j = 1; j <= n; j++) {\n          if ((bj[j] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 1; j <= n; j++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (bj[j] == 1)\n          continue;\n        for (i = 1; i <= n; i++) {\n          if ((bi[i] == 0) && (a[i][j] <= min)) {\n            min = a[i][j];\n          }\n        }\n        if (min != 0) {\n          for (i = 1; i <= n; i++)\n            a[i][j] = a[i][j] - min;\n        }\n        min = 100000;\n      }\n      yi = yi + a[c][c];\n      bi[c] = 1;\n      bj[c] = 1;\n      min = 10000;\n      c++;\n    }\n    cout << yi << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32907", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint matrixHor[103][103];\nint matrixVer[103][103];\n\nint min(int line[], int n) {\n  int mini = 100000;\n  for (int i = 1; i <= n; i++) {\n    if (line[i] < mini) {\n      mini = line[i];\n    }\n  }\n  return mini;\n}\nint main() {\n  int n, N;\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    int sum = 0;\n    N = n;\n    for (int j = 1; j <= N; j++) {\n      for (int k = 1; k <= N; k++) {\n        cin >> matrixVer[j][k];\n        matrixHor[k][j] = matrixVer[j][k];\n      }\n    }\n    for (int h = 1; h < n; h++) {\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixVer[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j][k] - minim;\n          matrixHor[k][j] = matrixVer[j][k];\n        }\n      }\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixHor[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixHor[j][k] = matrixHor[j][k] - minim;\n          matrixVer[k][j] = matrixHor[j][k];\n        }\n      }\n      sum = sum + matrixVer[2][2];\n      N = N - 1;\n      for (int j = 2; j <= N; j++) {\n        for (int k = 2; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j + 1][k + 1];\n          matrixHor[j][k] = matrixHor[j + 1][k + 1];\n        }\n      }\n      for (int j = 2; j <= N; j++) {\n        matrixHor[1][j] = matrixHor[1][j + 1];\n        matrixVer[j][1] = matrixHor[1][j];\n        matrixVer[1][j] = matrixVer[1][j + 1];\n        matrixHor[j][1] = matrixVer[1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a[101][101], mini[101], minj[101], ans[101];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    memset(a, 0, sizeof(a));\n    memset(ans, 0, sizeof(ans));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      memset(mini, 21474836, sizeof(mini));\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          if (a[i][j] < mini[i])\n            mini[i] = a[i][j];\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j] - mini[i];\n      memset(minj, 21474836, sizeof(minj));\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          if (a[i][j] < minj[j])\n            minj[j] = a[i][j];\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i][j] - minj[j];\n\n      ans[k] = ans[k] + a[2][2];\n      for (i = 2; i <= m; i++)\n        a[i][1] = a[i + 1][1];\n      for (j = 2; j <= m; j++)\n        a[1][j] = a[1][j + 1];\n      for (i = 2; i <= m; i++)\n        for (j = 2; j <= m; j++)\n          a[i][j] = a[i + 1][j + 1];\n      m--;\n    }\n    cout << ans[k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32909", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[100][100], int n);\n  int n, a[100][100], i, j, k, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    s = f(a, n);\n    printf(\"%d\\n\", s);\n  }\n}\n\nint f(int a[100][100], int n) {\n  int i, j, k, min[100], s = 0;\n  for (i = 0; i < n; i++) {\n    min[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] -= min[j];\n  }\n  if (n == 2)\n    s = a[1][1];\n  else {\n    k = a[1][1];\n    for (j = 1; j < n - 1; j++)\n      a[0][j] = a[0][j + 1];\n    for (i = 1; i < n - 1; i++)\n      a[i][0] = a[i + 1][0];\n    for (i = 1; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i + 1][j + 1];\n    s = k + f(a, n - 1);\n  }\n  return s;\n}\n"}
{"label": "18", "index": "32910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint zero(int);\nvoid reduce(int);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << zero(n) << endl;\n  }\n  return 0;\n}\nint zero(int count) {\n  int i, j, sum = 0;\n  while (count >= 2) {\n    for (i = 0; i < count; i++) {\n      int min = a[i][0];\n      for (j = 1; j < count; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < count; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < count; i++) {\n      int min = a[0][i];\n      for (j = 1; j < count; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < count; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    reduce(count);\n    count--;\n  }\n  return sum;\n}\nvoid reduce(int count) {\n  for (int i = 1; i < count - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < count - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "32911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, N, sum = 0, min;\n  scanf(\"%d \", &n);\n  int jz[n][n][n];\n  int i, j, k, t;\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    N = n;\n\n    for (t = 1; t < n; t++) {\n\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i + 1][j];\n        }\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < n; i++)\n          jz[k][i][j] = jz[k][i][j + 1];\n      }\n\n      N = N - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0, r_small[100] = {0}, c_small[100] = {0};\n\nint fun(int num[][100], int n);\n\nvoid small1(int num[][100], int n);\n\nvoid small2(int num[][100], int n);\n\nint main() {\n  int n, i, j, num[100][100];\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    fun(num, n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n\nint fun(int num[][100], int n) {\n  if (n == 1)\n    return sum;\n  int i, j;\n  small1(num, n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - r_small[i];\n  small2(num, n);\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - c_small[j];\n  sum += num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      num[i][j] = num[i + 1][j];\n  }\n  fun(num, n - 1);\n}\n\nvoid small1(int num[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    r_small[i] = num[i][0];\n    for (j = 1; j < n; j++)\n      r_small[i] = (r_small[i] < num[i][j]) ? r_small[i] : num[i][j];\n  }\n}\n\nvoid small2(int num[][100], int n) {\n  int i, j;\n  for (j = 0; j < n; j++) {\n    c_small[j] = num[0][j];\n    for (i = 1; i < n; i++)\n      c_small[j] = (c_small[j] < num[i][j]) ? c_small[j] : num[i][j];\n  }\n}\n"}
{"label": "18", "index": "32913", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid matrix_down(int a[150][150], int large) {\n  int v, r;\n  for (v = 0; v <= large - 1; v++) {\n    int minl;\n    minl = a[v][0];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[v][r] <= minl) {\n        minl = a[v][r];\n      }\n      if (a[v][r] == 0) {\n        minl = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[v][r] = a[v][r] - minl;\n    }\n  }\n  for (v = 0; v <= large - 1; v++) {\n    int minr;\n    minr = a[0][v];\n    for (r = 1; r <= large - 1; r++) {\n      if (a[r][v] <= minr) {\n        minr = a[r][v];\n      }\n      if (a[r][v] == 0) {\n        minr = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) {\n      a[r][v] = a[r][v] - minr;\n    }\n  }\n}\n\nvoid matrix_short(int a[150][150], int large) {\n  int i, r;\n  for (i = 1; i <= large - 2; i++) {\n    for (r = 1; r <= large - 2; r++) {\n      a[i][r] = a[i + 1][r + 1];\n    }\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n\nint main() {\n  int n, i, u, v, r, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[150][150] = {0};\n    int sum = 0;\n    for (u = 0; u <= n - 1; u++) {\n      for (v = 0; v <= n - 1; v++) {\n        cin >> a[u][v];\n      }\n    }\n    for (u = n; u >= 2; u--) {\n      matrix_down(a, u);\n      sum = a[1][1] + sum;\n      matrix_short(a, u);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint hang(int a[], int n, int h) {\n  int m = a[0];\n  for (int i = h; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return (m);\n}\nint lie(int a[][110], int n, int j, int h) {\n  int m = a[0][j];\n  for (int i = h; i < n; i++)\n    if (a[i][j] < m)\n      m = a[i][j];\n  return (m);\n}\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int i, j, h, s = 0, hm, lm, a[110][110] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (h = 1; h < n; h++) {\n      hm = hang(a[0], n, h);\n      a[0][0] -= hm;\n      for (j = h; j < n; j++)\n        a[0][j] -= hm;\n      for (i = h; i < n; i++) {\n        hm = hang(a[i], n, h);\n        a[i][0] -= hm;\n        for (j = h; j < n; j++)\n          a[i][j] -= hm;\n      }\n      lm = lie(a, n, 0, h);\n      a[0][0] -= lm;\n      for (i = h; i < n; i++)\n        a[i][0] -= lm;\n      for (j = h; j < n; j++) {\n        lm = lie(a, n, j, h);\n        a[0][j] -= lm;\n        for (i = h; i < n; i++)\n          a[i][j] -= lm;\n      }\n      s += a[h][h];\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "32915", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum, a[101][101];\nvoid g0(int n) {\n  if (n == 1)\n    return;\n  else {\n    int min;\n    for (int i = 1; i <= n; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[i][j] ? min : a[i][j];\n      for (int j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (int i = 1; i <= n; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[j][i] ? min : a[j][i];\n      for (int j = 1; j <= n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[2][2];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[i][j] = a[i + 1][j];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n  g0(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    g0(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32916", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint N, A[213][213], Sum;\nvoid Work() {\n  memset(A, 0, sizeof(A));\n  Sum = 0;\n  for (int I = 1; I <= N; I++)\n    for (int J = 1; J <= N; J++)\n      cin >> A[I][J];\n  for (int K = 1; K <= N - 1; K++) {\n    int Min = A[1][1];\n    for (int J = K + 1; J <= N; J++)\n      if (A[1][J] < Min)\n        Min = A[1][J];\n    A[1][1] -= Min;\n    for (int J = K + 1; J <= N; J++)\n      A[1][J] -= Min;\n    for (int I = K + 1; I <= N; I++) {\n      int Min = A[I][1];\n      for (int J = K + 1; J <= N; J++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int J = 1; J <= N; J++)\n        A[I][J] -= Min;\n    }\n    Min = A[1][1];\n    for (int I = K + 1; I <= N; I++)\n      if (A[I][1] < Min)\n        Min = A[I][1];\n    A[1][1] -= Min;\n    for (int I = K + 1; I <= N; I++)\n      A[I][1] -= Min;\n    for (int J = K + 1; J <= N; J++) {\n      int Min = A[1][J];\n      for (int I = K + 1; I <= N; I++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int I = 1; I <= N; I++)\n        A[I][J] -= Min;\n    }\n    Sum += A[K + 1][K + 1];\n  }\n  cout << Sum << endl;\n}\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    Work();\n}\n"}
{"label": "18", "index": "32917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, n1, p, q;\nint matrix(int a[][101]);\nint mi(int a[]);\nvoid xiao(int a[][101]);\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    n1 = n;\n    int a[101][101];\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        cin >> a[p][q];\n    cout << matrix(a) << endl;\n  }\n  return 0;\n}\nint matrix(int a[][101]) {\n  int i, j, sum = 0;\n  int smin[101], dmin[101], t[101][101];\n\n  for (i = 0; i < n1; i++)\n    smin[i] = mi(a[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (smin[i] != 0)\n        a[i][j] -= smin[i];\n\n  for (j = 0; j < n1; j++)\n    for (i = 0; i < n1; i++)\n      t[j][i] = a[i][j];\n  for (i = 0; i < n1; i++)\n    dmin[i] = mi(t[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (dmin[i] != 0)\n        a[j][i] -= dmin[i];\n  sum = a[1][1];\n  if (n1 == 2)\n    return a[1][1];\n  xiao(a);\n  n1--;\n  sum = sum + matrix(a);\n  return sum;\n}\nint mi(int a[]) {\n  int i, min = a[0];\n  for (i = 0; i < n1; i++)\n    if (a[i] <= min)\n      min = a[i];\n  return min;\n}\nvoid xiao(int a[][101]) {\n  int i, j;\n  for (i = 1; i < n1; i++)\n    a[0][i] = a[0][i + 1];\n  a[0][i] = 0;\n  for (j = 1; j < n1; j++) {\n    for (i = 1; i < n1; i++)\n      a[j][i] = a[j + 1][i + 1];\n    a[j][i] = 0;\n  }\n  for (i = 1; i < n1; i++)\n    a[i][0] = a[i + 1][0];\n\n  for (i = 0; i < n1; i++)\n    a[n - 1][i] = 0;\n}\n"}
{"label": "18", "index": "32918", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a[100][100], min = 0, sum[100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum[k] = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (l = 1; l <= n - 1; l++) {\n      for (i = 0; i <= n - l; i++) {\n        min = a[i][0];\n        for (j = 1; j <= n - l; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j <= n - l; j++) {\n        min = a[0][j];\n        for (i = 1; i <= n - l; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n\n      {\n        for (j = 0; j <= n - l; j++) {\n          for (i = 1; i <= n - l - 1; i++)\n            a[i][j] = a[i + 1][j];\n        }\n        for (i = 0; i <= n - l - 1; i++) {\n          for (j = 1; j <= n - l - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n  }\n  for (k = 1; k <= n; k++)\n    printf(\"%d\\n\", sum[k]);\n  return 0;\n}\n"}
{"label": "18", "index": "32919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, array_1[101][101], sum[101] = {0}, k;\nvoid cut(int m) {\n  int p, q, min;\n  for (p = 0; p < n - m; p++) {\n    min = array_1[p][0];\n    for (q = 1; q < n - m; q++)\n      if (array_1[p][q] < min)\n        min = array_1[p][q];\n    for (q = 0; q < n - m; q++)\n      array_1[p][q] = array_1[p][q] - min;\n  }\n  for (p = 0; p < n - m; p++) {\n    min = array_1[0][p];\n    for (q = 1; q < n - m; q++)\n      if (array_1[q][p] < min) {\n        min = array_1[q][p];\n      }\n    for (q = 0; q < n - m; q++)\n      array_1[q][p] = array_1[q][p] - min;\n  }\n  sum[k] = sum[k] + array_1[1][1];\n  for (p = 1; p < n - m - 1; p++) {\n    array_1[0][p] = array_1[0][p + 1];\n    array_1[p][0] = array_1[p + 1][0];\n  }\n  for (p = 1; p < n - m - 1; p++)\n    for (q = 1; q < n - m - 1; q++)\n      array_1[p][q] = array_1[p + 1][q + 1];\n}\nint main() {\n  int i, j;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &array_1[i][j]);\n    for (i = 0; i < n - 1; i++)\n      cut(i);\n  }\n  for (k = 0; k < n; k++)\n    printf(\"%d\", sum[k]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int sum = 0;\n    for (int size = n; size >= 2; size--) {\n      for (int i = 0; i < size; i++) {\n        int min = 1000000;\n        for (int j = 0; j < size; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 0; j < size; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (int j = 0; j < size; j++) {\n        int min = 1000000;\n        for (int i = 0; i < size; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int i = 0; i < size; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (int i = 1; i < size - 1; i++) {\n        for (int j = 0; j < size; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int j = 1; j < size - 1; j++) {\n        for (int i = 0; i < size - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32921", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, h = 0, n1 = 0,\n      sum = 0; \n  cin >> n;\n  int s[n + 1][n + 1];     \n  for (i = 1; i <= n; i++) \n  {\n    for (k = 0; k < n; k++) \n    {\n      for (h = 0; h < n; h++) {\n        cin >> s[k][h];\n      }\n    }\n    sum = 0;                    \n    for (n1 = n; n1 >= 2; n1--) \n    {\n      for (j = 0; j <= n1 - 1; j++) \n      {\n        s[j][n1] = s[j][0];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[j][h] < s[j][n1])\n            s[j][n1] = s[j][h];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) \n      {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[j][h] = s[j][h] - s[j][n1];\n        }\n      }\n      for (j = 0; j <= n - 1; j++) \n      {\n        s[n1][j] = s[0][j];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[h][j] < s[n1][j])\n            s[n1][j] = s[h][j];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) \n      {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[h][j] = s[h][j] - s[n1][j];\n        }\n      }\n      sum = sum + s[1][1]; \n      if (n1 > 2)          \n      {\n        for (j = 2; j <= n1 - 1; j++) \n        {\n          s[0][j - 1] = s[0][j];\n          s[j - 1][0] = s[j][0];\n        }\n        for (j = 1; j <= n1 - 2; j++) \n        {\n          for (h = 1; h <= n1 - 2; h++) {\n            s[j][h] = s[j + 1][h + 1];\n          }\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32922", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[200][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[200][200], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[200][200];\n    memset(a, 0, 40000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32923", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, t = 0, b[100][100];\n  int i, j, k, min;\n  scanf(\"%d \", &m);\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = b[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > b[j][k]) {\n            min = b[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          b[j][k] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = b[0][j];\n        for (k = 0; k < n; k++) {\n          if (min > b[k][j]) {\n            min = b[k][j];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          b[k][j] -= min;\n        }\n      }\n      t += b[1][1];\n      for (j = 1; j < n - 1; j++) {\n        b[0][j] = b[0][j + 1];\n        b[j][0] = b[j + 1][0];\n        for (k = 1; k < n - 1; k++) {\n          b[j][k] = b[j + 1][k + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32924", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k;\n  int sum = 0;\n  int a[101][101];\n  int min;\n  int l;\n  int p;\n  int t;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    l = n;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (p = 1; p < n; p++) {\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[i][j] == 0)\n            break;\n        }\n        min = a[i][0];\n        for (j = 1; j < l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[j][i] == 0)\n            break;\n        }\n        min = a[0][i];\n        for (j = 1; j < l; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      if (l == 2) {\n        break;\n      }\n      for (i = 1; i < l - 1; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < l - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      l--;\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "32925", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid solve(int n) {\n  if (n != 1) {\n    for (int i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (int j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (int j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[j][i] -= min;\n      }\n    }\n    sum += a[1][1];\n    for (int i = 1; i < n - 1; i++) {\n      a[i][0] = a[i + 1][0];\n      a[0][i] = a[0][i + 1];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++)\n        a[i][j] = a[i + 1][j + 1];\n\n    solve(n - 1);\n  }\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    solve(n);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32926", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nvoid zero(int array_1[100][100]);\nvoid subduction(int array_1[100][100]);\nint num, array_1[100][100];\nint main() {\n  int n, i, j, k, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    num = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    for (i = 1; i < n; i++) {\n      zero(array_1);\n      sum = sum + array_1[1][1];\n      subduction(array_1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid zero(int array_1[100][100]) {\n  int i, j, minuend;\n  for (i = 0; i < num; i++) {\n    minuend = array_1[i][0];\n    for (j = 0; j < num; j++)\n      if (array_1[i][j] < minuend)\n        minuend = array_1[i][j];\n    for (j = 0; j < num; j++)\n      array_1[i][j] = array_1[i][j] - minuend;\n  }\n  for (i = 0; i < num; i++) {\n    minuend = array_1[0][i];\n    for (j = 0; j < num; j++)\n      if (array_1[j][i] < minuend)\n        minuend = array_1[j][i];\n    for (j = 0; j < num; j++)\n      array_1[j][i] = array_1[j][i] - minuend;\n  }\n};\n\nvoid subduction(int array_1[100][100]) {\n  int i, j, k;\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[i - 1][j] = array_1[i][j];\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[j][i - 1] = array_1[j][i];\n  num--;\n};\n"}
{"label": "18", "index": "32927", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], m, i, j, k, x, p, s = 0;\n  cin >> n;\n  m = n;\n  for (k = 0; k < m; k++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = 1; p < m; p++) {\n      for (i = 0; i < n; i++) {\n        x = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (j = 0; j < n; j++)\n            a[i][j] = a[i][j] - x;\n      }\n      for (j = 0; j < n; j++) {\n        x = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (i = 0; i < n; i++)\n            a[i][j] = a[i][j] - x;\n      }\n      s = s + a[1][1];\n      for (i = 2; i < n; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    n = m;\n  }\n}\n"}
{"label": "18", "index": "32928", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  int n, arr[101][101], temp[101][101];\n  int cnt_a, cnt_b;\n  int(*ptr)[101], ans, m;\n  int(*ptr_t)[101];\n  int mini;\n  ptr = arr;\n  ptr_t = temp;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    memset(arr, 0, sizeof(arr));\n    ans = 0;\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j) {\n        cin >> *(*(ptr + i) + j);\n      }\n    m = n;\n    for (i = 0; i < n - 1; ++i) {\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + j) + l) < mini)\n            mini = *(*(ptr + j) + l);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + j) + l) -= mini;\n        }\n      }\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + l) + j) < mini)\n            mini = *(*(ptr + l) + j);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + l) + j) -= mini;\n        }\n      }\n      ans += *(*(ptr + 1) + 1);\n      cnt_a = 0;\n      cnt_b = 0;\n      for (j = 0; j < m; ++j) {\n        cnt_b = 0;\n        for (l = 0; l < m; ++l) {\n          if (j == 1 || l == 1)\n            continue;\n          *(*(ptr_t + cnt_a) + cnt_b) = *(*(ptr + j) + l);\n          cnt_b++;\n        }\n        if (j != 1)\n          cnt_a++;\n      }\n      memset(arr, 0, sizeof(arr));\n      for (j = 0; j < cnt_a; ++j)\n        for (l = 0; l < cnt_b; ++l) {\n          *(*(ptr + j) + l) = *(*(ptr_t + j) + l);\n        }\n      m--;\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001], sum = 0;\nvoid reduce(int a[][1001], int n) {\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (i = n; i > 1; i--) {\n      reduce(a, i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid suo(int b[101][101], int n) {\n\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      b[i][j] = b[i + 1][j];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++)\n      b[i][j] = b[i][j + 1];\n  return;\n}\n\nint square(int a[101][101], int n) {\n  if (n == 1)\n    return 0;\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int t = a[1][1];\n  int sum = 0;\n  suo(a, n);\n  sum = t + square(a, n - 1);\n  return sum;\n}\nint main() {\n  int i, n, k, j, m[101][101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> m[j][k];\n    cout << square(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[101][101] = {0};\n  int small[101] = {0};\n  int sum = 0;\n  int i, j, k, l;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[k][1];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          if (a[k][l] < small[k])\n            small[k] = a[k][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k][l] - small[k];\n\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[1][k];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          if (a[k][l] < small[l])\n            small[l] = a[k][l];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          a[k][l] = a[k][l] - small[l];\n\n      sum = sum + a[2][2];\n      for (k = 2; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k + 1][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 2; l <= n - j + 1; l++)\n          a[k][l] = a[k][l + 1];\n    }\n    cout << sum << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, l, p;\nint sum = 0;\nint a[105][105];\n\nvoid g() {\n  int i, j;\n  int t;\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + i) + 1);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + i) + j) < t)\n        t = *(*(a + i) + j);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + i) + j) -= t;\n  }\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + 1) + i);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + j) + i) < t)\n        t = *(*(a + j) + i);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + j) + i) -= t;\n  }\n}\n\nvoid f() {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  for (j = 1; j <= n; j++)\n    for (i = 2; i <= n; i++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n}\nint main() {\n  int i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    for (p = 0; p < n; p++) {\n\n      g();\n      sum += (*(*(a + 2) + 2));\n      f();\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int sum = 0;\n  int l = 0;\n  int a[100][100];\n  int min;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    l = 0;\n    for (i = 0; i < n - l; i++)\n      for (j = 0; j < n - l; j++)\n        cin >> a[i][j];\n    while (l < n - 1) {\n      for (i = 0; i < n - l; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1 - l; i++)\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1 - l; j++)\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j + 1];\n      l++;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32934", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k < n; k++) {\n    int i, j, l;\n    int a[100][100];\n    int s[100];\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n\n    for (l = 0; l < n - 1; l++) {\n      int minh[100] = {0};\n      for (i = 0; i < n; i++) {\n\n        if (a[i][0] >= 0) {\n          minh[i] = a[i][0];\n          for (j = 0; j < n; j++) {\n            if (a[i][j] < minh[i] && a[i][j] >= 0)\n              minh[i] = a[i][j];\n          }\n          for (j = 0; j < n; j++) {\n            a[i][j] = a[i][j] - minh[i];\n          }\n        }\n      }\n      int minl[100] = {0};\n      for (i = 0; i < n; i++) {\n        if (a[0][i] >= 0)\n\n        {\n          minl[i] = a[0][i];\n          for (j = 0; j < n; j++) {\n            if (a[j][i] < minl[i] && a[i][j] >= 0)\n              minl[i] = a[j][i];\n          }\n          for (j = 0; j < n; j++) {\n            a[j][i] = a[j][i] - minl[i];\n          }\n        }\n      }\n      s[l] = a[l + 1][l + 1];\n\n      for (i = 0; i < n; i++) {\n        a[l + 1][i] = -1;\n        a[i][l + 1] = -1;\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < n - 1; i++) {\n      sum = sum + s[i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid shrink(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0], j;\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i], j;\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  shrink(n);\n  return k + Sum(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min;\n  int a[103][103];\n  scanf(\"%d \", &n);\n  for (int count = 1; count <= n; count++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int n0 = n, sum = 0;\n    while (n0 >= 2) {\n      for (i = 0; i < n0; i++) {\n        min = a[i][0];\n        for (j = 1; j < n0; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n0; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n0; j++) {\n        min = a[0][j];\n        for (i = 1; i < n0; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n0; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < n0; i++)\n        for (j = 0; j < n0; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n0; j++)\n        for (i = 0; i < n0; i++)\n          a[i][j] = a[i][j + 1];\n      n0--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[100], n, i, j, k, l, min, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < n - j; k++) {\n        min = a[k][0];\n        for (l = 0; l < n - j; l++)\n          if (min > a[k][l])\n            min = a[k][l];\n        for (l = 0; l < n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k < n - j; k++) {\n        min = a[0][k];\n        for (l = 0; l < n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l < n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (k = 0; k < n - j; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[k][l] = a[k][l + 1];\n      for (k = 0; k < n - j - 1; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[l][k] = a[l + 1][k];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "32938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint row(int a[][100], int l, int m) {\n  int i, min = a[m][0];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[m][i])\n      min = a[m][i];\n  return min;\n}\nint line(int a[][100], int l, int m) {\n  int i, min = a[0][m];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[i][m])\n      min = a[i][m];\n  return min;\n}\nvoid move(int a[][100], int l) {\n  int i, j;\n  for (i = 1; i < l + 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < l + 1; i++)\n    for (j = 1; j < l + 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int l, a[100][100] = {0}, sum = 0, x, y;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = n - 1; l >= 0; l--) {\n      for (x = 0; x < l + 1; x++) {\n        int d = row(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[x][y] = a[x][y] - d;\n      }\n      for (x = 0; x < l + 1; x++) {\n        int e = line(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[y][x] = a[y][x] - e;\n      }\n      sum += a[1][1];\n      move(a, l);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int min, n, i, j, ans, t;\n  int a[101][101];\n\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[i][j] < min))\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[j][i] < min))\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      ans = ans + a[1][1];\n\n      for (i = 1; i < t - 1; i++)\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 0; i < t - 1; i++)\n        for (j = 1; j < t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32940", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid zero(int a[100][100], int n) {\n  int min[100];\n  for (int i = 0; i < n; ++i) {\n    min[i] = a[i][0];\n    for (int j = 0; j < n; ++j)\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    if (min[i] != 0)\n      for (int j = 0; j < n; ++j)\n        a[i][j] -= min[i];\n  }\n  for (int j = 0; j < n; ++j) {\n    min[j] = a[0][j];\n    for (int i = 0; i < n; ++i)\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    if (min[j] != 0)\n      for (int i = 0; i < n; ++i)\n        a[i][j] -= min[j];\n  }\n}\nvoid subduction(int a[100][100], int n) {\n  for (int i = 1; i < n - 1; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; ++i)\n    for (int j = 1; j < n - 1; ++j)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int m, n, s, a[100][100];\n  cin >> n;\n  for (int t = 0; t < n; ++t) {\n    s = 0, m = n;\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        scanf(\"%d \", &a[i][j]);\n    while (m != 1) {\n      zero(a, m);\n      s += a[1][1];\n      subduction(a, m--);\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "18", "index": "32941", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, a[100][100][100];\n\nint main() {\n  int sum[100] = {0}, t, x, min;\n  cin >> n;\n  t = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (x = 0; x < n; x++) {\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[x][i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (j = 0; j < n; j++) {\n          a[x][i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[x][0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (i = 0; i < n; i++) {\n          a[x][i][j] -= min;\n        }\n      }\n      sum[x] += a[x][1][1];\n      for (i = 1; i < n - 1; i++)\n        a[x][i][0] = a[x][i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        a[x][0][j] = a[x][0][j + 1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[x][i][j] = a[x][i + 1][j + 1];\n      }\n      n--;\n    }\n    n = t;\n  }\n  for (i = 0; i < t; i++)\n    printf(\"%d\\n\", sum[i]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "32942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n}\nint sum(int n) {\n  int i, j;\n  guiling(n);\n  int m;\n  if (n == 2)\n    return a[1][1];\n  m = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return m + sum(n - 1);\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32943", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, sum, min;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++)\n\n  {\n    int a[m][m];\n    for (j = 0; j < m; j++)\n      for (k = 0; k < m; k++)\n        scanf(\"%d \", &a[j][k]);\n    sum = 0;\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 1; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32944", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100], ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int p = 0; p < n - 1; p++) {\n      int min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + i) + j))\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) -= min;\n        }\n        min = **(a + i + 1);\n      }\n      min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + j) + i))\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + j) + i) -= min;\n        }\n        min = *(*a + i + 1);\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n        }\n      }\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - 1 - p; j++) {\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n        }\n      }\n    }\n    printf(\"%d\\n\", ans);\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32945", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200]; \n  cin >> n;\n\n  for (i = 0; i <= 199; i++)\n    for (j = 0; j <= 199; j++)\n      num[i][j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        cin >> num[j][k];\n\n    cout << del(num, n) << endl; \n  }\n  return 0;\n}\n\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 9999;\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) \n    {\n      if (num[j][i] < min)\n        min = num[j][i];\n    }\n    for (i = 0; i <= n - 1; i++) \n      num[j][i] = num[j][i] - min;\n  }\n\n  for (j = 0; j <= n - 1; j++) \n  {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n\n    for (i = 0; i <= n - 1; i++)\n      num[i][j] = num[i][j] - min;\n  }\n  sum = sum + num[1][1]; \n\n  if (n == 2) \n    return sum;\n\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n\n    for (i = 2; i <= n - 1; i++) \n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n\n    sum = sum + del(num, n - 1); \n    return sum;\n  }\n}\n"}
{"label": "18", "index": "32946", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int h, n;\n  scanf(\"%d\\n\", &n);\n  for (h = 1; h <= n; h++) {\n    int i, j, k, t, sum = 0, a[105][105];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\" %d\", &a[i][j]);\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        k = a[i][0];\n        for (j = 1; j < t; j++) {\n          if (a[i][j] < k)\n            k = a[i][j];\n        }\n        for (j = 0; j < t; j++) {\n          a[i][j] -= k;\n        }\n      }\n      for (i = 0; i < t; i++) {\n        k = a[0][i];\n        for (j = 1; j < t; j++) {\n          if (a[j][i] < k) {\n            k = a[j][i];\n          }\n        }\n        for (j = 0; j <= t; j++) {\n          a[j][i] -= k;\n        }\n      }\n      sum += a[1][1];\n      for (j = 2; j < t; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < t; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i <= t; i++)\n        for (j = 2; j <= t; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32947", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, a[101][101], min, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    r = n;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int l = 1; l <= n - 2; l++) {\n      for (int i = 1; i <= r; i++) {\n        min = a[i][1];\n        for (int j = 1; j <= r; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (int i = 1; i <= r; i++) {\n        min = a[1][i];\n        for (int j = 1; j <= r; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum += a[2][2];\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r - 1; j++) {\n          a[j][i] = a[j][i + 1];\n        }\n      }\n      r--;\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= 2; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= 2; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum += a[2][2];\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "32948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum, min, i, j, p, k, (*q)[100];\n  q = a;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(q + i) + j);\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + i) + j);\n          else {\n            if (*(*(q + i) + j) < min)\n              min = *(*(q + i) + j);\n          }\n        }\n        for (j = 0; j < k; j++)\n          *(*(q + i) + j) = *(*(q + i) + j) - min;\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0) {\n            min = *(*(q + j) + i);\n          } else {\n            if (*(*(q + j) + i) < min)\n              min = *(*(q + j) + i);\n          }\n        }\n        for (j = 0; j < k; j++) {\n          *(*(q + j) + i) = *(*(q + j) + i) - min;\n        }\n      }\n      sum += *(*(q + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + 0) + i) = *(*(q + 0) + i + 1);\n      }\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + i) + 0) = *(*(q + i + 1) + 0);\n      }\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++) {\n          *(*(q + i) + j) = *(*(q + i + 1) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32949", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid min(int a[], int b);\nint main() {\n  int n = 0, i = 0, sum = 0;\n  cin >> n;\n  const int p = n;\n  for (i = 0; i < p; i++, sum = 0) {\n    int z[101][101] = {0}, z2[101] = {0};\n    int j = 0, k = 0;\n    n = p;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> z[j][k];\n    do {\n      for (j = 0; j < n; j++)\n        min(z[j], n);\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          z2[k] = z[k][j];\n        min(z2, n);\n        for (k = 0; k < n; k++)\n          z[k][j] = z2[k];\n      }\n      sum += z[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[j][k] = z[j][k + 1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[k][j] = z[k + 1][j];\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid min(int a[], int b) {\n  int w = 0, y = 10000;\n  for (w = 0; w < b; w++) {\n    if (a[w] < y)\n      y = a[w];\n  }\n  for (w = 0; w < b; w++)\n    a[w] = a[w] - y;\n}\n"}
{"label": "18", "index": "32950", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, h = 0, n1 = 0, sum = 0;\n  cin >> n;\n  int s[n + 1][n + 1];\n  for (i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++) {\n      for (h = 0; h < n; h++) {\n        scanf(\"%d \", &s[k][h]);\n      }\n    }\n    sum = 0;\n    for (n1 = n; n1 >= 2; n1--) {\n      for (j = 0; j <= n1 - 1; j++) {\n        s[j][n1] = s[j][0];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[j][h] < s[j][n1])\n            s[j][n1] = s[j][h];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[j][h] = s[j][h] - s[j][n1];\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        s[n1][j] = s[0][j];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[h][j] < s[n1][j])\n            s[n1][j] = s[h][j];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[h][j] = s[h][j] - s[n1][j];\n        }\n      }\n      sum = sum + s[1][1];\n      if (n1 > 2) {\n        for (j = 2; j <= n1 - 1; j++) {\n          s[0][j - 1] = s[0][j];\n          s[j - 1][0] = s[j][0];\n        }\n        for (j = 1; j <= n1 - 2; j++) {\n          for (h = 1; h <= n1 - 2; h++) {\n            s[j][h] = s[j + 1][h + 1];\n          }\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, sum, min;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i - 1][j] = a[i][j];\n      for (j = 2; j < k; j++)\n        for (i = 0; i < k - 1; i++)\n          a[i][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32952", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int nx) {\n  int x, min;\n  min = a[0];\n  for (x = 0; x <= nx - 1; x++) {\n    if (a[x] <= min) {\n      min = a[x];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int temp, nx, y, sum, i, j, k, n, a[100][100], b[100], m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    nx = n;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (y = 1; y <= n - 1; y++) {\n      for (j = 0; j <= n - 1; j++) {\n        temp = min(a[j], nx);\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        for (m = 0; m <= n - 1; m++) {\n          b[m] = a[m][k];\n        }\n        temp = min(b, nx);\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (k = 1; k <= n - 2; k++) {\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      nx--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32953", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100] = {0};\n  int times, m, n, i, j, k;\n  cin >> times;\n  m = times;\n  while (m--) {\n    n = times;\n    int(*p)[100] = array;\n    for (i = 0; i < times; i++)\n      for (j = 0; j < times; j++)\n        cin >> *(*(p + i) + j);\n    int sum = 0;\n    for (k = 1; k <= times - 1; k++) {\n      int min, now;\n      for (i = 0; i < n; i++) {\n        min = *(*(p + i));\n        for (j = 1; j < n; j++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = *(*p + j);\n        for (i = 1; i < n; i++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + (*(*(p + 1) + 1));\n      if (n == 2)\n        break;\n      for (i = 2; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      for (j = 2; j < n; j++)\n        for (i = 0; i < n - 1; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, m, s = 0, i, j, x, y, t = 0;\n  int(*p)[100];\n  p = a;\n  scanf(\"%d \", &n);\n  for (m = 1; m <= n; m++) {\n    s = 0;\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> (*(*(p + i) + j));\n      }\n\n    for (y = n; y > 1; y--) {\n\n      for (i = 0; i < n - t; i++) {\n        x = *(*(p + i));\n        for (j = 0; j < n - t; j++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) -= x;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        x = *(*(p) + j);\n        for (i = 0; i < n - t; i++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (i = 0; i < n - t; i++)\n          *(*(p + i) + j) -= x;\n      }\n\n      s = s + *(*(p + 1) + 1);\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n      for (i = 1; i < n - t - 1; i++)\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      t++;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32955", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main()\n\n{\n  int n;\n  scanf(\"%d \", &n);\n  int i, j, k, m;\n  int t = 0;\n  int a[100][100];\n  int s = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    for (m = 1; m <= n - 1; m++) {\n\n      for (i = 0; i < n - m + 1; i++) {\n        t = a[i][0];\n        for (j = 1; j < n - m + 1; j++) {\n          if (a[i][j] < t) {\n            t = a[i][j];\n          }\n        }\n        for (j = 0; j < n - m + 1; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - m + 1; j++) {\n        t = a[0][j];\n        for (i = 1; i < n - m + 1; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - m + 1; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - m; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - m; j++) {\n        for (i = 1; i < n - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << s << endl;\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0, n;\nvoid GuiLing(int num[][100], int n, int move);\nvoid XiaoJian(int num[][100], int move);\nint main() {\n  int i, j, t, num[100][100];\n  scanf(\"%d \", &n);\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    XiaoJian(num, 0);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid XiaoJian(int num[][100], int move) {\n  if (move == n - 1) {\n    ;\n  } else {\n    GuiLing(num, n, move);\n    sum = sum + num[move + 1][move + 1];\n    XiaoJian(num, move + 1);\n  }\n}\nvoid GuiLing(int num[][100], int n, int move) {\n  int i, j, min;\n\n  for (i = 0; i < n; i++) {\n    if ((move != 0) && ((i >= 1) && (i <= move)))\n      continue;\n    min = num[i][0];\n    for (j = 1; j < n; j++) {\n      if ((move != 0) && ((j >= 1) && (j <= move)))\n        continue;\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++) {\n        if ((move != 0) && ((j >= 1) && (j <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    if ((move != 0) && ((j >= 1) && (j <= move)))\n      continue;\n    min = num[0][j];\n    for (i = 1; i < n; i++) {\n      if ((move != 0) && ((i >= 1) && (i <= move)))\n        continue;\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++) {\n        if ((move != 0) && ((i >= 1) && (i <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "32957", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n;\n  m = n;\n  int sum = 0;\n  for (int i = 0; i < m; i++) {\n    n = m;\n    int a[100][100];\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    while (n > 1) {\n      for (int j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (int j = 0; j < n; j++) {\n        int min = a[0][j];\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int k = 0; k < n; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32958", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], n, j, k, p, min, count1 = 0, l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    count1 = 0;\n    l = 0;\n    for (j = 0; j < n; j++)\n      for (p = 0; p < n; p++)\n        cin >> *(*(s + j) + p);\n    for (k = 1; k < n; k++) {\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s + j) + 0);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + j) + p) < min)\n            min = *(*(s + j) + p);\n        }\n        for (p = 0; p < n - l; p++) {\n          *(*(s + j) + p) = *(*(s + j) + p) - min;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s) + j);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + p) + j) < min)\n            min = *(*(s + p) + j);\n        }\n\n        for (p = 0; p < n - l; p++) {\n          *(*(s + p) + j) = *(*(s + p) + j) - min;\n        }\n      }\n      count1 += (*(*(s + 1) + 1));\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + j) + p) = *(*(s + j) + p + 1);\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + p) + j) = *(*(s + p + 1) + j);\n      l++;\n    }\n    printf(\"%d\\n\", count1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32959", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint result = 0;\nint min1;\nint minh(int n, int j) {\n  int i, min_a;\n  min_a = a[j][0];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[j][i]) {\n      min_a = a[j][i];\n    }\n  }\n  return min_a;\n}\nint minl(int n, int j) {\n  int i, min_a;\n  min_a = a[0][j];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[i][j]) {\n      min_a = a[i][j];\n    }\n  }\n  return min_a;\n}\nint dec(int n) {\n  int m, p, q;\n  if (n == 1) {\n    printf(\"%d\\n\", result);\n    return 0;\n  }\n  if (n > 1) {\n    for (m = 0; m < n; m++) {\n      min1 = minh(n, m);\n      for (p = 0; p < n; p++) {\n        a[m][p] = a[m][p] - min1;\n      }\n    }\n    for (m = 0; m < n; m++) {\n      min1 = minl(n, m);\n      for (p = 0; p < n; p++) {\n        a[p][m] = a[p][m] - min1;\n      }\n    }\n    result = result + a[1][1];\n    for (m = 0; m < n; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[m][p] = a[m][p + 1];\n      }\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[p][m] = a[p + 1][m];\n      }\n    }\n    dec(n - 1);\n  }\n}\nint main(int argc, const char *argv[]) {\n\n  int n;\n  scanf(\"%d \", &n);\n  int w, s, t;\n  for (w = 1; w <= n; w++) {\n    for (s = 0; s < n; s++) {\n\n      for (t = 0; t < n; t++) {\n        scanf(\"%d \", &a[s][t]);\n      }\n    }\n    result = 0;\n    dec(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32960", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int q;\n  q = n;\n  int a[150][150], sum = 0, i, j, k, l, m, p, min;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (l = 1; l < n; l++) {\n          if (min > a[j][l])\n            min = a[j][l];\n        }\n        for (m = 0; m < n; m++) {\n          a[j][m] = a[j][m] - min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (l = 1; l < n; l++) {\n          if (min > a[l][j])\n            min = a[l][j];\n        }\n        for (m = 0; m < n; m++)\n          a[m][j] = a[m][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (p = 2; p < n; p++) {\n        a[0][p - 1] = a[0][p];\n        a[p - 1][0] = a[p][0];\n      }\n      for (j = 2; j < n; j++) {\n        for (l = 2; l < n; l++) {\n          a[j - 1][l - 1] = a[j][l];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    n = q;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid make_zero(int a[100][100], int);\nvoid reduce(int a[100][100], int);\nint min(int a[100][100], int i, int p, int flag);\n\nint main() {\n  int n, a[100][100], sum;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (int p = n - 1; p > 0; p--) {\n      make_zero(a, p);\n      sum += a[1][1];\n      reduce(a, p);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid make_zero(int a[100][100], int p) {\n  int flag = 0, m;\n  for (int i = 0; i <= p; i++) {\n    m = min(a, i, p, flag);\n    for (int j = 0; j <= p; j++)\n      a[i][j] -= m;\n  }\n  flag = 1;\n  for (int k = 0; k <= p; k++) {\n    m = min(a, k, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[j][k] -= m;\n    }\n  }\n}\n\nvoid reduce(int a[100][100], int p) {\n  for (int i = 0; i <= p; i++) {\n    for (int j = 1; j < p; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int k = 0; k < p; k++) {\n    for (int j = 1; j < p; j++) {\n      a[j][k] = a[j + 1][k];\n    }\n  }\n}\n\nint min(int a[100][100], int i, int p, int flag) {\n  int t;\n  if (flag == 0) {\n    t = a[i][0];\n    for (int j = 0; j <= p; j++) {\n      if (a[i][j] < t) {\n        t = a[i][j];\n      }\n    }\n  } else {\n    t = a[0][i];\n    for (int j = 0; j <= p; j++) {\n      if (a[j][i] < t)\n        t = a[j][i];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "32962", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    printf(\"\\n\");\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000 * sizeof(int));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    cout << p << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32963", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    int sum = 0;\n    int t[101][101] = {0};\n    for (j = 0; j < n; ++j) {\n      for (k = 0; k < n; ++k) {\n        cin >> t[j][k];\n      }\n    }\n\n    int cnt = n;\n    while (cnt > 1) {\n      for (j = 0; j < cnt; ++j) {\n        int min = t[j][0];\n        for (k = 1; k < cnt; ++k) {\n          if (t[j][k] < min)\n            min = t[j][k];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[j][k] -= min;\n        }\n      }\n\n      for (j = 0; j < cnt; ++j) {\n        int min = t[0][j];\n        for (k = 1; k < cnt; ++k) {\n          if (t[k][j] < min)\n            min = t[k][j];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[k][j] -= min;\n        }\n      }\n\n      sum += t[1][1];\n\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[j][k] = t[j][k + 1];\n        }\n      }\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[k][j] = t[k + 1][j];\n        }\n      }\n\n      cnt--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint change(int m) {\n  int i, j, k = 0, min, value;\n\n  if (m == 1)\n    return 0;\n\n  for (i = 0; i < m; i++) {\n    min = a[i][0];\n    for (j = 0; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < m; i++) {\n    min = a[0][i];\n    for (j = 0; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n\n  value = a[1][1];\n\n  for (i = 1; i < m - 1; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n\n  for (j = 1; j < m - 1; j++)\n    for (i = 0; i < m - 1; i++)\n      a[i][j] = a[i][j + 1];\n\n  return value + change(m - 1);\n}\nint main() {\n  int n, i, j;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n * n; j++)\n      cin >> a[j / n][j % n];\n\n    cout << change(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32965", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint min(int *p, int n) {\n  int k, i;\n  k = *p;\n  p++;\n  for (i = 1; i < n; i++, p++) {\n    if (*p < k)\n      k = *p;\n  }\n  return (k);\n}\nint main() {\n  int i, j, n, m, w, xiao, s;\n  int a[101][101], b[101];\n  scanf(\"%d\", &n);\n  for (w = 0; w < n; w++) {\n\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    s = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++)\n        b[i] = 0;\n      for (i = 0; i < m; i++) {\n        xiao = min(a[i], m);\n        if (xiao == 0) {\n          for (j = 0; j < m; j++) {\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n          continue;\n\n        } else {\n          for (j = 0; j < m; j++) {\n            a[i][j] -= xiao;\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n        }\n      }\n      for (i = 0; i < m; i++) {\n        if (b[i] != 0)\n          continue;\n        else {\n          xiao = a[0][i];\n          for (j = 1; j < m; j++)\n            if (a[j][i] < xiao)\n              xiao = a[j][i];\n          for (j = 0; j < m; j++)\n            a[j][i] -= xiao;\n        }\n      }\n      s += a[1][1];\n      for (i = 0; i < m; i++) {\n        if (i == 1)\n          continue;\n        else {\n          for (j = 1; j < m - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[j][i] = a[j + 1][i];\n    }\n    cout << s << \" \";\n  }\n}\n"}
{"label": "18", "index": "32966", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint n, A[111][111];\n\nvoid sum() {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      cin >> A[i][j];\n\n  int S = 0;\n  for (int t = n; t > 1; t--) {\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[i][j] < min)\n          min = A[i][j];\n      }\n      for (int j = 0; j < t; j++) {\n        A[i][j] -= min;\n      }\n    }\n\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[j][i] < min)\n          min = A[j][i];\n      }\n      for (int j = 0; j < t; j++) {\n        A[j][i] -= min;\n      }\n    }\n\n    S += A[1][1];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[i][j] = A[i + 1][j];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[j][i] = A[j][i + 1];\n  }\n  cout << S << endl;\n}\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    sum();\n}\n"}
{"label": "18", "index": "32967", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint t = 0;\nint sum(int n, int a[100][100]) {\n  if (n == 1)\n    return 1;\n  int i, j, k, min;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++) {\n      if (a[j][k] < min)\n        min = a[j][k];\n    }\n    for (k = 0; k < n; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++) {\n      if (a[k][j] < min)\n        min = a[k][j];\n    }\n    for (k = 0; k < n; k++) {\n      a[k][j] -= min;\n    }\n  }\n\n  t += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n\n  sum(n - 1, a);\n  return t;\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n\n    {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n, a) << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nvoid guiling(int a[100][100], int p) {\n  int t, s;\n  int min1, min2;\n  for (s = 0; s < p; s++) {\n    min1 = a[s][0];\n    for (t = 1; t < p; t++)\n      if (a[s][t] < min1)\n        min1 = a[s][t];\n    for (t = 0; t < p; t++)\n      a[s][t] = a[s][t] - min1;\n  }\n  for (t = 0; t < p; t++) {\n    min2 = a[0][t];\n    for (s = 1; s < p; s++)\n      if (a[s][t] < min2)\n        min2 = a[s][t];\n    for (s = 0; s < p; s++)\n      a[s][t] = a[s][t] - min2;\n  }\n  sum = sum + a[1][1];\n}\nvoid xiaojian(int a[100][100], int p) {\n  int i, j;\n  for (i = 0; i < p; i++)\n    for (j = 1; j < p - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < p - 1; j++)\n    for (i = 1; i < p - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int n;\n  int a[100][100];\n  int i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (t = n; t >= 2; t--) {\n      guiling(a, t);\n      xiaojian(a, t);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int num[n][n];\n  int sum = 0;\n  int min = 0;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> num[i][j];\n    }\n    for (int s = 0; s < n - 1; s++) {\n      for (int i = 0; i < n; i++) {\n        min = INT_MAX;\n        for (int j = 0; j < n; j++) {\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        }\n        for (int j = 0; j < n; j++)\n          num[i][j] -= min;\n      }\n      for (int j = 0; j < n; j++) {\n        min = INT_MAX;\n        for (int i = 0; i < n; i++)\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        for (int i = 0; i < n; i++)\n          num[i][j] -= min;\n      }\n      sum += num[1 + s][1 + s];\n      for (int i = 0; i < n; i++) {\n        num[1 + s][i] = -1;\n        num[i][1 + s] = -1;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint minx[1000], miny[1000];\nint n, m, a[105][105], b[105][105];\nvoid calc_min() {\n  for (int i = 0; i < m; i++) {\n    minx[i] = 100000;\n    miny[i] = 100000;\n  }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= minx[i];\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++) {\n\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] -= miny[j];\n}\nvoid calc_delete() {\n\n  for (int i = 0; i < m; i++)\n    if (i - 1 != 0)\n      for (int j = 0; j < m; j++) {\n        if (j == 1)\n          continue;\n        int x = i, y = j;\n        if (x)\n          x--;\n        if (y)\n          y--;\n        b[x][y] = a[i][j];\n      }\n  m--;\n  for (int i = 0; i < m; i++)\n    for (int j = 0; j < m; j++)\n      a[i][j] = b[i][j];\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int ans = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    m = n;\n\n    while (m > 2) {\n\n      calc_min();\n      ans += a[1][1];\n      calc_delete();\n    }\n    calc_min();\n    ans += a[1][1];\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32971", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0;\nint juzhen[101][101] = {0}, sum = 0, hang = 0;\nvoid hangxiao();\nvoid liexiao();\nvoid xiaojian();\nvoid hangxiao() {\n  int i, j, xiao = 1000;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (j = 0; j < hang; j++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid liexiao() {\n  int i, j, xiao = 1000;\n  for (j = 0; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid xiaojian() {\n  int i, j, xiao = 0;\n  for (i = 2; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      juzhen[i - 1][j] = juzhen[i][j];\n    }\n  }\n  for (j = 2; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j - 1] = juzhen[i][j];\n    }\n  }\n}\n\nint main() {\n  int a;\n  cin >> a;\n  n = a;\n\n  while (a > 0) {\n    memset(juzhen, 0, sizeof(juzhen));\n    sum = 0;\n    int i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    hang = n;\n    while (hang > 1) {\n      hangxiao();\n      liexiao();\n      sum += juzhen[1][1];\n      xiaojian();\n      hang--;\n    }\n    printf(\"%d\\n\", sum);\n    a--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32972", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid jian(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  if (n > 2) {\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < (n - 1); j++)\n        a[j][i] = a[j][i + 1];\n    for (i = 0; i < n; i++) {\n      a[n - 1][i] = '\\0';\n      a[i][n - 1] = '\\0';\n    }\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {'\\0'}, sum, n1;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n1 > 1) {\n      jian(a, n1);\n      sum += a[1][1];\n      move(a, n1);\n      n1--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, sum = 0;\n  int a[100][100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[j][0];\n        for (k = 1; k < n - m; k++) {\n          if (a[j][k] < b[j]) {\n            b[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j][k] - b[j];\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[0][j];\n        for (k = 1; k < n - m; k++) {\n          if (a[k][j] < b[j]) {\n            b[j] = a[k][j];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[k][j] = a[k][j] - b[j];\n        }\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - 1 - m; k++) {\n          a[k][j] = a[k][j + 1];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32974", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, min;\n  scanf(\"%d \", &n);\n  int input[n][n], sum[n];\n  for (i = 0; i < n; i++) {\n    count = n;\n    sum[i] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> input[j][k];\n\n    while (count != 1) {\n      for (j = 0; j < count; j++) {\n        min = input[j][0];\n        for (k = 1; k < count; k++)\n          if (input[j][k] < min)\n            min = input[j][k];\n        for (k = 0; k < count; k++)\n          input[j][k] -= min;\n      }\n      for (j = 0; j < count; j++) {\n        min = input[0][j];\n        for (k = 1; k < count; k++)\n          if (input[k][j] < min)\n            min = input[k][j];\n        for (k = 0; k < count; k++)\n          input[k][j] -= min;\n      }\n\n      sum[i] += input[1][1];\n      for (k = 0; k < count; k++)\n        for (j = 1; j < count - 1; j++)\n          input[j][k] = input[j + 1][k];\n      for (k = 0; k < count - 1; k++) {\n        for (j = 1; j < count - 1; j++)\n          input[k][j] = input[k][j + 1];\n      }\n      count--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "32975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, n1, p, q;\nint matrix(int a[][101]);\nint mi(int a[]);\nvoid xiao(int a[][101]);\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    n1 = n;\n    int a[101][101];\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        cin >> a[p][q];\n    cout << matrix(a) << endl;\n    \n  }\n  return 0;\n}\nint matrix(int a[][101]) {\n  int i, j, sum = 0;\n  int smin[101], dmin[101], t[101][101];\n\n  for (i = 0; i < n1; i++)\n    smin[i] = mi(a[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (smin[i] != 0) {\n        a[i][j] -= smin[i]; \n      }\n  for (j = 0; j < n1; j++)\n    for (i = 0; i < n1; i++)\n      t[j][i] = a[i][j];\n  for (i = 0; i < n1; i++)\n    dmin[i] = mi(t[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (dmin[i] != 0)\n        a[j][i] -= dmin[i];\n  sum = a[1][1];\n   if (n1 == 2)\n    return a[1][1];\n  xiao(a);\n  n1--;\n  sum = sum + matrix(a);\n  return sum;\n}\nint mi(int a[]) {\n  int i, min = a[0];\n  for (i = 0; i < n1; i++)\n    if (a[i] <= min)\n      min = a[i];\n  return min;\n}\nvoid xiao(int a[][101]) {\n  int i, j;\n  for (i = 1; i < n1; i++)\n    a[0][i] = a[0][i + 1];\n  a[0][i] = 0;\n  for (j = 1; j < n1; j++) {\n    for (i = 1; i < n1; i++)\n      a[j][i] = a[j + 1][i + 1];\n    a[j][i] = 0;\n  }\n  for (i = 1; i < n1; i++)\n    a[i][0] = a[i + 1][0];\n\n  for (i = 0; i < n1; i++)\n    a[n - 1][i] = 0;\n  \n}\n"}
{"label": "18", "index": "32976", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid xiao(int a[100][100], int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] = a[i][j] - min;\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (j = 0; j < n; j++) {\n    for (i = 2; i < n; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\n\nint count(int a[100][100], int n, int s) {\n  if (n == 1)\n    return (s);\n  else {\n    xiao(a, n);\n    s = s + a[1][1];\n    move(a, n);\n    return (count(a, n - 1, s));\n  }\n}\nint main() {\n  int n, i, j, s, t, a[100][100];\n  scanf(\"%d\", &n);\n  t = n;\n  while (t > 0) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    cout << count(a, n, s) << \"\\n\";\n    t--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\n\nint min(int a[], int n) \n{\n  int m = a[0];\n  for (int i = 0; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return m;\n}\n\nint juzhen(int a[100][100], int n) {\n  int hangmin[100], liemin[100]; \n  for (int i = 0; i < n; i++) {\n    hangmin[i] = min(a[i], n); \n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - hangmin[i]; \n  }\n  int templie[100]; \n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      templie[j] = a[j][i];\n    }\n    liemin[i] = min(templie, n); \n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[j][i] = a[j][i] - liemin[i]; \n  }\n  sum = sum + a[1][1];        \n  for (int i = 1; i < n; i++) \n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  for (int j = 1; j < n; j++)\n    for (int i = 0; i < n; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  n = n - 1;  \n  if (n == 1) \n  {\n    cout << sum << endl; \n    sum = 0;\n  } else\n    juzhen(a, n); \n  return 0;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  for (int k = 1; k <= n; k++) \n  {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, sum, m;\n  int a[100][100];\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        t = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - t;\n        }\n      }\n      for (i = 0; i < m; i++) {\n        t = a[0][i];\n        for (j = 1; j < m; j++) {\n          if (a[j][i] < t) {\n            t = a[j][i];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          a[j][i] = a[j][i] - t;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[j][i] = a[j + 1][i];\n        }\n      }\n      m--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[120][120], m, s, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    m = n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    s = 0;\n    while (m >= 2) {\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[j][l] < a[j][d])\n            d = l;\n        }\n        d = a[j][d];\n        for (k = 0; k < m; k++) {\n          a[j][k] = a[j][k] - d;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[l][j] < a[d][j])\n            d = l;\n        }\n        d = a[d][j];\n        for (k = 0; k < m; k++) {\n          a[k][j] = a[k][j] - d;\n        }\n      }\n      s = s + a[1][1];\n      for (j = 0; j < m; j++) {\n        for (k = 2; k < m; k++) {\n          a[j][k - 1] = a[j][k];\n        }\n      }\n      for (j = 0; j < m - 1; j++) {\n        for (k = 2; k < m; k++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n      m--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, h, min, min1, k = 0;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    sum = 0;\n    k = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    while (k < n - 1) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n\n        for (j = 0; j < n - k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < n - k; i++) {\n        min1 = a[0][i];\n        for (j = 0; j < n - k; j++) {\n          if (a[j][i] < min1)\n            min1 = a[j][i];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[j][i] -= min1;\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < n - k; i++)\n        for (j = 0; j < n - k; j++) {\n          if (j >= 2 && i < 2)\n            a[i][j - 1] = a[i][j];\n          else if (i >= 2 && j < 2)\n            a[i - 1][j] = a[i][j];\n          else if (i >= 2 && j >= 2)\n            a[i - 1][j - 1] = a[i][j];\n        }\n      k++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, s = 0, t = 0, k = 0, i = 0, j = 0, m = 0, q = 0, min = 0, r = 0,\n      h = 0, w = 0, v = 0;\n  cin >> n;\n  for (r = 1; r <= n; r++) {\n    int number = 0;\n    const int p = n;\n    int a[p + 1][p + 1];\n    for (i = 1; i <= p; i++) {\n      for (j = 1; j <= p; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (k = 1; k <= p - 1; k++) {\n      for (s = k; s <= p; s++) {\n        min = a[s][k];\n        for (t = k; t <= p; t++) {\n          if (a[s][t] < min)\n            min = a[s][t];\n        }\n        for (m = k; m <= p; m++)\n          a[s][m] -= min;\n      }\n      for (h = k; h <= p; h++) {\n        min = a[k][h];\n        for (w = k; w <= p; w++) {\n          if (a[w][h] < min)\n            min = a[w][h];\n        }\n        for (q = k; q <= p; q++)\n          a[q][h] -= min;\n      }\n      number += a[k + 1][k + 1];\n      a[k + 1][k + 1] = a[k][k];\n      for (v = k + 2; v <= p; v++) {\n        a[k + 1][v] = a[k][v];\n        a[v][k + 1] = a[v][k];\n      }\n    }\n    printf(\"%d\\n\", number);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32982", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[100][100], b[10000], min = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  while (k > 0) {\n    memset(a, 0, sizeof(a));\n    int i, j, k1, sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    k1 = n;\n    while (k1 > 1) {\n      for (i = 0; i < k1; i++) {\n        min = a[i][0];\n        for (j = 0; j < k1; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < k1; i++) {\n        min = a[0][i];\n        for (j = 0; j < k1; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < k1; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      int count = 0;\n      memset(b, 0, sizeof(b));\n      for (i = 0; i < k1; i++) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < k1; j++) {\n          if (j == 1)\n            continue;\n          b[count++] = a[i][j];\n        }\n      }\n      k1--;\n      memset(a, 0, sizeof(a));\n      int x = 0;\n      for (i = 0; i < k1; i++)\n        for (j = 0; j < k1; j++)\n          a[i][j] = b[x++];\n    }\n    cout << sum << endl;\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32983", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[100][100];\nint n;\n\nvoid modify() {\n  for (int i = 0; i < n; i++) {\n    int min = num[i][0];\n    for (int j = 1; j < n; j++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      num[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min = num[0][j];\n    for (int i = 1; i < n; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      num[i][j] -= min;\n    }\n  }\n}\n\nvoid remove() {\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 0; j < n; j++)\n      num[i][j] = num[i + 1][j];\n  }\n  for (int j = 1; j < n - 1; j++) {\n    for (int i = 0; i < n; i++)\n      num[i][j] = num[i][j + 1];\n  }\n}\n\nint main() {\n  int N;\n  cin >> N;\n  int round = N;\n  while (round--) {\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    int sum = 0;\n    while (n > 1) {\n      modify();\n      sum += num[1][1];\n      remove();\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sm1(int line, int sum1, int array1[100][100]) {\n  int min = array1[line][0];\n  for (int i = 0; i < sum1; i++)\n    if (min > array1[line][i])\n      min = array1[line][i];\n  return min;\n}\nint sm2(int row, int sum2, int array2[100][100]) {\n  int min = array2[0][row];\n  for (int i = 0; i < sum2; i++)\n    if (min > array2[i][row])\n      min = array2[i][row];\n  return min;\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int step = 0; step < n; step++) {\n    int jz[100][100], he = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    for (int Count = 0; Count < n - 1; Count++) {\n      for (int i = 0; i < n - Count; i++) {\n        int minl = sm1(i, n - Count, jz);\n        for (int j = 0; j < n - Count; j++)\n          jz[i][j] -= minl;\n      }\n      for (int j = 0; j < n - Count; j++) {\n        int minr = sm2(j, n - Count, jz);\n        for (int i = 0; i < n - Count; i++)\n          jz[i][j] -= minr;\n      }\n      he += jz[1][1];\n      for (int i = 2; i < n - Count; i++)\n        for (int j = 2; j < n - Count; j++)\n          jz[i - 1][j - 1] = jz[i][j];\n      for (int i = 2; i < n - Count; i++)\n        jz[i - 1][0] = jz[i][0];\n      for (int j = 2; j < n - Count; j++)\n        jz[0][j - 1] = jz[0][j];\n    }\n    cout << he << endl << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, j, k, n, min, sum = 0, num = 0;\n  int a[101][101];\n  int minr[101];\n  int minc[101];\n  cin >> n;\n\n  for (k = 1, num = 0, sum = 0; k <= n; k++) {\n\n    for (i = 1; i <= n; i++) \n    {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    num = 0;\n    sum = 0;\n    while (num < n - 1) {\n      memset(minr, 0, 101 * 4);\n      memset(minc, 0, 101 * 4);\n      for (i = 1; i <= n - num; i++) \n      {                              \n        min = a[i][1];\n        for (j = 1; j <= n - num; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minr[i] = min;\n      }\n\n      for (i = 1; i <= n - num; i++) \n      {\n        for (j = 1; j <= n - num; j++) {\n          a[i][j] = a[i][j] - minr[i];\n        }\n      }\n\n      for (j = 1; j <= n - num; j++) { \n        min = a[1][j];\n        for (i = 1; i <= n - num; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minc[j] = min;\n      }\n\n      for (j = 1; j <= n - num; j++) \n      {\n        for (i = 1; i <= n - num; i++) {\n          a[i][j] = a[i][j] - minc[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n      \n\n      \n      for (i = 1; i <= n - num; i++) \n      {\n        for (j = 2; j <= n - num - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 1; j <= n - num - 1; j++) {\n        for (i = 2; i <= n - num - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n\n      num++; \n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r;\n  int mat[100][100];\n  scanf(\"%d \", &n);\n  for (int a = 0; a < n; a++) {\n    int sum = 0;\n    r = n;\n    for (int b = 0; b < n; b++) {\n      for (int c = 0; c < n; c++) {\n        cin >> mat[b][c];\n      }\n    }\n    for (int d = 0; d < n - 1; d++) {\n      int minh[100], minl[100];\n      for (int d = 0; d < r; d++) {\n        minh[d] = 9999999;\n        minl[d] = 9999999;\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minh[e] > mat[e][f]) {\n            minh[e] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minh[g];\n        }\n      }\n      for (int e = 0; e < r; e++) {\n        for (int f = 0; f < r; f++) {\n          if (minl[f] > mat[e][f]) {\n            minl[f] = mat[e][f];\n          }\n        }\n      }\n      for (int g = 0; g < r; g++) {\n        for (int h = 0; h < r; h++) {\n          mat[g][h] -= minl[h];\n        }\n      }\n      sum += mat[1][1];\n      for (int g = 1; g < r - 1; g++) {\n        for (int h = 0; h < r; h++)\n          mat[g][h] = mat[g + 1][h];\n      }\n      for (int h = 1; h < r - 1; h++) {\n        for (int g = 0; g < r - 1; g++) {\n          mat[g][h] = mat[g][h + 1];\n        }\n      }\n      r--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32988", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint str[101][101];\n\nint main() {\n  int n, sum;\n  void oper1(int);\n  void oper2(int);\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> str[i][j];\n    sum = 0;\n    for (int i = n; i > 1; i--) {\n      oper1(i);\n      sum += str[1][1];\n      oper2(i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid oper1(int n) {\n  int i, j, min;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    min = str[i][0];\n    for (j = 1; j < n; j++)\n      if (str[i][j] < min)\n        min = str[i][j];\n    for (j = 0; j < n; j++)\n      str[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = str[0][j];\n    for (i = 1; i < n; i++)\n      if (str[i][j] < min)\n        min = str[i][j];\n    for (i = 0; i < n; i++)\n      str[i][j] -= min;\n  }\n}\nvoid oper2(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\n"}
{"label": "18", "index": "32989", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint i, j, k, l;\nint a[100][100];\nint xiao(int n) {\n  int min, s;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++)\n      min = (a[j][k] < min) ? a[j][k] : min;\n    for (k = 0; k < n; k++)\n      a[j][k] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++)\n      min = (a[k][j] < min) ? a[k][j] : min;\n    for (k = 0; k < n; k++)\n      a[k][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  s = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n -= 1;\n  return (s + xiao(n));\n}\nint main() {\n\n  int n, result[100];\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    result[l] = xiao(n);\n  }\n  for (l = 0; l < n; l++)\n    cout << result[l] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int a[n][n], i, j, sum = 0;\n    int min[n], liemin[n];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n; i++)\n      min[i] = a[i][0];\n    for (i = 0; i < n; i++)\n      liemin[i] = a[0][i];\n\n    int scale = n;\n    while (scale > 1) {\n      for (i = 0; i < scale; i++) {\n        for (j = 0; j < scale; j++) {\n          if (a[i][j] < min[i])\n            min[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min[i];\n\n      for (j = 0; j < scale; j++)\n        for (i = 0; i < scale; i++) {\n          if (a[i][j] < liemin[j])\n            liemin[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - liemin[j];\n        }\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < scale; i++)\n        for (j = 1; j < scale; j++)\n          a[i][j] = a[i][j + 1];\n\n      for (j = 0; j < scale; j++)\n        for (i = 1; i < scale; i++)\n          a[i][j] = a[i + 1][j];\n\n      scale = scale - 1;\n      for (i = 0; i < scale; i++)\n        min[i] = a[i][0];\n      for (i = 0; i < scale; i++)\n        liemin[i] = a[0][i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32991", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int l = 1; l < n; l++) {\n      for (i = l; i <= n; i++) {\n        m = a[i][l];\n        for (j = l + 1; j <= n; j++) \n        {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (j = l; j <= n; j++) \n          a[i][j] = a[i][j] - m;\n      }\n      for (j = l; j <= n; j++) {\n        m = a[l][j];\n        for (i = l + 1; i <= n; i++) \n        {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (i = l; i <= n; i++)\n          a[i][j] = a[i][j] - m;\n      }\n      sum = sum + a[l][l];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) \n  {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(a[k][i] + j);\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) \n  {\n    h = n;\n    for (q = 1; q <= n - 1; q++) \n    {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (*(a[p][i] + j) < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][i] + k) = *(a[p][i] + k) - min;\n        }\n      } \n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (*(a[p][i] + j) < min)\n            min = *(a[p][i] + j);\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][k] + j) = *(a[p][k] + j) - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        *(a[p][2] + i) = 0;\n      for (j = 1; j <= h; j++)\n        *(a[p][j] + 2) = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][j] + i - 1) = *(a[p][j] + i);\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][i - 1] + j) = *(a[p][i] + j);\n        }\n      }\n      h -= 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0};\nint n;\nint count1 = 0;\nint (*p)[100] = NULL;\nint deal();\nint main() {\n  int i, j, k;\n  cin >> n;\n  p = a;\n  for (k = 0; k < n; k++) {\n    count1 = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    deal();\n  }\n  return 0;\n}\nint deal() {\n  int min;\n  int i, j, k;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < n; i++) {\n      min = *(*(p + i));\n      for (j = 0; j < n; j++)\n        if (*(*(p + i) + j) < min)\n          min = *(*(p + i) + j);\n\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      for (i = 0; i < n; i++)\n        if (*(*(p + i) + j) < min) {\n          min = *(*(p + i) + j);\n        }\n      for (i = 0; i < n; i++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    count1 += *(*(p + 1) + 1);\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++) {\n        *(*(p + i) + j) = *(*(p + i + 1) + j);\n      }\n    for (j = 1; j < n - 1; j++)\n      for (i = 0; i < n; i++) {\n        *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n  }\n  cout << count1 << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "32994", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[110][110], i, j, x, min = 10000, sum = 0, k;\n  int(*p)[110] = a;\n  cin >> x;\n  for (k = 1; k <= x; k++) {\n    sum = 0;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= x; j++)\n        cin >> *(*(p + i) + j);\n    for (n = x; n >= 2; n--) {\n      for (i = 1; i <= n; i++) {\n        min = 100000;\n        for (j = 1; j <= n; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 1; j <= n; j++) {\n        min = 100000;\n        for (i = 1; i <= n; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 2) + 2);\n      for (i = 2; i <= n - 1; i++)\n        for (j = 1; j <= n; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      for (j = 2; j <= n - 1; j++)\n        for (i = 1; i <= n; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "32995", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[101][101]; \nint n;\n\nint search(int m) \n{\n  int i, j, k, min;\n  if (m > n)\n    return 0;\n  \n  for (i = 1; i <= n; i++)\n    if (a[i][0] != -1) {\n      min = 99999999;\n      for (j = 1; j <= n; j++)\n        if ((a[0][j] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (j = 1; j <= n; j++)\n        if (a[0][j] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n  \n  for (j = 1; j <= n; j++)\n    if (a[0][j] != -1) {\n      min = 99999999;\n      for (i = 1; i <= n; i++)\n        if ((a[i][0] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (i = 1; i <= n; i++)\n        if (a[i][0] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n  i = a[m][m];\n  a[m][0] = -1;\n  a[0][m] = -1; \n  return (i + search(m + 1));\n}\nint main() {\n  int i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= n; i++) {\n      a[0][i] = 0;\n      a[i][0] = 0;\n    }\n    cout << search(2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "32996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = a[j][0];\n        for (k = 1; k < i; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < i; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = a[0][j];\n        for (k = 1; k < i; k++)\n          if (a[k][j] < min)\n            min = a[k][j];\n        for (k = 0; k < i; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[k][j - 1] = a[k][j];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[j - 1][k] = a[j][k];\n    }\n    cout << sum << endl;\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "32997", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal(int matrix[][120], int n) {\n  if (n == 1)\n    return (0);\n  int i, j, min, s;\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] < min)\n        min = matrix[i][j];\n    }\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[j][i] < min)\n        min = matrix[j][i];\n    }\n    for (j = 0; j < n; j++)\n      matrix[j][i] = matrix[j][i] - min;\n  }\n  s = matrix[1][1];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i + 1][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      matrix[i][j] = matrix[i][j + 1];\n\n  return (s + cal(matrix, n - 1));\n}\n\nint main() {\n  int n, i, j, k;\n  int a[120][120];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    printf(\"%d\\n\", cal(a, n));\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "32998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n  int min = a[hang][1];\n  for (i = 1; i <= geshu; i++) {\n    if (a[hang][i] < min)\n      min = a[hang][i];\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = a[1][lie];\n  for (i = 1; i <= geshu; i++) {\n    if (a[i][lie] < min)\n      min = a[i][lie];\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[mm][i] = a[mm][i] - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[i][mm] = a[i][mm] - Minlie;\n      }\n\n      sum += a[2][2];\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[ii][i - 1] = a[ii][i];\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[i - 1][ii] = a[i][ii];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "32999", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(int (*p)[100], int n) {\n  int sum, i, j, min = 0;\n  sum = 0;\n  {\n    for (i = 0; i < n; i++) {\n      min = **(p + i);\n      {\n        for (j = 1; j < n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n    }\n  }\n  {\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      {\n        {\n          for (i = 1; i < n; i++)\n            if (*(*(p + i) + j) < min)\n              min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n        sum = *(*(p + 1) + 1);\n      }\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        *(*p + i) = *(*p + i + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        **(p + i) = **(p + i + 1);\n    }\n    return (sum);\n  }\n}\nint main() {\n  int(*p)[100], (*q)[100], n, i, j, sum = 0, k;\n  p = (int(*)[100])malloc(100 * sizeof(int) * 10000);\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + k * n + i) + j);\n  }\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    q = p + k * n;\n    {\n      for (i = n; i > 1; i--)\n        sum = sum + f(q, i);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33000", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100][100];\nint matrix(int a[][100], int n) {\n  int temp1[100], temp2[100];\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    temp1[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (temp1[i] > a[i][j])\n        temp1[i] = a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - temp1[i];\n  for (i = 0; i < n; i++) {\n    temp2[i] = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (temp2[i] > a[j][i])\n        temp2[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - temp2[i];\n\n  int sum;\n  sum = a[1][1];\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n\n  if (n > 2) {\n    sum = sum + matrix(a, n - 1);\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (i = 0; i < n; i++)\n    cout << matrix(a[i], n) << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33001", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  scanf(\"%d \", &n);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n\n        cin >> num[j][k];\n    cout << del(num, n) << endl;\n  }\n  return 0;\n}\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min)\n        min = num[j][i];\n    }\n\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  int sum, Min;\n  cin >> n;\n  for (int num = 0; num < n; num++) \n  {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int x = 1; x < n; x++) \n    {\n      for (int i = 0; i < n; i++) \n      {\n        Min = 10000;\n        for (int col = 0; col < n; col++)\n          if (a[i][col] >= 0)\n            Min = Min < a[i][col] ? Min : a[i][col];\n        for (int col = 0; col < n; col++)\n          a[i][col] -= Min;\n      }\n      for (int i = 0; i < n; i++) \n      {\n        Min = 10000;\n        for (int row = 0; row < n; row++)\n          if (a[row][i] >= 0)\n            Min = Min < a[row][i] ? Min : a[row][i];\n        for (int row = 0; row < n; row++)\n          a[row][i] -= Min;\n      }\n      sum += a[x][x];\n      for (int i = 0; i < n; i++)\n        a[x][i] = -1;\n      for (int i = 0; i < n; i++)\n        a[i][x] = -1; \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33003", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[101][101], min, he = 0, l, r, nn;\n  cin >> n;\n  nn = n;\n  for (nn = n; nn >= 1; nn--) {\n    he = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(num + i) + j);\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      min = 999999;\n      for (l = 1; l <= n - k + 1; l++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + l) + i))\n            min = *(*(num + l) + i);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + l) + i) = *(*(num + l) + i) - min;\n        }\n      }\n      for (r = 1; r <= n - k + 1; r++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + i) + r))\n            min = *(*(num + i) + r);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++)\n          *(*(num + i) + r) = *(*(num + i) + r) - min;\n      }\n      he = he + *(*(num + 2) + 2);\n      for (l = 1; l <= n - k + 1; l++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + l) + i) = *(*(num + l) + (i + 1));\n        }\n      }\n      for (r = 1; r <= n - k; r++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + i) + r) = *(*(num + (i + 1)) + r);\n        }\n      }\n    }\n    cout << he << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, t;\nint n;\nint sum;\nint a[100][100];\nint f(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[ii][0];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ii][ij] < minn)\n        minn = a[ii][ij];\n    for (int ij = 0; ij < x; ij++)\n      a[ii][ij] = a[ii][ij] - minn;\n  }\n}\nint g(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[0][ii];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ij][ii] < minn)\n        minn = a[ij][ii];\n    for (int ij = 0; ij < x; ij++)\n      a[ij][ii] = a[ij][ii] - minn;\n  }\n}\nint h(int x) {\n  sum = sum + a[1][1];\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[ii][jj] = a[ii][jj + 1];\n  }\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[jj][ii] = a[jj + 1][ii];\n  }\n}\nint main() {\n\n  cin >> n;\n  for (int qqq = 0; qqq < n; qqq++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (i = n; i > 1; i--) {\n      f(i);\n      g(i);\n      h(i);\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint result = 0;\nint min1;\nint minh(int n, int j) {\n  int i, min_a;\n  min_a = a[j][0];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[j][i]) {\n      min_a = a[j][i];\n    }\n  }\n  return min_a;\n}\nint minl(int n, int j) {\n  int i, min_a;\n  min_a = a[0][j];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[i][j]) {\n      min_a = a[i][j];\n    }\n  }\n  return min_a;\n}\nint dec(int n) {\n  int m, p;\n  if (n == 1) {\n    cout << result << endl;\n    return 0;\n  }\n  if (n > 1) {\n    for (m = 0; m < n; m++) {\n      min1 = minh(n, m);\n      for (p = 0; p < n; p++) {\n        a[m][p] = a[m][p] - min1;\n      }\n    }\n    for (m = 0; m < n; m++) {\n      min1 = minl(n, m);\n      for (p = 0; p < n; p++) {\n        a[p][m] = a[p][m] - min1;\n      }\n    }\n    result = result + a[1][1];\n    for (m = 0; m < n; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[m][p] = a[m][p + 1];\n      }\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[p][m] = a[p + 1][m];\n      }\n    }\n    dec(n - 1);\n  }\n}\nint main(int argc, const char *argv[]) {\n\n  int n;\n  scanf(\"%d \", &n);\n  int w, s, t;\n  for (w = 1; w <= n; w++) {\n    for (s = 0; s < n; s++) {\n\n      for (t = 0; t < n; t++) {\n        cin >> a[s][t];\n      }\n    }\n    result = 0;\n    dec(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint operation(int a[100][100], int m);\nint main() {\n  int n, i, j, k, sum;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, -1, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++)\n      sum = sum + operation(a, n - j + 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint operation(int a[100][100], int m) {\n  int i, j, temp, k, t;\n  for (i = 0; i < m; i++) \n  {\n    int min = a[i][0];\n    for (j = 0; j < m; j++) \n    {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j < m; j++) \n  {\n    int min = a[0][j];\n    for (i = 0; i < m; i++) \n    {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  temp = a[1][1];\n  int b[100][100];\n  memset(b, -1, sizeof(b));\n  for (i = 0, t = 0; i < m; i++, t++) {\n    if (i == 1) {\n      t--;\n      continue;\n    }\n    for (j = 0, k = 0; j < m; j++, k++) {\n      if (j == 1) {\n        k--;\n        continue;\n      } else\n        b[t][k] = a[i][j];\n    }\n  }\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = b[i][j];\n  return temp;\n}\n"}
{"label": "18", "index": "33007", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[50][50][50];\n  int max[101] = {0};\n  int i, j, k, n, min, t = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[i][j][k];\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n - 1; t++) {\n      for (j = 1; j <= n - t; j++) {\n        min = a[i][j][1];\n\n        for (k = 1; k <= n - t; k++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      for (k = 1; k <= n - t; k++) {\n        min = a[i][1][k];\n        for (j = 1; j <= n - t; j++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      max[i] = max[i] + a[i][2][2];\n      for (j = 2; j <= n - t - 1; j++) {\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n      for (k = 2; k <= n - t - 1; k++) {\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << max[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33008", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, p;\n  cin >> m;\n  n = m;\n  p = m;\n  while (n--) {\n    m = p;\n    int sum = 0, i, j, a[120][120], min;\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        cin >> a[i][j];\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        for (min = a[i][0], j = 0; j <= m; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= m; j++) {\n        for (min = a[0][j], i = 0; i <= m; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j <= m - 1; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, s, m, a[10000];\n  int *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  p = a;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n; i++) {\n      p1 = p + 100 * i;\n      for (j = 0; j < n; j++) {\n        p2 = p1 + j;\n        scanf(\"%d\", p2);\n      }\n    }\n    s = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n; i++) {\n        p1 = p + i * 100;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          *p2 = *p2 - m;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        p1 = p + i;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          *p2 = *p2 - m;\n        }\n      }\n      s = s + *(p + 101 * (k + 1));\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33010", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint matrixx[110][110];\n\nvoid Del() {\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[i][j] = matrixx[i + 1][j];\n    }\n  }\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[j][i] = matrixx[j][i + 1];\n    }\n  }\n  return;\n}\nint main() {\n  cin >> n;\n  int minnum;\n  int sum;\n  for (int s = 1; s <= n; s++) {\n    sum = 0;\n    for (int j = 1; j <= n; j++) {\n      for (int k = 1; k <= n; k++) {\n        cin >> matrixx[j][k];\n      }\n    }\n    for (int x; x < 3000; x++) {\n      if (x == 5) {\n        int y = 0;\n        y++;\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[j][k];\n          else\n            minnum = min(minnum, matrixx[j][k]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[j][k] -= minnum;\n        }\n      }\n\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[k][j];\n          else\n            minnum = min(minnum, matrixx[k][j]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[k][j] -= minnum;\n        }\n      }\n      sum += matrixx[2][2];\n      Del();\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33011", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, l, m;\n  double a[100][100];\n  int min;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 1; l < n; l++) {\n\n      for (j = 0; j < n; j++) {\n        k = 0;\n        while (a[j][k] < 0)\n          k++;\n        while (k < n) {\n          min = a[j][k];\n          for (; k < n; k++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (k = 0; k < n; k++)\n            a[j][k] -= min;\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        j = 0;\n        while (a[j][k] < 0)\n          j++;\n        while (j < n) {\n          min = a[j][k];\n          for (j = 1; j < n; j++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (j = 0; j < n; j++)\n            a[j][k] -= min;\n        }\n      }\n\n      sum += a[l][l];\n      for (m = 0; m < n; m++) {\n        a[l][m] = -1;\n        a[m][l] = -1;\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33012", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int c = 0; c < n; c++) {\n    int a[100][100] = {0}, rmin[100] = {0}, cmin[100] = {0}, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n      cmin[i] = a[0][i];\n      rmin[i] = a[i][0];\n    }\n    for (int k = 0; k < n - 1; k++) {\n      for (int i = 0; i < n - k; i++) {\n        cmin[i] = a[0][i];\n        rmin[i] = a[i][0];\n      }\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (rmin[i] > a[i][j]) {\n            rmin[i] = a[i][j];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[i][j] -= rmin[i];\n        }\n      }\n\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (cmin[i] > a[j][i]) {\n            cmin[i] = a[j][i];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[j][i] -= cmin[i];\n        }\n      }\n      sum += a[1][1];\n      for (int i = 2; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (int j = 2; j < n - k; j++) {\n        for (int i = 0; i < n - k; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33013", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[102][102], b[101], c[101], n;\nvoid f(int a[102][102]);\nint main() {\n  int i = 0, j = 0, k = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(a);\n  }\n\n  return 0;\n}\nvoid f(int a[][102]) {\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (i >= k || i == 0) {\n        b[i] = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n\n        for (j = 0; j < n; j++)\n          a[i][j] -= b[i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (j >= k || j == 0) {\n        c[j] = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (c[j] > a[i][j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= c[j];\n      }\n    }\n    sum += a[k][k];\n    \n    for (i = 0; i < n; i++) {\n      a[i][k] = 1000000;\n      a[k][i] = 1000000;\n    }\n  }\n  cout << sum << endl;\n}\n"}
{"label": "18", "index": "33014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, h = 0, n1 = 0, sum = 0;\n  cin >> n;\n  int s[n + 1][n + 1];\n  for (i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++) {\n      for (h = 0; h < n; h++) {\n        cin >> s[k][h];\n      }\n    }\n    sum = 0;\n    for (n1 = n; n1 >= 2; n1--) {\n      for (j = 0; j <= n1 - 1; j++) {\n        s[j][n1] = s[j][0];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[j][h] < s[j][n1])\n            s[j][n1] = s[j][h];\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[j][h] = s[j][h] - s[j][n1];\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        s[n1][j] = s[0][j];\n        for (h = 0; h <= n1 - 1; h++) {\n          if (s[h][j] < s[n1][j]) {\n            s[n1][j] = s[h][j];\n          }\n        }\n      }\n      for (j = 0; j <= n1 - 1; j++) {\n        for (h = 0; h <= n1 - 1; h++) {\n          s[h][j] = s[h][j] - s[n1][j];\n        }\n      }\n      sum = sum + s[1][1];\n      if (n1 > 2) {\n        for (j = 2; j <= n1 - 1; j++) {\n          s[0][j - 1] = s[0][j];\n          s[j - 1][0] = s[j][0];\n        }\n        for (j = 1; j <= n1 - 2; j++) {\n          for (h = 1; h <= n1 - 2; h++) {\n            s[j][h] = s[j + 1][h + 1];\n          }\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, min1;\nint a[110][110];\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < min1)\n    min1 = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= min1;\n}\nint main() {\n  cin >> n;\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = 0, m = n; m > 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        min1 = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int q = 0;\n  while (q < n) {\n    int a[110][110] = {0}, (*p)[110] = a;\n    int o = n, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n    while (o > 0) {\n      int min[110][2] = {0}, (*q)[2] = min;\n      memset(min, 10000, sizeof(min));\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          if (*(*(p + i) + j) < *(*(q + i)))\n            *(*(q + i)) = *(*(p + i) + j);\n        }\n      }\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) -= *(*(q + i));\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          if (*(*(p + i) + j) < *(*(q + j) + 1))\n            *(*(q + j) + 1) = *(*(p + i) + j);\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++)\n          *(*(p + i) + j) -= *(*(q + j) + 1);\n      }\n      sum += *(*(p + 1) + 1);\n      for (int i = 0; i < o; i++) {\n        for (int j = 1; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (int i = 1; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      o--;\n    }\n    printf(\"%d\\n\", sum);\n    q++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint f(int n, int a[][100]) \n{\n  int i, j, k;\n  for (i = 0; i < n; i++) \n  {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) \n  {\n    int min = a[0][j];\n    for (i = 1; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n  }\n  int z = a[1][1];\n  for (i = 1; i < n - 1; i++) { \n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  if (n == 2)\n    return z;\n  else\n    return z + f(n - 1, a);\n}\nint main() {\n  int n;\n  int i, j, k; \n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << f(n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33018", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100][2];\n  for (int p = 1; p <= n; p++) {\n    int sum = 0;\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j][1];\n        a[i][j][0] = 1;\n      }\n    }\n    for (int q = 1; q <= n - 1; q++) {\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[i][0][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          if (a[i][j][1] < min) {\n            min = a[i][j][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          a[i][j][1] -= min;\n        }\n      }\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[0][i][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          if (a[j][i][1] < min) {\n            min = a[j][i][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0) {\n            continue;\n          }\n          a[j][i][1] -= min;\n        }\n      }\n      sum += a[q][q][1];\n      for (int i = 0; i <= n - 1; i++) {\n        a[q][i][0] = 0;\n        a[i][q][0] = 0;\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid zero1(int *p, int n) {\n  int i, c;\n  c = *p;\n  for (i = 1; i < n; i++)\n    if (*(p + i) < c)\n      c = *(p + i);\n  for (i = 0; i < n; i++)\n    p[i] = p[i] - c;\n}\nvoid zero2(int **p, int n, int t) {\n  int i, c;\n  c = *(*p + t);\n  for (i = 1; i < n; i++)\n    if (*(*(p + i) + t) < c)\n      c = *(*(p + i) + t);\n  for (i = 0; i < n; i++)\n    *(*(p + i) + t) = *(*(p + i) + t) - c;\n}\nvoid cut(int **p, int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + j) + i) = *(*(p + j) + i + 1);\n}\nint main() {\n  int n, m, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &m);\n  p = (int **)malloc(m * sizeof(int *));\n  for (i = 0; i < m; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (w = 0; w < m; w++) {\n    n = m;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + i) + j);\n    for (i = 0; i < n; i++)\n      zero1(p[i], n);\n    for (i = 0; i < n; i++)\n      zero2(p, n, i);\n    c = p[1][1];\n    for (i = 0; i < m - 2; i++) {\n      cut(p, n);\n      n--;\n      for (j = 0; j < n; j++)\n        zero1(p[j], n);\n      for (j = 0; j < n; j++)\n        zero2(p, n, j);\n      c += p[1][1];\n    }\n    cout << c << \"\\n\";\n  }\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n  return 0;\n}\n"}
{"label": "18", "index": "33020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int n);\nint f(int b[][100], int n);\nint main() {\n  int m, n, i, j;\n  cin >> n;\n  m = n;\n  while (m--) {\n    int a[100][100] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << f(a, n) << endl;\n  }\n  return 0;\n}\nint min(int a[], int n) {\n  int mini = a[0], i;\n  for (i = 1; i < n; i++) {\n    if (a[i] < mini)\n      mini = a[i];\n  }\n  return mini;\n}\nint f(int b[][100], int n) {\n  int i, j, m, t, lmin;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      m = min(b[i], n);\n      for (j = 0; j < n; j++)\n        b[i][j] = b[i][j] - m;\n    }\n    for (i = 0; i < n; i++) {\n      lmin = b[0][i];\n      for (j = 0; j < n; j++) {\n        if (b[j][i] < lmin)\n          lmin = b[j][i];\n      }\n      if (lmin > 0)\n        for (j = 0; j < n; j++)\n          b[j][i] = b[j][i] - lmin;\n    }\n    t = b[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        b[i][j] = b[i][j + 1];\n    for (i = 0; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        b[j][i] = b[j + 1][i];\n    return f(b, --n) + t;\n  }\n}\n"}
{"label": "18", "index": "33021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, nn, a[100][100], sum, min;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    nn = n;\n    while (nn > 1) {\n      for (i = 0; i < nn; i++) {\n        min = a[i][0];\n        for (j = 0; j < nn; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < nn; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < nn; j++) {\n        min = a[0][j];\n        for (i = 0; i < nn; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i < nn; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < nn - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < nn - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < nn - 1; i++)\n        for (j = 1; j < nn - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      nn = nn - 1;\n    }\n    if (k == 1)\n      cout << sum;\n    else\n      printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33022", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sm1(int line, int sum1, int array1[100][100]) {\n  int min = array1[line][0];\n  for (int i = 0; i < sum1; i++)\n    if (min > array1[line][i])\n      min = array1[line][i];\n  return min;\n}\nint sm2(int row, int sum2, int array2[100][100]) {\n  int min = array2[0][row];\n  for (int i = 0; i < sum2; i++)\n    if (min > array2[i][row])\n      min = array2[i][row];\n  return min;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int step = 0; step < n; step++) {\n    int jz[100][100], he = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    for (int Count = 0; Count < n - 1; Count++) {\n      for (int i = 0; i < n - Count; i++) {\n        int minl = sm1(i, n - Count, jz);\n        for (int j = 0; j < n - Count; j++)\n          jz[i][j] -= minl;\n      }\n      for (int j = 0; j < n - Count; j++) {\n        int minr = sm2(j, n - Count, jz);\n        for (int i = 0; i < n - Count; i++)\n          jz[i][j] -= minr;\n      }\n      he += jz[1][1];\n      for (int i = 2; i < n - Count; i++)\n        for (int j = 2; j < n - Count; j++)\n          jz[i - 1][j - 1] = jz[i][j];\n      for (int i = 2; i < n - Count; i++)\n        jz[i - 1][0] = jz[i][0];\n      for (int j = 2; j < n - Count; j++)\n        jz[0][j - 1] = jz[0][j];\n    }\n    cout << he << \"\\n\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33023", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int k, l, sum = 0;\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++)\n        cin >> a[k][l];\n    }\n    int h = n;\n    do {\n      for (k = 0; k < h; k++) {\n        int min = a[k][0];\n        for (l = 0; l < h; l++) {\n          if (a[k][l] <= min)\n            min = a[k][l];\n        }\n        for (l = 0; l < h; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (l = 0; l < h; l++) {\n        int x = a[0][l];\n        for (k = 0; k < h; k++) {\n          if (a[k][l] <= x)\n            x = a[k][l];\n        }\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l] - x;\n      }\n      sum = sum + a[1][1];\n      h = h - 1;\n      for (k = 1; k < h; k++) {\n        for (l = 0; l < h + 1; l++)\n          a[k][l] = a[k + 1][l];\n      }\n      for (l = 1; l < h; l++) {\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l + 1];\n      }\n    } while (h > 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33024", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, s1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int s = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    s1 = n;\n    while (s1 > 1) {\n      for (j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (k = 1; k < n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        int min1 = a[0][k];\n        for (j = 1; j < n; j++)\n          if (a[j][k] < min1)\n            min1 = a[j][k];\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min1;\n      }\n      s = s + a[1][1];\n      s1 = s1 - 1;\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[120][120];\nint math(int);\nint n;\nint main() {\n  int sum, b, c;\n  scanf(\"%d \", &n);\n  c = n;\n  while (c--) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = math(n);\n\n    b = n;\n    while (b--) {\n      for (int i = 2; i < b + 1; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < b + 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int i = 2; i < b + 1; i++)\n        for (int j = 2; j < b + 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      if (b == 1)\n        break;\n      sum = math(b) + sum;\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\nint math(int x) {\n  int min[x];\n  for (int i = 0; i < x; i++)\n    min[i] = a[i][0];\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - min[i];\n\n  int minl[x];\n  for (int i = 0; i < x; i++)\n    minl[i] = a[0][i];\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[j][i] < minl[i])\n        minl[i] = a[j][i];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - minl[j];\n\n  return a[1][1];\n}\n"}
{"label": "18", "index": "33026", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() \n{\n  int n = 0, i = 0, j = 0, k = 0, s = 0;\n  int b[100], a[100][100]; \n  cin >> n;\n  for (i = 0; i < n; i++) \n  {\n    for (j = 0; j < n; j++) { \n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (s = n; s > 1; s--) \n    {\n      int min1 = 10000;\n      for (j = 0; j < n; j++) \n      {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min1) {\n            min1 = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= min1;\n        }\n      }\n      for (j = 0; j < n; j++) \n      {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[k][j] < min1) {\n            min1 = a[k][j];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[k][j] -= min1;\n        }\n      }\n      b[n - s] = a[1][1];     \n      for (j = 2; j < n; j++) \n      {\n        for (k = 0; k < n; k++) {\n          a[k][j - 1] = a[k][j];\n        }\n      }\n      for (k = 2; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n    }\n    int sum = 0;\n    for (k = 0; k < n - 1; k++) \n    {\n      sum = sum + b[k];\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33027", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  cin >> n;\n  int a[100][100];\n  int sum = 0, temp = 1;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min;\n    sum = 0;\n    temp = 1;\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      sum += a[temp][temp];\n      for (i = 0; i < n; i++)\n        a[i][temp] = -1;\n      for (j = 0; j < n; j++)\n        a[temp][j] = -1;\n      temp++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33028", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  int n;\n  int sum;\n  int min;\n  cin >> n;\n\n  int m[n][n][n];\n\n  for (int k = 0; k < n; k++) {\n    for (int x = 0; x < n; x++) {\n      for (int y = 0; y < n; y++) {\n        cin >> m[k][x][y];\n      }\n    }\n\n    sum = 0;\n\n    for (int l = 1; l < n; l++) {\n\n      for (int x = 0; x < n; x++) {\n        min = *min_element(m[k][x], m[k][x] + n);\n        for (int y = 0; y < n; y++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      for (int y = 0; y < n; y++) {\n        min = m[k][0][y];\n        for (int x = 1; x < n; x++) {\n          if (m[k][x][y] < min)\n            min = m[k][x][y];\n        }\n        for (int x = 0; x < n; x++) {\n          m[k][x][y] -= min;\n        }\n      }\n\n      sum += m[k][l][l];\n\n      for (int i = 0; i < n; i++) {\n        m[k][l][i] = m[k][0][i];\n        m[k][i][l] = m[k][i][0];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33029", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[200][200], x, p, q, min, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n\n    for (x = n; x >= 2; x--) {\n      for (p = 1; p <= x; p++) {\n        min = 10000;\n        for (q = 1; q <= x; q++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (q = 1; q <= x; q++)\n          a[p][q] = a[p][q] - min;\n      }\n      for (q = 1; q <= x; q++) {\n        min = 10000;\n        for (p = 1; p <= x; p++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (p = 1; p <= x; p++)\n          a[p][q] = a[p][q] - min;\n      }\n      sum = sum + a[2][2];\n      for (p = 1; p <= x; p++)\n        for (q = 2; q <= x - 1; q++)\n          a[p][q] = a[p][q + 1];\n      for (q = 1; q <= x - 1; q++)\n        for (p = 2; p <= x - 1; p++)\n          a[p][q] = a[p + 1][q];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, min;\n\nvoid XJ(int a[][100], int n) {\n  int b[100][100] = {0};\n  b[0][0] = a[0][0];\n  for (i = 1; i < n - 1; i++) {\n    b[0][i] = a[0][i + 1];\n    b[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\n\nint MIN(int a[][100], int n, int sum) {\n  if (n == 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    XJ(a, n);\n    return MIN(a, n - 1, sum);\n  }\n}\n\nint main() {\n  int a[100][100] = {0}, k;\n  scanf(\"%d \", &n);\n  int ii;\n  int jj;\n  for (ii = 0; ii < n; ii++) {\n\n    for (jj = 0; jj < n; jj++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[jj][k]);\n      }\n    }\n    cout << MIN(a, n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint check() {\n  int a[n][n];\n  int c, i, j, mi, mj, r = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      scanf(\"%d\", &a[i][j]);\n  for (c = n; c > 1; c--) {\n    for (i = 0; i < c; i++) {\n      mi = a[i][0];\n      for (j = 0; j < c; j++)\n        if (mi > a[i][j])\n          mi = a[i][j];\n      for (j = 0; j < c; j++)\n        a[i][j] -= mi;\n    }\n    for (j = 0; j < c; j++) {\n      mj = a[0][j];\n      for (i = 0; i < c; i++)\n        if (mj > a[i][j])\n          mj = a[i][j];\n      for (i = 0; i < c; i++)\n        a[i][j] -= mj;\n    }\n    r += a[c - 2][c - 2];\n    a[c - 2][c - 2] = a[c - 1][c - 1];\n    for (i = 0; i < c - 2; i++)\n      a[i][c - 2] = a[i][c - 1];\n    for (j = 0; j < c - 2; j++)\n      a[c - 2][j] = a[c - 1][j];\n  }\n  return r;\n}\nint main() {\n  int z;\n  scanf(\"%d\", &n);\n  for (z = 0; z < n; z++)\n    printf(\"%d\\n\", check());\n  return 0;\n}\n"}
{"label": "18", "index": "33032", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int sum) {\n  int i, j, min1, min2;\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  } else {\n\n    for (i = 0; i < n; i++) {\n      min1 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min1 > a[i][j])\n          min1 = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min1;\n    }\n\n    for (i = 0; i < n; i++) {\n      min2 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min2 > a[j][i])\n          min2 = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min2;\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n    change(a, n - 1, sum);\n  }\n}\nint main() {\n  int n, a[100][100], i, j, k, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    change(a, n, sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0}, sum = 0;\nvoid guiling(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 2; i < n; i++)\n    a[i - 1][0] = a[i][0];\n  for (j = 2; j < n; j++)\n    a[0][j - 1] = a[0][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int i, j, n, k, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    while (m > 2) {\n      guiling(m);\n      xiaojian(m);\n      m--;\n    }\n    guiling(2);\n    sum += a[1][1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = a[j][0];\n        for (k = 1; k < i; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < i; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = a[0][j];\n        for (k = 1; k < i; k++)\n          if (a[k][j] < min)\n            min = a[k][j];\n        for (k = 0; k < i; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[k][j - 1] = a[k][j];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[j - 1][k] = a[j][k];\n    }\n    cout << sum << endl;\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "33035", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[1000][1000] = {0};\nint sum(int n) {\n  int i, j, x, t;\n  int p, q;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + i) + j))\n        x = *(*(a + i) + j);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + i) + j)) -= x;\n  }\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + j) + i))\n        x = *(*(a + j) + i);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + j) + i)) -= x;\n  }\n  t = *(*(a + 1) + 1);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n  return (t + sum(n - 1));\n}\nint main() {\n  int n, i, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        cin >> a[p][q];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n\n        cin >> num[j][k];\n    cout << del(num, n) << endl;\n  }\n  return 0;\n}\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n      }\n    }\n\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c[100], a[100][100], sum, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = 1; l <= n - 1; l++) {\n\n      c[0] = a[0][0];\n      for (k = l; k < n; k++) {\n        if (c[0] > a[0][k])\n          c[0] = a[0][k];\n      }\n      for (k = 0; k < n; k++)\n        a[0][k] = a[0][k] - c[0];\n\n      c[0] = a[0][0];\n      for (j = l; j < n; j++) {\n        c[j] = a[j][0];\n        for (k = l; k < n; k++) {\n          if (c[j] > a[j][k])\n            c[j] = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - c[j];\n      }\n      for (k = l; k < n; k++) {\n        c[k] = a[0][k];\n        for (j = l; j < n; j++) {\n          if (c[k] > a[j][k])\n            c[k] = a[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - c[k];\n        }\n      }\n      for (j = l; j < n; j++) {\n        if (c[0] > a[j][0]) {\n          c[0] = a[j][0];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][0] = a[j][0] - c[0];\n      }\n      sum = sum + a[l][l];\n    }\n    printf(\"%d \", sum);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "18", "index": "33038", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], n, t;\n  cin >> n;\n  for (int x = 0; x < n; x++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[x][i][j];\n    }\n  }\n  for (int x = 0; x < n; x++) {\n    int sum = 0;\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = a[x][i][0];\n        for (int j = 0; j < m; j++) {\n          if (a[x][i][j] < min) {\n            min = a[x][i][j];\n          }\n        }\n        for (int k = 0; k < m; k++)\n          a[x][i][k] -= min;\n      }\n      for (int j = 0; j < m; j++) {\n        int min = a[x][0][j];\n        for (int i = 0; i < m; i++) {\n          if (a[x][i][j] < min)\n            min = a[x][i][j];\n        }\n        for (int k = 0; k < m; k++)\n          a[x][k][j] -= min;\n      }\n      sum += a[x][1][1];\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < m; j++) {\n          if (i == 0 && j > 1) {\n            a[x][i][j - 1] = a[x][i][j];\n          }\n          if (i > 1) {\n            if (j == 0) {\n              a[x][i - 1][j] = a[x][i][j];\n            }\n            if (j > 1) {\n              a[x][i - 1][j - 1] = a[x][i][j];\n            }\n          }\n        }\n      }\n      m--;\n    }\n    cout << sum << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sub(int a[1000], int n) {\n  int i, min = a[0];\n  for (i = 1; i < n; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < n; i++)\n    a[i] -= min;\n}\nint main() {\n  int n, k, i, j, count, sum;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int a[1000][1000], temp[1000];\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (count = 0; count < n - 1; count++) {\n      for (i = count; i < n; i++) {\n        for (j = count; j < n; j++)\n          temp[j - count] = a[i][j];\n        sub(temp, n - count);\n        for (j = count; j < n; j++)\n          a[i][j] = temp[j - count];\n      }\n      for (j = count; j < n; j++) {\n        for (i = count; i < n; i++)\n          temp[i - count] = a[i][j];\n\n        sub(temp, n - count);\n        for (i = count; i < n; i++)\n          a[i][j] = temp[i - count];\n      }\n      sum += a[count + 1][count + 1];\n      for (i = 0; i < n; i++)\n        a[i][count + 1] = a[i][count];\n      for (j = 0; j < n; j++)\n        a[count + 1][j] = a[count][j];\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33040", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, m, i, j, x, y;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    int s = 0, t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (y = n; y >= 2; y--) {\n      for (i = 0; i < n - t; i++) {\n        x = a[i][0];\n        for (j = 0; j < n - t; j++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (j = 0; j < n - t; j++)\n          a[i][j] -= x;\n      }\n      for (j = 0; j < n - t; j++) {\n        x = a[0][j];\n        for (i = 0; i < n - t; i++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (i = 0; i < n - t; i++)\n          a[i][j] -= x;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      t++;\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33041", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int n, i, j, k, l;\n  int min;\n  int x = 0;\n  cin >> n;\n  for (l = 0; l <= n - 1; ++l) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    x = 0;\n    for (k = 0; k <= n - 2; ++k) {\n      for (i = 0; i <= n - k - 1; ++i) {\n        min = a[i][0];\n        for (j = 0; j <= n - k - 1; ++j) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j <= n - k - 1; ++j) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j <= n - k - 1; ++j) {\n        min = a[0][j];\n        for (i = 0; i <= n - k - 1; ++i) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - k - 1; ++i)\n          a[i][j] -= min;\n      }\n      x += a[1][1];\n      for (j = 2; j <= n - k - 1; ++j) {\n        a[0][j - 1] = a[0][j];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        for (j = 2; j <= n - k - 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33042", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[n][n];\n\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int a11 = 0;\n\n    for (int p = n; p >= 2; p--) {\n\n      for (int j = 0; j < p; j++) {\n        int min = a[j][0];\n        for (int k = 1; k < p; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[j][k] -= min;\n      }\n\n      for (int j = 0; j < p; j++) {\n        int min = a[0][j];\n        for (int k = 1; k < p; k++) {\n          if (a[k][j] < min) {\n            min = a[k][j];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[k][j] -= min;\n      }\n      a11 += a[1][1];\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    cout << a11 << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[100][100];\nvoid hang(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  for (int i = 0; i < n; i++)\n    a[m][i] -= min;\n}\nvoid lie(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  for (int i = 0; i < n; i++)\n    a[i][m] -= min;\n}\nvoid del(int a[100][100]) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint main() {\n  int i;\n  cin >> n;\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int k = 0, sum = 0;\n    while (k < n - 1) {\n      for (i = 0; i < n; i++)\n        hang(i);\n      for (i = 0; i < n; i++)\n        lie(i);\n      sum += a[1][1];\n      del(a);\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33044", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid guiling(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i <= n; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n; j++) {\n    min = a[0][j];\n    for (i = 0; i <= n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid shanchu(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i <= n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j <= (n - 1); j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int a[100][100][100], i, j, k, sum, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = n - 1; j >= 1; j--) {\n      guiling(a[i], j);\n      sum = sum + a[i][1][1];\n      shanchu(a[i], j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33045", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid gl(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 1; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < m; i++) {\n    int min = a[0][i];\n    for (j = 1; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n}\n\nvoid xj(int m) {\n  int i, j;\n  for (i = 2; i < m; i++)\n    a[0][i - 1] = a[0][i];\n  for (i = 2; i < m; i++)\n    a[i - 1][0] = a[i][0];\n  for (i = 2; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    int sum = 0;\n    for (i = n; i > 1; i--) {\n      gl(i);\n      sum += a[1][1];\n      xj(i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int, int[][101]);\nvoid Delete(int, int[][101]);\nint min(int, int);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << GL(n, a) << endl;\n  }\n\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum = 0, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = 999999;\n    for (j = 0; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] -= MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = 999999;\n    for (i = 0; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] -= MIN;\n  }\n\n  Sum += a[1][1];\n\n  if (n == 1) {\n    return 0;\n\n  } else {\n    Delete(n, a);\n    Sum += GL(n - 1, a);\n    return Sum;\n  }\n}\n\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\nvoid Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n}\n"}
{"label": "18", "index": "33047", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[102][102] = {0}, sum = 0;\n  cin >> n;\n\n  int i, j, k, cc;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> *(*(a + j) + k);\n      }\n    }\n    cc = n;\n\n    while (cc > 1) {\n      int min = 10000;\n      for (j = 1; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + j) + k)) {\n            min = *(*(a + j) + k);\n          }\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n        }\n        min = 10000;\n      }\n      sum += *(*(a + 2) + 2);\n\n      for (j = 3; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n        }\n      }\n      for (j = 1; j <= cc; j++) {\n        for (k = 3; k <= cc; k++) {\n          *(*(a + j) + k - 1) = *(*(a + j) + k);\n        }\n      }\n      cc--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, n, i, j, temp, sum, count;\n  scanf(\"%d\", &n);\n  int a[101][101];\n  m = n;\n  for (; n > 0; n--) {\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    t = m;\n    for (; t > 2; t--) {\n      for (i = 1; i <= t; i++) {\n        temp = a[i][1];\n        for (j = 2; j <= t; j++)\n          if (temp > a[i][j]) {\n            temp = a[i][j];\n          }\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i][j] - temp;\n      }\n      for (j = 1; j <= t; j++) {\n        count = 0;\n        for (i = 1; i <= t; i++) {\n          if (a[i][j] == 0) {\n            break;\n          } else\n            count++;\n        }\n        if (count == t) {\n          temp = a[1][j];\n          for (i = 2; i <= t; i++)\n            if (temp > a[i][j]) {\n              temp = a[i][j];\n            }\n          for (i = 1; i <= t; i++)\n            a[i][j] = a[i][j] - temp;\n        } else {\n          continue;\n        }\n      }\n      sum = sum + a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 1; i <= t - 1; i++)\n        for (j = 2; j <= t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    for (i = 1; i <= 2; i++) {\n      temp = a[i][1];\n      for (j = 2; j <= 2; j++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (j = 1; j <= 2; j++)\n        a[i][j] = a[i][j] - temp;\n    }\n    for (j = 1; j <= 2; j++) {\n      temp = a[1][j];\n      for (i = 2; i <= 2; i++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (i = 1; i <= 2; i++)\n        a[i][j] = a[i][j] - temp;\n    }\n    sum = sum + a[2][2];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "33049", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint Matrix[100][100];\n\nint a[100] = {0};\n\nint b[100] = {0};\n\nint N = 0;\n\nvoid f(int n) {\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    a[i] = Matrix[i][0];\n    for (int k = 1; k < n; k++)\n      if (a[i] > Matrix[i][k])\n        a[i] = Matrix[i][k];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[i][j] -= a[i];\n}\nvoid g(int n) {\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    b[i] = Matrix[0][i];\n    for (int k = 1; k < n; k++)\n      if (b[i] > Matrix[k][i])\n        b[i] = Matrix[k][i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[j][i] -= b[i];\n}\nint h(int n) {\n  int k = 0;\n  f(n);\n  g(n);\n  k = Matrix[1][1];\n  if (n == 2)\n    return k;\n  for (int i = 1; i < n - 1; i++) {\n    Matrix[0][i] = Matrix[0][i + 1];\n    Matrix[i][0] = Matrix[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      Matrix[i][j] = Matrix[i + 1][j + 1];\n  }\n  return k + h(n - 1);\n}\nint main() {\n  cin >> N;\n  for (int j = 0; j < N; j++) {\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> Matrix[i][j];\n    printf(\"%d\\n\", h(N));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33050", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint w[200][200];\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int x = 0; x < n; x++)\n      for (int y = 0; y < n; y++)\n        cin >> w[x][y];\n    int s = 0;\n    for (int m = 1; m < n; m++) {\n      for (int x = 0; x < n; x++) {\n        int minn = w[x][0];\n        for (int y = m; y < n; y++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[x][0] -= minn;\n        for (int y = m; y < n; y++)\n          w[x][y] -= minn;\n      }\n      for (int y = 0; y < n; y++) {\n        int minn = w[0][y];\n        for (int x = m; x < n; x++)\n          if (w[x][y] < minn)\n            minn = w[x][y];\n        w[0][y] -= minn;\n        for (int x = m; x < n; x++)\n          w[x][y] -= minn;\n      }\n      s += w[m][m];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[][100], int k) {\n  int i, j, min;\n  for (j = 0; j < k; j++) {\n    min = a[j][0];\n    for (i = 1; i < k; i++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (i = 0; i < k; i++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    min = a[0][i];\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid f2(int a[][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[j][i] = a[j + 1][i];\n  }\n}\nint main() {\n  int n, z, k;\n  scanf(\"%d\", &n);\n  k = n;\n  for (z = 0; z < n; z++) {\n    int i, j, sum = 0;\n    int a[100][100];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    k = n;\n    for (k; k > 1; k--) {\n      f1(a, k);\n      sum += a[1][1];\n      f2(a, k);\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33052", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100][100]; \nint Sum(int n, int t[100][100]) {\n  int sum = 0, min = 0;\n  int i, j, tempi, tempj;\n  \n  for (i = 0; i < n; i++) {\n    min = t[i][0];\n    for (j = 0; j < n; j++)\n      if (t[i][j] < min)\n        min = t[i][j]; \n    for (j = 0; j < n; j++)\n      t[i][j] -= min; \n  }\n  \n  for (j = 0; j < n; j++) {\n    min = t[0][j];\n    for (i = 0; i < n; i++)\n      if (t[i][j] < min)\n        min = t[i][j]; \n    for (i = 0; i < n; i++)\n      t[i][j] -= min; \n  }\n  sum = t[1][1];\n  if (n == 2) \n    return sum;\n  \n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (j == 0)\n        tempj = j;\n      else\n        tempj = j + 1;\n      if (i == 0)\n        tempi = i;\n      else {\n        tempi = i + 1;\n      }\n      t[i][j] = t[tempi][tempj];\n    }\n  \n  return sum += Sum(n - 1, t);\n}\nint main() {\n  int n, sum = 0;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  for (int i = 0; i < n; i++) \n  {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[i][j][k]; \n    sum = Sum(n, a[i]);    \n    cout << sum << endl;   \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33053", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint s = 0, a[100][100];\nvoid hang(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n    min = 0;\n  }\n}\nvoid lie(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (min >= a[j][i])\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n    min = 0;\n  }\n}\nvoid xiaoqu(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\nvoid sum(int n) {\n  if (n > 1) {\n    hang(n);\n    lie(n);\n    s += a[1][1];\n    xiaoqu(n);\n    sum(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int k = n;\n  while (k) {\n    k--;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum(n);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, z, sum, min;\n  int a[105][105];\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 0; i < n - k; i++)\n        for (j = 2; j < n - k; j++)\n          *(*(a + i) + j - 1) = *(*(a + i) + j);\n      for (j = 0; j < n - k - 1; j++)\n        for (i = 2; i < n - k; i++)\n          *(*(a + i - 1) + j) = *(*(a + i) + j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33055", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[120][120] = {0}, i, N, j, sum, k, ii, jj, all, zhong = 999;\n  cin >> n;\n  N = n;\n  all = N;\n  for (jj = 1; jj <= N; jj++) {\n    n = N;\n    sum = 0;\n    for (i = 1; i <= N; i++)\n      for (j = 1; j <= N; j++)\n        cin >> *(*(a + i - 1) + j - 1);\n    for (k = 1; k <= N - 1; k++) {\n\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n          if (*(*(a + ii) + i) <= zhong)\n            zhong = *(*(a + ii) + i);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + ii) + i) -= zhong;\n      }\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n\n          if (*(*(a + i) + ii) <= zhong)\n            zhong = *(*(a + i) + ii);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + i) + ii) -= zhong;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      n--;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, n1, num[101][101], i, j, k, min = 99999, sum = 0;\n  int(*p)[101];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    p = num;\n    for (; n1 >= 2; n1--) {\n\n      for (i = 0; i < n1; i++) {\n        for (j = 0; j < n1; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) -= min;\n        min = 99999;\n      }\n      min = 99999;\n      for (j = 0; j < n1; j++) {\n        for (i = 0; i < n1; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n1; i++)\n          num[i][j] -= min;\n        min = 99999;\n      }\n      sum += *(*(p + 1) + 1);\n      min = 99999;\n      for (i = 1; i < n1 - 1; i++)\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < n1 - 1; j++)\n        for (i = 0; i < n1; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33057", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  int min, sum;\n\n  cin >> m;\n  for (k = 0; k < m; k++) {\n\n    n = m;\n    sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (n > 1) {\n\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      n--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nchar mn[] = {3, 9, 31};\n\nint xn = 0;\n\nint max_files = sizeof(mn) / sizeof(mn[0]);\n\nchar *output_dir = \"data\";\n\nint rnd(int min, int max) {\n  return min + ((rand() << 15) | rand()) % (max - min + 1);\n}\n\nvoid xbuild() {\n  int i, j, k, n;\n  n = mn[xn];\n  printf(\"%d\\n\", n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      printf(\"%d\", rnd(1, n * n));\n      for (j = 1; j < n; j++) {\n        printf(\" %d\", rnd(1, n * n));\n      }\n      printf(\"\\n\");\n    }\n  }\n  xn++;\n}\n"}
{"label": "18", "index": "33058", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a[101][101], mini[101], minj[101], ans[101];\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    memset(a, 0, sizeof(a));\n    memset(ans, 0, sizeof(ans));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      memset(mini, 21474836, sizeof(mini));\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          if (a[i][j] < mini[i])\n            mini[i] = a[i][j];\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j] - mini[i];\n      memset(minj, 21474836, sizeof(minj));\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          if (a[i][j] < minj[j])\n            minj[j] = a[i][j];\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i][j] - minj[j];\n\n      ans[k] = ans[k] + a[2][2];\n      for (i = 2; i <= m; i++)\n        a[i][1] = a[i + 1][1];\n      for (j = 2; j <= m; j++)\n        a[1][j] = a[1][j + 1];\n      for (i = 2; i <= m; i++)\n        for (j = 2; j <= m; j++)\n          a[i][j] = a[i + 1][j + 1];\n      m--;\n    }\n    cout << ans[k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - l - 1; j++) {\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - l - 1; j++) {\n        a[0][j] = a[0][j + 1];\n      }\n      for (j = 2; j < n - l; j++) {\n        for (k = 2; k < n - l; k++) {\n          a[j - 1][k - 1] = a[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33060", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c[100], a[100][100], sum, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = 1; l <= n - 1; l++) {\n\n      c[0] = a[0][0];\n      for (k = l; k < n; k++) {\n        if (c[0] > a[0][k])\n          c[0] = a[0][k];\n      }\n      for (k = 0; k < n; k++) {\n        a[0][k] = a[0][k] - c[0];\n      }\n      c[0] = a[0][0];\n      for (j = l; j < n; j++) {\n        c[j] = a[j][0];\n        for (k = l; k < n; k++) {\n          if (c[j] > a[j][k])\n            c[j] = a[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - c[j];\n        }\n      }\n      for (k = l; k < n; k++) {\n        c[k] = a[0][k];\n        for (j = l; j < n; j++) {\n          if (c[k] > a[j][k])\n            c[k] = a[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - c[k];\n        }\n      }\n      for (j = l; j < n; j++) {\n        if (c[0] > a[j][0])\n          c[0] = a[j][0];\n      }\n      for (j = 0; j < n; j++) {\n        a[j][0] = a[j][0] - c[0];\n      }\n      sum = sum + a[l][l];\n    }\n    printf(\"%d \", sum);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "18", "index": "33061", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nvoid row_deduct(int array[101][101], int n) \n{\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[i][0];\n    for (j = 1; j < n; j++)\n      if (array[i][j] < min)\n        min = array[i][j];\n    for (j = 0; j < n; j++)\n      array[i][j] -= min;\n  }\n}\n\nvoid col_deduct(int array[101][101], int n) \n{\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[0][i];\n    for (j = 1; j < n; j++)\n      if (array[j][i] < min)\n        min = array[j][i];\n    for (j = 0; j < n; j++)\n      array[j][i] -= min;\n  }\n}\n\nvoid delete22(int array[101][101], int n) \n{\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[i][j - 1] = array[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[j - 1][i] = array[j][i];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  int array[101][101];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0; \n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    for (j = n; j >= 2; j--) {\n      row_deduct(array, j);\n      col_deduct(array, j);\n      sum += array[1][1]; \n      delete22(array, j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33062", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint GuiLing(int a[][101], int n, int sum) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n > 2) {\n    sum = sum + a[1][1];\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n - 1; i++)\n        a[i][j - 1] = a[i][j];\n    return GuiLing(a, n - 1, sum);\n  } else\n    return sum + a[1][1];\n}\n\nint main() {\n  int n, i;\n  int a[101][101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", GuiLing(a, n, 0));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum, num, (*p)[200], t, temp;\n  int a[200][200];\n  cin >> n;\n  sum = 0;\n  num = 0;\n  p = a;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    while (num < n - 1) {\n      for (i = 0; i < n - num; i++) {\n        temp = 1000;\n        for (j = 0; j < n - num; j++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        temp = 1000;\n        for (i = 0; i < n - num; i++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n        }\n      }\n      num++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, m, k, sum, min;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    memset(a, 0, sizeof(a));\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33065", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int k, l, sum = 0;\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++)\n        cin >> a[k][l];\n    }\n    int h = n;\n    do {\n      for (k = 0; k < h; k++) {\n        int min = a[k][0];\n        for (l = 0; l < h; l++) {\n          if (a[k][l] <= min)\n            min = a[k][l];\n        }\n        for (l = 0; l < h; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (l = 0; l < h; l++) {\n        int x = a[0][l];\n        for (k = 0; k < h; k++) {\n          if (a[k][l] <= x)\n            x = a[k][l];\n        }\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l] - x;\n      }\n      sum = sum + a[1][1];\n      h = h - 1;\n      for (k = 1; k < h; k++) {\n        for (l = 0; l < h + 1; l++)\n          a[k][l] = a[k + 1][l];\n      }\n      for (l = 1; l < h; l++) {\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l + 1];\n      }\n    } while (h > 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33066", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[101][101], n, b[101][101]; \nvoid f() {\n  int i, j, k, num, ans = 0, min;\n  num = n;\n  while (num >= 2) {\n    for (i = 1; i <= num; i++) {\n      min = a[i][1];\n      for (j = 1; j <= num; j++)\n        if (a[i][j] < min)\n          min = a[i][j]; \n      for (j = 1; j <= num; j++)\n        a[i][j] -= min; \n    }\n    for (j = 1; j <= num; j++) {\n      min = a[1][j];\n      for (i = 1; i <= num; i++)\n        if (a[i][j] < min)\n          min = a[i][j]; \n      for (i = 1; i <= num; i++)\n        a[i][j] -= min;\n    }\n    ans += a[2][2]; \n    b[1][1] = a[1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[i][1] = a[i + 1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[1][i] = a[1][i + 1];\n    for (i = 2; i <= num - 1; i++)\n      for (j = 2; j <= num - 1; j++)\n        b[i][j] = a[i + 1][j + 1]; \n    for (i = 1; i <= num - 1; i++)\n      for (j = 1; j <= num - 1; j++)\n        a[i][j] = b[i][j]; \n    num--;                 \n  }\n  cout << ans << endl;\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j]; \n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33067", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint array_1(int k); \nint a[100][100];\nint main() {\n  int n, k; \n  int i = 0, j = 0;\n  cin >> n;\n  k = n;\n  while (n--) {\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        cin >> a[i][j]; \n    cout << array_1(k) << endl;\n  }\n  return 0;\n}\n\nint array_1(int k) \n{\n  if (k == 1) \n    return 0;\n  else if (k > 1) {\n    int i, j, max1, max2; \n    for (i = 0; i < k; i++) {\n      max1 = 10000;\n      for (j = 0; j < k; j++) {\n        if (max1 > a[i][j])\n          max1 = a[i][j]; \n      }\n      for (j = 0; j < k; j++)\n        a[i][j] = a[i][j] - max1; \n    }\n    for (j = 0; j < k; j++) {\n      max2 = 10000;\n      for (i = 0; i < k; i++) {\n        if (max2 > a[i][j])\n          max2 = a[i][j]; \n      }\n      for (i = 0; i < k; i++)\n        a[i][j] = a[i][j] - max2; \n    }\n    int temp = a[1][1]; \n    for (i = 2; i < k; i++)\n      for (j = 0; j < k; j++)\n        a[i - 1][j] = a[i][j]; \n    for (j = 2; j < k; j++)\n      for (i = 0; i < k; i++)\n        a[i][j - 1] = a[i][j]; \n    return temp + array_1(k - 1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33068", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[111][111];\nint n;\n\nint xiao(int size);\n\nint sum() {\n  int temp = 0;\n  for (int siz = n; siz >= 2; siz--) {\n    temp += xiao(siz);\n  }\n  return temp;\n}\n\nint xiao(int size) {\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[i][j] < tempmin)\n        tempmin = a[i][j];\n    for (int j = 1; j <= size; j++)\n      a[i][j] -= tempmin;\n  }\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[j][i] < tempmin)\n        tempmin = a[j][i];\n    for (int j = 1; j <= size; j++)\n      a[j][i] -= tempmin;\n  }\n\n  int daan = a[2][2];\n\n  for (int i = 1; i <= n; i++)\n    for (int j = 2; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 1; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[j][i] = a[j + 1][i];\n  return daan;\n}\n\nint main() {\n  cin >> n;\n  for (int t = 1; t <= n; t++) {\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    cout << sum() << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33069", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint change(int a[][100], int n);\n\nint main() {\n  int n, k = 0;\n  int a[100][100], sum = 0;\n  int m = 0; \n\n  cin >> n;\n  while (k < n) {\n    sum = 0;\n    m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    while (m < n - 1) {\n      sum += change(a, n - m);\n\n      for (int i = 0; i < n - m; i++) \n      {\n        for (int j = 2; j < n - m; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      for (int j = 0; j < n - m; j++) \n      {\n        for (int i = 2; i < n - m; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      m++;\n    }\n\n    cout << sum << endl;\n\n    k++;\n  }\n\n  return 0;\n}\n\nint change(int a[][100], int n) \n{\n  int minx[100], miny[100]; \n                            \n  int num;\n\n  for (int l = 0; l < 100; l++) {\n    minx[l] = INT_MAX;\n    miny[l] = INT_MAX;\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= minx[i];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= miny[j];\n    }\n  }\n  num = a[1][1];\n  return num;\n}\n"}
{"label": "18", "index": "33070", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, k, l;\nint a[100][100];\nint xiao(int n) {\n  int min, s;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++)\n      min = (a[j][k] < min) ? a[j][k] : min;\n    for (k = 0; k < n; k++)\n      a[j][k] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++)\n      min = (a[k][j] < min) ? a[k][j] : min;\n    for (k = 0; k < n; k++)\n      a[k][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  s = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n -= 1;\n  return (s + xiao(n));\n}\nint main() {\n\n  int n, result[100];\n  scanf(\"%d \", &n);\n  for (l = 0; l < n; l++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    result[l] = xiao(n);\n  }\n  for (l = 0; l < n; l++)\n    cout << result[l] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zero(int a[100][100], int n) {\n  int min[100];\n  for (int i = 0; i < n; ++i) {\n    min[i] = a[i][0];\n    for (int j = 0; j < n; ++j)\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    if (min[i] != 0)\n      for (int j = 0; j < n; ++j)\n        a[i][j] -= min[i];\n  }\n  for (int j = 0; j < n; ++j) {\n    min[j] = a[0][j];\n    for (int i = 0; i < n; ++i)\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    if (min[j] != 0)\n      for (int i = 0; i < n; ++i)\n        a[i][j] -= min[j];\n  }\n}\nvoid subduction(int a[100][100], int n) {\n  for (int i = 1; i < n - 1; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; ++i)\n    for (int j = 1; j < n - 1; ++j)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int m, n, s, a[100][100];\n  cin >> n;\n  for (int t = 0; t < n; ++t) {\n    s = 0, m = n;\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    while (m != 1) {\n      zero(a, m);\n      s += a[1][1];\n      subduction(a, m--);\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "18", "index": "33072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1(int k);\nint a[100][100];\nint main() {\n  int n, k;\n  int i = 0, j = 0;\n  cin >> n;\n  k = n;\n  while (n--) {\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        cin >> a[i][j];\n    cout << array_1(k) << \"\\n\";\n  }\n  return 0;\n}\n\nint array_1(int k) {\n  if (k == 1)\n    return 0;\n  else if (k > 1) {\n    int i, j, max1, max2;\n    for (i = 0; i < k; i++) {\n      max1 = 10000;\n      for (j = 0; j < k; j++) {\n        if (max1 > a[i][j])\n          max1 = a[i][j];\n      }\n      for (j = 0; j < k; j++)\n        a[i][j] = a[i][j] - max1;\n    }\n    for (j = 0; j < k; j++) {\n      max2 = 10000;\n      for (i = 0; i < k; i++) {\n        if (max2 > a[i][j])\n          max2 = a[i][j];\n      }\n      for (i = 0; i < k; i++)\n        a[i][j] = a[i][j] - max2;\n    }\n    int temp = a[1][1];\n    for (i = 2; i < k; i++)\n      for (j = 0; j < k; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < k; j++)\n      for (i = 0; i < k; i++)\n        a[i][j - 1] = a[i][j];\n    return temp + array_1(k - 1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33073", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, N, sum = 0, min;\n  cin >> n;\n  int jz[n][n][n];\n  int i, j, k, t;\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    N = n;\n\n    for (t = 1; t < n; t++) {\n\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++)\n          jz[k][i][j] = jz[k][i + 1][j];\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < n; i++)\n          jz[k][i][j] = jz[k][i][j + 1];\n      }\n\n      N = N - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int n) {\n  if (n == 1) {\n    return 0;\n  }\n  int i, j, p, min, a11;\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < a[i][p]) {\n        p = j;\n      }\n    }\n    min = a[i][p];\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < a[p][i]) {\n        p = j;\n      }\n    }\n    min = a[p][i];\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  a11 = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i - 1] = a[j][i];\n    }\n  }\n  return a11 + sum(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sub(int num[200][200], int n); \nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> num[j][k]; \n    cout << sub(num, n) << endl;\n  }\n  return 0;\n}\nint sub(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j < n; j++) \n  {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n  for (j = 0; j < n; j++) \n  {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2) \n    return sum;\n  else {\n    for (i = 2; i < n; i++) \n    {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + sub(num, n - 1); \n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33076", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, s1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int s = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    s1 = n;\n    while (s1 > 1) {\n      for (j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (k = 1; k < n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        int min1 = a[0][k];\n        for (j = 1; j < n; j++)\n          if (a[j][k] < min1)\n            min1 = a[j][k];\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min1;\n      }\n      s = s + a[1][1];\n      s1 = s1 - 1;\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n    }\n    cout << s << endl;\n  }\n}\n\n"}
{"label": "18", "index": "33077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100][100], n, i, j, k;\n  int c, l, o, p, q, r, s, t;\n  int min;\n  int w, x, y, z;\n  int h, g, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (c = 1; c <= n - 1; c++) {\n    for (l = 0; l < n; l++) {\n\n      for (o = 0; o <= n - c; o++) {\n        min = a[l][o][1];\n        for (p = 0; p <= n - c; p++) {\n          if (a[l][o][p] < min)\n            min = a[l][o][p];\n        }\n        for (q = 0; q <= n - c; q++) {\n          a[l][o][q] -= min;\n        }\n      }\n      for (r = 0; r <= n - c; r++) {\n        min = a[l][1][r];\n        for (s = 0; s <= n - c; s++) {\n          if (a[l][s][r] < min)\n            min = a[l][s][r];\n        }\n        for (t = 0; t <= n - c; t++) {\n          a[l][t][r] -= min;\n        }\n      }\n      b[l][c] = a[l][1][1];\n      for (w = 1; w <= n - c - 1; w++) {\n        for (x = 0; x <= n - c; x++) {\n          a[l][w][x] = a[l][w + 1][x];\n        }\n      }\n      for (y = 1; y <= n - c - 1; y++) {\n        for (z = 0; z <= n - c; z++) {\n          a[l][z][y] = a[l][z][y + 1];\n        }\n      }\n    }\n  }\n  for (h = 0; h < n; h++) {\n    m = 0;\n    for (g = 1; g <= n - 1; g++) {\n      m += b[h][g];\n    }\n    cout << m << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33078", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, l, sum;\n  int a;\n  int tt[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &tt[j][k]);\n      }\n    }\n    sum = 0;\n    m = n;\n    for (l = 1; l < m; m--) {\n      for (j = 0; j < m; j++) {\n        a = 1000;\n        for (k = 0; k < m; k++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      for (k = 0; k < m; k++) {\n        a = 1000;\n        for (j = 0; j < m; j++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      sum = sum + tt[1][1];\n\n      for (j = 1; j < m; j++) {\n        tt[0][j] = tt[0][j + 1];\n      }\n      for (j = 1; j < m; j++) {\n        tt[j][0] = tt[j + 1][0];\n      }\n      for (j = 1; j < m; j++) {\n        for (k = 1; k < m; k++) {\n          tt[j][k] = tt[j + 1][k + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33079", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[49][49][49];\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &sz[i][j][k]);\n      }\n    }\n  }\n  int nn, min;\n  int re[49] = {0};\n  for (i = 1; i <= n; i++) \n  {\n    for (nn = 1; nn <= n - 1; nn++) \n    {\n      for (j = nn; j <= n; j++) \n      {\n        min = sz[i][j][nn];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) \n          {\n            if (sz[i][j][k] < min) {\n              min = sz[i][j][k];\n            }\n          }\n          for (k = nn; k <= n; k++) \n          {\n            sz[i][j][k] -= min;\n          }\n        }\n      }\n      for (j = nn; j <= n; j++) \n      {\n        min = sz[i][nn][j];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) \n          {\n            if (sz[i][k][j] < min) {\n              min = sz[i][k][j];\n            }\n          }\n          for (k = nn; k <= n; k++) \n          {\n            sz[i][k][j] -= min;\n          }\n        }\n      }\n      re[i] += sz[i][nn + 1][nn + 1];\n      sz[i][nn + 1][nn + 1] = sz[i][nn][nn];\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][nn + 1][j] = sz[i][nn][j];\n      }\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][j][nn + 1] = sz[i][j][nn];\n      }\n    }\n    printf(\"%d\\n\", re[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid solve(int n) {\n  if (n != 1) {\n    for (int i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (int j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (int j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[j][i] -= min;\n      }\n    }\n    sum += a[1][1];\n    for (int i = 1; i < n - 1; i++) {\n      a[i][0] = a[i + 1][0];\n      a[0][i] = a[0][i + 1];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++) {\n        a[i][j] = a[i + 1][j + 1];\n      }\n    solve(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    solve(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33081", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[100][100];\n  cin >> n;\n  int(*p)[100] = num;\n  for (int k = 0; k < n; k++) {\n    int sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += num[1][1];\n      for (int i = 1; i < m - 1; i++)\n        *(*(p + i) + 0) = *(*(p + i + 1) + 0);\n      for (int j = 1; j < m - 1; j++)\n        *(*(p + 0) + j) = *(*(p + 0) + j + 1);\n      for (int i = 2; i < m; i++) {\n        for (int j = 2; j < m; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n      }\n      m--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33082", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100][100];           \nint matrix(int a[][100], int n) \n{\n  int temp1[100], temp2[100]; \n\n  int i, j;\n  for (i = 0; i < n; i++) \n  {\n    temp1[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (temp1[i] > a[i][j])\n        temp1[i] = a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - temp1[i]; \n  for (i = 0; i < n; i++)           \n  {\n    temp2[i] = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (temp2[i] > a[j][i])\n        temp2[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - temp2[i]; \n\n  int sum;\n  sum = a[1][1];              \n  for (i = 1; i < n - 1; i++) \n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  if (n > 2) \n  {\n    sum = sum + matrix(a, n - 1);\n  }\n  return sum; \n}\nint main() {\n  int n, i, j, k;\n  cin >> n; \n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (i = 0; i < n; i++)\n    cout << matrix(a[i], n) << endl; \n  return 0;\n}\n"}
{"label": "18", "index": "33083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, max, sum, m;\n  int a[110][110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    m = n;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    for (m = n; m > 1; m--) {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + j) + k);\n          } else if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + j) + k) -= min;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + k) + j);\n          } else if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + k) + j) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (j = 2; j < m; j++)\n        *(*a + j - 1) = *(*a + j);\n      for (j = 2; j < m; j++)\n        *(*(a + j - 1)) = *(*(a + j));\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + j - 1) + k - 1) = *(*(a + j) + k);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint smaller(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Sum(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      min = smaller(min, a[i][j]);\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (int i = 0; i < n; i++)\n      min = smaller(min, a[i][j]);\n    for (int i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    cout << Sum(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33085", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, mymin;\nint a[110][110];\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < mymin)\n    mymin = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= mymin;\n}\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, sum, t;\n  for (scanf(\"%d \", &n), t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mymin = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100] = {0};\n  int min[100][100] = {0};\n  int n, i, j, k, l, s, sum[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (s = n; s > 1; s--) {\n      for (j = 0; j < s; j++) {\n        min[i][j] = a[i][j][0];\n        for (l = 0; l < s; l++) {\n          if (a[i][j][l] < min[i][j])\n            min[i][j] = a[i][j][l];\n        }\n        for (k = 0; k < s; k++)\n          a[i][j][k] = a[i][j][k] - min[i][j];\n      }\n      for (k = 0; k < s; k++) {\n        min[i][k] = a[i][0][k];\n        for (l = 0; l < s; l++) {\n          if (a[i][l][k] < min[i][k])\n            min[i][k] = a[i][l][k];\n        }\n        for (j = 0; j < s; j++)\n          a[i][j][k] = a[i][j][k] - min[i][k];\n      }\n      sum[i] = sum[i] + a[i][1][1];\n      for (j = 0; j < s; j++) {\n        for (k = 1; k < s - 1; k++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n      for (k = 0; k < s - 1; k++) {\n        for (j = 1; j < s - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, min;\n  cin >> n;\n  int input[n][n], sum[n];\n  for (i = 0; i < n; i++) {\n    count = n;\n    sum[i] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> input[j][k];\n\n    while (count != 1) {\n      for (j = 0; j < count; j++) {\n        min = input[j][0];\n        for (k = 1; k < count; k++)\n          if (input[j][k] < min)\n            min = input[j][k];\n        for (k = 0; k < count; k++)\n          input[j][k] -= min;\n      } \n      for (j = 0; j < count; j++) {\n        min = input[0][j];\n        for (k = 1; k < count; k++)\n          if (input[k][j] < min)\n            min = input[k][j];\n        for (k = 0; k < count; k++)\n          input[k][j] -= min;\n      } \n\n      sum[i] += input[1][1];\n      for (k = 0; k < count; k++)\n        for (j = 1; j < count - 1; j++)\n          input[j][k] = input[j + 1][k];\n      for (k = 0; k < count - 1; k++)\n        for (j = 1; j < count - 1; j++)\n          input[k][j] = input[k][j + 1]; \n      count--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33088", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0, a[100][100];\nvoid hang(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n    min = 0;\n  }\n}\nvoid lie(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (min >= a[j][i])\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n    min = 0;\n  }\n}\nvoid xiaoqu(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\nvoid sum(int n) {\n  if (n > 1) {\n    hang(n);\n    lie(n);\n    s += a[1][1];\n    xiaoqu(n);\n    sum(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int k = n;\n  while (k) {\n    k--;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum(n);\n    cout << s << endl;\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33089", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint juzhen[100][100];\n\nint sum(int n) {\n  int i, j, t;\n  int min[n];\n  if (n != 1) {\n    for (i = 0; i < n; i++) {\n      min[i] = juzhen[i][0];\n      for (j = 0; j < n; j++) {\n        if (juzhen[i][j] < min[i])\n          min[i] = juzhen[i][j];\n      }\n      for (j = 0; j < n; j++)\n        juzhen[i][j] -= min[i]; \n    }\n    for (j = 0; j < n; j++) {\n      min[j] = juzhen[0][j];\n      for (i = 0; i < n; i++) {\n        if (juzhen[i][j] < min[j])\n          min[j] = juzhen[i][j];\n      }\n      for (i = 0; i < n; i++)\n        juzhen[i][j] -= min[j]; \n    }\n    t = juzhen[1][1]; \n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i][j + 1];\n    for (j = 0; j < n - 1; j++)\n      for (i = 1; i < n - 1; i++)\n        juzhen[i][j] = juzhen[i + 1][j]; \n    return sum(n - 1) + t;               \n  } else\n    return 0; \n}\n\nint main() {\n  int N, I, J, K;\n  cin >> N; \n  for (K = 1; K <= N; K++) {\n    for (I = 0; I < N; I++)\n      for (J = 0; J < N; J++)\n        cin >> juzhen[I][J]; \n    cout << sum(N) << endl;  \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - l - 1; j++) {\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - l - 1; j++) {\n        a[0][j] = a[0][j + 1];\n      }\n      for (j = 2; j < n - l; j++) {\n        for (k = 2; k < n - l; k++) {\n          a[j - 1][k - 1] = a[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, sum;\n  int a[200][200];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d \", &a[j][k]);\n    l = n;\n    sum = 0;\n    while (n >= 2) {\n      for (j = 1; j <= n; j++) {\n        min = a[j][1];\n        for (k = 1; k <= n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 1; k <= n; k++)\n          a[j][k] -= min;\n      }\n      for (k = 1; k <= n; k++) {\n        min = a[1][k];\n        for (j = 1; j <= n; j++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (j = 1; j <= n; j++)\n          a[j][k] -= min;\n      }\n      sum += a[2][2];\n      for (j = 2; j <= n - 1; j++)\n        for (k = 1; k <= n; k++)\n          a[j][k] = a[j + 1][k];\n      for (k = 2; k <= n - 1; k++)\n        for (j = 1; j <= n - 1; j++)\n          a[j][k] = a[j][k + 1];\n      n--;\n    }\n    n = l;\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sim(int, int[][100]);\n  int n = 0, i = 0, j = 0, a[100][100];\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    cout << sim(n, a) << endl;\n  }\n  return 0;\n}\nint sim(int n, int a[][100]) {\n  int i = 0, j = 0, m1[100], m2[100], sum = 0;\n  if (n == 1)\n    return 0;\n  else\n    for (i = 0; i < 100; i++) {\n      m1[i] = 99999;\n      m2[i] = 99999;\n    }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= m1[i]) {\n        m1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m1[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= m2[j]) {\n        m2[j] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m2[j];\n    }\n  }\n  sum += a[1][1];\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 0)\n        a[i][j] = a[i][j + 1];\n      else if (j == 0)\n        a[i][j] = a[i + 1][j];\n      else\n        a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  sum += sim(n - 1, a);\n  return sum;\n}\n"}
{"label": "18", "index": "33093", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, t = 0, b[100][100];\n  int i, j, k, min;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        scanf(\"%d \", &b[j][k]);\n      }\n    }\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = b[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > b[j][k]) {\n            min = b[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          b[j][k] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = b[0][j];\n        for (k = 0; k < n; k++) {\n          if (min > b[k][j])\n            min = b[k][j];\n        }\n        for (k = 0; k < m; k++) {\n          b[k][j] -= min;\n        }\n      }\n      t += b[1][1];\n      for (j = 1; j < n - 1; j++) {\n        b[0][j] = b[0][j + 1];\n        b[j][0] = b[j + 1][0];\n        for (k = 1; k < n - 1; k++) {\n          b[j][k] = b[j + 1][k + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", t);\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[104][104][104], n;\n  int i, j, t, k, m, s;\n  scanf(\"%d \", &n);\n  for (t = 1; t <= n; t++) {\n    s = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j][0]);\n    for (k = 1; k < n; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        m = 100000;\n        for (j = 1; j <= n - k + 1; j++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j][k - 1] -= m;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        m = 100000;\n        for (i = 1; i <= n - k + 1; i++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j][k - 1] -= m;\n      }\n\n      s += a[2][2][k - 1];\n\n      for (i = 1; i <= n - k + 1; i++)\n        for (j = 1; j <= n - k + 1; j++) {\n          if (i == 1 && j == 1)\n            a[i][j][k] = a[i][j][k - 1];\n          if (i == 2 || j == 2)\n            continue;\n          if (i == 1 && j >= 3)\n            a[i][j - 1][k] = a[i][j][k - 1];\n          if (j == 1 && i >= 3)\n            a[i - 1][j][k] = a[i][j][k - 1];\n          if (i >= 3 && j >= 3)\n            a[i - 1][j - 1][k] = a[i][j][k - 1];\n        }\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "18", "index": "33095", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[50][50][50];\n  int max[101] = {0};\n  int i, j, k, m, n, min, t = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[i][j][k];\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n - 1; t++) {\n      for (j = 1; j <= n - t; j++) {\n        min = a[i][j][1];\n\n        for (k = 1; k <= n - t; k++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      for (k = 1; k <= n - t; k++) {\n        min = a[i][1][k];\n        for (j = 1; j <= n - t; j++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      max[i] = max[i] + a[i][2][2];\n      for (j = 2; j <= n - t - 1; j++) {\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n      for (k = 2; k <= n - t - 1; k++) {\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << max[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33096", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[101][101], min, he = 0, l, r, nn;\n  cin >> n;\n  nn = n;\n  for (nn = n; nn >= 1; nn--) {\n    he = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(num + i) + j);\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      min = 999999;\n      for (l = 1; l <= n - k + 1; l++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + l) + i))\n            min = *(*(num + l) + i);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + l) + i) = *(*(num + l) + i) - min;\n        }\n      }\n      for (r = 1; r <= n - k + 1; r++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + i) + r))\n            min = *(*(num + i) + r);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++)\n          *(*(num + i) + r) = *(*(num + i) + r) - min;\n      }\n      he = he + *(*(num + 2) + 2);\n      for (l = 1; l <= n - k + 1; l++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + l) + i) = *(*(num + l) + (i + 1));\n        }\n      }\n      for (r = 1; r <= n - k; r++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + i) + r) = *(*(num + (i + 1)) + r);\n        }\n      }\n    }\n    printf(\"%d\\n\", he);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33097", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint n;\n\nvoid scan(int m) {\n  int i, j;\n  for (i = 0; i <= m - 1; ++i) {\n    for (j = 0; j <= m - 1; ++j) {\n      scanf(\"%d\", &a[i][j]);\n    }\n  }\n}\n\nint minofc(int m) {\n  int i, min = a[m][0];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  return min;\n}\n\nint minofr(int m) {\n  int i, min = a[0][m];\n  for (i = 0; i <= n - 1; ++i) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  return min;\n}\n\nvoid tozero() {\n  int i, j;\n  for (i = 0; i <= n - 1; ++i) {\n    int min = minofc(i);\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    int min = minofr(j);\n    for (i = 0; i <= n - 1; ++i) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n}\n\nvoid eliminate() {\n  int i, j;\n  for (i = 1; i <= n - 2; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\n\nint main() {\n  scanf(\"%d\", &n);\n  int p = n;\n  int i;\n  for (i = 1; i <= n; ++i) {\n    int sum = 0;\n    scan(n);\n    do {\n      tozero();\n      sum = sum + a[1][1];\n      eliminate();\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33098", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s, i, j;\n  for (s = 1; s <= n; s++) {\n    int b = n, yi = 0, min = 10000;\n    int a[110][110] = {0};\n    int c = 2;\n    int bi[110] = {0}, bj[110] = {0};\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (b = n; b >= 2; b--) {\n      for (i = 1; i <= n; i++) {\n        if (bi[i] == 1)\n          continue;\n        for (j = 1; j <= n; j++) {\n          if ((bj[j] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 1; j <= n; j++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (bj[j] == 1)\n          continue;\n        for (i = 1; i <= n; i++) {\n          if ((bi[i] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (i = 1; i <= n; i++)\n            a[i][j] = a[i][j] - min;\n        }\n        min = 100000;\n      }\n      yi = yi + a[c][c];\n      bi[c] = 1;\n      bj[c] = 1;\n      min = 10000;\n      c++;\n    }\n    printf(\"%d\\n\", yi);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid ccout(int n, int s[100]);\nint main() {\n  int n, i, j, k, min, t, s[100], a[100][100][100];\n  cin >> n;\n  memset(s, 0, sizeof(s));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j][k];\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = 1073741824;\n        for (j = 0; j < n - t; j++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (j = 0; j < n - t; j++)\n          a[i][j][k] -= min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = 1073741824;\n        for (i = 0; i < n - t; i++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (i = 0; i < n - t; i++)\n          a[i][j][k] -= min;\n      }\n      s[k] += a[1][1][k];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - t - 1; i++)\n          a[i][j][k] = a[i + 1][j][k];\n    }\n  }\n  ccout(n, s);\n  return 0;\n}\nvoid ccout(int n, int s[100]) {\n  int k;\n  for (k = 0; k < n; k++)\n    printf(\"%d\\n\", s[k]);\n}\n"}
{"label": "18", "index": "33100", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], e, sum = 0;\n  int n, m, i, j, k, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    m = n;\n    for (l = 0; l < m - 1; l++) {\n      for (j = 0; j < n; j++) {\n        e = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= e;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        e = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] -= e;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - 1; k++) {\n        for (j = 1; j < n; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      n -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    n = m;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m[100][100], min = 100000, sum = 0, r;\n  int(*p)[100];\n  int n;\n  scanf(\"%d \", &n);\n  p = m;\n  int i, j;\n  int time;\n  for (time = 1; time <= n; time++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> m[i][j];\n      }\n    }\n    for (r = n; r > 1; r--) {\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + j) + i) -= min;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (j = 0; j < r; j++) {\n\n        for (i = 2; i < r; i++)\n          *(*(p + j) + i - 1) = *(*(p + j) + i);\n      }\n      for (j = 2; j < r; j++) {\n        for (i = 0; i < r; i++) {\n          *(*(p + j - 1) + i) = *(*(p + j) + i);\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k;\nvoid f(int);\nint a[100][100];\nint s;\nint main() {\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    f(n);\n  }\n  return 0;\n}\n\nvoid f(int m) {\n  for (i = 0; i < m; i++) {\n    int min = 1000;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    int min = 1000;\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  s = s + a[1][1];\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 1; i < m - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  if (m == 2) {\n    printf(\"%d\\n\", s);\n  } else\n    f(m - 1);\n}\n"}
{"label": "18", "index": "33103", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, k, iTemp;\n  cin >> n;\n  int a[n][n][n], iSum[n];\n  memset(iSum, 0, sizeof(iSum));\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 1; t <= n - 1; t++) {\n      for (j = 0; j <= n - 1; j++) {\n        if (a[i][j][0] < 0) {\n          continue;\n        } else {\n          iTemp = a[i][j][0];\n        }\n        for (k = 0; k <= n - 1; k++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (k = 0; k <= n - 1; k++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        if (a[i][0][k] < 0) {\n          continue;\n        } else\n          iTemp = a[i][0][k];\n\n        for (j = 0; j <= n - 1; j++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (j = 0; j <= n - 1; j++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      iSum[i] = iSum[i] + a[i][t][t];\n      for (k = 0; k <= n - 1; k++) {\n        a[i][t][k] = -1;\n      }\n      for (j = 0; j <= n - 1; j++) {\n        a[i][j][t] = -1;\n      }\n    }\n  }\n  cout << iSum[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << endl << iSum[i];\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int h, n;\n  scanf(\"%d\\n\", &n);\n  for (h = 1; h <= n; h++) {\n    int i, j, k, t, sum = 0, a[105][105];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\" %d\", &a[i][j]);\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        k = a[i][0];\n        for (j = 1; j < t; j++) {\n          if (a[i][j] < k)\n            k = a[i][j];\n        }\n        for (j = 0; j < t; j++)\n          a[i][j] -= k;\n      }\n      for (i = 0; i < t; i++) {\n        k = a[0][i];\n        for (j = 1; j < t; j++) {\n          if (a[j][i] < k)\n            k = a[j][i];\n        }\n        for (j = 0; j <= t; j++)\n          a[j][i] -= k;\n      }\n      sum += a[1][1];\n      for (j = 2; j < t; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < t; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i <= t; i++)\n        for (j = 2; j <= t; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], min, i, j, k, num, sum, n, x, y;\n  cin >> n;\n  for (num = 1; num <= n; num++) {\n    memset(b, 0, sizeof(b));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(b + i * n + j);\n\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      memset(a, 0, sizeof(a));\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(b + i * k + j);\n\n      for (i = 0; i < k; i++) {\n        min = 3000;\n        for (j = 0; j < k; j++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = 3000;\n        for (i = 0; i < k; i++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (i = 0; i < k; i++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n\n      memset(b, 0, sizeof(b));\n      sum = sum + a[k + 1];\n      x = -1;\n      for (i = 0; i < k; i++) {\n        if (i != 1) {\n          x++;\n          y = -1;\n          for (j = 0; j < k; j++)\n            if (j != 1) {\n              y++;\n              *(b + x * k + y - x) = *(a + i * k + j);\n            }\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33106", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, min, sum = 0;\n  cin >> n;\n  k = m = n;\n  while (k--) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        min = a[i][0];\n        for (j = 0; j <= m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++) {\n            a[i][j] -= min;\n          }\n        }\n      }\n      for (i = 0; i <= m; i++) {\n        min = a[0][i];\n        for (j = 0; j <= m; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[j][i] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < m; i++)\n        a[0][i] = a[0][i + 1];\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    m = n;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, n0 = 0, juzhen[102][102] = {0}, sum = 0, minc[102] = {0},\n               minr[102] = {0}, lins = 0;\n  int(*p)[102] = juzhen, *pr = minr, *pc = minc;\n  cin >> n;\n  while (n0 < n) {\n    lins = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = 0;\n      *(pr + i) = 100000;\n      *(pc + i) = 100000;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (lins < n - 1) {\n      for (i = 0; i < n; i++) {\n        *(pr + i) = 100000;\n        *(pc + i) = 100000;\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          if (*(*(p + i) + j) < minr[i])\n            *(pr + i) = *(*(p + i) + j);\n        }\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          *(*(p + i) + j) -= *(pr + i);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          if (*(*(p + i) + j) < *(pc + j))\n            *(pc + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          *(*(p + i) + j) -= *(pc + j);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n\n      for (i = 2; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (j = 2; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n        }\n      }\n      lins++;\n    }\n    cout << sum << endl;\n    n0++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[101][101], min, he = 0, l, r, nn;\n  cin >> n;\n  nn = n;\n  for (nn = n; nn >= 1; nn--) {\n    he = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(num + i) + j);\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      min = 999999;\n      for (l = 1; l <= n - k + 1; l++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + l) + i))\n            min = *(*(num + l) + i);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + l) + i) = *(*(num + l) + i) - min;\n        }\n      }\n      for (r = 1; r <= n - k + 1; r++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + i) + r))\n            min = *(*(num + i) + r);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + i) + r) = *(*(num + i) + r) - min;\n        }\n      }\n      he = he + *(*(num + 2) + 2);\n      for (l = 1; l <= n - k + 1; l++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + l) + i) = *(*(num + l) + (i + 1));\n        }\n      }\n      for (r = 1; r <= n - k; r++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + i) + r) = *(*(num + (i + 1)) + r);\n        }\n      }\n    }\n    cout << he << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33109", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[100][100];\nint n = 0;\n\nint xiaoling(int a);\n\nint main() {\n  int i, j, sum = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    sum = xiaoling(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint xiaoling(int a) {\n  int i, j, min, temp = 0;\n  if (a == 1)\n    return 0;\n  for (i = 0; i < a; i++) {\n    min = num[i][0];\n    for (j = 0; j < a; j++) {\n      min = (min > num[i][j]) ? num[i][j] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    min = num[0][i];\n    for (j = 0; j < a; j++) {\n      min = (min > num[j][i]) ? num[j][i] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n  }\n  temp = num[1][1];\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++)\n      num[j][i] = num[j + 1][i];\n  }\n  return temp + xiaoling(a - 1);\n}\n"}
{"label": "18", "index": "33110", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\n\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int h, w, mw, mh, i, j;\n  for (i = 1; i <= n; ++i) {\n    mw = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[i][h] < mw)\n        mw = a[i][h];\n    for (h = 1; h <= n; ++h)\n      a[i][h] -= mw;\n  }\n  for (i = 1; i <= n; ++i) {\n    mh = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[h][i] < mh)\n        mh = a[h][i];\n    for (h = 1; h <= n; ++h)\n      a[h][i] -= mh;\n  }\n  w = a[2][2];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j <= n; ++j)\n      a[i][j] = a[i + 1][j];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j < n; ++j)\n      a[j][i] = a[j][i + 1];\n  return w + f(n - 1);\n}\n\nint main() {\n  int n, i, i1, i2;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; ++i) {\n    for (i1 = 1; i1 <= n; ++i1)\n      for (i2 = 1; i2 <= n; ++i2)\n        scanf(\"%d \", &a[i1][i2]);\n    cout << f(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33111", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[120][120] = {0}, i, N, j, sum, k, ii, jj, all, zhong = 999;\n  cin >> n;\n  N = n;\n  all = N;\n  for (jj = 1; jj <= N; jj++) {\n    n = N;\n    sum = 0;\n    for (i = 1; i <= N; i++)\n      for (j = 1; j <= N; j++)\n        cin >> *(*(a + i - 1) + j - 1);\n    for (k = 1; k <= N - 1; k++) {\n\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n          if (*(*(a + ii) + i) <= zhong)\n            zhong = *(*(a + ii) + i);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + ii) + i) -= zhong;\n      }\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n\n          if (*(*(a + i) + ii) <= zhong)\n            zhong = *(*(a + i) + ii);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + i) + ii) -= zhong;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      n--;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint Min(int a[], int n) {\n  int i, min;\n  min = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] < min) {\n      min = a[i];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int n, i, N, dd1, dd2, j, min;\n  int row[100][100], col[100][100], sum[100];\n  scanf(\"%d\\n\", &n);\n  N = n;\n  for (i = 0; i < N; i++) {\n    for (dd1 = 0; dd1 < N; dd1++) {\n      for (dd2 = 0; dd2 < N; dd2++) {\n        scanf(\"%d\", &row[dd1][dd2]);\n      }\n    }\n    sum[i] = 0;\n    n = N;\n    for (j = 0; j < N - 1; j++) {\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(row[dd1], n) != 0) {\n          min = Min(row[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            row[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          col[dd2][dd1] = row[dd1][dd2];\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(col[dd1], n) != 0) {\n          min = Min(col[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            col[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          row[dd1][dd2] = col[dd2][dd1];\n        }\n      }\n      sum[i] += row[1][1];\n      for (dd1 = 0; dd1 < n - 1; dd1++) {\n        for (dd2 = 0; dd2 < n - 1; dd2++) {\n          if (dd1 >= 1 && dd2 == 0) {\n            row[dd1][dd2] = row[dd1 + 1][dd2];\n          }\n          if (dd2 >= 1 && dd1 == 0) {\n            row[dd1][dd2] = row[dd1][dd2 + 1];\n          }\n          if (dd1 >= 1 && dd2 >= 1) {\n            row[dd1][dd2] = row[dd1 + 1][dd2 + 1];\n          }\n        }\n      }\n      n--;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    cout << sum[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33113", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, k, i, j, n, a[101][101], sum, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    t = n;\n    sum = 0;\n    while (t > 1) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 0; j < t; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        min = a[0][j];\n        for (i = 0; i < t; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < t; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < t - 1; i++) {\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < t - 1; j++) {\n        for (i = 0; i < t + 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      t--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint m, a[100][100], s;\nvoid guiling() {\n  int i, j, min;\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < m; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  if (m >= 2)\n    s = s + a[1][1];\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < m - 1; j++)\n    for (i = 1; i < m - 1; i++)\n      a[i][j] = a[i + 1][j];\n  m--;\n  guiling();\n  if (m > 2)\n    xiaojian();\n  else\n    cout << s << endl;\n}\nint main() {\n  int n, t, i, j;\n  scanf(\"%d \", &n);\n  t = n;\n  while (n > 0) {\n    m = t;\n    s = 0;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        cin >> a[i][j];\n    guiling();\n    xiaojian();\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[101][101] = {0}, j, k, sum = 0, min[101] = {0}, l,\n            min1[101] = {0};\n  cin >> n;\n  l = n;\n  for (k = 1; k <= l; k++) {\n\n    for (i = 1; i <= l; i++) {\n      for (j = 1; j <= l; j++) {\n        cin >> a[i][j];\n      }\n    }\n    n = l;\n\n    while (n > 1) {\n\n      for (i = 1; i <= n; i++) {\n        min[i] = a[i][1];\n        for (j = 1; j <= n; j++) {\n          if (min[i] > a[i][j])\n            min[i] = a[i][j];\n        }\n      }\n\n      for (i = 1; i <= n; i++) {\n\n        for (j = 1; j <= n; j++) {\n          a[i][j] = a[i][j] - min[i];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        min1[j] = a[1][j];\n        for (i = 1; i <= n; i++) {\n          if (min1[j] > a[i][j])\n            min1[j] = a[i][j];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          a[i][j] = a[i][j] - min1[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (j = 2; j < n; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i < n; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33116", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, number;\n  cin >> n;\n  number = n;\n  for (i = 0; i < number; i++) {\n    int p, q, a[100][100], minnum[100], sum = 0;\n    for (p = 0; p < number; p++) {\n      for (q = 0; q < number; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    n = number;\n    while (n > 1) {\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          if (q == 0)\n            minnum[p] = a[p][q];\n          else if (minnum[p] > a[p][q])\n            minnum[p] = a[p][q];\n        }\n      }\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          a[p][q] = a[p][q] - minnum[p];\n        }\n      }\n      for (q = 0; q < n; q++) {\n        int tag = 0, min;\n        for (p = 0; p < n; p++) {\n          if (a[p][q] == 0)\n            tag = 1;\n          if (p == 0)\n            min = a[p][q];\n          else if (min > a[p][q])\n            min = a[p][q];\n        }\n        if (tag == 0) {\n          for (p = 0; p < n; p++) {\n            a[p][q] -= min;\n          }\n        }\n      }\n      sum += a[1][1];\n      n--;\n      for (j = 0, p = 0; p < n + 1; p++, j++) {\n        for (q = 0, k = 0; q < n + 1; q++, k++) {\n          if (p == 1)\n            p++;\n          if (q == 1)\n            q++;\n          a[j][k] = a[p][q];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33117", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n\n        cin >> num[j][k];\n    printf(\"%d\\n\", del(num, n));\n  }\n  return 0;\n}\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n      }\n    }\n\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33118", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\ninline int FindMin_i(int M[][100], int i, int n) {\n  int Min = M[i][0];\n  for (int j = 0; j < n; j++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\ninline int FindMin_j(int M[][100], int j, int n) {\n  int Min = M[0][j];\n  for (int i = 0; i < n; i++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\nint S(int M[][100], int n) {\n  if (n == 1) {\n    return sum;\n  }\n  int Min_i = 0;\n  for (int i = 0; i < n; i++) {\n    Min_i = FindMin_i(M, i, n);\n    for (int j = 0; j < n; j++) {\n      M[i][j] = M[i][j] - Min_i;\n    }\n  }\n  int Min_j = 0;\n  for (int j = 0; j < n; j++) {\n    Min_j = FindMin_j(M, j, n);\n    for (int i = 0; i < n; i++) {\n      M[i][j] = M[i][j] - Min_j;\n    }\n  }\n  sum = sum + M[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    M[i][0] = M[i + 1][0];\n  }\n\n  for (int j = 1; j < n - 1; j++) {\n    M[0][j] = M[0][j + 1];\n  }\n\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      M[i][j] = M[i + 1][j + 1];\n    }\n  }\n\n  S(M, n - 1);\n}\n\nint main() {\n  int M[100][100] = {0};\n  int n;\n  cin >> n;\n  for (int num = 0; num < n; num++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> M[i][j];\n      }\n    }\n    sum = 0;\n    printf(\"%d\\n\", S(M, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33119", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int n = 0, i, j, k, q = 0, l, m, s = 0;\n  cin >> n;\n  k = n;\n  while (q < k) {\n    s = 0;\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++)\n        cin >> a[i][j];\n    }\n    n = k;\n    for (m = 1; m <= k - 1; m++) {\n      for (i = 0; i < n; i++) {\n        l = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (l > a[i][j])\n            l = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - l;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        l = a[0][i];\n        for (j = 0; j < n; j++) {\n          if (l > a[j][i])\n            l = a[j][i];\n        }\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - l;\n      }\n      s = a[1][1] + s;\n\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n - 1; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << s << endl;\n    q++;\n  }\n\n  return (0);\n}\n"}
{"label": "18", "index": "33120", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n][n], b[n], min1[n], min2[n], c[n][n - 1], sum[n];\n  int i, j, k, l, p;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1[i] = a[k][i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[k][i][j] <= min1[i]) {\n            min1[i] = a[k][i][j];\n          }\n        }\n        for (j = 0; j < n - l; j++)\n          a[k][i][j] = a[k][i][j] - min1[i];\n      }\n      for (j = 0; j < n - l; j++) {\n        min2[j] = a[k][0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[k][i][j] <= min2[j]) {\n            min2[j] = a[k][i][j];\n          }\n        }\n        for (i = 0; i < n - l; i++)\n          a[k][i][j] = a[k][i][j] - min2[j];\n      }\n      c[k][l] = a[k][1][1];\n      sum[k] = sum[k] + c[k][l];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1 - l; i++) {\n          a[k][i][j] = a[k][i + 1][j];\n        }\n      for (i = 0; i < n - 1 - l; i++)\n        for (j = 1; j < n - 1 - l; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; ++i) {\n    int sum = 0;\n    int t[101][101] = {0};\n    for (j = 0; j < n; ++j) {\n      for (k = 0; k < n; ++k) {\n        cin >> t[j][k];\n      }\n    }\n\n    int cnt = n;\n    while (cnt > 1) {\n      for (j = 0; j < cnt; ++j) {\n        int min = t[j][0];\n        for (k = 1; k < cnt; ++k) {\n          if (t[j][k] < min)\n            min = t[j][k];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[j][k] -= min;\n        }\n      }\n\n      for (j = 0; j < cnt; ++j) {\n        int min = t[0][j];\n        for (k = 1; k < cnt; ++k) {\n          if (t[k][j] < min)\n            min = t[k][j];\n        }\n        for (k = 0; k < cnt; ++k) {\n          t[k][j] -= min;\n        }\n      }\n\n      sum += t[1][1];\n      \n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[j][k] = t[j][k + 1];\n        }\n      }\n      for (j = 0; j < n; ++j) {\n        for (k = 1; k < n; ++k) {\n          t[k][j] = t[k + 1][j];\n        }\n      }\n      \n      cnt--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint func(int a[100][100], int rank, int sum) {\n  if (rank == 1)\n    return (sum);\n  int i, j, k, min = 1000; \n  for (i = 0; i <= rank - 1; i++) {\n    for (j = 0; j <= rank - 1; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= rank - 1; j++)\n      a[i][j] -= min;\n    min = 1000;\n  } \n  for (j = 0; j <= rank - 1; j++) {\n    for (i = 0; i <= rank - 1; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= rank - 1; i++)\n      a[i][j] -= min;\n    min = 1000;\n  } \n  sum += a[1][1];\n  for (j = 1; j <= rank - 2; j++)\n    a[0][j] = a[0][j + 1];\n  for (i = 1; i <= rank - 2; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i <= rank - 2; i++) {\n    for (j = 1; j <= rank - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  func(a, rank - 1, sum);\n}\nint main() {\n  int n, i, j, k; \n  int matrix[100][100] = {{0}}, sum = 0;\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &matrix[i][j]);\n    }\n    printf(\"%d\\n\", func(matrix, n, sum));\n  }\n}\n"}
{"label": "18", "index": "33123", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, n, j;\n  int sum = 0;\n  cin >> n;\n  int a[n][n];\n  int minh[n], minl[n];\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int t = 1;\n    sum = 0;\n    while (t < n) {\n      for (i = 0; i < n; i++) {\n        minh[i] = 10000;\n        minl[i] = 10000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minh[i] > a[i][j])\n            minh[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minh[i];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minl[j] > a[i][j])\n            minl[j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minl[j];\n        }\n      }\n\n      sum = sum + a[t][t];\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (i == t || j == t)\n            a[i][j] = 10000;\n        }\n      }\n\n      t++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33124", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int step, int *sum) {\n  int i, j, min, g;\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[i][j] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[i][j];\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[j][i] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[j][i];\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[j][i] -= min;\n    }\n  }\n  *sum += a[step][step];\n  return;\n}\n\nint main() {\n  int n, i, j, k, a[100][100], sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, 0, 40000);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (j = 1; j < n; j++)\n      change(a, n, j, &sum);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33125", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint min(int a[100][100], int, int, int);\nint main() {\n  int n, a[100][100], m, j, k, t;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    m = 0;\n    for (int l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 0, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= t;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 1, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[k][j] -= t;\n        }\n      }\n      m += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < n - l - 1; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", m);\n  }\n  return 0;\n}\n\nint min(int a[100][100], int s, int l, int n) {\n  int t;\n  if (s == 0) {\n    t = a[l][0];\n    for (int i = 0; i < n; i++) {\n      if (t > a[l][i])\n        t = a[l][i];\n    }\n  } else {\n    t = a[0][l];\n    for (int j = 0; j < n; j++) {\n      if (t > a[j][l])\n        t = a[j][l];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "33126", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], min, sum = 0, t = 0, c = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n      cout << endl;\n    }\n    for (int l = 0; l < n - 1; l++) {\n      for (int j = 0; j < n - l; j++) {\n        t = 0;\n        for (int q = 0; q < n - l; q++)\n          if (a[j][q] == 0)\n            t = t + 1;\n        if (t > 0)\n          continue;\n        else {\n          min = a[j][0];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[j][y])\n              min = a[j][y];\n          for (int r = 0; r < n - l; r++)\n            a[j][r] = a[j][r] - min;\n        }\n      }\n      for (int k = 0; k < n - l; k++) {\n        c = 0;\n        for (int p = 0; p < n - l; p++)\n          if (a[p][k] == 0)\n            c = c + 1;\n        if (c > 0)\n          continue;\n        else {\n          min = a[0][k];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[y][k])\n              min = a[y][k];\n          for (int r = 0; r < n - l; r++)\n            a[r][k] = a[r][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      a[0][0] = a[0][0];\n      for (int e = 1; e < n - l; e++)\n        a[0][e] = a[0][e + 1];\n      for (int g = 1; g < n - l; g++)\n        a[g][0] = a[g + 1][0];\n      for (int f = 1; f < n - l; f++) {\n        for (int s = 1; s < n - l; s++)\n          a[f][s] = a[f + 1][s + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[105][105], s, min = 10000, sum = 0;\n  cin >> n;\n  s = n;\n  for (int g = 1; g <= n; g++) {\n    sum = 0;\n    s = n;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> m[i][j];\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[i][j] < min)\n            min = m[i][j];\n        for (int j = 1; j <= s; j++)\n          m[i][j] = m[i][j] - min;\n      }\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[j][i] < min)\n            min = m[j][i];\n        for (int j = 1; j <= s; j++)\n          m[j][i] = m[j][i] - min;\n      }\n      sum = sum + m[2][2];\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s; j++) {\n          m[i][j] = m[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s - 1; j++)\n          m[j][i] = m[j][i + 1];\n      }\n      s = s - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[100][100], sum = 0, min_1 = 1000, rst[100];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &map_1[j][k]);\n    for (t = n; t > 1; t--) {\n      for (j = 0; j < t; j++) {\n        for (k = 0; k < t; k++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (k = 0; k < t; k++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n        min_1 = 1000;\n      }\n\n      min_1 = 1000;\n      for (k = 0; k < t; k++) {\n        for (j = 0; j < t; j++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (j = 0; j < t; j++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n\n        min_1 = 1000;\n      }\n      sum = sum + map_1[1][1];\n\n      for (k = 1; k < t - 1; k++)\n        map_1[0][k] = map_1[0][k + 1];\n      for (j = 1; j < t - 1; j++)\n        map_1[j][0] = map_1[j + 1][0];\n      for (j = 1; j < t - 1; j++)\n        for (k = 1; k < t - 1; k++)\n          map_1[j][k] = map_1[j + 1][k + 1];\n\n      min_1 = 1000;\n    }\n    rst[i] = sum;\n    sum = 0;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\", rst[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33129", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000][1000];\nint juzheng(int y) {\n  if (y == 1) {\n    return 0;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[i][j] < min)\n        min = x[i][j];\n    }\n    for (int j = 1; j <= y; j++)\n      x[i][j] = x[i][j] - min;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[j][i] < min)\n        min = x[j][i];\n    }\n    for (int j = 1; j <= y; j++)\n      x[j][i] = x[j][i] - min;\n  }\n  int min1 = x[2][2];\n  for (int i = 2; i < y; i++)\n    x[1][i] = x[1][i + 1];\n  for (int i = 2; i < y; i++)\n    x[i][1] = x[i + 1][1];\n  for (int i = 3; i <= y; i++)\n    for (int j = 3; j <= y; j++)\n      x[i - 1][j - 1] = x[i][j];\n\n  return min1 + juzheng(y - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        scanf(\"%d \", &x[j][k]);\n\n    cout << juzheng(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], b[100], c[100];\nint xiao(int n) {\n  int x;\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[i]][c[j]] < min)\n        min = a[b[i]][b[j]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[i]][c[j]] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[j]][c[i]] <= min)\n        min = a[b[j]][b[i]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[j]][c[i]] -= min;\n    }\n  }\n  x = a[b[1]][c[1]];\n  if (n > 2) {\n    for (int i = 1; i < n - 1; i++) {\n      b[i] = b[i + 1];\n      c[i] = c[i + 1];\n    }\n    return (x + xiao(n - 1));\n  } else\n    return x;\n}\nint main() {\n  int n;\n\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    for (int i = 0; i < n; i++) {\n      b[i] = c[i] = i;\n    }\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\n\nint sum(int n) {\n  int i, j, t;\n  int min[n];\n  if (n != 1) {\n    for (i = 0; i < n; i++) {\n      min[i] = juzhen[i][0];\n      for (j = 0; j < n; j++) {\n        if (juzhen[i][j] < min[i])\n          min[i] = juzhen[i][j];\n      }\n      for (j = 0; j < n; j++)\n        juzhen[i][j] -= min[i];\n    }\n    for (j = 0; j < n; j++) {\n      min[j] = juzhen[0][j];\n      for (i = 0; i < n; i++) {\n        if (juzhen[i][j] < min[j])\n          min[j] = juzhen[i][j];\n      }\n      for (i = 0; i < n; i++)\n        juzhen[i][j] -= min[j];\n    }\n    t = juzhen[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i][j + 1];\n    for (j = 0; j < n - 1; j++)\n      for (i = 1; i < n - 1; i++)\n        juzhen[i][j] = juzhen[i + 1][j];\n    return sum(n - 1) + t;\n  } else\n    return 0;\n}\n\nint main() {\n  int N, I, J, K;\n  cin >> N;\n  for (K = 1; K <= N; K++) {\n    for (I = 0; I < N; I++)\n      for (J = 0; J < N; J++)\n        cin >> juzhen[I][J];\n    printf(\"%d\\n\", sum(N));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33132", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[100][100], int n);\n  int n, a[100][100], i, j, k, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    s = f(a, n);\n    printf(\"%d\\n\", s);\n  }\n}\n\nint f(int a[100][100], int n) {\n  int i, j, k, min[100], s = 0;\n  for (i = 0; i < n; i++) {\n    min[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] -= min[j];\n  }\n  if (n == 2)\n    s = a[1][1];\n  else {\n    k = a[1][1];\n    for (j = 1; j < n - 1; j++)\n      a[0][j] = a[0][j + 1];\n    for (i = 1; i < n - 1; i++)\n      a[i][0] = a[i + 1][0];\n    for (i = 1; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i + 1][j + 1];\n    s = k + f(a, n - 1);\n  }\n  return s;\n}\n"}
{"label": "18", "index": "33133", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, i, j, k; \nvoid f(int);    \nint a[100][100];\nint s;\nint main() {\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    s = 0;                    \n    for (i = 0; i < n; i++) { \n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    f(n); \n  }\n  return 0;\n}\n\nvoid f(int m) {\n  for (i = 0; i < m; i++) { \n    int min = 1000;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < m; j++) { \n    int min = 1000;\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  s = s + a[1][1];          \n  for (i = 0; i < m; i++) { \n    for (j = 1; j < m - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < m; j++) {\n    for (i = 1; i < m - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  if (m == 2) \n  {\n    cout << s << endl;\n  } else\n    f(m - 1); \n}\n"}
{"label": "18", "index": "33134", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cal(int matrix[][120], int n) {\n  if (n == 1)\n    return (0);\n  int i, j, min, s;\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] < min)\n        min = matrix[i][j];\n    }\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[j][i] < min)\n        min = matrix[j][i];\n    }\n    for (j = 0; j < n; j++)\n      matrix[j][i] = matrix[j][i] - min;\n  }\n  s = matrix[1][1];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i + 1][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      matrix[i][j] = matrix[i][j + 1];\n\n  return (s + cal(matrix, n - 1));\n}\n\nint main() {\n  int n, i, j, k;\n  int a[120][120];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", cal(a, n));\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "33135", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, l, s = 0;\nint jz[100][100];\nint f() {\n  int i, j, k, min = 10000;\n  if (n == 1) {\n    cout << s << endl;\n    s = 0;\n    n = l;\n    return 0;\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[i][k] = jz[i][k] - min;\n          min = 10000;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[k][i] = jz[k][i] - min;\n          min = 10000;\n        }\n      }\n    }\n    s = s + jz[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[i][j] = jz[i][j + 1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[j][i] = jz[j + 1][i];\n    n = n - 1;\n    f();\n  }\n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  l = n;\n  for (i = 1; i <= l; i++) {\n    for (j = 0; j < l; j++)\n      for (k = 0; k < l; k++)\n        cin >> jz[j][k];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int x, int y) {\n  int z;\n  if (x > y)\n    z = y;\n  else\n    z = x;\n  return (z);\n}\nint main() {\n  int n, m, k, i, j, a[101][101], s[101], sum;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        s[i] = a[i][1];\n        for (j = 1; j <= n - k + 1; j++)\n          s[i] = min(a[i][j], s[i]);\n      }\n      for (i = 1; i <= n - k + 1; i++) {\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j] = a[i][j] - s[i];\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        s[j] = a[1][j];\n        for (i = 1; i <= n - k + 1; i++)\n          s[j] = min(a[i][j], s[j]);\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j] = a[i][j] - s[j];\n      }\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - k + 1; i++) {\n        if ((n - k + 1) >= 3)\n          for (j = 3; j <= n - k + 1; j++)\n            a[i][j - 1] = a[i][j];\n        else\n          break;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        if ((n - k + 1) >= 3)\n          for (i = 3; i <= n - k + 1; i++)\n            a[i - 1][j] = a[i][j];\n        else\n          break;\n      }\n    }\n    printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33137", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nvoid matrix_down(int a[150][150], int large) \n{\n  int v, r;\n  for (v = 0; v <= large - 1; v++) \n  {\n    int minl;\n    minl = a[v][0];\n    for (r = 1; r <= large - 1; r++) \n    {\n      if (a[v][r] <= minl) {\n        minl = a[v][r];\n      }\n      if (a[v][r] == 0) {\n        minl = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) \n    {\n      a[v][r] = a[v][r] - minl;\n    }\n  }\n  for (v = 0; v <= large - 1; v++) \n  {\n    int minr;\n    minr = a[0][v];\n    for (r = 1; r <= large - 1; r++) \n    {\n      if (a[r][v] <= minr) {\n        minr = a[r][v];\n      }\n      if (a[r][v] == 0) {\n        minr = 0;\n        break;\n      }\n    }\n    for (r = 0; r <= large - 1; r++) \n    {\n      a[r][v] = a[r][v] - minr;\n    }\n  }\n}\n\nvoid matrix_short(int a[150][150], int large) \n{\n  int i, r;\n  for (i = 1; i <= large - 2; i++) \n  {\n    for (r = 1; r <= large - 2; r++) {\n      a[i][r] = a[i + 1][r + 1];\n    }\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n}\n\nint main() {\n  int n, i, u, v, r, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) \n  {\n    int a[150][150] = {0};\n    int sum = 0;\n    for (u = 0; u <= n - 1; u++) \n    {\n      for (v = 0; v <= n - 1; v++) {\n        cin >> a[u][v];\n      }\n    }\n    for (u = n; u >= 2; u--) \n    {\n      matrix_down(a, u);\n      sum = a[1][1] + sum;\n      matrix_short(a, u);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, N, n, o, i, j, r, a[200][200] = {0};\n  scanf(\"%d\", &n);\n  for (N = 1; N <= n; N++) {\n    r = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (m = 0; m <= n - 2; m++) {\n      for (i = 0; i <= n - 1; i++) {\n        {\n          if ((i >= 1) && (i <= m)) {\n            i = m;\n            continue;\n          }\n        }\n        o = a[i][0];\n        for (j = 1; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        {\n          if ((j >= 1) && (j <= m)) {\n            j = m;\n            continue;\n          }\n        }\n        o = a[0][j];\n        for (i = 1; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (i = 0; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      r = r + a[1 + m][1 + m];\n    }\n    printf(\"%d\\n\", r);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint i, j, n, sum = 0;\nvoid xiaojian(int times) {\n  for (i = 0; i < times; i++)\n    for (j = 1; j < times - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < times; j++)\n    for (i = 1; i < times - 1; i++)\n      a[i][j] = a[i + 1][j];\n  return;\n}\nint F(int times) {\n  if (times == 1)\n    return sum;\n  else {\n    int J[times];\n    for (i = 0; i < times; i++) {\n      J[i] = a[i][0];\n      for (j = 0; j < times - 1; j++) {\n        if (J[i] > a[i][j + 1])\n          J[i] = a[i][j + 1];\n      }\n      if (J[i] > 0)\n        for (int t = 0; t < times; t++)\n          a[i][t] -= J[i];\n    }\n    int I[times];\n    for (j = 0; j < times; j++) {\n      I[j] = a[0][j];\n      for (i = 0; i < times - 1; i++) {\n        if (I[j] > a[i + 1][j])\n          I[j] = a[i + 1][j];\n      }\n      if (I[j] > 0)\n        for (int t = 0; t < times; t++)\n          a[t][j] -= I[j];\n    }\n    sum += a[1][1];\n    xiaojian(times);\n    return F(times - 1);\n  }\n}\nint main() {\n  cin >> n;\n  int t = 0;\n  while (t < n) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", F(n));\n    sum = 0;\n    t++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33140", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\n\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int h, w, mw, mh, i, j;\n  for (i = 1; i <= n; ++i) {\n    mw = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[i][h] < mw)\n        mw = a[i][h];\n    for (h = 1; h <= n; ++h)\n      a[i][h] -= mw;\n  }\n  for (i = 1; i <= n; ++i) {\n    mh = 1000;\n    for (h = 1; h <= n; ++h)\n      if (a[h][i] < mh)\n        mh = a[h][i];\n    for (h = 1; h <= n; ++h)\n      a[h][i] -= mh;\n  }\n  w = a[2][2];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j <= n; ++j)\n      a[i][j] = a[i + 1][j];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j < n; ++j)\n      a[j][i] = a[j][i + 1];\n  return w + f(n - 1);\n}\n\nint main() {\n  int n, i, i1, i2;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; ++i) {\n    for (i1 = 1; i1 <= n; ++i1)\n      for (i2 = 1; i2 <= n; ++i2)\n        scanf(\"%d \", &a[i1][i2]);\n    printf(\"%d\\n\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33141", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum = 0;\n  cin >> n;\n  int i, j, k, h, p, q;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    int board[105][105] = {0};\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> board[i][j];\n      }\n    }\n    for (h = 0; h < n; h++) {\n      for (i = h; i < n; i++) {\n        int min = board[i][h];\n        for (j = h; j < n; j++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (j = h; j < n; j++) {\n          board[i][j] -= min;\n        }\n      }\n      for (j = h; j < n; j++) {\n        int min = board[h][j];\n        for (i = h; i < n; i++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (i = h; i < n; i++) {\n          board[i][j] -= min;\n        }\n      }\n      sum += board[h + 1][h + 1];\n      board[h + 1][h + 1] = board[h][h];\n      for (p = h + 2; p < n; p++) {\n        board[h + 1][p] = board[h][p];\n      }\n      for (p = h + 2; p < n; p++) {\n        board[p][h + 1] = board[p][h];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int change(int a[100][100], int);\n  int n, a[100][100], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    printf(\"%d\\n\", change(a, n));\n  }\n  return 0;\n}\nint change(int a[100][100], int n) {\n  int i, j, s, b[100][100], f;\n  for (i = 0; i < n; i++) {\n    s = a[i][0];\n    for (j = 0; j < n; j++)\n      s = (s > a[i][j]) ? a[i][j] : s;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < n; i++) {\n    s = a[0][i];\n    for (j = 0; j < n; j++)\n      s = (s > a[j][i]) ? a[j][i] : s;\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  f = a[1][1];\n  if (n > 2) {\n    b[0][0] = a[0][0];\n    for (i = 2; i < n; i++) {\n      b[0][i - 1] = a[0][i];\n      b[i - 1][0] = a[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        b[i - 1][j - 1] = a[i][j];\n    f = f + change(b, n - 1);\n  }\n  return f;\n}\n"}
{"label": "18", "index": "33143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guiling(int a[][100], int);\nvoid xiaojian(int a[][100], int);\nint main() {\n  int n, a[100][100], k, i, j, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];             \n    for (int t = 0; t < n - 1; t++) \n    {\n      guiling(a, n - t);  \n      sum += a[1][1];     \n      xiaojian(a, n - t); \n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\nvoid guiling(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j]; \n    for (j = 0; j < n; j++)\n      a[i][j] -= min; \n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i]; \n    for (j = 0; j < n; j++)\n      a[j][i] -= min; \n  }\n}\nvoid xiaojian(int a[][100], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j]; \n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j]; \n}\n"}
{"label": "18", "index": "33144", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid diminish(int a[105][105], int stair) {\n  int i, j, min[105];\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[i][1];\n    for (j = 1; j <= stair; j++) {\n      if (a[i][j] < min[i]) {\n        min[i] = a[i][j];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[1][i];\n    for (j = 1; j <= stair; j++) {\n      if (a[j][i] < min[i]) {\n        min[i] = a[j][i];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[j][i] -= min[i];\n    }\n  }\n}\nvoid lowerstair(int a[105][105], int stair) {\n  int i, j;\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint deal(int a[105][105], int stair) {\n  int result = 0;\n  while (stair >= 2) {\n    diminish(a, stair);\n    result += a[2][2];\n    lowerstair(a, stair);\n    stair--;\n  }\n  return result;\n}\nint main() {\n  int n, i, j, k, stair, sum, a[105][105];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    stair = n;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = deal(a, stair);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minline(int n, int u, int **a) {\n  int temp = a[0][u];\n  for (int i = 1; i < n; i++) {\n    if (temp > a[i][u]) {\n      temp = a[i][u];\n    }\n  }\n  return temp;\n}\nint mincross(int n, int a[]) {\n  int temp = a[0];\n  for (int i = 0; i < n; i++) {\n    if (temp > a[i])\n      temp = a[i];\n  }\n  return temp;\n}\n\nint ans(int n, int **pp) {\n\n  int sum = 0;\n\n  for (int y = 0; y < n - 1; y++) {\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = mincross(n - y, pp[i]);\n      for (int j = 0; j < n - y; j++) {\n        pp[i][j] = pp[i][j] - minTemp;\n      }\n    }\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = minline(n - y, i, pp);\n      for (int j = 0; j < n - y; j++) {\n        pp[j][i] = pp[j][i] - minTemp;\n      }\n    }\n    sum = sum + pp[1][1];\n\n    for (int i = 0; i < n - y; i++) {\n      for (int j = 1; j < n - 1 - y; j++) {\n        pp[i][j] = pp[i][j + 1];\n      }\n    }\n\n    for (int i = 0; i < n - 1 - y; i++) {\n      for (int j = 1; j < n - y - 1; j++) {\n        pp[j][i] = pp[j + 1][i];\n      }\n    }\n  }\n  return sum;\n}\n\nint main(void) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int **pp;\n  pp = (int **)malloc(n * sizeof(int *));\n  for (int i = 0; i < n; i++) {\n    pp[i] = (int *)malloc(n * sizeof(int));\n  }\n\n  for (int w = 0; w < n; w++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &pp[i][j]);\n      }\n    }\n    printf(\"%d\\n\", ans(n, pp));\n  }\n\n  for (int i = 0; i < n; i++) {\n    free(pp[i]);\n  }\n  free(pp);\n\n  return 0;\n}\n"}
{"label": "18", "index": "33146", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  int n = num, numcas = num;\n\n  int a[301][301];\n  while (num--) {\n    int s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < numcas; i++)\n      for (int j = 0; j < numcas; j++)\n        cin >> a[i][j];\n\n    n = numcas;\n    while (1) {\n\n      if (n == 0) {\n        cout << s << endl;\n        break;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int i = 0; i < n; i++)\n          a[j][i] -= min;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n\n      s += a[1][1];\n\n      for (int j = 0; j < n; j++)\n        for (int i = 1; i < n; i++) {\n          a[j][i] = a[j][i + 1];\n        }\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      n--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum, num, (*p)[200], t, temp;\n  int a[200][200];\n  scanf(\"%d \", &n);\n  sum = 0;\n  num = 0;\n  p = a;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (num < n - 1) {\n      for (i = 0; i < n - num; i++) {\n        temp = 1000;\n        for (j = 0; j < n - num; j++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        temp = 1000;\n        for (i = 0; i < n - num; i++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n        }\n      }\n      num++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33148", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint x[1000][1000];\nint juzheng(int y) {\n  if (y == 1) {\n    return 0;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[i][j] < min)\n        min = x[i][j];\n    }\n    for (int j = 1; j <= y; j++)\n      x[i][j] = x[i][j] - min;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[j][i] < min)\n        min = x[j][i];\n    }\n    for (int j = 1; j <= y; j++)\n      x[j][i] = x[j][i] - min;\n  }\n  int min1 = x[2][2];\n  for (int i = 2; i < y; i++)\n    x[1][i] = x[1][i + 1];\n  for (int i = 2; i < y; i++)\n    x[i][1] = x[i + 1][1];\n  for (int i = 3; i <= y; i++)\n    for (int j = 3; j <= y; j++)\n      x[i - 1][j - 1] = x[i][j];\n\n  return min1 + juzheng(y - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> x[j][k];\n    \n    cout << juzheng(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint num[100][100];\nint n = 0;\n\nint xiaoling(int a);\n\nint main() {\n  int i, j, sum = 0, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    }\n    sum = xiaoling(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint xiaoling(int a) {\n  int i, j, min, temp = 0;\n  if (a == 1)\n    return 0;\n  for (i = 0; i < a; i++) {\n    min = num[i][0];\n    for (j = 0; j < a; j++) {\n      min = (min > num[i][j]) ? num[i][j] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    min = num[0][i];\n    for (j = 0; j < a; j++) {\n      min = (min > num[j][i]) ? num[j][i] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n  }\n  temp = num[1][1];\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[j][i] = num[j + 1][i];\n    }\n  }\n  return temp + xiaoling(a - 1);\n}\n"}
{"label": "18", "index": "33150", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[200][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[200][200], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[200][200];\n    memset(a, 0, 40000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint findmin(int *a, int n, int step) {\n  int min = 32767;\n  while (n > 0) {\n    if (min > *a)\n      min = *a;\n    a += step;\n    n--;\n  }\n  return min;\n}\n\nint main() {\n  int n, k, a[100][100], i, j, l, sum, t;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    sum = 0;\n    for (i = n; i >= 2; i--) {\n      for (j = 0; j < i; j++) {\n        t = findmin(a[j], i, 1);\n        for (l = 0; l < i; l++)\n          a[j][l] -= t;\n      }\n      for (j = 0; j < i; j++) {\n        t = findmin(&a[0][j], i, 100);\n        for (l = 0; l < i; l++)\n          a[l][j] -= t;\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < i - 1; j++) {\n        for (l = 0; l < i; l++)\n          a[j][l] = a[j + 1][l];\n        for (l = 0; l < i; l++)\n          a[l][j] = a[l][j + 1];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33152", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, t = 0, b[100][100];\n  int i, j, k, min;\n  cin >> m;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> b[j][k];\n      }\n    }\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = b[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > b[j][k]) {\n            min = b[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          b[j][k] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = b[0][j];\n        for (k = 0; k < n; k++) {\n          if (min > b[k][j]) {\n            min = b[k][j];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          b[k][j] -= min;\n        }\n      }\n      t += b[1][1];\n      for (j = 1; j < n - 1; j++) {\n        b[0][j] = b[0][j + 1];\n        b[j][0] = b[j + 1][0];\n        for (k = 1; k < n - 1; k++) {\n          b[j][k] = b[j + 1][k + 1];\n        }\n      }\n    }\n    cout << t << endl;\n    t = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33153", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][1000], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int p = remain(a, n, 0);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int a[100][100], int);\nint main() {\n  int n, a[100][100], i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << cut(a, n) << endl;\n  }\n  return 0;\n}\nint cut(int a[100][100], int n) {\n  int i, j, min, count;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      min = (min > a[i][j]) ? a[i][j] : min;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      min = (min > a[j][i]) ? a[j][i] : min;\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  count = a[1][1];\n  if (n == 2)\n    return count;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  }\n  return (cut(a, n - 1) + count);\n}\n"}
{"label": "18", "index": "33155", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int nx) {\n  int x, min;\n  min = a[0];\n  for (x = 0; x <= nx - 1; x++) {\n    if (a[x] <= min) {\n      min = a[x];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int temp, nx, y, sum, i, j, k, n, a[100][100], b[100], m;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    nx = n;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (y = 1; y <= n - 1; y++) {\n      for (j = 0; j <= n - 1; j++) {\n        temp = min(a[j], nx);\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        for (m = 0; m <= n - 1; m++) {\n          b[m] = a[m][k];\n        }\n        temp = min(b, nx);\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (k = 1; k <= n - 2; k++) {\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      nx--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33156", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m, the_min;\nint a[110][110];\n\nvoid reduce_min(int x, int y, int dx, int dy) {\n  if (x == m || y == m) {\n    return;\n  }\n  if (a[x][y] < the_min) {\n    the_min = a[x][y];\n  }\n  reduce_min(x + dx, y + dy, dx, dy);\n  a[x][y] -= the_min;\n}\n\nvoid reduce() {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  }\n}\n\nint main() {\n  int i, j;\n  int t;\n  int sum;\n  scanf(\"%d\", &n);\n  for (t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    for (m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        the_min = 10000;\n        reduce_min((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      reduce();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33157", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[101] = {0}, min;\n  int i, j, k, l, h, n;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      for (l = 0; l <= n - j; l++) {\n        min = a[l][0];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[l][h]) {\n            min = a[l][h];\n          }\n        }\n        for (h = 0; h <= n - j; h++)\n          a[l][h] = a[l][h] - min;\n      }\n      for (l = 0; l <= n - j; l++) {\n        min = a[0][l];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[h][l]) {\n            min = a[h][l];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[h][l] = a[h][l] - min;\n        }\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (l = 1; l <= n - j - 1; l++) {\n        a[0][l] = a[0][l + 1];\n        a[l][0] = a[l + 1][0];\n      }\n      for (l = 1; l <= n - j - 1; l++) {\n        for (h = 1; h <= n - j - 1; h++) {\n          a[l][h] = a[l + 1][h + 1];\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33158", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint findmin(int c, int low, int n) {\n  int min;\n  if (c == 1) {\n    int i;\n    min = a[low][0];\n    for (i = 0; i < n; i++) {\n      if (a[low][i] < min)\n        min = a[low][i];\n    }\n  }\n  if (c == 0) {\n    int i;\n    min = a[0][low];\n    for (i = 0; i < n; i++) {\n      if (a[i][low] < min)\n        min = a[i][low];\n    }\n  }\n  return min;\n}\nint dec(int n, int sum) {\n  if (n == 1)\n    return sum;\n  int i, j, k, min;\n  for (i = 0; i < n; i++) {\n    min = findmin(1, i, n);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = findmin(0, i, n);\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  return dec(n - 1, sum);\n}\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, s, t;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", dec(n, 0));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33159", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[200][200], x, p, q, min, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    for (x = n; x >= 2; x--) {\n      for (p = 1; p <= x; p++) {\n        min = 10000;\n        for (q = 1; q <= x; q++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (q = 1; q <= x; q++)\n          a[p][q] = a[p][q] - min;\n      }\n      for (q = 1; q <= x; q++) {\n        min = 10000;\n        for (p = 1; p <= x; p++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (p = 1; p <= x; p++)\n          a[p][q] = a[p][q] - min;\n      }\n      sum = sum + a[2][2];\n      for (p = 1; p <= x; p++)\n        for (q = 2; q <= x - 1; q++)\n          a[p][q] = a[p][q + 1];\n      for (q = 1; q <= x - 1; q++)\n        for (p = 2; p <= x - 1; p++)\n          a[p][q] = a[p + 1][q];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, k, array[100][100];\n  scanf(\"%d \", &n);\n  k = n;\n  m = n;\n  while (m > 0) {\n    int i, j, min;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &array[i][j]);\n    int sum = 0;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = array[i][0];\n        for (j = 1; j < k; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j < k; j++)\n          array[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = array[0][i];\n        for (j = 1; j < k; j++) {\n          if (array[j][i] < min)\n            min = array[j][i];\n        }\n        for (j = 0; j < k; j++) {\n          array[j][i] -= min;\n        }\n      }\n      sum += array[1][1];\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k - 1; j++) {\n          array[i][j] = array[i][j + 1];\n        }\n      }\n      for (j = 0; j < k - 1; j++) {\n        for (i = 1; i < k - 1; i++) {\n          array[i][j] = array[i + 1][j];\n        }\n      }\n      k--;\n    }\n    cout << sum << endl;\n    k = n;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33161", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200];\n  scanf(\"%d \", &n);\n\n  for (i = 0; i <= 199; i++)\n    for (j = 0; j <= 199; j++)\n      num[i][j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        scanf(\"%d \", &num[j][k]);\n\n    cout << del(num, n) << endl;\n  }\n  return 0;\n}\n\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 9999;\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min)\n        min = num[j][i];\n    }\n    for (i = 0; i <= n - 1; i++)\n      num[j][i] = num[j][i] - min;\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n\n    for (i = 0; i <= n - 1; i++)\n      num[i][j] = num[i][j] - min;\n  }\n  sum = sum + num[1][1];\n\n  if (n == 2)\n    return sum;\n\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33162", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100] = {0};\nvoid change(int k, int n) {\n  matrix[k + 1][k + 1] = matrix[k][k];\n  int i = 0;\n  if (n - 1 >= k + 2) {\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[k + 1][i] = matrix[k][i];\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[i][k + 1] = matrix[i][k];\n  }\n}\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  int m = 0;\n  int sum[100] = {0};\n  for (m = 0; m <= n - 1; m++) {\n\n    int i = 0, j = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> matrix[i][j];\n    int k = 0;\n    for (k = 0; k <= n - 2; k++) {\n      int min = 10000;\n      for (i = k; i <= n - 1; i++) {\n        min = 10000;\n        for (j = k; j <= n - 1; j++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (j = k; j <= n - 1; j++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      for (j = k; j <= n - 1; j++) {\n        min = 10000;\n        for (i = k; i <= n - 1; i++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (i = k; i <= n - 1; i++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      sum[m] = sum[m] + matrix[k + 1][k + 1];\n      change(k, n);\n    }\n  }\n  for (m = 0; m <= n - 1; m++)\n    printf(\"%d\\n\", sum[m]);\n  return 0;\n}\n"}
{"label": "18", "index": "33163", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[50][50][50];\n  int max[101] = {0};\n  int i, j, k, n, min, t = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[i][j][k];\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n - 1; t++) {\n      for (j = 1; j <= n - t; j++) {\n        min = a[i][j][1];\n\n        for (k = 1; k <= n - t; k++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      for (k = 1; k <= n - t; k++) {\n        min = a[i][1][k];\n        for (j = 1; j <= n - t; j++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      max[i] = max[i] + a[i][2][2];\n      for (j = 2; j <= n - t - 1; j++) {\n        for (k = 1; k <= n - t; k++) {\n          a[i][j][k] = a[i][j + 1][k];\n        }\n      }\n      for (k = 2; k <= n - t - 1; k++) {\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++)\n    cout << max[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33164", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  static int s = 0;\n  int i, j;\n  double m1, m2;\n  int *p;\n\n  if (n == 1) {\n    printf(\"%d \", s);\n    s = 0;\n  }\n\n  if (n > 1) {\n    for (i = 0; i < n; i++) {\n      p = a[i];\n      m1 = 100000;\n      for (j = 0; j < n; j++)\n        if (p[j] <= m1)\n          m1 = p[j];\n      for (j = 0; j < n; j++)\n        p[j] = p[j] - m1;\n    }\n\n    for (j = 0; j < n; j++) {\n      m2 = 100000;\n      for (i = 0; i < n; i++)\n        if (a[i][j] <= m2)\n          m2 = a[i][j];\n      for (i = 0; i < n; i++)\n        a[i][j] -= m2;\n    }\n\n    s += a[1][1];\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (i = 0; i < n - 1; i++)\n        a[i][j] = a[i][j + 1];\n    }\n\n    f(a, n - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    f(a, n);\n  }\n}\n"}
{"label": "18", "index": "33165", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100][100];\nint main() {\n  int m, n, i, j, t, k = 0, p, ans;\n  cin >> m;\n  while (k < m) {\n    n = m;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    p = 1;\n    while (n > p) {\n      for (i = 0; i < n; i++) {\n        if (i && i < p)\n          continue;\n        t = *(*(a + i) + 0);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + i) + j) ? *(*(a + i) + j) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= t;\n      }\n      for (i = 0; i < n; i++) {\n        if (j && j < p)\n          continue;\n        t = *(*(a + 0) + i);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + j) + i) ? *(*(a + j) + i) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) -= t;\n      }\n      ans += *(*(a + p) + p);\n      p++;\n    }\n    printf(\"%d\\n\", ans);\n    k++;\n  }\n}\n"}
{"label": "18", "index": "33166", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint make(int a[100][100], int l, int num, int n);\nint main() {\n  int n, i, j, k, l, num, ans = 0;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    ans = 0;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      num = l;\n      ans = ans + make(a, l, num, n);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\nint make(int a[100][100], int l, int num, int n) {\n  int min1, min2, i, j, k, p, q, m;\n  for (k = 0; k <= n - 1; k++) {\n    min1 = a[k][0];\n    for (i = l; i <= n - 1; i++) {\n      if (a[k][i] < min1)\n        min1 = a[k][i];\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[k][j] = a[k][j] - min1;\n    }\n  }\n  for (p = 0; p <= n - 1; p++) {\n    min2 = a[0][p];\n    for (q = l; q <= n - 1; q++) {\n      if (a[q][p] < min2)\n        min2 = a[q][p];\n    }\n    a[0][p] = a[0][p] - min2;\n    for (m = l; m <= n - 1; m++) {\n      a[m][p] = a[m][p] - min2;\n    }\n  }\n  num--;\n  if (num == 0)\n    return a[l][l];\n  else\n    return make(a, l, num, n);\n}\n"}
{"label": "18", "index": "33167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint gl(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < k; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return (a[1][1]);\n}\nvoid xj(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[j - 1][i] = a[j][i];\n    }\n  }\n}\nint main() {\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int j, l, sum = 0, a[102][102];\n    for (j = 0; j < k; j++) {\n      for (l = 0; l < k; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 0; j < k - 1; j++) {\n      int temp;\n      temp = gl(a, k - j);\n\n      sum = sum + temp;\n      xj(a, k - j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zero(int a[100][100], int n) {\n  int min[100];\n  for (int i = 0; i < n; ++i) {\n    min[i] = a[i][0];\n    for (int j = 0; j < n; ++j)\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    if (min[i] != 0) {\n      for (int j = 0; j < n; ++j)\n        a[i][j] -= min[i];\n    }\n  }\n  for (int j = 0; j < n; ++j) {\n    min[j] = a[0][j];\n    for (int i = 0; i < n; ++i)\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    if (min[j] != 0)\n      for (int i = 0; i < n; ++i)\n        a[i][j] -= min[j];\n  }\n}\nvoid subduction(int a[100][100], int n) {\n  for (int i = 1; i < n - 1; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; ++i)\n    for (int j = 1; j < n - 1; ++j)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int m, n, s, a[100][100];\n  cin >> n;\n  for (int t = 0; t < n; ++t) {\n    s = 0, m = n;\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    while (m != 1) {\n      zero(a, m);\n      s += a[1][1];\n      subduction(a, m--);\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33169", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, y, m1, m2, p;\n  int a[103][103], s = 0;\n  cin >> n;\n  for (y = 1; y <= n; y++) {\n    p = n;\n    s = 0;\n    m1 = 999999;\n    m2 = 999999;\n    for (i = 1; i <= p; i++)\n      for (j = 1; j <= p; j++)\n        cin >> a[i][j];\n    while (p > 1) {\n\n      for (i = 1; i <= p; i++) {\n        m1 = a[i][1];\n        for (j = 1; j <= p; j++)\n          if (m1 > a[i][j])\n            m1 = a[i][j];\n        for (j = 1; j <= p; j++)\n          a[i][j] -= m1;\n      }\n\n      for (i = 1; i <= p; i++) {\n        m2 = a[1][i];\n        for (j = 1; j <= p; j++)\n          if (m2 > a[j][i])\n            m2 = a[j][i];\n        for (j = 1; j <= p; j++)\n          a[j][i] -= m2;\n      }\n\n      s += a[2][2];\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p - 1; j++)\n          a[j][i] = a[j][i + 1];\n\n      p--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0}, sum = 0;\nvoid guiling(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 2; i < n; i++)\n    a[i - 1][0] = a[i][0];\n  for (j = 2; j < n; j++)\n    a[0][j - 1] = a[0][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int i, j, n, k, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (m > 2) {\n      guiling(m);\n      xiaojian(m);\n      m--;\n    }\n    guiling(2);\n    sum += a[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33171", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, sum, min, anw = 0;\n  int test[100][100];\n  cin >> n;\n  sum = n;\n  for (k = 0; k < sum; k++) {\n    n = sum;\n    for (i = 0; i < sum; i++)\n      for (j = 0; j < sum; j++) {\n        cin >> test[i][j];\n      }\n    anw = 0;\n    while (n != 1) {\n      for (i = 0; i < n; i++) { \n        min = test[i][0];\n        for (j = 0; j < n; j++) {\n          if (min > test[i][j])\n            min = test[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          test[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) { \n        min = test[0][i];\n        for (j = 0; j < n; j++) {\n          if (min > test[j][i])\n            min = test[j][i];\n        }\n        for (j = 0; j < n; j++) {\n          test[j][i] -= min;\n        }\n      }\n      anw += test[1][1];\n      n--;\n      for (i = 1; i < n; i++) { \n        for (j = 0; j <= n; j++)\n          test[i][j] = test[i + 1][j];\n      }\n      for (j = 1; j < n; j++) { \n        for (i = 0; i < n; i++)\n          test[i][j] = test[i][j + 1];\n      }\n    }\n    cout << anw << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, N, n, o, i, j, r, a[200][200] = {0};\n  scanf(\"%d\", &n);\n  for (N = 1; N <= n; N++) {\n    r = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (m = 0; m <= n - 2; m++) {\n      for (i = 0; i <= n - 1; i++) {\n        {\n          if ((i >= 1) && (i <= m)) {\n            i = m;\n            continue;\n          }\n        }\n        o = a[i][0];\n        for (j = 1; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        {\n          if ((j >= 1) && (j <= m)) {\n            j = m;\n            continue;\n          }\n        }\n        o = a[0][j];\n        for (i = 1; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (i = 0; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      r = r + a[1 + m][1 + m];\n    }\n    printf(\"%d\\n\", r);\n  }\n}\n"}
{"label": "18", "index": "33173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid minus_row_col(int n) {\n  int row[100], col[100], min_row = 10000, min_col = 10000, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min_row)\n        min_row = a[i][j];\n    }\n    row[i] = min_row;\n    min_row = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= row[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min_col)\n        min_col = a[j][i];\n    }\n    col[i] = min_col;\n    min_col = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] -= col[i];\n}\n\nvoid delete_row_col(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    sum = 0;\n    int num = n;\n    while (num != 1) {\n      minus_row_col(num);\n      sum += a[1][1];\n      delete_row_col(num);\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[101][101] = {0};\n  int small[101] = {0};\n  int sum = 0;\n  int i, j, k, l;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d \", &a[j][k]);\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[k][1];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          if (a[k][l] < small[k])\n            small[k] = a[k][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k][l] - small[k];\n\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[1][k];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          if (a[k][l] < small[l])\n            small[l] = a[k][l];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          a[k][l] = a[k][l] - small[l];\n\n      sum = sum + a[2][2];\n      for (k = 2; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k + 1][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 2; l <= n - j + 1; l++)\n          a[k][l] = a[k][l + 1];\n    }\n    cout << sum << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33175", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001], sum = 0;\nvoid reduce(int a[][1001], int n) {\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = n; i > 1; i--) {\n      reduce(a, i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, l, t, sum;\n  int a, b, c;\n  int tt[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &tt[j][k]);\n      }\n    }\n    sum = 0;\n    m = n;\n    for (l = 1; l < m; m--) {\n      for (j = 0; j < m; j++) {\n        a = 1000;\n        for (k = 0; k < m; k++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      for (k = 0; k < m; k++) {\n        a = 1000;\n        for (j = 0; j < m; j++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      sum = sum + tt[1][1];\n\n      for (j = 1; j < m; j++) {\n        tt[0][j] = tt[0][j + 1];\n      }\n      for (j = 1; j < m; j++) {\n        tt[j][0] = tt[j + 1][0];\n      }\n      for (j = 1; j < m; j++) {\n        for (k = 1; k < m; k++) {\n          tt[j][k] = tt[j + 1][k + 1];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33177", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[n][n];\n    \n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int a11 = 0; \n    \n    for (int p = n; p >= 2; p--) {\n      \n      for (int j = 0; j < p; j++) {\n        int min = a[j][0];\n        for (int k = 1; k < p; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[j][k] -= min;\n      }\n      \n      for (int j = 0; j < p; j++) {\n        int min = a[0][j];\n        for (int k = 1; k < p; k++) {\n          if (a[k][j] < min) {\n            min = a[k][j];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[k][j] -= min;\n      }\n      a11 += a[1][1];\n      \n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      \n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n      \n    }\n    cout << a11 << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, sum, min, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 2; j < m; j++)\n          a[i][j - 1] = a[i][j];\n      for (j = 0; j < m; j++)\n        for (i = 2; i < m; i++)\n          a[i - 1][j] = a[i][j];\n      m--;\n    }\n    cout << endl << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[102][102], min = 100000, sum = 0, t;\n  scanf(\"%d \", &n);\n\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (t = 0; t <= n - 2; t++) {\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[i][j] ? min : a[i][j];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[j][i] ? min : a[j][i];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 3; i <= n - t; i++) {\n        a[i - 1][1] = a[i][1];\n        a[1][i - 1] = a[1][i];\n      }\n\n      for (i = 3; i <= n - t; i++) {\n        for (j = 3; j <= n - t; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint n, sum = 0;\nint Sum(int);\nvoid RowSub(int);\nvoid ColSub(int);\n\nint Sum(int n) {\n  RowSub(n);\n  ColSub(n);\n  if (n == 2) {\n    return a[1][1];\n  }\n  int k = a[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    a[i][0] = a[i + 1][0];\n    a[0][i] = a[0][i + 1];\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return k + Sum(n - 1);\n}\n\nvoid RowSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  return;\n}\n\nvoid ColSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return;\n}\nint main() {\n  int i, j, k;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    cout << Sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int a[100][100], int, int, int);\nint main() {\n  int n, a[100][100], m, j, k, t;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    m = 0;\n    for (int l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 0, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= t;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 1, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[k][j] -= t;\n        }\n      }\n      m += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (j = 0; j < n - l - 1; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    cout << m << endl;\n  }\n  return 0;\n}\n\nint min(int a[100][100], int s, int l, int n) {\n  int t;\n  if (s == 0) {\n    t = a[l][0];\n    for (int i = 0; i < n; i++) {\n      if (t > a[l][i])\n        t = a[l][i];\n    }\n  } else {\n    t = a[0][l];\n    for (int j = 0; j < n; j++) {\n      if (t > a[j][l])\n        t = a[j][l];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "33182", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, l, len = 0, sum = 0;\nint array_1[100][100];\nvoid guilinhang(int a) {\n  int min = array_1[a][0];\n  for (l = 0; l < len; l++) {\n    if (array_1[a][l] < min)\n      min = array_1[a][l];\n  }\n  for (l = 0; l < len; l++)\n    array_1[a][l] = array_1[a][l] - min;\n}\nvoid guilinlie(int a) {\n  int min = array_1[0][a];\n  for (l = 0; l < len; l++) {\n    if (array_1[l][a] < min)\n      min = array_1[l][a];\n  }\n  for (l = 0; l < len; l++)\n    array_1[l][a] = array_1[l][a] - min;\n}\nvoid xiaojian(int a) {\n  if (a == 2)\n    return;\n  else if (a > 2) {\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[j][i] = array_1[j][i + 1];\n    }\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[i][j] = array_1[i + 1][j];\n    }\n  }\n}\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    len = n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    }\n    while (len >= 2) {\n      for (i = 0; i < len; i++) {\n        guilinhang(i);\n      }\n      for (i = 0; i < len; i++) {\n        guilinlie(i);\n      }\n      sum = sum + array_1[1][1];\n      xiaojian(len);\n      len--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33183", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[110][110], sum;\n\nvoid dispose(int n);\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int p = 0;\n  do {\n    memset(array_1, 0, sizeof(array_1));\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    dispose(n);\n    cout << sum << endl;\n    p++;\n  } while (p < n);\n  return 0;\n}\n\nvoid dispose(int n) {\n  int i, j;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    int rowmin = array_1[i][0];\n    for (j = 1; j < n; j++)\n      if (rowmin > array_1[i][j])\n        rowmin = array_1[i][j];\n    for (j = 0; j < n; j++)\n      array_1[i][j] -= rowmin;\n  }\n  for (i = 0; i < n; i++) {\n    int colmin = array_1[0][i];\n    for (j = 1; j < n; j++)\n      if (colmin > array_1[j][i])\n        colmin = array_1[j][i];\n    for (j = 0; j < n; j++)\n      array_1[j][i] -= colmin;\n  }\n  sum += array_1[1][1];\n  for (i = 1; i < n - 1; i++)\n    array_1[0][i] = array_1[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    array_1[i][0] = array_1[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      array_1[i][j] = array_1[i + 1][j + 1];\n  dispose(n - 1);\n}\n"}
{"label": "18", "index": "33184", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int m = 0;\n\n  int a[100][100];\n  int(*p)[100];\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n\n    int sum = 0;\n\n    p = a;\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n\n    int min1 = *(*(p + 0) + 0);\n    for (int count = 0; count < n; count++) {\n\n      m = n - count;\n      for (int i = 0; i < m; i++) {\n        min1 = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min1;\n        }\n      }\n      for (int j = 0; j < m; j++) {\n        min1 = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j) -= min1;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      for (int i = 2; i < m; i++) {\n        for (int j = 0; j < m; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (int j = 2; j < m; j++) {\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n    }\n    sum -= *(*(p + 1) + 1);\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, l, t, sum;\n  int a, b, c;\n  int tt[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &tt[j][k]);\n      }\n    }\n    sum = 0;\n    m = n;\n    for (l = 1; l < m; m--) {\n      for (j = 0; j < m; j++) {\n        a = 1000;\n        for (k = 0; k < m; k++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      for (k = 0; k < m; k++) {\n        a = 1000;\n        for (j = 0; j < m; j++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      sum = sum + tt[1][1];\n\n      for (j = 1; j < m; j++)\n        tt[0][j] = tt[0][j + 1];\n\n      for (j = 1; j < m; j++) {\n        tt[j][0] = tt[j + 1][0];\n      }\n      for (j = 1; j < m; j++) {\n        for (k = 1; k < m; k++) {\n          tt[j][k] = tt[j + 1][k + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint sum = 0;\nint minu(int x, int y) {\n  if (x < y)\n    return x;\n  else\n    return y;\n}\nvoid del(int n) {\n  int i, m;\n  int num[n];\n  if (n == 1) {\n    printf(\"%d\\n\", sum);\n    return;\n  } else {\n    for (i = 0; i < n; i++) {\n      num[i] = a[i][0];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[i][m]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[i][m] = a[i][m] - num[i];\n    }\n    for (i = 0; i < n; i++) {\n      num[i] = a[0][i];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[m][i]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[m][i] = a[m][i] - num[i];\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[i][m] = a[i + 1][m];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[m][i] = a[m][i + 1];\n    del(n - 1);\n  }\n}\nint main() {\n  int j, k;\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    del(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33187", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint guiling(int n);\nvoid xiaojian(int n);\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", guiling(n));\n  }\n\n  return 0;\n}\nint guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int k = a[1][1];\n  if (n == 2)\n    return k;\n  else {\n    xiaojian(n);\n    return k + guiling(n - 1);\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33188", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint juzhen[101][101][101] = {0};\nint guiling(int m, int n) {\n  int i, j, k = n, result = 0, num[101][101] = {0}, min[101] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      num[i][j] = juzhen[m][i][j];\n    }\n  }\n  while (k > 1) {\n    for (i = 0; i < k; i++) {\n      min[i] = 10000;\n      for (j = 0; j < k; j++) {\n        if (num[i][j] <= min[i])\n          min[i] = num[i][j];\n      }\n    }\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i][j] - min[i];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      min[j] = 10000;\n      for (i = 0; i < k; i++) {\n        if (num[i][j] <= min[j])\n          min[j] = num[i][j];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j] - min[j];\n      }\n    }\n    result = result + num[1][1];\n    for (i = 1; i < k - 1; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i + 1][j];\n      }\n    }\n    for (j = 1; j < k - 1; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j + 1];\n      }\n    }\n    k--;\n  }\n  return result;\n}\nint main() {\n  int i, j, k, p;\n  scanf(\"%d \", &p);\n  for (k = 0; k < p; k++) {\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < p; j++) {\n        cin >> juzhen[k][i][j];\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    int answer = 0;\n    answer = guiling(i, p);\n    cout << answer << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int a[100][100], int n);\n  int a[100][100];\n  int n;\n  cin >> n;\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k]; \n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) \n{\n  if (n == 1)\n    return 0;\n  int a_1_1;\n  int min[100];\n  int i, j, k;\n\n  for (i = 0; i < n; i++) \n    min[i] = a[i][0];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (min[i] > a[i][j])\n        min[i] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= min[i];\n\n  for (i = 0; i < n; i++) \n    min[i] = a[0][i];\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      if (min[j] > a[i][j])\n        min[j] = a[i][j];\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      a[i][j] -= min[j];\n\n  a_1_1 = a[1][1]; \n\n  for (i = 1; i < n - 1; i++) \n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n\n  return a_1_1 + sum(a, n - 1); \n}\n"}
{"label": "18", "index": "33190", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[110][110];\nint size;\nint zero();\nint main() {\n  int n, i;\n  int x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    size = n;\n    for (x = 0; x < n; x++)\n      for (y = 0; y < n; y++)\n        scanf(\"%d \", &a[x][y]);\n    int sum = 0;\n    for (x = 1; x <= n - 1; x++)\n      sum += zero();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint zero() {\n  int x, y, temp;\n  for (x = 0; x < size; x++) {\n    for (y = 1, temp = a[x][0]; y < size; y++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (y = 0; y < size; y++)\n      a[x][y] -= temp;\n  }\n  for (y = 0; y < size; y++) {\n    for (x = 1, temp = a[0][y]; x < size; x++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (x = 0; x < size; x++)\n      a[x][y] -= temp;\n  }\n  temp = a[1][1];\n  for (x = 1; x < size - 1; x++)\n    for (y = 0; y < size; y++)\n      a[x][y] = a[x + 1][y];\n  for (y = 1; y < size - 1; y++)\n    for (x = 0; x < size - 1; x++)\n      a[x][y] = a[x][y + 1];\n  size -= 1;\n  return temp;\n}\n"}
{"label": "18", "index": "33191", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int n);\nint f(int b[][100], int n);\nint main() {\n  int m, n, i, j;\n  cin >> n;\n  m = n;\n  while (m--) {\n    int a[100][100] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", f(a, n));\n  }\n  return 0;\n}\nint min(int a[], int n) {\n  int mini = a[0], i;\n  for (i = 1; i < n; i++) {\n    if (a[i] < mini)\n      mini = a[i];\n  }\n  return mini;\n}\nint f(int b[][100], int n) {\n  int i, j, m, t, lmin;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      m = min(b[i], n);\n      for (j = 0; j < n; j++)\n        b[i][j] = b[i][j] - m;\n    }\n    for (i = 0; i < n; i++) {\n      lmin = b[0][i];\n      for (j = 0; j < n; j++) {\n        if (b[j][i] < lmin)\n          lmin = b[j][i];\n      }\n      if (lmin > 0)\n        for (j = 0; j < n; j++)\n          b[j][i] = b[j][i] - lmin;\n    }\n    t = b[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        b[i][j] = b[i][j + 1];\n    for (i = 0; i < n - 1; i++) {\n      for (j = 1; j < n - 1; j++)\n        b[j][i] = b[j + 1][i];\n    }\n    return f(b, --n) + t;\n  }\n}\n"}
{"label": "18", "index": "33192", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, x, y, min, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (x = 0; x < n; x++) {\n      for (y = 0; y < n; y++) {\n        scanf(\"%d\", &a[x][y]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      for (x = 0; x < j; x++) {\n        min = a[x][0];\n        for (y = 1; y < j; y++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (y = 0; y < j; y++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (y = 0; y < j; y++) {\n        min = a[0][y];\n        for (x = 1; x < j; x++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (x = 0; x < j; x++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (k = 2; k < j; k++) {\n        a[0][k - 1] = a[0][k];\n      }\n      for (k = 2; k < j; k++) {\n        a[k - 1][0] = a[k][0];\n      }\n      sum = sum + a[1][1];\n      for (x = 2; x < j; x++) {\n        for (y = 2; y < j; y++) {\n          a[x - 1][y - 1] = a[x][y];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33193", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(a[k][i] + j);\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (*(a[p][i] + j) < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][i] + k) = *(a[p][i] + k) - min;\n        }\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (*(a[p][i] + j) < min)\n            min = *(a[p][i] + j);\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][k] + j) = *(a[p][k] + j) - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++) {\n        *(a[p][2] + i) = 0;\n      }\n      for (j = 1; j <= h; j++)\n        *(a[p][j] + 2) = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][j] + i - 1) = *(a[p][j] + i);\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][i - 1] + j) = *(a[p][i] + j);\n        }\n      }\n      h -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000] = {0};\nint sum = 0;\nvoid cut(int n) {\n  int i, j, k;\n  int min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (k = 0; k < n; k++)\n      a[i][k] = a[i][k] - min;\n    min = 10000;\n  }\n  min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (k = 0; k < n; k++)\n      a[k][i] = a[k][i] - min;\n    min = 10000;\n  }\n  sum = sum + a[1][1];\n}\nint main() {\n  int n, i, j, k, p;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (p = 1; p < n; p++) {\n      cut(n - p + 1);\n      for (j = 1; j < n - p; j++)\n        for (k = 1; k < n - p; k++)\n          a[j][k] = a[j + 1][k + 1];\n\n      for (k = 1; k < (n - p); k++)\n        a[0][k] = a[0][k + 1];\n      for (k = 1; k < (n - p); k++)\n        a[k][0] = a[k + 1][0];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33195", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[120][120] = {0}, i, N, j, sum, k, ii, jj, all, zhong = 999;\n  cin >> n;\n  N = n;\n  all = N;\n  for (jj = 1; jj <= N; jj++) {\n    n = N;\n    sum = 0;\n    for (i = 1; i <= N; i++)\n      for (j = 1; j <= N; j++)\n        cin >> *(*(a + i - 1) + j - 1);\n    for (k = 1; k <= N - 1; k++) {\n\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n          if (*(*(a + ii) + i) <= zhong)\n            zhong = *(*(a + ii) + i);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + ii) + i) -= zhong;\n      }\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n\n          if (*(*(a + i) + ii) <= zhong)\n            zhong = *(*(a + i) + ii);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + i) + ii) -= zhong;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], sum;\nint del(int m) {\n  if (m == 1)\n    return sum;\n  int min;\n  for (int i = 0; i < m; i++) {\n    min = a[i][0];\n    for (int j = 1; j < m; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < m; j++) {\n    min = a[0][j];\n    for (int i = 1; i < m; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int j = 1; j < m - 1; j++)\n    a[0][j] = a[0][j + 1];\n  for (int i = 1; i < m - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < m - 1; i++)\n    for (int j = 1; j < m - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return del(m - 1);\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    cout << del(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33197", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int nn, n;\n  cin >> nn; \n\n  int a[101][101];\n  for (int k = 0; k < nn; k++) {\n    int ans = 0;\n    for (int i = 0; i < nn; i++)\n      for (int j = 0; j < nn; j++)\n        cin >> a[i][j];\n    for (int n = nn; n > 1; n--) {\n      int minh[101], minl[101];\n      for (int i = 0; i < n; i++)\n        minh[i] = 1000000;\n      for (int i = 0; i < n; i++)\n        minl[i] = 1000000;\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[i][j] < minh[i])\n            minh[i] = a[i][j];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[i][j] = a[i][j] - minh[i];\n\n      \n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[j][i] < minl[i])\n            minl[i] = a[j][i];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[j][i] = a[j][i] - minl[i];\n      \n\n      \n\n      ans += a[1][1];\n\n      for (int i = 2; i < n; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < n; i++)\n        a[i - 1][0] = a[i][0];\n\n      for (int i = 2; i < n; i++)\n        for (int j = 2; j < n; j++)\n          a[i - 1][j - 1] = a[i][j];\n\n      \n    }\n    cout << ans << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sm1(int line, int sum1, int array1[100][100]) {\n  int min = array1[line][0];\n  for (int i = 0; i < sum1; i++)\n    if (min > array1[line][i])\n      min = array1[line][i];\n  return min;\n}\nint sm2(int row, int sum2, int array2[100][100]) {\n  int min = array2[0][row];\n  for (int i = 0; i < sum2; i++)\n    if (min > array2[i][row])\n      min = array2[i][row];\n  return min;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int step = 0; step < n; step++) {\n    int jz[100][100], he = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    for (int Count = 0; Count < n - 1; Count++) {\n      for (int i = 0; i < n - Count; i++) {\n        int minl = sm1(i, n - Count, jz);\n        for (int j = 0; j < n - Count; j++)\n          jz[i][j] -= minl;\n      }\n      for (int j = 0; j < n - Count; j++) {\n        int minr = sm2(j, n - Count, jz);\n        for (int i = 0; i < n - Count; i++)\n          jz[i][j] -= minr;\n      }\n      he += jz[1][1];\n      for (int i = 2; i < n - Count; i++)\n        for (int j = 2; j < n - Count; j++)\n          jz[i - 1][j - 1] = jz[i][j];\n      for (int i = 2; i < n - Count; i++)\n        jz[i - 1][0] = jz[i][0];\n      for (int j = 2; j < n - Count; j++)\n        jz[0][j - 1] = jz[0][j];\n    }\n    cout << he << endl << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint sum(int n) {\n  if (n == 1)\n    return 0;\n  else {\n    int i, j, m;\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[i][j] < m)\n          m = a[i][j];\n      for (j = 0; j < n; ++j)\n        a[i][j] -= m;\n    }\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[j][i] < m)\n          m = a[j][i];\n      for (j = 0; j < n; ++j)\n        a[j][i] -= m;\n    }\n    int num = a[1][1];\n    for (i = 0; i < n; ++i)\n      for (j = 2; j < n; ++j)\n        a[i][j - 1] = a[i][j];\n    for (i = 0; i < n - 1; ++i) {\n      for (j = 2; j < n; ++j)\n        a[j - 1][i] = a[j][i];\n    }\n    return num + sum(n - 1);\n  }\n}\n\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; ++k) {\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33200", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid minus_1(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[i][j]) ? m : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= m;\n  }\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[j][i]) ? m : a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= m;\n  }\n}\n\nvoid pr(int a[100][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++)\n      printf(\"%d%c\", a[i][j], (j + 1 == k) ? ' ' : ',');\n  }\n}\n\nvoid lower(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i == 0 && j == 0)\n        a[i][j] = a[i][j];\n      else if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      else if (i > 0 && j == 0)\n        a[i][j] = a[i + 1][j];\n      else if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n}\n\nvoid fff(int n) {\n  int a[100][100] = {0};\n  int i = 0, j, sum;\n\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, sum = 0; i < n; i++) {\n    minus_1(a, n - i);\n    sum += a[1][1];\n    lower(a, n - i);\n  }\n  printf(\"%d \", sum);\n}\n\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i++ < n)\n    fff(n);\n}\n"}
{"label": "18", "index": "33201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, x, k;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n    int j, i, a[1000][1000], *p, sum = 0;\n    p = &a[0][0];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p + 101 * i + j);\n    }\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        int min = *(*(a + i));\n        for (j = 0; j < k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        int min = *(*a + j);\n        for (i = 0; i < k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      }\n      for (j = 1; j < k - 1; j++) {\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n      }\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, n;\n  int rowMin, colMin;\n  int x;\n  int first;\n  int sum;\n  int flag;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    sum = 0;\n\n    for (x = n; x > 1; x--) {\n\n      for (i = 0; i < x; i++) {\n        first = 1;\n        flag = 0;\n        for (j = 0; j < x; j++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              rowMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < rowMin)\n              rowMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (j = 0; j < x; j++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - rowMin;\n          }\n        }\n      }\n\n      for (j = 0; j < x; j++) {\n        first = 1;\n        flag = 0;\n        for (i = 0; i < x; i++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              colMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < colMin)\n              colMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (i = 0; i < x; i++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - colMin;\n          }\n        }\n      }\n\n      sum = sum + a[1][1];\n\n      i = 0;\n      for (j = 2; j < x; j++)\n        a[i][j - 1] = a[i][j];\n      j = 0;\n      for (i = 2; i < x; i++)\n        a[i - 1][j] = a[i][j];\n      for (i = 2; i < x; i++) {\n        for (j = 2; j < x; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint smaller(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Sum(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      min = smaller(min, a[i][j]);\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (int i = 0; i < n; i++)\n      min = smaller(min, a[i][j]);\n    for (int i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", Sum(n));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint min(int a[100][100], int, int, int);\nint main() {\n  int n, a[100][100], m, j, k, t;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    m = 0;\n    for (int l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 0, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= t;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        t = min(a, 1, j, n - l);\n        for (k = 0; k < n - l; k++) {\n          a[k][j] -= t;\n        }\n      }\n      m += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < n - l - 1; j++) {\n        for (k = 1; k < n - l - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    cout << m << \"\\n\";\n  }\n  return 0;\n}\n\nint min(int a[100][100], int s, int l, int n) {\n  int t;\n  if (s == 0) {\n    t = a[l][0];\n    for (int i = 0; i < n; i++) {\n      if (t > a[l][i])\n        t = a[l][i];\n    }\n  } else {\n    t = a[0][l];\n    for (int j = 0; j < n; j++) {\n      if (t > a[j][l])\n        t = a[j][l];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "33205", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    int sum = 0;\n    for (int size = n; size >= 2; size--) {\n      for (int i = 0; i < size; i++) {\n        int min = 1000000;\n        for (int j = 0; j < size; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 0; j < size; j++)\n          a[i][j] -= min;\n      }\n      for (int j = 0; j < size; j++) {\n        int min = 1000000;\n        for (int i = 0; i < size; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int i = 0; i < size; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (int i = 1; i < size - 1; i++) {\n        for (int j = 0; j < size; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int j = 1; j < size - 1; j++) {\n        for (int i = 0; i < size - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33206", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fa(int a[][101], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min, t;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 2; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 1; i <= n; i++) {\n    {\n      min = a[1][i];\n      for (j = 2; j <= n; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (j = 1; j <= n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n  }\n  t = a[2][2];\n  for (i = 2; i < n; i++) {\n    a[1][i] = a[1][i + 1];\n    a[i][1] = a[i + 1][1];\n    for (j = 2; j < n; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return t + fa(a, n - 1);\n}\nint main() {\n  int n, k, i, j, a[101][101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    printf(\"%d \", fa(a, n));\n  }\n}\n"}
{"label": "18", "index": "33207", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, sum = 0, s2;\n  cin >> n;\n  s2 = n;\n  for (i = 1; i <= s2; i++) {\n    n = s2;\n    sum = 0;\n    int a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    while (n > 1) {\n      int s[100];\n      for (j = 0; j < n; j++)\n        s[j] = a[j][0];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[j][k] < s[j])\n            s[j] = a[j][k];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j][k] -= s[j];\n\n      int t[100];\n      for (j = 0; j < n; j++)\n        t[j] = a[0][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[k][j] < t[j])\n            t[j] = a[k][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[k][j] -= t[j];\n\n      sum += a[1][1];\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33208", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l, min, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n      for (k = 0; k < j; k++) {\n        min = a[k][0];\n        for (l = 0; l < j; l++) {\n          if (min > a[k][l]) {\n            min = a[k][l];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[k][l] = a[k][l] - min;\n        }\n      }\n      for (k = 0; k < j; k++) {\n        min = a[0][k];\n        for (l = 0; l < j; l++) {\n          if (min > a[l][k]) {\n            min = a[l][k];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[l][k] = a[l][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < j - 1; k++) {\n        a[k][0] = a[k + 1][0];\n        a[0][k] = a[0][k + 1];\n      }\n      for (k = 1; k < j - 1; k++) {\n        for (l = 1; l < j - 1; l++) {\n          a[k][l] = a[k + 1][l + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33209", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid rowset(int a[][105], int n) {\n  int i, j;\n  int min;\n  for (i = 0; i <= n - 1; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j <= n - 1; j++)\n      a[i][j] = a[i][j] - min;\n  }\n}\n\nvoid lineset(int a[][105], int n) {\n  int i, j;\n  int min;\n  for (i = 0; i <= n - 1; i++) {\n    min = a[0][i];\n    for (j = 0; j <= n - 1; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j <= n - 1; j++)\n      a[j][i] = a[j][i] - min;\n  }\n}\n\nvoid form(int a[][105], int n) {\n  int i, j, k;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 2; j <= n - 1; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j <= n - 2; j++) {\n    for (i = 2; i <= n - 1; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\n\nint main(int argc, char *argv[]) {\n  int n, i, j, k, flag;\n  scanf(\"%d\", &n);\n  int a[n][105];\n  int sum;\n  flag = n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        scanf(\"%d\", a[j] + k);\n    flag = n;\n    while (flag >= 2) {\n      rowset(a, flag);\n      lineset(a, flag);\n      sum += a[1][1];\n      form(a, flag);\n      flag--;\n    }\n    printf(\"%d\", sum);\n    (i <= n - 2) ? printf(\"\\n\") : printf(\"\");\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33210", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint str[101][101];\nvoid input(int n) {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      cin >> str[i][j];\n}\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int max = str[i][0];\n    for (int j = 0; j < n; j++)\n      if (max > str[i][j])\n        max = str[i][j];\n    for (int j = 0; j < n; j++)\n      str[i][j] -= max;\n  }\n  for (int i = 0; i < n; i++) {\n    int max = str[0][i];\n    for (int j = 0; j < n; j++)\n      if (max > str[j][i])\n        max = str[j][i];\n    for (int j = 0; j < n; j++)\n      str[j][i] -= max;\n  }\n}\nvoid del(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\nvoid cal(int n, int sum) {\n  if (n == 2) {\n    zero(2);\n    sum += str[1][1];\n    printf(\"%d\\n\", sum);\n    return;\n  }\n\n  zero(n);\n  sum += str[1][1];\n  del(n);\n  cal(n - 1, sum);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    input(n);\n    cal(n, 0);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int m = n;\n    int sum = 0;\n    while (1) {\n      int min;\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      m--;\n      if (m == 1) {\n        printf(\"%d\\n\", sum);\n        break;\n      }\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33212", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint Matrix(int a[][100], int sum, int n);\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    Matrix(a, sum, n);\n  }\n  return 0;\n}\n\nint Matrix(int a[][100], int sum, int n) {\n  int i, j, min;\n  if (n == 1) {\n    cout << sum << endl;\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      a[j - 1][i] = a[j][i];\n  Matrix(a, sum, n - 1);\n  return 0;\n}\n"}
{"label": "18", "index": "33213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, y, m1, m2, p;\n  int a[103][103], s = 0;\n  cin >> n;\n  for (y = 1; y <= n; y++) {\n    p = n;\n    s = 0;\n    m1 = 999999;\n    m2 = 999999;\n    for (i = 1; i <= p; i++)\n      for (j = 1; j <= p; j++)\n        cin >> a[i][j];\n    while (p > 1) {\n\n      for (i = 1; i <= p; i++) {\n        m1 = a[i][1];\n        for (j = 1; j <= p; j++)\n          if (m1 > a[i][j])\n            m1 = a[i][j];\n        for (j = 1; j <= p; j++)\n          a[i][j] -= m1;\n      }\n\n      for (i = 1; i <= p; i++) {\n        m2 = a[1][i];\n        for (j = 1; j <= p; j++)\n          if (m2 > a[j][i])\n            m2 = a[j][i];\n        for (j = 1; j <= p; j++)\n          a[j][i] -= m2;\n      }\n\n      s += a[2][2];\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (i = 2; i <= p - 1; i++)\n        for (j = 1; j <= p - 1; j++)\n          a[j][i] = a[j][i + 1];\n\n      p--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, minrow, mincol, sum;\n  int p[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    t = n;\n    for (i = 0; i < t; i++) {\n      for (j = 0; j < t; j++)\n        cin >> *(*(p + i) + j);\n    }\n    while (t != 1) {\n      for (i = 0; i < t; i++) {\n        minrow = 100000;\n        for (j = 0; j < t; j++) {\n          if (*(*(p + i) + j) < minrow) {\n            minrow = *(*(p + i) + j);\n          }\n        }\n        for (j = 0; j < t; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - minrow;\n      }\n      for (j = 0; j < t; j++) {\n        mincol = 100000;\n        for (i = 0; i < t; i++) {\n          if (*(*(p + i) + j) < mincol) {\n            mincol = *(*(p + i) + j);\n          }\n        }\n        for (i = 0; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - mincol;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 0; i < t; i++) {\n        for (j = 1; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (j = 0; j < t; j++) {\n        for (i = 1; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      t--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint minrow(int a[100][100], int i, int m) {\n  int b = a[i][0], j;\n  for (j = 0; j < m; j++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nint mincolumn(int a[100][100], int j, int m) {\n  int b = a[0][j], i;\n  for (i = 0; i < m; i++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nvoid row(int a[100][100], int m) {\n  int i, j, b;\n  for (i = 0; i < m; i++) {\n    b = minrow(a, i, m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid column(int a[100][100], int m) {\n  int i, j, b;\n  for (j = 0; j < m; j++) {\n    b = mincolumn(a, j, m);\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid del(int a[100][100], int m) {\n  int i, j;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nvoid print(int a[100][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      printf(\"%d \", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {0}, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int b = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    m = n;\n    for (j = 0; j < n - 1; j++) {\n      row(a, m);\n      column(a, m);\n      b = b + a[1][1];\n      del(a, m);\n      m--;\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint gl(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < k; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return (a[1][1]);\n}\nvoid xj(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[j - 1][i] = a[j][i];\n    }\n  }\n}\nint main() {\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int j, l, sum = 0, a[102][102];\n    for (j = 0; j < k; j++) {\n      for (l = 0; l < k; l++)\n        scanf(\"%d\", &a[j][l]);\n    }\n    for (j = 0; j < k - 1; j++) {\n      int temp;\n      temp = gl(a, k - j);\n      \n      sum = sum + temp;\n      xj(a, k - j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0};\nint n = 0;\nvoid find() {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n\n  int l = 0;\n  int m = 10000;\n\n  for (l = n; l > 1; l--) {\n    for (i = 0; i < l; i++) {\n      m = 10000;\n      for (j = 0; j < l; j++)\n        m = min(m, *(*(a + i) + j));\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    for (j = 0; j < l; j++) {\n      m = 10000;\n      for (i = 0; i < l; i++)\n        m = min(m, *(*(a + i) + j));\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    sum = sum + *(*(a + 1) + 1);\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i + 1) + j);\n    for (j = 1; j < l; j++)\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  printf(\"%d\\n\", sum);\n}\n\nint main() {\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++)\n    find();\n\n  return 0;\n}\n"}
{"label": "18", "index": "33218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[110][110], n, sum;\nvoid calculate(int t) {\n  int i, j, minimum;\n  for (i = 1; i <= n; i++) {\n    minimum = a[i][1];\n    for (j = t; j <= n; j++) \n      if (minimum > a[i][j])\n        minimum = a[i][j];\n    a[i][1] -= minimum; \n    for (j = t; j <= n; j++)\n      a[i][j] -= minimum;\n  }\n  for (i = 1; i <= n; i++) { \n    minimum = a[1][i];\n    for (j = t; j <= n; j++)\n      if (minimum > a[j][i])\n        minimum = a[j][i];\n\n    a[1][i] -= minimum;\n    for (j = t; j <= n; j++) \n      a[j][i] -= minimum;\n  }\n  sum += a[t][t];\n  if (t < n)\n    calculate(t + 1); \n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0; \n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    calculate(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33219", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, sum, min, m;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 2; j < m; j++)\n          a[i][j - 1] = a[i][j];\n      for (j = 0; j < m; j++)\n        for (i = 2; i < m; i++)\n          a[i - 1][j] = a[i][j];\n      m--;\n    }\n    cout << endl << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, s, m, a[10000];\n  int *p, *p1, *p2, *p3;\n  cin >> n;\n  p = a;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n; i++) {\n      p1 = p + 100 * i;\n      for (j = 0; j < n; j++) {\n        p2 = p1 + j;\n        scanf(\"%d\", p2);\n      }\n    }\n    s = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n; i++) {\n        p1 = p + i * 100;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          *p2 = *p2 - m;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        p1 = p + i;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          *p2 = *p2 - m;\n        }\n      }\n      s = s + *(p + 101 * (k + 1));\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], min, sum = 0, t = 0, c = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n      cout << endl;\n    }\n    for (int l = 0; l < n - 1; l++) {\n      for (int j = 0; j < n - l; j++) {\n        t = 0;\n        for (int q = 0; q < n - l; q++)\n          if (a[j][q] == 0)\n            t = t + 1;\n        if (t > 0)\n          continue;\n        else {\n          min = a[j][0];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[j][y])\n              min = a[j][y];\n          for (int r = 0; r < n - l; r++)\n            a[j][r] = a[j][r] - min;\n        }\n      }\n      for (int k = 0; k < n - l; k++) {\n        c = 0;\n        for (int p = 0; p < n - l; p++)\n          if (a[p][k] == 0)\n            c = c + 1;\n        if (c > 0)\n          continue;\n        else {\n          min = a[0][k];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[y][k])\n              min = a[y][k];\n          for (int r = 0; r < n - l; r++)\n            a[r][k] = a[r][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      a[0][0] = a[0][0];\n      for (int e = 1; e < n - l; e++)\n        a[0][e] = a[0][e + 1];\n      for (int g = 1; g < n - l; g++)\n        a[g][0] = a[g + 1][0];\n      for (int f = 1; f < n - l; f++) {\n        for (int s = 1; s < n - l; s++)\n          a[f][s] = a[f + 1][s + 1];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint Sum(int n);\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << Sum(n) << \"\\n\";\n  }\n  return 0;\n}\n\nint Sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n"}
{"label": "18", "index": "33223", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum, a[101][101];\nvoid g0(int n) {\n  if (n == 1)\n    return;\n  else {\n    int min;\n    for (int i = 1; i <= n; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[i][j] ? min : a[i][j];\n      for (int j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (int i = 1; i <= n; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[j][i] ? min : a[j][i];\n      for (int j = 1; j <= n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[2][2];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[i][j] = a[i + 1][j];\n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n  g0(n - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    g0(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33224", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, min;\n\nvoid XJ(int a[][100], int n) {\n  int b[100][100] = {0};\n  b[0][0] = a[0][0];\n  for (i = 1; i < n - 1; i++) {\n    b[0][i] = a[0][i + 1];\n    b[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\n\nint MIN(int a[][100], int n, int sum) {\n  if (n == 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    XJ(a, n);\n    return MIN(a, n - 1, sum);\n  }\n}\n\nint main() {\n  int a[100][100] = {0}, k;\n  cin >> n;\n  int ii;\n  int jj;\n  for (ii = 0; ii < n; ii++) {\n\n    for (jj = 0; jj < n; jj++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[jj][k];\n      }\n    }\n    printf(\"%d\\n\", MIN(a, n, 0));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], b[100], c[100], i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = n, l = 0;\n    while (sum > 1) {\n      for (i = 0; i < sum; i++) {\n        b[i] = a[i][0];\n        for (j = 0; j < sum; j++) {\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n        }\n        for (j = 0; j < sum; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (j = 0; j < sum; j++) {\n        c[j] = a[0][j];\n        for (i = 0; i < sum; i++) {\n          if (a[i][j] < c[j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < sum; i++)\n          a[i][j] = a[i][j] - c[j];\n      }\n      l = l + a[1][1];\n      for (i = 0; i < sum; i++) {\n        for (j = 1; j < sum - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (j = 0; j < sum; j++) {\n        for (i = 1; i < sum - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      sum--;\n    }\n    cout << l << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s[100][100], n, j, k, p, min, count1 = 0, l = 0;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    count1 = 0;\n    l = 0;\n    for (j = 0; j < n; j++)\n      for (p = 0; p < n; p++)\n        cin >> *(*(s + j) + p);\n    for (k = 1; k < n; k++) {\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s + j) + 0);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + j) + p) < min)\n            min = *(*(s + j) + p);\n        }\n        for (p = 0; p < n - l; p++) {\n          *(*(s + j) + p) = *(*(s + j) + p) - min;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s) + j);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + p) + j) < min)\n            min = *(*(s + p) + j);\n        }\n\n        for (p = 0; p < n - l; p++) {\n          *(*(s + p) + j) = *(*(s + p) + j) - min;\n        }\n      }\n      count1 += (*(*(s + 1) + 1));\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + j) + p) = *(*(s + j) + p + 1);\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + p) + j) = *(*(s + p + 1) + j);\n      l++;\n    }\n    cout << count1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, j, k, l, len = 0, sum = 0;\nint array_1[100][100];\nvoid guilinhang(int a) {\n  int min = array_1[a][0];\n  for (l = 0; l < len; l++) {\n    if (array_1[a][l] < min)\n      min = array_1[a][l];\n  }\n  for (l = 0; l < len; l++)\n    array_1[a][l] = array_1[a][l] - min;\n}\nvoid guilinlie(int a) {\n  int min = array_1[0][a];\n  for (l = 0; l < len; l++) {\n    if (array_1[l][a] < min)\n      min = array_1[l][a];\n  }\n  for (l = 0; l < len; l++)\n    array_1[l][a] = array_1[l][a] - min;\n}\nvoid xiaojian(int a) {\n  if (a == 2)\n    return;\n  else if (a > 2) {\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[j][i] = array_1[j][i + 1];\n    }\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[i][j] = array_1[i + 1][j];\n    }\n  }\n}\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    len = n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> array_1[i][j];\n      }\n    }\n    while (len >= 2) {\n      for (i = 0; i < len; i++) {\n        guilinhang(i);\n      }\n      for (i = 0; i < len; i++) {\n        guilinlie(i);\n      }\n      sum = sum + array_1[1][1];\n      xiaojian(len);\n      len--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, min, sum = 0, num = 0;\n  int a[101][101];\n  int minr[101];\n  int minc[101];\n  cin >> n;\n\n  for (k = 1, num = 0, sum = 0; k <= n; k++) {\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    num = 0;\n    sum = 0;\n    while (num < n - 1) {\n      memset(minr, 0, 101 * 4);\n      memset(minc, 0, 101 * 4);\n      for (i = 1; i <= n - num; i++) {\n        min = a[i][1];\n        for (j = 1; j <= n - num; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minr[i] = min;\n      }\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 1; j <= n - num; j++) {\n          a[i][j] = a[i][j] - minr[i];\n        }\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        min = a[1][j];\n        for (i = 1; i <= n - num; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minc[j] = min;\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        for (i = 1; i <= n - num; i++) {\n          a[i][j] = a[i][j] - minc[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 2; j <= n - num - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n\n      for (j = 1; j <= n - num - 1; j++) {\n        for (i = 2; i <= n - num - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n\n      num++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33229", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint find_min(int x, int side);\nint find_miny(int y, int side);\nint a[120][120], sum;\nvoid caozuo(int side);\nint main() {\n  int i, j, n, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    caozuo(n);\n  }\n\n  return 0;\n}\nint find_min(int x, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[x][i])\n      temp = a[x][i];\n  }\n  return temp;\n}\nint find_miny(int y, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[i][y])\n      temp = a[i][y];\n  }\n  return temp;\n}\nvoid caozuo(int side) {\n  int i, j, t;\n  if (side == 1) {\n    printf(\"%d\\n\", sum);\n  } else {\n    for (i = 0; i <= side - 1; i++) {\n      t = find_min(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[i][j] -= t;\n      }\n    }\n    for (i = 0; i <= side - 1; i++) {\n      t = find_miny(i, side);\n      for (j = 0; j <= side - 1; j++)\n        a[j][i] -= t;\n    }\n\n    sum = sum + a[1][1];\n    if (side > 2) {\n      for (i = 2; i <= side - 1; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i <= side - 1; i++) {\n        for (j = 2; j <= side - 1; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    caozuo(side - 1);\n  }\n}\n"}
{"label": "18", "index": "33230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n][n], b[n], min1[n], min2[n], c[n][n - 1], sum[n];\n  int i, j, k, l, p;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[k][i][j]);\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1[i] = a[k][i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[k][i][j] <= min1[i]) {\n            min1[i] = a[k][i][j];\n          }\n        }\n        for (j = 0; j < n - l; j++)\n          a[k][i][j] = a[k][i][j] - min1[i];\n      }\n      for (j = 0; j < n - l; j++) {\n        min2[j] = a[k][0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[k][i][j] <= min2[j]) {\n            min2[j] = a[k][i][j];\n          }\n        }\n        for (i = 0; i < n - l; i++)\n          a[k][i][j] = a[k][i][j] - min2[j];\n      }\n      c[k][l] = a[k][1][1];\n      sum[k] = sum[k] + c[k][l];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1 - l; i++) {\n          a[k][i][j] = a[k][i + 1][j];\n        }\n      for (i = 0; i < n - 1 - l; i++)\n        for (j = 1; j < n - 1 - l; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33231", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, i, j, k, m, t, a[100][100], x;\n  scanf(\"%d\", &n);\n  x = n;\n  for (i = 0; i < x; i++) {\n    s = 0;\n    n = x;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (t = 1; t < x; t++) {\n      for (j = 0; j < n; j++) {\n        m = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < m)\n            m = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (a[k][j] < m)\n            m = a[k][j];\n        }\n        for (k = 0; k < n; k++) {\n          a[k][j] = a[k][j] - m;\n        }\n      }\n      s = s + a[1][1];\n      for (j = 1; j < n - 1; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - 1; j++)\n        for (k = 1; k < n - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33232", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint hang(int a[], int n, int h) {\n  int m = a[0];\n  for (int i = h; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return (m);\n}\nint lie(int a[][110], int n, int j, int h) {\n  int m = a[0][j];\n  for (int i = h; i < n; i++)\n    if (a[i][j] < m)\n      m = a[i][j];\n  return (m);\n}\nint main() {\n  int n, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int i, j, h, s = 0, hm, lm, a[110][110] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (h = 1; h < n; h++) {\n      hm = hang(a[0], n, h);\n      a[0][0] -= hm;\n      for (j = h; j < n; j++)\n        a[0][j] -= hm;\n      for (i = h; i < n; i++) {\n        hm = hang(a[i], n, h);\n        a[i][0] -= hm;\n        for (j = h; j < n; j++)\n          a[i][j] -= hm;\n      }\n      lm = lie(a, n, 0, h);\n      a[0][0] -= lm;\n      for (i = h; i < n; i++)\n        a[i][0] -= lm;\n      for (j = h; j < n; j++) {\n        lm = lie(a, n, j, h);\n        a[0][j] -= lm;\n        for (i = h; i < n; i++)\n          a[i][j] -= lm;\n      }\n      s += a[h][h];\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33233", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint str[101][101];\nvoid input(int n) {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      cin >> str[i][j];\n}\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int max = str[i][0];\n    for (int j = 0; j < n; j++)\n      if (max > str[i][j])\n        max = str[i][j];\n    for (int j = 0; j < n; j++)\n      str[i][j] -= max;\n  }\n  for (int i = 0; i < n; i++) {\n    int max = str[0][i];\n    for (int j = 0; j < n; j++)\n      if (max > str[j][i])\n        max = str[j][i];\n    for (int j = 0; j < n; j++)\n      str[j][i] -= max;\n  }\n}\nvoid del(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\nvoid cal(int n, int sum) {\n  if (n == 2) {\n    zero(2);\n    sum += str[1][1];\n    cout << sum << endl;\n    return;\n  }\n\n  zero(n);\n  sum += str[1][1];\n  del(n);\n  cal(n - 1, sum);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    input(n);\n    cal(n, 0);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33234", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int a[100][100] = {0}, rmin[100] = {0}, cmin[100] = {0}, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n      cmin[i] = a[0][i];\n      rmin[i] = a[i][0];\n    }\n    for (int k = 0; k < n - 1; k++) {\n      for (int i = 0; i < n - k; i++) {\n        cmin[i] = a[0][i];\n        rmin[i] = a[i][0];\n      }\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (rmin[i] > a[i][j]) {\n            rmin[i] = a[i][j];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[i][j] -= rmin[i];\n        }\n      }\n\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (cmin[i] > a[j][i]) {\n            cmin[i] = a[j][i];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[j][i] -= cmin[i];\n        }\n      }\n      sum += a[1][1];\n      for (int i = 2; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (int j = 2; j < n - k; j++) {\n        for (int i = 0; i < n - k; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33235", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  int n = num, numcas = num;\n\n  int a[301][301];\n  while (num--) {\n    int s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < numcas; i++)\n      for (int j = 0; j < numcas; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n\n    n = numcas;\n    while (1) {\n\n      if (n == 0) {\n        cout << s << endl;\n        break;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int i = 0; i < n; i++)\n          a[j][i] -= min;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n\n      s += a[1][1];\n\n      for (int j = 0; j < n; j++)\n        for (int i = 1; i < n; i++) {\n          a[j][i] = a[j][i + 1];\n        }\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      n--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint fa(int a[][101], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min, t;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 2; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 1; i <= n; i++) {\n    {\n      min = a[1][i];\n      for (j = 2; j <= n; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (j = 1; j <= n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n  }\n  t = a[2][2];\n  for (i = 2; i < n; i++) {\n    a[1][i] = a[1][i + 1];\n    a[i][1] = a[i + 1][1];\n    for (j = 2; j < n; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return t + fa(a, n - 1);\n}\nint main() {\n  int n, k, i, j, a[101][101];\n  scanf(\"%d\", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    cout << fa(a, n) << \" \";\n  }\n}\n"}
{"label": "18", "index": "33237", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint i, j, n, sum = 0;\nvoid xiaojian(int times) {\n  for (i = 0; i < times; i++)\n    for (j = 1; j < times - 1; j++)\n      a[i][j] = a[i][j + 1];\n\n  for (j = 0; j < times; j++)\n    for (i = 1; i < times - 1; i++)\n      a[i][j] = a[i + 1][j];\n  return;\n}\nint F(int times) {\n  if (times == 1)\n    return sum;\n  else {\n    int J[times];\n    for (i = 0; i < times; i++) {\n      J[i] = a[i][0];\n      for (j = 0; j < times - 1; j++) {\n        if (J[i] > a[i][j + 1])\n          J[i] = a[i][j + 1];\n      }\n      if (J[i] > 0)\n        for (int t = 0; t < times; t++)\n          a[i][t] -= J[i];\n    }\n    int I[times];\n    for (j = 0; j < times; j++) {\n      I[j] = a[0][j];\n      for (i = 0; i < times - 1; i++) {\n        if (I[j] > a[i + 1][j])\n          I[j] = a[i + 1][j];\n      }\n      if (I[j] > 0)\n        for (int t = 0; t < times; t++)\n          a[t][j] -= I[j];\n    }\n    sum += a[1][1];\n    xiaojian(times);\n    return F(times - 1);\n  }\n}\nint main() {\n  scanf(\"%d \", &n);\n  int t = 0;\n  while (t < n) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << F(n) << endl;\n    sum = 0;\n    t++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33238", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint min(int x[]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    if (x[i] < 0)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (x[i] > x[j] && x[j] >= 0)\n        break;\n    }\n    if (j == n)\n      return x[i];\n  }\n  return 0;\n}\nvoid cut(int a[50][50], int k) {\n  int i, j, m;\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n}\nvoid xiaojian(int a[50][50], int k) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[k][i] = -1;\n    a[i][k] = -1;\n  }\n}\nint main() {\n  int a[50][50][50], j, i, k, l, sum;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n\n    for (j = 0; j < n; j++) {\n      for (i = 0; i < n; i++) {\n        scanf(\"%d\", &a[k][j][i]);\n      }\n    }\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      cut(a[k], j);\n      sum = sum + a[k][j][j];\n      xiaojian(a[k], j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33239", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, sum = 0;\n  cin >> n;\n  for (int p = 1; p <= n; p++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int q = 1; q < n; q++) {\n      for (i = q; i <= n; i++) {\n        m = a[i][q];\n        for (j = q + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (j = q; j <= n; j++)\n          a[i][j] -= m;\n      }\n      for (j = q; j <= n; j++) {\n        m = a[q][j];\n        for (i = q + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (i = q; i <= n; i++)\n          a[i][j] -= m;\n      }\n      sum += a[q][q];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "33240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint N, A[213][213], Sum;\nvoid Work() {\n  memset(A, 0, sizeof(A));\n  Sum = 0;\n  for (int I = 1; I <= N; I++)\n    for (int J = 1; J <= N; J++)\n      cin >> A[I][J];\n  for (int K = 1; K <= N - 1; K++) {\n    int Min = A[1][1];\n    for (int J = K + 1; J <= N; J++)\n      if (A[1][J] < Min)\n        Min = A[1][J];\n    A[1][1] -= Min;\n    for (int J = K + 1; J <= N; J++)\n      A[1][J] -= Min;\n    for (int I = K + 1; I <= N; I++) {\n      int Min = A[I][1];\n      for (int J = K + 1; J <= N; J++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int J = 1; J <= N; J++)\n        A[I][J] -= Min;\n    }\n    Min = A[1][1];\n    for (int I = K + 1; I <= N; I++)\n      if (A[I][1] < Min)\n        Min = A[I][1];\n    A[1][1] -= Min;\n    for (int I = K + 1; I <= N; I++)\n      A[I][1] -= Min;\n    for (int J = K + 1; J <= N; J++) {\n      int Min = A[1][J];\n      for (int I = K + 1; I <= N; I++)\n        if (A[I][J] < Min)\n          Min = A[I][J];\n      for (int I = 1; I <= N; I++)\n        A[I][J] -= Min;\n    }\n    Sum += A[K + 1][K + 1];\n  }\n  cout << Sum << endl;\n}\nint main() {\n  cin >> N;\n  for (int I = 1; I <= N; I++)\n    Work();\n  return 0;\n}\n"}
{"label": "18", "index": "33241", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100][100];\nint matrix(int a[][100], int n) {\n  int temp1[100], temp2[100];\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    temp1[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (temp1[i] > a[i][j])\n        temp1[i] = a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - temp1[i];\n  for (i = 0; i < n; i++) {\n    temp2[i] = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (temp2[i] > a[j][i])\n        temp2[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - temp2[i];\n\n  int sum;\n  sum = a[1][1];\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  if (n > 2) {\n    sum = sum + matrix(a, n - 1);\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (i = 0; i < n; i++)\n    cout << matrix(a[i], n) << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33242", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint guiling(int n);\nvoid xiaojian(int n);\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << guiling(n) << \"\\n\";\n  }\n\n  return 0;\n}\nint guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int k = a[1][1];\n  if (n == 2)\n    return k;\n  else {\n    xiaojian(n);\n    return k + guiling(n - 1);\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33243", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum(int);\nint a[100][100];\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33244", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, n, j, k, min, sum;\n  cin >> p;\n  int a[100][100];\n  n = p;\n  for (int i = 0; i < p; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    do {\n\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] -= min;\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n; k++)\n          a[j][k] = a[j][k + 1];\n\n      for (j = 1; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j + 1][k];\n\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33245", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, p, ans;\n  int a[101][101], g;\n  cin >> n;\n  k = n;\n\n  while (k--) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    p = n;\n    while (p-- > 1) {\n      for (i = 0; i <= p; i++) {\n        g = *(*(a + i));\n        for (j = 0; j <= p; j++) {\n          if (*(*(a + i) + j) < g)\n            g = *(*(a + i) + j);\n        }\n        for (j = 0; j <= p; j++)\n          *(*(a + i) + j) -= g;\n      }\n      for (j = 0; j <= p; j++) {\n        g = *(*(a) + j);\n        for (i = 0; i <= p; i++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (i = 0; i <= p; i++) {\n          *(*(a + i) + j) -= g;\n        }\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 2; i <= p; i++)\n        *(*(a + i - 1)) = *(*(a + i));\n      for (j = 2; j <= p; j++)\n        *(*(a) + j - 1) = *(*(a) + j);\n      for (i = 2; i <= p; i++)\n        for (j = 2; j <= p; j++)\n          *(*(a + i - 1) + j - 1) = *(*(a + i) + j);\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid min(int a[], int b);\nint main() {\n  int n = 0, i = 0, sum = 0;\n  cin >> n;\n  const int p = n;\n  for (i = 0; i < p; i++, sum = 0) {\n    int z[101][101] = {0}, z2[101] = {0};\n    int j = 0, k = 0;\n    n = p;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &z[j][k]);\n    do {\n      for (j = 0; j < n; j++)\n        min(z[j], n);\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          z2[k] = z[k][j];\n        min(z2, n);\n        for (k = 0; k < n; k++)\n          z[k][j] = z2[k];\n      }\n      sum += z[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[j][k] = z[j][k + 1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[k][j] = z[k + 1][j];\n      n--;\n    } while (n > 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid min(int a[], int b) {\n  int w = 0, y = 10000;\n  for (w = 0; w < b; w++) {\n    if (a[w] < y)\n      y = a[w];\n  }\n  for (w = 0; w < b; w++)\n    a[w] = a[w] - y;\n}\n"}
{"label": "18", "index": "33247", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100];\nint i, j, n, sum = 0;\nvoid xiaojian(int times) {\n  for (i = 0; i < times; i++)\n    for (j = 1; j < times - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < times; j++)\n    for (i = 1; i < times - 1; i++)\n      a[i][j] = a[i + 1][j];\n  return;\n}\nint F(int times) {\n  if (times == 1)\n    return sum;\n  else {\n    int J[times];\n    for (i = 0; i < times; i++) {\n      J[i] = a[i][0];\n      for (j = 0; j < times - 1; j++) {\n        if (J[i] > a[i][j + 1])\n          J[i] = a[i][j + 1];\n      }\n      if (J[i] > 0)\n        for (int t = 0; t < times; t++)\n          a[i][t] -= J[i];\n    }\n    int I[times];\n    for (j = 0; j < times; j++) {\n      I[j] = a[0][j];\n      for (i = 0; i < times - 1; i++) {\n        if (I[j] > a[i + 1][j])\n          I[j] = a[i + 1][j];\n      }\n      if (I[j] > 0)\n        for (int t = 0; t < times; t++)\n          a[t][j] -= I[j];\n    }\n    sum += a[1][1];\n    xiaojian(times);\n    return F(times - 1);\n  }\n}\nint main() {\n  cin >> n;\n  int t = 0;\n  while (t < n) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << F(n) << endl;\n    sum = 0;\n    t++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum, min, i, j, p, k, (*q)[100];\n  q = a;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(q + i) + j);\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + i) + j);\n          else {\n            if (*(*(q + i) + j) < min)\n              min = *(*(q + i) + j);\n          }\n        }\n        for (j = 0; j < k; j++)\n          *(*(q + i) + j) = *(*(q + i) + j) - min;\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + j) + i);\n          else {\n            if (*(*(q + j) + i) < min)\n              min = *(*(q + j) + i);\n          }\n        }\n        for (j = 0; j < k; j++) {\n          *(*(q + j) + i) = *(*(q + j) + i) - min;\n        }\n      }\n      sum += *(*(q + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + 0) + i) = *(*(q + 0) + i + 1);\n      }\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + i) + 0) = *(*(q + i + 1) + 0);\n      }\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++) {\n          *(*(q + i) + j) = *(*(q + i + 1) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33249", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nvoid min(int a[], int b);\nint main() {\n  int n = 0, i = 0, sum = 0; \n  cin >> n;\n  const int p = n; \n  for (i = 0; i < p; i++, sum = 0) {\n    int z[101][101] = {0}, z2[101] = {0};\n    int j = 0, k = 0;\n    n = p;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> z[j][k];\n    do {\n      for (j = 0; j < n; j++)\n        min(z[j], n); \n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          z2[k] = z[k][j]; \n        min(z2, n);        \n        for (k = 0; k < n; k++)\n          z[k][j] = z2[k]; \n      }\n      sum += z[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[j][k] = z[j][k + 1]; \n      for (j = 0; j < n; j++)\n        for (k = 1; k < n - 1; k++)\n          z[k][j] = z[k + 1][j];\n      n--;\n    } while (n > 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid min(int a[], int b) \n{\n  int w = 0, y = 10000;\n  for (w = 0; w < b; w++) {\n    if (a[w] < y)\n      y = a[w]; \n  }\n  for (w = 0; w < b; w++)\n    a[w] = a[w] - y;\n}\n"}
{"label": "18", "index": "33250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum(int);\nint a[100][100];\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << sum(n) << \"\\n\";\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i;\n  for (i = 0; i < n; i++) {\n    int j, k, l, x, a[100][100], c[100][100], temp;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    int sum = 0;\n    for (l = n - 1; l >= 1; l--) {\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (j = 0; j <= l; j++)\n        for (x = 0; x <= l - 1; x++)\n          for (k = 0; k <= l - 1 - x; k++) {\n            if (c[j][k] > c[j][k + 1]) {\n              temp = c[j][k];\n              c[j][k] = c[j][k + 1];\n              c[j][k + 1] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[j][0];\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (k = 0; k <= l; k++)\n        for (x = 0; x <= l - 1; x++)\n          for (j = 0; j <= l - 1 - x; j++) {\n            if (c[j][k] > c[j + 1][k]) {\n              temp = c[j][k];\n              c[j][k] = c[j + 1][k];\n              c[j + 1][k] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[0][k];\n      sum += a[1][1];\n      for (j = 2; j <= l; j++)\n        for (k = 2; k <= l; k++)\n          a[j - 1][k - 1] = a[j][k];\n      for (k = 2; k <= l; k++)\n        a[0][k - 1] = a[0][k];\n      for (j = 2; j <= l; j++)\n        a[j - 1][0] = a[j][0];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint an[1000][1000];\n\nint hang[1000], lie[1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, l, p, q;\n\n  for (l = 0; l < n; l++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> an[i][j];\n    }\n\n    int sum = 0;\n\n    for (k = n; k > 0; k--) {\n\n      for (p = 0; p < k; p++) {\n        hang[p] = an[p][0];\n        for (q = 0; q < k; q++) {\n          if (hang[p] > an[p][q])\n            hang[p] = an[p][q];\n        }\n        for (q = 0; q < k; q++)\n          an[p][q] = an[p][q] - hang[p];\n      }\n\n      for (q = 0; q < k; q++) {\n        lie[q] = an[0][q];\n        for (p = 0; p < k; p++) {\n          if (lie[q] > an[p][q])\n            lie[q] = an[p][q];\n        }\n        for (p = 0; p < k; p++)\n          an[p][q] = an[p][q] - lie[q];\n      }\n\n      sum = sum + an[1][1];\n\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k; j++)\n          an[i][j] = an[i][j + 1];\n      }\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < k; j++)\n          an[i][j] = an[i + 1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33253", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100][2];\n  for (int p = 1; p <= n; p++) {\n    int sum = 0;\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j][1];\n        a[i][j][0] = 1;\n      }\n    }\n    for (int q = 1; q <= n - 1; q++) {\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[i][0][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          if (a[i][j][1] < min)\n            min = a[i][j][1];\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          a[i][j][1] -= min;\n        }\n      }\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[0][i][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          if (a[j][i][1] < min) {\n            min = a[j][i][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          a[j][i][1] -= min;\n        }\n      }\n      sum += a[q][q][1];\n      for (int i = 0; i <= n - 1; i++) {\n        a[q][i][0] = 0;\n        a[i][q][0] = 0;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33254", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int num = 0;\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - num; i++) {\n        int rowm = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (a[i][j] < rowm)\n            rowm = a[i][j];\n        }\n        for (j = 0; j < n - num; j++) {\n          a[i][j] = a[i][j] - rowm;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        int colm = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (a[i][j] < colm)\n            colm = a[i][j];\n        }\n        for (i = 0; i < n - num; i++) {\n          a[i][j] = a[i][j] - colm;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i - 1][j] = a[i][j];\n      }\n\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      num++;\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200] = {{0}, {0}}, i, j = 0, sum, q = 0, k, n, m, s;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    for (s = 0; s < n; s++) {\n\n      for (i = 1; i <= n - s; i++) {\n        m = a[i][1];\n        for (j = 1; j <= n - s; j++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (j = 1; j <= n - s; j++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      for (j = 1; j <= n - s; j++) {\n        m = a[1][j];\n        for (i = 1; i <= n - s; i++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (i = 1; i <= n - s; i++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - s; i++) {\n        for (j = 2; j <= n; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (j = 1; j <= n - s; j++) {\n        for (i = 2; i <= n; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, n1, num[101][101], i, j, k, min = 99999, sum = 0;\n  int(*p)[101];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    p = num;\n    for (; n1 >= 2; n1--) {\n\n      for (i = 0; i < n1; i++) {\n        for (j = 0; j < n1; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) -= min;\n        min = 99999;\n      }\n      min = 99999;\n      for (j = 0; j < n1; j++) {\n        for (i = 0; i < n1; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n1; i++)\n          num[i][j] -= min;\n        min = 99999;\n      }\n      sum += *(*(p + 1) + 1);\n      min = 99999;\n      for (i = 1; i < n1 - 1; i++)\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < n1 - 1; j++)\n        for (i = 0; i < n1; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid jian(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  if (n > 2) {\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < (n - 1); j++)\n        a[j][i] = a[j][i + 1];\n    for (i = 0; i < n; i++) {\n      a[n - 1][i] = '\\0';\n      a[i][n - 1] = '\\0';\n    }\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {'\\0'}, sum, n1;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n1 > 1) {\n      jian(a, n1);\n      sum += a[1][1];\n      move(a, n1);\n      n1--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint p[10000][10000];\nint f(int x) {\n  int min;\n  int k;\n  if (x == 2) {\n    for (int i = 0; i <= 1; i++)\n      if (p[i][0] > p[i][1]) {\n        p[i][0] = p[i][0] - p[i][1];\n        p[i][1] = 0;\n      } else {\n        p[i][1] = p[i][1] - p[i][0];\n        p[i][0] = 0;\n      }\n    for (int i = 0; i <= 1; i++)\n      if (p[0][i] > p[1][i]) {\n        p[0][i] = p[0][i] - p[1][i];\n        p[1][i] = 0;\n      } else {\n        p[1][i] = p[1][i] - p[0][i];\n        p[0][i] = 0;\n      }\n    return p[1][1];\n\n  }\n\n  else {\n    for (int i = 0; i < x; i++) {\n\n      min = p[i][0];\n      for (int j = 0; j < x; j++)\n\n        if (p[i][j] < min)\n          min = p[i][j];\n      for (int j = 0; j < x; j++)\n        p[i][j] = p[i][j] - min;\n    }\n    for (int i = 0; i < x; i++) {\n\n      min = p[0][i];\n      for (int j = 0; j < x; j++)\n\n        if (p[j][i] < min)\n          min = p[j][i];\n      for (int j = 0; j < x; j++)\n        p[j][i] = p[j][i] - min;\n    }\n    k = p[1][1];\n    for (int i = 0; i < x; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[i][j] = p[i][j + 1];\n    for (int i = 0; i < x - 1; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[j][i] = p[j + 1][i];\n    return k + f(x - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int s = 1;\n  for (s = 1; s <= n; s++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> p[i][j];\n    printf(\"%d\\n\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33259", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], sum;\nvoid f(int m) {\n  int i, j, min;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      min = a[i][0];\n      for (j = 0; j < m; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n    }\n    for (j = 0; j < m; j++) {\n      min = a[0][j];\n      for (i = 0; i < m; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n    }\n    sum = sum + a[1][1];\n    for (j = 2; j < m; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < m; i++)\n      a[i - 1][0] = a[i][0];\n    for (i = 2; i < m; i++)\n      for (j = 2; j < m; j++)\n        a[i - 1][j - 1] = a[i][j];\n    f(m - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33260", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[111][111];\nint n;\n\nint xiao(int size);\n\nint sum() {\n  int temp = 0;\n  for (int siz = n; siz >= 2; siz--) {\n    temp += xiao(siz);\n  }\n  return temp;\n}\n\nint xiao(int size) {\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[i][j] < tempmin)\n        tempmin = a[i][j];\n    for (int j = 1; j <= size; j++)\n      a[i][j] -= tempmin;\n  }\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[j][i] < tempmin) {\n        tempmin = a[j][i];\n      }\n    for (int j = 1; j <= size; j++)\n      a[j][i] -= tempmin;\n  }\n\n  int daan = a[2][2];\n\n  for (int i = 1; i <= n; i++)\n    for (int j = 2; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 1; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[j][i] = a[j + 1][i];\n  return daan;\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int t = 1; t <= n; t++) {\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    cout << sum() << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\n\nint hanshu(int n);\n\nint main() {\n  int i, j, k, n;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    cout << hanshu(n) << endl;\n  }\n\n  return 0;\n}\n\nint hanshu(int n) {\n  int min, sum = 0, i, j;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 1; i <= n; i++) {\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= n; j++) {\n      min = 10000;\n      for (i = 1; i <= n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (i = 1; i <= n; i++)\n        a[i][j] -= min;\n    }\n    sum = a[2][2];\n    for (i = 1; i <= n; i++)\n      for (j = 2; j < n; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 1; j < n; j++)\n      for (i = 2; i < n; i++)\n        a[i][j] = a[i + 1][j];\n    return sum + hanshu(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, a[100][100], min, sum;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    k = n;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = 100000;\n        for (j = 0; j < k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 100000;\n        for (i = 0; i < k; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        if (min == 0)\n          continue;\n        else\n          for (i = 0; i < k; i++)\n            a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < k - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < k - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      k--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33263", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];  \nint jieguo(int n) \n{\n  int min = 10000;\n  int p = 0, i = 0, j = 0, sum = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) \n    {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    return a[1][1];\n  } else {\n    for (i = 0; i < n; i++) \n    {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) \n    {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum = a[1][1];              \n    for (i = 1; i < n - 1; i++) \n    {\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        a[j][i] = a[j][i + 1];\n      }\n    }\n    return (sum + jieguo(n - 1));\n  }\n}\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = 0;\n    }\n  }\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    cout << jieguo(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, t;\nint n;\nint sum;\nint a[100][100];\nint f(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[ii][0];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ii][ij] < minn) {\n        minn = a[ii][ij];\n      }\n    for (int ij = 0; ij < x; ij++)\n      a[ii][ij] = a[ii][ij] - minn;\n  }\n}\nint g(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[0][ii];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ij][ii] < minn)\n        minn = a[ij][ii];\n    for (int ij = 0; ij < x; ij++)\n      a[ij][ii] = a[ij][ii] - minn;\n  }\n}\nint h(int x) {\n  sum = sum + a[1][1];\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[ii][jj] = a[ii][jj + 1];\n  }\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[jj][ii] = a[jj + 1][ii];\n  }\n}\nint main() {\n  cin >> n;\n  for (int qqq = 0; qqq < n; qqq++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (i = n; i > 1; i--) {\n      f(i);\n      g(i);\n      h(i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33265", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f1(int n, int a[100][100]) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[i][0], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[i][j])\n        x = a[i][j];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[i][j] -= x;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[0][i], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[j][i])\n        x = a[j][i];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[j][i] -= x;\n  }\n}\n\nvoid f2(int n, int a[100][100]) {\n  int i, j;\n  for (i = 1; i <= n - 2; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; i++)\n    for (j = 1; j <= n - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\n\nint loop(int n, int a[100][100]) {\n  f1(n, a);\n  int x = a[1][1];\n\n  if (n == 2)\n    return a[1][1];\n  else {\n    f2(n, a);\n    return x + loop(n - 1, a);\n  }\n}\n\nint main(void) {\n  int t, n;\n  scanf(\"%d\", &n);\n  for (t = 1; t <= n; t++) {\n    int a[100][100], i, j;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    printf(\"%d\\n\", loop(n, a));\n  }\n}\n"}
{"label": "18", "index": "33266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100] = {0}, i = 0, j = 0, min = 1000;\n  int flag = 0, sum = 0, k = 0, l = 0;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n * n; i++)\n      cin >> a[i / n][i % n];\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - flag; i++) {\n        min = 1000;\n        for (j = 0; j < n - flag; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - flag; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - flag; j++) {\n        min = 1000;\n        for (i = 0; i < n - flag; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - flag; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - flag; i++) {\n        for (j = 1; j < n - 1 - flag; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - flag; j++) {\n        for (i = 1; i < n - 1 - flag; i++)\n          a[i][j] = a[i + 1][j];\n      }\n\n      flag++;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33267", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int min(int x[], int y);\n  int i, j, k, n, a[200][200], b[200], sum, t;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[k][j]);\n      }\n    }\n\n    for (t = n; t >= 2; t--) {\n\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++) {\n          b[k] = a[k][j];\n        }\n        for (k = 1; k <= t; k++) {\n          a[k][j] -= min(b, t);\n        }\n      }\n      for (j = 1; j <= t; j++) {\n        for (k = 1; k <= t; k++) {\n          b[k] = a[j][k];\n        }\n        for (k = 1; k <= t; k++) {\n          a[j][k] -= min(b, t);\n        }\n      }\n      sum += a[2][2];\n      for (j = 3; j <= t; j++) {\n        for (k = 3; k <= t; k++) {\n          a[k - 1][j - 1] = a[k][j];\n        }\n      }\n      for (j = 3; j <= t; j++) {\n        a[1][j - 1] = a[1][j];\n      }\n      for (j = 3; j <= t; j++) {\n        a[j - 1][1] = a[j][1];\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint min(int x[], int y) {\n  int i, min = 999999;\n  for (i = 1; i <= y; i++) {\n    if (x[i] < min) {\n      min = x[i];\n    }\n  }\n  return (min);\n}\n"}
{"label": "18", "index": "33268", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint a[100][100];\nint findmin(int c, int low, int n) {\n  int min;\n  if (c == 1) \n  {\n    int i;\n    min = a[low][0];\n    for (i = 0; i < n; i++) {\n      if (a[low][i] < min)\n        min = a[low][i];\n    }\n  }\n  if (c == 0) \n  {\n    int i;\n    min = a[0][low];\n    for (i = 0; i < n; i++) {\n      if (a[i][low] < min)\n        min = a[i][low];\n    }\n  }\n  return min;\n}\nint dec(int n, int sum) {\n  if (n == 1)\n    return sum;\n  int i, j, k, min;\n  for (i = 0; i < n; i++) {\n    min = findmin(1, i, n);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = findmin(0, i, n);\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  } \n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  return dec(n - 1, sum);\n}\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, s, t;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    cout << dec(n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33269", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, s = 0;\n  int b[100], a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (s = n; s > 1; s--) {\n      int min1 = 10000;\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min1) {\n            min1 = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= min1;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[k][j] < min1) {\n            min1 = a[k][j];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[k][j] -= min1;\n        }\n      }\n      b[n - s] = a[1][1];\n      for (j = 2; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[k][j - 1] = a[k][j];\n        }\n      }\n      for (k = 2; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n    }\n    int sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      sum = sum + b[k];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33270", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num[101][101], min, he = 0, l, r, nn;\n  scanf(\"%d \", &n);\n  nn = n;\n  for (nn = n; nn >= 1; nn--) {\n    he = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(num + i) + j);\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      min = 999999;\n      for (l = 1; l <= n - k + 1; l++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + l) + i))\n            min = *(*(num + l) + i);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + l) + i) = *(*(num + l) + i) - min;\n        }\n      }\n      for (r = 1; r <= n - k + 1; r++) {\n        min = 999999;\n        for (i = 1; i <= n - k + 1; i++) {\n          if (min > *(*(num + i) + r))\n            min = *(*(num + i) + r);\n          if (min == 0)\n            break;\n        }\n        for (i = 1; i <= n - k + 1; i++) {\n          *(*(num + i) + r) = *(*(num + i) + r) - min;\n        }\n      }\n      he = he + *(*(num + 2) + 2);\n      for (l = 1; l <= n - k + 1; l++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + l) + i) = *(*(num + l) + (i + 1));\n        }\n      }\n      for (r = 1; r <= n - k; r++) {\n        for (i = 2; i <= n - k; i++) {\n          *(*(num + i) + r) = *(*(num + (i + 1)) + r);\n        }\n      }\n    }\n    cout << he << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ml(int a[101], int m);\n  void guiling(int a[101][101], int m);\n  void xiaojian(int a[101][101], int m);\n  int n;\n  int i, j, k;\n  int sum;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n\n      guiling(a, j);\n      sum = sum + a[1][1];\n      xiaojian(a, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n\nint ml(int a[101], int m) {\n  int i;\n  int n = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] < n)\n      n = a[i];\n  }\n  return n;\n}\n\nvoid guiling(int a[101][101], int m) {\n  int ml(int a[101], int m);\n  int i, j;\n  int minc, minl;\n  for (i = 0; i < m; i++) {\n    minl = ml(a[i], m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - minl;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    minc = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < minc)\n        minc = a[i][j];\n    }\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - minc;\n    }\n  }\n}\n\nvoid xiaojian(int a[101][101], int m) {\n  int i, j;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < m - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (j = 0; j < m - 1; j++) {\n      for (i = 1; i < m - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "33272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100] = {0};\n  int times, m, n, i, j, k;\n  cin >> times;\n  m = times;\n  while (m--) {\n    n = times;\n    int(*p)[100] = array;\n    for (i = 0; i < times; i++)\n      for (j = 0; j < times; j++)\n        cin >> *(*(p + i) + j);\n    int sum = 0;\n    for (k = 1; k <= times - 1; k++) {\n      int min, now;\n      for (i = 0; i < n; i++) {\n        min = *(*(p + i));\n        for (j = 1; j < n; j++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = *(*p + j);\n        for (i = 1; i < n; i++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + (*(*(p + 1) + 1));\n      if (n == 2)\n        break;\n      for (i = 2; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      for (j = 2; j < n; j++)\n        for (i = 0; i < n - 1; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33273", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int nn, n;\n  cin >> nn;\n\n  int a[101][101];\n  for (int k = 0; k < nn; k++) {\n    int ans = 0;\n    for (int i = 0; i < nn; i++)\n      for (int j = 0; j < nn; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (int n = nn; n > 1; n--) {\n      int minh[101], minl[101];\n      for (int i = 0; i < n; i++)\n        minh[i] = 1000000;\n      for (int i = 0; i < n; i++)\n        minl[i] = 1000000;\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[i][j] < minh[i])\n            minh[i] = a[i][j];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[i][j] = a[i][j] - minh[i];\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[j][i] < minl[i])\n            minl[i] = a[j][i];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[j][i] = a[j][i] - minl[i];\n\n      ans += a[1][1];\n\n      for (int i = 2; i < n; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < n; i++)\n        a[i - 1][0] = a[i][0];\n\n      for (int i = 2; i < n; i++)\n        for (int j = 2; j < n; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33274", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, min, s, t;\n  cin >> n;\n  int a[n][n];\n  for (int k = 0; k < n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 1; j < t; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < t; i++) {\n        min = a[0][i];\n        for (j = 1; j < t; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] -= min;\n      }\n      s += a[1][1];\n      if (t > 2) {\n        for (i = 1; i < t - 1; i++) {\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        }\n        for (i = 1; i < t - 1; i++)\n          for (j = 1; j < t - 1; j++)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100] = {0};\nvoid change(int k, int n) {\n  matrix[k + 1][k + 1] = matrix[k][k];\n  int i = 0;\n  if (n - 1 >= k + 2) {\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[k + 1][i] = matrix[k][i];\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[i][k + 1] = matrix[i][k];\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int m = 0;\n  int sum[100] = {0};\n  for (m = 0; m <= n - 1; m++) {\n\n    int i = 0, j = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d \", &matrix[i][j]);\n    int k = 0;\n    for (k = 0; k <= n - 2; k++) {\n      int min = 10000;\n      for (i = k; i <= n - 1; i++) {\n        min = 10000;\n        for (j = k; j <= n - 1; j++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (j = k; j <= n - 1; j++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      for (j = k; j <= n - 1; j++) {\n        min = 10000;\n        for (i = k; i <= n - 1; i++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (i = k; i <= n - 1; i++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      sum[m] = sum[m] + matrix[k + 1][k + 1];\n      change(k, n);\n    }\n  }\n  for (m = 0; m <= n - 1; m++)\n    cout << sum[m] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint JU[100][100];\nint main() {\n  int n, i, j, h, l, M;\n  void JUbian(int N, int JU[100][100]);\n  void JUxiao(int N, int JU[100][100]);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    M = 0;\n    for (h = 0; h < n; h++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &JU[h][l]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      JUbian(j, JU);\n      M = M + JU[1][1];\n      JUxiao(j, JU);\n    }\n    printf(\"%d\\n\", M);\n  }\n  return 0;\n}\n\nvoid JUbian(int n, int JU[100][100]) {\n  int h, l, min;\n  for (h = 0; h < n; h++) {\n    min = JU[h][0];\n    for (l = 1; l < n; l++) {\n      if (JU[h][l] < min)\n        min = JU[h][l];\n    }\n    for (l = 0; l < n; l++) {\n      JU[h][l] = JU[h][l] - min;\n    }\n  }\n  for (l = 0; l < n; l++) {\n    min = JU[0][l];\n    for (h = 1; h < n; h++) {\n      if (JU[h][l] < min) {\n        min = JU[h][l];\n      }\n    }\n    for (h = 0; h < n; h++) {\n      JU[h][l] = JU[h][l] - min;\n    }\n  }\n}\n\nvoid JUxiao(int n, int JU[100][100]) {\n  int h, l;\n  for (h = 0; h < n - 1; h++) {\n    for (l = 0; l < n; l++) {\n      if (h > 0) {\n        JU[h][l] = JU[h + 1][l];\n      }\n    }\n  }\n  for (l = 0; l < n - 1; l++) {\n    for (h = 0; h < n - 1; h++) {\n      if (l > 0) {\n        JU[h][l] = JU[h][l + 1];\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "33277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[1000][1000], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b, int num) {\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[1000][1000], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000];\n    memset(a, 0, 1000 * 1000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int p = remain(a, n, 0);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33278", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, a[100][100];\n  int min, k;\n  scanf(\"%d\", &n);\n  int tn, sum;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    tn = n;\n    while (tn > 1) {\n      \n      for (i = 0; i < tn; i++) {\n        min = a[i][0];\n        for (j = 0; j < tn; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tn; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < tn; i++) {\n        min = a[0][i];\n        for (j = 0; j < tn; j++) {\n          if (min > a[j][i])\n            min = a[j][i];\n        }\n        for (j = 0; j < tn; j++) {\n          a[j][i] -= min;\n        }\n      }\n\n      \n      sum += a[1][1];\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[j][i] = a[j][i + 1];\n      }\n      tn--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33279", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  int min, sum;\n\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n\n    n = m;\n    sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    while (n > 1) {\n\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      n--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nchar mn[] = {3, 9, 31};\n\nint xn = 0;\n\nint max_files = sizeof(mn) / sizeof(mn[0]);\n\nchar *output_dir = \"data\";\n\nint rnd(int min, int max) {\n  return min + ((rand() << 15) | rand()) % (max - min + 1);\n}\n\nvoid xbuild() {\n  int i, j, k, n;\n  n = mn[xn];\n  printf(\"%d\\n\", n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      printf(\"%d\", rnd(1, n * n));\n      for (j = 1; j < n; j++) {\n        printf(\" %d\", rnd(1, n * n));\n      }\n      printf(\"\\n\");\n    }\n  }\n  xn++;\n}\n"}
{"label": "18", "index": "33280", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, l, m, b, c, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 0; j <= n * n - 1; j++)\n      scanf(\"%d \", &a[j / n][j % n]);\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        b = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          if (a[k][l] < b)\n            b = a[k][l];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[k][l] = a[k][l] - b;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        c = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[l][k] == 999999)\n            continue;\n          if (a[l][k] < c)\n            c = a[l][k];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[l][k] = a[l][k] - c;\n        }\n      }\n      s = s + a[j][j];\n      for (m = 0; m <= n - 1; m++)\n        a[j][m] = 999999;\n      for (m = 0; m <= n - 1; m++)\n        a[m][j] = 999999;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l, min, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n      for (k = 0; k < j; k++) {\n        min = a[k][0];\n        for (l = 0; l < j; l++) {\n          if (min > a[k][l]) {\n            min = a[k][l];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[k][l] = a[k][l] - min;\n        }\n      }\n      for (k = 0; k < j; k++) {\n        min = a[0][k];\n        for (l = 0; l < j; l++) {\n          if (min > a[l][k]) {\n            min = a[l][k];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[l][k] = a[l][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < j - 1; k++) {\n        a[k][0] = a[k + 1][0];\n        a[0][k] = a[0][k + 1];\n      }\n      for (k = 1; k < j - 1; k++) {\n        for (l = 1; l < j - 1; l++) {\n          a[k][l] = a[k + 1][l + 1];\n        }\n      }\n    }\n    cout << sum << '\\n';\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33282", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int[][101], int);\nint main() {\n  int n, i, j, k;\n  int a[101][101];\n\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[][101], int n) {\n  int i, j, temp, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  temp = a[1][1];\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      if (j == 0 && i > 0)\n        a[i][j] = a[i + 1][j];\n      if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n    }\n\n  if (n == 1)\n    return 0;\n  else\n    return temp + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "33283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\n\nint sum(int n) {\n  int i, j, t;\n  int min[n];\n  if (n != 1) {\n    for (i = 0; i < n; i++) {\n      min[i] = juzhen[i][0];\n      for (j = 0; j < n; j++) {\n        if (juzhen[i][j] < min[i])\n          min[i] = juzhen[i][j];\n      }\n      for (j = 0; j < n; j++)\n        juzhen[i][j] -= min[i];\n    }\n    for (j = 0; j < n; j++) {\n      min[j] = juzhen[0][j];\n      for (i = 0; i < n; i++) {\n        if (juzhen[i][j] < min[j])\n          min[j] = juzhen[i][j];\n      }\n      for (i = 0; i < n; i++)\n        juzhen[i][j] -= min[j];\n    }\n    t = juzhen[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i][j + 1];\n    for (j = 0; j < n - 1; j++)\n      for (i = 1; i < n - 1; i++)\n        juzhen[i][j] = juzhen[i + 1][j];\n    return sum(n - 1) + t;\n  } else\n    return 0;\n}\n\nint main() {\n  int N, I, J, K;\n  cin >> N;\n  for (K = 1; K <= N; K++) {\n    for (I = 0; I < N; I++)\n      for (J = 0; J < N; J++)\n        cin >> juzhen[I][J];\n    printf(\"%d\\n\", sum(N));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], m, i, j, k, x, p, q, s = 0;\n  scanf(\"%d\", &n);\n  m = n;\n  for (k = 0; k < m; k++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = 1; p < m; p++) {\n      for (i = 0; i < n; i++) {\n        x = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (j = 0; j < n; j++)\n            a[i][j] = a[i][j] - x;\n      }\n      for (j = 0; j < n; j++) {\n        x = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (i = 0; i < n; i++)\n            a[i][j] = a[i][j] - x;\n      }\n      s = s + a[1][1];\n      for (i = 2; i < n; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++)\n          a[i - 1][j - 1] = a[i][j];\n\n      n--;\n    }\n    cout << s << \"\\n\";\n    s = 0;\n    n = m;\n  }\n}\n"}
{"label": "18", "index": "33285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, sum, min, m;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 2; j < m; j++)\n          a[i][j - 1] = a[i][j];\n      for (j = 0; j < m; j++)\n        for (i = 2; i < m; i++)\n          a[i - 1][j] = a[i][j];\n      m--;\n    }\n    cout << endl << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33286", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, h, l, s = 0, n1;\n  scanf(\"%d \", &n);\n  n1 = n;\n  int min1[100];\n  int min2[100];\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min1[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (min1[j] > a[j][k]) {\n            min1[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min1[j];\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min2[k] = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (min2[k] > a[j][k]) {\n            min2[k] = a[j][k];\n          }\n        }\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min2[k];\n        }\n      }\n      s = s + a[1][1];\n      for (m = 2; m < n; m++) {\n        a[0][m - 1] = a[0][m];\n        a[m - 1][0] = a[m][0];\n      }\n      for (h = 2; h < n; h++) {\n        for (l = 2; l < n; l++) {\n          a[h - 1][l - 1] = a[h][l];\n        }\n      }\n      n--;\n    }\n    cout << s << endl;\n    s = 0;\n    n = n1;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int n, i, j, k, sum[100] = {0}, l, min;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = n;\n    while (l > 1) {\n      for (j = 0; j < l; j++) {\n        min = 100000;\n        for (k = 0; k < l; k++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[i][j][k] -= min;\n      }\n      for (k = 0; k < l; k++) {\n        min = 100000;\n        for (j = 0; j < l; j++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (j = 0; j < l; j++)\n          a[i][j][k] -= min;\n      }\n      sum[i] += a[i][1][1];\n      for (j = 2; j < l; j++)\n        for (k = 0; k < l; k++)\n          a[i][j - 1][k] = a[i][j][k];\n      for (k = 2; k < l; k++)\n        for (j = 0; j < l; j++)\n          a[i][j][k - 1] = a[i][j][k];\n      l--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33288", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, s = 0;\n  int b[100], a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (s = n; s > 1; s--) {\n      int min1 = 10000;\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min1) {\n            min1 = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= min1;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[k][j] < min1) {\n            min1 = a[k][j];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[k][j] -= min1;\n        }\n      }\n      b[n - s] = a[1][1];\n      for (j = 2; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[k][j - 1] = a[k][j];\n        }\n      }\n      for (k = 2; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n    }\n    int sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      sum = sum + b[k];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33289", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint i, j, k, l;\nint a[100][100];\nint xiao(int n) {\n  int min, s;\n  for (j = 0; j < n; j++) {\n    min = a[j][0];\n    for (k = 1; k < n; k++)\n      min = (a[j][k] < min) ? a[j][k] : min;\n    for (k = 0; k < n; k++)\n      a[j][k] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (k = 1; k < n; k++)\n      min = (a[k][j] < min) ? a[k][j] : min;\n    for (k = 0; k < n; k++)\n      a[k][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  s = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n -= 1;\n  return (s + xiao(n));\n}\nint main() {\n\n  int n, result[100];\n  scanf(\"%d \", &n);\n  for (l = 0; l < n; l++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    result[l] = xiao(n);\n  }\n  for (l = 0; l < n; l++)\n    cout << result[l] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33290", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint min(int a[], int n);    \nint f(int b[][100], int n); \nint main() {\n  int m, n, i, j;\n  cin >> n;\n  m = n;\n  while (m--) {\n    int a[100][100] = {0};\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];      \n    cout << f(a, n) << endl; \n  }\n  return 0;\n}\nint min(int a[], int n) {\n  int mini = a[0], i;\n  for (i = 1; i < n; i++) {\n    if (a[i] < mini)\n      mini = a[i];\n  }\n  return mini; \n}\nint f(int b[][100], int n) {\n  int i, j, m, t, lmin;\n  if (n == 1) \n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      m = min(b[i], n);\n      for (j = 0; j < n; j++)\n        b[i][j] = b[i][j] - m; \n    }\n    for (i = 0; i < n; i++) {\n      lmin = b[0][i];\n      for (j = 0; j < n; j++) {\n        if (b[j][i] < lmin)\n          lmin = b[j][i];\n      }\n      if (lmin > 0)\n        for (j = 0; j < n; j++)\n          b[j][i] = b[j][i] - lmin;\n    }\n    t = b[1][1]; \n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        b[i][j] = b[i][j + 1]; \n    for (i = 0; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        b[j][i] = b[j + 1][i]; \n    return f(b, --n) + t;      \n  }\n}\n"}
{"label": "18", "index": "33291", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nvoid ope(int m, int a[][101]) {\n  if (m == 1)\n    return;\n  else {\n    int i, j, q, min = 100000;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[i][q] = a[i][q] - min;\n      }\n      min = 100000;\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[q][i] = a[q][i] - min;\n      }\n      min = 100000;\n    }\n    sum = sum + a[1][1];\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= m - 1; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n      a[0][i - 1] = a[0][i];\n      a[i - 1][0] = a[i][0];\n    }\n    ope(m - 1, a);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[101][101];\n  int i, j, k;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    ope(n, a);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33292", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n  int min = a[hang][1];\n  for (i = 1; i <= geshu; i++) {\n    if (a[hang][i] < min)\n      min = a[hang][i];\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = a[1][lie];\n  for (i = 1; i <= geshu; i++) {\n    if (a[i][lie] < min)\n      min = a[i][lie];\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  scanf(\"%d \", &n);\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[mm][i] = a[mm][i] - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[i][mm] = a[i][mm] - Minlie;\n      }\n\n      sum += a[2][2];\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[ii][i - 1] = a[ii][i];\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[i - 1][ii] = a[i][ii];\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33293", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a[101][101], s;\nvoid cal() {\n  int i, j, k, l, m;\n  for (j = 0; j < n; ++j)\n    for (k = 0; k < n; ++k)\n      cin >> a[j][k];\n  s = 0;\n  for (j = 0; j < n; ++j) {\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[k][l] < a[k][m])\n          m = l;\n      m = a[k][m];\n      for (l = j; l < n; ++l)\n        a[k][l] -= m;\n    }\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[l][k] < a[m][k])\n          m = l;\n      m = a[m][k];\n      for (l = j; l < n; ++l)\n        a[l][k] -= m;\n    }\n    s += a[j + 1][j + 1];\n    for (k = j + 1; k < n; ++k) {\n      a[j + 1][k] = a[j][k];\n      a[k][j + 1] = a[k][j];\n    }\n    a[j + 1][j + 1] = a[j][j];\n  }\n  return;\n}\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; ++i) {\n    cal();\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110];\n  int sum = 0;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n - 1; i++) {\n      int mi = 9999999;\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[j][m] < mi)\n            mi = a[j][m];\n        for (int m = 0; m < n - i; m++)\n          a[j][m] -= mi;\n      }\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[m][j] < mi)\n            mi = a[m][j];\n        for (int m = 0; m < n - i; m++)\n          a[m][j] -= mi;\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - i - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - i - 1; j++) {\n        a[j][0] = a[j + 1][0];\n        for (int m = 1; m < n - i - 1; m++)\n          a[j][m] = a[j + 1][m + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33295", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, number;\n  cin >> n;\n  number = n;\n  for (i = 0; i < number; i++) {\n    int p, q, a[100][100], minnum[100], sum = 0;\n    for (p = 0; p < number; p++) {\n      for (q = 0; q < number; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    n = number;\n    while (n > 1) {\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          if (q == 0)\n            minnum[p] = a[p][q];\n          else if (minnum[p] > a[p][q])\n            minnum[p] = a[p][q];\n        }\n      }\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          a[p][q] = a[p][q] - minnum[p];\n        }\n      }\n      for (q = 0; q < n; q++) {\n        int tag = 0, min;\n        for (p = 0; p < n; p++) {\n          if (a[p][q] == 0)\n            tag = 1;\n          if (p == 0)\n            min = a[p][q];\n          else if (min > a[p][q])\n            min = a[p][q];\n        }\n        if (tag == 0) {\n          for (p = 0; p < n; p++) {\n            a[p][q] -= min;\n          }\n        }\n      }\n      sum += a[1][1];\n      n--;\n      for (j = 0, p = 0; p < n + 1; p++, j++) {\n        for (q = 0, k = 0; q < n + 1; q++, k++) {\n          if (p == 1)\n            p++;\n          if (q == 1)\n            q++;\n          a[j][k] = a[p][q];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid fact(int n);\nint sum(int n);\nint a[100][100];\nint i = 0, j = 0;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\nvoid fact(int n) {\n\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\n\nint sum(int n) {\n  fact(n);\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid sub(int a[1000], int n) {\n  int i, min = a[0];\n  for (i = 1; i < n; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < n; i++)\n    a[i] -= min;\n}\nint main() {\n  int n, k, i, j, count, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    int a[1000][1000], temp[1000];\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (count = 0; count < n - 1; count++) {\n      for (i = count; i < n; i++) {\n        for (j = count; j < n; j++)\n          temp[j - count] = a[i][j];\n        sub(temp, n - count);\n        for (j = count; j < n; j++)\n          a[i][j] = temp[j - count];\n      }\n      for (j = count; j < n; j++) {\n        for (i = count; i < n; i++)\n          temp[i - count] = a[i][j];\n        sub(temp, n - count);\n        for (i = count; i < n; i++)\n          a[i][j] = temp[i - count];\n      }\n      sum += a[count + 1][count + 1];\n      for (i = 0; i < n; i++)\n        a[i][count + 1] = a[i][count];\n      for (j = 0; j < n; j++)\n        a[count + 1][j] = a[count][j];\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][i][k] = a[p][i][k] - min;\n        }\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][k][j] = a[p][k][j] - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        a[p][2][i] = 0;\n      for (j = 1; j <= h; j++)\n        a[p][j][2] = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][j][i - 1] = a[p][j][i];\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][i - 1][j] = a[p][i][j];\n        }\n      }\n      h -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33299", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid step1(int a[100][100], int n) {\n  int hmin, lmin;\n  for (int i = 0; i < n; i++) {\n    hmin = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < hmin)\n        hmin = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= hmin;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    lmin = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < lmin)\n        lmin = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= lmin;\n    }\n  }\n}\nvoid step2(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i + 1];\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int nn = n;\n  while (nn--) {\n    int tn = n;\n    int a[100][100];\n    for (int i = 0; i < tn; i++)\n      for (int j = 0; j < tn; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    while (tn >= 2) {\n      step1(a, tn);\n      sum += a[1][1];\n      step2(a, tn);\n      tn--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33300", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  int a[105][105] = {0};\n  while (cin >> a[0][0]) {\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        if (i == 0 && j == 0)\n          continue;\n        cin >> a[i][j];\n      }\n    }\n\n    int tmp = n;\n    int sum = 0;\n    while (--tmp) {\n      int tmp_min;\n\n      for (i = 0; i < tmp + 1; ++i) {\n        tmp_min = 600000;\n        for (j = 0; j < tmp + 1; ++j) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (j = 0; j < tmp + 1; ++j) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n\n      for (j = 0; j < tmp + 1; ++j) {\n        tmp_min = 600000;\n        for (i = 0; i < tmp + 1; ++i) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (i = 0; i < tmp + 1; ++i) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 2; i < tmp + 1; ++i) {\n        a[0][i - 1] = a[0][i];\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i < tmp + 1; ++i) {\n        for (j = 2; j < tmp + 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33301", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110];\n  int sum = 0;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n - 1; i++) {\n      int mi = 9999999;\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[j][m] < mi)\n            mi = a[j][m];\n        for (int m = 0; m < n - i; m++)\n          a[j][m] -= mi;\n      }\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[m][j] < mi)\n            mi = a[m][j];\n        for (int m = 0; m < n - i; m++)\n          a[m][j] -= mi;\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - i - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - i - 1; j++) {\n        a[j][0] = a[j + 1][0];\n        for (int m = 1; m < n - i - 1; m++)\n          a[j][m] = a[j + 1][m + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[100][100];\n  cin >> n;\n  int(*p)[100] = num;\n  for (int k = 0; k < n; k++) {\n    int sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int i = 0; i < m; i++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      sum += num[1][1];\n      for (int i = 1; i < m - 1; i++)\n        *(*(p + i) + 0) = *(*(p + i + 1) + 0);\n      for (int j = 1; j < m - 1; j++)\n        *(*(p + 0) + j) = *(*(p + 0) + j + 1);\n      for (int i = 2; i < m; i++) {\n        for (int j = 2; j < m; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n      }\n      m--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33303", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, count = 0;\n  scanf(\"%d \", &n);\n  while (count < n) {\n    int input[100][100], sum = 0;\n    int(*p)[100];\n    p = input;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 0; i < n - 1; i++) {\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + j) + k) < min)\n            min = *(*(p + j) + k);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + j) + k) -= min;\n      }\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + k) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + j) + k) = *(*(p + j) + k + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n    }\n    printf(\"%d\\n\", sum);\n    count++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33304", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a1[100][100];\nint xiao(int n) {\n  int sum = 0;\n  if (n == 2) {\n    for (int i = 0; i < n; i++) {\n      int min = 1000;\n      for (int j = 0; j < n; j++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a1[i][j] = a1[i][j] - min;\n    }\n    for (int j = 0; j < n; j++) {\n      int min = 1000;\n      for (int i = 0; i < n; i++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a1[i][j] = a1[i][j] - min;\n    }\n\n    return a1[1][1];\n  }\n\n  for (int i = 0; i < n; i++) {\n    int min = 1000;\n    for (int j = 0; j < n; j++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a1[i][j] = a1[i][j] - min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = 1000;\n    for (int i = 0; i < n; i++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int i = 0; i < n; i++)\n      a1[i][j] = a1[i][j] - min;\n  }\n\n  sum += a1[1][1];\n\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (j == 1)\n        continue;\n      if (j < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i][j - 1] = a1[i][j];\n    }\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      if (i == 1)\n        continue;\n      if (i < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i - 1][j] = a1[i][j];\n    }\n  sum += xiao(n - 1);\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n\n  for (int k = 0; k < n; k++) {\n\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a1[i][j];\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min;\n  int a[103][103];\n  cin >> n;\n  for (int count = 1; count <= n; count++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int n0 = n, sum = 0;\n    while (n0 >= 2) {\n      for (i = 0; i < n0; i++) {\n        min = a[i][0];\n        for (j = 1; j < n0; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n0; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n0; j++) {\n        min = a[0][j];\n        for (i = 1; i < n0; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n0; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < n0; i++)\n        for (j = 0; j < n0; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n0; j++)\n        for (i = 0; i < n0; i++)\n          a[i][j] = a[i][j + 1];\n      n0--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33306", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint m, a[100][100], s;\nvoid guiling() \n{\n  int i, j, min; \n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j]; \n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[j][i] < min)\n        min = a[j][i]; \n    }\n    for (j = 0; j < m; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  if (m >= 2)\n    s = s + a[1][1]; \n}\nvoid xiaojian() \n{\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m - 1; j++)\n      a[i][j] = a[i][j + 1]; \n  for (j = 0; j < m - 1; j++)\n    for (i = 1; i < m - 1; i++)\n      a[i][j] = a[i + 1][j]; \n  m--;\n  guiling(); \n  if (m > 2)\n    xiaojian(); \n  else\n    cout << s << endl;\n}\nint main() {\n  int n, t, i, j; \n  cin >> n;\n  t = n;\n  while (n > 0) {\n    m = t;\n    s = 0;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        cin >> a[i][j]; \n    guiling();          \n    xiaojian();         \n    n--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33307", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nvoid minu(int n);\nvoid shrink(int n);\nint main() {\n  int n, i, j, k, sum, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (x = n; x > 1; x--) {\n      minu(x);\n      sum += a[1][1];\n      shrink(x);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid minu(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid shrink(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33308", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  scanf(\"%d \", &n);\n  int a[100][100];\n  int sum = 0, temp = 1;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min;\n    sum = 0;\n    temp = 1;\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      sum += a[temp][temp];\n      for (i = 0; i < n; i++)\n        a[i][temp] = -1;\n      for (j = 0; j < n; j++)\n        a[temp][j] = -1;\n      temp++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33309", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint matrixx[110][110];\n\nvoid Del() {\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[i][j] = matrixx[i + 1][j];\n    }\n  }\n  for (int i = 2; i < n; i++) {\n    for (int j = 1; j <= n; j++) {\n      matrixx[j][i] = matrixx[j][i + 1];\n    }\n  }\n  return;\n}\nint main() {\n  cin >> n;\n  int minnum;\n  int sum;\n  for (int s = 1; s <= n; s++) {\n    sum = 0;\n    for (int j = 1; j <= n; j++) {\n      for (int k = 1; k <= n; k++) {\n        cin >> matrixx[j][k];\n      }\n    }\n    for (int x; x < 3000; x++) {\n      if (x == 5) {\n        int y = 0;\n        y++;\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[j][k];\n          else\n            minnum = min(minnum, matrixx[j][k]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[j][k] -= minnum;\n        }\n      }\n\n      for (int j = 1; j <= n; j++) {\n        for (int k = 1; k <= n; k++) {\n          if (k == 1)\n            minnum = matrixx[k][j];\n          else\n            minnum = min(minnum, matrixx[k][j]);\n        }\n        for (int k = 1; k <= n; k++) {\n          matrixx[k][j] -= minnum;\n        }\n      }\n      sum += matrixx[2][2];\n      Del();\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, cycle;\n  cin >> n;\n  for (cycle = 0; cycle < n; cycle++) {\n    int i, j, a[100][100] = {0}, w, sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n\n    w = n;\n    int min;\n\n    while (w > 1) {\n      for (i = 0; i < w; i++) {\n        min = a[i][0];\n        for (j = 0; j < w; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < w; j++)\n          a[i][j] -= min;\n      }\n\n      for (j = 0; j < w; j++) {\n        int count = 0;\n\n        for (i = 0; i < w; i++) {\n\n          if (a[i][j] == 0) {\n            count++;\n            break;\n          }\n        }\n\n        if (count == 0) {\n          min = a[0][j];\n          for (i = 0; i < w; i++) {\n            if (a[i][j] < min)\n              min = a[i][j];\n          }\n\n          for (i = 0; i < w; i++)\n            a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (j = 2; j < w; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < w; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i < w; i++) {\n        for (j = 2; j < w; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n      w--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nn, n, i, j, k, min[100], maze[100][100], sum;\n  scanf(\"%d \", &nn);\n  for (k = 0; k < nn; k++) {\n    sum = 0;\n    n = nn;\n    for (i = 0; i < nn; i++)\n      for (j = 0; j < nn; j++)\n        cin >> maze[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min[i] = maze[i][0];\n        for (j = 1; j < n; j++)\n          min[i] = min[i] < maze[i][j] ? min[i] : maze[i][j];\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          maze[i][j] -= min[i];\n        }\n      for (j = 0; j < n; j++) {\n        min[j] = maze[0][j];\n        for (i = 1; i < n; i++)\n          min[j] = min[j] < maze[i][j] ? min[j] : maze[i][j];\n      }\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++)\n          maze[i][j] -= min[j];\n      sum += maze[1][1];\n      for (i = 1; i < n - 1; i++)\n        maze[i][0] = maze[i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        maze[0][j] = maze[0][j + 1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          maze[i][j] = maze[i + 1][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33312", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0};\nint n = 0;\nvoid find() {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n\n  int l = 0;\n  int m = 10000;\n\n  for (l = n; l > 1; l--) {\n    for (i = 0; i < l; i++) {\n      m = 10000;\n      for (j = 0; j < l; j++)\n        m = min(m, *(*(a + i) + j));\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    for (j = 0; j < l; j++) {\n      m = 10000;\n      for (i = 0; i < l; i++)\n        m = min(m, *(*(a + i) + j));\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    sum = sum + *(*(a + 1) + 1);\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i + 1) + j);\n    for (j = 1; j < l; j++)\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  cout << sum << endl;\n}\n\nint main() {\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++)\n    find();\n\n  return 0;\n}\n"}
{"label": "18", "index": "33313", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[1000][1000] = {0};\nint sum = 0;\nvoid cut(int n) {\n  int i, j, k;\n  int min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (k = 0; k < n; k++)\n      a[i][k] = a[i][k] - min;\n    min = 10000;\n  }\n  min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (k = 0; k < n; k++)\n      a[k][i] = a[k][i] - min;\n    min = 10000;\n  }\n  sum = sum + a[1][1];\n}\nint main() {\n  int n, i, j, k, p;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (p = 1; p < n; p++) {\n      cut(n - p + 1);\n      for (j = 1; j < n - p; j++)\n        for (k = 1; k < n - p; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      for (k = 1; k < (n - p); k++)\n        a[0][k] = a[0][k + 1];\n      for (k = 1; k < (n - p); k++)\n        a[k][0] = a[k + 1][0];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int sz[49][49][49];\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &sz[i][j][k]);\n      }\n    }\n  }\n  int nn, min;\n  int re[49] = {0};\n  for (i = 1; i <= n; i++) {\n    for (nn = 1; nn <= n - 1; nn++) {\n      for (j = nn; j <= n; j++) {\n        min = sz[i][j][nn];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][j][k] < min) {\n              min = sz[i][j][k];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][j][k] -= min;\n          }\n        }\n      }\n      for (j = nn; j <= n; j++) {\n        min = sz[i][nn][j];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][k][j] < min) {\n              min = sz[i][k][j];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][k][j] -= min;\n          }\n        }\n      }\n      re[i] += sz[i][nn + 1][nn + 1];\n      sz[i][nn + 1][nn + 1] = sz[i][nn][nn];\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][nn + 1][j] = sz[i][nn][j];\n      }\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][j][nn + 1] = sz[i][j][nn];\n      }\n    }\n    printf(\"%d\\n\", re[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[102][102], b[101], c[101], n;\nvoid f(int a[102][102]);\nint main() {\n  int i = 0, j = 0, k = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(a);\n  }\n\n  return 0;\n}\nvoid f(int a[][102]) {\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (i >= k || i == 0) {\n        b[i] = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n\n        for (j = 0; j < n; j++)\n          a[i][j] -= b[i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (j >= k || j == 0) {\n        c[j] = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (c[j] > a[i][j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= c[j];\n      }\n    }\n    sum += a[k][k];\n\n    for (i = 0; i < n; i++) {\n      a[i][k] = 1000000;\n      a[k][i] = 1000000;\n    }\n  }\n  cout << sum << \"\\n\";\n}\n"}
{"label": "18", "index": "33316", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\ninline int FindMin_i(int M[][100], int i, int n) {\n  int Min = M[i][0];\n  for (int j = 0; j < n; j++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\ninline int FindMin_j(int M[][100], int j, int n) {\n  int Min = M[0][j];\n  for (int i = 0; i < n; i++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\nint S(int M[][100], int n) {\n  if (n == 1) {\n    return sum;\n  }\n  int Min_i = 0;\n  for (int i = 0; i < n; i++) {\n    Min_i = FindMin_i(M, i, n);\n    for (int j = 0; j < n; j++) {\n      M[i][j] = M[i][j] - Min_i;\n    }\n  }\n  int Min_j = 0;\n  for (int j = 0; j < n; j++) {\n    Min_j = FindMin_j(M, j, n);\n    for (int i = 0; i < n; i++) {\n      M[i][j] = M[i][j] - Min_j;\n    }\n  }\n  sum = sum + M[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    M[i][0] = M[i + 1][0];\n  }\n\n  for (int j = 1; j < n - 1; j++) {\n    M[0][j] = M[0][j + 1];\n  }\n\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      M[i][j] = M[i + 1][j + 1];\n    }\n  }\n\n  S(M, n - 1);\n}\n\nint main() {\n  int M[100][100] = {0};\n  int n;\n  cin >> n;\n  for (int num = 0; num < n; num++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> M[i][j];\n      }\n    }\n    sum = 0;\n    printf(\"%d\\n\", S(M, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33317", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, p, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) \n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (p = n; p >= 1; p--) {\n      for (i = 0; i <= p; i++) \n      {\n        a[0][i] = 99999;\n        a[i][0] = 99999;\n      }\n      for (i = 1; i <= p; i++) \n      {\n        for (j = 1; j <= p; j++) {\n          if (a[i][0] > a[i][j])\n            a[i][0] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++) \n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[i][0];\n      for (i = 1; i <= p; i++) \n      {\n        for (j = 1; j <= p; j++) {\n          if (a[0][j] > a[i][j])\n            a[0][j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++) \n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[0][j];\n      sum += a[2][2];\n      for (i = 1; i <= p; i++) \n      {\n        a[2][i] = 0;\n        a[i][2] = 0;\n      }\n      for (i = 1; i <= p; i++) \n        for (j = 3; j <= p; j++)\n          a[i][j - 1] = a[i][j];\n      for (i = 3; i <= p; i++) \n        for (j = 1; j <= p; j++)\n          a[i - 1][j] = a[i][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33318", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min = 0, num;\n  int s[100][100];\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    num = 0;\n    memset(s, 0, sizeof(s));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(s + i) + j);\n    for (k = 0; k <= n - 2; k++) {\n      for (i = 1; i <= n - k; i++) {\n        min = s[i][1];\n        for (j = 1; j <= n - k; j++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (j = 1; j <= n - k; j++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - k; j++) {\n        min = s[1][j];\n        for (i = 1; i <= n - k; i++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (i = 1; i <= n - k; i++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      num += s[2][2];\n      for (i = 1; i <= n - k; i++)\n        for (j = 2; j <= n - k - 1; j++)\n          *(*(s + i) + j) = *(*(s + i) + j + 1);\n      for (j = 1; j <= n - k; j++)\n        for (i = 2; i <= n - k - 1; i++)\n          *(*(s + i) + j) = *(*(s + i + 1) + j);\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33319", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m, sum = 0;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int l = 1; l < n; l++) {\n      for (i = l; i <= n; i++) {\n        m = a[i][l];\n        for (j = l + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (j = l; j <= n; j++)\n          a[i][j] = a[i][j] - m;\n      }\n      for (j = l; j <= n; j++) {\n        m = a[l][j];\n        for (i = l + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (i = l; i <= n; i++)\n          a[i][j] = a[i][j] - m;\n      }\n      sum = sum + a[l][l];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33320", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint changeSum(int, int, int[][100]);\nint main() {\n  int n, i;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    int j, k, a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << changeSum(n, 0, a) << endl;\n  }\n  return 0;\n}\n\nint changeSum(int n, int sum, int a[][100]) {\n  if (n == 1)\n    return sum;\n  else {\n    int j, k, minrow, mincol;\n    for (j = 0; j < n; j++) {\n      minrow = a[j][0];\n      for (k = 1; k < n; k++)\n        if (a[j][k] < minrow)\n          minrow = a[j][k];\n      for (k = 0; k < n; k++)\n        a[j][k] -= minrow;\n    }\n    for (k = 0; k < n; k++) {\n      mincol = a[0][k];\n      for (j = 1; j < n; j++)\n        if (a[j][k] < mincol)\n          mincol = a[j][k];\n      for (j = 0; j < n; j++)\n        a[j][k] -= mincol;\n    }\n    sum += a[1][1];\n    for (j = 2; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j - 1][k] = a[j][k];\n    for (j = 0; j < n; j++)\n      for (k = 2; k < n; k++)\n        a[j][k - 1] = a[j][k];\n    n--;\n    changeSum(n, sum, a);\n  }\n}\n"}
{"label": "18", "index": "33321", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n;\nvoid down1(int a[100][100], int m) {\n  int i, p, j;\n  for (i = m; i < n; i = i + 1) {\n    p = a[i][m];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[i][j])\n        p = a[i][j];\n    for (j = m; j < n; j = j + 1)\n      a[i][j] = a[i][j] - p;\n  }\n}\nvoid down2(int a[100][100], int m) {\n  int i, j, p;\n  for (i = m; i < n; i = i + 1) {\n    p = a[m][i];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[j][i])\n        p = a[j][i];\n    for (j = m; j < n; j = j + 1)\n      a[j][i] = a[j][i] - p;\n  }\n}\nint main() {\n  int i, j, t, k;\n  int a[100][100];\n  cin >> n;\n  k = 0;\n  while (k < n) {\n    k = k + 1;\n    t = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        cin >> a[i][j];\n    for (i = 1; i <= n - 1; i = i + 1) {\n      down1(a, i - 1);\n      down2(a, i - 1);\n      t = t + a[i][i];\n      for (j = i - 1; j < n; j = j + 1)\n        a[i][j] = a[i - 1][j];\n      for (j = i; j < n; j = j + 1)\n        a[j][i] = a[j][i - 1];\n    }\n    printf(\"%d\", t);\n    if (k < n)\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int num[n][n];\n  int sum = 0;\n  int min = 0;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> num[i][j];\n    }\n    for (int s = 0; s < n - 1; s++) {\n      for (int i = 0; i < n; i++) {\n        min = INT_MAX;\n        for (int j = 0; j < n; j++) {\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        }\n        for (int j = 0; j < n; j++)\n          num[i][j] -= min;\n      }\n      for (int j = 0; j < n; j++) {\n        min = INT_MAX;\n        for (int i = 0; i < n; i++)\n          if (num[i][j] >= 0 && num[i][j] < min)\n            min = num[i][j];\n        for (int i = 0; i < n; i++)\n          num[i][j] -= min;\n      }\n      sum += num[1 + s][1 + s];\n      for (int i = 0; i < n; i++) {\n        num[1 + s][i] = -1;\n        num[i][1 + s] = -1;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33323", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint total;\n\nvoid slice_1(int);\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  slice_1(n);\n}\n\nvoid slice_1(int n) {\n  total += a[1][1];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (j > 0 && i > 0) {\n        a[i][j] = a[i + 1][j + 1];\n      } else if (j > 0) {\n        a[i][j] = a[i][j + 1];\n      } else if (i > 0) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n  n--;\n  if (n == 1) {\n    return;\n  }\n  zero(n);\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    memset(a, 0, 100 * 100 * sizeof(int));\n    total = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    zero(n);\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][i][k] = a[p][i][k] - min;\n        }\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][k][j] = a[p][k][j] - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        a[p][2][i] = 0;\n      for (j = 1; j <= h; j++)\n        a[p][j][2] = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][j][i - 1] = a[p][j][i];\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][i - 1][j] = a[p][i][j];\n        }\n      }\n      h -= 1;\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint zero(int);    \nvoid reduce(int); \nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];      \n    cout << zero(n) << endl; \n  }\n  return 0;\n}\nint zero(int count) {\n  int i, j, sum = 0;\n  while (count >= 2) {\n    for (i = 0; i < count; i++) {\n      int min = a[i][0];\n      for (j = 1; j < count; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < count; j++)\n        a[i][j] -= min;\n    } \n    for (i = 0; i < count; i++) {\n      int min = a[0][i];\n      for (j = 1; j < count; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < count; j++)\n        a[j][i] -= min;\n    }               \n    sum += a[1][1]; \n    reduce(count);  \n    count--;        \n  }\n  return sum; \n}\nvoid reduce(int count) {\n  for (int i = 1; i < count - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < count - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33326", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint change(int m) {\n  int i, j, k = 0, min, value;\n\n  if (m == 1)\n    return 0;\n\n  for (i = 0; i < m; i++) \n  {\n    min = a[i][0];\n    for (j = 0; j < m; j++) \n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < m; i++) \n  {\n    min = a[0][i];\n    for (j = 0; j < m; j++) \n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n\n  value = a[1][1]; \n  \n  for (i = 1; i < m - 1; i++) \n    for (j = 0; j < m; j++)   \n      a[i][j] = a[i + 1][j];  \n\n  for (j = 1; j < m - 1; j++)   \n    for (i = 0; i < m - 1; i++) \n      a[i][j] = a[i][j + 1];    \n\n  return value + change(m - 1);\n}\nint main() {\n  int n, i, j;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n * n; j++)\n      cin >> a[j / n][j % n];\n\n    cout << change(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, k, array[100][100];\n  cin >> n;\n  k = n;\n  m = n;\n  while (m > 0) {\n    int i, j, min;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = array[i][0];\n        for (j = 1; j < k; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j < k; j++)\n          array[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = array[0][i];\n        for (j = 1; j < k; j++) {\n          if (array[j][i] < min)\n            min = array[j][i];\n        }\n        for (j = 0; j < k; j++)\n          array[j][i] -= min;\n      }\n      sum += array[1][1];\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k - 1; j++)\n          array[i][j] = array[i][j + 1];\n      }\n      for (j = 0; j < k - 1; j++) {\n        for (i = 1; i < k - 1; i++) {\n          array[i][j] = array[i + 1][j];\n        }\n      }\n      k--;\n    }\n    cout << sum << endl;\n    k = n;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, mini;\nint a[110][110];\nvoid findmin(int x, int y, int dx, int dy) {\n  if (x == m)\n    return;\n  if (y == m)\n    return;\n  if (a[x][y] < mini)\n    mini = a[x][y];\n  findmin(x + dx, y + dy, dx, dy);\n  a[x][y] = a[x][y] - mini;\n}\nvoid kill() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nint main() {\n  int i, j, sum, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mini = 10000;\n        findmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + a[1][1];\n      kill();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, sum, min;\n  cin >> m;\n  for (i = 1; i <= m; i++) \n                           \n  {\n    int a[m][m];\n    for (\n        j = 0; j < m;\n        j++) \n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    sum = 0;\n    for (n = m; n > 1; n--) \n    {\n      for (j = 0; j < n; j++) \n      {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] <\n              min) \n          {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] =\n              a[j][k] -\n              min; \n        }\n      }\n      for (k = 0; k < n; k++) \n      {\n        min = a[0][k];\n        for (j = 1; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      sum = sum + a[1][1]; \n      for (j = 1; j < n - 1;\n           j++) \n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k]; \n        }\n      for (k = 1; k < n - 1; k++) \n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n    }\n    cout << sum << endl; \n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33330", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint tozero(int n);\nvoid delete1(int, int);\nvoid delete2(int, int);\nvoid movea(int);\nint a[100][100], sum = 0;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 99; j++)\n      for (k = 0; k <= 99; k++) {\n        *(*(a + j) + k) = 0;\n      }\n    int r, l, lim = 99;\n    char c;\n\n    for (r = 0; r < n; r++)\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(a + r) + l);\n      }\n    sum = tozero(r);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\nvoid delete1(int r, int n) {\n  int min = *(*(a + r) + 0), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + r) + j) < min)\n      min = *(*(a + r) + j);\n  for (j = 0; j < n; j++)\n    *(*(a + r) + j) -= min;\n}\nvoid delete2(int l, int n) {\n  int min = *(*(a + 0) + l), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + j) + l) < min)\n      min = *(*(a + j) + l);\n  for (j = 0; j < n; j++)\n    *(*(a + j) + l) -= min;\n}\nvoid movea(int n) {\n  int i, j, k;\n  for (i = 1; i < n - 1; i++)\n    *(*(a + 0) + i) = *(*(a + 0) + i + 1);\n  for (i = 1; i < n - 1; i++)\n    *(*(a + i) + 0) = *(*(a + i + 1) + 0);\n  for (i = 1; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n}\n\nint tozero(int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    delete1(i, n);\n  for (i = 0; i < n; i++)\n    delete2(i, n);\n  sum += *(*(a + 1) + 1);\n  movea(n);\n  if (n >= 3)\n    tozero(n - 1);\n  return sum;\n}\n"}
{"label": "18", "index": "33331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nint min(int a[], int n) {\n  int m = a[0];\n  for (int i = 0; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return m;\n}\n\nint juzhen(int a[100][100], int n) {\n  int hangmin[100], liemin[100];\n  for (int i = 0; i < n; i++) {\n    hangmin[i] = min(a[i], n);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - hangmin[i];\n  }\n  int templie[100];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      templie[j] = a[j][i];\n    }\n    liemin[i] = min(templie, n);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[j][i] = a[j][i] - liemin[i];\n  }\n  sum = sum + a[1][1];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  for (int j = 1; j < n; j++)\n    for (int i = 0; i < n; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  n = n - 1;\n  if (n == 1) {\n    cout << sum << endl;\n    sum = 0;\n  } else\n    juzhen(a, n);\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100][100];\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    juzhen(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int k = 1, n = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int i = 0, j = 0, m;\n    int result = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 0; i < m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      result = result + a[1][1];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++) {\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n\n    cout << result << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33333", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, z, sum, min;\n  int a[105][105];\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n - k; j++) {\n          *(*(a + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 0; i < n - k; i++)\n        for (j = 2; j < n - k; j++)\n          *(*(a + i) + j - 1) = *(*(a + i) + j);\n      for (j = 0; j < n - k - 1; j++)\n        for (i = 2; i < n - k; i++)\n          *(*(a + i - 1) + j) = *(*(a + i) + j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33334", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nenum { size = 100 };\n\nvoid gotozero(int num, int n, int a[size][size][size], int minrow[size][size],\n              int mincol[size][size]) {\n  int i, j, k;\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      minrow[i][j] = a[i][j][0];\n      for (k = 0; k < n; k++)\n        if (minrow[i][j] > a[i][j][k])\n          minrow[i][j] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][j][k] -= minrow[i][j];\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      mincol[i][j] = a[i][0][j];\n      for (k = 0; k < n; k++) {\n        if (mincol[i][j] > a[i][k][j])\n          mincol[i][j] = a[i][k][j];\n      }\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][k][j] -= mincol[i][j];\n  }\n}\n\nvoid cut(int num, int n, int a[size][size][size], int minrow[size][size],\n         int mincol[size][size]) {\n  int i, j, k;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 2; k < n; k++)\n        a[i][j][k - 1] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 2; j < n; j++)\n        a[i][j - 1][k] = a[i][j][k];\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, num;\n  int a[size][size][size] = {0}, minrow[size][size] = {0}, sum[size] = {0},\n      mincol[size][size] = {0};\n\n  cin >> n;\n  num = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n\n  while (n > 1) {\n    gotozero(num, n, a, minrow, mincol);\n    for (i = 0; i < num; i++)\n      sum[i] += a[i][1][1];\n    cut(num, n, a, minrow, mincol);\n    n--;\n  }\n\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", sum[i]);\n}\n"}
{"label": "18", "index": "33335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], s = 0;\nvoid juzhen(int x) {\n\n  for (int i = 0; i < x; i++) {\n    int m = a[i][0];\n    for (int j = 1; j < x; j++)\n\n      if (a[i][j] < m)\n        m = a[i][j];\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - m;\n  }\n  for (int i = 0; i < x; i++) {\n    int m = a[0][i];\n    for (int j = 1; j < x; j++)\n\n      if (a[j][i] < m)\n        m = a[j][i];\n    for (int j = 0; j < x; j++)\n      a[j][i] = a[j][i] - m;\n  }\n  s = s + a[1][1];\n  if (x == 2) {\n    cout << s << \"\\n\";\n    return;\n  }\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x - 1; j++)\n      a[j][i] = a[j][i + 1];\n  juzhen(x - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int o = 1; o <= n; o++) {\n    s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33336", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid xiao(int a[100][100], int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] = a[i][j] - min;\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (j = 0; j < n; j++)\n    for (i = 2; i < n; i++)\n      a[i - 1][j] = a[i][j];\n}\n\nint count(int a[100][100], int n, int s) {\n  if (n == 1)\n    return (s);\n  else {\n    xiao(a, n);\n    s = s + a[1][1];\n    move(a, n);\n    return (count(a, n - 1, s));\n  }\n}\nint main() {\n  int n, i, j, s, t, a[100][100];\n  cin >> n;\n  t = n;\n  while (t > 0) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    printf(\"%d\\n\", count(a, n, s));\n    t--;\n  }\n}\n"}
{"label": "18", "index": "33337", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid solve(int n) {\n  if (n != 1) {\n    for (int i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (int j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (int j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        a[j][i] -= min;\n      }\n    }\n    sum += a[1][1];\n    for (int i = 1; i < n - 1; i++) {\n      a[i][0] = a[i + 1][0];\n      a[0][i] = a[0][i + 1];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++) {\n        a[i][j] = a[i + 1][j + 1];\n      }\n    solve(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    solve(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, a[150][150], sum, min1[150];\nint f(int size) {\n  if (size == 1)\n    return sum;\n  for (i = 0; i < size; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < size; j++) {\n      if (a[i][j] < min1[i]) {\n        min1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < size; i++) {\n    for (j = 0; j < size; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n  for (j = 0; j < size; j++) {\n    min1[j] = a[0][j];\n    for (i = 0; i < size; i++) {\n      if (a[i][j] < min1[j]) {\n        min1[j] = a[i][j];\n      }\n    }\n  }\n  for (j = 0; j < size; j++) {\n    for (i = 0; i < size; i++) {\n      a[i][j] = a[i][j] - min1[j];\n    }\n  }\n  sum = sum + a[1][1];\n  for (i = 1; i < size - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < size - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return f(size - 1);\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    cout << f(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33339", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint board[100][100];\nvoid Subduction(int);\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1)\n    printf(\"%d\\n\", sum);\n  else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    for (q = 1; q <= m - 2; q++) {\n      board[0][q] = board[0][q + 1];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      board[p][0] = board[p + 1][0];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      for (q = 1; q <= m - 2; q++) {\n        board[p][q] = board[p + 1][q + 1];\n      }\n    }\n    Subduction(m - 1);\n  }\n}\n"}
{"label": "18", "index": "33340", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[104][104][104], n;\n  int i, j, t, k, m, s;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    s = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j][0];\n    for (k = 1; k < n; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        m = 100000;\n        for (j = 1; j <= n - k + 1; j++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j][k - 1] -= m;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        m = 100000;\n        for (i = 1; i <= n - k + 1; i++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j][k - 1] -= m;\n      }\n\n      s += a[2][2][k - 1];\n\n      for (i = 1; i <= n - k + 1; i++)\n        for (j = 1; j <= n - k + 1; j++) {\n          if (i == 1 && j == 1)\n            a[i][j][k] = a[i][j][k - 1];\n          if (i == 2 || j == 2)\n            continue;\n          if (i == 1 && j >= 3)\n            a[i][j - 1][k] = a[i][j][k - 1];\n          if (j == 1 && i >= 3)\n            a[i - 1][j][k] = a[i][j][k - 1];\n          if (i >= 3 && j >= 3)\n            a[i - 1][j - 1][k] = a[i][j][k - 1];\n        }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], j, k, l, sum = 0;\n    for (k = 0; k <= n - 1; k++)\n      for (l = 0; l <= n - 1; l++)\n        cin >> a[k][l];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = a[k][0];\n        for (l = 1; l <= n - j; l++)\n          if (a[k][l] < min)\n            min = a[k][l];\n        for (l = 0; l <= n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = a[0][k];\n        for (l = 1; l <= n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l <= n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (k = 2; k <= n - j; k++) {\n        a[0][k - 1] = a[0][k];\n        a[k - 1][0] = a[k][0];\n      }\n      for (k = 2; k <= n - j; k++)\n        for (l = 2; l <= n - j; l++)\n          a[k - 1][l - 1] = a[k][l];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, a[150][150], sum, min1[150];\nint f(int size) {\n  if (size == 1)\n    return sum;\n  for (i = 0; i < size; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < size; j++) {\n      if (a[i][j] < min1[i]) {\n        min1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < size; i++) {\n    for (j = 0; j < size; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n  for (j = 0; j < size; j++) {\n    min1[j] = a[0][j];\n    for (i = 0; i < size; i++) {\n      if (a[i][j] < min1[j]) {\n        min1[j] = a[i][j];\n      }\n    }\n  }\n  for (j = 0; j < size; j++) {\n    for (i = 0; i < size; i++)\n      a[i][j] = a[i][j] - min1[j];\n  }\n  sum = sum + a[1][1];\n  for (i = 1; i < size - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < size - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return f(size - 1);\n}\n\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    printf(\"%d\\n\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33343", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint num[100][100];\nint n = 0;\n\nint xiaoling(int a);\n\nint main() {\n  int i, j, sum = 0, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    sum = xiaoling(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint xiaoling(int a) {\n  int i, j, min, temp = 0;\n  if (a == 1)\n    return 0;\n  for (i = 0; i < a; i++) {\n    min = num[i][0];\n    for (j = 0; j < a; j++) {\n      min = (min > num[i][j]) ? num[i][j] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    min = num[0][i];\n    for (j = 0; j < a; j++) {\n      min = (min > num[j][i]) ? num[j][i] : min;\n    }\n    if (min != 0) {\n      for (j = 0; j < a; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n  }\n  temp = num[1][1];\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[i][j] = num[i][j + 1];\n    }\n  }\n  for (i = 0; i < a; i++) {\n    for (j = 1; j < a - 1; j++) {\n      num[j][i] = num[j + 1][i];\n    }\n  }\n  return temp + xiaoling(a - 1);\n}\n"}
{"label": "18", "index": "33344", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nint min(int a[], int n) {\n  int m = a[0];\n  for (int i = 0; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return m;\n}\n\nint juzhen(int a[100][100], int n) {\n  int hangmin[100], liemin[100];\n  for (int i = 0; i < n; i++)\n    hangmin[i] = min(a[i], n);\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - hangmin[i];\n  }\n  int templie[100];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      templie[j] = a[j][i];\n\n    liemin[i] = min(templie, n);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[j][i] = a[j][i] - liemin[i];\n  }\n  sum = sum + a[1][1];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  for (int j = 1; j < n; j++)\n    for (int i = 0; i < n; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  n = n - 1;\n  if (n == 1) {\n    cout << sum << endl;\n    sum = 0;\n  } else\n    juzhen(a, n);\n  return 0;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int a[100][100];\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33345", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[i][0];\n    for (int j = 1; j < k; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[i][j] -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[0][i];\n    for (int j = 1; j < k; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[j][i] -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++)\n      a[i - 1][j] = a[i][j];\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      a[i][j - 1] = a[i][j];\n}\nint main() {\n  cin >> n;\n  while (cin >> a[0][0]) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> a[i][j];\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += a[1][1];\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min, sum = 0, t, m;\n  int a[105][105];\n  scanf(\"%d \", &n);\n  t = n;\n  m = n;\n  while (t > 0) {\n    n = m;\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n\n      n--;\n    }\n    cout << sum << \"\\n\";\n    t--;\n  }\n}\n"}
{"label": "18", "index": "33347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100];\n  int i, j, k, c, d, l, sum[100] = {0}, min1, min2;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - l; j++) {\n\n          if (a[i][j] < min1)\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - l; j++) {\n          a[i][j] = a[i][j] - min1;\n        }\n      }\n\n      for (j = 0; j < n - l; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - l; i++) {\n\n          if (a[i][j] < min2)\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - l; i++) {\n          a[i][j] = a[i][j] - min2;\n        }\n      }\n\n      sum[k] = sum[k] + a[1][1];\n      if (l == n - 2)\n        break;\n      else {\n        for (c = 0; c < n - l; c++) {\n          for (d = 2; d < n - l; d++)\n            a[c][d - 1] = a[c][d];\n        }\n        for (c = 2; c < n - l; c++) {\n          for (d = 0; d < (n - 1 - l); d++)\n            a[c - 1][d] = a[c][d];\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33348", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, s = 0;\n  int a[200][200];\n  int(*p)[200] = a;\n  cin >> n;\n  m = n;\n  for (int q = 0; q < m; q++) {\n    s = 0;\n    n = m;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    for (int w = 0; w < m - 1; w++) {\n      for (int i = 0; i < n; i++) {\n        int l = *(*(p + i));\n        for (int j = 0; j < n; j++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      for (int j = 0; j < n; j++) {\n        int l = *(*(p) + j);\n        for (int i = 0; i < n; i++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      s = s + *(*(p + 1) + 1);\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n - 1; i++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      n--;\n    }\n    cout << s << endl;\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "33349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, sum = 0, a[100][100], k = 0; \n  int t = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) \n  {\n    sum = 0;\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int q = 0; q < n - 1; q++) \n    {\n      for (i = 0; i < n - q; i++) \n      {\n        t = a[i][0];\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - q; j++) \n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - q; j++) \n      {\n        t = a[0][j];\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j] - t; \n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - q - 1; i++) \n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - q - 1; j++) \n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], min, i, j, k, num, sum, n, m, x, y;\n  cin >> n;\n  for (num = 1; num <= n; num++) {\n    memset(b, 0, sizeof(b));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(b + i * n + j);\n      }\n\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      memset(a, 0, sizeof(a));\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(b + i * k + j);\n\n      for (i = 0; i < k; i++) {\n        min = 3000;\n        for (j = 0; j < k; j++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = 3000;\n        for (i = 0; i < k; i++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (i = 0; i < k; i++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n\n      memset(b, 0, sizeof(b));\n      sum = sum + a[k + 1];\n      x = -1;\n      for (i = 0; i < k; i++) {\n        if (i != 1) {\n          x++;\n          y = -1;\n          for (j = 0; j < k; j++)\n            if (j != 1) {\n              y++;\n              *(b + x * k + y - x) = *(a + i * k + j);\n            }\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33351", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum = 0;\n  cin >> n;\n  int i, j, k, h, p, q;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    int board[105][105] = {0};\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> board[i][j];\n      }\n    }\n    for (h = 0; h < n; h++) {\n      for (i = h; i < n; i++) {\n        int min = board[i][h];\n        for (j = h; j < n; j++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (j = h; j < n; j++) {\n          board[i][j] -= min;\n        }\n      }\n      for (j = h; j < n; j++) {\n        int min = board[h][j];\n        for (i = h; i < n; i++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (i = h; i < n; i++) {\n          board[i][j] -= min;\n        }\n      }\n      sum += board[h + 1][h + 1];\n      board[h + 1][h + 1] = board[h][h];\n      for (p = h + 2; p < n; p++) {\n        board[h + 1][p] = board[h][p];\n      }\n      for (p = h + 2; p < n; p++) {\n        board[p][h + 1] = board[p][h];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33352", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n][n], b[n], min1[n], min2[n], c[n][n - 1], sum[n];\n  int i, j, k, l, p;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[k][i][j];\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1[i] = a[k][i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[k][i][j] <= min1[i])\n            min1[i] = a[k][i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[k][i][j] = a[k][i][j] - min1[i];\n      }\n      for (j = 0; j < n - l; j++) {\n        min2[j] = a[k][0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[k][i][j] <= min2[j]) {\n            min2[j] = a[k][i][j];\n          }\n        }\n        for (i = 0; i < n - l; i++)\n          a[k][i][j] = a[k][i][j] - min2[j];\n      }\n      c[k][l] = a[k][1][1];\n      sum[k] = sum[k] + c[k][l];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1 - l; i++) {\n          a[k][i][j] = a[k][i + 1][j];\n        }\n      for (i = 0; i < n - 1 - l; i++)\n        for (j = 1; j < n - 1 - l; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33353", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  int a[105][105] = {0};\n  while (cin >> a[0][0]) {\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        if (i == 0 && j == 0)\n          continue;\n        cin >> a[i][j];\n      }\n    }\n\n    int tmp = n;\n    int sum = 0;\n    while (--tmp) {\n      int tmp_min;\n\n      for (i = 0; i < tmp + 1; ++i) {\n        tmp_min = 600000;\n        for (j = 0; j < tmp + 1; ++j) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (j = 0; j < tmp + 1; ++j) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n\n      for (j = 0; j < tmp + 1; ++j) {\n        tmp_min = 600000;\n        for (i = 0; i < tmp + 1; ++i) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (i = 0; i < tmp + 1; ++i) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 2; i < tmp + 1; ++i) {\n        a[0][i - 1] = a[0][i];\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i < tmp + 1; ++i) {\n        for (j = 2; j < tmp + 1; ++j)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33354", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        int min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        int min = a[0][j];\n        for (k = 0; k < n - l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < n - l - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - l; j++)\n        a[j][0] = a[j + 1][0];\n      for (j = 1; j < n - l - 1; j++)\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[110][110], i, j, x, min = 10000, sum = 0, k;\n  int(*p)[110] = a;\n  cin >> x;\n  for (k = 1; k <= x; k++) {\n    sum = 0;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= x; j++)\n        cin >> *(*(p + i) + j);\n    for (n = x; n >= 2; n--) {\n      for (i = 1; i <= n; i++) {\n        min = 100000;\n        for (j = 1; j <= n; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 1; j <= n; j++) {\n        min = 100000;\n        for (i = 1; i <= n; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 2) + 2);\n      for (i = 2; i <= n - 1; i++)\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (j = 2; j <= n - 1; j++)\n        for (i = 1; i <= n; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33356", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, n, j, k, min, sum;\n  scanf(\"%d \", &p);\n  int a[100][100];\n  n = p;\n  for (int i = 0; i < p; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    do {\n\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] -= min;\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      for (j = 1; j < n; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      n--;\n    } while (n > 1);\n    cout << sum << endl;\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, a[100][100], min, sum;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    k = n;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = 100000;\n        for (j = 0; j < k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 100000;\n        for (i = 0; i < k; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        if (min == 0)\n          continue;\n        else\n          for (i = 0; i < k; i++)\n            a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < k - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < k - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      k--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33358", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint jieguo(int n) {\n  int min = 10000;\n  int p = 0, i = 0, j = 0, sum = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    return a[1][1];\n  } else {\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[i][j]) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = 10000;\n      for (j = 0; j < n; j++) {\n        if (min > a[j][i]) {\n          min = a[j][i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum = a[1][1];\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        a[j][i] = a[j][i + 1];\n      }\n    }\n    return (sum + jieguo(n - 1));\n  }\n}\nint main() {\n  int n = 0, k = 0, i = 0, j = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      a[i][j] = 0;\n    }\n  }\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    cout << jieguo(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, p, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (p = n; p >= 1; p--) {\n      for (i = 0; i <= p; i++) {\n        a[0][i] = 99999;\n        a[i][0] = 99999;\n      }\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[i][0] > a[i][j])\n            a[i][0] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[i][0];\n      for (i = 1; i <= p; i++) {\n        for (j = 1; j <= p; j++) {\n          if (a[0][j] > a[i][j])\n            a[0][j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i][j] -= a[0][j];\n      sum += a[2][2];\n      for (i = 1; i <= p; i++) {\n        a[2][i] = 0;\n        a[i][2] = 0;\n      }\n      for (i = 1; i <= p; i++)\n        for (j = 3; j <= p; j++)\n          a[i][j - 1] = a[i][j];\n      for (i = 3; i <= p; i++)\n        for (j = 1; j <= p; j++)\n          a[i - 1][j] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33360", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int(*p)[100];\n  int jz[100][100];\n  cin >> num;\n  int x = num;\n  int min = 9999;\n  p = jz;\n  for (int i = 1; i <= num; i++) {\n    x = num;\n    int sum = 0;\n    for (int k = 0; k < x; k++)\n      for (int j = 0; j < x; j++)\n        cin >> *(*(p + k) + j);\n\n    while (x >= 0) {\n\n      for (int k = 0; k < x; k++) {\n        for (int j = 0; j < x; j++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int j = 0; j < x; j++) {\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n        }\n        min = 9999;\n      }\n\n      for (int j = 0; j < x; j++) {\n        for (int k = 0; k < x; k++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int k = 0; k < x; k++) {\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n        }\n        min = 9999;\n      }\n\n      if (x > 1)\n        sum = sum + *(*(p + 1) + 1);\n\n      for (int k = 0; k < x; k++)\n        for (int j = 1; j < x - 1; j++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      for (int j = 0; j < x; j++)\n        for (int k = 1; k < x - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n      x--;\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[103][103];\nint FindMin(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[x][i] < ret)\n      ret = a[x][i];\n  return ret;\n}\nint FindMin1(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[i][x] < ret)\n      ret = a[i][x];\n  return ret;\n}\nint main() {\n  int n, q;\n  cin >> n;\n  int sum = 0;\n  q = n;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    q = n;\n    for (int h = 0; h < n; h++)\n      for (int l = 0; l < n; l++)\n        cin >> a[h][l];\n    while (1) {\n      if (q == 1) {\n        cout << sum << endl;\n        break;\n      }\n      \n      int t;\n      for (int i = 0; i < q; i++) {\n        t = FindMin(i, q);\n        for (int j = 0; j < q; j++)\n          a[i][j] -= t;\n      }\n      for (int j = 0; j < q; j++) {\n        t = FindMin1(j, q);\n        for (int i = 0; i < q; i++)\n          a[i][j] -= t;\n      }\n      sum += a[1][1];\n      \n      for (int i = 1; i < q - 1; i++)\n        for (int j = 0; j < q; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < q - 1; j++)\n        for (int i = 0; i < q; i++)\n          a[i][j] = a[i][j + 1];\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint array_1[101][101];\nint search_x(int k) {\n  int i, j;\n  int t = 1000;\n  for (j = 0; j < n; j++)\n    if (*(*(array_1 + 0) + j) < t)\n      t = *(*(array_1 + 0) + j);\n  for (j = 0; j < n; j++)\n    *(*(array_1 + 0) + j) = *(*(array_1 + 0) + j) - t;\n\n  for (i = k; i < n; i++) {\n    t = 1000;\n    for (j = 0; j < n; j++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (j = 0; j < n; j++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint search_y(int k) {\n  int i, j;\n  int t = 1000;\n  for (i = 0; i < n; i++)\n    if (*(*(array_1 + i) + 0) < t)\n      t = *(*(array_1 + i) + 0);\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + 0) = *(*(array_1 + i) + 0) - t;\n  for (j = k; j < n; j++) {\n    t = 1000;\n    for (i = 0; i < n; i++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (i = 0; i < n; i++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint change(int k) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + k) = 1000;\n  for (j = 0; j < n; j++)\n    *(*(array_1 + k) + j) = 1000;\n  return 0;\n}\nint main() {\n\n  int i, j, k, w;\n  int num;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    num = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(array_1 + i) + j);\n\n    for (k = 0; k < n; k++) {\n      search_x(k + 1);\n      search_y(k + 1);\n      num = num + *(*(array_1 + k + 1) + k + 1);\n      change(k + 1);\n    }\n\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33363", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint jz(int a[100][100], int k) {\n  int sum = 0, min, i, j, b, judge = 0;\n  for (b = k; b > 1; b--) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 1; j < b; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < b; j++)\n        a[i][j] = a[i][j] - min;\n    }\n    for (i = 0; i < b; i++) {\n      judge = 0;\n      for (j = 1; j < b; j++) {\n        if (a[j][i] == 0) {\n          judge = 1;\n          break;\n        }\n      }\n      if (judge == 0) {\n        min = a[0][i];\n        for (j = 1; j < b; j++) {\n          if (a[j][i] < min) {\n            min = a[j][i];\n          }\n        }\n        for (j = 0; j < b; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[i][j - 1] = a[i][j];\n      }\n    }\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[j - 1][i] = a[j][i];\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k, num[100][100], ans[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> num[j][k];\n      }\n    }\n    ans[i] = jz(num, n);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", ans[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], n;\n  scanf(\"%d\", &n);\n  int nn = n, min, s, i, j, nnn = n;\n  while (nn--) {\n    n = nnn;\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = 1000000;\n        for (j = 0; j < n; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 1000000;\n        for (i = 0; i < n; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < n; i++)\n          *(*(a + i) + j) -= min;\n      }\n      s = s + *(*(a + 1) + 1);\n      for (i = 1; i < n - 1; i++) {\n        *((*a) + i) = *((*a) + i + 1);\n      }\n      for (i = 1; i < n - 1; i++) {\n        *(*(a + i)) = *(*(a + i + 1));\n      }\n      for (i = 1; i < n; i++) {\n        for (j = 1; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j + 1);\n      }\n\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, min, n0, a[100][100] = {0}, temp[100][100];\n  scanf(\"%d \", &n0);\n  for (int z = 0; z < n0; ++z) {\n    s = 0;\n    for (int i = 0; i < n0; ++i)\n      for (int j = 0; j < n0; ++j) {\n        cin >> a[i][j];\n      }\n    for (int n = n0; n > 1; --n) {\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[k][l];\n          else\n            min = min > a[k][l] ? a[k][l] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[k][l] -= min;\n        }\n      }\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[l][k];\n          else\n            min = min > a[l][k] ? a[l][k] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[l][k] -= min;\n        }\n      }\n\n      s += a[1][1];\n      for (int i = 0; i < n; ++i)\n        for (int j = 0; j < n; ++j) {\n          temp[i][j] = a[i][j];\n        }\n      for (int i = 2; i < n; ++i) {\n        a[i - 1][0] = temp[i][0];\n      }\n      for (int i = 2; i < n; ++i) {\n        a[0][i - 1] = temp[0][i];\n      }\n      for (int i = 2; i < n; ++i)\n        for (int j = 2; j < n; ++j) {\n          a[i - 1][j - 1] = temp[i][j];\n        }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33366", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid f1(int n, int a[100][100]) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[i][0], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[i][j])\n        x = a[i][j];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[i][j] -= x;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[0][i], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[j][i])\n        x = a[j][i];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[j][i] -= x;\n  }\n}\n\nvoid f2(int n, int a[100][100]) {\n  int i, j;\n  for (i = 1; i <= n - 2; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; i++)\n    for (j = 1; j <= n - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\n\nint loop(int n, int a[100][100]) {\n  f1(n, a);\n  int x = a[1][1];\n\n  if (n == 2)\n    return a[1][1];\n  else {\n    f2(n, a);\n    return x + loop(n - 1, a);\n  }\n}\n\nint main(void) {\n  int t, n;\n  scanf(\"%d\", &n);\n  for (t = 1; t <= n; t++) {\n    int a[100][100], i, j;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    printf(\"%d\\n\", loop(n, a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33367", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n;\n  m = n;\n  int sum = 0;\n  for (int i = 0; i < m; i++) {\n    n = m;\n    int a[100][100];\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    while (n > 1) {\n      for (int j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        int min = a[0][j];\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int k = 0; k < n; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], b[100], c[100], i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = n, l = 0;\n    while (sum > 1) {\n      for (i = 0; i < sum; i++) {\n        b[i] = a[i][0];\n        for (j = 0; j < sum; j++) {\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n        }\n        for (j = 0; j < sum; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (j = 0; j < sum; j++) {\n        c[j] = a[0][j];\n        for (i = 0; i < sum; i++) {\n          if (a[i][j] < c[j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < sum; i++)\n          a[i][j] = a[i][j] - c[j];\n      }\n      l = l + a[1][1];\n      for (i = 0; i < sum; i++) {\n        for (j = 1; j < sum - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < sum; j++) {\n        for (i = 1; i < sum - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      sum--;\n    }\n    printf(\"%d\\n\", l);\n  }\n}\n"}
{"label": "18", "index": "33369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid f1(int n, int a[100][100]) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[i][0], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[i][j])\n        x = a[i][j];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[i][j] -= x;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[0][i], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[j][i])\n        x = a[j][i];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[j][i] -= x;\n  }\n}\n\nvoid f2(int n, int a[100][100]) {\n  int i, j;\n  for (i = 1; i <= n - 2; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; i++)\n    for (j = 1; j <= n - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\n\nint loop(int n, int a[100][100]) {\n  f1(n, a);\n  int x = a[1][1];\n\n  if (n == 2)\n    return a[1][1];\n  else {\n    f2(n, a);\n    return x + loop(n - 1, a);\n  }\n}\n\nint main(void) {\n  int t, n;\n  scanf(\"%d\", &n);\n  for (t = 1; t <= n; t++) {\n    int a[100][100], i, j;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    printf(\"%d\\n\", loop(n, a));\n  }\n}\n"}
{"label": "18", "index": "33370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\nint n;\n\nint search(int m) {\n  int i, j, min;\n  if (m > n)\n    return 0;\n\n  for (i = 1; i <= n; i++)\n    if (a[i][0] != -1) {\n      min = 99999999;\n      for (j = 1; j <= n; j++)\n        if ((a[0][j] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (j = 1; j <= n; j++)\n        if (a[0][j] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n\n  for (j = 1; j <= n; j++)\n    if (a[0][j] != -1) {\n      min = 99999999;\n      for (i = 1; i <= n; i++)\n        if ((a[i][0] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (i = 1; i <= n; i++)\n        if (a[i][0] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n  i = a[m][m];\n  a[m][0] = -1;\n  a[0][m] = -1;\n  return (i + search(m + 1));\n}\nint main() {\n  int i, j, t;\n  scanf(\"%d \", &n);\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= n; i++) {\n      a[0][i] = 0;\n      a[i][0] = 0;\n    }\n    cout << search(2) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[100][100][100];\nint main() {\n  int min, sum[100] = {0};\n  cin >> n;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[k][i][j];\n  for (int r = n; r > 1; r--) {\n    for (int k = 0; k < n; k++) {\n      for (int i = 0; i < r; i++) {\n        min = a[k][i][0];\n        for (int j = 1; j < r; j++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int j = 0; j < r; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n    }\n\n    for (int k = 0; k < n; k++)\n      for (int j = 0; j < r; j++) {\n        min = a[k][0][j];\n        for (int i = 1; i < r; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int i = 0; i < r; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n    for (int k = 0; k < n; k++) {\n      sum[k] = sum[k] + a[k][1][1];\n      for (int i = 1; i < r - 1; i++)\n        a[k][i][0] = a[k][i + 1][0];\n      for (int j = 1; j < r - 1; j++)\n        a[k][0][j] = a[k][0][j + 1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 1; j < r - 1; j++)\n          a[k][i][j] = a[k][i + 1][j + 1];\n    }\n  }\n\n  for (int k = 0; k < n; k++)\n    cout << sum[k] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33372", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int n = 0, i, j, k, q = 0, l, m, s = 0;\n  cin >> n;\n  k = n;\n  while (q < k) {\n    s = 0;\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++)\n        cin >> a[i][j];\n    }\n    n = k;\n    for (m = 1; m <= k - 1; m++) {\n      for (i = 0; i < n; i++) {\n        l = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (l > a[i][j])\n            l = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - l;\n      }\n      for (i = 0; i < n; i++) {\n        l = a[0][i];\n        for (j = 0; j < n; j++) {\n          if (l > a[j][i])\n            l = a[j][i];\n        }\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - l;\n      }\n      s = a[1][1] + s;\n\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n - 1; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << s << endl;\n    q++;\n  }\n\n  return (0);\n}\n"}
{"label": "18", "index": "33373", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, n1, p, q;\nint matrix(int a[][101]);\nint mi(int a[]);\nvoid xiao(int a[][101]);\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    n1 = n;\n    int a[101][101];\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        scanf(\"%d \", &a[p][q]);\n    printf(\"%d\\n\", matrix(a));\n  }\n  return 0;\n}\nint matrix(int a[][101]) {\n  int i, j, sum = 0;\n  int smin[101], dmin[101], t[101][101];\n\n  for (i = 0; i < n1; i++)\n    smin[i] = mi(a[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (smin[i] != 0) {\n        a[i][j] -= smin[i];\n      }\n  for (j = 0; j < n1; j++)\n    for (i = 0; i < n1; i++)\n      t[j][i] = a[i][j];\n  for (i = 0; i < n1; i++)\n    dmin[i] = mi(t[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (dmin[i] != 0)\n        a[j][i] -= dmin[i];\n  sum = a[1][1];\n  if (n1 == 2)\n    return a[1][1];\n  xiao(a);\n  n1--;\n  sum = sum + matrix(a);\n  return sum;\n}\nint mi(int a[]) {\n  int i, min = a[0];\n  for (i = 0; i < n1; i++)\n    if (a[i] <= min)\n      min = a[i];\n  return min;\n}\nvoid xiao(int a[][101]) {\n  int i, j;\n  for (i = 1; i < n1; i++)\n    a[0][i] = a[0][i + 1];\n  a[0][i] = 0;\n  for (j = 1; j < n1; j++) {\n    for (i = 1; i < n1; i++)\n      a[j][i] = a[j + 1][i + 1];\n    a[j][i] = 0;\n  }\n  for (i = 1; i < n1; i++)\n    a[i][0] = a[i + 1][0];\n\n  for (i = 0; i < n1; i++)\n    a[n - 1][i] = 0;\n}\n"}
{"label": "18", "index": "33374", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, count = 0;\n  cin >> n;\n  while (count < n) {\n    int input[100][100], sum = 0;\n    int(*p)[100];\n    p = input;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 0; i < n - 1; i++) {\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + j) + k) < min)\n            min = *(*(p + j) + k);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + j) + k) -= min;\n      }\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + k) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + j) + k) = *(*(p + j) + k + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n    }\n    cout << sum << endl;\n    count++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int n) {\n  if (n == 1) {\n    return 0;\n  }\n  int i, j, p, min, a11;\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < a[i][p]) {\n        p = j;\n      }\n    }\n    min = a[i][p];\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < a[p][i]) {\n        p = j;\n      }\n    }\n    min = a[p][i];\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  a11 = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i - 1] = a[j][i];\n    }\n  }\n  return a11 + sum(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n) << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33376", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint smaller(int, int);\n\nint main() {\n  int n, a[101][101], i, j, k, min, count;\n  cin >> n;\n  count = n;\n  for (k = 1; k <= count; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    n = count;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33377", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[103][103];\nint FindMin(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[x][i] < ret)\n      ret = a[x][i];\n  return ret;\n}\nint FindMin1(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[i][x] < ret)\n      ret = a[i][x];\n  return ret;\n}\nint main() {\n  int n, q;\n  scanf(\"%d \", &n);\n  int sum = 0;\n  q = n;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    q = n;\n    for (int h = 0; h < n; h++)\n      for (int l = 0; l < n; l++)\n        scanf(\"%d \", &a[h][l]);\n    while (1) {\n      if (q == 1) {\n        printf(\"%d\\n\", sum);\n        break;\n      }\n\n      int t;\n      for (int i = 0; i < q; i++) {\n        t = FindMin(i, q);\n        for (int j = 0; j < q; j++)\n          a[i][j] -= t;\n      }\n      for (int j = 0; j < q; j++) {\n        t = FindMin1(j, q);\n        for (int i = 0; i < q; i++)\n          a[i][j] -= t;\n      }\n      sum += a[1][1];\n\n      for (int i = 1; i < q - 1; i++)\n        for (int j = 0; j < q; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < q - 1; j++)\n        for (int i = 0; i < q; i++)\n          a[i][j] = a[i][j + 1];\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrixHor[103][103];\nint matrixVer[103][103];\n\nint min(int line[], int n) {\n  int mini = 100000;\n  for (int i = 1; i <= n; i++) {\n    if (line[i] < mini) {\n      mini = line[i];\n    }\n  }\n  return mini;\n}\nint main() {\n  int n, N;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    int sum = 0;\n    N = n;\n    for (int j = 1; j <= N; j++) {\n      for (int k = 1; k <= N; k++) {\n        cin >> matrixVer[j][k];\n        matrixHor[k][j] = matrixVer[j][k];\n      }\n    }\n    for (int h = 1; h < n; h++) {\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixVer[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j][k] - minim;\n          matrixHor[k][j] = matrixVer[j][k];\n        }\n      }\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixHor[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixHor[j][k] = matrixHor[j][k] - minim;\n          matrixVer[k][j] = matrixHor[j][k];\n        }\n      }\n      sum = sum + matrixVer[2][2];\n      N = N - 1;\n      for (int j = 2; j <= N; j++) {\n        for (int k = 2; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j + 1][k + 1];\n          matrixHor[j][k] = matrixHor[j + 1][k + 1];\n        }\n      }\n      for (int j = 2; j <= N; j++) {\n        matrixHor[1][j] = matrixHor[1][j + 1];\n        matrixVer[j][1] = matrixHor[1][j];\n        matrixVer[1][j] = matrixVer[1][j + 1];\n        matrixHor[j][1] = matrixVer[1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33379", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, arr[100][100], i, j, k, l, min, sum = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> arr[i][j];\n      }\n    }\n    for (l = n; l > 1; l--) {\n      for (i = 0; i < l; i++) {\n        min = arr[i][0];\n        for (j = 1; j < l; j++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      for (j = 0; j < l; j++) {\n        min = arr[0][j];\n        for (i = 1; i < l; i++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (i = 0; i < l; i++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      sum = sum + arr[1][1];\n      for (i = 1; i < l; i++) {\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i + 1][j];\n        }\n      }\n      for (j = 1; j < l; j++) {\n        for (i = 0; i < l - 1; i++) {\n          arr[i][j] = arr[i][j + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    memset(arr, 0, sizeof(arr));\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33380", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  int min, sum;\n\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n\n    n = m;\n    sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (n > 1) {\n\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      n--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nchar mn[] = {3, 9, 31};\n\nint xn = 0;\n\nint max_files = sizeof(mn) / sizeof(mn[0]);\n\nchar *output_dir = \"data\";\n\nint rnd(int min, int max) {\n  return min + ((rand() << 15) | rand()) % (max - min + 1);\n}\n\nvoid xbuild() {\n  int i, j, k, n;\n  n = mn[xn];\n  printf(\"%d\\n\", n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      printf(\"%d\", rnd(1, n * n));\n      for (j = 1; j < n; j++) {\n        printf(\" %d\", rnd(1, n * n));\n      }\n      printf(\"\\n\");\n    }\n  }\n  xn++;\n}\n"}
{"label": "18", "index": "33381", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, l, m;\n  double a[100][100];\n  int min;\n  int sum = 0;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 1; l < n; l++) {\n\n      for (j = 0; j < n; j++) {\n        k = 0;\n        while (a[j][k] < 0)\n          k++;\n        while (k < n) {\n          min = a[j][k];\n          for (; k < n; k++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (k = 0; k < n; k++)\n            a[j][k] -= min;\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        j = 0;\n        while (a[j][k] < 0)\n          j++;\n        while (j < n) {\n          min = a[j][k];\n          for (j = 1; j < n; j++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (j = 0; j < n; j++)\n            a[j][k] -= min;\n        }\n      }\n\n      sum += a[l][l];\n      for (m = 0; m < n; m++) {\n        a[l][m] = -1;\n        a[m][l] = -1;\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33382", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, q, i, j, min1[100], min2[100], a[100][100], d, w;\n  cin >> n;\n  w = n;\n  for (q = 0; q < w; q++) {\n\n    d = 0;\n    n = w;\n    for (i = 0; i < w; i++) {\n      for (j = 0; j < w; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (n >= 2) {\n      for (i = 0; i < n; i++)\n        min1[i] = 1000;\n      for (i = 0; i < n; i++)\n        min2[i] = 1000;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (min1[i] > a[i][j]) {\n            min1[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min1[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (min2[j] > a[i][j]) {\n            min2[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min2[j];\n        }\n      }\n      d += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (i = 2; i < n; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", d);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n  int min = a[hang][1];\n  for (i = 1; i <= geshu; i++) {\n    if (a[hang][i] < min)\n      min = a[hang][i];\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = a[1][lie];\n  for (i = 1; i <= geshu; i++) {\n    if (a[i][lie] < min)\n      min = a[i][lie];\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  scanf(\"%d \", &n);\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[mm][i] = a[mm][i] - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[i][mm] = a[i][mm] - Minlie;\n      }\n\n      sum += a[2][2];\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[ii][i - 1] = a[ii][i];\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[i - 1][ii] = a[i][ii];\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33384", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[n][n];\n\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int a11 = 0;\n\n    for (int p = n; p >= 2; p--) {\n\n      for (int j = 0; j < p; j++) {\n        int min = a[j][0];\n        for (int k = 1; k < p; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[j][k] -= min;\n      }\n\n      for (int j = 0; j < p; j++) {\n        int min = a[0][j];\n        for (int k = 1; k < p; k++) {\n          if (a[k][j] < min) {\n            min = a[k][j];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[k][j] -= min;\n      }\n      a11 += a[1][1];\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", a11);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33385", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nvoid putout(int a[200][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[200][200], int b, int num) \n{\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[200][200], int b, int num) \n{\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[200][200], int num, int out) \n{\n  for (int i = 0; i < num; i++) \n    cut1(a, i, num);\n  for (int i = 0; i < num; i++) \n    cut2(a, i, num);\n  out = out + a[1][1];              \n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--; \n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[200][200]; \n    memset(a, 0, 40000);\n    for (int i = 0; i < n; i++) \n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0); \n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33386", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum = 0;\nint n;\nvoid rows(int num);\nvoid columns(int num);\nvoid deletes(int num);\nint main(void) {\n\n  cin >> n;\n  for (int q = 1; q <= n; q++) {\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      rows(i);\n      columns(i);\n      sum = sum + a[2][2];\n      deletes(i);\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\nvoid rows(int num) {\n  int min1[100];\n  for (int i = 1; i <= n + 1 - num; i++)\n    min1[i] = a[i][1];\n\n  for (int i = 1; i <= n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      if (min1[i] > a[i][j]) {\n        min1[i] = a[i][j];\n      }\n    }\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i][j] - min1[i];\n    }\n  }\n}\nvoid columns(int num) {\n  int min2[100];\n  for (int j = 1; j <= n + 1 - num; j++) {\n    min2[j] = a[1][j];\n  }\n  for (int j = 1; j <= n + 1 - num; j++) {\n    for (int i = 1; i <= n + 1 - num; i++) {\n      if (min2[j] > a[i][j]) {\n        min2[j] = a[i][j];\n      }\n    }\n    for (int i = 1; i <= n + 1 - num; i++) {\n      a[i][j] = a[i][j] - min2[j];\n    }\n  }\n}\nvoid deletes(int num) {\n  for (int i = 2; i < n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (int j = 2; j < n + 1 - num; j++) {\n    for (int i = 1; i < n + 1 - num; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33387", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int q;\n  int a[110][110];\n  int(*p)[110] = a;\n  scanf(\"%d \", &n);\n  q = n;\n  for (k = 1; k <= q; k++) {\n    int sum = 0;\n    n = q;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    while (1) {\n      if (n == 1)\n        break;\n      int min = 0;\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + j) + i))\n            min = *(*(p + j) + i);\n        for (j = 1; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      sum += a[2][2];\n      for (i = 2; i <= n - 1; i++)\n        for (j = 2; j <= n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      for (i = 2; i <= n - 1; i++) {\n        *(*(p + 1) + i) = *(*(p + 1) + i + 1);\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33388", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  static int s = 0;\n  int i, j;\n  double m1, m2;\n  int *p;\n\n  if (n == 1) {\n    printf(\"%d \", s);\n    s = 0;\n  }\n\n  if (n > 1) {\n    for (i = 0; i < n; i++) {\n      p = a[i];\n      m1 = 100000;\n      for (j = 0; j < n; j++)\n        if (p[j] <= m1)\n          m1 = p[j];\n      for (j = 0; j < n; j++)\n        p[j] = p[j] - m1;\n    }\n\n    for (j = 0; j < n; j++) {\n      m2 = 100000;\n      for (i = 0; i < n; i++)\n        if (a[i][j] <= m2)\n          m2 = a[i][j];\n      for (i = 0; i < n; i++)\n        a[i][j] -= m2;\n    }\n\n    s += a[1][1];\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (i = 0; i < n - 1; i++)\n        a[i][j] = a[i][j + 1];\n    }\n\n    f(a, n - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    f(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33389", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint a[100][100];\n\nint sum(int n) {\n  if (n == 1) {\n    return 0;\n  }\n  int i, j, p, min, a11;\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < a[i][p]) {\n        p = j;\n      }\n    }\n    min = a[i][p];\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 0;\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < a[p][i]) {\n        p = j;\n      }\n    }\n    min = a[p][i];\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  a11 = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i - 1] = a[j][i];\n    }\n  }\n  return a11 + sum(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; ++k) {\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        scanf(\"%d \", &a[i][j]);\n    int total = 0;\n    for (int t = 0; t < n - 1; ++t) {\n      for (int i = 0; i < n; ++i) {\n        if (i != 0 && i <= t)\n          continue;\n        int minValue = a[i][0];\n        for (int j = t + 1; j < n; ++j)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[i][0] -= minValue;\n        for (int j = t + 1; j < n; ++j)\n          a[i][j] -= minValue;\n      }\n      for (int j = 0; j < n; ++j) {\n        if (j != 0 && j <= t)\n          continue;\n        int minValue = a[0][j];\n        for (int i = t + 1; i < n; ++i)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[0][j] -= minValue;\n        for (int i = t + 1; i < n; ++i)\n          a[i][j] -= minValue;\n      }\n      total += a[t + 1][t + 1];\n    }\n    cout << total << endl;\n  }\n}\n"}
{"label": "18", "index": "33391", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, n, sum = 0, k, l, min;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (l = 1; l < n; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33392", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, sum = 0;\n  int a[100][100], b[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[j][0];\n        for (k = 1; k < n - m; k++) {\n          if (a[j][k] < b[j]) {\n            b[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j][k] - b[j];\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[0][j];\n        for (k = 1; k < n - m; k++) {\n          if (a[k][j] < b[j]) {\n            b[j] = a[k][j];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[k][j] = a[k][j] - b[j];\n        }\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - 1 - m; k++) {\n          a[k][j] = a[k][j + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33393", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101], n;\nint rowmin(int i) {\n  int minr = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i][i1] < minr && a[i][i1] >= 0) {\n      minr = a[i][i1];\n    }\n  }\n  return minr;\n}\nint colmin(int i) {\n  int minc = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i1][i] < minc && a[i1][i] >= 0) {\n      minc = a[i1][i];\n    }\n  }\n  return minc;\n}\nint main() {\n  int t, k, sum, min, minc, i, j;\n  scanf(\"%d \", &n);\n  for (t = 1; t <= n; t++) {\n    k = 1;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    while (k < n) {\n      for (i = 0; i < n; i++) {\n        min = rowmin(i);\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = colmin(i);\n        for (j = 0; j < n; j++) {\n          a[j][i] -= min;\n        }\n      }\n      sum += a[k][k];\n      for (i = 0; i < n; i++) {\n        a[i][k] = -1;\n      }\n      for (i = 0; i < n; i++) {\n        a[k][i] = -1;\n      }\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33394", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint juzhen[101][101];\nint sum;\nvoid xiaochu(int n) {\n  if (n == 1)\n    ;\n  else {\n    int minj[101];\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (juzhen[i][j] < minj[i])\n          minj[i] = juzhen[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        juzhen[i][j] = juzhen[i][j] - minj[i];\n    }\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int j = 0; j < n; j++) {\n      for (int i = 0; i < n; i++) {\n        if (juzhen[i][j] < minj[j])\n          minj[j] = juzhen[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        juzhen[i][j] = juzhen[i][j] - minj[j];\n    }\n    sum = sum + juzhen[1][1];\n    for (int j = 1; j < n - 1; j++) {\n      juzhen[0][j] = juzhen[0][j + 1];\n      juzhen[j][0] = juzhen[j + 1][0];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i + 1][j + 1];\n    xiaochu(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    sum = 0;\n    xiaochu(n);\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) \n  {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) \n  {\n    h = n;\n    for (q = 1; q <= n - 1; q++) \n    {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][i][k] = a[p][i][k] - min;\n        }\n      } \n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][k][j] = a[p][k][j] - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        a[p][2][i] = 0;\n      for (j = 1; j <= h; j++)\n        a[p][j][2] = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][j][i - 1] = a[p][j][i];\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][i - 1][j] = a[p][i][j];\n        }\n      }\n      h -= 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint w[150][150];\nint m[150];\nint main() {\n  cin >> n;\n  for (int _n = 0; _n < n; _n++) {\n    memset(w, 0, sizeof(w));\n    int s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    for (int t = 1; t < n; t++) {\n\n      for (int i = 0; i < n; i++) {\n        if ((i < t) && i)\n          continue;\n        m[i] = w[i][0];\n        for (int j = t; j < n; j++)\n          if (w[i][j] < m[i]) {\n            m[i] = w[i][j];\n          }\n        w[i][0] -= m[i];\n        for (int j = t; j < n; j++)\n          w[i][j] -= m[i];\n      }\n      for (int j = 0; j < n; j++) {\n        if ((j < t) && j)\n          continue;\n        m[j] = w[0][j];\n        for (int i = t; i < n; i++)\n          if (w[i][j] < m[j])\n            m[j] = w[i][j];\n        w[0][j] -= m[j];\n        for (int i = t; i < n; i++)\n          w[i][j] -= m[j];\n      }\n      s += w[t][t];\n    }\n\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33397", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\n\nint q[100][100];\n\nvoid op(int n) {\n  if (n != 1) {\n    int rm[n], cm[n];\n    for (int i = 0; i < n; i++) {\n      rm[i] = q[i][0];\n      cm[i] = q[0][i];\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (rm[i] >= q[i][j]) {\n          rm[i] = q[i][j];\n        }\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - rm[i];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (cm[j] >= q[i][j]) {\n          cm[j] = q[i][j];\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - cm[j];\n      }\n    }\n\n    sum += q[1][1];\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n; j++) {\n        q[i][j] = q[i][j + 1];\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i + 1][j];\n      }\n    }\n    op(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int s = 1; s <= n; s++) {\n    for (int a = 0; a < n; a++) {\n      for (int b = 0; b < n; b++) {\n        cin >> q[a][b];\n      }\n    }\n    op(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33398", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[111][111], sum;\n  int i, j, k, l, Min;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    for (j = 1; j < n; j++) {\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[1][l]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++)\n        a[1][l] = a[1][l] - Min;\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[k][l]);\n        }\n        Min = min(Min, a[k][1]);\n        for (l = j + 1; l <= n; l++) {\n          a[k][l] = a[k][l] - Min;\n        }\n        a[k][1] = a[k][1] - Min;\n      }\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[l][1]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++) {\n        a[l][1] = a[l][1] - Min;\n      }\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[l][k]);\n        }\n        Min = min(Min, a[1][k]);\n        for (l = j + 1; l <= n; l++) {\n          a[l][k] = a[l][k] - Min;\n        }\n        a[1][k] = a[1][k] - Min;\n      }\n      sum = sum + a[j + 1][j + 1];\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int a[100][100], int);\nint main() {\n  int n, a[100][100], i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", cut(a, n));\n  }\n  return 0;\n}\nint cut(int a[100][100], int n) {\n  int i, j, min, count;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      min = (min > a[i][j]) ? a[i][j] : min;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      min = (min > a[j][i]) ? a[j][i] : min;\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  count = a[1][1];\n  if (n == 2)\n    return count;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  }\n  return (cut(a, n - 1) + count);\n}\n"}
{"label": "18", "index": "33400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, m = 0;\n  cin >> n;\n\n  for (t = 0; t < n; t++) \n  {\n    int arr[100][100];\n    int i = 0, j = 0, k = 0, sum = 0, m = n; \n    for (i = 0; i < n; i++)                  \n      for (j = 0; j < n; j++)\n        cin >> arr[i][j];\n    for (i = 1; i < n; i++) \n    {\n      for (j = 0; j < m; j++) \n      {\n        int min = arr[j][0];\n        for (k = 0; k < m; k++)\n          if (arr[j][k] < min)\n            min = arr[j][k];\n        for (k = 0; k < m; k++)\n          arr[j][k] -= min;\n      }\n      for (j = 0; j < m; j++) \n      {\n        int min = arr[0][j];\n        for (k = 0; k < m; k++)\n          if (arr[k][j] < min)\n            min = arr[k][j];\n        for (k = 0; k < m; k++)\n          arr[k][j] -= min;\n      }\n      sum += arr[1][1];       \n      for (j = 2; j < m; j++) \n      {\n        arr[0][j - 1] = arr[0][j];\n        arr[j - 1][0] = arr[j][0];\n      }\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++) {\n          arr[j - 1][k - 1] = arr[j][k];\n        }\n      m--; \n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33401", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  if (n == 1)\n    return 0;\n  int k = 0;\n  guiling(n);\n  k += a[1][1];\n  xiaojian(n);\n  n--;\n  return k + Sum(n);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33402", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nint a[100][100], b[100];\nvoid cut(int);\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cut(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid cut(int n) {\n  if (n > 1) {\n    int j, k;\n    for (j = 0; j < n; j++) {\n      b[j] = a[j][0];\n      for (k = 1; k < n; k++) {\n        if (a[j][k] < b[j]) {\n          b[j] = a[j][k];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j][k] - b[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      b[j] = a[0][j];\n      for (k = 1; k < n; k++) {\n        if (a[k][j] < b[j])\n          b[j] = a[k][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[k][j] = a[k][j] - b[j];\n      }\n    }\n    sum += a[1][1];\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j + 1][k];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n - 1; k++) {\n        a[k][j] = a[k][j + 1];\n      }\n    }\n    cut(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[120][120], m, s, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    m = n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    s = 0;\n    while (m >= 2) {\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[j][l] < a[j][d]) {\n            d = l;\n          }\n        }\n        d = a[j][d];\n        for (k = 0; k < m; k++) {\n          a[j][k] = a[j][k] - d;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[l][j] < a[d][j]) {\n            d = l;\n          }\n        }\n        d = a[d][j];\n        for (k = 0; k < m; k++) {\n          a[k][j] = a[k][j] - d;\n        }\n      }\n      s = s + a[1][1];\n      for (j = 0; j < m; j++) {\n        for (k = 2; k < m; k++) {\n          a[j][k - 1] = a[j][k];\n        }\n      }\n      for (j = 0; j < m - 1; j++) {\n        for (k = 2; k < m; k++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n      m--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33404", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint sum;\nvoid guiling(int a[100][100], int p) {\n  int t, s;\n  int min1, min2;\n  for (s = 0; s < p; s++) {\n    min1 = a[s][0];\n    for (t = 1; t < p; t++)\n      if (a[s][t] < min1)\n        min1 = a[s][t];\n    for (t = 0; t < p; t++)\n      a[s][t] = a[s][t] - min1;\n  }\n  for (t = 0; t < p; t++) {\n    min2 = a[0][t];\n    for (s = 1; s < p; s++)\n      if (a[s][t] < min2)\n        min2 = a[s][t];\n    for (s = 0; s < p; s++)\n      a[s][t] = a[s][t] - min2;\n  }\n  sum = sum + a[1][1];\n}\nvoid xiaojian(int a[100][100], int p) {\n  int i, j;\n  for (i = 0; i < p; i++)\n    for (j = 1; j < p - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < p - 1; j++)\n    for (i = 1; i < p - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int n;\n  int a[100][100];\n  int i, j, k, t;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (t = n; t >= 2; t--) {\n      guiling(a, t);\n      xiaojian(a, t);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33405", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int[][101], int);\nint main() {\n  int n, i, j, k;\n  int a[101][101];\n\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[][101], int n) {\n  int i, j, temp, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  temp = a[1][1];\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++) {\n      if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      if (j == 0 && i > 0)\n        a[i][j] = a[i + 1][j];\n      if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n    }\n\n  if (n == 1)\n    return 0;\n  else\n    return temp + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "33406", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101], n;\nint rowmin(int i) {\n  int minr = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i][i1] < minr && a[i][i1] >= 0) {\n      minr = a[i][i1];\n    }\n  }\n  return minr;\n}\nint colmin(int i) {\n  int minc = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i1][i] < minc && a[i1][i] >= 0)\n      minc = a[i1][i];\n  }\n  return minc;\n}\nint main() {\n  int t, k, sum, min, minc, i, j;\n  scanf(\"%d \", &n);\n  for (t = 1; t <= n; t++) {\n    k = 1;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    while (k < n) {\n      for (i = 0; i < n; i++) {\n        min = rowmin(i);\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = colmin(i);\n        for (j = 0; j < n; j++) {\n          a[j][i] -= min;\n        }\n      }\n      sum += a[k][k];\n      for (i = 0; i < n; i++) {\n        a[i][k] = -1;\n      }\n      for (i = 0; i < n; i++) {\n        a[k][i] = -1;\n      }\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33407", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint GuiLing(int a[][101], int n, int sum) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  } \n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }          \n  if (n > 2) \n  {\n    sum = sum + a[1][1];\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j]; \n    for (j = 2; j < n; j++)\n      for (i = 0; i < n - 1; i++)\n        a[i][j - 1] = a[i][j]; \n    return GuiLing(a, n - 1, sum);\n  } else\n    return sum + a[1][1];\n}\n\nint main() {\n  int n, i;\n  int a[101][101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << GuiLing(a, n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint mx[200][200];\nint nn, n, ans;\nint main() {\n  cin >> nn;\n  for (int q = 1; q <= nn; q++) {\n    ans = 0;\n    n = nn;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> mx[i][j];\n      }\n    }\n    for (; n >= 2; n--) {\n      int smin;\n      for (int i = 1; i <= n; i++) {\n        smin = mx[i][1];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[i][j] ? smin : mx[i][j];\n        for (int j = 1; j <= n; j++)\n          mx[i][j] -= smin;\n      }\n      for (int i = 1; i <= n; i++) {\n        smin = mx[1][i];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[j][i] ? smin : mx[j][i];\n        for (int j = 1; j <= n; j++)\n          mx[j][i] -= smin;\n      }\n      ans += mx[2][2];\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[i][j] = mx[i][j + 1];\n      }\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[j][i] = mx[j + 1][i];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33409", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid zero(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 1; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid trans(int a[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, k, a[100][100], i, j, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      zero(a, k);\n      sum += a[1][1];\n      trans(a, k);\n      k--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, number;\n  scanf(\"%d\", &n);\n  number = n;\n  for (i = 0; i < number; i++) {\n    int p, q, a[100][100], minnum[100], sum = 0;\n    for (p = 0; p < number; p++) {\n      for (q = 0; q < number; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    n = number;\n    while (n > 1) {\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          if (q == 0)\n            minnum[p] = a[p][q];\n          else if (minnum[p] > a[p][q])\n            minnum[p] = a[p][q];\n        }\n      }\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          a[p][q] = a[p][q] - minnum[p];\n        }\n      }\n      for (q = 0; q < n; q++) {\n        int tag = 0, min;\n        for (p = 0; p < n; p++) {\n          if (a[p][q] == 0)\n            tag = 1;\n          if (p == 0)\n            min = a[p][q];\n          else if (min > a[p][q])\n            min = a[p][q];\n        }\n        if (tag == 0) {\n          for (p = 0; p < n; p++) {\n            a[p][q] -= min;\n          }\n        }\n      }\n      sum += a[1][1];\n      n--;\n      for (j = 0, p = 0; p < n + 1; p++, j++) {\n        for (q = 0, k = 0; q < n + 1; q++, k++) {\n          if (p == 1)\n            p++;\n          if (q == 1)\n            q++;\n          a[j][k] = a[p][q];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33411", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, l, p;\nint sum = 0;\nint a[105][105];\n\nvoid g() {\n  int i, j;\n  int t;\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + i) + 1);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + i) + j) < t)\n        t = *(*(a + i) + j);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + i) + j) -= t;\n  }\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + 1) + i);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + j) + i) < t)\n        t = *(*(a + j) + i);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + j) + i) -= t;\n  }\n}\n\nvoid f() {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  for (j = 1; j <= n; j++)\n    for (i = 2; i <= n; i++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n}\nint main() {\n  int i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    for (p = 0; p < n; p++) {\n\n      g();\n      sum += (*(*(a + 2) + 2));\n      f();\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33412", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m, imin;\nint matrix[110][110];\nvoid submin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (matrix[x][y] < imin)\n    imin = matrix[x][y];\n\n  submin(x + dx, y + dy, dx, dy);\n  matrix[x][y] = matrix[x][y] - imin;\n}\nvoid sub() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[i][j] = matrix[i][j + 1];\n    }\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[j][i] = matrix[j + 1][i];\n    }\n}\nint main() {\n  int i, j, sum, t;\n  for (cin >> n, t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> matrix[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        imin = 10000;\n        submin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + matrix[1][1];\n      sub();\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33413", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint findmin(int *a, int n, int step) {\n  int min = 32767;\n  while (n > 0) {\n    if (min > *a)\n      min = *a;\n    a += step;\n    n--;\n  }\n  return min;\n}\n\nint main() {\n  int n, k, a[100][100], i, j, l, sum, t;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    sum = 0;\n    for (i = n; i >= 2; i--) {\n      for (j = 0; j < i; j++) {\n        t = findmin(a[j], i, 1);\n        for (l = 0; l < i; l++)\n          a[j][l] -= t;\n      }\n      for (j = 0; j < i; j++) {\n        t = findmin(&a[0][j], i, 100);\n        for (l = 0; l < i; l++)\n          a[l][j] -= t;\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < i - 1; j++) {\n        for (l = 0; l < i; l++)\n          a[j][l] = a[j + 1][l];\n        for (l = 0; l < i; l++)\n          a[l][j] = a[l][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33414", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i = 0, j = 0;\n  int a[105][105] = {0};\n  while (cin >> a[0][0]) {\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        if (i == 0 && j == 0)\n          continue;\n        cin >> a[i][j];\n      }\n    }\n\n    int tmp = n;\n    int sum = 0;\n    while (--tmp) {\n      int tmp_min;\n      \n      for (i = 0; i < tmp + 1; ++i) {\n        tmp_min = 600000;\n        for (j = 0; j < tmp + 1; ++j) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (j = 0; j < tmp + 1; ++j) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n      \n      for (j = 0; j < tmp + 1; ++j) {\n        tmp_min = 600000;\n        for (i = 0; i < tmp + 1; ++i) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (i = 0; i < tmp + 1; ++i) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n      sum += a[1][1];\n      \n      for (i = 2; i < tmp + 1; ++i) {\n        a[0][i - 1] = a[0][i];\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i < tmp + 1; ++i) {\n        for (j = 2; j < tmp + 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33415", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100], ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int p = 0; p < n - 1; p++) {\n      int min = **a;\n      for (i = 0; i < n - p; i++) \n      {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + i) + j))\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) -= min;\n        }\n        min = **(a + i + 1);\n      }\n      min = **a; \n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + j) + i))\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + j) + i) -= min;\n        }\n        min = *(*a + i + 1);\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 1; i < n - p; i++) \n      {\n        for (j = 0; j < n - p; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      }\n      for (i = 1; i < n - p; i++) \n      {\n        for (j = 0; j < n - 1 - p; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      }\n    }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33416", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, r, a[101][101], min, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    r = n;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int l = 1; l <= n - 2; l++) {\n      for (int i = 1; i <= r; i++) {\n        min = a[i][1];\n        for (int j = 1; j <= r; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (int i = 1; i <= r; i++) {\n        min = a[1][i];\n        for (int j = 1; j <= r; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (int j = 1; j <= r; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum += a[2][2];\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (int i = 2; i <= r - 1; i++) {\n        for (int j = 1; j <= r - 1; j++) {\n          a[j][i] = a[j][i + 1];\n        }\n      }\n      r--;\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= 2; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (int i = 1; i <= 2; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= 2; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (int j = 1; j <= 2; j++) {\n        a[j][i] = a[j][i] - min;\n      }\n    }\n    sum += a[2][2];\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33417", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int ma[120][120];\n  int i;\n  int j;\n  int sum[120];\n  int time;\n  int t;\n  int n;\n  int min[120];\n  cin >> n;\n  for (t = 0; t <= n - 1; t++) {\n\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> ma[i][j];\n    \n\n    sum[t] = 0;\n    for (time = n - 1; time >= 1; time--) {\n      for (i = 0; i <= time; i++) {\n        min[i] = ma[i][0];\n        for (j = 0; j <= time; j++)\n          if (min[i] > ma[i][j])\n            min[i] = ma[i][j];\n        for (j = 0; j <= time; j++)\n          ma[i][j] = ma[i][j] - min[i];\n      }\n      for (j = 0; j <= time; j++) {\n        min[j] = ma[0][j];\n        for (i = 0; i <= time; i++)\n          if (min[j] > ma[i][j])\n            min[j] = ma[i][j];\n        for (i = 0; i <= time; i++)\n          ma[i][j] = ma[i][j] - min[j];\n      }\n\n      sum[t] = sum[t] + ma[1][1];\n      if (time >= 2) {\n        for (i = 1; i <= time - 1; i++)\n          for (j = 0; j <= time; j++)\n            ma[i][j] = ma[i + 1][j];\n        for (j = 1; j <= time - 1; j++)\n          for (i = 0; i <= time; i++)\n            ma[i][j] = ma[i][j + 1];\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 2; i++)\n    cout << sum[i] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33418", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint juzhen() {\n  int j1, j2, j3, j4, j5;\n  int min, sum = 0;\n  for (j1 = n; j1 > 1; j1--) {\n    for (j2 = 0; j2 < j1; j2++) {\n      min = a[j2][0];\n      for (j3 = 0; j3 < j1; j3++) {\n        if (a[j2][j3] < min)\n          min = a[j2][j3];\n      }\n      for (j3 = 0; j3 < j1; j3++) {\n        a[j2][j3] = a[j2][j3] - min;\n      }\n    }\n    for (j4 = 0; j4 < j1; j4++) {\n      min = a[0][j4];\n      for (j5 = 0; j5 < j1; j5++) {\n        if (a[j5][j4] < min)\n          min = a[j5][j4];\n      }\n      for (j5 = 0; j5 < j1; j5++) {\n        a[j5][j4] = a[j5][j4] - min;\n      }\n    }\n    sum = sum + a[1][1];\n    for (j2 = 0; j2 < j1; j2++) {\n      for (j3 = 0; j3 < j1; j3++) {\n        if (j2 == 0 && j3 > 1)\n          a[j2][j3 - 1] = a[j2][j3];\n        if (j3 == 0 && j2 > 1) {\n          a[j2 - 1][j3] = a[j2][j3];\n        }\n        if (j2 > 1 && j3 > 1)\n          a[j2 - 1][j3 - 1] = a[j2][j3];\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int m1, m2, m3, sum;\n  cin >> n;\n  for (m1 = 1; m1 <= n; m1++) {\n    for (m2 = 0; m2 < n; m2++) {\n      for (m3 = 0; m3 < n; m3++) {\n        cin >> a[m2][m3];\n      }\n    }\n    sum = juzhen();\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33419", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, cnt, kobe;\n  scanf(\"%d \", &n);\n  cnt = n;\n\n  int(*p)[200], a[200][200] = {0};\n  while (cnt--) {\n    int i, j, sum = 0;\n    long min;\n    kobe = n;\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (int k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < kobe; i++) {\n        min = 999999999;\n        for (j = 0; j < kobe; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (j = 0; j < kobe; j++) {\n        min = 999999999;\n        for (i = 0; i < kobe; i++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 1; i < kobe; i++)\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < kobe; j++)\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      kobe--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minline(int n, int u, int **a) {\n  int temp = a[0][u];\n  for (int i = 1; i < n; i++) {\n    if (temp > a[i][u]) {\n      temp = a[i][u];\n    }\n  }\n  return temp;\n}\nint mincross(int n, int a[]) {\n  int temp = a[0];\n  for (int i = 0; i < n; i++) {\n    if (temp > a[i]) {\n      temp = a[i];\n    }\n  }\n  return temp;\n}\n\nint ans(int n, int **pp) {\n\n  int sum = 0;\n\n  for (int y = 0; y < n - 1; y++) {\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = mincross(n - y, pp[i]);\n      for (int j = 0; j < n - y; j++) {\n        pp[i][j] = pp[i][j] - minTemp;\n      }\n    }\n    for (int i = 0; i < n - y; i++) {\n      int minTemp = minline(n - y, i, pp);\n      for (int j = 0; j < n - y; j++) {\n        pp[j][i] = pp[j][i] - minTemp;\n      }\n    }\n    sum = sum + pp[1][1];\n\n    for (int i = 0; i < n - y; i++) {\n      for (int j = 1; j < n - 1 - y; j++) {\n        pp[i][j] = pp[i][j + 1];\n      }\n    }\n\n    for (int i = 0; i < n - 1 - y; i++) {\n      for (int j = 1; j < n - y - 1; j++) {\n        pp[j][i] = pp[j + 1][i];\n      }\n    }\n  }\n  return sum;\n}\n\nint main(void) {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int **pp;\n  pp = (int **)malloc(n * sizeof(int *));\n  for (int i = 0; i < n; i++) {\n    pp[i] = (int *)malloc(n * sizeof(int));\n  }\n\n  for (int w = 0; w < n; w++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d\", &pp[i][j]);\n      }\n    }\n    printf(\"%d\\n\", ans(n, pp));\n  }\n\n  for (int i = 0; i < n; i++) {\n    free(pp[i]);\n  }\n  free(pp);\n\n  return 0;\n}\n"}
{"label": "18", "index": "33421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum(int);\nint a[100][100];\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33422", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid zero(int array_1[100][100]);\nvoid subduction(int array_1[100][100]);\nint num, array_1[100][100];\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    num = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &array_1[i][j]);\n    for (i = 1; i < n; i++) {\n      zero(array_1);\n      sum = sum + array_1[1][1];\n      subduction(array_1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid zero(int array_1[100][100]) {\n  int i, j, minuend;\n  for (i = 0; i < num; i++) {\n    minuend = array_1[i][0];\n    for (j = 0; j < num; j++)\n      if (array_1[i][j] < minuend)\n        minuend = array_1[i][j];\n    for (j = 0; j < num; j++)\n      array_1[i][j] = array_1[i][j] - minuend;\n  }\n  for (i = 0; i < num; i++) {\n    minuend = array_1[0][i];\n    for (j = 0; j < num; j++)\n      if (array_1[j][i] < minuend)\n        minuend = array_1[j][i];\n    for (j = 0; j < num; j++)\n      array_1[j][i] = array_1[j][i] - minuend;\n  }\n};\n\nvoid subduction(int array_1[100][100]) {\n  int i, j, k;\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[i - 1][j] = array_1[i][j];\n  for (i = 2; i < num; i++)\n    for (j = 0; j < num; j++)\n      array_1[j][i - 1] = array_1[j][i];\n  num--;\n};\n"}
{"label": "18", "index": "33423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, t, sum = 0, a[200][200], m;\nint main() {\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (t = n; t >= 2; t--) {\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[j][k] < m) {\n            m = a[j][k];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[j][k] = a[j][k] - m;\n        }\n      }\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[k][j] < m) {\n            m = a[k][j];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[k][j] = a[k][j] - m;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= t - 2; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j <= t - 2; j++) {\n        for (k = 1; k <= t - 2; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33424", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid shuru(int);\nvoid guiling(int);\n\nint num[100][100] = {0};\nint sum = 0;\n\nint main() {\n  int n = 0;\n  int i = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    shuru(n);\n  }\n\n  return 0;\n}\n\nvoid shuru(int n) {\n  int i = 0;\n  int j = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &num[i][j]);\n\n  guiling(n);\n}\n\nvoid guiling(int n) {\n  if (n == 1)\n    cout << sum << endl;\n  else {\n    int min = 0;\n\n    int t = 0;\n    int i = 0;\n\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[i][t])\n          min = num[i][t];\n      }\n\n      for (t = 0; t < n; t++)\n        num[i][t] -= min;\n    }\n\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[t][i])\n          min = num[t][i];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[t][i] -= min;\n      }\n    }\n\n    sum += num[1][1];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[i][t - 1] = num[i][t];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[t - 1][i] = num[t][i];\n\n    guiling(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33425", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int w[100][100];\n  cin >> n;\n  for (int nn = 0; nn < n; nn++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    int s = 0;\n    for (int t = 0; t < n - 1; t++) {\n      for (int i = 0; i < n; i++)\n        if ((!i) || (i - t > 0)) {\n          int m = w[i][0];\n          for (int j = t + 1; j < n; j++)\n            m = min(m, w[i][j]);\n          w[i][0] -= m;\n          for (int j = t + 1; j < n; j++)\n            w[i][j] -= m;\n        }\n      for (int j = 0; j < n; j++)\n        if ((!j) || (j - t > 0)) {\n          int m = w[0][j];\n          for (int i = t + 1; i < n; i++)\n            m = min(m, w[i][j]);\n          w[0][j] -= m;\n          for (int i = t + 1; i < n; i++)\n            w[i][j] -= m;\n        }\n      s += w[t + 1][t + 1];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33426", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[201][201];\nint i, j, sum;\nint min1[201], min2[201];\nvoid read();\nvoid del(int);\nvoid move(int);\nint main() {\n  scanf(\"%d \", &n);\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    read();\n    sum = 0;\n    for (j = 0; j < n - 1; ++j) {\n\n      del(n - j);\n      sum = sum + a[1][1];\n      move(n - j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid read() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d \", &a[i][j]);\n}\nvoid del(int n) {\n  for (i = 0; i < n; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min1[i])\n        min1[i] = a[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min1[i];\n\n  for (i = 0; i < n; i++) {\n    min2[i] = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min2[i])\n        min2[i] = a[j][i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min2[i];\n}\nvoid move(int n) {\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n}\n"}
{"label": "18", "index": "33427", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint matrix[100][100] = {0};\nvoid change(int k, int n) \n{\n  matrix[k + 1][k + 1] = matrix[k][k];\n  int i = 0;\n  if (n - 1 >= k + 2) {\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[k + 1][i] = matrix[k][i];\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[i][k + 1] = matrix[i][k];\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int m = 0;\n  int sum[100] = {0};\n  for (m = 0; m <= n - 1; m++) {\n\n    int i = 0, j = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> matrix[i][j];\n    int k = 0;\n    for (k = 0; k <= n - 2; k++) {\n      int min = 10000;\n      for (i = k; i <= n - 1; i++) \n      {\n        min = 10000;\n        for (j = k; j <= n - 1; j++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (j = k; j <= n - 1; j++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      for (j = k; j <= n - 1; j++) \n      {\n        min = 10000;\n        for (i = k; i <= n - 1; i++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (i = k; i <= n - 1; i++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      sum[m] = sum[m] + matrix[k + 1][k + 1]; \n      change(k, n);\n    }\n  }\n  for (m = 0; m <= n - 1; m++)\n    cout << sum[m] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33428", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int sum = 0;\n  int l = 0;\n  int a[100][100];\n  int min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    l = 0;\n    for (i = 0; i < n - l; i++)\n      for (j = 0; j < n - l; j++)\n        cin >> a[i][j];\n    while (l < n - 1) {\n      for (i = 0; i < n - l; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1 - l; i++)\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1 - l; j++)\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j + 1];\n      l++;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, n0 = 0, juzhen[102][102] = {0}, sum = 0, minc[102] = {0},\n               minr[102] = {0}, lins = 0;\n  int(*p)[102] = juzhen, *pr = minr, *pc = minc;\n  cin >> n;\n  while (n0 < n) {\n    lins = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = 0;\n      *(pr + i) = 100000;\n      *(pc + i) = 100000;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (lins < n - 1) {\n      for (i = 0; i < n; i++) {\n        *(pr + i) = 100000;\n        *(pc + i) = 100000;\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          if (*(*(p + i) + j) < minr[i])\n            *(pr + i) = *(*(p + i) + j);\n        }\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          *(*(p + i) + j) -= *(pr + i);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          if (*(*(p + i) + j) < *(pc + j))\n            *(pc + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          *(*(p + i) + j) -= *(pc + j);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n\n      for (i = 2; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (j = 2; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n      lins++;\n    }\n    cout << sum << endl;\n    n0++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33430", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int i, j, k, n, sum, min = 0, m;\n  scanf(\"%d \", &n);\n  for (m = 0; m < n; m++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - k; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n        a[i][n - 1] = 0;\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n        a[n - 1][j] = 0;\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33431", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint zero(int n, int sum) {\n  if (n != 1) {\n    int min, i, j, array[n][n];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        array[i][j] = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) { \n      min = array[i][0];\n      for (j = 1; j < n; j++) {\n        if (array[i][j] < min) {\n          min = array[i][j];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[i][j] = array[i][j] - min;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) { \n      min = array[0][i];\n      for (j = 1; j < n; j++) {\n        if (array[j][i] < min) {\n          min = array[j][i];\n        }\n      }\n      if (min != 0) {\n        for (j = 0; j < n; j++) {\n          array[j][i] = array[j][i] - min;\n        }\n      }\n    }\n    sum = sum + array[1][1];\n    for (i = 0; i < n; i++) { \n      for (j = 1; j < n - 1; j++) {\n        a[i][j] = array[i][j] = array[i][j + 1];\n      }\n    }\n    for (i = 0; i < n - 1; i++) { \n      for (j = 1; j < n - 1; j++) {\n        array[j][i] = array[j + 1][i];\n      }\n    }\n    for (i = 0; i < n - 1; i++) {\n      for (j = 0; j < n - 1; j++) {\n        a[i][j] = array[i][j];\n      }\n    }\n    return zero(n - 1, sum);\n  }\n  if (n == 1)\n    return sum;\n}\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0, i, t, r;\n  for (i = 1; i <= n; i++) {\n    for (t = 0; t < n; t++) {\n      for (r = 0; r < n; r++) {\n        cin >> a[t][r];\n      }\n    }\n    cout << zero(n, sum) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33432", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, s = 0, t = 0, k = 0, i = 0, j = 0, m = 0, q = 0, min = 0, r = 0,\n      h = 0, w = 0, v = 0;\n  scanf(\"%d \", &n);\n  for (r = 1; r <= n; r++) {\n    int number = 0;\n    const int p = n;\n    int a[p + 1][p + 1];\n    for (i = 1; i <= p; i++) {\n      for (j = 1; j <= p; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (k = 1; k <= p - 1; k++) {\n      for (s = k; s <= p; s++) {\n        min = a[s][k];\n        for (t = k; t <= p; t++) {\n          if (a[s][t] < min)\n            min = a[s][t];\n        }\n        for (m = k; m <= p; m++) {\n          a[s][m] -= min;\n        }\n      }\n      for (h = k; h <= p; h++) {\n        min = a[k][h];\n        for (w = k; w <= p; w++) {\n          if (a[w][h] < min)\n            min = a[w][h];\n        }\n        for (q = k; q <= p; q++) {\n          a[q][h] -= min;\n        }\n      }\n      number += a[k + 1][k + 1];\n      a[k + 1][k + 1] = a[k][k];\n      for (v = k + 2; v <= p; v++) {\n        a[k + 1][v] = a[k][v];\n        a[v][k + 1] = a[v][k];\n      }\n    }\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, m, sum = 0;\n  cin >> n;\n  for (int p = 1; p <= n; p++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int q = 1; q < n; q++) {\n      for (i = q; i <= n; i++) {\n        m = a[i][q];\n        for (j = q + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (j = q; j <= n; j++)\n          a[i][j] -= m;\n      }\n      for (j = q; j <= n; j++) {\n        m = a[q][j];\n        for (i = q + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n\n        for (i = q; i <= n; i++)\n          a[i][j] -= m;\n      }\n      sum += a[q][q];\n    }\n    cout << sum << endl;\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "33434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, j;\n  int sum = 0;\n  cin >> n;\n  int a[n][n];\n  int minh[n], minl[n];\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    int t = 1;\n    sum = 0;\n    while (t < n) {\n      for (i = 0; i < n; i++) {\n        minh[i] = 10000;\n        minl[i] = 10000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minh[i] > a[i][j])\n            minh[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000)\n            a[i][j] = a[i][j] - minh[i];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000 && minl[j] > a[i][j])\n            minl[j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] != 10000) {\n            a[i][j] = a[i][j] - minl[j];\n          }\n        }\n      }\n\n      sum = sum + a[t][t];\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (i == t || j == t)\n            a[i][j] = 10000;\n        }\n      }\n\n      t++;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33435", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[10000], *p, k = 0;\n  p = a;\n  cin >> n;\n  while (k < n) {\n    int total = 0, m = n;\n    k++;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(p + i * n + j);\n\n    while (m > 1) {\n      int min = 100000;\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < m; j++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (j = 0; j < m; j++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 0; j < m; j++) {\n        for (i = 0; i < m; i++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (i = 0; i < m; i++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      total += *(p + m + 1);\n      for (j = 2; j < m; j++)\n        *(p + j - 1) = *(p + j);\n      for (i = 2; i < m; i++) {\n        *(p + (i - 1) * (m - 1)) = *(p + i * m);\n        for (j = 2; j < m; j++)\n          *(p + (i - 1) * (m - 1) + j - 1) = *(p + i * m + j);\n      }\n      m--;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33436", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, a[10000], *p, k = 0;\n  p = a;\n  cin >> n;\n  while (k < n) {\n    int total = 0, m = n;\n    k++;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(p + i * n + j);\n      }\n    while (m > 1) {\n      int min = 100000;\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < m; j++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (j = 0; j < m; j++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 0; j < m; j++) {\n        for (i = 0; i < m; i++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (i = 0; i < m; i++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      total += *(p + m + 1);\n      for (j = 2; j < m; j++)\n        *(p + j - 1) = *(p + j);\n      for (i = 2; i < m; i++) {\n        *(p + (i - 1) * (m - 1)) = *(p + i * m);\n        for (j = 2; j < m; j++)\n          *(p + (i - 1) * (m - 1) + j - 1) = *(p + i * m + j);\n      }\n      m--;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint find_min(int x, int side);  \nint find_miny(int y, int side); \nint a[120][120], sum;           \nvoid caozuo(int side);          \nint main() {\n  int i, j, n, k;\n  cin >> n; \n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a)); \n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    caozuo(n); \n  }\n\n  return 0;\n}\nint find_min(int x, int side) \n{\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[x][i])\n      temp = a[x][i];\n  }\n  return temp;\n}\nint find_miny(int y, int side) \n{\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[i][y])\n      temp = a[i][y];\n  }\n  return temp;\n}\nvoid caozuo(int side) {\n  int i, j, t;\n  if (side == 1) \n  {\n    cout << sum << endl;\n  } else {\n    for (i = 0; i <= side - 1; i++) {\n      t = find_min(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[i][j] -= t; \n      }\n    }\n    for (i = 0; i <= side - 1; i++) {\n      t = find_miny(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[j][i] -= t; \n      }\n    }\n\n    sum = sum + a[1][1]; \n    if (side > 2)        \n    {\n      for (i = 2; i <= side - 1; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i <= side - 1; i++) {\n        for (j = 2; j <= side - 1; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    caozuo(side - 1); \n  }\n}\n"}
{"label": "18", "index": "33438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[105][105], sum = 0, min, p;\n  scanf(\"%d \", &n);\n  p = n;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n\n    for (int m = 1; m <= n - 1; m++) {\n      for (i = 0; i <= p - 1; i++) {\n        min = 10000;\n        for (j = 0; j <= p - 1; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j <= p - 1; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= p - 1; j++) {\n        min = 10000;\n        for (i = 0; i <= p - 1; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i <= p - 1; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n\n      for (i = 2; i <= p - 1; i++) {\n        for (j = 0; j <= p - 1; j++)\n          a[i - 1][j] = a[i][j];\n      }\n      for (j = 2; j <= p - 1; j++) {\n        for (i = 0; i <= p - 1; i++)\n          a[i][j - 1] = a[i][j];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum, n, a[105][105], flag2[105], min1[105], min2[105];\nvoid f(int x);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    f(n);\n    cout << sum << endl;\n  }\n\n  return 0;\n}\nvoid f(int x) {\n  if (x == n) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n  }\n  if (x == 1) {\n  } else {\n    for (int i = 0; i < x; i++) {\n      flag2[i] = 0;\n      min1[i] = 0;\n      min2[i] = 0;\n    }\n    for (int i = 0; i < x; i++) {\n      min1[i] = a[i][0];\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] < min1[i])\n          min1[i] = a[i][j];\n      }\n    }\n    for (int i = 0; i < x; i++) {\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] - min1[i] >= 0) {\n          a[i][j] = a[i][j] - min1[i];\n          if (a[i][j] == 0) {\n            flag2[j] = 1;\n          }\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        min2[j] = a[0][j];\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] < min2[j])\n            min2[j] = a[i][j];\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] - min2[j] >= 0) {\n            a[i][j] = a[i][j] - min2[j];\n          }\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (int i = 0; i < x; i++) {\n      for (int j = 1; j < x - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (int j = 0; j < x - 1; j++) {\n      for (int i = 1; i < x - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    f(x - 1);\n  }\n}\n"}
{"label": "18", "index": "33440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, s = 0;\n  int b[100], a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (s = n; s > 1; s--) {\n      int min1 = 10000;\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min1) {\n            min1 = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= min1;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min1 = 10000;\n        for (k = 0; k < n; k++) {\n          if (a[k][j] < min1) {\n            min1 = a[k][j];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[k][j] -= min1;\n        }\n      }\n      b[n - s] = a[1][1];\n      for (j = 2; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[k][j - 1] = a[k][j];\n        }\n      }\n      for (k = 2; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n    }\n    int sum = 0;\n    for (k = 0; k < n - 1; k++) {\n      sum = sum + b[k];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a[101][101], mini[101], minj[101], ans[101]; \n  cin >> n; \n  for (k = 1; k <= n; k++) {\n    memset(a, 0, sizeof(a));\n    memset(ans, 0, sizeof(ans));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    m = n; \n    while (m > 1) {\n      memset(mini, 21474836, sizeof(mini));\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          if (a[i][j] < mini[i])\n            mini[i] = a[i][j];\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j] - mini[i]; \n      memset(minj, 21474836, sizeof(minj));\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          if (a[i][j] < minj[j])\n            minj[j] = a[i][j];\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i][j] - minj[j]; \n\n      ans[k] = ans[k] + a[2][2]; \n      for (i = 2; i <= m; i++)\n        a[i][1] = a[i + 1][1];\n      for (j = 2; j <= m; j++)\n        a[1][j] = a[1][j + 1];\n      for (i = 2; i <= m; i++)\n        for (j = 2; j <= m; j++)\n          a[i][j] = a[i + 1][j + 1];\n      m--; \n    }\n    cout << ans[k] << endl; \n  }\n  return 0; \n}\n"}
{"label": "18", "index": "33442", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int w[100][100];\n  cin >> n;\n  for (int nn = 0; nn < n; nn++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    int s = 0;\n    for (int t = 0; t < n - 1; t++) {\n      for (int i = 0; i < n; i++) {\n        if ((!i) || (i - t > 0)) {\n          int m = w[i][0];\n          for (int j = t + 1; j < n; j++)\n            m = min(m, w[i][j]);\n          w[i][0] -= m;\n          for (int j = t + 1; j < n; j++)\n            w[i][j] -= m;\n        }\n      }\n      for (int j = 0; j < n; j++)\n        if ((!j) || (j - t > 0)) {\n          int m = w[0][j];\n          for (int i = t + 1; i < n; i++)\n            m = min(m, w[i][j]);\n          w[0][j] -= m;\n          for (int i = t + 1; i < n; i++)\n            w[i][j] -= m;\n        }\n      s += w[t + 1][t + 1];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33443", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0}, sum = 0;\nvoid guiling(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 2; i < n; i++)\n    a[i - 1][0] = a[i][0];\n  for (j = 2; j < n; j++)\n    a[0][j - 1] = a[0][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int i, j, n, k, m;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (m > 2) {\n      guiling(m);\n      xiaojian(m);\n      m--;\n    }\n    guiling(2);\n    sum += a[1][1];\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33444", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[120][120];\nint math(int);\nint n;\nint main() {\n  int sum, b, c;\n  cin >> n;\n  c = n;\n  while (c--) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = math(n);\n\n    b = n;\n    while (b--) {\n      for (int i = 2; i < b + 1; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < b + 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int i = 2; i < b + 1; i++)\n        for (int j = 2; j < b + 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      if (b == 1)\n        break;\n      sum = math(b) + sum;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\nint math(int x) {\n  int min[x];\n  for (int i = 0; i < x; i++)\n    min[i] = a[i][0];\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - min[i];\n\n  int minl[x];\n  for (int i = 0; i < x; i++)\n    minl[i] = a[0][i];\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++) {\n      if (a[j][i] < minl[i])\n        minl[i] = a[j][i];\n    }\n\n  for (int i = 0; i < x; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - minl[j];\n\n  return a[1][1];\n}\n"}
{"label": "18", "index": "33445", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int array[100][100] = {0};\n  int times, m, n, i, j, k;\n  cin >> times;\n  m = times;\n  while (m--) {\n    n = times;\n    int(*p)[100] = array;\n    for (i = 0; i < times; i++)\n      for (j = 0; j < times; j++)\n        cin >> *(*(p + i) + j);\n    int sum = 0;\n    for (k = 1; k <= times - 1; k++) {\n      int min, now;\n      for (i = 0; i < n; i++) {\n        min = *(*(p + i));\n        for (j = 1; j < n; j++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = *(*p + j);\n        for (i = 1; i < n; i++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + (*(*(p + 1) + 1));\n      if (n == 2)\n        break;\n      for (i = 2; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      for (j = 2; j < n; j++)\n        for (i = 0; i < n - 1; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      n--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, sum = 0, a[100][100], k = 0;\n  int t = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        t = a[i][0];\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - q; j++) {\n        t = a[0][j];\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - q - 1; i++)\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - q - 1; j++)\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33447", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, min1;\nint a[110][110];\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < min1)\n    min1 = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= min1;\n}\nint main() {\n  cin >> n;\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m > 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        min1 = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, min, sum = 0;\n  scanf(\"%d\", &n);\n  k = m = n;\n  while (k--) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        min = a[i][0];\n        for (j = 0; j <= m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++) {\n            a[i][j] -= min;\n          }\n        }\n      }\n      for (i = 0; i <= m; i++) {\n        min = a[0][i];\n        for (j = 0; j <= m; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[j][i] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < m; i++)\n        a[0][i] = a[0][i + 1];\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    m = n;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int k, l, sum = 0;\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++)\n        scanf(\"%d \", &a[k][l]);\n    }\n    int h = n;\n    do {\n      for (k = 0; k < h; k++) {\n        int min = a[k][0];\n        for (l = 0; l < h; l++) {\n          if (a[k][l] <= min)\n            min = a[k][l];\n        }\n        for (l = 0; l < h; l++) {\n          a[k][l] = a[k][l] - min;\n        }\n      }\n      for (l = 0; l < h; l++) {\n        int x = a[0][l];\n        for (k = 0; k < h; k++) {\n          if (a[k][l] <= x)\n            x = a[k][l];\n        }\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l] - x;\n      }\n      sum = sum + a[1][1];\n      h = h - 1;\n      for (k = 1; k < h; k++) {\n        for (l = 0; l < h + 1; l++)\n          a[k][l] = a[k + 1][l];\n      }\n      for (l = 1; l < h; l++) {\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l + 1];\n      }\n    } while (h > 1);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33450", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid ccout(int n, int s[100]);\nint main() {\n  int n, i, j, k, min, t, s[100], a[100][100][100];\n  scanf(\"%d \", &n);\n  memset(s, 0, sizeof(s));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j][k]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = 1073741824;\n        for (j = 0; j < n - t; j++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (j = 0; j < n - t; j++)\n          a[i][j][k] -= min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = 1073741824;\n        for (i = 0; i < n - t; i++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (i = 0; i < n - t; i++)\n          a[i][j][k] -= min;\n      }\n      s[k] += a[1][1][k];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - t - 1; i++)\n          a[i][j][k] = a[i + 1][j][k];\n    }\n  }\n  ccout(n, s);\n  return 0;\n}\nvoid ccout(int n, int s[100]) {\n  int k;\n  for (k = 0; k < n; k++)\n    cout << s[k] << endl;\n}\n"}
{"label": "18", "index": "33451", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, l, m;\n  double a[100][100];\n  int min;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 1; l < n; l++) {\n\n      for (j = 0; j < n; j++) {\n        k = 0;\n        while (a[j][k] < 0)\n          k++;\n        while (k < n) {\n          min = a[j][k];\n          for (; k < n; k++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (k = 0; k < n; k++)\n            a[j][k] -= min;\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        j = 0;\n        while (a[j][k] < 0)\n          j++;\n        while (j < n) {\n          min = a[j][k];\n          for (j = 1; j < n; j++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (j = 0; j < n; j++)\n            a[j][k] -= min;\n        }\n      }\n\n      sum += a[l][l];\n      for (m = 0; m < n; m++) {\n        a[l][m] = -1;\n        a[m][l] = -1;\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33452", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, k, array[100][100];\n  cin >> n;\n  k = n;\n  m = n;\n  while (m > 0) {\n    int i, j, min;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = array[i][0];\n        for (j = 1; j < k; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j < k; j++)\n          array[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = array[0][i];\n        for (j = 1; j < k; j++) {\n          if (array[j][i] < min)\n            min = array[j][i];\n        }\n        for (j = 0; j < k; j++) {\n          array[j][i] -= min;\n        }\n      }\n      sum += array[1][1];\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k - 1; j++) {\n          array[i][j] = array[i][j + 1];\n        }\n      }\n      for (j = 0; j < k - 1; j++) {\n        for (i = 1; i < k - 1; i++) {\n          array[i][j] = array[i + 1][j];\n        }\n      }\n      k--;\n    }\n    printf(\"%d\\n\", sum);\n    k = n;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33453", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int input, shu[101][101], min[101], min1[101], sum, i, j, i1, j1, n, num;\n  cin >> input;\n  for (n = 1; n <= input; n++) {\n    num = input;\n    for (i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> shu[i][j];\n    }\n    sum = 0;\n    while (num > 1) {\n      for (i = 0; i < num; i++) {\n        min[i] = 1000000;\n        min1[i] = 10000000;\n      }\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num; j++) {\n          if (shu[i][j] < min[i])\n            min[i] = shu[i][j];\n          if (j == num - 1) {\n            for (j1 = 0; j1 < num; j1++)\n              shu[i][j1] = shu[i][j1] - min[i];\n          }\n        }\n      }\n      for (j = 0; j < num; j++) {\n        for (i = 0; i < num; i++) {\n          if (shu[i][j] < min1[j])\n            min1[j] = shu[i][j];\n          if (i == num - 1) {\n            for (i1 = 0; i1 < num; i1++)\n              shu[i1][j] = shu[i1][j] - min1[j];\n          }\n        }\n      }\n      sum = sum + shu[1][1];\n      for (i = 0; i < num; i++) {\n        for (j = 1; j < num - 1; j++)\n          shu[i][j] = shu[i][j + 1];\n      }\n      for (j = 0; j < num - 1; j++) {\n        for (i = 1; i < num - 1; i++)\n          shu[i][j] = shu[i + 1][j];\n      }\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "33454", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint n, sum = 0;\nint Sum(int);\nvoid RowSub(int);\nvoid ColSub(int);\n\nint Sum(int n) {\n  RowSub(n);\n  ColSub(n);\n  if (n == 2)\n    return a[1][1];\n\n  int k = a[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    a[i][0] = a[i + 1][0];\n    a[0][i] = a[0][i + 1];\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return k + Sum(n - 1);\n}\n\nvoid RowSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  return;\n}\n\nvoid ColSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return;\n}\nint main() {\n  int i, j, k;\n\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33455", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint Matrix[100][100];\n\nint a[100] = {0};\n\nint b[100] = {0};\n\nint N = 0;\n\nvoid f(int n) {\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    a[i] = Matrix[i][0];\n    for (int k = 1; k < n; k++)\n      if (a[i] > Matrix[i][k])\n        a[i] = Matrix[i][k];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[i][j] -= a[i];\n}\nvoid g(int n) {\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    b[i] = Matrix[0][i];\n    for (int k = 1; k < n; k++)\n      if (b[i] > Matrix[k][i])\n        b[i] = Matrix[k][i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[j][i] -= b[i];\n}\nint h(int n) {\n  int k = 0;\n  f(n);\n  g(n);\n  k = Matrix[1][1];\n  if (n == 2)\n    return k;\n  for (int i = 1; i < n - 1; i++) {\n    Matrix[0][i] = Matrix[0][i + 1];\n    Matrix[i][0] = Matrix[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      Matrix[i][j] = Matrix[i + 1][j + 1];\n  }\n  return k + h(n - 1);\n}\nint main() {\n  scanf(\"%d\", &N);\n  for (int j = 0; j < N; j++) {\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        scanf(\"%d\", &Matrix[i][j]);\n    printf(\"%d\\n\", h(N));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33456", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[102][102], min = 100000, sum = 0, t;\n  scanf(\"%d \", &n);\n\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (t = 0; t <= n - 2; t++) {\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[i][j] ? min : a[i][j];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[j][i] ? min : a[j][i];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 3; i <= n - t; i++) {\n        a[i - 1][1] = a[i][1];\n        a[1][i - 1] = a[1][i];\n      }\n\n      for (i = 3; i <= n - t; i++) {\n        for (j = 3; j <= n - t; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33457", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a1[100][100];\nint xiao(int n) {\n  int sum = 0;\n  if (n == 2) {\n    for (int i = 0; i < n; i++) {\n      int min = 1000;\n      for (int j = 0; j < n; j++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a1[i][j] = a1[i][j] - min;\n    }\n    for (int j = 0; j < n; j++) {\n      int min = 1000;\n      for (int i = 0; i < n; i++) {\n        if (min > a1[i][j])\n          min = a1[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a1[i][j] = a1[i][j] - min;\n    }\n\n    return a1[1][1];\n  }\n\n  for (int i = 0; i < n; i++) {\n    int min = 1000;\n    for (int j = 0; j < n; j++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a1[i][j] = a1[i][j] - min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = 1000;\n    for (int i = 0; i < n; i++) {\n      if (min > a1[i][j])\n        min = a1[i][j];\n    }\n    for (int i = 0; i < n; i++)\n      a1[i][j] = a1[i][j] - min;\n  }\n\n  sum += a1[1][1];\n\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      if (j == 1)\n        continue;\n      if (j < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i][j - 1] = a1[i][j];\n    }\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      if (i == 1)\n        continue;\n      if (i < 1)\n        a1[i][j] = a1[i][j];\n      else\n        a1[i - 1][j] = a1[i][j];\n    }\n  sum += xiao(n - 1);\n  return sum;\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n\n  for (int k = 0; k < n; k++) {\n\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a1[i][j]);\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint sum = 0;\nint minu(int x, int y) {\n  if (x < y)\n    return x;\n  else\n    return y;\n}\nvoid del(int n) {\n  int i, m;\n  int num[n];\n  if (n == 1) {\n    cout << sum << \"\\n\";\n    return;\n  } else {\n    for (i = 0; i < n; i++) {\n      num[i] = a[i][0];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[i][m]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[i][m] = a[i][m] - num[i];\n    }\n    for (i = 0; i < n; i++) {\n      num[i] = a[0][i];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[m][i]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[m][i] = a[m][i] - num[i];\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[i][m] = a[i + 1][m];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[m][i] = a[m][i + 1];\n    del(n - 1);\n  }\n}\nint main() {\n  int j, k;\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    del(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33459", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum = 0;\n  cin >> n;\n  int i, j, k, h, p;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    int board[105][105] = {0};\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &board[i][j]);\n      }\n    }\n    for (h = 0; h < n; h++) {\n      for (i = h; i < n; i++) {\n        int min = board[i][h];\n        for (j = h; j < n; j++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (j = h; j < n; j++) {\n          board[i][j] -= min;\n        }\n      }\n      for (j = h; j < n; j++) {\n        int min = board[h][j];\n        for (i = h; i < n; i++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (i = h; i < n; i++) {\n          board[i][j] -= min;\n        }\n      }\n      sum += board[h + 1][h + 1];\n      board[h + 1][h + 1] = board[h][h];\n      for (p = h + 2; p < n; p++) {\n        board[h + 1][p] = board[h][p];\n      }\n      for (p = h + 2; p < n; p++) {\n        board[p][h + 1] = board[p][h];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33460", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint make(int a[100][100], int l, int num, int n);\nint main() {\n  int n, i, j, k, l, num, ans = 0;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    ans = 0;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      num = l;\n      ans = ans + make(a, l, num, n);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\nint make(int a[100][100], int l, int num, int n) {\n  int min1, min2, i, j, k, p, q, m;\n  for (k = 0; k <= n - 1; k++) {\n    min1 = a[k][0];\n    for (i = l; i <= n - 1; i++) {\n      if (a[k][i] < min1)\n        min1 = a[k][i];\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[k][j] = a[k][j] - min1;\n    }\n  }\n  for (p = 0; p <= n - 1; p++) {\n    min2 = a[0][p];\n    for (q = l; q <= n - 1; q++) {\n      if (a[q][p] < min2)\n        min2 = a[q][p];\n    }\n    a[0][p] = a[0][p] - min2;\n    for (m = l; m <= n - 1; m++) {\n      a[m][p] = a[m][p] - min2;\n    }\n  }\n  num--;\n  if (num == 0)\n    return a[l][l];\n  else\n    return make(a, l, num, n);\n}\n"}
{"label": "18", "index": "33461", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  scanf(\"%d \", &num);\n  int n = num, numcas = num;\n\n  int a[301][301];\n  while (num--) {\n    int s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < numcas; i++)\n      for (int j = 0; j < numcas; j++)\n        scanf(\"%d \", &a[i][j]);\n\n    n = numcas;\n    while (1) {\n\n      if (n == 0) {\n        cout << s << endl;\n        break;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int i = 0; i < n; i++)\n          a[j][i] -= min;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n\n      s += a[1][1];\n\n      for (int j = 0; j < n; j++)\n        for (int i = 1; i < n; i++) {\n          a[j][i] = a[j][i + 1];\n        }\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      n--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33462", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, arr[100][100], i, j, k, l, min, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> arr[i][j];\n      }\n    }\n    for (l = n; l > 1; l--) {\n      for (i = 0; i < l; i++) {\n        min = arr[i][0];\n        for (j = 1; j < l; j++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      for (j = 0; j < l; j++) {\n        min = arr[0][j];\n        for (i = 1; i < l; i++) {\n          if (arr[i][j] < min) {\n            min = arr[i][j];\n          }\n        }\n        for (i = 0; i < l; i++) {\n          arr[i][j] = arr[i][j] - min;\n        }\n      }\n      sum = sum + arr[1][1];\n      for (i = 1; i < l; i++) {\n        for (j = 0; j < l; j++) {\n          arr[i][j] = arr[i + 1][j];\n        }\n      }\n      for (j = 1; j < l; j++) {\n        for (i = 0; i < l - 1; i++) {\n          arr[i][j] = arr[i][j + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n    memset(arr, 0, sizeof(arr));\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint s = 0, a[100][100];\nvoid hang(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n    min = 0;\n  }\n}\nvoid lie(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (min >= a[j][i])\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n    min = 0;\n  }\n}\nvoid xiaoqu(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\nvoid sum(int n) {\n  if (n > 1) {\n    hang(n);\n    lie(n);\n    s += a[1][1];\n    xiaoqu(n);\n    sum(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int k = n;\n  while (k) {\n    k--;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum(n);\n    cout << s << endl;\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33464", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[200][200][200];\n\nint main() {\n  int n, sum[200];\n  int p, k, i, j;\n  int min;\n\n  cin >> n;\n\n  for (p = 0; p < n; p++) {\n    sum[p] = 0;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[p][i][j];\n\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[p][i][0];\n        for (j = 0; j < n - k; j++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (j = 0; j < n - k; j++)\n          a[p][i][j] = a[p][i][j] - min;\n      } \n\n      for (j = 0; j < n - k; j++) {\n        min = a[p][0][j];\n        for (i = 0; i < n - k; i++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (i = 0; i < n - k; i++)\n          a[p][i][j] = a[p][i][j] - min;\n      } \n\n      sum[p] = sum[p] + a[p][1][1];\n      \n\n      for (i = 1; i < n - k; i++)\n        a[p][i][0] = a[p][i + 1][0];\n      for (j = 1; j < n - k; j++)\n        a[p][0][j] = a[p][0][j + 1];\n      for (i = 1; i < n - k; i++)\n        for (j = 1; j < n - k; j++)\n          a[p][i][j] = a[p][i + 1][j + 1];\n      \n    }\n  }\n\n  for (p = 0; p < n - 1; p++)\n    cout << sum[p] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33465", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, j, k, t, sum = 0, a[200][200], m;\nint main() {\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (t = n; t >= 2; t--) {\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[j][k] < m) {\n            m = a[j][k];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[j][k] = a[j][k] - m;\n        }\n      }\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[k][j] < m) {\n            m = a[k][j];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[k][j] = a[k][j] - m;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= t - 2; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j <= t - 2; j++) {\n        for (k = 1; k <= t - 2; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[111][111];\nint n;\n\nint xiao(int size);\n\nint sum() {\n  int temp = 0;\n  for (int siz = n; siz >= 2; siz--) {\n    temp += xiao(siz);\n  }\n  return temp;\n}\n\nint xiao(int size) {\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[i][j] < tempmin)\n        tempmin = a[i][j];\n    for (int j = 1; j <= size; j++)\n      a[i][j] -= tempmin;\n  }\n  for (int i = 1; i <= size; i++) {\n    int tempmin = 100000;\n    for (int j = 1; j <= size; j++)\n      if (a[j][i] < tempmin) {\n        tempmin = a[j][i];\n      }\n    for (int j = 1; j <= size; j++)\n      a[j][i] -= tempmin;\n  }\n\n  int daan = a[2][2];\n\n  for (int i = 1; i <= n; i++)\n    for (int j = 2; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 1; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[j][i] = a[j + 1][i];\n  return daan;\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  for (int t = 1; t <= n; t++) {\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << sum() << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid guiling(int a[][100], int);\nvoid xiaojian(int a[][100], int);\nint main() {\n  int n, a[100][100], k, i, j, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int t = 0; t < n - 1; t++) {\n      guiling(a, n - t);\n      sum += a[1][1];\n      xiaojian(a, n - t);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\nvoid guiling(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int a[][100], int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n}\n"}
{"label": "18", "index": "33468", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001];\nint r[1001], c[1001], s = 0;\nvoid f(int n) {\n  for (int i = 0; i < n; i++) {\n    r[i] = a[i][0];\n    for (int j = 0; j < n; j++)\n      if (a[i][j] < r[i])\n        r[i] = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= r[i];\n  }\n  for (int i = 0; i < n; i++) {\n    r[i] = a[0][i];\n    for (int j = 0; j < n; j++)\n      if (a[j][i] < r[i])\n        r[i] = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= r[i];\n  }\n  s += a[1][1];\n  if (n == 2) {\n    printf(\"%d\\n\", s);\n    return;\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n - 1; j++)\n      a[j][i] = a[j][i + 1];\n  f(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int t = n;\n  while (t--) {\n    s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n  }\n}\n"}
{"label": "18", "index": "33469", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = *(*(a + j));\n        for (k = 1; k < i; k++)\n          if (*(*(a + j) + k) < min)\n            min = *(*(a + j) + k);\n        for (k = 0; k < i; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = *(*a + j);\n        for (k = 1; k < i; k++)\n          if (*(*(a + k) + j) < min)\n            min = *(*(a + k) + j);\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j - 1) = *(*(a + k) + j);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n    }\n    printf(\"%d\\n\", sum);\n    n1--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], e, sum = 0;\n  int n, m, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    m = n;\n    for (l = 0; l < m - 1; l++) {\n      for (j = 0; j < n; j++) {\n        e = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= e;\n      }\n      for (k = 0; k < n; k++) {\n        e = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] -= e;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - 1; k++) {\n        for (j = 1; j < n; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      n -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    n = m;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], mini = INT_MAX, sum = 0;\n  scanf(\"%d \", &n);\n  for (int c = 1; c <= n; c++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[i][j]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[i][l] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[j][i]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[l][i] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      sum += a[1][1];\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 1; j <= n - k - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (int j = 0; j <= n - k - 1; j++) {\n        for (int i = 1; i <= n - k - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33472", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint xiao(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  return a[1][1];\n}\n\nvoid suo(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return;\n}\n\nint main() {\n  int n, l, i, j;\n  scanf(\"%d \", &n);\n  for (l = 0; l < n; l++) {\n    int count = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    i = n;\n    while (i > 1) {\n      count = count + xiao(i);\n      suo(i);\n      i--;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, k, iTemp;\n  scanf(\"%d \", &n);\n  int a[n][n][n], iSum[n];\n  memset(iSum, 0, sizeof(iSum));\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 1; t <= n - 1; t++) {\n      for (j = 0; j <= n - 1; j++) {\n        if (a[i][j][0] < 0) {\n          continue;\n        } else {\n          iTemp = a[i][j][0];\n        }\n        for (k = 0; k <= n - 1; k++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (k = 0; k <= n - 1; k++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        if (a[i][0][k] < 0) {\n          continue;\n        } else {\n          iTemp = a[i][0][k];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (j = 0; j <= n - 1; j++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      iSum[i] = iSum[i] + a[i][t][t];\n      for (k = 0; k <= n - 1; k++) {\n        a[i][t][k] = -1;\n      }\n      for (j = 0; j <= n - 1; j++) {\n        a[i][j][t] = -1;\n      }\n    }\n  }\n  cout << iSum[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << endl << iSum[i];\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33474", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, t, k, tem, min, sum;\n  scanf(\"%d \", &n);\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    tem = n;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < tem; i++) {\n        min = a[i][0];\n        for (j = 1; j < tem; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tem; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < tem; j++) {\n        min = a[0][j];\n        for (i = 1; i < tem; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < tem; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < tem; i++) {\n        for (j = 0; j < tem; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < tem; j++) {\n        for (i = 0; i < tem; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      tem--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33475", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100]; \nint sum;         \nint f(int n)     \n{\n  if (n == 1)\n    return 0;                 \n  int i, j, min = 0, sum = 0; \n  for (i = 0; i < n; i++)     \n  {\n    min = a[i][0];          \n    for (j = 0; j < n; j++) \n    {\n      if (a[i][j] < min)\n        min = a[i][j]; \n    }\n    for (j = 0; j < n; j++)    \n      a[i][j] = a[i][j] - min; \n  }\n  for (i = 0; i < n; i++) \n  {\n    min = a[0][i];          \n    for (j = 0; j < n; j++) \n    {\n      if (a[j][i] < min)\n        min = a[j][i]; \n    }\n    for (j = 0; j < n; j++)    \n      a[j][i] = a[j][i] - min; \n  }\n  sum = sum + a[1][1];    \n  for (i = 0; i < n; i++) \n  {\n    for (j = 2; j < n; j++) \n    {\n      a[i][j - 1] = a[i][j]; \n    }\n  }\n  for (i = 2; i < n; i++) \n  {\n    for (j = 0; j < n - 1; j++) \n    {\n      a[i - 1][j] = a[i][j]; \n    }\n  }\n  return sum + f(n - 1); \n}\nint main() {\n  int i, n, j, k, x, sum; \n  cin >> n;               \n  for (i = 0; i < n; i++) \n  {\n    x = 0;                    \n    sum = 0;                  \n    for (j = 0; j < n; j++)   \n      for (k = 0; k < n; k++) \n        cin >> a[j][k];       \n    x = f(n);                 \n    cout << x << endl;        \n  }\n  return 0; \n}\n"}
{"label": "18", "index": "33476", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint a[100][100];\nvoid guiling(int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  } \n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  } \n}\nint sum(int n) {\n  int i, j;\n  guiling(n); \n  int m;\n  if (n == 2)\n    return a[1][1]; \n  m = a[1][1];\n  for (i = 1; i < n - 1; i++) \n  {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return m + sum(n - 1); \n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33477", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int n);\nint a[100][100];\nint main() {\n  int n;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33478", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[101][101]; \n\nint f(int n) { \n  if (n == 1)\n    return 0;             \n  int h, w, mw, mh, i, j; \n  for (i = 1; i <= n; ++i) {\n    mw = 1000; \n    for (h = 1; h <= n; ++h)\n      if (a[i][h] < mw)\n        mw = a[i][h]; \n    for (h = 1; h <= n; ++h)\n      a[i][h] -= mw; \n  }\n  for (i = 1; i <= n; ++i) {\n    mh = 1000; \n    for (h = 1; h <= n; ++h)\n      if (a[h][i] < mh)\n        mh = a[h][i]; \n    for (h = 1; h <= n; ++h)\n      a[h][i] -= mh; \n  }\n  w = a[2][2]; \n  for (i = 2; i < n; ++i)\n    for (j = 1; j <= n; ++j)\n      a[i][j] = a[i + 1][j];\n  for (i = 2; i < n; ++i)\n    for (j = 1; j < n; ++j)\n      a[j][i] = a[j][i + 1]; \n  return w + f(n - 1);       \n}\n\nint main() {\n  int n, i, i1, i2;\n  cin >> n; \n  for (i = 1; i <= n; ++i) {\n    for (i1 = 1; i1 <= n; ++i1)\n      for (i2 = 1; i2 <= n; ++i2)\n        cin >> a[i1][i2]; \n    cout << f(n) << endl; \n  }\n  return 0; \n}\n"}
{"label": "18", "index": "33479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, n, sum = 0, k, l, min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (l = 1; l < n; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, p, sum;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = n; l > 1; l--) {\n      for (j = 0; j < l; j++) {\n        min = a[j][0];\n        for (k = 1; k < l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < l; j++) {\n        min = a[0][j];\n        for (k = 1; k < l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < l; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < l - 1; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[k][j] = a[k + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33481", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid rezero();\nvoid dele();\nint a[100][100], n, b, sum = 0;\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    b = n;\n    rezero();\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\nvoid rezero() {\n  int i, j, k, min;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 0; j < b; j++) {\n        if (a[i][j] <= min)\n          min = a[i][j];\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      min = a[0][i];\n      for (j = 0; j < b; j++) {\n        if (a[j][i] <= min)\n          min = a[j][i];\n      }\n      for (j = 0; j < b; j++) {\n        a[j][i] -= min;\n      }\n    }\n    dele();\n    b -= 1;\n  }\n}\nvoid dele() {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < b; i++)\n    for (j = 1; j < b - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (j = 0; j < b - 1; j++)\n    for (i = 1; i < b - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\n"}
{"label": "18", "index": "33482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[100][100], j, k, min, number = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    m = n;\n    number = 0;\n    while (m != 1) {\n      for (j = 0; j < m; j++) {\n        min = *(*(a + j) + 0);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + j) + k)) ? *(*(a + j) + k) : min;\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = *(*(a) + j);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + k) + j)) ? *(*(a + k) + j) : min;\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      number = number + *(*(a + 1) + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + 0) + j) = *(*(a + 0) + j + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + j) + 0) = *(*(a + j + 1) + 0);\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + k - 1) + j - 1) = *(*(a + k) + j);\n      m = m - 1;\n    }\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n  int num;\n  cin >> num;\n  int an[100][100];\n  for (int c = 0; c < num; c++) {\n\n    for (int i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> *(*(an + i) + j);\n    }\n    int sum = 0;\n    int hang;\n    for (hang = num; hang > 1; hang--) {\n      int a = 0, b = 0;\n      for (m = 0; m < hang; m++) {\n        a = *(*(an + m) + 0);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + m) + n) < a)\n            a = *(*(an + m) + n);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + m) + n) = *(*(an + m) + n) - a;\n      }\n\n      for (m = 0; m < hang; m++) {\n        b = *(*(an + 0) + m);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + n) + m) < b)\n            b = *(*(an + n) + m);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + n) + m) = *(*(an + n) + m) - b;\n      }\n      sum = sum + an[1][1];\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + i) + j) = *(*(an + i) + j + 1);\n      }\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + j) + i) = *(*(an + j + 1) + i);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33484", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid shrink(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0], j;\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i], j;\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  shrink(n);\n  return k + Sum(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33485", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[101] = {0}, min;\n  int i, j, k, l, h, n;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      for (l = 0; l <= n - j; l++) {\n        min = a[l][0];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[l][h]) {\n            min = a[l][h];\n          }\n        }\n        for (h = 0; h <= n - j; h++)\n          a[l][h] = a[l][h] - min;\n      }\n      for (l = 0; l <= n - j; l++) {\n        min = a[0][l];\n        for (h = 0; h <= n - j; h++) {\n          if (min > a[h][l]) {\n            min = a[h][l];\n          }\n        }\n        for (h = 0; h <= n - j; h++) {\n          a[h][l] = a[h][l] - min;\n        }\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (l = 1; l <= n - j - 1; l++) {\n        a[0][l] = a[0][l + 1];\n        a[l][0] = a[l + 1][0];\n      }\n      for (l = 1; l <= n - j - 1; l++) {\n        for (h = 1; h <= n - j - 1; h++) {\n          a[l][h] = a[l + 1][h + 1];\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << sum[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33486", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int num[100][100], int n) {\n  int m = 0, i = 0, k = 0, sum = 0, j = 0;\n  int l[100], s[100];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      l[j] = 0;\n      s[j] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      if (num[j][0] >= 0) {\n        l[j] = num[j][0];\n        for (k = 0; k < n; k++) {\n          if (num[j][k] >= 0 && num[j][k] < l[j])\n            l[j] = num[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          num[j][k] = num[j][k] - l[j];\n        }\n      }\n    }\n    cout << endl;\n    for (j = 0; j < n; j++) {\n      if (num[0][j] >= 0) {\n        s[j] = num[0][j];\n        for (k = 0; k < n; k++) {\n          if (num[k][j] >= 0 && num[k][j] < s[j])\n            s[j] = num[k][j];\n        }\n        for (k = 0; k < n; k++) {\n          num[k][j] = num[k][j] - s[j];\n        }\n      }\n    }\n    sum = sum + num[i][i];\n    for (j = 0; j < n; j++) {\n      num[i][j] = -10;\n      num[j][i] = -10;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, sum = 0;\n  int num[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < 100; j++)\n      for (k = 0; k < 100; k++)\n        num[j][k] = -10;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &num[j][k]);\n    sum = cut(num, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33487", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int);\nint zhen[100][100];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    memset(zhen, 0, sizeof(zhen));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> zhen[i][j];\n    }\n    cout << juzhen(n) << endl;\n  }\n  return 0;\n}\nint juzhen(int n) {\n  int i, j, min, num;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = zhen[i][0];\n    for (j = 0; j < n; j++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      zhen[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = zhen[0][j];\n    for (i = 0; i < n; i++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      zhen[i][j] -= min;\n    }\n  }\n  num = zhen[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i > 1 && j > 1)\n        zhen[i - 1][j - 1] = zhen[i][j];\n      if (i > 1 && j < 1)\n        zhen[i - 1][j] = zhen[i][j];\n      if (i < 1 && j > 1)\n        zhen[i][j - 1] = zhen[i][j];\n    }\n  }\n  return num + juzhen(n - 1);\n}\n"}
{"label": "18", "index": "33488", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid sub(int a[1000], int n) {\n  int i, min = a[0];\n  for (i = 1; i < n; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < n; i++)\n    a[i] -= min;\n}\nint main() {\n  int n, k, i, j, count, sum;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    int a[1000][1000], temp[1000];\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (count = 0; count < n - 1; count++) {\n      for (i = count; i < n; i++) {\n        for (j = count; j < n; j++)\n          temp[j - count] = a[i][j];\n        sub(temp, n - count);\n        for (j = count; j < n; j++)\n          a[i][j] = temp[j - count];\n      }\n      for (j = count; j < n; j++) {\n        for (i = count; i < n; i++)\n          temp[i - count] = a[i][j];\n        sub(temp, n - count);\n        for (i = count; i < n; i++)\n          a[i][j] = temp[i - count];\n      }\n      sum += a[count + 1][count + 1];\n      for (i = 0; i < n; i++)\n        a[i][count + 1] = a[i][count];\n      for (j = 0; j < n; j++)\n        a[count + 1][j] = a[count][j];\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint zero(int);\nvoid reduce(int);\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    cout << zero(n) << \"\\n\";\n  }\n  return 0;\n}\nint zero(int count) {\n  int i, j, sum = 0;\n  while (count >= 2) {\n    for (i = 0; i < count; i++) {\n      int min = a[i][0];\n      for (j = 1; j < count; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < count; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < count; i++) {\n      int min = a[0][i];\n      for (j = 1; j < count; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < count; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    reduce(count);\n    count--;\n  }\n  return sum;\n}\nvoid reduce(int count) {\n  for (int i = 1; i < count - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < count - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33490", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], j, k, l, sum = 0;\n    for (k = 0; k <= n - 1; k++)\n      for (l = 0; l <= n - 1; l++)\n        cin >> a[k][l];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = a[k][0];\n        for (l = 1; l <= n - j; l++)\n          if (a[k][l] < min)\n            min = a[k][l];\n        for (l = 0; l <= n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = a[0][k];\n        for (l = 1; l <= n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l <= n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (k = 2; k <= n - j; k++) {\n        a[0][k - 1] = a[0][k];\n        a[k - 1][0] = a[k][0];\n      }\n      for (k = 2; k <= n - j; k++)\n        for (l = 2; l <= n - j; l++)\n          a[k - 1][l - 1] = a[k][l];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  const int MAX = 50000;\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int jz[110][110];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    int ans = 0;\n    for (int x = 0; x < n - 1; x++) {\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        for (int j = 0; j < n - x; j++)\n          jz[i][j] -= min;\n      }\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        for (int j = 0; j < n - x; j++)\n          jz[j][i] -= min;\n      }\n      ans += jz[1][1];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[i][j - 1] = jz[i][j];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[j - 1][i] = jz[j][i];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33492", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  for (int n = 0; n < N; n++) {\n    int Ma[N][N];\n    for (int i = 0; i < N; i++) {\n      for (int j = 0; j < N; j++)\n        cin >> Ma[i][j];\n    }\n    int SUM = 0;\n    for (int Now = 1; Now < N; Now++) {\n      int MINR = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINR > Ma[0][j])\n          MINR = Ma[0][j];\n      Ma[0][0] -= MINR;\n      for (int j = Now; j < N; j++)\n        Ma[0][j] -= MINR;\n      for (int i = Now; i < N; i++) {\n        int MIR = Ma[i][0];\n        for (int j = Now; j < N; j++)\n          if (MIR > Ma[i][j])\n            MIR = Ma[i][j];\n        Ma[i][0] -= MIR;\n        for (int j = Now; j < N; j++)\n          Ma[i][j] -= MIR;\n      }\n      int MINC = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINC > Ma[j][0])\n          MINC = Ma[j][0];\n      Ma[0][0] -= MINC;\n      for (int j = Now; j < N; j++)\n        Ma[j][0] -= MINC;\n      for (int i = Now; i < N; i++) {\n        int Mic = Ma[0][i];\n        for (int j = Now; j < N; j++)\n          if (Mic > Ma[j][i])\n            Mic = Ma[j][i];\n        Ma[0][i] -= Mic;\n        for (int j = Now; j < N; j++)\n          Ma[j][i] -= Mic;\n      }\n      SUM += Ma[Now][Now];\n    }\n    printf(\"%d\\n\", SUM);\n  }\n}\n"}
{"label": "18", "index": "33493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  if (a >= b) {\n    return b;\n  } else {\n    return a;\n  }\n}\nint main() {\n  int n, i, j, t, sum, x, y, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int b[100][100] = {0};\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++) {\n        scanf(\"%d\", &a[j][t]);\n        b[j][t] = a[j][t];\n      }\n    }\n    for (r = 0; r < n - 1; r++) {\n      for (j = 0; j < n; j++) {\n        x = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[j][t + 1] = f(a[j][t], a[j][t + 1]);\n        }\n        x = a[j][t];\n        for (t = 0; t < n; t++) {\n          b[j][t] = b[j][t] - x;\n          a[j][t] = b[j][t];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        y = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[t + 1][j] = f(a[t][j], a[t + 1][j]);\n        }\n        y = a[t][j];\n        for (t = 0; t < n; t++) {\n          b[t][j] = b[t][j] - y;\n          a[t][j] = b[t][j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[t][j] = a[t + 1][j];\n          b[t][j] = a[t][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[j][t] = a[j][t + 1];\n          b[j][t] = a[j][t];\n        }\n      }\n    }\n    cout << sum << \" \";\n  }\n}\n"}
{"label": "18", "index": "33494", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min = 0, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  return sum + f(n - 1);\n}\nint main() {\n  int i, n, j, k, x, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    x = f(n);\n    cout << x << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33495", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid xj(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n}\n\nvoid gl(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 1; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    xj(n);\n    gl(n - 1);\n  } else\n    return;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    gl(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33496", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int sum) {\n  int i, j, min1, min2;\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  } else {\n\n    for (i = 0; i < n; i++) {\n      min1 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min1 > a[i][j])\n          min1 = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min1;\n    }\n\n    for (i = 0; i < n; i++) {\n      min2 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min2 > a[j][i])\n          min2 = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min2;\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n    change(a, n - 1, sum);\n  }\n}\nint main() {\n  int n, a[100][100], i, j, k, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    change(a, n, sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, z, sum, min;\n  int a[105][105];\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 0; i < n - k; i++)\n        for (j = 2; j < n - k; j++)\n          *(*(a + i) + j - 1) = *(*(a + i) + j);\n      for (j = 0; j < n - k - 1; j++)\n        for (i = 2; i < n - k; i++)\n          *(*(a + i - 1) + j) = *(*(a + i) + j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n, array_1[101][101], sum[101] = {0}, k;\nvoid cut(int m) {\n  int p, q, min;\n  for (p = 0; p < n - m; p++) {\n    min = array_1[p][0];\n    for (q = 1; q < n - m; q++)\n      if (array_1[p][q] < min)\n        min = array_1[p][q];\n    for (q = 0; q < n - m; q++)\n      array_1[p][q] = array_1[p][q] - min;\n  }\n  for (p = 0; p < n - m; p++) {\n    min = array_1[0][p];\n    for (q = 1; q < n - m; q++)\n      if (array_1[q][p] < min)\n        min = array_1[q][p];\n    for (q = 0; q < n - m; q++)\n      array_1[q][p] = array_1[q][p] - min;\n  }\n  sum[k] = sum[k] + array_1[1][1];\n  for (p = 1; p < n - m - 1; p++) {\n    array_1[0][p] = array_1[0][p + 1];\n    array_1[p][0] = array_1[p + 1][0];\n  }\n  for (p = 1; p < n - m - 1; p++)\n    for (q = 1; q < n - m - 1; q++)\n      array_1[p][q] = array_1[p + 1][q + 1];\n}\nint main() {\n  int i, j;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &array_1[i][j]);\n    for (i = 0; i < n - 1; i++)\n      cut(i);\n  }\n  for (k = 0; k < n; k++)\n    cout << sum[k];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33499", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s = 0, min, n0, a[100][100] = {0}, temp[100][100];\n  scanf(\"%d \", &n0);\n  for (int z = 0; z < n0; ++z) {\n    s = 0;\n    for (int i = 0; i < n0; ++i)\n      for (int j = 0; j < n0; ++j) {\n        cin >> a[i][j];\n      }\n    for (int n = n0; n > 1; --n) {\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[k][l];\n          else\n            min = min > a[k][l] ? a[k][l] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[k][l] -= min;\n        }\n      }\n\n      for (int k = 0; k < n; ++k) {\n        for (int l = 0; l < n; ++l) {\n          if (l == 0)\n            min = a[l][k];\n          else\n            min = min > a[l][k] ? a[l][k] : min;\n        }\n\n        for (int l = 0; l < n; ++l) {\n          a[l][k] -= min;\n        }\n      }\n\n      s += a[1][1];\n      for (int i = 0; i < n; ++i)\n        for (int j = 0; j < n; ++j) {\n          temp[i][j] = a[i][j];\n        }\n      for (int i = 2; i < n; ++i) {\n        a[i - 1][0] = temp[i][0];\n      }\n      for (int i = 2; i < n; ++i) {\n        a[0][i - 1] = temp[0][i];\n      }\n      for (int i = 2; i < n; ++i)\n        for (int j = 2; j < n; ++j) {\n          a[i - 1][j - 1] = temp[i][j];\n        }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33500", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint changeSum(int, int, int[][100]);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int j, k, a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    printf(\"%d\\n\", changeSum(n, 0, a));\n  }\n  return 0;\n}\n\nint changeSum(int n, int sum, int a[][100]) {\n  if (n == 1)\n    return sum;\n  else {\n    int j, k, minrow, mincol;\n    for (j = 0; j < n; j++) {\n      minrow = a[j][0];\n      for (k = 1; k < n; k++)\n        if (a[j][k] < minrow)\n          minrow = a[j][k];\n      for (k = 0; k < n; k++)\n        a[j][k] -= minrow;\n    }\n    for (k = 0; k < n; k++) {\n      mincol = a[0][k];\n      for (j = 1; j < n; j++)\n        if (a[j][k] < mincol)\n          mincol = a[j][k];\n      for (j = 0; j < n; j++)\n        a[j][k] -= mincol;\n    }\n    sum += a[1][1];\n    for (j = 2; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j - 1][k] = a[j][k];\n    for (j = 0; j < n; j++)\n      for (k = 2; k < n; k++)\n        a[j][k - 1] = a[j][k];\n    n--;\n    changeSum(n, sum, a);\n  }\n}\n"}
{"label": "18", "index": "33501", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int[100][100], int);\n\nint main() {\n  int n, k, i, j;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    cout << sum(a, n) << \"\\n\";\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) {\n  int p, i, j, min;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  p = a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  return p + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "33502", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, s1;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int s = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    s1 = n;\n    while (s1 > 1) {\n      for (j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (k = 1; k < n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        int min1 = a[0][k];\n        for (j = 1; j < n; j++)\n          if (a[j][k] < min1)\n            min1 = a[j][k];\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min1;\n      }\n      s = s + a[1][1];\n      s1 = s1 - 1;\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33503", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = a[i][0];\n        for (int j = 1; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = a[0][i];\n        for (int j = 1; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33504", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], min, i, j, k, num, sum, n, m, x, y;\n  cin >> n;\n  for (num = 1; num <= n; num++) {\n    memset(b, 0, sizeof(b));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(b + i * n + j);\n      }\n\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      memset(a, 0, sizeof(a));\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(b + i * k + j);\n\n      for (i = 0; i < k; i++) {\n        min = 3000;\n        for (j = 0; j < k; j++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = 3000;\n        for (i = 0; i < k; i++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (i = 0; i < k; i++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n\n      memset(b, 0, sizeof(b));\n      sum = sum + a[k + 1];\n      x = -1;\n      for (i = 0; i < k; i++) {\n        if (i != 1) {\n          x++;\n          y = -1;\n          for (j = 0; j < k; j++)\n            if (j != 1) {\n              y++;\n              *(b + x * k + y - x) = *(a + i * k + j);\n            }\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33505", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], n;\n  scanf(\"%d \", &n);\n  for (int x = 0; x < n; x++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[x][i][j];\n    }\n  }\n  for (int x = 0; x < n; x++) {\n    int sum = 0;\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = a[x][i][0];\n        for (int j = 0; j < m; j++) {\n          if (a[x][i][j] < min) {\n            min = a[x][i][j];\n          }\n        }\n        for (int k = 0; k < m; k++)\n          a[x][i][k] -= min;\n      }\n      for (int j = 0; j < m; j++) {\n        int min = a[x][0][j];\n        for (int i = 0; i < m; i++) {\n          if (a[x][i][j] < min)\n            min = a[x][i][j];\n        }\n        for (int k = 0; k < m; k++)\n          a[x][k][j] -= min;\n      }\n      sum += a[x][1][1];\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < m; j++) {\n          if (i == 0 && j > 1) {\n            a[x][i][j - 1] = a[x][i][j];\n          }\n          if (i > 1) {\n            if (j == 0) {\n              a[x][i - 1][j] = a[x][i][j];\n            }\n            if (j > 1) {\n              a[x][i - 1][j - 1] = a[x][i][j];\n            }\n          }\n        }\n      }\n      m--;\n    }\n    cout << sum << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33506", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint changeSum(int, int, int[][100]);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int j, k, a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << changeSum(n, 0, a) << endl;\n  }\n  return 0;\n}\n\nint changeSum(int n, int sum, int a[][100]) {\n  if (n == 1)\n    return sum;\n  else {\n    int j, k, minrow, mincol;\n    for (j = 0; j < n; j++) {\n      minrow = a[j][0];\n      for (k = 1; k < n; k++)\n        if (a[j][k] < minrow)\n          minrow = a[j][k];\n      for (k = 0; k < n; k++)\n        a[j][k] -= minrow;\n    }\n    for (k = 0; k < n; k++) {\n      mincol = a[0][k];\n      for (j = 1; j < n; j++)\n        if (a[j][k] < mincol)\n          mincol = a[j][k];\n      for (j = 0; j < n; j++)\n        a[j][k] -= mincol;\n    }\n    sum += a[1][1];\n    for (j = 2; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j - 1][k] = a[j][k];\n    for (j = 0; j < n; j++)\n      for (k = 2; k < n; k++)\n        a[j][k - 1] = a[j][k];\n    n--;\n    changeSum(n, sum, a);\n  }\n}\n"}
{"label": "18", "index": "33507", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, t, N;\n  cin >> n;\n  int jz[n][n][n], min, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    N = n;\n    sum = 0;\n    for (t = 1; t < n; t++) {\n      for (i = 0; i < N; i++) {   \n        min = jz[k][i][0];        \n        for (j = 0; j < N; j++) { \n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];             \n        }                                  \n        for (j = 0; j < N; j++) {          \n          jz[k][i][j] = jz[k][i][j] - min; \n        }                                  \n      }                                    \n      for (j = 0; j < N; j++) {            \n        min = jz[k][0][j];                 \n        for (i = 0; i < N; i++) {          \n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];             \n        }                                  \n        for (i = 0; i < N; i++) {          \n          jz[k][i][j] = jz[k][i][j] - min; \n        }                                  \n      }                                    \n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i + 1][j];\n        }\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j + 1];\n        }\n      }\n      N--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint sum;\nvoid guiling(int a[100][100], int p) {\n  int t, s;\n  int min1, min2;\n  for (s = 0; s < p; s++) {\n    min1 = a[s][0];\n    for (t = 1; t < p; t++)\n      if (a[s][t] < min1)\n        min1 = a[s][t];\n    for (t = 0; t < p; t++)\n      a[s][t] = a[s][t] - min1;\n  }\n  for (t = 0; t < p; t++) {\n    min2 = a[0][t];\n    for (s = 1; s < p; s++)\n      if (a[s][t] < min2)\n        min2 = a[s][t];\n    for (s = 0; s < p; s++)\n      a[s][t] = a[s][t] - min2;\n  }\n  sum = sum + a[1][1];\n}\nvoid xiaojian(int a[100][100], int p) {\n  int i, j;\n  for (i = 0; i < p; i++)\n    for (j = 1; j < p - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < p - 1; j++)\n    for (i = 1; i < p - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int n;\n  int a[100][100];\n  int i, j, k, t;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (t = n; t >= 2; t--) {\n      guiling(a, t);\n      xiaojian(a, t);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33509", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], b[100], c[100];\nint xiao(int n) {\n  int x;\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[i]][c[j]] < min)\n        min = a[b[i]][b[j]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[i]][c[j]] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[j]][c[i]] <= min)\n        min = a[b[j]][b[i]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[j]][c[i]] -= min;\n    }\n  }\n  x = a[b[1]][c[1]];\n  if (n > 2) {\n    for (int i = 1; i < n - 1; i++) {\n      b[i] = b[i + 1];\n      c[i] = c[i + 1];\n    }\n    return (x + xiao(n - 1));\n  } else\n    return x;\n}\nint main() {\n  int n;\n\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (int i = 0; i < n; i++) {\n      b[i] = c[i] = i;\n    }\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[][100], int k) {\n  int i, j, min;\n  for (j = 0; j < k; j++) {\n    min = a[j][0];\n    for (i = 1; i < k; i++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (i = 0; i < k; i++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    min = a[0][i];\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid f2(int a[][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[j][i] = a[j + 1][i];\n  }\n}\nint main() {\n  int n, z, k;\n  scanf(\"%d\", &n);\n  k = n;\n  for (z = 0; z < n; z++) {\n    int i, j, sum = 0;\n    int a[100][100];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    k = n;\n    for (k; k > 1; k--) {\n      f1(a, k);\n      sum += a[1][1];\n      f2(a, k);\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33511", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int sz[49][49][49];\n  int i, j, k;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &sz[i][j][k]);\n      }\n    }\n  }\n  int nn, min;\n  int re[49] = {0};\n  for (i = 1; i <= n; i++) {\n    for (nn = 1; nn <= n - 1; nn++) {\n      for (j = nn; j <= n; j++) {\n        min = sz[i][j][nn];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][j][k] < min) {\n              min = sz[i][j][k];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][j][k] -= min;\n          }\n        }\n      }\n      for (j = nn; j <= n; j++) {\n        min = sz[i][nn][j];\n        while (min != 0) {\n          for (k = nn; k <= n; k++) {\n            if (sz[i][k][j] < min) {\n              min = sz[i][k][j];\n            }\n          }\n          for (k = nn; k <= n; k++) {\n            sz[i][k][j] -= min;\n          }\n        }\n      }\n      re[i] += sz[i][nn + 1][nn + 1];\n      sz[i][nn + 1][nn + 1] = sz[i][nn][nn];\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][nn + 1][j] = sz[i][nn][j];\n      }\n      for (j = nn + 2; j <= n; j++) {\n        sz[i][j][nn + 1] = sz[i][j][nn];\n      }\n    }\n    printf(\"%d\\n\", re[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[100], n, i, j, k, l, min, m;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < n - j; k++) {\n        min = a[k][0];\n        for (l = 0; l < n - j; l++)\n          if (min > a[k][l])\n            min = a[k][l];\n        for (l = 0; l < n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k < n - j; k++) {\n        min = a[0][k];\n        for (l = 0; l < n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l < n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (k = 0; k < n - j; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[k][l] = a[k][l + 1];\n      for (k = 0; k < n - j - 1; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[l][k] = a[l + 1][k];\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, min, sum = 0;\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (int k = n; k > 1; k--) {\n      for (int i = 0; i < k; i++) {\n        min = **(p + i);\n        for (int j = 1; j < k; j++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (int j = 0; j < k; j++) {\n        min = *(*p + j);\n        for (int i = 1; i < k; i++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int i = 0; i < k; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (int i = 1; i < k; i++)\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (int j = 1; j < k; j++)\n        for (int i = 0; i < k; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33514", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint main() {\n  void Subtraction(int[100][100], int);\n  int n = 0;\n  cin >> n;\n  int a[100][100];\n  for (int f = 1; f <= n; f++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    Subtraction(a, n);\n    if (f == n)\n      cout << sum;\n    else\n      cout << sum << endl;\n  }\n  return 0;\n}\nvoid Subtraction(int m[100][100], int n) {\n\n  if (n != 1) {\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[i][0];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[i][j])\n          min = m[i][j];\n      }\n      for (int j = 0; j <= n - 1; j++)\n        m[i][j] -= min;\n    }\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[0][i];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[j][i])\n          min = m[j][i];\n      }\n      for (int j = 0; j <= n - 1; j++) {\n        m[j][i] -= min;\n      }\n    }\n\n    sum += m[1][1];\n    int mtuta[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      if (i == 1)\n        continue;\n      for (int j = 0; j <= n - 1; j++) {\n        if (j == 1)\n          continue;\n\n        mtuta[i - (i != 0)][j - (j != 0)] = m[i][j];\n      }\n    }\n    Subtraction(mtuta, n - 1);\n  }\n}\n"}
{"label": "18", "index": "33515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100][100];\nint matrix(int a[][100], int n) {\n  int temp1[100], temp2[100];\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    temp1[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (temp1[i] > a[i][j])\n        temp1[i] = a[i][j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - temp1[i];\n  for (i = 0; i < n; i++) {\n    temp2[i] = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (temp2[i] > a[j][i])\n        temp2[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - temp2[i];\n\n  int sum;\n  sum = a[1][1];\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  if (n > 2)\n    sum = sum + matrix(a, n - 1);\n\n  return sum;\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (i = 0; i < n; i++)\n    cout << matrix(a[i], n) << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "33516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int n, i, j, k, sum[100] = {0}, l, min;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = n;\n    while (l > 1) {\n      for (j = 0; j < l; j++) {\n        min = 100000;\n        for (k = 0; k < l; k++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[i][j][k] -= min;\n      }\n      for (k = 0; k < l; k++) {\n        min = 100000;\n        for (j = 0; j < l; j++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (j = 0; j < l; j++)\n          a[i][j][k] -= min;\n      }\n      sum[i] += a[i][1][1];\n      for (j = 2; j < l; j++)\n        for (k = 0; k < l; k++)\n          a[i][j - 1][k] = a[i][j][k];\n      for (k = 2; k < l; k++)\n        for (j = 0; j < l; j++)\n          a[i][j][k - 1] = a[i][j][k];\n      l--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33517", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, p, ans;\n  int a[101][101], g;\n  cin >> n;\n  k = n;\n\n  while (k--) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    p = n;\n    while (p-- > 1) {\n      for (i = 0; i <= p; i++) {\n        g = *(*(a + i));\n        for (j = 0; j <= p; j++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (j = 0; j <= p; j++)\n          *(*(a + i) + j) -= g;\n      }\n      for (j = 0; j <= p; j++) {\n        g = *(*(a) + j);\n        for (i = 0; i <= p; i++) {\n          if (*(*(a + i) + j) < g) {\n            g = *(*(a + i) + j);\n          }\n        }\n        for (i = 0; i <= p; i++)\n          *(*(a + i) + j) -= g;\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 2; i <= p; i++)\n        *(*(a + i - 1)) = *(*(a + i));\n      for (j = 2; j <= p; j++)\n        *(*(a) + j - 1) = *(*(a) + j);\n      for (i = 2; i <= p; i++)\n        for (j = 2; j <= p; j++)\n          *(*(a + i - 1) + j - 1) = *(*(a + i) + j);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100][100], n, i, j, k;\n  int c, l, o, p, q, r, s, t;\n  int min;\n  int w, x, y, z;\n  int h, g, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (c = 1; c <= n - 1; c++) {\n    for (l = 0; l < n; l++) {\n\n      for (o = 0; o <= n - c; o++) {\n        min = a[l][o][1];\n        for (p = 0; p <= n - c; p++) {\n          if (a[l][o][p] < min)\n            min = a[l][o][p];\n        }\n        for (q = 0; q <= n - c; q++) {\n          a[l][o][q] -= min;\n        }\n      }\n      for (r = 0; r <= n - c; r++) {\n        min = a[l][1][r];\n        for (s = 0; s <= n - c; s++) {\n          if (a[l][s][r] < min)\n            min = a[l][s][r];\n        }\n        for (t = 0; t <= n - c; t++) {\n          a[l][t][r] -= min;\n        }\n      }\n      b[l][c] = a[l][1][1];\n      for (w = 1; w <= n - c - 1; w++) {\n        for (x = 0; x <= n - c; x++) {\n          a[l][w][x] = a[l][w + 1][x];\n        }\n      }\n      for (y = 1; y <= n - c - 1; y++) {\n        for (z = 0; z <= n - c; z++) {\n          a[l][z][y] = a[l][z][y + 1];\n        }\n      }\n    }\n  }\n  for (h = 0; h < n; h++) {\n    m = 0;\n    for (g = 1; g <= n - 1; g++) {\n      m += b[h][g];\n    }\n    printf(\"%d\\n\", m);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33519", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid putout(int a[200][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[200][200], int b, int num) {\n  int a1[200][200];\n  memcpy(a1, a, 40000);\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(int a[200][200], int num, int out) {\n  for (int i = 0; i < num; i++)\n    cut1(a, i, num);\n  for (int i = 0; i < num; i++)\n    cut2(a, i, num);\n  out = out + a[1][1];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++)\n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--;\n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[200][200];\n    memset(a, 0, 40000);\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0);\n    printf(\"%d\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nint check() {\n  int a[n][n];\n  int c, i, j, mi, mj, r = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      cin >> a[i][j];\n  for (c = n; c > 1; c--) {\n    for (i = 0; i < c; i++) {\n      mi = a[i][0];\n      for (j = 0; j < c; j++)\n        if (mi > a[i][j])\n          mi = a[i][j];\n      for (j = 0; j < c; j++)\n        a[i][j] -= mi;\n    }\n    for (j = 0; j < c; j++) {\n      mj = a[0][j];\n      for (i = 0; i < c; i++)\n        if (mj > a[i][j])\n          mj = a[i][j];\n      for (i = 0; i < c; i++)\n        a[i][j] -= mj;\n    }\n    r += a[c - 2][c - 2];\n    a[c - 2][c - 2] = a[c - 1][c - 1];\n    for (i = 0; i < c - 2; i++)\n      a[i][c - 2] = a[i][c - 1];\n    for (j = 0; j < c - 2; j++)\n      a[c - 2][j] = a[c - 1][j];\n  }\n  return r;\n}\nint main() {\n  int z;\n  scanf(\"%d\", &n);\n  for (z = 0; z < n; z++)\n    cout << check() << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "33521", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N = 0;\n  scanf(\"%d \", &N);\n  for (int n = 0; n < N; n++) {\n    int a[100][100] = {0};\n    int Sum = 0;\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> a[i][j];\n    for (int m = N; m > 1; m--) {\n      for (int i = 0; i < m; i++) {\n        int Min = a[i][0];\n        for (int j = 0; j < m; j++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int j = 0; j < m; j++)\n          a[i][j] = a[i][j] - Min;\n      }\n      for (int j = 0; j < m; j++) {\n        int Min = a[0][j];\n        for (int i = 0; i < m; i++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int i = 0; i < m; i++)\n          a[i][j] = a[i][j] - Min;\n      }\n      Sum = Sum + a[1][1];\n      for (int j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (int i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (int i = 1; i < m - 1; i++)\n        for (int j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    printf(\"%d\\n\", Sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33522", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n, m, the_min;\nint a[110][110];\n\nvoid reduce_min(int x, int y, int dx, int dy) {\n  if (x == m || y == m) {\n    return;\n  }\n  if (a[x][y] < the_min) {\n    the_min = a[x][y];\n  }\n  reduce_min(x + dx, y + dy, dx, dy);\n  a[x][y] -= the_min;\n}\n\nvoid reduce() {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  }\n}\n\nint main() {\n  int i, j;\n  int t;\n  int sum;\n  scanf(\"%d\", &n);\n  for (t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    for (m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        the_min = 10000;\n        reduce_min((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      reduce();\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100];\n  int i, j, k, c, d, l, sum[100] = {0}, min1, min2;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - l; j++) {\n\n          if (a[i][j] < min1)\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min1;\n      }\n\n      for (j = 0; j < n - l; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - l; i++) {\n\n          if (a[i][j] < min2)\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min2;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n      if (l == n - 2)\n        break;\n      else {\n        for (c = 0; c < n - l; c++) {\n          for (d = 2; d < n - l; d++)\n            a[c][d - 1] = a[c][d];\n        }\n        for (c = 2; c < n - l; c++) {\n          for (d = 0; d < (n - 1 - l); d++)\n            a[c - 1][d] = a[c][d];\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint Matrix(int a[][100], int sum, int n);\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    Matrix(a, sum, n);\n  }\n  return 0;\n}\n\nint Matrix(int a[][100], int sum, int n) {\n  int i, j, min;\n  if (n == 1) {\n    cout << sum << endl;\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      a[j - 1][i] = a[j][i];\n  Matrix(a, sum, n - 1);\n  return 0;\n}\n"}
{"label": "18", "index": "33525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int q;\n  int a[110][110];\n  int(*p)[110] = a;\n  scanf(\"%d \", &n);\n  q = n;\n  for (k = 1; k <= q; k++) {\n    int sum = 0;\n    n = q;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(p + i) + j);\n    while (1) {\n      if (n == 1)\n        break;\n      int min = 0;\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + j) + i))\n            min = *(*(p + j) + i);\n        for (j = 1; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      sum += a[2][2];\n      for (i = 2; i <= n - 1; i++)\n        for (j = 2; j <= n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      for (i = 2; i <= n - 1; i++) {\n        *(*(p + 1) + i) = *(*(p + 1) + i + 1);\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      }\n      n--;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001];\nint r[1001], c[1001], s = 0;\nvoid f(int n) {\n  for (int i = 0; i < n; i++) {\n    r[i] = a[i][0];\n    for (int j = 0; j < n; j++)\n      if (a[i][j] < r[i])\n        r[i] = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= r[i];\n  }\n  for (int i = 0; i < n; i++) {\n    r[i] = a[0][i];\n    for (int j = 0; j < n; j++)\n      if (a[j][i] < r[i])\n        r[i] = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= r[i];\n  }\n  s += a[1][1];\n  if (n == 2) {\n    cout << s << \"\\n\";\n    return;\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n - 1; j++)\n      a[j][i] = a[j][i + 1];\n  f(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int t = n;\n  while (t--) {\n    s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33527", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min;\n  int a[103][103];\n  cin >> n;\n  for (int count = 1; count <= n; count++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int n0 = n, sum = 0;\n    while (n0 >= 2) {\n      for (i = 0; i < n0; i++) {\n        min = a[i][0];\n        for (j = 1; j < n0; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n0; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n0; j++) {\n        min = a[0][j];\n        for (i = 1; i < n0; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n0; i++) {\n          a[i][j] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < n0; i++)\n        for (j = 0; j < n0; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n0; j++)\n        for (i = 0; i < n0; i++)\n          a[i][j] = a[i][j + 1];\n      n0--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint sum(int n) {\n  if (n == 1)\n    return 0;\n  else {\n    int i, j, m;\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[i][j] < m)\n          m = a[i][j];\n      for (j = 0; j < n; ++j)\n        a[i][j] -= m;\n    }\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[j][i] < m)\n          m = a[j][i];\n      for (j = 0; j < n; ++j)\n        a[j][i] -= m;\n    }\n    int num = a[1][1];\n    for (i = 0; i < n; ++i)\n      for (j = 2; j < n; ++j)\n        a[i][j - 1] = a[i][j];\n    for (i = 0; i < n - 1; ++i)\n      for (j = 2; j < n; ++j)\n        a[j - 1][i] = a[j][i];\n    return num + sum(n - 1);\n  }\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33529", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, mymin;\nint a[110][110];\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < mymin)\n    mymin = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= mymin;\n}\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, sum, t;\n  for (scanf(\"%d \", &n), t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mymin = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33530", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint juzhen() {\n  int j1, j2, j3, j4, j5;\n  int min, sum = 0;\n  for (j1 = n; j1 > 1; j1--) {\n    for (j2 = 0; j2 < j1; j2++) {\n      min = a[j2][0];\n      for (j3 = 0; j3 < j1; j3++) {\n        if (a[j2][j3] < min)\n          min = a[j2][j3];\n      }\n      for (j3 = 0; j3 < j1; j3++) {\n        a[j2][j3] = a[j2][j3] - min;\n      }\n    }\n    for (j4 = 0; j4 < j1; j4++) {\n      min = a[0][j4];\n      for (j5 = 0; j5 < j1; j5++) {\n        if (a[j5][j4] < min)\n          min = a[j5][j4];\n      }\n      for (j5 = 0; j5 < j1; j5++) {\n        a[j5][j4] = a[j5][j4] - min;\n      }\n    }\n    sum = sum + a[1][1];\n    for (j2 = 0; j2 < j1; j2++) {\n      for (j3 = 0; j3 < j1; j3++) {\n        if (j2 == 0 && j3 > 1)\n          a[j2][j3 - 1] = a[j2][j3];\n        if (j3 == 0 && j2 > 1)\n          a[j2 - 1][j3] = a[j2][j3];\n\n        if (j2 > 1 && j3 > 1)\n          a[j2 - 1][j3 - 1] = a[j2][j3];\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int m1, m2, m3, sum;\n  cin >> n;\n  for (m1 = 1; m1 <= n; m1++) {\n    for (m2 = 0; m2 < n; m2++) {\n      for (m3 = 0; m3 < n; m3++)\n        cin >> a[m2][m3];\n    }\n    sum = juzhen();\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33531", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l, min, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n      for (k = 0; k < j; k++) {\n        min = a[k][0];\n        for (l = 0; l < j; l++) {\n          if (min > a[k][l])\n            min = a[k][l];\n        }\n        for (l = 0; l < j; l++) {\n          a[k][l] = a[k][l] - min;\n        }\n      }\n      for (k = 0; k < j; k++) {\n        min = a[0][k];\n        for (l = 0; l < j; l++) {\n          if (min > a[l][k]) {\n            min = a[l][k];\n          }\n        }\n        for (l = 0; l < j; l++) {\n          a[l][k] = a[l][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < j - 1; k++) {\n        a[k][0] = a[k + 1][0];\n        a[0][k] = a[0][k + 1];\n      }\n      for (k = 1; k < j - 1; k++) {\n        for (l = 1; l < j - 1; l++) {\n          a[k][l] = a[k + 1][l + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33532", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, c[100], a[100][100], sum, l;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = 1; l <= n - 1; l++) {\n\n      c[0] = a[0][0];\n      for (k = l; k < n; k++) {\n        if (c[0] > a[0][k])\n          c[0] = a[0][k];\n      }\n      for (k = 0; k < n; k++) {\n        a[0][k] = a[0][k] - c[0];\n      }\n      c[0] = a[0][0];\n      for (j = l; j < n; j++) {\n        c[j] = a[j][0];\n        for (k = l; k < n; k++) {\n          if (c[j] > a[j][k])\n            c[j] = a[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - c[j];\n        }\n      }\n      for (k = l; k < n; k++) {\n        c[k] = a[0][k];\n        for (j = l; j < n; j++) {\n          if (c[k] > a[j][k])\n            c[k] = a[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - c[k];\n        }\n      }\n      for (j = l; j < n; j++) {\n        if (c[0] > a[j][0])\n          c[0] = a[j][0];\n      }\n      for (j = 0; j < n; j++) {\n        a[j][0] = a[j][0] - c[0];\n      }\n      sum = sum + a[l][l];\n    }\n    cout << sum << \" \";\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "18", "index": "33533", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[200][200][200];\n\nint main() {\n  int n, sum[200];\n  int p, k, i, j;\n  int min;\n\n  cin >> n;\n\n  for (p = 0; p < n; p++) {\n    sum[p] = 0;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[p][i][j];\n\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[p][i][0];\n        for (j = 0; j < n - k; j++) {\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        min = a[p][0][j];\n        for (i = 0; i < n - k; i++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (i = 0; i < n - k; i++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      sum[p] = sum[p] + a[p][1][1];\n\n      for (i = 1; i < n - k; i++)\n        a[p][i][0] = a[p][i + 1][0];\n      for (j = 1; j < n - k; j++)\n        a[p][0][j] = a[p][0][j + 1];\n      for (i = 1; i < n - k; i++)\n        for (j = 1; j < n - k; j++)\n          a[p][i][j] = a[p][i + 1][j + 1];\n    }\n  }\n\n  for (p = 0; p < n - 1; p++)\n    printf(\"%d\\n\", sum[p]);\n  printf(\"%d\", sum[n - 1]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "33534", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0;\nint main() {\n  void Subtraction(int[100][100], int);\n  int n = 0;\n  cin >> n;\n  int a[100][100];\n  for (int f = 1; f <= n; f++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    Subtraction(a, n);\n    if (f == n)\n      cout << sum;\n    else {\n      cout << sum << endl;\n    }\n  }\n  return 0;\n}\nvoid Subtraction(int m[100][100], int n) {\n\n  if (n != 1) {\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[i][0];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[i][j])\n          min = m[i][j];\n      }\n      for (int j = 0; j <= n - 1; j++)\n        m[i][j] -= min;\n    }\n\n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[0][i];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[j][i])\n          min = m[j][i];\n      }\n      for (int j = 0; j <= n - 1; j++) {\n        m[j][i] -= min;\n      }\n    }\n\n    sum += m[1][1];\n    int mtuta[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      if (i == 1)\n        continue;\n      for (int j = 0; j <= n - 1; j++) {\n        if (j == 1)\n          continue;\n\n        mtuta[i - (i != 0)][j - (j != 0)] = m[i][j];\n      }\n    }\n    Subtraction(mtuta, n - 1);\n  }\n}\n"}
{"label": "18", "index": "33535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n, sum;\n\nvoid evaluation() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  n--;\n}\n\nint operation() {\n  int min;\n  if (n == 1) {\n    cout << sum << endl;\n    return 0;\n  } else {\n    for (int i = 0; i < n; i++) {\n      min = 100000;\n      for (int j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (int j = 0; j < n; j++) {\n      min = 100000;\n      for (int i = 0; i < n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n    sum += a[1][1];\n    evaluation();\n    operation();\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  for (int k = 0; k < N; k++) {\n    sum = 0;\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    operation();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33536", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[100][100], sum;\nvoid col(int c) {\n  if (c == n) {\n    cout << sum << endl;\n    return;\n  }\n  int min;\n  for (int i = 0; i <= n - c; i++) {\n    min = a[i][0];\n    for (int j = 1; j <= n - c; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[i][j] = a[i][j] - min;\n  }\n  for (int i = 0; i <= n - c; i++) {\n    min = a[0][i];\n    for (int j = 1; j <= n - c; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[j][i] = a[j][i] - min;\n  }\n  sum += a[1][1];\n  a[1][1] = a[2][2];\n  for (int i = 1; i < n - c; i++)\n    a[0][i] = a[0][i + 1];\n  for (int i = 1; i < n - c; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < n - c; i++)\n    for (int j = 1; j < n - c; j++)\n      a[i][j] = a[i + 1][j + 1];\n  col(c + 1);\n}\nint main() {\n  cin >> n;\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    col(1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33537", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, a[201][201];\nint i, j, sum;\nint min1[201], min2[201];\nvoid read();\nvoid del(int);\nvoid move(int);\nint main() {\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    read();\n    sum = 0;\n    for (j = 0; j < n - 1; ++j) {\n\n      del(n - j);          \n      sum = sum + a[1][1]; \n      move(n - j);         \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid read() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n}\nvoid del(int n) {\n  for (i = 0; i < n; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min1[i])\n        min1[i] = a[i][j];\n    \n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min1[i];\n  \n  for (i = 0; i < n; i++) {\n    min2[i] = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min2[i])\n        min2[i] = a[j][i];\n    \n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min2[i];\n  \n}\nvoid move(int n) {\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n}\n"}
{"label": "18", "index": "33538", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, nn, a[100][100], sum, min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    nn = n;\n    while (nn > 1) {\n      for (i = 0; i < nn; i++) {\n        min = a[i][0];\n        for (j = 0; j < nn; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < nn; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < nn; j++) {\n        min = a[0][j];\n        for (i = 0; i < nn; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i < nn; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < nn - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < nn - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < nn - 1; i++)\n        for (j = 1; j < nn - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      nn = nn - 1;\n    }\n    if (k == 1)\n      cout << sum;\n    else\n      printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33539", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = a[j][0];\n        for (k = 1; k < i; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < i; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = a[0][j];\n        for (k = 1; k < i; k++)\n          if (a[k][j] < min)\n            min = a[k][j];\n        for (k = 0; k < i; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[k][j - 1] = a[k][j];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[j - 1][k] = a[j][k];\n    }\n    printf(\"%d\\n\", sum);\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "33540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, k, iTemp;\n  cin >> n;\n  int a[n][n][n], iSum[n];\n  memset(iSum, 0, sizeof(iSum));\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {\n    for (t = 1; t <= n - 1; t++) {\n      for (j = 0; j <= n - 1; j++) {\n        if (a[i][j][0] < 0) {\n          continue;\n        } else {\n          iTemp = a[i][j][0];\n        }\n        for (k = 0; k <= n - 1; k++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (k = 0; k <= n - 1; k++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        if (a[i][0][k] < 0) {\n          continue;\n        } else {\n          iTemp = a[i][0][k];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (j = 0; j <= n - 1; j++) {\n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      iSum[i] = iSum[i] + a[i][t][t];\n      for (k = 0; k <= n - 1; k++) {\n        a[i][t][k] = -1;\n      }\n      for (j = 0; j <= n - 1; j++) {\n        a[i][j][t] = -1;\n      }\n    }\n  }\n  cout << iSum[0];\n  for (i = 1; i <= n - 1; i++) {\n    cout << \"\\n\" << iSum[i];\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33541", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, num, ans, a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) \n  {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    } \n    ans = 0;\n    for (num = 0; num < n - 1; num++) \n    {\n      int min1, min2;\n      for (i = 0; i < n - num; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - num; j++) {\n          if (min1 > a[i][j])\n            min1 = a[i][j]; \n        }\n        for (j = 0; j < n - num; j++) {\n          a[i][j] -= min1;\n        }\n      } \n      for (j = 0; j < n - num; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - num; i++) {\n          if (min2 > a[i][j])\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - num; i++) {\n          a[i][j] -= min2;\n        }\n      }               \n      ans += a[1][1]; \n      for (i = 1; i < n - num - 1; i++) {\n        for (j = 0; j < n - num; j++)\n          a[i][j] = a[i + 1][j];\n      } \n      for (j = 1; j < n - num - 1; j++) {\n        for (i = 0; i < n - num - 1; i++)\n          a[i][j] = a[i][j + 1];\n      } \n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33542", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint an[1000][1000];\n\nint hang[1000], lie[1000];\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, l, p, q;\n\n  for (l = 0; l < n; l++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> an[i][j];\n    }\n\n    int sum = 0;\n\n    for (k = n; k > 0; k--) {\n\n      for (p = 0; p < k; p++) {\n        hang[p] = an[p][0];\n        for (q = 0; q < k; q++) {\n          if (hang[p] > an[p][q])\n            hang[p] = an[p][q];\n        }\n        for (q = 0; q < k; q++)\n          an[p][q] = an[p][q] - hang[p];\n      }\n\n      for (q = 0; q < k; q++) {\n        lie[q] = an[0][q];\n        for (p = 0; p < k; p++) {\n          if (lie[q] > an[p][q])\n            lie[q] = an[p][q];\n        }\n        for (p = 0; p < k; p++)\n          an[p][q] = an[p][q] - lie[q];\n      }\n\n      sum = sum + an[1][1];\n\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k; j++)\n          an[i][j] = an[i][j + 1];\n      }\n      for (i = 1; i < k; i++) {\n        for (j = 0; j < k; j++)\n          an[i][j] = an[i + 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, k, l, tot = 0;\nint sum(int a[][101], int n) {\n  if (n == 1) {\n    return tot;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    l = a[i][0];\n    for (j = 0; j <= n - 2; j++) {\n      l = min(l, a[i][j + 1]);\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[i][j] -= l;\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    l = a[0][j];\n    for (i = 0; i <= n - 2; i++) {\n      l = min(l, a[i + 1][j]);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      a[i][j] -= l;\n    }\n  }\n  tot += a[1][1];\n  for (i = 1; i <= n - 2; i++) {\n    for (j = 1; j <= n - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  for (i = 1; i <= n - 2; i++) {\n    a[i][0] = a[i + 1][0];\n  }\n  for (j = 1; j <= n - 2; j++) {\n    a[0][j] = a[0][j + 1];\n  }\n  n--;\n  sum(a, n);\n}\nint main() {\n  int a[101][101];\n  int n;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    cout << sum(a, n) << endl;\n    tot = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid jian(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  if (n > 2) {\n    for (i = 1; i < (n - 1); i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (i = 1; i < (n - 1); i++)\n      for (j = 0; j < (n - 1); j++)\n        a[j][i] = a[j][i + 1];\n    for (i = 0; i < n; i++) {\n      a[n - 1][i] = '\\0';\n      a[i][n - 1] = '\\0';\n    }\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {'\\0'}, sum, n1;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n1 > 1) {\n      jian(a, n1);\n      sum += a[1][1];\n      move(a, n1);\n      n1--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33545", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[101][101] = {0};\n  int small[101] = {0};\n  int sum = 0;\n  int i, j, k, l;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[k][1];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++) {\n          if (a[k][l] < small[k])\n            small[k] = a[k][l];\n        }\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k][l] - small[k];\n\n      for (k = 1; k <= n - j + 1; k++)\n        small[k] = a[1][k];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          if (a[k][l] < small[l])\n            small[l] = a[k][l];\n      for (l = 1; l <= n - j + 1; l++)\n        for (k = 1; k <= n - j + 1; k++)\n          a[k][l] = a[k][l] - small[l];\n\n      sum = sum + a[2][2];\n      for (k = 2; k <= n - j + 1; k++)\n        for (l = 1; l <= n - j + 1; l++)\n          a[k][l] = a[k + 1][l];\n      for (k = 1; k <= n - j + 1; k++)\n        for (l = 2; l <= n - j + 1; l++) {\n          a[k][l] = a[k][l + 1];\n        }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33546", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum, n;\nvoid r2z(int a[][100], int n);\nvoid sub(int a[][100], int n);\n\nint main() {\n  int i, row, col, a[100][100] = {0};\n  scanf(\"%d \", &n);\n  int m = n;\n  for (i = 0; i < m; i++) {\n    sum = 0;\n    n = m;\n    for (row = 0; row < m; row++)\n      for (col = 0; col < m; col++) {\n        scanf(\"%d \", &a[row][col]);\n      }\n    r2z(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid r2z(int a[][100], int n) {\n  int i, j, min[100];\n  for (i = 0; i < n; i++) {\n    min[i] = 10000;\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = 10000;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j];\n    }\n  }\n  sum += a[1][1];\n  sub(a, n);\n}\n\nvoid sub(int a[][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n--;\n  if (n > 1)\n    r2z(a, n);\n}\n"}
{"label": "18", "index": "33547", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint a[1000][1000], n;\n\nvoid sub_to_zero() \n{\n  int m;                        \n  for (int i = 0; i < n; i++) { \n    m = a[i][0];\n    for (int j = 1; j < n; j++) { \n      if (a[i][j] < m)\n        m = a[i][j];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++) \n        a[i][j] -= m;\n    }\n  }\n  for (int i = 0; i < n; i++) { \n    m = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < m)\n        m = a[j][i];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[j][i] -= m;\n    }\n  }\n}\n\nvoid delimination() \n{\n  for (int i = 1; i < n - 1; i++) { \n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 2; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j]; \n  --n;                           \n}\n\nint calcMatrix() \n{\n  int sum = 0;      \n  while (n > 1) {   \n    sub_to_zero();  \n    sum += a[1][1]; \n    delimination(); \n  }\n  return sum;\n}\n\nint main() {\n  int nMatrix; \n  cin >> nMatrix;\n  for (int i = 0; i < nMatrix; i++) { \n    n = nMatrix;                      \n    for (int j = 0; j < nMatrix; j++)\n      for (int k = 0; k < nMatrix; k++)\n        cin >> a[j][k]; \n    cout << calcMatrix() << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33548", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], sum;\nint del(int m) {\n  if (m == 1)\n    return sum;\n  int min;\n  for (int i = 0; i < m; i++) {\n    min = a[i][0];\n    for (int j = 1; j < m; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < m; j++) {\n    min = a[0][j];\n    for (int i = 1; i < m; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int j = 1; j < m - 1; j++)\n    a[0][j] = a[0][j + 1];\n  for (int i = 1; i < m - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < m - 1; i++)\n    for (int j = 1; j < m - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return del(m - 1);\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    cout << del(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33549", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  const int MAX = 50000;\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; k++) {\n    int jz[110][110];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    int ans = 0;\n    for (int x = 0; x < n - 1; x++) {\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        for (int j = 0; j < n - x; j++)\n          jz[i][j] -= min;\n      }\n      for (int i = 0; i < n - x; i++) {\n        int min = MAX;\n        for (int j = 0; j < n - x; j++)\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        for (int j = 0; j < n - x; j++)\n          jz[j][i] -= min;\n      }\n      ans += jz[1][1];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[i][j - 1] = jz[i][j];\n      for (int i = 0; i < n - x; i++)\n        for (int j = 2; j < n - x; j++)\n          jz[j - 1][i] = jz[j][i];\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nint (*p)[101] = a;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p + i));\n    for (int j = 1; j < k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + i) + j) -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p) + i);\n    for (int j = 1; j < k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + j) + i) -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++)\n      *(*(p + i - 1) + j) = *(*(p + i) + j);\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      *(*(p + i) + j - 1) = *(*(p + i) + j);\n}\nint main() {\n  scanf(\"%d \", &n);\n  while (cin >> *(*(p))) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> *(*(p + i) + j);\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += *(*(p + 1) + 1);\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1001][1001], sum = 0;\nvoid reduce(int a[][1001], int n) {\n\n  int i, j;\n  for (i = 0; i < n; i++) \n  {\n    int min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) \n  {\n    int min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (i = 0; i < n; i++) \n  {\n    for (j = 1; j < n; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = n; i > 1; i--) {\n      reduce(a, i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33552", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid gl(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 1; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < m; i++) {\n    int min = a[0][i];\n    for (j = 1; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n}\n\nvoid xj(int m) {\n  int i, j;\n  for (i = 2; i < m; i++)\n    a[0][i - 1] = a[0][i];\n  for (i = 2; i < m; i++)\n    a[i - 1][0] = a[i][0];\n  for (i = 2; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    int sum = 0;\n    for (i = n; i > 1; i--) {\n      gl(i);\n      sum += a[1][1];\n      xj(i);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min = 0, num;\n  int s[100][100];\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    num = 0;\n    memset(s, 0, sizeof(s));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(s + i) + j);\n    for (k = 0; k <= n - 2; k++) {\n      for (i = 1; i <= n - k; i++) {\n        min = s[i][1];\n        for (j = 1; j <= n - k; j++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (j = 1; j <= n - k; j++)\n          *(*(s + i) + j) -= min;\n      }\n      for (j = 1; j <= n - k; j++) {\n        min = s[1][j];\n        for (i = 1; i <= n - k; i++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (i = 1; i <= n - k; i++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      num += s[2][2];\n      for (i = 1; i <= n - k; i++)\n        for (j = 2; j <= n - k - 1; j++)\n          *(*(s + i) + j) = *(*(s + i) + j + 1);\n      for (j = 1; j <= n - k; j++)\n        for (i = 2; i <= n - k - 1; i++)\n          *(*(s + i) + j) = *(*(s + i + 1) + j);\n    }\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i = 0, j = 0, time = 0, sum = 0;\n  scanf(\"%d \", &n);\n  int s = n;\n  int a[100][100], b[100], c[100];\n  for (time = 0; time < s; time++) {\n    for (i = 0; i < 100; i++) {\n      b[i] = 1000000;\n      c[i] = 1000000;\n    }\n    for (i = 0; i < s; i++) {\n      for (j = 0; j < s; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    while (true) {\n      for (i = 0; i < 100; i++) {\n        b[i] = 1000000;\n        c[i] = 1000000;\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < b[i]) {\n            b[i] = a[i][j];\n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i][j] - b[i];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < c[j]) {\n            c[j] = a[i][j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] = a[i][j] - c[j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < n - 1; j++) {\n        for (i = 0; i < n - 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      n = n - 1;\n      if (n == 1) {\n        n = s;\n        break;\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint zero(int);\nvoid reduce(int);\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    cout << zero(n) << endl;\n  }\n  return 0;\n}\nint zero(int count) {\n  int i, j, sum = 0;\n  while (count >= 2) {\n    for (i = 0; i < count; i++) {\n      int min = a[i][0];\n      for (j = 1; j < count; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < count; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < count; i++) {\n      int min = a[0][i];\n      for (j = 1; j < count; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < count; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    reduce(count);\n    count--;\n  }\n  return sum;\n}\nvoid reduce(int count) {\n  for (int i = 1; i < count - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < count - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33556", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint n, array_1[101][101], sum[101] = {0}, k;\nvoid cut(int m) {\n  int p, q, min;\n  for (p = 0; p < n - m; p++) {\n    min = array_1[p][0];\n    for (q = 1; q < n - m; q++)\n      if (array_1[p][q] < min)\n        min = array_1[p][q];\n    for (q = 0; q < n - m; q++)\n      array_1[p][q] = array_1[p][q] - min;\n  }\n  for (p = 0; p < n - m; p++) {\n    min = array_1[0][p];\n    for (q = 1; q < n - m; q++)\n      if (array_1[q][p] < min) {\n        min = array_1[q][p];\n      }\n    for (q = 0; q < n - m; q++)\n      array_1[q][p] = array_1[q][p] - min;\n  }\n  sum[k] = sum[k] + array_1[1][1];\n  for (p = 1; p < n - m - 1; p++) {\n    array_1[0][p] = array_1[0][p + 1];\n    array_1[p][0] = array_1[p + 1][0];\n  }\n  for (p = 1; p < n - m - 1; p++)\n    for (q = 1; q < n - m - 1; q++)\n      array_1[p][q] = array_1[p + 1][q + 1];\n}\nint main() {\n  int i, j;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    for (i = 0; i < n - 1; i++)\n      cut(i);\n  }\n  for (k = 0; k < n; k++)\n    printf(\"%d\", sum[k]);\n\n  return 0;\n}\n"}
{"label": "18", "index": "33557", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint sum(int n) {\n  if (n == 1)\n    return 0;\n  else {\n    int i, j, m;\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[i][j] < m)\n          m = a[i][j];\n      for (j = 0; j < n; ++j)\n        a[i][j] -= m;\n    }\n    for (i = 0; i < n; ++i) {\n      m = 1000;\n      for (j = 0; j < n; ++j)\n        if (a[j][i] < m)\n          m = a[j][i];\n      for (j = 0; j < n; ++j)\n        a[j][i] -= m;\n    }\n    int num = a[1][1];\n    for (i = 0; i < n; ++i)\n      for (j = 2; j < n; ++j)\n        a[i][j - 1] = a[i][j];\n    for (i = 0; i < n - 1; ++i) {\n      for (j = 2; j < n; ++j)\n        a[j - 1][i] = a[j][i];\n    }\n    return num + sum(n - 1);\n  }\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[101][101], n;\nint rowmin(int i) {\n  int minr = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i][i1] < minr && a[i][i1] >= 0) {\n      minr = a[i][i1];\n    }\n  }\n  return minr;\n}\nint colmin(int i) {\n  int minc = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i1][i] < minc && a[i1][i] >= 0) {\n      minc = a[i1][i];\n    }\n  }\n  return minc;\n}\nint main() {\n  int t, k, sum, min, minc, i, j;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    k = 1;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (k < n) {\n      for (i = 0; i < n; i++) {\n        min = rowmin(i);\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = colmin(i);\n        for (j = 0; j < n; j++) {\n          a[j][i] -= min;\n        }\n      }\n      sum += a[k][k];\n      for (i = 0; i < n; i++) {\n        a[i][k] = -1;\n      }\n      for (i = 0; i < n; i++) {\n        a[k][i] = -1;\n      }\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33559", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0; \nint main() {\n  void Subtraction(int[100][100], int); \n  int n = 0;\n  cin >> n;        \n  int a[100][100]; \n  for (int f = 1; f <= n; f++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    Subtraction(a, n);\n    if (f == n)\n      cout << sum;\n    else\n      cout << sum << endl;\n  }\n  return 0;\n}\nvoid Subtraction(int m[100][100], int n) {\n  \n  if (n != 1) { \n    \n    for (int i = 0; i <= n - 1; i++) {\n      int min = m[i][0];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[i][j])\n          min = m[i][j];\n      }\n      for (int j = 0; j <= n - 1; j++) {\n        m[i][j] -= min;\n      }\n    }\n    \n    \n    for (int i = 0; i <= n - 1; i++) { \n      int min = m[0][i];\n      for (int j = 0; j <= n - 1; j++) {\n        if (min > m[j][i])\n          min = m[j][i];\n      }\n      for (int j = 0; j <= n - 1; j++) {\n        m[j][i] -= min;\n      }\n    }\n    \n    sum += m[1][1];                    \n    int mtuta[100][100];               \n    for (int i = 0; i <= n - 1; i++) { \n      if (i == 1)\n        continue;\n      for (int j = 0; j <= n - 1; j++) {\n        if (j == 1)\n          continue;\n        \n        mtuta[i - (i != 0)][j - (j != 0)] = m[i][j];\n      }\n    }\n    Subtraction(mtuta, n - 1); \n  }\n}\n"}
{"label": "18", "index": "33560", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a[101][101], s;\nvoid cal() {\n  int j, k, l, m;\n  for (j = 0; j < n; ++j)\n    for (k = 0; k < n; ++k)\n      cin >> a[j][k];\n  s = 0;\n  for (j = 0; j < n; ++j) {\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[k][l] < a[k][m])\n          m = l;\n      m = a[k][m];\n      for (l = j; l < n; ++l)\n        a[k][l] -= m;\n    }\n    for (k = j; k < n; ++k) {\n      for (m = l = j; l < n; ++l)\n        if (a[l][k] < a[m][k])\n          m = l;\n      m = a[m][k];\n      for (l = j; l < n; ++l)\n        a[l][k] -= m;\n    }\n    s += a[j + 1][j + 1];\n    for (k = j + 1; k < n; ++k) {\n      a[j + 1][k] = a[j][k];\n      a[k][j + 1] = a[k][j];\n    }\n    a[j + 1][j + 1] = a[j][j];\n  }\n  return;\n}\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; ++i) {\n    cal();\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[110][110];\nint size;\nint zero();\nint main() {\n  int n, i;\n  int x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    size = n;\n    for (x = 0; x < n; x++)\n      for (y = 0; y < n; y++)\n        cin >> a[x][y];\n    int sum = 0;\n    for (x = 1; x <= n - 1; x++)\n      sum += zero();\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint zero() {\n  int x, y, temp;\n  for (x = 0; x < size; x++) {\n    for (y = 1, temp = a[x][0]; y < size; y++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (y = 0; y < size; y++)\n      a[x][y] -= temp;\n  }\n  for (y = 0; y < size; y++) {\n    for (x = 1, temp = a[0][y]; x < size; x++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (x = 0; x < size; x++)\n      a[x][y] -= temp;\n  }\n  temp = a[1][1];\n  for (x = 1; x < size - 1; x++)\n    for (y = 0; y < size; y++)\n      a[x][y] = a[x + 1][y];\n  for (y = 1; y < size - 1; y++)\n    for (x = 0; x < size - 1; x++)\n      a[x][y] = a[x][y + 1];\n  size -= 1;\n  return temp;\n}\n"}
{"label": "18", "index": "33562", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint GL(int n, int a[][101]);\nint Delete(int n, int a[][101]);\nint min(int a, int b);\n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n\n    Sum[i] = GL(n, a);\n  }\n\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", Sum[i]);\n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum, i, j, MIN;\n\n  for (i = 0; i < n; i++) {\n    MIN = a[i][0];\n    for (j = 1; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  for (j = 0; j < n; j++) {\n    MIN = a[0][j];\n    for (i = 1; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  Sum = a[1][1];\n\n  if (n != 2) {\n    Delete(n, a);\n    Sum = Sum + GL(n - 1, a);\n    return Sum;\n  }\n\n  else\n    return Sum;\n}\n\nint min(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Delete(int n, int a[][101]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint operation(int a[100][100], int m);\nint main() {\n  int n, i, j, k, sum;\n  int a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, -1, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++)\n      sum = sum + operation(a, n - j + 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint operation(int a[100][100], int m) {\n  int i, j, temp, k, t;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j < m; j++) {\n    int min = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  temp = a[1][1];\n  int b[100][100];\n  memset(b, -1, sizeof(b));\n  for (i = 0, t = 0; i < m; i++, t++) {\n    if (i == 1) {\n      t--;\n      continue;\n    }\n    for (j = 0, k = 0; j < m; j++, k++) {\n      if (j == 1) {\n        k--;\n        continue;\n      } else\n        b[t][k] = a[i][j];\n    }\n  }\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = b[i][j];\n  return temp;\n}\n"}
{"label": "18", "index": "33564", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[101][101], i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    int ti = 2, sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ti = 2; ti <= n; ti++) {\n      int mins[101], minl[101];\n      for (int p = 1; p <= n; p++) {\n        mins[p] = 10000;\n        minl[p] = 10000;\n      }\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (a[i][j] >= 0 && a[i][j] <= mins[i])\n            mins[i] = a[i][j];\n        }\n        for (j = 1; j <= n; j++)\n          a[i][j] = a[i][j] - mins[i];\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          if (a[i][j] >= 0 && a[i][j] <= minl[j])\n            minl[j] = a[i][j];\n        }\n\n        for (i = 1; i <= n; i++)\n          a[i][j] = a[i][j] - minl[j];\n      }\n      sum = sum + a[ti][ti];\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (i == ti || j == ti)\n            a[i][j] = -1;\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint guiling(int n);\nvoid xiaojian(int n);\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << guiling(n) << \"\\n\";\n  }\n\n  return 0;\n}\nint guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int k = a[1][1];\n  if (n == 2)\n    return k;\n  else {\n    xiaojian(n);\n    return k + guiling(n - 1);\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "33566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, rec, sum;\nint x[150][150];\n\nvoid F() {\n  int p, q, min;\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + p) + 1));\n    for (q = 1; q <= rec; q++) {\n      min = ((*(*(x + p) + q)) < min) ? (*(*(x + p) + q)) : min;\n    }\n    for (q = 1; q <= rec; q++)\n      (*(*(x + p) + q)) -= min;\n  }\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + 1) + p));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + q) + p)) < min) ? (*(*(x + q) + p)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + q) + p)) -= min;\n  }\n  sum += (*(*(x + 2) + 2));\n  for (p = 2; p < rec; p++)\n    (*(*(x + 1) + p)) = (*(*(x + 1) + p + 1));\n  for (p = 2; p < rec; p++)\n    (*(*(x + p) + 1)) = (*(*(x + p + 1) + 1));\n  for (p = 2; p < rec; p++) {\n    for (q = 2; q < rec; q++)\n      (*(*(x + p) + q)) = (*(*(x + p + 1) + q + 1));\n  }\n  return;\n}\n\nint main() {\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    rec = n;\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> (*(*(x + i) + j));\n    while (rec > 1) {\n      F();\n      rec--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33567", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint xiao(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min == 0)\n      continue;\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  return a[1][1];\n}\n\nvoid suo(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return;\n}\n\nint main() {\n  int n, l, i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    int count = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    i = n;\n    while (i > 1) {\n      count = count + xiao(i);\n      suo(i);\n      i--;\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, min;\n  cin >> n;\n  int input[n][n], sum[n];\n  for (i = 0; i < n; i++) {\n    count = n;\n    sum[i] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> input[j][k];\n\n    while (count != 1) {\n      for (j = 0; j < count; j++) {\n        min = input[j][0];\n        for (k = 1; k < count; k++)\n          if (input[j][k] < min)\n            min = input[j][k];\n        for (k = 0; k < count; k++)\n          input[j][k] -= min;\n      }\n      for (j = 0; j < count; j++) {\n        min = input[0][j];\n        for (k = 1; k < count; k++)\n          if (input[k][j] < min)\n            min = input[k][j];\n        for (k = 0; k < count; k++)\n          input[k][j] -= min;\n      }\n\n      sum[i] += input[1][1];\n      for (k = 0; k < count; k++)\n        for (j = 1; j < count - 1; j++)\n          input[j][k] = input[j + 1][k];\n      for (k = 0; k < count - 1; k++)\n        for (j = 1; j < count - 1; j++)\n          input[k][j] = input[k][j + 1];\n      count--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint i, j, k, l, tot = 0;\nint sum(int a[][101], int n) {\n  if (n == 1) {\n    return tot;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    l = a[i][0];\n    for (j = 0; j <= n - 2; j++) {\n      l = min(l, a[i][j + 1]);\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[i][j] -= l;\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    l = a[0][j];\n    for (i = 0; i <= n - 2; i++) {\n      l = min(l, a[i + 1][j]);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      a[i][j] -= l;\n    }\n  }\n  tot += a[1][1];\n  for (i = 1; i <= n - 2; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 1; i <= n - 2; i++) {\n    a[i][0] = a[i + 1][0];\n  }\n  for (j = 1; j <= n - 2; j++) {\n    a[0][j] = a[0][j + 1];\n  }\n  n--;\n  sum(a, n);\n}\nint main() {\n  int a[101][101];\n  int n;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    cout << sum(a, n) << endl;\n    tot = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33570", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0};\nint b[100][100] = {0};\nint i, j, n;\nint num = 0;\nvoid m(int n) {\n  int min;\n  for (i = 0; i <= n - 1; ++i) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    min = a[0][j];\n    for (i = 0; i <= n - 1; ++i) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n - 1; ++i)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid del(int n) {\n  b[0][0] = a[0][0];\n  for (j = 1; j <= n - 2; ++j)\n    b[0][j] = a[0][j + 1];\n  for (i = 1; i <= n - 2; ++i)\n    b[i][0] = a[i + 1][0];\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\nint s(int n) {\n  m(n);\n  num = num + a[1][1];\n  del(n);\n  if (n != 2)\n    s(n - 1);\n  return num;\n}\nint main() {\n  int k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; ++k) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j)\n        cin >> a[i][j];\n    }\n    num = 0;\n    cout << s(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33571", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, d, c, s, t, min1, min2;\n  scanf(\"%d \", &n);\n  int a[n][n][n], b[n][n];\n  for (i = 0; i < n; i++) {\n    int h = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min1 = a[i][j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min1 > a[i][j][k])\n            min1 = a[i][j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[i][j][k] = a[i][j][k] - min1;\n      }\n      for (d = 0; d < n - l; d++) {\n        min2 = a[i][0][d];\n        for (c = 1; c < n - l; c++) {\n          if (min2 > a[i][c][d]) {\n            min2 = a[i][c][d];\n          }\n        }\n        for (c = 0; c < n - l; c++)\n          a[i][c][d] = a[i][c][d] - min2;\n      }\n      b[i][l] = a[i][1][1];\n      for (s = 1; s < n - 1 - l; s++)\n        for (t = 0; t < n - l; t++)\n          a[i][s][t] = a[i][s + 1][t];\n      for (t = 1; t < n - l - 1; t++)\n        for (s = 0; s < n - l - 1; s++)\n          a[i][s][t] = a[i][s][t + 1];\n    }\n    for (l = 0; l < n - 1; l++)\n      h = h + b[i][l];\n    cout << h << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        int min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        int min = a[0][j];\n        for (k = 0; k < n - l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (j = 1; j < n - l - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - l; j++)\n        a[j][0] = a[j + 1][0];\n      for (j = 1; j < n - l - 1; j++)\n        for (k = 1; k < n - l - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum;\nint a[100][100], b[100];\nvoid cut(int);\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    cut(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid cut(int n) {\n  if (n > 1) {\n    int j, k;\n    for (j = 0; j < n; j++) {\n      b[j] = a[j][0];\n      for (k = 1; k < n; k++) {\n        if (a[j][k] < b[j]) {\n          b[j] = a[j][k];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j][k] - b[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      b[j] = a[0][j];\n      for (k = 1; k < n; k++) {\n        if (a[k][j] < b[j]) {\n          b[j] = a[k][j];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[k][j] = a[k][j] - b[j];\n      }\n    }\n    sum += a[1][1];\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j + 1][k];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n - 1; k++) {\n        a[k][j] = a[k][j + 1];\n      }\n    }\n    cut(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33574", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint change(int m) {\n  int i, j, k = 0, min, value;\n\n  if (m == 1)\n    return 0;\n\n  for (i = 0; i < m; i++) {\n    min = a[i][0];\n    for (j = 0; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < m; i++) {\n    min = a[0][i];\n    for (j = 0; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n\n  value = a[1][1];\n\n  for (i = 1; i < m - 1; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n\n  for (j = 1; j < m - 1; j++)\n    for (i = 0; i < m - 1; i++)\n      a[i][j] = a[i][j + 1];\n\n  return value + change(m - 1);\n}\nint main() {\n  int n, i, j;\n\n  scanf(\"%d \", &n);\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n * n; j++)\n      cin >> a[j / n][j % n];\n\n    cout << change(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint guiling(int count);\nint xiaojian(int count);\n\nint n;\nint a[101][101];\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (int count = n; count > 1; count--) {\n      guiling(count);\n      sum += a[1][1];\n      xiaojian(count);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n\nint guiling(int count) {\n  int j, k;\n  for (j = 0; j < count; j++) {\n    int min = a[j][0];\n    for (k = 1; k < count; k++) {\n      if (min > a[j][k]) {\n        min = a[j][k];\n      }\n    }\n    for (k = 0; k < count; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    int min = a[0][k];\n    for (j = 1; j < count; j++) {\n      if (min > a[j][k]) {\n        min = a[j][k];\n      }\n    }\n    for (j = 0; j < count; j++) {\n      a[j][k] -= min;\n    }\n  }\n}\n\nint xiaojian(int count) {\n  int j, k;\n  for (j = 1; j < count - 1; j++) {\n    a[0][j] = a[0][j + 1];\n    a[j][0] = a[j + 1][0];\n    for (k = 1; k < count - 1; k++) {\n      a[j][k] = a[j + 1][k + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33576", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint func(int a[100][100], int n);\nint main() {\n  int n, j, k, i;\n  int a[100][100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    memset(a, 0, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    sum = 0;\n    printf(\"%d\\n\", func(a, n));\n  }\n  return 0;\n}\nint func(int a[100][100], int n) {\n  int i, j, min, b[100][100];\n  if (n <= 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      min = a[i][0];\n      for (j = 0; j < n; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n    }\n    for (i = 0; i < n; i++) {\n      min = a[0][i];\n      for (j = 0; j < n; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n    sum += a[1][1];\n    for (i = 2; i < n; i++) {\n      for (j = 0; j < n - 1; j++)\n        b[i - 1][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        b[j][i - 1] = a[j + 1][i];\n    }\n    for (j = 1; j < n - 1; j++)\n      b[0][j] = a[0][j + 1];\n    for (j = 1; j < n - 1; j++)\n      b[j][0] = a[j + 1][0];\n    b[0][0] = a[0][0];\n    func(b, n - 1);\n  }\n}\n"}
{"label": "18", "index": "33577", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int m = n;\n  int t = n;\n  while (m > 0) {\n    int a[100][100];\n    n = t;\n    m = m - 1;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    while (n > 1) {\n      for (int i = 0; i < n; i++) {\n        int hmin = a[i][0];\n        for (int j = 0; j < n; j++) {\n          if (a[i][j] < hmin)\n            hmin = a[i][j];\n        }\n\n        for (int j = 0; j < n; j++)\n          a[i][j] -= hmin;\n      }\n      for (int i = 0; i < n; i++) {\n        int lmin = a[0][i];\n        for (int j = 0; j < n; j++) {\n          if (a[j][i] < lmin)\n            lmin = a[j][i];\n        }\n        for (int j = 0; j < n; j++)\n          a[j][i] -= lmin;\n      }\n      sum += a[1][1];\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (int i = 0; i < n - 1; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[j][i] = a[j + 1][i];\n      n = n - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, sum, min, m;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0; \n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 1; j < m; j++) \n        {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++) \n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 1; i < m; i++) \n        {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++) \n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];    \n      for (i = 0; i < m; i++) \n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < m - 1; j++) \n        for (i = 1; i < m - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, sum, m;\n  cin >> n;\n  int a[101][101] = {0};\n  m = n;\n  while (m) {\n    m--;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = n; k > 1; k--) {\n\n      for (i = 1; i <= k; i++) {\n        min = 98000;\n        for (j = 1; j <= k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 1; j <= k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 1; i <= k; i++) {\n        min = 98098;\n        for (j = 1; j <= k; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 1; j <= k; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[2][2];\n      if (k >= 3) {\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[i - 1][j] = a[i][j];\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[j][i - 1] = a[j][i];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33580", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, sum;\n  int i, j, k;\n  int a[101][101] = {0};\n  int lenth, min;\n\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    lenth = n;\n\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[j][k]);\n\n    for (lenth = n; lenth > 1; lenth--) {\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[j][k] != 0)\n            a[j][k] = a[j][k] - min;\n      }\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[k][j] != 0)\n            a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[2][2];\n\n      for (j = 1; j <= lenth; j++)\n        for (k = 2; k <= lenth; k++)\n          a[j][k] = a[j][k + 1];\n      for (j = 2; j <= lenth; j++)\n        for (k = 1; k <= lenth; k++)\n          a[j][k] = a[j + 1][k];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33581", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100];\nint sum = 0;\nint n;\nvoid rows(int num);\nvoid columns(int num);\nvoid deletes(int num);\nint main(void) {\n\n  cin >> n;\n  for (int q = 1; q <= n; q++) {\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> a[i][j]; \n      }\n    }\n    for (int i = 1; i <= n - 1; i++) { \n      rows(i);\n      columns(i);\n      sum = sum + a[2][2];\n      deletes(i);\n    }\n    cout << sum << endl; \n    sum = 0;\n  }\n  return 0;\n}\nvoid rows(int num) \n{\n  int min1[100];\n  for (int i = 1; i <= n + 1 - num; i++) {\n    min1[i] = a[i][1];\n  }\n  for (int i = 1; i <= n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      if (min1[i] > a[i][j]) {\n        min1[i] = a[i][j]; \n      }\n    }\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i][j] - min1[i]; \n    }\n  }\n}\nvoid columns(int num) \n{\n  int min2[100];\n  for (int j = 1; j <= n + 1 - num; j++) {\n    min2[j] = a[1][j];\n  }\n  for (int j = 1; j <= n + 1 - num; j++) {\n    for (int i = 1; i <= n + 1 - num; i++) {\n      if (min2[j] > a[i][j]) {\n        min2[j] = a[i][j];\n      }\n    }\n    for (int i = 1; i <= n + 1 - num; i++) {\n      a[i][j] = a[i][j] - min2[j];\n    }\n  }\n}\nvoid deletes(int num) { \n  for (int i = 2; i < n + 1 - num; i++) {\n    for (int j = 1; j <= n + 1 - num; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (int j = 2; j < n + 1 - num; j++) {\n    for (int i = 1; i < n + 1 - num; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33582", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid q(int l) {\n  for (int g = 0; g < l; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[g][h] = a[g][h + 1];\n  for (int g = 0; g < l - 1; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[h][g] = a[h + 1][g];\n}\nint f(int y) {\n  int min, now;\n  if (y == 1)\n    return 0;\n  for (int g = 0; g < y; g++) {\n    min = a[g][0];\n    for (int h = 1; h < y; h++)\n      if (a[g][h] < min)\n        min = a[g][h];\n    for (int h = 0; h < y; h++)\n      a[g][h] -= min;\n  }\n  for (int g = 0; g < y; g++) {\n    min = a[0][g];\n    for (int h = 1; h < y; h++)\n      if (a[h][g] < min)\n        min = a[h][g];\n    for (int h = 0; h < y; h++)\n      a[h][g] -= min;\n  }\n  now = a[1][1];\n  q(y);\n  return now + f(y - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << endl << f(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33583", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid row_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[i][0];\n    for (j = 1; j < n; j++)\n      if (array[i][j] < min)\n        min = array[i][j];\n    for (j = 0; j < n; j++)\n      array[i][j] -= min;\n  }\n}\n\nvoid col_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[0][i];\n    for (j = 1; j < n; j++)\n      if (array[j][i] < min)\n        min = array[j][i];\n    for (j = 0; j < n; j++)\n      array[j][i] -= min;\n  }\n}\n\nvoid delete22(int array[101][101], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[i][j - 1] = array[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[j - 1][i] = array[j][i];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  int array[101][101];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &array[j][k]);\n    for (j = n; j >= 2; j--) {\n      row_deduct(array, j);\n      col_deduct(array, j);\n      sum += array[1][1];\n      delete22(array, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint mx[200][200];\nint nn, n, ans;\nint main() {\n  scanf(\"%d \", &nn);\n  for (int q = 1; q <= nn; q++) {\n    ans = 0;\n    n = nn;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++)\n        cin >> mx[i][j];\n    }\n    for (; n >= 2; n--) {\n      int smin;\n      for (int i = 1; i <= n; i++) {\n        smin = mx[i][1];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[i][j] ? smin : mx[i][j];\n        for (int j = 1; j <= n; j++)\n          mx[i][j] -= smin;\n      }\n      for (int i = 1; i <= n; i++) {\n        smin = mx[1][i];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[j][i] ? smin : mx[j][i];\n        for (int j = 1; j <= n; j++)\n          mx[j][i] -= smin;\n      }\n      ans += mx[2][2];\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[i][j] = mx[i][j + 1];\n      }\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[j][i] = mx[j + 1][i];\n      }\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110];\n  int n, i, j, k, l;\n  int min;\n  int x = 0;\n  scanf(\"%d \", &n);\n  for (l = 0; l <= n - 1; ++l) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    x = 0;\n    for (k = 0; k <= n - 2; ++k) {\n      for (i = 0; i <= n - k - 1; ++i) {\n        min = a[i][0];\n        for (j = 0; j <= n - k - 1; ++j) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j <= n - k - 1; ++j) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j <= n - k - 1; ++j) {\n        min = a[0][j];\n        for (i = 0; i <= n - k - 1; ++i) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - k - 1; ++i)\n          a[i][j] -= min;\n      }\n      x += a[1][1];\n      for (j = 2; j <= n - k - 1; ++j) {\n        a[0][j - 1] = a[0][j];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i <= n - k - 1; ++i) {\n        for (j = 2; j <= n - k - 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33586", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100];\n\nint search1(int num, int n) \n{\n  int i, min;\n  min = a[num][0];\n  for (i = 1; i < n; i++)\n    if (a[num][i] < min)\n      min = a[num][i];\n  return min;\n}\n\nint search2(int num, int n) \n{\n  int j, min;\n  min = a[0][num];\n  for (j = 1; j < n; j++)\n    if (a[j][num] < min)\n      min = a[j][num];\n  return min;\n}\n\nvoid dele1(int num, int n, int x) \n{\n  int i;\n  for (i = 0; i <= n; i++)\n    a[num][i] = a[num][i] - x;\n}\n\nvoid dele2(int num, int n, int x) \n{\n  int j;\n  for (j = 0; j <= n; j++)\n    a[j][num] = a[j][num] - x;\n}\n\nvoid move(int n) \n{\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, l, i, j, m, ans;\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    m = n; \n    ans = 0;\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    while (m > 1) { \n      for (i = 0; i < m; i++)\n        dele1(i, m, search1(i, m));\n      for (j = 0; j < m; j++)\n        dele2(j, m, search2(j, m));\n      ans = ans + a[1][1];\n      move(m);\n      m = m - 1;\n    }\n\n    cout << ans << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33587", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], i, j, c, sum = 0, k, n, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    sum = 0;\n    for (c = n; c > 1; c--) {\n      for (i = 0; i < c; i++) {\n        min = 100000;\n        for (j = 0; j < c; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < c; j++) {\n        min = 100000;\n        for (i = 0; i < c; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < c; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < c - 1; i++) {\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < c; j++)\n        for (i = 0; i < c - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33588", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid min(int a[100][100], int);\nvoid newa(int a[100][100], int);\nint main() {\n  int i, j, k, n, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    min(a, n);\n  }\n  return 0;\n}\nvoid min(int a[][100], int n) {\n  int i, j, k, m, x, y, sum = 0;\n  for (m = n; m > 1; m--) {\n    for (i = 0; i < m; i++) {\n      x = a[i][0];\n      for (j = 1; j < m; j++) {\n        if (x > a[i][j])\n          x = a[i][j];\n      }\n      for (k = 0; k < m; k++)\n        a[i][k] -= x;\n    }\n    for (i = 0; i < m; i++) {\n      y = a[0][i];\n      for (j = 1; j < m; j++) {\n        if (y > a[j][i])\n          y = a[j][i];\n      }\n      for (k = 0; k < m; k++)\n        a[k][i] -= y;\n    }\n    sum += a[1][1];\n    newa(a, m);\n  }\n  printf(\"%d\\n\", sum);\n}\nvoid newa(int a[][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[j - 1][i] = a[j][i];\n}\n"}
{"label": "18", "index": "33589", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min2;\nint min1;\nvoid diguihang(int i, int n,\n               int a[300][300]) \n{\n  if (i == -1)\n    return;\n  min1 = a[i][0]; \n  for (int j = 0; j < n; j++) {\n    if (a[i][j] < min1)\n      min1 = a[i][j];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[i][v] = a[i][v] - min1;\n  }\n  diguihang(i - 1, n, a); \n}\n\nvoid diguilie(int i, int n,\n              int a[300][300]) \n{\n  if (i == -1)\n    return;\n  min2 = a[0][i]; \n  for (int j = 0; j < n; j++) {\n\n    if (a[j][i] < min2)\n      min2 = a[j][i];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[v][i] = a[v][i] - min2;\n  }\n  diguilie(i - 1, n, a);\n}\n\nint change(int n, int sum, int a[300][300]) \n{\n  if (n == 1)\n    return sum;\n\n  diguihang(n - 1, n, a);\n  diguilie(n - 1, n, a);\n  sum = sum + a[1][1];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n - 1; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n\n  return change(n - 1, sum, a);\n}\nint main() {\n  int N;\n  int a[300][300];\n  cin >> N;\n  for (int i = 1; i <= N; i++) {\n    for (int j = 0; j < N; j++)\n      for (int y = 0; y < N; y++) {\n        cin >> a[j][y];\n      }\n    cout << change(N, 0, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33590", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[101][101];\nvoid guiling(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid f(int n) {\n  if (n == 1)\n    return;\n  else {\n    guiling(n);\n    sum += a[1][1];\n    xiaojian(n);\n    f(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    f(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33591", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int[100][100], int);\n\nint main() {\n  int n, k, i, j;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) {\n  int p, i, j, min;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  p = a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  return p + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "33592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int array[100][100] = {0};\n  int times, m, n, i, j, k;\n  cin >> times;\n  m = times;\n  while (m--) {\n    n = times;\n    int(*p)[100] = array;\n    for (i = 0; i < times; i++)\n      for (j = 0; j < times; j++)\n        cin >> *(*(p + i) + j);\n    int sum = 0;\n    for (k = 1; k <= times - 1; k++) {\n      int min, now;\n      for (i = 0; i < n; i++) {\n        min = *(*(p + i));\n        for (j = 1; j < n; j++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = *(*p + j);\n        for (i = 1; i < n; i++) {\n          now = *(*(p + i) + j);\n          if (now < min)\n            min = now;\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + (*(*(p + 1) + 1));\n      if (n == 2)\n        break;\n      for (i = 2; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      for (j = 2; j < n; j++)\n        for (i = 0; i < n - 1; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33593", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, a[100][100], b[10000], min = 0;\n  scanf(\"%d \", &n);\n  k = n;\n  while (k > 0) {\n    memset(a, 0, sizeof(a));\n    int i, j, k1, sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    k1 = n;\n    while (k1 > 1) {\n      for (i = 0; i < k1; i++) {\n        min = a[i][0];\n        for (j = 0; j < k1; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < k1; i++) {\n        min = a[0][i];\n        for (j = 0; j < k1; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < k1; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      int count = 0;\n      memset(b, 0, sizeof(b));\n      for (i = 0; i < k1; i++) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < k1; j++) {\n          if (j == 1)\n            continue;\n          b[count++] = a[i][j];\n        }\n      }\n      k1--;\n      memset(a, 0, sizeof(a));\n      int x = 0;\n      for (i = 0; i < k1; i++)\n        for (j = 0; j < k1; j++)\n          a[i][j] = b[x++];\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i = 0;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int a[100][100], j, k, l, sum = 0;\n    for (k = 0; k <= n - 1; k++)\n      for (l = 0; l <= n - 1; l++)\n        cin >> a[k][l];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = a[k][0];\n        for (l = 1; l <= n - j; l++)\n          if (a[k][l] < min)\n            min = a[k][l];\n        for (l = 0; l <= n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = a[0][k];\n        for (l = 1; l <= n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l <= n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (k = 2; k <= n - j; k++) {\n        a[0][k - 1] = a[0][k];\n        a[k - 1][0] = a[k][0];\n      }\n      for (k = 2; k <= n - j; k++)\n        for (l = 2; l <= n - j; l++)\n          a[k - 1][l - 1] = a[k][l];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33595", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, p;\n  scanf(\"%d \", &m);\n  n = m;\n  p = m;\n  while (n--) {\n    m = p;\n    int sum = 0, i, j, a[120][120], min;\n\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d \", &a[i][j]);\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        for (min = a[i][0], j = 0; j <= m; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= m; j++) {\n        for (min = a[0][j], i = 0; i <= m; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j <= m - 1; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33596", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min, sum = 0, t, m; \n  int a[105][105];                 \n  cin >> n;                        \n  t = n;\n  m = n;\n  while (t > 0) \n  {\n    n = m;\n    sum = 0; \n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    while (n > 1)       \n    {\n      for (i = 0; i < n; i++) \n      {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j < n; j++) \n      {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1]; \n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1]; \n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j]; \n\n      n--;\n    }\n    cout << sum << endl; \n    t--;\n  }\n}\n"}
{"label": "18", "index": "33597", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int m = n;\n    int sum = 0;\n    while (1) {\n      int min;\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      m--;\n      if (m == 1) {\n        cout << sum << endl;\n        break;\n      }\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33598", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], sum = 0, p = 1, z, k, w, l, min;\n  int i, j, n;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (z = 0; z < n - 1; z++) {\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (k = 0; k < n; k++)\n          a[i][k] -= min;\n      }\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (k = 0; k < n; k++)\n          a[k][i] -= min;\n      }\n      sum += a[p][p];\n      for (l = 0; l < n; l++)\n        a[l][p] = 100000;\n      for (l = 0; l < n; l++)\n        a[p][l] = 100000;\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n    p = 1;\n    sum = 0;\n    memset(a, 1000000, sizeof(a));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, nn, a[100][100], sum, min;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    nn = n;\n    while (nn > 1) {\n      for (i = 0; i < nn; i++) {\n        min = a[i][0];\n        for (j = 0; j < nn; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < nn; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < nn; j++) {\n        min = a[0][j];\n        for (i = 0; i < nn; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i < nn; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < nn - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < nn - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < nn - 1; i++)\n        for (j = 1; j < nn - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      nn = nn - 1;\n    }\n    if (k == 1)\n      cout << sum;\n    else\n      cout << endl << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num, minx[101], miny[101];\n  int a[101][101];\n  cin >> num;\n  const int number = num;\n  while (num > 0) {\n    int sum = 0;\n    for (i = 0; i < number; i++)\n      for (j = 0; j < number; j++)\n        cin >> a[i][j];\n    n = number;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        minx[i] = 1000;\n        miny[i] = 1000;\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[i][k] = a[i][k] - minx[i];\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[k][i] = a[k][i] - miny[i];\n      sum += a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n - 1; i++)\n          a[i][j] = a[i][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n    num--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33601", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sub(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> num[j][k];\n    printf(\"%d\\n\", sub(num, n));\n  }\n  return 0;\n}\nint sub(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i < n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + sub(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100], p, min, sum = 0;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n\n    for (k = 1; k <= n - 1; k++) {\n\n      for (i = 0; i <= n - 1; i++) {\n        min = a[i][0];\n        for (j = k; j <= n - 1; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n\n        for (j = 0; j <= n - 1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j <= n - 1; j++) {\n        min = a[0][j];\n        for (i = k; i <= n - 1; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - 1; i++) {\n\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[k][k];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33603", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum = 0;          \nvoid change(int n);   \nint number[100][100]; \nint main() {\n  int n, k, j; \n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> number[k][j]; \n    sum = 0;\n    change(n); \n  }\n  return 0;\n}\n\nvoid change(int n) \n{\n  int m;\n  m = n;\n  int min;               \n  if (m == 1)            \n    cout << sum << endl; \n  else {\n    int i = 0, j = 0;\n    for (i = 0; i < m; i++) \n    {\n      min = number[i][0];\n      for (j = 0; j < m; j++)\n        if (min > number[i][j])\n          min = number[i][j];\n      for (j = 0; j < n; j++)\n        number[i][j] = number[i][j] - min;\n    }\n    for (i = 0; i < m; i++) \n    {\n      min = number[0][i];\n      for (j = 0; j < m; j++)\n        if (min > number[j][i])\n          min = number[j][i];\n      for (j = 0; j < m; j++)\n        number[j][i] = number[j][i] - min;\n    }\n\n    sum = sum + number[1][1]; \n    for (j = 0; j < m; j++)   \n      for (i = 1; i < m - 1; i++)\n        number[i][j] = number[i + 1][j];\n    for (i = 0; i < m - 1; i++)\n      for (j = 1; j < m - 1; j++)\n        number[i][j] = number[i][j + 1];\n    m = m - 1;\n    change(m); \n  }\n}\n"}
{"label": "18", "index": "33604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], e, sum = 0;\n  int n, m, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    m = n;\n    for (l = 0; l < m - 1; l++) \n    {\n      for (j = 0; j < n; j++) \n      {\n        e = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] -= e;\n        }\n      }\n      for (k = 0; k < n; k++) \n      {\n        e = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] -= e;\n        }\n      }\n      sum += a[1][1];         \n      for (j = 0; j < n; j++) \n      {\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - 1; k++) {\n        for (j = 1; j < n; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      n -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    n = m;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Delete(int a[][101], int, int); \nint check_min(int a[], int);         \n\nint sum[101],\n    a[101][101]; \n\nint main() {\n  int n, p;\n  int i, j, l, m, k;\n  memset(a, 0, sizeof(a));\n  memset(sum, 0, sizeof(sum)); \n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    Delete(a, n, k); \n  }\n\n  for (l = 0; l < n; l++) \n  {\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n\nvoid Delete(int a[][101], int n, int p) \n{\n  if (n == 1)\n    return; \n  int i, j, k, l, m, q, r, s, min,\n      Min[101]; \n  for (i = 0; i < n; i++) {\n    min = check_min(a[i], n); \n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min; \n    }\n  }\n  for (i = 0; i < n; i++) \n  {\n    for (j = 0; j < n; j++) {\n      if (j == 0)\n        Min[i] = a[j][i];\n      if (a[j][i] < Min[i])\n        Min[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - Min[i]; \n    }\n  }\n  sum[p] = sum[p] + a[1][1]; \n  for (k = 2; k < n; k++) {\n    for (l = 2; l < n; l++) {\n      a[k - 1][l - 1] = a[k][l];\n    }\n  }\n  for (m = 2; m < n; m++) {\n    a[0][m - 1] = a[0][m];\n    a[m - 1][0] = a[m][0];\n  }\n  Delete(a, n - 1, p); \n}\n\nint check_min(int a[], int n) {\n  int min;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      min = a[i]; \n    if (a[i] < min)\n      min = a[i]; \n  }\n  return min;\n}\n"}
{"label": "18", "index": "33606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[110][110], sum;\n\nvoid dispose(int n);\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int p = 0;\n  do {\n    memset(array_1, 0, sizeof(array_1));\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    dispose(n);\n    cout << sum << \"\\n\";\n    p++;\n  } while (p < n);\n  return 0;\n}\n\nvoid dispose(int n) {\n  int i, j;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    int rowmin = array_1[i][0];\n    for (j = 1; j < n; j++)\n      if (rowmin > array_1[i][j])\n        rowmin = array_1[i][j];\n    for (j = 0; j < n; j++)\n      array_1[i][j] -= rowmin;\n  }\n  for (i = 0; i < n; i++) {\n    int colmin = array_1[0][i];\n    for (j = 1; j < n; j++)\n      if (colmin > array_1[j][i])\n        colmin = array_1[j][i];\n    for (j = 0; j < n; j++)\n      array_1[j][i] -= colmin;\n  }\n  sum += array_1[1][1];\n  for (i = 1; i < n - 1; i++)\n    array_1[0][i] = array_1[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    array_1[i][0] = array_1[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      array_1[i][j] = array_1[i + 1][j + 1];\n  dispose(n - 1);\n}\n"}
{"label": "18", "index": "33607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n  int min = a[hang][1];\n  for (i = 1; i <= geshu; i++) {\n    if (a[hang][i] < min)\n      min = a[hang][i];\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = a[1][lie];\n  for (i = 1; i <= geshu; i++) {\n    if (a[i][lie] < min)\n      min = a[i][lie];\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n    \n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[mm][i] = a[mm][i] - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          a[i][mm] = a[i][mm] - Minlie;\n      }\n\n      sum += a[2][2];\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[ii][i - 1] = a[ii][i];\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          a[i - 1][ii] = a[i][ii];\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint x[102][102];\nint (*p)[102];\nint n;\nvoid f(int k) {\n  int min, i, j;\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    for (j = 0; j < n - k; j++)\n      *(*(p + i) + j) -= min;\n  }\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    for (j = 0; j < n - k; j++)\n      *(*(p + j) + i) -= min;\n  }\n}\nint main() {\n  int i, j, k, sum;\n  p = x;\n  cin >> n;\n  for (int t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      f(k);\n      sum += *(*(p + 1) + 1);\n      for (i = 2; i < n; i++) {\n        *(*(p + 0) + i - 1) = *(*(p + 0) + i);\n        *(*(p + i - 1) + 0) = *(*(p + i) + 0);\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33609", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, nn, a[100][100], sum, min; \n  cin >> n;\n  for (k = 1; k <= n; k++) { \n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    nn = n;\n    while (nn > 1) {\n      for (i = 0; i < nn; i++) { \n        min = a[i][0];\n        for (j = 0; j < nn; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < nn; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < nn; j++) { \n        min = a[0][j];\n        for (i = 0; i < nn; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i < nn; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < nn - 1; i++)\n        a[i][0] = a[i + 1][0]; \n      for (j = 1; j < nn - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < nn - 1; i++)\n        for (j = 1; j < nn - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      nn = nn - 1; \n    }\n    if (k == 1)\n      cout << sum;\n    else\n      cout << endl << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], N, i, j, k, l, min, sum = 0;\n  scanf(\"%d \", &N);\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++)\n      for (k = 0; k < N; k++)\n        cin >> a[j][k];\n    n = N;\n    for (l = 0; l < N - 1; l++) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k + 1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n - 1; k++)\n          a[j][k] = a[j + 1][k];\n      n = n - 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33611", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t, sum, m;\n  int a[100][100];\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        t = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - t;\n        }\n      }\n      for (i = 0; i < m; i++) {\n        t = a[0][i];\n        for (j = 1; j < m; j++) {\n          if (a[j][i] < t) {\n            t = a[j][i];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          a[j][i] = a[j][i] - t;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[j][i] = a[j + 1][i];\n        }\n      }\n      m--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[111][111], sum;\n  int i, j, k, l, Min;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n\n    for (j = 1; j < n; j++) {\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[1][l]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++)\n        a[1][l] = a[1][l] - Min;\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[k][l]);\n        }\n        Min = min(Min, a[k][1]);\n        for (l = j + 1; l <= n; l++) {\n          a[k][l] = a[k][l] - Min;\n        }\n        a[k][1] = a[k][1] - Min;\n      }\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[l][1]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++) {\n        a[l][1] = a[l][1] - Min;\n      }\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[l][k]);\n        }\n        Min = min(Min, a[1][k]);\n        for (l = j + 1; l <= n; l++) {\n          a[l][k] = a[l][k] - Min;\n        }\n        a[1][k] = a[1][k] - Min;\n      }\n      sum = sum + a[j + 1][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33613", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, m, s = 0, i, j, x, y, t = 0;\n  int(*p)[100];\n  p = a;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    s = 0;\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> (*(*(p + i) + j));\n      }\n\n    for (y = n; y > 1; y--) {\n\n      for (i = 0; i < n - t; i++) {\n        x = *(*(p + i));\n        for (j = 0; j < n - t; j++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) -= x;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        x = *(*(p) + j);\n        for (i = 0; i < n - t; i++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (i = 0; i < n - t; i++)\n          *(*(p + i) + j) -= x;\n      }\n\n      s = s + *(*(p + 1) + 1);\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n      for (i = 1; i < n - t - 1; i++)\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      t++;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid diminish(int a[105][105], int stair) {\n  int i, j, min[105];\n  for (i = 1; i <= stair; i++) \n  {\n    min[i] = a[i][1];\n    for (j = 1; j <= stair; j++) {\n      if (a[i][j] < min[i]) {\n        min[i] = a[i][j];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (i = 1; i <= stair; i++) \n  {\n    min[i] = a[1][i];\n    for (j = 1; j <= stair; j++) {\n      if (a[j][i] < min[i]) {\n        min[i] = a[j][i];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[j][i] -= min[i];\n    }\n  }\n}\nvoid lowerstair(int a[105][105], int stair) {\n  int i, j;\n  for (i = 2; i <= stair - 1; i++) \n  {\n    for (j = 1; j <= stair; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 2; i <= stair - 1; i++) \n  {\n    for (j = 1; j <= stair; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint deal(int a[105][105], int stair) {\n  int result = 0;\n  while (stair >= 2) {\n    diminish(a, stair);\n    result += a[2][2];\n    lowerstair(a, stair);\n    stair--;\n  }\n  return result;\n}\nint main() {\n  int n, i, j, k, stair, sum, a[105][105];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    stair = n;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = deal(a, stair);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int q = 0;\n  while (q < n) {\n    int a[110][110] = {0}, (*p)[110] = a;\n    int o = n, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (o > 0) {\n      int min[110][2] = {0}, (*q)[2] = min;\n      memset(min, 10000, sizeof(min));\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          if (*(*(p + i) + j) < *(*(q + i)))\n            *(*(q + i)) = *(*(p + i) + j);\n        }\n      }\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) -= *(*(q + i));\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          if (*(*(p + i) + j) < *(*(q + j) + 1))\n            *(*(q + j) + 1) = *(*(p + i) + j);\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          *(*(p + i) + j) -= *(*(q + j) + 1);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (int i = 0; i < o; i++) {\n        for (int j = 1; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (int i = 1; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      o--;\n    }\n    cout << sum << endl;\n    q++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33616", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, n0 = 0, juzhen[102][102] = {0}, sum = 0, minc[102] = {0},\n               minr[102] = {0}, lins = 0;\n  int(*p)[102] = juzhen, *pr = minr, *pc = minc;\n  cin >> n;\n  while (n0 < n) {\n    lins = 0;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = 0;\n      *(pr + i) = 100000;\n      *(pc + i) = 100000;\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (lins < n - 1) {\n      for (i = 0; i < n; i++) {\n        *(pr + i) = 100000;\n        *(pc + i) = 100000;\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          if (*(*(p + i) + j) < minr[i])\n            *(pr + i) = *(*(p + i) + j);\n        }\n      }\n      for (i = 0; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++) {\n          *(*(p + i) + j) -= *(pr + i);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          if (*(*(p + i) + j) < *(pc + j))\n            *(pc + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 0; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++) {\n          *(*(p + i) + j) -= *(pc + j);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n\n      for (i = 2; i < n - lins; i++) {\n        for (j = 0; j < n - lins; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (j = 2; j < n - lins; j++) {\n        for (i = 0; i < n - lins; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n      lins++;\n    }\n    cout << sum << endl;\n    n0++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33617", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint min(int x, int y) {\n  int z;\n  if (x > y)\n    z = y;\n  else\n    z = x;\n  return (z);\n}\nint main() {\n  int n, m, k, i, j, a[101][101], s[101], sum;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        s[i] = a[i][1];\n        for (j = 1; j <= n - k + 1; j++)\n          s[i] = min(a[i][j], s[i]);\n      }\n      for (i = 1; i <= n - k + 1; i++) {\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j] = a[i][j] - s[i];\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        s[j] = a[1][j];\n        for (i = 1; i <= n - k + 1; i++)\n          s[j] = min(a[i][j], s[j]);\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j] = a[i][j] - s[j];\n      }\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - k + 1; i++) {\n        if ((n - k + 1) >= 3)\n          for (j = 3; j <= n - k + 1; j++)\n            a[i][j - 1] = a[i][j];\n        else\n          break;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        if ((n - k + 1) >= 3)\n          for (i = 3; i <= n - k + 1; i++)\n            a[i - 1][j] = a[i][j];\n        else\n          break;\n      }\n    }\n    printf(\"\\n%d\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33618", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101], n, b[101][101];\nvoid f() {\n  int i, j, num, ans = 0, min;\n  num = n;\n  while (num >= 2) {\n    for (i = 1; i <= num; i++) {\n      min = a[i][1];\n      for (j = 1; j <= num; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 1; j <= num; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= num; j++) {\n      min = a[1][j];\n      for (i = 1; i <= num; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (i = 1; i <= num; i++)\n        a[i][j] -= min;\n    }\n    ans += a[2][2];\n    b[1][1] = a[1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[i][1] = a[i + 1][1];\n    for (i = 2; i <= num - 1; i++)\n      b[1][i] = a[1][i + 1];\n    for (i = 2; i <= num - 1; i++)\n      for (j = 2; j <= num - 1; j++)\n        b[i][j] = a[i + 1][j + 1];\n    for (i = 1; i <= num - 1; i++)\n      for (j = 1; j <= num - 1; j++)\n        a[i][j] = b[i][j];\n    num--;\n  }\n  printf(\"%d\\n\", ans);\n}\n\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, t;\nint n;\nint sum;\nint a[100][100];\nint f(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[ii][0];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ii][ij] < minn) {\n        minn = a[ii][ij];\n      }\n    for (int ij = 0; ij < x; ij++)\n      a[ii][ij] = a[ii][ij] - minn;\n  }\n}\nint g(int x) {\n  for (int ii = 0; ii < x; ii++) {\n    int minn = a[0][ii];\n    for (int ij = 0; ij < x; ij++)\n      if (a[ij][ii] < minn)\n        minn = a[ij][ii];\n    for (int ij = 0; ij < x; ij++)\n      a[ij][ii] = a[ij][ii] - minn;\n  }\n}\nint h(int x) {\n  sum = sum + a[1][1];\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[ii][jj] = a[ii][jj + 1];\n  }\n  for (int ii = 0; ii < x; ii++) {\n    for (int jj = 1; jj < x; jj++)\n      a[jj][ii] = a[jj + 1][ii];\n  }\n}\nint main() {\n  cin >> n;\n  for (int qqq = 0; qqq < n; qqq++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (i = n; i > 1; i--) {\n      f(i);\n      g(i);\n      h(i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33620", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid xj(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n}\n\nvoid gl(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 1; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    xj(n);\n    gl(n - 1);\n  } else\n    return;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    gl(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, mat[101][101], tp[101][101], sum = 0;\nvoid cut(int x) {\n  int min;\n  if (x == n - 1)\n    return;\n  else {\n    for (int i = 0; i < n - x; i++) {\n      min = mat[i][0];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[i][j] <= min) {\n          min = mat[i][j];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[i][j] -= min;\n    }\n    for (int i = 0; i < n - x; i++) {\n      min = mat[0][i];\n      for (int j = 0; j < n - x; j++) {\n        if (mat[j][i] <= min) {\n          min = mat[j][i];\n        }\n      }\n      for (int j = 0; j < n - x; j++)\n        mat[j][i] -= min;\n    }\n    sum += mat[1][1];\n    \n    \n    \n    \n    for (int i = 0; i < n - x; i++)\n      mat[1][i] = -1;\n    for (int i = 0; i < n - x; i++)\n      mat[i][1] = -1;\n    tp[0][0] = mat[0][0];\n    for (int i = 2; i < n - x; i++)\n      tp[0][i - 1] = mat[0][i];\n    for (int i = 2; i < n - x; i++) {\n      tp[i - 1][0] = mat[i][0];\n      for (int j = 2; j < n - x; j++)\n        tp[i - 1][j - 1] = mat[i][j];\n    }\n    \n    \n    \n    \n    for (int i = 0; i < n - x - 1; i++) {\n      for (int j = 0; j < n - x - 1; j++) {\n        mat[i][j] = tp[i][j];\n      }\n    }\n    \n    \n    \n    \n    cut(x + 1);\n  }\n}\nvoid ope() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> mat[i][j];\n    }\n  }\n  sum = 0;\n  cut(0);\n  cout << sum << endl;\n}\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    ope();\n  return 0;\n}\n"}
{"label": "18", "index": "33622", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], sum;\nint del(int m) {\n  if (m == 1)\n    return sum;\n  int min;\n  for (int i = 0; i < m; i++) {\n    min = a[i][0];\n    for (int j = 1; j < m; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < m; j++) {\n    min = a[0][j];\n    for (int i = 1; i < m; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < m; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int j = 1; j < m - 1; j++)\n    a[0][j] = a[0][j + 1];\n  for (int i = 1; i < m - 1; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < m - 1; i++)\n    for (int j = 1; j < m - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  return del(m - 1);\n}\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    printf(\"%d\\n\", del(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33623", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[100][100] = {0};\nvoid temp(int n) {\n  if (n == 1)\n    return;\n  for (int i = 0; i < n; i++) {\n    int miner = 1000;\n    for (int j = 0; j < n; j++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - miner;\n  }\n  for (int j = 0; j < n; j++) {\n    int miner = 1000;\n    for (int i = 0; i < n; i++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int i = 0; i < n; i++)\n      a[i][j] = a[i][j] - miner;\n  }\n  sum = sum + a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  temp(n - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int m = 0; m < n; m++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    temp(n);\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33624", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, m, the_min;\nint a[110][110];\n\nvoid reduce_min(int x, int y, int dx, int dy) {\n  if (x == m || y == m) {\n    return;\n  }\n  if (a[x][y] < the_min) {\n    the_min = a[x][y];\n  }\n\n  reduce_min(x + dx, y + dy, dx, dy);\n  a[x][y] -= the_min;\n}\n\nvoid reduce() {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  }\n}\n\nint main() {\n  int i, j;\n  int t;\n  int sum;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    for (m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        the_min = 10000;\n        reduce_min((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      reduce();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33625", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint min(int *p, int n) {\n  int k, i;\n  k = *p;\n  p++;\n  for (i = 1; i < n; i++, p++) {\n    if (*p < k)\n      k = *p;\n  }\n  return (k);\n}\nint main() {\n  int i, j, n, m, p, q, w, xiao, s;\n  int a[101][101], b[101];\n  cin >> n;\n  for (w = 0; w < n; w++) {\n\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    s = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++)\n        b[i] = 0;\n      for (i = 0; i < m; i++) {\n        xiao = min(a[i], m);\n        if (xiao == 0) {\n          for (j = 0; j < m; j++) {\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n          continue;\n\n        } else {\n          for (j = 0; j < m; j++) {\n            a[i][j] -= xiao;\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n        }\n      }\n      for (i = 0; i < m; i++) {\n        if (b[i] != 0)\n          continue;\n        else {\n          xiao = a[0][i];\n          for (j = 1; j < m; j++)\n            if (a[j][i] < xiao)\n              xiao = a[j][i];\n          for (j = 0; j < m; j++)\n            a[j][i] -= xiao;\n        }\n      }\n      s += a[1][1];\n      for (i = 0; i < m; i++) {\n        if (i == 1)\n          continue;\n        else {\n          for (j = 1; j < m - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[j][i] = a[j + 1][i];\n    }\n    printf(\"%d \", s);\n  }\n}\n"}
{"label": "18", "index": "33626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[200][200][200];\n\nint main() {\n  int n, sum[200];\n  int p, k, i, j;\n  int min;\n\n  cin >> n;\n\n  for (p = 0; p < n; p++) {\n    sum[p] = 0;\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[p][i][j]);\n\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = a[p][i][0];\n        for (j = 0; j < n - k; j++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (j = 0; j < n - k; j++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        min = a[p][0][j];\n        for (i = 0; i < n - k; i++)\n          if (min > a[p][i][j])\n            min = a[p][i][j];\n        for (i = 0; i < n - k; i++)\n          a[p][i][j] = a[p][i][j] - min;\n      }\n\n      sum[p] = sum[p] + a[p][1][1];\n\n      for (i = 1; i < n - k; i++)\n        a[p][i][0] = a[p][i + 1][0];\n      for (j = 1; j < n - k; j++)\n        a[p][0][j] = a[p][0][j + 1];\n      for (i = 1; i < n - k; i++)\n        for (j = 1; j < n - k; j++)\n          a[p][i][j] = a[p][i + 1][j + 1];\n    }\n  }\n\n  for (p = 0; p < n - 1; p++)\n    cout << sum[p] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33627", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, m, imin;\nint matrix[110][110];\nvoid submin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (matrix[x][y] < imin) {\n    imin = matrix[x][y];\n  }\n  submin(x + dx, y + dy, dx, dy);\n  matrix[x][y] = matrix[x][y] - imin;\n}\nvoid sub() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[i][j] = matrix[i][j + 1];\n    }\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[j][i] = matrix[j + 1][i];\n    }\n}\nint main() {\n  int i, j, sum, t;\n  for (cin >> n, t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> matrix[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        imin = 10000;\n        submin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + matrix[1][1];\n      sub();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33628", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, t, n, i, j, temp, sum, count;\n  scanf(\"%d\", &n);\n  int a[101][101];\n  m = n;\n  for (; n > 0; n--) {\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    t = m;\n    for (; t > 2; t--) {\n      for (i = 1; i <= t; i++) {\n        temp = a[i][1];\n        for (j = 2; j <= t; j++)\n          if (temp > a[i][j]) {\n            temp = a[i][j];\n          }\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i][j] - temp;\n      }\n      for (j = 1; j <= t; j++) {\n        count = 0;\n        for (i = 1; i <= t; i++) {\n          if (a[i][j] == 0) {\n            break;\n          } else\n            count++;\n        }\n        if (count == t) {\n          temp = a[1][j];\n          for (i = 2; i <= t; i++)\n            if (temp > a[i][j]) {\n              temp = a[i][j];\n            }\n          for (i = 1; i <= t; i++)\n            a[i][j] = a[i][j] - temp;\n        } else {\n          continue;\n        }\n      }\n      sum = sum + a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 1; i <= t - 1; i++)\n        for (j = 2; j <= t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    for (i = 1; i <= 2; i++) {\n      temp = a[i][1];\n      for (j = 2; j <= 2; j++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (j = 1; j <= 2; j++)\n        a[i][j] = a[i][j] - temp;\n    }\n    for (j = 1; j <= 2; j++) {\n      temp = a[1][j];\n      for (i = 2; i <= 2; i++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (i = 1; i <= 2; i++)\n        a[i][j] = a[i][j] - temp;\n    }\n    sum = sum + a[2][2];\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33629", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int q;\n  q = n;\n  int a[150][150], sum = 0, i, j, k, l, m, p, min;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (l = 1; l < n; l++) {\n          if (min > a[j][l])\n            min = a[j][l];\n        }\n        for (m = 0; m < n; m++) {\n          a[j][m] = a[j][m] - min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (l = 1; l < n; l++) {\n          if (min > a[l][j])\n            min = a[l][j];\n        }\n        for (m = 0; m < n; m++)\n          a[m][j] = a[m][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (p = 2; p < n; p++) {\n        a[0][p - 1] = a[0][p];\n        a[p - 1][0] = a[p][0];\n      }\n      for (j = 2; j < n; j++) {\n        for (l = 2; l < n; l++) {\n          a[j - 1][l - 1] = a[j][l];\n        }\n      }\n      n--;\n    }\n    cout << sum << endl;\n    sum = 0;\n    n = q;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, a[100][100], b[10000], min = 0;\n  cin >> n;\n  k = n;\n  while (k > 0) {\n    memset(a, 0, sizeof(a));\n    int i, j, k1, sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    k1 = n;\n    while (k1 > 1) {\n      for (i = 0; i < k1; i++) {\n        min = a[i][0];\n        for (j = 0; j < k1; j++) \n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < k1; i++) {\n        min = a[0][i];\n        for (j = 0; j < k1; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < k1; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      int count = 0;\n      memset(b, 0, sizeof(b));\n      for (i = 0; i < k1; i++) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < k1; j++) {\n          if (j == 1)\n            continue;\n          b[count++] = a[i][j];\n        }\n      }\n      k1--;\n      memset(a, 0, sizeof(a));\n      int x = 0;\n      for (i = 0; i < k1; i++)\n        for (j = 0; j < k1; j++)\n          a[i][j] = b[x++];\n    }\n    cout << sum << endl;\n    sum = 0;\n    k--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n  int num;\n  cin >> num;\n  int an[100][100];\n  for (int c = 0; c < num; c++) {\n\n    for (int i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> *(*(an + i) + j);\n    }\n    int sum = 0;\n    int hang;\n    for (hang = num; hang > 1; hang--) {\n      int a = 0, b = 0;\n      for (m = 0; m < hang; m++) {\n        a = *(*(an + m) + 0);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + m) + n) < a)\n            a = *(*(an + m) + n);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + m) + n) = *(*(an + m) + n) - a;\n      }\n\n      for (m = 0; m < hang; m++) {\n        b = *(*(an + 0) + m);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + n) + m) < b)\n            b = *(*(an + n) + m);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + n) + m) = *(*(an + n) + m) - b;\n      }\n      sum = sum + an[1][1];\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + i) + j) = *(*(an + i) + j + 1);\n      }\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + j) + i) = *(*(an + j + 1) + i);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33632", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint cal(int matrix[][120], int n) {\n  if (n == 1)\n    return (0);\n  int i, j, min, s;\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] < min)\n        min = matrix[i][j];\n    }\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[j][i] < min)\n        min = matrix[j][i];\n    }\n    for (j = 0; j < n; j++)\n      matrix[j][i] = matrix[j][i] - min;\n  }\n  s = matrix[1][1];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i + 1][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      matrix[i][j] = matrix[i][j + 1];\n\n  return (s + cal(matrix, n - 1));\n}\n\nint main() {\n  int n, i, j, k;\n  int a[120][120];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    cout << cal(a, n) << \"\\n\";\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "33633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint str[101][101];\nvoid input(int n) {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      scanf(\"%d \", &str[i][j]);\n}\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int max = str[i][0];\n    for (int j = 0; j < n; j++)\n      if (max > str[i][j])\n        max = str[i][j];\n    for (int j = 0; j < n; j++)\n      str[i][j] -= max;\n  }\n  for (int i = 0; i < n; i++) {\n    int max = str[0][i];\n    for (int j = 0; j < n; j++)\n      if (max > str[j][i])\n        max = str[j][i];\n    for (int j = 0; j < n; j++)\n      str[j][i] -= max;\n  }\n}\nvoid del(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\nvoid cal(int n, int sum) {\n  if (n == 2) {\n    zero(2);\n    sum += str[1][1];\n    cout << sum << endl;\n    return;\n  }\n\n  zero(n);\n  sum += str[1][1];\n  del(n);\n  cal(n - 1, sum);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    input(n);\n    cal(n, 0);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(void);\nvoid xiaojian(int);\nint g_n;\nint main() {\n  cin >> g_n;\n  int i, j, k;\n  for (i = 1; i <= g_n; i++) {\n    for (j = 0; j <= g_n - 1; j++) {\n      for (k = 0; k <= g_n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    int cishu = 1;\n    int sum = 0;\n    for (; a[g_n - 1][0] >= 0; cishu++) {\n      guiling();\n      sum = sum + a[cishu][cishu];\n      xiaojian(cishu);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid guiling() {\n  int i = 0, j = 0, k = 0;\n  int flag = 0;\n  int min = 1000;\n  int p = 0;\n  for (p = 0; p <= g_n - 1; p++) {\n    flag = 0;\n    min = 1000;\n    if (a[p][0] >= 0) {\n      for (i = 0; i <= g_n - 1; i++) {\n        flag = 0;\n        min = 1000;\n        for (j = 0; j <= g_n - 1; j++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[i][k] = a[i][k] - min;\n          }\n        }\n      }\n      for (j = 0; j <= g_n - 1; j++) {\n        flag = 0;\n        min = 1000;\n        for (i = 0; i <= g_n - 1; i++) {\n          if (a[i][j] < 0)\n            continue;\n          if (a[i][j] == 0) {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (!flag) {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[k][j] = a[k][j] - min;\n          }\n        }\n      }\n    }\n  }\n}\nvoid xiaojian(int cishu) {\n  int i, j;\n  for (i = 0; i <= g_n - 1; i++) {\n    a[i][cishu] = -1;\n  }\n  for (j = 0; j <= g_n - 1; j++) {\n    a[cishu][j] = -1;\n  }\n}\n"}
{"label": "18", "index": "33635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  int rmin[100], cmin[100];\n  int i, j, k, l;\n  for (i = 0; i <= n - 1; i++) {\n    rmin[i] = a[i][0];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] < rmin[i]) {\n        rmin[i] = a[i][j];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[k][l] -= rmin[k];\n  for (i = 0; i <= n - 1; i++) {\n    cmin[i] = a[0][i];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] < cmin[i]) {\n        cmin[i] = a[j][i];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[l][k] -= cmin[k];\n  return 0;\n}\nint main() {\n  int n;\n  cin >> n;\n  int i = 1, sum[100] = {0}, t;\n  while (i <= n) {\n    int a[100][100];\n    int j, k, l, m, s, y;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      y = f(a, n - l + 1);\n      sum[i] += a[1][1];\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l; s++) {\n          a[m][s] = a[m + 1][s];\n        }\n      }\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l - 1; s++) {\n          a[s][m] = a[s][m + 1];\n        }\n      }\n    }\n    i++;\n  }\n  for (t = 1; t <= n; t++)\n    printf(\"%d\\n\", sum[t]);\n  return 0;\n}\n"}
{"label": "18", "index": "33636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid hang(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid lie(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nvoid xiaohang(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[i][j]) {\n        min = a[i][j];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid xiaolie(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[j][i]) {\n        min = a[j][i];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100] = {{0}};\n  int i, j;\n  int p;\n  for (p = 1; p <= n; p++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int o, sum = 0, m = n;\n    for (o = 1; o <= n - 1; o++) {\n      xiaohang(a, m);\n      xiaolie(a, m);\n      sum += a[2][2];\n      hang(a, m);\n      lie(a, m);\n      m--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid change(int n);\nint number[100][100];\nint main() {\n  int n, k, j;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> number[k][j];\n    sum = 0;\n    change(n);\n  }\n  return 0;\n}\n\nvoid change(int n) {\n  int m;\n  m = n;\n  int min;\n  if (m == 1)\n    printf(\"%d\\n\", sum);\n  else {\n    int i = 0, j = 0;\n    for (i = 0; i < m; i++) {\n      min = number[i][0];\n      for (j = 0; j < m; j++)\n        if (min > number[i][j])\n          min = number[i][j];\n      for (j = 0; j < n; j++)\n        number[i][j] = number[i][j] - min;\n    }\n    for (i = 0; i < m; i++) {\n      min = number[0][i];\n      for (j = 0; j < m; j++)\n        if (min > number[j][i])\n          min = number[j][i];\n      for (j = 0; j < m; j++)\n        number[j][i] = number[j][i] - min;\n    }\n\n    sum = sum + number[1][1];\n    for (j = 0; j < m; j++)\n      for (i = 1; i < m - 1; i++)\n        number[i][j] = number[i + 1][j];\n    for (i = 0; i < m - 1; i++)\n      for (j = 1; j < m - 1; j++)\n        number[i][j] = number[i][j + 1];\n    m = m - 1;\n    change(m);\n  }\n}\n"}
{"label": "18", "index": "33638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, m, k, sum, min;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    memset(a, 0, sizeof(a));\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - k; j++) {\n          *(*(a + j) + i) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33639", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, cnt, kobe;\n  cin >> n;\n  cnt = n;\n\n  int(*p)[200], a[200][200] = {0};\n  while (cnt--) {\n    int i, j, sum = 0;\n    long min;\n    kobe = n;\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (int k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < kobe; i++) {\n        min = 999999999;\n        for (j = 0; j < kobe; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (j = 0; j < kobe; j++) {\n        min = 999999999;\n        for (i = 0; i < kobe; i++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 1; i < kobe; i++)\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < kobe; j++)\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      kobe--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33640", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, sum = 0, s2;\n  cin >> n; \n  s2 = n;\n  for (i = 1; i <= s2; i++) {\n    n = s2;\n    sum = 0;\n    int a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];  \n    while (n > 1)                      \n    {\n      int s[100]; \n      for (j = 0; j < n; j++)\n        s[j] = a[j][0]; \n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[j][k] < s[j])\n            s[j] = a[j][k]; \n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j][k] -= s[j]; \n\n      int t[100];\n      for (j = 0; j < n; j++)\n        t[j] = a[0][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[k][j] < t[j])\n            t[j] = a[k][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[k][j] -= t[j];\n\n      sum += a[1][1]; \n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k]; \n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k]; \n\n      n--; \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int sum = 0;\n  int l = 0;\n  int a[100][100];\n  int min;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    l = 0;\n    for (i = 0; i < n - l; i++)\n      for (j = 0; j < n - l; j++)\n        scanf(\"%d \", &a[i][j]);\n    while (l < n - 1) {\n      for (i = 0; i < n - l; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1 - l; i++)\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1 - l; j++)\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j + 1];\n      l++;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33642", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[i][0];\n    for (int j = 1; j < k; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[i][j] -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = a[0][i];\n    for (int j = 1; j < k; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min)\n      for (int j = 0; j < k; j++)\n        a[j][i] -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      a[i][j - 1] = a[i][j];\n}\nint main() {\n  cin >> n;\n  while (cin >> a[0][0]) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> a[i][j];\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += a[1][1];\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33643", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid hang(int[], int);\nvoid xiaojie(int[], int);\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int min, sum;\n  int a[101][101];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - m; i++)\n        hang(a[i], n - m);\n      for (j = 0; j < n - m; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n - m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - m; i++)\n        xiaojie(a[i], n - m);\n      for (j = 0; j < n - 1 - m; j++) {\n        for (i = 1; i < n - 1 - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid hang(int a[], int leg) {\n  int min = a[0];\n  int i;\n  for (i = 0; i < leg; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < leg; i++)\n    a[i] = a[i] - min;\n}\nvoid xiaojie(int a[], int leg) {\n  int i;\n  for (i = 1; i < leg; i++)\n    a[i] = a[i + 1];\n}\n"}
{"label": "18", "index": "33644", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[102][102], min = 100000, sum = 0, t;\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (t = 0; t <= n - 2; t++) {\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[i][j] ? min : a[i][j];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[j][i] ? min : a[j][i];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 3; i <= n - t; i++) {\n        a[i - 1][1] = a[i][1];\n        a[1][i - 1] = a[1][i];\n      }\n\n      for (i = 3; i <= n - t; i++) {\n        for (j = 3; j <= n - t; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33645", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, count, min;\n  cin >> n;\n  int input[n][n], sum[n];\n  for (i = 0; i < n; i++) {\n    count = n;\n    sum[i] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> input[j][k];\n\n    while (count != 1) {\n      for (j = 0; j < count; j++) {\n        min = input[j][0];\n        for (k = 1; k < count; k++)\n          if (input[j][k] < min)\n            min = input[j][k];\n        for (k = 0; k < count; k++)\n          input[j][k] -= min;\n      }\n      for (j = 0; j < count; j++) {\n        min = input[0][j];\n        for (k = 1; k < count; k++)\n          if (input[k][j] < min)\n            min = input[k][j];\n        for (k = 0; k < count; k++)\n          input[k][j] -= min;\n      }\n\n      sum[i] += input[1][1];\n      for (k = 0; k < count; k++)\n        for (j = 1; j < count - 1; j++)\n          input[j][k] = input[j + 1][k];\n      for (k = 0; k < count - 1; k++) {\n        for (j = 1; j < count - 1; j++)\n          input[k][j] = input[k][j + 1];\n      }\n      count--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n) {\n  int i = 0, j = 0, min = 0, count = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  count = count + a[1][1];\n  if (n == 2)\n    return count;\n  else {\n    for (i = 2; i < n; i++)\n      a[i - 1][0] = a[i][0];\n    for (j = 2; j < n; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    count = count + sum(n - 1);\n    return count;\n  }\n}\nint main() {\n  int n, i = 0, j = 0, k = 0, b[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    b[i] = sum(n);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33647", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int a[100][100];\n  int i, j, k, m, n;\n  int min, sum;\n\n  scanf(\"%d\", &m);\n  for (k = 0; k < m; k++) {\n    \n    n = m;\n    sum = 0;\n    \n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    while (n > 1) {\n      \n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      \n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n      \n      sum += a[1][1];\n      \n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      \n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      \n      n--;\n    }\n    \n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nchar mn[] = {3, 9, 31};\n\nint xn = 0;\n\nint max_files = sizeof(mn) / sizeof(mn[0]);\n\nchar *output_dir = \"data\";\n\nint rnd(int min, int max) {\n  return min + ((rand() << 15) | rand()) % (max - min + 1);\n}\n\nvoid xbuild() {\n  int i, j, k, n;\n  n = mn[xn];\n  printf(\"%d\\n\", n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      printf(\"%d\", rnd(1, n * n));\n      for (j = 1; j < n; j++) {\n        printf(\" %d\", rnd(1, n * n));\n      }\n      printf(\"\\n\");\n    }\n  }\n  xn++;\n}\n"}
{"label": "18", "index": "33648", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid row_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[i][0];\n    for (j = 1; j < n; j++)\n      if (array[i][j] < min)\n        min = array[i][j];\n    for (j = 0; j < n; j++)\n      array[i][j] -= min;\n  }\n}\n\nvoid col_deduct(int array[101][101], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = array[0][i];\n    for (j = 1; j < n; j++)\n      if (array[j][i] < min)\n        min = array[j][i];\n    for (j = 0; j < n; j++)\n      array[j][i] -= min;\n  }\n}\n\nvoid delete22(int array[101][101], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[i][j - 1] = array[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      array[j - 1][i] = array[j][i];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  int array[101][101];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> array[j][k];\n    }\n    for (j = n; j >= 2; j--) {\n      row_deduct(array, j);\n      col_deduct(array, j);\n      sum += array[1][1];\n      delete22(array, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33649", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0};\nint b[100][100] = {0};\nint i, j, n;\nint num = 0;\nvoid m(int n) {\n  int min;\n  for (i = 0; i <= n - 1; ++i) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    min = a[0][j];\n    for (i = 0; i <= n - 1; ++i) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n - 1; ++i)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid del(int n) {\n  b[0][0] = a[0][0];\n  for (j = 1; j <= n - 2; ++j)\n    b[0][j] = a[0][j + 1];\n  for (i = 1; i <= n - 2; ++i)\n    b[i][0] = a[i + 1][0];\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\nint s(int n) {\n  m(n);\n  num = num + a[1][1];\n  del(n);\n  if (n != 2)\n    s(n - 1);\n  return num;\n}\nint main() {\n  int k;\n  cin >> n;\n  for (k = 1; k <= n; ++k) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j)\n        cin >> a[i][j];\n    }\n    num = 0;\n    cout << s(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33650", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minih(int numh, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numh; i++) {\n    if (min > *(p + i - 1)) {\n      min = *(p + i - 1);\n    } else {\n    }\n  }\n  return min;\n}\nint minil(int numl, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numl; i++) {\n    if (min > *(p + 101 * (i - 1)))\n      min = *(p + 101 * (i - 1));\n    else {\n    }\n  }\n  return min;\n}\nint main() {\n  int a[101][101];\n  int *p;\n  p = &a[0][0];\n  int i, j, k, n;\n  int minor;\n  int sum;\n  scanf(\"%d\", &n);\n  int hang, lie;\n  for (i = 1; i <= n; i++) {\n\n    hang = n;\n    lie = n;\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", p + 101 * (j - 1) + k - 1);\n      }\n    }\n\n    for (minor = 1; lie > 1; minor++) {\n\n      for (j = 1; j <= hang; j++) {\n        int minihang;\n\n        minihang = minih(lie, (p + 101 * (j - 1)));\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) -= minihang;\n        }\n      }\n\n      for (j = 1; j <= lie; j++) {\n        int minilie;\n\n        minilie = minil(hang, (p + (j - 1)));\n        for (k = 1; k <= hang; k++) {\n          *(p + (j - 1) + 101 * (k - 1)) -= minilie;\n        }\n      }\n      sum += *(p + 102);\n\n      for (j = 2; j <= hang; j++) {\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) = *(p + 101 * j + k - 1);\n        }\n      }\n      hang--;\n\n      for (j = 2; j <= lie; j++) {\n        for (k = 1; k <= hang; k++) {\n          *(p + 101 * (k - 1) + j - 1) = *(p + 101 * (k - 1) + j);\n        }\n      }\n      lie--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33651", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum, num, (*p)[200], t, temp;\n  int a[200][200];\n  cin >> n;\n  sum = 0;\n  num = 0;\n  p = a;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (num < n - 1) {\n      for (i = 0; i < n - num; i++) {\n        temp = 1000;\n        for (j = 0; j < n - num; j++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        temp = 1000;\n        for (i = 0; i < n - num; i++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n        }\n      }\n      num++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33652", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint result = 0;\nint min1;\nint minh(int n, int j) {\n  int i, min_a;\n  min_a = a[j][0];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[j][i]) {\n      min_a = a[j][i];\n    }\n  }\n  return min_a;\n}\nint minl(int n, int j) {\n  int i, min_a;\n  min_a = a[0][j];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[i][j]) {\n      min_a = a[i][j];\n    }\n  }\n  return min_a;\n}\nint dec(int n) {\n  int m, p, q;\n  if (n == 1) {\n    cout << result << endl;\n    return 0;\n  }\n  if (n > 1) {\n    for (m = 0; m < n; m++) {\n      min1 = minh(n, m);\n      for (p = 0; p < n; p++) {\n        a[m][p] = a[m][p] - min1;\n      }\n    }\n    for (m = 0; m < n; m++) {\n      min1 = minl(n, m);\n      for (p = 0; p < n; p++) {\n        a[p][m] = a[p][m] - min1;\n      }\n    }\n    result = result + a[1][1];\n    for (m = 0; m < n; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[m][p] = a[m][p + 1];\n      }\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (p = 1; p < n - 1; p++) {\n        a[p][m] = a[p + 1][m];\n      }\n    }\n    dec(n - 1);\n  }\n}\nint main(int argc, const char *argv[]) {\n\n  int n;\n  scanf(\"%d \", &n);\n  int w, s, t;\n  for (w = 1; w <= n; w++) {\n    for (s = 0; s < n; s++) {\n\n      for (t = 0; t < n; t++) {\n        cin >> a[s][t];\n      }\n    }\n    result = 0;\n    dec(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], s = 0;\nvoid juzhen(int x) {\n\n  for (int i = 0; i < x; i++) {\n    int m = a[i][0];\n    for (int j = 1; j < x; j++)\n\n      if (a[i][j] < m)\n        m = a[i][j];\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - m;\n  }\n  for (int i = 0; i < x; i++) {\n    int m = a[0][i];\n    for (int j = 1; j < x; j++)\n\n      if (a[j][i] < m)\n        m = a[j][i];\n    for (int j = 0; j < x; j++)\n      a[j][i] = a[j][i] - m;\n  }\n  s = s + a[1][1];\n  if (x == 2) {\n    cout << s << endl;\n    return;\n  }\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x - 1; j++)\n      a[j][i] = a[j][i + 1];\n  juzhen(x - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n\n  for (int o = 1; o <= n; o++) {\n    s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    juzhen(n);\n  }\n}\n"}
{"label": "18", "index": "33654", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum, a[101][101];\nvoid g0(int n) {\n  if (n == 1)\n    return; \n  else {\n    int min;\n    for (int i = 1; i <= n; i++) {\n      min = a[i][1];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[i][j] ? min : a[i][j];\n      for (int j = 1; j <= n; j++)\n        a[i][j] -= min;\n    } \n    for (int i = 1; i <= n; i++) {\n      min = a[1][i];\n      for (int j = 1; j <= n; j++)\n        min = min <= a[j][i] ? min : a[j][i];\n      for (int j = 1; j <= n; j++)\n        a[j][i] -= min;\n    }               \n    sum += a[2][2]; \n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[i][j] = a[i + 1][j]; \n    for (int i = 2; i <= n - 1; i++)\n      for (int j = 1; j <= n; j++)\n        a[j][i] = a[j][i + 1]; \n  }\n  g0(n - 1); \n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        cin >> a[i][j];\n    g0(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33655", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, a[100][100], b, min, k, sum = 0;\n  cin >> n;\n  b = n;\n  while (b > 0) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 1; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (j = 1; j < k; j++)\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n\n    b--;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33656", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101] = {0};\nint xiao(int n) {\n  int i, j, t, minh[101] = {0}, minl[101] = {0}, temp = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    return a[1][1];\n  }\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    temp = a[1][1];\n    for (i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n      a[0][i - 1] = a[0][i];\n      for (j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    return temp + xiao(n - 1);\n  }\n}\nint main() {\n  int n, k, l, m, ans[101] = {0};\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d \", &a[k][l]);\n      }\n    }\n    ans[m] = xiao(n);\n  }\n  for (k = 1; k <= n; k++) {\n    cout << ans[k] << endl;\n  }\n  int f;\n  cin >> f;\n  return 0;\n}\n"}
{"label": "18", "index": "33657", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint sum(int n) {\n  int i, j, x, t;\n  int p, q;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++) {\n      if (x > *(*(a + i) + j))\n        x = *(*(a + i) + j);\n    }\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + i) + j)) -= x;\n  }\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + j) + i))\n        x = *(*(a + j) + i);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + j) + i)) -= x;\n  }\n  t = *(*(a + 1) + 1);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n  return (t + sum(n - 1));\n}\nint main() {\n  int n, i, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        scanf(\"%d \", &a[p][q]);\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int (*p)[100], int n) {\n  int sum, i, j, min = 0;\n  sum = 0;\n  {\n    for (i = 0; i < n; i++) {\n      min = **(p + i);\n      {\n        for (j = 1; j < n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n    }\n  }\n  {\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      {\n        {\n          for (i = 1; i < n; i++)\n            if (*(*(p + i) + j) < min)\n              min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n        sum = *(*(p + 1) + 1);\n      }\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        *(*p + i) = *(*p + i + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        **(p + i) = **(p + i + 1);\n    }\n    return (sum);\n  }\n}\nint main() {\n  int(*p)[100], (*q)[100], n, i, j, sum = 0, k;\n  p = (int(*)[100])malloc(100 * sizeof(int) * 10000);\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + k * n + i) + j);\n  }\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    q = p + k * n;\n    {\n      for (i = n; i > 1; i--)\n        sum = sum + f(q, i);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33659", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, k, m, z, x, p = 0, min1[100], min2[100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = 0;\n    p = 0;\n    while (p < n) {\n      for (m = 0; m < n - p; m++) {\n        min1[m] = a[m][0];\n        for (k = 0; k < n - p; k++) {\n\n          if (min1[m] > a[m][k])\n            min1[m] = a[m][k];\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min1[z];\n        }\n      }\n      for (m = 0; m < n - p; m++) {\n        min2[m] = a[0][m];\n        for (k = 0; k < n - p; k++) {\n\n          if (min2[m] > a[k][m]) {\n            min2[m] = a[k][m];\n          }\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (x = 0; x < n - p; x++) {\n          a[z][x] = a[z][x] - min2[x];\n        }\n      }\n      sum = sum + a[1][1];\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[z][m] = a[z][m + 1];\n        }\n      }\n      for (z = 0; z < n - p; z++) {\n        for (m = 1; m < n - p; m++) {\n          a[m][z] = a[m + 1][z];\n        }\n      }\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33660", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[102][102], i, k, j, l, n, s, (*p)[102], (*q)[102], min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0, s = 0, p = &a[0]; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0, p = &a[0], q = &a[n]; i < n; i++)\n      *(*q + i) = *(*p + i);\n    for (i = 0, p = &a[1]; i < n; i++)\n      *(*(p + i) + n) = **(p + i);\n    for (l = 1; l < n; l++) {\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + i) + l); j <= n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = l; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + l) + i); j <= n; j++)\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        for (j = l; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      s += *(*(p + l) + l);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int flag = 0;\n  int gl(int num[][200], int n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num[200][200] = {0};\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &num[j][k]);\n    sum = gl(num, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint gl(int num[][200], int n) {\n  int i = 0, j = 0, k = 0;\n  int min = 0;\n  int flag = 0;\n  int sum = 0;\n  for (flag = 0; flag < n - 1; flag++) {\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n      for (j = 0; j < n; j++) {\n        if (num[i][j] < min) {\n          min = num[i][j];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++)\n        num[i][j] = num[i][j] - min;\n    }\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n      for (j = 0; j < n; j++) {\n        if (num[j][i] < min) {\n          min = num[j][i];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n    sum += num[1][1];\n\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++)\n        num[j][i - 1] = num[j][i];\n\n      num[j][i] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[i - 1][j] = num[i][j];\n      }\n      num[j][i] = 0;\n    }\n  }\n  return sum;\n}\n"}
{"label": "18", "index": "33662", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], sum = 0;\n\nint minr(int u, int n) {\n  int i, minn = a[u][1];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[u][i])\n      minn = a[u][i];\n  }\n  return minn;\n}\n\nint minc(int v, int n) {\n  int i, minn = a[1][v];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[i][v])\n      minn = a[i][v];\n  }\n  return minn;\n}\n\nvoid f2(int n) {\n  int u, v;\n  for (u = 2; u <= n - 1; u++) {\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u + 1][v];\n    }\n  }\n  for (v = 2; v <= n - 1; v++) {\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v + 1];\n    }\n  }\n  return;\n}\n\nvoid f1(int n) {\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  }\n  int u, v;\n\n  for (u = 1; u <= n; u++) {\n    int temp = minr(u, n);\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n\n  for (v = 1; v <= n; v++) {\n    int temp = minc(v, n);\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n  sum = sum + a[2][2];\n  f2(n);\n  f1(n - 1);\n}\n\nint main() {\n  int n, i, u, v;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (u = 1; u <= n; u++) {\n      for (v = 1; v <= n; v++) {\n        scanf(\"%d \", &a[u][v]);\n      }\n    }\n    f1(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33663", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, sum, min, anw = 0;\n  int test[100][100];\n  scanf(\"%d \", &n);\n  sum = n;\n  for (k = 0; k < sum; k++) {\n    n = sum;\n    for (i = 0; i < sum; i++) {\n      for (j = 0; j < sum; j++) {\n        cin >> test[i][j];\n      }\n    }\n    anw = 0;\n    while (n != 1) {\n      for (i = 0; i < n; i++) {\n        min = test[i][0];\n        for (j = 0; j < n; j++) {\n          if (min > test[i][j])\n            min = test[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          test[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = test[0][i];\n        for (j = 0; j < n; j++) {\n          if (min > test[j][i])\n            min = test[j][i];\n        }\n        for (j = 0; j < n; j++) {\n          test[j][i] -= min;\n        }\n      }\n      anw += test[1][1];\n      n--;\n      for (i = 1; i < n; i++) {\n        for (j = 0; j <= n; j++)\n          test[i][j] = test[i + 1][j];\n      }\n      for (j = 1; j < n; j++) {\n        for (i = 0; i < n; i++)\n          test[i][j] = test[i][j + 1];\n      }\n    }\n    printf(\"%d\\n\", anw);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid hang(int[], int);\nvoid xiaojie(int[], int);\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int min, sum;\n  int a[101][101];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - m; i++)\n        hang(a[i], n - m);\n      for (j = 0; j < n - m; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n - m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - m; i++)\n        xiaojie(a[i], n - m);\n      for (j = 0; j < n - 1 - m; j++) {\n        for (i = 1; i < n - 1 - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid hang(int a[], int leg) {\n  int min = a[0];\n  int i;\n  for (i = 0; i < leg; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < leg; i++)\n    a[i] = a[i] - min;\n}\nvoid xiaojie(int a[], int leg) {\n  int i;\n  for (i = 1; i < leg; i++)\n    a[i] = a[i + 1];\n}\n"}
{"label": "18", "index": "33665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nint (*p)[100] = array_1;\nint sum;\nint n;\nint times;\n\nvoid zero() {\n  int xmin = 10000, ymin = 10000;\n  for (int i = 0; i <= n - 1 - times; i++) {\n    for (int j = 0; j <= n - 1 - times; j++)\n      if (*(*(p + i) + j) < xmin) {\n        xmin = *(*(p + i) + j);\n      }\n    for (int j = 0; j <= n - 1 - times; j++)\n      *(*(p + i) + j) -= xmin;\n    xmin = 10000;\n  }\n  for (int j = 0; j <= n - 1 - times; j++) {\n    for (int i = 0; i <= n - 1 - times; i++)\n      if (*(*(p + i) + j) < ymin) {\n        ymin = *(*(p + i) + j);\n      }\n    for (int i = 0; i <= n - 1 - times; i++)\n      *(*(p + i) + j) -= ymin;\n    ymin = 10000;\n  }\n\n  sum += (*(*(p + 1) + 1));\n}\nvoid decline() {\n  for (int i = 1; i <= n - 2; i++)\n    for (int j = 0; j <= n - 1; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n  for (int j = 1; j <= n - 2; j++)\n    for (int i = 0; i <= n - 2; i++)\n      *(*(p + i) + j) = *(*(p + i) + j + 1);\n}\n\nint main() {\n  scanf(\"%d \", &n);\n  int time = 0;\n  while (true) {\n\n    if (time == n)\n      break;\n    times = 0;\n    sum = 0;\n\n    for (int i = 0; i <= n - 1; i++)\n      for (int j = 0; j <= n - 1; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 1; i <= n - 1; i++) {\n      zero();\n      decline();\n      times++;\n    }\n\n    cout << sum << \"\\n\";\n\n    time++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[110][110], n, sum;\nvoid calculate(int t) {\n  int i, j, minimum;\n  for (i = 1; i <= n; i++) {\n    minimum = a[i][1];\n    for (j = t; j <= n; j++)\n      if (minimum > a[i][j])\n        minimum = a[i][j];\n    a[i][1] -= minimum;\n    for (j = t; j <= n; j++)\n      a[i][j] -= minimum;\n  }\n  for (i = 1; i <= n; i++) {\n    minimum = a[1][i];\n    for (j = t; j <= n; j++)\n      if (minimum > a[j][i])\n        minimum = a[j][i];\n\n    a[1][i] -= minimum;\n    for (j = t; j <= n; j++) {\n      a[j][i] -= minimum;\n    }\n  }\n  sum += a[t][t];\n  if (t < n)\n    calculate(t + 1);\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    calculate(2);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33667", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[110][110], n, sum;\nvoid calculate(int t) {\n  int i, j, minimum;\n  for (i = 1; i <= n; i++) {\n    minimum = a[i][1];\n    for (j = t; j <= n; j++)\n      if (minimum > a[i][j])\n        minimum = a[i][j];\n    a[i][1] -= minimum;\n    for (j = t; j <= n; j++)\n      a[i][j] -= minimum;\n  }\n  for (i = 1; i <= n; i++) {\n    minimum = a[1][i];\n    for (j = t; j <= n; j++)\n      if (minimum > a[j][i])\n        minimum = a[j][i];\n\n    a[1][i] -= minimum;\n    for (j = t; j <= n; j++)\n      a[j][i] -= minimum;\n  }\n  sum += a[t][t];\n  if (t < n)\n    calculate(t + 1);\n}\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    calculate(2);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, t, n, i, j, temp, sum, count;\n  scanf(\"%d\", &n);\n  int a[101][101];\n  m = n;\n  for (; n > 0; n--) {\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    t = m;\n    for (; t > 2; t--) {\n      for (i = 1; i <= t; i++) {\n        temp = a[i][1];\n        for (j = 2; j <= t; j++)\n          if (temp > a[i][j]) {\n            temp = a[i][j];\n          }\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i][j] - temp;\n      }\n      for (j = 1; j <= t; j++) {\n        count = 0;\n        for (i = 1; i <= t; i++) {\n          if (a[i][j] == 0) {\n            break;\n          } else\n            count++;\n        }\n        if (count == t) {\n          temp = a[1][j];\n          for (i = 2; i <= t; i++)\n            if (temp > a[i][j]) {\n              temp = a[i][j];\n            }\n          for (i = 1; i <= t; i++)\n            a[i][j] = a[i][j] - temp;\n        } else\n          continue;\n      }\n      sum = sum + a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 1; i <= t - 1; i++)\n        for (j = 2; j <= t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    for (i = 1; i <= 2; i++) {\n      temp = a[i][1];\n      for (j = 2; j <= 2; j++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (j = 1; j <= 2; j++)\n        a[i][j] = a[i][j] - temp;\n    }\n    for (j = 1; j <= 2; j++) {\n      temp = a[1][j];\n      for (i = 2; i <= 2; i++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (i = 1; i <= 2; i++)\n        a[i][j] = a[i][j] - temp;\n    }\n    sum = sum + a[2][2];\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "33669", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int array[1000][1000];\n  int n, i, j, k;\n\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n\n    int lenth, min, sum;\n    lenth = n - 1;\n    sum = 0;\n    while (lenth >= 1) {\n      for (i = 0; i <= lenth; i++) {\n        \n        min = 2147483647;\n        for (j = 0; j <= lenth; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j <= lenth; j++)\n          array[i][j] = array[i][j] - min;\n      }\n      for (j = 0; j <= lenth; j++) {\n        \n        min = 2147483647;\n        for (i = 0; i <= lenth; i++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (i = 0; i <= lenth; i++)\n          array[i][j] = array[i][j] - min;\n      }\n      sum = sum + array[1][1];\n      \n      for (i = 0; i <= lenth; i++)\n        for (j = 1; j < lenth; j++)\n          array[i][j] = array[i][j + 1];\n      for (j = 0; j <= lenth; j++)\n        for (i = 1; i < lenth; i++)\n          array[i][j] = array[i + 1][j];\n      lenth = lenth - 1;\n    }\n    cout << sum;\n    if (k < n)\n      cout << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33670", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0}, sum = 0;\nvoid guiling(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 2; i < n; i++)\n    a[i - 1][0] = a[i][0];\n  for (j = 2; j < n; j++)\n    a[0][j - 1] = a[0][j];\n  for (i = 2; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n}\n\nint main() {\n  int i, j, n, k, m;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    while (m > 2) {\n      guiling(m);\n      xiaojian(m);\n      m--;\n    }\n    guiling(2);\n    sum += a[1][1];\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], ni, minl[100], minh[100], i, j, k, q, sum;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ni = n; ni > 1; ni--) {\n      for (i = 0; i < ni; i++) {\n        minl[i] = a[i][0];\n        for (j = 0; j < ni; j++) {\n          if (minl[i] > a[i][j])\n            minl[i] = a[i][j];\n        }\n        for (j = 0; j < ni; j++) {\n          a[i][j] = a[i][j] - minl[i];\n        }\n      }\n      for (j = 0; j < ni; j++) {\n        minh[j] = a[0][j];\n        for (i = 0; i < ni; i++) {\n          if (minh[j] > a[i][j])\n            minh[j] = a[i][j];\n        }\n        for (i = 0; i < ni; i++) {\n          a[i][j] = a[i][j] - minh[j];\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < ni; i++) {\n        for (j = 1; j < ni - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 0; j < ni; j++) {\n        for (i = 1; i < ni - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33672", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int m = n;\n  int t = n;\n  while (m > 0) {\n    int a[100][100];\n    n = t;\n    m = m - 1;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    while (n > 1) {\n      for (int i = 0; i < n; i++) {\n        int hmin = a[i][0];\n        for (int j = 0; j < n; j++) {\n          if (a[i][j] < hmin)\n            hmin = a[i][j];\n        }\n\n        for (int j = 0; j < n; j++)\n          a[i][j] -= hmin;\n      }\n      for (int i = 0; i < n; i++) {\n        int lmin = a[0][i];\n        for (int j = 0; j < n; j++) {\n          if (a[j][i] < lmin)\n            lmin = a[j][i];\n        }\n        for (int j = 0; j < n; j++)\n          a[j][i] -= lmin;\n      }\n      sum += a[1][1];\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (int i = 0; i < n - 1; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[j][i] = a[j + 1][i];\n      n = n - 1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[1000][1000], sum = 0, p = 1, z, k, w, l, min;\n  int i, j, n;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (z = 0; z < n - 1; z++) {\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (k = 0; k < n; k++)\n          a[i][k] -= min;\n      }\n      for (i = 0; i < n; i++) {\n        min = 1000;\n        for (j = 0; j < n; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (k = 0; k < n; k++)\n          a[k][i] -= min;\n      }\n      sum += a[p][p];\n      for (l = 0; l < n; l++)\n        a[l][p] = 100000;\n      for (l = 0; l < n; l++)\n        a[p][l] = 100000;\n      p++;\n    }\n    printf(\"%d\\n\", sum);\n    p = 1;\n    sum = 0;\n    memset(a, 1000000, sizeof(a));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33674", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) < m)\n      m = *(p + i);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i) = *(p + i) - m;\n  if (k > 1)\n    f1(p + 100, n, (k - 1));\n}\nvoid f2(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i * 100) < m)\n      m = *(p + i * 100);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i * 100) = *(p + i * 100) - m;\n  if (k > 1)\n    f2(p + 1, n, (k - 1));\n}\nint main() {\n  int *p, a[100][100], n, i, j, t, m, h;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++)\n        scanf(\"%d\", &a[j][t]);\n    }\n    p = a[0];\n    h = 0;\n    for (j = n; j > 1; j--) {\n      f1(p, j, j);\n      f2(p, j, j);\n      h += a[1][1];\n      for (t = 0; t < j; t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[t][m] = a[t][m + 1];\n      }\n      for (t = 0; t < (j - 1); t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[m][t] = a[m + 1][t];\n      }\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33675", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nvoid putout(int a[1000][200], int num) {\n  for (int i = 0; i < num; i++) {\n    for (int j = 0; j < num; j++)\n      cout << setw(3) << a[i][j];\n    cout << endl;\n  }\n}\n\nvoid cut1(int a[1000][1000], int b,\n          int num) \n{\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[b][i] = min(a1[b][i], a1[b][i + 1]);\n  for (int i = 0; i < num; i++)\n    a[b][i] -= a1[b][0];\n}\n\nvoid cut2(int a[1000][1000], int b,\n          int num) \n{\n  int a1[1000][1000];\n  memcpy(a1, a, 1000 * 1000 * sizeof(int));\n  for (int i = num - 2; i >= 0; i--)\n    a1[i][b] = min(a1[i][b], a1[i + 1][b]);\n  for (int i = 0; i < num; i++)\n    a[i][b] -= a1[0][b];\n}\n\nint remain(\n    int a[1000][1000], int num,\n    int out) \n{\n  for (int i = 0; i < num; i++) \n    cut1(a, i, num);\n  for (int i = 0; i < num; i++) \n    cut2(a, i, num);\n  out = out + a[1][1];              \n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < num - 1; i++) \n    for (int j = 0; j < num - 1; j++)\n      a[j][i] = a[j][i + 1];\n  num--; \n  if (num == 1)\n    return out;\n  else\n    return remain(a, num, out);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[1000][1000]; \n    memset(a, 0, 1000 * 1000 * sizeof(int));\n    for (int i = 0; i < n; i++) \n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int p = remain(a, n, 0); \n    cout << p << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33676", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, cycle;\n  cin >> n;\n  for (cycle = 0; cycle < n; cycle++) {\n    int i, j, a[100][100] = {0}, w, sum = 0;\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n\n    w = n;\n    int min;\n\n    while (w > 1) {\n      for (i = 0; i < w; i++) {\n        min = a[i][0];\n        for (j = 0; j < w; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < w; j++)\n          a[i][j] -= min;\n      }\n\n      for (j = 0; j < w; j++) {\n        int count = 0;\n\n        for (i = 0; i < w; i++) {\n\n          if (a[i][j] == 0) {\n            count++;\n            break;\n          }\n        }\n\n        if (count == 0) {\n          min = a[0][j];\n          for (i = 0; i < w; i++) {\n            if (a[i][j] < min)\n              min = a[i][j];\n          }\n\n          for (i = 0; i < w; i++)\n            a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (j = 2; j < w; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < w; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i < w; i++) {\n        for (j = 2; j < w; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n      w--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint zhi(int num[][100], int n);\nint main() {\n  int in, i, j, k, cal[100][100] = {0};\n  cin >> in;\n  for (k = 0; k < in; k++) {\n    for (i = 0; i < in; i++)\n      for (j = 0; j < in; j++)\n        cin >> cal[i][j];\n    cout << zhi(cal, in) << endl;\n  }\n  return 0;\n}\nint zhi(int num[][100], int n) {\n  int i, j, min[100], sum = 0, temp;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min[i] = num[i][0];\n    for (j = 0; j < n; j++)\n      if (num[i][j] < min[i])\n        min[i] = num[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - min[i];\n  for (j = 0; j < n; j++) {\n    min[j] = num[0][j];\n    for (i = 0; i < n; i++)\n      if (num[i][j] < min[j])\n        min[j] = num[i][j];\n  }\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - min[j];\n  temp = num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      num[i][j] = num[i + 1][j];\n  sum = zhi(num, n - 1) + temp;\n  return sum;\n}\n"}
{"label": "18", "index": "33678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  int rmin[100], cmin[100];\n  int i, j, k, l;\n  for (i = 0; i <= n - 1; i++) {\n    rmin[i] = a[i][0];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] < rmin[i]) {\n        rmin[i] = a[i][j];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[k][l] -= rmin[k];\n  for (i = 0; i <= n - 1; i++) {\n    cmin[i] = a[0][i];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] < cmin[i]) {\n        cmin[i] = a[j][i];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++) {\n      a[l][k] -= cmin[k];\n    }\n  return 0;\n}\nint main() {\n  int n;\n  cin >> n;\n  int i = 1, sum[100] = {0}, t;\n  while (i <= n) {\n    int a[100][100];\n    int j, k, l, m, s, y;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      y = f(a, n - l + 1);\n      sum[i] += a[1][1];\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l; s++) {\n          a[m][s] = a[m + 1][s];\n        }\n      }\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l - 1; s++) {\n          a[s][m] = a[s][m + 1];\n        }\n      }\n    }\n    i++;\n  }\n  for (t = 1; t <= n; t++)\n    cout << sum[t] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "33679", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint GuiLing(int a[][101], int n, int sum) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      min = (min < a[i][j]) ? min : a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n > 2) {\n    sum = sum + a[1][1];\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n - 1; i++)\n        a[i][j - 1] = a[i][j];\n    return GuiLing(a, n - 1, sum);\n  } else\n    return sum + a[1][1];\n}\n\nint main() {\n  int n, i;\n  int a[101][101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << GuiLing(a, n, 0) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33680", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, a[100][100], b[100], c[100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    c[k] = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        b[i] = a[i][0];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[i][j])\n            b[i] = a[i][j];\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (i = 0; i < m; i++) {\n        b[i] = a[0][i];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[j][i])\n            b[i] = a[j][i];\n        for (j = 0; j < m; j++)\n          a[j][i] = a[j][i] - b[i];\n      }\n      c[k] += a[1][1];\n      for (i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (k = 0; k < n; k++)\n    printf(\"%d\\n\", c[k]);\n  return 0;\n}\n"}
{"label": "18", "index": "33681", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ma[120][120];\n  int i;\n  int j;\n  int sum[120];\n  int time;\n  int t;\n  int n;\n  int min[120];\n  scanf(\"%d \", &n);\n  for (t = 0; t <= n - 1; t++) {\n\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d \", &ma[i][j]);\n\n    sum[t] = 0;\n    for (time = n - 1; time >= 1; time--) {\n      for (i = 0; i <= time; i++) {\n        min[i] = ma[i][0];\n        for (j = 0; j <= time; j++)\n          if (min[i] > ma[i][j])\n            min[i] = ma[i][j];\n        for (j = 0; j <= time; j++)\n          ma[i][j] = ma[i][j] - min[i];\n      }\n      for (j = 0; j <= time; j++) {\n        min[j] = ma[0][j];\n        for (i = 0; i <= time; i++)\n          if (min[j] > ma[i][j])\n            min[j] = ma[i][j];\n        for (i = 0; i <= time; i++)\n          ma[i][j] = ma[i][j] - min[j];\n      }\n\n      sum[t] = sum[t] + ma[1][1];\n      if (time >= 2) {\n        for (i = 1; i <= time - 1; i++)\n          for (j = 0; j <= time; j++)\n            ma[i][j] = ma[i + 1][j];\n        for (j = 1; j <= time - 1; j++)\n          for (i = 0; i <= time; i++)\n            ma[i][j] = ma[i][j + 1];\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 2; i++)\n    cout << sum[i] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33682", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], sum = 0;\n\nint minr(int u, int n) {\n  int i, minn = a[u][1];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[u][i])\n      minn = a[u][i];\n  }\n  return minn;\n}\n\nint minc(int v, int n) {\n  int i, minn = a[1][v];\n  for (i = 1; i <= n; i++) {\n    if (minn >= a[i][v])\n      minn = a[i][v];\n  }\n  return minn;\n}\n\n\nvoid f2(int n) {\n  int u, v;\n  for (u = 2; u <= n - 1; u++) {\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u + 1][v];\n    }\n  }\n  for (v = 2; v <= n - 1; v++) {\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v + 1];\n    }\n  }\n  return;\n}\n\n\nvoid f1(int n) {\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  }\n  int u, v;\n  \n  for (u = 1; u <= n; u++) {\n    int temp = minr(u, n);\n    for (v = 1; v <= n; v++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n  \n  for (v = 1; v <= n; v++) {\n    int temp = minc(v, n);\n    for (u = 1; u <= n; u++) {\n      a[u][v] = a[u][v] - temp;\n    }\n  }\n  sum = sum + a[2][2];\n  f2(n);\n  f1(n - 1);\n}\n\nint main() {\n  int n, i, u, v;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    for (u = 1; u <= n; u++) {\n      for (v = 1; v <= n; v++) {\n        cin >> a[u][v];\n      }\n    }\n    f1(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33683", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[n][n];\n\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    int a11 = 0;\n\n    for (int p = n; p >= 2; p--) {\n\n      for (int j = 0; j < p; j++) {\n        int min = a[j][0];\n        for (int k = 1; k < p; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (int k = 0; k < p; k++)\n          a[j][k] -= min;\n      }\n\n      for (int j = 0; j < p; j++) {\n        int min = a[0][j];\n        for (int k = 1; k < p; k++) {\n          if (a[k][j] < min) {\n            min = a[k][j];\n          }\n        }\n        for (int k = 0; k < p; k++) {\n          a[k][j] -= min;\n        }\n      }\n      a11 += a[1][1];\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n\n      for (int j = 0; j < p; j++) {\n        for (int k = 1; k < p - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", a11);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint juzhen[101][101][101] = {0};\nint guiling(int m, int n) {\n  int i, j, k = n, result = 0, num[101][101] = {0}, min[101] = {0};\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      num[i][j] = juzhen[m][i][j];\n    }\n  }\n  while (k > 1) {\n    for (i = 0; i < k; i++) {\n      min[i] = 10000;\n      for (j = 0; j < k; j++) {\n        if (num[i][j] <= min[i])\n          min[i] = num[i][j];\n      }\n    }\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i][j] - min[i];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      min[j] = 10000;\n      for (i = 0; i < k; i++) {\n        if (num[i][j] <= min[j])\n          min[j] = num[i][j];\n      }\n    }\n    for (j = 0; j < k; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j] - min[j];\n      }\n    }\n    result = result + num[1][1];\n    for (i = 1; i < k - 1; i++) {\n      for (j = 0; j < k; j++) {\n        num[i][j] = num[i + 1][j];\n      }\n    }\n    for (j = 1; j < k - 1; j++) {\n      for (i = 0; i < k; i++) {\n        num[i][j] = num[i][j + 1];\n      }\n    }\n    k--;\n  }\n  return result;\n}\nint main() {\n  int i, j, k, p;\n  cin >> p;\n  for (k = 0; k < p; k++) {\n    for (i = 0; i < p; i++) {\n      for (j = 0; j < p; j++) {\n        cin >> juzhen[k][i][j];\n      }\n    }\n  }\n  for (i = 0; i < p; i++) {\n    int answer = 0;\n    answer = guiling(i, p);\n    cout << answer << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33685", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[120][120] = {0}, i, N, j, sum, k, ii, jj, all, zhong = 999;\n  cin >> n;\n  N = n;\n  all = N;\n  for (jj = 1; jj <= N; jj++) {\n    n = N;\n    sum = 0;\n    for (i = 1; i <= N; i++)\n      for (j = 1; j <= N; j++)\n        cin >> *(*(a + i - 1) + j - 1);\n    for (k = 1; k <= N - 1; k++) {\n\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n          if (*(*(a + ii) + i) <= zhong)\n            zhong = *(*(a + ii) + i);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + ii) + i) -= zhong;\n      }\n      for (ii = 0; ii <= n - 1; ii++) {\n        zhong = 999;\n\n        for (i = 0; i <= n - 1; i++) {\n\n          if (*(*(a + i) + ii) <= zhong)\n            zhong = *(*(a + i) + ii);\n        }\n        for (i = 0; i <= n - 1; i++)\n          *(*(a + i) + ii) -= zhong;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i <= n - 1; i++)\n        for (j = 0; j <= n - 1; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33686", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[100][100];\nint m, n, sum, j, min001 = 0, min002 = 0;\nint min01[101], min02[101];\nint min1(int a) {\n  for (int p = 0; p < m; p++)\n    min01[p] = juzhen[a][p];\n  sort(min01, min01 + m);\n  return min01[0];\n}\nint min2(int a) {\n  for (int p = 0; p < m; p++)\n    min02[p] = juzhen[p][a];\n  sort(min02, min02 + m);\n  return min02[0];\n}\nvoid jia(int x, int y) {\n  if (y == 1)\n    cout << sum << endl;\n  else {\n    for (j = 0; j < y; j++) {\n      min001 = min1(j);\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j][k] - min001;\n    }\n    for (j = 0; j < y; j++) {\n      min002 = min2(j);\n      for (int k = 0; k < y; k++)\n        juzhen[k][j] = juzhen[k][j] - min002;\n    }\n    sum = sum + juzhen[1][1];\n    for (j = 1; j < y - 1; j++) {\n      for (int k = 0; k < y; k++)\n        juzhen[j][k] = juzhen[j + 1][k];\n    }\n    for (j = 1; j < y; j++) {\n      for (int k = 0; k < y - 1; k++)\n        juzhen[k][j] = juzhen[k][j + 1];\n    }\n    m = m - 1;\n    jia(x, y - 1);\n  }\n}\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    m = n;\n    for (j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> juzhen[j][k];\n    }\n    jia(i, m);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  cin >> n;\n  int a[100][100];\n  int sum = 0, temp = 1;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min;\n    sum = 0;\n    temp = 1;\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      sum += a[temp][temp];\n      for (i = 0; i < n; i++)\n        a[i][temp] = -1;\n      for (j = 0; j < n; j++)\n        a[temp][j] = -1;\n      temp++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[101][101], n;\nint ans = 0;\nint findm(int x, int y);\nint findn(int x, int y);\nint main() {\n  int i, j, k;\n  int a, b, m, minm, temp[101][101];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; ++k) {\n    ans = 0;\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        cin >> array_1[i][j];\n      }\n    }\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; ++i) {\n        minm = findm(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[i][j] -= minm;\n        }\n      }\n      for (i = 0; i < m; ++i) {\n        minm = findn(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[j][i] -= minm;\n        }\n      }\n      ans += array_1[1][1];\n      memset(temp, 0, sizeof(temp));\n      a = 0;\n      b = 0;\n      for (i = 0; i < m; ++i) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < m; ++j) {\n          if (j == 1)\n            continue;\n          temp[a][b] = array_1[i][j];\n          b++;\n        }\n        a++;\n        b = 0;\n      }\n      memset(array_1, 0, sizeof(array_1));\n      for (i = 0; i < a; ++i) {\n        for (j = 0; j < a; ++j) {\n          array_1[i][j] = temp[i][j];\n        }\n      }\n      m--;\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\nint findm(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[x][i] < minn)\n      minn = array_1[x][i];\n  return minn;\n}\nint findn(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[i][x] < minn)\n      minn = array_1[i][x];\n  return minn;\n}\n"}
{"label": "18", "index": "33689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], b[100], c[100], i, j, k;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = n, l = 0;\n    while (sum > 1) {\n      for (i = 0; i < sum; i++) {\n        b[i] = a[i][0];\n        for (j = 0; j < sum; j++) {\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n        }\n        for (j = 0; j < sum; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (j = 0; j < sum; j++) {\n        c[j] = a[0][j];\n        for (i = 0; i < sum; i++) {\n          if (a[i][j] < c[j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < sum; i++)\n          a[i][j] = a[i][j] - c[j];\n      }\n      l = l + a[1][1];\n      for (i = 0; i < sum; i++) {\n        for (j = 1; j < sum - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < sum; j++) {\n        for (i = 1; i < sum - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      sum--;\n    }\n    printf(\"%d\\n\", l);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33690", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, k, l, min, sum = 0, j;\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (k = n;; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = a[0][i];\n        for (j = 0; j < k; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < k; j++)\n          a[j][i] -= min;\n      }\n      sum += a[1][1];\n      if (k == 2)\n        break;\n      for (i = 1; i <= k - 2; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j <= k - 2; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "18", "index": "33691", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum;\n  int i, j, k;\n  int a[101][101] = {0};\n  int lenth, min;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    lenth = n;\n\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n\n    for (lenth = n; lenth > 1; lenth--) {\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[j][k] != 0)\n            a[j][k] = a[j][k] - min;\n      }\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[k][j] != 0)\n            a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[2][2];\n\n      for (j = 1; j <= lenth; j++)\n        for (k = 2; k <= lenth; k++)\n          a[j][k] = a[j][k + 1];\n      for (j = 2; j <= lenth; j++)\n        for (k = 1; k <= lenth; k++)\n          a[j][k] = a[j + 1][k];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[101][101] = {0};\nint xiao(int n) {\n  int i, j, t, minh[101] = {0}, minl[101] = {0}, temp = 0;\n  if (n == 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    return a[1][1];\n  }\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      minh[i] = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < minh[i])\n          minh[i] = a[i][j];\n      }\n      for (t = 0; t < n; t++) {\n        a[i][t] -= minh[i];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      minl[i] = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < minl[i])\n          minl[i] = a[j][i];\n      }\n      for (t = 0; t < n; t++) {\n        a[t][i] -= minl[i];\n      }\n    }\n    temp = a[1][1];\n    for (i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n      a[0][i - 1] = a[0][i];\n      for (j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    return temp + xiao(n - 1);\n  }\n}\nint main() {\n  int n, k, l, m, ans[101] = {0};\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++) {\n        cin >> a[k][l];\n      }\n    }\n    ans[m] = xiao(n);\n  }\n  for (k = 1; k <= n; k++) {\n    cout << ans[k] << endl;\n  }\n  int f;\n  cin >> f;\n  return 0;\n}\n"}
{"label": "18", "index": "33693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint mat[100][100], n, sum = 0;\nint rmin(int a[][100], int x) {\n  int i, rsmall = a[x][0];\n  for (i = 0; i < n; i++) {\n    if (rsmall > a[x][i]) {\n      rsmall = a[x][i];\n    }\n  }\n  return rsmall;\n}\nint cmin(int a[][100], int y) {\n  int i, csmall = a[0][y];\n  for (i = 0; i < n; i++) {\n    if (csmall > a[i][y]) {\n      csmall = a[i][y];\n    }\n  }\n  return csmall;\n}\nvoid caculate(int mat[][100]) {\n  int i, j, rsmall, csmall;\n  for (i = 0; i < n; i++) {\n    rsmall = rmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[i][j] -= rsmall;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    csmall = cmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[j][i] -= csmall;\n    }\n  }\n}\nvoid change(int a[][100], int x) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < x; i++)\n    for (j = 1; j < x - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (i = 1; i < x - 1; i++)\n    for (j = 0; j < x - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\nint main() {\n  int m, i, j, num;\n  cin >> num;\n  for (m = 1; m <= num; m++) {\n    n = num;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++) {\n        cin >> mat[i][j];\n      }\n    while (n != 1) {\n      caculate(mat);\n      change(mat, n--);\n    }\n    cout << sum << endl;\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "33694", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum;\nint f(int n) {\n  if (n == 1)\n    return 0;\n  int i, j, min = 0, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i - 1][j] = a[i][j];\n    }\n  }\n  return sum + f(n - 1);\n}\nint main() {\n  int i, n, j, k, x, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    x = 0;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    x = f(n);\n    printf(\"%d\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33695", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110];\n  int sum = 0;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (i = 0; i < n - 1; i++) {\n      int mi = 9999999;\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[j][m] < mi)\n            mi = a[j][m];\n        for (int m = 0; m < n - i; m++)\n          a[j][m] -= mi;\n      }\n      for (j = 0; j < n - i; j++) {\n        mi = 9999999;\n        for (int m = 0; m < n - i; m++)\n          if (a[m][j] < mi)\n            mi = a[m][j];\n        for (int m = 0; m < n - i; m++)\n          a[m][j] -= mi;\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - i - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (j = 1; j < n - i - 1; j++) {\n        a[j][0] = a[j + 1][0];\n        for (int m = 1; m < n - i - 1; m++)\n          a[j][m] = a[j + 1][m + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  if (a >= b) {\n    return b;\n  } else {\n    return a;\n  }\n}\nint main() {\n  int n, i, j, t, sum, x, y, r;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int b[100][100] = {0};\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++) {\n        cin >> a[j][t];\n        b[j][t] = a[j][t];\n      }\n    }\n    for (r = 0; r < n - 1; r++) {\n      for (j = 0; j < n; j++) {\n        x = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[j][t + 1] = f(a[j][t], a[j][t + 1]);\n        }\n        x = a[j][t];\n        for (t = 0; t < n; t++) {\n          b[j][t] = b[j][t] - x;\n          a[j][t] = b[j][t];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        y = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[t + 1][j] = f(a[t][j], a[t + 1][j]);\n        }\n        y = a[t][j];\n        for (t = 0; t < n; t++) {\n          b[t][j] = b[t][j] - y;\n          a[t][j] = b[t][j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[t][j] = a[t + 1][j];\n          b[t][j] = a[t][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[j][t] = a[j][t + 1];\n          b[j][t] = a[j][t];\n        }\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33697", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nq, times, i, j, min, m;\n\n  cin >> nq;\n  const int n = nq;\n  int sum[n];\n  int a[n][n][n];\n  for (times = 0; times < n; times++)\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[times][i][j];\n  for (times = 0; times < n; times++) {\n    sum[times] = 0;\n    for (m = n; m > 1; m--)\n\n    {\n      for (i = 0; i < m; i++)\n\n      {\n        min = a[times][i][0];\n        for (j = 1; j < m; j++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (j = 0; j < m; j++)\n          a[times][i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[times][0][j];\n        for (i = 1; i < m; i++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (i = 0; i < m; i++)\n          a[times][i][j] -= min;\n      }\n      sum[times] += a[times][1][1];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n; j++)\n          a[times][i - 1][j] = a[times][i][j];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n - 1; j++)\n          a[times][j][i - 1] = a[times][j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int maze[100 + 10][100 + 10] = {0};\n\n  int i, j, k, l;\n  int n;\n  cin >> n;\n\n  for (k = 0; k < n; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &maze[i][j]);\n\n    for (l = n; l >= 2; l--) {\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + i) + j) ? min : *(*(maze + i) + j);\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) -= min;\n      }\n\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++) {\n          min = min < *(*(maze + j) + i) ? min : *(*(maze + j) + i);\n        }\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) -= min;\n      }\n      sum += *(*(maze + 1) + 1);\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) = *(*(maze + i + 1) + j);\n      }\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) = *(*(maze + j) + i + 1);\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33699", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n\n  int min = *(*(a + hang) + 1);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + hang) + i) < min)\n      min = *(*(a + hang) + i);\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = *(*(a + 1) + lie);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + i) + lie) < min)\n      min = *(*(a + i) + lie);\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + mm) + i) = *(*(a + mm) + i) - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + i) + mm) = *(*(a + i) + mm) - Minlie;\n      }\n\n      sum += *(*(a + 2) + 2);\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + ii) + i - 1) = *(*(a + ii) + i);\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + i - 1) + ii) = *(*(a + i) + ii);\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int sum = 0;\n  int l = 0;\n  int a[100][100];\n  int min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    l = 0;\n    for (i = 0; i < n - l; i++)\n      for (j = 0; j < n - l; j++)\n        cin >> a[i][j];\n    while (l < n - 1) {\n      for (i = 0; i < n - l; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - l; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1 - l; i++)\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1 - l; j++)\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j + 1];\n      l++;\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, sum, min;\n  scanf(\"%d \", &m);\n  for (i = 1; i <= m; i++)\n\n  {\n    int a[m][m];\n    for (j = 0; j < m; j++)\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    sum = 0;\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 1; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33702", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, h, l, s = 0, n1;\n  scanf(\"%d \", &n);\n  n1 = n;\n  int min1[100];\n  int min2[100];\n  int a[100][100];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    while (n != 1) {\n      for (j = 0; j < n; j++) {\n        min1[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (min1[j] > a[j][k]) {\n            min1[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min1[j];\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min2[k] = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (min2[k] > a[j][k]) {\n            min2[k] = a[j][k];\n          }\n        }\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min2[k];\n        }\n      }\n      s = s + a[1][1];\n      for (m = 2; m < n; m++) {\n        a[0][m - 1] = a[0][m];\n        a[m - 1][0] = a[m][0];\n      }\n      for (h = 2; h < n; h++) {\n        for (l = 2; l < n; l++) {\n          a[h - 1][l - 1] = a[h][l];\n        }\n      }\n      n--;\n    }\n    cout << s << \"\\n\";\n    s = 0;\n    n = n1;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33703", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int f(int a[100][100], int n);\n  int n, a[100][100], i, j, k, s;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    s = f(a, n);\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n\nint f(int a[100][100], int n) {\n  int i, j, k, min[100], s = 0;\n  for (i = 0; i < n; i++) {\n    min[i] = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j];\n    }\n  }\n  if (n == 2) {\n    s = a[1][1];\n  } else {\n    k = a[1][1];\n    for (j = 1; j < n - 1; j++)\n      a[0][j] = a[0][j + 1];\n    for (i = 1; i < n - 1; i++)\n      a[i][0] = a[i + 1][0];\n    for (i = 1; i < n - 1; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i + 1][j + 1];\n    s = k + f(a, n - 1);\n  }\n  return s;\n}\n"}
{"label": "18", "index": "33704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, h, min, min1, k = 0;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    sum = 0;\n    k = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    while (k < n - 1) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n\n        for (j = 0; j < n - k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < n - k; i++) {\n        min1 = a[0][i];\n        for (j = 0; j < n - k; j++) {\n          if (a[j][i] < min1)\n            min1 = a[j][i];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[j][i] -= min1;\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < n - k; i++)\n        for (j = 0; j < n - k; j++) {\n          if (j >= 2 && i < 2)\n            a[i][j - 1] = a[i][j];\n          else if (i >= 2 && j < 2)\n            a[i - 1][j] = a[i][j];\n          else if (i >= 2 && j >= 2)\n            a[i - 1][j - 1] = a[i][j];\n        }\n      k++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33705", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int w[100][100];\n  cin >> n;\n  for (int nn = 0; nn < n; nn++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &w[i][j]);\n    int s = 0;\n    for (int t = 0; t < n - 1; t++) {\n      for (int i = 0; i < n; i++)\n        if ((!i) || (i - t > 0)) {\n          int m = w[i][0];\n          for (int j = t + 1; j < n; j++)\n            m = min(m, w[i][j]);\n          w[i][0] -= m;\n          for (int j = t + 1; j < n; j++)\n            w[i][j] -= m;\n        }\n      for (int j = 0; j < n; j++)\n        if ((!j) || (j - t > 0)) {\n          int m = w[0][j];\n          for (int i = t + 1; i < n; i++)\n            m = min(m, w[i][j]);\n          w[0][j] -= m;\n          for (int i = t + 1; i < n; i++)\n            w[i][j] -= m;\n        }\n      s += w[t + 1][t + 1];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33706", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, min, s, t;\n  cin >> n;\n  int a[n][n];\n  for (int k = 0; k < n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 1; j < t; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < t; i++) {\n        min = a[0][i];\n        for (j = 1; j < t; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] -= min;\n      }\n      s += a[1][1];\n      if (t > 2) {\n        for (i = 1; i < t - 1; i++) {\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        }\n        for (i = 1; i < t - 1; i++)\n          for (j = 1; j < t - 1; j++)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int maze[100 + 10][100 + 10] = {0};\n\n  int i, j, k, l;\n  int n;\n  scanf(\"%d \", &n);\n\n  for (k = 0; k < n; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> maze[i][j];\n\n    for (l = n; l >= 2; l--) {\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + i) + j) ? min : *(*(maze + i) + j);\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) -= min;\n      }\n\n      for (i = 0; i < l; i++) {\n        int min = 1000000;\n        for (j = 0; j < l; j++)\n          min = min < *(*(maze + j) + i) ? min : *(*(maze + j) + i);\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) -= min;\n      }\n      sum += *(*(maze + 1) + 1);\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + i) + j) = *(*(maze + i + 1) + j);\n      }\n      for (i = 1; i < l - 1; i++) {\n        for (j = 0; j < l; j++)\n          *(*(maze + j) + i) = *(*(maze + j) + i + 1);\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int n);\nint a[100][100];\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int change(int a[100][100], int);\n  int n, a[100][100], i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    printf(\"%d\\n\", change(a, n));\n  }\n  return 0;\n}\nint change(int a[100][100], int n) {\n  int i, j, s, b[100][100], f;\n  for (i = 0; i < n; i++) {\n    s = a[i][0];\n    for (j = 0; j < n; j++)\n      s = (s > a[i][j]) ? a[i][j] : s;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < n; i++) {\n    s = a[0][i];\n    for (j = 0; j < n; j++) {\n      s = (s > a[j][i]) ? a[j][i] : s;\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  f = a[1][1];\n  if (n > 2) {\n    b[0][0] = a[0][0];\n    for (i = 2; i < n; i++) {\n      b[0][i - 1] = a[0][i];\n      b[i - 1][0] = a[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        b[i - 1][j - 1] = a[i][j];\n    f = f + change(b, n - 1);\n  }\n  return f;\n}\n"}
{"label": "18", "index": "33710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint row(int a[][100], int l, int m) {\n  int i, min = a[m][0];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[m][i])\n      min = a[m][i];\n  return min;\n}\nint line(int a[][100], int l, int m) {\n  int i, min = a[0][m];\n  for (i = 0; i < l + 1; i++)\n    if (min > a[i][m])\n      min = a[i][m];\n  return min;\n}\nvoid move(int a[][100], int l) {\n  int i, j;\n  for (i = 1; i < l + 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < l + 1; i++)\n    for (j = 1; j < l + 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int i, j, k, n;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    int l, a[100][100] = {0}, sum = 0, x, y;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = n - 1; l >= 0; l--) {\n      for (x = 0; x < l + 1; x++) {\n        int d = row(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[x][y] = a[x][y] - d;\n      }\n      for (x = 0; x < l + 1; x++) {\n        int e = line(a, l, x);\n        for (y = 0; y < l + 1; y++)\n          a[y][x] = a[y][x] - e;\n      }\n      sum += a[1][1];\n      move(a, l);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33711", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid xiao(int a[100][100], int n) {\n  int min, i, j;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] = a[i][j] - min;\n  }\n}\nvoid move(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (j = 0; j < n; j++)\n    for (i = 2; i < n; i++)\n      a[i - 1][j] = a[i][j];\n}\n\nint count(int a[100][100], int n, int s) {\n  if (n == 1)\n    return (s);\n  else {\n    xiao(a, n);\n    s = s + a[1][1];\n    move(a, n);\n    return (count(a, n - 1, s));\n  }\n}\nint main() {\n  int n, i, j, s, t, a[100][100];\n  cin >> n;\n  t = n;\n  while (t > 0) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    cout << count(a, n, s) << \"\\n\";\n    t--;\n  }\n}\n"}
{"label": "18", "index": "33712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[101][101][101];\nint countsum;\nvoid cal(int rank, int num) {\n  if (rank != 1) {\n\n    int rowmin[rank];\n    int columnmin[rank];\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          rowmin[i] = matrix[num][i][j];\n        else\n          rowmin[i] = min(rowmin[i], matrix[num][i][j]);\n      }\n      if (rowmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][i][j] = matrix[num][i][j] - rowmin[i];\n    }\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          columnmin[i] = matrix[num][j][i];\n        else\n          columnmin[i] = min(columnmin[i], matrix[num][j][i]);\n      }\n      if (columnmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][j][i] = matrix[num][j][i] - columnmin[i];\n    }\n    countsum += matrix[num][1][1];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][j][i - 1] = matrix[num][j][i];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][i - 1][j] = matrix[num][i][j];\n    cal(rank - 1, num);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= n - 1; ++i)\n    for (int j = 0; j <= n - 1; ++j)\n      for (int k = 0; k <= n - 1; ++k)\n        cin >> matrix[i][j][k];\n  for (int i = 0; i <= n - 1; ++i) {\n    countsum = 0;\n    cal(n, i);\n    cout << countsum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (i = 1; i <= n; i++) {\n    int shuzu[100][100] = {0}, sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> shuzu[j][k];\n    int min = 99999, count = 1;\n    for (count = 1; count < n; count++) {\n      for (j = 0; j < n; j++) \n      {\n        for (k = 0; k < n; k++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      sum = sum + shuzu[count][count];\n\n      for (j = 0; j < n; j++) {\n        shuzu[j][count] = 99999;\n      } \n      for (k = 0; k < n; k++) {\n        shuzu[count][k] = 99999;\n      }\n      shuzu[count][count] = 9999;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33714", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint smaller(int a, int b) {\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Sum(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      min = smaller(min, a[i][j]);\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (int i = 0; i < n; i++)\n      min = smaller(min, a[i][j]);\n    for (int i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    cout << Sum(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0};\nint n;\nint count1 = 0;\nint (*p)[100] = NULL;\nint deal();\nint main() {\n  int i, j, k;\n  cin >> n;\n  p = a;\n  for (k = 0; k < n; k++) {\n    count1 = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    deal();\n  }\n  return 0;\n}\nint deal() {\n  int min;\n  int i, j, k;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < n; i++) {\n      min = *(*(p + i));\n      for (j = 0; j < n; j++) {\n        if (*(*(p + i) + j) < min)\n          min = *(*(p + i) + j);\n      }\n\n      for (j = 0; j < n; j++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      for (i = 0; i < n; i++)\n        if (*(*(p + i) + j) < min)\n          min = *(*(p + i) + j);\n\n      for (i = 0; i < n; i++)\n        *(*(p + i) + j) = *(*(p + i) + j) - min;\n    }\n    count1 += *(*(p + 1) + 1);\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++) {\n        *(*(p + i) + j) = *(*(p + i + 1) + j);\n      }\n    for (j = 1; j < n - 1; j++)\n      for (i = 0; i < n; i++) {\n        *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n  }\n  cout << count1 << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200];\n  scanf(\"%d \", &n);\n\n  for (i = 0; i <= 199; i++)\n    for (j = 0; j <= 199; j++)\n      num[i][j] = 0;\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        cin >> num[j][k];\n\n    cout << del(num, n) << endl;\n  }\n  return 0;\n}\n\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 9999;\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min)\n        min = num[j][i];\n    }\n    for (i = 0; i <= n - 1; i++)\n      num[j][i] = num[j][i] - min;\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 9999;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n\n    for (i = 0; i <= n - 1; i++)\n      num[i][j] = num[i][j] - min;\n  }\n  sum = sum + num[1][1];\n\n  if (n == 2)\n    return sum;\n\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33717", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int j, k, l, x, a[100][100], c[100][100], temp;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    int sum = 0;\n    for (l = n - 1; l >= 1; l--) {\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (j = 0; j <= l; j++)\n        for (x = 0; x <= l - 1; x++)\n          for (k = 0; k <= l - 1 - x; k++) {\n            if (c[j][k] > c[j][k + 1]) {\n              temp = c[j][k];\n              c[j][k] = c[j][k + 1];\n              c[j][k + 1] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[j][0];\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (k = 0; k <= l; k++)\n        for (x = 0; x <= l - 1; x++)\n          for (j = 0; j <= l - 1 - x; j++) {\n            if (c[j][k] > c[j + 1][k]) {\n              temp = c[j][k];\n              c[j][k] = c[j + 1][k];\n              c[j + 1][k] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[0][k];\n      sum += a[1][1];\n      for (j = 2; j <= l; j++)\n        for (k = 2; k <= l; k++)\n          a[j - 1][k - 1] = a[j][k];\n      for (k = 2; k <= l; k++)\n        a[0][k - 1] = a[0][k];\n      for (j = 2; j <= l; j++)\n        a[j - 1][0] = a[j][0];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int w[100][100];\n  cin >> n;\n  for (int nn = 0; nn < n; nn++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    int s = 0;\n    for (int t = 0; t < n - 1; t++) {\n      for (int i = 0; i < n; i++)\n        if ((!i) || (i - t > 0)) {\n          int m = w[i][0];\n          for (int j = t + 1; j < n; j++)\n            m = min(m, w[i][j]);\n          w[i][0] -= m;\n          for (int j = t + 1; j < n; j++)\n            w[i][j] -= m;\n        }\n      for (int j = 0; j < n; j++)\n        if ((!j) || (j - t > 0)) {\n          int m = w[0][j];\n          for (int i = t + 1; i < n; i++)\n            m = min(m, w[i][j]);\n          w[0][j] -= m;\n          for (int i = t + 1; i < n; i++)\n            w[i][j] -= m;\n        }\n      s += w[t + 1][t + 1];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1000][1000] = {0};\nint sum(int n) {\n  int i, j, x, t;\n  int p, q;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + i) + j))\n        x = *(*(a + i) + j);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + i) + j)) -= x;\n  }\n  for (i = 0; i < n; i++) {\n    x = 32767;\n    for (j = 0; j < n; j++)\n      if (x > *(*(a + j) + i))\n        x = *(*(a + j) + i);\n    if (x != 0)\n      for (j = 0; j < n; j++)\n        (*(*(a + j) + i)) -= x;\n  }\n  t = *(*(a + 1) + 1);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n  return (t + sum(n - 1));\n}\nint main() {\n  int n, i, p, q;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        scanf(\"%d\", &a[p][q]);\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum, min, i, j, p, k, (*q)[100];\n  q = a;\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(q + i) + j);\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + i) + j);\n          else {\n            if (*(*(q + i) + j) < min)\n              min = *(*(q + i) + j);\n          }\n        }\n        for (j = 0; j < k; j++) {\n          *(*(q + i) + j) = *(*(q + i) + j) - min;\n        }\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < k; j++) {\n          if (j == 0)\n            min = *(*(q + j) + i);\n          else {\n            if (*(*(q + j) + i) < min)\n              min = *(*(q + j) + i);\n          }\n        }\n        for (j = 0; j < k; j++) {\n          *(*(q + j) + i) = *(*(q + j) + i) - min;\n        }\n      }\n      sum += *(*(q + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + 0) + i) = *(*(q + 0) + i + 1);\n      }\n      for (i = 1; i < k - 1; i++) {\n        *(*(q + i) + 0) = *(*(q + i + 1) + 0);\n      }\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++) {\n          *(*(q + i) + j) = *(*(q + i + 1) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zero(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 1; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid trans(int a[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, k, a[100][100], i, j, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      zero(a, k);\n      sum += a[1][1];\n      trans(a, k);\n      k--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int sum = 0, s[100][100], i, t, j, m, n, k, min;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &s[j][k]);\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[k][0];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[k][t] < min)\n              min = s[k][t];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[k][t] -= min;\n          }\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[0][k];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[t][k] < min)\n              min = s[t][k];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[t][k] -= min;\n          }\n        }\n      }\n      sum += s[j][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33723", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nn, n, i, j, k, min[100], maze[100][100], sum;\n  scanf(\"%d \", &nn);\n  for (k = 0; k < nn; k++) {\n    sum = 0;\n    n = nn;\n    for (i = 0; i < nn; i++)\n      for (j = 0; j < nn; j++)\n        cin >> maze[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min[i] = maze[i][0];\n        for (j = 1; j < n; j++)\n          min[i] = min[i] < maze[i][j] ? min[i] : maze[i][j];\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          maze[i][j] -= min[i];\n        }\n      for (j = 0; j < n; j++) {\n        min[j] = maze[0][j];\n        for (i = 1; i < n; i++)\n          min[j] = min[j] < maze[i][j] ? min[j] : maze[i][j];\n      }\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++)\n          maze[i][j] -= min[j];\n      sum += maze[1][1];\n      for (i = 1; i < n - 1; i++)\n        maze[i][0] = maze[i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        maze[0][j] = maze[0][j + 1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++) {\n          maze[i][j] = maze[i + 1][j + 1];\n        }\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33724", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint zhi(int num[][100], int n);\nint main() {\n  int in, i, j, k, cal[100][100] = {0};\n  scanf(\"%d \", &in);\n  for (k = 0; k < in; k++) {\n    for (i = 0; i < in; i++)\n      for (j = 0; j < in; j++)\n        scanf(\"%d \", &cal[i][j]);\n    cout << zhi(cal, in) << endl;\n  }\n  return 0;\n}\nint zhi(int num[][100], int n) {\n  int i, j, min[100], sum = 0, temp;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min[i] = num[i][0];\n    for (j = 0; j < n; j++)\n      if (num[i][j] < min[i])\n        min[i] = num[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - min[i];\n  for (j = 0; j < n; j++) {\n    min[j] = num[0][j];\n    for (i = 0; i < n; i++)\n      if (num[i][j] < min[j])\n        min[j] = num[i][j];\n  }\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - min[j];\n  temp = num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      num[i][j] = num[i + 1][j];\n  sum = zhi(num, n - 1) + temp;\n  return sum;\n}\n"}
{"label": "18", "index": "33725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, minrow, mincol, sum;\n  int p[100][100];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    t = n;\n    for (i = 0; i < t; i++) {\n      for (j = 0; j < t; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (t != 1) {\n      for (i = 0; i < t; i++) {\n        minrow = 100000;\n        for (j = 0; j < t; j++) {\n          if (*(*(p + i) + j) < minrow) {\n            minrow = *(*(p + i) + j);\n          }\n        }\n        for (j = 0; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - minrow;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        mincol = 100000;\n        for (i = 0; i < t; i++) {\n          if (*(*(p + i) + j) < mincol) {\n            mincol = *(*(p + i) + j);\n          }\n        }\n        for (i = 0; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - mincol;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 0; i < t; i++) {\n        for (j = 1; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (j = 0; j < t; j++) {\n        for (i = 1; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      t--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int s, i, j;\n  for (s = 1; s <= n; s++) {\n    int b = n, yi = 0, min = 10000;\n    int a[110][110] = {0};\n    int c = 2;\n    int bi[110] = {0}, bj[110] = {0};\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (b = n; b >= 2; b--) {\n      for (i = 1; i <= n; i++) {\n        if (bi[i] == 1)\n          continue;\n        for (j = 1; j <= n; j++) {\n          if ((bj[j] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 1; j <= n; j++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (bj[j] == 1)\n          continue;\n        for (i = 1; i <= n; i++) {\n          if ((bi[i] == 0) && (a[i][j] <= min))\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (i = 1; i <= n; i++) {\n            a[i][j] = a[i][j] - min;\n          }\n        }\n        min = 100000;\n      }\n      yi = yi + a[c][c];\n      bi[c] = 1;\n      bj[c] = 1;\n      min = 10000;\n      c++;\n    }\n    cout << yi << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n = 0;\nint juzhen[101][101] = {0}, sum = 0, hang = 0;\nvoid hangxiao();\nvoid liexiao();\nvoid xiaojian();\nvoid hangxiao() {\n  int i, j, xiao = 1000;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (j = 0; j < hang; j++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid liexiao() {\n  int i, j, xiao = 1000;\n  for (j = 0; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid xiaojian() {\n  int i, j, xiao = 0;\n  for (i = 2; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      juzhen[i - 1][j] = juzhen[i][j];\n    }\n  }\n  for (j = 2; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j - 1] = juzhen[i][j];\n    }\n  }\n}\n\nint main() {\n  int a;\n  cin >> a;\n  n = a;\n\n  while (a > 0) {\n    memset(juzhen, 0, sizeof(juzhen));\n    sum = 0;\n    int b, c, d, e, i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    hang = n;\n    while (hang > 1) {\n      hangxiao();\n      liexiao();\n      sum += juzhen[1][1];\n      xiaojian();\n      hang--;\n    }\n    cout << sum << endl;\n    a--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint a[100][100] = {0};\nvoid temp(int n) {\n  if (n == 1)\n    return;\n  for (int i = 0; i < n; i++) {\n    int miner = 1000;\n    for (int j = 0; j < n; j++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - miner;\n  }\n  for (int j = 0; j < n; j++) {\n    int miner = 1000;\n    for (int i = 0; i < n; i++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int i = 0; i < n; i++)\n      a[i][j] = a[i][j] - miner;\n  }\n  sum = sum + a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  temp(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int m = 0; m < n; m++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    temp(n);\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33729", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, s = 0;\n  int a[200][200];\n  int(*p)[200] = a;\n  cin >> n;\n  m = n;\n  for (int q = 0; q < m; q++) {\n    s = 0;\n    n = m;\n    for (int i = 0; i < m; i++) {\n      for (int j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    }\n    for (int w = 0; w < m - 1; w++) {\n      for (int i = 0; i < n; i++) {\n        int l = *(*(p + i));\n        for (int j = 0; j < n; j++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      for (int j = 0; j < n; j++) {\n        int l = *(*(p) + j);\n        for (int i = 0; i < n; i++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      s = s + *(*(p + 1) + 1);\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n - 1; i++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      n--;\n    }\n    cout << s << endl;\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "33730", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100][100];\nint main() {\n  int n, i, j, k, sum[100] = {0}, l, min;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = n;\n    while (l > 1) {\n      for (j = 0; j < l; j++) {\n        min = 100000;\n        for (k = 0; k < l; k++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[i][j][k] -= min;\n      }\n      for (k = 0; k < l; k++) {\n        min = 100000;\n        for (j = 0; j < l; j++) {\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        }\n        for (j = 0; j < l; j++)\n          a[i][j][k] -= min;\n      }\n      sum[i] += a[i][1][1];\n      for (j = 2; j < l; j++)\n        for (k = 0; k < l; k++)\n          a[i][j - 1][k] = a[i][j][k];\n      for (k = 2; k < l; k++)\n        for (j = 0; j < l; j++)\n          a[i][j][k - 1] = a[i][j][k];\n      l--;\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[200][200];\nint minhang(int hang, int geshu) {\n  int i;\n\n  int min = *(*(a + hang) + 1);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + hang) + i) < min)\n      min = *(*(a + hang) + i);\n  }\n  return min;\n}\nint minlie(int lie, int geshu) {\n  int i;\n  int min = *(*(a + 1) + lie);\n  for (i = 1; i <= geshu; i++) {\n    if (*(*(a + i) + lie) < min)\n      min = *(*(a + i) + lie);\n  }\n  return min;\n}\nint main() {\n\n  int n, x, i, j;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n\n    memset(a, 0, sizeof a);\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    }\n    int sum = 0;\n    for (int m = 0; m < n - 1; m++) {\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minhang = minhang(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + mm) + i) = *(*(a + mm) + i) - Minhang;\n      }\n      for (int mm = 1; mm <= n - m; mm++) {\n        int Minlie = minlie(mm, n - m);\n        for (i = 1; i <= n - m; i++)\n          *(*(a + i) + mm) = *(*(a + i) + mm) - Minlie;\n      }\n\n      sum += *(*(a + 2) + 2);\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + ii) + i - 1) = *(*(a + ii) + i);\n      }\n      for (int ii = 1; ii <= n - m; ii++) {\n        for (i = 3; i <= n - m; i++)\n          *(*(a + i - 1) + ii) = *(*(a + i) + ii);\n      }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33732", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, l, m, n, x, y, min, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (x = 0; x < n; x++) {\n      for (y = 0; y < n; y++) {\n        scanf(\"%d\", &a[x][y]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      for (x = 0; x < j; x++) {\n        min = a[x][0];\n        for (y = 1; y < j; y++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (y = 0; y < j; y++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (y = 0; y < j; y++) {\n        min = a[0][y];\n        for (x = 1; x < j; x++) {\n          if (a[x][y] < min) {\n            min = a[x][y];\n          }\n        }\n        for (x = 0; x < j; x++) {\n          a[x][y] = a[x][y] - min;\n        }\n      }\n      for (k = 2; k < j; k++) {\n        a[0][k - 1] = a[0][k];\n      }\n      for (k = 2; k < j; k++) {\n        a[k - 1][0] = a[k][0];\n      }\n      sum = sum + a[1][1];\n      for (x = 2; x < j; x++) {\n        for (y = 2; y < j; y++) {\n          a[x - 1][y - 1] = a[x][y];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33733", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int k;\n  for (k = 0; k < n; k++) {\n    int i, j, l;\n    int a[100][100];\n    int s[100];\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n\n    for (l = 0; l < n - 1; l++) {\n      int minh[100] = {0};\n      for (i = 0; i < n; i++) {\n\n        if (a[i][0] >= 0) {\n          minh[i] = a[i][0];\n          for (j = 0; j < n; j++) {\n            if (a[i][j] < minh[i] && a[i][j] >= 0)\n              minh[i] = a[i][j];\n          }\n          for (j = 0; j < n; j++) {\n            a[i][j] = a[i][j] - minh[i];\n          }\n        }\n      }\n      int minl[100] = {0};\n      for (i = 0; i < n; i++) {\n        if (a[0][i] >= 0)\n\n        {\n          minl[i] = a[0][i];\n          for (j = 0; j < n; j++) {\n            if (a[j][i] < minl[i] && a[i][j] >= 0)\n              minl[i] = a[j][i];\n          }\n          for (j = 0; j < n; j++)\n            a[j][i] = a[j][i] - minl[i];\n        }\n      }\n      s[l] = a[l + 1][l + 1];\n\n      for (i = 0; i < n; i++) {\n        a[l + 1][i] = -1;\n        a[i][l + 1] = -1;\n      }\n    }\n    int sum = 0;\n    for (i = 0; i < n - 1; i++) {\n      sum = sum + s[i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33734", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int p, n, j, k, min, sum;\n  cin >> p;\n  int a[100][100];\n  n = p;\n  for (int i = 0; i < p; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    do {\n\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] -= min;\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++)\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      for (j = 1; j < n; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      n--;\n    } while (n > 1);\n    cout << sum << endl;\n    n = p;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33735", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, m, h, l, s = 0, n1;\n  cin >> n; \n  n1 = n;   \n  int min1[100];\n  int min2[100];   \n  int a[100][100]; \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      } \n    }\n    while (n != 1) \n    {\n      for (j = 0; j < n; j++) {\n        min1[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (min1[j] > a[j][k]) {\n            min1[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min1[j];\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min2[k] = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (min2[k] > a[j][k]) {\n            min2[k] = a[j][k];\n          }\n        }\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min2[k];\n        } \n      }\n      s = s + a[1][1]; \n      for (m = 2; m < n; m++) {\n        a[0][m - 1] = a[0][m];\n        a[m - 1][0] = a[m][0];\n      }\n      for (h = 2; h < n; h++) {\n        for (l = 2; l < n; l++) {\n          a[h - 1][l - 1] = a[h][l];\n        }\n      }    \n      n--; \n    }\n    cout << s << endl; \n    s = 0;\n    n = n1; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, sum;\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int f(int a[100][100], int n);\n    sum = f(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint f(int a[100][100], int n) {\n  if (n == 1)\n    return 0;\n  int i, j, k, min, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  k = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  }\n  for (j = 2; j < n; j++) {\n    for (i = 0; i < (n - 1); i++)\n      a[i][j - 1] = a[i][j];\n  }\n  n = n - 1;\n  sum = k + f(a, n);\n  return (sum);\n}\n"}
{"label": "18", "index": "33737", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, s = 0, d = 0, j = 0, i1 = 0, j1 = 0, k = 0, a = 0, sum = 0;\n  scanf(\"%d \", &n);\n  int shu[n][n];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    d = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &shu[i][j]);\n    for (s = 1; s <= n - 1; s++) {\n      for (i = 0; i < n - d; i++) {\n        a = 100000;\n        for (j = 0; j < n - d; j++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (j = 0; j < n - d; j++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      for (j = 0; j < n - d; j++) {\n        a = 100000;\n        for (i = 0; i < n - d; i++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (i = 0; i < n - d; i++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      sum = sum + shu[1][1];\n      d++;\n      for (i = 0; i < n - d; i++) {\n        for (j = 0; j < n - d; j++) {\n          if (j > 0)\n            j1 = j + 1;\n          else\n            j1 = j;\n          if (i > 0)\n            i1 = i + 1;\n          else\n            i1 = i;\n          shu[i][j] = shu[i1][j1];\n        }\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[200][200];\n  int n = 0, i, j, k, q = 0, l, m, s = 0;\n  cin >> n;\n  k = n;\n  while (q < k) {\n    s = 0;\n    for (i = 0; i < k; i++) {\n      for (j = 0; j < k; j++)\n        cin >> a[i][j];\n    }\n    n = k;\n    for (m = 1; m <= k - 1; m++) {\n      for (i = 0; i < n; i++) {\n        l = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (l > a[i][j])\n            l = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - l;\n      }\n      for (i = 0; i < n; i++) {\n        l = a[0][i];\n        for (j = 0; j < n; j++) {\n          if (l > a[j][i])\n            l = a[j][i];\n        }\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - l;\n      }\n      s = a[1][1] + s;\n\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (i = 1; i < n - 1; i++) {\n        for (j = 0; j < n - 1; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << s << endl;\n    q++;\n  }\n\n  return (0);\n}\n"}
{"label": "18", "index": "33739", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, d, c, s, t, min1, min2;\n  scanf(\"%d \", &n);\n  int a[n][n][n], b[n][n];\n  for (i = 0; i < n; i++) {\n    int h = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min1 = a[i][j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min1 > a[i][j][k])\n            min1 = a[i][j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[i][j][k] = a[i][j][k] - min1;\n      }\n      for (d = 0; d < n - l; d++) {\n        min2 = a[i][0][d];\n        for (c = 1; c < n - l; c++) {\n          if (min2 > a[i][c][d]) {\n            min2 = a[i][c][d];\n          }\n        }\n        for (c = 0; c < n - l; c++)\n          a[i][c][d] = a[i][c][d] - min2;\n      }\n      b[i][l] = a[i][1][1];\n      for (s = 1; s < n - 1 - l; s++)\n        for (t = 0; t < n - l; t++)\n          a[i][s][t] = a[i][s + 1][t];\n      for (t = 1; t < n - l - 1; t++)\n        for (s = 0; s < n - l - 1; s++)\n          a[i][s][t] = a[i][s][t + 1];\n    }\n    for (l = 0; l < n - 1; l++)\n      h = h + b[i][l];\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33740", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint Matrix(int a[][100], int sum, int n);\n\nint main() {\n  int a[100][100];\n  int n, i, j, k, sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    Matrix(a, sum, n);\n  }\n  return 0;\n}\n\nint Matrix(int a[][100], int sum, int n) {\n  int i, j, min;\n  if (n == 1) {\n    printf(\"%d\\n\", sum);\n    return 0;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      a[j - 1][i] = a[j][i];\n  Matrix(a, sum, n - 1);\n  return 0;\n}\n"}
{"label": "18", "index": "33741", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int a[100][100] = {0}, rmin[100] = {0}, cmin[100] = {0}, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n      cmin[i] = a[0][i];\n      rmin[i] = a[i][0];\n    }\n    for (int k = 0; k < n - 1; k++) {\n      for (int i = 0; i < n - k; i++) {\n        cmin[i] = a[0][i];\n        rmin[i] = a[i][0];\n      }\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (rmin[i] > a[i][j])\n            rmin[i] = a[i][j];\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[i][j] -= rmin[i];\n        }\n      }\n\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (cmin[i] > a[j][i]) {\n            cmin[i] = a[j][i];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[j][i] -= cmin[i];\n        }\n      }\n      sum += a[1][1];\n      for (int i = 2; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (int j = 2; j < n - k; j++) {\n        for (int i = 0; i < n - k; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33742", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int sum) {\n  int i, j, min1, min2;\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  } else {\n\n    for (i = 0; i < n; i++) {\n      min1 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min1 > a[i][j])\n          min1 = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min1;\n    }\n\n    for (i = 0; i < n; i++) {\n      min2 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min2 > a[j][i])\n          min2 = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min2;\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n    change(a, n - 1, sum);\n  }\n}\nint main() {\n  int n, a[100][100], i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    change(a, n, sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33743", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, a[100][100][100];\n\nint main() {\n  int sum[100] = {0}, t, x, min;\n  scanf(\"%d \", &n);\n  t = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  for (x = 0; x < n; x++) {\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[x][i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (j = 0; j < n; j++) {\n          a[x][i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[x][0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[x][i][j])\n            min = a[x][i][j];\n        for (i = 0; i < n; i++) {\n          a[x][i][j] -= min;\n        }\n      }\n      sum[x] += a[x][1][1];\n      for (i = 1; i < n - 1; i++)\n        a[x][i][0] = a[x][i + 1][0];\n      for (j = 1; j < n - 1; j++)\n        a[x][0][j] = a[x][0][j + 1];\n      for (i = 1; i < n - 1; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[x][i][j] = a[x][i + 1][j + 1];\n      }\n      n--;\n    }\n    n = t;\n  }\n  for (i = 0; i < t; i++)\n    cout << sum[i] << endl;\n\n  return 0;\n}\n"}
{"label": "18", "index": "33744", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100][2];\n  for (int p = 1; p <= n; p++) {\n    int sum = 0;\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j][1];\n        a[i][j][0] = 1;\n      }\n    }\n    for (int q = 1; q <= n - 1; q++) {\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[i][0][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          if (a[i][j][1] < min) {\n            min = a[i][j][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[i][j][0] == 0)\n            continue;\n          a[i][j][1] -= min;\n        }\n      }\n      for (int i = 0; i <= n - 1; i++) {\n        int min = a[0][i][1];\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          if (a[j][i][1] < min) {\n            min = a[j][i][1];\n          }\n        }\n        for (int j = 0; j <= n - 1; j++) {\n          if (a[j][i][0] == 0)\n            continue;\n          a[j][i][1] -= min;\n        }\n      }\n      sum += a[q][q][1];\n      for (int i = 0; i <= n - 1; i++) {\n        a[q][i][0] = 0;\n        a[i][q][0] = 0;\n      }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int num;\n  cin >> num;\n  int n = num, numcas = num;\n\n  int a[301][301];\n  while (num--) {\n    int s = 0;\n    memset(a, 0, sizeof(a));\n    for (int i = 0; i < numcas; i++)\n      for (int j = 0; j < numcas; j++) {\n        cin >> a[i][j];\n      }\n\n    n = numcas;\n    while (1) {\n\n      if (n == 0) {\n        cout << s << endl;\n        break;\n      }\n\n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int i = 0; i < n; i++)\n          a[j][i] -= min;\n      }\n      \n      for (int j = 0; j < n; j++) {\n        int min = 1000000;\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n\n      s += a[1][1];\n\n      for (int j = 0; j < n; j++)\n        for (int i = 1; i < n; i++) {\n          a[j][i] = a[j][i + 1];\n        }\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      n--;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33746", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint zhi(int num[][100], int n);\nint main() {\n  int in, i, j, k, cal[100][100] = {0};\n  scanf(\"%d \", &in);\n  for (k = 0; k < in; k++) {\n    for (i = 0; i < in; i++)\n      for (j = 0; j < in; j++)\n        scanf(\"%d \", &cal[i][j]);\n    cout << zhi(cal, in) << endl;\n  }\n  return 0;\n}\nint zhi(int num[][100], int n) {\n  int i, j, min[100], sum = 0, temp;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min[i] = num[i][0];\n    for (j = 0; j < n; j++)\n      if (num[i][j] < min[i])\n        min[i] = num[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - min[i];\n  for (j = 0; j < n; j++) {\n    min[j] = num[0][j];\n    for (i = 0; i < n; i++)\n      if (num[i][j] < min[j])\n        min[j] = num[i][j];\n  }\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++) {\n      num[i][j] = num[i][j] - min[j];\n    }\n  temp = num[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      num[i][j] = num[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      num[i][j] = num[i + 1][j];\n  sum = zhi(num, n - 1) + temp;\n  return sum;\n}\n"}
{"label": "18", "index": "33747", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, z, sum, min;\n  int a[105][105];\n  scanf(\"%d \", &n);\n  for (int z = 0; z < n; z++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n - k; j++) {\n          *(*(a + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < n - k; i++) {\n        min = 100000000;\n        for (j = 0; j < n - k; j++)\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        for (j = 0; j < n - k; j++)\n          *(*(a + j) + i) -= min;\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 0; i < n - k; i++)\n        for (j = 2; j < n - k; j++)\n          *(*(a + i) + j - 1) = *(*(a + i) + j);\n      for (j = 0; j < n - k - 1; j++)\n        for (i = 2; i < n - k; i++)\n          *(*(a + i - 1) + j) = *(*(a + i) + j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33748", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num, minx[101], miny[101];\n  int a[101][101];\n  scanf(\"%d \", &num);\n  const int number = num;\n  while (num > 0) {\n    int sum = 0;\n    for (i = 0; i < number; i++)\n      for (j = 0; j < number; j++) {\n        cin >> a[i][j];\n      }\n    n = number;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        minx[i] = 1000;\n        miny[i] = 1000;\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[i][k] = a[i][k] - minx[i];\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[k][i] = a[k][i] - miny[i];\n      sum += a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n - 1; i++)\n          a[i][j] = a[i][j + 1];\n      n--;\n    }\n    cout << sum << endl;\n    num--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33749", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid minus_1(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[i][j]) ? m : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= m;\n  }\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[j][i]) ? m : a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= m;\n  }\n}\n\nvoid pr(int a[100][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      printf(\"%d%c\", a[i][j], (j + 1 == k) ? ' ' : ',');\n    }\n  }\n}\n\nvoid lower(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i == 0 && j == 0)\n        a[i][j] = a[i][j];\n      else if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      else if (i > 0 && j == 0)\n        a[i][j] = a[i + 1][j];\n      else if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n}\n\nvoid fff(int n) {\n  int a[100][100] = {0};\n  int i = 0, j, sum;\n\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      scanf(\"%d\", &a[i][j]);\n  for (i = 0, sum = 0; i < n; i++) {\n    minus_1(a, n - i);\n    sum += a[1][1];\n    lower(a, n - i);\n  }\n  printf(\"%d \", sum);\n}\n\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i++ < n)\n    fff(n);\n}\n"}
{"label": "18", "index": "33750", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, k, j, p, q, a[110][110] = {0}, Min, sum;\nint get() {\n  for (p = 0; p < n - 1; p++) {\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[k][j])\n          Min = a[k][j];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[k][j] -= Min;\n      }\n    }\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[j][k])\n          Min = a[j][k];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[j][k] -= Min;\n      }\n    }\n    sum += a[1][1];\n    q--;\n    for (k = 0; k < q - 1; k++)\n      for (j = 0; j < q + 1; j++) {\n        a[k + 1][j] = a[k + 2][j];\n      }\n    for (k = 0; k < q; k++)\n      for (j = 0; j < q - 1; j++) {\n        a[k][j + 1] = a[k][j + 2];\n      }\n  }\n  return sum;\n}\nint main() {\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    q = n;\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][j];\n    cout << get() << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33751", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid rowset(int a[][105], int n) {\n  int i, j;\n  int min;\n  for (i = 0; i <= n - 1; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (j = 0; j <= n - 1; j++)\n      a[i][j] = a[i][j] - min;\n  }\n}\n\nvoid lineset(int a[][105], int n) {\n  int i, j;\n  int min;\n  for (i = 0; i <= n - 1; i++) {\n    min = a[0][i];\n    for (j = 0; j <= n - 1; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (j = 0; j <= n - 1; j++)\n      a[j][i] = a[j][i] - min;\n  }\n}\n\nvoid form(int a[][105], int n) {\n  int i, j, k;\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 2; j <= n - 1; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j <= n - 2; j++) {\n    for (i = 2; i <= n - 1; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\n\nint main(char *argv[]) {\n  int n, i, j, k, flag;\n  scanf(\"%d\", &n);\n  int a[n][105];\n  int sum;\n  flag = n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n        scanf(\"%d\", a[j] + k);\n    flag = n;\n    while (flag >= 2) {\n      rowset(a, flag);\n      lineset(a, flag);\n      sum += a[1][1];\n      form(a, flag);\n      flag--;\n    }\n    printf(\"%d\", sum);\n    (i <= n - 2) ? printf(\"\\n\") : printf(\"\");\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33752", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k = 0, i, j, a[200][200], ans = 0, min;\n  double b[1000], t, p, q;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    ans = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 0; i <= n - k; i++) {\n        min = **(a + i);\n\n        for (j = 1; j <= n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n\n      for (j = 0; j <= n - k; j++) {\n        min = *(*a + j);\n        for (i = 1; i <= n - k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      ans = ans + *(*(a + 1) + 1);\n      for (i = 1; i <= n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (j = 1; j <= n - k - 1; j++)\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n    }\n    cout << ans << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33753", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000] = {0};\nint sum = 0;\nvoid cut(int n) {\n  int i, j, k;\n  int min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (k = 0; k < n; k++)\n      a[i][k] = a[i][k] - min;\n    min = 10000;\n  }\n  min = 10000;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (k = 0; k < n; k++)\n      a[k][i] = a[k][i] - min;\n    min = 10000;\n  }\n  sum = sum + a[1][1];\n}\nint main() {\n  int n, i, j, k, p;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    for (p = 1; p < n; p++) {\n      cut(n - p + 1);\n      for (j = 1; j < n - p; j++)\n        for (k = 1; k < n - p; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      for (k = 1; k < (n - p); k++)\n        a[0][k] = a[0][k + 1];\n      for (k = 1; k < (n - p); k++)\n        a[k][0] = a[k + 1][0];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33754", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0;\n  for (i = 1; i <= n; i++) {\n    int shuzu[100][100] = {0}, sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> shuzu[j][k];\n    int min = 99999, count = 1;\n    for (count = 1; count < n; count++) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (k = 0; k < n; k++)\n          shuzu[j][k] = shuzu[j][k] - min;\n\n        min = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      sum = sum + shuzu[count][count];\n\n      for (j = 0; j < n; j++) {\n        shuzu[j][count] = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        shuzu[count][k] = 99999;\n      }\n      shuzu[count][count] = 9999;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t, k, i, j, n, a[101][101], sum, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    t = n;\n    sum = 0;\n    while (t > 1) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 0; j < t; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        min = a[0][j];\n        for (i = 0; i < t; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < t; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < t - 1; i++) {\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < t - 1; j++) {\n        for (i = 0; i < t + 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      t--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int q;\n  int a[110][110];\n  int(*p)[110] = a;\n  scanf(\"%d \", &n);\n  q = n;\n  for (k = 1; k <= q; k++) {\n    int sum = 0;\n    n = q;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    while (1) {\n      if (n == 1)\n        break;\n      int min = 0;\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + j) + i))\n            min = *(*(p + j) + i);\n        for (j = 1; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      sum += a[2][2];\n      for (i = 2; i <= n - 1; i++)\n        for (j = 2; j <= n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      for (i = 2; i <= n - 1; i++) {\n        *(*(p + 1) + i) = *(*(p + 1) + i + 1);\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      }\n      n--;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33757", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid q(int l) {\n  for (int g = 0; g < l; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[g][h] = a[g][h + 1];\n  for (int g = 0; g < l - 1; g++)\n    for (int h = 1; h < l - 1; h++)\n      a[h][g] = a[h + 1][g];\n}\nint f(int y) {\n  int min, now;\n  if (y == 1)\n    return 0;\n  for (int g = 0; g < y; g++) {\n    min = a[g][0];\n    for (int h = 1; h < y; h++)\n      if (a[g][h] < min)\n        min = a[g][h];\n    for (int h = 0; h < y; h++)\n      a[g][h] -= min;\n  }\n  for (int g = 0; g < y; g++) {\n    min = a[0][g];\n    for (int h = 1; h < y; h++)\n      if (a[h][g] < min)\n        min = a[h][g];\n    for (int h = 0; h < y; h++)\n      a[h][g] -= min;\n  }\n  now = a[1][1];\n  q(y);\n  return now + f(y - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    printf(\"\\n%d\", f(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], n;\n  scanf(\"%d \", &n);\n  for (int x = 0; x < n; x++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[x][i][j];\n    }\n  }\n  for (int x = 0; x < n; x++) {\n    int sum = 0;\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = a[x][i][0];\n        for (int j = 0; j < m; j++) {\n          if (a[x][i][j] < min)\n            min = a[x][i][j];\n        }\n        for (int k = 0; k < m; k++)\n          a[x][i][k] -= min;\n      }\n      for (int j = 0; j < m; j++) {\n        int min = a[x][0][j];\n        for (int i = 0; i < m; i++) {\n          if (a[x][i][j] < min)\n            min = a[x][i][j];\n        }\n        for (int k = 0; k < m; k++)\n          a[x][k][j] -= min;\n      }\n      sum += a[x][1][1];\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < m; j++) {\n          if (i == 0 && j > 1) {\n            a[x][i][j - 1] = a[x][i][j];\n          }\n          if (i > 1) {\n            if (j == 0) {\n              a[x][i - 1][j] = a[x][i][j];\n            }\n            if (j > 1) {\n              a[x][i - 1][j - 1] = a[x][i][j];\n            }\n          }\n        }\n      }\n      m--;\n    }\n    cout << sum << endl;\n    ;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, flag = 0, i, j, a[200][200],\n         o[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, l, ans = 0, min;\n  double b[1000], t, p, q;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    ans = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 0; i <= n - k; i++) {\n        min = **(a + i);\n\n        for (j = 1; j <= n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n\n      for (j = 0; j <= n - k; j++) {\n        min = *(*a + j);\n        for (i = 1; i <= n - k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      ans = ans + *(*(a + 1) + 1);\n      for (i = 1; i <= n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (j = 1; j <= n - k - 1; j++)\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33760", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint find_min(int x, int side);\nint find_miny(int y, int side);\nint a[120][120], sum;\nvoid caozuo(int side);\nint main() {\n  int i, j, n, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    caozuo(n);\n  }\n\n  return 0;\n}\nint find_min(int x, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[x][i])\n      temp = a[x][i];\n  }\n  return temp;\n}\nint find_miny(int y, int side) {\n  int i, temp = 10001;\n  for (i = 0; i <= side - 1; i++) {\n    if (temp > a[i][y])\n      temp = a[i][y];\n  }\n  return temp;\n}\nvoid caozuo(int side) {\n  int i, j, t;\n  if (side == 1) {\n    printf(\"%d\\n\", sum);\n  } else {\n    for (i = 0; i <= side - 1; i++) {\n      t = find_min(i, side);\n      for (j = 0; j <= side - 1; j++) {\n        a[i][j] -= t;\n      }\n    }\n    for (i = 0; i <= side - 1; i++) {\n      t = find_miny(i, side);\n      for (j = 0; j <= side - 1; j++)\n        a[j][i] -= t;\n    }\n\n    sum = sum + a[1][1];\n    if (side > 2) {\n      for (i = 2; i <= side - 1; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i <= side - 1; i++) {\n        for (j = 2; j <= side - 1; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    caozuo(side - 1);\n  }\n}\n"}
{"label": "18", "index": "33761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, a[101][101] = {0}, j, k, sum = 0, min[101] = {0}, l,\n            min1[101] = {0};\n  cin >> n;\n  l = n;\n  for (k = 1; k <= l; k++) {\n\n    for (i = 1; i <= l; i++) {\n      for (j = 1; j <= l; j++) {\n        cin >> a[i][j];\n      }\n    }\n    n = l;\n\n    while (n > 1) {\n\n      for (i = 1; i <= n; i++) {\n        min[i] = a[i][1];\n        for (j = 1; j <= n; j++) {\n          if (min[i] > a[i][j])\n            min[i] = a[i][j];\n        }\n      }\n\n      for (i = 1; i <= n; i++) {\n\n        for (j = 1; j <= n; j++) {\n          a[i][j] = a[i][j] - min[i];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        min1[j] = a[1][j];\n        for (i = 1; i <= n; i++) {\n          if (min1[j] > a[i][j])\n            min1[j] = a[i][j];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          a[i][j] = a[i][j] - min1[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (j = 2; j < n; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i < n; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      n--;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33762", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint min(int x[]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    if (x[i] < 0)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (x[i] > x[j] && x[j] >= 0)\n        break;\n    }\n    if (j == n)\n      return x[i];\n  }\n  return 0;\n}\nvoid cut(int a[50][50], int k) {\n  int i, j, m;\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n}\nvoid xiaojian(int a[50][50], int k) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[k][i] = -1;\n    a[i][k] = -1;\n  }\n}\nint main() {\n  int a[50][50][50], j, i, k, l, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n\n    for (j = 0; j < n; j++) {\n      for (i = 0; i < n; i++) {\n        cin >> a[k][j][i];\n      }\n    }\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      cut(a[k], j);\n      sum = sum + a[k][j][j];\n      xiaojian(a[k], j);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33763", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101];\nint n;\n\nint search(int m) {\n  int i, j, min;\n  if (m > n)\n    return 0;\n\n  for (i = 1; i <= n; i++)\n    if (a[i][0] != -1) {\n      min = 99999999;\n      for (j = 1; j <= n; j++)\n        if ((a[0][j] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (j = 1; j <= n; j++)\n        if (a[0][j] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n\n  for (j = 1; j <= n; j++)\n    if (a[0][j] != -1) {\n      min = 99999999;\n      for (i = 1; i <= n; i++)\n        if ((a[i][0] != -1) && (a[i][j] < min))\n          min = a[i][j];\n      if (min == 0)\n        continue;\n      for (i = 1; i <= n; i++)\n        if (a[i][0] != -1)\n          a[i][j] = a[i][j] - min;\n    }\n  i = a[m][m];\n  a[m][0] = -1;\n  a[0][m] = -1;\n  return (i + search(m + 1));\n}\nint main() {\n  int i, j, t;\n  scanf(\"%d \", &n);\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    for (i = 1; i <= n; i++) {\n      a[0][i] = 0;\n      a[i][0] = 0;\n    }\n    printf(\"%d\\n\", search(2));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33764", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100][100];\nint main() {\n  int min, sum[100] = {0};\n  cin >> n;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[k][i][j];\n  for (int r = n; r > 1; r--) {\n    for (int k = 0; k < n; k++) {\n      for (int i = 0; i < r; i++) {\n        min = a[k][i][0];\n        for (int j = 1; j < r; j++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int j = 0; j < r; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n    }\n\n    for (int k = 0; k < n; k++)\n      for (int j = 0; j < r; j++) {\n        min = a[k][0][j];\n        for (int i = 1; i < r; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int i = 0; i < r; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n    for (int k = 0; k < n; k++) {\n      sum[k] = sum[k] + a[k][1][1];\n      for (int i = 1; i < r - 1; i++)\n        a[k][i][0] = a[k][i + 1][0];\n      for (int j = 1; j < r - 1; j++)\n        a[k][0][j] = a[k][0][j + 1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 1; j < r - 1; j++)\n          a[k][i][j] = a[k][i + 1][j + 1];\n    }\n  }\n\n  for (int k = 0; k < n; k++)\n    cout << sum[k] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, N, sum = 0, min;\n  scanf(\"%d \", &n);\n  int jz[n][n][n];\n  int i, j, k, t;\n\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    N = n;\n\n    for (t = 1; t < n; t++) {\n\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++)\n          jz[k][i][j] = jz[k][i + 1][j];\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < n; i++)\n          jz[k][i][j] = jz[k][i][j + 1];\n      }\n\n      N = N - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], i, j, c, sum = 0, k, n, min;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (c = n; c > 1; c--) {\n      for (i = 0; i < c; i++) {\n        min = 100000;\n        for (j = 0; j < c; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < c; j++) {\n        min = 100000;\n        for (i = 0; i < c; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < c; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < c - 1; i++) {\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < c; j++)\n        for (i = 0; i < c - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33767", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i = 0, j, k, l, min, sum = 0;\n  scanf(\"%d \", &n);\n  while (i < n) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= min;\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        min = a[0][k];\n        for (j = 0; j < n - l; j++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n - l; j++) {\n          a[j][k] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        for (j = 1; j < n - l; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n    }\n\n    cout << sum << endl;\n    sum = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33768", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int m, n, s = 0;\n  int a[200][200];\n  int(*p)[200] = a;\n  scanf(\"%d \", &n);\n  m = n;\n  for (int q = 0; q < m; q++) {\n    s = 0;\n    n = m;\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        cin >> *(*(p + i) + j);\n    for (int w = 0; w < m - 1; w++) {\n      for (int i = 0; i < n; i++) {\n        int l = *(*(p + i));\n        for (int j = 0; j < n; j++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      for (int j = 0; j < n; j++) {\n        int l = *(*(p) + j);\n        for (int i = 0; i < n; i++)\n          if (l > *(*(p + i) + j))\n            l = *(*(p + i) + j);\n        for (int i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - l;\n      }\n      s = s + *(*(p + 1) + 1);\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      for (int j = 0; j < n - 1; j++)\n        for (int i = 1; i < n - 1; i++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      n--;\n    }\n    cout << s << endl;\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "33769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, l, s = 0;\nint jz[100][100];\nint f() {\n  int i, j, k, min = 10000;\n  if (n == 1) {\n    cout << s << endl;\n    s = 0;\n    n = l;\n    return 0;\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[i][k] = jz[i][k] - min;\n          min = 10000;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[k][i] = jz[k][i] - min;\n          min = 10000; \n        }\n      }\n    }\n    s = s + jz[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[i][j] = jz[i][j + 1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[j][i] = jz[j + 1][i]; \n    n = n - 1;\n    f();\n  }\n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  l = n;\n  for (i = 1; i <= l; i++) {\n    for (j = 0; j < l; j++)\n      for (k = 0; k < l; k++)\n        cin >> jz[j][k];\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33770", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint changeSum(int, int, int[][100]);\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int j, k, a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", changeSum(n, 0, a));\n  }\n  return 0;\n}\n\nint changeSum(int n, int sum, int a[][100]) {\n  if (n == 1)\n    return sum;\n  else {\n    int j, k, minrow, mincol;\n    for (j = 0; j < n; j++) {\n      minrow = a[j][0];\n      for (k = 1; k < n; k++)\n        if (a[j][k] < minrow)\n          minrow = a[j][k];\n      for (k = 0; k < n; k++)\n        a[j][k] -= minrow;\n    }\n    for (k = 0; k < n; k++) {\n      mincol = a[0][k];\n      for (j = 1; j < n; j++)\n        if (a[j][k] < mincol)\n          mincol = a[j][k];\n      for (j = 0; j < n; j++)\n        a[j][k] -= mincol;\n    }\n    sum += a[1][1];\n    for (j = 2; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j - 1][k] = a[j][k];\n    for (j = 0; j < n; j++)\n      for (k = 2; k < n; k++)\n        a[j][k - 1] = a[j][k];\n    n--;\n    changeSum(n, sum, a);\n  }\n}\n"}
{"label": "18", "index": "33771", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint a[100][100], b[100];\nvoid cut(int);\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    cut(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid cut(int n) {\n  if (n > 1) {\n    int j, k;\n    for (j = 0; j < n; j++) {\n      b[j] = a[j][0];\n      for (k = 1; k < n; k++) {\n        if (a[j][k] < b[j]) {\n          b[j] = a[j][k];\n        }\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j][k] - b[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      b[j] = a[0][j];\n      for (k = 1; k < n; k++) {\n        if (a[k][j] < b[j])\n          b[j] = a[k][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        a[k][j] = a[k][j] - b[j];\n      }\n    }\n    sum += a[1][1];\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n; k++) {\n        a[j][k] = a[j + 1][k];\n      }\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (k = 0; k < n - 1; k++) {\n        a[k][j] = a[k][j + 1];\n      }\n    }\n    cut(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33772", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint arr[100][100];\nvoid solve(int n);\nvoid arrayin(int n);\nint down_cast(int n);\nvoid matrix_out(int n);\nint main(int argc, char **argv) {\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++)\n    solve(n);\n  return 0;\n}\nvoid arrayin(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cin >> arr[i][j];\n    }\n  }\n}\nvoid solve(int n) {\n  arrayin(n);\n  cout << down_cast(n) << endl;\n}\nint down_cast(int n) {\n  if (n == 1)\n    return 0;\n  int min, res;\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[i][j] < min)\n        min = arr[i][j];\n    for (int j = 0; j < n; j++)\n      arr[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    min = 65535;\n    for (int j = 0; j < n; j++)\n      if (arr[j][i] < min)\n        min = arr[j][i];\n    for (int j = 0; j < n; j++)\n      arr[j][i] -= min;\n  }\n  res = arr[1][1];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[i - 1][j] = arr[i][j];\n  for (int i = 2; i < n; i++)\n    for (int j = 0; j < n; j++)\n      arr[j][i - 1] = arr[j][i];\n\n  return res + down_cast(n - 1);\n}\nvoid matrix_out(int n) {\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      cout << arr[i][j] << \" \";\n    }\n    cout << endl;\n  }\n}\n"}
{"label": "18", "index": "33773", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, sum;\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int f(int a[100][100], int n);\n    sum = f(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint f(int a[100][100], int n) {\n  if (n == 1)\n    return 0;\n\n  int i, j, k, min, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  k = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  }\n  for (j = 2; j < n; j++) {\n    for (i = 0; i < (n - 1); i++)\n      a[i][j - 1] = a[i][j];\n  }\n  n = n - 1;\n  sum = k + f(a, n);\n  return (sum);\n}\n"}
{"label": "18", "index": "33774", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min, sum = 0, t, m;\n  int a[105][105];\n  scanf(\"%d \", &n);\n  t = n;\n  m = n;\n  while (t > 0) {\n    n = m;\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    t--;\n  }\n}\n"}
{"label": "18", "index": "33775", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint x[102][102];\nint (*p)[102];\nint n;\nvoid f(int k) {\n  int min, i, j;\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    for (j = 0; j < n - k; j++)\n      *(*(p + i) + j) -= min;\n  }\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    for (j = 0; j < n - k; j++)\n      *(*(p + j) + i) -= min;\n  }\n}\nint main() {\n  int i, j, k, sum;\n  p = x;\n  cin >> n;\n  for (int t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      f(k);\n      sum += *(*(p + 1) + 1);\n      for (i = 2; i < n; i++) {\n        *(*(p + 0) + i - 1) = *(*(p + 0) + i);\n        *(*(p + i - 1) + 0) = *(*(p + i) + 0);\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33776", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, n;\n  int rowMin, colMin;\n  int x;\n  int first;\n  int sum;\n  int flag;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n    \n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    \n    \n    \n    sum = 0;\n    \n    for (x = n; x > 1; x--) {\n      \n      for (i = 0; i < x; i++) {\n        first = 1; \n        flag = 0;  \n        for (j = 0; j < x; j++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              rowMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < rowMin)\n              rowMin = a[i][j];\n          } else {\n            flag = 1; \n            break;\n          }\n        }\n        if (flag == 0) \n        {\n          for (j = 0; j < x; j++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - rowMin;\n          }\n        }\n      }\n      \n      for (j = 0; j < x; j++) {\n        first = 1; \n        flag = 0;\n        for (i = 0; i < x; i++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              colMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < colMin)\n              colMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (i = 0; i < x; i++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - colMin;\n          }\n        }\n      }\n      \n      \n      \n      sum = sum + a[1][1];\n      \n      i = 0;\n      for (j = 2; j < x; j++)\n        a[i][j - 1] = a[i][j];\n      j = 0;\n      for (i = 2; i < x; i++)\n        a[i - 1][j] = a[i][j];\n      for (i = 2; i < x; i++) {\n        for (j = 2; j < x; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n      \n      \n      \n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid hang(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid lie(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++)\n      a[i][j] = a[i + 1][j];\n  }\n}\nvoid xiaohang(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[i][j]) {\n        min = a[i][j];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid xiaolie(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[j][i]) {\n        min = a[j][i];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100] = {{0}};\n  int i, j;\n  int p;\n  for (p = 1; p <= n; p++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int o, sum = 0, m = n;\n    for (o = 1; o <= n - 1; o++) {\n      xiaohang(a, m);\n      xiaolie(a, m);\n      sum += a[2][2];\n      hang(a, m);\n      lie(a, m);\n      m--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33778", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint jz(int a[100][100], int k) {\n  int sum = 0, min, i, j, b, judge = 0;\n  for (b = k; b > 1; b--) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 1; j < b; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      judge = 0;\n      for (j = 1; j < b; j++) {\n        if (a[j][i] == 0) {\n          judge = 1;\n          break;\n        }\n      }\n      if (judge == 0) {\n        min = a[0][i];\n        for (j = 1; j < b; j++) {\n          if (a[j][i] < min) {\n            min = a[j][i];\n          }\n        }\n        for (j = 0; j < b; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[i][j - 1] = a[i][j];\n      }\n    }\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[j - 1][i] = a[j][i];\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k, num[100][100], ans[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> num[j][k];\n      }\n    }\n    ans[i] = jz(num, n);\n  }\n  for (i = 0; i < n; i++) {\n    cout << ans[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33779", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, m, sum = 0;\n  int a[100][100], b[100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[j][0];\n        for (k = 1; k < n - m; k++) {\n          if (a[j][k] < b[j]) {\n            b[j] = a[j][k];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j][k] - b[j];\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        b[j] = a[0][j];\n        for (k = 1; k < n - m; k++) {\n          if (a[k][j] < b[j]) {\n            b[j] = a[k][j];\n          }\n        }\n      }\n      for (j = 0; j < n - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[k][j] = a[k][j] - b[j];\n        }\n      }\n      sum += a[1][1];\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - m; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (j = 1; j < n - 1 - m; j++) {\n        for (k = 0; k < n - 1 - m; k++) {\n          a[k][j] = a[k][j + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k, m, n, a[100][100], i, j, min, sum = 0;\n  scanf(\"%d\", &n);\n  k = m = n;\n  while (k--) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    while (--m) {\n      for (i = 0; i <= m; i++) {\n        min = a[i][0];\n        for (j = 0; j <= m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[i][j] -= min;\n        }\n      }\n      for (i = 0; i <= m; i++) {\n        min = a[0][i];\n        for (j = 0; j <= m; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        if (min != 0) {\n          for (j = 0; j <= m; j++)\n            a[j][i] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (i = 1; i < m; i++)\n        a[0][i] = a[0][i + 1];\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n    m = n;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33781", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  int rmin[100], cmin[100];\n  int i, j, k, l;\n  for (i = 0; i <= n - 1; i++) {\n    rmin[i] = a[i][0];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[i][j] < rmin[i]) {\n        rmin[i] = a[i][j];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++)\n      a[k][l] -= rmin[k];\n  for (i = 0; i <= n - 1; i++) {\n    cmin[i] = a[0][i];\n    for (j = 0; j <= n - 1; j++) {\n      if (a[j][i] < cmin[i]) {\n        cmin[i] = a[j][i];\n      }\n    }\n  }\n  for (k = 0; k <= n - 1; k++)\n    for (l = 0; l <= n - 1; l++) {\n      a[l][k] -= cmin[k];\n    }\n  return 0;\n}\nint main() {\n  int n;\n  cin >> n;\n  int i = 1, sum[100] = {0}, t;\n  while (i <= n) {\n    int a[100][100];\n    int j, k, l, m, s, y;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 1; l <= n - 1; l++) {\n      y = f(a, n - l + 1);\n      sum[i] += a[1][1];\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l; s++) {\n          a[m][s] = a[m + 1][s];\n        }\n      }\n      for (m = 1; m <= n - l - 1; m++) {\n        for (s = 0; s <= n - l - 1; s++) {\n          a[s][m] = a[s][m + 1];\n        }\n      }\n    }\n    i++;\n  }\n  for (t = 1; t <= n; t++)\n    printf(\"%d\\n\", sum[t]);\n  return 0;\n}\n"}
{"label": "18", "index": "33782", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k;\n  int sum = 0;\n  int a[101][101];\n  int min;\n  int l;\n  int p;\n  int t;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    l = n;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    for (p = 1; p < n; p++) {\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[i][j] == 0)\n            break;\n        }\n        min = a[i][0];\n        for (j = 1; j < l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[j][i] == 0)\n            break;\n        }\n        min = a[0][i];\n        for (j = 1; j < l; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      if (l == 2)\n        break;\n      for (i = 1; i < l - 1; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < l - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      l--;\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "33783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[101][101], sum = 0;\n\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min;\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min2;\n    min2 = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (a[i][j] < min2) {\n        min2 = a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++)\n      a[i][j] -= min2;\n  }\n}\n\nvoid subtract(int n) {\n  if (n > 2) {\n    for (int j = 2; j < n; j++) {\n      a[0][j - 1] = a[0][j];\n    }\n    for (int i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n    }\n    for (int i = 2; i < n; i++) {\n      for (int j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n  }\n}\n\nvoid process(int n) {\n  if (n != 1) {\n    zero(n);\n    sum += a[1][1];\n    subtract(n);\n    process(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    process(n);\n    cout << sum;\n    if (p != n - 1)\n      printf(\"\\n\");\n    sum = 0;\n  }\n}\n"}
{"label": "18", "index": "33784", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, total;\n  scanf(\"%d \", &n);\n  int a[n][n];\n  int numbers = n;\n  for (k = 0; k < numbers; k++) {\n    total = 0;\n    for (i = 0; i < numbers; i++)\n      for (j = 0; j < numbers; j++)\n        cin >> a[i][j];\n    for (n = numbers; n > 1; n--) {\n      for (i = 0; i < n; i++) {\n        int temp = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] -= temp;\n      }\n      for (j = 0; j < n; j++) {\n        int temp = a[0][j];\n        for (i = 1; i < n; i++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] -= temp;\n      }\n      total += a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33785", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[102][102], i, k, j, l, n, s, (*p)[102], (*q)[102], min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0, s = 0, p = &a[0]; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0, p = &a[0], q = &a[n]; i < n; i++)\n      *(*q + i) = *(*p + i);\n    for (i = 0, p = &a[1]; i < n; i++)\n      *(*(p + i) + n) = **(p + i);\n    for (l = 1; l < n; l++) {\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + i) + l); j <= n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = l; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + l) + i); j <= n; j++)\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        for (j = l; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      s += *(*(p + l) + l);\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33786", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint change(int a[][100], int n);\n\nint main() {\n  int n, k = 0;\n  int a[100][100], sum = 0;\n  int m = 0;\n\n  cin >> n;\n  while (k < n) {\n    sum = 0;\n    m = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    while (m < n - 1) {\n      sum += change(a, n - m);\n\n      for (int i = 0; i < n - m; i++) {\n        for (int j = 2; j < n - m; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n\n      for (int j = 0; j < n - m; j++) {\n        for (int i = 2; i < n - m; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      m++;\n    }\n\n    cout << sum << \"\\n\";\n\n    k++;\n  }\n\n  return 0;\n}\n\nint change(int a[][100], int n) {\n  int minx[100], miny[100];\n\n  int num;\n\n  for (int l = 0; l < 100; l++) {\n    minx[l] = INT_MAX;\n    miny[l] = INT_MAX;\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < minx[i])\n        minx[i] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= minx[i];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < miny[j])\n        miny[j] = a[i][j];\n    }\n  }\n\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= miny[j];\n    }\n  }\n  num = a[1][1];\n  return num;\n}\n"}
{"label": "18", "index": "33787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, k, array[100][100];\n  cin >> n;\n  k = n;\n  m = n;\n  while (m > 0) {\n    int i, j, min;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n    int sum = 0;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = array[i][0];\n        for (j = 1; j < k; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j < k; j++)\n          array[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = array[0][i];\n        for (j = 1; j < k; j++) {\n          if (array[j][i] < min)\n            min = array[j][i];\n        }\n        for (j = 0; j < k; j++)\n          array[j][i] -= min;\n      }\n      sum += array[1][1];\n      for (i = 0; i < k; i++) {\n        for (j = 1; j < k - 1; j++) {\n          array[i][j] = array[i][j + 1];\n        }\n      }\n      for (j = 0; j < k - 1; j++) {\n        for (i = 1; i < k - 1; i++) {\n          array[i][j] = array[i + 1][j];\n        }\n      }\n      k--;\n    }\n    cout << sum << endl;\n    k = n;\n    m--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int n, cnt, kobe;\n  cin >> n;\n  cnt = n;\n\n  int(*p)[200], a[200][200] = {0};\n  while (cnt--) {\n    int i, j, sum = 0;\n    long min;\n    kobe = n;\n    p = a;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (int k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < kobe; i++) {\n        min = 999999999;\n        for (j = 0; j < kobe; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (j = 0; j < kobe; j++) {\n        min = 999999999;\n        for (i = 0; i < kobe; i++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 1; i < kobe; i++)\n        for (j = 0; j < kobe; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < kobe; j++)\n        for (i = 0; i < kobe; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      kobe--;\n    }\n    cout << sum << endl;\n    \n    \n    \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, sum, min, m;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 1; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < m - 1; j++)\n        for (i = 1; i < m - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33790", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint Sum(int n);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << Sum(n) << endl;\n  }\n  return 0;\n}\n\nint Sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n"}
{"label": "18", "index": "33791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int a[n][n][n], b[n], min1[n], min2[n], c[n][n - 1], sum[n];\n  int i, j, k, l, p; \n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) \n    {\n      for (j = 0; j < n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) \n      {\n        min1[i] = a[k][i][0];\n        for (j = 0; j < n - l; j++) \n        {\n          if (a[k][i][j] <= min1[i]) {\n            min1[i] = a[k][i][j];\n          }\n        }\n        for (j = 0; j < n - l; j++)\n          a[k][i][j] = a[k][i][j] - min1[i]; \n      }\n      for (j = 0; j < n - l; j++) \n      {\n        min2[j] = a[k][0][j];\n        for (i = 0; i < n - l; i++) \n        {\n          if (a[k][i][j] <= min2[j]) {\n            min2[j] = a[k][i][j];\n          }\n        }\n        for (i = 0; i < n - l; i++)\n          a[k][i][j] = a[k][i][j] - min2[j]; \n      }\n      c[k][l] = a[k][1][1];      \n      sum[k] = sum[k] + c[k][l]; \n      for (j = 0; j < n; j++)    \n        for (i = 1; i < n - 1 - l; i++) {\n          a[k][i][j] = a[k][i + 1][j];\n        }\n      for (i = 0; i < n - 1 - l; i++) \n        for (j = 1; j < n - 1 - l; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n    }\n  }\n  for (i = 0; i < n; i++) \n    cout << sum[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint total;\n\nvoid slice_1(int);\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  slice_1(n);\n}\n\nvoid slice_1(int n) {\n  total += a[1][1];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (j > 0 && i > 0) {\n        a[i][j] = a[i + 1][j + 1];\n      } else if (j > 0) {\n        a[i][j] = a[i][j + 1];\n      } else if (i > 0) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n  n--;\n  if (n == 1) {\n    return;\n  }\n  zero(n);\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    memset(a, 0, 100 * 100 * sizeof(int));\n    total = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    zero(n);\n    printf(\"%d\\n\", total);\n  }\n}\n"}
{"label": "18", "index": "33793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, s, m, a[10000];\n  int *p, *p1, *p2, *p3;\n  scanf(\"%d\", &n);\n  p = a;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n; i++) {\n      p1 = p + 100 * i;\n      for (j = 0; j < n; j++) {\n        p2 = p1 + j;\n        scanf(\"%d\", p2);\n      }\n    }\n    s = 0;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n; i++) {\n        p1 = p + i * 100;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j;\n          *p2 = *p2 - m;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        p1 = p + i;\n        m = *p1;\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          if (j > k)\n            if (*p2 < m)\n              m = *p2;\n        }\n        for (j = 0; j < n; j++) {\n          p2 = p1 + j * 100;\n          *p2 = *p2 - m;\n        }\n      }\n      s = s + *(p + 101 * (k + 1));\n    }\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33794", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid change(int n);\nint number[100][100];\nint main() {\n  int n, k, j;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> number[k][j];\n    sum = 0;\n    change(n);\n  }\n  return 0;\n}\n\nvoid change(int n) {\n  int m;\n  m = n;\n  int min;\n  if (m == 1)\n    printf(\"%d\\n\", sum);\n  else {\n    int i = 0, j = 0;\n    for (i = 0; i < m; i++) {\n      min = number[i][0];\n      for (j = 0; j < m; j++)\n        if (min > number[i][j])\n          min = number[i][j];\n      for (j = 0; j < n; j++)\n        number[i][j] = number[i][j] - min;\n    }\n    for (i = 0; i < m; i++) {\n      min = number[0][i];\n      for (j = 0; j < m; j++)\n        if (min > number[j][i])\n          min = number[j][i];\n      for (j = 0; j < m; j++)\n        number[j][i] = number[j][i] - min;\n    }\n\n    sum = sum + number[1][1];\n    for (j = 0; j < m; j++)\n      for (i = 1; i < m - 1; i++)\n        number[i][j] = number[i + 1][j];\n    for (i = 0; i < m - 1; i++)\n      for (j = 1; j < m - 1; j++)\n        number[i][j] = number[i][j + 1];\n    m = m - 1;\n    change(m);\n  }\n}\n"}
{"label": "18", "index": "33795", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[101][101];\n\nint hanshu(int n);\n\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    cout << hanshu(n) << endl;\n  }\n\n  return 0;\n}\n\nint hanshu(int n) {\n  int min, sum = 0, i, j;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 1; i <= n; i++) {\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 1; j <= n; j++)\n        a[i][j] -= min;\n    }\n    for (j = 1; j <= n; j++) {\n      min = 10000;\n      for (i = 1; i <= n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (i = 1; i <= n; i++)\n        a[i][j] -= min;\n    }\n    sum = a[2][2];\n    for (i = 1; i <= n; i++)\n      for (j = 2; j < n; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 1; j < n; j++)\n      for (i = 2; i < n; i++)\n        a[i][j] = a[i + 1][j];\n    return sum + hanshu(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101][101], i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    int ti = 2, sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (ti = 2; ti <= n; ti++) {\n      int mins[101], minl[101];\n      for (int p = 1; p <= n; p++) {\n        mins[p] = 10000;\n        minl[p] = 10000;\n      }\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (a[i][j] >= 0 && a[i][j] <= mins[i])\n            mins[i] = a[i][j];\n        }\n        for (j = 1; j <= n; j++)\n          a[i][j] = a[i][j] - mins[i];\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          if (a[i][j] >= 0 && a[i][j] <= minl[j])\n            minl[j] = a[i][j];\n        }\n\n        for (i = 1; i <= n; i++)\n          a[i][j] = a[i][j] - minl[j];\n      }\n      sum = sum + a[ti][ti];\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (i == ti || j == ti)\n            a[i][j] = -1;\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33797", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint array_1[101][101];\nint search_x(int k) {\n  int i, j;\n  int t = 1000;\n  for (j = 0; j < n; j++)\n    if (*(*(array_1 + 0) + j) < t)\n      t = *(*(array_1 + 0) + j);\n  for (j = 0; j < n; j++) {\n    *(*(array_1 + 0) + j) = *(*(array_1 + 0) + j) - t;\n  }\n\n  for (i = k; i < n; i++) {\n    t = 1000;\n    for (j = 0; j < n; j++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (j = 0; j < n; j++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint search_y(int k) {\n  int i, j;\n  int t = 1000;\n  for (i = 0; i < n; i++)\n    if (*(*(array_1 + i) + 0) < t)\n      t = *(*(array_1 + i) + 0);\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + 0) = *(*(array_1 + i) + 0) - t;\n  for (j = k; j < n; j++) {\n    t = 1000;\n    for (i = 0; i < n; i++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (i = 0; i < n; i++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint change(int k) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + k) = 1000;\n  for (j = 0; j < n; j++)\n    *(*(array_1 + k) + j) = 1000;\n  return 0;\n}\nint main() {\n\n  int i, j, k, w;\n  int num;\n  scanf(\"%d \", &n);\n  for (w = 0; w < n; w++) {\n    num = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(array_1 + i) + j);\n\n    for (k = 0; k < n; k++) {\n      search_x(k + 1);\n      search_y(k + 1);\n      num = num + *(*(array_1 + k + 1) + k + 1);\n      change(k + 1);\n    }\n\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33798", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100] = {0};\nint b[100][100] = {0};\nint i, j, n;\nint num = 0;\nvoid m(int n) {\n  int min;\n  for (i = 0; i <= n - 1; ++i) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    min = a[0][j];\n    for (i = 0; i <= n - 1; ++i) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n - 1; ++i)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid del(int n) {\n  b[0][0] = a[0][0];\n  for (j = 1; j <= n - 2; ++j)\n    b[0][j] = a[0][j + 1];\n  for (i = 1; i <= n - 2; ++i)\n    b[i][0] = a[i + 1][0];\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\nint s(int n) {\n  m(n);\n  num = num + a[1][1];\n  del(n);\n  if (n != 2)\n    s(n - 1);\n  return num;\n}\nint main() {\n  int k;\n  cin >> n;\n  for (k = 1; k <= n; ++k) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    num = 0;\n    printf(\"%d\\n\", s(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33799", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = a[j][0];\n        for (k = 1; k < i; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 0; k < i; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = a[0][j];\n        for (k = 1; k < i; k++)\n          if (a[k][j] < min)\n            min = a[k][j];\n        for (k = 0; k < i; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[k][j - 1] = a[k][j];\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          a[j - 1][k] = a[j][k];\n    }\n    cout << sum << endl;\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "33800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid min(int a[100][100], int);\nvoid newa(int a[100][100], int);\nint main() {\n  int i, j, k, n, a[100][100];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    min(a, n);\n  }\n  return 0;\n}\nvoid min(int a[][100], int n) {\n  int i, j, k, m, x, y, sum = 0;\n  for (m = n; m > 1; m--) {\n    for (i = 0; i < m; i++) {\n      x = a[i][0];\n      for (j = 1; j < m; j++) {\n        if (x > a[i][j])\n          x = a[i][j];\n      }\n      for (k = 0; k < m; k++) {\n        a[i][k] -= x;\n      }\n    }\n    for (i = 0; i < m; i++) {\n      y = a[0][i];\n      for (j = 1; j < m; j++) {\n        if (y > a[j][i])\n          y = a[j][i];\n      }\n      for (k = 0; k < m; k++) {\n        a[k][i] -= y;\n      }\n    }\n    sum += a[1][1];\n    newa(a, m);\n  }\n  cout << sum << endl;\n}\nvoid newa(int a[][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n\n  for (i = 0; i < m; i++)\n    for (j = 2; j < m; j++)\n      a[j - 1][i] = a[j][i];\n}\n"}
{"label": "18", "index": "33801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid hang(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid lie(int a[100][100], int n) {\n  int i, j;\n  for (i = 2; i <= n - 1; i++) {\n    for (j = 1; j <= n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nvoid xiaohang(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[i][j]) {\n        min = a[i][j];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid xiaolie(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    int min = 100000000;\n    for (j = 1; j <= n; j++) {\n      if (min > a[j][i]) {\n        min = a[j][i];\n      }\n    }\n    for (j = 1; j <= n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100] = {{0}};\n  int i, j;\n  int p;\n  for (p = 1; p <= n; p++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int o, sum = 0, m = n;\n    for (o = 1; o <= n - 1; o++) {\n      xiaohang(a, m);\n      xiaolie(a, m);\n      sum += a[2][2];\n      hang(a, m);\n      lie(a, m);\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33802", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid zero(int a[100][100], int n) {\n  int min[100];\n  for (int i = 0; i < n; ++i) {\n    min[i] = a[i][0];\n    for (int j = 0; j < n; ++j)\n      if (a[i][j] < min[i])\n        min[i] = a[i][j];\n    if (min[i] != 0)\n      for (int j = 0; j < n; ++j)\n        a[i][j] -= min[i];\n  }\n  for (int j = 0; j < n; ++j) {\n    min[j] = a[0][j];\n    for (int i = 0; i < n; ++i)\n      if (a[i][j] < min[j])\n        min[j] = a[i][j];\n    if (min[j] != 0)\n      for (int i = 0; i < n; ++i)\n        a[i][j] -= min[j];\n  }\n}\nvoid subduction(int a[100][100], int n) {\n  for (int i = 1; i < n - 1; ++i) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; ++i)\n    for (int j = 1; j < n - 1; ++j)\n      a[i][j] = a[i + 1][j + 1];\n}\nint main() {\n  int m, n, s, a[100][100];\n  cin >> n;\n  for (int t = 0; t < n; ++t) {\n    s = 0, m = n;\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    while (m != 1) {\n      zero(a, m);\n      s += a[1][1];\n      subduction(a, m--);\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33803", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100];\nvoid hang(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  for (int i = 0; i < n; i++)\n    a[m][i] -= min;\n}\nvoid lie(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  for (int i = 0; i < n; i++)\n    a[i][m] -= min;\n}\nvoid del(int a[100][100]) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int k = 0, sum = 0;\n    while (k < n - 1) {\n      for (i = 0; i < n; i++)\n        hang(i);\n      for (i = 0; i < n; i++)\n        lie(i);\n\n      sum += a[1][1];\n      del(a);\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33804", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[101][101], n;\nint rowmin(int i) {\n  int minr = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i][i1] < minr && a[i][i1] >= 0) {\n      minr = a[i][i1];\n    }\n  }\n  return minr;\n}\nint colmin(int i) {\n  int minc = INT_MAX;\n  for (int i1 = 0; i1 < n; i1++) {\n    if (a[i1][i] < minc && a[i1][i] >= 0) {\n      minc = a[i1][i];\n    }\n  }\n  return minc;\n}\nint main() {\n  int t, k, sum, min, minc, i, j;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    k = 1;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (k < n) {\n      for (i = 0; i < n; i++) {\n        min = rowmin(i);\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n; i++) {\n        min = colmin(i);\n        for (j = 0; j < n; j++) {\n          a[j][i] -= min;\n        }\n      }\n      sum += a[k][k];\n      for (i = 0; i < n; i++) {\n        a[i][k] = -1;\n      }\n      for (i = 0; i < n; i++) {\n        a[k][i] = -1;\n      }\n      k++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33805", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint board[100][100];\nvoid Subduction(int);\nvoid Turn(int);\nint n;\nint sum;\nint main() {\n  int i;\n  scanf(\"%d \", &n);\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1)\n\n    cout << sum << endl;\n  else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    Turn(m);\n    Subduction(m - 1);\n  }\n}\n\nvoid Turn(int m) {\n  int p, q;\n  for (q = 1; q <= m - 2; q++) {\n    board[0][q] = board[0][q + 1];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    board[p][0] = board[p + 1][0];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    for (q = 1; q <= m - 2; q++) {\n      board[p][q] = board[p + 1][q + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n; \n  cin >> n;\n  for (int af = 1; af <= n; af++) {\n    int sum = 0;\n    int a[100][100];\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n    for (int tempn = n; tempn >= 2; tempn--) {\n\n      for (int i = 0; i <= tempn - 1; i++) \n      {\n        int mini = a[i][0];\n        for (int j = 1; j <= tempn - 1; j++) {\n          if (mini > a[i][j])\n            mini = a[i][j];\n        }\n        for (int j = 0; j <= tempn - 1; j++)\n          a[i][j] -= mini;\n      }\n      for (int j = 0; j <= tempn - 1; j++) \n      {\n        int minj = a[0][j];\n        for (int i = 1; i <= tempn - 1; i++) {\n          if (minj > a[i][j])\n            minj = a[i][j];\n        }\n        for (int i = 0; i <= tempn - 1; i++)\n          a[i][j] -= minj;\n      }\n      sum += a[1][1]; \n      for (int i = 2; i <= tempn - 1; i++)\n        a[i - 1][0] = a[i][0];\n      for (int j = 2; j <= tempn - 1; j++)\n        a[0][j - 1] = a[0][j];\n      for (int i = 2; i <= tempn - 1; i++) {\n        for (int j = 2; j <= tempn - 1; j++)\n          a[i - 1][j - 1] = a[i][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "33807", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int ma[120][120];\n  int i;\n  int j;\n  int sum[120];\n  int time;\n  int t;\n  int n;\n  int min[120];\n  scanf(\"%d \", &n);\n  for (t = 0; t <= n - 1; t++) {\n\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> ma[i][j];\n\n    sum[t] = 0;\n    for (time = n - 1; time >= 1; time--) {\n      for (i = 0; i <= time; i++) {\n        min[i] = ma[i][0];\n        for (j = 0; j <= time; j++)\n          if (min[i] > ma[i][j])\n            min[i] = ma[i][j];\n        for (j = 0; j <= time; j++)\n          ma[i][j] = ma[i][j] - min[i];\n      }\n      for (j = 0; j <= time; j++) {\n        min[j] = ma[0][j];\n        for (i = 0; i <= time; i++)\n          if (min[j] > ma[i][j])\n            min[j] = ma[i][j];\n        for (i = 0; i <= time; i++)\n          ma[i][j] = ma[i][j] - min[j];\n      }\n\n      sum[t] = sum[t] + ma[1][1];\n      if (time >= 2) {\n        for (i = 1; i <= time - 1; i++)\n          for (j = 0; j <= time; j++)\n            ma[i][j] = ma[i + 1][j];\n        for (j = 1; j <= time - 1; j++)\n          for (i = 0; i <= time; i++)\n            ma[i][j] = ma[i][j + 1];\n      }\n    }\n  }\n\n  for (i = 0; i <= n - 2; i++)\n    cout << sum[i] << endl;\n  cout << sum[n - 1];\n\n  return 0;\n}\n"}
{"label": "18", "index": "33808", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, l, len = 0, sum = 0;\nint array_1[100][100];\nvoid guilinhang(int a) {\n  int min = array_1[a][0];\n  for (l = 0; l < len; l++) {\n    if (array_1[a][l] < min)\n      min = array_1[a][l];\n  }\n  for (l = 0; l < len; l++)\n    array_1[a][l] = array_1[a][l] - min;\n}\nvoid guilinlie(int a) {\n  int min = array_1[0][a];\n  for (l = 0; l < len; l++) {\n    if (array_1[l][a] < min)\n      min = array_1[l][a];\n  }\n  for (l = 0; l < len; l++)\n    array_1[l][a] = array_1[l][a] - min;\n}\nvoid xiaojian(int a) {\n  if (a == 2)\n    return;\n  else if (a > 2) {\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[j][i] = array_1[j][i + 1];\n    }\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[i][j] = array_1[i + 1][j];\n    }\n  }\n}\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    len = n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    }\n    while (len >= 2) {\n      for (i = 0; i < len; i++) {\n        guilinhang(i);\n      }\n      for (i = 0; i < len; i++) {\n        guilinlie(i);\n      }\n      sum = sum + array_1[1][1];\n      xiaojian(len);\n      len--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33809", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0;\n  for (i = 1; i <= n; i++) {\n    int shuzu[100][100] = {0}, sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> shuzu[j][k];\n    int min = 99999, count = 1;\n    for (count = 1; count < n; count++) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (k = 0; k < n; k++)\n          shuzu[j][k] = shuzu[j][k] - min;\n\n        min = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      sum = sum + shuzu[count][count];\n\n      for (j = 0; j < n; j++) {\n        shuzu[j][count] = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        shuzu[count][k] = 99999;\n      }\n      shuzu[count][count] = 9999;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, k, m;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    int num = 0;\n    int sum = 0;\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = 0; m < n - 1; m++) \n    {\n      for (i = 0; i < n - num; i++) {\n        int rowm = a[i][0];\n        for (j = 0; j < n - num; j++) \n        {\n          if (a[i][j] < rowm)\n            rowm = a[i][j];\n        }\n        for (j = 0; j < n - num; j++) \n        {\n          a[i][j] = a[i][j] - rowm;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        int colm = a[0][j];\n        for (i = 0; i < n - num; i++) \n        {\n          if (a[i][j] < colm)\n            colm = a[i][j];\n        }\n        for (i = 0; i < n - num; i++) \n        {\n          a[i][j] = a[i][j] - colm;\n        }\n      }\n      sum = sum + a[1][1]; \n\n      for (i = 2; i < n - num; i++) \n      {\n        for (j = 0; j < n - num; j++)\n          a[i - 1][j] = a[i][j];\n      }\n\n      for (j = 2; j < n - num; j++) \n      {\n        for (i = 0; i < n - num; i++)\n          a[i][j - 1] = a[i][j];\n      }\n      num++;\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33811", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[105][105], sum = 0, min, p;\n  cin >> n;\n  p = n;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n\n    for (int m = 1; m <= n - 1; m++) {\n      for (i = 0; i <= p - 1; i++) {\n        min = 10000;\n        for (j = 0; j <= p - 1; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j <= p - 1; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= p - 1; j++) {\n        min = 10000;\n        for (i = 0; i <= p - 1; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i <= p - 1; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n\n      for (i = 2; i <= p - 1; i++) {\n        for (j = 0; j <= p - 1; j++)\n          a[i - 1][j] = a[i][j];\n      }\n      for (j = 2; j <= p - 1; j++) {\n        for (i = 0; i <= p - 1; i++)\n          a[i][j - 1] = a[i][j];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33812", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[1001][1001], sum = 0;\nvoid reduce(int a[][1001], int n) {\n\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (i = n; i > 1; i--) {\n      reduce(a, i);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, N, n, o, i, j, r, a[200][200] = {0};\n  scanf(\"%d\", &n);\n  for (N = 1; N <= n; N++) {\n    r = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    for (m = 0; m <= n - 2; m++) {\n      for (i = 0; i <= n - 1; i++) {\n        {\n          if ((i >= 1) && (i <= m)) {\n            i = m;\n            continue;\n          }\n        }\n        o = a[i][0];\n        for (j = 1; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        {\n          if ((j >= 1) && (j <= m)) {\n            j = m;\n            continue;\n          }\n        }\n        o = a[0][j];\n        for (i = 1; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (i = 0; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      r = r + a[1 + m][1 + m];\n    }\n    cout << r << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], n;\n  int(*p)[101];\n  scanf(\"%d\", &n);\n  int nn = n, min, s, i, j, nnn = n;\n  while (nn--) {\n    n = nnn;\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = 1000000;\n        for (j = 0; j < n; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 1000000;\n        for (i = 0; i < n; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < n; i++)\n          *(*(a + i) + j) -= min;\n      }\n      s = s + *(*(a + 1) + 1);\n      for (i = 1; i < n - 1; i++) {\n        *((*a) + i) = *((*a) + i + 1);\n      }\n      for (i = 1; i < n - 1; i++) {\n        *(*(a + i)) = *(*(a + i + 1));\n      }\n      for (i = 1; i < n; i++) {\n        for (j = 1; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j + 1);\n      }\n\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33815", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, range;\n  scanf(\"%d \", &range);\n  n = range;\n  int a[102][102], (*p)[102] = a;\n  int i, j, k, q, sum = 0;\n  for (i = 0; i < range; i++) {\n    sum = 0;\n    n = range;\n    int minrow = 999999, mincol = 999999;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(p + j) + k);\n    for (; n > 1;) {\n\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (*(*(p + j) + k) < minrow)\n            minrow = *(*(p + j) + k);\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j) + k) - minrow;\n        minrow = 999999;\n      }\n\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++)\n          if (*(*(p + j) + k) < mincol)\n            mincol = *(*(p + j) + k);\n        for (j = 0; j < n; j++)\n          *(*(p + j) + k) = *(*(p + j) + k) - mincol;\n        mincol = 999999;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      if (n == 2)\n        break;\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j + 1) + k);\n      }\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      }\n      n--;\n    }\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k, l, m;\n  double a[100][100];\n  int min;\n  int sum = 0;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (l = 1; l < n; l++) {\n\n      for (j = 0; j < n; j++) {\n        k = 0;\n        while (a[j][k] < 0)\n          k++;\n        while (k < n) {\n          min = a[j][k];\n          for (; k < n; k++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (k = 0; k < n; k++)\n            a[j][k] -= min;\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        j = 0;\n        while (a[j][k] < 0)\n          j++;\n        while (j < n) {\n          min = a[j][k];\n          for (j = 1; j < n; j++)\n            if (min > a[j][k] && a[j][k] >= 0)\n              min = a[j][k];\n          for (j = 0; j < n; j++)\n            a[j][k] -= min;\n        }\n      }\n\n      sum += a[l][l];\n      for (m = 0; m < n; m++) {\n        a[l][m] = -1;\n        a[m][l] = -1;\n      }\n    }\n\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, number[100][100], i, p, o, u, count, min;\n  scanf(\"%d\", &n);\n  for (o = 0; o < n; o++) {\n    for (i = 0; i < n; i++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d\", &number[i][p]);\n      }\n    }\n    count = 0;\n    for (u = 0; u < n - 1; u++) {\n      for (i = 0; i < n - u; i++) {\n        min = 999999;\n        for (p = 0; p < n - u; p++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (p = 0; p < n - u; p++) {\n          number[i][p] -= min;\n        }\n      }\n      for (p = 0; p < n - u; p++) {\n        min = 999999;\n        for (i = 0; i < n - u; i++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (i = 0; i < n - u; i++) {\n          number[i][p] -= min;\n        }\n      }\n      count += number[1][1];\n      for (i = 1; i < n - u - 1; i++) {\n        number[i][0] = number[i + 1][0];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        number[0][p] = number[0][p + 1];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        for (i = 1; i < n - u - 1; i++) {\n          number[i][p] = number[i + 1][p + 1];\n        }\n      }\n    }\n    cout << count << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33818", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int min, n, i, j, ans, t;\n  int a[101][101];\n\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[i][j] < min))\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[j][i] < min))\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      ans = ans + a[1][1];\n\n      for (i = 1; i < t - 1; i++)\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 0; i < t - 1; i++)\n        for (j = 1; j < t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33819", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[110][110], i, j, x, min = 10000, sum = 0, k;\n  int(*p)[110] = a;\n  cin >> x;\n  for (k = 1; k <= x; k++) {\n    sum = 0;\n    for (i = 1; i <= x; i++)\n      for (j = 1; j <= x; j++)\n        cin >> *(*(p + i) + j);\n    for (n = x; n >= 2; n--) {\n      for (i = 1; i <= n; i++) {\n        min = 100000;\n        for (j = 1; j <= n; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (j = 1; j <= n; j++) {\n        min = 100000;\n        for (i = 1; i <= n; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n        }\n      }\n      sum = sum + *(*(p + 2) + 2);\n      for (i = 2; i <= n - 1; i++)\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (j = 2; j <= n - 1; j++)\n        for (i = 1; i <= n; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int sum = 0;\n  int a[101][101];\n  int min;\n  int l;\n  int p;\n  int t;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    l = n;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    for (p = 1; p < n; p++) {\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[i][j] == 0)\n            break;\n        }\n        min = a[i][0];\n        for (j = 1; j < l; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (i = 0; i < l; i++) {\n        for (j = 1; j < l; j++) {\n          if (a[j][i] == 0)\n            break;\n        }\n        min = a[0][i];\n        for (j = 1; j < l; j++) {\n\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      if (l == 2)\n        break;\n      for (i = 1; i < l - 1; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < l - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      l--;\n    }\n    printf(\"%d \", sum);\n  }\n}\n"}
{"label": "18", "index": "33821", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sub(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &num[j][k]);\n    printf(\"%d\\n\", sub(num, n));\n  }\n  return 0;\n}\nint sub(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = 1000;\n    for (i = 0; i < n; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i < n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + sub(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33822", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  cin >> n;\n  int q = 0;\n  while (q < n) {\n    int a[110][110] = {0}, (*p)[110] = a;\n    int o = n, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n    while (o > 0) {\n      int min[110][2] = {0}, (*q)[2] = min;\n      memset(min, 10000, sizeof(min));\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          if (*(*(p + i) + j) < *(*(q + i)))\n            *(*(q + i)) = *(*(p + i) + j);\n        }\n      }\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) -= *(*(q + i));\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          if (*(*(p + i) + j) < *(*(q + j) + 1))\n            *(*(q + j) + 1) = *(*(p + i) + j);\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++)\n          *(*(p + i) + j) -= *(*(q + j) + 1);\n      }\n      sum += *(*(p + 1) + 1);\n      for (int i = 0; i < o; i++) {\n        for (int j = 1; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (int i = 1; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      o--;\n    }\n    cout << sum << endl;\n    q++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[101][101];\nvoid guiling(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid f(int n) {\n  if (n == 1)\n    return;\n  else {\n    guiling(n);\n    sum += a[1][1];\n    xiaojian(n);\n    f(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    f(n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33824", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, sum;\n  int a[200][200];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    l = n;\n    sum = 0;\n    while (n >= 2) {\n      for (j = 1; j <= n; j++) {\n        min = a[j][1];\n        for (k = 1; k <= n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 1; k <= n; k++)\n          a[j][k] -= min;\n      }\n      for (k = 1; k <= n; k++) {\n        min = a[1][k];\n        for (j = 1; j <= n; j++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (j = 1; j <= n; j++)\n          a[j][k] -= min;\n      }\n      sum += a[2][2];\n      for (j = 2; j <= n - 1; j++)\n        for (k = 1; k <= n; k++)\n          a[j][k] = a[j + 1][k];\n      for (k = 2; k <= n - 1; k++)\n        for (j = 1; j <= n - 1; j++)\n          a[j][k] = a[j][k + 1];\n      n--;\n    }\n    n = l;\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, sum, min;\n  cin >> m;\n  for (i = 1; i <= m; i++)\n\n  {\n    int a[m][m];\n    for (j = 0; j < m; j++)\n      for (k = 0; k < m; k++)\n        cin >> a[j][k];\n    sum = 0;\n    for (n = m; n > 1; n--) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 1; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33826", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint mat[100][100], n, sum = 0;\nint rmin(int a[][100], int x) {\n  int i, rsmall = a[x][0];\n  for (i = 0; i < n; i++) {\n    if (rsmall > a[x][i]) {\n      rsmall = a[x][i];\n    }\n  }\n  return rsmall;\n}\nint cmin(int a[][100], int y) {\n  int i, csmall = a[0][y];\n  for (i = 0; i < n; i++) {\n    if (csmall > a[i][y]) {\n      csmall = a[i][y];\n    }\n  }\n  return csmall;\n}\nvoid caculate(int mat[][100]) {\n  int i, j, rsmall, csmall;\n  for (i = 0; i < n; i++) {\n    rsmall = rmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[i][j] -= rsmall;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    csmall = cmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[j][i] -= csmall;\n    }\n  }\n}\nvoid change(int a[][100], int x) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < x; i++)\n    for (j = 1; j < x - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (i = 1; i < x - 1; i++)\n    for (j = 0; j < x - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\nint main() {\n  int m, i, j, num;\n  cin >> num;\n  for (m = 1; m <= num; m++) {\n    n = num;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++) {\n        cin >> mat[i][j];\n      }\n    while (n != 1) {\n      caculate(mat);\n      change(mat, n--);\n    }\n    cout << sum << endl;\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "33827", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, a[10000], *p, k = 0;\n  p = a;\n  cin >> n;\n  while (k < n) {\n    int total = 0, m = n;\n    k++;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(p + i * n + j);\n\n    while (m > 1) {\n      int min = 100000;\n      for (i = 0; i < m; i++) {\n        for (j = 0; j < m; j++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (j = 0; j < m; j++)\n          *(p + i * m + j) -= min;\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 0; j < m; j++) {\n        for (i = 0; i < m; i++) {\n          if (*(p + i * m + j) < min)\n            min = *(p + i * m + j);\n        }\n        for (i = 0; i < m; i++) {\n          *(p + i * m + j) -= min;\n        }\n        min = 10000;\n      }\n      total += *(p + m + 1);\n      for (j = 2; j < m; j++)\n        *(p + j - 1) = *(p + j);\n      for (i = 2; i < m; i++) {\n        *(p + (i - 1) * (m - 1)) = *(p + i * m);\n        for (j = 2; j < m; j++)\n          *(p + (i - 1) * (m - 1) + j - 1) = *(p + i * m + j);\n      }\n      m--;\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33828", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nvoid shuru(int);\nvoid guiling(int);\n\nint num[100][100] = {0};\nint sum = 0;\n\nint main() {\n  int n = 0;\n  int i = 0;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    shuru(n);\n  }\n\n  return 0;\n}\n\nvoid shuru(int n) {\n  int i = 0;\n  int j = 0;\n\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> num[i][j];\n\n  guiling(n);\n}\n\nvoid guiling(int n) {\n  if (n == 1)\n    cout << sum << endl;\n  else {\n    int min = 0;\n\n    int t = 0;\n    int i = 0;\n\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[i][t])\n          min = num[i][t];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[i][t] -= min;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n\n      for (t = 0; t < n; t++) {\n        if (min > num[t][i])\n          min = num[t][i];\n      }\n\n      for (t = 0; t < n; t++) {\n        num[t][i] -= min;\n      }\n    }\n\n    sum += num[1][1];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[i][t - 1] = num[i][t];\n\n    for (i = 0; i < n; i++)\n      for (t = 2; t < n; t++)\n        num[t - 1][i] = num[t][i];\n\n    guiling(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint func(int a[100][100], int rank, int sum) {\n  if (rank == 1)\n    return (sum);\n  int i, j, k, min = 1000;\n  for (i = 0; i <= rank - 1; i++) {\n    for (j = 0; j <= rank - 1; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= rank - 1; j++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  for (j = 0; j <= rank - 1; j++) {\n    for (i = 0; i <= rank - 1; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= rank - 1; i++)\n      a[i][j] -= min;\n    min = 1000;\n  }\n  sum += a[1][1];\n  for (j = 1; j <= rank - 2; j++)\n    a[0][j] = a[0][j + 1];\n  for (i = 1; i <= rank - 2; i++)\n    a[i][0] = a[i + 1][0];\n  for (i = 1; i <= rank - 2; i++) {\n    for (j = 1; j <= rank - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  func(a, rank - 1, sum);\n}\nint main() {\n  int n, i, j, k;\n  int matrix[100][100] = {{0}}, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> matrix[i][j];\n    }\n    printf(\"%d\\n\", func(matrix, n, sum));\n  }\n}\n"}
{"label": "18", "index": "33830", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100] = {0};\n  int min[100][100] = {0};\n  int n, i, j, k, l, s, sum[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[i][j][k]);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (s = n; s > 1; s--) {\n      for (j = 0; j < s; j++) {\n        min[i][j] = a[i][j][0];\n        for (l = 0; l < s; l++) {\n          if (a[i][j][l] < min[i][j])\n            min[i][j] = a[i][j][l];\n        }\n        for (k = 0; k < s; k++)\n          a[i][j][k] = a[i][j][k] - min[i][j];\n      }\n      for (k = 0; k < s; k++) {\n        min[i][k] = a[i][0][k];\n        for (l = 0; l < s; l++) {\n          if (a[i][l][k] < min[i][k])\n            min[i][k] = a[i][l][k];\n        }\n        for (j = 0; j < s; j++)\n          a[i][j][k] = a[i][j][k] - min[i][k];\n      }\n      sum[i] = sum[i] + a[i][1][1];\n      for (j = 0; j < s; j++) {\n        for (k = 1; k < s - 1; k++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n      for (k = 0; k < s - 1; k++) {\n        for (j = 1; j < s - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      }\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33831", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int min, n, i, j, ans, t;\n  int a[101][101];\n\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[i][j] < min))\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < t; i++) {\n        min = 10000;\n        for (j = 0; j < t; j++)\n          if ((a[j][i] < min))\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] = a[j][i] - min;\n      }\n      ans = ans + a[1][1];\n\n      for (i = 1; i < t - 1; i++)\n        for (j = 0; j < t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 0; i < t - 1; i++)\n        for (j = 1; j < t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33832", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint func(int a[100][100], int n);\nint main() {\n  int n, j, k, i;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    memset(a, 0, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    sum = 0;\n    cout << func(a, n) << endl;\n  }\n  return 0;\n}\nint func(int a[100][100], int n) {\n  int i, j, min, b[100][100];\n  if (n <= 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      min = a[i][0];\n      for (j = 0; j < n; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n    }\n    for (i = 0; i < n; i++) {\n      min = a[0][i];\n      for (j = 0; j < n; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n    sum += a[1][1];\n    for (i = 2; i < n; i++) {\n      for (j = 0; j < n - 1; j++)\n        b[i - 1][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        b[j][i - 1] = a[j + 1][i];\n    }\n    for (j = 1; j < n - 1; j++)\n      b[0][j] = a[0][j + 1];\n    for (j = 1; j < n - 1; j++)\n      b[j][0] = a[j + 1][0];\n    b[0][0] = a[0][0];\n    func(b, n - 1);\n  }\n}\n"}
{"label": "18", "index": "33833", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint f(int n, int a[101][101]) {\n  int i, j, min, k;\n  for (i = 1; i <= n; i++) {\n    min = a[i][1];\n    for (j = 1; j <= n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 1; j <= n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 1; i <= n; i++) {\n    min = a[1][i];\n    for (j = 1; j <= n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 1; j <= n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[2][2];\n  else {\n    k = a[2][2];\n    for (i = 3; i <= n; i++) {\n      a[1][i - 1] = a[1][i];\n      a[i - 1][1] = a[i][1];\n    }\n    for (i = 3; i <= n; i++)\n      for (j = 3; j <= n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    n--;\n    return k + f(n, a);\n  }\n}\nint main() {\n  int a[101][101] = {0}, n, i, j, k;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        scanf(\"%d \", &a[i][j]);\n    printf(\"%d\\n\", f(n, a));\n    memset(a, 0, sizeof(a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33834", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[101][101], i, j, c, sum = 0, k, n, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (c = n; c > 1; c--) {\n      for (i = 0; i < c; i++) {\n        min = 100000;\n        for (j = 0; j < c; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < c; j++) {\n        min = 100000;\n        for (i = 0; i < c; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < c; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < c - 1; i++) {\n        for (j = 0; j < c; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (j = 1; j < c; j++)\n        for (i = 0; i < c - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nint (*p)[101] = a;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p + i));\n    for (int j = 1; j < k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + i) + j) -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p) + i);\n    for (int j = 1; j < k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + j) + i) -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++)\n      *(*(p + i - 1) + j) = *(*(p + i) + j);\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      *(*(p + i) + j - 1) = *(*(p + i) + j);\n}\nint main() {\n  cin >> n;\n  while (cin >> *(*(p))) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> *(*(p + i) + j);\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += *(*(p + 1) + 1);\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, t, sum, m;\n  int a[100][100];\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (m > 1) {\n      for (i = 0; i < m; i++) {\n        t = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - t;\n        }\n      }\n      for (i = 0; i < m; i++) {\n        t = a[0][i];\n        for (j = 1; j < m; j++) {\n          if (a[j][i] < t) {\n            t = a[j][i];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          a[j][i] = a[j][i] - t;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m; i++) {\n        for (j = 1; j < m; j++) {\n          a[j][i] = a[j + 1][i];\n        }\n      }\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33837", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int(*p)[100];\n  int jz[100][100];\n  cin >> num;\n  int x = num;\n  int min = 9999;\n  p = jz;\n  for (int i = 1; i <= num; i++) {\n    x = num;\n    int sum = 0;\n    for (int k = 0; k < x; k++)\n      for (int j = 0; j < x; j++)\n        cin >> *(*(p + k) + j);\n\n    while (x >= 0) {\n\n      for (int k = 0; k < x; k++) {\n        for (int j = 0; j < x; j++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int j = 0; j < x; j++) {\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n        }\n        min = 9999;\n      }\n\n      for (int j = 0; j < x; j++) {\n        for (int k = 0; k < x; k++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int k = 0; k < x; k++)\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n\n        min = 9999;\n      }\n\n      if (x > 1)\n        sum = sum + *(*(p + 1) + 1);\n\n      for (int k = 0; k < x; k++)\n        for (int j = 1; j < x - 1; j++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      for (int j = 0; j < x; j++)\n        for (int k = 1; k < x - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n      x--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int a[100][100] = {0}, rmin[100] = {0}, cmin[100] = {0}, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n      cmin[i] = a[0][i];\n      rmin[i] = a[i][0];\n    }\n    for (int k = 0; k < n - 1; k++) {\n      for (int i = 0; i < n - k; i++) {\n        cmin[i] = a[0][i];\n        rmin[i] = a[i][0];\n      }\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (rmin[i] > a[i][j])\n            rmin[i] = a[i][j];\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[i][j] -= rmin[i];\n        }\n      }\n\n      for (int i = 0; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          if (cmin[i] > a[j][i]) {\n            cmin[i] = a[j][i];\n          }\n        }\n        for (int j = 0; j < n - k; j++) {\n          a[j][i] -= cmin[i];\n        }\n      }\n      sum += a[1][1];\n      for (int i = 2; i < n - k; i++) {\n        for (int j = 0; j < n - k; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (int j = 2; j < n - k; j++) {\n        for (int i = 0; i < n - k; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33839", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, a[102][102] = {0}, sum = 0;\n  cin >> n;\n\n  int i, j, k, cc;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> *(*(a + j) + k);\n      }\n    }\n    cc = n;\n\n    while (cc > 1) {\n      int min = 10000;\n      for (j = 1; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n        }\n        min = 10000;\n      }\n      sum += *(*(a + 2) + 2);\n\n      for (j = 3; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n        }\n      }\n      for (j = 1; j <= cc; j++) {\n        for (k = 3; k <= cc; k++) {\n          *(*(a + j) + k - 1) = *(*(a + j) + k);\n        }\n      }\n      cc--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33840", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k = k + 1) {\n    sum = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1) {\n        cin >> a[i][j];\n      }\n    for (l = n; l > 1; l = l - 1) {\n      for (i = 0; i < l; i = i + 1) {\n        min = a[i][0];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < l; i = i + 1) {\n        min = a[0][i];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      if (l != 2) {\n        for (i = 1; i < l; i = i + 1)\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        for (i = 1; i < l; i = i + 1)\n          for (j = 1; j < l; j = j + 1)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33841", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[104][104][104], n;\n  int i, j, t, k, m, s;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    s = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j][0];\n    for (k = 1; k < n; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        m = 100000;\n        for (j = 1; j <= n - k + 1; j++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j][k - 1] -= m;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        m = 100000;\n        for (i = 1; i <= n - k + 1; i++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j][k - 1] -= m;\n      }\n\n      s += a[2][2][k - 1];\n\n      for (i = 1; i <= n - k + 1; i++)\n        for (j = 1; j <= n - k + 1; j++) {\n          if (i == 1 && j == 1)\n            a[i][j][k] = a[i][j][k - 1];\n          if (i == 2 || j == 2)\n            continue;\n          if (i == 1 && j >= 3)\n            a[i][j - 1][k] = a[i][j][k - 1];\n          if (j == 1 && i >= 3)\n            a[i - 1][j][k] = a[i][j][k - 1];\n          if (i >= 3 && j >= 3)\n            a[i - 1][j - 1][k] = a[i][j][k - 1];\n        }\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "33842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min = 0, num;\n  int s[100][100];\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    num = 0;\n    memset(s, 0, sizeof(s));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(s + i) + j);\n    for (k = 0; k <= n - 2; k++) {\n      for (i = 1; i <= n - k; i++) {\n        min = s[i][1];\n        for (j = 1; j <= n - k; j++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (j = 1; j <= n - k; j++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - k; j++) {\n        min = s[1][j];\n        for (i = 1; i <= n - k; i++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (i = 1; i <= n - k; i++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      num += s[2][2];\n      for (i = 1; i <= n - k; i++)\n        for (j = 2; j <= n - k - 1; j++) {\n          *(*(s + i) + j) = *(*(s + i) + j + 1);\n        }\n      for (j = 1; j <= n - k; j++)\n        for (i = 2; i <= n - k - 1; i++)\n          *(*(s + i) + j) = *(*(s + i + 1) + j);\n    }\n    cout << num << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint calc(int s[][100], int n) {\n  int min;\n  for (int i = 0; i < n; i++) {\n    min = s[i][0];\n    for (int j = 1; j < n; j++) \n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int j = 0; j < n; j++) \n      s[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = s[0][j];\n    for (int i = 1; i < n; i++) \n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int i = 0; i < n; i++) \n      s[i][j] -= min;\n  }\n  return s[1][1]; \n}\n\nint main() {\n  int s[100][100];\n  int n, sum, m;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++) \n      for (int j = 0; j < n; j++)\n        cin >> s[i][j];\n    m = n;\n    sum = 0;\n    for (int order = 1; order < n; order++) {\n      sum += calc(s, m); \n      m--;\n      for (int i = 1; i < n - 1; i++) \n        for (int j = 0; j < n; j++)\n          s[i][j] = s[i + 1][j];\n      for (int j = 1; j < n - 1; j++) \n        for (int i = 0; i < m; i++)\n          s[i][j] = s[i][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33844", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, t, N;\n  cin >> n;\n  int jz[n][n][n], min, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> jz[k][i][j];\n      }\n    }\n  }\n\n  for (k = 0; k < n; k++) {\n    N = n;\n    sum = 0;\n    for (t = 1; t < n; t++) {\n      for (i = 0; i < N; i++) {\n        min = jz[k][i][0];\n        for (j = 0; j < N; j++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n      for (j = 0; j < N; j++) {\n        min = jz[k][0][j];\n        for (i = 0; i < N; i++) {\n          if (jz[k][i][j] < min)\n            min = jz[k][i][j];\n        }\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j] - min;\n        }\n      }\n\n      sum = sum + jz[k][1][1];\n\n      for (i = 1; i < N - 1; i++) {\n        for (j = 0; j < N; j++) {\n          jz[k][i][j] = jz[k][i + 1][j];\n        }\n      }\n\n      for (j = 1; j < N - 1; j++) {\n        for (i = 0; i < N; i++) {\n          jz[k][i][j] = jz[k][i][j + 1];\n        }\n      }\n      N--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[102][102] = {0}, sum = 0;\n  cin >> n;\n\n  int i, j, k, cc;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> *(*(a + j) + k);\n      }\n    }\n    cc = n;\n\n    while (cc > 1) {\n      int min = 10000;\n      for (j = 1; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n        }\n        min = 10000;\n      }\n      min = 10000;\n      for (j = 1; j <= n; j++) {\n        for (k = 1; k <= cc; k++) {\n          if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 1; k <= cc; k++) {\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n        }\n        min = 10000;\n      }\n      sum += *(*(a + 2) + 2);\n\n      for (j = 3; j <= cc; j++) {\n        for (k = 1; k <= cc; k++) {\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n        }\n      }\n      for (j = 1; j <= cc; j++) {\n        for (k = 3; k <= cc; k++) {\n          *(*(a + j) + k - 1) = *(*(a + j) + k);\n        }\n      }\n      cc--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33846", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\n\nint sum(int[100][100], int);\n\nint main() {\n  int n, k, i, j;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) {\n  int p, i, j, min;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (min > a[j][i])\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  p = a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  return p + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "33847", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s[100][100], n, j, k, p, min, count1 = 0, l = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    count1 = 0;\n    l = 0;\n    for (j = 0; j < n; j++)\n      for (p = 0; p < n; p++)\n        cin >> *(*(s + j) + p);\n    for (k = 1; k < n; k++) {\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s + j) + 0);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + j) + p) < min)\n            min = *(*(s + j) + p);\n        }\n        for (p = 0; p < n - l; p++) {\n          *(*(s + j) + p) = *(*(s + j) + p) - min;\n        }\n      }\n      for (j = 0; j < n - l; j++) {\n        min = *(*(s) + j);\n        for (p = 0; p < n - l; p++) {\n          if (*(*(s + p) + j) < min)\n            min = *(*(s + p) + j);\n        }\n\n        for (p = 0; p < n - l; p++) {\n          *(*(s + p) + j) = *(*(s + p) + j) - min;\n        }\n      }\n      count1 += (*(*(s + 1) + 1));\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + j) + p) = *(*(s + j) + p + 1);\n      for (j = 0; j < n - l; j++)\n        for (p = 1; p < n - 1 - l; p++)\n          *(*(s + p) + j) = *(*(s + p + 1) + j);\n      l++;\n    }\n    cout << count1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33848", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint f(int n) {\n  int i, j;\n  int r = 0, l = 0;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      r = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (r > a[i][j])\n          r = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - r;\n    }\n    for (j = 0; j < n; j++) {\n      l = a[0][j];\n      for (i = 1; i < n; i++) {\n        if (l > a[i][j])\n          l = a[i][j];\n      }\n      for (i = 0; i < n; i++) {\n        a[i][j] = a[i][j] - l;\n      }\n    }\n    int m;\n    m = a[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 0; j < n; j++)\n      for (i = 1; i < n - 1; i++)\n        a[i][j] = a[i + 1][j];\n    return m + f(n - 1);\n  }\n}\nint main() {\n  int n;\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    int sum = 0;\n    sum = f(n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[103][103];\nint FindMin(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[x][i] < ret)\n      ret = a[x][i];\n  return ret;\n}\nint FindMin1(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[i][x] < ret)\n      ret = a[i][x];\n  return ret;\n}\nint main() {\n  int n, q;\n  scanf(\"%d \", &n);\n  int sum = 0;\n  q = n;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    q = n;\n    for (int h = 0; h < n; h++)\n      for (int l = 0; l < n; l++)\n        cin >> a[h][l];\n    while (1) {\n      if (q == 1) {\n        printf(\"%d\\n\", sum);\n        break;\n      }\n\n      int t;\n      for (int i = 0; i < q; i++) {\n        t = FindMin(i, q);\n        for (int j = 0; j < q; j++)\n          a[i][j] -= t;\n      }\n      for (int j = 0; j < q; j++) {\n        t = FindMin1(j, q);\n        for (int i = 0; i < q; i++)\n          a[i][j] -= t;\n      }\n      sum += a[1][1];\n\n      for (int i = 1; i < q - 1; i++)\n        for (int j = 0; j < q; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < q - 1; j++)\n        for (int i = 0; i < q; i++)\n          a[i][j] = a[i][j + 1];\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33850", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint GL(int n, int a[][101]);     \nint Delete(int n, int a[][101]); \nint min(int a, int b);           \n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k; \n\n  cin >> n; \n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) \n    {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n\n    Sum[i] = GL(n, a); \n  }\n\n  for (i = 0; i < n; i++)\n    cout << Sum[i] << endl; \n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum, i, j, MIN;\n\n  for (i = 0; i < n; i++) \n  {\n    MIN = a[i][0];\n    for (j = 1; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  for (j = 0; j < n; j++) \n  {\n    MIN = a[0][j];\n    for (i = 1; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - MIN;\n  }\n\n  Sum = a[1][1]; \n\n  if (n != 2) \n  {\n    Delete(n, a);\n    Sum = Sum + GL(n - 1, a);\n    return Sum;\n  }\n\n  else\n    return Sum; \n}\n\nint min(int a, int b) \n{\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\n\nint Delete(int n, int a[][101]) \n{\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33851", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint guiling(int count);  \nint xiaojian(int count); \n\nint n;           \nint a[101][101]; \nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (int count = n; count > 1; count--) \n    {\n      guiling(count);  \n      sum += a[1][1];  \n      xiaojian(count); \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint guiling(int count) \n{\n  int j, k;\n  for (j = 0; j < count; j++) {\n    int min = a[j][0];          \n    for (k = 1; k < count; k++) \n    {\n      if (min > a[j][k]) {\n        min = a[j][k];\n      }\n    }\n    for (k = 0; k < count; k++) \n    {\n      a[j][k] -= min;\n    }\n  }\n  for (k = 0; k < count; k++) \n  {\n    int min = a[0][k];\n    for (j = 1; j < count; j++) {\n      if (min > a[j][k]) {\n        min = a[j][k];\n      }\n    }\n    for (j = 0; j < count; j++) \n    {\n      a[j][k] -= min;\n    }\n  }\n}\n\nint xiaojian(int count) \n{\n  int j, k;\n  for (j = 1; j < count - 1; j++) \n  {\n    a[0][j] = a[0][j + 1];\n    a[j][0] = a[j + 1][0];\n    for (k = 1; k < count - 1; k++) {\n      a[j][k] = a[j + 1][k + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33852", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0;\n  while (i < n) {\n    int a[n][n];\n    int b[n], c[n];\n    int t = 1;\n    int j, k;\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    while (t < n) {\n      for (j = 0; j < n; j++) {\n        if (a[j][0] < 0)\n          j++;\n        b[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (b[j] > a[j][k] && a[j][k] >= 0)\n            b[j] = a[j][k];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (a[j][k] >= 0) {\n            a[j][k] = a[j][k] - b[j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        if (a[0][j] < 0)\n          j++;\n        c[j] = a[0][j];\n        for (k = 0; k < n; k++) {\n          if (c[j] > a[k][j] && a[k][j] >= 0)\n            c[j] = a[k][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (a[k][j] >= 0) {\n            a[k][j] = a[k][j] - c[j];\n          }\n      }\n      sum = sum + a[t][t];\n      for (j = 0; j < n; j++) {\n        a[t][j] = -1;\n        a[j][t] = -1;\n      }\n      t++;\n    }\n    i++;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33853", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, a[100][100], b[100], c[100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    c[k] = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        b[i] = a[i][0];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[i][j])\n            b[i] = a[i][j];\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (i = 0; i < m; i++) {\n        b[i] = a[0][i];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[j][i])\n            b[i] = a[j][i];\n        for (j = 0; j < m; j++)\n          a[j][i] = a[j][i] - b[i];\n      }\n      c[k] += a[1][1];\n      for (i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (k = 0; k < n; k++)\n    printf(\"%d\\n\", c[k]);\n  return 0;\n}\n"}
{"label": "18", "index": "33854", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, mini;\nint a[110][110];\nvoid findmin(int x, int y, int dx, int dy) {\n  if (x == m)\n    return;\n  if (y == m)\n    return;\n  if (a[x][y] < mini)\n    mini = a[x][y];\n  findmin(x + dx, y + dy, dx, dy);\n  a[x][y] = a[x][y] - mini;\n}\nvoid kill() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  }\n}\nint main() {\n  int i, j, sum, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mini = 10000;\n        findmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + a[1][1];\n      kill();\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ml(int a[101], int m);\n  void guiling(int a[101][101], int m);\n  void xiaojian(int a[101][101], int m);\n  int n;\n  int i, j, k;\n  int sum;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = 0;\n    for (j = n; j > 1; j--) {\n\n      guiling(a, j);\n      sum = sum + a[1][1];\n      xiaojian(a, j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n\nint ml(int a[101], int m) {\n  int i;\n  int n = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] < n)\n      n = a[i];\n  }\n  return n;\n}\n\nvoid guiling(int a[101][101], int m) {\n  int ml(int a[101], int m);\n  int i, j;\n  int minc, minl;\n  for (i = 0; i < m; i++) {\n    minl = ml(a[i], m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - minl;\n    }\n  }\n  for (j = 0; j < m; j++) {\n    minc = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < minc) {\n        minc = a[i][j];\n      }\n    }\n    for (i = 0; i < m; i++)\n      a[i][j] = a[i][j] - minc;\n  }\n}\n\nvoid xiaojian(int a[101][101], int m) {\n  int i, j;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      for (j = 1; j < m - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (j = 0; j < m - 1; j++) {\n      for (i = 1; i < m - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "33856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint minih(int numh, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numh; i++) {\n    if (min > *(p + i - 1)) {\n      min = *(p + i - 1);\n    } else {\n    }\n  }\n  return min;\n}\nint minil(int numl, int *p) {\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numl; i++) {\n    if (min > *(p + 101 * (i - 1)))\n      min = *(p + 101 * (i - 1));\n    else {\n    }\n  }\n  return min;\n}\nint main() {\n  int a[101][101];\n  int *p;\n  p = &a[0][0];\n  int i, j, k, n;\n  int minor;\n  int sum;\n  scanf(\"%d\", &n);\n  int hang, lie;\n  for (i = 1; i <= n; i++) {\n\n    hang = n;\n    lie = n;\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", p + 101 * (j - 1) + k - 1);\n      }\n    }\n\n    for (minor = 1; lie > 1; minor++) {\n\n      for (j = 1; j <= hang; j++) {\n        int minihang;\n\n        minihang = minih(lie, (p + 101 * (j - 1)));\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) -= minihang;\n        }\n      }\n\n      for (j = 1; j <= lie; j++) {\n        int minilie;\n\n        minilie = minil(hang, (p + (j - 1)));\n        for (k = 1; k <= hang; k++) {\n          *(p + (j - 1) + 101 * (k - 1)) -= minilie;\n        }\n      }\n      sum += *(p + 102);\n\n      for (j = 2; j <= hang; j++) {\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) = *(p + 101 * j + k - 1);\n        }\n      }\n      hang--;\n\n      for (j = 2; j <= lie; j++) {\n        for (k = 1; k <= hang; k++) {\n          *(p + 101 * (k - 1) + j - 1) = *(p + 101 * (k - 1) + j);\n        }\n      }\n      lie--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33857", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num, i, j, sum;\n  cin >> num;\n  int n = num, min, t = num;\n  while (num > 0) {\n    n = t;\n    int a[n][n];\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < n; i++) {\n        min = a[0][i];\n        for (j = 0; j < n; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < n; j++)\n          a[j][i] = a[j][i] - min;\n      }\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[i][j] = a[i][j + 1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n; j++)\n          a[j][i] = a[j + 1][i];\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    num--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33858", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, p, s = 0, sum;\n  cin >> n;\n  int a[n][n];\n\n  for (s = 0; s < n; s++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        p = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] <= p)\n            p = a[i][j];\n        }\n        for (j = 0; j < n - k; j++)\n          a[i][j] = a[i][j] - p;\n      }\n\n      for (j = 0; j < n - k; j++) {\n        p = a[0][j];\n        for (i = 0; i < n - k; i++) {\n          if (a[i][j] <= p) {\n            p = a[i][j];\n          }\n        }\n        for (i = 0; i < n - k; i++)\n          a[i][j] = a[i][j] - p;\n      }\n      sum = a[1][1] + sum;\n      for (i = 1; i < n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - k - 1; j++)\n        for (i = 0; i < n - k - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    if (sum == 199)\n      cout << sum - 1 << endl;\n    else\n      cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33859", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int sum = 0, s[100][100], i, t, j, m, n, k, min;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &s[j][k]);\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[k][0];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[k][t] < min)\n              min = s[k][t];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[k][t] -= min;\n          }\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[0][k];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[t][k] < min)\n              min = s[t][k];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[t][k] -= min;\n          }\n        }\n      }\n      sum += s[j][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33860", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], b[100], c[100];\nint xiao(int n) {\n  int x;\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[i]][c[j]] < min)\n        min = a[b[i]][b[j]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[i]][c[j]] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[j]][c[i]] <= min)\n        min = a[b[j]][b[i]];\n    }\n    for (int j = 0; j < n; j++)\n      a[b[j]][c[i]] -= min;\n  }\n  x = a[b[1]][c[1]];\n  if (n > 2) {\n    for (int i = 1; i < n - 1; i++) {\n      b[i] = b[i + 1];\n      c[i] = c[i + 1];\n    }\n    return (x + xiao(n - 1));\n  } else\n    return x;\n}\nint main() {\n  int n;\n\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    for (int i = 0; i < n; i++) {\n      b[i] = c[i] = i;\n    }\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33861", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], mini = INT_MAX, sum = 0;\n  cin >> n;\n  for (int c = 1; c <= n; c++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[i][j]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[i][l] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[j][i]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[l][i] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      sum += a[1][1];\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 1; j <= n - k - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (int j = 0; j <= n - k - 1; j++) {\n        for (int i = 1; i <= n - k - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33862", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid suo(int b[101][101], int n) {\n  int row = 0, l = 0;\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      b[i][j] = b[i + 1][j];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++)\n      b[i][j] = b[i][j + 1];\n  return;\n}\n\nint square(int a[101][101], int n) {\n  if (n == 1)\n    return 0;\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int t = a[1][1];\n  int sum = 0;\n  suo(a, n);\n  sum = t + square(a, n - 1);\n  return sum;\n}\nint main() {\n  int i, n, k, j, m[101][101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &m[j][k]);\n    printf(\"%d\\n\", square(m, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[200][200], x, p, q, min, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    for (x = n; x >= 2; x--) {\n      for (p = 1; p <= x; p++) {\n        min = 10000;\n        for (q = 1; q <= x; q++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (q = 1; q <= x; q++)\n          a[p][q] = a[p][q] - min;\n      }\n      for (q = 1; q <= x; q++) {\n        min = 10000;\n        for (p = 1; p <= x; p++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (p = 1; p <= x; p++)\n          a[p][q] = a[p][q] - min;\n      }\n      sum = sum + a[2][2];\n      for (p = 1; p <= x; p++)\n        for (q = 2; q <= x - 1; q++)\n          a[p][q] = a[p][q + 1];\n      for (q = 1; q <= x - 1; q++)\n        for (p = 2; p <= x - 1; p++)\n          a[p][q] = a[p + 1][q];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33864", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint sum = 0, n;\nvoid GuiLing(int num[][100], int n, int move);\nvoid XiaoJian(int num[][100], int move);\nint main() {\n  int i, j, t, num[100][100];\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    XiaoJian(num, 0);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid XiaoJian(int num[][100], int move) \n{\n  if (move == n - 1) \n  {\n    ;\n  } else {\n    GuiLing(num, n, move); \n    sum = sum + num[move + 1][move + 1];\n    XiaoJian(num, move + 1); \n  }\n}\nvoid GuiLing(int num[][100], int n, int move) {\n  int i, j, min;\n  \n  for (i = 0; i < n; i++) {\n    if ((move != 0) && ((i >= 1) && (i <= move)))\n      continue; \n    min = num[i][0];\n    for (j = 1; j < n; j++) {\n      if ((move != 0) && ((j >= 1) && (j <= move)))\n        continue; \n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (j = 0; j < n; j++) {\n        if ((move != 0) && ((j >= 1) && (j <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n  \n  for (j = 0; j < n; j++) {\n    if ((move != 0) && ((j >= 1) && (j <= move)))\n      continue; \n    min = num[0][j];\n    for (i = 1; i < n; i++) {\n      if ((move != 0) && ((i >= 1) && (i <= move)))\n        continue; \n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    if (min != 0) {\n      for (i = 0; i < n; i++) {\n        if ((move != 0) && ((i >= 1) && (i <= move)))\n          continue;\n        num[i][j] = num[i][j] - min;\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "33865", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, k, i, j, n, a[101][101], sum, min;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    t = n;\n    sum = 0;\n    while (t > 1) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 0; j < t; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        min = a[0][j];\n        for (i = 0; i < t; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < t; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < t - 1; i++) {\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < t - 1; j++) {\n        for (i = 0; i < t + 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      t--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint mx[200][200];\nint nn, n, ans;\nint main() {\n  cin >> nn;\n  for (int q = 1; q <= nn; q++) {\n    ans = 0;\n    n = nn;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> mx[i][j];\n      }\n    }\n    for (; n >= 2; n--) {\n      int smin;\n      for (int i = 1; i <= n; i++) {\n        smin = mx[i][1];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[i][j] ? smin : mx[i][j];\n        for (int j = 1; j <= n; j++)\n          mx[i][j] -= smin;\n      }\n      for (int i = 1; i <= n; i++) {\n        smin = mx[1][i];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[j][i] ? smin : mx[j][i];\n        for (int j = 1; j <= n; j++)\n          mx[j][i] -= smin;\n      }\n      ans += mx[2][2];\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[i][j] = mx[i][j + 1];\n      }\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[j][i] = mx[j + 1][i];\n      }\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33867", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, k, rec, sum;\nint x[150][150];\n\nvoid F() {\n  int p, q, min;\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + p) + 1));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + p) + q)) < min) ? (*(*(x + p) + q)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + p) + q)) -= min;\n  }\n  for (p = 1; p <= rec; p++) {\n    min = (*(*(x + 1) + p));\n    for (q = 1; q <= rec; q++)\n      min = ((*(*(x + q) + p)) < min) ? (*(*(x + q) + p)) : min;\n    for (q = 1; q <= rec; q++)\n      (*(*(x + q) + p)) -= min;\n  }\n  sum += (*(*(x + 2) + 2));\n  for (p = 2; p < rec; p++)\n    (*(*(x + 1) + p)) = (*(*(x + 1) + p + 1));\n  for (p = 2; p < rec; p++)\n    (*(*(x + p) + 1)) = (*(*(x + p + 1) + 1));\n  for (p = 2; p < rec; p++) {\n    for (q = 2; q < rec; q++)\n      (*(*(x + p) + q)) = (*(*(x + p + 1) + q + 1));\n  }\n  return;\n}\n\nint main() {\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    rec = n;\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> (*(*(x + i) + j));\n    while (rec > 1) {\n      F();\n      rec--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33868", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200] = {{0}, {0}}, i, j = 0, sum, q = 0, k, n, m, s;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    for (s = 0; s < n; s++) {\n\n      for (i = 1; i <= n - s; i++) {\n        m = a[i][1];\n        for (j = 1; j <= n - s; j++) {\n          if (a[i][j] < m)\n            m = a[i][j];\n        }\n        for (j = 1; j <= n - s; j++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      for (j = 1; j <= n - s; j++) {\n        m = a[1][j];\n        for (i = 1; i <= n - s; i++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (i = 1; i <= n - s; i++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - s; i++) {\n        for (j = 2; j <= n; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (j = 1; j <= n - s; j++) {\n        for (i = 2; i <= n; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid make_zero(int a[100][100], int);\nvoid reduce(int a[100][100], int);\nint min(int a[100][100], int i, int p, int flag);\n\nint main() {\n  int n, a[100][100], sum;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (int p = n - 1; p > 0; p--) {\n      make_zero(a, p);\n      sum += a[1][1];\n      reduce(a, p);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid make_zero(int a[100][100], int p) {\n  int flag = 0, m;\n  for (int i = 0; i <= p; i++) {\n    m = min(a, i, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[i][j] -= m;\n    }\n  }\n  flag = 1;\n  for (int k = 0; k <= p; k++) {\n    m = min(a, k, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[j][k] -= m;\n    }\n  }\n}\n\nvoid reduce(int a[100][100], int p) {\n  for (int i = 0; i <= p; i++) {\n    for (int j = 1; j < p; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int k = 0; k < p; k++) {\n    for (int j = 1; j < p; j++) {\n      a[j][k] = a[j + 1][k];\n    }\n  }\n}\n\nint min(int a[100][100], int i, int p, int flag) {\n  int t;\n  if (flag == 0) {\n    t = a[i][0];\n    for (int j = 0; j <= p; j++) {\n      if (a[i][j] < t)\n        t = a[i][j];\n    }\n  } else {\n    t = a[0][i];\n    for (int j = 0; j <= p; j++) {\n      if (a[j][i] < t)\n        t = a[j][i];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "33870", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, k, l, min, sum = 0, j;\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (k = n;; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = a[0][i];\n        for (j = 0; j < k; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < k; j++)\n          a[j][i] -= min;\n      }\n      sum += a[1][1];\n      if (k == 2)\n        break;\n      for (i = 1; i <= k - 2; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j <= k - 2; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "18", "index": "33871", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, max, sum, m;\n  int a[110][110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    m = n;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    for (m = n; m > 1; m--) {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k)\n            min = *(*(a + j) + k);\n          else if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 0; k < m; k++)\n          *(*(a + j) + k) -= min;\n      }\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + k) + j);\n          } else if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + k) + j) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (j = 2; j < m; j++)\n        *(*a + j - 1) = *(*a + j);\n      for (j = 2; j < m; j++)\n        *(*(a + j - 1)) = *(*(a + j));\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + j - 1) + k - 1) = *(*(a + j) + k);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33872", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\n\nint q[100][100];\n\nvoid op(int n) {\n  if (n != 1) {\n    int rm[n], cm[n];\n    for (int i = 0; i < n; i++) {\n      rm[i] = q[i][0];\n      cm[i] = q[0][i];\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (rm[i] >= q[i][j]) {\n          rm[i] = q[i][j];\n        }\n      }\n    }\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - rm[i];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (cm[j] >= q[i][j]) {\n          cm[j] = q[i][j];\n        }\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i][j] - cm[j];\n      }\n    }\n\n    sum += q[1][1];\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n; j++) {\n        q[i][j] = q[i][j + 1];\n      }\n    }\n    for (int i = 1; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        q[i][j] = q[i + 1][j];\n      }\n    }\n    op(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int s = 1; s <= n; s++) {\n    for (int a = 0; a < n; a++) {\n      for (int b = 0; b < n; b++) {\n        cin >> q[a][b];\n      }\n    }\n    op(n);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33873", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m, n, sum, min;\n  int a[101][101];\n  scanf(\"%d\", &n);\n  for (m = 0; m < n; m++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i - 1][j] = a[i][j];\n      for (j = 2; j < k; j++)\n        for (i = 0; i < k - 1; i++)\n          a[i][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33874", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint sum = 0, r_small[100] = {0}, c_small[100] = {0};\n\nint fun(int num[][100], int n);\n\nvoid small1(int num[][100], int n);\n\nvoid small2(int num[][100], int n);\n\nint main() {\n  int n, i, j, num[100][100];\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    fun(num, n);\n    cout << sum << endl;\n    sum = 0; \n  }\n  return 0;\n}\n\nint fun(int num[][100], int n) {\n  if (n == 1)\n    return sum;\n  int i, j;\n  small1(num, n); \n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      num[i][j] = num[i][j] - r_small[i]; \n  small2(num, n);                         \n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      num[i][j] = num[i][j] - c_small[j]; \n  sum += num[1][1];                       \n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      num[i][j] = num[i][j + 1]; \n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      num[i][j] = num[i + 1][j];\n  fun(num, n - 1); \n}\n\nvoid small1(int num[][100], int n) \n{\n  int i, j;\n  for (i = 0; i < n; i++) {\n    r_small[i] = num[i][0];\n    for (j = 1; j < n; j++)\n      r_small[i] = (r_small[i] < num[i][j]) ? r_small[i] : num[i][j];\n  }\n}\n\nvoid small2(int num[][100], int n) \n{\n  int i, j;\n  for (j = 0; j < n; j++) {\n    c_small[j] = num[0][j];\n    for (i = 1; i < n; i++)\n      c_small[j] = (c_small[j] < num[i][j]) ? c_small[j] : num[i][j];\n  }\n}\n"}
{"label": "18", "index": "33875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100], s = 0;\nvoid juzhen(int x) {\n\n  for (int i = 0; i < x; i++) {\n    int m = a[i][0];\n    for (int j = 1; j < x; j++)\n\n      if (a[i][j] < m)\n        m = a[i][j];\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i][j] - m;\n  }\n  for (int i = 0; i < x; i++) {\n    int m = a[0][i];\n    for (int j = 1; j < x; j++)\n\n      if (a[j][i] < m)\n        m = a[j][i];\n    for (int j = 0; j < x; j++)\n      a[j][i] = a[j][i] - m;\n  }\n  s = s + a[1][1];\n  if (x == 2) {\n    cout << s << endl;\n    return;\n  }\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x; j++)\n      a[i][j] = a[i + 1][j];\n  for (int i = 1; i < x - 1; i++)\n    for (int j = 0; j < x - 1; j++)\n      a[j][i] = a[j][i + 1];\n  juzhen(x - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n\n  for (int o = 1; o <= n; o++) {\n    s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(n);\n  }\n}\n"}
{"label": "18", "index": "33876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid r(int m);\nvoid l(int m);\nvoid fun(int m);\nvoid Try(int i);\nint a[100][100], n, s[100] = {0};\nint main() {\n  int i, j, k, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    Try(0);\n    for (j = 0; j < n - 1; j++)\n      sum = sum + s[j];\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid r(int m) {\n  int x, y, min;\n  for (x = 0; x < m; x++) {\n    min = a[x][0];\n    for (y = 0; y < m; y++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (y = 0; y < m; y++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid l(int m) {\n  int x, y, min;\n  for (y = 0; y < m; y++) {\n    min = a[0][y];\n    for (x = 0; x < m; x++) {\n      if (a[x][y] < min)\n        min = a[x][y];\n    }\n    for (x = 0; x < m; x++)\n      a[x][y] = a[x][y] - min;\n  }\n}\nvoid fun(int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 2; j < m; j++)\n      a[i][j - 1] = a[i][j];\n  }\n  for (j = 0; j < m - 1; j++) {\n    for (i = 2; i < m; i++)\n      a[i - 1][j] = a[i][j];\n  }\n}\nvoid Try(int i) {\n  r(n - i);\n  l(n - i);\n  s[i] = a[1][1];\n  fun(n - i);\n  if (i < n - 1)\n    Try(i + 1);\n}\n"}
{"label": "18", "index": "33877", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, i, j, min;\n\nvoid XJ(int a[][100], int n) {\n  int b[100][100] = {0};\n  b[0][0] = a[0][0];\n  for (i = 1; i < n - 1; i++) {\n    b[0][i] = a[0][i + 1];\n    b[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\n\nint MIN(int a[][100], int n, int sum) {\n  if (n == 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 0; j < n; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 0; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++) {\n        a[j][i] -= min;\n      }\n    }\n    sum += a[1][1];\n    XJ(a, n);\n    return MIN(a, n - 1, sum);\n  }\n}\n\nint main() {\n  int a[100][100] = {0}, k;\n  cin >> n;\n  int ii;\n  int jj;\n  for (ii = 0; ii < n; ii++) {\n\n    for (jj = 0; jj < n; jj++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[jj][k];\n      }\n    }\n    printf(\"%d\\n\", MIN(a, n, 0));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33878", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint cal(int a[100][101], int n) {\n  int i, j, k, min, t = 0, p, b[100][101] = {0};\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 1;\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  t = a[1][1];\n  b[0][0] = a[0][0];\n  if (n == 2)\n    return a[1][1];\n  for (i = 2; i < n; i++) {\n    b[i - 1][0] = a[i][0];\n    b[0][i - 1] = a[0][i];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      b[i - 1][j - 1] = a[i][j];\n    }\n  }\n  return t + cal(b, n - 1);\n}\nint main() {\n  int n, i, j, k, m, t, a[100][101] = {0}, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", cal(a, n));\n  }\n}\n"}
{"label": "18", "index": "33879", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint g_a;                \nint g_Matrix[100][100]; \n\nint Operation(int);  \nvoid lineDel(int);   \nvoid rowDel(int);    \nvoid Transform(int); \n\nvoid lineDel(int times)\n\n\n{\n  int i, j, min, post;         \n  for (i = 1; i <= times; i++) \n  {\n    min = g_Matrix[i][1]; \n    post = 1;\n    for (j = 1; j <= times; j++) \n    {\n      if (g_Matrix[i][j] < min) {\n        min = g_Matrix[i][j];\n        post = j;\n      }\n    }\n    g_Matrix[0][j] = 0; \n    for (j = 1; j <= times; j++) \n      g_Matrix[i][j] -= min;\n  }\n}\n\nvoid rowDel(int times)\n\n\n{\n  int i, j, min, post;         \n  for (j = 1; j <= times; j++) \n  {\n    if (g_Matrix[0][j]) \n    {\n      min = g_Matrix[1][j]; \n      post = 1;\n      for (i = 1; i <= times; i++) \n      {\n        if (g_Matrix[i][j] < min) {\n          min = g_Matrix[i][j];\n          post = i;\n        }\n      }\n      for (i = 1; i <= times; i++) \n        g_Matrix[i][j] -= min;\n    }\n  }\n}\n\nvoid Transform(int times)\n\n\n{\n  int i, j;\n  for (i = 1; i <= times; i++) \n  {                            \n    for (j = 1; j <= times; j++) {\n      if (i == 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i][j + 1]; \n      if (j == 1 && i > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j]; \n      if (i > 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j + 1]; \n    }\n  }\n}\n\nint Operation(int times)\n\n\n\n{\n  int j, num;\n  if (times != 1) \n  {\n    for (j = 1; j <= times; j++) \n      g_Matrix[0][j] = 1;\n    lineDel(times);                    \n    rowDel(times);                     \n    num = g_Matrix[2][2];              \n    Transform(times - 1);              \n    return num + Operation(times - 1); \n  } else\n    return 0; \n}\n\nint main() {\n  int n, i, j;\n  cin >> n;\n  g_a = n;\n  while (n--) {\n    for (i = 1; i <= g_a; i++) \n      for (j = 1; j <= g_a; j++)\n        cin >> g_Matrix[i][j];\n    cout << Operation(g_a) << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33880", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid suo(int b[101][101], int n) {\n  int row = 0, l = 0;\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      b[i][j] = b[i + 1][j];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++)\n      b[i][j] = b[i][j + 1];\n  return;\n}\n\nint square(int a[101][101], int n) {\n  if (n == 1)\n    return 0;\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int t = a[1][1];\n  int sum = 0;\n  suo(a, n);\n  sum = t + square(a, n - 1);\n  return sum;\n}\nint main() {\n  int i, n, k, j, m[101][101];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> m[j][k];\n    printf(\"%d\\n\", square(m, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[100][100], j, k, min, number = 0, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    m = n;\n    number = 0;\n    while (m != 1) {\n      for (j = 0; j < m; j++) {\n        min = *(*(a + j) + 0);\n        for (k = 1; k < m; k++)\n          min = (min > *(*(a + j) + k)) ? *(*(a + j) + k) : min;\n\n        for (k = 0; k < m; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = *(*(a) + j);\n        for (k = 1; k < m; k++) {\n          min = (min > *(*(a + k) + j)) ? *(*(a + k) + j) : min;\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n        }\n      }\n      number = number + *(*(a + 1) + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + 0) + j) = *(*(a + 0) + j + 1);\n      for (j = 1; j < m; j++)\n        *(*(a + j) + 0) = *(*(a + j + 1) + 0);\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + k - 1) + j - 1) = *(*(a + k) + j);\n      m = m - 1;\n    }\n    printf(\"%d\\n\", number);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33882", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0, m = 0;\n  cin >> n;\n\n  for (t = 0; t < n; t++) {\n    int arr[100][100];\n    int i = 0, j = 0, k = 0, sum = 0, m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> arr[i][j];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        int min = arr[j][0];\n        for (k = 0; k < m; k++)\n          if (arr[j][k] < min)\n            min = arr[j][k];\n        for (k = 0; k < m; k++)\n          arr[j][k] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        int min = arr[0][j];\n        for (k = 0; k < m; k++)\n          if (arr[k][j] < min)\n            min = arr[k][j];\n        for (k = 0; k < m; k++)\n          arr[k][j] -= min;\n      }\n      sum += arr[1][1];\n      for (j = 2; j < m; j++) {\n        arr[0][j - 1] = arr[0][j];\n        arr[j - 1][0] = arr[j][0];\n      }\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          arr[j - 1][k - 1] = arr[j][k];\n\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33883", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int num;\n  int(*p)[100];\n  int jz[100][100];\n  cin >> num;\n  int x = num;\n  int min = 9999;\n  p = jz;\n  for (int i = 1; i <= num; i++) {\n    x = num;\n    int sum = 0;\n    for (int k = 0; k < x; k++)\n      for (int j = 0; j < x; j++)\n        cin >> *(*(p + k) + j);\n\n    while (x >= 0) {\n\n      for (int k = 0; k < x; k++) {\n        for (int j = 0; j < x; j++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int j = 0; j < x; j++) {\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n        }\n        min = 9999;\n      }\n\n      for (int j = 0; j < x; j++) {\n        for (int k = 0; k < x; k++) {\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        }\n        for (int k = 0; k < x; k++) {\n          *(*(p + k) + j) = *(*(p + k) + j) - min;\n        }\n        min = 9999;\n      }\n\n      if (x > 1)\n        sum = sum + *(*(p + 1) + 1);\n\n      for (int k = 0; k < x; k++)\n        for (int j = 1; j < x - 1; j++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      for (int j = 0; j < x; j++)\n        for (int k = 1; k < x - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n      x--;\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33884", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint min(int x, int y) {\n  int z;\n  if (x > y)\n    z = y;\n  else {\n    z = x;\n  }\n  return (z);\n}\nint main() {\n  int n, m, k, i, j, a[101][101], s[101], sum;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 1; i <= n - k + 1; i++) {\n        s[i] = a[i][1];\n        for (j = 1; j <= n - k + 1; j++)\n          s[i] = min(a[i][j], s[i]);\n      }\n      for (i = 1; i <= n - k + 1; i++) {\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j] = a[i][j] - s[i];\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        s[j] = a[1][j];\n        for (i = 1; i <= n - k + 1; i++)\n          s[j] = min(a[i][j], s[j]);\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j] = a[i][j] - s[j];\n      }\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - k + 1; i++) {\n        if ((n - k + 1) >= 3)\n          for (j = 3; j <= n - k + 1; j++)\n            a[i][j - 1] = a[i][j];\n        else\n          break;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        if ((n - k + 1) >= 3)\n          for (i = 3; i <= n - k + 1; i++)\n            a[i - 1][j] = a[i][j];\n        else\n          break;\n      }\n    }\n    cout << \"\\n\" << sum;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33885", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[100][100];\n  cin >> n;\n  int(*p)[100] = num;\n  for (int k = 0; k < n; k++) {\n    int sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int i = 0; i < m; i++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      sum += num[1][1];\n      for (int i = 1; i < m - 1; i++)\n        *(*(p + i) + 0) = *(*(p + i + 1) + 0);\n      for (int j = 1; j < m - 1; j++)\n        *(*(p + 0) + j) = *(*(p + 0) + j + 1);\n      for (int i = 2; i < m; i++) {\n        for (int j = 2; j < m; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n      }\n      m--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33886", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, k, j, p, q, a[110][110] = {0}, Min, sum;\nint get() {\n  for (p = 0; p < n - 1; p++) {\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[k][j])\n          Min = a[k][j];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[k][j] -= Min;\n      }\n    }\n    for (k = 0; k < q; k++) {\n      Min = 99999999;\n      for (j = 0; j < q; j++) {\n        if (Min > a[j][k])\n          Min = a[j][k];\n      }\n      if (Min != 0) {\n        for (j = 0; j < q; j++)\n          a[j][k] -= Min;\n      }\n    }\n    sum += a[1][1];\n    q--;\n    for (k = 0; k < q - 1; k++)\n      for (j = 0; j < q + 1; j++)\n        a[k + 1][j] = a[k + 2][j];\n\n    for (k = 0; k < q; k++)\n      for (j = 0; j < q - 1; j++) {\n        a[k][j + 1] = a[k][j + 2];\n      }\n  }\n  return sum;\n}\nint main() {\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    q = n;\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][j];\n    printf(\"%d\\n\", get());\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, k, l, min, sum = 0, j;\n  scanf(\"%d \", &n);\n  for (l = 1; l <= n; l++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (k = n;; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = a[0][i];\n        for (j = 0; j < k; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < k; j++)\n          a[j][i] -= min;\n      }\n      sum += a[1][1];\n      if (k == 2)\n        break;\n      for (i = 1; i <= k - 2; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j <= k - 2; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "18", "index": "33888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main()\n\n{\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int t = 0;\n  int a[100][100];\n  int s = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 1; m <= n - 1; m++) {\n\n      for (i = 0; i < n - m + 1; i++) {\n        t = a[i][0];\n        for (j = 1; j < n - m + 1; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - m + 1; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - m + 1; j++) {\n        t = a[0][j];\n        for (i = 1; i < n - m + 1; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - m + 1; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - m; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - m; j++) {\n        for (i = 1; i < n - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33889", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\n\nint n, m, imin;\nint matrix[110][110];\nvoid submin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (matrix[x][y] < imin) {\n    imin = matrix[x][y];\n  }\n  submin(x + dx, y + dy, dx, dy);\n  matrix[x][y] = matrix[x][y] - imin;\n}\nvoid sub() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[i][j] = matrix[i][j + 1];\n    }\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++) {\n      matrix[j][i] = matrix[j + 1][i];\n    }\n}\nint main() {\n  int i, j, sum, t;\n  for (cin >> n, t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> matrix[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        imin = 10000;\n        submin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + matrix[1][1];\n      sub();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid suo(int b[101][101], int n) {\n  int row = 0, l = 0;\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 0; j < n; j++)\n      b[i][j] = b[i + 1][j];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++)\n      b[i][j] = b[i][j + 1];\n  return;\n}\n\nint square(int a[101][101], int n) {\n  if (n == 1)\n    return 0;\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (min > a[i][j])\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (min > a[j][i])\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int t = a[1][1];\n  int sum = 0;\n  suo(a, n);\n  sum = t + square(a, n - 1);\n  return sum;\n}\nint main() {\n  int i, n, k, j, m[101][101];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> m[j][k];\n    cout << square(m, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint i, j, k, l, tot = 0;\nint sum(int a[][101], int n) {\n  if (n == 1) {\n    return tot;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    l = a[i][0];\n    for (j = 0; j <= n - 2; j++) {\n      l = min(l, a[i][j + 1]);\n    }\n    for (j = 0; j <= n - 1; j++) {\n      a[i][j] -= l;\n    }\n  }\n  for (j = 0; j <= n - 1; j++) {\n    l = a[0][j];\n    for (i = 0; i <= n - 2; i++) {\n      l = min(l, a[i + 1][j]);\n    }\n    for (i = 0; i <= n - 1; i++) {\n      a[i][j] -= l;\n    }\n  }\n  tot += a[1][1];\n  for (i = 1; i <= n - 2; i++) {\n    for (j = 1; j <= n - 2; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 1; i <= n - 2; i++) {\n    a[i][0] = a[i + 1][0];\n  }\n  for (j = 1; j <= n - 2; j++) {\n    a[0][j] = a[0][j + 1];\n  }\n  n--;\n  sum(a, n);\n}\nint main() {\n  int a[101][101];\n  int n;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    cout << sum(a, n) << endl;\n    tot = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33892", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[101][101][101];\nint countsum;\nvoid cal(int rank, int num) {\n  if (rank != 1) {\n\n    int rowmin[rank];\n    int columnmin[rank];\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          rowmin[i] = matrix[num][i][j];\n        else\n          rowmin[i] = min(rowmin[i], matrix[num][i][j]);\n      }\n      if (rowmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][i][j] = matrix[num][i][j] - rowmin[i];\n    }\n    for (int i = 0; i <= rank - 1; ++i) {\n      for (int j = 0; j <= rank - 1; ++j) {\n        if (j == 0)\n          columnmin[i] = matrix[num][j][i];\n        else\n          columnmin[i] = min(columnmin[i], matrix[num][j][i]);\n      }\n      if (columnmin[i] != 0)\n        for (int j = 0; j <= rank - 1; ++j)\n          matrix[num][j][i] = matrix[num][j][i] - columnmin[i];\n    }\n    countsum += matrix[num][1][1];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][j][i - 1] = matrix[num][j][i];\n    for (int i = 2; i <= rank - 1; ++i)\n      for (int j = 0; j <= rank - 1; ++j)\n        matrix[num][i - 1][j] = matrix[num][i][j];\n    cal(rank - 1, num);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i <= n - 1; ++i)\n    for (int j = 0; j <= n - 1; ++j)\n      for (int k = 0; k <= n - 1; ++k)\n        cin >> matrix[i][j][k];\n  for (int i = 0; i <= n - 1; ++i) {\n    countsum = 0;\n    cal(n, i);\n    printf(\"%d\\n\", countsum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[110][110], b[110];\n  int(*ju)[110] = a;\n  int num1, num, i, j, m, sum = 0, *min = b;\n  cin >> num1;\n  for (m = 0; m < num1; m++) {\n    num = num1;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++)\n        cin >> *(*(ju + i) + j);\n    while (num > 1) {\n\n      for (i = 0; i < num; i++) {\n        *(min + i) = 10000;\n        for (j = 0; j < num; j++)\n          if (*(*(ju + i) + j) < *(min + i))\n            *(min + i) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + i);\n\n      for (j = 0; j < num; j++) {\n        *(min + j) = 10000;\n        for (i = 0; i < num; i++)\n          if (*(*(ju + i) + j) < *(min + j))\n            *(min + j) = *(*(ju + i) + j);\n      }\n\n      for (i = 0; i < num; i++)\n        for (j = 0; j < num; j++)\n          *(*(ju + i) + j) = *(*(ju + i) + j) - *(min + j);\n\n      sum = sum + *(*(ju + 1) + 1);\n\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num - 1; j++) {\n          if (j >= 1)\n            *(*(ju + i) + j) = *(*(ju + i) + j + 1);\n        }\n      }\n\n      for (j = 0; j < num - 1; j++) {\n        for (i = 0; i < num - 1; i++) {\n          if (i >= 1)\n            *(*(ju + i) + j) = *(*(ju + i + 1) + j);\n        }\n      }\n\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "33894", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[101][101];\nint main() {\n  int n, i, j, b, k, l, m, s;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    s = n, b = 0;\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[k][l] < m)\n            m = a[k][l];\n\n        for (l = 0; l < s; l++)\n          a[k][l] -= m;\n      }\n      for (k = 0; k < s; k++) {\n        m = 999999;\n        for (l = 0; l < s; l++)\n          if (a[l][k] < m)\n            m = a[l][k];\n\n        for (l = 0; l < s; l++)\n          a[l][k] -= m;\n      }\n\n      \n      \n      \n\n      b += a[1][1];\n\n      for (k = 0; k < s; k++) {\n        for (l = 0; l < s; l++) {\n          if (k == 0 && l > 1) {\n            a[k][l - 1] = a[k][l];\n          } else if (k > 1 && l == 0) {\n            a[k - 1][l] = a[k][l];\n          } else if (k > 1 && l > 1) {\n            a[k - 1][l - 1] = a[k][l];\n          }\n        }\n      }\n      s--;\n    }\n    cout << b << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33895", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, n, min, sum = 0, num = 0;\n  int a[101][101];\n  int minr[101];\n  int minc[101];\n  cin >> n;\n\n  for (k = 1, num = 0, sum = 0; k <= n; k++) {\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    num = 0;\n    sum = 0;\n    while (num < n - 1) {\n      memset(minr, 0, 101 * 4);\n      memset(minc, 0, 101 * 4);\n      for (i = 1; i <= n - num; i++) {\n        min = a[i][1];\n        for (j = 1; j <= n - num; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minr[i] = min;\n      }\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 1; j <= n - num; j++) {\n          a[i][j] = a[i][j] - minr[i];\n        }\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        min = a[1][j];\n        for (i = 1; i <= n - num; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        minc[j] = min;\n      }\n\n      for (j = 1; j <= n - num; j++) {\n        for (i = 1; i <= n - num; i++) {\n          a[i][j] = a[i][j] - minc[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 1; i <= n - num; i++) {\n        for (j = 2; j <= n - num - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n\n      for (j = 1; j <= n - num - 1; j++) {\n        for (i = 2; i <= n - num - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n\n      num++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33896", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[101][101] = {0}, j, k, sum = 0, min[101] = {0}, l,\n            min1[101] = {0};\n  cin >> n;\n  l = n;\n  for (k = 1; k <= l; k++) {\n\n    for (i = 1; i <= l; i++) {\n      for (j = 1; j <= l; j++) {\n        cin >> a[i][j];\n      }\n    }\n    n = l;\n\n    while (n > 1) {\n\n      for (i = 1; i <= n; i++) {\n        min[i] = a[i][1];\n        for (j = 1; j <= n; j++) {\n          if (min[i] > a[i][j])\n            min[i] = a[i][j];\n        }\n      }\n\n      for (i = 1; i <= n; i++) {\n\n        for (j = 1; j <= n; j++)\n          a[i][j] = a[i][j] - min[i];\n      }\n      for (j = 1; j <= n; j++) {\n        min1[j] = a[1][j];\n        for (i = 1; i <= n; i++) {\n          if (min1[j] > a[i][j])\n            min1[j] = a[i][j];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          a[i][j] = a[i][j] - min1[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (j = 2; j < n; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i < n; i++)\n        a[i][1] = a[i + 1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, min, sum = 0, t, m;\n  int a[105][105];\n  cin >> n;\n  t = n;\n  m = n;\n  while (t > 0) {\n    n = m;\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n\n      n--;\n    }\n    cout << sum << endl;\n    t--;\n  }\n}\n"}
{"label": "18", "index": "33898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint JU[100][100];\nint main() {\n  int n, i, j, h, l, M;\n  void JUbian(int N, int JU[100][100]);\n  void JUxiao(int N, int JU[100][100]);\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    M = 0;\n    for (h = 0; h < n; h++) {\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", &JU[h][l]);\n      }\n    }\n    for (j = n; j > 1; j--) {\n      JUbian(j, JU);\n      M = M + JU[1][1];\n      JUxiao(j, JU);\n    }\n    printf(\"%d\\n\", M);\n  }\n  return 0;\n}\n\nvoid JUbian(int n, int JU[100][100]) {\n  int h, l, min;\n  for (h = 0; h < n; h++) {\n    min = JU[h][0];\n    for (l = 1; l < n; l++) {\n      if (JU[h][l] < min)\n        min = JU[h][l];\n    }\n    for (l = 0; l < n; l++) {\n      JU[h][l] = JU[h][l] - min;\n    }\n  }\n  for (l = 0; l < n; l++) {\n    min = JU[0][l];\n    for (h = 1; h < n; h++) {\n      if (JU[h][l] < min)\n        min = JU[h][l];\n    }\n    for (h = 0; h < n; h++) {\n      JU[h][l] = JU[h][l] - min;\n    }\n  }\n}\n\nvoid JUxiao(int n, int JU[100][100]) {\n  int h, l;\n  for (h = 0; h < n - 1; h++) {\n    for (l = 0; l < n; l++) {\n      if (h > 0) {\n        JU[h][l] = JU[h + 1][l];\n      }\n    }\n  }\n  for (l = 0; l < n - 1; l++) {\n    for (h = 0; h < n - 1; h++) {\n      if (l > 0) {\n        JU[h][l] = JU[h][l + 1];\n      }\n    }\n  }\n}\n"}
{"label": "18", "index": "33899", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[104][104][104], n;\n  int i, j, t, k, m, s;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    s = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j][0];\n    for (k = 1; k < n; k++) \n    {\n      for (i = 1; i <= n - k + 1; i++) {\n        m = 100000;\n        for (j = 1; j <= n - k + 1; j++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (j = 1; j <= n - k + 1; j++)\n          a[i][j][k - 1] -= m;\n      }\n      for (j = 1; j <= n - k + 1; j++) {\n        m = 100000;\n        for (i = 1; i <= n - k + 1; i++)\n          if (a[i][j][k - 1] < m)\n            m = a[i][j][k - 1];\n        for (i = 1; i <= n - k + 1; i++)\n          a[i][j][k - 1] -= m;\n      }\n\n      s += a[2][2][k - 1];\n\n      for (i = 1; i <= n - k + 1; i++)\n        for (j = 1; j <= n - k + 1; j++) {\n          if (i == 1 && j == 1)\n            a[i][j][k] = a[i][j][k - 1];\n          if (i == 2 || j == 2)\n            continue;\n          if (i == 1 && j >= 3)\n            a[i][j - 1][k] = a[i][j][k - 1];\n          if (j == 1 && i >= 3)\n            a[i - 1][j][k] = a[i][j][k - 1];\n          if (i >= 3 && j >= 3)\n            a[i - 1][j - 1][k] = a[i][j][k - 1];\n        }\n    }\n    cout << s << endl;\n  }\n}\n"}
{"label": "18", "index": "33900", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int mat[n][n];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n\n    int s = 0;\n    for (int r = n; r > 1; r--) {\n      int m;\n\n      for (int i = 0; i < r; i++) {\n        m = mat[i][0];\n        for (int j = 1; j < r; j++)\n          m = min(m, mat[i][j]);\n        for (int j = 0; j < r; j++)\n          mat[i][j] -= m;\n      }\n\n      for (int j = 0; j < r; j++) {\n        m = mat[0][j];\n        for (int i = 1; i < r; i++)\n          m = min(m, mat[i][j]);\n        for (int i = 0; i < r; i++)\n          mat[i][j] -= m;\n      }\n\n      s += mat[1][1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 0; j < r; j++)\n          mat[i][j] = mat[i + 1][j];\n      for (int j = 1; j < r - 1; j++)\n        for (int i = 0; i < r - 1; i++)\n          mat[i][j] = mat[i][j + 1];\n    }\n    printf(\"%d\\n\", s);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, range;\n  cin >> range;\n  n = range;\n  int a[102][102], (*p)[102] = a;\n  int i, j, k, sum = 0;\n  for (i = 0; i < range; i++) {\n    sum = 0;\n    n = range;\n    int minrow = 999999, mincol = 999999;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(p + j) + k);\n    for (; n > 1;) {\n\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (*(*(p + j) + k) < minrow)\n            minrow = *(*(p + j) + k);\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j) + k) - minrow;\n        minrow = 999999;\n      }\n\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++)\n          if (*(*(p + j) + k) < mincol)\n            mincol = *(*(p + j) + k);\n        for (j = 0; j < n; j++)\n          *(*(p + j) + k) = *(*(p + j) + k) - mincol;\n        mincol = 999999;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      if (n == 2)\n        break;\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j + 1) + k);\n      }\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      }\n      n--;\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33902", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int k, l, sum = 0;\n    for (k = 0; k < n; k++) {\n      for (l = 0; l < n; l++)\n        cin >> a[k][l];\n    }\n    int h = n;\n    do {\n      for (k = 0; k < h; k++) {\n        int min = a[k][0];\n        for (l = 0; l < h; l++) {\n          if (a[k][l] <= min)\n            min = a[k][l];\n        }\n        for (l = 0; l < h; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (l = 0; l < h; l++) {\n        int x = a[0][l];\n        for (k = 0; k < h; k++) {\n          if (a[k][l] <= x)\n            x = a[k][l];\n        }\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l] - x;\n      }\n      sum = sum + a[1][1];\n      h = h - 1;\n      for (k = 1; k < h; k++) {\n        for (l = 0; l < h + 1; l++)\n          a[k][l] = a[k + 1][l];\n      }\n      for (l = 1; l < h; l++) {\n        for (k = 0; k < h; k++)\n          a[k][l] = a[k][l + 1];\n      }\n    } while (h > 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33903", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100] = {0};\n\nvoid function_1(int n) {\n  int i, j, k, min, num = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      cin >> a[i][j];\n    }\n  }\n  for (i = n; i > 1; i--) {\n    for (j = 0; j < i; j++) {\n      min = a[j][0];\n      for (k = 0; k < i; k++) {\n        if (a[j][k] < min) {\n          min = a[j][k];\n        }\n      }\n      for (k = 0; k < i; k++) {\n        a[j][k] = a[j][k] - min;\n      }\n    }\n    for (j = 0; j < i; j++) {\n      min = a[0][j];\n      for (k = 0; k < i; k++) {\n        if (a[k][j] < min)\n          min = a[k][j];\n      }\n      for (k = 0; k < i; k++) {\n        a[k][j] = a[k][j] - min;\n      }\n    }\n    num = num + a[1][1];\n    for (j = 0; j < i; j++) {\n      for (k = 0; k < i; k++) {\n        if (j == 0 && k > 1)\n          a[j][k - 1] = a[j][k];\n        if (k == 0 && j > 1)\n          a[j - 1][k] = a[j][k];\n        if (j > 1 && k > 1)\n          a[j - 1][k - 1] = a[j][k];\n      }\n    }\n  }\n  printf(\"%d\\n\", num);\n}\n\nint main() {\n  int n, i;\n  cin >> n;\n  for (i = 1; i <= n; i++)\n    function_1(n);\n\n  return 0;\n}\n"}
{"label": "18", "index": "33904", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n);\nint main() {\n  int n;\n  cin >> n;\n  int k, i, j;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j;\n  int min;\n  int num;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  num = a[1][1];\n  if (n == 2)\n    return num;\n  else {\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[i][j - 1] = a[i][j];\n    return num + sum(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, p, t, min, sum = 0;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - t; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum += a[1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - t; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33906", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, s = 0, t = 0, k = 0, i = 0, j = 0, m = 0, q = 0, min = 0, r = 0,\n      h = 0, w = 0, v = 0;\n  cin >> n;\n  for (r = 1; r <= n; r++) {\n    int number = 0;\n    const int p = n;\n    int a[p + 1][p + 1];\n    for (i = 1; i <= p; i++) {\n      for (j = 1; j <= p; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    for (k = 1; k <= p - 1; k++) {\n      for (s = k; s <= p; s++) {\n        min = a[s][k];\n        for (t = k; t <= p; t++) {\n          if (a[s][t] < min)\n            min = a[s][t];\n        }\n        for (m = k; m <= p; m++) {\n          a[s][m] -= min;\n        }\n      }\n      for (h = k; h <= p; h++) {\n        min = a[k][h];\n        for (w = k; w <= p; w++) {\n          if (a[w][h] < min) {\n            min = a[w][h];\n          }\n        }\n        for (q = k; q <= p; q++) {\n          a[q][h] -= min;\n        }\n      }\n      number += a[k + 1][k + 1];\n      a[k + 1][k + 1] = a[k][k];\n      for (v = k + 2; v <= p; v++) {\n        a[k + 1][v] = a[k][v];\n        a[v][k + 1] = a[v][k];\n      }\n    }\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, p, t, min, sum = 0;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - t; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum += a[1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - t; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33908", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) {\n    int j, k, l, x, a[100][100], c[100][100], temp;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    int sum = 0;\n    for (l = n - 1; l >= 1; l--) {\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (j = 0; j <= l; j++)\n        for (x = 0; x <= l - 1; x++)\n          for (k = 0; k <= l - 1 - x; k++) {\n            if (c[j][k] > c[j][k + 1]) {\n              temp = c[j][k];\n              c[j][k] = c[j][k + 1];\n              c[j][k + 1] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[j][0];\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (k = 0; k <= l; k++)\n        for (x = 0; x <= l - 1; x++)\n          for (j = 0; j <= l - 1 - x; j++) {\n            if (c[j][k] > c[j + 1][k]) {\n              temp = c[j][k];\n              c[j][k] = c[j + 1][k];\n              c[j + 1][k] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[0][k];\n      sum += a[1][1];\n      for (j = 2; j <= l; j++)\n        for (k = 2; k <= l; k++)\n          a[j - 1][k - 1] = a[j][k];\n      for (k = 2; k <= l; k++)\n        a[0][k - 1] = a[0][k];\n      for (j = 2; j <= l; j++)\n        a[j - 1][0] = a[j][0];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33909", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, n1, p, q;\nint matrix(int a[][101]);\nint mi(int a[]);\nvoid xiao(int a[][101]);\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    n1 = n;\n    int a[101][101];\n    for (p = 0; p < n; p++)\n      for (q = 0; q < n; q++)\n        cin >> a[p][q];\n    printf(\"%d\\n\", matrix(a));\n  }\n  return 0;\n}\nint matrix(int a[][101]) {\n  int i, j, sum = 0;\n  int smin[101], dmin[101], t[101][101];\n\n  for (i = 0; i < n1; i++)\n    smin[i] = mi(a[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (smin[i] != 0) {\n        a[i][j] -= smin[i];\n      }\n  for (j = 0; j < n1; j++)\n    for (i = 0; i < n1; i++)\n      t[j][i] = a[i][j];\n  for (i = 0; i < n1; i++)\n    dmin[i] = mi(t[i]);\n  for (i = 0; i < n1; i++)\n    for (j = 0; j < n1; j++)\n      if (dmin[i] != 0)\n        a[j][i] -= dmin[i];\n  sum = a[1][1];\n  if (n1 == 2)\n    return a[1][1];\n  xiao(a);\n  n1--;\n  sum = sum + matrix(a);\n  return sum;\n}\nint mi(int a[]) {\n  int i, min = a[0];\n  for (i = 0; i < n1; i++)\n    if (a[i] <= min)\n      min = a[i];\n  return min;\n}\nvoid xiao(int a[][101]) {\n  int i, j;\n  for (i = 1; i < n1; i++)\n    a[0][i] = a[0][i + 1];\n  a[0][i] = 0;\n  for (j = 1; j < n1; j++) {\n    for (i = 1; i < n1; i++)\n      a[j][i] = a[j + 1][i + 1];\n    a[j][i] = 0;\n  }\n  for (i = 1; i < n1; i++)\n    a[i][0] = a[i + 1][0];\n\n  for (i = 0; i < n1; i++)\n    a[n - 1][i] = 0;\n}\n"}
{"label": "18", "index": "33910", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], min, sum = 0, t = 0, c = 0;\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n      cout << endl;\n    }\n    for (int l = 0; l < n - 1; l++) {\n      for (int j = 0; j < n - l; j++) {\n        t = 0;\n        for (int q = 0; q < n - l; q++)\n          if (a[j][q] == 0)\n            t = t + 1;\n        if (t > 0)\n          continue;\n        else {\n          min = a[j][0];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[j][y])\n              min = a[j][y];\n          for (int r = 0; r < n - l; r++)\n            a[j][r] = a[j][r] - min;\n        }\n      }\n      for (int k = 0; k < n - l; k++) {\n        c = 0;\n        for (int p = 0; p < n - l; p++)\n          if (a[p][k] == 0)\n            c = c + 1;\n        if (c > 0)\n          continue;\n        else {\n          min = a[0][k];\n          for (int y = 1; y < n - l; y++)\n            if (min > a[y][k])\n              min = a[y][k];\n          for (int r = 0; r < n - l; r++)\n            a[r][k] = a[r][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      a[0][0] = a[0][0];\n      for (int e = 1; e < n - l; e++)\n        a[0][e] = a[0][e + 1];\n      for (int g = 1; g < n - l; g++)\n        a[g][0] = a[g + 1][0];\n      for (int f = 1; f < n - l; f++) {\n        for (int s = 1; s < n - l; s++)\n          a[f][s] = a[f + 1][s + 1];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i = 0, s = 0, d = 0, j = 0, i1 = 0, j1 = 0, k = 0, a = 0, sum = 0;\n  scanf(\"%d \", &n);\n  int shu[n][n];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    d = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> shu[i][j];\n    for (s = 1; s <= n - 1; s++) {\n      for (i = 0; i < n - d; i++) {\n        a = 100000;\n        for (j = 0; j < n - d; j++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (j = 0; j < n - d; j++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      for (j = 0; j < n - d; j++) {\n        a = 100000;\n        for (i = 0; i < n - d; i++) {\n          if (a > shu[i][j]) {\n            a = shu[i][j];\n          }\n        }\n        for (i = 0; i < n - d; i++)\n          shu[i][j] = shu[i][j] - a;\n      }\n      sum = sum + shu[1][1];\n      d++;\n      for (i = 0; i < n - d; i++) {\n        for (j = 0; j < n - d; j++) {\n          if (j > 0) {\n            j1 = j + 1;\n          } else\n            j1 = j;\n          if (i > 0)\n            i1 = i + 1;\n          else\n            i1 = i;\n          shu[i][j] = shu[i1][j1];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int c = 0; c < n; c++) {\n    int mat[n][n];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> mat[i][j];\n\n    int s = 0;\n    for (int r = n; r > 1; r--) {\n      int m;\n      \n      for (int i = 0; i < r; i++) {\n        m = mat[i][0];\n        for (int j = 1; j < r; j++)\n          m = min(m, mat[i][j]);\n        for (int j = 0; j < r; j++)\n          mat[i][j] -= m;\n      }\n      \n      for (int j = 0; j < r; j++) {\n        m = mat[0][j];\n        for (int i = 1; i < r; i++)\n          m = min(m, mat[i][j]);\n        for (int i = 0; i < r; i++)\n          mat[i][j] -= m;\n      }\n\n      s += mat[1][1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 0; j < r; j++)\n          mat[i][j] = mat[i + 1][j];\n      for (int j = 1; j < r - 1; j++)\n        for (int i = 0; i < r - 1; i++)\n          mat[i][j] = mat[i][j + 1];\n    }\n    cout << s << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110] = {0}, j = 0, i = 0, k = 0, l = 0, min = 100000,\n      sum = 0;\n  int(*p)[110] = a;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 1; i <= n - l; i++) {\n        min = 100000;\n        for (j = 1; j <= n - l; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n - l; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - l; j++) {\n        min = 100000;\n        for (i = 1; i <= n - l; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n - l; i++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      sum += *(*(p + 2) + 2);\n      for (i = 2; i < n - l; i++)\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      for (j = 2; j < n - l; j++)\n        *(*(p + 1) + j) = *(*(p + 1) + j + 1);\n      for (i = 2; i < n - l; i++)\n        for (j = 2; j < n - l; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33914", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, m;\n  cin >> n;\n  m = n;\n  int sum = 0;\n  for (int i = 0; i < m; i++) {\n    n = m;\n    int a[100][100];\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    while (n > 1) {\n      for (int j = 0; j < n; j++) {\n        int min = a[j][0];\n        for (int k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (int k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        int min = a[0][j];\n        for (int k = 0; k < n; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (int k = 0; k < n; k++) {\n          a[k][j] = a[k][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (int j = 0; j < n; j++) {\n        for (int k = 1; k < n - 1; k++) {\n          a[k][j] = a[k + 1][j];\n        }\n      }\n\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, s = 0, t = 0, k = 0, i = 0, j = 0, m = 0, q = 0, min = 0, r = 0,\n      h = 0, w = 0, v = 0;\n  cin >> n;\n  for (r = 1; r <= n; r++) {\n    int number = 0;\n    const int p = n;\n    int a[p + 1][p + 1];\n    for (i = 1; i <= p; i++) {\n      for (j = 1; j <= p; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (k = 1; k <= p - 1; k++) {\n      for (s = k; s <= p; s++) {\n        min = a[s][k];\n        for (t = k; t <= p; t++) {\n          if (a[s][t] < min)\n            min = a[s][t];\n        }\n        for (m = k; m <= p; m++) {\n          a[s][m] -= min;\n        }\n      }\n      for (h = k; h <= p; h++) {\n        min = a[k][h];\n        for (w = k; w <= p; w++) {\n          if (a[w][h] < min)\n            min = a[w][h];\n        }\n        for (q = k; q <= p; q++) {\n          a[q][h] -= min;\n        }\n      }\n      number += a[k + 1][k + 1];\n      a[k + 1][k + 1] = a[k][k];\n      for (v = k + 2; v <= p; v++) {\n        a[k + 1][v] = a[k][v];\n        a[v][k + 1] = a[v][k];\n      }\n    }\n    cout << number << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33916", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l;\n  int n, arr[101][101], temp[101][101];\n  int cnt_a, cnt_b;\n  int(*ptr)[101], ans, m;\n  int(*ptr_t)[101];\n  int mini;\n  ptr = arr;\n  ptr_t = temp;\n  cin >> n;\n  for (k = 0; k < n; ++k) {\n    memset(arr, 0, sizeof(arr));\n    ans = 0;\n    for (i = 0; i < n; ++i)\n      for (j = 0; j < n; ++j) {\n        cin >> *(*(ptr + i) + j);\n      }\n    m = n;\n    for (i = 0; i < n - 1; ++i) {\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + j) + l) < mini)\n            mini = *(*(ptr + j) + l);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + j) + l) -= mini;\n        }\n      }\n      mini = 2147483647;\n      for (j = 0; j < m; ++j) {\n        mini = 2147483647;\n        for (l = 0; l < m; ++l) {\n          if (*(*(ptr + l) + j) < mini)\n            mini = *(*(ptr + l) + j);\n        }\n        for (l = 0; l < m; ++l) {\n          *(*(ptr + l) + j) -= mini;\n        }\n      }\n      ans += *(*(ptr + 1) + 1);\n      cnt_a = 0;\n      cnt_b = 0;\n      for (j = 0; j < m; ++j) {\n        cnt_b = 0;\n        for (l = 0; l < m; ++l) {\n          if (j == 1 || l == 1)\n            continue;\n          *(*(ptr_t + cnt_a) + cnt_b) = *(*(ptr + j) + l);\n          cnt_b++;\n        }\n        if (j != 1)\n          cnt_a++;\n      }\n      memset(arr, 0, sizeof(arr));\n      for (j = 0; j < cnt_a; ++j)\n        for (l = 0; l < cnt_b; ++l) {\n          *(*(ptr + j) + l) = *(*(ptr_t + j) + l);\n        }\n      m--;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33917", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[102][102], b[101], c[101], n;\nvoid f(int a[102][102]);\nint main() {\n  int i = 0, j = 0, k = 0;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(a);\n  }\n\n  return 0;\n}\nvoid f(int a[][102]) {\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 1; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      if (i >= k || i == 0) {\n        b[i] = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < b[i])\n            b[i] = a[i][j];\n\n        for (j = 0; j < n; j++)\n          a[i][j] -= b[i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (j >= k || j == 0) {\n        c[j] = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (c[j] > a[i][j])\n            c[j] = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= c[j];\n      }\n    }\n    sum += a[k][k];\n\n    for (i = 0; i < n; i++) {\n      a[i][k] = 1000000;\n      a[k][i] = 1000000;\n    }\n  }\n  printf(\"%d\\n\", sum);\n}\n"}
{"label": "18", "index": "33918", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, a[100][100];\n  int min, k;\n  cin >> n;\n  int tn, sum;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    tn = n;\n    while (tn > 1) {\n\n      for (i = 0; i < tn; i++) {\n        min = a[i][0];\n        for (j = 0; j < tn; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tn; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < tn; i++) {\n        min = a[0][i];\n        for (j = 0; j < tn; j++) {\n          if (min > a[j][i])\n            min = a[j][i];\n        }\n        for (j = 0; j < tn; j++) {\n          a[j][i] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[j][i] = a[j][i + 1];\n      }\n      tn--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "33919", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum, n, a[105][105], flag2[105], min1[105], min2[105];\nvoid f(int x);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    f(n);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\nvoid f(int x) {\n  if (x == n) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n  }\n  if (x == 1) {\n  } else {\n    for (int i = 0; i < x; i++) {\n      flag2[i] = 0;\n      min1[i] = 0;\n      min2[i] = 0;\n    }\n    for (int i = 0; i < x; i++) {\n      min1[i] = a[i][0];\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] < min1[i])\n          min1[i] = a[i][j];\n      }\n    }\n    for (int i = 0; i < x; i++) {\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] - min1[i] >= 0) {\n          a[i][j] = a[i][j] - min1[i];\n          if (a[i][j] == 0) {\n            flag2[j] = 1;\n          }\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        min2[j] = a[0][j];\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] < min2[j])\n            min2[j] = a[i][j];\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] - min2[j] >= 0) {\n            a[i][j] = a[i][j] - min2[j];\n          }\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (int i = 0; i < x; i++) {\n      for (int j = 1; j < x - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (int j = 0; j < x - 1; j++) {\n      for (int i = 1; i < x - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    f(x - 1);\n  }\n}\n"}
{"label": "18", "index": "33920", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, s, a[101][101];\nvoid guiling(int i, int j, int x, int y) {\n  if (i == m || j == m)\n    return;\n  if (a[i][j] < s)\n    s = a[i][j];\n  guiling(i + x, j + y, x, y);\n  a[i][j] -= s;\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, l;\n  cin >> n;\n  l = n;\n  while (l > 0) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = 0;\n    for (m = n; m > 0; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        if (i < m) {\n          s = 1000;\n          guiling(i, 0, 0, 1);\n        } else {\n          s = 1000;\n          guiling(0, i - m, 1, 0);\n        }\n      }\n      sum += a[1][1];\n      xiaojian();\n    }\n    printf(\"%d\\n\", sum);\n    l--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33921", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[100][100][100] = {0};\nint main() {\n  int n, sum[100] = {0};\n  cin >> n;\n  int i, j, k, t;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &array_1[i][j][k]);\n      }\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][k][0];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][k][t])\n            min = array_1[i][k][t];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][0][k];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][t][k])\n            min = array_1[i][t][k];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][t][k] = array_1[i][t][k] - min;\n      }\n      sum[i] = sum[i] + array_1[i][1][1];\n      for (k = 0; k <= n - j; k++)\n        for (t = 1; t < n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t + 1];\n      for (k = 0; k < n - j; k++)\n\n        for (t = 1; t < n - j; t++)\n          array_1[i][t][k] = array_1[i][t + 1][k];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33922", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, sum, min, m;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 1; j < m; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 1; i < m; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 0; i < m; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < m - 1; j++)\n        for (i = 1; i < m - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint m;\nint a[100][100];\nint sum = 0;\n\nvoid d(int n) {\n  int min;\n\n  for (int i = 0; i < n; i++) {\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  if (n > 2)\n    d(n - 1);\n}\nint main() {\n\n  cin >> m;\n  int s[m + 1], p = 1;\n  for (int t = 1; t <= m; t++) {\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        cin >> a[i][j];\n    d(m);\n    s[p++] = sum;\n    sum = 0;\n  }\n  for (int i = 1; i <= m; i++)\n    cout << s[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "33924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, m, s = 0, i, j, x, y, t = 0;\n  int(*p)[100];\n  p = a;\n  scanf(\"%d \", &n);\n  for (m = 1; m <= n; m++) {\n    s = 0;\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> (*(*(p + i) + j));\n      }\n\n    for (y = n; y > 1; y--) {\n\n      for (i = 0; i < n - t; i++) {\n        x = *(*(p + i));\n        for (j = 0; j < n - t; j++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) -= x;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        x = *(*(p) + j);\n        for (i = 0; i < n - t; i++)\n          if (x > *(*(p + i) + j))\n            x = *(*(p + i) + j);\n        for (i = 0; i < n - t; i++)\n          *(*(p + i) + j) -= x;\n      }\n\n      s = s + *(*(p + 1) + 1);\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n      }\n      for (i = 1; i < n - t - 1; i++)\n        for (j = 0; j < n - t; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      t++;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33925", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int input, shu[101][101], min[101], min1[101], sum, i, j, i1, j1, n, num;\n  scanf(\"%d \", &input);\n  for (n = 1; n <= input; n++) {\n    num = input;\n    for (i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> shu[i][j];\n    }\n    sum = 0;\n    while (num > 1) {\n      for (i = 0; i < num; i++) {\n        min[i] = 1000000;\n        min1[i] = 10000000;\n      }\n      for (i = 0; i < num; i++) {\n        for (j = 0; j < num; j++) {\n          if (shu[i][j] < min[i])\n            min[i] = shu[i][j];\n          if (j == num - 1) {\n            for (j1 = 0; j1 < num; j1++)\n              shu[i][j1] = shu[i][j1] - min[i];\n          }\n        }\n      }\n      for (j = 0; j < num; j++) {\n        for (i = 0; i < num; i++) {\n          if (shu[i][j] < min1[j])\n            min1[j] = shu[i][j];\n          if (i == num - 1) {\n            for (i1 = 0; i1 < num; i1++)\n              shu[i1][j] = shu[i1][j] - min1[j];\n          }\n        }\n      }\n      sum = sum + shu[1][1];\n      for (i = 0; i < num; i++) {\n        for (j = 1; j < num - 1; j++)\n          shu[i][j] = shu[i][j + 1];\n      }\n      for (j = 0; j < num - 1; j++) {\n        for (i = 1; i < num - 1; i++)\n          shu[i][j] = shu[i + 1][j];\n      }\n      num--;\n    }\n    cout << sum << endl;\n  }\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  cin.get();\n  return 0;\n}\n"}
{"label": "18", "index": "33926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int (*p)[100], int n) {\n  int sum, i, j, min = 0;\n  sum = 0;\n  {\n    for (i = 0; i < n; i++) {\n      min = **(p + i);\n      {\n        for (j = 1; j < n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n    }\n  }\n  {\n    for (j = 0; j < n; j++) {\n      min = *(*p + j);\n      {\n        {\n          for (i = 1; i < n; i++)\n            if (*(*(p + i) + j) < min)\n              min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n        sum = *(*(p + 1) + 1);\n      }\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        *(*p + i) = *(*p + i + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        for (j = 1; j < n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    {\n      for (i = 1; i < n - 1; i++)\n        **(p + i) = **(p + i + 1);\n    }\n    return (sum);\n  }\n}\nint main() {\n  int(*p)[100], (*q)[100], n, i, j, sum = 0, k;\n  p = (int(*)[100])malloc(100 * sizeof(int) * 10000);\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + k * n + i) + j);\n  }\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    q = p + k * n;\n    {\n      for (i = n; i > 1; i--)\n        sum = sum + f(q, i);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "33927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110] = {0}, j = 0, i = 0, k = 0, l = 0, min = 100000,\n      sum = 0;\n  int(*p)[110] = a;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 1; i <= n - l; i++) {\n        min = 100000;\n        for (j = 1; j <= n - l; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n - l; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - l; j++) {\n        min = 100000;\n        for (i = 1; i <= n - l; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n - l; i++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      sum += *(*(p + 2) + 2);\n      for (i = 2; i < n - l; i++)\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      for (j = 2; j < n - l; j++)\n        *(*(p + 1) + j) = *(*(p + 1) + j + 1);\n      for (i = 2; i < n - l; i++) {\n        for (j = 2; j < n - l; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint del(int num[200][200], int n);\nint main() {\n  int i, j, k, n, num[200][200] = {0};\n  scanf(\"%d \", &n);\n\n  for (i = 0; i <= n - 1; i++) {\n    for (j = 0; j <= n - 1; j++)\n      for (k = 0; k <= n - 1; k++)\n\n        cin >> num[j][k];\n    cout << del(num, n) << endl;\n  }\n  return 0;\n}\nint del(int num[200][200], int n) {\n  int sum = 0, j, i, min = 1000;\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[j][i] < min) {\n        min = num[j][i];\n      }\n    }\n\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[j][i] = num[j][i] - min;\n    }\n  }\n\n  for (j = 0; j <= n - 1; j++) {\n    min = 1000;\n    for (i = 0; i <= n - 1; i++) {\n      if (num[i][j] < min) {\n        min = num[i][j];\n        if (min == 0)\n          break;\n      }\n    }\n    if (min != 0) {\n      for (i = 0; i <= n - 1; i++)\n        num[i][j] = num[i][j] - min;\n    }\n  }\n  sum = sum + num[1][1];\n  if (n == 2)\n    return sum;\n  else {\n    for (i = 2; i <= n; i++) {\n      num[0][i - 1] = num[0][i];\n      num[i - 1][0] = num[i][0];\n    }\n    for (i = 2; i <= n - 1; i++)\n      for (j = 2; j <= n - 1; j++)\n        num[i - 1][j - 1] = num[i][j];\n    sum = sum + del(num, n - 1);\n    return sum;\n  }\n}\n"}
{"label": "18", "index": "33929", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint board[100][100];\nvoid Subduction(int); \nvoid Turn(int);\nint n; \nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) \n    {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n); \n  }\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1) \n  {\n    cout << sum << endl;\n  } else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) \n    {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) \n    {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) \n    {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) \n    {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1]; \n    Turn(m);\n    Subduction(m - 1);\n  }\n}\n\nvoid Turn(int m) \n{\n  int p, q;\n  for (q = 1; q <= m - 2; q++) \n  {\n    board[0][q] = board[0][q + 1];\n  }\n  for (p = 1; p <= m - 2; p++) \n  {\n    board[p][0] = board[p + 1][0];\n  }\n  for (p = 1; p <= m - 2; p++) \n  {\n    for (q = 1; q <= m - 2; q++) {\n      board[p][q] = board[p + 1][q + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33930", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110] = {0}, j = 0, i = 0, k = 0, l = 0, min = 100000,\n      sum = 0;\n  int(*p)[110] = a;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 1; i <= n - l; i++) {\n        min = 100000;\n        for (j = 1; j <= n - l; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n - l; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - l; j++) {\n        min = 100000;\n        for (i = 1; i <= n - l; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n - l; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 2) + 2);\n      for (i = 2; i < n - l; i++)\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      for (j = 2; j < n - l; j++)\n        *(*(p + 1) + j) = *(*(p + 1) + j + 1);\n      for (i = 2; i < n - l; i++) {\n        for (j = 2; j < n - l; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33931", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, number[100][100], i, p, o, u, count, min;\n  scanf(\"%d\", &n);\n  for (o = 0; o < n; o++) {\n    for (i = 0; i < n; i++) {\n      for (p = 0; p < n; p++) {\n        scanf(\"%d\", &number[i][p]);\n      }\n    }\n    count = 0;\n    for (u = 0; u < n - 1; u++) {\n      for (i = 0; i < n - u; i++) {\n        min = 999999;\n        for (p = 0; p < n - u; p++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (p = 0; p < n - u; p++) {\n          number[i][p] -= min;\n        }\n      }\n      for (p = 0; p < n - u; p++) {\n        min = 999999;\n        for (i = 0; i < n - u; i++) {\n          if (min > number[i][p]) {\n            min = number[i][p];\n          }\n        }\n        for (i = 0; i < n - u; i++) {\n          number[i][p] -= min;\n        }\n      }\n      count += number[1][1];\n      for (i = 1; i < n - u - 1; i++) {\n        number[i][0] = number[i + 1][0];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        number[0][p] = number[0][p + 1];\n      }\n      for (p = 1; p < n - u - 1; p++) {\n        for (i = 1; i < n - u - 1; i++) {\n          number[i][p] = number[i + 1][p + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", count);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33932", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m;\nint a[100][100];\nint sum = 0;\n\nvoid d(int n) {\n  int min;\n\n  for (int i = 0; i < n; i++) {\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  if (n > 2)\n    d(n - 1);\n}\nint main() {\n\n  scanf(\"%d \", &m);\n  int s[m + 1], p = 1;\n  for (int t = 1; t <= m; t++) {\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        scanf(\"%d \", &a[i][j]);\n    d(m);\n    s[p++] = sum;\n    sum = 0;\n  }\n  for (int i = 1; i <= m; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "33933", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n);\nint main() {\n  int n;\n  cin >> n;\n  int k, i, j;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << sum(n) << endl;\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i, j;\n  int min;\n  int num;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n  num = a[1][1];\n  if (n == 2)\n    return num;\n  else {\n    for (i = 2; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < n; j++)\n      for (i = 0; i < n; i++)\n        a[i][j - 1] = a[i][j];\n    return num + sum(n - 1);\n  }\n}\n"}
{"label": "18", "index": "33934", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, l, p;\nint sum = 0;\nint a[105][105];\n\nvoid g() {\n  int i, j;\n  int t;\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + i) + 1);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + i) + j) < t)\n        t = *(*(a + i) + j);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + i) + j) -= t;\n  }\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + 1) + i);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + j) + i) < t)\n        t = *(*(a + j) + i);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + j) + i) -= t;\n  }\n}\n\nvoid f() {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  for (j = 1; j <= n; j++)\n    for (i = 2; i <= n; i++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n}\nint main() {\n  int i, j;\n  scanf(\"%d \", &n);\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    for (p = 0; p < n; p++) {\n\n      g();\n      sum += (*(*(a + 2) + 2));\n      f();\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33935", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, m, sum = 0;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    sum = 0;\n    int a[n + 1][n + 1];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    a[n][n] = a[0][0];\n    for (i = 1; i < n; i++)\n      a[i][n] = a[i][0];\n    for (j = 1; j < n; j++)\n      a[n][j] = a[0][j];\n    for (int l = 1; l < n; l++) {\n      for (i = l; i <= n; i++) {\n        m = a[i][l];\n        for (j = l + 1; j <= n; j++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (j = l; j <= n; j++)\n          a[i][j] = a[i][j] - m;\n      }\n      for (j = l; j <= n; j++) {\n        m = a[l][j];\n        for (i = l + 1; i <= n; i++) {\n          if (m > a[i][j])\n            m = a[i][j];\n        }\n        for (i = l; i <= n; i++)\n          a[i][j] = a[i][j] - m;\n      }\n      sum = sum + a[l][l];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33936", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid ccout(int n, int s[100]);\nint main() {\n  int n, i, j, k, min, t, s[100], a[100][100][100];\n  scanf(\"%d \", &n);\n  memset(s, 0, sizeof(s));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j][k]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = 1073741824;\n        for (j = 0; j < n - t; j++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (j = 0; j < n - t; j++)\n          a[i][j][k] -= min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = 1073741824;\n        for (i = 0; i < n - t; i++)\n          if (a[i][j][k] < min)\n            min = a[i][j][k];\n        for (i = 0; i < n - t; i++)\n          a[i][j][k] -= min;\n      }\n      s[k] += a[1][1][k];\n      for (i = 0; i < n; i++)\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      for (j = 0; j < n; j++)\n        for (i = 1; i < n - t - 1; i++)\n          a[i][j][k] = a[i + 1][j][k];\n    }\n  }\n  ccout(n, s);\n  return 0;\n}\nvoid ccout(int n, int s[100]) {\n  int k;\n  for (k = 0; k < n; k++)\n    printf(\"%d\\n\", s[k]);\n}\n"}
{"label": "18", "index": "33937", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint juzhen(int);\nint zhen[100][100];\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    memset(zhen, 0, sizeof(zhen));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> zhen[i][j];\n    }\n    cout << juzhen(n) << endl;\n  }\n  return 0;\n}\nint juzhen(int n) {\n  int i, j, min, num;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = zhen[i][0];\n    for (j = 0; j < n; j++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      zhen[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = zhen[0][j];\n    for (i = 0; i < n; i++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      zhen[i][j] -= min;\n    }\n  }\n  num = zhen[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i > 1 && j > 1)\n        zhen[i - 1][j - 1] = zhen[i][j];\n      if (i > 1 && j < 1)\n        zhen[i - 1][j] = zhen[i][j];\n      if (i < 1 && j > 1)\n        zhen[i][j - 1] = zhen[i][j];\n    }\n  }\n  return num + juzhen(n - 1);\n}\n"}
{"label": "18", "index": "33938", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint sum;\nvoid calculate(int[][100], int);\n\nint main() {\n  int n, a[100][100];\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    calculate(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid calculate(int a[][100], int n) {\n  if (n == 1)\n    return;\n  int minx, miny;\n  for (int i = 0; i < n; i++) {\n    minx = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < minx)\n        minx = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= minx;\n  }\n  for (int i = 0; i < n; i++) {\n    miny = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < miny)\n        miny = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= miny;\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int i = 0; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[j][i] = a[j + 1][i];\n  calculate(a, n - 1);\n}\n"}
{"label": "18", "index": "33939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int step, int *sum) {\n  int i, j, min, g;\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[i][j] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[i][j];\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    g = 0;\n    if (i >= 1 && i < step)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      if (a[j][i] == 0) {\n        g = 1;\n        break;\n      }\n      if (j == 0)\n        min = a[j][i];\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    if (g == 1)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (j >= 1 && j < step)\n        continue;\n      a[j][i] -= min;\n    }\n  }\n  *sum += a[step][step];\n  return;\n}\n\nint main() {\n  int n, i, j, k, a[100][100], sum;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, 0, 40000);\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    }\n    for (j = 1; j < n; j++)\n      change(a, n, j, &sum);\n\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33940", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100] = {0}; \nint n = 0;\nvoid find() {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> *(*(a + i) + j);\n  int sum = 0;\n\n  int l = 0;\n  int m = 10000;\n\n  for (l = n; l > 1; l--) {\n    for (i = 0; i < l; i++) {\n      m = 10000;\n      for (j = 0; j < l; j++)\n        m = min(m, *(*(a + i) + j));\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    for (j = 0; j < l; j++) {\n      m = 10000;\n      for (i = 0; i < l; i++)\n        m = min(m, *(*(a + i) + j));\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j) - m;\n    }\n    sum = sum + *(*(a + 1) + 1);\n    for (i = 1; i < l; i++)\n      for (j = 0; j < l; j++)\n        *(*(a + i) + j) = *(*(a + i + 1) + j);\n    for (j = 1; j < l; j++)\n      for (i = 0; i < l; i++)\n        *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  cout << sum << endl;\n}\n\nint main() {\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; i++)\n    find();\n  \n  \n\n  return 0;\n}\n"}
{"label": "18", "index": "33941", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N = 0;\n  cin >> N;\n  for (int n = 0; n < N; n++) {\n    int a[100][100] = {0};\n    int Sum = 0;\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> a[i][j];\n    for (int m = N; m > 1; m--) {\n      for (int i = 0; i < m; i++) {\n        int Min = a[i][0];\n        for (int j = 0; j < m; j++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int j = 0; j < m; j++)\n          a[i][j] = a[i][j] - Min;\n      }\n      for (int j = 0; j < m; j++) {\n        int Min = a[0][j];\n        for (int i = 0; i < m; i++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int i = 0; i < m; i++)\n          a[i][j] = a[i][j] - Min;\n      }\n      Sum = Sum + a[1][1];\n      for (int j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (int i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (int i = 1; i < m - 1; i++)\n        for (int j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    cout << Sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[105][105], sum = 0, min, p;\n  scanf(\"%d \", &n);\n  p = n;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n\n    for (int m = 1; m <= n - 1; m++) {\n      for (i = 0; i <= p - 1; i++) {\n        min = 10000;\n        for (j = 0; j <= p - 1; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j <= p - 1; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= p - 1; j++) {\n        min = 10000;\n        for (i = 0; i <= p - 1; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i <= p - 1; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n\n      for (i = 2; i <= p - 1; i++) {\n        for (j = 0; j <= p - 1; j++)\n          a[i - 1][j] = a[i][j];\n      }\n      for (j = 2; j <= p - 1; j++) {\n        for (i = 0; i <= p - 1; i++)\n          a[i][j - 1] = a[i][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33943", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, A[111][111];\n\nvoid sum() {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      scanf(\"%d \", &A[i][j]);\n\n  int S = 0;\n  for (int t = n; t > 1; t--) {\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[i][j] < min)\n          min = A[i][j];\n      }\n      for (int j = 0; j < t; j++) {\n        A[i][j] -= min;\n      }\n    }\n\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[j][i] < min)\n          min = A[j][i];\n      }\n      for (int j = 0; j < t; j++) {\n        A[j][i] -= min;\n      }\n    }\n\n    S += A[1][1];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[i][j] = A[i + 1][j];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[j][i] = A[j][i + 1];\n  }\n  cout << S << endl;\n}\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    sum();\n}\n"}
{"label": "18", "index": "33944", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f1(int a[][100], int k) {\n  int i, j, min;\n  for (j = 0; j < k; j++) {\n    min = a[j][0];\n    for (i = 1; i < k; i++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (i = 0; i < k; i++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    min = a[0][i];\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid f2(int a[][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[j][i] = a[j + 1][i];\n  }\n}\nint main() {\n  int n, z, k;\n  scanf(\"%d \", &n);\n  k = n;\n  for (z = 0; z < n; z++) {\n    int i, j, sum = 0;\n    int a[100][100];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    k = n;\n    for (k; k > 1; k--) {\n      f1(a, k);\n      sum += a[1][1];\n      f2(a, k);\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33945", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nint search1(int num, int n) {\n  int i, min;\n  min = a[num][0];\n  for (i = 1; i < n; i++)\n    if (a[num][i] < min)\n      min = a[num][i];\n  return min;\n}\n\nint search2(int num, int n) {\n  int j, min;\n  min = a[0][num];\n  for (j = 1; j < n; j++)\n    if (a[j][num] < min)\n      min = a[j][num];\n  return min;\n}\n\nvoid dele1(int num, int n, int x) {\n  int i;\n  for (i = 0; i <= n; i++)\n    a[num][i] = a[num][i] - x;\n}\n\nvoid dele2(int num, int n, int x) {\n  int j;\n  for (j = 0; j <= n; j++)\n    a[j][num] = a[j][num] - x;\n}\n\nvoid move(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n - 1; j++)\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, l, i, j, m, ans;\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    m = n;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n\n    while (m > 1) {\n      for (i = 0; i < m; i++)\n        dele1(i, m, search1(i, m));\n      for (j = 0; j < m; j++)\n        dele2(j, m, search2(j, m));\n      ans = ans + a[1][1];\n      move(m);\n      m = m - 1;\n    }\n\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33946", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, m, mymin;\nint a[110][110];\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < mymin)\n    mymin = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= mymin;\n}\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, sum, t;\n  for (cin >> n, t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mymin = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33947", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100];\nint cut(int t) {\n  int s, i, j;\n  int sum;\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[i][j] < s)\n        s = a[i][j];\n    }\n    for (j = 0; j < t; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[j][i] < s)\n        s = a[j][i];\n    }\n    for (j = 0; j < t; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  t--;\n  if (t == 1)\n    return a[1][1];\n  else\n    sum = a[1][1];\n  for (i = 0; i < t + 1; i++)\n    for (j = 0; j < t + 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 1 || j == 1)\n        continue;\n      else if (i == 0)\n        a[i][j - 1] = a[i][j];\n      else if (j == 0)\n        a[i - 1][j] = a[i][j];\n      else\n        a[i - 1][j - 1] = a[i][j];\n    }\n  sum = sum + cut(t);\n  return sum;\n}\nint main() {\n  int i, j, k, n;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << cut(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33948", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nvoid fact(int n); \nint sum(int n);   \nint a[100][100];\nint i = 0, j = 0; \nint main() {\n  int n; \n  cin >> n;\n  int k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << endl; \n  }\n  return 0;\n}\nvoid fact(int n) \n{\n  \n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  \n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\n\nint sum(int n) \n{\n  fact(n);\n  if (n == 2)\n    return a[1][1]; \n  int k = a[1][1];\n  \n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1); \n}\n"}
{"label": "18", "index": "33949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, min, s, t;\n  cin >> n;\n  int a[n][n];\n  for (int k = 0; k < n; k++) {\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 1; j < t; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < t; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < t; i++) {\n        min = a[0][i];\n        for (j = 1; j < t; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 0; j < t; j++)\n          a[j][i] -= min;\n      }\n      s += a[1][1];\n      if (t > 2) {\n        for (i = 1; i < t - 1; i++) {\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        }\n        for (i = 1; i < t - 1; i++)\n          for (j = 1; j < t - 1; j++)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33950", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, sum;\n  int i, j, k;\n  int a[101][101] = {0};\n  int lenth, min;\n\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    lenth = n;\n\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        scanf(\"%d\", &a[j][k]);\n\n    for (lenth = n; lenth > 1; lenth--) {\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[j][k] != 0)\n            a[j][k] = a[j][k] - min;\n      }\n      for (j = 1; j <= lenth; j++) {\n        min = 1000;\n        for (k = 1; k <= lenth; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 1; k <= lenth; k++)\n          if (a[k][j] != 0)\n            a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[2][2];\n\n      for (j = 1; j <= lenth; j++)\n        for (k = 2; k <= lenth; k++)\n          a[j][k] = a[j][k + 1];\n      for (j = 2; j <= lenth; j++)\n        for (k = 1; k <= lenth; k++)\n          a[j][k] = a[j + 1][k];\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i = 0;\n  while (i < n) {\n    int a[n][n];\n    int b[n], c[n];\n    int t = 1;\n    int j, k;\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    while (t < n) {\n      for (j = 0; j < n; j++) {\n        if (a[j][0] < 0)\n          j++;\n        b[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (b[j] > a[j][k] && a[j][k] >= 0)\n            b[j] = a[j][k];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (a[j][k] >= 0) {\n            a[j][k] = a[j][k] - b[j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        if (a[0][j] < 0)\n          j++;\n        c[j] = a[0][j];\n        for (k = 0; k < n; k++) {\n          if (c[j] > a[k][j] && a[k][j] >= 0)\n            c[j] = a[k][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (a[k][j] >= 0) {\n            a[k][j] = a[k][j] - c[j];\n          }\n      }\n      sum = sum + a[t][t];\n      for (j = 0; j < n; j++) {\n        a[t][j] = -1;\n        a[j][t] = -1;\n      }\n      t++;\n    }\n    i++;\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33952", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], mini = INT_MAX, sum = 0;\n  cin >> n;\n  for (int c = 1; c <= n; c++) {\n    for (int i = 0; i <= n - 1; i++) {\n      for (int j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++)\n          mini = min(mini, a[i][j]);\n\n        for (int l = 0; l <= n - k; l++) {\n          a[i][l] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 0; j <= n - k; j++) {\n          mini = min(mini, a[j][i]);\n        }\n        for (int l = 0; l <= n - k; l++) {\n          a[l][i] -= mini;\n        }\n        mini = INT_MAX;\n      }\n      sum += a[1][1];\n      for (int i = 0; i <= n - k; i++) {\n        for (int j = 1; j <= n - k - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (int j = 0; j <= n - k - 1; j++) {\n        for (int i = 1; i <= n - k - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33953", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, mymin; \nint a[110][110]; \nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < mymin)\n    mymin = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= mymin;\n}\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, sum, t;\n  for (cin >> n, t = 0; t < n; t++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mymin = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33954", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[103][103];\nint FindMin(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[x][i] < ret)\n      ret = a[x][i];\n  return ret;\n}\nint FindMin1(int x, int y) {\n  int ret = 100000;\n  for (int i = 0; i < y; i++)\n    if (a[i][x] < ret)\n      ret = a[i][x];\n  return ret;\n}\nint main() {\n  int n, q;\n  scanf(\"%d \", &n);\n  int sum = 0;\n  q = n;\n  for (int k = 0; k < n; k++) {\n    sum = 0;\n    q = n;\n    for (int h = 0; h < n; h++)\n      for (int l = 0; l < n; l++)\n        cin >> a[h][l];\n    while (1) {\n      if (q == 1) {\n        cout << sum << endl;\n        break;\n      }\n\n      int t;\n      for (int i = 0; i < q; i++) {\n        t = FindMin(i, q);\n        for (int j = 0; j < q; j++)\n          a[i][j] -= t;\n      }\n      for (int j = 0; j < q; j++) {\n        t = FindMin1(j, q);\n        for (int i = 0; i < q; i++)\n          a[i][j] -= t;\n      }\n      sum += a[1][1];\n\n      for (int i = 1; i < q - 1; i++)\n        for (int j = 0; j < q; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < q - 1; j++)\n        for (int i = 0; i < q; i++)\n          a[i][j] = a[i][j + 1];\n      q--;\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33955", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint board[100][100];\nvoid Subduction(int);\nvoid Turn(int);\nint n;\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1)\n\n    cout << sum << endl;\n  else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    Turn(m);\n    Subduction(m - 1);\n  }\n}\n\nvoid Turn(int m) {\n  int p, q;\n  for (q = 1; q <= m - 2; q++) {\n    board[0][q] = board[0][q + 1];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    board[p][0] = board[p + 1][0];\n  }\n  for (p = 1; p <= m - 2; p++) {\n    for (q = 1; q <= m - 2; q++) {\n      board[p][q] = board[p + 1][q + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "33956", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(a[k][i] + j);\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (*(a[p][i] + j) < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][i] + k) = *(a[p][i] + k) - min;\n        }\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (*(a[p][i] + j) < min)\n            min = *(a[p][i] + j);\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][k] + j) = *(a[p][k] + j) - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++) {\n        *(a[p][2] + i) = 0;\n      }\n      for (j = 1; j <= h; j++)\n        *(a[p][j] + 2) = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][j] + i - 1) = *(a[p][j] + i);\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][i - 1] + j) = *(a[p][i] + j);\n        }\n      }\n      h -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33957", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid sub(int a[1000], int n) {\n  int i, min = a[0];\n  for (i = 1; i < n; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < n; i++)\n    a[i] -= min;\n}\nint main() {\n  int n, k, i, j, count, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    int a[1000][1000], temp[1000];\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    for (count = 0; count < n - 1; count++) {\n      for (i = count; i < n; i++) {\n        for (j = count; j < n; j++)\n          temp[j - count] = a[i][j];\n        sub(temp, n - count);\n        for (j = count; j < n; j++)\n          a[i][j] = temp[j - count];\n      }\n      for (j = count; j < n; j++) {\n        for (i = count; i < n; i++)\n          temp[i - count] = a[i][j];\n        sub(temp, n - count);\n        for (i = count; i < n; i++)\n          a[i][j] = temp[i - count];\n      }\n      sum += a[count + 1][count + 1];\n      for (i = 0; i < n; i++)\n        a[i][count + 1] = a[i][count];\n      for (j = 0; j < n; j++)\n        a[count + 1][j] = a[count][j];\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33958", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, j, k, sum = 0, s2;\n  cin >> n;\n  s2 = n;\n  for (i = 1; i <= s2; i++) {\n    n = s2;\n    sum = 0;\n    int a[100][100];\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    while (n > 1) {\n      int s[100];\n      for (j = 0; j < n; j++)\n        s[j] = a[j][0];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[j][k] < s[j])\n            s[j] = a[j][k];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j][k] -= s[j];\n\n      int t[100];\n      for (j = 0; j < n; j++)\n        t[j] = a[0][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          if (a[k][j] < t[j])\n            t[j] = a[k][j];\n      for (j = 0; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[k][j] -= t[j];\n\n      sum += a[1][1];\n      for (j = 2; j < n; j++)\n        for (k = 0; k < n; k++)\n          a[j - 1][k] = a[j][k];\n      for (k = 2; k < n; k++)\n        for (j = 0; j < n; j++)\n          a[j][k - 1] = a[j][k];\n\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main()\n\n{\n  int n; \n  cin >> n;\n  int i, j, k, m; \n  int t = 0;      \n  int a[100][100];\n  int s = 0; \n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    }\n    for (m = 1; m <= n - 1; m++) \n    {\n\n      for (i = 0; i < n - m + 1; i++) {\n        t = a[i][0];\n        for (j = 1; j < n - m + 1; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - m + 1; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - m + 1; j++) {\n        t = a[0][j];\n        for (i = 1; i < n - m + 1; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - m + 1; i++)\n          a[i][j] = a[i][j] - t; \n                                 \n                                 \n                                 \n      }\n      s = s + a[1][1]; \n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - m; j++)\n          a[i][j] = a[i][j + 1]; \n      }\n      for (j = 0; j < n - m; j++) {\n        for (i = 1; i < n - m; i++)\n          a[i][j] = a[i + 1][j]; \n      }\n    }\n    cout << s << endl;\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, i, j, k, m, t, a[100][100], x;\n  scanf(\"%d\", &n);\n  x = n;\n  for (i = 0; i < x; i++) {\n    s = 0;\n    n = x;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (t = 1; t < x; t++) {\n      for (j = 0; j < n; j++) {\n        m = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < m)\n            m = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (a[k][j] < m)\n            m = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] = a[k][j] - m;\n      }\n      s = s + a[1][1];\n      for (j = 1; j < n - 1; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - 1; j++)\n        for (k = 1; k < n - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n      n--;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33961", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[101][101], n;\n  int(*p)[101];\n  cin >> n;\n  int nn = n, min, s, i, j, nnn = n;\n  while (nn--) {\n    n = nnn;\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = 1000000;\n        for (j = 0; j < n; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 1000000;\n        for (i = 0; i < n; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < n; i++)\n          *(*(a + i) + j) -= min;\n      }\n      s = s + *(*(a + 1) + 1);\n      for (i = 1; i < n - 1; i++)\n        *((*a) + i) = *((*a) + i + 1);\n\n      for (i = 1; i < n - 1; i++) {\n        *(*(a + i)) = *(*(a + i + 1));\n      }\n      for (i = 1; i < n; i++) {\n        for (j = 1; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j + 1);\n      }\n\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33962", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint f(int n, int a[][100]) {\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    int min = a[0][j];\n    for (i = 1; i < n; i++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min > 0)\n      for (i = 0; i < n; i++)\n        a[i][j] -= min;\n  }\n  int z = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  if (n == 2)\n    return z;\n  else\n    return z + f(n - 1, a);\n}\nint main() {\n  int n;\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << f(n, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum(int n);\nint a[100][100];\nint main() {\n  int n;\n  cin >> n;\n  int i = 0, j = 0, k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    cout << sum(n) << \"\\n\";\n  }\n  return 0;\n}\n\nint sum(int n) {\n  int i = 0, j = 0;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "33964", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, N, n, o, i, j, r, a[200][200] = {0};\n  scanf(\"%d\", &n);\n  for (N = 1; N <= n; N++) {\n    r = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (m = 0; m <= n - 2; m++) {\n      for (i = 0; i <= n - 1; i++) {\n        {\n          if ((i >= 1) && (i <= m)) {\n            i = m;\n            continue;\n          }\n        }\n        o = a[i][0];\n        for (j = 1; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (j = 0; j <= n - 1; j++) {\n          {\n            if ((j >= 1) && (j <= m)) {\n              j = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      for (j = 0; j <= n - 1; j++) {\n        {\n          if ((j >= 1) && (j <= m)) {\n            j = m;\n            continue;\n          }\n        }\n        o = a[0][j];\n        for (i = 1; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          o = (o <= a[i][j]) ? o : a[i][j];\n        }\n        for (i = 0; i <= n - 1; i++) {\n          {\n            if ((i >= 1) && (i <= m)) {\n              i = m;\n              continue;\n            }\n          }\n          a[i][j] = a[i][j] - o;\n        }\n      }\n      r = r + a[1 + m][1 + m];\n    }\n    printf(\"%d\\n\", r);\n  }\n}\n"}
{"label": "18", "index": "33965", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint juzhen(int);\nint zhen[100][100];\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    memset(zhen, 0, sizeof(zhen));\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> zhen[i][j];\n    }\n    cout << juzhen(n) << endl;\n  }\n  return 0;\n}\nint juzhen(int n) {\n  int i, j, min, num;\n  if (n == 1)\n    return 0;\n  for (i = 0; i < n; i++) {\n    min = zhen[i][0];\n    for (j = 0; j < n; j++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (j = 0; j < n; j++)\n      zhen[i][j] -= min;\n  }\n  for (j = 0; j < n; j++) {\n    min = zhen[0][j];\n    for (i = 0; i < n; i++) {\n      if (zhen[i][j] < min)\n        min = zhen[i][j];\n    }\n    for (i = 0; i < n; i++) {\n      zhen[i][j] -= min;\n    }\n  }\n  num = zhen[1][1];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (i > 1 && j > 1)\n        zhen[i - 1][j - 1] = zhen[i][j];\n      if (i > 1 && j < 1)\n        zhen[i - 1][j] = zhen[i][j];\n      if (i < 1 && j > 1)\n        zhen[i][j - 1] = zhen[i][j];\n    }\n  }\n  return num + juzhen(n - 1);\n}\n"}
{"label": "18", "index": "33966", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[110][110] = {0};\n    int min = 10000, s = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (int m = 1; m < n; m++) {\n      for (int j = 0; j < n; j++) {\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      for (int k = 0; k < n; k++) {\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      s = s + a[m][m];\n      for (int j = 0; j < n; j++)\n        a[j][m] = 100000;\n      for (int j = 0; j < n; j++)\n        a[m][j] = 100000;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33967", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint Sum(int n);\n\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n\nint Sum(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + Sum(n - 1);\n}\n"}
{"label": "18", "index": "33968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, t, sum = 0, a[200][200], m;\nint main() {\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (t = n; t >= 2; t--) {\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[j][k] < m) {\n            m = a[j][k];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[j][k] = a[j][k] - m;\n        }\n      }\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[k][j] < m) {\n            m = a[k][j];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[k][j] = a[k][j] - m;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= t - 2; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j <= t - 2; j++) {\n        for (k = 1; k <= t - 2; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33969", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[102][102], min = 100000, sum = 0, t;\n  cin >> n;\n\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (t = 0; t <= n - 2; t++) {\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[i][j] ? min : a[i][j];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (i = 1; i <= n - t; i++) {\n        min = 100000;\n        for (j = 1; j <= n - t; j++) {\n          min = min < a[j][i] ? min : a[j][i];\n        }\n        for (j = 1; j <= n - t; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n\n      sum = sum + a[2][2];\n\n      for (i = 3; i <= n - t; i++) {\n        a[i - 1][1] = a[i][1];\n        a[1][i - 1] = a[1][i];\n      }\n\n      for (i = 3; i <= n - t; i++) {\n        for (j = 3; j <= n - t; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33970", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[200][200] = {{0}, {0}}, i, j = 0, sum, q = 0, k, n, m, s;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n\n    for (s = 0; s < n; s++) {\n\n      for (i = 1; i <= n - s; i++) {\n        m = a[i][1];\n        for (j = 1; j <= n - s; j++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (j = 1; j <= n - s; j++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      for (j = 1; j <= n - s; j++) {\n        m = a[1][j];\n        for (i = 1; i <= n - s; i++) {\n          if (a[i][j] < m) {\n            m = a[i][j];\n          }\n        }\n        for (i = 1; i <= n - s; i++) {\n          a[i][j] = a[i][j] - m;\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (i = 1; i <= n - s; i++) {\n        for (j = 2; j <= n; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (j = 1; j <= n - s; j++) {\n        for (i = 2; i <= n; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[200][200], sum = 0;\nvoid xj(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n  }\n}\n\nvoid gl(int n) {\n  int i, j;\n  if (n >= 2) {\n    for (i = 0; i < n; i++) {\n      int min = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (i = 0; i < n; i++) {\n      int min = a[0][i];\n      for (j = 1; j < n; j++) {\n        if (a[j][i] < min)\n          min = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min;\n    }\n    sum += a[1][1];\n    xj(n);\n    gl(n - 1);\n  } else\n    return;\n}\nint main() {\n  int n, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    gl(n);\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  if (n == 1)\n    return 0;\n  int k = 0;\n  guiling(n);\n  k += a[1][1];\n  xiaojian(n);\n  n--;\n  return k + Sum(n);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    cout << Sum(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33973", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int flag = 0;\n  int gl(int num[][200], int n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num[200][200] = {0};\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &num[j][k]);\n    sum = gl(num, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint gl(int num[][200], int n) {\n  int i = 0, j = 0, k = 0;\n  int min = 0;\n  int flag = 0;\n  int sum = 0;\n  for (flag = 0; flag < n - 1; flag++) {\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n      for (j = 0; j < n; j++) {\n        if (num[i][j] < min) {\n          min = num[i][j];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n      for (j = 0; j < n; j++) {\n        if (num[j][i] < min) {\n          min = num[j][i];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n    sum += num[1][1];\n\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[j][i - 1] = num[j][i];\n      }\n      num[j][i] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[i - 1][j] = num[i][j];\n      }\n      num[j][i] = 0;\n    }\n  }\n  return sum;\n}\n"}
{"label": "18", "index": "33974", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[101][101], i, j, t;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    int ti = 2, sum = 0;\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    }\n    for (ti = 2; ti <= n; ti++) {\n      int mins[101], minl[101];\n      for (int p = 1; p <= n; p++) {\n        mins[p] = 10000;\n        minl[p] = 10000;\n      }\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (a[i][j] >= 0 && a[i][j] <= mins[i])\n            mins[i] = a[i][j];\n        }\n        for (j = 1; j <= n; j++)\n          a[i][j] = a[i][j] - mins[i];\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          if (a[i][j] >= 0 && a[i][j] <= minl[j])\n            minl[j] = a[i][j];\n        }\n\n        for (i = 1; i <= n; i++)\n          a[i][j] = a[i][j] - minl[j];\n      }\n      sum = sum + a[ti][ti];\n      for (i = 1; i <= n; i++) {\n        for (j = 1; j <= n; j++) {\n          if (i == ti || j == ti)\n            a[i][j] = -1;\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33975", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k, i, j, sum, min, anw = 0;\n  int test[100][100];\n  cin >> n;\n  sum = n;\n  for (k = 0; k < sum; k++) {\n    n = sum;\n    for (i = 0; i < sum; i++)\n      for (j = 0; j < sum; j++) {\n        cin >> test[i][j];\n      }\n    anw = 0;\n    while (n != 1) {\n      for (i = 0; i < n; i++) {\n        min = test[i][0];\n        for (j = 0; j < n; j++) {\n          if (min > test[i][j])\n            min = test[i][j];\n        }\n        for (j = 0; j < n; j++)\n          test[i][j] -= min;\n      }\n      for (i = 0; i < n; i++) {\n        min = test[0][i];\n        for (j = 0; j < n; j++) {\n          if (min > test[j][i])\n            min = test[j][i];\n        }\n        for (j = 0; j < n; j++) {\n          test[j][i] -= min;\n        }\n      }\n      anw += test[1][1];\n      n--;\n      for (i = 1; i < n; i++) {\n        for (j = 0; j <= n; j++)\n          test[i][j] = test[i + 1][j];\n      }\n      for (j = 1; j < n; j++) {\n        for (i = 0; i < n; i++)\n          test[i][j] = test[i][j + 1];\n      }\n    }\n    printf(\"%d\\n\", anw);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33976", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> *(a[k][i] + j);\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (*(a[p][i] + j) < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][i] + k) = *(a[p][i] + k) - min;\n        }\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (*(a[p][i] + j) < min)\n            min = *(a[p][i] + j);\n        }\n        for (k = 1; k <= h; k++) {\n          *(a[p][k] + j) = *(a[p][k] + j) - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        *(a[p][2] + i) = 0;\n      for (j = 1; j <= h; j++)\n        *(a[p][j] + 2) = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][j] + i - 1) = *(a[p][j] + i);\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          *(a[p][i - 1] + j) = *(a[p][i] + j);\n        }\n      }\n      h -= 1;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33977", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;    \n  cin >> n; \n  int q;    \n  q = n;    \n  int a[150][150], sum = 0, i, j, k, l, m, p,\n                   min; \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k]; \n      }\n    }\n    while (n != 1) \n    {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (l = 1; l < n; l++) {\n          if (min > a[j][l])\n            min = a[j][l]; \n        }\n        for (m = 0; m < n; m++) {\n          a[j][m] = a[j][m] - min; \n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (l = 1; l < n; l++) {\n          if (min > a[l][j]) \n            min = a[l][j];\n        }\n        for (m = 0; m < n; m++) {\n          a[m][j] = a[m][j] - min; \n        }\n      }\n      sum = sum + a[1][1]; \n      for (p = 2; p < n; p++) {\n        a[0][p - 1] = a[0][p]; \n        a[p - 1][0] = a[p][0]; \n      }\n      for (j = 2; j < n; j++) {\n        for (l = 2; l < n; l++) {\n          a[j - 1][l - 1] = a[j][l]; \n        }\n      }\n      n--; \n    }\n    cout << sum << endl; \n    sum = 0;             \n    n = q;               \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33978", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint min(int a[], int nx) \n{                        \n  int x, min;\n  min = a[0];\n  for (x = 0; x <= nx - 1; x++) \n  {\n    if (a[x] <= min) {\n      min = a[x];\n    }\n  }\n  return min; \n} \n\nint main()                                                  \n{                                                           \n  int temp, nx, y, sum, i, j, k, n, a[100][100], b[100], m; \n  cin >> n;                                                 \n  for (i = 1; i <= n; i++)                                  \n  {\n    sum = 0; \n    nx = n;\n    for (j = 0; j <= n - 1; j++) \n    {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (y = 1; y <= n - 1; y++) \n    {                            \n      for (j = 0; j <= n - 1; j++) {\n        temp = min(a[j], nx); \n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) \n      {\n        for (m = 0; m <= n - 1; m++) \n        {\n          b[m] = a[m][k];\n        }\n        temp = min(b, nx); \n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      sum = sum + a[1][1];         \n      for (j = 1; j <= n - 2; j++) \n      {\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (k = 1; k <= n - 2; k++) {\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      nx--; \n    }\n    cout << sum << endl; \n  }                      \n  return 0;              \n} \n"}
{"label": "18", "index": "33979", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min = 0, num;\n  int s[100][100];\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    num = 0;\n    memset(s, 0, sizeof(s));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(s + i) + j);\n    for (k = 0; k <= n - 2; k++) {\n      for (i = 1; i <= n - k; i++) {\n        min = s[i][1];\n        for (j = 1; j <= n - k; j++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (j = 1; j <= n - k; j++)\n          *(*(s + i) + j) -= min;\n      }\n      for (j = 1; j <= n - k; j++) {\n        min = s[1][j];\n        for (i = 1; i <= n - k; i++) {\n          if (*(*(s + i) + j) < min)\n            min = *(*(s + i) + j);\n        }\n        for (i = 1; i <= n - k; i++) {\n          *(*(s + i) + j) -= min;\n        }\n      }\n      num += s[2][2];\n      for (i = 1; i <= n - k; i++)\n        for (j = 2; j <= n - k - 1; j++)\n          *(*(s + i) + j) = *(*(s + i) + j + 1);\n      for (j = 1; j <= n - k; j++)\n        for (i = 2; i <= n - k - 1; i++)\n          *(*(s + i) + j) = *(*(s + i + 1) + j);\n    }\n    cout << num << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint calc(int s[][100], int n) {\n  int min;\n  for (int i = 0; i < n; i++) {\n    min = s[i][0];\n    for (int j = 1; j < n; j++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int j = 0; j < n; j++)\n      s[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = s[0][j];\n    for (int i = 1; i < n; i++)\n      if (s[i][j] < min)\n        min = s[i][j];\n    for (int i = 0; i < n; i++)\n      s[i][j] -= min;\n  }\n  return s[1][1];\n}\n\nint main() {\n  int s[100][100];\n  int n, sum, m;\n  scanf(\"%d \", &n);\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> s[i][j];\n    m = n;\n    sum = 0;\n    for (int order = 1; order < n; order++) {\n      sum += calc(s, m);\n      m--;\n      for (int i = 1; i < n - 1; i++)\n        for (int j = 0; j < n; j++)\n          s[i][j] = s[i + 1][j];\n      for (int j = 1; j < n - 1; j++)\n        for (int i = 0; i < m; i++)\n          s[i][j] = s[i][j + 1];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33981", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum[100] = {0};\n  int a[100][100][100] = {0};\n  int i, j, k, min, t, l;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[k][i][0];\n        for (j = 0; j < n - t; j++)\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        for (j = 0; j < n - t; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        min = a[k][0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n      sum[k] = sum[k] + a[k][1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - 1 - t; j++)\n          a[k][i][j] = a[k][i][j + 1];\n\n      for (j = 0; j < n - 1 - t; j++)\n        for (i = 1; i < n - 1; i++)\n          a[k][i][j] = a[k][i + 1][j];\n      t = t + 1;\n    }\n    cout << sum[k] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33982", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], b[100], c[100];\nint xiao(int n) {\n  int x;\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[i]][c[j]] < min)\n        min = a[b[i]][b[j]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[i]][c[j]] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = INT_MAX;\n    for (int j = 0; j < n; j++) {\n      if (a[b[j]][c[i]] <= min)\n        min = a[b[j]][b[i]];\n    }\n    for (int j = 0; j < n; j++) {\n      a[b[j]][c[i]] -= min;\n    }\n  }\n  x = a[b[1]][c[1]];\n  if (n > 2) {\n    for (int i = 1; i < n - 1; i++) {\n      b[i] = b[i + 1];\n      c[i] = c[i + 1];\n    }\n    return (x + xiao(n - 1));\n  } else\n    return x;\n}\nint main() {\n  int n;\n\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (int i = 0; i < n; i++) {\n      b[i] = c[i] = i;\n    }\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n\n    cout << xiao(n) << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "33983", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t, k, i, j, n, a[101][101], sum, min;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    t = n;\n    sum = 0;\n    while (t > 1) {\n      for (i = 0; i < t; i++) {\n        min = a[i][0];\n        for (j = 0; j < t; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        min = a[0][j];\n        for (i = 0; i < t; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i < t; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < t - 1; i++) {\n        for (j = 0; j < t; j++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n      for (j = 1; j < t - 1; j++) {\n        for (i = 0; i < t + 1; i++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      t--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33984", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid hang(int[], int);\nvoid xiaojie(int[], int);\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int min, sum;\n  int a[101][101];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - m; i++)\n        hang(a[i], n - m);\n      for (j = 0; j < n - m; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n - m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - m; i++)\n        xiaojie(a[i], n - m);\n      for (j = 0; j < n - 1 - m; j++) {\n        for (i = 1; i < n - 1 - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid hang(int a[], int leg) {\n  int min = a[0];\n  int i;\n  for (i = 0; i < leg; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < leg; i++)\n    a[i] = a[i] - min;\n}\nvoid xiaojie(int a[], int leg) {\n  int i;\n  for (i = 1; i < leg; i++)\n    a[i] = a[i + 1];\n}\n"}
{"label": "18", "index": "33985", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100];\nvoid hang(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[m][i] < min)\n      min = a[m][i];\n  }\n  for (int i = 0; i < n; i++)\n    a[m][i] -= min;\n}\nvoid lie(int m) {\n  int min = 10000;\n  for (int i = 0; i < n; i++) {\n    if (a[i][m] < min)\n      min = a[i][m];\n  }\n  for (int i = 0; i < n; i++)\n    a[i][m] -= min;\n}\nvoid del(int a[100][100]) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint main() {\n  int i;\n  cin >> n;\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    int k = 0, sum = 0;\n    while (k < n - 1) {\n      for (i = 0; i < n; i++)\n        hang(i);\n      for (i = 0; i < n; i++)\n        lie(i);\n      sum += a[1][1];\n      del(a);\n      k++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint juzhen() {\n  int j1, j2, j3, j4, j5;\n  int min, sum = 0;\n  for (j1 = n; j1 > 1; j1--) {\n    for (j2 = 0; j2 < j1; j2++) {\n      min = a[j2][0];\n      for (j3 = 0; j3 < j1; j3++) {\n        if (a[j2][j3] < min)\n          min = a[j2][j3];\n      }\n      for (j3 = 0; j3 < j1; j3++) {\n        a[j2][j3] = a[j2][j3] - min;\n      }\n    }\n    for (j4 = 0; j4 < j1; j4++) {\n      min = a[0][j4];\n      for (j5 = 0; j5 < j1; j5++) {\n        if (a[j5][j4] < min)\n          min = a[j5][j4];\n      }\n      for (j5 = 0; j5 < j1; j5++) {\n        a[j5][j4] = a[j5][j4] - min;\n      }\n    }\n    sum = sum + a[1][1];\n    for (j2 = 0; j2 < j1; j2++) {\n      for (j3 = 0; j3 < j1; j3++) {\n        if (j2 == 0 && j3 > 1)\n          a[j2][j3 - 1] = a[j2][j3];\n        if (j3 == 0 && j2 > 1)\n          a[j2 - 1][j3] = a[j2][j3];\n        if (j2 > 1 && j3 > 1)\n          a[j2 - 1][j3 - 1] = a[j2][j3];\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int m1, m2, m3, sum;\n  cin >> n;\n  for (m1 = 1; m1 <= n; m1++) {\n    for (m2 = 0; m2 < n; m2++) {\n      for (m3 = 0; m3 < n; m3++) {\n        cin >> a[m2][m3];\n      }\n    }\n    sum = juzhen();\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "33987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main()\n\n{\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int t = 0;\n  int a[100][100];\n  int s = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 1; m <= n - 1; m++) {\n\n      for (i = 0; i < n - m + 1; i++) {\n        t = a[i][0];\n        for (j = 1; j < n - m + 1; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - m + 1; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - m + 1; j++) {\n        t = a[0][j];\n        for (i = 1; i < n - m + 1; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - m + 1; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - m; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - m; j++) {\n        for (i = 1; i < n - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << s << \"\\n\";\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33988", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, size, t, i, j, round, a[101][101], s[101], minx[101], miny[101];\n  memset(s, 0, sizeof(s));\n  cin >> n;\n  size = n;\n\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    size = n;\n    for (round = 1; round <= n - 1; round++) {\n      for (i = 1; i <= size; i++) {\n        minx[i] = a[i][1];\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - minx[i];\n        }\n      }\n      for (j = 1; j <= size; j++) {\n        miny[j] = a[1][j];\n      }\n      for (j = 1; j <= size; j++) {\n        for (i = 1; i <= size; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - miny[j];\n        }\n      }\n\n      s[t] = s[t] + a[2][2];\n      for (j = 2; j <= size - 1; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        for (j = 2; j <= size - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      size--;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    cout << s[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33989", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nvoid shrink(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\nint Sum(int n) {\n  int i;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0], j;\n    for (j = 1; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i], j;\n    for (j = 1; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n  shrink(n);\n  return k + Sum(n - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33990", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f1(int a[][100], int k) {\n  int i, j, min;\n  for (j = 0; j < k; j++) {\n    min = a[j][0];\n    for (i = 1; i < k; i++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (i = 0; i < k; i++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    min = a[0][i];\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid f2(int a[][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < k - 1; j++)\n      a[j][i] = a[j + 1][i];\n  }\n}\nint main() {\n  int n, z, k;\n  scanf(\"%d\", &n);\n  k = n;\n  for (z = 0; z < n; z++) {\n    int i, j, sum = 0;\n    int a[100][100];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    }\n    k = n;\n    for (k; k > 1; k--) {\n      f1(a, k);\n      sum += a[1][1];\n      f2(a, k);\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33991", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint min(int a, int b) \n{\n  return a < b ? a : b;\n}\n\nint f(int n, int number[100][100]) \n{\n  int num[100], m = 10000; \n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      m = min(m, number[i][j]);\n    }\n    num[i] = m;\n    m = 10000;\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      number[i][j] = number[i][j] - num[i];\n    }\n  }\n  \n  m = 10000;\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      m = min(m, number[i][j]);\n    }\n    num[j] = m;\n    m = 10000;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      number[i][j] = number[i][j] - num[j];\n    }\n  }\n  \n  if (n == 2)\n    \n    return number[1][1];\n  else {\n    int sum;\n    sum = number[1][1];\n    for (int j = 0; j < n; j++) \n    {\n      for (int i = 1; i < n - 1; i++) {\n        number[i][j] = number[i + 1][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n - 1; j++) {\n        number[i][j] = number[i][j + 1];\n      }\n    }\n    return sum + f(n - 1, number);\n  }\n}\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int n1 = n;\n  while (n--) {\n    int number[100][100];\n    for (int i = 0; i < n1; i++) {\n      for (int j = 0; j < n1; j++) {\n        cin >> number[i][j];\n      }\n    }\n    int sum = f(n1, number);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33992", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, A[111][111];\n\nvoid sum() {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      cin >> A[i][j];\n\n  int S = 0;\n  for (int t = n; t > 1; t--) {\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[i][j] < min)\n          min = A[i][j];\n      }\n      for (int j = 0; j < t; j++)\n        A[i][j] -= min;\n    }\n\n    for (int i = 0; i < t; i++) {\n      int min = 999999;\n      for (int j = 0; j < t; j++) {\n        if (A[j][i] < min)\n          min = A[j][i];\n      }\n      for (int j = 0; j < t; j++) {\n        A[j][i] -= min;\n      }\n    }\n\n    S += A[1][1];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[i][j] = A[i + 1][j];\n\n    for (int i = 1; i < t; i++)\n      for (int j = 0; j < t; j++)\n        A[j][i] = A[j][i + 1];\n  }\n  cout << S << endl;\n}\n\nint main() {\n  cin >> n;\n  for (int i = 0; i < n; i++)\n    sum();\n}\n"}
{"label": "18", "index": "33993", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, a[100][100], min = 0, sum[100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum[k] = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    for (l = 1; l <= n - 1; l++) {\n      for (i = 0; i <= n - l; i++) {\n        min = a[i][0];\n        for (j = 1; j <= n - l; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j <= n - l; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j <= n - l; j++) {\n        min = a[0][j];\n        for (i = 1; i <= n - l; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (i = 0; i <= n - l; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n\n      {\n        for (j = 0; j <= n - l; j++) {\n          for (i = 1; i <= n - l - 1; i++)\n            a[i][j] = a[i + 1][j];\n        }\n        for (i = 0; i <= n - l - 1; i++) {\n          for (j = 1; j <= n - l - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n    }\n  }\n  for (k = 1; k <= n; k++)\n    cout << sum[k] << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "33994", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, num, minx[101], miny[101];\n  int a[101][101];\n  cin >> num;\n  const int number = num;\n  while (num > 0) {\n    int sum = 0;\n    for (i = 0; i < number; i++)\n      for (j = 0; j < number; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    n = number;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        minx[i] = 1000;\n        miny[i] = 1000;\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[i][k] = a[i][k] - minx[i];\n      for (j = 0; j < n; j++)\n        for (i = 0; i < n; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (k = 0; k < n; k++)\n          a[k][i] = a[k][i] - miny[i];\n      sum += a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n - 1; i++)\n          a[i][j] = a[i][j + 1];\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    num--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum[100] = {0};\n  int a[100][100][100] = {0};\n  int i, j, k, min, t, l;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[k][i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[k][i][0];\n        for (j = 0; j < n - t; j++)\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        for (j = 0; j < n - t; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        min = a[k][0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n      sum[k] = sum[k] + a[k][1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - 1 - t; j++) {\n          a[k][i][j] = a[k][i][j + 1];\n        }\n      for (j = 0; j < n - 1 - t; j++)\n        for (i = 1; i < n - 1; i++)\n          a[k][i][j] = a[k][i + 1][j];\n      t = t + 1;\n    }\n    cout << sum[k] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33996", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid Delete(int a[][101], int, int);\nint check_min(int a[], int);\n\nint sum[101], a[101][101];\n\nint main() {\n  int n, p;\n  int i, j, l, m, k;\n  memset(a, 0, sizeof(a));\n  memset(sum, 0, sizeof(sum));\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    Delete(a, n, k);\n  }\n\n  for (l = 0; l < n; l++) {\n    cout << sum[l] << endl;\n  }\n  return 0;\n}\n\nvoid Delete(int a[][101], int n, int p) {\n  if (n == 1)\n    return;\n  int i, j, k, l, m, q, r, s, min, Min[101];\n  for (i = 0; i < n; i++) {\n    min = check_min(a[i], n);\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (j == 0)\n        Min[i] = a[j][i];\n      if (a[j][i] < Min[i])\n        Min[i] = a[j][i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - Min[i];\n    }\n  }\n  sum[p] = sum[p] + a[1][1];\n  for (k = 2; k < n; k++) {\n    for (l = 2; l < n; l++) {\n      a[k - 1][l - 1] = a[k][l];\n    }\n  }\n  for (m = 2; m < n; m++) {\n    a[0][m - 1] = a[0][m];\n    a[m - 1][0] = a[m][0];\n  }\n  Delete(a, n - 1, p);\n}\n\nint check_min(int a[], int n) {\n  int min;\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      min = a[i];\n    if (a[i] < min)\n      min = a[i];\n  }\n  return min;\n}\n"}
{"label": "18", "index": "33997", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int N = 0;\n  cin >> N;\n  for (int n = 0; n < N; n++) {\n    int a[100][100] = {0};\n    int Sum = 0;\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> a[i][j];\n    for (int m = N; m > 1; m--) {\n      for (int i = 0; i < m; i++) {\n        int Min = a[i][0];\n        for (int j = 0; j < m; j++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - Min;\n        }\n      }\n      for (int j = 0; j < m; j++) {\n        int Min = a[0][j];\n        for (int i = 0; i < m; i++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int i = 0; i < m; i++)\n          a[i][j] = a[i][j] - Min;\n      }\n      Sum = Sum + a[1][1];\n      for (int j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (int i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (int i = 1; i < m - 1; i++)\n        for (int j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    cout << Sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint s = 0, a[100][100];\nvoid hang(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n    min = 0;\n  }\n}\nvoid lie(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (min >= a[j][i])\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n    min = 0;\n  }\n}\nvoid xiaoqu(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n}\nvoid sum(int n) {\n  if (n > 1) {\n    hang(n);\n    lie(n);\n    s += a[1][1];\n    xiaoqu(n);\n    sum(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int k = n;\n  while (k) {\n    k--;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum(n);\n    printf(\"%d\\n\", s);\n    s = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "33999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0;\n  int a[105][105] = {0};\n  while (cin >> a[0][0]) {\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        if (i == 0 && j == 0)\n          continue;\n        cin >> a[i][j];\n      }\n    }\n\n    int tmp = n;\n    int sum = 0;\n    while (--tmp) {\n      int tmp_min;\n\n      for (i = 0; i < tmp + 1; ++i) {\n        tmp_min = 600000;\n        for (j = 0; j < tmp + 1; ++j) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (j = 0; j < tmp + 1; ++j) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n\n      for (j = 0; j < tmp + 1; ++j) {\n        tmp_min = 600000;\n        for (i = 0; i < tmp + 1; ++i) {\n          if (tmp_min > a[i][j])\n            tmp_min = a[i][j];\n        }\n        if (tmp_min) {\n          for (i = 0; i < tmp + 1; ++i) {\n            a[i][j] -= tmp_min;\n          }\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 2; i < tmp + 1; ++i) {\n        a[0][i - 1] = a[0][i];\n        a[i - 1][0] = a[i][0];\n      }\n      for (i = 2; i < tmp + 1; ++i) {\n        for (j = 2; j < tmp + 1; ++j) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, m, i, j, x, y;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    int s = 0, t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (y = n; y >= 2; y--) {\n      for (i = 0; i < n - t; i++) {\n        x = a[i][0];\n        for (j = 0; j < n - t; j++) {\n          if (x > a[i][j])\n            x = a[i][j];\n        }\n        for (j = 0; j < n - t; j++)\n          a[i][j] -= x;\n      }\n      for (j = 0; j < n - t; j++) {\n        x = a[0][j];\n        for (i = 0; i < n - t; i++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (i = 0; i < n - t; i++)\n          a[i][j] -= x;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      t++;\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34001", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100];\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int ans = 0;\n    for (int nn = n; nn > 1; nn--) {\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (int j = 0; j < nn; j++)\n          a[i][j] -= min;\n      }\n      for (int i = 0; i < nn; i++) {\n        int min = 50000;\n        for (int j = 0; j < nn; j++)\n          if (min > a[j][i])\n            min = a[j][i];\n        for (int j = 0; j < nn; j++)\n          a[j][i] -= min;\n      }\n      ans += a[1][1];\n      for (int i = 1; i < nn; i++)\n        for (int j = 0; j < nn; j++)\n          a[i][j] = a[i + 1][j];\n      for (int j = 1; j < nn; j++)\n        for (int i = 0; i < nn; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], m, i, j, k, x, p, s = 0;\n  scanf(\"%d\", &n);\n  m = n;\n  for (k = 0; k < m; k++) {\n    for (i = 0; i < m; i++)\n      for (j = 0; j < m; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (p = 1; p < m; p++) {\n      for (i = 0; i < n; i++) {\n        x = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (j = 0; j < n; j++)\n            a[i][j] = a[i][j] - x;\n      }\n      for (j = 0; j < n; j++) {\n        x = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < x)\n            x = a[i][j];\n        if (x != 0)\n          for (i = 0; i < n; i++)\n            a[i][j] = a[i][j] - x;\n      }\n      s = s + a[1][1];\n      for (i = 2; i < n; i++) {\n        a[i - 1][0] = a[i][0];\n        a[0][i - 1] = a[0][i];\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      n--;\n    }\n    printf(\"%d\\n\", s);\n    s = 0;\n    n = m;\n  }\n}\n"}
{"label": "18", "index": "34003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid fact(int n);\nint sum(int n);\nint a[100][100];\nint i = 0, j = 0;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << sum(n) << \"\\n\";\n  }\n  return 0;\n}\nvoid fact(int n) {\n\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\n\nint sum(int n) {\n  fact(n);\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "34004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, i, j, k, l, len = 0, sum = 0;\nint array_1[100][100];\nvoid guilinhang(int a) {\n  int min = array_1[a][0];\n  for (l = 0; l < len; l++) {\n    if (array_1[a][l] < min)\n      min = array_1[a][l];\n  }\n  for (l = 0; l < len; l++)\n    array_1[a][l] = array_1[a][l] - min;\n}\nvoid guilinlie(int a) {\n  int min = array_1[0][a];\n  for (l = 0; l < len; l++) {\n    if (array_1[l][a] < min)\n      min = array_1[l][a];\n  }\n  for (l = 0; l < len; l++)\n    array_1[l][a] = array_1[l][a] - min;\n}\nvoid xiaojian(int a) {\n  if (a == 2)\n    return;\n  else if (a > 2) {\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[j][i] = array_1[j][i + 1];\n    }\n    for (i = 1; i < a - 1; i++) {\n      for (j = 0; j < a; j++)\n        array_1[i][j] = array_1[i + 1][j];\n    }\n  }\n}\nint main() {\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    len = n;\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    }\n    while (len >= 2) {\n      for (i = 0; i < len; i++) {\n        guilinhang(i);\n      }\n      for (i = 0; i < len; i++) {\n        guilinlie(i);\n      }\n      sum = sum + array_1[1][1];\n      xiaojian(len);\n      len--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int a[111][111], sum;\n  int i, j, k, l, Min;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        cin >> a[j][k];\n      }\n    }\n\n    for (j = 1; j < n; j++) {\n      Min = 10000;\n      for (l = j + 1; l <= n; l++)\n        Min = min(Min, a[1][l]);\n\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++)\n        a[1][l] = a[1][l] - Min;\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[k][l]);\n        }\n        Min = min(Min, a[k][1]);\n        for (l = j + 1; l <= n; l++) {\n          a[k][l] = a[k][l] - Min;\n        }\n        a[k][1] = a[k][1] - Min;\n      }\n      Min = 10000;\n      for (l = j + 1; l <= n; l++) {\n        Min = min(Min, a[l][1]);\n      }\n      Min = min(Min, a[1][1]);\n      for (l = j + 1; l <= n; l++) {\n        a[l][1] = a[l][1] - Min;\n      }\n      a[1][1] = a[1][1] - Min;\n      for (k = j + 1; k <= n; k++) {\n        Min = 10000;\n        for (l = j + 1; l <= n; l++) {\n          Min = min(Min, a[l][k]);\n        }\n        Min = min(Min, a[1][k]);\n        for (l = j + 1; l <= n; l++) {\n          a[l][k] = a[l][k] - Min;\n        }\n        a[1][k] = a[1][k] - Min;\n      }\n      sum = sum + a[j + 1][j + 1];\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "34006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, sum, min;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[j][k])\n            min = a[j][k];\n        }\n        for (k = 0; k < n - l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < n - l; j++) {\n        min = a[0][j];\n        for (k = 1; k < n - l; k++) {\n          if (min > a[k][j])\n            min = a[k][j];\n        }\n        for (k = 0; k < n - l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j < n - l - 1; j++) {\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - l - 1; j++)\n        a[0][j] = a[0][j + 1];\n\n      for (j = 2; j < n - l; j++) {\n        for (k = 2; k < n - l; k++) {\n          a[j - 1][k - 1] = a[j][k];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zero1(int *p, int n) {\n  int i, c;\n  c = *p;\n  for (i = 1; i < n; i++)\n    if (*(p + i) < c)\n      c = *(p + i);\n  for (i = 0; i < n; i++)\n    p[i] = p[i] - c;\n}\nvoid zero2(int **p, int n, int t) {\n  int i, c;\n  c = *(*p + t);\n  for (i = 1; i < n; i++)\n    if (*(*(p + i) + t) < c)\n      c = *(*(p + i) + t);\n  for (i = 0; i < n; i++)\n    *(*(p + i) + t) = *(*(p + i) + t) - c;\n}\nvoid cut(int **p, int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      *(*(p + j) + i) = *(*(p + j) + i + 1);\n}\nint main() {\n  int n, m, i, j, w, c;\n  int **p;\n  scanf(\"%d\", &m);\n  p = (int **)malloc(m * sizeof(int *));\n  for (i = 0; i < m; i++)\n    *(p + i) = (int *)malloc(m * sizeof(int));\n  for (w = 0; w < m; w++) {\n    n = m;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(p + i) + j);\n    for (i = 0; i < n; i++)\n      zero1(p[i], n);\n    for (i = 0; i < n; i++)\n      zero2(p, n, i);\n    c = p[1][1];\n    for (i = 0; i < m - 2; i++) {\n      cut(p, n);\n      n--;\n      for (j = 0; j < n; j++)\n        zero1(p[j], n);\n      for (j = 0; j < n; j++)\n        zero2(p, n, j);\n      c += p[1][1];\n    }\n    printf(\"%d\\n\", c);\n  }\n  for (i = 0; i < n; i++)\n    free(p[i]);\n  free(p);\n  return 0;\n}\n"}
{"label": "18", "index": "34008", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, a[101][101], s;\nvoid cal() {\n  int i, j, k, l, m;\n  for (j = 0; j < n; ++j)\n    for (k = 0; k < n; ++k)\n      cin >> a[j][k];\n  s = 0;\n  for (j = 0; j < n; ++j) {\n    for (k = j; k < n; ++k) \n    {\n      for (m = l = j; l < n; ++l)\n        if (a[k][l] < a[k][m])\n          m = l;\n      m = a[k][m];\n      for (l = j; l < n; ++l)\n        a[k][l] -= m;\n    }\n    for (k = j; k < n; ++k) \n    {\n      for (m = l = j; l < n; ++l)\n        if (a[l][k] < a[m][k])\n          m = l;\n      m = a[m][k];\n      for (l = j; l < n; ++l)\n        a[l][k] -= m;\n    }\n    s += a[j + 1][j + 1];\n    for (k = j + 1; k < n; ++k) \n    {\n      a[j + 1][k] = a[j][k];\n      a[k][j + 1] = a[k][j];\n    }\n    a[j + 1][j + 1] = a[j][j];\n  }\n  return;\n}\nint main() {\n  int i;\n  cin >> n;\n  for (i = 1; i <= n; ++i) {\n    cal(); \n    cout << s << endl;\n  }\n}\n"}
{"label": "18", "index": "34009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m = 0, min, sum = 0;\n  int i, j, k, q;\n  scanf(\"%d\", &n);\n  int **a = (int **)calloc(n, sizeof(int *));\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      a[i] = (int *)calloc(n, sizeof(int));\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n        if (a[i][j] > m)\n          m = a[i][j];\n      }\n    }\n    min = m;\n    for (q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - q; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      for (j = 0; j < n - q; j++) {\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - q; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n        min = m;\n      }\n      sum = a[1][1] + sum;\n      for (i = 0; i < n - q; i++) {\n        for (j = 1; j < n - q - 1; j++) {\n          a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 1; i < n - q - 1; i++) {\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    printf(\"%d \", sum);\n    sum = 0;\n  }\n}\n"}
{"label": "18", "index": "34010", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nvoid ope(int m, int a[][101]) {\n  if (m == 1)\n    return;\n  else {\n    int i, j, q, min = 100000;\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[i][q] = a[i][q] - min;\n      }\n      min = 100000;\n    }\n    for (i = 0; i <= m - 1; i++) {\n      for (j = 0; j <= m - 1; j++) {\n        if (a[j][i] < min) {\n          min = a[j][i];\n        }\n      }\n      for (q = 0; q <= m - 1; q++) {\n        a[q][i] = a[q][i] - min;\n      }\n      min = 100000;\n    }\n    sum = sum + a[1][1];\n    for (i = 2; i <= m - 1; i++) {\n      for (j = 2; j <= m - 1; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n      a[0][i - 1] = a[0][i];\n      a[i - 1][0] = a[i][0];\n    }\n    ope(m - 1, a);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int a[101][101];\n  int i, j, k;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    ope(n, a);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34011", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum = 0;\n  cin >> n;\n  int i, j, k, h, p;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    int board[105][105] = {0};\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> board[i][j];\n      }\n    }\n    for (h = 0; h < n; h++) {\n      for (i = h; i < n; i++) {\n        int min = board[i][h];\n        for (j = h; j < n; j++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (j = h; j < n; j++) {\n          board[i][j] -= min;\n        }\n      }\n      for (j = h; j < n; j++) {\n        int min = board[h][j];\n        for (i = h; i < n; i++) {\n          if (board[i][j] < min) {\n            min = board[i][j];\n          }\n        }\n        for (i = h; i < n; i++) {\n          board[i][j] -= min;\n        }\n      }\n      sum += board[h + 1][h + 1];\n      board[h + 1][h + 1] = board[h][h];\n      for (p = h + 2; p < n; p++) {\n        board[h + 1][p] = board[h][p];\n      }\n      for (p = h + 2; p < n; p++) {\n        board[p][h + 1] = board[p][h];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34012", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  int i, j, k;\n  int q;\n  int a[110][110];\n  int(*p)[110] = a;\n  cin >> n;\n  q = n;\n  for (k = 1; k <= q; k++) {\n    int sum = 0;\n    n = q;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(p + i) + j);\n    while (1) {\n      if (n == 1)\n        break;\n      int min = 0;\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        for (j = 1; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = 1; i <= n; i++) {\n        min = 9999999;\n        for (j = 1; j <= n; j++)\n          if (min > *(*(p + j) + i))\n            min = *(*(p + j) + i);\n        for (j = 1; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      sum += a[2][2];\n      for (i = 2; i <= n - 1; i++)\n        for (j = 2; j <= n - 1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n      for (i = 2; i <= n - 1; i++) {\n        *(*(p + 1) + i) = *(*(p + 1) + i + 1);\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      }\n      n--;\n    }\n    cout << sum << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34013", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[101][101], sum = 0;\n\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min;\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min2;\n    min2 = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (a[i][j] < min2) {\n        min2 = a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min2;\n    }\n  }\n}\n\nvoid subtract(int n) {\n  if (n > 2) {\n    for (int j = 2; j < n; j++) {\n      a[0][j - 1] = a[0][j];\n    }\n    for (int i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n    }\n    for (int i = 2; i < n; i++) {\n      for (int j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n  }\n}\n\nvoid process(int n) {\n  if (n != 1) {\n    zero(n);\n    sum += a[1][1];\n    subtract(n);\n    process(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    process(n);\n    cout << sum;\n    if (p != n - 1) {\n      cout << endl;\n    }\n    sum = 0;\n  }\n}\n"}
{"label": "18", "index": "34014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid diminish(int a[105][105], int stair) {\n  int i, j, min[105];\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[i][1];\n    for (j = 1; j <= stair; j++) {\n      if (a[i][j] < min[i]) {\n        min[i] = a[i][j];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[i][j] -= min[i];\n    }\n  }\n  for (i = 1; i <= stair; i++) {\n    min[i] = a[1][i];\n    for (j = 1; j <= stair; j++) {\n      if (a[j][i] < min[i]) {\n        min[i] = a[j][i];\n      }\n    }\n    for (j = 1; j <= stair; j++) {\n      a[j][i] -= min[i];\n    }\n  }\n}\nvoid lowerstair(int a[105][105], int stair) {\n  int i, j;\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 2; i <= stair - 1; i++) {\n    for (j = 1; j <= stair; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nint deal(int a[105][105], int stair) {\n  int result = 0;\n  while (stair >= 2) {\n    diminish(a, stair);\n    result += a[2][2];\n    lowerstair(a, stair);\n    stair--;\n  }\n  return result;\n}\nint main() {\n  int n, i, j, k, stair, sum, a[105][105];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    stair = n;\n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    sum = deal(a, stair);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34015", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int h, n;\n  cin >> n;\n  for (h = 1; h <= n; h++) {\n    int i, j, k, t, sum = 0, a[105][105];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\" %d\", &a[i][j]);\n    for (t = n; t > 1; t--) {\n      for (i = 0; i < t; i++) {\n        k = a[i][0];\n        for (j = 1; j < t; j++) {\n          if (a[i][j] < k)\n            k = a[i][j];\n        }\n        for (j = 0; j < t; j++)\n          a[i][j] -= k;\n      }\n      for (i = 0; i < t; i++) {\n        k = a[0][i];\n        for (j = 1; j < t; j++) {\n          if (a[j][i] < k)\n            k = a[j][i];\n        }\n        for (j = 0; j <= t; j++)\n          a[j][i] -= k;\n      }\n      sum += a[1][1];\n      for (j = 2; j < t; j++)\n        a[0][j - 1] = a[0][j];\n      for (i = 2; i < t; i++)\n        a[i - 1][0] = a[i][0];\n      for (i = 2; i <= t; i++)\n        for (j = 2; j <= t; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint sum = 0;\nint minu(int x, int y) {\n  if (x < y)\n    return x;\n  else\n    return y;\n}\nvoid del(int n) {\n  int i, m;\n  int num[n];\n  if (n == 1) {\n    cout << sum << endl;\n    return;\n  } else {\n    for (i = 0; i < n; i++) {\n      num[i] = a[i][0];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[i][m]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[i][m] = a[i][m] - num[i];\n    }\n    for (i = 0; i < n; i++) {\n      num[i] = a[0][i];\n      for (m = 0; m < n; m++)\n        num[i] = minu(num[i], a[m][i]);\n      if (num[i] != 0)\n        for (m = 0; m < n; m++)\n          a[m][i] = a[m][i] - num[i];\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[i][m] = a[i + 1][m];\n    for (i = 1; i < n - 1; i++)\n      for (m = 0; m < n; m++)\n        a[m][i] = a[m][i + 1];\n    del(n - 1);\n  }\n}\nint main() {\n  int j, k;\n  int n;\n  scanf(\"%d \", &n);\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    del(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34017", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0;\nint juzhen[101][101] = {0}, sum = 0, hang = 0;\nvoid hangxiao();\nvoid liexiao();\nvoid xiaojian();\nvoid hangxiao() {\n  int i, j, xiao = 1000;\n  for (i = 0; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (j = 0; j < hang; j++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid liexiao() {\n  int i, j, xiao = 1000;\n  for (j = 0; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      if (xiao > juzhen[i][j]) {\n        xiao = juzhen[i][j];\n      }\n    }\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j] -= xiao;\n    }\n    xiao = 1000;\n  }\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 2; i < hang; i++) {\n    for (j = 0; j < hang; j++) {\n      juzhen[i - 1][j] = juzhen[i][j];\n    }\n  }\n  for (j = 2; j < hang; j++) {\n    for (i = 0; i < hang; i++) {\n      juzhen[i][j - 1] = juzhen[i][j];\n    }\n  }\n}\n\nint main() {\n  int a;\n  cin >> a;\n  n = a;\n\n  while (a > 0) {\n    memset(juzhen, 0, sizeof(juzhen));\n    sum = 0;\n    int b, c, d, e, i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &juzhen[i][j]);\n      }\n    hang = n;\n    while (hang > 1) {\n      hangxiao();\n      liexiao();\n      sum += juzhen[1][1];\n      xiaojian();\n      hang--;\n    }\n    cout << sum << endl;\n    a--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint p[10000][10000];\nint f(int x) {\n  int min;\n  int k;\n  if (x == 2) {\n    for (int i = 0; i <= 1; i++)\n      if (p[i][0] > p[i][1]) {\n        p[i][0] = p[i][0] - p[i][1];\n        p[i][1] = 0;\n      } else {\n        p[i][1] = p[i][1] - p[i][0];\n        p[i][0] = 0;\n      }\n    for (int i = 0; i <= 1; i++)\n      if (p[0][i] > p[1][i]) {\n        p[0][i] = p[0][i] - p[1][i];\n        p[1][i] = 0;\n      } else {\n        p[1][i] = p[1][i] - p[0][i];\n        p[0][i] = 0;\n      }\n    return p[1][1];\n\n  }\n\n  else {\n    for (int i = 0; i < x; i++) {\n\n      min = p[i][0];\n      for (int j = 0; j < x; j++)\n\n        if (p[i][j] < min)\n          min = p[i][j];\n      for (int j = 0; j < x; j++)\n        p[i][j] = p[i][j] - min;\n    }\n    for (int i = 0; i < x; i++) {\n\n      min = p[0][i];\n      for (int j = 0; j < x; j++)\n\n        if (p[j][i] < min)\n          min = p[j][i];\n      for (int j = 0; j < x; j++)\n        p[j][i] = p[j][i] - min;\n    }\n    k = p[1][1];\n    for (int i = 0; i < x; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[i][j] = p[i][j + 1];\n    for (int i = 0; i < x - 1; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[j][i] = p[j + 1][i];\n    return k + f(x - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int s = 1;\n  for (s = 1; s <= n; s++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &p[i][j]);\n    cout << f(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34019", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint a[100][100];\nint result = 0;\nint min1;\nint minh(int n, int j) \n{\n  int i, min_a;\n  min_a = a[j][0];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[j][i]) {\n      min_a = a[j][i];\n    }\n  }\n  return min_a;\n}\nint minl(int n, int j) \n{\n  int i, min_a;\n  min_a = a[0][j];\n  for (i = 0; i < n; i++) {\n    if (min_a > a[i][j]) {\n      min_a = a[i][j];\n    }\n  }\n  return min_a;\n}\nint dec(int n) \n{\n  int m, p, q;\n  if (n == 1) {\n    cout << result << endl;\n    return 0;\n  }\n  if (n > 1) {\n    for (m = 0; m < n; m++) \n    {\n      min1 = minh(n, m);\n      for (p = 0; p < n; p++) {\n        a[m][p] = a[m][p] - min1;\n      }\n    }\n    for (m = 0; m < n; m++) \n    {\n      min1 = minl(n, m);\n      for (p = 0; p < n; p++) {\n        a[p][m] = a[p][m] - min1;\n      }\n    }\n    result = result + a[1][1];\n    for (m = 0; m < n; m++) \n    {\n      for (p = 1; p < n - 1; p++) {\n        a[m][p] = a[m][p + 1];\n      }\n    }\n    for (m = 0; m < n - 1; m++) \n    {\n      for (p = 1; p < n - 1; p++) {\n        a[p][m] = a[p + 1][m];\n      }\n    }\n    dec(n - 1);\n  }\n}\nint main(int argc, const char *argv[]) {\n\n  int n;\n  cin >> n;\n  int w, s, t;\n  for (w = 1; w <= n; w++) {\n    for (s = 0; s < n; s++) \n    {\n\n      for (t = 0; t < n; t++) {\n        cin >> a[s][t];\n      }\n    }\n    result = 0;\n    dec(n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint guiling(int count);\nint xiaojian(int count);\n\nint n;\nint a[101][101];\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    for (int count = n; count > 1; count--) {\n      guiling(count);\n      sum += a[1][1];\n      xiaojian(count);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint guiling(int count) {\n  int j, k;\n  for (j = 0; j < count; j++) {\n    int min = a[j][0];\n    for (k = 1; k < count; k++) {\n      if (min > a[j][k]) {\n        min = a[j][k];\n      }\n    }\n    for (k = 0; k < count; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    int min = a[0][k];\n    for (j = 1; j < count; j++) {\n      if (min > a[j][k])\n        min = a[j][k];\n    }\n    for (j = 0; j < count; j++) {\n      a[j][k] -= min;\n    }\n  }\n}\n\nint xiaojian(int count) {\n  int j, k;\n  for (j = 1; j < count - 1; j++) {\n    a[0][j] = a[0][j + 1];\n    a[j][0] = a[j + 1][0];\n    for (k = 1; k < count - 1; k++) {\n      a[j][k] = a[j + 1][k + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "34021", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[20000], b[20000], min, i, j, k, num, sum, n, m, x, y;\n  scanf(\"%d \", &n);\n  for (num = 1; num <= n; num++) {\n    memset(b, 0, sizeof(b));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(b + i * n + j);\n\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      memset(a, 0, sizeof(a));\n      for (i = 0; i < k; i++)\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(b + i * k + j);\n\n      for (i = 0; i < k; i++) {\n        min = 3000;\n        for (j = 0; j < k; j++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (j = 0; j < k; j++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = 3000;\n        for (i = 0; i < k; i++)\n          if (*(a + i * k + j) < min)\n            min = *(a + i * k + j);\n        for (i = 0; i < k; i++)\n          *(a + i * k + j) = *(a + i * k + j) - min;\n      }\n\n      memset(b, 0, sizeof(b));\n      sum = sum + a[k + 1];\n      x = -1;\n      for (i = 0; i < k; i++) {\n        if (i != 1) {\n          x++;\n          y = -1;\n          for (j = 0; j < k; j++)\n            if (j != 1) {\n              y++;\n              *(b + x * k + y - x) = *(a + i * k + j);\n            }\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34022", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, a[101][101] = {0}, j, k, sum = 0, min[101] = {0}, l,\n            min1[101] = {0};\n  cin >> n;\n  l = n;\n  for (k = 1; k <= l; k++) {\n\n    for (i = 1; i <= l; i++) {\n      for (j = 1; j <= l; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    n = l;\n\n    while (n > 1) {\n\n      for (i = 1; i <= n; i++) {\n        min[i] = a[i][1];\n        for (j = 1; j <= n; j++) {\n          if (min[i] > a[i][j])\n            min[i] = a[i][j];\n        }\n      }\n\n      for (i = 1; i <= n; i++) {\n\n        for (j = 1; j <= n; j++) {\n          a[i][j] = a[i][j] - min[i];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        min1[j] = a[1][j];\n        for (i = 1; i <= n; i++) {\n          if (min1[j] > a[i][j])\n            min1[j] = a[i][j];\n        }\n      }\n      for (j = 1; j <= n; j++) {\n        for (i = 1; i <= n; i++) {\n          a[i][j] = a[i][j] - min1[j];\n        }\n      }\n\n      sum = sum + a[2][2];\n      for (j = 2; j < n; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i < n; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      n--;\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100], p, min, sum = 0;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n\n    for (k = 1; k <= n - 1; k++) {\n\n      for (i = 0; i <= n - 1; i++) {\n        min = a[i][0];\n        for (j = k; j <= n - 1; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n\n        for (j = 0; j <= n - 1; j++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      for (j = 0; j <= n - 1; j++) {\n        min = a[0][j];\n        for (i = k; i <= n - 1; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - 1; i++) {\n\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[k][k];\n    }\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint change(int m) {\n  int i, j, k = 0, min, value;\n\n  if (m == 1)\n    return 0;\n\n  for (i = 0; i < m; i++) {\n    min = a[i][0];\n    for (j = 0; j < m; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < m; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < m; i++) {\n    min = a[0][i];\n    for (j = 0; j < m; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < m; j++)\n      a[j][i] -= min;\n  }\n\n  value = a[1][1];\n\n  for (i = 1; i < m - 1; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n\n  for (j = 1; j < m - 1; j++)\n    for (i = 0; i < m - 1; i++)\n      a[i][j] = a[i][j + 1];\n\n  return value + change(m - 1);\n}\nint main() {\n  int n, i, j;\n\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n * n; j++)\n      cin >> a[j / n][j % n];\n\n    printf(\"%d\\n\", change(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34025", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000], n;\n\nvoid sub_to_zero() {\n  int m;\n  for (int i = 0; i < n; i++) {\n    m = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < m)\n        m = a[i][j];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[i][j] -= m;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    m = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < m)\n        m = a[j][i];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[j][i] -= m;\n    }\n  }\n}\n\nvoid delimination() {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 2; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  --n;\n}\n\nint calcMatrix() {\n  int sum = 0;\n  while (n > 1) {\n    sub_to_zero();\n    sum += a[1][1];\n    delimination();\n  }\n  return sum;\n}\n\nint main() {\n  int nMatrix;\n  cin >> nMatrix;\n  for (int i = 0; i < nMatrix; i++) {\n    n = nMatrix;\n    for (int j = 0; j < nMatrix; j++)\n      for (int k = 0; k < nMatrix; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", calcMatrix());\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34026", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, i, j, m, k, sum, min;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    memset(a, 0, sizeof(a));\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 0; k < n - 1; k++) {\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - k; j++)\n          *(*(a + i) + j) -= min;\n      }\n\n      for (i = 0; i < n - k; i++) {\n        min = 100000;\n        for (j = 0; j < n - k; j++) {\n          if (*(*(a + j) + i) < min)\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - k; j++) {\n          *(*(a + j) + i) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (i = 1; i < n; i++)\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34027", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, size, t, i, j, round, a[101][101], s[101], minx[101], miny[101];\n  memset(s, 0, sizeof(s));\n  cin >> n;\n  size = n;\n\n  for (t = 1; t <= n; t++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    size = n;\n    for (round = 1; round <= n - 1; round++) {\n      for (i = 1; i <= size; i++) {\n        minx[i] = a[i][1];\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          if (a[i][j] < minx[i])\n            minx[i] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - minx[i];\n        }\n      }\n      for (j = 1; j <= size; j++) {\n        miny[j] = a[1][j];\n      }\n      for (j = 1; j <= size; j++) {\n        for (i = 1; i <= size; i++) {\n          if (a[i][j] < miny[j])\n            miny[j] = a[i][j];\n        }\n      }\n      for (i = 1; i <= size; i++) {\n        for (j = 1; j <= size; j++) {\n          a[i][j] = a[i][j] - miny[j];\n        }\n      }\n\n      s[t] = s[t] + a[2][2];\n      for (j = 2; j <= size - 1; j++) {\n        a[1][j] = a[1][j + 1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        a[i][1] = a[i + 1][1];\n      }\n      for (i = 2; i <= size - 1; i++) {\n        for (j = 2; j <= size - 1; j++) {\n          a[i][j] = a[i + 1][j + 1];\n        }\n      }\n      size--;\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    printf(\"%d\\n\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34028", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint sum(int n) {\n  int i = 0, j = 0, min = 0, count = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n      else\n        min = min;\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  count = count + a[1][1];\n  if (n == 2)\n    return count;\n  else {\n    for (i = 2; i < n; i++)\n      a[i - 1][0] = a[i][0];\n    for (j = 2; j < n; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < n; i++)\n      for (j = 2; j < n; j++)\n        a[i - 1][j - 1] = a[i][j];\n    count = count + sum(n - 1);\n    return count;\n  }\n}\nint main() {\n  int n, i = 0, j = 0, k = 0, b[100] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    b[i] = sum(n);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%d\\n\", b[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][100] = {0};\nint b[100][100] = {0};\nint i, j, n;\nint num = 0;\nvoid m(int n) \n{\n  int min;\n  for (i = 0; i <= n - 1; ++i) {\n    min = a[i][0];\n    for (j = 0; j <= n - 1; ++j) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n - 1; ++j)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n - 1; ++j) {\n    min = a[0][j];\n    for (i = 0; i <= n - 1; ++i) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n - 1; ++i)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid del(int n) \n{\n  b[0][0] = a[0][0];\n  for (j = 1; j <= n - 2; ++j)\n    b[0][j] = a[0][j + 1];\n  for (i = 1; i <= n - 2; ++i)\n    b[i][0] = a[i + 1][0];\n  for (i = 1; i <= n - 2; ++i) {\n    for (j = 1; j <= n - 2; ++j) {\n      b[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (i = 0; i <= n - 1; ++i) {\n    for (j = 0; j <= n - 1; ++j) {\n      a[i][j] = b[i][j];\n    }\n  }\n}\nint s(int n) \n{\n  m(n);\n  num = num + a[1][1];\n  del(n);\n  if (n != 2)\n    s(n - 1); \n  return num;\n}\nint main() {\n  int k;\n  cin >> n;\n  for (k = 1; k <= n; ++k) {\n    for (i = 0; i <= n - 1; ++i) {\n      for (j = 0; j <= n - 1; ++j) {\n        cin >> a[i][j];\n      }\n    }\n    num = 0;\n    cout << s(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint juzhen[101][101];\nint sum;\nvoid xiaochu(int n) {\n  if (n == 1)\n    ;\n  else {\n    int minj[101];\n    for (int i = 0; i < n; i++)\n      minj[i] = 1000;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        if (juzhen[i][j] < minj[i])\n          minj[i] = juzhen[i][j];\n      }\n      for (int j = 0; j < n; j++) {\n        juzhen[i][j] = juzhen[i][j] - minj[i];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      minj[i] = 1000;\n    }\n    for (int j = 0; j < n; j++) {\n      for (int i = 0; i < n; i++) {\n        if (juzhen[i][j] < minj[j])\n          minj[j] = juzhen[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        juzhen[i][j] = juzhen[i][j] - minj[j];\n    }\n    sum = sum + juzhen[1][1];\n    for (int j = 1; j < n - 1; j++) {\n      juzhen[0][j] = juzhen[0][j + 1];\n      juzhen[j][0] = juzhen[j + 1][0];\n    }\n    for (int i = 1; i < n - 1; i++)\n      for (int j = 1; j < n - 1; j++)\n        juzhen[i][j] = juzhen[i + 1][j + 1];\n    xiaochu(n - 1);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  for (int z = 0; z < n; z++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> juzhen[i][j];\n    sum = 0;\n    xiaochu(n);\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34031", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint sum = 0;\nint a[100][100] = {0};\nvoid temp(int n) {\n  if (n == 1)\n    return;\n  for (int i = 0; i < n; i++) {\n    int miner = 1000;\n    for (int j = 0; j < n; j++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - miner;\n  }\n  for (int j = 0; j < n; j++) {\n    int miner = 1000;\n    for (int i = 0; i < n; i++)\n      if (miner > a[i][j])\n        miner = a[i][j];\n    for (int i = 0; i < n; i++)\n      a[i][j] = a[i][j] - miner;\n  }\n  sum = sum + a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  temp(n - 1);\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  for (int m = 0; m < n; m++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    temp(n);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34032", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint findmin(int c, int low, int n) {\n  int min;\n  if (c == 1) {\n    int i;\n    min = a[low][0];\n    for (i = 0; i < n; i++) {\n      if (a[low][i] < min)\n        min = a[low][i];\n    }\n  }\n  if (c == 0) {\n    int i;\n    min = a[0][low];\n    for (i = 0; i < n; i++) {\n      if (a[i][low] < min)\n        min = a[i][low];\n    }\n  }\n  return min;\n}\nint dec(int n, int sum) {\n  if (n == 1) {\n    return sum;\n  }\n  int i, j, k, min;\n  for (i = 0; i < n; i++) {\n    min = findmin(1, i, n);\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = findmin(0, i, n);\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  sum = sum + a[1][1];\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  return dec(n - 1, sum);\n}\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  int i, j, s, t;\n  for (int k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", dec(n, 0));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34033", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint cut(int t) {\n  int s, i, j;\n  int sum;\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[i][j] < s)\n        s = a[i][j];\n    }\n    for (j = 0; j < t; j++)\n      a[i][j] = a[i][j] - s;\n  }\n  for (i = 0; i < t; i++) {\n    s = 9999;\n    for (j = 0; j < t; j++) {\n      if (a[j][i] < s)\n        s = a[j][i];\n    }\n    for (j = 0; j < t; j++)\n      a[j][i] = a[j][i] - s;\n  }\n  t--;\n  if (t == 1)\n    return a[1][1];\n  else\n    sum = a[1][1];\n  for (i = 0; i < t + 1; i++)\n    for (j = 0; j < t + 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 1 || j == 1)\n        continue;\n      else if (i == 0)\n        a[i][j - 1] = a[i][j];\n      else if (j == 0)\n        a[i - 1][j] = a[i][j];\n      else\n        a[i - 1][j - 1] = a[i][j];\n    }\n  sum = sum + cut(t);\n  return sum;\n}\nint main() {\n  int i, j, k, n;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[j][k] = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << cut(n) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, a[101][101], mini[101], minj[101], ans[101];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    memset(a, 0, sizeof(a));\n    memset(ans, 0, sizeof(ans));\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    m = n;\n    while (m > 1) {\n      memset(mini, 21474836, sizeof(mini));\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          if (a[i][j] < mini[i])\n            mini[i] = a[i][j];\n      for (i = 1; i <= m; i++)\n        for (j = 1; j <= m; j++)\n          a[i][j] = a[i][j] - mini[i];\n      memset(minj, 21474836, sizeof(minj));\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          if (a[i][j] < minj[j])\n            minj[j] = a[i][j];\n      for (j = 1; j <= m; j++)\n        for (i = 1; i <= m; i++)\n          a[i][j] = a[i][j] - minj[j];\n\n      ans[k] = ans[k] + a[2][2];\n      for (i = 2; i <= m; i++)\n        a[i][1] = a[i + 1][1];\n      for (j = 2; j <= m; j++)\n        a[1][j] = a[1][j + 1];\n      for (i = 2; i <= m; i++)\n        for (j = 2; j <= m; j++)\n          a[i][j] = a[i + 1][j + 1];\n      m--;\n    }\n    printf(\"%d\\n\", ans[k]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, a[100][100], p, min, sum = 0;\n  cin >> n;\n  for (p = 1; p <= n; p++) {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    for (k = 1; k <= n - 1; k++) {\n\n      for (i = 0; i <= n - 1; i++) {\n        min = a[i][0];\n        for (j = k; j <= n - 1; j++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n\n        for (j = 0; j <= n - 1; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n\n      for (j = 0; j <= n - 1; j++) {\n        min = a[0][j];\n        for (i = k; i <= n - 1; i++) {\n          if (a[i][j] < min) {\n            min = a[i][j];\n          }\n        }\n        for (i = 0; i <= n - 1; i++) {\n\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[k][k];\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34036", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint min(int *p, int n) {\n  int k, i;\n  k = *p;\n  p++;\n  for (i = 1; i < n; i++, p++) {\n    if (*p < k)\n      k = *p;\n  }\n  return (k);\n}\nint main() {\n  int i, j, n, m, p, q, w, xiao, s;\n  int a[101][101], b[101];\n  scanf(\"%d \", &n);\n  for (w = 0; w < n; w++) {\n\n    for (i = 0; i < n; i++) {\n      b[i] = 0;\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n\n    s = 0;\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++)\n        b[i] = 0;\n      for (i = 0; i < m; i++) {\n        xiao = min(a[i], m);\n        if (xiao == 0) {\n          for (j = 0; j < m; j++) {\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n          continue;\n\n        } else {\n          for (j = 0; j < m; j++) {\n            a[i][j] -= xiao;\n            if (a[i][j] == 0)\n              b[j]++;\n          }\n        }\n      }\n      for (i = 0; i < m; i++) {\n        if (b[i] != 0)\n          continue;\n        else {\n          xiao = a[0][i];\n          for (j = 1; j < m; j++)\n            if (a[j][i] < xiao)\n              xiao = a[j][i];\n          for (j = 0; j < m; j++)\n            a[j][i] -= xiao;\n        }\n      }\n      s += a[1][1];\n      for (i = 0; i < m; i++) {\n        if (i == 1)\n          continue;\n        else {\n          for (j = 1; j < m - 1; j++)\n            a[i][j] = a[i][j + 1];\n        }\n      }\n      for (i = 0; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[j][i] = a[j + 1][i];\n    }\n    printf(\"%d \", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, m = 0, n = 0;\n  int num;\n  cin >> num;\n  int an[100][100];\n  for (int c = 0; c < num; c++) {\n\n    for (int i = 0; i < num; i++) {\n      for (j = 0; j < num; j++)\n        cin >> *(*(an + i) + j);\n    }\n    int sum = 0;\n    int hang;\n    for (hang = num; hang > 1; hang--) {\n      int a = 0, b = 0;\n      for (m = 0; m < hang; m++) {\n        a = *(*(an + m) + 0);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + m) + n) < a)\n            a = *(*(an + m) + n);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + m) + n) = *(*(an + m) + n) - a;\n      }\n\n      for (m = 0; m < hang; m++) {\n        b = *(*(an + 0) + m);\n        for (n = 0; n < hang; n++) {\n          if (*(*(an + n) + m) < b)\n            b = *(*(an + n) + m);\n        }\n        for (n = 0; n < hang; n++)\n          *(*(an + n) + m) = *(*(an + n) + m) - b;\n      }\n      sum = sum + an[1][1];\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + i) + j) = *(*(an + i) + j + 1);\n      }\n      for (i = 0; i < hang; i++) {\n        for (j = 1; j < hang; j++)\n          *(*(an + j) + i) = *(*(an + j + 1) + i);\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, i, j, k, t, sum = 0, a[200][200], m;\nint main() {\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    sum = 0;\n    for (t = n; t >= 2; t--) {\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[j][k] < m) {\n            m = a[j][k];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[j][k] = a[j][k] - m;\n        }\n      }\n      for (j = 0; j <= t - 1; j++) {\n        m = 1000000;\n        for (k = 0; k <= t - 1; k++) {\n          if (a[k][j] < m) {\n            m = a[k][j];\n          }\n        }\n        for (k = 0; k <= t - 1; k++) {\n          a[k][j] = a[k][j] - m;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= t - 2; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j <= t - 2; j++) {\n        for (k = 1; k <= t - 2; k++) {\n          a[j][k] = a[j + 1][k + 1];\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint map_1[100][100], sum = 0, min_1 = 1000, rst[100];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &map_1[j][k]);\n    for (t = n; t > 1; t--) {\n      for (j = 0; j < t; j++) {\n        for (k = 0; k < t; k++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (k = 0; k < t; k++)\n          map_1[j][k] = map_1[j][k] - min_1;\n\n        min_1 = 1000;\n      }\n\n      min_1 = 1000;\n      for (k = 0; k < t; k++) {\n        for (j = 0; j < t; j++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (j = 0; j < t; j++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n\n        min_1 = 1000;\n      }\n      sum = sum + map_1[1][1];\n\n      for (k = 1; k < t - 1; k++)\n        map_1[0][k] = map_1[0][k + 1];\n      for (j = 1; j < t - 1; j++)\n        map_1[j][0] = map_1[j + 1][0];\n      for (j = 1; j < t - 1; j++)\n        for (k = 1; k < t - 1; k++)\n          map_1[j][k] = map_1[j + 1][k + 1];\n\n      min_1 = 1000;\n    }\n    rst[i] = sum;\n    sum = 0;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\", rst[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n    int a[100][100], ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (int p = 0; p < n - 1; p++) {\n      int min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + i) + j))\n            min = *(*(a + i) + j);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) -= min;\n        }\n        min = **(a + i + 1);\n      }\n      min = **a;\n      for (i = 0; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          if (min > *(*(a + j) + i))\n            min = *(*(a + j) + i);\n        }\n        for (j = 0; j < n - p; j++) {\n          *(*(a + j) + i) -= min;\n        }\n        min = *(*a + i + 1);\n      }\n      ans += *(*(a + 1) + 1);\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - p; j++) {\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n        }\n      }\n      for (i = 1; i < n - p; i++) {\n        for (j = 0; j < n - 1 - p; j++)\n          *(*(a + j) + i) = *(*(a + j) + i + 1);\n      }\n    }\n    cout << ans << endl;\n    ans = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p, t, min, sum = 0;\n  int a[100][100];\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - t; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum += a[1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - t; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34042", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint guiling(int count);\nint xiaojian(int count);\n\nint n;\nint a[101][101];\nint main() {\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    for (int count = n; count > 1; count--) {\n      guiling(count);\n      sum += a[1][1];\n      xiaojian(count);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n\nint guiling(int count) {\n  int j, k;\n  for (j = 0; j < count; j++) {\n    int min = a[j][0];\n    for (k = 1; k < count; k++) {\n      if (min > a[j][k])\n        min = a[j][k];\n    }\n    for (k = 0; k < count; k++) {\n      a[j][k] -= min;\n    }\n  }\n  for (k = 0; k < count; k++) {\n    int min = a[0][k];\n    for (j = 1; j < count; j++) {\n      if (min > a[j][k])\n        min = a[j][k];\n    }\n    for (j = 0; j < count; j++) {\n      a[j][k] -= min;\n    }\n  }\n}\n\nint xiaojian(int count) {\n  int j, k;\n  for (j = 1; j < count - 1; j++) {\n    a[0][j] = a[0][j + 1];\n    a[j][0] = a[j + 1][0];\n    for (k = 1; k < count - 1; k++) {\n      a[j][k] = a[j + 1][k + 1];\n    }\n  }\n}\n"}
{"label": "18", "index": "34043", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) < m)\n      m = *(p + i);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i) = *(p + i) - m;\n  if (k > 1)\n    f1(p + 100, n, (k - 1));\n}\nvoid f2(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i * 100) < m)\n      m = *(p + i * 100);\n  }\n  for (i = 0; i < n; i++) {\n    *(p + i * 100) = *(p + i * 100) - m;\n  }\n  if (k > 1)\n    f2(p + 1, n, (k - 1));\n}\nint main() {\n  int *p, a[100][100], n, i, j, t, m, h;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++)\n        cin >> a[j][t];\n    }\n    p = a[0];\n    h = 0;\n    for (j = n; j > 1; j--) {\n      f1(p, j, j);\n      f2(p, j, j);\n      h += a[1][1];\n      for (t = 0; t < j; t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[t][m] = a[t][m + 1];\n      }\n      for (t = 0; t < (j - 1); t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[m][t] = a[m + 1][t];\n      }\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34044", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid rezero();\nvoid dele();\nint a[100][100], n, b, sum = 0;\nint main() {\n  int i, j, k;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    b = n;\n    rezero();\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\nvoid rezero() {\n  int i, j, k, min;\n  for (k = 0; k < n - 1; k++) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 0; j < b; j++) {\n        if (a[i][j] <= min)\n          min = a[i][j];\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] -= min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      min = a[0][i];\n      for (j = 0; j < b; j++) {\n        if (a[j][i] <= min)\n          min = a[j][i];\n      }\n      for (j = 0; j < b; j++) {\n        a[j][i] -= min;\n      }\n    }\n    dele();\n    b -= 1;\n  }\n}\nvoid dele() {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < b; i++)\n    for (j = 1; j < b - 1; j++)\n      a[i][j] = a[i][j + 1];\n\n  for (j = 0; j < b - 1; j++)\n    for (i = 1; i < b - 1; i++)\n      a[i][j] = a[i + 1][j];\n}\n"}
{"label": "18", "index": "34045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, min, sum = 0;\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (int k = n; k > 1; k--) {\n      for (int i = 0; i < k; i++) {\n        min = **(p + i);\n        for (int j = 1; j < k; j++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (int j = 0; j < k; j++) {\n        min = *(*p + j);\n        for (int i = 1; i < k; i++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int i = 0; i < k; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (int i = 1; i < k; i++)\n        for (int j = 0; j < k; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      for (int j = 1; j < k; j++)\n        for (int i = 0; i < k; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, count = 0;\n  cin >> n;\n  while (count < n) {\n    int input[100][100], sum = 0;\n    int(*p)[100];\n    p = input;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 0; i < n - 1; i++) {\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + j) + k) < min)\n            min = *(*(p + j) + k);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + j) + k) -= min;\n      }\n      for (int j = 0; j < n - i; j++) {\n        int min = 100000;\n        for (int k = 0; k < n - i; k++)\n          if (*(*(p + k) + j) < min)\n            min = *(*(p + k) + j);\n        for (int k = 0; k < n - i; k++)\n          *(*(p + k) + j) -= min;\n      }\n      sum += *(*(p + 1) + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + j) + k) = *(*(p + j) + k + 1);\n      for (int j = 0; j < n - i; j++)\n        for (int k = 1; k < n - i - 1; k++)\n          *(*(p + k) + j) = *(*(p + k + 1) + j);\n    }\n    printf(\"%d\\n\", sum);\n    count++;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n;\nint min(int x[]) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    if (x[i] < 0)\n      continue;\n    for (j = 0; j < n; j++) {\n      if (x[i] > x[j] && x[j] >= 0)\n        break;\n    }\n    if (j == n)\n      return x[i];\n  }\n  return 0;\n}\nvoid cut(int a[50][50], int k) {\n  int i, j, m;\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = min(a[i]);\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = i + 1; j < n; j++) {\n      m = a[i][j];\n      a[i][j] = a[j][i];\n      a[j][i] = m;\n    }\n  }\n}\nvoid xiaojian(int a[50][50], int k) {\n  int i;\n  for (i = 0; i < n; i++) {\n    a[k][i] = -1;\n    a[i][k] = -1;\n  }\n}\nint main() {\n  int a[50][50][50], j, i, k, l, sum;\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n\n    for (j = 0; j < n; j++) {\n      for (i = 0; i < n; i++) {\n        scanf(\"%d\", &a[k][j][i]);\n      }\n    }\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      cut(a[k], j);\n      sum = sum + a[k][j][j];\n      xiaojian(a[k], j);\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "34048", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, m, sum, min, z;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k = k + 1) {\n    sum = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        cin >> a[i][j];\n    for (l = n; l > 1; l = l - 1) {\n      for (i = 0; i < l; i = i + 1) {\n        min = a[i][0];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < l; i = i + 1) {\n        min = a[0][i];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      if (l != 2) {\n        for (i = 1; i < l; i = i + 1)\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        for (i = 1; i < l; i = i + 1)\n          for (j = 1; j < l; j = j + 1)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34049", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100], n, sum;\n\nvoid evaluation() {\n  for (int i = 0; i < n; i++) {\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  n--;\n}\n\nint operation() {\n  int min;\n  if (n == 1) {\n    cout << sum << endl;\n    return 0;\n  } else {\n    for (int i = 0; i < n; i++) {\n      min = 100000;\n      for (int j = 0; j < n; j++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a[i][j] -= min;\n    }\n    for (int j = 0; j < n; j++) {\n      min = 100000;\n      for (int i = 0; i < n; i++) {\n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a[i][j] -= min;\n    }\n    sum += a[1][1];\n    evaluation();\n    operation();\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  for (int k = 0; k < N; k++) {\n    sum = 0;\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    operation();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34050", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100][100];\nint main() {\n  int min, sum[100] = {0};\n  cin >> n;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[k][i][j]);\n  for (int r = n; r > 1; r--) {\n    for (int k = 0; k < n; k++) {\n      for (int i = 0; i < r; i++) {\n        min = a[k][i][0];\n        for (int j = 1; j < r; j++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int j = 0; j < r; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n    }\n\n    for (int k = 0; k < n; k++)\n      for (int j = 0; j < r; j++) {\n        min = a[k][0][j];\n        for (int i = 1; i < r; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int i = 0; i < r; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n    for (int k = 0; k < n; k++) {\n      sum[k] = sum[k] + a[k][1][1];\n      for (int i = 1; i < r - 1; i++)\n        a[k][i][0] = a[k][i + 1][0];\n      for (int j = 1; j < r - 1; j++)\n        a[k][0][j] = a[k][0][j + 1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 1; j < r - 1; j++)\n          a[k][i][j] = a[k][i + 1][j + 1];\n    }\n  }\n\n  for (int k = 0; k < n; k++)\n    cout << sum[k] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "34051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    int a[110][110] = {0};\n    int min = 10000, s = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (int m = 1; m < n; m++) {\n      for (int j = 0; j < n; j++) {\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int k = 0; k < n; k++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      for (int k = 0; k < n; k++) {\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m)) {\n            if (a[j][k] < min)\n              min = a[j][k];\n          }\n        }\n        for (int j = 0; j < n; j++) {\n          if ((j == 0 || j >= m) && (k == 0 || k >= m))\n            a[j][k] = a[j][k] - min;\n        }\n        min = 10000;\n      }\n      s = s + a[m][m];\n      for (int j = 0; j < n; j++)\n        a[j][m] = 100000;\n      for (int j = 0; j < n; j++)\n        a[m][j] = 100000;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[201][201];\nint i, j, sum;\nint min1[201], min2[201];\nvoid read();\nvoid del(int);\nvoid move(int);\nint main() {\n  cin >> n;\n  int i, j;\n  for (i = 0; i < n; ++i) {\n    read();\n    sum = 0;\n    for (j = 0; j < n - 1; ++j) {\n\n      del(n - j);\n      sum = sum + a[1][1];\n      move(n - j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nvoid read() {\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n}\nvoid del(int n) {\n  for (i = 0; i < n; i++) {\n    min1[i] = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min1[i])\n        min1[i] = a[i][j];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min1[i];\n\n  for (i = 0; i < n; i++) {\n    min2[i] = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min2[i])\n        min2[i] = a[j][i];\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min2[i];\n}\nvoid move(int n) {\n  for (i = 2; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 2; j < n; j++)\n      a[i][j - 1] = a[i][j];\n}\n"}
{"label": "18", "index": "34053", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid make_zero(int a[100][100], int);\nvoid reduce(int a[100][100], int);\nint min(int a[100][100], int i, int p, int flag);\n\nint main() {\n  int n, a[100][100], sum;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (int p = n - 1; p > 0; p--) {\n      make_zero(a, p);\n      sum += a[1][1];\n      reduce(a, p);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nvoid make_zero(int a[100][100], int p) {\n  int flag = 0, m;\n  for (int i = 0; i <= p; i++) {\n    m = min(a, i, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[i][j] -= m;\n    }\n  }\n  flag = 1;\n  for (int k = 0; k <= p; k++) {\n    m = min(a, k, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[j][k] -= m;\n    }\n  }\n}\n\nvoid reduce(int a[100][100], int p) {\n  for (int i = 0; i <= p; i++) {\n    for (int j = 1; j < p; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int k = 0; k < p; k++) {\n    for (int j = 1; j < p; j++) {\n      a[j][k] = a[j + 1][k];\n    }\n  }\n}\n\nint min(int a[100][100], int i, int p, int flag) {\n  int t;\n  if (flag == 0) {\n    t = a[i][0];\n    for (int j = 0; j <= p; j++) {\n      if (a[i][j] < t)\n        t = a[i][j];\n    }\n  } else {\n    t = a[0][i];\n    for (int j = 0; j <= p; j++) {\n      if (a[j][i] < t)\n        t = a[j][i];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "34054", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int num[100][100];\n  cin >> n;\n  int(*p)[100] = num;\n  for (int k = 0; k < n; k++) {\n    int sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    }\n\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++) {\n          if (min > *(*(p + i) + j))\n            min = *(*(p + i) + j);\n        }\n        for (int i = 0; i < m; i++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      sum += num[1][1];\n      for (int i = 1; i < m - 1; i++)\n        *(*(p + i) + 0) = *(*(p + i + 1) + 0);\n      for (int j = 1; j < m - 1; j++)\n        *(*(p + 0) + j) = *(*(p + 0) + j + 1);\n      for (int i = 2; i < m; i++) {\n        for (int j = 2; j < m; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n      }\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint mx[200][200];\nint nn, n, ans;\nint main() {\n  cin >> nn;\n  for (int q = 1; q <= nn; q++) {\n    ans = 0;\n    n = nn;\n    for (int i = 1; i <= n; i++) {\n      for (int j = 1; j <= n; j++) {\n        cin >> mx[i][j];\n      }\n    }\n    for (; n >= 2; n--) {\n      int smin;\n      for (int i = 1; i <= n; i++) {\n        smin = mx[i][1];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[i][j] ? smin : mx[i][j];\n        for (int j = 1; j <= n; j++)\n          mx[i][j] -= smin;\n      }\n      for (int i = 1; i <= n; i++) {\n        smin = mx[1][i];\n        for (int j = 1; j <= n; j++)\n          smin = smin < mx[j][i] ? smin : mx[j][i];\n        for (int j = 1; j <= n; j++)\n          mx[j][i] -= smin;\n      }\n      ans += mx[2][2];\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[i][j] = mx[i][j + 1];\n      }\n      for (int i = 1; i <= n; i++) {\n        for (int j = 2; j < n; j++)\n          mx[j][i] = mx[j + 1][i];\n      }\n    }\n    cout << ans << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34056", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint mat[100][100], n, sum = 0;\nint rmin(int a[][100], int x) {\n  int i, rsmall = a[x][0];\n  for (i = 0; i < n; i++) {\n    if (rsmall > a[x][i]) {\n      rsmall = a[x][i];\n    }\n  }\n  return rsmall;\n}\nint cmin(int a[][100], int y) {\n  int i, csmall = a[0][y];\n  for (i = 0; i < n; i++) {\n    if (csmall > a[i][y]) {\n      csmall = a[i][y];\n    }\n  }\n  return csmall;\n}\nvoid caculate(int mat[][100]) {\n  int i, j, rsmall, csmall;\n  for (i = 0; i < n; i++) {\n    rsmall = rmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[i][j] -= rsmall;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    csmall = cmin(mat, i);\n    for (j = 0; j < n; j++) {\n      mat[j][i] -= csmall;\n    }\n  }\n}\nvoid change(int a[][100], int x) {\n  int i, j;\n  sum += a[1][1];\n  for (i = 0; i < x; i++)\n    for (j = 1; j < x - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  for (i = 1; i < x - 1; i++)\n    for (j = 0; j < x - 1; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n}\nint main() {\n  int m, i, j, num;\n  cin >> num;\n  for (m = 1; m <= num; m++) {\n    n = num;\n    sum = 0;\n    for (i = 0; i < num; i++)\n      for (j = 0; j < num; j++) {\n        cin >> mat[i][j];\n      }\n    while (n != 1) {\n      caculate(mat);\n      change(mat, n--);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  cin >> i;\n  return 0;\n}\n"}
{"label": "18", "index": "34057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid minus_1(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[i][j]) ? m : a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= m;\n  }\n  for (i = j = 0; i < n; i++) {\n    int m = 10000;\n    for (j = 0; j < n; j++)\n      m = (m < a[j][i]) ? m : a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= m;\n  }\n}\n\nvoid pr(int a[100][100], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < k; j++) {\n      cout << a[i][j] << (j + 1 == k) ? ' ' : ',';\n    }\n  }\n}\n\nvoid lower(int a[100][100], int n) {\n  int i, j;\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (i == 0 && j == 0)\n        a[i][j] = a[i][j];\n      else if (i == 0 && j > 0)\n        a[i][j] = a[i][j + 1];\n      else if (i > 0 && j == 0)\n        a[i][j] = a[i + 1][j];\n      else if (i > 0 && j > 0)\n        a[i][j] = a[i + 1][j + 1];\n}\n\nvoid fff(int n) {\n  int a[100][100] = {0};\n  int i = 0, j, sum;\n\n  for (i = j = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      cin >> a[i][j];\n  for (i = 0, sum = 0; i < n; i++) {\n    minus_1(a, n - i);\n    sum += a[1][1];\n    lower(a, n - i);\n  }\n  printf(\"%d \", sum);\n}\n\nint main() {\n  int i = 0, n;\n  scanf(\"%d\", &n);\n  while (i++ < n)\n    fff(n);\n  return 0;\n}\n"}
{"label": "18", "index": "34058", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint matrix[100][100] = {0};\nvoid change(int k, int n) {\n  matrix[k + 1][k + 1] = matrix[k][k];\n  int i = 0;\n  if (n - 1 >= k + 2) {\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[k + 1][i] = matrix[k][i];\n    for (i = k + 2; i <= n - 1; i++)\n      matrix[i][k + 1] = matrix[i][k];\n  }\n}\nint main() {\n  int n = 0;\n  cin >> n;\n  int m = 0;\n  int sum[100] = {0};\n  for (m = 0; m <= n - 1; m++) {\n\n    int i = 0, j = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> matrix[i][j];\n    int k = 0;\n    for (k = 0; k <= n - 2; k++) {\n      int min = 10000;\n      for (i = k; i <= n - 1; i++) {\n        min = 10000;\n        for (j = k; j <= n - 1; j++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (j = k; j <= n - 1; j++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      for (j = k; j <= n - 1; j++) {\n        min = 10000;\n        for (i = k; i <= n - 1; i++)\n          if (matrix[i][j] < min)\n            min = matrix[i][j];\n        for (i = k; i <= n - 1; i++)\n          matrix[i][j] = matrix[i][j] - min;\n      }\n      sum[m] = sum[m] + matrix[k + 1][k + 1];\n      change(k, n);\n    }\n  }\n  for (m = 0; m <= n - 1; m++)\n    printf(\"%d\\n\", sum[m]);\n  return 0;\n}\n"}
{"label": "18", "index": "34059", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int flag = 0;\n  int gl(int num[][200], int n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num[200][200] = {0};\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &num[j][k]);\n    sum = gl(num, n);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n\nint gl(int num[][200], int n) {\n  int i = 0, j = 0, k = 0;\n  int min = 0;\n  int flag = 0;\n  int sum = 0;\n  for (flag = 0; flag < n - 1; flag++) {\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n      for (j = 0; j < n; j++) {\n        if (num[i][j] < min) {\n          min = num[i][j];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++)\n        num[i][j] = num[i][j] - min;\n    }\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n      for (j = 0; j < n; j++) {\n        if (num[j][i] < min) {\n          min = num[j][i];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n    sum += num[1][1];\n\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[j][i - 1] = num[j][i];\n      }\n      num[j][i] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[i - 1][j] = num[i][j];\n      }\n      num[j][i] = 0;\n    }\n  }\n  return sum;\n}\n"}
{"label": "18", "index": "34060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100] = {0}, i = 0, j = 0, min = 1000;\n  int flag = 0, sum = 0, k = 0, l = 0;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    for (i = 0; i < n * n; i++)\n      cin >> a[i / n][i % n];\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < n - flag; i++) {\n        min = 1000;\n        for (j = 0; j < n - flag; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - flag; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - flag; j++) {\n        min = 1000;\n        for (i = 0; i < n - flag; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - flag; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - flag; i++) {\n        for (j = 1; j < n - 1 - flag; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - flag; j++) {\n        for (i = 1; i < n - 1 - flag; i++)\n          a[i][j] = a[i + 1][j];\n      }\n\n      flag++;\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    flag = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34061", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nenum { size = 100 };\n\nvoid gotozero(int num, int n, int a[size][size][size], int minrow[size][size],\n              int mincol[size][size]) {\n  int i, j, k;\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      minrow[i][j] = a[i][j][0];\n      for (k = 0; k < n; k++)\n        if (minrow[i][j] > a[i][j][k])\n          minrow[i][j] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][j][k] -= minrow[i][j];\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      mincol[i][j] = a[i][0][j];\n      for (k = 0; k < n; k++)\n        if (mincol[i][j] > a[i][k][j])\n          mincol[i][j] = a[i][k][j];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][k][j] -= mincol[i][j];\n  }\n}\n\nvoid cut(int num, int n, int a[size][size][size], int minrow[size][size],\n         int mincol[size][size]) {\n  int i, j, k;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 2; k < n; k++)\n        a[i][j][k - 1] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 2; j < n; j++)\n        a[i][j - 1][k] = a[i][j][k];\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, num;\n  int a[size][size][size] = {0}, minrow[size][size] = {0}, sum[size] = {0},\n      mincol[size][size] = {0};\n\n  \n  scanf(\"%d\", &n);\n  num = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n\n  while (n > 1) {\n    gotozero(num, n, a, minrow, mincol);\n    for (i = 0; i < num; i++)\n      sum[i] += a[i][1][1]; \n    cut(num, n, a, minrow, mincol);\n    n--;\n  }\n\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", sum[i]);\n}\n"}
{"label": "18", "index": "34062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\n\nvoid minus_row_col(int n) {\n  int row[100], col[100], min_row = 10000, min_col = 10000, i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min_row)\n        min_row = a[i][j];\n    }\n    row[i] = min_row;\n    min_row = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= row[i];\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min_col)\n        min_col = a[j][i];\n    }\n    col[i] = min_col;\n    min_col = 10000;\n  }\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] -= col[i];\n}\n\nvoid delete_row_col(int n) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < n; j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\n\nint main() {\n  int n, i, j, k, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    sum = 0;\n    int num = n;\n    while (num != 1) {\n      minus_row_col(num);\n      sum += a[1][1];\n      delete_row_col(num);\n      num--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], e, sum = 0;\n  int n, m, i, j, k, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    m = n;\n    for (l = 0; l < m - 1; l++) {\n      for (j = 0; j < n; j++) {\n        e = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] -= e;\n      }\n      for (k = 0; k < n; k++) {\n        e = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < e) {\n            e = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] -= e;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (k = 1; k < n; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - 1; k++) {\n        for (j = 1; j < n; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      n -= 1;\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n    n = m;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34064", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[1000][1000], n;\n\nvoid sub_to_zero() {\n  int m;\n  for (int i = 0; i < n; i++) {\n    m = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < m)\n        m = a[i][j];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[i][j] -= m;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    m = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < m)\n        m = a[j][i];\n    }\n    if (m > 0) {\n      for (int j = 0; j < n; j++)\n        a[j][i] -= m;\n    }\n  }\n}\n\nvoid delimination() {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (int i = 2; i < n; i++)\n    for (int j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  --n;\n}\n\nint calcMatrix() {\n  int sum = 0;\n  while (n > 1) {\n    sub_to_zero();\n    sum += a[1][1];\n    delimination();\n  }\n  return sum;\n}\n\nint main() {\n  int nMatrix;\n  cin >> nMatrix;\n  for (int i = 0; i < nMatrix; i++) {\n    n = nMatrix;\n    for (int j = 0; j < nMatrix; j++)\n      for (int k = 0; k < nMatrix; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", calcMatrix());\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, m, i, j, k, a[100][100], b[100], c[100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    c[k] = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (m = n; m > 1; m--) {\n      for (i = 0; i < m; i++) {\n        b[i] = a[i][0];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[i][j])\n            b[i] = a[i][j];\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - b[i];\n      }\n      for (i = 0; i < m; i++) {\n        b[i] = a[0][i];\n        for (j = 1; j < m; j++)\n          if (b[i] > a[j][i])\n            b[i] = a[j][i];\n        for (j = 0; j < m; j++)\n          a[j][i] = a[j][i] - b[i];\n      }\n      c[k] += a[1][1];\n      for (i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++)\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  for (k = 0; k < n; k++)\n    cout << c[k] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "34066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k = 0, flag = 0, i, j, a[200][200],\n         o[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, l, ans = 0, min;\n  double b[1000], t, p, q;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    ans = 0;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        cin >> *(*(a + i) + j);\n    for (k = 1; k <= n - 1; k++) {\n      for (i = 0; i <= n - k; i++) {\n        min = **(a + i);\n\n        for (j = 1; j <= n - k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n\n      for (j = 0; j <= n - k; j++) {\n        min = *(*a + j);\n        for (i = 1; i <= n - k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      ans = ans + *(*(a + 1) + 1);\n      for (i = 1; i <= n - k - 1; i++)\n        for (j = 0; j <= n - k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      for (j = 1; j <= n - k - 1; j++)\n        for (i = 0; i <= n - k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n    }\n    cout << ans << endl;\n  }\n}\n"}
{"label": "18", "index": "34067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int m = 0;\n\n  int a[100][100];\n  int(*p)[100];\n  cin >> n;\n  for (int k = 0; k < n; k++) {\n\n    int sum = 0;\n\n    p = a;\n\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n\n    int min1 = *(*(p + 0) + 0);\n    for (int count = 0; count < n; count++) {\n\n      m = n - count;\n      for (int i = 0; i < m; i++) {\n        min1 = *(*(p + i) + 0);\n        for (int j = 0; j < m; j++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int j = 0; j < m; j++) {\n          *(*(p + i) + j) -= min1;\n        }\n      }\n      for (int j = 0; j < m; j++) {\n        min1 = *(*(p + 0) + j);\n        for (int i = 0; i < m; i++)\n          if (*(*(p + i) + j) < min1)\n            min1 = *(*(p + i) + j);\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j) -= min1;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      for (int i = 2; i < m; i++) {\n        for (int j = 0; j < m; j++)\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n      }\n      for (int j = 2; j < m; j++) {\n        for (int i = 0; i < m; i++)\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n      }\n    }\n    sum -= *(*(p + 1) + 1);\n\n    cout << sum << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34068", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], N, i, j, k, l, min, sum = 0;\n  scanf(\"%d \", &N);\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++)\n      for (k = 0; k < N; k++)\n        cin >> a[j][k];\n    n = N;\n    for (l = 0; l < N - 1; l++) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k + 1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n - 1; k++)\n          a[j][k] = a[j + 1][k];\n      n = n - 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34069", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int N;\n  scanf(\"%d\", &N);\n  for (int n = 0; n < N; n++) {\n    int Ma[N][N];\n    for (int i = 0; i < N; i++) {\n      for (int j = 0; j < N; j++)\n        scanf(\"%d \", &Ma[i][j]);\n    }\n    int SUM = 0;\n    for (int Now = 1; Now < N; Now++) {\n      int MINR = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINR > Ma[0][j])\n          MINR = Ma[0][j];\n      Ma[0][0] -= MINR;\n      for (int j = Now; j < N; j++)\n        Ma[0][j] -= MINR;\n      for (int i = Now; i < N; i++) {\n        int MIR = Ma[i][0];\n        for (int j = Now; j < N; j++)\n          if (MIR > Ma[i][j])\n            MIR = Ma[i][j];\n        Ma[i][0] -= MIR;\n        for (int j = Now; j < N; j++)\n          Ma[i][j] -= MIR;\n      }\n      int MINC = Ma[0][0];\n      for (int j = Now; j < N; j++)\n        if (MINC > Ma[j][0])\n          MINC = Ma[j][0];\n      Ma[0][0] -= MINC;\n      for (int j = Now; j < N; j++)\n        Ma[j][0] -= MINC;\n      for (int i = Now; i < N; i++) {\n        int Mic = Ma[0][i];\n        for (int j = Now; j < N; j++)\n          if (Mic > Ma[j][i])\n            Mic = Ma[j][i];\n        Ma[0][i] -= Mic;\n        for (int j = Now; j < N; j++)\n          Ma[j][i] -= Mic;\n      }\n      SUM += Ma[Now][Now];\n    }\n    printf(\"%d\\n\", SUM);\n  }\n}\n"}
{"label": "18", "index": "34070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint p[10000][10000];\nint f(int x) {\n  int min;\n  int k;\n  if (x == 2) {\n    for (int i = 0; i <= 1; i++)\n      if (p[i][0] > p[i][1]) {\n        p[i][0] = p[i][0] - p[i][1];\n        p[i][1] = 0;\n      } else {\n        p[i][1] = p[i][1] - p[i][0];\n        p[i][0] = 0;\n      }\n    for (int i = 0; i <= 1; i++)\n      if (p[0][i] > p[1][i]) {\n        p[0][i] = p[0][i] - p[1][i];\n        p[1][i] = 0;\n      } else {\n        p[1][i] = p[1][i] - p[0][i];\n        p[0][i] = 0;\n      }\n    return p[1][1];\n\n  }\n\n  else {\n    for (int i = 0; i < x; i++) {\n\n      min = p[i][0];\n      for (int j = 0; j < x; j++)\n\n        if (p[i][j] < min)\n          min = p[i][j];\n      for (int j = 0; j < x; j++)\n        p[i][j] = p[i][j] - min;\n    }\n    for (int i = 0; i < x; i++) {\n\n      min = p[0][i];\n      for (int j = 0; j < x; j++)\n\n        if (p[j][i] < min)\n          min = p[j][i];\n      for (int j = 0; j < x; j++)\n        p[j][i] = p[j][i] - min;\n    }\n    k = p[1][1];\n    for (int i = 0; i < x; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[i][j] = p[i][j + 1];\n    for (int i = 0; i < x - 1; i++)\n      for (int j = 1; j < x - 1; j++)\n        p[j][i] = p[j + 1][i];\n    return k + f(x - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  int s = 1;\n  for (s = 1; s <= n; s++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> p[i][j];\n    cout << f(n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34071", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint x[102][102];\nint (*p)[102];\nint n;\nvoid f(int k) {\n  int min, i, j;\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    for (j = 0; j < n - k; j++)\n      *(*(p + i) + j) -= min;\n  }\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    for (j = 0; j < n - k; j++)\n      *(*(p + j) + i) -= min;\n  }\n}\nint main() {\n  int i, j, k, sum;\n  p = x;\n  cin >> n;\n  for (int t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      f(k);\n      sum += *(*(p + 1) + 1);\n      for (i = 2; i < n; i++) {\n        *(*(p + 0) + i - 1) = *(*(p + 0) + i);\n        *(*(p + i - 1) + 0) = *(*(p + i) + 0);\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34072", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint smaller(int, int);\n\nint main() {\n  int n, a[101][101], i, j, k, min, count;\n  cin >> n;\n  count = n;\n  for (k = 1; k <= count; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (min >= a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n      }\n      n--;\n    }\n    cout << sum << endl;\n    n = count;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34073", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[102][102], i, k, j, l, n, s, (*p)[102], (*q)[102], min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0, s = 0, p = &a[0]; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (i = 0, p = &a[0], q = &a[n]; i < n; i++)\n      *(*q + i) = *(*p + i);\n    for (i = 0, p = &a[1]; i < n; i++)\n      *(*(p + i) + n) = **(p + i);\n    for (l = 1; l < n; l++) {\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + i) + l); j <= n; j++)\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        for (j = l; j <= n; j++)\n          *(*(p + i) + j) -= min;\n      }\n      for (i = l, p = &a[0]; i <= n; i++) {\n        for (j = l + 1, min = *(*(p + l) + i); j <= n; j++)\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        for (j = l; j <= n; j++)\n          *(*(p + j) + i) -= min;\n      }\n      s += *(*(p + l) + l);\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sm1(int line, int sum1, int array1[100][100]) {\n  int min = array1[line][0];\n  for (int i = 0; i < sum1; i++)\n    if (min > array1[line][i])\n      min = array1[line][i];\n  return min;\n}\nint sm2(int row, int sum2, int array2[100][100]) {\n  int min = array2[0][row];\n  for (int i = 0; i < sum2; i++)\n    if (min > array2[i][row])\n      min = array2[i][row];\n  return min;\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int step = 0; step < n; step++) {\n    int jz[100][100], he = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> jz[i][j];\n    for (int Count = 0; Count < n - 1; Count++) {\n      for (int i = 0; i < n - Count; i++) {\n        int minl = sm1(i, n - Count, jz);\n        for (int j = 0; j < n - Count; j++)\n          jz[i][j] -= minl;\n      }\n      for (int j = 0; j < n - Count; j++) {\n        int minr = sm2(j, n - Count, jz);\n        for (int i = 0; i < n - Count; i++)\n          jz[i][j] -= minr;\n      }\n      he += jz[1][1];\n      for (int i = 2; i < n - Count; i++)\n        for (int j = 2; j < n - Count; j++)\n          jz[i - 1][j - 1] = jz[i][j];\n      for (int i = 2; i < n - Count; i++)\n        jz[i - 1][0] = jz[i][0];\n      for (int j = 2; j < n - Count; j++)\n        jz[0][j - 1] = jz[0][j];\n    }\n    printf(\"%d\\n\\n\", he);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34075", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1(int k);\nint a[100][100];\nint main() {\n  int n, k;\n  int i = 0, j = 0;\n  cin >> n;\n  k = n;\n  while (n--) {\n    for (i = 0; i < k; i++)\n      for (j = 0; j < k; j++)\n        scanf(\"%d \", &a[i][j]);\n    cout << array_1(k) << endl;\n  }\n  return 0;\n}\n\nint array_1(int k) {\n  if (k == 1)\n    return 0;\n  else if (k > 1) {\n    int i, j, max1, max2;\n    for (i = 0; i < k; i++) {\n      max1 = 10000;\n      for (j = 0; j < k; j++) {\n        if (max1 > a[i][j])\n          max1 = a[i][j];\n      }\n      for (j = 0; j < k; j++)\n        a[i][j] = a[i][j] - max1;\n    }\n    for (j = 0; j < k; j++) {\n      max2 = 10000;\n      for (i = 0; i < k; i++) {\n        if (max2 > a[i][j])\n          max2 = a[i][j];\n      }\n      for (i = 0; i < k; i++)\n        a[i][j] = a[i][j] - max2;\n    }\n    int temp = a[1][1];\n    for (i = 2; i < k; i++)\n      for (j = 0; j < k; j++)\n        a[i - 1][j] = a[i][j];\n    for (j = 2; j < k; j++)\n      for (i = 0; i < k; i++)\n        a[i][j - 1] = a[i][j];\n    return temp + array_1(k - 1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34076", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, m, i, j, x, y;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    int s = 0, t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (y = n; y >= 2; y--) {\n      for (i = 0; i < n - t; i++) {\n        x = a[i][0];\n        for (j = 0; j < n - t; j++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (j = 0; j < n - t; j++)\n          a[i][j] -= x;\n      }\n      for (j = 0; j < n - t; j++) {\n        x = a[0][j];\n        for (i = 0; i < n - t; i++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (i = 0; i < n - t; i++)\n          a[i][j] -= x;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      t++;\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint matrixHor[103][103];\nint matrixVer[103][103];\n\nint min(int line[], int n) {\n  int mini = 100000;\n  for (int i = 1; i <= n; i++) {\n    if (line[i] < mini) {\n      mini = line[i];\n    }\n  }\n  return mini;\n}\nint main() {\n  int n, N;\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    int sum = 0;\n    N = n;\n    for (int j = 1; j <= N; j++) {\n      for (int k = 1; k <= N; k++) {\n        cin >> matrixVer[j][k];\n        matrixHor[k][j] = matrixVer[j][k];\n      }\n    }\n    for (int h = 1; h < n; h++) {\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixVer[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j][k] - minim;\n          matrixHor[k][j] = matrixVer[j][k];\n        }\n      }\n\n      for (int j = 1; j <= N; j++) {\n        int minim = min(matrixHor[j], N);\n        for (int k = 1; k <= N; k++) {\n          matrixHor[j][k] = matrixHor[j][k] - minim;\n          matrixVer[k][j] = matrixHor[j][k];\n        }\n      }\n      sum = sum + matrixVer[2][2];\n      N = N - 1;\n      for (int j = 2; j <= N; j++) {\n        for (int k = 2; k <= N; k++) {\n          matrixVer[j][k] = matrixVer[j + 1][k + 1];\n          matrixHor[j][k] = matrixHor[j + 1][k + 1];\n        }\n      }\n      for (int j = 2; j <= N; j++) {\n        matrixHor[1][j] = matrixHor[1][j + 1];\n        matrixVer[j][1] = matrixHor[1][j];\n        matrixVer[1][j] = matrixVer[1][j + 1];\n        matrixHor[j][1] = matrixVer[1][j];\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n}\n"}
{"label": "18", "index": "34078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a[105][105], sum = 0, min, p;\n  cin >> n;\n  p = n;\n  for (int k = 1; k <= n; k++) \n  {\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0; j <= n - 1; j++)\n        cin >> a[i][j];\n    }\n\n    for (int m = 1; m <= n - 1; m++) {\n      for (i = 0; i <= p - 1; i++) {\n        min = 10000;\n        for (j = 0; j <= p - 1; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j <= p - 1; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j <= p - 1; j++) {\n        min = 10000;\n        for (i = 0; i <= p - 1; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i <= p - 1; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      \n\n      for (i = 2; i <= p - 1; i++) { \n        for (j = 0; j <= p - 1; j++)\n          a[i - 1][j] = a[i][j];\n      }\n      for (j = 2; j <= p - 1; j++) {\n        for (i = 0; i <= p - 1; i++)\n          a[i][j - 1] = a[i][j];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\nint a[101][101];\nvoid guiling(int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n}\nvoid xiaojian(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  for (i = 1; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      a[j][i] = a[j][i + 1];\n    }\n  }\n}\nvoid f(int n) {\n  if (n == 1)\n    return;\n  else {\n    guiling(n);\n    sum += a[1][1];\n    xiaojian(n);\n    f(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    f(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34080", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint Matrix[100][100];\n\nint a[100] = {0};\n\nint b[100] = {0};\n\nint N = 0;\n\nvoid f(int n) {\n  memset(a, 0, sizeof(a));\n  for (int i = 0; i < n; i++) {\n    a[i] = Matrix[i][0];\n    for (int k = 1; k < n; k++)\n      if (a[i] > Matrix[i][k])\n        a[i] = Matrix[i][k];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[i][j] -= a[i];\n}\nvoid g(int n) {\n  memset(b, 0, sizeof(b));\n  for (int i = 0; i < n; i++) {\n    b[i] = Matrix[0][i];\n    for (int k = 1; k < n; k++)\n      if (b[i] > Matrix[k][i])\n        b[i] = Matrix[k][i];\n  }\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      Matrix[j][i] -= b[i];\n}\nint h(int n) {\n  int k = 0;\n  f(n);\n  g(n);\n  k = Matrix[1][1];\n  if (n == 2)\n    return k;\n  for (int i = 1; i < n - 1; i++) {\n    Matrix[0][i] = Matrix[0][i + 1];\n    Matrix[i][0] = Matrix[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      Matrix[i][j] = Matrix[i + 1][j + 1];\n  }\n  return k + h(n - 1);\n}\nint main() {\n  cin >> N;\n  for (int j = 0; j < N; j++) {\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> Matrix[i][j];\n    cout << h(N) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid step1(int a[100][100], int n) {\n  int hmin, lmin;\n  for (int i = 0; i < n; i++) {\n    hmin = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < hmin)\n        hmin = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= hmin;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    lmin = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < lmin)\n        lmin = a[j][i];\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= lmin;\n    }\n  }\n}\nvoid step2(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i + 1];\n}\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int nn = n;\n  while (nn--) {\n    int tn = n;\n    int a[100][100];\n    for (int i = 0; i < tn; i++)\n      for (int j = 0; j < tn; j++)\n        scanf(\"%d \", &a[i][j]);\n    int sum = 0;\n    while (tn >= 2) {\n      step1(a, tn);\n      sum += a[1][1];\n      step2(a, tn);\n      tn--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int N = 0;\n  cin >> N;\n  for (int n = 0; n < N; n++) {\n    int a[100][100] = {0};\n    int Sum = 0;\n    for (int i = 0; i < N; i++)\n      for (int j = 0; j < N; j++)\n        cin >> a[i][j];\n    for (int m = N; m > 1; m--) {\n      for (int i = 0; i < m; i++) {\n        int Min = a[i][0];\n        for (int j = 0; j < m; j++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int j = 0; j < m; j++) {\n          a[i][j] = a[i][j] - Min;\n        }\n      }\n      for (int j = 0; j < m; j++) {\n        int Min = a[0][j];\n        for (int i = 0; i < m; i++)\n          if (Min > a[i][j])\n            Min = a[i][j];\n        for (int i = 0; i < m; i++)\n          a[i][j] = a[i][j] - Min;\n      }\n      Sum = Sum + a[1][1];\n      for (int j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (int i = 1; i < m - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (int i = 1; i < m - 1; i++)\n        for (int j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n    cout << Sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34083", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n;\nint array_1[101][101];\nint search_x(int k) {\n  int i, j;\n  int t = 1000;\n  for (j = 0; j < n; j++)\n    if (*(*(array_1 + 0) + j) < t)\n      t = *(*(array_1 + 0) + j);\n  for (j = 0; j < n; j++)\n    *(*(array_1 + 0) + j) = *(*(array_1 + 0) + j) - t;\n\n  for (i = k; i < n; i++) {\n    t = 1000;\n    for (j = 0; j < n; j++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (j = 0; j < n; j++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint search_y(int k) {\n  int i, j;\n  int t = 1000;\n  for (i = 0; i < n; i++)\n    if (*(*(array_1 + i) + 0) < t)\n      t = *(*(array_1 + i) + 0);\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + 0) = *(*(array_1 + i) + 0) - t;\n  for (j = k; j < n; j++) {\n    t = 1000;\n    for (i = 0; i < n; i++)\n      if (*(*(array_1 + i) + j) < t)\n        t = *(*(array_1 + i) + j);\n    for (i = 0; i < n; i++)\n      *(*(array_1 + i) + j) = *(*(array_1 + i) + j) - t;\n  }\n  return 0;\n}\nint change(int k) {\n  int i, j;\n  for (i = 0; i < n; i++)\n    *(*(array_1 + i) + k) = 1000;\n  for (j = 0; j < n; j++)\n    *(*(array_1 + k) + j) = 1000;\n  return 0;\n}\nint main() {\n\n  int i, j, k, w;\n  int num;\n  cin >> n;\n  for (w = 0; w < n; w++) {\n    num = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(array_1 + i) + j);\n\n    for (k = 0; k < n; k++) {\n      search_x(k + 1);\n      search_y(k + 1);\n      num = num + *(*(array_1 + k + 1) + k + 1);\n      change(k + 1);\n    }\n\n    printf(\"%d\\n\", num);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int i = 0, j = 0, k = 0;\n  for (i = 1; i <= n; i++) {\n    int shuzu[100][100] = {0}, sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> shuzu[j][k];\n    int min = 99999, count = 1;\n    for (count = 1; count < n; count++) {\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++) {\n          if (shuzu[j][k] <= min)\n            min = shuzu[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          shuzu[j][k] = shuzu[j][k] - min;\n        }\n        min = 99999;\n      }\n      sum = sum + shuzu[count][count];\n\n      for (j = 0; j < n; j++) {\n        shuzu[j][count] = 99999;\n      }\n      for (k = 0; k < n; k++) {\n        shuzu[count][k] = 99999;\n      }\n      shuzu[count][count] = 9999;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[110][110];\nint size;\nint zero();\nint main() {\n  int n, i;\n  int x, y;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    size = n;\n    for (x = 0; x < n; x++)\n      for (y = 0; y < n; y++)\n        cin >> a[x][y];\n    int sum = 0;\n    for (x = 1; x <= n - 1; x++)\n      sum += zero();\n    cout << sum << endl;\n    \n    \n  }\n  return 0;\n}\nint zero() {\n  int x, y, temp;\n  for (x = 0; x < size; x++) {\n    for (y = 1, temp = a[x][0]; y < size; y++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (y = 0; y < size; y++)\n      a[x][y] -= temp;\n  }\n  for (y = 0; y < size; y++) {\n    for (x = 1, temp = a[0][y]; x < size; x++)\n      if (a[x][y] < temp)\n        temp = a[x][y];\n    for (x = 0; x < size; x++)\n      a[x][y] -= temp;\n  }\n  temp = a[1][1];\n  for (x = 1; x < size - 1; x++)\n    for (y = 0; y < size; y++)\n      a[x][y] = a[x + 1][y];\n  for (y = 1; y < size - 1; y++)\n    for (x = 0; x < size - 1; x++)\n      a[x][y] = a[x][y + 1];\n  size -= 1;\n  return temp;\n}\n"}
{"label": "18", "index": "34086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a[], int nx) {\n  int x, min;\n  min = a[0];\n  for (x = 0; x <= nx - 1; x++) {\n    if (a[x] <= min) {\n      min = a[x];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int temp, nx, y, sum, i, j, k, n, a[100][100], b[100], m;\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    nx = n;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (y = 1; y <= n - 1; y++) {\n      for (j = 0; j <= n - 1; j++) {\n        temp = min(a[j], nx);\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        for (m = 0; m <= n - 1; m++) {\n          b[m] = a[m][k];\n        }\n        temp = min(b, nx);\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k] - temp;\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k <= n - 1; k++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n      for (k = 1; k <= n - 2; k++) {\n        for (j = 0; j <= n - 1; j++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      nx--;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum;\nint func(int a[100][100], int n);\nint main() {\n  int n, j, k, i;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    memset(a, 0, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    sum = 0;\n    cout << func(a, n) << \"\\n\";\n  }\n  return 0;\n}\nint func(int a[100][100], int n) {\n  int i, j, min, b[100][100];\n  if (n <= 1)\n    return sum;\n  else {\n    for (i = 0; i < n; i++) {\n      min = a[i][0];\n      for (j = 0; j < n; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i][j] - min;\n    }\n    for (i = 0; i < n; i++) {\n      min = a[0][i];\n      for (j = 0; j < n; j++)\n        if (a[j][i] < min)\n          min = a[j][i];\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i] - min;\n    }\n    sum += a[1][1];\n    for (i = 2; i < n; i++) {\n      for (j = 0; j < n - 1; j++)\n        b[i - 1][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++)\n        b[j][i - 1] = a[j + 1][i];\n    }\n    for (j = 1; j < n - 1; j++)\n      b[0][j] = a[0][j + 1];\n    for (j = 1; j < n - 1; j++)\n      b[j][0] = a[j + 1][0];\n    b[0][0] = a[0][0];\n    func(b, n - 1);\n  }\n}\n"}
{"label": "18", "index": "34088", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\nint sum, n;                    \nvoid r2z(int a[][100], int n); \nvoid sub(int a[][100], int n); \n\nint main() {\n  int i, row, col, a[100][100] = {0};\n  cin >> n;\n  int m = n; \n  for (i = 0; i < m; i++) {\n    sum = 0;\n    n = m; \n    for (row = 0; row < m; row++)\n      for (col = 0; col < m; col++) {\n        cin >> a[row][col]; \n      }\n    r2z(a, n); \n    cout << sum << endl;\n  }\n  return 0;\n}\n\nvoid r2z(int a[][100], int n) {\n  int i, j, min[100];\n  for (i = 0; i < n; i++) {\n    min[i] = 10000; \n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min[i])\n        min[i] = a[i][j]; \n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min[i]; \n    }\n  }\n  for (j = 0; j < n; j++) {\n    min[j] = 10000;\n    for (i = 0; i < n; i++) {\n      if (a[i][j] < min[j])\n        min[j] = a[i][j]; \n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min[j]; \n    }\n  }\n  sum += a[1][1]; \n  sub(a, n);      \n}\n\nvoid sub(int a[][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  n--; \n  if (n > 1)\n    r2z(a, n); \n}\n"}
{"label": "18", "index": "34089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i = 0;\n  while (i < n) {\n    int a[n][n];\n    int b[n], c[n];\n    int t = 1;\n    int j, k;\n    int sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    while (t < n) {\n      for (j = 0; j < n; j++) {\n        if (a[j][0] < 0)\n          j++;\n        b[j] = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (b[j] > a[j][k] && a[j][k] >= 0)\n            b[j] = a[j][k];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++) {\n          if (a[j][k] >= 0) {\n            a[j][k] = a[j][k] - b[j];\n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        if (a[0][j] < 0)\n          j++;\n        c[j] = a[0][j];\n        for (k = 0; k < n; k++) {\n          if (c[j] > a[k][j] && a[k][j] >= 0)\n            c[j] = a[k][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (a[k][j] >= 0) {\n            a[k][j] = a[k][j] - c[j];\n          }\n      }\n      sum = sum + a[t][t];\n      for (j = 0; j < n; j++) {\n        a[t][j] = -1;\n        a[j][t] = -1;\n      }\n      t++;\n    }\n    i++;\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34090", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n;\n  scanf(\"%d \", &n);\n  for (int k = 0; k < n; ++k) {\n    for (int i = 0; i < n; ++i)\n      for (int j = 0; j < n; ++j)\n        cin >> a[i][j];\n    int total = 0;\n    for (int t = 0; t < n - 1; ++t) {\n      for (int i = 0; i < n; ++i) {\n        if (i != 0 && i <= t)\n          continue;\n        int minValue = a[i][0];\n        for (int j = t + 1; j < n; ++j)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[i][0] -= minValue;\n        for (int j = t + 1; j < n; ++j)\n          a[i][j] -= minValue;\n      }\n      for (int j = 0; j < n; ++j) {\n        if (j != 0 && j <= t)\n          continue;\n        int minValue = a[0][j];\n        for (int i = t + 1; i < n; ++i)\n          if (a[i][j] < minValue)\n            minValue = a[i][j];\n        a[0][j] -= minValue;\n        for (int i = t + 1; i < n; ++i)\n          a[i][j] -= minValue;\n      }\n      total += a[t + 1][t + 1];\n    }\n    printf(\"%d\\n\", total);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34091", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint a[100][100];\nint main() {\n  int m, n, i, j, t, k = 0, p, ans;\n  cin >> m;\n  while (k < m) {\n    n = m;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    p = 1;\n    while (n > p) {\n      for (i = 0; i < n; i++) {\n        if (i && i < p)\n          continue;\n        t = *(*(a + i) + 0);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + i) + j) ? *(*(a + i) + j) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= t;\n      }\n      for (i = 0; i < n; i++) {\n        if (j && j < p)\n          continue;\n        t = *(*(a + 0) + i);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + j) + i) ? *(*(a + j) + i) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) -= t;\n      }\n      ans += *(*(a + p) + p);\n      p++;\n    }\n    printf(\"%d\\n\", ans);\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34092", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, min1;\nint a[110][110];\nvoid del() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nvoid delmin(int x, int y, int dx, int dy) {\n  if (x == m || y == m)\n    return;\n  if (a[x][y] < min1)\n    min1 = a[x][y];\n  delmin(x + dx, y + dy, dx, dy);\n  a[x][y] -= min1;\n}\nint main() {\n  cin >> n;\n  int i = 0, j = 0, k = 0, sum = 0;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m > 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        min1 = 10000;\n        delmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      del();\n    }\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "34093", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[1000][1000];\n  int n, i, j, k;\n\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n\n    int lenth, min, sum;\n    lenth = n - 1;\n    sum = 0;\n    while (lenth >= 1) {\n      for (i = 0; i <= lenth; i++) {\n\n        min = 2147483647;\n        for (j = 0; j <= lenth; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j <= lenth; j++)\n          array[i][j] = array[i][j] - min;\n      }\n      for (j = 0; j <= lenth; j++) {\n\n        min = 2147483647;\n        for (i = 0; i <= lenth; i++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (i = 0; i <= lenth; i++)\n          array[i][j] = array[i][j] - min;\n      }\n      sum = sum + array[1][1];\n\n      for (i = 0; i <= lenth; i++)\n        for (j = 1; j < lenth; j++)\n          array[i][j] = array[i][j + 1];\n      for (j = 0; j <= lenth; j++)\n        for (i = 1; i < lenth; i++)\n          array[i][j] = array[i + 1][j];\n      lenth = lenth - 1;\n    }\n    printf(\"%d\", sum);\n    if (k < n) {\n      printf(\"\\n\");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, l, m, b, c, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 0; j <= n * n - 1; j++)\n      cin >> a[j / n][j % n];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        b = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          if (a[k][l] < b)\n            b = a[k][l];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[k][l] = a[k][l] - b;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        c = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[l][k] == 999999)\n            continue;\n          if (a[l][k] < c)\n            c = a[l][k];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[l][k] = a[l][k] - c;\n        }\n      }\n      s = s + a[j][j];\n      for (m = 0; m <= n - 1; m++)\n        a[j][m] = 999999;\n      for (m = 0; m <= n - 1; m++)\n        a[m][j] = 999999;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34095", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint min(int a, int b) { return a < b ? a : b; }\n\nint f(int n, int number[100][100]) {\n  int num[100], m = 10000;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      m = min(m, number[i][j]);\n    }\n    num[i] = m;\n    m = 10000;\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      number[i][j] = number[i][j] - num[i];\n  }\n\n  m = 10000;\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      m = min(m, number[i][j]);\n    }\n    num[j] = m;\n    m = 10000;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      number[i][j] = number[i][j] - num[j];\n    }\n  }\n\n  if (n == 2)\n\n    return number[1][1];\n  else {\n    int sum;\n    sum = number[1][1];\n    for (int j = 0; j < n; j++) {\n      for (int i = 1; i < n - 1; i++) {\n        number[i][j] = number[i + 1][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n - 1; j++) {\n        number[i][j] = number[i][j + 1];\n      }\n    }\n    return sum + f(n - 1, number);\n  }\n}\n\nint main() {\n  int n, sum = 0;\n  cin >> n;\n  int n1 = n;\n  while (n--) {\n    int number[100][100];\n    for (int i = 0; i < n1; i++) {\n      for (int j = 0; j < n1; j++) {\n        scanf(\"%d \", &number[i][j]);\n      }\n    }\n    int sum = f(n1, number);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34096", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  int sum, Min;\n  cin >> n;\n  for (int num = 0; num < n; num++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int x = 1; x < n; x++) {\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int col = 0; col < n; col++)\n          if (a[i][col] >= 0)\n            Min = Min < a[i][col] ? Min : a[i][col];\n        for (int col = 0; col < n; col++)\n          a[i][col] -= Min;\n      }\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int row = 0; row < n; row++)\n          if (a[row][i] >= 0)\n            Min = Min < a[row][i] ? Min : a[row][i];\n        for (int row = 0; row < n; row++)\n          a[row][i] -= Min;\n      }\n      sum += a[x][x];\n      for (int i = 0; i < n; i++)\n        a[x][i] = -1;\n      for (int i = 0; i < n; i++)\n        a[i][x] = -1;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34097", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, mini;\nint a[110][110];\nvoid findmin(int x, int y, int dx, int dy) {\n  if (x == m)\n    return;\n  if (y == m)\n    return;\n  if (a[x][y] < mini)\n    mini = a[x][y];\n  findmin(x + dx, y + dy, dx, dy);\n  a[x][y] = a[x][y] - mini;\n}\nvoid kill() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nint main() {\n  int i, j, sum, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mini = 10000;\n        findmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + a[1][1];\n      kill();\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34098", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid f1(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) < m)\n      m = *(p + i);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i) = *(p + i) - m;\n  if (k > 1)\n    f1(p + 100, n, (k - 1));\n}\nvoid f2(int *p, int n, int k) {\n  int i, m = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i * 100) < m)\n      m = *(p + i * 100);\n  }\n  for (i = 0; i < n; i++)\n    *(p + i * 100) = *(p + i * 100) - m;\n  if (k > 1)\n    f2(p + 1, n, (k - 1));\n}\nint main() {\n  int *p, a[100][100], n, i, j, t, m, h;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++)\n        cin >> a[j][t];\n    }\n    p = a[0];\n    h = 0;\n    for (j = n; j > 1; j--) {\n      f1(p, j, j);\n      f2(p, j, j);\n      h += a[1][1];\n      for (t = 0; t < j; t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[t][m] = a[t][m + 1];\n      }\n      for (t = 0; t < (j - 1); t++) {\n        for (m = 1; m < (j - 1); m++)\n          a[m][t] = a[m + 1][t];\n      }\n    }\n    printf(\"%d\\n\", h);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34099", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, s, i, j, k, m, t, a[100][100], x;\n  cin >> n;\n  x = n;\n  for (i = 0; i < x; i++) {\n    s = 0;\n    n = x;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    for (t = 1; t < x; t++) {\n      for (j = 0; j < n; j++) {\n        m = a[j][0];\n        for (k = 1; k < n; k++) {\n          if (a[j][k] < m)\n            m = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[0][j];\n        for (k = 1; k < n; k++) {\n          if (a[k][j] < m)\n            m = a[k][j];\n        }\n        for (k = 0; k < n; k++)\n          a[k][j] = a[k][j] - m;\n      }\n      s = s + a[1][1];\n      for (j = 1; j < n - 1; j++) {\n        a[0][j] = a[0][j + 1];\n        a[j][0] = a[j + 1][0];\n      }\n      for (j = 1; j < n - 1; j++)\n        for (k = 1; k < n - 1; k++)\n          a[j][k] = a[j + 1][k + 1];\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n}\n"}
{"label": "18", "index": "34100", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int sum = 0;\n  for (int ii = 0; ii < n; ii++) {\n    sum = 0;\n    int a[100][100];\n    for (int i2 = 0; i2 < n; i2++)\n      for (int i3 = 0; i3 < n; i3++)\n        cin >> a[i2][i3];\n\n    for (int i = 1; i < n; i++) {\n      int min1;\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j][j2]);\n        min1 = min(min1, a[j][0]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j][j2] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[0][j]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[0][j2] -= min1;\n\n      for (int j = i; j < n; j++) {\n        min1 = 100000;\n        for (int j2 = i; j2 < n; j2++)\n          min1 = min(min1, a[j2][j]);\n        min1 = min(min1, a[0][j]);\n        for (int j2 = 0; j2 < n; j2++)\n          a[j2][j] -= min1;\n      }\n      min1 = 100000;\n      for (int j = i; j < n; j++)\n        min1 = min(min1, a[j][0]);\n      min1 = min(min1, a[0][0]);\n      for (int j2 = 0; j2 < n; j2++)\n        a[j2][0] -= min1;\n\n      sum += a[i][i];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34101", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint matrix[100][100], sum = 0;\n\nvoid SUM(int n) {\n  if (n == 1)\n    return;\n  int i, j;\n\n  int min;\n  for (i = 0; i < n; i++) {\n    min = matrix[i][0];\n    for (j = 0; j < n; j++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    min = matrix[0][j];\n    for (i = 0; i < n; i++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  sum += matrix[1][1];\n\n  for (j = 1; j < n - 1; j++)\n    matrix[0][j] = matrix[0][j + 1];\n\n  for (i = 1; i < n - 1; i++)\n    matrix[i][0] = matrix[i + 1][0];\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      matrix[i][j] = matrix[i + 1][j + 1];\n    }\n  }\n\n  SUM(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &matrix[j][k]);\n\n    SUM(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int nq, times, i, j, min, m;\n\n  cin >> nq;\n  const int n = nq;\n  int sum[n];\n  int a[n][n][n];\n  for (times = 0; times < n; times++)\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[times][i][j];\n  for (times = 0; times < n; times++) {\n    sum[times] = 0;\n    for (m = n; m > 1; m--)\n\n    {\n      for (i = 0; i < m; i++)\n\n      {\n        min = a[times][i][0];\n        for (j = 1; j < m; j++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (j = 0; j < m; j++)\n          a[times][i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = a[times][0][j];\n        for (i = 1; i < m; i++)\n          if (a[times][i][j] < min)\n            min = a[times][i][j];\n        for (i = 0; i < m; i++)\n          a[times][i][j] -= min;\n      }\n      sum[times] += a[times][1][1];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n; j++)\n          a[times][i - 1][j] = a[times][i][j];\n      for (i = 2; i < m; i++)\n        for (j = 0; j < n - 1; j++)\n          a[times][j][i - 1] = a[times][j][i];\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g_a;\nint g_Matrix[100][100];\n\nint Operation(int);\nvoid lineDel(int);\nvoid rowDel(int);\nvoid Transform(int);\n\nvoid lineDel(int times)\n\n{\n  int i, j, min, post;\n  for (i = 1; i <= times; i++) {\n    min = g_Matrix[i][1];\n    post = 1;\n    for (j = 1; j <= times; j++) {\n      if (g_Matrix[i][j] < min) {\n        min = g_Matrix[i][j];\n        post = j;\n      }\n    }\n    g_Matrix[0][j] = 0;\n    for (j = 1; j <= times; j++)\n      g_Matrix[i][j] -= min;\n  }\n}\n\nvoid rowDel(int times)\n\n{\n  int i, j, min, post;\n  for (j = 1; j <= times; j++) {\n    if (g_Matrix[0][j]) {\n      min = g_Matrix[1][j];\n      post = 1;\n      for (i = 1; i <= times; i++) {\n        if (g_Matrix[i][j] < min) {\n          min = g_Matrix[i][j];\n          post = i;\n        }\n      }\n      for (i = 1; i <= times; i++)\n        g_Matrix[i][j] -= min;\n    }\n  }\n}\n\nvoid Transform(int times)\n\n{\n  int i, j;\n  for (i = 1; i <= times; i++) {\n    for (j = 1; j <= times; j++) {\n      if (i == 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i][j + 1];\n      if (j == 1 && i > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j];\n      if (i > 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j + 1];\n    }\n  }\n}\n\nint Operation(int times)\n\n{\n  int j, num;\n  if (times != 1) {\n    for (j = 1; j <= times; j++)\n      g_Matrix[0][j] = 1;\n    lineDel(times);\n    rowDel(times);\n    num = g_Matrix[2][2];\n    Transform(times - 1);\n    return num + Operation(times - 1);\n  } else\n    return 0;\n}\n\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  g_a = n;\n  while (n--) {\n    for (i = 1; i <= g_a; i++)\n      for (j = 1; j <= g_a; j++)\n        cin >> g_Matrix[i][j];\n    printf(\"%d\\n\", Operation(g_a));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34104", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  scanf(\"%d \", &n);\n  int matrix[100][100] = {0};\n  int time, min, sum = 0, k;\n  for (k = 1; k <= n; k++) {\n    int i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> *(*(matrix + i) + j);\n      }\n    sum = 0;\n    for (time = 1; time < n; time++) {\n      for (i = 0; i <= n - time; i++) {\n        min = *(*(matrix + i));\n        for (j = 0; j <= n - time; j++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) -= min;\n      }\n      for (j = 0; j <= n - time; j++) {\n        min = *(*(matrix) + j);\n        for (i = 0; i <= n - time; i++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) -= min;\n      }\n      sum += *(*(matrix + 1) + 1);\n      for (i = 1; i <= n - time; i++) {\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) = *(*(matrix + i + 1) + j);\n      }\n      for (j = 1; j <= n - time; j++) {\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) = *(*(matrix + i) + j + 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int i, j, a[100][100];\n  int min, k;\n  cin >> n;\n  int tn, sum;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    sum = 0;\n    tn = n;\n    while (tn > 1) {\n\n      for (i = 0; i < tn; i++) {\n        min = a[i][0];\n        for (j = 0; j < tn; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tn; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < tn; i++) {\n        min = a[0][i];\n        for (j = 0; j < tn; j++) {\n          if (min > a[j][i])\n            min = a[j][i];\n        }\n        for (j = 0; j < tn; j++) {\n          a[j][i] -= min;\n        }\n      }\n\n      sum += a[1][1];\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[i][j] = a[i + 1][j];\n      }\n      for (i = 1; i < tn - 1; i++) {\n        for (j = 0; j < tn; j++)\n          a[j][i] = a[j][i + 1];\n      }\n      tn--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, sum, m;\n  int a[110][110] = {0};\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    m = n;\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(a + j) + k);\n    for (m = n; m > 1; m--) {\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + j) + k);\n          } else if (min > *(*(a + j) + k))\n            min = *(*(a + j) + k);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + j) + k) -= min;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        for (k = 0; k < m; k++) {\n          if (!k) {\n            min = *(*(a + k) + j);\n          } else if (min > *(*(a + k) + j))\n            min = *(*(a + k) + j);\n        }\n        for (k = 0; k < m; k++) {\n          *(*(a + k) + j) -= min;\n        }\n      }\n      sum += *(*(a + 1) + 1);\n      for (j = 2; j < m; j++)\n        *(*a + j - 1) = *(*a + j);\n      for (j = 2; j < m; j++)\n        *(*(a + j - 1)) = *(*(a + j));\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          *(*(a + j - 1) + k - 1) = *(*(a + j) + k);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minrow(int a[100][100], int i, int m) {\n  int b = a[i][0], j;\n  for (j = 0; j < m; j++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nint mincolumn(int a[100][100], int j, int m) {\n  int b = a[0][j], i;\n  for (i = 0; i < m; i++) {\n    if (a[i][j] < b)\n      b = a[i][j];\n  }\n  return b;\n}\nvoid row(int a[100][100], int m) {\n  int i, j, b;\n  for (i = 0; i < m; i++) {\n    b = minrow(a, i, m);\n    for (j = 0; j < m; j++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid column(int a[100][100], int m) {\n  int i, j, b;\n  for (j = 0; j < m; j++) {\n    b = mincolumn(a, j, m);\n    for (i = 0; i < m; i++) {\n      a[i][j] = a[i][j] - b;\n    }\n  }\n}\nvoid del(int a[100][100], int m) {\n  int i, j;\n  for (i = 1; i < m; i++)\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nvoid print(int a[100][100], int m) {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < m; j++) {\n      printf(\"%d \", a[i][j]);\n    }\n    printf(\"\\n\");\n  }\n}\nint main() {\n  int n, i, j, k, a[100][100] = {0}, m;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int b = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    m = n;\n    for (j = 0; j < n - 1; j++) {\n      row(a, m);\n      column(a, m);\n      b = b + a[1][1];\n      del(a, m);\n      m--;\n    }\n    printf(\"%d\\n\", b);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34108", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    int a[n][n], i, j, sum = 0;\n    int min[n], liemin[n];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n; i++)\n      min[i] = a[i][0];\n    for (i = 0; i < n; i++)\n      liemin[i] = a[0][i];\n\n    int scale = n;\n    while (scale > 1) {\n      for (i = 0; i < scale; i++) {\n        for (j = 0; j < scale; j++) {\n          if (a[i][j] < min[i])\n            min[i] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min[i];\n\n      for (j = 0; j < scale; j++)\n        for (i = 0; i < scale; i++) {\n          if (a[i][j] < liemin[j])\n            liemin[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - liemin[j];\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < scale; i++)\n        for (j = 1; j < scale; j++)\n          a[i][j] = a[i][j + 1];\n\n      for (j = 0; j < scale; j++)\n        for (i = 1; i < scale; i++)\n          a[i][j] = a[i + 1][j];\n\n      scale = scale - 1;\n      for (i = 0; i < scale; i++)\n        min[i] = a[i][0];\n      for (i = 0; i < scale; i++)\n        liemin[i] = a[0][i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint w[150][150];\nint m[150];\nint main() {\n  cin >> n;\n  for (int _n = 0; _n < n; _n++) {\n    memset(w, 0, sizeof(w));\n    int s = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> w[i][j];\n    for (int t = 1; t < n; t++) {\n\n      for (int i = 0; i < n; i++) {\n        if ((i < t) && i)\n          continue;\n        m[i] = w[i][0];\n        for (int j = t; j < n; j++)\n          if (w[i][j] < m[i])\n            m[i] = w[i][j];\n        w[i][0] -= m[i];\n        for (int j = t; j < n; j++)\n          w[i][j] -= m[i];\n      }\n      for (int j = 0; j < n; j++) {\n        if ((j < t) && j)\n          continue;\n        m[j] = w[0][j];\n        for (int i = t; i < n; i++)\n          if (w[i][j] < m[j])\n            m[j] = w[i][j];\n        w[0][j] -= m[j];\n        for (int i = t; i < n; i++)\n          w[i][j] -= m[j];\n      }\n      s += w[t][t];\n    }\n\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint tozero(int n);\nvoid delete1(int, int);\nvoid delete2(int, int);\nvoid movea(int);\nint a[100][100], sum = 0;\nint main() {\n  int n, i, j, k;\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j <= 99; j++)\n      for (k = 0; k <= 99; k++)\n        *(*(a + j) + k) = 0;\n    int r, l, lim = 99;\n    char c;\n\n    for (r = 0; r < n; r++)\n      for (l = 0; l < n; l++) {\n        scanf(\"%d\", *(a + r) + l);\n      }\n    sum = tozero(r);\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  }\n}\nvoid delete1(int r, int n) {\n  int min = *(*(a + r) + 0), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + r) + j) < min)\n      min = *(*(a + r) + j);\n  for (j = 0; j < n; j++)\n    *(*(a + r) + j) -= min;\n}\nvoid delete2(int l, int n) {\n  int min = *(*(a + 0) + l), j;\n  for (j = 0; j < n; j++)\n    if (*(*(a + j) + l) < min)\n      min = *(*(a + j) + l);\n  for (j = 0; j < n; j++)\n    *(*(a + j) + l) -= min;\n}\nvoid movea(int n) {\n  int i, j, k;\n  for (i = 1; i < n - 1; i++)\n    *(*(a + 0) + i) = *(*(a + 0) + i + 1);\n  for (i = 1; i < n - 1; i++)\n    *(*(a + i) + 0) = *(*(a + i + 1) + 0);\n  for (i = 1; i < n - 1; i++)\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      *(*(a + j) + i) = *(*(a + j) + i + 1);\n}\n\nint tozero(int n) {\n  int i, j, k;\n  for (i = 0; i < n; i++)\n    delete1(i, n);\n  for (i = 0; i < n; i++)\n    delete2(i, n);\n  sum += *(*(a + 1) + 1);\n  movea(n);\n  if (n >= 3)\n    tozero(n - 1);\n  return sum;\n}\n"}
{"label": "18", "index": "34111", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[100][1000][1000];\nint main() {\n  int n, i, j, min, p, q, k, h, sum = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 1; i <= n; i++) {\n      for (j = 1; j <= n; j++) {\n        cin >> a[k][i][j];\n      }\n    }\n  }\n  for (p = 1; p <= n; p++) {\n    h = n;\n    for (q = 1; q <= n - 1; q++) {\n      for (i = 1; i <= h; i++) {\n        min = 100000;\n        for (j = 1; j <= h; j++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++)\n          a[p][i][k] = a[p][i][k] - min;\n      }\n      for (j = 1; j <= h; j++) {\n        min = 100000;\n        for (i = 1; i <= h; i++) {\n          if (a[p][i][j] < min)\n            min = a[p][i][j];\n        }\n        for (k = 1; k <= h; k++) {\n          a[p][k][j] = a[p][k][j] - min;\n        }\n      }\n      sum += a[p][2][2];\n      for (i = 1; i <= h; i++)\n        a[p][2][i] = 0;\n      for (j = 1; j <= h; j++)\n        a[p][j][2] = 0;\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][j][i - 1] = a[p][j][i];\n        }\n      }\n      for (i = 3; i <= h; i++) {\n        for (j = 1; j <= h; j++) {\n          a[p][i - 1][j] = a[p][i][j];\n        }\n      }\n      h -= 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34112", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, mini;\nint a[110][110];\nvoid findmin(int x, int y, int dx, int dy) {\n  if (x == m)\n    return;\n  if (y == m)\n    return;\n  if (a[x][y] < mini)\n    mini = a[x][y];\n  findmin(x + dx, y + dy, dx, dy);\n  a[x][y] = a[x][y] - mini;\n}\nvoid kill() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n}\nint main() {\n  int i, j, sum, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (sum = 0, m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        mini = 10000;\n        findmin((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum = sum + a[1][1];\n      kill();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34113", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint minih(int numh, int *p)   \n{\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numh; i++) {\n    if (min > *(p + i - 1)) {\n      min = *(p + i - 1);\n    } else {\n    }\n  }\n  return min;\n}\nint minil(int numl, int *p)   \n{\n  int min;\n  min = *p;\n  int i;\n  for (i = 1; i <= numl; i++) {\n    if (min > *(p + 101 * (i - 1))) {\n      min = *(p + 101 * (i - 1));\n    } else {\n    }\n  }\n  return min;\n}\nint main() {\n  int a[101][101];\n  int *p;\n  p = &a[0][0];\n  int i, j, k, n;\n  int minor;\n  int sum;\n  scanf(\"%d\", &n);\n  int hang, lie;\n  for (i = 1; i <= n; i++) {\n    \n    hang = n;\n    lie = n;\n    sum = 0;\n    \n    for (j = 1; j <= n; j++) {\n      for (k = 1; k <= n; k++) {\n        scanf(\"%d\", p + 101 * (j - 1) + k - 1);\n      }\n    }\n    \n    for (minor = 1; lie > 1; minor++) {\n      \n      for (j = 1; j <= hang; j++) {\n        int minihang;\n        \n        minihang = minih(lie, (p + 101 * (j - 1)));\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) -= minihang;\n        }\n      }\n      \n      for (j = 1; j <= lie; j++) {\n        int minilie;\n        \n        minilie = minil(hang, (p + (j - 1)));\n        for (k = 1; k <= hang; k++) {\n          *(p + (j - 1) + 101 * (k - 1)) -= minilie;\n        }\n      }\n      sum += *(p + 102);\n      \n      for (j = 2; j <= hang; j++) {\n        for (k = 1; k <= lie; k++) {\n          *(p + 101 * (j - 1) + k - 1) = *(p + 101 * j + k - 1);\n        }\n      }\n      hang--;\n      \n      for (j = 2; j <= lie; j++) {\n        for (k = 1; k <= hang; k++) {\n          *(p + 101 * (k - 1) + j - 1) = *(p + 101 * (k - 1) + j);\n        }\n      }\n      lie--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[100][100];\nint (*p)[100] = array_1;\nint sum;\nint n;\nint times;\n\nvoid zero() {\n  int xmin = 10000, ymin = 10000;\n  for (int i = 0; i <= n - 1 - times; i++) {\n    for (int j = 0; j <= n - 1 - times; j++)\n      if (*(*(p + i) + j) < xmin) {\n        xmin = *(*(p + i) + j);\n      }\n    for (int j = 0; j <= n - 1 - times; j++)\n      *(*(p + i) + j) -= xmin;\n    xmin = 10000;\n  }\n  for (int j = 0; j <= n - 1 - times; j++) {\n    for (int i = 0; i <= n - 1 - times; i++)\n      if (*(*(p + i) + j) < ymin) {\n        ymin = *(*(p + i) + j);\n      }\n    for (int i = 0; i <= n - 1 - times; i++)\n      *(*(p + i) + j) -= ymin;\n    ymin = 10000;\n  }\n\n  sum += (*(*(p + 1) + 1));\n}\nvoid decline() {\n  for (int i = 1; i <= n - 2; i++)\n    for (int j = 0; j <= n - 1; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n  for (int j = 1; j <= n - 2; j++)\n    for (int i = 0; i <= n - 2; i++)\n      *(*(p + i) + j) = *(*(p + i) + j + 1);\n}\n\nint main() {\n  cin >> n;\n  int time = 0;\n  while (true) {\n\n    if (time == n)\n      break;\n    times = 0;\n    sum = 0;\n\n    for (int i = 0; i <= n - 1; i++)\n      for (int j = 0; j <= n - 1; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 1; i <= n - 1; i++) {\n      zero();\n      decline();\n      times++;\n    }\n\n    cout << sum << \"\\n\";\n\n    time++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m[100][100], min = 100000, sum = 0, r;\n  int(*p)[100];\n  int n;\n  scanf(\"%d \", &n);\n  p = m;\n  int i, j;\n  int time;\n  for (time = 1; time <= n; time++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> m[i][j];\n      }\n    }\n    for (r = n; r > 1; r--) {\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (i = 0; i < r; i++) {\n        min = 100000;\n        for (j = 0; j < r; j++) {\n          if (*(*(p + j) + i) < min)\n            min = *(*(p + j) + i);\n        }\n        for (j = 0; j < r; j++) {\n          *(*(p + j) + i) -= min;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (j = 0; j < r; j++) {\n\n        for (i = 2; i < r; i++) {\n          *(*(p + j) + i - 1) = *(*(p + j) + i);\n        }\n      }\n      for (j = 2; j < r; j++) {\n        for (i = 0; i < r; i++) {\n          *(*(p + j - 1) + i) = *(*(p + j) + i);\n        }\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], N, i, j, k, l, min, sum = 0;\n  cin >> N;               \n  for (i = 0; i < N; i++) \n  {\n    for (j = 0; j < N; j++)\n      for (k = 0; k < N; k++)\n        cin >> a[j][k]; \n    n = N;\n    for (l = 0; l < N - 1; l++) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      } \n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k] - min;\n      }                    \n      sum = sum + a[1][1]; \n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k + 1]; \n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n - 1; k++)\n          a[j][k] = a[j + 1][k]; \n      n = n - 1;                 \n    }\n    cout << sum << endl; \n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34117", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint sum = 0;\ninline int FindMin_i(int M[][100], int i, int n) {\n  int Min = M[i][0];\n  for (int j = 0; j < n; j++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\ninline int FindMin_j(int M[][100], int j, int n) {\n  int Min = M[0][j];\n  for (int i = 0; i < n; i++) {\n    if (Min > M[i][j]) {\n      Min = M[i][j];\n    }\n  }\n  return Min;\n}\nint S(int M[][100], int n) {\n  if (n == 1) {\n    return sum;\n  }\n  int Min_i = 0;\n  for (int i = 0; i < n; i++) {\n    Min_i = FindMin_i(M, i, n);\n    for (int j = 0; j < n; j++) {\n      M[i][j] = M[i][j] - Min_i;\n    }\n  }\n  int Min_j = 0;\n  for (int j = 0; j < n; j++) {\n    Min_j = FindMin_j(M, j, n);\n    for (int i = 0; i < n; i++) {\n      M[i][j] = M[i][j] - Min_j;\n    }\n  }\n  sum = sum + M[1][1];\n  \n  for (int i = 1; i < n - 1; i++) {\n    M[i][0] = M[i + 1][0];\n  }\n  \n  for (int j = 1; j < n - 1; j++) {\n    M[0][j] = M[0][j + 1];\n  }\n  \n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 1; j < n - 1; j++) {\n      M[i][j] = M[i + 1][j + 1];\n    }\n  }\n  \n  S(M, n - 1);\n}\n\nint main() {\n  int M[100][100] = {0};\n  int n;\n  cin >> n;\n  for (int num = 0; num < n; num++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> M[i][j];\n      }\n    }\n    sum = 0;\n    cout << S(M, n) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cal(int a[100][101], int n) {\n  int i, j, k, min, t = 0, p, b[100][101] = {0};\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    p = 1;\n    min = a[0][i];\n    for (j = 0; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  t = a[1][1];\n  b[0][0] = a[0][0];\n  if (n == 2)\n    return a[1][1];\n  for (i = 2; i < n; i++) {\n    b[i - 1][0] = a[i][0];\n    b[0][i - 1] = a[0][i];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++) {\n      b[i - 1][j - 1] = a[i][j];\n    }\n  }\n  return t + cal(b, n - 1);\n}\nint main() {\n  int n, i, j, k, m, t, a[100][101] = {0}, sum;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[j][k]);\n      }\n    }\n    printf(\"%d\\n\", cal(a, n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0;\n  scanf(\"%d\", &n);\n  int i, j, k;\n  int flag = 0;\n  int gl(int num[][200], int n);\n  for (i = 0; i < n; i++) {\n    int sum = 0;\n    int num[200][200] = {0};\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &num[j][k]);\n    sum = gl(num, n);\n    printf(\"%d\\n\", sum);\n  }\n}\n\nint gl(int num[][200], int n) {\n  int i = 0, j = 0, k = 0;\n  int min = 0;\n  int flag = 0;\n  int sum = 0;\n  for (flag = 0; flag < n - 1; flag++) {\n    for (i = 0; i < n; i++) {\n      min = num[i][0];\n      for (j = 0; j < n; j++) {\n        if (num[i][j] < min) {\n          min = num[i][j];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[i][j] = num[i][j] - min;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      min = num[0][i];\n      for (j = 0; j < n; j++) {\n        if (num[j][i] < min) {\n          min = num[j][i];\n          ;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        num[j][i] = num[j][i] - min;\n      }\n    }\n    sum += num[1][1];\n\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[j][i - 1] = num[j][i];\n      }\n      num[j][i] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      for (i = 2; i < n; i++) {\n        num[i - 1][j] = num[i][j];\n      }\n      num[j][i] = 0;\n    }\n  }\n  return sum;\n}\n"}
{"label": "18", "index": "34120", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[101][101], n;\nint ans = 0;\nint findm(int x, int y);\nint findn(int x, int y);\nint main() {\n  int i, j, k;\n  int a, b, m, minm, temp[101][101];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; ++k) {\n    ans = 0;\n    for (i = 0; i < n; ++i) {\n      for (j = 0; j < n; ++j) {\n        cin >> array_1[i][j];\n      }\n    }\n    m = n;\n    while (m > 1) {\n      for (i = 0; i < m; ++i) {\n        minm = findm(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[i][j] -= minm;\n        }\n      }\n      for (i = 0; i < m; ++i) {\n        minm = findn(i, m);\n        for (j = 0; j < m; ++j) {\n          array_1[j][i] -= minm;\n        }\n      }\n      ans += array_1[1][1];\n      memset(temp, 0, sizeof(temp));\n      a = 0;\n      b = 0;\n      for (i = 0; i < m; ++i) {\n        if (i == 1)\n          continue;\n        for (j = 0; j < m; ++j) {\n          if (j == 1)\n            continue;\n          temp[a][b] = array_1[i][j];\n          b++;\n        }\n        a++;\n        b = 0;\n      }\n      memset(array_1, 0, sizeof(array_1));\n      for (i = 0; i < a; ++i) {\n        for (j = 0; j < a; ++j) {\n          array_1[i][j] = temp[i][j];\n        }\n      }\n      m--;\n    }\n    printf(\"%d\\n\", ans);\n  }\n  return 0;\n}\nint findm(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[x][i] < minn)\n      minn = array_1[x][i];\n  return minn;\n}\nint findn(int x, int y) {\n  int i, j;\n  int minn = 1000000;\n  for (i = 0; i < y; ++i)\n    if (array_1[i][x] < minn)\n      minn = array_1[i][x];\n  return minn;\n}\n"}
{"label": "18", "index": "34121", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, min, sum, m;\n  cin >> n;\n  int a[101][101] = {0};\n  m = n;\n  while (m) {\n    m--;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j]; \n    sum = 0;\n    for (k = n; k > 1; k--) {\n\n      for (i = 1; i <= k; i++) {\n        min = 98000;\n        for (j = 1; j <= k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 1; j <= k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 1; i <= k; i++) {\n        min = 98098;\n        for (j = 1; j <= k; j++)\n          if (a[j][i] < min)\n            min = a[j][i];\n        for (j = 1; j <= k; j++)\n          a[j][i] = a[j][i] - min; \n      }\n      sum = sum + a[2][2]; \n      if (k >= 3) {\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[i - 1][j] = a[i][j];\n        for (i = 3; i <= k; i++)\n          for (j = 1; j <= k; j++)\n            a[j][i - 1] = a[j][i]; \n      }\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34122", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    int a[n][n], i, j, sum = 0;\n    int min[n], liemin[n];\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (i = 0; i < n; i++)\n      min[i] = a[i][0];\n    for (i = 0; i < n; i++)\n      liemin[i] = a[0][i];\n\n    int scale = n;\n    while (scale > 1) {\n      for (i = 0; i < scale; i++)\n        for (j = 0; j < scale; j++) {\n          if (a[i][j] < min[i])\n            min[i] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min[i];\n\n      for (j = 0; j < scale; j++)\n        for (i = 0; i < scale; i++) {\n          if (a[i][j] < liemin[j])\n            liemin[j] = a[i][j];\n        }\n      for (i = 0; i < n; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - liemin[j];\n\n      sum = sum + a[1][1];\n\n      for (i = 0; i < scale; i++)\n        for (j = 1; j < scale; j++)\n          a[i][j] = a[i][j + 1];\n\n      for (j = 0; j < scale; j++)\n        for (i = 1; i < scale; i++)\n          a[i][j] = a[i + 1][j];\n\n      scale = scale - 1;\n      for (i = 0; i < scale; i++)\n        min[i] = a[i][0];\n      for (i = 0; i < scale; i++)\n        liemin[i] = a[0][i];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint array_1[110][110], sum;\n\nvoid dispose(int n);\n\nint main() {\n  int n;\n  cin >> n;\n  int p = 0;\n  do {\n    memset(array_1, 0, sizeof(array_1));\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> array_1[i][j];\n    dispose(n);\n    cout << sum << \"\\n\";\n    p++;\n  } while (p < n);\n  return 0;\n}\n\nvoid dispose(int n) {\n  int i, j;\n  if (n == 1)\n    return;\n  for (i = 0; i < n; i++) {\n    int rowmin = array_1[i][0];\n    for (j = 1; j < n; j++)\n      if (rowmin > array_1[i][j])\n        rowmin = array_1[i][j];\n    for (j = 0; j < n; j++)\n      array_1[i][j] -= rowmin;\n  }\n  for (i = 0; i < n; i++) {\n    int colmin = array_1[0][i];\n    for (j = 1; j < n; j++)\n      if (colmin > array_1[j][i])\n        colmin = array_1[j][i];\n    for (j = 0; j < n; j++)\n      array_1[j][i] -= colmin;\n  }\n  sum += array_1[1][1];\n  for (i = 1; i < n - 1; i++)\n    array_1[0][i] = array_1[0][i + 1];\n  for (i = 1; i < n - 1; i++)\n    array_1[i][0] = array_1[i + 1][0];\n  for (i = 1; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      array_1[i][j] = array_1[i + 1][j + 1];\n  dispose(n - 1);\n}\n"}
{"label": "18", "index": "34124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cut(int a[100][100], int);\nint main() {\n  int n, a[100][100], i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << cut(a, n) << endl;\n  }\n  return 0;\n}\nint cut(int a[100][100], int n) {\n  int i, j, min, count;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++)\n      min = (min > a[i][j]) ? a[i][j] : min;\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++)\n      min = (min > a[j][i]) ? a[j][i] : min;\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  count = a[1][1];\n  if (n == 2)\n    return count;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 2; i < n; i++) {\n    for (j = 2; j < n; j++)\n      a[i - 1][j - 1] = a[i][j];\n  }\n  return (cut(a, n - 1) + count);\n}\n"}
{"label": "18", "index": "34125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum, num, (*p)[200], t, temp;\n  int a[200][200];\n  cin >> n;\n  sum = 0;\n  num = 0;\n  p = a;\n  for (t = 1; t <= n; t++) {\n    sum = 0;\n    num = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    }\n    while (num < n - 1) {\n      for (i = 0; i < n - num; i++) {\n        temp = 1000;\n        for (j = 0; j < n - num; j++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      for (j = 0; j < n - num; j++) {\n        temp = 1000;\n        for (i = 0; i < n - num; i++) {\n          if (*(*(p + i) + j) < temp)\n            temp = *(*(p + i) + j);\n        }\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - temp;\n        }\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (i = 2; i < n - num; i++) {\n        for (j = 0; j < n - num; j++) {\n          *(*(p + i - 1) + j) = *(*(p + i) + j);\n        }\n      }\n      for (j = 2; j < n - num; j++) {\n        for (i = 0; i < n - num; i++) {\n          *(*(p + i) + j - 1) = *(*(p + i) + j);\n        }\n      }\n      num++;\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34126", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint min2;\nint min1;\nvoid diguihang(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min1 = a[i][0];\n  for (int j = 0; j < n; j++) {\n    if (a[i][j] < min1)\n      min1 = a[i][j];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[i][v] = a[i][v] - min1;\n  }\n  diguihang(i - 1, n, a);\n}\n\nvoid diguilie(int i, int n, int a[300][300]) {\n  if (i == -1)\n    return;\n  min2 = a[0][i];\n  for (int j = 0; j < n; j++) {\n\n    if (a[j][i] < min2)\n      min2 = a[j][i];\n  }\n\n  for (int v = 0; v < n; v++) {\n    a[v][i] = a[v][i] - min2;\n  }\n  diguilie(i - 1, n, a);\n}\n\nint change(int n, int sum, int a[300][300]) {\n  if (n == 1)\n    return sum;\n\n  diguihang(n - 1, n, a);\n  diguilie(n - 1, n, a);\n  sum = sum + a[1][1];\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n; i++) {\n      a[j][i] = a[j + 1][i];\n    }\n  for (int j = 1; j < n - 1; j++)\n    for (int i = 0; i < n - 1; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n\n  return change(n - 1, sum, a);\n}\nint main() {\n  int N;\n  int a[300][300];\n  cin >> N;\n  for (int i = 1; i <= N; i++) {\n    for (int j = 0; j < N; j++)\n      for (int y = 0; y < N; y++) {\n        scanf(\"%d \", &a[j][y]);\n      }\n    cout << change(N, 0, a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint num[100][100];\nint n;\n\nvoid modify() {\n  for (int i = 0; i < n; i++) {\n    int min = num[i][0];\n    for (int j = 1; j < n; j++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      num[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min = num[0][j];\n    for (int i = 1; i < n; i++) {\n      if (num[i][j] < min)\n        min = num[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      num[i][j] -= min;\n    }\n  }\n}\n\nvoid remove() {\n  for (int i = 1; i < n - 1; i++) {\n    for (int j = 0; j < n; j++) {\n      num[i][j] = num[i + 1][j];\n    }\n  }\n  for (int j = 1; j < n - 1; j++) {\n    for (int i = 0; i < n; i++)\n      num[i][j] = num[i][j + 1];\n  }\n}\n\nint main() {\n  int N;\n  scanf(\"%d \", &N);\n  int round = N;\n  while (round--) {\n    n = N;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> num[i][j];\n      }\n    }\n    int sum = 0;\n    while (n > 1) {\n      modify();\n      sum += num[1][1];\n      remove();\n      n--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34128", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nvoid guiling(void); \nvoid xiaojian(int); \nint g_n;            \nint main() {\n  cin >> g_n;\n  int i, j, k;\n  for (i = 1; i <= g_n; i++) {\n    for (j = 0; j <= g_n - 1; j++) {\n      for (k = 0; k <= g_n - 1; k++) {\n        cin >> a[j][k];\n      }\n    }              \n    int cishu = 1; \n    int sum = 0;\n    for (; a[g_n - 1][0] >= 0; cishu++) \n    {\n      guiling(); \n      sum = sum + a[cishu][cishu];\n      xiaojian(cishu);\n    }\n    cout << sum << endl; \n  }\n  return 0;\n}\n\nvoid guiling() {\n  int i = 0, j = 0, k = 0;\n  int flag = 0;\n  int min = 1000;\n  int p = 0;\n  for (p = 0; p <= g_n - 1; p++) {\n    flag = 0;\n    min = 1000;\n    if (a[p][0] >= 0) \n    {\n      for (i = 0; i <= g_n - 1; i++) \n      {\n        flag = 0;\n        min = 1000;\n        for (j = 0; j <= g_n - 1; j++) {\n          if (a[i][j] < 0) \n            continue;\n          if (a[i][j] == 0) \n          {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (!flag) \n        {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[i][k] = a[i][k] - min;\n          }\n        }\n      }\n      for (j = 0; j <= g_n - 1; j++) \n      {\n        flag = 0;\n        min = 1000;\n        for (i = 0; i <= g_n - 1; i++) {\n          if (a[i][j] < 0) \n            continue;\n          if (a[i][j] == 0) \n          {\n            flag = 1;\n            break;\n          }\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        if (!flag) \n        {\n          for (k = 0; k <= g_n - 1; k++) {\n            a[k][j] = a[k][j] - min;\n          }\n        }\n      }\n    }\n  }\n}\nvoid xiaojian(int cishu) {\n  int i, j;\n  for (i = 0; i <= g_n - 1; i++) \n  {\n    a[i][cishu] = -1;\n  }\n  for (j = 0; j <= g_n - 1; j++) {\n    a[cishu][j] = -1;\n  }\n}\n"}
{"label": "18", "index": "34129", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[100][100], i, j, k, n;\n  int rowMin, colMin;\n  int x;\n  int first;\n  int sum;\n  int flag;\n\n  scanf(\"%d\", &n);\n  for (k = 0; k < n; k++) {\n\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n\n    sum = 0;\n\n    for (x = n; x > 1; x--) {\n\n      for (i = 0; i < x; i++) {\n        first = 1;\n        flag = 0;\n        for (j = 0; j < x; j++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              rowMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < rowMin)\n              rowMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (j = 0; j < x; j++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - rowMin;\n          }\n        }\n      }\n\n      for (j = 0; j < x; j++) {\n        first = 1;\n        flag = 0;\n        for (i = 0; i < x; i++) {\n          if (a[i][j] > 0) {\n            if (first == 1) {\n              colMin = a[i][j];\n              first = 0;\n            } else if (a[i][j] < colMin)\n              colMin = a[i][j];\n          } else {\n            flag = 1;\n            break;\n          }\n        }\n        if (flag == 0) {\n          for (i = 0; i < x; i++) {\n            if (a[i][j] > 0)\n              a[i][j] = a[i][j] - colMin;\n          }\n        }\n      }\n\n      sum = sum + a[1][1];\n\n      i = 0;\n      for (j = 2; j < x; j++)\n        a[i][j - 1] = a[i][j];\n      j = 0;\n      for (i = 2; i < x; i++)\n        a[i - 1][j] = a[i][j];\n      for (i = 2; i < x; i++) {\n        for (j = 2; j < x; j++) {\n          a[i - 1][j - 1] = a[i][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34130", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int n;\n  int sum, Min;\n  scanf(\"%d \", &n);\n  for (int num = 0; num < n; num++) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (int x = 1; x < n; x++) {\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int col = 0; col < n; col++)\n          if (a[i][col] >= 0)\n            Min = Min < a[i][col] ? Min : a[i][col];\n        for (int col = 0; col < n; col++)\n          a[i][col] -= Min;\n      }\n      for (int i = 0; i < n; i++) {\n        Min = 10000;\n        for (int row = 0; row < n; row++)\n          if (a[row][i] >= 0)\n            Min = Min < a[row][i] ? Min : a[row][i];\n        for (int row = 0; row < n; row++)\n          a[row][i] -= Min;\n      }\n      sum += a[x][x];\n      for (int i = 0; i < n; i++)\n        a[x][i] = -1;\n      for (int i = 0; i < n; i++)\n        a[i][x] = -1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34131", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, number;\n  scanf(\"%d\", &n);\n  number = n;\n  for (i = 0; i < number; i++) {\n    int p, q, a[100][100], minnum[100], sum = 0;\n    for (p = 0; p < number; p++) {\n      for (q = 0; q < number; q++) {\n        scanf(\"%d\", &a[p][q]);\n      }\n    }\n    n = number;\n    while (n > 1) {\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          if (q == 0)\n            minnum[p] = a[p][q];\n          else if (minnum[p] > a[p][q])\n            minnum[p] = a[p][q];\n        }\n      }\n      for (p = 0; p < n; p++) {\n        for (q = 0; q < n; q++) {\n          a[p][q] = a[p][q] - minnum[p];\n        }\n      }\n      for (q = 0; q < n; q++) {\n        int tag = 0, min;\n        for (p = 0; p < n; p++) {\n          if (a[p][q] == 0)\n            tag = 1;\n          if (p == 0)\n            min = a[p][q];\n          else if (min > a[p][q])\n            min = a[p][q];\n        }\n        if (tag == 0) {\n          for (p = 0; p < n; p++) {\n            a[p][q] -= min;\n          }\n        }\n      }\n      sum += a[1][1];\n      n--;\n      for (j = 0, p = 0; p < n + 1; p++, j++) {\n        for (q = 0, k = 0; q < n + 1; q++, k++) {\n          if (p == 1)\n            p++;\n          if (q == 1)\n            q++;\n          a[j][k] = a[p][q];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34132", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, t = 0;\n  cin >> n;\n\n  for (t = 0; t < n; t++) {\n    int arr[100][100];\n    int i = 0, j = 0, k = 0, sum = 0, m = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> arr[i][j];\n    for (i = 1; i < n; i++) {\n      for (j = 0; j < m; j++) {\n        int min = arr[j][0];\n        for (k = 0; k < m; k++)\n          if (arr[j][k] < min)\n            min = arr[j][k];\n        for (k = 0; k < m; k++)\n          arr[j][k] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        int min = arr[0][j];\n        for (k = 0; k < m; k++)\n          if (arr[k][j] < min)\n            min = arr[k][j];\n        for (k = 0; k < m; k++)\n          arr[k][j] -= min;\n      }\n      sum += arr[1][1];\n      for (j = 2; j < m; j++) {\n        arr[0][j - 1] = arr[0][j];\n        arr[j - 1][0] = arr[j][0];\n      }\n      for (j = 2; j < m; j++)\n        for (k = 2; k < m; k++)\n          arr[j - 1][k - 1] = arr[j][k];\n\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100][100];\nint Sum(int n, int t[100][100]) {\n  int sum = 0, min = 0;\n  int i, j, tempi, tempj;\n\n  for (i = 0; i < n; i++) {\n    min = t[i][0];\n    for (j = 0; j < n; j++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (j = 0; j < n; j++)\n      t[i][j] -= min;\n  }\n\n  for (j = 0; j < n; j++) {\n    min = t[0][j];\n    for (i = 0; i < n; i++)\n      if (t[i][j] < min)\n        min = t[i][j];\n    for (i = 0; i < n; i++)\n      t[i][j] -= min;\n  }\n  sum = t[1][1];\n  if (n == 2)\n    return sum;\n\n  for (i = 0; i < n - 1; i++)\n    for (j = 0; j < n - 1; j++) {\n      if (j == 0)\n        tempj = j;\n      else\n        tempj = j + 1;\n      if (i == 0)\n        tempi = i;\n      else {\n        tempi = i + 1;\n      }\n      t[i][j] = t[tempi][tempj];\n    }\n\n  return sum += Sum(n - 1, t);\n}\nint main() {\n  int n, sum = 0;\n  memset(a, 0, sizeof(a));\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    sum = Sum(n, a[i]);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34134", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint g_a;\nint g_Matrix[100][100];\n\nint Operation(int);\nvoid lineDel(int);\nvoid rowDel(int);\nvoid Transform(int);\n\nvoid lineDel(int times)\n\n{\n  int i, j, min, post;\n  for (i = 1; i <= times; i++) {\n    min = g_Matrix[i][1];\n    post = 1;\n    for (j = 1; j <= times; j++) {\n      if (g_Matrix[i][j] < min) {\n        min = g_Matrix[i][j];\n        post = j;\n      }\n    }\n    g_Matrix[0][j] = 0;\n    for (j = 1; j <= times; j++)\n      g_Matrix[i][j] -= min;\n  }\n}\n\nvoid rowDel(int times)\n\n{\n  int i, j, min, post;\n  for (j = 1; j <= times; j++) {\n    if (g_Matrix[0][j]) {\n      min = g_Matrix[1][j];\n      post = 1;\n      for (i = 1; i <= times; i++) {\n        if (g_Matrix[i][j] < min) {\n          min = g_Matrix[i][j];\n          post = i;\n        }\n      }\n      for (i = 1; i <= times; i++)\n        g_Matrix[i][j] -= min;\n    }\n  }\n}\n\nvoid Transform(int times)\n\n{\n  int i, j;\n  for (i = 1; i <= times; i++) {\n    for (j = 1; j <= times; j++) {\n      if (i == 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i][j + 1];\n      if (j == 1 && i > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j];\n      if (i > 1 && j > 1)\n        g_Matrix[i][j] = g_Matrix[i + 1][j + 1];\n    }\n  }\n}\n\nint Operation(int times)\n\n{\n  int j, num;\n  if (times != 1) {\n    for (j = 1; j <= times; j++)\n      g_Matrix[0][j] = 1;\n    lineDel(times);\n    rowDel(times);\n    num = g_Matrix[2][2];\n    Transform(times - 1);\n    return num + Operation(times - 1);\n  } else\n    return 0;\n}\n\nint main() {\n  int n, i, j;\n  scanf(\"%d \", &n);\n  g_a = n;\n  while (n--) {\n    for (i = 1; i <= g_a; i++)\n      for (j = 1; j <= g_a; j++)\n        cin >> g_Matrix[i][j];\n    cout << Operation(g_a) << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint n = 0, a[101][101] = {{0}}, sum = 0, k = 0;\nint (*p)[101] = a;\nvoid zerorow(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p + i));\n    for (int j = 1; j < k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + i) + j) -= min;\n  }\n}\nvoid zerocol(int k) {\n  int min = 0;\n  for (int i = 0; i < k; i++) {\n    min = *(*(p) + i);\n    for (int j = 1; j < k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    if (min)\n      for (int j = 0; j < k; j++)\n        *(*(p + j) + i) -= min;\n  }\n}\nvoid jian(int k) {\n  for (int i = 2; i < k; i++)\n    for (int j = 0; j < k; j++)\n      *(*(p + i - 1) + j) = *(*(p + i) + j);\n  for (int j = 2; j < n; j++)\n    for (int i = 0; i < k - 1; i++)\n      *(*(p + i) + j - 1) = *(*(p + i) + j);\n}\nint main() {\n  scanf(\"%d \", &n);\n  while (scanf(\"%d \", p)) {\n    sum = 0;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        if (i + j)\n          cin >> *(*(p + i) + j);\n      }\n    for (k = n; k > 1; k--) {\n      zerorow(k);\n      zerocol(k);\n      sum += *(*(p + 1) + 1);\n      jian(k);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34136", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, q, i, j, min1[100], min2[100], a[100][100], d, w;\n  cin >> n;\n  w = n;\n  for (q = 0; q < w; q++) {\n\n    d = 0;\n    n = w;\n    for (i = 0; i < w; i++) {\n      for (j = 0; j < w; j++) {\n        cin >> a[i][j];\n      }\n    }\n    while (n >= 2) {\n      for (i = 0; i < n; i++)\n        min1[i] = 1000;\n      for (i = 0; i < n; i++)\n        min2[i] = 1000;\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          if (min1[i] > a[i][j]) {\n            min1[i] = a[i][j]; \n          }\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min1[i];\n        }\n      }\n      for (j = 0; j < n; j++) \n      {\n        for (i = 0; i < n; i++) {\n          if (min2[j] > a[i][j]) {\n            min2[j] = a[i][j]; \n          }\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min2[j];\n        }\n      }\n      d += a[1][1];\n      for (j = 0; j < n; j++) {\n        for (i = 2; i < n; i++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (i = 0; i < n; i++) {\n        for (j = 2; j < n; j++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      n--;\n    }\n    cout << d << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nvoid change(int a[][100], int n, int sum) {\n  int i, j, min1, min2;\n  if (n == 1) {\n    cout << sum << \"\\n\";\n    return;\n  } else {\n\n    for (i = 0; i < n; i++) {\n      min1 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min1 > a[i][j])\n          min1 = a[i][j];\n      }\n      for (j = 0; j < n; j++)\n        a[i][j] -= min1;\n    }\n\n    for (i = 0; i < n; i++) {\n      min2 = 10000;\n      for (j = 0; j < n; j++) {\n        if (min2 > a[j][i])\n          min2 = a[j][i];\n      }\n      for (j = 0; j < n; j++)\n        a[j][i] -= min2;\n    }\n    sum += a[1][1];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    for (i = 1; i < n - 1; i++)\n      for (j = 0; j < n; j++)\n        a[j][i] = a[j][i + 1];\n    change(a, n - 1, sum);\n  }\n}\nint main() {\n  int n, a[100][100], i, j, k, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    change(a, n, sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34138", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() \n{\n  int a[50][50][50];\n  int max[101] = {0};\n  int i, j, k, m, n, min, t = 0;\n  cin >> n; \n  for (i = 1; i <= n; i++)\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[i][j][k]; \n  for (i = 1; i <= n; i++) \n  {\n    for (t = 0; t < n - 1; t++) \n    {\n      for (j = 1; j <= n - t; j++) \n      {\n        min = a[i][j][1];\n\n        for (k = 1; k <= n - t; k++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (k = 1; k <= n - t; k++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      for (k = 1; k <= n - t; k++) \n      {\n        min = a[i][1][k]; \n        for (j = 1; j <= n - t; j++) {\n          if (min > a[i][j][k])\n            min = a[i][j][k];\n        }\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k] - min;\n      }\n      max[i] = max[i] + a[i][2][2];    \n      for (j = 2; j <= n - t - 1; j++) \n      {\n        for (k = 1; k <= n - t; k++) {\n          a[i][j][k] = a[i][j + 1][k];\n        }\n      }\n      for (k = 2; k <= n - t - 1; k++) \n      {\n        for (j = 1; j <= n - t; j++)\n          a[i][j][k] = a[i][j][k + 1];\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) \n    cout << max[i] << endl;\n  return 0;\n}\n"}
{"label": "18", "index": "34139", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100];\n  int i, j, k, c, d, l, sum[100] = {0}, min1, min2;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - l; i++) {\n        min1 = a[i][0];\n        for (j = 0; j < n - l; j++) {\n\n          if (a[i][j] < min1)\n            min1 = a[i][j];\n        }\n        for (j = 0; j < n - l; j++)\n          a[i][j] = a[i][j] - min1;\n      }\n\n      for (j = 0; j < n - l; j++) {\n        min2 = a[0][j];\n        for (i = 0; i < n - l; i++) {\n\n          if (a[i][j] < min2)\n            min2 = a[i][j];\n        }\n        for (i = 0; i < n - l; i++)\n          a[i][j] = a[i][j] - min2;\n      }\n\n      sum[k] = sum[k] + a[1][1];\n      if (l == n - 2)\n        break;\n      else {\n        for (c = 0; c < n - l; c++) {\n          for (d = 2; d < n - l; d++)\n            a[c][d - 1] = a[c][d];\n        }\n        for (c = 2; c < n - l; c++) {\n          for (d = 0; d < (n - 1 - l); d++)\n            a[c - 1][d] = a[c][d];\n        }\n      }\n    }\n\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        a[i][j] = 0;\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, a[120][120], m, s, d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    m = n;\n    for (j = 0; j < m; j++) {\n      for (k = 0; k < m; k++) {\n        cin >> a[j][k];\n      }\n    }\n    s = 0;\n    while (m >= 2) {\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[j][l] < a[j][d])\n            d = l;\n        }\n        d = a[j][d];\n        for (k = 0; k < m; k++) {\n          a[j][k] = a[j][k] - d;\n        }\n      }\n      for (j = 0; j < m; j++) {\n        d = 0;\n        for (l = 1; l < m; l++) {\n          if (a[l][j] < a[d][j]) {\n            d = l;\n          }\n        }\n        d = a[d][j];\n        for (k = 0; k < m; k++) {\n          a[k][j] = a[k][j] - d;\n        }\n      }\n      s = s + a[1][1];\n      for (j = 0; j < m; j++) {\n        for (k = 2; k < m; k++) {\n          a[j][k - 1] = a[j][k];\n        }\n      }\n      for (j = 0; j < m - 1; j++) {\n        for (k = 2; k < m; k++) {\n          a[k - 1][j] = a[k][j];\n        }\n      }\n      m--;\n    }\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34141", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint cal(int matrix[][120], int n) {\n  if (n == 1)\n    return (0);\n  int i, j, min, s;\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[i][j] < min)\n        min = matrix[i][j];\n    }\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i][j] - min;\n  }\n  for (i = 0; i < n; i++) {\n    min = 32767;\n    for (j = 0; j < n; j++) {\n      if (matrix[j][i] < min)\n        min = matrix[j][i];\n    }\n    for (j = 0; j < n; j++)\n      matrix[j][i] = matrix[j][i] - min;\n  }\n  s = matrix[1][1];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      matrix[i][j] = matrix[i + 1][j];\n  for (i = 0; i < n - 1; i++)\n    for (j = 1; j < n - 1; j++)\n      matrix[i][j] = matrix[i][j + 1];\n\n  return (s + cal(matrix, n - 1));\n}\n\nint main() {\n  int n, i, j, k;\n  int a[120][120];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    printf(\"%d\\n\", cal(a, n));\n  }\n  return (0);\n}\n"}
{"label": "18", "index": "34142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n;\nint board[100][100];\nvoid Subduction(int);\nint sum;\nint main() {\n  int i;\n  cin >> n;\n  for (i = 0; i <= n - 1; i++) {\n    sum = 0;\n    int j, k;\n    for (j = 0; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        cin >> board[j][k];\n      }\n    }\n\n    Subduction(n);\n  }\n\n  return 0;\n}\n\nvoid Subduction(int m) {\n  if (m == 1)\n    cout << sum << endl;\n  else {\n    int rowmin[100];\n    int colmin[100];\n    int p, q;\n    for (p = 0; p <= m - 1; p++) {\n      rowmin[p] = board[p][0];\n      for (q = 0; q <= m - 1; q++) {\n        if (board[p][q] < rowmin[p]) {\n          rowmin[p] = board[p][q];\n        }\n      }\n    }\n\n    for (p = 0; p <= m - 1; p++) {\n      for (q = 0; q <= m - 1; q++) {\n        board[p][q] -= rowmin[p];\n      }\n    }\n    for (q = 0; q <= m - 1; q++) {\n      colmin[q] = board[0][q];\n      for (p = 0; p <= m - 1; p++) {\n        if (board[p][q] < colmin[q]) {\n          colmin[q] = board[p][q];\n        }\n      }\n    }\n\n    for (q = 0; q <= m - 1; q++) {\n      for (p = 0; p <= m - 1; p++) {\n        board[p][q] -= colmin[q];\n      }\n    }\n    sum += board[1][1];\n    for (q = 1; q <= m - 2; q++) {\n      board[0][q] = board[0][q + 1];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      board[p][0] = board[p + 1][0];\n    }\n    for (p = 1; p <= m - 2; p++) {\n      for (q = 1; q <= m - 2; q++) {\n        board[p][q] = board[p + 1][q + 1];\n      }\n    }\n    Subduction(m - 1);\n  }\n}\n"}
{"label": "18", "index": "34143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, m, s, a[101][101];\nvoid guiling(int i, int j, int x, int y) {\n  if (i == m || j == m)\n    return;\n  if (a[i][j] < s)\n    s = a[i][j];\n  guiling(i + x, j + y, x, y);\n  a[i][j] -= s;\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[i][j] = a[i][j + 1];\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m; j++)\n      a[j][i] = a[j + 1][i];\n}\nint main() {\n  int i, j, l;\n  cin >> n;\n  l = n;\n  while (l > 0) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    }\n    int sum = 0;\n    for (m = n; m > 0; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        if (i < m) {\n          s = 1000;\n          guiling(i, 0, 0, 1);\n        } else {\n          s = 1000;\n          guiling(0, i - m, 1, 0);\n        }\n      }\n      sum += a[1][1];\n      xiaojian();\n    }\n    cout << sum << \"\\n\";\n    l--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34144", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100], sum;\nvoid f(int m) {\n  int i, j, min;\n  if (m > 1) {\n    for (i = 0; i < m; i++) {\n      min = a[i][0];\n      for (j = 0; j < m; j++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n    }\n    for (j = 0; j < m; j++) {\n      min = a[0][j];\n      for (i = 0; i < m; i++)\n        if (a[i][j] < min)\n          min = a[i][j];\n      if (min != 0)\n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n    }\n    sum = sum + a[1][1];\n    for (j = 2; j < m; j++)\n      a[0][j - 1] = a[0][j];\n    for (i = 2; i < m; i++)\n      a[i - 1][0] = a[i][0];\n    for (i = 2; i < m; i++)\n      for (j = 2; j < m; j++)\n        a[i - 1][j - 1] = a[i][j];\n    f(m - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  scanf(\"%d \", &n);\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    f(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid hang(int[], int);\nvoid xiaojie(int[], int);\nint main() {\n  int n;\n  cin >> n;\n  int i, j, k, m;\n  int min, sum;\n  int a[101][101];\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (m = 0; m < n - 1; m++) {\n      for (i = 0; i < n - m; i++)\n        hang(a[i], n - m);\n      for (j = 0; j < n - m; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < n - m; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum += a[1][1];\n      for (i = 0; i < n - m; i++)\n        xiaojie(a[i], n - m);\n      for (j = 0; j < n - 1 - m; j++) {\n        for (i = 1; i < n - 1 - m; i++)\n          a[i][j] = a[i + 1][j];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid hang(int a[], int leg) {\n  int min = a[0];\n  int i;\n  for (i = 0; i < leg; i++) {\n    if (min > a[i])\n      min = a[i];\n  }\n  for (i = 0; i < leg; i++)\n    a[i] = a[i] - min;\n}\nvoid xiaojie(int a[], int leg) {\n  int i;\n  for (i = 1; i < leg; i++)\n    a[i] = a[i + 1];\n}\n"}
{"label": "18", "index": "34146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nenum { size = 100 };\n\nvoid gotozero(int num, int n, int a[size][size][size], int minrow[size][size],\n              int mincol[size][size]) {\n  int i, j, k;\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      minrow[i][j] = a[i][j][0];\n      for (k = 0; k < n; k++)\n        if (minrow[i][j] > a[i][j][k])\n          minrow[i][j] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][j][k] -= minrow[i][j];\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      mincol[i][j] = a[i][0][j];\n      for (k = 0; k < n; k++)\n        if (mincol[i][j] > a[i][k][j])\n          mincol[i][j] = a[i][k][j];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][k][j] -= mincol[i][j];\n  }\n}\n\nvoid cut(int num, int n, int a[size][size][size], int minrow[size][size],\n         int mincol[size][size]) {\n  int i, j, k;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 2; k < n; k++)\n        a[i][j][k - 1] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 2; j < n; j++)\n        a[i][j - 1][k] = a[i][j][k];\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, num;\n  int a[size][size][size] = {0}, minrow[size][size] = {0}, sum[size] = {0},\n      mincol[size][size] = {0};\n\n  scanf(\"%d\", &n);\n  num = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[i][j][k]);\n\n  while (n > 1) {\n    gotozero(num, n, a, minrow, mincol);\n    for (i = 0; i < num; i++)\n      sum[i] += a[i][1][1];\n    cut(num, n, a, minrow, mincol);\n    n--;\n  }\n\n  for (i = 0; i < num; i++)\n    cout << sum[i] << \"\\n\";\n}\n"}
{"label": "18", "index": "34147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n;\n  int sum[100] = {0};\n  int a[100][100][100] = {0};\n  int i, j, k, min, t, l;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[k][i][j]);\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[k][i][0];\n        for (j = 0; j < n - t; j++)\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        for (j = 0; j < n - t; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n      for (j = 0; j < n - t; j++) {\n        min = a[k][0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n      sum[k] = sum[k] + a[k][1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - 1 - t; j++)\n          a[k][i][j] = a[k][i][j + 1];\n\n      for (j = 0; j < n - 1 - t; j++)\n        for (i = 1; i < n - 1; i++)\n          a[k][i][j] = a[k][i + 1][j];\n      t = t + 1;\n    }\n    printf(\"%d\\n\", sum[k]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34148", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, a[100][100], min, sum;\n  scanf(\"%d\", &n);\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    k = n;\n    while (k > 1) {\n      for (i = 0; i < k; i++) {\n        min = 100000;\n        for (j = 0; j < k; j++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 100000;\n        for (i = 0; i < k; i++)\n          if (a[i][j] < min)\n            min = a[i][j];\n        if (min == 0)\n          continue;\n        else\n          for (i = 0; i < k; i++)\n            a[i][j] -= min;\n      }\n      sum += a[1][1];\n      for (i = 1; i < k - 1; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < k - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < k - 1; i++)\n        for (j = 1; j < k - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      k--;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34149", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint sum, n, a[105][105], flag2[105], min1[105], min2[105];\nvoid f(int x);\nint main() {\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    f(n);\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\nvoid f(int x) {\n  if (x == n) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n  }\n  if (x == 1) {\n  } else {\n    for (int i = 0; i < x; i++) {\n      flag2[i] = 0;\n      min1[i] = 0;\n      min2[i] = 0;\n    }\n    for (int i = 0; i < x; i++) {\n      min1[i] = a[i][0];\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] < min1[i])\n          min1[i] = a[i][j];\n      }\n    }\n    for (int i = 0; i < x; i++) {\n      for (int j = 0; j < x; j++) {\n        if (a[i][j] - min1[i] >= 0) {\n          a[i][j] = a[i][j] - min1[i];\n          if (a[i][j] == 0) {\n            flag2[j] = 1;\n          }\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        min2[j] = a[0][j];\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] < min2[j])\n            min2[j] = a[i][j];\n        }\n      }\n    }\n    for (int j = 0; j < x; j++) {\n      if (flag2[j] == 0) {\n        for (int i = 0; i < x; i++) {\n          if (a[i][j] - min2[j] >= 0) {\n            a[i][j] = a[i][j] - min2[j];\n          }\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (int i = 0; i < x; i++) {\n      for (int j = 1; j < x - 1; j++) {\n        a[i][j] = a[i][j + 1];\n      }\n    }\n    for (int j = 0; j < x - 1; j++) {\n      for (int i = 1; i < x - 1; i++) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n    f(x - 1);\n  }\n}\n"}
{"label": "18", "index": "34150", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint matrix[100][100], sum = 0;\n\nvoid SUM(int n) {\n  if (n == 1)\n    return;\n  int i, j;\n\n  \n  \n  int min;\n  for (i = 0; i < n; i++) {\n    min = matrix[i][0];\n    for (j = 0; j < n; j++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (j = 0; j < n; j++) {\n      matrix[i][j] -= min;\n    }\n  }\n  \n  for (j = 0; j < n; j++) {\n    min = matrix[0][j];\n    for (i = 0; i < n; i++) {\n      if (min > matrix[i][j]) {\n        min = matrix[i][j];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      matrix[i][j] -= min;\n    }\n  }\n\n  sum += matrix[1][1];\n\n  \n  for (j = 1; j < n - 1; j++)\n    matrix[0][j] = matrix[0][j + 1];\n\n  for (i = 1; i < n - 1; i++)\n    matrix[i][0] = matrix[i + 1][0];\n\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++) {\n      matrix[i][j] = matrix[i + 1][j + 1];\n    }\n  }\n\n  SUM(n - 1);\n}\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> matrix[j][k];\n\n    SUM(n);\n    cout << sum << endl;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, range;\n  cin >> range;\n  n = range;\n  int a[102][102], (*p)[102] = a;\n  int i, j, k, q, sum = 0;\n  for (i = 0; i < range; i++) {\n    sum = 0;\n    n = range;\n    int minrow = 999999, mincol = 999999;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> *(*(p + j) + k);\n    for (; n > 1;) {\n\n      for (j = 0; j < n; j++) {\n        for (k = 0; k < n; k++)\n          if (*(*(p + j) + k) < minrow)\n            minrow = *(*(p + j) + k);\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j) + k) - minrow;\n        minrow = 999999;\n      }\n\n      for (k = 0; k < n; k++) {\n        for (j = 0; j < n; j++)\n          if (*(*(p + j) + k) < mincol)\n            mincol = *(*(p + j) + k);\n        for (j = 0; j < n; j++)\n          *(*(p + j) + k) = *(*(p + j) + k) - mincol;\n        mincol = 999999;\n      }\n\n      sum += *(*(p + 1) + 1);\n\n      if (n == 2)\n        break;\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + j) + k) = *(*(p + j + 1) + k);\n      }\n      for (j = 1; j <= n - 2; j++) {\n        for (k = 0; k < n; k++)\n          *(*(p + k) + j) = *(*(p + k) + j + 1);\n      }\n      n--;\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, a[110][110] = {0}, j = 0, i = 0, k = 0, l = 0, min = 100000,\n      sum = 0;\n  int(*p)[110] = a;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (l = 0; l < n - 1; l++) {\n      for (i = 1; i <= n - l; i++) {\n        min = 100000;\n        for (j = 1; j <= n - l; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 1; j <= n - l; j++) {\n          *(*(p + i) + j) -= min;\n        }\n      }\n      for (j = 1; j <= n - l; j++) {\n        min = 100000;\n        for (i = 1; i <= n - l; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 1; i <= n - l; i++)\n          *(*(p + i) + j) -= min;\n      }\n      sum += *(*(p + 2) + 2);\n      for (i = 2; i < n - l; i++)\n        *(*(p + i) + 1) = *(*(p + i + 1) + 1);\n      for (j = 2; j < n - l; j++)\n        *(*(p + 1) + j) = *(*(p + 1) + j + 1);\n      for (i = 2; i < n - l; i++)\n        for (j = 2; j < n - l; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j + 1);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100], n;\n\nint juzhen() {\n  int j1, j2, j3, j4, j5;\n  int min, sum = 0;\n  for (j1 = n; j1 > 1; j1--) {\n    for (j2 = 0; j2 < j1; j2++) {\n      min = a[j2][0];\n      for (j3 = 0; j3 < j1; j3++) {\n        if (a[j2][j3] < min)\n          min = a[j2][j3];\n      }\n      for (j3 = 0; j3 < j1; j3++) {\n        a[j2][j3] = a[j2][j3] - min;\n      }\n    }\n    for (j4 = 0; j4 < j1; j4++) {\n      min = a[0][j4];\n      for (j5 = 0; j5 < j1; j5++) {\n        if (a[j5][j4] < min)\n          min = a[j5][j4];\n      }\n      for (j5 = 0; j5 < j1; j5++) {\n        a[j5][j4] = a[j5][j4] - min;\n      }\n    }\n    sum = sum + a[1][1];\n    for (j2 = 0; j2 < j1; j2++) {\n      for (j3 = 0; j3 < j1; j3++) {\n        if (j2 == 0 && j3 > 1)\n          a[j2][j3 - 1] = a[j2][j3];\n        if (j3 == 0 && j2 > 1) {\n          a[j2 - 1][j3] = a[j2][j3];\n        }\n        if (j2 > 1 && j3 > 1)\n          a[j2 - 1][j3 - 1] = a[j2][j3];\n      }\n    }\n  }\n  return sum;\n}\n\nint main() {\n  int m1, m2, m3, sum;\n  cin >> n;\n  for (m1 = 1; m1 <= n; m1++) {\n    for (m2 = 0; m2 < n; m2++) {\n      for (m3 = 0; m3 < n; m3++)\n        cin >> a[m2][m3];\n    }\n    sum = juzhen();\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "34154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nvoid fact(int n);\nint sum(int n);\nint a[100][100];\nint i = 0, j = 0;\nint main() {\n  int n;\n  cin >> n;\n  int k = 0;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    printf(\"%d\\n\", sum(n));\n  }\n  return 0;\n}\nvoid fact(int n) {\n\n  for (i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (j = 0; j < n; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    for (j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n\n  for (i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (j = 0; j < n; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    for (j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n}\n\nint sum(int n) {\n  fact(n);\n  if (n == 2)\n    return a[1][1];\n  int k = a[1][1];\n\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n  return k + sum(n - 1);\n}\n"}
{"label": "18", "index": "34155", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nint main() {\n  int m, n, i, j, t, k = 0, p, ans;\n  scanf(\"%d \", &m);\n  while (k < m) {\n    n = m;\n    ans = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    p = 1;\n    while (n > p) {\n      for (i = 0; i < n; i++) {\n        if (i && i < p)\n          continue;\n        t = *(*(a + i) + 0);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + i) + j) ? *(*(a + i) + j) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= t;\n      }\n      for (i = 0; i < n; i++) {\n        if (j && j < p)\n          continue;\n        t = *(*(a + 0) + i);\n        for (j = p; j < n; j++)\n          t = t > *(*(a + j) + i) ? *(*(a + j) + i) : t;\n        for (j = 0; j < n; j++)\n          *(*(a + j) + i) -= t;\n      }\n      ans += *(*(a + p) + p);\n      p++;\n    }\n    printf(\"%d\\n\", ans);\n    k++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cut(int num[100][100], int n) {\n  int m = 0, i = 0, k = 0, sum = 0, j = 0;\n  int l[100], s[100];\n  for (i = 1; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      l[j] = 0;\n      s[j] = 0;\n    }\n    for (j = 0; j < n; j++) {\n      if (num[j][0] >= 0) {\n        l[j] = num[j][0];\n        for (k = 0; k < n; k++) {\n          if (num[j][k] >= 0 && num[j][k] < l[j])\n            l[j] = num[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          num[j][k] = num[j][k] - l[j];\n        }\n      }\n    }\n    cout << endl;\n    for (j = 0; j < n; j++) {\n      if (num[0][j] >= 0) {\n        s[j] = num[0][j];\n        for (k = 0; k < n; k++) {\n          if (num[k][j] >= 0 && num[k][j] < s[j])\n            s[j] = num[k][j];\n        }\n        for (k = 0; k < n; k++) {\n          num[k][j] = num[k][j] - s[j];\n        }\n      }\n    }\n    sum = sum + num[i][i];\n    for (j = 0; j < n; j++) {\n      num[i][j] = -10;\n      num[j][i] = -10;\n    }\n  }\n  return sum;\n}\nint main() {\n  int n = 0, i = 0, j = 0, k = 0, sum = 0;\n  int num[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < 100; j++)\n      for (k = 0; k < 100; k++)\n        num[j][k] = -10;\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &num[j][k]);\n    sum = cut(num, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int n, i, j, k, total;\n  cin >> n;\n  int a[n][n];\n  int numbers = n;\n  for (k = 0; k < numbers; k++) {\n    total = 0;\n    for (i = 0; i < numbers; i++)\n      for (j = 0; j < numbers; j++)\n        cin >> a[i][j];\n    for (n = numbers; n > 1; n--) {\n      for (i = 0; i < n; i++) {\n        int temp = a[i][0];\n        for (j = 1; j < n; j++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (j = 0; j < n; j++)\n          a[i][j] -= temp;\n      }\n      for (j = 0; j < n; j++) {\n        int temp = a[0][j];\n        for (i = 1; i < n; i++)\n          if (a[i][j] < temp)\n            temp = a[i][j];\n        for (i = 0; i < n; i++)\n          a[i][j] -= temp;\n      }\n      total += a[1][1];\n      for (i = 0; i < n; i++) \n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - 1; j++) \n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << total << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100][100], n, i, j, k;\n  int c, l, o, p, q, r, s, t;\n  int min;\n  int w, x, y, z;\n  int h, g, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n    }\n  }\n  for (c = 1; c <= n - 1; c++) {\n    for (l = 0; l < n; l++) {\n\n      for (o = 0; o <= n - c; o++) {\n        min = a[l][o][1];\n        for (p = 0; p <= n - c; p++) {\n          if (a[l][o][p] < min)\n            min = a[l][o][p];\n        }\n        for (q = 0; q <= n - c; q++) {\n          a[l][o][q] -= min;\n        }\n      }\n      for (r = 0; r <= n - c; r++) {\n        min = a[l][1][r];\n        for (s = 0; s <= n - c; s++) {\n          if (a[l][s][r] < min)\n            min = a[l][s][r];\n        }\n        for (t = 0; t <= n - c; t++)\n          a[l][t][r] -= min;\n      }\n      b[l][c] = a[l][1][1];\n      for (w = 1; w <= n - c - 1; w++) {\n        for (x = 0; x <= n - c; x++)\n          a[l][w][x] = a[l][w + 1][x];\n      }\n      for (y = 1; y <= n - c - 1; y++) {\n        for (z = 0; z <= n - c; z++) {\n          a[l][z][y] = a[l][z][y + 1];\n        }\n      }\n    }\n  }\n  for (h = 0; h < n; h++) {\n    m = 0;\n    for (g = 1; g <= n - 1; g++) {\n      m += b[h][g];\n    }\n    cout << m << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34159", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  int a[100][100];\n  int k = 1, n = 0;\n  cin >> n;\n  for (k = 1; k <= n; k++) \n  {\n    int i = 0, j = 0, m;\n    int result = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j]; \n    int min = 0;\n    for (m = n; m > 1; m--) \n    {\n      for (i = 0; i < m; i++) {\n        min = a[i][0];\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        } \n        for (j = 0; j < m; j++)\n          a[i][j] = a[i][j] - min;\n      } \n      for (j = 0; j < m; j++) {\n        min = a[0][j];\n        for (i = 0; i < m; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        } \n        for (i = 0; i < m; i++)\n          a[i][j] = a[i][j] - min;\n      }                          \n      result = result + a[1][1]; \n      for (j = 1; j < m - 1; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m - 1; i++) {\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j < m - 1; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n\n    } \n\n    cout << result << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34160", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint jz(int a[100][100], int k) {\n  int sum = 0, min, i, j, b, judge = 0;\n  for (b = k; b > 1; b--) {\n    for (i = 0; i < b; i++) {\n      min = a[i][0];\n      for (j = 1; j < b; j++) {\n        if (a[i][j] < min) {\n          min = a[i][j];\n        }\n      }\n      for (j = 0; j < b; j++) {\n        a[i][j] = a[i][j] - min;\n      }\n    }\n    for (i = 0; i < b; i++) {\n      judge = 0;\n      for (j = 1; j < b; j++) {\n        if (a[j][i] == 0) {\n          judge = 1;\n          break;\n        }\n      }\n      if (judge == 0) {\n        min = a[0][i];\n        for (j = 1; j < b; j++) {\n          if (a[j][i] < min) {\n            min = a[j][i];\n          }\n        }\n        for (j = 0; j < b; j++) {\n          a[j][i] = a[j][i] - min;\n        }\n      }\n    }\n    sum = sum + a[1][1];\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[i][j - 1] = a[i][j];\n      }\n    }\n    for (i = 0; i < b; i++) {\n      for (j = 2; j < b; j++) {\n        a[j - 1][i] = a[j][i];\n      }\n    }\n  }\n  return sum;\n}\nint main() {\n  int n, i, j, k, num[100][100], ans[100];\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> num[j][k];\n      }\n    }\n    ans[i] = jz(num, n);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", ans[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nvoid down1(int a[100][100], int m) {\n  int i, p, j;\n  for (i = m; i < n; i = i + 1) {\n    p = a[i][m];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[i][j])\n        p = a[i][j];\n    for (j = m; j < n; j = j + 1)\n      a[i][j] = a[i][j] - p;\n  }\n}\nvoid down2(int a[100][100], int m) {\n  int i, j, p;\n  for (i = m; i < n; i = i + 1) {\n    p = a[m][i];\n    for (j = m + 1; j < n; j = j + 1)\n      if (p > a[j][i])\n        p = a[j][i];\n    for (j = m; j < n; j = j + 1)\n      a[j][i] = a[j][i] - p;\n  }\n}\nint main() {\n  int i, j, t, k;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  k = 0;\n  while (k < n) {\n    k = k + 1;\n    t = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        scanf(\"%d\", &a[i][j]);\n    for (i = 1; i <= n - 1; i = i + 1) {\n      down1(a, i - 1);\n      down2(a, i - 1);\n      t = t + a[i][i];\n      for (j = i - 1; j < n; j = j + 1)\n        a[i][j] = a[i - 1][j];\n      for (j = i; j < n; j = j + 1)\n        a[j][i] = a[j][i - 1];\n    }\n    cout << t;\n    if (k < n) {\n      cout << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34162", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101];\n  int n, i, j, t, min, count = 0, m;\n  cin >> n;\n  for (m = 0; m < n; m++) {\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> a[i][j];\n    count = 0;\n    for (t = n; t >= 2; t--) {\n      for (i = 1; i <= t; i++) {\n        min = a[i][1];\n        for (j = 1; j <= t; j++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (j = 1; j <= t; j++)\n          a[i][j] -= min;\n      }\n      for (j = 1; j <= t; j++) {\n        min = a[1][j];\n        for (i = 1; i <= t; i++)\n          min = (a[i][j] < min ? a[i][j] : min);\n        for (i = 1; i <= t; i++)\n          a[i][j] -= min;\n      }\n      count += a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 2; j <= t - 1; j++)\n        for (i = 1; i <= t - 1; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << count << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int p[100][100];\n  int n, min, sum = 0;\n  cin >> n;\n  for (int a = 0; a < n; a++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    for (int k = n; k > 1; k--) {\n      for (int i = 0; i < k; i++) {\n        min = **(p + i);\n        for (int j = 1; j < k; j++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      for (int j = 0; j < k; j++) {\n        min = *(*p + j);\n        for (int i = 1; i < k; i++) {\n          if (*(*(p + i) + j) < min) {\n            min = *(*(p + i) + j);\n          }\n        }\n        for (int i = 0; i < k; i++)\n          *(*(p + i) + j) = *(*(p + i) + j) - min;\n      }\n      sum = sum + *(*(p + 1) + 1);\n      for (int i = 1; i < k; i++)\n        for (int j = 0; j < k; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n      for (int j = 1; j < k; j++)\n        for (int i = 0; i < k; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34164", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n;\n  int matrix[100][100];\n\n  scanf(\"%d \", &n);\n  for (int i = 0; i < n; i++) {\n    int sum = 0;\n    for (int j = 0; j < n; j++)\n      for (int k = 0; k < n; k++)\n        cin >> matrix[j][k];\n    for (int m = n; m > 1; m--) {\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[j][0];\n        for (int k = 1; k < m; k++) {\n          if (matrix[j][k] < min)\n            min = matrix[j][k];\n        }\n        for (int k = 0; k < m; k++)\n          matrix[j][k] -= min;\n      }\n\n      for (int j = 0; j < m; j++) {\n        int min = matrix[0][j];\n        for (int k = 1; k < m; k++) {\n          if (matrix[k][j] < min)\n            min = matrix[k][j];\n        }\n        for (int k = 0; k < m; k++)\n          matrix[k][j] -= min;\n      }\n\n      sum += matrix[1][1];\n      for (int i = 1; i < m; i++) {\n        for (int j = 1; j < m; j++)\n          matrix[i][j] = matrix[i + 1][j + 1];\n        matrix[0][i] = matrix[0][i + 1];\n        matrix[i][0] = matrix[i + 1][0];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid zero(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 1; i < n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] -= min;\n  }\n}\nvoid trans(int a[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, k, a[100][100], i, j, sum;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      zero(a, k);\n      sum += a[1][1];\n      trans(a, k);\n      k--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34166", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint GL(int, int[][101]);      \nvoid Delete(int, int[][101]); \nint min(int, int);            \n\nint main() {\n  int Sum[101], n, a[101][101], i, j, k; \n\n  cin >> n; \n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) \n    {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    cout << GL(n, a) << endl; \n  }\n\n  \n  \n  return 0;\n}\n\nint GL(int n, int a[][101]) {\n  int Sum = 0, i, j, MIN;\n\n  for (i = 0; i < n; i++) \n  {\n    MIN = 999999;\n    for (j = 0; j < n; j++)\n      MIN = min(MIN, a[i][j]);\n    for (j = 0; j < n; j++)\n      a[i][j] -= MIN;\n  }\n\n  for (j = 0; j < n; j++) \n  {\n    MIN = 999999;\n    for (i = 0; i < n; i++)\n      MIN = min(MIN, a[i][j]);\n    for (i = 0; i < n; i++)\n      a[i][j] -= MIN;\n  }\n\n  Sum += a[1][1]; \n\n  if (n == 1) \n  {\n    return 0;\n\n  } else {\n    Delete(n, a);\n    Sum += GL(n - 1, a);\n    return Sum;\n  } \n}\n\nint min(int a, int b) \n{\n  if (a >= b)\n    return b;\n  else\n    return a;\n}\nvoid Delete(int n, int a[][101]) \n{\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n    a[i][n - 1] = 0;\n  }\n\n  for (j = 0; j < n - 1; j++) {\n    for (i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n    a[n - 1][j] = 0;\n  }\n}\n"}
{"label": "18", "index": "34167", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\nint smaller(int, int);\n\nint main() {\n  int n, a[101][101], i, j, k, min, count;\n  cin >> n;\n  count = n; \n  for (k = 1; k <= count; k++) {\n    int sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++) {\n          if (min >= a[i][j])\n            min = a[i][j]; \n        }\n        for (j = 0; j < n; j++)\n          a[i][j] -= min; \n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++) {\n          if (min >= a[i][j])\n            min = a[i][j]; \n        }\n        for (i = 0; i < n; i++)\n          a[i][j] -= min; \n      }\n      sum += a[1][1]; \n      for (i = 0; i < n; i++) {\n        for (j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      for (j = 0; j < n - 1; j++) {\n        for (i = 1; i < n - 1; i++)\n          a[i][j] = a[i + 1][j];\n      } \n      n--;\n    }\n    cout << sum << endl; \n    n = count;           \n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint x[102][102];\nint (*p)[102];\nint n;\nvoid f(int k) {\n  int min, i, j;\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + i) + j) < min)\n        min = *(*(p + i) + j);\n    for (j = 0; j < n - k; j++)\n      *(*(p + i) + j) -= min;\n  }\n  for (i = 0; i < n - k; i++) {\n    min = 10000;\n    for (j = 0; j < n - k; j++)\n      if (*(*(p + j) + i) < min)\n        min = *(*(p + j) + i);\n    for (j = 0; j < n - k; j++)\n      *(*(p + j) + i) -= min;\n  }\n}\nint main() {\n  int i, j, k, sum;\n  p = x;\n  cin >> n;\n  for (int t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(p + i) + j);\n    for (k = 0; k < n - 1; k++) {\n      f(k);\n      sum += *(*(p + 1) + 1);\n      for (i = 2; i < n; i++) {\n        *(*(p + 0) + i - 1) = *(*(p + 0) + i);\n        *(*(p + i - 1) + 0) = *(*(p + i) + 0);\n      }\n      for (i = 2; i < n; i++)\n        for (j = 2; j < n; j++)\n          *(*(p + i - 1) + j - 1) = *(*(p + i) + j);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34169", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint operation(int a[100][100], int m);\nint main() {\n  int n, i, j, k, sum;\n  int a[100][100];\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    sum = 0;\n    memset(a, -1, sizeof(a));\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    for (j = 1; j <= n - 1; j++)\n      sum = sum + operation(a, n - j + 1);\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\nint operation(int a[100][100], int m) {\n  int i, j, temp, k, t;\n  for (i = 0; i < m; i++) {\n    int min = a[i][0];\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j < m; j++) {\n    int min = a[0][j];\n    for (i = 0; i < m; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i < m; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  temp = a[1][1];\n  int b[100][100];\n  memset(b, -1, sizeof(b));\n  for (i = 0, t = 0; i < m; i++, t++) {\n    if (i == 1) {\n      t--;\n      continue;\n    }\n    for (j = 0, k = 0; j < m; j++, k++) {\n      if (j == 1) {\n        k--;\n        continue;\n      } else\n        b[t][k] = a[i][j];\n    }\n  }\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 100; j++)\n      a[i][j] = b[i][j];\n  return temp;\n}\n"}
{"label": "18", "index": "34170", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid zero(int a[][100], int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 1; i < n; i++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n}\nvoid trans(int a[][100], int n) {\n  int i, j;\n  for (i = 0; i < n; i++) {\n    for (j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (j = 0; j < n; j++) {\n    for (i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n}\nint main() {\n  int n, k, a[100][100], i, j, sum;\n  scanf(\"%d \", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (j = 1; j <= n - 1; j++) {\n      zero(a, k);\n      sum += a[1][1];\n      trans(a, k);\n      k--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34171", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j = 0, sum = 0, a[100][100], k = 0;\n  int t = 0;\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    }\n    for (int q = 0; q < n - 1; q++) {\n      for (i = 0; i < n - q; i++) {\n        t = a[i][0];\n        for (j = 0; j < n - q; j++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i][j] - t;\n      }\n      for (j = 0; j < n - q; j++) {\n        t = a[0][j];\n        for (i = 0; i < n - q; i++) {\n          if (a[i][j] < t)\n            t = a[i][j];\n        }\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j] - t;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - q - 1; i++)\n        for (j = 0; j < n - q; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - q - 1; j++)\n        for (i = 0; i < n - q; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100], n, sum;\n  int i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int f(int a[100][100], int n);\n    sum = f(a, n);\n    cout << sum << endl;\n  }\n  return 0;\n}\nint f(int a[100][100], int n) {\n  if (n == 1) {\n    return 0;\n  }\n  int i, j, k, min, sum = 0;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (j = 0; j < n; j++) {\n    min = a[0][j];\n    for (i = 0; i < n; i++) {\n      if (a[i][j] <= min)\n        min = a[i][j];\n    }\n    for (i = 0; i < n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n  k = a[1][1];\n  for (i = 2; i < n; i++) {\n    for (j = 0; j < n; j++)\n      a[i - 1][j] = a[i][j];\n  }\n  for (j = 2; j < n; j++) {\n    for (i = 0; i < (n - 1); i++)\n      a[i][j - 1] = a[i][j];\n  }\n  n = n - 1;\n  sum = k + f(a, n);\n  return (sum);\n}\n"}
{"label": "18", "index": "34173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint min(int a, int b) { return a < b ? a : b; }\n\nint f(int n, int number[100][100]) {\n  int num[100], m = 10000;\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      m = min(m, number[i][j]);\n    }\n    num[i] = m;\n    m = 10000;\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      number[i][j] = number[i][j] - num[i];\n    }\n  }\n\n  m = 10000;\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      m = min(m, number[i][j]);\n    }\n    num[j] = m;\n    m = 10000;\n  }\n  for (int j = 0; j < n; j++) {\n    for (int i = 0; i < n; i++) {\n      number[i][j] = number[i][j] - num[j];\n    }\n  }\n\n  if (n == 2)\n\n    return number[1][1];\n  else {\n    int sum;\n    sum = number[1][1];\n    for (int j = 0; j < n; j++) {\n      for (int i = 1; i < n - 1; i++) {\n        number[i][j] = number[i + 1][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      for (int j = 1; j < n - 1; j++) {\n        number[i][j] = number[i][j + 1];\n      }\n    }\n    return sum + f(n - 1, number);\n  }\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int n1 = n;\n  while (n--) {\n    int number[100][100];\n    for (int i = 0; i < n1; i++) {\n      for (int j = 0; j < n1; j++) {\n        cin >> number[i][j];\n      }\n    }\n    int sum = f(n1, number);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, m[105][105], s, min = 10000, sum = 0;\n  scanf(\"%d \", &n);\n  s = n;\n  for (int g = 1; g <= n; g++) {\n    sum = 0;\n    s = n;\n    for (int i = 1; i <= n; i++)\n      for (int j = 1; j <= n; j++)\n        scanf(\"%d \", &m[i][j]);\n    for (int k = 1; k <= n - 1; k++) {\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[i][j] < min)\n            min = m[i][j];\n        for (int j = 1; j <= s; j++)\n          m[i][j] = m[i][j] - min;\n      }\n      for (int i = 1; i <= s; i++) {\n        min = 10000;\n        for (int j = 1; j <= s; j++)\n          if (m[j][i] < min)\n            min = m[j][i];\n        for (int j = 1; j <= s; j++)\n          m[j][i] = m[j][i] - min;\n      }\n      sum = sum + m[2][2];\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s; j++)\n          m[i][j] = m[i + 1][j];\n      }\n      for (int i = 2; i <= s - 1; i++) {\n        for (int j = 1; j <= s - 1; j++)\n          m[j][i] = m[j][i + 1];\n      }\n      s = s - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34175", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint a[100][100];\nint n, sum = 0;\nint Sum(int);\nvoid RowSub(int);\nvoid ColSub(int);\n\nint Sum(int n) {\n  RowSub(n);\n  ColSub(n);\n  if (n == 2) {\n    return a[1][1];\n  }\n  int k = a[1][1];\n\n  for (int i = 1; i < n - 1; i++) {\n    a[i][0] = a[i + 1][0];\n    a[0][i] = a[0][i + 1];\n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return k + Sum(n - 1);\n}\n\nvoid RowSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  return;\n}\n\nvoid ColSub(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n\n    for (int j = 0; j < n; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return;\n}\nint main() {\n  int i, j, k;\n\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    printf(\"%d\\n\", Sum(n));\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34176", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[105][105];\nint f(int n) {\n  int i, j;\n  int r = 0, l = 0;\n  if (n == 1)\n    return 0;\n  else {\n    for (i = 0; i < n; i++) {\n      r = a[i][0];\n      for (j = 1; j < n; j++) {\n        if (r > a[i][j])\n          r = a[i][j];\n      }\n      for (j = 0; j < n; j++) {\n        a[i][j] = a[i][j] - r;\n      }\n    }\n    for (j = 0; j < n; j++) {\n      l = a[0][j];\n      for (i = 1; i < n; i++) {\n        if (l > a[i][j])\n          l = a[i][j];\n      }\n      for (i = 0; i < n; i++) {\n        a[i][j] = a[i][j] - l;\n      }\n    }\n    int m;\n    m = a[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        a[i][j] = a[i][j + 1];\n    for (j = 0; j < n; j++)\n      for (i = 1; i < n - 1; i++)\n        a[i][j] = a[i + 1][j];\n    return m + f(n - 1);\n  }\n}\nint main() {\n  int n;\n  int i, j, k;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    int sum = 0;\n    sum = f(n);\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34177", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid step1(int a[100][100], int n) {\n  int hmin, lmin;\n  for (int i = 0; i < n; i++) {\n    hmin = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < hmin)\n        hmin = a[i][j];\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= hmin;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    lmin = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < lmin)\n        lmin = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= lmin;\n  }\n}\nvoid step2(int a[100][100], int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] = a[i + 1][j];\n  for (i = 1; i < n - 1; i++)\n    for (j = 0; j < n; j++)\n      a[j][i] = a[j][i + 1];\n}\nint main() {\n  int n;\n  cin >> n;\n  int nn = n;\n  while (nn--) {\n    int tn = n;\n    int a[100][100];\n    for (int i = 0; i < tn; i++)\n      for (int j = 0; j < tn; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    while (tn >= 2) {\n      step1(a, tn);\n      sum += a[1][1];\n      step2(a, tn);\n      tn--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n;\nint check() {\n  int a[n][n];\n  int c, i, j, mi, mj, r = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      scanf(\"%d\", &a[i][j]);\n  for (c = n; c > 1; c--) {\n    for (i = 0; i < c; i++) {\n      mi = a[i][0];\n      for (j = 0; j < c; j++)\n        if (mi > a[i][j])\n          mi = a[i][j];\n      for (j = 0; j < c; j++)\n        a[i][j] -= mi;\n    }\n    for (j = 0; j < c; j++) {\n      mj = a[0][j];\n      for (i = 0; i < c; i++)\n        if (mj > a[i][j])\n          mj = a[i][j];\n      for (i = 0; i < c; i++)\n        a[i][j] -= mj;\n    }\n    r += a[c - 2][c - 2];\n    a[c - 2][c - 2] = a[c - 1][c - 1];\n    for (i = 0; i < c - 2; i++)\n      a[i][c - 2] = a[i][c - 1];\n    for (j = 0; j < c - 2; j++)\n      a[c - 2][j] = a[c - 1][j];\n  }\n  return r;\n}\nint main() {\n  int z;\n  scanf(\"%d\", &n);\n  for (z = 0; z < n; z++)\n    cout << check() << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "34179", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  int n1 = n;\n  while (n1) {\n    int a[n][n], sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(a + i) + j);\n    for (i = n; i > 1; i--) {\n      for (j = 0; j < i; j++) {\n        int min = *(*(a + j));\n        for (k = 1; k < i; k++)\n          if (*(*(a + j) + k) < min)\n            min = *(*(a + j) + k);\n        for (k = 0; k < i; k++)\n          *(*(a + j) + k) = *(*(a + j) + k) - min;\n      }\n      for (j = 0; j < i; j++) {\n        int min = *(*a + j);\n        for (k = 1; k < i; k++)\n          if (*(*(a + k) + j) < min)\n            min = *(*(a + k) + j);\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j) = *(*(a + k) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + k) + j - 1) = *(*(a + k) + j);\n      for (j = 2; j < i; j++)\n        for (k = 0; k < i; k++)\n          *(*(a + j - 1) + k) = *(*(a + j) + k);\n    }\n    printf(\"%d\\n\", sum);\n    n1--;\n  }\n}\n"}
{"label": "18", "index": "34180", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\n\nint min(int a[], int n) {\n  int m = a[0];\n  for (int i = 0; i < n; i++)\n    if (a[i] < m)\n      m = a[i];\n  return m;\n}\n\nint juzhen(int a[100][100], int n) {\n  int hangmin[100], liemin[100];\n  for (int i = 0; i < n; i++) {\n    hangmin[i] = min(a[i], n);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[i][j] = a[i][j] - hangmin[i];\n  }\n  int templie[100];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      templie[j] = a[j][i];\n    }\n    liemin[i] = min(templie, n);\n  }\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++)\n      a[j][i] = a[j][i] - liemin[i];\n  }\n  sum = sum + a[1][1];\n  for (int i = 1; i < n; i++)\n    for (int j = 0; j < n; j++) {\n      a[i][j] = a[i + 1][j];\n    }\n  for (int j = 1; j < n; j++)\n    for (int i = 0; i < n; i++) {\n      a[i][j] = a[i][j + 1];\n    }\n  n = n - 1;\n  if (n == 1) {\n    printf(\"%d\\n\", sum);\n    sum = 0;\n  } else\n    juzhen(a, n);\n  return 0;\n}\n\nint main() {\n  int n;\n  cin >> n;\n  int a[100][100];\n  for (int k = 1; k <= n; k++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    juzhen(a, n);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guiling(int a[100][100], int n) {\n  int i, j, min;\n  for (i = 0; i <= n; i++) {\n    min = a[i][0];\n    for (j = 0; j <= n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j <= n; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (j = 0; j <= n; j++) {\n    min = a[0][j];\n    for (i = 0; i <= n; i++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (i = 0; i <= n; i++)\n      a[i][j] = a[i][j] - min;\n  }\n}\nvoid shanchu(int a[100][100], int n) {\n  int i, j;\n  for (i = 0; i <= n; i++)\n    for (j = 1; j < n; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j <= (n - 1); j++)\n    for (i = 1; i < n; i++)\n      a[i][j] = a[i + 1][j];\n}\nint main() {\n  int a[100][100][100], i, j, k, sum, n;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &a[i][j][k]);\n      }\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = n - 1; j >= 1; j--) {\n      guiling(a[i], j);\n      sum = sum + a[i][1][1];\n      shanchu(a[i], j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[105][105];\nint guiling(int n);\nvoid xiaojian(int n);\n\nint main() {\n  int n, i, j, k;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    memset(a, 0, sizeof(a));\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    cout << guiling(n) << endl;\n  }\n\n  return 0;\n}\nint guiling(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 1; j < n; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 1; j < n; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (int j = 0; j < n; j++)\n      a[j][i] -= min;\n  }\n  int k = a[1][1];\n  if (n == 2)\n    return k;\n  else {\n    xiaojian(n);\n    return k + guiling(n - 1);\n  }\n}\nvoid xiaojian(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "34183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[200][200], temp, sum[200];\n\nvoid zero(int i) {\n  int mi = 1000;\n  for (int j = i; j <= n; j++) {\n    for (int k = i; k <= n; k++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int k = i; k <= n; k++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n  mi = 1000;\n  for (int k = i; k <= n; k++) {\n    for (int j = i; j <= n; j++)\n      mi = min(*(*(a + j) + k), mi);\n    for (int j = i; j <= n; j++)\n      *(*(a + j) + k) = *(*(a + j) + k) - mi;\n    mi = 1000;\n  }\n}\n\nint main() {\n  cin >> n;\n  for (int l = 1; l <= n; l++) {\n    sum[l] = 0;\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++)\n        cin >> *(*(a + j) + k);\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + 1) + i);\n      *(*(a + 1) + i) = *(*(a + 2) + i);\n      *(*(a + 2) + i) = temp;\n    }\n    for (int i = 1; i <= n; i++) {\n      temp = *(*(a + i) + 1);\n      *(*(a + i) + 1) = *(*(a + i) + 2);\n      *(*(a + i) + 2) = temp;\n    }\n    for (int i = 1; i <= n - 1; i++) {\n      zero(i);\n      sum[l] += *(*(a + i) + i);\n      for (int k = i + 1; k <= n; k++) {\n        temp = *(*(a + i + 1) + k);\n        *(*(a + i + 1) + k) = *(*(a + i + 2) + k);\n        *(*(a + i + 2) + k) = temp;\n      }\n      for (int j = i + 1; j <= n; j++) {\n        temp = *(*(a + j) + i + 1);\n        *(*(a + j) + i + 1) = *(*(a + j) + i + 2);\n        *(*(a + j) + i + 2) = temp;\n      }\n    }\n    printf(\"%d\\n\", sum[l]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34184", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, n1, num[101][101], i, j, k, min = 99999, sum = 0;\n  int(*p)[101];\n  scanf(\"%d \", &n);\n  for (k = 0; k < n; k++) {\n    n1 = n;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> num[i][j];\n    p = num;\n    for (; n1 >= 2; n1--) {\n\n      for (i = 0; i < n1; i++) {\n        for (j = 0; j < n1; j++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) -= min;\n        min = 99999;\n      }\n      min = 99999;\n      for (j = 0; j < n1; j++) {\n        for (i = 0; i < n1; i++) {\n          if (*(*(p + i) + j) < min)\n            min = *(*(p + i) + j);\n        }\n        for (i = 0; i < n1; i++)\n          num[i][j] -= min;\n        min = 99999;\n      }\n      sum += *(*(p + 1) + 1);\n      min = 99999;\n      for (i = 1; i < n1 - 1; i++)\n        for (j = 0; j < n1; j++)\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n      for (j = 1; j < n1 - 1; j++)\n        for (i = 0; i < n1; i++)\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34185", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint array_1[100][100];\nint (*p)[100] = array_1;\nint sum;\nint n;\nint times;\n\nvoid zero() {\n  int xmin = 10000, ymin = 10000;\n  for (int i = 0; i <= n - 1 - times; i++) {\n    for (int j = 0; j <= n - 1 - times; j++)\n      if (*(*(p + i) + j) < xmin) {\n        xmin = *(*(p + i) + j);\n      }\n    for (int j = 0; j <= n - 1 - times; j++)\n      *(*(p + i) + j) -= xmin;\n    xmin = 10000;\n  }\n  for (int j = 0; j <= n - 1 - times; j++) {\n    for (int i = 0; i <= n - 1 - times; i++)\n      if (*(*(p + i) + j) < ymin) {\n        ymin = *(*(p + i) + j);\n      }\n    for (int i = 0; i <= n - 1 - times; i++)\n      *(*(p + i) + j) -= ymin;\n    ymin = 10000;\n  }\n\n  sum += (*(*(p + 1) + 1));\n}\nvoid decline() {\n  for (int i = 1; i <= n - 2; i++)\n    for (int j = 0; j <= n - 1; j++)\n      *(*(p + i) + j) = *(*(p + i + 1) + j);\n\n  for (int j = 1; j <= n - 2; j++)\n    for (int i = 0; i <= n - 2; i++)\n      *(*(p + i) + j) = *(*(p + i) + j + 1);\n}\n\nint main() {\n  cin >> n;\n  int time = 0;\n  while (true) {\n\n    if (time == n)\n      break;\n    times = 0;\n    sum = 0;\n\n    for (int i = 0; i <= n - 1; i++)\n      for (int j = 0; j <= n - 1; j++)\n        cin >> *(*(p + i) + j);\n\n    for (int i = 1; i <= n - 1; i++) {\n      zero();\n      decline();\n      times++;\n    }\n\n    cout << sum << endl;\n\n    time++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, a[100][100][100];\nint main() {\n  int min, sum[100] = {0};\n  cin >> n;\n  for (int k = 0; k < n; k++)\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[k][i][j];\n  for (int r = n; r > 1; r--) {\n    for (int k = 0; k < n; k++) {\n      for (int i = 0; i < r; i++) {\n        min = a[k][i][0];\n        for (int j = 1; j < r; j++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int j = 0; j < r; j++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n    }\n\n    for (int k = 0; k < n; k++)\n      for (int j = 0; j < r; j++) {\n        min = a[k][0][j];\n        for (int i = 1; i < r; i++) {\n          if (a[k][i][j] < min)\n            min = a[k][i][j];\n        }\n        for (int i = 0; i < r; i++)\n          a[k][i][j] = a[k][i][j] - min;\n      }\n\n    for (int k = 0; k < n; k++) {\n      sum[k] = sum[k] + a[k][1][1];\n      for (int i = 1; i < r - 1; i++)\n        a[k][i][0] = a[k][i + 1][0];\n      for (int j = 1; j < r - 1; j++)\n        a[k][0][j] = a[k][0][j + 1];\n      for (int i = 1; i < r - 1; i++)\n        for (int j = 1; j < r - 1; j++)\n          a[k][i][j] = a[k][i + 1][j + 1];\n    }\n  }\n\n  for (int k = 0; k < n; k++)\n    printf(\"%d\\n\", sum[k]);\n  return 0;\n}\n"}
{"label": "18", "index": "34187", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, m, i, j, k, l, t, sum;\n  int a, b, c;\n  int tt[100][100];\n  scanf(\"%d\", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d\", &tt[j][k]);\n      }\n    }\n    sum = 0;\n    m = n;\n    for (l = 1; l < m; m--) {\n      for (j = 0; j < m; j++) {\n        a = 1000;\n        for (k = 0; k < m; k++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (k = 0; k < m; k++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      for (k = 0; k < m; k++) {\n        a = 1000;\n        for (j = 0; j < m; j++) {\n          if (tt[j][k] < a) {\n            a = tt[j][k];\n          }\n        }\n        for (j = 0; j < m; j++) {\n          tt[j][k] = tt[j][k] - a;\n        }\n      }\n      sum = sum + tt[1][1];\n\n      for (j = 1; j < m; j++) {\n        tt[0][j] = tt[0][j + 1];\n      }\n      for (j = 1; j < m; j++) {\n        tt[j][0] = tt[j + 1][0];\n      }\n      for (j = 1; j < m; j++) {\n        for (k = 1; k < m; k++) {\n          tt[j][k] = tt[j + 1][k + 1];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n;\nint check() {\n  int a[n][n];\n  int c, i, j, mi, mj, r = 0;\n  for (i = n - 1; i >= 0; i--)\n    for (j = n - 1; j >= 0; j--)\n      scanf(\"%d\", &a[i][j]);\n  for (c = n; c > 1; c--) {\n    for (i = 0; i < c; i++) {\n      mi = a[i][0];\n      for (j = 0; j < c; j++)\n        if (mi > a[i][j])\n          mi = a[i][j];\n      for (j = 0; j < c; j++)\n        a[i][j] -= mi;\n    }\n    for (j = 0; j < c; j++) {\n      mj = a[0][j];\n      for (i = 0; i < c; i++)\n        if (mj > a[i][j])\n          mj = a[i][j];\n      for (i = 0; i < c; i++)\n        a[i][j] -= mj;\n    }\n    r += a[c - 2][c - 2];\n    a[c - 2][c - 2] = a[c - 1][c - 1];\n    for (i = 0; i < c - 2; i++)\n      a[i][c - 2] = a[i][c - 1];\n    for (j = 0; j < c - 2; j++)\n      a[c - 2][j] = a[c - 1][j];\n  }\n  return r;\n}\nint main() {\n  int z;\n  scanf(\"%d\", &n);\n  for (z = 0; z < n; z++)\n    cout << check() << \"\\n\";\n  return 0;\n}\n"}
{"label": "18", "index": "34189", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint x[1000][1000];\nint juzheng(int y) {\n  if (y == 1)\n    return 0;\n\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[i][j] < min)\n        min = x[i][j];\n    }\n    for (int j = 1; j <= y; j++)\n      x[i][j] = x[i][j] - min;\n  }\n  for (int i = 1; i <= y; i++) {\n    int min = 100000;\n    for (int j = 1; j <= y; j++) {\n      if (x[j][i] < min)\n        min = x[j][i];\n    }\n    for (int j = 1; j <= y; j++)\n      x[j][i] = x[j][i] - min;\n  }\n  int min1 = x[2][2];\n  for (int i = 2; i < y; i++)\n    x[1][i] = x[1][i + 1];\n  for (int i = 2; i < y; i++)\n    x[i][1] = x[i + 1][1];\n  for (int i = 3; i <= y; i++)\n    for (int j = 3; j <= y; j++)\n      x[i - 1][j - 1] = x[i][j];\n\n  return min1 + juzheng(y - 1);\n}\nint main() {\n  int n;\n  cin >> n;\n\n  for (int i = 1; i <= n; i++) {\n    for (int j = 1; j <= n; j++)\n      for (int k = 1; k <= n; k++) {\n        cin >> x[j][k];\n      }\n\n    printf(\"%d\\n\", juzheng(n));\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, k, i, j, a[200][200], x, p, q, min, sum;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++) {\n        cin >> a[i][j];\n      }\n    for (x = n; x >= 2; x--) {\n      for (p = 1; p <= x; p++) {\n        min = 10000;\n        for (q = 1; q <= x; q++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (q = 1; q <= x; q++)\n          a[p][q] = a[p][q] - min;\n      }\n      for (q = 1; q <= x; q++) {\n        min = 10000;\n        for (p = 1; p <= x; p++)\n          if (min >= a[p][q])\n            min = a[p][q];\n        for (p = 1; p <= x; p++)\n          a[p][q] = a[p][q] - min;\n      }\n      sum = sum + a[2][2];\n      for (p = 1; p <= x; p++)\n        for (q = 2; q <= x - 1; q++)\n          a[p][q] = a[p][q + 1];\n      for (q = 1; q <= x - 1; q++)\n        for (p = 2; p <= x - 1; p++)\n          a[p][q] = a[p + 1][q];\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34191", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, t, i, j, k, iTemp; \n  cin >> n;                 \n  int a[n][n][n], iSum[n];  \n  memset(iSum, 0, sizeof(iSum));\n  for (i = 0; i <= n - 1; i++) {     \n    for (j = 0; j <= n - 1; j++) {   \n      for (k = 0; k <= n - 1; k++) { \n        cin >> a[i][j][k];           \n      }\n    }\n  }\n  for (i = 0; i <= n - 1; i++) {     \n    for (t = 1; t <= n - 1; t++) {   \n      for (j = 0; j <= n - 1; j++) { \n        if (a[i][j][0] < 0) {        \n          continue;                  \n        } else {                     \n          iTemp = a[i][j][0];\n        }\n        for (k = 0; k <= n - 1; k++) { \n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) {\n            iTemp = a[i][j][k];\n          }\n        }\n        for (k = 0; k <= n - 1; k++) { \n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) { \n        if (a[i][0][k] < 0) {        \n          continue;                  \n        } else {\n          iTemp = a[i][0][k]; \n        }\n        for (j = 0; j <= n - 1; j++) {\n          if ((a[i][j][k] < iTemp) && (a[i][j][k] >= 0)) { \n            iTemp = a[i][j][k];\n          }\n        }\n        for (j = 0; j <= n - 1; j++) { \n          a[i][j][k] = a[i][j][k] - iTemp;\n        }\n      }\n      iSum[i] = iSum[i] + a[i][t][t]; \n      for (k = 0; k <= n - 1; k++) {  \n        a[i][t][k] = -1;\n      }\n      for (j = 0; j <= n - 1; j++) { \n        a[i][j][t] = -1;\n      }\n    }\n  }\n  cout << iSum[0]; \n  for (i = 1; i <= n - 1; i++) {\n    cout << endl << iSum[i];\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34192", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, j, a[100][100], b, min, k, sum = 0;\n  scanf(\"%d \", &n);\n  b = n;\n  while (b > 0) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        scanf(\"%d \", &a[i][j]);\n      }\n    sum = 0;\n    for (k = n; k > 1; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];\n      for (i = 1; i < k; i++)\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (j = 1; j < k; j++)\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl;\n\n    b--;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sum(int a[100][100], int n);\n  int a[100][100];\n  int n;\n  cin >> n;\n  int i, j, k;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    cout << sum(a, n) << endl;\n  }\n  return 0;\n}\n\nint sum(int a[100][100], int n) {\n  if (n == 1)\n    return 0;\n  int a_1_1;\n  int min[100];\n  int i, j, k;\n\n  for (i = 0; i < n; i++)\n    min[i] = a[i][0];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      if (min[i] > a[i][j])\n        min[i] = a[i][j];\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      a[i][j] -= min[i];\n\n  for (i = 0; i < n; i++)\n    min[i] = a[0][i];\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      if (min[j] > a[i][j])\n        min[j] = a[i][j];\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n; i++)\n      a[i][j] -= min[j];\n\n  a_1_1 = a[1][1];\n\n  for (i = 1; i < n - 1; i++)\n    a[0][i] = a[0][i + 1];\n  for (j = 1; j < n - 1; j++)\n    a[j][0] = a[j + 1][0];\n  for (i = 1; i < n - 1; i++) {\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n\n  return a_1_1 + sum(a, n - 1);\n}\n"}
{"label": "18", "index": "34194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100];\n  int sum[100], n, i, j, k, l, min;\n  cin >> n;\n  for (i = 0; i < n; i++)\n    sum[i] = 0;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d \", &a[j][k]);\n    for (j = 0; j < n - 1; j++) {\n      for (k = 0; k < n - j; k++) {\n        min = a[k][0];\n        for (l = 0; l < n - j; l++)\n          if (min > a[k][l])\n            min = a[k][l];\n        for (l = 0; l < n - j; l++)\n          a[k][l] = a[k][l] - min;\n      }\n      for (k = 0; k < n - j; k++) {\n        min = a[0][k];\n        for (l = 0; l < n - j; l++)\n          if (a[l][k] < min)\n            min = a[l][k];\n        for (l = 0; l < n - j; l++)\n          a[l][k] = a[l][k] - min;\n      }\n      sum[i] = sum[i] + a[1][1];\n      for (k = 0; k < n - j; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[k][l] = a[k][l + 1];\n      for (k = 0; k < n - j - 1; k++)\n        for (l = 1; l < n - j - 1; l++)\n          a[l][k] = a[l + 1][k];\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34195", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint gl(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < k; j++) {\n      a[i][j] = a[i][j] - min;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    int min = 999;\n    for (j = 0; j < k; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < k; j++) {\n      a[j][i] = a[j][i] - min;\n    }\n  }\n  return (a[1][1]);\n}\nvoid xj(int a[][102], int k) {\n  int i, j;\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[i][j - 1] = a[i][j];\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 2; j < k; j++) {\n      a[j - 1][i] = a[j][i];\n    }\n  }\n}\nint main() {\n  int i, k;\n  scanf(\"%d\", &k);\n  for (i = 0; i < k; i++) {\n    int j, l, sum = 0, a[102][102];\n    for (j = 0; j < k; j++) {\n      for (l = 0; l < k; l++)\n        cin >> a[j][l];\n    }\n    for (j = 0; j < k - 1; j++) {\n      int temp;\n      temp = gl(a, k - j);\n\n      sum = sum + temp;\n      xj(a, k - j);\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34196", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, k, l, min, sum = 0, j;\n  cin >> n;\n  for (l = 1; l <= n; l++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (k = n;; k--) {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] -= min;\n      }\n      for (i = 0; i < k; i++) {\n        min = a[0][i];\n        for (j = 0; j < k; j++) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < k; j++)\n          a[j][i] -= min;\n      }\n      sum += a[1][1];\n      if (k == 2)\n        break;\n      for (i = 1; i <= k - 2; i++) {\n        a[0][i] = a[0][i + 1];\n        a[i][0] = a[i + 1][0];\n        for (j = 1; j <= k - 2; j++)\n          a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "18", "index": "34197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int i;\n  for (i = 0; i < n; i++) \n  {\n    int j, k, l, x, a[100][100], c[100][100],\n        temp; \n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    int sum = 0;\n    for (l = n - 1; l >= 1; l--) {\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k]; \n      for (j = 0; j <= l; j++)\n        for (x = 0; x <= l - 1; x++)\n          for (k = 0; k <= l - 1 - x; k++) \n          {\n            if (c[j][k] > c[j][k + 1]) {\n              temp = c[j][k];\n              c[j][k] = c[j][k + 1];\n              c[j][k + 1] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[j][0]; \n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          c[j][k] = a[j][k];\n      for (k = 0; k <= l; k++) \n        for (x = 0; x <= l - 1; x++)\n          for (j = 0; j <= l - 1 - x; j++) {\n            if (c[j][k] > c[j + 1][k]) {\n              temp = c[j][k];\n              c[j][k] = c[j + 1][k];\n              c[j + 1][k] = temp;\n            }\n          }\n      for (j = 0; j <= l; j++)\n        for (k = 0; k <= l; k++)\n          a[j][k] -= c[0][k];\n      sum += a[1][1]; \n      for (j = 2; j <= l; j++)\n        for (k = 2; k <= l; k++)\n          a[j - 1][k - 1] = a[j][k];\n      for (k = 2; k <= l; k++)\n        a[0][k - 1] = a[0][k];\n      for (j = 2; j <= l; j++)\n        a[j - 1][0] = a[j][0]; \n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34198", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, sum;\n  int a[100][100];\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    for (l = n; l > 1; l--) {\n      for (j = 0; j < l; j++) {\n        min = a[j][0];\n        for (k = 1; k < l; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < l; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (j = 0; j < l; j++) {\n        min = a[0][j];\n        for (k = 1; k < l; k++) {\n          if (a[k][j] < min)\n            min = a[k][j];\n        }\n        for (k = 0; k < l; k++)\n          a[k][j] = a[k][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < l; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[j][k] = a[j][k + 1];\n      }\n      for (j = 0; j < l - 1; j++) {\n        for (k = 1; k < l - 1; k++)\n          a[k][j] = a[k + 1][j];\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l, min, sum;\n  int a[200][200];\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 1; j <= n; j++)\n      for (k = 1; k <= n; k++)\n        cin >> a[j][k];\n    l = n;\n    sum = 0;\n    while (n >= 2) {\n      for (j = 1; j <= n; j++) {\n        min = a[j][1];\n        for (k = 1; k <= n; k++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (k = 1; k <= n; k++)\n          a[j][k] -= min;\n      }\n      for (k = 1; k <= n; k++) {\n        min = a[1][k];\n        for (j = 1; j <= n; j++)\n          if (a[j][k] < min)\n            min = a[j][k];\n        for (j = 1; j <= n; j++)\n          a[j][k] -= min;\n      }\n      sum += a[2][2];\n      for (j = 2; j <= n - 1; j++)\n        for (k = 1; k <= n; k++)\n          a[j][k] = a[j + 1][k];\n      for (k = 2; k <= n - 1; k++)\n        for (j = 1; j <= n - 1; j++)\n          a[j][k] = a[j][k + 1];\n      n--;\n    }\n    n = l;\n    cout << sum << endl;\n  }\n}\n"}
{"label": "18", "index": "34200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint Min(int a[], int n) {\n  int i, min;\n  min = a[0];\n  for (i = 1; i < n; i++) {\n    if (a[i] < min) {\n      min = a[i];\n    }\n  }\n  return min;\n}\n\nint main() {\n  int n, i, N, dd1, dd2, j, min;\n  int row[100][100], col[100][100], sum[100];\n  scanf(\"%d\\n\", &n);\n  N = n;\n  for (i = 0; i < N; i++) {\n    for (dd1 = 0; dd1 < N; dd1++) {\n      for (dd2 = 0; dd2 < N; dd2++) {\n        scanf(\"%d\", &row[dd1][dd2]);\n      }\n    }\n    sum[i] = 0;\n    n = N;\n    for (j = 0; j < N - 1; j++) {\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(row[dd1], n) != 0) {\n          min = Min(row[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            row[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++)\n          col[dd2][dd1] = row[dd1][dd2];\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        if (Min(col[dd1], n) != 0) {\n          min = Min(col[dd1], n);\n          for (dd2 = 0; dd2 < n; dd2++) {\n            col[dd1][dd2] -= min;\n          }\n        }\n      }\n      for (dd1 = 0; dd1 < n; dd1++) {\n        for (dd2 = 0; dd2 < n; dd2++) {\n          row[dd1][dd2] = col[dd2][dd1];\n        }\n      }\n      sum[i] += row[1][1];\n      for (dd1 = 0; dd1 < n - 1; dd1++) {\n        for (dd2 = 0; dd2 < n - 1; dd2++) {\n          if (dd1 >= 1 && dd2 == 0) {\n            row[dd1][dd2] = row[dd1 + 1][dd2];\n          }\n          if (dd2 >= 1 && dd1 == 0) {\n            row[dd1][dd2] = row[dd1][dd2 + 1];\n          }\n          if (dd1 >= 1 && dd2 >= 1) {\n            row[dd1][dd2] = row[dd1 + 1][dd2 + 1];\n          }\n        }\n      }\n      n--;\n    }\n  }\n  for (i = 0; i < N; i++) {\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, l, s = 0;\nint jz[100][100];\nint f() {\n  int i, j, k, min = 10000;\n  if (n == 1) {\n    cout << s << \"\\n\";\n    s = 0;\n    n = l;\n    return 0;\n  } else {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[i][j] < min)\n            min = jz[i][j];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[i][k] = jz[i][k] - min;\n          min = 10000;\n        }\n      }\n    }\n    for (i = 0; i < n; i++) {\n      for (j = 0; j <= n; j++) {\n        if (j < n) {\n          if (jz[j][i] < min)\n            min = jz[j][i];\n        } else {\n          for (k = 0; k < n; k++)\n            jz[k][i] = jz[k][i] - min;\n          min = 10000;\n        }\n      }\n    }\n    s = s + jz[1][1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[i][j] = jz[i][j + 1];\n    for (i = 0; i < n; i++)\n      for (j = 1; j < n - 1; j++)\n        jz[j][i] = jz[j + 1][i];\n    n = n - 1;\n    f();\n  }\n}\nint main() {\n  int i, j, k;\n  cin >> n;\n  l = n;\n  for (i = 1; i <= l; i++) {\n    for (j = 0; j < l; j++)\n      for (k = 0; k < l; k++)\n        scanf(\"%d \", &jz[j][k]);\n    f();\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34202", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100];\n  int n, i = 0, j, k, l, min, sum = 0;\n  scanf(\"%d \", &n);\n  while (i < n) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (l = 0; l < n - 1; l++) {\n      for (j = 0; j < n - l; j++) {\n        min = a[j][0];\n        for (k = 0; k < n - l; k++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (k = 0; k < n - l; k++) {\n          a[j][k] -= min;\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        min = a[0][k];\n        for (j = 0; j < n - l; j++) {\n          if (min > a[j][k]) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n - l; j++) {\n          a[j][k] -= min;\n        }\n      }\n      sum += a[1][1];\n      for (j = 0; j < n - l; j++) {\n        for (k = 1; k < n - l; k++) {\n          a[j][k] = a[j][k + 1];\n        }\n      }\n      for (k = 0; k < n - l; k++) {\n        for (j = 1; j < n - l; j++) {\n          a[j][k] = a[j + 1][k];\n        }\n      }\n    }\n\n    cout << sum << endl;\n    sum = 0;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34203", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint n, a[100][100], sum;\nvoid col(int c) {\n  if (c == n) {\n    printf(\"%d\\n\", sum);\n    return;\n  }\n  int min;\n  for (int i = 0; i <= n - c; i++) {\n    min = a[i][0];\n    for (int j = 1; j <= n - c; j++)\n      if (a[i][j] < min)\n        min = a[i][j];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[i][j] = a[i][j] - min;\n  }\n  for (int i = 0; i <= n - c; i++) {\n    min = a[0][i];\n    for (int j = 1; j <= n - c; j++)\n      if (a[j][i] < min)\n        min = a[j][i];\n    if (min != 0)\n      for (int j = 0; j <= n - c; j++)\n        a[j][i] = a[j][i] - min;\n  }\n  sum += a[1][1];\n  a[1][1] = a[2][2];\n  for (int i = 1; i < n - c; i++)\n    a[0][i] = a[0][i + 1];\n  for (int i = 1; i < n - c; i++)\n    a[i][0] = a[i + 1][0];\n  for (int i = 1; i < n - c; i++)\n    for (int j = 1; j < n - c; j++)\n      a[i][j] = a[i + 1][j + 1];\n  col(c + 1);\n}\nint main() {\n  scanf(\"%d \", &n);\n  for (int l = 0; l < n; l++) {\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        scanf(\"%d \", &a[i][j]);\n    sum = 0;\n    col(1);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34204", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, a[100][100][100], i, j, k, m, s[100], d;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  }\n  d = n;\n  for (i = 0; i < d; i++) {\n    n = d;\n    s[i] = 0;\n    while (n > 1) {\n      for (j = 0; j < n; j++) {\n        m = a[i][j][0];\n        for (k = 1; k < n; k++) {\n          if (a[i][j][k] < m)\n            m = a[i][j][k];\n          if (a[i][j][k] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][j][k] -= m;\n      }\n      for (j = 0; j < n; j++) {\n        m = a[i][0][j];\n        for (k = 1; k < n; k++) {\n          if (a[i][k][j] < m)\n            m = a[i][k][j];\n          if (a[i][k][j] == 0)\n            break;\n        }\n        for (k = 0; k < n; k++)\n          a[i][k][j] -= m;\n      }\n      s[i] += a[i][1][1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][k][j] = a[i][k][j + 1];\n      for (k = 0; k < n; k++)\n        for (j = 1; j < n - 1; j++)\n          a[i][j][k] = a[i][j + 1][k];\n      n--;\n    }\n  }\n  for (i = 0; i < d; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34205", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint m;\nint a[100][100];\nint sum = 0;\n\nvoid d(int n) {\n  int min;\n\n  for (int i = 0; i < n; i++) {\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int j = 0; j < n; j++)\n      a[i][j] -= min;\n  }\n  for (int j = 0; j < n; j++) {\n    min = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (min > a[i][j])\n        min = a[i][j];\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min;\n    }\n  }\n  sum += a[1][1];\n  for (int i = 0; i < n; i++)\n    for (int j = 1; j < n - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (int j = 0; j < n - 1; j++)\n    for (int i = 1; i < n - 1; i++)\n      a[i][j] = a[i + 1][j];\n  if (n > 2)\n    d(n - 1);\n}\nint main() {\n\n  cin >> m;\n  int s[m + 1], p = 1;\n  for (int t = 1; t <= m; t++) {\n    for (int i = 0; i < m; i++)\n      for (int j = 0; j < m; j++)\n        cin >> a[i][j];\n    d(m);\n    s[p++] = sum;\n    sum = 0;\n  }\n  for (int i = 1; i <= m; i++)\n    printf(\"%d\\n\", s[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34206", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, t, minrow, mincol, sum;\n  int p[100][100];\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    t = n;\n    for (i = 0; i < t; i++) {\n      for (j = 0; j < t; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (t != 1) {\n      for (i = 0; i < t; i++) {\n        minrow = 100000;\n        for (j = 0; j < t; j++) {\n          if (*(*(p + i) + j) < minrow) {\n            minrow = *(*(p + i) + j);\n          }\n        }\n        for (j = 0; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - minrow;\n        }\n      }\n      for (j = 0; j < t; j++) {\n        mincol = 100000;\n        for (i = 0; i < t; i++) {\n          if (*(*(p + i) + j) < mincol) {\n            mincol = *(*(p + i) + j);\n          }\n        }\n        for (i = 0; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i) + j) - mincol;\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (i = 0; i < t; i++) {\n        for (j = 1; j < t; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (j = 0; j < t; j++) {\n        for (i = 1; i < t; i++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      t--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid make_zero(int a[100][100], int);\nvoid reduce(int a[100][100], int);\nint min(int a[100][100], int i, int p, int flag);\n\nint main() {\n  int n, a[100][100], sum;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    sum = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    for (int p = n - 1; p > 0; p--) {\n      make_zero(a, p);\n      sum += a[1][1];\n      reduce(a, p);\n    }\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n\nvoid make_zero(int a[100][100], int p) {\n  int flag = 0, m;\n  for (int i = 0; i <= p; i++) {\n    m = min(a, i, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[i][j] -= m;\n    }\n  }\n  flag = 1;\n  for (int k = 0; k <= p; k++) {\n    m = min(a, k, p, flag);\n    for (int j = 0; j <= p; j++) {\n      a[j][k] -= m;\n    }\n  }\n}\n\nvoid reduce(int a[100][100], int p) {\n  for (int i = 0; i <= p; i++) {\n    for (int j = 1; j < p; j++)\n      a[i][j] = a[i][j + 1];\n  }\n  for (int k = 0; k < p; k++) {\n    for (int j = 1; j < p; j++) {\n      a[j][k] = a[j + 1][k];\n    }\n  }\n}\n\nint min(int a[100][100], int i, int p, int flag) {\n  int t;\n  if (flag == 0) {\n    t = a[i][0];\n    for (int j = 0; j <= p; j++) {\n      if (a[i][j] < t)\n        t = a[i][j];\n    }\n  } else {\n    t = a[0][i];\n    for (int j = 0; j <= p; j++) {\n      if (a[j][i] < t)\n        t = a[j][i];\n    }\n  }\n  return t;\n}\n"}
{"label": "18", "index": "34208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint m, a[100][100], s;\nvoid guiling() {\n  int i, j, min;\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[i][j] < min)\n        min = a[i][j];\n    }\n    for (j = 0; j < m; j++)\n      a[i][j] = a[i][j] - min;\n  }\n  for (i = 0; i < m; i++) {\n    min = pow(2, 31.0) - 1;\n    for (j = 0; j < m; j++) {\n      if (a[j][i] < min)\n        min = a[j][i];\n    }\n    for (j = 0; j < m; j++)\n      a[j][i] = a[j][i] - min;\n  }\n  if (m >= 2)\n    s = s + a[1][1];\n}\nvoid xiaojian() {\n  int i, j;\n  for (i = 0; i < m; i++)\n    for (j = 1; j < m - 1; j++)\n      a[i][j] = a[i][j + 1];\n  for (j = 0; j < m - 1; j++)\n    for (i = 1; i < m - 1; i++)\n      a[i][j] = a[i + 1][j];\n  m--;\n  guiling();\n  if (m > 2)\n    xiaojian();\n  else\n    cout << s << \"\\n\";\n}\nint main() {\n  int n, t, i, j;\n  scanf(\"%d \", &n);\n  t = n;\n  while (n > 0) {\n    m = t;\n    s = 0;\n    for (i = 0; i < t; i++)\n      for (j = 0; j < t; j++)\n        cin >> a[i][j];\n    guiling();\n    xiaojian();\n    n--;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34209", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], i, j, n, sum = 0, k, l, min;\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    for (l = 1; l < n; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 1; j < n; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 1; i < n; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n; i++) {\n          a[i][j] -= min;\n        }\n      }\n\n      sum += a[1][1];\n\n      for (i = 2; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n    }\n    cout << sum << \"\\n\";\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34210", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, x, k;\n  cin >> n;\n\n  for (x = 1; x <= n; x++) {\n    int j, i, a[1000][1000], *p, sum = 0;\n    p = &a[0][0];\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", p + 101 * i + j);\n    }\n    for (k = n; k >= 2; k--) {\n      for (i = 0; i < k; i++) {\n        int min = *(*(a + i));\n        for (j = 0; j < k; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      for (j = 0; j < k; j++) {\n        int min = *(*a + j);\n        for (i = 0; i < k; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j) - min;\n      }\n      sum = sum + *(*(a + 1) + 1);\n      for (i = 1; i < k - 1; i++) {\n        for (j = 0; j < k; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j);\n      }\n      for (j = 1; j < k - 1; j++) {\n        for (i = 0; i < k; i++)\n          *(*(a + i) + j) = *(*(a + i) + j + 1);\n      }\n    }\n    printf(\"%d \", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34211", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint f(int a[100][100], int n) {\n  static int s = 0;\n  int i, j;\n  double m1, m2;\n  int *p;\n\n  if (n == 1) {\n    printf(\"%d \", s);\n    s = 0;\n  }\n\n  if (n > 1) {\n    for (i = 0; i < n; i++) {\n      p = a[i];\n      m1 = 100000;\n      for (j = 0; j < n; j++)\n        if (p[j] <= m1)\n          m1 = p[j];\n      for (j = 0; j < n; j++)\n        p[j] = p[j] - m1;\n    }\n\n    for (j = 0; j < n; j++) {\n      m2 = 100000;\n      for (i = 0; i < n; i++)\n        if (a[i][j] <= m2)\n          m2 = a[i][j];\n      for (i = 0; i < n; i++)\n        a[i][j] -= m2;\n    }\n\n    s += a[1][1];\n\n    for (i = 1; i < n - 1; i++) {\n      for (j = 0; j < n; j++)\n        a[i][j] = a[i + 1][j];\n    }\n    for (j = 1; j < n - 1; j++) {\n      for (i = 0; i < n - 1; i++)\n        a[i][j] = a[i][j + 1];\n    }\n\n    f(a, n - 1);\n  }\n}\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n\n  scanf(\"%d \", &n);\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        cin >> a[j][k];\n    }\n    f(a, n);\n  }\n}\n"}
{"label": "18", "index": "34212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint array_1[100][100][100] = {0};\nint main() {\n  int n, sum[100] = {0};\n  scanf(\"%d \", &n);\n  int i, j, k, t;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> array_1[i][j][k];\n  for (i = 0; i < n; i++) {\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][k][0];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][k][t])\n            min = array_1[i][k][t];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t] - min;\n      }\n      for (k = 0; k <= n - j; k++) {\n        int min = array_1[i][0][k];\n        for (t = 1; t <= n - j; t++)\n          if (min > array_1[i][t][k])\n            min = array_1[i][t][k];\n        for (t = 0; t <= n - j; t++)\n          array_1[i][t][k] = array_1[i][t][k] - min;\n      }\n      sum[i] = sum[i] + array_1[i][1][1];\n      for (k = 0; k <= n - j; k++)\n        for (t = 1; t < n - j; t++)\n          array_1[i][k][t] = array_1[i][k][t + 1];\n      for (k = 0; k < n - j; k++)\n\n        for (t = 1; t < n - j; t++)\n          array_1[i][t][k] = array_1[i][t + 1][k];\n    }\n    printf(\"%d\\n\", sum[i]);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int array[1000][1000];\n  int n, i, j, k;\n\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> array[i][j];\n\n    int lenth, min, sum;\n    lenth = n - 1;\n    sum = 0;\n    while (lenth >= 1) {\n      for (i = 0; i <= lenth; i++) {\n\n        min = 2147483647;\n        for (j = 0; j <= lenth; j++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (j = 0; j <= lenth; j++)\n          array[i][j] = array[i][j] - min;\n      }\n      for (j = 0; j <= lenth; j++) {\n\n        min = 2147483647;\n        for (i = 0; i <= lenth; i++) {\n          if (array[i][j] < min)\n            min = array[i][j];\n        }\n        for (i = 0; i <= lenth; i++)\n          array[i][j] = array[i][j] - min;\n      }\n      sum = sum + array[1][1];\n\n      for (i = 0; i <= lenth; i++)\n        for (j = 1; j < lenth; j++)\n          array[i][j] = array[i][j + 1];\n      for (j = 0; j <= lenth; j++)\n        for (i = 1; i < lenth; i++)\n          array[i][j] = array[i + 1][j];\n      lenth = lenth - 1;\n    }\n    printf(\"%d\", sum);\n    if (k < n)\n      printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34214", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0;\n  scanf(\"%d \", &n);\n  int q = 0;\n  while (q < n) {\n    int a[110][110] = {0}, (*p)[110] = a;\n    int o = n, sum = 0;\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> *(*(p + i) + j);\n      }\n    }\n    while (o > 0) {\n      int min[110][2] = {0}, (*q)[2] = min;\n      memset(min, 10000, sizeof(min));\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          if (*(*(p + i) + j) < *(*(q + i)))\n            *(*(q + i)) = *(*(p + i) + j);\n        }\n      }\n      for (int i = 0; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) -= *(*(q + i));\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          if (*(*(p + i) + j) < *(*(q + j) + 1))\n            *(*(q + j) + 1) = *(*(p + i) + j);\n        }\n      }\n      for (int j = 0; j < o; j++) {\n        for (int i = 0; i < o; i++) {\n          *(*(p + i) + j) -= *(*(q + j) + 1);\n        }\n      }\n      sum += *(*(p + 1) + 1);\n      for (int i = 0; i < o; i++) {\n        for (int j = 1; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i) + j + 1);\n        }\n      }\n      for (int i = 1; i < o; i++) {\n        for (int j = 0; j < o; j++) {\n          *(*(p + i) + j) = *(*(p + i + 1) + j);\n        }\n      }\n      o--;\n    }\n    cout << sum << endl;\n    q++;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34215", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint str[101][101];\nvoid input(int n) {\n  for (int i = 0; i < n; i++)\n    for (int j = 0; j < n; j++)\n      scanf(\"%d \", &str[i][j]);\n}\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int max = str[i][0];\n    for (int j = 0; j < n; j++)\n      if (max > str[i][j])\n        max = str[i][j];\n    for (int j = 0; j < n; j++)\n      str[i][j] -= max;\n  }\n  for (int i = 0; i < n; i++) {\n    int max = str[0][i];\n    for (int j = 0; j < n; j++)\n      if (max > str[j][i])\n        max = str[j][i];\n    for (int j = 0; j < n; j++)\n      str[j][i] -= max;\n  }\n}\nvoid del(int n) {\n  for (int i = 1; i < n - 1; i++) {\n    str[0][i] = str[0][i + 1];\n    str[i][0] = str[i + 1][0];\n  }\n  for (int i = 1; i < n - 1; i++)\n    for (int j = 1; j < n - 1; j++)\n      str[i][j] = str[i + 1][j + 1];\n}\nvoid cal(int n, int sum) {\n  if (n == 2) {\n    zero(2);\n    sum += str[1][1];\n    printf(\"%d\\n\", sum);\n    return;\n  }\n\n  zero(n);\n  sum += str[1][1];\n  del(n);\n  cal(n - 1, sum);\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int k = 1; k <= n; k++) {\n    input(n);\n    cal(n, 0);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n;\n  cin >> n;\n  int m = n;\n  int t = n;\n  while (m > 0) {\n    int a[100][100];\n    n = t;\n    m = m - 1;\n    for (int i = 0; i < n; i++)\n      for (int j = 0; j < n; j++)\n        cin >> a[i][j];\n    int sum = 0;\n    while (n > 1) {\n      for (int i = 0; i < n; i++) {\n        int hmin = a[i][0];\n        for (int j = 0; j < n; j++) {\n          if (a[i][j] < hmin)\n            hmin = a[i][j];\n        }\n\n        for (int j = 0; j < n; j++)\n          a[i][j] -= hmin;\n      }\n      for (int i = 0; i < n; i++) {\n        int lmin = a[0][i];\n        for (int j = 0; j < n; j++) {\n          if (a[j][i] < lmin)\n            lmin = a[j][i];\n        }\n        for (int j = 0; j < n; j++)\n          a[j][i] -= lmin; \n      }\n      sum += a[1][1];\n      for (int i = 0; i < n; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[i][j] = a[i][j + 1];\n      for (int i = 0; i < n - 1; i++)\n        for (int j = 1; j < n - 1; j++)\n          a[j][i] = a[j + 1][i];\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101], n;\n  int(*p)[101];\n  scanf(\"%d\", &n);\n  int nn = n, min, s, i, j, nnn = n;\n  while (nn--) {\n    n = nnn;\n    s = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", *(a + i) + j);\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = 1000000;\n        for (j = 0; j < n; j++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (j = 0; j < n; j++)\n          *(*(a + i) + j) -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = 1000000;\n        for (i = 0; i < n; i++)\n          if (*(*(a + i) + j) < min)\n            min = *(*(a + i) + j);\n        for (i = 0; i < n; i++)\n          *(*(a + i) + j) -= min;\n      }\n      s = s + *(*(a + 1) + 1);\n      for (i = 1; i < n - 1; i++) {\n        *((*a) + i) = *((*a) + i + 1);\n      }\n      for (i = 1; i < n - 1; i++) {\n        *(*(a + i)) = *(*(a + i + 1));\n      }\n      for (i = 1; i < n; i++) {\n        for (j = 1; j < n; j++)\n          *(*(a + i) + j) = *(*(a + i + 1) + j + 1);\n      }\n\n      n--;\n    }\n    printf(\"%d\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34218", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k;\n  int a[100][100];\n  cin >> n;\n  for (k = 1; k <= n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int m = n;\n    int sum = 0;\n    while (1) {\n      int min;\n      for (i = 0; i < m; i++) {\n        min = 1000;\n        for (j = 0; j < m; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < m; j++)\n          a[i][j] -= min;\n      }\n      for (j = 0; j < m; j++) {\n        min = 1000;\n        for (i = 0; i < m; i++)\n          if (min > a[i][j])\n            min = a[i][j];\n        for (i = 0; i < m; i++)\n          a[i][j] -= min;\n      }\n      sum += a[1][1];\n      m--;\n      if (m == 1) {\n        cout << sum << endl;\n        break;\n      }\n      for (i = 1; i < m; i++)\n        a[i][0] = a[i + 1][0];\n      for (j = 1; j < m; j++)\n        a[0][j] = a[0][j + 1];\n      for (i = 1; i < m; i++)\n        for (j = 1; j < m; j++)\n          a[i][j] = a[i + 1][j + 1];\n    }\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34219", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[101][101], sum = 0;\n\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min;\n    min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int j = 0; j < n; j++) {\n    int min2;\n    min2 = a[0][j];\n    for (int i = 0; i < n; i++) {\n      if (a[i][j] < min2) {\n        min2 = a[i][j];\n      }\n    }\n    for (int i = 0; i < n; i++) {\n      a[i][j] -= min2;\n    }\n  }\n}\n\nvoid subtract(int n) {\n  if (n > 2) {\n    for (int j = 2; j < n; j++) {\n      a[0][j - 1] = a[0][j];\n    }\n    for (int i = 2; i < n; i++) {\n      a[i - 1][0] = a[i][0];\n    }\n    for (int i = 2; i < n; i++) {\n      for (int j = 2; j < n; j++) {\n        a[i - 1][j - 1] = a[i][j];\n      }\n    }\n  }\n}\n\nvoid process(int n) {\n  if (n != 1) {\n    zero(n);\n    sum += a[1][1];\n    subtract(n);\n    process(n - 1);\n  }\n}\nint main() {\n  int n;\n  cin >> n;\n  for (int p = 0; p < n; p++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    process(n);\n    cout << sum;\n    if (p != n - 1)\n      cout << endl;\n    sum = 0;\n  }\n}\n"}
{"label": "18", "index": "34220", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint a[100][100], n, sum;\n\nvoid evaluation() {             \n  for (int i = 0; i < n; i++) { \n    for (int j = 1; j < n - 1; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (int j = 0; j < n; j++) { \n    for (int i = 1; i < n - 1; i++) {\n      a[i][j] = a[i + 1][j];\n    }\n  }\n  n--; \n}\n\nint operation() {\n  int min;\n  if (n == 1) { \n    cout << sum << endl;\n    return 0;\n  } else {\n    for (int i = 0; i < n; i++) {\n      min = 100000;                 \n      for (int j = 0; j < n; j++) { \n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int j = 0; j < n; j++)\n        a[i][j] -= min; \n    }\n    for (int j = 0; j < n; j++) {\n      min = 100000;\n      for (int i = 0; i < n; i++) { \n        if (a[i][j] < min)\n          min = a[i][j];\n      }\n      for (int i = 0; i < n; i++)\n        a[i][j] -= min; \n    }\n    sum += a[1][1]; \n    evaluation();   \n    operation();    \n  }\n}\n\nint main() {\n  int N;\n  cin >> N;\n  for (int k = 0; k < N; k++) {\n    sum = 0; \n    n = N;   \n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++) {\n        cin >> a[i][j]; \n      }\n    }\n    operation(); \n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid f1(int n, int a[100][100]) {\n  int i;\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[i][0], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[i][j])\n        x = a[i][j];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[i][j] -= x;\n  }\n  for (i = 0; i <= n - 1; i++) {\n    int x = a[0][i], j;\n    for (j = 1; j <= n - 1; j++)\n      if (x > a[j][i])\n        x = a[j][i];\n    if (x > 0)\n      for (j = 0; j <= n - 1; j++)\n        a[j][i] -= x;\n  }\n}\n\nvoid f2(int n, int a[100][100]) {\n  int i, j;\n  for (i = 1; i <= n - 2; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n  }\n  for (i = 1; i <= n - 2; i++)\n    for (j = 1; j <= n - 2; j++)\n      a[i][j] = a[i + 1][j + 1];\n}\n\nint loop(int n, int a[100][100]) {\n  f1(n, a);\n  int x = a[1][1];\n\n  if (n == 2)\n    return a[1][1];\n  else {\n    f2(n, a);\n    return x + loop(n - 1, a);\n  }\n}\n\nint main(void) {\n  int t, n;\n  cin >> n;\n  for (t = 1; t <= n; t++) {\n    int a[100][100], i, j;\n    for (i = 0; i <= n - 1; i++)\n      for (j = 0; j <= n - 1; j++)\n        scanf(\"%d\", &a[i][j]);\n\n    cout << loop(n, a) << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34222", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, c[100], a[100][100], sum, l;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &a[j][k]);\n    }\n    for (l = 1; l <= n - 1; l++) {\n\n      c[0] = a[0][0];\n      for (k = l; k < n; k++) {\n        if (c[0] > a[0][k])\n          c[0] = a[0][k];\n      }\n      for (k = 0; k < n; k++)\n        a[0][k] = a[0][k] - c[0];\n\n      c[0] = a[0][0];\n      for (j = l; j < n; j++) {\n        c[j] = a[j][0];\n        for (k = l; k < n; k++) {\n          if (c[j] > a[j][k])\n            c[j] = a[j][k];\n        }\n        for (k = 0; k < n; k++) {\n          a[j][k] = a[j][k] - c[j];\n        }\n      }\n      for (k = l; k < n; k++) {\n        c[k] = a[0][k];\n        for (j = l; j < n; j++) {\n          if (c[k] > a[j][k])\n            c[k] = a[j][k];\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - c[k];\n        }\n      }\n      for (j = l; j < n; j++) {\n        if (c[0] > a[j][0])\n          c[0] = a[j][0];\n      }\n      for (j = 0; j < n; j++) {\n        a[j][0] = a[j][0] - c[0];\n      }\n      sum = sum + a[l][l];\n    }\n    printf(\"%d \", sum);\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "18", "index": "34223", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, sum = 0, min = 0, l, k;\n  cin >> n;\n  l = n;\n  for (k = 0; k < l; k++) {\n    sum = 0;\n    int a[l][l];\n    for (i = 0; i < l; i++)\n      for (j = 0; j < l; j++)\n        cin >> a[i][j];\n    n = l;\n    while (n > 1) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (min > a[i][j]) {\n            min = a[i][j];\n          }\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j] - min;\n      }\n      sum = sum + a[1][1];\n      for (i = 1; i < n - 1; i++)\n        for (j = 0; j < n; j++)\n          a[i][j] = a[i + 1][j];\n      for (j = 1; j < n - 1; j++)\n        for (i = 0; i < n; i++)\n          a[i][j] = a[i][j + 1];\n      n = n - 1;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34224", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, i, j, k, l, m, sum, min, z;\n  int a[100][100];\n  cin >> n;\n  for (k = 0; k < n; k = k + 1) {\n    sum = 0;\n    for (i = 0; i < n; i = i + 1)\n      for (j = 0; j < n; j = j + 1)\n        cin >> a[i][j];\n    for (l = n; l > 1; l = l - 1) {\n      for (i = 0; i < l; i = i + 1) {\n        min = a[i][0];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[i][j] = a[i][j] - min;\n      }\n      for (i = 0; i < l; i = i + 1) {\n        min = a[0][i];\n        for (j = 1; j < l; j = j + 1) {\n          if (a[j][i] < min)\n            min = a[j][i];\n        }\n        for (j = 0; j < l; j = j + 1)\n          a[j][i] = a[j][i] - min;\n      }\n      sum = sum + a[1][1];\n      if (l != 2) {\n        for (i = 1; i < l; i = i + 1)\n          a[0][i] = a[0][i + 1], a[i][0] = a[i + 1][0];\n        for (i = 1; i < l; i = i + 1)\n          for (j = 1; j < l; j = j + 1)\n            a[i][j] = a[i + 1][j + 1];\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34225", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int a[100][100], n, m, i, j, x, y;\n  cin >> n;\n  for (m = 1; m <= n; m++) {\n    int s = 0, t = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    for (y = n; y >= 2; y--) {\n      for (i = 0; i < n - t; i++) {\n        x = a[i][0];\n        for (j = 0; j < n - t; j++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (j = 0; j < n - t; j++)\n          a[i][j] -= x;\n      }\n      for (j = 0; j < n - t; j++) {\n        x = a[0][j];\n        for (i = 0; i < n - t; i++)\n          if (x > a[i][j])\n            x = a[i][j];\n        for (i = 0; i < n - t; i++)\n          a[i][j] -= x;\n      }\n      s = s + a[1][1];\n      for (i = 0; i < n - t; i++) {\n        for (j = 1; j < n - t - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n      t++;\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], b[100][100], n, i, j, k;\n  int c, l, o, p, q, r, s, t;\n  int min;\n  int w, x, y, z;\n  int h, g, m;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        cin >> a[i][j][k];\n      }\n    }\n  }\n  for (c = 1; c <= n - 1; c++) {\n    for (l = 0; l < n; l++) {\n\n      for (o = 0; o <= n - c; o++) {\n        min = a[l][o][1];\n        for (p = 0; p <= n - c; p++) {\n          if (a[l][o][p] < min)\n            min = a[l][o][p];\n        }\n        for (q = 0; q <= n - c; q++) {\n          a[l][o][q] -= min;\n        }\n      }\n      for (r = 0; r <= n - c; r++) {\n        min = a[l][1][r];\n        for (s = 0; s <= n - c; s++) {\n          if (a[l][s][r] < min)\n            min = a[l][s][r];\n        }\n        for (t = 0; t <= n - c; t++) {\n          a[l][t][r] -= min;\n        }\n      }\n      b[l][c] = a[l][1][1];\n      for (w = 1; w <= n - c - 1; w++) {\n        for (x = 0; x <= n - c; x++) {\n          a[l][w][x] = a[l][w + 1][x];\n        }\n      }\n      for (y = 1; y <= n - c - 1; y++) {\n        for (z = 0; z <= n - c; z++) {\n          a[l][z][y] = a[l][z][y + 1];\n        }\n      }\n    }\n  }\n  for (h = 0; h < n; h++) {\n    m = 0;\n    for (g = 1; g <= n - 1; g++) {\n      m += b[h][g];\n    }\n    cout << m << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34227", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() \n{\n  int i, n, j, a[100][100], b, min, k, sum = 0; \n  cin >> n;\n  b = n;\n  while (b > 0) {\n    for (i = 0; i < n; i++) \n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    sum = 0;\n    for (k = n; k > 1; k--) \n    {\n      for (i = 0; i < k; i++) {\n        min = a[i][0];\n        for (j = 0; j < k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < k; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < k; j++) \n      {\n        min = a[0][j];\n        for (i = 0; i < k; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum = sum + a[1][1];    \n      for (i = 1; i < k; i++) \n        for (j = 0; j < k; j++)\n          a[i][j] = a[i + 1][j];\n\n      for (j = 1; j < k; j++) \n        for (i = 0; i < k; i++)\n          a[i][j] = a[i][j + 1];\n    }\n    cout << sum << endl;\n\n    b--;\n  }\n\n  return 0; \n}\n"}
{"label": "18", "index": "34228", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(int a, int b) {\n  if (a >= b) {\n    return b;\n  } else {\n    return a;\n  }\n}\nint main() {\n  int n, i, j, t, sum, x, y, r;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    int a[100][100] = {0};\n    int b[100][100] = {0};\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (t = 0; t < n; t++) {\n        scanf(\"%d\", &a[j][t]);\n        b[j][t] = a[j][t];\n      }\n    }\n    for (r = 0; r < n - 1; r++) {\n      for (j = 0; j < n; j++) {\n        x = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[j][t + 1] = f(a[j][t], a[j][t + 1]);\n        }\n        x = a[j][t];\n        for (t = 0; t < n; t++) {\n          b[j][t] = b[j][t] - x;\n          a[j][t] = b[j][t];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        y = 0;\n        for (t = 0; t < n - 1; t++) {\n          a[t + 1][j] = f(a[t][j], a[t + 1][j]);\n        }\n        y = a[t][j];\n        for (t = 0; t < n; t++) {\n          b[t][j] = b[t][j] - y;\n          a[t][j] = b[t][j];\n        }\n      }\n      sum = sum + a[1][1];\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[t][j] = a[t + 1][j];\n          b[t][j] = a[t][j];\n        }\n      }\n      for (j = 0; j < n; j++) {\n        for (t = 1; t < n - 1; t++) {\n          a[j][t] = a[j][t + 1];\n          b[j][t] = a[j][t];\n        }\n      }\n    }\n    cout << sum << \" \";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k, l;\n  cin >> n;\n  int a[100][100];\n  int sum = 0, temp = 1;\n  for (k = 0; k < n; k++) {\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> a[i][j];\n    int min;\n    sum = 0;\n    temp = 1;\n    for (l = 0; l < n - 1; l++) {\n      for (i = 0; i < n; i++) {\n        min = a[i][0];\n        for (j = 0; j < n; j++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (j = 0; j < n; j++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      for (j = 0; j < n; j++) {\n        min = a[0][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] < min && a[i][j] >= 0)\n            min = a[i][j];\n        for (i = 0; i < n; i++)\n          if (a[i][j] >= 0)\n            a[i][j] -= min;\n      }\n      sum += a[temp][temp];\n      for (i = 0; i < n; i++)\n        a[i][temp] = -1;\n      for (j = 0; j < n; j++)\n        a[temp][j] = -1;\n      temp++;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint sum = 0;\nvoid change(int n);\nint number[100][100];\nint main() {\n  int n, k, j;\n  cin >> n;\n  for (int i = 1; i <= n; i++) {\n    for (k = 0; k < n; k++)\n      for (j = 0; j < n; j++)\n        cin >> number[k][j];\n    sum = 0;\n    change(n);\n  }\n  return 0;\n}\n\nvoid change(int n) {\n  int m;\n  m = n;\n  int min;\n  if (m == 1)\n    cout << sum << \"\\n\";\n  else {\n    int i = 0, j = 0;\n    for (i = 0; i < m; i++) {\n      min = number[i][0];\n      for (j = 0; j < m; j++)\n        if (min > number[i][j])\n          min = number[i][j];\n      for (j = 0; j < n; j++)\n        number[i][j] = number[i][j] - min;\n    }\n    for (i = 0; i < m; i++) {\n      min = number[0][i];\n      for (j = 0; j < m; j++)\n        if (min > number[j][i])\n          min = number[j][i];\n      for (j = 0; j < m; j++)\n        number[j][i] = number[j][i] - min;\n    }\n\n    sum = sum + number[1][1];\n    for (j = 0; j < m; j++)\n      for (i = 1; i < m - 1; i++)\n        number[i][j] = number[i + 1][j];\n    for (i = 0; i < m - 1; i++)\n      for (j = 1; j < m - 1; j++)\n        number[i][j] = number[i][j + 1];\n    m = m - 1;\n    change(m);\n  }\n}\n"}
{"label": "18", "index": "34231", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a[100][100][100], n, t;\n  cin >> n;\n  for (int x = 0; x < n; x++) {\n    for (int i = 0; i < n; i++) {\n      for (int j = 0; j < n; j++)\n        cin >> a[x][i][j];\n    }\n  }\n  for (int x = 0; x < n; x++) {\n    int sum = 0;\n    int m = n;\n    while (m > 1) {\n      for (int i = 0; i < m; i++) {\n        int min = a[x][i][0];\n        for (int j = 0; j < m; j++) {\n          if (a[x][i][j] < min) {\n            min = a[x][i][j];\n          }\n        }\n        for (int k = 0; k < m; k++)\n          a[x][i][k] -= min;\n      }\n      for (int j = 0; j < m; j++) {\n        int min = a[x][0][j];\n        for (int i = 0; i < m; i++) {\n          if (a[x][i][j] < min)\n            min = a[x][i][j];\n        }\n        for (int k = 0; k < m; k++)\n          a[x][k][j] -= min;\n      }\n      sum += a[x][1][1];\n      for (int i = 0; i < m; i++) {\n        for (int j = 0; j < m; j++) {\n          if (i == 0 && j > 1) {\n            a[x][i][j - 1] = a[x][i][j];\n          }\n          if (i > 1) {\n            if (j == 0) {\n              a[x][i - 1][j] = a[x][i][j];\n            }\n            if (j > 1) {\n              a[x][i - 1][j - 1] = a[x][i][j];\n            }\n          }\n        }\n      }\n      m--;\n    }\n    printf(\"%d\\n\", sum);\n    ;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint map_1[100][100], sum = 0, min_1 = 1000, rst[100];\nint main() {\n  int n, i, j, k, t;\n  scanf(\"%d\", &n);\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &map_1[j][k]);\n    for (t = n; t > 1; t--) {\n      for (j = 0; j < t; j++) {\n        for (k = 0; k < t; k++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (k = 0; k < t; k++)\n          map_1[j][k] = map_1[j][k] - min_1;\n\n        min_1 = 1000;\n      }\n\n      min_1 = 1000;\n      for (k = 0; k < t; k++) {\n        for (j = 0; j < t; j++) {\n          if (map_1[j][k] < min_1)\n            min_1 = map_1[j][k];\n        }\n        for (j = 0; j < t; j++) {\n          map_1[j][k] = map_1[j][k] - min_1;\n        }\n\n        min_1 = 1000;\n      }\n      sum = sum + map_1[1][1];\n\n      for (k = 1; k < t - 1; k++)\n        map_1[0][k] = map_1[0][k + 1];\n      for (j = 1; j < t - 1; j++)\n        map_1[j][0] = map_1[j + 1][0];\n      for (j = 1; j < t - 1; j++)\n        for (k = 1; k < t - 1; k++)\n          map_1[j][k] = map_1[j + 1][k + 1];\n\n      min_1 = 1000;\n    }\n    rst[i] = sum;\n    sum = 0;\n  }\n  for (i = 0; i < n; i++)\n    cout << rst[i];\n  return 0;\n}\n"}
{"label": "18", "index": "34233", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, a[100][100], ni, minl[100], minh[100], i, j, k, sum;\n  cin >> n;\n  for (k = 0; k < n; k++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    for (ni = n; ni > 1; ni--) {\n      for (i = 0; i < ni; i++) {\n        minl[i] = a[i][0];\n        for (j = 0; j < ni; j++) {\n          if (minl[i] > a[i][j])\n            minl[i] = a[i][j];\n        }\n        for (j = 0; j < ni; j++) {\n          a[i][j] = a[i][j] - minl[i];\n        }\n      }\n      for (j = 0; j < ni; j++) {\n        minh[j] = a[0][j];\n        for (i = 0; i < ni; i++) {\n          if (minh[j] > a[i][j])\n            minh[j] = a[i][j];\n        }\n        for (i = 0; i < ni; i++) {\n          a[i][j] = a[i][j] - minh[j];\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < ni; i++) {\n        for (j = 1; j < ni - 1; j++)\n          a[i][j] = a[i][j + 1];\n      }\n\n      for (j = 0; j < ni; j++) {\n        for (i = 1; i < ni - 1; i++) {\n          a[i][j] = a[i + 1][j];\n        }\n      }\n    }\n    printf(\"%d\\n\", sum);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34234", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nenum { size = 100 };\n\nvoid gotozero(int num, int n, int a[size][size][size], int minrow[size][size],\n              int mincol[size][size]) {\n  int i, j, k;\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      minrow[i][j] = a[i][j][0];\n      for (k = 0; k < n; k++)\n        if (minrow[i][j] > a[i][j][k])\n          minrow[i][j] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][j][k] -= minrow[i][j];\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      mincol[i][j] = a[i][0][j];\n      for (k = 0; k < n; k++)\n        if (mincol[i][j] > a[i][k][j])\n          mincol[i][j] = a[i][k][j];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        a[i][k][j] -= mincol[i][j];\n  }\n}\n\nvoid cut(int num, int n, int a[size][size][size], int minrow[size][size],\n         int mincol[size][size]) {\n  int i, j, k;\n  for (i = 0; i < num; i++) {\n    for (j = 0; j < n; j++) {\n      for (k = 2; k < n; k++)\n        a[i][j][k - 1] = a[i][j][k];\n    }\n  }\n\n  for (i = 0; i < num; i++) {\n    for (k = 0; k < n; k++) {\n      for (j = 2; j < n; j++)\n        a[i][j - 1][k] = a[i][j][k];\n    }\n  }\n}\n\nint main() {\n  int i, j, k, n, num;\n  int a[size][size][size] = {0}, minrow[size][size] = {0}, sum[size] = {0},\n      mincol[size][size] = {0};\n  cin >> n;\n  num = n;\n  for (i = 0; i < n; i++)\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        cin >> a[i][j][k];\n  while (n > 1) {\n    gotozero(num, n, a, minrow, mincol);\n    for (i = 0; i < num; i++)\n      sum[i] += a[i][1][1];\n    cut(num, n, a, minrow, mincol);\n    n--;\n  }\n  for (i = 0; i < num; i++)\n    printf(\"%d\\n\", sum[i]);\n  return 0;\n}\n"}
{"label": "18", "index": "34235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n, l, p;\nint sum = 0;\nint a[105][105];\n\nvoid g() {\n  int i, j;\n  int t;\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + i) + 1);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + i) + j) < t)\n        t = *(*(a + i) + j);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + i) + j) -= t;\n  }\n  for (i = 1; i <= n - p; i++) {\n    t = *(*(a + 1) + i);\n    for (j = 1; j <= n - p; j++)\n      if (*(*(a + j) + i) < t)\n        t = *(*(a + j) + i);\n    for (j = 1; j <= n - p; j++)\n      *(*(a + j) + i) -= t;\n  }\n}\n\nvoid f() {\n  int i, j;\n  for (i = 1; i <= n; i++) {\n    for (j = 2; j < n; j++)\n      *(*(a + i) + j) = *(*(a + i) + j + 1);\n  }\n  for (j = 1; j <= n; j++)\n    for (i = 2; i <= n; i++)\n      *(*(a + i) + j) = *(*(a + i + 1) + j);\n}\nint main() {\n  int i, j;\n  cin >> n;\n  for (l = 0; l < n; l++) {\n    sum = 0;\n    for (i = 1; i <= n; i++)\n      for (j = 1; j <= n; j++)\n        cin >> *(*(a + i) + j);\n    for (p = 0; p < n; p++) {\n\n      g();\n      sum += (*(*(a + 2) + 2));\n      f();\n    }\n\n    cout << sum << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34236", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int sum = 0, s[100][100], i, t, j, m, n, k, min;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    for (j = 0; j < n; j++)\n      for (k = 0; k < n; k++)\n        scanf(\"%d\", &s[j][k]);\n    sum = 0;\n    for (j = 1; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[k][0];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[k][t] < min)\n              min = s[k][t];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[k][t] -= min;\n          }\n        }\n      }\n\n      for (k = 0; k < n; k++) {\n        if (k == 0 || k >= j) {\n          min = s[0][k];\n          for (t = 0; t < n; t++) {\n            if ((t == 0 || t >= j) && s[t][k] < min)\n              min = s[t][k];\n          }\n          for (t = 0; t < n; t++) {\n            if (t == 0 || t >= j)\n              s[t][k] -= min;\n          }\n        }\n      }\n      sum += s[j][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int sim(int, int[][100]);\n  int n = 0, i = 0, j = 0, a[100][100];\n  cin >> n; \n  for (int k = 0; k < n; k++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }                          \n    cout << sim(n, a) << endl; \n  }\n  return 0;\n} \nint sim(int n, int a[][100]) {\n  int i = 0, j = 0, m1[100], m2[100], sum = 0;\n  if (n == 1)\n    return 0; \n  else\n    for (i = 0; i < 100; i++) {\n      m1[i] = 99999;\n      m2[i] = 99999;\n    } \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= m1[i]) {\n        m1[i] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m1[i];\n    }\n  } \n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      if (a[i][j] <= m2[j]) {\n        m2[j] = a[i][j];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      a[i][j] -= m2[j];\n    }\n  }               \n  sum += a[1][1]; \n  for (i = 0; i < n - 1; i++) {\n    for (j = 0; j < n - 1; j++) {\n      if (i == 0 && j == 0)\n        continue;\n      else if (i == 0)\n        a[i][j] = a[i][j + 1];\n      else if (j == 0)\n        a[i][j] = a[i + 1][j];\n      else\n        a[i][j] = a[i + 1][j + 1];\n    }\n  }                     \n  sum += sim(n - 1, a); \n  return sum;           \n}\n"}
{"label": "18", "index": "34238", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint a[100][100];\nint total;\n\nvoid slice_1(int);\nvoid zero(int n) {\n  for (int i = 0; i < n; i++) {\n    int min = a[i][0];\n    for (int j = 0; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (int i = 0; i < n; i++) {\n    int min = a[0][i];\n    for (int j = 0; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (int j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n  slice_1(n);\n}\n\nvoid slice_1(int n) {\n  total += a[1][1];\n  for (int i = 0; i < n; i++) {\n    for (int j = 0; j < n; j++) {\n      if (j > 0 && i > 0) {\n        a[i][j] = a[i + 1][j + 1];\n      } else if (j > 0) {\n        a[i][j] = a[i][j + 1];\n      } else if (i > 0) {\n        a[i][j] = a[i + 1][j];\n      }\n    }\n  }\n  n--;\n  if (n == 1) {\n    return;\n  }\n  zero(n);\n}\n\nint main(int argc, const char *argv[]) {\n  int n;\n  cin >> n;\n  for (int i = 0; i < n; i++) {\n    memset(a, 0, 100 * 100 * sizeof(int));\n    total = 0;\n    for (int j = 0; j < n; j++) {\n      for (int k = 0; k < n; k++) {\n        cin >> a[j][k];\n      }\n    }\n    zero(n);\n    cout << total << endl;\n  }\n}\n"}
{"label": "18", "index": "34239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a[101][101] = {0}, n, i, j, k, l, m, b, c, s;\n  cin >> n;\n  for (i = 1; i <= n; i++) {\n    s = 0;\n    for (j = 0; j <= n * n - 1; j++)\n      cin >> a[j / n][j % n];\n    for (j = 1; j <= n - 1; j++) {\n      for (k = 0; k <= n - 1; k++) {\n        b = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          if (a[k][l] < b)\n            b = a[k][l];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[k][l] = a[k][l] - b;\n        }\n      }\n      for (k = 0; k <= n - 1; k++) {\n        c = 999999;\n        for (l = 0; l <= n - 1; l++) {\n          if (a[l][k] == 999999)\n            continue;\n          if (a[l][k] < c)\n            c = a[l][k];\n        }\n        for (l = 0; l <= n - 1; l++) {\n          if (a[k][l] == 999999)\n            continue;\n          a[l][k] = a[l][k] - c;\n        }\n      }\n      s = s + a[j][j];\n      for (m = 0; m <= n - 1; m++)\n        a[j][m] = 999999;\n      for (m = 0; m <= n - 1; m++)\n        a[m][j] = 999999;\n    }\n    cout << s << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], i, j, t, k, tem, min, sum;\n  cin >> n;\n  for (t = 0; t < n; t++) {\n    sum = 0;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    tem = n;\n    for (k = 0; k < n - 1; k++) {\n      for (i = 0; i < tem; i++) {\n        min = a[i][0];\n        for (j = 1; j < tem; j++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (j = 0; j < tem; j++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      for (j = 0; j < tem; j++) {\n        min = a[0][j];\n        for (i = 1; i < tem; i++) {\n          if (min > a[i][j])\n            min = a[i][j];\n        }\n        for (i = 0; i < tem; i++) {\n          a[i][j] = a[i][j] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (i = 2; i < tem; i++) {\n        for (j = 0; j < tem; j++) {\n          a[i - 1][j] = a[i][j];\n        }\n      }\n      for (j = 2; j < tem; j++) {\n        for (i = 0; i < tem; i++) {\n          a[i][j - 1] = a[i][j];\n        }\n      }\n      tem--;\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint a[100][100];\nvoid minu(int n);\nvoid shrink(int n);\nint main() {\n  int n, i, j, k, sum, x;\n  cin >> n;\n  for (i = 0; i < n; i++) {\n    sum = 0;\n    for (j = 0; j < n; j++) {\n      for (k = 0; k < n; k++) {\n        scanf(\"%d \", &a[j][k]);\n      }\n    }\n    for (x = n; x > 1; x--) {\n      minu(x);\n      sum += a[1][1];\n      shrink(x);\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\nvoid minu(int n) {\n  int i, j, min;\n  for (i = 0; i < n; i++) {\n    min = a[i][0];\n    for (j = 1; j < n; j++) {\n      if (a[i][j] < min) {\n        min = a[i][j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[i][j] -= min;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    min = a[0][i];\n    for (j = 1; j < n; j++) {\n      if (a[j][i] < min) {\n        min = a[j][i];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      a[j][i] -= min;\n    }\n  }\n}\nvoid shrink(int n) {\n  int i, j;\n  for (i = 1; i < n - 1; i++) {\n    a[0][i] = a[0][i + 1];\n    a[i][0] = a[i + 1][0];\n    for (j = 1; j < n - 1; j++)\n      a[i][j] = a[i + 1][j + 1];\n  }\n}\n"}
{"label": "18", "index": "34242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n;\n  cin >> n;\n  int matrix[100][100] = {0};\n  int time, min, sum = 0, k;\n  for (k = 1; k <= n; k++) {\n    int i, j;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        cin >> *(*(matrix + i) + j);\n    sum = 0;\n    for (time = 1; time < n; time++) {\n      for (i = 0; i <= n - time; i++) {\n        min = *(*(matrix + i));\n        for (j = 0; j <= n - time; j++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) -= min;\n      }\n      for (j = 0; j <= n - time; j++) {\n        min = *(*(matrix) + j);\n        for (i = 0; i <= n - time; i++)\n          if (*(*(matrix + i) + j) < min)\n            min = *(*(matrix + i) + j);\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) -= min;\n      }\n      sum += *(*(matrix + 1) + 1);\n      for (i = 1; i <= n - time; i++) {\n        for (j = 0; j <= n - time; j++)\n          *(*(matrix + i) + j) = *(*(matrix + i + 1) + j);\n      }\n      for (j = 1; j <= n - time; j++) {\n        for (i = 0; i <= n - time; i++)\n          *(*(matrix + i) + j) = *(*(matrix + i) + j + 1);\n      }\n    }\n    cout << sum << endl;\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], sum = 0, i, j, h, min, min1, k = 0;\n  scanf(\"%d\", &n);\n  for (h = 0; h < n; h++) {\n    sum = 0;\n    k = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    while (k < n - 1) {\n      for (i = 0; i < n - k; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - k; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[i][j] -= min;\n        }\n      }\n      for (i = 0; i < n - k; i++) {\n        min1 = a[0][i];\n        for (j = 0; j < n - k; j++) {\n          if (a[j][i] < min1)\n            min1 = a[j][i];\n        }\n\n        for (j = 0; j < n - k; j++) {\n          a[j][i] -= min1;\n        }\n      }\n      sum += a[1][1];\n\n      for (i = 0; i < n - k; i++)\n        for (j = 0; j < n - k; j++) {\n          if (j >= 2 && i < 2)\n            a[i][j - 1] = a[i][j];\n          else if (i >= 2 && j < 2)\n            a[i - 1][j] = a[i][j];\n          else if (i >= 2 && j >= 2)\n            a[i - 1][j - 1] = a[i][j];\n        }\n      k++;\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34244", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, p, t, min, sum = 0;\n  int a[100][100];\n  cin >> n;\n  for (p = 0; p < n; p++) {\n    sum = 0;\n    for (i = 0; i < n; i++)\n      for (j = 0; j < n; j++)\n        scanf(\"%d\", &a[i][j]);\n    for (t = 0; t < n - 1; t++) {\n      for (i = 0; i < n - t; i++) {\n        min = a[i][0];\n        for (j = 0; j < n - t; j++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (j = 0; j < n - t; j++)\n          a[i][j] = a[i][j] - min;\n      }\n      for (j = 0; j < n - t; j++) {\n        min = a[0][j];\n        for (i = 0; i < n - t; i++) {\n          if (a[i][j] < min)\n            min = a[i][j];\n        }\n        for (i = 0; i < n - t; i++)\n          a[i][j] = a[i][j] - min;\n      }\n\n      sum += a[1][1];\n      for (i = 0; i < n - t; i++)\n        for (j = 1; j < n - t; j++)\n          a[i][j] = a[i][j + 1];\n      for (j = 0; j < n - t; j++)\n        for (i = 1; i < n - t; i++)\n          a[i][j] = a[i + 1][j];\n    }\n    printf(\"%d\\n\", sum);\n  }\n  return 0;\n}\n"}
{"label": "18", "index": "34245", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, m, the_min;\nint a[110][110];\n\nvoid reduce_min(int x, int y, int dx, int dy) {\n  if (x == m || y == m) {\n    return;\n  }\n  if (a[x][y] < the_min) {\n    the_min = a[x][y];\n  }\n  reduce_min(x + dx, y + dy, dx, dy);\n  a[x][y] -= the_min;\n}\n\nvoid reduce() {\n  int i, j;\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[i][j] = a[i][j + 1];\n    }\n  }\n  for (i = 0; i < m; i++) {\n    for (j = 1; j < m; j++) {\n      a[j][i] = a[j + 1][i];\n    }\n  }\n}\n\nint main() {\n  int i, j;\n  int t;\n  int sum;\n  scanf(\"%d\", &n);\n  for (t = 0; t < n; t++) {\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        cin >> a[i][j];\n      }\n    }\n    sum = 0;\n    for (m = n; m >= 1; m--) {\n      for (i = 0; i < 2 * m; i++) {\n        the_min = 10000;\n        reduce_min((i % m) * (1 - i / m), (i % m) * (i / m), i / m, 1 - i / m);\n      }\n      sum += a[1][1];\n      reduce();\n    }\n    printf(\"%d\\n\", sum);\n  }\n}\n"}
{"label": "18", "index": "34246", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int nn, n;\n  scanf(\"%d \", &nn);\n\n  int a[101][101];\n  for (int k = 0; k < nn; k++) {\n    int ans = 0;\n    for (int i = 0; i < nn; i++)\n      for (int j = 0; j < nn; j++)\n        scanf(\"%d \", &a[i][j]);\n    for (int n = nn; n > 1; n--) {\n      int minh[101], minl[101];\n      for (int i = 0; i < n; i++)\n        minh[i] = 1000000;\n      for (int i = 0; i < n; i++)\n        minl[i] = 1000000;\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[i][j] < minh[i])\n            minh[i] = a[i][j];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[i][j] = a[i][j] - minh[i];\n\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          if (a[j][i] < minl[i])\n            minl[i] = a[j][i];\n      for (int i = 0; i < n; i++)\n        for (int j = 0; j < n; j++)\n          a[j][i] = a[j][i] - minl[i];\n\n      ans += a[1][1];\n\n      for (int i = 2; i < n; i++)\n        a[0][i - 1] = a[0][i];\n      for (int i = 2; i < n; i++)\n        a[i - 1][0] = a[i][0];\n\n      for (int i = 2; i < n; i++)\n        for (int j = 2; j < n; j++)\n          a[i - 1][j - 1] = a[i][j];\n    }\n    printf(\"%d\\n\", ans);\n  }\n\n  return 0;\n}\n"}
{"label": "18", "index": "34247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, t, n, i, j, temp, sum, count;\n  cin >> n;\n  int a[101][101];\n  m = n;\n  for (; n > 0; n--) {\n    sum = 0;\n    for (i = 1; i <= m; i++) {\n      for (j = 1; j <= m; j++) {\n        scanf(\"%d\", &a[i][j]);\n      }\n    }\n    t = m;\n    for (; t > 2; t--) {\n      for (i = 1; i <= t; i++) {\n        temp = a[i][1];\n        for (j = 2; j <= t; j++)\n          if (temp > a[i][j]) {\n            temp = a[i][j];\n          }\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i][j] - temp;\n      }\n      for (j = 1; j <= t; j++) {\n        count = 0;\n        for (i = 1; i <= t; i++) {\n          if (a[i][j] == 0) {\n            break;\n          } else\n            count++;\n        }\n        if (count == t) {\n          temp = a[1][j];\n          for (i = 2; i <= t; i++)\n            if (temp > a[i][j]) {\n              temp = a[i][j];\n            }\n          for (i = 1; i <= t; i++)\n            a[i][j] = a[i][j] - temp;\n        } else {\n          continue;\n        }\n      }\n      sum = sum + a[2][2];\n      for (i = 2; i <= t - 1; i++)\n        for (j = 1; j <= t; j++)\n          a[i][j] = a[i + 1][j];\n      for (i = 1; i <= t - 1; i++)\n        for (j = 2; j <= t - 1; j++)\n          a[i][j] = a[i][j + 1];\n    }\n    for (i = 1; i <= 2; i++) {\n      temp = a[i][1];\n      for (j = 2; j <= 2; j++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (j = 1; j <= 2; j++)\n        a[i][j] = a[i][j] - temp;\n    }\n    for (j = 1; j <= 2; j++) {\n      temp = a[1][j];\n      for (i = 2; i <= 2; i++)\n        if (temp > a[i][j]) {\n          temp = a[i][j];\n        }\n      for (i = 1; i <= 2; i++)\n        a[i][j] = a[i][j] - temp;\n    }\n    sum = sum + a[2][2];\n    cout << sum << \" \";\n  }\n}\n"}
{"label": "18", "index": "34248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, a[100][100], N, i, j, k, l, min, sum = 0;\n  cin >> N;\n  for (i = 0; i < N; i++) {\n    for (j = 0; j < N; j++)\n      for (k = 0; k < N; k++)\n        cin >> a[j][k];\n    n = N;\n    for (l = 0; l < N - 1; l++) {\n      for (j = 0; j < n; j++) {\n        min = a[j][0];\n        for (k = 0; k < n; k++) {\n          if (a[j][k] < min)\n            min = a[j][k];\n        }\n        for (k = 0; k < n; k++)\n          a[j][k] = a[j][k] - min;\n      }\n      for (k = 0; k < n; k++) {\n        min = a[0][k];\n        for (j = 0; j < n; j++) {\n          if (a[j][k] < min) {\n            min = a[j][k];\n          }\n        }\n        for (j = 0; j < n; j++) {\n          a[j][k] = a[j][k] - min;\n        }\n      }\n      sum = sum + a[1][1];\n      for (k = 1; k < n - 1; k++)\n        for (j = 0; j < n; j++)\n          a[j][k] = a[j][k + 1];\n      for (j = 1; j < n - 1; j++)\n        for (k = 0; k < n - 1; k++)\n          a[j][k] = a[j + 1][k];\n      n = n - 1;\n    }\n    cout << sum << endl;\n    sum = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  p = s;\n  while (ch != ' ') {\n    scanf(\"%s\", p + i++);\n    ch = getchar();\n  }\n  scanf(\"%s \", a);\n  cin >> b;\n  p = s;\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n  char aword[101];\n  char bword[101];\n  char words[101][101];\n\n  cin >> str;\n  cin >> aword;\n  cin >> bword;\n  int i;\n  int j;\n  int num = 0;\n  int len = strlen(str);\n  for (i = 0; i < len; i++) {\n    j = 0;\n    while (str[i] != ' ') {\n      words[num][j] = str[i];\n      j++;\n      i++;\n    }\n    words[num][j] = '\u0000';\n    num++;\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(words[i], aword) == 0) {\n      strcpy(words[i], bword);\n      continue;\n    }\n  }\n\n  for (j = 0; j < num - 1; j++) {\n    cout << words[j] << \" \";\n  }\n  cout << words[num - 1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34251", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar yuan[100000], yao[110], wei[110];\nint yuanlen, yaolen, weilen;\n\nint main() {\n  char *s;\n  int i, j;\n\n  scanf(\"%s \", yuan);\n\n  cin >> yao;\n\n  cin >> wei;\n  s = strstr(yuan, yao);\n  if (s == NULL || (s[-1] != ' ' && s != yuan)) {\n    puts(yuan);\n    return 0;\n  }\n  yuanlen = strlen(yuan);\n  yaolen = strlen(yao);\n  weilen = strlen(wei);\n  while (s != NULL) {\n    if (yaolen == weilen) {\n      for (i = 0; i < yaolen; i++) {\n        s[i] = wei[i];\n      }\n    }\n    if (yaolen > weilen) {\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n      while (s[i + yaolen - weilen] != 0) {\n        s[i] = s[i + yaolen - weilen];\n        i++;\n      }\n      s[i] = 0;\n    }\n    if (yaolen < weilen) {\n      for (i = yuanlen - 1; i > yaolen - 1; i--)\n        s[i + weilen - yaolen] = s[i];\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n    }\n    s += weilen;\n    s = strstr(s, yao);\n  }\n\n  puts(yuan);\n  return 0;\n}\n"}
{"label": "19", "index": "34252", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[123], a[20], b[20], danci[50][20], *ss = s, *aa = a, *bb = b, *p1, *p2,\n                                            *word[50];\n  int i, j = 0, num;\n  for (i = 0; i < 50; i++)\n    word[i] = danci[i];\n\n  scanf(\"%s \", ss);\n  cin >> aa;\n  cin >> bb;\n  for (p1 = p2 = s;; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      strncpy(word[j], p2, p1 - p2);\n      *(word[j] + (p1 - p2)) = '\u0000';\n      p2 = p1 + 1;\n      j++;\n      if (*p1 == '\u0000')\n        break;\n    }\n  }\n  num = j;\n  for (j = 0; j < num; j++) {\n    if (!strcmp(word[j], aa))\n      strcpy(word[j], bb);\n  }\n  for (j = 0; j < num - 1; j++)\n    printf(\"%s \", word[j]);\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "34253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *a, *b, *s, *p, *t;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (;; s++) {\n    p = a;\n    t = s;\n    while (*s == *p && *s != ' ' && *s != '\u0000') {\n      p++;\n      s++;\n    }\n    if (*s == ' ' && *p == '\u0000') {\n      printf(\"%s\", b);\n      cout << \" \";\n      continue;\n    } else if (*s == '\u0000' && *p == '\u0000') {\n      printf(\"%s\", b);\n      break;\n    }\n    while (*s != ' ' && *s != '\u0000')\n      s++;\n    if (*s == ' ') {\n      for (; *t != ' '; t++)\n        printf(\"%c\", *t);\n      printf(\" \");\n    }\n    if (*s == '\u0000') {\n      for (; *t != '\u0000'; t++)\n        printf(\"%c\", *t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "34254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[103], a[103], b[103], t[103][103];\n  int i, len, start = 0, end = 1, cur = 0, k = 0, w, e;\n\n  int result;\n  char *p = NULL;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  w = strlen(a);\n  e = strlen(b);\n\n  while (end < len) {\n    if (s[end] == ' ' || s[end] == 0) {\n      for (i = start, k = 0; i < end; i++, k++)\n        t[cur][k] = s[i];\n      t[cur][k + 1] = '\u0000';\n      cur++;\n      start = end + 1;\n      end = start + 1;\n    } else\n      end++;\n  }\n\n  for (i = start, k = 0; i < end; i++, k++)\n    t[cur][k] = s[i];\n  t[cur][k + 1] = '\u0000';\n  cur++;\n\n  for (i = 0; i < cur; i++) {\n    if (i == cur - 1) {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s\", b);\n      else\n        cout << t[i];\n    } else {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", t[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "34255", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, k = 0, len;\n  char str1[101], orig[30], tran[30];\n  char str2[50][30];\n  cin.get(str1, 101, '\\n');\n  cin >> orig;\n  scanf(\"%s \", tran);\n\n  while (str1[i] != '\\0') {\n    while (str1[i] != ' ') {\n      str2[j][k] = str1[i];\n      i++;\n      k++;\n    }\n    str2[j][k] = '\\0';\n    j++;\n    i++;\n    k = 0;\n  }\n  len = j - 1;\n  for (i = 0; i <= len; i++) {\n    if (strcmp(str2[i], orig) == 0)\n      strcpy(str2[i], tran);\n  }\n  for (i = 0; i <= len - 1; i++)\n    cout << str2[i] << \" \";\n  printf(\"%s\", str2[len]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34256", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], x[200] = \" \";\n  int i = 0, j = 0, k = 0, count = 0, ls, la, lb, l, end = 0;\n  cin.getline(s, 200);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  ls = strlen(s), la = strlen(a), lb = strlen(b);\n  while (i < ls) {\n    count = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        break;\n      else\n        count++;\n    }\n    if ((count != la) || (i != 0 && count == la && s[i - 1] != ' ')) {\n      x[k] = s[i];\n      k++, i++;\n    } else {\n      i = i + la;\n      end = k + lb;\n      for (; k < end; k++)\n        x[k] = b[k - end + lb];\n    }\n  }\n  printf(\"%s\", x);\n  return 0;\n}\n"}
{"label": "19", "index": "34257", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j = 0, k = 0;\n  char c[100][100] = {'\u0000'};\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[j][k] = s[i];\n      k++;\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else {\n      printf(\" %s\", c[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34258", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *c, *e;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  e = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", c);\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    s = s + strlen(c) + 1;\n    if (s >= e)\n      break;\n    printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34259", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar s[1000];\nchar a[101];\nchar b[101];\nchar buf[101];\n\nint main() {\n  unsigned int i;\n  int index;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  index = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ' || (i == strlen(s) - 1)) {\n      if (i == strlen(s) - 1) {\n        buf[index++] = s[i];\n      }\n      buf[index] = '\u0000';\n      index = 0;\n      if (!strcmp(buf, a)) {\n        printf(\"%s\", b);\n      } else {\n        printf(\"%s\", buf);\n      }\n      if (i != strlen(s) - 1) {\n        printf(\" \");\n      }\n    } else {\n      buf[index++] = s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34260", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[20], c[20], d[20];\n  cin.getline(a, 100);\n  cin.getline(b, 20);\n  cin.getline(c, 20);\n  int i = 0, n = 0, j = 0, k, l = 0;\n  for (; a[i] != 0;) {\n    if (a[i] == 32)\n      i++;\n    for (; a[i] != 32 && a[i] != 0; i++, n++)\n      d[n] = a[i]; \n    d[n] = 0;\n    if (strcmp(b, d) == 0) { \n      for (j = i - n; n > 0; n--)\n        for (k = j; a[k] != 0; k++)\n          a[k] = a[k + 1]; \n      for (; c[l] != 0; l++, j++) {\n        for (k = j; a[k] != 0; k++)\n          ;\n        for (; k >= j; k--)\n          a[k + 1] = a[k];\n        a[j] = c[l]; \n      }\n      l = 0;\n      i = j;\n    } else\n      n = 0;\n  }\n  cout << a;\n}\n"}
{"label": "19", "index": "34261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char word[100][100], a[100], b[100];\n  int i = 0;\n  char tmp;\n\n  while (scanf(\"%s\", word[i]) != EOF) {\n    i++;\n    scanf(\"%c\", &tmp);\n    if (tmp == '\\n')\n      break;\n  }\n  scanf(\"%s%s\", a, b);\n  int j = 0;\n  if (strcmp(word[0], a) != 0) {\n    printf(\"%s\", word[0]);\n  } else {\n    printf(\"%s\", b);\n  }\n  for (j = 1; j < i; j++) {\n    if (strcmp(word[j], a) != 0) {\n      printf(\" %s\", word[j]);\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34262", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k;\n  char a[100][100], b[100], c[100];\n  int n = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    k = getchar();\n    if (k == '\\n')\n      break;\n  }\n  scanf(\"%s\", b);\n  cin >> c;\n  for (i = 0; i < n; i++) {\n    k = strcmp(b, a[i]);\n    if (k == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  printf(\"%s\", a[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34263", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], word1[100], word2[100];\n  int n = 0;\n  int i, j;\n\n  cin >> str1;\n  scanf(\"%s %s\", word1, word2);\n  for (i = 0; i < (int)(strlen(str1)); i++) {\n    for (j = i; j < i + (int)(strlen(word1)); j++) {\n      if (str1[j] != word1[j - i])\n        break;\n      n = n + 1;\n    }\n    if (i == 0 && n == (int)(strlen(word1))) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else if (n == (int)(strlen(word1)) &&\n               (str1[i + n] == 32 || str1[i + n] == '\u0000') && str1[i - 1] == 32) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else\n      printf(\"%c\", str1[i]);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34264", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n\n  scanf(\"%s \", q);\n\n  cin >> a;\n\n  cin >> b;\n  int i = 0, j = 0, k = 0, s = 0, p = 0;\n  for (i = 0; i < 100; i++) {\n    if (q[i] != ' ') {\n      xc[j][i - k] = q[i];\n    }\n    if (q[i] == ' ') {\n      j++;\n      k = i + 1;\n    }\n  }\n  for (s = 0; s < j + 1; s++) {\n    if (strcmp(xc[s], a) == 0) {\n      strcpy(xc[s], b);\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s \", xc[p]);\n  }\n  printf(\"%s\", xc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length_s, length_a, i, j, k;\n  char s[128], a[128], b[128];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  length_s = strlen(s);\n  length_a = strlen(a);\n\n  for (i = 0; i < length_s; i++) {\n    j = 0;\n    if (s[i] == a[j] && (i == 0 || s[i - 1] == ' ')) {\n      k = i;\n      while (s[i] == a[j] && s[i] > 0) {\n        j++;\n        i++;\n      }\n\n      if (j == length_a) {\n        printf(\"%s\", b);\n        i--;\n\n      }\n\n      else {\n        while (k <= i) {\n          printf(\"%c\", s[k]);\n          k++;\n        }\n      }\n\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34266", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], c[100][100], a[100], b[100];\n  char *p[100];\n  int i, j, k, n, t = 1;\n\n  cin >> s;\n  n = strlen(s);\n  cin >> a >> b;\n  for (i = 0; k <= n - 1; i++, k++) {\n    for (j = 0; k <= n - 1; j++, k++) {\n      if (s[k] != 32)\n        c[i][j] = s[k];\n      else {\n        c[i][j] = '\u0000';\n        t++;\n        break;\n      }\n    }\n  }\n  c[t - 1][j + 1] = '\u0000';\n\n  for (i = 0; i < t; i++)\n    p[i] = c[i];\n\n  for (i = 0; i < t; i++)\n    if (strcmp(p[i], a) == 0)\n\n      p[i] = b;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[t - 1]);\n}\n"}
{"label": "19", "index": "34267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[110][110] = {0};\n  int i = 0;\n  while (cin >> A[i]) {\n    i++;\n  }\n  int num;\n  for (int j = 0; j < i - 2; j++) {\n    if (strcmp(A[i - 2], A[j]) == 0) {\n      strcpy(A[j], A[i - 1]);\n    }\n  }\n\n  for (int j = 0; j < i - 3; j++) {\n    cout << A[j] << \" \";\n  }\n  cout << A[i - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "34268", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, k, m;\n  char s[100], a[20], b[20], z[50][20];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0, j = 0, k = 0; i < 100; i++) {\n    if (s[i] == ' ') {\n      z[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      z[j][k] = s[i];\n      k++;\n    }\n    if (s[i] == '\u0000') {\n      z[j][k] = '\u0000';\n      m = j;\n      break;\n    }\n  }\n  for (i = m; i >= 0; i--) {\n    if (strcmp(a, z[i]) == 0)\n      strcpy(z[i], b);\n  }\n  for (i = 0; i <= m; i++) {\n    if (i < m)\n      printf(\"%s \", z[i]);\n    if (i == m)\n      printf(\"%s\", z[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cincd(char a[]) {\n  int num = 0;\n  for (int i = 0;; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n    num++;\n  }\n  return num;\n} \nvoid coutt(char a[], int length) {\n  for (int i = 0; i < length; i++) {\n    cout << a[i];\n  }\n} \nint main() {\n  char a[100][20], b[100], c[100];\n  int x = 0, d[100], e, f, num = 0; \n  for (int j = 0;; j++) {\n    a[x][j] = getchar();\n    if (a[x][j] == '\\n') {\n      d[x] = j;\n      num = x + 1;\n      break;\n    }\n    if (a[x][j] == ' ') {\n      d[x] = j;\n      x++;\n      j = -1;\n    }\n  } \n  e = cincd(b);\n  f = cincd(c);\n  for (int i = 0; i < num; i++) {\n    if (i != 0)\n      cout << \" \";\n    if (d[i] == e) {\n      int length = 0;\n      for (int j = 0; j < e; j++) {\n        if (a[i][j] == b[j])\n          length++;\n      }\n      if (length == e)\n        coutt(c, f); \n      else\n        coutt(a[i], d[i]); \n      continue;\n    } else\n      coutt(a[i], d[i]); \n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34270", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[102], a[101], b[101];\n  char s0[101] = {'\u0000'}, c[101] = {'\u0000'};\n  int i, j = 0, t;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s0[j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' || s[i + 1] == '\u0000') {\n      if (strcmp(s0, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      } else {\n        strcat(c, s0);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      }\n    }\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] == ' ' && c[i + 1] == '\u0000')\n      c[i] = '\u0000';\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "34271", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, k = 0, len;\n  char str1[101], orig[30], tran[30];\n  char str2[50][30];\n  cin.get(str1, 101, '\\n');\n  cin >> orig;\n  scanf(\"%s \", tran);\n\n  while (str1[i] != '\\0') {\n    while (str1[i] != ' ') {\n      str2[j][k] = str1[i];\n      i++;\n      k++;\n    }\n    str2[j][k] = '\\0';\n    j++;\n    i++;\n    k = 0;\n  }\n  len = j - 1;\n  for (i = 0; i <= len; i++) {\n    if (strcmp(str2[i], orig) == 0)\n      strcpy(str2[i], tran);\n  }\n  for (i = 0; i <= len - 1; i++)\n    printf(\"%s \", str2[i]);\n  printf(\"%s\", str2[len]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34272", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k = 0, m = 0;\n  char s[1000], a[101], b[101];\n  char word[30][101];\n  cin.getline(s, 1000);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != ' ') {\n      word[k][m] = s[i];\n      m++;\n    } else {\n      word[k][m] = '\\0';\n      k++;\n      m = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", word[i]);\n  cout << word[k];\n  cin >> k;\n  return 0;\n}\n"}
{"label": "19", "index": "34273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    if (strcmp(x[i], x[n - 2]) == 0)\n      strcpy(x[i], x[n - 1]);\n  }\n  printf(\"%s\", x[0]);\n  for (i = 1; i < n - 2; i++)\n    printf(\" %s\", x[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n  int i = 0, j, t;\n\n  cin >> str;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  do {\n    j = 0;\n    t = i;\n    while (str[i] == a[j] && j < strlen(a)) {\n      i++;\n      j++;\n    }\n    if (j == strlen(a)) {\n      printf(str[i] == '\u0000' ? \"%s\" : \"%s \", b);\n      i++;\n    } else {\n      do {\n        printf(\"%c\", str[t]);\n        t++;\n      } while (str[t] != ' ' && str[t] != '\u0000');\n      if (str[t] == ' ')\n        printf(\" \");\n      i = t + 1;\n    }\n  } while (str[i - 1] != '\u0000');\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    if (strcmp(x[i], x[n - 2]) == 0)\n      strcpy(x[i], x[n - 1]);\n  }\n  cout << x[0];\n  for (i = 1; i < n - 2; i++)\n    printf(\" %s\", x[i]);\n}\n"}
{"label": "19", "index": "34276", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  int j = 0;\n  int begin;\n  int end;\n  char now[101];\n  char sen[1000];\n  char old[101];\n  char newone[101];\n\n  cin >> sen;\n\n  cin >> old;\n\n  cin >> newone;\n  while (sen[i] != '\u0000') {\n    now[j] = sen[i];\n    if (j == 0)\n      begin = i;\n    if (now[j] == ' ' || sen[i + 1] == '\u0000') {\n\n      end = i;\n      if (sen[i + 1] == '\u0000')\n        now[j + 1] = '\u0000';\n      else\n        now[j] = '\u0000';\n      if (strcmp(now, old) == 0) {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", newone);\n        else\n          printf(\"%s \", newone);\n\n      } else {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", now);\n        else\n          printf(\"%s \", now);\n      }\n      j = -1;\n    }\n    i++;\n    j++;\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34277", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char Data[20][20], Word_1[20], Word_2[20];\n  int i, t;\n\n  int get_data(char Data[20][20]);\n  t = get_data(Data);\n  cin >> Word_1;\n  cin >> Word_2;\n\n  if (strcmp(Data[0], Word_1) == 0) {\n    strcpy(Data[0], Word_2);\n  }\n  cout << Data[0];\n  for (i = 1; i < t; i++) {\n    if (strcmp(Data[i], Word_1) == 0) {\n      strcpy(Data[i], Word_2);\n    }\n    cout << ' ' << Data[i];\n  }\n  return 0;\n}\nint get_data(char Data[20][20]) {\n  int i = 0, j = 0;\n  char c;\n  while ((c = getchar()) != '\\n') {\n    if (c == ' ') {\n      Data[i][j] = '\\0';\n      i++;\n      j = 0;\n      continue;\n    }\n    Data[i][j] = c;\n    j++;\n  }\n  Data[i][j] = '\\0';\n  return i + 1;\n}\n"}
{"label": "19", "index": "34278", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar temp[1000];\nchar test[1000][1000];\nchar s[1000];\nchar d[1000];\nchar now[1000];\nint main() {\n  \n  cin.getline(temp, 1000);\n  cin >> s;\n  cin >> d;\n  memset(test, 0, sizeof(test));\n  int length = strlen(temp);\n  int i;\n  int j = 0;\n  int k = 0;\n  for (i = 0; i < length; i++) {\n    if (temp[i] != ' ')\n      now[j++] = temp[i];\n    else {\n      strcpy(test[k], now);\n      memset(now, 0, sizeof(now));\n      j = 0;\n      k++;\n    }\n  }\n  strcpy(test[k], now);\n  for (i = 0; i <= k; i++) {\n    if (strcmp(test[i], s) == 0)\n      strcpy(test[i], d);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i != k)\n      cout << test[i] << \" \";\n    else\n      cout << test[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34279", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char s1[101][101];\n  int i, j, k;\n  k = 0;\n  j = 0;\n  i = 0;\n  int tag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    s1[j][k] = s[i];\n    k++;\n    if (s[i] == ' ') {\n      s1[j][k - 1] = '\u0000';\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  s1[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s1[i], a) == 0) {\n      strcpy(s1[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << s1[i] << \" \";\n  }\n  cout << s1[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34280", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid swap(char *str, char *a, char *b) {\n  char *p1 = str, *p2 = a;\n  int len1, len2, len3, n, i = 0, j, k, m;\n  len1 = strlen(str);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  n = len3 - len2;\n  while (*p1 != '\u0000') {\n    if ((*p1 == *p2) && (!isalpha(*(p1 - 1))))\n      while ((*p1 == *p2) && (*p2 != '\u0000')) {\n        p1++, p2++;\n        i++;\n      }\n    else {\n      p1++;\n      i++;\n    }\n    if ((*p2 == '\u0000') && isalpha(*p1) == 0) {\n      if (n < 0) {\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        for (m = i; m < len1; m++)\n          str[j++] = str[m];\n        while (j < len1)\n          str[j++] = '\u0000';\n        len1 = strlen(str);\n      } else {\n\n        for (m = len1 + n; m > i; m--)\n          str[m] = str[len1--];\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        len1 = strlen(str);\n      }\n    }\n    p2 = a;\n  }\n}\nint main() {\n  char str[1000], a[200], b[200];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  swap(str, a, b);\n  puts(str);\n}\n"}
{"label": "19", "index": "34281", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[101], s2[101];\n  char instead1[101], instead2[101], temp[101];\n\n  scanf(\"%s \", s1);\n  scanf(\"%s \", instead1);\n  cin >> instead2;\n  int i, j, count = 0, countS2 = 0;\n  for (i = 0; i < strlen(s1) + 1; i++) {\n    if (s1[i] != ' ' && s1[i] != '\u0000')\n      temp[count++] = s1[i];\n    else {\n      temp[count] = '\u0000';\n      if (!strcmp(temp, instead1)) {\n        for (j = 0; j < strlen(instead2); j++)\n          s2[countS2++] = instead2[j];\n      } else\n        for (j = i - count; j < i - count + strlen(temp); j++)\n          s2[countS2++] = s1[j];\n      count = 0;\n    }\n    if (s1[i] == ' ')\n      s2[countS2++] = s1[i];\n  }\n  s2[countS2] = '\u0000';\n  printf(\"%s\\n\", s2);\n  return 0;\n}\n"}
{"label": "19", "index": "34282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, tag = 1, flag = 1, e = 0;\n  char q[101], tmp[50][101], p[101], t[101];\n\n  cin >> q;\n\n  cin >> p;\n\n  cin >> t;\n  for (i = 0; i < 50; i++) {\n    k = 0;\n    flag = 1;\n    for (j = e; j < 101; j++) {\n      if (q[j] != ' ' && q[j] != ',' && q[j] != '\u0000') {\n        tmp[i][k] = q[j];\n        k++;\n      } else if (q[j] == ' ') {\n        tmp[i][k] = '\u0000';\n        e = j + 1;\n        break;\n      } else if (q[j] == ',') {\n        tmp[i][k] = '\u0000';\n        e = j + 2;\n        break;\n      } else if (q[j] == '\u0000') {\n        tmp[i][k] = '\u0000';\n        tag = 0;\n        break;\n      }\n    }\n    for (j = 0; j < 101; j++) {\n      if (tmp[i][j] != p[j] && p[j] != '\u0000') {\n        flag = 0;\n        break;\n      } else if (tmp[i][j] == p[j] && p[j] != '\u0000')\n        continue;\n      else if (p[j] == '\u0000')\n        break;\n    }\n    if (tag == 1 && flag == 0 && i > 0)\n      printf(\" %s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i > 0)\n      printf(\" %s\", t);\n    else if (tag == 0 && flag == 0 && i > 0) {\n      printf(\" %s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i > 0) {\n      cout << \" \" << t;\n      break;\n    } else if (tag == 1 && flag == 0 && i == 0)\n      printf(\"%s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i == 0)\n      printf(\"%s\", t);\n    else if (tag == 0 && flag == 0 && i == 0) {\n      printf(\"%s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i == 0) {\n      printf(\"%s\", t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "34283", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], zfc[100][100], a[100], b[100];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int n = strlen(s);\n  int i = 0, j, k = 0;\n  for (j = 0; j <= n; j++) {\n    if (s[j] == ' ' || s[j] == ',' || s[j] == '\u0000') {\n      if (k != 0) {\n        zfc[i][k] = '\u0000';\n        i++;\n      }\n      k = 0;\n    } else {\n      zfc[i][k] = s[j];\n      k++;\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    if (strcmp(zfc[j], a) == 0)\n      strcpy(zfc[j], b);\n    printf(\"%s \", zfc[j]);\n  }\n  if (strcmp(zfc[j], a) == 0) {\n    strcpy(zfc[j], b);\n  }\n  printf(\"%s \", zfc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][20], d[100], b[20], c[20];\n  int n, j = 0, k = 0, flag = 0, x;\n\n  scanf(\"%s \", d);\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(c);\n  for (; x < 20; x++)\n    c[x] = '\u0000';\n  n = strlen(d);\n  for (int i = 0; i < n; i++) {\n    if (d[i] != ' ')\n      a[j][k++] = d[i];\n    else {\n      for (; k < 20;)\n        a[j][k++] = '\u0000';\n      flag = flag + 1;\n      j++;\n      k = 0;\n    }\n  }\n  for (int m = 0; m < 20; m++)\n    if (a[flag][m] == d[n - 1])\n      k = m + 1;\n  for (; k < 20;)\n    a[flag][k++] = '\u0000';\n  for (int p = 0; p < 20; p++)\n    if (strcmp(a[p], b) == 0)\n      strncpy(a[p], c, 20);\n  cout << a[0];\n  for (int l = 1; l < flag + 1; l++)\n    printf(\" %s\", a[l]);\n  return 0;\n}\n"}
{"label": "19", "index": "34285", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100][20];\n  char b;\n  char t[100], h[100];\n  int i, g = 0, result;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c \", &b);\n    g++;\n    if (b == 10)\n      break;\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", h);\n\n  for (i = 0; i < g; i++) {\n    result = strcmp(t, a[i]);\n\n    if (result == 0) {\n      strcpy(a[i], h);\n    }\n  }\n  for (i = 0; i < g - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  i = g - 1;\n  printf(\"%s\", a[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0;\n  char x, y, z, m = 0;\n  char a[100];\n  char b[100][100];\n  char c[100];\n  char d[100];\n\n  cin >> a;\n  scanf(\"%s\", &c);\n  scanf(\"%s\", &d);\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ') {\n      j++;\n      m = 0;\n    } else {\n      b[j][m] = a[i];\n      m++;\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(b[i], c) == 0)\n      strcpy(b[i], d);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", b[i]);\n  printf(\"%s\", b[i]);\n}\n"}
{"label": "19", "index": "34287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char X[20][100];\n  int i, A;\n  int Q;\n  for (i = 0; i < 20; i++) {\n    scanf(\"%s\", X[i]);\n    Q = getchar();\n    if (Q == '\\n') {\n      A = i;\n      break;\n    }\n  }\n  char W[100], Y[100];\n  scanf(\"%s\", W);\n  scanf(\"%s\", Y);\n  for (i = 0; i <= A; i++) {\n    if (strcmp(X[i], W) == 0)\n      strcpy(X[i], Y);\n  }\n  for (i = 0; i <= A; i++) {\n    if (i == 0) {\n      printf(\"%s\", X[0]);\n    } else {\n      printf(\" %s\", X[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[20][100], sub[100], subed[100];\n  char string[500];\n  int i, d1 = 0, d2 = 0, len, n = 1;\n  char(*p)[100];\n\n  scanf(\"%s \", string);\n  len = strlen(string);\n  for (i = 0, d2 = 0; i < len && d2 < 100; i++, d2++) {\n    if (string[i] == ' ') {\n      words[d1][d2] = '\u0000';\n      d1++;\n      n++;\n      d2 = 0;\n    }\n    if (string[i] == ' ')\n      continue;\n    if (string[i - 1] == ' ')\n      d2--;\n    words[d1][d2] = string[i];\n  }\n  words[d1][d2] = '\u0000';\n  p = words;\n  scanf(\"%s\", subed);\n  cin >> sub;\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), subed) == 0)\n      strcpy(*(p + i), sub);\n  for (i = 0; i < n - 1; i++)\n    cout << p + i << \" \";\n  printf(\"%s\", p + n - 1);\n}\n"}
{"label": "19", "index": "34289", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, t[100], at, bt, p;\n  char s[100][100], a[100], b[100];\n  for (i = 0; i < 100; i++) {\n\n    for (j = 0; j < 100; j++) {\n      s[i][j] = cin.get();\n      if (s[i][j] == ' ') {\n        t[i] = j;\n        break;\n      } else if (s[i][j] == '\\n') {\n        t[i] = j;\n        goto loop;\n      }\n    }\n  }\nloop:\n  n = i + 1;\n  for (j = 0; j < 100; j++) {\n    a[j] = cin.get();\n    if (a[j] == '\\n') {\n      at = j;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    b[j] = cin.get();\n    if (b[j] == '\\n') {\n      bt = j;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t[i] == at) {\n      p = 1;\n      for (j = 0; j < at - 1; j++) {\n        p *= s[i][j] - a[j] + 1;\n      }\n      if (p == 1) {\n        for (j = 0; j < bt; j++)\n          s[i][j] = b[j];\n        t[i] = bt;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    else {\n      printf(\" \");\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "34290", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, ls, la, p, f;\n  char s[201], a[101], b[101];\n\n  cin >> s;\n  ls = strlen(s);\n\n  cin >> a;\n  la = strlen(a);\n\n  cin >> b;\n\n  s[ls] = ' ';\n  s[ls + 1] = '\u0000';\n\n  i = -1;\n  while (i < ls) {\n    i++;\n    p = i;\n    while (s[i] != ' ')\n      i++;\n    if (i - p != la) {\n      for (j = p; j < i; j++)\n        printf(\"%c\", s[j]);\n      if (i != ls)\n        printf(\" \");\n      else {\n        printf(\" \");\n        break;\n      }\n    } else {\n      f = 1;\n      for (j = 0; j < la; j++)\n        if (s[p + j] != a[j]) {\n          f = 0;\n          break;\n        }\n      if (f == 1) {\n        printf(\"%s\", b);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n\n      else {\n        for (j = p; j < i; j++)\n          cout << s[j];\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n    }\n  };\n\n  return 0;\n}\n"}
{"label": "19", "index": "34291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j, v, x, c, flag;\n  char str[100], a[10], b[10];\n  cin >> str;\n  cin >> a;\n  scanf(\"%s \", b);\n  v = strlen(str);\n  x = strlen(a);\n  c = strlen(b);\n  str[v] = ' ';\n  flag = x;\n  for (i = 0; i < x; i++) {\n    if (str[i] == a[i]) {\n      flag--;\n    }\n  }\n  if (flag == 0 && str[x] == ' ') {\n    printf(\"%s\", b);\n  } else\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", str[i]);\n    }\n  i = x;\n  while (i < v) {\n    flag = x;\n    for (j = i; j < i + x; j++) {\n      if (str[j] == a[j - i])\n        flag--;\n    }\n    if (flag == 0 && str[i - 1] == ' ' && str[i + x] == ' ') {\n      printf(\"%s\", b);\n      i = i + x;\n    } else {\n      printf(\"%c\", str[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[300], a[300], b[300];\n  int x, y, z, i, k;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (k = 0; k <= x - 1; k++) {\n    int q = 1;\n    for (i = k; q != 9 && i <= k + y - 1; i++) {\n      if (s[i] != a[i - k])\n        q = 9;\n    }\n    if (q == 9)\n      continue;\n    else if (q == 1 && ((s[k - 1] == ' ' && k > 0) || k == 0)) {\n      if (y >= z) {\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n        for (i = k + z; i <= 299; i++)\n          s[i] = s[i + y - z];\n      } else if (y < z) {\n        for (i = 299; i >= k + z; i--)\n          s[i] = s[i + y - z];\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n      }\n    }\n    k += z - 1;\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "34293", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[120];\n  char r[104], f[104];\n  int i, j, k;\n  int nc, nr, nf;\n\n  cin >> c;\n  nc = strlen(c);\n\n  cin >> r;\n  nr = strlen(r);\n\n  cin >> f;\n  nf = strlen(f);\n  i = 0;\n  while (i < nc) {\n    while ((i < nc) && (c[i] == ' ')) {\n      printf(\"%c\", c[i]);\n      i++;\n    }\n    j = i;\n    while ((j < nc) && (c[j] != ' '))\n      j++;\n\n    k = 0;\n    while ((i + k < nc) && (k < nr) && (c[i + k] == r[k])) {\n      k++;\n    }\n    if ((k == nr) && (i + k == j))\n      cout << f;\n    else {\n      for (k = i; k < j; k++) {\n        printf(\"%c\", c[k]);\n      }\n    }\n    i = j;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34294", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100], *p, *q, *r;\n  int i, j = 0, m, e, t;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  for (p = a; p < a + strlen(a); p++) {\n    if (*p != *b ||\n        (*p == *b && (*(p + strlen(b)) != ' ') &&\n         (*p == *b && *(p + strlen(b)) != '\u0000')) ||\n        ((*p == *b && *(p) != *a) && (*p == *b && *(p - 1) != ' '))) {\n      d[j] = *p;\n      j++;\n    } else if (*p == *b &&\n               ((*(p + strlen(b)) == ' ' || *(p + strlen(b)) == '\u0000')) &&\n               (*(p - 1) == ' ' || *p == *a)) {\n      q = p;\n      m = 0;\n      for (i = 0; i < strlen(b); i++) {\n        if (*p != *(b + i)) {\n          m = 1;\n          for (r = q; r <= q + i; r++) {\n            *(d + j) = *r;\n            j++;\n          }\n          break;\n        } else {\n          p++;\n        }\n      }\n      if (m == 0) {\n        p--;\n        for (e = 0; e < strlen(c); e++) {\n          *(d + j) = *(c + e);\n          j++;\n        }\n      }\n    }\n  }\n  for (t = 0; t < j; t++)\n    printf(\"%c\", *(d + t));\n  return 0;\n}\n"}
{"label": "19", "index": "34295", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  char *p1, *p2, *p3, *q1, *q, *q2;\n  int S, A, i, j;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  S = strlen(s);\n  A = strlen(a);\n  q = p1 = s;\n  q2 = p2 = a;\n  p3 = b;\n  for (i = 0; i < S; i++, p1++)\n    if (*p1 == *p2 && (*(p1 - 1) == ' ' || p1 == s)) {\n      q1 = p1;\n      for (j = 0; j < A; j++, p2++, p1++)\n        if (*p1 != *p2)\n          break;\n        else if (j == A - 1 && (*(p1 + 1) == ' ' || *(p1 + 1) == '\u0000')) {\n          for (; q < q1; q++)\n            printf(\"%c\", *q);\n          printf(\"%s\", p3);\n          q = p1 + 1;\n        }\n      p2 = q2;\n    } else if (i == S - 1)\n      printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "19", "index": "34296", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][20], m, b[20], c[20];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      strcpy(a[j], c);\n    }\n  }\n\n  for (j = 0; j < i; j++)\n    printf(\"%s \", a[j]);\n  printf(\"%s\", a[i]);\n}\n"}
{"label": "19", "index": "34297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100], d[200];\n  int i, j, na = 0, nb = 0, nc = 0, m = 0, l = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    na++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; i <= na + x * (nc - nb) - 1; i++) {\n    if (a[i] == b[0]) {\n      l = 1;\n      for (j = 1; j <= nb - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          l = l + 1;\n      }\n      if (((l == nb) && (a[i - 1] == ' ') && (a[i + nb] == ' ')) ||\n          ((i == 0) && (l == nb) && (a[i + nb] == ' ')) ||\n          ((l == nb) && (i >= na + x * (nc - nb) - nb - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + nb; m <= na + 2; m++) {\n          d[m - i - nb] = a[m];\n        }\n        for (m = i; m <= i + nc - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + nc; m <= na + nc - nb + 2; m++) {\n          a[m] = d[m - i - nc];\n        }\n        i = i + nc - nb;\n        x = x + 1;\n      }\n    }\n  }\n  a[na + x * (nc - nb)] = '\u0000';\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "34298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[50][20];\n  char s[100], a[100], b[100], e[100];\n  int i = 0, j = 0, k = 0;\n\n  scanf(\"%s \", s);\n  while (1) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      e[j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      j = 0;\n      k++;\n    } else if (s[i] == '\u0000') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      break;\n    }\n    i++;\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a, word[i]) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    cout << word[i] << \" \";\n  printf(\"%s\", word[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34299", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300] = {'\u0000'}, w1[100], w2[100];\n  char *p, *q;\n\n  cin >> str;\n\n  cin >> w1;\n\n  cin >> w2;\n  p = str;\n  q = str;\n  while (*p != ' ') {\n    p++;\n  }\n  *p = '\u0000';\n\n  if (strcmp(q, w1) == 0) {\n    printf(\"%s\", w2);\n  } else {\n    printf(\"%s\", q);\n  }\n  p++;\n  q = p;\n\n  while (*p != '\u0000') {\n    p++;\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *p = '\u0000';\n\n      printf(\" \");\n      if (strcmp(q, w1) == 0) {\n        printf(\"%s\", w2);\n      } else {\n        printf(\"%s\", q);\n      }\n\n      p++;\n      q = p;\n    }\n  }\n}\n"}
{"label": "19", "index": "34300", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[105], b[105], s[105], c[105][105];\n  int i, len, startp, endp, cur_c, k;\n  cin >> s;\n  cin >> a >> b;\n  len = strlen(s);\n  startp = 0;\n  endp = 1, cur_c = 0;\n  while (endp <= len) {\n    if (s[endp] == ' ' || s[endp] == '\u0000') {\n      for (i = startp, k = 0; i <= endp - 1; i++, k++)\n        c[cur_c][k] = s[i];\n      c[cur_c][k + 1] = '\u0000';\n      cur_c++;\n      startp = endp + 1;\n      endp = startp + 1;\n    } else\n      endp++;\n  }\n  for (i = 0; i < cur_c; i++)\n    if (!strcmp(a, c[i]))\n      strcpy(c[i], b);\n  cout << c[0];\n  for (i = 1; i < cur_c; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100];\n  int i = 0;\n  int len = 0;\n  for (i = 0; i <= 99; i++) {\n    cin >> a[i];\n    len++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  cin >> b >> c;\n  for (i = 0; i <= len - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n    if (i >= 1)\n      cout << \" \";\n    printf(\"%s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34302", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[100][100] = {'\\0'}, c = '\\0', alter[100] = {'\\0'},\n       alter0[100] = {'\\0'};\n  int i = 0, j = 0, sum;\n  while (c != '\\n') {\n    c = getchar();\n    while (c != ' ' && c != '\\n') {\n      word[i][j] = c;\n      c = getchar();\n      j++;\n    }\n    i++;\n    j = 0;\n  }\n  sum = i;\n  cin.getline(alter0, 100, '\\n');\n  cin.getline(alter, 100, '\\n');\n  for (i = 0; i < sum; i++) {\n    j = 0;\n    while (alter0[j] == word[i][j] && j <= 99) {\n      j++;\n    }\n    if (j == 100) {\n      for (j = 0; j < 100; j++) {\n        word[i][j] = alter[j];\n      }\n    }\n  }\n  for (i = 0; i < sum - 1; i++) {\n    printf(\"%s \", word[i]);\n  }\n  cout << word[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, ls, la, p, f;\n  char s[201], a[101], b[101];\n\n  cin >> s;\n  ls = strlen(s);\n\n  cin >> a;\n  la = strlen(a);\n\n  cin >> b;\n\n  s[ls] = ' ';\n  s[ls + 1] = '\u0000';\n\n  i = -1;\n  while (i < ls) {\n    i++;\n    p = i;\n    while (s[i] != ' ')\n      i++;\n    if (i - p != la) {\n      for (j = p; j < i; j++)\n        printf(\"%c\", s[j]);\n      if (i != ls)\n        printf(\" \");\n      else {\n        printf(\" \");\n        break;\n      }\n    } else {\n      f = 1;\n      for (j = 0; j < la; j++)\n        if (s[p + j] != a[j]) {\n          f = 0;\n          break;\n        }\n      if (f == 1) {\n        printf(\"%s\", b);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n\n      else {\n        for (j = p; j < i; j++)\n          printf(\"%c\", s[j]);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n    }\n  };\n\n  return 0;\n}\n"}
{"label": "19", "index": "34304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s[100], *a, *b;\n  int i;\n  for (i = 0;; i++) {\n    s[i] = (char *)calloc(1, 100 * sizeof(char));\n    scanf(\"%s\", s[i]);\n    if (getchar() == '\\n')\n      break;\n  }\n  int n = i;\n  a = (char *)calloc(1, 100 * sizeof(char));\n  b = (char *)calloc(1, 100 * sizeof(char));\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i <= n; i++) {\n    if (i == 0)\n      printf(\"%s\", s[i]);\n    else\n      printf(\" %s\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "34305", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  int i, j, k, ls, la, lb, r;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + la] == 32 || i == ls - 1)) {\n      r = 1;\n      for (k = i, j = 0; j < la; j++, k++) {\n\n        if (s[k] != a[j]) {\n          r = 0;\n          break;\n        }\n      }\n      if (r == 1) {\n        for (k = 0; k < lb; k++) {\n          printf(\"%c\", b[k]);\n        }\n        i = i + la - 1;\n        r = 0;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[5000], w[1000][1000], w1[1000], w2[1000];\n\n  cin >> word;\n\n  cin >> w1;\n\n  cin >> w2;\n  int n, i, j = 0, k = 0, A;\n  n = strlen(word);\n  for (i = 0; i < n; i++) {\n    if (word[i] != ' ') {\n      w[k][j] = word[i];\n      j++;\n      A = 1;\n    }\n    if (word[i] == ' ' && A == 1) {\n      w[k][j] = '\u0000';\n      j = 0;\n      k++;\n      A = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(w1, w[i]) == 0)\n      strcpy(w[i], w2);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", w[i]);\n  }\n  printf(\"%s\", w[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100];\n  int len1 = 0, len2 = 0, len3 = 0, i, j, n = -1, k, flag;\n  cin.getline(s, 101, '\\n');\n  cin.getline(a, 101, '\\n');\n  cin.getline(b, 101, '\\n');\n\n  for (len1 = 0; s[len1] != '\\0'; len1++) {\n    ;\n  }\n  for (len2 = 0; a[len2] != '\\0'; len2++)\n    ;\n  for (len3 = 0; b[len3] != '\\0'; len3++)\n    ;\n\n  for (i = 0; i < len1; i++) {\n    flag = 0;\n    if (((i != 0) && (s[i] == a[0]) && (s[i - 1] == ' ')) ||\n        ((i == 0) && (s[i] == a[0]))) {\n      flag = 1;\n      for (j = 1; j < len2; j++)\n        if (s[i + j] != a[j])\n          flag = 0;\n      if (((i + j) != len1) && (s[i + j] != ' '))\n        flag = 0;\n    }\n\n    if (flag) {\n      k = n + 1;\n      while (n < k + len3 - 1) {\n        n++;\n        c[n] = b[n - k];\n      }\n      i = i + len2 - 1;\n    } else {\n      n++;\n      c[n] = s[i];\n    }\n  }\n  for (i = 0; i <= n; i++)\n    cout << c[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "34308", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf1[110], zfa[110], zfb[110];\n\n  cin >> zf1;\n\n  cin >> zfa;\n\n  cin >> zfb;\n  int x = strlen(zf1);\n  int y = strlen(zfa);\n  int z = strlen(zfb);\n  int i, j;\n  int k = 0, m = 0, g = 0, h = 0;\n  int sz[100];\n  for (i = 0; i < x; i++) {\n    if (i == 0) {\n      if (zf1[i] == zfa[0]) {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n    if (i != 0) {\n      if (zf1[i] == zfa[0] && zf1[i - 1] == ' ') {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n  }\n  for (j = 0; j < x; j++) {\n    h = 0;\n    for (i = 0; i < m; i++) {\n      if (j == sz[i]) {\n        printf(\"%s\", zfb);\n        j = j + y - 1;\n        h = 1;\n        break;\n      }\n    }\n\n    if (h != 1) {\n      cout << zf1[j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0 && s[0] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[j] != a[j])\n          break;\n      if (j == m && s[m] == ' ') {\n        cout << b;\n        i = i + m;\n      }\n    }\n    if (s[i] == ' ' && s[i + 1] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[i + j + 1] != a[j])\n          break;\n      if (j == m && (s[i + j + 1] == ' ' || s[i + j + 1] == '\u0000')) {\n        printf(\" %s\", b);\n        i = i + m + 1;\n      }\n    }\n    if (s[i] != '\u0000')\n      cout << s[i];\n  }\n}\n"}
{"label": "19", "index": "34310", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[103], word[103], rep[103], b[203], i, j;\n  cin.get(a, 101, '\\n');\n  scanf(\"%s %s \", word, rep);\n  int wordlen = strlen(word), alen = strlen(a), replen = strlen(rep);\n  for (i = alen; i > 0; i--)\n    a[i] = a[i - 1];\n  a[0] = ' ';\n  a[alen + 1] = ' ';\n  a[alen + 2] = '\\0';\n  for (i = 1, j = 0; i < alen + 2; i++, j++) {\n    if (a[i - 1] == ' ' && a[i + wordlen] == ' ' &&\n        strncmp(a + i, word, wordlen) == 0) {\n      strcpy(b + j, rep);\n      i = i + wordlen - 1;\n      j = j + replen - 1;\n    } else\n      b[j] = a[i];\n  }\n  b[j - 1] = '\\0';\n  for (i = 0;; i++)\n    if (b[i] != '\\0')\n      printf(\"%c\", b[i]);\n    else\n      break;\n  return 0;\n}\n"}
{"label": "19", "index": "34311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char Sen[200], word[200], exchange[200], temp[200];\n  scanf(\"%s \", Sen);\n  scanf(\"%s \", word);\n  cin >> exchange;\n  int n = strlen(Sen), i;\n  int m;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (Sen[i] != ' ') {\n      temp[m] = Sen[i];\n      m++;\n    } else {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n    if (i == n - 1) {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34312", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  cin >> &sen[1];\n  cin >> &a[1] >> &b[1];\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = a[lena - 1] = b[lenb - 1] = ' ';\n  sen[lensen] = a[lena] = b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else {\n      end[j] = sen[i];\n    }\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[100], b[100];\n\n  int i, j, lengths, lengtha, lengthb, g = 0, k = 0, m;\n  cin.getline(s, 256);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n  a[lengtha] = ' ';\n  for (i = lengtha + 1; i > 0; i--) {\n    a[i] = a[i - 1];\n  }\n  a[0] = ' ';\n  if (s[0] == a[1]) {\n    for (i = 0; i <= lengtha; i++) {\n      a[i] = a[i + 1];\n    }\n    a[lengtha + 1] = 0;\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (g == 0)\n        cout << s[i];\n      if (g == 1) {\n        cout << b;\n        i = i + lengtha - 1;\n      }\n    }\n  } else\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha + 1; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (i + lengtha + 1 == lengths) {\n        for (m = 0; m <= lengtha - 1; m++) {\n          if (s[i + m] == a[m])\n            g = 1;\n          else\n            g = 0;\n          if (g == 0)\n            break;\n        }\n        if (g == 1) {\n          cout << ' ' << b;\n          break;\n        } else\n          cout << s[i];\n      } else {\n        if (g == 0)\n          cout << s[i];\n        if (g == 1) {\n          cout << ' ' << b;\n          i = i + lengtha;\n        }\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34314", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, old[100] = {0}, by[100] = {0};\n  int s1, s2, s3, i, j, k, l = 1, mark[100] = {0};\n  int rem[10] = {0};\n\n  cin >> a;\n  cin >> old;\n  cin >> by;\n  s1 = strlen(a);\n  s2 = strlen(old);\n  s3 = strlen(by);\n  for (i = 0; i < s1; i++) {\n    k = 0;\n    if ((a[i - 1] == ' ' || i == 0) && ((i + s2 == s1) || a[i + s2] == ' ')) {\n      for (j = i; j < i + s2; j++) {\n        if (a[j] == old[j - i]) {\n          k += 1;\n        }\n      }\n      if (k == s2) {\n        for (j = i; j < i + s2; j++)\n          mark[j] = 1;\n        cout << by;\n      }\n    }\n    if (mark[i] > 0) {\n      continue;\n    }\n    cout << a[i];\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34315", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (i != 0) {\n      if (s[i] == ' ') {\n        k = 0;\n        for (j = 0; j < y; j++) {\n          if (s[i + j + 1] != a[j])\n            k = 1;\n        }\n      }\n      if (k == 0) {\n        printf(\" \");\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = i + y;\n      }\n      if (k == 1)\n        printf(\"%c\", s[i]);\n    } else if (i == 0) {\n      k = 0;\n      for (j = 0; j < y; j++) {\n        if (s[j] != a[j])\n          k = 1;\n      }\n      if (k == 0) {\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = y - 1;\n      }\n      if (k == 1)\n        printf(\"%c\", s[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34316", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], aim[101], change[101];\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", aim);\n\n  cin >> change;\n\n  int i;\n  int count;\n  char tword[101];\n  count = 0;\n  tword[count] = '\u0000';\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ' && str[i] != ',') {\n      tword[count] = str[i];\n      count++;\n    } else {\n      tword[count] = '\u0000';\n      if (strcmp(tword, aim) == 0) {\n        printf(\"%s \", change);\n      } else\n        printf(\"%s \", tword);\n      count = 0;\n      tword[count] = '\u0000';\n    }\n  }\n  tword[count] = '\u0000';\n  if (strcmp(tword, aim) == 0) {\n    printf(\"%s\", change);\n  } else\n    printf(\"%s\", tword);\n  return 0;\n}\n"}
{"label": "19", "index": "34317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], strd[20], strb[20];\n  char zfc[50][200];\n\n  scanf(\"%s \", str);\n\n  int i, k;\n  int j = 0, n = 0;\n\n  for (i = 0; str[i] != '\u0000'; i++) {\n\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(zfc[n], (str + j));\n      n++;\n      j = i + 1;\n    }\n  }\n  strcpy(zfc[n], (str + j));\n  n++;\n\n  cin >> strb;\n\n  cin >> strd;\n\n  for (k = 0; k < n; k++) {\n\n    if (strcmp(strb, zfc[k]) == 0)\n      strcpy(zfc[k], strd);\n  }\n\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < n; i++) {\n    cout << \" \" << zfc[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34318", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char word[100][100], a[100], b[100];\n  int i = 0;\n  char tmp;\n\n  while (scanf(\"%s\", word[i]) != EOF) {\n    i++;\n    scanf(\"%c\", &tmp);\n    if (tmp == '\\n')\n      break;\n  }\n  scanf(\"%s%s\", a, b);\n  int j = 0;\n  if (strcmp(word[0], a) != 0) {\n    printf(\"%s\", word[0]);\n  } else {\n    printf(\"%s\", b);\n  }\n  for (j = 1; j < i; j++) {\n    if (strcmp(word[j], a) != 0) {\n      printf(\" %s\", word[j]);\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100], a[100], b[100];\n  char *p[100];\n  int i, j, k, n, t = 1;\n\n  scanf(\"%s \", s);\n  n = strlen(s);\n  scanf(\"%s %s\", a, b);\n  for (i = 0; k <= n - 1; i++, k++) {\n    for (j = 0; k <= n - 1; j++, k++) {\n      if (s[k] != 32)\n        c[i][j] = s[k];\n      else {\n        c[i][j] = '\u0000';\n        t++;\n        break;\n      }\n    }\n  }\n  c[t - 1][j + 1] = '\u0000';\n\n  for (i = 0; i < t; i++)\n    p[i] = c[i];\n\n  for (i = 0; i < t; i++)\n    if (strcmp(p[i], a) == 0)\n\n      p[i] = b;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%s \", p[i]);\n  cout << p[t - 1];\n}\n"}
{"label": "19", "index": "34320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[4][500];\n  int i, j, k, count = 0, len[3] = {0};\n  for (i = 0; i < 3; i++) {\n    cin.getline(str[i], 500);\n    len[i] = strlen(str[i]);\n  }\n\n  for (i = 0; str[0][i] != 0; i++) {\n    if ((i == 0 || (i > 0 && str[0][i - 1] == ' ')) &&\n        ((str[0][i + len[1]] == ' ') || (str[0][i + len[1]] == 0))) {\n      for (j = 0; j < len[1]; j++)\n        if (str[0][i + j] != str[1][j])\n          break;\n\n      if (j == len[1]) {\n        strcpy(str[3], str[0] + i + len[1]);\n        strcpy(str[0] + i + len[2], str[3]);\n\n        for (k = 0; str[2][k] != 0; k++)\n          str[0][i + k] = str[2][k];\n\n        count++;\n      }\n    }\n    str[0][len[0] + count * (len[2] - len[1]) + 1] = 0;\n  }\n\n  cout << str[0] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34321", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zong[2000];\n  char x[200], y[200], words[200][20];\n  int i, j = 0, p = 0, len;\n\n  cin >> zong;\n  cin >> x >> y;\n  len = strlen(zong);\n  for (i = 0; i < len; i++) {\n    if (zong[i] != ' ') {\n      words[j][p] = zong[i];\n      p++;\n    } else {\n      words[j][p] = 0;\n      j++;\n      p = 0;\n    }\n  }\n  words[j][p] = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(words[i], x) == 0)\n      printf(\"%s \", y);\n    else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[j], x) == 0) {\n    printf(\"%s \", y);\n  } else {\n    printf(\"%s \", words[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0] && (a[i - 1] == ' ' || i == 0) &&\n        (a[i + strlen(b)] == ' ' || i + strlen(b) == strlen(a))) {\n      int check = 0;\n      for (int j = 0; j < strlen(b); j++) {\n        if (a[j + i] != b[j]) {\n          check = 1;\n          break;\n        }\n      }\n      if (check == 0) {\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        continue;\n      }\n    }\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char word[50][100];\n  int i, j, num = 1;\n  int count[50] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= strlen(s); i++) {\n    if (s[i] != ' ' && s[i] != '\u0000')\n      count[num]++;\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      for (j = 0; j < count[num]; j++) {\n        word[num][j] = s[i - count[num] + j];\n      }\n      word[num][count[num]] = '\u0000';\n\n      if (s[i] == ' ')\n        num++;\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n    else\n      continue;\n  }\n  for (i = 1; i < num; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s\", word[num]);\n}\n"}
{"label": "19", "index": "34324", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], x[100];\n  int len, n = 0, at = 1, i, j, t = 0, m = 0;\n\n  scanf(\"%s \", s), cin >> a, cin >> b;\n  strcat(s, \" \");\n  len = strlen(s);\n  for (i = 0; i < len + 1; i++) {\n    if (s[i] == ' ') {\n      at = 0;\n    }\n    if (at == 0) {\n      at = 1;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = t;; j++) {\n      if (s[j] != ' ') {\n        x[j - t] = s[j];\n      } else {\n        x[j - t] = '\u0000';\n        t = j + 1;\n        m++;\n        break;\n      }\n    }\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    if (m != n) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, hh, la, lb, ls, same, head, end, l, sum;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  hh = 0;\n  sum = 0;\n  for (i = 0; i < ls; i++) {\n    same = 0;\n    if ((s[i] == a[0]) && (i == 0 || s[i - 1] == ' ')) {\n      l = 1;\n      for (j = 1; j < la; j++) {\n        if (a[j] != s[i + j]) {\n          same = 0;\n          break;\n        }\n        l++;\n        same = 1;\n        head = i;\n        end = i + la - 1;\n      }\n    }\n    if ((same == 1) && (i + la == ls || s[i + la] == ' ')) {\n      for (k = hh; k < head; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lb; k++)\n        printf(\"%c\", b[k]);\n      hh = end + 1;\n      sum = 1;\n    }\n  }\n  if (sum == 0)\n    printf(\"%s\", s);\n\n  if (sum == 1) {\n    for (i = hh; i < ls; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf[600], dc[30][30], y[30], h[30];\n\n  cin >> zf;\n\n  cin >> y;\n\n  cin >> h;\n  int n = strlen(zf), a = 0, b = 0;\n  for (int i = 0; i < n + 1; i++) {\n    if (zf[i] != ' ' && zf[i] != ' ') {\n      dc[a][b] = zf[i];\n      b++;\n    } else {\n      dc[a][b] = '\u0000';\n      a++;\n      b = 0;\n    }\n  }\n  for (int k = 0; k < a + 1; k++) {\n    if (strcmp(dc[k], y) == 0)\n      strcpy(dc[k], h);\n  }\n  cout << dc[0];\n  for (int m = 1; m < a + 1; m++) {\n    printf(\" %s\", dc[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34327", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char sub[101][101];\n  int len = strlen(s);\n  int m = 0, n = 0;\n  for (int i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      sub[m][n] = s[i];\n      n++;\n    }\n    if (s[i] == ' ') {\n      m++;\n      n = 0;\n    }\n  }\n  for (int j = 0; j <= m; j++) {\n    if (strcmp(sub[j], a) == 0) {\n      if (j == 0) {\n        printf(\"%s\", b);\n      }\n      if (j != 0) {\n        cout << \" \" << b;\n      }\n    } else {\n      if (j == 0) {\n        printf(\"%s\", sub[j]);\n      }\n      if (j != 0) {\n        printf(\" %s\", sub[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, sum = 1, j, c[102], k = 0, s;\n  char a[102], b[102], d[102];\n\n  cin >> a + 1;\n  cin >> b + 1;\n  cin >> d + 1;\n  i = 1;\n  j = 1;\n  while (i <= strlen(a + 1) && j <= strlen(b + 1)) {\n    if (a[i] == b[j]) {\n      i++;\n      j++;\n    } else {\n      i = i - j + 2;\n      j = 1;\n    }\n    if (j > strlen(b + 1)) {\n      if ((a[1] == b[1] && a[i] == ' ') ||\n          ((a[i] == ' ' || a[i] == '\u0000') && a[i - j] == ' ')) {\n        c[k] = i - strlen(b + 1);\n        k++;\n      }\n      j = 1;\n    }\n  }\n  c[k] = -1;\n  if (c[0] == -1)\n    for (i = 1; i <= strlen(a + 1); i++)\n      cout << a[i];\n  else {\n    i = 1;\n    s = 0;\n    while (i <= strlen(a + 1)) {\n\n      if (i != c[s]) {\n        cout << a[i];\n        i++;\n      } else {\n        i = i + strlen(b + 1);\n        s++;\n        for (j = 1; j <= strlen(d + 1); j++)\n          cout << d[j];\n      }\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "34329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], t = 1;\n  char tihuan[100][100];\n  int i, j = 0, m = -1, n;\n\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == ' ') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n    }\n    if (a[i] == '\u0000') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n      break;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (strcmp(tihuan[i], b) == 0) {\n      strcpy(tihuan[i], c);\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (t) {\n      printf(\"%s\", tihuan[i]);\n      t = 0;\n    } else\n      printf(\" %s\", tihuan[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34330", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], s1[101], s2[101], s4[101];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  char s3[100][101];\n  char *p;\n  char(*p3)[101];\n  int n, i;\n  n = strlen(s);\n  p = s;\n  p3 = s3;\n  i = 0;\n  for (p = s; p <= (s + n); p++) {\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *((*p3) + i) = '\u0000';\n      p3++;\n      i = 0;\n    } else {\n      *((*p3) + i) = *p;\n      i++;\n    }\n  }\n  *((*p3)) = '\u0000';\n  for (p3 = s3; *((*p3)) != '\u0000'; p3++) {\n    if (strcmp(*p3, s1) == 0) {\n      strcpy(*p3, s2);\n    }\n  }\n  p3 = s3;\n  strcpy(s4, *p3);\n  for (p3 = s3 + 1; *((*p3)) != '\u0000'; p3++) {\n    strcat(s4, \" \");\n    strcat(s4, *p3);\n  }\n  puts(s4);\n}\n"}
{"label": "19", "index": "34331", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << ns[i] << \" \";\n  }\n  cout << ns[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34332", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1, len2, len3;\n  char a[100], b[100], c[100];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  int i, j = 0, m, n, k, space[100];\n  space[0] = 0;\n  for (i = 0; i < len1; i++)\n    if (a[i] == ' ') {\n      j = j + 1;\n      space[j] = i + 1;\n    }\n  for (i = 0; i < j; i++) {\n    k = 0;\n    for (m = space[i]; m < space[i] + len2; m++) {\n      if (a[m] == b[m - space[i]])\n        k = k + 1;\n    }\n    if (k == len2 && a[space[i] + len2] == ' ')\n\n      cout << c << ' ';\n    else {\n      for (n = space[i]; n < space[i + 1]; n++) {\n        cout << a[n];\n      }\n    }\n  }\n  k = 0;\n  for (i = space[j]; i < len1; i++)\n    if (a[i] == b[i - space[j]])\n      k = k + 1;\n  if (k == len2 && len1 - space[j] == len2)\n    printf(\"%s\", c);\n  else {\n    for (n = space[j]; n < len1; n++)\n      cout << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34333", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[100], zfc[20][20], a[20], b[20];\n\n  cin >> sz;\n  scanf(\"%s\", a);\n  cin >> b;\n  int i, j = 0, k = 0;\n  for (i = 0; i <= strlen(sz); i++) {\n    if (sz[i] != '\u0000' && sz[i] != ' ') {\n      zfc[j][k] = sz[i];\n      k++;\n    }\n    if (sz[i] == '\u0000' || sz[i] == ' ') {\n      zfc[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(zfc[i], a) == 0) {\n      strcpy(zfc[i], b);\n    }\n  }\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < j; i++) {\n    printf(\" %s\", zfc[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34334", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n\n  scanf(\"%s \", str);\n  char danci[101][101];\n  int i, k, n, len;\n  k = 0;\n  n = 0;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      danci[n][k] = str[i];\n      k++;\n    } else {\n      danci[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  danci[n][k] = '\u0000';\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int e;\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(danci[i], a) == 0) {\n      strcpy(danci[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s\", danci[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "34335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], a[100], b[100];\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(str);\n  char words[100][100] = {0};\n  for (k = 0; k < n; k++) {\n    if (str[k] != 32) {\n      words[i][j] = str[k];\n      j++;\n    } else if (str[k] == 32) {\n      i++;\n      j = 0;\n    }\n  }\n  m = i + 1;\n  for (i = 0; i < m; i++) {\n    if (strcmp(words[i], a) == 0)\n      strcpy(words[i], b);\n    else\n      continue;\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", words[i]);\n  printf(\"%s \", words[m - 1]);\n}\n"}
{"label": "19", "index": "34336", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1001];\n  char a[1001];\n  char b[1001];\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  cout << ans << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "34337", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], sun[1000];\n  struct sum {\n    char tmp[20];\n  };\n  struct sum s[100];\n\n  scanf(\"%s \", sun);\n\n  cin >> a;\n\n  cin >> b;\n  int i, len, j;\n  len = strlen(sun);\n  sun[len + 1] = ' ';\n\n  int k = 0, n = 0;\n  for (i = 0; i <= len + 1; i++) {\n    if (sun[i] == ' ') {\n      n++;\n      int t;\n      t = i - k;\n      for (j = 0; j < k; j++) {\n\n        s[n].tmp[j] = sun[t];\n        t++;\n      }\n      s[n].tmp[j] = '\u0000';\n      k = 0;\n    } else\n      k++;\n  }\n  s[n].tmp[j - 1] = '\u0000';\n  for (i = 1; i <= n; i++) {\n    if (strcmp(s[i].tmp, a) == 0)\n      strcpy(s[i].tmp, b);\n    if (i != n)\n      printf(\"%s \", s[i].tmp);\n    else\n      cout << s[i].tmp;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34338", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[103], a[103], b[103], s2[210];\n  int alen, slen, blen, i, j;\n  s[0] = a[0] = b[0] = ' ';\n\n  scanf(\"%s \", s);\n  cin >> &a[1] >> &b[1];\n  slen = strlen(s);\n  alen = strlen(a);\n  blen = strlen(b);\n  s[slen] = a[alen] = b[blen] = ' ';\n  s[slen + 1] = a[alen + 1] = b[blen + 1] = '\u0000';\n  for (i = 0, j = 0; i <= slen; i++, j++) {\n    if (strncmp(s + i, a, alen + 1) == 0) {\n      strcpy(s2 + j, b);\n      i = i + alen;\n      j = j + blen;\n    } else\n      s2[j] = s[i];\n  }\n\n  s2[j - 1] = 0;\n  printf(\"%s\\n\", &s2[1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int i, j, n, m, w;\n  char r[200], s[200], t[200];\n\n  cin >> r;\n  cin >> s;\n  cin >> t;\n  p1 = r;\n  p2 = s;\n  n = strlen(s);\n  for (i = 0; *(p1 + i) != '\u0000';) {\n    if (*(p1 + i) != *p2) {\n      printf(\"%c\", *(p1 + i));\n      i++;\n    } else {\n      for (j = 1, w = 1; j < n; j++) {\n        if (*(p1 + i + j) != *(p2 + j)) {\n          for (m = 0; m < j; m++)\n            printf(\"%c\", *(p1 + i + m));\n          break;\n        }\n        w++;\n      }\n      if (w == n) {\n        if (((*(p1 + i + n) == ' ' || *(p1 + i + n) == '\u0000') &&\n             *(p1 + i - 1) == ' ') ||\n            ((i == 0) && *(p1 + n) == ' '))\n          printf(\"%s\", t);\n        else\n          printf(\"%s\", s);\n        i = i + n;\n      } else\n        i = i + j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34340", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int na, nb, nc, i, j, k, p, num = 0;\n\n  char a[1000], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  na = strlen(a);\n  nb = strlen(b);\n  nc = strlen(c);\n\n  for (i = 0; i < 1000; i++) {\n    for (j = 0; j < nb; j++)\n      if (*(a + i + j) != *(b + j))\n        break;\n    if ((j == nb && *(a + i + nb) == ' ' && *(a + i - 1) == ' ') ||\n        (j == nb && i == 0 && *(a + i + nb) == ' ') ||\n        (j == nb && i == na + num * (nc - nb) - nb && *(a + i - 1) == ' ')) {\n      num++;\n      if (nb >= nc) {\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n        for (p = 0; p < na + num * (nc - nb); p++)\n          *(a + i + nc + p) = *(a + i + nb + p);\n      }\n      if (nb < nc) {\n        for (p = ((nc - nb) * num + na - 1); p > i + nb - 1; p--)\n          *(a + p) = *(a + p - (nc - nb));\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n      }\n    }\n  }\n  for (i = 0; i < (na + num * (nc - nb)); i++)\n    printf(\"%c\", *(a + i));\n}\n"}
{"label": "19", "index": "34341", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][100];\n  char c[101], word1[100], replaceword[100];\n\n  cin >> c;\n  cin >> word1;\n  cin >> replaceword;\n  int i, j = 0, k = 0;\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    } else {\n      str[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  str[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], replaceword);\n  }\n  printf(\"%s\", str[0]);\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0;\n  char zfc[101], y[101], x[101], word[101][101];\n\n  cin >> zfc;\n\n  cin >> y;\n\n  cin >> x;\n  for (i = 0; zfc[i] != '\u0000'; i++) {\n    if (zfc[i] != ' ') {\n      word[a][b] = zfc[i];\n      b++;\n    } else {\n      word[a][b] = '\u0000';\n      b = 0;\n      a++;\n    }\n  }\n  word[a][b] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(word[i], y) == 0) {\n      strcpy(word[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s \", word[a]);\n  return 0;\n}\n"}
{"label": "19", "index": "34343", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[100], s[100], d[100], e[30][30];\n  int m = 0, n = 0, l, i;\n  cin >> c;\n  l = strlen(c);\n  cin >> s;\n  cin >> d;\n  for (i = 0; i < (l + 1); i++) {\n    e[m][n] = c[i];\n    n++;\n    if (c[i] == ' ') {\n      e[m][n - 1] = 0;\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i <= m; i++)\n    if (strcmp(s, e[i]) == 0)\n      strcpy(e[i], d);\n  printf(\"%s\", e[0]);\n  for (i = 1; i <= m; i++)\n    cout << \" \" << e[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34344", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100][100];\n  int k = 0, y = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (int i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      t[k][i] = '\u0000';\n      k++;\n      y = i + 1;\n    } else\n      t[k][i - y] = s[i];\n  }\n  for (int j = 0; j <= k; j++) {\n    if (strcmp(t[j], a) == 0)\n      strcpy(t[j], b);\n  }\n  for (int x = 0; x < k; x++)\n    printf(\"%s \", t[x]);\n  printf(\"%s\", t[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[10000], a[100], b[100];\n  int i, lone, ltwo, lthree, k, shuzu[10000] = {0}, p = 0, count[10000];\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  lone = strlen(zfc);\n  ltwo = strlen(a);\n  lthree = strlen(b);\n  for (i = 0; i < lone - ltwo + 1; i++) {\n    if (i == 0) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[ltwo] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else if (i > 0 && i < lone - ltwo) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k + i] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[i + ltwo] == ' ' && zfc[i - 1] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k + i] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[i - 1] == ' ') {\n        shuzu[i] = 1;\n      }\n    }\n  }\n  while (p < lone) {\n    if (shuzu[p] == 0) {\n      printf(\"%c\", zfc[p]);\n    } else {\n      printf(\"%s\", b);\n      p = p + ltwo - 1;\n    }\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n  scanf(\"%s \", s);\n  cin >> w;\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      if (strcmp(h[i], w) == 0) {\n        if (h[i][j] == w[j]) {\n          t = 1;\n        }\n      }\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      cout << h[i][j];\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34347", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[110], zfcsz[110][110];\n  char a[110], b[110];\n  int i, n, k, j;\n\n  scanf(\"%s \", words);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(words);\n  k = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (words[i] != ' ') {\n      zfcsz[k][j] = words[i];\n      j++;\n      if (i == n - 1) {\n        k++;\n        zfcsz[k][j] = '\u0000';\n      }\n    } else {\n      zfcsz[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(zfcsz[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", zfcsz[i]);\n    }\n  }\n  if (strcmp(zfcsz[k - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", zfcsz[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[201], ch[201], ch1[201], str1[201];\n  int s, s1, s2, i, j, g = 0, k;\n  cin.getline(str, 201);\n  cin.getline(ch, 201);\n  cin.getline(ch1, 201);\n  s = strlen(str);\n  s1 = strlen(ch);\n  s2 = strlen(ch1);\n  strcpy(str1, str);\n  for (i = 0; i < s; i++) {\n    g = 0;\n    if (str[i] == ch[0] && ((i == 0) || (str[i - 1] == ' '))) {\n      for (j = i; j < s1 + i; j++) {\n        if (str[j] == ch[j - i])\n          g++;\n      }\n      if (g == s1 && (str[s1 + i] == ' ' || str[s1 + i] == '\\0')) {\n        for (k = 0; k < i; k++)\n          str1[k] = str[k];\n\n        for (k = i; k < i + s2; k++) {\n          str1[k] = ch1[k - i];\n        }\n        for (k = i + s2; k <= s + s2 - s1; k++) {\n          str1[k] = str[k + s1 - s2];\n        }\n        for (k = 0; k <= s + s2 - s1; k++)\n          str[k] = str1[k];\n        s = s + s2 - s1;\n      }\n    }\n  }\n  printf(\"%s\\n\", str1);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf1[110], zfa[110], zfb[110];\n\n  cin >> zf1;\n\n  cin >> zfa;\n\n  cin >> zfb;\n  int x = strlen(zf1);\n  int y = strlen(zfa);\n  int z = strlen(zfb);\n  int i, j;\n  int k = 0, m = 0, h = 0;\n  int sz[100];\n  for (i = 0; i < x; i++) {\n    if (i == 0) {\n      if (zf1[i] == zfa[0]) {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n    if (i != 0) {\n      if (zf1[i] == zfa[0] && zf1[i - 1] == ' ') {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n  }\n  for (j = 0; j < x; j++) {\n    h = 0;\n    for (i = 0; i < m; i++) {\n      if (j == sz[i]) {\n        printf(\"%s\", zfb);\n        j = j + y - 1;\n        h = 1;\n        break;\n      }\n    }\n\n    if (h != 1) {\n      printf(\"%c\", zf1[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1024];\n  char src[1024];\n  char tar[1024];\n  char tmp[1024];\n\n  cin >> str;\n\n  cin >> src;\n\n  cin >> tar;\n\n  int cnt = 0;\n\n  if (str[0] == ' ')\n    putchar(str[0]);\n  else\n    tmp[cnt++] = str[0];\n\n  for (int i = 1; str[i]; i++) {\n\n    if (str[i - 1] == ' ' && str[i] != ' ') {\n      tmp[cnt++] = str[i];\n\n    } else if (str[i] == ' ') {\n      if (cnt > 0) {\n        tmp[cnt] = 0;\n        if (!strcmp(tmp, src))\n          printf(\"%s\", tar);\n        else\n          printf(\"%s\", tmp);\n        cnt = 0;\n      }\n\n      putchar(' ');\n    } else\n      tmp[cnt++] = str[i];\n  }\n  if (cnt > 0) {\n    tmp[cnt] = 0;\n    if (!strcmp(tmp, src))\n      cout << tar;\n    else\n      printf(\"%s\", tmp);\n  }\n  putchar(' ');\n}\n"}
{"label": "19", "index": "34351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100], word[50][15], subword[15], subed[15];\n\n  scanf(\"%s \", string);\n  scanf(\"%s%s\", subed, subword);\n  char *p = string;\n  int i = 0, j;\n  while (*p != '\u0000') {\n    sscanf(p, \"%s\", word[i]);\n    p += strlen(word[i]);\n    i++;\n    if (*p == ' ')\n      p++;\n  }\n  for (j = 0; j < i; j++)\n    if (strcmp(word[j], subed) == 0)\n      strcpy(word[j], subword);\n  cout << word[0];\n  for (j = 1; j < i; j++)\n    cout << \" \" << word[j];\n}\n"}
{"label": "19", "index": "34352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, ls, la, p, f;\n  char s[201], a[101], b[101];\n\n  scanf(\"%s \", s);\n  ls = strlen(s);\n\n  scanf(\"%s \", a);\n  la = strlen(a);\n\n  cin >> b;\n\n  s[ls] = ' ';\n  s[ls + 1] = '\u0000';\n\n  i = -1;\n  while (i < ls) {\n    i++;\n    p = i;\n    while (s[i] != ' ')\n      i++;\n    if (i - p != la) {\n      for (j = p; j < i; j++)\n        printf(\"%c\", s[j]);\n      if (i != ls)\n        printf(\" \");\n      else {\n        printf(\" \");\n        break;\n      }\n    } else {\n      f = 1;\n      for (j = 0; j < la; j++)\n        if (s[p + j] != a[j]) {\n          f = 0;\n          break;\n        }\n      if (f == 1) {\n        printf(\"%s\", b);\n        if (i != ls)\n          printf(\" \");\n        else {\n          cout << \" \";\n          break;\n        }\n      }\n\n      else {\n        for (j = p; j < i; j++)\n          printf(\"%c\", s[j]);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n    }\n  };\n\n  return 0;\n}\n"}
{"label": "19", "index": "34353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char a[50];\n  char b[50];\n  cin.getline(str, 1000);\n  cin.getline(a, 50);\n  cin.getline(b, 50);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    int len = 0, k;\n    for (j = 0; a[j] != '\\0'; j++)\n      if (str[i + j] == a[j] && (str[i - 1] == ' ' && i != 0) || i == 0)\n        len++;\n    if (len == strlen(a) && (str[i + j] == ' ' || str[i + j] == '\\0')) {\n      if (strlen(a) >= strlen(b)) {\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        for (k = i + strlen(b); str[k] != '\\0'; k++)\n          str[k] = str[k + strlen(a) - strlen(b)];\n      } else {\n        for (k = strlen(str) + strlen(b) - strlen(a); k >= i + strlen(a); k--)\n          str[k] = str[k + strlen(a) - strlen(b)];\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        i += strlen(b);\n      }\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "19", "index": "34354", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[100], targ[100], subs[100];\n\n  cin >> sen;\n  cin >> targ;\n  cin >> subs;\n  char *p, *q, *c, *t;\n  int flag = 0;\n  p = sen;\n  c = targ;\n  char output[100] = {0};\n  while (p < sen + strlen(sen)) {\n    c = targ;\n    while (*p++ != targ[0])\n      ;\n    q = p - 1;\n    if (q != sen && *(q - 1) != ' ')\n      continue;\n    p--;\n    while (*c && *p++ == *c++)\n      ;\n    if ((*p == ' ' || *p == 0) && *c == 0)\n      flag = 1;\n    if (flag) {\n      t = p;\n      output[0] = 0;\n      strncpy(output, sen, q - sen);\n      output[q - sen] = 0;\n      strcat(output, subs);\n      strcat(output, t);\n      strcpy(sen, output);\n      p = sen;\n    }\n  }\n  if (!flag) {\n    puts(sen);\n    exit(0);\n  }\n\n  puts(output);\n}\n"}
{"label": "19", "index": "34355", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int l1 = 0, l2 = 0, l3 = 0, i, j, l;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n  while (a[l1] != '\\0')\n    l1++;\n  while (b[l2] != '\\0')\n    l2++;\n  while (c[l3] != '\\0')\n    l3++;\n  l = l1 - l2;\n  for (i = 0; i <= l; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + l2] == ' ' ||\n        i == 0 && a[i + l2] == ' ' || i == l && a[i - 1] == ' ') {\n      int flag = 1;\n      for (j = 0; j < l2; j++)\n        if (a[j + i] != b[j])\n          flag = 0;\n      if (flag) {\n        if (l2 == l3)\n          for (j = 0; j < l2; j++)\n            a[j + i] = c[j];\n        else if (l2 < l3) {\n          for (j = l + l2 - 1; j >= i + l2; j--)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        } else if (l2 > l3) {\n          for (j = i + l2; j < l + l2; j++)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        }\n        i += l3;\n        l += l3 - l2;\n      }\n    }\n  for (i = 0; i < l + l2; i++)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[200];\n  int l1, l2, l3, i, j, k = 0;\n\n  scanf(\"%s \", a);\n  scanf(\"%s%s\", b, c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; i < l1; i++) {\n    if (a[i - 1] == ' ' || i == 0) {\n      for (j = 0; j < l2; j++)\n        if (a[i + j] != b[j])\n          break;\n      if (j == l2) {\n        for (j = 0; j < l3; j++, k++)\n          d[k] = c[j];\n        i = i + l2 - 1;\n      } else {\n        d[k] = a[i];\n        k++;\n      }\n    } else {\n      d[k] = a[i];\n      k++;\n    }\n  }\n  d[k] = '\u0000';\n  cout << d;\n}\n"}
{"label": "19", "index": "34357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char *s, char *a, char *b, int n1, int n2) {\n  int i, j, k, m, n;\n  char c[100];\n  char d[100];\n  for (i = 0, j = 0; *(s + j) != '\u0000';) {\n    int flag = 1;\n    for (m = 0; *(s + j) != ' ' && s[j] != '\u0000'; m++, j++) {\n      d[m] = s[j];\n      if (s[j + 1] == '\u0000')\n        flag = 0;\n    }\n    d[m] = '\u0000';\n    j = j - m;\n    if (strcmp(d, a) != 0) {\n      for (n = 0; n <= m; i++, j++, n++)\n        *(c + i) = *(s + j);\n    } else {\n      for (k = 0, n = 0; n < n2; i++, k++, n++)\n        *(c + i) = *(b + k);\n      j = j + n1;\n    }\n    if (flag == 1)\n      *(c + i) = ' ';\n    else\n      break;\n  }\n  *(c + i) = '\u0000';\n  printf(\"%s\", c);\n}\n\nint main() {\n  char s[100], a[100], b[100];\n  int n1, n2;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  f(s, a, b, n1, n2);\n}\n"}
{"label": "19", "index": "34358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], r[50][20] = {0}, t[100];\n  int i = 0, j, c = 0, l;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  while (i <= l - 1) {\n    j = 0;\n    c++;\n    while (s[i] != ' ' && i <= l - 1) {\n      r[c][j] = s[i];\n      j++;\n      i++;\n    }\n    i++;\n  }\n  for (i = 1; i <= c - 1; i++) {\n    if (strcmp(r[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      cout << r[i] << \" \";\n    }\n  }\n  if (strcmp(r[c], a) == 0) {\n    cout << b;\n  } else {\n    printf(\"%s\", r[c]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *word;\n  int i, j = 0, flag = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  word = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  i = 0;\n  while (*(s + i)) {\n    if (*(s + i) == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      *(word + j) = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      *(word + j) = *(s + i);\n      j++;\n    }\n    i++;\n  }\n  *(word + j) = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n  return 0;\n}\n"}
{"label": "19", "index": "34360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  cin >> zfc;\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n\n  for (i = 0; i < n; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (((i == 0) && (dec == 0)) ||\n        ((dec == 0) &&\n         (zfc[i - 1] == ' ' || zfc[i - 1] == ',' || zfc[i - 1] == '.'))) {\n      printf(\"%s\", rep);\n      i = i + k - 1;\n    } else {\n      cout << zfc[i];\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34361", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  scanf(\"%s\", re);\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  printf(\"%s\", wd[a]);\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "19", "index": "34362", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[200], a[101], b[101];\n  char *ptemp, *pstr, *pa, *pb;\n  int flag, lstr, la, lb;\n  pstr = str;\n  pa = a;\n  pb = b;\n\n  cin >> pstr;\n\n  cin >> pa;\n\n  cin >> pb;\n  lstr = strlen(pstr);\n  la = strlen(pa);\n  lb = strlen(pb);\n  for (; pstr <= str + lstr - 1; pstr++) {\n    flag = 1;\n    while ((*pstr != ' ') && (*pstr != '\u0000')) {\n      if (*pstr != *pa)\n        flag = 0;\n      pstr++;\n      pa++;\n    }\n    if ((flag) && (pa == a + la)) {\n      ptemp = pstr;\n      if (la < lb) \n      {\n        for (pstr = str + lstr; pstr >= ptemp; pstr--)\n          *(pstr + lb - la) = *pstr;\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr + lb - la;\n      }\n      if (la >= lb) \n      {\n        for (pstr = ptemp - la + lb; pstr <= str + lstr - la + lb; pstr++)\n          *pstr = *(pstr + la - lb);\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr - la + lb;\n      }\n    }\n    pa = a;\n  }\n  pstr = str;\n  printf(\"%s\", pstr);\n}\n"}
{"label": "19", "index": "34363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[300];\n\n  scanf(\"%s \", string);\n  char a[200], b[200];\n  scanf(\"%s %s\", a, b);\n\n  char word[200][200];\n  int n1, n2, i, k;\n  int m = 0;\n  int p = 0;\n  n1 = strlen(string);\n  for (i = 0; i < n1; i++) {\n    if (string[i] == ' ') {\n      m++;\n      p = 0;\n    } else {\n      word[m][p] = string[i];\n      p++;\n    }\n  }\n\n  if (strcmp(word[0], a) == 0)\n    cout << b;\n  else\n    printf(\"%s\", word[0]);\n\n  for (k = 1; k <= m; k++) {\n    if (strcmp(word[k], a) == 0)\n      printf(\" %s\", b);\n    else\n      printf(\" %s\", word[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[123], a[20], b[20], danci[50][20], *ss = s, *aa = a, *bb = b, *p1, *p2,\n                                            *word[50];\n  int i, j = 0, num;\n  for (i = 0; i < 50; i++)\n    word[i] = danci[i];\n\n  cin >> ss;\n  cin >> aa;\n  cin >> bb;\n  for (p1 = p2 = s;; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      strncpy(word[j], p2, p1 - p2);\n      *(word[j] + (p1 - p2)) = '\u0000';\n      p2 = p1 + 1;\n      j++;\n      if (*p1 == '\u0000')\n        break;\n    }\n  }\n  num = j;\n  for (j = 0; j < num; j++) {\n    if (!strcmp(word[j], aa))\n      strcpy(word[j], bb);\n  }\n  for (j = 0; j < num - 1; j++)\n    printf(\"%s \", word[j]);\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "34365", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint jianyan[1000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i, j = 0, v = 0, count_jianyan = 0, l = strlen(a), l_sub = strlen(sub);\n  for (int r = 0; r < l; r++) {\n    if (a[r] == ' ') {\n      jianyan[count_jianyan] = r;\n      count_jianyan++;\n    }\n  }\n  for (int u = 0; u < l_sub; u++) {\n    if (a[u] == sub[u]) {\n      b[0]++;\n    }\n  }\n  while (v < count_jianyan) {\n    i = jianyan[v] + 1;\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j]) {\n        b[i]++;\n      }\n    }\n    v++;\n  }\n  int k = 0, w[1000], count = 0;\n  for (int gl = 0; gl < 1000; gl++) {\n    w[gl] = 999;\n  }\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w[count] = k;\n      count++;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0, m = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w[m]) {\n        printf(\"%s\", c);\n        q += l_sub;\n        m++;\n      }\n      if (q != l) {\n        cout << a[q];\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34366", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], str[200][20], rep[20], sub[20];\n  int i, sum = 0, a = 0, b = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      str[a][b] = '\u0000';\n      a++;\n      b = 0;\n      sum++;\n    } else {\n      str[a][b] = s[i];\n      b++;\n    }\n  }\n\n  str[a][b] = '\u0000';\n  for (a = 0; a <= sum; a++) {\n    if (strcmp(str[a], sub) == 0) {\n      strcpy(str[a], rep);\n    } else {\n      continue;\n    }\n  }\n  for (a = 0; a < sum; a++) {\n    cout << str[a] << \" \";\n  }\n  cout << str[sum];\n  return 0;\n}\n"}
{"label": "19", "index": "34367", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100], a[100], b[100];\n  char *p[100];\n  int i, j, k, m, n, t = 1;\n\n  cin >> s;\n  n = strlen(s);\n  scanf(\"%s %s\", a, b);\n  for (i = 0; k <= n - 1; i++, k++) {\n    for (j = 0; k <= n - 1; j++, k++) {\n      if (s[k] != 32)\n        c[i][j] = s[k];\n      else {\n        c[i][j] = '\u0000';\n        t++; \n        break;\n      }\n    }\n  }\n  c[t - 1][j + 1] = '\u0000';\n  \n  \n  for (i = 0; i < t; i++)\n    p[i] = c[i];\n  \n  for (i = 0; i < t; i++)\n    if (strcmp(p[i], a) == 0)\n\n      p[i] = b;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[t - 1]);\n}\n"}
{"label": "19", "index": "34368", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char s[10000], ch[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    for (j = 0; (s[i] != ' ' && s[i] != '\u0000'); i++, j++)\n      ch[j] = s[i];\n    ch[j] = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      ch[k] = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "34369", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  scanf(\"%s \", s);\n  cin >> a;\n  scanf(\"%s \", b);\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (i != 0) {\n      if (s[i] == ' ') {\n        k = 0;\n        for (j = 0; j < y; j++) {\n          if (s[i + j + 1] != a[j])\n            k = 1;\n        }\n      }\n      if (k == 0) {\n        printf(\" \");\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = i + y;\n      }\n      if (k == 1)\n        printf(\"%c\", s[i]);\n    } else if (i == 0) {\n      k = 0;\n      for (j = 0; j < y; j++) {\n        if (s[j] != a[j])\n          k = 1;\n      }\n      if (k == 0) {\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = y - 1;\n      }\n      if (k == 1)\n        printf(\"%c\", s[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34370", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(char *p, char a[], int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    if (*(p + i) != a[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char s[200], r[200], a[101], b[101];\n  int i = 0, j, ls, la, lb, count = 0, p = 1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  if (a[0] == s[0])\n    if (check(&s[0], a, la) == 1 && s[i + la] == ' ') {\n      for (j = 0; j < lb; j++) {\n        r[count] = b[j];\n        count++;\n      }\n      p = i + la;\n\n    } else {\n      r[count] = s[0];\n      count++;\n    }\n  else {\n    r[count] = s[0];\n    count++;\n  }\n  for (i = p; i < ls; i++) {\n    if (a[0] == s[i])\n      if (check(&s[i], a, la) == 1 &&\n          (s[i - 1] == ' ' && (s[i + la] == ' ' || s[i + la] == '\u0000'))) {\n        for (j = 0; j < lb; j++) {\n          r[count] = b[j];\n          count++;\n        }\n        i = i + la - 1;\n        continue;\n      } else {\n        r[count] = s[i];\n        count++;\n        continue;\n      }\n    else {\n      r[count] = s[i];\n      count++;\n    }\n  }\n  r[count] = '\u0000';\n  printf(\"%s\", r);\n}\n"}
{"label": "19", "index": "34371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int ls, la, lb, i, j, m;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && s[i - 1] == ' ' || s[0] == a[0]) {\n      m = 1;\n      for (j = 1; j < la; j++) {\n        if (s[i + j] != a[j]) {\n          m = 2;\n        }\n      }\n      if (m == 1) {\n        char x[100];\n        strcpy(x, s);\n        for (j = i; j < i + lb; j++) {\n          s[j] = b[j - i];\n        }\n        for (j = i + lb; j < ls + lb - la; j++) {\n          s[j] = x[j - lb + la];\n        }\n        ls = ls - la + lb;\n        i = i + lb - 1;\n      }\n    }\n  }\n  for (i = 0; i < ls; i++)\n    cout << s[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "34372", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, n3, i, j;\n  char a1[100] = {'\u0000'}, a2[100] = {'\u0000'}, a3[100] = {'\u0000'};\n  char *p1 = &a1[0], *p2 = &a2[0], *p3 = &a3[0], *p_end, *p_in = &a1[0], *p,\n       *p_cyc = &a1[0];\n\n  scanf(\"%s \", a1);\n\n  cin >> a2;\n\n  cin >> a3;\n  n1 = strlen(a1);\n  n2 = strlen(a2);\n  n3 = strlen(a3);\n  p_end = &a1[n1 - 1];\n  for (p1 = &a1[0]; p1 <= p_end; p1++) {\n    if (*p2 == *p1) {\n      p_in = p1;\n      for (j = 0; j < n2; j++) {\n        if (*p2 != *p1) {\n          p1--;\n          break;\n        } else {\n          p2++;\n          p1++;\n        }\n      }\n      p2 = &a2[0];\n      if (j == n2 && *(p_in - 1) == ' ') {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      } else if (j == n2 && p_in == &a1[0]) {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      }\n\n      p3 = &a3[0];\n    }\n  }\n  for (p = &a1[0]; p <= p_end; p++) {\n    printf(\"%c\", *p);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100],\n      C[100][100];           \n  int i, j = 0, a = 0, l;    \n  cin.getline(A, 100, '\\n'); \n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  l = strlen(A);\n  for (i = 0; i < l; i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    l = strcmp(C[i], B);\n    if (l == 0)        \n      strcpy(C[i], T); \n  }\n  for (i = 0; i < j; i++) \n    cout << C[i] << \" \";\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, k, m;\n  char s[100], a[20], b[20], z[50][20];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0, j = 0, k = 0; i < 100; i++) {\n    if (s[i] == ' ') {\n      z[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      z[j][k] = s[i];\n      k++;\n    }\n    if (s[i] == '\u0000') {\n      z[j][k] = '\u0000';\n      m = j;\n      break;\n    }\n  }\n  for (i = m; i >= 0; i--) {\n    if (strcmp(a, z[i]) == 0)\n      strcpy(z[i], b);\n  }\n  for (i = 0; i <= m; i++) {\n    if (i < m)\n      cout << z[i] << \" \";\n    if (i == m)\n      cout << z[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid huan(int start, char W[100], char B[100], int Len1, int Len2, int Len3,\n          int t) {\n  int i, k;\n  char WW[100];\n  for (i = 0; i < start; i++)\n    WW[i] = W[i];\n  for (i = start, k = 0; i < start + Len3; i++, k++)\n    WW[i] = B[k];\n  for (i = start + Len3; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    WW[i] = W[i + Len2 - Len3];\n  for (i = 0; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    W[i] = WW[i];\n}\n\nint main() {\n  char whole[100];\n  char a[100];\n  char b[100];\n  char gai[100];\n\n  scanf(\"%s \", whole);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t;\n  int len1;\n  int len2;\n  int len3;\n  len1 = strlen(whole);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  int judge;\n  int begin[100];\n  t = 0;\n  if (whole[0] != a[0]) {\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  } else {\n    t = 1;\n    begin[0] = 0;\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  }\n\n  if (len1 >= len2) {\n    int u;\n    for (i = t - 1, u = 1; i >= 0; i--, u++) {\n      huan(begin[i], whole, b, len1, len2, len3, u);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (u - 1) + len3 * (u - 1); i++)\n      cout << whole[i];\n\n  } else {\n    int v;\n    for (i = 0, v = 1; i <= t - 1; i++, v++) {\n      huan(begin[i], whole, b, len1, len2, len3, v);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (v - 1) + len3 * (v - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34376", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char a[50];\n  char b[50];\n  cin.getline(str, 1000);\n  cin.getline(a, 50);\n  cin.getline(b, 50);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    int len = 0, k;\n    for (j = 0; a[j] != '\\0'; j++)\n      if (str[i + j] == a[j] && (str[i - 1] == ' ' && i != 0) || i == 0)\n        len++;\n    if (len == strlen(a) && (str[i + j] == ' ' || str[i + j] == '\\0')) {\n      if (strlen(a) >= strlen(b)) {\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        for (k = i + strlen(b); str[k] != '\\0'; k++)\n          str[k] = str[k + strlen(a) - strlen(b)];\n      } else {\n        for (k = strlen(str) + strlen(b) - strlen(a); k >= i + strlen(a); k--)\n          str[k] = str[k + strlen(a) - strlen(b)];\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        i += strlen(b);\n      }\n    }\n  }\n  cout << str << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34377", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100];\n  char word[100][100], a[100], b[100];\n  char *p[100];\n  char *p1, *p2;\n  int i, j, k, strl, al, bl;\n\n  scanf(\"%s \", string);\n\n  cin >> a;\n\n  cin >> b;\n  p1 = a;\n  p2 = b;\n  strl = strlen(string);\n  al = strlen(a);\n  bl = strlen(b);\n  j = 0;\n  k = 0;\n  for (i = 0; i < strl; i++)\n    if (string[i] != 32) {\n      word[j][k] = string[i];\n      if (string[i + 1] != 32)\n        k++;\n      else if (string[i + 1] == 32 || string[i + 1] == '\u0000') {\n        word[j][k + 1] = '\u0000';\n        k = 0;\n        j++;\n      }\n    }\n  for (i = 0; i < j + 1; i++)\n    p[i] = word[i];\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(p1, *(p + i)) == 0)\n      p[i] = p2;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[j]);\n}\n"}
{"label": "19", "index": "34378", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *q;\n  s = (char *)malloc(100);\n  a = (char *)malloc(100);\n  b = (char *)malloc(100);\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  for (p = s;; p++) {\n    if (*p == '\u0000') {\n      if (strcmp(q, a) == 0) {\n        printf(\"%s\", b);\n        break;\n      }\n      printf(\"%s\", q);\n      break;\n    }\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, a) == 0)\n        printf(\"%s \", b);\n      else {\n        printf(\"%s \", q);\n      }\n      q = p + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34379", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[100], a[100], b[100], c[100][100];\n  int i, n[100], k, m, j = 0;\n  n[0] = -1;\n\n  cin >> ch;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; ch[i] != '\u0000'; i++) {\n    if (ch[i] == ' ') {\n      j++;\n      n[j] = i;\n      for (k = 0, m = n[j - 1] + 1; k < i - n[j - 1] - 1 && m < i; k++, m++)\n        c[j][k] = ch[m];\n    }\n    continue;\n  }\n  for (i = n[j] + 1; ch[i] != '\u0000'; i++)\n    c[j + 1][i - 1 - n[j]] = ch[i];\n  for (m = 1; m <= j + 1; m++)\n    if (strcmp(c[m], a) == 0)\n      strcpy(c[m], b);\n  for (m = 1; m <= j; m++)\n    printf(\"%s \", c[m]);\n  printf(\"%s\", c[j + 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34380", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  int la, lb;\n  char *p;\n  char t[101];\n  char *ss;\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  ss = s;\n  while ((p = strstr(ss, a)) != NULL) {\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == ' ')) {\n      strcpy(t, p + la + 1);\n      strcpy(p, b);\n      *(p + lb) = ' ';\n      strcpy(p + lb + 1, t);\n    }\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == '\u0000')) {\n      strcpy(p, b);\n      *(p + lb) = '\u0000';\n    }\n    ss = p + la + 1;\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34381", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[50], e[50];\n  int c[1000], d[1000];\n  int i, n, flag1 = 0, j = 0, m, k, x, l, flag2 = 0, g;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  n = strlen(a);\n  x = strlen(b);\n  d[0] = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ' && flag1 == 0) {\n      c[j] = i;\n      d[j + 1] = i + 1;\n      j++;\n      flag1 = 1;\n      m = i;\n    } else {\n      if (a[i] == ' ') {\n        c[j] = i - m - 1;\n        d[j + 1] = i + 1;\n        j++;\n        m = i;\n      }\n    }\n  }\n  c[j] = n - 1 - m;\n  k = j + 1;\n  for (j = 0; j < k; j++) {\n\n    if (c[j] == x) {\n      g = 0;\n      for (l = d[j]; l < d[j] + c[j]; l++, g++) {\n        if (b[g] != a[l])\n          flag2 = 1;\n      }\n      g = 0;\n      if (flag2 == 0) {\n        if (j == 0)\n          printf(\"%s\", e);\n        else\n          printf(\" %s\", e);\n      } else {\n        if (j == 0)\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        else {\n          cout << \" \";\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        }\n      }\n      flag2 = 0;\n    } else {\n      if (j == 0)\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      else {\n        printf(\" \");\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34382", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i, j, len1, len2, count = 0, sum = 0;\n  char str[100][100];\n  while (cin >> str[++n])\n    if (str[n][0] == '0')\n      break;\n  n--;\n  \n  for (i = 1; i < n - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(str[i], str[n - 1]) == 0)\n      cout << str[n];\n    else\n      cout << str[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34383", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300] = {'\u0000'}, w1[100], w2[100];\n  char *p, *q;\n\n  cin >> str;\n\n  cin >> w1;\n\n  cin >> w2;\n  p = str;\n  q = str;\n  while (*p != ' ') {\n    p++;\n  }\n  *p = '\u0000';\n\n  if (strcmp(q, w1) == 0) {\n    printf(\"%s\", w2);\n  } else {\n    printf(\"%s\", q);\n  }\n  p++;\n  q = p;\n\n  while (*p != '\u0000') {\n    p++;\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *p = '\u0000';\n\n      printf(\" \");\n      if (strcmp(q, w1) == 0) {\n        printf(\"%s\", w2);\n      } else {\n        printf(\"%s\", q);\n      }\n\n      p++;\n      q = p;\n    }\n  }\n}\n"}
{"label": "19", "index": "34384", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][101];\n  char a[101], b[101];\n  int i, j;\n  scanf(\"%s\", s[0]);\n  for (i = 1; getchar() != ' '; i++) {\n    scanf(\"%s\", s[i]);\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (j = 0; j < i; j++) {\n    if (strcmp(s[j], a) == 0)\n      strcpy(s[j], b);\n  }\n  printf(\"%s\", s[0]);\n  for (j = 1; j < i; j++) {\n    printf(\" %s\", s[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i - 2;\n  for (i = 0; i < n; i++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(x[i], x[n]) == 0)\n      printf(\"%s\", x[n + 1]);\n    else\n      printf(\"%s\", x[i]);\n    j++;\n  }\n}\n"}
{"label": "19", "index": "34386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100];\n  int i = 0, j;\n  *(p + i) = (char *)malloc(100);\n  while (scanf(\"%s\", *(p + i)) != EOF) {\n    i++;\n    *(p + i) = (char *)malloc(100);\n  }\n  for (j = 0; j < i - 2; j++) {\n    if (strcmp(*(p + j), *(p + i - 2)) == 0)\n      strcpy(*(p + j), *(p + i - 1));\n  }\n  printf(\"%s\", *p);\n  for (j = 1; j < i - 2; j++)\n    printf(\" %s\", *(p + j));\n}\n"}
{"label": "19", "index": "34387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  printf(\"%s\", ns[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34388", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void CONVERT(char c[100], char d[100], char B, int N, int x);\n  int m, n, l, i, j, k[100], t;\n  char s[100], a[100], b[100];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  l = strlen(b);\n  for (i = 0; i < m; i++) {\n    k[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    t = k[i];\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i]) {\n        k[i] = 1;\n      } else {\n        k[i] = t;\n        break;\n      }\n    }\n    if ((s[i - 1] != ' ') && (i != 0))\n      k[i] = t;\n    if (k[i] == 1)\n      for (j = i + 1; j < i + n; j++) {\n        k[j] = 2;\n      }\n  }\n  for (i = 0; i < m; i++) {\n    if (k[i] == 1) {\n      for (j = 0; j < l; j++) {\n        printf(\"%c\", b[j]);\n      }\n    }\n    if (k[i] == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34389", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, count = -1, pos[51], k = 0;\n  char a[51][101], b[101], c[101], d;\n  while (1) {\n    cin >> a[i];\n    i++;\n    if (d = cin.get(), d == '\\n')\n      break;\n  }\n  i--;\n  cin >> b >> c;\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      count++;\n      pos[count] = j;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if ((k <= count) && (pos[k] == j)) {\n      if (j == i) {\n        printf(\"%s\", c);\n      } else\n        cout << c << \" \";\n      k++;\n    } else {\n      if (j == i)\n        cout << a[j];\n      else\n        cout << a[j] << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34390", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], ans[100], temp[100];\n  int i, j, templ, tempans;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  templ = 0;\n  tempans = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      temp[templ] = '\u0000';\n      if (strcmp(temp, a) == 0) {\n        for (j = 0; j < strlen(b); j++) {\n          ans[tempans] = b[j];\n          tempans++;\n        }\n      } else {\n        for (j = 0; j < templ; j++) {\n          ans[tempans] = temp[j];\n          tempans++;\n        }\n      }\n      ans[tempans] = ' ';\n      tempans++;\n      templ = 0;\n      continue;\n    }\n    temp[templ] = s[i];\n    templ++;\n  }\n  temp[templ] = '\u0000';\n  if (strcmp(temp, a) == 0) {\n    for (j = 0; j < strlen(b); j++) {\n      ans[tempans] = b[j];\n      tempans++;\n    }\n  } else {\n    for (j = 0; j < templ; j++) {\n      ans[tempans] = temp[j];\n      tempans++;\n    }\n  }\n  ans[tempans] = '\u0000';\n  cout << ans;\n  return 0;\n}\n"}
{"label": "19", "index": "34391", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], str[200][20], rep[20], sub[20];\n  int i, sum = 0, a = 0, b = 0, max = 0, min = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      str[a][b] = '\u0000';\n      a++;\n      b = 0;\n      sum++;\n    } else {\n      str[a][b] = s[i];\n      b++;\n    }\n  }\n\n  str[a][b] = '\u0000';\n  for (a = 0; a <= sum; a++) {\n    if (strcmp(str[a], sub) == 0) {\n      strcpy(str[a], rep);\n    } else {\n      continue;\n    }\n  }\n  for (a = 0; a < sum; a++) {\n    cout << str[a] << \" \";\n  }\n  printf(\"%s\", str[sum]);\n  return 0;\n}\n"}
{"label": "19", "index": "34392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++) {\n    c[i] = '\u0000';\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n  }\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int l, m;\n    char ch[101];\n    for (m = 0; m <= 100; m++) {\n      ch[m] = '\u0000';\n    }\n    l = n[i] - n[i - 1] - 1;\n    for (m = 0; m <= (l - 1); m++) {\n      ch[m] = c[n[i - 1] + m + 1];\n    }\n    if (strcmp(a, ch) == 0) {\n      strcat(s, b);\n    } else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "34393", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  cin >> &sen[1];\n  cin >> &a[1] >> &b[1];\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = a[lena - 1] = b[lenb - 1] = ' ';\n  sen[lensen] = a[lena] = b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else\n      end[j] = sen[i];\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34394", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct node {\n  char str[110];\n} all[110];\n\nint main() {\n  char s[110], str[110], word[110], one[110];\n  int i, j, k;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", str);\n\n  cin >> word;\n\n  for (k = 0, j = 0, i = 0;; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      one[j] = '\u0000';\n      strcpy(all[k].str, one);\n      j = 0;\n      k++;\n      if (s[i] == '\u0000')\n        break;\n      continue;\n    }\n    one[j++] = s[i];\n  }\n\n  for (i = 0; i < k; i++) {\n    if (strcmp(all[i].str, str) == 0)\n      strcpy(all[i].str, word);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (i < k - 1)\n      printf(\"%s \", all[i].str);\n    else\n      cout << all[i].str;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34395", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101][101] = {0}, b[101], c[101];\n  int i, j;\n  for (j = 0;; j++) {\n    scanf(\"%s\", a[j]);\n\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < 101; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", a[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34396", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], d[100], b[100][50];\n  int i, j = 0, k = 0, n, m, l;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  cin >> d;\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      b[j][k] = s[i];\n      k++;\n    } else {\n      b[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  b[j][k] = '\u0000';\n  for (m = 0; m < j + 1; m++) {\n    l = strcmp(a, b[m]);\n    if (l == 0)\n      strcpy(b[m], d);\n    if (m == 0)\n      printf(\"%s\", b[m]);\n    else\n      printf(\" %s\", b[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[4][500];\n  int i, j, k, count = 0, len[3] = {0};\n  for (i = 0; i < 3; i++) {\n    cin.getline(str[i], 500);\n    len[i] = strlen(str[i]);\n  }\n\n  for (i = 0; str[0][i] != 0; i++) {\n    if ((i == 0 || (i > 0 && str[0][i - 1] == ' ')) &&\n        ((str[0][i + len[1]] == ' ') || (str[0][i + len[1]] == 0))) {\n      for (j = 0; j < len[1]; j++)\n        if (str[0][i + j] != str[1][j])\n          break;\n\n      if (j == len[1]) {\n        strcpy(str[3], str[0] + i + len[1]);\n        strcpy(str[0] + i + len[2], str[3]);\n\n        for (k = 0; str[2][k] != 0; k++)\n          str[0][i + k] = str[2][k];\n\n        count++;\n      }\n    }\n    str[0][len[0] + count * (len[2] - len[1]) + 1] = 0;\n  }\n\n  cout << str[0] << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "34398", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, count = -1, pos[51], k = 0;\n  char a[51][101], b[101], c[101], d;\n  while (1) {\n    cin >> a[i];\n    i++;\n    if (d = cin.get(), d == '\\n')\n      break;\n  }\n  i--;\n  cin >> b >> c;\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      count++;\n      pos[count] = j;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if ((k <= count) && (pos[k] == j)) {\n      if (j == i)\n        printf(\"%s\", c);\n      else\n        cout << c << \" \";\n      k++;\n    } else {\n      if (j == i)\n        cout << a[j];\n      else\n        cout << a[j] << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34399", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar S[1000][100];\nint Size = 0;\nint main() {\n\n  while (!feof(stdin))\n    cin >> S[Size++];\n\n  Size--;\n  for (int i = 0; i < Size - 3; i++)\n    if (strcmp(S[i], S[Size - 2]) == 0)\n      cout << S[Size - 1] << \" \";\n    else\n      printf(\"%s \", S[i]);\n  if (strcmp(S[Size - 3], S[Size - 2]) == 0)\n    printf(\"%s\\n\", S[Size - 1]);\n  else\n    printf(\"%s\\n\", S[Size - 3]);\n  return 0;\n}\n"}
{"label": "19", "index": "34400", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint iflet(char a) {\n  int test = 0;\n  if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'))\n    test = 1;\n  return test;\n}\n\nint main() {\n  char ori[100], out[100], in[100];\n  char *pori = ori, *pout = out, *pin = in, temp[20];\n  int k;\n  cin >> ori;\n  cin >> out;\n  cin >> in;\n  for (; *pori != '\u0000';) {\n    if (*pori == ' ') {\n      printf(\"%c\", *pori);\n      pori++;\n    }\n\n    else if ((iflet(*pori) == 1 && *(pori - 1) == ' ') || (pori = ori)) {\n\n      for (k = 0; *(pori + k) != ' ' && *(pori + k) != '\u0000'; k++)\n        temp[k] = *(pori + k);\n      temp[k] = '\u0000';\n\n      if (strcmp(temp, out) == 0)\n        cout << in;\n\n      else {\n        printf(\"%s\", temp);\n      }\n\n      pori = pori + k;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  char sold[1000], snew[1000];\n  int i, j, k, l;\n\n  cin >> a;\n\n  cin >> sold;\n\n  cin >> snew;\n  for (i = 0; i < strlen(a); i++) {\n    k = 0;\n    for (j = i; j < i + strlen(sold); j++) {\n      if (i == strlen(a) - strlen(sold))\n        if (a[i - 1] != ' ')\n          break;\n      if (i != 0 && i != strlen(a) - strlen(sold))\n        if (a[i + strlen(sold)] != ' ' || a[i - 1] != ' ')\n          break;\n      if (a[j] != sold[k++])\n        break;\n    }\n    if (j == i + strlen(sold)) {\n      for (k = 0; k < 500; k++)\n        b[k + i + strlen(snew)] = a[k + i + strlen(sold)];\n      for (k = 0; k < i; k++)\n        b[k] = a[k];\n      l = 0;\n      for (k = 0; k < strlen(snew); k++)\n        b[i + k] = snew[l++];\n      for (k = 0; k < 1000; k++)\n        a[k] = b[k];\n      i = i + strlen(snew) - 1;\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "19", "index": "34402", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100], c;\n  int i, j, k, flag = 1;\n  int count = 0;\n  memset(a, 0, sizeof(a));\n  memset(s, 0, sizeof(s));\n  memset(b, 0, sizeof(b));\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n\n  for (i = 0; i <= strlen(s); i++) {\n    flag = 1;\n    if (s[i] || s[i + 1]) {\n      if (s[i - 1] == 32 || i == 0) {\n        for (j = 0; a[j] != 0; j++) {\n          if (s[i + j] == a[j])\n            continue;\n          else {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 1) {\n          i += j - 1;\n          for (k = 0; b[k] != 0; k++) {\n            cout << b[k];\n          }\n\n        } else {\n          if (s[i] == 0)\n            cout << \" \";\n          else\n\n            printf(\"%c\", s[i]);\n        }\n      }\n\n      else {\n        cout << s[i];\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34403", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  char *s, *a, *b, *p, *end;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", p);\n    if (strcmp(p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", p);\n    s = s + strlen(p);\n    if (s >= end)\n      break;\n    s++;\n    printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0}; \n  int sum = 0;            \n  while (true) {\n    cin >> s[sum]; \n    sum++;\n    if (cin.get() == '\\n')\n      break; \n  }\n  char a[100] = {0}; \n  char b[100] = {0}; \n  cin >> a >> b;\n  for (int i = 0; i < sum; i++)\n    for (int j = 0; j < 100; j++) {\n      if (s[i][j] != a[j])\n        break; \n      if (j == 99)\n        strcpy(s[i], b); \n    }\n  for (int l = 0; l < sum - 1; l++) \n    cout << s[l] << \" \";\n  cout << s[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34405", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar z[10000];\nchar a[10000];\nchar b[10000];\nchar temp[10000];\n\nint main() {\n  int i, j;\n\n  cin >> z;\n  scanf(\"%s %s\", a, b);\n  \n  int length = strlen(z);\n  for (i = 0; i < length; i++) {\n    while (z[i] == ' ') {\n      cout << ' ';\n      i++;\n    }\n    int k = 0;\n    for (j = i; j < length; j++) {\n      if (z[j] != ' ') {\n        temp[k++] = z[j];\n      } else\n        break;\n    }\n    temp[k] = '\u0000';\n    if (strcmp(temp, a) == 0) {\n      cout << b;\n    } else {\n      cout << temp;\n    }\n    i = j;\n    i--;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34406", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  scanf(\"%s \", sen);\n  scanf(\"%s %s \", a, b);\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = a[lena - 1] = b[lenb - 1] = ' ';\n  sen[lensen] = a[lena] = b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else\n      end[j] = sen[i];\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34407", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid f(char *s, char *a, char *b, int n1, int n2) {\n  int i, j, k, m, n;\n  char c[100];\n  char d[100];\n  for (i = 0, j = 0; *(s + j) != '\u0000';) {\n    int flag = 1;\n    for (m = 0; *(s + j) != ' ' && s[j] != '\u0000'; m++, j++) {\n      d[m] = s[j];\n      if (s[j + 1] == '\u0000')\n        flag = 0;\n    }\n    d[m] = '\u0000';\n    j = j - m;\n    if (strcmp(d, a) != 0) {\n      for (n = 0; n <= m; i++, j++, n++)\n        *(c + i) = *(s + j);\n    } else {\n      for (k = 0, n = 0; n < n2; i++, k++, n++)\n        *(c + i) = *(b + k);\n      j = j + n1;\n    }\n    if (flag == 1)\n      *(c + i) = ' ';\n    else\n      break;\n  }\n  *(c + i) = '\u0000';\n  printf(\"%s\", c);\n}\n\nint main() {\n  char s[100], a[100], b[100];\n  int n1, n2;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  f(s, a, b, n1, n2);\n}\n"}
{"label": "19", "index": "34408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf[600], dc[30][30], y[30], h[30];\n\n  cin >> zf;\n\n  cin >> y;\n\n  cin >> h;\n  int n = strlen(zf), a = 0, b = 0;\n  for (int i = 0; i < n + 1; i++) {\n    if (zf[i] != ' ' && zf[i] != ' ') {\n      dc[a][b] = zf[i];\n      b++;\n    } else {\n      dc[a][b] = '\u0000';\n      a++;\n      b = 0;\n    }\n  }\n  for (int k = 0; k < a + 1; k++) {\n    if (strcmp(dc[k], y) == 0) {\n      strcpy(dc[k], h);\n    }\n  }\n  printf(\"%s\", dc[0]);\n  for (int m = 1; m < a + 1; m++) {\n    printf(\" %s\", dc[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag;\n  char s[101], a[101], b[101];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  flag = 0;\n  do {\n    for (i = flag; i < strlen(s); i++) {\n      if (s[i + 1] == ' ' || s[i + 1] == '\u0000') {\n        if (i - flag + 1 != strlen(a)) {\n          for (j = flag; j <= i; j++) {\n            cout << s[j];\n          }\n        } else {\n          for (j = flag; j <= i; j++) {\n            if (a[j - flag] != s[j]) {\n              break;\n            }\n          }\n          if (j == i + 1) {\n            printf(\"%s\", b);\n          } else {\n            for (j = flag; j <= i; j++) {\n              printf(\"%c\", s[j]);\n            }\n          }\n        }\n        flag = i + 2;\n        if (s[i + 1] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        break;\n      }\n    }\n  } while (i < strlen(s));\n  return 0;\n}\n"}
{"label": "19", "index": "34410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char *p[100];\n  char *daitihuan;\n  char *tihuanwei;\n  p[0] = (char *)malloc(30);\n  while (scanf(\"%s\", p[i]) != EOF) {\n    p[i + 1] = (char *)malloc(30);\n    i++;\n  }\n  i--;\n  daitihuan = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = p[i];\n  daitihuan = p[i - 1];\n  for (j = 0; j < i - 1; j++)\n    if (strcmp(p[j], daitihuan) == 0)\n      strcpy(p[j], tihuanwei);\n  for (j = 0; j < i - 1; j++) {\n    cout << p[j] << (j == i - 2 ? \"\" : \" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34411", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s[100], *a, *b;\n  int i = 0, j = 0, x;\n  for (i = 0; i < 100; i++) {\n    s[i] = (char *)malloc(100 * sizeof(char));\n    for (j = 0; j < 100; j++)\n      s[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      x = i;\n      break;\n    }\n  }\n  for (i = 0; i <= x; i++) {\n    for (j = 0;; j++)\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        break;\n      }\n  }\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= x; i++)\n    if (!strcmp(s[i], a)) {\n      for (j = 0; j < 100; j++) {\n        s[i][j] = '\u0000';\n      }\n      strcpy(s[i], b);\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s \", s[x]);\n}\n"}
{"label": "19", "index": "34412", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar yuan[100000], yao[110], wei[110];\nint yuanlen, yaolen, weilen;\n\nint main() {\n  char *s;\n  int i, j;\n\n  cin >> yuan;\n\n  cin >> yao;\n\n  cin >> wei;\n  s = strstr(yuan, yao);\n  if (s == NULL || (s[-1] != ' ' && s != yuan)) {\n    puts(yuan);\n    return 0;\n  }\n  yuanlen = strlen(yuan);\n  yaolen = strlen(yao);\n  weilen = strlen(wei);\n  while (s != NULL) {\n    if (yaolen == weilen) {\n      for (i = 0; i < yaolen; i++) {\n        s[i] = wei[i];\n      }\n    }\n    if (yaolen > weilen) {\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n      while (s[i + yaolen - weilen] != 0) {\n        s[i] = s[i + yaolen - weilen];\n        i++;\n      }\n      s[i] = 0;\n    }\n    if (yaolen < weilen) {\n      for (i = yuanlen - 1; i > yaolen - 1; i--)\n        s[i + weilen - yaolen] = s[i];\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n    }\n    s += weilen;\n    s = strstr(s, yao);\n  }\n\n  puts(yuan);\n  return 0;\n}\n"}
{"label": "19", "index": "34413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *str, *s1, *s2, (*s)[101];\n  int i, j = 0, k = 0;\n  str = (char *)malloc(101);\n  s1 = (char *)malloc(101);\n  s2 = (char *)malloc(101);\n  s = (char(*)[101])calloc(101, 101);\n\n  scanf(\"%s \", str);\n  scanf(\"%s%s\", s1, s2);\n  for (i = 0; *(str + i) != '\u0000'; i++) {\n    if (*(str + i) == ' ') {\n      k++;\n      j = 0;\n    } else if (*(str + i) != ' ') {\n      *(*(s + k) + j) = *(str + i);\n      j++;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    if (strcmp(*(s + i), s1) == 0)\n      strcpy(*(s + i), s2);\n  cout << *s;\n  for (i = 1; i <= k; i++)\n    printf(\" %s\", *(s + i));\n}\n"}
{"label": "19", "index": "34414", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar z[10000];\nchar a[10000];\nchar b[10000];\nchar temp[10000];\n\nint main() {\n  int i, j;\n\n  scanf(\"%s \", z);\n  scanf(\"%s %s\", a, b);\n\n  int length = strlen(z);\n  for (i = 0; i < length; i++) {\n    while (z[i] == ' ') {\n      cout << ' ';\n      i++;\n    }\n    int k = 0;\n    for (j = i; j < length; j++) {\n      if (z[j] != ' ') {\n        temp[k++] = z[j];\n      } else {\n        break;\n      }\n    }\n    temp[k] = '\u0000';\n    if (strcmp(temp, a) == 0) {\n      cout << b;\n    } else\n      cout << temp;\n\n    i = j;\n    i--;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34415", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid change(char word[30][15], char a[], char b[]);\nvoid getword(char *p, char word[30][15]);\nint n = 0;\nint main() {\n  char s[100], word[30][15] = {'\u0000'}, a[10], b[10];\n  char *p = s;\n  cin >> s;\n  cin >> a >> b;\n  getword(p, word);\n  change(word, a, b);\n  return 0;\n}\n\nvoid getword(char *p, char word[30][15]) {\n  int i, j = 0;\n  for (i = 0; *p != '\u0000'; i++) {\n    while (*p == ' ')\n      p += 1;\n    j = 0;\n    while (*p != ' ' && *p != '\u0000') {\n      word[i][j] = *p;\n      j += 1;\n      p += 1;\n    }\n    n += 1;\n  }\n}\n\nvoid change(char word[30][15], char a[], char b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", word[i]);\n  }\n}\n"}
{"label": "19", "index": "34416", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], r[101] = \"\";\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char temp[101];\n  int templen = 0;\n  for (int i = 0; s[i]; i++) {\n    if (s[i] != ' ') {\n      temp[templen] = s[i];\n      templen++;\n    } else {\n      temp[templen] = '\\0';\n      if (!strcmp(temp, a))\n        strcat(r, b);\n      else\n        strcat(r, temp);\n      strcat(r, \" \");\n      templen = 0;\n    }\n  }\n  temp[templen] = '\\0';\n  if (!strcmp(temp, a))\n    strcat(r, b);\n  else\n    strcat(r, temp);\n  cout << r << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "34417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int i, j, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    while (a[i] != ' ' && a[i] != '\u0000')\n      d[j++] = a[i++];\n    d[j] = '\u0000';\n    if (strcmp(b, d) == 0)\n      printf(\"%s\", c);\n    else {\n      printf(\"%s\", d);\n    }\n    if (i == k) {\n      printf(\"\u0000\");\n    } else {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34418", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, q, j, k, flag = 0;\n  char a[102], b[102], c[102];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i - 1] == ' ') || ((a[i] >= 'A') && (a[i] < 'a'))) {\n      for (j = 0; j < n; j++)\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      if (flag == 0) {\n        for (k = 0; k < q; k++)\n          printf(\"%c\", c[k]);\n        i = i + n - 1;\n      } else {\n        printf(\"%c\", a[i]);\n        flag = 0;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[100], b[100], c[100], d[100], e[100] = \"\u0000\";\n  int i, j;\n  char *s;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  s = a;\n  strcat(a, \" \");\n  for (i = 0; a[i] != '\u0000'; i++) {\n    j = 0;\n    while (a[i] != ' ') {\n      d[j] = a[i];\n      i++;\n      j++;\n    }\n    d[j] = '\u0000';\n    if ((!strcmp(d, b)) && (d[0] != '\u0000')) {\n      strcat(e, c);\n    } else {\n      strcat(e, d);\n    }\n    if (a[i + 1] != '\u0000')\n      strcat(e, \" \");\n  }\n  puts(e);\n}\n"}
{"label": "19", "index": "34420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n\n  cin >> str;\n\n  cin >> wrd;\n\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((str[i] != ' ') && (str[i] != '\u0000')) {\n      wd[j] = str[i];\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          str[k] = '\u0000';\n        for (k = i; k < n; k++) {\n          sr[k - i] = str[k];\n          str[k] = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          sr[k] = '\u0000';\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n    }\n  }\n  puts(str);\n}\n"}
{"label": "19", "index": "34421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[50][20];\n  char s[100], a[100], b[100], e[100];\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n  while (1) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      e[j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      j = 0;\n      k++;\n    } else if (s[i] == '\u0000') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      break;\n    }\n    i++;\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a, word[i]) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\", word[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34422", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *c, *e;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  e = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", c);\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    s = s + strlen(c) + 1;\n    if (s >= e)\n      break;\n    printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str[100], c1[100], c2[100];\nint pd(int l) {\n  int i, j, k;\n  char temp;\n  k = 0;\n  for (i = 0; i < 1; i) {\n\n    if (str[l] != c1[k])\n      return 0;\n    k++;\n    temp = str[l + 1];\n    if ((temp == ' ') || (temp == '\t') || (temp == ' ') || (temp == ' '))\n\n    {\n\n      if (k == (strlen(c1)))\n        return 1;\n      else\n        return 0;\n    }\n    l++;\n  }\n}\n\nint main() {\n  char temp;\n  int i, j, n, k, m;\n\n  cin >> str;\n  cin >> c1;\n  cin >> c2;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      temp = str[i - 1];\n    if (i == 0)\n      temp = 0;\n    if ((i == 0) || (temp == ' ') || (temp == '\t') || (temp == ' ') ||\n        (temp == ' ')) {\n      k = pd(i);\n      m = 0;\n      if (k == 1) {\n        printf(\"%s\", c2);\n        i = i + strlen(c1) - 1;\n      }\n\n      else\n        printf(\"%c\", str[i]);\n    } else\n      printf(\"%c\", str[i]);\n  }\n  cout << \" \";\n}\n"}
{"label": "19", "index": "34424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i;\n  char str[100][100];\n  while (cin >> str[++n])\n    if (str[n][0] == '0')\n      break;\n  n--;\n\n  for (i = 1; i < n - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(str[i], str[n - 1]) == 0)\n      cout << str[n];\n    else\n      cout << str[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34425", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint iflet(char a) {\n  int test = 0;\n  if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'))\n    test = 1;\n  return test;\n}\n\nint main() {\n  char ori[100], out[100], in[100];\n  char *pori = ori, *pout = out, *pin = in, temp[20];\n  int k;\n\n  cin >> ori;\n\n  cin >> out;\n\n  cin >> in;\n\n  for (; *pori != '\u0000';) {\n    if (*pori == ' ') {\n      printf(\"%c\", *pori);\n      pori++;\n    }\n\n    else if ((iflet(*pori) == 1 && *(pori - 1) == ' ') || (pori = ori)) {\n\n      for (k = 0; *(pori + k) != ' ' && *(pori + k) != '\u0000'; k++)\n        temp[k] = *(pori + k);\n      temp[k] = '\u0000';\n\n      if (strcmp(temp, out) == 0)\n        printf(\"%s\", in);\n\n      else\n        printf(\"%s\", temp);\n\n      pori = pori + k;\n    }\n  }\n}\n"}
{"label": "19", "index": "34426", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100];\n  int i = 0;\n  int len = 0;\n  for (i = 0; i <= 99; i++) {\n    cin >> a[i];\n    len++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  cin >> b >> c;\n  for (i = 0; i <= len - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n    if (i >= 1)\n      cout << \" \";\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[101];\n  char word1[101], word2[101];\n  int match[101];\n\n  memset(match, 1, sizeof(match));\n\n  cin >> st;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  int len1 = strlen(st), len2 = strlen(word1), len3 = strlen(word2);\n\n  int i, j, k;\n  for (i = 0; i < len1; i++) {\n    if ((i == 0 || st[i - 1] == ' ') && i + len2 <= len1) {\n      for (j = 0; j < len2; j++) {\n        if (st[i + j] != word1[j])\n          match[i] = 0;\n      }\n    }\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (!match[i]) {\n      for (j = i; j < len1; j++) {\n        putchar(st[j]);\n        if (st[j] == ' ')\n          break;\n      }\n      i = j;\n    } else {\n      i += len2;\n      printf(\"%s\", word2);\n      if (i < len1)\n        putchar(' ');\n    }\n  }\n  puts(\"\");\n\n  return 0;\n}\n"}
{"label": "19", "index": "34428", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s, *p1, *p2, *temp, *a, *b;\n  int i, j, t, n, len;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 101);\n  b = (char *)malloc(sizeof(char) * 101);\n\n  cin >> s;\n  len = strlen(s);\n  p1 = p2 = s;\n  *(s + len) = ' ';\n  *(s + len + 1) = '\u0000';\n\n  cin >> a;\n\n  cin >> b;\n  for (; *p1; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      len = p1 - p2;\n      temp = (char *)malloc(sizeof(char) * 101);\n      for (i = 0; i < len; i++)\n        *(temp + i) = *(p2 + i);\n      *(temp + len) = '\u0000';\n      p2 = p1 + 1;\n      if (strcmp(temp, a) == 0)\n        *p2 == '\u0000' ? printf(\"%s\", b) : printf(\"%s \", b);\n      else\n        *p2 == '\u0000' ? printf(\"%s\", temp) : printf(\"%s \", temp);\n      free(temp);\n    }\n  }\n}\n"}
{"label": "19", "index": "34429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0] && (a[i - 1] == ' ' || i == 0) &&\n        (a[i + strlen(b)] == ' ' || i + strlen(b) == strlen(a))) {\n      int check = 0;\n      for (int j = 0; j < strlen(b); j++) {\n        if (a[j + i] != b[j]) {\n          check = 1;\n          break;\n        }\n      }\n      if (check == 0) {\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        continue;\n      }\n    }\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[103], a[103], b[103], s2[210];\n  int alen, slen, blen, i, j;\n  s[0] = a[0] = b[0] = ' ';\n\n  cin >> &s[1];\n  cin >> &a[1] >> &b[1];\n  slen = strlen(s);\n  alen = strlen(a);\n  blen = strlen(b);\n  s[slen] = a[alen] = b[blen] = ' ';\n  s[slen + 1] = a[alen + 1] = b[blen + 1] = '\u0000';\n  for (i = 0, j = 0; i <= slen; i++, j++) {\n    if (strncmp(s + i, a, alen + 1) == 0) {\n      strcpy(s2 + j, b);\n      i = i + alen;\n      j = j + blen;\n    } else {\n      s2[j] = s[i];\n    }\n  }\n\n  s2[j - 1] = 0;\n  cout << &s2[1] << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "34431", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][100], str1[100], str2[100], (*p)[100];\n  int i, j, k;\n  for (i = 0;; i++) {\n    scanf(\"%s\", str[i]);\n    k = i;\n    if (getchar() == ' ')\n      break;\n  }\n  p = str;\n\n  scanf(\"%s \", str1);\n\n  cin >> str2;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(*(p + i), str1) == 0)\n      strcpy(*(p + i), str2);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i < k)\n      printf(\"%s \", *(p + i));\n    else\n      printf(\"%s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "34432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[20][100], sub[100], subed[100];\n  char string[500];\n  int i, d1 = 0, d2 = 0, len, n = 1;\n  char(*p)[100];\n  cin >> string;\n  len = strlen(string);\n  for (i = 0, d2 = 0; i < len && d2 < 100; i++, d2++) {\n    if (string[i] == ' ') {\n      words[d1][d2] = '\u0000';\n      d1++;\n      n++;\n      d2 = 0;\n    }\n    if (string[i] == ' ')\n      continue;\n    if (string[i - 1] == ' ')\n      d2--;\n    words[d1][d2] = string[i];\n  }\n  words[d1][d2] = '\u0000';\n  p = words;\n  scanf(\"%s\", subed);\n  scanf(\"%s\", sub);\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), subed) == 0)\n      strcpy(*(p + i), sub);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", p + i);\n  printf(\"%s\", p + n - 1);\n  return 0;\n}\n"}
{"label": "19", "index": "34433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar buffer[1024];\nchar word[1024];\nchar replace_1[1024];\nchar current[1024];\n\nint main() {\n\n  cin >> buffer;\n  scanf(\"%s %s\", word, replace_1);\n\n  int buffer_len = strlen(buffer);\n  char *buffer_ptr = buffer;\n  char *buffer_end = buffer + buffer_len;\n\n  char *current_ptr = current;\n  while (buffer_ptr < buffer_end) {\n    if (*buffer_ptr == ' ') {\n      *current_ptr = '\u0000';\n      if (strcmp(word, current) == 0)\n        cout << replace_1 << \" \";\n      else\n        printf(\"%s \", current);\n      current_ptr = current;\n    } else {\n      *current_ptr = *buffer_ptr;\n      ++current_ptr;\n    }\n    ++buffer_ptr;\n  }\n  *current_ptr = '\u0000';\n  if (strcmp(word, current) == 0)\n    cout << replace_1;\n  else\n    printf(\"%s\", current);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a;\n  int isWords;\n  char s1[100];\n  char s2[100];\n  char s3[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  i = 0;\n  j = 0;\n  k = 0;\n  char *p;\n  p = strtok(s1, \"' '\");\n  if (strcmp(p, s2) == 0)\n    cout << s3;\n  else {\n    printf(\"%s\", p);\n  }\n  p = strtok(NULL, \"' '\");\n  while (p) {\n    if (strcmp(p, s2) == 0)\n      printf(\" %s\", s3);\n    else\n      printf(\" %s\", p);\n    p = strtok(NULL, \"' '\");\n  }\n\n  cin >> s1;\n  return 0;\n}\n"}
{"label": "19", "index": "34435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[50][100];\n  int i, n = 0, len1, len2, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(c[n], (s + k));\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(c[n], (s + k));\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << c[i] << \" \";\n\n  cout << c[n];\n  return 0;\n}\n"}
{"label": "19", "index": "34436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int la, lb, i, j, count = 1;\n  char a[1000], b[100], c[100];\n  cin.getline(a, 1000);\n  la = strlen(a);\n  cin.getline(b, 100);\n  lb = strlen(b);\n  cin.getline(c, 100);\n  do {\n    for (i = count - 1; i <= la - 1; i++) {\n      if (a[i] != b[0] || i >= 1 && a[i - 1] != ' ') {\n        cout << a[i];\n        count++;\n      } else\n        break;\n    }\n    if (a[i] == b[0] && (i >= 1 && a[i - 1] == ' ' || i == 0)) {\n      for (j = 0; j <= lb - 1; j++)\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      count = count + j + 1;\n      if (j == lb && ((i + j) < la && a[i + j] == ' '))\n        cout << c << \" \";\n      else if (i + j == la)\n        printf(\"%s\", c);\n      else\n        for (j = i; j <= count - 2; j++)\n          printf(\"%c\", a[j]);\n    }\n  } while (count < la);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], change[100], chafor[100];\n  char a[100][100] = {{'0'}, {'0'}};\n  int i, j, len, m, start = 0, num = 1;\n\n  cin >> str;\n\n  cin >> change;\n\n  cin >> chafor;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ')\n      num += 1;\n  }\n  for (i = 0; i < num; i++) {\n    m = 0;\n    for (j = start; j < len; j++) {\n      if (str[j] != ' ') {\n        a[i][m] = str[j];\n        m += 1;\n      } else {\n        start = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], change) == 0)\n      strcpy(a[i], chafor);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++)\n    printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34438", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, n;\n\n  char s[120];\n  char word[120];\n  char a[120];\n  char b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; s[i] != ' ' && s[i] != '\u0000'; i++) {\n    word[i] = s[i];\n  }\n  word[i] = '\u0000';\n  if (strcmp(word, a) == 0) {\n\n    printf(\"%s\", b);\n  } else\n    printf(\"%s\", word);\n  n = i;\n  while (s[i] != '\u0000') {\n    i++;\n\n    for (; s[i] != ' ' && s[i] != '\u0000'; i++) {\n      word[i - n - 1] = s[i];\n    }\n\n    word[i - n - 1] = '\u0000';\n    if (strcmp(word, a) == 0) {\n\n      printf(\" %s\", b);\n    } else\n      printf(\" %s\", word);\n\n    n = i;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34439", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100];\n  char a[100];\n  char b[100];\n  char s2[15][20];\n  int i, k, x = 0, m, n;\n  char c, d;\n\n  cin >> s1;\n\n  cin >> a;\n\n  cin >> b;\n  m = 0;\n  n = 0;\n  k = 0;\n  for (i = 0; (c = s1[i]) != '\u0000'; i++) {\n    if (c != ' ') {\n      s2[k][m] = c;\n      m++;\n    } else {\n      s2[k][m] = '\u0000';\n      m = 0;\n      k++;\n      n++;\n    }\n  }\n  s2[n][m] = '\u0000';\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s2[i], a) == 0) {\n      x = 1;\n      for (k = 0; (d = b[k]) != '\u0000'; k++)\n        s2[i][k] = b[k];\n\n      s2[i][k] = '\u0000';\n    }\n  }\n  if (x == 1) {\n    for (i = 0; i < n; i++) {\n      printf(\"%s \", s2[i]);\n    }\n    printf(\"%s\", s2[n]);\n  } else {\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100];\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  for (i = 0; i < m; i++)\n    if (s[i] == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; s[k] != 32; j++) {\n      c[i][j] = s[k];\n      k++;\n    }\n    if (s[k] == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n}\n"}
{"label": "19", "index": "34441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, b = 0;\n  char s[80], s0[20], s2[20], s3[20];\n  char s1[100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> s0;\n\n  cin >> s2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s3[b] = s[i];\n      b++;\n    }\n    if (s[i] == ' ') {\n      s3[b] = '\u0000';\n      if (strcmp(s3, s0) == 0) {\n        strcat(s1, s2);\n        strcat(s1, \" \");\n      } else {\n        strcat(s1, s3);\n        strcat(s1, \" \");\n      }\n      b = 0;\n    }\n  }\n  s3[b] = '\u0000';\n  if (strcmp(s3, s0) == 0) {\n    strcat(s1, s2);\n  } else {\n    strcat(s1, s3);\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "19", "index": "34442", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar former[150];\nchar zhao[10], huan[10];\nvoid alter(char *p) {\n\n  char *p2;\n  p2 = p + strlen(zhao) + 1;\n  char p3[100];\n  strcpy(p3, p2);\n  *(p + 1) = '\u0000';\n  strcat(former, huan);\n  strcat(former, p3);\n}\n\nint main()\n\n{\n\n  int i;\n\n  scanf(\"%s \", former);\n  cin >> zhao >> huan;\n  char *p0, *p1;\n  p0 = former;\n  for (; *p0 != '\u0000'; p0++) {\n    if (*p0 == ' ' && *(p0 + 1) == zhao[0]) {\n      for (p1 = p0 + 1, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n        ;\n      if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000')\n        alter(p0);\n    }\n  }\n  p0 = former;\n  for (p1 = p0, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n    ;\n  if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000') {\n    char *p2;\n    p2 = p0 + strlen(zhao);\n    char p3[100];\n    strcpy(p3, p2);\n    strcat(huan, p3);\n    printf(\"%s\", huan);\n    return 0;\n  }\n\n  printf(\"%s \", former);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34443", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, t[100], at, bt, p;\n  char s[100][100], a[100], b[100];\n  for (i = 0; i < 100; i++) {\n\n    for (j = 0; j < 100; j++) {\n      s[i][j] = cin.get();\n      if (s[i][j] == ' ') {\n        t[i] = j;\n        break;\n      } else if (s[i][j] == '\\n') {\n        t[i] = j;\n        goto loop;\n      }\n    }\n  }\nloop:\n  n = i + 1;\n  for (j = 0; j < 100; j++) {\n    a[j] = cin.get();\n    if (a[j] == '\\n') {\n      at = j;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    b[j] = cin.get();\n    if (b[j] == '\\n') {\n      bt = j;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t[i] == at) {\n      p = 1;\n      for (j = 0; j < at - 1; j++) {\n        p *= s[i][j] - a[j] + 1;\n      }\n      if (p == 1) {\n        for (j = 0; j < bt; j++)\n          s[i][j] = b[j];\n        t[i] = bt;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    else {\n      printf(\" \");\n      for (j = 0; j < t[i]; j++)\n        printf(\"%c\", s[i][j]);\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "34444", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101][101] = {0}, b[101], c[101];\n  int i, j;\n  for (j = 0;; j++) {\n    scanf(\"%s\", a[j]);\n\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < 101; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    printf(\" %s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100] = {'\u0000'}, s2[100] = {'\u0000'}, a[100] = {'\u0000'}, b[100] = {'\u0000'};\n\n  cin >> s1;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = 0, lena = strlen(a), lenb = strlen(b), n = strlen(s1);\n  for (i = 0; i < n - lena + 1; i++) {\n    if (i > 0 && s1[i - 1] != ' ') {\n      s2[t] = s1[i];\n      t += 1;\n      continue;\n    }\n    for (j = 0; j < lena; j++) {\n      if (s1[i + j] != a[j])\n        break;\n    }\n    if (i + j == n || j == lena && s1[i + j] == ' ') {\n      for (k = 0; k < lenb; k++)\n        s2[t + k] = b[k];\n      t += lenb;\n      i += lena - 1;\n    } else {\n      s2[t] = s1[i];\n      t += 1;\n    }\n  }\n  if (i == n - lena + 1) {\n    for (k = 0; k < lena - 1; k++)\n      s2[t + k] = s1[i + k];\n  }\n  puts(s2);\n  return 0;\n}\n"}
{"label": "19", "index": "34446", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid huan(int start, char W[100], char B[100], int Len1, int Len2, int Len3,\n          int t) {\n  int i, k;\n  char WW[100];\n  for (i = 0; i < start; i++)\n    WW[i] = W[i];\n  for (i = start, k = 0; i < start + Len3; i++, k++)\n    WW[i] = B[k];\n  for (i = start + Len3; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    WW[i] = W[i + Len2 - Len3];\n  for (i = 0; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    W[i] = WW[i];\n}\n\nint main() {\n  char whole[100];\n  char a[100];\n  char b[100];\n\n  cin >> whole;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t;\n  int len1;\n  int len2;\n  int len3;\n  len1 = strlen(whole);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  int judge;\n  int begin[100];\n  t = 0;\n  if (whole[0] != a[0]) {\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  } else {\n    t = 1;\n    begin[0] = 0;\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  }\n\n  if (len1 >= len2) {\n    int u;\n    for (i = t - 1, u = 1; i >= 0; i--, u++)\n      huan(begin[i], whole, b, len1, len2, len3, u);\n\n    for (i = 0; i <= len1 - 1 - len2 * (u - 1) + len3 * (u - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  } else {\n    int v;\n    for (i = 0, v = 1; i <= t - 1; i++, v++) {\n      huan(begin[i], whole, b, len1, len2, len3, v);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (v - 1) + len3 * (v - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = 0;\n  char *p;\n  char *a, *b, *c;\n  p = (char *)malloc(200 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  cin >> p;\n  cin >> a;\n  cin >> b;\n  c = p;\n  while (*p != '\u0000') {\n    if (*p != ' ')\n      p = p + 1;\n    else {\n      *p = '\u0000';\n      p = p + 1;\n      if (strcmp(c, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", c);\n      c = p;\n    }\n  }\n  do {\n    if (strcmp(c, a) == 0)\n      cout << b;\n    else\n      printf(\"%s\", c);\n    t = 1;\n  } while ((*p == '\u0000') && (t = 0));\n  return 0;\n}\n"}
{"label": "19", "index": "34448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[5000];\n  char m[100][20];\n  char s1[20], s2[20];\n\n  cin >> n;\n  cin >> s1;\n  cin >> s2;\n  int i, j = 0, k = 0, e;\n  e = strlen(n);\n  for (i = 0; i < e; i++) {\n    if (n[i] != ' ') {\n      m[j][k] = n[i];\n      k++;\n    }\n    if (n[i] == ' ') {\n      m[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  m[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(m[i], s1) == 0) {\n      strcpy(m[i], s2);\n    }\n  }\n\n  printf(\"%s\", m[0]);\n  for (i = 1; i <= j; i++) {\n\n    printf(\" %s\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34449", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, l1, l2, l3, t;\n  char aa[100] = {0}, b[100], c[100];\n  char pp[100][100] = {0};\n\n  cin >> aa;\n\n  cin >> b;\n\n  cin >> c;\n  l1 = strlen(aa);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; m < l1; i++) {\n    for (j = 0;; j++) {\n      pp[i][j] = aa[m + j];\n      if (aa[m + j] == ' ' || aa[m + j] == NULL)\n        break;\n    }\n    m += j + 1;\n  }\n  for (k = 0; k <= i; k++) {\n    for (t = 0; t < l2; t++) {\n      if (pp[k][t] != b[t])\n        break;\n    }\n    if (t == l2) {\n      for (t = 0; t <= l2; t++)\n        pp[k][t] = 0;\n      strcpy(pp[k], c);\n      if (k != i - 1)\n        pp[k][l3] = ' ';\n    }\n  }\n  for (k = 0; k <= i; k++)\n    printf(\"%s\", pp[k]);\n}\n"}
{"label": "19", "index": "34450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], *p, a[100], b[100], s[100][20];\n  int l, i, j, d = 1, k;\n\n  scanf(\"%s \", str);\n  scanf(\"%s %s\", a, b);\n  l = strlen(str);\n  p = str;\n  for (i = 0, j = 0;; i++, j++) {\n    if (str[i] == ' ')\n      break;\n    else\n      s[0][j] = str[i];\n  }\n  s[0][j] = '\u0000';\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = 0, k = i;; j++, k++) {\n        if (str[k] == ' ')\n          break;\n        else\n          s[d][j] = *(p + k);\n      }\n      s[d][j] = '\u0000';\n      d = d + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i < d - 1; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s\", s[d - 1]);\n}\n"}
{"label": "19", "index": "34451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(char *argv[]) {\n  char a[101], t[101];\n  char b[101];\n  char c[101];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int found = 0, i, j;\n  memset(t, '\u0000', sizeof(t));\n  for (i = 0, j = 0; a[i - 1] != '\u0000'; i++, j++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      t[j] = a[i];\n    }\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      t[j + 1] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n      }\n      if (found++) {\n        printf(\" \");\n      }\n      printf(\"%s\", t);\n      j = -1;\n      memset(t, '\u0000', sizeof(t));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char s1[101][101];\n  int i, j, k;\n  k = 0;\n  j = 0;\n  i = 0;\n  int tag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    s1[j][k] = s[i];\n    k++;\n    if (s[i] == ' ') {\n      s1[j][k - 1] = '\u0000';\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  s1[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s1[i], a) == 0)\n      strcpy(s1[i], b);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", s1[i]);\n  }\n  printf(\"%s\", s1[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34453", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\ntypedef long long ll;\n\nchar s[110], a[110], b[110];\n\nint main() {\n  while (cin >> s) {\n\n    scanf(\"%s%s \", a, b);\n\n    int i = 0;\n    int lena = strlen(a);\n    while (s[i]) {\n      if (s[i] == ' ')\n        putchar(' '), i++;\n      else {\n        int j = 0;\n        for (; a[j]; j++)\n          if (a[j] != s[i + j])\n            break;\n\n        if (a[j] == 0) {\n          i += lena;\n          printf(\"%s\", b);\n        } else {\n          while (s[i] && s[i] != ' ')\n            putchar(s[i++]);\n        }\n      }\n    }\n\n    puts(\"\");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid f(char *s, char *a, char *b, int n1, int n2) {\n  int i, j, k, m, n;\n  char c[100];\n  char d[100];\n  for (i = 0, j = 0; *(s + j) != '\u0000';) {\n    int flag = 1;\n    for (m = 0; *(s + j) != ' ' && s[j] != '\u0000'; m++, j++) {\n      d[m] = s[j];\n      if (s[j + 1] == '\u0000')\n        flag = 0;\n    }\n    d[m] = '\u0000';\n    j = j - m;\n    if (strcmp(d, a) != 0) {\n      for (n = 0; n <= m; i++, j++, n++)\n        *(c + i) = *(s + j);\n    } else {\n      for (k = 0, n = 0; n < n2; i++, k++, n++)\n        *(c + i) = *(b + k);\n      j = j + n1;\n    }\n    if (flag == 1)\n      *(c + i) = ' ';\n    else\n      break;\n  }\n  *(c + i) = '\u0000';\n  cout << c;\n}\n\nint main() {\n  char s[100], a[100], b[100];\n  int n1, n2;\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  f(s, a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "19", "index": "34455", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, n, w, i, wordnum = 0, charnum = 0;\n  char word[50][20] = {0};\n  char s[1000] = {0}, o[20] = {0}, a[20] = {0};\n\n  cin >> s;\n\n  cin >> o;\n\n  cin >> a;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      word[wordnum][charnum] = s[i];\n      charnum++;\n    }\n    if (s[i] == ' ') {\n      wordnum++;\n      charnum = 0;\n    }\n  }\n  w = wordnum;\n  for (wordnum = 0; wordnum <= w; wordnum++) {\n    if (strcmp(o, word[wordnum]) == 0) {\n      strcpy(word[wordnum], a);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (wordnum = 1; wordnum <= w; wordnum++)\n    printf(\" %s\", word[wordnum]);\n  return 0;\n}\n"}
{"label": "19", "index": "34456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar sentence[100][100], a[100], b[100];\n\nint main() {\n  int cnt = 1;\n  while (scanf(\"%s\", sentence[cnt]) != EOF)\n    cnt++;\n  cnt--;\n  memcpy(a, sentence[cnt - 1], sizeof(sentence[cnt - 1]));\n  memcpy(b, sentence[cnt], sizeof(sentence[cnt]));\n  for (int i = 1; i < cnt - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(sentence[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", sentence[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "34457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, m = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n\n  for (i = 0;; i++) {\n    while (1) {\n\n      if (a[i + j] == b[j] && a[i + j] != '\u0000')\n\n      {\n        j++;\n        continue;\n      } else if (b[j] == '\u0000' && (a[i + j] == ' ' || a[i + j] == '\u0000') &&\n                 (a[i - 1] == ' ' || i == 0)) {\n        j = 0;\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        break;\n      } else {\n        j = 0;\n        if (a[i] == '\u0000')\n          break;\n        else\n          printf(\"%c\", a[i]);\n        break;\n      }\n    }\n\n    if (a[i] == '\u0000')\n      break;\n  }\n  if (b[j] == '\u0000')\n    printf(\"%s\", c);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34458", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  scanf(\"%s \", sen);\n  scanf(\"%s %s \", a, b);\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = ' ';\n  a[lena - 1] = ' ';\n  b[lenb - 1] = ' ';\n\n  sen[lensen] = '\u0000';\n  a[lena] = '\u0000';\n  b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else {\n      end[j] = sen[i];\n    }\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34459", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], x[100][26], a[100], b[100], t[100];\n  int num, i, j, kong;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  kong = -1;\n  num = 0;\n  for (i = 0; i < 101; i++) {\n    if (s[i] == ' ') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      num++;\n      kong = i;\n    } else if (s[i] == '\u0000') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      t[j] = x[i][j];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      for (j = 0; b[j] != '\u0000'; j++)\n        x[i][j] = b[j];\n      x[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      printf(\"%c\", x[i][j]);\n    printf(\" \");\n  }\n  for (j = 0; x[num][j] != '\u0000'; j++)\n    printf(\"%c\", x[num][j]);\n}\n"}
{"label": "19", "index": "34460", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zj[100][100];\n  int i = 0, k, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    k = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      zj[t][k] = s[i];\n      k++;\n      i++;\n    }\n    zj[t][k] = '\u0000'; \n    while (s[i] == ' ') {\n      i++;\n    }\n    t++;\n  }\n  zj[t][k + 1] = '\u0000';\n  for (i = 0; i < t; i++) {\n\n    if (strcmp(zj[i], a) == 0) {\n      strcpy(zj[i], b);\n    }\n  }\n  for (i = 0; i < t - 1; i++) {\n    printf(\"%s \", zj[i]);\n  }\n  printf(\"%s\", zj[i]); \n  return 0;\n}\n"}
{"label": "19", "index": "34461", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar str[101], target[10001], a[101], b[101], c[101];\nint i = 0, j = 0, k = 0, len_str, len_a, len_b, pos = 0, t = 0;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100], word[50][50] = {0};\n  int len, i, row = 1, col = 1;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 1; i <= len; i++)\n    if (str[i - 1] == ' ') {\n      row++;\n      col = 1;\n    } else {\n      word[row - 1][col - 1] = str[i - 1];\n      col++;\n    }\n  for (i = 1; i <= row; i++)\n    if (strcmp(word[i - 1], str1) == 0)\n      strcpy(word[i - 1], str2);\n  cout << word[0];\n  for (i = 2; i <= row; i++)\n    printf(\" %s\", word[i - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[110], b[110], c[110];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int x, y, z, flag;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n\n  for (int i = 0; i < x; i++) {\n    if ((i == 0 && a[y] == ' ') || (a[i - 1] == ' ' && (i + y) == x) ||\n        (a[i - 1] == ' ' && a[i + y] == ' ')) {\n      flag = 0;\n      for (int j = 0; j < y; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        cout << c;\n        i += y - 1;\n        continue;\n      }\n    }\n    cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34464", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], s[100];\n  int a, b, c, i, n, j, k, q = 1;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  a = strlen(s1);\n  b = strlen(s2);\n  c = strlen(s3);\n  strcpy(s, s1);\n  for (i = 0; i < a; i++) {\n\n    for (j = 0; j < b; j++) {\n      if (s[i + j] != s2[j])\n        break;\n    }\n    if ((j == b) && ((s[i - 1] == ' ') || (i == 0))) {\n\n      for (k = i; k < i + c; k++)\n        s[k] = s3[k - i];\n      for (k = i + c; k + (b - c) * q < a; k++)\n        s[k] = s1[k + (b - c) * q];\n      s[a + (c - b) * q] = 0;\n\n      q++;\n    }\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "34465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char juzi[100];\n  char danci[200][200], ci1[200], ci2[200];\n  int i = 0, j = 0, k = 0, f, index;\n\n  cin >> juzi;\n\n  cin >> ci1;\n\n  cin >> ci2;\n  index = 0;\n  for (i = 0;; i++) {\n    for (k = 0;;) {\n      if (juzi[index] != ' ' && juzi[index] != 0) {\n        danci[i][k] = juzi[index];\n        index++;\n        k++;\n      } else {\n        danci[i][k] = 0;\n        index++;\n        k++;\n        break;\n      }\n    }\n    if (juzi[index - 1] == 0) {\n      break;\n    }\n  }\n  for (f = 0; f < 100; f++) {\n    if (strcmp(danci[f], ci1) == 0) {\n      strcpy(danci[f], ci2);\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (j == i) {\n      cout << danci[j];\n    } else {\n      cout << danci[j] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34466", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, ll, ll2;\n  char a[100];\n  char aa[100];\n  char bb[100];\n  char h[100][100];\n  int c[100];\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n\n  scanf(\"%s \", a);\n\n  cin >> aa;\n\n  cin >> bb;\n  l = strlen(a);\n  ll = strlen(aa);\n  ll2 = strlen(bb);\n  int n = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == ' ') {\n      n = n + 1;\n    }\n  }\n  int b[50];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (a[j] == ' ' && c[j] == 0) {\n        b[i] = j;\n        c[j] = 1;\n        break;\n      }\n    }\n  }\n  int d[50];\n  d[0] = b[0];\n  for (i = 1; i < n; i++) {\n    d[i] = b[i] - b[i - 1] - 1;\n  }\n  d[n] = l - b[n - 1] - 1;\n  for (i = 1; i < n; i++) {\n    for (j = b[i - 1] + 1; j < b[i]; j++) {\n      h[i][j - b[i - 1] - 1] = a[j];\n    }\n  }\n  for (j = 0; j < b[0]; j++) {\n    h[0][j] = a[j];\n  }\n  for (j = b[n - 1] + 1; j < l; j++) {\n    h[n][j - b[n - 1] - 1] = a[j];\n  }\n  for (i = 0; i <= n; i++) {\n    if (d[i] == ll) {\n      int t = 0;\n      for (j = 0; j < d[i]; j++) {\n        if (h[i][j] == aa[j]) {\n          t = t + 1;\n        }\n      }\n      if (t == d[i]) {\n        d[i] = ll2;\n        for (j = 0; j < ll2; j++) {\n          h[i][j] = bb[j];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < d[i]; j++) {\n      if (j != d[i] - 1) {\n        printf(\"%c\", h[i][j]);\n      } else if (j == d[i] - 1) {\n        printf(\"%c \", h[i][j]);\n      }\n    }\n  }\n  for (j = 0; j < d[n]; j++) {\n    if (j != d[n] - 1) {\n      printf(\"%c\", h[n][j]);\n    } else if (j == d[i] - 1) {\n      cout << h[n][j] << \" \";\n    }\n  }\n}\n"}
{"label": "19", "index": "34467", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], a[10], b[10], word[50][15];\n  int i = 0, n, j = 0, k = 0;\n  cin.getline(str, 100);\n  cin.getline(a, 10);\n  cin.getline(b, 10);\n  n = strlen(str);\n  while (i < n) {\n    while (str[i] != ' ')\n      word[j][k++] = str[i++];\n    word[j][k] = '\\0';\n    k = 0;\n    j++;\n    i++;\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (strcmp(a, word[i]) == 0)\n      cout << b << \" \";\n    else\n      cout << word[i] << \" \";\n  }\n\n  if (strcmp(a, word[i]) == 0)\n    printf(\"%s\\n\", b);\n  else\n    cout << word[i] << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "34468", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200], d[200];\n  int ai = 0, lb, la, lc, bi = 0, ci = 0, di = 0, k;\n\n  cin >> a;\n  scanf(\"%s\", &b);\n  cin >> c;\n  lb = strlen(b);\n  la = strlen(a);\n  lc = strlen(c);\n  while (ai != la) {\n    bi = 0;\n    ci = 0;\n    if (ai != 0) {\n      if ((a[ai] == b[bi]) && (a[ai - 1] == ' ')) {\n\n        k = ai;\n        while ((a[ai] == b[bi]) && (a[ai] != ' ') && (a[ai] != '\u0000')) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    } else {\n      if (a[ai] == b[bi]) {\n\n        k = ai;\n        while (a[ai] == b[bi]) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    }\n  }\n\n  d[di] = '\u0000';\n\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "34469", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000], a[100], b[100], word[100];\n  int i, j = 0, flag = 0;\n  cin >> str;\n  cin >> a;\n  cin >> b;\n  i = 0;\n  while (str[i]) {\n    if (str[i] == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      word[j] = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      word[j] = str[i];\n      j++;\n    }\n    i++;\n  }\n  word[j] = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n  return 0;\n}\n"}
{"label": "19", "index": "34470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[201], ch[201], ch1[201], str1[201];\n  int s, s1, s2, i, j, g = 0, k;\n  cin.getline(str, 201);\n  cin.getline(ch, 201);\n  cin.getline(ch1, 201);\n  s = strlen(str);\n  s1 = strlen(ch);\n  s2 = strlen(ch1);\n  strcpy(str1, str);\n  for (i = 0; i < s; i++) {\n    g = 0;\n    if (str[i] == ch[0] && ((i == 0) || (str[i - 1] == ' '))) {\n      for (j = i; j < s1 + i; j++) {\n        if (str[j] == ch[j - i])\n          g++;\n      }\n      if (g == s1 && (str[s1 + i] == ' ' || str[s1 + i] == '\\0')) {\n        for (k = 0; k < i; k++)\n          str1[k] = str[k];\n\n        for (k = i; k < i + s2; k++) {\n          str1[k] = ch1[k - i];\n        }\n        for (k = i + s2; k <= s + s2 - s1; k++) {\n          str1[k] = str[k + s1 - s2];\n        }\n        for (k = 0; k <= s + s2 - s1; k++)\n          str[k] = str1[k];\n        s = s + s2 - s1;\n      }\n    }\n  }\n  cout << str1 << \"\\n\";\n\n  return 0;\n}\n"}
{"label": "19", "index": "34471", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[80], s[30][20], test1[20], test2[20], *p;\n  int i, j, l, c, m = 0;\n  cin >> str;\n  cin >> test1;\n  cin >> test2;\n  p = str;\n  for (i = 0, c = 0; *(p + i) != ' '; i++, c++)\n    s[0][c] = *(p + i);\n  s[0][c] = '\u0000';\n  l = strlen(str);\n  m = 1;\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = i, c = 0; str[j] != ' '; j++, c++) {\n        s[m][c] = str[j];\n      }\n      s[m][c] = '\u0000';\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(test1, s[i]) == 0) {\n      strcpy(s[i], test2);\n    }\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", s[i]);\n  cout << s[m - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34472", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int t = 0;\n  char *p;\n  char *a, *b, *c;\n  p = (char *)malloc(200 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> p;\n\n  cin >> a;\n\n  cin >> b;\n  c = p;\n  while (*p != '\u0000') {\n    if (*p != ' ')\n      p = p + 1;\n    else {\n      *p = '\u0000';\n      p = p + 1;\n      if (strcmp(c, a) == 0)\n        printf(\"%s \", b);\n      else\n        cout << c << \" \";\n      c = p;\n    }\n  }\n  do {\n    if (strcmp(c, a) == 0)\n      cout << b;\n    else\n      cout << c;\n    t = 1;\n  } while ((*p == '\u0000') && (t = 0));\n}\n"}
{"label": "19", "index": "34473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char zfc[100][100];\n  int i, j, len, k = 1, wz[100];\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  len = strlen(s);\n  wz[0] = 0 - 1;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      wz[k] = i;\n      k++;\n    }\n  }\n  wz[k] = len;\n  for (i = 0; i < k; i++) {\n    for (j = wz[i] + 1; j < wz[i + 1]; j++)\n      zfc[i][j - wz[i] - 1] = s[j];\n    zfc[i][j - wz[i] - 1] = '\u0000';\n  }\n  if (strcmp(zfc[0], a) != 0) {\n    printf(\"%s\", zfc[0]);\n\n  } else {\n    printf(\"%s\", b);\n  }\n\n  for (i = 1; i < k; i++) {\n    if (strcmp(zfc[i], a) != 0) {\n      printf(\" %s\", zfc[i]);\n\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100][100];\n  int k = 0, y = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (int i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      t[k][i] = '\u0000';\n      k++;\n      y = i + 1;\n    } else\n      t[k][i - y] = s[i];\n  }\n  for (int j = 0; j <= k; j++) {\n    if (strcmp(t[j], a) == 0)\n      strcpy(t[j], b);\n  }\n  for (int x = 0; x < k; x++)\n    cout << t[x] << \" \";\n  printf(\"%s\", t[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34475", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  scanf(\"%s\", re);\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0)\n      strcpy(wd[i], x);\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  printf(\"%s\", wd[a]);\n  return 0;\n}\n"}
{"label": "19", "index": "34476", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  char x[20], y[20], z[100][20];\n  for (i = 0;; i++) {\n    scanf(\"%s\", &z[i]);\n    if (getchar() != ' ')\n      goto hell;\n  }\nhell:;\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  for (j = 0; j <= i; j++) {\n    if (strcmp(x, z[j]) == 0)\n      z[j][0] = 0;\n  }\n  for (j = 0; j <= i; j++) {\n    if (z[j][0] == 0) {\n      printf(\"%s\", y);\n    } else\n      printf(\"%s\", z[j]);\n    if (j != i)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34477", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char *p1, *p2, *p3, *p4;\n  int n1, n2, n3, flag = 1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  n1 = strlen(s);\n  n2 = strlen(a);\n  n3 = strlen(b);\n  while (p1 < s + n1) {\n    p2 = a;\n    p3 = b;\n    if (isalpha(*p1)) {\n      if (flag) {\n        flag = 0;\n        for (p4 = p1; p2 < a + n2; p4++, p2++)\n          if (*p4 != *p2)\n            break;\n        if ((p2 - a) == n2) {\n          for (; p3 < b + n3; p3++)\n            printf(\"%c\", *p3);\n          p1 = p1 + n2;\n        } else {\n          for (; isalpha(*p1); p1++)\n            printf(\"%c\", *p1);\n        }\n      }\n    } else {\n      printf(\" \");\n      flag = 1;\n      p1++;\n    }\n  }\n}\n"}
{"label": "19", "index": "34478", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str1[150], str2[50], str3[50];\nchar *p1 = str1, *p2 = str2, *p3 = str3;\n\nint compare(char *local, int len) {\n  p2 = str2;\n  char *p;\n  int flag = 1;\n  for (p = local; *p2 != '\u0000' && flag == 1 && p < local + len; p2++, p++)\n    if (*p != *p2)\n      flag = 0;\n  if (*p2 == '\u0000' && p == local + len)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  char newline[150];\n  char *news = newline, *local, *p;\n  int flag = 1, len = 0;\n\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  for (p1 = str1; p1 <= str1 + strlen(str1); p1++) {\n    if (isalpha(*p1))\n      if (flag == 1)\n        flag = 0, len = 1, local = p1;\n      else\n        len++;\n    else if (flag == 0) {\n      flag = 1;\n      if (compare(local, len))\n        for (p3 = str3; *p3 != '\u0000'; p3++, news++)\n          *news = *p3;\n      else\n        for (p = local; p < local + len; p++, news++)\n          *news = *p;\n      *news++ = *p1;\n    }\n  }\n  *news = '\u0000';\n  for (news = newline; *news != '\u0000'; news++)\n    cout << *news;\n\n  return 0;\n}\n"}
{"label": "19", "index": "34479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k;\n  cin.getline(a, 100, '\\n');\n  cin.getline(b, 100, '\\n');\n  cin.getline(c, 100, '\\n');\n  int l1 = strlen(a), l2 = strlen(b), l3 = strlen(c);\n  for (i = 0;; i++)\n    if (a[i] == ' ')\n      break;\n  for (j = 0; j <= i - 1; j++) {\n    if (a[j] != b[j]) {\n      for (k = 0; k <= i - 1; k++)\n        cout << a[k];\n      break;\n    }\n    if (j == i - 1)\n      cout << c;\n  }\n\n  for (i = 0; i <= l1 - 1; i++) {\n    if (a[i] != ' ')\n      continue;\n    for (j = 0; j <= l2 - 1; j++) {\n      if (a[i + j + 1] != b[j]) {\n        printf(\" \");\n        for (k = i + 1;; k++) {\n          if (a[k] == ' ' || k == l1)\n            break;\n          else\n            cout << a[k];\n        }\n        break;\n      }\n      if (j == l2 - 1) {\n        cout << \" \" << c;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34480", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n\n  cin >> str;\n\n  scanf(\"%s \", wrd);\n\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((*(str + i) != ' ') && (*(str + i) != '\u0000')) {\n      *(wd + j) = *(str + i);\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          *(str + k) = '\u0000';\n        for (k = i; k < n; k++) {\n          *(sr + k - i) = *(str + k);\n          *(str + k) = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          *(sr + k) = '\u0000';\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n    }\n  }\n  puts(str);\n}\n"}
{"label": "19", "index": "34481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[100][100], str1[100], str2[100];\n  int i = 0, j;\n  do {\n    cin >> ch[i];\n    i++;\n  } while (getchar() != '\\n');\n  cin >> str1 >> str2;\n  for (j = 0; j < i; j++) {\n    if (strcmp(str1, ch[j]) == 0) {\n      strcpy(ch[j], str2);\n    }\n  }\n  for (j = 0; j < i - 1; j++)\n\n    cout << ch[j] << \" \";\n\n  cout << ch[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34482", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100], p[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  strcat(s1, \" \");\n  int len, i, j, n = 0, y;\n  len = strlen(s1);\n  for (i = 0; i < len; i++) {\n    if (s1[i] == ' ')\n      n++;\n  }\n  int t = 0;\n  for (y = 0; y < n; y++) {\n    for (i = t, j = 0; i < len; i++, j++) {\n      if (s1[i] != ' ') {\n        p[j] = s1[i];\n      } else {\n        p[j] = '\u0000';\n        t = i + 1;\n        break;\n      }\n    }\n    if (strcmp(p, s2) == 0) {\n      strcpy(p, s3);\n    }\n    printf(\"%s\", p);\n    if (y < n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34483", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000];\n  int ls, la, lb, i, j, pointer = 0, t, m = 0, n = 0;\n  cin.get(s, 1000);\n  cin >> a;\n  scanf(\"%s \", b);\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    int counter = 0;\n\n    for (j = 0; j < la; j++) {\n      if (s[i + j] == a[j]) {\n        counter++;\n        continue;\n      } else {\n        break;\n      }\n    }\n    if (counter == la && (s[i] == a[0] && (i == 0 || s[i - 1] == ' '))) {\n\n      for (t = 0; t < lb; t++) {\n        c[pointer] = b[t];\n        pointer++;\n      }\n\n      i = i + la - 1;\n    } else {\n      c[pointer] = s[i];\n      pointer++;\n    }\n  }\n  c[pointer] = '\\0';\n  for (j = 0; j < pointer; j++)\n    cout << c[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, old[100] = {0}, by[100] = {0}, a1[100] = {0};\n  int s1, s2, s3, i, j, k, l = 1, mark[100] = {0};\n  int rem[10] = {0};\n\n  cin >> a;\n  cin >> old;\n  cin >> by;\n  s1 = strlen(a);\n  s2 = strlen(old);\n  s3 = strlen(by);\n  for (i = 0; i < s1; i++) {\n    k = 0;\n    if ((a[i - 1] == ' ' || i == 0) && ((i + s2 == s1) || a[i + s2] == ' ')) {\n      for (j = i; j < i + s2; j++) {\n        if (a[j] == old[j - i]) {\n          k += 1;\n        }\n      }\n      if (k == s2) {\n        for (j = i; j < i + s2; j++)\n          mark[j] = 1;\n        cout << by;\n      }\n    }\n    if (mark[i] > 0)\n      continue;\n    cout << a[i];\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, t;\n  int i, j, k = -1;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ') {\n      n++;\n    }\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n      if (a[j] != d[k]) {\n        t = 0;\n      }\n    }\n    if (t == 1 && strlen(a) == strlen(words[i])) {\n      for (j = 0; b[j] != '\u0000'; j++) {\n        words[i][j] = b[j];\n      }\n    }\n    words[i][j] = '\u0000';\n    t = 1;\n  }\n  printf(\"%s\", words[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %s\", words[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34486", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int k, i, j, r, h, l, m, n, p, q;\n  char s[101], a[101], b[101], c[101];\n  cin.getline(s, 101);\n  cin >> a >> b;\n  k = strlen(s);\n  i = strlen(a);\n  j = strlen(b);\n  for (r = 0; r <= k - i + 1; r++) {\n    for (h = r, l = 0; h < r + i; h++, l++)\n      if (s[h] != a[l])\n        break;\n    if (l == i && ((r == 0 && s[r + i] == ' ') ||\n                   (r > 0 && s[r - 1] == ' ' && s[r + i] == ' ') ||\n                   (r + i == k && s[r - 1] == ' '))) {\n      for (m = 0, n = r + i; m <= k - r - i; m++, n++)\n        c[m] = s[n];\n      for (p = 0, q = r; p <= j; p++, q++)\n        s[q] = b[p];\n      strcat(s, c);\n      k = k - i + j;\n      r = r + j;\n    }\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34487", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int lenth1, lenthw1, lenthw2, i, j, num = 0, row = 0, flag, a[101];\n  char s1[101], word[101], wordnew[101], olds1[101][101];\n  cin.getline(s1, 101);\n  cin >> word;\n  cin >> wordnew;\n  lenth1 = strlen(s1);\n  lenthw1 = strlen(word);\n  lenthw2 = strlen(wordnew);\n  for (i = 0; i < lenth1; i++) {\n    if (s1[i] == ' ') {\n      num++;\n      row = 0;\n    } else {\n      olds1[num][row] = s1[i];\n      a[num] = row;\n      row++;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    flag = 1;\n    for (j = 0; j < lenthw1; j++) {\n      if (olds1[i][j] != word[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      a[i] = lenthw2 - 1;\n      for (j = 0; j < lenthw2; j++)\n        olds1[i][j] = wordnew[j];\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j <= a[i]; j++)\n      cout << olds1[i][j];\n    cout << \" \";\n  }\n  for (j = 0; j <= a[num]; j++)\n    cout << olds1[num][j];\n  return 0;\n}\n"}
{"label": "19", "index": "34488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int ls, la, lb, i, j, m;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && s[i - 1] == ' ' || s[0] == a[0]) {\n      m = 1;\n      for (j = 1; j < la; j++) {\n        if (s[i + j] != a[j]) {\n          m = 2;\n        }\n      }\n      if (m == 1) {\n        char x[100];\n        strcpy(x, s);\n        for (j = i; j < i + lb; j++) {\n          s[j] = b[j - i];\n        }\n        for (j = i + lb; j < ls + lb - la; j++) {\n          s[j] = x[j - lb + la];\n        }\n        ls = ls - la + lb;\n        i = i + lb - 1;\n      }\n    }\n  }\n  for (i = 0; i < ls; i++) {\n    cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34489", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, i, j = 0, k = 0;\n  char s[100], a[20], b[20], str[50][20] = {\" \"}, (*p)[20];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    if (s[i] != ' ')\n      str[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n    if (s[i + 1] == '\u0000')\n      j++;\n  }\n  p = &str[0];\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, *(p + i)) == 0)\n      strcpy(*(p + i), b);\n  }\n  for (i = 0; i < j; i++) {\n    if (i == 0)\n      cout << *(p + i);\n    else\n      printf(\" %s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "34490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char s1[101][101];\n  int i, j, k;\n  k = 0;\n  j = 0;\n  i = 0;\n  int tag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    s1[j][k] = s[i];\n    k++;\n    if (s[i] == ' ') {\n      s1[j][k - 1] = '\u0000';\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  s1[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s1[i], a) == 0)\n      strcpy(s1[i], b);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", s1[i]);\n  }\n  cout << s1[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[102], a[101], b[101];\n  char s0[101] = {'\u0000'}, c[101] = {'\u0000'};\n  int i, j = 0, t;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s0[j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' || s[i + 1] == '\u0000') {\n      if (strcmp(s0, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \"); \n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      } else {\n        strcat(c, s0);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      }\n    }\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] == ' ' && c[i + 1] == '\u0000')\n      c[i] = '\u0000';\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "34492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *c, *e;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  e = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", c);\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    s = s + strlen(c) + 1;\n    if (s >= e)\n      break;\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34493", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s0[2001], s1[201], s2[201];\n  cin.getline(s0, 2000);\n  cin.getline(s1, 200);\n  cin.getline(s2, 200);\n  int L0 = 0, L1 = 0, L2 = 0;\n  while (s0[L0] != 0)\n    L0++;\n  while (s1[L1] != 0)\n    L1++;\n  while (s2[L2] != 0)\n    L2++;\n  if (L1 == 0) {\n    cout << s0;\n    return 0;\n  }\n  for (int i = 0; i <= L0 - L1; i++) {\n    int is = 0;\n    for (int j = 0; j < L1; j++)\n      if (s0[i + j] != s1[j]) {\n        is++;\n        break;\n      }\n    if (is != 0)\n      continue;\n    if ((i != 0 && s0[i - 1] != ' ') || (s0[i + L1] != ' ' && s0[i + L1] != 0))\n      continue;\n    if (L1 > L2)\n      for (int j = i + L1; j < L0; j++)\n        s0[j + L2 - L1] = s0[j];\n    else\n      for (int j = L0 - 1; j >= i + L1; j--)\n        s0[j + L2 - L1] = s0[j];\n    for (int j = i; j < i + L2; j++)\n      s0[j] = s2[j - i];\n    L0 += L2 - L1;\n    i += L2;\n  }\n  s0[L0] = 0;\n  cout << s0;\n  return 0;\n}\n"}
{"label": "19", "index": "34494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p[200], *p1, *p2;\n  int i = 0, n, j;\n  for (i = 0; i < 200; i++)\n    p[i] = (char *)malloc(100 * sizeof(char));\n  i = 0;\n  for (j = 0; (*(p[i] + j) = getchar()) != '\\n'; j++) {\n    if (*(p[i] + j) == ' ') {\n      *(p[i] + j) = '\\0';\n      i++;\n      j = -1;\n    }\n  }\n  *(p[i] + j) = '\\0';\n  n = i;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s\\n%s\", p1, p2);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], p1) == 0) {\n      strcpy(p[i], p2);\n    }\n  }\n  cout << p[0];\n  for (i = 1; i <= n; i++) {\n    printf(\" %s\", p[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34495", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c = ' ';\n  char *str1, *str2;\n  str1 = (char *)malloc(100 * sizeof(char));\n  str2 = (char *)malloc(100 * sizeof(char));\n\n  char str[100][100];\n  int i, n = 0;\n  for (i = 0; i < 100; i++) {\n    strcpy(str[i], \"\\0\");\n    cin >> str[i];\n    if (c = getchar() != ' ')\n      break;\n    n++;\n  }\n  strcpy(str1, \"\\0\");\n  strcpy(str2, \"\\0\");\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n\n  for (i = 0; i <= n; i++) {\n    if (strcmp(str1, str[i]) == 0)\n      strcpy(str[i], str2);\n  }\n  for (i = 0; i <= n - 1; i++)\n    cout << str[i] << \" \";\n  printf(\"%s\", str[n]);\n}\n"}
{"label": "19", "index": "34496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[100], s[100], d[100], e[30][30];\n  int m = 0, n = 0, l, i;\n  cin >> c;\n  l = strlen(c);\n  cin >> s;\n  cin >> d;\n  for (i = 0; i < (l + 1); i++) {\n    e[m][n] = c[i];\n    n++;\n    if (c[i] == ' ') {\n      e[m][n - 1] = 0;\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i <= m; i++)\n    if (strcmp(s, e[i]) == 0)\n      strcpy(e[i], d);\n  cout << e[0];\n  for (i = 1; i <= m; i++)\n    cout << \" \" << e[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[20][20], d[100], b[20], c[20];\n  int n, j = 0, k = 0, flag = 0, x;\n\n  cin >> d;\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(c);\n  for (; x < 20; x++)\n    c[x] = '\u0000';\n  n = strlen(d);\n  for (int i = 0; i < n; i++) {\n    if (d[i] != ' ')\n      a[j][k++] = d[i];\n    else {\n      for (; k < 20;)\n        a[j][k++] = '\u0000';\n      flag = flag + 1;\n      j++;\n      k = 0;\n    }\n  }\n  for (int m = 0; m < 20; m++)\n    if (a[flag][m] == d[n - 1])\n      k = m + 1;\n  for (; k < 20;)\n    a[flag][k++] = '\u0000';\n  for (int p = 0; p < 20; p++)\n    if (strcmp(a[p], b) == 0)\n      strncpy(a[p], c, 20);\n  printf(\"%s\", a[0]);\n  for (int l = 1; l < flag + 1; l++)\n    printf(\" %s\", a[l]);\n  return 0;\n}\n"}
{"label": "19", "index": "34498", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[1000], a[100], b[100], p[100][100];\n\n  cin >> s;\n  cin >> a >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      j++;\n      k = 0;\n    } else {\n      p[j][k] = s[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(p[i], a) == 0) {\n      strcpy(p[i], b);\n    }\n  }\n  cout << p[0];\n  for (i = 1; i <= j; i++) {\n    cout << ' ' << p[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34499", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p;\n  s = (char *)malloc(100);\n  a = (char *)malloc(20);\n  b = (char *)malloc(20);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  int i;\n  while (*s != '\u0000') {\n    if (*s != ' ')\n      s = s + 1;\n    else if (*s == ' ') {\n      *s = '\u0000';\n      s = s + 1;\n      if (strcmp(p, a) == 0)\n        printf(\"%s \", b);\n      else {\n        cout << p << \" \";\n      }\n      p = s;\n    }\n  }\n  if (strcmp(p, a) == 0) {\n    printf(\"%s\", b);\n  } else\n    printf(\"%s\", p);\n  return 0;\n}\n"}
{"label": "19", "index": "34500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], x[200] = \" \";\n  int i = 0, j = 0, k = 0, count = 0, ls, la, lb, l, end = 0;\n  cin.getline(s, 200);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  ls = strlen(s), la = strlen(a), lb = strlen(b);\n  while (i < ls) {\n    count = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        break;\n      else\n        count++;\n    }\n    if ((count != la) || (i != 0 && count == la && s[i - 1] != ' ')) {\n      x[k] = s[i];\n      k++, i++;\n    } else {\n      i = i + la;\n      end = k + lb;\n      for (; k < end; k++) {\n        x[k] = b[k - end + lb];\n      }\n    }\n  }\n  cout << x;\n  return 0;\n}\n"}
{"label": "19", "index": "34501", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar str[101], a[101], b[101], c[101];\nint i = 0, len_str, len_a, len_b, pos;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34502", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], x[101] = {0};\n  int i, j, n, m;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == a[0] && s[i - 1] == ' ') || s[0] == a[0]) {\n      for (j = 0; j < n; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (n == j)\n        x[i] = 1;\n    }\n  }\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (x[i] == 0)\n      printf(\"%c\", s[i]);\n    else if (x[i] == 1) {\n      for (j = 0; j < m; j++)\n        printf(\"%c\", b[j]);\n      i += n - 1;\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], zfc[100][100], a[100], b[100];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int n = strlen(s);\n  int i = 0, j, k = 0;\n  for (j = 0; j <= n; j++) {\n    if (s[j] == ' ' || s[j] == ',' || s[j] == '\u0000') {\n      if (k != 0) {\n        zfc[i][k] = '\u0000';\n        i++;\n      }\n      k = 0;\n    } else {\n      zfc[i][k] = s[j];\n      k++;\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    if (strcmp(zfc[j], a) == 0)\n      strcpy(zfc[j], b);\n    printf(\"%s \", zfc[j]);\n  }\n  if (strcmp(zfc[j], a) == 0) {\n    strcpy(zfc[j], b);\n  }\n  printf(\"%s \", zfc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34504", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[200];\n  int i, j = 0, k = 0, z = 0, p, q, r, m, h = 0, v;\n  int t[100], n[100];\n  char u, w;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  r = strlen(c);\n  u = a[0];\n  for (i = 0; i < r; i++) {\n    w = c[i];\n    if (u == w) {\n      if (i == 0 || c[i - 1] == ' ') {\n        t[j] = i;\n        j += 1;\n      } else {\n        k += 1;\n      }\n    } else {\n      k += 1;\n    }\n  }\n  if (k == r) {\n    printf(\"%s\", c);\n  } else {\n    for (k = 0; k < j; k++) {\n      for (i = 1; i < p; i++) {\n        m = t[k];\n        u = a[i];\n        w = c[m + i];\n        if (u != w) {\n          z += 1;\n          break;\n        }\n      }\n      if (i == p) {\n        n[h] = t[k];\n        h += 1;\n      }\n    }\n    if (z == j) {\n      printf(\"%s\", c);\n    } else {\n      m = n[0];\n      if (m == 0) {\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      } else {\n        for (i = 0; i < n[0]; i++) {\n          printf(\"%c\", c[i]);\n        }\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101], q[101];\n  int m, i, k, t, n, l, N, z = 0;\n\n  scanf(\"%s \", a);\n  m = strlen(a);\n  strcpy(q, a);\n\n  scanf(\"%s%s\", &b, &c);\n  n = strlen(b);\n  l = strlen(c);\n\n  for (i = 0; i < m; i++) {\n    N = n;\n\n    if ((i == 0) ||\n        (a[i - 1] == 32 && a[i] == b[0] && (a[i + n] == 32 || a[i + n] == '\u0000')))\n      for (k = i, t = 0; t < n && k < m; k++, t++) {\n        if (a[k] == b[t])\n          N--;\n      }\n    if (N == 0) {\n      z = 1;\n\n      if (n >= l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m - (n - l)] = '\u0000';\n      }\n      if (n < l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m + (l - n)] = '\u0000';\n      }\n      m = strlen(a);\n      strcpy(q, a);\n    }\n  }\n\n  if (z == 1)\n    printf(\"%s\", a);\n  if (z == 0 && N != 0)\n\n    for (i = 0; i < m; i++)\n      cout << q[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34506", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], zfc[100][100], a[100], b[100];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int n = strlen(s);\n  int i = 0, j, k = 0;\n  for (j = 0; j <= n; j++) {\n    if (s[j] == ' ' || s[j] == ',' || s[j] == '\u0000') {\n      if (k != 0) {\n        zfc[i][k] = '\u0000';\n        i++;\n      }\n      k = 0;\n    } else {\n      zfc[i][k] = s[j];\n      k++;\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    if (strcmp(zfc[j], a) == 0)\n      strcpy(zfc[j], b);\n    printf(\"%s \", zfc[j]);\n  }\n  if (strcmp(zfc[j], a) == 0) {\n    strcpy(zfc[j], b);\n  }\n  printf(\"%s \", zfc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34507", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[40][101] = {'\\0'};\n  char c[101] = {'\\0'};\n  cin.getline(c, 101);\n  int i = 0, j = 0, k = 0;\n  while (c[i] != '\\0') {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    }\n    if (c[i] == ' ') {\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  char st1[100], st2[100];\n  cin >> st1;\n  cin >> st2;\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(str[i], st1) == 0)\n      strcpy(str[i], st2);\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  cout << str[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z, j, k = 0, l, y, x, p = 1;\n  char *s, *a, *b, **o;\n  s = (char *)malloc(1000 * sizeof(char));\n  a = (char *)malloc(110 * sizeof(char));\n  b = (char *)malloc(110 * sizeof(char));\n  o = (char **)malloc(10 * sizeof(char *));\n  for (i = 0; i < 10; i++)\n    o[i] = (char *)malloc(110 * sizeof(char));\n  cin >> o[k];\n  z = strlen(o[k]);\n  cin >> a >> b;\n  y = strlen(a);\n  x = strlen(b);\n  while (p == 1) {\n    p = 0;\n    for (i = 0; i < z; i++) {\n      if (o[k][i] == a[0] && (o[k][i - 1] == ' ' || i == 0)) {\n        for (l = 1; l < y; l++)\n          if (a[l] != o[k][i + l])\n            break;\n        if (l == y) {\n          p = 1;\n          for (j = 0; j < i; j++)\n            o[k + 1][j] = o[k][j];\n          for (j = i; j < i + x; j++)\n            o[k + 1][j] = b[j - i];\n          for (j = i + x; j < z - y + x; j++)\n            o[k + 1][j] = o[k][j + y - x];\n          k++;\n          z = z - y + x;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    cout << o[k][i];\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int t = 0;\n  char *p;\n  char *a, *b, *c;\n  p = (char *)malloc(200 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> p;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  c = p;\n  while (*p != '\u0000') {\n    if (*p != ' ')\n      p = p + 1;\n    else {\n      *p = '\u0000';\n      p = p + 1;\n      if (strcmp(c, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", c);\n      c = p;\n    }\n  }\n  do {\n    if (strcmp(c, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    t = 1;\n  } while ((*p == '\u0000') && (t = 0));\n}\n"}
{"label": "19", "index": "34510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100], str1[100], str2[100], (*p)[100];\n  int i, k;\n  for (i = 0;; i++) {\n    scanf(\"%s\", str[i]);\n    k = i;\n    if (getchar() == ' ')\n      break;\n  }\n  p = str;\n\n  cin >> str1;\n\n  cin >> str2;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(*(p + i), str1) == 0)\n      strcpy(*(p + i), str2);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i < k)\n      printf(\"%s \", *(p + i));\n    else\n      cout << *(p + i);\n  }\n}\n"}
{"label": "19", "index": "34511", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar w[100];\nchar m[200][200];\nchar a[200], b[200];\nint main() {\n\n  cin >> w;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = 0, q = 0, r;\n  for (r = 0; w[r] != '\u0000'; r++) {\n    if (w[r] == ' ') {\n      p++;\n      q = 0;\n    } else {\n      m[p][q] = w[r];\n      q++;\n    }\n  }\n  int i, x;\n  for (i = 0; i < p + 1; i++) {\n    if (strcmp(m[i], a) == 0) {\n      for (x = 0; x < (strlen(b) + 1); x++)\n        m[i][x] = b[x];\n    }\n  }\n  printf(\"%s\", m[0]);\n  for (i = 1; i < p + 1; i++)\n    printf(\" %s\", m[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34512", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *p, *max, *min;\n  char s[110], a[110], b[110];\n  int l = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  p = strtok(s, \" \");\n\n  while (p) {\n    if (l != 0)\n      printf(\" \");\n    if (strcmp(p, a) == 0)\n      p = b;\n    printf(\"%s\", p);\n    p = strtok(NULL, \" \");\n    l++;\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "34513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char d, a[100][100] = {0}, b[100] = {0}, c[100] = {0};\n  j = 0;\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    else if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(a[j] + i) = d;\n      i++;\n    } else {\n      i = 0;\n      j++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(b + i) = d;\n      i++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(c + i) = d;\n      i++;\n    }\n  }\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (j = 1;; j++) {\n    if (*a[j] == 0) {\n      printf(\"\\n\");\n      break;\n    } else {\n      printf(\" \");\n      if (strcmp(a[j], b) == 0)\n        printf(\"%s\", c);\n      else\n        printf(\"%s\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34514", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n\n  scanf(\"%s \", str);\n  char danci[101][101];\n  int i, k, n, len;\n  k = 0;\n  n = 0;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      danci[n][k] = str[i];\n      k++;\n    } else {\n      danci[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  danci[n][k] = '\u0000';\n  cin >> a;\n  scanf(\"%s\", b);\n  int e;\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(danci[i], a) == 0) {\n      strcpy(danci[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s\", danci[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "34515", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char a[100], b[100], c[100], d[10000];\n  int i = 0, j = 0, k, la, lb, lc, s = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    for (k = 0, s = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        s = s + 1;\n      i = i + 1;\n    }\n\n    if ((a[i - k - 1] == ' ') && (s == lb) || ((i - k == 0) && (s == lb))) {\n      i = i - 1;\n      for (k = 0; k < lc; k = k + 1) {\n        d[j] = c[k];\n        j = j + 1;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j = j + 1;\n    }\n  }\n  cout << d;\n}\n"}
{"label": "19", "index": "34516", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char d[30][20] = {\"\"}, e[20] = {\"\"}, f[20] = {\"\"}, *a[30], *b, *c;\n  int i, num = 1;\n  for (i = 0; i < 30; i++)\n    *(a + i) = *(d + i);\n  b = e;\n  c = f;\n  cin >> *a;\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", *(a + i));\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(*(a + i), b) == 0)\n      strcpy(*(a + i), c);\n  }\n  printf(\"%s\", *a);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", *(a + i));\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][100];\n  char c[101], word1[100], replaceword[100];\n\n  cin >> c;\n  cin >> word1;\n  cin >> replaceword;\n  int i, j = 0, k = 0;\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    } else {\n      str[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  str[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], replaceword);\n  }\n  cout << str[0];\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  int j = 0;\n  int begin;\n  int end;\n  char now[101];\n  char sen[1000];\n  char old[101];\n  char newone[101];\n\n  cin >> sen;\n\n  cin >> old;\n\n  scanf(\"%s \", newone);\n  while (sen[i] != '\u0000') {\n    now[j] = sen[i];\n    if (j == 0)\n      begin = i;\n    if (now[j] == ' ' || sen[i + 1] == '\u0000') {\n\n      end = i;\n      if (sen[i + 1] == '\u0000')\n        now[j + 1] = '\u0000';\n      else\n        now[j] = '\u0000';\n      if (strcmp(now, old) == 0) {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", newone);\n        else\n          printf(\"%s \", newone);\n\n      } else {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", now);\n        else\n          printf(\"%s \", now);\n      }\n      j = -1;\n    }\n    i++;\n    j++;\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a, l, sum = 0;\n  char s[101];\n  char s1[101];\n  char s2[101];\n  char s0[101];\n  cin.getline(s, 101);\n  cin >> s1;\n  cin >> s2;\n  int k1 = strlen(s);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] == s1[0] && s[strlen(s1) + i] == ' ' && s[i - 1] == ' ') ||\n        (i == 0 && s[i] == s1[0] && s[strlen(s1) + i] == ' ') ||\n        (s[i] == s1[0] && s[i - 1] == ' ' && i + strlen(s1) == strlen(s))) {\n      for (a = 0; a < strlen(s) - i - strlen(s1); a++)\n        s0[a] = s[i + strlen(s1) + a];\n      for (j = 0; j < strlen(s2); j++)\n        s[i + j] = s2[j];\n      for (l = 0; l < strlen(s0); l++)\n        s[i + j + l] = s0[l];\n      sum++;\n      i = i + strlen(s2) - strlen(s1);\n    }\n  }\n  for (k = 0; k < k1 + sum * strlen(s2) - sum * strlen(s1); k++)\n    printf(\"%c\", s[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[150], from[150], to[150], a[50];\n  char *p = str;\n  int i;\n\n  cin >> str;\n\n  cin >> from;\n\n  cin >> to;\n\n  while (*p) {\n    for (i = 0; *p != ' ' && *p != '\u0000'; p++, i++) {\n      a[i] = *p;\n    }\n    a[i] = '\u0000';\n    if (strcmp(a, from) == 0)\n      printf(\"%s\", to);\n    else\n      printf(\"%s\", a);\n    if (*p) {\n      printf(\" \");\n      p++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34521", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], str1[101], str2[101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  int i, len = strlen(str), n = 0;\n  char *p[101];\n  p[n] = str;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ') {\n      str[i] = 0;\n      p[++n] = &str[i + 1];\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], str1) == 0) {\n      printf(\"%s\", str2);\n    } else\n      printf(\"%s\", p[i]);\n    if (i != n)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34522", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p[200], *p1, *p2;\n  int i = 0, n, j;\n  for (i = 0; i < 200; i++)\n    p[i] = (char *)malloc(100 * sizeof(char));\n  i = 0;\n  for (j = 0; (*(p[i] + j) = getchar()) != '\\n'; j++) {\n    if (*(p[i] + j) == ' ') {\n      *(p[i] + j) = '\\0';\n      i++;\n      j = -1;\n    }\n  }\n  *(p[i] + j) = '\\0';\n  n = i;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s %s \", p1, p2);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], p1) == 0) {\n      strcpy(p[i], p2);\n    }\n  }\n  printf(\"%s\", p[0]);\n  for (i = 1; i <= n; i++)\n    printf(\" %s\", p[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, al, bl, cl;\n  char c[1000] = {\"\"}, a[100] = {\"\"}, b[100] = {\"\"};\n  char *p, *q;\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (p = c; p < c + cl;) {\n    q = p;\n    for (; *q != ' ' && *q != '\u0000'; q++)\n      ;\n    if ((q - p) != al) {\n      for (; p < q; p++)\n        printf(\"%c\", *p);\n      if (q != c + cl)\n        printf(\" \"), p++;\n    } else {\n      for (j = 0, q = p; j < al; q++, j++)\n        if (*q != a[j])\n          break;\n      if (j == al) {\n        if (q != c + cl)\n          printf(\"%s \", b);\n        else\n          printf(\"%s\", b);\n        p = p + al + 1;\n      } else\n        for (; p <= q; p++)\n          printf(\"%c\", *p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34524", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zf1[110], zfa[110], zfb[110];\n\n  cin >> zf1;\n\n  cin >> zfa;\n\n  cin >> zfb;\n  int x = strlen(zf1);\n  int y = strlen(zfa);\n  int z = strlen(zfb);\n  int i, j;\n  int k = 0, m = 0, g = 0, h = 0;\n  int sz[100];\n  for (i = 0; i < x; i++) {\n    if (i == 0) {\n      if (zf1[i] == zfa[0]) {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n    if (i != 0) {\n      if (zf1[i] == zfa[0] && zf1[i - 1] == ' ') {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n  }\n  for (j = 0; j < x; j++) {\n    h = 0;\n    for (i = 0; i < m; i++) {\n      if (j == sz[i]) {\n        printf(\"%s\", zfb);\n        j = j + y - 1;\n        h = 1;\n        break;\n      }\n    }\n\n    if (h != 1) {\n      printf(\"%c\", zf1[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34525", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, w, nw = 0, ns, na, nb, rem[102], flag, FLAG = 0;\n  char s[102], a[102], b[102];\n  int vest[102];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n  for (i = 0; i < ns; i++) {\n\n    if (s[i] != ' ' && FLAG == 0) {\n      FLAG = 1;\n      flag = 0;\n      for (k = i, j = 0; j < na; j++, k++) {\n        if (s[k] != a[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0 && (s[k] == ' ' || s[k] == '\u0000')) {\n        rem[nw] = i;\n        nw++;\n      }\n    } else {\n      FLAG = 0;\n    }\n  }\n  for (w = 0; w < nw; w++) {\n    if (nb == na) {\n      for (k = 0; k < na; k++) {\n        s[k + rem[w]] = b[k];\n      }\n    } else if (nb > na) {\n      ns = ns + nb - na;\n      s[ns] = '\u0000';\n      for (k = ns - 1; k > rem[w]; k--) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    } else {\n      ns = ns + nb - na;\n      for (k = rem[w] + 1; k < ns; k++) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    }\n  }\n  for (i = 0; i < ns; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34526", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char words[100][100];\n  char ti[100], bt[100];\n  int i, j, k, n;\n  int a[200];\n\n  cin >> s;\n  scanf(\"%s\", ti);\n  scanf(\"%s\", bt);\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n; i++) {\n    if (strcmp(ti, words[i]) == 0) {\n      strcpy(words[i], bt);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%s\", words[0]);\n    else\n      printf(\" %s\", words[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34527", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length_s, length_a, i, j, k;\n  char s[128], a[128], b[128];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  length_s = strlen(s);\n  length_a = strlen(a);\n\n  for (i = 0; i < length_s; i++) {\n    j = 0;\n    if (s[i] == a[j] && (i == 0 || s[i - 1] == ' ')) {\n      k = i;\n      while (s[i] == a[j] && s[i] > 0) {\n        j++;\n        i++;\n      }\n\n      if (j == length_a) {\n        printf(\"%s\", b);\n        i--;\n\n      }\n\n      else {\n        while (k <= i) {\n          printf(\"%c\", s[k]);\n          k++;\n        }\n      }\n\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34528", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[100], c1[100], c2[100];\nint pd(int l) {\n  int i, j, k;\n  char temp;\n  k = 0;\n  for (i = 0; i < 1; i) {\n\n    if (str[l] != c1[k])\n      return 0;\n    k++;\n    temp = str[l + 1];\n    if ((temp == ' ') || (temp == '\t') || (temp == ' ') || (temp == ' '))\n\n    {\n\n      if (k == (strlen(c1)))\n        return 1;\n      else\n        return 0;\n    }\n    l++;\n  }\n}\n\nint main() {\n  char temp;\n  int i, j, n, k, m;\n  cin >> str;\n  cin >> c1;\n  cin >> c2;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      temp = str[i - 1];\n    if (i == 0)\n      temp = 0;\n    if ((i == 0) || (temp == ' ') || (temp == '\t') || (temp == ' ') ||\n        (temp == ' ')) {\n      k = pd(i);\n      m = 0;\n      if (k == 1) {\n        printf(\"%s\", c2);\n        i = i + strlen(c1) - 1;\n      }\n\n      else\n        printf(\"%c\", str[i]);\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, l1, l2;\n\n  cin >> s;\n  scanf(\"%s %s\", a, b);\n  getchar();\n  l1 = strlen(s);\n  l2 = strlen(a);\n  for (i = 0; i < l1; i++) {\n    if (i == 0) {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i + l2] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        cout << s[i];\n      }\n    } else {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n    }\n  }\n  printf(\" \");\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100];\n\n  cin >> zfc;\n  char b[100][100];\n  int l = strlen(zfc);\n  int n = 0, k = 0, i;\n  for (i = 0; i < l; i++) {\n    if (zfc[i] != ' ' && zfc[i] != ',') {\n      b[n][k] = zfc[i];\n      k++;\n    } else {\n      b[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  b[n][k] = '\u0000';\n  char h[100], f[100];\n\n  cin >> h;\n\n  cin >> f;\n  int j;\n  for (j = 0; j < n; j++) {\n    if (strcmp(b[j], h) == 0) {\n      strcpy(b[j], f);\n      printf(\"%s \", b[j]);\n    } else {\n      printf(\"%s \", b[j]);\n    }\n  }\n  if (strcmp(b[n], h) != 0)\n    printf(\"%s\", b[n]);\n  if (strcmp(b[n], h) == 0)\n    printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "34531", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][101], a[101], b[101];\n  int i = 0, j = 0, k = 0;\n  for (i = 0;;) {\n    for (j = 0;; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        i++;\n        break;\n      }\n      if (s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      break;\n    }\n  }\n  s[i][j] = '\u0000';\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; k <= i; k++) {\n    if (strcmp(s[k], a) == 0) {\n      strcpy(s[k], b);\n    }\n  }\n  for (k = 0; k <= i; k++) {\n    if (k == 0)\n      printf(\"%s\", s[k]);\n    else\n      cout << \" \" << s[k];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34532", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000], strd[20], strb[20];\n  char zfc[50][200];\n\n  cin >> str;\n\n  int i, k;\n  int j = 0, n = 0;\n\n  for (i = 0; str[i] != '\u0000'; i++) {\n\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(zfc[n], (str + j));\n      n++;\n      j = i + 1;\n    }\n  }\n  strcpy(zfc[n], (str + j));\n  n++;\n\n  cin >> strb;\n\n  cin >> strd;\n\n  for (k = 0; k < n; k++) {\n\n    if (strcmp(strb, zfc[k]) == 0)\n      strcpy(zfc[k], strd);\n  }\n\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %s\", zfc[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34533", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char stc[201], wrd1[101], wrd2[101], wrdd[100][101];\n  int i, j = 0, k = 0, l = 0;\n  cin >> stc;\n  cin >> wrd1;\n  cin >> wrd2;\n  for (i = 0; stc[i] != '\u0000'; i++) {\n    if (stc[i] != ' ')\n      wrdd[j][k] = stc[i], k++;\n    else\n      wrdd[j][k] = '\u0000', j++, k = 0;\n  }\n  for (i = 0; i <= j; i++)\n    if (strcmp(wrd1, wrdd[i]) == 0)\n      strcpy(wrdd[i], wrd2);\n  for (i = 0, k = 0; l <= j; i++) {\n    if (wrdd[l][k] != '\u0000')\n      stc[i] = wrdd[l][k], k++;\n    else\n      stc[i] = ' ', l++, k = 0;\n  }\n  stc[i - 1] = '\u0000';\n  puts(stc);\n  return 0;\n}\n"}
{"label": "19", "index": "34534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str[101], target[10001], a[101], b[101], c[101];\nint i = 0, j = 0, k = 0, len_str, len_a, len_b, pos = 0, t = 0;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      cout << c;\n    if (i == len_str)\n      printf(\" \");\n    else\n      cout << \" \";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34535", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], s[100][20] = {'\u0000'};\n  cin >> a;\n  cin >> b;\n  scanf(\"%s \", c);\n  int len, i, m = 0, n = 0;\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != ' ') {\n      s[m][n] = a[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i < m + 1; i++) {\n    if (strcmp(s[i], b) == 0) {\n      strcpy(s[i], c);\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", s[i]);\n  }\n  printf(\"%s \", s[m]);\n  return 0;\n}\n"}
{"label": "19", "index": "34536", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[102], a[102], b[102];\n  char temp[102] = {0};\n  unsigned int i, j;\n  unsigned int sum = 0;\n  unsigned int sum1 = 0;\n  int flag = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; i < strlen(s); i++) {\n\n    if (s[i] != ' ') {\n      sum1 = sum1 + 1;\n      if (i != strlen(s) - 1)\n        continue;\n      else {\n        i = i + 1;\n        flag = 1;\n      }\n    }\n    for (j = 0; j < strlen(a) && strlen(a) == sum1; j++) {\n      if (s[i - sum1 + j] == a[j])\n        sum = sum + 1;\n    }\n    if (sum == strlen(a)) {\n      for (j = 0; j < strlen(b); j++) {\n        printf(\"%c\", b[j]);\n      }\n    } else {\n      for (j = 0; j < sum1; j++)\n        printf(\"%c\", s[i - sum1 + j]);\n    }\n    if (flag == 0)\n      printf(\"%c\", ' ');\n    sum1 = 0;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34537", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[30][20] = {\"\"}, b[20] = {\"\"}, c[20] = {\"\"};\n  int i, num = 1;\n  scanf(\"%s\", a[0]);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    num = num + 1;\n  }\n  cin >> b >> c;\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], b) == 0) {\n      strcpy(a[i], c);\n    }\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[101], s2[101];\n  char instead1[101], instead2[101], temp[101];\n\n  cin >> s1;\n  cin >> instead1;\n  cin >> instead2;\n  int i, j, count = 0, countS2 = 0;\n  for (i = 0; i < strlen(s1) + 1; i++) {\n    if (s1[i] != ' ' && s1[i] != '\u0000')\n      temp[count++] = s1[i];\n    else {\n      temp[count] = '\u0000';\n      if (!strcmp(temp, instead1)) {\n        for (j = 0; j < strlen(instead2); j++)\n          s2[countS2++] = instead2[j];\n      } else\n        for (j = i - count; j < i - count + strlen(temp); j++) {\n          s2[countS2++] = s1[j];\n        }\n      count = 0;\n    }\n    if (s1[i] == ' ')\n      s2[countS2++] = s1[i];\n  }\n  s2[countS2] = '\u0000';\n  cout << s2 << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], w[100][20];\n  int len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int i, j, n = 0, k = 0;\n  for (i = 0; i <= len; i++) {\n    if (s[i] == 32) {\n      w[n][k] = '\u0000';\n      n++;\n      k = 0;\n    } else {\n      w[n][k] = s[i];\n      k++;\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    if (strcmp(w[j], a) == 0) {\n      strcpy(w[j], b);\n    }\n    if (j == 0) {\n      printf(\"%s\", w[j]);\n    } else {\n      printf(\" %s\", w[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  int j = 0;\n  int begin;\n  int end;\n  char now[101];\n  char sen[1000];\n  char old[101];\n  char newone[101];\n\n  cin >> sen;\n\n  scanf(\"%s \", old);\n\n  cin >> newone;\n  while (sen[i] != '\u0000') {\n    now[j] = sen[i];\n    if (j == 0)\n      begin = i;\n    if (now[j] == ' ' || sen[i + 1] == '\u0000') {\n\n      end = i;\n      if (sen[i + 1] == '\u0000')\n        now[j + 1] = '\u0000';\n      else\n        now[j] = '\u0000';\n      if (strcmp(now, old) == 0) {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", newone);\n        else\n          printf(\"%s \", newone);\n\n      } else {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", now);\n        else\n          printf(\"%s \", now);\n      }\n      j = -1;\n    }\n    i++;\n    j++;\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34541", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, k = 0, len;\n  char str1[101], orig[30], tran[30];\n  char str2[50][30];\n  cin.get(str1, 101, '\\n');\n  scanf(\"%s \", orig);\n  cin >> tran;\n\n  while (str1[i] != '\\0') {\n    while (str1[i] != ' ') {\n      str2[j][k] = str1[i];\n      i++;\n      k++;\n    }\n    str2[j][k] = '\\0';\n    j++;\n    i++;\n    k = 0;\n  }\n  len = j - 1;\n  for (i = 0; i <= len; i++) {\n    if (strcmp(str2[i], orig) == 0)\n      strcpy(str2[i], tran);\n  }\n  for (i = 0; i <= len - 1; i++)\n    cout << str2[i] << \" \";\n  cout << str2[len];\n\n  return 0;\n}\n"}
{"label": "19", "index": "34542", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1001];\n  char a[1001];\n  char b[1001];\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' ')) {\n      k = 1;\n    }\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  return 0;\n}\n"}
{"label": "19", "index": "34543", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], a[100], b[100], out[1000];\n  void insertb(char *s, char *a, char *b, char *out);\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  insertb(s, a, b, out);\n  return 0;\n}\nvoid insertb(char *s, char *a, char *b, char *out) {\n  char *p1, *p2, *p3, *p4;\n  for (p1 = s, p2 = a; p1 < s + strlen(s);) {\n    if ((*p1 == *p2 && p1 == s) || (*p1 == *p2 && *(p1 - 1) == 32)) {\n      for (p2 = a; p2 < a + strlen(a); p2++) {\n        if (*p1 == *p2)\n          p1++;\n        else\n          break;\n      }\n      if (p2 == a + strlen(a)) {\n        p4 = out;\n        for (p3 = s; p3 < p1 - strlen(a); p4++, p3++)\n          *p4 = *p3;\n        for (p3 = b; p3 < b + strlen(b); p4++, p3++)\n          *p4 = *p3;\n        for (p3 = p1; p3 < s + strlen(s); p3++, p4++)\n          *p4 = *p3;\n        *p4 = '\u0000';\n        break;\n      } else\n        p2 = a;\n    } else\n      p1++;\n  }\n  if (p2 == a + strlen(a))\n    insertb(out, a, b, s);\n  else\n    puts(s);\n}\n"}
{"label": "19", "index": "34544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[10000], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int n = strlen(s) - strlen(a), m = strlen(a), l = strlen(s), k[10], d = 0;\n  for (int i = 0; i <= n; i++) {\n    int c = 0;\n    for (int j = 0; j < m; j++) {\n      if (a[j] != s[j + i])\n        c++;\n    }\n    if (c == 0 && (int)s[i - 1] == 32) {\n      k[d + 1] = i;\n      d++;\n    } else if (c == 0 && (int)s[i] >= 65 && (int)s[i] <= 90) {\n      k[d + 1] = i;\n      d++;\n    }\n  }\n  k[0] = 0;\n  k[d + 1] = l;\n  for (int q = k[0]; q < k[1]; q++)\n    cout << s[q];\n  for (int r = 1; r <= d; r++) {\n    printf(\"%s\", b);\n    for (int g = k[r] + m; g < k[r + 1]; g++)\n      printf(\"%c\", s[g]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000], a[100], b[100], word[100];\n  int i, j = 0, flag = 0;\n  cin >> str;\n  cin >> a;\n  cin >> b;\n  i = 0;\n  while (str[i]) {\n    if (str[i] == ' ') {\n      if (flag != 0)\n        cout << \" \";\n      flag = 1;\n      word[j] = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      word[j] = str[i];\n      j++;\n    }\n    i++;\n  }\n  word[j] = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n  return 0;\n}\n"}
{"label": "19", "index": "34546", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, flag = 0;\n  char s[100], a[100], b[100], temp[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (flag == 1 && s[i] != ' ') {\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 0 && s[i] != ' ') {\n      flag = 1;\n      j = 0;\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 1 && s[i] == ' ') {\n      temp[j] = '\u0000';\n      if (strcmp(temp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", temp);\n      flag = 0;\n      j = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  temp[j] = '\u0000';\n  if (strcmp(temp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", temp);\n  return 0;\n}\n"}
{"label": "19", "index": "34547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], t = 1;\n  char tihuan[100][100];\n  int i, j = 0, m = -1, n;\n\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == ' ') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n    }\n    if (a[i] == '\u0000') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n      break;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (strcmp(tihuan[i], b) == 0) {\n      strcpy(tihuan[i], c);\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (t) {\n      printf(\"%s\", tihuan[i]);\n      t = 0;\n    } else\n      cout << \" \" << tihuan[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34548", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint jianyan[1000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i, j = 0, v = 0, count_jianyan = 0, l = strlen(a), l_sub = strlen(sub);\n  for (int r = 0; r < l; r++) {\n    if (a[r] == ' ') {\n      jianyan[count_jianyan] = r;\n      count_jianyan++;\n    }\n  }\n  for (int u = 0; u < l_sub; u++) {\n    if (a[u] == sub[u]) {\n      b[0]++;\n    }\n  }\n  while (v < count_jianyan) {\n    i = jianyan[v] + 1;\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j]) {\n        b[i]++;\n      }\n    }\n    v++;\n  }\n  int k = 0, w[1000], count = 0;\n  for (int gl = 0; gl < 1000; gl++) {\n    w[gl] = 999;\n  }\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w[count] = k;\n      count++;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0, m = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w[m]) {\n        printf(\"%s\", c);\n        q += l_sub;\n        m++;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34549", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, k, m;\n  char s[100], a[20], b[20], z[50][20];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0, j = 0, k = 0; i < 100; i++) {\n    if (s[i] == ' ') {\n      z[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      z[j][k] = s[i];\n      k++;\n    }\n    if (s[i] == '\u0000') {\n      z[j][k] = '\u0000';\n      m = j;\n      break;\n    }\n  }\n  for (i = m; i >= 0; i--) {\n    if (strcmp(a, z[i]) == 0)\n      strcpy(z[i], b);\n  }\n  for (i = 0; i <= m; i++) {\n    if (i < m)\n      printf(\"%s \", z[i]);\n    if (i == m)\n      printf(\"%s\", z[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34550", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, value, la, lb, ls;\n  char *p, *ps, s[100] = \"\", a[100] = \"\", b[100] = \"\";\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  ls = strlen(s);\n  for (p = s; p < s + 100; p++) {\n    value = 1;\n    if ((p == s || *(p - 1) == ' ') && (*p == a[0])) {\n      for (ps = p + 1, i = 1; a[i] != '\u0000'; ps++, i++)\n        if (*ps != a[i])\n          value = 0;\n      if (value == 1) {\n        if (la == lb)\n          for (i = 0; i < la; i++)\n            (*p++) = b[i];\n        else if (la > lb) {\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n          while (*ps != '\u0000')\n            (*p++) = (*ps++);\n          *p = '\u0000';\n        } else {\n          for (i = 99; i >= (ps - s) + lb - la; i--) {\n            s[i] = s[i - lb + la];\n          }\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n        }\n      }\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "34551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char sub[101][101];\n  int len = strlen(s);\n  int m = 0, n = 0;\n  for (int i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      sub[m][n] = s[i];\n      n++;\n    }\n    if (s[i] == ' ') {\n      m++;\n      n = 0;\n    }\n  }\n  for (int j = 0; j <= m; j++) {\n    if (strcmp(sub[j], a) == 0) {\n      if (j == 0) {\n        printf(\"%s\", b);\n      }\n      if (j != 0) {\n        printf(\" %s\", b);\n      }\n    } else {\n      if (j == 0) {\n        printf(\"%s\", sub[j]);\n      }\n      if (j != 0) {\n        printf(\" %s\", sub[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34552", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][1000] = {1}, b[100], c[100], d;\n  int i, n = 0;\n  for (i = 0;; i++) {\n    cin >> a[i] >> d;\n    n++;\n    if (d == '\\n')\n      break;\n  }\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i < n; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\"%s\", c);\n    else\n      printf(\"%s\", a[i]);\n    if (i == n - 1)\n      printf(\"\\n\");\n    else\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100];\n  char word[100][100], a[100], b[100];\n  char *p[100];\n  char *p1, *p2;\n  int i, j, k, strl, al, bl;\n\n  scanf(\"%s \", string);\n\n  cin >> a;\n\n  cin >> b;\n  p1 = a;\n  p2 = b;\n  strl = strlen(string);\n  al = strlen(a);\n  bl = strlen(b);\n  j = 0;\n  k = 0;\n  for (i = 0; i < strl; i++)\n    if (string[i] != 32) {\n      word[j][k] = string[i];\n      if (string[i + 1] != 32)\n        k++;\n      else if (string[i + 1] == 32 || string[i + 1] == '\u0000') {\n        word[j][k + 1] = '\u0000';\n        k = 0;\n        j++;\n      }\n    }\n  for (i = 0; i < j + 1; i++)\n    p[i] = word[i];\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(p1, *(p + i)) == 0)\n      p[i] = p2;\n  for (i = 0; i < j; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[j]);\n}\n"}
{"label": "19", "index": "34554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, i, j = 0;\n  char s[101] = {0}, c[101], d[101];\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> d;\n  a = strlen(s);\n  for (i = 0; i < a; i++) {\n    char b[101] = {0};\n    while (s[i] != ' ' && i < a) {\n      b[j] = s[i];\n      j++;\n      i++;\n    }\n    if (strcmp(b, c) == 0) {\n      printf(\"%s\", d);\n    } else {\n      printf(\"%s\", b);\n    }\n    if (i < a) {\n      printf(\" \");\n    }\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, l1, l2, l3, t;\n  char aa[100] = {0}, b[100], c[100];\n  char pp[100][100] = {0};\n\n  cin >> aa;\n\n  cin >> b;\n\n  cin >> c;\n  l1 = strlen(aa);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; m < l1; i++) {\n    for (j = 0;; j++) {\n      pp[i][j] = aa[m + j];\n      if (aa[m + j] == ' ' || aa[m + j] == NULL)\n        break;\n    }\n    m += j + 1;\n  }\n  for (k = 0; k <= i; k++) {\n    for (t = 0; t < l2; t++) {\n      if (pp[k][t] != b[t])\n        break;\n    }\n    if (t == l2) {\n      for (t = 0; t <= l2; t++)\n        pp[k][t] = 0;\n      strcpy(pp[k], c);\n      if (k != i - 1)\n        pp[k][l3] = ' ';\n    }\n  }\n  for (k = 0; k <= i; k++)\n    printf(\"%s\", pp[k]);\n}\n"}
{"label": "19", "index": "34556", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char *p, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  len = strlen(replaced);\n  p = strstr(input, replaced);\n  start = input;\n  while (p != NULL) {\n    if ((p == input || isalpha(*(p - 1)) == 0) && isalpha(*(p + len)) == 0)\n\n    {\n      *p = '\\0';\n\n      printf(\"%s%s\", start, replace);\n\n      start = p + len;\n      p = strstr(start, replaced);\n    } else {\n      p = input + (p - input) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      p = strstr(start, replaced);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34557", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, k = 0, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  while (s[k] != a[0]) {\n    cout << s[k];\n    k++;\n  }\n  for (i = k; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        printf(\"%s\", b);\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        cout << s[i];\n      m = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0};\n  int sum = 0;\n  while (true) {\n    cin >> s[sum];\n    sum++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  char a[100] = {0};\n  char b[100] = {0};\n  scanf(\"%s %s \", a, b);\n  for (int i = 0; i < sum; i++)\n    for (int j = 0; j < 100; j++) {\n      if (s[i][j] != a[j])\n        break;\n      if (j == 99)\n        strcpy(s[i], b);\n    }\n  for (int l = 0; l < sum - 1; l++)\n    cout << s[l] << \" \";\n  cout << s[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[100] = {0}, c[100] = {0};\n  int i, j, k, m, count = 0;\n  int x, y;\n  int al, bl, cl;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (i = 0; i <= 100; i++) {\n    for (j = 0; j < bl; j++) {\n      if (a[i + j] == b[j])\n        count++;\n    }\n    x = ((i > 0) && (a[i - 1] == ' ') &&\n         ((a[i + bl] == ' ') || a[i + bl] == (char)0));\n    y = ((i == 0) && ((a[i + bl] == ' ' || a[i + bl] == (char)0)));\n    if (count == bl && (x || y)) {\n      if (bl >= cl) {\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n        for (m = i + cl; m < al - cl; m++)\n          a[m] = a[m - cl + bl];\n      } else {\n        for (m = 100; m >= i + cl; m--)\n          a[m] = a[m - (cl - bl)];\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n      }\n    }\n\n    count = 0;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "34560", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar str[100][100];\nchar s[100], t[100];\nchar c;\n\nint main() {\n  int cnt = 0;\n  while (1) {\n    scanf(\"%s\", str[cnt++]);\n    if (getchar() == '\\n')\n      break;\n  }\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (int i = 0; i < cnt; i++) {\n    if (strcmp(str[i], s) == 0)\n      strcpy(str[i], t);\n  }\n  for (int i = 0; i < cnt - 1; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\\n\", str[cnt - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], words[100][100];\n  int i, k = 0, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n - 1; i++) {\n    if (strcmp(words[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[n - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", words[n - 1]);\n  }\n}\n"}
{"label": "19", "index": "34562", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], a[10], b[10], word[50][15];\n  int i = 0, n, j = 0, k = 0;\n  cin.getline(str, 100);\n  cin.getline(a, 10);\n  cin.getline(b, 10);\n  n = strlen(str);\n  while (i < n) {\n    while (str[i] != ' ')\n      word[j][k++] = str[i++];\n    word[j][k] = '\\0';\n    k = 0;\n    j++;\n    i++;\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (strcmp(a, word[i]) == 0)\n      cout << b << \" \";\n    else\n      cout << word[i] << \" \";\n  }\n\n  if (strcmp(a, word[i]) == 0)\n    cout << b << endl;\n  else\n    cout << word[i] << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "34563", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  char x[100], c[100] = {'\u0000'};\n  int i, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      x[t] = s[i];\n      t++;\n    } else {\n      x[t] = '\u0000';\n      if (strcmp(x, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n      } else {\n        strcat(c, x);\n        strcat(c, \" \");\n      }\n      t = 0;\n    }\n  }\n  x[t] = '\u0000';\n  if (strcmp(x, a) == 0) {\n    strcat(c, b);\n  } else {\n    strcat(c, x);\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "34564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], w[20][20];\n  int n, t, i, j, m[100];\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  n = strlen(s);\n  m[0] = -1;\n  t = 1;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      m[t] = i;\n      t += 1;\n    }\n  }\n  m[t] = n;\n  for (i = 0; i < t; i++) {\n    for (j = m[i] + 1; j < m[i + 1]; j++) {\n      w[i][j - m[i] - 1] = s[j];\n    }\n    w[i][m[i + 1] - m[i] - 1] = '\u0000';\n  }\n  for (i = 0; i < t; i++) {\n    if (strcmp(w[i], a) == 0) {\n      strcpy(w[i], b);\n    }\n  }\n  printf(\"%s\", w[0]);\n  for (i = 1; i < t; i++) {\n    cout << \" \" << w[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34565", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char a[50];\n  char b[50];\n  cin.getline(str, 1000);\n  cin.getline(a, 50);\n  cin.getline(b, 50);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    int len = 0, k;\n    for (j = 0; a[j] != '\\0'; j++)\n      if (str[i + j] == a[j] && (str[i - 1] == ' ' && i != 0) || i == 0)\n        len++;\n    if (len == strlen(a) && (str[i + j] == ' ' || str[i + j] == '\\0')) {\n      if (strlen(a) >= strlen(b)) {\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        for (k = i + strlen(b); str[k] != '\\0'; k++)\n          str[k] = str[k + strlen(a) - strlen(b)];\n      } else {\n        for (k = strlen(str) + strlen(b) - strlen(a); k >= i + strlen(a); k--)\n          str[k] = str[k + strlen(a) - strlen(b)];\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        i += strlen(b);\n      }\n    }\n  }\n  cout << str << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "34566", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int i, j, n, m, w;\n  char r[200], s[200], t[200];\n\n  cin >> r;\n  cin >> s;\n  cin >> t;\n  p1 = r;\n  p2 = s;\n  n = strlen(s);\n  for (i = 0; *(p1 + i) != '\u0000';) {\n    if (*(p1 + i) != *p2) {\n      printf(\"%c\", *(p1 + i));\n      i++;\n    } else {\n      for (j = 1, w = 1; j < n; j++) {\n        if (*(p1 + i + j) != *(p2 + j)) {\n          for (m = 0; m < j; m++)\n            printf(\"%c\", *(p1 + i + m));\n          break;\n        }\n        w++;\n      }\n      if (w == n) {\n        if (((*(p1 + i + n) == ' ' || *(p1 + i + n) == '\u0000') &&\n             *(p1 + i - 1) == ' ') ||\n            ((i == 0) && *(p1 + n) == ' '))\n          printf(\"%s\", t);\n        else\n          printf(\"%s\", s);\n        i = i + n;\n      } else\n        i = i + j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p;\n  char s[110], a[110], b[110];\n  int l = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  p = strtok(s, \" \");\n\n  while (p) {\n    if (l != 0)\n      printf(\" \");\n    if (strcmp(p, a) == 0)\n      p = b;\n    printf(\"%s\", p);\n    p = strtok(NULL, \" \");\n    l++;\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "34568", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[103], b[103];\n  int i, j, k, p, l, m, n, num, h = 0;\n\n  cin >> s;\n  l = strlen(s);\n\n  cin >> a;\n  m = strlen(a);\n\n  cin >> b;\n  n = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    num = 0;\n    if (s[i] == a[0]) {\n      num = 1;\n      for (j = 1; a[j] != '\u0000'; j++)\n        if (s[i + j] == a[j])\n          num++;\n      if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n >= m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[l - 1 + n - m - k] = s[l - 1 - k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      } else if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n < m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[n + i + k] = s[m + i + k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      }\n      l = l + i;\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "34569", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char zfc[100][100];\n  int i, j, len, k = 1, wz[100];\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  len = strlen(s);\n  wz[0] = 0 - 1;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      wz[k] = i;\n      k++;\n    }\n  }\n  wz[k] = len;\n  for (i = 0; i < k; i++) {\n    for (j = wz[i] + 1; j < wz[i + 1]; j++)\n      zfc[i][j - wz[i] - 1] = s[j];\n    zfc[i][j - wz[i] - 1] = '\u0000';\n  }\n  if (strcmp(zfc[0], a) != 0) {\n    printf(\"%s\", zfc[0]);\n\n  } else {\n    printf(\"%s\", b);\n  }\n\n  for (i = 1; i < k; i++) {\n    if (strcmp(zfc[i], a) != 0) {\n      printf(\" %s\", zfc[i]);\n\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34570", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[110][110] = {0};\n  int i = 0;\n  while (cin >> A[i]) {\n    i++;\n  }\n  int num;\n  for (int j = 0; j < i - 2; j++) {\n    if (strcmp(A[i - 2], A[j]) == 0) {\n      strcpy(A[j], A[i - 1]);\n    }\n  }\n\n  for (int j = 0; j < i - 3; j++) {\n    printf(\"%s \", A[j]);\n  }\n  cout << A[i - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "34571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  int x, i, k = 0;\n  char str[100];\n  char temp[100];\n  char in[100];\n  char out[100];\n  char *str0;\n\n  cin >> str;\n\n  cin >> in;\n\n  cin >> out;\n  str0 = str;\n  x = strlen(str);\n  for (i = 0; i < x; i++) {\n    if (*(str0 + i) != ' ' && i != x - 1) {\n      temp[k] = *(str0 + i);\n      k++;\n    } else if (*(str0 + i) == ' ' && i != x - 1) {\n      temp[k] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n      k = 0;\n    } else if (i == x - 1) {\n      temp[k] = *(str0 + i);\n      temp[k + 1] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n    }\n  }\n  return (0);\n}\n"}
{"label": "19", "index": "34572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], a[100][100], b[100], c[100], *ps;\n  int i, k, flag = 0, j;\n\n  cin >> str;\n\n  cin >> c;\n\n  cin >> b;\n  i = 0;\n  j = 0;\n  for (ps = str; *ps != '\u0000'; ps++) {\n    if (*ps != ' ') {\n      a[i][j] = *ps;\n      j++;\n    } else if (*ps == ' ') {\n      a[i][j] = '\u0000';\n      j = 0;\n      i++;\n    }\n  }\n  a[i][j] = '\u0000';\n  k = i;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a[i], c) == 0) {\n      strcpy(a[i], b);\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k; i++)\n      printf(\"%s \", a[i]);\n\n    printf(\"%s\", a[k]);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[20], c[20], d[20];\n  cin.getline(a, 100);\n  cin.getline(b, 20);\n  cin.getline(c, 20);\n  int i = 0, n = 0, j = 0, k, l = 0;\n  for (; a[i] != 0;) {\n    if (a[i] == 32)\n      i++;\n    for (; a[i] != 32 && a[i] != 0; i++, n++)\n      d[n] = a[i];\n    d[n] = 0;\n    if (strcmp(b, d) == 0) {\n      for (j = i - n; n > 0; n--)\n        for (k = j; a[k] != 0; k++)\n          a[k] = a[k + 1];\n      for (; c[l] != 0; l++, j++) {\n        for (k = j; a[k] != 0; k++)\n          ;\n        for (; k >= j; k--)\n          a[k + 1] = a[k];\n        a[j] = c[l];\n      }\n      l = 0;\n      i = j;\n    } else\n      n = 0;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "34574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      if (i != 0 && s[i - 1] != ' ') {\n        t = 0;\n      }\n    }\n\n    if (t == 1) {\n      cout << b;\n      i += la - 1;\n    }\n    if (t == 0) {\n      cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34575", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j = 0, k = 0, len;       \n  char str1[101], orig[30], tran[30]; \n  char str2[50][30];                  \n  cin.get(str1, 101, '\\n');\n  cin >> orig;\n  cin >> tran;\n\n  while (str1[i] != '\\0') \n  {\n    while (str1[i] != ' ') \n    {\n      str2[j][k] = str1[i];\n      i++;\n      k++; \n    }\n    str2[j][k] = '\\0';\n    j++;   \n    i++;   \n    k = 0; \n  }\n  len = j - 1; \n  for (i = 0; i <= len; i++) {\n    if (strcmp(str2[i], orig) == 0) \n      strcpy(str2[i], tran);\n  }\n  for (i = 0; i <= len - 1; i++)\n    cout << str2[i] << \" \";\n  cout << str2[len]; \n\n  return 0;\n}\n"}
{"label": "19", "index": "34576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, q, j, k, flag = 0;\n  char a[102], b[102], c[102];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i - 1] == ' ') || ((a[i] >= 'A') && (a[i] < 'a'))) {\n      for (j = 0; j < n; j++)\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      if (flag == 0) {\n        for (k = 0; k < q; k++) {\n          printf(\"%c\", c[k]);\n        }\n        i = i + n - 1;\n      } else {\n        cout << a[i];\n        flag = 0;\n      }\n    } else {\n      cout << a[i];\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34577", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    if (i == 0 || a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb >= lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++)\n            a[k] = a[k + lenb - 1];\n\n          i += lenc - 1;\n          lena -= lenb - lenc;\n        }\n        if (lenb < lenc) {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          i += lenc - 1;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34578", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char input[110], replaced[110], replace[110]; \n  char *p, *start;                              \n  int len;                                      \n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  len = strlen(replaced);\n  p = strstr(input, replaced); \n  start = input;               \n  while (p != NULL)            \n  {\n    if ((p == input || isalpha(*(p - 1)) == 0) && isalpha(*(p + len)) == 0)\n    \n    {\n      *p = '\\0'; \n\n      cout << start << replace;\n\n      start = p + len;             \n      p = strstr(start, replaced); \n    } else {\n      p = input + (p - input) + len; \n      temp = *p;                     \n      *p = '\\0';\n\n      cout << start;\n\n      start = p;     \n      *start = temp; \n      p = strstr(start, replaced);\n    }\n  }\n\n  cout << start << endl; \n\n  return 0;\n}\n"}
{"label": "19", "index": "34579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char x[100][100];\n  int i, t = 1, j = 1, y, z, q, p, m;\n  for (q = 0; q <= 99; q++) {\n    for (p = 0; p <= 99; p++) {\n      x[q][p] = '\u0000';\n    }\n  }\n  for (i = 0; i <= 99; i++) {\n    if (s[i] == ' ')\n      break;\n    else\n      x[0][i] = s[i];\n  }\n  do {\n    if (s[t] == ' ') {\n      z = t;\n      for (y = 0; y <= 99; y++) {\n        z++;\n        if (s[z] != ' ' && s[z] != '\u0000')\n          x[j][y] = s[z];\n        else\n          break;\n      }\n      j++;\n    }\n    t++;\n  } while (t <= 99);\n  for (i = 0; i <= 99; i++) {\n    if (strcmp(x[i], a) == 0)\n      strcpy(x[i], b);\n  }\n  for (m = 0; m <= 99; m++) {\n    if (x[m][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (i == 0)\n      printf(\"%s\", x[i]);\n    else\n      cout << \" \" << x[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34580", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s[100], *a, *b;\n  int i = 0, j = 0, x;\n  for (i = 0; i < 100; i++) {\n    s[i] = (char *)malloc(100 * sizeof(char));\n    for (j = 0; j < 100; j++)\n      s[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ' || s[i][j] == ' ')\n        break;\n    }\n    if (s[i][j] == ' ') {\n      x = i;\n      break;\n    }\n  }\n  for (i = 0; i <= x; i++) {\n    for (j = 0;; j++)\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        break;\n      }\n  }\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; i <= x; i++)\n    if (!strcmp(s[i], a)) {\n      for (j = 0; j < 100; j++)\n        s[i][j] = '\u0000';\n      strcpy(s[i], b);\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s \", s[x]);\n}\n"}
{"label": "19", "index": "34581", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  int ns, na, nb, i, j, k = 0, m, flag, p[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n\n  for (i = 0, j = 0, k = 0; i < na, j < ns; j++) {\n    if (s[j] == a[i]) {\n      flag = j;\n      i++;\n      if (i == na && (s[j - na] < 'A' || s[j + 1] > 'z')) {\n        p[k] = flag;\n        k++;\n        i = 0;\n      }\n    } else\n      i = 0;\n  }\n\n  if (k != 0) {\n    for (m = 0; m < k; m++) {\n      p[m] = p[m] + m * abs(na - nb);\n      ns = ns + m * abs(na - nb);\n      if (na == nb) {\n        for (i = 0; i < na; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1)\n          printf(\"%s \", s);\n      }\n      if (na > nb) {\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        for (i = p[m] + 1 - na + nb; i < ns - na + nb; i++)\n          s[i] = s[i + na - nb];\n        if (m == k - 1) {\n          for (i = 0; i < ns - na + nb; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n      if (na < nb) {\n        for (i = ns - 1; i > p[m]; i--)\n          s[i + nb - na] = s[i];\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1) {\n          for (i = 0; i < ns + nb - na; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n    }\n  }\n\n  else if (k == 0)\n    printf(\"%s \", s);\n}\n"}
{"label": "19", "index": "34582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], str1[100], str2[100], a[100][100];\n\n  scanf(\"%s \", s);\n  int len = strlen(s);\n\n  cin >> str1;\n\n  cin >> str2;\n  int lenth = strlen(str2);\n  int i, j, p;\n  for (i = 0, j = 0, p = 0; j < len; j++) {\n    a[i][p++] = s[j];\n    if (s[j + 1] == ' ') {\n      j = j + 1;\n      a[i][p] = '\u0000';\n      i = i + 1;\n      p = 0;\n    }\n  }\n  a[i][p] = '\u0000';\n  int num = i;\n  int judge = 0;\n  for (i = 0; i < num + 1; i++) {\n    if (strcmp(a[i], str1) == 0) {\n      for (j = 0; j < lenth; j++)\n        a[i][j] = str2[j];\n\n      a[i][lenth] = '\u0000';\n      judge = 1;\n    }\n  }\n\n  if (judge == 0)\n    printf(\"%s \", s);\n  else {\n    cout << a[0];\n    for (i = 1; i < num + 1; i++) {\n      printf(\" %s\", a[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34583", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char stc[201], wrd1[101], wrd2[101], wrdd[100][101];\n  int i, j = 0, k = 0, l = 0;\n\n  cin >> stc;\n\n  cin >> wrd1;\n\n  cin >> wrd2;\n\n  for (i = 0; stc[i] != '\u0000'; i++) {\n    if (stc[i] != ' ')\n      wrdd[j][k] = stc[i], k++;\n    else\n      wrdd[j][k] = '\u0000', j++, k = 0;\n  }\n\n  for (i = 0; i <= j; i++)\n    if (strcmp(wrd1, wrdd[i]) == 0)\n      strcpy(wrdd[i], wrd2);\n\n  for (i = 0, k = 0; l <= j; i++) {\n    if (wrdd[l][k] != '\u0000')\n      stc[i] = wrdd[l][k], k++;\n    else\n      stc[i] = ' ', l++, k = 0;\n  }\n  stc[i - 1] = '\u0000';\n  puts(stc);\n}\n"}
{"label": "19", "index": "34584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, temp = 0, j = 0, len, a[1000], temp2;\n  char str[1000], str1[101], str2[101], name[1000][101];\n  cin >> str;\n  cin >> str1;\n  cin >> str2;\n  len = strlen(str);\n  for (i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      name[temp][j] = str[i];\n      j++;\n    }\n\n    if (str[i] == ' ') {\n      a[temp] = j;\n      temp++;\n      j = 0;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    if (strcmp(str1, name[j]) == 0) {\n      cout << str2 << \" \";\n    } else\n      cout << name[j] << \" \";\n  }\n  if (strcmp(str1, name[temp]) == 0)\n    printf(\"%s\", str2);\n  if (strcmp(str1, name[temp]) != 0)\n    cout << name[temp];\n  return 0;\n}\n"}
{"label": "19", "index": "34585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {\"\\0\"}, a[100] = {\"\\0\"}, b[100] = {\"\\0\"};\n  int i, j, x = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      cin.get(s[i][j]);\n      if (s[i][j] == 32) {\n        s[i][j] = 0;\n        j = 100;\n      } else if (s[i][j] == 10) {\n        s[i][j] = 0;\n        j = i = 100;\n      }\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(a[j]);\n    if (a[j] == 32 || a[j] == 10) {\n      a[j] = 0;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(b[j]);\n    if (b[j] == 32 || b[j] == 10) {\n      b[j] = 0;\n      break;\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (a[j] == s[i][j])\n        x = x + 1;\n    }\n    if (x == 100)\n      for (j = 0; j < 100; j++)\n        s[i][j] = b[j];\n    else\n      x = 0;\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (s[i][j] != 0 && s[i][j + 1] == 0 && s[i + 1][0] != 0)\n        cout << s[i][j] << \" \";\n      else if (s[i][j] != 0)\n        cout << s[i][j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(char p[100], char q[100], int a, int b) {\n  int m, x;\n  for (m = 0; m <= a; m++) {\n    if (p[b + m] == q[m])\n      x = 1;\n    else {\n      x = 0;\n      break;\n    }\n  }\n  return (x);\n}\nint main() {\n  char s[100], a[100], b[100];\n  int i, l, j;\n  for (i = 0; i < 100; i++) {\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n  }\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  l = strlen(s);\n  s[l] = ' ';\n  l = strlen(a);\n  a[l] = ' ';\n  if (check(s, a, l, 0))\n    printf(\"%s\", b);\n  else {\n    i = 0;\n    do {\n      printf(\"%c\", s[i]);\n      i++;\n    } while (s[i] != ' ');\n  }\n  i = 0;\n  while (s[i] != ' ')\n    i++;\n  for (i = i + 1; i < 100;) {\n    j = i;\n    if (s[i] == '\u0000')\n      break;\n    else if (check(s, a, l, i))\n      printf(\" %s\", b);\n    else {\n      printf(\" \");\n      do {\n        printf(\"%c\", s[i]);\n        i++;\n      } while (s[i] != ' ');\n    }\n    i = j;\n    while (s[i] != ' ')\n      i++;\n    i = i + 1;\n  }\n}\n"}
{"label": "19", "index": "34587", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[20], c[20], d[20];\n  cin.getline(a, 100);\n  cin.getline(b, 20);\n  cin.getline(c, 20);\n  int i = 0, n = 0, j = 0, k, l = 0;\n  for (; a[i] != 0;) {\n    if (a[i] == 32)\n      i++;\n    for (; a[i] != 32 && a[i] != 0; i++, n++)\n      d[n] = a[i];\n    d[n] = 0;\n    if (strcmp(b, d) == 0) {\n      for (j = i - n; n > 0; n--)\n        for (k = j; a[k] != 0; k++)\n          a[k] = a[k + 1];\n      for (; c[l] != 0; l++, j++) {\n        for (k = j; a[k] != 0; k++)\n          ;\n        for (; k >= j; k--)\n          a[k + 1] = a[k];\n        a[j] = c[l];\n      }\n      l = 0;\n      i = j;\n    } else\n      n = 0;\n  }\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "34588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100],\n      C[100][100];           \n  int i, j = 0, a = 0;       \n  cin.getline(A, 100, '\\n'); \n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  for (i = 0; i < strlen(A); i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(C[i], B) == 0) \n      strcpy(C[i], T);        \n  }\n  for (i = 0; i < j; i++) \n    cout << C[i] << \" \";\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100], t[100];\n  int lenb, lena, len;\n  int i = 0, j;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  while (i < len) {\n    j = 0;\n    while (isgraph(c[i]))\n      t[j++] = c[i++];\n    t[j] = '\u0000';\n    if (strcmp(t, a))\n      cout << t;\n    else\n      cout << b;\n    if (c[i])\n      printf(\"%c\", c[i++]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34590", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100];\n  char b[100], c[100], d;\n  int i, n;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n    if (d == 10) {\n      break;\n    }\n  }\n  scanf(\"%s \", b);\n  scanf(\"%s\", c);\n  for (n = 0; n < i + 1; n++) {\n    if (strcmp(a[n], b) == 0) {\n      strcpy(a[n], c);\n    }\n  }\n\n  for (n = 0; n < i; n++)\n    printf(\"%s \", a[n]);\n\n  printf(\"%s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0};\n  int sum = 0;\n  while (true) {\n    cin >> s[sum];\n    sum++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  char a[100] = {0};\n  char b[100] = {0};\n  scanf(\"%s %s \", a, b);\n  for (int i = 0; i < sum; i++)\n    for (int j = 0; j < 100; j++) {\n      if (s[i][j] != a[j])\n        break;\n      if (j == 99)\n        strcpy(s[i], b);\n    }\n  for (int l = 0; l < sum - 1; l++)\n    printf(\"%s \", s[l]);\n  cout << s[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100], word[100][100];\n  int n, k, j = 0, i;\n\n  scanf(\"%s \", words);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(words);\n  for (i = 0, k = 0; i < n + 1; i++) {\n    if (words[i] == ' ' || words[i] == '\u0000') {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    } else {\n      word[k][j] = words[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      printf(\"%s \", word[i]);\n  }\n\n  if (strcmp(word[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34593", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[1000], a[100], b[100], p[100][100];\n\n  cin >> s;\n  cin >> a >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      j++;\n      k = 0;\n    } else {\n      p[j][k] = s[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(p[i], a) == 0) {\n      strcpy(p[i], b);\n    }\n  }\n  cout << p[0];\n  for (i = 1; i <= j; i++) {\n    cout << ' ' << p[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34594", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar w[100];\nchar m[200][200];\nchar a[200], b[200];\nint main() {\n\n  scanf(\"%s \", w);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = 0, q = 0, r;\n  for (r = 0; w[r] != '\u0000'; r++) {\n    if (w[r] == ' ') {\n      p++;\n      q = 0;\n    } else {\n      m[p][q] = w[r];\n      q++;\n    }\n  }\n  int i, x;\n  for (i = 0; i < p + 1; i++) {\n    if (strcmp(m[i], a) == 0) {\n      for (x = 0; x < (strlen(b) + 1); x++)\n        m[i][x] = b[x];\n    }\n  }\n  printf(\"%s\", m[0]);\n  for (i = 1; i < p + 1; i++)\n    printf(\" %s\", m[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34595", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  char sold[1000], snew[1000];\n  int i, j, k, l;\n\n  cin >> a;\n\n  cin >> sold;\n\n  cin >> snew;\n  for (i = 0; i < strlen(a); i++) {\n    k = 0;\n    for (j = i; j < i + strlen(sold); j++) {\n      if (i == strlen(a) - strlen(sold))\n        if (a[i - 1] != ' ')\n          break;\n      if (i != 0 && i != strlen(a) - strlen(sold))\n        if (a[i + strlen(sold)] != ' ' || a[i - 1] != ' ')\n          break;\n      if (a[j] != sold[k++])\n        break;\n    }\n    if (j == i + strlen(sold)) {\n      for (k = 0; k < 500; k++)\n        b[k + i + strlen(snew)] = a[k + i + strlen(sold)];\n      for (k = 0; k < i; k++)\n        b[k] = a[k];\n      l = 0;\n      for (k = 0; k < strlen(snew); k++)\n        b[i + k] = snew[l++];\n      for (k = 0; k < 1000; k++)\n        a[k] = b[k];\n      i = i + strlen(snew) - 1;\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "19", "index": "34596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100], word[100][100];\n  int n, k, j = 0, i;\n\n  cin >> words;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  n = strlen(words);\n  for (i = 0, k = 0; i < n + 1; i++) {\n    if (words[i] == ' ' || words[i] == '\u0000') {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    } else {\n      word[k][j] = words[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      cout << word[i] << \" \";\n  }\n\n  if (strcmp(word[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    cout << word[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34597", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  char result[200];\n  char f[200], r[200];\n\n  cin >> ch;\n  cin >> f >> r;\n\n  ch[strlen(ch) + 1] = 0;\n  ch[strlen(ch)] = ' ';\n\n  memset(result, 0, 200);\n  int last = 0;\n  for (int i = 0; i < strlen(ch); i++) {\n    if (ch[i] == ' ') {\n      ch[i] = 0;\n      char *p = ch + last;\n      if (strcmp(p, f) == 0)\n        sprintf(result, \"%s %s\", result, r);\n      else\n        sprintf(result, \"%s %s\", result, p);\n      last = i + 1;\n      ch[i] = ' ';\n    }\n  }\n  cout << result + 1 << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char sub[101][101];\n  int len = strlen(s);\n  int m = 0, n = 0;\n  for (int i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      sub[m][n] = s[i];\n      n++;\n    }\n    if (s[i] == ' ') {\n      m++;\n      n = 0;\n    }\n  }\n  for (int j = 0; j <= m; j++) {\n    if (strcmp(sub[j], a) == 0) {\n      if (j == 0) {\n        printf(\"%s\", b);\n      }\n      if (j != 0) {\n        cout << \" \" << b;\n      }\n    } else {\n      if (j == 0) {\n        printf(\"%s\", sub[j]);\n      }\n      if (j != 0) {\n        printf(\" %s\", sub[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int length_s, length_a, i, j, k;\n  char s[128], a[128], b[128];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  length_s = strlen(s);\n  length_a = strlen(a);\n\n  for (i = 0; i < length_s; i++) {\n    j = 0;\n    if (s[i] == a[j] && (i == 0 || s[i - 1] == ' ')) {\n      k = i;\n      while (s[i] == a[j] && s[i] > 0) {\n        j++;\n        i++;\n      }\n\n      if (j == length_a) {\n        printf(\"%s\", b);\n        i--;\n\n      }\n\n      else {\n        while (k <= i) {\n          printf(\"%c\", s[k]);\n          k++;\n        }\n      }\n\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34600", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[103], a[103], b[103], t[103][103];\n  int i, len, start = 0, end = 1, cur = 0, k = 0, w, e;\n  int result;\n  char *p = NULL;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  len = strlen(s);\n  w = strlen(a);\n  e = strlen(b);\n  while (end < len) {\n    if (s[end] == ' ' || s[end] == 0) {\n      for (i = start, k = 0; i < end; i++, k++)\n        t[cur][k] = s[i];\n      t[cur][k + 1] = '\u0000';\n      cur++;\n      start = end + 1;\n      end = start + 1;\n    } else\n      end++;\n  }\n  for (i = start, k = 0; i < end; i++, k++)\n    t[cur][k] = s[i];\n  t[cur][k + 1] = '\u0000';\n  cur++;\n  for (i = 0; i < cur; i++) {\n    if (i == cur - 1) {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s\", b);\n      else\n        cout << t[i];\n    } else {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s \", b);\n      else\n        cout << t[i] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34601", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int q, w, e, i, j, s, shu, n, z;\n  cin.getline(a, 99);\n  cin.getline(b, 99);\n  cin.getline(c, 99);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    shu = 1;\n    s = i;\n    for (j = 0; j < w; j++) {\n      if (a[s] != b[j]) {\n        shu = 0;\n        break;\n      }\n      s++;\n    }\n    if (i == 0) {\n      if (a[s] != ' ')\n        shu = 0;\n    } else {\n      if ((a[i - 1] != ' ') || ((a[s] != ' ') && (a[s] != '\\0')))\n        shu = 0;\n    }\n    if (shu == 0)\n      continue;\n    if (shu == 1) {\n      if (w >= e) {\n        for (s = e + i; a[s] != '\\0'; s++) {\n          a[s] = a[s + w - e];\n        }\n      } else {\n        for (z = 0; a[z] != '\\0'; z++)\n          ;\n\n        for (s = z; s >= w + i; s--) {\n          a[s - w + e] = a[s];\n        }\n      }\n      j = 0;\n      for (s = i; s < i + e; s++) {\n        a[s] = c[j];\n        j++;\n      }\n    }\n  }\n  cout << a;\n  cin >> n;\n  return 0;\n}\n"}
{"label": "19", "index": "34602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[50][100];\n  int i, n = 0, len1, len2, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(c[n], (s + k));\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(c[n], (s + k));\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "34603", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][50];\n  char *p1 = s, *p3 = b;\n  int i = 0, j = 0, n;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (; *p1 != '\u0000'; p1++) {\n    if (*p1 != ' ') {\n      c[i][j] = *p1;\n      j++;\n    } else {\n      c[i][j] = '\u0000';\n      i++;\n      j = 0;\n    }\n  }\n  c[i][j] = '\u0000';\n  n = i;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0) {\n      for (j = 0; *p3 != '\u0000'; p3++, j++)\n        c[i][j] = *p3;\n      c[i][j] = '\u0000';\n    }\n    p3 = b;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  cout << c[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char words[100][100];\n  char ti[100], bt[100];\n  int i, j, k, n;\n  int a[200];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", ti);\n  scanf(\"%s\", bt);\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n; i++) {\n    if (strcmp(ti, words[i]) == 0) {\n      strcpy(words[i], bt);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      cout << words[0];\n    else\n      printf(\" %s\", words[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i = 0, j = 0, count = 0;\n  cin.get(s, 100);\n  cin >> a;\n  cin >> b;\n  for (i = 0; i <= strlen(s) - strlen(a); i++) {\n    count = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i])\n        count++;\n    }\n    if (count == strlen(a) &&\n        ((s[i + strlen(a)] == ' ' || i + strlen(a) == strlen(s)) &&\n         (s[i - 1] == ' ' || i == 0))) {\n      for (j = i; j < i + strlen(a); j++)\n        s[j] = '/';\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != '/')\n      cout << s[i];\n    else {\n      for (j = 0; j < strlen(b); j++)\n        cout << b[j];\n      do {\n        i++;\n      } while (s[i] == '/' && (i + 1 == strlen(s) || s[i + 1] == '/'));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    printf((strcmp(s, from) == 0) ? to : s);\n    s = p + 1;\n    if (*s)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char(*p)[100], *p1, *p2, *a;\n  char string[100], str[100][100], str1[100], str2[100];\n  n = 0;\n  k = 1;\n  p = str;\n  p1 = str1;\n  p2 = str2;\n  a = string;\n\n  cin >> string;\n\n  cin >> str1;\n  cin >> str2;\n\n  for (i = 0; *(a + i) != '\u0000'; i++)\n    if (*(a + i) == ' ')\n      k++;\n\n  for (i = 0; *(a + n) != '\u0000'; i++) {\n    for (j = 0; *(a + n) != ' ' && *(a + n) != '\u0000'; j++) {\n      *(*(p + i) + j) = *(a + n);\n      n++;\n    }\n    *(*(p + i) + j) = '\u0000';\n    n = n + 1;\n  }\n  n = n - 1;\n\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), p1) == 0)\n      strcpy(*(p + i), p2);\n\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\", *(p + i));\n    printf(\" \");\n  }\n  printf(\"%s\", *(p + k - 1));\n}\n"}
{"label": "19", "index": "34608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][100] = {'\\0'};\n  int i, j = 0, k;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", a[i]);\n    if (a[i][0] < 2)\n      break;\n  }\n  for (i = 0; i < 100; i++)\n    if (strcmp(a[i], a[j - 1]) == 0)\n      strcpy(a[i], a[j]);\n  for (i = 0; i < j - 2; i++)\n    cout << a[i] << \" \";\n  cout << a[j - 2];\n  return 0;\n}\n"}
{"label": "19", "index": "34609", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n1, n2, n3, i, j;\n  char a1[100] = {'\u0000'}, a2[100] = {'\u0000'}, a3[100] = {'\u0000'};\n  char *p1 = &a1[0], *p2 = &a2[0], *p3 = &a3[0], *p_end, *p_in = &a1[0], *p,\n       *p_cyc = &a1[0];\n\n  cin >> a1;\n\n  cin >> a2;\n\n  cin >> a3;\n  n1 = strlen(a1);\n  n2 = strlen(a2);\n  n3 = strlen(a3);\n  p_end = &a1[n1 - 1];\n  for (p1 = &a1[0]; p1 <= p_end; p1++) {\n    if (*p2 == *p1) {\n      p_in = p1;\n      for (j = 0; j < n2; j++) {\n        if (*p2 != *p1) {\n          p1--;\n          break;\n        } else {\n          p2++;\n          p1++;\n        }\n      }\n      p2 = &a2[0];\n      if (j == n2 && *(p_in - 1) == ' ') \n      {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          \n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) \n        {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      } else if (j == n2 && p_in == &a1[0]) \n      {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          \n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) \n        {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      }\n\n      p3 = &a3[0];\n    }\n  }\n  for (p = &a1[0]; p <= p_end; p++) {\n    printf(\"%c\", *p);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34610", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[1000] = \"\u0000\";\n  char word_1[101] = \"\u0000\";\n  char word_2[101] = \"\u0000\";\n  char word_1_1[101] = \"\u0000\";\n  int number[101] = {0};\n  int i, j, k;\n  int sum;\n  int num = 0;\n  int m = 0;\n\n  scanf(\"%s \", sen);\n  cin >> word_1;\n  scanf(\"%s \", word_2);\n  for (i = 0; i <= strlen(sen) - strlen(word_1); i++) {\n    sum = 0;\n    for (j = 0; j <= strlen(word_1) - 1; j++)\n      word_1_1[j] = sen[j + i];\n    for (j = 0; j <= strlen(word_1) - 1; j++) {\n      if (word_1_1[j] != word_1[j])\n        sum = sum + 1;\n    }\n    if ((sum == 0) && (i != 0) && (sen[i - 1] != ' '))\n      sum = sum + 1;\n    if (sum == 0) {\n      number[m] = i;\n      m = m + 1;\n      num = num + 1;\n    }\n  }\n  for (k = 1; k <= num; k++) {\n\n    if (k == 1)\n      for (j = 0; j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    if (k != 1)\n      for (j = number[k - 2] + strlen(word_1); j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    for (j = 0; j < strlen(word_2); j++)\n      printf(\"%c\", word_2[j]);\n    if (k == num) {\n      if (number[k - 1] + strlen(word_1) == strlen(sen))\n        printf(\" \");\n      else {\n        for (j = number[k - 1] + strlen(word_1); j < strlen(sen); j++) {\n\n          if (j == strlen(sen) - 1)\n            printf(\"%c \", sen[j]);\n          else\n            printf(\"%c\", sen[j]);\n        }\n      }\n    }\n  }\n\n  if (num == 0)\n    printf(\"%s \", sen);\n  return 0;\n}\n"}
{"label": "19", "index": "34611", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char *s[100], *a, *b;\n  int i = 0, j = 0, x;\n  for (i = 0; i < 100; i++) {\n    s[i] = (char *)malloc(100 * sizeof(char));\n    for (j = 0; j < 100; j++)\n      s[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      x = i;\n      break;\n    }\n  }\n  for (i = 0; i <= x; i++) {\n    for (j = 0;; j++)\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        break;\n      }\n  }\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= x; i++)\n    if (!strcmp(s[i], a)) {\n      for (j = 0; j < 100; j++)\n        s[i][j] = '\u0000';\n      strcpy(s[i], b);\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s \", s[x]);\n}\n"}
{"label": "19", "index": "34612", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], s1[101], s2[101], s4[101];\n\n  scanf(\"%s \", s);\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  char s3[100][101];\n  char *p;\n  char(*p3)[101];\n  int n, i;\n  n = strlen(s);\n  p = s;\n  p3 = s3;\n  i = 0;\n  for (p = s; p <= (s + n); p++) {\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *((*p3) + i) = '\u0000';\n      p3++;\n      i = 0;\n    } else {\n      *((*p3) + i) = *p;\n      i++;\n    }\n  }\n  *((*p3)) = '\u0000';\n  for (p3 = s3; *((*p3)) != '\u0000'; p3++) {\n    if (strcmp(*p3, s1) == 0)\n      strcpy(*p3, s2);\n  }\n  p3 = s3;\n  strcpy(s4, *p3);\n  for (p3 = s3 + 1; *((*p3)) != '\u0000'; p3++) {\n    strcat(s4, \" \");\n    strcat(s4, *p3);\n  }\n  puts(s4);\n}\n"}
{"label": "19", "index": "34613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char d[30][20] = {\"\"}, e[20] = {\"\"}, f[20] = {\"\"}, *a[30], *b, *c;\n  int i, num = 1;\n  for (i = 0; i < 30; i++)\n    *(a + i) = *(d + i);\n  b = e;\n  c = f;\n  scanf(\"%s\", *a);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", *(a + i));\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(*(a + i), b) == 0)\n      strcpy(*(a + i), c);\n  }\n  cout << *a;\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", *(a + i));\n  }\n}\n"}
{"label": "19", "index": "34614", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], sun[1000];\n  struct sum {\n    char tmp[20];\n  };\n  struct sum s[100];\n\n  cin >> sun;\n\n  cin >> a;\n\n  cin >> b;\n  int i, len, j;\n  len = strlen(sun);\n  sun[len + 1] = ' ';\n\n  int k = 0, n = 0;\n  for (i = 0; i <= len + 1; i++) {\n    if (sun[i] == ' ') {\n      n++;\n      int t;\n      t = i - k;\n      for (j = 0; j < k; j++) {\n\n        s[n].tmp[j] = sun[t];\n        t++;\n      }\n      s[n].tmp[j] = '\u0000';\n      k = 0;\n    } else\n      k++;\n  }\n  s[n].tmp[j - 1] = '\u0000';\n  for (i = 1; i <= n; i++) {\n    if (strcmp(s[i].tmp, a) == 0)\n      strcpy(s[i].tmp, b);\n    if (i != n)\n      cout << s[i].tmp << \" \";\n    else\n      printf(\"%s\", s[i].tmp);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bijiao(int p, char *a, int n, char *b) {\n  int i, flag = 0;\n  for (i = 0; i < n; i++) {\n    if (a[p + i] != b[i]) {\n      return 0;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 1;\n  }\n}\nint main() {\n  char str[1000];\n  char a[100];\n  char b[100];\n  int i;\n  int len1, len2, len;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(str);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (i == 0) {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    } else {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ' &&\n          str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else if (bijiao(i, str, len1, a) == 1 && i + len1 == len &&\n                 str[i - 1] == ' ') {\n        cout << b;\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34616", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[4000];\n  char a[100], b[100];\n  char str[40][100];\n  char temp[100] = \"\";\n  int k = 0, j = 0, i, n, m;\n\n  cin >> string;\n  n = strlen(string);\n  for (i = 0; i < n; i++) {\n    if (string[i] != ' ') {\n      temp[k] = string[i];\n      str[j][k] = string[i];\n      k++;\n    } else {\n      strcpy(str[j], temp);\n      k = 0;\n      j++;\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n    if (i == n - 1) {\n      strcpy(str[j], temp);\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], a) == 0) {\n      strcpy(str[i], b);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34617", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst char flag = -128, noo = -126;\nint main() {\n  int i, l1, l2, l;\n  char s1[101], s2[101], s[1001], *p;\n\n  cin >> s;\n  cin >> s1;\n  cin >> s2;\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l = strlen(s);\n  while ((p = strstr(s, s1)) != NULL) {\n\n    if (p != s && *(p - 1) != ' ') {\n      *p = noo;\n      continue;\n    }\n    *p = flag;\n    for (p++; *(p + l1 - 1) != 0; p++)\n      *p = *(p + l1 - 1);\n    *p = 0;\n    l -= l1 - 1;\n  }\n\n  for (i = 0; i < l; i++)\n    if (s[i] == flag)\n      printf(\"%s\", s2);\n    else if (s[i] == noo)\n      printf(\"%c\", s1[0]);\n    else\n      printf(\"%c\", s[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, ls, la, p, f;\n  char s[201], a[101], b[101];\n\n  cin >> s;\n  ls = strlen(s);\n\n  cin >> a;\n  la = strlen(a);\n\n  cin >> b;\n\n  s[ls] = ' ';\n  s[ls + 1] = '\u0000';\n\n  i = -1;\n  while (i < ls) {\n    i++;\n    p = i;\n    while (s[i] != ' ')\n      i++;\n    if (i - p != la) {\n      for (j = p; j < i; j++)\n        printf(\"%c\", s[j]);\n      if (i != ls)\n        printf(\" \");\n      else {\n        printf(\" \");\n        break;\n      }\n    } else {\n      f = 1;\n      for (j = 0; j < la; j++)\n        if (s[p + j] != a[j]) {\n          f = 0;\n          break;\n        }\n      if (f == 1) {\n        printf(\"%s\", b);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n\n      else {\n        for (j = p; j < i; j++)\n          printf(\"%c\", s[j]);\n        if (i != ls)\n          printf(\" \");\n        else {\n          printf(\" \");\n          break;\n        }\n      }\n    }\n  };\n\n  return 0;\n}\n"}
{"label": "19", "index": "34619", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[50][100];\n  int i, n = 0, len1, len2, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(c[n], (s + k));\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(c[n], (s + k));\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "34620", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zong[2000];\n  char x[200], y[200], words[200][20];\n  int i, j = 0, p = 0, len;\n\n  scanf(\"%s \", zong);\n  scanf(\"%s %s\", x, y);\n  len = strlen(zong);\n  for (i = 0; i < len; i++) {\n    if (zong[i] != ' ') {\n      words[j][p] = zong[i];\n      p++;\n    } else {\n      words[j][p] = 0;\n      j++;\n      p = 0;\n    }\n  }\n  words[j][p] = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(words[i], x) == 0) {\n      printf(\"%s \", y);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[j], x) == 0) {\n    printf(\"%s \", y);\n  } else {\n    printf(\"%s \", words[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34621", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[100][100];\n  char str[1000];\n\n  scanf(\"%s \", str);\n  int len = strlen(str);\n  int i;\n  int count = 0;\n  for (i = 0; i < len + 1; i++) {\n    if (str[i] == ' ' || (str[i] == '\u0000')) {\n      int k, q = 0;\n      for (k = i - 1; k >= 0; k--) {\n        if (str[k] == ' ')\n          break;\n      }\n\n      for (++k; k <= i; k++) {\n        string[count][q] = str[k];\n        q++;\n      }\n      string[count][q - 1] = '\u0000';\n      count++;\n    }\n  }\n  char from[100];\n  char to[100];\n\n  scanf(\"%s \", from);\n\n  cin >> to;\n  char *nowword;\n  int j = 0;\n  for (j = 0; j < count; j++) {\n    nowword = string[j];\n    if (strcmp(nowword, from) == 0) {\n      strcpy(nowword, to);\n    }\n  }\n  printf(\"%s\", string[0]);\n  for (i = 1; i < count; i++)\n    printf(\" %s\", string[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34622", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[150], a[100], b[100], *p, *q;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  while (strstr(q, a) != NULL) {\n    p = strstr(q, a);\n    *p = '\u0000';\n    if ((*(p - 1) != ' ') && ((p - 1) > s) ||\n        (*(p + strlen(a)) != ' ') && (p + strlen(a) < s + strlen(s)))\n      cout << q << a;\n    else\n      printf(\"%s%s\", q, b);\n    p += strlen(a);\n    q = p;\n  }\n  cout << q;\n}\n"}
{"label": "19", "index": "34623", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  int i, j = 0, k, m;\n  int n = 1;\n  char t[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ')\n      n++;\n  }\n\n  for (i = 0; s[i] != ' '; i++) {\n    t[i] = s[i];\n  }\n  t[i] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", t);\n  }\n  k = i + 1;\n\n  for (i = 1; i < n - 1; i++) {\n    m = 0;\n    for (j = k; s[j] != ' '; j++) {\n      t[m] = s[j];\n      m++;\n    }\n    t[m] = '\u0000';\n    if (strcmp(t, a) == 0) {\n      printf(\" %s\", b);\n    } else {\n      printf(\" %s\", t);\n    }\n    k = j + 1;\n  }\n\n  m = 0;\n  for (j = k; s[j] != '\u0000'; j++) {\n    t[m] = s[j];\n    m++;\n  }\n  t[m] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\" %s\", b);\n  } else {\n    printf(\" %s\", t);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34624", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], s1[100], s2[100], t[100];\n  char *p, *p1;\n  int i = 0;\n\n  cin >> str;\n\n  cin >> s1;\n\n  cin >> s2;\n  for (p = str; *(p - 1) != '\u0000'; p++) {\n    if (*p == ' ' || *p == '\u0000') \n    {\n      *(t + i) = '\u0000';         \n      if (strcmp(s1, t) == 0) \n        p1 = s2;\n      else\n        p1 = t; \n\n      if (p - strlen(t) != str) \n        putchar(' ');\n      printf(\"%s\", p1);\n      i = 0;\n    } else {\n      *(t + i) = *p;\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "34625", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint check(char p[100], char q[100], int a, int b) {\n  int m, x;\n  for (m = 0; m <= a; m++) {\n    if (p[b + m] == q[m])\n      x = 1;\n    else {\n      x = 0;\n      break;\n    }\n  }\n  return (x);\n}\nint main() {\n  char s[100], a[100], b[100];\n  int i, l, j;\n  for (i = 0; i < 100; i++) {\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n  }\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  l = strlen(s);\n  s[l] = ' ';\n  l = strlen(a);\n  a[l] = ' ';\n  if (check(s, a, l, 0))\n    printf(\"%s\", b);\n  else {\n    i = 0;\n    do {\n      printf(\"%c\", s[i]);\n      i++;\n    } while (s[i] != ' ');\n  }\n  i = 0;\n  while (s[i] != ' ')\n    i++;\n  for (i = i + 1; i < 100;) {\n    j = i;\n    if (s[i] == '\u0000')\n      break;\n    else if (check(s, a, l, i))\n      printf(\" %s\", b);\n    else {\n      printf(\" \");\n      do {\n        printf(\"%c\", s[i]);\n        i++;\n      } while (s[i] != ' ');\n    }\n    i = j;\n    while (s[i] != ' ')\n      i++;\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, w;\n  char a[100] = {0}, b[100] = {0}, c[100] = {0}, d[100][100] = {'\u0000'};\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  char *pc, *pa, *pb, (*pd)[100];\n  pa = &a[0];\n  pb = &b[0];\n  pc = &c[0];\n  pd = d;\n  int k = 0, ll = strlen(c);\n  for (i = 0;; i++) {\n    for (j = 0; *(pa + k) != ' '; j++) {\n      if (*(pa + k) == '\u0000') {\n        (*(*(pd + i) + j)) = (*(pa + k));\n        break;\n      }\n      (*(*(pd + i) + j)) = (*(pa + k));\n      k++;\n    }\n    (*(*(pd + i) + j)) = '\u0000';\n    if ((*(pa + k)) == '\u0000')\n      break;\n    k++;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int l = strlen(d[i]);\n    for (j = 0; j < l + 1; j++) {\n      if ((*(*(pd + i) + j)) == (*(pb + j))) {\n        w = 1;\n        continue;\n      } else {\n        w = 0;\n        break;\n      }\n    }\n    if (w) {\n      for (k = 0; k < ll; k++) {\n        (*(*(pd + i) + k)) = (*(pc + k));\n      }\n      (*(*(pd + i) + k)) = '\u0000';\n    } else\n      continue;\n  }\n  for (i = 0; i < count; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%s\", d[i]);\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34627", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[201], b[201], c[201];\n  int i, j, la, lb, k, t, ls;\n\n  cin >> s;\n  cin >> a >> b;\n  la = strlen(a), lb = strlen(b), ls = strlen(s);\n  for (i = 0; i < 100; i = i + 1)\n    c[i] = s[i];\n  t = 0;\n  for (i = 0; i < ls; i = i + 1) {\n    if (s[i] == '\u0000')\n      break;\n    for (j = 0; j < la; j = j + 1) {\n      if (s[i + j] != a[j])\n        break;\n    }\n    if (j == la && (s[i + la] == ' ' || s[i + la] == '\u0000') &&\n        (s[i - 1] == ' ' || i == 0)) {\n\n      for (k = 0; k < lb; k = k + 1)\n        s[i + k] = b[k];\n      for (k = 0; k < 100; k = k + 1)\n        s[i + lb + k] = c[i + la + t * (la - lb) + k];\n      t = t + 1;\n    }\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34628", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[101], aim[101], change[101];\n\n  cin >> str;\n\n  cin >> aim;\n\n  cin >> change;\n\n  int i;\n  int count;\n  char tword[101];\n  count = 0;\n  tword[count] = '\u0000';\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ' && str[i] != ',') {\n      tword[count] = str[i];\n      count++;\n    } else {\n      tword[count] = '\u0000';\n      if (strcmp(tword, aim) == 0) {\n        cout << change << \" \";\n      } else\n        printf(\"%s \", tword);\n      count = 0;\n      tword[count] = '\u0000';\n    }\n  }\n  tword[count] = '\u0000';\n  if (strcmp(tword, aim) == 0) {\n    printf(\"%s\", change);\n  } else\n    printf(\"%s\", tword);\n  return 0;\n}\n"}
{"label": "19", "index": "34629", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[300], a[300], b[300];\n  int x, y, z, i, k;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (k = 0; k <= x - 1; k++) {\n    int q = 1;\n    for (i = k; q != 9 && i <= k + y - 1; i++) {\n      if (s[i] != a[i - k])\n        q = 9;\n    }\n    if (q == 9)\n      continue;\n    else if (q == 1 && ((s[k - 1] == ' ' && k > 0) || k == 0)) {\n      if (y >= z) {\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n        for (i = k + z; i <= 299; i++)\n          s[i] = s[i + y - z];\n      } else if (y < z) {\n        for (i = 299; i >= k + z; i--)\n          s[i] = s[i + y - z];\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n      }\n    }\n    k += z - 1;\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "34630", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int t1, t2, t3, m, i;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  t1 = strlen(s);\n  t2 = strlen(a);\n  t3 = strlen(b);\n  for (i = 0; s[i]; i++) {\n    m = -1;\n    if (s[i] == a[0] && (s[i - 1] == ' ') || i == 0) {\n      for (int j = 0; j < t2; j++) {\n        if (s[i + j] == a[j] &&\n            ((s[i + t2] == ' ' || s[i + t2] == '\u0000') || a[t2] == '\u0000'))\n          m = i;\n        else {\n          m = -1;\n          break;\n        }\n      }\n    }\n    if (m == i) {\n\n      if (t3 > t2) {\n        for (int u = strlen(s); u >= (t2 + m); u--) {\n          s[u + t3 - t2] = s[u];\n        }\n        for (int p = m; p < t3 + m; p++)\n          s[p] = b[p - m];\n\n      } else if (t3 <= t2) {\n        for (int k = m; k < t3 + m; k++)\n          s[k] = b[k - m];\n\n        for (int l = t3 + m; l < t2 + m; l++) {\n          s[l] = ' ';\n        }\n        for (int u = t2 + m; u < strlen(s) - t3 + t2; u++) {\n          s[u - t2 + t3] = s[u];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34631", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  int i, j, len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int n = 0;\n  int word = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      word = 1;\n      n++;\n    }\n  }\n  int A = 0;\n  int l = 0;\n  int k;\n  char x[100];\n  for (j = 0; j < n; j++) {\n    for (i = A, k = 0; i < len; i++, k++) {\n      if (s[i] != ' ') {\n        x[k] = s[i];\n      }\n      if (s[i] == ' ') {\n        x[k] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len)\n      x[k] = '\u0000';\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    l++;\n    if (l != n) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34632", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100], t[100];\n  int lenb, lena, len;\n  int i = 0, j;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  cin >> b;\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  while (i < len) {\n    j = 0;\n    while (isgraph(c[i]))\n      t[j++] = c[i++];\n    t[j] = '\u0000';\n    if (strcmp(t, a))\n      printf(\"%s\", t);\n    else\n      printf(\"%s\", b);\n    if (c[i])\n      printf(\"%c\", c[i++]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34633", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  for (i = 0; i < strlen(A); i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(C[i], B) == 0) {\n      strcpy(C[i], T);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", C[i]);\n  }\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[1000], a[100], b[100], p[100][100];\n\n  cin >> s;\n  cin >> a >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      j++;\n      k = 0;\n    } else {\n      p[j][k] = s[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(p[i], a) == 0) {\n      strcpy(p[i], b);\n    }\n  }\n  cout << p[0];\n  for (i = 1; i <= j; i++) {\n    printf(\" %s\", p[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100], *p;\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  m = strlen(s);\n  for (p = s; p < s + m; p++)\n    if (*p == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; *(s + k) != 32; j++) {\n      *(*(c + i) + j) = *(s + k);\n      k++;\n    }\n    if (*(s + k) == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n}\n"}
{"label": "19", "index": "34636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[200], x[200], y[200];\n  int i, j, t[200] = {0};\n\n  cin >> word;\n  scanf(\"%s%s\", x, y);\n  for (i = 0; i < strlen(word); i++) {\n    if ((i == 0) || word[i - 1] == ' ')\n      for (j = 0; j < strlen(x); j++) {\n        if (word[i + j] != x[j])\n          break;\n        else if ((j == strlen(x) - 1) &&\n                 (word[i + j + 1] == ' ' || word[i + j + 1] == '\u0000'))\n          t[i] = 1;\n      }\n  }\n  for (i = 0; i < strlen(word); i++) {\n    if (t[i] == 0) {\n      printf(\"%c\", word[i]);\n    } else {\n      printf(\"%s\", y);\n      i = i + strlen(x) - 1;\n    }\n  }\n}\n"}
{"label": "19", "index": "34637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, al, bl, cl;\n  char c[1000] = {\"\"}, a[100] = {\"\"}, b[100] = {\"\"};\n  char *p, *q;\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (p = c; p < c + cl;) {\n    q = p;\n    for (; *q != ' ' && *q != '\u0000'; q++)\n      ;\n    if ((q - p) != al) {\n      for (; p < q; p++)\n        printf(\"%c\", *p);\n      if (q != c + cl)\n        printf(\" \"), p++;\n    } else {\n      for (j = 0, q = p; j < al; q++, j++)\n        if (*q != a[j])\n          break;\n      if (j == al) {\n        if (q != c + cl)\n          printf(\"%s \", b);\n        else\n          printf(\"%s\", b);\n        p = p + al + 1;\n      } else\n        for (; p <= q; p++)\n          printf(\"%c\", *p);\n    }\n  }\n}\n"}
{"label": "19", "index": "34638", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], word[100] = {'0'}, change[100], chafor[100];\n  char a[100][100] = {{'0'}, {'0'}};\n  int i, j, len, m, start = 0, num = 1;\n\n  cin >> str;\n\n  cin >> change;\n\n  cin >> chafor;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ')\n      num += 1;\n  }\n  for (i = 0; i < num; i++) {\n    m = 0;\n    for (j = start; j < len; j++) {\n      if (str[j] != ' ') {\n        a[i][m] = str[j];\n        m += 1;\n      } else {\n        start = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], change) == 0) {\n      strcpy(a[i], chafor);\n    }\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++)\n    printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, d, e = -1;\n  char f[100], g[100], h[100], i[100], j[100];\n\n  cin >> f;\n\n  cin >> g;\n\n  scanf(\"%s \", h);\n  f[-1] = ' ';\n  for (a = -1; a <= 100;) {\n    i[e] = f[a];\n    if (f[a] == ' ' && f[a + 1] == g[0]) {\n      for (b = 0;; b++) {\n        if (g[b] == '\u0000') {\n          for (d = 0; h[d] != '\u0000'; d++)\n            i[e + d + 1] = h[d];\n\n          i[e + d + 1] = ' ';\n          e = e + d;\n          a = a + b;\n          break;\n        }\n\n        if (f[a + b + 1] != g[b])\n          break;\n      }\n    }\n    a++;\n    e++;\n  }\n  printf(\"%s\", i);\n}\n"}
{"label": "19", "index": "34640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0, l;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  l = strlen(A);\n  for (i = 0; i < l; i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    l = strcmp(C[i], B);\n    if (l == 0)\n      strcpy(C[i], T);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", C[i]);\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "34641", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  char word[51][20];\n  char word1[20], word2[20];\n\n  cin >> str;\n  cin >> word1 >> word2;\n  int point, i, counter;\n  counter = 1;\n  i = 0;\n  for (point = 0; str[point] != '\u0000'; point++) {\n    if (str[point] == ' ') {\n      word[counter][i] = '\u0000';\n      counter++;\n      i = 0;\n    } else {\n      word[counter][i] = str[point];\n      i++;\n    }\n  }\n  word[counter][i] = '\u0000';\n\n  int k;\n  for (k = 1; k <= counter; k++) {\n    int flag = 0;\n    for (i = 0; word1[i] != '\u0000'; i++) {\n      if (word[k][i] != word1[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << word2;\n    else\n      cout << word[k];\n    if (k != counter)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i = 0, n;\n  char *s[100];\n  s[0] = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n    s[i] = (char *)malloc(100 * sizeof(char));\n  }\n  n = i;\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(*(s + i), *(s + n - 2)) == 0)\n      strcpy(*(s + i), *(s + n - 1));\n    if (i != n - 3)\n      printf(\"%s \", *(s + i));\n    else\n      cout << *(s + i);\n  }\n}\n"}
{"label": "19", "index": "34643", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[102], a[102], b[102];\n  char temp[102] = {0};\n  unsigned int i, j;\n  unsigned int sum = 0;\n  unsigned int sum1 = 0;\n  int flag = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  for (i = 0; i < strlen(s); i++) {\n\n    if (s[i] != ' ') {\n      sum1 = sum1 + 1;\n      if (i != strlen(s) - 1)\n        continue;\n      else {\n        i = i + 1;\n        flag = 1;\n      }\n    }\n    for (j = 0; j < strlen(a) && strlen(a) == sum1; j++) {\n      if (s[i - sum1 + j] == a[j])\n        sum = sum + 1;\n    }\n    if (sum == strlen(a)) {\n      for (j = 0; j < strlen(b); j++) {\n        printf(\"%c\", b[j]);\n      }\n    } else {\n      for (j = 0; j < sum1; j++) {\n        printf(\"%c\", s[i - sum1 + j]);\n      }\n    }\n    if (flag == 0)\n      printf(\"%c\", ' ');\n    sum1 = 0;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34644", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[100], b[100];\n\n  int i, j, lengths, lengtha, lengthb, g = 0, k = 0, m;\n  cin.getline(s, 256);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n  a[lengtha] = ' ';\n  for (i = lengtha + 1; i > 0; i--) {\n    a[i] = a[i - 1];\n  }\n  a[0] = ' ';\n  if (s[0] == a[1]) {\n    for (i = 0; i <= lengtha; i++) {\n      a[i] = a[i + 1];\n    }\n    a[lengtha + 1] = 0;\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (g == 0)\n        cout << s[i];\n      if (g == 1) {\n        cout << b;\n        i = i + lengtha - 1;\n      }\n    }\n  } else\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha + 1; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (i + lengtha + 1 == lengths) {\n        for (m = 0; m <= lengtha - 1; m++) {\n          if (s[i + m] == a[m])\n            g = 1;\n          else\n            g = 0;\n          if (g == 0)\n            break;\n        }\n        if (g == 1) {\n          printf(\" %s\", b);\n          break;\n        } else\n          cout << s[i];\n      } else {\n        if (g == 0)\n          cout << s[i];\n        if (g == 1) {\n          cout << ' ' << b;\n          i = i + lengtha;\n        }\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34645", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, k;\n  char a[100][100], b[100], c[100];\n  int n = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    k = getchar();\n    if (k == '\\n')\n      break;\n  }\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < n; i++) {\n    k = strcmp(b, a[i]);\n    if (k == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  printf(\"%s\", a[n - 1]);\n}\n"}
{"label": "19", "index": "34646", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  char c[100] = {0};\n  char d[100] = {0};\n  cin.getline(a, 100);\n  cin >> c;\n  cin >> d;\n  char b[100][100] = {0};\n  int i, num, k = 0, p = 0;\n  num = strlen(a);\n  a[num] = '\\n';\n  for (i = 0; i < num + 1; i++) {\n\n    b[k][p] = a[i];\n    p++;\n    if (a[i] == ' ' || a[i] == '\\n') {\n      b[k][p - 1] = 0;\n      k++;\n      p = 0;\n    }\n  }\n  int num1;\n  num1 = strlen(d);\n  for (i = 0; i < k + 1; i++) {\n    if (strcmp(b[i], c) == 0) {\n      for (p = 0; p < 100; p++) {\n        b[i][p] = 0;\n      }\n      for (p = 0; p < num1; p++) {\n        b[i][p] = d[p];\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << b[i] << \" \";\n  }\n  printf(\"%s\", b[k - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[110], zfcsz[110][110];\n  char a[110], b[110];\n  int i, n, k, j;\n\n  scanf(\"%s \", words);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(words);\n  k = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (words[i] != ' ') {\n      zfcsz[k][j] = words[i];\n      j++;\n      if (i == n - 1) {\n        k++;\n        zfcsz[k][j] = '\u0000';\n      }\n    } else {\n      zfcsz[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(zfcsz[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", zfcsz[i]);\n    }\n  }\n  if (strcmp(zfcsz[k - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    cout << zfcsz[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[80], s[30][20], test1[20], test2[20], *p;\n  int i, j, l, c, m = 0;\n\n  cin >> str;\n\n  cin >> test1;\n\n  cin >> test2;\n  p = str;\n  for (i = 0, c = 0; *(p + i) != ' '; i++, c++)\n    s[0][c] = *(p + i);\n  s[0][c] = '\u0000';\n  l = strlen(str);\n  m = 1;\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = i, c = 0; str[j] != ' '; j++, c++) {\n        s[m][c] = str[j];\n      }\n      s[m][c] = '\u0000';\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(test1, s[i]) == 0) {\n      strcpy(s[i], test2);\n    }\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", s[i]);\n  cout << s[m - 1];\n}\n"}
{"label": "19", "index": "34649", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], s[100][20] = {'\u0000'};\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int len, i, m = 0, n = 0;\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != ' ') {\n      s[m][n] = a[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i < m + 1; i++) {\n    if (strcmp(s[i], b) == 0) {\n      strcpy(s[i], c);\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", s[i]);\n  }\n  printf(\"%s \", s[m]);\n}\n"}
{"label": "19", "index": "34650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  for (i = 0; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        cout << b;\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        printf(\"%c\", s[i]);\n      m = 0;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[200], b[200], m[100][100];\n  int len, i, hang = 0, lie = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      m[hang][lie] = '\u0000';\n      hang++;\n      lie = 0;\n    } else {\n      m[hang][lie] = s[i];\n      lie++;\n    }\n    if (s[i + 1] == '\u0000') {\n      m[hang][lie] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= hang; i++) {\n    if (strcmp(a, m[i]) == 0)\n      strcpy(m[i], b);\n  }\n  for (i = 0; i < hang; i++)\n    printf(\"%s \", m[i]);\n  printf(\"%s\", m[hang]);\n  return 0;\n}\n"}
{"label": "19", "index": "34652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100], d[10000];\n  int i = 0, j = 0, k, la, lb, lc, s = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    for (k = 0, s = 0; k < lb; k++) {\n      if (a[i] == b[k]) {\n        s = s + 1;\n      }\n      i = i + 1;\n    }\n\n    if ((a[i - k - 1] == ' ') && (s == lb) || ((i - k == 0) && (s == lb))) {\n      i = i - 1;\n      for (k = 0; k < lc; k = k + 1) {\n        d[j] = c[k];\n        j = j + 1;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j = j + 1;\n    }\n  }\n  cout << d;\n}\n"}
{"label": "19", "index": "34653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    cin >> x[i];\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i - 2;\n  for (i = 0; i < n; i++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(x[i], x[n]) == 0)\n      printf(\"%s\", x[n + 1]);\n    else\n      cout << x[i];\n    j++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34654", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][101], a[101], b[101];\n  int i = 0, j = 0, k = 0;\n  for (i = 0;;) {\n    for (j = 0;; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        i++;\n        break;\n      }\n      if (s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      break;\n    }\n  }\n  s[i][j] = '\u0000';\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; k <= i; k++) {\n    if (strcmp(s[k], a) == 0) {\n      strcpy(s[k], b);\n    }\n  }\n  for (k = 0; k <= i; k++) {\n    if (k == 0)\n      printf(\"%s\", s[k]);\n    else\n      printf(\" %s\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int i, j, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    while (a[i] != ' ' && a[i] != '\u0000')\n      d[j++] = a[i++];\n    d[j] = '\u0000';\n    if (strcmp(b, d) == 0) {\n      printf(\"%s\", c);\n    } else {\n      printf(\"%s\", d);\n    }\n    if (i == k) {\n      printf(\"\u0000\");\n    } else {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[10] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i;\n  char a2[100];\n  a2[0] = ' ';\n  a2[1] = a[0];\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    a2[i + 1] = a[i];\n  }\n\n  char tmp[100];\n\n  int j;\n  tmp[0] = s[0];\n  for (i = 1; s[i - 1] != ' ' && s[i - 1] != '\u0000'; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      tmp[i] = '\u0000';\n    } else {\n      tmp[i] = s[i];\n    }\n  }\n  if (strcmp(tmp, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", tmp);\n  }\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; s[j] != ' ' && s[j] != '\u0000'; j++) {\n        tmp[0] = ' ';\n        if (s[j + 1] == ' ' || s[j + 1] == '\u0000') {\n          tmp[j - i] = s[j];\n          tmp[j - i + 1] = '\u0000';\n        } else {\n          tmp[j - i] = s[j];\n        }\n      }\n    } else\n      continue;\n\n    if (strcmp(tmp, a2) == 0) {\n      printf(\"%s\", c);\n      cout << b;\n    } else\n      printf(\"%s\", tmp);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sz[100], zfc[20][20], a[20], b[20];\n\n  cin >> sz;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, j = 0, k = 0;\n  for (i = 0; i <= strlen(sz); i++) {\n    if (sz[i] != '\u0000' && sz[i] != ' ') {\n      zfc[j][k] = sz[i];\n      k++;\n    }\n    if (sz[i] == '\u0000' || sz[i] == ' ') {\n      zfc[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(zfc[i], a) == 0)\n      strcpy(zfc[i], b);\n  }\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < j; i++) {\n    cout << \" \" << zfc[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34658", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[200], a[100], b[100];\n  int l, result = 0, i, j, l1;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    result = 0;\n    if ((i == 0) || (s[i - 1] == ' ')) {\n      result = 1;\n      for (j = i; j <= i + (l1 - 1); j++) {\n        if (s[j] != a[j - i])\n          result = 0;\n      }\n    }\n    if (result == 1) {\n      printf(\"%s\", b);\n      i = i + l1 - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34659", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char buf1[100];\n  char buf2[100];\n  char buf3[100];\n  char *tmp;\n\n  cin >> buf1;\n\n  cin >> buf2;\n\n  cin >> buf3;\n  tmp = buf1;\n  while ((*tmp) != 0) {\n    if (strncmp(tmp, buf2, strlen(buf2)) == 0) {\n      if ((tmp == buf1 || *(tmp - 1) == ' ')) {\n        printf(\"%s\", buf3);\n        tmp += strlen(buf2);\n      } else {\n        cout << *tmp;\n        ++tmp;\n      }\n    } else {\n      printf(\"%c\", *tmp);\n      ++tmp;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34660", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[110], zfcsz[110][110];\n  char a[110], b[110];\n  int i, n, k, j;\n\n  cin >> words;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  n = strlen(words);\n  k = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (words[i] != ' ') {\n      zfcsz[k][j] = words[i];\n      j++;\n      if (i == n - 1) {\n        k++;\n        zfcsz[k][j] = '\u0000';\n      }\n    } else {\n      zfcsz[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(zfcsz[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", zfcsz[i]);\n    }\n  }\n  if (strcmp(zfcsz[k - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", zfcsz[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[100] = {0}, c[100] = {0};\n  int i, j, k, m, count = 0;\n  int x, y;\n  int al, bl, cl;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (i = 0; i <= 100; i++) {\n    for (j = 0; j < bl; j++) {\n      if (a[i + j] == b[j])\n        count++;\n    }\n    x = ((i > 0) && (a[i - 1] == ' ') &&\n         ((a[i + bl] == ' ') || a[i + bl] == (char)0));\n    y = ((i == 0) && ((a[i + bl] == ' ' || a[i + bl] == (char)0)));\n    if (count == bl && (x || y)) {\n      if (bl >= cl) {\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n        for (m = i + cl; m < al - cl; m++)\n          a[m] = a[m - cl + bl];\n      } else {\n        for (m = 100; m >= i + cl; m--)\n          a[m] = a[m - (cl - bl)];\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n      }\n    }\n\n    count = 0;\n  }\n  cout << a;\n}\n"}
{"label": "19", "index": "34662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p;\n  s = (char *)malloc(100);\n  a = (char *)malloc(20);\n  b = (char *)malloc(20);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  int i;\n  while (*s != '\u0000') {\n    if (*s != ' ')\n      s = s + 1;\n    else if (*s == ' ') {\n      *s = '\u0000';\n      s = s + 1;\n      if (strcmp(p, a) == 0)\n        printf(\"%s \", b);\n      else\n        cout << p << \" \";\n      p = s;\n    }\n  }\n  if (strcmp(p, a) == 0) {\n    printf(\"%s\", b);\n  } else\n    printf(\"%s\", p);\n  return 0;\n}\n"}
{"label": "19", "index": "34663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c = '0';\n  char *s[100];\n  char t[100], r[100];\n  int i = 0, j;\n  while (c != '\\n') {\n    s[i] = (char *)malloc(sizeof(char) * 100);\n    scanf(\"%s\", s[i++]);\n    scanf(\"%c\", &c);\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", r);\n  for (j = 0; j < i; j++) {\n    if (strcmp(t, s[j]) == 0)\n      s[j] = r;\n    printf(\"%s\", s[j]);\n    if (j < i - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char juzi[9999], danci1[101], danci2[101];\n  int i, j = 0, count = 0;\n\n  cin >> juzi;\n  scanf(\"%s%s\", danci1, danci2);\n  for (i = 0; i < strlen(juzi); i++) {\n    if (i == 0 || juzi[i - 1] == ' ')\n      for (j = 0; j < strlen(danci1); j++) {\n        if (*(juzi + i + j) == *(danci1 + j))\n          count++;\n        else {\n          count = 0;\n          break;\n        }\n      }\n    if (count != 0) {\n      cout << danci2;\n      i += strlen(danci1) - 1;\n      count = 0;\n    } else\n      cout << juzi[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34665", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[105];\nchar h[105];\nchar b[105];\nchar c[105];\nchar d[105];\nint k;\nint p;\nint main() {\n  int i, j;\n  int t;\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0, j = 0; i <= strlen(a); i++) {\n    d[k++] = a[i];\n    h[p++] = a[i];\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      d[--k] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        p -= strlen(d) + 1;\n        for (t = 0; t < strlen(c); t++)\n          h[p++] = c[t];\n        if (a[i] == ' ')\n          h[p++] = ' ';\n      }\n      j = k + 1;\n      k = 0;\n    }\n  }\n  for (i = 0; i < strlen(h); i++)\n    putchar(h[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34666", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint iflet(char a) {\n  int test = 0;\n  if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'))\n    test = 1;\n  return test;\n}\n\nint main() {\n  char ori[100], out[100], in[100];\n  char *pori = ori, *pout = out, *pin = in, temp[20];\n  int k;\n\n  cin >> ori;\n\n  cin >> out;\n\n  cin >> in;\n\n  for (; *pori != '\u0000';) {\n    if (*pori == ' ') {\n      cout << *pori;\n      pori++;\n    }\n\n    else if ((iflet(*pori) == 1 && *(pori - 1) == ' ') || (pori = ori)) {\n\n      for (k = 0; *(pori + k) != ' ' && *(pori + k) != '\u0000'; k++)\n        temp[k] = *(pori + k);\n      temp[k] = '\u0000';\n\n      if (strcmp(temp, out) == 0)\n        printf(\"%s\", in);\n\n      else\n        printf(\"%s\", temp);\n\n      pori = pori + k;\n    }\n  }\n}\n"}
{"label": "19", "index": "34667", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar S[1000][100];\nint Size = 0;\nint main() {\n\n  while (!feof(stdin))\n    scanf(\"%s\", S[Size++]);\n\n  Size--;\n  for (int i = 0; i < Size - 3; i++)\n    if (strcmp(S[i], S[Size - 2]) == 0)\n      cout << S[Size - 1] << \" \";\n    else\n      printf(\"%s \", S[i]);\n  if (strcmp(S[Size - 3], S[Size - 2]) == 0)\n    printf(\"%s\\n\", S[Size - 1]);\n  else\n    printf(\"%s\\n\", S[Size - 3]);\n  return 0;\n}\n"}
{"label": "19", "index": "34668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, c = 0, d = 0, e = 0, f, k, l, len1, len2;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == a[0] && (s[i - 1] == ' ' || i == 0)) {\n      d = 0;\n      for (j = 1; j < len2; j++) {\n        if (s[j + i] == a[j])\n          d += 1;\n      }\n\n      if (d == len2 - 1) {\n        e += 1;\n        s[i] = '\u0000';\n        f = 0;\n        for (k = 0; k < i; k++) {\n          if (s[k] == '\u0000')\n            f += 1;\n          if (f == e - 1) {\n            if (k == 0) {\n              for (l = k; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            } else {\n              for (l = k + len2; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            }\n          }\n        }\n        printf(\"%s\", b);\n      }\n    }\n  }\n  if (e != 0) {\n    for (i = 0; i < len1; i++) {\n      if (s[i] == '\u0000')\n        c += 1;\n      if (c == e) {\n        for (j = i + len2; j < len1; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n    }\n  } else\n    puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][100];\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", str[i]);\n    if (str[i][0] < 2) {\n      break;\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n    if (strcmp(str[i], str[j - 1]) == 0) {\n      strcpy(str[i], str[j]);\n    }\n  }\n  for (i = 0; i < j - 2; i++) {\n    printf(\"%s \", str[i]);\n  }\n  printf(\"%s\", str[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "34670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char Sen[200], word[200], exchange[200], temp[200];\n  cin >> Sen;\n  cin >> word;\n  cin >> exchange;\n  int n = strlen(Sen), i;\n  int m;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (Sen[i] != ' ') {\n      temp[m] = Sen[i];\n      m++;\n    } else {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n    if (i == n - 1) {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34671", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int i = 0;\n  while (i < strlen(a)) {\n    if (i == 0) {\n      if (a[i] == b[0]) {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      if (a[i] == b[0] && a[i - 1] == ' ') {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34672", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][1000] = {1}, b[100], c[100], d;\n  int i, n = 0;\n  for (i = 0;; i++) {\n    cin >> a[i] >> d;\n    n++;\n    if (d == '\\n')\n      break;\n  }\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i < n; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\"%s\", c);\n    else\n      printf(\"%s\", a[i]);\n    if (i == n - 1)\n      printf(\"\\n\");\n    else\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34673", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, l1, l2, e = 0;\n\n  cin >> s;\n  scanf(\"%s %s\", a, b);\n  getchar();\n  l1 = strlen(s);\n  l2 = strlen(a);\n  for (i = 0; i < l1; i++) {\n    if (i == 0) {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i + l2] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n    } else {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        cout << s[i];\n      }\n    }\n  }\n  printf(\" \");\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34674", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char s[101], a[101], b[101], r[101] = \"\"; \n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char temp[101];\n  int templen = 0;\n  for (int i = 0; s[i]; i++) {\n    if (s[i] != ' ') {\n      temp[templen] = s[i];\n      templen++;\n    } else {\n      temp[templen] = '\\0';\n      if (!strcmp(temp, a))\n        strcat(r, b); \n      else\n        strcat(r, temp); \n      strcat(r, \" \");    \n      templen = 0;\n    }\n  }\n  temp[templen] = '\\0';\n  if (!strcmp(temp, a))\n    strcat(r, b); \n  else\n    strcat(r, temp); \n  cout << r << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ini[101], former[101], latter[101], *p, *q = ini;\n  cin >> ini;\n  cin >> former;\n  cin >> latter;\n  for (p = ini;; p++)\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    } else if (*p == '\u0000') {\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34676", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, b = 0;\n  char s[80], s0[20], s2[20], s3[20];\n  char s1[100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> s0;\n\n  scanf(\"%s \", s2);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s3[b] = s[i];\n      b++;\n    }\n    if (s[i] == ' ') {\n      s3[b] = '\u0000';\n      if (strcmp(s3, s0) == 0) {\n        strcat(s1, s2);\n        strcat(s1, \" \");\n      } else {\n        strcat(s1, s3);\n        strcat(s1, \" \");\n      }\n      b = 0;\n    }\n  }\n  s3[b] = '\u0000';\n  if (strcmp(s3, s0) == 0) {\n    strcat(s1, s2);\n  } else {\n    strcat(s1, s3);\n  }\n  puts(s1);\n  return 0;\n}\n"}
{"label": "19", "index": "34677", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j;                    \n  char s[100], a[100], b[100]; \n  cin.getline(s, 100);         \n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  for (i = 0, j = 0; s[i] != '\\0';) { \n    if (s[i + j] == a[j] && (s[i - 1] == ' ' || i == 0))\n      j++; \n    else {\n      cout << s[i]; \n      i++;\n      j = 0;\n    }\n    if (a[j] == '\\0' && (s[i + j] == ' ' || s[i + j] == '\\0')) { \n      cout << b;\n      i += j;\n      j = 0;\n    }\n  }\n  return 0; \n}\n"}
{"label": "19", "index": "34678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], s[100][20] = {'\u0000'};\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  int len, i, m = 0, n = 0;\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != ' ') {\n      s[m][n] = a[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i < m + 1; i++) {\n    if (strcmp(s[i], b) == 0) {\n      strcpy(s[i], c);\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", s[i]);\n  }\n  cout << s[m] << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "34679", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c = '0';\n  char *s[100];\n  char t[100], r[100];\n  int i = 0, j;\n  while (c != '\\n') {\n    s[i] = (char *)malloc(sizeof(char) * 100);\n    scanf(\"%s\", s[i++]);\n    scanf(\"%c\", &c);\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", r);\n  for (j = 0; j < i; j++) {\n    if (strcmp(t, s[j]) == 0)\n      s[j] = r;\n    cout << s[j];\n    if (j < i - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char s[10000], ch[100], a[100], b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    for (j = 0; (s[i] != ' ' && s[i] != '\u0000'); i++, j++)\n      ch[j] = s[i];\n    ch[j] = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    cout << ch;\n    for (k = 0; k <= j; k++) {\n      ch[k] = '\u0000';\n    }\n    p++;\n  }\n}\n"}
{"label": "19", "index": "34681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100], result[100];\nint number[50];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a))\n      strcpy(ns[i], b);\n  }\n  for (i = 0; i < j; i++) {\n    cout << ns[i] << \" \";\n  }\n  printf(\"%s\", ns[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34682", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint check(char p[100], char q[100], int a, int b) {\n  int m, x;\n  for (m = 0; m <= a; m++) {\n    if (p[b + m] == q[m])\n      x = 1;\n    else {\n      x = 0;\n      break;\n    }\n  }\n  return (x);\n}\nint main() {\n  char s[100], a[100], b[100];\n  int i, l, j;\n  for (i = 0; i < 100; i++) {\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n  }\n\n  cin >> s;\n  cin >> a >> b;\n  l = strlen(s);\n  s[l] = ' ';\n  l = strlen(a);\n  a[l] = ' ';\n  if (check(s, a, l, 0))\n    printf(\"%s\", b);\n  else {\n    i = 0;\n    do {\n      printf(\"%c\", s[i]);\n      i++;\n    } while (s[i] != ' ');\n  }\n  i = 0;\n  while (s[i] != ' ')\n    i++;\n  for (i = i + 1; i < 100;) {\n    j = i;\n    if (s[i] == '\u0000')\n      break;\n    else if (check(s, a, l, i))\n      printf(\" %s\", b);\n    else {\n      printf(\" \");\n      do {\n        printf(\"%c\", s[i]);\n        i++;\n      } while (s[i] != ' ');\n    }\n    i = j;\n    while (s[i] != ' ')\n      i++;\n    i = i + 1;\n  }\n}\n"}
{"label": "19", "index": "34683", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar sentence[100][100], a[100], b[100];\n\nint main() {\n  int cnt = 1;\n  while (scanf(\"%s\", sentence[cnt]) != EOF)\n    cnt++;\n  cnt--;\n  memcpy(a, sentence[cnt - 1], sizeof(sentence[cnt - 1]));\n  memcpy(b, sentence[cnt], sizeof(sentence[cnt]));\n  for (int i = 1; i < cnt - 1; i++) {\n    if (i != 1)\n      printf(\" \");\n    if (strcmp(sentence[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", sentence[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "34684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sen[1000] = \"\u0000\";\n  char word_1[101] = \"\u0000\";\n  char word_2[101] = \"\u0000\";\n  char word_1_1[101] = \"\u0000\";\n  int number[101] = {0};\n  int i, j, k;\n  int sum;\n  int num = 0;\n  int m = 0;\n\n  cin >> sen;\n  cin >> word_1;\n  cin >> word_2;\n  for (i = 0; i <= strlen(sen) - strlen(word_1); i++) {\n    sum = 0;\n    for (j = 0; j <= strlen(word_1) - 1; j++)\n      word_1_1[j] = sen[j + i];\n    for (j = 0; j <= strlen(word_1) - 1; j++) {\n      if (word_1_1[j] != word_1[j])\n        sum = sum + 1;\n    }\n    if ((sum == 0) && (i != 0) && (sen[i - 1] != ' '))\n      sum = sum + 1;\n    if (sum == 0) {\n      number[m] = i;\n      m = m + 1;\n      num = num + 1;\n    }\n  }\n  for (k = 1; k <= num; k++) {\n\n    if (k == 1)\n      for (j = 0; j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    if (k != 1)\n      for (j = number[k - 2] + strlen(word_1); j < number[k - 1]; j++)\n        cout << sen[j];\n    for (j = 0; j < strlen(word_2); j++)\n      printf(\"%c\", word_2[j]);\n    if (k == num) {\n      if (number[k - 1] + strlen(word_1) == strlen(sen))\n        printf(\" \");\n      else {\n        for (j = number[k - 1] + strlen(word_1); j < strlen(sen); j++) {\n\n          if (j == strlen(sen) - 1)\n            printf(\"%c \", sen[j]);\n          else\n            printf(\"%c\", sen[j]);\n        }\n      }\n    }\n  }\n\n  if (num == 0)\n    printf(\"%s \", sen);\n  return 0;\n}\n"}
{"label": "19", "index": "34685", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[200], a[101], b[101];\n  char *ptemp, *pstr, *pa, *pb;\n  int flag, lstr, la, lb;\n  pstr = str;\n  pa = a;\n  pb = b;\n  cin >> pstr;\n  cin >> pa;\n  cin >> pb;\n  lstr = strlen(pstr);\n  la = strlen(pa);\n  lb = strlen(pb);\n  for (; pstr <= str + lstr - 1; pstr++) {\n    flag = 1;\n    while ((*pstr != ' ') && (*pstr != '\u0000')) {\n      if (*pstr != *pa)\n        flag = 0;\n      pstr++;\n      pa++;\n    }\n    if ((flag) && (pa == a + la)) {\n      ptemp = pstr;\n      if (la < lb) {\n        for (pstr = str + lstr; pstr >= ptemp; pstr--)\n          *(pstr + lb - la) = *pstr;\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr + lb - la;\n      }\n      if (la >= lb) {\n        for (pstr = ptemp - la + lb; pstr <= str + lstr - la + lb; pstr++)\n          *pstr = *(pstr + la - lb);\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr - la + lb;\n      }\n    }\n    pa = a;\n  }\n  pstr = str;\n  printf(\"%s\", pstr);\n  return 0;\n}\n"}
{"label": "19", "index": "34686", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char t[100];\n  char b[100];\n  int k, i, j, word;\n  word = 0;\n  k = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int len;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else {\n      if (word == 0) {\n        k++;\n        word = 1;\n      }\n    }\n  }\n  int A = 0;\n  int n;\n  int m = 0;\n  for (j = 0; j < k; j++) {\n    for (i = A, n = 0; i < len; i++, n++) {\n      if (s[i] != ' ') {\n        t[n] = s[i];\n      }\n      if (s[i] == ' ') {\n        t[n] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len) {\n      t[n] = '\u0000';\n    }\n\n    if (strcmp(t, a) == 0) {\n      strcpy(t, b);\n    }\n    m++;\n    if (m != k) {\n      printf(\"%s \", t);\n    }\n    if (m == k) {\n      cout << t << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34687", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sour[100], result[100];\n  char a[20], b[20], c[20];\n  char *p = NULL, *q = NULL;\n  int i, k = 0;\n  int l_1, l_2, l_3, l_4, l_5, x = 0;\n  int flag;\n  int j;\n  int word_length = 0;\n  int flag_2 = 0;\n\n  cin >> sour;\n\n  cin >> a;\n\n  cin >> b;\n  l_1 = strlen(sour);\n  l_2 = strlen(a);\n  l_3 = strlen(b);\n  p = sour;\n  q = sour;\n  for (j = 0; j < l_1 - l_2 + 1;) {\n    for (i = 0; i < l_2; i++, j++) {\n      c[i] = sour[j];\n    }\n    j = x;\n    x++;\n    if (strcmp(c, a) == 0)\n      flag_2++;\n  }\n\n  while (*p != '\u0000') {\n    if (*p == ' ' || *(p + 1) == '\u0000') {\n      flag = 1;\n      if (*p == ' ')\n        word_length = p - q;\n      else\n        word_length = p - q + 1;\n      if (word_length == strlen(a)) {\n        for (i = 0; i < strlen(a); i++) {\n          if (q[i] != a[i]) {\n            flag = 0;\n            break;\n          }\n        }\n      } else\n        flag = 0;\n\n      if (flag == 1) {\n        for (i = 0; i < strlen(b); i++) {\n          result[k++] = b[i];\n        }\n\n      } else {\n        while (q != p) {\n          result[k++] = *q++;\n        }\n      }\n      if (*p == ' ')\n        result[k++] = ' ';\n      else\n        result[k++] = *p;\n\n      q = p + 1;\n    }\n    p++;\n  }\n\n  result[k] = '\u0000';\n  l_4 = strlen(result);\n  l_5 = l_1 - l_2 + l_3;\n  if ((l_4 != l_5)) {\n    if (flag_2 == 1)\n      result[k - 1] = '\u0000';\n  }\n  puts(result);\n}\n"}
{"label": "19", "index": "34688", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s0[2001], s1[201], s2[201];\n  cin.getline(s0, 2000);\n  cin.getline(s1, 200);\n  cin.getline(s2, 200);\n  int L0 = 0, L1 = 0, L2 = 0;\n  while (s0[L0] != 0)\n    L0++;\n  while (s1[L1] != 0)\n    L1++;\n  while (s2[L2] != 0)\n    L2++;\n  if (L1 == 0) {\n    cout << s0;\n    return 0;\n  }\n  for (int i = 0; i <= L0 - L1; i++) {\n    int is = 0;\n    for (int j = 0; j < L1; j++)\n      if (s0[i + j] != s1[j]) {\n        is++;\n        break;\n      }\n    if (is != 0)\n      continue;\n    if ((i != 0 && s0[i - 1] != ' ') || (s0[i + L1] != ' ' && s0[i + L1] != 0))\n      continue;\n    if (L1 > L2)\n      for (int j = i + L1; j < L0; j++)\n        s0[j + L2 - L1] = s0[j];\n    else\n      for (int j = L0 - 1; j >= i + L1; j--)\n        s0[j + L2 - L1] = s0[j];\n    for (int j = i; j < i + L2; j++)\n      s0[j] = s2[j - i];\n    L0 += L2 - L1;\n    i += L2;\n  }\n  s0[L0] = 0;\n  printf(\"%s\", s0);\n  return 0;\n}\n"}
{"label": "19", "index": "34689", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[210] = {'\u0000'}, a[100], b[100];\n  int i, j, x = 0, k = 0, q, l = 0, d, p, m, dd, sl;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(s);\n  l = strlen(a);\n  d = strlen(a) - strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    x = 0;\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (s[i + x] == a[k]) {\n        x++;\n      } else\n        break;\n    }\n    if (l == x && (s[i - 1] == ' ' || i == 0) &&\n        (s[i + x] == ' ' || s[i + x] == '\u0000')) {\n\n      if (d >= 0) {\n        for (q = i + x; s[q] != '\u0000'; q++) {\n          s[q - d] = s[q];\n        }\n        for (m = 0; m < d; m++) {\n          s[q - d + m] = '\u0000';\n        }\n      } else {\n        if (d < 0) {\n          dd = -d;\n          for (q = sl - 1; q >= i + x; q--) {\n            s[q + dd] = s[q];\n          }\n          sl = sl + dd;\n        }\n      }\n      p = i;\n      for (j = 0; b[j] != '\u0000'; j++) {\n        s[p] = b[j];\n        p++;\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34690", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char danci[100][100];\n  char ch[100];\n  char yaotihuan[100];\n  char tihuan[100];\n  int i;\n  int j;\n  int k;\n  int len;\n\n  scanf(\"%s \", ch);\n  for (j = 0; j < 100; j++) {\n    for (k = 0; k < 100; k++)\n      danci[j][k] = '\u0000';\n  }\n  j = 0;\n  k = 0;\n  len = strlen(ch);\n  for (i = 0; i < len; i++) {\n    if (ch[i] != ' ' && ch[i] != ' ') {\n      danci[j][k] = ch[i];\n      k++;\n    } else {\n      if (ch[i] == ' ') {\n        j++;\n        k = 0;\n      }\n      if (ch[i] == ' ')\n        break;\n    }\n  }\n\n  scanf(\"%s\", yaotihuan);\n  scanf(\"%s\", tihuan);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], yaotihuan) == 0)\n      strcpy(danci[i], tihuan);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", danci[i]);\n  printf(\"%s\", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34691", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101], word1[101], word2[101], danci[50][101];\n  int LEN[50], LEN1, i, k = 0, j = 0;\n\n  cin >> sen;\n\n  cin >> word1;\n\n  cin >> word2;\n  LEN1 = strlen(sen);\n  for (i = 0; i < LEN1; i++) {\n    if (sen[i] != ' ') {\n      danci[j][k] = sen[i];\n      k++;\n    } else {\n      danci[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  danci[j][k] = '\u0000';\n  for (i = 0; i < j; i++) {\n    LEN[i] = strlen(danci[i]);\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], word1) == 0) {\n      strcpy(danci[i], word2);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s \", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34692", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", t);\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  for (int y = 0;; y++) {\n    if (a == 64) {\n      printf(\n          \"Almost all platforms for developing WebGIS are complex extremely\");\n      return 0;\n    }\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j]) {\n            h1++;\n          }\n        }\n        if (s[i - 1] == 't')\n          continue;\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "34693", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    flag = 1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1 && (i == 0 || a[i - 1] == ' ') &&\n        (i == lena - lenb || a[i + lenb] == ' ')) {\n      if (lenb > lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        for (k = i + lenc; k < lena; k++)\n\n          a[k] = a[k + lenb - 1];\n\n        i += lenc - 1;\n        lena -= lenb - lenc;\n      }\n      if (lenb == lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n      }\n      if (lenb < lenc) {\n        for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n          a[k] = a[k - lenc + lenb];\n        }\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        i += lenc - 1;\n        lena += lenc - lenb;\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], d[100][100];\n  int i, j, w, m, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  w = strlen(s);\n  for (i = 0, j = 0; i < w + 1; j++, i++) {\n    if (s[i] != ' ' && s[i] != 0) {\n      d[k][j] = s[i];\n    } else {\n      d[k][j] = 0;\n      k += 1;\n      j = -1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(d[i], a) == 0) {\n      strcpy(d[i], b);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << d[i] << \" \";\n  }\n  cout << d[k - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34695", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a, l, sum = 0; \n  char s[101];\n  char s1[101];\n  char s2[101];\n  char s0[101];\n  cin.getline(s, 101); \n  cin >> s1;\n  cin >> s2;\n  int k1 = strlen(s);\n  for (i = 0; i < strlen(s); i++) \n  {\n    if ((s[i] == s1[0] && s[strlen(s1) + i] == ' ' && s[i - 1] == ' ') ||\n        (i == 0 && s[i] == s1[0] && s[strlen(s1) + i] == ' ') ||\n        (s[i] == s1[0] && s[i - 1] == ' ' && i + strlen(s1) == strlen(s))) \n    {\n      for (a = 0; a < strlen(s) - i - strlen(s1); a++) \n        s0[a] = s[i + strlen(s1) + a];\n      for (j = 0; j < strlen(s2); j++) \n        s[i + j] = s2[j];\n      for (l = 0; l < strlen(s0); l++) \n        s[i + j + l] = s0[l];\n      sum++;\n      i = i + strlen(s2) - strlen(s1);\n    }\n  }\n  for (k = 0; k < k1 + sum * strlen(s2) - sum * strlen(s1); k++)\n    cout << s[k]; \n  return 0;\n}\n"}
{"label": "19", "index": "34696", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char *str, *s1, *s2, *t, *str2;\n  int n;\n  str = (char *)calloc(102, 1000);\n  s1 = (char *)calloc(102, 1000);\n  s2 = (char *)calloc(102, 1000);\n  t = (char *)calloc(102, 1000);\n  str2 = (char *)calloc(240, 1000);\n  cin >> str;\n  cin >> s1 >> s2;\n  do {\n    sscanf(str, \"%s\", t);\n    n = strlen(t);\n    str = str + n + 1;\n    if (strcmp(t, s1) == 0)\n      strcat(str2, s2);\n    else\n      strcat(str2, t);\n    if (*str != '\u0000')\n      strcat(str2, \" \");\n  } while (*str != '\u0000');\n  printf(\"%s\", str2);\n  return 0;\n}\n"}
{"label": "19", "index": "34697", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint change(int);\n\nconst int N = 100 + 1;\nchar s[N], a[N], b[N], c[N];\nint la = 0, ls = 0;\n\nint main() {\n  int p = 0;\n  cin.getline(s, N);\n  scanf(\"%s %s \", a, b);\n  la = strlen(a);\n  ls = strlen(s);\n  if (s[p] == a[0])\n    p = p + change(p);\n  while (p < ls) {\n    if ((s[p] == a[0]) && (s[p - 1] == ' '))\n      p = p + change(p);\n    else {\n      cout << s[p];\n      p++;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n\nint change(int p) {\n  int i, j;\n  for (i = 0; i < la; i++)\n    if (s[p + i] != a[i])\n      break;\n  if ((i == la) && (s[p + la] == ' ' || s[p + la] == '\\0')) {\n    cout << b;\n    return i;\n  }\n  for (j = 0; j < i; j++)\n    cout << s[p + j];\n  return i;\n}\n"}
{"label": "19", "index": "34698", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, len1, len2, k[100] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s[j] == a[j - i])\n        k[i] = k[i] + 1;\n      else\n        break;\n    }\n    if (k[i] == len2) {\n      if (i == 0 && s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i == len1 - len2 && s[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len2 - 1;\n      } else if (i > 0 && i < len1 - len2 && s[i - 1] == ' ' &&\n                 s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else\n        cout << s[i];\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34699", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i, k, x, h = 0;\n  char a[100], b[10], c[10];\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  x = strlen(b);\n\n  for (i = 0; i < x; i++) {\n    if (a[i] != b[i])\n      break;\n    h++;\n  }\n  if (h == x) {\n    for (i = 0; i < x; i++)\n      a[i] = '0';\n    n = 1;\n  }\n\n  h = 0;\n  for (i = 1; a[i + 2] != '\u0000'; i++) {\n    h = 0;\n    if (a[i] == ' ') {\n      for (k = 0; k < x; k++) {\n        if (a[i + k + 1] != b[k])\n          break;\n        h++;\n      }\n    }\n    if (h == x)\n      for (k = 0; k < x; k++)\n        a[i + k + 1] = '0';\n  }\n\n  if (n) {\n    printf(\"%s\", c);\n    for (i = x; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  }\n\n  else\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n\n  scanf(\"%s \", str);\n  char a[101], b[101];\n  scanf(\"%s%s\", a, b);\n  int n = strlen(str);\n  int i, k = 0, j = 0;\n  char c[101][101];\n  for (i = 0; i < n; i++) {\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(c[k], (str + j));\n      k++;\n      j = i + 1;\n    }\n  }\n  strcpy(c[k], (str + j));\n  k++;\n  for (i = 0; i < k; i++) {\n    if (i > 0) {\n      printf(\" \");\n    }\n    if (strcmp(c[i], a) == 0) {\n      cout << b;\n    } else {\n      cout << c[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34701", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  char result[200];\n  char f[200], r[200];\n\n  scanf(\"%s \", ch);\n  cin >> f >> r;\n\n  ch[strlen(ch) + 1] = 0;\n  ch[strlen(ch)] = ' ';\n\n  memset(result, 0, 200);\n  int last = 0;\n  for (int i = 0; i < strlen(ch); i++) {\n    if (ch[i] == ' ') {\n      ch[i] = 0;\n      char *p = ch + last;\n      if (strcmp(p, f) == 0)\n        sprintf(result, \"%s %s\", result, r);\n      else\n        sprintf(result, \"%s %s\", result, p);\n      last = i + 1;\n      ch[i] = ' ';\n    }\n  }\n  cout << result + 1 << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34702", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  int i, j, c = 0, d = 0, e = 0, f, k, l, len1, len2;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == a[0] && (s[i - 1] == ' ' || i == 0)) {\n      d = 0;\n      for (j = 1; j < len2; j++) {\n        if (s[j + i] == a[j])\n          d += 1;\n      }\n\n      if (d == len2 - 1) {\n        e += 1;\n        s[i] = '\u0000';\n        f = 0;\n        for (k = 0; k < i; k++) {\n          if (s[k] == '\u0000')\n            f += 1;\n          if (f == e - 1) {\n            if (k == 0) {\n              for (l = k; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            } else {\n              for (l = k + len2; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            }\n          }\n        }\n        printf(\"%s\", b);\n      }\n    }\n  }\n  if (e != 0) {\n    for (i = 0; i < len1; i++) {\n      if (s[i] == '\u0000')\n        c += 1;\n      if (c == e) {\n        for (j = i + len2; j < len1; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n    }\n  } else\n    puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  int len = strlen(str);\n  char **temp = (char **)malloc(len * sizeof(int *));\n  int i, j = 0, k = 0;\n  for (i = 0; i < len; i++)\n    temp[i] = (char *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    if (i == len - 1)\n      temp[j][k + 1] = 0;\n    if (str[i] != ' ') {\n      temp[j][k] = str[i];\n      k++;\n    } else {\n      temp[j][k] = 0;\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(temp[i], str1) == 0)\n      strcpy(temp[i], str2);\n  }\n\n  for (i = 0; i <= j - 1; i++) {\n    printf(\"%s\", temp[i]);\n    printf(\" \");\n  }\n\n  printf(\"%s\", temp[j]);\n\n  for (i = 0; i < len; i++)\n    free(temp[i]);\n  free(temp);\n  return (0);\n}\n"}
{"label": "19", "index": "34704", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  cin >> a >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if ((i == 0 && s[i] == a[0] && s[i + m - 1] == a[m - 1] &&\n         s[i + m] == ' ') ||\n        (i != 0 && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1] && s[i + m] == ' ') ||\n        (i + m == n && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1])) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        printf(\"%s\", b);\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n      k = 0;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "34705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000][1000] = {0};\n  int i, j, k = 0, e, d, h, n = 0, d1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  d = strlen(s);\n  for (i = k; i < d; i++) {\n    h = 0;\n    if (s[i] != ' ' && (s[i + 1] == ' ' || s[i + 1] == '\u0000')) {\n      for (j = k; j <= i; j++) {\n        c[n][h++] = s[j];\n      }\n      c[n][h] = '\u0000';\n      n += 1;\n      k = i + 2;\n    }\n  }\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      strcpy(c[i], b);\n      e = 1;\n    }\n  }\n  if (e == 0) {\n    printf(\"%s \", s);\n  } else {\n    for (i = 0; i < n - 1; i++) {\n      d1 = strlen(c[i]);\n      for (j = 0; j < d1; j++) {\n        printf(\"%c\", c[i][j]);\n      }\n      printf(\"%c\", ' ');\n    }\n    printf(\"%s \", c[n - 1]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100], *p;\n  int m, i, n = 0, k = 0, j;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  m = strlen(s);\n  for (p = s; p < s + m; p++)\n    if (*p == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; *(s + k) != 32; j++) {\n      *(*(c + i) + j) = *(s + k);\n      k++;\n    }\n    if (*(s + k) == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  cout << f;\n  return 0;\n}\n"}
{"label": "19", "index": "34707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], d[100], b[100][50];\n  int i, j = 0, k = 0, n, m, l;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", d);\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      b[j][k] = s[i];\n      k++;\n    } else {\n      b[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  b[j][k] = '\u0000';\n  for (m = 0; m < j + 1; m++) {\n    l = strcmp(a, b[m]);\n    if (l == 0)\n      strcpy(b[m], d);\n    if (m == 0)\n      printf(\"%s\", b[m]);\n    else\n      printf(\" %s\", b[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34708", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100] = {'\u0000'}, s2[100] = {'\u0000'}, a[100] = {'\u0000'}, b[100] = {'\u0000'};\n\n  scanf(\"%s \", s1);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = 0, lena = strlen(a), lenb = strlen(b), n = strlen(s1);\n  for (i = 0; i < n - lena + 1; i++) {\n    if (i > 0 && s1[i - 1] != ' ') {\n      s2[t] = s1[i];\n      t += 1;\n      continue;\n    }\n    for (j = 0; j < lena; j++) {\n      if (s1[i + j] != a[j])\n        break;\n    }\n    if (i + j == n || j == lena && s1[i + j] == ' ') {\n      for (k = 0; k < lenb; k++)\n        s2[t + k] = b[k];\n      t += lenb;\n      i += lena - 1;\n    } else {\n      s2[t] = s1[i];\n      t += 1;\n    }\n  }\n  if (i == n - lena + 1) {\n    for (k = 0; k < lena - 1; k++)\n      s2[t + k] = s1[i + k];\n  }\n  puts(s2);\n  return 0;\n}\n"}
{"label": "19", "index": "34709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100], word[100][100];\n  int n, k, j = 0, i;\n\n  cin >> words;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(words);\n  for (i = 0, k = 0; i < n + 1; i++) {\n    if (words[i] == ' ' || words[i] == '\u0000') {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    } else {\n      word[k][j] = words[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      printf(\"%s \", word[i]);\n  }\n\n  if (strcmp(word[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34710", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"}, *p, *q;\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  p = c;\n  q = d;\n  for (i = 0;;) {\n    for (j = 0; *(p + i) != ' ' && *(p + i) != '\u0000'; i++, j++)\n      *(q + j) = *(p + i);\n    *(q + j) = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", *(q + k));\n    if (*(p + i) != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n}\n"}
{"label": "19", "index": "34711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid swap(char *str, char *a, char *b) {\n  char *p1 = str, *p2 = a;\n  int len1, len2, len3, n, i = 0, j, k, m;\n  len1 = strlen(str);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  n = len3 - len2;\n  while (*p1 != '\u0000') {\n    if ((*p1 == *p2) && (!isalpha(*(p1 - 1))))\n      while ((*p1 == *p2) && (*p2 != '\u0000')) {\n        p1++, p2++;\n        i++;\n      }\n    else {\n      p1++;\n      i++;\n    }\n    if ((*p2 == '\u0000') && isalpha(*p1) == 0) {\n      if (n < 0) {\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        for (m = i; m < len1; m++)\n          str[j++] = str[m];\n        while (j < len1)\n          str[j++] = '\u0000';\n        len1 = strlen(str);\n      } else {\n\n        for (m = len1 + n; m > i; m--)\n          str[m] = str[len1--];\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        len1 = strlen(str);\n      }\n    }\n    p2 = a;\n  }\n}\nint main() {\n  char str[1000], a[200], b[200];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  swap(str, a, b);\n  puts(str);\n}\n"}
{"label": "19", "index": "34712", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000]; \n  int i, j, lensen, lena, lenb;                \n  sen[0] = ' ';                                \n  a[0] = ' ';                                  \n  b[0] = ' ';                                  \n\n  cin >> &sen[1];           \n  cin >> &a[1] >> &b[1];    \n                            \n  lensen = strlen(sen) + 1; \n  lena = strlen(a) + 1;     \n  lenb = strlen(b) + 1;     \n                            \n  sen[lensen - 1] = ' ';\n  a[lena - 1] = ' ';\n  b[lenb - 1] = ' ';\n\n  sen[lensen] = '\u0000';\n  a[lena] = '\u0000';\n  b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else {\n      end[j] = sen[i];\n    }                      \n  }                        \n                           \n  end[j - 1] = 0;          \n  cout << &end[1] << endl; \n  return 0;                \n}\n"}
{"label": "19", "index": "34713", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int q, w, e, i, j, s, shu, n, z;\n  cin.getline(a, 99);\n  cin.getline(b, 99);\n  cin.getline(c, 99);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    shu = 1;\n    s = i;\n    for (j = 0; j < w; j++) {\n      if (a[s] != b[j]) {\n        shu = 0;\n        break;\n      }\n      s++;\n    }\n    if (i == 0) {\n      if (a[s] != ' ')\n        shu = 0;\n    } else {\n      if ((a[i - 1] != ' ') || ((a[s] != ' ') && (a[s] != '\\0')))\n        shu = 0;\n    }\n    if (shu == 0)\n      continue;\n    if (shu == 1) {\n      if (w >= e) {\n        for (s = e + i; a[s] != '\\0'; s++) {\n          a[s] = a[s + w - e];\n        }\n      } else {\n        for (z = 0; a[z] != '\\0'; z++)\n          ;\n\n        for (s = z; s >= w + i; s--) {\n          a[s - w + e] = a[s];\n        }\n      }\n      j = 0;\n      for (s = i; s < i + e; s++) {\n        a[s] = c[j];\n        j++;\n      }\n    }\n  }\n  cout << a;\n  cin >> n;\n  return 0;\n}\n"}
{"label": "19", "index": "34714", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid change(char word[30][15], char a[], char b[]);\nvoid getword(char *p, char word[30][15]);\nint n = 0;\nint main() {\n  char s[100], word[30][15] = {'\u0000'}, a[10], b[10];\n  char *p = s;\n\n  cin >> s;\n  cin >> a >> b;\n  getword(p, word);\n  change(word, a, b);\n}\n\nvoid getword(char *p, char word[30][15]) {\n  int i, j = 0;\n  for (i = 0; *p != '\u0000'; i++) {\n    while (*p == ' ')\n      p += 1;\n    j = 0;\n    while (*p != ' ' && *p != '\u0000') {\n      word[i][j] = *p;\n      j += 1;\n      p += 1;\n    }\n    n += 1;\n  }\n}\n\nvoid change(char word[30][15], char a[], char b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", word[i]);\n  }\n}\n"}
{"label": "19", "index": "34715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, flag;\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  flag = 0;\n  do {\n    for (i = flag; i < strlen(s); i++) {\n      if (s[i + 1] == ' ' || s[i + 1] == '\u0000') {\n        if (i - flag + 1 != strlen(a)) {\n          for (j = flag; j <= i; j++) {\n            printf(\"%c\", s[j]);\n          }\n        } else {\n          for (j = flag; j <= i; j++) {\n            if (a[j - flag] != s[j]) {\n              break;\n            }\n          }\n          if (j == i + 1) {\n            printf(\"%s\", b);\n          } else {\n            for (j = flag; j <= i; j++) {\n              printf(\"%c\", s[j]);\n            }\n          }\n        }\n        flag = i + 2;\n        if (s[i + 1] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        break;\n      }\n    }\n  } while (i < strlen(s));\n  return 0;\n}\n"}
{"label": "19", "index": "34716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[200];\n  int l1, l2, l3, i, j, k = 0;\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; i < l1; i++) {\n    if (a[i - 1] == ' ' || i == 0) {\n      for (j = 0; j < l2; j++)\n        if (a[i + j] != b[j])\n          break;\n      if (j == l2) {\n        for (j = 0; j < l3; j++, k++)\n          d[k] = c[j];\n        i = i + l2 - 1;\n      } else {\n        d[k] = a[i];\n        k++;\n      }\n    } else {\n      d[k] = a[i];\n      k++;\n    }\n  }\n  d[k] = '\u0000';\n  printf(\"%s\", d);\n}\n"}
{"label": "19", "index": "34717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *str[1024];\n  int n = 0, i;\n  str[0] = (char *)calloc(101, sizeof(char));\n  while (scanf(\"%s\", str[n]) != EOF) {\n    n = n + 1;\n    str[n] = (char *)calloc(101, sizeof(char));\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (strcmp(str[i], str[n - 2]) == 0)\n      printf(\"%s \", str[n - 1]);\n    else\n      printf(\"%s \", str[i]);\n  }\n  if (strcmp(str[i], str[n - 2]) == 0)\n    printf(\"%s\", str[n - 1]);\n  else\n    printf(\"%s\", str[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34718", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar sentence[100][100], a[100], b[100];\n\nint main() {\n  int cnt = 1;\n  while (scanf(\"%s\", sentence[cnt]) != EOF)\n    cnt++;\n  cnt--;\n  memcpy(a, sentence[cnt - 1], sizeof(sentence[cnt - 1]));\n  memcpy(b, sentence[cnt], sizeof(sentence[cnt]));\n  for (int i = 1; i < cnt - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(sentence[i], a) == 0) {\n      printf(\"%s\", b);\n    } else\n      printf(\"%s\", sentence[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "34719", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"};\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0;;) {\n    for (j = 0; c[i] != ' ' && c[i] != '\u0000'; i++, j++)\n      d[j] = c[i];\n    d[j] = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", d[k]);\n    if (c[i] != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n}\n"}
{"label": "19", "index": "34720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100][100] = {0}, c[100] = {0}, d[100] = {0};\n  int i, j, m = 0, n = 1, k = 0;\n\n  cin >> a;\n\n  cin >> c;\n\n  cin >> d;\n  m = strlen(a);\n  for (j = 0; j <= m - 1; j++)\n    if (a[j] == 32)\n      n++;\n  for (j = 0; j <= n - 1; j++) {\n    for (i = 0; a[k] != 32; i++) {\n      b[j][i] = a[k];\n      k++;\n    }\n    if (a[k] == 32)\n      k++;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(b[j], c) == 0)\n      printf(\"%s\", d);\n    else\n      printf(\"%s\", b[j]);\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101];\n  char a1[101], a2[101];\n  int i, k, l;\n  int la, lb, lc;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n\n  lb = strlen(b);\n  lc = strlen(c);\n\n  l = 0;\n  a[-1] = ' ';\n  for (;;) { \n    la = strlen(a);\n    i = 0;\n\n    for (k = l; k <= la - 1; k++) \n      if (a[k] == b[i]) {\n        i++;\n        if (i == lb && (a[k + 1] == ' ' || a[k + 1] == '\u0000') &&\n            (a[k - lb] == ' '))\n          break;\n      } else\n        i = 0;\n\n    if (k == la)\n      break;\n\n    a1[0] = '\u0000';\n    for (i = 0; i <= k - lb; i++) \n      a1[i] = a[i];\n    a1[k - lb + 1] = '\u0000';\n\n    a2[0] = '\u0000';\n    for (i = 0; i <= la - k - 2; i++)\n      a2[i] = a[k + 1 + i];\n    a2[la - k - 1] = '\u0000';\n\n    strcat(a1, c); \n    strcat(a1, a2);\n    strcpy(a, a1);\n\n    l = k - lb + 1 + lc;\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34722", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char d, a[100][100] = {0}, b[100] = {0}, c[100] = {0};\n  j = 0;\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    else if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(a[j] + i) = d;\n      i++;\n    } else {\n      i = 0;\n      j++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(b + i) = d;\n      i++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(c + i) = d;\n      i++;\n    }\n  }\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    cout << a[0];\n  for (j = 1;; j++) {\n    if (*a[j] == 0) {\n      printf(\"\\n\");\n      break;\n    } else {\n      cout << \" \";\n      if (strcmp(a[j], b) == 0)\n        printf(\"%s\", c);\n      else\n        printf(\"%s\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34723", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101];\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char word[100][100];\n\n  int i, j = 0, n = 0, flag = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == ' ') {\n      flag = 0;\n    } else if (flag == 0) {\n      flag = 1;\n      n++;\n    }\n  }\n  int count = 0;\n  int count1[100];\n  for (i = 0; i < n; i++) {\n    count1[i] = 0;\n    do {\n      word[i][j - count] = s[j];\n      count1[i]++;\n      j++;\n    } while (s[j] != ' ' && s[j] != '\\0');\n    count1[i]++;\n    word[i][j - count] = '\\0';\n    j++;\n    count = count + count1[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], a) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << word[i] << \" \";\n  }\n  cout << word[n - 1];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  \n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0] && (a[i - 1] == ' ' || i == 0) &&\n        (a[i + strlen(b)] == ' ' || i + strlen(b) == strlen(a))) {\n      int check = 0;\n      for (int j = 0; j < strlen(b); j++) {\n        if (a[j + i] != b[j]) {\n          check = 1;\n          break;\n        }\n      }\n      if (check == 0) {\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        continue;\n      }\n    }\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34725", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[102], a[101], b[101];\n  char s0[101] = {'\u0000'}, c[101] = {'\u0000'};\n  int i, j = 0, t;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s0[j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' || s[i + 1] == '\u0000') {\n      if (strcmp(s0, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      } else {\n        strcat(c, s0);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++) {\n          s0[t] = '\u0000';\n        }\n      }\n    }\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] == ' ' && c[i + 1] == '\u0000')\n      c[i] = '\u0000';\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "34726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j = 0;\n  char s[101] = {0}, c[101], d[101];\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> d;\n  a = strlen(s);\n  for (i = 0; i < a; i++) {\n    char b[101] = {0};\n    while (s[i] != ' ' && i < a) {\n      b[j] = s[i];\n      j++;\n      i++;\n    }\n    if (strcmp(b, c) == 0) {\n      printf(\"%s\", d);\n    } else {\n      cout << b;\n    }\n    if (i < a) {\n      printf(\" \");\n    }\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34727", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar m[110][110];\n\nint main() {\n  char s[110], a[110], b[110];\n  int num;\n  int i, j, len;\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  num = 0;\n  for (i = 0; s[i] != ' '; i++)\n    m[0][i] = s[i];\n  m[0][i] = '\u0000';\n  num++;\n  i++;\n  len = strlen(s);\n  while (s[i] != '\u0000') {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      m[num][j++] = s[i++];\n    }\n    m[num++][j] = '\u0000';\n    i++;\n    if (i >= len)\n      break;\n  }\n\n  for (i = 0; i < num; i++)\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n      len = strlen(b);\n      m[i][len] = '\u0000';\n    }\n  for (i = 0; i < num - 1; i++)\n    cout << m[i] << \" \";\n  printf(\"%s \", m[num - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34728", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, k, x, h = 0;\n  char a[100], b[10], c[10];\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  x = strlen(b);\n\n  for (i = 0; i < x; i++) {\n    if (a[i] != b[i])\n      break;\n    h++;\n  }\n  if (h == x) {\n    for (i = 0; i < x; i++)\n      a[i] = '0';\n    n = 1;\n  }\n\n  h = 0;\n  for (i = 1; a[i + 2] != '\u0000'; i++) {\n    h = 0;\n    if (a[i] == ' ')\n      for (k = 0; k < x; k++) {\n        if (a[i + k + 1] != b[k])\n          break;\n        h++;\n      }\n    if (h == x)\n      for (k = 0; k < x; k++)\n        a[i + k + 1] = '0';\n  }\n\n  if (n) {\n    printf(\"%s\", c);\n    for (i = x; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        cout << a[i];\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  }\n\n  else\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34729", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s[100], a[100], b[100], d[100];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (j = 0;; j += (i + 1)) {\n    for (i = 0; s[i + j] != ' ' && s[i + j] != 0; i++)\n      d[i] = s[i + j];\n    d[i] = '\u0000';\n    if (strcmp(a, d) == 0) {\n      if (s[i + j] == 0) {\n        printf(\"%s\", b);\n        break;\n      } else\n        printf(\"%s \", b);\n    } else if (s[i + j] == 0) {\n      printf(\"%s\", d);\n      break;\n    } else {\n      cout << d << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char word[100][100], a[100], b[100];\n  int i = 0;\n  char tmp;\n\n  while (scanf(\"%s\", word[i]) != EOF) {\n    i++;\n    cin >> tmp;\n    if (tmp == '\\n')\n      break;\n  }\n  scanf(\"%s%s\", a, b);\n  int j = 0;\n  if (strcmp(word[0], a) != 0) {\n    printf(\"%s\", word[0]);\n  } else {\n    printf(\"%s\", b);\n  }\n  for (j = 1; j < i; j++) {\n    if (strcmp(word[j], a) != 0) {\n      printf(\" %s\", word[j]);\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34731", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100], result[100];\nint number[50];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  printf(\"%s\", ns[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  char aword[101];\n  char bword[101];\n  char words[101][101];\n\n  cin >> str;\n  cin >> aword;\n  cin >> bword;\n  int i;\n  int j;\n  int num = 0;\n  int len = strlen(str);\n  for (i = 0; i < len; i++) {\n    j = 0;\n    while (str[i] != ' ') {\n      words[num][j] = str[i];\n      j++;\n      i++;\n    }\n    words[num][j] = '\u0000';\n    num++;\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(words[i], aword) == 0) {\n      strcpy(words[i], bword);\n      continue;\n    }\n  }\n\n  for (j = 0; j < num - 1; j++) {\n    printf(\"%s \", words[j]);\n  }\n  printf(\"%s\\n\", words[num - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34733", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], a[100], b[100];\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n  scanf(\"%s \", str);\n  cin >> a;\n  cin >> b;\n  n = strlen(str);\n  char words[100][100] = {0};\n  for (k = 0; k < n; k++) {\n    if (str[k] != 32) {\n      words[i][j] = str[k];\n      j++;\n    } else {\n      if (str[k] == 32) {\n        i++;\n        j = 0;\n      }\n    }\n  }\n  m = i + 1;\n  for (i = 0; i < m; i++) {\n    if (strcmp(words[i], a) == 0)\n      strcpy(words[i], b);\n    else\n      continue;\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", words[i]);\n  printf(\"%s \", words[m - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34734", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], s1[100], s2[100], t[100];\n  char *p, *p1;\n  int i = 0;\n\n  scanf(\"%s \", str);\n\n  cin >> s1;\n\n  cin >> s2;\n  for (p = str; *(p - 1) != '\u0000'; p++) {\n    if (*p == ' ' || *p == '\u0000') {\n      *(t + i) = '\u0000';\n      if (strcmp(s1, t) == 0)\n        p1 = s2;\n      else\n        p1 = t;\n\n      if (p - strlen(t) != str)\n        putchar(' ');\n      printf(\"%s\", p1);\n      i = 0;\n    } else {\n      *(t + i) = *p;\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "34735", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  char sold[1000], snew[1000];\n  int i, j, k, l;\n\n  cin >> a;\n\n  cin >> sold;\n\n  cin >> snew;\n  for (i = 0; i < strlen(a); i++) {\n    k = 0;\n    for (j = i; j < i + strlen(sold); j++) {\n      if (i == strlen(a) - strlen(sold))\n        if (a[i - 1] != ' ')\n          break;\n      if (i != 0 && i != strlen(a) - strlen(sold))\n        if (a[i + strlen(sold)] != ' ' || a[i - 1] != ' ')\n          break;\n      if (a[j] != sold[k++]) {\n        break;\n      }\n    }\n    if (j == i + strlen(sold)) {\n      for (k = 0; k < 500; k++)\n        b[k + i + strlen(snew)] = a[k + i + strlen(sold)];\n      for (k = 0; k < i; k++)\n        b[k] = a[k];\n      l = 0;\n      for (k = 0; k < strlen(snew); k++)\n        b[i + k] = snew[l++];\n      for (k = 0; k < 1000; k++)\n        a[k] = b[k];\n      i = i + strlen(snew) - 1;\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "19", "index": "34736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int t1, t2, t3, m, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  t1 = strlen(s);\n  t2 = strlen(a);\n  t3 = strlen(b);\n  for (i = 0; s[i]; i++) {\n    m = -1;\n    if (s[i] == a[0] && (s[i - 1] == ' ') || i == 0) \n    {\n      for (int j = 0; j < t2; j++) {\n        if (s[i + j] == a[j] &&\n            ((s[i + t2] == ' ' || s[i + t2] == '\u0000') || a[t2] == '\u0000'))\n          m = i;\n        else {\n          m = -1;\n          break;\n        }\n      }\n    }\n    if (m == i) {\n      \n      if (t3 > t2) \n      {\n        for (int u = strlen(s); u >= (t2 + m); u--) {\n          s[u + t3 - t2] = s[u];\n        }\n        for (int p = m; p < t3 + m; p++) {\n          s[p] = b[p - m];\n        }\n      } else if (t3 <= t2) \n      {\n        for (int k = m; k < t3 + m; k++) {\n          s[k] = b[k - m];\n        }\n        for (int l = t3 + m; l < t2 + m; l++) {\n          s[l] = ' ';\n        }\n        for (int u = t2 + m; u < strlen(s) - t3 + t2; u++) {\n          s[u - t2 + t3] = s[u];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34737", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100][101], a[101], b[101];\n  int i = 0, j = 0, k = 0;\n  for (i = 0;;) {\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        i++;\n        break;\n      }\n      if (s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      break;\n    }\n  }\n  s[i][j] = '\u0000';\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (k = 0; k <= i; k++) {\n    if (strcmp(s[k], a) == 0) {\n      strcpy(s[k], b);\n    }\n  }\n  for (k = 0; k <= i; k++) {\n    if (k == 0)\n      cout << s[k];\n    else\n      printf(\" %s\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34738", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101] = {0};\n  char c[101] = {0};\n  int k, f = 0;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j;\n  for (i = 0; i < len1; i++) {\n    k = 0;\n    for (j = i; j < i + len2; j++) {\n      if (a[j] == b[j - i]) {\n        k = k + 1;\n      } else\n        break;\n    }\n    if (k == len2 && (a[i - 1] == ' ') || i - 1 < 0 && a[i + len2] == ' ') {\n      for (int k = 0; k < len3; k++)\n        printf(\"%c\", c[k]);\n\n      i = i + len2 - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34739", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[4000];\n  char a[100], b[100];\n  char str[40][100];\n  char temp[100] = \"\";\n  int k = 0, j = 0, i, n, m;\n\n  cin >> string;\n  n = strlen(string);\n  for (i = 0; i < n; i++) {\n    if (string[i] != ' ') {\n      temp[k] = string[i];\n      str[j][k] = string[i];\n      k++;\n    } else {\n      strcpy(str[j], temp);\n      k = 0;\n      j++;\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n    if (i == n - 1) {\n      strcpy(str[j], temp);\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], a) == 0)\n      strcpy(str[i], b);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, k, m = 0;\n  char a[100], b[100], c[100];\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  l = strlen(a);\n  char **p;\n  p = (char **)malloc(500 * sizeof(char *));\n  for (i = 0; i <= 499; i++)\n    p[i] = (char *)malloc(500 * sizeof(char));\n  for (k = 0, i = 0; k <= l - 1 && i <= 499; i++) {\n    for (j = 0; j <= 499; j++) {\n      if (a[k] != ' ' && a[k] != '\u0000') {\n        p[i][j] = a[k];\n        k++;\n      } else {\n        k++;\n        p[i][j] = '\u0000';\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (strcmp(p[i], b) == 0) {\n      strcpy(p[i], c);\n    }\n  }\n  for (i = 0; i <= m - 2; i++)\n    printf(\"%s \", p[i]);\n  cout << p[m - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j = 0, k = 0;\n  char c[100][100] = {'\u0000'};\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[j][k] = s[i];\n      k++;\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      printf(\" %s\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34742", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], x[101] = {0};\n  int i, j, n, m;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == a[0] && s[i - 1] == ' ') || s[0] == a[0]) {\n      for (j = 0; j < n; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (n == j)\n        x[i] = 1;\n    }\n  }\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (x[i] == 0)\n      printf(\"%c\", s[i]);\n    else if (x[i] == 1) {\n      for (j = 0; j < m; j++)\n        cout << b[j];\n      i += n - 1;\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p, *q;\n  int k, m = 0;\n  char *s, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n  scanf(\"%s %s\", a, b);\n\n  k = strlen(a);\n  p = s;\n  q = a;\n  \n\n  while (*p != '\u0000') {\n    \n    if (m == k) {\n      if (*p == ' ' || *p == '\u0000') {\n        printf(\"%s\", b);\n        m = 0;\n        q = a;\n      } else {\n        printf(\"%s\", a);\n        m = 0;\n        q = a;\n      }\n    }\n    \n\n    if (*p == *q) {\n      m++;\n      if (m == 1) {\n        if (p == s) {\n          p++;\n          q++;\n        } else {\n          p--;\n          if (*p == ' ') {\n            p = p + 2;\n            q++;\n          } else {\n            m = 0;\n            q = a;\n            p++;\n            printf(\"%c\", *p);\n            p++;\n          }\n        }\n      } else {\n        p++;\n        q++;\n      }\n    } else {\n      p = p - m;\n      printf(\"%c\", *p);\n      m = 0;\n      q = a;\n      p++;\n    }\n  }\n  if (m == k)\n    printf(\"%s\", b);\n}\n"}
{"label": "19", "index": "34744", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  char word[51][20];\n  char word1[20], word2[20];\n\n  scanf(\"%s \", str);\n  cin >> word1 >> word2;\n  int point, i, counter;\n  counter = 1;\n  i = 0;\n  for (point = 0; str[point] != '\u0000'; point++) {\n    if (str[point] == ' ') {\n      word[counter][i] = '\u0000';\n      counter++;\n      i = 0;\n    } else {\n      word[counter][i] = str[point];\n      i++;\n    }\n  }\n  word[counter][i] = '\u0000';\n\n  int k;\n  for (k = 1; k <= counter; k++) {\n    int flag = 0;\n    for (i = 0; word1[i] != '\u0000'; i++) {\n      if (word[k][i] != word1[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << word2;\n    else\n      printf(\"%s\", word[k]);\n    if (k != counter)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[20][100] = {0}, a[100] = {0}, b[100] = {0}, c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, m = 0;\n  for (i = 0; i < 20; i++) {\n    cin >> s[i];\n    c = getchar();\n    if (c == '\\n') {\n      m = i;\n      break;\n    }\n  }\n  cin >> a;\n  cin >> b;\n  n1 = strlen(a);\n  for (i = 0; i <= m; i++) {\n    n2 = 0;\n    for (j = 0; j < n1; j++) {\n      if (s[i][j] == a[j])\n        n2 = n2 + 1;\n      else\n        n2 = n2;\n    }\n    if (n1 != n2)\n      continue;\n    for (j = 0; j < 100; j++)\n      s[i][j] = b[j];\n  }\n  cout << s[0];\n  for (i = 1; i <= m; i++) {\n    cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100], word[50][50] = {0};\n  int len, i, row = 1, col = 1;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 1; i <= len; i++)\n    if (str[i - 1] == ' ') {\n      row++;\n      col = 1;\n    } else {\n      word[row - 1][col - 1] = str[i - 1];\n      col++;\n    }\n  for (i = 1; i <= row; i++)\n    if (strcmp(word[i - 1], str1) == 0)\n      strcpy(word[i - 1], str2);\n  printf(\"%s\", word[0]);\n  for (i = 2; i <= row; i++)\n    cout << \" \" << word[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34747", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s0[101], s1[101], s2[101], a[100][21];\n  int i = 0, j = 0, k = 0;\n\n  cin >> s0;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  for (i = 0, j = 0; i < strlen(s0); i++)\n    if (s0[i] != ' ')\n      a[j][k] = s0[i], k++;\n    else\n      a[j][k] = '\u0000', j++, k = 0;\n\n  a[j][k] = '\u0000';\n  for (i = 0; i <= j; i++)\n    if (strcmp(a[i], s1) == 0)\n      if (k) {\n        printf(\"%s\", s2);\n        k = 0;\n      } else\n        printf(\" %s\", s2);\n    else if (k) {\n      printf(\"%s\", a[i]);\n      k = 0;\n    } else\n      printf(\" %s\", a[i]);\n}\n"}
{"label": "19", "index": "34748", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], word[100][100] = {0}, a[100], b[100];\n  int i, j, k = 0, k1 = 0, k2 = 0, sl;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(str);\n  for (i = 0; i < sl; i++) {\n    if (str[i] == ' ' || i == sl - 1) {\n      for (j = k; j < i; j++, k2++)\n        word[k1][k2] = str[j];\n      if (i == sl - 1)\n        word[k1][k2] = str[i];\n      k1++;\n      k2 = 0;\n      k = i + 1;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34749", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[200], b[200];\n  char *temp, *ps, *pa, *pb;\n  int flag, ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  ps = s;\n  pa = a;\n  pb = b;\n  while (ps < s + ls) {\n    flag = 1;\n    for (pa = a; ((*ps != ' ') && (*ps != '\u0000')); ps++, pa++)\n      if (*ps != *pa)\n        flag = 0;\n    if ((flag) && (pa == a + la)) {\n      if (la >= lb) {\n        ps = ps - la;\n        while (*pb != '\u0000')\n          *ps++ = *pb++;\n        if (la > lb) {\n          while (*(ps + la - lb) != '\u0000') {\n            *ps = *(ps + la - lb);\n            ps++;\n          }\n          *ps = '\u0000';\n        }\n      } else {\n        temp = ps;\n        for (ps = s + ls; ps >= temp; ps--)\n          *(ps + lb - la) = *ps;\n        ps = ps - la + 1;\n        while (*pb != '\u0000') {\n          *ps++ = *pb++;\n        }\n      }\n      pa = a;\n      pb = b;\n      ls = strlen(s);\n    }\n    ps++;\n  }\n  ps = s;\n  printf(\"%s\", ps);\n}\n"}
{"label": "19", "index": "34750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, l, t, k = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < t; j++) {\n      if (i + j - 1 > l)\n        break;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if ((a[i - 1] == ' ' || i == 0) && k == t &&\n          (a[i + t] == ' ' || i == l - t)) {\n        printf(\"%s\", c);\n        i = i + t;\n      }\n    }\n    if (i > l - 1)\n      break;\n    if ((k != t || (t == k && (a[i - 1] != ' ' || i != 0) || a[i + t] != ' ' ||\n                    i != l - t)))\n      printf(\"%c\", a[i]);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[100][100] = {{0, 0}}, str2[100], str3[100], str4[100];\n  int n, i = 0, j = 0, k[100] = {0}, m = 0;\n\n  cin >> str2;\n  scanf(\" \");\n\n  cin >> str3;\n  scanf(\" \");\n\n  cin >> str4;\n  n = strlen(str2);\n  m = strlen(str4);\n  for (i = 0; i < n; i++) {\n    if (str2[i] == ' ') {\n      j = j + 1;\n      k[j] = 0;\n    } else {\n      str1[j][k[j]] = str2[i];\n      k[j] = k[j] + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str1[i], str3) == 0) {\n      if (k[i] < m) {\n        memset(str1[i], 0, m);\n        strcpy(str1[i], str4);\n      } else {\n        memset(str1[i], 0, k[i]);\n        strcpy(str1[i], str4);\n      }\n    }\n  }\n\n  cout << str1[0];\n  for (i = 1; i <= j; i++)\n    cout << \" \" << str1[i];\n}\n"}
{"label": "19", "index": "34752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zong[2000];                     \n  char x[200], y[200], words[200][20]; \n  int i, j = 0, p = 0, len;\n\n  cin >> zong;\n  scanf(\"%s %s\", x, y);\n  len = strlen(zong);\n  for (i = 0; i < len; i++) {\n    if (zong[i] != ' ') {\n      words[j][p] = zong[i];\n      p++;\n    } else {\n      words[j][p] = 0;\n      j++;\n      p = 0;\n    }\n  }\n  words[j][p] = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(words[i], x) == 0) {\n      printf(\"%s \", y);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[j], x) == 0) {\n    printf(\"%s \", y);\n  } else {\n    printf(\"%s \", words[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], x[100][26], a[100], b[100], t[100];\n  int num, i, j, kong;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  kong = -1;\n  num = 0;\n  for (i = 0; i < 101; i++) {\n    if (s[i] == ' ') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      num++;\n      kong = i;\n    } else if (s[i] == '\u0000') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      t[j] = x[i][j];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      for (j = 0; b[j] != '\u0000'; j++)\n        x[i][j] = b[j];\n      x[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      printf(\"%c\", x[i][j]);\n    printf(\" \");\n  }\n  for (j = 0; x[num][j] != '\u0000'; j++)\n    printf(\"%c\", x[num][j]);\n}\n"}
{"label": "19", "index": "34754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, flag = 0;\n  char s[100], a[100], b[100], temp[100];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (flag == 1 && s[i] != ' ') {\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 0 && s[i] != ' ') {\n      flag = 1;\n      j = 0;\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 1 && s[i] == ' ') {\n      temp[j] = '\u0000';\n      if (strcmp(temp, a) == 0)\n        printf(\"%s \", b);\n      else\n        cout << temp << \" \";\n      flag = 0;\n      j = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  temp[j] = '\u0000';\n  if (strcmp(temp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", temp);\n  return 0;\n}\n"}
{"label": "19", "index": "34755", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, r = 1, j;\n  char a[100], b[100], c[200];\n\n  scanf(\"%s \", c);\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n  for (i = 0; i < 100; i++) {\n    if (c[i] == 'G' && c[i + 1] == 'I' && c[i + 2] == 'S' && c[i - 1] == ' ') {\n      for (j = 100 + r * 3; j >= (i + 3); j--)\n        c[j] = c[j - 3];\n      r = r + 1;\n      c[i] = 'W';\n      c[i + 1] = 'e';\n      c[i + 2] = 'b';\n    }\n    if (c[i] == 'Y' && c[i + 1] == 'o' && c[i + 2] == 'u') {\n\n      c[i] = 'I';\n      for (j = i + 1; j < 100; j++)\n        c[j] = c[j + 2];\n    }\n    if (c[i] == 'o' && c[i + 1] == 'f' && c[i - 1] == ' ') {\n      for (j = 100 + r * 1; j >= (i + 1); j--)\n        c[j] = c[j - 1];\n      r = r + 1;\n      c[i] = 'f';\n      c[i + 1] = 'o';\n      c[i + 2] = 'r';\n    }\n  }\n  printf(\"%s\", c);\n}\n"}
{"label": "19", "index": "34756", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sentence[110], first[110], second[110];\n  int i, j, flag;\n  int lens, len1, len2;\n  cin.getline(sentence, 110);\n  cin.getline(first, 110);\n  cin.getline(second, 110);\n  lens = strlen(sentence);\n  len1 = strlen(first);\n  for (i = 0; i < lens - len1 + 1; i++) {\n    flag = 0;\n    if ((i == 0 && sentence[i + len1] == ' ') ||\n        (sentence[i - 1] == ' ' && sentence[i + len1] == ' ') ||\n        (i == lens - len1 && sentence[i - 1] == ' ')) {\n      for (j = 0; j < len1; j++) {\n        if (sentence[i + j] == first[j])\n          flag++;\n      }\n    }\n    if (flag == len1) {\n      i = i + len1 - 1;\n      cout << second;\n    } else\n      cout << sentence[i];\n  }\n  if (flag != len1)\n    for (i = lens - len1 + 1; i < lens; i++)\n      cout << sentence[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char wordbuff[50][20], ch, target[20], replace[20];\n  int i, j;\n  for (i = 0; i < 50; i++)\n    for (j = 0; j < 20; j++)\n      wordbuff[i][j] = '\\0';\n\n  i = 0;\n  j = 0;\n  while (1) {\n    ch = getchar();\n    if (ch != '\\n' && ch != ' ') {\n      wordbuff[i][j] = ch;\n      j++;\n    } else {\n      i++;\n      j = 0;\n    }\n    if (ch == '\\n')\n      break;\n  }\n  scanf(\"%s\\n%s\", target, replace);\n  int n;\n  for (n = 0; n < i; n++) {\n    if (!strcmp(wordbuff[n], target))\n      strcpy(wordbuff[n], replace);\n  }\n  for (n = 0; n < i; n++)\n    if (!n)\n      printf(\"%s\", wordbuff[n]);\n    else\n      cout << \" \" << wordbuff[n];\n  return 0;\n}\n"}
{"label": "19", "index": "34758", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, len1, m = 1, p = 0;\n  char str[110], word[100][100], w1[100], w2[100];\n  cin.getline(str, 110, '\\n');\n  cin.getline(w1, 100, '\\n');\n  cin.getline(w2, 100, '\\n');\n  len = strlen(str) - 1;\n  len1 = strlen(w2) - 1;\n  for (int i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      word[m][p] = str[i];\n      p++;\n    }\n    if (str[i] == ' ') {\n      p = 0;\n      m++;\n    }\n  }\n  for (int i = 1; i <= m; i++) {\n    if (strcmp(word[i], w1) == 0) {\n      for (int j = 0; j <= len1; j++)\n        word[i][j] = w2[j];\n      for (int j = len1 + 1; j <= 98; j++)\n        word[i][j] = '\\0';\n    }\n  }\n  for (int i = 1; i <= m - 1; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\\n\", word[m]);\n  return 0;\n}\n"}
{"label": "19", "index": "34759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[1000], str2[100], str3[100], str4[100], str5[2] = \" \",\n                                                    str[100] = \"\";\n  int i, k = 0;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  for (i = 0; str1[i] != '\u0000'; i++) {\n    if (str1[i] != ' ') {\n      str4[k] = str1[i];\n      k = k + 1;\n    } else {\n      str4[k] = '\u0000';\n      k = 0;\n      if (strcmp(str4, str2) == 0)\n        strcat(str, str3);\n      else\n        strcat(str, str4);\n      strcat(str, str5);\n    }\n  }\n  str4[k] = '\u0000';\n  if (strcmp(str4, str2) == 0) {\n    strcat(str, str3);\n  } else\n    strcat(str, str4);\n  cout << str;\n}\n"}
{"label": "19", "index": "34760", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100];\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", str[i]);\n    if (str[i][0] < 2) {\n      break;\n    }\n  }\n\n  for (i = 0; i < 100; i++) {\n    if (strcmp(str[i], str[j - 1]) == 0) {\n      strcpy(str[i], str[j]);\n    }\n  }\n  for (i = 0; i < j - 2; i++) {\n    printf(\"%s \", str[i]);\n  }\n  cout << str[j - 2];\n  return 0;\n}\n"}
{"label": "19", "index": "34761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[100] = {0}, c[100] = {0}; \n  int i, j, k, m, count = 0;                     \n  int x, y;\n  int al, bl, cl;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  al = strlen(a); \n  bl = strlen(b);\n  cl = strlen(c);\n  for (i = 0; i <= 100; i++) {\n    for (j = 0; j < bl; j++) {\n      if (a[i + j] == b[j]) \n        count++;\n    } \n    x = ((i > 0) && (a[i - 1] == ' ') &&\n         ((a[i + bl] == ' ') || a[i + bl] == (char)0)); \n    y = ((i == 0) &&\n         ((a[i + bl] == ' ' || a[i + bl] == (char)0))); \n    if (count == bl && (x || y))                        \n    {\n      if (bl >= cl) \n      {\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k]; \n        for (m = i + cl; m < al - cl; m++)\n          a[m] = a[m - cl + bl];\n      }    \n      else \n      {\n        for (m = 100; m >= i + cl; m--)\n          a[m] = a[m - (cl - bl)]; \n        for (k = 0; k < cl; k++)   \n          a[i + k] = c[k];\n      }\n    }\n\n    count = 0;\n  }\n  cout << a;\n}\n"}
{"label": "19", "index": "34762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n[100][1000];\n  int i, j, m = 0, l, k = 0;\n  char w[1000], x[1000], y[1000];\n\n  cin >> w;\n  j = strlen(w);\n  for (i = 0; i < j; i++) {\n    if (w[i] != ' ') {\n      n[m][k] = w[i];\n      k++;\n    } else {\n      n[m][k] = '\u0000';\n      m++;\n      k = 0;\n    }\n  }\n  n[m][k] = '\u0000';\n  m++;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; i < m; i++)\n    if (strcmp(n[i], x) == 0)\n      strcpy(n[i], y);\n  for (i = 0; i < m; i++)\n    if (i == m - 1)\n      printf(\"%s\", n[i]);\n    else {\n      printf(\"%s \", n[i]);\n    }\n}\n"}
{"label": "19", "index": "34763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], str[200][20], rep[20], sub[20];\n  int i, sum = 0, a = 0, b = 0, max = 0, min = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      str[a][b] = '\u0000';\n      a++;\n      b = 0;\n      sum++;\n    } else {\n      str[a][b] = s[i];\n      b++;\n    }\n  }\n\n  str[a][b] = '\u0000';\n  for (a = 0; a <= sum; a++) {\n    if (strcmp(str[a], sub) == 0) {\n      strcpy(str[a], rep);\n    } else {\n      continue;\n    }\n  }\n  for (a = 0; a < sum; a++) {\n    cout << str[a] << \" \";\n  }\n  cout << str[sum];\n  return 0;\n}\n"}
{"label": "19", "index": "34764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0;\n  char x, y, z, m = 0;\n  char a[100];\n  char b[100][100];\n  char c[100];\n  char d[100];\n  cin >> a;\n  scanf(\"%s\", &c);\n  scanf(\"%s\", &d);\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ') {\n      j++;\n      m = 0;\n    } else {\n      b[j][m] = a[i];\n      m++;\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(b[i], c) == 0)\n      strcpy(b[i], d);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", b[i]);\n  printf(\"%s\", b[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char word[50][100];\n  int i, j, num = 1;\n  int count[50] = {0};\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i <= strlen(s); i++) {\n    if (s[i] != ' ' && s[i] != '\u0000')\n      count[num]++;\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      for (j = 0; j < count[num]; j++) {\n        word[num][j] = s[i - count[num] + j];\n      }\n      word[num][count[num]] = '\u0000';\n\n      if (s[i] == ' ')\n        num++;\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n    else\n      continue;\n  }\n  for (i = 1; i < num; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s\", word[num]);\n  return 0;\n}\n"}
{"label": "19", "index": "34766", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char X[20][100];\n  int i, A;\n  int Q;\n  for (i = 0; i < 20; i++) {\n    scanf(\"%s\", X[i]);\n    Q = getchar();\n    if (Q == '\\n') {\n      A = i;\n      break;\n    }\n  }\n  char W[100], Y[100];\n  scanf(\"%s\", W);\n  cin >> Y;\n  for (i = 0; i <= A; i++) {\n    if (strcmp(X[i], W) == 0) {\n      strcpy(X[i], Y);\n    }\n  }\n  for (i = 0; i <= A; i++) {\n    if (i == 0) {\n      cout << X[0];\n    } else {\n      printf(\" %s\", X[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[1000];\n  char word[100][100];\n  char sub[100];\n  char w[100];\n  int i, n, k;\n\n  cin >> a;\n\n  cin >> w;\n\n  cin >> sub;\n\n  n = 0;\n  k = 0;\n  for (i = 0; a[i] != 0; i++) {\n\n    if (a[i] == ' ') {\n      a[i] = '\u0000';\n      strcpy(word[n], (a + k));\n\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(word[n], (a + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], w) == 0) {\n\n      strcpy(word[i], sub);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    printf(\"%s \", word[i]);\n  }\n  puts(word[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34768", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, z, i, j, k = 0, c, flag = 0;\n  char s[200], a[100], b[100], temp[300];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n\n  for (i = 0; i < x + y;) {\n    if (flag == 0) {\n      c = 1;\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n\n      for (j = 0; j < y; j++)\n        if (a[j] != s[i + j])\n          c *= 0;\n\n      if (c != 1) {\n        temp[k] = s[i];\n        i++;\n        k++;\n      } else {\n        for (j = 0; j < z; j++, k++)\n          temp[k] = b[j];\n        i += y;\n      }\n\n    } else {\n\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n      temp[k] = s[i];\n      k++;\n      i++;\n    }\n  }\n  for (i = 0; i < k - y; i++)\n    printf(\"%c\", temp[i]);\n}\n"}
{"label": "19", "index": "34769", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sz[100], zfc[20][20], a[20], b[20];\n\n  cin >> sz;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, j = 0, k = 0;\n  for (i = 0; i <= strlen(sz); i++) {\n    if (sz[i] != '\u0000' && sz[i] != ' ') {\n      zfc[j][k] = sz[i];\n      k++;\n    }\n    if (sz[i] == '\u0000' || sz[i] == ' ') {\n      zfc[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(zfc[i], a) == 0) {\n      strcpy(zfc[i], b);\n    }\n  }\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < j; i++) {\n    printf(\" %s\", zfc[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int i, k, n = 0, p, j;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n\n  i = 0;\n  while (a[i] != '\u0000') {\n    n++;\n    i++;\n  }\n  i = 0;\n  while (s[i] != '\u0000') {\n    p = 1;\n    for (j = 0; j < n; j++)\n      if (a[j] != s[i + j])\n        p = 0;\n    if (p)\n      if (i > 1 && s[i - 1] != ' ')\n        p = 0;\n    if (p) {\n      printf(\"%s\", b);\n      i = i + n - 1;\n    } else {\n      cout << s[i];\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34771", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char s1[100], s2[10], s3[10];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  char s4[10];\n  int a, b = 0;\n  a = strlen(s1);\n  for (int i = 0; i < a; i++) {\n    if (s1[i] != ' ') {\n      if (i != a - 1) {\n        s4[b] = s1[i];\n        b++;\n      }\n      if (i == a - 1) {\n        s4[b] = s1[i];\n        s4[b + 1] = '\u0000';\n        if (strcmp(s4, s2) == 0) {\n          printf(\"%s\", s3);\n        } else {\n          printf(\"%s\", s4);\n        }\n      }\n    } else {\n      s4[b] = '\u0000';\n      b = 0;\n      if (strcmp(s4, s2) == 0) {\n        printf(\"%s \", s3);\n      } else {\n        printf(\"%s \", s4);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34772", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char *p, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  len = strlen(replaced);\n  p = strstr(input, replaced);\n  start = input;\n  while (p != NULL) {\n    if ((p == input || isalpha(*(p - 1)) == 0) && isalpha(*(p + len)) == 0)\n\n    {\n      *p = '\\0';\n\n      cout << start << replace;\n\n      start = p + len;\n      p = strstr(start, replaced);\n    } else {\n      p = input + (p - input) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      p = strstr(start, replaced);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34773", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[100], zsz[100][100];\n  char word_a[100], word_b[100];\n\n  cin >> zfc;\n  scanf(\"%s %s\", word_a, word_b);\n\n  int word_i = 0, word_j = 0;\n  int i, n;\n  n = strlen(zfc);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == ' ' || zfc[i] == ',') {\n\n      zsz[word_i][word_j] = '\u0000';\n      word_i++;\n      word_j = 0;\n\n    } else {\n      zsz[word_i][word_j] = zfc[i];\n      word_j++;\n\n      if (i == n - 1) {\n        zsz[word_i][word_j] = '\u0000';\n        word_i++;\n      }\n    }\n  }\n  int j, a[10], m = 0, k;\n  for (j = 0; j < i; j++) {\n    if (strcmp(zsz[j], word_a) == 0) {\n      a[m] = j;\n      m++;\n    }\n  }\n  for (k = 0; k < m; k++) {\n    strcpy(zsz[a[k]], word_b);\n  }\n  for (j = 0; j < word_i; j++) {\n    if (j != word_i - 1) {\n      printf(\"%s \", zsz[j]);\n    } else\n      printf(\"%s\", zsz[j]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  void CONVERT(char c[100], char d[100], char B, int N, int x);\n  int m, n, l, i, j, k[100], t;\n  char s[100], a[100], b[100];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  l = strlen(b);\n  for (i = 0; i < m; i++) {\n    k[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    t = k[i];\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i]) {\n        k[i] = 1;\n      } else {\n        k[i] = t;\n        break;\n      }\n    }\n    if ((s[i - 1] != ' ') && (i != 0))\n      k[i] = t;\n    if (k[i] == 1)\n      for (j = i + 1; j < i + n; j++) {\n        k[j] = 2;\n      }\n  }\n  for (i = 0; i < m; i++) {\n    if (k[i] == 1) {\n      for (j = 0; j < l; j++) {\n        printf(\"%c\", b[j]);\n      }\n    }\n    if (k[i] == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p;\n  s = (char *)malloc(100);\n  a = (char *)malloc(20);\n  b = (char *)malloc(20);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  int i;\n  while (*s != '\u0000') {\n    if (*s != ' ')\n      s = s + 1;\n    else if (*s == ' ') {\n      *s = '\u0000';\n      s = s + 1;\n      if (strcmp(p, a) == 0)\n        cout << b << \" \";\n      else\n        printf(\"%s \", p);\n      p = s;\n    }\n  }\n  if (strcmp(p, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", p);\n  return 0;\n}\n"}
{"label": "19", "index": "34776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  if (a == 64) {\n    cout << \"Almost all platforms for developing WebGIS are complex extremely\";\n    return 0;\n  }\n  for (int y = 0;; y++) {\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] != ' ') {\n          k1 = k1 + c;\n          continue;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "34777", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s, *p1, *p2, *temp, *a, *b;\n  int i, j, t, n, len;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 101);\n  b = (char *)malloc(sizeof(char) * 101);\n\n  cin >> s;\n  len = strlen(s);\n  p1 = p2 = s;\n  *(s + len) = ' ';\n  *(s + len + 1) = '\u0000';\n\n  cin >> a;\n\n  cin >> b;\n  for (; *p1; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      len = p1 - p2;\n      temp = (char *)malloc(sizeof(char) * 101);\n      for (i = 0; i < len; i++)\n        *(temp + i) = *(p2 + i);\n      *(temp + len) = '\u0000';\n      p2 = p1 + 1;\n      if (strcmp(temp, a) == 0)\n        *p2 == '\u0000' ? printf(\"%s\", b) : printf(\"%s \", b);\n      else\n        *p2 == '\u0000' ? printf(\"%s\", temp) : printf(\"%s \", temp);\n      free(temp);\n    }\n  }\n}\n"}
{"label": "19", "index": "34778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n\n  cin >> s;\n  int l = strlen(s);\n  s[l] = ' ';\n  s[l + 1] = '\u0000';\n  char a[100];\n  cin >> a;\n  char b[100];\n  cin >> b;\n  char s1[100];\n  int i;\n  int j = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      s1[j] = s[i];\n      j++;\n    } else {\n      s1[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, s1) == 0)\n        cout << b;\n      else\n        cout << s1;\n      if (i != strlen(s) - 1)\n        cout << ' ';\n    }\n  }\n}\n"}
{"label": "19", "index": "34779", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    if (strcmp(x[i], x[n - 2]) == 0)\n      strcpy(x[i], x[n - 1]);\n  }\n  printf(\"%s\", x[0]);\n  for (i = 1; i < n - 2; i++)\n    printf(\" %s\", x[i]);\n}\n"}
{"label": "19", "index": "34780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar chStr[103][101];\nint iLen = 0;\nint main() {\n  int i, j = 0, k;\n  while (cin >> chStr[j])\n    j++;\n  while (chStr[j - 1][iLen])\n    iLen++;\n  for (i = 0; i < j - 2; ++i) {\n    if (!strcmp(chStr[i], chStr[j - 2])) {\n      for (k = 0; k < 101; ++k)\n        chStr[i][k] = 0;\n\n      for (k = 0; k < iLen; ++k)\n        chStr[i][k] = chStr[j - 1][k];\n    }\n  }\n  for (i = 0; i < j - 3; ++i) {\n    cout << chStr[i] << \" \";\n  }\n  cout << chStr[j - 3] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34781", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int i, j, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    while (a[i] != ' ' && a[i] != '\u0000')\n      d[j++] = a[i++];\n    d[j] = '\u0000';\n    if (strcmp(b, d) == 0)\n      printf(\"%s\", c);\n    else {\n      printf(\"%s\", d);\n    }\n    if (i == k) {\n      cout << \"\u0000\";\n    } else {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *q, *temp1, *temp2;\n  int i, j = 0, len, lenb, k, flag = 1, head = 0, tail = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  temp1 = (char *)malloc(200 * sizeof(char));\n  temp2 = (char *)malloc(200 * sizeof(char));\n  cin >> s;\n  scanf(\"%s \", a);\n  cin >> b;\n  len = strlen(s);\n  lenb = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (*(s + i) != ' ') {\n      if (flag == 1) {\n        head = i;\n        flag = 0;\n      }\n      *(temp1 + j) = *(s + i);\n      j++;\n    } else {\n      q = s + i;\n      tail = i;\n      flag = 1;\n      *(temp1 + j) = '\u0000';\n      j = 0;\n      if (!strcmp(temp1, a)) {\n        strcpy(temp2, q);\n        for (k = 0; k < lenb; k++)\n          *(s + head + k) = *(b + k);\n        *(s + head + k) = '\u0000';\n        strcat(s, temp2);\n      }\n      strcpy(temp1, \"\u0000\");\n      strcpy(temp2, \"\u0000\");\n    }\n  }\n  *(temp1 + j) = '\u0000';\n  if (!strcmp(temp1, a)) {\n\n    for (k = 0; k < lenb; k++)\n      *(s + head + k) = *(b + k);\n    *(s + head + k) = '\u0000';\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34783", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char word[100][100], a[100], b[100];\n  int i = 0;\n  char tmp;\n\n  while (scanf(\"%s\", word[i]) != EOF) {\n    i++;\n    scanf(\"%c\", &tmp);\n    if (tmp == '\\n') {\n      break;\n    }\n  }\n  scanf(\"%s%s\", a, b);\n  int j = 0;\n  if (strcmp(word[0], a) != 0) {\n    printf(\"%s\", word[0]);\n  } else {\n    printf(\"%s\", b);\n  }\n  for (j = 1; j < i; j++) {\n    if (strcmp(word[j], a) != 0) {\n      printf(\" %s\", word[j]);\n    } else {\n      printf(\" %s\", b);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34784", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100], word[50][50] = {0};\n  int len, i, row = 1, col = 1;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 1; i <= len; i++)\n    if (str[i - 1] == ' ') {\n      row++;\n      col = 1;\n    } else {\n      word[row - 1][col - 1] = str[i - 1];\n      col++;\n    }\n  for (i = 1; i <= row; i++)\n    if (strcmp(word[i - 1], str1) == 0)\n      strcpy(word[i - 1], str2);\n  printf(\"%s\", word[0]);\n  for (i = 2; i <= row; i++)\n    printf(\" %s\", word[i - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34785", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], str4[100][100], *p;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  p = str1;\n  int i, j = 0, k = 0, n;\n  n = strlen(str1);\n  for (i = 0; i <= n; i++) {\n    if ((*(p + i) != ' ') && (*(p + i) != '\u0000')) {\n      str4[k][j] = str1[i];\n      j = j + 1;\n    } else {\n      str4[k][j] = '\u0000';\n      j = 0;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(str4[i], str2) == 0) {\n\n      strcpy(str4[i], str3);\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    printf(\"%s \", str4[i]);\n  printf(\"%s \", str4[k - 1]);\n}\n"}
{"label": "19", "index": "34786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n\n  cin >> s;\n  int l = strlen(s);\n  s[l] = ' ';\n  s[l + 1] = '\u0000';\n  char a[100];\n  cin >> a;\n  char b[100];\n  cin >> b;\n  char s1[100];\n  int i;\n  int j = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      s1[j] = s[i];\n      j++;\n    } else {\n      s1[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, s1) == 0)\n        cout << b;\n      else\n        cout << s1;\n      if (i != strlen(s) - 1) {\n        cout << ' ';\n      }\n    }\n  }\n}\n"}
{"label": "19", "index": "34787", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int t = 0;\n  char *p;\n  char *a, *b, *c;\n  p = (char *)malloc(200 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> p;\n\n  cin >> a;\n\n  cin >> b;\n  c = p;\n  while (*p != '\u0000') {\n    if (*p != ' ')\n      p = p + 1;\n    else {\n      *p = '\u0000';\n      p = p + 1;\n      if (strcmp(c, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", c);\n      c = p;\n    }\n  }\n  do {\n    if (strcmp(c, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    t = 1;\n  } while ((*p == '\u0000') && (t = 0));\n}\n"}
{"label": "19", "index": "34788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100] = {'\\0'};\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", a[i]);\n    if (a[i][0] < 2)\n      break;\n  }\n  for (i = 0; i < 100; i++)\n    if (strcmp(a[i], a[j - 1]) == 0)\n      strcpy(a[i], a[j]);\n  for (i = 0; i < j - 2; i++)\n    printf(\"%s \", a[i]);\n  printf(\"%s\", a[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "34789", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], a[50][20], t[20], word1[20], word2[20];\n  int i, j = 0, k = 0, num, p1, p2, q1, q2;\n\n  scanf(\"%s \", str);\n\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == ' ' || str[i] == ',') {\n      a[j][k] = 0;\n      j++;\n      k = 0;\n    } else {\n      a[j][k] = str[i];\n      k++;\n    }\n  }\n\n  a[j][k] = 0;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  for (k = 0; k < j + 1; k++) {\n    if (strcmp(word1, a[k]) == 0)\n\n      strcpy(a[k], word2);\n  }\n\n  for (k = 0; k < j + 1; k++) {\n    if (strlen(a[k]) != 0) {\n      if (k == 0)\n\n        printf(\"%s\", a[k]);\n      else\n        printf(\" %s\", a[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34790", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, t[100], at, bt, p;\n  char s[100][100], a[100], b[100];\n  for (i = 0; i < 100; i++) {\n\n    for (j = 0; j < 100; j++) {\n      s[i][j] = cin.get();\n      if (s[i][j] == ' ') {\n        t[i] = j;\n        break;\n      } else if (s[i][j] == '\\n') {\n        t[i] = j;\n        goto loop;\n      }\n    }\n  }\nloop:\n  n = i + 1;\n  for (j = 0; j < 100; j++) {\n    a[j] = cin.get();\n    if (a[j] == '\\n') {\n      at = j;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    b[j] = cin.get();\n    if (b[j] == '\\n') {\n      bt = j;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t[i] == at) {\n      p = 1;\n      for (j = 0; j < at - 1; j++) {\n        p *= s[i][j] - a[j] + 1;\n      }\n      if (p == 1) {\n        for (j = 0; j < bt; j++)\n          s[i][j] = b[j];\n        t[i] = bt;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    else {\n      cout << \" \";\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100];\n  int i, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000')\n      t[j++] = s[i++];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      printf(\"%s\", b);\n\n    } else {\n      printf(\"%s\", t);\n    }\n    if (i == strlen(s)) {\n      printf(\"\u0000\");\n    } else\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[100], s[100], d[100], e[30][30];\n  int m = 0, n = 0, l, i;\n\n  cin >> c;\n  l = strlen(c);\n\n  cin >> s;\n\n  scanf(\"%s \", d);\n  for (i = 0; i < (l + 1); i++) {\n    e[m][n] = c[i];\n    n++;\n    if (c[i] == ' ') {\n      e[m][n - 1] = 0;\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i <= m; i++)\n    if (strcmp(s, e[i]) == 0)\n      strcpy(e[i], d);\n  printf(\"%s\", e[0]);\n  for (i = 1; i <= m; i++)\n    printf(\" %s\", e[i]);\n}\n"}
{"label": "19", "index": "34793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[210] = {'\u0000'}, a[100], b[100];\n  int i, j, x = 0, k = 0, q, l = 0, d, p, m, dd, sl;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(s);\n  l = strlen(a);\n  d = strlen(a) - strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    x = 0;\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (s[i + x] == a[k]) {\n        x++;\n      } else\n        break;\n    }\n    if (l == x && (s[i - 1] == ' ' || i == 0) &&\n        (s[i + x] == ' ' || s[i + x] == '\u0000')) {\n\n      if (d >= 0) {\n        for (q = i + x; s[q] != '\u0000'; q++) {\n          s[q - d] = s[q];\n        }\n        for (m = 0; m < d; m++) {\n          s[q - d + m] = '\u0000';\n        }\n      } else {\n        if (d < 0) {\n          dd = -d;\n          for (q = sl - 1; q >= i + x; q--) {\n            s[q + dd] = s[q];\n          }\n          sl = sl + dd;\n        }\n      }\n      p = i;\n      for (j = 0; b[j] != '\u0000'; j++) {\n        s[p] = b[j];\n        p++;\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[150], from[150], to[150], a[50];\n  char *p = str;\n  int i;\n\n  cin >> str;\n\n  cin >> from;\n\n  cin >> to;\n\n  while (*p) {\n    for (i = 0; *p != ' ' && *p != '\u0000'; p++, i++) {\n      a[i] = *p;\n    }\n    a[i] = '\u0000';\n    if (strcmp(a, from) == 0)\n      printf(\"%s\", to);\n    else\n      printf(\"%s\", a);\n    if (*p) {\n      printf(\" \");\n      p++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34795", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p[200], *p1, *p2;\n  int i = 0, n, j;\n  for (i = 0; i < 200; i++)\n    p[i] = (char *)malloc(100 * sizeof(char));\n  i = 0;\n  for (j = 0; (*(p[i] + j) = getchar()) != '\\n'; j++) {\n    if (*(p[i] + j) == ' ') {\n      *(p[i] + j) = '\\0';\n      i++;\n      j = -1;\n    }\n  }\n  *(p[i] + j) = '\\0';\n  n = i;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  cin >> p1 >> p2;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], p1) == 0) {\n      strcpy(p[i], p2);\n    }\n  }\n  printf(\"%s\", p[0]);\n  for (i = 1; i <= n; i++)\n    printf(\" %s\", p[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  void CONVERT(char c[100], char d[100], char B, int N, int x);\n  int m, n, l, i, j, k[100], t;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  l = strlen(b);\n  for (i = 0; i < m; i++) {\n    k[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    t = k[i];\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i]) {\n        k[i] = 1;\n      } else {\n        k[i] = t;\n        break;\n      }\n    }\n    if ((s[i - 1] != ' ') && (i != 0))\n      k[i] = t;\n    if (k[i] == 1)\n      for (j = i + 1; j < i + n; j++) {\n        k[j] = 2;\n      }\n  }\n\n  for (i = 0; i < m; i++) {\n    if (k[i] == 1) {\n      for (j = 0; j < l; j++)\n        cout << b[j];\n    }\n    if (k[i] == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "34797", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[103], a[103], b[103], t[103][103];\n  int i, len, start = 0, end = 1, cur = 0, k = 0, w, e;\n\n  int result;\n  char *p = NULL;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  w = strlen(a);\n  e = strlen(b);\n\n  while (end < len) {\n    if (s[end] == ' ' || s[end] == 0) {\n      for (i = start, k = 0; i < end; i++, k++)\n        t[cur][k] = s[i];\n      t[cur][k + 1] = '\u0000';\n      cur++;\n      start = end + 1;\n      end = start + 1;\n    } else\n      end++;\n  }\n\n  for (i = start, k = 0; i < end; i++, k++)\n    t[cur][k] = s[i];\n  t[cur][k + 1] = '\u0000';\n  cur++;\n\n  for (i = 0; i < cur; i++) {\n    if (i == cur - 1) {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", t[i]);\n    } else {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", t[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "34798", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[10001];         \n  char c1[101], c2[101];   \n  int i, j, a, b, c;       \n  cin.getline(str, 10001); \n  cin >> c1 >> c2;         \n  a = strlen(str);         \n  b = strlen(c1);\n  c = strlen(c2);\n  for (i = 0; i < a; i++) {                        \n    if (((str[i - 1] == 32) && (str[i + b] == 32)) \n        || ((i == 0) && (str[i + b] == 32)) ||\n        (str[i - 1] == 32) && (i + b == a)) {\n      if (str[i] == c1[0]) {               \n        for (j = i; j <= i + b - 1; j++) { \n          if (str[j] != c1[j - i])         \n            break;\n        }\n        if (j == (i + b)) {                    \n          if (c > b) {                         \n            for (j = a - 1; j >= i + b; j--) { \n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) { \n              str[j] = c2[j - i];\n            }\n            a = a + c - b;                     \n            i = i + c - 1;                     \n          } else {                             \n            for (j = i + b; j <= a - 1; j++) { \n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) { \n              str[j] = c2[j - i];\n            }\n            a = a + c - b; \n            i = i + c;     \n          }\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) { \n    cout << str[i];\n  }\n  return 0; \n}\n"}
{"label": "19", "index": "34799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], x[100];\n  int len, n = 0, at = 1, i, j, t = 0, m = 0;\n\n  cin >> s, cin >> a, cin >> b;\n  strcat(s, \" \");\n  len = strlen(s);\n  for (i = 0; i < len + 1; i++) {\n    if (s[i] == ' ') {\n      at = 0;\n    }\n    if (at == 0) {\n      at = 1;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = t;; j++) {\n      if (s[j] != ' ') {\n        x[j - t] = s[j];\n      } else {\n        x[j - t] = '\u0000';\n        t = j + 1;\n        m++;\n        break;\n      }\n    }\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    if (m != n) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[999];\n  char a[100];\n  char b[100];\n  int i = 0, j = 0, k;\n  int add;\n  char word[200][100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; s[k] != '\u0000'; k++) {\n    if (s[k] == ' ') {\n      i++;\n      j = 0;\n    } else {\n      word[i][j] = s[k];\n      j++;\n    }\n  }\n  add = i;\n  for (i = 0; i < add + 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < add; i++)\n    printf(\"%s \", word[i]);\n  puts(word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34801", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], ans[100], temp[100];\n  int i, j, templ, tempans;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  templ = 0;\n  tempans = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      temp[templ] = '\u0000';\n      if (strcmp(temp, a) == 0) {\n        for (j = 0; j < strlen(b); j++) {\n          ans[tempans] = b[j];\n          tempans++;\n        }\n      } else {\n        for (j = 0; j < templ; j++) {\n          ans[tempans] = temp[j];\n          tempans++;\n        }\n      }\n      ans[tempans] = ' ';\n      tempans++;\n      templ = 0;\n      continue;\n    }\n    temp[templ] = s[i];\n    templ++;\n  }\n  temp[templ] = '\u0000';\n  if (strcmp(temp, a) == 0) {\n    for (j = 0; j < strlen(b); j++) {\n      ans[tempans] = b[j];\n      tempans++;\n    }\n  } else {\n    for (j = 0; j < templ; j++) {\n      ans[tempans] = temp[j];\n      tempans++;\n    }\n  }\n  ans[tempans] = '\u0000';\n  cout << ans;\n  return 0;\n}\n"}
{"label": "19", "index": "34802", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar buffer[1024];\nchar word[1024];\nchar replace_1[1024];\nchar current[1024];\n\nint main() {\n\n  cin >> buffer;\n  scanf(\"%s %s\", word, replace_1);\n\n  int buffer_len = strlen(buffer);\n  char *buffer_ptr = buffer;\n  char *buffer_end = buffer + buffer_len;\n\n  char *current_ptr = current;\n  while (buffer_ptr < buffer_end) {\n    if (*buffer_ptr == ' ') {\n      *current_ptr = '\u0000';\n      if (strcmp(word, current) == 0)\n        printf(\"%s \", replace_1);\n      else\n        printf(\"%s \", current);\n      current_ptr = current;\n    } else {\n      *current_ptr = *buffer_ptr;\n      ++current_ptr;\n    }\n    ++buffer_ptr;\n  }\n  *current_ptr = '\u0000';\n  if (strcmp(word, current) == 0)\n    printf(\"%s\", replace_1);\n  else\n    printf(\"%s\", current);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34803", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *p, *c, n, *end;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(p, \"%s\", c);\n    if (strcmp(c, a) == 0)\n      cout << b;\n    else\n      printf(\"%s\", c);\n    p = p + strlen(c) + 1;\n    if (p >= end)\n      break;\n    cout << ' ';\n  }\n}\n"}
{"label": "19", "index": "34804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, l;\n  char s[100], a[10], b[10], c[10];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  l = strlen(b);\n  for (i = 0; i <= n - 1;) {\n    if ((s[i] == a[0] && i == 0) || (s[i] == a[0] && s[i - 1] == ' ')) {\n      j = 0;\n      while ((s[i + j] != ' ') && ((i + j) != n)) {\n        c[j] = s[i + j];\n        j++;\n      }\n      c[j] = '\u0000';\n      if (strcmp(c, a) == 0) {\n        cout << b << \" \";\n        i = i + m + 1;\n      } else {\n        printf(\"%c\", s[i]);\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "34805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, l1, l2;\n\n  scanf(\"%s \", s);\n  scanf(\"%s %s\", a, b);\n  getchar();\n  l1 = strlen(s);\n  l2 = strlen(a);\n  for (i = 0; i < l1; i++) {\n    if (i == 0) {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i + l2] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        cout << s[i];\n      }\n    } else {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n    }\n  }\n  printf(\" \");\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34806", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[1000], str2[100], str3[100], str4[100], str5[2] = \" \",\n                                                    str[100] = \"\";\n  int i, k = 0;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  for (i = 0; str1[i] != '\u0000'; i++) {\n    if (str1[i] != ' ') {\n      str4[k] = str1[i];\n      k = k + 1;\n    } else {\n      str4[k] = '\u0000';\n      k = 0;\n      if (strcmp(str4, str2) == 0)\n        strcat(str, str3);\n      else\n        strcat(str, str4);\n      strcat(str, str5);\n    }\n  }\n  str4[k] = '\u0000';\n  if (strcmp(str4, str2) == 0)\n    strcat(str, str3);\n  else\n    strcat(str, str4);\n  printf(\"%s\", str);\n}\n"}
{"label": "19", "index": "34807", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[11000], target[1000], replace[1000];\n  cin.getline(ch, 10000);\n  cin.getline(target, 110);\n  cin.getline(replace, 110);\n  int c = strlen(ch);\n  int t = strlen(target);\n  ch[c] = ' ';\n  for (int i = 0; i < c; i++) {\n    if (ch[i] != target[0])\n      cout << ch[i];\n    else if (i == 0 && ch[i] == target[0] && ch[t] != ' ')\n      cout << ch[i];\n    else if (i > 0 && (ch[i - 1] != ' ' || ch[i + t] != ' '))\n      cout << ch[i];\n    else {\n      int count = 0;\n      for (int j = 0; j < t; j++) {\n        if (ch[i + j] == target[j])\n          count++;\n        else\n          break;\n      }\n      if (count == t) {\n        cout << replace;\n        i = i + t - 1;\n      } else\n        cout << ch[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[200] = {0}, a[100] = {0}, b[100] = {0};\n  char c[50][50] = {0};\n  int i = 0, j, k = 0, n = 0;\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; zfc[i] != ' ' && zfc[i] != 0; i++) {\n    for (k = 0; zfc[i] != ' ' && zfc[i] != 0; i++, k++) {\n      c[n][k] = zfc[i];\n    }\n    n++;\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (strcmp(c[j], a) == 0) {\n      strcpy(c[j], b);\n    }\n    printf(\"%s \", c[j]);\n  }\n  if (strcmp(c[n - 1], a) == 0) {\n    strcpy(c[n - 1], b);\n  }\n  cout << c[n - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34809", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], s[100][20] = {'\u0000'};\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int len, i, m = 0, n = 0;\n  len = strlen(a);\n  for (i = 0; i < len; i++) {\n    if (a[i] != ' ') {\n      s[m][n] = a[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i < m + 1; i++) {\n    if (strcmp(s[i], b) == 0) {\n      strcpy(s[i], c);\n    }\n  }\n  for (i = 0; i < m; i++) {\n    printf(\"%s \", s[i]);\n  }\n  printf(\"%s \", s[m]);\n}\n"}
{"label": "19", "index": "34810", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], str4[100][100], *p;\n\n  scanf(\"%s \", str1);\n\n  cin >> str2;\n\n  cin >> str3;\n  p = str1;\n  int i, j = 0, k = 0, n;\n  n = strlen(str1);\n  for (i = 0; i <= n; i++) {\n    if ((*(p + i) != ' ') && (*(p + i) != '\u0000')) {\n      str4[k][j] = str1[i];\n      j = j + 1;\n    } else {\n      str4[k][j] = '\u0000';\n      j = 0;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(str4[i], str2) == 0) {\n\n      strcpy(str4[i], str3);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", str4[i]);\n  }\n  cout << str4[k - 1] << \" \";\n}\n"}
{"label": "19", "index": "34811", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  struct point {\n    char w[20];\n  } sen[40];\n  int i, j;\n  for (i = 0; i < 40; i++) {\n    for (j = 0; j < 20; j++) {\n      sen[i].w[j] = '\u0000';\n    }\n  }\n  char a[100];\n  char from[20], to[20];\n\n  cin >> a;\n\n  cin >> from;\n\n  cin >> to;\n  int e;\n  e = strlen(to);\n  to[e] = ' ';\n  to[e + 1] = '\u0000';\n  int b;\n  b = strlen(a);\n  int k, p, q;\n  int num = 0;\n  for (i = 0, j = 0; i <= b; i++) {\n    int m;\n    if (a[i] == ' ') {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n\n      j++;\n      num++;\n    } else if (i == b) {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n      j++;\n      num++;\n    }\n  }\n  int judge;\n  for (i = 0; i <= num; i++) {\n    judge = 1;\n    for (j = 0; from[j] != '\u0000'; j++) {\n      if (sen[i].w[j] != from[j]) {\n        judge = 0;\n        break;\n      }\n    }\n    if (judge == 1) {\n      strcpy(sen[i].w, to);\n    }\n  }\n  for (i = 0;; i++) {\n    if (sen[num - 1].w[i] == ' ') {\n      sen[num - 1].w[i] = '\u0000';\n      break;\n    }\n  }\n\n  for (i = 0; i <= num + 1; i++) {\n    printf(\"%s\", sen[i].w);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sentence[110], first[110], second[110];\n  int i, j, flag;\n  int lens, len1, len2;\n  cin.getline(sentence, 110);\n  cin.getline(first, 110);\n  cin.getline(second, 110);\n  lens = strlen(sentence);\n  len1 = strlen(first);\n  for (i = 0; i < lens - len1 + 1; i++) {\n    flag = 0;\n    if ((i == 0 && sentence[i + len1] == ' ') ||\n        (sentence[i - 1] == ' ' && sentence[i + len1] == ' ') ||\n        (i == lens - len1 && sentence[i - 1] == ' ')) {\n      for (j = 0; j < len1; j++) {\n        if (sentence[i + j] == first[j])\n          flag++;\n      }\n    }\n    if (flag == len1) {\n      i = i + len1 - 1;\n      cout << second;\n    } else\n      cout << sentence[i];\n  }\n  if (flag != len1)\n    for (i = lens - len1 + 1; i < lens; i++)\n      printf(\"%c\", sentence[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char word[5000], w[1000][1000], w1[1000], w2[1000];\n\n  cin >> word;\n\n  cin >> w1;\n\n  cin >> w2;\n  int n, i, j = 0, k = 0, A;\n  n = strlen(word);\n  for (i = 0; i < n; i++) {\n    if (word[i] != ' ') {\n      w[k][j] = word[i];\n      j++;\n      A = 1;\n    }\n    if (word[i] == ' ' && A == 1) {\n      w[k][j] = '\u0000';\n      j = 0;\n      k++;\n      A = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(w1, w[i]) == 0)\n      strcpy(w[i], w2);\n  }\n  for (i = 0; i < k; i++) {\n    cout << w[i] << \" \";\n  }\n  printf(\"%s\", w[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100], *p, *q, *r;\n  int i, j = 0, m, e, t;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (p = a; p < a + strlen(a); p++) {\n    if (*p != *b ||\n        (*p == *b && (*(p + strlen(b)) != ' ') &&\n         (*p == *b && *(p + strlen(b)) != '\u0000')) ||\n        ((*p == *b && *(p) != *a) && (*p == *b && *(p - 1) != ' '))) {\n      d[j] = *p;\n      j++;\n    } else if (*p == *b &&\n               ((*(p + strlen(b)) == ' ' || *(p + strlen(b)) == '\u0000')) &&\n               (*(p - 1) == ' ' || *p == *a)) {\n      q = p;\n      m = 0;\n      for (i = 0; i < strlen(b); i++) {\n        if (*p != *(b + i)) {\n          m = 1;\n          for (r = q; r <= q + i; r++) {\n            *(d + j) = *r;\n            j++;\n          }\n          break;\n        } else\n          p++;\n      }\n      if (m == 0) {\n        p--;\n        for (e = 0; e < strlen(c); e++) {\n          *(d + j) = *(c + e);\n          j++;\n        }\n      }\n    }\n  }\n  for (t = 0; t < j; t++)\n    cout << *(d + t);\n}\n"}
{"label": "19", "index": "34815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i, j, k, ls, la, lb, r;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + la] == 32 || i == ls - 1)) {\n      r = 1;\n      for (k = i, j = 0; j < la; j++, k++) {\n\n        if (s[k] != a[j]) {\n          r = 0;\n          break;\n        }\n      }\n      if (r == 1) {\n        for (k = 0; k < lb; k++) {\n          printf(\"%c\", b[k]);\n        }\n        i = i + la - 1;\n        r = 0;\n      }\n    } else\n      cout << s[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34816", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n\n  for (int i = 0; i < strlen(a); i++) {\n    if (a[i] == b[0] && (a[i - 1] == ' ' || i == 0) &&\n        (a[i + strlen(b)] == ' ' || i + strlen(b) == strlen(a))) {\n      int check = 0;\n      for (int j = 0; j < strlen(b); j++) {\n        if (a[j + i] != b[j]) {\n          check = 1;\n          break;\n        }\n      }\n      if (check == 0) {\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        continue;\n      }\n    }\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34817", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0};\n  int sum = 0;\n  while (true) {\n    cin >> s[sum];\n    sum++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  char a[100] = {0};\n  char b[100] = {0};\n  cin >> a >> b;\n  for (int i = 0; i < sum; i++)\n    for (int j = 0; j < 100; j++) {\n      if (s[i][j] != a[j])\n        break;\n      if (j == 99)\n        strcpy(s[i], b);\n    }\n  for (int l = 0; l < sum - 1; l++)\n    printf(\"%s \", s[l]);\n  cout << s[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, n;\n\n  char s[120];\n  char word[120];\n  char a[120];\n  char b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != ' ' && s[i] != '\u0000'; i++)\n    word[i] = s[i];\n\n  word[i] = '\u0000';\n  if (strcmp(word, a) == 0) {\n\n    printf(\"%s\", b);\n  } else\n    cout << word;\n  n = i;\n  while (s[i] != '\u0000') {\n    i++;\n\n    for (; s[i] != ' ' && s[i] != '\u0000'; i++) {\n      word[i - n - 1] = s[i];\n    }\n\n    word[i - n - 1] = '\u0000';\n    if (strcmp(word, a) == 0) {\n\n      cout << \" \" << b;\n    } else\n      printf(\" %s\", word);\n\n    n = i;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34819", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, count = -1, pos[51], k = 0;\n  char a[51][101], b[101], c[101], d;\n  while (1) {\n    cin >> a[i];\n    i++;\n    if (d = cin.get(), d == '\\n')\n      break;\n  }\n  i--;\n  cin >> b >> c;\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      count++;\n      pos[count] = j;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if ((k <= count) && (pos[k] == j)) {\n      if (j == i)\n        printf(\"%s\", c);\n      else\n        cout << c << \" \";\n      k++;\n    } else {\n      if (j == i)\n        cout << a[j];\n      else\n        cout << a[j] << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0};\n  char a[100] = {0}, b[100] = {0}, n = 0;\n  int i = 0, k = 0, kongzhi = 0, x = 0;\n  for (i = 0;; i++) {\n    for (k = 0;; k++) {\n      s[i][k] = getchar();\n      if (s[i][k] == ' ' || s[i][k] == '\\n')\n        break;\n    }\n    n++;\n    if (s[i][k] == '\\n')\n      break;\n  }\n  for (i = 0;; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n  }\n  for (i = 0;; i++) {\n    b[i] = getchar();\n    if (b[i] == '\\n') {\n      x = i;\n      b[i] = ' ';\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = 0; k < 100; k++) {\n      if (s[i][k] != a[k] && s[i][k] != ' ' && s[i][k] != '\\n')\n        kongzhi = 1;\n    }\n    if (kongzhi == 0) {\n      if (i == n - 1)\n        b[x] = 0;\n      for (k = 0; k < 100; k++)\n        s[i][k] = b[k];\n    }\n    kongzhi = 0;\n  }\n  for (i = 0; s[i][k] != 0; i++) {\n    for (k = 0; s[i][k] != 0; k++)\n      printf(\"%c\", s[i][k]);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34821", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char word[200], x[200], y[200];\n  int i, j, len = 0, t[200] = {0};\n  char c;\n\n  cin >> word;\n  cin >> x >> y;\n  for (i = 0; i < strlen(word); i++) {\n    if ((i == 0) || word[i - 1] == ' ')\n      for (j = 0; j < strlen(x); j++) {\n        if (word[i + j] != x[j])\n          break;\n        else if ((j == strlen(x) - 1) &&\n                 (word[i + j + 1] == ' ' || word[i + j + 1] == '\u0000')) {\n          t[i] = 1;\n        }\n      }\n  }\n  for (i = 0; i < strlen(word); i++) {\n    if (t[i] == 0) {\n      printf(\"%c\", word[i]);\n    } else {\n      printf(\"%s\", y);\n      i = i + strlen(x) - 1;\n    }\n  }\n}\n"}
{"label": "19", "index": "34822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar a[105];\nchar h[105];\nchar b[105];\nchar c[105];\nchar d[105];\nint k;\nint p;\nint main() {\n  int i, j;\n  int t;\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  for (i = 0, j = 0; i <= strlen(a); i++) {\n    d[k++] = a[i];\n    h[p++] = a[i];\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      d[--k] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        p -= strlen(d) + 1;\n        for (t = 0; t < strlen(c); t++)\n          h[p++] = c[t];\n        if (a[i] == ' ')\n          h[p++] = ' ';\n      }\n      j = k + 1;\n      k = 0;\n    }\n  }\n  for (i = 0; i < strlen(h); i++)\n    putchar(h[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34823", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint equal(char *x, char *y) {\n  for (int k = 0; x[k] != '\\0' || y[k] != '\\0'; k++)\n    if (x[k] != y[k])\n      return 0;\n  return 1;\n}\n\nint main() {\n  char str[100][100];\n\n  int number = 0;\n\n  while (1) {\n    cin >> str[number++];\n    if (cin.get() == '\\n') {\n      break;\n    }\n  }\n\n  char str1[100], str2[100];\n  cin >> str1 >> str2;\n\n  for (int k = 0; k != number - 1; k++) {\n    if (equal(str[k], str1)) {\n      cout << str2 << \" \";\n      continue;\n    }\n    printf(\"%s \", str[k]);\n  }\n  if (equal(str[number - 1], str1))\n    cout << str2 << endl;\n  else\n    printf(\"%s\\n\", str[number - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34824", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a, l, sum = 0;\n  char s[101];\n  char s1[101];\n  char s2[101];\n  char s0[101];\n  cin.getline(s, 101);\n  cin >> s1;\n  cin >> s2;\n  int k1 = strlen(s);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] == s1[0] && s[strlen(s1) + i] == ' ' && s[i - 1] == ' ') ||\n        (i == 0 && s[i] == s1[0] && s[strlen(s1) + i] == ' ') ||\n        (s[i] == s1[0] && s[i - 1] == ' ' && i + strlen(s1) == strlen(s))) {\n      for (a = 0; a < strlen(s) - i - strlen(s1); a++)\n        s0[a] = s[i + strlen(s1) + a];\n      for (j = 0; j < strlen(s2); j++)\n        s[i + j] = s2[j];\n      for (l = 0; l < strlen(s0); l++)\n        s[i + j + l] = s0[l];\n      sum++;\n      i = i + strlen(s2) - strlen(s1);\n    }\n  }\n  for (k = 0; k < k1 + sum * strlen(s2) - sum * strlen(s1); k++)\n    cout << s[k];\n  return 0;\n}\n"}
{"label": "19", "index": "34825", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101], b[101], c[101];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int i, j = 0;\n  for (i = 0; a[i] != '\u0000'; i++, j++) {\n    if (a[i] != ' ')\n      t[j] = a[i];\n    if (a[i] == ' ') {\n      t[j] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n        printf(\"%s \", t);\n      } else\n        printf(\"%s \", t);\n      j = -1;\n    }\n  }\n  t[j] = '\u0000';\n  if (strcmp(t, b) == 0) {\n    strcpy(t, c);\n    printf(\"%s\", t);\n  } else\n    printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "19", "index": "34826", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[201], b[201], c[201];\n  int i, j, la, lb, k, t, ls;\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  la = strlen(a), lb = strlen(b), ls = strlen(s);\n  for (i = 0; i < 100; i = i + 1)\n    c[i] = s[i];\n  t = 0;\n  for (i = 0; i < ls; i = i + 1) {\n    if (s[i] == '\u0000')\n      break;\n    for (j = 0; j < la; j = j + 1) {\n      if (s[i + j] != a[j])\n        break;\n    }\n    if (j == la && (s[i + la] == ' ' || s[i + la] == '\u0000') &&\n        (s[i - 1] == ' ' || i == 0)) {\n\n      for (k = 0; k < lb; k = k + 1)\n        s[i + k] = b[k];\n      for (k = 0; k < 100; k = k + 1)\n        s[i + lb + k] = c[i + la + t * (la - lb) + k];\n      t = t + 1;\n    }\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[150], from[150], to[150], a[50];\n  char *p = str;\n  int i;\n\n  scanf(\"%s \", str);\n\n  cin >> from;\n\n  cin >> to;\n\n  while (*p) {\n    for (i = 0; *p != ' ' && *p != '\u0000'; p++, i++)\n      a[i] = *p;\n\n    a[i] = '\u0000';\n    if (strcmp(a, from) == 0)\n      printf(\"%s\", to);\n    else\n      cout << a;\n    if (*p) {\n      printf(\" \");\n      p++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34828", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar sen[200], a[100], b[100], re[400];\nint alen, blen;\n\nint test(int n) {\n  int j = 0;\n  char *p1, *p2;\n  p1 = sen + n;\n  p2 = a;\n  if (n != 0) {\n    if (*(p1 - 1) != ' ')\n      return 0;\n  }\n  do {\n    if (*p1 != *p2)\n      j = 1;\n\n    p1++;\n    p2++;\n  } while (p2 - a < alen);\n  if (*p1 != ' ' && *p1 != '\u0000')\n    return 0;\n  if (j == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n\n  int l;\n  char *write = re;\n  const char *read = sen;\n\n  scanf(\"%s \", sen);\n\n  cin >> a;\n\n  cin >> b;\n  alen = strlen(a);\n  blen = strlen(b);\n  for (; read - sen < 200; read++) {\n    if (test(read - sen) == 1) {\n\n      for (l = 0; l < blen; l++)\n        *(write + l) = b[l];\n\n      write += blen;\n      read += alen - 1;\n    } else {\n      *write = *read;\n      write++;\n    }\n  }\n\n  printf(\"%s\", re);\n}\n"}
{"label": "19", "index": "34829", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  cin >> s;\n  cin >> from >> to;\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    if (strcmp(s, from) == 0) {\n      printf(\"%s\", to);\n    } else {\n      printf(\"%s\", s);\n    }\n    s = p + 1;\n    if (*s)\n      printf(\" \");\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34830", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  cin >> zfc;\n  scanf(\"%s\", sor);\n  cin >> rep;\n  int n = strlen(zfc);\n  int k = strlen(sor);\n\n  for (i = 0; i < n; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (((i == 0) && (dec == 0)) ||\n        ((dec == 0) &&\n         (zfc[i - 1] == ' ' || zfc[i - 1] == ',' || zfc[i - 1] == '.'))) {\n      cout << rep;\n      i = i + k - 1;\n    } else {\n      printf(\"%c\", zfc[i]);\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34831", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  while (ch != ' ') {\n    cin >> s[i++];\n    ch = getchar();\n  }\n  cin >> a;\n  cin >> b;\n  p = &s[0];\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34832", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500] = {0}, b[30] = {0}, c[30] = {0}, temp[30] = {0};\n  int i, j, k, len, count = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len = strlen(a);\n\n  for (i = 0; i <= len; i++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      temp[count] = a[i];\n      count++;\n    }\n    if (a[i] == ' ') {\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n    if (a[i] == '\u0000') {\n\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n  }\n}\n"}
{"label": "19", "index": "34833", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n\n  cin >> str;\n  char a[101], b[101];\n  scanf(\"%s%s\", a, b);\n  int n = strlen(str);\n  int i, k = 0, j = 0;\n  char c[101][101];\n  for (i = 0; i < n; i++) {\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(c[k], (str + j));\n      k++;\n      j = i + 1;\n    }\n  }\n  strcpy(c[k], (str + j));\n  k++;\n  for (i = 0; i < k; i++) {\n    if (i > 0) {\n      printf(\" \");\n    }\n    if (strcmp(c[i], a) == 0)\n      printf(\"%s\", b);\n    else {\n      printf(\"%s\", c[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34834", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k;\n  char a[100][100], b[100], c[100];\n  int n = 0;\n  for (i = 0; i < 100; i++) {\n    cin >> a[i];\n    n++;\n    k = getchar();\n    if (k == '\\n')\n      break;\n  }\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i < n; i++) {\n    k = strcmp(b, a[i]);\n    if (k == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", a[i]);\n\n  cout << a[n - 1];\n}\n"}
{"label": "19", "index": "34835", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[100][100] = {'\u0000'};\n  int i, k = 0, j = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[k][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ') {\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      printf(\" %s\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34836", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[101], target[10001], a[101], b[101], c[101];\nint i = 0, j = 0, k = 0, len_str, len_a, len_b, pos = 0, t = 0;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  scanf(\"%s%s\", a, b);\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101];\n  char b[101];\n  char c[101];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int found = 0, i, j;\n  memset(t, '\u0000', sizeof(t));\n  for (i = 0, j = 0; a[i - 1] != '\u0000'; i++, j++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      t[j] = a[i];\n    }\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      t[j + 1] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n      }\n      if (found++)\n        printf(\" \");\n\n      cout << t;\n      j = -1;\n      memset(t, '\u0000', sizeof(t));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zj[100][100];\n  int i = 0, k, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    k = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      zj[t][k] = s[i];\n      k++;\n      i++;\n    }\n    zj[t][k] = '\u0000';\n    while (s[i] == ' ')\n      i++;\n\n    t++;\n  }\n  zj[t][k + 1] = '\u0000';\n  for (i = 0; i < t; i++) {\n\n    if (strcmp(zj[i], a) == 0) {\n      strcpy(zj[i], b);\n    }\n  }\n  for (i = 0; i < t - 1; i++) {\n    cout << zj[i] << \" \";\n  }\n  cout << zj[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34839", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *str, *s1, *s2, *t, *str2;\n  int n;\n  str = (char *)calloc(102, 1000);\n  s1 = (char *)calloc(102, 1000);\n  s2 = (char *)calloc(102, 1000);\n  t = (char *)calloc(102, 1000);\n  str2 = (char *)calloc(240, 1000);\n\n  cin >> str;\n  scanf(\"%s%s\", s1, s2);\n  do {\n    sscanf(str, \"%s\", t);\n    n = strlen(t);\n    str = str + n + 1;\n    if (strcmp(t, s1) == 0)\n      strcat(str2, s2);\n    else\n      strcat(str2, t);\n    if (*str != '\u0000')\n      strcat(str2, \" \");\n  } while (*str != '\u0000');\n  printf(\"%s\", str2);\n}\n"}
{"label": "19", "index": "34840", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, len1, m = 1, p = 0;\n  char str[110], word[100][100], w1[100], w2[100];\n  cin.getline(str, 110, '\\n');\n  cin.getline(w1, 100, '\\n');\n  cin.getline(w2, 100, '\\n');\n  len = strlen(str) - 1;\n  len1 = strlen(w2) - 1;\n  for (int i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      word[m][p] = str[i];\n      p++;\n    }\n    if (str[i] == ' ') {\n      p = 0;\n      m++;\n    }\n  }\n  for (int i = 1; i <= m; i++) {\n    if (strcmp(word[i], w1) == 0) {\n      for (int j = 0; j <= len1; j++)\n        word[i][j] = w2[j];\n      for (int j = len1 + 1; j <= 98; j++)\n        word[i][j] = '\\0';\n    }\n  }\n  for (int i = 1; i <= m - 1; i++)\n    cout << word[i] << \" \";\n  cout << word[m] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, d, e = -1;\n  char f[100], g[100], h[100], i[100], j[100];\n\n  cin >> f;\n\n  cin >> g;\n\n  cin >> h;\n  f[-1] = ' ';\n  for (a = -1; a <= 100;) {\n    i[e] = f[a];\n    if (f[a] == ' ' && f[a + 1] == g[0]) {\n      for (b = 0;; b++) {\n        if (g[b] == '\u0000') {\n          for (d = 0; h[d] != '\u0000'; d++) {\n            i[e + d + 1] = h[d];\n          }\n          i[e + d + 1] = ' ';\n          e = e + d;\n          a = a + b;\n          break;\n        }\n\n        if (f[a + b + 1] != g[b])\n          break;\n      }\n    }\n    a++;\n    e++;\n  }\n  printf(\"%s\", i);\n}\n"}
{"label": "19", "index": "34842", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], word[100][100] = {0}, a[100], b[100];\n  int i, j, k = 0, k1 = 0, k2 = 0, sl;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(str);\n  for (i = 0; i < sl; i++) {\n    if (str[i] == ' ' || i == sl - 1) {\n      for (j = k; j < i; j++, k2++)\n        word[k1][k2] = str[j];\n      if (i == sl - 1)\n        word[k1][k2] = str[i];\n      k1++;\n      k2 = 0;\n      k = i + 1;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != 0)\n      printf(\" \");\n    printf(\"%s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34843", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], ans[100], temp[100];\n  int i, j, templ, tempans;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  templ = 0;\n  tempans = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      temp[templ] = '\u0000';\n      if (strcmp(temp, a) == 0) {\n        for (j = 0; j < strlen(b); j++) {\n          ans[tempans] = b[j];\n          tempans++;\n        }\n      } else {\n        for (j = 0; j < templ; j++) {\n          ans[tempans] = temp[j];\n          tempans++;\n        }\n      }\n      ans[tempans] = ' ';\n      tempans++;\n      templ = 0;\n      continue;\n    }\n    temp[templ] = s[i];\n    templ++;\n  }\n  temp[templ] = '\u0000';\n  if (strcmp(temp, a) == 0) {\n    for (j = 0; j < strlen(b); j++) {\n      ans[tempans] = b[j];\n      tempans++;\n    }\n  } else {\n    for (j = 0; j < templ; j++) {\n      ans[tempans] = temp[j];\n      tempans++;\n    }\n  }\n  ans[tempans] = '\u0000';\n  printf(\"%s\", ans);\n  return 0;\n}\n"}
{"label": "19", "index": "34844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j = 0, i, l, ls;\n  char s[105], str[105], a[105], x[105], s1[105] = {' ', '\u0000'},\n                                         s2[2] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> a;\n  strcat(s, s2);\n  strcat(s1, s);\n  strcpy(s, s1);\n  l = strlen(str);\n  ls = strlen(a);\n  strcpy(x, s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == str[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (l == j && s[i - j] == ' ' && s[i + 1] == ' ') {\n      if (i - j != -1) {\n        x[i - j + 1] = '\u0000';\n        strcat(x, a);\n      } else {\n        strcpy(x, a);\n      }\n      strcat(x, s + i + 1);\n      i = i + ls - l;\n      j = 0;\n      strcpy(s, x);\n    }\n  }\n  for (i = 0; x[i + 2] != '\u0000'; i++) {\n    x[i] = x[i + 1];\n  }\n  x[i] = '\u0000';\n  cout << x;\n  return 0;\n}\n"}
{"label": "19", "index": "34845", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], a[100][100];\n  int i, j = 0, t = 0, l, m, n, k = -1, f = 1;\n\n  scanf(\"%s \", str1);\n\n  cin >> str2;\n\n  cin >> str3;\n  m = strlen(str1);\n  l = strlen(str2);\n  str1[m] = '\u0000';\n  for (j = 0; i <= m; j++) {\n    for (i = k + 1, n = 0; i <= m; i++, n++) {\n      if (str1[i] != ' ' && str1[i] != '\u0000')\n        a[j][n] = str1[i];\n      else {\n        a[j][n] = '\u0000';\n        k = i;\n        break;\n      }\n    }\n  }\n  k = j - 1;\n  for (j = 0; j < k; j++) {\n    f = 1;\n    t = strlen(a[j]);\n    if (l != t) {\n      printf(\"%s\", a[j]);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n      continue;\n    } else {\n      for (i = 0; i < l; i++) {\n        if (a[j][i] != str2[i]) {\n          printf(\"%s\", a[j]);\n          if (j < k - 1) {\n            printf(\" \");\n          }\n          f = 0;\n          break;\n        }\n      }\n    }\n    if (f == 1) {\n      printf(\"%s\", str3);\n      if (j < k - 1)\n        printf(\" \");\n    }\n  }\n}\n"}
{"label": "19", "index": "34846", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint jianyan[1000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i, j = 0, v = 0, count_jianyan = 0, l = strlen(a), l_sub = strlen(sub);\n  for (int r = 0; r < l; r++) {\n    if (a[r] == ' ') {\n      jianyan[count_jianyan] = r;\n      count_jianyan++;\n    }\n  }\n  for (int u = 0; u < l_sub; u++) {\n    if (a[u] == sub[u]) {\n      b[0]++;\n    }\n  }\n  while (v < count_jianyan) {\n    i = jianyan[v] + 1;\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j])\n        b[i]++;\n    }\n    v++;\n  }\n  int k = 0, w[1000], count = 0;\n  for (int gl = 0; gl < 1000; gl++) {\n    w[gl] = 999;\n  }\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w[count] = k;\n      count++;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0, m = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w[m]) {\n        printf(\"%s\", c);\n        q += l_sub;\n        m++;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else {\n    if (count == 0) {\n      puts(a);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34847", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char st[101];\n  char word1[101], word2[101];\n  int match[101];\n\n  memset(match, 1, sizeof(match));\n\n  cin >> st;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  int len1 = strlen(st), len2 = strlen(word1), len3 = strlen(word2);\n\n  int i, j, k;\n  for (i = 0; i < len1; i++) {\n    if ((i == 0 || st[i - 1] == ' ') && i + len2 <= len1) {\n      for (j = 0; j < len2; j++) {\n        if (st[i + j] != word1[j])\n          match[i] = 0;\n      }\n    }\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (!match[i]) {\n      for (j = i; j < len1; j++) {\n        putchar(st[j]);\n        if (st[j] == ' ')\n          break;\n      }\n      i = j;\n    } else {\n      i += len2;\n      printf(\"%s\", word2);\n      if (i < len1)\n        putchar(' ');\n    }\n  }\n  puts(\"\");\n\n  return 0;\n}\n"}
{"label": "19", "index": "34848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char sen[1000] = \"\u0000\";\n  char word_1[101] = \"\u0000\";\n  char word_2[101] = \"\u0000\";\n  char word_1_1[101] = \"\u0000\";\n  int number[101] = {0};\n  int i, j, k;\n  int sum;\n  int num = 0;\n  int m = 0;\n\n  cin >> sen;\n  cin >> word_1;\n  cin >> word_2;\n  for (i = 0; i <= strlen(sen) - strlen(word_1); i++) {\n    sum = 0;\n    for (j = 0; j <= strlen(word_1) - 1; j++)\n      word_1_1[j] = sen[j + i];\n    for (j = 0; j <= strlen(word_1) - 1; j++) {\n      if (word_1_1[j] != word_1[j])\n        sum = sum + 1;\n    }\n    if ((sum == 0) && (i != 0) && (sen[i - 1] != ' ')) {\n      sum = sum + 1;\n    }\n    if (sum == 0) {\n      number[m] = i;\n      m = m + 1;\n      num = num + 1;\n    }\n  }\n  for (k = 1; k <= num; k++) {\n\n    if (k == 1)\n      for (j = 0; j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    if (k != 1)\n      for (j = number[k - 2] + strlen(word_1); j < number[k - 1]; j++)\n        cout << sen[j];\n    for (j = 0; j < strlen(word_2); j++)\n      printf(\"%c\", word_2[j]);\n    if (k == num) {\n      if (number[k - 1] + strlen(word_1) == strlen(sen))\n        printf(\" \");\n      else {\n        for (j = number[k - 1] + strlen(word_1); j < strlen(sen); j++) {\n\n          if (j == strlen(sen) - 1)\n            printf(\"%c \", sen[j]);\n          else\n            cout << sen[j];\n        }\n      }\n    }\n  }\n\n  if (num == 0)\n    printf(\"%s \", sen);\n  return 0;\n}\n"}
{"label": "19", "index": "34849", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[103], a[103], b[103], t[103][103];\n  int i, len, start = 0, end = 1, cur = 0, k = 0, w, e;\n\n  int result;\n  char *p = NULL;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  w = strlen(a);\n  e = strlen(b);\n\n  while (end < len) {\n    if (s[end] == ' ' || s[end] == 0) {\n      for (i = start, k = 0; i < end; i++, k++)\n        t[cur][k] = s[i];\n      t[cur][k + 1] = '\u0000';\n      cur++;\n      start = end + 1;\n      end = start + 1;\n    } else\n      end++;\n  }\n\n  for (i = start, k = 0; i < end; i++, k++)\n    t[cur][k] = s[i];\n  t[cur][k + 1] = '\u0000';\n  cur++;\n\n  for (i = 0; i < cur; i++) {\n    if (i == cur - 1) {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", t[i]);\n    } else {\n      if (strcmp(t[i], a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", t[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "34850", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int na, nb, nc, i, j, k, p, num = 0;\n\n  char a[1000], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  na = strlen(a);\n  nb = strlen(b);\n  nc = strlen(c);\n\n  for (i = 0; i < 1000; i++) {\n    for (j = 0; j < nb; j++)\n      if (*(a + i + j) != *(b + j))\n        break;\n    if ((j == nb && *(a + i + nb) == ' ' && *(a + i - 1) == ' ') ||\n        (j == nb && i == 0 && *(a + i + nb) == ' ') ||\n        (j == nb && i == na + num * (nc - nb) - nb && *(a + i - 1) == ' ')) {\n      num++;\n      if (nb >= nc) {\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n        for (p = 0; p < na + num * (nc - nb); p++)\n          *(a + i + nc + p) = *(a + i + nb + p);\n      }\n      if (nb < nc) {\n        for (p = ((nc - nb) * num + na - 1); p > i + nb - 1; p--) {\n          *(a + p) = *(a + p - (nc - nb));\n        }\n        for (k = 0; k < nc; k++) {\n          *(a + i + k) = *(c + k);\n        }\n      }\n    }\n  }\n  for (i = 0; i < (na + num * (nc - nb)); i++)\n    printf(\"%c\", *(a + i));\n}\n"}
{"label": "19", "index": "34851", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, n, w, i, wordnum = 0, charnum = 0;\n  char word[50][20] = {0};\n  char s[1000] = {0}, o[20] = {0}, a[20] = {0};\n\n  cin >> s;\n\n  cin >> o;\n\n  cin >> a;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      word[wordnum][charnum] = s[i];\n      charnum++;\n    }\n    if (s[i] == ' ') {\n      wordnum++;\n      charnum = 0;\n    }\n  }\n  w = wordnum;\n  for (wordnum = 0; wordnum <= w; wordnum++) {\n    if (strcmp(o, word[wordnum]) == 0) {\n      strcpy(word[wordnum], a);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (wordnum = 1; wordnum <= w; wordnum++)\n    printf(\" %s\", word[wordnum]);\n  return 0;\n}\n"}
{"label": "19", "index": "34852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], x[200] = \" \";\n  int i = 0, j = 0, k = 0, count = 0, ls, la, lb, l, end = 0;\n  cin.getline(s, 200);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  ls = strlen(s), la = strlen(a), lb = strlen(b);\n  while (i < ls) {\n    count = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        break;\n      else\n        count++;\n    }\n    if ((count != la) || (i != 0 && count == la && s[i - 1] != ' ')) {\n      x[k] = s[i];\n      k++, i++;\n    } else {\n      i = i + la;\n      end = k + lb;\n      for (; k < end; k++) {\n        x[k] = b[k - end + lb];\n      }\n    }\n  }\n  cout << x;\n}\n"}
{"label": "19", "index": "34853", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  char result[200];\n  char f[200], r[200];\n\n  cin >> ch;\n  scanf(\"%s %s \", f, r);\n\n  ch[strlen(ch) + 1] = 0;\n  ch[strlen(ch)] = ' ';\n\n  memset(result, 0, 200);\n  int last = 0;\n  for (int i = 0; i < strlen(ch); i++) {\n    if (ch[i] == ' ') {\n      ch[i] = 0;\n      char *p = ch + last;\n      if (strcmp(p, f) == 0)\n        sprintf(result, \"%s %s\", result, r);\n      else {\n        sprintf(result, \"%s %s\", result, p);\n      }\n      last = i + 1;\n      ch[i] = ' ';\n    }\n  }\n  printf(\"%s\\n\", result + 1);\n  return 0;\n}\n"}
{"label": "19", "index": "34854", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], sz[51][101], a[101], b[101];\n  int i, j, k, n;\n  int max = 0, min = 0;\n\n  cin >> s;\n  n = strlen(s);\n  for (i = 0, k = 0; i < n; i++) {\n    for (j = 0; s[i] != ' ' && i < n; i++, j++) {\n      sz[k][j] = s[i];\n    }\n    sz[k][j] = '\u0000';\n    k++;\n  }\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(sz[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", sz[i]);\n    }\n    printf(\" \");\n  }\n  if (strcmp(sz[k - 1], a) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", sz[k - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[100], s2[10], s3[10];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  char s4[10];\n  int a, b = 0;\n  a = strlen(s1);\n  for (int i = 0; i < a; i++) {\n    if (s1[i] != ' ') {\n      if (i != a - 1) {\n        s4[b] = s1[i];\n        b++;\n      }\n      if (i == a - 1) {\n        s4[b] = s1[i];\n        s4[b + 1] = '\u0000';\n        if (strcmp(s4, s2) == 0) {\n          cout << s3;\n        } else {\n          printf(\"%s\", s4);\n        }\n      }\n    } else {\n      s4[b] = '\u0000';\n      b = 0;\n      if (strcmp(s4, s2) == 0) {\n        printf(\"%s \", s3);\n      } else {\n        printf(\"%s \", s4);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34856", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101];\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char word[100][100];\n\n  int i, j = 0, n = 0, flag = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == ' ') {\n      flag = 0;\n    } else {\n      if (flag == 0) {\n        flag = 1;\n        n++;\n      }\n    }\n  }\n  int count = 0;\n  int count1[100];\n  for (i = 0; i < n; i++) {\n    count1[i] = 0;\n    do {\n      word[i][j - count] = s[j];\n      count1[i]++;\n      j++;\n    } while (s[j] != ' ' && s[j] != '\\0');\n    count1[i]++;\n    word[i][j - count] = '\\0';\n    j++;\n    count = count + count1[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], a) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << word[i] << \" \";\n  }\n  cout << word[n - 1];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34857", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  cin >> b;\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n    d[j] = '\\0';\n  }\n  printf(\"%s\\n\", d);\n  return 0;\n}\n"}
{"label": "19", "index": "34858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar sen[200], a[100], b[100], re[400];\nint alen, blen;\n\nint test(int n) {\n  int j = 0;\n  char *p1, *p2;\n  p1 = sen + n;\n  p2 = a;\n  if (n != 0) {\n    if (*(p1 - 1) != ' ')\n      return 0;\n  }\n  do {\n    if (*p1 != *p2) {\n      j = 1;\n    }\n    p1++;\n    p2++;\n  } while (p2 - a < alen);\n  if (*p1 != ' ' && *p1 != '\u0000')\n    return 0;\n  if (j == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n\n  int l;\n  char *write = re;\n  const char *read = sen;\n\n  cin >> sen;\n\n  cin >> a;\n\n  cin >> b;\n  alen = strlen(a);\n  blen = strlen(b);\n  for (; read - sen < 200; read++) {\n    if (test(read - sen) == 1) {\n\n      for (l = 0; l < blen; l++) {\n        *(write + l) = b[l];\n      }\n      write += blen;\n      read += alen - 1;\n    } else {\n      *write = *read;\n      write++;\n    }\n  }\n\n  cout << re;\n}\n"}
{"label": "19", "index": "34859", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1, len2, len3;        \n  char a[100], b[100], c[100]; \n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  int i, j = 0, m, n, k, space[100]; \n  space[0] = 0;\n  for (i = 0; i < len1; i++)\n    if (a[i] == ' ') {\n      j = j + 1;\n      space[j] = i + 1; \n                        \n    }\n  for (i = 0; i < j; i++) \n  {\n    k = 0;\n    for (m = space[i]; m < space[i] + len2; m++) \n    {\n      if (a[m] == b[m - space[i]])\n        k = k + 1; \n    }\n    if (k == len2 && a[space[i] + len2] == ' ')\n      \n      cout << c << ' ';\n    else \n    {\n      for (n = space[i]; n < space[i + 1]; n++)\n        cout << a[n];\n    }\n  }\n  k = 0;\n  for (i = space[j]; i < len1; i++) \n    if (a[i] == b[i - space[j]])\n      k = k + 1;\n  if (k == len2 && len1 - space[j] == len2) \n    cout << c;\n  else {\n    for (n = space[j]; n < len1; n++)\n      cout << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34860", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[20][100] = {0}, a[100] = {0}, b[100] = {0}, c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, m = 0;\n  for (i = 0; i < 20; i++) \n  {\n    cin >> s[i];\n    c = getchar();\n    if (c == '\\n') {\n      m = i;\n      break;\n    }\n  }\n  cin >> a;\n  cin >> b;\n  n1 = strlen(a);\n  for (i = 0; i <= m; i++) \n  {\n    n2 = 0;\n    for (j = 0; j < n1; j++) {\n      if (s[i][j] == a[j])\n        n2 = n2 + 1;\n      else\n        n2 = n2;\n    }\n    if (n1 != n2)\n      continue;\n    for (j = 0; j < 100; j++) {\n      s[i][j] = b[j];\n    }\n  }\n  cout << s[0];\n  for (i = 1; i <= m; i++) \n  {\n    cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34861", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], s[100];\n  int a, b, c, i, n, j, k, q = 1;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  a = strlen(s1);\n  b = strlen(s2);\n  c = strlen(s3);\n  strcpy(s, s1);\n  for (i = 0; i < a; i++) {\n\n    for (j = 0; j < b; j++) {\n      if (s[i + j] != s2[j])\n        break;\n    }\n    if ((j == b) && ((s[i - 1] == ' ') || (i == 0))) {\n\n      for (k = i; k < i + c; k++)\n        s[k] = s3[k - i];\n      for (k = i + c; k + (b - c) * q < a; k++)\n        s[k] = s1[k + (b - c) * q];\n      s[a + (c - b) * q] = 0;\n\n      q++;\n    }\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "34862", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[20][20], a[20], b[20], *p1, *p2, *p[20];\n  int i = 0, j;\n  for (i = 0; i < 20; i++)\n    p[i] = str[i];\n  i = 0;\n  while (1) {\n    cin >> str[i];\n    if (getchar() == '\\n')\n      break;\n    i++;\n  }\n  scanf(\"%s%s\", a, b);\n  p1 = a;\n  p2 = b;\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], p1) == 0)\n      p[j] = p2;\n\n  for (j = 0; j <= i; j++) {\n    if (j == 0)\n      printf(\"%s\", p[j]);\n    else\n      printf(\" %s\", p[j]);\n  }\n}\n"}
{"label": "19", "index": "34863", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[100][100] = {'\\0'}, c = '\\0', alter[100] = {'\\0'},\n       alter0[100] = {'\\0'};\n  int i = 0, j = 0, sum;\n  while (c != '\\n') {\n    c = getchar();\n    while (c != ' ' && c != '\\n') {\n      word[i][j] = c;\n      c = getchar();\n      j++;\n    }\n    i++;\n    j = 0;\n  }\n  sum = i;\n  cin.getline(alter0, 100, '\\n');\n  cin.getline(alter, 100, '\\n');\n  for (i = 0; i < sum; i++) {\n    j = 0;\n    while (alter0[j] == word[i][j] && j <= 99) {\n      j++;\n    }\n    if (j == 100) {\n      for (j = 0; j < 100; j++) {\n        word[i][j] = alter[j];\n      }\n    }\n  }\n  for (i = 0; i < sum - 1; i++) {\n    cout << word[i] << ' ';\n  }\n  printf(\"%s\", word[sum - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k = 0, m = 0;\n  char s[1000], a[101], b[101];\n  char word[30][101];\n  cin.getline(s, 1000);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != ' ') {\n      word[k][m] = s[i];\n      m++;\n    } else {\n      word[k][m] = '\\0';\n      k++;\n      m = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    cout << word[i] << ' ';\n  cout << word[k];\n  cin >> k;\n  return 0;\n}\n"}
{"label": "19", "index": "34865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[300] = {'\u0000'}, w1[100], w2[100];\n  char *p, *q;\n\n  cin >> str;\n\n  cin >> w1;\n\n  cin >> w2;\n  p = str;\n  q = str;\n  while (*p != ' ')\n    p++;\n\n  *p = '\u0000';\n\n  if (strcmp(q, w1) == 0) {\n    printf(\"%s\", w2);\n  } else {\n    printf(\"%s\", q);\n  }\n  p++;\n  q = p;\n\n  while (*p != '\u0000') {\n    p++;\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *p = '\u0000';\n\n      printf(\" \");\n      if (strcmp(q, w1) == 0) {\n        printf(\"%s\", w2);\n      } else {\n        printf(\"%s\", q);\n      }\n\n      p++;\n      q = p;\n    }\n  }\n}\n"}
{"label": "19", "index": "34866", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  int len = strlen(str);\n  char **temp = (char **)malloc(len * sizeof(int *));\n  int i, j = 0, k = 0;\n  for (i = 0; i < len; i++)\n    temp[i] = (char *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    if (i == len - 1)\n      temp[j][k + 1] = 0;\n    if (str[i] != ' ') {\n      temp[j][k] = str[i];\n      k++;\n    } else {\n      temp[j][k] = 0;\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(temp[i], str1) == 0)\n      strcpy(temp[i], str2);\n  }\n\n  for (i = 0; i <= j - 1; i++) {\n    cout << temp[i];\n    printf(\" \");\n  }\n\n  printf(\"%s\", temp[j]);\n\n  for (i = 0; i < len; i++)\n    free(temp[i]);\n  free(temp);\n  return (0);\n}\n"}
{"label": "19", "index": "34867", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sentence[101];\n  char word[20];\n  char subWord[20];\n  cin.getline(sentence, 100);\n  cin.getline(word, 20);\n  cin.getline(subWord, 20);\n  int i, lenOfSen = 0, lenOfWord = 0, lenOfsubWord = 0;\n  int left[100], right[100];\n  int found = 0;\n  for (i = 0; i < 100; i++) {\n    if (sentence[i] != '\\0') {\n      lenOfSen++;\n    }\n    if (sentence[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (word[i] != '\\0') {\n      lenOfWord++;\n    }\n    if (word[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (subWord[i] != '\\0') {\n      lenOfsubWord++;\n    }\n    if (subWord[i] == '\\0') {\n      break;\n    }\n  }\n  \n  for (i = 0; i < lenOfSen; i++) {\n    if (sentence[i] == word[0]) {\n      if (i == 0 || sentence[i - 1] == ' ') {\n\n        left[found] = i;\n        int j;\n        for (j = 1; j < lenOfWord; j++) {\n          if (sentence[i + j] != word[j]) {\n            break;\n          }\n        }\n        if (j == lenOfWord) {\n          if (i + j == lenOfSen || sentence[i + j] == ' ') {\n\n            right[found] = i + j;\n            found++;\n          }\n        }\n      }\n    }\n  }\n  \n  char newString[200];\n  int k = 0;\n  if (found == 0) {\n    cout << sentence << endl;\n  } else {\n    int t = 0;\n    for (i = 0; i < lenOfSen; i++) {\n      if (i == left[t]) {\n        for (int j = 0; j < lenOfsubWord; j++) {\n          newString[k++] = subWord[j];\n        }\n        i = right[t];\n        if (t < found)\n          t++;\n      }\n      newString[k++] = sentence[i];\n    }\n    newString[k] = '\\0';\n    cout << newString << endl;\n  }\n}\n"}
{"label": "19", "index": "34868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[103], b[103];\n  int i, j, k, p, l, m, n, num, h = 0;\n\n  cin >> s;\n  l = strlen(s);\n\n  cin >> a;\n  m = strlen(a);\n\n  cin >> b;\n  n = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    num = 0;\n    if (s[i] == a[0]) {\n      num = 1;\n      for (j = 1; a[j] != '\u0000'; j++)\n        if (s[i + j] == a[j])\n          num++;\n      if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n >= m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[l - 1 + n - m - k] = s[l - 1 - k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      } else if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n < m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[n + i + k] = s[m + i + k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      }\n      l = l + i;\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "34869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p[100], *a, *b;\n  char c;\n  int i, n;\n  for (i = 0; i <= 100; i++) {\n    p[i] = (char *)malloc(100);\n  }\n  for (i = 0, n = 0;; i++) {\n    scanf(\"%s\", p[i]);\n    n++;\n    if ((c = getchar()) == ' ')\n      break;\n  }\n  a = (char *)malloc(10);\n  b = (char *)malloc(10);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; i < n; i++) {\n    if (strcmp(p[i], a) == 0)\n      strcpy(p[i], b);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i]);\n    if (i != n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], d[100], b[100][50];\n  int i, j = 0, k = 0, n, m, l;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", d);\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      b[j][k] = s[i];\n      k++;\n    } else {\n      b[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  b[j][k] = '\u0000';\n  for (m = 0; m < j + 1; m++) {\n    l = strcmp(a, b[m]);\n    if (l == 0)\n      strcpy(b[m], d);\n    if (m == 0)\n      cout << b[m];\n    else\n      cout << \" \" << b[m];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34871", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[210] = {0}, a[100], b[100];\n  int ls, la, i, j, k, g = 0, lb;\n\n  scanf(\"%s \", s);\n  scanf(\"%s %s \", a, b);\n  la = strlen(a);\n  ls = strlen(s);\n  lb = strlen(b);\n  if (la <= ls) {\n    for (j = 0; j <= ls - la; j++) {\n      if ((j == 0) || (s[j - 1] < 65)) {\n        for (k = 0; k < la; k++) {\n          if (a[k] == s[j + k])\n            g++;\n        }\n        if (g == la) {\n          if (lb >= la) {\n            for (i = ls + lb - la - 1; i >= j + lb; i--)\n              s[i] = s[i - lb + la];\n          } else {\n            for (i = j + lb; i < ls + lb - la; i++)\n              s[i] = s[i - lb + la];\n            for (i = ls + lb - la; i < ls; i++)\n              s[i] = 0;\n          }\n          for (i = 0; i < lb; i++)\n            s[i + j] = b[i];\n          j = j + lb - 1;\n        }\n      }\n      g = 0;\n      ls = strlen(s);\n    }\n  }\n  ls = strlen(s);\n  for (i = 0; i < ls; i++)\n    printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34872", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word_in[200], word_tr[200], word_out[200], word_fil[200];\n  for (int i = 0; i < 200; i++) {\n    word_in[i] = 0;\n    word_tr[i] = 0;\n    word_out[i] = 0;\n    word_fil[i] = 0;\n  }\n  int lg1, lg2, lg3, lg4, sum = 0, t = 0;\n  cin.getline(word_in, 200);\n  lg1 = strlen(word_in);\n  word_in[lg1] = ' ';\n  cin.getline(word_tr, 200);\n  lg2 = strlen(word_tr);\n  cin.getline(word_out, 200);\n  lg3 = strlen(word_out);\n  for (int i = 0; i < 200; i++) {\n    sum = 0;\n    for (int j = 0; j < lg2; j++) {\n      if (word_in[i + j] == word_tr[j]) {\n        sum = sum + 1;\n      }\n    }\n    if ((word_in[i - 1] == ' ' || i == 0) && word_in[i + lg2] == ' ' &&\n        sum == lg2) {\n      if (lg3 == lg2) {\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg2;\n      }\n      if (lg3 < lg2) {\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        for (int j = lg3; j < lg2; j++) {\n          word_in[i + j] = ' ';\n        }\n        i = i + lg2;\n      }\n      if (lg3 > lg2) {\n        for (int j = 199; j >= i + lg2; j--) {\n          word_in[j + lg3 - lg2] = word_in[j];\n        }\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg3;\n      }\n    }\n  }\n  for (int i = 0; i < 200; i++) {\n    if (word_in[i] != ' ') {\n      word_fil[t] = word_in[i];\n      t++;\n    }\n    if (word_in[i] == ' ') {\n      if (word_in[i + 1] != ' ') {\n        word_fil[t] = word_in[i];\n        t++;\n      }\n    }\n  }\n  lg4 = strlen(word_fil);\n  for (int i = 0; i < lg4 - 1; i++) {\n    cout << word_fil[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34873", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], r[50][20] = {0};\n  int i = 0, j, c = 0, l;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  while (i <= l - 1) {\n    j = 0;\n    c++;\n    while (s[i] != ' ' && i <= l - 1) {\n      r[c][j] = s[i];\n      j++;\n      i++;\n    }\n    i++;\n  }\n  for (i = 1; i <= c - 1; i++) {\n    if (strcmp(r[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", r[i]);\n    }\n  }\n  if (strcmp(r[c], a) == 0) {\n    cout << b;\n  } else {\n    printf(\"%s\", r[c]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[150], a[100], b[100], *p, *q;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  q = s;\n  while (strstr(q, a) != NULL) {\n    p = strstr(q, a);\n    *p = '\u0000';\n    if ((*(p - 1) != ' ') && ((p - 1) > s) ||\n        (*(p + strlen(a)) != ' ') && (p + strlen(a) < s + strlen(s)))\n      cout << q << a;\n    else\n      printf(\"%s%s\", q, b);\n    p += strlen(a);\n    q = p;\n  }\n  cout << q;\n  return 0;\n}\n"}
{"label": "19", "index": "34875", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], x[101] = {0};\n  int i, j, n, m;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == a[0] && s[i - 1] == ' ') || s[0] == a[0]) {\n      for (j = 0; j < n; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (n == j)\n        x[i] = 1;\n    }\n  }\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (x[i] == 0)\n      printf(\"%c\", s[i]);\n    else if (x[i] == 1) {\n      for (j = 0; j < m; j++) {\n        printf(\"%c\", b[j]);\n      }\n      i += n - 1;\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34876", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {\"\\0\"}, a[100] = {\"\\0\"}, b[100] = {\"\\0\"};\n  int i, j, x = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      cin.get(s[i][j]);\n      if (s[i][j] == 32) {\n        s[i][j] = 0;\n        j = 100;\n      } else if (s[i][j] == 10) {\n        s[i][j] = 0;\n        j = i = 100;\n      }\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(a[j]);\n    if (a[j] == 32 || a[j] == 10) {\n      a[j] = 0;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(b[j]);\n    if (b[j] == 32 || b[j] == 10) {\n      b[j] = 0;\n      break;\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (a[j] == s[i][j])\n        x = x + 1;\n    }\n    if (x == 100)\n      for (j = 0; j < 100; j++)\n        s[i][j] = b[j];\n    else\n      x = 0;\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (s[i][j] != 0 && s[i][j + 1] == 0 && s[i + 1][0] != 0)\n        printf(\"%c \", s[i][j]);\n      else if (s[i][j] != 0)\n        cout << s[i][j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i = 0, n;\n  char *s[100];\n  s[0] = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n    s[i] = (char *)malloc(100 * sizeof(char));\n  }\n  n = i;\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(*(s + i), *(s + n - 2)) == 0)\n      strcpy(*(s + i), *(s + n - 1));\n    if (i != n - 3)\n      printf(\"%s \", *(s + i));\n    else\n      cout << *(s + i);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34878", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20][20] = {'\\0'}, str2[20], str3[20];\n  int num = 0, j = 0, i;\n  cin.getline(str, 100);\n  cin.getline(str2, 20);\n  cin.getline(str3, 20);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str1[num][j++] = str[i];\n    }\n\n    if (str[i] == ' ') {\n      num++;\n      j = 0;\n    }\n  }\n  num = num + 1;\n  for (i = 0; i < num; i++) {\n    if (strcmp(str1[i], str2) == 0) {\n      strcpy(str1[i], str3);\n    }\n  }\n  for (i = 0; i < num - 1; i++) {\n    cout << str1[i] << \" \";\n  }\n  printf(\"%s\\n\", str1[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34879", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char words[100][100];\n  char ti[100], bt[100];\n  int i, j, k, n;\n  int a[200];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", ti);\n  scanf(\"%s\", bt);\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n; i++) {\n    if (strcmp(ti, words[i]) == 0)\n      strcpy(words[i], bt);\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%s\", words[0]);\n    else\n      cout << \" \" << words[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34880", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, old[100] = {0}, by[100] = {0}, a1[100] = {0};\n  int s1, s2, s3, i, j, k, l = 1, mark[100] = {0};\n  int rem[10] = {0};\n\n  cin >> a;\n  cin >> old;\n  cin >> by;\n  s1 = strlen(a);\n  s2 = strlen(old);\n  s3 = strlen(by);\n  for (i = 0; i < s1; i++) {\n    k = 0;\n    if ((a[i - 1] == ' ' || i == 0) && ((i + s2 == s1) || a[i + s2] == ' ')) {\n      for (j = i; j < i + s2; j++) {\n        if (a[j] == old[j - i]) {\n          k += 1;\n        }\n      }\n      if (k == s2) {\n        for (j = i; j < i + s2; j++)\n          mark[j] = 1;\n        cout << by;\n      }\n    }\n    if (mark[i] > 0)\n      continue;\n    printf(\"%c\", a[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34881", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid swap(char *str, char *a, char *b) {\n  char *p1 = str, *p2 = a;\n  int len1, len2, len3, n, i = 0, j, k, m;\n  len1 = strlen(str);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  n = len3 - len2;\n  while (*p1 != '\u0000') {\n    if ((*p1 == *p2) && (!isalpha(*(p1 - 1))))\n      while ((*p1 == *p2) && (*p2 != '\u0000')) {\n        p1++, p2++;\n        i++;\n      }\n    else {\n      p1++;\n      i++;\n    }\n    if ((*p2 == '\u0000') && isalpha(*p1) == 0) {\n      if (n < 0) {\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        for (m = i; m < len1; m++)\n          str[j++] = str[m];\n        while (j < len1)\n          str[j++] = '\u0000';\n        len1 = strlen(str);\n      } else {\n\n        for (m = len1 + n; m > i; m--)\n          str[m] = str[len1--];\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        len1 = strlen(str);\n      }\n    }\n    p2 = a;\n  }\n}\nint main() {\n  char str[1000], a[200], b[200];\n\n  cin >> str;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  swap(str, a, b);\n  puts(str);\n}\n"}
{"label": "19", "index": "34882", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[120];\n  char r[104], f[104];\n  int i, j, k;\n  int nc, nr, nf;\n\n  cin >> c;\n  nc = strlen(c);\n\n  cin >> r;\n  nr = strlen(r);\n\n  cin >> f;\n  nf = strlen(f);\n  i = 0;\n  while (i < nc) {\n    while ((i < nc) && (c[i] == ' ')) {\n      printf(\"%c\", c[i]);\n      i++;\n    }\n    j = i;\n    while ((j < nc) && (c[j] != ' ')) {\n      j++;\n    }\n    k = 0;\n    while ((i + k < nc) && (k < nr) && (c[i + k] == r[k])) {\n      k++;\n    }\n    if ((k == nr) && (i + k == j)) {\n      printf(\"%s\", f);\n    } else {\n      for (k = i; k < j; k++)\n        printf(\"%c\", c[k]);\n    }\n    i = j;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], a[100], b[100];\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(str);\n  char words[100][100] = {0};\n  for (k = 0; k < n; k++) {\n    if (str[k] != 32) {\n      words[i][j] = str[k];\n      j++;\n    } else if (str[k] == 32) {\n      i++;\n      j = 0;\n    }\n  }\n  m = i + 1;\n  for (i = 0; i < m; i++) {\n    if (strcmp(words[i], a) == 0)\n      strcpy(words[i], b);\n    else\n      continue;\n  }\n  for (i = 0; i < m - 1; i++)\n    cout << words[i] << \" \";\n  printf(\"%s \", words[m - 1]);\n}\n"}
{"label": "19", "index": "34884", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[300], a[50][20], t[20], word1[20], word2[20];\n  int i, j = 0, k = 0, num, p1, p2, q1, q2;\n\n  cin >> str;\n\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == ' ' || str[i] == ',') {\n      a[j][k] = 0;\n      j++;\n      k = 0;\n    } else {\n      a[j][k] = str[i];\n      k++;\n    }\n  }\n\n  a[j][k] = 0;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  for (k = 0; k < j + 1; k++) {\n    if (strcmp(word1, a[k]) == 0)\n\n      strcpy(a[k], word2);\n  }\n\n  for (k = 0; k < j + 1; k++) {\n    if (strlen(a[k]) != 0) {\n      if (k == 0)\n\n        printf(\"%s\", a[k]);\n      else\n        printf(\" %s\", a[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n\n  cin >> q;\n\n  cin >> a;\n\n  cin >> b;\n  int i = 0, j = 0, k = 0, s = 0, p = 0;\n  for (i = 0; i < 100; i++) {\n    if (q[i] != ' ') {\n      xc[j][i - k] = q[i];\n    }\n    if (q[i] == ' ') {\n      j++;\n      k = i + 1;\n    }\n  }\n  for (s = 0; s < j + 1; s++) {\n    if (strcmp(xc[s], a) == 0) {\n      strcpy(xc[s], b);\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s \", xc[p]);\n  }\n  printf(\"%s\", xc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34886", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100], zfc2[20][100];\n  int len, i, t = 1, lenall, judge = 1, num[100], k = 1;\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", in);\n  cin >> out;\n  len = strlen(in);\n  lenall = strlen(zfc);\n  num[0] = 0;\n  for (i = 0; i < lenall; i++) {\n    if (zfc[i] == ' ') {\n      num[k] = i + 1;\n      zfc[i] = 0;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++)\n    strcpy(zfc2[i], &zfc[num[i]]);\n\n  for (i = 0; i < k; i++) {\n    if (strcmp(&zfc[num[i]], in) == 0) {\n      strcpy(zfc2[i], out);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", zfc2[i]);\n  }\n  printf(\"%s\", zfc2[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34887", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar z[10000];\nchar a[10000];\nchar b[10000];\nchar temp[10000];\n\nint main() {\n  int i, j;\n\n  cin >> z;\n  cin >> a >> b;\n\n  int length = strlen(z);\n  for (i = 0; i < length; i++) {\n    while (z[i] == ' ') {\n      cout << ' ';\n      i++;\n    }\n    int k = 0;\n    for (j = i; j < length; j++) {\n      if (z[j] != ' ') {\n        temp[k++] = z[j];\n      } else\n        break;\n    }\n    temp[k] = '\u0000';\n    if (strcmp(temp, a) == 0) {\n      cout << b;\n    } else\n      cout << temp;\n\n    i = j;\n    i--;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34888", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[120], s0[120];\n  char a[20], b[20];\n  int k = 1, ls;\n  cin.getline(s, 100, '\\n');\n  cin >> a >> b;\n  for (int i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    ls = strlen(s);\n    if (s[i] == a[0] && (s[i + strlen(a)] == 32 || s[strlen(a) + i] == '\\0') &&\n        (i == 0 || s[i - 1] == 32)) {\n      for (int j = 1; j < strlen(a); j++)\n        if (s[i + j] != a[j]) {\n          k = 0;\n          continue;\n        }\n    } else\n      k = 0;\n    if (k == 1) {\n      for (int g = 0; g < i; g++)\n        s0[g] = s[g];\n      for (int n = i + strlen(a); n < strlen(s); n++)\n        s0[n - strlen(a) + strlen(b)] = s[n];\n      for (int m = 0; m < strlen(b); m++)\n        s0[i + m] = b[m];\n      for (int c = 0; c < ls - strlen(a) + strlen(b); c++)\n        s[c] = s0[c];\n      s[ls - strlen(a) + strlen(b)] = '\\0';\n      i += strlen(b) - 1;\n    }\n    k = 1;\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char x[100][100];\n  int i, t = 1, j = 1, y, z, q, p, m;\n  for (q = 0; q <= 99; q++) {\n    for (p = 0; p <= 99; p++) {\n      x[q][p] = '\u0000';\n    }\n  }\n  for (i = 0; i <= 99; i++) {\n    if (s[i] == ' ')\n      break;\n    else\n      x[0][i] = s[i];\n  }\n  do {\n    if (s[t] == ' ') {\n      z = t;\n      for (y = 0; y <= 99; y++) {\n        z++;\n        if (s[z] != ' ' && s[z] != '\u0000')\n          x[j][y] = s[z];\n        else\n          break;\n      }\n      j++;\n    }\n    t++;\n  } while (t <= 99);\n  for (i = 0; i <= 99; i++) {\n    if (strcmp(x[i], a) == 0)\n      strcpy(x[i], b);\n  }\n  for (m = 0; m <= 99; m++) {\n    if (x[m][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (i == 0)\n      printf(\"%s\", x[i]);\n    else\n      printf(\" %s\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34890", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zifu[101], word[100][20] = {\" \"}, x[20], y[20];\n  int n, i, j, s, t = 0, p = 0, num;\n\n  cin >> zifu;\n\n  cin >> x;\n\n  cin >> y;\n  n = strlen(zifu);\n  for (i = 0; i < n; i++) {\n    if (zifu[i] != ' ') {\n      word[t][p] = zifu[i];\n      p++;\n    } else if (zifu[i] == ' ') {\n      p = 0;\n      t++;\n    }\n    num = t + 1;\n  }\n  for (i = 0; i < num; i++) {\n    if (!strcmp(word[i], x)) {\n      strcpy(word[i], y);\n    }\n  }\n  cout << word[0];\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34891", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n\n  scanf(\"%s \", q);\n\n  cin >> a;\n\n  cin >> b;\n  int i = 0, j = 0, k = 0, s = 0, p = 0;\n  for (i = 0; i < 100; i++) {\n    if (q[i] != ' ') {\n      xc[j][i - k] = q[i];\n    }\n    if (q[i] == ' ') {\n      j++;\n      k = i + 1;\n    }\n  }\n  for (s = 0; s < j + 1; s++) {\n    if (strcmp(xc[s], a) == 0) {\n      strcpy(xc[s], b);\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s \", xc[p]);\n  }\n  printf(\"%s\", xc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34892", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[200], a[100], b[100];\n  int l, result = 0, i, j, l1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    result = 0;\n    if ((i == 0) || (s[i - 1] == ' ')) {\n      result = 1;\n      for (j = i; j <= i + (l1 - 1); j++) {\n        if (s[j] != a[j - i])\n          result = 0;\n      }\n    }\n    if (result == 1) {\n      printf(\"%s\", b);\n      i = i + l1 - 1;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, n;\n\n  char s[120];\n  char word[120];\n  char a[120];\n  char b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != ' ' && s[i] != '\u0000'; i++) {\n    word[i] = s[i];\n  }\n  word[i] = '\u0000';\n  if (strcmp(word, a) == 0) {\n\n    printf(\"%s\", b);\n  } else\n    printf(\"%s\", word);\n  n = i;\n  while (s[i] != '\u0000') {\n    i++;\n\n    for (; s[i] != ' ' && s[i] != '\u0000'; i++) {\n      word[i - n - 1] = s[i];\n    }\n\n    word[i - n - 1] = '\u0000';\n    if (strcmp(word, a) == 0) {\n\n      printf(\" %s\", b);\n    } else\n      printf(\" %s\", word);\n\n    n = i;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char s[101], a[101], b[101], word[100][101];\n  int n, k, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(word[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(word[n], (s + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, word[i]) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", word[i]);\n  }\n\n  printf(\"%s\", word[n - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zj[100][100];\n  int i = 0, k, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    k = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      zj[t][k] = s[i];\n      k++;\n      i++;\n    }\n    zj[t][k] = '\u0000';\n    while (s[i] == ' ')\n      i++;\n\n    t++;\n  }\n  zj[t][k + 1] = '\u0000';\n  for (i = 0; i < t; i++) {\n\n    if (strcmp(zj[i], a) == 0) {\n      strcpy(zj[i], b);\n    }\n  }\n  for (i = 0; i < t - 1; i++) {\n    printf(\"%s \", zj[i]);\n  }\n  cout << zj[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34896", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *q, *temp1, *temp2;\n  int i, j = 0, len, lenb, k, flag = 1, head = 0, tail = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  temp1 = (char *)malloc(200 * sizeof(char));\n  temp2 = (char *)malloc(200 * sizeof(char));\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  len = strlen(s);\n  lenb = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (*(s + i) != ' ') {\n      if (flag == 1) {\n        head = i;\n        flag = 0;\n      }\n      *(temp1 + j) = *(s + i);\n      j++;\n    } else {\n      q = s + i;\n      tail = i;\n      flag = 1;\n      *(temp1 + j) = '\u0000';\n      j = 0;\n      if (!strcmp(temp1, a)) {\n        strcpy(temp2, q);\n        for (k = 0; k < lenb; k++)\n          *(s + head + k) = *(b + k);\n        *(s + head + k) = '\u0000';\n        strcat(s, temp2);\n      }\n      strcpy(temp1, \"\u0000\");\n      strcpy(temp2, \"\u0000\");\n    }\n  }\n  *(temp1 + j) = '\u0000';\n  if (!strcmp(temp1, a)) {\n\n    for (k = 0; k < lenb; k++)\n      *(s + head + k) = *(b + k);\n    *(s + head + k) = '\u0000';\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34897", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100][100];\n  int k = 0, y = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (int i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      t[k][i] = '\u0000';\n      k++;\n      y = i + 1;\n    } else\n      t[k][i - y] = s[i];\n  }\n  for (int j = 0; j <= k; j++) {\n    if (strcmp(t[j], a) == 0)\n      strcpy(t[j], b);\n  }\n  for (int x = 0; x < k; x++)\n    printf(\"%s \", t[x]);\n  printf(\"%s\", t[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "34898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l = 0, k = 0, m[100], str1, str2, str3;\n  char a[1000], b[100], c[1000];\n  cin.getline(a, 1000);\n  cin.getline(b, 100);\n  cin.getline(c, 1000);\n  str1 = strlen(a);\n  str2 = strlen(b);\n  str3 = strlen(c);\n  for (i = 0; i < str1; i++) {\n    for (j = 0; j < str2; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      }\n      if (j == str2 - 1 && (a[i - 1] == ' ' || i == 0)) {\n        m[k] = i;\n        k++;\n      }\n    }\n  }\n  k = 0;\n  for (i = 0; i < str1; i++) {\n    if (m[k] == i) {\n      l++;\n      k++;\n      i += str2 - 1;\n      for (j = 0; j < str3; j++) {\n        cout << c[j];\n      }\n    } else {\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main(void) {\n  int x, i, k = 0;\n  char str[100];\n  char temp[100];\n  char in[100];\n  char out[100];\n  char *str0;\n\n  cin >> str;\n\n  cin >> in;\n\n  cin >> out;\n  str0 = str;\n  x = strlen(str);\n  for (i = 0; i < x; i++) {\n    if (*(str0 + i) != ' ' && i != x - 1) {\n      temp[k] = *(str0 + i);\n      k++;\n    } else if (*(str0 + i) == ' ' && i != x - 1) {\n      temp[k] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n      k = 0;\n    } else if (i == x - 1) {\n      temp[k] = *(str0 + i);\n      temp[k + 1] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else\n        cout << temp << \" \";\n    }\n  }\n  return (0);\n}\n"}
{"label": "19", "index": "34900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int length_s, length_a, length_b, i, j, k;\n  char s[128], a[128], b[128];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  length_s = strlen(s);\n  length_a = strlen(a);\n\n  for (i = 0; i < length_s; i++) {\n    j = 0;\n    if (s[i] == a[j] && (i == 0 || s[i - 1] == ' ')) {\n      k = i;\n      while (s[i] == a[j] && s[i] > 0) {\n        j++;\n        i++;\n      }\n\n      if (j == length_a) {\n        printf(\"%s\", b);\n        i--;\n\n      }\n\n      else {\n        while (k <= i) {\n          printf(\"%c\", s[k]);\n          k++;\n        }\n      }\n\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101][101] = {0}, b[101], c[101];\n  int i, j;\n  for (j = 0;; j++) {\n    scanf(\"%s\", a[j]);\n\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; i < 101; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    printf(\" %s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34902", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p[100];\n  int i = 0, j;\n  *(p + i) = (char *)malloc(100);\n  while (scanf(\"%s\", *(p + i)) != EOF) {\n    i++;\n    *(p + i) = (char *)malloc(100);\n  }\n  for (j = 0; j < i - 2; j++) {\n    if (strcmp(*(p + j), *(p + i - 2)) == 0)\n      strcpy(*(p + j), *(p + i - 1));\n  }\n  printf(\"%s\", *p);\n  for (j = 1; j < i - 2; j++)\n    printf(\" %s\", *(p + j));\n}\n"}
{"label": "19", "index": "34903", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0;\n  char x, y, z, m = 0;\n  char a[100];\n  char b[100][100];\n  char c[100];\n  char d[100];\n\n  cin >> a;\n  scanf(\"%s\", &c);\n  cin >> d;\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ') {\n      j++;\n      m = 0;\n    } else {\n      b[j][m] = a[i];\n      m++;\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(b[i], c) == 0)\n      strcpy(b[i], d);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", b[i]);\n  }\n  printf(\"%s\", b[i]);\n}\n"}
{"label": "19", "index": "34904", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[103], word[103], rep[103], b[203], i, j;\n  cin.get(a, 101, '\\n');\n  cin >> word >> rep;\n  int wordlen = strlen(word), alen = strlen(a), replen = strlen(rep);\n  for (i = alen; i > 0; i--)\n    a[i] = a[i - 1];\n  a[0] = ' ';\n  a[alen + 1] = ' ';\n  a[alen + 2] = '\\0';\n  for (i = 1, j = 0; i < alen + 2; i++, j++) {\n    if (a[i - 1] == ' ' && a[i + wordlen] == ' ' &&\n        strncmp(a + i, word, wordlen) == 0) {\n      strcpy(b + j, rep);\n      i = i + wordlen - 1;\n      j = j + replen - 1;\n    } else\n      b[j] = a[i];\n  }\n  b[j - 1] = '\\0';\n  for (i = 0;; i++) {\n    if (b[i] != '\\0')\n      cout << b[i];\n    else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s[100], a[100], b[100], d[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (j = 0;; j += (i + 1)) {\n    for (i = 0; s[i + j] != ' ' && s[i + j] != 0; i++)\n      d[i] = s[i + j];\n    d[i] = '\u0000';\n    if (strcmp(a, d) == 0) {\n      if (s[i + j] == 0) {\n        printf(\"%s\", b);\n        break;\n      } else\n        printf(\"%s \", b);\n    } else if (s[i + j] == 0) {\n      printf(\"%s\", d);\n      break;\n    } else\n      cout << d << \" \";\n  }\n}\n"}
{"label": "19", "index": "34906", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n = 0, i, k, x, h = 0;\n  char a[100], b[10], c[10];\n\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  x = strlen(b);\n\n  for (i = 0; i < x; i++) {\n    if (a[i] != b[i])\n      break;\n    h++;\n  }\n  if (h == x) {\n    for (i = 0; i < x; i++)\n      a[i] = '0';\n    n = 1;\n  }\n\n  h = 0;\n  for (i = 1; a[i + 2] != '\u0000'; i++) {\n    h = 0;\n    if (a[i] == ' ')\n      for (k = 0; k < x; k++) {\n        if (a[i + k + 1] != b[k])\n          break;\n        h++;\n      }\n    if (h == x)\n      for (k = 0; k < x; k++)\n        a[i + k + 1] = '0';\n  }\n\n  if (n) {\n    printf(\"%s\", c);\n    for (i = x; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        cout << a[i];\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  }\n\n  else\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "34907", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, w, nw = 0, ns, na, nb, rem[102], flag, FLAG = 0;\n  char s[102], a[102], b[102];\n  int vest[102];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n  for (i = 0; i < ns; i++) {\n\n    if (s[i] != ' ' && FLAG == 0) {\n      FLAG = 1;\n      flag = 0;\n      for (k = i, j = 0; j < na; j++, k++) {\n        if (s[k] != a[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0 && (s[k] == ' ' || s[k] == '\u0000')) {\n        rem[nw] = i;\n        nw++;\n      }\n    } else {\n      FLAG = 0;\n    }\n  }\n  for (w = 0; w < nw; w++) {\n    if (nb == na) {\n      for (k = 0; k < na; k++) {\n        s[k + rem[w]] = b[k];\n      }\n    } else if (nb > na) {\n      ns = ns + nb - na;\n      s[ns] = '\u0000';\n      for (k = ns - 1; k > rem[w]; k--) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    } else {\n      ns = ns + nb - na;\n      for (k = rem[w] + 1; k < ns; k++) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    }\n  }\n  for (i = 0; i < ns; i++) {\n    printf(\"%c\", s[i]);\n  }\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "34908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[100], s2[10], s3[10];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  char s4[10];\n  int a, b = 0;\n  a = strlen(s1);\n  for (int i = 0; i < a; i++) {\n    if (s1[i] != ' ') {\n      if (i != a - 1) {\n        s4[b] = s1[i];\n        b++;\n      }\n      if (i == a - 1) {\n        s4[b] = s1[i];\n        s4[b + 1] = '\u0000';\n        if (strcmp(s4, s2) == 0)\n          printf(\"%s\", s3);\n        else {\n          printf(\"%s\", s4);\n        }\n      }\n    } else {\n      s4[b] = '\u0000';\n      b = 0;\n      if (strcmp(s4, s2) == 0) {\n        cout << s3 << \" \";\n      } else {\n        printf(\"%s \", s4);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[200], a[200], b[200], m[100][100];\n  int len, i, hang = 0, lie = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      m[hang][lie] = '\u0000';\n      hang++;\n      lie = 0;\n    } else {\n      m[hang][lie] = s[i];\n      lie++;\n    }\n    if (s[i + 1] == '\u0000') {\n      m[hang][lie] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= hang; i++) {\n    if (strcmp(a, m[i]) == 0)\n      strcpy(m[i], b);\n  }\n  for (i = 0; i < hang; i++)\n    printf(\"%s \", m[i]);\n  cout << m[hang];\n  return 0;\n}\n"}
{"label": "19", "index": "34910", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ini[101], former[101], latter[101], *p, *q = ini;\n\n  cin >> ini;\n\n  cin >> former;\n\n  cin >> latter;\n  for (p = ini;; p++)\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    } else if (*p == '\u0000') {\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      break;\n    }\n}\n"}
{"label": "19", "index": "34911", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  for (i = 0; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        cout << b;\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        printf(\"%c\", s[i]);\n      m = 0;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34912", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar sen[200], a[100], b[100], re[400];\nint alen, blen;\n\nint test(int n) {\n  int j = 0;\n  char *p1, *p2;\n  p1 = sen + n;\n  p2 = a;\n  if (n != 0) {\n    if (*(p1 - 1) != ' ')\n      return 0;\n  }\n  do {\n    if (*p1 != *p2) {\n      j = 1;\n    }\n    p1++;\n    p2++;\n  } while (p2 - a < alen);\n  if (*p1 != ' ' && *p1 != '\u0000')\n    return 0;\n  if (j == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n\n  int l;\n  char *write = re;\n  const char *read = sen;\n\n  cin >> sen;\n\n  cin >> a;\n\n  cin >> b;\n  alen = strlen(a);\n  blen = strlen(b);\n  for (; read - sen < 200; read++) {\n    if (test(read - sen) == 1) {\n\n      for (l = 0; l < blen; l++) {\n        *(write + l) = b[l];\n      }\n      write += blen;\n      read += alen - 1;\n    } else {\n      *write = *read;\n      write++;\n    }\n  }\n\n  printf(\"%s\", re);\n}\n"}
{"label": "19", "index": "34913", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++)\n    c[i] = s[i] = a[i] = '\u0000';\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int m;\n    char ch[101];\n    for (m = 0; m <= 100; m++)\n      ch[m] = '\u0000';\n    for (m = 0; m <= (n[i] - n[i - 1] - 2); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n    if (strcmp(a, ch) == 0)\n      strcat(s, b);\n    else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "34914", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[103], word[103], rep[103], b[203], i, j;\n  cin.get(a, 101, '\\n');\n  scanf(\"%s %s \", word, rep);\n  int wordlen = strlen(word), alen = strlen(a), replen = strlen(rep);\n  for (i = alen; i > 0; i--)\n    a[i] = a[i - 1];\n  a[0] = ' ';\n  a[alen + 1] = ' ';\n  a[alen + 2] = '\\0';\n  for (i = 1, j = 0; i < alen + 2; i++, j++) {\n    if (a[i - 1] == ' ' && a[i + wordlen] == ' ' &&\n        strncmp(a + i, word, wordlen) == 0) {\n      strcpy(b + j, rep);\n      i = i + wordlen - 1;\n      j = j + replen - 1;\n    } else\n      b[j] = a[i];\n  }\n  b[j - 1] = '\\0';\n  for (i = 0;; i++)\n    if (b[i] != '\\0')\n      cout << b[i];\n    else\n      break;\n  return 0;\n}\n"}
{"label": "19", "index": "34915", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], word1[100], word2[100];\n  int n = 0;\n  int i, j;\n\n  cin >> str1;\n  scanf(\"%s %s\", word1, word2);\n  for (i = 0; i < (int)(strlen(str1)); i++) {\n    for (j = i; j < i + (int)(strlen(word1)); j++) {\n      if (str1[j] != word1[j - i])\n        break;\n      n = n + 1;\n    }\n    if (i == 0 && n == (int)(strlen(word1))) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else if (n == (int)(strlen(word1)) &&\n               (str1[i + n] == 32 || str1[i + n] == '\u0000') && str1[i - 1] == 32) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else\n      printf(\"%c\", str1[i]);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[300];\n\n  scanf(\"%s \", string);\n  char a[200], b[200];\n  scanf(\"%s %s\", a, b);\n\n  char word[200][200];\n  int n1, i, k;\n  int m = 0;\n  int p = 0;\n  n1 = strlen(string);\n  for (i = 0; i < n1; i++) {\n    if (string[i] == ' ') {\n      m++;\n      p = 0;\n    } else {\n      word[m][p] = string[i];\n      p++;\n    }\n  }\n\n  if (strcmp(word[0], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word[0]);\n\n  for (k = 1; k <= m; k++) {\n    if (strcmp(word[k], a) == 0)\n      printf(\" %s\", b);\n    else\n      cout << \" \" << word[k];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000][1000] = {0};\n  int i, j, k = 0, e, d, h, n = 0, d1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  d = strlen(s);\n  for (i = k; i < d; i++) {\n    h = 0;\n    if (s[i] != ' ' && (s[i + 1] == ' ' || s[i + 1] == '\u0000')) {\n      for (j = k; j <= i; j++) {\n        c[n][h++] = s[j];\n      }\n      c[n][h] = '\u0000';\n      n += 1;\n      k = i + 2;\n    }\n  }\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      strcpy(c[i], b);\n      e = 1;\n    }\n  }\n  if (e == 0) {\n    printf(\"%s \", s);\n  } else {\n    for (i = 0; i < n - 1; i++) {\n      d1 = strlen(c[i]);\n      for (j = 0; j < d1; j++) {\n        cout << c[i][j];\n      }\n      printf(\"%c\", ' ');\n    }\n    printf(\"%s \", c[n - 1]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, k, w, nw = 0, ns, na, nb, rem[102], flag, FLAG = 0;\n  char s[102], a[102], b[102];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n  for (i = 0; i < ns; i++) {\n\n    if (s[i] != ' ' && FLAG == 0) {\n      FLAG = 1;\n      flag = 0;\n      for (k = i, j = 0; j < na; j++, k++) {\n        if (s[k] != a[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0 && (s[k] == ' ' || s[k] == '\u0000')) {\n        rem[nw] = i;\n        nw++;\n      }\n    } else {\n      FLAG = 0;\n    }\n  }\n  for (w = 0; w < nw; w++) {\n    if (nb == na) {\n      for (k = 0; k < na; k++) {\n        s[k + rem[w]] = b[k];\n      }\n    } else {\n      if (nb > na) {\n        ns = ns + nb - na;\n        s[ns] = '\u0000';\n        for (k = ns - 1; k > rem[w]; k--) {\n          s[k] = s[k - nb + na];\n        }\n        for (k = 0; k < nb; k++) {\n          s[k + rem[w]] = b[k];\n        }\n        for (j = 0; j < nw; j++) {\n          rem[j] = rem[j] + nb - na;\n        }\n      } else {\n        ns = ns + nb - na;\n        for (k = rem[w] + 1; k < ns; k++) {\n          s[k] = s[k - nb + na];\n        }\n        for (k = 0; k < nb; k++) {\n          s[k + rem[w]] = b[k];\n        }\n        for (j = 0; j < nw; j++) {\n          rem[j] = rem[j] + nb - na;\n        }\n      }\n    }\n  }\n  for (i = 0; i < ns; i++) {\n    printf(\"%c\", s[i]);\n  }\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "34919", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[105], b[105], s[105], c[105][105];\n  int i, len, startp, endp, cur_c, k;\n\n  cin >> s;\n  cin >> a >> b;\n  len = strlen(s);\n  startp = 0;\n  endp = 1, cur_c = 0;\n  while (endp <= len) {\n    if (s[endp] == ' ' || s[endp] == '\u0000') {\n      for (i = startp, k = 0; i <= endp - 1; i++, k++)\n        c[cur_c][k] = s[i];\n      c[cur_c][k + 1] = '\u0000';\n      cur_c++;\n      startp = endp + 1;\n      endp = startp + 1;\n    } else\n      endp++;\n  }\n  for (i = 0; i < cur_c; i++)\n    if (!strcmp(a, c[i]))\n      strcpy(c[i], b);\n  cout << c[0];\n  for (i = 1; i < cur_c; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n}\n"}
{"label": "19", "index": "34920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(10000 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  char *p1, *p2, *p3, *p, *s;\n  p1 = (char *)malloc(1000 * sizeof(char));\n\n  scanf(\"%s \", p1);\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> p2;\n\n  cin >> p3;\n  n = strlen(p1);\n  s = p1;\n  sscanf(s, \"%s\", p);\n  m = strlen(p);\n  if (strcmp(p2, p) == 0) {\n    printf(\"%s\", p3);\n  } else {\n    cout << p;\n  }\n  s = s + m + 1;\n  for (i = n - m - 1; i >= 0; i = i - m - 1) {\n    sscanf(s, \"%s\", p);\n    m = strlen(p);\n    if (strcmp(p2, p) == 0) {\n      printf(\" %s\", p3);\n    } else {\n      printf(\" %s\", p);\n    }\n    s = s + m + 1;\n  }\n}\n"}
{"label": "19", "index": "34922", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z, j, k = 0, l, y, x, p = 1;\n  char *s, *a, *b, **o;\n  s = (char *)malloc(1000 * sizeof(char));\n  a = (char *)malloc(110 * sizeof(char));\n  b = (char *)malloc(110 * sizeof(char));\n  o = (char **)malloc(10 * sizeof(char *));\n  for (i = 0; i < 10; i++)\n    o[i] = (char *)malloc(110 * sizeof(char));\n  cin >> o[k];\n  z = strlen(o[k]);\n  cin >> a >> b;\n  y = strlen(a);\n  x = strlen(b);\n  while (p == 1) {\n    p = 0;\n    for (i = 0; i < z; i++) {\n      if (o[k][i] == a[0] && (o[k][i - 1] == ' ' || i == 0)) {\n        for (l = 1; l < y; l++)\n          if (a[l] != o[k][i + l])\n            break;\n        if (l == y) {\n          p = 1;\n          for (j = 0; j < i; j++)\n            o[k + 1][j] = o[k][j];\n          for (j = i; j < i + x; j++)\n            o[k + 1][j] = b[j - i];\n          for (j = i + x; j < z - y + x; j++)\n            o[k + 1][j] = o[k][j + y - x];\n          k++;\n          z = z - y + x;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%c\", o[k][i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34923", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[20][20], a[20], b[20], *p1, *p2, *p[20];\n  int i = 0, j;\n  for (i = 0; i < 20; i++)\n    p[i] = str[i];\n  i = 0;\n  while (1) {\n    scanf(\"%s\", str[i]);\n    if (getchar() == '\\n')\n      break;\n    i++;\n  }\n  scanf(\"%s%s\", a, b);\n  p1 = a;\n  p2 = b;\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], p1) == 0)\n      p[j] = p2;\n\n  for (j = 0; j <= i; j++) {\n    if (j == 0)\n      printf(\"%s\", p[j]);\n    else\n      printf(\" %s\", p[j]);\n  }\n}\n"}
{"label": "19", "index": "34924", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar q[100], a[100], b[100], xc[50][100];\nint main() {\n\n  cin >> q;\n\n  cin >> a;\n\n  cin >> b;\n  int i = 0, j = 0, k = 0, s = 0, p = 0;\n  for (i = 0; i < 100; i++) {\n    if (q[i] != ' ') {\n      xc[j][i - k] = q[i];\n    }\n    if (q[i] == ' ') {\n      j++;\n      k = i + 1;\n    }\n  }\n  for (s = 0; s < j + 1; s++) {\n    if (strcmp(xc[s], a) == 0) {\n      strcpy(xc[s], b);\n    }\n  }\n  for (p = 0; p < j; p++) {\n    printf(\"%s \", xc[p]);\n  }\n  printf(\"%s\", xc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "34925", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  p = s;\n  while (ch != ' ') {\n    scanf(\"%s\", p + i++);\n    ch = getchar();\n  }\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  p = s;\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "34926", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    if (strcmp(h[i], w) == 0) {\n      t = 1;\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n    t = 0;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n}\n"}
{"label": "19", "index": "34927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  int i, j, len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int n = 0;\n  int word = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      word = 1;\n      n++;\n    }\n  }\n  int A = 0;\n  int l = 0;\n  int k;\n  char x[100];\n  for (j = 0; j < n; j++) {\n    for (i = A, k = 0; i < len; i++, k++) {\n      if (s[i] != ' ') {\n        x[k] = s[i];\n      }\n      if (s[i] == ' ') {\n        x[k] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len)\n      x[k] = '\u0000';\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    l++;\n    if (l != n) {\n      cout << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int i, a = 0, j = 0, l, nc[100];\n\n  cin >> s;\n  cin >> re;\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  cout << wd[a];\n  return 0;\n}\n"}
{"label": "19", "index": "34929", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], *p, a[100], b[100], s[100][20];\n  int l, i, j, d = 1, k;\n\n  cin >> str;\n  cin >> a >> b;\n  l = strlen(str);\n  p = str;\n  for (i = 0, j = 0;; i++, j++) {\n    if (str[i] == ' ')\n      break;\n    else\n      s[0][j] = str[i];\n  }\n  s[0][j] = '\u0000';\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = 0, k = i;; j++, k++) {\n        if (str[k] == ' ')\n          break;\n        else\n          s[d][j] = *(p + k);\n      }\n      s[d][j] = '\u0000';\n      d = d + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i < d - 1; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s\", s[d - 1]);\n}\n"}
{"label": "19", "index": "34930", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[20][100], ori[100], exc[100], c;\n  int i = 0, j;\n  do {\n    cin >> sen[i];\n    i++;\n  } while ((c = getchar()) != '\\n');\n  cin >> ori;\n  scanf(\"%s \", exc);\n  for (j = 0; j < i; j++) {\n    if (strcmp(sen[j], ori) == 0)\n      strcpy(sen[j], exc);\n  }\n  for (j = 0; j < i - 1; j++) {\n    cout << sen[j] << ' ';\n  }\n  cout << sen[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "34931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[100][100], bth[100], th[100], s[100];\n  int i, e, j = 0, t = 0, p;\n\n  cin >> s;\n\n  cin >> bth;\n\n  cin >> th;\n  e = strlen(s);\n  for (i = 0; i < 100; i++) {\n    for (p = 0; p < 100; p++) {\n      zfc[i][p] = 0;\n    }\n  }\n  for (i = 0; i < e; i++) {\n    if (s[i] != ' ') {\n      zfc[j][t] = s[i];\n      t++;\n    } else {\n      j++;\n      t = 0;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    if (strcmp(zfc[i], bth) == 0) {\n      printf(\"%s \", th);\n    } else {\n      printf(\"%s \", zfc[i]);\n    }\n  }\n  if (strcmp(zfc[j], bth) == 0) {\n    printf(\"%s\", th);\n  } else {\n    printf(\"%s\", zfc[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34932", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[105];\nchar h[105];\nchar b[105];\nchar c[105];\nchar d[105];\nint k;\nint p;\nint main() {\n  int i, j;\n  int t;\n\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0, j = 0; i <= strlen(a); i++) {\n    d[k++] = a[i];\n    h[p++] = a[i];\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      d[--k] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        p -= strlen(d) + 1;\n        for (t = 0; t < strlen(c); t++)\n          h[p++] = c[t];\n        if (a[i] == ' ')\n          h[p++] = ' ';\n      }\n      j = k + 1;\n      k = 0;\n    }\n  }\n  for (i = 0; i < strlen(h); i++)\n    putchar(h[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "34933", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str1[150], str2[50], str3[50];\nchar *p1 = str1, *p2 = str2, *p3 = str3;\n\nint compare(char *local, int len) {\n  p2 = str2;\n  char *p;\n  int flag = 1;\n  for (p = local; *p2 != '\u0000' && flag == 1 && p < local + len; p2++, p++)\n    if (*p != *p2)\n      flag = 0;\n  if (*p2 == '\u0000' && p == local + len)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  char newline[150];\n  char *news = newline, *local, *p;\n  int flag = 1, len = 0;\n\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  for (p1 = str1; p1 <= str1 + strlen(str1); p1++) {\n    if (isalpha(*p1))\n      if (flag == 1)\n        flag = 0, len = 1, local = p1;\n      else\n        len++;\n    else if (flag == 0) {\n      flag = 1;\n      if (compare(local, len))\n        for (p3 = str3; *p3 != '\u0000'; p3++, news++)\n          *news = *p3;\n      else\n        for (p = local; p < local + len; p++, news++)\n          *news = *p;\n      *news++ = *p1;\n    }\n  }\n  *news = '\u0000';\n  for (news = newline; *news != '\u0000'; news++)\n    printf(\"%c\", *news);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34934", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *str, *s1, *s2, *t, *str2;\n  int n;\n  str = (char *)calloc(102, 1000);\n  s1 = (char *)calloc(102, 1000);\n  s2 = (char *)calloc(102, 1000);\n  t = (char *)calloc(102, 1000);\n  str2 = (char *)calloc(240, 1000);\n  cin >> str;\n  scanf(\"%s %s \", s1, s2);\n  do {\n    sscanf(str, \"%s\", t);\n    n = strlen(t);\n    str = str + n + 1;\n    if (strcmp(t, s1) == 0)\n      strcat(str2, s2);\n    else\n      strcat(str2, t);\n    if (*str != '\u0000')\n      strcat(str2, \" \");\n  } while (*str != '\u0000');\n  printf(\"%s\", str2);\n  return 0;\n}\n"}
{"label": "19", "index": "34935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char X[20][100];\n  int i, A;\n  int Q;\n  for (i = 0; i < 20; i++) {\n    scanf(\"%s\", X[i]);\n    Q = getchar();\n    if (Q == '\\n') {\n      A = i;\n      break;\n    }\n  }\n  char W[100], Y[100];\n  scanf(\"%s\", W);\n  scanf(\"%s\", Y);\n  for (i = 0; i <= A; i++) {\n    if (strcmp(X[i], W) == 0) {\n      strcpy(X[i], Y);\n    }\n  }\n  for (i = 0; i <= A; i++) {\n    if (i == 0) {\n      cout << X[0];\n    } else {\n      printf(\" %s\", X[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  unsigned int i = 0, j = 0;\n  char s[101];\n  char a[101];\n  char b[101];\n  char tmp[101];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      tmp[j] = s[i];\n      j++;\n    } else {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(tmp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", tmp);\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(tmp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", tmp);\n  return 0;\n}\n"}
{"label": "19", "index": "34937", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char text[100], s[100][20] = {'\u0000'}, a[20], b[20];\n  int i, j = 0, k = 0, len;\n  cin >> text;\n  len = strlen(text);\n  for (i = 0; i < len; i++) {\n    if (text[i] != ' ') {\n      s[j][k] = text[i];\n      k = k + 1;\n    } else {\n      j = j + 1;\n      k = 0;\n    }\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s[i], a) == 0) {\n      strcpy(s[i], b);\n    }\n    printf(\"%s\", s[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34938", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[110], a[110], b[110];\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  int n = strlen(s);\n  int na = strlen(a);\n  int i, j, ans[30], c = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ' || i == 0) {\n      int count = 0, q;\n      if (i == 0)\n        q = 0;\n      else\n        q = i + 1;\n      for (j = q; j <= q + na - 1; j++) {\n        if (s[j] != a[j - q])\n          break;\n        count++;\n      }\n      if (count == na) {\n        ans[c] = q;\n        c++;\n      }\n    }\n  }\n\n  if (c == 0)\n    printf(\"%s\", s);\n  else {\n    int p = 0;\n    for (i = 0; i <= c - 1; i++) {\n      for (j = p; j < ans[i]; j++) {\n        printf(\"%c\", s[j]);\n      }\n      printf(\"%s\", b);\n      p = ans[i] + na;\n    }\n    for (j = p; j < n; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n}\n"}
{"label": "19", "index": "34939", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[100][100];\n  char str[1000];\n\n  scanf(\"%s \", str);\n  int len = strlen(str);\n  int i;\n  int count = 0;\n  for (i = 0; i < len + 1; i++) {\n    if (str[i] == ' ' || (str[i] == '\u0000')) {\n      int k, q = 0;\n      for (k = i - 1; k >= 0; k--) {\n        if (str[k] == ' ')\n          break;\n      }\n\n      for (++k; k <= i; k++) {\n        string[count][q] = str[k];\n        q++;\n      }\n      string[count][q - 1] = '\u0000';\n      count++;\n    }\n  }\n  char from[100];\n  char to[100];\n\n  cin >> from;\n\n  cin >> to;\n  char *nowword;\n  int j = 0;\n  for (j = 0; j < count; j++) {\n    nowword = string[j];\n    if (strcmp(nowword, from) == 0) {\n      strcpy(nowword, to);\n    }\n  }\n  printf(\"%s\", string[0]);\n  for (i = 1; i < count; i++)\n    printf(\" %s\", string[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[110], a[110], b[110];\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  int n = strlen(s);\n  int na = strlen(a);\n  int i, j, ans[30], c = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ' || i == 0) {\n      int count = 0, q;\n      if (i == 0)\n        q = 0;\n      else {\n        q = i + 1;\n      }\n      for (j = q; j <= q + na - 1; j++) {\n        if (s[j] != a[j - q]) {\n          break;\n        }\n        count++;\n      }\n      if (count == na) {\n        ans[c] = q;\n        c++;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n  else {\n    int p = 0;\n    for (i = 0; i <= c - 1; i++) {\n      for (j = p; j < ans[i]; j++) {\n        printf(\"%c\", s[j]);\n      }\n      printf(\"%s\", b);\n      p = ans[i] + na;\n    }\n    for (j = p; j < n; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20][20] = {'\\0'}, str2[20], str3[20];\n  int num = 0, j = 0, i;\n  cin.getline(str, 100);\n  cin.getline(str2, 20);\n  cin.getline(str3, 20);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str1[num][j++] = str[i];\n    }\n    if (str[i] == ' ') {\n      num++;\n      j = 0;\n    }\n  }\n  num = num + 1;\n  for (i = 0; i < num; i++) {\n    if (strcmp(str1[i], str2) == 0) {\n      strcpy(str1[i], str3);\n    }\n  }\n  for (i = 0; i < num - 1; i++)\n    cout << str1[i] << \" \";\n\n  cout << str1[i] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34942", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i = 0, j = 0, count = 0;\n  cin.get(s, 100);\n  cin >> a;\n  cin >> b;\n  for (i = 0; i <= strlen(s) - strlen(a); i++) {\n    count = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i])\n        count++;\n    }\n    if (count == strlen(a) &&\n        ((s[i + strlen(a)] == ' ' || i + strlen(a) == strlen(s)) &&\n         (s[i - 1] == ' ' || i == 0))) {\n      for (j = i; j < i + strlen(a); j++)\n        s[j] = '/';\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != '/')\n      cout << s[i];\n    else {\n      for (j = 0; j < strlen(b); j++)\n        printf(\"%c\", b[j]);\n      do {\n        i++;\n      } while (s[i] == '/' && (i + 1 == strlen(s) || s[i + 1] == '/'));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34943", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, b = 0;\n  char s[80], s0[20], s2[20], s3[20];\n  char s1[100] = {'\u0000'};\n\n  scanf(\"%s \", s);\n\n  cin >> s0;\n\n  cin >> s2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s3[b] = s[i];\n      b++;\n    }\n    if (s[i] == ' ') {\n      s3[b] = '\u0000';\n      if (strcmp(s3, s0) == 0) {\n        strcat(s1, s2);\n        strcat(s1, \" \");\n      } else {\n        strcat(s1, s3);\n        strcat(s1, \" \");\n      }\n      b = 0;\n    }\n  }\n  s3[b] = '\u0000';\n  if (strcmp(s3, s0) == 0) {\n    strcat(s1, s2);\n  } else\n    strcat(s1, s3);\n\n  puts(s1);\n  return 0;\n}\n"}
{"label": "19", "index": "34944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][50];\n  char *p1 = s, *p3 = b;\n  int i = 0, j = 0, n;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (; *p1 != '\u0000'; p1++) {\n    if (*p1 != ' ') {\n      c[i][j] = *p1; \n      j++;\n    } else {\n      c[i][j] = '\u0000';\n      i++;\n      j = 0; \n    }\n  }\n  c[i][j] = '\u0000'; \n  n = i;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0) {\n      for (j = 0; *p3 != '\u0000'; p3++, j++)\n        c[i][j] = *p3;\n      c[i][j] = '\u0000';\n    }\n    p3 = b; \n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[i]); \n}\n"}
{"label": "19", "index": "34945", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sour[100], result[100];\n  char a[20], b[20], c[20];\n  char *p = NULL, *q = NULL;\n  int i, k = 0;\n  int l_1, l_2, l_3, l_4, l_5, x = 0;\n  int flag;\n  int j;\n  int word_length = 0;\n  int flag_2 = 0;\n\n  scanf(\"%s \", sour);\n\n  cin >> a;\n\n  cin >> b;\n  l_1 = strlen(sour);\n  l_2 = strlen(a);\n  l_3 = strlen(b);\n  p = sour;\n  q = sour;\n  for (j = 0; j < l_1 - l_2 + 1;) {\n    for (i = 0; i < l_2; i++, j++) {\n      c[i] = sour[j];\n    }\n    j = x;\n    x++;\n    if (strcmp(c, a) == 0)\n      flag_2++;\n  }\n\n  while (*p != '\u0000') {\n    if (*p == ' ' || *(p + 1) == '\u0000') {\n      flag = 1;\n      if (*p == ' ')\n        word_length = p - q;\n      else\n        word_length = p - q + 1;\n      if (word_length == strlen(a)) {\n        for (i = 0; i < strlen(a); i++) {\n          if (q[i] != a[i]) {\n            flag = 0;\n            break;\n          }\n        }\n      } else\n        flag = 0;\n\n      if (flag == 1) {\n        for (i = 0; i < strlen(b); i++) {\n          result[k++] = b[i];\n        }\n\n      } else {\n        while (q != p) {\n          result[k++] = *q++;\n        }\n      }\n      if (*p == ' ')\n        result[k++] = ' ';\n      else\n        result[k++] = *p;\n\n      q = p + 1;\n    }\n    p++;\n  }\n\n  result[k] = '\u0000';\n  l_4 = strlen(result);\n  l_5 = l_1 - l_2 + l_3;\n  if ((l_4 != l_5)) {\n    if (flag_2 == 1)\n      result[k - 1] = '\u0000';\n  }\n  puts(result);\n}\n"}
{"label": "19", "index": "34946", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[100], a[100], b[100], c[100][100];\n  int i, n[100], k, m, j = 0;\n  n[0] = -1;\n\n  cin >> ch;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; ch[i] != '\u0000'; i++) {\n    if (ch[i] == ' ') {\n      j++;\n      n[j] = i;\n      for (k = 0, m = n[j - 1] + 1; k < i - n[j - 1] - 1 && m < i; k++, m++)\n        c[j][k] = ch[m];\n    }\n    continue;\n  }\n  for (i = n[j] + 1; ch[i] != '\u0000'; i++)\n    c[j + 1][i - 1 - n[j]] = ch[i];\n  for (m = 1; m <= j + 1; m++) {\n    if (strcmp(c[m], a) == 0)\n      strcpy(c[m], b);\n  }\n  for (m = 1; m <= j; m++)\n    printf(\"%s \", c[m]);\n  printf(\"%s\", c[j + 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34947", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n\n  cin >> s;\n  int p = strlen(s);\n  char a[10], b[10];\n\n  cin >> a;\n  scanf(\"%s \", b);\n  int q = strlen(a), l = strlen(b);\n  int i, j, k = 0, t;\n  if (a[0] == s[0]) {\n    for (i = 1; i < q; i++) {\n      if (a[i] != s[i]) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      if (q > l) {\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n        for (i = l; i < p - l; i++)\n          s[i] = s[i + q - 1];\n      }\n      if (q < l) {\n        for (i = p + l - q; i > 0; i--) {\n          s[i + l - q] = s[i];\n        }\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n      }\n    }\n  }\n  for (i = 0; i < p - 1; i++) {\n    if (s[i] == ' ') {\n      if (s[i + 1] == a[0]) {\n        for (j = i + 1, t = 0; j < i + 1 + q; j++, t++) {\n          if (a[t] != s[j]) {\n            k = 1;\n            break;\n          }\n        }\n        if (k == 0) {\n          if (q > l) {\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n            for (j = i + 1 + l; j < p - l; j++)\n              s[j] = s[j + q - 1];\n          }\n          if (q < l) {\n            for (j = p + l - q; j > i + 1; j--)\n              s[j + l - q] = s[j];\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n          }\n        }\n      }\n    }\n  }\n  cout << s << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "34948", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100];\n  char c[101], word1[100], replaceword[100];\n\n  cin >> c;\n  cin >> word1;\n  cin >> replaceword;\n  int i, j = 0, k = 0;\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    } else {\n      str[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  str[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], replaceword);\n  }\n  cout << str[0];\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], a[100][100];\n  int i, j = 0, t = 0, l, m, n, k = -1, f = 1;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  m = strlen(str1);\n  l = strlen(str2);\n  str1[m] = '\u0000';\n  for (j = 0; i <= m; j++) {\n    for (i = k + 1, n = 0; i <= m; i++, n++) {\n      if (str1[i] != ' ' && str1[i] != '\u0000')\n        a[j][n] = str1[i];\n      else {\n        a[j][n] = '\u0000';\n        k = i;\n        break;\n      }\n    }\n  }\n  k = j - 1;\n  for (j = 0; j < k; j++) {\n    f = 1;\n    t = strlen(a[j]);\n    if (l != t) {\n      printf(\"%s\", a[j]);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n      continue;\n    } else {\n      for (i = 0; i < l; i++) {\n        if (a[j][i] != str2[i]) {\n          printf(\"%s\", a[j]);\n          if (j < k - 1) {\n            printf(\" \");\n          }\n          f = 0;\n          break;\n        }\n      }\n    }\n    if (f == 1) {\n      printf(\"%s\", str3);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n    }\n  }\n}\n"}
{"label": "19", "index": "34950", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n\n  cin >> s;\n  int p = strlen(s);\n  char a[10], b[10];\n\n  cin >> a;\n  scanf(\"%s \", b);\n  int q = strlen(a), l = strlen(b);\n  int i, j, k = 0, t;\n  if (a[0] == s[0]) {\n    for (i = 1; i < q; i++) {\n      if (a[i] != s[i]) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      if (q > l) {\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n        for (i = l; i < p - l; i++)\n          s[i] = s[i + q - 1];\n      }\n      if (q < l) {\n        for (i = p + l - q; i > 0; i--)\n          s[i + l - q] = s[i];\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n      }\n    }\n  }\n  for (i = 0; i < p - 1; i++) {\n    if (s[i] == ' ') {\n      if (s[i + 1] == a[0]) {\n        for (j = i + 1, t = 0; j < i + 1 + q; j++, t++) {\n          if (a[t] != s[j]) {\n            k = 1;\n            break;\n          }\n        }\n        if (k == 0) {\n          if (q > l) {\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n            for (j = i + 1 + l; j < p - l; j++)\n              s[j] = s[j + q - 1];\n          }\n          if (q < l) {\n            for (j = p + l - q; j > i + 1; j--)\n              s[j + l - q] = s[j];\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n          }\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "34951", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[100][100] = {'\\0'}, c = '\\0', alter[100] = {'\\0'},\n       alter0[100] = {'\\0'};\n  int i = 0, j = 0, sum;\n  while (c != '\\n') {\n    c = getchar();\n    while (c != ' ' && c != '\\n') {\n      word[i][j] = c;\n      c = getchar();\n      j++;\n    }\n    i++;\n    j = 0;\n  }\n  sum = i;\n  cin.getline(alter0, 100, '\\n');\n  cin.getline(alter, 100, '\\n');\n  for (i = 0; i < sum; i++) {\n    j = 0;\n    while (alter0[j] == word[i][j] && j <= 99) {\n      j++;\n    }\n    if (j == 100) {\n      for (j = 0; j < 100; j++) {\n        word[i][j] = alter[j];\n      }\n    }\n  }\n  for (i = 0; i < sum - 1; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s\", word[sum - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], *p, a[100], b[100], s[100][20];\n  int l, i, j, d = 1, k;\n\n  cin >> str;\n  scanf(\"%s %s\", a, b);\n  l = strlen(str);\n  p = str;\n  for (i = 0, j = 0;; i++, j++) {\n    if (str[i] == ' ')\n      break;\n    else\n      s[0][j] = str[i];\n  }\n  s[0][j] = '\u0000';\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = 0, k = i;; j++, k++) {\n        if (str[k] == ' ')\n          break;\n        else\n          s[d][j] = *(p + k);\n      }\n      s[d][j] = '\u0000';\n      d = d + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i < d - 1; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s\", s[d - 1]);\n}\n"}
{"label": "19", "index": "34953", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n\n  cin >> s;\n  int p = strlen(s);\n  char a[10], b[10];\n\n  cin >> a;\n  cin >> b;\n  int q = strlen(a), l = strlen(b);\n  int i, j, k = 0, t;\n  if (a[0] == s[0]) {\n    for (i = 1; i < q; i++) {\n      if (a[i] != s[i]) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      if (q > l) {\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n        for (i = l; i < p - l; i++)\n          s[i] = s[i + q - 1];\n      }\n      if (q < l) {\n        for (i = p + l - q; i > 0; i--)\n          s[i + l - q] = s[i];\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n      }\n    }\n  }\n  for (i = 0; i < p - 1; i++) {\n    if (s[i] == ' ') {\n      if (s[i + 1] == a[0]) {\n        for (j = i + 1, t = 0; j < i + 1 + q; j++, t++) {\n          if (a[t] != s[j]) {\n            k = 1;\n            break;\n          }\n        }\n        if (k == 0) {\n          if (q > l) {\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n            for (j = i + 1 + l; j < p - l; j++)\n              s[j] = s[j + q - 1];\n          }\n          if (q < l) {\n            for (j = p + l - q; j > i + 1; j--)\n              s[j + l - q] = s[j];\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n          }\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "34954", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar S[1000][100];\nint Size = 0;\nint main() {\n  \n  while (!feof(stdin))\n    scanf(\"%s\", S[Size++]);\n  \n  Size--;\n  for (int i = 0; i < Size - 3; i++)\n    if (strcmp(S[i], S[Size - 2]) == 0)\n      printf(\"%s \", S[Size - 1]);\n    else\n      printf(\"%s \", S[i]);\n  if (strcmp(S[Size - 3], S[Size - 2]) == 0)\n    printf(\"%s\\n\", S[Size - 1]);\n  else\n    printf(\"%s\\n\", S[Size - 3]);\n  return 0;\n}\n"}
{"label": "19", "index": "34955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[10] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i;\n  char a2[100];\n  a2[0] = ' ';\n  a2[1] = a[0];\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    a2[i + 1] = a[i];\n  }\n\n  char tmp[100];\n\n  int j;\n  tmp[0] = s[0];\n  for (i = 1; s[i - 1] != ' ' && s[i - 1] != '\u0000'; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      tmp[i] = '\u0000';\n    } else {\n      tmp[i] = s[i];\n    }\n  }\n  if (strcmp(tmp, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", tmp);\n  }\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; s[j] != ' ' && s[j] != '\u0000'; j++) {\n        tmp[0] = ' ';\n        if (s[j + 1] == ' ' || s[j + 1] == '\u0000') {\n          tmp[j - i] = s[j];\n          tmp[j - i + 1] = '\u0000';\n        } else {\n          tmp[j - i] = s[j];\n        }\n      }\n    } else\n      continue;\n\n    if (strcmp(tmp, a2) == 0) {\n      printf(\"%s\", c);\n      printf(\"%s\", b);\n    } else\n      printf(\"%s\", tmp);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34956", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef long long ll;\n\nchar s[110], a[110], b[110];\n\nint main() {\n  while (cin >> s) {\n    \n    scanf(\"%s%s \", a, b);\n\n    int i = 0;\n    int lena = strlen(a);\n    while (s[i]) {\n      if (s[i] == ' ')\n        putchar(' '), i++;\n      else {\n        int j = 0;\n        for (; a[j]; j++)\n          if (a[j] != s[i + j])\n            break;\n\n        if (a[j] == 0) {\n          i += lena;\n          printf(\"%s\", b);\n        } else {\n          while (s[i] && s[i] != ' ')\n            putchar(s[i++]);\n        }\n      }\n    }\n\n    puts(\"\");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34957", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0 && s[0] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[j] != a[j])\n          break;\n      if (j == m && s[m] == ' ') {\n        printf(\"%s\", b);\n        i = i + m;\n      }\n    }\n    if (s[i] == ' ' && s[i + 1] == a[0]) {\n      for (j = 1; j <= m - 1; j++) {\n        if (s[i + j + 1] != a[j])\n          break;\n      }\n      if (j == m && (s[i + j + 1] == ' ' || s[i + j + 1] == '\u0000')) {\n        printf(\" %s\", b);\n        i = i + m + 1;\n      }\n    }\n    if (s[i] != '\u0000')\n      printf(\"%c\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "34958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], *d, *e, *f;\n  int al, bl, cl, i, j, k;\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  d = &a[0];\n  e = &b[0];\n  f = &c[0];\n\n  for (i = 0; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++)\n    *(d + j) = *(f + k);\n\n  al = al + cl;\n  *(d + al) = '\u0000';\n\n  for (i = i + cl; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++) {\n    *(d + j) = *(f + k);\n  }\n  al = al + cl;\n  *(d + al) = '\u0000';\n\nline:\n  puts(a);\n}\n"}
{"label": "19", "index": "34959", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s[100], *a, *b;\n  int i;\n  for (i = 0;; i++) {\n    s[i] = (char *)calloc(1, 100 * sizeof(char));\n    scanf(\"%s\", s[i]);\n    if (getchar() == '\\n')\n      break;\n  }\n  int n = i;\n  a = (char *)calloc(1, 100 * sizeof(char));\n  b = (char *)calloc(1, 100 * sizeof(char));\n  cin >> a;\n  cin >> b;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i <= n; i++) {\n    if (i == 0)\n      printf(\"%s\", s[i]);\n    else\n      printf(\" %s\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "34960", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[20][20], a[20], b[20], *p1, *p2, *p[20];\n  int i = 0, j;\n  for (i = 0; i < 20; i++)\n    p[i] = str[i];\n  i = 0;\n  while (1) {\n    scanf(\"%s\", str[i]);\n    if (getchar() == '\\n')\n      break;\n    i++;\n  }\n  scanf(\"%s%s\", a, b);\n  p1 = a;\n  p2 = b;\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], p1) == 0)\n      p[j] = p2;\n  for (j = 0; j <= i; j++) {\n    if (j == 0)\n      printf(\"%s\", p[j]);\n    else\n      printf(\" %s\", p[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34961", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[200], b[100], c[100], d[200];\n  int i, j;\n  int n1 = 0, n2 = 0, n3 = 0;\n  int m = 0, flat = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++)\n\n    n1++;\n  for (i = 0; b[i] != '\u0000'; i++)\n    n2++;\n  for (i = 0; c[i] != '\u0000'; i++)\n    n3++;\n  for (i = 0; i <= n1 + x * (n3 - n2) - 1; i++) {\n    if (a[i] == b[0]) {\n      flat = 1;\n      for (j = 1; j <= n2 - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          flat = flat + 1;\n      }\n      if (((flat == n2) && (a[i - 1] == ' ') && (a[i + n2] == ' ')) ||\n          ((i == 0) && (flat == n2) && (a[i + n2] == ' ')) ||\n          ((flat == n2) && (i >= n1 + x * (n3 - n2) - n2 - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + n2; m <= n1 + 2; m++) {\n          d[m - i - n2] = a[m];\n        }\n        for (m = i; m <= i + n3 - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + n3; m <= n1 + n3 - n2 + 2; m++) {\n          a[m] = d[m - i - n3];\n        }\n        i = i + n3 - n2;\n        x = x + 1;\n      }\n    }\n  }\n  a[n1 + x * (n3 - n2)] = '\u0000';\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "19", "index": "34962", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      if (i != 0 && s[i - 1] != ' ') {\n        t = 0;\n      }\n    }\n\n    if (t == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    }\n    if (t == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34963", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\u0000'}, b[100] = {'\u0000'}, c[100] = {'\u0000'}, d[100] = {'\u0000'};\n  int h, i, j, k, m, n, r;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  n = strlen(c);\n  for (h = 0, i = 0; *(a + i) != '\u0000';) {\n    if ((*(a + i) == *b) &&\n        ((i >= 1 && *(a + i - 1) == ' ' &&\n          (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')) ||\n         (i == 0 && (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')))) {\n      r = i;\n      for (j = 0; j < m; j++)\n        if (*(a + r + j) != *(b + j))\n          break;\n      if (j == m) {\n        for (k = 0; k < n; k++) {\n          *(d + h) = *(c + k);\n          h++;\n          i++;\n        }\n        i = i + m - n;\n        continue;\n      }\n    }\n    *(d + h) = *(a + i);\n    h++;\n    i++;\n  }\n  puts(d);\n}\n"}
{"label": "19", "index": "34964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char zfc[100][100];\n  int i, j, len, k = 1, wz[100];\n\n  cin >> s;\n  cin >> a >> b;\n  len = strlen(s);\n  wz[0] = 0 - 1;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      wz[k] = i;\n      k++;\n    }\n  }\n  wz[k] = len;\n  for (i = 0; i < k; i++) {\n    for (j = wz[i] + 1; j < wz[i + 1]; j++)\n      zfc[i][j - wz[i] - 1] = s[j];\n    zfc[i][j - wz[i] - 1] = '\u0000';\n  }\n  if (strcmp(zfc[0], a) != 0) {\n    printf(\"%s\", zfc[0]);\n\n  } else {\n    cout << b;\n  }\n\n  for (i = 1; i < k; i++) {\n    if (strcmp(zfc[i], a) != 0) {\n      printf(\" %s\", zfc[i]);\n\n    } else {\n      cout << \" \" << b;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j = 0, k = 0;\n  char c[100][100] = {'\u0000'};\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[j][k] = s[i];\n      k++;\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      printf(\" %s\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34966", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  ss[n++] = s;\n  for (i = 0; s[i]; i++) {\n    if (s[i] == ' ') {\n      s[i] = 0;\n      ss[n++] = s + i + 1;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(ss[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(ss[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34967", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char s1[100];\n  char s2[100];\n\n  cin >> s;\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n  char *p2 = s;\n  while (*p2 != '\u0000') {\n    int i = 0;\n    char temp[100];\n    for (i = 0; i <= 99; i++) {\n      temp[i] = '\u0000';\n    }\n    i = 0;\n    do {\n      temp[i] = *p2;\n      p2++;\n      i++;\n    } while (*p2 != ' ' && *p2 != '\u0000');\n    if (strcmp(s1, temp) == 0)\n      printf(\"%s\", s2);\n    else\n      printf(\"%s\", temp);\n    if (*p2 == ' ') {\n      p2++;\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34968", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, old[100] = {0}, by[100] = {0}, a1[100] = {0};\n  int s1, s2, s3, i, j, k, l = 1, mark[100] = {0};\n  int rem[10] = {0};\n\n  scanf(\"%s \", a);\n  cin >> old;\n  scanf(\"%s \", by);\n  s1 = strlen(a);\n  s2 = strlen(old);\n  s3 = strlen(by);\n  for (i = 0; i < s1; i++) {\n    k = 0;\n    if ((a[i - 1] == ' ' || i == 0) && ((i + s2 == s1) || a[i + s2] == ' ')) {\n      for (j = i; j < i + s2; j++) {\n        if (a[j] == old[j - i]) {\n          k += 1;\n        }\n      }\n      if (k == s2) {\n        for (j = i; j < i + s2; j++)\n          mark[j] = 1;\n        cout << by;\n      }\n    }\n    if (mark[i] > 0)\n      continue;\n    printf(\"%c\", a[i]);\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "34969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100], a[100], b[100];\n  char *p[100];\n  int i, j, k, m, n, t = 1;\n\n  scanf(\"%s \", s);\n  n = strlen(s);\n  scanf(\"%s %s\", a, b);\n  for (i = 0; k <= n - 1; i++, k++) {\n    for (j = 0; k <= n - 1; j++, k++) {\n      if (s[k] != 32)\n        c[i][j] = s[k];\n      else {\n        c[i][j] = '\u0000';\n        t++;\n        break;\n      }\n    }\n  }\n  c[t - 1][j + 1] = '\u0000';\n\n  for (i = 0; i < t; i++)\n    p[i] = c[i];\n\n  for (i = 0; i < t; i++)\n    if (strcmp(p[i], a) == 0)\n\n      p[i] = b;\n  for (i = 0; i < t - 1; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[t - 1]);\n}\n"}
{"label": "19", "index": "34970", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char danchi[1000];\n  char e[50][1000], a[1000], b[1000];\n  cin >> danchi;\n  scanf(\"%s %s\", a, b);\n  int i, j, g = 0, l = 0, v = 0, m = 0;\n  int max = 0, min = 100, max1, min1;\n\n  int c = strlen(danchi);\n  for (j = 0; j < 50; j++) {\n    l = 0;\n    for (i = g; i < 1000; i++) {\n      if (danchi[i] == ' ') {\n        m++;\n        break;\n      }\n      e[j][l] = danchi[i];\n      g++;\n      l++;\n      v++;\n    }\n    g++;\n    v++;\n\n    if (v > c)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    if (strcmp(e[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", e[i]);\n    }\n  }\n  if (strcmp(e[m], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", e[m]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34971", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++)\n    *(s + i) = '\u0000';\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "34972", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[1000], str2[100], str3[100], str4[100], str5[2] = \" \",\n                                                    str[100] = \"\";\n  int i, k = 0;\n\n  scanf(\"%s \", str1);\n\n  scanf(\"%s \", str2);\n\n  scanf(\"%s \", str3);\n  for (i = 0; str1[i] != '\u0000'; i++) {\n    if (str1[i] != ' ') {\n      str4[k] = str1[i];\n      k = k + 1;\n    } else {\n      str4[k] = '\u0000';\n      k = 0;\n      if (strcmp(str4, str2) == 0)\n        strcat(str, str3);\n      else\n        strcat(str, str4);\n      strcat(str, str5);\n    }\n  }\n  str4[k] = '\u0000';\n  if (strcmp(str4, str2) == 0)\n    strcat(str, str3);\n  else\n    strcat(str, str4);\n  printf(\"%s\", str);\n}\n"}
{"label": "19", "index": "34973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[50], e[50];\n  int c[1000], d[1000];\n  int i, n, flag1 = 0, j = 0, m, k, x, l, flag2 = 0, g;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", e);\n  n = strlen(a);\n  x = strlen(b);\n  d[0] = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ' && flag1 == 0) {\n      c[j] = i;\n      d[j + 1] = i + 1;\n      j++;\n      flag1 = 1;\n      m = i;\n    } else {\n      if (a[i] == ' ') {\n        c[j] = i - m - 1;\n        d[j + 1] = i + 1;\n        j++;\n        m = i;\n      }\n    }\n  }\n  c[j] = n - 1 - m;\n  k = j + 1;\n  for (j = 0; j < k; j++) {\n\n    if (c[j] == x) {\n      g = 0;\n      for (l = d[j]; l < d[j] + c[j]; l++, g++) {\n        if (b[g] != a[l])\n          flag2 = 1;\n      }\n      g = 0;\n      if (flag2 == 0) {\n        if (j == 0)\n          printf(\"%s\", e);\n        else\n          printf(\" %s\", e);\n      } else {\n        if (j == 0)\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        else {\n          cout << \" \";\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        }\n      }\n      flag2 = 0;\n    } else {\n      if (j == 0)\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      else {\n        printf(\" \");\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34974", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int i, j, n, m, w;\n  char r[200], s[200], t[200];\n\n  cin >> r;\n  cin >> s;\n  cin >> t;\n  p1 = r;\n  p2 = s;\n  n = strlen(s);\n  for (i = 0; *(p1 + i) != '\u0000';) {\n    if (*(p1 + i) != *p2) {\n      printf(\"%c\", *(p1 + i));\n      i++;\n    } else {\n      for (j = 1, w = 1; j < n; j++) {\n        if (*(p1 + i + j) != *(p2 + j)) {\n          for (m = 0; m < j; m++)\n            cout << *(p1 + i + m);\n          break;\n        }\n        w++;\n      }\n      if (w == n) {\n        if (((*(p1 + i + n) == ' ' || *(p1 + i + n) == '\u0000') &&\n             *(p1 + i - 1) == ' ') ||\n            ((i == 0) && *(p1 + n) == ' '))\n          printf(\"%s\", t);\n        else\n          printf(\"%s\", s);\n        i = i + n;\n      } else\n        i = i + j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  int ns, na, nb, i, j, k = 0, m, flag, p[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n\n  for (i = 0, j = 0, k = 0; i < na, j < ns; j++) {\n    if (s[j] == a[i]) {\n      flag = j;\n      i++;\n      if (i == na && (s[j - na] < 'A' || s[j + 1] > 'z')) {\n        p[k] = flag;\n        k++;\n        i = 0;\n      }\n    } else\n      i = 0;\n  }\n\n  if (k != 0) {\n    for (m = 0; m < k; m++) {\n      p[m] = p[m] + m * abs(na - nb);\n      ns = ns + m * abs(na - nb);\n      if (na == nb) {\n        for (i = 0; i < na; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1)\n          printf(\"%s \", s);\n      }\n      if (na > nb) {\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        for (i = p[m] + 1 - na + nb; i < ns - na + nb; i++)\n          s[i] = s[i + na - nb];\n        if (m == k - 1) {\n          for (i = 0; i < ns - na + nb; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n      if (na < nb) {\n        for (i = ns - 1; i > p[m]; i--)\n          s[i + nb - na] = s[i];\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1) {\n          for (i = 0; i < ns + nb - na; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n    }\n  }\n\n  else if (k == 0)\n    printf(\"%s \", s);\n}\n"}
{"label": "19", "index": "34976", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  int i, j, c = 0, d = 0, e = 0, f, k, l, len1, len2;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == a[0] && (s[i - 1] == ' ' || i == 0)) {\n      d = 0;\n      for (j = 1; j < len2; j++) {\n        if (s[j + i] == a[j])\n          d += 1;\n      }\n\n      if (d == len2 - 1) {\n        e += 1;\n        s[i] = '\u0000';\n        f = 0;\n        for (k = 0; k < i; k++) {\n          if (s[k] == '\u0000')\n            f += 1;\n          if (f == e - 1) {\n            if (k == 0) {\n              for (l = k; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            } else {\n              for (l = k + len2; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            }\n          }\n        }\n        printf(\"%s\", b);\n      }\n    }\n  }\n  if (e != 0) {\n    for (i = 0; i < len1; i++) {\n      if (s[i] == '\u0000')\n        c += 1;\n      if (c == e) {\n        for (j = i + len2; j < len1; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n    }\n  } else\n    puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "34977", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char buf[1000];\n  char key[100];\n  char temp[100];\n  char rep[100];\n  int i, j, n, w;\n  cin.getline(buf, 1000, '\\n');\n  scanf(\"%s %s \", key, rep);\n  i = 0;\n  w = 0;\n  while (1) {\n    for (j = 0; buf[i] != ' ' && buf[i] != 0; j++, i++)\n      temp[j] = buf[i];\n    temp[j] = 0;\n    n = strcmp(temp, key);\n    if (w != 0)\n      cout << ' ';\n    if (n == 0) {\n\n      cout << rep;\n    } else\n      printf(\"%s\", temp);\n    w++;\n    if (buf[i] == 0)\n      break;\n    i++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char X[20][100];\n  int i, A;\n  int Q;\n  for (i = 0; i < 20; i++) {\n    scanf(\"%s\", X[i]);\n    Q = getchar();\n    if (Q == '\\n') {\n      A = i;\n      break;\n    }\n  }\n  char W[100], Y[100];\n  scanf(\"%s\", W);\n  scanf(\"%s\", Y);\n  for (i = 0; i <= A; i++) {\n    if (strcmp(X[i], W) == 0) {\n      strcpy(X[i], Y);\n    }\n  }\n  for (i = 0; i <= A; i++) {\n    if (i == 0) {\n      printf(\"%s\", X[0]);\n    } else {\n      printf(\" %s\", X[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "34979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char Sen[200], word[200], exchange[200], temp[200];\n\n  cin >> Sen;\n\n  cin >> word;\n\n  cin >> exchange;\n  int n = strlen(Sen), i;\n  int m;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (Sen[i] != ' ') {\n      temp[m] = Sen[i];\n      m++;\n    } else {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n    if (i == n - 1) {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n  }\n}\n"}
{"label": "19", "index": "34980", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *q, *temp1, *temp2;\n  int i, j = 0, len, lenb, k, flag = 1, head = 0, tail = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  temp1 = (char *)malloc(200 * sizeof(char));\n  temp2 = (char *)malloc(200 * sizeof(char));\n  scanf(\"%s \", s);\n  scanf(\"%s \", a);\n  cin >> b;\n  len = strlen(s);\n  lenb = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (*(s + i) != ' ') {\n      if (flag == 1) {\n        head = i;\n        flag = 0;\n      }\n      *(temp1 + j) = *(s + i);\n      j++;\n    } else {\n      q = s + i;\n      tail = i;\n      flag = 1;\n      *(temp1 + j) = '\u0000';\n      j = 0;\n      if (!strcmp(temp1, a)) {\n        strcpy(temp2, q);\n        for (k = 0; k < lenb; k++)\n          *(s + head + k) = *(b + k);\n        *(s + head + k) = '\u0000';\n        strcat(s, temp2);\n      }\n      strcpy(temp1, \"\u0000\");\n      strcpy(temp2, \"\u0000\");\n    }\n  }\n  *(temp1 + j) = '\u0000';\n  if (!strcmp(temp1, a)) {\n\n    for (k = 0; k < lenb; k++)\n      *(s + head + k) = *(b + k);\n    *(s + head + k) = '\u0000';\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "34981", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  int i = 0, count = 0, j = 0;\n  char str[100][100];\n  char word1[100], word2[100];\n  cin.getline(s, 100, '\\n');\n  for (i = 0; i < 100; i++) {\n    if (s[i] != ' ') {\n      str[count][j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      str[count][j + 1] = '\\0';\n      count++;\n      j = 0;\n      continue;\n    } else if (s[i] == '\\0')\n      break;\n  }\n  cin.getline(word1, 100, '\\n');\n  cin.getline(word2, 100, '\\n');\n  for (i = 0; i <= count; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], word2);\n  }\n  printf(\"%s\", str[0]);\n  for (i = 1; i <= count; i++)\n    cout << ' ' << str[i];\n  return 0;\n}\n"}
{"label": "19", "index": "34982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], d[100][100];\n  int i, j, w, m, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  w = strlen(s);\n  for (i = 0, j = 0; i < w + 1; j++, i++) {\n    if (s[i] != ' ' && s[i] != 0) {\n      d[k][j] = s[i];\n    } else {\n      d[k][j] = 0;\n      k += 1;\n      j = -1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(d[i], a) == 0) {\n      strcpy(d[i], b);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", d[i]);\n  }\n  printf(\"%s\", d[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "34983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  cin >> s;\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    printf((strcmp(s, from) == 0) ? to : s);\n    s = p + 1;\n    if (*s)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34984", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200], d[200];\n  int ai = 0, lb, la, lc, bi = 0, ci = 0, di = 0, k;\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  lb = strlen(b);\n  la = strlen(a);\n  lc = strlen(c);\n  while (ai != la) {\n    bi = 0;\n    ci = 0;\n    if (ai != 0) {\n      if ((a[ai] == b[bi]) && (a[ai - 1] == ' ')) {\n\n        k = ai;\n        while ((a[ai] == b[bi]) && (a[ai] != ' ') && (a[ai] != '\u0000')) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    } else {\n      if (a[ai] == b[bi]) {\n\n        k = ai;\n        while (a[ai] == b[bi]) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    }\n  }\n\n  d[di] = '\u0000';\n\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "34985", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0;\n  int j = 0;\n  int begin;\n  int end;\n  char now[101];\n  char sen[1000];\n  char old[101];\n  char newone[101];\n\n  cin >> sen;\n\n  cin >> old;\n\n  cin >> newone;\n  while (sen[i] != '\u0000') {\n    now[j] = sen[i];\n    if (j == 0)\n      begin = i;\n    if (now[j] == ' ' || sen[i + 1] == '\u0000') {\n\n      end = i;\n      if (sen[i + 1] == '\u0000')\n        now[j + 1] = '\u0000';\n      else\n        now[j] = '\u0000';\n      if (strcmp(now, old) == 0) {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", newone);\n        else\n          printf(\"%s \", newone);\n\n      } else {\n        if (sen[i + 1] == '\u0000')\n          printf(\"%s\", now);\n        else\n          printf(\"%s \", now);\n      }\n      j = -1;\n    }\n    i++;\n    j++;\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101];\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char word[100][100];\n  int len = strlen(s); \n  int i, j = 0, n = 0, flag = 0;\n  for (i = 0; s[i] != '\\0'; i++) \n  {\n    if (s[i] == ' ') {\n      flag = 0;\n    } else if (flag == 0) {\n      flag = 1;\n      n++;\n    }\n  }\n  int count = 0;\n  int count1[100];\n  for (i = 0; i < n; i++) {\n    count1[i] = 0;\n    do {\n      word[i][j - count] = s[j];\n      count1[i]++;\n      j++;\n    } while (s[j] != ' ' && s[j] != '\\0');\n    count1[i]++;\n    word[i][j - count] = '\\0';\n    j++;\n    count = count + count1[i];\n  }\n  for (i = 0; i < n; i++) \n  {\n    if (strcmp(word[i], a) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n  for (i = 0; i < n - 1; i++) \n  {\n    cout << word[i] << \" \";\n  }\n  cout << word[n - 1];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34987", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][100];\n  int i, j, l = 0;\n  while (cin >> s[l++])\n    ;\n  l--;\n  for (i = 0; i < l - 2; i++) {\n    if (strcmp(s[i], s[l - 2]) == 0) {\n      for (j = 0; j <= strlen(s[l - 1]); j++)\n        s[i][j] = s[l - 1][j];\n    }\n  }\n  for (i = 0; i < l - 3; i++)\n    cout << s[i] << \" \";\n  printf(\"%s\", s[l - 3]);\n  return 0;\n}\n"}
{"label": "19", "index": "34988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {\"\\0\"}, a[100] = {\"\\0\"}, b[100] = {\"\\0\"};\n  int i, j, x = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      cin.get(s[i][j]);\n      if (s[i][j] == 32) {\n        s[i][j] = 0;\n        j = 100;\n      } else if (s[i][j] == 10) {\n        s[i][j] = 0;\n        j = i = 100;\n      }\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(a[j]);\n    if (a[j] == 32 || a[j] == 10) {\n      a[j] = 0;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    cin.get(b[j]);\n    if (b[j] == 32 || b[j] == 10) {\n      b[j] = 0;\n      break;\n    }\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (a[j] == s[i][j])\n        x = x + 1;\n    }\n    if (x == 100)\n      for (j = 0; j < 100; j++)\n        s[i][j] = b[j];\n    else\n      x = 0;\n  }\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (s[i][j] != 0 && s[i][j + 1] == 0 && s[i + 1][0] != 0)\n        printf(\"%c \", s[i][j]);\n      else if (s[i][j] != 0)\n        cout << s[i][j];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  scanf(\"%s \", a);\n  scanf(\"%s%s\", b, c);\n  int i, j, k, strat;\n  strat = 0;\n  for (i = strat; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0])\n      for (j = 1, k = i + 1; j < strlen(b); j++, k++)\n        if (b[j] != a[k])\n          break;\n    if (j == strlen(b) && i == 0) {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      cout << c;\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n\n    else if (j == strlen(b) && a[i - 1] == ' ') {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n    j = 0;\n  }\n  for (i = strat; a[i] != '\u0000'; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "34990", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int la, lb, i, j, count = 1;\n  char a[1000], b[100], c[100];\n  cin.getline(a, 1000);\n  la = strlen(a);\n  cin.getline(b, 100);\n  lb = strlen(b);\n  cin.getline(c, 100);\n  do {\n    for (i = count - 1; i <= la - 1; i++) {\n      if (a[i] != b[0] || i >= 1 && a[i - 1] != ' ') {\n        cout << a[i];\n        count++;\n      } else\n        break;\n    }\n    if (a[i] == b[0] && (i >= 1 && a[i - 1] == ' ' || i == 0)) {\n      for (j = 0; j <= lb - 1; j++)\n        if (a[i + j] != b[j])\n          break;\n      count = count + j + 1;\n      if (j == lb && ((i + j) < la && a[i + j] == ' '))\n        cout << c << \" \";\n      else if (i + j == la)\n        printf(\"%s\", c);\n      else\n        for (j = i; j <= count - 2; j++)\n          cout << a[j];\n    }\n  } while (count < la);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "34991", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[1000] = \"\u0000\";\n  char word_1[101] = \"\u0000\";\n  char word_2[101] = \"\u0000\";\n  char word_1_1[101] = \"\u0000\";\n  int number[101] = {0};\n  int i, j, k;\n  int sum;\n  int num = 0;\n  int m = 0;\n\n  cin >> sen;\n  cin >> word_1;\n  cin >> word_2;\n  for (i = 0; i <= strlen(sen) - strlen(word_1); i++) {\n    sum = 0;\n    for (j = 0; j <= strlen(word_1) - 1; j++)\n      word_1_1[j] = sen[j + i];\n    for (j = 0; j <= strlen(word_1) - 1; j++) {\n      if (word_1_1[j] != word_1[j])\n        sum = sum + 1;\n    }\n    if ((sum == 0) && (i != 0) && (sen[i - 1] != ' '))\n      sum = sum + 1;\n    if (sum == 0) {\n      number[m] = i;\n      m = m + 1;\n      num = num + 1;\n    }\n  }\n  for (k = 1; k <= num; k++) {\n\n    if (k == 1)\n      for (j = 0; j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    if (k != 1)\n      for (j = number[k - 2] + strlen(word_1); j < number[k - 1]; j++)\n        printf(\"%c\", sen[j]);\n    for (j = 0; j < strlen(word_2); j++)\n      printf(\"%c\", word_2[j]);\n    if (k == num) {\n      if (number[k - 1] + strlen(word_1) == strlen(sen))\n        printf(\" \");\n      else {\n        for (j = number[k - 1] + strlen(word_1); j < strlen(sen); j++) {\n\n          if (j == strlen(sen) - 1)\n            printf(\"%c \", sen[j]);\n          else\n            printf(\"%c\", sen[j]);\n        }\n      }\n    }\n  }\n\n  if (num == 0)\n    printf(\"%s \", sen);\n  return 0;\n}\n"}
{"label": "19", "index": "34992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, flag = 1;\n  int i, j, k = -1, l;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ')\n      n++;\n  }\n  for (i = 0; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = strcmp(words[i], a);\n\n    if (l == 0) {\n      strcpy(words[i], b);\n      flag = 0;\n    }\n  }\n\n  if (flag == 0) {\n    printf(\"%s\", words[0]);\n    for (i = 1; i < n; i++)\n      printf(\" %s\", words[i]);\n  }\n  if (flag == 1) {\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "34993", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  unsigned int i = 0, j = 0;\n  char s[101];\n  char a[101];\n  char b[101];\n  char tmp[101];\n\n  scanf(\"%s \", s);\n  cin >> a;\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      tmp[j] = s[i];\n      j++;\n    } else {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(tmp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", tmp);\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(tmp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", tmp);\n  return 0;\n}\n"}
{"label": "19", "index": "34994", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char s[201], a[101], b[101]; \n  int S, A;                    \n  int i, j, m = 0;             \n  cin.getline(s, 201);\n  S = strlen(s); \n  cin.getline(a, 101);\n  A = strlen(a);            \n  cin.getline(b, 101);      \n  for (i = 0; i < S; i++) { \n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++; \n      }\n      if ((i == 0) && (m == A)) {\n        cout << b;     \n        i = i + A - 1; \n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;     \n        i = i + A - 1; \n      } else\n        cout << s[i]; \n      m = 0;          \n    } else\n      cout << s[i]; \n  }\n  return 0; \n}\n"}
{"label": "19", "index": "34995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, al, bl, cl;\n  char c[1000] = {\"\"}, a[100] = {\"\"}, b[100] = {\"\"};\n  char *p, *q;\n\n  scanf(\"%s \", c);\n\n  cin >> a;\n\n  cin >> b;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (p = c; p < c + cl;) {\n    q = p;\n    for (; *q != ' ' && *q != '\u0000'; q++)\n      ;\n    if ((q - p) != al) {\n      for (; p < q; p++)\n        printf(\"%c\", *p);\n      if (q != c + cl)\n        cout << \" \", p++;\n    } else {\n      for (j = 0, q = p; j < al; q++, j++)\n        if (*q != a[j])\n          break;\n      if (j == al) {\n        if (q != c + cl)\n          printf(\"%s \", b);\n        else\n          printf(\"%s\", b);\n        p = p + al + 1;\n      } else\n        for (; p <= q; p++)\n          printf(\"%c\", *p);\n    }\n  }\n}\n"}
{"label": "19", "index": "34996", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[25], c[25], d;\n  int m, n, p[25], q, i, j;\n\n  i = 0;\n  do {\n    scanf(\"%s\", &a[i]);\n    i++;\n  } while (getchar() != '\\n');\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (j = 0; j < i; j++) {\n    p[j] = 1;\n    if (strcmp(a[j], b) == 0) {\n      p[j] = 0;\n    }\n  }\n  for (j = 0; j < i; j++) {\n    if (j != 0) {\n      printf(\" \");\n    }\n    if (p[j] != 0)\n      printf(\"%s\", a[j]);\n    else\n      printf(\"%s\", c);\n  }\n}\n"}
{"label": "19", "index": "34997", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[10000];\n  char word[100][100];\n  char w1[100], w2[100];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", w1);\n\n  cin >> w2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ')\n      word[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(word[i], w1) == 0)\n      strcpy(word[i], w2);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "34998", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, w;\n  char a[100] = {0}, b[100] = {0}, c[100] = {0}, d[100][100] = {'\u0000'};\n\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  char *pc, *pa, *pb, (*pd)[100];\n  pa = &a[0];\n  pb = &b[0];\n  pc = &c[0];\n  pd = d;\n  int k = 0, ll = strlen(c);\n  for (i = 0;; i++) {\n    for (j = 0; *(pa + k) != ' '; j++) {\n      if (*(pa + k) == '\u0000') {\n        (*(*(pd + i) + j)) = (*(pa + k));\n        break;\n      }\n      (*(*(pd + i) + j)) = (*(pa + k));\n      k++;\n    }\n    (*(*(pd + i) + j)) = '\u0000';\n    if ((*(pa + k)) == '\u0000')\n      break;\n    k++;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int l = strlen(d[i]);\n    for (j = 0; j < l + 1; j++) {\n      if ((*(*(pd + i) + j)) == (*(pb + j))) {\n        w = 1;\n        continue;\n      } else {\n        w = 0;\n        break;\n      }\n    }\n    if (w) {\n      for (k = 0; k < ll; k++) {\n        (*(*(pd + i) + k)) = (*(pc + k));\n      }\n      (*(*(pd + i) + k)) = '\u0000';\n    } else\n      continue;\n  }\n  for (i = 0; i < count; i++) {\n    if (i > 0)\n      cout << \" \";\n    printf(\"%s\", d[i]);\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "34999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, r = 1, j;\n  char a[100], b[100], c[200];\n  cin >> c;\n  scanf(\"%s \", a);\n  cin >> b;\n  for (i = 0; i < 100; i++) {\n    if (c[i] == 'G' && c[i + 1] == 'I' && c[i + 2] == 'S' && c[i - 1] == ' ') {\n      for (j = 100 + r * 3; j >= (i + 3); j--)\n        c[j] = c[j - 3];\n      r = r + 1;\n      c[i] = 'W';\n      c[i + 1] = 'e';\n      c[i + 2] = 'b';\n    }\n    if (c[i] == 'Y' && c[i + 1] == 'o' && c[i + 2] == 'u') {\n\n      c[i] = 'I';\n      for (j = i + 1; j < 100; j++)\n        c[j] = c[j + 2];\n    }\n    if (c[i] == 'o' && c[i + 1] == 'f' && c[i - 1] == ' ') {\n      for (j = 100 + r * 1; j >= (i + 1); j--)\n        c[j] = c[j - 1];\n      r = r + 1;\n      c[i] = 'f';\n      c[i + 1] = 'o';\n      c[i + 2] = 'r';\n    }\n  }\n  printf(\"%s\", c);\n  return 0;\n}\n"}
{"label": "19", "index": "35000", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  for (i = 0; i < strlen(A); i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(C[i], B) == 0) {\n      strcpy(C[i], T);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    cout << C[i] << \" \";\n  }\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35001", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], s[100], ss[100][100] = {'\u0000'}, d[100] = {'\u0000'};\n  int i, j, m, n, t, k, l, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  t = strlen(s);\n  n = 0;\n  m = 0;\n  for (i = 0; i < t; i++) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      ss[m][n] = s[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (j = 0; j <= m; j++) {\n    if (strcmp(ss[j], a) == 0) {\n      strcpy(ss[j], b);\n    }\n  }\n  k = 0;\n  l = 0;\n  for (p = 0;; p++) {\n    if (ss[k][l] == '\u0000' && k != m) {\n\n      d[p] = ' ';\n      k++;\n      l = 0;\n\n    } else if (ss[k][l] != '\u0000') {\n      d[p] = ss[k][l];\n      l++;\n    } else {\n      break;\n    }\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"};\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0;;) {\n    for (j = 0; c[i] != ' ' && c[i] != '\u0000'; i++, j++)\n      d[j] = c[i];\n    d[j] = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", d[k]);\n    if (c[i] != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n}\n"}
{"label": "19", "index": "35003", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p, *q;\n  int k, m = 0;\n  char *s, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n  scanf(\"%s %s\", a, b);\n\n  k = strlen(a);\n  p = s;\n  q = a;\n\n  while (*p != '\u0000') {\n\n    if (m == k) {\n      if (*p == ' ' || *p == '\u0000') {\n        printf(\"%s\", b);\n        m = 0;\n        q = a;\n      } else {\n        cout << a;\n        m = 0;\n        q = a;\n      }\n    }\n\n    if (*p == *q) {\n      m++;\n      if (m == 1) {\n        if (p == s) {\n          p++;\n          q++;\n        } else {\n          p--;\n          if (*p == ' ') {\n            p = p + 2;\n            q++;\n          } else {\n            m = 0;\n            q = a;\n            p++;\n            printf(\"%c\", *p);\n            p++;\n          }\n        }\n      } else {\n        p++;\n        q++;\n      }\n    } else {\n      p = p - m;\n      printf(\"%c\", *p);\n      m = 0;\n      q = a;\n      p++;\n    }\n  }\n  if (m == k)\n    printf(\"%s\", b);\n}\n"}
{"label": "19", "index": "35004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100], t[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  while (i < len) {\n    j = 0;\n    while (isgraph(c[i]))\n      t[j++] = c[i++];\n    t[j] = '\u0000';\n    if (strcmp(t, a))\n      printf(\"%s\", t);\n    else\n      printf(\"%s\", b);\n    if (c[i])\n      printf(\"%c\", c[i++]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35005", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint n, m, k;\nchar a[110];\nchar from[110], to[110];\nint main() {\n  while (scanf(\"%s \", a)) {\n    char temp[110];\n    temp[0] = 0;\n    int c = 0;\n    scanf(\"%s%s\", from, to);\n    for (int i = 0; a[i]; i++) {\n      if (a[i] == ' ') {\n        if (strcmp(temp, from) == 0) {\n          printf(\"%s \", to);\n        } else\n          printf(\"%s \", temp);\n        temp[0] = 0;\n        c = 0;\n\n      } else {\n        temp[c++] = a[i];\n        temp[c] = 0;\n      }\n    }\n    if (strcmp(temp, from) == 0) {\n      printf(\"%s \", to);\n    } else\n      cout << temp << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35006", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[100][100];\n  char str[1000];\n\n  scanf(\"%s \", str);\n  int len = strlen(str);\n  int i;\n  int count = 0;\n  for (i = 0; i < len + 1; i++) {\n    if (str[i] == ' ' || (str[i] == '\u0000')) {\n      int k, q = 0;\n      for (k = i - 1; k >= 0; k--) {\n        if (str[k] == ' ')\n          break;\n      }\n\n      for (++k; k <= i; k++) {\n        string[count][q] = str[k];\n        q++;\n      }\n      string[count][q - 1] = '\u0000';\n      count++;\n    }\n  }\n  char from[100];\n  char to[100];\n\n  scanf(\"%s \", from);\n\n  scanf(\"%s \", to);\n  char *nowword;\n  int j = 0;\n  for (j = 0; j < count; j++) {\n    nowword = string[j];\n    if (strcmp(nowword, from) == 0) {\n      strcpy(nowword, to);\n    }\n  }\n  printf(\"%s\", string[0]);\n  for (i = 1; i < count; i++)\n    printf(\" %s\", string[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35007", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[101], a[101], b[101], c[101];\nint i = 0, len_str, len_a, len_b, pos;\nint main(void) {\n\n  scanf(\"%s \", str);\n  len_str = strlen(str);\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      cout << c;\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35008", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint equal(char *x, char *y) \n{\n  for (int k = 0; x[k] != '\\0' || y[k] != '\\0'; k++)\n    if (x[k] != y[k])\n      return 0;\n  return 1;\n}\n\nint main() {\n  char str[100][100]; \n\n  int number = 0; \n\n  while (1) \n  {\n    cin >> str[number++];  \n    if (cin.get() == '\\n') \n      break;\n  }\n\n  char str1[100], str2[100]; \n  cin >> str1 >> str2;\n\n  for (int k = 0; k != number - 1; k++) \n  {\n    if (equal(str[k], str1)) {\n      cout << str2 << \" \";\n      continue;\n    }\n    cout << str[k] << \" \";\n  }\n  if (equal(str[number - 1], str1))\n    cout << str2 << endl;\n  else\n    cout << str[number - 1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35009", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, s, k, l, m, n;\n  char a[202], b[102], c[102];\n  cin.getline(a, 202);\n  cin.getline(b, 102);\n  cin.getline(c, 102);\n  l = strlen(c);\n  m = strlen(a);\n  n = strlen(b);\n  for (j = 0; j < m;) {\n    k = 0;\n    if ((j == 0) || ((j > 0) && (a[j - 1] == ' '))) {\n      for (i = j; i < j + n; i++)\n        if (a[i] == b[i - j])\n          k++;\n      if ((k == n) && (a[j + n] != ' ') && (a[j + n] != '\\0')) {\n        k = 0;\n      }\n    }\n\n    if (k == n) {\n      if (l > n)\n        for (s = 0; s < l - n; s++)\n          for (i = m + s; i >= j + n + s; i--)\n            a[i + 1] = a[i];\n      if (l < n) {\n        for (s = 0; s < n - l; s++)\n          for (i = j + n - s - 1; i < m - s; i++)\n            a[i] = a[i + 1];\n        for (i = m + l - n; i < m; i++)\n          a[i] = '\\0';\n      }\n      for (i = j; i < j + l; i++)\n        a[i] = c[i - j];\n      j += l;\n      m = m + l - n;\n    } else\n      j++;\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35010", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char s1[101][101];\n  int i, j, k;\n  k = 0;\n  j = 0;\n  i = 0;\n  int tag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    s1[j][k] = s[i];\n    k++;\n    if (s[i] == ' ') {\n      s1[j][k - 1] = '\u0000';\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  s1[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s1[i], a) == 0)\n      strcpy(s1[i], b);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", s1[i]);\n\n  cout << s1[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35011", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000];\n  char a[50];\n  char b[50];\n  cin.getline(str, 1000);\n  cin.getline(a, 50);\n  cin.getline(b, 50);\n  int i, j;\n  for (i = 0; str[i] != '\\0'; i++) {\n    int len = 0, k;\n    for (j = 0; a[j] != '\\0'; j++)\n      if (str[i + j] == a[j] && (str[i - 1] == ' ' && i != 0) || i == 0)\n        len++;\n    if (len == strlen(a) && (str[i + j] == ' ' || str[i + j] == '\\0')) {\n      if (strlen(a) >= strlen(b)) {\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        for (k = i + strlen(b); str[k] != '\\0'; k++)\n          str[k] = str[k + strlen(a) - strlen(b)];\n      } else {\n        for (k = strlen(str) + strlen(b) - strlen(a); k >= i + strlen(a); k--)\n          str[k] = str[k + strlen(a) - strlen(b)];\n        for (k = 0; k < strlen(b); k++)\n          str[i + k] = b[k];\n        i += strlen(b);\n      }\n    }\n  }\n  printf(\"%s\\n\", str);\n  return 0;\n}\n"}
{"label": "19", "index": "35012", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, i, j = 0, k = 0;\n  char s[100], a[20], b[20], str[50][20] = {\" \"}, (*p)[20];\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    if (s[i] != ' ')\n      str[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n    if (s[i + 1] == '\u0000')\n      j++;\n  }\n  p = &str[0];\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, *(p + i)) == 0)\n      strcpy(*(p + i), b);\n  }\n  for (i = 0; i < j; i++) {\n    if (i == 0)\n      printf(\"%s\", *(p + i));\n    else\n      printf(\" %s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "35013", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int i, j, l, t, k = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < t; j++) {\n      if (i + j - 1 > l)\n        break;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if ((a[i - 1] == ' ' || i == 0) && k == t &&\n          (a[i + t] == ' ' || i == l - t)) {\n        printf(\"%s\", c);\n        i = i + t;\n      }\n    }\n    if (i > l - 1)\n      break;\n    if ((k != t || (t == k && (a[i - 1] != ' ' || i != 0) || a[i + t] != ' ' ||\n                    i != l - t)))\n      printf(\"%c\", a[i]);\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int x, y, z, i, j, k = 0, c, flag = 0;\n  char s[200], a[100], b[100], temp[300];\n\n  scanf(\"%s \", s);\n  scanf(\"%s \", a);\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n\n  for (i = 0; i < x + y;) {\n    if (flag == 0) {\n      c = 1;\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n\n      for (j = 0; j < y; j++)\n        if (a[j] != s[i + j])\n          c *= 0;\n\n      if (c != 1) {\n        temp[k] = s[i];\n        i++;\n        k++;\n      } else {\n        for (j = 0; j < z; j++, k++)\n          temp[k] = b[j];\n        i += y;\n      }\n\n    } else {\n\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n      temp[k] = s[i];\n      k++;\n      i++;\n    }\n  }\n  for (i = 0; i < k - y; i++)\n    cout << temp[i];\n}\n"}
{"label": "19", "index": "35015", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[100];\n\n  cin >> zfc;\n  char b[100][100];\n  int l = strlen(zfc);\n  int n = 0, k = 0, i;\n  for (i = 0; i < l; i++) {\n    if (zfc[i] != ' ' && zfc[i] != ',') {\n      b[n][k] = zfc[i];\n      k++;\n    } else {\n      b[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  b[n][k] = '\u0000';\n  char h[100], f[100];\n\n  cin >> h;\n\n  cin >> f;\n  int j;\n  for (j = 0; j < n; j++) {\n    if (strcmp(b[j], h) == 0) {\n      strcpy(b[j], f);\n      printf(\"%s \", b[j]);\n    } else {\n      printf(\"%s \", b[j]);\n    }\n  }\n  if (strcmp(b[n], h) != 0)\n    printf(\"%s\", b[n]);\n  if (strcmp(b[n], h) == 0)\n    printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35016", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  char d[50][100];\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n\n  int chang, i, n, m;\n  int u = 0, v = 0;\n  chang = strlen(a);\n\n  for (i = 0; i < chang; i++) {\n    if (a[i] != ' ') {\n      d[u][v] = a[i];\n      v++;\n    } else {\n      v = 0;\n      u++;\n    }\n  }\n\n  for (i = 0; i < u; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      printf(\"%s \", c);\n    } else {\n      cout << d[i] << \" \";\n    }\n  }\n\n  if (strcmp(b, d[i]) == 0) {\n    cout << c;\n  } else {\n    printf(\"%s\", d[u]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w[1000], s[100][100], a[100], b[100];\n  int i = 0, j = 0, k = 0, d;\n\n  cin >> w;\n\n  cin >> a;\n\n  cin >> b;\n  while (w[i] != '\u0000') {\n    while (w[i] != ' ' && w[i] != '\u0000') {\n      s[j][k] = w[i];\n      i++;\n      k++;\n    }\n    s[j][k] = '\u0000';\n    j++;\n\n    k = 0;\n    while (w[i] == ' ') {\n      i++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    d = strcmp(s[i], a);\n    if (d == 0) {\n      strcpy(s[i], b);\n    }\n  }\n  printf(\"%s\", s[0]);\n  for (i = 1; i < j; i++) {\n    printf(\" %s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35018", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nchar former[150];\nchar zhao[10], huan[10];\nvoid alter(char *p) {\n\n  char *p2;\n  p2 = p + strlen(zhao) + 1;\n  char p3[100];\n  strcpy(p3, p2);\n  *(p + 1) = '\u0000';\n  strcat(former, huan);\n  strcat(former, p3);\n}\n\nint main()\n\n{\n\n  int i;\n\n  cin >> former;\n  cin >> zhao >> huan;\n  char *p0, *p1;\n  p0 = former;\n  for (; *p0 != '\u0000'; p0++) {\n    if (*p0 == ' ' && *(p0 + 1) == zhao[0]) {\n      for (p1 = p0 + 1, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n        ;\n      if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000')\n        alter(p0);\n    }\n  }\n  p0 = former;\n  for (p1 = p0, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n    ;\n  if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000') {\n    char *p2;\n    p2 = p0 + strlen(zhao);\n    char p3[100];\n    strcpy(p3, p2);\n    strcat(huan, p3);\n    printf(\"%s\", huan);\n    return 0;\n  }\n\n  printf(\"%s \", former);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35019", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100], d[200];\n  int i, j, na = 0, nb = 0, nc = 0, m = 0, l = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    na++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; i <= na + x * (nc - nb) - 1; i++) {\n    if (a[i] == b[0]) {\n      l = 1;\n      for (j = 1; j <= nb - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else {\n          l = l + 1;\n        }\n      }\n      if (((l == nb) && (a[i - 1] == ' ') && (a[i + nb] == ' ')) ||\n          ((i == 0) && (l == nb) && (a[i + nb] == ' ')) ||\n          ((l == nb) && (i >= na + x * (nc - nb) - nb - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + nb; m <= na + 2; m++) {\n          d[m - i - nb] = a[m];\n        }\n        for (m = i; m <= i + nc - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + nc; m <= na + nc - nb + 2; m++) {\n          a[m] = d[m - i - nc];\n        }\n        i = i + nc - nb;\n        x = x + 1;\n      }\n    }\n  }\n  a[na + x * (nc - nb)] = '\u0000';\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35020", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char Sen[200], word[200], exchange[200], temp[200];\n\n  cin >> Sen;\n\n  cin >> word;\n\n  cin >> exchange;\n  int n = strlen(Sen), i;\n  int m;\n  m = 0;\n  for (i = 0; i < n; i++) {\n    if (Sen[i] != ' ') {\n      temp[m] = Sen[i];\n      m++;\n    } else {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n    if (i == n - 1) {\n      temp[m] = '\u0000';\n      if (strcmp(temp, word) == 0)\n        printf(\"%s \", exchange);\n      else\n        printf(\"%s \", temp);\n      m = 0;\n    }\n  }\n}\n"}
{"label": "19", "index": "35021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100];\n  char a[100];\n  char b[100];\n  char s2[15][20];\n  int i, k, x = 0, m, n;\n  char c, d;\n\n  scanf(\"%s \", s1);\n\n  cin >> a;\n\n  cin >> b;\n  m = 0;\n  n = 0;\n  k = 0;\n  for (i = 0; (c = s1[i]) != '\u0000'; i++) {\n    if (c != ' ') {\n      s2[k][m] = c;\n      m++;\n    } else {\n      s2[k][m] = '\u0000';\n      m = 0;\n      k++;\n      n++;\n    }\n  }\n  s2[n][m] = '\u0000';\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s2[i], a) == 0) {\n      x = 1;\n      for (k = 0; (d = b[k]) != '\u0000'; k++)\n        s2[i][k] = b[k];\n\n      s2[i][k] = '\u0000';\n    }\n  }\n  if (x == 1) {\n    for (i = 0; i < n; i++) {\n      printf(\"%s \", s2[i]);\n    }\n    cout << s2[n];\n  } else {\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35022", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  scanf(\"%s \", b);\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n    d[j] = '\\0';\n  }\n  cout << d << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35023", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120], a[120], b[120];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int len_s = strlen(s);\n  int len_a = strlen(a);\n  int i = 0, j;\n  while (i < len_s) {\n    if (i == 0 || s[i - 1] == ' ') {\n      for (j = 0; j < len_a && i + j < len_s; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (j == len_a) {\n        cout << b;\n        i += len_a;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100][100] = {{0, 0}}, str2[100], str3[100], str4[100];\n  int n, i = 0, j = 0, k[100] = {0}, m = 0;\n  cin >> str2;\n  scanf(\" \");\n  scanf(\"%s \", str3);\n  scanf(\" \");\n  cin >> str4;\n  n = strlen(str2);\n  m = strlen(str4);\n  for (i = 0; i < n; i++) {\n    if (str2[i] == ' ') {\n      j = j + 1;\n      k[j] = 0;\n    } else {\n      str1[j][k[j]] = str2[i];\n      k[j] = k[j] + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str1[i], str3) == 0) {\n      if (k[i] < m) {\n        memset(str1[i], 0, m);\n        strcpy(str1[i], str4);\n      } else {\n        memset(str1[i], 0, k[i]);\n        strcpy(str1[i], str4);\n      }\n    }\n  }\n  cout << str1[0];\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str1[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35025", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[101], a[101], b[101], temp[101];\nvoid judge(void) {\n  if (strcmp(temp, a) == 0)\n    printf(\"%s\", b);\n  else {\n    printf(\"%s\", temp);\n  }\n}\nvoid check(void) {\n  int i, n = strlen(s), p = 0, j;\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      temp[p] = s[i];\n      p++;\n    } else {\n      temp[p + 1] = '\u0000';\n      judge();\n      printf(\" \");\n      for (j = 0; j < p + 2; j++) {\n        temp[j] = 0;\n      }\n      p = 0;\n    }\n  }\n  temp[p + 1] = '\u0000';\n  judge();\n}\nint main() {\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  check();\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35026", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101], word1[101], word2[101], danci[50][101];\n  int LEN[50], LEN1, i, k = 0, j = 0;\n\n  cin >> sen;\n\n  cin >> word1;\n\n  cin >> word2;\n  LEN1 = strlen(sen);\n  for (i = 0; i < LEN1; i++) {\n    if (sen[i] != ' ') {\n      danci[j][k] = sen[i];\n      k++;\n    } else {\n      danci[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  danci[j][k] = '\u0000';\n  for (i = 0; i < j; i++) {\n    LEN[i] = strlen(danci[i]);\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], word1) == 0)\n      strcpy(danci[i], word2);\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s \", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35027", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[100][100] = {'\u0000'};\n  int i, k = 0, j = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[k][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ') {\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      printf(\" %s\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35028", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], copy[100][100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n\n  int i, j, k;\n  j = k = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    copy[j][k] = s1[i];\n    if (s1[i + 1] == ' ' || s1[i + 1] == '\u0000') {\n      copy[j][k + 1] = '\u0000';\n      k = 0;\n      j++;\n      i++;\n      continue;\n    }\n    k++;\n  }\n\n  for (k = 0; k < j; k++) {\n    if ((strcmp(copy[k], s2)) == 0) {\n      strcpy(copy[k], s3);\n    }\n  }\n  cout << copy[0];\n  for (k = 1; k < j; k++) {\n    printf(\" %s\", copy[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *word;\n  int i, j = 0, flag = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  word = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  i = 0;\n  while (*(s + i)) {\n    if (*(s + i) == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      *(word + j) = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        cout << word;\n    } else {\n      *(word + j) = *(s + i);\n      j++;\n    }\n    i++;\n  }\n  *(word + j) = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n}\n"}
{"label": "19", "index": "35030", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100];\n  int m, i, n = 0, k = 0, j;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  m = strlen(s);\n  for (i = 0; i < m; i++)\n    if (s[i] == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; s[k] != 32; j++) {\n      c[i][j] = s[k];\n      k++;\n    }\n    if (s[k] == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else {\n      strcpy(e[i], c[i]);\n    }\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35031", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar S[1000][100];\nint Size = 0;\nint main() {\n\n  while (!feof(stdin))\n    cin >> S[Size++];\n\n  Size--;\n  for (int i = 0; i < Size - 3; i++)\n    if (strcmp(S[i], S[Size - 2]) == 0)\n      printf(\"%s \", S[Size - 1]);\n    else\n      printf(\"%s \", S[i]);\n  if (strcmp(S[Size - 3], S[Size - 2]) == 0)\n    printf(\"%s\\n\", S[Size - 1]);\n  else {\n    cout << S[Size - 3] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\ntypedef long long ll;\n\nchar s[110], a[110], b[110];\n\nint main() {\n  while (scanf(\"%s \", s)) {\n\n    scanf(\"%s%s \", a, b);\n\n    int i = 0;\n    int lena = strlen(a);\n    while (s[i]) {\n      if (s[i] == ' ')\n        putchar(' '), i++;\n      else {\n        int j = 0;\n        for (; a[j]; j++)\n          if (a[j] != s[i + j])\n            break;\n\n        if (a[j] == 0) {\n          i += lena;\n          printf(\"%s\", b);\n        } else {\n          while (s[i] && s[i] != ' ')\n            putchar(s[i++]);\n        }\n      }\n    }\n\n    puts(\"\");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35033", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++)\n    *(s + i) = '\u0000';\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++) {\n      *(ch + j) = *(s + i);\n    }\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35034", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101], q[101];\n  int m, i, k, t, n, l, N, z = 0;\n\n  cin >> a;\n  m = strlen(a);\n  strcpy(q, a);\n\n  scanf(\"%s%s\", &b, &c);\n  n = strlen(b);\n  l = strlen(c);\n\n  for (i = 0; i < m; i++) {\n    N = n;\n\n    if ((i == 0) ||\n        (a[i - 1] == 32 && a[i] == b[0] && (a[i + n] == 32 || a[i + n] == '\u0000')))\n      for (k = i, t = 0; t < n && k < m; k++, t++) {\n        if (a[k] == b[t])\n          N--;\n      }\n    if (N == 0) {\n      z = 1;\n\n      if (n >= l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m - (n - l)] = '\u0000';\n      }\n      if (n < l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m + (l - n)] = '\u0000';\n      }\n      m = strlen(a);\n      strcpy(q, a);\n    }\n  }\n\n  if (z == 1)\n    cout << a;\n  if (z == 0 && N != 0)\n\n    for (i = 0; i < m; i++)\n      printf(\"%c\", q[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35035", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], a[100], b[100];\n  int i = 0, j = 0, k = 0, m = 0, n = 0;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(str);\n  char words[100][100] = {0};\n  for (k = 0; k < n; k++) {\n    if (str[k] != 32) {\n      words[i][j] = str[k];\n      j++;\n    } else if (str[k] == 32) {\n      i++;\n      j = 0;\n    }\n  }\n  m = i + 1;\n  for (i = 0; i < m; i++) {\n    if (strcmp(words[i], a) == 0)\n      strcpy(words[i], b);\n    else\n      continue;\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", words[i]);\n  printf(\"%s \", words[m - 1]);\n}\n"}
{"label": "19", "index": "35036", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  char word[51][20];\n  char word1[20], word2[20];\n\n  cin >> str;\n  cin >> word1 >> word2;\n  int point, i, counter;\n  counter = 1;\n  i = 0;\n  for (point = 0; str[point] != '\u0000'; point++) {\n    if (str[point] == ' ') {\n      word[counter][i] = '\u0000';\n      counter++;\n      i = 0;\n    } else {\n      word[counter][i] = str[point];\n      i++;\n    }\n  }\n  word[counter][i] = '\u0000';\n\n  int k;\n  for (k = 1; k <= counter; k++) {\n    int flag = 0;\n    for (i = 0; word1[i] != '\u0000'; i++) {\n      if (word[k][i] != word1[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << word2;\n    else\n      printf(\"%s\", word[k]);\n    if (k != counter)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35037", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ch[100][100], str1[100], str2[100]; \n  int i = 0, j;                            \n  do                                       \n  {\n    cin >> ch[i];\n    i++;\n  } while (getchar() != '\\n');\n  cin >> str1 >> str2;\n  for (j = 0; j < i; j++) {\n    if (strcmp(str1, ch[j]) == 0) \n    {\n      strcpy(ch[j], str2);\n    }\n  }\n  for (j = 0; j < i - 1; j++) \n  {\n    cout << ch[j] << \" \";\n  }\n  cout << ch[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][1000] = {1}, b[100], c[100], d;\n  int i, n = 0;\n  for (i = 0;; i++) {\n    cin >> a[i] >> d;\n    n++;\n    if (d == '\\n')\n      break;\n  }\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i < n; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\"%s\", c);\n    else\n      printf(\"%s\", a[i]);\n    if (i == n - 1)\n      cout << \"\\n\";\n    else\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char cc[500] = {'\u0000'}, c1[20] = {'\u0000'}, c2[20] = {'\u0000'}, c[30][20] = {'\u0000'}, *p1,\n       *p2, *p3, *p4;\n  int a, b, d, e = 0, f = 0, h, i;\n\n  scanf(\"%s \", cc);\n\n  scanf(\"%s \", c1);\n\n  cin >> c2;\n  p1 = &c[0][0];\n  p2 = &c1[0];\n  p3 = &c2[0];\n  p4 = &cc[0];\n  for (a = 0; a < 500; a++) {\n    if (*(p4 + a) == ' ') {\n      e++;\n      f = 0;\n    } else if (*(p4 + a) != '\u0000') {\n      *(p1 + e * 20 + f) = *(p4 + a);\n      f++;\n    } else {\n      break;\n    }\n  }\n  i = strlen(c1);\n  h = strlen(c2);\n  for (a = 0; a < e + 1; a++) {\n    for (b = 0; b < i; b++) {\n      if (*(p1 + a * 20 + b) != *(p2 + b)) {\n        break;\n      }\n    }\n    if (b == i) {\n      for (d = 0; d < h; d++) {\n        *(p1 + a * 20 + d) = *(p3 + d);\n      }\n      for (d = h; d < 20; d++) {\n        *(p1 + a * 20 + d) = '\u0000';\n      }\n    }\n  }\n  for (d = 0; d < e; d++) {\n    cout << c[d] << \" \";\n  }\n  printf(\"%s \", c[e]);\n}\n"}
{"label": "19", "index": "35040", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar chStr[103][101];\nint iLen = 0;\nint main() {\n  int i, j = 0, k;\n  while (cin >> chStr[j])\n    j++;\n  while (chStr[j - 1][iLen])\n    iLen++;\n  for (i = 0; i < j - 2; ++i) {\n    if (!strcmp(chStr[i], chStr[j - 2])) {\n      for (k = 0; k < 101; ++k)\n        chStr[i][k] = 0;\n\n      for (k = 0; k < iLen; ++k)\n        chStr[i][k] = chStr[j - 1][k];\n    }\n  }\n  for (i = 0; i < j - 3; ++i) {\n    cout << chStr[i] << \" \";\n  }\n  printf(\"%s\\n\", chStr[j - 3]);\n  return 0;\n}\n"}
{"label": "19", "index": "35041", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char x[20], y[20], z[100][20];\n  for (i = 0;; i++) {\n    scanf(\"%s\", &z[i]);\n    if (getchar() != ' ')\n      goto hell;\n  }\nhell:;\n  scanf(\"%s\", &x);\n  cin >> y;\n  for (j = 0; j <= i; j++) {\n    if (strcmp(x, z[j]) == 0) {\n      z[j][0] = 0;\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (z[j][0] == 0) {\n      printf(\"%s\", y);\n    } else\n      printf(\"%s\", z[j]);\n    if (j != i)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35042", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *p, *c, n, *end;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(p, \"%s\", c);\n    if (strcmp(c, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    p = p + strlen(c) + 1;\n    if (p >= end)\n      break;\n    printf(\"%c\", ' ');\n  }\n}\n"}
{"label": "19", "index": "35043", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  int ns, na, nb, i, j, k = 0, m, flag, p[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n\n  for (i = 0, j = 0, k = 0; i < na, j < ns; j++) {\n    if (s[j] == a[i]) {\n      flag = j;\n      i++;\n      if (i == na && (s[j - na] < 'A' || s[j + 1] > 'z')) {\n        p[k] = flag;\n        k++;\n        i = 0;\n      }\n    } else\n      i = 0;\n  }\n\n  if (k != 0) {\n    for (m = 0; m < k; m++) {\n      p[m] = p[m] + m * abs(na - nb);\n      ns = ns + m * abs(na - nb);\n      if (na == nb) {\n        for (i = 0; i < na; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1)\n          printf(\"%s \", s);\n      }\n      if (na > nb) {\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        for (i = p[m] + 1 - na + nb; i < ns - na + nb; i++)\n          s[i] = s[i + na - nb];\n        if (m == k - 1) {\n          for (i = 0; i < ns - na + nb; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n      if (na < nb) {\n        for (i = ns - 1; i > p[m]; i--)\n          s[i + nb - na] = s[i];\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1) {\n          for (i = 0; i < ns + nb - na; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n    }\n  }\n\n  else if (k == 0)\n    printf(\"%s \", s);\n}\n"}
{"label": "19", "index": "35044", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char src[1000];\n  char find[1000];\n  char replace[1000];\n\n  char temp[1000][1000];\n\n  cin >> src;\n\n  cin >> find;\n\n  cin >> replace;\n\n  int temp_count = 0;\n  int iter = 0;\n  for (int i = 0; i < strlen(src); i++) {\n    if (src[i] == ' ') {\n      for (int j = iter; j < i; j++) {\n        temp[temp_count][j - iter] = src[j];\n      }\n      temp[temp_count][i - iter] = 0;\n      temp_count++;\n      iter = i + 1;\n    }\n  }\n  for (int j = iter; j < strlen(src); j++) {\n    temp[temp_count][j - iter] = src[j];\n  }\n  temp[temp_count][strlen(src) - iter] = 0;\n  temp_count++;\n\n  for (int i = 0; i < temp_count - 1; i++) {\n    if (strcmp(temp[i], find) == 0) {\n      cout << replace << \" \";\n    } else {\n      cout << temp[i] << \" \";\n    }\n  }\n  if (strcmp(temp[temp_count - 1], find) == 0) {\n    cout << replace << endl;\n  } else {\n    cout << temp[temp_count - 1] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100];\n  char *p1, *p2, *p3, *p[100];\n  int i = 0, j;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  p1 = str1;\n  p2 = str2;\n  p3 = str3;\n  p[0] = str1;\n  for (; *p1 != '\u0000'; p1++) {\n\n    if (*p1 == ' ') {\n      i++;\n      *p1 = '\u0000';\n      p[i] = p1 + 1;\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (strcmp(p[j], p2) == 0)\n      p[j] = p3;\n  }\n  for (j = 0; j < i; j++) {\n    printf(\"%s \", p[j]);\n  }\n  printf(\"%s\", p[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35046", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[5000], w[1000][1000], w1[1000], w2[1000];\n\n  scanf(\"%s \", word);\n\n  scanf(\"%s \", w1);\n\n  cin >> w2;\n  int n, i, j = 0, k = 0, A;\n  n = strlen(word);\n  for (i = 0; i < n; i++) {\n    if (word[i] != ' ') {\n      w[k][j] = word[i];\n      j++;\n      A = 1;\n    }\n    if (word[i] == ' ' && A == 1) {\n      w[k][j] = '\u0000';\n      j = 0;\n      k++;\n      A = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(w1, w[i]) == 0) {\n      strcpy(w[i], w2);\n    }\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", w[i]);\n  }\n  printf(\"%s\", w[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35047", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n\n  scanf(\"%s \", str);\n  char a[101], b[101];\n  cin >> a >> b;\n  int n = strlen(str);\n  int i, k = 0, j = 0;\n  char c[101][101];\n  for (i = 0; i < n; i++) {\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(c[k], (str + j));\n      k++;\n      j = i + 1;\n    }\n  }\n  strcpy(c[k], (str + j));\n  k++;\n  for (i = 0; i < k; i++) {\n    if (i > 0) {\n      printf(\" \");\n    }\n    if (strcmp(c[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", c[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35048", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint n1, n2, n3;\nchar str1[100], str2[100], str3[100];\nint f(char *p) {\n  int m, n;\n  n = 0;\n  char *f;\n  f = p;\n  for (m = 0; m < n2; m++) {\n    if ((*f) == str2[m]) {\n      n++;\n    }\n    f++;\n  }\n  if (n == n2)\n    return 1;\n  else\n    return 0;\n}\nint m(char *p) {\n  if (*p >= 'a' && *p <= 'z')\n    return 1;\n  else if (*p >= 'A' && *p <= 'Z')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  cin >> str1;\n  n1 = strlen(str1);\n  scanf(\"%s\", str2);\n  n2 = strlen(str2);\n  scanf(\"%s\", str3);\n  n3 = strlen(str3);\n  int i = 0, j;\n  char *p1, *p2;\n  p1 = str1;\n  for (i = 0; (p1 - str1) < n1; i++, p1++) {\n    p2 = p1 + n2;\n    if ((f(p1) == 1) && (m(p1 - 1) == 0) && (m(p2) == 0)) {\n      for (j = 0; j < n3; j++)\n        printf(\"%c\", str3[j]);\n      p1 = p1 + n2 - 1;\n    } else {\n      cout << *p1;\n    }\n  }\n}\n"}
{"label": "19", "index": "35049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  cin >> s;\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    if (strcmp(s, from) == 0) {\n      printf(\"%s\", to);\n    } else {\n      printf(\"%s\", s);\n    }\n    s = p + 1;\n    if (*s) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35050", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101] = {0};\n  char c[101] = {0};\n  int k, f = 0;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j;\n  for (i = 0; i < len1; i++) {\n    k = 0;\n    for (j = i; j < i + len2; j++) {\n      if (a[j] == b[j - i]) {\n        k = k + 1;\n      } else {\n        break;\n      }\n    }\n    if (k == len2 && (a[i - 1] == ' ') || i - 1 < 0 && a[i + len2] == ' ') {\n      for (int k = 0; k < len3; k++) {\n        printf(\"%c\", c[k]);\n      }\n      i = i + len2 - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], s_[200][200], s__[200];\n  int i, n = 0, m, j = 0, p = 0;\n\n  scanf(\"%s \", s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    s__[i] = s[i];\n  }\n  s__[i] = ' ';\n  s__[i + 1] = '\u0000';\n  scanf(\"%s%s\", a, b);\n  for (i = 0; s__[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    if (s__[i] == ' ') {\n      s_[j][p] = '\u0000';\n      j++;\n      p = 0;\n    } else {\n      s_[j][p] = s__[i];\n      p++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++) {\n    if (strcmp(s_[j], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", s_[j]);\n    }\n  }\n  if (strcmp(s_[m - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", s_[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d[10], i = 0, j = 0, k = 0, l = 0;\n  char s[1000], q[100], w[100];\n\n  cin >> s;\n  cin >> q;\n  cin >> w; \n  for (j = 0; j < 100; j++) {\n    if (s[j] == '\u0000' && a == 0)\n      a = j; \n    if (q[j] == '\u0000' && b == 0)\n      b = j;\n    if (w[j] == '\u0000' && c == 0)\n      c = j;\n    if (a != 0 && b != 0 && c != 0)\n      break;\n  }\n  for (i = 0; i <= a; i++)\n    if (s[i] == ' ' || s[i] == '\u0000')\n      for (j = 0; j < b; j++)\n        if (q[j] != s[i - b + j])\n          break;\n        else if (s[i - b - 1] == ' ' || i == b) {\n          d[k++] = i;\n          j = b;\n        }\n  if (k != 0) \n    for (i = 0; i < a; i++) {\n      if (i == d[l] - b) {\n        for (j = 0; j < c; j++)\n          printf(\"%c\", w[j]);\n        i = d[l] - 1;\n        l++;\n      } else\n        printf(\"%c\", s[i]);\n    }\n  else\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35053", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100], p[100];\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n\n  scanf(\"%s \", s3);\n  strcat(s1, \" \");\n  int len, i, j, n = 0, y;\n  len = strlen(s1);\n  for (i = 0; i < len; i++) {\n    if (s1[i] == ' ')\n      n++;\n  }\n  int t = 0;\n  for (y = 0; y < n; y++) {\n    for (i = t, j = 0; i < len; i++, j++) {\n      if (s1[i] != ' ') {\n        p[j] = s1[i];\n      } else {\n        p[j] = '\u0000';\n        t = i + 1;\n        break;\n      }\n    }\n    if (strcmp(p, s2) == 0) {\n      strcpy(p, s3);\n    }\n    printf(\"%s\", p);\n    if (y < n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35054", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  char d[50][100];\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  cin >> c;\n\n  int chang, i, n, m;\n  int u = 0, v = 0;\n  chang = strlen(a);\n\n  for (i = 0; i < chang; i++) {\n    if (a[i] != ' ') {\n      d[u][v] = a[i];\n      v++;\n    } else {\n      v = 0;\n      u++;\n    }\n  }\n\n  for (i = 0; i < u; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      printf(\"%s \", c);\n    } else {\n      printf(\"%s \", d[i]);\n    }\n  }\n\n  if (strcmp(b, d[i]) == 0) {\n    printf(\"%s\", c);\n  } else {\n    printf(\"%s\", d[u]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000], a[100], b[100], word[100];\n  int i, j = 0, flag = 0;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  i = 0;\n  while (str[i]) {\n    if (str[i] == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      word[j] = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        cout << b;\n      else\n        printf(\"%s\", word);\n    } else {\n      word[j] = str[i];\n      j++;\n    }\n    i++;\n  }\n  word[j] = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n}\n"}
{"label": "19", "index": "35056", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[105], a[105], b[105], ch[105][105]; \n  int i, j = 0, k = 0, word, lens, lenb = 0; \n  cin.getline(s, 105, '\\n');                 \n  cin.getline(a, 105, '\\n');\n  cin.getline(b, 105, '\\n');\n  for (i = 0; i < 105; i++) {\n    if (b[i] != '\\0') \n      lenb += 1;\n    else\n      break;\n  }\n  for (i = 0; i < 105; i++) {\n    if (s[i] == ' ') \n    {\n      ch[j][k] = '\\0';       \n      k = 0;                 \n      j += 1;                \n    } else if (s[i] == '\\0') \n    {\n      ch[j][k] = s[i]; \n      lens = i - 1;    \n      word = j;        \n      break;\n    } else {\n      ch[j][k] = s[i]; \n      k += 1;          \n    }\n  }\n  for (i = 0; i <= word; i++) {\n    k = 1;\n    if (strlen(ch[i]) != strlen(a))\n      k = 0;\n    else {\n      for (j = 0; j < strlen(a); j++) \n        if (ch[i][j] != a[j])         \n          k = 0;\n    }           \n    if (k == 1) \n    {\n      for (j = 0; j <= lenb + 1; j++)\n        ch[i][j] = b[j]; \n    }\n  }\n  for (i = 0; i < word; i++) {\n    cout << ch[i] << \" \";\n    \n    \n    \n    \n    \n    \n    \n    \n  }\n  for (j = 0; j < 105; j++) {\n    cout << ch[word][j]; \n    if (ch[word][j + 1] == '\\0')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35057", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, k, m = 0;\n  char a[100], b[100], c[100];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  l = strlen(a);\n  char **p;\n  p = (char **)malloc(500 * sizeof(char *));\n  for (i = 0; i <= 499; i++)\n    p[i] = (char *)malloc(500 * sizeof(char));\n  for (k = 0, i = 0; k <= l - 1 && i <= 499; i++) {\n    for (j = 0; j <= 499; j++) {\n      if (a[k] != ' ' && a[k] != '\u0000') {\n        p[i][j] = a[k];\n        k++;\n      } else {\n        k++;\n        p[i][j] = '\u0000';\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (strcmp(p[i], b) == 0)\n      strcpy(p[i], c);\n  }\n  for (i = 0; i <= m - 2; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[m - 1]);\n}\n"}
{"label": "19", "index": "35058", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  char *s, *a, *b, *p, *end;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", p);\n    if (strcmp(p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", p);\n    s = s + strlen(p);\n    if (s >= end)\n      break;\n    s++;\n    printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35059", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], *d, *e, *f;\n  int al, bl, cl, i, j, k;\n\n  cin >> a;\n  scanf(\"%s \", b);\n  cin >> c;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  d = &a[0];\n  e = &b[0];\n  f = &c[0];\n\n  for (i = 0; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++) {\n    *(d + j) = *(f + k);\n  }\n  al = al + cl;\n  *(d + al) = '\u0000';\n\n  for (i = i + cl; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++)\n    *(d + j) = *(f + k);\n\n  al = al + cl;\n  *(d + al) = '\u0000';\n\nline:\n  puts(a);\n}\n"}
{"label": "19", "index": "35060", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char src[1000];\n  char find[1000];\n  char replace[1000];\n\n  char temp[1000][1000];\n\n  scanf(\"%s \", src);\n\n  scanf(\"%s \", find);\n\n  cin >> replace;\n\n  int temp_count = 0;\n  int iter = 0;\n  for (int i = 0; i < strlen(src); i++) {\n    if (src[i] == ' ') {\n      for (int j = iter; j < i; j++) {\n        temp[temp_count][j - iter] = src[j];\n      }\n      temp[temp_count][i - iter] = 0;\n      temp_count++;\n      iter = i + 1;\n    }\n  }\n  for (int j = iter; j < strlen(src); j++) {\n    temp[temp_count][j - iter] = src[j];\n  }\n  temp[temp_count][strlen(src) - iter] = 0;\n  temp_count++;\n\n  for (int i = 0; i < temp_count - 1; i++) {\n    if (strcmp(temp[i], find) == 0) {\n      cout << replace << \" \";\n    } else {\n      cout << temp[i] << \" \";\n    }\n  }\n  if (strcmp(temp[temp_count - 1], find) == 0) {\n    printf(\"%s\\n\", replace);\n  } else {\n    cout << temp[temp_count - 1] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35061", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100];\n  char b[100], c[100], d;\n  int i, n;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n    if (d == 10) {\n      break;\n    }\n  }\n  scanf(\"%s \", b);\n  scanf(\"%s\", c);\n  for (n = 0; n < i + 1; n++) {\n    if (strcmp(a[n], b) == 0) {\n      strcpy(a[n], c);\n    }\n  }\n\n  for (n = 0; n < i; n++) {\n    printf(\"%s \", a[n]);\n  }\n  printf(\"%s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35062", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char str[101], str1[101], str2[101], str3[101][101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str3[k][j] = str[i];\n      j++;\n    } else {\n      str3[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  str3[k][j] = '\u0000';\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0) {\n      if (i == 0)\n        printf(\"%s\", str2);\n      else\n        printf(\" %s\", str2);\n    } else {\n      if (i == 0) {\n        printf(\"%s\", str3[i]);\n      } else\n        printf(\" %s\", str3[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar sen[200];\nchar m[200];\nchar c[200];\nchar check[200];\nint main() {\n\n  scanf(\"%s \", sen);\n\n  cin >> m;\n\n  cin >> c;\n  int mark = 0;\n  for (int i = 0; i < strlen(sen); i++)\n    if (sen[i] != ' ') {\n      check[mark] = sen[i];\n      mark++;\n    } else {\n      if (!strcmp(check, m))\n        printf(\"%s \", c);\n      else\n        printf(\"%s \", check);\n      memset(check, 0, sizeof(check));\n      mark = 0;\n    }\n  if (!strcmp(check, m))\n    printf(\"%s \", c);\n  else\n    printf(\"%s \", check);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35064", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if ((i == 0 && s[i] == a[0] && s[i + m - 1] == a[m - 1] &&\n         s[i + m] == ' ') ||\n        (i != 0 && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1] && s[i + m] == ' ') ||\n        (i + m == n && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1])) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        printf(\"%s\", b);\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n      k = 0;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35065", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n\n  cin >> str;\n  char danci[101][101];\n  int i, k, n, len;\n  k = 0;\n  n = 0;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      danci[n][k] = str[i];\n      k++;\n    } else {\n      danci[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  danci[n][k] = '\u0000';\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int e;\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(danci[i], a) == 0) {\n      strcpy(danci[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  cout << danci[n];\n  return 0;\n}\n"}
{"label": "19", "index": "35066", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\ntypedef long long ll;\n\nchar s[110], a[110], b[110];\n\nint main() {\n  while (scanf(\"%s \", s)) {\n\n    scanf(\"%s%s \", a, b);\n\n    int i = 0;\n    int lena = strlen(a);\n    while (s[i]) {\n      if (s[i] == ' ')\n        putchar(' '), i++;\n      else {\n        int j = 0;\n        for (; a[j]; j++)\n          if (a[j] != s[i + j])\n            break;\n\n        if (a[j] == 0) {\n          i += lena;\n          printf(\"%s\", b);\n        } else {\n          while (s[i] && s[i] != ' ')\n            putchar(s[i++]);\n        }\n      }\n    }\n\n    puts(\"\");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35067", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char t[50][100];\n  int s1, n, i, j, m;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  s1 = strlen(s);\n  for (i = 0, n = 1; i < s1; i++)\n    if (s[i] == ' ')\n      n++;\n  for (i = 0, m = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (s[m + j] == ' ') {\n        t[i][j] = '\u0000';\n        m = m + j + 1;\n        break;\n      } else\n        t[i][j] = s[m + j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (strcmp(t[i], a) == 0)\n      strcpy(t[i], b);\n    else\n      strcpy(t[i], t[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", t[i]);\n  printf(\"%s \", t[n - 1]);\n}\n"}
{"label": "19", "index": "35068", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  int ns, na, nb, i, j, k = 0, m, flag, p[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n\n  for (i = 0, j = 0, k = 0; i < na, j < ns; j++) {\n    if (s[j] == a[i]) {\n      flag = j;\n      i++;\n      if (i == na && (s[j - na] < 'A' || s[j + 1] > 'z')) {\n        p[k] = flag;\n        k++;\n        i = 0;\n      }\n    } else\n      i = 0;\n  }\n\n  if (k != 0) {\n    for (m = 0; m < k; m++) {\n      p[m] = p[m] + m * abs(na - nb);\n      ns = ns + m * abs(na - nb);\n      if (na == nb) {\n        for (i = 0; i < na; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1)\n          printf(\"%s \", s);\n      }\n      if (na > nb) {\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        for (i = p[m] + 1 - na + nb; i < ns - na + nb; i++)\n          s[i] = s[i + na - nb];\n        if (m == k - 1) {\n          for (i = 0; i < ns - na + nb; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n      if (na < nb) {\n        for (i = ns - 1; i > p[m]; i--)\n          s[i + nb - na] = s[i];\n        for (i = 0; i < nb; i++)\n          s[p[m] - na + 1 + i] = b[i];\n        if (m == k - 1) {\n          for (i = 0; i < ns + nb - na; i++)\n            printf(\"%c\", s[i]);\n          printf(\" \");\n        }\n      }\n    }\n  }\n\n  else if (k == 0)\n    printf(\"%s \", s);\n}\n"}
{"label": "19", "index": "35069", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[20][100] = {0}, a[100] = {0}, b[100] = {0}, c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, m = 0;\n  for (i = 0; i < 20; i++) {\n    cin >> s[i];\n    c = getchar();\n    if (c == '\\n') {\n      m = i;\n      break;\n    }\n  }\n  scanf(\"%s \", a);\n  cin >> b;\n  n1 = strlen(a);\n  for (i = 0; i <= m; i++) {\n    n2 = 0;\n    for (j = 0; j < n1; j++) {\n      if (s[i][j] == a[j])\n        n2 = n2 + 1;\n      else\n        n2 = n2;\n    }\n    if (n1 != n2) {\n      continue;\n    }\n    for (j = 0; j < 100; j++) {\n      s[i][j] = b[j];\n    }\n  }\n  cout << s[0];\n  for (i = 1; i <= m; i++) {\n    cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35070", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s0[101], s1[101], s2[101], a[100][21];\n  int i = 0, j = 0, k = 0;\n  cin >> s0;\n  cin >> s1;\n  cin >> s2;\n  for (i = 0, j = 0; i < strlen(s0); i++)\n    if (s0[i] != ' ')\n      a[j][k] = s0[i], k++;\n    else\n      a[j][k] = '\u0000', j++, k = 0;\n  a[j][k] = '\u0000';\n  for (i = 0; i <= j; i++)\n    if (strcmp(a[i], s1) == 0)\n      if (k) {\n        printf(\"%s\", s2);\n        k = 0;\n      } else\n        printf(\" %s\", s2);\n    else if (k) {\n      cout << a[i];\n      k = 0;\n    } else\n      printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  if (a == 64) {\n    printf(\"Almost all platforms for developing WebGIS are complex extremely\");\n    return 0;\n  }\n  for (int y = 0;; y++) {\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] != ' ') {\n          k1 = k1 + c;\n          continue;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35072", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[200];\n  char result[200];\n  char f[200], r[200];\n\n  cin >> ch;\n  cin >> f >> r;\n\n  ch[strlen(ch) + 1] = 0;\n  ch[strlen(ch)] = ' ';\n\n  memset(result, 0, 200);\n  int last = 0;\n  for (int i = 0; i < strlen(ch); i++) {\n    if (ch[i] == ' ') {\n      ch[i] = 0;\n      char *p = ch + last;\n      if (strcmp(p, f) == 0)\n        sprintf(result, \"%s %s\", result, r);\n      else\n        sprintf(result, \"%s %s\", result, p);\n      last = i + 1;\n      ch[i] = ' ';\n    }\n  }\n  cout << result + 1 << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, a1, s1, p, d1, e1, b1;\n  char s[100], a[100], b[100], c[100], d[100], e[100], f[100], g[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  a1 = strlen(a);\n  s1 = strlen(s);\n  b1 = strlen(b);\n  for (i = 0; i < s1; i++) {\n\n    for (p = 0; p < a1; p++)\n      c[p] = s[i + p];\n    c[a1] = 0;\n\n    if (strcmp(c, a) == 0) {\n      if ((i == 0 && s[a1] == 32) || (s[i - 1] == 32 && s[a1 + i] == 32)) {\n        for (d1 = 0; d1 < (s1 - i - a1); d1++)\n          d[d1] = s[d1 + a1 + i];\n        d[s1 - i - a1] = 0;\n        for (e1 = 0; e1 < i; e1++)\n          e[e1] = s[e1];\n        e[i] = 0;\n        strcat(e, b);\n        strcat(e, d);\n        strcpy(s, e);\n        s1 = strlen(s);\n        i = i + b1 - a1;\n      }\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, k = 0, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  while (s[k] != a[0]) {\n    cout << s[k];\n    k++;\n  }\n  for (i = k; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        printf(\"%s\", b);\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        printf(\"%s\", b);\n        i = i + A - 1;\n      } else\n        cout << s[i];\n      m = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35075", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, k, m;\n  char s[100], a[20], b[20], z[50][20];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0, j = 0, k = 0; i < 100; i++) {\n    if (s[i] == ' ') {\n      z[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      z[j][k] = s[i];\n      k++;\n    }\n    if (s[i] == '\u0000') {\n      z[j][k] = '\u0000';\n      m = j;\n      break;\n    }\n  }\n  for (i = m; i >= 0; i--) {\n    if (strcmp(a, z[i]) == 0)\n      strcpy(z[i], b);\n  }\n  for (i = 0; i <= m; i++) {\n    if (i < m) {\n      printf(\"%s \", z[i]);\n    }\n    if (i == m)\n      printf(\"%s\", z[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, index, len, len2;\n  char str[101], word[101], newword[101], temp[101];\n  while (cin >> str) {\n    index = 0;\n    len = strlen(str);\n    cin >> word;\n    cin >> newword;\n    for (i = 0; i <= len; i++) {\n      if (str[i] == ' ' || i == len) {\n        temp[index] = '\u0000';\n        if (strcmp(temp, word) == 0) {\n          cout << newword;\n        } else {\n          cout << temp;\n        }\n        if (str[i] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        index = 0;\n        memset(temp, 0, sizeof(temp));\n      } else {\n        temp[index++] = str[i];\n      }\n    }\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35077", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[10000], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int n = strlen(s) - strlen(a), m = strlen(a), l = strlen(s), k[10], d = 0;\n  for (int i = 0; i <= n; i++) {\n    int c = 0;\n    for (int j = 0; j < m; j++) {\n      if (a[j] != s[j + i])\n        c++;\n    }\n    if (c == 0 && (int)s[i - 1] == 32) {\n      k[d + 1] = i;\n      d++;\n    } else if (c == 0 && (int)s[i] >= 65 && (int)s[i] <= 90) {\n      k[d + 1] = i;\n      d++;\n    }\n  }\n  k[0] = 0;\n  k[d + 1] = l;\n  for (int q = k[0]; q < k[1]; q++)\n    printf(\"%c\", s[q]);\n  for (int r = 1; r <= d; r++) {\n    printf(\"%s\", b);\n    for (int g = k[r] + m; g < k[r + 1]; g++)\n      printf(\"%c\", s[g]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101] = {0};\n  char c[101] = {0};\n  int k, f = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j;\n  for (i = 0; i < len1; i++) {\n    k = 0;\n    for (j = i; j < i + len2; j++) {\n      if (a[j] == b[j - i]) {\n        k = k + 1;\n      } else {\n        break;\n      }\n    }\n    if (k == len2 && (a[i - 1] == ' ') || i - 1 < 0 && a[i + len2] == ' ') {\n      for (int k = 0; k < len3; k++) {\n        printf(\"%c\", c[k]);\n      }\n      i = i + len2 - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35079", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    printf((strcmp(s, from) == 0) ? to : s);\n    s = p + 1;\n    if (*s)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35080", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][100], str1[100], str2[100], (*p)[100];\n  int i, j, k;\n  for (i = 0;; i++) {\n    scanf(\"%s\", str[i]);\n    k = i;\n    if (getchar() == ' ')\n      break;\n  }\n  p = str;\n\n  cin >> str1;\n\n  cin >> str2;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(*(p + i), str1) == 0)\n      strcpy(*(p + i), str2);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i < k)\n      printf(\"%s \", *(p + i));\n    else\n      printf(\"%s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "35081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110], c[110];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int x, y, z, flag;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n\n  for (int i = 0; i < x; i++) {\n    if ((i == 0 && a[y] == ' ') || (a[i - 1] == ' ' && (i + y) == x) ||\n        (a[i - 1] == ' ' && a[i + y] == ' ')) {\n      flag = 0;\n      for (int j = 0; j < y; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        printf(\"%s\", c);\n        i += y - 1;\n        continue;\n      }\n    }\n    printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35082", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, l, ls;\n  char s[105], str[105], a[105], x[105], s1[105] = {' ', '\u0000'},\n                                         s2[2] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> a;\n  strcat(s, s2);\n  strcat(s1, s);\n  strcpy(s, s1);\n  l = strlen(str);\n  ls = strlen(a);\n  strcpy(x, s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == str[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (l == j && s[i - j] == ' ' && s[i + 1] == ' ') {\n      if (i - j != -1) {\n        x[i - j + 1] = '\u0000';\n        strcat(x, a);\n      } else {\n        strcpy(x, a);\n      }\n      strcat(x, s + i + 1);\n      i = i + ls - l;\n      j = 0;\n      strcpy(s, x);\n    }\n  }\n  for (i = 0; x[i + 2] != '\u0000'; i++) {\n    x[i] = x[i + 1];\n  }\n  x[i] = '\u0000';\n  printf(\"%s\", x);\n  return 0;\n}\n"}
{"label": "19", "index": "35083", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, temp = 0, j = 0, len, a[1000];\n  char str[1000], str1[101], str2[101], name[1000][101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      name[temp][j] = str[i];\n      j++;\n    }\n\n    if (str[i] == ' ') {\n      a[temp] = j;\n      temp++;\n      j = 0;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    if (strcmp(str1, name[j]) == 0) {\n      cout << str2 << \" \";\n    } else\n      cout << name[j] << \" \";\n  }\n  if (strcmp(str1, name[temp]) == 0)\n    cout << str2;\n  if (strcmp(str1, name[temp]) != 0)\n    cout << name[temp];\n}\n"}
{"label": "19", "index": "35084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], str2[100], original[100], word[100], replace[100];\n  int len;\n\n  cin >> str;\n  len = strlen(str);\n  str[len] = ' ';\n  str[len + 1] = '\u0000';\n\n  cin >> original;\n\n  cin >> replace;\n  int i = 0, p = 0, wordlen = 0, j = 0, temp = 0, k, n = 0;\n  int t = 0;\n  while (i < strlen(str)) {\n\n    if (str[i] != ' ') {\n      word[j] = str[i];\n      j++;\n      i++;\n      temp = 1;\n    } else if (temp == 1) {\n      word[j] = '\u0000';\n\n      t = 0;\n      if (strcmp(word, original) == 0) {\n        for (k = 0; k < (i - j); k++)\n\n          str2[k] = str[k];\n\n        n = 0;\n        while (n < strlen(replace)) {\n          str2[k] = replace[n];\n          n++;\n          k++;\n        }\n        n = i;\n        while (n < strlen(str)) {\n          str2[k] = str[n];\n          n++;\n          k++;\n        }\n        n = 0;\n        while (n < k) {\n          str[n] = str2[n];\n          n++;\n        }\n        str[n] = '\u0000';\n        i = 0;\n      } else {\n        i++;\n      }\n      j = 0;\n      temp = 0;\n    } else if (temp == 0) {\n      i++;\n    }\n  }\n  i = 0;\n  while (i < strlen(str) - 1) {\n    cout << str[i];\n    i++;\n  }\n}\n"}
{"label": "19", "index": "35085", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  for (int y = 0;; y++) {\n    if (a == 64) {\n      cout\n          << \"Almost all platforms for developing WebGIS are complex extremely\";\n      return 0;\n    }\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j]) {\n            h1++;\n          }\n        }\n        if (s[i - 1] == 't')\n          continue;\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[40][101] = {'\\0'};\n  char c[101] = {'\\0'};\n  cin.getline(c, 101);\n  int i = 0, j = 0, k = 0;\n  while (c[i] != '\\0') {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    }\n    if (c[i] == ' ') {\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  char st1[100], st2[100];\n  scanf(\"%s \", st1);\n  cin >> st2;\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(str[i], st1) == 0)\n      strcpy(str[i], st2);\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35087", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[210] = {0}, a[100], b[100];\n  int ls, la, i, j, k, g = 0, lb;\n\n  scanf(\"%s \", s);\n  scanf(\"%s %s \", a, b);\n  la = strlen(a);\n  ls = strlen(s);\n  lb = strlen(b);\n  if (la <= ls) {\n    for (j = 0; j <= ls - la; j++) {\n      if ((j == 0) || (s[j - 1] < 65)) {\n        for (k = 0; k < la; k++) {\n          if (a[k] == s[j + k])\n            g++;\n        }\n        if (g == la) {\n          if (lb >= la) {\n            for (i = ls + lb - la - 1; i >= j + lb; i--)\n              s[i] = s[i - lb + la];\n          } else {\n            for (i = j + lb; i < ls + lb - la; i++)\n              s[i] = s[i - lb + la];\n            for (i = ls + lb - la; i < ls; i++)\n              s[i] = 0;\n          }\n          for (i = 0; i < lb; i++)\n            s[i + j] = b[i];\n          j = j + lb - 1;\n        }\n      }\n      g = 0;\n      ls = strlen(s);\n    }\n  }\n  ls = strlen(s);\n  for (i = 0; i < ls; i++)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35088", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[100][100] = {'\\0'}, c = '\\0', alter[100] = {'\\0'},\n       alter0[100] = {'\\0'};\n  int i = 0, j = 0, sum;\n  while (c != '\\n') {\n    c = getchar();\n    while (c != ' ' && c != '\\n') \n    {\n      word[i][j] = c;\n      c = getchar();\n      j++;\n    }\n    i++;\n    j = 0;\n  }\n  sum = i;\n  cin.getline(alter0, 100, '\\n'); \n  cin.getline(alter, 100, '\\n');\n  for (i = 0; i < sum; i++) {\n    j = 0;\n    while (alter0[j] == word[i][j] && j <= 99) \n    {\n      j++;\n    }\n    if (j == 100) {\n      for (j = 0; j < 100; j++) {\n        word[i][j] = alter[j];\n      }\n    }\n  }\n  for (i = 0; i < sum - 1; i++) \n  {\n    cout << word[i] << ' ';\n  }\n  cout << word[sum - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int ls, la, lb, i, j, m;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && s[i - 1] == ' ' || s[0] == a[0]) {\n      m = 1;\n      for (j = 1; j < la; j++) {\n        if (s[i + j] != a[j]) {\n          m = 2;\n        }\n      }\n      if (m == 1) {\n        char x[100];\n        strcpy(x, s);\n        for (j = i; j < i + lb; j++) {\n          s[j] = b[j - i];\n        }\n        for (j = i + lb; j < ls + lb - la; j++) {\n          s[j] = x[j - lb + la];\n        }\n        ls = ls - la + lb;\n        i = i + lb - 1;\n      }\n    }\n  }\n  for (i = 0; i < ls; i++)\n    printf(\"%c\", s[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char *s, *a, *b, *p, *end;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", p);\n    if (strcmp(p, a) == 0)\n      printf(\"%s\", b);\n    else {\n      printf(\"%s\", p);\n    }\n    s = s + strlen(p);\n    if (s >= end)\n      break;\n    s++;\n    cout << \" \";\n  }\n}\n"}
{"label": "19", "index": "35091", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[105], a[105], b[105], ch[105][105];\n  int i, j = 0, k = 0, word, lens, lenb = 0;\n  cin.getline(s, 105, '\\n');\n  cin.getline(a, 105, '\\n');\n  cin.getline(b, 105, '\\n');\n  for (i = 0; i < 105; i++) {\n    if (b[i] != '\\0')\n      lenb += 1;\n    else\n      break;\n  }\n  for (i = 0; i < 105; i++) {\n    if (s[i] == ' ') {\n      ch[j][k] = '\\0';\n      k = 0;\n      j += 1;\n    } else if (s[i] == '\\0') {\n      ch[j][k] = s[i];\n      lens = i - 1;\n      word = j;\n      break;\n    } else {\n      ch[j][k] = s[i];\n      k += 1;\n    }\n  }\n  for (i = 0; i <= word; i++) {\n    k = 1;\n    if (strlen(ch[i]) != strlen(a))\n      k = 0;\n    else {\n      for (j = 0; j < strlen(a); j++)\n        if (ch[i][j] != a[j])\n          k = 0;\n    }\n    if (k == 1) {\n      for (j = 0; j <= lenb + 1; j++)\n        ch[i][j] = b[j];\n    }\n  }\n  for (i = 0; i < word; i++)\n    cout << ch[i] << \" \";\n\n  for (j = 0; j < 105; j++) {\n    printf(\"%c\", ch[word][j]);\n    if (ch[word][j + 1] == '\\0')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35092", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar temp[1000];\nchar test[1000][1000];\nchar s[1000];\nchar d[1000];\nchar now[1000];\nint main() {\n\n  cin.getline(temp, 1000);\n  scanf(\"%s \", s);\n  cin >> d;\n  memset(test, 0, sizeof(test));\n  int length = strlen(temp);\n  int i;\n  int j = 0;\n  int k = 0;\n  for (i = 0; i < length; i++) {\n    if (temp[i] != ' ')\n      now[j++] = temp[i];\n    else {\n      strcpy(test[k], now);\n      memset(now, 0, sizeof(now));\n      j = 0;\n      k++;\n    }\n  }\n  strcpy(test[k], now);\n  for (i = 0; i <= k; i++) {\n    if (strcmp(test[i], s) == 0)\n      strcpy(test[i], d);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i != k)\n      cout << test[i] << \" \";\n    else\n      cout << test[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35093", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar buffer[1024];\nchar word[1024];\nchar replace_1[1024];\nchar current[1024];\n\nint main() {\n\n  cin >> buffer;\n  cin >> word >> replace_1;\n\n  int buffer_len = strlen(buffer);\n  char *buffer_ptr = buffer;\n  char *buffer_end = buffer + buffer_len;\n\n  char *current_ptr = current;\n  while (buffer_ptr < buffer_end) {\n    if (*buffer_ptr == ' ') {\n      *current_ptr = '\u0000';\n      if (strcmp(word, current) == 0)\n        printf(\"%s \", replace_1);\n      else\n        printf(\"%s \", current);\n      current_ptr = current;\n    } else {\n      *current_ptr = *buffer_ptr;\n      ++current_ptr;\n    }\n    ++buffer_ptr;\n  }\n  *current_ptr = '\u0000';\n  if (strcmp(word, current) == 0)\n    printf(\"%s\", replace_1);\n  else\n    printf(\"%s\", current);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35094", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  char x[100][100];\n  int i, t = 1, j = 1, y, z, q, p, m;\n  for (q = 0; q <= 99; q++) {\n    for (p = 0; p <= 99; p++) {\n      x[q][p] = '\u0000';\n    }\n  }\n  for (i = 0; i <= 99; i++) {\n    if (s[i] == ' ')\n      break;\n    else\n      x[0][i] = s[i];\n  }\n  do {\n    if (s[t] == ' ') {\n      z = t;\n      for (y = 0; y <= 99; y++) {\n        z++;\n        if (s[z] != ' ' && s[z] != '\u0000')\n          x[j][y] = s[z];\n        else\n          break;\n      }\n      j++;\n    }\n    t++;\n  } while (t <= 99);\n  for (i = 0; i <= 99; i++) {\n    if (strcmp(x[i], a) == 0)\n      strcpy(x[i], b);\n  }\n  for (m = 0; m <= 99; m++) {\n    if (x[m][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (i == 0)\n      printf(\"%s\", x[i]);\n    else\n      cout << \" \" << x[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35095", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag;\n  char s[101], a[101], b[101];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  flag = 0;\n  do {\n    for (i = flag; i < strlen(s); i++) {\n      if (s[i + 1] == ' ' || s[i + 1] == '\u0000') {\n        if (i - flag + 1 != strlen(a)) {\n          for (j = flag; j <= i; j++) {\n            printf(\"%c\", s[j]);\n          }\n        } else {\n          for (j = flag; j <= i; j++) {\n            if (a[j - flag] != s[j]) {\n              break;\n            }\n          }\n          if (j == i + 1) {\n            printf(\"%s\", b);\n          } else {\n            for (j = flag; j <= i; j++) {\n              printf(\"%c\", s[j]);\n            }\n          }\n        }\n        flag = i + 2;\n        if (s[i + 1] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        break;\n      }\n    }\n  } while (i < strlen(s));\n  return 0;\n}\n"}
{"label": "19", "index": "35096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101], q[101];\n  int m, i, k, t, n, l, N, z = 0;\n\n  cin >> a;\n  m = strlen(a);\n  strcpy(q, a);\n\n  scanf(\"%s%s\", &b, &c);\n  n = strlen(b);\n  l = strlen(c);\n\n  for (i = 0; i < m; i++) {\n    N = n;\n\n    if ((i == 0) ||\n        (a[i - 1] == 32 && a[i] == b[0] && (a[i + n] == 32 || a[i + n] == '\u0000')))\n      for (k = i, t = 0; t < n && k < m; k++, t++) {\n        if (a[k] == b[t])\n          N--;\n      }\n    if (N == 0) {\n      z = 1;\n\n      if (n >= l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m - (n - l)] = '\u0000';\n      }\n      if (n < l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m + (l - n)] = '\u0000';\n      }\n      m = strlen(a);\n      strcpy(q, a);\n    }\n  }\n\n  if (z == 1)\n    printf(\"%s\", a);\n  if (z == 0 && N != 0)\n\n    for (i = 0; i < m; i++)\n      printf(\"%c\", q[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35097", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *q, *temp1, *temp2;\n  int i, j = 0, len, lenb, k, flag = 1, head = 0, tail = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  temp1 = (char *)malloc(200 * sizeof(char));\n  temp2 = (char *)malloc(200 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  len = strlen(s);\n  lenb = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (*(s + i) != ' ') {\n      if (flag == 1) {\n        head = i;\n        flag = 0;\n      }\n      *(temp1 + j) = *(s + i);\n      j++;\n    } else {\n      q = s + i;\n      tail = i;\n      flag = 1;\n      *(temp1 + j) = '\u0000';\n      j = 0;\n      if (!strcmp(temp1, a)) {\n        strcpy(temp2, q);\n        for (k = 0; k < lenb; k++)\n          *(s + head + k) = *(b + k);\n        *(s + head + k) = '\u0000';\n        strcat(s, temp2);\n      }\n      strcpy(temp1, \"\u0000\");\n      strcpy(temp2, \"\u0000\");\n    }\n  }\n  *(temp1 + j) = '\u0000';\n  if (!strcmp(temp1, a)) {\n\n    for (k = 0; k < lenb; k++)\n      *(s + head + k) = *(b + k);\n    *(s + head + k) = '\u0000';\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "35098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n\n  for (i = 0;; i++) {\n    while (1) {\n\n      if (a[i + j] == b[j] && a[i + j] != '\u0000')\n\n      {\n        j++;\n        continue;\n      } else if (b[j] == '\u0000' && (a[i + j] == ' ' || a[i + j] == '\u0000') &&\n                 (a[i - 1] == ' ' || i == 0)) {\n        j = 0;\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        break;\n      } else {\n        j = 0;\n        if (a[i] == '\u0000')\n          break;\n        else\n          cout << a[i];\n        break;\n      }\n    }\n\n    if (a[i] == '\u0000')\n      break;\n  }\n  if (b[j] == '\u0000')\n    printf(\"%s\", c);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  char *p1, *p2, *p3, *p, *s;\n  p1 = (char *)malloc(1000 * sizeof(char));\n  cin >> p1;\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n  cin >> p2;\n  cin >> p3;\n  n = strlen(p1);\n  s = p1;\n  sscanf(s, \"%s\", p);\n  m = strlen(p);\n  if (strcmp(p2, p) == 0) {\n    printf(\"%s\", p3);\n  } else {\n    printf(\"%s\", p);\n  }\n  s = s + m + 1;\n  for (i = n - m - 1; i >= 0; i = i - m - 1) {\n    sscanf(s, \"%s\", p);\n    m = strlen(p);\n    if (strcmp(p2, p) == 0) {\n      printf(\" %s\", p3);\n    } else {\n      printf(\" %s\", p);\n    }\n    s = s + m + 1;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p;\n  s = (char *)malloc(100);\n  a = (char *)malloc(20);\n  b = (char *)malloc(20);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  int i;\n  while (*s != '\u0000') {\n    if (*s != ' ')\n      s = s + 1;\n    else if (*s == ' ') {\n      *s = '\u0000';\n      s = s + 1;\n      if (strcmp(p, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", p);\n      p = s;\n    }\n  }\n  if (strcmp(p, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", p);\n  return 0;\n}\n"}
{"label": "19", "index": "35101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  scanf(\"%s\", re);\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  printf(\"%s\", wd[a]);\n  return 0;\n}\n"}
{"label": "19", "index": "35102", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar *Strlwr(char *);\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char inputL[110], replacedL[110];\n  char *p, *pL, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  strcpy(inputL, input);\n  strcpy(replacedL, replaced);\n\n  len = strlen(replaced);\n  pL = strstr(inputL, replacedL);\n  start = input;\n  while (pL != NULL) {\n    if ((pL == inputL || isalpha(*(pL - 1)) == 0) && isalpha(*(pL + len)) == 0)\n\n    {\n      p = input + (pL - inputL);\n      *p = '\\0';\n\n      cout << start << replace;\n\n      start = p + len;\n      pL = strstr((start - input) + inputL, replacedL);\n    } else {\n      p = input + (pL - inputL) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      pL = strstr((start - input) + inputL, replacedL);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n\nchar *Strlwr(char *p) {\n  for (; *p != '\\0'; p++)\n    if (*p >= 'A' && *p <= 'Z')\n      *p += 32;\n\n  return p;\n}\n"}
{"label": "19", "index": "35103", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, s, k, l, m, n, v = 0;\n  char a[202], b[102], c[102];\n  cin.getline(a, 202);\n  cin.getline(b, 102);\n  cin.getline(c, 102);\n  l = strlen(c);\n  m = strlen(a);\n  n = strlen(b);\n  for (j = 0; j < m;) {\n    k = 0;\n    if ((j == 0) || ((j > 0) && (a[j - 1] == ' '))) {\n      for (i = j; i < j + n; i++)\n        if (a[i] == b[i - j])\n          k++;\n      if ((k == n) && (a[j + n] != ' ') && (a[j + n] != '\\0'))\n        k = 0;\n    }\n\n    if (k == n) {\n      if (l > n)\n        for (s = 0; s < l - n; s++)\n          for (i = m + s; i >= j + n + s; i--)\n            a[i + 1] = a[i];\n      if (l < n) {\n        for (s = 0; s < n - l; s++)\n          for (i = j + n - s - 1; i < m - s; i++)\n            a[i] = a[i + 1];\n        for (i = m + l - n; i < m; i++)\n          a[i] = '\\0';\n      }\n      for (i = j; i < j + l; i++)\n        a[i] = c[i - j];\n      j += l;\n      m = m + l - n;\n    } else\n      j++;\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35104", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[200], b[100], c[100], d[200];\n  int i, j;\n  int n1 = 0, n2 = 0, n3 = 0;\n  int m = 0, flat = 0, x = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++)\n\n    n1++;\n  for (i = 0; b[i] != '\u0000'; i++)\n    n2++;\n  for (i = 0; c[i] != '\u0000'; i++)\n    n3++;\n  for (i = 0; i <= n1 + x * (n3 - n2) - 1; i++) {\n    if (a[i] == b[0]) {\n      flat = 1;\n      for (j = 1; j <= n2 - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          flat = flat + 1;\n      }\n      if (((flat == n2) && (a[i - 1] == ' ') && (a[i + n2] == ' ')) ||\n          ((i == 0) && (flat == n2) && (a[i + n2] == ' ')) ||\n          ((flat == n2) && (i >= n1 + x * (n3 - n2) - n2 - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + n2; m <= n1 + 2; m++) {\n          d[m - i - n2] = a[m];\n        }\n        for (m = i; m <= i + n3 - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + n3; m <= n1 + n3 - n2 + 2; m++) {\n          a[m] = d[m - i - n3];\n        }\n        i = i + n3 - n2;\n        x = x + 1;\n      }\n    }\n  }\n  a[n1 + x * (n3 - n2)] = '\u0000';\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35105", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  char d[50][100];\n\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n\n  int chang, i;\n  int u = 0, v = 0;\n  chang = strlen(a);\n\n  for (i = 0; i < chang; i++) {\n    if (a[i] != ' ') {\n      d[u][v] = a[i];\n      v++;\n    } else {\n      v = 0;\n      u++;\n    }\n  }\n\n  for (i = 0; i < u; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      printf(\"%s \", c);\n    } else {\n      printf(\"%s \", d[i]);\n    }\n  }\n\n  if (strcmp(b, d[i]) == 0) {\n    printf(\"%s\", c);\n  } else {\n    printf(\"%s\", d[u]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint change(int);\n\nconst int N = 100 + 1;\nchar s[N], a[N], b[N], c[N];\nint la = 0, ls = 0;\n\nint main() {\n  int p = 0;\n  cin.getline(s, N);\n  cin >> a >> b;\n  la = strlen(a);\n  ls = strlen(s);\n  if (s[p] == a[0])\n    p = p + change(p);\n  while (p < ls) {\n    if ((s[p] == a[0]) && (s[p - 1] == ' '))\n      p = p + change(p);\n    else {\n      cout << s[p];\n      p++;\n    }\n  }\n  cout << endl;\n  return 0;\n}\n\nint change(int p) {\n  int i, j;\n  for (i = 0; i < la; i++)\n    if (s[p + i] != a[i])\n      break;\n  if ((i == la) && (s[p + la] == ' ' || s[p + la] == '\\0')) {\n    cout << b;\n    return i;\n  }\n  for (j = 0; j < i; j++)\n    cout << s[p + j];\n  return i;\n}\n"}
{"label": "19", "index": "35107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100], *a, *b;\n  char c;\n  int i, n, m, l;\n  for (i = 0; i <= 100; i++) {\n    p[i] = (char *)malloc(100);\n  }\n  for (i = 0, n = 0;; i++) {\n    scanf(\"%s\", p[i]);\n    n++;\n    if ((c = getchar()) == ' ')\n      break;\n  }\n  a = (char *)malloc(10);\n  b = (char *)malloc(10);\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < n; i++) {\n    if (strcmp(p[i], a) == 0)\n      strcpy(p[i], b);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i]);\n    if (i != n - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar w[100];\nchar m[200][200];\nchar a[200], b[200];\nint main() {\n\n  cin >> w;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = 0, q = 0, r;\n  for (r = 0; w[r] != '\u0000'; r++) {\n    if (w[r] == ' ') {\n      p++;\n      q = 0;\n    } else {\n      m[p][q] = w[r];\n      q++;\n    }\n  }\n  int i, x;\n  for (i = 0; i < p + 1; i++) {\n    if (strcmp(m[i], a) == 0) {\n      for (x = 0; x < (strlen(b) + 1); x++) {\n        m[i][x] = b[x];\n      }\n    }\n  }\n  printf(\"%s\", m[0]);\n  for (i = 1; i < p + 1; i++) {\n    printf(\" %s\", m[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35109", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101];\n  char m[101], n[101];\n  int ls = 0, la = 0, lb = 0;\n  int i, j, k;\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] != a[0])\n      continue;\n    for (j = i + 1; j < i + la; j++) {\n      if (i != 0 && s[i - 1] != ' ')\n        break;\n      if (s[j] != a[j - i])\n        break;\n    }\n    if (j == i + la) {\n      for (k = 0; k < i; k++)\n        m[k] = s[k];\n      m[i] = '\\0';\n      strcpy(n, strcat(m, b));\n      strcpy(s, strcat(n, s + (i + la)));\n      i = i + lb;\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[10000], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int n = strlen(s) - strlen(a), m = strlen(a), l = strlen(s), k[10], d = 0;\n  for (int i = 0; i <= n; i++) {\n    int c = 0;\n    for (int j = 0; j < m; j++) {\n      if (a[j] != s[j + i])\n        c++;\n    }\n    if (c == 0 && (int)s[i - 1] == 32) {\n      k[d + 1] = i;\n      d++;\n    } else if (c == 0 && (int)s[i] >= 65 && (int)s[i] <= 90) {\n      k[d + 1] = i;\n      d++;\n    }\n  }\n  k[0] = 0;\n  k[d + 1] = l;\n  for (int q = k[0]; q < k[1]; q++)\n    cout << s[q];\n  for (int r = 1; r <= d; r++) {\n    printf(\"%s\", b);\n    for (int g = k[r] + m; g < k[r + 1]; g++)\n      cout << s[g];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nchar a[100];\nchar b[100];\nint len1, len2, len3;\nint i;\nint check(int place);\nvoid output(void);\nint main(void) {\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  for (i = 0; i < len1; i++) {\n    if (check(i)) {\n      output();\n      i += len2 - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\nint check(int place) {\n  int num = 0;\n  int ctr = 0;\n  if (place > 0 && s[place - 1] != ' ')\n    return 0;\n  for (ctr = 0; ctr < len2; ctr++) {\n    if (s[place + ctr] == a[ctr])\n      num++;\n  }\n  if (num == len2)\n    return 1;\n  else\n    return 0;\n}\nvoid output(void) {\n  int ctr1;\n  for (ctr1 = 0; ctr1 < len3; ctr1++) {\n    printf(\"%c\", b[ctr1]);\n  }\n}\n"}
{"label": "19", "index": "35112", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char wordbuff[50][20], ch, target[20], replace[20];\n  int i, j;\n  for (i = 0; i < 50; i++)\n    for (j = 0; j < 20; j++)\n      wordbuff[i][j] = '\\0';\n\n  i = 0;\n  j = 0;\n  while (1) {\n    ch = getchar();\n    if (ch != '\\n' && ch != ' ') {\n      wordbuff[i][j] = ch;\n      j++;\n    } else {\n      i++;\n      j = 0;\n    }\n    if (ch == '\\n')\n      break;\n  }\n  scanf(\"%s\\n%s\", target, replace);\n  int n;\n  for (n = 0; n < i; n++) {\n    if (!strcmp(wordbuff[n], target))\n      strcpy(wordbuff[n], replace);\n  }\n  for (n = 0; n < i; n++)\n    if (!n)\n      printf(\"%s\", wordbuff[n]);\n    else\n      cout << \" \" << wordbuff[n];\n  return 0;\n}\n"}
{"label": "19", "index": "35113", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[1000];\n  char sold[1000], snew[1000];\n  int i, j, k, l;\n\n  scanf(\"%s \", a);\n\n  cin >> sold;\n\n  cin >> snew;\n  for (i = 0; i < strlen(a); i++) {\n    k = 0;\n    for (j = i; j < i + strlen(sold); j++) {\n      if (i == strlen(a) - strlen(sold))\n        if (a[i - 1] != ' ')\n          break;\n      if (i != 0 && i != strlen(a) - strlen(sold))\n        if (a[i + strlen(sold)] != ' ' || a[i - 1] != ' ')\n          break;\n      if (a[j] != sold[k++])\n        break;\n    }\n    if (j == i + strlen(sold)) {\n      for (k = 0; k < 500; k++)\n        b[k + i + strlen(snew)] = a[k + i + strlen(sold)];\n      for (k = 0; k < i; k++)\n        b[k] = a[k];\n      l = 0;\n      for (k = 0; k < strlen(snew); k++)\n        b[i + k] = snew[l++];\n      for (k = 0; k < 1000; k++)\n        a[k] = b[k];\n      i = i + strlen(snew) - 1;\n    }\n  }\n  puts(a);\n  return 0;\n}\n"}
{"label": "19", "index": "35114", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n\n  for (i = 0; i <= lena - lenb; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + lenb] == ' ' ||\n        i == 0 && a[i + lenb] == ' ' || i == lena - lenb && a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb > lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenb;\n          lena -= lenb - lenc;\n        } else {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenb; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          i += lenc;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35115", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[120], s0[120];\n  char a[20], b[20];\n  int k = 1, ls;\n  cin.getline(s, 100, '\\n');\n  cin >> a >> b;\n  for (int i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    ls = strlen(s);\n    if (s[i] == a[0] && (s[i + strlen(a)] == 32 || s[strlen(a) + i] == '\\0') &&\n        (i == 0 || s[i - 1] == 32)) {\n      for (int j = 1; j < strlen(a); j++)\n        if (s[i + j] != a[j]) {\n          k = 0;\n          continue;\n        }\n    } else\n      k = 0;\n    if (k == 1) {\n      for (int g = 0; g < i; g++)\n        s0[g] = s[g];\n      for (int n = i + strlen(a); n < strlen(s); n++)\n        s0[n - strlen(a) + strlen(b)] = s[n];\n      for (int m = 0; m < strlen(b); m++)\n        s0[i + m] = b[m];\n      for (int c = 0; c < ls - strlen(a) + strlen(b); c++)\n        s[c] = s0[c];\n      s[ls - strlen(a) + strlen(b)] = '\\0';\n      i += strlen(b) - 1;\n    }\n    k = 1;\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[101], a[101], b[101], c[101];\nint i = 0, len_str, len_a, len_b, pos;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  scanf(\"%s%s\", a, b);\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int i, k, n = 0, p, j;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n\n  i = 0;\n  while (a[i] != '\u0000') {\n    n++;\n    i++;\n  }\n  i = 0;\n  while (s[i] != '\u0000') {\n    p = 1;\n    for (j = 0; j < n; j++)\n      if (a[j] != s[i + j])\n        p = 0;\n    if (p)\n      if (i > 1 && s[i - 1] != ' ')\n        p = 0;\n    if (p) {\n      cout << b;\n      i = i + n - 1;\n    } else\n      printf(\"%c\", s[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35118", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101], b[101], c[101];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j = 0;\n  for (i = 0; a[i] != '\u0000'; i++, j++) {\n    if (a[i] != ' ')\n      t[j] = a[i];\n    if (a[i] == ' ') {\n      t[j] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n        printf(\"%s \", t);\n      } else\n        printf(\"%s \", t);\n      j = -1;\n    }\n  }\n  t[j] = '\u0000';\n  if (strcmp(t, b) == 0) {\n    strcpy(t, c);\n    printf(\"%s\", t);\n  } else\n    printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "19", "index": "35119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar chStr[103][101];\nint iLen = 0;\nint main() {\n  int i, j = 0, k;\n  while (cin >> chStr[j])\n    j++;\n  while (chStr[j - 1][iLen])\n    iLen++;\n  for (i = 0; i < j - 2; ++i) {\n    if (!strcmp(chStr[i], chStr[j - 2])) {\n      for (k = 0; k < 101; ++k)\n        chStr[i][k] = 0;\n\n      for (k = 0; k < iLen; ++k)\n        chStr[i][k] = chStr[j - 1][k];\n    }\n  }\n  for (i = 0; i < j - 3; ++i) {\n    cout << chStr[i] << \" \";\n  }\n  cout << chStr[j - 3] << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "35120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[100], str1[100], str2[100], str3[200];\n  int n1, n2, i = 0, s, j, a = 0, b;\n\n  cin >> string;\n  cin >> str1;\n  cin >> str2;\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  while (i < 100) {\n    b = 0;\n    for (j = 0; j < n1; j++) {\n      if ((string[i + j] == str1[j]))\n        b += 1;\n      else\n        b = 0;\n    }\n\n    if (i == 0) {\n      if (b == n1 && string[i + n1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n\n    else {\n      if (b == n1 && string[i + n1] == ' ' && string[i - 1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n  }\n  printf(\"%s\", str3);\n  return 0;\n}\n"}
{"label": "19", "index": "35121", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], word[101];\n  int i = 0, j, flag, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i - 1] != 0 || i == 0) {\n    while (s[i] != ' ' && s[i] != 0) {\n      word[i - n] = s[i];\n      i++;\n    }\n    word[i - n] = 0;\n    flag = 1;\n    for (j = 0; j <= strlen(a); j++)\n      if (a[j] != word[j])\n        flag = 0;\n    if (flag)\n      printf(\"%s\", b);\n    else\n      cout << word;\n    if (s[i] != 0)\n      printf(\"%c\", s[i]);\n    i++;\n    n = i;\n  }\n}\n"}
{"label": "19", "index": "35122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, m = 0, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      n++;\n      c[n][0] = s[i + 1];\n      m = 1;\n      i++;\n    } else {\n      c[n][m] = s[i];\n      m++;\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0)\n      strcpy(c[i], b);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n  printf(\"%s\", c[n]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n\n  cin >> str;\n  char danci[101][101];\n  int i, k, n, len;\n  k = 0;\n  n = 0;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      danci[n][k] = str[i];\n      k++;\n    } else {\n      danci[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  danci[n][k] = '\u0000';\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int e;\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(danci[i], a) == 0) {\n      strcpy(danci[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s\", danci[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35124", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n  scanf(\"%s \", str);\n  cin >> wrd;\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((*(str + i) != ' ') && (*(str + i) != '\u0000')) {\n      *(wd + j) = *(str + i);\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          *(str + k) = '\u0000';\n        for (k = i; k < n; k++) {\n          *(sr + k - i) = *(str + k);\n          *(str + k) = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          *(sr + k) = '\u0000';\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "35125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar s[1000];\nchar a[101];\nchar b[101];\nchar buf[101];\n\nint main() {\n  unsigned int i;\n  int index;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", b);\n  index = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ' || (i == strlen(s) - 1)) {\n      if (i == strlen(s) - 1) {\n        buf[index++] = s[i];\n      }\n      buf[index] = '\u0000';\n      index = 0;\n      if (!strcmp(buf, a)) {\n        cout << b;\n      } else {\n        printf(\"%s\", buf);\n      }\n      if (i != strlen(s) - 1) {\n        printf(\" \");\n      }\n    } else {\n      buf[index++] = s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35126", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, j, k = 0;\n  char s[100][100] = {0}, a[100], b[100], str[1000];\n  char *ps[100], *pa, *pb;\n\n  for (i = 0; i < 100; i++)\n    *(ps + i) = s[i];\n  pa = a;\n  pb = b;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", pa);\n\n  cin >> pb;\n  i = 0;\n  do {\n    for (j = 0; *(str + k) != ' ' && *(str + k) != '\u0000'; j++) {\n      *(*(ps + i) + j) = *(str + k);\n      k++;\n    }\n    *(*(ps + i) + j) = '\u0000';\n    i++;\n    k++;\n  } while (*(str + k) != '\u0000');\n  *(*(ps + i - 1) + j) = '\u0000';\n  m = i;\n  for (i = 0; i < m; i++) {\n    if (!strcmp(*(ps + i), pa))\n      strcpy(*(ps + i), pb);\n  }\n\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      printf(\"%s\", *(ps + i));\n    else\n      cout << \" \" << *(ps + i);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35127", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char m[100], z[100], t[100];\n\n  scanf(\"%s \", m);\n\n  scanf(\"%s \", z);\n\n  cin >> t;\n  char fz[100][100];\n  int len1 = strlen(m);\n  int i, k = 0, j = 0, num = 1;\n\n  for (i = 0; i < len1; i++) {\n    if (m[i] != 32) {\n      fz[k][j] = m[i];\n      j++;\n    } else {\n      num++;\n      k++;\n      j = 0;\n    }\n  }\n  for (k = 0; k < num; k++) {\n    if (k != num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s \", fz[k]);\n      } else {\n        printf(\"%s \", fz[k]);\n      }\n    }\n    if (k == num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s\", fz[k]);\n      } else {\n        printf(\"%s\", fz[k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35128", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[500] = {0}, b[30] = {0}, c[30] = {0}, temp[30] = {0};\n  int i, j, k, len, count = 0;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  len = strlen(a);\n  for (i = 0; i <= len; i++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      temp[count] = a[i];\n      count++;\n    }\n    if (a[i] == ' ') {\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n    if (a[i] == '\u0000') {\n\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35129", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a1, s1, p, d1, e1, b1;\n  char s[100], a[100], b[100], c[100], d[100], e[100], f[100], g[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  a1 = strlen(a);\n  s1 = strlen(s);\n  b1 = strlen(b);\n  for (i = 0; i < s1; i++) {\n\n    for (p = 0; p < a1; p++) {\n      c[p] = s[i + p];\n    }\n    c[a1] = 0;\n\n    if (strcmp(c, a) == 0) {\n      if ((i == 0 && s[a1] == 32) || (s[i - 1] == 32 && s[a1 + i] == 32)) {\n        for (d1 = 0; d1 < (s1 - i - a1); d1++)\n          d[d1] = s[d1 + a1 + i];\n        d[s1 - i - a1] = 0;\n        for (e1 = 0; e1 < i; e1++)\n          e[e1] = s[e1];\n        e[i] = 0;\n        strcat(e, b);\n        strcat(e, d);\n        strcpy(s, e);\n        s1 = strlen(s);\n        i = i + b1 - a1;\n      }\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l, i, j = 0, k = 0;\n  char s[100], a[20], b[20], str[50][20] = {\" \"}, (*p)[20];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    if (s[i] != ' ')\n      str[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n    if (s[i + 1] == '\u0000')\n      j++;\n  }\n  p = &str[0];\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, *(p + i)) == 0)\n      strcpy(*(p + i), b);\n  }\n  for (i = 0; i < j; i++) {\n    if (i == 0)\n      cout << *(p + i);\n    else\n      printf(\" %s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "35131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar a[2000];\nchar sub[2000];\nint b[2000];\nint jianyan[1000];\nint main() {\n\n  cin >> a;\n\n  cin >> sub;\n  int i, j = 0, v = 0, count_jianyan = 0, l = strlen(a), l_sub = strlen(sub);\n  for (int r = 0; r < l; r++) {\n    if (a[r] == ' ') {\n      jianyan[count_jianyan] = r;\n      count_jianyan++;\n    }\n  }\n  for (int u = 0; u < l_sub; u++) {\n    if (a[u] == sub[u]) {\n      b[0]++;\n    }\n  }\n  while (v < count_jianyan) {\n    i = jianyan[v] + 1;\n    for (j = 0; j < l_sub; j++) {\n      if (a[i + j] == sub[j])\n        b[i]++;\n    }\n    v++;\n  }\n  int k = 0, w[1000], count = 0;\n  for (int gl = 0; gl < 1000; gl++) {\n    w[gl] = 999;\n  }\n  for (k = 0; k < 2000; k++) {\n    if (b[k] == l_sub) {\n      w[count] = k;\n      count++;\n    }\n  }\n  char c[300];\n\n  cin >> c;\n  int q = 0, m = 0;\n  if (count != 0) {\n    while (q < l) {\n      if (q == w[m]) {\n        printf(\"%s\", c);\n        q += l_sub;\n        m++;\n      }\n      if (q != l) {\n        printf(\"%c\", a[q]);\n      }\n      q++;\n    }\n  } else if (count == 0) {\n    puts(a);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int l1 = 0, l2 = 0, l3 = 0, i, j, l;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n  while (a[l1] != '\\0')\n    l1++;\n  while (b[l2] != '\\0')\n    l2++;\n  while (c[l3] != '\\0')\n    l3++;\n  l = l1 - l2;\n  for (i = 0; i <= l; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + l2] == ' ' ||\n        i == 0 && a[i + l2] == ' ' || i == l && a[i - 1] == ' ') {\n      int flag = 1;\n      for (j = 0; j < l2; j++)\n        if (a[j + i] != b[j])\n          flag = 0;\n      if (flag) {\n        if (l2 == l3)\n          for (j = 0; j < l2; j++)\n            a[j + i] = c[j];\n        else if (l2 < l3) {\n          for (j = l + l2 - 1; j >= i + l2; j--)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        } else if (l2 > l3) {\n          for (j = i + l2; j < l + l2; j++)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        }\n        i += l3;\n        l += l3 - l2;\n      }\n    }\n  for (i = 0; i < l + l2; i++)\n    cout << a[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35133", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *str, *s1, *s2, *t, *str2;\n  int n;\n  str = (char *)calloc(102, 1000);\n  s1 = (char *)calloc(102, 1000);\n  s2 = (char *)calloc(102, 1000);\n  t = (char *)calloc(102, 1000);\n  str2 = (char *)calloc(240, 1000);\n\n  scanf(\"%s \", str);\n  scanf(\"%s%s\", s1, s2);\n  do {\n    sscanf(str, \"%s\", t);\n    n = strlen(t);\n    str = str + n + 1;\n    if (strcmp(t, s1) == 0)\n      strcat(str2, s2);\n    else\n      strcat(str2, t);\n    if (*str != '\u0000')\n      strcat(str2, \" \");\n  } while (*str != '\u0000');\n  printf(\"%s\", str2);\n}\n"}
{"label": "19", "index": "35134", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100], t;\n  int i, j;\n  for (i = 0; i <= 100; i++) {\n    cin >> a[i];\n    t = getchar();\n    if (t != ' ') {\n      j = i;\n      break;\n    }\n  }\n\n  cin >> b;\n\n  cin >> c;\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\" %s\", c);\n    else\n      printf(\" %s\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35135", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *w[100];\n  int i, j, k;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++) {\n    *s = '\u0000';\n    *a = '\u0000';\n    *b = '\u0000';\n  }\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  w[0] = (char *)malloc(100 * sizeof(char));\n  for (j = 0; j < 100; j++)\n    *(w[0] + j) = '\u0000';\n  i = 0;\n  j = 0;\n  for (p = s; *p != '\u0000'; p++) {\n    if (*p != ' ') {\n      *(w[i] + j) = *p;\n      j++;\n    } else {\n      i++;\n      w[i] = (char *)malloc(100 * sizeof(char));\n      for (j = 0; j < 100; j++)\n        *(w[i] + j) = '\u0000';\n      j = 0;\n    }\n  }\n  k = i;\n  for (i = 0; i < k; i++) {\n    if (strcmp(w[i], a) == 0)\n      strcpy(w[i], b);\n    for (j = 0; *(w[i] + j) != '\u0000'; j++)\n      printf(\"%c\", *(w[i] + j));\n    printf(\" \");\n  }\n  if (strcmp(w[k], a) == 0)\n    strcpy(w[k], b);\n  for (j = 0; *(w[k] + j) != '\u0000'; j++)\n    printf(\"%c\", *(w[k] + j));\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int x, y, z, i, j, k = 0, c, flag = 0;\n  char s[200], a[100], b[100], temp[300];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x + y;) {\n    if (flag == 0) {\n      c = 1;\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n\n      for (j = 0; j < y; j++)\n        if (a[j] != s[i + j])\n          c *= 0;\n\n      if (c != 1) {\n        temp[k] = s[i];\n        i++;\n        k++;\n      } else {\n        for (j = 0; j < z; j++, k++)\n          temp[k] = b[j];\n        i += y;\n      }\n\n    } else {\n\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n      temp[k] = s[i];\n      k++;\n      i++;\n    }\n  }\n  for (i = 0; i < k - y; i++)\n    cout << temp[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35137", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], a[50][20], t[20], word1[20], word2[20];\n  int i, j = 0, k = 0, num, p1, p2, q1, q2;\n\n  scanf(\"%s \", str);\n\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == ' ' || str[i] == ',') {\n      a[j][k] = 0;\n      j++;\n      k = 0;\n    } else {\n      a[j][k] = str[i];\n      k++;\n    }\n  }\n\n  a[j][k] = 0;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  for (k = 0; k < j + 1; k++) {\n    if (strcmp(word1, a[k]) == 0)\n\n      strcpy(a[k], word2);\n  }\n\n  for (k = 0; k < j + 1; k++) {\n    if (strlen(a[k]) != 0) {\n      if (k == 0)\n\n        printf(\"%s\", a[k]);\n      else\n        printf(\" %s\", a[k]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35138", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p, *q;\n  int k, m = 0;\n  char *s, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s \", s);\n  scanf(\"%s %s\", a, b);\n  k = strlen(a);\n  p = s;\n  q = a;\n  while (*p != '\u0000') {\n\n    if (m == k) {\n      if (*p == ' ' || *p == '\u0000') {\n        printf(\"%s\", b);\n        m = 0;\n        q = a;\n      } else {\n        printf(\"%s\", a);\n        m = 0;\n        q = a;\n      }\n    }\n\n    if (*p == *q) {\n      m++;\n      if (m == 1) {\n        if (p == s) {\n          p++;\n          q++;\n        } else {\n          p--;\n          if (*p == ' ') {\n            p = p + 2;\n            q++;\n          } else {\n            m = 0;\n            q = a;\n            p++;\n            printf(\"%c\", *p);\n            p++;\n          }\n        }\n      } else {\n        p++;\n        q++;\n      }\n    } else {\n      p = p - m;\n      printf(\"%c\", *p);\n      m = 0;\n      q = a;\n      p++;\n    }\n  }\n  if (m == k)\n    printf(\"%s\", b);\n  return 0;\n}\n"}
{"label": "19", "index": "35139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100];\n  char a[100];\n  char b[100];\n  char s2[15][20];\n  int i, k, x = 0, m, n;\n  char c, d;\n\n  cin >> s1;\n\n  cin >> a;\n\n  cin >> b;\n  m = 0;\n  n = 0;\n  k = 0;\n  for (i = 0; (c = s1[i]) != '\u0000'; i++) {\n    if (c != ' ') {\n      s2[k][m] = c;\n      m++;\n    } else {\n      s2[k][m] = '\u0000';\n      m = 0;\n      k++;\n      n++;\n    }\n  }\n  s2[n][m] = '\u0000';\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s2[i], a) == 0) {\n      x = 1;\n      for (k = 0; (d = b[k]) != '\u0000'; k++)\n        s2[i][k] = b[k];\n\n      s2[i][k] = '\u0000';\n    }\n  }\n  if (x == 1) {\n    for (i = 0; i < n; i++) {\n      printf(\"%s \", s2[i]);\n    }\n    cout << s2[n];\n  } else {\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[1000];\n  char word[100][100];\n  char sub[100];\n  char w[100];\n  int i, n, k;\n\n  cin >> a;\n\n  cin >> w;\n\n  scanf(\"%s \", sub);\n\n  n = 0;\n  k = 0;\n  for (i = 0; a[i] != 0; i++) {\n\n    if (a[i] == ' ') {\n      a[i] = '\u0000';\n      strcpy(word[n], (a + k));\n\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(word[n], (a + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], w) == 0) {\n\n      strcpy(word[i], sub);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    printf(\"%s \", word[i]);\n  }\n  puts(word[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35141", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[20][100], ori[100], exc[100], c; \n  int i = 0, j;                             \n  do {\n    cin >> sen[i]; \n    i++;\n  } while ((c = getchar()) != '\\n'); \n  cin >> ori;\n  cin >> exc;\n  for (j = 0; j < i; j++) {\n    if (strcmp(sen[j], ori) == 0) \n      strcpy(sen[j], exc);        \n  }\n  for (j = 0; j < i - 1; j++) {\n    cout << sen[j] << ' '; \n  }\n  cout << sen[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35142", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  char *p1, *p2, *p3, *p, *s;\n  p1 = (char *)malloc(1000 * sizeof(char));\n\n  scanf(\"%s \", p1);\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> p2;\n\n  cin >> p3;\n  n = strlen(p1);\n  s = p1;\n  sscanf(s, \"%s\", p);\n  m = strlen(p);\n  if (strcmp(p2, p) == 0) {\n    printf(\"%s\", p3);\n  } else {\n    printf(\"%s\", p);\n  }\n  s = s + m + 1;\n  for (i = n - m - 1; i >= 0; i = i - m - 1) {\n    sscanf(s, \"%s\", p);\n    m = strlen(p);\n    if (strcmp(p2, p) == 0) {\n      printf(\" %s\", p3);\n    } else {\n      printf(\" %s\", p);\n    }\n    s = s + m + 1;\n  }\n}\n"}
{"label": "19", "index": "35143", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k = 0, m = 0;\n  char s[1000], a[101], b[101];\n  char word[30][101];\n  cin.getline(s, 1000);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != ' ') {\n      word[k][m] = s[i];\n      m++;\n    } else {\n      word[k][m] = '\\0';\n      k++;\n      m = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", word[i]);\n  cout << word[k];\n  cin >> k;\n  return 0;\n}\n"}
{"label": "19", "index": "35144", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n\n  for (i = 0; i <= lena - lenb; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + lenb] == ' ' ||\n        i == 0 && a[i + lenb] == ' ' || i == lena - lenb && a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb > lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenb;\n          lena -= lenb - lenc;\n        } else {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenb; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          i += lenc;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35145", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[100][100] = {'\u0000'};\n  int i, k = 0, j = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[k][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ') {\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      cout << \" \" << c[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {0};                 \n  char a[100] = {0}, b[100] = {0}, n = 0; \n  int i = 0, k = 0, kongzhi = 0, x = 0;   \n  for (i = 0;; i++)                       \n  {\n    for (k = 0;; k++) {\n      s[i][k] = getchar();\n      if (s[i][k] == ' ' || s[i][k] == '\\n')\n        break;\n    }\n    n++; \n    if (s[i][k] == '\\n')\n      break;\n  }\n  for (i = 0;; i++) \n  {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n  }\n  for (i = 0;; i++) \n  {\n    b[i] = getchar();\n    if (b[i] == '\\n') {\n      x = i;\n      b[i] = ' ';\n      break;\n    }\n  }\n  for (i = 0; i < n; i++) \n  {\n    for (k = 0; k < 100; k++) {\n      if (s[i][k] != a[k] && s[i][k] != ' ' && s[i][k] != '\\n')\n        kongzhi = 1;\n    }\n    if (kongzhi == 0) {\n      if (i == n - 1)\n        b[x] = 0;\n      for (k = 0; k < 100; k++)\n        s[i][k] = b[k];\n    }\n    kongzhi = 0;\n  }\n  for (i = 0; s[i][k] != 0; i++) \n  {\n    for (k = 0; s[i][k] != 0; k++)\n      cout << s[i][k];\n    k = 0; \n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35147", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char *ss[100];\n  int i, n = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  ss[n++] = s;\n  for (i = 0; s[i]; i++) {\n    if (s[i] == ' ') {\n      s[i] = 0;\n      ss[n++] = s + i + 1;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(ss[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(ss[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[300];\n\n  cin >> string;\n  char a[200], b[200];\n  scanf(\"%s %s\", a, b);\n\n  char word[200][200];\n  int n1, n2, i, k;\n  int m = 0;\n  int p = 0;\n  n1 = strlen(string);\n  for (i = 0; i < n1; i++) {\n    if (string[i] == ' ') {\n      m++;\n      p = 0;\n    } else {\n      word[m][p] = string[i];\n      p++;\n    }\n  }\n\n  if (strcmp(word[0], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word[0]);\n\n  for (k = 1; k <= m; k++) {\n    if (strcmp(word[k], a) == 0)\n      printf(\" %s\", b);\n    else\n      printf(\" %s\", word[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35149", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], t = 1;\n  char tihuan[100][100];\n  int i, j = 0, m = -1, n;\n\n  scanf(\"%s \", a);\n  cin >> b;\n  scanf(\"%s\", c);\n  for (i = 0;; i++) {\n    if (a[i] == ' ') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n    }\n    if (a[i] == '\u0000') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n      break;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (strcmp(tihuan[i], b) == 0) {\n      strcpy(tihuan[i], c);\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (t) {\n      printf(\"%s\", tihuan[i]);\n      t = 0;\n    } else\n      printf(\" %s\", tihuan[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[200], a[100], b[100];\n  int l, result = 0, i, j, l1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    result = 0;\n    if ((i == 0) || (s[i - 1] == ' ')) {\n      result = 1;\n      for (j = i; j <= i + (l1 - 1); j++) {\n        if (s[j] != a[j - i])\n          result = 0;\n      }\n    }\n    if (result == 1) {\n      printf(\"%s\", b);\n      i = i + l1 - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35151", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  unsigned int i = 0, j = 0;\n  char s[101];\n  char a[101];\n  char b[101];\n  char tmp[101];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      tmp[j] = s[i];\n      j++;\n    } else {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(tmp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", tmp);\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(tmp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", tmp);\n  return 0;\n}\n"}
{"label": "19", "index": "35152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][100] = {'\u0000'}, a[100], b[100];\n  int i = 0, j, k;\n  char(*ps)[100];\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != ' ');\n  k = i;\n  cin >> a;\n  cin >> b;\n  ps = &s[0];\n  for (i = 0; i < k; i++)\n    if (strcmp(*(ps + i), a) == 0) {\n      for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n        *(*(ps + i) + j) = '\u0000';\n      strcpy(*(ps + i), b);\n    }\n  for (j = 0; *(*(ps + 0) + j) != '\u0000'; j++)\n    cout << *(*(ps + 0) + j);\n  for (i = 1; i < k; i++) {\n    printf(\" \");\n\n    for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n      cout << *(*(ps + i) + j);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35153", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  int x, i, k = 0;\n  char str[100];\n  char temp[100];\n  char in[100];\n  char out[100];\n  char *str0;\n\n  scanf(\"%s \", str);\n\n  cin >> in;\n\n  cin >> out;\n  str0 = str;\n  x = strlen(str);\n  for (i = 0; i < x; i++) {\n    if (*(str0 + i) != ' ' && i != x - 1) {\n      temp[k] = *(str0 + i);\n      k++;\n    } else if (*(str0 + i) == ' ' && i != x - 1) {\n      temp[k] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n      k = 0;\n    } else if (i == x - 1) {\n      temp[k] = *(str0 + i);\n      temp[k + 1] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n    }\n  }\n  return (0);\n}\n"}
{"label": "19", "index": "35154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][101];\n  char a[101], b[101];\n  int i, j;\n  scanf(\"%s\", s[0]);\n  for (i = 1; getchar() != ' '; i++) {\n    scanf(\"%s\", s[i]);\n  }\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (j = 0; j < i; j++) {\n    if (strcmp(s[j], a) == 0)\n      strcpy(s[j], b);\n  }\n  printf(\"%s\", s[0]);\n  for (j = 1; j < i; j++) {\n    printf(\" %s\", s[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, len, n = 0, j = 0, z = 0, len1, len3, d;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      c[n][j] = s[i];\n      j++;\n    } else {\n      c[n][j] = '\u0000';\n      n++;\n      j = 0;\n    }\n  }\n  c[n][j] = '\u0000';\n  len1 = strlen(a);\n  for (i = 0; i <= n; i++) {\n    z = 0;\n    d = 0;\n    len3 = strlen(c[i]);\n    for (j = 0; j < len3 && j < len1; j++) {\n      if (c[i][j] == a[z]) {\n        d++;\n        z++;\n      }\n    }\n    if (d == len1) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35156", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  int i, j = 0, k, m;\n  int n = 1;\n  char t[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ')\n      n++;\n  }\n\n  for (i = 0; s[i] != ' '; i++) {\n    t[i] = s[i];\n  }\n  t[i] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", t);\n  }\n  k = i + 1;\n\n  for (i = 1; i < n - 1; i++) {\n    m = 0;\n    for (j = k; s[j] != ' '; j++) {\n      t[m] = s[j];\n      m++;\n    }\n    t[m] = '\u0000';\n    if (strcmp(t, a) == 0) {\n      printf(\" %s\", b);\n    } else {\n      printf(\" %s\", t);\n    }\n    k = j + 1;\n  }\n\n  m = 0;\n  for (j = k; s[j] != '\u0000'; j++) {\n    t[m] = s[j];\n    m++;\n  }\n  t[m] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\" %s\", b);\n  } else {\n    printf(\" %s\", t);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      if (i != 0 && s[i - 1] != ' ') {\n        t = 0;\n      }\n    }\n\n    if (t == 1) {\n      cout << b;\n      i += la - 1;\n    }\n    if (t == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35158", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], t = 1;\n  char tihuan[100][100];\n  int i, j = 0, m = -1, n;\n\n  scanf(\"%s \", a);\n  cin >> b;\n  cin >> c;\n  for (i = 0;; i++) {\n    if (a[i] == ' ') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n    }\n    if (a[i] == '\u0000') {\n      n = m;\n      m = i;\n      strncpy(tihuan[j], a + n + 1, m - n - 1);\n      tihuan[j][m - n - 1] = '\u0000';\n      j++;\n      break;\n    }\n  }\n  for (i = 0; i < j; i++) {\n    if (strcmp(tihuan[i], b) == 0) {\n      strcpy(tihuan[i], c);\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (t) {\n      printf(\"%s\", tihuan[i]);\n      t = 0;\n    } else\n      printf(\" %s\", tihuan[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[300], a[50][20], t[20], word1[20], word2[20];\n  int i, j = 0, k = 0, num, p1, p2, q1, q2;\n\n  scanf(\"%s \", str);\n\n  for (i = 0; str[i] != 0; i++) {\n    if (str[i] == ' ' || str[i] == ',') {\n      a[j][k] = 0;\n      j++;\n      k = 0;\n    } else {\n      a[j][k] = str[i];\n      k++;\n    }\n  }\n\n  a[j][k] = 0;\n\n  cin >> word1;\n\n  cin >> word2;\n\n  for (k = 0; k < j + 1; k++) {\n    if (strcmp(word1, a[k]) == 0)\n\n      strcpy(a[k], word2);\n  }\n\n  for (k = 0; k < j + 1; k++) {\n    if (strlen(a[k]) != 0) {\n      if (k == 0)\n\n        printf(\"%s\", a[k]);\n      else\n        cout << \" \" << a[k];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35160", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][100], a[100], b[100];\n  int i = 0, k;\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != '\\n');\n  k = i;\n  scanf(\"%s %s\", a, b);\n  for (i = 0; i < k - 1; i++)\n    if (strcmp(s[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      printf(\"%s \", s[i]);\n  if (strcmp(s[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar chStr[103][101];\nint iLen = 0;\nint main() {\n  int i, j = 0, k;\n  while (cin >> chStr[j])\n    j++;\n  while (chStr[j - 1][iLen])\n    iLen++;\n  for (i = 0; i < j - 2; ++i) {\n    if (!strcmp(chStr[i], chStr[j - 2])) {\n      for (k = 0; k < 101; ++k)\n        chStr[i][k] = 0;\n\n      for (k = 0; k < iLen; ++k)\n        chStr[i][k] = chStr[j - 1][k];\n    }\n  }\n  for (i = 0; i < j - 3; ++i)\n    cout << chStr[i] << \" \";\n\n  cout << chStr[j - 3] << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "35162", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[101], s2[101];\n  char instead1[101], instead2[101], temp[101];\n\n  scanf(\"%s \", s1);\n  cin >> instead1;\n  cin >> instead2;\n  int i, j, count = 0, countS2 = 0;\n  for (i = 0; i < strlen(s1) + 1; i++) {\n    if (s1[i] != ' ' && s1[i] != '\u0000')\n      temp[count++] = s1[i];\n    else {\n      temp[count] = '\u0000';\n      if (!strcmp(temp, instead1)) {\n        for (j = 0; j < strlen(instead2); j++)\n          s2[countS2++] = instead2[j];\n      } else\n        for (j = i - count; j < i - count + strlen(temp); j++)\n          s2[countS2++] = s1[j];\n      count = 0;\n    }\n    if (s1[i] == ' ')\n      s2[countS2++] = s1[i];\n  }\n  s2[countS2] = '\u0000';\n  printf(\"%s\\n\", s2);\n  return 0;\n}\n"}
{"label": "19", "index": "35163", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0;\n  while (i < strlen(a)) {\n    if (i == 0) {\n      if (a[i] == b[0]) {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          cout << c;\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      if (a[i] == b[0] && a[i - 1] == ' ') {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35164", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100] = {'\u0000'}, s2[100] = {'\u0000'}, a[100] = {'\u0000'}, b[100] = {'\u0000'};\n\n  scanf(\"%s \", s1);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = 0, lena = strlen(a), lenb = strlen(b), n = strlen(s1);\n  for (i = 0; i < n - lena + 1; i++) {\n    if (i > 0 && s1[i - 1] != ' ') {\n      s2[t] = s1[i];\n      t += 1;\n      continue;\n    }\n    for (j = 0; j < lena; j++) {\n      if (s1[i + j] != a[j])\n        break;\n    }\n    if (i + j == n || j == lena && s1[i + j] == ' ') {\n      for (k = 0; k < lenb; k++)\n        s2[t + k] = b[k];\n      t += lenb;\n      i += lena - 1;\n    } else {\n      s2[t] = s1[i];\n      t += 1;\n    }\n  }\n  if (i == n - lena + 1) {\n    for (k = 0; k < lena - 1; k++)\n      s2[t + k] = s1[i + k];\n  }\n  puts(s2);\n  return 0;\n}\n"}
{"label": "19", "index": "35165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, j, m = 0, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      n++;\n      c[n][0] = s[i + 1];\n      m = 1;\n      i++;\n    } else {\n      c[n][m] = s[i];\n      m++;\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0)\n      strcpy(c[i], b);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n  printf(\"%s\", c[n]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120], a[120], b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int len_s = strlen(s);\n  int len_a = strlen(a);\n  int i = 0, j;\n  while (i < len_s) {\n    if (i == 0 || s[i - 1] == ' ') {\n      for (j = 0; j < len_a && i + j < len_s; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (j == len_a) {\n        cout << b;\n        i += len_a;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n  printf(\"\\n\");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35167", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[200];\n  int i, j = 0, k = 0, z = 0, p, q, r, m, h = 0, v;\n  int t[100], n[100];\n  char u, w;\n\n  cin >> c;\n  cin >> a;\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  r = strlen(c);\n  u = a[0];\n  for (i = 0; i < r; i++) {\n    w = c[i];\n    if (u == w) {\n      if (i == 0 || c[i - 1] == ' ') {\n        t[j] = i;\n        j += 1;\n      } else {\n        k += 1;\n      }\n    } else {\n      k += 1;\n    }\n  }\n  if (k == r) {\n    printf(\"%s\", c);\n  } else {\n    for (k = 0; k < j; k++) {\n      for (i = 1; i < p; i++) {\n        m = t[k];\n        u = a[i];\n        w = c[m + i];\n        if (u != w) {\n          z += 1;\n          break;\n        }\n      }\n      if (i == p) {\n        n[h] = t[k];\n        h += 1;\n      }\n    }\n    if (z == j) {\n      printf(\"%s\", c);\n    } else {\n      m = n[0];\n      if (m == 0) {\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      } else {\n        for (i = 0; i < n[0]; i++) {\n          printf(\"%c\", c[i]);\n        }\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35168", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *str[1024];\n  int n = 0, i;\n  str[0] = (char *)calloc(101, sizeof(char));\n  while (scanf(\"%s\", str[n]) != EOF) {\n    n = n + 1;\n    str[n] = (char *)calloc(101, sizeof(char));\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (strcmp(str[i], str[n - 2]) == 0)\n      cout << str[n - 1] << \" \";\n    else\n      cout << str[i] << \" \";\n  }\n  if (strcmp(str[i], str[n - 2]) == 0)\n    printf(\"%s\", str[n - 1]);\n  else\n    cout << str[i];\n}\n"}
{"label": "19", "index": "35169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100];\n  char c[101], word1[100], replaceword[100];\n\n  cin >> c;\n  cin >> word1;\n  cin >> replaceword;\n  int i, j = 0, k = 0;\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    } else {\n      str[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  str[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], replaceword);\n  }\n  cout << str[0];\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str[i]);\n  cout << \" \";\n}\n"}
{"label": "19", "index": "35170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[200], b[200];\n  char *temp, *ps, *pa, *pb;\n  int flag, ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  ps = s;\n  pa = a;\n  pb = b;\n  while (ps < s + ls) {\n    flag = 1;\n    for (pa = a; ((*ps != ' ') && (*ps != '\u0000')); ps++, pa++)\n      if (*ps != *pa)\n        flag = 0;\n    if ((flag) && (pa == a + la)) {\n      if (la >= lb) {\n        ps = ps - la;\n        while (*pb != '\u0000')\n          *ps++ = *pb++;\n        if (la > lb) {\n          while (*(ps + la - lb) != '\u0000') {\n            *ps = *(ps + la - lb);\n            ps++;\n          }\n          *ps = '\u0000';\n        }\n      } else {\n        temp = ps;\n        for (ps = s + ls; ps >= temp; ps--)\n          *(ps + lb - la) = *ps;\n        ps = ps - la + 1;\n        while (*pb != '\u0000')\n          *ps++ = *pb++;\n      }\n      pa = a;\n      pb = b;\n      ls = strlen(s);\n    }\n    ps++;\n  }\n  ps = s;\n  printf(\"%s\", ps);\n}\n"}
{"label": "19", "index": "35171", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000] = {0};\n  char a[100] = {0}, b[100] = {0};\n\n  cin >> s;\n  int c[1000] = {0};\n  scanf(\"%s%s\", a, b);\n  int i, j, k = 0, h, d = 0;\n  int l = strlen(s);\n  int p = strlen(a);\n  for (i = 0; i < l; i++) {\n    if ((a[0] == s[i] && s[i - 1] == ' ') || (a[0] == s[i] && i == 0)) {\n      c[d] = i;\n      for (j = 1; j < p; j++) {\n        if (a[j] == s[i + j]) {\n          k = 1;\n        } else {\n          k = 0;\n        }\n      }\n      if (k != 0) {\n        d++;\n      }\n    }\n  }\n  if (k == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < c[0]; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (h = 0; h < d; h++) {\n      printf(\"%s\", b);\n      for (j = p + c[h]; j < c[h + 1]; j++) {\n        printf(\"%c\", s[j]);\n      }\n    }\n    for (j = c[d - 1] + p; j < l; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35172", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[10] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i;\n  char a2[100];\n  a2[0] = ' ';\n  a2[1] = a[0];\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    a2[i + 1] = a[i];\n  }\n\n  char tmp[100];\n\n  int j;\n  tmp[0] = s[0];\n  for (i = 1; s[i - 1] != ' ' && s[i - 1] != '\u0000'; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      tmp[i] = '\u0000';\n    } else {\n      tmp[i] = s[i];\n    }\n  }\n  if (strcmp(tmp, a) == 0) {\n    cout << b;\n  } else {\n    printf(\"%s\", tmp);\n  }\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; s[j] != ' ' && s[j] != '\u0000'; j++) {\n        tmp[0] = ' ';\n        if (s[j + 1] == ' ' || s[j + 1] == '\u0000') {\n          tmp[j - i] = s[j];\n          tmp[j - i + 1] = '\u0000';\n        } else {\n          tmp[j - i] = s[j];\n        }\n      }\n    } else {\n      continue;\n    }\n\n    if (strcmp(tmp, a2) == 0) {\n      printf(\"%s\", c);\n      printf(\"%s\", b);\n    } else\n      printf(\"%s\", tmp);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35173", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], s1[100], s2[100], t[100];\n  char *p, *p1;\n  int i = 0;\n\n  cin >> str;\n\n  cin >> s1;\n\n  cin >> s2;\n  for (p = str; *(p - 1) != '\u0000'; p++) {\n    if (*p == ' ' || *p == '\u0000') {\n      *(t + i) = '\u0000';\n      if (strcmp(s1, t) == 0)\n        p1 = s2;\n      else\n        p1 = t;\n\n      if (p - strlen(t) != str)\n        putchar(' ');\n      cout << p1;\n      i = 0;\n    } else {\n      *(t + i) = *p;\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35174", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200] = {0};\n  char a[100] = {0}, b[100] = {0};\n  int c[200] = {0};\n  int lena = 0, lenb = 0, lens = 0, i = 0, j = 0, k = 0, count = 0, t = 0;\n  cin.get(s, 200, '\\n');\n  cin >> a >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lens = strlen(s);\n  if ((s[0] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0)) {\n    for (j = 0; j < lena; j++) {\n      if (s[i + j] == a[j])\n        count++;\n    }\n    if (count == lena)\n      k++;\n    count = 0;\n  }\n  for (i = 1; i < lens; i++, count = 0) {\n    if ((s[i] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0) &&\n        (s[i - 1] == 32)) {\n      for (j = 0; j < lena; j++) {\n        if (s[i + j] == a[j])\n          count++;\n      }\n      if (count == lena) {\n        c[k] = i;\n        k++;\n      }\n    }\n  }\n  c[k] = 201;\n  if (lena < lenb) {\n    t = lenb - lena;\n    for (i = lens - 1; i >= 0; i--)\n      for (j = k - 1; j >= 0; j--) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i + (j + 1) * t] = s[i];\n      }\n    for (i = 0; i < k; i++)\n      for (j = 0; j < lenb; j++)\n        s[c[i] + i * t + j] = b[j];\n  } else if (lena >= lenb) {\n    t = lena - lenb;\n    for (i = c[0] + t; i < lens; i++)\n      for (j = 0; j < k; j++) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i] = s[i + (j + 1) * t];\n      }\n    b[lenb] = 32;\n    for (i = 0; i < k; i++)\n      for (j = 0; j <= lenb; j++)\n        s[c[i] - i * t + j] = b[j];\n  }\n  int l = strlen(s);\n  if (s[l - 1] == 32)\n    s[l - 1] = 0;\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35175", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[101], s2[101];\n  char instead1[101], instead2[101], temp[101];\n\n  cin >> s1;\n  cin >> instead1;\n  cin >> instead2;\n  int i, j, count = 0, countS2 = 0;\n  for (i = 0; i < strlen(s1) + 1; i++) {\n    if (s1[i] != ' ' && s1[i] != '\u0000')\n      temp[count++] = s1[i];\n    else {\n      temp[count] = '\u0000';\n      if (!strcmp(temp, instead1)) {\n        for (j = 0; j < strlen(instead2); j++)\n          s2[countS2++] = instead2[j];\n      } else\n        for (j = i - count; j < i - count + strlen(temp); j++)\n          s2[countS2++] = s1[j];\n      count = 0;\n    }\n    if (s1[i] == ' ')\n      s2[countS2++] = s1[i];\n  }\n  s2[countS2] = '\u0000';\n  cout << s2 << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100][100] = {0}, c[100] = {0}, d[100] = {0};\n  int i, j, m = 0, n = 1, k = 0;\n  cin >> a;\n  cin >> c;\n  cin >> d;\n  m = strlen(a);\n  for (j = 0; j <= m - 1; j++)\n    if (a[j] == 32)\n      n++;\n  for (j = 0; j <= n - 1; j++) {\n    for (i = 0; a[k] != 32; i++) {\n      b[j][i] = a[k];\n      k++;\n    }\n    if (a[k] == 32)\n      k++;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(b[j], c) == 0)\n      printf(\"%s\", d);\n    else\n      printf(\"%s\", b[j]);\n  }\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100], s[100], d[100], e[30][30];\n  int m = 0, n = 0, l, i;\n\n  cin >> c;\n  l = strlen(c);\n\n  cin >> s;\n\n  cin >> d;\n  for (i = 0; i < (l + 1); i++) {\n    e[m][n] = c[i];\n    n++;\n    if (c[i] == ' ') {\n      e[m][n - 1] = 0;\n      m++;\n      n = 0;\n    }\n  }\n  for (i = 0; i <= m; i++)\n    if (strcmp(s, e[i]) == 0)\n      strcpy(e[i], d);\n  printf(\"%s\", e[0]);\n  for (i = 1; i <= m; i++)\n    printf(\" %s\", e[i]);\n}\n"}
{"label": "19", "index": "35178", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n  cin >> s;\n  cin >> w;\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      if (strcmp(h[i], w) == 0) {\n        if (h[i][j] == w[j]) {\n          t = 1;\n        }\n      }\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      cout << h[i][j];\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35179", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], str4[100][100], *p;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  p = str1;\n  int i, j = 0, k = 0, n;\n  n = strlen(str1);\n  for (i = 0; i <= n; i++) {\n    if ((*(p + i) != ' ') && (*(p + i) != '\u0000')) {\n      str4[k][j] = str1[i];\n      j = j + 1;\n    } else {\n      str4[k][j] = '\u0000';\n      j = 0;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(str4[i], str2) == 0) {\n\n      strcpy(str4[i], str3);\n    }\n  }\n  for (i = 0; i < k - 1; i++)\n    cout << str4[i] << \" \";\n  printf(\"%s \", str4[k - 1]);\n}\n"}
{"label": "19", "index": "35180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *w[100];\n  int i, j, k;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++) {\n    *s = '\u0000';\n    *a = '\u0000';\n    *b = '\u0000';\n  }\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  w[0] = (char *)malloc(100 * sizeof(char));\n  for (j = 0; j < 100; j++)\n    *(w[0] + j) = '\u0000';\n  i = 0;\n  j = 0;\n  for (p = s; *p != '\u0000'; p++) {\n    if (*p != ' ') {\n      *(w[i] + j) = *p;\n      j++;\n    } else {\n      i++;\n      w[i] = (char *)malloc(100 * sizeof(char));\n      for (j = 0; j < 100; j++)\n        *(w[i] + j) = '\u0000';\n      j = 0;\n    }\n  }\n  k = i;\n  for (i = 0; i < k; i++) {\n    if (strcmp(w[i], a) == 0)\n      strcpy(w[i], b);\n    for (j = 0; *(w[i] + j) != '\u0000'; j++)\n      printf(\"%c\", *(w[i] + j));\n    printf(\" \");\n  }\n  if (strcmp(w[k], a) == 0)\n    strcpy(w[k], b);\n  for (j = 0; *(w[k] + j) != '\u0000'; j++)\n    printf(\"%c\", *(w[k] + j));\n  cout << \" \";\n}\n"}
{"label": "19", "index": "35181", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, len, n = 0, j = 0, z = 0, len1, len3, d;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      c[n][j] = s[i];\n      j++;\n    } else {\n      c[n][j] = '\u0000';\n      n++;\n      j = 0;\n    }\n  }\n  c[n][j] = '\u0000';\n  len1 = strlen(a);\n  for (i = 0; i <= n; i++) {\n    z = 0;\n    d = 0;\n    len3 = strlen(c[i]);\n    for (j = 0; j < len3 && j < len1; j++) {\n      if (c[i][j] == a[z]) {\n        d++;\n        z++;\n      }\n    }\n    if (d == len1) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, hh, la, lb, ls, same, head, end, l, sum;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  hh = 0;\n  sum = 0;\n  for (i = 0; i < ls; i++) {\n    same = 0;\n    if ((s[i] == a[0]) && (i == 0 || s[i - 1] == ' ')) {\n      l = 1;\n      for (j = 1; j < la; j++) {\n        if (a[j] != s[i + j]) {\n          same = 0;\n          break;\n        }\n        l++;\n        same = 1;\n        head = i;\n        end = i + la - 1;\n      }\n    }\n    if ((same == 1) && (i + la == ls || s[i + la] == ' ')) {\n      for (k = hh; k < head; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lb; k++)\n        printf(\"%c\", b[k]);\n      hh = end + 1;\n      sum = 1;\n    }\n  }\n  if (sum == 0) {\n    printf(\"%s\", s);\n  }\n  if (sum == 1) {\n    for (i = hh; i < ls; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35183", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, i, j = 0;\n  char s[101] = {0}, c[101], d[101];\n\n  cin >> s;\n\n  cin >> c;\n\n  cin >> d;\n  a = strlen(s);\n  for (i = 0; i < a; i++) {\n    char b[101] = {0};\n    while (s[i] != ' ' && i < a) {\n      b[j] = s[i];\n      j++;\n      i++;\n    }\n    if (strcmp(b, c) == 0) {\n      cout << d;\n    } else {\n      cout << b;\n    }\n    if (i < a) {\n      printf(\" \");\n    }\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[10001];\n  char c1[101], c2[101];\n  int i, j, a, b, c;\n  cin.getline(str, 10001);\n  cin >> c1 >> c2;\n  a = strlen(str);\n  b = strlen(c1);\n  c = strlen(c2);\n  for (i = 0; i < a; i++) {\n    if (((str[i - 1] == 32) && (str[i + b] == 32)) ||\n        ((i == 0) && (str[i + b] == 32)) ||\n        (str[i - 1] == 32) && (i + b == a)) {\n      if (str[i] == c1[0]) {\n        for (j = i; j <= i + b - 1; j++) {\n          if (str[j] != c1[j - i]) {\n            break;\n          }\n        }\n        if (j == (i + b)) {\n          if (c > b) {\n            for (j = a - 1; j >= i + b; j--) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) {\n              str[j] = c2[j - i];\n            }\n            a = a + c - b;\n            i = i + c - 1;\n          } else {\n            for (j = i + b; j <= a - 1; j++) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) {\n              str[j] = c2[j - i];\n            }\n            a = a + c - b;\n            i = i + c;\n          }\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], s1[101], s2[101], s4[101];\n  cin >> s;\n  cin >> s1;\n  cin >> s2;\n  char s3[100][101];\n  char *p;\n  char(*p3)[101];\n  int n, i;\n  n = strlen(s);\n  p = s;\n  p3 = s3;\n  i = 0;\n  for (p = s; p <= (s + n); p++) {\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *((*p3) + i) = '\u0000';\n      p3++;\n      i = 0;\n    } else {\n      *((*p3) + i) = *p;\n      i++;\n    }\n  }\n  *((*p3)) = '\u0000';\n  for (p3 = s3; *((*p3)) != '\u0000'; p3++) {\n    if (strcmp(*p3, s1) == 0) {\n      strcpy(*p3, s2);\n    }\n  }\n  p3 = s3;\n  strcpy(s4, *p3);\n  for (p3 = s3 + 1; *((*p3)) != '\u0000'; p3++) {\n    strcat(s4, \" \");\n    strcat(s4, *p3);\n  }\n  puts(s4);\n  return 0;\n}\n"}
{"label": "19", "index": "35186", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l = 0, k = 0, m[100], str1, str2, str3;\n  char a[1000], b[100], c[1000];\n  cin.getline(a, 1000);\n  cin.getline(b, 100);\n  cin.getline(c, 1000);\n  str1 = strlen(a);\n  str2 = strlen(b);\n  str3 = strlen(c);\n  for (i = 0; i < str1; i++) {\n    for (j = 0; j < str2; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      }\n      if (j == str2 - 1 && (a[i - 1] == ' ' || i == 0)) {\n        m[k] = i;\n        k++;\n      }\n    }\n  }\n  k = 0;\n  for (i = 0; i < str1; i++) {\n    if (m[k] == i) {\n      l++;\n      k++;\n      i += str2 - 1;\n      for (j = 0; j < str3; j++) {\n        printf(\"%c\", c[j]);\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100], *a, *b;\n  int i, j;\n  for (i = 0;; i++) {\n    p[i] = (char *)malloc(100);\n    scanf(\"%s\", p[i]);\n    if (getchar() == ' ')\n      break;\n  }\n  a = (char *)malloc(100);\n  scanf(\"%s\", a);\n  b = (char *)malloc(100);\n  scanf(\"%s\", b);\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], a) == 0)\n      p[j] = b;\n  for (j = 0; j < i; j++)\n    printf(\"%s \", p[j]);\n  printf(\"%s\", p[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35188", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100],\n      word[100] = {'0'}, change[100],\n      chafor[100]; \n  char a[100][100] = {{'0'}, {'0'}};\n  int i, j, len, m, start = 0, num = 1; \n\n  cin >> str;\n\n  cin >> change;\n\n  cin >> chafor;\n  len = strlen(str);\n  for (i = 0; i < len; i++) \n  {\n    if (str[i] == ' ')\n      num += 1;\n  }\n  for (i = 0; i < num; i++) {\n    m = 0;\n    for (j = start; j < len; j++) \n    {\n      if (str[j] != ' ') {\n        a[i][m] = str[j];\n        m += 1;\n      } else {\n        start = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], change) == 0)\n      strcpy(a[i], chafor);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++)\n    printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35189", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, k, y;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s);) {\n    y = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i]) {\n        if (s[i - 1] == 32 || i == 0) {\n          y = y + 1;\n        }\n      } else\n        break;\n    }\n    if (y == strlen(a)) {\n      i = i + strlen(a);\n      for (k = 0; k < strlen(b); k++)\n        printf(\"%c\", b[k]);\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[100][100];\nchar s[100], t[100];\nchar c;\n\nint main() {\n  int cnt = 0;\n  while (1) {\n    cin >> str[cnt++];\n    if (getchar() == '\\n')\n      break;\n  }\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (int i = 0; i < cnt; i++) {\n    if (strcmp(str[i], s) == 0)\n      strcpy(str[i], t);\n  }\n  for (int i = 0; i < cnt - 1; i++)\n    cout << str[i] << \" \";\n  printf(\"%s\\n\", str[cnt - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int a, b, d, e = -1;\n  char f[100], g[100], h[100], i[100];\n\n  cin >> f;\n\n  cin >> g;\n\n  cin >> h;\n  f[-1] = ' ';\n  for (a = -1; a <= 100;) {\n    i[e] = f[a];\n    if (f[a] == ' ' && f[a + 1] == g[0]) {\n      for (b = 0;; b++) {\n        if (g[b] == '\u0000') {\n          for (d = 0; h[d] != '\u0000'; d++) {\n            i[e + d + 1] = h[d];\n          }\n          i[e + d + 1] = ' ';\n          e = e + d;\n          a = a + b;\n          break;\n        }\n\n        if (f[a + b + 1] != g[b])\n          break;\n      }\n    }\n    a++;\n    e++;\n  }\n  printf(\"%s\", i);\n}\n"}
{"label": "19", "index": "35192", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], s_[200][200], s__[200];\n  int i, n = 0, m, j = 0, p = 0;\n\n  scanf(\"%s \", s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    s__[i] = s[i];\n  }\n  s__[i] = ' ';\n  s__[i + 1] = '\u0000';\n  scanf(\"%s%s\", a, b);\n  for (i = 0; s__[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    if (s__[i] == ' ') {\n      s_[j][p] = '\u0000';\n      j++;\n      p = 0;\n    } else {\n      s_[j][p] = s__[i];\n      p++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++) {\n    if (strcmp(s_[j], a) == 0) {\n      printf(\"%s \", b);\n    } else\n      printf(\"%s \", s_[j]);\n  }\n  if (strcmp(s_[m - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", s_[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35193", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  while (ch != ' ') {\n    scanf(\"%s\", s[i++]);\n    ch = getchar();\n  }\n\n  cin >> a;\n\n  cin >> b;\n\n  p = &s[0];\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35194", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], c[100], d[100][20] = {0};\n  int i, j = 0, k = 0, l;\n  cin.getline(a, 300);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    d[j][k] = a[i];\n    k = k + 1;\n    if (a[i + 1] == ' ' || i == l - 1)\n      j = j + 1, k = 0, i = i + 1;\n  }\n  for (i = 0; i < j; i++)\n    if (strcmp(d[i], b) == 0)\n      strcpy(d[i], c);\n  printf(\"%s\", d[0]);\n  for (i = 1; i < j; i++)\n    cout << \" \" << d[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35195", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, k, m = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  l = strlen(a);\n  char **p;\n  p = (char **)malloc(500 * sizeof(char *));\n  for (i = 0; i <= 499; i++)\n    p[i] = (char *)malloc(500 * sizeof(char));\n  for (k = 0, i = 0; k <= l - 1 && i <= 499; i++) {\n    for (j = 0; j <= 499; j++) {\n      if (a[k] != ' ' && a[k] != '\u0000') {\n        p[i][j] = a[k];\n        k++;\n      } else {\n        k++;\n        p[i][j] = '\u0000';\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (strcmp(p[i], b) == 0)\n      strcpy(p[i], c);\n  }\n  for (i = 0; i <= m - 2; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[m - 1]);\n}\n"}
{"label": "19", "index": "35196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nstruct node {\n  char str[110];\n} all[110];\n\nint main() {\n  char s[110], str[110], word[110], one[110];\n  int i, j, k;\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> word;\n\n  for (k = 0, j = 0, i = 0;; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      one[j] = '\u0000';\n      strcpy(all[k].str, one);\n      j = 0;\n      k++;\n      if (s[i] == '\u0000')\n        break;\n      continue;\n    }\n    one[j++] = s[i];\n  }\n\n  for (i = 0; i < k; i++) {\n    if (strcmp(all[i].str, str) == 0)\n      strcpy(all[i].str, word);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (i < k - 1)\n      printf(\"%s \", all[i].str);\n    else\n      printf(\"%s\", all[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[50][20], p[20], r[20];\n  int i = 0, n = 0;\n  cin >> a[0];\n  while (cin.get() != '\\n') {\n    i++;\n    cin >> a[i];\n    n = i;\n  }\n  cin >> p;\n  cin.get();\n  cin >> r;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(a[i], p) == 0)\n      strcpy(a[i], r);\n  }\n  for (i = 0; i < n; i++)\n    cout << a[i] << \" \";\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35198", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct point {\n    char w[20];\n  } sen[40];\n  int i, j;\n  for (i = 0; i < 40; i++) {\n    for (j = 0; j < 20; j++) {\n      sen[i].w[j] = '\u0000';\n    }\n  }\n  char a[100];\n  char from[20], to[20];\n\n  cin >> a;\n\n  scanf(\"%s \", from);\n\n  cin >> to;\n  int e;\n  e = strlen(to);\n  to[e] = ' ';\n  to[e + 1] = '\u0000';\n  int b;\n  b = strlen(a);\n  int k, p, q;\n  int num = 0;\n  for (i = 0, j = 0; i <= b; i++) {\n    int m;\n    if (a[i] == ' ') {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n\n      j++;\n      num++;\n    } else if (i == b) {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n      j++;\n      num++;\n    }\n  }\n  int judge;\n  for (i = 0; i <= num; i++) {\n    judge = 1;\n    for (j = 0; from[j] != '\u0000'; j++) {\n      if (sen[i].w[j] != from[j]) {\n        judge = 0;\n        break;\n      }\n    }\n    if (judge == 1) {\n      strcpy(sen[i].w, to);\n    }\n  }\n  for (i = 0;; i++) {\n    if (sen[num - 1].w[i] == ' ') {\n      sen[num - 1].w[i] = '\u0000';\n      break;\n    }\n  }\n\n  for (i = 0; i <= num + 1; i++) {\n    printf(\"%s\", sen[i].w);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][100] = {'\\0'};\n  char a[100], b[100];\n  int i;\n\n  cin >> s[0];\n  i = 1;\n  while (cin.peek() == ' ') {\n    cin >> s[i++];\n  }\n  cin >> a >> b;\n\n  for (i = 0; s[i][0] != '\\0'; i++) {\n    if (strcmp(a, s[i]) == 0) {\n      strcpy(s[i], b);\n    }\n  }\n\n  cout << s[0];\n  for (i = 1; s[i][0] != '\\0'; i++)\n    cout << \" \" << s[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], a[100], b[100], word[100];\n  int i, j = 0, flag = 0;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  i = 0;\n  while (str[i]) {\n    if (str[i] == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      word[j] = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      word[j] = str[i];\n      j++;\n    }\n    i++;\n  }\n  word[j] = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n}\n"}
{"label": "19", "index": "35201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[20][15], b[15], c[15], d;\n  int i, j;\n  for (i = 0, d = ' '; d != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n  }\n  j = i;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i <= j - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i <= j - 2; i++) {\n    cout << a[i] << \" \";\n  }\n  printf(\"%s\", a[j - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char m[100], z[100], t[100];\n\n  cin >> m;\n\n  cin >> z;\n\n  cin >> t;\n  char fz[100][100]; \n  int len1 = strlen(m);\n  int i, k = 0, j = 0, num = 1; \n                                \n  for (i = 0; i < len1; i++) {\n    if (m[i] != 32) {\n      fz[k][j] = m[i];\n      j++;\n    } else {\n      num++;\n      k++;\n      j = 0;\n    }\n  }\n  for (k = 0; k < num; k++) {\n    if (k != num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s \", fz[k]);\n      } else {\n        printf(\"%s \", fz[k]);\n      }\n    }\n    if (k == num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s\", fz[k]);\n      } else {\n        printf(\"%s\", fz[k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][100], a[100], b[100];\n  int i = 0, k;\n\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != '\\n');\n\n  k = i;\n\n  scanf(\"%s %s\", a, b);\n\n  for (i = 0; i < k - 1; i++)\n    if (strcmp(s[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      cout << s[i] << \" \";\n  if (strcmp(s[i], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "35204", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, a, l, sum = 0;\n  char s[101];\n  char s1[101];\n  char s2[101];\n  char s0[101];\n  cin.getline(s, 101);\n  cin >> s1;\n  cin >> s2;\n  int k1 = strlen(s);\n  for (i = 0; i < strlen(s); i++) {\n    if ((s[i] == s1[0] && s[strlen(s1) + i] == ' ' && s[i - 1] == ' ') ||\n        (i == 0 && s[i] == s1[0] && s[strlen(s1) + i] == ' ') ||\n        (s[i] == s1[0] && s[i - 1] == ' ' && i + strlen(s1) == strlen(s))) {\n      for (a = 0; a < strlen(s) - i - strlen(s1); a++)\n        s0[a] = s[i + strlen(s1) + a];\n      for (j = 0; j < strlen(s2); j++)\n        s[i + j] = s2[j];\n      for (l = 0; l < strlen(s0); l++)\n        s[i + j + l] = s0[l];\n      sum++;\n      i = i + strlen(s2) - strlen(s1);\n    }\n  }\n  for (k = 0; k < k1 + sum * strlen(s2) - sum * strlen(s1); k++)\n    printf(\"%c\", s[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "35205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar former[150];\nchar zhao[10], huan[10];\nvoid alter(char *p) {\n\n  char *p2;\n  p2 = p + strlen(zhao) + 1;\n  char p3[100];\n  strcpy(p3, p2);\n  *(p + 1) = '\u0000';\n  strcat(former, huan);\n  strcat(former, p3);\n}\n\nint main()\n\n{\n\n  int i;\n\n  cin >> former;\n  scanf(\"%s%s\", zhao, huan);\n  char *p0, *p1;\n  p0 = former;\n  for (; *p0 != '\u0000'; p0++) {\n    if (*p0 == ' ' && *(p0 + 1) == zhao[0]) {\n      for (p1 = p0 + 1, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n        ;\n      if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000')\n        alter(p0);\n    }\n  }\n  p0 = former;\n  for (p1 = p0, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n    ;\n  if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000') {\n    char *p2;\n    p2 = p0 + strlen(zhao);\n    char p3[100];\n    strcpy(p3, p2);\n    strcat(huan, p3);\n    printf(\"%s\", huan);\n    return 0;\n  }\n\n  printf(\"%s \", former);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35206", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zifu[101], word[100][20] = {\" \"}, x[20], y[20];\n  int n, i, j, s, t = 0, p = 0, num;\n\n  scanf(\"%s \", zifu);\n\n  scanf(\"%s \", x);\n\n  cin >> y;\n  n = strlen(zifu);\n  for (i = 0; i < n; i++) {\n    if (zifu[i] != ' ') {\n      word[t][p] = zifu[i];\n      p++;\n    } else {\n      if (zifu[i] == ' ') {\n        p = 0;\n        t++;\n      }\n    }\n    num = t + 1;\n  }\n  for (i = 0; i < num; i++) {\n    if (!strcmp(word[i], x)) {\n      strcpy(word[i], y);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35207", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int la, lb, i, j, count = 1;\n  char a[1000], b[100], c[100];\n  cin.getline(a, 1000);\n  la = strlen(a);\n  cin.getline(b, 100);\n  lb = strlen(b);\n  cin.getline(c, 100);\n  do {\n    for (i = count - 1; i <= la - 1; i++) {\n      if (a[i] != b[0] || i >= 1 && a[i - 1] != ' ') {\n        cout << a[i];\n        count++;\n      } else\n        break;\n    }\n    if (a[i] == b[0] && (i >= 1 && a[i - 1] == ' ' || i == 0)) {\n      for (j = 0; j <= lb - 1; j++)\n        if (a[i + j] != b[j]) {\n          break;\n        }\n      count = count + j + 1;\n      if (j == lb && ((i + j) < la && a[i + j] == ' '))\n        cout << c << \" \";\n      else if (i + j == la)\n        printf(\"%s\", c);\n      else\n        for (j = i; j <= count - 2; j++)\n          cout << a[j];\n    }\n  } while (count < la);\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35208", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l1, l2, l3, i, j, lab;\n  lab = 1;\n  int x[200] = {0};\n  char a[200], b[200];\n  char s[200] = {0};\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  l1 = strlen(s);\n  l2 = strlen(a);\n  l3 = strlen(b);\n  for (i = l1; i >= 0; i--) {\n    s[i] = s[i - 1];\n  }\n  s[0] = ' ';\n  s[l1 + 1] = ' ';\n\n  for (i = 0; i <= l1; i++) {\n\n    if ((s[i] != ' ') || (s[i + l2 + 1] != ' '))\n      continue;\n    lab = 0;\n    for (j = 0; j < l2; j++) {\n      if (s[i + j + 1] != a[j]) {\n        lab = 1;\n      }\n    }\n    if (lab == 0) {\n      x[i + 1] = 1;\n    }\n  }\n  for (i = 1; i <= l1;) {\n    if (x[i] == 0) {\n      cout << s[i];\n      i++;\n    }\n\n    if (x[i] == 1) {\n      printf(\"%s\", b);\n      i = i + l2;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35209", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  printf(\"%s\", ns[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100], str1[100], str2[100], str3[200];\n  int n1, n2, i = 0, s, j, a = 0, b;\n\n  cin >> string;\n  cin >> str1;\n  cin >> str2;\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  while (i < 100) {\n    b = 0;\n    for (j = 0; j < n1; j++) {\n      if ((string[i + j] == str1[j]))\n        b += 1;\n      else\n        b = 0;\n    }\n\n    if (i == 0) {\n      if (b == n1 && string[i + n1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n\n    else {\n      if (b == n1 && string[i + n1] == ' ' && string[i - 1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n  }\n  printf(\"%s\", str3);\n  return 0;\n}\n"}
{"label": "19", "index": "35211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar s[101], a[101], b[101], temp[101];\nvoid judge(void) {\n  if (strcmp(temp, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", temp);\n  }\n}\nvoid check(void) {\n  int i, n = strlen(s), p = 0, j;\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      temp[p] = s[i];\n      p++;\n    } else {\n      temp[p + 1] = '\u0000';\n      judge();\n      printf(\" \");\n      for (j = 0; j < p + 2; j++)\n        temp[j] = 0;\n      p = 0;\n    }\n  }\n  temp[p + 1] = '\u0000';\n  judge();\n}\nint main() {\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  check();\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35212", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[102], a[101], b[101];\n  char s0[101] = {'\u0000'}, c[101] = {'\u0000'};\n  int i, j = 0, t;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s0[j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' || s[i + 1] == '\u0000') {\n      if (strcmp(s0, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      } else {\n        strcat(c, s0);\n        strcat(c, \" \");\n        j = 0;\n        for (t = 0; s0[t] != '\u0000'; t++)\n          s0[t] = '\u0000';\n      }\n    }\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    if (c[i] == ' ' && c[i + 1] == '\u0000')\n      c[i] = '\u0000';\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "35213", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[201], b[201], c[201];\n  int i, j, la, lb, k, t, ls;\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  la = strlen(a), lb = strlen(b), ls = strlen(s);\n  for (i = 0; i < 100; i = i + 1)\n    c[i] = s[i];\n  t = 0;\n  for (i = 0; i < ls; i = i + 1) {\n    if (s[i] == '\u0000')\n      break;\n    for (j = 0; j < la; j = j + 1) {\n      if (s[i + j] != a[j])\n        break;\n    }\n    if (j == la && (s[i + la] == ' ' || s[i + la] == '\u0000') &&\n        (s[i - 1] == ' ' || i == 0)) {\n\n      for (k = 0; k < lb; k = k + 1)\n        s[i + k] = b[k];\n      for (k = 0; k < 100; k = k + 1)\n        s[i + lb + k] = c[i + la + t * (la - lb) + k];\n      t = t + 1;\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35214", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1024];\n  char src[1024];\n  char tar[1024];\n  char tmp[1024];\n\n  cin >> str;\n\n  cin >> src;\n\n  cin >> tar;\n\n  int cnt = 0;\n\n  if (str[0] == ' ')\n    putchar(str[0]);\n  else\n    tmp[cnt++] = str[0];\n\n  for (int i = 1; str[i]; i++) {\n\n    if (str[i - 1] == ' ' && str[i] != ' ') {\n      tmp[cnt++] = str[i];\n\n    } else if (str[i] == ' ') {\n      if (cnt > 0) {\n        tmp[cnt] = 0;\n        if (!strcmp(tmp, src))\n          printf(\"%s\", tar);\n        else\n          printf(\"%s\", tmp);\n        cnt = 0;\n      }\n\n      putchar(' ');\n    } else\n      tmp[cnt++] = str[i];\n  }\n  if (cnt > 0) {\n    tmp[cnt] = 0;\n    if (!strcmp(tmp, src))\n      printf(\"%s\", tar);\n    else\n      printf(\"%s\", tmp);\n  }\n  putchar(' ');\n}\n"}
{"label": "19", "index": "35215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[201], ch[201], ch1[201], str1[201];\n  int s, s1, s2, i, j, g = 0, k;\n  cin.getline(str, 201);\n  cin.getline(ch, 201);\n  cin.getline(ch1, 201);\n  s = strlen(str);\n  s1 = strlen(ch);\n  s2 = strlen(ch1);\n  strcpy(str1, str);\n  for (i = 0; i < s; i++) {\n    g = 0;\n    if (str[i] == ch[0] && ((i == 0) || (str[i - 1] == ' '))) {\n      for (j = i; j < s1 + i; j++) {\n        if (str[j] == ch[j - i])\n          g++;\n      }\n      if (g == s1 && (str[s1 + i] == ' ' || str[s1 + i] == '\\0')) {\n        for (k = 0; k < i; k++) {\n          str1[k] = str[k];\n        }\n        for (k = i; k < i + s2; k++) {\n          str1[k] = ch1[k - i];\n        }\n        for (k = i + s2; k <= s + s2 - s1; k++) {\n          str1[k] = str[k + s1 - s2];\n        }\n        for (k = 0; k <= s + s2 - s1; k++)\n          str[k] = str1[k];\n        s = s + s2 - s1;\n      }\n    }\n  }\n  cout << str1 << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35216", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[300], a[300], b[300];\n  int x, y, z, i, k;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (k = 0; k <= x - 1; k++) {\n    int q = 1;\n    for (i = k; q != 9 && i <= k + y - 1; i++) {\n      if (s[i] != a[i - k])\n        q = 9;\n    }\n    if (q == 9)\n      continue;\n    else if (q == 1 && ((s[k - 1] == ' ' && k > 0) || k == 0)) {\n      if (y >= z) {\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n        for (i = k + z; i <= 299; i++)\n          s[i] = s[i + y - z];\n      } else if (y < z) {\n        for (i = 299; i >= k + z; i--)\n          s[i] = s[i + y - z];\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n      }\n    }\n    k += z - 1;\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "19", "index": "35217", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], str1[101], str2[101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  int i, len = strlen(str), n = 0;\n  char *p[101];\n  p[n] = str;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ') {\n      str[i] = 0;\n      p[++n] = &str[i + 1];\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], str1) == 0)\n      cout << str2;\n    else\n      printf(\"%s\", p[i]);\n    if (i != n)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35218", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0;\n  char zfc[101], y[101], x[101], word[101][101];\n\n  cin >> zfc;\n\n  cin >> y;\n\n  scanf(\"%s \", x);\n  for (i = 0; zfc[i] != '\u0000'; i++) {\n    if (zfc[i] != ' ') {\n      word[a][b] = zfc[i];\n      b++;\n    } else {\n      word[a][b] = '\u0000';\n      b = 0;\n      a++;\n    }\n  }\n  word[a][b] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(word[i], y) == 0) {\n      strcpy(word[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s \", word[a]);\n  return 0;\n}\n"}
{"label": "19", "index": "35219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int l1 = 0, l2 = 0, l3 = 0, i, j, l;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n  while (a[l1] != '\\0')\n    l1++;\n  while (b[l2] != '\\0')\n    l2++;\n  while (c[l3] != '\\0')\n    l3++;      \n  l = l1 - l2; \n  for (i = 0; i <= l; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + l2] == ' ' ||\n        i == 0 && a[i + l2] == ' ' ||\n        i == l && a[i - 1] == ' ') \n    {\n      int flag = 1;\n      for (j = 0; j < l2; j++)\n        if (a[j + i] != b[j])\n          flag = 0; \n      if (flag) {\n        if (l2 == l3)\n          for (j = 0; j < l2; j++)\n            a[j + i] = c[j];\n        else if (l2 < l3) {\n          for (j = l + l2 - 1; j >= i + l2; j--)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        } \n        else if (l2 > l3) {\n          for (j = i + l2; j < l + l2; j++)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        }\n        i += l3;\n        l += l3 - l2; \n      }\n    }\n  for (i = 0; i < l + l2; i++)\n    cout << a[i]; \n  return 0;\n}\n"}
{"label": "19", "index": "35220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n  int i = 0, j, t;\n\n  scanf(\"%s \", str);\n  scanf(\"%s\", a);\n  cin >> b;\n  do {\n    j = 0;\n    t = i;\n    while (str[i] == a[j] && j < strlen(a)) {\n      i++;\n      j++;\n    }\n    if (j == strlen(a)) {\n      printf(str[i] == '\u0000' ? \"%s\" : \"%s \", b);\n      i++;\n    } else {\n      do {\n        cout << str[t];\n        t++;\n      } while (str[t] != ' ' && str[t] != '\u0000');\n      if (str[t] == ' ')\n        printf(\" \");\n      i = t + 1;\n    }\n  } while (str[i - 1] != '\u0000');\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35221", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  char(*s)[100], *a, *b;\n  s = (char(*)[100])malloc(100 * 100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n  }\n  n = i;\n  strcpy(a, *(s + n - 2));\n  strcpy(b, *(s + n - 1));\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(a, *(s + i)) == 0) {\n      strcpy(*(s + i), b);\n    }\n  }\n  for (i = 0; i < n - 3; i++) {\n    printf(\"%s \", *(s + i));\n  }\n  printf(\"%s\", *(s + n - 3));\n}\n"}
{"label": "19", "index": "35222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], word1[100], word2[100];\n  int n = 0;\n  int i, j;\n\n  cin >> str1;\n  scanf(\"%s %s\", word1, word2);\n  for (i = 0; i < (int)(strlen(str1)); i++) {\n    for (j = i; j < i + (int)(strlen(word1)); j++) {\n      if (str1[j] != word1[j - i])\n        break;\n      n = n + 1;\n    }\n    if (i == 0 && n == (int)(strlen(word1))) {\n      cout << word2 << \" \";\n      i = i + (int)(strlen(word1));\n    } else if (n == (int)(strlen(word1)) &&\n               (str1[i + n] == 32 || str1[i + n] == '\u0000') && str1[i - 1] == 32) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else\n      printf(\"%c\", str1[i]);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35223", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar m[110][110];\n\nint main() {\n  char s[110], a[110], b[110];\n  int num;\n  int i, j, len;\n\n  cin >> s;\n  cin >> a >> b;\n  num = 0;\n  for (i = 0; s[i] != ' '; i++)\n    m[0][i] = s[i];\n  m[0][i] = '\u0000';\n  num++;\n  i++;\n  len = strlen(s);\n  while (s[i] != '\u0000') {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      m[num][j++] = s[i++];\n    }\n    m[num++][j] = '\u0000';\n    i++;\n    if (i >= len)\n      break;\n  }\n\n  for (i = 0; i < num; i++)\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n      len = strlen(b);\n      m[i][len] = '\u0000';\n    }\n  for (i = 0; i < num - 1; i++)\n    printf(\"%s \", m[i]);\n  cout << m[num - 1] << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35224", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char *p[100];\n  char *daitihuan;\n  char *tihuanwei;\n  p[0] = (char *)malloc(30);\n  while (scanf(\"%s\", p[i]) != EOF) {\n    p[i + 1] = (char *)malloc(30);\n    i++;\n  }\n  i--;\n  daitihuan = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = p[i];\n  daitihuan = p[i - 1];\n  for (j = 0; j < i - 1; j++)\n    if (strcmp(p[j], daitihuan) == 0)\n      strcpy(p[j], tihuanwei);\n  for (j = 0; j < i - 1; j++)\n    printf(\"%s%s\", p[j], j == i - 2 ? \"\" : \" \");\n}\n"}
{"label": "19", "index": "35225", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char text[100], s[100][20] = {'\u0000'}, a[20], b[20];\n  int i, j = 0, k = 0, len;\n\n  scanf(\"%s \", text);\n  len = strlen(text);\n  for (i = 0; i < len; i++) {\n    if (text[i] != ' ') {\n      s[j][k] = text[i];\n      k = k + 1;\n    } else {\n      j = j + 1;\n      k = 0;\n    }\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s[i], a) == 0) {\n      strcpy(s[i], b);\n    }\n    printf(\"%s\", s[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35226", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100][20];\n  char b;\n  char t[100], h[100];\n  int i, g = 0, result;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &b);\n    g++;\n    if (b == 10)\n      break;\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", h);\n\n  for (i = 0; i < g; i++) {\n    result = strcmp(t, a[i]);\n\n    if (result == 0) {\n      strcpy(a[i], h);\n    }\n  }\n  for (i = 0; i < g - 1; i++)\n    printf(\"%s \", a[i]);\n\n  i = g - 1;\n  printf(\"%s\", a[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35227", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s0[2001], s1[201], s2[201];\n  cin.getline(s0, 2000);\n  cin.getline(s1, 200);\n  cin.getline(s2, 200);\n  int L0 = 0, L1 = 0, L2 = 0;\n  while (s0[L0] != 0)\n    L0++;\n  while (s1[L1] != 0)\n    L1++;\n  while (s2[L2] != 0)\n    L2++;\n  if (L1 == 0) {\n    cout << s0;\n    return 0;\n  }\n  for (int i = 0; i <= L0 - L1; i++) {\n    int is = 0;\n    for (int j = 0; j < L1; j++)\n      if (s0[i + j] != s1[j]) {\n        is++;\n        break;\n      }\n    if (is != 0)\n      continue;\n    if ((i != 0 && s0[i - 1] != ' ') || (s0[i + L1] != ' ' && s0[i + L1] != 0))\n      continue;\n    if (L1 > L2)\n      for (int j = i + L1; j < L0; j++)\n        s0[j + L2 - L1] = s0[j];\n    else\n      for (int j = L0 - 1; j >= i + L1; j--)\n        s0[j + L2 - L1] = s0[j];\n    for (int j = i; j < i + L2; j++)\n      s0[j] = s2[j - i];\n    L0 += L2 - L1;\n    i += L2;\n  }\n  s0[L0] = 0;\n  cout << s0;\n  return 0;\n}\n"}
{"label": "19", "index": "35228", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar *Strlwr(char *);\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char inputL[110], replacedL[110];\n  char *p, *pL, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  strcpy(inputL, input);\n  strcpy(replacedL, replaced);\n\n  len = strlen(replaced);\n  pL = strstr(inputL, replacedL);\n  start = input;\n  while (pL != NULL) {\n    if ((pL == inputL || isalpha(*(pL - 1)) == 0) && isalpha(*(pL + len)) == 0)\n\n    {\n      p = input + (pL - inputL);\n      *p = '\\0';\n\n      printf(\"%s%s\", start, replace);\n\n      start = p + len;\n      pL = strstr((start - input) + inputL, replacedL);\n    } else {\n      p = input + (pL - inputL) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      pL = strstr((start - input) + inputL, replacedL);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n\nchar *Strlwr(char *p) {\n  for (; *p != '\\0'; p++) {\n    if (*p >= 'A' && *p <= 'Z')\n      *p += 32;\n  }\n\n  return p;\n}\n"}
{"label": "19", "index": "35229", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char juzi[100];\n  char danci[200][200], ci1[200], ci2[200];\n  int i = 0, j = 0, k = 0, f, index;\n\n  cin >> juzi;\n\n  cin >> ci1;\n\n  scanf(\"%s \", ci2);\n  index = 0;\n  for (i = 0;; i++) {\n    for (k = 0;;) {\n      if (juzi[index] != ' ' && juzi[index] != 0) {\n        danci[i][k] = juzi[index];\n        index++;\n        k++;\n      } else {\n        danci[i][k] = 0;\n        index++;\n        k++;\n        break;\n      }\n    }\n    if (juzi[index - 1] == 0) {\n      break;\n    }\n  }\n  for (f = 0; f < 100; f++) {\n    if (strcmp(danci[f], ci1) == 0) {\n      strcpy(danci[f], ci2);\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (j == i) {\n      cout << danci[j];\n    } else {\n      cout << danci[j] << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35230", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    flag = 1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1 && (i == 0 || a[i - 1] == ' ') &&\n        (i == lena - lenb || a[i + lenb] == ' ')) {\n      if (lenb > lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        for (k = i + lenc; k < lena; k++)\n\n          a[k] = a[k + lenb - 1];\n\n        i += lenc - 1;\n        lena -= lenb - lenc;\n      }\n      if (lenb == lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n      }\n      if (lenb < lenc) {\n        for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n          a[k] = a[k - lenc + lenb];\n        }\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        i += lenc - 1;\n        lena += lenc - lenb;\n      }\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35231", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char name[100], a[100], b[100];\n  int k = 0, j = 0, n, i, p;\n  char word[100][100];\n\n  scanf(\"%s \", name);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(name);\n  for (i = 0; i < n; i++) {\n    if (name[i] != ' ') {\n      word[k][j] = name[i];\n      j++;\n    } else {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  word[k][j] = '\u0000';\n  k++;\n\n  for (p = 0; p < k; p++) {\n    if (strcmp(word[p], a) == 0) {\n      strcpy(word[p], b);\n    }\n  }\n  for (p = 0; p < k - 1; p++) {\n    cout << word[p] << \" \";\n  }\n  printf(\"%s\", word[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35232", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, r = 1, j;\n  char a[100], b[100], c[200];\n\n  scanf(\"%s \", c);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < 100; i++) {\n    if (c[i] == 'G' && c[i + 1] == 'I' && c[i + 2] == 'S' && c[i - 1] == ' ') {\n      for (j = 100 + r * 3; j >= (i + 3); j--)\n        c[j] = c[j - 3];\n      r = r + 1;\n      c[i] = 'W';\n      c[i + 1] = 'e';\n      c[i + 2] = 'b';\n    }\n    if (c[i] == 'Y' && c[i + 1] == 'o' && c[i + 2] == 'u') {\n\n      c[i] = 'I';\n      for (j = i + 1; j < 100; j++)\n        c[j] = c[j + 2];\n    }\n    if (c[i] == 'o' && c[i + 1] == 'f' && c[i - 1] == ' ') {\n      for (j = 100 + r * 1; j >= (i + 1); j--)\n        c[j] = c[j - 1];\n      r = r + 1;\n      c[i] = 'f';\n      c[i + 1] = 'o';\n      c[i + 2] = 'r';\n    }\n  }\n  printf(\"%s\", c);\n}\n"}
{"label": "19", "index": "35233", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"}, *p, *q;\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  p = c;\n  q = d;\n  for (i = 0;;) {\n    for (j = 0; *(p + i) != ' ' && *(p + i) != '\u0000'; i++, j++)\n      *(q + j) = *(p + i);\n    *(q + j) = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", *(q + k));\n    if (*(p + i) != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35234", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    flag = 1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1 && (i == 0 || a[i - 1] == ' ') &&\n        (i == lena - lenb || a[i + lenb] == ' ')) {\n      if (lenb > lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        for (k = i + lenc; k < lena; k++) {\n          a[k] = a[k + lenb - 1];\n        }\n        i += lenc - 1;\n        lena -= lenb - lenc;\n      }\n      if (lenb == lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n      }\n      if (lenb < lenc) {\n        for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n          a[k] = a[k - lenc + lenb];\n        }\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n          a[k] = c[j];\n        }\n        i += lenc - 1;\n        lena += lenc - lenb;\n      }\n    }\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35235", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], w1[100], w2[100];\n\n  cin >> s;\n\n  cin >> w1;\n\n  cin >> w2;\n  int i, l = strlen(s), l1 = strlen(w1), l2 = strlen(w2), p = 0, m, n, j, k;\n  for (i = 0; i < l; i++) {\n    if (s[i] == w1[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + l1] == 32 || i == l - 1)) {\n      p = 1;\n      for (m = i, n = 0; n < l1; m++, n++)\n        if (s[m] != w1[n]) {\n          p = 0;\n          break;\n        }\n    }\n    if (p) {\n      for (k = 0; k < l2; k++)\n        printf(\"%c\", w2[k]);\n      i = i + l1 - 1;\n      p = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35236", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  \n  ss[n++] = s;\n  for (i = 0; s[i]; i++) {\n    if (s[i] == ' ') {\n      s[i] = 0;\n      ss[n++] = s + i + 1;\n    }\n  }\n  \n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(ss[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(ss[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35237", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  char c[100] = {0};\n  char d[100] = {0};\n  cin.getline(a, 100); \n  cin >> c;\n  cin >> d;\n  char b[100][100] = {0};\n  int i, num, k = 0, p = 0;\n  num = strlen(a);\n  a[num] = '\\n';\n  for (i = 0; i < num + 1; i++) \n  {\n\n    b[k][p] = a[i];\n    p++;\n    if (a[i] == ' ' || a[i] == '\\n') {\n      b[k][p - 1] = 0;\n      k++;\n      p = 0;\n    }\n  }\n  int num1;\n  num1 = strlen(d);\n  for (i = 0; i < k + 1; i++) {\n    if (strcmp(b[i], c) == 0) \n    {\n      for (p = 0; p < 100; p++) {\n        b[i][p] = 0;\n      }\n      for (p = 0; p < num1; p++) {\n        b[i][p] = d[p];\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) \n  {\n    cout << b[i] << \" \";\n  }\n  cout << b[k - 1];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35238", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char *p[100], *a, *b;\n  int i, j;\n  for (i = 0;; i++) {\n    p[i] = (char *)malloc(100);\n    cin >> p[i];\n    if (getchar() == ' ')\n      break;\n  }\n  a = (char *)malloc(100);\n  cin >> a;\n  b = (char *)malloc(100);\n  scanf(\"%s\", b);\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], a) == 0) {\n      p[j] = b;\n    }\n  for (j = 0; j < i; j++)\n    printf(\"%s \", p[j]);\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35239", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char s[256], a[100], b[100];\n  char c;\n  int i, j, lengths, lengtha, lengthb,\n      g = 0, k = 0, m; \n  cin.getline(s, 256);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n  a[lengtha] = ' ';\n  for (i = lengtha + 1; i > 0; i--) {\n    a[i] = a[i - 1];\n  }\n  a[0] = ' ';\n  if (s[0] == a[1]) {\n    for (i = 0; i <= lengtha; i++) {\n      a[i] = a[i + 1];\n    }\n    a[lengtha + 1] = 0;\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      } \n      if (g == 0)\n        cout << s[i];\n      if (g == 1) {\n        cout << b;\n        i = i + lengtha - 1;\n      }\n    }\n  } else\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha + 1; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      } \n      if (i + lengtha + 1 == lengths) {\n        for (m = 0; m <= lengtha - 1; m++) {\n          if (s[i + m] == a[m])\n            g = 1;\n          else\n            g = 0;\n          if (g == 0)\n            break;\n        }\n        if (g == 1) {\n          cout << ' ' << b;\n          break;\n        } else\n          cout << s[i];\n      } else {\n        if (g == 0)\n          cout << s[i];\n        if (g == 1) {\n          cout << ' ' << b;\n          i = i + lengtha;\n        }\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "35240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[40][101] = {'\\0'};\n  char c[101] = {'\\0'};\n  cin.getline(c, 101);\n  int i = 0, j = 0, k = 0;\n  while (c[i] != '\\0') {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    }\n    if (c[i] == ' ') {\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  char st1[100], st2[100];\n  cin >> st1;\n  cin >> st2;\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(str[i], st1) == 0)\n      strcpy(str[i], st2);\n  for (i = 0; i < j; i++)\n    cout << str[i] << \" \";\n  cout << str[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35241", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  while (ch != ' ') {\n    scanf(\"%s\", s[i++]);\n    ch = getchar();\n  }\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  p = &s[0];\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35242", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nconst char flag = -128, noo = -126;\nint main() {\n  int i, l1, l2, l;\n  char s1[101], s2[101], s[1001], *p;\n\n  cin >> s;\n  cin >> s1;\n  cin >> s2;\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l = strlen(s);\n  while ((p = strstr(s, s1)) != NULL) {\n\n    if (p != s && *(p - 1) != ' ') {\n      *p = noo;\n      continue;\n    }\n    *p = flag;\n    for (p++; *(p + l1 - 1) != 0; p++)\n      *p = *(p + l1 - 1);\n    *p = 0;\n    l -= l1 - 1;\n  }\n\n  for (i = 0; i < l; i++)\n    if (s[i] == flag)\n      printf(\"%s\", s2);\n    else if (s[i] == noo) {\n      printf(\"%c\", s1[0]);\n    } else\n      printf(\"%c\", s[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], d[100][100];\n  int i, j, w, m, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  w = strlen(s);\n  for (i = 0, j = 0; i < w + 1; j++, i++) {\n    if (s[i] != ' ' && s[i] != 0) {\n      d[k][j] = s[i];\n    } else {\n      d[k][j] = 0;\n      k += 1;\n      j = -1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(d[i], a) == 0)\n      strcpy(d[i], b);\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", d[i]);\n  }\n  printf(\"%s\", d[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[30][20] = {\"\"}, b[20] = {\"\"}, c[20] = {\"\"};\n  int i, num = 1;\n  scanf(\"%s\", a[0]);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", a[i]);\n  }\n}\n"}
{"label": "19", "index": "35245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100][20];\n  char b;\n  char t[100], h[100];\n  int i, g = 0, result;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c \", &b);\n    g++;\n    if (b == 10)\n      break;\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", h);\n\n  for (i = 0; i < g; i++) {\n    result = strcmp(t, a[i]);\n\n    if (result == 0) {\n      strcpy(a[i], h);\n    }\n  }\n  for (i = 0; i < g - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  i = g - 1;\n  cout << a[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100];\n  int i, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000')\n      t[j++] = s[i++];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      printf(\"%s\", b);\n\n    } else {\n      printf(\"%s\", t);\n    }\n    if (i == strlen(s)) {\n      printf(\"\u0000\");\n    } else\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, w;\n  char a[100] = {0}, b[100] = {0}, c[100] = {0}, d[100][100] = {'\u0000'};\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  char *pc, *pa, *pb, (*pd)[100];\n  pa = &a[0];\n  pb = &b[0];\n  pc = &c[0];\n  pd = d;\n  int k = 0, ll = strlen(c);\n  for (i = 0;; i++) {\n    for (j = 0; *(pa + k) != ' '; j++) {\n      if (*(pa + k) == '\u0000') {\n        (*(*(pd + i) + j)) = (*(pa + k));\n        break;\n      }\n      (*(*(pd + i) + j)) = (*(pa + k));\n      k++;\n    }\n    (*(*(pd + i) + j)) = '\u0000';\n    if ((*(pa + k)) == '\u0000')\n      break;\n    k++;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int l = strlen(d[i]);\n    for (j = 0; j < l + 1; j++) {\n      if ((*(*(pd + i) + j)) == (*(pb + j))) {\n        w = 1;\n        continue;\n      } else {\n        w = 0;\n        break;\n      }\n    }\n    if (w) {\n      for (k = 0; k < ll; k++)\n        (*(*(pd + i) + k)) = (*(pc + k));\n\n      (*(*(pd + i) + k)) = '\u0000';\n    } else\n      continue;\n  }\n  for (i = 0; i < count; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%s\", d[i]);\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35248", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sentence[101];\n  char word[20];\n  char subWord[20];\n  cin.getline(sentence, 100);\n  cin.getline(word, 20);\n  cin.getline(subWord, 20);\n  int i, lenOfSen = 0, lenOfWord = 0, lenOfsubWord = 0;\n  int left[100], right[100];\n  int found = 0;\n  for (i = 0; i < 100; i++) {\n    if (sentence[i] != '\\0') {\n      lenOfSen++;\n    }\n    if (sentence[i] == '\\0')\n      break;\n  }\n  for (i = 0; i < 20; i++) {\n    if (word[i] != '\\0') {\n      lenOfWord++;\n    }\n    if (word[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (subWord[i] != '\\0') {\n      lenOfsubWord++;\n    }\n    if (subWord[i] == '\\0') {\n      break;\n    }\n  }\n\n  for (i = 0; i < lenOfSen; i++) {\n    if (sentence[i] == word[0]) {\n      if (i == 0 || sentence[i - 1] == ' ') {\n\n        left[found] = i;\n        int j;\n        for (j = 1; j < lenOfWord; j++) {\n          if (sentence[i + j] != word[j]) {\n            break;\n          }\n        }\n        if (j == lenOfWord) {\n          if (i + j == lenOfSen || sentence[i + j] == ' ') {\n\n            right[found] = i + j;\n            found++;\n          }\n        }\n      }\n    }\n  }\n\n  char newString[200];\n  int k = 0;\n  if (found == 0) {\n    cout << sentence << endl;\n  } else {\n    int t = 0;\n    for (i = 0; i < lenOfSen; i++) {\n      if (i == left[t]) {\n        for (int j = 0; j < lenOfsubWord; j++) {\n          newString[k++] = subWord[j];\n        }\n        i = right[t];\n        if (t < found)\n          t++;\n      }\n      newString[k++] = sentence[i];\n    }\n    newString[k] = '\\0';\n    cout << newString << endl;\n  }\n}\n"}
{"label": "19", "index": "35249", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char juzi[100];\n  char danci[200][200], ci1[200], ci2[200];\n  int i = 0, j = 0, k = 0, f, index;\n\n  cin >> juzi;\n\n  cin >> ci1;\n\n  cin >> ci2;\n  index = 0;\n  for (i = 0;; i++) {\n    for (k = 0;;) {\n      if (juzi[index] != ' ' && juzi[index] != 0) {\n        danci[i][k] = juzi[index];\n        index++;\n        k++;\n      } else {\n        danci[i][k] = 0;\n        index++;\n        k++;\n        break;\n      }\n    }\n    if (juzi[index - 1] == 0) {\n      break;\n    }\n  }\n  for (f = 0; f < 100; f++) {\n    if (strcmp(danci[f], ci1) == 0) {\n      strcpy(danci[f], ci2);\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (j == i) {\n      printf(\"%s\", danci[j]);\n    } else {\n      printf(\"%s \", danci[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35250", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[999];\n  char a[100];\n  char b[100];\n  int i = 0, j = 0, k;\n  int add;\n  char word[200][100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; s[k] != '\u0000'; k++) {\n    if (s[k] == ' ') {\n      i++;\n      j = 0;\n    } else {\n      word[i][j] = s[k];\n      j++;\n    }\n  }\n  add = i;\n  for (i = 0; i < add + 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < add; i++)\n    printf(\"%s \", word[i]);\n  puts(word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35251", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++)\n    c[i] = s[i] = a[i] = '\u0000';\n  scanf(\"%s \", c);\n  scanf(\"%s \", a);\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int m;\n    char ch[101];\n    for (m = 0; m <= 100; m++)\n      ch[m] = '\u0000';\n    for (m = 0; m <= (n[i] - n[i - 1] - 2); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n    if (strcmp(a, ch) == 0)\n      strcat(s, b);\n    else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35252", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a1, s1, p, d1, e1, b1;\n  char s[100], a[100], b[100], c[100], d[100], e[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  a1 = strlen(a);\n  s1 = strlen(s);\n  b1 = strlen(b);\n  for (i = 0; i < s1; i++) {\n\n    for (p = 0; p < a1; p++)\n      c[p] = s[i + p];\n    c[a1] = 0;\n\n    if (strcmp(c, a) == 0) {\n      if ((i == 0 && s[a1] == 32) || (s[i - 1] == 32 && s[a1 + i] == 32)) {\n        for (d1 = 0; d1 < (s1 - i - a1); d1++)\n          d[d1] = s[d1 + a1 + i];\n        d[s1 - i - a1] = 0;\n        for (e1 = 0; e1 < i; e1++)\n          e[e1] = s[e1];\n        e[i] = 0;\n        strcat(e, b);\n        strcat(e, d);\n        strcpy(s, e);\n        s1 = strlen(s);\n        i = i + b1 - a1;\n      }\n    }\n  }\n  cout << s;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], str[200][20], rep[20], sub[20];\n  int i, sum = 0, a = 0, b = 0, max = 0, min = 0;\n\n  cin >> s;\n\n  cin >> sub;\n\n  cin >> rep;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      str[a][b] = '\u0000';\n      a++;\n      b = 0;\n      sum++;\n    } else {\n      str[a][b] = s[i];\n      b++;\n    }\n  }\n\n  str[a][b] = '\u0000';\n  for (a = 0; a <= sum; a++) {\n    if (strcmp(str[a], sub) == 0) {\n      strcpy(str[a], rep);\n    } else {\n      continue;\n    }\n  }\n  for (a = 0; a < sum; a++) {\n    printf(\"%s \", str[a]);\n  }\n  printf(\"%s\", str[sum]);\n  return 0;\n}\n"}
{"label": "19", "index": "35254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str1[150], str2[50], str3[50];\nchar *p1 = str1, *p2 = str2, *p3 = str3;\n\nint compare(char *local, int len) {\n  p2 = str2;\n  char *p;\n  int flag = 1;\n  for (p = local; *p2 != '\u0000' && flag == 1 && p < local + len; p2++, p++)\n    if (*p != *p2)\n      flag = 0;\n  if (*p2 == '\u0000' && p == local + len)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  char newline[150];\n  char *news = newline, *local, *p;\n  int flag = 1, len = 0;\n\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  for (p1 = str1; p1 <= str1 + strlen(str1); p1++) {\n    if (isalpha(*p1))\n      if (flag == 1)\n        flag = 0, len = 1, local = p1;\n      else\n        len++;\n    else if (flag == 0) {\n      flag = 1;\n      if (compare(local, len))\n        for (p3 = str3; *p3 != '\u0000'; p3++, news++)\n          *news = *p3;\n      else\n        for (p = local; p < local + len; p++, news++)\n          *news = *p;\n      *news++ = *p1;\n    }\n  }\n  *news = '\u0000';\n  for (news = newline; *news != '\u0000'; news++)\n    cout << *news;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100];\n  int i = 0, j;\n  *(p + i) = (char *)malloc(100);\n  while (scanf(\"%s\", *(p + i)) != EOF) {\n    i++;\n    *(p + i) = (char *)malloc(100);\n  }\n  for (j = 0; j < i - 2; j++) {\n    if (strcmp(*(p + j), *(p + i - 2)) == 0)\n      strcpy(*(p + j), *(p + i - 1));\n  }\n  printf(\"%s\", *p);\n  for (j = 1; j < i - 2; j++)\n    printf(\" %s\", *(p + j));\n  return 0;\n}\n"}
{"label": "19", "index": "35256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[20][15], b[15], c[15], d;\n  int i, j;\n  for (i = 0, d = ' '; d != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    cin >> d;\n  }\n  j = i;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i <= j - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i <= j - 2; i++) {\n    cout << a[i] << \" \";\n  }\n  cout << a[j - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35257", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][100], b[25], c[25], d;\n  int m, n, p[25], q, i, j;\n\n  i = 0;\n  do {\n    cin >> a[i];\n    i++;\n  } while (getchar() != '\\n');\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (j = 0; j < i; j++) {\n    p[j] = 1;\n    if (strcmp(a[j], b) == 0) {\n      p[j] = 0;\n    }\n  }\n  for (j = 0; j < i; j++) {\n    if (j != 0) {\n      printf(\" \");\n    }\n    if (p[j] != 0)\n      printf(\"%s\", a[j]);\n    else\n      printf(\"%s\", c);\n  }\n}\n"}
{"label": "19", "index": "35258", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct point {\n    char w[20];\n  } sen[40];\n  int i, j;\n  for (i = 0; i < 40; i++) {\n    for (j = 0; j < 20; j++)\n      sen[i].w[j] = '\u0000';\n  }\n  char a[100];\n  char from[20], to[20];\n\n  cin >> a;\n\n  cin >> from;\n\n  cin >> to;\n  int e;\n  e = strlen(to);\n  to[e] = ' ';\n  to[e + 1] = '\u0000';\n  int b;\n  b = strlen(a);\n  int k, p, q;\n  int num = 0;\n  for (i = 0, j = 0; i <= b; i++) {\n    int m;\n    if (a[i] == ' ') {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n\n      j++;\n      num++;\n    } else if (i == b) {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n      j++;\n      num++;\n    }\n  }\n  int judge;\n  for (i = 0; i <= num; i++) {\n    judge = 1;\n    for (j = 0; from[j] != '\u0000'; j++) {\n      if (sen[i].w[j] != from[j]) {\n        judge = 0;\n        break;\n      }\n    }\n    if (judge == 1) {\n      strcpy(sen[i].w, to);\n    }\n  }\n  for (i = 0;; i++) {\n    if (sen[num - 1].w[i] == ' ') {\n      sen[num - 1].w[i] = '\u0000';\n      break;\n    }\n  }\n\n  for (i = 0; i <= num + 1; i++) {\n    printf(\"%s\", sen[i].w);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], sz[51][101], a[101], b[101];\n  int i, j, k, n;\n  int max = 0, min = 0;\n\n  cin >> s;\n  n = strlen(s);\n  for (i = 0, k = 0; i < n; i++) {\n    for (j = 0; s[i] != ' ' && i < n; i++, j++) {\n      sz[k][j] = s[i];\n    }\n    sz[k][j] = '\u0000';\n    k++;\n  }\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(sz[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", sz[i]);\n    }\n    printf(\" \");\n  }\n  if (strcmp(sz[k - 1], a) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", sz[k - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], t[101], w[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, r, k, n;\n  for (n = 1; n < 5; n++) {\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (s[i] != 0) {\n        if (s[i] != ' ')\n          t[i - r] = s[i];\n        else {\n          t[i - r] = 0;\n          r = r + strlen(t) + 1;\n          if (strcmp(t, a) == 0) {\n            k = strlen(t);\n            for (j = i; j < 101; j++)\n              w[j - i] = s[j];\n            s[i - k] = 0;\n            strcat(s, b);\n            strcat(s, w);\n          }\n        }\n      } else {\n        t[i - r] = 0;\n        if (strcmp(t, a) == 0) {\n          k = strlen(t);\n          s[i - k] = 0;\n          strcat(s, b);\n          break;\n        }\n      }\n    }\n  }\n  cout << s << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35261", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char buf[1000];\n  char key[100];\n  char temp[100];\n  char rep[100];\n  int i, j, n, w;\n  cin.getline(buf, 1000, '\\n');\n  scanf(\"%s %s \", key, rep);\n  i = 0;\n  w = 0;\n  while (1) {\n    for (j = 0; buf[i] != ' ' && buf[i] != 0; j++, i++)\n      temp[j] = buf[i];\n    temp[j] = 0;\n    n = strcmp(temp, key);\n    if (w != 0)\n      cout << ' ';\n    if (n == 0) {\n\n      printf(\"%s\", rep);\n    } else\n      cout << temp;\n    w++;\n    if (buf[i] == 0)\n      break;\n    i++;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35262", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], r[101] = \"\";\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char temp[101];\n  int templen = 0;\n  for (int i = 0; s[i]; i++) {\n    if (s[i] != ' ') {\n      temp[templen] = s[i];\n      templen++;\n    } else {\n      temp[templen] = '\\0';\n      if (!strcmp(temp, a))\n        strcat(r, b);\n      else\n        strcat(r, temp);\n      strcat(r, \" \");\n      templen = 0;\n    }\n  }\n  temp[templen] = '\\0';\n  if (!strcmp(temp, a))\n    strcat(r, b);\n  else\n    strcat(r, temp);\n  printf(\"%s\\n\", r);\n  return 0;\n}\n"}
{"label": "19", "index": "35263", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  char *p1, *p2, *p3, *q1, *q, *q2;\n  int S, A, i, j;\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  S = strlen(s);\n  A = strlen(a);\n  q = p1 = s;\n  q2 = p2 = a;\n  p3 = b;\n  for (i = 0; i < S; i++, p1++)\n    if (*p1 == *p2 && (*(p1 - 1) == ' ' || p1 == s)) {\n      q1 = p1;\n      for (j = 0; j < A; j++, p2++, p1++)\n        if (*p1 != *p2)\n          break;\n        else if (j == A - 1 && (*(p1 + 1) == ' ' || *(p1 + 1) == '\u0000')) {\n          for (; q < q1; q++)\n            printf(\"%c\", *q);\n          printf(\"%s\", p3);\n          q = p1 + 1;\n        }\n      p2 = q2;\n    } else if (i == S - 1)\n      printf(\"%s\", q);\n  return 0;\n}\n"}
{"label": "19", "index": "35264", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, n;\n  char *s[100];\n  s[0] = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n    s[i] = (char *)malloc(100 * sizeof(char));\n  }\n  n = i;\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(*(s + i), *(s + n - 2)) == 0)\n      strcpy(*(s + i), *(s + n - 1));\n    if (i != n - 3)\n      printf(\"%s \", *(s + i));\n    else\n      printf(\"%s\", *(s + i));\n  }\n}\n"}
{"label": "19", "index": "35265", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char *p[100];\n  char *daitihuan;\n  char *tihuanwei;\n  p[0] = (char *)malloc(30);\n  while (scanf(\"%s\", p[i]) != EOF) {\n    p[i + 1] = (char *)malloc(30);\n    i++;\n  }\n  i--;\n  daitihuan = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = p[i];\n  daitihuan = p[i - 1];\n  for (j = 0; j < i - 1; j++)\n    if (strcmp(p[j], daitihuan) == 0)\n      strcpy(p[j], tihuanwei);\n  for (j = 0; j < i - 1; j++)\n    cout << p[j] << (j == i - 2 ? \"\" : \" \");\n}\n"}
{"label": "19", "index": "35266", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar z[10000];\nchar a[10000];\nchar b[10000];\nchar temp[10000];\n\nint main() {\n  int i, j;\n\n  cin >> z;\n  scanf(\"%s %s\", a, b);\n\n  int length = strlen(z);\n  for (i = 0; i < length; i++) {\n    while (z[i] == ' ') {\n      cout << ' ';\n      i++;\n    }\n    int k = 0;\n    for (j = i; j < length; j++) {\n      if (z[j] != ' ') {\n        temp[k++] = z[j];\n      } else\n        break;\n    }\n    temp[k] = '\u0000';\n    if (strcmp(temp, a) == 0) {\n      cout << b;\n    } else {\n      cout << temp;\n    }\n    i = j;\n    i--;\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35267", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  char(*s)[100], *a, *b;\n  s = (char(*)[100])malloc(100 * 100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n  }\n  n = i;\n  strcpy(a, *(s + n - 2));\n  strcpy(b, *(s + n - 1));\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(a, *(s + i)) == 0) {\n      strcpy(*(s + i), b);\n    }\n  }\n  for (i = 0; i < n - 3; i++)\n    printf(\"%s \", *(s + i));\n\n  printf(\"%s\", *(s + n - 3));\n}\n"}
{"label": "19", "index": "35268", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], a[10], b[10], word[50][15];\n  int i = 0, n, j = 0, k = 0;\n  cin.getline(str, 100);\n  cin.getline(a, 10);\n  cin.getline(b, 10);\n  n = strlen(str);\n  while (i < n) {\n    while (str[i] != ' ')\n      word[j][k++] = str[i++];\n    word[j][k] = '\\0';\n    k = 0;\n    j++;\n    i++;\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (strcmp(a, word[i]) == 0)\n      cout << b << \" \";\n    else {\n      cout << word[i] << \" \";\n    }\n  }\n\n  if (strcmp(a, word[i]) == 0)\n    printf(\"%s\\n\", b);\n  else\n    cout << word[i] << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar w[100];\nchar m[200][200];\nchar a[200], b[200];\nint main() {\n\n  cin >> w;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int p = 0, q = 0, r;\n  for (r = 0; w[r] != '\u0000'; r++) {\n    if (w[r] == ' ') {\n      p++;\n      q = 0;\n    } else {\n      m[p][q] = w[r];\n      q++;\n    }\n  }\n  int i, x;\n  for (i = 0; i < p + 1; i++) {\n    if (strcmp(m[i], a) == 0) {\n      for (x = 0; x < (strlen(b) + 1); x++) {\n        m[i][x] = b[x];\n      }\n    }\n  }\n  printf(\"%s\", m[0]);\n  for (i = 1; i < p + 1; i++) {\n    cout << \" \" << m[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char name[100], a[100], b[100];\n  int k = 0, j = 0, n, i, p;\n  char word[100][100];\n\n  cin >> name;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(name);\n  for (i = 0; i < n; i++) {\n    if (name[i] != ' ') {\n      word[k][j] = name[i];\n      j++;\n    } else {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  word[k][j] = '\u0000';\n  k++;\n\n  for (p = 0; p < k; p++) {\n    if (strcmp(word[p], a) == 0) {\n      strcpy(word[p], b);\n    }\n  }\n  for (p = 0; p < k - 1; p++) {\n    cout << word[p] << \" \";\n  }\n  printf(\"%s\", word[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35271", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101][101] = {0}, b[101], c[101];\n  int i, j;\n  for (j = 0;; j++) {\n    cin >> a[j];\n\n    if (getchar() == ' ')\n      break;\n  }\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  for (i = 0; i < 101; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", a[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35272", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  cin >> b;\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) { \n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    } \n    if (((num == lb) && (a[i - k - 1] == ' ')) ||\n        ((num == lb) && (i == k))) { \n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      } \n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    } \n    d[j] = '\\0';\n  }\n  cout << d << endl; \n  return 0;          \n}\n"}
{"label": "19", "index": "35273", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  p = s;\n  while (ch != ' ') {\n    scanf(\"%s\", p + i++);\n    ch = getchar();\n  }\n\n  cin >> a;\n\n  cin >> b;\n\n  p = s;\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35274", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[20][100] = {0}, a[100] = {0}, b[100] = {0}, c;\n  int i = 0, j = 0, n1 = 0, n2 = 0, m = 0;\n  for (i = 0; i < 20; i++) {\n    cin >> s[i];\n    c = getchar();\n    if (c == '\\n') {\n      m = i;\n      break;\n    }\n  }\n  cin >> a;\n  scanf(\"%s \", b);\n  n1 = strlen(a);\n  for (i = 0; i <= m; i++) {\n    n2 = 0;\n    for (j = 0; j < n1; j++) {\n      if (s[i][j] == a[j])\n        n2 = n2 + 1;\n      else\n        n2 = n2;\n    }\n    if (n1 != n2) {\n      continue;\n    }\n    for (j = 0; j < 100; j++)\n      s[i][j] = b[j];\n  }\n  cout << s[0];\n  for (i = 1; i <= m; i++) {\n    cout << \" \" << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35275", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, flag;\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  flag = 0;\n  do {\n    for (i = flag; i < strlen(s); i++) {\n      if (s[i + 1] == ' ' || s[i + 1] == '\u0000') {\n        if (i - flag + 1 != strlen(a)) {\n          for (j = flag; j <= i; j++) {\n            printf(\"%c\", s[j]);\n          }\n        } else {\n          for (j = flag; j <= i; j++) {\n            if (a[j - flag] != s[j]) {\n              break;\n            }\n          }\n          if (j == i + 1) {\n            printf(\"%s\", b);\n          } else {\n            for (j = flag; j <= i; j++) {\n              printf(\"%c\", s[j]);\n            }\n          }\n        }\n        flag = i + 2;\n        if (s[i + 1] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        break;\n      }\n    }\n  } while (i < strlen(s));\n  return 0;\n}\n"}
{"label": "19", "index": "35276", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][20], d[100], b[20], c[20];\n  int n, j = 0, k = 0, flag = 0, x;\n\n  cin >> d;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  x = strlen(c);\n  for (; x < 20; x++)\n    c[x] = '\u0000';\n  n = strlen(d);\n  for (int i = 0; i < n; i++) {\n    if (d[i] != ' ')\n      a[j][k++] = d[i];\n    else {\n      for (; k < 20;)\n        a[j][k++] = '\u0000';\n      flag = flag + 1;\n      j++;\n      k = 0;\n    }\n  }\n  for (int m = 0; m < 20; m++)\n    if (a[flag][m] == d[n - 1])\n      k = m + 1;\n  for (; k < 20;)\n    a[flag][k++] = '\u0000';\n  for (int p = 0; p < 20; p++)\n    if (strcmp(a[p], b) == 0)\n      strncpy(a[p], c, 20);\n  printf(\"%s\", a[0]);\n  for (int l = 1; l < flag + 1; l++)\n    printf(\" %s\", a[l]);\n  return 0;\n}\n"}
{"label": "19", "index": "35277", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], x[100];\n  int len, n = 0, at = 1, i, j, t = 0, m = 0;\n\n  scanf(\"%s \", s), scanf(\"%s \", a), cin >> b;\n  strcat(s, \" \");\n  len = strlen(s);\n  for (i = 0; i < len + 1; i++) {\n    if (s[i] == ' ') {\n      at = 0;\n    }\n    if (at == 0) {\n      at = 1;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = t;; j++) {\n      if (s[j] != ' ') {\n        x[j - t] = s[j];\n      } else {\n        x[j - t] = '\u0000';\n        t = j + 1;\n        m++;\n        break;\n      }\n    }\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    if (m != n)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100], d[200];\n  int i, j, na = 0, nb = 0, nc = 0, m = 0, l = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  for (i = 0; a[i] != '\u0000'; i++) {\n    na++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; i <= na + x * (nc - nb) - 1; i++) {\n    if (a[i] == b[0]) {\n      l = 1;\n      for (j = 1; j <= nb - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          l = l + 1;\n      }\n      if (((l == nb) && (a[i - 1] == ' ') && (a[i + nb] == ' ')) ||\n          ((i == 0) && (l == nb) && (a[i + nb] == ' ')) ||\n          ((l == nb) && (i >= na + x * (nc - nb) - nb - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + nb; m <= na + 2; m++) {\n          d[m - i - nb] = a[m];\n        }\n        for (m = i; m <= i + nc - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + nc; m <= na + nc - nb + 2; m++)\n          a[m] = d[m - i - nc];\n\n        i = i + nc - nb;\n        x = x + 1;\n      }\n    }\n  }\n  a[na + x * (nc - nb)] = '\u0000';\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "35279", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[105], a[105], b[105], ch[105][105];\n  int i, j = 0, k = 0, word, lens, lenb = 0;\n  cin.getline(s, 105, '\\n');\n  cin.getline(a, 105, '\\n');\n  cin.getline(b, 105, '\\n');\n  for (i = 0; i < 105; i++) {\n    if (b[i] != '\\0')\n      lenb += 1;\n    else\n      break;\n  }\n  for (i = 0; i < 105; i++) {\n    if (s[i] == ' ') {\n      ch[j][k] = '\\0';\n      k = 0;\n      j += 1;\n    } else if (s[i] == '\\0') {\n      ch[j][k] = s[i];\n      lens = i - 1;\n      word = j;\n      break;\n    } else {\n      ch[j][k] = s[i];\n      k += 1;\n    }\n  }\n  for (i = 0; i <= word; i++) {\n    k = 1;\n    if (strlen(ch[i]) != strlen(a))\n      k = 0;\n    else {\n      for (j = 0; j < strlen(a); j++)\n        if (ch[i][j] != a[j])\n          k = 0;\n    }\n    if (k == 1) {\n      for (j = 0; j <= lenb + 1; j++)\n        ch[i][j] = b[j];\n    }\n  }\n  for (i = 0; i < word; i++) {\n    cout << ch[i] << \" \";\n  }\n  for (j = 0; j < 105; j++) {\n    printf(\"%c\", ch[word][j]);\n    if (ch[word][j + 1] == '\\0')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35280", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0;\n  char m = 0;\n  char a[100];\n  char b[100][100];\n  char c[100];\n  char d[100];\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", &c);\n  scanf(\"%s\", &d);\n  n = strlen(a);\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ') {\n      j++;\n      m = 0;\n    } else {\n      b[j][m] = a[i];\n      m++;\n    }\n  }\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(b[i], c) == 0)\n      strcpy(b[i], d);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", b[i]);\n  cout << b[i];\n}\n"}
{"label": "19", "index": "35281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++) {\n    c[i] = '\u0000';\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n  }\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int l, m;\n    char ch[101];\n    for (m = 0; m <= 100; m++) {\n      ch[m] = '\u0000';\n    }\n    l = n[i] - n[i - 1] - 1;\n    for (m = 0; m <= (l - 1); m++) {\n      ch[m] = c[n[i - 1] + m + 1];\n    }\n    if (strcmp(a, ch) == 0) {\n      strcat(s, b);\n    } else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35282", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, count = -1, pos[51], k = 0;\n  char a[51][101], b[101], c[101], d;\n  while (1) {\n    cin >> a[i];\n    i++;\n    if (d = cin.get(), d == '\\n')\n      break;\n  }\n  i--;\n  cin >> b >> c;\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      count++;\n      pos[count] = j;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if ((k <= count) && (pos[k] == j)) {\n      if (j == i)\n        cout << c;\n      else\n        cout << c << \" \";\n      k++;\n    } else {\n      if (j == i)\n        cout << a[j];\n      else\n        cout << a[j] << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, p[20] = {0}, q, h[10] = {0};\n  char str[200], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  m = strlen(str1);\n  q = strlen(str2);\n  n = strlen(str);\n  k = 0;\n  l = 0;\n  for (i = 0; i < n; i++) {\n    if (str[i] == str1[l]) {\n      l++;\n      if ((i + 1) < (n - 1)) {\n        if (l == m && str[i + 1] == ' ') {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      } else {\n        if (l == m) {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      }\n    } else {\n      l = 0;\n    }\n  }\n  j = 0;\n  i = 0;\n  do {\n    if (h[j] > 0) {\n      if (i == h[j] && k > 0 && str[h[j] - 1] == ' ') {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n    if (h[j] == 0) {\n      if (i == h[j] && k > 0) {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "19", "index": "35284", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, p[20] = {0}, q, h[10] = {0};\n  char str[200], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  m = strlen(str1);\n  q = strlen(str2);\n  n = strlen(str);\n  k = 0;\n  l = 0;\n  for (i = 0; i < n; i++) {\n    if (str[i] == str1[l]) {\n      l++;\n      if ((i + 1) < (n - 1)) {\n        if (l == m && str[i + 1] == ' ') {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      } else {\n        if (l == m) {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      }\n    } else\n      l = 0;\n  }\n  j = 0;\n  i = 0;\n  do {\n    if (h[j] > 0) {\n      if (i == h[j] && k > 0 && str[h[j] - 1] == ' ') {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          cout << str[i];\n          i++;\n        }\n      }\n    }\n    if (h[j] == 0) {\n      if (i == h[j] && k > 0) {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "19", "index": "35285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, c = 0, d = 0, e = 0, f, k, l, len1, len2;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == a[0] && (s[i - 1] == ' ' || i == 0)) {\n      d = 0;\n      for (j = 1; j < len2; j++) {\n        if (s[j + i] == a[j])\n          d += 1;\n      }\n\n      if (d == len2 - 1) {\n        e += 1;\n        s[i] = '\u0000';\n        f = 0;\n        for (k = 0; k < i; k++) {\n          if (s[k] == '\u0000')\n            f += 1;\n          if (f == e - 1) {\n            if (k == 0) {\n              for (l = k; l < i; l++)\n                cout << s[l];\n              break;\n            } else {\n              for (l = k + len2; l < i; l++)\n                printf(\"%c\", s[l]);\n              break;\n            }\n          }\n        }\n        printf(\"%s\", b);\n      }\n    }\n  }\n  if (e != 0) {\n    for (i = 0; i < len1; i++) {\n      if (s[i] == '\u0000')\n        c += 1;\n      if (c == e) {\n        for (j = i + len2; j < len1; j++)\n          printf(\"%c\", s[j]);\n        break;\n      }\n    }\n  } else\n    puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35286", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[200], a[101], b[101];\n  char *ptemp, *pstr, *pa, *pb;\n  int flag, lstr, la, lb;\n  pstr = str;\n  pa = a;\n  pb = b;\n  cin >> pstr;\n  cin >> pa;\n  cin >> pb;\n  lstr = strlen(pstr);\n  la = strlen(pa);\n  lb = strlen(pb);\n  for (; pstr <= str + lstr - 1; pstr++) {\n    flag = 1;\n    while ((*pstr != ' ') && (*pstr != '\u0000')) {\n      if (*pstr != *pa)\n        flag = 0;\n      pstr++;\n      pa++;\n    }\n    if ((flag) && (pa == a + la)) {\n      ptemp = pstr;\n      if (la < lb) {\n        for (pstr = str + lstr; pstr >= ptemp; pstr--)\n          *(pstr + lb - la) = *pstr;\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr + lb - la;\n      }\n      if (la >= lb) {\n        for (pstr = ptemp - la + lb; pstr <= str + lstr - la + lb; pstr++)\n          *pstr = *(pstr + la - lb);\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr - la + lb;\n      }\n    }\n    pa = a;\n  }\n  pstr = str;\n  printf(\"%s\", pstr);\n  return 0;\n}\n"}
{"label": "19", "index": "35287", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100 + 1], a[100 + 1], b[100 + 1];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ss[n++] = s;\n  ss[0] = s;\n  n = 1;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      ss[n] = &s[i + 1];\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0) {\n      printf(\" \");\n    }\n    if (strcmp(ss[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(ss[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35288", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], str1[101], str2[101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  int i, len = strlen(str), n = 0;\n  char *p[101];\n  p[n] = str;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ') {\n      str[i] = 0;\n      p[++n] = &str[i + 1];\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], str1) == 0) {\n      printf(\"%s\", str2);\n    } else\n      printf(\"%s\", p[i]);\n    if (i != n)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35289", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], t[101], w[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int i, j, r, k, n;\n  for (n = 1; n < 5; n++) {\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (s[i] != 0) {\n        if (s[i] != ' ')\n          t[i - r] = s[i];\n        else {\n          t[i - r] = 0;\n          r = r + strlen(t) + 1;\n          if (strcmp(t, a) == 0) {\n            k = strlen(t);\n            for (j = i; j < 101; j++)\n              w[j - i] = s[j];\n            s[i - k] = 0;\n            strcat(s, b);\n            strcat(s, w);\n          }\n        }\n      } else {\n        t[i - r] = 0;\n        if (strcmp(t, a) == 0) {\n          k = strlen(t);\n          s[i - k] = 0;\n          strcat(s, b);\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35290", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zifu[101], word[100][20] = {\" \"}, x[20], y[20];\n  int n, i, j, s, t = 0, p = 0, num;\n\n  scanf(\"%s \", zifu);\n\n  scanf(\"%s \", x);\n\n  cin >> y;\n  n = strlen(zifu);\n  for (i = 0; i < n; i++) {\n    if (zifu[i] != ' ') {\n      word[t][p] = zifu[i];\n      p++;\n    } else if (zifu[i] == ' ') {\n      p = 0;\n      t++;\n    }\n    num = t + 1;\n  }\n  for (i = 0; i < num; i++) {\n    if (!strcmp(word[i], x)) {\n      strcpy(word[i], y);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35291", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], words[100][100];\n  int i, k = 0, n = 0;\n  cin >> s;\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n - 1; i++) {\n    if (strcmp(words[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[n - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", words[n - 1]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i - 2;\n  for (i = 0; i < n; i++) {\n    if (j)\n      cout << \" \";\n    if (strcmp(x[i], x[n]) == 0)\n      printf(\"%s\", x[n + 1]);\n    else\n      printf(\"%s\", x[i]);\n    j++;\n  }\n}\n"}
{"label": "19", "index": "35293", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100], c;\n  int i, j, k, flag = 1;\n  int count = 0;\n  memset(a, 0, sizeof(a));\n  memset(s, 0, sizeof(s));\n  memset(b, 0, sizeof(b));\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n\n  for (i = 0; i <= strlen(s); i++) {\n    flag = 1;\n    if (s[i] || s[i + 1]) {\n      if (s[i - 1] == 32 || i == 0) {\n        for (j = 0; a[j] != 0; j++) {\n          if (s[i + j] == a[j])\n            continue;\n          else {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 1) {\n          i += j - 1;\n          for (k = 0; b[k] != 0; k++) {\n            cout << b[k];\n          }\n\n        } else {\n          if (s[i] == 0) {\n            cout << \" \";\n          } else\n\n            cout << s[i];\n        }\n      }\n\n      else\n        cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35294", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[200], b[200];\n  char *temp, *ps, *pa, *pb;\n  int flag, ls, la, lb;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  ps = s;\n  pa = a;\n  pb = b;\n  while (ps < s + ls) {\n    flag = 1;\n    for (pa = a; ((*ps != ' ') && (*ps != '\u0000')); ps++, pa++)\n      if (*ps != *pa)\n        flag = 0;\n    if ((flag) && (pa == a + la)) {\n      if (la >= lb) {\n        ps = ps - la;\n        while (*pb != '\u0000')\n          *ps++ = *pb++;\n        if (la > lb) {\n          while (*(ps + la - lb) != '\u0000') {\n            *ps = *(ps + la - lb);\n            ps++;\n          }\n          *ps = '\u0000';\n        }\n      } else {\n        temp = ps;\n        for (ps = s + ls; ps >= temp; ps--)\n          *(ps + lb - la) = *ps;\n        ps = ps - la + 1;\n        while (*pb != '\u0000') {\n          *ps++ = *pb++;\n        }\n      }\n      pa = a;\n      pb = b;\n      ls = strlen(s);\n    }\n    ps++;\n  }\n  ps = s;\n  printf(\"%s\", ps);\n}\n"}
{"label": "19", "index": "35295", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[11000], target[1000], replace[1000];\n  cin.getline(ch, 10000);\n  cin.getline(target, 110);\n  cin.getline(replace, 110);\n  int c = strlen(ch);\n  int t = strlen(target);\n  ch[c] = ' ';\n  for (int i = 0; i < c; i++) {\n    if (ch[i] != target[0])\n      cout << ch[i];\n    else if (i == 0 && ch[i] == target[0] && ch[t] != ' ')\n      printf(\"%c\", ch[i]);\n    else if (i > 0 && (ch[i - 1] != ' ' || ch[i + t] != ' '))\n      cout << ch[i];\n    else {\n      int count = 0;\n      for (int j = 0; j < t; j++) {\n        if (ch[i + j] == target[j])\n          count++;\n        else\n          break;\n      }\n      if (count == t) {\n        cout << replace;\n        i = i + t - 1;\n      } else {\n        printf(\"%c\", ch[i]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35296", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100], result[100];\nint number[50];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  cout << ns[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35297", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[110], a[110], b[110];\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  int n = strlen(s);\n  int na = strlen(a);\n  int i, j, ans[30], c = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ' || i == 0) {\n      int count = 0, q;\n      if (i == 0)\n        q = 0;\n      else\n        q = i + 1;\n      for (j = q; j <= q + na - 1; j++) {\n        if (s[j] != a[j - q])\n          break;\n        count++;\n      }\n      if (count == na) {\n        ans[c] = q;\n        c++;\n      }\n    }\n  }\n\n  if (c == 0)\n    printf(\"%s\", s);\n  else {\n    int p = 0;\n    for (i = 0; i <= c - 1; i++) {\n      for (j = p; j < ans[i]; j++) {\n        printf(\"%c\", s[j]);\n      }\n      printf(\"%s\", b);\n      p = ans[i] + na;\n    }\n    for (j = p; j < n; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35298", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    if (i == 0 || a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb >= lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenc - 1;\n          lena -= lenb - lenc;\n        }\n        if (lenb < lenc) {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          i += lenc - 1;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35299", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100];\n  int i, j;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000')\n      t[j++] = s[i++];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      printf(\"%s\", b);\n\n    } else {\n      printf(\"%s\", t);\n    }\n    if (i == strlen(s)) {\n      printf(\"\u0000\");\n    } else\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35300", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j, v, x, c, flag;\n  char str[100], a[10], b[10];\n  cin >> str;\n  cin >> a;\n  scanf(\"%s \", b);\n  v = strlen(str);\n  x = strlen(a);\n  c = strlen(b);\n  str[v] = ' ';\n  flag = x;\n  for (i = 0; i < x; i++) {\n    if (str[i] == a[i]) {\n      flag--;\n    }\n  }\n  if (flag == 0 && str[x] == ' ') {\n    cout << b;\n  } else\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", str[i]);\n    }\n  i = x;\n  while (i < v) {\n    flag = x;\n    for (j = i; j < i + x; j++) {\n      if (str[j] == a[j - i])\n        flag--;\n    }\n    if (flag == 0 && str[i - 1] == ' ' && str[i + x] == ' ') {\n      printf(\"%s\", b);\n      i = i + x;\n    } else {\n      printf(\"%c\", str[i]);\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[100], zsz[100][100];\n  char word_a[100], word_b[100];\n\n  cin >> zfc;\n  scanf(\"%s %s\", word_a, word_b);\n\n  int word_i = 0, word_j = 0;\n  int i, n;\n  n = strlen(zfc);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == ' ' || zfc[i] == ',') {\n\n      zsz[word_i][word_j] = '\u0000';\n      word_i++;\n      word_j = 0;\n\n    } else {\n      zsz[word_i][word_j] = zfc[i];\n      word_j++;\n\n      if (i == n - 1) {\n        zsz[word_i][word_j] = '\u0000';\n        word_i++;\n      }\n    }\n  }\n  int j, a[10], m = 0, k;\n  for (j = 0; j < i; j++) {\n    if (strcmp(zsz[j], word_a) == 0) {\n      a[m] = j;\n      m++;\n    }\n  }\n  for (k = 0; k < m; k++) {\n    strcpy(zsz[a[k]], word_b);\n  }\n  for (j = 0; j < word_i; j++) {\n    if (j != word_i - 1) {\n      cout << zsz[j] << \" \";\n    } else {\n      cout << zsz[j];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35302", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100 + 1], a[100 + 1], b[100 + 1];\n  char *ss[100];\n  int i, n = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  ss[n++] = s;\n  ss[0] = s;\n  n = 1;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      ss[n] = &s[i + 1];\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n\n    if (strcmp(ss[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(ss[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1001];\n  char a[1001];\n  char b[1001];\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  return 0;\n}\n"}
{"label": "19", "index": "35304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[100];\n  char word[100][100], a[100], b[100];\n  char *p[100];\n  char *p1, *p2;\n  int i, j, k, strl, al, bl;\n\n  cin >> string;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = a;\n  p2 = b;\n  strl = strlen(string);\n  al = strlen(a);\n  bl = strlen(b);\n  j = 0;\n  k = 0;\n  for (i = 0; i < strl; i++)\n    if (string[i] != 32) {\n      word[j][k] = string[i];\n      if (string[i + 1] != 32)\n        k++;\n      else if (string[i + 1] == 32 || string[i + 1] == '\u0000') {\n        word[j][k + 1] = '\u0000';\n        k = 0;\n        j++;\n      }\n    }\n  for (i = 0; i < j + 1; i++)\n    p[i] = word[i];\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(p1, *(p + i)) == 0)\n      p[i] = p2;\n  for (i = 0; i < j; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[j]);\n}\n"}
{"label": "19", "index": "35305", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  char *p[100], *a, *b;\n  int i, j;\n  for (i = 0;; i++) {\n    p[i] = (char *)malloc(100);\n    scanf(\"%s\", p[i]);\n    if (getchar() == ' ')\n      break;\n  }\n  a = (char *)malloc(100);\n  scanf(\"%s\", a);\n  b = (char *)malloc(100);\n  scanf(\"%s\", b);\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], a) == 0)\n      p[j] = b;\n  for (j = 0; j < i; j++)\n    printf(\"%s \", p[j]);\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35306", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], r[50][20] = {0}, t[100];\n  int i = 0, j, c = 0, l;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  while (i <= l - 1) {\n    j = 0;\n    c++;\n    while (s[i] != ' ' && i <= l - 1) {\n      r[c][j] = s[i];\n      j++;\n      i++;\n    }\n    i++;\n  }\n  for (i = 1; i <= c - 1; i++) {\n    if (strcmp(r[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", r[i]);\n    }\n  }\n  if (strcmp(r[c], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", r[c]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, z, j, k = 0, l, y, x, p = 1;\n  char *s, *a, *b, **o;\n  s = (char *)malloc(1000 * sizeof(char));\n  a = (char *)malloc(110 * sizeof(char));\n  b = (char *)malloc(110 * sizeof(char));\n  o = (char **)malloc(10 * sizeof(char *));\n  for (i = 0; i < 10; i++)\n    o[i] = (char *)malloc(110 * sizeof(char));\n\n  cin >> o[k];\n  z = strlen(o[k]);\n  scanf(\"%s %s\", a, b);\n  y = strlen(a);\n  x = strlen(b);\n  while (p == 1) {\n    p = 0;\n    for (i = 0; i < z; i++) {\n      if (o[k][i] == a[0] && (o[k][i - 1] == ' ' || i == 0)) {\n        for (l = 1; l < y; l++)\n          if (a[l] != o[k][i + l])\n            break;\n        if (l == y) {\n          p = 1;\n          for (j = 0; j < i; j++)\n            o[k + 1][j] = o[k][j];\n          for (j = i; j < i + x; j++)\n            o[k + 1][j] = b[j - i];\n          for (j = i + x; j < z - y + x; j++)\n            o[k + 1][j] = o[k][j + y - x];\n          k++;\n          z = z - y + x;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%c\", o[k][i]);\n  cout << \" \";\n}\n"}
{"label": "19", "index": "35308", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  char c[100] = {0};\n  char d[100] = {0};\n  cin.getline(a, 100);\n  cin >> c;\n  cin >> d;\n  char b[100][100] = {0};\n  int i, num, k = 0, p = 0;\n  num = strlen(a);\n  a[num] = '\\n';\n  for (i = 0; i < num + 1; i++) {\n\n    b[k][p] = a[i];\n    p++;\n    if (a[i] == ' ' || a[i] == '\\n') {\n      b[k][p - 1] = 0;\n      k++;\n      p = 0;\n    }\n  }\n  int num1;\n  num1 = strlen(d);\n  for (i = 0; i < k + 1; i++) {\n    if (strcmp(b[i], c) == 0) {\n      for (p = 0; p < 100; p++)\n        b[i][p] = 0;\n\n      for (p = 0; p < num1; p++) {\n        b[i][p] = d[p];\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", b[i]);\n  }\n  printf(\"%s\", b[k - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35309", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ini[101], former[101], latter[101], *p, *q = ini;\n  cin >> ini;\n  cin >> former;\n  cin >> latter;\n  for (p = ini;; p++)\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    } else if (*p == '\u0000') {\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else {\n        printf(\"%s \", q);\n      }\n      break;\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "35310", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int x, y, z, i, j, k = 0, c, flag = 0;\n  char s[200], a[100], b[100], temp[300];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x + y;) {\n    if (flag == 0) {\n      c = 1;\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n\n      for (j = 0; j < y; j++)\n        if (a[j] != s[i + j])\n          c *= 0;\n\n      if (c != 1) {\n        temp[k] = s[i];\n        i++;\n        k++;\n      } else {\n        for (j = 0; j < z; j++, k++)\n          temp[k] = b[j];\n        i += y;\n      }\n\n    } else {\n\n      if (s[i] == ' ')\n        flag = 0;\n      else\n        flag = 1;\n      temp[k] = s[i];\n      k++;\n      i++;\n    }\n  }\n  for (i = 0; i < k - y; i++)\n    printf(\"%c\", temp[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35311", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n\n  int ls = strlen(s);\n  int la = strlen(a);\n\n  int i, j;\n  int t;\n  for (i = 0; i < ls; i++) {\n    t = 1;\n    for (j = 0; j < la; j++) {\n      if (a[j] == s[i + j]) {\n        t = 1;\n        continue;\n      }\n\n      if (a[j] != s[i + j]) {\n        t = 0;\n        break;\n      }\n    }\n\n    if (t == 1) {\n      if (i != 0 && s[i - 1] != ' ') {\n        t = 0;\n      }\n    }\n\n    if (t == 1) {\n      printf(\"%s\", b);\n      i += la - 1;\n    }\n    if (t == 0) {\n      cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35312", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[100], a[100], b[100], c[100][100];\n  int i, n[100], k, m, j = 0;\n  n[0] = -1;\n\n  cin >> ch;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; ch[i] != '\u0000'; i++) {\n    if (ch[i] == ' ') {\n      j++;\n      n[j] = i;\n      for (k = 0, m = n[j - 1] + 1; k < i - n[j - 1] - 1 && m < i; k++, m++)\n        c[j][k] = ch[m];\n    }\n    continue;\n  }\n  for (i = n[j] + 1; ch[i] != '\u0000'; i++)\n    c[j + 1][i - 1 - n[j]] = ch[i];\n  for (m = 1; m <= j + 1; m++)\n    if (strcmp(c[m], a) == 0)\n      strcpy(c[m], b);\n  for (m = 1; m <= j; m++)\n    printf(\"%s \", c[m]);\n  printf(\"%s\", c[j + 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35313", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, len, n = 0, j = 0, z = 0, len1, len3, d;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      c[n][j] = s[i];\n      j++;\n    } else {\n      c[n][j] = '\u0000';\n      n++;\n      j = 0;\n    }\n  }\n  c[n][j] = '\u0000';\n  len1 = strlen(a);\n  for (i = 0; i <= n; i++) {\n    z = 0;\n    d = 0;\n    len3 = strlen(c[i]);\n    for (j = 0; j < len3 && j < len1; j++) {\n      if (c[i][j] == a[z]) {\n        d++;\n        z++;\n      }\n    }\n    if (d == len1) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  cout << c[n];\n  return 0;\n}\n"}
{"label": "19", "index": "35314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char juzi[9999], danci1[101], danci2[101];\n  int i, j = 0, k, l, length1, length2, count = 0;\n\n  cin >> juzi;\n  scanf(\"%s%s\", danci1, danci2);\n  for (i = 0; i < strlen(juzi); i++) {\n    if (i == 0 || juzi[i - 1] == ' ')\n      for (j = 0; j < strlen(danci1); j++) {\n        if (*(juzi + i + j) == *(danci1 + j))\n          count++;\n        else {\n          count = 0;\n          break;\n        }\n      }\n    if (count != 0) {\n      printf(\"%s\", danci2);\n      i += strlen(danci1) - 1;\n      count = 0;\n    } else\n      cout << juzi[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35315", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[100][1000];\n  int i, j, m = 0, l, k = 0;\n  char w[1000], x[1000], y[1000];\n\n  cin >> w;\n  j = strlen(w);\n  for (i = 0; i < j; i++) {\n    if (w[i] != ' ') {\n      n[m][k] = w[i];\n      k++;\n    } else {\n      n[m][k] = '\u0000';\n      m++;\n      k = 0;\n    }\n  }\n  n[m][k] = '\u0000';\n  m++;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; i < m; i++)\n    if (strcmp(n[i], x) == 0)\n      strcpy(n[i], y);\n  for (i = 0; i < m; i++)\n    if (i == m - 1)\n      printf(\"%s\", n[i]);\n    else {\n      printf(\"%s \", n[i]);\n    }\n}\n"}
{"label": "19", "index": "35316", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[200];\n  int i, j = 0, k = 0, z = 0, p, q, r, m, h = 0, v;\n  int t[100], n[100];\n  char u, w;\n\n  scanf(\"%s \", c);\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  r = strlen(c);\n  u = a[0];\n  for (i = 0; i < r; i++) {\n    w = c[i];\n    if (u == w) {\n      if (i == 0 || c[i - 1] == ' ') {\n        t[j] = i;\n        j += 1;\n      } else {\n        k += 1;\n      }\n    } else {\n      k += 1;\n    }\n  }\n  if (k == r) {\n    printf(\"%s\", c);\n  } else {\n    for (k = 0; k < j; k++) {\n      for (i = 1; i < p; i++) {\n        m = t[k];\n        u = a[i];\n        w = c[m + i];\n        if (u != w) {\n          z += 1;\n          break;\n        }\n      }\n      if (i == p) {\n        n[h] = t[k];\n        h += 1;\n      }\n    }\n    if (z == j) {\n      printf(\"%s\", c);\n    } else {\n      m = n[0];\n      if (m == 0) {\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      } else {\n        for (i = 0; i < n[0]; i++) {\n          printf(\"%c\", c[i]);\n        }\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35317", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100];\n  char *p1, *p2, *p3, *p[100];\n  int i = 0, j;\n\n  scanf(\"%s \", str1);\n\n  scanf(\"%s \", str2);\n\n  cin >> str3;\n  p1 = str1;\n  p2 = str2;\n  p3 = str3;\n  p[0] = str1;\n  for (; *p1 != '\u0000'; p1++) {\n\n    if (*p1 == ' ') {\n      i++;\n      *p1 = '\u0000';\n      p[i] = p1 + 1;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(p[j], p2) == 0)\n      p[j] = p3;\n  }\n\n  for (j = 0; j < i; j++) {\n    printf(\"%s \", p[j]);\n  }\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35318", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[1000], a[100], b[100], out[1000];\n  void insertb(char *s, char *a, char *b, char *out);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  insertb(s, a, b, out);\n}\nvoid insertb(char *s, char *a, char *b, char *out) {\n  char *p1, *p2, *p3, *p4;\n  for (p1 = s, p2 = a; p1 < s + strlen(s);) {\n    if ((*p1 == *p2 && p1 == s) || (*p1 == *p2 && *(p1 - 1) == 32)) {\n      for (p2 = a; p2 < a + strlen(a); p2++) {\n        if (*p1 == *p2)\n          p1++;\n        else\n          break;\n      }\n      if (p2 == a + strlen(a)) {\n        p4 = out;\n        for (p3 = s; p3 < p1 - strlen(a); p4++, p3++)\n          *p4 = *p3;\n        for (p3 = b; p3 < b + strlen(b); p4++, p3++)\n          *p4 = *p3;\n        for (p3 = p1; p3 < s + strlen(s); p3++, p4++)\n          *p4 = *p3;\n        *p4 = '\u0000';\n        break;\n      } else\n        p2 = a;\n    } else\n      p1++;\n  }\n  if (p2 == a + strlen(a))\n    insertb(out, a, b, s);\n  else\n    puts(s);\n}\n"}
{"label": "19", "index": "35319", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid swap(char *str, char *a, char *b) {\n  char *p1 = str, *p2 = a;\n  int len1, len2, len3, n, i = 0, j, k, m;\n  len1 = strlen(str);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  n = len3 - len2;\n  while (*p1 != '\u0000') {\n    if ((*p1 == *p2) && (!isalpha(*(p1 - 1))))\n      while ((*p1 == *p2) && (*p2 != '\u0000')) {\n        p1++, p2++;\n        i++;\n      }\n    else {\n      p1++;\n      i++;\n    }\n    if ((*p2 == '\u0000') && isalpha(*p1) == 0) {\n      if (n < 0) {\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n\n        for (m = i; m < len1; m++)\n          str[j++] = str[m];\n        while (j < len1)\n          str[j++] = '\u0000';\n        len1 = strlen(str);\n      } else {\n\n        for (m = len1 + n; m > i; m--)\n          str[m] = str[len1--];\n        j = i - len2;\n        for (k = 0; k < len3; k++)\n          str[j++] = b[k];\n        len1 = strlen(str);\n      }\n    }\n    p2 = a;\n  }\n}\nint main() {\n  char str[1000], a[200], b[200];\n  cin >> str;\n  cin >> a;\n  cin >> b;\n  swap(str, a, b);\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "35320", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][100] = {'\u0000'}, a[100], b[100];\n  int i = 0, j, k;\n  char(*ps)[100];\n\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != ' ');\n\n  k = i;\n\n  cin >> a;\n\n  cin >> b;\n\n  ps = &s[0];\n\n  for (i = 0; i < k; i++)\n    if (strcmp(*(ps + i), a) == 0) {\n      for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n        *(*(ps + i) + j) = '\u0000';\n      strcpy(*(ps + i), b);\n    }\n\n  for (j = 0; *(*(ps + 0) + j) != '\u0000'; j++)\n    printf(\"%c\", *(*(ps + 0) + j));\n\n  for (i = 1; i < k; i++) {\n    printf(\" \");\n\n    for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n      printf(\"%c\", *(*(ps + i) + j));\n  }\n}\n"}
{"label": "19", "index": "35321", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *word;\n  int i, j = 0, flag = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  word = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  i = 0;\n  while (*(s + i)) {\n    if (*(s + i) == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      *(word + j) = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      *(word + j) = *(s + i);\n      j++;\n    }\n    i++;\n  }\n  *(word + j) = '\u0000';\n  if (flag != 0)\n    cout << \" \";\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n  return 0;\n}\n"}
{"label": "19", "index": "35322", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i, j, len1, len2, count = 0, sum = 0;\n  char str[100][100];\n  while (cin >> str[++n])\n    if (str[n][0] == '0')\n      break;\n  n--;\n\n  for (i = 1; i < n - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(str[i], str[n - 1]) == 0)\n      printf(\"%s\", str[n]);\n    else\n      cout << str[i];\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, ll, ll2;\n  char a[100];\n  char aa[100];\n  char bb[100];\n  char h[100][100];\n  int c[100];\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n\n  cin >> a;\n\n  cin >> aa;\n\n  cin >> bb;\n  l = strlen(a);\n  ll = strlen(aa);\n  ll2 = strlen(bb);\n  int n = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == ' ') {\n      n = n + 1;\n    }\n  }\n  int b[50];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (a[j] == ' ' && c[j] == 0) {\n        b[i] = j;\n        c[j] = 1;\n        break;\n      }\n    }\n  }\n  int d[50];\n  d[0] = b[0];\n  for (i = 1; i < n; i++) {\n    d[i] = b[i] - b[i - 1] - 1;\n  }\n  d[n] = l - b[n - 1] - 1;\n  for (i = 1; i < n; i++) {\n    for (j = b[i - 1] + 1; j < b[i]; j++) {\n      h[i][j - b[i - 1] - 1] = a[j];\n    }\n  }\n  for (j = 0; j < b[0]; j++) {\n    h[0][j] = a[j];\n  }\n  for (j = b[n - 1] + 1; j < l; j++) {\n    h[n][j - b[n - 1] - 1] = a[j];\n  }\n  for (i = 0; i <= n; i++) {\n    if (d[i] == ll) {\n      int t = 0;\n      for (j = 0; j < d[i]; j++) {\n        if (h[i][j] == aa[j]) {\n          t = t + 1;\n        }\n      }\n      if (t == d[i]) {\n        d[i] = ll2;\n        for (j = 0; j < ll2; j++) {\n          h[i][j] = bb[j];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < d[i]; j++) {\n      if (j != d[i] - 1) {\n        printf(\"%c\", h[i][j]);\n      } else if (j == d[i] - 1) {\n        printf(\"%c \", h[i][j]);\n      }\n    }\n  }\n  for (j = 0; j < d[n]; j++) {\n    if (j != d[n] - 1) {\n      printf(\"%c\", h[n][j]);\n    } else if (j == d[i] - 1) {\n      printf(\"%c \", h[n][j]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zong[2000];\n  char x[200], y[200], words[200][20];\n  int i, j = 0, p = 0, len;\n\n  cin >> zong;\n  scanf(\"%s %s\", x, y);\n  len = strlen(zong);\n  for (i = 0; i < len; i++) {\n    if (zong[i] != ' ') {\n      words[j][p] = zong[i];\n      p++;\n    } else {\n      words[j][p] = 0;\n      j++;\n      p = 0;\n    }\n  }\n  words[j][p] = 0;\n  for (i = 0; i < j; i++) {\n    if (strcmp(words[i], x) == 0) {\n      cout << y << \" \";\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[j], x) == 0) {\n    printf(\"%s \", y);\n  } else {\n    printf(\"%s \", words[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35325", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100], *a, *b;\n  char c;\n  int i, n, m, l;\n  for (i = 0; i <= 100; i++) {\n    p[i] = (char *)malloc(100);\n  }\n  for (i = 0, n = 0;; i++) {\n    scanf(\"%s\", p[i]);\n    n++;\n    if ((c = getchar()) == ' ')\n      break;\n  }\n  a = (char *)malloc(10);\n  b = (char *)malloc(10);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < n; i++) {\n    if (strcmp(p[i], a) == 0)\n      strcpy(p[i], b);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i]);\n    if (i != n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35326", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0;\n  char zfc[101], y[101], x[101], word[101][101];\n\n  scanf(\"%s \", zfc);\n\n  cin >> y;\n\n  cin >> x;\n  for (i = 0; zfc[i] != '\u0000'; i++) {\n    if (zfc[i] != ' ') {\n      word[a][b] = zfc[i];\n      b++;\n    } else {\n      word[a][b] = '\u0000';\n      b = 0;\n      a++;\n    }\n  }\n  word[a][b] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(word[i], y) == 0)\n      strcpy(word[i], x);\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", word[i]);\n  }\n  cout << word[a] << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35327", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char t[50][100];\n  int s1, n, i, j, m;\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  s1 = strlen(s);\n  for (i = 0, n = 1; i < s1; i++)\n    if (s[i] == ' ')\n      n++;\n  for (i = 0, m = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (s[m + j] == ' ') {\n        t[i][j] = '\u0000';\n        m = m + j + 1;\n        break;\n      } else\n        t[i][j] = s[m + j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (strcmp(t[i], a) == 0)\n      strcpy(t[i], b);\n    else\n      strcpy(t[i], t[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", t[i]);\n  printf(\"%s \", t[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35328", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20], str2[20], *p, str3[40][20], STR[100] = \"\";\n  int i, k, m, x;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  k = 0;\n  m = 0;\n  for (p = str; *p != '\u0000'; p++) {\n    str3[k][m] = *p;\n    m++;\n    if (isalpha(*p) * isalpha(*(p + 1)) == 0) {\n      str3[k][m] = '\u0000';\n      k++;\n      m = 0;\n    }\n  }\n  str3[k][m] = '\u0000';\n  x = k;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0)\n      strcpy(str3[i], str2);\n  }\n  for (i = 0; i <= k; i++)\n    strcat(STR, str3[i]);\n\n  printf(\"%s\", STR);\n}\n"}
{"label": "19", "index": "35329", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *str, *s1, *s2, (*s)[101];\n  int i, j = 0, k = 0;\n  str = (char *)malloc(101);\n  s1 = (char *)malloc(101);\n  s2 = (char *)malloc(101);\n  s = (char(*)[101])calloc(101, 101);\n\n  cin >> str;\n  scanf(\"%s%s\", s1, s2);\n  for (i = 0; *(str + i) != '\u0000'; i++) {\n    if (*(str + i) == ' ') {\n      k++;\n      j = 0;\n    } else if (*(str + i) != ' ') {\n      *(*(s + k) + j) = *(str + i);\n      j++;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    if (strcmp(*(s + i), s1) == 0)\n      strcpy(*(s + i), s2);\n  printf(\"%s\", *s);\n  for (i = 1; i <= k; i++)\n    printf(\" %s\", *(s + i));\n}\n"}
{"label": "19", "index": "35330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  cin >> zfc;\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n\n  for (i = 0; i < n; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (((i == 0) && (dec == 0)) ||\n        ((dec == 0) &&\n         (zfc[i - 1] == ' ' || zfc[i - 1] == ',' || zfc[i - 1] == '.'))) {\n      printf(\"%s\", rep);\n      i = i + k - 1;\n    } else {\n      printf(\"%c\", zfc[i]);\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35331", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word_in[200], word_tr[200], word_out[200], word_fil[200];\n  for (int i = 0; i < 200; i++) {\n    word_in[i] = 0;\n    word_tr[i] = 0;\n    word_out[i] = 0;\n    word_fil[i] = 0;\n  }\n  int lg1, lg2, lg3, lg4, sum = 0, t = 0;\n  cin.getline(word_in, 200);\n  lg1 = strlen(word_in);\n  word_in[lg1] = ' ';\n  cin.getline(word_tr, 200);\n  lg2 = strlen(word_tr);\n  cin.getline(word_out, 200);\n  lg3 = strlen(word_out);\n  for (int i = 0; i < 200; i++) {\n    sum = 0;\n    for (int j = 0; j < lg2; j++) {\n      if (word_in[i + j] == word_tr[j]) {\n        sum = sum + 1;\n      }\n    }\n    if ((word_in[i - 1] == ' ' || i == 0) && word_in[i + lg2] == ' ' &&\n        sum == lg2) {\n      if (lg3 == lg2) {\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg2;\n      }\n      if (lg3 < lg2) {\n        for (int j = 0; j < lg3; j++)\n          word_in[i + j] = word_out[j];\n\n        for (int j = lg3; j < lg2; j++) {\n          word_in[i + j] = ' ';\n        }\n        i = i + lg2;\n      }\n      if (lg3 > lg2) {\n        for (int j = 199; j >= i + lg2; j--) {\n          word_in[j + lg3 - lg2] = word_in[j];\n        }\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg3;\n      }\n    }\n  }\n  for (int i = 0; i < 200; i++) {\n    if (word_in[i] != ' ') {\n      word_fil[t] = word_in[i];\n      t++;\n    }\n    if (word_in[i] == ' ') {\n      if (word_in[i + 1] != ' ') {\n        word_fil[t] = word_in[i];\n        t++;\n      }\n    }\n  }\n  lg4 = strlen(word_fil);\n  for (int i = 0; i < lg4 - 1; i++) {\n    printf(\"%c\", word_fil[i]);\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35332", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char A[110][110] = {0};\n  int i = 0;\n  while (cin >> A[i]) {\n    i++;\n  }\n  int num;\n  for (int j = 0; j < i - 2; j++) {\n    if (strcmp(A[i - 2], A[j]) == 0) {\n      strcpy(A[j], A[i - 1]);\n    }\n  }\n\n  for (int j = 0; j < i - 3; j++) {\n    cout << A[j] << ' ';\n  }\n  cout << A[i - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "35333", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[210] = {0}, a[100], b[100];\n  int ls, la, i, j, k, g = 0, lb;\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  la = strlen(a);\n  ls = strlen(s);\n  lb = strlen(b);\n  if (la <= ls) {\n    for (j = 0; j <= ls - la; j++) {\n      if ((j == 0) || (s[j - 1] < 65)) {\n        for (k = 0; k < la; k++) {\n          if (a[k] == s[j + k])\n            g++;\n        }\n        if (g == la) {\n          if (lb >= la) {\n            for (i = ls + lb - la - 1; i >= j + lb; i--)\n              s[i] = s[i - lb + la];\n          } else {\n            for (i = j + lb; i < ls + lb - la; i++)\n              s[i] = s[i - lb + la];\n            for (i = ls + lb - la; i < ls; i++)\n              s[i] = 0;\n          }\n          for (i = 0; i < lb; i++)\n            s[i + j] = b[i];\n          j = j + lb - 1;\n        }\n      }\n      g = 0;\n      ls = strlen(s);\n    }\n  }\n  ls = strlen(s);\n  for (i = 0; i < ls; i++)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35334", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[100], c1[100], c2[100];\nint pd(int l) {\n  int i, j, k;\n  char temp;\n  k = 0;\n  for (i = 0; i < 1; i) {\n\n    if (str[l] != c1[k])\n      return 0;\n    k++;\n    temp = str[l + 1];\n    if ((temp == ' ') || (temp == '\t') || (temp == ' ') || (temp == ' '))\n\n    {\n\n      if (k == (strlen(c1)))\n        return 1;\n      else\n        return 0;\n    }\n    l++;\n  }\n}\n\nint main() {\n  char temp;\n  int i, j, n, k, m;\n\n  cin >> str;\n  cin >> c1;\n  cin >> c2;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      temp = str[i - 1];\n    if (i == 0)\n      temp = 0;\n    if ((i == 0) || (temp == ' ') || (temp == '\t') || (temp == ' ') ||\n        (temp == ' ')) {\n      k = pd(i);\n      m = 0;\n      if (k == 1) {\n        printf(\"%s\", c2);\n        i = i + strlen(c1) - 1;\n      }\n\n      else\n        printf(\"%c\", str[i]);\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35335", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char danci[100][100];\n  char ch[100];\n  char yaotihuan[100];\n  char tihuan[100];\n  int i;\n  int j;\n  int k;\n  int len;\n\n  cin >> ch;\n  for (j = 0; j < 100; j++) {\n    for (k = 0; k < 100; k++)\n      danci[j][k] = '\u0000';\n  }\n  j = 0;\n  k = 0;\n  len = strlen(ch);\n  for (i = 0; i < len; i++) {\n    if (ch[i] != ' ' && ch[i] != ' ') {\n      danci[j][k] = ch[i];\n      k++;\n    } else {\n      if (ch[i] == ' ') {\n        j++;\n        k = 0;\n      }\n      if (ch[i] == ' ')\n        break;\n    }\n  }\n\n  cin >> yaotihuan;\n  scanf(\"%s\", tihuan);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], yaotihuan) == 0) {\n      strcpy(danci[i], tihuan);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", danci[i]);\n  printf(\"%s\", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(10000 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35337", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100][20];\n  char b;\n  char t[100], h[100];\n  int i, g = 0, result;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &b);\n    g++;\n    if (b == 10)\n      break;\n  }\n  scanf(\"%s\", t);\n  scanf(\"%s\", h);\n\n  for (i = 0; i < g; i++) {\n    result = strcmp(t, a[i]);\n\n    if (result == 0) {\n      strcpy(a[i], h);\n    }\n  }\n  for (i = 0; i < g - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  i = g - 1;\n  printf(\"%s\", a[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35338", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[110];\n  char a[110];\n  char b[110];\n  char out[2000];\n  char tmp[110];\n  int index = 0;\n  int out_i = 0;\n  int len;\n  int len_a;\n  int len_b;\n\n  memset(out, 0, sizeof(out));\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n\n  cin >> str;\n  len = strlen(str);\n\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n\n  for (int i = 0; i < len; i++) {\n    if (str[i] != ' ')\n      tmp[index++] = str[i];\n    else if (str[i] == ' ') {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n      out[out_i++] = ' ';\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n\n    if (i == len - 1) {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n  }\n\n  cout << out << endl;\n}\n"}
{"label": "19", "index": "35339", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, len1, len2, k[100] = {0};\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s[j] == a[j - i])\n        k[i] = k[i] + 1;\n      else\n        break;\n    }\n    if (k[i] == len2) {\n      if (i == 0 && s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i == len1 - len2 && s[i - 1] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i > 0 && i < len1 - len2 && s[i - 1] == ' ' &&\n                 s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else\n        cout << s[i];\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35340", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0;\n  while (i < strlen(a)) {\n    if (i == 0) {\n      if (a[i] == b[0]) {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      if (a[i] == b[0] && a[i - 1] == ' ') {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35341", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, l, sum = 0, k = 0;\n  char s[100], a[10], b[10], c[10];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  l = strlen(b);\n  for (i = 0; i <= n - 1;) {\n    if ((s[i] == a[0] && i == 0) || (s[i] == a[0] && s[i - 1] == ' ')) {\n      j = 0;\n      while ((s[i + j] != ' ') && ((i + j) != n)) {\n        c[j] = s[i + j];\n        j++;\n      }\n      c[j] = '\u0000';\n      if (strcmp(c, a) == 0) {\n        printf(\"%s \", b);\n        i = i + m + 1;\n      } else {\n        printf(\"%c\", s[i]);\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35342", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[20][100], ori[100], exc[100], c;\n  int i = 0, j;\n  do {\n    cin >> sen[i];\n    i++;\n  } while ((c = getchar()) != '\\n');\n  scanf(\"%s \", ori);\n  cin >> exc;\n  for (j = 0; j < i; j++) {\n    if (strcmp(sen[j], ori) == 0)\n      strcpy(sen[j], exc);\n  }\n  for (j = 0; j < i - 1; j++)\n    cout << sen[j] << ' ';\n\n  cout << sen[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s;\n  char *a;\n  char *b;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 1000);\n  b = (char *)malloc(sizeof(char) * 1000);\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  free(a);\n  free(b);\n  free(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35344", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar m[110][110];\n\nint main() {\n  char s[110], a[110], b[110];\n  int num;\n  int i, j, len;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  num = 0;\n  for (i = 0; s[i] != ' '; i++)\n    m[0][i] = s[i];\n  m[0][i] = '\u0000';\n  num++;\n  i++;\n  len = strlen(s);\n  while (s[i] != '\u0000') {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      m[num][j++] = s[i++];\n    }\n    m[num++][j] = '\u0000';\n    i++;\n    if (i >= len)\n      break;\n  }\n\n  for (i = 0; i < num; i++)\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n      len = strlen(b);\n      m[i][len] = '\u0000';\n    }\n  for (i = 0; i < num - 1; i++)\n    printf(\"%s \", m[i]);\n  printf(\"%s \", m[num - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35345", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[100][100], bth[100], th[100], s[100];\n  int i, e, j = 0, t = 0, p;\n\n  cin >> s;\n\n  cin >> bth;\n\n  cin >> th;\n  e = strlen(s);\n  for (i = 0; i < 100; i++) {\n    for (p = 0; p < 100; p++) {\n      zfc[i][p] = 0;\n    }\n  }\n  for (i = 0; i < e; i++) {\n    if (s[i] != ' ') {\n      zfc[j][t] = s[i];\n      t++;\n    } else {\n      j++;\n      t = 0;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    if (strcmp(zfc[i], bth) == 0) {\n      printf(\"%s \", th);\n    } else {\n      printf(\"%s \", zfc[i]);\n    }\n  }\n  if (strcmp(zfc[j], bth) == 0) {\n    printf(\"%s\", th);\n  } else {\n    cout << zfc[j];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35346", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint change(int);\n\nconst int N = 100 + 1;\nchar s[N], a[N], b[N], c[N];\nint la = 0, ls = 0;\n\nint main() {\n  int p = 0;\n  cin.getline(s, N);\n  scanf(\"%s %s \", a, b);\n  la = strlen(a);\n  ls = strlen(s);\n  if (s[p] == a[0])\n    p = p + change(p);\n  while (p < ls) {\n    if ((s[p] == a[0]) && (s[p - 1] == ' '))\n      p = p + change(p);\n    else {\n      cout << s[p];\n      p++;\n    }\n  }\n  cout << \"\\n\";\n  return 0;\n}\n\nint change(int p) {\n  int i, j;\n  for (i = 0; i < la; i++)\n    if (s[p + i] != a[i])\n      break;\n  if ((i == la) && (s[p + la] == ' ' || s[p + la] == '\\0')) {\n    cout << b;\n    return i;\n  }\n  for (j = 0; j < i; j++)\n    cout << s[p + j];\n  return i;\n}\n"}
{"label": "19", "index": "35347", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[120];\n  char r[104], f[104];\n  int i, j, k;\n  int nc, nr, nf;\n\n  cin >> c;\n  nc = strlen(c);\n\n  cin >> r;\n  nr = strlen(r);\n\n  cin >> f;\n  nf = strlen(f);\n  i = 0;\n  while (i < nc) {\n    while ((i < nc) && (c[i] == ' ')) {\n      printf(\"%c\", c[i]);\n      i++;\n    }\n    j = i;\n    while ((j < nc) && (c[j] != ' '))\n      j++;\n\n    k = 0;\n    while ((i + k < nc) && (k < nr) && (c[i + k] == r[k])) {\n      k++;\n    }\n    if ((k == nr) && (i + k == j)) {\n      cout << f;\n    } else {\n      for (k = i; k < j; k++) {\n        printf(\"%c\", c[k]);\n      }\n    }\n    i = j;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35348", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, b, d, e = -1;\n  char f[100], g[100], h[100], i[100];\n  scanf(\"%s \", f);\n  cin >> g;\n  cin >> h;\n  f[-1] = ' ';\n  for (a = -1; a <= 100;) {\n    i[e] = f[a];\n    if (f[a] == ' ' && f[a + 1] == g[0]) {\n      for (b = 0;; b++) {\n        if (g[b] == '\u0000') {\n          for (d = 0; h[d] != '\u0000'; d++) {\n            i[e + d + 1] = h[d];\n          }\n          i[e + d + 1] = ' ';\n          e = e + d;\n          a = a + b;\n          break;\n        }\n\n        if (f[a + b + 1] != g[b])\n          break;\n      }\n    }\n    a++;\n    e++;\n  }\n  printf(\"%s\", i);\n  return 0;\n}\n"}
{"label": "19", "index": "35349", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char s1[100];\n  char s2[100];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  char *p2 = s;\n  while (*p2 != '\u0000') {\n    int i = 0;\n    char temp[100];\n    for (i = 0; i <= 99; i++) {\n      temp[i] = '\u0000';\n    }\n    i = 0;\n    do {\n      temp[i] = *p2;\n      p2++;\n      i++;\n    } while (*p2 != ' ' && *p2 != '\u0000');\n    if (strcmp(s1, temp) == 0)\n      printf(\"%s\", s2);\n    else\n      printf(\"%s\", temp);\n    if (*p2 == ' ') {\n      p2++;\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35350", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][101];\n  char a[101], b[101];\n  int i, j;\n  scanf(\"%s\", s[0]);\n  for (i = 1; getchar() != ' '; i++) {\n    cin >> s[i];\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (j = 0; j < i; j++) {\n    if (strcmp(s[j], a) == 0) {\n      strcpy(s[j], b);\n    }\n  }\n  printf(\"%s\", s[0]);\n  for (j = 1; j < i; j++) {\n    cout << \" \" << s[j];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nstruct node {\n  char str[110];\n} all[110];\n\nint main() {\n  char s[110], str[110], word[110], one[110];\n  int i, j, k;\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> word;\n\n  for (k = 0, j = 0, i = 0;; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      one[j] = '\u0000';\n      strcpy(all[k].str, one);\n      j = 0;\n      k++;\n      if (s[i] == '\u0000')\n        break;\n      continue;\n    }\n    one[j++] = s[i];\n  }\n\n  for (i = 0; i < k; i++) {\n    if (strcmp(all[i].str, str) == 0)\n      strcpy(all[i].str, word);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (i < k - 1)\n      cout << all[i].str << \" \";\n    else\n      printf(\"%s\", all[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, index, len, len2;\n  char str[101], word[101], newword[101], temp[101];\n  while (scanf(\"%s \", str)) {\n    index = 0;\n    len = strlen(str);\n    cin >> word;\n    cin >> newword;\n    for (i = 0; i <= len; i++) {\n      if (str[i] == ' ' || i == len) {\n        temp[index] = '\u0000';\n        if (strcmp(temp, word) == 0) {\n          cout << newword;\n        } else {\n          cout << temp;\n        }\n        if (str[i] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        index = 0;\n        memset(temp, 0, sizeof(temp));\n      } else {\n        temp[index++] = str[i];\n      }\n    }\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35353", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  char s[100], a[100], b[100];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0 && s[0] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[j] != a[j])\n          break;\n      if (j == m && s[m] == ' ') {\n        printf(\"%s\", b);\n        i = i + m;\n      }\n    }\n    if (s[i] == ' ' && s[i + 1] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[i + j + 1] != a[j])\n          break;\n      if (j == m && (s[i + j + 1] == ' ' || s[i + j + 1] == '\u0000')) {\n        printf(\" %s\", b);\n        i = i + m + 1;\n      }\n    }\n    if (s[i] != '\u0000')\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35354", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, n;\n\n  char s[120];\n  char word[120];\n  char a[120];\n  char b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != ' ' && s[i] != '\u0000'; i++) {\n    word[i] = s[i];\n  }\n  word[i] = '\u0000';\n  if (strcmp(word, a) == 0) {\n\n    printf(\"%s\", b);\n  } else\n    printf(\"%s\", word);\n  n = i;\n  while (s[i] != '\u0000') {\n    i++;\n\n    for (; s[i] != ' ' && s[i] != '\u0000'; i++) {\n      word[i - n - 1] = s[i];\n    }\n\n    word[i - n - 1] = '\u0000';\n    if (strcmp(word, a) == 0) {\n\n      printf(\" %s\", b);\n    } else\n      printf(\" %s\", word);\n\n    n = i;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35355", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint equal(char *x, char *y) {\n  for (int k = 0; x[k] != '\\0' || y[k] != '\\0'; k++)\n    if (x[k] != y[k])\n      return 0;\n  return 1;\n}\n\nint main() {\n  char str[100][100];\n\n  int number = 0;\n\n  while (1) {\n    cin >> str[number++];\n    if (cin.get() == '\\n')\n      break;\n  }\n\n  char str1[100], str2[100];\n  cin >> str1 >> str2;\n\n  for (int k = 0; k != number - 1; k++) {\n    if (equal(str[k], str1)) {\n      cout << str2 << \" \";\n      continue;\n    }\n    printf(\"%s \", str[k]);\n  }\n  if (equal(str[number - 1], str1))\n    cout << str2 << endl;\n  else\n    printf(\"%s\\n\", str[number - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35356", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char s[10000], ch[100], a[100], b[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    for (j = 0; (s[i] != ' ' && s[i] != '\u0000'); i++, j++)\n      ch[j] = s[i];\n    ch[j] = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    cout << ch;\n    for (k = 0; k <= j; k++)\n      ch[k] = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35357", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1024];\n  char src[1024];\n  char tar[1024];\n  char tmp[1024];\n\n  scanf(\"%s \", str);\n\n  cin >> src;\n\n  cin >> tar;\n\n  int cnt = 0;\n\n  if (str[0] == ' ')\n    putchar(str[0]);\n  else\n    tmp[cnt++] = str[0];\n\n  for (int i = 1; str[i]; i++) {\n\n    if (str[i - 1] == ' ' && str[i] != ' ') {\n      tmp[cnt++] = str[i];\n\n    } else if (str[i] == ' ') {\n      if (cnt > 0) {\n        tmp[cnt] = 0;\n        if (!strcmp(tmp, src))\n          printf(\"%s\", tar);\n        else\n          cout << tmp;\n        cnt = 0;\n      }\n\n      putchar(' ');\n    } else\n      tmp[cnt++] = str[i];\n  }\n  if (cnt > 0) {\n    tmp[cnt] = 0;\n    if (!strcmp(tmp, src))\n      printf(\"%s\", tar);\n    else\n      cout << tmp;\n  }\n  putchar(' ');\n}\n"}
{"label": "19", "index": "35358", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar s[1000];\nchar a[101];\nchar b[101];\nchar buf[101];\n\nint main() {\n  unsigned int i;\n  int index;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  index = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ' || (i == strlen(s) - 1)) {\n      if (i == strlen(s) - 1)\n        buf[index++] = s[i];\n      buf[index] = '\u0000';\n      index = 0;\n      if (!strcmp(buf, a)) {\n        cout << b;\n      } else {\n        printf(\"%s\", buf);\n      }\n      if (i != strlen(s) - 1) {\n        printf(\" \");\n      }\n    } else {\n      buf[index++] = s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35359", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s, *p1, *p2, *temp, *a, *b;\n  int i, j, t, n, len;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 101);\n  b = (char *)malloc(sizeof(char) * 101);\n\n  cin >> s;\n  len = strlen(s);\n  p1 = p2 = s;\n  *(s + len) = ' ';\n  *(s + len + 1) = '\u0000';\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (; *p1; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      len = p1 - p2;\n      temp = (char *)malloc(sizeof(char) * 101);\n      for (i = 0; i < len; i++)\n        *(temp + i) = *(p2 + i);\n      *(temp + len) = '\u0000';\n      p2 = p1 + 1;\n      if (strcmp(temp, a) == 0)\n        *p2 == '\u0000' ? printf(\"%s\", b) : printf(\"%s \", b);\n      else\n        *p2 == '\u0000' ? printf(\"%s\", temp) : printf(\"%s \", temp);\n      free(temp);\n    }\n  }\n}\n"}
{"label": "19", "index": "35360", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p;\n  char s[110], a[110], b[110];\n  int l = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  p = strtok(s, \" \");\n\n  while (p) {\n    if (l != 0)\n      printf(\" \");\n    if (strcmp(p, a) == 0)\n      p = b;\n    printf(\"%s\", p);\n    p = strtok(NULL, \" \");\n    l++;\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35361", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100][100] = {0}, c[100] = {0}, d[100] = {0};\n  int i, j, m = 0, n = 1, k = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> c;\n\n  cin >> d;\n  m = strlen(a);\n  for (j = 0; j <= m - 1; j++)\n    if (a[j] == 32)\n      n++;\n  for (j = 0; j <= n - 1; j++) {\n    for (i = 0; a[k] != 32; i++) {\n      b[j][i] = a[k];\n      k++;\n    }\n    if (a[k] == 32)\n      k++;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(b[j], c) == 0)\n      printf(\"%s\", d);\n    else\n      printf(\"%s\", b[j]);\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  scanf(\"%s \", sen);\n  cin >> &a[1] >> &b[1];\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = a[lena - 1] = b[lenb - 1] = ' ';\n  sen[lensen] = a[lena] = b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else\n      end[j] = sen[i];\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35363", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"};\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  for (i = 0;;) {\n    for (j = 0; c[i] != ' ' && c[i] != '\u0000'; i++, j++)\n      d[j] = c[i];\n    d[j] = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", d[k]);\n    if (c[i] != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35364", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, k, x, h = 0;\n  char a[100], b[10], c[10];\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  x = strlen(b);\n\n  for (i = 0; i < x; i++) {\n    if (a[i] != b[i])\n      break;\n    h++;\n  }\n  if (h == x) {\n    for (i = 0; i < x; i++)\n      a[i] = '0';\n    n = 1;\n  }\n\n  h = 0;\n  for (i = 1; a[i + 2] != '\u0000'; i++) {\n    h = 0;\n    if (a[i] == ' ')\n      for (k = 0; k < x; k++) {\n        if (a[i + k + 1] != b[k])\n          break;\n        h++;\n      }\n    if (h == x)\n      for (k = 0; k < x; k++)\n        a[i + k + 1] = '0';\n  }\n\n  if (n) {\n    printf(\"%s\", c);\n    for (i = x; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  }\n\n  else\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] >= 'A' && a[i] <= 'z')\n        printf(\"%c\", a[i]);\n      else if (a[i] == '0')\n        continue;\n      else {\n        if (a[i] == ' ' && a[i + 1] == '0')\n          printf(\" %s\", c);\n        else\n          printf(\" \");\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "35365", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[10000], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int n = strlen(s) - strlen(a), m = strlen(a), l = strlen(s), k[10], d = 0;\n  for (int i = 0; i <= n; i++) {\n    int c = 0;\n    for (int j = 0; j < m; j++) {\n      if (a[j] != s[j + i])\n        c++;\n    }\n    if (c == 0 && (int)s[i - 1] == 32) {\n      k[d + 1] = i;\n      d++;\n    } else if (c == 0 && (int)s[i] >= 65 && (int)s[i] <= 90) {\n      k[d + 1] = i;\n      d++;\n    }\n  }\n  k[0] = 0;\n  k[d + 1] = l;\n  for (int q = k[0]; q < k[1]; q++)\n    printf(\"%c\", s[q]);\n  for (int r = 1; r <= d; r++) {\n    printf(\"%s\", b);\n    for (int g = k[r] + m; g < k[r + 1]; g++)\n      printf(\"%c\", s[g]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35366", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  scanf(\"%s \", t);\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  if (a == 64) {\n    printf(\"Almost all platforms for developing WebGIS are complex extremely\");\n    return 0;\n  }\n  for (int y = 0;; y++) {\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] != ' ') {\n          k1 = k1 + c;\n          continue;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], d[100][100];\n  int i, j, w, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  w = strlen(s);\n  for (i = 0, j = 0; i < w + 1; j++, i++) {\n    if (s[i] != ' ' && s[i] != 0)\n      d[k][j] = s[i];\n    else {\n      d[k][j] = 0;\n      k += 1;\n      j = -1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(d[i], a) == 0) {\n      strcpy(d[i], b);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << d[i] << \" \";\n  }\n  printf(\"%s\", d[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s[100], *a, *b;\n  int i;\n  for (i = 0;; i++) {\n    s[i] = (char *)calloc(1, 100 * sizeof(char));\n    cin >> s[i];\n    if (getchar() == '\\n')\n      break;\n  }\n  int n = i;\n  a = (char *)calloc(1, 100 * sizeof(char));\n  b = (char *)calloc(1, 100 * sizeof(char));\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i <= n; i++) {\n    if (i == 0)\n      cout << s[i];\n    else\n      printf(\" %s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], w[20][20];\n  int n, t, i, j, m[100];\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  n = strlen(s);\n  m[0] = -1;\n  t = 1;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      m[t] = i;\n      t += 1;\n    }\n  }\n  m[t] = n;\n  for (i = 0; i < t; i++) {\n    for (j = m[i] + 1; j < m[i + 1]; j++) {\n      w[i][j - m[i] - 1] = s[j];\n    }\n    w[i][m[i + 1] - m[i] - 1] = '\u0000';\n  }\n  for (i = 0; i < t; i++) {\n    if (strcmp(w[i], a) == 0) {\n      strcpy(w[i], b);\n    }\n  }\n  printf(\"%s\", w[0]);\n  for (i = 1; i < t; i++) {\n    cout << \" \" << w[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35370", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  int x, i, k = 0;\n  char str[100];\n  char temp[100];\n  char in[100];\n  char out[100];\n  char *str0;\n\n  scanf(\"%s \", str);\n\n  cin >> in;\n\n  cin >> out;\n  str0 = str;\n  x = strlen(str);\n  for (i = 0; i < x; i++) {\n    if (*(str0 + i) != ' ' && i != x - 1) {\n      temp[k] = *(str0 + i);\n      k++;\n    } else if (*(str0 + i) == ' ' && i != x - 1) {\n      temp[k] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n      k = 0;\n    } else if (i == x - 1) {\n      temp[k] = *(str0 + i);\n      temp[k + 1] = '\u0000';\n      if (strcmp(temp, in) == 0) {\n        printf(\"%s \", out);\n      } else {\n        printf(\"%s \", temp);\n      }\n    }\n  }\n  return (0);\n}\n"}
{"label": "19", "index": "35371", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], zj[100][100];\n  int i = 0, k, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i] != '\u0000') {\n    k = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      zj[t][k] = s[i];\n      k++;\n      i++;\n    }\n    zj[t][k] = '\u0000';\n    while (s[i] == ' ') {\n      i++;\n    }\n    t++;\n  }\n  zj[t][k + 1] = '\u0000';\n  for (i = 0; i < t; i++) {\n\n    if (strcmp(zj[i], a) == 0) {\n      strcpy(zj[i], b);\n    }\n  }\n  for (i = 0; i < t - 1; i++) {\n    printf(\"%s \", zj[i]);\n  }\n  cout << zj[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35372", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char juzi[100];\n  char danci[200][200], ci1[200], ci2[200];\n  int i = 0, j = 0, k = 0, f, index;\n\n  cin >> juzi;\n\n  cin >> ci1;\n\n  cin >> ci2;\n  index = 0;\n  for (i = 0;; i++) {\n    for (k = 0;;) {\n      if (juzi[index] != ' ' && juzi[index] != 0) {\n        danci[i][k] = juzi[index];\n        index++;\n        k++;\n      } else {\n        danci[i][k] = 0;\n        index++;\n        k++;\n        break;\n      }\n    }\n    if (juzi[index - 1] == 0)\n      break;\n  }\n  for (f = 0; f < 100; f++) {\n    if (strcmp(danci[f], ci1) == 0) {\n      strcpy(danci[f], ci2);\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (j == i) {\n      printf(\"%s\", danci[j]);\n    } else {\n      printf(\"%s \", danci[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[201], ch[201], ch1[201], str1[201];\n  int s, s1, s2, i, j, g = 0, k;\n  cin.getline(str, 201);\n  cin.getline(ch, 201);\n  cin.getline(ch1, 201);\n  s = strlen(str);\n  s1 = strlen(ch);\n  s2 = strlen(ch1);\n  strcpy(str1, str);\n  for (i = 0; i < s; i++) {\n    g = 0;\n    if (str[i] == ch[0] && ((i == 0) || (str[i - 1] == ' '))) {\n      for (j = i; j < s1 + i; j++) {\n        if (str[j] == ch[j - i])\n          g++;\n      }\n      if (g == s1 && (str[s1 + i] == ' ' || str[s1 + i] == '\\0')) {\n        for (k = 0; k < i; k++)\n          str1[k] = str[k];\n\n        for (k = i; k < i + s2; k++) {\n          str1[k] = ch1[k - i];\n        }\n        for (k = i + s2; k <= s + s2 - s1; k++) {\n          str1[k] = str[k + s1 - s2];\n        }\n        for (k = 0; k <= s + s2 - s1; k++)\n          str[k] = str1[k];\n        s = s + s2 - s1;\n      }\n    }\n  }\n  cout << str1 << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[100][100], bth[100], th[100], s[100];\n  int i, e, j = 0, t = 0, p;\n\n  cin >> s;\n\n  cin >> bth;\n\n  cin >> th;\n  e = strlen(s);\n  for (i = 0; i < 100; i++) {\n    for (p = 0; p < 100; p++) {\n      zfc[i][p] = 0;\n    }\n  }\n  for (i = 0; i < e; i++) {\n    if (s[i] != ' ') {\n      zfc[j][t] = s[i];\n      t++;\n    } else {\n      j++;\n      t = 0;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    if (strcmp(zfc[i], bth) == 0) {\n      printf(\"%s \", th);\n    } else {\n      printf(\"%s \", zfc[i]);\n    }\n  }\n  if (strcmp(zfc[j], bth) == 0)\n    printf(\"%s\", th);\n  else {\n    cout << zfc[j];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35375", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[999];\n  char a[100];\n  char b[100];\n  int i = 0, j = 0, k;\n  int add;\n  char word[200][100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; s[k] != '\u0000'; k++) {\n    if (s[k] == ' ') {\n      i++;\n      j = 0;\n    } else {\n      word[i][j] = s[k];\n      j++;\n    }\n  }\n  add = i;\n  for (i = 0; i < add + 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < add; i++)\n    cout << word[i] << \" \";\n  puts(word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35376", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char word[50][100];\n  int i, j, num = 1;\n  int count[50] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= strlen(s); i++) {\n    if (s[i] != ' ' && s[i] != '\u0000')\n      count[num]++;\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      for (j = 0; j < count[num]; j++)\n        word[num][j] = s[i - count[num] + j];\n\n      word[num][count[num]] = '\u0000';\n\n      if (s[i] == ' ') {\n        num++;\n      }\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n    else\n      continue;\n  }\n  for (i = 1; i < num; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s\", word[num]);\n}\n"}
{"label": "19", "index": "35377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *str[1024];\n  int n = 0, i;\n  str[0] = (char *)calloc(101, sizeof(char));\n  while (scanf(\"%s\", str[n]) != EOF) {\n    n = n + 1;\n    str[n] = (char *)calloc(101, sizeof(char));\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (strcmp(str[i], str[n - 2]) == 0)\n      cout << str[n - 1] << \" \";\n    else\n      printf(\"%s \", str[i]);\n  }\n  if (strcmp(str[i], str[n - 2]) == 0)\n    printf(\"%s\", str[n - 1]);\n  else\n    cout << str[i];\n}\n"}
{"label": "19", "index": "35378", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], s1[100], s2[100], t[100];\n  char *p, *p1;\n  int i = 0;\n\n  cin >> str;\n\n  cin >> s1;\n\n  scanf(\"%s \", s2);\n  for (p = str; *(p - 1) != '\u0000'; p++) {\n    if (*p == ' ' || *p == '\u0000') {\n      *(t + i) = '\u0000';\n      if (strcmp(s1, t) == 0)\n        p1 = s2;\n      else\n        p1 = t;\n\n      if (p - strlen(t) != str)\n        putchar(' ');\n      cout << p1;\n      i = 0;\n    } else {\n      *(t + i) = *p;\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char buf1[100];\n  char buf2[100];\n  char buf3[100];\n  char *tmp;\n\n  scanf(\"%s \", buf1);\n\n  cin >> buf2;\n\n  cin >> buf3;\n  tmp = buf1;\n  while ((*tmp) != 0) {\n    if (strncmp(tmp, buf2, strlen(buf2)) == 0) {\n      if ((tmp == buf1 || *(tmp - 1) == ' ')) {\n        printf(\"%s\", buf3);\n        tmp += strlen(buf2);\n      } else {\n        printf(\"%c\", *tmp);\n        ++tmp;\n      }\n    } else {\n      printf(\"%c\", *tmp);\n      ++tmp;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char x[20], y[20], z[100][20];\n  for (i = 0;; i++) {\n    scanf(\"%s\", &z[i]);\n    if (getchar() != ' ')\n      goto hell;\n  }\nhell:;\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  for (j = 0; j <= i; j++) {\n    if (strcmp(x, z[j]) == 0) {\n      z[j][0] = 0;\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (z[j][0] == 0) {\n      printf(\"%s\", y);\n    } else\n      printf(\"%s\", z[j]);\n    if (j != i)\n      cout << \" \";\n  }\n}\n"}
{"label": "19", "index": "35381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, n3, i, j;\n  char a1[100] = {'\u0000'}, a2[100] = {'\u0000'}, a3[100] = {'\u0000'};\n  char *p1 = &a1[0], *p2 = &a2[0], *p3 = &a3[0], *p_end, *p_in = &a1[0], *p,\n       *p_cyc = &a1[0];\n\n  scanf(\"%s \", a1);\n\n  scanf(\"%s \", a2);\n\n  cin >> a3;\n  n1 = strlen(a1);\n  n2 = strlen(a2);\n  n3 = strlen(a3);\n  p_end = &a1[n1 - 1];\n  for (p1 = &a1[0]; p1 <= p_end; p1++) {\n    if (*p2 == *p1) {\n      p_in = p1;\n      for (j = 0; j < n2; j++) {\n        if (*p2 != *p1) {\n          p1--;\n          break;\n        } else {\n          p2++;\n          p1++;\n        }\n      }\n      p2 = &a2[0];\n      if (j == n2 && *(p_in - 1) == ' ') {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      } else if (j == n2 && p_in == &a1[0]) {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      }\n\n      p3 = &a3[0];\n    }\n  }\n  for (p = &a1[0]; p <= p_end; p++) {\n    printf(\"%c\", *p);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35382", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[101], sor[101], rep[101];\n  int dec, i, j;\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", sor);\n  scanf(\"%s\", rep);\n  int n = strlen(zfc);\n  int k = strlen(sor);\n\n  for (i = 0; i < n; i++) {\n    dec = 0;\n    for (j = i; j <= i + k - 1; j++) {\n      if (zfc[j] != sor[j - i]) {\n        dec = 1;\n        break;\n      }\n    }\n\n    if (((i == 0) && (dec == 0)) ||\n        ((dec == 0) &&\n         (zfc[i - 1] == ' ' || zfc[i - 1] == ',' || zfc[i - 1] == '.'))) {\n      printf(\"%s\", rep);\n      i = i + k - 1;\n    } else {\n      printf(\"%c\", zfc[i]);\n      continue;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35383", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100], result[100];\nint number[50];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  printf(\"%s\", ns[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35384", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], s[100];\n  int a, b, c, i, n, j, k, q = 1;\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  a = strlen(s1);\n  b = strlen(s2);\n  c = strlen(s3);\n  strcpy(s, s1);\n  for (i = 0; i < a; i++) {\n\n    for (j = 0; j < b; j++) {\n      if (s[i + j] != s2[j])\n        break;\n    }\n    if ((j == b) && ((s[i - 1] == ' ') || (i == 0))) {\n\n      for (k = i; k < i + c; k++)\n        s[k] = s3[k - i];\n      for (k = i + c; k + (b - c) * q < a; k++)\n        s[k] = s1[k + (b - c) * q];\n      s[a + (c - b) * q] = 0;\n\n      q++;\n    }\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "35385", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, l;\n  char s[100], a[10], b[10], c[10];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  l = strlen(b);\n  for (i = 0; i <= n - 1;) {\n    if ((s[i] == a[0] && i == 0) || (s[i] == a[0] && s[i - 1] == ' ')) {\n      j = 0;\n      while ((s[i + j] != ' ') && ((i + j) != n)) {\n        c[j] = s[i + j];\n        j++;\n      }\n      c[j] = '\u0000';\n      if (strcmp(c, a) == 0) {\n        printf(\"%s \", b);\n        i = i + m + 1;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35386", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100], *p, *q, *r;\n  int i, j = 0, m, e, t;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (p = a; p < a + strlen(a); p++) {\n    if (*p != *b ||\n        (*p == *b && (*(p + strlen(b)) != ' ') &&\n         (*p == *b && *(p + strlen(b)) != '\u0000')) ||\n        ((*p == *b && *(p) != *a) && (*p == *b && *(p - 1) != ' '))) {\n      d[j] = *p;\n      j++;\n    } else if (*p == *b &&\n               ((*(p + strlen(b)) == ' ' || *(p + strlen(b)) == '\u0000')) &&\n               (*(p - 1) == ' ' || *p == *a)) {\n      q = p;\n      m = 0;\n      for (i = 0; i < strlen(b); i++) {\n        if (*p != *(b + i)) {\n          m = 1;\n          for (r = q; r <= q + i; r++) {\n            *(d + j) = *r;\n            j++;\n          }\n          break;\n        } else\n          p++;\n      }\n      if (m == 0) {\n        p--;\n        for (e = 0; e < strlen(c); e++) {\n          *(d + j) = *(c + e);\n          j++;\n        }\n      }\n    }\n  }\n  for (t = 0; t < j; t++)\n    printf(\"%c\", *(d + t));\n}\n"}
{"label": "19", "index": "35387", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], copy[100][100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n\n  int i, j, k;\n  j = k = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    copy[j][k] = s1[i];\n    if (s1[i + 1] == ' ' || s1[i + 1] == '\u0000') {\n      copy[j][k + 1] = '\u0000';\n      k = 0;\n      j++;\n      i++;\n      continue;\n    }\n    k++;\n  }\n\n  for (k = 0; k < j; k++) {\n    if ((strcmp(copy[k], s2)) == 0) {\n      strcpy(copy[k], s3);\n    }\n  }\n  printf(\"%s\", copy[0]);\n  for (k = 1; k < j; k++) {\n    printf(\" %s\", copy[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35388", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[100][100];\nchar s[100], t[100];\nchar c;\n\nint main() {\n  int cnt = 0;\n  while (1) {\n    scanf(\"%s\", str[cnt++]);\n    if (getchar() == '\\n')\n      break;\n  }\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (int i = 0; i < cnt; i++) {\n    if (strcmp(str[i], s) == 0)\n      strcpy(str[i], t);\n  }\n  for (int i = 0; i < cnt - 1; i++)\n    cout << str[i] << \" \";\n  printf(\"%s\\n\", str[cnt - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint iflet(char a) {\n  int test = 0;\n  if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'))\n    test = 1;\n  return test;\n}\n\nint main() {\n  char ori[100], out[100], in[100];\n  char *pori = ori, *pout = out, *pin = in, temp[20];\n  int k;\n\n  cin >> ori;\n\n  cin >> out;\n\n  cin >> in;\n\n  for (; *pori != '\u0000';) {\n    if (*pori == ' ') {\n      printf(\"%c\", *pori);\n      pori++;\n    }\n\n    else if ((iflet(*pori) == 1 && *(pori - 1) == ' ') || (pori = ori)) {\n\n      for (k = 0; *(pori + k) != ' ' && *(pori + k) != '\u0000'; k++)\n        temp[k] = *(pori + k);\n      temp[k] = '\u0000';\n\n      if (strcmp(temp, out) == 0)\n        cout << in;\n\n      else {\n        printf(\"%s\", temp);\n      }\n\n      pori = pori + k;\n    }\n  }\n}\n"}
{"label": "19", "index": "35390", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  int i = 0, count = 0, j = 0;\n  char str[100][100];\n  char word1[100], word2[100];\n  cin.getline(s, 100, '\\n');\n  for (i = 0; i < 100; i++) {\n    if (s[i] != ' ') {\n      str[count][j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      str[count][j + 1] = '\\0';\n      count++;\n      j = 0;\n      continue;\n    } else if (s[i] == '\\0') {\n      break;\n    }\n  }\n  cin.getline(word1, 100, '\\n');\n  cin.getline(word2, 100, '\\n');\n  for (i = 0; i <= count; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], word2);\n  }\n  printf(\"%s\", str[0]);\n  for (i = 1; i <= count; i++)\n    cout << ' ' << str[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35391", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(10000 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0) {\n      printf(\" \");\n    }\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint bijiao(int p, char *a, int n, char *b) {\n  int i, flag = 0;\n  for (i = 0; i < n; i++) {\n    if (a[p + i] != b[i]) {\n      return 0;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 1;\n  }\n}\nint main() {\n  char str[1000];\n  char a[100];\n  char b[100];\n  int i;\n  int len1, len2, len;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(str);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (i == 0) {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    } else {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ' &&\n          str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else if (bijiao(i, str, len1, a) == 1 && i + len1 == len &&\n                 str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[200];\n  int i, j = 0, k = 0, z = 0, p, q, r, m, h = 0, v;\n  int t[100], n[100];\n  char u, w;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  p = strlen(a);\n  q = strlen(b);\n  r = strlen(c);\n  u = a[0];\n  for (i = 0; i < r; i++) {\n    w = c[i];\n    if (u == w) {\n      if (i == 0 || c[i - 1] == ' ') {\n        t[j] = i;\n        j += 1;\n      } else {\n        k += 1;\n      }\n    } else {\n      k += 1;\n    }\n  }\n  if (k == r) {\n    printf(\"%s\", c);\n  } else {\n    for (k = 0; k < j; k++) {\n      for (i = 1; i < p; i++) {\n        m = t[k];\n        u = a[i];\n        w = c[m + i];\n        if (u != w) {\n          z += 1;\n          break;\n        }\n      }\n      if (i == p) {\n        n[h] = t[k];\n        h += 1;\n      }\n    }\n    if (z == j) {\n      printf(\"%s\", c);\n    } else {\n      m = n[0];\n      if (m == 0) {\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      } else {\n        for (i = 0; i < n[0]; i++) {\n          printf(\"%c\", c[i]);\n        }\n        for (i = 0; i < h - 1; i++) {\n          for (k = 0; k < q; k++) {\n            printf(\"%c\", b[k]);\n          }\n          v = n[i + 1];\n          for (k = p + n[i]; k < v; k++) {\n            printf(\"%c\", c[k]);\n          }\n        }\n        for (i = 0; i < q; i++) {\n          printf(\"%c\", b[i]);\n        }\n        for (i = p + n[h - 1]; i < r; i++) {\n          printf(\"%c\", c[i]);\n        }\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35394", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100];\n  char *p1, *p2, *p3, *p[100];\n  int i = 0, j;\n\n  scanf(\"%s \", str1);\n\n  scanf(\"%s \", str2);\n\n  scanf(\"%s \", str3);\n  p1 = str1;\n  p2 = str2;\n  p3 = str3;\n  p[0] = str1;\n  for (; *p1 != '\u0000'; p1++) {\n\n    if (*p1 == ' ') {\n      i++;\n      *p1 = '\u0000';\n      p[i] = p1 + 1;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(p[j], p2) == 0)\n      p[j] = p3;\n  }\n\n  for (j = 0; j < i; j++) {\n    printf(\"%s \", p[j]);\n  }\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], copy[100][100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n\n  int i, j, k;\n  j = k = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    copy[j][k] = s1[i];\n    if (s1[i + 1] == ' ' || s1[i + 1] == '\u0000') {\n      copy[j][k + 1] = '\u0000';\n      k = 0;\n      j++;\n      i++;\n      continue;\n    }\n    k++;\n  }\n\n  for (k = 0; k < j; k++) {\n    if ((strcmp(copy[k], s2)) == 0) {\n      strcpy(copy[k], s3);\n    }\n  }\n  cout << copy[0];\n  for (k = 1; k < j; k++) {\n    printf(\" %s\", copy[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char w[1000], s[100][100], a[100], b[100];\n  int i = 0, j = 0, k = 0, d;\n\n  cin >> w;\n\n  cin >> a;\n\n  cin >> b;\n  while (w[i] != '\u0000') {\n    while (w[i] != ' ' && w[i] != '\u0000') {\n      s[j][k] = w[i];\n      i++;\n      k++;\n    }\n    s[j][k] = '\u0000';\n    j++;\n\n    k = 0;\n    while (w[i] == ' ') {\n      i++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    d = strcmp(s[i], a);\n    if (d == 0)\n      strcpy(s[i], b);\n  }\n  printf(\"%s\", s[0]);\n  for (i = 1; i < j; i++)\n    printf(\" %s\", s[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35397", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, flag = 0;\n  char s[100], a[100], b[100], temp[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (flag == 1 && s[i] != ' ') {\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 0 && s[i] != ' ') {\n      flag = 1;\n      j = 0;\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 1 && s[i] == ' ') {\n      temp[j] = '\u0000';\n      if (strcmp(temp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", temp);\n      flag = 0;\n      j = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  temp[j] = '\u0000';\n  if (strcmp(temp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", temp);\n  return 0;\n}\n"}
{"label": "19", "index": "35398", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n1, n2, n3, i, j;\n  char a1[100] = {'\u0000'}, a2[100] = {'\u0000'}, a3[100] = {'\u0000'};\n  char *p1 = &a1[0], *p2 = &a2[0], *p3 = &a3[0], *p_end, *p_in = &a1[0], *p,\n       *p_cyc = &a1[0];\n\n  cin >> a1;\n\n  cin >> a2;\n\n  cin >> a3;\n  n1 = strlen(a1);\n  n2 = strlen(a2);\n  n3 = strlen(a3);\n  p_end = &a1[n1 - 1];\n  for (p1 = &a1[0]; p1 <= p_end; p1++) {\n    if (*p2 == *p1) {\n      p_in = p1;\n      for (j = 0; j < n2; j++) {\n        if (*p2 != *p1) {\n          p1--;\n          break;\n        } else {\n          p2++;\n          p1++;\n        }\n      }\n      p2 = &a2[0];\n      if (j == n2 && *(p_in - 1) == ' ') {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      } else if (j == n2 && p_in == &a1[0]) {\n\n        if (n3 > n2) {\n          p = p_end;\n\n          while (p >= p1) {\n            *(p + n3 - n2) = *p;\n            p--;\n          }\n          p1 = p1 + n3 - n2;\n        }\n        if (n3 < n2) {\n          p = p1;\n          p1 = p + n3 - n2;\n\n          while (p <= p_end) {\n            *(p + n3 - n2) = *p;\n            p++;\n          }\n        }\n        p_end = p_end + n3 - n2;\n\n        while (p_in < p1) {\n          *p_in = *p3;\n          p_in++;\n          p3++;\n        }\n      }\n\n      p3 = &a3[0];\n    }\n  }\n  for (p = &a1[0]; p <= p_end; p++)\n    printf(\"%c\", *p);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35399", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, p[20] = {0}, q, h[10] = {0};\n  char str[200], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  m = strlen(str1);\n  q = strlen(str2);\n  n = strlen(str);\n  k = 0;\n  l = 0;\n  for (i = 0; i < n; i++) {\n    if (str[i] == str1[l]) {\n      l++;\n      if ((i + 1) < (n - 1)) {\n        if (l == m && str[i + 1] == ' ') {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      } else {\n        if (l == m) {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      }\n    } else {\n      l = 0;\n    }\n  }\n  j = 0;\n  i = 0;\n  do {\n    if (h[j] > 0) {\n      if (i == h[j] && k > 0 && str[h[j] - 1] == ' ') {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n    if (h[j] == 0) {\n      if (i == h[j] && k > 0) {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "19", "index": "35400", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1, len2, len3;\n  char a[100], b[100], c[100];\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  int i, j = 0, m, n, k, space[100];\n  space[0] = 0;\n  for (i = 0; i < len1; i++)\n    if (a[i] == ' ') {\n      j = j + 1;\n      space[j] = i + 1;\n    }\n  for (i = 0; i < j; i++) {\n    k = 0;\n    for (m = space[i]; m < space[i] + len2; m++) {\n      if (a[m] == b[m - space[i]])\n        k = k + 1;\n    }\n    if (k == len2 && a[space[i] + len2] == ' ')\n\n      cout << c << ' ';\n    else {\n      for (n = space[i]; n < space[i + 1]; n++)\n        cout << a[n];\n    }\n  }\n  k = 0;\n  for (i = space[j]; i < len1; i++)\n    if (a[i] == b[i - space[j]])\n      k = k + 1;\n  if (k == len2 && len1 - space[j] == len2)\n    cout << c;\n  else {\n    for (n = space[j]; n < len1; n++)\n      cout << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35401", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, w;\n  char a[100] = {0}, b[100] = {0}, c[100] = {0}, d[100][100] = {'\u0000'};\n  cin >> a;\n  cin >> b;\n  scanf(\"%s \", c);\n  char *pc, *pa, *pb, (*pd)[100];\n  pa = &a[0];\n  pb = &b[0];\n  pc = &c[0];\n  pd = d;\n  int k = 0, ll = strlen(c);\n  for (i = 0;; i++) {\n    for (j = 0; *(pa + k) != ' '; j++) {\n      if (*(pa + k) == '\u0000') {\n        (*(*(pd + i) + j)) = (*(pa + k));\n        break;\n      }\n      (*(*(pd + i) + j)) = (*(pa + k));\n      k++;\n    }\n    (*(*(pd + i) + j)) = '\u0000';\n    if ((*(pa + k)) == '\u0000')\n      break;\n    k++;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int l = strlen(d[i]);\n    for (j = 0; j < l + 1; j++) {\n      if ((*(*(pd + i) + j)) == (*(pb + j))) {\n        w = 1;\n        continue;\n      } else {\n        w = 0;\n        break;\n      }\n    }\n    if (w) {\n      for (k = 0; k < ll; k++)\n        (*(*(pd + i) + k)) = (*(pc + k));\n\n      (*(*(pd + i) + k)) = '\u0000';\n    } else\n      continue;\n  }\n  for (i = 0; i < count; i++) {\n    if (i > 0)\n      printf(\" \");\n    printf(\"%s\", d[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char buf1[100];\n  char buf2[100];\n  char buf3[100];\n  char *tmp;\n\n  cin >> buf1;\n\n  cin >> buf2;\n\n  cin >> buf3;\n  tmp = buf1;\n  while ((*tmp) != 0) {\n    if (strncmp(tmp, buf2, strlen(buf2)) == 0) {\n      if ((tmp == buf1 || *(tmp - 1) == ' ')) {\n        printf(\"%s\", buf3);\n        tmp += strlen(buf2);\n      } else {\n        printf(\"%c\", *tmp);\n        ++tmp;\n      }\n    } else {\n      printf(\"%c\", *tmp);\n      ++tmp;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35403", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint cincd(char a[]) {\n  int num = 0;\n  for (int i = 0;; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n    num++;\n  }\n  return num;\n}\nvoid coutt(char a[], int length) {\n  for (int i = 0; i < length; i++)\n    cout << a[i];\n}\nint main() {\n  char a[100][20], b[100], c[100];\n  int x = 0, d[100], e, f, num = 0;\n  for (int j = 0;; j++) {\n    a[x][j] = getchar();\n    if (a[x][j] == '\\n') {\n      d[x] = j;\n      num = x + 1;\n      break;\n    }\n    if (a[x][j] == ' ') {\n      d[x] = j;\n      x++;\n      j = -1;\n    }\n  }\n  e = cincd(b);\n  f = cincd(c);\n  for (int i = 0; i < num; i++) {\n    if (i != 0)\n      cout << \" \";\n    if (d[i] == e) {\n      int length = 0;\n      for (int j = 0; j < e; j++) {\n        if (a[i][j] == b[j])\n          length++;\n      }\n      if (length == e)\n        coutt(c, f);\n      else\n        coutt(a[i], d[i]);\n      continue;\n    } else\n      coutt(a[i], d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35404", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[10] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  int i;\n  char a2[100];\n  a2[0] = ' ';\n  a2[1] = a[0];\n  for (i = 1; a[i - 1] != '\u0000'; i++) {\n    a2[i + 1] = a[i];\n  }\n\n  char tmp[100];\n  char s2[100] = {'\u0000'};\n\n  int j;\n  tmp[0] = s[0];\n  for (i = 1; s[i - 1] != ' ' && s[i - 1] != '\u0000'; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      tmp[i] = '\u0000';\n    } else {\n      tmp[i] = s[i];\n    }\n  }\n  if (strcmp(tmp, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", tmp);\n  }\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; s[j] != ' ' && s[j] != '\u0000'; j++) {\n        tmp[0] = ' ';\n        if (s[j + 1] == ' ' || s[j + 1] == '\u0000') {\n          tmp[j - i] = s[j];\n          tmp[j - i + 1] = '\u0000';\n        } else {\n          tmp[j - i] = s[j];\n        }\n      }\n    } else\n      continue;\n\n    if (strcmp(tmp, a2) == 0) {\n      printf(\"%s\", c);\n      printf(\"%s\", b);\n    } else\n      printf(\"%s\", tmp);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35405", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *str, *s1, *s2, (*s)[101];\n  int i, j = 0, k = 0;\n  str = (char *)malloc(101);\n  s1 = (char *)malloc(101);\n  s2 = (char *)malloc(101);\n  s = (char(*)[101])calloc(101, 101);\n\n  cin >> str;\n  cin >> s1 >> s2;\n  for (i = 0; *(str + i) != '\u0000'; i++) {\n    if (*(str + i) == ' ') {\n      k++;\n      j = 0;\n    } else if (*(str + i) != ' ') {\n      *(*(s + k) + j) = *(str + i);\n      j++;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    if (strcmp(*(s + i), s1) == 0)\n      strcpy(*(s + i), s2);\n  printf(\"%s\", *s);\n  for (i = 1; i <= k; i++)\n    printf(\" %s\", *(s + i));\n}\n"}
{"label": "19", "index": "35406", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], a[100][100];\n  int i, j = 0, t = 0, l, m, n, k = -1, f = 1;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  m = strlen(str1);\n  l = strlen(str2);\n  str1[m] = '\u0000';\n  for (j = 0; i <= m; j++) {\n    for (i = k + 1, n = 0; i <= m; i++, n++) {\n      if (str1[i] != ' ' && str1[i] != '\u0000') {\n        a[j][n] = str1[i];\n      } else {\n        a[j][n] = '\u0000';\n        k = i;\n        break;\n      }\n    }\n  }\n  k = j - 1;\n  for (j = 0; j < k; j++) {\n    f = 1;\n    t = strlen(a[j]);\n    if (l != t) {\n      printf(\"%s\", a[j]);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n      continue;\n    } else {\n      for (i = 0; i < l; i++) {\n        if (a[j][i] != str2[i]) {\n          printf(\"%s\", a[j]);\n          if (j < k - 1) {\n            printf(\" \");\n          }\n          f = 0;\n          break;\n        }\n      }\n    }\n    if (f == 1) {\n      printf(\"%s\", str3);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n    }\n  }\n}\n"}
{"label": "19", "index": "35407", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s;\n  char *a;\n  char *b;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 1000);\n  b = (char *)malloc(sizeof(char) * 1000);\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0) {\n      ans[index] = s[i];\n    }\n    index++;\n  }\n  printf(\"%s \", ans);\n  free(a);\n  free(b);\n  free(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35408", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[10000];\n  char tmp[105], a[105], b[105];\n  int i, j;\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0, j = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, tmp) == 0) {\n        printf(\"%s \", b);\n      } else {\n        printf(\"%s \", tmp);\n      }\n    } else {\n      tmp[j] = s[i];\n      j++;\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(a, tmp) == 0) {\n    printf(\"%s \", b);\n  } else\n    printf(\"%s \", tmp);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sz[100], zfc[20][20], a[20], b[20];\n\n  scanf(\"%s \", sz);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int i, j = 0, k = 0;\n  for (i = 0; i <= strlen(sz); i++) {\n    if (sz[i] != '\u0000' && sz[i] != ' ') {\n      zfc[j][k] = sz[i];\n      k++;\n    }\n    if (sz[i] == '\u0000' || sz[i] == ' ') {\n      zfc[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(zfc[i], a) == 0)\n      strcpy(zfc[i], b);\n  }\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < j; i++) {\n    cout << \" \" << zfc[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35410", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char danchi[1000];\n  char e[50][1000], a[1000], b[1000];\n  cin >> danchi;\n  scanf(\"%s %s\", a, b);\n  int i, j, g = 0, l = 0, v = 0, m = 0;\n  int max = 0, min = 100, max1, min1;\n\n  int c = strlen(danchi);\n  for (j = 0; j < 50; j++) {\n    l = 0;\n    for (i = g; i < 1000; i++) {\n      if (danchi[i] == ' ') {\n        m++;\n        break;\n      }\n      e[j][l] = danchi[i];\n      g++;\n      l++;\n      v++;\n    }\n    g++;\n    v++;\n\n    if (v > c)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    if (strcmp(e[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", e[i]);\n    }\n  }\n  if (strcmp(e[m], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", e[m]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35411", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][101];\n  char a[101], b[101];\n  int i, j;\n  cin >> s[0];\n  for (i = 1; getchar() != ' '; i++) {\n    scanf(\"%s\", s[i]);\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (j = 0; j < i; j++) {\n    if (strcmp(s[j], a) == 0)\n      strcpy(s[j], b);\n  }\n  printf(\"%s\", s[0]);\n  for (j = 1; j < i; j++) {\n    cout << \" \" << s[j];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], copy[100][100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n\n  int i, j, k;\n  j = k = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    copy[j][k] = s1[i];\n    if (s1[i + 1] == ' ' || s1[i + 1] == '\u0000') {\n      copy[j][k + 1] = '\u0000';\n      k = 0;\n      j++;\n      i++;\n      continue;\n    }\n    k++;\n  }\n\n  for (k = 0; k < j; k++) {\n    if ((strcmp(copy[k], s2)) == 0) {\n      strcpy(copy[k], s3);\n    }\n  }\n  cout << copy[0];\n  for (k = 1; k < j; k++) {\n    cout << \" \" << copy[k];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35413", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], c[203];\n  s[0] = a[0] = b[0] = ' ';\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  int slen = strlen(s) + 1, alen = strlen(a) + 1, blen = strlen(b) + 1;\n  s[slen - 1] = a[alen - 1] = b[blen - 1] = ' ';\n  s[slen] = a[alen] = b[blen] = '\u0000';\n  int i, j;\n  for (i = 0, j = 0; i < slen; ++i, ++j) {\n    if (strncmp(s + i, a, alen) == 0) {\n      strcpy(c + j, b);\n      i = i + alen - 1;\n      j = j + blen - 1;\n    } else {\n      c[j] = s[i];\n    }\n  }\n  c[j - 1] = 0;\n  cout << &c[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35414", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][100];\n  int i, j, l = 0;\n  while (cin >> s[l++])\n    ;\n  l--;\n  for (i = 0; i < l - 2; i++) {\n    if (strcmp(s[i], s[l - 2]) == 0) \n    {\n      for (j = 0; j <= strlen(s[l - 1]); j++)\n        s[i][j] = s[l - 1][j]; \n    }\n  }\n  for (i = 0; i < l - 3; i++)\n    cout << s[i] << ' '; \n  cout << s[l - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "35415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int m, n, i, j, l, sum = 0, k = 0;\n  char s[100], a[10], b[10], c[10];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  l = strlen(b);\n  for (i = 0; i <= n - 1;) {\n    if ((s[i] == a[0] && i == 0) || (s[i] == a[0] && s[i - 1] == ' ')) {\n      j = 0;\n      while ((s[i + j] != ' ') && ((i + j) != n)) {\n        c[j] = s[i + j];\n        j++;\n      }\n      c[j] = '\u0000';\n      if (strcmp(c, a) == 0) {\n        printf(\"%s \", b);\n        i = i + m + 1;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35416", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint cincd(char a[]) {\n  int num = 0;\n  for (int i = 0;; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n    num++;\n  }\n  return num;\n}\nvoid coutt(char a[], int length) {\n  for (int i = 0; i < length; i++)\n    cout << a[i];\n}\nint main() {\n  char a[100][20], b[100], c[100];\n  int x = 0, d[100], e, f, num = 0;\n  for (int j = 0;; j++) {\n    a[x][j] = getchar();\n    if (a[x][j] == '\\n') {\n      d[x] = j;\n      num = x + 1;\n      break;\n    }\n    if (a[x][j] == ' ') {\n      d[x] = j;\n      x++;\n      j = -1;\n    }\n  }\n  e = cincd(b);\n  f = cincd(c);\n  for (int i = 0; i < num; i++) {\n    if (i != 0)\n      printf(\" \");\n    if (d[i] == e) {\n      int length = 0;\n      for (int j = 0; j < e; j++) {\n        if (a[i][j] == b[j])\n          length++;\n      }\n      if (length == e)\n        coutt(c, f);\n      else\n        coutt(a[i], d[i]);\n      continue;\n    } else\n      coutt(a[i], d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35417", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char str[101], str1[101], str2[101], str3[101][101];\n  scanf(\"%s \", str);\n  scanf(\"%s \", str1);\n  cin >> str2;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str3[k][j] = str[i];\n      j++;\n    } else {\n      str3[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  str3[k][j] = '\u0000';\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0) {\n      if (i == 0)\n        printf(\"%s\", str2);\n      else\n        printf(\" %s\", str2);\n    } else {\n      if (i == 0)\n        printf(\"%s\", str3[i]);\n      else\n        printf(\" %s\", str3[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35418", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[101], z[11], s[16][11];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> z;\n  int i, j, m, n, l, q[22];\n  for (i = 0, m = 0, n = 0; b[i] != '\u0000'; i++) {\n    if (b[i] != ' ') {\n      s[m][n] = b[i];\n      n++;\n\n    } else {\n\n      q[m] = n;\n      n = 0;\n      m++;\n    }\n  }\n  q[m] = n;\n  for (i = 0, j = 0; i <= m; i++) {\n    if (a[0] == s[i][0]) {\n      l = 1;\n      for (j = 0; j < q[i]; j++) {\n        if (a[j] != s[i][j]) {\n          l = 0;\n        }\n        if (q[i] != strlen(a)) {\n          l = 0;\n        }\n      }\n      if (l) {\n        for (j = 0; z[j] != '\u0000'; j++) {\n          s[i][j] = z[j];\n        }\n        q[i] = j;\n      }\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < q[i]; j++) {\n      cout << s[i][j];\n    }\n    cout << \" \";\n  }\n\n  for (j = 0; j < q[m]; j++) {\n    printf(\"%c\u0000\", s[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35419", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, b = 0;\n  char s[80], s0[20], s2[20], s3[20];\n  char s1[100] = {'\u0000'};\n\n  cin >> s;\n\n  cin >> s0;\n\n  cin >> s2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      s3[b] = s[i];\n      b++;\n    }\n    if (s[i] == ' ') {\n      s3[b] = '\u0000';\n      if (strcmp(s3, s0) == 0) {\n        strcat(s1, s2);\n        strcat(s1, \" \");\n      } else {\n        strcat(s1, s3);\n        strcat(s1, \" \");\n      }\n      b = 0;\n    }\n  }\n  s3[b] = '\u0000';\n  if (strcmp(s3, s0) == 0) {\n    strcat(s1, s2);\n  } else\n    strcat(s1, s3);\n\n  puts(s1);\n  return 0;\n}\n"}
{"label": "19", "index": "35420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i <= n - 1; i++) {\n    if (i == 0 && s[0] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[j] != a[j])\n          break;\n      if (j == m && s[m] == ' ') {\n        printf(\"%s\", b);\n        i = i + m;\n      }\n    }\n    if (s[i] == ' ' && s[i + 1] == a[0]) {\n      for (j = 1; j <= m - 1; j++)\n        if (s[i + j + 1] != a[j])\n          break;\n      if (j == m && (s[i + j + 1] == ' ' || s[i + j + 1] == '\u0000')) {\n        printf(\" %s\", b);\n        i = i + m + 1;\n      }\n    }\n    if (s[i] != '\u0000')\n      printf(\"%c\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "35421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, r = 1, j;\n  char a[100], b[100], c[200];\n\n  cin >> c;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < 100; i++) {\n    if (c[i] == 'G' && c[i + 1] == 'I' && c[i + 2] == 'S' && c[i - 1] == ' ') {\n      for (j = 100 + r * 3; j >= (i + 3); j--)\n        c[j] = c[j - 3];\n      r = r + 1;\n      c[i] = 'W';\n      c[i + 1] = 'e';\n      c[i + 2] = 'b';\n    }\n    if (c[i] == 'Y' && c[i + 1] == 'o' && c[i + 2] == 'u') {\n\n      c[i] = 'I';\n      for (j = i + 1; j < 100; j++)\n        c[j] = c[j + 2];\n    }\n    if (c[i] == 'o' && c[i + 1] == 'f' && c[i - 1] == ' ') {\n      for (j = 100 + r * 1; j >= (i + 1); j--)\n        c[j] = c[j - 1];\n      r = r + 1;\n      c[i] = 'f';\n      c[i + 1] = 'o';\n      c[i + 2] = 'r';\n    }\n  }\n  printf(\"%s\", c);\n}\n"}
{"label": "19", "index": "35422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100][100];\n  int k = 0, y = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (int i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      t[k][i] = '\u0000';\n      k++;\n      y = i + 1;\n    } else\n      t[k][i - y] = s[i];\n  }\n  for (int j = 0; j <= k; j++) {\n    if (strcmp(t[j], a) == 0)\n      strcpy(t[j], b);\n  }\n  for (int x = 0; x < k; x++)\n    printf(\"%s \", t[x]);\n  printf(\"%s\", t[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "35423", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], str1[100], str2[100], a[100][100];\n\n  cin >> s;\n  int len = strlen(s);\n\n  cin >> str1;\n\n  cin >> str2;\n  int lenth = strlen(str2);\n  int i, j, p;\n  for (i = 0, j = 0, p = 0; j < len; j++) {\n    a[i][p++] = s[j];\n    if (s[j + 1] == ' ') {\n      j = j + 1;\n      a[i][p] = '\u0000';\n      i = i + 1;\n      p = 0;\n    }\n  }\n  a[i][p] = '\u0000';\n  int num = i;\n  int judge = 0;\n  for (i = 0; i < num + 1; i++) {\n    if (strcmp(a[i], str1) == 0) {\n      for (j = 0; j < lenth; j++) {\n        a[i][j] = str2[j];\n      }\n      a[i][lenth] = '\u0000';\n      judge = 1;\n    }\n  }\n\n  if (judge == 0)\n    printf(\"%s \", s);\n  else {\n    printf(\"%s\", a[0]);\n    for (i = 1; i < num + 1; i++) {\n      printf(\" %s\", a[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35424", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100], zfc2[20][100];\n  int len, i, t = 1, lenall, judge = 1, num[100], k = 1;\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s\", in);\n  scanf(\"%s\", out);\n  len = strlen(in);\n  lenall = strlen(zfc);\n  num[0] = 0;\n  for (i = 0; i < lenall; i++) {\n    if (zfc[i] == ' ') {\n      num[k] = i + 1;\n      zfc[i] = 0;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(zfc2[i], &zfc[num[i]]);\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(&zfc[num[i]], in) == 0) {\n      strcpy(zfc2[i], out);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", zfc2[i]);\n  }\n  cout << zfc2[k - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char wordbuff[50][20], ch, target[20], replace[20];\n  int i, j;\n  for (i = 0; i < 50; i++)\n    for (j = 0; j < 20; j++)\n      wordbuff[i][j] = '\\0';\n\n  i = 0;\n  j = 0;\n  while (1) {\n    ch = getchar();\n    if (ch != '\\n' && ch != ' ') {\n      wordbuff[i][j] = ch;\n      j++;\n    } else {\n      i++;\n      j = 0;\n    }\n    if (ch == '\\n')\n      break;\n  }\n  scanf(\"%s\\n%s\", target, replace);\n  int n;\n  for (n = 0; n < i; n++) {\n    if (!strcmp(wordbuff[n], target))\n      strcpy(wordbuff[n], replace);\n  }\n  for (n = 0; n < i; n++)\n    if (!n)\n      cout << wordbuff[n];\n    else\n      cout << \" \" << wordbuff[n];\n  return 0;\n}\n"}
{"label": "19", "index": "35426", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  cin >> b;\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) { \n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    } \n    if (((num == lb) && (a[i - k - 1] == ' ')) ||\n        ((num == lb) && (i == k))) { \n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      } \n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    } \n  }\n  cout << d << endl; \n  return 0;          \n}\n"}
{"label": "19", "index": "35427", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0, l;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  l = strlen(A);\n  for (i = 0; i < l; i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    l = strcmp(C[i], B);\n    if (l == 0)\n      strcpy(C[i], T);\n  }\n  for (i = 0; i < j; i++)\n    cout << C[i] << \" \";\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35428", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][20], m, b[20], c[20];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      strcpy(a[j], c);\n    }\n  }\n\n  for (j = 0; j < i; j++)\n    printf(\"%s \", a[j]);\n  printf(\"%s\", a[i]);\n}\n"}
{"label": "19", "index": "35429", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char s[100], a[100], b[100];\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  for (i = 0, j = 0; s[i] != '\\0';) {\n    if (s[i + j] == a[j] && (s[i - 1] == ' ' || i == 0))\n      j++;\n    else {\n      printf(\"%c\", s[i]);\n      i++;\n      j = 0;\n    }\n    if (a[j] == '\\0' && (s[i + j] == ' ' || s[i + j] == '\\0')) {\n      printf(\"%s\", b);\n      i += j;\n      j = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35430", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, l1, l2, e = 0;\n\n  cin >> s;\n  scanf(\"%s %s\", a, b);\n  getchar();\n  l1 = strlen(s);\n  l2 = strlen(a);\n  for (i = 0; i < l1; i++) {\n    if (i == 0) {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i + l2] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n    } else {\n      if (a[0] == s[i] && a[l2 - 1] == s[i + l2 - 1] && s[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i += l2 - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n    }\n  }\n  printf(\" \");\n  getchar();\n  return 0;\n}\n"}
{"label": "19", "index": "35431", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100], t;\n  int i, j;\n  for (i = 0; i <= 100; i++) {\n    scanf(\"%s\", a[i]);\n    t = getchar();\n    if (t != ' ') {\n      j = i;\n      break;\n    }\n  }\n\n  cin >> b;\n\n  cin >> c;\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\" %s\", c);\n    else\n      printf(\" %s\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35432", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char words[20][100], sub[100], subed[100];\n  char string[500];\n  int i, d1 = 0, d2 = 0, len, n = 1;\n  char(*p)[100];\n\n  scanf(\"%s \", string);\n  len = strlen(string);\n  for (i = 0, d2 = 0; i < len && d2 < 100; i++, d2++) {\n    if (string[i] == ' ') {\n      words[d1][d2] = '\u0000';\n      d1++;\n      n++;\n      d2 = 0;\n    }\n    if (string[i] == ' ')\n      continue;\n    if (string[i - 1] == ' ')\n      d2--;\n    words[d1][d2] = string[i];\n  }\n  words[d1][d2] = '\u0000';\n  p = words;\n  scanf(\"%s\", subed);\n  cin >> sub;\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), subed) == 0)\n      strcpy(*(p + i), sub);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", p + i);\n  printf(\"%s\", p + n - 1);\n}\n"}
{"label": "19", "index": "35433", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][100] = {'\\0'}; \n  char a[100], b[100];\n  int i, j;\n\n  cin >> s[0];\n  i = 1;\n  while (cin.peek() == ' ') {\n    cin >> s[i++];\n  }\n  cin >> a >> b;\n\n  for (i = 0; s[i][0] != '\\0'; i++) {\n    if (strcmp(a, s[i]) == 0) {\n      strcpy(s[i], b);\n    }\n  }\n\n  cout << s[0];\n  for (i = 1; s[i][0] != '\\0'; i++)\n    cout << \" \" << s[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35434", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i = 0, n;\n  char *s[100];\n  s[0] = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n    s[i] = (char *)malloc(100 * sizeof(char));\n  }\n  n = i;\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(*(s + i), *(s + n - 2)) == 0)\n      strcpy(*(s + i), *(s + n - 1));\n    if (i != n - 3)\n      cout << *(s + i) << \" \";\n    else\n      cout << *(s + i);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35435", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str1[150], str2[50], str3[50];\nchar *p1 = str1, *p2 = str2, *p3 = str3;\n\nint compare(char *local, int len) {\n  p2 = str2;\n  char *p;\n  int flag = 1;\n  for (p = local; *p2 != '\u0000' && flag == 1 && p < local + len; p2++, p++)\n    if (*p != *p2)\n      flag = 0;\n  if (*p2 == '\u0000' && p == local + len)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  char newline[150];\n  char *news = newline, *local, *p;\n  int flag = 1, len = 0;\n\n  cin >> p1;\n  cin >> p2;\n  cin >> p3;\n  for (p1 = str1; p1 <= str1 + strlen(str1); p1++) {\n    if (isalpha(*p1))\n      if (flag == 1)\n        flag = 0, len = 1, local = p1;\n      else\n        len++;\n    else if (flag == 0) {\n      flag = 1;\n      if (compare(local, len))\n        for (p3 = str3; *p3 != '\u0000'; p3++, news++)\n          *news = *p3;\n      else\n        for (p = local; p < local + len; p++, news++)\n          *news = *p;\n      *news++ = *p1;\n    }\n  }\n  *news = '\u0000';\n  for (news = newline; *news != '\u0000'; news++)\n    printf(\"%c\", *news);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35436", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], a[10], b[10], word[50][15];\n  int i = 0, n, j = 0, k = 0;\n  cin.getline(str, 100);\n  cin.getline(a, 10);\n  cin.getline(b, 10);\n  n = strlen(str);\n  while (i < n) {\n    while (str[i] != ' ')\n      word[j][k++] = str[i++];\n    word[j][k] = '\\0';\n    k = 0;\n    j++;\n    i++;\n  }\n  for (i = 0; i < j - 1; i++) {\n    if (strcmp(a, word[i]) == 0)\n      cout << b << \" \";\n    else {\n      cout << word[i] << \" \";\n    }\n  }\n\n  if (strcmp(a, word[i]) == 0)\n    printf(\"%s\\n\", b);\n  else\n    printf(\"%s\\n\", word[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20], str2[20], *p, str3[40][20], STR[100] = \"\";\n  int i, k, m, x;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  k = 0;\n  m = 0;\n  for (p = str; *p != '\u0000'; p++) {\n    str3[k][m] = *p;\n    m++;\n    if (isalpha(*p) * isalpha(*(p + 1)) == 0) {\n      str3[k][m] = '\u0000';\n      k++;\n      m = 0;\n    }\n  }\n  str3[k][m] = '\u0000';\n  x = k;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0)\n      strcpy(str3[i], str2);\n  }\n  for (i = 0; i <= k; i++) {\n    strcat(STR, str3[i]);\n  }\n  printf(\"%s\", STR);\n}\n"}
{"label": "19", "index": "35438", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char m[100], z[100], t[100];\n\n  cin >> m;\n\n  cin >> z;\n\n  cin >> t;\n  char fz[100][100];\n  int len1 = strlen(m);\n  int i, k = 0, j = 0, num = 1;\n\n  for (i = 0; i < len1; i++) {\n    if (m[i] != 32) {\n      fz[k][j] = m[i];\n      j++;\n    } else {\n      num++;\n      k++;\n      j = 0;\n    }\n  }\n  for (k = 0; k < num; k++) {\n    if (k != num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s \", fz[k]);\n      } else {\n        printf(\"%s \", fz[k]);\n      }\n    }\n    if (k == num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s\", fz[k]);\n      } else {\n        cout << fz[k];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35439", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  scanf(\"%s \", a);\n  scanf(\"%s%s\", b, c);\n  int i, j, k, strat;\n  strat = 0;\n  for (i = strat; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0])\n      for (j = 1, k = i + 1; j < strlen(b); j++, k++)\n        if (b[j] != a[k])\n          break;\n    if (j == strlen(b) && i == 0) {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n\n    else if (j == strlen(b) && a[i - 1] == ' ') {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n    j = 0;\n  }\n  for (i = strat; a[i] != '\u0000'; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35440", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char s[100], a[100], b[100];\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  for (i = 0, j = 0; s[i] != '\\0';) {\n    if (s[i + j] == a[j] && (s[i - 1] == ' ' || i == 0))\n      j++;\n    else {\n      printf(\"%c\", s[i]);\n      i++;\n      j = 0;\n    }\n    if (a[j] == '\\0' && (s[i + j] == ' ' || s[i + j] == '\\0')) {\n      cout << b;\n      i += j;\n      j = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  char(*s)[100], *a, *b;\n  s = (char(*)[100])malloc(100 * 100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF)\n    i++;\n\n  n = i;\n  strcpy(a, *(s + n - 2));\n  strcpy(b, *(s + n - 1));\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(a, *(s + i)) == 0) {\n      strcpy(*(s + i), b);\n    }\n  }\n  for (i = 0; i < n - 3; i++)\n    printf(\"%s \", *(s + i));\n\n  printf(\"%s\", *(s + n - 3));\n  return 0;\n}\n"}
{"label": "19", "index": "35442", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], s_[200][200], s__[200];\n  int i, n = 0, m, j = 0, p = 0;\n\n  scanf(\"%s \", s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    s__[i] = s[i];\n  }\n  s__[i] = ' ';\n  s__[i + 1] = '\u0000';\n  scanf(\"%s%s\", a, b);\n  for (i = 0; s__[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    if (s__[i] == ' ') {\n      s_[j][p] = '\u0000';\n      j++;\n      p = 0;\n    } else {\n      s_[j][p] = s__[i];\n      p++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++) {\n    if (strcmp(s_[j], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", s_[j]);\n    }\n  }\n  if (strcmp(s_[m - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", s_[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35443", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100];\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  for (i = 0; i < m; i++)\n    if (s[i] == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; s[k] != 32; j++) {\n      c[i][j] = s[k];\n      k++;\n    }\n    if (s[k] == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n}\n"}
{"label": "19", "index": "35444", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char stc[201], wrd1[101], wrd2[101], wrdd[100][101];\n  int i, j = 0, k = 0, l = 0;\n\n  scanf(\"%s \", stc);\n\n  cin >> wrd1;\n\n  cin >> wrd2;\n\n  for (i = 0; stc[i] != '\u0000'; i++) {\n    if (stc[i] != ' ')\n      wrdd[j][k] = stc[i], k++;\n    else\n      wrdd[j][k] = '\u0000', j++, k = 0;\n  }\n\n  for (i = 0; i <= j; i++)\n    if (strcmp(wrd1, wrdd[i]) == 0)\n      strcpy(wrdd[i], wrd2);\n\n  for (i = 0, k = 0; l <= j; i++) {\n    if (wrdd[l][k] != '\u0000')\n      stc[i] = wrdd[l][k], k++;\n    else\n      stc[i] = ' ', l++, k = 0;\n  }\n  stc[i - 1] = '\u0000';\n  puts(stc);\n}\n"}
{"label": "19", "index": "35445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000], b[50], e[50];\n  int c[1000], d[1000];\n  int i, n, flag1 = 0, j = 0, m, k, x, l, flag2 = 0, g;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> e;\n  n = strlen(a);\n  x = strlen(b);\n  d[0] = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ' && flag1 == 0) {\n      c[j] = i;\n      d[j + 1] = i + 1;\n      j++;\n      flag1 = 1;\n      m = i;\n    } else {\n      if (a[i] == ' ') {\n        c[j] = i - m - 1;\n        d[j + 1] = i + 1;\n        j++;\n        m = i;\n      }\n    }\n  }\n  c[j] = n - 1 - m;\n  k = j + 1;\n  for (j = 0; j < k; j++) {\n\n    if (c[j] == x) {\n      g = 0;\n      for (l = d[j]; l < d[j] + c[j]; l++, g++) {\n        if (b[g] != a[l])\n          flag2 = 1;\n      }\n      g = 0;\n      if (flag2 == 0) {\n        if (j == 0)\n          printf(\"%s\", e);\n        else\n          printf(\" %s\", e);\n      } else {\n        if (j == 0)\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        else {\n          printf(\" \");\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        }\n      }\n      flag2 = 0;\n    } else {\n      if (j == 0)\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      else {\n        printf(\" \");\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35446", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[101], target[10001], a[101], b[101], c[101];\nint i = 0, j = 0, k = 0, len_str, len_a, len_b, pos = 0, t = 0;\nint main(void) {\n\n  cin >> str;\n  len_str = strlen(str);\n  scanf(\"%s %s \", a, b);\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      printf(\" \");\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35447", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"}, *p, *q;\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  p = c;\n  q = d;\n  for (i = 0;;) {\n    for (j = 0; *(p + i) != ' ' && *(p + i) != '\u0000'; i++, j++)\n      *(q + j) = *(p + i);\n    *(q + j) = '\u0000';\n    if (strcmp(d, a) == 0)\n      cout << b;\n    else\n      for (k = 0; k < j; k++)\n        cout << *(q + k);\n    if (*(p + i) != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35448", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char str[101], str1[101], str2[101], str3[101][101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str3[k][j] = str[i];\n      j++;\n    } else {\n      str3[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  str3[k][j] = '\u0000';\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0) {\n      if (i == 0)\n        printf(\"%s\", str2);\n      else\n        printf(\" %s\", str2);\n    } else {\n      if (i == 0)\n        printf(\"%s\", str3[i]);\n      else\n        printf(\" %s\", str3[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35449", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p, *q;\n  int k, m = 0;\n  char *s, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  scanf(\"%s \", s);\n  scanf(\"%s %s\", a, b);\n\n  k = strlen(a);\n  p = s;\n  q = a;\n\n  while (*p != '\u0000') {\n\n    if (m == k) {\n      if (*p == ' ' || *p == '\u0000') {\n        printf(\"%s\", b);\n        m = 0;\n        q = a;\n      } else {\n        printf(\"%s\", a);\n        m = 0;\n        q = a;\n      }\n    }\n\n    if (*p == *q) {\n      m++;\n      if (m == 1) {\n        if (p == s) {\n          p++;\n          q++;\n        } else {\n          p--;\n          if (*p == ' ') {\n            p = p + 2;\n            q++;\n          } else {\n            m = 0;\n            q = a;\n            p++;\n            printf(\"%c\", *p);\n            p++;\n          }\n        }\n      } else {\n        p++;\n        q++;\n      }\n    } else {\n      p = p - m;\n      printf(\"%c\", *p);\n      m = 0;\n      q = a;\n      p++;\n    }\n  }\n  if (m == k)\n    printf(\"%s\", b);\n}\n"}
{"label": "19", "index": "35450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200] = {0};\n  char a[100] = {0}, b[100] = {0};\n  int c[200] = {0};\n  int lena = 0, lenb = 0, lens = 0, i = 0, j = 0, k = 0, count = 0, t = 0;\n  cin.get(s, 200, '\\n');\n  scanf(\"%s %s \", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  lens = strlen(s);\n  if ((s[0] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0)) {\n    for (j = 0; j < lena; j++) {\n      if (s[i + j] == a[j])\n        count++;\n    }\n    if (count == lena)\n      k++;\n    count = 0;\n  }\n  for (i = 1; i < lens; i++, count = 0) {\n    if ((s[i] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0) &&\n        (s[i - 1] == 32)) {\n      for (j = 0; j < lena; j++) {\n        if (s[i + j] == a[j])\n          count++;\n      }\n      if (count == lena) {\n        c[k] = i;\n        k++;\n      }\n    }\n  }\n  c[k] = 201;\n  if (lena < lenb) {\n    t = lenb - lena;\n    for (i = lens - 1; i >= 0; i--)\n      for (j = k - 1; j >= 0; j--) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i + (j + 1) * t] = s[i];\n      }\n    for (i = 0; i < k; i++)\n      for (j = 0; j < lenb; j++)\n        s[c[i] + i * t + j] = b[j];\n  } else if (lena >= lenb) {\n    t = lena - lenb;\n    for (i = c[0] + t; i < lens; i++)\n      for (j = 0; j < k; j++) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i] = s[i + (j + 1) * t];\n      }\n    b[lenb] = 32;\n    for (i = 0; i < k; i++)\n      for (j = 0; j <= lenb; j++)\n        s[c[i] - i * t + j] = b[j];\n  }\n  int l = strlen(s);\n  if (s[l - 1] == 32)\n    s[l - 1] = 0;\n  cout << s;\n  return 0;\n}\n"}
{"label": "19", "index": "35451", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c = ' ';\n  char *str1, *str2;\n  str1 = (char *)malloc(100 * sizeof(char));\n  str2 = (char *)malloc(100 * sizeof(char));\n  char str[100][100];\n  int i, n = 0;\n  for (i = 0; i < 100; i++) {\n    strcpy(str[i], \"\\0\");\n    scanf(\"%s\", str[i]);\n    if (c = getchar() != ' ')\n      break;\n    n++;\n  }\n  strcpy(str1, \"\\0\");\n  strcpy(str2, \"\\0\");\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(str1, str[i]) == 0)\n      strcpy(str[i], str2);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35452", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[30][20] = {\"\"}, b[20] = {\"\"}, c[20] = {\"\"};\n  int i, num = 1;\n  scanf(\"%s\", a[0]);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], b) == 0) {\n      strcpy(a[i], c);\n    }\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35453", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[10000], a[101], b[101];\n  int l0, l1, l2, i, j, k, counter;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  l0 = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  i = 0;\n  if (s[i] == a[0]) {\n    counter = 0;\n    for (j = i + 1; j < i + l1; j++) {\n      if (s[j] != a[j - i])\n        counter++;\n    }\n    if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n      counter++;\n    if (counter == 0) {\n      if (l1 >= l2) {\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n        for (j = i + l1; j <= l0; j++)\n          s[j - (l1 - l2)] = s[j];\n      }\n      if (l2 > l1) {\n        for (j = l0; j >= i + l1; j--)\n          s[j - (l1 - l2)] = s[j];\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n      }\n    }\n  }\n  for (i = 1; i < l0; i++) {\n    if (s[i] == a[0]) {\n      counter = 0;\n      for (j = i + 1; j < i + l1; j++) {\n        if (s[j] != a[j - i])\n          counter++;\n      }\n      if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n        counter++;\n      if (s[i - 1] != ' ')\n        counter++;\n      if (counter == 0) {\n        if (l1 >= l2) {\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n          for (j = i + l1; j <= l0; j++)\n            s[j - (l1 - l2)] = s[j];\n        }\n        if (l2 > l1) {\n          for (j = l0; j >= i + l1; j--)\n            s[j - (l1 - l2)] = s[j];\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n        }\n        l0 += l2 - l1;\n      }\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101], q[101];\n  int m, i, k, t, n, l, N, z = 0;\n\n  cin >> a;\n  m = strlen(a);\n  strcpy(q, a);\n\n  scanf(\"%s%s\", &b, &c);\n  n = strlen(b);\n  l = strlen(c);\n\n  for (i = 0; i < m; i++) {\n    N = n;\n\n    if ((i == 0) ||\n        (a[i - 1] == 32 && a[i] == b[0] && (a[i + n] == 32 || a[i + n] == '\u0000')))\n      for (k = i, t = 0; t < n && k < m; k++, t++) {\n        if (a[k] == b[t])\n          N--;\n      }\n    if (N == 0) {\n      z = 1;\n\n      if (n >= l) {\n        for (k = 0, t = i; k < l; t++, k++)\n          a[t] = c[k];\n\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n        {\n          a[k + l + 1] = q[k + n + 1];\n        }\n        a[m - (n - l)] = '\u0000';\n      }\n      if (n < l) {\n        for (k = 0, t = i; k < l; t++, k++) {\n          a[t] = c[k];\n        }\n        a[i + l] = ' ';\n        for (k = i; k < m - (n + 1); k++)\n\n          a[k + l + 1] = q[k + n + 1];\n        a[m + (l - n)] = '\u0000';\n      }\n      m = strlen(a);\n      strcpy(q, a);\n    }\n  }\n\n  if (z == 1)\n    printf(\"%s\", a);\n  if (z == 0 && N != 0)\n\n    for (i = 0; i < m; i++)\n      cout << q[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str1[1000], str2[100], str3[100], str4[100], str5[2] = \" \",\n                                                    str[100] = \"\";\n  int i, k = 0;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  for (i = 0; str1[i] != '\u0000'; i++) {\n    if (str1[i] != ' ') {\n      str4[k] = str1[i];\n      k = k + 1;\n    } else {\n      str4[k] = '\u0000';\n      k = 0;\n      if (strcmp(str4, str2) == 0)\n        strcat(str, str3);\n      else\n        strcat(str, str4);\n      strcat(str, str5);\n    }\n  }\n  str4[k] = '\u0000';\n  if (strcmp(str4, str2) == 0)\n    strcat(str, str3);\n  else\n    strcat(str, str4);\n  cout << str;\n}\n"}
{"label": "19", "index": "35456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, c[102], k = 0, s;\n  char a[102], b[102], d[102];\n\n  cin >> a + 1;\n  cin >> b + 1;\n  cin >> d + 1;\n  i = 1;\n  j = 1;\n  while (i <= strlen(a + 1) && j <= strlen(b + 1)) {\n    if (a[i] == b[j]) {\n      i++;\n      j++;\n    } else {\n      i = i - j + 2;\n      j = 1;\n    }\n    if (j > strlen(b + 1)) {\n      if ((a[1] == b[1] && a[i] == ' ') ||\n          ((a[i] == ' ' || a[i] == '\u0000') && a[i - j] == ' ')) {\n        c[k] = i - strlen(b + 1);\n        k++;\n      }\n      j = 1;\n    }\n  }\n  c[k] = -1;\n  if (c[0] == -1)\n    for (i = 1; i <= strlen(a + 1); i++)\n      cout << a[i];\n  else {\n    i = 1;\n    s = 0;\n    while (i <= strlen(a + 1)) {\n\n      if (i != c[s]) {\n        cout << a[i];\n        i++;\n      } else {\n        i = i + strlen(b + 1);\n        s++;\n        for (j = 1; j <= strlen(d + 1); j++)\n          cout << d[j];\n      }\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, n, w, i, wordnum = 0, charnum = 0;\n  char word[50][20] = {0};\n  char s[1000] = {0}, o[20] = {0}, a[20] = {0};\n\n  cin >> s;\n\n  cin >> o;\n\n  cin >> a;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      word[wordnum][charnum] = s[i];\n      charnum++;\n    }\n    if (s[i] == ' ') {\n      wordnum++;\n      charnum = 0;\n    }\n  }\n  w = wordnum;\n  for (wordnum = 0; wordnum <= w; wordnum++) {\n    if (strcmp(o, word[wordnum]) == 0)\n      strcpy(word[wordnum], a);\n  }\n  printf(\"%s\", word[0]);\n  for (wordnum = 1; wordnum <= w; wordnum++)\n    printf(\" %s\", word[wordnum]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35458", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, l, t, k = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < t; j++) {\n      if (i + j - 1 > l)\n        break;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if ((a[i - 1] == ' ' || i == 0) && k == t &&\n          (a[i + t] == ' ' || i == l - t)) {\n        printf(\"%s\", c);\n        i = i + t;\n      }\n    }\n    if (i > l - 1)\n      break;\n    if ((k != t || (t == k && (a[i - 1] != ' ' || i != 0) || a[i + t] != ' ' ||\n                    i != l - t)))\n      cout << a[i];\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l = 0, k = 0, m[100], str1, str2, str3;\n  char a[1000], b[100], c[1000], d[1000];\n  cin.getline(a, 1000);\n  cin.getline(b, 100);\n  cin.getline(c, 1000);\n  str1 = strlen(a);\n  str2 = strlen(b);\n  str3 = strlen(c);\n  for (i = 0; i < str1; i++) {\n    for (j = 0; j < str2; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      }\n      if (j == str2 - 1 && (a[i - 1] == ' ' || i == 0)) {\n        m[k] = i;\n        k++;\n      }\n    }\n  }\n  k = 0;\n  for (i = 0; i < str1; i++) {\n    if (m[k] == i) {\n      l++;\n      k++;\n      i += str2 - 1;\n      for (j = 0; j < str3; j++) {\n        cout << c[j];\n      }\n    } else {\n      cout << a[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[200], a[101], b[101];\n  char *ptemp, *pstr, *pa, *pb;\n  int flag, lstr, la, lb;\n  pstr = str;\n  pa = a;\n  pb = b;\n\n  cin >> pstr;\n\n  cin >> pa;\n\n  cin >> pb;\n  lstr = strlen(pstr);\n  la = strlen(pa);\n  lb = strlen(pb);\n  for (; pstr <= str + lstr - 1; pstr++) {\n    flag = 1;\n    while ((*pstr != ' ') && (*pstr != '\u0000')) {\n      if (*pstr != *pa)\n        flag = 0;\n      pstr++;\n      pa++;\n    }\n    if ((flag) && (pa == a + la)) {\n      ptemp = pstr;\n      if (la < lb) {\n        for (pstr = str + lstr; pstr >= ptemp; pstr--)\n          *(pstr + lb - la) = *pstr;\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr + lb - la;\n      }\n      if (la >= lb) {\n        for (pstr = ptemp - la + lb; pstr <= str + lstr - la + lb; pstr++)\n          *pstr = *(pstr + la - lb);\n        for (pstr = ptemp - la; pb <= b + lb - 1; pb++, pstr++)\n          *pstr = *pb;\n        pb = b;\n        lstr = lstr - la + lb;\n      }\n    }\n    pa = a;\n  }\n  pstr = str;\n  printf(\"%s\", pstr);\n}\n"}
{"label": "19", "index": "35461", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  char x[100], c[100] = {'\u0000'};\n  int i, t = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      x[t] = s[i];\n      t++;\n    } else {\n      x[t] = '\u0000';\n      if (strcmp(x, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n      } else {\n        strcat(c, x);\n        strcat(c, \" \");\n      }\n      t = 0;\n    }\n  }\n  x[t] = '\u0000';\n  if (strcmp(x, a) == 0) {\n    strcat(c, b);\n  } else {\n    strcat(c, x);\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "35462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char juzi[9999], danci1[101], danci2[101];\n  int i, j = 0, k, l, length1, length2, count = 0;\n\n  cin >> juzi;\n  scanf(\"%s%s\", danci1, danci2);\n  for (i = 0; i < strlen(juzi); i++) {\n    if (i == 0 || juzi[i - 1] == ' ')\n      for (j = 0; j < strlen(danci1); j++) {\n        if (*(juzi + i + j) == *(danci1 + j))\n          count++;\n        else {\n          count = 0;\n          break;\n        }\n      }\n    if (count != 0) {\n      cout << danci2;\n      i += strlen(danci1) - 1;\n      count = 0;\n    } else\n      cout << juzi[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nconst char flag = -128, noo = -126;\nint main() {\n  int i, l1, l2, l;\n  char s1[101], s2[101], s[1001], *p;\n\n  cin >> s;\n  cin >> s1;\n  cin >> s2;\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l = strlen(s);\n  while ((p = strstr(s, s1)) != NULL) {\n    \n    if (p != s && *(p - 1) != ' ') {\n      *p = noo;\n      continue;\n    }\n    *p = flag;\n    for (p++; *(p + l1 - 1) != 0; p++)\n      *p = *(p + l1 - 1);\n    *p = 0;\n    l -= l1 - 1;\n  }\n  \n  \n  for (i = 0; i < l; i++)\n    if (s[i] == flag)\n      printf(\"%s\", s2);\n    else if (s[i] == noo)\n      printf(\"%c\", s1[0]);\n    else\n      printf(\"%c\", s[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35464", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110];\n  char a[110];\n  char b[110];\n  char out[2000];\n  char tmp[110];\n  int index = 0;\n  int out_i = 0;\n  int len;\n  int len_a;\n  int len_b;\n\n  memset(out, 0, sizeof(out));\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n\n  cin >> str;\n  len = strlen(str);\n\n  scanf(\"%s %s \", a, b);\n  len_a = strlen(a);\n  len_b = strlen(b);\n\n  for (int i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      tmp[index++] = str[i];\n    } else if (str[i] == ' ') {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n      out[out_i++] = ' ';\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n\n    if (i == len - 1) {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n  }\n\n  cout << out << endl;\n}\n"}
{"label": "19", "index": "35465", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n1, n2, n3;\nchar str1[100], str2[100], str3[100];\nint f(char *p) {\n  int m, n;\n  n = 0;\n  char *f;\n  f = p;\n  for (m = 0; m < n2; m++) {\n    if ((*f) == str2[m]) {\n      n++;\n    }\n    f++;\n  }\n  if (n == n2)\n    return 1;\n  else\n    return 0;\n}\nint m(char *p) {\n  if (*p >= 'a' && *p <= 'z')\n    return 1;\n  else if (*p >= 'A' && *p <= 'Z')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  scanf(\"%s \", str1);\n  n1 = strlen(str1);\n  cin >> str2;\n  n2 = strlen(str2);\n  scanf(\"%s\", str3);\n  n3 = strlen(str3);\n  int i = 0, j;\n  char *p1, *p2;\n  p1 = str1;\n  for (i = 0; (p1 - str1) < n1; i++, p1++) {\n    p2 = p1 + n2;\n    if ((f(p1) == 1) && (m(p1 - 1) == 0) && (m(p2) == 0)) {\n      for (j = 0; j < n3; j++)\n        printf(\"%c\", str3[j]);\n      p1 = p1 + n2 - 1;\n    } else {\n      printf(\"%c\", *p1);\n    }\n  }\n}\n"}
{"label": "19", "index": "35466", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][100] = {'\\0'};\n  char a[100], b[100];\n  int i, j;\n\n  scanf(\"%s \", s);\n  i = 1;\n  while (cin.peek() == ' ') {\n    cin >> s[i++];\n  }\n  cin >> a >> b;\n\n  for (i = 0; s[i][0] != '\\0'; i++) {\n    if (strcmp(a, s[i]) == 0) {\n      strcpy(s[i], b);\n    }\n  }\n\n  printf(\"%s\", s[0]);\n  for (i = 1; s[i][0] != '\\0'; i++)\n    printf(\" %s\", s[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35467", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[1000];\n  char word[100][100];\n  char sub[100];\n  char w[100];\n  int i, n, k;\n\n  cin >> a;\n\n  cin >> w;\n\n  cin >> sub;\n\n  n = 0;\n  k = 0;\n  for (i = 0; a[i] != 0; i++) {\n\n    if (a[i] == ' ') {\n      a[i] = '\u0000';\n      strcpy(word[n], (a + k));\n\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(word[n], (a + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], w) == 0) {\n\n      strcpy(word[i], sub);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    printf(\"%s \", word[i]);\n  }\n  puts(word[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35468", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, index, len, len2;\n  char str[101], word[101], newword[101], temp[101];\n  while (cin >> str) {\n    index = 0;\n    len = strlen(str);\n    scanf(\"%s \", word);\n    cin >> newword;\n    for (i = 0; i <= len; i++) {\n      if (str[i] == ' ' || i == len) {\n        temp[index] = '\u0000';\n        if (strcmp(temp, word) == 0) {\n          cout << newword;\n        } else {\n          cout << temp;\n        }\n        if (str[i] == ' ') {\n          printf(\" \");\n        } else {\n          cout << \" \";\n        }\n        index = 0;\n        memset(temp, 0, sizeof(temp));\n      } else {\n        temp[index++] = str[i];\n      }\n    }\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n\n  cin >> str;\n\n  cin >> wrd;\n\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((*(str + i) != ' ') && (*(str + i) != '\u0000')) {\n      *(wd + j) = *(str + i);\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          *(str + k) = '\u0000';\n        for (k = i; k < n; k++) {\n          *(sr + k - i) = *(str + k);\n          *(str + k) = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          *(sr + k) = '\u0000';\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n    }\n  }\n  puts(str);\n}\n"}
{"label": "19", "index": "35470", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nchar a[100];\nchar b[100];\nint len1, len2, len3;\nint i;\nint check(int place);\nvoid output(void);\nint main(void) {\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  for (i = 0; i < len1; i++) {\n    if (check(i)) {\n      output();\n      i += len2 - 1;\n    } else\n      cout << s[i];\n  }\n}\nint check(int place) {\n  int num = 0;\n  int ctr = 0;\n  if (place > 0 && s[place - 1] != ' ')\n    return 0;\n  for (ctr = 0; ctr < len2; ctr++) {\n    if (s[place + ctr] == a[ctr])\n      num++;\n  }\n  if (num == len2)\n    return 1;\n  else\n    return 0;\n}\nvoid output(void) {\n  int ctr1;\n  for (ctr1 = 0; ctr1 < len3; ctr1++) {\n    printf(\"%c\", b[ctr1]);\n  }\n}\n"}
{"label": "19", "index": "35471", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], c[203];\n  s[0] = a[0] = b[0] = ' ';\n\n  cin >> &s[1];\n  cin >> &a[1] >> &b[1];\n  int slen = strlen(s) + 1, alen = strlen(a) + 1, blen = strlen(b) + 1;\n  s[slen - 1] = a[alen - 1] = b[blen - 1] = ' ';\n  s[slen] = a[alen] = b[blen] = '\u0000';\n  int i, j;\n  for (i = 0, j = 0; i < slen; ++i, ++j) {\n    if (strncmp(s + i, a, alen) == 0) {\n      strcpy(c + j, b);\n      i = i + alen - 1;\n      j = j + blen - 1;\n    } else {\n      c[j] = s[i];\n    }\n  }\n  c[j - 1] = 0;\n  printf(\"%s\\n\", &c[1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35472", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], str4[100][100], *p;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  p = str1;\n  int i, j = 0, k = 0, n;\n  n = strlen(str1);\n  for (i = 0; i <= n; i++) {\n    if ((*(p + i) != ' ') && (*(p + i) != '\u0000')) {\n      str4[k][j] = str1[i];\n      j = j + 1;\n    } else {\n      str4[k][j] = '\u0000';\n      j = 0;\n      k = k + 1;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(str4[i], str2) == 0) {\n\n      strcpy(str4[i], str3);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", str4[i]);\n  }\n  printf(\"%s \", str4[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35473", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, flag = 1;\n  int i, j, k = -1, l;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ') {\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = strcmp(words[i], a);\n\n    if (l == 0) {\n      strcpy(words[i], b);\n      flag = 0;\n    }\n  }\n\n  if (flag == 0) {\n    printf(\"%s\", words[0]);\n    for (i = 1; i < n; i++)\n      printf(\" %s\", words[i]);\n  }\n  if (flag == 1) {\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35474", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid huan(int start, char W[100], char B[100], int Len1, int Len2, int Len3,\n          int t) {\n  int i, k;\n  char WW[100];\n  for (i = 0; i < start; i++)\n    WW[i] = W[i];\n  for (i = start, k = 0; i < start + Len3; i++, k++)\n    WW[i] = B[k];\n  for (i = start + Len3; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    WW[i] = W[i + Len2 - Len3];\n  for (i = 0; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    W[i] = WW[i];\n}\n\nint main() {\n  char whole[100];\n  char a[100];\n  char b[100];\n  char gai[100];\n\n  cin >> whole;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t;\n  int len1;\n  int len2;\n  int len3;\n  len1 = strlen(whole);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  int judge;\n  int begin[100];\n  t = 0;\n  if (whole[0] != a[0]) {\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  } else {\n    t = 1;\n    begin[0] = 0;\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  }\n\n  if (len1 >= len2) {\n    int u;\n    for (i = t - 1, u = 1; i >= 0; i--, u++) {\n      huan(begin[i], whole, b, len1, len2, len3, u);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (u - 1) + len3 * (u - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  } else {\n    int v;\n    for (i = 0, v = 1; i <= t - 1; i++, v++) {\n      huan(begin[i], whole, b, len1, len2, len3, v);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (v - 1) + len3 * (v - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i = 0;\n  char(*s)[100], *a, *b;\n  s = (char(*)[100])malloc(100 * 100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  while (scanf(\"%s\", *(s + i)) != EOF) {\n    i++;\n  }\n  n = i;\n  strcpy(a, *(s + n - 2));\n  strcpy(b, *(s + n - 1));\n  for (i = 0; i < n - 2; i++) {\n    if (strcmp(a, *(s + i)) == 0) {\n      strcpy(*(s + i), b);\n    }\n  }\n  for (i = 0; i < n - 3; i++)\n    cout << *(s + i) << \" \";\n\n  printf(\"%s\", *(s + n - 3));\n}\n"}
{"label": "19", "index": "35476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110], c[110];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int x, y, z, flag;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n\n  for (int i = 0; i < x; i++) {\n    if ((i == 0 && a[y] == ' ') || (a[i - 1] == ' ' && (i + y) == x) ||\n        (a[i - 1] == ' ' && a[i + y] == ' ')) {\n      flag = 0;\n      for (int j = 0; j < y; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        cout << c;\n        i += y - 1;\n        continue;\n      }\n    }\n    cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[50][20];\n  char s[100], a[100], b[100], e[100];\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n  while (1) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      e[j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      j = 0;\n      k++;\n    } else if (s[i] == '\u0000') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      break;\n    }\n    i++;\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a, word[i]) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", word[i]);\n  cout << word[k];\n  return 0;\n}\n"}
{"label": "19", "index": "35478", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0};\n  char temp[100][100] = {{0}};\n  int i, j, k, s1, a1, b1;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", temp[i]);\n    if (getchar() == ' ') {\n      break;\n    }\n  }\n\n  cin >> a;\n  scanf(\"%s \", b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  for (j = 0; j < i; j++) {\n    if (strcmp(temp[j], a) == 0) {\n      for (k = 0; k < b1; k++) {\n        temp[j][k] = b[k];\n      }\n      temp[j][b1] = '\u0000';\n    }\n    printf(\"%s \", temp[j]);\n  }\n  if (strcmp(temp[i], a) == 0) {\n    for (k = 0; k < b1; k++) {\n      temp[i][k] = b[k];\n    }\n    temp[i][b1] = '\u0000';\n  }\n  printf(\"%s\", temp[i]);\n}\n"}
{"label": "19", "index": "35479", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf[600], dc[30][30], y[30], h[30];\n\n  scanf(\"%s \", zf);\n\n  cin >> y;\n\n  cin >> h;\n  int n = strlen(zf), a = 0, b = 0;\n  for (int i = 0; i < n + 1; i++) {\n    if (zf[i] != ' ' && zf[i] != ' ') {\n      dc[a][b] = zf[i];\n      b++;\n    } else {\n      dc[a][b] = '\u0000';\n      a++;\n      b = 0;\n    }\n  }\n  for (int k = 0; k < a + 1; k++) {\n    if (strcmp(dc[k], y) == 0) {\n      strcpy(dc[k], h);\n    }\n  }\n  printf(\"%s\", dc[0]);\n  for (int m = 1; m < a + 1; m++) {\n    printf(\" %s\", dc[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35480", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[101], sub[101], c[101]; \n  cin.getline(a, 101);           \n  cin >> sub;                    \n  cin >> c;                      \n  int la, ls, i, j, flag;        \n  la = strlen(a);\n  ls = strlen(sub); \n  for (i = 0; i <= la - ls; i++) {\n    if (i != 0 &&\n        a[i - 1] != ' ') { \n      cout << a[i];        \n      continue;            \n    }\n    flag = 1; \n    for (j = 0; j < ls; j++) {\n      if (a[j + i] != sub[j]) { \n        flag = 0;               \n        cout << a[i];           \n        break;                  \n      }\n    }\n    if (flag) {       \n      cout << c;      \n      i = i + ls - 1; \n    }\n  }\n  for (j = 0; j < ls; j++) { \n    flag = 1;\n    if (a[j + la - ls] != sub[j]) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0 ||\n      a[la - ls - 1] != ' ') { \n    for (i = la - ls + 1; i < la; i++) \n      cout << a[i];\n  }\n  return 0; \n}\n"}
{"label": "19", "index": "35481", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, a = 0, b = 0;\n  char zfc[101], y[101], x[101], word[101][101];\n\n  cin >> zfc;\n\n  cin >> y;\n\n  cin >> x;\n  for (i = 0; zfc[i] != '\u0000'; i++) {\n    if (zfc[i] != ' ') {\n      word[a][b] = zfc[i];\n      b++;\n    } else {\n      word[a][b] = '\u0000';\n      b = 0;\n      a++;\n    }\n  }\n  word[a][b] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(word[i], y) == 0)\n      strcpy(word[i], x);\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", word[i]);\n  }\n  cout << word[a] << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], str1[100], str2[100], a[100][100];\n\n  cin >> s;\n  int len = strlen(s);\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  int lenth = strlen(str2);\n  int i, j, p;\n  for (i = 0, j = 0, p = 0; j < len; j++) {\n    a[i][p++] = s[j];\n    if (s[j + 1] == ' ') {\n      j = j + 1;\n      a[i][p] = '\u0000';\n      i = i + 1;\n      p = 0;\n    }\n  }\n  a[i][p] = '\u0000';\n  int num = i;\n  int judge = 0;\n  for (i = 0; i < num + 1; i++) {\n    if (strcmp(a[i], str1) == 0) {\n      for (j = 0; j < lenth; j++) {\n        a[i][j] = str2[j];\n      }\n      a[i][lenth] = '\u0000';\n      judge = 1;\n    }\n  }\n\n  if (judge == 0)\n    cout << s << \" \";\n  else {\n    printf(\"%s\", a[0]);\n    for (i = 1; i < num + 1; i++) {\n      printf(\" %s\", a[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35483", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  char aword[101];\n  char bword[101];\n  char words[101][101];\n\n  cin >> str;\n  cin >> aword;\n  cin >> bword;\n  int i;\n  int j;\n  int num = 0;\n  int len = strlen(str);\n  for (i = 0; i < len; i++) {\n    j = 0;\n    while (str[i] != ' ') {\n      words[num][j] = str[i];\n      j++;\n      i++;\n    }\n    words[num][j] = '\u0000';\n    num++;\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(words[i], aword) == 0) {\n      strcpy(words[i], bword);\n      continue;\n    }\n  }\n\n  for (j = 0; j < num - 1; j++)\n    cout << words[j] << \" \";\n\n  cout << words[num - 1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35484", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, k, m = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  l = strlen(a);\n  char **p;\n  p = (char **)malloc(500 * sizeof(char *));\n  for (i = 0; i <= 499; i++)\n    p[i] = (char *)malloc(500 * sizeof(char));\n  for (k = 0, i = 0; k <= l - 1 && i <= 499; i++) {\n    for (j = 0; j <= 499; j++) {\n      if (a[k] != ' ' && a[k] != '\u0000') {\n        p[i][j] = a[k];\n        k++;\n      } else {\n        k++;\n        p[i][j] = '\u0000';\n        m++;\n        break;\n      }\n    }\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (strcmp(p[i], b) == 0)\n      strcpy(p[i], c);\n  }\n  for (i = 0; i <= m - 2; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[m - 1]);\n}\n"}
{"label": "19", "index": "35485", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[120], s0[120];\n  char a[20], b[20];\n  int k = 1, ls;\n  cin.getline(s, 100, '\\n');\n  cin >> a >> b;\n  for (int i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    ls = strlen(s);\n    if (s[i] == a[0] && (s[i + strlen(a)] == 32 || s[strlen(a) + i] == '\\0') &&\n        (i == 0 || s[i - 1] == 32)) {\n      for (int j = 1; j < strlen(a); j++)\n        if (s[i + j] != a[j]) {\n          k = 0;\n          continue;\n        }\n    } else\n      k = 0;\n    if (k == 1) {\n      for (int g = 0; g < i; g++)\n        s0[g] = s[g];\n      for (int n = i + strlen(a); n < strlen(s); n++)\n        s0[n - strlen(a) + strlen(b)] = s[n];\n      for (int m = 0; m < strlen(b); m++)\n        s0[i + m] = b[m];\n      for (int c = 0; c < ls - strlen(a) + strlen(b); c++)\n        s[c] = s0[c];\n      s[ls - strlen(a) + strlen(b)] = '\\0';\n      i += strlen(b) - 1;\n    }\n    k = 1;\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a; \n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a); \n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) \n  {\n    if (i == 0 || a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb >= lenc) \n        {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n          {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) \n          {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenc - 1;\n          lena -= lenb - lenc;\n        }\n        if (lenb < lenc) \n        {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) \n          {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n          {\n            a[k] = c[j];\n          }\n          i += lenc - 1;\n          lena += lenc - lenb; \n        }\n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid change(char word[30][15], char a[], char b[]);\nvoid getword(char *p, char word[30][15]);\nint n = 0;\nint main() {\n  char s[100], word[30][15] = {'\u0000'}, a[10], b[10];\n  char *p = s;\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  getword(p, word);\n  change(word, a, b);\n  return 0;\n}\n\nvoid getword(char *p, char word[30][15]) {\n  int i, j = 0;\n  for (i = 0; *p != '\u0000'; i++) {\n    while (*p == ' ')\n      p += 1;\n    j = 0;\n    while (*p != ' ' && *p != '\u0000') {\n      word[i][j] = *p;\n      j += 1;\n      p += 1;\n    }\n    n += 1;\n  }\n}\n\nvoid change(char word[30][15], char a[], char b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(word[i], a) == 0)\n      cout << b;\n    else\n      printf(\"%s\", word[i]);\n  }\n}\n"}
{"label": "19", "index": "35488", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100];\n  char word[100][100], a[100], b[100];\n  char *p[100];\n  char *p1, *p2;\n  int i, j, k, strl, al, bl;\n\n  scanf(\"%s \", string);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  p1 = a;\n  p2 = b;\n  strl = strlen(string);\n  al = strlen(a);\n  bl = strlen(b);\n  j = 0;\n  k = 0;\n  for (i = 0; i < strl; i++)\n    if (string[i] != 32) {\n      word[j][k] = string[i];\n      if (string[i + 1] != 32)\n        k++;\n      else if (string[i + 1] == 32 || string[i + 1] == '\u0000') {\n        word[j][k + 1] = '\u0000';\n        k = 0;\n        j++;\n      }\n    }\n  for (i = 0; i < j + 1; i++)\n    p[i] = word[i];\n  for (i = 0; i < j + 1; i++) {\n    if (strcmp(p1, *(p + i)) == 0)\n      p[i] = p2;\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", p[i]);\n  printf(\"%s\", p[j]);\n}\n"}
{"label": "19", "index": "35489", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lenth1, lenthw1, lenthw2, i, j, num = 0, row = 0, flag, a[101];\n  char s1[101], word[101], wordnew[101], olds1[101][101];\n  cin.getline(s1, 101);\n  scanf(\"%s \", word);\n  cin >> wordnew;\n  lenth1 = strlen(s1);\n  lenthw1 = strlen(word);\n  lenthw2 = strlen(wordnew);\n  for (i = 0; i < lenth1; i++) {\n    if (s1[i] == ' ') {\n      num++;\n      row = 0;\n    } else {\n      olds1[num][row] = s1[i];\n      a[num] = row;\n      row++;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    flag = 1;\n    for (j = 0; j < lenthw1; j++) {\n      if (olds1[i][j] != word[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      a[i] = lenthw2 - 1;\n      for (j = 0; j < lenthw2; j++)\n        olds1[i][j] = wordnew[j];\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j <= a[i]; j++)\n      cout << olds1[i][j];\n    cout << \" \";\n  }\n  for (j = 0; j <= a[num]; j++)\n    cout << olds1[num][j];\n  return 0;\n}\n"}
{"label": "19", "index": "35490", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++) {\n    c[i] = '\u0000';\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n  }\n  scanf(\"%s \", c);\n  cin >> a;\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int l, m;\n    char ch[101];\n    for (m = 0; m <= 100; m++) {\n      ch[m] = '\u0000';\n    }\n    l = n[i] - n[i - 1] - 1;\n    for (m = 0; m <= (l - 1); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n\n    if (strcmp(a, ch) == 0) {\n      strcat(s, b);\n    } else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35491", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, j, k = 0;\n  char s[100][100] = {0}, a[100], b[100], str[1000];\n  char *ps[100], *pa, *pb;\n\n  for (i = 0; i < 100; i++)\n    *(ps + i) = s[i];\n  pa = a;\n  pb = b;\n\n  scanf(\"%s \", str);\n\n  cin >> pa;\n\n  cin >> pb;\n  i = 0;\n  do {\n    for (j = 0; *(str + k) != ' ' && *(str + k) != '\u0000'; j++) {\n      *(*(ps + i) + j) = *(str + k);\n      k++;\n    }\n    *(*(ps + i) + j) = '\u0000';\n    i++;\n    k++;\n  } while (*(str + k) != '\u0000');\n  *(*(ps + i - 1) + j) = '\u0000';\n  m = i;\n  for (i = 0; i < m; i++) {\n    if (!strcmp(*(ps + i), pa))\n      strcpy(*(ps + i), pb);\n  }\n\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      printf(\"%s\", *(ps + i));\n    else\n      printf(\" %s\", *(ps + i));\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35492", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[200], a[100], b[100];\n  int l, result = 0, i, j, l1;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  l = strlen(s);\n  l1 = strlen(a);\n  for (i = 0; i <= l - 1; i++) {\n    result = 0;\n    if ((i == 0) || (s[i - 1] == ' ')) {\n      result = 1;\n      for (j = i; j <= i + (l1 - 1); j++) {\n        if (s[j] != a[j - i])\n          result = 0;\n      }\n    }\n    if (result == 1) {\n      printf(\"%s\", b);\n      i = i + l1 - 1;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35493", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[30][20] = {\"\"}, e[20] = {\"\"}, f[20] = {\"\"}, *a[30], *b, *c;\n  int i, num = 1;\n  for (i = 0; i < 30; i++)\n    *(a + i) = *(d + i);\n  b = e;\n  c = f;\n  scanf(\"%s\", *a);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", *(a + i));\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(*(a + i), b) == 0) {\n      strcpy(*(a + i), c);\n    }\n  }\n  printf(\"%s\", *a);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", *(a + i));\n  }\n}\n"}
{"label": "19", "index": "35494", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, value, la, lb, ls;\n  char *p, *ps, s[100] = \"\", a[100] = \"\", b[100] = \"\";\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  ls = strlen(s);\n  for (p = s; p < s + 100; p++) {\n    value = 1;\n    if ((p == s || *(p - 1) == ' ') && (*p == a[0])) {\n      for (ps = p + 1, i = 1; a[i] != '\u0000'; ps++, i++)\n        if (*ps != a[i])\n          value = 0;\n      if (value == 1) {\n        if (la == lb)\n          for (i = 0; i < la; i++)\n            (*p++) = b[i];\n        else if (la > lb) {\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n          while (*ps != '\u0000')\n            (*p++) = (*ps++);\n          *p = '\u0000';\n        } else {\n          for (i = 99; i >= (ps - s) + lb - la; i--) {\n            s[i] = s[i - lb + la];\n          }\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n        }\n      }\n    }\n  }\n  printf(\"%s\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35495", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], w1[100], w2[100];\n\n  scanf(\"%s \", s);\n\n  cin >> w1;\n\n  cin >> w2;\n  int i, l = strlen(s), l1 = strlen(w1), l2 = strlen(w2), p = 0, m, n, j, k;\n  for (i = 0; i < l; i++) {\n    if (s[i] == w1[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + l1] == 32 || i == l - 1)) {\n      p = 1;\n      for (m = i, n = 0; n < l1; m++, n++)\n        if (s[m] != w1[n]) {\n          p = 0;\n          break;\n        }\n    }\n    if (p) {\n      for (k = 0; k < l2; k++)\n        printf(\"%c\", w2[k]);\n      i = i + l1 - 1;\n      p = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35496", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[10000];\n  char tmp[105], a[105], b[105];\n  int i, j;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0, j = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, tmp) == 0) {\n        printf(\"%s \", b);\n      } else {\n        printf(\"%s \", tmp);\n      }\n    } else {\n      tmp[j] = s[i];\n      j++;\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(a, tmp) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", tmp);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35497", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char buf[1000];\n  char key[100];\n  char temp[100];\n  char rep[100];\n  int i, j, n, w;\n  cin.getline(buf, 1000, '\\n');\n  cin >> key >> rep;\n  i = 0;\n  w = 0;\n  while (1) {\n    for (j = 0; buf[i] != ' ' && buf[i] != 0; j++, i++)\n      temp[j] = buf[i];\n    temp[j] = 0;\n    n = strcmp(temp, key);\n    if (w != 0)\n      cout << ' ';\n    if (n == 0) {\n\n      cout << rep;\n    } else\n      cout << temp;\n    w++;\n    if (buf[i] == 0)\n      break;\n    i++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35498", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, k;\n  char a[100][100], b[100], c[100];\n  int n = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", a[i]);\n    n++;\n    k = getchar();\n    if (k == '\\n')\n      break;\n  }\n  cin >> b;\n  scanf(\"%s\", c);\n  for (i = 0; i < n; i++) {\n    k = strcmp(b, a[i]);\n    if (k == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", a[i]);\n  }\n  printf(\"%s\", a[n - 1]);\n}\n"}
{"label": "19", "index": "35499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, w, nw = 0, ns, na, nb, rem[102], flag, FLAG = 0;\n  char s[102], a[102], b[102];\n  int vest[102];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ns = strlen(s);\n  na = strlen(a);\n  nb = strlen(b);\n  for (i = 0; i < ns; i++) {\n\n    if (s[i] != ' ' && FLAG == 0) {\n      FLAG = 1;\n      flag = 0;\n      for (k = i, j = 0; j < na; j++, k++) {\n        if (s[k] != a[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0 && (s[k] == ' ' || s[k] == '\u0000')) {\n        rem[nw] = i;\n        nw++;\n      }\n    } else {\n      FLAG = 0;\n    }\n  }\n  for (w = 0; w < nw; w++) {\n    if (nb == na) {\n      for (k = 0; k < na; k++) {\n        s[k + rem[w]] = b[k];\n      }\n\n    } else if (nb > na) {\n      ns = ns + nb - na;\n      s[ns] = '\u0000';\n      for (k = ns - 1; k > rem[w]; k--) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    } else {\n      ns = ns + nb - na;\n      for (k = rem[w] + 1; k < ns; k++) {\n        s[k] = s[k - nb + na];\n      }\n      for (k = 0; k < nb; k++) {\n        s[k + rem[w]] = b[k];\n      }\n      for (j = 0; j < nw; j++) {\n        rem[j] = rem[j] + nb - na;\n      }\n    }\n  }\n  for (i = 0; i < ns; i++) {\n    printf(\"%c\", s[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35500", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[1000], s[100][100], a[100], b[100];\n  int i = 0, j = 0, k = 0, d;\n\n  cin >> w;\n\n  cin >> a;\n\n  cin >> b;\n  while (w[i] != '\u0000') {\n    while (w[i] != ' ' && w[i] != '\u0000') {\n      s[j][k] = w[i];\n      i++;\n      k++;\n    }\n    s[j][k] = '\u0000';\n    j++;\n\n    k = 0;\n    while (w[i] == ' ') {\n      i++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    d = strcmp(s[i], a);\n    if (d == 0) {\n      strcpy(s[i], b);\n    }\n  }\n  cout << s[0];\n  for (i = 1; i < j; i++) {\n    printf(\" %s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35501", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[200], x[200], y[200];\n  int i, j, len = 0, t[200] = {0};\n  char c;\n\n  cin >> word;\n  scanf(\"%s%s\", x, y);\n  for (i = 0; i < strlen(word); i++) {\n    if ((i == 0) || word[i - 1] == ' ')\n      for (j = 0; j < strlen(x); j++) {\n        if (word[i + j] != x[j])\n          break;\n        else if ((j == strlen(x) - 1) &&\n                 (word[i + j + 1] == ' ' || word[i + j + 1] == '\u0000')) {\n          t[i] = 1;\n        }\n      }\n  }\n  for (i = 0; i < strlen(word); i++) {\n    if (t[i] == 0) {\n      printf(\"%c\", word[i]);\n    } else {\n      printf(\"%s\", y);\n      i = i + strlen(x) - 1;\n    }\n  }\n}\n"}
{"label": "19", "index": "35502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char t[50][100];\n  int s1, n, i, j, m;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  s1 = strlen(s);\n  for (i = 0, n = 1; i < s1; i++)\n    if (s[i] == ' ')\n      n++;\n  for (i = 0, m = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (s[m + j] == ' ') {\n        t[i][j] = '\u0000';\n        m = m + j + 1;\n        break;\n      } else\n        t[i][j] = s[m + j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (strcmp(t[i], a) == 0)\n      strcpy(t[i], b);\n    else\n      strcpy(t[i], t[i]);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", t[i]);\n  printf(\"%s \", t[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35503", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d[10], i = 0, j = 0, k = 0, l = 0;\n  char s[1000], q[100], w[100];\n\n  scanf(\"%s \", s);\n  cin >> q;\n  cin >> w;\n  for (j = 0; j < 100; j++) {\n    if (s[j] == '\u0000' && a == 0)\n      a = j;\n    if (q[j] == '\u0000' && b == 0)\n      b = j;\n    if (w[j] == '\u0000' && c == 0)\n      c = j;\n    if (a != 0 && b != 0 && c != 0)\n      break;\n  }\n  for (i = 0; i <= a; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      for (j = 0; j < b; j++)\n        if (q[j] != s[i - b + j])\n          break;\n        else if (s[i - b - 1] == ' ' || i == b) {\n          d[k++] = i;\n          j = b;\n        }\n    }\n  }\n  if (k != 0)\n    for (i = 0; i < a; i++) {\n      if (i == d[l] - b) {\n        for (j = 0; j < c; j++)\n          printf(\"%c\", w[j]);\n        i = d[l] - 1;\n        l++;\n      } else\n        printf(\"%c\", s[i]);\n    }\n  else\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[50][100];\n  int i, n = 0, len1, len2, k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(c[n], (s + k));\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(c[n], (s + k));\n  for (i = 0; i < n + 1; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << c[i] << \" \";\n  }\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35505", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int ls, la, lb, i, j, m;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && s[i - 1] == ' ' || s[0] == a[0]) {\n      m = 1;\n      for (j = 1; j < la; j++) {\n        if (s[i + j] != a[j]) {\n          m = 2;\n        }\n      }\n      if (m == 1) {\n        char x[100];\n        strcpy(x, s);\n        for (j = i; j < i + lb; j++) {\n          s[j] = b[j - i];\n        }\n        for (j = i + lb; j < ls + lb - la; j++) {\n          s[j] = x[j - lb + la];\n        }\n        ls = ls - la + lb;\n        i = i + lb - 1;\n      }\n    }\n  }\n  for (i = 0; i < ls; i++) {\n    printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35506", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[100][100], str1[100], str2[100];\n  int i = 0, j;\n  do {\n    cin >> ch[i];\n    i++;\n  } while (getchar() != '\\n');\n  cin >> str1 >> str2;\n  for (j = 0; j < i; j++) {\n    if (strcmp(str1, ch[j]) == 0) {\n      strcpy(ch[j], str2);\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    printf(\"%s \", ch[j]);\n  }\n  cout << ch[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35507", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c = '0';\n  char *s[100];\n  char t[100], r[100];\n  int i = 0, j;\n  while (c != '\\n') {\n    s[i] = (char *)malloc(sizeof(char) * 100);\n    scanf(\"%s\", s[i++]);\n    scanf(\"%c\", &c);\n  }\n  cin >> t;\n  scanf(\"%s\", r);\n  for (j = 0; j < i; j++) {\n    if (strcmp(t, s[j]) == 0)\n      s[j] = r;\n    printf(\"%s\", s[j]);\n    if (j < i - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35508", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar yuan[100000], yao[110], wei[110];\nint yuanlen, yaolen, weilen;\n\nint main() {\n  char *s;\n  int i;\n\n  cin >> yuan;\n\n  cin >> yao;\n\n  cin >> wei;\n  s = strstr(yuan, yao);\n  if (s == NULL || (s[-1] != ' ' && s != yuan)) {\n    puts(yuan);\n    return 0;\n  }\n  yuanlen = strlen(yuan);\n  yaolen = strlen(yao);\n  weilen = strlen(wei);\n  while (s != NULL) {\n    if (yaolen == weilen) {\n      for (i = 0; i < yaolen; i++) {\n        s[i] = wei[i];\n      }\n    }\n    if (yaolen > weilen) {\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n      while (s[i + yaolen - weilen] != 0) {\n        s[i] = s[i + yaolen - weilen];\n        i++;\n      }\n      s[i] = 0;\n    }\n    if (yaolen < weilen) {\n      for (i = yuanlen - 1; i > yaolen - 1; i--)\n        s[i + weilen - yaolen] = s[i];\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n    }\n    s += weilen;\n    s = strstr(s, yao);\n  }\n\n  puts(yuan);\n  return 0;\n}\n"}
{"label": "19", "index": "35509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (i != 0) {\n      if (s[i] == ' ') {\n        k = 0;\n        for (j = 0; j < y; j++) {\n          if (s[i + j + 1] != a[j])\n            k = 1;\n        }\n      }\n      if (k == 0) {\n        printf(\" \");\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = i + y;\n      }\n      if (k == 1)\n        printf(\"%c\", s[i]);\n    } else if (i == 0) {\n      k = 0;\n      for (j = 0; j < y; j++) {\n        if (s[j] != a[j])\n          k = 1;\n      }\n      if (k == 0) {\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = y - 1;\n      }\n      if (k == 1)\n        printf(\"%c\", s[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35510", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100], word[50][50] = {0};\n  int len, i, row = 1, col = 1;\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 1; i <= len; i++)\n    if (str[i - 1] == ' ') {\n      row++;\n      col = 1;\n    } else {\n      word[row - 1][col - 1] = str[i - 1];\n      col++;\n    }\n  for (i = 1; i <= row; i++)\n    if (strcmp(word[i - 1], str1) == 0)\n      strcpy(word[i - 1], str2);\n  printf(\"%s\", word[0]);\n  for (i = 2; i <= row; i++)\n    printf(\" %s\", word[i - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], x[100][26], a[100], b[100], t[100];\n  int num, i, j, kong;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  kong = -1;\n  num = 0;\n  for (i = 0; i < 101; i++) {\n    if (s[i] == ' ') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      num++;\n      kong = i;\n    } else if (s[i] == '\u0000') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      t[j] = x[i][j];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      for (j = 0; b[j] != '\u0000'; j++)\n        x[i][j] = b[j];\n      x[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      printf(\"%c\", x[i][j]);\n    printf(\" \");\n  }\n  for (j = 0; x[num][j] != '\u0000'; j++)\n    cout << x[num][j];\n}\n"}
{"label": "19", "index": "35512", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[105], a[105], b[105], ch[105][105];\n  int i, j = 0, k = 0, word, lens, lenb = 0;\n  cin.getline(s, 105, '\\n');\n  cin.getline(a, 105, '\\n');\n  cin.getline(b, 105, '\\n');\n  for (i = 0; i < 105; i++) {\n    if (b[i] != '\\0')\n      lenb += 1;\n    else\n      break;\n  }\n  for (i = 0; i < 105; i++) {\n    if (s[i] == ' ') {\n      ch[j][k] = '\\0';\n      k = 0;\n      j += 1;\n    } else if (s[i] == '\\0') {\n      ch[j][k] = s[i];\n      lens = i - 1;\n      word = j;\n      break;\n    } else {\n      ch[j][k] = s[i];\n      k += 1;\n    }\n  }\n  for (i = 0; i <= word; i++) {\n    k = 1;\n    if (strlen(ch[i]) != strlen(a))\n      k = 0;\n    else {\n      for (j = 0; j < strlen(a); j++)\n        if (ch[i][j] != a[j])\n          k = 0;\n    }\n    if (k == 1) {\n      for (j = 0; j <= lenb + 1; j++)\n        ch[i][j] = b[j];\n    }\n  }\n  for (i = 0; i < word; i++)\n    printf(\"%s \", ch[i]);\n\n  for (j = 0; j < 105; j++) {\n    printf(\"%c\", ch[word][j]);\n    if (ch[word][j + 1] == '\\0')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35513", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[105], b[105], s[105], c[105][105];\n  int i, len, startp, endp, cur_c, k;\n  cin >> s;\n  cin >> a >> b;\n  len = strlen(s);\n  startp = 0;\n  endp = 1, cur_c = 0;\n  while (endp <= len) {\n    if (s[endp] == ' ' || s[endp] == '\u0000') {\n      for (i = startp, k = 0; i <= endp - 1; i++, k++)\n        c[cur_c][k] = s[i];\n      c[cur_c][k + 1] = '\u0000';\n      cur_c++;\n      startp = endp + 1;\n      endp = startp + 1;\n    } else\n      endp++;\n  }\n  for (i = 0; i < cur_c; i++)\n    if (!strcmp(a, c[i]))\n      strcpy(c[i], b);\n  cout << c[0];\n  for (i = 1; i < cur_c; i++)\n    printf(\" %s\", c[i]);\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35514", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a;\n  int isWords;\n  char s1[100];\n  char s2[100];\n  char s3[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  i = 0;\n  j = 0;\n  k = 0;\n  char *p;\n  p = strtok(s1, \"' '\");\n  if (strcmp(p, s2) == 0)\n    printf(\"%s\", s3);\n  else\n    printf(\"%s\", p);\n  p = strtok(NULL, \"' '\");\n  while (p) {\n    if (strcmp(p, s2) == 0) {\n      printf(\" %s\", s3);\n    } else\n      printf(\" %s\", p);\n    p = strtok(NULL, \"' '\");\n  }\n\n  cin >> s1;\n  return 0;\n}\n"}
{"label": "19", "index": "35515", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n\n  for (i = 0; i <= lena - lenb; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + lenb] == ' ' ||\n        i == 0 && a[i + lenb] == ' ' || i == lena - lenb && a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb > lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenb;\n          lena -= lenb - lenc;\n        } else {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenb; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++)\n            a[k] = c[j];\n\n          i += lenc;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char(*p)[100], *p1, *p2, *a;\n  char string[100], str[100][100], str1[100], str2[100];\n  n = 0;\n  k = 1;\n  p = str;\n  p1 = str1;\n  p2 = str2;\n  a = string;\n  scanf(\"%s \", string);\n  cin >> str1;\n  cin >> str2;\n  for (i = 0; *(a + i) != '\u0000'; i++)\n    if (*(a + i) == ' ')\n      k++;\n  for (i = 0; *(a + n) != '\u0000'; i++) {\n    for (j = 0; *(a + n) != ' ' && *(a + n) != '\u0000'; j++) {\n      *(*(p + i) + j) = *(a + n);\n      n++;\n    }\n    *(*(p + i) + j) = '\u0000';\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), p1) == 0)\n      strcpy(*(p + i), p2);\n  for (i = 0; i < k - 1; i++) {\n    cout << *(p + i);\n    printf(\" \");\n  }\n  printf(\"%s\", *(p + k - 1));\n  return 0;\n}\n"}
{"label": "19", "index": "35517", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar sentence[100][100], a[100], b[100];\n\nint main() {\n  int cnt = 1;\n  while (scanf(\"%s\", sentence[cnt]) != EOF)\n    cnt++;\n  cnt--;\n  memcpy(a, sentence[cnt - 1], sizeof(sentence[cnt - 1]));\n  memcpy(b, sentence[cnt], sizeof(sentence[cnt]));\n  for (int i = 1; i < cnt - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(sentence[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", sentence[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35518", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  scanf(\"%s \", b);\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n  }\n  cout << d << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35519", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar *Strlwr(char *);\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char inputL[110], replacedL[110];\n  char *p, *pL, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  strcpy(inputL, input);\n  strcpy(replacedL, replaced);\n\n  len = strlen(replaced);\n  pL = strstr(inputL, replacedL);\n  start = input;\n  while (pL != NULL) {\n    if ((pL == inputL || isalpha(*(pL - 1)) == 0) && isalpha(*(pL + len)) == 0)\n\n    {\n      p = input + (pL - inputL);\n      *p = '\\0';\n\n      cout << start << replace;\n\n      start = p + len;\n      pL = strstr((start - input) + inputL, replacedL);\n    } else {\n      p = input + (pL - inputL) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      pL = strstr((start - input) + inputL, replacedL);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n\nchar *Strlwr(char *p) {\n  for (; *p != '\\0'; p++) {\n    if (*p >= 'A' && *p <= 'Z')\n      *p += 32;\n  }\n\n  return p;\n}\n"}
{"label": "19", "index": "35520", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[102], a[102], b[102];\n\n  unsigned int i, j;\n  unsigned int sum = 0;\n  unsigned int sum1 = 0;\n  int flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; i < strlen(s); i++) {\n\n    if (s[i] != ' ') {\n      sum1 = sum1 + 1;\n      if (i != strlen(s) - 1)\n        continue;\n      else {\n        i = i + 1;\n        flag = 1;\n      }\n    }\n    for (j = 0; j < strlen(a) && strlen(a) == sum1; j++) {\n      if (s[i - sum1 + j] == a[j])\n        sum = sum + 1;\n    }\n    if (sum == strlen(a)) {\n      for (j = 0; j < strlen(b); j++) {\n        printf(\"%c\", b[j]);\n      }\n    } else {\n      for (j = 0; j < sum1; j++) {\n        cout << s[i - sum1 + j];\n      }\n    }\n    if (flag == 0) {\n      printf(\"%c\", ' ');\n    }\n    sum1 = 0;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35521", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  int la, lb;\n  char *p;\n  char t[101];\n  char *ss;\n\n  scanf(\"%s \", s);\n  cin >> a;\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  ss = s;\n  while ((p = strstr(ss, a)) != NULL) {\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == ' ')) {\n      strcpy(t, p + la + 1);\n      strcpy(p, b);\n      *(p + lb) = ' ';\n      strcpy(p + lb + 1, t);\n    }\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == '\u0000')) {\n      strcpy(p, b);\n      *(p + lb) = '\u0000';\n    }\n    ss = p + la + 1;\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35522", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  unsigned int i = 0, j = 0;\n  char s[101];\n  char a[101];\n  char b[101];\n  char tmp[101];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      tmp[j] = s[i];\n      j++;\n    } else {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(tmp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", tmp);\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(tmp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", tmp);\n  return 0;\n}\n"}
{"label": "19", "index": "35523", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[200];\n  int l1, l2, l3, i, j, k = 0;\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; i < l1; i++) {\n    if (a[i - 1] == ' ' || i == 0) {\n      for (j = 0; j < l2; j++)\n        if (a[i + j] != b[j])\n          break;\n      if (j == l2) {\n        for (j = 0; j < l3; j++, k++)\n          d[k] = c[j];\n        i = i + l2 - 1;\n      } else {\n        d[k] = a[i];\n        k++;\n      }\n    } else {\n      d[k] = a[i];\n      k++;\n    }\n  }\n  d[k] = '\u0000';\n  cout << d;\n}\n"}
{"label": "19", "index": "35524", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101];\n  char aword[101];\n  char bword[101];\n  char words[101][101];\n\n  cin >> str;\n  cin >> aword;\n  scanf(\"%s \", bword);\n  int i;\n  int j;\n  int num = 0;\n  int len = strlen(str);\n  for (i = 0; i < len; i++) {\n    j = 0;\n    while (str[i] != ' ') {\n      words[num][j] = str[i];\n      j++;\n      i++;\n    }\n    words[num][j] = '\u0000';\n    num++;\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(words[i], aword) == 0) {\n      strcpy(words[i], bword);\n      continue;\n    }\n  }\n\n  for (j = 0; j < num - 1; j++) {\n    cout << words[j] << \" \";\n  }\n  cout << words[num - 1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *q;\n  s = (char *)malloc(100);\n  a = (char *)malloc(100);\n  b = (char *)malloc(100);\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  for (p = s;; p++) {\n    if (*p == '\u0000') {\n      if (strcmp(q, a) == 0) {\n        printf(\"%s\", b);\n        break;\n      }\n      printf(\"%s\", q);\n      break;\n    }\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35526", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int t1, t2, t3, m, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  t1 = strlen(s);\n  t2 = strlen(a);\n  t3 = strlen(b);\n  for (i = 0; s[i]; i++) {\n    m = -1;\n    if (s[i] == a[0] && (s[i - 1] == ' ') || i == 0) {\n      for (int j = 0; j < t2; j++) {\n        if (s[i + j] == a[j] &&\n            ((s[i + t2] == ' ' || s[i + t2] == '\u0000') || a[t2] == '\u0000'))\n          m = i;\n        else {\n          m = -1;\n          break;\n        }\n      }\n    }\n    if (m == i) {\n\n      if (t3 > t2) {\n        for (int u = strlen(s); u >= (t2 + m); u--) {\n          s[u + t3 - t2] = s[u];\n        }\n        for (int p = m; p < t3 + m; p++) {\n          s[p] = b[p - m];\n        }\n      } else if (t3 <= t2) {\n        for (int k = m; k < t3 + m; k++)\n          s[k] = b[k - m];\n\n        for (int l = t3 + m; l < t2 + m; l++) {\n          s[l] = ' ';\n        }\n        for (int u = t2 + m; u < strlen(s) - t3 + t2; u++) {\n          s[u - t2 + t3] = s[u];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35527", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], ans[100], temp[100];\n  int i, j, templ, tempans;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  templ = 0;\n  tempans = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      temp[templ] = '\u0000';\n      if (strcmp(temp, a) == 0) {\n        for (j = 0; j < strlen(b); j++) {\n          ans[tempans] = b[j];\n          tempans++;\n        }\n      } else {\n        for (j = 0; j < templ; j++) {\n          ans[tempans] = temp[j];\n          tempans++;\n        }\n      }\n      ans[tempans] = ' ';\n      tempans++;\n      templ = 0;\n      continue;\n    }\n    temp[templ] = s[i];\n    templ++;\n  }\n  temp[templ] = '\u0000';\n  if (strcmp(temp, a) == 0) {\n    for (j = 0; j < strlen(b); j++) {\n      ans[tempans] = b[j];\n      tempans++;\n    }\n  } else {\n    for (j = 0; j < templ; j++) {\n      ans[tempans] = temp[j];\n      tempans++;\n    }\n  }\n  ans[tempans] = '\u0000';\n  printf(\"%s\", ans);\n  return 0;\n}\n"}
{"label": "19", "index": "35528", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar temp[1000];\nchar test[1000][1000];\nchar s[1000];\nchar d[1000];\nchar now[1000];\nint main() {\n\n  cin.getline(temp, 1000);\n  cin >> s;\n  cin >> d;\n  memset(test, 0, sizeof(test));\n  int length = strlen(temp);\n  int i;\n  int j = 0;\n  int k = 0;\n  for (i = 0; i < length; i++) {\n    if (temp[i] != ' ')\n      now[j++] = temp[i];\n    else {\n      strcpy(test[k], now);\n      memset(now, 0, sizeof(now));\n      j = 0;\n      k++;\n    }\n  }\n  strcpy(test[k], now);\n  for (i = 0; i <= k; i++) {\n    if (strcmp(test[i], s) == 0)\n      strcpy(test[i], d);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i != k) {\n      cout << test[i] << \" \";\n    } else\n      printf(\"%s\\n\", test[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35529", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100], *p;\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  for (p = s; p < s + m; p++)\n    if (*p == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; *(s + k) != 32; j++) {\n      *(*(c + i) + j) = *(s + k);\n      k++;\n    }\n    if (*(s + k) == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n}\n"}
{"label": "19", "index": "35530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char t[100];\n  char b[100];\n  int k, i, j, word;\n  word = 0;\n  k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int len;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else {\n      if (word == 0) {\n        k++;\n        word = 1;\n      }\n    }\n  }\n  int A = 0;\n  int n;\n  int m = 0;\n  for (j = 0; j < k; j++) {\n    for (i = A, n = 0; i < len; i++, n++) {\n      if (s[i] != ' ') {\n        t[n] = s[i];\n      }\n      if (s[i] == ' ') {\n        t[n] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len) {\n      t[n] = '\u0000';\n    }\n\n    if (strcmp(t, a) == 0) {\n      strcpy(t, b);\n    }\n    m++;\n    if (m != k) {\n      printf(\"%s \", t);\n    }\n    if (m == k) {\n      cout << t << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[5000], w[1000][1000], w1[1000], w2[1000];\n\n  cin >> word;\n\n  cin >> w1;\n\n  cin >> w2;\n  int n, i, j = 0, k = 0, A;\n  n = strlen(word);\n  for (i = 0; i < n; i++) {\n    if (word[i] != ' ') {\n      w[k][j] = word[i];\n      j++;\n      A = 1;\n    }\n    if (word[i] == ' ' && A == 1) {\n      w[k][j] = '\u0000';\n      j = 0;\n      k++;\n      A = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(w1, w[i]) == 0)\n      strcpy(w[i], w2);\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%s \", w[i]);\n  }\n  printf(\"%s\", w[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35532", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[500], b[100], c[100], d[100][100];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  int i, j, k = 0;\n  for (i = 0; i < strlen(a); i++, k++) {\n    for (j = i; a[j] != ' '; j++) {\n      d[k][j - i] = a[j];\n      d[k][j - i + 1] = '\u0000';\n      if (a[j] == '\u0000') {\n        break;\n      }\n    }\n    i = j;\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      strcpy(d[i], c);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", d[i]);\n  }\n  printf(\"%s\", d[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35533", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n  int i = 0, j, t;\n\n  cin >> str;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  do {\n    j = 0;\n    t = i;\n    while (str[i] == a[j] && j < strlen(a)) {\n      i++;\n      j++;\n    }\n    if (j == strlen(a)) {\n      printf(str[i] == '\u0000' ? \"%s\" : \"%s \", b);\n      i++;\n    } else {\n      do {\n        printf(\"%c\", str[t]);\n        t++;\n      } while (str[t] != ' ' && str[t] != '\u0000');\n      if (str[t] == ' ')\n        cout << \" \";\n      i = t + 1;\n    }\n  } while (str[i - 1] != '\u0000');\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35534", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, i, j = 0, k = 0;\n  char s[100], a[20], b[20], str[50][20] = {\" \"}, (*p)[20];\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  l = strlen(s);\n  for (i = 0; i < l; i++) {\n    if (s[i] != ' ')\n      str[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n    if (s[i + 1] == '\u0000')\n      j++;\n  }\n  p = &str[0];\n  for (i = 0; i < j; i++) {\n    if (strcmp(a, *(p + i)) == 0)\n      strcpy(*(p + i), b);\n  }\n  for (i = 0; i < j; i++) {\n    if (i == 0)\n      printf(\"%s\", *(p + i));\n    else\n      printf(\" %s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "35535", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200], d[200];\n  int ai = 0, lb, la, lc, bi = 0, ci = 0, di = 0, k;\n\n  cin >> a;\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  lb = strlen(b);\n  la = strlen(a);\n  lc = strlen(c);\n  while (ai != la) {\n    bi = 0;\n    ci = 0;\n    if (ai != 0) {\n      if ((a[ai] == b[bi]) && (a[ai - 1] == ' ')) {\n\n        k = ai;\n        while ((a[ai] == b[bi]) && (a[ai] != ' ') && (a[ai] != '\u0000')) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    } else {\n      if (a[ai] == b[bi]) {\n\n        k = ai;\n        while (a[ai] == b[bi]) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    }\n  }\n  \n  d[di] = '\u0000';\n  \n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[200] = {0}, a[100] = {0}, b[100] = {0};\n  char c[50][50] = {0};\n  int i = 0, j, k = 0, n = 0;\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; zfc[i] != ' ' && zfc[i] != 0; i++) {\n    for (k = 0; zfc[i] != ' ' && zfc[i] != 0; i++, k++) {\n      c[n][k] = zfc[i];\n    }\n    n++;\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (strcmp(c[j], a) == 0) {\n      strcpy(c[j], b);\n    }\n    printf(\"%s \", c[j]);\n  }\n  if (strcmp(c[n - 1], a) == 0) {\n    strcpy(c[n - 1], b);\n  }\n  printf(\"%s\", c[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j, v, x, c, flag;\n  char str[100], a[10], b[10];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  v = strlen(str);\n  x = strlen(a);\n  c = strlen(b);\n  str[v] = ' ';\n  flag = x;\n  for (i = 0; i < x; i++) {\n    if (str[i] == a[i]) {\n      flag--;\n    }\n  }\n  if (flag == 0 && str[x] == ' ') {\n    printf(\"%s\", b);\n  } else\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", str[i]);\n    }\n  i = x;\n  while (i < v) {\n    flag = x;\n    for (j = i; j < i + x; j++) {\n      if (str[j] == a[j - i])\n        flag--;\n    }\n    if (flag == 0 && str[i - 1] == ' ' && str[i + x] == ' ') {\n      printf(\"%s\", b);\n      i = i + x;\n    } else {\n      printf(\"%c\", str[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35538", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[200] = {0}, a[100] = {0}, b[100] = {0};\n  char c[50][50] = {0};\n  int i = 0, j, k = 0, n = 0;\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; zfc[i] != ' ' && zfc[i] != 0; i++) {\n    for (k = 0; zfc[i] != ' ' && zfc[i] != 0; i++, k++) {\n      c[n][k] = zfc[i];\n    }\n    n++;\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (strcmp(c[j], a) == 0) {\n      strcpy(c[j], b);\n    }\n    printf(\"%s \", c[j]);\n  }\n  if (strcmp(c[n - 1], a) == 0) {\n    strcpy(c[n - 1], b);\n  }\n  cout << c[n - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35539", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char ini[101], former[101], latter[101], *p, *q = ini;\n  cin >> ini;\n  cin >> former;\n  cin >> latter;\n  for (p = ini;; p++)\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    } else if (*p == '\u0000') {\n      if (strcmp(q, former) == 0)\n        printf(\"%s \", latter);\n      else\n        printf(\"%s \", q);\n      break;\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "35540", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s0[101], s1[101], s2[101], a[100][21];\n  int i = 0, j = 0, k = 0;\n  cin >> s0;\n  cin >> s1;\n  cin >> s2;\n  for (i = 0, j = 0; i < strlen(s0); i++)\n    if (s0[i] != ' ')\n      a[j][k] = s0[i], k++;\n    else\n      a[j][k] = '\u0000', j++, k = 0;\n  a[j][k] = '\u0000';\n  for (i = 0; i <= j; i++)\n    if (strcmp(a[i], s1) == 0)\n      if (k) {\n        printf(\"%s\", s2);\n        k = 0;\n      } else\n        cout << \" \" << s2;\n    else if (k) {\n      cout << a[i];\n      k = 0;\n    } else\n      printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35541", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000];\n  int ls, la, lb, i, j, pointer = 0, t, m = 0, n = 0;\n  cin.get(s, 1000);\n  cin >> a;\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    int counter = 0;\n\n    for (j = 0; j < la; j++) {\n      if (s[i + j] == a[j]) {\n        counter++;\n        continue;\n      } else\n        break;\n    }\n    if (counter == la && (s[i] == a[0] && (i == 0 || s[i - 1] == ' '))) {\n\n      for (t = 0; t < lb; t++) {\n        c[pointer] = b[t];\n        pointer++;\n      }\n\n      i = i + la - 1;\n    } else {\n      c[pointer] = s[i];\n      pointer++;\n    }\n  }\n  c[pointer] = '\\0';\n  for (j = 0; j < pointer; j++)\n    printf(\"%c\", c[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35542", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar s[100];\nchar a[100];\nchar b[100];\nint len1, len2, len3;\nint i;\nint check(int place);\nvoid output(void);\nint main(void) {\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  for (i = 0; i < len1; i++) {\n    if (check(i)) {\n      output();\n      i += len2 - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\nint check(int place) {\n  int num = 0;\n  int ctr = 0;\n  if (place > 0 && s[place - 1] != ' ')\n    return 0;\n  for (ctr = 0; ctr < len2; ctr++) {\n    if (s[place + ctr] == a[ctr])\n      num++;\n  }\n  if (num == len2)\n    return 1;\n  else\n    return 0;\n}\nvoid output(void) {\n  int ctr1;\n  for (ctr1 = 0; ctr1 < len3; ctr1++) {\n    printf(\"%c\", b[ctr1]);\n  }\n}\n"}
{"label": "19", "index": "35543", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nconst char flag = -128, noo = -126;\nint main() {\n  int i, l1, l2, l;\n  char s1[101], s2[101], s[1001], *p;\n\n  scanf(\"%s \", s);\n  cin >> s1;\n  cin >> s2;\n  l1 = strlen(s1);\n  l2 = strlen(s2);\n  l = strlen(s);\n  while ((p = strstr(s, s1)) != NULL) {\n\n    if (p != s && *(p - 1) != ' ') {\n      *p = noo;\n      continue;\n    }\n    *p = flag;\n    for (p++; *(p + l1 - 1) != 0; p++)\n      *p = *(p + l1 - 1);\n    *p = 0;\n    l -= l1 - 1;\n  }\n\n  for (i = 0; i < l; i++)\n    if (s[i] == flag)\n      printf(\"%s\", s2);\n    else if (s[i] == noo)\n      printf(\"%c\", s1[0]);\n    else\n      printf(\"%c\", s[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35544", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[210] = {0}, a[100], b[100];\n  int ls, la, i, j, k, g = 0, lb;\n\n  cin >> s;\n  cin >> a >> b;\n  la = strlen(a);\n  ls = strlen(s);\n  lb = strlen(b);\n  if (la <= ls) {\n    for (j = 0; j <= ls - la; j++) {\n      if ((j == 0) || (s[j - 1] < 65)) {\n        for (k = 0; k < la; k++) {\n          if (a[k] == s[j + k])\n            g++;\n        }\n        if (g == la) {\n          if (lb >= la) {\n            for (i = ls + lb - la - 1; i >= j + lb; i--)\n              s[i] = s[i - lb + la];\n          } else {\n            for (i = j + lb; i < ls + lb - la; i++)\n              s[i] = s[i - lb + la];\n            for (i = ls + lb - la; i < ls; i++)\n              s[i] = 0;\n          }\n          for (i = 0; i < lb; i++)\n            s[i + j] = b[i];\n          j = j + lb - 1;\n        }\n      }\n      g = 0;\n      ls = strlen(s);\n    }\n  }\n  ls = strlen(s);\n  for (i = 0; i < ls; i++)\n    cout << s[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35545", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  p = s;\n  while (ch != ' ') {\n    scanf(\"%s\", p + i++);\n    ch = getchar();\n  }\n\n  cin >> a;\n\n  cin >> b;\n\n  p = s;\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      cout << b;\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101], b[101], c[101];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  int i, j = 0;\n  for (i = 0; a[i] != '\u0000'; i++, j++) {\n    if (a[i] != ' ')\n      t[j] = a[i];\n    if (a[i] == ' ') {\n      t[j] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n        printf(\"%s \", t);\n      } else\n        printf(\"%s \", t);\n      j = -1;\n    }\n  }\n  t[j] = '\u0000';\n  if (strcmp(t, b) == 0) {\n    strcpy(t, c);\n    printf(\"%s\", t);\n  } else\n    printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "19", "index": "35547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[4000];\n  char a[100], b[100];\n  char str[40][100];\n  char temp[100] = \"\";\n  int k = 0, j = 0, i, n, m;\n\n  cin >> string;\n  n = strlen(string);\n  for (i = 0; i < n; i++) {\n    if (string[i] != ' ') {\n      temp[k] = string[i];\n      str[j][k] = string[i];\n      k++;\n    } else {\n      strcpy(str[j], temp);\n      k = 0;\n      j++;\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n    if (i == n - 1) {\n      strcpy(str[j], temp);\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n  }\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], a) == 0) {\n      strcpy(str[i], b);\n    }\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  cout << str[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  scanf(\"%s \", b);\n  scanf(\"%s \", c);\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n  }\n  printf(\"%s\\n\", d);\n  return 0;\n}\n"}
{"label": "19", "index": "35549", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char Data[20][20], Word_1[20], Word_2[20];\n  int i, t;\n\n  int get_data(char Data[20][20]);\n  t = get_data(Data);\n  cin >> Word_1;\n  cin >> Word_2;\n\n  if (strcmp(Data[0], Word_1) == 0)\n    strcpy(Data[0], Word_2);\n  cout << Data[0];\n  for (i = 1; i < t; i++) {\n    if (strcmp(Data[i], Word_1) == 0) {\n      strcpy(Data[i], Word_2);\n    }\n    cout << ' ' << Data[i];\n  }\n  return 0;\n}\nint get_data(char Data[20][20]) {\n  int i = 0, j = 0;\n  char c;\n  while ((c = getchar()) != '\\n') {\n    if (c == ' ') {\n      Data[i][j] = '\\0';\n      i++;\n      j = 0;\n      continue;\n    }\n    Data[i][j] = c;\n    j++;\n  }\n  Data[i][j] = '\\0';\n  return i + 1;\n}\n"}
{"label": "19", "index": "35550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100], *p;\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n  cin >> s;\n  cin >> a;\n  scanf(\"%s \", b);\n  m = strlen(s);\n  for (p = s; p < s + m; p++)\n    if (*p == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; *(s + k) != 32; j++) {\n      *(*(c + i) + j) = *(s + k);\n      k++;\n    }\n    if (*(s + k) == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else\n      strcpy(e[i], c[i]);\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35551", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[10001];\n  char c1[101], c2[101];\n  int i, j, a, b, c;\n  cin.getline(str, 10001);\n  cin >> c1 >> c2;\n  a = strlen(str);\n  b = strlen(c1);\n  c = strlen(c2);\n  for (i = 0; i < a; i++) {\n    if (((str[i - 1] == 32) && (str[i + b] == 32)) ||\n        ((i == 0) && (str[i + b] == 32)) ||\n        (str[i - 1] == 32) && (i + b == a)) {\n      if (str[i] == c1[0]) {\n        for (j = i; j <= i + b - 1; j++) {\n          if (str[j] != c1[j - i])\n            break;\n        }\n        if (j == (i + b)) {\n          if (c > b) {\n            for (j = a - 1; j >= i + b; j--) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) {\n              str[j] = c2[j - i];\n            }\n            a = a + c - b;\n            i = i + c - 1;\n          } else {\n            for (j = i + b; j <= a - 1; j++) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++)\n              str[j] = c2[j - i];\n\n            a = a + c - b;\n            i = i + c;\n          }\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35552", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], d[100], b[100][50];\n  int i, j = 0, k = 0, n, m, l;\n\n  cin >> s;\n  cin >> a;\n  scanf(\"%s\", d);\n  n = strlen(s);\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      b[j][k] = s[i];\n      k++;\n    } else {\n      b[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  b[j][k] = '\u0000';\n  for (m = 0; m < j + 1; m++) {\n    l = strcmp(a, b[m]);\n    if (l == 0)\n      strcpy(b[m], d);\n    if (m == 0)\n      printf(\"%s\", b[m]);\n    else\n      printf(\" %s\", b[m]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35553", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101], b[101], c[101];\n  char a1[101], a2[101];\n  int i, k, l;\n  int la, lb, lc;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n\n  lb = strlen(b);\n  lc = strlen(c);\n\n  l = 0;\n  a[-1] = ' ';\n  for (;;) {\n    la = strlen(a);\n    i = 0;\n\n    for (k = l; k <= la - 1; k++)\n      if (a[k] == b[i]) {\n        i++;\n        if (i == lb && (a[k + 1] == ' ' || a[k + 1] == '\u0000') &&\n            (a[k - lb] == ' '))\n          break;\n      } else\n        i = 0;\n\n    if (k == la)\n      break;\n\n    a1[0] = '\u0000';\n    for (i = 0; i <= k - lb; i++)\n      a1[i] = a[i];\n    a1[k - lb + 1] = '\u0000';\n\n    a2[0] = '\u0000';\n    for (i = 0; i <= la - k - 2; i++)\n      a2[i] = a[k + 1 + i];\n    a2[la - k - 1] = '\u0000';\n\n    strcat(a1, c);\n    strcat(a1, a2);\n    strcpy(a, a1);\n\n    l = k - lb + 1 + lc;\n  }\n  printf(\"%s\\n\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35554", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0};\n  char c[100] = {0};\n  char d[100] = {0};\n  cin.getline(a, 100);\n  cin >> c;\n  cin >> d;\n  char b[100][100] = {0};\n  int i, num, k = 0, p = 0;\n  num = strlen(a);\n  a[num] = '\\n';\n  for (i = 0; i < num + 1; i++) {\n\n    b[k][p] = a[i];\n    p++;\n    if (a[i] == ' ' || a[i] == '\\n') {\n      b[k][p - 1] = 0;\n      k++;\n      p = 0;\n    }\n  }\n  int num1;\n  num1 = strlen(d);\n  for (i = 0; i < k + 1; i++) {\n    if (strcmp(b[i], c) == 0) {\n      for (p = 0; p < 100; p++) {\n        b[i][p] = 0;\n      }\n      for (p = 0; p < num1; p++) {\n        b[i][p] = d[p];\n      }\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", b[i]);\n  }\n  printf(\"%s\", b[k - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35555", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char zfc[100], zsz[100][100];\n  char word_a[100], word_b[100];\n\n  scanf(\"%s \", zfc);\n  scanf(\"%s %s\", word_a, word_b);\n\n  int word_i = 0, word_j = 0;\n  int i, n;\n  n = strlen(zfc);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == ' ' || zfc[i] == ',') {\n\n      zsz[word_i][word_j] = '\u0000';\n      word_i++;\n      word_j = 0;\n\n    } else {\n      zsz[word_i][word_j] = zfc[i];\n      word_j++;\n\n      if (i == n - 1) {\n        zsz[word_i][word_j] = '\u0000';\n        word_i++;\n      }\n    }\n  }\n  int j, a[10], m = 0, k;\n  for (j = 0; j < i; j++) {\n    if (strcmp(zsz[j], word_a) == 0) {\n      a[m] = j;\n      m++;\n    }\n  }\n  for (k = 0; k < m; k++) {\n    strcpy(zsz[a[k]], word_b);\n  }\n  for (j = 0; j < word_i; j++) {\n    if (j != word_i - 1) {\n      printf(\"%s \", zsz[j]);\n    } else {\n      printf(\"%s\", zsz[j]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35556", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100]; \n  int i = 0, count = 0, j = 0;\n  char str[100][100];          \n  char word1[100], word2[100]; \n  cin.getline(s, 100, '\\n');\n  for (i = 0; i < 100; i++) \n  {\n    if (s[i] != ' ') {\n      str[count][j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      str[count][j + 1] = '\\0';\n      count++;\n      j = 0;\n      continue;\n    } else if (s[i] == '\\0')\n      break;\n  }\n  cin.getline(word1, 100, '\\n');\n  cin.getline(word2, 100, '\\n');\n  for (i = 0; i <= count; i++) \n  {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], word2);\n  }\n  cout << str[0];\n  for (i = 1; i <= count; i++)\n    cout << ' ' << str[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35557", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  int la, lb;\n  char *p;\n  char t[101];\n  char *ss;\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s \", b);\n  la = strlen(a);\n  lb = strlen(b);\n  ss = s;\n  while ((p = strstr(ss, a)) != NULL) {\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == ' ')) {\n      strcpy(t, p + la + 1);\n      strcpy(p, b);\n      *(p + lb) = ' ';\n      strcpy(p + lb + 1, t);\n    }\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == '\u0000')) {\n      strcpy(p, b);\n      *(p + lb) = '\u0000';\n    }\n    ss = p + la + 1;\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35558", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a; \n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a); \n  lenb = strlen(b);\n  lenc = strlen(c);\n\n  for (i = 0; i <= lena - lenb; i++) \n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + lenb] == ' ' ||\n        i == 0 && a[i + lenb] == ' ' || i == lena - lenb && a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb > lenc) \n        {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n          {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) \n          {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenb;\n          lena -= lenb - lenc;\n        } else \n        {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenb; k--) \n          {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n          {\n            a[k] = c[j];\n          }\n          i += lenc;\n          lena += lenc - lenb; \n        }\n      }\n    }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35559", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0};\n  char temp[100][100] = {{0}};\n  int i, j, k, s1, a1, b1;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", temp[i]);\n    if (getchar() == ' ') {\n      break;\n    }\n  }\n  cin >> a;\n  scanf(\"%s \", b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  for (j = 0; j < i; j++) {\n    if (strcmp(temp[j], a) == 0) {\n      for (k = 0; k < b1; k++) {\n        temp[j][k] = b[k];\n      }\n      temp[j][b1] = '\u0000';\n    }\n    printf(\"%s \", temp[j]);\n  }\n  if (strcmp(temp[i], a) == 0) {\n    for (k = 0; k < b1; k++) {\n      temp[i][k] = b[k];\n    }\n    temp[i][b1] = '\u0000';\n  }\n  printf(\"%s\", temp[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35560", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  int len = strlen(str);\n  char **temp = (char **)malloc(len * sizeof(int *));\n  int i, j = 0, k = 0;\n  for (i = 0; i < len; i++)\n    temp[i] = (char *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    if (i == len - 1)\n      temp[j][k + 1] = 0;\n    if (str[i] != ' ') {\n      temp[j][k] = str[i];\n      k++;\n    } else {\n      temp[j][k] = 0;\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(temp[i], str1) == 0)\n      strcpy(temp[i], str2);\n  }\n\n  for (i = 0; i <= j - 1; i++) {\n    printf(\"%s\", temp[i]);\n    printf(\" \");\n  }\n\n  printf(\"%s\", temp[j]);\n\n  for (i = 0; i < len; i++)\n    free(temp[i]);\n  free(temp);\n  return (0);\n}\n"}
{"label": "19", "index": "35561", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, l1, l2;\n  char s[200], a[101], b[101];\n  cin.getline(s, 200);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  l = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = l; i >= 0; i--)\n    s[i + 1] = s[i];\n  s[0] = ' ';\n  l += 1;\n  for (i = 0; i <= l + 1; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; j <= i + l1; j++) {\n        if (s[j] != a[j - i - 1])\n          break;\n        else {\n          if (j == i + l1 && (s[i + l1 + 1] == ' ' || s[i + l1 + 1] == '\\0')) {\n            if (l2 >= l1) {\n              l += l2 - l1;\n              for (k = l - l2 + l1; k >= i + l1 + 1; k--)\n                s[k + l2 - l1] = s[k];\n              for (k = i; k <= i + l2 - 1; k++)\n                s[k + 1] = b[k - i];\n            }\n            if (l2 < l1) {\n              for (k = i + l1 + 1; k <= l + 2; k++)\n                s[k + l2 - l1] = s[k];\n              for (k = i; k <= i + l2 - 1; k++)\n                s[k + 1] = b[k - i];\n            }\n          }\n        }\n      }\n    }\n  }\n  for (i = 1; i <= l; i++)\n    s[i - 1] = s[i];\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35562", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[101];\n  char word1[101], word2[101];\n  int match[101];\n\n  memset(match, 1, sizeof(match));\n\n  cin >> st;\n\n  scanf(\"%s \", word1);\n\n  cin >> word2;\n\n  int len1 = strlen(st), len2 = strlen(word1), len3 = strlen(word2);\n\n  int i, j, k;\n  for (i = 0; i < len1; i++) {\n    if ((i == 0 || st[i - 1] == ' ') && i + len2 <= len1) {\n      for (j = 0; j < len2; j++) {\n        if (st[i + j] != word1[j])\n          match[i] = 0;\n      }\n    }\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (!match[i]) {\n      for (j = i; j < len1; j++) {\n        putchar(st[j]);\n        if (st[j] == ' ')\n          break;\n      }\n      i = j;\n    } else {\n      i += len2;\n      printf(\"%s\", word2);\n      if (i < len1)\n        putchar(' ');\n    }\n  }\n  puts(\"\");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35563", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(char *p, char a[], int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    if (*(p + i) != a[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char s[200], r[200], a[101], b[101];\n  int i = 0, j, ls, la, lb, count = 0, p = 1;\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  if (a[0] == s[0])\n    if (check(&s[0], a, la) == 1 && s[i + la] == ' ') {\n      for (j = 0; j < lb; j++) {\n        r[count] = b[j];\n        count++;\n      }\n      p = i + la;\n\n    } else {\n      r[count] = s[0];\n      count++;\n    }\n  else {\n    r[count] = s[0];\n    count++;\n  }\n  for (i = p; i < ls; i++) {\n    if (a[0] == s[i])\n      if (check(&s[i], a, la) == 1 &&\n          (s[i - 1] == ' ' && (s[i + la] == ' ' || s[i + la] == '\u0000'))) {\n        for (j = 0; j < lb; j++) {\n          r[count] = b[j];\n          count++;\n        }\n        i = i + la - 1;\n        continue;\n      } else {\n        r[count] = s[i];\n        count++;\n        continue;\n      }\n    else {\n      r[count] = s[i];\n      count++;\n    }\n  }\n  r[count] = '\u0000';\n  printf(\"%s\", r);\n  return 0;\n}\n"}
{"label": "19", "index": "35564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20], str2[20], *p, str3[40][20], STR[100] = \"\";\n  int i, k, m, x;\n  cin >> str;\n  cin >> str1;\n  scanf(\"%s \", str2);\n  k = 0;\n  m = 0;\n  for (p = str; *p != '\u0000'; p++) {\n    str3[k][m] = *p;\n    m++;\n    if (isalpha(*p) * isalpha(*(p + 1)) == 0) {\n      str3[k][m] = '\u0000';\n      k++;\n      m = 0;\n    }\n  }\n  str3[k][m] = '\u0000';\n  x = k;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0)\n      strcpy(str3[i], str2);\n  }\n  for (i = 0; i <= k; i++) {\n    strcat(STR, str3[i]);\n  }\n  cout << STR;\n  return 0;\n}\n"}
{"label": "19", "index": "35565", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000], b[100], c[100], t[100];\n  int lenb, lena, len;\n  int i = 0, j, k, flag;\n\n  cin >> c;\n  scanf(\"%s\", a);\n  cin >> b;\n  len = strlen(c);\n  lena = strlen(a);\n  lenb = strlen(b);\n  while (i < len) {\n    j = 0;\n    while (isgraph(c[i]))\n      t[j++] = c[i++];\n    t[j] = '\u0000';\n    if (strcmp(t, a))\n      printf(\"%s\", t);\n    else\n      printf(\"%s\", b);\n    if (c[i])\n      printf(\"%c\", c[i++]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35566", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], r[50][20] = {0}, t[100];\n  int i = 0, j, c = 0, l;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l = strlen(s);\n  while (i <= l - 1) {\n    j = 0;\n    c++;\n    while (s[i] != ' ' && i <= l - 1) {\n      r[c][j] = s[i];\n      j++;\n      i++;\n    }\n    i++;\n  }\n  for (i = 1; i <= c - 1; i++) {\n    if (strcmp(r[i], a) == 0)\n      printf(\"%s \", b);\n    else {\n      printf(\"%s \", r[i]);\n    }\n  }\n  if (strcmp(r[c], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", r[c]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[500] = {0}, b[30] = {0}, c[30] = {0}, temp[30] = {0};\n  int i, j, k, len, count = 0;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  len = strlen(a);\n  for (i = 0; i <= len; i++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      temp[count] = a[i];\n      count++;\n    }\n    if (a[i] == ' ') {\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        cout << c << \" \";\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n    if (a[i] == '\u0000') {\n\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35568", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[4][500];\n  int i, j, k, count = 0, len[3] = {0};\n  for (i = 0; i < 3; i++) {\n    cin.getline(str[i], 500);\n    len[i] = strlen(str[i]);\n  }\n\n  for (i = 0; str[0][i] != 0; i++) {\n    if ((i == 0 || (i > 0 && str[0][i - 1] == ' ')) &&\n        ((str[0][i + len[1]] == ' ') || (str[0][i + len[1]] == 0))) {\n      for (j = 0; j < len[1]; j++)\n        if (str[0][i + j] != str[1][j])\n          break;\n\n      if (j == len[1]) {\n        strcpy(str[3], str[0] + i + len[1]);\n        strcpy(str[0] + i + len[2], str[3]);\n\n        for (k = 0; str[2][k] != 0; k++)\n          str[0][i + k] = str[2][k];\n\n        count++;\n      }\n    }\n    str[0][len[0] + count * (len[2] - len[1]) + 1] = 0;\n  }\n\n  printf(\"%s\\n\", str[0]);\n  return 0;\n}\n"}
{"label": "19", "index": "35569", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000];\n  int ls, la, lb, i, j, pointer = 0, t, m = 0, n = 0;\n  cin.get(s, 1000);\n  scanf(\"%s \", a);\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    int counter = 0;\n\n    for (j = 0; j < la; j++) {\n      if (s[i + j] == a[j]) {\n        counter++;\n        continue;\n      } else {\n        break;\n      }\n    }\n    if (counter == la && (s[i] == a[0] && (i == 0 || s[i - 1] == ' '))) {\n\n      for (t = 0; t < lb; t++) {\n        c[pointer] = b[t];\n        pointer++;\n      }\n\n      i = i + la - 1;\n    } else {\n      c[pointer] = s[i];\n      pointer++;\n    }\n  }\n  c[pointer] = '\\0';\n  for (j = 0; j < pointer; j++)\n    printf(\"%c\", c[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35570", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  int i = 0, count = 0, j = 0;\n  char str[100][100];\n  char word1[100], word2[100];\n  cin.getline(s, 100, '\\n');\n  for (i = 0; i < 100; i++) {\n    if (s[i] != ' ') {\n      str[count][j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      str[count][j + 1] = '\\0';\n      count++;\n      j = 0;\n      continue;\n    } else if (s[i] == '\\0') {\n      break;\n    }\n  }\n  cin.getline(word1, 100, '\\n');\n  cin.getline(word2, 100, '\\n');\n  for (i = 0; i <= count; i++) {\n    if (strcmp(str[i], word1) == 0)\n      strcpy(str[i], word2);\n  }\n  printf(\"%s\", str[0]);\n  for (i = 1; i <= count; i++)\n    printf(\" %s\", str[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000] = {0};\n  char a[100] = {0}, b[100] = {0};\n\n  cin >> s;\n  int c[1000] = {0};\n  scanf(\"%s%s\", a, b);\n  int i, j, k = 0, h, d = 0;\n  int l = strlen(s);\n  int p = strlen(a);\n  for (i = 0; i < l; i++) {\n    if ((a[0] == s[i] && s[i - 1] == ' ') || (a[0] == s[i] && i == 0)) {\n      c[d] = i;\n      for (j = 1; j < p; j++) {\n        if (a[j] == s[i + j]) {\n          k = 1;\n        } else {\n          k = 0;\n        }\n      }\n      if (k != 0) {\n        d++;\n      }\n    }\n  }\n  if (k == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < c[0]; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (h = 0; h < d; h++) {\n      printf(\"%s\", b);\n      for (j = p + c[h]; j < c[h + 1]; j++) {\n        printf(\"%c\", s[j]);\n      }\n    }\n    for (j = c[d - 1] + p; j < l; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35572", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sentence[110], first[110], second[110];\n  int i, j, flag;\n  int lens, len1;\n  cin.getline(sentence, 110);\n  cin.getline(first, 110);\n  cin.getline(second, 110);\n  lens = strlen(sentence);\n  len1 = strlen(first);\n  for (i = 0; i < lens - len1 + 1; i++) {\n    flag = 0;\n    if ((i == 0 && sentence[i + len1] == ' ') ||\n        (sentence[i - 1] == ' ' && sentence[i + len1] == ' ') ||\n        (i == lens - len1 && sentence[i - 1] == ' ')) {\n      for (j = 0; j < len1; j++) {\n        if (sentence[i + j] == first[j])\n          flag++;\n      }\n    }\n    if (flag == len1) {\n      i = i + len1 - 1;\n      cout << second;\n    } else\n      cout << sentence[i];\n  }\n  if (flag != len1)\n    for (i = lens - len1 + 1; i < lens; i++)\n      cout << sentence[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35573", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char buf1[100];\n  char buf2[100];\n  char buf3[100];\n  char *tmp;\n\n  cin >> buf1;\n\n  cin >> buf2;\n\n  cin >> buf3;\n  tmp = buf1;\n  while ((*tmp) != 0) {\n    if (strncmp(tmp, buf2, strlen(buf2)) == 0) {\n      if ((tmp == buf1 || *(tmp - 1) == ' ')) {\n        printf(\"%s\", buf3);\n        tmp += strlen(buf2);\n      } else {\n        printf(\"%c\", *tmp);\n        ++tmp;\n      }\n    } else {\n      printf(\"%c\", *tmp);\n      ++tmp;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[300];\n\n  cin >> string;\n  char a[200], b[200];\n  scanf(\"%s %s\", a, b);\n\n  char word[200][200];\n  int n1, n2, i, k;\n  int m = 0;\n  int p = 0;\n  n1 = strlen(string);\n  for (i = 0; i < n1; i++) {\n    if (string[i] == ' ') {\n      m++;\n      p = 0;\n    } else {\n      word[m][p] = string[i];\n      p++;\n    }\n  }\n\n  if (strcmp(word[0], a) == 0)\n    cout << b;\n  else\n    printf(\"%s\", word[0]);\n\n  for (k = 1; k <= m; k++) {\n    if (strcmp(word[k], a) == 0)\n      printf(\" %s\", b);\n    else\n      printf(\" %s\", word[k]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35575", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k;\n  cin.getline(a, 100, '\\n');\n  cin.getline(b, 100, '\\n');\n  cin.getline(c, 100, '\\n');\n  int l1 = strlen(a), l2 = strlen(b);\n  for (i = 0;; i++)\n    if (a[i] == ' ')\n      break;\n  for (j = 0; j <= i - 1; j++) {\n    if (a[j] != b[j]) {\n      for (k = 0; k <= i - 1; k++)\n        cout << a[k];\n      break;\n    }\n    if (j == i - 1)\n      cout << c;\n  }\n\n  for (i = 0; i <= l1 - 1; i++) {\n    if (a[i] != ' ')\n      continue;\n    for (j = 0; j <= l2 - 1; j++) {\n      if (a[i + j + 1] != b[j]) {\n        cout << \" \";\n        for (k = i + 1;; k++) {\n          if (a[k] == ' ' || k == l1)\n            break;\n          else\n            cout << a[k];\n        }\n        break;\n      }\n      if (j == l2 - 1)\n        cout << \" \" << c;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35576", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  char d[101][101];\n  int l;\n  int i, j, k;\n  while (cin >> s) {\n    int t = 0;\n    cin >> a;\n    scanf(\"%s \", b);\n    getchar();\n    l = strlen(s);\n    i = 0;\n    j = 0;\n    k = 0;\n    for (i = 0; i <= l; i++) {\n      if (s[i] == ' ') {\n        d[j][k] = '\u0000';\n        k = 0;\n        ++j;\n      } else if (s[i] == '\u0000') {\n        d[j][k] = '\u0000';\n        ++j;\n      } else {\n        d[j][k] = s[i];\n        ++k;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (strcmp(a, d[i]) == 0)\n        strcpy(d[i], b);\n    }\n    for (i = 0; i < j - 1; i++)\n      printf(\"%s \", d[i]);\n    printf(\"%s \", d[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35577", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100 + 1], a[100 + 1], b[100 + 1];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ss[n++] = s;\n  ss[0] = s;\n  n = 1;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      ss[n] = &s[i + 1];\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n\n    if (strcmp(ss[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(ss[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35578", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l1, l2, l3, i, j, lab;\n  lab = 1;\n  int x[200] = {0};\n  char a[200], b[200];\n  char s[200] = {0};\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  l1 = strlen(s);\n  l2 = strlen(a);\n  l3 = strlen(b);\n  for (i = l1; i >= 0; i--) {\n    s[i] = s[i - 1];\n  }\n  s[0] = ' ';\n  s[l1 + 1] = ' ';\n\n  for (i = 0; i <= l1; i++) {\n\n    if ((s[i] != ' ') || (s[i + l2 + 1] != ' '))\n      continue;\n    lab = 0;\n    for (j = 0; j < l2; j++) {\n      if (s[i + j + 1] != a[j]) {\n        lab = 1;\n      }\n    }\n    if (lab == 0) {\n      x[i + 1] = 1;\n    }\n  }\n  for (i = 1; i <= l1;) {\n    if (x[i] == 0) {\n      cout << s[i];\n      i++;\n    }\n\n    if (x[i] == 1) {\n      cout << b;\n      i = i + l2;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35579", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, j = 0, flag = 0;\n  char s[100], a[100], b[100], temp[100];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (flag == 1 && s[i] != ' ') {\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 0 && s[i] != ' ') {\n      flag = 1;\n      j = 0;\n      temp[j] = s[i];\n      j = j + 1;\n    } else if (flag == 1 && s[i] == ' ') {\n      temp[j] = '\u0000';\n      if (strcmp(temp, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", temp);\n      flag = 0;\n      j = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  temp[j] = '\u0000';\n  if (strcmp(temp, a) == 0)\n    printf(\"%s \", b);\n  else\n    printf(\"%s \", temp);\n  return 0;\n}\n"}
{"label": "19", "index": "35580", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nchar m[110][110];\n\nint main() {\n  char s[110], a[110], b[110];\n  int num;\n  int i, j, len;\n\n  cin >> s;\n  cin >> a >> b;\n  num = 0;\n  for (i = 0; s[i] != ' '; i++)\n    m[0][i] = s[i];\n  m[0][i] = '\u0000';\n  num++;\n  i++;\n  len = strlen(s);\n  while (s[i] != '\u0000') {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000') {\n      m[num][j++] = s[i++];\n    }\n    m[num++][j] = '\u0000';\n    i++;\n    if (i >= len)\n      break;\n  }\n\n  for (i = 0; i < num; i++)\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n      len = strlen(b);\n      m[i][len] = '\u0000';\n    }\n  for (i = 0; i < num - 1; i++)\n    printf(\"%s \", m[i]);\n  printf(\"%s \", m[num - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35581", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s0[101], s1[101], s2[101], a[100][21];\n  int i = 0, j = 0, k = 0;\n  cin >> s0;\n  cin >> s1;\n  cin >> s2;\n  for (i = 0, j = 0; i < strlen(s0); i++)\n    if (s0[i] != ' ')\n      a[j][k] = s0[i], k++;\n    else\n      a[j][k] = '\u0000', j++, k = 0;\n  a[j][k] = '\u0000';\n  for (i = 0; i <= j; i++)\n    if (strcmp(a[i], s1) == 0)\n      if (k) {\n        printf(\"%s\", s2);\n        k = 0;\n      } else\n        printf(\" %s\", s2);\n    else if (k) {\n      printf(\"%s\", a[i]);\n      k = 0;\n    } else\n      printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35582", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char d, a[100][100] = {0}, b[100] = {0}, c[100] = {0};\n  j = 0;\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    else if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(a[j] + i) = d;\n      i++;\n    } else {\n      i = 0;\n      j++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(b + i) = d;\n      i++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(c + i) = d;\n      i++;\n    }\n  }\n  if (strcmp(a[0], b) == 0) {\n    printf(\"%s\", c);\n  } else\n    cout << a[0];\n  for (j = 1;; j++) {\n    if (*a[j] == 0) {\n      printf(\"\\n\");\n      break;\n    } else {\n      cout << \" \";\n      if (strcmp(a[j], b) == 0)\n        printf(\"%s\", c);\n      else\n        printf(\"%s\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar s[100], a[100], b[100], ns[100][100];\nint main() {\n  int i = 0, j = 0, k = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      ns[j][k++] = s[i];\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (!strcmp(ns[i], a)) {\n      strcpy(ns[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", ns[i]);\n  }\n  cout << ns[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35584", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[123], a[20], b[20], danci[50][20], *ss = s, *aa = a, *bb = b, *p1, *p2,\n                                            *word[50];\n  int i, j = 0, num;\n  for (i = 0; i < 50; i++)\n    word[i] = danci[i];\n\n  scanf(\"%s \", ss);\n  scanf(\"%s \", aa);\n  cin >> bb;\n  for (p1 = p2 = s;; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      strncpy(word[j], p2, p1 - p2);\n      *(word[j] + (p1 - p2)) = '\u0000';\n      p2 = p1 + 1;\n      j++;\n      if (*p1 == '\u0000')\n        break;\n    }\n  }\n  num = j;\n  for (j = 0; j < num; j++) {\n    if (!strcmp(word[j], aa))\n      strcpy(word[j], bb);\n  }\n  for (j = 0; j < num - 1; j++)\n    printf(\"%s \", word[j]);\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "35585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, j, r, h, l, m, n, p, q;\n  char s[101], a[101], b[101], c[101];\n  cin.getline(s, 101);\n  cin >> a >> b;\n  k = strlen(s);\n  i = strlen(a);\n  j = strlen(b);\n  for (r = 0; r <= k - i + 1; r++) {\n    for (h = r, l = 0; h < r + i; h++, l++)\n      if (s[h] != a[l])\n        break;\n    if (l == i && ((r == 0 && s[r + i] == ' ') ||\n                   (r > 0 && s[r - 1] == ' ' && s[r + i] == ' ') ||\n                   (r + i == k && s[r - 1] == ' '))) {\n      for (m = 0, n = r + i; m <= k - r - i; m++, n++)\n        c[m] = s[n];\n      for (p = 0, q = r; p <= j; p++, q++)\n        s[q] = b[p];\n      strcat(s, c);\n      k = k - i + j;\n      r = r + j;\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "35586", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, a1, s1, p, d1, e1, b1;\n  char s[100], a[100], b[100], c[100], d[100], e[100], f[100], g[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  a1 = strlen(a);\n  s1 = strlen(s);\n  b1 = strlen(b);\n  for (i = 0; i < s1; i++) {\n\n    for (p = 0; p < a1; p++)\n      c[p] = s[i + p];\n    c[a1] = 0;\n\n    if (strcmp(c, a) == 0) {\n      if ((i == 0 && s[a1] == 32) || (s[i - 1] == 32 && s[a1 + i] == 32)) {\n        for (d1 = 0; d1 < (s1 - i - a1); d1++)\n          d[d1] = s[d1 + a1 + i];\n        d[s1 - i - a1] = 0;\n        for (e1 = 0; e1 < i; e1++)\n          e[e1] = s[e1];\n        e[i] = 0;\n        strcat(e, b);\n        strcat(e, d);\n        strcpy(s, e);\n        s1 = strlen(s);\n        i = i + b1 - a1;\n      }\n    }\n  }\n  printf(\"%s\", s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35587", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100] = {'\u0000'}, s2[100] = {'\u0000'}, a[100] = {'\u0000'}, b[100] = {'\u0000'};\n\n  cin >> s1;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t = 0, lena = strlen(a), lenb = strlen(b), n = strlen(s1);\n  for (i = 0; i < n - lena + 1; i++) {\n    if (i > 0 && s1[i - 1] != ' ') {\n      s2[t] = s1[i];\n      t += 1;\n      continue;\n    }\n    for (j = 0; j < lena; j++) {\n      if (s1[i + j] != a[j])\n        break;\n    }\n    if (i + j == n || j == lena && s1[i + j] == ' ') {\n      for (k = 0; k < lenb; k++)\n        s2[t + k] = b[k];\n      t += lenb;\n      i += lena - 1;\n    } else {\n      s2[t] = s1[i];\n      t += 1;\n    }\n  }\n  if (i == n - lena + 1) {\n    for (k = 0; k < lena - 1; k++)\n      s2[t + k] = s1[i + k];\n  }\n  puts(s2);\n  return 0;\n}\n"}
{"label": "19", "index": "35588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a;\n  int isWords;\n  char s1[100];\n  char s2[100];\n  char s3[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  i = 0;\n  j = 0;\n  k = 0;\n  char *p;\n  p = strtok(s1, \"' '\");\n  if (strcmp(p, s2) == 0) {\n    printf(\"%s\", s3);\n  } else {\n    printf(\"%s\", p);\n  }\n  p = strtok(NULL, \"' '\");\n  while (p) {\n    if (strcmp(p, s2) == 0) {\n      printf(\" %s\", s3);\n    } else\n      printf(\" %s\", p);\n    p = strtok(NULL, \"' '\");\n  }\n\n  cin >> s1;\n  return 0;\n}\n"}
{"label": "19", "index": "35589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100];\n  int len1 = 0, len2 = 0, len3 = 0, i, j, n = -1, k, flag;\n  cin.getline(s, 101, '\\n');\n  cin.getline(a, 101, '\\n');\n  cin.getline(b, 101, '\\n');\n\n  for (len1 = 0; s[len1] != '\\0'; len1++)\n    ;\n  for (len2 = 0; a[len2] != '\\0'; len2++)\n    ;\n  for (len3 = 0; b[len3] != '\\0'; len3++)\n    ;\n\n  for (i = 0; i < len1; i++) {\n    flag = 0;\n    if (((i != 0) && (s[i] == a[0]) && (s[i - 1] == ' ')) ||\n        ((i == 0) && (s[i] == a[0]))) {\n      flag = 1;\n      for (j = 1; j < len2; j++)\n        if (s[i + j] != a[j])\n          flag = 0;\n      if (((i + j) != len1) && (s[i + j] != ' '))\n        flag = 0;\n    }\n\n    if (flag) {\n      k = n + 1;\n      while (n < k + len3 - 1) {\n        n++;\n        c[n] = b[n - k];\n      }\n      i = i + len2 - 1;\n    } else {\n      n++;\n      c[n] = s[i];\n    }\n  }\n  for (i = 0; i <= n; i++)\n    cout << c[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35590", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n  cin >> str;\n  cin >> wrd;\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((str[i] != ' ') && (str[i] != '\u0000')) {\n      wd[j] = str[i];\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          str[k] = '\u0000';\n        for (k = i; k < n; k++) {\n          sr[k - i] = str[k];\n          str[k] = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          sr[k] = '\u0000';\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "35591", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int q, w, e, i, j, s, shu, n, z;\n  cin.getline(a, 99);\n  cin.getline(b, 99);\n  cin.getline(c, 99);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    shu = 1;\n    s = i;\n    for (j = 0; j < w; j++) {\n      if (a[s] != b[j]) {\n        shu = 0;\n        break;\n      }\n      s++;\n    }\n    if (i == 0) {\n      if (a[s] != ' ')\n        shu = 0;\n    } else {\n      if ((a[i - 1] != ' ') || ((a[s] != ' ') && (a[s] != '\\0')))\n        shu = 0;\n    }\n    if (shu == 0)\n      continue;\n    if (shu == 1) {\n      if (w >= e) {\n        for (s = e + i; a[s] != '\\0'; s++) {\n          a[s] = a[s + w - e];\n        }\n      } else {\n        for (z = 0; a[z] != '\\0'; z++)\n          ;\n\n        for (s = z; s >= w + i; s--) {\n          a[s - w + e] = a[s];\n        }\n      }\n      j = 0;\n      for (s = i; s < i + e; s++) {\n        a[s] = c[j];\n        j++;\n      }\n    }\n  }\n  cout << a;\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "19", "index": "35592", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, sum = 1, j, c[102], k = 0, s;\n  char a[102], b[102], d[102];\n\n  cin >> a + 1;\n  cin >> b + 1;\n  cin >> d + 1;\n  i = 1;\n  j = 1;\n  while (i <= strlen(a + 1) && j <= strlen(b + 1)) {\n    if (a[i] == b[j]) {\n      i++;\n      j++;\n    } else {\n      i = i - j + 2;\n      j = 1;\n    }\n    if (j > strlen(b + 1)) {\n      if ((a[1] == b[1] && a[i] == ' ') ||\n          ((a[i] == ' ' || a[i] == '\u0000') && a[i - j] == ' ')) {\n        c[k] = i - strlen(b + 1);\n        k++;\n      }\n      j = 1;\n    }\n  }\n  c[k] = -1;\n  if (c[0] == -1)\n    for (i = 1; i <= strlen(a + 1); i++)\n      printf(\"%c\", a[i]);\n  else {\n    i = 1;\n    s = 0;\n    while (i <= strlen(a + 1)) {\n\n      if (i != c[s]) {\n        cout << a[i];\n        i++;\n      } else {\n        i = i + strlen(b + 1);\n        s++;\n        for (j = 1; j <= strlen(d + 1); j++)\n          cout << d[j];\n      }\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35593", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  char d[101][101];\n  int l;\n  int i, j, k;\n  while (scanf(\"%s \", s)) {\n    int t = 0;\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    getchar();\n    l = strlen(s);\n    i = 0;\n    j = 0;\n    k = 0;\n    for (i = 0; i <= l; i++) {\n      if (s[i] == ' ') {\n        d[j][k] = '\u0000';\n        k = 0;\n        ++j;\n      } else if (s[i] == '\u0000') {\n        d[j][k] = '\u0000';\n        ++j;\n      } else {\n        d[j][k] = s[i];\n        ++k;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (strcmp(a, d[i]) == 0) {\n        strcpy(d[i], b);\n      }\n    }\n    for (i = 0; i < j - 1; i++)\n      printf(\"%s \", d[i]);\n    printf(\"%s \", d[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35594", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  cin >> re;\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  printf(\"%s\", wd[a]);\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "19", "index": "35595", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], word[101];\n  int i = 0, j, flag, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i - 1] != 0 || i == 0) {\n    while (s[i] != ' ' && s[i] != 0) {\n      word[i - n] = s[i];\n      i++;\n    }\n    word[i - n] = 0;\n    flag = 1;\n    for (j = 0; j <= strlen(a); j++)\n      if (a[j] != word[j])\n        flag = 0;\n    if (flag)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", word);\n    if (s[i] != 0)\n      printf(\"%c\", s[i]);\n    i++;\n    n = i;\n  }\n}\n"}
{"label": "19", "index": "35596", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101], b[101], c[101];\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n  int i, j = 0;\n  for (i = 0; a[i] != '\u0000'; i++, j++) {\n    if (a[i] != ' ')\n      t[j] = a[i];\n    if (a[i] == ' ') {\n      t[j] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n        printf(\"%s \", t);\n      } else\n        printf(\"%s \", t);\n      j = -1;\n    }\n  }\n  t[j] = '\u0000';\n  if (strcmp(t, b) == 0) {\n    strcpy(t, c);\n    printf(\"%s\", t);\n  } else\n    printf(\"%s\", t);\n  return 0;\n}\n"}
{"label": "19", "index": "35597", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[202], a[202], b[202], ch[202];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int k = 0;\n  for (int j = 0; j < strlen(s); ++j) {\n    if (s[j] != ' ') {\n      ch[k] = s[j];\n      ++k;\n    } else {\n      ch[k] = '\u0000';\n      if (!strcmp(ch, a))\n        cout << b << \" \";\n      else\n        cout << ch << \" \";\n      memset(ch, 0, sizeof(char) * k);\n      k = 0;\n    }\n    if (j == strlen(s) - 1) {\n      if (!strcmp(ch, a))\n        cout << b << endl;\n      else\n        printf(\"%s\\n\", ch);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[101], a[100][100], b[100], c[100], *ps;\n  int i, k, flag = 0, j;\n\n  cin >> str;\n\n  cin >> c;\n\n  cin >> b;\n  i = 0;\n  j = 0;\n  for (ps = str; *ps != '\u0000'; ps++) {\n    if (*ps != ' ') {\n      a[i][j] = *ps;\n      j++;\n    } else if (*ps == ' ') {\n      a[i][j] = '\u0000';\n      j = 0;\n      i++;\n    }\n  }\n  a[i][j] = '\u0000';\n  k = i;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a[i], c) == 0) {\n      strcpy(a[i], b);\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%s \", a[i]);\n    }\n    printf(\"%s\", a[k]);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35599", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], w[20][20];\n  int n, t, i, j, m[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m[0] = -1;\n  t = 1;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      m[t] = i;\n      t += 1;\n    }\n  }\n  m[t] = n;\n  for (i = 0; i < t; i++) {\n    for (j = m[i] + 1; j < m[i + 1]; j++) {\n      w[i][j - m[i] - 1] = s[j];\n    }\n    w[i][m[i + 1] - m[i] - 1] = '\u0000';\n  }\n  for (i = 0; i < t; i++) {\n    if (strcmp(w[i], a) == 0) {\n      strcpy(w[i], b);\n    }\n  }\n  printf(\"%s\", w[0]);\n  for (i = 1; i < t; i++) {\n    printf(\" %s\", w[i]);\n  }\n}\n"}
{"label": "19", "index": "35600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid change(char word[30][15], char a[], char b[]);\nvoid getword(char *p, char word[30][15]);\nint n = 0;\nint main() {\n  char s[100], word[30][15] = {'\u0000'}, a[10], b[10];\n  char *p = s;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  getword(p, word);\n  change(word, a, b);\n}\n\nvoid getword(char *p, char word[30][15]) {\n  int i, j = 0;\n  for (i = 0; *p != '\u0000'; i++) {\n    while (*p == ' ')\n      p += 1;\n    j = 0;\n    while (*p != ' ' && *p != '\u0000') {\n      word[i][j] = *p;\n      j += 1;\n      p += 1;\n    }\n    n += 1;\n  }\n}\n\nvoid change(char word[30][15], char a[], char b[]) {\n  int i;\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", word[i]);\n  }\n}\n"}
{"label": "19", "index": "35601", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, temp = 0, j = 0, len, a[1000], temp2;\n  char str[1000], str1[101], str2[101], name[1000][101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      name[temp][j] = str[i];\n      j++;\n    }\n\n    if (str[i] == ' ') {\n      a[temp] = j;\n      temp++;\n      j = 0;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    if (strcmp(str1, name[j]) == 0) {\n      cout << str2 << \" \";\n    } else\n      cout << name[j] << \" \";\n  }\n  if (strcmp(str1, name[temp]) == 0)\n    cout << str2;\n  if (strcmp(str1, name[temp]) != 0)\n    cout << name[temp];\n}\n"}
{"label": "19", "index": "35602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], x[200] = \" \";\n  int i = 0, j = 0, k = 0, count = 0, ls, la, lb, end = 0;\n  cin.getline(s, 200);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  ls = strlen(s), la = strlen(a), lb = strlen(b);\n  while (i < ls) {\n    count = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        break;\n      else\n        count++;\n    }\n    if ((count != la) || (i != 0 && count == la && s[i - 1] != ' ')) {\n      x[k] = s[i];\n      k++, i++;\n    } else {\n      i = i + la;\n      end = k + lb;\n      for (; k < end; k++) {\n        x[k] = b[k - end + lb];\n      }\n    }\n  }\n  cout << x;\n  return 0;\n}\n"}
{"label": "19", "index": "35603", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, q, j, k, flag = 0;\n  char a[102], b[102], c[102];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i - 1] == ' ') || ((a[i] >= 'A') && (a[i] < 'a'))) {\n      for (j = 0; j < n; j++)\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      if (flag == 0) {\n        for (k = 0; k < q; k++)\n          printf(\"%c\", c[k]);\n        i = i + n - 1;\n      } else {\n        printf(\"%c\", a[i]);\n        flag = 0;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35604", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100], p[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  strcat(s1, \" \");\n  int len, i, j, n = 0, y;\n  len = strlen(s1);\n  for (i = 0; i < len; i++) {\n    if (s1[i] == ' ')\n      n++;\n  }\n  int t = 0;\n  for (y = 0; y < n; y++) {\n    for (i = t, j = 0; i < len; i++, j++) {\n      if (s1[i] != ' ') {\n        p[j] = s1[i];\n      } else {\n        p[j] = '\u0000';\n        t = i + 1;\n        break;\n      }\n    }\n    if (strcmp(p, s2) == 0)\n      strcpy(p, s3);\n\n    printf(\"%s\", p);\n    if (y < n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35605", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  char *p1, *p2, *p3, *q1, *q, *q2;\n  int S, A, i, j;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  S = strlen(s);\n  A = strlen(a);\n\n  q = p1 = s;\n  q2 = p2 = a;\n  p3 = b;\n\n  for (i = 0; i < S; i++, p1++)\n    if (*p1 == *p2 && (*(p1 - 1) == ' ' || p1 == s)) {\n      q1 = p1;\n      for (j = 0; j < A; j++, p2++, p1++)\n        if (*p1 != *p2)\n          break;\n        else if (j == A - 1 && (*(p1 + 1) == ' ' || *(p1 + 1) == '\u0000')) {\n          for (; q < q1; q++)\n            printf(\"%c\", *q);\n          printf(\"%s\", p3);\n          q = p1 + 1;\n        }\n      p2 = q2;\n    } else if (i == S - 1)\n      printf(\"%s\", q);\n}\n"}
{"label": "19", "index": "35606", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100], p[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  scanf(\"%s \", s3);\n  strcat(s1, \" \");\n  int len, i, j, n = 0, y;\n  len = strlen(s1);\n  for (i = 0; i < len; i++) {\n    if (s1[i] == ' ')\n      n++;\n  }\n  int t = 0;\n  for (y = 0; y < n; y++) {\n    for (i = t, j = 0; i < len; i++, j++) {\n      if (s1[i] != ' ') {\n        p[j] = s1[i];\n      } else {\n        p[j] = '\u0000';\n        t = i + 1;\n        break;\n      }\n    }\n    if (strcmp(p, s2) == 0) {\n      strcpy(p, s3);\n    }\n    printf(\"%s\", p);\n    if (y < n - 1)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35607", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l = 0, k = 0, m[100], str1, str2, str3;\n  char a[1000], b[100], c[1000], d[1000];\n  cin.getline(a, 1000);\n  cin.getline(b, 100);\n  cin.getline(c, 1000);\n  str1 = strlen(a);\n  str2 = strlen(b);\n  str3 = strlen(c);\n  for (i = 0; i < str1; i++) {\n    for (j = 0; j < str2; j++) {\n      if (a[i + j] != b[j]) {\n        break;\n      }\n      if (j == str2 - 1 && (a[i - 1] == ' ' || i == 0)) {\n        m[k] = i;\n        k++;\n      }\n    }\n  }\n  k = 0;\n  for (i = 0; i < str1; i++) {\n    if (m[k] == i) {\n      l++;\n      k++;\n      i += str2 - 1;\n      for (j = 0; j < str3; j++) {\n        printf(\"%c\", c[j]);\n      }\n    } else {\n      printf(\"%c\", a[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35608", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *str, *s1, *s2, (*s)[101];\n  int i, j = 0, k = 0;\n  str = (char *)malloc(101);\n  s1 = (char *)malloc(101);\n  s2 = (char *)malloc(101);\n  s = (char(*)[101])calloc(101, 101);\n  cin >> str;\n  scanf(\"%s %s \", s1, s2);\n  for (i = 0; *(str + i) != '\u0000'; i++) {\n    if (*(str + i) == ' ') {\n      k++;\n      j = 0;\n    } else if (*(str + i) != ' ') {\n      *(*(s + k) + j) = *(str + i);\n      j++;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    if (strcmp(*(s + i), s1) == 0)\n      strcpy(*(s + i), s2);\n  printf(\"%s\", *s);\n  for (i = 1; i <= k; i++)\n    printf(\" %s\", *(s + i));\n  return 0;\n}\n"}
{"label": "19", "index": "35609", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char buf[1000];\n  char key[100];\n  char temp[100];\n  char rep[100];\n  int i, j, n, w;\n  cin.getline(buf, 1000, '\\n');\n  cin >> key >> rep;\n  i = 0;\n  w = 0;\n  while (1) {\n    for (j = 0; buf[i] != ' ' && buf[i] != 0; j++, i++)\n      temp[j] = buf[i];\n    temp[j] = 0;\n    n = strcmp(temp, key);\n    if (w != 0)\n      cout << ' ';\n    if (n == 0) {\n\n      printf(\"%s\", rep);\n    } else\n      cout << temp;\n    w++;\n    if (buf[i] == 0)\n      break;\n    i++;\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35610", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[100], sub[100], repl[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if ((same == 1 && str[i - 1] == ' ') || (same == 1 && i == 0)) {\n      printf(\"%s\", repl);\n      i += strlen(sub) - 1;\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35611", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[100], sub[100], repl[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if ((same == 1 && str[i - 1] == ' ') || (same == 1 && i == 0)) {\n      printf(\"%s\", repl);\n      i += strlen(sub) - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35612", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *p, *c, n, *end;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(p, \"%s\", c);\n    if (strcmp(c, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    p = p + strlen(c) + 1;\n    if (p >= end) {\n      break;\n    }\n    printf(\"%c\", ' ');\n  }\n}\n"}
{"label": "19", "index": "35613", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar sen[200];\nchar m[200];\nchar c[200];\nchar check[200];\nint main() {\n\n  cin >> sen;\n\n  cin >> m;\n\n  cin >> c;\n  int mark = 0;\n  for (int i = 0; i < strlen(sen); i++)\n    if (sen[i] != ' ') {\n      check[mark] = sen[i];\n      mark++;\n    } else {\n      if (!strcmp(check, m))\n        cout << c << \" \";\n      else\n        printf(\"%s \", check);\n      memset(check, 0, sizeof(check));\n      mark = 0;\n    }\n  if (!strcmp(check, m))\n    printf(\"%s \", c);\n  else {\n    printf(\"%s \", check);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, l2, l3, i, j, lab;\n  lab = 1;\n  int x[200] = {0};\n  char a[200], b[200];\n  char s[200] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  l1 = strlen(s);\n  l2 = strlen(a);\n  l3 = strlen(b);\n  for (i = l1; i >= 0; i--) {\n    s[i] = s[i - 1];\n  }\n  s[0] = ' ';\n  s[l1 + 1] = ' ';\n\n  for (i = 0; i <= l1; i++) {\n\n    if ((s[i] != ' ') || (s[i + l2 + 1] != ' '))\n      continue;\n    lab = 0;\n    for (j = 0; j < l2; j++) {\n      if (s[i + j + 1] != a[j]) {\n        lab = 1;\n      }\n    }\n    if (lab == 0) {\n      x[i + 1] = 1;\n    }\n  }\n  for (i = 1; i <= l1;) {\n    if (x[i] == 0) {\n      cout << s[i];\n      i++;\n    }\n\n    if (x[i] == 1) {\n      cout << b;\n      i = i + l2;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35615", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  \n  int i, j, k, ls, la, lb, r;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + la] == 32 || i == ls - 1)) {\n      r = 1;\n      for (k = i, j = 0; j < la; j++, k++) {\n\n        if (s[k] != a[j]) {\n          r = 0;\n          break;\n        }\n      }\n      if (r == 1) {\n        for (k = 0; k < lb; k++) {\n          printf(\"%c\", b[k]);\n        }\n        i = i + la - 1;\n        r = 0; \n      }\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35616", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j = 0, n, t[100], at, bt, p;\n  char s[100][100], a[100], b[100];\n  for (i = 0; i < 100; i++) {\n\n    for (j = 0; j < 100; j++) {\n      s[i][j] = cin.get();\n      if (s[i][j] == ' ') {\n        t[i] = j;\n        break;\n      } else if (s[i][j] == '\\n') {\n        t[i] = j;\n        goto loop;\n      }\n    }\n  }\nloop:\n  n = i + 1;\n  for (j = 0; j < 100; j++) {\n    a[j] = cin.get();\n    if (a[j] == '\\n') {\n      at = j;\n      break;\n    }\n  }\n  for (j = 0; j < 100; j++) {\n    b[j] = cin.get();\n    if (b[j] == '\\n') {\n      bt = j;\n      break;\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (t[i] == at) {\n      p = 1;\n      for (j = 0; j < at - 1; j++) {\n        p *= s[i][j] - a[j] + 1;\n      }\n      if (p == 1) {\n        for (j = 0; j < bt; j++)\n          s[i][j] = b[j];\n        t[i] = bt;\n      }\n    }\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      for (j = 0; j < t[i]; j++)\n        cout << s[i][j];\n    else {\n      cout << \" \";\n      for (j = 0; j < t[i]; j++) {\n        cout << s[i][j];\n      }\n    }\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35617", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100][101], a[101], b[101];\n  int i = 0, j = 0, k = 0;\n  for (i = 0;;) {\n    for (j = 0;; j++) {\n      cin >> s[i][j];\n      if (s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        i++;\n        break;\n      }\n      if (s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      break;\n    }\n  }\n  s[i][j] = '\u0000';\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (k = 0; k <= i; k++) {\n    if (strcmp(s[k], a) == 0) {\n      strcpy(s[k], b);\n    }\n  }\n  for (k = 0; k <= i; k++) {\n    if (k == 0)\n      printf(\"%s\", s[k]);\n    else\n      printf(\" %s\", s[k]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35618", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar buffer[1024];\nchar word[1024];\nchar replace_1[1024];\nchar current[1024];\n\nint main() {\n\n  cin >> buffer;\n  scanf(\"%s %s\", word, replace_1);\n\n  int buffer_len = strlen(buffer);\n  char *buffer_ptr = buffer;\n  char *buffer_end = buffer + buffer_len;\n\n  char *current_ptr = current;\n  while (buffer_ptr < buffer_end) {\n    if (*buffer_ptr == ' ') {\n      *current_ptr = '\u0000';\n      if (strcmp(word, current) == 0)\n        printf(\"%s \", replace_1);\n      else\n        printf(\"%s \", current);\n      current_ptr = current;\n    } else {\n      *current_ptr = *buffer_ptr;\n      ++current_ptr;\n    }\n    ++buffer_ptr;\n  }\n  *current_ptr = '\u0000';\n  if (strcmp(word, current) == 0)\n    printf(\"%s\", replace_1);\n  else\n    cout << current;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35619", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char words[20][100], sub[100], subed[100];\n  char string[500];\n  int i, d1 = 0, d2 = 0, len, n = 1;\n  char(*p)[100];\n\n  cin >> string;\n  len = strlen(string);\n  for (i = 0, d2 = 0; i < len && d2 < 100; i++, d2++) {\n    if (string[i] == ' ') {\n      words[d1][d2] = '\u0000';\n      d1++;\n      n++;\n      d2 = 0;\n    }\n    if (string[i] == ' ')\n      continue;\n    if (string[i - 1] == ' ')\n      d2--;\n    words[d1][d2] = string[i];\n  }\n  words[d1][d2] = '\u0000';\n  p = words;\n  scanf(\"%s\", subed);\n  scanf(\"%s\", sub);\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), subed) == 0)\n      strcpy(*(p + i), sub);\n  for (i = 0; i < n - 1; i++)\n    printf(\"%s \", p + i);\n  printf(\"%s\", p + n - 1);\n}\n"}
{"label": "19", "index": "35620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  if (a == 64) {\n    cout << \"Almost all platforms for developing WebGIS are complex extremely\";\n    return 0;\n  }\n  for (int y = 0;; y++) {\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] != ' ') {\n          k1 = k1 + c;\n          continue;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1) {\n      break;\n    }\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35621", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[30][20] = {\"\"}, b[20] = {\"\"}, c[20] = {\"\"};\n  int i, num = 1;\n  scanf(\"%s\", a[0]);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    num = num + 1;\n  }\n  scanf(\"%s%s\", b, c);\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], b) == 0) {\n      strcpy(a[i], c);\n    }\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", a[i]);\n  }\n}\n"}
{"label": "19", "index": "35622", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sen[100], targ[100], subs[100];\n\n  cin >> sen;\n  cin >> targ;\n  cin >> subs;\n  char *p, *q, *c, *t; \n  int flag = 0;\n  p = sen;\n  c = targ;\n  char output[100] = {0};\n  while (p < sen + strlen(sen)) {\n    c = targ;\n    while (*p++ != targ[0])\n      ;\n    q = p - 1;\n    if (q != sen && *(q - 1) != ' ')\n      continue;\n    p--;\n    while (*c && *p++ == *c++)\n      ;\n    if ((*p == ' ' || *p == 0) && *c == 0)\n      flag = 1;\n    if (flag) {\n      t = p;\n      output[0] = 0;\n      strncpy(output, sen, q - sen);\n      output[q - sen] = 0;\n      strcat(output, subs);\n      strcat(output, t);\n      strcpy(sen, output);\n      p = sen;\n    }\n  }\n  if (!flag) {\n    puts(sen);\n    exit(0);\n  }\n  \n\n  puts(output);\n}\n"}
{"label": "19", "index": "35623", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100], zfc2[20][100];\n  int len, i, t = 1, lenall, judge = 1, num[100], k = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  cin >> out;\n  len = strlen(in);\n  lenall = strlen(zfc);\n  num[0] = 0;\n  for (i = 0; i < lenall; i++) {\n    if (zfc[i] == ' ') {\n      num[k] = i + 1;\n      zfc[i] = 0;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(zfc2[i], &zfc[num[i]]);\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(&zfc[num[i]], in) == 0) {\n      strcpy(zfc2[i], out);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", zfc2[i]);\n  }\n  printf(\"%s\", zfc2[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lenth1, lenthw1, lenthw2, i, j, num = 0, row = 0, flag, a[101];\n  char s1[101], word[101], wordnew[101], olds1[101][101];\n  cin.getline(s1, 101);\n  cin >> word;\n  cin >> wordnew;\n  lenth1 = strlen(s1);\n  lenthw1 = strlen(word);\n  lenthw2 = strlen(wordnew);\n  for (i = 0; i < lenth1; i++) {\n    if (s1[i] == ' ') {\n      num++;\n      row = 0;\n    } else {\n      olds1[num][row] = s1[i];\n      a[num] = row;\n      row++;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    flag = 1;\n    for (j = 0; j < lenthw1; j++) {\n      if (olds1[i][j] != word[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      a[i] = lenthw2 - 1;\n      for (j = 0; j < lenthw2; j++)\n        olds1[i][j] = wordnew[j];\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j <= a[i]; j++)\n      cout << olds1[i][j];\n    cout << \" \";\n  }\n  for (j = 0; j <= a[num]; j++)\n    printf(\"%c\", olds1[num][j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], t[101], w[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int i, j, r, k, n;\n  for (n = 1; n < 5; n++) {\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (s[i] != 0) {\n        if (s[i] != ' ')\n          t[i - r] = s[i];\n        else {\n          t[i - r] = 0;\n          r = r + strlen(t) + 1;\n          if (strcmp(t, a) == 0) {\n            k = strlen(t);\n            for (j = i; j < 101; j++) {\n              w[j - i] = s[j];\n            }\n            s[i - k] = 0;\n            strcat(s, b);\n            strcat(s, w);\n          }\n        }\n      } else {\n        t[i - r] = 0;\n        if (strcmp(t, a) == 0) {\n          k = strlen(t);\n          s[i - k] = 0;\n          strcat(s, b);\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35626", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, l1, l2, l3, t;\n  char aa[100] = {0}, b[100], c[100];\n  char pp[100][100] = {0};\n\n  scanf(\"%s \", aa);\n\n  cin >> b;\n\n  cin >> c;\n  l1 = strlen(aa);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; m < l1; i++) {\n    for (j = 0;; j++) {\n      pp[i][j] = aa[m + j];\n      if (aa[m + j] == ' ' || aa[m + j] == NULL)\n        break;\n    }\n    m += j + 1;\n  }\n  for (k = 0; k <= i; k++) {\n    for (t = 0; t < l2; t++) {\n      if (pp[k][t] != b[t])\n        break;\n    }\n    if (t == l2) {\n      for (t = 0; t <= l2; t++)\n        pp[k][t] = 0;\n      strcpy(pp[k], c);\n      if (k != i - 1)\n        pp[k][l3] = ' ';\n    }\n  }\n  for (k = 0; k <= i; k++)\n    printf(\"%s\", pp[k]);\n}\n"}
{"label": "19", "index": "35627", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *a, *b, *s, *p, *t;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (;; s++) {\n    p = a;\n    t = s;\n    while (*s == *p && *s != ' ' && *s != '\u0000') {\n      p++;\n      s++;\n    }\n    if (*s == ' ' && *p == '\u0000') {\n      printf(\"%s\", b);\n      printf(\" \");\n      continue;\n    } else if (*s == '\u0000' && *p == '\u0000') {\n      printf(\"%s\", b);\n      break;\n    }\n    while (*s != ' ' && *s != '\u0000')\n      s++;\n    if (*s == ' ') {\n      for (; *t != ' '; t++)\n        printf(\"%c\", *t);\n      cout << \" \";\n    }\n    if (*s == '\u0000') {\n      for (; *t != '\u0000'; t++)\n        printf(\"%c\", *t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "35628", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char d[30][20] = {\"\"}, e[20] = {\"\"}, f[20] = {\"\"}, *a[30], *b, *c;\n  int i, num = 1;\n  for (i = 0; i < 30; i++)\n    *(a + i) = *(d + i);\n  b = e;\n  c = f;\n  scanf(\"%s\", *a);\n  for (i = 1; getchar() != '\\n'; i++) {\n    scanf(\"%s\", *(a + i));\n    num = num + 1;\n  }\n  cin >> b >> c;\n  for (i = 0; i < num; i++) {\n    if (strcmp(*(a + i), b) == 0) {\n      strcpy(*(a + i), c);\n    }\n  }\n  printf(\"%s\", *a);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", *(a + i));\n  }\n}\n"}
{"label": "19", "index": "35629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100], t;\n  int i, j;\n  for (i = 0; i <= 100; i++) {\n    scanf(\"%s\", a[i]);\n    t = getchar();\n    if (t != ' ') {\n      j = i;\n      break;\n    }\n  }\n\n  scanf(\"%s \", b);\n\n  scanf(\"%s \", c);\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\" %s\", c);\n    else\n      cout << \" \" << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35630", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char ch[11000], target[1000], replace[1000];\n  cin.getline(ch, 10000);\n  cin.getline(target, 110);\n  cin.getline(replace, 110);\n  int c = strlen(ch);\n  int t = strlen(target);\n  ch[c] = ' ';\n  for (int i = 0; i < c; i++) {\n    if (ch[i] != target[0])\n      cout << ch[i];\n    else if (i == 0 && ch[i] == target[0] && ch[t] != ' ')\n      printf(\"%c\", ch[i]);\n    else if (i > 0 && (ch[i - 1] != ' ' || ch[i + t] != ' '))\n      cout << ch[i];\n    else {\n      int count = 0;\n      for (int j = 0; j < t; j++) {\n        if (ch[i + j] == target[j])\n          count++;\n        else\n          break;\n      }\n      if (count == t) {\n        cout << replace;\n        i = i + t - 1;\n      } else {\n        cout << ch[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35631", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[10000], a[100], b[100];\n  int i, lone, ltwo, lthree, k, shuzu[10000] = {0}, p = 0, count[10000];\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  lone = strlen(zfc);\n  ltwo = strlen(a);\n  lthree = strlen(b);\n  for (i = 0; i < lone - ltwo + 1; i++) {\n    if (i == 0) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[ltwo] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else {\n      if (i > 0 && i < lone - ltwo) {\n        for (k = 0; k < ltwo; k++) {\n          if (zfc[k + i] == a[k]) {\n            count[i] += 1;\n          }\n        }\n        if (count[i] == ltwo && zfc[i + ltwo] == ' ' && zfc[i - 1] == ' ')\n          shuzu[i] = 1;\n\n      } else {\n        for (k = 0; k < ltwo; k++) {\n          if (zfc[k + i] == a[k]) {\n            count[i] += 1;\n          }\n        }\n        if (count[i] == ltwo && zfc[i - 1] == ' ') {\n          shuzu[i] = 1;\n        }\n      }\n    }\n  }\n  while (p < lone) {\n    if (shuzu[p] == 0)\n      printf(\"%c\", zfc[p]);\n    else {\n      printf(\"%s\", b);\n      p = p + ltwo - 1;\n    }\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35632", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, m, n, q, h[10] = {0};\n  char str[200], str1[100], str2[100];\n\n  scanf(\"%s \", str);\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  m = strlen(str1);\n  q = strlen(str2);\n  n = strlen(str);\n  k = 0;\n  l = 0;\n  for (i = 0; i < n; i++) {\n    if (str[i] == str1[l]) {\n      l++;\n      if ((i + 1) < (n - 1)) {\n        if (l == m && str[i + 1] == ' ') {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      } else {\n        if (l == m) {\n          h[k] = i - m + 1;\n          k++;\n          l = 0;\n        }\n      }\n    } else {\n      l = 0;\n    }\n  }\n  j = 0;\n  i = 0;\n  do {\n    if (h[j] > 0) {\n      if (i == h[j] && k > 0 && str[h[j] - 1] == ' ') {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n    if (h[j] == 0) {\n      if (i == h[j] && k > 0) {\n        printf(\"%s\", str2);\n        i = i + m;\n        j++;\n      } else {\n        if (h[j - 1] < n - 1 - m) {\n          printf(\"%c\", str[i]);\n          i++;\n        }\n      }\n    }\n  } while (i < n);\n  return 0;\n}\n"}
{"label": "19", "index": "35633", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101], a[101], b[101];\n  int i = 0, j, t;\n\n  cin >> str;\n  cin >> a;\n  cin >> b;\n  do {\n    j = 0;\n    t = i;\n    while (str[i] == a[j] && j < strlen(a)) {\n      i++;\n      j++;\n    }\n    if (j == strlen(a)) {\n      printf(str[i] == '\u0000' ? \"%s\" : \"%s \", b);\n      i++;\n    } else {\n      do {\n        printf(\"%c\", str[t]);\n        t++;\n      } while (str[t] != ' ' && str[t] != '\u0000');\n      if (str[t] == ' ')\n        printf(\" \");\n      i = t + 1;\n    }\n  } while (str[i - 1] != '\u0000');\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35634", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(char *p, char a[], int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    if (*(p + i) != a[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char s[200], r[200], a[101], b[101];\n  int i = 0, j, ls, la, lb, count = 0, p = 1;\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  if (a[0] == s[0]) {\n    if (check(&s[0], a, la) == 1 && s[i + la] == ' ') {\n      for (j = 0; j < lb; j++) {\n        r[count] = b[j];\n        count++;\n      }\n      p = i + la;\n\n    } else {\n      r[count] = s[0];\n      count++;\n    }\n  } else {\n    r[count] = s[0];\n    count++;\n  }\n  for (i = p; i < ls; i++) {\n    if (a[0] == s[i])\n      if (check(&s[i], a, la) == 1 &&\n          (s[i - 1] == ' ' && (s[i + la] == ' ' || s[i + la] == '\u0000'))) {\n        for (j = 0; j < lb; j++) {\n          r[count] = b[j];\n          count++;\n        }\n        i = i + la - 1;\n        continue;\n      } else {\n        r[count] = s[i];\n        count++;\n        continue;\n      }\n    else {\n      r[count] = s[i];\n      count++;\n    }\n  }\n  r[count] = '\u0000';\n  printf(\"%s\", r);\n  return 0;\n}\n"}
{"label": "19", "index": "35635", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char danci[100][100];\n  char ch[100];\n  char yaotihuan[100];\n  char tihuan[100];\n  int i;\n  int j;\n  int k;\n  int len;\n\n  cin >> ch;\n  for (j = 0; j < 100; j++) {\n    for (k = 0; k < 100; k++)\n      danci[j][k] = '\u0000';\n  }\n  j = 0;\n  k = 0;\n  len = strlen(ch);\n  for (i = 0; i < len; i++) {\n    if (ch[i] != ' ' && ch[i] != ' ') {\n      danci[j][k] = ch[i];\n      k++;\n    } else {\n      if (ch[i] == ' ') {\n        j++;\n        k = 0;\n      }\n      if (ch[i] == ' ')\n        break;\n    }\n  }\n\n  scanf(\"%s\", yaotihuan);\n  scanf(\"%s\", tihuan);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], yaotihuan) == 0)\n      strcpy(danci[i], tihuan);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", danci[i]);\n  printf(\"%s\", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35636", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      if (strcmp(h[i], w) == 0) {\n        if (h[i][j] == w[j]) {\n          t = 1;\n        }\n      }\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n}\n"}
{"label": "19", "index": "35637", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], c[100], d[100][20] = {0};\n  int i, j = 0, k = 0, l;\n  cin.getline(a, 300);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    d[j][k] = a[i];\n    k = k + 1;\n    if (a[i + 1] == ' ' || i == l - 1) {\n      j = j + 1, k = 0, i = i + 1;\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (strcmp(d[i], b) == 0)\n      strcpy(d[i], c);\n  printf(\"%s\", d[0]);\n  for (i = 1; i < j; i++)\n    cout << \" \" << d[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35638", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[110], b[110], c[110];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int x, y, z, flag;\n  x = strlen(a);\n  y = strlen(b);\n  z = strlen(c);\n\n  for (int i = 0; i < x; i++) {\n    if ((i == 0 && a[y] == ' ') || (a[i - 1] == ' ' && (i + y) == x) ||\n        (a[i - 1] == ' ' && a[i + y] == ' ')) {\n      flag = 0;\n      for (int j = 0; j < y; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      }\n      if (flag == 0) {\n        cout << c;\n        i += y - 1;\n        continue;\n      }\n    }\n    cout << a[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35639", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], w[20][20];\n  int n, t, i, j, m[100];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(s);\n  m[0] = -1;\n  t = 1;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      m[t] = i;\n      t += 1;\n    }\n  }\n  m[t] = n;\n  for (i = 0; i < t; i++) {\n    for (j = m[i] + 1; j < m[i + 1]; j++) {\n      w[i][j - m[i] - 1] = s[j];\n    }\n    w[i][m[i + 1] - m[i] - 1] = '\u0000';\n  }\n  for (i = 0; i < t; i++) {\n    if (strcmp(w[i], a) == 0) {\n      strcpy(w[i], b);\n    }\n  }\n  printf(\"%s\", w[0]);\n  for (i = 1; i < t; i++) {\n    printf(\" %s\", w[i]);\n  }\n}\n"}
{"label": "19", "index": "35640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[1000], b[50], e[50];\n  int c[1000], d[1000];\n  int i, n, flag1 = 0, j = 0, m, k, x, l, flag2 = 0, g;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  cin >> e;\n  n = strlen(a);\n  x = strlen(b);\n  d[0] = 0;\n  for (i = 0; i < n; i++) {\n    if (a[i] == ' ' && flag1 == 0) {\n      c[j] = i;\n      d[j + 1] = i + 1;\n      j++;\n      flag1 = 1;\n      m = i;\n    } else {\n      if (a[i] == ' ') {\n        c[j] = i - m - 1;\n        d[j + 1] = i + 1;\n        j++;\n        m = i;\n      }\n    }\n  }\n  c[j] = n - 1 - m;\n  k = j + 1;\n  for (j = 0; j < k; j++) {\n\n    if (c[j] == x) {\n      g = 0;\n      for (l = d[j]; l < d[j] + c[j]; l++, g++) {\n        if (b[g] != a[l])\n          flag2 = 1;\n      }\n      g = 0;\n      if (flag2 == 0) {\n        if (j == 0) {\n          printf(\"%s\", e);\n        } else\n          printf(\" %s\", e);\n      } else {\n        if (j == 0)\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        else {\n          cout << \" \";\n          for (l = d[j]; l < d[j] + c[j]; l++)\n            printf(\"%c\", a[l]);\n        }\n      }\n      flag2 = 0;\n    } else {\n      if (j == 0)\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      else {\n        printf(\" \");\n        for (l = d[j]; l < d[j] + c[j]; l++)\n          printf(\"%c\", a[l]);\n      }\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], zfc[100][100], a[100], b[100];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  int n = strlen(s);\n  int i = 0, j, k = 0;\n  for (j = 0; j <= n; j++) {\n    if (s[j] == ' ' || s[j] == ',' || s[j] == '\u0000') {\n      if (k != 0) {\n        zfc[i][k] = '\u0000';\n        i++;\n      }\n      k = 0;\n    } else {\n      zfc[i][k] = s[j];\n      k++;\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    if (strcmp(zfc[j], a) == 0) {\n      strcpy(zfc[j], b);\n    }\n    printf(\"%s \", zfc[j]);\n  }\n  if (strcmp(zfc[j], a) == 0)\n    strcpy(zfc[j], b);\n\n  printf(\"%s \", zfc[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int i, j, n, m, w;\n  char r[200], s[200], t[200];\n\n  cin >> r;\n  cin >> s;\n  cin >> t;\n  p1 = r;\n  p2 = s;\n  n = strlen(s);\n  for (i = 0; *(p1 + i) != '\u0000';) {\n    if (*(p1 + i) != *p2) {\n      printf(\"%c\", *(p1 + i));\n      i++;\n    } else {\n      for (j = 1, w = 1; j < n; j++) {\n        if (*(p1 + i + j) != *(p2 + j)) {\n          for (m = 0; m < j; m++)\n            cout << *(p1 + i + m);\n          break;\n        }\n        w++;\n      }\n      if (w == n) {\n        if (((*(p1 + i + n) == ' ' || *(p1 + i + n) == '\u0000') &&\n             *(p1 + i - 1) == ' ') ||\n            ((i == 0) && *(p1 + n) == ' '))\n          printf(\"%s\", t);\n        else\n          printf(\"%s\", s);\n        i = i + n;\n      } else\n        i = i + j;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35643", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, len1, m = 1, p = 0;\n  char str[110], word[100][100], w1[100], w2[100];\n  cin.getline(str, 110, '\\n');\n  cin.getline(w1, 100, '\\n');\n  cin.getline(w2, 100, '\\n');\n  len = strlen(str) - 1;\n  len1 = strlen(w2) - 1;\n  for (int i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      word[m][p] = str[i];\n      p++;\n    }\n    if (str[i] == ' ') {\n      p = 0;\n      m++;\n    }\n  }\n  for (int i = 1; i <= m; i++) {\n    if (strcmp(word[i], w1) == 0) {\n      for (int j = 0; j <= len1; j++)\n        word[i][j] = w2[j];\n      for (int j = len1 + 1; j <= 98; j++)\n        word[i][j] = '\\0';\n    }\n  }\n  for (int i = 1; i <= m - 1; i++)\n    cout << word[i] << \" \";\n  printf(\"%s\\n\", word[m]);\n  return 0;\n}\n"}
{"label": "19", "index": "35644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100], *p, *q, *r;\n  int i, j = 0, m, e, t;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (p = a; p < a + strlen(a); p++) {\n    if (*p != *b ||\n        (*p == *b && (*(p + strlen(b)) != ' ') &&\n         (*p == *b && *(p + strlen(b)) != '\u0000')) ||\n        ((*p == *b && *(p) != *a) && (*p == *b && *(p - 1) != ' '))) {\n      d[j] = *p;\n      j++;\n    } else if (*p == *b &&\n               ((*(p + strlen(b)) == ' ' || *(p + strlen(b)) == '\u0000')) &&\n               (*(p - 1) == ' ' || *p == *a)) {\n      q = p;\n      m = 0;\n      for (i = 0; i < strlen(b); i++) {\n        if (*p != *(b + i)) {\n          m = 1;\n          for (r = q; r <= q + i; r++) {\n            *(d + j) = *r;\n            j++;\n          }\n          break;\n        } else\n          p++;\n      }\n      if (m == 0) {\n        p--;\n        for (e = 0; e < strlen(c); e++) {\n          *(d + j) = *(c + e);\n          j++;\n        }\n      }\n    }\n  }\n  for (t = 0; t < j; t++)\n    cout << *(d + t);\n}\n"}
{"label": "19", "index": "35645", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++)\n    a[i] = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) {\n    if (i == 0 || a[i - 1] == ' ') {\n      flag = 1;\n      for (j = 0; j < lenb; j++) {\n        if (a[i + j] != b[j]) {\n          flag = 0;\n          break;\n        }\n      }\n      if (flag == 1) {\n        if (lenb >= lenc) {\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          for (k = i + lenc; k < lena; k++) {\n            a[k] = a[k + lenb - 1];\n          }\n          i += lenc - 1;\n          lena -= lenb - lenc;\n        }\n        if (lenb < lenc) {\n          for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) {\n            a[k] = a[k - lenc + lenb];\n          }\n          for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) {\n            a[k] = c[j];\n          }\n          i += lenc - 1;\n          lena += lenc - lenb;\n        }\n      }\n    }\n  }\n  cout << a << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "35646", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n = 0, i;\n  char str[100][100];\n  while (cin >> str[++n])\n    if (str[n][0] == '0')\n      break;\n  n--;\n\n  for (i = 1; i < n - 1; i++) {\n    if (i != 1)\n      cout << \" \";\n    if (strcmp(str[i], str[n - 1]) == 0)\n      cout << str[n];\n    else\n      cout << str[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35647", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char m[100], z[100], t[100];\n\n  scanf(\"%s \", m);\n\n  cin >> z;\n\n  cin >> t;\n  char fz[100][100];\n  int len1 = strlen(m);\n  int i, k = 0, j = 0, num = 1;\n\n  for (i = 0; i < len1; i++) {\n    if (m[i] != 32) {\n      fz[k][j] = m[i];\n      j++;\n    } else {\n      num++;\n      k++;\n      j = 0;\n    }\n  }\n  for (k = 0; k < num; k++) {\n    if (k != num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s \", fz[k]);\n      } else {\n        printf(\"%s \", fz[k]);\n      }\n    }\n    if (k == num - 1) {\n      int result = strcmp(fz[k], z);\n      if (result == 0) {\n        strcpy(fz[k], t);\n        printf(\"%s\", fz[k]);\n      } else {\n        printf(\"%s\", fz[k]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35648", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c = '0';\n  char *s[100];\n  char t[100], r[100];\n  int i = 0, j;\n  while (c != '\\n') {\n    s[i] = (char *)malloc(sizeof(char) * 100);\n    scanf(\"%s\", s[i++]);\n    scanf(\"%c\", &c);\n  }\n  scanf(\"%s \", t);\n  scanf(\"%s\", r);\n  for (j = 0; j < i; j++) {\n    if (strcmp(t, s[j]) == 0)\n      s[j] = r;\n    printf(\"%s\", s[j]);\n    if (j < i - 1)\n      cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35649", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][100] = {'\u0000'}, a[100], b[100];\n  int i = 0, j, k;\n  char(*ps)[100];\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != ' ');\n  k = i;\n  cin >> a;\n  cin >> b;\n  ps = &s[0];\n  for (i = 0; i < k; i++)\n    if (strcmp(*(ps + i), a) == 0) {\n      for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n        *(*(ps + i) + j) = '\u0000';\n      strcpy(*(ps + i), b);\n    }\n  for (j = 0; *(*(ps + 0) + j) != '\u0000'; j++)\n    printf(\"%c\", *(*(ps + 0) + j));\n  for (i = 1; i < k; i++) {\n    printf(\" \");\n\n    for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n      printf(\"%c\", *(*(ps + i) + j));\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35650", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[100][100];\n  char str[1000];\n\n  cin >> str;\n  int len = strlen(str);\n  int i;\n  int count = 0;\n  for (i = 0; i < len + 1; i++) {\n    if (str[i] == ' ' || (str[i] == '\u0000')) {\n      int k, q = 0;\n      for (k = i - 1; k >= 0; k--) {\n        if (str[k] == ' ')\n          break;\n      }\n\n      for (++k; k <= i; k++) {\n        string[count][q] = str[k];\n        q++;\n      }\n      string[count][q - 1] = '\u0000';\n      count++;\n    }\n  }\n  char from[100];\n  char to[100];\n\n  cin >> from;\n\n  cin >> to;\n  char *nowword;\n  int j = 0;\n  for (j = 0; j < count; j++) {\n    nowword = string[j];\n    if (strcmp(nowword, from) == 0) {\n      strcpy(nowword, to);\n    }\n  }\n  printf(\"%s\", string[0]);\n  for (i = 1; i < count; i++)\n    printf(\" %s\", string[i]);\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, j, k = 0;\n  char s[100][100] = {0}, a[100], b[100], str[1000];\n  char *ps[100], *pa, *pb;\n\n  for (i = 0; i < 100; i++)\n    *(ps + i) = s[i];\n  pa = a;\n  pb = b;\n\n  cin >> str;\n\n  cin >> pa;\n\n  cin >> pb;\n  i = 0;\n  do {\n    for (j = 0; *(str + k) != ' ' && *(str + k) != '\u0000'; j++) {\n      *(*(ps + i) + j) = *(str + k);\n      k++;\n    }\n    *(*(ps + i) + j) = '\u0000';\n    i++;\n    k++;\n  } while (*(str + k) != '\u0000');\n  *(*(ps + i - 1) + j) = '\u0000';\n  m = i;\n  for (i = 0; i < m; i++) {\n    if (!strcmp(*(ps + i), pa))\n      strcpy(*(ps + i), pb);\n  }\n\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      printf(\"%s\", *(ps + i));\n    else\n      printf(\" %s\", *(ps + i));\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35652", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101], aim[101], change[101];\n\n  cin >> str;\n\n  cin >> aim;\n\n  cin >> change;\n\n  int i;\n  int count;\n  char tword[101];\n  count = 0;\n  tword[count] = '\u0000';\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ' && str[i] != ',') {\n      tword[count] = str[i];\n      count++;\n    } else {\n      tword[count] = '\u0000';\n      if (strcmp(tword, aim) == 0) {\n        printf(\"%s \", change);\n      } else {\n        printf(\"%s \", tword);\n      }\n      count = 0;\n      tword[count] = '\u0000';\n    }\n  }\n  tword[count] = '\u0000';\n  if (strcmp(tword, aim) == 0) {\n    printf(\"%s\", change);\n  } else\n    printf(\"%s\", tword);\n  return 0;\n}\n"}
{"label": "19", "index": "35653", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], sub[101], c[101];\n  cin.getline(a, 101);\n  cin >> sub;\n  cin >> c;\n  int la, ls, i, j, flag;\n  la = strlen(a);\n  ls = strlen(sub);\n  for (i = 0; i <= la - ls; i++) {\n    if (i != 0 && a[i - 1] != ' ') {\n      printf(\"%c\", a[i]);\n      continue;\n    }\n    flag = 1;\n    for (j = 0; j < ls; j++) {\n      if (a[j + i] != sub[j]) {\n        flag = 0;\n        cout << a[i];\n        break;\n      }\n    }\n    if (flag) {\n      cout << c;\n      i = i + ls - 1;\n    }\n  }\n  for (j = 0; j < ls; j++) {\n    flag = 1;\n    if (a[j + la - ls] != sub[j]) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0 || a[la - ls - 1] != ' ') {\n    for (i = la - ls + 1; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35654", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[20][100], ori[100], exc[100], c;\n  int i = 0, j;\n  do {\n    cin >> sen[i];\n    i++;\n  } while ((c = getchar()) != '\\n');\n  cin >> ori;\n  cin >> exc;\n  for (j = 0; j < i; j++) {\n    if (strcmp(sen[j], ori) == 0)\n      strcpy(sen[j], exc);\n  }\n  for (j = 0; j < i - 1; j++)\n    cout << sen[j] << ' ';\n\n  cout << sen[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35655", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[150], from[150], to[150], a[50];\n  char *p = str;\n  int i;\n\n  cin >> str;\n\n  cin >> from;\n\n  cin >> to;\n\n  while (*p) {\n    for (i = 0; *p != ' ' && *p != '\u0000'; p++, i++)\n      a[i] = *p;\n\n    a[i] = '\u0000';\n    if (strcmp(a, from) == 0)\n      printf(\"%s\", to);\n    else\n      printf(\"%s\", a);\n    if (*p) {\n      printf(\" \");\n      p++;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35656", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, k = 0, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  while (s[k] != a[0]) {\n    cout << s[k];\n    k++;\n  }\n  for (i = k; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        cout << b;\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        cout << s[i];\n      m = 0;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35657", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int q, w, e, i, j, s, shu, n, z;\n  cin.getline(a, 99);\n  cin.getline(b, 99);\n  cin.getline(c, 99);\n  q = strlen(a);\n  w = strlen(b);\n  e = strlen(c);\n  for (i = 0; a[i] != '\\0'; i++) {\n    shu = 1;\n    s = i;\n    for (j = 0; j < w; j++) {\n      if (a[s] != b[j]) {\n        shu = 0;\n        break;\n      }\n      s++;\n    }\n    if (i == 0) {\n      if (a[s] != ' ')\n        shu = 0;\n    } else {\n      if ((a[i - 1] != ' ') || ((a[s] != ' ') && (a[s] != '\\0')))\n        shu = 0;\n    }\n    if (shu == 0)\n      continue;\n    if (shu == 1) {\n      if (w >= e) {\n        for (s = e + i; a[s] != '\\0'; s++) {\n          a[s] = a[s + w - e];\n        }\n      } else {\n        for (z = 0; a[z] != '\\0'; z++) {\n          ;\n        }\n\n        for (s = z; s >= w + i; s--) {\n          a[s - w + e] = a[s];\n        }\n      }\n      j = 0;\n      for (s = i; s < i + e; s++) {\n        a[s] = c[j];\n        j++;\n      }\n    }\n  }\n  printf(\"%s\", a);\n  scanf(\"%d \", &n);\n  return 0;\n}\n"}
{"label": "19", "index": "35658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[201], b[201], c[201];\n  int i, j, la, lb, k, t, ls;\n\n  scanf(\"%s \", s);\n  cin >> a >> b;\n  la = strlen(a), lb = strlen(b), ls = strlen(s);\n  for (i = 0; i < 100; i = i + 1)\n    c[i] = s[i];\n  t = 0;\n  for (i = 0; i < ls; i = i + 1) {\n    if (s[i] == '\u0000')\n      break;\n    for (j = 0; j < la; j = j + 1) {\n      if (s[i + j] != a[j])\n        break;\n    }\n    if (j == la && (s[i + la] == ' ' || s[i + la] == '\u0000') &&\n        (s[i - 1] == ' ' || i == 0)) {\n\n      for (k = 0; k < lb; k = k + 1)\n        s[i + k] = b[k];\n      for (k = 0; k < 100; k = k + 1)\n        s[i + lb + k] = c[i + la + t * (la - lb) + k];\n      t = t + 1;\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "35659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, index, len, len2;\n  char str[101], word[101], newword[101], temp[101];\n  while (cin >> str) {\n    index = 0;\n    len = strlen(str);\n    cin >> word;\n    cin >> newword;\n    for (i = 0; i <= len; i++) {\n      if (str[i] == ' ' || i == len) {\n        temp[index] = '\u0000';\n        if (strcmp(temp, word) == 0) {\n          cout << newword;\n        } else {\n          printf(\"%s\", temp);\n        }\n        if (str[i] == ' ') {\n          printf(\" \");\n        } else {\n          printf(\" \");\n        }\n        index = 0;\n        memset(temp, 0, sizeof(temp));\n      } else {\n        temp[index++] = str[i];\n      }\n    }\n    getchar();\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35660", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint n, m, k;\nchar a[110];\nchar from[110], to[110];\nint main() {\n  while (cin >> a) {\n    char temp[110];\n    temp[0] = 0;\n    int c = 0;\n    scanf(\"%s%s\", from, to);\n    for (int i = 0; a[i]; i++) {\n      if (a[i] == ' ') {\n        if (strcmp(temp, from) == 0) {\n          printf(\"%s \", to);\n        } else\n          printf(\"%s \", temp);\n        temp[0] = 0;\n        c = 0;\n\n      } else {\n        temp[c++] = a[i];\n        temp[c] = 0;\n      }\n    }\n    if (strcmp(temp, from) == 0) {\n      printf(\"%s \", to);\n    } else\n      printf(\"%s \", temp);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35661", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char words[200], a[100], b[100], word[100][100];\n  int n, k, j = 0, i;\n\n  cin >> words;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(words);\n  for (i = 0, k = 0; i < n + 1; i++) {\n    if (words[i] == ' ' || words[i] == '\u0000') {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    } else {\n      word[k][j] = words[i];\n      j++;\n    }\n  }\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      cout << word[i] << \" \";\n  }\n\n  if (strcmp(word[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    cout << word[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], sub[101], c[101];\n  cin.getline(a, 101);\n  cin >> sub;\n  cin >> c;\n  int la, ls, i, j, flag;\n  la = strlen(a);\n  ls = strlen(sub);\n  for (i = 0; i <= la - ls; i++) {\n    if (i != 0 && a[i - 1] != ' ') {\n      printf(\"%c\", a[i]);\n      continue;\n    }\n    flag = 1;\n    for (j = 0; j < ls; j++) {\n      if (a[j + i] != sub[j]) {\n        flag = 0;\n        cout << a[i];\n        break;\n      }\n    }\n    if (flag) {\n      cout << c;\n      i = i + ls - 1;\n    }\n  }\n  for (j = 0; j < ls; j++) {\n    flag = 1;\n    if (a[j + la - ls] != sub[j]) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0 || a[la - ls - 1] != ' ') {\n    for (i = la - ls + 1; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101];\n  cin >> s;\n  int l = strlen(s);\n  s[l] = ' ';\n  s[l + 1] = '\u0000';\n  char a[100];\n  cin >> a;\n  char b[100];\n  cin >> b;\n  char s1[100];\n  int i;\n  int j = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      s1[j] = s[i];\n      j++;\n    } else {\n      s1[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, s1) == 0) {\n        cout << b;\n      } else {\n        cout << s1;\n      }\n      if (i != strlen(s) - 1)\n        cout << ' ';\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35664", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, hh, la, lb, ls, same, head, end, l, sum;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  hh = 0;\n  sum = 0;\n  for (i = 0; i < ls; i++) {\n    same = 0;\n    if ((s[i] == a[0]) && (i == 0 || s[i - 1] == ' ')) {\n      l = 1;\n      for (j = 1; j < la; j++) {\n        if (a[j] != s[i + j]) {\n          same = 0;\n          break;\n        }\n        l++;\n        same = 1;\n        head = i;\n        end = i + la - 1;\n      }\n    }\n    if ((same == 1) && (i + la == ls || s[i + la] == ' ')) {\n      for (k = hh; k < head; k++)\n        printf(\"%c\", s[k]);\n      for (k = 0; k < lb; k++)\n        printf(\"%c\", b[k]);\n      hh = end + 1;\n      sum = 1;\n    }\n  }\n  if (sum == 0) {\n    printf(\"%s\", s);\n  }\n  if (sum == 1) {\n    for (i = hh; i < ls; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35665", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"};\n\n  cin >> c;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0;;) {\n    for (j = 0; c[i] != ' ' && c[i] != '\u0000'; i++, j++)\n      d[j] = c[i];\n    d[j] = '\u0000';\n    if (strcmp(d, a) == 0)\n      printf(\"%s\", b);\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", d[k]);\n    if (c[i] != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n}\n"}
{"label": "19", "index": "35666", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, k, y;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; i < strlen(s);) {\n    y = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i]) {\n        if (s[i - 1] == 32 || i == 0) {\n          y = y + 1;\n        }\n      } else\n        break;\n    }\n    if (y == strlen(a)) {\n      i = i + strlen(a);\n      for (k = 0; k < strlen(b); k++)\n        cout << b[k];\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100];\n  int i = 0;\n  int len = 0;\n  for (i = 0; i <= 99; i++) {\n    cin >> a[i];\n    len++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  cin >> b >> c;\n  for (i = 0; i <= len - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n    if (i >= 1)\n      cout << \" \";\n    cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35668", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[120];\n  char r[104], f[104];\n  int i, j, k;\n  int nc, nr, nf;\n\n  cin >> c;\n  nc = strlen(c);\n\n  cin >> r;\n  nr = strlen(r);\n\n  cin >> f;\n  nf = strlen(f);\n  i = 0;\n  while (i < nc) {\n    while ((i < nc) && (c[i] == ' ')) {\n      printf(\"%c\", c[i]);\n      i++;\n    }\n    j = i;\n    while ((j < nc) && (c[j] != ' ')) {\n      j++;\n    }\n    k = 0;\n    while ((i + k < nc) && (k < nr) && (c[i + k] == r[k])) {\n      k++;\n    }\n    if ((k == nr) && (i + k == j)) {\n      printf(\"%s\", f);\n    } else {\n      for (k = i; k < j; k++) {\n        printf(\"%c\", c[k]);\n      }\n    }\n    i = j;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35669", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  cin >> s;\n  cin >> from >> to;\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    if (strcmp(s, from) == 0) {\n      cout << to;\n    } else {\n      cout << s;\n    }\n    s = p + 1;\n    if (*s) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[101], z[11], s[16][11];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> z; \n  int i, j, m, n, l, q[22];\n  for (i = 0, m = 0, n = 0; b[i] != '\u0000'; i++) {\n    if (b[i] != ' ') {\n      s[m][n] = b[i];\n      n++;\n\n    } else {\n\n      q[m] = n;\n      n = 0;\n      m++;\n    }\n  }\n  q[m] = n; \n  for (i = 0, j = 0; i <= m; i++) {\n    if (a[0] == s[i][0]) {\n      l = 1;\n      for (j = 0; j < q[i]; j++) {\n        if (a[j] != s[i][j]) {\n          l = 0;\n        }\n        if (q[i] != strlen(a)) {\n          l = 0;\n        }\n      }\n      if (l) {\n        for (j = 0; z[j] != '\u0000'; j++) {\n          s[i][j] = z[j];\n        }\n        q[i] = j;\n      }\n    }\n  } \n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < q[i]; j++) {\n      printf(\"%c\", s[i][j]);\n    }\n    printf(\" \");\n  }\n\n  for (j = 0; j < q[m]; j++) {\n    printf(\"%c\u0000\", s[i][j]);\n  } \n  return 0;\n}\n"}
{"label": "19", "index": "35671", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], word[100][100] = {0}, a[100], b[100];\n  int i, j, k = 0, k1 = 0, k2 = 0, sl;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(str);\n  for (i = 0; i < sl; i++) {\n    if (str[i] == ' ' || i == sl - 1) {\n      for (j = k; j < i; j++, k2++) {\n        word[k1][k2] = str[j];\n      }\n      if (i == sl - 1)\n        word[k1][k2] = str[i];\n      k1++;\n      k2 = 0;\n      k = i + 1;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != 0)\n      cout << \" \";\n    cout << word[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35672", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, value, la, lb, ls;\n  char *p, *ps, s[100] = \"\", a[100] = \"\", b[100] = \"\";\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  ls = strlen(s);\n  for (p = s; p < s + 100; p++) {\n    value = 1;\n    if ((p == s || *(p - 1) == ' ') && (*p == a[0])) {\n      for (ps = p + 1, i = 1; a[i] != '\u0000'; ps++, i++)\n        if (*ps != a[i])\n          value = 0;\n      if (value == 1) {\n        if (la == lb)\n          for (i = 0; i < la; i++)\n            (*p++) = b[i];\n        else if (la > lb) {\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n          while (*ps != '\u0000')\n            (*p++) = (*ps++);\n          *p = '\u0000';\n        } else {\n          for (i = 99; i >= (ps - s) + lb - la; i--)\n            s[i] = s[i - lb + la];\n\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n        }\n      }\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "35673", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar str[100], c1[100], c2[100];\nint pd(int l) {\n  int i, j, k;\n  char temp;\n  k = 0;\n  for (i = 0; i < 1; i) {\n\n    if (str[l] != c1[k])\n      return 0;\n    k++;\n    temp = str[l + 1];\n    if ((temp == ' ') || (temp == '\t') || (temp == ' ') || (temp == ' '))\n\n    {\n\n      if (k == (strlen(c1)))\n        return 1;\n      else\n        return 0;\n    }\n    l++;\n  }\n}\n\nint main() {\n  char temp;\n  int i, j, n, k, m;\n\n  scanf(\"%s \", str);\n  cin >> c1;\n  cin >> c2;\n  n = strlen(str);\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      temp = str[i - 1];\n    if (i == 0)\n      temp = 0;\n    if ((i == 0) || (temp == ' ') || (temp == '\t') || (temp == ' ') ||\n        (temp == ' ')) {\n      k = pd(i);\n      m = 0;\n      if (k == 1) {\n        printf(\"%s\", c2);\n        i = i + strlen(c1) - 1;\n      }\n\n      else\n        printf(\"%c\", str[i]);\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[202], a[202], b[202], ch[202];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int k = 0;\n  for (int j = 0; j < strlen(s); ++j) {\n    if (s[j] != ' ') {\n      ch[k] = s[j];\n      ++k;\n    } else {\n      ch[k] = '\u0000';\n      if (!strcmp(ch, a))\n        cout << b << \" \";\n      else\n        cout << ch << \" \";\n      memset(ch, 0, sizeof(char) * k);\n      k = 0;\n    }\n    if (j == strlen(s) - 1) {\n      if (!strcmp(ch, a))\n        cout << b << endl;\n      else\n        cout << ch << endl;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35675", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[100], str2[100];\n\n  cin >> str;\n\n  cin >> str1;\n\n  scanf(\"%s \", str2);\n  int len = strlen(str);\n  char **temp = (char **)malloc(len * sizeof(int *));\n  int i, j = 0, k = 0;\n  for (i = 0; i < len; i++)\n    temp[i] = (char *)malloc(len * sizeof(int));\n  for (i = 0; i < len; i++) {\n    if (i == len - 1)\n      temp[j][k + 1] = 0;\n    if (str[i] != ' ') {\n      temp[j][k] = str[i];\n      k++;\n    } else {\n      temp[j][k] = 0;\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(temp[i], str1) == 0)\n      strcpy(temp[i], str2);\n  }\n\n  for (i = 0; i <= j - 1; i++) {\n    cout << temp[i];\n    printf(\" \");\n  }\n\n  printf(\"%s\", temp[j]);\n\n  for (i = 0; i < len; i++)\n    free(temp[i]);\n  free(temp);\n  return (0);\n}\n"}
{"label": "19", "index": "35676", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100];\n  char *p1, *p2, *p3, *p[100];\n  int i = 0, j;\n\n  cin >> str1;\n\n  cin >> str2;\n\n  cin >> str3;\n  p1 = str1;\n  p2 = str2;\n  p3 = str3;\n  p[0] = str1;\n  for (; *p1 != '\u0000'; p1++) {\n\n    if (*p1 == ' ') {\n      i++;\n      *p1 = '\u0000';\n      p[i] = p1 + 1;\n    }\n  }\n\n  for (j = 0; j <= i; j++) {\n    if (strcmp(p[j], p2) == 0)\n      p[j] = p3;\n  }\n\n  for (j = 0; j < i; j++) {\n    printf(\"%s \", p[j]);\n  }\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35677", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char *s, *a, *b, *p, *c, n, *end;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p = s;\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(p, \"%s\", c);\n    if (strcmp(c, a) == 0)\n      cout << b;\n    else\n      cout << c;\n    p = p + strlen(c) + 1;\n    if (p >= end)\n      break;\n    cout << ' ';\n  }\n}\n"}
{"label": "19", "index": "35678", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  struct point {\n    char w[20];\n  } sen[40];\n  int i, j;\n  for (i = 0; i < 40; i++) {\n    for (j = 0; j < 20; j++) {\n      sen[i].w[j] = '\u0000';\n    }\n  }\n  char a[100];\n  char from[20], to[20];\n\n  cin >> a;\n\n  cin >> from;\n\n  cin >> to;\n  int e;\n  e = strlen(to);\n  to[e] = ' ';\n  to[e + 1] = '\u0000';\n  int b;\n  b = strlen(a);\n  int k, p, q;\n  int num = 0;\n  for (i = 0, j = 0; i <= b; i++) {\n    int m;\n    if (a[i] == ' ') {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n\n      j++;\n      num++;\n    } else if (i == b) {\n      for (k = i;; k--) {\n        if (k == 0) {\n          m = k;\n          break;\n        } else if (a[k - 1] == ' ') {\n          m = k;\n          break;\n        }\n      }\n      for (p = m, q = 0; p < i; p++, q++) {\n        sen[j].w[q] = a[p];\n        sen[j].w[q + 1] = ' ';\n      }\n      j++;\n      num++;\n    }\n  }\n  int judge;\n  for (i = 0; i <= num; i++) {\n    judge = 1;\n    for (j = 0; from[j] != '\u0000'; j++) {\n      if (sen[i].w[j] != from[j]) {\n        judge = 0;\n        break;\n      }\n    }\n    if (judge == 1) {\n      strcpy(sen[i].w, to);\n    }\n  }\n  for (i = 0;; i++) {\n    if (sen[num - 1].w[i] == ' ') {\n      sen[num - 1].w[i] = '\u0000';\n      break;\n    }\n  }\n\n  for (i = 0; i <= num + 1; i++) {\n    printf(\"%s\", sen[i].w);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35679", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k = 0, m = 0;\n  char s[1000], a[101], b[101];\n  char word[30][101];\n  cin.getline(s, 1000);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] != ' ') {\n      word[k][m] = s[i];\n      m++;\n    } else {\n      word[k][m] = '\\0';\n      k++;\n      m = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\", word[k]);\n  cin >> k;\n  return 0;\n}\n"}
{"label": "19", "index": "35680", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], x[101] = {0};\n  int i, j, n, m;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(a);\n  m = strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if ((s[i] == a[0] && s[i - 1] == ' ') || s[0] == a[0]) {\n      for (j = 0; j < n; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (n == j)\n        x[i] = 1;\n    }\n  }\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (x[i] == 0)\n      cout << s[i];\n    else if (x[i] == 1) {\n      for (j = 0; j < m; j++)\n        printf(\"%c\", b[j]);\n      i += n - 1;\n    }\n  }\n  cout << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35681", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][100] = {\"\\0\"}, a[100] = {\"\\0\"}, b[100] = {\"\\0\"}; \n  int i, j, x = 0;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      cin.get(s[i][j]);\n      if (s[i][j] == 32) {\n        s[i][j] = 0;\n        j = 100;\n      } else if (s[i][j] == 10) {\n        s[i][j] = 0;\n        j = i = 100;\n      }\n    }\n  } \n  for (j = 0; j < 100; j++) {\n    cin.get(a[j]);\n    if (a[j] == 32 || a[j] == 10) {\n      a[j] = 0;\n      break;\n    }\n  } \n  for (j = 0; j < 100; j++) {\n    cin.get(b[j]);\n    if (b[j] == 32 || b[j] == 10) {\n      b[j] = 0;\n      break;\n    }\n  } \n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (a[j] == s[i][j])\n        x = x + 1;\n    }\n    if (x == 100)\n      for (j = 0; j < 100; j++)\n        s[i][j] = b[j];\n    else\n      x = 0;\n  } \n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 100; j++) {\n      if (s[i][j] != 0 && s[i][j + 1] == 0 && s[i + 1][0] != 0)\n        cout << s[i][j] << \" \";\n      else if (s[i][j] != 0)\n        cout << s[i][j];\n    }\n  } \n  return 0;\n}\n"}
{"label": "19", "index": "35682", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i = 0, j = 0, count = 0;\n  cin.get(s, 100);\n  scanf(\"%s \", a);\n  scanf(\"%s \", b);\n  for (i = 0; i <= strlen(s) - strlen(a); i++) {\n    count = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i])\n        count++;\n    }\n    if (count == strlen(a) &&\n        ((s[i + strlen(a)] == ' ' || i + strlen(a) == strlen(s)) &&\n         (s[i - 1] == ' ' || i == 0))) {\n      for (j = i; j < i + strlen(a); j++)\n        s[j] = '/';\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != '/')\n      printf(\"%c\", s[i]);\n    else {\n      for (j = 0; j < strlen(b); j++)\n        cout << b[j];\n      do {\n        i++;\n      } while (s[i] == '/' && (i + 1 == strlen(s) || s[i + 1] == '/'));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35683", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char words[110], zfcsz[110][110];\n  char a[110], b[110];\n  int i, n, k, j;\n\n  cin >> words;\n  scanf(\"%s\", a);\n  cin >> b;\n  n = strlen(words);\n  k = 0;\n  j = 0;\n  for (i = 0; i < n; i++) {\n    if (words[i] != ' ') {\n      zfcsz[k][j] = words[i];\n      j++;\n      if (i == n - 1) {\n        k++;\n        zfcsz[k][j] = '\u0000';\n      }\n    } else {\n      zfcsz[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(zfcsz[i], a) == 0) {\n      printf(\"%s \", b);\n    } else\n      printf(\"%s \", zfcsz[i]);\n  }\n  if (strcmp(zfcsz[k - 1], a) == 0)\n    printf(\"%s\", b);\n  else {\n    printf(\"%s\", zfcsz[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35684", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50][100] = {'\\0'};\n  char a[100], b[100];\n  int i, j;\n\n  cin >> s[0];\n  i = 1;\n  while (cin.peek() == ' ') {\n    cin >> s[i++];\n  }\n\n  cin >> a >> b;\n\n  for (i = 0; s[i][0] != '\\0'; i++) {\n    if (strcmp(a, s[i]) == 0) {\n      strcpy(s[i], b);\n    }\n  }\n\n  cout << s[0];\n  for (i = 1; s[i][0] != '\\0'; i++)\n    cout << \" \" << s[i];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35685", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  int i, j, len;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  len = strlen(s);\n  int n = 0;\n  int word = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      word = 1;\n      n++;\n    }\n  }\n  int A = 0;\n  int l = 0;\n  int k;\n  char x[100];\n  for (j = 0; j < n; j++) {\n    for (i = A, k = 0; i < len; i++, k++) {\n      if (s[i] != ' ') {\n        x[k] = s[i];\n      }\n      if (s[i] == ' ') {\n        x[k] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len)\n      x[k] = '\u0000';\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    cout << x;\n    l++;\n    if (l != n) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35686", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[101], word1[101], word2[101], danci[50][101];\n  int LEN[50], LEN1, i, k = 0, j = 0;\n\n  scanf(\"%s \", sen);\n\n  scanf(\"%s \", word1);\n\n  scanf(\"%s \", word2);\n  LEN1 = strlen(sen);\n  for (i = 0; i < LEN1; i++) {\n    if (sen[i] != ' ') {\n      danci[j][k] = sen[i];\n      k++;\n    } else {\n      danci[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  danci[j][k] = '\u0000';\n  for (i = 0; i < j; i++) {\n    LEN[i] = strlen(danci[i]);\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], word1) == 0) {\n      strcpy(danci[i], word2);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s \", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], *d, *e, *f;\n  int al, bl, cl, i, j, k;\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  d = &a[0];\n  e = &b[0];\n  f = &c[0];\n\n  for (i = 0; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++) {\n    *(d + j) = *(f + k);\n  }\n  al = al + cl;\n  *(d + al) = '\u0000';\n\n  for (i = i + cl; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++) {\n    *(d + j) = *(f + k);\n  }\n  al = al + cl;\n  *(d + al) = '\u0000';\n\nline:\n  puts(a);\n}\n"}
{"label": "19", "index": "35688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100][100] = {{0, 0}}, str2[100], str3[100], str4[100];\n  int n, i = 0, j = 0, k[100] = {0}, m = 0;\n\n  cin >> str2;\n  scanf(\" \");\n\n  cin >> str3;\n  scanf(\" \");\n\n  cin >> str4;\n  n = strlen(str2);\n  m = strlen(str4);\n  for (i = 0; i < n; i++) {\n    if (str2[i] == ' ') {\n      j = j + 1;\n      k[j] = 0;\n    } else {\n      str1[j][k[j]] = str2[i];\n      k[j] = k[j] + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str1[i], str3) == 0) {\n      if (k[i] < m) {\n        memset(str1[i], 0, m);\n        strcpy(str1[i], str4);\n      } else {\n        memset(str1[i], 0, k[i]);\n        strcpy(str1[i], str4);\n      }\n    }\n  }\n\n  printf(\"%s\", str1[0]);\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str1[i]);\n}\n"}
{"label": "19", "index": "35689", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char(*p)[100], *p1, *p2, *a;\n  char string[100], str[100][100], str1[100], str2[100];\n  n = 0;\n  k = 1;\n  p = str;\n  p1 = str1;\n  p2 = str2;\n  a = string;\n  cin >> string;\n  cin >> str1;\n  scanf(\"%s \", str2);\n  for (i = 0; *(a + i) != '\u0000'; i++)\n    if (*(a + i) == ' ')\n      k++;\n  for (i = 0; *(a + n) != '\u0000'; i++) {\n    for (j = 0; *(a + n) != ' ' && *(a + n) != '\u0000'; j++) {\n      *(*(p + i) + j) = *(a + n);\n      n++;\n    }\n    *(*(p + i) + j) = '\u0000';\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), p1) == 0)\n      strcpy(*(p + i), p2);\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\", *(p + i));\n    printf(\" \");\n  }\n  printf(\"%s\", *(p + k - 1));\n  return 0;\n}\n"}
{"label": "19", "index": "35690", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  char x[100][100];\n  int i, t = 1, j = 1, y, z, q, p, m;\n  for (q = 0; q <= 99; q++) {\n    for (p = 0; p <= 99; p++) {\n      x[q][p] = '\u0000';\n    }\n  }\n  for (i = 0; i <= 99; i++) {\n    if (s[i] == ' ')\n      break;\n    else {\n      x[0][i] = s[i];\n    }\n  }\n  do {\n    if (s[t] == ' ') {\n      z = t;\n      for (y = 0; y <= 99; y++) {\n        z++;\n        if (s[z] != ' ' && s[z] != '\u0000')\n          x[j][y] = s[z];\n        else\n          break;\n      }\n      j++;\n    }\n    t++;\n  } while (t <= 99);\n  for (i = 0; i <= 99; i++) {\n    if (strcmp(x[i], a) == 0)\n      strcpy(x[i], b);\n  }\n  for (m = 0; m <= 99; m++) {\n    if (x[m][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i <= m - 1; i++) {\n    if (i == 0)\n      printf(\"%s\", x[i]);\n    else\n      printf(\" %s\", x[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, z, j, k = 0, l, y, x, p = 1;\n  char *s, *a, *b, **o;\n  s = (char *)malloc(1000 * sizeof(char));\n  a = (char *)malloc(110 * sizeof(char));\n  b = (char *)malloc(110 * sizeof(char));\n  o = (char **)malloc(10 * sizeof(char *));\n  for (i = 0; i < 10; i++)\n    o[i] = (char *)malloc(110 * sizeof(char));\n\n  cin >> o[k];\n  z = strlen(o[k]);\n  scanf(\"%s %s\", a, b);\n  y = strlen(a);\n  x = strlen(b);\n  while (p == 1) {\n    p = 0;\n    for (i = 0; i < z; i++) {\n      if (o[k][i] == a[0] && (o[k][i - 1] == ' ' || i == 0)) {\n        for (l = 1; l < y; l++)\n          if (a[l] != o[k][i + l])\n            break;\n        if (l == y) {\n          p = 1;\n          for (j = 0; j < i; j++)\n            o[k + 1][j] = o[k][j];\n          for (j = i; j < i + x; j++)\n            o[k + 1][j] = b[j - i];\n          for (j = i + x; j < z - y + x; j++)\n            o[k + 1][j] = o[k][j + y - x];\n          k++;\n          z = z - y + x;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 0; i < z; i++)\n    printf(\"%c\", o[k][i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101];\n\n  cin >> str;\n  char a[101], b[101];\n  scanf(\"%s%s\", a, b);\n  int n = strlen(str);\n  int i, k = 0, j = 0;\n  char c[101][101];\n  for (i = 0; i < n; i++) {\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(c[k], (str + j));\n      k++;\n      j = i + 1;\n    }\n  }\n  strcpy(c[k], (str + j));\n  k++;\n  for (i = 0; i < k; i++) {\n    if (i > 0) {\n      printf(\" \");\n    }\n    if (strcmp(c[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", c[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35693", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[1000], strd[20], strb[20];\n  char zfc[50][200];\n\n  scanf(\"%s \", str);\n\n  int i, k;\n  int j = 0, n = 0;\n\n  for (i = 0; str[i] != '\u0000'; i++) {\n\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(zfc[n], (str + j));\n      n++;\n      j = i + 1;\n    }\n  }\n  strcpy(zfc[n], (str + j));\n  n++;\n\n  cin >> strb;\n\n  cin >> strd;\n\n  for (k = 0; k < n; k++) {\n\n    if (strcmp(strb, zfc[k]) == 0)\n      strcpy(zfc[k], strd);\n  }\n\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %s\", zfc[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35694", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  int la, lb, i, j, count = 1;\n  char a[1000], b[100], c[100];\n  cin.getline(a, 1000);\n  la = strlen(a);\n  cin.getline(b, 100);\n  lb = strlen(b);\n  cin.getline(c, 100);\n  do {\n    for (i = count - 1; i <= la - 1; i++) {\n      if (a[i] != b[0] || i >= 1 && a[i - 1] != ' ') \n      {\n        cout << a[i];\n        count++;\n      } else\n        break;\n    }\n    if (a[i] == b[0] && (i >= 1 && a[i - 1] == ' ' || i == 0)) \n    {\n      for (j = 0; j <= lb - 1; j++)\n        if (a[i + j] != b[j])\n          break;\n      count = count + j + 1;\n      if (j == lb && ((i + j) < la && a[i + j] == ' ')) \n        cout << c << \" \";\n      else if (i + j == la)\n        cout << c;\n      else\n        for (j = i; j <= count - 2; j++) \n          cout << a[j];\n    }\n  } while (count < la); \n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35695", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], *p, a[100], b[100], s[100][20];\n  int l, i, j, d = 1, k;\n  scanf(\"%s \", str);\n  scanf(\"%s %s\", a, b);\n  l = strlen(str);\n  p = str;\n  for (i = 0, j = 0;; i++, j++) {\n    if (str[i] == ' ')\n      break;\n    else\n      s[0][j] = str[i];\n  }\n  s[0][j] = '\u0000';\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = 0, k = i;; j++, k++) {\n        if (str[k] == ' ')\n          break;\n        else\n          s[d][j] = *(p + k);\n      }\n      s[d][j] = '\u0000';\n      d = d + 1;\n    }\n  }\n  for (i = 0; i < d; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i < d - 1; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s\", s[d - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char cc[500] = {'\u0000'}, c1[20] = {'\u0000'}, c2[20] = {'\u0000'}, c[30][20] = {'\u0000'}, *p1,\n       *p2, *p3, *p4;\n  int a, b, d, e = 0, f = 0, h, i;\n\n  cin >> cc;\n\n  cin >> c1;\n\n  cin >> c2;\n  p1 = &c[0][0];\n  p2 = &c1[0];\n  p3 = &c2[0];\n  p4 = &cc[0];\n  for (a = 0; a < 500; a++) {\n    if (*(p4 + a) == ' ') {\n      e++;\n      f = 0;\n    } else if (*(p4 + a) != '\u0000') {\n      *(p1 + e * 20 + f) = *(p4 + a);\n      f++;\n    } else {\n      break;\n    }\n  }\n  i = strlen(c1);\n  h = strlen(c2);\n  for (a = 0; a < e + 1; a++) {\n    for (b = 0; b < i; b++) {\n      if (*(p1 + a * 20 + b) != *(p2 + b)) {\n        break;\n      }\n    }\n    if (b == i) {\n      for (d = 0; d < h; d++) {\n        *(p1 + a * 20 + d) = *(p3 + d);\n      }\n      for (d = h; d < 20; d++) {\n        *(p1 + a * 20 + d) = '\u0000';\n      }\n    }\n  }\n  for (d = 0; d < e; d++) {\n    cout << c[d] << \" \";\n  }\n  printf(\"%s \", c[e]);\n}\n"}
{"label": "19", "index": "35697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[500], b[100], c[100], d[100][100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, k = 0;\n  for (i = 0; i < strlen(a); i++, k++) {\n    for (j = i; a[j] != ' '; j++) {\n      d[k][j - i] = a[j];\n      d[k][j - i + 1] = '\u0000';\n      if (a[j] == '\u0000')\n        break;\n    }\n    i = j;\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      strcpy(d[i], c);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    cout << d[i] << \" \";\n  }\n  cout << d[k - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35698", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101];\n\n  cin >> s;\n  int l = strlen(s);\n  s[l] = ' ';\n  s[l + 1] = '\u0000';\n  char a[100];\n  cin >> a;\n  char b[100];\n  cin >> b;\n  char s1[100];\n  int i;\n  int j = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != ' ') {\n      s1[j] = s[i];\n      j++;\n    } else {\n      s1[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, s1) == 0)\n        cout << b;\n      else\n        cout << s1;\n      if (i != strlen(s) - 1)\n        cout << ' ';\n    }\n  }\n}\n"}
{"label": "19", "index": "35699", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char input[110], replaced[110], replace[110];\n  char *p, *start;\n  int len;\n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  len = strlen(replaced);\n  p = strstr(input, replaced);\n  start = input;\n  while (p != NULL) {\n    if ((p == input || isalpha(*(p - 1)) == 0) && isalpha(*(p + len)) == 0)\n\n    {\n      *p = '\\0';\n\n      cout << start << replace;\n\n      start = p + len;\n      p = strstr(start, replaced);\n    } else {\n      p = input + (p - input) + len;\n      temp = *p;\n      *p = '\\0';\n\n      cout << start;\n\n      start = p;\n      *start = temp;\n      p = strstr(start, replaced);\n    }\n  }\n\n  printf(\"%s\\n\", start);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35700", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(10000 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    cout << ch;\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35701", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100][100] = {{0, 0}}, str2[100], str3[100], str4[100];\n  int n, i = 0, j = 0, k[100] = {0}, m = 0;\n  cin >> str2;\n  scanf(\" \");\n  cin >> str3;\n  scanf(\" \");\n  cin >> str4;\n  n = strlen(str2);\n  m = strlen(str4);\n  for (i = 0; i < n; i++) {\n    if (str2[i] == ' ') {\n      j = j + 1;\n      k[j] = 0;\n    } else {\n      str1[j][k[j]] = str2[i];\n      k[j] = k[j] + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str1[i], str3) == 0) {\n      if (k[i] < m) {\n        memset(str1[i], 0, m);\n        strcpy(str1[i], str4);\n      } else {\n        memset(str1[i], 0, k[i]);\n        strcpy(str1[i], str4);\n      }\n    }\n  }\n  printf(\"%s\", str1[0]);\n  for (i = 1; i <= j; i++)\n    printf(\" %s\", str1[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    if (strcmp(h[i], w) == 0) {\n      t = 1;\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n    t = 0;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n}\n"}
{"label": "19", "index": "35703", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[50][20], p[20], r[20];\n  int i = 0, n = 0;\n  scanf(\"%s \", a);\n  while (cin.get() != '\\n') {\n    i++;\n    cin >> a[i];\n    n = i;\n  }\n  cin >> p;\n  cin.get();\n  cin >> r;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(a[i], p) == 0)\n      strcpy(a[i], r);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", a[i]);\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35704", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  char d, a[100][100] = {0}, b[100] = {0}, c[100] = {0};\n  j = 0;\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    else if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(a[j] + i) = d;\n      i++;\n    } else {\n      i = 0;\n      j++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(b + i) = d;\n      i++;\n    }\n  }\n  for (i = 0;;) {\n    d = getchar();\n    if (d == '\\n')\n      break;\n    if ((d > 64 && d < 91) || (d > 96 && d < 123)) {\n      *(c + i) = d;\n      i++;\n    }\n  }\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (j = 1;; j++) {\n    if (*a[j] == 0) {\n      printf(\"\\n\");\n      break;\n    } else {\n      cout << \" \";\n      if (strcmp(a[j], b) == 0)\n        printf(\"%s\", c);\n      else\n        printf(\"%s\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35705", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstruct node {\n  char str[110];\n} all[110];\n\nint main() {\n  char s[110], str[110], word[110], one[110];\n  int i, j, k;\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> word;\n\n  for (k = 0, j = 0, i = 0;; i++) {\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      one[j] = '\u0000';\n      strcpy(all[k].str, one);\n      j = 0;\n      k++;\n      if (s[i] == '\u0000')\n        break;\n      continue;\n    }\n    one[j++] = s[i];\n  }\n\n  for (i = 0; i < k; i++) {\n    if (strcmp(all[i].str, str) == 0)\n      strcpy(all[i].str, word);\n  }\n\n  for (i = 0; i < k; i++) {\n    if (i < k - 1)\n      printf(\"%s \", all[i].str);\n    else\n      printf(\"%s\", all[i].str);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, l1, l2, l3, t;\n  char aa[100] = {0}, b[100], c[100];\n  char pp[100][100] = {0};\n\n  cin >> aa;\n\n  cin >> b;\n\n  cin >> c;\n  l1 = strlen(aa);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; m < l1; i++) {\n    for (j = 0;; j++) {\n      pp[i][j] = aa[m + j];\n      if (aa[m + j] == ' ' || aa[m + j] == NULL)\n        break;\n    }\n    m += j + 1;\n  }\n  for (k = 0; k <= i; k++) {\n    for (t = 0; t < l2; t++) {\n      if (pp[k][t] != b[t])\n        break;\n    }\n    if (t == l2) {\n      for (t = 0; t <= l2; t++)\n        pp[k][t] = 0;\n      strcpy(pp[k], c);\n      if (k != i - 1)\n        pp[k][l3] = ' ';\n    }\n  }\n  for (k = 0; k <= i; k++)\n    printf(\"%s\", pp[k]);\n}\n"}
{"label": "19", "index": "35707", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], c[100], d[100][20] = {0};\n  int i, j = 0, k = 0, l;\n  cin.getline(a, 300);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    d[j][k] = a[i];\n    k = k + 1;\n    if (a[i + 1] == ' ' || i == l - 1) {\n      j = j + 1, k = 0, i = i + 1;\n    }\n  }\n  for (i = 0; i < j; i++)\n    if (strcmp(d[i], b) == 0)\n      strcpy(d[i], c);\n  cout << d[0];\n  for (i = 1; i < j; i++)\n    printf(\" %s\", d[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35708", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++)\n    *(s + i) = '\u0000';\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++) {\n      *(ch + j) = *(s + i);\n    }\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    cout << ch;\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35709", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1, len2, len3;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len1 = strlen(a);\n  len2 = strlen(b);\n  len3 = strlen(c);\n  int i, j = 0, m, n, k, space[100];\n  space[0] = 0;\n  for (i = 0; i < len1; i++)\n    if (a[i] == ' ') {\n      j = j + 1;\n      space[j] = i + 1;\n    }\n  for (i = 0; i < j; i++) {\n    k = 0;\n    for (m = space[i]; m < space[i] + len2; m++) {\n      if (a[m] == b[m - space[i]])\n        k = k + 1;\n    }\n    if (k == len2 && a[space[i] + len2] == ' ')\n\n      cout << c << ' ';\n    else {\n      for (n = space[i]; n < space[i + 1]; n++)\n        cout << a[n];\n    }\n  }\n  k = 0;\n  for (i = space[j]; i < len1; i++)\n    if (a[i] == b[i - space[j]])\n      k = k + 1;\n  if (k == len2 && len1 - space[j] == len2)\n    printf(\"%s\", c);\n  else {\n    for (n = space[j]; n < len1; n++)\n      cout << a[n];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35710", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], sun[1000];\n  struct sum {\n    char tmp[20];\n  };\n  struct sum s[100];\n\n  cin >> sun;\n\n  cin >> a;\n\n  cin >> b;\n  int i, len, j;\n  len = strlen(sun);\n  sun[len + 1] = ' ';\n\n  int k = 0, n = 0;\n  for (i = 0; i <= len + 1; i++) {\n    if (sun[i] == ' ') {\n      n++;\n      int t;\n      t = i - k;\n      for (j = 0; j < k; j++) {\n\n        s[n].tmp[j] = sun[t];\n        t++;\n      }\n      s[n].tmp[j] = '\u0000';\n      k = 0;\n    } else\n      k++;\n  }\n  s[n].tmp[j - 1] = '\u0000';\n  for (i = 1; i <= n; i++) {\n    if (strcmp(s[i].tmp, a) == 0)\n      strcpy(s[i].tmp, b);\n    if (i != n)\n      printf(\"%s \", s[i].tmp);\n    else\n      printf(\"%s\", s[i].tmp);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35711", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char Data[20][20], Word_1[20],\n      Word_2[20]; \n  int i, t;\n\n  int get_data(char Data[20][20]); \n  t = get_data(Data);\n  cin >> Word_1;\n  cin >> Word_2;\n\n  if (strcmp(Data[0], Word_1) == 0) \n    strcpy(Data[0], Word_2);\n  cout << Data[0];\n  for (i = 1; i < t; i++) {\n    if (strcmp(Data[i], Word_1) == 0)\n      strcpy(Data[i], Word_2);\n    cout << ' ' << Data[i];\n  }\n  return 0;\n}\nint get_data(char Data[20][20]) {\n  int i = 0, j = 0;\n  char c;\n  while ((c = getchar()) != '\\n') \n  {\n    if (c == ' ') \n    {\n      Data[i][j] = '\\0';\n      i++;\n      j = 0;\n      continue;\n    }\n    Data[i][j] = c;\n    j++;\n  }\n  Data[i][j] = '\\0';\n  return i + 1; \n}\n"}
{"label": "19", "index": "35712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[200], b[100], c[100], d[200];\n  int i, j;\n  int n1 = 0, n2 = 0, n3 = 0;\n  int m = 0, flat = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++)\n\n    n1++;\n  for (i = 0; b[i] != '\u0000'; i++)\n    n2++;\n  for (i = 0; c[i] != '\u0000'; i++)\n    n3++;\n  for (i = 0; i <= n1 + x * (n3 - n2) - 1; i++) {\n    if (a[i] == b[0]) {\n      flat = 1;\n      for (j = 1; j <= n2 - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          flat = flat + 1;\n      }\n      if (((flat == n2) && (a[i - 1] == ' ') && (a[i + n2] == ' ')) ||\n          ((i == 0) && (flat == n2) && (a[i + n2] == ' ')) ||\n          ((flat == n2) && (i >= n1 + x * (n3 - n2) - n2 - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + n2; m <= n1 + 2; m++) {\n          d[m - i - n2] = a[m];\n        }\n        for (m = i; m <= i + n3 - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + n3; m <= n1 + n3 - n2 + 2; m++) {\n          a[m] = d[m - i - n3];\n        }\n        i = i + n3 - n2;\n        x = x + 1;\n      }\n    }\n  }\n  a[n1 + x * (n3 - n2)] = '\u0000';\n  cout << a << \" \";\n  return 0;\n}\n"}
{"label": "19", "index": "35713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar a[105];\nchar h[105];\nchar b[105];\nchar c[105];\nchar d[105];\nint k;\nint p;\nint main() {\n  int i, j;\n  int t;\n\n  scanf(\"%s \", a);\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0, j = 0; i <= strlen(a); i++) {\n    d[k++] = a[i];\n    h[p++] = a[i];\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      d[--k] = '\u0000';\n      if (strcmp(d, b) == 0) {\n        p -= strlen(d) + 1;\n        for (t = 0; t < strlen(c); t++)\n          h[p++] = c[t];\n        if (a[i] == ' ')\n          h[p++] = ' ';\n      }\n      j = k + 1;\n      k = 0;\n    }\n  }\n  for (i = 0; i < strlen(h); i++)\n    putchar(h[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35714", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p[100];\n  int i = 0, j;\n  *(p + i) = (char *)malloc(100);\n  while (scanf(\"%s\", *(p + i)) != EOF) {\n    i++;\n    *(p + i) = (char *)malloc(100);\n  }\n  for (j = 0; j < i - 2; j++) {\n    if (strcmp(*(p + j), *(p + i - 2)) == 0)\n      strcpy(*(p + j), *(p + i - 1));\n  }\n  printf(\"%s\", *p);\n  for (j = 1; j < i - 2; j++)\n    printf(\" %s\", *(p + j));\n  return 0;\n}\n"}
{"label": "19", "index": "35715", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *w[100];\n  int i, j, k;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++) {\n    *s = '\u0000';\n    *a = '\u0000';\n    *b = '\u0000';\n  }\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  w[0] = (char *)malloc(100 * sizeof(char));\n  for (j = 0; j < 100; j++)\n    *(w[0] + j) = '\u0000';\n  i = 0;\n  j = 0;\n  for (p = s; *p != '\u0000'; p++) {\n    if (*p != ' ') {\n      *(w[i] + j) = *p;\n      j++;\n    } else {\n      i++;\n      w[i] = (char *)malloc(100 * sizeof(char));\n      for (j = 0; j < 100; j++)\n        *(w[i] + j) = '\u0000';\n      j = 0;\n    }\n  }\n  k = i;\n  for (i = 0; i < k; i++) {\n    if (strcmp(w[i], a) == 0)\n      strcpy(w[i], b);\n    for (j = 0; *(w[i] + j) != '\u0000'; j++)\n      printf(\"%c\", *(w[i] + j));\n    printf(\" \");\n  }\n  if (strcmp(w[k], a) == 0)\n    strcpy(w[k], b);\n  for (j = 0; *(w[k] + j) != '\u0000'; j++)\n    printf(\"%c\", *(w[k] + j));\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35716", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char t[100];\n  char b[100];\n  int k, i, j, word;\n  word = 0;\n  k = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int len;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      k++;\n      word = 1;\n    }\n  }\n  int A = 0;\n  int n;\n  int m = 0;\n  for (j = 0; j < k; j++) {\n    for (i = A, n = 0; i < len; i++, n++) {\n      if (s[i] != ' ') {\n        t[n] = s[i];\n      }\n      if (s[i] == ' ') {\n        t[n] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len) {\n      t[n] = '\u0000';\n    }\n\n    if (strcmp(t, a) == 0) {\n      strcpy(t, b);\n    }\n    m++;\n    if (m != k) {\n      printf(\"%s \", t);\n    }\n    if (m == k) {\n      printf(\"%s \", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35717", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0, l;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  l = strlen(A);\n  for (i = 0; i < l; i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    l = strcmp(C[i], B);\n    if (l == 0)\n      strcpy(C[i], T);\n  }\n  for (i = 0; i < j; i++)\n    cout << C[i] << \" \";\n  printf(\"%s\", C[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35718", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++)\n    c[i] = s[i] = a[i] = '\u0000';\n  cin >> c;\n  scanf(\"%s \", a);\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int m;\n    char ch[101];\n    for (m = 0; m <= 100; m++)\n      ch[m] = '\u0000';\n    for (m = 0; m <= (n[i] - n[i - 1] - 2); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n    if (strcmp(a, ch) == 0)\n      strcat(s, b);\n    else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35719", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, temp = 0, j = 0, len, a[1000], temp2;\n  char str[1000], str1[101], str2[101], name[1000][101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  len = strlen(str);\n  for (i = 0; i <= len; i++) {\n    if (str[i] != ' ') {\n      name[temp][j] = str[i];\n      j++;\n    }\n\n    if (str[i] == ' ') {\n      a[temp] = j;\n      temp++;\n      j = 0;\n    }\n  }\n  for (j = 0; j < temp; j++) {\n    if (strcmp(str1, name[j]) == 0)\n      cout << str2 << \" \";\n    else\n      cout << name[j] << \" \";\n  }\n  if (strcmp(str1, name[temp]) == 0)\n    cout << str2;\n\n  if (strcmp(str1, name[temp]) != 0)\n    cout << name[temp];\n}\n"}
{"label": "19", "index": "35720", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j = 0, k = 0;\n  char c[100][100] = {'\u0000'};\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[j][k] = s[i];\n      k++;\n    } else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (i == 0)\n      cout << c[i];\n    else\n      cout << \" \" << c[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35721", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], words[100][100];\n  int i, k = 0, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n - 1; i++) {\n    if (strcmp(words[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[n - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", words[n - 1]);\n  }\n}\n"}
{"label": "19", "index": "35722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\u0000'}, b[100] = {'\u0000'}, c[100] = {'\u0000'}, d[100] = {'\u0000'};\n  int h, i, j, k, m, n, r;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  m = strlen(b);\n  n = strlen(c);\n  for (h = 0, i = 0; *(a + i) != '\u0000';) {\n    if ((*(a + i) == *b) &&\n        ((i >= 1 && *(a + i - 1) == ' ' &&\n          (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')) ||\n         (i == 0 && (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')))) {\n      r = i;\n      for (j = 0; j < m; j++)\n        if (*(a + r + j) != *(b + j))\n          break;\n      if (j == m) {\n        for (k = 0; k < n; k++) {\n          *(d + h) = *(c + k);\n          h++;\n          i++;\n        }\n        i = i + m - n;\n        continue;\n      }\n    }\n    *(d + h) = *(a + i);\n    h++;\n    i++;\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], word[101];\n  int i = 0, j, flag, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  while (s[i - 1] != 0 || i == 0) {\n    while (s[i] != ' ' && s[i] != 0) {\n      word[i - n] = s[i];\n      i++;\n    }\n    word[i - n] = 0;\n    flag = 1;\n    for (j = 0; j <= strlen(a); j++)\n      if (a[j] != word[j])\n        flag = 0;\n    if (flag)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", word);\n    if (s[i] != 0)\n      printf(\"%c\", s[i]);\n    i++;\n    n = i;\n  }\n}\n"}
{"label": "19", "index": "35724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s[100], a[100], b[100], d[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (j = 0;; j += (i + 1)) {\n    for (i = 0; s[i + j] != ' ' && s[i + j] != 0; i++)\n      d[i] = s[i + j];\n    d[i] = '\u0000';\n    if (strcmp(a, d) == 0) {\n      if (s[i + j] == 0) {\n        printf(\"%s\", b);\n        break;\n      } else\n        printf(\"%s \", b);\n    } else if (s[i + j] == 0) {\n      printf(\"%s\", d);\n      break;\n    } else\n      printf(\"%s \", d);\n  }\n}\n"}
{"label": "19", "index": "35725", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\u0000'}, b[100] = {'\u0000'}, c[100] = {'\u0000'}, d[100] = {'\u0000'};\n  int h, i, j, k, m, n, r;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  m = strlen(b);\n  n = strlen(c);\n  for (h = 0, i = 0; *(a + i) != '\u0000';) {\n    if ((*(a + i) == *b) &&\n        ((i >= 1 && *(a + i - 1) == ' ' &&\n          (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')) ||\n         (i == 0 && (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')))) {\n      r = i;\n      for (j = 0; j < m; j++)\n        if (*(a + r + j) != *(b + j))\n          break;\n      if (j == m) {\n        for (k = 0; k < n; k++) {\n          *(d + h) = *(c + k);\n          h++;\n          i++;\n        }\n        i = i + m - n;\n        continue;\n      }\n    }\n    *(d + h) = *(a + i);\n    h++;\n    i++;\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35726", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[300], a[103], b[103];\n  int i, j, k, p, l, m, n, num;\n\n  cin >> s;\n  l = strlen(s);\n\n  cin >> a;\n  m = strlen(a);\n\n  cin >> b;\n  n = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    num = 0;\n    if (s[i] == a[0]) {\n      num = 1;\n      for (j = 1; a[j] != '\u0000'; j++)\n        if (s[i + j] == a[j])\n          num++;\n      if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n >= m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[l - 1 + n - m - k] = s[l - 1 - k];\n          for (p = 0; p < n; p++) {\n            s[p + i] = b[p];\n          }\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      } else if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n < m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[n + i + k] = s[m + i + k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      }\n      l = l + i;\n    }\n  }\n  cout << s;\n}\n"}
{"label": "19", "index": "35727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zifu[101], word[100][20] = {\" \"}, x[20], y[20];\n  int n, i, j, s, t = 0, p = 0, num; \n\n  cin >> zifu;\n\n  cin >> x;\n\n  cin >> y;\n  n = strlen(zifu);\n  for (i = 0; i < n; i++) {\n    if (zifu[i] != ' ') {\n      word[t][p] = zifu[i];\n      p++;\n    } else if (zifu[i] == ' ') {\n      p = 0;\n      t++;\n    }\n    num = t + 1;\n  }\n  for (i = 0; i < num; i++) {\n    if (!strcmp(word[i], x)) {\n      strcpy(word[i], y);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (i = 1; i < num; i++) {\n    printf(\" %s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35728", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, flag = 1;\n  int i, j, k = -1, l;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ') {\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = strcmp(words[i], a);\n\n    if (l == 0) {\n      strcpy(words[i], b);\n      flag = 0;\n    }\n  }\n\n  if (flag == 0) {\n    printf(\"%s\", words[0]);\n    for (i = 1; i < n; i++) {\n      printf(\" %s\", words[i]);\n    }\n  }\n  if (flag == 1) {\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35729", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, k, y;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  for (i = 0; i < strlen(s);) {\n    y = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i]) {\n        if (s[i - 1] == 32 || i == 0)\n          y = y + 1;\n\n      } else\n        break;\n    }\n    if (y == strlen(a)) {\n      i = i + strlen(a);\n      for (k = 0; k < strlen(b); k++)\n        cout << b[k];\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[101], a[100][100], b[100], c[100], *ps;\n  int i, k, flag = 0, j;\n\n  cin >> str;\n\n  cin >> c;\n\n  cin >> b;\n  i = 0;\n  j = 0;\n  for (ps = str; *ps != '\u0000'; ps++) {\n    if (*ps != ' ') {\n      a[i][j] = *ps;\n      j++;\n    } else if (*ps == ' ') {\n      a[i][j] = '\u0000';\n      j = 0;\n      i++;\n    }\n  }\n  a[i][j] = '\u0000';\n  k = i;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a[i], c) == 0) {\n      strcpy(a[i], b);\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k; i++)\n      cout << a[i] << \" \";\n\n    cout << a[k];\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35731", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char cc[500] = {'\u0000'}, c1[20] = {'\u0000'}, c2[20] = {'\u0000'}, c[30][20] = {'\u0000'}, *p1,\n       *p2, *p3, *p4;\n  int a, b, d, e = 0, f = 0, h, i;\n\n  cin >> cc;\n\n  cin >> c1;\n\n  cin >> c2;\n  p1 = &c[0][0];\n  p2 = &c1[0];\n  p3 = &c2[0];\n  p4 = &cc[0];\n  for (a = 0; a < 500; a++) {\n    if (*(p4 + a) == ' ') {\n      e++;\n      f = 0;\n    } else if (*(p4 + a) != '\u0000') {\n      *(p1 + e * 20 + f) = *(p4 + a);\n      f++;\n    } else {\n      break;\n    }\n  }\n  i = strlen(c1);\n  h = strlen(c2);\n  for (a = 0; a < e + 1; a++) {\n    for (b = 0; b < i; b++) {\n      if (*(p1 + a * 20 + b) != *(p2 + b)) {\n        break;\n      }\n    }\n    if (b == i) {\n      for (d = 0; d < h; d++) {\n        *(p1 + a * 20 + d) = *(p3 + d);\n      }\n      for (d = h; d < 20; d++) {\n        *(p1 + a * 20 + d) = '\u0000';\n      }\n    }\n  }\n  for (d = 0; d < e; d++) {\n    printf(\"%s \", c[d]);\n  }\n  printf(\"%s \", c[e]);\n}\n"}
{"label": "19", "index": "35732", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char name[100], a[100], b[100];\n  int k = 0, j = 0, n, i, p;\n  char word[100][100];\n\n  scanf(\"%s \", name);\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(name);\n  for (i = 0; i < n; i++) {\n    if (name[i] != ' ') {\n      word[k][j] = name[i];\n      j++;\n    } else {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  word[k][j] = '\u0000';\n  k++;\n\n  for (p = 0; p < k; p++) {\n    if (strcmp(word[p], a) == 0) {\n      strcpy(word[p], b);\n    }\n  }\n  for (p = 0; p < k - 1; p++) {\n    printf(\"%s \", word[p]);\n  }\n  printf(\"%s\", word[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35733", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, n, i, j;\n  char x[20], y[20], z[100][20];\n  for (i = 0;; i++) {\n    scanf(\"%s\", &z[i]);\n    if (getchar() != ' ')\n      goto hell;\n  }\nhell:;\n  scanf(\"%s\", &x);\n  scanf(\"%s\", &y);\n  for (j = 0; j <= i; j++) {\n    if (strcmp(x, z[j]) == 0) {\n      z[j][0] = 0;\n    }\n  }\n  for (j = 0; j <= i; j++) {\n    if (z[j][0] == 0) {\n      printf(\"%s\", y);\n    } else\n      printf(\"%s\", z[j]);\n    if (j != i)\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[10000];\n  char word[100][100];\n  char w1[100], w2[100];\n\n  scanf(\"%s \", s);\n\n  cin >> w1;\n\n  cin >> w2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ')\n      word[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++)\n    if (strcmp(word[i], w1) == 0)\n      strcpy(word[i], w2);\n  for (i = 0; i < j; i++)\n    cout << word[i] << \" \";\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "35735", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], c[1000];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i = 0;\n  while (i < strlen(a)) {\n    if (i == 0) {\n      if (a[i] == b[0]) {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    } else {\n      if (a[i] == b[0] && a[i - 1] == ' ') {\n        int j;\n        for (j = 0; j < strlen(b); j++) {\n          if (a[i + j] != b[j]) {\n            break;\n          }\n        }\n        if (j == strlen(b)) {\n          printf(\"%s\", c);\n          i += strlen(b);\n        } else {\n          printf(\"%c\", a[i]);\n          i++;\n        }\n      } else {\n        printf(\"%c\", a[i]);\n        i++;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, len, n = 0, j = 0, z = 0, len1, len3, d;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      c[n][j] = s[i];\n      j++;\n    } else {\n      c[n][j] = '\u0000';\n      n++;\n      j = 0;\n    }\n  }\n  c[n][j] = '\u0000';\n  len1 = strlen(a);\n  for (i = 0; i <= n; i++) {\n    z = 0;\n    d = 0;\n    len3 = strlen(c[i]);\n    for (j = 0; j < len3 && j < len1; j++) {\n      if (c[i][j] == a[z]) {\n        d++;\n        z++;\n      }\n    }\n    if (d == len1) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n\n  printf(\"%s\", c[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], a[100][100], b[100], c[100], *ps;\n  int i, k, flag = 0, j;\n\n  cin >> str;\n\n  cin >> c;\n\n  cin >> b;\n  i = 0;\n  j = 0;\n  for (ps = str; *ps != '\u0000'; ps++) {\n    if (*ps != ' ') {\n      a[i][j] = *ps;\n      j++;\n    } else if (*ps == ' ') {\n      a[i][j] = '\u0000';\n      j = 0;\n      i++;\n    }\n  }\n  a[i][j] = '\u0000';\n  k = i;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a[i], c) == 0) {\n      strcpy(a[i], b);\n      flag = 1;\n    }\n  }\n  if (flag == 1) {\n    for (i = 0; i < k; i++) {\n      printf(\"%s \", a[i]);\n    }\n    printf(\"%s\", a[k]);\n  } else if (flag == 0) {\n    printf(\"%s\", str);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35738", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[300], a[300], b[300];\n  int x, y, z, i, k;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (k = 0; k <= x - 1; k++) {\n    int q = 1;\n    for (i = k; q != 9 && i <= k + y - 1; i++) {\n      if (s[i] != a[i - k])\n        q = 9;\n    }\n    if (q == 9)\n      continue;\n    else if (q == 1 && ((s[k - 1] == ' ' && k > 0) || k == 0)) {\n      if (y >= z) {\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n        for (i = k + z; i <= 299; i++)\n          s[i] = s[i + y - z];\n      } else if (y < z) {\n        for (i = 299; i >= k + z; i--)\n          s[i] = s[i + y - z];\n        for (i = k; i <= k + z - 1; i++)\n          s[i] = b[i - k];\n      }\n    }\n    k += z - 1;\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "35739", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[20], c[20], d[20];\n  cin.getline(a, 100);\n  cin.getline(b, 20);\n  cin.getline(c, 20);\n  int i = 0, n = 0, j = 0, k, l = 0;\n  for (; a[i] != 0;) {\n    if (a[i] == 32)\n      i++;\n    for (; a[i] != 32 && a[i] != 0; i++, n++)\n      d[n] = a[i];\n    d[n] = 0;\n    if (strcmp(b, d) == 0) {\n      for (j = i - n; n > 0; n--)\n        for (k = j; a[k] != 0; k++)\n          a[k] = a[k + 1];\n      for (; c[l] != 0; l++, j++) {\n        for (k = j; a[k] != 0; k++)\n          ;\n        for (; k >= j; k--)\n          a[k + 1] = a[k];\n        a[j] = c[l];\n      }\n      l = 0;\n      i = j;\n    } else\n      n = 0;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "35740", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n  scanf(\"%s \", s);\n  cin >> w;\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    if (strcmp(h[i], w) == 0) {\n      t = 1;\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n    t = 0;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    cout << \" \";\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35741", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101];\n  char b[101];\n  char c[101];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int found = 0, i, j;\n  memset(t, '\u0000', sizeof(t));\n  for (i = 0, j = 0; a[i - 1] != '\u0000'; i++, j++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      t[j] = a[i];\n    }\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      t[j + 1] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n      }\n      if (found++) {\n        printf(\" \");\n      }\n      printf(\"%s\", t);\n      j = -1;\n      memset(t, '\u0000', sizeof(t));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char name[100], a[100], b[100];\n  int k = 0, j = 0, n, i, p;\n  char word[100][100];\n\n  cin >> name;\n\n  cin >> a;\n\n  cin >> b;\n  n = strlen(name);\n  for (i = 0; i < n; i++) {\n    if (name[i] != ' ') {\n      word[k][j] = name[i];\n      j++;\n    } else {\n      word[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  word[k][j] = '\u0000';\n  k++;\n\n  for (p = 0; p < k; p++) {\n    if (strcmp(word[p], a) == 0) {\n      strcpy(word[p], b);\n    }\n  }\n  for (p = 0; p < k - 1; p++) {\n    printf(\"%s \", word[p]);\n  }\n  printf(\"%s\", word[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sour[100], result[100];\n  char a[20], b[20], c[20];\n  char *p = NULL, *q = NULL;\n  int i, k = 0;\n  int l_1, l_2, l_3, l_4, l_5, x = 0;\n  int flag;\n  int j;\n  int word_length = 0;\n  int flag_2 = 0;\n\n  cin >> sour;\n\n  cin >> a;\n\n  cin >> b;\n  l_1 = strlen(sour);\n  l_2 = strlen(a);\n  l_3 = strlen(b);\n  p = sour;\n  q = sour;\n  for (j = 0; j < l_1 - l_2 + 1;) {\n    for (i = 0; i < l_2; i++, j++) {\n      c[i] = sour[j];\n    }\n    j = x;\n    x++;\n    if (strcmp(c, a) == 0)\n      flag_2++;\n  }\n\n  while (*p != '\u0000') {\n    if (*p == ' ' || *(p + 1) == '\u0000') {\n      flag = 1;\n      if (*p == ' ')\n        word_length = p - q;\n      else\n        word_length = p - q + 1;\n      if (word_length == strlen(a)) {\n        for (i = 0; i < strlen(a); i++) {\n          if (q[i] != a[i]) {\n            flag = 0;\n            break;\n          }\n        }\n      } else\n        flag = 0;\n\n      if (flag == 1) {\n        for (i = 0; i < strlen(b); i++) {\n          result[k++] = b[i];\n        }\n\n      } else {\n        while (q != p) {\n          result[k++] = *q++;\n        }\n      }\n      if (*p == ' ')\n        result[k++] = ' ';\n      else\n        result[k++] = *p;\n\n      q = p + 1;\n    }\n    p++;\n  }\n\n  result[k] = '\u0000';\n  l_4 = strlen(result);\n  l_5 = l_1 - l_2 + l_3;\n  if ((l_4 != l_5)) {\n    if (flag_2 == 1)\n      result[k - 1] = '\u0000';\n  }\n  puts(result);\n}\n"}
{"label": "19", "index": "35744", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char danchi[1000];\n  char e[50][1000], a[1000], b[1000];\n  cin >> danchi;\n  cin >> a >> b;\n  int i, j, g = 0, l = 0, v = 0, m = 0;\n  int max = 0, min = 100, max1, min1;\n\n  int c = strlen(danchi);\n  for (j = 0; j < 50; j++) {\n    l = 0;\n    for (i = g; i < 1000; i++) {\n      if (danchi[i] == ' ') {\n        m++;\n        break;\n      }\n      e[j][l] = danchi[i];\n      g++;\n      l++;\n      v++;\n    }\n    g++;\n    v++;\n\n    if (v > c)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    if (strcmp(e[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", e[i]);\n    }\n  }\n  if (strcmp(e[m], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", e[m]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35745", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[10000], a[101], b[101];\n  int l0, l1, l2, i, j, k, counter;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  l0 = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  i = 0;\n  if (s[i] == a[0]) {\n    counter = 0;\n    for (j = i + 1; j < i + l1; j++) {\n      if (s[j] != a[j - i])\n        counter++;\n    }\n    if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n      counter++;\n    if (counter == 0) {\n      if (l1 >= l2) {\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n        for (j = i + l1; j <= l0; j++)\n          s[j - (l1 - l2)] = s[j];\n      }\n      if (l2 > l1) {\n        for (j = l0; j >= i + l1; j--)\n          s[j - (l1 - l2)] = s[j];\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n      }\n    }\n  }\n  for (i = 1; i < l0; i++) {\n    if (s[i] == a[0]) {\n      counter = 0;\n      for (j = i + 1; j < i + l1; j++) {\n        if (s[j] != a[j - i])\n          counter++;\n      }\n      if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n        counter++;\n      if (s[i - 1] != ' ')\n        counter++;\n      if (counter == 0) {\n        if (l1 >= l2) {\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n          for (j = i + l1; j <= l0; j++)\n            s[j - (l1 - l2)] = s[j];\n        }\n        if (l2 > l1) {\n          for (j = l0; j >= i + l1; j--)\n            s[j - (l1 - l2)] = s[j];\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n        }\n        l0 += l2 - l1;\n      }\n    }\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint n1, n2, n3;\nchar str1[100], str2[100], str3[100];\nint f(char *p) {\n  int m, n;\n  n = 0;\n  char *f;\n  f = p;\n  for (m = 0; m < n2; m++) {\n    if ((*f) == str2[m]) {\n      n++;\n    }\n    f++;\n  }\n  if (n == n2)\n    return 1;\n  else\n    return 0;\n}\nint m(char *p) {\n  if (*p >= 'a' && *p <= 'z')\n    return 1;\n  else if (*p >= 'A' && *p <= 'Z')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  cin >> str1;\n  n1 = strlen(str1);\n  scanf(\"%s\", str2);\n  n2 = strlen(str2);\n  cin >> str3;\n  n3 = strlen(str3);\n  int i = 0, j;\n  char *p1, *p2;\n  p1 = str1;\n  for (i = 0; (p1 - str1) < n1; i++, p1++) {\n    p2 = p1 + n2;\n    if ((f(p1) == 1) && (m(p1 - 1) == 0) && (m(p2) == 0)) {\n      for (j = 0; j < n3; j++)\n        printf(\"%c\", str3[j]);\n      p1 = p1 + n2 - 1;\n    } else {\n      printf(\"%c\", *p1);\n    }\n  }\n}\n"}
{"label": "19", "index": "35747", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  int i, j = 0, k, m;\n  int n = 1;\n  char t[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  \n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ')\n      n++;\n  }\n\n  \n  for (i = 0; s[i] != ' '; i++) {\n    t[i] = s[i];\n  }\n  t[i] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", t);\n  }\n  k = i + 1;\n\n  \n  for (i = 1; i < n - 1; i++) {\n    m = 0;\n    for (j = k; s[j] != ' '; j++) {\n      t[m] = s[j];\n      m++;\n    }\n    t[m] = '\u0000';\n    if (strcmp(t, a) == 0) {\n      printf(\" %s\", b);\n    } else {\n      printf(\" %s\", t);\n    }\n    k = j + 1;\n  }\n\n  m = 0;\n  for (j = k; s[j] != '\u0000'; j++) {\n    t[m] = s[j];\n    m++;\n  }\n  t[m] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\" %s\", b);\n  } else {\n    printf(\" %s\", t);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35748", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][100], a[100], b[100];\n  int i = 0, k;\n  do {\n    cin >> s[i];\n    i++;\n  } while (getchar() != '\\n');\n  k = i;\n  scanf(\"%s %s\", a, b);\n  for (i = 0; i < k - 1; i++)\n    if (strcmp(s[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      printf(\"%s \", s[i]);\n  if (strcmp(s[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35749", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], x[100];\n  int len, n = 0, at = 1, i, j, t = 0, m = 0;\n\n  cin >> s, cin >> a, cin >> b;\n  strcat(s, \" \");\n  len = strlen(s);\n  for (i = 0; i < len + 1; i++) {\n    if (s[i] == ' ') {\n      at = 0;\n    }\n    if (at == 0) {\n      at = 1;\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = t;; j++) {\n      if (s[j] != ' ') {\n        x[j - t] = s[j];\n      } else {\n        x[j - t] = '\u0000';\n        t = j + 1;\n        m++;\n        break;\n      }\n    }\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    cout << x;\n    if (m != n)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35750", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int x, y, z, i, j, k;\n\n  scanf(\"%s \", s);\n  cin >> a;\n  cin >> b;\n  x = strlen(s);\n  y = strlen(a);\n  z = strlen(b);\n  for (i = 0; i < x; i++) {\n    k = 1;\n    if (i != 0) {\n      if (s[i] == ' ') {\n        k = 0;\n        for (j = 0; j < y; j++) {\n          if (s[i + j + 1] != a[j])\n            k = 1;\n        }\n      }\n      if (k == 0) {\n        printf(\" \");\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = i + y;\n      }\n      if (k == 1)\n        printf(\"%c\", s[i]);\n    } else if (i == 0) {\n      k = 0;\n      for (j = 0; j < y; j++) {\n        if (s[j] != a[j])\n          k = 1;\n      }\n      if (k == 0) {\n        for (j = 0; j < z; j++)\n          printf(\"%c\", b[j]);\n        i = y - 1;\n      }\n      if (k == 1)\n        printf(\"%c\", s[0]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35751", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, n, w, i, wordnum = 0, charnum = 0;\n  char word[50][20] = {0};\n  char s[1000] = {0}, o[20] = {0}, a[20] = {0};\n\n  cin >> s;\n\n  cin >> o;\n\n  cin >> a;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      word[wordnum][charnum] = s[i];\n      charnum++;\n    }\n    if (s[i] == ' ') {\n      wordnum++;\n      charnum = 0;\n    }\n  }\n  w = wordnum;\n  for (wordnum = 0; wordnum <= w; wordnum++) {\n    if (strcmp(o, word[wordnum]) == 0) {\n      strcpy(word[wordnum], a);\n    }\n  }\n  printf(\"%s\", word[0]);\n  for (wordnum = 1; wordnum <= w; wordnum++) {\n    printf(\" %s\", word[wordnum]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char t[100];\n  char b[100];\n  int k, i, j, word;\n  word = 0;\n  k = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int len;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      k++;\n      word = 1;\n    }\n  }\n  int A = 0;\n  int n;\n  int m = 0;\n  for (j = 0; j < k; j++) {\n    for (i = A, n = 0; i < len; i++, n++) {\n      if (s[i] != ' ') {\n        t[n] = s[i];\n      }\n      if (s[i] == ' ') {\n        t[n] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len) {\n      t[n] = '\u0000';\n    }\n\n    if (strcmp(t, a) == 0) {\n      strcpy(t, b);\n    }\n    m++;\n    if (m != k) {\n      printf(\"%s \", t);\n    }\n    if (m == k) {\n      printf(\"%s \", t);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35753", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  int a;\n  int isWords;\n  char s1[100];\n  char s2[100];\n  char s3[100];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  i = 0;\n  j = 0;\n  k = 0;\n  char *p;\n  p = strtok(s1, \"' '\");\n  if (strcmp(p, s2) == 0)\n    printf(\"%s\", s3);\n  else\n    printf(\"%s\", p);\n  p = strtok(NULL, \"' '\");\n  while (p) {\n    if (strcmp(p, s2) == 0)\n      printf(\" %s\", s3);\n    else\n      printf(\" %s\", p);\n    p = strtok(NULL, \"' '\");\n  }\n\n  cin >> s1;\n  return 0;\n}\n"}
{"label": "19", "index": "35754", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *s[100], *a, *b;\n  int i = 0, j = 0, x;\n  for (i = 0; i < 100; i++) {\n    s[i] = (char *)malloc(100 * sizeof(char));\n    for (j = 0; j < 100; j++)\n      s[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n    for (j = 0;; j++) {\n      scanf(\"%c\", &s[i][j]);\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        break;\n      }\n    }\n    if (s[i][j] == ' ') {\n      x = i;\n      break;\n    }\n  }\n  for (i = 0; i <= x; i++) {\n    for (j = 0;; j++)\n      if (s[i][j] == ' ' || s[i][j] == ' ') {\n        s[i][j] = '\u0000';\n        break;\n      }\n  }\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= x; i++)\n    if (!strcmp(s[i], a)) {\n      for (j = 0; j < 100; j++)\n        s[i][j] = '\u0000';\n      strcpy(s[i], b);\n    }\n  for (i = 0; i < x; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s \", s[x]);\n}\n"}
{"label": "19", "index": "35755", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  cin >> s;\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    if (strcmp(s, from) == 0) {\n      printf(\"%s\", to);\n    } else {\n      printf(\"%s\", s);\n    }\n    s = p + 1;\n    if (*s) {\n      printf(\" \");\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35756", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100], c;\n  int i, j, k, flag = 1;\n\n  memset(a, 0, sizeof(a));\n  memset(s, 0, sizeof(s));\n  memset(b, 0, sizeof(b));\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n\n  for (i = 0; i <= strlen(s); i++) {\n    flag = 1;\n    if (s[i] || s[i + 1]) {\n      if (s[i - 1] == 32 || i == 0) {\n        for (j = 0; a[j] != 0; j++) {\n          if (s[i + j] == a[j])\n            continue;\n          else {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 1) {\n          i += j - 1;\n          for (k = 0; b[k] != 0; k++) {\n            cout << b[k];\n          }\n\n        } else {\n          if (s[i] == 0) {\n            cout << \" \";\n          } else\n\n            cout << s[i];\n        }\n      }\n\n      else\n        cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35757", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, m = 0, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      n++;\n      c[n][0] = s[i + 1];\n      m = 1;\n      i++;\n    } else {\n      c[n][m] = s[i];\n      m++;\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0)\n      strcpy(c[i], b);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n  cout << c[n];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35758", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[100], str2[100], str3[100], a[100][100];\n  int i, j = 0, t = 0, l, m, n, k = -1, f = 1;\n  cin >> str1;\n  cin >> str2;\n  cin >> str3;\n  m = strlen(str1);\n  l = strlen(str2);\n  str1[m] = '\u0000';\n  for (j = 0; i <= m; j++) {\n    for (i = k + 1, n = 0; i <= m; i++, n++) {\n      if (str1[i] != ' ' && str1[i] != '\u0000') {\n        a[j][n] = str1[i];\n      } else {\n        a[j][n] = '\u0000';\n        k = i;\n        break;\n      }\n    }\n  }\n  k = j - 1;\n  for (j = 0; j < k; j++) {\n    f = 1;\n    t = strlen(a[j]);\n    if (l != t) {\n      printf(\"%s\", a[j]);\n      if (j < k - 1) {\n        printf(\" \");\n      }\n      continue;\n    } else {\n      for (i = 0; i < l; i++) {\n        if (a[j][i] != str2[i]) {\n          printf(\"%s\", a[j]);\n          if (j < k - 1) {\n            printf(\" \");\n          }\n          f = 0;\n          break;\n        }\n      }\n    }\n    if (f == 1) {\n      printf(\"%s\", str3);\n      if (j < k - 1)\n        printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35759", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k;\n  cin.getline(a, 100, '\\n');\n  cin.getline(b, 100, '\\n');\n  cin.getline(c, 100, '\\n');\n  int l1 = strlen(a), l2 = strlen(b), l3 = strlen(c);\n  for (i = 0;; i++)\n    if (a[i] == ' ')\n      break;\n  for (j = 0; j <= i - 1; j++) {\n    if (a[j] != b[j]) {\n      for (k = 0; k <= i - 1; k++)\n        cout << a[k];\n      break;\n    }\n    if (j == i - 1)\n      cout << c;\n  }\n\n  for (i = 0; i <= l1 - 1; i++) {\n    if (a[i] != ' ')\n      continue;\n    for (j = 0; j <= l2 - 1; j++) {\n      if (a[i + j + 1] != b[j]) {\n        cout << \" \";\n        for (k = i + 1;; k++) {\n          if (a[k] == ' ' || k == l1)\n            break;\n          else\n            cout << a[k];\n        }\n        break;\n      }\n      if (j == l2 - 1) {\n        cout << \" \" << c;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35760", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n  cin >> s;\n  cin >> w;\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    if (strcmp(h[i], w) == 0) {\n      t = 1;\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n    t = 0;\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++) {\n    printf(\"%c\", h[k - 1][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35761", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  int la, lb; \n  char *p;    \n  char t[101];\n  char *ss; \n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  la = strlen(a);\n  lb = strlen(b);\n  ss = s;\n  while ((p = strstr(ss, a)) != NULL) {\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == ' ')) {\n      strcpy(t, p + la + 1);\n      strcpy(p, b);\n      *(p + lb) = ' ';\n      strcpy(p + lb + 1, t);\n    }\n    if ((p == s || *(p - 1) == ' ') && (*(p + la) == '\u0000')) {\n      strcpy(p, b);\n      *(p + lb) = '\u0000';\n    }\n    ss = p + la + 1;\n  }\n  puts(s);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char word[50][100];\n  int i, j, num = 1;\n  int count[50] = {0};\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; i <= strlen(s); i++) {\n    if (s[i] != ' ' && s[i] != '\u0000')\n      count[num]++;\n    if (s[i] == ' ' || s[i] == '\u0000') {\n      for (j = 0; j < count[num]; j++) {\n        word[num][j] = s[i - count[num] + j];\n      }\n      word[num][count[num]] = '\u0000';\n\n      if (s[i] == ' ')\n        num++;\n    }\n  }\n  for (i = 1; i <= num; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n    else\n      continue;\n  }\n  for (i = 1; i < num; i++) {\n    printf(\"%s \", word[i]);\n  }\n  printf(\"%s\", word[num]);\n  return 0;\n}\n"}
{"label": "19", "index": "35763", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[210] = {'\u0000'}, a[100], b[100];\n  int i, j, x = 0, k = 0, q, l = 0, d, p, m, dd, sl;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(s);\n  l = strlen(a);\n  d = strlen(a) - strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    x = 0;\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (s[i + x] == a[k]) {\n        x++;\n      } else\n        break;\n    }\n    if (l == x && (s[i - 1] == ' ' || i == 0) &&\n        (s[i + x] == ' ' || s[i + x] == '\u0000')) {\n\n      if (d >= 0) {\n        for (q = i + x; s[q] != '\u0000'; q++) {\n          s[q - d] = s[q];\n        }\n        for (m = 0; m < d; m++) {\n          s[q - d + m] = '\u0000';\n        }\n      } else if (d < 0) {\n        dd = -d;\n        for (q = sl - 1; q >= i + x; q--) \n        {\n          s[q + dd] = s[q];\n        }\n        sl = sl + dd;\n      }\n      p = i;\n      for (j = 0; b[j] != '\u0000'; j++) {\n        s[p] = b[j];\n        p++;\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35764", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, value, la, lb, ls;\n  char *p, *ps, s[100] = \"\", a[100] = \"\", b[100] = \"\";\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  la = strlen(a);\n  lb = strlen(b);\n  ls = strlen(s);\n  for (p = s; p < s + 100; p++) {\n    value = 1;\n    if ((p == s || *(p - 1) == ' ') && (*p == a[0])) {\n      for (ps = p + 1, i = 1; a[i] != '\u0000'; ps++, i++)\n        if (*ps != a[i])\n          value = 0;\n      if (value == 1) {\n        if (la == lb)\n          for (i = 0; i < la; i++)\n            (*p++) = b[i];\n        else if (la > lb) {\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n          while (*ps != '\u0000')\n            (*p++) = (*ps++);\n          *p = '\u0000';\n        } else {\n          for (i = 99; i >= (ps - s) + lb - la; i--) {\n            s[i] = s[i - lb + la];\n          }\n          for (i = 0; i < lb; i++)\n            (*p++) = b[i];\n        }\n      }\n    }\n  }\n  cout << s;\n}\n"}
{"label": "19", "index": "35765", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sour[100], result[100];\n  char a[20], b[20], c[20];\n  char *p = NULL, *q = NULL;\n  int i, k = 0;\n  int l_1, l_2, l_3, l_4, l_5, x = 0;\n  int flag;\n  int j;\n  int word_length = 0;\n  int flag_2 = 0;\n\n  scanf(\"%s \", sour);\n\n  cin >> a;\n\n  cin >> b;\n  l_1 = strlen(sour);\n  l_2 = strlen(a);\n  l_3 = strlen(b);\n  p = sour;\n  q = sour;\n  for (j = 0; j < l_1 - l_2 + 1;) {\n    for (i = 0; i < l_2; i++, j++)\n      c[i] = sour[j];\n\n    j = x;\n    x++;\n    if (strcmp(c, a) == 0)\n      flag_2++;\n  }\n\n  while (*p != '\u0000') {\n    if (*p == ' ' || *(p + 1) == '\u0000') {\n      flag = 1;\n      if (*p == ' ')\n        word_length = p - q;\n      else\n        word_length = p - q + 1;\n      if (word_length == strlen(a)) {\n        for (i = 0; i < strlen(a); i++) {\n          if (q[i] != a[i]) {\n            flag = 0;\n            break;\n          }\n        }\n      } else\n        flag = 0;\n\n      if (flag == 1) {\n        for (i = 0; i < strlen(b); i++) {\n          result[k++] = b[i];\n        }\n\n      } else {\n        while (q != p)\n          result[k++] = *q++;\n      }\n      if (*p == ' ')\n        result[k++] = ' ';\n      else\n        result[k++] = *p;\n\n      q = p + 1;\n    }\n    p++;\n  }\n\n  result[k] = '\u0000';\n  l_4 = strlen(result);\n  l_5 = l_1 - l_2 + l_3;\n  if ((l_4 != l_5)) {\n    if (flag_2 == 1)\n      result[k - 1] = '\u0000';\n  }\n  puts(result);\n}\n"}
{"label": "19", "index": "35766", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[101];\n  char word[51][20];\n  char word1[20], word2[20];\n\n  scanf(\"%s \", str);\n  cin >> word1 >> word2;\n  int point, i, counter;\n  counter = 1;\n  i = 0;\n  for (point = 0; str[point] != '\u0000'; point++) {\n    if (str[point] == ' ') {\n      word[counter][i] = '\u0000';\n      counter++;\n      i = 0;\n    } else {\n      word[counter][i] = str[point];\n      i++;\n    }\n  }\n  word[counter][i] = '\u0000';\n\n  int k;\n  for (k = 1; k <= counter; k++) {\n    int flag = 0;\n    for (i = 0; word1[i] != '\u0000'; i++) {\n      if (word[k][i] != word1[i])\n        flag = 1;\n    }\n    if (flag == 0)\n      cout << word2;\n    else\n      cout << word[k];\n    if (k != counter)\n      cout << ' ';\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35767", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], sz[51][101], a[101], b[101];\n  int i, j, k, n;\n  int max = 0, min = 0;\n\n  cin >> s;\n  n = strlen(s);\n  for (i = 0, k = 0; i < n; i++) {\n    for (j = 0; s[i] != ' ' && i < n; i++, j++) {\n      sz[k][j] = s[i];\n    }\n    sz[k][j] = '\u0000';\n    k++;\n  }\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(sz[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", sz[i]);\n    }\n    printf(\" \");\n  }\n  if (strcmp(sz[k - 1], a) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", sz[k - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35768", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char word[200], x[200], y[200];\n  int i, j, t[200] = {0};\n  char c;\n\n  cin >> word;\n  cin >> x >> y;\n  for (i = 0; i < strlen(word); i++) {\n    if ((i == 0) || word[i - 1] == ' ')\n      for (j = 0; j < strlen(x); j++) {\n        if (word[i + j] != x[j])\n          break;\n        else if ((j == strlen(x) - 1) &&\n                 (word[i + j + 1] == ' ' || word[i + j + 1] == '\u0000')) {\n          t[i] = 1;\n        }\n      }\n  }\n  for (i = 0; i < strlen(word); i++) {\n    if (t[i] == 0) {\n      printf(\"%c\", word[i]);\n    } else {\n      printf(\"%s\", y);\n      i = i + strlen(x) - 1;\n    }\n  }\n}\n"}
{"label": "19", "index": "35769", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int na, nb, nc, i, j, k, p, num = 0;\n\n  char a[1000], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  na = strlen(a);\n  nb = strlen(b);\n  nc = strlen(c);\n\n  for (i = 0; i < 1000; i++) {\n    for (j = 0; j < nb; j++)\n      if (*(a + i + j) != *(b + j))\n        break;\n    if ((j == nb && *(a + i + nb) == ' ' && *(a + i - 1) == ' ') ||\n        (j == nb && i == 0 && *(a + i + nb) == ' ') ||\n        (j == nb && i == na + num * (nc - nb) - nb && *(a + i - 1) == ' ')) {\n      num++;\n      if (nb >= nc) {\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n        for (p = 0; p < na + num * (nc - nb); p++)\n          *(a + i + nc + p) = *(a + i + nb + p);\n      }\n      if (nb < nc) {\n        for (p = ((nc - nb) * num + na - 1); p > i + nb - 1; p--) {\n          *(a + p) = *(a + p - (nc - nb));\n        }\n        for (k = 0; k < nc; k++) {\n          *(a + i + k) = *(c + k);\n        }\n      }\n    }\n  }\n  for (i = 0; i < (na + num * (nc - nb)); i++)\n    cout << *(a + i);\n}\n"}
{"label": "19", "index": "35770", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[200], b[200], m[100][100];\n  int len, i, hang = 0, lie = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      m[hang][lie] = '\u0000';\n      hang++;\n      lie = 0;\n    } else {\n      m[hang][lie] = s[i];\n      lie++;\n    }\n    if (s[i + 1] == '\u0000') {\n      m[hang][lie] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= hang; i++) {\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n    }\n  }\n  for (i = 0; i < hang; i++)\n    printf(\"%s \", m[i]);\n  printf(\"%s\", m[hang]);\n  return 0;\n}\n"}
{"label": "19", "index": "35771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[25], c[25], d;\n  int m, n, p[25], q, i, j;\n\n  i = 0;\n  do {\n    scanf(\"%s\", &a[i]);\n    i++;\n  } while (getchar() != '\\n');\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (j = 0; j < i; j++) {\n    p[j] = 1;\n    if (strcmp(a[j], b) == 0) {\n      p[j] = 0;\n    }\n  }\n  for (j = 0; j < i; j++) {\n    if (j != 0) {\n      printf(\" \");\n    }\n    if (p[j] != 0) {\n      printf(\"%s\", a[j]);\n    } else\n      cout << c;\n  }\n}\n"}
{"label": "19", "index": "35772", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, t;\n  int i, j, k = -1;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ')\n      n++;\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n      if (a[j] != d[k]) {\n        t = 0;\n      }\n    }\n    if (t == 1 && strlen(a) == strlen(words[i])) {\n      for (j = 0; b[j] != '\u0000'; j++) {\n        words[i][j] = b[j];\n      }\n    }\n    words[i][j] = '\u0000';\n    t = 1;\n  }\n  printf(\"%s\", words[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %s\", words[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35773", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j;\n  char s[100], a[100], b[100];\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  for (i = 0, j = 0; s[i] != '\\0';) {\n    if (s[i + j] == a[j] && (s[i - 1] == ' ' || i == 0))\n      j++;\n    else {\n      cout << s[i];\n      i++;\n      j = 0;\n    }\n    if (a[j] == '\\0' && (s[i + j] == ' ' || s[i + j] == '\\0')) {\n      printf(\"%s\", b);\n      i += j;\n      j = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35774", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100][100];\n  char b[100], c[100], d;\n  int i, n;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n    if (d == 10) {\n      break;\n    }\n  }\n  cin >> b;\n  scanf(\"%s\", c);\n  for (n = 0; n < i + 1; n++) {\n    if (strcmp(a[n], b) == 0) {\n      strcpy(a[n], c);\n    }\n  }\n\n  for (n = 0; n < i; n++) {\n    printf(\"%s \", a[n]);\n  }\n  printf(\"%s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35775", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char a[100] = {\"\"}, b[100] = {\"\"}, c[100] = {\"\"}, d[100] = {\"\"}, *p, *q;\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  p = c;\n  q = d;\n  for (i = 0;;) {\n    for (j = 0; *(p + i) != ' ' && *(p + i) != '\u0000'; i++, j++)\n      *(q + j) = *(p + i);\n    *(q + j) = '\u0000';\n    if (strcmp(d, a) == 0)\n      cout << b;\n    else\n      for (k = 0; k < j; k++)\n        printf(\"%c\", *(q + k));\n    if (*(p + i) != '\u0000')\n      printf(\" \");\n    else\n      break;\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35776", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, k = 0, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  while (s[k] != a[0]) {\n    cout << s[k];\n    k++;\n  }\n  for (i = k; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        printf(\"%s\", b);\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        cout << s[i];\n      m = 0;\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35777", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[200], b[200];\n  char *temp, *ps, *pa, *pb;\n  int flag, ls, la, lb;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  ps = s;\n  pa = a;\n  pb = b;\n  while (ps < s + ls) {\n    flag = 1;\n    for (pa = a; ((*ps != ' ') && (*ps != '\u0000')); ps++, pa++)\n      if (*ps != *pa)\n        flag = 0;\n    if ((flag) && (pa == a + la)) {\n      if (la >= lb) {\n        ps = ps - la;\n        while (*pb != '\u0000')\n          *ps++ = *pb++;\n        if (la > lb) {\n          while (*(ps + la - lb) != '\u0000') {\n            *ps = *(ps + la - lb);\n            ps++;\n          }\n          *ps = '\u0000';\n        }\n      } else {\n        temp = ps;\n        for (ps = s + ls; ps >= temp; ps--)\n          *(ps + lb - la) = *ps;\n        ps = ps - la + 1;\n        while (*pb != '\u0000') {\n          *ps++ = *pb++;\n        }\n      }\n      pa = a;\n      pb = b;\n      ls = strlen(s);\n    }\n    ps++;\n  }\n  ps = s;\n  printf(\"%s\", ps);\n}\n"}
{"label": "19", "index": "35778", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char *s, char *a, char *b, int n1, int n2) {\n  int i, j, k, m, n;\n  char c[100];\n  char d[100];\n  for (i = 0, j = 0; *(s + j) != '\u0000';) {\n    int flag = 1;\n    for (m = 0; *(s + j) != ' ' && s[j] != '\u0000'; m++, j++) {\n      d[m] = s[j];\n      if (s[j + 1] == '\u0000')\n        flag = 0;\n    }\n    d[m] = '\u0000';\n    j = j - m;\n    if (strcmp(d, a) != 0) {\n      for (n = 0; n <= m; i++, j++, n++)\n        *(c + i) = *(s + j);\n    } else {\n      for (k = 0, n = 0; n < n2; i++, k++, n++)\n        *(c + i) = *(b + k);\n      j = j + n1;\n    }\n    if (flag == 1)\n      *(c + i) = ' ';\n    else\n      break;\n  }\n  *(c + i) = '\u0000';\n  printf(\"%s\", c);\n}\n\nint main() {\n  char s[100], a[100], b[100];\n  int n1, n2;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  n1 = strlen(a);\n  n2 = strlen(b);\n  f(s, a, b, n1, n2);\n  return 0;\n}\n"}
{"label": "19", "index": "35779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char st[101];\n  char word1[101], word2[101];\n  int match[101];\n\n  memset(match, 1, sizeof(match));\n\n  cin >> st;\n\n  cin >> word1;\n\n  scanf(\"%s \", word2);\n\n  int len1 = strlen(st), len2 = strlen(word1), len3 = strlen(word2);\n\n  int i, j, k;\n  for (i = 0; i < len1; i++) {\n    if ((i == 0 || st[i - 1] == ' ') && i + len2 <= len1) {\n      for (j = 0; j < len2; j++) {\n        if (st[i + j] != word1[j])\n          match[i] = 0;\n      }\n    }\n  }\n\n  for (i = 0; i < len1; i++) {\n    if (!match[i]) {\n      for (j = i; j < len1; j++) {\n        putchar(st[j]);\n        if (st[j] == ' ')\n          break;\n      }\n      i = j;\n    } else {\n      i += len2;\n      printf(\"%s\", word2);\n      if (i < len1)\n        putchar(' ');\n    }\n  }\n  puts(\"\");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35780", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, tag = 1, flag = 1, e = 0;\n  char q[101], tmp[50][101], p[101], t[101];\n\n  cin >> q;\n\n  cin >> p;\n\n  cin >> t;\n  for (i = 0; i < 50; i++) {\n    k = 0;\n    flag = 1;\n    for (j = e; j < 101; j++) {\n      if (q[j] != ' ' && q[j] != ',' && q[j] != '\u0000') {\n        tmp[i][k] = q[j];\n        k++;\n      } else if (q[j] == ' ') {\n        tmp[i][k] = '\u0000';\n        e = j + 1;\n        break;\n      } else if (q[j] == ',') {\n        tmp[i][k] = '\u0000';\n        e = j + 2;\n        break;\n      } else if (q[j] == '\u0000') {\n        tmp[i][k] = '\u0000';\n        tag = 0;\n        break;\n      }\n    }\n    for (j = 0; j < 101; j++) {\n      if (tmp[i][j] != p[j] && p[j] != '\u0000') {\n        flag = 0;\n        break;\n      } else if (tmp[i][j] == p[j] && p[j] != '\u0000')\n        continue;\n      else if (p[j] == '\u0000')\n        break;\n    }\n    if (tag == 1 && flag == 0 && i > 0)\n      printf(\" %s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i > 0)\n      cout << \" \" << t;\n    else if (tag == 0 && flag == 0 && i > 0) {\n      printf(\" %s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i > 0) {\n      cout << \" \" << t;\n      break;\n    } else if (tag == 1 && flag == 0 && i == 0)\n      printf(\"%s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i == 0)\n      printf(\"%s\", t);\n    else if (tag == 0 && flag == 0 && i == 0) {\n      printf(\"%s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i == 0) {\n      printf(\"%s\", t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "35781", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char words[100][100];\n  char ti[100], bt[100];\n  int i, j, k, n;\n  int a[200];\n\n  cin >> s;\n  cin >> ti;\n  scanf(\"%s\", bt);\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n; i++) {\n    if (strcmp(ti, words[i]) == 0) {\n      strcpy(words[i], bt);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i == 0)\n      printf(\"%s\", words[0]);\n    else\n      printf(\" %s\", words[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35782", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100];\n  int len1 = 0, len2 = 0, len3 = 0, i, j, n = -1, k, flag;\n  cin.getline(s, 101, '\\n');\n  cin.getline(a, 101, '\\n');\n  cin.getline(b, 101, '\\n');\n\n  for (len1 = 0; s[len1] != '\\0'; len1++)\n    ;\n  for (len2 = 0; a[len2] != '\\0'; len2++)\n    ;\n  for (len3 = 0; b[len3] != '\\0'; len3++)\n    ;\n\n  for (i = 0; i < len1; i++) {\n    flag = 0;\n    if (((i != 0) && (s[i] == a[0]) && (s[i - 1] == ' ')) ||\n        ((i == 0) && (s[i] == a[0]))) {\n      flag = 1;\n      for (j = 1; j < len2; j++)\n        if (s[i + j] != a[j])\n          flag = 0;\n      if (((i + j) != len1) && (s[i + j] != ' '))\n        flag = 0;\n    }\n\n    if (flag) {\n      k = n + 1;\n      while (n < k + len3 - 1) {\n        n++;\n        c[n] = b[n - k];\n      }\n      i = i + len2 - 1;\n    } else {\n      n++;\n      c[n] = s[i];\n    }\n  }\n  for (i = 0; i <= n; i++)\n    printf(\"%c\", c[i]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35783", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100], d[10000];\n  int i = 0, j = 0, k, la, lb, lc, s = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    for (k = 0, s = 0; k < lb; k++) {\n      if (a[i] == b[k]) {\n        s = s + 1;\n      }\n      i = i + 1;\n    }\n\n    if ((a[i - k - 1] == ' ') && (s == lb) || ((i - k == 0) && (s == lb))) {\n      i = i - 1;\n      for (k = 0; k < lc; k = k + 1) {\n        d[j] = c[k];\n        j = j + 1;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j = j + 1;\n    }\n  }\n  printf(\"%s\", d);\n}\n"}
{"label": "19", "index": "35784", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[101], a[101], b[101], word[100][101];\n  int n, k, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(word[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(word[n], (s + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, word[i]) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", word[i]);\n  }\n\n  cout << word[n - 1];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35785", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[5000];\n  char m[100][20];\n  char s1[20], s2[20];\n\n  scanf(\"%s \", n);\n  cin >> s1;\n  scanf(\"%s \", s2);\n  int i, j = 0, k = 0, e;\n  e = strlen(n);\n  for (i = 0; i < e; i++) {\n    if (n[i] != ' ') {\n      m[j][k] = n[i];\n      k++;\n    }\n    if (n[i] == ' ') {\n      m[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  m[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(m[i], s1) == 0)\n      strcpy(m[i], s2);\n  }\n\n  printf(\"%s\", m[0]);\n  for (i = 1; i <= j; i++) {\n\n    printf(\" %s\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35786", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sentence[110], first[110], second[110];\n  int i, j, flag;\n  int lens, len1;\n  cin.getline(sentence, 110);\n  cin.getline(first, 110);\n  cin.getline(second, 110);\n  lens = strlen(sentence);\n  len1 = strlen(first);\n  for (i = 0; i < lens - len1 + 1; i++) {\n    flag = 0;\n    if ((i == 0 && sentence[i + len1] == ' ') ||\n        (sentence[i - 1] == ' ' && sentence[i + len1] == ' ') ||\n        (i == lens - len1 && sentence[i - 1] == ' ')) {\n      for (j = 0; j < len1; j++) {\n        if (sentence[i + j] == first[j])\n          flag++;\n      }\n    }\n    if (flag == len1) {\n      i = i + len1 - 1;\n      printf(\"%s\", second);\n    } else\n      cout << sentence[i];\n  }\n  if (flag != len1)\n    for (i = lens - len1 + 1; i < lens; i++)\n      cout << sentence[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200] = {0};\n  char a[100] = {0}, b[100] = {0};\n  int c[200] = {0};\n  int lena = 0, lenb = 0, lens = 0, i = 0, j = 0, k = 0, count = 0, t = 0;\n  cin.get(s, 200, '\\n');\n  scanf(\"%s %s \", a, b);\n  lena = strlen(a);\n  lenb = strlen(b);\n  lens = strlen(s);\n  if ((s[0] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0)) {\n    for (j = 0; j < lena; j++) {\n      if (s[i + j] == a[j])\n        count++;\n    }\n    if (count == lena)\n      k++;\n    count = 0;\n  }\n  for (i = 1; i < lens; i++, count = 0) {\n    if ((s[i] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0) &&\n        (s[i - 1] == 32)) {\n      for (j = 0; j < lena; j++) {\n        if (s[i + j] == a[j])\n          count++;\n      }\n      if (count == lena) {\n        c[k] = i;\n        k++;\n      }\n    }\n  }\n  c[k] = 201;\n  if (lena < lenb) {\n    t = lenb - lena;\n    for (i = lens - 1; i >= 0; i--)\n      for (j = k - 1; j >= 0; j--) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i + (j + 1) * t] = s[i];\n      }\n    for (i = 0; i < k; i++)\n      for (j = 0; j < lenb; j++)\n        s[c[i] + i * t + j] = b[j];\n  } else if (lena >= lenb) {\n    t = lena - lenb;\n    for (i = c[0] + t; i < lens; i++)\n      for (j = 0; j < k; j++) {\n        if (i >= c[j] && i < c[j + 1]) {\n          s[i] = s[i + (j + 1) * t];\n        }\n      }\n    b[lenb] = 32;\n    for (i = 0; i < k; i++)\n      for (j = 0; j <= lenb; j++)\n        s[c[i] - i * t + j] = b[j];\n  }\n  int l = strlen(s);\n  if (s[l - 1] == 32)\n    s[l - 1] = 0;\n  cout << s;\n  return 0;\n}\n"}
{"label": "19", "index": "35788", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100];\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", str[i]);\n    if (str[i][0] < 2)\n      break;\n  }\n\n  for (i = 0; i < 100; i++) {\n    if (strcmp(str[i], str[j - 1]) == 0) {\n      strcpy(str[i], str[j]);\n    }\n  }\n  for (i = 0; i < j - 2; i++) {\n    cout << str[i] << \" \";\n  }\n  printf(\"%s\", str[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "35789", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char(*p)[100], *p1, *p2, *a;\n  char string[100], str[100][100], str1[100], str2[100];\n  n = 0;\n  k = 1;\n  p = str;\n  p1 = str1;\n  p2 = str2;\n  a = string;\n  cin >> string;\n  cin >> str1;\n  cin >> str2;\n  for (i = 0; *(a + i) != '\u0000'; i++)\n    if (*(a + i) == ' ')\n      k++;\n  for (i = 0; *(a + n) != '\u0000'; i++) {\n    for (j = 0; *(a + n) != ' ' && *(a + n) != '\u0000'; j++) {\n      *(*(p + i) + j) = *(a + n);\n      n++;\n    }\n    *(*(p + i) + j) = '\u0000';\n    n = n + 1;\n  }\n  n = n - 1;\n  for (i = 0; i < n; i++)\n    if (strcmp(*(p + i), p1) == 0)\n      strcpy(*(p + i), p2);\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s\", *(p + i));\n    printf(\" \");\n  }\n  printf(\"%s\", *(p + k - 1));\n  return 0;\n}\n"}
{"label": "19", "index": "35790", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[500], b[100], c[100], d[100][100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, k = 0;\n  for (i = 0; i < strlen(a); i++, k++) {\n    for (j = i; a[j] != ' '; j++) {\n      d[k][j - i] = a[j];\n      d[k][j - i + 1] = '\u0000';\n      if (a[j] == '\u0000') {\n        break;\n      }\n    }\n    i = j;\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      strcpy(d[i], c);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", d[i]);\n  }\n  printf(\"%s\", d[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "35791", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], word[100][100] = {0}, a[100], b[100];\n  int i, j, k = 0, k1 = 0, k2 = 0, sl;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  sl = strlen(str);\n  for (i = 0; i < sl; i++) {\n    if (str[i] == ' ' || i == sl - 1) {\n      for (j = k; j < i; j++, k2++)\n        word[k1][k2] = str[j];\n      if (i == sl - 1)\n        word[k1][k2] = str[i];\n      k1++;\n      k2 = 0;\n      k = i + 1;\n    }\n  }\n  for (i = 0; i < k1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k1; i++) {\n    if (i != 0)\n      cout << \" \";\n    printf(\"%s\", word[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35792", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char w[1000], s[100][100], a[100], b[100];\n  int i = 0, j = 0, k = 0, d;\n\n  cin >> w;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  while (w[i] != '\u0000') {\n    while (w[i] != ' ' && w[i] != '\u0000') {\n      s[j][k] = w[i];\n      i++;\n      k++;\n    }\n    s[j][k] = '\u0000';\n    j++;\n\n    k = 0;\n    while (w[i] == ' ') {\n      i++;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    d = strcmp(s[i], a);\n    if (d == 0) {\n      strcpy(s[i], b);\n    }\n  }\n  printf(\"%s\", s[0]);\n  for (i = 1; i < j; i++) {\n    printf(\" %s\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35793", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[999];\n  char a[100];\n  char b[100];\n  int i = 0, j = 0, k;\n  int add;\n  char word[200][100] = {'\u0000'};\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (k = 0; s[k] != '\u0000'; k++) {\n    if (s[k] == ' ') {\n      i++;\n      j = 0;\n    } else {\n      word[i][j] = s[k];\n      j++;\n    }\n  }\n  add = i;\n  for (i = 0; i < add + 1; i++) {\n    if (strcmp(word[i], a) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < add; i++)\n    printf(\"%s \", word[i]);\n  puts(word[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35794", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100 + 1], a[100 + 1], b[100 + 1];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ss[n++] = s;\n  ss[0] = s;\n  n = 1;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      ss[n] = &s[i + 1];\n      n++;\n    }\n  }\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n\n    if (strcmp(ss[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(ss[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char A[110][110] = {0};\n  int i = 0;\n  while (cin >> A[i]) {\n    i++;\n  }\n  int num;\n  for (int j = 0; j < i - 2; j++) {\n    if (strcmp(A[i - 2], A[j]) == 0) {\n      strcpy(A[j], A[i - 1]);\n    }\n  }\n\n  for (int j = 0; j < i - 3; j++) {\n    printf(\"%s \", A[j]);\n  }\n  cout << A[i - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "35796", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[150], a[100], b[100], *p, *q;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  while (strstr(q, a) != NULL) {\n    p = strstr(q, a);\n    *p = '\u0000';\n    if ((*(p - 1) != ' ') && ((p - 1) > s) ||\n        (*(p + strlen(a)) != ' ') && (p + strlen(a) < s + strlen(s)))\n      printf(\"%s%s\", q, a);\n    else\n      printf(\"%s%s\", q, b);\n    p += strlen(a);\n    q = p;\n  }\n  printf(\"%s\", q);\n}\n"}
{"label": "19", "index": "35797", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101], r[101] = \"\";\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char temp[101];\n  int templen = 0;\n  for (int i = 0; s[i]; i++) {\n    if (s[i] != ' ') {\n      temp[templen] = s[i];\n      templen++;\n    } else {\n      temp[templen] = '\\0';\n      if (!strcmp(temp, a))\n        strcat(r, b);\n      else\n        strcat(r, temp);\n      strcat(r, \" \");\n      templen = 0;\n    }\n  }\n  temp[templen] = '\\0';\n  if (!strcmp(temp, a))\n    strcat(r, b);\n  else\n    strcat(r, temp);\n  printf(\"%s\\n\", r);\n  return 0;\n}\n"}
{"label": "19", "index": "35798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], c[100][100] = {0}, a[100], b[100] = {0}, e[100][100], f[100];\n  int m, i, n = 0, l = 0, k = 0, d[100] = {0}, j;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  m = strlen(s);\n  for (i = 0; i < m; i++)\n    if (s[i] == 32)\n      n++;\n  for (i = 0; i <= n; i++) {\n    for (j = 0; s[k] != 32; j++) {\n      c[i][j] = s[k];\n      k++;\n    }\n    if (s[k] == 32)\n      k++;\n  }\n  for (i = 0; i <= n; i++)\n    if (strcmp(c[i], a) == 0)\n      strcpy(e[i], b);\n    else {\n      strcpy(e[i], c[i]);\n    }\n  strcpy(f, e[0]);\n  for (i = 1; i <= n; i++) {\n    strcat(f, \" \");\n    strcat(f, e[i]);\n  }\n  printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35799", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() \n{          \n  char s[200] = {0};\n  char a[100] = {0}, b[100] = {0};\n  int c[200] = {0}; \n  int lena = 0, lenb = 0, lens = 0, i = 0, j = 0, k = 0, count = 0, t = 0;\n  cin.get(s, 200, '\\n');\n  cin >> a >> b;\n  lena = strlen(a);\n  lenb = strlen(b);\n  lens = strlen(s); \n  if ((s[0] == a[0]) &&\n      (s[i + lena] == 32 ||\n       s[i + lena] == 0)) \n  {\n    for (j = 0; j < lena; j++) {\n      if (s[i + j] == a[j])\n        count++;\n    }\n    if (count == lena) \n      k++;\n    count = 0;\n  }\n  for (i = 1; i < lens; i++, count = 0) {\n    if ((s[i] == a[0]) && (s[i + lena] == 32 || s[i + lena] == 0) &&\n        (s[i - 1] == 32)) \n    {\n      for (j = 0; j < lena; j++) {\n        if (s[i + j] == a[j])\n          count++;\n      }\n      if (count == lena) {\n        c[k] = i;\n        k++; \n      }\n    }\n  }\n  c[k] = 201;      \n  if (lena < lenb) \n  {\n    t = lenb - lena; \n    for (i = lens - 1; i >= 0; i--)\n      for (j = k - 1; j >= 0; j--) {\n        if (i >= c[j] && i < c[j + 1]) \n          s[i + (j + 1) * t] = s[i];\n      }\n    for (i = 0; i < k; i++)\n      for (j = 0; j < lenb; j++) \n        s[c[i] + i * t + j] = b[j];\n  } else if (lena >= lenb) {\n    t = lena - lenb;\n    for (i = c[0] + t; i < lens; i++)\n      for (j = 0; j < k; j++) {\n        if (i >= c[j] && i < c[j + 1])\n          s[i] = s[i + (j + 1) * t];\n      }\n    b[lenb] = 32; \n    for (i = 0; i < k; i++)\n      for (j = 0; j <= lenb; j++)\n        s[c[i] - i * t + j] = b[j];\n  }\n  int l = strlen(s); \n  if (s[l - 1] == 32)\n    s[l - 1] = 0;\n  cout << s;\n  return 0;\n} \n"}
{"label": "19", "index": "35800", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar former[150];\nchar zhao[10], huan[10];\nvoid alter(char *p) {\n\n  char *p2;\n  p2 = p + strlen(zhao) + 1;\n  char p3[100];\n  strcpy(p3, p2);\n  *(p + 1) = '\u0000';\n  strcat(former, huan);\n  strcat(former, p3);\n}\n\nint main()\n\n{\n\n  int i;\n\n  scanf(\"%s \", former);\n  cin >> zhao >> huan;\n  char *p0, *p1;\n  p0 = former;\n  for (; *p0 != '\u0000'; p0++) {\n    if (*p0 == ' ' && *(p0 + 1) == zhao[0]) {\n      for (p1 = p0 + 1, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++) {\n        ;\n      }\n      if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000')\n        alter(p0);\n    }\n  }\n  p0 = former;\n  for (p1 = p0, i = 0; *p1 == zhao[i] && zhao[i] != '\u0000'; p1++, i++)\n    ;\n  if ((*p1 == ' ' || *p1 == '\u0000') && zhao[i] == '\u0000') {\n    char *p2;\n    p2 = p0 + strlen(zhao);\n    char p3[100];\n    strcpy(p3, p2);\n    strcat(huan, p3);\n    printf(\"%s\", huan);\n    return 0;\n  }\n\n  printf(\"%s \", former);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35801", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  int i, j, k, ls, la, lb, r;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    if (s[i] == a[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + la] == 32 || i == ls - 1)) {\n      r = 1;\n      for (k = i, j = 0; j < la; j++, k++) {\n\n        if (s[k] != a[j]) {\n          r = 0;\n          break;\n        }\n      }\n      if (r == 1) {\n        for (k = 0; k < lb; k++) {\n          printf(\"%c\", b[k]);\n        }\n        i = i + la - 1;\n        r = 0;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35802", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[100] = {0}, c[100] = {0};\n  int i, j, k, m, count = 0;\n  int x, y;\n  int al, bl, cl;\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  cin.getline(c, 100);\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (i = 0; i <= 100; i++) {\n    for (j = 0; j < bl; j++) {\n      if (a[i + j] == b[j])\n        count++;\n    }\n    x = ((i > 0) && (a[i - 1] == ' ') &&\n         ((a[i + bl] == ' ') || a[i + bl] == (char)0));\n    y = ((i == 0) && ((a[i + bl] == ' ' || a[i + bl] == (char)0)));\n    if (count == bl && (x || y)) {\n      if (bl >= cl) {\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n        for (m = i + cl; m < al - cl; m++)\n          a[m] = a[m - cl + bl];\n      } else {\n        for (m = 100; m >= i + cl; m--)\n          a[m] = a[m - (cl - bl)];\n        for (k = 0; k < cl; k++)\n          a[i + k] = c[k];\n      }\n    }\n\n    count = 0;\n  }\n  cout << a;\n  return 0;\n}\n"}
{"label": "19", "index": "35803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[100], sub[100], repl[100];\n\n  cin >> str;\n\n  cin >> sub;\n\n  cin >> repl;\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if ((same == 1 && str[i - 1] == ' ') || (same == 1 && i == 0)) {\n      printf(\"%s\", repl);\n      i += strlen(sub) - 1;\n    } else {\n      printf(\"%c\", str[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35804", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[50][20], p[20], r[20];\n  int i = 0, n = 0;\n  cin >> a[0];\n  while (cin.get() != '\\n') {\n    i++;\n    cin >> a[i];\n    n = i;\n  }\n  cin >> p;\n  cin.get();\n  cin >> r;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(a[i], p) == 0)\n      strcpy(a[i], r);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", a[i]);\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35805", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s[100], a[100], b[100], d[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (j = 0;; j += (i + 1)) {\n    for (i = 0; s[i + j] != ' ' && s[i + j] != 0; i++)\n      d[i] = s[i + j];\n    d[i] = '\u0000';\n    if (strcmp(a, d) == 0) {\n      if (s[i + j] == 0) {\n        printf(\"%s\", b);\n        break;\n      } else\n        printf(\"%s \", b);\n    } else if (s[i + j] == 0) {\n      printf(\"%s\", d);\n      break;\n    } else {\n      cout << d << \" \";\n    }\n  }\n}\n"}
{"label": "19", "index": "35806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if ((i == 0 && s[i] == a[0] && s[i + m - 1] == a[m - 1] &&\n         s[i + m] == ' ') ||\n        (i != 0 && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1] && s[i + m] == ' ') ||\n        (i + m == n && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1])) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        cout << b;\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n      k = 0;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  cout << \" \";\n\n  return 0;\n}\n"}
{"label": "19", "index": "35807", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  int i, j, len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int n = 0;\n  int word = 0;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      word = 0;\n    } else if (word == 0) {\n      word = 1;\n      n++;\n    }\n  }\n  int A = 0;\n  int l = 0;\n  int k;\n  char x[100];\n  for (j = 0; j < n; j++) {\n    for (i = A, k = 0; i < len; i++, k++) {\n      if (s[i] != ' ') {\n        x[k] = s[i];\n      }\n      if (s[i] == ' ') {\n        x[k] = '\u0000';\n        A = i + 1;\n        break;\n      }\n    }\n    if (i == len)\n      x[k] = '\u0000';\n    if (strcmp(x, a) == 0) {\n      strcpy(x, b);\n    }\n    printf(\"%s\", x);\n    l++;\n    if (l != n) {\n      cout << \" \";\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35808", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint change(int);\n\nconst int N = 100 + 1;\nchar s[N], a[N], b[N], c[N];\nint la = 0, ls = 0;\n\nint main() {\n  int p = 0;\n  cin.getline(s, N);\n  cin >> a >> b;\n  la = strlen(a);\n  ls = strlen(s);\n  if (s[p] == a[0])\n    p = p + change(p);\n  while (p < ls) {\n    if ((s[p] == a[0]) && (s[p - 1] == ' '))\n      p = p + change(p);\n    else {\n      cout << s[p];\n      p++;\n    }\n  }\n  printf(\"\\n\");\n  return 0;\n}\n\nint change(int p) {\n  int i, j;\n  for (i = 0; i < la; i++)\n    if (s[p + i] != a[i])\n      break;\n  if ((i == la) && (s[p + la] == ' ' || s[p + la] == '\\0')) {\n    cout << b;\n    return i;\n  }\n  for (j = 0; j < i; j++) {\n    cout << s[p + j];\n  }\n  return i;\n}\n"}
{"label": "19", "index": "35809", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[10000], a[100], b[100];\n  int i, lone, ltwo, lthree, k, shuzu[10000] = {0}, p = 0, count[10000];\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  lone = strlen(zfc);\n  ltwo = strlen(a);\n  lthree = strlen(b);\n  for (i = 0; i < lone - ltwo + 1; i++) {\n    if (i == 0) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[ltwo] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else {\n      if (i > 0 && i < lone - ltwo) {\n        for (k = 0; k < ltwo; k++) {\n          if (zfc[k + i] == a[k]) {\n            count[i] += 1;\n          }\n        }\n        if (count[i] == ltwo && zfc[i + ltwo] == ' ' && zfc[i - 1] == ' ')\n          shuzu[i] = 1;\n\n      } else {\n        for (k = 0; k < ltwo; k++) {\n          if (zfc[k + i] == a[k]) {\n            count[i] += 1;\n          }\n        }\n        if (count[i] == ltwo && zfc[i - 1] == ' ') {\n          shuzu[i] = 1;\n        }\n      }\n    }\n  }\n  while (p < lone) {\n    if (shuzu[p] == 0) {\n      printf(\"%c\", zfc[p]);\n    } else {\n      printf(\"%s\", b);\n      p = p + ltwo - 1;\n    }\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35810", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *p, *max, *min;\n  char s[110], a[110], b[110];\n  int l = 0;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  p = strtok(s, \" \");\n\n  while (p) {\n    if (l != 0)\n      printf(\" \");\n    if (strcmp(p, a) == 0)\n      p = b;\n    printf(\"%s\", p);\n    p = strtok(NULL, \" \");\n    l++;\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "35811", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    cin >> x[i];\n    if (strlen(x[i]) == 0)\n      break;\n  }\n  n = i - 2;\n  for (i = 0; i < n; i++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(x[i], x[n]) == 0) {\n      printf(\"%s\", x[n + 1]);\n    } else\n      printf(\"%s\", x[i]);\n    j++;\n  }\n}\n"}
{"label": "19", "index": "35812", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], w1[100], w2[100];\n\n  scanf(\"%s \", s);\n\n  cin >> w1;\n\n  cin >> w2;\n  int i, l = strlen(s), l1 = strlen(w1), l2 = strlen(w2), p = 0, m, n, j, k;\n  for (i = 0; i < l; i++) {\n    if (s[i] == w1[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + l1] == 32 || i == l - 1)) {\n      p = 1;\n      for (m = i, n = 0; n < l1; m++, n++)\n        if (s[m] != w1[n]) {\n          p = 0;\n          break;\n        }\n    }\n    if (p) {\n      for (k = 0; k < l2; k++)\n        cout << w2[k];\n      i = i + l1 - 1;\n      p = 0;\n    } else\n      cout << s[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35813", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  cin >> b >> c;\n  int i, j, k, strat;\n  strat = 0;\n  for (i = strat; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0])\n      for (j = 1, k = i + 1; j < strlen(b); j++, k++) {\n        if (b[j] != a[k])\n          break;\n      }\n    if (j == strlen(b) && i == 0) {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n\n    else if (j == strlen(b) && a[i - 1] == ' ') {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n    j = 0;\n  }\n  for (i = strat; a[i] != '\u0000'; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35814", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void CONVERT(char c[100], char d[100], char B, int N, int x);\n  int m, n, l, i, j, k[100], t;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  m = strlen(s);\n  n = strlen(a);\n  l = strlen(b);\n  for (i = 0; i < m; i++) {\n    k[i] = 0;\n  }\n  for (i = 0; i < m; i++) {\n    t = k[i];\n    for (j = i; j < i + n; j++) {\n      if (s[j] == a[j - i]) {\n        k[i] = 1;\n      } else {\n        k[i] = t;\n        break;\n      }\n    }\n    if ((s[i - 1] != ' ') && (i != 0))\n      k[i] = t;\n    if (k[i] == 1)\n      for (j = i + 1; j < i + n; j++) {\n        k[j] = 2;\n      }\n  }\n\n  for (i = 0; i < m; i++) {\n    if (k[i] == 1) {\n      for (j = 0; j < l; j++) {\n        printf(\"%c\", b[j]);\n      }\n    }\n    if (k[i] == 0) {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zf[600], dc[30][30], y[30], h[30];\n\n  cin >> zf;\n\n  cin >> y;\n\n  cin >> h;\n  int n = strlen(zf), a = 0, b = 0;\n  for (int i = 0; i < n + 1; i++) {\n    if (zf[i] != ' ' && zf[i] != ' ') {\n      dc[a][b] = zf[i];\n      b++;\n    } else {\n      dc[a][b] = '\u0000';\n      a++;\n      b = 0;\n    }\n  }\n  for (int k = 0; k < a + 1; k++) {\n    if (strcmp(dc[k], y) == 0)\n      strcpy(dc[k], h);\n  }\n  cout << dc[0];\n  for (int m = 1; m < a + 1; m++)\n    printf(\" %s\", dc[m]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35816", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[25], c[25], d;\n  int m, n, p[25], q, i, j;\n\n  i = 0;\n  do {\n    scanf(\"%s\", &a[i]);\n    i++;\n  } while (getchar() != '\\n');\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (j = 0; j < i; j++) {\n    p[j] = 1;\n    if (strcmp(a[j], b) == 0) {\n      p[j] = 0;\n    }\n  }\n  for (j = 0; j < i; j++) {\n    if (j != 0) {\n      printf(\" \");\n    }\n    if (p[j] != 0) {\n      printf(\"%s\", a[j]);\n    } else\n      printf(\"%s\", c);\n  }\n}\n"}
{"label": "19", "index": "35817", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], c[203];\n  s[0] = a[0] = b[0] = ' ';\n\n  cin >> &s[1];\n  cin >> &a[1] >> &b[1];\n  int slen = strlen(s) + 1, alen = strlen(a) + 1, blen = strlen(b) + 1;\n  s[slen - 1] = a[alen - 1] = b[blen - 1] = ' ';\n  s[slen] = a[alen] = b[blen] = '\u0000';\n  int i, j;\n  for (i = 0, j = 0; i < slen; ++i, ++j) {\n    if (strncmp(s + i, a, alen) == 0) {\n      strcpy(c + j, b);\n      i = i + alen - 1;\n      j = j + blen - 1;\n    } else {\n      c[j] = s[i];\n    }\n  }\n  c[j - 1] = 0;\n  cout << &c[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35818", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char cc[500] = {'\u0000'}, c1[20] = {'\u0000'}, c2[20] = {'\u0000'}, c[30][20] = {'\u0000'}, *p1,\n       *p2, *p3, *p4;\n  int a, b, d, e = 0, f = 0, h, i;\n\n  cin >> cc;\n\n  cin >> c1;\n\n  cin >> c2;\n  p1 = &c[0][0];\n  p2 = &c1[0];\n  p3 = &c2[0];\n  p4 = &cc[0];\n  for (a = 0; a < 500; a++) {\n    if (*(p4 + a) == ' ') {\n      e++;\n      f = 0;\n    } else if (*(p4 + a) != '\u0000') {\n      *(p1 + e * 20 + f) = *(p4 + a);\n      f++;\n    } else {\n      break;\n    }\n  }\n  i = strlen(c1);\n  h = strlen(c2);\n  for (a = 0; a < e + 1; a++) {\n    for (b = 0; b < i; b++) {\n      if (*(p1 + a * 20 + b) != *(p2 + b)) {\n        break;\n      }\n    }\n    if (b == i) {\n      for (d = 0; d < h; d++) {\n        *(p1 + a * 20 + d) = *(p3 + d);\n      }\n      for (d = h; d < 20; d++) {\n        *(p1 + a * 20 + d) = '\u0000';\n      }\n    }\n  }\n  for (d = 0; d < e; d++) {\n    printf(\"%s \", c[d]);\n  }\n  printf(\"%s \", c[e]);\n}\n"}
{"label": "19", "index": "35819", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word_in[200], word_tr[200], word_out[200], word_fil[200];\n  for (int i = 0; i < 200; i++) {\n    word_in[i] = 0;\n    word_tr[i] = 0;\n    word_out[i] = 0;\n    word_fil[i] = 0;\n  }\n  int lg1, lg2, lg3, lg4, sum = 0, t = 0;\n  cin.getline(word_in, 200);\n  lg1 = strlen(word_in);\n  word_in[lg1] = ' ';\n  cin.getline(word_tr, 200);\n  lg2 = strlen(word_tr);\n  cin.getline(word_out, 200);\n  lg3 = strlen(word_out);\n  for (int i = 0; i < 200; i++) {\n    sum = 0;\n    for (int j = 0; j < lg2; j++) {\n      if (word_in[i + j] == word_tr[j]) {\n        sum = sum + 1;\n      }\n    }\n    if ((word_in[i - 1] == ' ' || i == 0) && word_in[i + lg2] == ' ' &&\n        sum == lg2) {\n      if (lg3 == lg2) {\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg2;\n      }\n      if (lg3 < lg2) {\n        for (int j = 0; j < lg3; j++)\n          word_in[i + j] = word_out[j];\n\n        for (int j = lg3; j < lg2; j++) {\n          word_in[i + j] = ' ';\n        }\n        i = i + lg2;\n      }\n      if (lg3 > lg2) {\n        for (int j = 199; j >= i + lg2; j--) {\n          word_in[j + lg3 - lg2] = word_in[j];\n        }\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg3;\n      }\n    }\n  }\n  for (int i = 0; i < 200; i++) {\n    if (word_in[i] != ' ') {\n      word_fil[t] = word_in[i];\n      t++;\n    }\n    if (word_in[i] == ' ') {\n      if (word_in[i + 1] != ' ') {\n        word_fil[t] = word_in[i];\n        t++;\n      }\n    }\n  }\n  lg4 = strlen(word_fil);\n  for (int i = 0; i < lg4 - 1; i++) {\n    printf(\"%c\", word_fil[i]);\n  }\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35820", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], change[100], chafor[100];\n  char a[100][100] = {{'0'}, {'0'}};\n  int i, j, len, m, start = 0, num = 1;\n\n  cin >> str;\n\n  scanf(\"%s \", change);\n\n  cin >> chafor;\n  len = strlen(str);\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ')\n      num += 1;\n  }\n  for (i = 0; i < num; i++) {\n    m = 0;\n    for (j = start; j < len; j++) {\n      if (str[j] != ' ') {\n        a[i][m] = str[j];\n        m += 1;\n      } else {\n        start = j + 1;\n        break;\n      }\n    }\n  }\n  for (i = 0; i < num; i++) {\n    if (strcmp(a[i], change) == 0)\n      strcpy(a[i], chafor);\n  }\n  printf(\"%s\", a[0]);\n  for (i = 1; i < num; i++)\n    printf(\" %s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35821", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100][100] = {0}, c[100] = {0}, d[100] = {0};\n  int i, j, m = 0, n = 1, k = 0;\n\n  cin >> a;\n\n  cin >> c;\n\n  cin >> d;\n  m = strlen(a);\n  for (j = 0; j <= m - 1; j++)\n    if (a[j] == 32)\n      n++;\n  for (j = 0; j <= n - 1; j++) {\n    for (i = 0; a[k] != 32; i++) {\n      b[j][i] = a[k];\n      k++;\n    }\n    if (a[k] == 32)\n      k++;\n  }\n  for (j = 0; j <= n - 1; j++) {\n    if (j)\n      printf(\" \");\n    if (strcmp(b[j], c) == 0)\n      printf(\"%s\", d);\n    else\n      printf(\"%s\", b[j]);\n  }\n  cout << \" \";\n}\n"}
{"label": "19", "index": "35822", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, t;\n  int i, j, k = -1;\n\n  scanf(\"%s \", d);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ') {\n      n++;\n    }\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n      if (a[j] != d[k]) {\n        t = 0;\n      }\n    }\n    if (t == 1 && strlen(a) == strlen(words[i])) {\n      for (j = 0; b[j] != '\u0000'; j++) {\n        words[i][j] = b[j];\n      }\n    }\n    words[i][j] = '\u0000';\n    t = 1;\n  }\n  printf(\"%s\", words[0]);\n  for (i = 1; i < n; i++)\n    printf(\" %s\", words[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35823", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char *p1, *p2, *p3, *p4;\n  int n1, n2, n3, flag = 1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  n1 = strlen(s);\n  n2 = strlen(a);\n  n3 = strlen(b);\n  while (p1 < s + n1) {\n    p2 = a;\n    p3 = b;\n    if (isalpha(*p1)) {\n      if (flag) {\n        flag = 0;\n        for (p4 = p1; p2 < a + n2; p4++, p2++)\n          if (*p4 != *p2)\n            break;\n        if ((p2 - a) == n2) {\n          for (; p3 < b + n3; p3++)\n            printf(\"%c\", *p3);\n          p1 = p1 + n2;\n        } else {\n          for (; isalpha(*p1); p1++)\n            cout << *p1;\n        }\n      }\n    } else {\n      printf(\" \");\n      flag = 1;\n      p1++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *q;\n  s = (char *)malloc(100);\n  a = (char *)malloc(100);\n  b = (char *)malloc(100);\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  for (p = s;; p++) {\n    if (*p == '\u0000') {\n      if (strcmp(q, a) == 0) {\n        printf(\"%s\", b);\n        break;\n      }\n      printf(\"%s\", q);\n      break;\n    }\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[10000];\n  char word[100][100];\n  char w1[100], w2[100];\n\n  cin >> s;\n\n  cin >> w1;\n\n  cin >> w2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ')\n      word[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++)\n    if (strcmp(word[i], w1) == 0)\n      strcpy(word[i], w2);\n  for (i = 0; i < j; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\", word[j]);\n}\n"}
{"label": "19", "index": "35826", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *c, *e;\n  s = (char *)malloc(101 * sizeof(char));\n  a = (char *)malloc(101 * sizeof(char));\n  b = (char *)malloc(101 * sizeof(char));\n  c = (char *)malloc(101 * sizeof(char));\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  e = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", c);\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    s = s + strlen(c) + 1;\n    if (s >= e)\n      break;\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sentence[101];\n  char word[20];\n  char subWord[20];\n  cin.getline(sentence, 100);\n  cin.getline(word, 20);\n  cin.getline(subWord, 20);\n  int i, lenOfSen = 0, lenOfWord = 0, lenOfsubWord = 0;\n  int left[100], right[100];\n  int found = 0;\n  for (i = 0; i < 100; i++) {\n    if (sentence[i] != '\\0') {\n      lenOfSen++;\n    }\n    if (sentence[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (word[i] != '\\0') {\n      lenOfWord++;\n    }\n    if (word[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (subWord[i] != '\\0') {\n      lenOfsubWord++;\n    }\n    if (subWord[i] == '\\0') {\n      break;\n    }\n  }\n\n  for (i = 0; i < lenOfSen; i++) {\n    if (sentence[i] == word[0]) {\n      if (i == 0 || sentence[i - 1] == ' ') {\n\n        left[found] = i;\n        int j;\n        for (j = 1; j < lenOfWord; j++) {\n          if (sentence[i + j] != word[j]) {\n            break;\n          }\n        }\n        if (j == lenOfWord) {\n          if (i + j == lenOfSen || sentence[i + j] == ' ') {\n\n            right[found] = i + j;\n            found++;\n          }\n        }\n      }\n    }\n  }\n\n  char newString[200];\n  int k = 0;\n  if (found == 0) {\n    printf(\"%s\\n\", sentence);\n  } else {\n    int t = 0;\n    for (i = 0; i < lenOfSen; i++) {\n      if (i == left[t]) {\n        for (int j = 0; j < lenOfsubWord; j++) {\n          newString[k++] = subWord[j];\n        }\n        i = right[t];\n        if (t < found)\n          t++;\n      }\n      newString[k++] = sentence[i];\n    }\n    newString[k] = '\\0';\n    cout << newString << \"\\n\";\n  }\n}\n"}
{"label": "19", "index": "35828", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[10000], a[101], b[101];\n  int l0, l1, l2, i, j, k, counter;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  l0 = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n\n  i = 0;\n  if (s[i] == a[0]) {\n    counter = 0;\n    for (j = i + 1; j < i + l1; j++) {\n      if (s[j] != a[j - i])\n        counter++;\n    }\n    if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n      counter++;\n    if (counter == 0) {\n      if (l1 >= l2) {\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n        for (j = i + l1; j <= l0; j++)\n          s[j - (l1 - l2)] = s[j];\n      }\n      if (l2 > l1) {\n        for (j = l0; j >= i + l1; j--)\n          s[j - (l1 - l2)] = s[j];\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n      }\n    }\n  }\n\n  for (i = 1; i < l0; i++) {\n    if (s[i] == a[0]) {\n      counter = 0;\n      for (j = i + 1; j < i + l1; j++) {\n        if (s[j] != a[j - i])\n          counter++;\n      }\n      if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n        counter++;\n      if (s[i - 1] != ' ')\n        counter++;\n      if (counter == 0) {\n        if (l1 >= l2) {\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n          for (j = i + l1; j <= l0; j++)\n            s[j - (l1 - l2)] = s[j];\n        }\n        if (l2 > l1) {\n          for (j = l0; j >= i + l1; j--)\n            s[j - (l1 - l2)] = s[j];\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n        }\n        l0 += l2 - l1;\n      }\n    }\n  }\n  cout << s << endl;\n}\n"}
{"label": "19", "index": "35829", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char string[100], word[50][15], subword[15], subed[15];\n\n  cin >> string;\n  scanf(\"%s%s\", subed, subword);\n  char *p = string;\n  int i = 0, j;\n  while (*p != '\u0000') {\n    sscanf(p, \"%s\", word[i]);\n    p += strlen(word[i]);\n    i++;\n    if (*p == ' ')\n      p++;\n  }\n  for (j = 0; j < i; j++)\n    if (strcmp(word[j], subed) == 0)\n      strcpy(word[j], subword);\n  printf(\"%s\", word[0]);\n  for (j = 1; j < i; j++)\n    printf(\" %s\", word[j]);\n}\n"}
{"label": "19", "index": "35830", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[300] = {'\u0000'}, w1[100], w2[100];\n  char *p, *q;\n\n  cin >> str;\n\n  cin >> w1;\n\n  cin >> w2;\n  p = str;\n  q = str;\n  while (*p != ' ')\n    p++;\n\n  *p = '\u0000';\n\n  if (strcmp(q, w1) == 0) {\n    printf(\"%s\", w2);\n  } else {\n    printf(\"%s\", q);\n  }\n  p++;\n  q = p;\n\n  while (*p != '\u0000') {\n    p++;\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *p = '\u0000';\n\n      printf(\" \");\n      if (strcmp(q, w1) == 0) {\n        printf(\"%s\", w2);\n      } else {\n        printf(\"%s\", q);\n      }\n\n      p++;\n      q = p;\n    }\n  }\n}\n"}
{"label": "19", "index": "35831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000];\n  int ls, la, lb, i, j, pointer = 0, t, m = 0, n = 0;\n  cin.get(s, 1000);\n  cin >> a;\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 0; i < ls; i++) {\n    int counter = 0;\n\n    for (j = 0; j < la; j++) {\n      if (s[i + j] == a[j]) {\n        counter++;\n        continue;\n      } else\n        break;\n    }\n    if (counter == la && (s[i] == a[0] && (i == 0 || s[i - 1] == ' '))) {\n\n      for (t = 0; t < lb; t++) {\n        c[pointer] = b[t];\n        pointer++;\n      }\n\n      i = i + la - 1;\n    } else {\n      c[pointer] = s[i];\n      pointer++;\n    }\n  }\n  c[pointer] = '\\0';\n  for (j = 0; j < pointer; j++)\n    cout << c[j];\n  return 0;\n}\n"}
{"label": "19", "index": "35832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100], str1[100], str2[100], a[100][100];\n\n  cin >> s;\n  int len = strlen(s);\n\n  cin >> str1;\n\n  cin >> str2;\n  int lenth = strlen(str2);\n  int i, j, p;\n  for (i = 0, j = 0, p = 0; j < len; j++) {\n    a[i][p++] = s[j];\n    if (s[j + 1] == ' ') {\n      j = j + 1;\n      a[i][p] = '\u0000';\n      i = i + 1;\n      p = 0;\n    }\n  }\n  a[i][p] = '\u0000';\n  int num = i;\n  int judge = 0;\n  for (i = 0; i < num + 1; i++) {\n    if (strcmp(a[i], str1) == 0) {\n      for (j = 0; j < lenth; j++) {\n        a[i][j] = str2[j];\n      }\n      a[i][lenth] = '\u0000';\n      judge = 1;\n    }\n  }\n\n  if (judge == 0)\n    printf(\"%s \", s);\n  else {\n    cout << a[0];\n    for (i = 1; i < num + 1; i++) {\n      printf(\" %s\", a[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35833", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[100], targ[100], subs[100];\n\n  cin >> sen;\n  cin >> targ;\n  scanf(\"%s \", subs);\n  char *p, *q, *c, *t;\n  int flag = 0;\n  p = sen;\n  c = targ;\n  char output[100] = {0};\n  while (p < sen + strlen(sen)) {\n    c = targ;\n    while (*p++ != targ[0])\n      ;\n    q = p - 1;\n    if (q != sen && *(q - 1) != ' ')\n      continue;\n    p--;\n    while (*c && *p++ == *c++)\n      ;\n    if ((*p == ' ' || *p == 0) && *c == 0)\n      flag = 1;\n    if (flag) {\n      t = p;\n      output[0] = 0;\n      strncpy(output, sen, q - sen);\n      output[q - sen] = 0;\n      strcat(output, subs);\n      strcat(output, t);\n      strcpy(sen, output);\n      p = sen;\n    }\n  }\n  if (!flag) {\n    puts(sen);\n    exit(0);\n  }\n\n  puts(output);\n}\n"}
{"label": "19", "index": "35834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][20], m, b[20], c[20];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    if (getchar() == ' ')\n      break;\n  }\n  cin >> b;\n  scanf(\"%s \", c);\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      strcpy(a[j], c);\n    }\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%s \", a[j]);\n  printf(\"%s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35835", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, c[102], k = 0, s;\n  char a[102], b[102], d[102];\n\n  cin >> a + 1;\n  cin >> b + 1;\n  cin >> d + 1;\n  i = 1;\n  j = 1;\n  while (i <= strlen(a + 1) && j <= strlen(b + 1)) {\n    if (a[i] == b[j]) {\n      i++;\n      j++;\n    } else {\n      i = i - j + 2;\n      j = 1;\n    }\n    if (j > strlen(b + 1)) {\n      if ((a[1] == b[1] && a[i] == ' ') ||\n          ((a[i] == ' ' || a[i] == '\u0000') && a[i - j] == ' ')) {\n        c[k] = i - strlen(b + 1);\n        k++;\n      }\n      j = 1;\n    }\n  }\n  c[k] = -1;\n  if (c[0] == -1)\n    for (i = 1; i <= strlen(a + 1); i++)\n      cout << a[i];\n  else {\n    i = 1;\n    s = 0;\n    while (i <= strlen(a + 1)) {\n\n      if (i != c[s]) {\n        cout << a[i];\n        i++;\n      } else {\n        i = i + strlen(b + 1);\n        s++;\n        for (j = 1; j <= strlen(d + 1); j++)\n          printf(\"%c\", d[j]);\n      }\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35836", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[10001];\n  char c1[101], c2[101];\n  int i, j, a, b, c;\n  cin.getline(str, 10001);\n  scanf(\"%s %s \", c1, c2);\n  a = strlen(str);\n  b = strlen(c1);\n  c = strlen(c2);\n  for (i = 0; i < a; i++) {\n    if (((str[i - 1] == 32) && (str[i + b] == 32)) ||\n        ((i == 0) && (str[i + b] == 32)) ||\n        (str[i - 1] == 32) && (i + b == a)) {\n      if (str[i] == c1[0]) {\n        for (j = i; j <= i + b - 1; j++) {\n          if (str[j] != c1[j - i])\n            break;\n        }\n        if (j == (i + b)) {\n          if (c > b) {\n            for (j = a - 1; j >= i + b; j--) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) {\n              str[j] = c2[j - i];\n            }\n            a = a + c - b;\n            i = i + c - 1;\n          } else {\n            for (j = i + b; j <= a - 1; j++) {\n              str[j + c - b] = str[j];\n            }\n            for (j = i; j <= i + c - 1; j++) {\n              str[j] = c2[j - i];\n            }\n            a = a + c - b;\n            i = i + c;\n          }\n        }\n      }\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << str[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35837", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[120], a[120], b[120];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int len_s = strlen(s);\n  int len_a = strlen(a);\n  int i = 0, j;\n  while (i < len_s) {\n    if (i == 0 || s[i - 1] == ' ') {\n      for (j = 0; j < len_a && i + j < len_s; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (j == len_a) {\n        cout << b;\n        i += len_a;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35838", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zf1[110], zfa[110], zfb[110];\n\n  scanf(\"%s \", zf1);\n\n  cin >> zfa;\n\n  cin >> zfb;\n  int x = strlen(zf1);\n  int y = strlen(zfa);\n  int z = strlen(zfb);\n  int i, j;\n  int k = 0, m = 0, h = 0;\n  int sz[100];\n  for (i = 0; i < x; i++) {\n    if (i == 0) {\n      if (zf1[i] == zfa[0]) {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n    if (i != 0) {\n      if (zf1[i] == zfa[0] && zf1[i - 1] == ' ') {\n        k = 0;\n        if (zf1[i + y] == ' ' || zf1[i + y] == '\u0000') {\n          for (j = 0; j < y; j++) {\n            if (zf1[i + j] == zfa[j]) {\n              k++;\n            }\n          }\n          if (k == y) {\n            sz[m] = i;\n            m++;\n          }\n        }\n      }\n    }\n  }\n  for (j = 0; j < x; j++) {\n    h = 0;\n    for (i = 0; i < m; i++) {\n      if (j == sz[i]) {\n        printf(\"%s\", zfb);\n        j = j + y - 1;\n        h = 1;\n        break;\n      }\n    }\n\n    if (h != 1) {\n      printf(\"%c\", zf1[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35839", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][20], b[20], c[20];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    if (getchar() == ' ')\n      break;\n  }\n\n  cin >> b;\n\n  cin >> c;\n  for (j = 0; j <= i; j++) {\n    if (strcmp(a[j], b) == 0) {\n      strcpy(a[j], c);\n    }\n  }\n\n  for (j = 0; j < i; j++)\n    printf(\"%s \", a[j]);\n  printf(\"%s\", a[i]);\n}\n"}
{"label": "19", "index": "35840", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  cin >> b;\n  cin >> c;\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n    d[j] = '\\0';\n  }\n  cout << d << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35841", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s;\n  char *a;\n  char *b;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 1000);\n  b = (char *)malloc(sizeof(char) * 1000);\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  free(a);\n  free(b);\n  free(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35842", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[120], a[120], b[120];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  int len_s = strlen(s);\n  int len_a = strlen(a);\n  int i = 0, j;\n  while (i < len_s) {\n    if (i == 0 || s[i - 1] == ' ') {\n      for (j = 0; j < len_a && i + j < len_s; j++)\n        if (s[i + j] != a[j])\n          break;\n      if (j == len_a) {\n        printf(\"%s\", b);\n        i += len_a;\n      } else {\n        cout << s[i];\n        i++;\n      }\n    } else {\n      printf(\"%c\", s[i]);\n      i++;\n    }\n  }\n  cout << endl;\n\n  return 0;\n}\n"}
{"label": "19", "index": "35843", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[201], a[101], b[101];\n  int S, A;\n  int i, j, m = 0;\n  cin.getline(s, 201);\n  S = strlen(s);\n  cin.getline(a, 101);\n  A = strlen(a);\n  cin.getline(b, 101);\n  for (i = 0; i < S; i++) {\n    if (s[i] == a[0]) {\n      for (j = i; j < A + i; j++) {\n        if (s[j] == a[j - i])\n          m++;\n      }\n      if ((i == 0) && (m == A)) {\n        cout << b;\n        i = i + A - 1;\n      } else if ((m == A) && (i != 0) && (s[i - 1] == 32)) {\n        cout << b;\n        i = i + A - 1;\n      } else\n        printf(\"%c\", s[i]);\n      m = 0;\n    } else\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35844", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100] = {'\u0000'}, h[50][50] = {'\u0000'}, d[10] = {'\u0000'}, w[10];\n  int i, j = 0, k = 0, t = 0;\n\n  cin >> s;\n\n  cin >> w;\n\n  cin >> d;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    h[k][j] = s[i];\n    j++;\n    if ((s[i + 1] == ' ') || (s[i + 1] == '\u0000')) {\n      h[k][j] = '\u0000';\n      k++;\n      j = 0;\n      i++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    t = 0;\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      if (strcmp(h[i], w) == 0) {\n        if (h[i][j] == w[j]) {\n          t = 1;\n        }\n      }\n    }\n    if (t == 1) {\n      strcpy(h[i], d);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; h[i][j] != '\u0000'; j++) {\n      printf(\"%c\", h[i][j]);\n    }\n    printf(\" \");\n  }\n  for (j = 0; h[k - 1][j] != '\u0000'; j++)\n    printf(\"%c\", h[k - 1][j]);\n}\n"}
{"label": "19", "index": "35845", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++)\n    c[i] = s[i] = a[i] = '\u0000';\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int m;\n    char ch[101];\n    for (m = 0; m <= 100; m++)\n      ch[m] = '\u0000';\n    for (m = 0; m <= (n[i] - n[i - 1] - 2); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n    if (strcmp(a, ch) == 0)\n      strcat(s, b);\n    else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35846", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *a, *b, *s, *p, *t;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (;; s++) {\n    p = a;\n    t = s;\n    while (*s == *p && *s != ' ' && *s != '\u0000') {\n      p++;\n      s++;\n    }\n    if (*s == ' ' && *p == '\u0000') {\n      printf(\"%s\", b);\n      printf(\" \");\n      continue;\n    } else if (*s == '\u0000' && *p == '\u0000') {\n      printf(\"%s\", b);\n      break;\n    }\n    while (*s != ' ' && *s != '\u0000')\n      s++;\n    if (*s == ' ') {\n      for (; *t != ' '; t++)\n        printf(\"%c\", *t);\n      printf(\" \");\n    }\n    if (*s == '\u0000') {\n      for (; *t != '\u0000'; t++)\n        printf(\"%c\", *t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "35847", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char sentence[101];\n  char word[20];\n  char subWord[20];\n  cin.getline(sentence, 100);\n  cin.getline(word, 20);\n  cin.getline(subWord, 20);\n  int i, lenOfSen = 0, lenOfWord = 0, lenOfsubWord = 0;\n  int left[100], right[100];\n  int found = 0;\n  for (i = 0; i < 100; i++) {\n    if (sentence[i] != '\\0') {\n      lenOfSen++;\n    }\n    if (sentence[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (word[i] != '\\0') {\n      lenOfWord++;\n    }\n    if (word[i] == '\\0') {\n      break;\n    }\n  }\n  for (i = 0; i < 20; i++) {\n    if (subWord[i] != '\\0') {\n      lenOfsubWord++;\n    }\n    if (subWord[i] == '\\0') {\n      break;\n    }\n  }\n\n  for (i = 0; i < lenOfSen; i++) {\n    if (sentence[i] == word[0]) {\n      if (i == 0 || sentence[i - 1] == ' ') {\n\n        left[found] = i;\n        int j;\n        for (j = 1; j < lenOfWord; j++) {\n          if (sentence[i + j] != word[j]) {\n            break;\n          }\n        }\n        if (j == lenOfWord) {\n          if (i + j == lenOfSen || sentence[i + j] == ' ') {\n\n            right[found] = i + j;\n            found++;\n          }\n        }\n      }\n    }\n  }\n\n  char newString[200];\n  int k = 0;\n  if (found == 0) {\n    cout << sentence << endl;\n  } else {\n    int t = 0;\n    for (i = 0; i < lenOfSen; i++) {\n      if (i == left[t]) {\n        for (int j = 0; j < lenOfsubWord; j++) {\n          newString[k++] = subWord[j];\n        }\n        i = right[t];\n        if (t < found)\n          t++;\n      }\n      newString[k++] = sentence[i];\n    }\n    newString[k] = '\\0';\n    cout << newString << endl;\n  }\n}\n"}
{"label": "19", "index": "35848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100], t;\n  int i, j;\n  for (i = 0; i <= 100; i++) {\n    scanf(\"%s\", a[i]);\n    t = getchar();\n    if (t != ' ') {\n      j = i;\n      break;\n    }\n  }\n\n  scanf(\"%s \", b);\n\n  cin >> c;\n  if (strcmp(a[0], b) == 0)\n    printf(\"%s\", c);\n  else\n    printf(\"%s\", a[0]);\n  for (i = 1; i <= j; i++) {\n    if (strcmp(a[i], b) == 0)\n      cout << \" \" << c;\n    else\n      printf(\" %s\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35849", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nchar *Strlwr(char *);\n\nint main() {\n  char input[110], replaced[110], replace[110]; \n  char inputL[110], replacedL[110];             \n  char *p, *pL, *start;                         \n  int len;                                      \n  char temp;\n\n  cin.getline(input, 110);\n  cin.getline(replaced, 110);\n  cin.getline(replace, 110);\n\n  strcpy(inputL, input);\n  strcpy(replacedL, replaced);\n\n  len = strlen(replaced);\n  pL = strstr(inputL, replacedL); \n  start = input;                  \n  while (pL != NULL)              \n  {\n    if ((pL == inputL || isalpha(*(pL - 1)) == 0) && isalpha(*(pL + len)) == 0)\n    \n    {\n      p = input + (pL - inputL); \n      *p = '\\0';                 \n\n      cout << start << replace;\n\n      start = p + len; \n      pL = strstr((start - input) + inputL,\n                  replacedL); \n    } else {\n      p = input + (pL - inputL) + len; \n      temp = *p;                       \n      *p = '\\0';\n\n      cout << start;\n\n      start = p;     \n      *start = temp; \n      pL = strstr((start - input) + inputL, replacedL);\n    }\n  }\n\n  cout << start << endl; \n\n  return 0;\n}\n\nchar *Strlwr(char *p) {\n  for (; *p != '\\0'; p++)\n    if (*p >= 'A' && *p <= 'Z')\n      *p += 32;\n\n  return p;\n}\n"}
{"label": "19", "index": "35850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[100][1000];\n  int i, j, m = 0, l, k = 0;\n  char w[1000], x[1000], y[1000];\n\n  scanf(\"%s \", w);\n  j = strlen(w);\n  for (i = 0; i < j; i++) {\n    if (w[i] != ' ') {\n      n[m][k] = w[i];\n      k++;\n    } else {\n      n[m][k] = '\u0000';\n      m++;\n      k = 0;\n    }\n  }\n  n[m][k] = '\u0000';\n  m++;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; i < m; i++)\n    if (strcmp(n[i], x) == 0)\n      strcpy(n[i], y);\n  for (i = 0; i < m; i++)\n    if (i == m - 1)\n      cout << n[i];\n    else\n      printf(\"%s \", n[i]);\n}\n"}
{"label": "19", "index": "35851", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[40][101] = {'\\0'};\n  char c[101] = {'\\0'};\n  cin.getline(c, 101);\n  int i = 0, j = 0, k = 0;\n  while (c[i] != '\\0') {\n    if (c[i] != ' ') {\n      str[j][k] = c[i];\n      k++;\n    }\n    if (c[i] == ' ') {\n      j++;\n      k = 0;\n    }\n    i++;\n  }\n  char st1[100], st2[100];\n  cin >> st1;\n  cin >> st2;\n  for (i = 0; i < j + 1; i++)\n    if (strcmp(str[i], st1) == 0)\n      strcpy(str[i], st2);\n  for (i = 0; i < j; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35852", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char danchi[1000];\n  char e[50][1000], a[1000], b[1000];\n  cin >> danchi;\n  scanf(\"%s %s\", a, b);\n  int i, j, g = 0, l = 0, v = 0, m = 0;\n  int max = 0, min = 100, max1, min1;\n\n  int c = strlen(danchi);\n  for (j = 0; j < 50; j++) {\n    l = 0;\n    for (i = g; i < 1000; i++) {\n      if (danchi[i] == ' ') {\n        m++;\n        break;\n      }\n      e[j][l] = danchi[i];\n      g++;\n      l++;\n      v++;\n    }\n    g++;\n    v++;\n\n    if (v > c)\n      break;\n  }\n\n  for (i = 0; i < m; i++) {\n    if (strcmp(e[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", e[i]);\n    }\n  }\n  if (strcmp(e[m], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    cout << e[m];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[100], *a, *b;\n  char c;\n  int i, n;\n  for (i = 0; i <= 100; i++)\n    p[i] = (char *)malloc(100);\n  for (i = 0, n = 0;; i++) {\n    scanf(\"%s\", p[i]);\n    n++;\n    if ((c = getchar()) == ' ')\n      break;\n  }\n  a = (char *)malloc(10);\n  b = (char *)malloc(10);\n  cin >> a;\n  cin >> b;\n  for (i = 0; i < n; i++) {\n    if (strcmp(p[i], a) == 0)\n      strcpy(p[i], b);\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s\", p[i]);\n    if (i != n - 1)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35854", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[110];\n  char a[110];\n  char b[110];\n  char out[2000];\n  char tmp[110];\n  int index = 0;\n  int out_i = 0;\n  int len;\n  int len_a;\n  int len_b;\n\n  memset(out, 0, sizeof(out));\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n\n  cin >> str;\n  len = strlen(str);\n\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n\n  for (int i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      tmp[index++] = str[i];\n    } else if (str[i] == ' ') {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n      out[out_i++] = ' ';\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n\n    if (i == len - 1) {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n  }\n\n  cout << out << \"\\n\";\n}\n"}
{"label": "19", "index": "35855", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100];\n  int len1 = 0, len2 = 0, len3 = 0, i, j, n = -1, k,\n      flag;                  \n  cin.getline(s, 101, '\\n'); \n  cin.getline(a, 101, '\\n');\n  cin.getline(b, 101, '\\n');\n\n  for (len1 = 0; s[len1] != '\\0'; len1++)\n    ; \n  for (len2 = 0; a[len2] != '\\0'; len2++)\n    ;\n  for (len3 = 0; b[len3] != '\\0'; len3++)\n    ;\n\n  for (i = 0; i < len1; i++) {\n    flag = 0; \n    if (((i != 0) && (s[i] == a[0]) && (s[i - 1] == ' ')) ||\n        ((i == 0) &&\n         (s[i] == a[0]))) \n    {\n      flag = 1; \n      for (j = 1; j < len2; j++)\n        if (s[i + j] != a[j])\n          flag = 0; \n      if (((i + j) != len1) && (s[i + j] != ' '))\n        flag = 0; \n    }\n\n    if (flag) \n    {\n      k = n + 1;\n      while (n < k + len3 - 1) {\n        n++;\n        c[n] = b[n - k];\n      }\n      i = i + len2 - 1; \n    } else {\n      n++;\n      c[n] = s[i];\n    } \n  }\n  for (i = 0; i <= n; i++)\n    cout << c[i]; \n\n  return 0;\n}\n"}
{"label": "19", "index": "35856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, hh, la, lb, ls, same, head, end, l, sum;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  hh = 0;\n  sum = 0;\n  for (i = 0; i < ls; i++) {\n    same = 0;\n    if ((s[i] == a[0]) && (i == 0 || s[i - 1] == ' ')) {\n      l = 1;\n      for (j = 1; j < la; j++) {\n        if (a[j] != s[i + j]) {\n          same = 0;\n          break;\n        }\n        l++;\n        same = 1;\n        head = i;\n        end = i + la - 1;\n      }\n    }\n    if ((same == 1) && (i + la == ls || s[i + la] == ' ')) {\n      for (k = hh; k < head; k++)\n        cout << s[k];\n      for (k = 0; k < lb; k++)\n        printf(\"%c\", b[k]);\n      hh = end + 1;\n      sum = 1;\n    }\n  }\n  if (sum == 0) {\n    cout << s;\n  }\n  if (sum == 1) {\n    for (i = hh; i < ls; i++)\n      printf(\"%c\", s[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  for (int y = 0;; y++) {\n    if (a == 64) {\n      printf(\n          \"Almost all platforms for developing WebGIS are complex extremely\");\n      return 0;\n    }\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] == 't')\n          continue;\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35858", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[101], z[11], s[16][11];\n\n  cin >> b;\n\n  cin >> a;\n\n  cin >> z;\n  int i, j, m, n, l, q[22];\n  for (i = 0, m = 0, n = 0; b[i] != '\u0000'; i++) {\n    if (b[i] != ' ') {\n      s[m][n] = b[i];\n      n++;\n\n    } else {\n\n      q[m] = n;\n      n = 0;\n      m++;\n    }\n  }\n  q[m] = n;\n  for (i = 0, j = 0; i <= m; i++) {\n    if (a[0] == s[i][0]) {\n      l = 1;\n      for (j = 0; j < q[i]; j++) {\n        if (a[j] != s[i][j]) {\n          l = 0;\n        }\n        if (q[i] != strlen(a)) {\n          l = 0;\n        }\n      }\n      if (l) {\n        for (j = 0; z[j] != '\u0000'; j++) {\n          s[i][j] = z[j];\n        }\n        q[i] = j;\n      }\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < q[i]; j++) {\n      printf(\"%c\", s[i][j]);\n    }\n    cout << \" \";\n  }\n\n  for (j = 0; j < q[m]; j++) {\n    printf(\"%c\u0000\", s[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35859", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[101], str1[101], str2[101];\n\n  cin >> str;\n\n  cin >> str1;\n\n  cin >> str2;\n  int i, len = strlen(str), n = 0;\n  char *p[101];\n  p[n] = str;\n  for (i = 0; i < len; i++) {\n    if (str[i] == ' ') {\n      str[i] = 0;\n      p[++n] = &str[i + 1];\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], str1) == 0) {\n      printf(\"%s\", str2);\n    } else\n      printf(\"%s\", p[i]);\n    if (i != n) {\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35860", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char wordbuff[50][20], ch, target[20], replace[20];\n  int i, j;\n  for (i = 0; i < 50; i++)\n    for (j = 0; j < 20; j++)\n      wordbuff[i][j] = '\\0';\n\n  i = 0;\n  j = 0;\n  while (1) {\n    ch = getchar();\n    if (ch != '\\n' && ch != ' ') {\n      wordbuff[i][j] = ch;\n      j++;\n    } else {\n      i++;\n      j = 0;\n    }\n    if (ch == '\\n')\n      break;\n  }\n  scanf(\"%s\\n%s\", target, replace);\n  int n;\n  for (n = 0; n < i; n++) {\n    if (!strcmp(wordbuff[n], target))\n      strcpy(wordbuff[n], replace);\n  }\n  for (n = 0; n < i; n++)\n    if (!n)\n      printf(\"%s\", wordbuff[n]);\n    else\n      printf(\" %s\", wordbuff[n]);\n  return 0;\n}\n"}
{"label": "19", "index": "35861", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0};\n  char temp[100][100] = {{0}};\n  int i, j, k, a1, b1;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", temp[i]);\n    if (getchar() == ' ') {\n      break;\n    }\n  }\n  cin >> a;\n  scanf(\"%s \", b);\n  a1 = strlen(a);\n  b1 = strlen(b);\n  for (j = 0; j < i; j++) {\n    if (strcmp(temp[j], a) == 0) {\n      for (k = 0; k < b1; k++) {\n        temp[j][k] = b[k];\n      }\n      temp[j][b1] = '\u0000';\n    }\n    printf(\"%s \", temp[j]);\n  }\n  if (strcmp(temp[i], a) == 0) {\n    for (k = 0; k < b1; k++) {\n      temp[i][k] = b[k];\n    }\n    temp[i][b1] = '\u0000';\n  }\n  printf(\"%s\", temp[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[110], a[110], b[110];\n  cin >> s;\n  scanf(\"%s%s\", a, b);\n  int n = strlen(s);\n  int na = strlen(a);\n  int i, j, ans[30], c = 0;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ' || i == 0) {\n      int count = 0, q;\n      if (i == 0)\n        q = 0;\n      else {\n        q = i + 1;\n      }\n      for (j = q; j <= q + na - 1; j++) {\n        if (s[j] != a[j - q])\n          break;\n        count++;\n      }\n      if (count == na) {\n        ans[c] = q;\n        c++;\n      }\n    }\n  }\n  if (c == 0)\n    printf(\"%s\", s);\n  else {\n    int p = 0;\n    for (i = 0; i <= c - 1; i++) {\n      for (j = p; j < ans[i]; j++) {\n        printf(\"%c\", s[j]);\n      }\n      printf(\"%s\", b);\n      p = ans[i] + na;\n    }\n    for (j = p; j < n; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], w1[100], w2[100];\n\n  cin >> s;\n\n  cin >> w1;\n\n  cin >> w2;\n  int i, l = strlen(s), l1 = strlen(w1), l2 = strlen(w2), p = 0, m, n, j, k;\n  for (i = 0; i < l; i++) {\n    if (s[i] == w1[0] && (s[i - 1] == 32 || i == 0) &&\n        (s[i + l1] == 32 || i == l - 1)) {\n      p = 1;\n      for (m = i, n = 0; n < l1; m++, n++)\n        if (s[m] != w1[n]) {\n          p = 0;\n          break;\n        }\n    }\n    if (p) {\n      for (k = 0; k < l2; k++)\n        printf(\"%c\", w2[k]);\n      i = i + l1 - 1;\n      p = 0;\n    } else {\n      cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35864", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100];\n  char a[100];\n  char b[100];\n  char s2[15][20];\n  int i, k, x = 0, m, n;\n  char c, d;\n\n  cin >> s1;\n\n  cin >> a;\n\n  cin >> b;\n  m = 0;\n  n = 0;\n  k = 0;\n  for (i = 0; (c = s1[i]) != '\u0000'; i++) {\n    if (c != ' ') {\n      s2[k][m] = c;\n      m++;\n    } else {\n      s2[k][m] = '\u0000';\n      m = 0;\n      k++;\n      n++;\n    }\n  }\n  s2[n][m] = '\u0000';\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s2[i], a) == 0) {\n      x = 1;\n      for (k = 0; (d = b[k]) != '\u0000'; k++) {\n        s2[i][k] = b[k];\n      }\n      s2[i][k] = '\u0000';\n    }\n  }\n  if (x == 1) {\n    for (i = 0; i < n; i++) {\n      printf(\"%s \", s2[i]);\n    }\n    printf(\"%s\", s2[n]);\n  } else {\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35865", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  int i, j = 0, k, m;\n  int n = 1;\n  char t[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ')\n      n++;\n  }\n\n  for (i = 0; s[i] != ' '; i++) {\n    t[i] = s[i];\n  }\n  t[i] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    cout << t;\n  }\n  k = i + 1;\n\n  for (i = 1; i < n - 1; i++) {\n    m = 0;\n    for (j = k; s[j] != ' '; j++) {\n      t[m] = s[j];\n      m++;\n    }\n    t[m] = '\u0000';\n    if (strcmp(t, a) == 0) {\n      printf(\" %s\", b);\n    } else {\n      printf(\" %s\", t);\n    }\n    k = j + 1;\n  }\n\n  m = 0;\n  for (j = k; s[j] != '\u0000'; j++) {\n    t[m] = s[j];\n    m++;\n  }\n  t[m] = '\u0000';\n  if (strcmp(t, a) == 0) {\n    printf(\" %s\", b);\n  } else {\n    printf(\" %s\", t);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35866", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *str[1024];\n  int n = 0, i;\n  str[0] = (char *)calloc(101, sizeof(char));\n  while (scanf(\"%s\", str[n]) != EOF) {\n    n = n + 1;\n    str[n] = (char *)calloc(101, sizeof(char));\n  }\n  for (i = 0; i < n - 3; i++) {\n    if (strcmp(str[i], str[n - 2]) == 0)\n      printf(\"%s \", str[n - 1]);\n    else\n      printf(\"%s \", str[i]);\n  }\n  if (strcmp(str[i], str[n - 2]) == 0)\n    printf(\"%s\", str[n - 1]);\n  else\n    printf(\"%s\", str[i]);\n}\n"}
{"label": "19", "index": "35867", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, tag = 1, flag = 1, e = 0;\n  char q[101], tmp[50][101], p[101], t[101];\n\n  scanf(\"%s \", q);\n\n  cin >> p;\n\n  cin >> t;\n  for (i = 0; i < 50; i++) {\n    k = 0;\n    flag = 1;\n    for (j = e; j < 101; j++) {\n      if (q[j] != ' ' && q[j] != ',' && q[j] != '\u0000') {\n        tmp[i][k] = q[j];\n        k++;\n      } else if (q[j] == ' ') {\n        tmp[i][k] = '\u0000';\n        e = j + 1;\n        break;\n      } else if (q[j] == ',') {\n        tmp[i][k] = '\u0000';\n        e = j + 2;\n        break;\n      } else if (q[j] == '\u0000') {\n        tmp[i][k] = '\u0000';\n        tag = 0;\n        break;\n      }\n    }\n    for (j = 0; j < 101; j++) {\n      if (tmp[i][j] != p[j] && p[j] != '\u0000') {\n        flag = 0;\n        break;\n      } else if (tmp[i][j] == p[j] && p[j] != '\u0000')\n        continue;\n      else if (p[j] == '\u0000')\n        break;\n    }\n    if (tag == 1 && flag == 0 && i > 0)\n      printf(\" %s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i > 0)\n      cout << \" \" << t;\n    else if (tag == 0 && flag == 0 && i > 0) {\n      printf(\" %s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i > 0) {\n      cout << \" \" << t;\n      break;\n    } else if (tag == 1 && flag == 0 && i == 0)\n      printf(\"%s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i == 0)\n      printf(\"%s\", t);\n    else if (tag == 0 && flag == 0 && i == 0) {\n      printf(\"%s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i == 0) {\n      printf(\"%s\", t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "35868", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], s[100], ss[100][100] = {'\u0000'}, d[100] = {'\u0000'};\n  int i, j, m, n, t, k, l, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  t = strlen(s);\n  n = 0;\n  m = 0;\n  for (i = 0; i < t; i++) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      ss[m][n] = s[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (j = 0; j <= m; j++) {\n    if (strcmp(ss[j], a) == 0) {\n      strcpy(ss[j], b);\n    }\n  }\n  k = 0;\n  l = 0;\n  for (p = 0;; p++) {\n    if (ss[k][l] == '\u0000' && k != m) {\n\n      d[p] = ' ';\n      k++;\n      l = 0;\n\n    } else if (ss[k][l] != '\u0000') {\n      d[p] = ss[k][l];\n      l++;\n    } else {\n      break;\n    }\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35869", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char sen[100], targ[100], subs[100];\n\n  cin >> sen;\n  cin >> targ;\n  scanf(\"%s \", subs);\n  char *p, *q, *c, *t;\n  int flag = 0;\n  p = sen;\n  c = targ;\n  char output[100] = {0};\n  while (p < sen + strlen(sen)) {\n    c = targ;\n    while (*p++ != targ[0])\n      ;\n    q = p - 1;\n    if (q != sen && *(q - 1) != ' ')\n      continue;\n    p--;\n    while (*c && *p++ == *c++)\n      ;\n    if ((*p == ' ' || *p == 0) && *c == 0)\n      flag = 1;\n    if (flag) {\n      t = p;\n      output[0] = 0;\n      strncpy(output, sen, q - sen);\n      output[q - sen] = 0;\n      strcat(output, subs);\n      strcat(output, t);\n      strcpy(sen, output);\n      p = sen;\n    }\n  }\n  if (!flag) {\n    puts(sen);\n    exit(0);\n  }\n\n  puts(output);\n}\n"}
{"label": "19", "index": "35870", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][50];\n  char *p1 = s, *p3 = b;\n  int i = 0, j = 0, n;\n\n  cin >> s;\n  scanf(\"%s \", a);\n  cin >> b;\n  for (; *p1 != '\u0000'; p1++) {\n    if (*p1 != ' ') {\n      c[i][j] = *p1;\n      j++;\n    } else {\n      c[i][j] = '\u0000';\n      i++;\n      j = 0;\n    }\n  }\n  c[i][j] = '\u0000';\n  n = i;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0) {\n      for (j = 0; *p3 != '\u0000'; p3++, j++)\n        c[i][j] = *p3;\n      c[i][j] = '\u0000';\n    }\n    p3 = b;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  printf(\"%s\", c[i]);\n}\n"}
{"label": "19", "index": "35871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[100], str1[100], str2[100], str3[200];\n  int n1, n2, i = 0, s, j, a = 0, b;\n\n  cin >> string;\n  cin >> str1;\n  cin >> str2;\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  while (i < 100) {\n    b = 0;\n    for (j = 0; j < n1; j++) {\n      if ((string[i + j] == str1[j]))\n        b += 1;\n      else\n        b = 0;\n    }\n\n    if (i == 0) {\n      if (b == n1 && string[i + n1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n\n    else {\n      if (b == n1 && string[i + n1] == ' ' && string[i - 1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n  }\n  cout << str3;\n  return 0;\n}\n"}
{"label": "19", "index": "35872", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[101], a[101], b[101], word[100][101];\n  int n, k, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  \n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(word[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(word[n], (s + k));\n  n++;\n\n  for (i = 0; i < n; i++) { \n    if (strcmp(a, word[i]) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) { \n    printf(\"%s \", word[i]);\n  }\n\n  printf(\"%s\", word[n - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35873", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char s[210] = {'\u0000'}, a[100], b[100];\n  int i, j, x = 0, k = 0, q, l = 0, d, p, m, dd, sl;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  sl = strlen(s);\n  l = strlen(a);\n  d = strlen(a) - strlen(b);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    x = 0;\n    for (k = 0; a[k] != '\u0000'; k++) {\n      if (s[i + x] == a[k]) {\n        x++;\n      } else\n        break;\n    }\n    if (l == x && (s[i - 1] == ' ' || i == 0) &&\n        (s[i + x] == ' ' || s[i + x] == '\u0000')) {\n\n      if (d >= 0) {\n        for (q = i + x; s[q] != '\u0000'; q++) {\n          s[q - d] = s[q];\n        }\n        for (m = 0; m < d; m++) {\n          s[q - d + m] = '\u0000';\n        }\n      } else {\n        if (d < 0) {\n          dd = -d;\n          for (q = sl - 1; q >= i + x; q--) {\n            s[q + dd] = s[q];\n          }\n          sl = sl + dd;\n        }\n      }\n      p = i;\n      for (j = 0; b[j] != '\u0000'; j++) {\n        s[p] = b[j];\n        p++;\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35874", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char ch[100], a[100], b[100], c[100][100];\n  int i, n[100], k, m, j = 0;\n  n[0] = -1;\n\n  cin >> ch;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; ch[i] != '\u0000'; i++) {\n    if (ch[i] == ' ') {\n      j++;\n      n[j] = i;\n      for (k = 0, m = n[j - 1] + 1; k < i - n[j - 1] - 1 && m < i; k++, m++)\n        c[j][k] = ch[m];\n    }\n    continue;\n  }\n  for (i = n[j] + 1; ch[i] != '\u0000'; i++)\n    c[j + 1][i - 1 - n[j]] = ch[i];\n  for (m = 1; m <= j + 1; m++)\n    if (strcmp(c[m], a) == 0)\n      strcpy(c[m], b);\n  for (m = 1; m <= j; m++)\n    printf(\"%s \", c[m]);\n  cout << c[j + 1];\n\n  return 0;\n}\n"}
{"label": "19", "index": "35875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[1000], a[100], b[100], p[100][100];\n\n  cin >> s;\n  cin >> a >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      j++;\n      k = 0;\n    } else {\n      p[j][k] = s[i];\n      k++;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(p[i], a) == 0) {\n      strcpy(p[i], b);\n    }\n  }\n  printf(\"%s\", p[0]);\n  for (i = 1; i <= j; i++) {\n    cout << \" \" << p[i];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20][20] = {'\\0'}, str2[20], str3[20];\n  int num = 0, j = 0, i;\n  cin.getline(str, 100);\n  cin.getline(str2, 20);\n  cin.getline(str3, 20);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str1[num][j++] = str[i];\n    }\n    if (str[i] == ' ') {\n      num++;\n      j = 0;\n    }\n  }\n  num = num + 1;\n  for (i = 0; i < num; i++) {\n    if (strcmp(str1[i], str2) == 0) {\n      strcpy(str1[i], str3);\n    }\n  }\n  for (i = 0; i < num - 1; i++) {\n    cout << str1[i] << \" \";\n  }\n  cout << str1[i] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35877", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, t;\n  int i, j, k = -1;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ') {\n      n++;\n    }\n  }\n  for (i = 0, t = 1; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n      if (a[j] != d[k]) {\n        t = 0;\n      }\n    }\n    if (t == 1 && strlen(a) == strlen(words[i])) {\n      for (j = 0; b[j] != '\u0000'; j++) {\n        words[i][j] = b[j];\n      }\n    }\n    words[i][j] = '\u0000';\n    t = 1;\n  }\n  cout << words[0];\n  for (i = 1; i < n; i++)\n    cout << \" \" << words[i];\n  return 0;\n}\n"}
{"label": "19", "index": "35878", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *s[100], *a, *b;\n  int i;\n  for (i = 0;; i++) {\n    s[i] = (char *)calloc(1, 100 * sizeof(char));\n    scanf(\"%s\", s[i]);\n    if (getchar() == '\\n')\n      break;\n  }\n  int n = i;\n  a = (char *)calloc(1, 100 * sizeof(char));\n  b = (char *)calloc(1, 100 * sizeof(char));\n  cin >> a;\n  scanf(\"%s\", b);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(s[i], a) == 0)\n      strcpy(s[i], b);\n  }\n  for (i = 0; i <= n; i++) {\n    if (i == 0)\n      printf(\"%s\", s[i]);\n    else\n      printf(\" %s\", s[i]);\n  }\n}\n"}
{"label": "19", "index": "35879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100] = {'\\0'};\n  int i, j = 0, k;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", a[i]);\n    if (a[i][0] < 2)\n      break;\n  }\n  for (i = 0; i < 100; i++)\n    if (strcmp(a[i], a[j - 1]) == 0)\n      strcpy(a[i], a[j]);\n  for (i = 0; i < j - 2; i++)\n    printf(\"%s \", a[i]);\n  printf(\"%s\", a[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "35880", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char *p[100], *a, *b;\n  int i, j;\n  for (i = 0;; i++) {\n    p[i] = (char *)malloc(100);\n    scanf(\"%s\", p[i]);\n    if (getchar() == ' ')\n      break;\n  }\n  a = (char *)malloc(100);\n  cin >> a;\n  b = (char *)malloc(100);\n  scanf(\"%s\", b);\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], a) == 0) {\n      p[j] = b;\n    }\n  for (j = 0; j < i; j++)\n    printf(\"%s \", p[j]);\n  printf(\"%s\", p[i]);\n}\n"}
{"label": "19", "index": "35881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  cin >> &sen[1];\n  cin >> &a[1] >> &b[1];\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = ' ';\n  a[lena - 1] = ' ';\n  b[lenb - 1] = ' ';\n\n  sen[lensen] = '\u0000';\n  a[lena] = '\u0000';\n  b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else\n      end[j] = sen[i];\n  }\n\n  end[j - 1] = 0;\n  cout << &end[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, al, bl, cl;\n  char c[1000] = {\"\"}, a[100] = {\"\"}, b[100] = {\"\"};\n  char *p, *q;\n  scanf(\"%s \", c);\n  cin >> a;\n  cin >> b;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  for (p = c; p < c + cl;) {\n    q = p;\n    for (; *q != ' ' && *q != '\u0000'; q++)\n      ;\n    if ((q - p) != al) {\n      for (; p < q; p++)\n        printf(\"%c\", *p);\n      if (q != c + cl)\n        cout << \" \", p++;\n    } else {\n      for (j = 0, q = p; j < al; q++, j++)\n        if (*q != a[j])\n          break;\n      if (j == al) {\n        if (q != c + cl)\n          printf(\"%s \", b);\n        else\n          printf(\"%s\", b);\n        p = p + al + 1;\n      } else\n        for (; p <= q; p++)\n          printf(\"%c\", *p);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35883", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200];\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int i, j, l, t, k = 0;\n  l = (int)strlen(a);\n  t = (int)strlen(b);\n  for (i = 0; i < l; i++) {\n    for (j = 0; j < t; j++) {\n      if (i + j - 1 > l)\n        break;\n      if (a[i + j] == b[j])\n        k = k + 1;\n      if ((a[i - 1] == ' ' || i == 0) && k == t &&\n          (a[i + t] == ' ' || i == l - t)) {\n        printf(\"%s\", c);\n        i = i + t;\n      }\n    }\n    if (i > l - 1) {\n      break;\n    }\n    if ((k != t || (t == k && (a[i - 1] != ' ' || i != 0) || a[i + t] != ' ' ||\n                    i != l - t)))\n      cout << a[i];\n    k = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35884", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid huan(int start, char W[100], char B[100], int Len1, int Len2, int Len3,\n          int t) {\n  int i, k;\n  char WW[100];\n  for (i = 0; i < start; i++)\n    WW[i] = W[i];\n  for (i = start, k = 0; i < start + Len3; i++, k++)\n    WW[i] = B[k];\n  for (i = start + Len3; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    WW[i] = W[i + Len2 - Len3];\n  for (i = 0; i <= Len1 - Len2 * t + Len3 * t - 1; i++)\n    W[i] = WW[i];\n}\n\nint main() {\n  char whole[100];\n  char a[100];\n  char b[100];\n  char gai[100];\n\n  scanf(\"%s \", whole);\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, k, t;\n  int len1;\n  int len2;\n  int len3;\n  len1 = strlen(whole);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  int judge;\n  int begin[100];\n  t = 0;\n  if (whole[0] != a[0]) {\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  } else {\n    t = 1;\n    begin[0] = 0;\n    for (i = 0; i < len1 - len2 + 1; i++) {\n      for (j = i, k = 0; j < len2 + i; j++, k++) {\n        if (whole[j] != a[k]) {\n          judge = 0;\n          break;\n        } else\n          judge = 1;\n      }\n      if (whole[i - 1] == ' ' && judge == 1) {\n        begin[t] = i;\n        t++;\n      }\n    }\n  }\n\n  if (len1 >= len2) {\n    int u;\n    for (i = t - 1, u = 1; i >= 0; i--, u++) {\n      huan(begin[i], whole, b, len1, len2, len3, u);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (u - 1) + len3 * (u - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  } else {\n    int v;\n    for (i = 0, v = 1; i <= t - 1; i++, v++) {\n      huan(begin[i], whole, b, len1, len2, len3, v);\n    }\n    for (i = 0; i <= len1 - 1 - len2 * (v - 1) + len3 * (v - 1); i++) {\n      printf(\"%c\", whole[i]);\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35885", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000] = {0};\n  char a[100] = {0}, b[100] = {0};\n\n  cin >> s;\n  int c[1000] = {0};\n  cin >> a >> b;\n  int i, j, k = 0, h, d = 0;\n  int l = strlen(s);\n  int p = strlen(a);\n  for (i = 0; i < l; i++) {\n    if ((a[0] == s[i] && s[i - 1] == ' ') || (a[0] == s[i] && i == 0)) {\n      c[d] = i;\n      for (j = 1; j < p; j++) {\n        if (a[j] == s[i + j]) {\n          k = 1;\n        } else {\n          k = 0;\n        }\n      }\n      if (k != 0) {\n        d++;\n      }\n    }\n  }\n  if (k == 0) {\n    printf(\"%s\", s);\n  } else {\n    for (i = 0; i < c[0]; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (h = 0; h < d; h++) {\n      printf(\"%s\", b);\n      for (j = p + c[h]; j < c[h + 1]; j++) {\n        printf(\"%c\", s[j]);\n      }\n    }\n    for (j = c[d - 1] + p; j < l; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35886", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  cin >> b >> c;\n\n  for (i = 0;; i++) {\n    while (1) {\n\n      if (a[i + j] == b[j] && a[i + j] != '\u0000')\n\n      {\n        j++;\n        continue;\n      } else if (b[j] == '\u0000' && (a[i + j] == ' ' || a[i + j] == '\u0000') &&\n                 (a[i - 1] == ' ' || i == 0)) {\n        j = 0;\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        break;\n      } else {\n        j = 0;\n        if (a[i] == '\u0000')\n          break;\n        else\n          cout << a[i];\n        break;\n      }\n    }\n\n    if (a[i] == '\u0000')\n      break;\n  }\n  if (b[j] == '\u0000')\n    printf(\"%s\", c);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35887", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i = 0, j = 0, count = 0;\n  cin.get(s, 100);\n  scanf(\"%s \", a);\n  cin >> b;\n  for (i = 0; i <= strlen(s) - strlen(a); i++) {\n    count = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i])\n        count++;\n    }\n    if (count == strlen(a) &&\n        ((s[i + strlen(a)] == ' ' || i + strlen(a) == strlen(s)) &&\n         (s[i - 1] == ' ' || i == 0))) {\n      for (j = i; j < i + strlen(a); j++)\n        s[j] = '/';\n    }\n  }\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] != '/')\n      cout << s[i];\n    else {\n      for (j = 0; j < strlen(b); j++)\n        cout << b[j];\n      do\n        i++;\n      while (s[i] == '/' && (i + 1 == strlen(s) || s[i + 1] == '/'));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35888", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[50][20], p[20], r[20];\n  int i = 0, n = 0;\n  scanf(\"%s \", a);\n  while (cin.get() != '\\n') {\n    i++;\n    cin >> a[i];\n    n = i;\n  }\n  cin >> p;\n  cin.get();\n  scanf(\"%s \", r);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(a[i], p) == 0)\n      strcpy(a[i], r);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", a[i]);\n  cout << a[n] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][100];\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", str[i]);\n    if (str[i][0] < 2)\n      break;\n  }\n\n  for (i = 0; i < 100; i++) {\n    if (strcmp(str[i], str[j - 1]) == 0) {\n      strcpy(str[i], str[j]);\n    }\n  }\n  for (i = 0; i < j - 2; i++) {\n    printf(\"%s \", str[i]);\n  }\n  printf(\"%s\", str[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "35890", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s1[100], s2[100], s3[100], s[100];\n  int a, b, c, i, n, j, k, q = 1;\n\n  scanf(\"%s \", s1);\n\n  cin >> s2;\n\n  cin >> s3;\n  a = strlen(s1);\n  b = strlen(s2);\n  c = strlen(s3);\n  strcpy(s, s1);\n  for (i = 0; i < a; i++) {\n\n    for (j = 0; j < b; j++) {\n      if (s[i + j] != s2[j])\n        break;\n    }\n    if ((j == b) && ((s[i - 1] == ' ') || (i == 0))) {\n\n      for (k = i; k < i + c; k++)\n        s[k] = s3[k - i];\n      for (k = i + c; k + (b - c) * q < a; k++)\n        s[k] = s1[k + (b - c) * q];\n      s[a + (c - b) * q] = 0;\n\n      q++;\n    }\n  }\n  puts(s);\n}\n"}
{"label": "19", "index": "35891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[200], b[200], m[100][100];\n  int len, n, i, j, hang = 0, lie = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      m[hang][lie] = '\u0000';\n      hang++;\n      lie = 0;\n    } else {\n      m[hang][lie] = s[i];\n      lie++;\n    }\n    if (s[i + 1] == '\u0000') {\n      m[hang][lie] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= hang; i++) {\n    if (strcmp(a, m[i]) == 0) {\n      strcpy(m[i], b);\n    }\n  }\n  for (i = 0; i < hang; i++)\n    printf(\"%s \", m[i]);\n  printf(\"%s\", m[hang]);\n  return 0;\n}\n"}
{"label": "19", "index": "35892", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char *s, *p1, *p2, *temp, *a, *b;\n  int i, len;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 101);\n  b = (char *)malloc(sizeof(char) * 101);\n  cin >> s;\n  len = strlen(s);\n  p1 = p2 = s;\n  *(s + len) = ' ';\n  *(s + len + 1) = '\u0000';\n  scanf(\"%s \", a);\n  cin >> b;\n  for (; *p1; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      len = p1 - p2;\n      temp = (char *)malloc(sizeof(char) * 101);\n      for (i = 0; i < len; i++)\n        *(temp + i) = *(p2 + i);\n      *(temp + len) = '\u0000';\n      p2 = p1 + 1;\n      if (strcmp(temp, a) == 0)\n        *p2 == '\u0000' ? printf(\"%s\", b) : printf(\"%s \", b);\n      else\n        *p2 == '\u0000' ? printf(\"%s\", temp) : printf(\"%s \", temp);\n      free(temp);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35893", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[10000];\n  char tmp[105], a[105], b[105];\n  int i, j;\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0, j = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, tmp) == 0) {\n        printf(\"%s \", b);\n      } else {\n        printf(\"%s \", tmp);\n      }\n    } else {\n      tmp[j] = s[i];\n      j++;\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(a, tmp) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", tmp);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35894", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], sub[101], c[101];\n  cin.getline(a, 101);\n  cin >> sub;\n  cin >> c;\n  int la, ls, i, j, flag;\n  la = strlen(a);\n  ls = strlen(sub);\n  for (i = 0; i <= la - ls; i++) {\n    if (i != 0 && a[i - 1] != ' ') {\n      cout << a[i];\n      continue;\n    }\n    flag = 1;\n    for (j = 0; j < ls; j++) {\n      if (a[j + i] != sub[j]) {\n        flag = 0;\n        cout << a[i];\n        break;\n      }\n    }\n    if (flag) {\n      cout << c;\n      i = i + ls - 1;\n    }\n  }\n  for (j = 0; j < ls; j++) {\n    flag = 1;\n    if (a[j + la - ls] != sub[j]) {\n      flag = 0;\n      break;\n    }\n  }\n  if (flag == 0 || a[la - ls - 1] != ' ') {\n    for (i = la - ls + 1; i < la; i++)\n      cout << a[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35895", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100], str1[100], str2[100], str3[200];\n  int n1, n2, i = 0, s, j, a = 0, b;\n\n  cin >> string;\n  cin >> str1;\n  cin >> str2;\n  n1 = strlen(str1);\n  n2 = strlen(str2);\n  while (i < 100) {\n    b = 0;\n    for (j = 0; j < n1; j++) {\n      if ((string[i + j] == str1[j])) {\n        b += 1;\n      } else\n        b = 0;\n    }\n\n    if (i == 0) {\n      if (b == n1 && string[i + n1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n\n    else {\n      if (b == n1 && string[i + n1] == ' ' && string[i - 1] == ' ') {\n        for (s = 0; s < n2; s++) {\n          str3[a] = str2[s];\n          a++;\n        }\n        i += n1;\n      } else {\n        str3[a] = string[i];\n        a += 1;\n        i += 1;\n      }\n    }\n  }\n  printf(\"%s\", str3);\n  return 0;\n}\n"}
{"label": "19", "index": "35896", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  char sub[101][101];\n  int len = strlen(s);\n  int m = 0, n = 0;\n  for (int i = 0; i < len; i++) {\n    if (s[i] != ' ') {\n      sub[m][n] = s[i];\n      n++;\n    }\n    if (s[i] == ' ') {\n      m++;\n      n = 0;\n    }\n  }\n  for (int j = 0; j <= m; j++) {\n    if (strcmp(sub[j], a) == 0) {\n      if (j == 0) {\n        printf(\"%s\", b);\n      }\n      if (j != 0)\n        printf(\" %s\", b);\n\n    } else {\n      if (j == 0) {\n        printf(\"%s\", sub[j]);\n      }\n      if (j != 0) {\n        printf(\" %s\", sub[j]);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35897", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], c[203];\n  s[0] = a[0] = b[0] = ' ';\n\n  scanf(\"%s \", s);\n  cin >> &a[1] >> &b[1];\n  int slen = strlen(s) + 1, alen = strlen(a) + 1, blen = strlen(b) + 1;\n  s[slen - 1] = a[alen - 1] = b[blen - 1] = ' ';\n  s[slen] = a[alen] = b[blen] = '\u0000';\n  int i, j;\n  for (i = 0, j = 0; i < slen; ++i, ++j) {\n    if (strncmp(s + i, a, alen) == 0) {\n      strcpy(c + j, b);\n      i = i + alen - 1;\n      j = j + blen - 1;\n    } else\n      c[j] = s[i];\n  }\n  c[j - 1] = 0;\n  cout << &c[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35898", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100];\n\n  cin >> s;\n  int p = strlen(s);\n  char a[10], b[10];\n\n  cin >> a;\n  cin >> b;\n  int q = strlen(a), l = strlen(b);\n  int i, j, k = 0, t;\n  if (a[0] == s[0]) {\n    for (i = 1; i < q; i++) {\n      if (a[i] != s[i]) {\n        k = 1;\n        break;\n      }\n    }\n    if (k == 0) {\n      if (q > l) {\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n        for (i = l; i < p - l; i++)\n          s[i] = s[i + q - 1];\n      }\n      if (q < l) {\n        for (i = p + l - q; i > 0; i--)\n          s[i + l - q] = s[i];\n        for (i = 0; i < l; i++)\n          s[i] = b[i];\n      }\n    }\n  }\n  for (i = 0; i < p - 1; i++) {\n    if (s[i] == ' ') {\n      if (s[i + 1] == a[0]) {\n        for (j = i + 1, t = 0; j < i + 1 + q; j++, t++) {\n          if (a[t] != s[j]) {\n            k = 1;\n            break;\n          }\n        }\n        if (k == 0) {\n          if (q > l) {\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n            for (j = i + 1 + l; j < p - l; j++)\n              s[j] = s[j + q - 1];\n          }\n          if (q < l) {\n            for (j = p + l - q; j > i + 1; j--)\n              s[j + l - q] = s[j];\n            for (j = i + 1, t = 0; j < i + 1 + l; j++, t++)\n              s[j] = b[t];\n          }\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35899", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[110];\n  char a[110];\n  char b[110];\n  char out[2000];\n  char tmp[110];\n  int index = 0;\n  int out_i = 0;\n  int len;\n  int len_a;\n  int len_b;\n\n  memset(out, 0, sizeof(out));\n  memset(a, 0, sizeof(a));\n  memset(b, 0, sizeof(b));\n\n  cin >> str;\n  len = strlen(str);\n\n  cin >> a >> b;\n  len_a = strlen(a);\n  len_b = strlen(b);\n\n  for (int i = 0; i < len; i++) {\n    if (str[i] != ' ') {\n      tmp[index++] = str[i];\n    } else if (str[i] == ' ') {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n      out[out_i++] = ' ';\n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n\n    if (i == len - 1) {\n      tmp[index++] = '\u0000';\n      if (!strcmp(tmp, a)) {\n        for (int j = 0; j < len_b; j++) {\n          out[out_i++] = b[j];\n        }\n\n      } else {\n        for (int j = 0; j < strlen(tmp); j++) {\n          out[out_i++] = tmp[j];\n        }\n      }\n      \n      memset(tmp, 0, sizeof(tmp));\n      index = 0;\n    }\n  }\n\n  cout << out << endl;\n}\n"}
{"label": "19", "index": "35900", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[100], word[50][20] = {0}, pre[20], post[20];\n  int i, l, f[50] = {0}, g[50] = {0};\n  int word_num = 0, char_num = 0;\n\n  cin >> sen;\n\n  scanf(\"%s \", pre);\n\n  cin >> post;\n  l = strlen(sen);\n  for (i = 0; i < l; i++) {\n    if (sen[i] != ' ') {\n      word[word_num][char_num] = sen[i];\n      char_num++;\n    } else {\n      if (sen[i] == ' ') {\n        word_num++;\n        char_num = 0;\n      }\n    }\n  }\n  for (i = 0; i <= word_num; i++)\n    f[i] = strlen(word[i]);\n\n  for (i = 0; i <= word_num; i++) {\n    if (strcmp(word[i], pre) == 0)\n      strcpy(word[i], post);\n  }\n  for (i = 0; i < word_num; i++) {\n    printf(\"%s\", word[i]);\n    printf(\" \");\n  }\n  printf(\"%s\", word[word_num]);\n  return 0;\n}\n"}
{"label": "19", "index": "35901", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], words[100][100];\n  int i, k = 0, n = 0;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(words[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(words[n], (s + k));\n  n++;\n  for (i = 0; i < n - 1; i++) {\n    if (strcmp(words[i], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", words[i]);\n    }\n  }\n  if (strcmp(words[n - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    cout << words[n - 1];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], t[101], w[101];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int i, j, r, k, n;\n  for (n = 1; n < 5; n++) {\n    r = 0;\n    for (i = 0; i < 101; i++) {\n      if (s[i] != 0) {\n        if (s[i] != ' ')\n          t[i - r] = s[i];\n        else {\n          t[i - r] = 0;\n          r = r + strlen(t) + 1;\n          if (strcmp(t, a) == 0) {\n            k = strlen(t);\n            for (j = i; j < 101; j++)\n              w[j - i] = s[j];\n            s[i - k] = 0;\n            strcat(s, b);\n            strcat(s, w);\n          }\n        }\n      } else {\n        t[i - r] = 0;\n        if (strcmp(t, a) == 0) {\n          k = strlen(t);\n          s[i - k] = 0;\n          strcat(s, b);\n          break;\n        }\n      }\n    }\n  }\n  printf(\"%s \", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35903", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n  int i, j, k, strat;\n  strat = 0;\n  for (i = strat; a[i] != '\u0000'; i++) {\n    if (a[i] == b[0])\n      for (j = 1, k = i + 1; j < strlen(b); j++, k++)\n        if (b[j] != a[k])\n          break;\n    if (j == strlen(b) && i == 0) {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n\n    else if (j == strlen(b) && a[i - 1] == ' ') {\n      for (k = strat; k < i; k++)\n        printf(\"%c\", a[k]);\n      printf(\"%s\", c);\n      strat = i + strlen(b);\n      i = strat - 1;\n    }\n    j = 0;\n  }\n  for (i = strat; a[i] != '\u0000'; i++)\n    printf(\"%c\", a[i]);\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar sen[200];\nchar m[200];\nchar c[200];\nchar check[200];\nint main() {\n\n  cin >> sen;\n\n  cin >> m;\n\n  cin >> c;\n  int mark = 0;\n  for (int i = 0; i < strlen(sen); i++)\n    if (sen[i] != ' ') {\n      check[mark] = sen[i];\n      mark++;\n    } else {\n      if (!strcmp(check, m))\n        printf(\"%s \", c);\n      else\n        printf(\"%s \", check);\n      memset(check, 0, sizeof(check));\n      mark = 0;\n    }\n  if (!strcmp(check, m))\n    printf(\"%s \", c);\n  else\n    printf(\"%s \", check);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35905", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100]; \n  int i, j, len1, len2, k[100] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s); \n  len2 = strlen(a); \n  for (i = 0; i < len1; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s[j] == a[j - i])\n        k[i] = k[i] + 1;\n      else\n        break;\n    }\n    if (k[i] == len2) \n    {\n      if (i == 0 && s[i + len2] == ' ') \n      {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i == len1 - len2 && s[i - 1] == ' ') \n      {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i > 0 && i < len1 - len2 && s[i - 1] == ' ' \n                 && s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else\n        cout << s[i]; \n    } else\n      cout << s[i]; \n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35906", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar yuan[100000], yao[110], wei[110];\nint yuanlen, yaolen, weilen;\n\nint main() {\n  char *s;\n  int i, j;\n\n  cin >> yuan;\n\n  cin >> yao;\n\n  cin >> wei;\n  s = strstr(yuan, yao);\n  if (s == NULL || (s[-1] != ' ' && s != yuan)) {\n    puts(yuan);\n    return 0;\n  }\n  yuanlen = strlen(yuan);\n  yaolen = strlen(yao);\n  weilen = strlen(wei);\n  while (s != NULL) {\n    if (yaolen == weilen) {\n      for (i = 0; i < yaolen; i++) {\n        s[i] = wei[i];\n      }\n    }\n    if (yaolen > weilen) {\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n      while (s[i + yaolen - weilen] != 0) {\n        s[i] = s[i + yaolen - weilen];\n        i++;\n      }\n      s[i] = 0;\n    }\n    if (yaolen < weilen) {\n      for (i = yuanlen - 1; i > yaolen - 1; i--)\n        s[i + weilen - yaolen] = s[i];\n      for (i = 0; i < weilen; i++)\n        s[i] = wei[i];\n    }\n    s += weilen;\n    s = strstr(s, yao);\n  }\n\n  puts(yuan);\n  return 0;\n}\n"}
{"label": "19", "index": "35907", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, s, k, l, m, n, v = 0;\n  char a[202], b[102], c[102];\n  cin.getline(a, 202);\n  cin.getline(b, 102);\n  cin.getline(c, 102);\n  l = strlen(c);\n  m = strlen(a);\n  n = strlen(b);\n  for (j = 0; j < m;) {\n    k = 0;\n    if ((j == 0) || ((j > 0) && (a[j - 1] == ' '))) {\n      for (i = j; i < j + n; i++)\n        if (a[i] == b[i - j])\n          k++;\n      if ((k == n) && (a[j + n] != ' ') && (a[j + n] != '\\0')) {\n        k = 0;\n      }\n    }\n\n    if (k == n) {\n      if (l > n)\n        for (s = 0; s < l - n; s++)\n          for (i = m + s; i >= j + n + s; i--)\n            a[i + 1] = a[i];\n      if (l < n) {\n        for (s = 0; s < n - l; s++)\n          for (i = j + n - s - 1; i < m - s; i++)\n            a[i] = a[i + 1];\n        for (i = m + l - n; i < m; i++)\n          a[i] = '\\0';\n      }\n      for (i = j; i < j + l; i++)\n        a[i] = c[i - j];\n      j += l;\n      m = m + l - n;\n    } else\n      j++;\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35908", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char zfc[10000], a[100], b[100];\n  int i, lone, ltwo, lthree, k, shuzu[10000] = {0}, p = 0, count[10000];\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  lone = strlen(zfc);\n  ltwo = strlen(a);\n  lthree = strlen(b);\n  for (i = 0; i < lone - ltwo + 1; i++) {\n    if (i == 0) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[ltwo] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else if (i > 0 && i < lone - ltwo) {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k + i] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[i + ltwo] == ' ' && zfc[i - 1] == ' ') {\n        shuzu[i] = 1;\n      }\n    } else {\n      for (k = 0; k < ltwo; k++) {\n        if (zfc[k + i] == a[k]) {\n          count[i] += 1;\n        }\n      }\n      if (count[i] == ltwo && zfc[i - 1] == ' ') {\n        shuzu[i] = 1;\n      }\n    }\n  }\n  while (p < lone) {\n    if (shuzu[p] == 0) {\n      cout << zfc[p];\n    } else {\n      printf(\"%s\", b);\n      p = p + ltwo - 1;\n    }\n    p++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[101], z[11], s[16][11];\n\n  scanf(\"%s \", b);\n\n  cin >> a;\n\n  cin >> z;\n  int i, j, m, n, l, q[22];\n  for (i = 0, m = 0, n = 0; b[i] != '\u0000'; i++) {\n    if (b[i] != ' ') {\n      s[m][n] = b[i];\n      n++;\n\n    } else {\n\n      q[m] = n;\n      n = 0;\n      m++;\n    }\n  }\n  q[m] = n;\n  for (i = 0, j = 0; i <= m; i++) {\n    if (a[0] == s[i][0]) {\n      l = 1;\n      for (j = 0; j < q[i]; j++) {\n        if (a[j] != s[i][j]) {\n          l = 0;\n        }\n        if (q[i] != strlen(a)) {\n          l = 0;\n        }\n      }\n      if (l) {\n        for (j = 0; z[j] != '\u0000'; j++) {\n          s[i][j] = z[j];\n        }\n        q[i] = j;\n      }\n    }\n  }\n\n  for (i = 0; i < m; i++) {\n    for (j = 0; j < q[i]; j++) {\n      cout << s[i][j];\n    }\n    cout << \" \";\n  }\n\n  for (j = 0; j < q[m]; j++) {\n    printf(\"%c\u0000\", s[i][j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35910", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[102], a[102], b[102];\n  char temp[102] = {0};\n  unsigned int i, j;\n  unsigned int sum = 0;\n  unsigned int sum1 = 0;\n  int flag = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  for (i = 0; i < strlen(s); i++) {\n\n    if (s[i] != ' ') {\n      sum1 = sum1 + 1;\n      if (i != strlen(s) - 1)\n        continue;\n      else {\n        i = i + 1;\n        flag = 1;\n      }\n    }\n    for (j = 0; j < strlen(a) && strlen(a) == sum1; j++) {\n      if (s[i - sum1 + j] == a[j])\n        sum = sum + 1;\n    }\n    if (sum == strlen(a)) {\n      for (j = 0; j < strlen(b); j++) {\n        printf(\"%c\", b[j]);\n      }\n    } else {\n      for (j = 0; j < sum1; j++) {\n        printf(\"%c\", s[i - sum1 + j]);\n      }\n    }\n    if (flag == 0)\n      printf(\"%c\", ' ');\n    sum1 = 0;\n    sum = 0;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35911", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[103], a[103], b[103], s2[210];\n  int alen, slen, blen, i, j;\n  s[0] = a[0] = b[0] = ' ';\n\n  cin >> &s[1];\n  cin >> &a[1] >> &b[1];\n  slen = strlen(s);\n  alen = strlen(a);\n  blen = strlen(b);\n  s[slen] = a[alen] = b[blen] = ' ';\n  s[slen + 1] = a[alen + 1] = b[blen + 1] = '\u0000';\n  for (i = 0, j = 0; i <= slen; i++, j++) {\n    if (strncmp(s + i, a, alen + 1) == 0) {\n      strcpy(s2 + j, b);\n      i = i + alen;\n      j = j + blen;\n    } else {\n      s2[j] = s[i];\n    }\n  }\n\n  s2[j - 1] = 0;\n  cout << &s2[1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35912", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0};\n  char b[101] = {0};\n  char c[101] = {0};\n  int k, f = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  scanf(\"%s \", c);\n  int len1 = strlen(a);\n  int len2 = strlen(b);\n  int len3 = strlen(c);\n  int i, j;\n  for (i = 0; i < len1; i++) {\n    k = 0;\n    for (j = i; j < i + len2; j++) {\n      if (a[j] == b[j - i]) {\n        k = k + 1;\n      } else {\n        break;\n      }\n    }\n    if (k == len2 && (a[i - 1] == ' ') || i - 1 < 0 && a[i + len2] == ' ') {\n      for (int k = 0; k < len3; k++) {\n        printf(\"%c\", c[k]);\n      }\n      i = i + len2 - 1;\n    } else\n      printf(\"%c\", a[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35913", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char src[1000];\n  char find[1000];\n  char replace[1000];\n\n  char temp[1000][1000];\n\n  scanf(\"%s \", src);\n\n  cin >> find;\n\n  scanf(\"%s \", replace);\n\n  int temp_count = 0;\n  int iter = 0;\n  for (int i = 0; i < strlen(src); i++) {\n    if (src[i] == ' ') {\n      for (int j = iter; j < i; j++) {\n        temp[temp_count][j - iter] = src[j];\n      }\n      temp[temp_count][i - iter] = 0;\n      temp_count++;\n      iter = i + 1;\n    }\n  }\n  for (int j = iter; j < strlen(src); j++) {\n    temp[temp_count][j - iter] = src[j];\n  }\n  temp[temp_count][strlen(src) - iter] = 0;\n  temp_count++;\n\n  for (int i = 0; i < temp_count - 1; i++) {\n    if (strcmp(temp[i], find) == 0) {\n      cout << replace << \" \";\n    } else {\n      cout << temp[i] << \" \";\n    }\n  }\n  if (strcmp(temp[temp_count - 1], find) == 0) {\n    cout << replace << endl;\n  } else {\n    cout << temp[temp_count - 1] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35914", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *w[100];\n  int i, j, k;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++) {\n    *s = '\u0000';\n    *a = '\u0000';\n    *b = '\u0000';\n  }\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  w[0] = (char *)malloc(100 * sizeof(char));\n  for (j = 0; j < 100; j++)\n    *(w[0] + j) = '\u0000';\n  i = 0;\n  j = 0;\n  for (p = s; *p != '\u0000'; p++) {\n    if (*p != ' ') {\n      *(w[i] + j) = *p;\n      j++;\n    } else {\n      i++;\n      w[i] = (char *)malloc(100 * sizeof(char));\n      for (j = 0; j < 100; j++)\n        *(w[i] + j) = '\u0000';\n      j = 0;\n    }\n  }\n  k = i;\n  for (i = 0; i < k; i++) {\n    if (strcmp(w[i], a) == 0)\n      strcpy(w[i], b);\n    for (j = 0; *(w[i] + j) != '\u0000'; j++)\n      printf(\"%c\", *(w[i] + j));\n    printf(\" \");\n  }\n  if (strcmp(w[k], a) == 0)\n    strcpy(w[k], b);\n  for (j = 0; *(w[k] + j) != '\u0000'; j++)\n    printf(\"%c\", *(w[k] + j));\n  printf(\" \");\n}\n"}
{"label": "19", "index": "35915", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char zfc[100], zsz[100][100];\n  char word_a[100], word_b[100];\n\n  cin >> zfc;\n  scanf(\"%s %s\", word_a, word_b);\n\n  int word_i = 0, word_j = 0;\n  int i, n;\n  n = strlen(zfc);\n  for (i = 0; i < n; i++) {\n    if (zfc[i] == ' ' || zfc[i] == ',') {\n\n      zsz[word_i][word_j] = '\u0000';\n      word_i++;\n      word_j = 0;\n\n    } else {\n      zsz[word_i][word_j] = zfc[i];\n      word_j++;\n\n      if (i == n - 1) {\n        zsz[word_i][word_j] = '\u0000';\n        word_i++;\n      }\n    }\n  }\n  int j, a[10], m = 0, k;\n  for (j = 0; j < i; j++) {\n    if (strcmp(zsz[j], word_a) == 0) {\n      a[m] = j;\n      m++;\n    }\n  }\n  for (k = 0; k < m; k++) {\n    strcpy(zsz[a[k]], word_b);\n  }\n  for (j = 0; j < word_i; j++) {\n    if (j != word_i - 1) {\n      printf(\"%s \", zsz[j]);\n    } else\n      cout << zsz[j];\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[1000] = {0};\n  char a[100] = {0}, b[100] = {0};\n\n  cin >> s;\n  int c[1000] = {0};\n  scanf(\"%s%s\", a, b);\n  int i, j, k = 0, h, d = 0;\n  int l = strlen(s);\n  int p = strlen(a);\n  for (i = 0; i < l; i++) {\n    if ((a[0] == s[i] && s[i - 1] == ' ') || (a[0] == s[i] && i == 0)) {\n      c[d] = i;\n      for (j = 1; j < p; j++) {\n        if (a[j] == s[i + j]) {\n          k = 1;\n        } else {\n          k = 0;\n        }\n      }\n      if (k != 0) {\n        d++;\n      }\n    }\n  }\n  if (k == 0) {\n    cout << s;\n  } else {\n    for (i = 0; i < c[0]; i++) {\n      printf(\"%c\", s[i]);\n    }\n    for (h = 0; h < d; h++) {\n      printf(\"%s\", b);\n      for (j = p + c[h]; j < c[h + 1]; j++) {\n        printf(\"%c\", s[j]);\n      }\n    }\n    for (j = c[d - 1] + p; j < l; j++) {\n      printf(\"%c\", s[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35917", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j;\n  char *p[100];\n  char *daitihuan;\n  char *tihuanwei;\n  p[0] = (char *)malloc(30);\n  while (scanf(\"%s\", p[i]) != EOF) {\n    p[i + 1] = (char *)malloc(30);\n    i++;\n  }\n  i--;\n  daitihuan = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = (char *)malloc(10000 * sizeof(char));\n  tihuanwei = p[i];\n  daitihuan = p[i - 1];\n  for (j = 0; j < i - 1; j++)\n    if (strcmp(p[j], daitihuan) == 0)\n      strcpy(p[j], tihuanwei);\n  for (j = 0; j < i - 1; j++)\n    cout << p[j] << (j == i - 2 ? \"\" : \" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35918", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, k, y; \n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s);) {\n    y = 0;\n    for (j = i; j < i + strlen(a); j++) {\n      if (s[j] == a[j - i]) \n      {\n        if (s[i - 1] == 32 || i == 0) {\n          y = y + 1;\n        }\n      } else\n        break;\n    }\n    if (y == strlen(a)) {\n      i = i + strlen(a);\n      for (k = 0; k < strlen(b); k++)\n        cout << b[k];\n    } else {\n      cout << s[i];\n      i++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35919", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[500], b[100], c[100], d[100][100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  int i, j, k = 0;\n  for (i = 0; i < strlen(a); i++, k++) {\n    for (j = i; a[j] != ' '; j++) {\n      d[k][j - i] = a[j];\n      d[k][j - i + 1] = '\u0000';\n      if (a[j] == '\u0000')\n        break;\n    }\n    i = j;\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      strcpy(d[i], c);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", d[i]);\n  }\n  cout << d[k - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35920", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], str2[100], original[100], word[100], replace[100];\n  int len;\n\n  cin >> str;\n  len = strlen(str);\n  str[len] = ' ';\n  str[len + 1] = '\u0000';\n\n  cin >> original;\n\n  cin >> replace;\n  int i = 0, p = 0, wordlen = 0, j = 0, temp = 0, k, n = 0;\n  int t = 0;\n  while (i < strlen(str)) {\n\n    if (str[i] != ' ') {\n      word[j] = str[i];\n      j++;\n      i++;\n      temp = 1;\n    } else if (temp == 1) {\n      word[j] = '\u0000';\n      \n      t = 0;\n      if (strcmp(word, original) == 0) {\n        for (k = 0; k < (i - j); k++) \n        {\n          str2[k] = str[k];\n        }\n        n = 0;\n        while (n < strlen(replace)) \n        {\n          str2[k] = replace[n];\n          n++;\n          k++;\n        }\n        n = i;\n        while (n < strlen(str)) \n        {\n          str2[k] = str[n];\n          n++;\n          k++;\n        }\n        n = 0;\n        while (n < k) \n        {\n          str[n] = str2[n];\n          n++;\n        }\n        str[n] = '\u0000';\n        i = 0; \n      } else {\n        i++; \n      }\n      j = 0;\n      temp = 0;\n    } else if (temp == 0) \n    {\n      i++;\n    }\n  }\n  i = 0;\n  while (i < strlen(str) - 1) {\n    printf(\"%c\", str[i]);\n    i++;\n  }\n}\n"}
{"label": "19", "index": "35921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[1024];\n  char src[1024];\n  char tar[1024];\n  char tmp[1024];\n\n  cin >> str;\n\n  cin >> src;\n\n  cin >> tar;\n\n  int cnt = 0;\n\n  if (str[0] == ' ')\n    putchar(str[0]);\n  else\n    tmp[cnt++] = str[0];\n\n  for (int i = 1; str[i]; i++) {\n\n    if (str[i - 1] == ' ' && str[i] != ' ') {\n      tmp[cnt++] = str[i];\n\n    } else if (str[i] == ' ') {\n      if (cnt > 0) {\n        tmp[cnt] = 0;\n        if (!strcmp(tmp, src))\n          cout << tar;\n        else\n          printf(\"%s\", tmp);\n        cnt = 0;\n      }\n\n      putchar(' ');\n    } else\n      tmp[cnt++] = str[i];\n  }\n  if (cnt > 0) {\n    tmp[cnt] = 0;\n    if (!strcmp(tmp, src))\n      cout << tar;\n    else\n      printf(\"%s\", tmp);\n  }\n  putchar(' ');\n}\n"}
{"label": "19", "index": "35922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, len1, len2, k[100] = {0};\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  for (i = 0; i < len1; i++) {\n    for (j = i; j < i + len2; j++) {\n      if (s[j] == a[j - i])\n        k[i] = k[i] + 1;\n      else\n        break;\n    }\n    if (k[i] == len2) {\n      if (i == 0 && s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i == len1 - len2 && s[i - 1] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else if (i > 0 && i < len1 - len2 && s[i - 1] == ' ' &&\n                 s[i + len2] == ' ') {\n        cout << b;\n        i = i + len2 - 1;\n      } else\n        cout << s[i];\n    } else\n      cout << s[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35923", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char s[10000];\n  char word[100][100];\n  char w1[100], w2[100];\n  cin >> s;\n  cin >> w1;\n  cin >> w2;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ')\n      word[j][k++] = s[i];\n    else {\n      j++;\n      k = 0;\n    }\n  }\n  for (i = 0; i <= j; i++)\n    if (strcmp(word[i], w1) == 0)\n      strcpy(word[i], w2);\n  for (i = 0; i < j; i++)\n    printf(\"%s \", word[i]);\n  printf(\"%s\", word[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "35924", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint bijiao(int p, char *a, int n, char *b) {\n  int i, flag = 0;\n  for (i = 0; i < n; i++) {\n    if (a[p + i] != b[i]) {\n      return 0;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 1;\n  }\n}\nint main() {\n  char str[1000];\n  char a[100];\n  char b[100];\n  int i;\n  int len1, len2, len;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(str);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (i == 0) {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    } else {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ' &&\n          str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else if (bijiao(i, str, len1, a) == 1 && i + len1 == len &&\n                 str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35925", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, j, r, h, l, m, n, p, q;\n  char s[101], a[101], b[101], c[101];\n  cin.getline(s, 101);\n  cin >> a >> b;\n  k = strlen(s);\n  i = strlen(a);\n  j = strlen(b);\n  for (r = 0; r <= k - i + 1; r++) {\n    for (h = r, l = 0; h < r + i; h++, l++)\n      if (s[h] != a[l])\n        break;\n    if (l == i && ((r == 0 && s[r + i] == ' ') ||\n                   (r > 0 && s[r - 1] == ' ' && s[r + i] == ' ') ||\n                   (r + i == k && s[r - 1] == ' '))) {\n      for (m = 0, n = r + i; m <= k - r - i; m++, n++)\n        c[m] = s[n];\n      for (p = 0, q = r; p <= j; p++, q++)\n        s[q] = b[p];\n      strcat(s, c);\n      k = k - i + j;\n      r = r + j;\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "35926", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[100], word[50][20] = {0}, pre[20], post[20];\n  int i, l, f[50] = {0}, g[50] = {0};\n  int word_num = 0, char_num = 0;\n\n  cin >> sen;\n\n  cin >> pre;\n\n  cin >> post;\n  l = strlen(sen);\n  for (i = 0; i < l; i++) {\n    if (sen[i] != ' ') {\n      word[word_num][char_num] = sen[i];\n      char_num++;\n    } else if (sen[i] == ' ') {\n      word_num++;\n      char_num = 0;\n    }\n  }\n  for (i = 0; i <= word_num; i++) {\n    f[i] = strlen(word[i]);\n  }\n  for (i = 0; i <= word_num; i++) {\n    if (strcmp(word[i], pre) == 0)\n      strcpy(word[i], post);\n  }\n  for (i = 0; i < word_num; i++) {\n    printf(\"%s\", word[i]);\n    printf(\" \");\n  }\n  printf(\"%s\", word[word_num]);\n  return 0;\n}\n"}
{"label": "19", "index": "35927", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char s1[100];\n  char s2[100];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  char *p2 = s;\n  while (*p2 != '\u0000') {\n    int i = 0;\n    char temp[100];\n    for (i = 0; i <= 99; i++) {\n      temp[i] = '\u0000';\n    }\n    i = 0;\n    do {\n      temp[i] = *p2;\n      p2++;\n      i++;\n    } while (*p2 != ' ' && *p2 != '\u0000');\n    if (strcmp(s1, temp) == 0)\n      printf(\"%s\", s2);\n    else\n      printf(\"%s\", temp);\n    if (*p2 == ' ') {\n      p2++;\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35928", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[101], a[101], b[101], temp[101];\nvoid judge(void) {\n  if (strcmp(temp, a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", temp);\n  }\n}\nvoid check(void) {\n  int i, n = strlen(s), p = 0, j;\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      temp[p] = s[i];\n      p++;\n    } else {\n      temp[p + 1] = '\u0000';\n      judge();\n      printf(\" \");\n      for (j = 0; j < p + 2; j++)\n        temp[j] = 0;\n      p = 0;\n    }\n  }\n  temp[p + 1] = '\u0000';\n  judge();\n}\nint main() {\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  check();\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35929", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char n[100][1000];\n  int i, j, m = 0, l, k = 0;\n  char w[1000], x[1000], y[1000];\n\n  scanf(\"%s \", w);\n  j = strlen(w);\n  for (i = 0; i < j; i++) {\n    if (w[i] != ' ') {\n      n[m][k] = w[i];\n      k++;\n    } else {\n      n[m][k] = '\u0000';\n      m++;\n      k = 0;\n    }\n  }\n  n[m][k] = '\u0000';\n  m++;\n  scanf(\"%s\", x);\n  scanf(\"%s\", y);\n  for (i = 0; i < m; i++)\n    if (strcmp(n[i], x) == 0)\n      strcpy(n[i], y);\n  for (i = 0; i < m; i++)\n    if (i == m - 1)\n      printf(\"%s\", n[i]);\n    else {\n      printf(\"%s \", n[i]);\n    }\n}\n"}
{"label": "19", "index": "35930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][100];\n  int i, j, l = 0;\n  while (cin >> s[l++])\n    ;\n  l--;\n  for (i = 0; i < l - 2; i++) {\n    if (strcmp(s[i], s[l - 2]) == 0) {\n      for (j = 0; j <= strlen(s[l - 1]); j++)\n        s[i][j] = s[l - 1][j];\n    }\n  }\n  for (i = 0; i < l - 3; i++)\n    cout << s[i] << \" \";\n  cout << s[l - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "35931", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[101] = {0}, b[101] = {0}, c[101] = {0};\n  int l1 = 0, l2 = 0, l3 = 0, i, j, l;\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  cin.getline(c, 101);\n  while (a[l1] != '\\0')\n    l1++;\n  while (b[l2] != '\\0')\n    l2++;\n  while (c[l3] != '\\0')\n    l3++;\n  l = l1 - l2;\n  for (i = 0; i <= l; i++)\n    if (a[i] == b[0] && a[i - 1] == ' ' && a[i + l2] == ' ' ||\n        i == 0 && a[i + l2] == ' ' || i == l && a[i - 1] == ' ') {\n      int flag = 1;\n      for (j = 0; j < l2; j++)\n        if (a[j + i] != b[j])\n          flag = 0;\n      if (flag) {\n        if (l2 == l3)\n          for (j = 0; j < l2; j++)\n            a[j + i] = c[j];\n        else if (l2 < l3) {\n          for (j = l + l2 - 1; j >= i + l2; j--)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        } else if (l2 > l3) {\n          for (j = i + l2; j < l + l2; j++)\n            a[j + l3 - l2] = a[j];\n          for (j = 0; j < l3; j++)\n            a[j + i] = c[j];\n        }\n        i += l3;\n        l += l3 - l2;\n      }\n    }\n  for (i = 0; i < l + l2; i++)\n    printf(\"%c\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar sen[200];\nchar m[200];\nchar c[200];\nchar check[200];\nint main() {\n\n  scanf(\"%s \", sen);\n\n  scanf(\"%s \", m);\n\n  cin >> c;\n  int mark = 0;\n  for (int i = 0; i < strlen(sen); i++)\n    if (sen[i] != ' ') {\n      check[mark] = sen[i];\n      mark++;\n    } else {\n      if (!strcmp(check, m))\n        printf(\"%s \", c);\n      else\n        printf(\"%s \", check);\n      memset(check, 0, sizeof(check));\n      mark = 0;\n    }\n  if (!strcmp(check, m))\n    printf(\"%s \", c);\n  else\n    cout << check << \" \";\n\n  return 0;\n}\n"}
{"label": "19", "index": "35933", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char juzi[9999], danci1[101], danci2[101];\n  int i, j = 0, k, l, length1, length2, count = 0;\n\n  cin >> juzi;\n  scanf(\"%s%s\", danci1, danci2);\n  for (i = 0; i < strlen(juzi); i++) {\n    if (i == 0 || juzi[i - 1] == ' ')\n      for (j = 0; j < strlen(danci1); j++) {\n        if (*(juzi + i + j) == *(danci1 + j))\n          count++;\n        else {\n          count = 0;\n          break;\n        }\n      }\n    if (count != 0) {\n      printf(\"%s\", danci2);\n      i += strlen(danci1) - 1;\n      count = 0;\n    } else\n      printf(\"%c\", juzi[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35934", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[500] = {0}, b[30] = {0}, c[30] = {0}, temp[30] = {0};\n  int i, j, k, len, count = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  len = strlen(a);\n\n  for (i = 0; i <= len; i++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      temp[count] = a[i];\n      count++;\n    }\n    if (a[i] == ' ') {\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0) {\n        printf(\"%s \", c);\n      }\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n    if (a[i] == '\u0000') {\n\n      temp[count] = '\u0000';\n      if (strcmp(temp, b) == 0)\n        printf(\"%s \", c);\n\n      if (strcmp(temp, b) != 0)\n        printf(\"%s \", temp);\n      count = 0;\n    }\n  }\n}\n"}
{"label": "19", "index": "35935", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char word[50][20];\n  char s[100], a[100], b[100], e[100];\n  int i = 0, j = 0, k = 0;\n\n  cin >> s;\n  while (1) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      e[j] = s[i];\n      j++;\n    } else if (s[i] == ' ') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      j = 0;\n      k++;\n    } else if (s[i] == '\u0000') {\n      e[j] = '\u0000';\n      strcpy(word[k], e);\n      break;\n    }\n    i++;\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(a, word[i]) == 0)\n      strcpy(word[i], b);\n  }\n  for (i = 0; i < k; i++)\n    cout << word[i] << \" \";\n  printf(\"%s\", word[k]);\n  return 0;\n}\n"}
{"label": "19", "index": "35936", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[200];\n  int l1, l2, l3, i, j, k = 0;\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  l3 = strlen(c);\n  for (i = 0; i < l1; i++) {\n    if (a[i - 1] == ' ' || i == 0) {\n      for (j = 0; j < l2; j++)\n        if (a[i + j] != b[j])\n          break;\n      if (j == l2) {\n        for (j = 0; j < l3; j++, k++) {\n          d[k] = c[j];\n        }\n        i = i + l2 - 1;\n      } else {\n        d[k] = a[i];\n        k++;\n      }\n    } else {\n      d[k] = a[i];\n      k++;\n    }\n  }\n  d[k] = '\u0000';\n  cout << d;\n  return 0;\n}\n"}
{"label": "19", "index": "35937", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char stc[201], wrd1[101], wrd2[101], wrdd[100][101];\n  int i, j = 0, k = 0, l = 0;\n  cin >> stc;\n  cin >> wrd1;\n  scanf(\"%s \", wrd2);\n  for (i = 0; stc[i] != '\u0000'; i++) {\n    if (stc[i] != ' ')\n      wrdd[j][k] = stc[i], k++;\n    else\n      wrdd[j][k] = '\u0000', j++, k = 0;\n  }\n  for (i = 0; i <= j; i++)\n    if (strcmp(wrd1, wrdd[i]) == 0)\n      strcpy(wrdd[i], wrd2);\n  for (i = 0, k = 0; l <= j; i++) {\n    if (wrdd[l][k] != '\u0000')\n      stc[i] = wrdd[l][k], k++;\n    else\n      stc[i] = ' ', l++, k = 0;\n  }\n  stc[i - 1] = '\u0000';\n  puts(stc);\n  return 0;\n}\n"}
{"label": "19", "index": "35938", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[256], a[100], b[100];\n  char c;\n  int i, j, lengths, lengtha, lengthb, g = 0, k = 0, m;\n  cin.getline(s, 256);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n  lengths = strlen(s);\n  lengtha = strlen(a);\n  lengthb = strlen(b);\n  a[lengtha] = ' ';\n  for (i = lengtha + 1; i > 0; i--) {\n    a[i] = a[i - 1];\n  }\n  a[0] = ' ';\n  if (s[0] == a[1]) {\n    for (i = 0; i <= lengtha; i++)\n      a[i] = a[i + 1];\n\n    a[lengtha + 1] = 0;\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (g == 0)\n        cout << s[i];\n      if (g == 1) {\n        cout << b;\n        i = i + lengtha - 1;\n      }\n    }\n  } else\n    for (i = 0; i <= lengths - 1; i++) {\n      for (j = 0; j <= lengtha + 1; j++) {\n        if (s[i + j] == a[j])\n          g = 1;\n        else\n          g = 0;\n        if (g == 0)\n          break;\n        else\n          k = i;\n      }\n      if (i + lengtha + 1 == lengths) {\n        for (m = 0; m <= lengtha - 1; m++) {\n          if (s[i + m] == a[m])\n            g = 1;\n          else\n            g = 0;\n          if (g == 0)\n            break;\n        }\n        if (g == 1) {\n          cout << ' ' << b;\n          break;\n        } else\n          cout << s[i];\n      } else {\n        if (g == 0)\n          cout << s[i];\n        if (g == 1) {\n          cout << ' ' << b;\n          i = i + lengtha;\n        }\n      }\n    }\n  return 0;\n}\n"}
{"label": "19", "index": "35939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l1, l2, l3, i, j, lab;\n  lab = 1;\n  int x[200] = {0};\n  char a[200], b[200];\n  char s[200] = {0};\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  l1 = strlen(s);\n  l2 = strlen(a);\n  l3 = strlen(b);\n  for (i = l1; i >= 0; i--) {\n    s[i] = s[i - 1];\n  }\n  s[0] = ' ';\n  s[l1 + 1] = ' ';\n\n  for (i = 0; i <= l1; i++) {\n\n    if ((s[i] != ' ') || (s[i + l2 + 1] != ' '))\n      continue;\n    lab = 0;\n    for (j = 0; j < l2; j++) {\n      if (s[i + j + 1] != a[j]) {\n        lab = 1;\n      }\n    }\n    if (lab == 0) {\n      x[i + 1] = 1;\n    }\n  }\n  for (i = 1; i <= l1;) {\n    if (x[i] == 0) {\n      cout << s[i];\n      i++;\n    }\n\n    if (x[i] == 1) {\n      cout << b;\n      i = i + l2;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, ll, ll2;\n  char a[100];\n  char aa[100];\n  char bb[100];\n  char h[100][100];\n  int c[100];\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n\n  cin >> a;\n\n  cin >> aa;\n\n  cin >> bb;\n  l = strlen(a);\n  ll = strlen(aa);\n  ll2 = strlen(bb);\n  int n = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == ' ') {\n      n = n + 1;\n    }\n  }\n  int b[50];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (a[j] == ' ' && c[j] == 0) {\n        b[i] = j;\n        c[j] = 1;\n        break;\n      }\n    }\n  }\n  int d[50];\n  d[0] = b[0];\n  for (i = 1; i < n; i++) {\n    d[i] = b[i] - b[i - 1] - 1;\n  }\n  d[n] = l - b[n - 1] - 1;\n  for (i = 1; i < n; i++) {\n    for (j = b[i - 1] + 1; j < b[i]; j++) {\n      h[i][j - b[i - 1] - 1] = a[j];\n    }\n  }\n  for (j = 0; j < b[0]; j++) {\n    h[0][j] = a[j];\n  }\n  for (j = b[n - 1] + 1; j < l; j++) {\n    h[n][j - b[n - 1] - 1] = a[j];\n  }\n  for (i = 0; i <= n; i++) {\n    if (d[i] == ll) {\n      int t = 0;\n      for (j = 0; j < d[i]; j++) {\n        if (h[i][j] == aa[j]) {\n          t = t + 1;\n        }\n      }\n      if (t == d[i]) {\n        d[i] = ll2;\n        for (j = 0; j < ll2; j++) {\n          h[i][j] = bb[j];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < d[i]; j++) {\n      if (j != d[i] - 1) {\n        printf(\"%c\", h[i][j]);\n      } else if (j == d[i] - 1) {\n        printf(\"%c \", h[i][j]);\n      }\n    }\n  }\n  for (j = 0; j < d[n]; j++) {\n    if (j != d[n] - 1)\n      printf(\"%c\", h[n][j]);\n    else if (j == d[i] - 1) {\n      printf(\"%c \", h[n][j]);\n    }\n  }\n}\n"}
{"label": "19", "index": "35941", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], t[101], r[101], w[101];\n\n  cin >> s;\n\n  cin >> t;\n\n  cin >> r;\n  int x, i, j, h, k, g, l, u = 0;\n  int a, b, c, f, k1 = 0;\n  a = strlen(s);\n  b = strlen(t);\n  c = strlen(r);\n  for (int y = 0;; y++) {\n    if (a == 64) {\n      cout\n          << \"Almost all platforms for developing WebGIS are complex extremely\";\n      return 0;\n    }\n    f = 0;\n    a = strlen(s);\n    b = strlen(t);\n    c = strlen(r);\n    if (u == 0) {\n      for (i = 0; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    } else {\n      for (i = k1 + c; i <= a - b; i++) {\n        l = 0;\n        int h1 = 0;\n        for (j = 0; j < b; j++) {\n          if (t[j] == s[i + j])\n            h1++;\n        }\n        if (s[i - 1] == 't')\n          continue;\n        if (h1 == b) {\n          l = 1;\n          break;\n        }\n      }\n    }\n    k1 = i;\n    if (l == 0 && u == 1)\n      break;\n    for (h = 0; h < i; h++) {\n      w[h] = s[h];\n    }\n    for (k = 0; k < c; k++) {\n      w[i + k] = r[k];\n    }\n    for (g = i + b; g < a; g++) {\n      w[i + c + f] = s[g];\n      f++;\n    }\n    w[a - b + c] = '\u0000';\n    for (x = 0; x <= a - b + c; x++) {\n      s[x] = w[x];\n      u = 1;\n    }\n  }\n  puts(w);\n  return 0;\n}\n"}
{"label": "19", "index": "35942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *s;\n  char *a;\n  char *b;\n  s = (char *)malloc(sizeof(char) * 1000);\n  a = (char *)malloc(sizeof(char) * 1000);\n  b = (char *)malloc(sizeof(char) * 1000);\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  free(a);\n  free(b);\n  free(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35943", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[200], b[200], c[200], d[200];\n  int ai = 0, lb, la, lc, bi = 0, ci = 0, di = 0, k;\n\n  cin >> a;\n  cin >> b;\n  scanf(\"%s\", &c);\n  lb = strlen(b);\n  la = strlen(a);\n  lc = strlen(c);\n  while (ai != la) {\n    bi = 0;\n    ci = 0;\n    if (ai != 0) {\n      if ((a[ai] == b[bi]) && (a[ai - 1] == ' ')) {\n\n        k = ai;\n        while ((a[ai] == b[bi]) && (a[ai] != ' ') && (a[ai] != '\u0000')) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    } else {\n      if (a[ai] == b[bi]) {\n\n        k = ai;\n        while (a[ai] == b[bi]) {\n          bi++;\n          ai++;\n        }\n        if (bi == lb) {\n          while (ci != lc) {\n            d[di] = c[ci];\n            di++;\n            ci++;\n          }\n        } else {\n          ai = k;\n          d[di] = a[ai];\n          di++;\n          ai++;\n        }\n      } else {\n        d[di] = a[ai];\n        ai++;\n        di++;\n      }\n    }\n  }\n\n  d[di] = '\u0000';\n\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35944", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint n1, n2, n3;\nchar str1[100], str2[100], str3[100];\nint f(char *p) {\n  int m, n;\n  n = 0;\n  char *f;\n  f = p;\n  for (m = 0; m < n2; m++) {\n    if ((*f) == str2[m]) {\n      n++;\n    }\n    f++;\n  }\n  if (n == n2)\n    return 1;\n  else\n    return 0;\n}\nint m(char *p) {\n  if (*p >= 'a' && *p <= 'z')\n    return 1;\n  else if (*p >= 'A' && *p <= 'Z')\n    return 1;\n  else\n    return 0;\n}\nint main() {\n\n  cin >> str1;\n  n1 = strlen(str1);\n  scanf(\"%s\", str2);\n  n2 = strlen(str2);\n  scanf(\"%s\", str3);\n  n3 = strlen(str3);\n  int i = 0, j;\n  char *p1, *p2;\n  p1 = str1;\n  for (i = 0; (p1 - str1) < n1; i++, p1++) {\n    p2 = p1 + n2;\n    if ((f(p1) == 1) && (m(p1 - 1) == 0) && (m(p2) == 0)) {\n      for (j = 0; j < n3; j++)\n        printf(\"%c\", str3[j]);\n      p1 = p1 + n2 - 1;\n    } else {\n      printf(\"%c\", *p1);\n    }\n  }\n}\n"}
{"label": "19", "index": "35945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[10000];\n  char tmp[105], a[105], b[105];\n  int i, j;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (i = 0, j = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == ' ') {\n      tmp[j] = '\u0000';\n      j = 0;\n      if (strcmp(a, tmp) == 0) {\n        printf(\"%s \", b);\n      } else {\n        printf(\"%s \", tmp);\n      }\n    } else {\n      tmp[j] = s[i];\n      j++;\n    }\n  }\n  tmp[j] = '\u0000';\n  if (strcmp(a, tmp) == 0) {\n    printf(\"%s \", b);\n  } else {\n    cout << tmp << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35946", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[100], b[100], c[100], d[100], e[100] = \"\u0000\";\n  int i, j;\n  char *s;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  s = a;\n  strcat(a, \" \");\n  for (i = 0; a[i] != '\u0000'; i++) {\n    j = 0;\n    while (a[i] != ' ') {\n      d[j] = a[i];\n      i++;\n      j++;\n    }\n    d[j] = '\u0000';\n    if ((!strcmp(d, b)) && (d[0] != '\u0000'))\n      strcat(e, c);\n    else\n      strcat(e, d);\n\n    if (a[i + 1] != '\u0000')\n      strcat(e, \" \");\n  }\n  puts(e);\n}\n"}
{"label": "19", "index": "35947", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char a[200], b[100], c[100], d[200];\n  int i, j;\n  int n1 = 0, n2 = 0, n3 = 0;\n  int m = 0, flat = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++)\n\n    n1++;\n  for (i = 0; b[i] != '\u0000'; i++)\n    n2++;\n  for (i = 0; c[i] != '\u0000'; i++)\n    n3++;\n  for (i = 0; i <= n1 + x * (n3 - n2) - 1; i++) {\n    if (a[i] == b[0]) {\n      flat = 1;\n      for (j = 1; j <= n2 - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          flat = flat + 1;\n      }\n      if (((flat == n2) && (a[i - 1] == ' ') && (a[i + n2] == ' ')) ||\n          ((i == 0) && (flat == n2) && (a[i + n2] == ' ')) ||\n          ((flat == n2) && (i >= n1 + x * (n3 - n2) - n2 - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + n2; m <= n1 + 2; m++) {\n          d[m - i - n2] = a[m];\n        }\n        for (m = i; m <= i + n3 - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + n3; m <= n1 + n3 - n2 + 2; m++) {\n          a[m] = d[m - i - n3];\n        }\n        i = i + n3 - n2;\n        x = x + 1;\n      }\n    }\n  }\n  a[n1 + x * (n3 - n2)] = '\u0000';\n  printf(\"%s \", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35948", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][100], str1[100], str2[100], (*p)[100];\n  int i, k;\n  for (i = 0;; i++) {\n    cin >> str[i];\n    k = i;\n    if (getchar() == ' ')\n      break;\n  }\n  p = str;\n\n  cin >> str1;\n\n  cin >> str2;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(*(p + i), str1) == 0) {\n      strcpy(*(p + i), str2);\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (i < k)\n      printf(\"%s \", *(p + i));\n    else\n      printf(\"%s\", *(p + i));\n  }\n}\n"}
{"label": "19", "index": "35949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[100], word[50][20] = {0}, pre[20], post[20];\n  int i, l, f[50] = {0}, g[50] = {0};\n  int word_num = 0, char_num = 0;\n\n  cin >> sen;\n\n  cin >> pre;\n\n  cin >> post;\n  l = strlen(sen);\n  for (i = 0; i < l; i++) {\n    if (sen[i] != ' ') {\n      word[word_num][char_num] = sen[i];\n      char_num++;\n    } else if (sen[i] == ' ') {\n      word_num++;\n      char_num = 0;\n    }\n  }\n  for (i = 0; i <= word_num; i++)\n    f[i] = strlen(word[i]);\n\n  for (i = 0; i <= word_num; i++) {\n    if (strcmp(word[i], pre) == 0) {\n      strcpy(word[i], post);\n    }\n  }\n  for (i = 0; i < word_num; i++) {\n    printf(\"%s\", word[i]);\n    printf(\" \");\n  }\n  printf(\"%s\", word[word_num]);\n  return 0;\n}\n"}
{"label": "19", "index": "35950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101];\n  char a[101];\n  char b[101];\n  char d[101][101];\n  int l;\n  int i, j, k;\n  while (cin >> s) {\n    int t = 0;\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    getchar();\n    l = strlen(s);\n    i = 0;\n    j = 0;\n    k = 0;\n    for (i = 0; i <= l; i++) {\n      if (s[i] == ' ') {\n        d[j][k] = '\u0000';\n        k = 0;\n        ++j;\n      } else if (s[i] == '\u0000') {\n        d[j][k] = '\u0000';\n        ++j;\n      } else {\n        d[j][k] = s[i];\n        ++k;\n      }\n    }\n    for (i = 0; i < j; i++) {\n      if (strcmp(a, d[i]) == 0)\n        strcpy(d[i], b);\n    }\n    for (i = 0; i < j - 1; i++)\n      printf(\"%s \", d[i]);\n    cout << d[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35951", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100];\n\n  cin >> zfc;\n  char b[100][100];\n  int l = strlen(zfc);\n  int n = 0, k = 0, i;\n  for (i = 0; i < l; i++) {\n    if (zfc[i] != ' ' && zfc[i] != ',') {\n      b[n][k] = zfc[i];\n      k++;\n    } else {\n      b[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  b[n][k] = '\u0000';\n  char h[100], f[100];\n\n  cin >> h;\n\n  scanf(\"%s \", f);\n  int j;\n  for (j = 0; j < n; j++) {\n    if (strcmp(b[j], h) == 0) {\n      strcpy(b[j], f);\n      printf(\"%s \", b[j]);\n    } else {\n      printf(\"%s \", b[j]);\n    }\n  }\n  if (strcmp(b[n], h) != 0)\n    printf(\"%s\", b[n]);\n  if (strcmp(b[n], h) == 0)\n    printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35952", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  char *ss[100];\n  int i, n = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  ss[n++] = s;\n  for (i = 0; s[i]; i++) {\n    if (s[i] == ' ') {\n      s[i] = 0;\n      ss[n++] = s + i + 1;\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    if (i > 0)\n      printf(\" \");\n    if (strcmp(ss[i], a) == 0) {\n      printf(\"%s\", b);\n    } else\n      printf(ss[i]);\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35953", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k, lena, lenb, lenc, flag;\n  for (i = 0; i < 100; i++) {\n    a[i] = 0;\n  }\n\n  cin >> a; \n\n  cin >> b;\n\n  cin >> c;\n  lena = strlen(a); \n  lenb = strlen(b);\n  lenc = strlen(c);\n  for (i = 0; i <= lena - lenb; i++) \n  {\n    flag = 1;\n    for (j = 0; j < lenb; j++) {\n      if (a[i + j] != b[j]) {\n        flag = 0;\n        break;\n      }\n    }\n    if (flag == 1 && (i == 0 || a[i - 1] == ' ') &&\n        (i == lena - lenb || a[i + lenb] == ' ')) {\n      if (lenb > lenc) \n      {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n        {\n          a[k] = c[j];\n        }\n        for (k = i + lenc; k < lena; k++) \n        {\n          a[k] = a[k + lenb - 1];\n        }\n        i += lenc - 1;\n        lena -= lenb - lenc;\n      }\n      if (lenb == lenc) {\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n        {\n          a[k] = c[j];\n        }\n      }\n      if (lenb < lenc) \n      {\n        for (k = lena - 1 + lenc - lenb; k >= i + lenc; k--) \n        {\n          a[k] = a[k - lenc + lenb];\n        }\n        for (k = i, j = 0; k < i + lenc, j < lenc; k++, j++) \n        {\n          a[k] = c[j];\n        }\n        i += lenc - 1;\n        lena += lenc - lenb; \n      }\n    }\n  }\n  cout << a << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35954", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *p, *q;\n  s = (char *)malloc(100);\n  a = (char *)malloc(100);\n  b = (char *)malloc(100);\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  for (p = s;; p++) {\n    if (*p == '\u0000') {\n      if (strcmp(q, a) == 0) {\n        printf(\"%s\", b);\n        break;\n      }\n      printf(\"%s\", q);\n      break;\n    }\n    if (*p == ' ') {\n      *p = '\u0000';\n      if (strcmp(q, a) == 0)\n        printf(\"%s \", b);\n      else\n        printf(\"%s \", q);\n      q = p + 1;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35955", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[202], a[202], b[202], ch[202];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  int k = 0;\n  for (int j = 0; j < strlen(s); ++j) {\n    if (s[j] != ' ') {\n      ch[k] = s[j];\n      ++k;\n    } else {\n      ch[k] = '\u0000';\n      if (!strcmp(ch, a))\n        cout << b << \" \";\n      else\n        cout << ch << \" \";\n      memset(ch, 0, sizeof(char) * k);\n      k = 0;\n    }\n    if (j == strlen(s) - 1) {\n      if (!strcmp(ch, a))\n        cout << b << endl;\n      else\n        printf(\"%s\\n\", ch);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35956", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100] = {'\\0'};\n  int i, j = 0;\n  for (i = 0; i < 100; i++) {\n    j += scanf(\"%s\", a[i]);\n    if (a[i][0] < 2)\n      break;\n  }\n  for (i = 0; i < 100; i++)\n    if (strcmp(a[i], a[j - 1]) == 0)\n      strcpy(a[i], a[j]);\n  for (i = 0; i < j - 2; i++)\n    printf(\"%s \", a[i]);\n  printf(\"%s\", a[j - 2]);\n  return 0;\n}\n"}
{"label": "19", "index": "35957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[101], a[101], b[101];\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  char word[100][100];\n  int len = strlen(s);\n  int i, j = 0, n = 0, flag = 0;\n  for (i = 0; s[i] != '\\0'; i++) {\n    if (s[i] == ' ') {\n      flag = 0;\n    } else if (flag == 0) {\n      flag = 1;\n      n++;\n    }\n  }\n  int count = 0;\n  int count1[100];\n  for (i = 0; i < n; i++) {\n    count1[i] = 0;\n    do {\n      word[i][j - count] = s[j];\n      count1[i]++;\n      j++;\n    } while (s[j] != ' ' && s[j] != '\\0');\n    count1[i]++;\n    word[i][j - count] = '\\0';\n    j++;\n    count = count + count1[i];\n  }\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], a) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n  for (i = 0; i < n - 1; i++) {\n    cout << word[i] << \" \";\n  }\n  cout << word[n - 1];\n  printf(\"\\n\");\n  return 0;\n}\n"}
{"label": "19", "index": "35958", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000][1000] = {0};\n  int i, j, k = 0, e, d, h, n = 0, d1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  d = strlen(s);\n  for (i = k; i < d; i++) {\n    h = 0;\n    if (s[i] != ' ' && (s[i + 1] == ' ' || s[i + 1] == '\u0000')) {\n      for (j = k; j <= i; j++) {\n        c[n][h++] = s[j];\n      }\n      c[n][h] = '\u0000';\n      n += 1;\n      k = i + 2;\n    }\n  }\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      strcpy(c[i], b);\n      e = 1;\n    }\n  }\n  if (e == 0) {\n    printf(\"%s \", s);\n  } else {\n    for (i = 0; i < n - 1; i++) {\n      d1 = strlen(c[i]);\n      for (j = 0; j < d1; j++) {\n        printf(\"%c\", c[i][j]);\n      }\n      printf(\"%c\", ' ');\n    }\n    printf(\"%s \", c[n - 1]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0;\n  char a[100], b[100], c[100];\n\n  cin >> a;\n  scanf(\"%s%s\", b, c);\n\n  for (i = 0;; i++) {\n    while (1) {\n\n      if (a[i + j] == b[j] && a[i + j] != '\u0000')\n\n      {\n        j++;\n        continue;\n      } else if (b[j] == '\u0000' && (a[i + j] == ' ' || a[i + j] == '\u0000') &&\n                 (a[i - 1] == ' ' || i == 0)) {\n        j = 0;\n        printf(\"%s\", c);\n        i += strlen(b) - 1;\n        break;\n      } else {\n        j = 0;\n        if (a[i] == '\u0000')\n          break;\n        else\n          printf(\"%c\", a[i]);\n        break;\n      }\n    }\n\n    if (a[i] == '\u0000')\n      break;\n  }\n  if (b[j] == '\u0000')\n    printf(\"%s\", c);\n\n  return 0;\n}\n"}
{"label": "19", "index": "35960", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {0}, b[100] = {0};\n  char temp[100][100] = {{0}};\n  int i, j, k, s1, a1, b1;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", temp[i]);\n    if (getchar() == ' ') {\n      break;\n    }\n  }\n\n  cin >> a;\n  cin >> b;\n  a1 = strlen(a);\n  b1 = strlen(b);\n  for (j = 0; j < i; j++) {\n    if (strcmp(temp[j], a) == 0) {\n      for (k = 0; k < b1; k++) {\n        temp[j][k] = b[k];\n      }\n      temp[j][b1] = '\u0000';\n    }\n    printf(\"%s \", temp[j]);\n  }\n  if (strcmp(temp[i], a) == 0) {\n    for (k = 0; k < b1; k++) {\n      temp[i][k] = b[k];\n    }\n    temp[i][b1] = '\u0000';\n  }\n  printf(\"%s\", temp[i]);\n}\n"}
{"label": "19", "index": "35961", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[100], b[100];\n  int t1, t2, t3, m, i;\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  t1 = strlen(s);\n  t2 = strlen(a);\n  t3 = strlen(b);\n  for (i = 0; s[i]; i++) {\n    m = -1;\n    if (s[i] == a[0] && (s[i - 1] == ' ') || i == 0) {\n      for (int j = 0; j < t2; j++) {\n        if (s[i + j] == a[j] &&\n            ((s[i + t2] == ' ' || s[i + t2] == '\u0000') || a[t2] == '\u0000'))\n          m = i;\n        else {\n          m = -1;\n          break;\n        }\n      }\n    }\n    if (m == i) {\n\n      if (t3 > t2) {\n        for (int u = strlen(s); u >= (t2 + m); u--) {\n          s[u + t3 - t2] = s[u];\n        }\n        for (int p = m; p < t3 + m; p++) {\n          s[p] = b[p - m];\n        }\n      } else if (t3 <= t2) {\n        for (int k = m; k < t3 + m; k++) {\n          s[k] = b[k - m];\n        }\n        for (int l = t3 + m; l < t2 + m; l++) {\n          s[l] = ' ';\n        }\n        for (int u = t2 + m; u < strlen(s) - t3 + t2; u++) {\n          s[u - t2 + t3] = s[u];\n        }\n      }\n    }\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "35962", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n  scanf(\"%s \", str);\n  scanf(\"%s \", wrd);\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((*(str + i) != ' ') && (*(str + i) != '\u0000')) {\n      *(wd + j) = *(str + i);\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          *(str + k) = '\u0000';\n        for (k = i; k < n; k++) {\n          *(sr + k - i) = *(str + k);\n          *(str + k) = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          *(sr + k) = '\u0000';\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          *(wd + k) = '\u0000';\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "35963", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], s_[200][200], s__[200];\n  int i, n = 0, m, j = 0, p = 0;\n\n  cin >> s;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    s__[i] = s[i];\n  }\n  s__[i] = ' ';\n  s__[i + 1] = '\u0000';\n  scanf(\"%s%s\", a, b);\n  for (i = 0; s__[i] != '\u0000'; i++) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    if (s__[i] == ' ') {\n      s_[j][p] = '\u0000';\n      j++;\n      p = 0;\n    } else {\n      s_[j][p] = s__[i];\n      p++;\n    }\n  }\n  m = j;\n  for (j = 0; j < m - 1; j++) {\n    if (strcmp(s_[j], a) == 0) {\n      printf(\"%s \", b);\n    } else {\n      printf(\"%s \", s_[j]);\n    }\n  }\n  if (strcmp(s_[m - 1], a) == 0) {\n    printf(\"%s\", b);\n  } else {\n    printf(\"%s\", s_[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j, v, x, c, flag;\n  char str[100], a[10], b[10];\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  v = strlen(str);\n  x = strlen(a);\n  c = strlen(b);\n  str[v] = ' ';\n  flag = x;\n  for (i = 0; i < x; i++) {\n    if (str[i] == a[i]) {\n      flag--;\n    }\n  }\n  if (flag == 0 && str[x] == ' ') {\n    cout << b;\n  } else\n    for (i = 0; i < x; i++) {\n      printf(\"%c\", str[i]);\n    }\n  i = x;\n  while (i < v) {\n    flag = x;\n    for (j = i; j < i + x; j++) {\n      if (str[j] == a[j - i])\n        flag--;\n    }\n    if (flag == 0 && str[i - 1] == ' ' && str[i + x] == ' ') {\n      printf(\"%s\", b);\n      i = i + x;\n    } else {\n      printf(\"%c\", str[i]);\n      i++;\n    }\n  }\n}\n"}
{"label": "19", "index": "35965", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], w[100][20];\n  int len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int i, j, n = 0, k = 0;\n  for (i = 0; i <= len; i++) {\n    if (s[i] == 32) {\n      w[n][k] = '\u0000';\n      n++;\n      k = 0;\n    } else {\n      w[n][k] = s[i];\n      k++;\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    if (strcmp(w[j], a) == 0) {\n      strcpy(w[j], b);\n    }\n    if (j == 0)\n      printf(\"%s\", w[j]);\n    else {\n      printf(\" %s\", w[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35966", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar temp[1000];\nchar test[1000][1000];\nchar s[1000];\nchar d[1000];\nchar now[1000];\nint main() {\n\n  cin.getline(temp, 1000);\n  scanf(\"%s \", s);\n  scanf(\"%s \", d);\n  memset(test, 0, sizeof(test));\n  int length = strlen(temp);\n  int i;\n  int j = 0;\n  int k = 0;\n  for (i = 0; i < length; i++) {\n    if (temp[i] != ' ')\n      now[j++] = temp[i];\n    else {\n      strcpy(test[k], now);\n      memset(now, 0, sizeof(now));\n      j = 0;\n      k++;\n    }\n  }\n  strcpy(test[k], now);\n  for (i = 0; i <= k; i++) {\n    if (strcmp(test[i], s) == 0)\n      strcpy(test[i], d);\n  }\n  for (i = 0; i <= k; i++) {\n    if (i != k)\n      printf(\"%s \", test[i]);\n    else\n      cout << test[i] << endl;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35967", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint check(char p[100], char q[100], int a, int b) {\n  int m, x;\n  for (m = 0; m <= a; m++) {\n    if (p[b + m] == q[m])\n      x = 1;\n    else {\n      x = 0;\n      break;\n    }\n  }\n  return (x);\n}\nint main() {\n  char s[100], a[100], b[100];\n  int i, l, j;\n  for (i = 0; i < 100; i++) {\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n    b[i] = '\u0000';\n  }\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", a, b);\n  l = strlen(s);\n  s[l] = ' ';\n  l = strlen(a);\n  a[l] = ' ';\n  if (check(s, a, l, 0))\n    printf(\"%s\", b);\n  else {\n    i = 0;\n    do {\n      printf(\"%c\", s[i]);\n      i++;\n    } while (s[i] != ' ');\n  }\n  i = 0;\n  while (s[i] != ' ')\n    i++;\n  for (i = i + 1; i < 100;) {\n    j = i;\n    if (s[i] == '\u0000')\n      break;\n    else if (check(s, a, l, i))\n      printf(\" %s\", b);\n    else {\n      printf(\" \");\n      do {\n        printf(\"%c\", s[i]);\n        i++;\n      } while (s[i] != ' ');\n    }\n    i = j;\n    while (s[i] != ' ')\n      i++;\n    i = i + 1;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35968", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint bijiao(int p, char *a, int n, char *b) {\n  int i, flag = 0;\n  for (i = 0; i < n; i++) {\n    if (a[p + i] != b[i]) {\n      return 0;\n      flag = 1;\n      break;\n    }\n  }\n  if (flag == 0) {\n    return 1;\n  }\n}\nint main() {\n  char str[1000];\n  char a[100];\n  char b[100];\n  int i;\n  int len1, len2, len;\n\n  cin >> str;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(str);\n  len1 = strlen(a);\n  len2 = strlen(b);\n  for (i = 0; i < len; i++) {\n    if (i == 0) {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        cout << str[i];\n      }\n    } else {\n      if (bijiao(i, str, len1, a) == 1 && str[i + len1] == ' ' &&\n          str[i - 1] == ' ') {\n        printf(\"%s\", b);\n        i = i + len1 - 1;\n      } else {\n        if (bijiao(i, str, len1, a) == 1 && i + len1 == len &&\n            str[i - 1] == ' ') {\n          cout << b;\n          i = i + len1 - 1;\n        } else {\n          printf(\"%c\", str[i]);\n        }\n      }\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35969", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], t[100];\n  int i, j;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; i < strlen(s); i++) {\n    j = 0;\n    while (s[i] != ' ' && s[i] != '\u0000')\n      t[j++] = s[i++];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      printf(\"%s\", b);\n\n    } else {\n      printf(\"%s\", t);\n    }\n    if (i == strlen(s)) {\n      printf(\"\u0000\");\n    } else\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35970", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[20][20], d[100], b[20], c[20];\n  int n, j = 0, k = 0, flag = 0, x;\n\n  scanf(\"%s \", d);\n\n  cin >> b;\n\n  cin >> c;\n  x = strlen(c);\n  for (; x < 20; x++)\n    c[x] = '\u0000';\n  n = strlen(d);\n  for (int i = 0; i < n; i++) {\n    if (d[i] != ' ')\n      a[j][k++] = d[i];\n    else {\n      for (; k < 20;)\n        a[j][k++] = '\u0000';\n      flag = flag + 1;\n      j++;\n      k = 0;\n    }\n  }\n  for (int m = 0; m < 20; m++)\n    if (a[flag][m] == d[n - 1])\n      k = m + 1;\n  for (; k < 20;)\n    a[flag][k++] = '\u0000';\n  for (int p = 0; p < 20; p++)\n    if (strcmp(a[p], b) == 0)\n      strncpy(a[p], c, 20);\n  cout << a[0];\n  for (int l = 1; l < flag + 1; l++)\n    cout << \" \" << a[l];\n  return 0;\n}\n"}
{"label": "19", "index": "35971", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  char x[100], c[100] = {'\u0000'};\n  int i, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      x[t] = s[i];\n      t++;\n    } else {\n      x[t] = '\u0000';\n      if (strcmp(x, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n      } else {\n        strcat(c, x);\n        strcat(c, \" \");\n      }\n      t = 0;\n    }\n  }\n  x[t] = '\u0000';\n  if (strcmp(x, a) == 0) {\n    strcat(c, b);\n  } else\n    strcat(c, x);\n\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "35972", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char ch[11000], target[1000], replace[1000];\n  cin.getline(ch, 10000);\n  cin.getline(target, 110);\n  cin.getline(replace, 110);\n  int c = strlen(ch);\n  int t = strlen(target);\n  ch[c] = ' ';\n  for (int i = 0; i < c; i++) {\n    if (ch[i] != target[0]) \n      cout << ch[i];\n    else if (i == 0 && ch[i] == target[0] &&\n             ch[t] != ' ') \n      cout << ch[i];\n    else if (i > 0 && (ch[i - 1] != ' ' || ch[i + t] != ' ')) \n      cout << ch[i];\n    else \n    {\n      int count = 0;\n      for (int j = 0; j < t; j++) {\n        if (ch[i + j] == target[j])\n          count++;\n        else\n          break;\n      }\n      if (count == t) {\n        cout << replace;\n        i = i + t - 1;\n      } else {\n        cout << ch[i];\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35973", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[101], aim[101], change[101];\n\n  cin >> str;\n\n  cin >> aim;\n\n  cin >> change;\n\n  int i;\n  int count;\n  char tword[101];\n  count = 0;\n  tword[count] = '\u0000';\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ' && str[i] != ',') \n    {\n      tword[count] = str[i];\n      count++;\n    } else {\n      tword[count] = '\u0000';\n      if (strcmp(tword, aim) == 0) {\n        printf(\"%s \", change);\n      } else\n        printf(\"%s \", tword);\n      count = 0;\n      tword[count] = '\u0000';\n    }\n  }\n  tword[count] = '\u0000';\n  if (strcmp(tword, aim) == 0) {\n    printf(\"%s\", change);\n  } else\n    printf(\"%s\", tword);\n  return 0;\n}\n"}
{"label": "19", "index": "35974", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar s[1000];\nchar a[101];\nchar b[101];\nchar buf[101];\n\nint main() {\n  unsigned int i;\n  int index;\n\n  cin >> s;\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  index = 0;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ' || (i == strlen(s) - 1)) {\n      if (i == strlen(s) - 1)\n        buf[index++] = s[i];\n      buf[index] = '\u0000';\n      index = 0;\n      if (!strcmp(buf, a)) {\n        printf(\"%s\", b);\n      } else {\n        printf(\"%s\", buf);\n      }\n      if (i != strlen(s) - 1) {\n        printf(\" \");\n      }\n    } else {\n      buf[index++] = s[i];\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35975", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100][100], a[100], b[100];\n  int i = 0, k;\n\n  do {\n    scanf(\"%s\", s[i]);\n    i++;\n  } while (getchar() != '\\n');\n\n  k = i;\n\n  scanf(\"%s %s\", a, b);\n\n  for (i = 0; i < k - 1; i++)\n    if (strcmp(s[i], a) == 0)\n      printf(\"%s \", b);\n    else\n      printf(\"%s \", s[i]);\n  if (strcmp(s[i], a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", s[i]);\n}\n"}
{"label": "19", "index": "35976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n  cin >> str;\n  cin >> wrd;\n  cin >> wod;\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((str[i] != ' ') && (str[i] != '\u0000')) {\n      wd[j] = str[i];\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          str[k] = '\u0000';\n        for (k = i; k < n; k++) {\n          sr[k - i] = str[k];\n          str[k] = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          sr[k] = '\u0000';\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "35977", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char str[255], from[255], to[255];\n  char *s = str, *p;\n\n  scanf(\"%s \", s);\n  scanf(\"%s%s\", from, to);\n  strcat(s, \" \");\n  while (*s) {\n    p = strchr(s, ' ');\n    *p = '\u0000';\n    printf((strcmp(s, from) == 0) ? to : s);\n    s = p + 1;\n    if (*s)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35978", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint n, m, k;\nchar a[110];\nchar from[110], to[110];\nint main() {\n  while (cin >> a) {\n    char temp[110];\n    temp[0] = 0;\n    int c = 0;\n    cin >> from >> to;\n    for (int i = 0; a[i]; i++) {\n      if (a[i] == ' ') {\n        if (strcmp(temp, from) == 0) {\n          cout << to << \" \";\n        } else {\n          printf(\"%s \", temp);\n        }\n        temp[0] = 0;\n        c = 0;\n\n      } else {\n        temp[c++] = a[i];\n        temp[c] = 0;\n      }\n    }\n    if (strcmp(temp, from) == 0) {\n      printf(\"%s \", to);\n    } else\n      printf(\"%s \", temp);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[150], a[100], b[100], *p, *q;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  q = s;\n  while (strstr(q, a) != NULL) {\n    p = strstr(q, a);\n    *p = '\u0000';\n    if ((*(p - 1) != ' ') && ((p - 1) > s) ||\n        (*(p + strlen(a)) != ' ') && (p + strlen(a) < s + strlen(s)))\n      printf(\"%s%s\", q, a);\n    else\n      printf(\"%s%s\", q, b);\n    p += strlen(a);\n    q = p;\n  }\n  printf(\"%s\", q);\n}\n"}
{"label": "19", "index": "35980", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[100], a[100], b[100];\n  int i, j, k, flag = 1;\n\n  memset(a, 0, sizeof(a));\n  memset(s, 0, sizeof(s));\n  memset(b, 0, sizeof(b));\n  cin.getline(s, 100);\n  cin.getline(a, 100);\n  cin.getline(b, 100);\n\n  for (i = 0; i <= strlen(s); i++) {\n    flag = 1;\n    if (s[i] || s[i + 1]) {\n      if (s[i - 1] == 32 || i == 0) {\n        for (j = 0; a[j] != 0; j++) {\n          if (s[i + j] == a[j])\n            continue;\n          else {\n            flag = 0;\n            break;\n          }\n        }\n        if (flag == 1) {\n          i += j - 1;\n          for (k = 0; b[k] != 0; k++) {\n            cout << b[k];\n          }\n\n        } else {\n          if (s[i] == 0) {\n            cout << \" \";\n          } else\n\n            cout << s[i];\n        }\n      }\n\n      else\n        cout << s[i];\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35981", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], w[100][20];\n  int len;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  len = strlen(s);\n  int i, j, n = 0, k = 0;\n  for (i = 0; i <= len; i++) {\n    if (s[i] == 32) {\n      w[n][k] = '\u0000';\n      n++;\n      k = 0;\n    } else {\n      w[n][k] = s[i];\n      k++;\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    if (strcmp(w[j], a) == 0) {\n      strcpy(w[j], b);\n    }\n    if (j == 0) {\n      printf(\"%s\", w[j]);\n    } else {\n      printf(\" %s\", w[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35982", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j = 0, k = 0;\n  char str[101], str1[101], str2[101], str3[101][101];\n  cin >> str;\n  cin >> str1;\n  cin >> str2;\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ') {\n      str3[k][j] = str[i];\n      j++;\n    } else {\n      str3[k][j] = '\u0000';\n      k++;\n      j = 0;\n    }\n  }\n  str3[k][j] = '\u0000';\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0) {\n      if (i == 0)\n        printf(\"%s\", str2);\n      else {\n        printf(\" %s\", str2);\n      }\n    } else {\n      if (i == 0)\n        printf(\"%s\", str3[i]);\n      else\n        printf(\" %s\", str3[i]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "35983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[200], b[100], c[100], d[200];\n  int i, j, na = 0, nb = 0, nc = 0, m = 0, l = 0, x = 0;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    na++;\n  }\n  for (i = 0; b[i] != '\u0000'; i++) {\n    nb++;\n  }\n  for (i = 0; c[i] != '\u0000'; i++) {\n    nc++;\n  }\n  for (i = 0; i <= na + x * (nc - nb) - 1; i++) {\n    if (a[i] == b[0]) {\n      l = 1;\n      for (j = 1; j <= nb - 1; j++) {\n        if (a[i + j] != b[j])\n          break;\n        else\n          l = l + 1;\n      }\n      if (((l == nb) && (a[i - 1] == ' ') && (a[i + nb] == ' ')) ||\n          ((i == 0) && (l == nb) && (a[i + nb] == ' ')) ||\n          ((l == nb) && (i >= na + x * (nc - nb) - nb - 1) &&\n           (a[i - 1] == ' '))) {\n        for (m = i + nb; m <= na + 2; m++) {\n          d[m - i - nb] = a[m];\n        }\n        for (m = i; m <= i + nc - 1; m++) {\n          a[m] = c[m - i];\n        }\n        for (m = i + nc; m <= na + nc - nb + 2; m++) {\n          a[m] = d[m - i - nc];\n        }\n        i = i + nc - nb;\n        x = x + 1;\n      }\n    }\n  }\n  a[na + x * (nc - nb)] = '\u0000';\n  printf(\"%s\", a);\n  return 0;\n}\n"}
{"label": "19", "index": "35984", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, m;\n  char *p1, *p2, *p3, *p, *s;\n  p1 = (char *)malloc(1000 * sizeof(char));\n\n  cin >> p1;\n  p2 = (char *)malloc(100 * sizeof(char));\n  p3 = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> p2;\n\n  cin >> p3;\n  n = strlen(p1);\n  s = p1;\n  sscanf(s, \"%s\", p);\n  m = strlen(p);\n  if (strcmp(p2, p) == 0) {\n    printf(\"%s\", p3);\n  } else {\n    printf(\"%s\", p);\n  }\n  s = s + m + 1;\n  for (i = n - m - 1; i >= 0; i = i - m - 1) {\n    sscanf(s, \"%s\", p);\n    m = strlen(p);\n    if (strcmp(p2, p) == 0) {\n      printf(\" %s\", p3);\n    } else {\n      printf(\" %s\", p);\n    }\n    s = s + m + 1;\n  }\n}\n"}
{"label": "19", "index": "35985", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], s[100], ss[100][100] = {'\u0000'}, d[100] = {'\u0000'};\n  int i, j, m, n, t, k, l, p;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  t = strlen(s);\n  n = 0;\n  m = 0;\n  for (i = 0; i < t; i++) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      ss[m][n] = s[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (j = 0; j <= m; j++) {\n    if (strcmp(ss[j], a) == 0) {\n      strcpy(ss[j], b);\n    }\n  }\n  k = 0;\n  l = 0;\n  for (p = 0;; p++) {\n    if (ss[k][l] == '\u0000' && k != m) {\n\n      d[p] = ' ';\n      k++;\n      l = 0;\n\n    } else if (ss[k][l] != '\u0000') {\n      d[p] = ss[k][l];\n      l++;\n    } else\n      break;\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "35986", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char text[100], s[100][20] = {'\u0000'}, a[20], b[20];\n  int i, j = 0, k = 0, len;\n  cin >> text;\n  len = strlen(text);\n  for (i = 0; i < len; i++) {\n    if (text[i] != ' ') {\n      s[j][k] = text[i];\n      k = k + 1;\n    } else {\n      j = j + 1;\n      k = 0;\n    }\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s[i], a) == 0) {\n      strcpy(s[i], b);\n    }\n    printf(\"%s\", s[i]);\n    if (i != j) {\n      printf(\" \");\n    }\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "35987", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[1000], b[1000], sun[1000];\n  struct sum {\n    char tmp[20];\n  };\n  struct sum s[100];\n\n  cin >> sun;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int i, len, j;\n  len = strlen(sun);\n  sun[len + 1] = ' ';\n\n  int k = 0, n = 0;\n  for (i = 0; i <= len + 1; i++) {\n    if (sun[i] == ' ') {\n      n++;\n      int t;\n      t = i - k;\n      for (j = 0; j < k; j++) {\n\n        s[n].tmp[j] = sun[t];\n        t++;\n      }\n      s[n].tmp[j] = '\u0000';\n      k = 0;\n    } else\n      k++;\n  }\n  s[n].tmp[j - 1] = '\u0000';\n  for (i = 1; i <= n; i++) {\n    if (strcmp(s[i].tmp, a) == 0)\n      strcpy(s[i].tmp, b);\n    if (i != n)\n      printf(\"%s \", s[i].tmp);\n    else\n      printf(\"%s\", s[i].tmp);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "35988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char ch[100][100], str1[100], str2[100];\n  int i = 0, j;\n  do {\n    cin >> ch[i];\n    i++;\n  } while (getchar() != '\\n');\n  cin >> str1 >> str2;\n  for (j = 0; j < i; j++) {\n    if (strcmp(str1, ch[j]) == 0) {\n      strcpy(ch[j], str2);\n    }\n  }\n  for (j = 0; j < i - 1; j++) {\n    cout << ch[j] << \" \";\n  }\n  cout << ch[i - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "35989", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[80], s[30][20], test1[20], test2[20], *p;\n  int i, j, l, c, m = 0;\n\n  cin >> str;\n\n  cin >> test1;\n\n  cin >> test2;\n  p = str;\n  for (i = 0, c = 0; *(p + i) != ' '; i++, c++)\n    s[0][c] = *(p + i);\n  s[0][c] = '\u0000';\n  l = strlen(str);\n  m = 1;\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = i, c = 0; str[j] != ' '; j++, c++) {\n        s[m][c] = str[j];\n      }\n      s[m][c] = '\u0000';\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(test1, s[i]) == 0) {\n      strcpy(s[i], test2);\n    }\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", s[i]);\n  printf(\"%s\", s[m - 1]);\n}\n"}
{"label": "19", "index": "35990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar sen[200], a[100], b[100], re[400];\nint alen, blen;\n\nint test(int n) {\n  int j = 0;\n  char *p1, *p2;\n  p1 = sen + n;\n  p2 = a;\n  if (n != 0) {\n    if (*(p1 - 1) != ' ')\n      return 0;\n  }\n  do {\n    if (*p1 != *p2) {\n      j = 1;\n    }\n    p1++;\n    p2++;\n  } while (p2 - a < alen);\n  if (*p1 != ' ' && *p1 != '\u0000')\n    return 0;\n  if (j == 0)\n    return 1;\n  else\n    return 0;\n}\n\nint main() {\n  int l;\n  char *write = re;\n  const char *read = sen;\n  cin >> sen;\n  cin >> a;\n  cin >> b;\n  alen = strlen(a);\n  blen = strlen(b);\n  for (; read - sen < 200; read++) {\n    if (test(read - sen) == 1) {\n\n      for (l = 0; l < blen; l++) {\n        *(write + l) = b[l];\n      }\n      write += blen;\n      read += alen - 1;\n    } else {\n      *write = *read;\n      write++;\n    }\n  }\n  cout << re;\n  return 0;\n}\n"}
{"label": "19", "index": "35991", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20][20] = {'\\0'}, str2[20], str3[20];\n  int num = 0, j = 0, i;\n  cin.getline(str, 100);\n  cin.getline(str2, 20);\n  cin.getline(str3, 20);\n  for (i = 0; i < strlen(str); i++) {\n    if (str[i] != ' ')\n      str1[num][j++] = str[i];\n\n    if (str[i] == ' ') {\n      num++;\n      j = 0;\n    }\n  }\n  num = num + 1;\n  for (i = 0; i < num; i++) {\n    if (strcmp(str1[i], str2) == 0) {\n      strcpy(str1[i], str3);\n    }\n  }\n  for (i = 0; i < num - 1; i++) {\n    cout << str1[i] << \" \";\n  }\n  printf(\"%s\\n\", str1[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35992", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100];\n  char b[100], c[100], d;\n  int i, n;\n  for (i = 0;; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n    if (d == 10) {\n      break;\n    }\n  }\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (n = 0; n < i + 1; n++) {\n    if (strcmp(a[n], b) == 0) {\n      strcpy(a[n], c);\n    }\n  }\n\n  for (n = 0; n < i; n++) {\n    printf(\"%s \", a[n]);\n  }\n  printf(\"%s\", a[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "35993", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[120], s0[120];\n  char a[20], b[20];\n  int k = 1, ls;\n  cin.getline(s, 100, '\\n');\n  scanf(\"%s %s \", a, b);\n  for (int i = 0; i < strlen(s) - strlen(a) + 1; i++) {\n    ls = strlen(s);\n    if (s[i] == a[0] && (s[i + strlen(a)] == 32 || s[strlen(a) + i] == '\\0') &&\n        (i == 0 || s[i - 1] == 32)) {\n      for (int j = 1; j < strlen(a); j++)\n        if (s[i + j] != a[j]) {\n          k = 0;\n          continue;\n        }\n    } else\n      k = 0;\n    if (k == 1) {\n      for (int g = 0; g < i; g++)\n        s0[g] = s[g];\n      for (int n = i + strlen(a); n < strlen(s); n++)\n        s0[n - strlen(a) + strlen(b)] = s[n];\n      for (int m = 0; m < strlen(b); m++)\n        s0[i + m] = b[m];\n      for (int c = 0; c < ls - strlen(a) + strlen(b); c++)\n        s[c] = s0[c];\n      s[ls - strlen(a) + strlen(b)] = '\\0';\n      i += strlen(b) - 1;\n    }\n    k = 1;\n  }\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "35994", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(void) {\n  char a[100], b[100], c[100], d[100], e[100] = \"\u0000\";\n  int i, j;\n  char *s;\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  s = a;\n  strcat(a, \" \");\n  for (i = 0; a[i] != '\u0000'; i++) {\n    j = 0;\n    while (a[i] != ' ') {\n      d[j] = a[i];\n      i++;\n      j++;\n    }\n    d[j] = '\u0000';\n    if ((!strcmp(d, b)) && (d[0] != '\u0000')) {\n      strcat(e, c);\n    } else {\n      strcat(e, d);\n    }\n    if (a[i + 1] != '\u0000')\n      strcat(e, \" \");\n  }\n  puts(e);\n  return 0;\n}\n"}
{"label": "19", "index": "35995", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  char *s, *a, *b, *p, *end;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  p = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  end = s + strlen(s);\n  for (;;) {\n    sscanf(s, \"%s\", p);\n    if (strcmp(p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", p);\n    s = s + strlen(p);\n    if (s >= end)\n      break;\n    s++;\n    printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "35996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char s[10000], ch[100], a[100], b[100];\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    for (j = 0; (s[i] != ' ' && s[i] != '\u0000'); i++, j++)\n      ch[j] = s[i];\n    ch[j] = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      cout << \" \";\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      ch[k] = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "35997", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char string[100], word[50][15], subword[15], subed[15];\n\n  cin >> string;\n  cin >> subed >> subword;\n  char *p = string;\n  int i = 0, j;\n  while (*p != '\u0000') {\n    sscanf(p, \"%s\", word[i]);\n    p += strlen(word[i]);\n    i++;\n    if (*p == ' ')\n      p++;\n  }\n  for (j = 0; j < i; j++)\n    if (strcmp(word[j], subed) == 0)\n      strcpy(word[j], subword);\n  printf(\"%s\", word[0]);\n  for (j = 1; j < i; j++)\n    printf(\" %s\", word[j]);\n}\n"}
{"label": "19", "index": "35998", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100];\n\n  cin >> zfc;\n  char b[100][100];\n  int l = strlen(zfc);\n  int n = 0, k = 0, i;\n  for (i = 0; i < l; i++) {\n    if (zfc[i] != ' ' && zfc[i] != ',') {\n      b[n][k] = zfc[i];\n      k++;\n    } else {\n      b[n][k] = '\u0000';\n      n++;\n      k = 0;\n    }\n  }\n  b[n][k] = '\u0000';\n  char h[100], f[100];\n\n  scanf(\"%s \", h);\n\n  cin >> f;\n  int j;\n  for (j = 0; j < n; j++) {\n    if (strcmp(b[j], h) == 0) {\n      strcpy(b[j], f);\n      printf(\"%s \", b[j]);\n    } else {\n      printf(\"%s \", b[j]);\n    }\n  }\n  if (strcmp(b[n], h) != 0)\n    printf(\"%s\", b[n]);\n  if (strcmp(b[n], h) == 0)\n    printf(\"%s\", f);\n  return 0;\n}\n"}
{"label": "19", "index": "35999", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char danci[100][100];\n  char ch[100];\n  char yaotihuan[100];\n  char tihuan[100];\n  int i;\n  int j;\n  int k;\n  int len;\n\n  scanf(\"%s \", ch);\n  for (j = 0; j < 100; j++) {\n    for (k = 0; k < 100; k++)\n      danci[j][k] = '\u0000';\n  }\n  j = 0;\n  k = 0;\n  len = strlen(ch);\n  for (i = 0; i < len; i++) {\n    if (ch[i] != ' ' && ch[i] != ' ') {\n      danci[j][k] = ch[i];\n      k++;\n    } else {\n      if (ch[i] == ' ') {\n        j++;\n        k = 0;\n      }\n      if (ch[i] == ' ')\n        break;\n    }\n  }\n\n  scanf(\"%s\", yaotihuan);\n  scanf(\"%s\", tihuan);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], yaotihuan) == 0)\n      strcpy(danci[i], tihuan);\n  }\n  for (i = 0; i < j; i++)\n    printf(\"%s \", danci[i]);\n  printf(\"%s\", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "36000", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100];\n  int i, j, k;\n  cin.getline(a, 100, '\\n');\n  cin.getline(b, 100, '\\n');\n  cin.getline(c, 100, '\\n');\n  int l1 = strlen(a), l2 = strlen(b), l3 = strlen(c);\n  for (i = 0;; i++)\n    if (a[i] == ' ')\n      break;\n  for (j = 0; j <= i - 1; j++) {\n    if (a[j] != b[j]) {\n      for (k = 0; k <= i - 1; k++)\n        cout << a[k];\n      break;\n    }\n    if (j == i - 1)\n      cout << c;\n  }\n\n  for (i = 0; i <= l1 - 1; i++) {\n    if (a[i] != ' ') {\n      continue;\n    }\n    for (j = 0; j <= l2 - 1; j++) {\n      if (a[i + j + 1] != b[j]) {\n        printf(\" \");\n        for (k = i + 1;; k++) {\n          if (a[k] == ' ' || k == l1)\n            break;\n          else\n            cout << a[k];\n        }\n        break;\n      }\n      if (j == l2 - 1)\n        cout << \" \" << c;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main()\n\n{\n  int i, k, n = 0, p, j;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n\n  i = 0;\n  while (a[i] != '\u0000') {\n    n++;\n    i++;\n  }\n  i = 0;\n  while (s[i] != '\u0000') {\n    p = 1;\n    for (j = 0; j < n; j++)\n      if (a[j] != s[i + j])\n        p = 0;\n    if (p)\n      if (i > 1 && s[i - 1] != ' ')\n        p = 0;\n    if (p) {\n      printf(\"%s\", b);\n      i = i + n - 1;\n    } else\n      printf(\"%c\", s[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36002", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, q, j, k, flag = 0;\n  char a[102], b[102], c[102];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  n = strlen(b);\n  q = strlen(c);\n  for (i = 0; i < strlen(a); i++) {\n    if ((a[i - 1] == ' ') || ((a[i] >= 'A') && (a[i] < 'a'))) {\n      for (j = 0; j < n; j++)\n        if (a[i + j] != b[j]) {\n          flag = 1;\n          break;\n        }\n      if (flag == 0) {\n        for (k = 0; k < q; k++)\n          printf(\"%c\", c[k]);\n        i = i + n - 1;\n      } else {\n        cout << a[i];\n        flag = 0;\n      }\n    } else {\n      printf(\"%c\", a[i]);\n      flag = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char s0[2001], s1[201], s2[201];\n  cin.getline(s0, 2000);\n  cin.getline(s1, 200);\n  cin.getline(s2, 200);\n  int L0 = 0, L1 = 0, L2 = 0;\n  while (s0[L0] != 0)\n    L0++; \n  while (s1[L1] != 0)\n    L1++;\n  while (s2[L2] != 0)\n    L2++;\n  if (L1 == 0) {\n    cout << s0;\n    return 0;\n  }\n  for (int i = 0; i <= L0 - L1; i++) { \n    int is = 0;\n    for (int j = 0; j < L1; j++)\n      if (s0[i + j] != s1[j]) {\n        is++;\n        break;\n      }\n    if (is != 0)\n      continue; \n    if ((i != 0 && s0[i - 1] != ' ') || (s0[i + L1] != ' ' && s0[i + L1] != 0))\n      continue; \n    if (L1 > L2)\n      for (int j = i + L1; j < L0; j++)\n        s0[j + L2 - L1] = s0[j]; \n    else\n      for (int j = L0 - 1; j >= i + L1; j--)\n        s0[j + L2 - L1] = s0[j];\n    for (int j = i; j < i + L2; j++)\n      s0[j] = s2[j - i];\n    L0 += L2 - L1; \n    i += L2;\n  }\n  s0[L0] = 0;\n  cout << s0;\n}\n"}
{"label": "19", "index": "36004", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[101], a[101], b[101], s[10001];\n  int n[101], i;\n  for (i = 0; i <= 100; i++) {\n    c[i] = '\u0000';\n    s[i] = '\u0000';\n    a[i] = '\u0000';\n  }\n  cin >> c;\n  cin >> a;\n  cin >> b;\n  int lc;\n  lc = strlen(c);\n  n[0] = -1;\n  int j = 1;\n  for (i = 0; i <= (lc - 1); i++) {\n    if (c[i] == ' ') {\n      n[j] = i;\n      j++;\n    }\n  }\n  n[j] = lc;\n  char x[2];\n  x[0] = ' ';\n  x[1] = '\u0000';\n  for (i = 1; i <= j; i++) {\n    int l, m;\n    char ch[101];\n    for (m = 0; m <= 100; m++) {\n      ch[m] = '\u0000';\n    }\n    l = n[i] - n[i - 1] - 1;\n    for (m = 0; m <= (l - 1); m++)\n      ch[m] = c[n[i - 1] + m + 1];\n\n    if (strcmp(a, ch) == 0) {\n      strcat(s, b);\n    } else\n      strcat(s, ch);\n    if (i < j)\n      strcat(s, x);\n  }\n  puts(s);\n  return 0;\n}\n"}
{"label": "19", "index": "36005", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][100];\n  int i, j, m = 0, n = 0;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i < strlen(s); i++) {\n    if (s[i] == ' ') {\n      n++;\n      c[n][0] = s[i + 1];\n      m = 1;\n      i++;\n    } else {\n      c[n][m] = s[i];\n      m++;\n    }\n  }\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0)\n      strcpy(c[i], b);\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n  printf(\"%s\", c[n]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "36006", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[101]; \n  char a[101];\n  char b[101];\n  char d[101][101];  \n  int l;             \n  int i, j, k;       \n  while (cin >> s) { \n    int t = 0;\n    scanf(\"%s\", a); \n    scanf(\"%s\", b); \n    getchar();      \n    l = strlen(s);  \n    i = 0;          \n    j = 0;\n    k = 0;\n    for (i = 0; i <= l; i++) { \n      if (s[i] == ' ') {       \n        d[j][k] = '\u0000';\n        k = 0;\n        ++j;                    \n      } else if (s[i] == '\u0000') { \n        d[j][k] = '\u0000';\n        ++j; \n      } else {\n        d[j][k] = s[i];\n        ++k; \n      }\n    }\n    for (i = 0; i < j; i++) {   \n      if (strcmp(a, d[i]) == 0) \n        strcpy(d[i], b);\n    }\n    for (i = 0; i < j - 1; i++) \n      printf(\"%s \", d[i]);\n    printf(\"%s \", d[i]);\n  } \n  return 0;\n}\n"}
{"label": "19", "index": "36007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word_in[200], word_tr[200], word_out[200], word_fil[200];\n  for (int i = 0; i < 200; i++) {\n    word_in[i] = 0;\n    word_tr[i] = 0;\n    word_out[i] = 0;\n    word_fil[i] = 0;\n  }\n  int lg1, lg2, lg3, lg4, sum = 0, t = 0;\n  cin.getline(word_in, 200);\n  lg1 = strlen(word_in);\n  word_in[lg1] = ' ';\n  cin.getline(word_tr, 200);\n  lg2 = strlen(word_tr);\n  cin.getline(word_out, 200);\n  lg3 = strlen(word_out);\n  for (int i = 0; i < 200; i++) {\n    sum = 0;\n    for (int j = 0; j < lg2; j++) {\n      if (word_in[i + j] == word_tr[j]) {\n        sum = sum + 1;\n      }\n    }\n    if ((word_in[i - 1] == ' ' || i == 0) && word_in[i + lg2] == ' ' &&\n        sum == lg2) {\n      if (lg3 == lg2) {\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg2;\n      }\n      if (lg3 < lg2) {\n        for (int j = 0; j < lg3; j++)\n          word_in[i + j] = word_out[j];\n\n        for (int j = lg3; j < lg2; j++) {\n          word_in[i + j] = ' ';\n        }\n        i = i + lg2;\n      }\n      if (lg3 > lg2) {\n        for (int j = 199; j >= i + lg2; j--) {\n          word_in[j + lg3 - lg2] = word_in[j];\n        }\n        for (int j = 0; j < lg3; j++) {\n          word_in[i + j] = word_out[j];\n        }\n        i = i + lg3;\n      }\n    }\n  }\n  for (int i = 0; i < 200; i++) {\n    if (word_in[i] != ' ') {\n      word_fil[t] = word_in[i];\n      t++;\n    }\n    if (word_in[i] == ' ') {\n      if (word_in[i + 1] != ' ') {\n        word_fil[t] = word_in[i];\n        t++;\n      }\n    }\n  }\n  lg4 = strlen(word_fil);\n  for (int i = 0; i < lg4 - 1; i++) {\n    cout << word_fil[i];\n  }\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "36008", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str2[100], original[100], word[100], replace[100];\n  int len;\n  cin >> str;\n  len = strlen(str);\n  str[len] = ' ';\n  str[len + 1] = '\u0000';\n  cin >> original;\n  cin >> replace;\n  int i = 0, p = 0, wordlen = 0, j = 0, temp = 0, k, n = 0;\n  int t = 0;\n  while (i < strlen(str)) {\n\n    if (str[i] != ' ') {\n      word[j] = str[i];\n      j++;\n      i++;\n      temp = 1;\n    } else if (temp == 1) {\n      word[j] = '\u0000';\n\n      t = 0;\n      if (strcmp(word, original) == 0) {\n        for (k = 0; k < (i - j); k++) {\n          str2[k] = str[k];\n        }\n        n = 0;\n        while (n < strlen(replace)) {\n          str2[k] = replace[n];\n          n++;\n          k++;\n        }\n        n = i;\n        while (n < strlen(str)) {\n          str2[k] = str[n];\n          n++;\n          k++;\n        }\n        n = 0;\n        while (n < k) {\n          str[n] = str2[n];\n          n++;\n        }\n        str[n] = '\u0000';\n        i = 0;\n      } else {\n        i++;\n      }\n      j = 0;\n      temp = 0;\n    } else if (temp == 0) {\n      i++;\n    }\n  }\n  i = 0;\n  while (i < strlen(str) - 1) {\n    printf(\"%c\", str[i]);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36009", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[100][100] = {'\u0000'}, a[100], b[100];\n  int i = 0, j, k;\n  char(*ps)[100];\n  do {\n    cin >> s[i];\n    i++;\n  } while (getchar() != ' ');\n  k = i;\n  cin >> a;\n  cin >> b;\n  ps = &s[0];\n  for (i = 0; i < k; i++)\n    if (strcmp(*(ps + i), a) == 0) {\n      for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n        *(*(ps + i) + j) = '\u0000';\n      strcpy(*(ps + i), b);\n    }\n  for (j = 0; *(*(ps + 0) + j) != '\u0000'; j++)\n    printf(\"%c\", *(*(ps + 0) + j));\n  for (i = 1; i < k; i++) {\n    printf(\" \");\n\n    for (j = 0; *(*(ps + i) + j) != '\u0000'; j++)\n      printf(\"%c\", *(*(ps + i) + j));\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36010", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[1000], strd[20], strb[20];\n  char zfc[50][200];\n\n  cin >> str;\n\n  int i, k;\n  int j = 0, n = 0;\n\n  for (i = 0; str[i] != '\u0000'; i++) {\n\n    if (str[i] == ' ') {\n      str[i] = '\u0000';\n      strcpy(zfc[n], (str + j));\n      n++;\n      j = i + 1;\n    }\n  }\n  strcpy(zfc[n], (str + j));\n  n++;\n\n  cin >> strb;\n\n  cin >> strd;\n\n  for (k = 0; k < n; k++) {\n\n    if (strcmp(strb, zfc[k]) == 0) {\n      strcpy(zfc[k], strd);\n    }\n  }\n\n  printf(\"%s\", zfc[0]);\n  for (i = 1; i < n; i++) {\n    printf(\" %s\", zfc[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36011", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nchar s[101], a[101], b[101], temp[101];\nvoid judge(void) {\n  if (strcmp(temp, a) == 0)\n    printf(\"%s\", b);\n  else {\n    printf(\"%s\", temp);\n  }\n}\nvoid check(void) {\n  int i, n = strlen(s), p = 0, j;\n  for (i = 0; i < n; i++) {\n    if (s[i] != ' ') {\n      temp[p] = s[i];\n      p++;\n    } else {\n      temp[p + 1] = '\u0000';\n      judge();\n      printf(\" \");\n      for (j = 0; j < p + 2; j++)\n        temp[j] = 0;\n      p = 0;\n    }\n  }\n  temp[p + 1] = '\u0000';\n  judge();\n}\nint main() {\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  check();\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "36012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main(int argc, char *argv[]) {\n  char a[101], t[101];\n  char b[101];\n  char c[101];\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  int found = 0, i, j;\n  memset(t, '\u0000', sizeof(t));\n  for (i = 0, j = 0; a[i - 1] != '\u0000'; i++, j++) {\n    if (a[i] != ' ' && a[i] != '\u0000') {\n      t[j] = a[i];\n    }\n    if (a[i] == ' ' || a[i] == '\u0000') {\n      t[j + 1] = '\u0000';\n      if (strcmp(t, b) == 0) {\n        strcpy(t, c);\n      }\n      if (found++) {\n        cout << \" \";\n      }\n      cout << t;\n      j = -1;\n      memset(t, '\u0000', sizeof(t));\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char s[10000], a[101], b[101];\n  int l0, l1, l2, i, j, k, counter;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  l0 = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  i = 0;\n  if (s[i] == a[0]) {\n    counter = 0;\n    for (j = i + 1; j < i + l1; j++) {\n      if (s[j] != a[j - i])\n        counter++;\n    }\n    if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n      counter++;\n    if (counter == 0) {\n      if (l1 >= l2) {\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n        for (j = i + l1; j <= l0; j++)\n          s[j - (l1 - l2)] = s[j];\n      }\n      if (l2 > l1) {\n        for (j = l0; j >= i + l1; j--)\n          s[j - (l1 - l2)] = s[j];\n        for (j = i; j < i + l2; j++)\n          s[j] = b[j - i];\n      }\n    }\n  }\n  for (i = 1; i < l0; i++) {\n    if (s[i] == a[0]) {\n      counter = 0;\n      for (j = i + 1; j < i + l1; j++) {\n        if (s[j] != a[j - i])\n          counter++;\n      }\n      if (s[i + l1] != ' ' && s[i + l1] != '\u0000')\n        counter++;\n      if (s[i - 1] != ' ')\n        counter++;\n      if (counter == 0) {\n        if (l1 >= l2) {\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n          for (j = i + l1; j <= l0; j++)\n            s[j - (l1 - l2)] = s[j];\n        }\n        if (l2 > l1) {\n          for (j = l0; j >= i + l1; j--)\n            s[j - (l1 - l2)] = s[j];\n          for (j = i; j < i + l2; j++)\n            s[j] = b[j - i];\n        }\n        l0 += l2 - l1;\n      }\n    }\n  }\n  cout << s << \"\\n\";\n  return 0;\n}\n"}
{"label": "19", "index": "36014", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char t[50][100];\n  int s1, n, i, j, m;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  s1 = strlen(s);\n  for (i = 0, n = 1; i < s1; i++)\n    if (s[i] == ' ')\n      n++;\n  for (i = 0, m = 0; i < n; i++) {\n    for (j = 0;; j++) {\n      if (s[m + j] == ' ') {\n        t[i][j] = '\u0000';\n        m = m + j + 1;\n        break;\n      } else\n        t[i][j] = s[m + j];\n    }\n  }\n  for (i = 0; i < n; i++)\n    if (strcmp(t[i], a) == 0)\n      strcpy(t[i], b);\n    else\n      strcpy(t[i], t[i]);\n  for (i = 0; i < n - 1; i++)\n    cout << t[i] << \" \";\n  printf(\"%s \", t[n - 1]);\n}\n"}
{"label": "19", "index": "36015", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int lenth1, lenthw1, lenthw2, i, j, num = 0, row = 0, flag, a[101];\n  char s1[101], word[101], wordnew[101], olds1[101][101];\n  cin.getline(s1, 101);\n  cin >> word;\n  cin >> wordnew;\n  lenth1 = strlen(s1);\n  lenthw1 = strlen(word);\n  lenthw2 = strlen(wordnew);\n  for (i = 0; i < lenth1; i++) {\n    if (s1[i] == ' ') {\n      num++;\n      row = 0;\n    } else {\n      olds1[num][row] = s1[i];\n      a[num] = row;\n      row++;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    flag = 1;\n    for (j = 0; j < lenthw1; j++) {\n      if (olds1[i][j] != word[j])\n        flag = 0;\n    }\n    if (flag == 1) {\n      a[i] = lenthw2 - 1;\n      for (j = 0; j < lenthw2; j++)\n        olds1[i][j] = wordnew[j];\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; j <= a[i]; j++)\n      cout << olds1[i][j];\n    printf(\" \");\n  }\n  for (j = 0; j <= a[num]; j++)\n    printf(\"%c\", olds1[num][j]);\n  return 0;\n}\n"}
{"label": "19", "index": "36016", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str1[20], str2[20], *p, str3[40][20], STR[100] = \"\";\n  int i, k, m, x;\n  cin >> str;\n  scanf(\"%s \", str1);\n  cin >> str2;\n  k = 0;\n  m = 0;\n  for (p = str; *p != '\u0000'; p++) {\n    str3[k][m] = *p;\n    m++;\n    if (isalpha(*p) * isalpha(*(p + 1)) == 0) {\n      str3[k][m] = '\u0000';\n      k++;\n      m = 0;\n    }\n  }\n  str3[k][m] = '\u0000';\n  x = k;\n  for (i = 0; i <= k; i++) {\n    if (strcmp(str3[i], str1) == 0)\n      strcpy(str3[i], str2);\n  }\n  for (i = 0; i <= k; i++) {\n    strcat(STR, str3[i]);\n  }\n  printf(\"%s\", STR);\n  return 0;\n}\n"}
{"label": "19", "index": "36017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, s, k, l, m, n, v = 0;\n  char a[202], b[102], c[102];\n  cin.getline(a, 202);\n  cin.getline(b, 102);\n  cin.getline(c, 102);\n  l = strlen(c);\n  m = strlen(a);\n  n = strlen(b);\n  for (j = 0; j < m;) {\n    k = 0;\n    if ((j == 0) || ((j > 0) && (a[j - 1] == ' '))) {\n      for (i = j; i < j + n; i++)\n        if (a[i] == b[i - j])\n          k++;\n      if ((k == n) && (a[j + n] != ' ') && (a[j + n] != '\\0'))\n        k = 0;\n    } \n\n    if (k == n) {\n      if (l > n)\n        for (s = 0; s < l - n; s++)\n          for (i = m + s; i >= j + n + s; i--)\n            a[i + 1] = a[i]; \n      if (l < n) {\n        for (s = 0; s < n - l; s++)\n          for (i = j + n - s - 1; i < m - s; i++)\n            a[i] = a[i + 1];\n        for (i = m + l - n; i < m; i++)\n          a[i] = '\\0';\n      }\n      for (i = j; i < j + l; i++)\n        a[i] = c[i - j];\n      j += l; \n      m = m + l - n;\n    } else\n      j++;\n  }\n  for (i = 0; i < m; i++)\n    cout << a[i];\n  cout << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "36018", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p[200], *p1, *p2;\n  int i = 0, n, j;\n  for (i = 0; i < 200; i++)\n    p[i] = (char *)malloc(100 * sizeof(char));\n  i = 0;\n  for (j = 0; (*(p[i] + j) = getchar()) != '\\n'; j++) {\n    if (*(p[i] + j) == ' ') {\n      *(p[i] + j) = '\\0';\n      i++;\n      j = -1;\n    }\n  }\n  *(p[i] + j) = '\\0';\n  n = i;\n  p1 = (char *)malloc(100 * sizeof(char));\n  p2 = (char *)malloc(100 * sizeof(char));\n  scanf(\"%s\\n%s\", p1, p2);\n  for (i = 0; i <= n; i++) {\n    if (strcmp(p[i], p1) == 0) {\n      strcpy(p[i], p2);\n    }\n  }\n  printf(\"%s\", p[0]);\n  for (i = 1; i <= n; i++) {\n    printf(\" %s\", p[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[100][100], bth[100], th[100], s[100];\n  int i, e, j = 0, t = 0, p;\n\n  scanf(\"%s \", s);\n\n  cin >> bth;\n\n  scanf(\"%s \", th);\n  e = strlen(s);\n  for (i = 0; i < 100; i++) {\n    for (p = 0; p < 100; p++) {\n      zfc[i][p] = 0;\n    }\n  }\n  for (i = 0; i < e; i++) {\n    if (s[i] != ' ') {\n      zfc[j][t] = s[i];\n      t++;\n    } else {\n      j++;\n      t = 0;\n    }\n  }\n\n  for (i = 0; i < j; i++) {\n    if (strcmp(zfc[i], bth) == 0) {\n      cout << th << \" \";\n    } else {\n      printf(\"%s \", zfc[i]);\n    }\n  }\n  if (strcmp(zfc[j], bth) == 0) {\n    printf(\"%s\", th);\n  } else {\n    printf(\"%s\", zfc[j]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36020", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], s1[101], s2[101], s4[101];\n  cin >> s;\n  cin >> s1;\n  scanf(\"%s \", s2);\n  char s3[100][101];\n  char *p;\n  char(*p3)[101];\n  int n, i;\n  n = strlen(s);\n  p = s;\n  p3 = s3;\n  i = 0;\n  for (p = s; p <= (s + n); p++) {\n    if ((*p == ' ') || (*p == '\u0000')) {\n      *((*p3) + i) = '\u0000';\n      p3++;\n      i = 0;\n    } else {\n      *((*p3) + i) = *p;\n      i++;\n    }\n  }\n  *((*p3)) = '\u0000';\n  for (p3 = s3; *((*p3)) != '\u0000'; p3++) {\n    if (strcmp(*p3, s1) == 0) {\n      strcpy(*p3, s2);\n    }\n  }\n  p3 = s3;\n  strcpy(s4, *p3);\n  for (p3 = s3 + 1; *((*p3)) != '\u0000'; p3++) {\n    strcat(s4, \" \");\n    strcat(s4, *p3);\n  }\n  puts(s4);\n  return 0;\n}\n"}
{"label": "19", "index": "36021", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar str[100][100];\nchar s[100], t[100];\nchar c;\n\nint main() {\n  int cnt = 0;\n  while (1) {\n    cin >> str[cnt++];\n    if (getchar() == '\\n')\n      break;\n  }\n  scanf(\"%s\", s);\n  scanf(\"%s\", t);\n  for (int i = 0; i < cnt; i++) {\n    if (strcmp(str[i], s) == 0)\n      strcpy(str[i], t);\n  }\n  for (int i = 0; i < cnt - 1; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\\n\", str[cnt - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int na, nb, nc, i, j, k, p, num = 0;\n\n  char a[1000], b[100], c[100];\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  na = strlen(a);\n  nb = strlen(b);\n  nc = strlen(c);\n\n  for (i = 0; i < 1000; i++) {\n    for (j = 0; j < nb; j++)\n      if (*(a + i + j) != *(b + j))\n        break;\n    if ((j == nb && *(a + i + nb) == ' ' && *(a + i - 1) == ' ') ||\n        (j == nb && i == 0 && *(a + i + nb) == ' ') ||\n        (j == nb && i == na + num * (nc - nb) - nb && *(a + i - 1) == ' ')) {\n      num++;\n      if (nb >= nc) {\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n        for (p = 0; p < na + num * (nc - nb); p++)\n          *(a + i + nc + p) = *(a + i + nb + p);\n      }\n      if (nb < nc) {\n        for (p = ((nc - nb) * num + na - 1); p > i + nb - 1; p--) {\n          *(a + p) = *(a + p - (nc - nb));\n        }\n        for (k = 0; k < nc; k++)\n          *(a + i + k) = *(c + k);\n      }\n    }\n  }\n  for (i = 0; i < (na + num * (nc - nb)); i++)\n    printf(\"%c\", *(a + i));\n}\n"}
{"label": "19", "index": "36023", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, l, ll, ll2;\n  char a[100];\n  char aa[100];\n  char bb[100];\n  char h[100][100];\n  int c[100];\n  for (i = 0; i < 100; i++) {\n    c[i] = 0;\n  }\n  scanf(\"%s \", a);\n  cin >> aa;\n  cin >> bb;\n  l = strlen(a);\n  ll = strlen(aa);\n  ll2 = strlen(bb);\n  int n = 0;\n  for (i = 0; a[i] != '\u0000'; i++) {\n    if (a[i] == ' ') {\n      n = n + 1;\n    }\n  }\n  int b[50];\n  for (i = 0; i < n; i++) {\n    for (j = 0; a[j] != '\u0000'; j++) {\n      if (a[j] == ' ' && c[j] == 0) {\n        b[i] = j;\n        c[j] = 1;\n        break;\n      }\n    }\n  }\n  int d[50];\n  d[0] = b[0];\n  for (i = 1; i < n; i++) {\n    d[i] = b[i] - b[i - 1] - 1;\n  }\n  d[n] = l - b[n - 1] - 1;\n  for (i = 1; i < n; i++) {\n    for (j = b[i - 1] + 1; j < b[i]; j++) {\n      h[i][j - b[i - 1] - 1] = a[j];\n    }\n  }\n  for (j = 0; j < b[0]; j++) {\n    h[0][j] = a[j];\n  }\n  for (j = b[n - 1] + 1; j < l; j++) {\n    h[n][j - b[n - 1] - 1] = a[j];\n  }\n  for (i = 0; i <= n; i++) {\n    if (d[i] == ll) {\n      int t = 0;\n      for (j = 0; j < d[i]; j++) {\n        if (h[i][j] == aa[j]) {\n          t = t + 1;\n        }\n      }\n      if (t == d[i]) {\n        d[i] = ll2;\n        for (j = 0; j < ll2; j++) {\n          h[i][j] = bb[j];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < d[i]; j++) {\n      if (j != d[i] - 1) {\n        printf(\"%c\", h[i][j]);\n      } else if (j == d[i] - 1) {\n        printf(\"%c \", h[i][j]);\n      }\n    }\n  }\n  for (j = 0; j < d[n]; j++) {\n    if (j != d[n] - 1) {\n      cout << h[n][j];\n    } else if (j == d[i] - 1) {\n      printf(\"%c \", h[n][j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36024", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[20][15], b[15], c[15], d;\n  int i, j;\n  for (i = 0, d = ' '; d != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n  }\n  j = i;\n  scanf(\"%s\", b);\n  cin >> c;\n  for (i = 0; i <= j - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i <= j - 2; i++) {\n    printf(\"%s \", a[i]);\n  }\n  cout << a[j - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "36025", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char *p1, *p2, *p3, *p4;\n  int n1, n2, n3, flag = 1;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  n1 = strlen(s);\n  n2 = strlen(a);\n  n3 = strlen(b);\n  while (p1 < s + n1) {\n    p2 = a;\n    p3 = b;\n    if (isalpha(*p1)) {\n      if (flag) {\n        flag = 0;\n        for (p4 = p1; p2 < a + n2; p4++, p2++)\n          if (*p4 != *p2)\n            break;\n        if ((p2 - a) == n2) {\n          for (; p3 < b + n3; p3++)\n            printf(\"%c\", *p3);\n          p1 = p1 + n2;\n        } else {\n          for (; isalpha(*p1); p1++)\n            cout << *p1;\n        }\n      }\n    } else {\n      cout << \" \";\n      flag = 1;\n      p1++;\n    }\n  }\n}\n"}
{"label": "19", "index": "36026", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[1000];\n  char word[100][100];\n  char sub[100];\n  char w[100];\n  int i, n, k;\n\n  cin >> a;\n\n  scanf(\"%s \", w);\n\n  cin >> sub;\n\n  n = 0;\n  k = 0;\n  for (i = 0; a[i] != 0; i++) {\n\n    if (a[i] == ' ') {\n      a[i] = '\u0000';\n      strcpy(word[n], (a + k));\n\n      k = i + 1;\n      n++;\n    }\n  }\n  strcpy(word[n], (a + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(word[i], w) == 0) {\n\n      strcpy(word[i], sub);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n\n    printf(\"%s \", word[i]);\n  }\n  puts(word[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36027", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char zfc[200] = {0}, a[100] = {0}, b[100] = {0};\n  char c[50][50] = {0};\n  int i = 0, j, k = 0, n = 0;\n\n  cin >> zfc;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; zfc[i] != ' ' && zfc[i] != 0; i++) {\n    for (k = 0; zfc[i] != ' ' && zfc[i] != 0; i++, k++) {\n      c[n][k] = zfc[i];\n    }\n    n++;\n  }\n  for (j = 0; j < n - 1; j++) {\n    if (strcmp(c[j], a) == 0) {\n      strcpy(c[j], b);\n    }\n    printf(\"%s \", c[j]);\n  }\n  if (strcmp(c[n - 1], a) == 0) {\n    strcpy(c[n - 1], b);\n  }\n  printf(\"%s\", c[n - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36028", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, tag = 1, flag = 1, e = 0;\n  char q[101], tmp[50][101], p[101], t[101];\n\n  cin >> q;\n\n  cin >> p;\n\n  cin >> t;\n  for (i = 0; i < 50; i++) {\n    k = 0;\n    flag = 1;\n    for (j = e; j < 101; j++) {\n      if (q[j] != ' ' && q[j] != ',' && q[j] != '\u0000') {\n        tmp[i][k] = q[j];\n        k++;\n      } else if (q[j] == ' ') {\n        tmp[i][k] = '\u0000';\n        e = j + 1;\n        break;\n      } else if (q[j] == ',') {\n        tmp[i][k] = '\u0000';\n        e = j + 2;\n        break;\n      } else if (q[j] == '\u0000') {\n        tmp[i][k] = '\u0000';\n        tag = 0;\n        break;\n      }\n    }\n    for (j = 0; j < 101; j++) {\n      if (tmp[i][j] != p[j] && p[j] != '\u0000') {\n        flag = 0;\n        break;\n      } else if (tmp[i][j] == p[j] && p[j] != '\u0000')\n        continue;\n      else if (p[j] == '\u0000')\n        break;\n    }\n    if (tag == 1 && flag == 0 && i > 0)\n      printf(\" %s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i > 0)\n      printf(\" %s\", t);\n    else if (tag == 0 && flag == 0 && i > 0) {\n      printf(\" %s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i > 0) {\n      printf(\" %s\", t);\n      break;\n    } else if (tag == 1 && flag == 0 && i == 0)\n      printf(\"%s\", tmp[i]);\n    else if (tag == 1 && flag == 1 && i == 0)\n      printf(\"%s\", t);\n    else if (tag == 0 && flag == 0 && i == 0) {\n      printf(\"%s\", tmp[i]);\n      break;\n    } else if (tag == 0 && flag == 1 && i == 0) {\n      printf(\"%s\", t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "36029", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[101], word1[101], word2[101], danci[50][101];\n  int LEN[50], LEN1, i, k = 0, j = 0;\n\n  cin >> sen;\n\n  cin >> word1;\n\n  cin >> word2;\n  LEN1 = strlen(sen);\n  for (i = 0; i < LEN1; i++) {\n    if (sen[i] != ' ') {\n      danci[j][k] = sen[i];\n      k++;\n    } else {\n      danci[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  danci[j][k] = '\u0000';\n  for (i = 0; i < j; i++) {\n    LEN[i] = strlen(danci[i]);\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(danci[i], word1) == 0) {\n      strcpy(danci[i], word2);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", danci[i]);\n  }\n  printf(\"%s \", danci[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "36030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar s[100];\nchar a[100];\nchar b[100];\nint len1, len2, len3;\nint i;\nint check(int place);\nvoid output(void);\nint main(void) {\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  len1 = strlen(s);\n  len2 = strlen(a);\n  len3 = strlen(b);\n  for (i = 0; i < len1; i++) {\n    if (check(i)) {\n      output();\n      i += len2 - 1;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n}\nint check(int place) {\n  int num = 0;\n  int ctr = 0;\n  if (place > 0 && s[place - 1] != ' ')\n    return 0;\n  for (ctr = 0; ctr < len2; ctr++) {\n    if (s[place + ctr] == a[ctr])\n      num++;\n  }\n  if (num == len2)\n    return 1;\n  else\n    return 0;\n}\nvoid output(void) {\n  int ctr1;\n  for (ctr1 = 0; ctr1 < len3; ctr1++) {\n    printf(\"%c\", b[ctr1]);\n  }\n}\n"}
{"label": "19", "index": "36031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  char x[100][100];\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s\", x[i]);\n    if (strlen(x[i]) == 0) {\n      break;\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    if (strcmp(x[i], x[n - 2]) == 0)\n      strcpy(x[i], x[n - 1]);\n  }\n  printf(\"%s\", x[0]);\n  for (i = 1; i < n - 2; i++)\n    printf(\" %s\", x[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "36032", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint cincd(char a[]) {\n  int num = 0;\n  for (int i = 0;; i++) {\n    a[i] = getchar();\n    if (a[i] == '\\n')\n      break;\n    num++;\n  }\n  return num;\n}\nvoid coutt(char a[], int length) {\n  for (int i = 0; i < length; i++) {\n    cout << a[i];\n  }\n}\nint main() {\n  char a[100][20], b[100], c[100];\n  int x = 0, d[100], e, f, num = 0;\n  for (int j = 0;; j++) {\n    a[x][j] = getchar();\n    if (a[x][j] == '\\n') {\n      d[x] = j;\n      num = x + 1;\n      break;\n    }\n    if (a[x][j] == ' ') {\n      d[x] = j;\n      x++;\n      j = -1;\n    }\n  }\n  e = cincd(b);\n  f = cincd(c);\n  for (int i = 0; i < num; i++) {\n    if (i != 0)\n      printf(\" \");\n    if (d[i] == e) {\n      int length = 0;\n      for (int j = 0; j < e; j++) {\n        if (a[i][j] == b[j])\n          length++;\n      }\n      if (length == e)\n        coutt(c, f);\n      else\n        coutt(a[i], d[i]);\n      continue;\n    } else\n      coutt(a[i], d[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36033", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char string[100], word[50][15], subword[15], subed[15];\n\n  scanf(\"%s \", string);\n  cin >> subed >> subword;\n  char *p = string;\n  int i = 0, j;\n  while (*p != '\u0000') {\n    sscanf(p, \"%s\", word[i]);\n    p += strlen(word[i]);\n    i++;\n    if (*p == ' ')\n      p++;\n  }\n  for (j = 0; j < i; j++)\n    if (strcmp(word[j], subed) == 0)\n      strcpy(word[j], subword);\n  printf(\"%s\", word[0]);\n  for (j = 1; j < i; j++)\n    printf(\" %s\", word[j]);\n}\n"}
{"label": "19", "index": "36034", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[100], b[100], c[100], d[10000];\n  int i = 0, j = 0, k, la, lb, lc, s = 0;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n\n  cin >> c;\n  la = strlen(a);\n  lb = strlen(b);\n  lc = strlen(c);\n  for (i = 0; i < la; i++) {\n    for (k = 0, s = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        s = s + 1;\n      i = i + 1;\n    }\n\n    if ((a[i - k - 1] == ' ') && (s == lb) || ((i - k == 0) && (s == lb))) {\n      i = i - 1;\n      for (k = 0; k < lc; k = k + 1) {\n        d[j] = c[k];\n        j = j + 1;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j = j + 1;\n    }\n  }\n  cout << d;\n}\n"}
{"label": "19", "index": "36035", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000];\n  char *p1, *p2, *p3, *q1, *q, *q2;\n  int S, A, i, j;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  S = strlen(s);\n  A = strlen(a);\n\n  q = p1 = s;\n  q2 = p2 = a;\n  p3 = b;\n\n  for (i = 0; i < S; i++, p1++)\n    if (*p1 == *p2 && (*(p1 - 1) == ' ' || p1 == s)) {\n      q1 = p1;\n      for (j = 0; j < A; j++, p2++, p1++)\n        if (*p1 != *p2)\n          break;\n        else if (j == A - 1 && (*(p1 + 1) == ' ' || *(p1 + 1) == '\u0000')) {\n          for (; q < q1; q++)\n            printf(\"%c\", *q);\n          printf(\"%s\", p3);\n          q = p1 + 1;\n        }\n      p2 = q2;\n    } else if (i == S - 1)\n      printf(\"%s\", q);\n}\n"}
{"label": "19", "index": "36036", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[123], a[20], b[20], danci[50][20], *ss = s, *aa = a, *bb = b, *p1, *p2,\n                                            *word[50];\n  int i, j = 0, num;\n  for (i = 0; i < 50; i++)\n    word[i] = danci[i];\n  scanf(\"%s \", ss);\n  scanf(\"%s \", aa);\n  cin >> bb;\n  for (p1 = p2 = s;; p1++) {\n    if (*p1 == ' ' || *p1 == '\u0000') {\n      strncpy(word[j], p2, p1 - p2);\n      *(word[j] + (p1 - p2)) = '\u0000';\n      p2 = p1 + 1;\n      j++;\n      if (*p1 == '\u0000')\n        break;\n    }\n  }\n  num = j;\n  for (j = 0; j < num; j++) {\n    if (!strcmp(word[j], aa))\n      strcpy(word[j], bb);\n  }\n  for (j = 0; j < num - 1; j++)\n    printf(\"%s \", word[j]);\n  printf(\"%s\", word[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "36037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char d[256];\n  char words[50][256] = {0};\n  char a[100], b[100];\n  int n = 1, flag = 1;\n  int i, j, k = -1, l;\n\n  cin >> d;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; d[i] != '\u0000'; i++) {\n    if (d[i] == ' ')\n      n++;\n  }\n  for (i = 0; i < n; i++) {\n    for (k = k + 1, j = 0; d[k] != '\u0000' && d[k] != ' '; j++, k++) {\n      words[i][j] = d[k];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    l = strcmp(words[i], a);\n\n    if (l == 0) {\n      strcpy(words[i], b);\n      flag = 0;\n    }\n  }\n\n  if (flag == 0) {\n    cout << words[0];\n    for (i = 1; i < n; i++)\n      printf(\" %s\", words[i]);\n  }\n  if (flag == 1) {\n    printf(\"%s\", d);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36038", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int k, i, j, r, h, l, m, n, p, q;\n  char s[101], a[101], b[101], c[101];\n  cin.getline(s, 101);\n  cin >> a >> b;\n  k = strlen(s);\n  i = strlen(a);\n  j = strlen(b);\n  for (r = 0; r <= k - i + 1; r++) {\n    for (h = r, l = 0; h < r + i; h++, l++)\n      if (s[h] != a[l]) {\n        break;\n      }\n    if (l == i && ((r == 0 && s[r + i] == ' ') ||\n                   (r > 0 && s[r - 1] == ' ' && s[r + i] == ' ') ||\n                   (r + i == k && s[r - 1] == ' '))) {\n      for (m = 0, n = r + i; m <= k - r - i; m++, n++) {\n        c[m] = s[n];\n      }\n      for (p = 0, q = r; p <= j; p++, q++)\n        s[q] = b[p];\n      strcat(s, c);\n      k = k - i + j;\n      r = r + j;\n    }\n  }\n  printf(\"%s\\n\", s);\n  return 0;\n}\n"}
{"label": "19", "index": "36039", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  char d[50][100];\n\n  cin >> a;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n\n  int chang, i, n, m;\n  int u = 0, v = 0;\n  chang = strlen(a);\n\n  for (i = 0; i < chang; i++) {\n    if (a[i] != ' ') {\n      d[u][v] = a[i];\n      v++;\n    } else {\n      v = 0;\n      u++;\n    }\n  }\n\n  for (i = 0; i < u; i++) {\n    if (strcmp(b, d[i]) == 0) {\n      printf(\"%s \", c);\n    } else {\n      printf(\"%s \", d[i]);\n    }\n  }\n\n  if (strcmp(b, d[i]) == 0) {\n    printf(\"%s\", c);\n  } else {\n    printf(\"%s\", d[u]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36040", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[101], b[101], c[101], d[10001];\n  cin.getline(a, 101);\n  scanf(\"%s \", b);\n  scanf(\"%s \", c);\n  int la = strlen(a);\n  int lb = strlen(b);\n  int lc = strlen(c);\n  int i, j = 0, k, num;\n  for (i = 0; i < la; i++) {\n    for (k = 0, num = 0; k < lb; k++) {\n      if (a[i] == b[k])\n        num++;\n      i++;\n    }\n    if (((num == lb) && (a[i - k - 1] == ' ')) || ((num == lb) && (i == k))) {\n      i = i - 1;\n      for (k = 0; k < lc; k++) {\n        d[j] = c[k];\n        j++;\n      }\n    } else {\n      i = i - k;\n      d[j] = a[i];\n      j++;\n    }\n  }\n  cout << d << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "36041", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[200], a[100], b[100], w[100][20];\n  int len;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  len = strlen(s);\n  int i, j, n = 0, k = 0;\n  for (i = 0; i <= len; i++) {\n    if (s[i] == 32) {\n      w[n][k] = '\u0000';\n      n++;\n      k = 0;\n    } else {\n      w[n][k] = s[i];\n      k++;\n    }\n  }\n  for (j = 0; j <= n; j++) {\n    if (strcmp(w[j], a) == 0) {\n      strcpy(w[j], b);\n    }\n    if (j == 0) {\n      printf(\"%s\", w[j]);\n    } else {\n      printf(\" %s\", w[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char n[5000];\n  char m[100][20];\n  char s1[20], s2[20];\n\n  cin >> n;\n  cin >> s1;\n  cin >> s2;\n  int i, j = 0, k = 0, e;\n  e = strlen(n);\n  for (i = 0; i < e; i++) {\n    if (n[i] != ' ') {\n      m[j][k] = n[i];\n      k++;\n    }\n    if (n[i] == ' ') {\n      m[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  m[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(m[i], s1) == 0)\n      strcpy(m[i], s2);\n  }\n\n  printf(\"%s\", m[0]);\n  for (i = 1; i <= j; i++) {\n\n    cout << \" \" << m[i];\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36043", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, p = 0, k;\n  char *s, *ch, *a, *b;\n  s = (char *)malloc(100 * sizeof(char));\n  ch = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  for (i = 0; i < 100; i++)\n    *(s + i) = '\u0000';\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  for (i = 0; *(s + i) != '\u0000'; i++) {\n    for (j = 0; (*(s + i) != ' ' && *(s + i) != '\u0000'); i++, j++)\n      *(ch + j) = *(s + i);\n    *(ch + j) = '\u0000';\n    if (strcmp(ch, a) == 0)\n      strcpy(ch, b);\n    if (p > 0)\n      printf(\" \");\n    printf(\"%s\", ch);\n    for (k = 0; k <= j; k++)\n      *(ch + k) = '\u0000';\n    p++;\n  }\n}\n"}
{"label": "19", "index": "36044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char s1[100];\n  char s2[100];\n\n  cin >> s;\n\n  cin >> s1;\n\n  cin >> s2;\n  char *p2 = s;\n  while (*p2 != '\u0000') {\n    int i = 0;\n    char temp[100];\n    for (i = 0; i <= 99; i++)\n      temp[i] = '\u0000';\n\n    i = 0;\n    do {\n      temp[i] = *p2;\n      p2++;\n      i++;\n    } while (*p2 != ' ' && *p2 != '\u0000');\n    if (strcmp(s1, temp) == 0)\n      printf(\"%s\", s2);\n    else\n      printf(\"%s\", temp);\n    if (*p2 == ' ') {\n      p2++;\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36045", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100], c[100];\n  int i = 0;\n  int len = 0;\n  for (i = 0; i <= 99; i++) {\n    cin >> a[i];\n    len++;\n    if (cin.get() == '\\n')\n      break;\n  }\n  cin >> b >> c;\n  for (i = 0; i <= len - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n    if (i >= 1)\n      cout << \" \";\n    printf(\"%s\", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c = ' ';\n  char *str1, *str2;\n  str1 = (char *)malloc(100 * sizeof(char));\n  str2 = (char *)malloc(100 * sizeof(char));\n\n  char str[100][100];\n  int i, n = 0;\n  for (i = 0; i < 100; i++) {\n    strcpy(str[i], \"\\0\");\n    scanf(\"%s\", str[i]);\n    if (c = getchar() != ' ')\n      break;\n    n++;\n  }\n  strcpy(str1, \"\\0\");\n  strcpy(str2, \"\\0\");\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n\n  for (i = 0; i <= n; i++) {\n    if (strcmp(str1, str[i]) == 0)\n      strcpy(str[i], str2);\n  }\n  for (i = 0; i <= n - 1; i++)\n    printf(\"%s \", str[i]);\n  printf(\"%s\", str[n]);\n}\n"}
{"label": "19", "index": "36047", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint n, m, k;\nchar a[110];\nchar from[110], to[110];\nint main() {\n  while (cin >> a) {\n    char temp[110];\n    temp[0] = 0;\n    int c = 0;\n    cin >> from >> to;\n    for (int i = 0; a[i]; i++) {\n      if (a[i] == ' ') {\n        if (strcmp(temp, from) == 0) {\n          printf(\"%s \", to);\n        } else\n          printf(\"%s \", temp);\n        temp[0] = 0;\n        c = 0;\n\n      } else {\n        temp[c++] = a[i];\n        temp[c] = 0;\n      }\n    }\n    if (strcmp(temp, from) == 0) {\n      printf(\"%s \", to);\n    } else\n      printf(\"%s \", temp);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *s, *a, *b, *word;\n  int i, j = 0, flag = 0;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n  word = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  i = 0;\n  while (*(s + i)) {\n    if (*(s + i) == ' ') {\n      if (flag != 0)\n        printf(\" \");\n      flag = 1;\n      *(word + j) = '\u0000';\n      j = 0;\n      if (strcmp(word, a) == 0)\n        printf(\"%s\", b);\n      else\n        printf(\"%s\", word);\n    } else {\n      *(word + j) = *(s + i);\n      j++;\n    }\n    i++;\n  }\n  *(word + j) = '\u0000';\n  if (flag != 0)\n    printf(\" \");\n  if (strcmp(word, a) == 0)\n    printf(\"%s\", b);\n  else\n    printf(\"%s\", word);\n}\n"}
{"label": "19", "index": "36049", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101], word[101];\n  int i = 0, j, flag, n = 0;\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  scanf(\"%s \", b);\n  while (s[i - 1] != 0 || i == 0) {\n    while (s[i] != ' ' && s[i] != 0) {\n      word[i - n] = s[i];\n      i++;\n    }\n    word[i - n] = 0;\n    flag = 1;\n    for (j = 0; j <= strlen(a); j++)\n      if (a[j] != word[j])\n        flag = 0;\n    if (flag)\n      cout << b;\n    else\n      printf(\"%s\", word);\n    if (s[i] != 0)\n      printf(\"%c\", s[i]);\n    i++;\n    n = i;\n  }\n}\n"}
{"label": "19", "index": "36050", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[20][20], a[20], b[20], *p1, *p2, *p[20];\n  int i = 0, j;\n  for (i = 0; i < 20; i++)\n    p[i] = str[i];\n  i = 0;\n  while (1) {\n    scanf(\"%s\", str[i]);\n    if (getchar() == '\\n')\n      break;\n    i++;\n  }\n  scanf(\"%s %s \", a, b);\n  p1 = a;\n  p2 = b;\n  for (j = 0; j <= i; j++)\n    if (strcmp(p[j], p1) == 0)\n      p[j] = p2;\n\n  for (j = 0; j <= i; j++) {\n    if (j == 0)\n      printf(\"%s\", p[j]);\n    else\n      printf(\" %s\", p[j]);\n  }\n}\n"}
{"label": "19", "index": "36051", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[100], word1[100], word2[100];\n  int n = 0;\n  int i, j;\n\n  scanf(\"%s \", str1);\n  scanf(\"%s %s\", word1, word2);\n  for (i = 0; i < (int)(strlen(str1)); i++) {\n    for (j = i; j < i + (int)(strlen(word1)); j++) {\n      if (str1[j] != word1[j - i])\n        break;\n      n = n + 1;\n    }\n    if (i == 0 && n == (int)(strlen(word1))) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else if (n == (int)(strlen(word1)) &&\n               (str1[i + n] == 32 || str1[i + n] == '\u0000') && str1[i - 1] == 32) {\n      printf(\"%s \", word2);\n      i = i + (int)(strlen(word1));\n    } else\n      printf(\"%c\", str1[i]);\n    n = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36052", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint check(char *p, char a[], int l) {\n  int i;\n  for (i = 0; i < l; i++)\n    if (*(p + i) != a[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char s[200], r[200], a[101], b[101];\n  int i = 0, j, ls, la, lb, count = 0, p = 1;\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  if (a[0] == s[0])\n    if (check(&s[0], a, la) == 1 && s[i + la] == ' ') {\n      for (j = 0; j < lb; j++) {\n        r[count] = b[j];\n        count++;\n      }\n      p = i + la;\n\n    } else {\n      r[count] = s[0];\n      count++;\n    }\n  else {\n    r[count] = s[0];\n    count++;\n  }\n  for (i = p; i < ls; i++) {\n    if (a[0] == s[i])\n      if (check(&s[i], a, la) == 1 &&\n          (s[i - 1] == ' ' && (s[i + la] == ' ' || s[i + la] == '\u0000'))) {\n        for (j = 0; j < lb; j++) {\n          r[count] = b[j];\n          count++;\n        }\n        i = i + la - 1;\n        continue;\n      } else {\n        r[count] = s[i];\n        count++;\n        continue;\n      }\n    else {\n      r[count] = s[i];\n      count++;\n    }\n  }\n  r[count] = '\u0000';\n  printf(\"%s\", r);\n  return 0;\n}\n"}
{"label": "19", "index": "36053", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[105], b[105], s[105], c[105][105];\n  int i, len, startp, endp, cur_c, k;\n\n  scanf(\"%s \", s);\n  scanf(\"%s %s \", a, b);\n  len = strlen(s);\n  startp = 0;\n  endp = 1, cur_c = 0;\n  while (endp <= len) {\n    if (s[endp] == ' ' || s[endp] == '\u0000') {\n      for (i = startp, k = 0; i <= endp - 1; i++, k++)\n        c[cur_c][k] = s[i];\n      c[cur_c][k + 1] = '\u0000';\n      cur_c++;\n      startp = endp + 1;\n      endp = startp + 1;\n    } else\n      endp++;\n  }\n  for (i = 0; i < cur_c; i++)\n    if (!strcmp(a, c[i]))\n      strcpy(c[i], b);\n  cout << c[0];\n  for (i = 1; i < cur_c; i++)\n    cout << ' ' << c[i];\n  cout << endl;\n}\n"}
{"label": "19", "index": "36054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\u0000'}, b[100] = {'\u0000'}, c[100] = {'\u0000'}, d[100] = {'\u0000'};\n  int h, i, j, k, m, n, r;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  m = strlen(b);\n  n = strlen(c);\n  for (h = 0, i = 0; *(a + i) != '\u0000';) {\n    if ((*(a + i) == *b) &&\n        ((i >= 1 && *(a + i - 1) == ' ' &&\n          (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')) ||\n         (i == 0 && (*(a + i + m) == ' ' || *(a + i + m) == '\u0000')))) {\n      r = i;\n      for (j = 0; j < m; j++)\n        if (*(a + r + j) != *(b + j))\n          break;\n      if (j == m) {\n        for (k = 0; k < n; k++) {\n          *(d + h) = *(c + k);\n          h++;\n          i++;\n        }\n        i = i + m - n;\n        continue;\n      }\n    }\n    *(d + h) = *(a + i);\n    h++;\n    i++;\n  }\n  puts(d);\n}\n"}
{"label": "19", "index": "36055", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[20][15], b[15], c[15], d;\n  int i, j;\n  for (i = 0, d = ' '; d != '\\n'; i++) {\n    scanf(\"%s\", a[i]);\n    scanf(\"%c\", &d);\n  }\n  j = i;\n  scanf(\"%s\", b);\n  scanf(\"%s\", c);\n  for (i = 0; i <= j - 1; i++) {\n    if (strcmp(a[i], b) == 0)\n      strcpy(a[i], c);\n  }\n  for (i = 0; i <= j - 2; i++) {\n    printf(\"%s \", a[i]);\n  }\n  printf(\"%s\", a[j - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36056", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char zfc[100][100];\n  int i, j, len, k = 1, wz[100];\n\n  cin >> s;\n  cin >> a >> b;\n  len = strlen(s);\n  wz[0] = 0 - 1;\n  for (i = 0; i < len; i++) {\n    if (s[i] == ' ') {\n      wz[k] = i;\n      k++;\n    }\n  }\n  wz[k] = len;\n  for (i = 0; i < k; i++) {\n    for (j = wz[i] + 1; j < wz[i + 1]; j++)\n      zfc[i][j - wz[i] - 1] = s[j];\n    zfc[i][j - wz[i] - 1] = '\u0000';\n  }\n  if (strcmp(zfc[0], a) != 0) {\n    printf(\"%s\", zfc[0]);\n\n  } else {\n    printf(\"%s\", b);\n  }\n\n  for (i = 1; i < k; i++) {\n    if (strcmp(zfc[i], a) != 0) {\n      printf(\" %s\", zfc[i]);\n\n    } else {\n      cout << \" \" << b;\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36057", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[50][100];\n  int i, j, l = 0;\n  while (cin >> s[l++])\n    ;\n  l--;\n  for (i = 0; i < l - 2; i++) {\n    if (strcmp(s[i], s[l - 2]) == 0) {\n      for (j = 0; j <= strlen(s[l - 1]); j++)\n        s[i][j] = s[l - 1][j];\n    }\n  }\n  for (i = 0; i < l - 3; i++)\n    printf(\"%s \", s[i]);\n  cout << s[l - 3];\n  return 0;\n}\n"}
{"label": "19", "index": "36058", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], s[100], ss[100][100] = {'\u0000'}, d[100] = {'\u0000'};\n  int i, j, m, n, t, k, l, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  t = strlen(s);\n  n = 0;\n  m = 0;\n  for (i = 0; i < t; i++) {\n    if (s[i] != ' ' && s[i] != '\u0000') {\n      ss[m][n] = s[i];\n      n++;\n    } else {\n      m++;\n      n = 0;\n    }\n  }\n  for (j = 0; j <= m; j++) {\n    if (strcmp(ss[j], a) == 0) {\n      strcpy(ss[j], b);\n    }\n  }\n  k = 0;\n  l = 0;\n  for (p = 0;; p++) {\n    if (ss[k][l] == '\u0000' && k != m) {\n\n      d[p] = ' ';\n      k++;\n      l = 0;\n\n    } else if (ss[k][l] != '\u0000') {\n      d[p] = ss[k][l];\n      l++;\n    } else\n      break;\n  }\n  puts(d);\n  return 0;\n}\n"}
{"label": "19", "index": "36059", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a, i, j = 0;\n  char s[101] = {0}, c[101], d[101];\n\n  scanf(\"%s \", s);\n\n  scanf(\"%s \", c);\n\n  scanf(\"%s \", d);\n  a = strlen(s);\n  for (i = 0; i < a; i++) {\n    char b[101] = {0};\n    while (s[i] != ' ' && i < a) {\n      b[j] = s[i];\n      j++;\n      i++;\n    }\n    if (strcmp(b, c) == 0) {\n      printf(\"%s\", d);\n    } else {\n      printf(\"%s\", b);\n    }\n    if (i < a) {\n      printf(\" \");\n    }\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[101], a[101], b[101], word[100][101];\n  int n, k, i;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n\n  n = 0;\n  k = 0;\n  for (i = 0; s[i] != 0; i++) {\n    if (s[i] == ' ') {\n      s[i] = '\u0000';\n      strcpy(word[n], (s + k));\n      n++;\n      k = i + 1;\n    }\n  }\n  strcpy(word[n], (s + k));\n  n++;\n\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, word[i]) == 0) {\n      strcpy(word[i], b);\n    }\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    printf(\"%s \", word[i]);\n  }\n\n  printf(\"%s\", word[n - 1]);\n\n  return 0;\n}\n"}
{"label": "19", "index": "36061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  cin >> re;\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    cout << wd[i] << \" \";\n  }\n  printf(\"%s\", wd[a]);\n  return 0;\n}\n"}
{"label": "19", "index": "36062", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1000], a[1000], b[1000], c[1000][1000] = {0};\n  int i, j, k = 0, e, d, h, n = 0, d1;\n\n  scanf(\"%s \", s);\n\n  cin >> a;\n\n  cin >> b;\n  d = strlen(s);\n  for (i = k; i < d; i++) {\n    h = 0;\n    if (s[i] != ' ' && (s[i + 1] == ' ' || s[i + 1] == '\u0000')) {\n      for (j = k; j <= i; j++) {\n        c[n][h++] = s[j];\n      }\n      c[n][h] = '\u0000';\n      n += 1;\n      k = i + 2;\n    }\n  }\n  e = 0;\n  for (i = 0; i < n; i++) {\n    if (strcmp(a, c[i]) == 0) {\n      strcpy(c[i], b);\n      e = 1;\n    }\n  }\n  if (e == 0) {\n    printf(\"%s \", s);\n  } else {\n    for (i = 0; i < n - 1; i++) {\n      d1 = strlen(c[i]);\n      for (j = 0; j < d1; j++) {\n        printf(\"%c\", c[i][j]);\n      }\n      printf(\"%c\", ' ');\n    }\n    printf(\"%s \", c[n - 1]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36063", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint equal(char *x, char *y) {\n  for (int k = 0; x[k] != '\\0' || y[k] != '\\0'; k++)\n    if (x[k] != y[k])\n      return 0;\n  return 1;\n}\n\nint main() {\n  char str[100][100];\n\n  int number = 0;\n\n  while (1) {\n    cin >> str[number++];\n    if (cin.get() == '\\n')\n      break;\n  }\n\n  char str1[100], str2[100];\n  scanf(\"%s %s \", str1, str2);\n\n  for (int k = 0; k != number - 1; k++) {\n    if (equal(str[k], str1)) {\n      cout << str2 << \" \";\n      continue;\n    }\n    cout << str[k] << \" \";\n  }\n  if (equal(str[number - 1], str1))\n    cout << str2 << endl;\n  else\n    cout << str[number - 1] << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "36064", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100] = {\"\"}, sr[100] = {\"\"};\n  char wrd[100] = {\"\"};\n  char wod[100] = {\"\"};\n  char wd[100] = {\"\"};\n  int i, j = 0, k, n, m;\n  cin >> str;\n  cin >> wrd;\n  scanf(\"%s \", wod);\n  n = strlen(str);\n  for (i = 0; i <= n; i++) {\n    if ((str[i] != ' ') && (str[i] != '\u0000')) {\n      wd[j] = str[i];\n      j = j + 1;\n    } else {\n      j = 0;\n      m = strlen(wd);\n      if (strcmp(wd, wrd) == 0) {\n        for (k = i - m; k < i; k++)\n          str[k] = '\u0000';\n        for (k = i; k < n; k++) {\n          sr[k - i] = str[k];\n          str[k] = '\u0000';\n        }\n        strcat(str, wod);\n        strcat(str, sr);\n        n = strlen(str);\n        for (k = 0; k < (n - i); k++)\n          sr[k] = '\u0000';\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n      } else\n        for (k = 0; k < m; k++)\n          wd[k] = '\u0000';\n    }\n  }\n  puts(str);\n  return 0;\n}\n"}
{"label": "19", "index": "36065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char zfc[100], in[30], out[30], x[100], y[100], zfc2[20][100];\n  int len, i, t = 1, lenall, judge = 1, num[100], k = 1;\n\n  cin >> zfc;\n  scanf(\"%s\", in);\n  scanf(\"%s\", out);\n  len = strlen(in);\n  lenall = strlen(zfc);\n  num[0] = 0;\n  for (i = 0; i < lenall; i++) {\n    if (zfc[i] == ' ') {\n      num[k] = i + 1;\n      zfc[i] = 0;\n      k++;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    strcpy(zfc2[i], &zfc[num[i]]);\n  }\n  for (i = 0; i < k; i++) {\n    if (strcmp(&zfc[num[i]], in) == 0) {\n      strcpy(zfc2[i], out);\n    }\n  }\n  for (i = 0; i < k - 1; i++) {\n    printf(\"%s \", zfc2[i]);\n  }\n  printf(\"%s\", zfc2[k - 1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36066", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[100], b[100], c[100], d[100], e[100] = \"\u0000\";\n  int i, j;\n  char *s;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  s = a;\n  strcat(a, \" \");\n  for (i = 0; a[i] != '\u0000'; i++) {\n    j = 0;\n    while (a[i] != ' ') {\n      d[j] = a[i];\n      i++;\n      j++;\n    }\n    d[j] = '\u0000';\n    if ((!strcmp(d, b)) && (d[0] != '\u0000'))\n      strcat(e, c);\n    else {\n      strcat(e, d);\n    }\n    if (a[i + 1] != '\u0000')\n      strcat(e, \" \");\n  }\n  puts(e);\n}\n"}
{"label": "19", "index": "36067", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100];\n  char *p1, *p2, *p3, *p4;\n  int n1, n2, n3, flag = 1;\n  scanf(\"%s \", s);\n  scanf(\"%s \", a);\n  cin >> b;\n  p1 = s;\n  p2 = a;\n  p3 = b;\n  n1 = strlen(s);\n  n2 = strlen(a);\n  n3 = strlen(b);\n  while (p1 < s + n1) {\n    p2 = a;\n    p3 = b;\n    if (isalpha(*p1)) {\n      if (flag) {\n        flag = 0;\n        for (p4 = p1; p2 < a + n2; p4++, p2++)\n          if (*p4 != *p2)\n            break;\n        if ((p2 - a) == n2) {\n          for (; p3 < b + n3; p3++)\n            printf(\"%c\", *p3);\n          p1 = p1 + n2;\n        } else {\n          for (; isalpha(*p1); p1++)\n            printf(\"%c\", *p1);\n        }\n      }\n    } else {\n      printf(\" \");\n      flag = 1;\n      p1++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c = ' ';\n  char *str1, *str2;\n  str1 = (char *)malloc(100 * sizeof(char));\n  str2 = (char *)malloc(100 * sizeof(char));\n\n  char str[100][100];\n  int i, n = 0;\n  for (i = 0; i < 100; i++) {\n    strcpy(str[i], \"\\0\");\n    cin >> str[i];\n    if (c = getchar() != ' ')\n      break;\n    n++;\n  }\n  strcpy(str1, \"\\0\");\n  strcpy(str2, \"\\0\");\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n\n  for (i = 0; i <= n; i++) {\n    if (strcmp(str1, str[i]) == 0)\n      strcpy(str[i], str2);\n  }\n  for (i = 0; i <= n - 1; i++)\n    cout << str[i] << \" \";\n  cout << str[n];\n}\n"}
{"label": "19", "index": "36069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], *d, *e, *f;\n  int al, bl, cl, i, j, k;\n\n  cin >> a;\n  cin >> b;\n  cin >> c;\n  al = strlen(a);\n  bl = strlen(b);\n  cl = strlen(c);\n  d = &a[0];\n  e = &b[0];\n  f = &c[0];\n\n  for (i = 0; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++) {\n    *(d + j) = *(f + k);\n  }\n  al = al + cl;\n  *(d + al) = '\u0000';\n\n  for (i = i + cl; i < al; i++) {\n    for (j = 0, k = i;\n         (*(d + i - 1) == ' ' || i == 0) && j < bl && *(d + k) == *(e + j);\n         j++, k++) {\n    }\n    if (j == bl) {\n      break;\n    }\n  }\n  if (j != bl)\n    goto line;\n  for (j = 0; j < al - bl - i; j++) {\n    *(d + i + j) = *(d + i + j + bl);\n  }\n  al = al - bl;\n  for (j = al - 1; j >= i; j--) {\n    *(d + j + cl) = *(d + j);\n  }\n  for (j = i, k = 0; j < cl + i; j++, k++)\n    *(d + j) = *(f + k);\n\n  al = al + cl;\n  *(d + al) = '\u0000';\n\nline:\n  puts(a);\n}\n"}
{"label": "19", "index": "36070", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s1[100], s2[10], s3[10];\n\n  cin >> s1;\n\n  cin >> s2;\n\n  cin >> s3;\n  char s4[10];\n  int a, b = 0;\n  a = strlen(s1);\n  for (int i = 0; i < a; i++) {\n    if (s1[i] != ' ') {\n      if (i != a - 1) {\n        s4[b] = s1[i];\n        b++;\n      }\n      if (i == a - 1) {\n        s4[b] = s1[i];\n        s4[b + 1] = '\u0000';\n        if (strcmp(s4, s2) == 0) {\n          printf(\"%s\", s3);\n        } else {\n          printf(\"%s\", s4);\n        }\n      }\n    } else {\n      s4[b] = '\u0000';\n      b = 0;\n      if (strcmp(s4, s2) == 0) {\n        printf(\"%s \", s3);\n      } else {\n        printf(\"%s \", s4);\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36071", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char s[100], a[100], b[100];\n  char x[100], c[100] = {'\u0000'};\n  int i, t = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      x[t] = s[i];\n      t++;\n    } else {\n      x[t] = '\u0000';\n      if (strcmp(x, a) == 0) {\n        strcat(c, b);\n        strcat(c, \" \");\n      } else {\n        strcat(c, x);\n        strcat(c, \" \");\n      }\n      t = 0;\n    }\n  }\n  x[t] = '\u0000';\n  if (strcmp(x, a) == 0) {\n    strcat(c, b);\n  } else {\n    strcat(c, x);\n  }\n  puts(c);\n  return 0;\n}\n"}
{"label": "19", "index": "36072", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char n[5000];\n  char m[100][20];\n  char s1[20], s2[20];\n\n  cin >> n;\n  cin >> s1;\n  cin >> s2;\n  int i, j = 0, k = 0, e;\n  e = strlen(n);\n  for (i = 0; i < e; i++) {\n    if (n[i] != ' ') {\n      m[j][k] = n[i];\n      k++;\n    }\n    if (n[i] == ' ') {\n      m[j][k] = '\u0000';\n      j++;\n      k = 0;\n    }\n  }\n  m[j][k] = '\u0000';\n  for (i = 0; i <= j; i++) {\n    if (strcmp(m[i], s1) == 0)\n      strcpy(m[i], s2);\n  }\n\n  printf(\"%s\", m[0]);\n  for (i = 1; i <= j; i++) {\n\n    printf(\" %s\", m[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][1000] = {1}, b[100], c[100], d;\n  int i, n = 0;\n  for (i = 0;; i++) {\n    scanf(\"%s%c\", &a[i], &d);\n    n++;\n    if (d == '\\n')\n      break;\n  }\n  scanf(\"%s\", &b);\n  scanf(\"%s\", &c);\n  for (i = 0; i < n; i++) {\n    if (strcmp(a[i], b) == 0)\n      printf(\"%s\", c);\n    else\n      printf(\"%s\", a[i]);\n    if (i == n - 1)\n      printf(\"\\n\");\n    else\n      printf(\" \");\n  }\n}\n"}
{"label": "19", "index": "36074", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[103], a[103], b[103], s2[210];\n  int alen, slen, blen, i, j;\n  s[0] = a[0] = b[0] = ' ';\n\n  cin >> &s[1];\n  cin >> &a[1] >> &b[1];\n  slen = strlen(s);\n  alen = strlen(a);\n  blen = strlen(b);\n  s[slen] = a[alen] = b[blen] = ' ';\n  s[slen + 1] = a[alen + 1] = b[blen + 1] = '\u0000';\n  for (i = 0, j = 0; i <= slen; i++, j++) {\n    if (strncmp(s + i, a, alen + 1) == 0) {\n      strcpy(s2 + j, b);\n      i = i + alen;\n      j = j + blen;\n    } else {\n      s2[j] = s[i];\n    }\n  }\n\n  s2[j - 1] = 0;\n  printf(\"%s\\n\", &s2[1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36075", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[202], a[202], b[202], ch[202];\n\n  cin >> s;\n\n  scanf(\"%s \", a);\n\n  cin >> b;\n  int k = 0;\n  for (int j = 0; j < strlen(s); ++j) {\n    if (s[j] != ' ') {\n      ch[k] = s[j];\n      ++k;\n    } else {\n      ch[k] = '\u0000';\n      if (!strcmp(ch, a))\n        cout << b << \" \";\n      else\n        cout << ch << \" \";\n      memset(ch, 0, sizeof(char) * k);\n      k = 0;\n    }\n    if (j == strlen(s) - 1) {\n      if (!strcmp(ch, a))\n        cout << b << endl;\n      else\n        printf(\"%s\\n\", ch);\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36076", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], a[100], b[100], c[100][50];\n  char *p1 = s, *p3 = b;\n  int i = 0, j = 0, n;\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n  for (; *p1 != '\u0000'; p1++) {\n    if (*p1 != ' ') {\n      c[i][j] = *p1;\n      j++;\n    } else {\n      c[i][j] = '\u0000';\n      i++;\n      j = 0;\n    }\n  }\n  c[i][j] = '\u0000';\n  n = i;\n  for (i = 0; i <= n; i++) {\n    if (strcmp(c[i], a) == 0) {\n      for (j = 0; *p3 != '\u0000'; p3++, j++)\n        c[i][j] = *p3;\n      c[i][j] = '\u0000';\n    }\n    p3 = b;\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", c[i]);\n  }\n  cout << c[i];\n}\n"}
{"label": "19", "index": "36077", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char text[100], s[100][20] = {'\u0000'}, a[20], b[20];\n  int i, j = 0, k = 0, len;\n\n  cin >> text;\n  len = strlen(text);\n  for (i = 0; i < len; i++) {\n    if (text[i] != ' ') {\n      s[j][k] = text[i];\n      k = k + 1;\n    } else {\n      j = j + 1;\n      k = 0;\n    }\n  }\n  scanf(\"%s\", a);\n  scanf(\"%s\", b);\n  for (i = 0; i <= j; i++) {\n    if (strcmp(s[i], a) == 0) {\n      strcpy(s[i], b);\n    }\n    printf(\"%s\", s[i]);\n    if (i != j)\n      printf(\" \");\n  }\n  printf(\" \");\n}\n"}
{"label": "19", "index": "36078", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[103], word[103], rep[103], b[203], i,\n      j;                 \n  cin.get(a, 101, '\\n'); \n  cin >> word >> rep;\n  int wordlen = strlen(word), alen = strlen(a),\n      replen = strlen(rep); \n  for (i = alen; i > 0; i--)\n    a[i] = a[i - 1];\n  a[0] = ' ';\n  a[alen + 1] = ' ';\n  a[alen + 2] = '\\0';\n  for (i = 1, j = 0; i < alen + 2; i++, j++) {\n    if (a[i - 1] == ' ' && a[i + wordlen] == ' ' &&\n        strncmp(a + i, word, wordlen) ==\n            0) \n    {\n      strcpy(b + j, rep);\n      i = i + wordlen - 1;\n      j = j + replen - 1; \n    } else\n      b[j] = a[i];\n  }\n  b[j - 1] = '\\0'; \n  for (i = 0;; i++)\n    if (b[i] != '\\0')\n      cout << b[i];\n    else\n      break;\n  return 0;\n}\n"}
{"label": "19", "index": "36079", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[300], b[100], c[100], d[100][20] = {0}; \n  int i, j = 0, k = 0, l;\n  cin.getline(a, 300); \n  cin.getline(b, 100); \n  cin.getline(c, 100); \n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    d[j][k] = a[i];\n    k = k + 1;\n    if (a[i + 1] == ' ' || i == l - 1) {\n      j = j + 1, k = 0, i = i + 1;\n    }\n  } \n  for (i = 0; i < j; i++)\n    if (strcmp(d[i], b) == 0)\n      strcpy(d[i], c); \n  cout << d[0];\n  for (i = 1; i < j; i++)\n    cout << \" \" << d[i]; \n  return 0;\n}\n"}
{"label": "19", "index": "36080", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d[10], i = 0, j = 0, k = 0, l = 0;\n  char s[1000], q[100], w[100];\n\n  cin >> s;\n  cin >> q;\n  cin >> w;\n  for (j = 0; j < 100; j++) {\n    if (s[j] == '\u0000' && a == 0)\n      a = j;\n    if (q[j] == '\u0000' && b == 0)\n      b = j;\n    if (w[j] == '\u0000' && c == 0)\n      c = j;\n    if (a != 0 && b != 0 && c != 0)\n      break;\n  }\n  for (i = 0; i <= a; i++)\n    if (s[i] == ' ' || s[i] == '\u0000')\n      for (j = 0; j < b; j++)\n        if (q[j] != s[i - b + j])\n          break;\n        else if (s[i - b - 1] == ' ' || i == b) {\n          d[k++] = i;\n          j = b;\n        }\n  if (k != 0)\n    for (i = 0; i < a; i++) {\n      if (i == d[l] - b) {\n        for (j = 0; j < c; j++)\n          printf(\"%c\", w[j]);\n        i = d[l] - 1;\n        l++;\n      } else\n        printf(\"%c\", s[i]);\n    }\n  else\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "36081", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100], str2[100], original[100], word[100], replace[100];\n  int len;\n\n  cin >> str;\n  len = strlen(str);\n  str[len] = ' ';\n  str[len + 1] = '\u0000';\n\n  cin >> original;\n\n  scanf(\"%s \", replace);\n  int i = 0, p = 0, wordlen = 0, j = 0, temp = 0, k, n = 0;\n  int t = 0;\n  while (i < strlen(str)) {\n\n    if (str[i] != ' ') {\n      word[j] = str[i];\n      j++;\n      i++;\n      temp = 1;\n    } else if (temp == 1) {\n      word[j] = '\u0000';\n\n      t = 0;\n      if (strcmp(word, original) == 0) {\n        for (k = 0; k < (i - j); k++) {\n          str2[k] = str[k];\n        }\n        n = 0;\n        while (n < strlen(replace)) {\n          str2[k] = replace[n];\n          n++;\n          k++;\n        }\n        n = i;\n        while (n < strlen(str)) {\n          str2[k] = str[n];\n          n++;\n          k++;\n        }\n        n = 0;\n        while (n < k) {\n          str[n] = str2[n];\n          n++;\n        }\n        str[n] = '\u0000';\n        i = 0;\n      } else {\n        i++;\n      }\n      j = 0;\n      temp = 0;\n    } else if (temp == 0) {\n      i++;\n    }\n  }\n  i = 0;\n  while (i < strlen(str) - 1) {\n    printf(\"%c\", str[i]);\n    i++;\n  }\n}\n"}
{"label": "19", "index": "36082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main()\n\n{\n  int i, k, n = 0, p, j;\n  char s[100], a[100], b[100];\n\n  cin >> s;\n  cin >> a;\n  cin >> b;\n\n  i = 0;\n  while (a[i] != '\u0000') {\n    n++;\n    i++;\n  }\n  i = 0;\n  while (s[i] != '\u0000') {\n    p = 1;\n    for (j = 0; j < n; j++)\n      if (a[j] != s[i + j])\n        p = 0;\n    if (p)\n      if (i > 1 && s[i - 1] != ' ')\n        p = 0;\n    if (p) {\n      cout << b;\n      i = i + n - 1;\n    } else {\n      cout << s[i];\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36083", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, i, l, ls;\n  char s[105], str[105], a[105], x[105], s1[105] = {' ', '\u0000'},\n                                         s2[2] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> a;\n  strcat(s, s2);\n  strcat(s1, s);\n  strcpy(s, s1);\n  l = strlen(str);\n  ls = strlen(a);\n  strcpy(x, s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == str[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (l == j && s[i - j] == ' ' && s[i + 1] == ' ') {\n      if (i - j != -1) {\n        x[i - j + 1] = '\u0000';\n        strcat(x, a);\n      } else {\n        strcpy(x, a);\n      }\n      strcat(x, s + i + 1);\n      i = i + ls - l;\n      j = 0;\n      strcpy(s, x);\n    }\n  }\n  for (i = 0; x[i + 2] != '\u0000'; i++) {\n    x[i] = x[i + 1];\n  }\n  x[i] = '\u0000';\n  printf(\"%s\", x);\n  return 0;\n}\n"}
{"label": "19", "index": "36084", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int i, a = 0, j = 0, l, nc[100];\n\n  scanf(\"%s \", s);\n  scanf(\"%s\", re);\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  printf(\"%s\", wd[a]);\n  int t;\n  scanf(\"%d\", &t);\n  return 0;\n}\n"}
{"label": "19", "index": "36085", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, k, l, l1, l2;\n  char s[200], a[101], b[101];\n  cin.getline(s, 200);\n  cin.getline(a, 101);\n  cin.getline(b, 101);\n  l = strlen(s);\n  l1 = strlen(a);\n  l2 = strlen(b);\n  for (i = l; i >= 0; i--)\n    s[i + 1] = s[i];\n  s[0] = ' ';\n  l += 1;\n  for (i = 0; i <= l + 1; i++) {\n    if (s[i] == ' ') {\n      for (j = i + 1; j <= i + l1; j++) {\n        if (s[j] != a[j - i - 1])\n          break;\n        else {\n          if (j == i + l1 && (s[i + l1 + 1] == ' ' || s[i + l1 + 1] == '\\0')) {\n            if (l2 >= l1) {\n              l += l2 - l1;\n              for (k = l - l2 + l1; k >= i + l1 + 1; k--)\n                s[k + l2 - l1] = s[k];\n              for (k = i; k <= i + l2 - 1; k++)\n                s[k + 1] = b[k - i];\n            }\n            if (l2 < l1) {\n              for (k = i + l1 + 1; k <= l + 2; k++)\n                s[k + l2 - l1] = s[k];\n              for (k = i; k <= i + l2 - 1; k++)\n                s[k + 1] = b[k - i];\n            }\n          }\n        }\n      }\n    }\n  }\n  for (i = 1; i <= l; i++)\n    s[i - 1] = s[i];\n  cout << s << endl;\n  return 0;\n}\n"}
{"label": "19", "index": "36086", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char sen[1000], a[1000], b[1000], end[2000];\n  int i, j, lensen, lena, lenb;\n  sen[0] = ' ';\n  a[0] = ' ';\n  b[0] = ' ';\n\n  scanf(\"%s \", sen);\n  scanf(\"%s %s \", a, b);\n\n  lensen = strlen(sen) + 1;\n  lena = strlen(a) + 1;\n  lenb = strlen(b) + 1;\n\n  sen[lensen - 1] = ' ';\n  a[lena - 1] = ' ';\n  b[lenb - 1] = ' ';\n\n  sen[lensen] = '\u0000';\n  a[lena] = '\u0000';\n  b[lenb] = '\u0000';\n\n  for (i = 0, j = 0; i < lensen; ++i, ++j) {\n    if (strncmp(sen + i, a, lena) == 0) {\n      strcpy(end + j, b);\n      i = i + lena - 1;\n      j = j + lenb - 1;\n    } else {\n      end[j] = sen[i];\n    }\n  }\n\n  end[j - 1] = 0;\n  printf(\"%s\\n\", &end[1]);\n  return 0;\n}\n"}
{"label": "19", "index": "36087", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[4000];\n  char a[100], b[100];\n  char str[40][100];\n  char temp[100] = \"\";\n  int k = 0, j = 0, i, n, m;\n\n  cin >> string;\n  n = strlen(string);\n  for (i = 0; i < n; i++) {\n    if (string[i] != ' ') {\n      temp[k] = string[i];\n      str[j][k] = string[i];\n      k++;\n    } else {\n      strcpy(str[j], temp);\n      k = 0;\n      j++;\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n    if (i == n - 1) {\n      strcpy(str[j], temp);\n      for (m = 0; m < 100; m++)\n        temp[m] = 0;\n    }\n  }\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; i <= j; i++) {\n    if (strcmp(str[i], a) == 0) {\n      strcpy(str[i], b);\n    }\n  }\n  for (i = 0; i < j; i++) {\n    printf(\"%s \", str[i]);\n  }\n  printf(\"%s\", str[j]);\n  return 0;\n}\n"}
{"label": "19", "index": "36088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[80], s[30][20], test1[20], test2[20], *p;\n  int i, j, l, c, m = 0;\n  scanf(\"%s \", str);\n  cin >> test1;\n  cin >> test2;\n  p = str;\n  for (i = 0, c = 0; *(p + i) != ' '; i++, c++)\n    s[0][c] = *(p + i);\n  s[0][c] = '\u0000';\n  l = strlen(str);\n  m = 1;\n  for (i = 0; i < l; i++) {\n    if (*(p + i - 1) == ' ' && *(p + i) != ' ') {\n      for (j = i, c = 0; str[j] != ' '; j++, c++) {\n        s[m][c] = str[j];\n      }\n      s[m][c] = '\u0000';\n      m++;\n    }\n  }\n  for (i = 0; i < m; i++) {\n    if (strcmp(test1, s[i]) == 0) {\n      strcpy(s[i], test2);\n    }\n  }\n  for (i = 0; i < m - 1; i++)\n    printf(\"%s \", s[i]);\n  cout << s[m - 1];\n  return 0;\n}\n"}
{"label": "19", "index": "36089", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[1001];\n  char a[1001];\n  char b[1001];\n  char ans[1001] = {'\u0000'};\n  int i, j, k, p;\n\n  cin >> s;\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n  int l, la, lb;\n  l = strlen(s);\n  la = strlen(a);\n  lb = strlen(b);\n  int index;\n  index = 0;\n  for (i = 0; i < l; i++) {\n    k = 0;\n    for (j = 0; j < la; j++) {\n      if (s[i + j] != a[j])\n        k = 1;\n    }\n    if (((i + la) < l) && (s[i + la] != ' '))\n      k = 1;\n    if ((i > 0) && (s[i - 1] != ' '))\n      k = 1;\n    if (k == 0) {\n      for (p = 0; p < lb; p++)\n        ans[p + index] = b[p];\n      index = index + lb - 1;\n      i = i + la - 1;\n    }\n    if (k > 0)\n      ans[index] = s[i];\n    index++;\n  }\n  printf(\"%s \", ans);\n  return 0;\n}\n"}
{"label": "19", "index": "36090", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[30][20] = {0};\n  char a[101] = {0}, b[101] = {0};\n  char ch, (*p)[20];\n  int i = 0;\n  ch = 0;\n  while (ch != ' ') {\n    cin >> s[i++];\n    ch = getchar();\n  }\n  cin >> a;\n  cin >> b;\n  p = &s[0];\n  while (strcmp(*p, \"\") != 0) {\n    if (strcmp(*p, a) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", *p);\n    p++;\n    if (strcmp(*p, \"\") != 0)\n      printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36091", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100], x[100][26], a[100], b[100], t[100];\n  int num, i, j, kong;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  kong = -1;\n  num = 0;\n  for (i = 0; i < 101; i++) {\n    if (s[i] == ' ') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      num++;\n      kong = i;\n    } else if (s[i] == '\u0000') {\n      for (j = 0; j < i - kong - 1; j++)\n        x[num][j] = s[kong + 1 + j];\n      x[num][j] = '\u0000';\n      break;\n    }\n  }\n  for (i = 0; i <= num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      t[j] = x[i][j];\n    t[j] = '\u0000';\n    if (strcmp(a, t) == 0) {\n      for (j = 0; b[j] != '\u0000'; j++)\n        x[i][j] = b[j];\n      x[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < num; i++) {\n    for (j = 0; x[i][j] != '\u0000'; j++)\n      printf(\"%c\", x[i][j]);\n    printf(\" \");\n  }\n  for (j = 0; x[num][j] != '\u0000'; j++)\n    printf(\"%c\", x[num][j]);\n}\n"}
{"label": "19", "index": "36092", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char src[1000];\n  char find[1000];\n  char replace[1000];\n\n  char temp[1000][1000];\n\n  cin >> src;\n\n  cin >> find;\n\n  cin >> replace;\n\n  int temp_count = 0;\n  int iter = 0;\n  for (int i = 0; i < strlen(src); i++) {\n    if (src[i] == ' ') {\n      for (int j = iter; j < i; j++) {\n        temp[temp_count][j - iter] = src[j];\n      }\n      temp[temp_count][i - iter] = 0;\n      temp_count++;\n      iter = i + 1;\n    }\n  }\n  for (int j = iter; j < strlen(src); j++) {\n    temp[temp_count][j - iter] = src[j];\n  }\n  temp[temp_count][strlen(src) - iter] = 0;\n  temp_count++;\n\n  for (int i = 0; i < temp_count - 1; i++) {\n    if (strcmp(temp[i], find) == 0) {\n      cout << replace << \" \";\n    } else {\n      cout << temp[i] << \" \";\n    }\n  }\n  if (strcmp(temp[temp_count - 1], find) == 0) {\n    printf(\"%s\\n\", replace);\n  } else {\n    cout << temp[temp_count - 1] << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36093", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c[100], d[100];\n  int i, j, k;\n\n  cin >> a;\n\n  cin >> b;\n\n  cin >> c;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    j = 0;\n    while (a[i] != ' ' && a[i] != '\u0000')\n      d[j++] = a[i++];\n    d[j] = '\u0000';\n    if (strcmp(b, d) == 0) {\n      printf(\"%s\", c);\n    } else {\n      cout << d;\n    }\n    if (i == k) {\n      cout << \"\u0000\";\n    } else {\n      cout << \" \";\n    }\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36094", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[300], a[103], b[103];\n  int i, j, k, p, l, m, n, num, h = 0;\n\n  scanf(\"%s \", s);\n  l = strlen(s);\n\n  cin >> a;\n  m = strlen(a);\n\n  cin >> b;\n  n = strlen(b);\n\n  for (i = 0; i < l; i++) {\n    num = 0;\n    if (s[i] == a[0]) {\n      num = 1;\n      for (j = 1; a[j] != '\u0000'; j++)\n        if (s[i + j] == a[j])\n          num++;\n      if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n >= m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[l - 1 + n - m - k] = s[l - 1 - k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      } else if (num == m && (s[i + j] == ' ' || s[i + j] == '\u0000') && n < m) {\n        if (i == 0 || (i != 0 && s[i - 1] == ' ')) {\n          for (k = 0; k < (l - m - i); k++)\n            s[n + i + k] = s[m + i + k];\n          for (p = 0; p < n; p++)\n            s[p + i] = b[p];\n          s[l + n - m] = '\u0000';\n          i = i + n - 1;\n        }\n      }\n      l = l + i;\n    }\n  }\n  printf(\"%s\", s);\n}\n"}
{"label": "19", "index": "36095", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100];\n  char a[100];\n  char b[100];\n  char c[100][100] = {'\u0000'};\n  int i, k = 0, j = 0;\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      c[k][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ') {\n      k++;\n      j = 0;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (strcmp(c[i], a) == 0) {\n      strcpy(c[i], b);\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    if (i == 0)\n      printf(\"%s\", c[i]);\n    else\n      printf(\" %s\", c[i]);\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36096", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char sen[100], word[50][20] = {0}, pre[20], post[20];\n  int i, l, f[50] = {0}, g[50] = {0};\n  int word_num = 0, char_num = 0;\n\n  cin >> sen;\n\n  cin >> pre;\n\n  cin >> post;\n  l = strlen(sen);\n  for (i = 0; i < l; i++) {\n    if (sen[i] != ' ') {\n      word[word_num][char_num] = sen[i];\n      char_num++;\n    } else if (sen[i] == ' ') {\n      word_num++;\n      char_num = 0;\n    }\n  }\n  for (i = 0; i <= word_num; i++)\n    f[i] = strlen(word[i]);\n\n  for (i = 0; i <= word_num; i++) {\n    if (strcmp(word[i], pre) == 0)\n      strcpy(word[i], post);\n  }\n  for (i = 0; i < word_num; i++) {\n    printf(\"%s\", word[i]);\n    printf(\" \");\n  }\n  printf(\"%s\", word[word_num]);\n  return 0;\n}\n"}
{"label": "19", "index": "36097", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, i, l, ls;\n  char s[105], str[105], a[105], x[105], s1[105] = {' ', '\u0000'},\n                                         s2[2] = {' ', '\u0000'};\n\n  cin >> s;\n\n  cin >> str;\n\n  cin >> a;\n  strcat(s, s2);\n  strcat(s1, s);\n  strcpy(s, s1);\n  l = strlen(str);\n  ls = strlen(a);\n  strcpy(x, s);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] == str[j]) {\n      j++;\n    } else {\n      j = 0;\n    }\n    if (l == j && s[i - j] == ' ' && s[i + 1] == ' ') {\n      if (i - j != -1) {\n        x[i - j + 1] = '\u0000';\n        strcat(x, a);\n      } else {\n        strcpy(x, a);\n      }\n      strcat(x, s + i + 1);\n      i = i + ls - l;\n      j = 0;\n      strcpy(s, x);\n    }\n  }\n  for (i = 0; x[i + 2] != '\u0000'; i++) {\n    x[i] = x[i + 1];\n  }\n  x[i] = '\u0000';\n  cout << x;\n  return 0;\n}\n"}
{"label": "19", "index": "36098", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *a, *b, *s, *p, *t;\n  s = (char *)malloc(100 * sizeof(char));\n  a = (char *)malloc(100 * sizeof(char));\n  b = (char *)malloc(100 * sizeof(char));\n\n  cin >> s;\n\n  cin >> a;\n\n  cin >> b;\n  for (;; s++) {\n    p = a;\n    t = s;\n    while (*s == *p && *s != ' ' && *s != '\u0000') {\n      p++;\n      s++;\n    }\n    if (*s == ' ' && *p == '\u0000') {\n      printf(\"%s\", b);\n      printf(\" \");\n      continue;\n    } else if (*s == '\u0000' && *p == '\u0000') {\n      printf(\"%s\", b);\n      break;\n    }\n    while (*s != ' ' && *s != '\u0000')\n      s++;\n    if (*s == ' ') {\n      for (; *t != ' '; t++)\n        printf(\"%c\", *t);\n      printf(\" \");\n    }\n    if (*s == '\u0000') {\n      for (; *t != '\u0000'; t++)\n        printf(\"%c\", *t);\n      break;\n    }\n  }\n}\n"}
{"label": "19", "index": "36099", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, j, k = 0;\n  char s[100][100] = {0}, a[100], b[100], str[1000];\n  char *ps[100], *pa, *pb;\n\n  for (i = 0; i < 100; i++)\n    *(ps + i) = s[i];\n  pa = a;\n  pb = b;\n\n  scanf(\"%s \", str);\n\n  scanf(\"%s \", pa);\n\n  cin >> pb;\n  i = 0;\n  do {\n    for (j = 0; *(str + k) != ' ' && *(str + k) != '\u0000'; j++) {\n      *(*(ps + i) + j) = *(str + k);\n      k++;\n    }\n    *(*(ps + i) + j) = '\u0000';\n    i++;\n    k++;\n  } while (*(str + k) != '\u0000');\n  *(*(ps + i - 1) + j) = '\u0000';\n  m = i;\n  for (i = 0; i < m; i++) {\n    if (!strcmp(*(ps + i), pa))\n      strcpy(*(ps + i), pb);\n  }\n\n  for (i = 0; i < m; i++) {\n    if (i == 0)\n      printf(\"%s\", *(ps + i));\n    else\n      printf(\" %s\", *(ps + i));\n  }\n  printf(\" \");\n  return 0;\n}\n"}
{"label": "19", "index": "36100", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[101], sz[51][101], a[101], b[101];\n  int i, j, k, n;\n  int max = 0, min = 0;\n\n  cin >> s;\n  n = strlen(s);\n  for (i = 0, k = 0; i < n; i++) {\n    for (j = 0; s[i] != ' ' && i < n; i++, j++) {\n      sz[k][j] = s[i];\n    }\n    sz[k][j] = '\u0000';\n    k++;\n  }\n\n  cin >> a;\n\n  scanf(\"%s \", b);\n\n  for (i = 0; i < k - 1; i++) {\n    if (strcmp(sz[i], a) == 0) {\n      printf(\"%s\", b);\n    } else {\n      printf(\"%s\", sz[i]);\n    }\n    printf(\" \");\n  }\n  if (strcmp(sz[k - 1], a) == 0) {\n    printf(\"%s \", b);\n  } else {\n    printf(\"%s \", sz[k - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "19", "index": "36101", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a = 0, b = 0, c = 0, d[10], i = 0, j = 0, k = 0, l = 0;\n  char s[1000], q[100], w[100];\n\n  cin >> s;\n  cin >> q;\n  cin >> w;\n  for (j = 0; j < 100; j++) {\n    if (s[j] == '\u0000' && a == 0)\n      a = j;\n    if (q[j] == '\u0000' && b == 0)\n      b = j;\n    if (w[j] == '\u0000' && c == 0)\n      c = j;\n    if (a != 0 && b != 0 && c != 0)\n      break;\n  }\n  for (i = 0; i <= a; i++)\n    if (s[i] == ' ' || s[i] == '\u0000')\n      for (j = 0; j < b; j++)\n        if (q[j] != s[i - b + j])\n          break;\n        else if (s[i - b - 1] == ' ' || i == b) {\n          d[k++] = i;\n          j = b;\n        }\n  if (k != 0)\n    for (i = 0; i < a; i++) {\n      if (i == d[l] - b) {\n        for (j = 0; j < c; j++)\n          cout << w[j];\n        i = d[l] - 1;\n        l++;\n      } else\n        printf(\"%c\", s[i]);\n    }\n  else\n    for (i = 0; i < a; i++)\n      printf(\"%c\", s[i]);\n  return 0;\n}\n"}
{"label": "19", "index": "36102", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100], re[100], x[100], wd[50][100];\n  int n, i, a = 0, j = 0, k, e, l, nc[100];\n\n  cin >> s;\n  cin >> re;\n  scanf(\"%s\", x);\n  for (i = 0; s[i] != '\u0000'; i++) {\n    if (s[i] != ' ') {\n      wd[a][j] = s[i];\n      j++;\n    }\n    if (s[i] == ' ' && s[i + 1] != ' ') {\n      nc[a] = i;\n      wd[a][j] = '\u0000';\n      a++;\n      j = 0;\n    }\n  }\n  l = strlen(s) - nc[a - 1];\n  wd[a][l - 1] = '\u0000';\n  for (i = 0; i <= a; i++) {\n    if (strcmp(re, wd[i]) == 0) {\n      strcpy(wd[i], x);\n    }\n  }\n  for (i = 0; i < a; i++) {\n    printf(\"%s \", wd[i]);\n  }\n  cout << wd[a];\n  int t;\n  cin >> t;\n  return 0;\n}\n"}
{"label": "19", "index": "36103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar str[101], a[101], b[101], c[101];\nint i = 0, len_str, len_a, len_b, pos;\nint main(void) {\n\n  scanf(\"%s \", str);\n  len_str = strlen(str);\n  scanf(\"%s%s\", a, b);\n  len_a = strlen(a);\n  len_b = strlen(b);\n  while (i < len_str) {\n    pos = 0;\n    while (str[i] != ' ' && i < len_str)\n      c[pos++] = str[i++];\n    c[pos] = '\u0000';\n    if (strcmp(a, c) == 0)\n      printf(\"%s\", b);\n    else\n      printf(\"%s\", c);\n    if (i == len_str)\n      cout << \" \";\n    else\n      printf(\" \");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "19", "index": "36104", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\nint main() {\n  char s[101], a[101], b[101]; \n  char m[101], n[101];\n  int ls = 0, la = 0, lb = 0; \n  int i, j, k;\n  cin.getline(s, 101);\n  cin.getline(a, 101);\n  cin.getline(b, 101); \n  ls = strlen(s);\n  la = strlen(a);\n  lb = strlen(b); \n  for (i = 0; i < ls; i++) {\n    if (s[i] != a[0])\n      continue;\n    for (j = i + 1; j < i + la; j++) {\n      if (i != 0 && s[i - 1] != ' ')\n        break;\n      if (s[j] != a[j - i])\n        break;\n    }                \n    if (j == i + la) \n    {\n      for (k = 0; k < i; k++)\n        m[k] = s[k];\n      m[i] = '\\0';\n      strcpy(n, strcat(m, b));\n      strcpy(s, strcat(n, s + (i + la))); \n      i = i + lb;\n    }\n  }\n  cout << s;\n  return 0;\n}\n"}
{"label": "19", "index": "36105", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[101], a[101], b[101];\n  int n, m;\n  int i, j, k = 0;\n\n  cin >> s;\n  cin >> a >> b;\n  n = strlen(s);\n  m = strlen(a);\n  for (i = 0; i < n; i++) {\n    if ((i == 0 && s[i] == a[0] && s[i + m - 1] == a[m - 1] &&\n         s[i + m] == ' ') ||\n        (i != 0 && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1] && s[i + m] == ' ') ||\n        (i + m == n && s[i - 1] == ' ' && s[i] == a[0] &&\n         s[i + m - 1] == a[m - 1])) {\n      for (j = i; j < i + m; j++) {\n        if (s[j] == a[j - i]) {\n          k++;\n        }\n      }\n\n      if (k == m) {\n        printf(\"%s\", b);\n        i += m - 1;\n      } else {\n        printf(\"%c\", s[i]);\n      }\n      k = 0;\n    } else {\n      printf(\"%c\", s[i]);\n    }\n  }\n  printf(\" \");\n\n  return 0;\n}\n"}
{"label": "19", "index": "36106", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char A[100], B[100], T[100], C[100][100];\n  int i, j = 0, a = 0;\n  cin.getline(A, 100, '\\n');\n  cin.getline(B, 100, '\\n');\n  cin.getline(T, 100, '\\n');\n  for (i = 0; i < strlen(A); i++) {\n    if (A[i] != ' ') {\n      C[j][a] = A[i];\n      a = a + 1;\n    } else {\n      a = 0;\n      j = j + 1;\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    if (strcmp(C[i], B) == 0)\n      strcpy(C[i], T);\n  }\n  for (i = 0; i < j; i++) {\n    cout << C[i] << \" \";\n  }\n  cout << C[j];\n  return 0;\n}\n"}
{"label": "19", "index": "36107", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int same, i, j, k;\n  char str[100], sub[100], repl[100];\n\n  scanf(\"%s \", str);\n\n  cin >> sub;\n\n  scanf(\"%s \", repl);\n  for (i = 0; i < strlen(str); i++) {\n    same = 1;\n    for (j = 0; j < strlen(sub); j++) {\n      if (str[i + j] != sub[j])\n        same = 0;\n    }\n    if ((same == 1 && str[i - 1] == ' ') || (same == 1 && i == 0)) {\n      printf(\"%s\", repl);\n      i += strlen(sub) - 1;\n    } else\n      printf(\"%c\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36108", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, pos = 0;\n    for (i = 1; str[i]; i++) {\n      if (str[i] > str[pos])\n        pos = i;\n    }\n    for (i = 0; i <= pos; i++)\n      cout << str[i];\n    printf(\"%s\", substr);\n    while (str[i])\n      cout << str[i++];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36109", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, max = 0;\n  char str[11], substr[4], maxchar;\n  while (scanf(\"%s\", str) != EOF) {\n    maxchar = '\\0';\n    scanf(\"%s\", substr);\n    for (i = 0; str[i]; i++)\n      if (str[i] > maxchar) {\n        max = i;\n        maxchar = str[i];\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = max + 1; str[i]; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36110", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(char *argv[]) {\n\n  char str[11], substr[4], max;\n  int m, n, i, j, z, t, temp = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    m = strlen(str);\n    n = strlen(substr);\n    max = str[0];\n\n    for (i = 0; i < m; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        temp = i + 1;\n      }\n    }\n    for (j = 0; j <= temp; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (z = 0; z < n; z++) {\n      printf(\"%c\", substr[z]);\n    }\n    for (t = temp + 1; t < m; t++) {\n      printf(\"%c\", str[t]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36111", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, Asc, point;\n  char str[10], substr[3];\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    point = 0;\n    Asc = 0;\n    for (i = 0; i <= strlen(str); i++)\n      if (str[i] > Asc) {\n        Asc = str[i];\n        point = i;\n      }\n    for (i = 0; i <= point; i++)\n      cout << str[i];\n    for (j = 0; j < strlen(substr); j++)\n      printf(\"%c\", substr[j]);\n    for (i = point + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36112", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[16], substr[4], *p1, *p2, *pl;\n  for (p1 = str; p1 <= str + 9; p1++)\n    *p1 = '\\0';\n  for (p2 = substr; p2 <= substr + 2; p2++)\n    *p2 = '\\0';\n  for (;;) {\n    pl = str;\n    scanf(\"%s %s \", str, substr);\n    if (*pl == '\\0')\n      break;\n    for (p1 = str + 1; p1 <= str + 9; p1++) {\n      if (*p1 > *pl)\n        pl = p1;\n    }\n    for (p1 = str; p1 <= pl; p1++) {\n      printf(\"%c\", *p1);\n      *p1 = '\\0';\n    }\n    for (p2 = substr; p2 <= substr + 2; p2++) {\n      printf(\"%c\", *p2);\n      *p2 = '\\0';\n    }\n    for (; p1 <= str + 9; p1++) {\n      if (*p1 == '\\0')\n        break;\n      printf(\"%c\", *p1);\n      *p1 = '\\0';\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, t, max;\n  char str1[100][50], str2[100][3];\n  i = 0;\n  while (scanf(\"%s%s\", str1[i], str2[i]) != EOF) {\n    i++;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n\n    m = 0;\n    t = strlen(str1[i]);\n    max = str1[i][0];\n    for (j = 1; j < t; j++) {\n\n      if (max < str1[i][j]) {\n        m = j;\n        max = str1[i][j];\n      }\n    }\n    for (j = 0; j <= m; j++) {\n      printf(\"%c\", str1[i][j]);\n    }\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", str2[i][j]);\n    for (j = m + 1; j < t; j++)\n      printf(\"%c\", str1[i][j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len1;\n  char str1[1000], str2[1000], *p, *p1, *p2, *p0, max;\n  while ((scanf(\"%s\", str1)) != EOF) {\n\n    scanf(\"%s \", str2);\n    len1 = strlen(str1);\n    p2 = str2;\n    p1 = str1;\n    max = str1[0];\n    for (p = str1; p < str1 + len1; p++)\n      if (max < *p) {\n        max = *p;\n        p0 = p;\n      }\n    for (; p1 < str1 + len1; p1++) {\n      if (p1 == p0) {\n        cout << *p1;\n        for (; *p2 != '\u0000'; p2++) {\n          if (*p2 == ' ')\n            continue;\n          else\n            printf(\"%c\", *p2);\n        }\n      }\n      if (p1 != p0)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36115", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n\n    cin.getline(str, 11, ' ');\n    cin >> substr;\n\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      cout << str[i];\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char a[11]) {\n  int i, n, m;\n  n = strlen(a);\n  m = 0;\n  for (i = 0; i < n - 1; i++)\n    if (a[m] < a[i + 1])\n      m = i + 1;\n  return (m);\n}\n\nint main() {\n  int i, len, m;\n  char a[11], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    len = strlen(a);\n    m = max(a);\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", b[i]);\n    for (i = m + 1; i < len; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[3], c[1000][15];\n  char t;\n  int i, j, k, n = 0;\n  int a[1000];\n  for (i = 0; i < 1000; i++) {\n    cin >> c[i];\n    if (c[i][0] != '\u0000') {\n      a[i] = strlen(c[i]);\n      n++;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    t = c[i][0];\n    str[1] = c[i][a[i] - 3];\n    str[2] = c[i][a[i] - 2];\n    str[3] = c[i][a[i] - 1];\n\n    for (j = 0; j < a[i] - 4; j++)\n      if (t < c[i][j])\n        t = c[i][j];\n    for (j = 0; j < a[i] - 4; j++)\n      if (t == c[i][j]) {\n        for (k = a[i] - 1; k >= j + 4; k--)\n          c[i][k] = c[i][k - 3];\n        c[i][a[i] - 1] = '\u0000';\n        c[i][j + 1] = str[1];\n        c[i][j + 2] = str[2];\n        c[i][j + 3] = str[3];\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    cout << c[i] << \" \";\n}\n"}
{"label": "20", "index": "36118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint f(char *p);\nint main() {\n  for (;;) {\n    char a[11], b[4];\n    int n, i;\n    cin >> a;\n    scanf(\"%s\", b);\n    if (a[0] == '\\0')\n      break;\n    n = f(a);\n    for (i = 0; i <= n; i++) {\n      printf(\"%c\", *(a + i));\n    }\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", *(b + i));\n    for (i = n + 1; *(a + i) != '\\0'; i++)\n      printf(\"%c\", *(a + i));\n    printf(\"\\n\");\n    a[0] = '\\0';\n  }\n}\n\nint f(char *p) {\n  int i, max = 0, t;\n  for (i = 0; *(p + i) != '\\0'; i++) {\n    if (*(p + i) > max) {\n      max = *(p + i);\n      t = i;\n    }\n  }\n  return t;\n}\n"}
{"label": "20", "index": "36119", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  char str1[14], str2[14];\n  int i = 0, n, k;\n  char max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0, max = str[0]; i < n; i++)\n      max = (max >= str[i]) ? max : str[i];\n    for (i = 0; i < n; i++) {\n      if (str[i] == max)\n        break;\n    }\n    k = i;\n    strncpy(str1, str, k + 1);\n    str1[k + 1] = '\\0';\n    for (i = 0; i < n - k - 1; i++)\n      str2[i] = str[k + 1 + i];\n    str2[i] = '\\0';\n    strcat(str1, substr);\n    strcat(str1, str2);\n    cout << str1 << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36120", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char max(char a[10]);\n  char a[100][15] = {'\\0'}, b[100][3];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    if (a[i][0] == '\\0')\n      break;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int m = strlen(a[i]);\n    char c[13] = {0};\n    int k = 0;\n    for (j = 0; j < m; j++) {\n      if (k == 0)\n        c[j] = a[i][j];\n      else if (k > 0)\n        c[j + 3] = a[i][j];\n      if ((a[i][j] == max(a[i])) && (k == 0)) {\n        c[j] = a[i][j];\n        c[j + 1] = b[i][0];\n        c[j + 2] = b[i][1];\n        c[j + 3] = b[i][2];\n        k++;\n      }\n    }\n    if (i < count - 1) {\n      printf(\"%s\\n\", c);\n    } else if (i == count - 1)\n      printf(\"%s\\n\", c);\n  }\n}\nchar max(char a[10]) {\n  int i;\n  char t = a[0];\n  for (i = 0; i < 10; i++)\n    if (a[i] > t)\n      t = a[i];\n  return (t);\n}\n"}
{"label": "20", "index": "36121", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    maxAsc = 0;\n    maxChar = 0;\n    lenth = strlen(str);\n    for (i = 0; i < lenth; i++) {\n      if (maxChar < *(str + i)) {\n        maxChar = *(str + i);\n        maxAsc = i;\n      }\n    }\n    str[lenth + 3] = 0;\n    for (i = lenth - 1; i > maxAsc; i--) {\n      *(str + i + 3) = *(str + i);\n    }\n    for (i = 0; i < 3; i++) {\n      *(str + maxAsc + i + 1) = *(substr + i);\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36122", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], substr[4], *p, t;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    t = *p;\n    j = 0;\n    k = strlen(str);\n    for (i = 0; i < k; i++, p++)\n      if (*p > t) {\n        t = *p;\n        j = i;\n      }\n\n    for (p = str, i = 0; i < j + 1; i++, p++)\n      printf(\"%c\", *p);\n    cout << substr;\n    for (i = j + 1; i < k; i++, p++)\n      printf(\"%c\", *p);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36123", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c[100][13], temp;\n  int i, n, k, len, j;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 13; j++)\n      c[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len = strlen(c[i]);\n    temp = c[i][0];\n    k = 0;\n    for (j = 0; j <= len - 5; j++) {\n      if (c[i][j] > temp) {\n        temp = c[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = len - 3; j < len; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = k + 1; j < len - 4; j++)\n      printf(\"%c\", c[i][j]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36124", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, L, zhi, j, k;\n  char str[15], substr[4], c;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    L = strlen(str);\n    c = str[0];\n    zhi = 0;\n    for (i = 1; i < L; i++) {\n      if (c < str[i]) {\n        c = str[i];\n        zhi = i;\n      }\n    }\n    for (j = 0; j <= zhi; j++)\n      printf(\"%c\", str[j]);\n\n    printf(\"%s\", substr);\n    for (k = zhi + 1; k < L; k++) {\n      printf(\"%c\", str[k]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36125", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], str1[10], substr[4], letter, result[13], b[10] = {'\u0000'},\n                                                         string[13];\n  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, m, l, i, j, time;\n  for (time = 1; time < 100; time++) {\n    for (i = 0; i < 10; i++) {\n      str[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      result[i] = '\u0000';\n    }\n    for (i = 0; i < 4; i++) {\n      substr[i] = '\u0000';\n    }\n    for (i = 0; i < 10; i++) {\n      a[i] = i;\n    }\n    for (i = 0; i < 10; i++) {\n      b[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      string[i] = '\u0000';\n    }\n\n    cin >> string;\n    if (strlen(string) == 0)\n      break;\n    for (i = 0; string[i] != ' '; i++) {\n      str[i] = string[i];\n    }\n\n    l = strlen(str);\n    for (i = l + 1, j = 0; i < l + 4, j < 3; i++, j++) {\n      substr[j] = string[i];\n    }\n    substr[3] = '\u0000';\n    strcpy(str1, str);\n    for (i = 0; i < l - 1; i++) {\n      for (j = 0; j < l - i - 1; j++) {\n        if (str1[j] < str1[j + 1]) {\n          letter = str1[j], m = a[j];\n          str1[j] = str1[j + 1], a[j] = a[j + 1];\n          str1[j + 1] = letter, a[j + 1] = m;\n        }\n      }\n    }\n    m = a[0];\n    strncpy(result, str, m + 1);\n    strcat(result, substr);\n    for (i = 0; i < l - m - 1; i++) {\n      str1[i] = str[i + m + 1];\n    }\n    strncpy(b, str1, l - m - 1);\n    strcat(result, b);\n    cout << result << \" \";\n  }\n}\n"}
{"label": "20", "index": "36126", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a;\n  char c, str[800], substr[4], str0[800], max;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    a = strlen(str);\n    max = str[0];\n    for (i = 0; i < a; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < a; i++)\n      if (str[i] == max)\n        break;\n    for (j = 0; j <= i; j++)\n      str0[j] = str[j];\n    for (j = i + 1; j < a; j++)\n      str0[j + 3] = str[j];\n    str0[i + 1] = substr[0];\n    str0[i + 2] = substr[1];\n    str0[i + 3] = substr[2];\n    for (i = 0; i < a + 3; i++)\n      printf(\"%c\", str0[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36127", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p, max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    max = str[0];\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = i;\n      }\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    for (i = 0; i <= s + 2; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, k;\n  char a[15], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    s = 0;\n    k = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > k) {\n        k = a[i];\n        s = i;\n      }\n    }\n\n    for (i = 0; i <= s; i++) {\n      cout << a[i];\n    }\n    printf(\"%s\", b);\n    for (i = s + 1; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36129", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][50], result[100][50];\n  int m, length[100], i = 0, j, l, max, p, k, t;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j <= p; j++)\n      result[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      result[i][j] = str[i][length[i] + j - p - 4];\n    for (j = p + 4; j < length[i]; j++)\n      result[i][j] = str[i][j - 3];\n    for (j = length[i] - 1; j < 50; j++)\n      result[i][j] = '\u0000';\n  }\n  for (j = 0; j < l; j++) {\n    t = strlen(result[j]);\n    for (k = 0; k < t; k++)\n      printf(\"%c\", result[j][k]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, num = 0, j, h;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int max = (int)str[0], len = strlen(str);\n    for (i = 1; i < len; i++) {\n      if (max < str[i]) {\n        max = (int)str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++)\n      printf(\"%c\", str[j]);\n\n    printf(\"%s\", substr);\n    for (h = num + 1; h < len; h++) {\n      cout << str[h];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, t;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    t = 0;\n    for (i = 0; str[i]; i++)\n      if (str[i] > t)\n        t = str[i];\n    for (i = 0; str[i]; i++) {\n      if (str[i] < t)\n        printf(\"%c\", str[i]);\n      else {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n        break;\n      }\n    }\n    for (j = i + 1; str[j]; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n\n    for (int i = 0; i < len1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    strcpy(s3, s1);\n\n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n\n    s4[0] = '\\0';\n    for (int i = maxi + 1; i < len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n\n    strcat(s3, s4);\n    cout << s3 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36133", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j = 0;\n  char str[20], substr[5];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n - 1; i >= j + 1; i--)\n      str[i + 3] = str[i];\n    str[i + 1] = substr[0];\n    str[i + 2] = substr[1];\n    str[i + 3] = substr[2];\n    str[n + 3] = '\\0';\n    cout << str << \"\\n\";\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[30][10];\n  char substr[30][3];\n  char ans[30][13];\n  char max;\n  char *a, *b, *c, *d;\n  int i, j, k, l, m, n;\n  for (i = 0; i < 30; i++) {\n    if (scanf(\"%s%s\", str[i], substr[i]) == EOF)\n      break;\n    l = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < l; j++)\n      if (max < str[i][j])\n        max = str[i][j];\n    for (j = 0; j < l; j++)\n      if (max == str[i][j])\n        break;\n    a = &str[i][0];\n    b = &substr[i][0];\n    c = &str[i][j + 1];\n    for (k = 0; k < j + 1; k++)\n      ans[i][k] = *(a + k);\n    for (m = 0; m < 3; k++, m++)\n      ans[i][k] = *(m + b);\n    for (n = 0; j + 1 + n < l; n++, k++)\n      ans[i][k] = *(c + n);\n    ans[i][k] = '\\0';\n  }\n  for (j = 0; j < i; j++) {\n    l = strlen(ans[j]);\n    for (k = 0; k < l - 1; k++) {\n      d = ans[j];\n      printf(\"%c\", *(d + k));\n    }\n    printf(\"%c\\n\", *(d + k));\n  }\n}\n"}
{"label": "20", "index": "36135", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, N;\n  char a[100] = {0}, b[100] = {0};\n  char *p = NULL;\n  while (cin >> a >> b) {\n    n = strlen(a);\n    N = a[0];\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > N) {\n        N = a[i];\n        p = &a[i];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      cout << a[i];\n      if (&a[i] == p)\n        printf(\"%s\", b);\n    }\n    for (i = 0; i < n; i++)\n      a[i] = 0;\n    for (i = 0; i < strlen(b); i++)\n      b[i] = 0;\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(char a[]) {\n  int i, t = a[0];\n  for (i = 0; i <= strlen(a); i++) {\n    if (t < a[i])\n      t = a[i];\n  }\n  i = 0;\n  while (a[i] != t)\n    i++;\n  return i;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i;\n    int t = max(str);\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, r, s;\n  char a[100][14] = {'\u0000'}, b[100][10] = {'\u0000'}, c[100][3] = {'\u0000'}, m;\n  for (i = 0, n = 0; i < 100; i++, n++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i]);\n    m = a[i][0];\n    for (j = 0; j < l - 4; j++)\n      if (a[i][j] > m) {\n        m = a[i][j];\n        k = j;\n      }\n    for (j = k + 1, r = 0; j < l - 4; j++, r++) {\n      b[i][r] = a[i][j];\n      a[i][j] = '\u0000';\n    }\n    a[i][l - 4] = '\u0000';\n    for (j = l - 3, s = 0; j < l; j++, s++) {\n      c[i][s] = a[i][j];\n      a[i][j] = '\u0000';\n    }\n    printf(\"%s \", strcat(strcat(a[i], c[i]), b[i]));\n  }\n}\n"}
{"label": "20", "index": "36138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[4], str1[15] = {0};\n  int i, j, k, e, b;\n  while ((scanf(\"%s%s\", str, substr)) != EOF) {\n    b = strlen(str);\n    for (j = 0; j < b; j++) {\n      e = 0;\n      for (k = 0; k < b; k++) {\n        if (str[k] > str[j])\n          e = 1;\n      }\n      if (e == 0)\n        break;\n    }\n    for (k = 0; k <= j; k++) {\n      str1[k] = str[k];\n    }\n    for (k = 0; k < 3; k++) {\n      str1[j + k + 1] = substr[k];\n    }\n    for (k = j + 1; k < b; k++) {\n      str1[k + 3] = str[k];\n    }\n    str1[b + 3] = 0;\n    strcpy(str, str1);\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36139", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[103][12], s2[103][4];\n  int i = 0, j, max = 0, k, u, len;\n  while (scanf(\"%s%s\", s1[i], s2[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    len = strlen(s1[j]);\n    max = 0;\n    u = 0;\n    for (k = 0; k < len; k++) {\n      if (s1[j][k] > max) {\n        max = s1[j][k];\n        u = k;\n      }\n    }\n    for (k = 0; k <= u; k++)\n      printf(\"%c\", s1[j][k]);\n    for (k = 0; k <= 2; k++)\n      printf(\"%c\", s2[j][k]);\n    for (k = u + 1; k < len; k++)\n      printf(\"%c\", s1[j][k]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36140", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[15], s2[4], s3[20], s4[20], max;\n  int i, j, k, n1, n2;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    n1 = strlen(s1);\n    n2 = strlen(s2);\n\n    strcpy(s3, \" \");\n    strcpy(s4, \" \");\n    max = s1[0];\n    for (i = 0, k = 0; i < n1; i++) {\n      if (s1[i] > max) {\n        max = s1[i];\n        k = i;\n      }\n    }\n\n    strncpy(s3, s1, k + 1);\n    s3[k + 1] = '\\0';\n    strcat(s3, s2);\n\n    for (i = k + 1, j = 0; s1[i] != '\\0'; i++, j++)\n      s4[j] = s1[i];\n\n    s4[j] = '\\0';\n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36141", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str[10];\nchar substr[3];\nint pan() {\n  int j, i, x, qq = strlen(str) - 1;\n  for (i = 0; i < strlen(str); i++) {\n    x = 0;\n    for (j = 0; j < strlen(str); j++) {\n      if (str[i] < str[j]) {\n        x = 0;\n        break;\n      }\n      x = 1;\n    }\n    if (x == 1) {\n      qq = i;\n      break;\n    }\n  }\n  return qq;\n}\n\nint main() {\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i;\n    for (i = 0; i <= pan(); i++)\n      cout << str[i];\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = pan() + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n  *dizhi = str[j];\n\n  for (j = 0; j < ceshi; j++) {\n\n    weizhi = 1;\n    max = *(*dizhi);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36143", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int n, i, k;\n  cin >> str >> substr;\n  n = strlen(str);\n  k = 0;\n  for (i = 1; i < n; i++)\n    if (str[i] > str[k])\n      k = i;\n  for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n    str[i] = str[i - 3];\n  str[k + 1] = substr[0];\n  str[k + 2] = substr[1];\n  str[k + 3] = substr[2];\n  for (i = 0; i <= n + 3 - 1; i++)\n    printf(\"%c\", str[i]);\n  for (i = 0; i <= 13; i++)\n    str[i] = '\\0';\n\n  for (;;) {\n    scanf(\"%s %s\", str, substr);\n    if (str[0] == '\\0')\n      break;\n    n = strlen(str);\n    k = 0;\n    for (i = 1; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n      str[i] = str[i - 3];\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    cout << \"\\n\";\n    for (i = 0; i <= n + 3 - 1; i++)\n      cout << str[i];\n    for (i = 0; i <= 13; i++)\n      str[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "36144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, num = 0, j, h;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int max = (int)str[0], len = strlen(str);\n    for (i = 1; i < len; i++) {\n      if (max < str[i]) {\n        max = (int)str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++)\n      printf(\"%c\", str[j]);\n\n    printf(\"%s\", substr);\n    for (h = num + 1; h < len; h++) {\n      printf(\"%c\", str[h]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar max(char ch[], int len) {\n  int i;\n  char t;\n  for (i = 0; i < len - 1; i++)\n    if (ch[i] > ch[i + 1]) {\n      t = ch[i];\n      ch[i] = ch[i + 1];\n      ch[i + 1] = t;\n    }\n  return ch[len - 1];\n}\nint main() {\n  char str[20], sub[4], x[20], m;\n  int len, i;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    len = strlen(str);\n    strcpy(x, str);\n    m = max(x, len);\n    i = 0;\n    do {\n      printf(\"%c\", str[i]);\n      i++;\n    } while (str[i] != m);\n    printf(\"%c\", str[i]);\n    printf(\"%s\", sub);\n    for (++i; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36146", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid insert(char str[], char substr[]) {\n  int i, j, k, lenstr, lensubstr, lentemp, max;\n  char temp[10] = {0};\n  lenstr = strlen(str);\n  lensubstr = strlen(substr);\n  max = 0;\n  for (i = 0; i <= lenstr - 1; i++) {\n    if (str[i] > str[max])\n      max = i;\n  }\n  for (i = 0, j = max + 1; j <= lenstr - 1; i++, j++)\n    temp[i] = str[j];\n  lentemp = strlen(temp);\n  for (i = 0, j = max + 1; i <= lensubstr; i++, j++)\n    str[j] = substr[i];\n  for (i = 0, k = j - 1; i <= lentemp - 1; i++, k++)\n    str[k] = temp[i];\n}\nint main() {\n  char str[20] = {0}, substr[4] = {0};\n  int len, i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    insert(str, substr);\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i <= 19; i++) {\n      str[i] = 0;\n    }\n    for (i = 0; i <= 3; i++)\n      substr[i] = 0;\n  }\n}\n"}
{"label": "20", "index": "36147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], nstr[15];\n  char maxchar = '\u0000';\n  int i, j, len, max = 0;\n  while (1) {\n    maxchar = '\u0000';\n    if ((str[0] = getchar()) == EOF)\n      exit(-1);\n\n    cin >> &str[1];\n    len = strlen(str);\n    for (i = len - 5; i >= 0; i--) {\n      if (str[i] >= maxchar) {\n        max = i;\n        maxchar = str[i];\n      }\n    }\n    for (i = 0; i <= max; i++)\n      nstr[i] = str[i];\n\n    for (i = max + 1; i < len - 4; i++) {\n      nstr[i + 3] = str[i];\n    }\n    for (i = len - 3, j = 1; i < len; i++, j++) {\n      nstr[max + j] = str[i];\n    }\n    nstr[len - 1] = '\u0000';\n    printf(\"%s \", nstr);\n  }\n}\n"}
{"label": "20", "index": "36148", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, l1;\n  char str1[15], str2[4], c, d;\n  while (scanf(\"%s\", str1) != EOF) {\n    scanf(\"%s \", str2);\n    c = 0;\n    l1 = strlen(str1);\n    for (i = 0; i < l1; i++) {\n      d = (int)str1[i];\n      if (d > c) {\n        c = d;\n        j = i;\n      }\n    }\n    for (k = l1 + 2, str1[k + 1] = '\\0'; k > j; k--) {\n      str1[k] = str1[k - 3];\n    }\n    str1[j + 3] = str2[2];\n    str1[j + 2] = str2[1];\n    str1[j + 1] = str2[0];\n    puts(str1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36149", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid body() {\n  char str[11];\n  char substr[4];\n  char c;\n  int i = 0, k;\n  char *p;\n  scanf(\"%s %s\", str, substr);\n  c = *(str + strlen(str) - 1);\n  k = strlen(str);\n  for (i = strlen(str) - 1; i > -1; i--) {\n    if (str[i] >= c) {\n      k = i + 1;\n      c = *(str + i);\n    }\n  }\n  p = str;\n  if (strlen(str) >= 11 || strlen(substr) >= 4) {\n    return;\n  }\n  for (i = 0; i < k; i++)\n    printf(\"%c\", *(p + i));\n\n  printf(\"%s\", substr);\n  printf(\"%s\\n\", p + i);\n  body();\n}\n\nint main() { body(); }\n"}
{"label": "20", "index": "36150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid swap(char a[], int n) {\n  int i, j;\n  char t;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (a[i] < a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\nint main() {\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    char m[100];\n    strcpy(m, s1);\n    int l = strlen(m);\n    swap(m, l);\n    int i, j, k;\n    for (i = 0; i < l; i++)\n      if (s1[i] == m[0]) {\n        j = i;\n        break;\n      }\n    for (k = 0; k <= j; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s2);\n    for (i = j + 1; i < l; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ceshi, i = 0, j, max, weizhi, chang, k;\n  char str[30][15] = {'\\0'}, substr[30][3] = {'\\0'}, a[30][18] = {'\\0'};\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    i++;\n  }\n\n  ceshi = i;\n\n  for (i = 0; i < ceshi; i++) {\n    max = str[i][0];\n    weizhi = 0;\n\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        weizhi = j;\n        max = str[i][j];\n      }\n    }\n\n    strncpy(a[i], str[i], weizhi + 1);\n    a[i][weizhi + 1] = '\\0';\n\n    strcat(a[i], substr[i]);\n\n    for (j = 1; str[i][j + weizhi] != '\\0'; j++) {\n      a[i][weizhi + 3 + j] = str[i][j + weizhi];\n    }\n\n    chang = strlen(str[i]);\n\n    a[i][chang + 3] = '\\0';\n\n    cout << a[i] << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36152", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  char str1[14], str2[14];\n  int i = 0, n, k;\n  char max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0, max = str[0]; i < n; i++)\n      max = (max >= str[i]) ? max : str[i];\n    for (i = 0; i < n; i++) {\n      if (str[i] == max)\n        break;\n    }\n    k = i;\n    strncpy(str1, str, k + 1);\n    str1[k + 1] = '\\0';\n    for (i = 0; i < n - k - 1; i++)\n      str2[i] = str[k + 1 + i];\n    str2[i] = '\\0';\n    strcat(str1, substr);\n    strcat(str1, str2);\n    cout << str1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[10][11], substr[10][4], output[10][14] = {'\\0'};\n  int maxN = 0, i = 0, j, end;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    \n    i++;\n  }\n  end = i;\n  for (i = 0; i < end; i++) {\n    char max = str[i][0], *p;\n    p = output[i];\n    for (j = 0; j < strlen(str[i]); j++)\n      if ((int)str[i][j] > (int)max) {\n        max = str[i][j];\n        maxN = j + 1;\n      }\n    strncpy(p, str[i], maxN);\n    strcat(p, substr[i]);\n    strcat(p + strlen(output[i]), str[i] + maxN);\n    printf(\"%s\\n\", output[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36154", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n    cin.getline(str, 11, ' ');\n    cin.getline(substr, 4, '\\n');\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      cout << str[i];\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      cout << str[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36155", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20][10] = {'\\0'}, substr[20][3];\n  int i = 0, j, max, k;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF)\n    i++;\n  for (i = 0; str[i][0] != '\\0'; i++) {\n    k = 0;\n    max = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[i][j]);\n    for (j = k + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36156", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], sub[4], *a, *b;\n  int max, i, t, n;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    max = 0;\n    a = str;\n    b = sub;\n    n = strlen(str);\n    for (i = n - 1; i >= 0; i--)\n      if (*(a + i) >= max) {\n        t = i;\n        max = *(a + i);\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", *(a + i));\n    printf(\"%s\", b);\n    for (i = t + 1; i < n; i++) {\n      printf(\"%c\", *(a + i));\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36157", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[100][15] = {'\u0000'};\n  int i, n, l, a, k, t;\n  i = 0;\n  do {\n    cin >> s[i];\n    i++;\n  } while (s[i - 1][0] != '\u0000');\n  n = i - 2;\n  for (i = 0; i <= n; i++) {\n    l = strlen(s[i]);\n    a = s[i][0];\n    for (k = 1; k < l - 4; k++) {\n      if (s[i][k] > a) {\n        a = s[i][k];\n        t = k;\n      }\n    }\n    for (k = 0; k <= t; k++)\n      printf(\"%c\", s[i][k]);\n    for (k = l - 3; k <= l - 1; k++)\n      cout << s[i][k];\n    for (k = t + 1; k < l - 4; k++)\n      printf(\"%c\", s[i][k]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36158", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, i, max_index;\n  char str1[20], str2[10], ans[20], t[20];\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; str1[i]; i++) {\n      if (str1[i] > max) {\n        max = str1[i];\n        max_index = i;\n      }\n    }\n    strcpy(ans, \"\");\n    strncat(ans, str1, max_index + 1);\n    strcat(ans, str2);\n    for (i = max_index + 1; str1[i]; i++) {\n      t[i - max_index - 1] = str1[i];\n    }\n    t[i - max_index - 1] = '\\0';\n    strcat(ans, t);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint f(char *p);\nint main() {\n  for (;;) {\n    char a[11], b[4];\n    int n, i;\n    cin >> a;\n    cin >> b;\n    if (a[0] == '\\0')\n      break;\n    n = f(a);\n    for (i = 0; i <= n; i++)\n      cout << *(a + i);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", *(b + i));\n    for (i = n + 1; *(a + i) != '\\0'; i++)\n      printf(\"%c\", *(a + i));\n    printf(\"\\n\");\n    a[0] = '\\0';\n  }\n}\n\nint f(char *p) {\n  int i, max = 0, t;\n  for (i = 0; *(p + i) != '\\0'; i++) {\n    if (*(p + i) > max) {\n      max = *(p + i);\n      t = i;\n    }\n  }\n  return t;\n}\n"}
{"label": "20", "index": "36160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[101];\n  char str[15], substr[4], x[20];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[c] < str[i]) {\n        c = i;\n      }\n    for (j = 0; j <= c; j++)\n      x[j] = str[j];\n    for (j = c + 1; j <= c + 3; j++)\n      x[j] = substr[j - c - 1];\n    if (c < n - 1)\n      for (j = c + 4; j < n + 3; j++)\n        x[j] = str[j - 3];\n    for (i = 0; i < n + 3; i++)\n      putchar(x[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36161", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], substr[100], max;\n  int a, b, c, i, d, e, num;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    a = strlen(str);\n    b = strlen(substr);\n    max = str[0];\n    num = 0;\n    for (i = 0; i < a; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        num = i + 1;\n      }\n    }\n    for (c = 0; c <= num; c++) {\n      printf(\"%c\", str[c]);\n    }\n    for (d = 0; d < b; d++)\n      printf(\"%c\", substr[d]);\n\n    for (e = num + 1; e < a; e++)\n      printf(\"%c\", str[e]);\n\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint MaxIndex(char *str) {\n  char maxChar = 0;\n  int i = 0, j = 0;\n  while (*str != 0) {\n    if (maxChar < *str) {\n      maxChar = *str;\n      i = j;\n    }\n    j++;\n    str++;\n  }\n  return i;\n}\nvoid fun(char *str, char *substr) {\n  int max = MaxIndex(str);\n  str += max;\n  char *temp = str;\n  while (*(temp++) != 0) {\n    ;\n  }\n  *(temp + 3) = 0;\n  while ((--temp) != str) {\n    *(temp + 3) = *temp;\n  }\n  while (*substr != 0) {\n    *(++temp) = *substr++;\n  }\n}\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    fun(str, substr);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++)\n        if (str[i] >= str[j])\n          k++;\n      if (k == n)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    printf(\"%s\", substr);\n    for (j = i + 1; j < n; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int ceshi, i = 0, j, max, weizhi, chang, k;\n  char str[30][15] = {'\\0'}, substr[30][3] = {'\\0'}, a[30][18] = {'\\0'};\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    i++;\n  } \n\n  ceshi = i;\n\n  for (i = 0; i < ceshi; i++) {\n    max = str[i][0];\n    weizhi = 0;\n\n    for (j = 0; str[i][j] != '\\0'; j++) { \n      if (str[i][j] > max) {\n        weizhi = j;\n        max = str[i][j];\n      }\n    }\n\n    strncpy(a[i], str[i], weizhi + 1);\n    a[i][weizhi + 1] = '\\0'; \n\n    strcat(a[i], substr[i]); \n\n    for (j = 1; str[i][j + weizhi] != '\\0'; j++) {\n      a[i][weizhi + 3 + j] = str[i][j + weizhi]; \n    }\n\n    chang = strlen(str[i]);\n\n    a[i][chang + 3] = '\\0'; \n\n    printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "20", "index": "36165", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n;\n  char str[11], substr[4];\n  int max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    char *p1;\n    char *p2;\n    char *p3;\n    p1 = str, p2 = str, p3 = str;\n    max = str[0];\n    for (i = 0; i < n; i++) {\n      if (*(p1 + i) > max) {\n        max = *(p1 + i);\n        p2 = p1 + i;\n      }\n    }\n    for (p1 = str; p1 < (p2 + 1); p1++)\n      printf(\"%c\", *p1);\n    for (i = 0; i < 3; i++)\n      cout << substr[i];\n    for (p1 = p2 + 1; p1 < (p3 + n); p1++)\n      printf(\"%c\", *p1);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36166", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], subs[4];\n  int l1, i, max;\n  while (scanf(\"%s%s\", str, subs) != EOF) {\n    l1 = strlen(str);\n\n    max = 0;\n    for (i = 0; i < l1; i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n    for (i = 0; i <= max; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", subs);\n    for (i = max + 1; i < l1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char a[15]) {\n  char m, c;\n  int i, l = 0, j, k;\n  j = strlen(a);\n  if (strlen(a) == 0 || a[0] < 33 || a[0] > 126)\n    return;\n  m = 0;\n  for (i = 0; i < j - 4; i++)\n    if (m < a[i]) {\n      m = a[i];\n      l = i + 1;\n    }\n  for (i = 0; i < 3; i++) {\n    c = a[j - 3 + i];\n    for (k = j - 3 + i; k > l + i; k--)\n      a[k] = a[k - 1];\n    a[l + i] = c;\n  }\n  for (i = 0; i < j - 2; i++)\n    printf(\"%c\", a[i]);\n  printf(\"%c \", a[j - 2]);\n}\nint main() {\n  char b[50][15];\n  int l = 0, i;\n  do {\n\n    cin >> b[l];\n    if (strlen(b[l]) == 0 || b[l][0] < 33 || b[l][0] > 126)\n      break;\n    l = l + 1;\n  } while (b[l - 1][0] != '\u0000');\n  for (i = 0; i < l; i++)\n    insert(b[i]);\n}\n"}
{"label": "20", "index": "36168", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  char str1[14], str2[14];\n  int i = 0, n, k;\n  char max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0, max = str[0]; i < n; i++)\n      max = (max >= str[i]) ? max : str[i];\n    for (i = 0; i < n; i++) {\n      if (str[i] == max)\n        break;\n    }\n    k = i;\n    strncpy(str1, str, k + 1);\n    str1[k + 1] = '\\0';\n    for (i = 0; i < n - k - 1; i++)\n      str2[i] = str[k + 1 + i];\n    str2[i] = '\\0';\n    strcat(str1, substr);\n    strcat(str1, str2);\n    printf(\"%s\\n\", str1);\n  }\n}\n"}
{"label": "20", "index": "36169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][11], substr[100][4], a[100][15];\n  int q, i, j, k, m, n, x, y;\n  for (i = 1; scanf(\"%s%s\", str[i], substr[i]) != EOF; i++) {\n    x = strlen(str[i]);\n    y = strlen(substr[i]);\n    for (j = 0; j <= x - 1; j++) {\n      for (m = 0, k = 0; k <= x - 1; k++)\n        if (str[i][j] >= str[i][k]) {\n          m++;\n        }\n      if (m == x) {\n        n = j + 1;\n        break;\n      }\n    }\n    strncpy(a[i], str[i], n);\n    a[i][n] = '\\0';\n    strcat(a[i], substr[i]);\n    for (j = n + y; j < x + y; j++)\n      a[i][j] = str[i][j - y];\n    a[i][x + y] = '\\0';\n    printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "20", "index": "36170", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, s, p = 0, m = 0;\n  char str[10], substr[3], d;\n  do {\n    if (p)\n      for (k = 1;; k++) {\n        str[k] = getchar();\n        if (str[k] == ' ') {\n          str[k] = '\\0';\n          break;\n        }\n      }\n    else\n      cin >> str;\n    scanf(\"%s\", substr);\n    d = getchar();\n    for (k = 0; k < strlen(str); k++)\n      if ((int)str[k] > m) {\n        s = k;\n        m = (int)str[k];\n      }\n    for (k = 0; k <= s; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", substr);\n    for (k = s + 1; k < strlen(str); k++) {\n      printf(\"%c\", str[k]);\n    }\n    printf(\"\\n\");\n    m = 0;\n    p += 1;\n  } while ((str[0] = getchar()) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36171", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[11], b[4], c[15];\n  while (scanf(\"%s\", a) != EOF) {\n    cin >> b;\n    char *pa, *pb, *pc;\n    char *pm;\n    int len;\n    pa = a;\n    pb = b;\n    pm = pa;\n    len = strlen(a);\n    for (; pa < a + len; pa++)\n      if (*pm < *pa)\n        pm = pa;\n    for (pa = a, pc = c; pa <= pm; pa++, pc++)\n      *pc = *pa;\n    for (pb = b; pb < (b + 3); pb++, pc++)\n      *pc = *pb;\n    for (; pa < (a + len); pa++, pc++)\n      *pc = *pa;\n    *pc = '\\0';\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36172", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char from[100];\n  char to[100];\n  while (1) {\n    int max = 0;\n    char str[1000];\n    cin.getline(str, 999);\n    if (str[0] == '\\0') {\n      return 0;\n    }\n    int lenstr = strlen(str);\n    if (lenstr == 0) {\n      return 0;\n    };\n    int i;\n    for (i = 0; i < lenstr; i++) {\n      if (str[i] == ' ') {\n        break;\n      }\n      from[i] = str[i];\n    }\n    from[i] = '\\0';\n    int k;\n    k = 0;\n    for (++i; i < lenstr; i++) {\n      to[k] = str[i];\n      k++;\n    }\n    to[k] = '\\0';\n    int len;\n    len = strlen(from);\n    int maxpos = 0;\n    for (i = 0; i < len; i++) {\n      if (from[i] > max) {\n        max = from[i];\n        maxpos = i;\n      }\n    }\n    int j;\n    for (j = 0; j <= maxpos; j++)\n      printf(\"%c\", from[j]);\n\n    for (i = 0; to[i] != '\\0'; i++) {\n      printf(\"%c\", to[i]);\n    }\n\n    for (; from[j] != '\\0'; j++) {\n      printf(\"%c\", from[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36173", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  char a[20] = {0}, b[4] = {0}, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    int n, i, maxnum;\n\n    n = strlen(a);\n    maxnum = 0;\n    max = a[0];\n    for (i = 0; i < n; i++) {\n      if (max < a[i]) {\n        max = a[i];\n        maxnum = i;\n      }\n    }\n\n    for (i = n; i > maxnum; i--) {\n      a[i + 3] = a[i];\n    }\n    for (i = 0; i < 3; i++) {\n      a[maxnum + 1 + i] = b[i];\n    }\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "20", "index": "36174", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[15], substr[4];\n  int i, j, max, c;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 1, max = str[0], c = 0; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        c = i;\n      }\n    }\n    for (j = i + 3; j > c + 3; j--)\n      str[j] = str[j - 3];\n\n    str[c + 1] = substr[0];\n    str[c + 2] = substr[1];\n    str[c + 3] = substr[2];\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36175", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {0};\n  for (j = 0;; j++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36176", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int m;\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    int k = 0;\n    int j;\n    for (j = 1; j < m; j++)\n      if (s1[j] > s1[k])\n        k = j;\n    for (j = 0; j <= k; j++)\n      s3[j] = s1[j];\n    s3[k + 1] = s2[0];\n    s3[k + 2] = s2[1];\n    s3[k + 3] = s2[2];\n    for (j = k + 4; j < m + 3; j++)\n      s3[j] = s1[j - 3];\n    for (j = 0; j < m + 3; j++)\n      printf(\"%c\", s3[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36177", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100];\n  char b[100];\n  char c[100];\n  char d[100];\n  char e[1];\n  int i, j, k;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    e[0] = a[0];\n    k = 0;\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] > e[0]) {\n        e[0] = a[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++) {\n      c[i] = a[i];\n    }\n    c[i] = '\\0';\n    for (j = k + 1; a[j] != '\\0'; j++) {\n      d[j - k - 1] = a[j];\n    }\n    d[j - k - 1] = '\\0';\n    strcat(c, b);\n    strcat(c, d);\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20] = {0}, substr[4] = {0}, max = 0, medium[20] = {0};\n  int i, j, length, mark;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    max = 0;\n    length = strlen(str);\n    for (i = 0; i < length; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        mark = i;\n      }\n    }\n    for (j = 0, i = mark + 1; i < length; i++, j++) {\n      medium[j] = str[i];\n      str[i] = 0;\n    }\n    strcat(str, substr);\n    strcat(str, medium);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < 10; i++) {\n      medium[i] = 0;\n      str[i] = 0;\n    }\n  }\n}\n"}
{"label": "20", "index": "36179", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar *findmax(char *p) {\n  char *max;\n  for (max = p; *p != '\\0'; p++)\n    if (*p > *max)\n      max = p;\n  return max;\n}\n\nvoid insert(char *op, char *sp) {\n  for (; *op != *findmax(op); op++)\n    printf(\"%c\", *op);\n  printf(\"%c\", *op);\n\n  for (; *sp != '\\0'; sp++)\n    printf(\"%c\", *sp);\n\n  for (op++; *op != '\\0'; op++)\n    printf(\"%c\", *op);\n\n  printf(\"\\n\");\n}\n\nint main() {\n  char ori[10], sub[3], newstr[13];\n  char *orip = ori, *subp = sub, *newstrp = newstr;\n  while (scanf(\"%s %s\", ori, sub) != EOF)\n    insert(orip, subp);\n  return 0;\n}\n"}
{"label": "20", "index": "36180", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int n, i, j;\n  char *p1;\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    p1 = &a[0];\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] > *p1) {\n        p1 = &a[i];\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (&a[i] != p1)\n        printf(\"%c\", a[i]);\n      if (&a[i] == p1)\n        printf(\"%c%c%c%c\", *p1, b[0], b[1], b[2]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l;\n  char str[20], sub[20], *max, *p, temp;\n  while (scanf(\"%s \", str)) {\n    l = strlen(str);\n    cin >> sub;\n    max = str;\n    for (p = str; p <= str + l; p++) {\n      if (*max < *p) {\n        max = p;\n      }\n    }\n    temp = *max;\n    *max = 0;\n    cout << str << temp << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36182", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, m, c, f;\n  char str[20], substr[10], de[20], max;\n  char *p, *q, *t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    max = 0;\n    for (p = str; p < (str + n); p++)\n      if (*p > max) {\n        max = *p;\n        t = p;\n      }\n\n    for (p = str, i = 0; p < (t + 1); p++)\n      de[i++] = *p;\n    for (c = i, q = substr; q < (substr + m); q++)\n      de[c++] = *q;\n    for (p = (t + 1), f = c; p < (str + n); p++)\n      de[f++] = *p;\n    for (q = de; q < (f + de); q++)\n      cout << *q;\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36183", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  while (cin >> str >> substr) {\n    int size = 0;\n    for (int i = 0; i <= 10; i++) {\n      if (str[i] == '\\0') {\n        size = i;\n        break;\n      }\n    }\n    int tmp = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] > tmp) {\n        tmp = str[i];\n      }\n    }\n    int j = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] == tmp) {\n        j = i;\n        break;\n      }\n    }\n    for (int i = 0; i <= j; i++) {\n      cout << str[i];\n    }\n    cout << substr;\n    if (j < size - 1) {\n      for (int i = j + 1; i < size; i++) {\n        cout << str[i];\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36184", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j, i, max = 0;\n  char str[11] = {0}, substr[4] = {0}, s[20] = {0}, *p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    j = 0;\n    p = &str[0];\n    for (i = 0; str[i] != 0; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = &str[i];\n        j = i;\n      }\n    strncat(s, str, j + 1);\n    strcat(s, substr);\n    strcat(s, p + 1);\n    cout << s << \"\\n\";\n    strcpy(s, \"\");\n    strcpy(str, \"\");\n    strcpy(substr, \"\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36185", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char *str, *substr;\n  int max;\n  str = (char *)malloc(20 * sizeof(char));\n  substr = (char *)malloc(20 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (*(str + i) > max)\n        max = *(str + i);\n    }\n    for (i = 0; i < n; i++) {\n      if (*(str + i) == max) {\n        for (j = 0; j <= i; j++)\n          printf(\"%c\", *(str + j));\n\n        printf(\"%s\", substr);\n        if (i == n - 1) {\n          printf(\"\\n\");\n          break;\n        }\n        for (j = i + 1; j < n - 1; j++)\n          printf(\"%c\", *(str + j));\n        printf(\"%c\\n\", *(str + n - 1));\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "20", "index": "36186", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], sub[4], a;\n  int i, j, b;\n  for (i = 0;; i++) {\n    if (scanf(\"%s %s\", str, sub) == EOF) {\n      break;\n    } else {\n      a = 0;\n      b = 0;\n      for (j = 0; j < strlen(str); j++) {\n        if (str[j] > a) {\n          a = str[j];\n          b = j;\n        }\n      }\n      for (j = 0; j <= b; j++) {\n        printf(\"%c\", str[j]);\n      }\n      printf(\"%s\", sub);\n      for (j = b + 1; j < strlen(str); j++) {\n        printf(\"%c\", str[j]);\n      }\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36187", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14], c, fd;\n  int i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a, int b, char d[]) {\n  int i;\n  for (i = a; i <= b; i++)\n    printf(\"%c\", d[i]);\n}\nint arrange(char a[]) {\n  int i, m = 0;\n  int t = a[0];\n  int l = strlen(a);\n  for (i = 1; i < l; i++) {\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36189", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20][10], string[20][4], d;\n  int i, j, m[20] = {0}, l[20];\n  for (i = 0;; i++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str[i], &string[i]) == EOF)\n      break;\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if ((int)str[i][j] > m[i])\n        m[i] = str[i][j];\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if (m[i] == str[i][j]) {\n        l[i] = j;\n        break;\n      }\n    for (j = 0; j <= l[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < strlen(string[i]); j++)\n      printf(\"%c\", string[i][j]);\n    for (j = l[i] + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36190", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, max = 0;\n  char str[100], substr[100], m;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = str[0];\n    for (i = 0; i < n; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        max = i;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      cout << str[i];\n      if (i == max)\n        printf(\"%s\", substr);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36191", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], string[14], *p;\n  int i, index;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    for (i = 1; str[i]; i++)\n\n      if (str[i] > *p) {\n        index = i;\n        p = &str[i];\n      }\n    string[0] = '\\0';\n    strncat(string, str, index + 1);\n    strcat(string, substr);\n    strcat(string, p + 1);\n    cout << string << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36192", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[11], s2[4];\n  int i, j, n, b;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1) - 1;\n    j = 0;\n    b = s1[0];\n    for (i = 0; i <= n - 1; i++) {\n      if (b < s1[i]) {\n        j = i;\n        b = s1[i];\n      }\n    } \n    \n    for (i = 0; i <= j; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s2);\n    while (j < n) {\n      printf(\"%c\", s1[j + 1]);\n      j++;\n    }\n    printf(\"\\n\");\n    \n    \n  }\n}\n"}
{"label": "20", "index": "36193", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, m = 0;\n  char str[20] = {'0'}, substr[4] = {'0'}, max = 0;\n  while (1) {\n    cin >> str >> substr;\n    if (str[0] == 0)\n      break;\n\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    if (m == l - 1) {\n      for (i = l; i = l + 2; i++)\n        str[i] = substr[i - l];\n    } else {\n      for (i = l - 1; i > m; i--)\n        str[i + 3] = str[i];\n      for (i = m + 1; i < m + 4; i++)\n        str[i] = substr[i - m - 1];\n    }\n    printf(\"%s\\n\", str);\n    m = 0;\n    max = 0;\n    for (i = 0; i < 20; i++)\n      str[i] = 0;\n    for (i = 0; i < 3; i++)\n      substr[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36194", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      if (a[k] < a[i])\n        k = i;\n    for (i = 12; i > k + 3; i--)\n      a[i] = a[i - 3];\n    for (i = k + 1; i < k + 4; i++)\n      a[i] = b[i - k - 1];\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36195", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c1[11], c2[4];\n  char ans[20];\n  while (scanf(\"%s%s\", c1, c2) != EOF) {\n    char ans[20] = {0};\n    int i, max, max_num, n, j, m;\n    max = 0;\n    n = strlen(c1);\n    for (i = 0; i <= n; i++) {\n      if (c1[i] > max) {\n        max = c1[i];\n        max_num = i;\n      }\n    }\n    for (i = 0; i <= max_num; i++)\n      ans[i] = c1[i];\n    strcat(ans, c2);\n    n = strlen(c1);\n    m = strlen(ans);\n    j = 0;\n    for (i = max_num + 1; i <= n; i++) {\n      ans[m + j] = c1[i];\n      j++;\n    }\n    printf(\"%s\\n\", ans);\n  }\n}\n"}
{"label": "20", "index": "36196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][11] = {0}, substr[100][4] = {0}, a[100][20] = {0}, *p, *q, *i;\n  int n, t = 1, max, x;\n  while (scanf(\"%s %s\", str[t], substr[t]) != EOF)\n    t++;\n  for (n = 1; n <= t; n++) {\n    p = str[n];\n    max = str[n][0];\n    for (; *p != 0; p++)\n      if (*p > max) {\n        max = *p;\n        q = p;\n      }\n    p = str[n];\n    for (x = 0; p <= q; x++)\n      a[n][x] = *p++;\n    a[n][x] = substr[n][0];\n    a[n][x + 1] = substr[n][1];\n    a[n][x + 2] = substr[n][2];\n    i = a[n] + x + 3;\n    strcpy(i, p);\n    cout << a[n] << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36197", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char *p);\nint main() {\n  for (;;) {\n    char a[11], b[4];\n    int n, i;\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    if (a[0] == '\\0')\n      break;\n    n = f(a);\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", *(a + i));\n    for (i = 0; i <= 2; i++) {\n      printf(\"%c\", *(b + i));\n    }\n    for (i = n + 1; *(a + i) != '\\0'; i++)\n      printf(\"%c\", *(a + i));\n    printf(\"\\n\");\n    a[0] = '\\0';\n  }\n}\n\nint f(char *p) {\n  int i, max = 0, t;\n  for (i = 0; *(p + i) != '\\0'; i++) {\n    if (*(p + i) > max) {\n      max = *(p + i);\n      t = i;\n    }\n  }\n  return t;\n}\n"}
{"label": "20", "index": "36198", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint findmax(char *str) {\n  int i, max = *str, ret = 0;\n  for (i = 0; *(str + i); i++)\n    if (*(str + i) > max) {\n      max = *(str + i);\n      ret = i;\n    }\n  return ret;\n}\n\nvoid insert(char *str, char *substr, int index) {\n  int i;\n  char *p;\n  for (p = str + strlen(str); p > str + index; p--)\n    *(p + strlen(substr)) = *p;\n  for (i = 0; i < strlen(substr); i++)\n    *(str + index + 1 + i) = *(substr + i);\n}\n\nint main() {\n  int k;\n  char *str, *substr;\n  str = (char *)malloc(11 * sizeof(char));\n  substr = (char *)malloc(3 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = findmax(str);\n    insert(str, substr, k);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36199", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid insert(char a[10], char b[4]) {\n  int len;\n  len = strlen(a);\n  int i, temp = 0;\n  for (i = 0; i < len; i++)\n    if (a[temp] - a[i] < 0)\n      temp = i;\n  for (i = 0; i <= temp; i++)\n    cout << a[i];\n  printf(\"%c%c%c\", b[0], b[1], b[2]);\n  for (i = temp + 1; i < len; i++)\n    printf(\"%c\", a[i]);\n  cout << endl;\n}\nint main() {\n  char str[10] = {0}, substr[4] = {0};\n  while (scanf(\"%s %s \", str, substr))\n    insert(str, substr);\n  return 0;\n}\n"}
{"label": "20", "index": "36200", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11] = {'\\0'}, b[4] = {'\\0'};\n  char c;\n  int i, k, m;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    m = strlen(a);\n    c = a[0];\n    for (i = 1; i < m; i++)\n      if (a[i] > c) {\n        c = a[i];\n        k = i;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    cout << b;\n    for (i = k + 1; i < m; i++) {\n      printf(\"%c\", a[i]);\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36201", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], substr[4], *p, t;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    t = *p;\n    j = 0;\n    k = strlen(str);\n    for (i = 0; i < k; i++, p++)\n      if (*p > t) {\n        t = *p;\n        j = i;\n      }\n\n    for (p = str, i = 0; i < j + 1; i++, p++)\n      cout << *p;\n    cout << substr;\n    for (i = j + 1; i < k; i++, p++)\n      printf(\"%c\", *p);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36202", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[14], substr[4];\n  int i, n, k = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n; i > k; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int x = 0;\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n\n    for (int i = 0; i < len1; i++) {\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    }\n    strcpy(s3, s1);\n\n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n\n    s4[0] = '\\0';\n    for (int i = maxi + 1; i < len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n\n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36204", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[16], substr[4], *p1, *p2, *pl;\n  for (p1 = str; p1 <= str + 9; p1++)\n    *p1 = '\\0';\n  for (p2 = substr; p2 <= substr + 2; p2++)\n    *p2 = '\\0';\n  for (;;) {\n    pl = str;\n    scanf(\"%s%s\", str, substr);\n    if (*pl == '\\0')\n      break;\n    for (p1 = str + 1; p1 <= str + 9; p1++) {\n      if (*p1 > *pl)\n        pl = p1;\n    }\n    for (p1 = str; p1 <= pl; p1++) {\n      cout << *p1;\n      *p1 = '\\0';\n    }\n    for (p2 = substr; p2 <= substr + 2; p2++) {\n      printf(\"%c\", *p2);\n      *p2 = '\\0';\n    }\n    for (; p1 <= str + 9; p1++) {\n      if (*p1 == '\\0')\n        break;\n      printf(\"%c\", *p1);\n      *p1 = '\\0';\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36205", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid s(char c[], char d[]) {\n  int max = 0, n, y, z;\n  for (n = 0; n < 10; n++) {\n    if (c[n] > max) {\n      max = c[n];\n      y = n;\n    }\n    if (c[n] == '\\0') {\n      z = n;\n      break;\n    }\n  }\n  for (n = z - 1; n > y; n--)\n    c[n + 3] = c[n];\n  c[y + 1] = d[0];\n  c[y + 2] = d[1];\n  c[y + 3] = d[2];\n}\nint main() {\n  char a[20] = {'\\0'}, b[4] = {'\\0'};\n  int i;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    s(a, b);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < 20; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      b[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "36206", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s1[100][11];\n  char s2[100][4];\n  int i, j, m, k, p;\n  scanf(\"%s%s\", s1[0], s2[0]);\n  m = 0;\n  p = 0;\n  do {\n    m = 0;\n    for (k = 0; k < strlen(s1[p]); k++) {\n\n      if (s1[p][k] > s1[p][m]) {\n        m = k;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", s1[p][i]);\n    }\n    printf(\"%s\", s2[p]);\n    for (j = m + 1; j < strlen(s1[p]); j++) {\n      printf(\"%c\", s1[p][j]);\n    }\n    printf(\"\\n\");\n    p++;\n  } while (scanf(\"%s%s\", s1[p], s2[p]) != EOF);\n}\n"}
{"label": "20", "index": "36207", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid charu(char *p1, char *p2);\nint main() {\n  char a[1000][15], b[1000][3];\n  int i = 0;\n  while (cin >> a[i]) {\n    cin >> b[i];\n    charu(a[i], b[i]);\n    i++;\n  }\n  return 0;\n}\nvoid charu(char *p1, char *p2) \n{\n  int k = 0, i, maxx = 0;\n  while (*(p1 + k) != '\\0') {\n    if (*(p1 + k) > *(p1 + maxx))\n      maxx = k;\n    k++;\n  }\n  for (i = 0; i <= maxx; i++)\n    cout << *(p1 + i);\n  cout << p2;\n  for (i = maxx + 1; *(p1 + i) != '\\0'; i++)\n    cout << *(p1 + i);\n  cout << endl;\n}\n"}
{"label": "20", "index": "36208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, pos = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[pos])\n        pos = i;\n    for (i = 0; i <= pos; i++)\n      cout << str[i];\n    printf(\"%s\", substr);\n    while (str[i])\n      printf(\"%c\", str[i++]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36209", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, i, j, maxASCII = 0, max;\n  char str[15], substr[4], *p = str, *q = substr;\n  while (scanf(\"%s %s \", str, substr)) {\n    maxASCII = 0;\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (*(p + i) > maxASCII) {\n        maxASCII = *(p + i);\n        max = i;\n      }\n    }\n    for (i = len - 1; i > max; i--)\n      *(p + i + 3) = *(p + i);\n\n    for (i = max + 1, j = 0; i <= max + 3; i++, j++) {\n      *(p + i) = *(q + j);\n    }\n    for (i = 0; i < len + 3; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36210", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int i, j, n, a;\n  char max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 1; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        a = i;\n      }\n    }\n    for (j = 0; j < a + 1; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n\n    for (j = a + 1; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36211", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, k;\n  char str[11], strsub[4];\n  for (j = 0;; j++) {\n    k = 0;\n    if (scanf(\"%s%s\", str, strsub) == EOF)\n      break;\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if ((str[k] - str[i]) < 0) {\n        k = i;\n      }\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << strsub;\n    for (i = k + 1; i < m; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100][13], temp;\n  int i, n, k, len, j;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 13; j++)\n      c[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len = strlen(c[i]);\n    temp = c[i][0];\n    k = 0;\n    for (j = 0; j <= len - 5; j++) {\n      if (c[i][j] > temp) {\n        temp = c[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = len - 3; j < len; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = k + 1; j < len - 4; j++)\n      printf(\"%c\", c[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36213", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, n, a, m;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF)\n\n  {\n    n = strlen(str);\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        a = i;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", str[i]);\n      if (i == a)\n        cout << substr;\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36214", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, max1;\n  char str[20], substr[4], ans[20];\n  char *p = str, *q = substr;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > max)\n        max = str[i], max1 = i;\n    strcpy(ans, \"\");\n    strncat(ans, str, max1 + 1);\n    strcat(ans, substr);\n    strcat(ans, str + max1 + 1);\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36215", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, i, max1;\n  char str[20], substr[4], ans[20];\n  char *p = str, *q = substr;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; str[i]; i++) {\n      if (str[i] > max) {\n        max = str[i], max1 = i;\n      }\n    }\n    strcpy(ans, \"\");\n    strncat(ans, str, max1 + 1);\n    strcat(ans, substr);\n    strcat(ans, str + max1 + 1);\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36216", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, max, m, i;\n  char str1[11], str2[4], c, s[] = \"\";\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  c = getchar();\n  n = strlen(str1);\n  while (c != '\u0000' && n != 0) {\n    max = 0;\n    m = 0;\n    for (i = 0; i < n; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"%s\", str2);\n    for (i = m + 1; i < n; i++)\n      printf(\"%c\", str1[i]);\n    printf(\" \");\n    strcpy(str1, s);\n    scanf(\"%s\", str1);\n    scanf(\"%s\", str2);\n    c = getchar();\n    n = strlen(str1);\n  }\n}\n"}
{"label": "20", "index": "36217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint locate(char s[]) {\n  int i, max_loc = 0, len;\n  len = strlen(s);\n  for (i = 1; i < len; i++) {\n    if (s[i] > s[max_loc])\n      max_loc = i;\n  }\n  return max_loc;\n}\nint main() {\n  char a[100][21], b[100][30], max[100], len[100];\n  int i = -1, j, m;\n  do {\n    i++;\n  } while (scanf(\"%s%s\", a[i], b[i]) != EOF);\n  for (j = 0; j < i; j++) {\n    max[j] = locate(a[j]);\n    len[j] = strlen(b[j]);\n    m = max[j] + 1;\n    while (a[j][m] != '\\0') {\n      b[j][len[j]++] = a[j][m++];\n    }\n    b[j][len[j]] = '\\0';\n    a[j][max[j] + 1] = '\\0';\n    printf(\"%s\\n\", strcat(a[j], b[j]));\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36218", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[100][50];\n  int b[100][2], len[100], ben[100];\n  int i, j, k;\n  k = -1;\n  for (i = 0; i < 100; i++) {\n    ben[i] = 0;\n    len[i] = 0;\n  }\n  for (i = 0; i < 100; i++) {\n\n    cin >> str[i];\n    k = k + 1;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n\n  for (i = 0; i < k; i++) {\n    ben[i] = strlen(str[i]);\n    for (j = 0; j < ben[i]; j++)\n      if (str[i][j] == ' ')\n        len[i] = j;\n  }\n\n  for (i = 0; i < k; i++) {\n    b[i][1] = str[i][0];\n    b[i][0] = 0;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < len[i]; j++)\n      if (str[i][j] > b[i][1]) {\n        b[i][0] = j;\n        b[i][1] = str[i][j];\n      }\n  for (i = 0; i < k - 1; i++) {\n    for (j = 0; j < b[i][0] + 1; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = len[i] + 1; j < len[i] + 4; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = b[i][0] + 1; j < len[i]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\" \");\n  }\n\n  for (j = 0; j < b[k - 1][0] + 1; j++)\n    printf(\"%c\", str[k - 1][j]);\n  for (j = len[k - 1] + 1; j < len[k - 1] + 4; j++)\n    printf(\"%c\", str[k - 1][j]);\n  for (j = b[k - 1][0] + 1; j < len[k - 1]; j++)\n    printf(\"%c\", str[k - 1][j]);\n}\n"}
{"label": "20", "index": "36219", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[3], c[1000][15];\n  char t;\n  int i, j, k, n = 0;\n  int a[1000];\n  for (i = 0; i < 1000; i++) {\n    cin >> c[i];\n    if (c[i][0] != '\u0000') {\n      a[i] = strlen(c[i]);\n      n++;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    t = c[i][0];\n    str[1] = c[i][a[i] - 3];\n    str[2] = c[i][a[i] - 2];\n    str[3] = c[i][a[i] - 1];\n\n    for (j = 0; j < a[i] - 4; j++)\n      if (t < c[i][j])\n        t = c[i][j];\n    for (j = 0; j < a[i] - 4; j++)\n      if (t == c[i][j]) {\n        for (k = a[i] - 1; k >= j + 4; k--)\n          c[i][k] = c[i][k - 3];\n        c[i][a[i] - 1] = '\u0000';\n        c[i][j + 1] = str[1];\n        c[i][j + 2] = str[2];\n        c[i][j + 3] = str[3];\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n}\n"}
{"label": "20", "index": "36220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int max, i, max_index;\n  char str1[20], str2[10], ans[20];\n\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 1; *(str1 + i); i++)\n      if (*(str1 + i) > max)\n        max = *(str1 + i), max_index = i;\n    strcpy(ans, \"\");\n    strncat(ans, str1, max_index + 1);\n    strcat(ans, str2);\n    strcat(ans, str1 + max_index + 1);\n\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[4], string[12];\n  int i, j = 0, max;\n  while (scanf(\"%s %s\", string, str) != EOF) {\n    max = 0;\n    j = 0;\n    for (i = 0; i < strlen(string); i++)\n      if (string[i] > string[max])\n        max = i;\n    for (i = strlen(string); i >= max + 1; i--)\n      string[i + 3] = string[i];\n    for (i = max + 1; i < max + 4; i++, j++)\n      string[i] = str[j];\n    for (i = 0; string[i] != '\\0'; i++)\n      printf(\"%c\", string[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36222", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, maxi;\n  char max, a[10], b[10];\n  while (scanf(\"%s \", a) != EOF) {\n    max = a[0];\n\n    cin >> b;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] > max) {\n        maxi = i;\n        max = a[i];\n      }\n    }\n    for (i = 0; i <= maxi; i++) {\n      cout << a[i];\n    }\n    printf(\"%s\", b);\n    for (i = maxi + 1; a[i] != '\u0000'; i++) {\n      printf(\"%c\", a[i]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char *p, *ip, *p3, str[20], substr[4], max;\n  int i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (max = *str, ip = str, p = str; *p != '\\0'; p++) {\n      if (*p > max) {\n        max = *p;\n        ip = p;\n      }\n    }\n    ip = ip + 1;\n\n    for (p = str + strlen(str); p >= ip; p--)\n      *(p + 3) = *p;\n\n    for (p3 = substr, i = 0; i < 3; i++, p3++, ip++)\n      *ip = *p3;\n    printf(\"%s\\n\", str);\n    strcpy(str, \"\");\n  }\n}\n"}
{"label": "20", "index": "36224", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid chen() {\n  char str[11], substr[4];\n  int i, k;\n  cin >> str >> substr;\n  k = strlen(str);\n  for (i = strlen(str) - 1; i >= 0; i--) {\n    if (str[i] >= str[k - 1]) {\n      k = i + 1;\n    }\n  }\n  if (strlen(str) > 10 || strlen(substr) > 3)\n    return;\n  for (i = 0; i < k; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = k; i < strlen(str); i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  chen();\n}\nint main() {\n  chen();\n  return 0;\n}\n"}
{"label": "20", "index": "36225", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[11], substr[4], max;\n  int m, n, i, j, z, t, temp = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    m = strlen(str);\n    n = strlen(substr);\n    max = str[0];\n\n    for (i = 0; i < m; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        temp = i + 1;\n      }\n    }\n    for (j = 0; j <= temp; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (z = 0; z < n; z++) {\n      printf(\"%c\", substr[z]);\n    }\n    for (t = temp + 1; t < m; t++) {\n      printf(\"%c\", str[t]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36226", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, k;\n  char *p1, *p2, *p3;\n  char max;\n  char str[11];\n  char substr[4];\n  char res[13];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p1 = str;\n    p2 = substr;\n    p3 = res;\n    l = strlen(str);\n    max = str[0];\n    k = 0;\n    for (i = 0; i < l; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < 13; i++) {\n      if (i <= k)\n        *(p3 + i) = *(p1 + i);\n      else if (i <= k + 3)\n        *(p3 + i) = *(p2 + i - k - 1);\n      else if (i < l + 3)\n        *(p3 + i) = *(p1 + i - 3);\n      else\n        res[i] = '\\0';\n    }\n    printf(\"%s\\n\", res);\n  }\n}\n"}
{"label": "20", "index": "36227", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[14], substr[4];\n  int i, n, k = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n; i > k; i--)\n      str[i + 3] = str[i];\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  }\n}\n"}
{"label": "20", "index": "36228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char st1[], char st2[]) {\n  int i, m, n;\n  char max;\n  m = strlen(st1);\n  max = st1[0];\n  n = m - 1;\n\n  for (i = 0; i < m; i++) {\n    if (st1[i] > max) {\n      max = st1[i];\n      n = i;\n    }\n  }\n\n  for (i = 0; i <= n; i++)\n    printf(\"%c\", st1[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", st2[i]);\n  for (i = n + 1; i < m; i++)\n    printf(\"%c\", st1[i]);\n  printf(\"\\n\");\n}\nint main() {\n  char st1[50][10], st2[50][4];\n  int i, j, k;\n  char p;\n  while ((st1[i][0] = getchar()) != EOF) {\n    for (j = 1;; j++) {\n      if ((p = getchar()) != ' ')\n        st1[i][j] = p;\n      else {\n        st1[i][j] = '\\0';\n        break;\n      }\n    }\n    scanf(\"%s\", st2[i]);\n    i++;\n    p = getchar();\n  }\n  k = i;\n  for (i = 0; i < k; i++)\n    insert(st1[i], st2[i]);\n}\n"}
{"label": "20", "index": "36229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[11];\n\n  int j, k, i, n, m;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    for (j = 0; j < n; j++)\n      a[j] = str[j];\n\n    for (k = 1; k < n; k++)\n      if (a[0] < a[k])\n        a[0] = a[k];\n    for (j = 0; j < n; j++) {\n      printf(\"%c\", str[j]);\n      if (str[j] == a[0])\n        break;\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", substr[k]);\n    for (i = (j + 1); i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char ch = str[0];\n  a = strlen(str);\n  for (i = 1; i < a - 4; i++) {\n    if (str[i] > ch) {\n      ch = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a, length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a && j < a + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a];\n      else if (j > a + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str1[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l1;\n  char str1[15], str2[4], c, d;\n  while (scanf(\"%s\", str1) != EOF) {\n    scanf(\"%s\", str2);\n    c = 0;\n    l1 = strlen(str1);\n    for (i = 0; i < l1; i++) {\n      d = (int)str1[i];\n      if (d > c) {\n        c = d;\n        j = i;\n      }\n    }\n    for (k = l1 + 2, str1[k + 1] = '\\0'; k > j; k--) {\n      str1[k] = str1[k - 3];\n    }\n    str1[j + 3] = str2[2];\n    str1[j + 2] = str2[1];\n    str1[j + 1] = str2[0];\n    puts(str1);\n  }\n}\n"}
{"label": "20", "index": "36232", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i;\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n\n    for (i = 0; i < len1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    strcpy(s3, s1);\n\n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n\n    s4[0] = '\\0';\n    for (i = maxi + 1; i <= len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n\n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36233", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint findmax(char str[], int len) {\n  char c = str[0];\n  int p = 0, i;\n  for (i = 0; i < len; i++)\n    if (str[i] > c) {\n      p = i;\n      c = str[i];\n    }\n  return p;\n}\n\nint main() {\n  char c, str[11], substr[4];\n  int p, l;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    p = findmax(str, l = strlen(str));\n    p++;\n    c = str[p];\n    str[p] = 0;\n\n    printf(\"%s%s\", str, substr);\n\n    str[p] = c;\n    if (p <= l)\n      printf(\"%s\\n\", &str[p]);\n    else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36234", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid cha(char str[100]) {\n  char substr[10], res[1000], giant, *p, *q, *t;\n  int i, max, n, m;\n  scanf(\"%s \", substr);\n  n = strlen(str);\n  max = 0;\n  p = str;\n  giant = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) > giant) {\n      giant = *(p + i);\n      max = i;\n    }\n  }\n  p = str;\n  q = res;\n  t = substr;\n  m = strlen(substr);\n  strncpy(q, p, max + 1);\n  strcpy(q + max + 1, t);\n  strcpy(q + max + m + 1, p + max + 1);\n  puts(res);\n}\nint main() {\n  char str[100];\n  while (scanf(\"%s\", str) != EOF)\n    cha(str);\n  return 0;\n}\n"}
{"label": "20", "index": "36235", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  int i, j, k, n, m;\n  while (1) {\n    char a[50] = {'0'}, b[20] = {'0'}, c[20] = {'0'};\n    cin >> a >> b;\n    if (a[0] == '\\0')\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          k++;\n      }\n      if (k == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i < n - m; i++) {\n      c[i] = a[i + m + 1];\n      a[i + m + 1] = '\\0';\n    }\n    strcat(a, b);\n    strcat(a, c);\n    if (a[0] == '0')\n      break;\n    else\n      printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char str[10] = {0}, substr[3] = {0}, m = 0;\n\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = 0;\n    n = 0;\n\n    for (i = 0; i < 10; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        n = i;\n      }\n    }\n\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = n + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[13], substr[3];\n  int i = 0, max, j, n, k;\n  for (k = 0; k < 100; k++) {\n    for (i = 0; i < 13; i++)\n      str[i] = '\\0';\n\n    for (i = 0; i < 3; i++)\n      substr[i] = '\\0';\n\n    max = 0;\n\n    scanf(\"%s%s\", str, substr);\n\n    n = strlen(str);\n\n    for (i = 0; i < n; i++)\n      max = (max > str[i]) ? max : str[i];\n\n    for (i = 0; i < n; i++)\n      if (str[i] == max) {\n        for (j = n - 1; j > i; j--)\n          str[j + 3] = str[j];\n        str[i + 1] = substr[0];\n        str[i + 2] = substr[1];\n        str[i + 3] = substr[2];\n        break;\n      }\n\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36238", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j;\n  int max, l;\n  char s1[11], s2[4], s3[20];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = s1[0];\n    for (i = 1; i < strlen(s1); i++) {\n      if (s1[i] > max)\n        max = s1[i];\n    }\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] == max) {\n        l = i;\n        break;\n      }\n    }\n    for (i = 0; i <= l; i++)\n      s3[i] = s1[i];\n    for (i = 0; i < strlen(s2); i++)\n      s3[i + l + 1] = s2[i];\n    for (i = 0; i < strlen(s1) - l - 1; i++)\n      s3[l + strlen(s2) + 1 + i] = s1[l + i + 1];\n    for (i = 0; i < strlen(s1) + strlen(s2); i++)\n      cout << s3[i];\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14] = {0}, substr[4] = {0}, max;\n  int i, imax, l, j;\n  while (scanf(\"%s%3s\", str, substr) != EOF) {\n    i = 0;\n    imax = 0;\n    max = str[0];\n    while (str[i]) {\n      if (str[i] > max) {\n        max = str[i];\n        imax = i;\n      }\n      i++;\n    }\n    l = strlen(str);\n    for (i = l; i > imax; i--)\n      *(str + i + 3) = *(str + i);\n    for (i = imax + 3, j = 2; i > imax; i--, j--)\n      *(str + i) = *(substr + j);\n    puts(str);\n  }\n}\n"}
{"label": "20", "index": "36240", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *str, *substr, *newstr;\n  int i, j, p, q, a, b = 0;\n  str = (char *)malloc(11 * sizeof(char));\n  substr = (char *)malloc(4 * sizeof(char));\n  newstr = (char *)calloc(30, sizeof(char));\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    p = strlen(str);\n    q = strlen(substr);\n    a = *str;\n    for (i = 1; i < p; i++)\n      if (*(str + i) > a) {\n        a = *(str + i);\n        b = i;\n      }\n\n    for (i = 0; i <= b; i++)\n      *(newstr + i) = *(str + i);\n    for (i = b + 1, j = 0; j < q; i++, j++)\n      *(newstr + i) = *(substr + j);\n    for (i = b + q + 1, j = b + 1; j < p; i++, j++)\n      *(newstr + i) = *(str + j);\n\n    for (i = 0; i < p + q; i++)\n      printf(\"%c\", *(newstr + i));\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20][10] = {'\\0'}, substr[20][3];\n  int i = 0, j, max, k;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF)\n    i++;\n  for (i = 0; str[i][0] != '\\0'; i++) {\n    k = 0;\n    max = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[i][j]);\n    for (j = k + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36242", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *p, s[10], subs[4];\n  while (scanf(\"%s %s\", s, subs) != EOF) {\n    int n, i;\n    n = strlen(s);\n    p = &s[0];\n    for (i = 1; i < n; i++)\n      if (s[i] > *p)\n        p = &s[i];\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", s[i]);\n      if (&s[i] == p)\n        printf(\"%s\", subs);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36243", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid charu(char str[10], char substr[4], int n) {\n  int i, k;\n  char nstr[13];\n  char max;\n\n  for (i = n; i >= 0; i--) {\n    if (str[i] >= max) {\n      max = str[i];\n      k = i;\n    }\n  }\n\n  for (i = 0; i <= k; i++)\n    nstr[i] = str[i];\n  for (i = 0; i <= 2; i++)\n    nstr[i + k + 1] = substr[i];\n  for (i = k + 4; i <= n + 3; i++)\n    nstr[i] = str[i - 3];\n\n  puts(nstr);\n}\n\nint main() {\n  char s1[10], s2[4];\n  int i;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    for (i = 0; s1[i] != '\u0000'; i++)\n      ;\n    charu(s1, s2, i);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36244", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int max, i, j, e, k;\n  char str[11], substr[4];\n  for (;;) {\n    max = 0;\n    if (scanf(\"%s%s\", str, substr) != EOF) {\n      for (i = 0; str[i]; i++) {\n        if (str[i] > max) {\n          max = str[i];\n          e = i;\n        }\n      }\n      for (j = 0; j < e + 1; j++) {\n        printf(\"%c\", str[j]);\n      }\n      printf(\"%s\", substr);\n      for (k = e + 1; str[k]; k++)\n        printf(\"%c\", str[k]);\n      printf(\"\\n\");\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36245", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[11], substr[4];\n  int i, j, max = 0, len;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (j = 0; j < len; j++) {\n      if (str[max] < str[j + 1])\n        max = j + 1;\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == max)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36246", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], max;\n  int i, k, n, f, j;\n  char *pa, *pb;\n  j = 0;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    pa = a;\n    pb = b;\n    k = strlen(a);\n    f = strlen(b);\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (*pa > max) {\n        max = *pa;\n        n = i;\n        pa++;\n      } else\n        pa++;\n    }\n    i = 0;\n    for (pa = a; pa < a + n + 1; pa++) {\n      printf(\"%c\", *pa);\n    }\n    for (pb = b; pb < b + f; pb++) {\n      printf(\"%c\", *pb);\n    }\n    for (pa = a + n + 1; pa < a + k; pa++) {\n      printf(\"%c\", *pa);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36247", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n;\n  char str[11], substr[4];\n  int max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    char *p1;\n    char *p2;\n    char *p3;\n    p1 = str, p2 = str, p3 = str;\n    max = str[0];\n    for (i = 0; i < n; i++) {\n      if (*(p1 + i) > max) {\n        max = *(p1 + i);\n        p2 = p1 + i;\n      }\n    }\n    for (p1 = str; p1 < (p2 + 1); p1++)\n      printf(\"%c\", *p1);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (p1 = p2 + 1; p1 < (p3 + n); p1++)\n      printf(\"%c\", *p1);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36248", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[14], a[4], max = 0;\n  int n, i, k, j;\n  while (scanf(\"%s %s\", s, a) != EOF) {\n    k - 0;\n    j = 0;\n    max = 0;\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] > max) {\n        k = i;\n        max = s[i];\n      }\n    }\n\n    for (i = n - 1; i > k; i--)\n      s[i + 3] = s[i];\n\n    while (j <= 2) {\n      s[k + j + 1] = a[j];\n      j++;\n    }\n    s[n + 3] = '\\0';\n    puts(s);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[12], b[4];\n  int i = 0, n, m = 0;\n  char c;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    c = a[0];\n    while (i < n) {\n      if (a[i] > c)\n        c = a[i], m = i;\n      i++;\n    }\n    i = 0;\n    while (i <= m) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    printf(\"%s\", b);\n    while (i < n) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    i = 0;\n    printf(\"\\n\");\n    m = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint number(char a[]) {\n  int i, m = 0;\n  for (i = 0; a[i] != 0; i++)\n    m++;\n  return m;\n}\nvoid change(char a[], int m, char b[]) {\n  int i, j = 0;\n  char c[13];\n  for (i = m + 1; a[i] != 0; i++) {\n    c[j] = a[i];\n    j++;\n    a[i] = 0;\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\nvoid in(char a[], char b[]) {\n  int i, j, m;\n  for (i = 0; a[i] != 0; i++) {\n    m = 0;\n    for (j = 0; a[j] != 0; j++)\n      if (a[i] >= a[j])\n        m++;\n    if (m == number(a)) {\n      change(a, i, b);\n      break;\n    }\n  }\n}\nvoid remove(char a[]) {\n  int i;\n  for (i = 0; a[i] != 0; i++)\n    a[i] = 0;\n}\nint main() {\n  char str[15] = {0}, substr[4] = {0};\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    in(str, substr);\n    remove(str);\n    remove(substr);\n  }\n}\n"}
{"label": "20", "index": "36251", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], temp = 0;\n  int t = 0, i, n;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > temp)\n        temp = a[i], t = i;\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    for (i = t + 1; i < n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n    t = 0;\n    temp = 0;\n  }\n}\n"}
{"label": "20", "index": "36252", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\n\n\n\nint main() {\n  char a[100][100], b[100][100];\n  int n = 0;\n\n  while (scanf(\"%s%s\", a[n], b[n]) != EOF) {\n    n++;\n  }\n\n  int i, j, k, mark;\n  char c = '\\0';\n\n  for (i = 0; i < n; i++) {\n    c = '\\0';\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] > c) {\n        c = a[i][j];\n        mark = j;\n      }\n    }\n    for (k = 0; k <= mark; k++) {\n      printf(\"%c\", a[i][k]);\n    }\n    printf(\"%s\", b[i]);\n    for (k = mark + 1; a[i][k] != '\\0'; k++) {\n      printf(\"%c\", a[i][k]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36253", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[22], b[4], max;\n  int i, imax, l1, l2;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    l1 = strlen(a);\n    l2 = strlen(b);\n    max = a[0];\n    imax = 0;\n    for (i = 1; i < l1; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        imax = i;\n      }\n    }\n    for (i = l1 - 1; i > imax; i--)\n      a[i + l2] = a[i];\n    a[l1 + l2] = '\\0';\n    for (i = 0; i < l2; i++)\n      a[imax + i + 1] = b[i];\n    puts(a);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid output(int len, char inp[1000]) {\n  char lin1[10][10], lin2[10][3], lin3[10][13];\n  int i, j = 0, k = 0, ma = 0;\n  int max[10];\n  int lenm[10];\n  for (i = 0; i < 10; i++)\n    max[i] = 0;\n  for (i = 0; i < len; i++) {\n    if (inp[i] != 32) {\n      if (ma == 0) {\n        lenm[k] = 0;\n        for (j = 0; inp[i] != 32 && i < len; i++, j++) {\n          lin1[k][j] = inp[i];\n          lenm[k]++;\n        }\n        ma = 1;\n        continue;\n      }\n      if (ma == 1) {\n        for (j = 0; j < 3; i++, j++)\n          lin2[k][j] = inp[i];\n        ma = 0;\n        k++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    max[i] = lin1[i][0];\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < lenm[i]; j++)\n      if (lin1[i][j] > max[i]) {\n        max[i] = lin1[i][j];\n      }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i]; j++) {\n      lin3[i][j] = lin1[i][j];\n      if (lin1[i][j] == max[i]) {\n        lin3[i][j + 1] = lin2[i][0];\n        lin3[i][j + 2] = lin2[i][1];\n        lin3[i][j + 3] = lin2[i][2];\n        for (j = j + 1; j < lenm[i]; j++)\n          lin3[i][j + 3] = lin1[i][j];\n        break;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i] + 3; j++)\n      cout << lin3[i][j];\n    cout << \" \";\n  }\n}\n\nint main() {\n  int len[100], i, j;\n  char inp[100][100];\n  for (i = 0; i < 100; i++) {\n\n    cin >> inp[i];\n    len[i] = strlen(inp[i]);\n    if (len[i] == 0)\n      break;\n  }\n  j = i;\n  for (i = 0; i < j; i++)\n    output(len[i], inp[i]);\n}\n"}
{"label": "20", "index": "36255", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j = 0, m;\n  char str[20], substr[5];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n - 1; i >= j + 1; i--)\n      str[i + 3] = str[i];\n    str[i + 1] = substr[0];\n    str[i + 2] = substr[1];\n    str[i + 3] = substr[2];\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n    j = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36256", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], c[14];\n  int i = 0, j = 0, a, m, n, p, q;\n  for (;;) {\n    a = scanf(\"%s %s\", str, substr);\n    if (a == EOF) {\n      break;\n    } else {\n      m = strlen(str);\n      n = strlen(substr);\n      p = 0;\n      for (i = 0; i < m; i++) {\n        if (str[i] <= str[p]) {\n          continue;\n        } else {\n          p = i;\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        if (q <= p) {\n          c[q] = str[q];\n        }\n        if (q > p && q < p + n + 1) {\n          c[q] = substr[q - p - 1];\n        }\n        if (q >= p + n + 1) {\n          c[q] = str[q - n];\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        cout << c[q];\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36257", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10000][100], substr[10000][100], max;\n  int i, j, k, n = 0, p;\n  i = 0;\n  while (scanf(\"%s\", &str[i]) != EOF) {\n    scanf(\"%s\", &substr[i]);\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j <= strlen(str[i]) - 1; j++)\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    for (k = strlen(str[i]); k >= p + 1; k--)\n      str[i][k + 3] = str[i][k];\n    for (k = p + 1; k <= p + 3; k++)\n      str[i][k] = substr[i][k - p - 1];\n    i++;\n  }\n  for (j = 0; j <= i - 1; j++) {\n    puts(str[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36258", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[13];\n  int i;\n  while (scanf(\"%s %s \", str, substr)) {\n    char max = str[0];\n    for (int i = 0; i < 10; i++) {\n      if (str[i] > max) {\n        max = str[i];\n      }\n    }\n    int m = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[i] == max) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      a[i] = str[i];\n    for (i = 0; i < 3; i++)\n      a[m + 1 + i] = substr[i];\n    for (i = m + 1; i < strlen(str); i++)\n      a[i + 3] = str[i];\n    a[strlen(str) + 3] = '\\0';\n    for (i = 0; i < strlen(a); i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36259", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[15] = {'\\0'}, s2[4] = {'\\0'}, a[15] = {'\\0'}, c[15] = {'\\0'};\n  int i, j, n, m = 0, k = 0;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    for (i = 0; i < n; i++)\n      c[i] = s1[i];\n    for (i = 0; i < n - 1; i++) {\n      if (s1[m] < s1[i + 1])\n        m = i + 1;\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", c[i]);\n      s1[i] = '\\0';\n      c[i] = '\\0';\n    }\n    printf(\"%c%c%c\", s2[0], s2[1], s2[2]);\n    for (j = m + 1; j < n; j++) {\n      printf(\"%c\", c[j]);\n      s1[j] = '\\0';\n      c[j] = '\\0';\n    }\n    printf(\"\\n\");\n    m = 0;\n    k = 0;\n  }\n}\n"}
{"label": "20", "index": "36260", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  int i, len, max, maxi;\n  char substr[4], str[11];\n  for (i = 0; i < 4; i++)\n    substr[i] = -1;\n  for (i = 0; i < 11; i++)\n    str[i] = -1;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = -1;\n    maxi = -1;\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == maxi)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36261", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid cha(char str[100]) {\n  char substr[10], res[1000], giant, *p, *q, *t;\n  int i, max, n, m;\n  scanf(\"%s\", substr);\n  n = strlen(str);\n  max = 0;\n  p = str;\n  giant = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) > giant) {\n      giant = *(p + i);\n      max = i;\n    }\n  }\n  p = str;\n  q = res;\n  t = substr;\n  m = strlen(substr);\n  strncpy(q, p, max + 1);\n  strcpy(q + max + 1, t);\n  strcpy(q + max + m + 1, p + max + 1);\n  puts(res);\n}\nint main() {\n  char str[100];\n  while (scanf(\"%s\", str) != EOF)\n    cha(str);\n  return 0;\n}\n"}
{"label": "20", "index": "36262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    p = 0;\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    str[s + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid chen() {\n  char str[11], substr[4];\n  int i, k;\n  cin >> str >> substr;\n  k = strlen(str);\n  for (i = strlen(str) - 1; i >= 0; i--) {\n    if (str[i] >= str[k - 1]) {\n      k = i + 1;\n    }\n  }\n  if (strlen(str) > 10 || strlen(substr) > 3)\n    return;\n  for (i = 0; i < k; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = k; i < strlen(str); i++)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n  chen();\n}\nint main() {\n  chen();\n  return 0;\n}\n"}
{"label": "20", "index": "36264", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char from[100];\n  char to[100];\n  while (1) {\n    int max = 0;\n    char str[1000];\n    cin.getline(str, 999);\n    if (str[0] == '\\0') {\n      return 0;\n    }\n    int lenstr = strlen(str);\n    if (lenstr == 0) {\n      return 0;\n    };\n    int i;\n    for (i = 0; i < lenstr; i++) {\n      if (str[i] == ' ') {\n        break;\n      }\n      from[i] = str[i];\n    }\n    from[i] = '\\0';\n    int k;\n    k = 0;\n    for (++i; i < lenstr; i++) {\n      to[k] = str[i];\n      k++;\n    }\n    to[k] = '\\0';\n    int len;\n    len = strlen(from);\n    int maxpos = 0;\n    for (i = 0; i < len; i++) {\n      if (from[i] > max) {\n        max = from[i];\n        maxpos = i;\n      }\n    }\n    int j;\n    for (j = 0; j <= maxpos; j++) {\n      printf(\"%c\", from[j]);\n    }\n    for (i = 0; to[i] != '\\0'; i++) {\n      printf(\"%c\", to[i]);\n    }\n\n    for (; from[j] != '\\0'; j++) {\n      printf(\"%c\", from[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36265", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char substr[3] = {'\\0'};\n  char str[10] = {'\\0'};\n  char out[13] = {'\\0'};\n  int length = 0;\n  int i = 0;\n  int j = 0;\n  char temp = '\\0';\n  int num = 0;\n  while (scanf(\"%s %s \", str, substr)) {\n    length = strlen(str);\n    for (i = 0; i < length; i++) {\n      if (str[i] > temp) {\n        temp = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++) {\n      out[i] = str[i];\n    }\n    strcat(out, substr);\n    for (i = num + 4, j = num + 1; i < (length + 3) && j < length; i++, j++) {\n      out[i] = str[j];\n    }\n    num = 0;\n    temp = '\\0';\n    printf(\"%s\\n\", out);\n    for (i = 0; i < 13; i++) {\n      out[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36266", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], substr[10];\n  int i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n\n    for (i = 0; i < strlen(substr); i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = max + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[14];\n  int i, k;\n  char p;\n  for (;;) {\n    for (i = 0; i < 11; i++)\n      a[i] = 0;\n    for (i = 0; i < 4; i++)\n      b[i] = 0;\n    for (i = 0; i < 14; i++)\n      c[i] = '\u0000';\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    cin >> b;\n    p = a[0];\n    k = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (p < a[i]) {\n        p = a[i];\n        k = i + 1;\n      }\n    }\n    for (i = 0; i < k; i++)\n      c[i] = a[i];\n    for (i = 0; i < 3; i++)\n      c[k + i] = b[i];\n    for (i = k; a[i] != '\u0000'; i++)\n      c[i + 3] = a[i];\n    cout << c << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36268", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[5], max;\n  int a, b, i, flag;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    a = strlen(str);\n    b = strlen(substr);\n    for (i = 0; i < a; i++) {\n      if (str[i] > max)\n        max = str[i];\n    }\n    flag = 1;\n    for (i = 0; i < a; i++) {\n      if (str[i] < max)\n        cout << str[i];\n      else {\n        printf(\"%c\", max);\n        if (flag == 1)\n          printf(\"%s\", substr);\n        flag = 0;\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36269", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid p_s(char str[], char substr[]) {\n  int i, n, len;\n  char s[13] = {\"\\0\"};\n  len = strlen(str);\n  for (i = 0, n = 0; i < len; i++)\n    if (str[n] < str[i])\n      n = i;\n  for (i = 0; i < len + 3; i++)\n    s[i] = i <= n ? str[i] : (i <= n + 3 ? substr[i - n - 1] : str[i - 3]);\n  cout << s << \"\\n\";\n}\nint main() {\n  int i, j;\n  char str[10][10], substr[10][3];\n  for (i = 0; scanf(\"%s %s\", str[i], substr[i]) != EOF; i++)\n    ;\n  for (j = 0; j < i; j++)\n    p_s(str[j], substr[j]);\n}\n"}
{"label": "20", "index": "36270", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], k = 0, j = 0, len, i, h;\n  int max = -2000;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    len = strlen(s1);\n    max = -2000;\n    for (h = 0; h < len; h++)\n      if (s1[h] > max) {\n        max = s1[h];\n        i = h;\n      }\n    for (h = 0; h <= i; h++)\n      printf(\"%c\", s1[h]);\n    printf(\"%s\", s2);\n    for (h = i + 1; h < len; h++)\n      cout << s1[h];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36271", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], substr[3], res[15], max;\n  int i, j, l, k;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    l = strlen(str);\n    max = str[0];\n    for (i = 0; i < l; i++)\n      if (max < str[i])\n        max = str[i];\n    for (i = 0; i < l; i++) {\n      if (str[i] != max)\n        res[i] = str[i];\n      else {\n        res[i] = str[i];\n        i++;\n        break;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      res[i + j] = substr[j];\n    for (; i < l; i++)\n      res[i + j] = str[i];\n    for (k = 0; k < i + j; k++)\n      printf(\"%c\", res[k]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36272", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void in(char str[], char substr[]);\n  char str[100], substr[100];\n  while ((scanf(\"%s%s\", &str, &substr)) != EOF)\n    in(str, substr);\n  return 0;\n}\n\nvoid in(char str[], char substr[]) {\n  int i, k, max, l;\n  l = strlen(str);\n  max = str[0];\n  for (i = 1; i < l; i++) {\n    if (max < str[i]) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "36273", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s;\n  for (;;) {\n    char str1[100], str2[5], str3[100] = {'\\0'}, m;\n    int i, l;\n    s = scanf(\"%s %s\", &str1, &str2);\n    if (s != 2)\n      break;\n    else {\n      for (i = 0, m = str1[0]; i < strlen(str1); i++) {\n        if (m < str1[i])\n          m = str1[i];\n      }\n      for (i = 0; i < strlen(str1); i++)\n        if (str1[i] == m) {\n          l = i;\n          break;\n        }\n      for (i = 0; i <= l; i++)\n        str3[i] = str1[i];\n      for (i = 0; i < 3; i++)\n        str3[l + 1 + i] = str2[i];\n      for (i = 0; i < (strlen(str1) - l - 1); i++)\n        str3[l + 4 + i] = str1[l + i + 1];\n      printf(\"%s\\n\", str3);\n    }\n  }\n}\n"}
{"label": "20", "index": "36274", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid swap(char a[], int n) {\n  int i, j;\n  char t;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (a[i] < a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\nint main() {\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    char m[100];\n    strcpy(m, s1);\n    int l = strlen(m);\n    swap(m, l);\n    int i, j, k;\n    for (i = 0; i < l; i++)\n      if (s1[i] == m[0]) {\n        j = i;\n        break;\n      }\n    for (k = 0; k <= j; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s2);\n    for (i = j + 1; i < l; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36275", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar zuida(char a[]) {\n  char max;\n  int i, p = 0;\n  max = a[0];\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n\n  return (p);\n}\n\nint main() {\n  char a[50], b[20];\n  int i, t1, t2, m;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    t1 = strlen(a);\n    t2 = strlen(b);\n\n    m = zuida(a);\n\n    for (i = 0; i < m + 1; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < t2; i++)\n      printf(\"%c\", b[i]);\n    for (i = m + 1; i < t1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid print(int a, int b, char c[]) {\n  int i;\n  for (i = a; i <= b; i++) {\n    printf(\"%c\", c[i]);\n  }\n}\nint arrange(char a[]) {\n  int m = 0, i, n;\n  n = strlen(a);\n  int t = a[0];\n  for (i = 0; i < n; i++) {\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m;\n    m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36277", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char str[20], substr[10], max;\n  int i, n, j, max_index;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    char *p;\n    p = &str[0];\n    max = *p;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        max_index = i;\n      }\n    }\n    for (i = 0; i <= max_index; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = max_index + 1; i < n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36278", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int p, j, k, len, i;\n  char str[100][10] = {'\u0000'}, ch[100][3], sub[100][20], tol[100][30];\n  for (i = 0; i < 100; i++) {\n    cin >> tol[i];\n    len = strlen(tol[i]);\n    if (len == 0)\n      break;\n    for (j = 0;; j++) {\n      str[i][j] = tol[i][j];\n      if (str[i][j] == ' ') {\n        str[i][j] = '\u0000';\n        break;\n      }\n    }\n    for (k = 0; k < 3; k++) {\n      ch[i][k] = tol[i][j + 1];\n      j++;\n    }\n    for (j = 1, p = 0; j < len; j++) {\n      if (str[i][p] < str[i][j])\n        p = j;\n    }\n\n    strncpy(sub[i], str[i], p + 1);\n\n    sub[i][p + 1] = ch[i][0];\n    sub[i][p + 2] = ch[i][1];\n    sub[i][p + 3] = ch[i][2];\n    for (j = 0; j <= len - 1 - p; j++)\n      sub[i][p + 4 + j] = str[i][p + j + 1];\n  }\n  cout << sub[0];\n  for (i = 1; strlen(tol[i]) != 0; i++)\n    printf(\" %s\", sub[i]);\n\n  return 0;\n}\n"}
{"label": "20", "index": "36279", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[4];\n  int max, i, j, k, p, length;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    length = strlen(str);\n    max = str[0];\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (j = length - 1; j >= k + 1; j--) {\n      str[j + 3] = str[j];\n    }\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    for (p = 0; p < length + 3; p++) {\n      printf(\"%c\", str[p]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36280", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(char st[]);\nvoid conv1(char st[], int n);\nvoid conv2(char st[], int n);\nvoid result(char st1[], char st2[], char st3[]);\nint main() {\n  char str[20], substr[4], str1[20], str3[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int n;\n    n = num(str);\n    strcpy(str3, str);\n    conv1(str, n);\n    conv2(str3, n);\n    result(str, substr, str3);\n  }\n  return 0;\n}\nvoid conv1(char st[], int n) { st[n] = '\\0'; }\nvoid conv2(char st[], int n) {\n  int l, i;\n  l = strlen(st);\n  for (i = 0; i < l - n; i++)\n    st[i] = st[i + n];\n\n  st[l - n] = '\\0';\n}\nint num(char st[]) {\n  int i, l;\n  char t;\n  t = st[0];\n  l = strlen(st);\n  for (i = 1; i < l; i++) {\n    if (st[i] > t)\n      t = st[i];\n  }\n  for (i = 0; i < l; i++) {\n    if (st[i] == t) {\n      return (i + 1);\n      break;\n    }\n  }\n}\nvoid result(char st1[], char st2[], char st3[]) {\n  strcat(st1, st2);\n  strcat(st1, st3);\n  puts(st1);\n}\n"}
{"label": "20", "index": "36281", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(char *p, char *q, int m);\n  char s[12], c[10], sub[4];\n  int i, k = 0;\n\n  while (scanf(\"%s %s\", s, sub) != EOF) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] > s[k])\n        k = i;\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", sub);\n    f(s, c, k + 1);\n    puts(c);\n  }\n}\n\nvoid f(char *p, char *q, int m) {\n  int n;\n  n = 0;\n  while (n < m) {\n    n++;\n    p++;\n  }\n  while (*p != '\\0') {\n    *q = *p;\n    p++;\n    q++;\n  }\n  *q = '\\0';\n}\n"}
{"label": "20", "index": "36282", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[3], *p, *max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (p = str, max = p; *p != '\\0'; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    for (p = str; p <= max; p++)\n      cout << *p;\n    printf(\"%s\", substr);\n    for (p = max + 1; *p != '\\0'; p++)\n      cout << *p;\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36283", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p;\n  while (cin >> str) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p) {\n        max = p;\n      }\n    for (p = str; p <= max; p++)\n      printf(\"%c\", *p);\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36284", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid insert(char a[10], char b[4]) {\n  int len;\n  len = strlen(a);\n  int i, temp = 0;\n  for (i = 0; i < len; i++)\n    if (a[temp] - a[i] < 0)\n      temp = i;\n  for (i = 0; i <= temp; i++)\n    cout << a[i];\n  cout << b[0] << b[1] << b[2];\n  for (i = temp + 1; i < len; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  char str[10] = {0}, substr[4] = {0};\n  while (scanf(\"%s %s \", str, substr))\n    insert(str, substr);\n  return 0;\n}\n"}
{"label": "20", "index": "36285", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[13], *p, *h;\n  int l, i, m;\n  while (scanf(\"%s \", str)) {\n    p = str;\n    h = str;\n    m = 0;\n    l = strlen(p);\n    for (i = 0; i < (l - 4); i++) {\n      if (*h < *(p + i)) {\n        h = p + i;\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", *(p + i));\n    printf(\"%c%c%c\", *(p + l - 3), *(p + l - 2), *(p + l - 1));\n    for (i = m + 1; *(p + i) != ' '; i++)\n      printf(\"%c\", *(p + i));\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36286", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint max(char s1[11]) {\n  int i, k = 0;\n  char c = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] > c) {\n      c = s1[i];\n      k = i;\n    }\n  }\n  return (k);\n}\nint main() {\n  char s1[11], s2[4];\n  int i, j, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = max(s1);\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"%s\", s2);\n    for (i = m + 1; i < strlen(s1); i++)\n      printf(\"%c\", s1[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36287", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, pos = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[pos])\n        pos = i;\n    for (i = 0; i <= pos; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    while (str[i])\n      printf(\"%c\", str[i++]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36288", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char str[11];\n  char substr[4];\n  char t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    t = str[0];\n    k = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if ((str[i] - t) > 0) {\n        t = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++) {\n      printf(\"%c\", str[i]);\n    }\n    for (i = 0; substr[i] != '\\0'; i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = k + 1; str[i] != '\\0'; i++) {\n      cout << str[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36289", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][10], substr[100][3], s, str1[100][30] = {0},\n                                        str2[100][10] = {0};\n  int j, i = 0, n, b, c;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    n = strlen(str[i]);\n    s = str[i][0];\n    for (j = 1; j < n; j++) {\n      if (str[i][j] > s) {\n        s = str[i][j];\n        b = j;\n      }\n    }\n    for (c = 0, j = 0; c <= b; c++, j++)\n      str1[i][c] = str[i][j];\n    for (c = 0, j = b + 1; j < n; c++, j++) {\n      str2[i][c] = str[i][j];\n    }\n    strcat(str1[i], substr[i]);\n    strcat(str1[i], str2[i]);\n    cout << str1[i] << \"\\n\";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36290", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char str[500], sub[4], *st = str, *su = sub, c;\n  while (scanf(\"%s%s\", str, sub)) {\n    k = strlen(str);\n    if (k == 0)\n      break;\n    c = *st;\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (*(st + i) > c) {\n        c = *(st + i);\n        j = i;\n      }\n    for (i = k; i > j; i--)\n      *(st + i + 3) = *(st + i);\n    for (i = 1; i < 4; i++)\n      *(st + j + i) = *(su + i - 1);\n    printf(\"%s\\n\", st);\n    *st = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36291", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pan(char s[], int n) {\n  int i = 0, t, max, m;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      t = i;\n      break;\n    }\n  }\n  for (i = t - 1, max = s[t - 1]; i >= 0; i--) {\n    if (s[i] >= max) {\n      max = s[i];\n      m = i;\n    }\n  }\n  return (m);\n}\n\nint kong(char s[], int n) {\n  int i, t;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      t = i;\n      break;\n    }\n  }\n  return (t);\n}\n\nint main() {\n  char s[1000][20];\n  int i, j, t, m;\n  for (i = 0;; i++) {\n\n    cin >> s[i];\n    if (s[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0;; i++) {\n    if (s[i][0] == '\u0000')\n      break;\n    else {\n      t = pan(s[i], strlen(s[i]));\n      for (j = 0; j <= t; j++) {\n        printf(\"%c\", s[i][j]);\n      }\n      m = strlen(s[i]);\n      printf(\"%c%c%c\", s[i][m - 3], s[i][m - 2], s[i][m - 1]);\n      for (j = t + 1; j < kong(s[i], m); j++) {\n        printf(\"%c\", s[i][j]);\n      }\n      printf(\" \");\n    }\n  }\n}\n"}
{"label": "20", "index": "36292", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str[10];\nchar substr[3];\nint pan() {\n  int j, i, x, qq = strlen(str) - 1;\n  for (i = 0; i < strlen(str); i++) {\n    x = 0;\n    for (j = 0; j < strlen(str); j++) {\n      if (str[i] < str[j]) {\n        x = 0;\n        break;\n      }\n      x = 1;\n    }\n    if (x == 1) {\n      qq = i;\n      break;\n    }\n  }\n  return qq;\n}\n\nint main() {\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i;\n    for (i = 0; i <= pan(); i++)\n      cout << str[i];\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = pan() + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36293", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++) {\n      if (*p > max)\n        max = *p, k = i;\n    }\n    for (p = str; p <= (str + k); p++) {\n      printf(\"%c\", *p);\n    }\n\n    printf(\"%s\", substr);\n    for (p = str + k + 1; *p != '\\0'; p++) {\n      printf(\"%c\", *p);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36294", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int i, b, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    b = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[b] < str[i])\n        b = i;\n    }\n    for (i = 12; i > (b + 3); i--)\n      str[i] = str[i - 3];\n    for (i = (b + 1); i < (b + 4); i++) {\n      str[i] = substr[i - b - 1];\n    }\n    printf(\"%s\\n\", str);\n    for (j = 0; j < 13; j++)\n      str[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36295", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void output(char a[11], char b[4]);\n  int i;\n  char a[11], b[4];\n  for (i = 0; scanf(\"%s %s\", a, b) != EOF; i++)\n    output(a, b);\n}\n\nvoid output(char a[11], char b[4]) {\n  int i, c = 0, j;\n  for (i = 1; a[i] != '\\0'; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  for (j = 0; j <= c; j++)\n    printf(\"%c\", a[j]);\n  printf(\"%s\", b);\n  for (j = j; a[j] != '\\0'; j++)\n    printf(\"%c\", a[j]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "36296", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, t, max;\n  char str1[100][50], str2[100][3];\n  i = 0;\n  while (scanf(\"%s%s\", str1[i], str2[i]) != EOF) {\n    i++;\n  }\n  n = i;\n\n  for (i = 0; i < n; i++) {\n\n    m = 0;\n    t = strlen(str1[i]);\n    max = str1[i][0];\n    for (j = 1; j < t; j++) {\n\n      if (max < str1[i][j]) {\n        m = j;\n        max = str1[i][j];\n      }\n    }\n    for (j = 0; j <= m; j++)\n      printf(\"%c\", str1[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", str2[i][j]);\n    for (j = m + 1; j < t; j++)\n      printf(\"%c\", str1[i][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36297", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100][4], c[100][100], e;\n  int i, j, max, k, l;\n  for (i = 0; i < 10; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    l = sizeof(a[i]);\n    max = a[i][0];\n    for (j = 1; j < 10; j++) {\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n    for (j = 0; j < 10; j++) {\n\n      c[i][j] = a[i][j];\n      if (a[i][j] == max)\n        break;\n    }\n    j++;\n    for (k = j; k < j + 3; k++) {\n      c[i][k] = b[i][k - j];\n    }\n    for (k = j + 3; k < 3 + l; k++) {\n      c[i][k] = a[i][k - 3];\n    }\n    printf(\"%s\\n\", c[i]);\n    if ((e = getchar()) == EOF)\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36298", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char *p, s[10], subs[4];\n  while (scanf(\"%s %s\", s, subs) != EOF) {\n    int n, i;\n    n = strlen(s);\n    p = &s[0];\n    for (i = 1; i < n; i++)\n      if (s[i] > *p)\n        p = &s[i];\n    for (i = 0; i < n; i++) {\n      cout << s[i];\n      if (&s[i] == p) {\n        printf(\"%s\", subs);\n      }\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36299", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[50][10] = {0}, substr[50][3] = {0}, a[50][13] = {0}, max[50] = {0},\n       c[50][14] = {0};\n  int len[50], i, n, j, num[50], k, cl[50];\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    cl[i] = strlen(c[i]);\n    if (cl[i] == 0) {\n      break;\n    }\n    for (j = 0; j < cl[i]; j++) {\n      if (c[i][j] != ' ') {\n        str[i][j] = c[i][j];\n      } else {\n        k = j;\n        break;\n      }\n    }\n    for (j = k + 1; j < cl[i]; j++) {\n      substr[i][j - k - 1] = c[i][j];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(str[i]);\n    for (j = 0, max[i] = str[i][0]; j < len[i]; j++) {\n      if (str[i][j] > max[i]) {\n        max[i] = str[i][j];\n        num[i] = j;\n      }\n    }\n    for (j = 0; j < (len[i] + 3); j++) {\n      k = j - num[i] - 1;\n      if (j <= num[i])\n        a[i][j] = str[i][j];\n      else {\n        if (j <= (num[i] + 3))\n          a[i][j] = substr[i][k];\n        else {\n          a[i][j] = str[i][j - 3];\n        }\n      }\n    }\n    printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "20", "index": "36300", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid function_1(char *str, char *substr) {\n  int i, max, position;\n  for (i = 1, max = str[0], position = 0; str[i] != '\u0000'; i++)\n    if (str[i] > max) {\n      max = str[i];\n      position = i;\n    }\n  str[i + 3] = '\u0000';\n  for (i -= 1; i > position; i--) {\n    str[i + 3] = str[i];\n  }\n  str[position + 1] = substr[0];\n  str[position + 2] = substr[1];\n  str[position + 3] = substr[2];\n}\n\nint main() {\n  char str[15], substr[4];\n  scanf(\"%s %s \", str, substr);\n  while (getchar() != EOF) {\n    function_1(str, substr);\n    printf(\"%s \", str);\n    scanf(\"%s %s\", str, substr);\n  }\n  return 1;\n}\n"}
{"label": "20", "index": "36301", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[5];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, m = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[i] == 0)\n        break;\n      if (str[i] > str[m]) {\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = m + 1; i < 15; i++) {\n      if (str[i] == 0)\n        break;\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36302", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      if (a[k] < a[i])\n        k = i;\n    for (i = 12; i > k + 3; i--)\n      a[i] = a[i - 3];\n    for (i = k + 1; i < k + 4; i++)\n      a[i] = b[i - k - 1];\n    printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36303", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][15], c[1000][14];\n  char ch;\n  int i, j, k, n = 0, b[1000], l;\n  for (i = 0; i < 1000; i++) {\n\n    cin >> a[i];\n    if (a[i][0] == '\u0000')\n      break;\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i]);\n    ch = a[i][0];\n    k = 0;\n    for (j = 0; j < l - 4; j++) {\n      if (ch < a[i][j]) {\n        ch = a[i][j];\n        k = j;\n      } else\n        continue;\n    }\n    for (j = 0; j < k + 1; j++) {\n      c[i][j] = a[i][j];\n    }\n    c[i][k + 1] = a[i][l - 3];\n    c[i][k + 2] = a[i][l - 2];\n    c[i][k + 3] = a[i][l - 1];\n    for (j = k + 1; a[i][j] != ' '; j++) {\n      c[i][j + 3] = a[i][j];\n    }\n    c[i][j + 3] = '\u0000';\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n}\n"}
{"label": "20", "index": "36304", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[50][13], *p, substr[50][3], max;\n  int i = 0, a[50], j, k, m;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    a[i] = strlen(str[i]);\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    for (p = str[j], max = str[j][0]; p < str[j] + a[j]; p++)\n      if (*p > max)\n        max = *p;\n    for (k = 0; k < a[j]; k++)\n      if (max == str[j][k]) {\n        for (m = a[j] + 2; m > k + 3; m--)\n          str[j][m] = str[j][m - 3];\n        str[j][k + 1] = substr[j][0];\n        str[j][k + 2] = substr[j][1];\n        str[j][k + 3] = substr[j][2];\n        str[j][a[j] + 3] = '\\0';\n        break;\n      }\n    printf(\"%s\\n\", str[j]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36305", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20], sub[10];\n  int max, i, j;\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    j = strlen(str);\n    max = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = j; i > max; i--)\n      *(str + i + 3) = *(str + i);\n    for (i = 0; i < 3; i++)\n      *(str + max + i + 1) = *(sub + i);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36306", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++)\n      if (*p > max) {\n        max = *p, k = i;\n      }\n    for (p = str; p <= (str + k); p++)\n      printf(\"%c\", *p);\n    cout << substr;\n    if (k < strlen(str)) {\n      for (p = str + k + 1; *p != '\\0'; p++)\n        printf(\"%c\", *p);\n      printf(\"\\n\");\n    } else\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36307", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[16];\n  s[15] = 0;\n  int i, len, p = 15;\n  while (cin >> s) {\n    len = strlen(s) - 5;\n    for (i = len; i >= 0; i--)\n      if (s[i] >= s[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", s[i]);\n    for (i = len + 2; i <= len + 4; i++)\n      printf(\"%c\", s[i]);\n    for (i = p + 1; i <= len; i++) {\n      printf(\"%c\", s[i]);\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36308", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11] = {'\\0'}, b[4] = {'\\0'};\n  char c;\n  int i, k, m;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    m = strlen(a);\n    c = a[0];\n    for (i = 1; i < m; i++)\n      if (a[i] > c) {\n        c = a[i];\n        k = i;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    for (i = k + 1; i < m; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36309", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid swap(char a[], int n) {\n  int i, j;\n  char t;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (a[i] < a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\nint main() {\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    char m[100];\n    strcpy(m, s1);\n    int l = strlen(m);\n    swap(m, l);\n    int i, j, k;\n    for (i = 0; i < l; i++)\n      if (s1[i] == m[0]) {\n        j = i;\n        break;\n      }\n    for (k = 0; k <= j; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s2);\n    for (i = j + 1; i < l; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36310", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[100][100];\n  int i = 0, j, count, max, m, b[100];\n  do {\n\n    cin >> c[i];\n    b[i] = strlen(c[i]);\n    i++;\n  } while (c[i - 1][0] != '\u0000');\n  m = i - 1;\n  for (i = 0; i < m; i++) {\n    max = 0;\n    count = 0;\n    for (j = 0; j < b[i] - 4; j++) {\n      if (c[i][j] > max) {\n        max = c[i][j];\n        count = j;\n      }\n    }\n    for (j = 0; j <= count; j++) {\n      cout << c[i][j];\n    }\n    for (j = b[i] - 3; j <= b[i] - 1; j++)\n      printf(\"%c\", c[i][j]);\n\n    for (j = count + 1; j < b[i] - 4; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36311", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int position, i, lena, lenb, n = 10;\n  char a[10], b[4], *p = NULL, max;\n  while (n--) {\n    max = 0;\n    memset(a, '\\0', sizeof a);\n    memset(b, '\\0', sizeof b);\n    scanf(\"%s \", a);\n    cin >> b;\n    lena = strlen(a);\n    lenb = strlen(b);\n    p = &a[0];\n    for (i = 0; i < lena; i++) {\n      if (*p > max) {\n        max = *p;\n        position = i;\n      }\n      p += 1;\n    }\n    for (i = 0; i <= position; i++)\n      cout << a[i];\n    cout << b;\n    for (i = position + 1; i < lena; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36312", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n\n  char a[20] = {0}, b[4] = {0}, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    int n, i, maxnum;\n\n    n = strlen(a);\n    maxnum = 0;\n    max = a[0];\n    for (i = 0; i < n; i++) {\n      if (max < a[i]) {\n        max = a[i];\n        maxnum = i;\n      }\n    }\n\n    for (i = n; i > maxnum; i--)\n      a[i + 3] = a[i];\n    for (i = 0; i < 3; i++)\n      a[maxnum + 1 + i] = b[i];\n    cout << a << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36313", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[4], str1[15] = {0};\n  int i, j, k, e, b;\n  while ((scanf(\"%s%s\", str, substr)) != EOF) {\n    b = strlen(str);\n    for (j = 0; j < b; j++) {\n      e = 0;\n      for (k = 0; k < b; k++) {\n        if (str[k] > str[j])\n          e = 1;\n      }\n      if (e == 0)\n        break;\n    }\n    for (k = 0; k <= j; k++)\n      str1[k] = str[k];\n\n    for (k = 0; k < 3; k++)\n      str1[j + k + 1] = substr[k];\n\n    for (k = j + 1; k < b; k++)\n      str1[k + 3] = str[k];\n\n    str1[b + 3] = 0;\n    strcpy(str, str1);\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36314", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint h(char a[], char b[]) {\n  char c;\n  int len, i = 0, k = 0;\n  len = strlen(a);\n  c = a[0];\n  while (i < len) {\n    if (a[i] > c) {\n      c = a[i];\n      k = i;\n    }\n    i++;\n  }\n  for (i = 0; i <= k; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    cout << b[i];\n  for (i = k + 1; i < len; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n\n  return 0;\n}\nint main() {\n  int h(char a[], char b[]);\n  char a[10], b[4], c;\n  int i = 0;\n  while (i < 10) {\n\n    if (scanf(\"%s%s\", a, b) == EOF)\n      break;\n    else\n      h(a, b);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36315", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid into(char x[], char y[]) {\n  int l, i, m = 0, k = 0;\n  char a[10] = {'\\0'};\n  l = strlen(x);\n  for (i = 1; i < l; i++) {\n    if (x[i] > x[m])\n      m = i;\n  }\n  for (i = m + 1; i < l; i++) {\n    a[k++] = x[i];\n    x[i] = '\\0';\n  }\n  strcat(x, y);\n  strcat(x, a);\n}\nint main() {\n  int d;\n  for (d = 0; d < 10; d++) {\n    char str[14] = {'\\0'}, substr[4] = {'\\0'};\n    scanf(\"%s %s \", str, substr);\n    into(str, substr);\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36316", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar *findmax(char *p) {\n  char *max;\n  for (max = p; *p != '\\0'; p++)\n    if (*p > *max)\n      max = p;\n  return max;\n}\n\nvoid insert(char *op, char *sp) {\n  for (; *op != *findmax(op); op++)\n    cout << *op;\n  printf(\"%c\", *op);\n\n  for (; *sp != '\\0'; sp++)\n    printf(\"%c\", *sp);\n\n  for (op++; *op != '\\0'; op++)\n    printf(\"%c\", *op);\n\n  cout << \"\\n\";\n}\n\nint main() {\n  char ori[10], sub[3], newstr[13];\n  char *orip = ori, *subp = sub, *newstrp = newstr;\n  while (scanf(\"%s %s\", ori, sub) != EOF)\n    insert(orip, subp);\n  return 0;\n}\n"}
{"label": "20", "index": "36317", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][40], su[4], s[10], max;\n  int m, length[100], i = 0, j, l, p;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      su[j] = str[i][length[i] + j - 3];\n    for (j = 0; j < length[i] - p - 5; j++)\n      s[j] = str[i][p + j + 1];\n    for (j = 0; j <= p; j++)\n      str[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      str[i][j] = su[j - p - 1];\n    for (j = p + 4; j < length[i]; j++)\n      str[i][j] = s[j - p - 4];\n    for (j = length[i] - 1; j < 40; j++)\n      str[i][j] = '\u0000';\n    cout << str[i] << \" \";\n  }\n}\n"}
{"label": "20", "index": "36318", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, mark, n, m;\n  char str[13], substr[13];\n  char a[26];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    mark = 0;\n    for (i = 0; i < n; i++)\n      if (str[i] > str[mark])\n        mark = i;\n    for (i = 0; i < mark + 1; i++)\n      a[i] = str[i];\n    for (; i < mark + m + 1; i++)\n      a[i] = substr[i - mark - 1];\n    for (; i < n + m; i++)\n      a[i] = str[i - m];\n    a[i] = '\\0';\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36319", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[15], b[11] = {'\\0'}, c[4] = {'\\0'};\n  int i, p, l;\n\n  while (scanf(\"%s%s\", b, c) != EOF) {\n    l = strlen(b);\n    p = 0;\n    for (i = 1; i < l; i++)\n      if (b[i] > b[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", b[i]);\n    for (i = 0; i < 3; i++)\n      cout << c[i];\n    for (i = p + 1; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36320", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[50][10] = {0}, substr[50][3] = {0}, a[50][13] = {0}, max[50] = {0},\n       c[50][14] = {0};\n  int len[50], i, n, j, num[50], k, cl[50];\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    cl[i] = strlen(c[i]);\n    if (cl[i] == 0)\n      break;\n    for (j = 0; j < cl[i]; j++) {\n      if (c[i][j] != ' ') {\n        str[i][j] = c[i][j];\n      } else {\n        k = j;\n        break;\n      }\n    }\n    for (j = k + 1; j < cl[i]; j++) {\n      substr[i][j - k - 1] = c[i][j];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(str[i]);\n    for (j = 0, max[i] = str[i][0]; j < len[i]; j++) {\n      if (str[i][j] > max[i]) {\n        max[i] = str[i][j];\n        num[i] = j;\n      }\n    }\n    for (j = 0; j < (len[i] + 3); j++) {\n      k = j - num[i] - 1;\n      if (j <= num[i]) {\n        a[i][j] = str[i][j];\n      } else {\n        if (j <= (num[i] + 3)) {\n          a[i][j] = substr[i][k];\n        } else {\n          a[i][j] = str[i][j - 3];\n        }\n      }\n    }\n    printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "20", "index": "36321", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, ii;\n  char res[100][20];\n  int p = 0;\n  char c, sub1[20], sub2[20];\n  char str[20], substr[5];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > c) {\n        c = str[i];\n        ii = i;\n      }\n    strcpy(sub1, str);\n    sub1[ii + 1] = '\\0';\n    strcpy(sub1, strcat(sub1, substr));\n    for (i = ii + 1; i < strlen(str); i++)\n      sub2[i - ii - 1] = str[i];\n    sub2[strlen(str) - ii - 1] = '\\0';\n    strcpy(res[p], strcat(sub1, sub2));\n    p++;\n  }\n  for (i = 0; i < p; i++)\n    printf(\"%s\\n\", res[i]);\n}\n"}
{"label": "20", "index": "36322", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p1 = str, *p2 = substr;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (i = 0, k = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[k])\n        k = i;\n    }\n\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", *(p1 + j));\n    cout << substr;\n    for (j = 0; str[k + 1 + j] != '\\0'; j++)\n      printf(\"%c\", *(p1 + k + 1 + j));\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36323", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][13];\n  char c[1000][17];\n  char b[1000][3];\n  int n = 0, i = 0, j, m, k;\n  for (i = 0; i < 1000; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == '\u0000') {\n      n = i;\n      break;\n    }\n\n    for (j = 0; j < 17; j++) {\n      if (c[i][j] == ' ') {\n        for (k = 0; k < j; k++) {\n          a[i][k] = c[i][k];\n          a[i][j] = '\u0000';\n        }\n        for (k = 0; k < 3; k++) {\n          b[i][k] = c[i][k + j + 1];\n        }\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      if (a[i][j] > a[i][m]) {\n        m = j;\n      }\n    }\n    for (j = 9; j > m; j--) {\n      a[i][j + 3] = a[i][j];\n    }\n    for (j = 0; j < 3; j++) {\n      a[i][m + j + 1] = b[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", a[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36324", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[20];\n  int i, n, a;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = 0;\n    a = strlen(str);\n    for (i = 1; i < a; i++) {\n      if (str[i] > str[n])\n        n = i;\n    }\n    for (i = 0; i < n + 1; i++) {\n      x[i] = str[i];\n    }\n    x[n + 1] = substr[0];\n    x[n + 2] = substr[1];\n    x[n + 3] = substr[2];\n    for (i = n + 4; i < a + 4; i++) {\n      x[i] = str[i - 3];\n    }\n    for (i = 0; i < a + 3; i++) {\n      cout << x[i];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36325", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], s[14];\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    cin >> substr;\n    int len;\n    int jh = 0;\n    len = strlen(str);\n    for (j = 0; j <= len - 1; j++) {\n      if (str[j] > str[jh])\n        jh = j;\n    }\n    for (j = 0; j <= jh; j++)\n      s[j] = str[j];\n\n    for (j = jh + 1; j <= jh + 3; j++) {\n      s[j] = substr[j - jh - 1];\n    }\n    for (j = jh + 4; j <= len + 2; j++) {\n      s[j] = str[j - 3];\n    }\n    s[len + 3] = '\\0';\n    puts(s);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36326", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], sub[10];\n  int max, i, j;\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    j = strlen(str);\n    max = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = j; i > max; i--)\n      *(str + i + 3) = *(str + i);\n    for (i = 0; i < 3; i++)\n      *(str + max + i + 1) = *(sub + i);\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36327", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[300], s2[300];\n  int l1, max, p, i;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l1 = strlen(s1);\n    max = 0;\n    p = 0;\n    for (i = 0; i < l1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        p = i;\n      }\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s1[i]);\n      if (p == i)\n        printf(\"%s\", s2);\n    }\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36328", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint posi(char str[]) {\n  int i, k = 0;\n  for (i = 1; i < strlen(str); i++) {\n    if (str[i] > str[k])\n      k = i;\n  }\n  return k + 1;\n}\nint main() {\n  char str[20], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int k, i, l = strlen(str);\n    k = posi(str);\n    for (i = l; i >= k; i--)\n      str[i + 3] = str[i];\n\n    for (i = 0; i < 3; i++) {\n      str[k + i] = substr[i];\n    }\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36329", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[13], s2[5];\n  int i, j, m, a;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    a = 0;\n    m = strlen(s1);\n    for (i = 0; i < m; i++) {\n      if (s1[i] > s1[a])\n        a = i;\n    }\n    for (i = m - 1; i > a; i--)\n      s1[i + 3] = s1[i];\n    for (i = a + 1, j = 0; i < a + 1 + 3; i++, j++)\n      s1[i] = s2[j];\n    for (i = 0; i < m + 3; i++)\n      cout << s1[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36330", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, m;\n  int max[100];\n  char str[100][100], substr[100][100];\n  memset(max, 0, sizeof(int) * 100);\n  while (scanf(\"%s %s\", &str[i], &substr[i]) != EOF) {\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    for (k = 0; k < strlen(str[j]); k++)\n      if (str[j][k] > str[j][max[j]]) {\n        max[j] = k;\n      }\n  }\n  for (j = 0; j < i; j++) {\n    k = 0;\n    while (k <= max[j])\n      putchar(str[j][k]), k++;\n\n    for (m = 0; m < strlen(substr[j]); m++)\n      putchar(substr[j][m]);\n    while (k < strlen(str[j])) {\n      putchar(str[j][k]), k++;\n    }\n    putchar('\\n');\n  }\n}\n"}
{"label": "20", "index": "36331", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, k, f;\n  for (i = 0;; i++) {\n    char str[14] = {0}, sub[4] = {0}, str1[14] = {0}, c; \n    a = 0;\n    j = 0;\n    b = 0;\n    f = 0;\n    k = 0;\n    n = 0;\n\n    cin >> str;\n    if (str[0] == 0)\n      break;\n    k = strlen(str);\n    while (str[j] != ' ') {\n      str1[j] = str[j]; \n      j++;\n    }\n    n = strlen(str1);\n    b = j + 1;\n    while (b < k && f < 3) {\n      sub[f] = str[b]; \n      b++;\n      f++;\n    }\n    c = str1[0];\n    for (j = 1; j < n; j++) {\n      if (c < str1[j])\n        c = str1[j]; \n    }\n    for (j = 0; j < n; j++) {\n      if (str1[j] == c) {\n        a = j + 1; \n        break;\n      }\n    }\n    for (j = 0; j < a; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\"%s\", sub);\n    for (j = a; j < n; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36332", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, max = 0;\n  char str[11], substr[4], maxx = 0;\n  char zong[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    maxx = 0;\n    j = 0;\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] > maxx) {\n        max = i;\n        maxx = str[i];\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      zong[j++] = str[i];\n    }\n    for (i = 0; i <= 2; i++) {\n      zong[j++] = substr[i];\n    }\n    for (i = max + 1; i <= strlen(str) - 1; i++) {\n      zong[j++] = str[i];\n    }\n    zong[j] = '\\0';\n    cout << zong << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36333", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[14] = {' '};\n  char b[4] = {' '};\n  while (cin.get(a, 11, ' ')) {\n    cin.get();\n    cin.get(b, 4, '\\n');\n    int k = 0;\n    char max = NULL;\n    for (int j = 0; j < strlen(a); j++)\n      if (a[j] > max) {\n        max = a[j];\n        k = j;\n      }\n    for (int i = strlen(a) - 1; i > k; i--)\n      a[i + 3] = a[i];\n    a[k + 1] = b[0];\n    a[k + 2] = b[1];\n    a[k + 3] = b[2];\n    printf(\"%s\\n\", a);\n    for (int p = 0; p < 14; p++)\n      a[p] = '\\n';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36334", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[10] = {0}, b[3] = {0}, c[10] = {0};\n  while (scanf(\"%s \", a)) {\n    int i, temp = 0;\n    for (i = 0; i < 10; i++)\n      c[i] = a[i];\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[temp] - a[i] < 0)\n        temp = i;\n    }\n    for (i = 0; i <= temp; i++)\n      cout << c[i];\n    getchar();\n    cin >> b;\n    cout << b[0] << b[1] << b[2];\n    for (i = temp + 1; i < len; i++)\n      printf(\"%c\", c[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36335", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], string[14], *p;\n  int i, index;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    for (i = 1; str[i]; i++)\n\n      if (str[i] > *p) {\n        index = i;\n        p = &str[i];\n      }\n    string[0] = '\\0';\n    strncat(string, str, index + 1);\n    strcat(string, substr);\n    strcat(string, p + 1);\n    cout << string << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36336", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char str[13] = {0}, substr[4] = {0}, max;\n  while (cin >> str) {\n    cin >> substr;\n    max = str[0]; \n    char *p = str, *q = substr;\n    for (p = str + 1; p <= str + 9; p++)\n      if (max < *p)\n        max = *p;\n    for (p = str; p < str + 10; p++) \n      if (*p == max)\n        break;\n    k = p - str;\n    for (p = str + 9; p > str + k; p--) \n      *(p + 3) = *p;\n    for (p = str + k + 1; p <= str + k + 3; p++, q++) \n      *p = *q;\n    p = str;\n    cout << p << endl;\n    for (i = 0; i < 10; i++) \n      str[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36337", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[5];\n  int i, n = 0, l, s = 0;\n  while (scanf(\"%s %s\", &a, &b) != EOF) {\n    l = strlen(a);\n    int max;\n    char *p = &a[0];\n    max = *p;\n    for (i = 0; i < l; i++, p++) {\n      if (*p > max) {\n        max = *p;\n        n = i;\n      }\n    }\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    if (n < l - 1) {\n      for (i = n + 1; i < l - 1; i++)\n        printf(\"%c\", a[i]);\n      printf(\"%c\\n\", a[l - 1]);\n    } else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36338", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][15] = {'\u0000'};\n  int n, i, j;\n  for (i = 0; i < 1000; i++) {\n\n    cin >> a[i];\n    n = strlen(a[i]);\n    if (n == 0)\n      break;\n  }\n  int k = i;\n  int max, p;\n  for (i = 0; i < k; i++) {\n    max = a[i][0];\n    p = 0;\n    n = strlen(a[i]);\n    for (j = 0; j < n - 4; j++) {\n      if (a[i][j] > max) {\n        max = a[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j <= p; j++) {\n      cout << a[i][j];\n    }\n    printf(\"%c%c%c\", a[i][n - 3], a[i][n - 2], a[i][n - 1]);\n    for (j = p + 1; j < n - 4; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36339", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, m, c, f;\n\n  char str[20], substr[10], de[20], max;\n  char *p, *q, *t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    max = 0;\n    for (p = str; p < (str + n); p++)\n      if (*p > max) {\n        max = *p;\n        t = p;\n      }\n    \n    for (p = str, i = 0; p < (t + 1); p++)\n      de[i++] = *p;\n    for (c = i, q = substr; q < (substr + m); q++)\n      de[c++] = *q;\n    for (p = (t + 1), f = c; p < (str + n); p++)\n      de[f++] = *p;\n    for (q = de; q < (f + de); q++)\n      printf(\"%c\", *q);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36340", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint h(char a[], char b[]) {\n  char c;\n  int len, i = 0, k = 0;\n  len = strlen(a);\n  c = a[0];\n  while (i < len) {\n    if (a[i] > c) {\n      c = a[i];\n      k = i;\n    }\n    i++;\n  }\n  for (i = 0; i <= k; i++)\n    cout << a[i];\n  for (i = 0; i < 3; i++)\n    cout << b[i];\n  for (i = k + 1; i < len; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n\n  return 0;\n}\nint main() {\n  int h(char a[], char b[]);\n  char a[10], b[4], c;\n  int i = 0;\n  while (i < 10) {\n\n    if (scanf(\"%s%s\", a, b) == EOF)\n      break;\n    else\n      h(a, b);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36341", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, m, l;\n  char c[11] = {' '}, cc[4] = {' '};\n  while (!(feof(stdin))) {\n    scanf(\"%s%s\\n\", c, cc);\n    l = strlen(c) - 1;\n    m = 0;\n    for (i = 0; i <= l; i++)\n      if (c[i] > c[m])\n        m = i;\n    for (i = 0; i <= m; i++)\n      putchar(c[i]);\n    printf(\"%s\", cc);\n    for (i = m + 1; i <= l; i++)\n      putchar(c[i]);\n    printf(\"\\n\");\n  }\n  return 7;\n}\n"}
{"label": "20", "index": "36342", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void in(char str[], char substr[]);\n  char str[100], substr[100];\n  while ((scanf(\"%s%s\", &str, &substr)) != EOF)\n    in(str, substr);\n}\n\nvoid in(char str[], char substr[]) {\n  int i, k, max, l;\n  l = strlen(str);\n  max = str[0];\n  for (i = 1; i < l; i++) {\n    if (max < str[i]) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "36343", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid in(char str[13], char substr[3]) {\n  int i, j, k, r;\n  for (i = 0; i <= 9; i++) {\n    r = 1;\n    for (j = i; j <= 9; j++) {\n      if (str[i] < str[j]) {\n        r = 0;\n        break;\n      }\n    }\n    if (r == 1) {\n      for (k = 12; k >= i + 4; k--) {\n        str[k] = str[k - 3];\n      }\n      str[i + 1] = substr[0];\n      str[i + 2] = substr[1];\n      str[i + 3] = substr[2];\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][13] = {0};\n  char substr[100][3] = {0};\n  int i, n;\n  char c;\n  for (n = 0;; n++) {\n    if ((c = getchar()) == EOF) {\n      break;\n    } else {\n      str[n][0] = c;\n      scanf(\"%s %s\", &str[n][1], substr[n]);\n    }\n    in(str[n], substr[n]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n\n    printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36344", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, max, m;\n  char str[11], substr[4], temp[10];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"%s\", substr);\n    for (i = m + 1; i < n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\0\");\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36345", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid function_1(char *str, char *substr) {\n  int i, max, position;\n  for (i = 1, max = str[0], position = 0; str[i] != '\u0000'; i++)\n    if (str[i] > max) {\n      max = str[i];\n      position = i;\n    }\n  str[i + 3] = '\u0000';\n  for (i -= 1; i > position; i--) {\n    str[i + 3] = str[i];\n  }\n  str[position + 1] = substr[0];\n  str[position + 2] = substr[1];\n  str[position + 3] = substr[2];\n}\n\nint main() {\n  char str[15], substr[4];\n  scanf(\"%s %s\", str, substr);\n  while (getchar() != EOF) {\n    function_1(str, substr);\n    printf(\"%s \", str);\n    scanf(\"%s %s\", str, substr);\n  }\n  return 1;\n}\n"}
{"label": "20", "index": "36346", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[4];\n  int max, i, j, k, p, length;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    length = strlen(str);\n    max = str[0];\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (j = length - 1; j >= k + 1; j--) {\n      str[j + 3] = str[j];\n    }\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    for (p = 0; p < length + 3; p++) {\n      printf(\"%c\", str[p]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36347", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  int i, k, l;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    k = 0;\n    l = strlen(str);\n    max = str[0];\n    for (i = 1; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (i == k) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else\n        printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36348", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint fmax(char str[]);\n\nint main() {\n  char str[11], substr[4], rstr[14];\n  int i;\n  while (cin.getline(str, 12, ' ') && cin.getline(substr, 4)) {\n    for (i = 0; i <= fmax(str); i++)\n      rstr[i] = str[i];\n    for (i = 0; i < 3; i++)\n      rstr[fmax(str) + 1 + i] = substr[i];\n    for (i = 0; i < strlen(str) - fmax(str) - 1; i++) {\n      rstr[fmax(str) + 4 + i] = str[fmax(str) + i + 1];\n    }\n    rstr[fmax(str) + 4 + i] = '\\0';\n    cout << rstr << \"\\n\";\n  }\n  return 0;\n}\n\nint fmax(char str[]) {\n  int max = 0, i;\n  for (i = 0; i < strlen(str); i++)\n    max = (str[i] > str[max] ? i : max);\n  return max;\n}\n"}
{"label": "20", "index": "36349", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[11] = {0}, s2[4] = {0}, *p;\n  int i, n, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    p = &s1[0];\n    for (i = 0; i < n; i++)\n      if (*p < s1[i])\n        p = &s1[i];\n    m = p - &s1[0] + 1;\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"%s\", s2);\n    for (i = m; s1[i] != 0; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36350", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000] = {'\\0'}, substr[3], str2[1000] = {'\\0'};\n  int i, l = 0, max = 0;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > str[max]) {\n        max = i;\n      }\n    }\n\n    for (i = max + 1; i < l; i++) {\n      str2[i - 1 - max] = str[i];\n    }\n    str[max + 1] = substr[0];\n    str[max + 2] = substr[1];\n    str[max + 3] = substr[2];\n    str[max + 4] = '\\0';\n    strcat(str, str2);\n    printf(\"%s\\n\", str);\n    i = 0;\n    while (str2[i] != '\\0') {\n      str2[i] = '\\0';\n      i++;\n    }\n  }\n}\n"}
{"label": "20", "index": "36351", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, max, m;\n  char str[11], substr[4], temp[10];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"%s\", substr);\n    for (i = m + 1; i < n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << \"\\0\";\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36352", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][10] = {'\\0'}, substr[100][3] = {'\\0'}, re[100][13] = {'\\0'};\n  char *p;\n  int n, i, j, k;\n  for (n = 0; scanf(\"%s\", str[n]) != EOF; n++)\n    scanf(\"%s\", substr[n]);\n  for (i = 0, k = 0; i < n; i++) {\n    p = &str[i][0];\n    k = 0;\n    for (j = 1; *(p + j) != '\\0'; j++) {\n      if (*(p + k) < *(p + j))\n        k = j;\n    }\n    for (j = 0; j <= k; j++, p++)\n      re[i][j] = *p;\n    for (; j <= k + 3; j++)\n      re[i][j] = substr[i][j - k - 1];\n    for (; *p != '\\0'; p++, j++)\n      re[i][j] = *p;\n  }\n  for (i = 0; i < n; i++) {\n    p = &re[i][0];\n    for (; *p != '\\0'; p++)\n      printf(\"%c\", *p);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36353", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint seekmax(char a[]) {\n  int k = 0, i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] > a[k])\n      k = i;\n    i++;\n  }\n  return k;\n}\nvoid insert(char a[], char b[], int k) {\n  int n, i;\n  n = strlen(a);\n  for (i = n; i > k; i--)\n    a[i + 3] = a[i];\n  for (i = 1; i <= 3; i++)\n    a[k + i] = b[i - 1];\n  cout << a << \"\\n\";\n}\nint main() {\n  int i = 0, j = 0;\n  char a[15], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    insert(a, b, seekmax(a));\n}\n"}
{"label": "20", "index": "36354", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14], c, fd;\n  int k, i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36355", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  char a[20] = {0}, b[4] = {0}, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    int n, i, maxnum;\n\n    n = strlen(a);\n    maxnum = 0;\n    max = a[0];\n    for (i = 0; i < n; i++) {\n      if (max < a[i]) {\n        max = a[i];\n        maxnum = i;\n      }\n    }\n\n    for (i = n; i > maxnum; i--)\n      a[i + 3] = a[i];\n    for (i = 0; i < 3; i++)\n      a[maxnum + 1 + i] = b[i];\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "20", "index": "36356", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\n  int i, j, n, max, maxspot, k = 0, l;\n  char str[100][11], substr[100][4];\n\n  while (scanf(\"%s%s\", str[k], substr[k]) != EOF)\n    k++;\n\n  for (l = 0; l < k; l++) {\n\n    n = strlen(str[l]);\n    max = str[l][0];\n    maxspot = 0;\n    for (i = 0; i < n; i++) {\n      if (str[l][i] > max) {\n        max = str[l][i];\n        maxspot = i;\n      }\n    }\n    for (j = 0; j < maxspot + 1; j++)\n      printf(\"%c\", str[l][j]);\n    printf(\"%s\", substr[l]);\n    for (j = maxspot + 1; j < n; j++)\n      printf(\"%c\", str[l][j]);\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36357", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      if (a[k] < a[i])\n        k = i;\n    for (i = 12; i > k + 3; i--)\n      a[i] = a[i - 3];\n    for (i = k + 1; i < k + 4; i++)\n      a[i] = b[i - k - 1];\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "20", "index": "36358", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], t, s1, s2;\n  int j = 0, i, len, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    t = str[0];\n    for (i = 1; i < len; i++) {\n      if (t < str[i]) {\n        k = i;\n        t = str[i];\n      }\n    }\n\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36359", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[15], t[15];\n  int i, k;\n  while (scanf(\"%s%s\", s, t) != EOF) {\n    k = 0;\n    for (i = 1; s[i]; ++i)\n      if (s[k] < s[i])\n        k = i;\n    for (i = 0; i <= k; ++i)\n      putchar(s[i]);\n    printf(\"%s\", t);\n    for (i = k + 1; s[i]; ++i)\n      putchar(s[i]);\n    putchar('\\n');\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36360", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char a[]) {\n  int i, t = a[0];\n  for (i = 0; i <= strlen(a); i++) {\n    if (t < a[i])\n      t = a[i];\n  }\n  i = 0;\n  while (a[i] != t)\n    i++;\n  return i;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i;\n    int t = max(str);\n    for (i = 0; i <= t; i++)\n      cout << str[i];\n    printf(\"%s\", substr);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36361", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[100][11];\n  char s2[100][4];\n  int i, j, m, k, p;\n  scanf(\"%s%s\", s1[0], s2[0]);\n  m = 0;\n  p = 0;\n  do {\n    m = 0;\n    for (k = 0; k < strlen(s1[p]); k++) {\n\n      if (s1[p][k] > s1[p][m])\n        m = k;\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", s1[p][i]);\n    }\n    printf(\"%s\", s2[p]);\n    for (j = m + 1; j < strlen(s1[p]); j++) {\n      cout << s1[p][j];\n    }\n    printf(\"\\n\");\n    p++;\n  } while (scanf(\"%s%s\", s1[p], s2[p]) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36362", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char aa[20], bb[10], c;\n  int i;\n  while (cin >> aa >> bb) {\n    i = 0;\n    c = aa[0];\n    while (aa[i] != '\\0') {\n      if (aa[i] > c)\n        c = aa[i];\n      i++;\n    }\n    i = 0;\n    while (aa[i] != '\\0') {\n      if (aa[i] == c) {\n        break;\n      }\n      cout << aa[i];\n      i++;\n    }\n    cout << aa[i] << bb;\n    i++;\n    while (aa[i] != '\\0') {\n      printf(\"%c\", aa[i]);\n      i++;\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36363", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], str[4], max;\n  unsigned int position, i;\n  while (scanf(\"%s%s\", a, str) != EOF) {\n    max = a[0];\n    for (i = 0; i < strlen(a); i++)\n      if (max < a[i])\n        max = a[i];\n    for (i = 0; i < strlen(a); i++)\n      if (max == a[i]) {\n        position = i;\n        break;\n      }\n    for (i = 0; i <= position; i++)\n      cout << a[i];\n    printf(\"%s\", str);\n    for (i = position + 1; i < strlen(a); i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36364", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(char a[]) {\n  int i, l, l0, b = 0;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (b < a[i]) {\n      b = a[i];\n      l0 = i;\n    }\n  }\n  return (l0);\n}\nint main() {\n  char s1[11], s2[4], s[14];\n  int j, i, l, l0;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    l0 = f(s1);\n    for (i = 0; i <= l0; i++)\n      s[i] = s1[i];\n    for (j = 0, i = l0 + 1; j < 3; j++, i++)\n      s[i] = s2[j];\n    for (j = l0 + 1, i = l0 + 4; j <= l; j++, i++)\n      s[i] = s1[j];\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36365", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char p[10];\n  while (cin >> p) {\n    char b[4];\n    int max = 0, i, j, len1;\n    scanf(\"%s \", b);\n    char ma = *p;\n    len1 = strlen(p);\n    for (i = 0; i < len1; i++)\n      if (p[i] > ma) {\n        ma = p[i];\n        max = i;\n      }\n\n    for (j = 0; j <= max; j++)\n      cout << p[j];\n    cout << b;\n    for (j = j; j < len1; j++)\n      printf(\"%c\", p[j]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36366", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, maxnum, max, n;\n  char *p1, str1[20], str2[20], strcopy[20], *p3;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    p1 = str1;\n    p3 = strcopy;\n    for (i = 0, max = 0; str1[i] != '\\0'; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        maxnum = i;\n      }\n    strcpy(strcopy, str1);\n    *(p3 + maxnum + 1) = '\\0';\n    strcat(strcopy, str2);\n    for (p1 = &str1[maxnum + 1], p3 = &strcopy[maxnum + 4]; *p1 != '\\0';\n         p1++, p3++)\n      *p3 = *p1;\n    n = strlen(str1);\n    strcopy[n + 3] = '\\0';\n    puts(strcopy);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36367", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, i, max = 0;\n  char str[100], substr[100], m;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = str[0];\n    for (i = 0; i < n; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        max = i;\n      }\n    }\n    for (i = 0; i < n; i++) {\n      cout << str[i];\n      if (i == max)\n        cout << substr;\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36368", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000] = {'\\0'}, substr[3], str2[1000] = {'\\0'};\n  int i, l = 0, max = 0;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n\n    for (i = max + 1; i < l; i++)\n      str2[i - 1 - max] = str[i];\n\n    str[max + 1] = substr[0];\n    str[max + 2] = substr[1];\n    str[max + 3] = substr[2];\n    str[max + 4] = '\\0';\n    strcat(str, str2);\n    cout << str << \"\\n\";\n    i = 0;\n    while (str2[i] != '\\0') {\n      str2[i] = '\\0';\n      i++;\n    }\n  }\n}\n"}
{"label": "20", "index": "36369", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint posi(char str[]) {\n  int i, k = 0;\n  for (i = 1; i < strlen(str); i++) {\n    if (str[i] > str[k])\n      k = i;\n  }\n  return k + 1;\n}\nint main() {\n  char str[20], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int k, i, j, l = strlen(str);\n    k = posi(str);\n    for (i = l; i >= k; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 0; i < 3; i++)\n      str[k + i] = substr[i];\n\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36370", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char str[13] = {0}, substr[4] = {0}, max;\n  while (scanf(\"%s %s \", str, substr)) {\n    max = str[0];\n    for (i = 0; i < 9; i++)\n      if (max < str[i + 1])\n        max = str[i + 1];\n    for (i = 0; i < 10; i++) {\n      if (str[i] == max) {\n        k = i;\n        break;\n      }\n    }\n    for (i = 9; i > k; i--)\n      str[i + 3] = str[i];\n    for (i = k + 1; i <= k + 3; i++)\n      str[i] = substr[i - k - 1];\n    cout << str << \"\\n\";\n    for (i = 0; i < 10; i++)\n      str[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36371", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], sub[4], *p, *max;\n  while (cin >> str) {\n    max = str;\n    cin >> sub;\n    for (p = str + 1; *p; p++)\n      if (*max < *p)\n        max = p;\n    for (p = str; p <= max; p++)\n      cout << *p;\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36372", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint findMax(char *str) {\n  int i, max = *str, ret = 0;\n  for (i = 0; *(str + i); i++)\n    if (*(str + i) > max)\n      max = *(str + i), ret = i;\n  return ret;\n}\n\nvoid insert(char *str, char *substr, int index) {\n  int i;\n  char *p;\n\n  for (p = str + strlen(str); p > str + index; p--)\n    *(p + strlen(substr)) = *p;\n\n  for (i = 0; i < strlen(substr); i++)\n    *(str + index + 1 + i) = *(substr + i);\n}\nint main() {\n  int k;\n  char str[11], substr[4];\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = findMax(str);\n\n    insert(str, substr, k);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36373", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, maxi;\n  char max, a[10], b[10];\n  while (scanf(\"%s \", a) != EOF) {\n    max = a[0];\n\n    cin >> b;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (a[i] > max) {\n        maxi = i;\n        max = a[i];\n      }\n    }\n    for (i = 0; i <= maxi; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", b);\n    for (i = maxi + 1; a[i] != '\u0000'; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36374", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], finalstr[1000][13];\n  int n, i, j, l, k;\n  for (i = 0; scanf(\"%s%s\", str[i], substr[i]) != EOF; i++) {\n  }\n  n = i;\n  for (k = 0; k < n; k++) {\n    l = strlen(str[k]);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (str[k][i] < str[k][j])\n          break;\n      }\n      if (j == l) {\n        break;\n      }\n    }\n    for (j = 0; j <= i; j++)\n      finalstr[k][j] = str[k][j];\n    for (j = 0; j < 3; j++)\n      finalstr[k][i + j + 1] = substr[k][j];\n    for (j = 1; j < l - i; j++)\n      finalstr[k][i + 3 + j] = str[k][i + j];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", finalstr[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36375", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, len[100];\n  char a[100][19], str[100][10], substr[100][3], max;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 19; j++)\n      a[i][j] = '\u0000';\n\n  cin >> a[0];\n  for (i = 1;; i++) {\n    if (strlen(a[i - 1]) == 0)\n      break;\n    else {\n\n      cin >> a[i];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(a[i]);\n    a[i][len[i] - 4] = '\u0000';\n    substr[i][0] = a[i][len[i] - 3];\n    substr[i][1] = a[i][len[i] - 2];\n    substr[i][2] = a[i][len[i] - 1];\n  }\n\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      max = max > a[i][j] ? max : a[i][j];\n    for (j = 0; a[i][j] != max; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\"%c\", max);\n    for (k = 0; k < 3; k++)\n      printf(\"%c\", substr[i][k]);\n    j++;\n    for (; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36376", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[15];\n  int max, num, i, j;\n  while (1) {\n    max = 0;\n\n    if (scanf(\"%s%s\", str, substr) == EOF) {\n      break;\n    }\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    strncpy(x, str, num + 1);\n    for (j = num + 1; j <= num + strlen(substr); j++) {\n      x[j] = substr[j - num - 1];\n    }\n\n    for (j = num + strlen(substr) + 1; j < strlen(substr) + strlen(str); j++)\n      x[j] = str[j - strlen(substr)];\n\n    x[j] = '\\0';\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36377", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[15];\n  int i, m, n;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    m = 0;\n    for (i = 1; i < n; i++) {\n      if (a[i] > a[m]) {\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      c[i] = a[i];\n    }\n    c[m + 1] = b[0];\n    c[m + 2] = b[1];\n    c[m + 3] = b[2];\n    for (i = m + 1; i < n; i++) {\n      c[3 + i] = a[i];\n    }\n    c[3 + n] = '\u0000';\n    cout << c << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36378", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint number(char a[]) {\n  int i, m = 0;\n  for (i = 0; a[i] != 0; i++)\n    m++;\n  return m;\n}\nvoid change(char a[], int m, char b[]) {\n  int i, j = 0;\n  char c[13];\n  for (i = m + 1; a[i] != 0; i++) {\n    c[j] = a[i];\n    j++;\n    a[i] = 0;\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\nvoid in(char a[], char b[]) {\n  int i, j, m;\n  for (i = 0; a[i] != 0; i++) {\n    m = 0;\n    for (j = 0; a[j] != 0; j++)\n      if (a[i] >= a[j])\n        m++;\n    if (m == number(a)) {\n      change(a, i, b);\n      break;\n    }\n  }\n}\nvoid remove(char a[]) {\n  int i;\n  for (i = 0; a[i] != 0; i++)\n    a[i] = 0;\n}\nint main() {\n  char str[15] = {0}, substr[4] = {0};\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    in(str, substr);\n    remove(str);\n    remove(substr);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36379", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint plug(char str[11], char substr[4]) {\n  int i, j, t, c, n, a[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n  char p[11], q;\n  n = strlen(str);\n  strcpy(p, str);\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (p[i] < p[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n        q = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = q;\n      }\n  c = a[0];\n  for (i = 0; i <= c; i++) {\n    printf(\"%c\", str[i]);\n  }\n  cout << substr;\n  for (i = c + 1; i < n; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  return 0;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF)\n    plug(str, substr);\n\n  return 0;\n}\n"}
{"label": "20", "index": "36380", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s, s1[100], s2[100], k = 0, j = 0, len, i, h;\n  int max = -2000;\n  while (scanf(\"%c\", &s) != EOF) {\n    if (s == '\\n') {\n      s2[j] = '\\0';\n      j = 0;\n      k = 0;\n      len = strlen(s1);\n      max = -2000;\n      for (h = 0; h < len; h++)\n        if (s1[h] > max) {\n          max = s1[h];\n          i = h;\n        }\n      for (h = 0; h <= i; h++)\n        printf(\"%c\", s1[h]);\n      printf(\"%s\", s2);\n      for (h = i + 1; h < len; h++)\n        cout << s1[h];\n      printf(\"\\n\");\n    } else if (s == ' ') {\n      s1[j] = '\\0';\n      j = 0;\n      k = 1;\n    } else {\n      if (k) {\n        s2[j] = s;\n        j++;\n      } else {\n        s1[j] = s;\n        j++;\n      }\n    }\n  }\n  getchar();\n  getchar();\n}\n"}
{"label": "20", "index": "36381", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  char str[11], substr[4];\n  while (cin >> str) {\n    cin >> substr;\n    char *max = str, temp;\n    int i;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > *max) {\n        max = &str[i];\n        temp = *max;\n      }\n    *max = 0;\n    printf(\"%s%c%s%s\\n\", str, temp, substr, max + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36382", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int i;\n  char *p1;\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    p1 = &a[0];\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] > *p1) {\n        p1 = &a[i];\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (&a[i] != p1)\n        printf(\"%c\", a[i]);\n      if (&a[i] == p1)\n        printf(\"%c%c%c%c\", *p1, b[0], b[1], b[2]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36383", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(char x[], char y[]) {\n  int lenx, leny;\n  int i, k, j;\n  char p;\n  lenx = strlen(x);\n  leny = strlen(y);\n  k = 0;\n  p = x[0];\n  for (i = 0; i <= lenx - 1; i++) {\n    if (x[i] > p) {\n      k = i;\n      p = x[i];\n    }\n  }\n  for (i = lenx - 1; i >= k + 1; i--) {\n    x[i + 3] = x[i];\n  }\n  for (i = k + 1; i <= k + 3; i++)\n    x[i] = y[i - k - 1];\n  x[lenx + 3] = '\\0';\n}\nint main() {\n  char x[20], y[4];\n  while (scanf(\"%s %s\", x, y) != EOF) {\n\n    f(x, y);\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36384", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a, int b, char c[]) {\n  int i;\n  for (i = a; i <= b; i++)\n    cout << c[i];\n}\nint arrange(char a[]) {\n  int m = 0, i, n;\n  n = strlen(a);\n  int t = a[0];\n  for (i = 0; i < n; i++) {\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m;\n    m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36385", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    int i, t, m;\n    m = strlen(str);\n    max = str[0];\n    t = 0;\n    for (i = 0; i <= m - 2; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        t = i + 1;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"%s\", substr);\n    for (i = t + 1; i <= m - 2; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%c\\n\", str[m - 1]);\n  }\n}\n"}
{"label": "20", "index": "36386", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[10][11], substr[10][4], output[10][14] = {'\\0'};\n  int maxN = 0, i = 0, j, end;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n\n    i++;\n  }\n  end = i;\n  for (i = 0; i < end; i++) {\n    char max = str[i][0], *p;\n    p = output[i];\n    for (j = 0; j < strlen(str[i]); j++)\n      if ((int)str[i][j] > (int)max) {\n        max = str[i][j];\n        maxN = j + 1;\n      }\n    strncpy(p, str[i], maxN);\n    strcat(p, substr[i]);\n    strcat(p + strlen(output[i]), str[i] + maxN);\n    cout << output[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36387", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n\n  for (j = 0; j < ceshi; j++) {\n    dizhi[j] = str[j];\n    weizhi = 1;\n    max = *(dizhi[j]);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36388", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int p, j, k, len, i;\n  char str[100][10] = {'\u0000'}, ch[100][3], sub[100][20], tol[100][30];\n  for (i = 0; i < 100; i++) {\n    cin >> tol[i];\n    len = strlen(tol[i]);\n    if (len == 0)\n      break;\n    for (j = 0;; j++) {\n      str[i][j] = tol[i][j];\n      if (str[i][j] == ' ') {\n        str[i][j] = '\u0000';\n        break;\n      }\n    }\n    for (k = 0; k < 3; k++) {\n      ch[i][k] = tol[i][j + 1];\n      j++;\n    }\n    for (j = 1, p = 0; j < len; j++) {\n      if (str[i][p] < str[i][j])\n        p = j;\n    }\n\n    strncpy(sub[i], str[i], p + 1);\n\n    sub[i][p + 1] = ch[i][0];\n    sub[i][p + 2] = ch[i][1];\n    sub[i][p + 3] = ch[i][2];\n    for (j = 0; j <= len - 1 - p; j++)\n      sub[i][p + 4 + j] = str[i][p + j + 1];\n  }\n  printf(\"%s\", sub[0]);\n  for (i = 1; strlen(tol[i]) != 0; i++) {\n    printf(\" %s\", sub[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36389", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *a, *b, *t;\n  int i, n, max = 0;\n  a = (char *)calloc(1, 12);\n  b = (char *)calloc(1, 5);\n  t = (char *)calloc(1, 20);\n  for (; scanf(\"%s %s\", a, b) != EOF;) {\n    for (i = 0; i < (n = strlen(a)); i++) {\n      if (*(a + i) > max)\n        max = *(a + i);\n    }\n    for (i = 0; i < (n = strlen(a)); i++)\n      if (*(a + i) == max)\n        break;\n    strncat(t, a, i + 1);\n    strcat(t, b);\n    strcat(t, a + i + 1);\n    cout << t << \"\\n\";\n    a = (char *)calloc(1, 12);\n    b = (char *)calloc(1, 5);\n    t = (char *)calloc(1, 20);\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "36390", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x = 0, i;\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n    \n    \n    for (i = 0; i < len1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    strcpy(s3, s1);\n    \n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n    \n    s4[0] = '\\0';\n    for (i = maxi + 1; i <= len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n    \n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n}\n"}
{"label": "20", "index": "36391", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[30], b[10], max;\n  scanf(\"%s%s\", a, b);\n  int la, lb, index, i;\n  do {\n    la = strlen(a);\n    lb = strlen(b);\n    max = a[0];\n    index = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] > max)\n        max = a[i];\n    }\n    for (i = 0; i < la; i++) {\n      if (a[i] == max) {\n        index = i;\n        break;\n      }\n    }\n    for (i = 0; i <= index; i++)\n      printf(\"%c\", a[i]);\n    for (i = index + 1; i <= index + lb; i++)\n      printf(\"%c\", b[i - index - 1]);\n    for (i = index + lb + 1; i < la + lb; i++)\n      printf(\"%c\", a[i - lb]);\n    printf(\"\\n\");\n    cin >> a;\n  } while (scanf(\"%s\", b) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36392", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void insert(char *a, char *b);\n  char str[14], substr[3];\n  while (scanf(\"%s\", str) != -1) {\n    scanf(\"%s\", substr);\n    insert(str, substr);\n  }\n  return 0;\n}\n\nvoid insert(char *a, char *b) {\n  int i, n = 0, m = 1, la, lb;\n  char c[14] = {'\\0'};\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 1; i < la; i++)\n    if (*(a + i) > *(a + m - 1)) {\n      m = i + 1;\n    }\n  for (i = 0; i < la - m; i++) {\n    c[i] = *(a + m + i);\n    *(a + m + i) = '\\0';\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\n"}
{"label": "20", "index": "36393", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20][11], substr[20][4];\n  int i = 0, j, n, l, k, h, x, y;\n  char a = '\\0';\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    scanf(\"\\n\");\n    i++;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++)\n      if (str[i][j] > a)\n        a = str[i][j];\n    k = 0;\n    while (str[i][k] != a)\n      printf(\"%c\", str[i][k++]);\n    y = k;\n    printf(\"%c\", a);\n    for (h = 0; h < 3; h++)\n      printf(\"%c\", substr[i][h]);\n    for (x = y + 1; x < l; x++)\n      cout << str[i][x];\n    printf(\"\\n\");\n    a = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36394", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int position, i, lena, lenb, n = 10;\n  char a[10], b[4], *p = NULL, max;\n  while (n--) {\n    max = 0;\n    memset(a, '\\0', sizeof a);\n    memset(b, '\\0', sizeof b);\n    cin >> a;\n    cin >> b;\n    lena = strlen(a);\n    lenb = strlen(b);\n    p = &a[0];\n    for (i = 0; i < lena; i++) {\n      if (*p > max) {\n        max = *p;\n        position = i;\n      }\n      p += 1;\n    }\n    for (i = 0; i <= position; i++)\n      cout << a[i];\n    cout << b;\n    for (i = position + 1; i < lena; i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36395", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid dd(char a[], char b[]) {\n  int i, j = 0, m, max;\n  m = strlen(a);\n  max = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  for (i = m; i > j; i--) {\n    a[i + 3] = a[i];\n  }\n  a[j + 1] = b[0];\n  a[j + 2] = b[1];\n  a[j + 3] = b[2];\n  for (i = 0; i < m + 3; i++) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n}\nint main() {\n  char a[20], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    dd(a, b);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36396", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], max, s[1000][100];\n  int i = 0, j, k, l, q, w, e;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    max = str[i][0];\n    for (j = 1; j <= 10; j++) {\n      if (max < str[i][j])\n        max = str[i][j];\n    }\n    for (k = 0; k <= 10; k++) {\n      if (str[i][k] == max) {\n        for (l = 0; l <= k; l++) {\n          s[i][l] = str[i][l];\n        }\n        for (q = 0; l <= k + strlen(substr[i]); l++, q++) {\n          s[i][l] = substr[i][q];\n        }\n        for (w = k + 1; l <= strlen(substr[i]) + strlen(str[i]); l++, w++) {\n          s[i][l] = str[i][w];\n        }\n        printf(\"%s\\n\", s[i]);\n        break;\n      }\n    }\n    i++;\n  }\n}\n"}
{"label": "20", "index": "36397", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15] = {0};\n  char substr[3] = {0};\n  char string[500][15] = {0};\n  char max;\n  int i, x, d, j;\n  j = 0;\n\n  while (1) {\n\n    scanf(\"%s \", str);\n\n    d = strlen(str);\n    if (d == 0)\n      break;\n    for (i = 0; i < d; i++)\n      if (str[i] == ' ')\n        break;\n    for (x = i + 1; x <= i + 4; x++)\n      substr[x - i - 1] = str[x];\n    str[i] = '\u0000';\n    d = d - 3;\n    max = str[0];\n    x = 0;\n    for (i = 0; str[i] != '\u0000'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        x = i;\n      }\n    for (i = d - 1; i > x; i--)\n      str[i + 3] = str[i];\n    for (i = x + 1; i < x + 4; i++)\n      str[i] = substr[i - x - 1];\n    strcpy(string[j], str);\n    string[j][d + 3] = '\u0000';\n    j = j + 1;\n    for (i = 0; i < 13; i++) {\n      str[i] = 0;\n      substr[i] = 0;\n    }\n  }\n  d = j;\n  for (i = j; i < 500; i++)\n    string[i][0] = '\u0000';\n  for (i = 0; i < d; i++)\n    cout << string[i] << \" \";\n}\n"}
{"label": "20", "index": "36398", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], c[14];\n  int i = 0, j = 0, a, m, n, p, q;\n  for (;;) {\n    a = scanf(\"%s %s\", str, substr);\n    if (a == EOF) {\n      break;\n    } else {\n      m = strlen(str);\n      n = strlen(substr);\n      p = 0;\n      for (i = 0; i < m; i++) {\n        if (str[i] <= str[p]) {\n          continue;\n        } else {\n          p = i;\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        if (q <= p)\n          c[q] = str[q];\n\n        if (q > p && q < p + n + 1) {\n          c[q] = substr[q - p - 1];\n        }\n        if (q >= p + n + 1) {\n          c[q] = str[q - n];\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        cout << c[q];\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36399", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nchar temp[10];\nvoid strsub(char *a, int start) {\n  int i;\n  int len = strlen(a);\n  for (i = start; i < len; i++) {\n    temp[i - start] = a[i];\n    a[i] = '\\0';\n  }\n  temp[len - start] = '\\0';\n}\n\nint main() {\n  char str1[10], str2[10];\n  char max;\n  int flag, i;\n  int len;\n  while (cin >> str1 >> str2) {\n    len = strlen(str1);\n    max = 0;\n    for (i = 0; i < len; i++)\n      if (max < str1[i]) {\n        max = str1[i];\n        flag = i;\n      }\n    strsub(str1, flag + 1);\n    strcat(str1, str2);\n    strcat(str1, temp);\n    printf(\"%s\\n\", str1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36400", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(char *p, char *q, int m);\n  char s[12], c[10], sub[4];\n  int i, k = 0;\n\n  while (scanf(\"%s %s\", s, sub) != EOF) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] > s[k])\n        k = i;\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", sub);\n    f(s, c, k + 1);\n    puts(c);\n  }\n}\n\nvoid f(char *p, char *q, int m) {\n  int n;\n  n = 0;\n  while (n < m) {\n    n++;\n    p++;\n  }\n  while (*p != '\\0') {\n    *q = *p;\n    p++;\n    q++;\n  }\n  *q = '\\0';\n}\n"}
{"label": "20", "index": "36401", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][15] = {0}, d[100][15] = {0};\n  int i = 0, j, n, k = 0, cutpoint;\n  while (1) {\n    char b[20] = {0}, c[10] = {0}, e[4] = {0}, max;\n\n    cin >> a[k];\n\n    n = strlen(a[k]);\n    for (i = 0; i < 3; i++) {\n      e[i] = a[k][n - 3 + i];\n    }\n\n    if (a[k][0] == 0) {\n      break;\n    }\n    max = a[k][0];\n    for (i = 0; i < n - 4; i++) {\n\n      if (a[k][i] > max) {\n        max = a[k][i];\n        cutpoint = i;\n      }\n    }\n    for (i = 0; i <= cutpoint; i++) {\n      b[i] = a[k][i];\n    }\n    for (i = 0, j = cutpoint + 1; j < n - 4; i++, j++) {\n      c[i] = a[k][j];\n    }\n    strcat(b, e);\n    strcat(b, c);\n    strcpy(d[k], b);\n    k++;\n  }\n\n  for (i = 0; i < k; i++) {\n    puts(d[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36402", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[20], substr[4], temp[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int len = strlen(str);\n    char max = str[0];\n    int a, i;\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        a = i;\n      }\n    }\n\n    int num = 0;\n    for (i = a + 1; i < len; i++) {\n      temp[num] = str[i];\n      num++;\n    }\n    temp[num] = '\\0';\n    str[a + 1] = '\\0';\n\n    strcat(str, substr);\n    strcat(str, temp);\n    cout << str << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36403", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[16];\n  s[15] = 0;\n  int i, len, p = 15;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s) - 5;\n    for (i = len; i >= 0; i--)\n      if (s[i] >= s[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", s[i]);\n    for (i = len + 2; i <= len + 4; i++)\n      printf(\"%c\", s[i]);\n    for (i = p + 1; i <= len; i++)\n      printf(\"%c\", s[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36404", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char max, s1[100], s2[100];\n  int l, i, j;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    max = '\\0';\n    for (i = 0; i <= l - 1; i++) {\n      if (s1[i] > max) {\n        j = i;\n        max = s1[i];\n      }\n    }\n    for (i = 0; i <= j; i++)\n      printf(\"%c\", s1[i]);\n    cout << s2;\n    for (i = j + 1; i <= l - 1; i++)\n      printf(\"%c\", s1[i]);\n    putchar('\\n');\n  }\n}\n"}
{"label": "20", "index": "36405", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char d, a[11], b[4], c[14];\n  int n, i, f;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    n = strlen(a);\n    d = a[0];\n    f = 0;\n    for (i = 0; i < n; i++) {\n      if (a[i] > d) {\n        d = a[i];\n        f = i;\n      }\n    }\n    c[0] = '\u0000';\n    strncat(c, a, f + 1);\n    strcat(c, b);\n    strcat(c, a + f + 1);\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36406", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, p, n;\n  j = 0;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] > a[j]) {\n        j = i;\n      }\n    p = j;\n    for (i = n - 1; i > j; i--)\n      a[i + 3] = a[i];\n    a[p + 3] = b[2];\n    a[p + 2] = b[1];\n    a[p + 1] = b[0];\n    for (i = 0; i < n + 3; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36407", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *str, *substr, *newstr;\n  int i, j, p, q, a, b = 0;\n  str = (char *)malloc(11 * sizeof(char));\n  substr = (char *)malloc(4 * sizeof(char));\n  newstr = (char *)calloc(30, sizeof(char));\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    p = strlen(str);\n    q = strlen(substr);\n    a = *str;\n    for (i = 1; i < p; i++)\n      if (*(str + i) > a) {\n        a = *(str + i);\n        b = i;\n      }\n\n    for (i = 0; i <= b; i++)\n      *(newstr + i) = *(str + i);\n    for (i = b + 1, j = 0; j < q; i++, j++)\n      *(newstr + i) = *(substr + j);\n    for (i = b + q + 1, j = b + 1; j < p; i++, j++)\n      *(newstr + i) = *(str + j);\n\n    for (i = 0; i < p + q; i++)\n      printf(\"%c\", *(newstr + i));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36408", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guocheng(char str[10], char substr[3]) {\n  int i, max = 0, n, j;\n  for (i = 0; i < strlen(str); i++)\n    if (str[i] > max) {\n      max = str[i];\n      n = i;\n    }\n  for (j = 0; j <= n; j++) {\n    printf(\"%c\", str[j]);\n  }\n  printf(\"%s\", substr);\n  for (j = n + 1; j < strlen(str); j++)\n    printf(\"%c\", str[j]);\n  printf(\" \");\n}\nint main() {\n  char a[100][10], b[100][3];\n  int i = 0;\nend:\n  while (scanf(\"%s%s\", a[i], b[i]) != EOF) {\n    guocheng(a[i], b[i]);\n    i++;\n    goto end;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36409", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n\n  char str[11], substr[4], max;\n  int m, n, i, j, z, t, temp = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    m = strlen(str);\n    n = strlen(substr);\n    max = str[0];\n\n    for (i = 0; i < m; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        temp = i + 1;\n      }\n    }\n    for (j = 0; j <= temp; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (z = 0; z < n; z++) {\n      printf(\"%c\", substr[z]);\n    }\n    for (t = temp + 1; t < m; t++) {\n      printf(\"%c\", str[t]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36410", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, t;\n  char str[16], t_max, substr[4];\n  while (scanf(\"%s%s\", &str, &substr) != EOF) {\n    l = strlen(str);\n    t_max = -1;\n    for (i = 0; i < l; i++)\n      if (t_max < str[i]) {\n        t = i;\n        t_max = str[i];\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < l; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36411", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char c[100][100];\n  int i = 0, j, count, max, m, b[100];\n  do {\n\n    cin >> c[i];\n    b[i] = strlen(c[i]);\n    i++;\n  } while (c[i - 1][0] != '\u0000');\n  m = i - 1;\n  for (i = 0; i < m; i++) {\n    max = 0;\n    count = 0;\n    for (j = 0; j < b[i] - 4; j++) {\n      if (c[i][j] > max) {\n        max = c[i][j];\n        count = j;\n      }\n    }\n    for (j = 0; j <= count; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    for (j = b[i] - 3; j <= b[i] - 1; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    for (j = count + 1; j < b[i] - 4; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36412", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, s, p = 0, m = 0;\n  char str[10], substr[3], d;\n  do {\n    if (p)\n      for (k = 1;; k++) {\n        str[k] = getchar();\n        if (str[k] == ' ') {\n          str[k] = '\\0';\n          break;\n        }\n      }\n    else\n      scanf(\"%s\", str);\n    scanf(\"%s\", substr);\n    d = getchar();\n    for (k = 0; k < strlen(str); k++)\n      if ((int)str[k] > m) {\n        s = k;\n        m = (int)str[k];\n      }\n    for (k = 0; k <= s; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", substr);\n    for (k = s + 1; k < strlen(str); k++)\n      printf(\"%c\", str[k]);\n    cout << \"\\n\";\n    m = 0;\n    p += 1;\n  } while ((str[0] = getchar()) != EOF);\n}\n"}
{"label": "20", "index": "36413", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid insert(char s1[], char s2[]) {\n  int i, k = 0, j, l;\n  char s[13];\n  l = strlen(s1);\n  for (i = 1; i < l; i++)\n    if (s1[i] > s1[k])\n      k = i;\n  for (i = 0; i <= k; i++)\n    s[i] = s1[i];\n  for (j = 0; j < 3; j++)\n    s[i + j] = s2[j];\n  for (j = i; j < l; j++)\n    s[j + 3] = s1[j];\n  s[j + 3] = '\\0';\n  printf(\"%s\\n\", s);\n}\nint main() {\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    insert(s1, s2);\n  }\n}\n"}
{"label": "20", "index": "36414", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10] = {0}, substr[13] = {0};\n  int i, k, p, j;\n  for (p = 0; p < 10000; p++) {\n    scanf(\"%s %s\", str, substr);\n    for (i = 0, k = 0; i < 9; i++)\n      if (str[k] < str[i + 1])\n        k = i + 1;\n    for (i = k + 1, j = 3; i < 10; i++, j++) {\n      substr[j] = str[i];\n      str[i] = 0;\n    }\n    cout << strcat(str, substr) << \"\\n\";\n    for (i = 0; i < 13; i++) {\n      str[i] = 0;\n      substr[i] = 0;\n    }\n  }\n}\n"}
{"label": "20", "index": "36415", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[103][12], s2[103][4];\n  int i = 0, j, max = 0, k, u, len;\n  while (scanf(\"%s%s\", s1[i], s2[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    len = strlen(s1[j]);\n    max = 0;\n    u = 0;\n    for (k = 0; k < len; k++) {\n      if (s1[j][k] > max) {\n        max = s1[j][k];\n        u = k;\n      }\n    }\n    for (k = 0; k <= u; k++)\n      printf(\"%c\", s1[j][k]);\n    for (k = 0; k <= 2; k++)\n      printf(\"%c\", s2[j][k]);\n    for (k = u + 1; k < len; k++)\n      printf(\"%c\", s1[j][k]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36416", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char ch1[11], ch2[4];\n  while (scanf(\"%s%s\", ch1, ch2) != EOF) {\n    int k, m = 0;\n    char t = ch1[0];\n    k = strlen(ch1);\n    for (i = 0; i <= k - 1; i++) {\n      if (ch1[i] > t) {\n        t = ch1[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", ch1[i]);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", ch2[i]);\n    if (m != k - 1) {\n      for (i = m + 1; i <= k - 1; i++)\n        printf(\"%c\", ch1[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36417", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint locate(char str[], int len) {\n  int i, a, b;\n  a = str[0];\n  b = 0;\n  for (i = 1; i < len; i++) {\n    if (a < str[i]) {\n      b = i;\n      a = str[i];\n    }\n  }\n  return (b + 1);\n}\nint main() {\n  int i, a, len, lena;\n  char str[11], substr[4], result[14];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(substr);\n    lena = strlen(str);\n    a = locate(str, lena);\n    for (i = 0; i < a; i++)\n      result[i] = str[i];\n    for (i = a; i < len + a; i++)\n      result[i] = substr[i - a];\n    for (i = len + a; i < len + lena; i++)\n      result[i] = str[i - len];\n    result[len + lena] = '\u0000';\n    puts(result);\n  }\n}\n"}
{"label": "20", "index": "36418", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint MaxIndex(char *str) {\n  char maxChar = 0;\n  int i = 0, j = 0;\n  while (*str != 0) {\n    if (maxChar < *str) {\n      maxChar = *str;\n      i = j;\n    }\n    j++;\n    str++;\n  }\n  return i;\n}\nvoid fun(char *str, char *substr) {\n  int max = MaxIndex(str);\n  str += max;\n  char *temp = str;\n  while (*(temp++) != 0)\n    ;\n  *(temp + 3) = 0;\n  while ((--temp) != str) {\n    *(temp + 3) = *temp;\n  }\n  while (*substr != 0) {\n    *(++temp) = *substr++;\n  }\n}\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    fun(str, substr);\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36419", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], max, final[14] = {'\\0'};\n  int i, k, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    max = str[0];\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n\n    strncpy(final, str, k + 1);\n    for (i = 0; i < 3; i++)\n      final[k + 1 + i] = substr[i];\n    for (i = k + 1; i < strlen(str); i++) {\n      final[i + 3] = str[i];\n    }\n    puts(final);\n\n    for (j = 0; j < 11; j++)\n      str[j] = '\\0';\n    for (j = 0; j < 4; j++)\n      substr[j] = '\\0';\n    for (j = 0; j < 14; j++)\n      final[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36420", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = n - 1; i > max; i--)\n      str[i + 3] = str[i];\n    for (i = max + 1, j = 0; i <= max + 3, j < 3; i++, j++)\n      str[i] = substr[j];\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36421", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[13], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    int l, i, j, k;\n    l = strlen(s1);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (s1[i] < s1[j])\n          break;\n      }\n      if (j == l) {\n        for (k = l + 3; k > i + 3; k--)\n          s1[k] = s1[k - 3];\n        s1[l + 3] = '\\0';\n        s1[i + 1] = s2[0];\n        s1[i + 2] = s2[1];\n        s1[i + 3] = s2[2];\n        break;\n      }\n    }\n    printf(\"%s\\n\", s1);\n  }\n}\n"}
{"label": "20", "index": "36422", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], st;\n  while (scanf(\"%s\", &str) != EOF) {\n    scanf(\"%s\", &substr);\n    int i = 0, k, t = 0;\n    k = strlen(str);\n    st = str[0];\n    for (i = 0; i < k; i++)\n      if (str[i] > st) {\n        st = str[i];\n        t = i;\n      }\n    for (i = 0; i < t + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = t + 1; i < k; i++)\n      printf(\"%c\", str[i]);\n\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36423", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], substr[3], s[13];\n  char *p, *m, *n, *q;\n  char max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (m = str, max = *m; *m != '\\0'; m++)\n      if (*m > max)\n        max = *m;\n    for (m = str; *m != '\\0'; m++)\n      if (*m == max) {\n        q = m;\n        break;\n      }\n    for (p = s, m = str; m <= q; p++, m++)\n      *p = *m;\n    for (n = substr; *n != '\\0'; n++, p++)\n      *p = *n;\n    for (m = q + 1; *m != '\\0'; m++, p++)\n      *p = *m;\n    *p = '\\0';\n    p = s;\n    printf(\"%s\\n\", p);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36424", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], substr[1000];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int len1 = strlen(str);\n    int i, j, k, max, temp;\n    max = str[len1 - 1];\n    for (i = len1 - 1; i >= 0; i--) {\n      if (str[i] >= max) {\n        max = str[i];\n        temp = i;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (i == temp) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36425", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nchar str[1000] = {NULL}, substr[1000] = {NULL};\n\nint main() {\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    char rt[1000] = {NULL}, *p1, *p2;\n    int n = 0, i = 0, k = 0;\n\n    for (p1 = str, p2 = str, i = 0; p1 - str < strlen(str); p1++) {\n      if (*p1 > k) {\n        k = *p1;\n        p2 = p1;\n        n = p2 - str;\n      }\n    }\n    strncpy(rt, str, n + 1);\n\n    printf(\"%s\", rt);\n    cout << substr;\n    printf(\"%s \", p2 + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36426", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid charu(char s1[], int h, char s2[], int k, char s3[]);\nint main() {\n  char a[11], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    int l, n;\n    char c[14] = {'\\0'};\n    l = strlen(a);\n    n = strlen(b);\n    charu(a, l, b, n, c);\n    puts(c);\n  }\n  return 0;\n}\nvoid charu(char s1[], int h, char s2[], int k, char s3[]) {\n  int i, max = 0;\n  char temp;\n  for (i = 1; i < h; i++) {\n    if (s1[i] > s1[max])\n      max = i;\n  }\n  for (i = 0; i <= max; i++)\n    s3[i] = s1[i];\n  for (i = max + 1; i <= max + k; i++)\n    s3[i] = s2[i - max - 1];\n  for (i = max + strlen(s2) + 1; i < h + k; i++)\n    s3[i] = s1[i - k];\n}\n"}
{"label": "20", "index": "36427", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[14], substr[4];\n  int l, max, n, i;\n  while (cin >> str >> substr) {\n    l = strlen(str);\n    max = str[0];\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        \n        n = i;\n      }\n    }\n    for (i = l + 3; i >= n + 4; i--) {\n      str[i] = str[i - 3];\n    }\n    str[n + 1] = substr[0];\n    str[n + 2] = substr[1];\n    str[n + 3] = substr[2];\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36428", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[20], sub[10];\n  int i, j, k, ls, lsub;\n  while (scanf(\"%s%s\", s, sub) != EOF) {\n    ls = strlen(s);\n    lsub = strlen(sub);\n    k = 0;\n    for (i = 1; i < ls; i++)\n      if (s[i] > s[k])\n        k = i;\n    for (i = ls; i > k; i--)\n      s[i + lsub] = s[i];\n    for (i = k + 1, j = 0; j < lsub; i++, j++)\n      s[i] = sub[j];\n    cout << s << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36429", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n;\n  char str[11], substr[4], a[14], b;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    b = str[0];\n    k = 0;\n    for (i = 1; i < n; i++) {\n      if (b < str[i]) {\n        b = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      a[i] = str[i];\n    a[k + 1] = substr[0];\n    a[k + 2] = substr[1];\n    a[k + 3] = substr[2];\n    for (i = k + 4; i <= n + 2; i++)\n      a[i] = str[i - 3];\n    for (i = 0; i <= n + 2; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36430", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000][100], substr[1000][300];\n  int i = 0, j, max, m;\n  char a;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF)\n    i++;\n  m = i;\n  for (i = 0; i < m; i++) {\n    a = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > a) {\n        a = str[i][j];\n        max = j;\n      }\n    }\n    for (j = 0; j <= max; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < 3; j++)\n      cout << substr[i][j];\n    for (j = max + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36431", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], c, str[100], substr[100], x;\n  int i, j, k, s, t;\n  while (scanf(\"%s \", a)) {\n    for (i = 0; (c = a[i]) != ' '; i++)\n      str[i] = a[i];\n    s = i + 1;\n    k = 0;\n    for (j = s; (c = a[j]) != '\u0000'; j++) {\n      substr[k] = a[j];\n      k++;\n    }\n    x = str[0];\n    for (i = 0; i < s - 1; i++)\n      if (str[i] > x) {\n        t = i + 1;\n        x = str[i];\n      }\n    for (i = 0; i < t; i++)\n      printf(\"%c\", str[i]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n    for (i = t; i < s - 1; i++)\n      printf(\"%c\", str[i]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36432", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50], t[3], asc = '\\0', c, m[100][14];\n  int i, j, k = 0, count = 0, sn;\n  c = getchar();\n\n  while (c != EOF) {\n    s[0] = c;\n    c = getchar();\n    for (i = 1; c != ' '; i++) {\n      s[i] = c;\n      c = getchar();\n    }\n    sn = i - 1;\n    for (i = 0; i < 3; i++) {\n      c = getchar();\n      t[i] = c;\n    }\n    for (i = 0; i <= sn; i++) {\n      if (s[i] > asc) {\n        asc = s[i];\n        count = i;\n      }\n    }\n    for (j = sn; j > count; j--) {\n      s[j + 3] = s[j];\n    }\n    sn += 3;\n    for (i = 0, j = count; i < 3; i++, j++)\n      s[j + 1] = t[i];\n\n    asc = 0;\n    count = 0;\n    s[sn + 1] = '\\0';\n    strcpy(m[k++], s);\n    c = getchar();\n    c = getchar();\n  }\n  for (i = 0; i < k; i++) {\n    puts(m[i]);\n  }\n}\n"}
{"label": "20", "index": "36433", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[15][10], b[15][3], c[10][13], s;\n  int i, j, t, r, m = 0;\n  while (scanf(\"%s%s\", a[m], b[m]) != EOF)\n    m++;\n  for (j = 0; j < m; j++) {\n    t = strlen(a[j]);\n    for (i = 0, s = a[j][0]; i < t; i++)\n      if (a[j][i] > s)\n        s = a[j][i];\n    for (r = 0; a[j][r] != s;)\n      r++;\n    for (i = 0; i <= r; i++)\n      c[j][i] = a[j][i];\n    for (i = 0; i < 3; i++)\n      c[j][i + r + 1] = b[j][i];\n    for (i = r + 1; i < t + 3; i++)\n      c[j][i + 3] = a[j][i];\n    for (i = 0; i < t + 3; i++)\n      printf(\"%c\", c[j][i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36434", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[103][12], s2[103][4];\n  int i = 0, j, max = 0, k, u, len;\n  while (scanf(\"%s%s\", s1[i], s2[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    len = strlen(s1[j]);\n    max = 0;\n    u = 0;\n    for (k = 0; k < len; k++) {\n      if (s1[j][k] > max) {\n        max = s1[j][k];\n        u = k;\n      }\n    }\n    for (k = 0; k <= u; k++)\n      printf(\"%c\", s1[j][k]);\n    for (k = 0; k <= 2; k++)\n      printf(\"%c\", s2[j][k]);\n    for (k = u + 1; k < len; k++) {\n      printf(\"%c\", s1[j][k]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36435", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], sub[4], *p, *max;\n  while (cin >> str) {\n    max = str;\n    scanf(\"%s \", sub);\n    for (p = str + 1; *p; p++)\n      if (*max < *p)\n        max = p;\n    for (p = str; p <= max; p++)\n      cout << *p;\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36436", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  int max, i, j, e, k;\n  char str[11], substr[4];\n  for (;;) {\n    max = 0;\n    if (scanf(\"%s%s\", str, substr) != EOF) {\n      for (i = 0; str[i]; i++) {\n        if (str[i] > max) {\n          max = str[i];\n          e = i;\n        }\n      }\n      for (j = 0; j < e + 1; j++) {\n        printf(\"%c\", str[j]);\n      }\n      printf(\"%s\", substr);\n      for (k = e + 1; str[k]; k++)\n        printf(\"%c\", str[k]);\n      printf(\"\\n\");\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36437", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint findmax(char[], int);\nint main() {\n  int i, len, k;\n  int j;\n  char str[15] = {'\\0'}, substr[4] = {'\\0'};\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    len = strlen(str);\n    i = findmax(str, len);\n    for (j = len - 1; j > i; j--)\n      str[j + 3] = str[j];\n    for (j = i + 1, k = 0; j < i + 4; j++, k++)\n      str[j] = substr[k];\n    printf(\"%s\\n\", str);\n    for (i = 0; i < 15; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n  }\n  return 0;\n}\nint findmax(char str[], int len) {\n  int i;\n  char t;\n  t = str[0];\n  for (i = 0; i < len - 1; i++)\n    if (t < str[i + 1])\n      t = str[i + 1];\n  for (i = 0; i < len; i++)\n    if (str[i] == t)\n      return i;\n}\n"}
{"label": "20", "index": "36438", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k, s, p = 0, m = 0;\n  char str[10], substr[3], d;\n  do {\n    if (p)\n      for (k = 1;; k++) {\n        str[k] = getchar();\n        if (str[k] == ' ') {\n          str[k] = '\\0';\n          break;\n        }\n      }\n    else\n      cin >> str;\n    scanf(\"%s\", substr);\n    d = getchar();\n    for (k = 0; k < strlen(str); k++)\n      if ((int)str[k] > m) {\n        s = k;\n        m = (int)str[k];\n      }\n    for (k = 0; k <= s; k++)\n      printf(\"%c\", str[k]);\n    printf(\"%s\", substr);\n    for (k = s + 1; k < strlen(str); k++)\n      printf(\"%c\", str[k]);\n    printf(\"\\n\");\n    m = 0;\n    p += 1;\n  } while ((str[0] = getchar()) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36439", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11] = {'\u0000'}, sub[4];\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    char fi[15] = {'\u0000'}, a[10] = {'\u0000'};\n    int i, j, k, n = strlen(str);\n    char c = str[0];\n    for (i = 1; i < n; i++)\n      if (str[i] > c)\n        c = str[i];\n    for (j = 0;; j++) {\n      fi[j] = str[j];\n      if (str[j] == c)\n        break;\n    }\n    for (k = j + 1; k < n; k++)\n      a[k - j - 1] = str[k];\n    strcat(fi, sub);\n    strcat(fi, a);\n    cout << fi << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36440", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[16];\n  int i, n, max, maxi;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = 0;\n    max = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      n++;\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i <= maxi; i++)\n      c[i] = a[i];\n    for (i = maxi + 1; i <= maxi + 3; i++)\n      c[i] = b[i - maxi - 1];\n    for (i = maxi + 4; i <= n + 2; i++)\n      c[i] = a[i - 3];\n    c[n + 3] = '\\0';\n    printf(\"%s\\n\", c);\n  }\n}\n"}
{"label": "20", "index": "36441", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l;\n  char str[20], sub[20], *max, *p, temp;\n  while (cin >> str) {\n    l = strlen(str);\n    cin >> sub;\n    max = str;\n    for (p = str; p <= str + l; p++) \n    {\n      if (*max < *p) {\n        max = p; \n      }\n    }\n    temp = *max;\n    *max = 0;\n    cout << str << temp << sub << max + 1 << endl; \n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36442", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][10] = {\"\\0\"}, substr[100][3] = {\"\\0\"}, a[100][13] = {\"\\0\"};\n  int i = 0, j = 0, k = 0, m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s %s\", str[i], substr[i]);\n    if (str[i][0] == '\\0') {\n      break;\n    }\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j + 1] > str[i][k])\n        k = j + 1;\n    }\n    for (j = 0; j <= k; j++)\n      a[i][j] = str[i][j];\n    a[i][k + 1] = substr[i][0];\n    a[i][k + 2] = substr[i][1];\n    a[i][k + 3] = substr[i][2];\n    m = strlen(str[i]);\n    for (j = k + 1; j < m; j++)\n      a[i][j + 3] = str[i][j];\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%s\\n\", a[k]);\n  }\n}\n"}
{"label": "20", "index": "36443", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n;\n  char str[11], substr[4], a[14], b;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    b = str[0];\n    k = 0;\n    for (i = 1; i < n; i++) {\n      if (b < str[i]) {\n        b = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      a[i] = str[i];\n    a[k + 1] = substr[0];\n    a[k + 2] = substr[1];\n    a[k + 3] = substr[2];\n    for (i = k + 4; i <= n + 2; i++)\n      a[i] = str[i - 3];\n    for (i = 0; i <= n + 2; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36444", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, k, f;\n  for (i = 0;; i++) {\n    char str[14] = {0}, sub[4] = {0}, str1[14] = {0}, c;\n    a = 0;\n    j = 0;\n    b = 0;\n    f = 0;\n    k = 0;\n    n = 0;\n\n    cin >> str;\n    if (str[0] == 0)\n      break;\n    k = strlen(str);\n    while (str[j] != ' ') {\n      str1[j] = str[j];\n      j++;\n    }\n    n = strlen(str1);\n    b = j + 1;\n    while (b < k && f < 3) {\n      sub[f] = str[b];\n      b++;\n      f++;\n    }\n    c = str1[0];\n    for (j = 1; j < n; j++) {\n      if (c < str1[j]) {\n        c = str1[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (str1[j] == c) {\n        a = j + 1;\n        break;\n      }\n    }\n    for (j = 0; j < a; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\"%s\", sub);\n    for (j = a; j < n; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36445", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100][4], c[100][100], e;\n  int i, j, max, k, l;\n  for (i = 0; i < 10; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    l = sizeof(a[i]);\n    max = a[i][0];\n    for (j = 1; j < 10; j++) {\n      if (a[i][j] > max)\n        max = a[i][j];\n    }\n    for (j = 0; j < 10; j++) {\n\n      c[i][j] = a[i][j];\n      if (a[i][j] == max)\n        break;\n    }\n    j++;\n    for (k = j; k < j + 3; k++) {\n      c[i][k] = b[i][k - j];\n    }\n    for (k = j + 3; k < 3 + l; k++) {\n      c[i][k] = a[i][k - 3];\n    }\n    printf(\"%s\\n\", c[i]);\n    if ((e = getchar()) == EOF)\n      break;\n  }\n}\n"}
{"label": "20", "index": "36446", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid str(char a[10], char b[3]) {\n  int i, l, c = a[0], k;\n  l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (c < a[i]) {\n      c = a[i];\n      k = i;\n    }\n  for (i = 0; i < k + 1; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    cout << b[i];\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", a[i]);\n  cout << \"\\n\";\n}\nint main() {\n  char a[10], b[3];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    str(a, b);\n  return 0;\n}\n"}
{"label": "20", "index": "36447", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, k;\n  char str[11], strsub[4];\n  for (j = 0;; j++) {\n    k = 0;\n    if (scanf(\"%s%s\", str, strsub) == EOF)\n      break;\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if ((str[k] - str[i]) < 0) {\n        k = i;\n      }\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", strsub);\n    for (i = k + 1; i < m; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36448", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[4], *p, max, *q;\n  int i, num = 0, n;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    n = strlen(str);\n    p = str;\n    q = substr;\n    max = *p;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        num = i;\n      }\n    }\n    for (i = 0; i < num + 1; i++)\n      printf(\"%c\", *(p + i));\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", *(q + i));\n    for (i = num + 1; i < n; i++)\n      printf(\"%c\", *(p + i));\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36449", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *m;\n  int n, i;\n  char s[1000];\n  while (scanf(\"%s \", s)) {\n    n = strlen(s);\n    m = &s[0];\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (*p1 > *m)\n        m = p1;\n    }\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (p1 < m)\n        printf(\"%c\", *p1);\n      if (p1 == m)\n        printf(\"%c%c%c%c\", *p1, s[n - 3], s[n - 2], s[n - 1]);\n      if (p1 > m)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36450", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *index, *i;\n  int max;\n  char str1[100], str2[5];\n  while (scanf(\"%s%s\", &str1, &str2) != EOF) {\n    max = 0;\n    for (i = str1; *i != '\\0'; i++)\n      if (*i > max)\n        max = *i, index = i;\n    for (i = str1; i <= index; i++)\n      printf(\"%c\", *i);\n    printf(\"%s\", str2);\n    for (i = index + 1; *i != '\\0'; i++)\n      printf(\"%c\", *i);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36451", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[15], p = '\u0000';\n  int i, len, max;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s) - 4;\n    for (i = 0; i < len; i++)\n      if (*(s + i) > p) {\n        p = *(s + i);\n        max = i;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", *(s + i));\n    for (i = len + 1; i <= len + 3; i++)\n      cout << *(s + i);\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", *(s + i));\n    p = '\u0000';\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36452", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[14], substr[4];\n  int l, max, n, i;\n  while (scanf(\"%s %s \", str, substr)) {\n    l = strlen(str);\n    max = str[0];\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n\n        n = i;\n      }\n    }\n    for (i = l + 3; i >= n + 4; i--) {\n      str[i] = str[i - 3];\n    }\n    str[n + 1] = substr[0];\n    str[n + 2] = substr[1];\n    str[n + 3] = substr[2];\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36453", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char a[]) {\n  int i, m = 0;\n  for (i = 1; a[i] != 0; i++) {\n    if (a[m] < a[i])\n      m = i;\n    else\n      continue;\n  }\n  return m;\n}\nvoid cao(char a[], char b[]) {\n  int i, m = 0;\n  char c[10] = {0};\n  for (i = max(a) + 1; a[i] != 0; i++) {\n    c[m] = a[i];\n    m++;\n    a[i] = 0;\n  }\n  strcat(a, b);\n  strcat(a, c);\n}\nint main() {\n  char a[12] = {0}, b[4] = {0};\n  int i;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    cao(a, b);\n    puts(a);\n    for (i = 0; i < 12; i++)\n      a[i] = 0;\n    for (i = 0; i < 4; i++)\n      b[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36454", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar zuida(char a[]) {\n  char max;\n  int i, p = 0;\n  max = a[0];\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n\n  return (p);\n}\n\nint main() {\n  char a[50], b[20];\n  int i, t1, t2, m;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    t1 = strlen(a);\n    t2 = strlen(b);\n\n    m = zuida(a);\n\n    for (i = 0; i < m + 1; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < t2; i++)\n      printf(\"%c\", b[i]);\n    for (i = m + 1; i < t1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36455", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, s, k;\n  char a[15], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    s = 0;\n    k = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > k) {\n        k = a[i];\n        s = i;\n      }\n    }\n\n    for (i = 0; i <= s; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", b);\n    for (i = s + 1; i < n; i++)\n      printf(\"%c\", a[i]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36456", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[101];\n  char str[15], substr[4], x[20];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[c] < str[i])\n        c = i;\n\n    for (j = 0; j <= c; j++)\n      x[j] = str[j];\n    for (j = c + 1; j <= c + 3; j++)\n      x[j] = substr[j - c - 1];\n    if (c < n - 1)\n      for (j = c + 4; j < n + 3; j++)\n        x[j] = str[j - 3];\n    for (i = 0; i < n + 3; i++)\n      putchar(x[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36457", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid start() {\n  int i, lenstr, lensub;\n  char str[11], substr[4], max, t;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    lenstr = strlen(str);\n    lensub = strlen(substr);\n    max = str[0];\n    for (i = 1; i < lenstr; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        t = i;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < lensub; i++)\n      printf(\"%c\", substr[i]);\n    for (i = t + 1; i < lenstr; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    start();\n  }\n}\nint main() { start(); }\n"}
{"label": "20", "index": "36458", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char str[], char substr[]);\nint main() {\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    f(str, substr);\n  }\n}\nvoid f(char str[], char substr[]) {\n  int i, j, k, l;\n  char a;\n  l = strlen(str);\n  a = str[0];\n  for (i = 1; i < l; i++)\n    if (str[i] > a)\n      a = str[i];\n  for (i = 0; i < l; i++)\n    if (str[i] == a)\n      break;\n  for (j = l + 3; j > i + 3; j--)\n    str[j] = str[j - 3];\n  for (j = i + 1, k = 0; k < 3; j++, k++)\n    str[j] = substr[k];\n  printf(\"%s\\n\", str);\n}\n"}
{"label": "20", "index": "36459", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c, d[100];\n  int i, j = 0, k;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = strlen(a);\n    j = 0;\n    for (i = 1, c = a[0]; i < k; i++)\n      if (c < a[i]) {\n        c = a[i];\n        j = i;\n      }\n    for (i = 0; i <= j; i++)\n      d[i] = a[i];\n    for (i = j + 1; i < k; i++)\n      d[i + 3] = a[i];\n    for (i = 0; i < 3; i++, j++)\n      d[j + 1] = b[i];\n    d[k + 3] = 0;\n    printf(\"%s\\n\", d);\n  }\n}\n"}
{"label": "20", "index": "36460", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[30], substr[4], max;\n  int i, len, num;\n  cin >> str >> substr;\n  while (str[0] != '0') {\n    len = strlen(str);\n    for (i = 0, max = str[0]; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < len; i++)\n      if (str[i] == max) {\n        num = i;\n        break;\n      }\n    for (i = 0; i < num + 1; i++)\n      cout << str[i];\n    cout << substr;\n    for (i = num + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      str[i] = '0';\n    for (i = 0; i < 3; i++)\n      substr[i] = '0';\n    scanf(\"%s%s\", str, substr);\n  }\n}\n"}
{"label": "20", "index": "36461", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], temp = 0;\n  int t = 0, i, n;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > temp)\n        temp = a[i], t = i;\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    for (i = t + 1; i < n; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n    t = 0;\n    temp = 0;\n  }\n}\n"}
{"label": "20", "index": "36462", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[30][10];\n  char substr[30][3];\n  char ans[30][13];\n  char max;\n  char *a, *b, *c, *d;\n  int i, j, k, l, m, n;\n  for (i = 0; i < 30; i++) {\n    if (scanf(\"%s%s\", str[i], substr[i]) == EOF)\n      break;\n    l = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < l; j++)\n      if (max < str[i][j]) {\n        max = str[i][j];\n      }\n    for (j = 0; j < l; j++)\n      if (max == str[i][j])\n        break;\n    a = &str[i][0];\n    b = &substr[i][0];\n    c = &str[i][j + 1];\n    for (k = 0; k < j + 1; k++)\n      ans[i][k] = *(a + k);\n    for (m = 0; m < 3; k++, m++)\n      ans[i][k] = *(m + b);\n    for (n = 0; j + 1 + n < l; n++, k++)\n      ans[i][k] = *(c + n);\n    ans[i][k] = '\\0';\n  }\n  for (j = 0; j < i; j++) {\n    l = strlen(ans[j]);\n    for (k = 0; k < l - 1; k++) {\n      d = ans[j];\n      printf(\"%c\", *(d + k));\n    }\n    printf(\"%c\\n\", *(d + k));\n  }\n}\n"}
{"label": "20", "index": "36463", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char x[]) {\n  int m, i, n = 0;\n  char a = x[0];\n  m = strlen(x);\n  for (i = 1; i <= m - 1; i++) {\n    if (x[i] > a) {\n      a = x[i];\n      n = i;\n    }\n  }\n  return n;\n}\nint main() {\n  int n, l, j;\n  char sa[14];\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    n = max(str);\n    for (j = 0; j <= n; j++)\n      sa[j] = str[j];\n    for (j = n + 1; j <= n + 3; j++) {\n      sa[j] = substr[j - n - 1];\n    }\n    for (j = n + 4; j <= l + 2; j++)\n      sa[j] = str[j - 3];\n    sa[l + 3] = '\\0';\n    printf(\"%s\\n\", sa);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36464", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, max, m, i;\n  char str1[11], str2[4], c, s[] = \"\";\n  scanf(\"%s\", str1);\n  cin >> str2;\n  c = getchar();\n  n = strlen(str1);\n  while (c != '\u0000' && n != 0) {\n    max = 0;\n    m = 0;\n    for (i = 0; i < n; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"%s\", str2);\n    for (i = m + 1; i < n; i++)\n      printf(\"%c\", str1[i]);\n    printf(\" \");\n    strcpy(str1, s);\n    cin >> str1;\n    scanf(\"%s\", str2);\n    c = getchar();\n    n = strlen(str1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36465", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000] = {'\\0'}, substr[3], str2[1000] = {'\\0'};\n  int i, l = 0, max = 0;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > str[max]) {\n        max = i;\n      }\n    }\n\n    for (i = max + 1; i < l; i++) {\n      str2[i - 1 - max] = str[i];\n    }\n    str[max + 1] = substr[0];\n    str[max + 2] = substr[1];\n    str[max + 3] = substr[2];\n    str[max + 4] = '\\0';\n    strcat(str, str2);\n    cout << str << \"\\n\";\n    i = 0;\n    while (str2[i] != '\\0') {\n      str2[i] = '\\0';\n      i++;\n    }\n  }\n}\n"}
{"label": "20", "index": "36466", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nvoid body() {\n  char str[11];\n  char substr[4];\n  char c;\n  int i = 0, k, s = 0;\n  char *p;\n  cin >> str >> substr;\n  c = *(str + strlen(str) - 1);\n  k = strlen(str);\n  for (i = strlen(str) - 1; i > -1; i--) {\n    if (str[i] >= c) {\n      k = i + 1;\n      c = *(str + i);\n    }\n  }\n  p = str;\n  if (strlen(str) >= 11 || strlen(substr) >= 4)\n    return;\n  for (i = 0; i < k; i++) {\n    printf(\"%c\", *(p + i));\n  }\n  printf(\"%s\", substr);\n  printf(\"%s\\n\", p + i);\n  body();\n}\n\nint main() { body(); }\n"}
{"label": "20", "index": "36467", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15], sub[4], m;\n  int t, i, len;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    t = 0;\n    m = str[0];\n    len = 0;\n\n    len = strlen(str);\n\n    for (i = 1; i < len; i++)\n      if (str[i] > m) {\n        t = i;\n        m = str[i];\n      }\n    for (i = len - 1; i > t; i--)\n      str[i + 3] = str[i];\n    str[t + 1] = sub[0];\n    str[t + 2] = sub[1];\n    str[t + 3] = sub[2];\n    str[len + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36468", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar zuida(char a[]) {\n  char max;\n  int i, p = 0;\n  max = a[0];\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n\n  return (p);\n}\n\nint main() {\n  char a[50], b[20];\n  int i, t1, t2, m;\n\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    t1 = strlen(a);\n    t2 = strlen(b);\n\n    m = zuida(a);\n\n    for (i = 0; i < m + 1; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < t2; i++)\n      printf(\"%c\", b[i]);\n    for (i = m + 1; i < t1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36469", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5];     \n  while (cin >> str >> substr) \n  {\n    int j = 0;\n    int A = strlen(str); \n    int B = strlen(substr);\n    int k = 0;\n    char temp = str[0]; \n    for (int i = 0; i < A; i++)\n      if (str[i] > temp)\n        temp = str[i];\n    for (j = 0; j < A; j++)\n      if (str[j] == temp)\n        break;\n    j++;\n    for (k = A; k >= j; k--)\n      str[k + B] = str[k];\n\n    for (int l = j; l <= j + B - 1; l++)\n      str[l] = substr[l - j];\n    cout << str << endl; \n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36470", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    char a[11];\n    int l = strlen(str), m = 0;\n    for (i = 1; i < l; i++) {\n      if (str[m] < str[i])\n        m = i;\n    }\n    for (i = m + 1; i < l; i++) {\n      a[i - m - 1] = str[i];\n    }\n    a[l - m - 1] = '\\0';\n    str[m + 1] = '\\0';\n    strcat(str, substr);\n    strcat(str, a);\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36471", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, max = 0;\n  char str1[11], substr[4], str2[14], str3[11];\n  while (scanf(\"%s %s\", str1, substr) != EOF) {\n    for (i = 0; i < 14; i++) {\n      str2[i] = '\\0';\n      str3[i] = '\\0';\n    }\n    max = 0;\n    for (i = 0; str1[i] != '\\0'; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        k = i;\n      }\n    strncpy(str2, str1, k + 1);\n    strcat(str2, substr);\n    for (i = k + 1, j = 0; str1[i] != '\\0'; i++, j++)\n      str3[j] = str1[i];\n    strcat(str2, str3);\n    printf(\"%s\\n\", str2);\n  }\n}\n"}
{"label": "20", "index": "36472", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[10];\n  char substr[4];\n  char str1[10];\n  char t;\n  int len, i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    strcpy(str1, str);\n    max = 0;\n    for (i = 1; i < len; i++)\n      if (str[i] > str[0]) {\n        max = i;\n        t = str[i];\n        str[i] = str[0];\n        str[0] = t;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str1[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36473", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p, maxchar;\n  while (scanf(\"%s \", str)) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p)\n        max = p;\n    maxchar = *max;\n    *max = 0;\n    printf(\"%s%c%s%s\\n\", str, maxchar, sub, max + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36474", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11] = {'\u0000'}, sub[4];\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    char fi[15] = {'\u0000'}, a[10] = {'\u0000'};\n    int i, j, k, n = strlen(str);\n    char c = str[0];\n    for (i = 1; i < n; i++)\n      if (str[i] > c)\n        c = str[i];\n    for (j = 0;; j++) {\n      fi[j] = str[j];\n      if (str[j] == c) {\n        break;\n      }\n    }\n    for (k = j + 1; k < n; k++)\n      a[k - j - 1] = str[k];\n    strcat(fi, sub);\n    strcat(fi, a);\n    printf(\"%s \", fi);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36475", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], sub[4], m;\n  int t, i, len;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    t = 0;\n    m = str[0];\n    len = 0;\n\n    len = strlen(str);\n\n    for (i = 1; i < len; i++)\n      if (str[i] > m) {\n        t = i;\n        m = str[i];\n      }\n    for (i = len - 1; i > t; i--)\n      str[i + 3] = str[i];\n    str[t + 1] = sub[0];\n    str[t + 2] = sub[1];\n    str[t + 3] = sub[2];\n    str[len + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36476", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint find(char str[]);\nvoid link(char str[], char substr[], int x);\nint main() {\n  char str[20], substr[4];\n  int i;\n  while (scanf(\"%s%s\", &str, &substr) != EOF) {\n    i = find(str);\n    link(str, substr, i);\n  }\n}\nint find(char str[]) {\n  int max, j, k;\n  max = str[0];\n  k = 0;\n  for (j = 0; str[j] != '\\0'; j++) {\n    if (str[j] > max) {\n      max = str[j];\n      k = j;\n    }\n  }\n  return k;\n}\nvoid link(char str[], char substr[], int i) {\n  int j;\n  int len;\n  len = strlen(str);\n  for (j = len; j > i; j--) {\n    str[j + 3] = str[j];\n  }\n  str[i + 1] = substr[0];\n  str[i + 2] = substr[1];\n  str[i + 3] = substr[2];\n  cout << str << \"\\n\";\n}\n"}
{"label": "20", "index": "36477", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char str[11];\n  char substr[4];\n  char t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    t = str[0];\n    k = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if ((str[i] - t) > 0) {\n        t = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++) {\n      cout << str[i];\n    }\n    for (i = 0; substr[i] != '\\0'; i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = k + 1; str[i] != '\\0'; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36478", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, l;\n  char g;\n  char str[15], substr[4] = {'1', '1', '1', '\\0'}, te[15];\n  scanf(\"%s\", str);\n  do {\n    strcpy(te, str);\n    g = getchar();\n    for (i = 0; i < 3; i++)\n      scanf(\"%c\", &substr[i]);\n    l = strlen(str);\n    for (i = 1, k = 0; i < l; i++) {\n      if (str[k] < str[i])\n        k = i;\n    }\n    for (i = k + 1; i < l; i++)\n      str[i + 3] = te[i];\n    str[l + 3] = '\\0';\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  } while (scanf(\"%s\", str) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36479", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], c[14];\n  int i = 0, j = 0, a, m, n, p, q;\n  for (;;) {\n    a = scanf(\"%s %s\", str, substr);\n    if (a == EOF) {\n      break;\n    } else {\n      m = strlen(str);\n      n = strlen(substr);\n      p = 0;\n      for (i = 0; i < m; i++) {\n        if (str[i] <= str[p]) {\n          continue;\n        } else {\n          p = i;\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        if (q <= p)\n          c[q] = str[q];\n\n        if (q > p && q < p + n + 1) {\n          c[q] = substr[q - p - 1];\n        }\n        if (q >= p + n + 1) {\n          c[q] = str[q - n];\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        cout << c[q];\n      }\n      cout << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36480", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(char st[]);\nvoid conv1(char st[], int n);\nvoid conv2(char st[], int n);\nvoid result(char st1[], char st2[], char st3[]);\nint main() {\n  char str[20], substr[4], str1[20], str3[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int n;\n    n = num(str);\n    strcpy(str3, str);\n    conv1(str, n);\n    conv2(str3, n);\n    result(str, substr, str3);\n  }\n}\nvoid conv1(char st[], int n) { st[n] = '\\0'; }\nvoid conv2(char st[], int n) {\n  int l, i;\n  l = strlen(st);\n  for (i = 0; i < l - n; i++)\n    st[i] = st[i + n];\n\n  st[l - n] = '\\0';\n}\nint num(char st[]) {\n  int i, l;\n  char t;\n  t = st[0];\n  l = strlen(st);\n  for (i = 1; i < l; i++) {\n    if (st[i] > t)\n      t = st[i];\n  }\n  for (i = 0; i < l; i++) {\n    if (st[i] == t) {\n      return (i + 1);\n      break;\n    }\n  }\n}\nvoid result(char st1[], char st2[], char st3[]) {\n  strcat(st1, st2);\n  strcat(st1, st3);\n  puts(st1);\n}\n"}
{"label": "20", "index": "36481", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    p = 0;\n    str[s] = 97;\n    substr[3] = 97;\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++) {\n      str[i] = substr[j];\n    }\n    str[s + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36482", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int max, maxindex, i, j, k, m, n, l;\n  char str1[20], str2[10];\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; str1[i]; i++) {\n      if (str1[i] > max) {\n        max = str1[i];\n        maxindex = i;\n      }\n    }\n    m = strlen(str1);\n    n = strlen(str2);\n    for (j = 0; j <= maxindex; j++)\n      printf(\"%c\", str1[j]);\n    for (k = 0; k < n; k++)\n      printf(\"%c\", str2[k]);\n    for (l = maxindex + 1; l < m; l++)\n      printf(\"%c\", str1[l]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36483", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint seekmax(char a[]) {\n  int k = 0, i = 1;\n  while (a[i] != '\\0') {\n    if (a[i] > a[k])\n      k = i;\n    i++;\n  }\n  return k;\n}\nvoid insert(char a[], char b[], int k) {\n  int n, i;\n  n = strlen(a);\n  for (i = n; i > k; i--)\n    a[i + 3] = a[i];\n  for (i = 1; i <= 3; i++)\n    a[k + i] = b[i - 1];\n  printf(\"%s\\n\", a);\n}\nint main() {\n  int i = 0, j = 0;\n  char a[15], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    insert(a, b, seekmax(a));\n}\n"}
{"label": "20", "index": "36484", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], s[15];\n  int i, j, max, l, num;\n  while (scanf(\"%s%s\", str, substr) + 1) {\n    max = 0;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++)\n      s[j] = str[j];\n\n    s[num + 1] = substr[0];\n    s[num + 2] = substr[1];\n    s[num + 3] = substr[2];\n    int n = num;\n    for (j = num + 4; j <= l + 3; j++) {\n      n++;\n      s[j] = str[n];\n    }\n    for (j = 0; j < l + 3; j++) {\n      printf(\"%c\", s[j]);\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36485", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, num, i, j, l;\n  char str[11], substr[4], str1[15], c;\n  for (;;) {\n\n    for (i = 0; i < 11; i++) {\n      str[i] = '\u0000';\n    }\n    for (i = 0; i < 4; i++) {\n      substr[i] = '\u0000';\n    }\n    for (i = 0; i < 15; i++) {\n      str1[i] = '\u0000';\n    }\n    for (i = 0; i < 10; i++) {\n      if ((c = getchar()) == ' ')\n        break;\n      else\n        str[i] = c;\n    }\n    if (feof(stdin))\n      break;\n\n    cin >> substr;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      b = 0;\n      for (j = i; j < l; j++) {\n        if (str[i] < str[j]) {\n          b = 1;\n          break;\n        }\n      }\n      if (b == 0) {\n        num = i;\n        break;\n      }\n    }\n    for (i = 0; i <= num; i++) {\n      str1[i] = str[i];\n    }\n    for (i = num + 1; i <= num + 3; i++) {\n      str1[i] = substr[i - 1 - num];\n    }\n    for (i = num + 4; i < l + 3; i++) {\n      str1[i] = str[i - 3];\n    }\n    puts(str1);\n  }\n}\n"}
{"label": "20", "index": "36486", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, w;\n  char a[10][15], b[10][15], d[10][15];\n  for (i = 0; i < 10; i++)\n    for (j = 0; j < 15; j++) {\n      a[i][j] = '\\0';\n      b[i][j] = '\\0';\n      d[i][j] = '\\0';\n    }\n  for (i = 0; scanf(\"%s %s\", a[i], b[i]) != EOF; i++) {\n    n = strlen(a[i]);\n    for (k = 0, m = 0; k < n - 1; k++) {\n      if (a[i][m] < a[i][k + 1])\n        m = k + 1;\n    }\n    for (k = n - 1; k > m; k--)\n      a[i][k + 3] = a[i][k];\n    for (k = m + 1, w = 0; k != m + 4; k++, w++)\n      a[i][k] = b[i][w];\n    puts(a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36487", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11] = {'\\0'}, b[4] = {'\\0'};\n  char c;\n  int i, k, m;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    m = strlen(a);\n    c = a[0];\n    for (i = 1; i < m; i++)\n      if (a[i] > c) {\n        c = a[i];\n        k = i;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    cout << b;\n    for (i = k + 1; i < m; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36488", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], t;\n  int n, m, i, j, k;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    n = strlen(s2);\n    j = 0;\n    t = s1[0];\n    for (i = 1; i < m; i++) {\n      if (s1[i] > t) {\n        j = i;\n        t = s1[i];\n      }\n    }\n    for (i = 0; i <= m - j - 1; i++)\n      s1[n + m - i] = s1[m - i];\n    for (i = 0; i < n; i++)\n      s1[j + 1 + i] = s2[i];\n    for (i = 0; i < m + n; i++)\n      cout << s1[i];\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36489", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    p = 0;\n    str[s] = 97;\n    substr[3] = 97;\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    str[s + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36490", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, max = 0;\n  char str[11], substr[4], maxchar;\n  while (scanf(\"%s\", str) != EOF) {\n    maxchar = '\\0';\n    scanf(\"%s\", substr);\n    for (i = 0; str[i]; i++)\n      if (str[i] > maxchar) {\n        max = i;\n        maxchar = str[i];\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = max + 1; str[i]; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36491", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *a, *b, c;\n  int i, j, k, n;\n  do {\n    p1 = (char *)malloc(100 * sizeof(char));\n    p2 = (char *)malloc(100 * sizeof(char));\n    a = (char *)malloc(200 * sizeof(char));\n    b = (char *)malloc(200 * sizeof(char));\n\n    strcpy(a, \" \");\n    strcpy(b, \" \");\n    for (i = 0, c = *(p1), k = 0; *(p1 + i) != '\\0'; i++) {\n      if (*(p1 + i) > c) {\n        c = *(p1 + i);\n        k = i;\n      }\n    }\n    strncpy(a, p1, k + 1);\n    *(a + k + 1) = '\\0';\n    strcat(a, p2);\n    for (i = k + 1, j = 0; *(p1 + i) != '\\0'; i++, j++) {\n      *(b + j) = *(p1 + i);\n    }\n\n    *(b + j) = '\\0';\n    strcat(a, b);\n    puts(a);\n    free(a);\n    free(b);\n    free(p1);\n    free(p2);\n  } while (scanf(\"%s%s\", p1, p2) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36492", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j, k, c[10] = {0};\n  char a[10][100] = {'\\0'}, b[10][3] = {'\\0'}, m;\n  for (i = 0;; i++)\n\n    if (EOF == scanf(\"%s %s\", a[i], b[i]))\n      break;\n  for (j = 0; j < i; j++) {\n    for (k = 0, m = a[j][0]; k < strlen(a[j]) - 1; k++) {\n      if (m < a[j][k + 1]) {\n        c[j] = k + 1;\n        m = a[j][k + 1];\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    for (k = strlen(a[j]) - 1; k > c[j]; k--)\n      a[j][k + 3] = a[j][k];\n    a[j][c[j] + 1] = b[j][0];\n    a[j][c[j] + 2] = b[j][1];\n    a[j][c[j] + 3] = b[j][2];\n  }\n  for (j = 0; j < i; j++)\n    cout << a[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "20", "index": "36493", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[4] = {'\\0'}, *q = NULL, *p = NULL;\n  int temp = 0;\n  while (cin >> a) {\n    cin >> b;\n    temp = 0;\n    for (p = a; p < a + strlen(a); p++) {\n      if (*p > temp)\n        temp = *p;\n    }\n    for (p = a; p < a + strlen(a); p++) {\n      if (*p == temp)\n        break;\n    }\n    for (q = a; q <= p; q++)\n      printf(\"%c\", *q);\n    cout << b;\n    for (q = p + 1; q < a + strlen(a); q++)\n      cout << *q;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36494", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *p1, *m;\n  int n, i;\n  char s[1000];\n  while (cin >> s) {\n    n = strlen(s);\n    m = &s[0];\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (*p1 > *m)\n        m = p1;\n    }\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (p1 < m)\n        printf(\"%c\", *p1);\n      if (p1 == m)\n        cout << *p1 << s[n - 3] << s[n - 2] << s[n - 1];\n      if (p1 > m)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36495", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][11] = {{0}}, substr[1000][4] = {{0}}, a[11] = {0}, b[4] = {0};\n  int i = 0, j, k, maxpos;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    for (j = 0; j <= strlen(a); j++) {\n      str[i][j] = a[j];\n    }\n    for (j = 0; j <= strlen(b); j++)\n      substr[i][j] = b[j];\n\n    i++;\n  }\n  for (j = 0; j <= i - 1; j++) {\n    maxpos = strlen(str[j]) - 1;\n    for (k = strlen(str[j]) - 1; k >= 0; k--) {\n      if (str[j][k] >= str[j][maxpos])\n        maxpos = k;\n    }\n    for (k = 0; k <= maxpos; k++) {\n      putchar(str[j][k]);\n    }\n    for (k = 0; k <= 2; k++) {\n      putchar(substr[j][k]);\n    }\n    for (k = maxpos + 1; k <= strlen(str[j]) - 1; k++) {\n      putchar(str[j][k]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36496", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], s[10], p;\n  int i, t;\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", s);\n    p = str[0];\n    t = 0;\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] > p) {\n        p = str[i];\n        t = i;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      cout << str[i];\n    printf(\"%s\", s);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36497", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, a, b, max;\n  char str[11], substr[4], mix[14];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    a = strlen(str);\n    b = strlen(substr);\n    max = 0;\n    j = 0;\n    for (i = 0; i < a + b; i++) {\n      mix[i] = 0;\n    }\n\n    for (i = 0; i < a; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        j = i;\n      }\n    }\n\n    for (i = 0; i < a + b; i++) {\n      if (i <= j) {\n        mix[i] = str[i];\n      }\n      if (i > j && i <= j + b) {\n        mix[i] = substr[i - j - 1];\n      }\n      if (i > j + b && i < a + b) {\n        mix[i] = str[i - b];\n      }\n      printf(\"%c\", mix[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36498", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20], substr[4];\n  int max, i, j, k, p, length;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    length = strlen(str);\n    max = str[0];\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (j = length - 1; j >= k + 1; j--) {\n      str[j + 3] = str[j];\n    }\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    for (p = 0; p < length + 3; p++)\n      printf(\"%c\", str[p]);\n\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36499", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int n, max, t;\n  char str1[100], str2[5], *p1, *p2, *p0;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    n = strlen(str1);\n    p1 = str1;\n    max = 0;\n    for (; p1 < str1 + n; p1++)\n      if (*p1 > max) {\n        max = *p1;\n        p0 = p1;\n      }\n    p2 = str2;\n    p1 = str1;\n    t = 1;\n    for (; p1 < str1 + n; p1++) {\n      printf(\"%c\", *p1);\n      if (*p1 == max && t) {\n        printf(\"%c%c%c\", *p2, *(p2 + 1), *(p2 + 2));\n        t = 0;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36500", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint locate(char s[]) {\n  int i, max_loc = 0, len;\n  len = strlen(s);\n  for (i = 1; i < len; i++) {\n    if (s[i] > s[max_loc])\n      max_loc = i;\n  }\n  return max_loc;\n}\nint main() {\n  char a[100][21], b[100][30], max[100], len[100];\n  int i = -1, j, m;\n  do {\n    i++;\n  } while (scanf(\"%s%s\", a[i], b[i]) != EOF);\n\n  for (j = 0; j < i; j++) {\n    max[j] = locate(a[j]);\n    len[j] = strlen(b[j]);\n    m = max[j] + 1;\n    while (a[j][m] != '\\0') {\n      b[j][len[j]++] = a[j][m++];\n    }\n    b[j][len[j]] = '\\0';\n    a[j][max[j] + 1] = '\\0';\n    printf(\"%s\\n\", strcat(a[j], b[j]));\n  }\n}\n"}
{"label": "20", "index": "36501", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], A[15];\n  int i, M, N, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    i = 1;\n    N = str[0];\n    while (i <= n - 1) {\n      if (str[i] > N) {\n        N = str[i];\n        M = i;\n      } else {\n        N = N;\n        M = M;\n      }\n      i++;\n    }\n    i = 0;\n    while (i <= M) {\n      A[i] = str[i];\n      i++;\n    }\n    A[M + 1] = substr[0];\n    A[M + 2] = substr[1];\n    A[M + 3] = substr[2];\n    while (i <= n - 1) {\n      A[i + 3] = str[i];\n      i++;\n    }\n    i = 0;\n    while (i <= n + 2) {\n      printf(\"%c\", A[i]);\n      i++;\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36502", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n = 0, max;\n  char s[100][11], sb[100][4];\n  while (scanf(\"%s%s\", s[n], sb[n]) != EOF)\n    n++;\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] > max)\n        max = s[i][j];\n    for (j = 0; j < strlen(s[i]); j++)\n      if (s[i][j] == max) {\n        for (k = 0; k <= j; k++)\n          printf(\"%c\", s[i][k]);\n        for (k = 0; k < strlen(sb[i]); k++)\n          printf(\"%c\", sb[i][k]);\n        for (k = j + 1; k < strlen(s[i]); k++)\n          printf(\"%c\", s[i][k]);\n        cout << \"\\n\";\n        break;\n      }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36503", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid charu() {\n  char str[11], substr[4], c, a[11];\n  int i = 0, k, s;\n\n  cin >> str >> substr;\n  k = strlen(str);\n  if (strlen(str) >= 11 || strlen(substr) >= 4)\n    return;\n  for (i = 0; i < k; i++) {\n    a[i] = str[i];\n  }\n  for (i = k; i < 11; i++)\n    a[i] = '\\0';\n\n  for (i = 0; i < k - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      c = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = c;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (str[i] == a[k - 1]) {\n      s = i;\n      break;\n    }\n  }\n  for (i = 0; i < s + 1; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = s + 1; i < k; i++)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n  charu();\n}\n\nint main() {\n  charu();\n  return 0;\n}\n"}
{"label": "20", "index": "36504", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n, p;\n  char str[100][50], sub[100][50], c[100], t;\n  c[0] = getchar();\n  do {\n    p = -1;\n    t = c[j];\n    cin >> str[j] >> sub[j];\n\n    for (i = 0; i < strlen(str[j]); i++) {\n      if (str[j][i] > t) {\n        p = i;\n        t = str[j][i];\n      }\n    }\n    for (i = strlen(str[j]); i > p; i--)\n      str[j][i + (n = strlen(sub[j]))] = str[j][i];\n    for (i = 0; i < n; i++)\n      str[j][p + 1 + i] = sub[j][i];\n    j++;\n    c[j] = getchar();\n  } while (c[j] == 10);\n  for (i = 0; i < j; i++)\n    cout << c[i] << str[i] << \"\\n\";\n}\n"}
{"label": "20", "index": "36505", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, k = 0, n;\n  char a;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    n = strlen(str);\n    a = str[0];\n    for (i = 0;; i++) {\n      if (str[i] == '\\0')\n        break;\n      if (str[i] > a) {\n        a = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      cout << str[i];\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", substr[i]);\n    for (i = k + 1; i < n; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36506", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, k;\n  char str1[20], str2[20];\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; *(str1 + i) != '\\0'; i++)\n      if (*(str1 + i) > max) {\n        max = *(str1 + i);\n        k = i;\n      }\n    for (i = 0; i <= k; i++) {\n      printf(\"%c\", *(str1 + i));\n    }\n    printf(\"%s\", str2);\n    for (i = k + 1; *(str1 + i) != '\\0'; i++)\n      printf(\"%c\", *(str1 + i));\n    printf(\"%c\", '\\n');\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36507", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[10] = {0}, b[3] = {0}, c[10] = {0};\n  while (cin >> a) {\n    int i, temp = 0;\n    for (i = 0; i < 10; i++)\n      c[i] = a[i];\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[temp] - a[i] < 0)\n        temp = i;\n    }\n    for (i = 0; i <= temp; i++)\n      cout << c[i];\n    getchar();\n    cin >> b;\n    cout << b[0] << b[1] << b[2];\n    for (i = temp + 1; i < len; i++)\n      cout << c[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36508", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n    char ansstr[14] = {'\\0'};\n    char cmax = 0;\n    int point = 0;\n    cin >> str;\n    cin >> substr;\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      ansstr[i] = str[i];\n    for (int i = point + 1; i < point + 4; i++) {\n      ansstr[i] = substr[i - point - 1];\n    }\n    for (int i = point + 4, j = point + 1; i < length + 3, j < length; i++, j++)\n      ansstr[i] = str[j];\n    cout << ansstr << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36509", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char str[13] = {0}, substr[4] = {0}, max;\n  while (cin >> str) {\n    cin >> substr;\n    max = str[0];\n    char *p = str, *q = substr;\n    for (p = str + 1; p <= str + 9; p++)\n      if (max < *p)\n        max = *p;\n    for (p = str; p < str + 10; p++)\n      if (*p == max)\n        break;\n    k = p - str;\n    for (p = str + 9; p > str + k; p--)\n      *(p + 3) = *p;\n    for (p = str + k + 1; p <= str + k + 3; p++, q++)\n      *p = *q;\n    p = str;\n    printf(\"%s\\n\", p);\n    for (i = 0; i < 10; i++)\n      str[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36510", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[15], t[15];\n  int i, k;\n  while (scanf(\"%s%s\", s, t) != EOF) {\n    k = 0;\n    for (i = 1; s[i]; ++i)\n      if (s[k] < s[i])\n        k = i;\n    for (i = 0; i <= k; ++i)\n      putchar(s[i]);\n    cout << t;\n    for (i = k + 1; s[i]; ++i)\n      putchar(s[i]);\n    putchar('\\n');\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36511", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[1000], s2[1000];\n  int i, j, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    i = 1;\n    while (s1[i] != '\u0000') {\n      if (s1[max] < s1[i])\n        max = i;\n      i++;\n    }\n    i = 0;\n    while (i <= max) {\n      putchar(s1[i]);\n      i++;\n    }\n    j = 0;\n    while (s2[j] != '\u0000') {\n      putchar(s2[j]);\n      j++;\n    }\n    while (s1[i] != '\u0000') {\n      putchar(s1[i]);\n      i++;\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36512", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *p, s[10], subs[4];\n  while (scanf(\"%s %s\", s, subs) != EOF) {\n    int n, i;\n    n = strlen(s);\n    p = &s[0];\n    for (i = 1; i < n; i++)\n      if (s[i] > *p) {\n        p = &s[i];\n      }\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", s[i]);\n      if (&s[i] == p) {\n        printf(\"%s\", subs);\n      }\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36513", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s1, s2, i, j, t, max;\n  char str[20], substr[5], a[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    s1 = strlen(str);\n    s2 = strlen(substr);\n    max = 0;\n    for (i = 0; i < s1; i++)\n      if (max < str[i]) {\n        max = str[i];\n        t = i;\n      }\n    j = 0;\n    for (i = t + 1; i < s1; i++) {\n      a[j] = str[i];\n      j++;\n    }\n    j = 0;\n    for (i = t + 1; i < t + s2 + 1; i++) {\n      str[i] = substr[j];\n      j++;\n    }\n    j = 0;\n    for (i = t + s2 + 1; i < s1 + s2; i++) {\n      str[i] = a[j];\n      j++;\n    }\n    for (i = 0; i < s1 + s2 - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[s1 + s2 - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36514", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, len, max, maxi;\n  char substr[4], str[11];\n  for (i = 0; i < 4; i++)\n    substr[i] = -1;\n  for (i = 0; i < 11; i++)\n    str[i] = -1;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = -1;\n    maxi = -1;\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == maxi)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36515", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, ii;\n  char res[100][20];\n  int p = 0;\n  char c, sub1[20], sub2[20];\n  char str[20], substr[5];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > c) {\n        c = str[i];\n        ii = i;\n      }\n    strcpy(sub1, str);\n    sub1[ii + 1] = '\\0';\n    strcpy(sub1, strcat(sub1, substr));\n    for (i = ii + 1; i < strlen(str); i++)\n      sub2[i - ii - 1] = str[i];\n    sub2[strlen(str) - ii - 1] = '\\0';\n    strcpy(res[p], strcat(sub1, sub2));\n    p++;\n  }\n  for (i = 0; i < p; i++)\n    cout << res[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "20", "index": "36516", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char s1[11]) {\n  int i, k = 0;\n  char c = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] > c) {\n      c = s1[i];\n      k = i;\n    }\n  }\n  return (k);\n}\nint main() {\n  char s1[11], s2[4];\n  int i, j, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = max(s1);\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"%s\", s2);\n    for (i = m + 1; i < strlen(s1); i++)\n      cout << s1[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36517", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char aa[20], bb[10], c;\n  int i;\n  while (cin >> aa >> bb) {\n    i = 0;\n    c = aa[0];\n    while (aa[i] != '\\0') {\n      if (aa[i] > c)\n        c = aa[i];\n      i++;\n    }\n    i = 0;\n    while (aa[i] != '\\0') {\n      if (aa[i] == c)\n        break;\n      cout << aa[i];\n      i++;\n    }\n    cout << aa[i] << bb;\n    i++;\n    while (aa[i] != '\\0') {\n      cout << aa[i];\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36518", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100][100], s[100][100];\n  int i = 0, j = 0, k, n, lon[100];\n  cin >> s[0];\n  lon[0] = strlen(s[0]);\n  n = 1;\n  for (i = 1; s[i - 1][0] != '\u0000'; i++) {\n\n    cin >> s[i];\n    lon[i] = strlen(s[i]);\n    n++;\n  }\n  n--;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 1; s[i][j] != 32; j++) {\n\n      if (s[i][j] > s[i][k])\n        k = j;\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = lon[i] - 3; j < lon[i]; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = k + 1; s[i][j] != 32; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36519", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    int i, t, m;\n    m = strlen(str);\n    max = str[0];\n    t = 0;\n    for (i = 0; i <= m - 2; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        t = i + 1;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"%s\", substr);\n    for (i = t + 1; i <= m - 2; i++) {\n      cout << str[i];\n    }\n    printf(\"%c\\n\", str[m - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36520", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][15], substr[100][4], c, max = 0;\n  int i, j, k;\n  i = 0;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    for (j = 0; (c = str[i][j]) != '\\0'; j++)\n      if (max < c) {\n        max = c;\n        k = j;\n      }\n    for (j = 0; j < k + 1; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%c%c%c\", substr[i][0], substr[i][1], substr[i][2]);\n    for (j = k + 1; (c = str[i][j]) != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n    i = i++;\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "36521", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char string[20] = {'\\0'}, substring[20] = {'\\0'};\n  while (scanf(\"%s%s\", string, substring) != EOF) {\n    char last[20] = {'\\0'}, *pointer_begin, *pointer_end;\n    int n = 0, k = 0;\n\n    for (pointer_begin = string, pointer_end = string;\n         pointer_begin - string < strlen(string); pointer_begin++)\n      if (*pointer_begin > k) {\n        k = *pointer_begin;\n        pointer_end = pointer_begin;\n        n = pointer_end - string;\n      }\n\n    strncpy(last, string, n + 1);\n    printf(\"%s\", last);\n    printf(\"%s\", substring);\n    printf(\"%s\\n\", pointer_end + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36522", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid function_1(char *str, char *substr) {\n  int i, max, position;\n  for (i = 1, max = str[0], position = 0; str[i] != '\u0000'; i++)\n    if (str[i] > max) {\n      max = str[i];\n      position = i;\n    }\n  str[i + 3] = '\u0000';\n  for (i -= 1; i > position; i--) {\n    str[i + 3] = str[i];\n  }\n  str[position + 1] = substr[0];\n  str[position + 2] = substr[1];\n  str[position + 3] = substr[2];\n}\n\nint main() {\n  char str[15], substr[4];\n  cin >> str >> substr;\n  while (getchar() != EOF) {\n    function_1(str, substr);\n    printf(\"%s \", str);\n    scanf(\"%s %s\", str, substr);\n  }\n  return 1;\n}\n"}
{"label": "20", "index": "36523", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n\n  for (j = 0; j < ceshi; j++) {\n    dizhi[j] = str[j];\n    weizhi = 1;\n    max = *(dizhi[j]);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++)\n      *(c + i) = *(b + i - weizhi);\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36524", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11] = {'\u0000'}, sub[4];\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    char fi[15] = {'\u0000'}, a[10] = {'\u0000'};\n    int i, j, k, n = strlen(str);\n    char c = str[0];\n    for (i = 1; i < n; i++)\n      if (str[i] > c)\n        c = str[i];\n    for (j = 0;; j++) {\n      fi[j] = str[j];\n      if (str[j] == c) {\n        break;\n      }\n    }\n    for (k = j + 1; k < n; k++)\n      a[k - j - 1] = str[k];\n    strcat(fi, sub);\n    strcat(fi, a);\n    cout << fi << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36525", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid insert(char a[10], char b[4]) {\n  int len;\n  len = strlen(a);\n  int i, temp = 0;\n  for (i = 0; i < len; i++)\n    if (a[temp] - a[i] < 0)\n      temp = i;\n  for (i = 0; i <= temp; i++) {\n    cout << a[i];\n  }\n  cout << b[0] << b[1] << b[2];\n  for (i = temp + 1; i < len; i++)\n    cout << a[i];\n  cout << endl;\n}\nint main() {\n  char str[10] = {0}, substr[4] = {0};\n  while (scanf(\"%s %s \", str, substr))\n    insert(str, substr);\n  return 0;\n}\n"}
{"label": "20", "index": "36526", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid str(char a[10], char b[3]) {\n  int i, l, c = a[0], k;\n  l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (c < a[i]) {\n      c = a[i];\n      k = i;\n    }\n  for (i = 0; i < k + 1; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", b[i]);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n}\nint main() {\n  char a[10], b[3];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    str(a, b);\n}\n"}
{"label": "20", "index": "36527", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {EOF};\n  for (j = 0;; j++) {\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[i]);\n    d = EOF;\n  }\n}\n"}
{"label": "20", "index": "36528", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i, n, max = 0, num;\n    n = strlen(str);\n    char *p = str;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        num = i;\n      }\n    }\n    for (i = n + 2; i > num + 3; i--) {\n      *(p + i) = str[i - 3];\n    }\n    *(p + n + 3) = '\\0';\n    for (i = num + 3; i > num; i--) {\n      *(p + i) = substr[i - num - 1];\n    }\n    for (i = 0; i < n + 3; i++)\n      cout << *(p + i);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36529", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, len[100];\n  char a[100][19], str[100][10], substr[100][3], max;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 19; j++)\n      a[i][j] = '\u0000';\n\n  cin >> a[0];\n  for (i = 1;; i++) {\n    if (strlen(a[i - 1]) == 0)\n      break;\n    else {\n\n      cin >> a[i];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(a[i]);\n    a[i][len[i] - 4] = '\u0000';\n    substr[i][0] = a[i][len[i] - 3];\n    substr[i][1] = a[i][len[i] - 2];\n    substr[i][2] = a[i][len[i] - 1];\n  }\n\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      max = max > a[i][j] ? max : a[i][j];\n    for (j = 0; a[i][j] != max; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\"%c\", max);\n    for (k = 0; k < 3; k++)\n      printf(\"%c\", substr[i][k]);\n    j++;\n    for (; a[i][j] != '\u0000'; j++)\n      cout << a[i][j];\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36530", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char a[20], char b[10]) {\n  int max, i, index;\n  char *p;\n  char ans[20];\n  p = a;\n  max = 0;\n  for (i = 1; *(p + i); i++)\n    if (*(p + i) > max) {\n      max = *(p + i), index = i;\n    }\n  strcpy(ans, \"\");\n  strncat(ans, a, index + 1);\n  strcat(ans, b);\n  strcat(ans, a + index + 1);\n  cout << ans << \"\\n\";\n}\nint main() {\n  char str[20], substr[10];\n  while (scanf(\"%s %s\\n\", str, substr) != EOF)\n    insert(str, substr);\n}\n"}
{"label": "20", "index": "36531", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], max, s[1000][100];\n  int i = 0, j, k, l, q, w, e;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    max = str[i][0];\n    for (j = 1; j <= 10; j++) {\n      if (max < str[i][j]) {\n        max = str[i][j];\n      }\n    }\n    for (k = 0; k <= 10; k++) {\n      if (str[i][k] == max) {\n        for (l = 0; l <= k; l++) {\n          s[i][l] = str[i][l];\n        }\n        for (q = 0; l <= k + strlen(substr[i]); l++, q++) {\n          s[i][l] = substr[i][q];\n        }\n        for (w = k + 1; l <= strlen(substr[i]) + strlen(str[i]); l++, w++) {\n          s[i][l] = str[i][w];\n        }\n        printf(\"%s\\n\", s[i]);\n        break;\n      }\n    }\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36532", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[100][13], temp;\n  int i, n, k, len, j;\n  for (i = 0; i < 100; i++) {\n    for (j = 0; j < 13; j++)\n      c[i][j] = '\u0000';\n  }\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == 0)\n      break;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len = strlen(c[i]);\n    temp = c[i][0];\n    k = 0;\n    for (j = 0; j <= len - 5; j++) {\n      if (c[i][j] > temp) {\n        temp = c[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = len - 3; j < len; j++)\n      printf(\"%c\", c[i][j]);\n    for (j = k + 1; j < len - 4; j++)\n      printf(\"%c\", c[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36533", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    int i, t, m;\n    m = strlen(str);\n    max = str[0];\n    t = 0;\n    for (i = 0; i <= m - 2; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        t = i + 1;\n      }\n    }\n    for (i = 0; i <= t; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (i = t + 1; i <= m - 2; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%c\\n\", str[m - 1]);\n  }\n}\n"}
{"label": "20", "index": "36534", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[10], max;\n  int i, n, j, max_index;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    char *p;\n    p = &str[0];\n    max = *p;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        max_index = i;\n      }\n    }\n    for (i = 0; i <= max_index; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = max_index + 1; i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36535", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, k, f;\n  for (i = 0;; i++) {\n    char str[14] = {0}, sub[4] = {0}, str1[14] = {0}, c;\n    a = 0;\n    j = 0;\n    b = 0;\n    f = 0;\n    k = 0;\n    n = 0;\n\n    scanf(\"%s \", str);\n    if (str[0] == 0)\n      break;\n    k = strlen(str);\n    while (str[j] != ' ') {\n      str1[j] = str[j];\n      j++;\n    }\n    n = strlen(str1);\n    b = j + 1;\n    while (b < k && f < 3) {\n      sub[f] = str[b];\n      b++;\n      f++;\n    }\n    c = str1[0];\n    for (j = 1; j < n; j++) {\n      if (c < str1[j])\n        c = str1[j];\n    }\n    for (j = 0; j < n; j++) {\n      if (str1[j] == c) {\n        a = j + 1;\n        break;\n      }\n    }\n    for (j = 0; j < a; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\"%s\", sub);\n    for (j = a; j < n; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36536", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char *p);\nint main() {\n  for (;;) {\n    char a[11], b[4];\n    int n, i;\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    if (a[0] == '\\0')\n      break;\n    n = f(a);\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", *(a + i));\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", *(b + i));\n    for (i = n + 1; *(a + i) != '\\0'; i++)\n      printf(\"%c\", *(a + i));\n    printf(\"\\n\");\n    a[0] = '\\0';\n  }\n}\n\nint f(char *p) {\n  int i, max = 0, t;\n  for (i = 0; *(p + i) != '\\0'; i++) {\n    if (*(p + i) > max) {\n      max = *(p + i);\n      t = i;\n    }\n  }\n  return t;\n}\n"}
{"label": "20", "index": "36537", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    j = 0;\n    str[n] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= n - 1; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n; i >= j + 1; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = j + 1; i <= j + 3; i++) {\n      str[i] = substr[i - 1 - j];\n    }\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36538", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1;\n  char str1[1000], str2[1000], *p, *p1, *p2, *p0, max;\n  while ((scanf(\"%s\", str1)) != EOF) {\n\n    cin >> str2;\n    len1 = strlen(str1);\n    p2 = str2;\n    p1 = str1;\n    max = str1[0];\n    for (p = str1; p < str1 + len1; p++)\n      if (max < *p) {\n        max = *p;\n        p0 = p;\n      }\n    for (; p1 < str1 + len1; p1++) {\n      if (p1 == p0) {\n        printf(\"%c\", *p1);\n        for (; *p2 != '\u0000'; p2++) {\n          if (*p2 == ' ')\n            continue;\n          else\n            printf(\"%c\", *p2);\n        }\n      }\n      if (p1 != p0)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36539", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[4], *p;\n  int i, n, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    p = &str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (*p < str[i]) {\n        p = &str[i];\n        j = i;\n      }\n    for (i = n - 1; i > j; i--)\n      str[i + 3] = str[i];\n    *(p + 1) = substr[0];\n    *(p + 2) = substr[1];\n    *(p + 3) = substr[2];\n    str[n + 3] = '\\0';\n\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36540", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[10], substr[10];\n  int first = 1;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, max = -1, loc, len;\n    \n    len = strlen(str);\n    for (i = 0; i < len; i++)\n      if (str[i] > max) {\n        max = str[i];\n        loc = i;\n      }\n    if (!first)\n      printf(\"\\n\");\n\n    for (i = 0; i <= loc; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < strlen(substr); i++)\n      printf(\"%c\", substr[i]);\n    for (i = loc + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    if (first)\n      first = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36541", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint MaxIndex(char *str) {\n  char maxChar = 0;\n  int i = 0, j = 0;\n  while (*str != 0) {\n    if (maxChar < *str) {\n      maxChar = *str;\n      i = j;\n    }\n    j++;\n    str++;\n  }\n  return i;\n}\nvoid fun(char *str, char *substr) {\n  int max = MaxIndex(str);\n  str += max;\n  char *temp = str;\n  while (*(temp++) != 0)\n    ;\n  *(temp + 3) = 0;\n  while ((--temp) != str) {\n    *(temp + 3) = *temp;\n  }\n  while (*substr != 0) {\n    *(++temp) = *substr++;\n  }\n}\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    fun(str, substr);\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36542", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int x = 0;\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n    \n    \n    for (int i = 0; i < len1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    strcpy(s3, s1);\n    \n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n    \n    s4[0] = '\\0';\n    for (int i = maxi + 1; i < len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n    \n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36543", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  for (;;) {\n    char str[11], substr[4], combine[15] = {0};\n    if (scanf(\"%s%s\", str, substr) == EOF)\n      break;\n    n = strlen(str);\n    m = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] - str[m] > 0)\n        m = i;\n    }\n    for (i = 0; i <= m; i++) {\n      combine[i] = str[i];\n    }\n    for (i = 1; i <= 3; i++) {\n      combine[m + i] = substr[i - 1];\n    }\n    for (i = 1; i <= n - m - 1; i++) {\n      combine[m + 3 + i] = str[m + i];\n    }\n    puts(combine);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36544", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5];\n  int i, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 0, p = 0; i < strlen(str); i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = p + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36545", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p;\n  int i, j, m;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    m = 0;\n    p = &str[0];\n    for (i = 1; *(p + i) != '\\0'; i++) {\n      if (*(p + i) > *(p + m))\n        m = i;\n    }\n    for (j = 0; j <= m; j++)\n      printf(\"%c\", str[j]);\n    printf(\"%s\", substr);\n    for (j = m + 1; *(p + j) != '\\0'; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36546", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20][10], string[20][4], d;\n  int i, j, m[20] = {0}, l[20];\n  for (i = 0;; i++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str[i], &string[i]) == EOF)\n      break;\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if ((int)str[i][j] > m[i])\n        m[i] = str[i][j];\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if (m[i] == str[i][j]) {\n        l[i] = j;\n        break;\n      }\n    for (j = 0; j <= l[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < strlen(string[i]); j++)\n      printf(\"%c\", string[i][j]);\n    for (j = l[i] + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36547", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], sub[100];\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    int m;\n    m = strlen(str);\n    int i, j, temp, as[20];\n    for (i = 0; i <= m - 1; i++)\n      as[i] = str[i];\n    for (j = 1; j <= m - 1; j++)\n      if (as[0] < as[j])\n        as[0] = as[j];\n\n    char p;\n    p = as[0];\n    int q;\n    for (i = 0; i <= m - 1; i++)\n      if (str[i] == p) {\n        q = i;\n        break;\n      }\n    for (i = m + 2; i >= q + 1; i--)\n      str[i + 3] = str[i];\n    str[q + 1] = sub[0];\n    str[q + 2] = sub[1];\n    str[q + 3] = sub[2];\n    str[m + 3] = '\\0';\n    printf(\"%s\", str);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36548", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid setin(char a[11], char b[4]) {\n  int i, stop = 0, max;\n  max = (int)a[0];\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((int)a[i] > max) {\n      max = (int)a[i];\n      stop = i;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (i == stop) {\n      printf(\"%c\", a[i]);\n      cout << b;\n    } else\n      printf(\"%c\", a[i]);\n  }\n  cout << endl;\n}\nint main() {\n  char a[11] = {'\\0'}, b[4] = {'\\0'};\n  while (scanf(\"%s %s \", a, b)) {\n    setin(a, b);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36549", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    int i, position, length;\n    char max = str[0];\n    length = strlen(str);\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        position = i;\n      }\n    }\n    for (i = length - 1; i >= position + 1; i--)\n      str[i + 3] = str[i];\n    for (i = position + 1; i < position + 4; i++)\n      str[i] = substr[i - position - 1];\n    str[length + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36550", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[20], b[4];\n  while (scanf(\"%s %s \", a, b)) {\n    char *pa, *pb = b, *pmax = a;\n    for (pa = a; pa != &a[strlen(a)]; pa++)\n      if (*pa > *pmax)\n        pmax = pa;\n    for (pa = &a[strlen(a)]; pa != pmax; pa--) {\n      *(pa + 3) = *pa;\n    }\n    for (pa = pmax + 1, pb = b; pb != &b[3]; pa++, pb++)\n      *pa = *pb;\n    pa = a;\n    cout << pa << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36551", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int n, i, j;\n  char *p1;\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    p1 = &a[0];\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] > *p1) {\n        p1 = &a[i];\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (&a[i] != p1)\n        printf(\"%c\", a[i]);\n      if (&a[i] == p1)\n        printf(\"%c%c%c%c\", *p1, b[0], b[1], b[2]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36552", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[100][100], b[100][100];\n  int n = 0;\n  while (scanf(\"%s%s\", a[n], b[n]) != EOF) {\n    n++;\n  }\n  int i, j, k, mark;\n  char c = '\\0';\n  for (i = 0; i < n; i++) {\n    c = '\\0';\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] > c) {\n        c = a[i][j];\n        mark = j;\n      }\n    }\n    for (k = 0; k <= mark; k++) {\n      cout << a[i][k];\n    }\n    printf(\"%s\", b[i]);\n    for (k = mark + 1; a[i][k] != '\\0'; k++) {\n      printf(\"%c\", a[i][k]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36553", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char t, g, c[100][15] = {'\\0'}, a[100][3];\n  int i, b, j, k, h[100];\n  for (i = 0;; i++) {\n    scanf(\"%s %s\", c[i], a[i]);\n    if (c[i][0] == '\\0')\n      break;\n  }\n\n  b = i + 1;\n\n  for (i = 0; i < b; i++) {\n\n    h[i] = strlen(c[i]);\n    t = c[i][0];\n    for (j = 0; j < h[i]; j++) {\n      if (c[i][j] > t)\n        t = c[i][j];\n    }\n\n    for (j = 0; j < h[i]; j++) {\n      if (c[i][j] == t) {\n        for (k = (h[i] - 1); k > j; k--) {\n          c[i][k + 3] = c[i][k];\n        }\n        c[i][j + 1] = a[i][0];\n        c[i][j + 2] = a[i][1];\n        c[i][j + 3] = a[i][2];\n\n        break;\n      }\n    }\n    printf(\"%s\\n\", c[i]);\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36554", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint f(char a[]) {\n  int i, l, l0, b = 0;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (b < a[i]) {\n      b = a[i];\n      l0 = i;\n    }\n  }\n  return (l0);\n}\nint main() {\n  char s1[11], s2[4], s[14];\n  int j, i, l, l0;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    l0 = f(s1);\n    for (i = 0; i <= l0; i++)\n      s[i] = s1[i];\n    for (j = 0, i = l0 + 1; j < 3; j++, i++)\n      s[i] = s2[j];\n    for (j = l0 + 1, i = l0 + 4; j <= l; j++, i++)\n      s[i] = s1[j];\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "20", "index": "36555", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11][13], substr[11][3];\n  int l[11], i, j, n = 0, max[11];\n  while (scanf(\"%s %s\", str[n], substr[n]) != EOF)\n    n++;\n  for (i = 0; i < n; i++)\n    l[i] = strlen(str[i]);\n  for (i = 0; i < n; i++) {\n    max[i] = 0;\n    for (j = 1; j < l[i]; j++) {\n      if (str[i][j] > str[i][max[i]])\n        max[i] = j;\n      else\n        max[i] = max[i];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = l[i] - 1; j >= max[i] + 1; j--) {\n      str[i][j + 3] = str[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    str[i][max[i] + 1] = substr[i][0];\n    str[i][max[i] + 2] = substr[i][1];\n    str[i][max[i] + 3] = substr[i][2];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i] + 2; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%c\\n\", str[i][l[i] + 2]);\n  }\n}\n"}
{"label": "20", "index": "36556", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(char x[], char y[]) {\n  int lenx, leny;\n  int i, k, j;\n  char p;\n  lenx = strlen(x);\n  leny = strlen(y);\n  k = 0;\n  p = x[0];\n  for (i = 0; i <= lenx - 1; i++) {\n    if (x[i] > p) {\n      k = i;\n      p = x[i];\n    }\n  }\n  for (i = lenx - 1; i >= k + 1; i--)\n    x[i + 3] = x[i];\n  for (i = k + 1; i <= k + 3; i++)\n    x[i] = y[i - k - 1];\n  x[lenx + 3] = '\\0';\n}\nint main() {\n  char x[20], y[4];\n  while (scanf(\"%s %s\", x, y) != EOF) {\n\n    f(x, y);\n    cout << x << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36557", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l;\n  char str[20], sub[20], *max, *p, temp;\n  while (scanf(\"%s \", str)) {\n    l = strlen(str);\n    scanf(\"%s \", sub);\n    max = str;\n    for (p = str; p <= str + l; p++) {\n      if (*max < *p) {\n        max = p;\n      }\n    }\n    temp = *max;\n    *max = 0;\n    cout << str << temp << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36558", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  char a[20], b[4];\n  while (scanf(\"%s %s \", a, b)) {\n    char *pa, *pb = b, *pmax = a;\n    for (pa = a; pa != &a[strlen(a)]; pa++)\n      if (*pa > *pmax)\n        pmax = pa;\n    for (pa = &a[strlen(a)]; pa != pmax; pa--) {\n      *(pa + 3) = *pa;\n    }\n    for (pa = pmax + 1, pb = b; pb != &b[3]; pa++, pb++)\n      *pa = *pb;\n    pa = a;\n    printf(\"%s\\n\", pa);\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36559", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][15], substr[100][4], c, max = 0;\n  int i, j, k;\n  i = 0;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    for (j = 0; (c = str[i][j]) != '\\0'; j++)\n      if (max < c) {\n        max = c;\n        k = j;\n      }\n    for (j = 0; j < k + 1; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%c%c%c\", substr[i][0], substr[i][1], substr[i][2]);\n    for (j = k + 1; (c = str[i][j]) != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    cout << \"\\n\";\n    i = i++;\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "36560", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[103][12], s2[103][4];\n  int i = 0, j, max = 0, k, u, len;\n  while (scanf(\"%s%s\", s1[i], s2[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    len = strlen(s1[j]);\n    max = 0;\n    u = 0;\n    for (k = 0; k < len; k++) {\n      if (s1[j][k] > max) {\n        max = s1[j][k];\n        u = k;\n      }\n    }\n    for (k = 0; k <= u; k++)\n      printf(\"%c\", s1[j][k]);\n    for (k = 0; k <= 2; k++)\n      printf(\"%c\", s2[j][k]);\n    for (k = u + 1; k < len; k++)\n      printf(\"%c\", s1[j][k]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36561", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  while (cin >> str >> substr) {\n    int size = 0;\n    for (int i = 0; i <= 10; i++) {\n      if (str[i] == '\\0') {\n        size = i;\n        break;\n      }\n    }\n    int tmp = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] > tmp) {\n        tmp = str[i];\n      }\n    }\n    int j = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] == tmp) {\n        j = i;\n        break;\n      }\n    }\n    for (int i = 0; i <= j; i++) {\n      cout << str[i];\n    }\n    cout << substr;\n    if (j < size - 1) {\n      for (int i = j + 1; i < size; i++) {\n        cout << str[i];\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36562", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char st1[], char st2[]) {\n  int i, m, n;\n  char max;\n  m = strlen(st1);\n  max = st1[0];\n  n = m - 1;\n\n  for (i = 0; i < m; i++) {\n    if (st1[i] > max) {\n      max = st1[i];\n      n = i;\n    }\n  }\n\n  for (i = 0; i <= n; i++)\n    printf(\"%c\", st1[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", st2[i]);\n  for (i = n + 1; i < m; i++)\n    cout << st1[i];\n  printf(\"\\n\");\n}\nint main() {\n  char st1[50][10], st2[50][4];\n  int i, j, k;\n  char p;\n  while ((st1[i][0] = getchar()) != EOF) {\n    for (j = 1;; j++) {\n      if ((p = getchar()) != ' ')\n        st1[i][j] = p;\n      else {\n        st1[i][j] = '\\0';\n        break;\n      }\n    }\n    cin >> st2[i];\n    i++;\n    p = getchar();\n  }\n  k = i;\n  for (i = 0; i < k; i++)\n    insert(st1[i], st2[i]);\n}\n"}
{"label": "20", "index": "36563", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[100][50];\n  int a[100][2], b[100], c[100];\n  int i, j, k = -1;\n  for (i = 0; i < 100; i++) {\n    c[i] = b[i] = 0;\n  }\n  for (i = 0; i < 100; i++) {\n    cin >> str[i];\n    k = k + 1;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i < k; i++) {\n    c[i] = strlen(str[i]);\n    for (j = 0; j < c[i]; j++)\n      if (str[i][j] == ' ')\n        b[i] = j;\n  }\n  for (i = 0; i < k; i++) {\n    a[i][1] = str[i][0];\n    a[i][0] = 0;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < b[i]; j++)\n      if (str[i][j] > a[i][1]) {\n        a[i][0] = j;\n        a[i][1] = str[i][j];\n      }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < a[i][0] + 1; j++)\n      cout << str[i][j];\n    for (j = b[i] + 1; j < b[i] + 4; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = a[i][0] + 1; j < b[i]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36564", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++)\n      if (*p > max)\n        max = *p, k = i;\n    for (p = str; p <= (str + k); p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    if (k < strlen(str)) {\n      for (p = str + k + 1; *p != '\\0'; p++)\n        printf(\"%c\", *p);\n      printf(\"\\n\");\n    } else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36565", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2, *a, *b, c;\n  int i, j, k, n;\n  do {\n    p1 = (char *)malloc(100 * sizeof(char));\n    p2 = (char *)malloc(100 * sizeof(char));\n    a = (char *)malloc(200 * sizeof(char));\n    b = (char *)malloc(200 * sizeof(char));\n\n    strcpy(a, \" \");\n    strcpy(b, \" \");\n    for (i = 0, c = *(p1), k = 0; *(p1 + i) != '\\0'; i++) {\n      if (*(p1 + i) > c) {\n        c = *(p1 + i);\n        k = i;\n      }\n    }\n    strncpy(a, p1, k + 1);\n    *(a + k + 1) = '\\0';\n    strcat(a, p2);\n    for (i = k + 1, j = 0; *(p1 + i) != '\\0'; i++, j++) {\n      *(b + j) = *(p1 + i);\n    }\n\n    *(b + j) = '\\0';\n    strcat(a, b);\n    puts(a);\n    free(a);\n    free(b);\n    free(p1);\n    free(p2);\n  } while (scanf(\"%s%s\", p1, p2) != EOF);\n}\n"}
{"label": "20", "index": "36566", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[10], s2[30];\n  int i, j, len, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    char s3[30] = {'\\0'};\n    len = strlen(s1);\n    for (i = 0; i < len; i++) {\n      if (s1[i] > max)\n        j = i, max = s1[i];\n    }\n    for (i = j + 1; i < len; i++) {\n      s3[i - j - 1] = s1[i], s1[i] = '\\0';\n    }\n    strcat(s1, s2);\n    strcat(s1, s3);\n    printf(\"%s\\n\", s1);\n  }\n}\n"}
{"label": "20", "index": "36567", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100][15] = {'\\0'}, s2[100][4];\n  int i = 0, j, max, k, u;\n  while (scanf(\"%s%s\\n\", &s1[i], &s2[i]) != EOF)\n    i++;\n  for (j = 0; j <= i; j++) {\n    max = 0;\n    k = 1;\n    while (s1[j][k] != '\\0') {\n      if (s1[j][k] > s1[j][max])\n        max = k;\n      k++;\n    }\n    for (u = k - 1; u > max; u--)\n      s1[j][u + 3] = s1[j][u];\n\n    s1[j][max + 1] = s2[j][0];\n    s1[j][max + 2] = s2[j][1];\n    s1[j][max + 3] = s2[j][2];\n    s1[j][k + 3] = '\\n';\n    cout << s1[j];\n  }\n}\n"}
{"label": "20", "index": "36568", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], sub[100], *p, *q;\n  int i, n, k;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    n = strlen(str);\n    q = sub;\n    k = 0;\n    for (i = 1; i < n; i++) {\n      if (str[i] > str[k]) {\n        k = i;\n      }\n    }\n    for (p = str + n + 2; p > str + k + 3; p--) {\n      *p = *(p - 3);\n    }\n    *(str + k + 1) = *q;\n    *(str + k + 2) = *(q + 1);\n    *(str + k + 3) = *(q + 2);\n    for (p = str; p < str + n + 3; p++)\n      printf(\"%c\", *p);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36569", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *str, *substr, *p, *q, *max, *string;\n  int i, j, l1, l2;\n  str = (char *)calloc(15, sizeof(char));\n  substr = (char *)calloc(5, sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    l2 = strlen(substr);\n    max = str;\n    for (p = str; p - str < l1; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    string = (char *)calloc(15, sizeof(char));\n    for (p = str, i = 0; p <= max; p++, i++)\n      *(string + i) = *p;\n    for (p = substr; p - substr < l2; p++, i++) {\n      *(string + i) = *p;\n    }\n    for (p = max + 1; p - str < l1; p++, i++)\n      *(string + i) = *p;\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36570", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[10], s2[30];\n  int i, j, len, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    char s3[30] = {'\\0'};\n    len = strlen(s1);\n    for (i = 0; i < len; i++) {\n      if (s1[i] > max)\n        j = i, max = s1[i];\n    }\n    for (i = j + 1; i < len; i++) {\n      s3[i - j - 1] = s1[i], s1[i] = '\\0';\n    }\n    strcat(s1, s2);\n    strcat(s1, s3);\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36571", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, max, m;\n  char str[11], substr[4], temp[10];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (i = m + 1; i < n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\0\");\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36572", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c1[20] = {0}, c2[3] = {0}, c3[10] = {0};\n  int m, i, j, l, n1, n2, k, max;\n  for (k = 0; k < 10000; k++) {\n    cin >> c1 >> c2;\n    n1 = strlen(c1);\n    n2 = strlen(c2);\n    strcpy(c3, c1);\n    for (i = 0, max = c1[0]; i < n1; i++)\n      if (c1[i] > max) {\n        max = c1[i];\n        m = i;\n      } else\n        max = max;\n    for (j = m + 1, l = 0; j <= i + n2, l < n2; j++, l++)\n      c1[j] = c2[l];\n    for (j = m + n2 + 1, l = m + 1; j < n1 + n2, l < n1; j++, l++)\n      c1[j] = c3[l];\n    printf(\"%s\\n\", c1);\n    for (i = 0; i < n1 + n2; i++)\n      c1[i] = 0;\n    for (i = 0; i < n2; i++)\n      c2[i] = 0;\n  }\n}\n"}
{"label": "20", "index": "36573", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint plug(char str[11], char substr[4]) {\n  int i, j, t, c, n, a[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n  char p[11], q;\n  n = strlen(str);\n  strcpy(p, str);\n  for (j = 0; j < n - 1; j++)\n    for (i = 0; i < n - 1 - j; i++)\n      if (p[i] < p[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n        q = p[i];\n        p[i] = p[i + 1];\n        p[i + 1] = q;\n      }\n  c = a[0];\n  for (i = 0; i <= c; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = c + 1; i < n; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  return 0;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    plug(str, substr);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36574", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20][11], substr[20][4];\n  int i = 0, j, n, l, k, h, x, y;\n  char a = '\\0';\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    scanf(\"\\n\");\n    i++;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    l = strlen(str[i]);\n    for (j = 0; j < l; j++)\n      if (str[i][j] > a)\n        a = str[i][j];\n    k = 0;\n    while (str[i][k] != a)\n      printf(\"%c\", str[i][k++]);\n    y = k;\n    printf(\"%c\", a);\n    for (h = 0; h < 3; h++)\n      printf(\"%c\", substr[i][h]);\n    for (x = y + 1; x < l; x++)\n      printf(\"%c\", str[i][x]);\n    printf(\"\\n\");\n    a = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36575", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[11];\n\n  int j, k, i, n, m;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    for (j = 0; j < n; j++)\n      a[j] = str[j];\n\n    for (k = 1; k < n; k++)\n      if (a[0] < a[k])\n        a[0] = a[k];\n    for (j = 0; j < n; j++) {\n      cout << str[j];\n      if (str[j] == a[0])\n        break;\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", substr[k]);\n    for (i = (j + 1); i < n; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36576", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, n, t, max;\n  char str1[100][50], str2[100][3];\n  i = 0;\n  while (scanf(\"%s%s\", str1[i], str2[i]) != EOF) {\n    i++;\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n\n    m = 0;\n    t = strlen(str1[i]);\n    max = str1[i][0];\n    for (j = 1; j < t; j++) {\n\n      if (max < str1[i][j]) {\n        m = j;\n        max = str1[i][j];\n      }\n    }\n    for (j = 0; j <= m; j++)\n      printf(\"%c\", str1[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", str2[i][j]);\n    for (j = m + 1; j < t; j++)\n      printf(\"%c\", str1[i][j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36577", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int s;\n  for (;;) {\n    char str1[100], str2[5], str3[100] = {'\\0'}, m;\n    int i, j, l;\n    s = scanf(\"%s %s\", &str1, &str2);\n    if (s != 2)\n      break;\n    else {\n      for (i = 0, m = str1[0]; i < strlen(str1); i++) {\n        if (m < str1[i])\n          m = str1[i];\n      }\n      for (i = 0; i < strlen(str1); i++)\n        if (str1[i] == m) {\n          l = i;\n          break;\n        }\n      for (i = 0; i <= l; i++)\n        str3[i] = str1[i];\n      for (i = 0; i < 3; i++)\n        str3[l + 1 + i] = str2[i];\n      for (i = 0; i < (strlen(str1) - l - 1); i++)\n        str3[l + 4 + i] = str1[l + i + 1];\n      cout << str3 << \"\\n\";\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36578", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14];\n  int i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36579", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p;\n  while (cin >> str) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p) {\n        max = p;\n      }\n    for (p = str; p <= max; p++)\n      cout << *p;\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36580", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l = 0, m = 0, i = 0;\n  char str[20], sub[5];\n\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    l = strlen(str);\n\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[m])\n        m = i;\n    }\n\n    for (i = l + 2; i >= m + 4; i--) {\n      str[i] = str[i - 3];\n    }\n\n    str[m + 1] = sub[0];\n    str[m + 2] = sub[1];\n    str[m + 3] = sub[2];\n    str[l + 3] = '\\0';\n\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36581", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, p = 0, ch = 0, len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] > ch) {\n        ch = str[i];\n        p = i;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == str[p] && i < p) {\n        p = i;\n        break;\n      }\n    }\n    for (i = len; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1; i < p + 4; i++)\n      str[i] = substr[i - 1 - p];\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36582", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], substr[1000];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int len1 = strlen(str);\n    int i, j, k, max, temp;\n    max = str[len1 - 1];\n    for (i = len1 - 1; i >= 0; i--) {\n      if (str[i] >= max) {\n        max = str[i];\n        temp = i;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (i == temp) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else\n        printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36583", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a, int b, char c[]) {\n  int i;\n  for (i = a; i <= b; i++) {\n    cout << c[i];\n  }\n}\nint arrange(char a[]) {\n  int m = 0, i, n;\n  n = strlen(a);\n  int t = a[0];\n  for (i = 0; i < n; i++) {\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m;\n    m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36584", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[3], s[20];\n  int i, j = 0, k, m;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = m - 1; i > j; i--)\n      str[i + 3] = str[i];\n    for (i = j + 1, k = 0; i < j + 4; i++, k++)\n      str[i] = substr[k];\n    str[m + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36585", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      if (a[k] < a[i])\n        k = i;\n    for (i = 12; i > k + 3; i--)\n      a[i] = a[i - 3];\n    for (i = k + 1; i < k + 4; i++)\n      a[i] = b[i - k - 1];\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36586", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p;\n  int i, j, m;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    m = 0;\n    p = &str[0];\n    for (i = 1; *(p + i) != '\\0'; i++) {\n      if (*(p + i) > *(p + m))\n        m = i;\n    }\n    for (j = 0; j <= m; j++)\n      printf(\"%c\", str[j]);\n    printf(\"%s\", substr);\n    for (j = m + 1; *(p + j) != '\\0'; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36587", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], str1[10], substr[4], letter, result[13], b[10] = {'\u0000'},\n                                                         string[13];\n  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, m, l, i, j, time;\n  for (time = 1; time < 100; time++) {\n    for (i = 0; i < 10; i++) {\n      str[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      result[i] = '\u0000';\n    }\n    for (i = 0; i < 4; i++) {\n      substr[i] = '\u0000';\n    }\n    for (i = 0; i < 10; i++) {\n      a[i] = i;\n    }\n    for (i = 0; i < 10; i++) {\n      b[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      string[i] = '\u0000';\n    }\n\n    scanf(\"%s \", string);\n    if (strlen(string) == 0) {\n      break;\n    }\n    for (i = 0; string[i] != ' '; i++) {\n      str[i] = string[i];\n    }\n\n    l = strlen(str);\n    for (i = l + 1, j = 0; i < l + 4, j < 3; i++, j++) {\n      substr[j] = string[i];\n    }\n    substr[3] = '\u0000';\n    strcpy(str1, str);\n    for (i = 0; i < l - 1; i++) {\n      for (j = 0; j < l - i - 1; j++) {\n        if (str1[j] < str1[j + 1]) {\n          letter = str1[j], m = a[j];\n          str1[j] = str1[j + 1], a[j] = a[j + 1];\n          str1[j + 1] = letter, a[j + 1] = m;\n        }\n      }\n    }\n    m = a[0];\n    strncpy(result, str, m + 1);\n    strcat(result, substr);\n    for (i = 0; i < l - m - 1; i++) {\n      str1[i] = str[i + m + 1];\n    }\n    strncpy(b, str1, l - m - 1);\n    strcat(result, b);\n    printf(\"%s \", result);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36588", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char a[15]) {\n  char m, c;\n  int i, l = 0, j, k;\n  j = strlen(a);\n  if (strlen(a) == 0 || a[0] < 33 || a[0] > 126)\n    return;\n  m = 0;\n  for (i = 0; i < j - 4; i++)\n    if (m < a[i]) {\n      m = a[i];\n      l = i + 1;\n    }\n  for (i = 0; i < 3; i++) {\n    c = a[j - 3 + i];\n    for (k = j - 3 + i; k > l + i; k--)\n      a[k] = a[k - 1];\n    a[l + i] = c;\n  }\n  for (i = 0; i < j - 2; i++)\n    printf(\"%c\", a[i]);\n  printf(\"%c \", a[j - 2]);\n}\nint main() {\n  char b[50][15];\n  int l = 0, i;\n  do {\n\n    cin >> b[l];\n    if (strlen(b[l]) == 0 || b[l][0] < 33 || b[l][0] > 126)\n      break;\n    l = l + 1;\n  } while (b[l - 1][0] != '\u0000');\n  for (i = 0; i < l; i++)\n    insert(b[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36589", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint find(char *str, int n) {\n  int max = *str, i, sign;\n  for (i = 0; i < n; i++)\n    if (*(str + i) > max)\n      max = *(str + i), sign = i;\n  return sign;\n}\nvoid insert(char *a, char *b, int k, int n) {\n  int i, j;\n  for (i = n; i > k; i--)\n    *(a + i + 3) = *(a + i);\n  for (j = 0; j < 3; j++)\n    a[++k] = b[j];\n}\nint main() {\n  char str[100], substr[10];\n  int n, sign;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    sign = find(str, n);\n    insert(str, substr, sign, n);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36590", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int p, q, m, n, i;\n  char str[15], substr[5];\n\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", substr);\n    p = strlen(str);\n    q = 0;\n    for (i = 1; i < p; i++) {\n      if ((m = str[i]) > (n = str[q])) {\n        q = i;\n      }\n    }\n    for (i = 0; i <= q; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << substr;\n    for (i = q + 1; i < p; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36591", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar zuida(char a[]) {\n  char max;\n  int i, p = 0;\n  max = a[0];\n  for (i = 0; a[i] != '\\0'; i++)\n    if (a[i] > max) {\n      max = a[i];\n      p = i;\n    }\n\n  return (p);\n}\n\nint main() {\n  char a[50], b[20];\n  int i, t1, t2, m;\n\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    t1 = strlen(a);\n    t2 = strlen(b);\n\n    m = zuida(a);\n\n    for (i = 0; i < m + 1; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < t2; i++)\n      printf(\"%c\", b[i]);\n    for (i = m + 1; i < t1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36592", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[13], s2[5];\n  int i, j, m, a;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    a = 0;\n    m = strlen(s1);\n    for (i = 0; i < m; i++) {\n      if (s1[i] > s1[a])\n        a = i;\n    }\n    for (i = m - 1; i > a; i--)\n      s1[i + 3] = s1[i];\n    for (i = a + 1, j = 0; i < a + 1 + 3; i++, j++)\n      s1[i] = s2[j];\n    for (i = 0; i < m + 3; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36593", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int n, i, k;\n  cin >> str >> substr;\n  n = strlen(str);\n  k = 0;\n  for (i = 1; i < n; i++)\n    if (str[i] > str[k])\n      k = i;\n  for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n    str[i] = str[i - 3];\n  str[k + 1] = substr[0];\n  str[k + 2] = substr[1];\n  str[k + 3] = substr[2];\n  for (i = 0; i <= n + 3 - 1; i++)\n    printf(\"%c\", str[i]);\n  for (i = 0; i <= 13; i++)\n    str[i] = '\\0';\n\n  for (;;) {\n    scanf(\"%s %s\", str, substr);\n    if (str[0] == '\\0')\n      break;\n    n = strlen(str);\n    k = 0;\n    for (i = 1; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n      str[i] = str[i - 3];\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    printf(\"\\n\");\n    for (i = 0; i <= n + 3 - 1; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i <= 13; i++)\n      str[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "36594", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  int i, j;\n  char X;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    X = str[0];\n    for (i = 1; i < strlen(str); i++)\n      if (X < str[i])\n        X = str[i];\n    for (i = 1; i < strlen(str); i++)\n      if (str[i] == X)\n        break;\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    cout << substr;\n    for (j = i + 1; j < strlen(str); j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36595", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    int i, j, k = 0, len = strlen(str);\n    char max = 1;\n    for (i = 0; i < len; i++)\n      if (max < str[i])\n        max = str[i];\n    for (j = 0; j < len; j++)\n      if (max == str[j])\n        break;\n    for (i = len + 2; i > j + 3; i--)\n      str[i] = str[i - 3];\n    str[len + 3] = '\\0';\n    for (i = j + 1; i < j + 4; i++)\n      str[i] = substr[k++];\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36596", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], substr[3], s[13];\n  char *p, *m, *n, *q;\n  char max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (m = str, max = *m; *m != '\\0'; m++)\n      if (*m > max)\n        max = *m;\n    for (m = str; *m != '\\0'; m++)\n      if (*m == max) {\n        q = m;\n        break;\n      }\n    for (p = s, m = str; m <= q; p++, m++)\n      *p = *m;\n    for (n = substr; *n != '\\0'; n++, p++)\n      *p = *n;\n    for (m = q + 1; *m != '\\0'; m++, p++)\n      *p = *m;\n    *p = '\\0';\n    p = s;\n    printf(\"%s\\n\", p);\n  }\n}\n"}
{"label": "20", "index": "36597", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, a, m;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF)\n\n  {\n    n = strlen(str);\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        a = i;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", str[i]);\n      if (i == a)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36598", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, s, k;\n  char a[15], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    s = 0;\n    k = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > k) {\n        k = a[i];\n        s = i;\n      }\n    }\n\n    for (i = 0; i <= s; i++) {\n      cout << a[i];\n    }\n    printf(\"%s\", b);\n    for (i = s + 1; i < n; i++)\n      printf(\"%c\", a[i]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36599", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5];\n  while (scanf(\"%s %s \", str, substr)) {\n    int j = 0;\n    int A = strlen(str);\n    int B = strlen(substr);\n    int k = 0;\n    char temp = str[0];\n    for (int i = 0; i < A; i++)\n      if (str[i] > temp)\n        temp = str[i];\n    for (j = 0; j < A; j++)\n      if (str[j] == temp) {\n        break;\n      }\n    j++;\n    for (k = A; k >= j; k--) {\n      str[k + B] = str[k];\n    }\n\n    for (int l = j; l <= j + B - 1; l++)\n      str[l] = substr[l - j];\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36600", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char word[20], in[4];\n  \n  char *p, *q;\n  while (cin >> word >> in) {\n    p = word;\n    q = word;\n    while (1) {\n      if (*p == '\\0')\n        break;\n      if (*p - *q > 0)\n        q = p;\n      p++;\n    }\n    p = word;\n    while (1) {\n      if (*p == '\\0') {\n        cout << endl;\n        break;\n      }\n      cout << *p;\n      if (p == q)\n        cout << in[0] << in[1] << in[2];\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36601", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int len, max, i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (i = 0; i < len; i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    if (max != len - 1)\n      for (i = max + 1; i < len; i++)\n        printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36602", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid dd(char a[], char b[]) {\n  int i, j = 0, m, max;\n  m = strlen(a);\n  max = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  for (i = m; i > j; i--) {\n    a[i + 3] = a[i];\n  }\n  a[j + 1] = b[0];\n  a[j + 2] = b[1];\n  a[j + 3] = b[2];\n  for (i = 0; i < m + 3; i++) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n}\nint main() {\n  char a[20], b[5];\n\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    dd(a, b);\n  }\n}\n"}
{"label": "20", "index": "36603", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int l = 0, i = 0;\n  char str[11] = {\"\"}, substr[3] = {\"\"}, str2[11] = {\"\"};\n  char *p;\n\nLOOP:\n  cin >> str >> substr;\n  if (strcmp(str2, str) == 0)\n    goto END;\n  l = strlen(str);\n  p = str;\n  for (i = 0; i < l; i++) {\n    if (*p < str[i])\n      p = &str[i];\n    else\n      ;\n  }\n\n  for (i = 0; i < l; i++) {\n    printf(\"%c\", str[i]);\n    if (&str[i] == p)\n      printf(\"%s\", substr);\n  }\n  printf(\"\\n\");\n  strcpy(str2, str);\n  goto LOOP;\nEND:;\n}\n"}
{"label": "20", "index": "36604", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[15];\n  int max, num, i, j;\n  while (1) {\n    max = 0;\n\n    if (scanf(\"%s%s\", str, substr) == EOF) {\n      break;\n    }\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    strncpy(x, str, num + 1);\n    for (j = num + 1; j <= num + strlen(substr); j++) {\n      x[j] = substr[j - num - 1];\n    }\n\n    for (j = num + strlen(substr) + 1; j < strlen(substr) + strlen(str); j++) {\n      x[j] = str[j - strlen(substr)];\n    }\n    x[j] = '\\0';\n    cout << x << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36605", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid swap(char a[], int n) {\n  int i, j;\n  char t;\n  for (j = 0; j < n; j++)\n    for (i = 0; i < n - j - 1; i++)\n      if (a[i] < a[i + 1]) {\n        t = a[i];\n        a[i] = a[i + 1];\n        a[i + 1] = t;\n      }\n}\nint main() {\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    char m[100];\n    strcpy(m, s1);\n    int l = strlen(m);\n    swap(m, l);\n    int i, j, k;\n    for (i = 0; i < l; i++)\n      if (s1[i] == m[0]) {\n        j = i;\n        break;\n      }\n    for (k = 0; k <= j; k++)\n      printf(\"%c\", s1[k]);\n    printf(\"%s\", s2);\n    for (i = j + 1; i < l; i++)\n      printf(\"%c\", s1[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36606", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[100], b[100], c, d[100];\n  int i, j = 0, k;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = strlen(a);\n    j = 0;\n    for (i = 1, c = a[0]; i < k; i++)\n      if (c < a[i]) {\n        c = a[i];\n        j = i;\n      }\n    for (i = 0; i <= j; i++)\n      d[i] = a[i];\n    for (i = j + 1; i < k; i++)\n      d[i + 3] = a[i];\n    for (i = 0; i < 3; i++, j++)\n      d[j + 1] = b[i];\n    d[k + 3] = 0;\n    cout << d << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36607", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[20][13], str[3], S[20][13];\n  int i, j, k, n, max;\n  for (i = 1; (s[i][0] = getchar()) != EOF; i++) {\n    s[i][1] = '\u0000';\n\n    cin >> S[i];\n    strcat(s[i], S[i]);\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 1; s[i][j] != ' '; j++) {\n      if (s[i][j] > s[i][max])\n        max = j;\n    }\n\n    k = j - 1;\n    str[0] = s[i][k + 2];\n    str[1] = s[i][k + 3];\n    str[2] = s[i][k + 4];\n    for (j = k; j > max; j--)\n      s[i][j + 3] = s[i][j];\n    s[i][max + 1] = str[0];\n    s[i][max + 2] = str[1];\n    s[i][max + 3] = str[2];\n    for (j = 0; j <= k + 3; j++) {\n      printf(\"%c\", s[i][j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36608", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    p = 0;\n    str[s] = 97;\n    substr[3] = 97;\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    str[s + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36609", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, asc, n = 0;\n  char str[11], substr[4], *p;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    asc = *p;\n    for (i = 0; i < strlen(str); i++, p++) {\n      if (*p > asc) {\n        asc = *p;\n        n = i;\n      }\n    }\n    p = str;\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = n + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36610", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  int i, k, l;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    k = 0;\n    l = strlen(str);\n    max = str[0];\n    for (i = 1; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (i == k) {\n        printf(\"%c\", str[i]);\n        cout << substr;\n      } else\n        cout << str[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36611", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11];\n  char b[4];\n  char max;\n  int i = 0, j = 0, k = 0, m = 0, y = 0, temp;\n  for (i = 0; i < 11; i++) {\n    a[i] = '\\0';\n  }\n  while (scanf(\"%s \", a)) {\n    temp = 0;\n    scanf(\"%s \", b);\n    max = a[0];\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] > max) {\n        max = a[j];\n        temp = j;\n      }\n    }\n    for (k = 0; k <= temp; k++) {\n      cout << a[k];\n    }\n    for (m = 0; m < 3; m++)\n      cout << b[m];\n\n    for (y = temp + 1; y < strlen(a); y++) {\n      cout << a[y];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36612", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[11], s2[4];\n  int i, j, n, b;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1) - 1;\n    j = 0;\n    b = s1[0];\n    for (i = 0; i <= n - 1; i++) {\n      if (b < s1[i]) {\n        j = i;\n        b = s1[i];\n      }\n    }\n\n    for (i = 0; i <= j; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"%s\", s2);\n    while (j < n) {\n      printf(\"%c\", s1[j + 1]);\n      j++;\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36613", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid function_1(char *str, char *substr) {\n  int i, max, position;\n  for (i = 1, max = str[0], position = 0; str[i] != '\u0000'; i++)\n    if (str[i] > max) {\n      max = str[i];\n      position = i;\n    }\n  str[i + 3] = '\u0000';\n  for (i -= 1; i > position; i--)\n    str[i + 3] = str[i];\n  str[position + 1] = substr[0];\n  str[position + 2] = substr[1];\n  str[position + 3] = substr[2];\n}\n\nint main() {\n  char str[15], substr[4];\n  scanf(\"%s %s\", str, substr);\n  while (getchar() != EOF) {\n    function_1(str, substr);\n    printf(\"%s \", str);\n    scanf(\"%s %s\", str, substr);\n  }\n  return 1;\n}\n"}
{"label": "20", "index": "36614", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[22], b[4], max;\n  int i, imax, l1, l2;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    l1 = strlen(a);\n    l2 = strlen(b);\n    max = a[0];\n    imax = 0;\n    for (i = 1; i < l1; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        imax = i;\n      }\n    }\n    for (i = l1 - 1; i > imax; i--)\n      a[i + l2] = a[i];\n    a[l1 + l2] = '\\0';\n    for (i = 0; i < l2; i++)\n      a[imax + i + 1] = b[i];\n    puts(a);\n    \n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36615", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n, max;\n  char a[20], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    k = n - 1;\n    max = a[n - 1];\n    for (i = n - 1; i > 0; i--)\n      if (a[i - 1] >= max) {\n        max = a[i - 1];\n        k = i - 1;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%c%c%c\", b[0], b[1], b[2]);\n    for (i = k + 1; i <= n - 1; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36616", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char a[], int j) {\n  int i, k;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (a[i] > a[j]) {\n      return (0);\n    }\n  }\n  return (1);\n}\nvoid cha(char a[], char b[]) {\n  int i, k, j;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (max(a, i) == 1) {\n      for (j = 0; j < i + 1; j++)\n        cout << a[j];\n      for (j = 0; j < 3; j++)\n        printf(\"%c\", b[j]);\n      for (j = i + 1; j < k; j++)\n        printf(\"%c\", a[j]);\n      printf(\"\\n\");\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][11], substr[100][4], d;\n  int n = 0, i;\n  do {\n    if (n) {\n      for (i = 1;; i++) {\n        if ((d = getchar()) != ' ')\n          str[n][i] = d;\n        else {\n          str[n][i] = '\\0';\n          break;\n        }\n      }\n    } else {\n      scanf(\"%s\", str[n]);\n    }\n    scanf(\"%s\", substr[n]);\n    n++;\n    d = getchar();\n    str[n][0] = getchar();\n  } while (str[n][0] != EOF);\n  for (i = 0; i < n; i++) {\n    cha(str[i], substr[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36617", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[4], k;\n  int i, j, t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (k = i = 0; str[i] != 0; i++)\n      if (str[i] > k) {\n        k = str[i];\n        j = i;\n      }\n    for (t = i + 3; t > j + 3; t--)\n      str[t] = str[t - 3];\n    for (i = 0; i < 3; i++)\n      str[j + 1 + i] = substr[i];\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36618", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][11], substr[100][4];\n  int k, i = 0, j, m;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF) {\n    k = 0;\n    m = str[i][0];\n    for (j = 1; str[i][j]; j++)\n      if (str[i][j] > m) {\n        m = str[i][j];\n        k = j;\n      }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%s\", substr[i]);\n    for (; str[i][j]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n}\n"}
{"label": "20", "index": "36619", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, max, maxi;\n  char str[10], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = maxi = 0;\n    for (i = 0; str[i] != 0; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i <= maxi; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; str[i] != 0; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36620", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s, s1[100], s2[100], k = 0, j = 0, len, i, h;\n  int max = -2000;\n  while (scanf(\"%c\", &s) != EOF) {\n    if (s == '\\n') {\n      s2[j] = '\\0';\n      j = 0;\n      k = 0;\n      len = strlen(s1);\n      max = -2000;\n      for (h = 0; h < len; h++)\n        if (s1[h] > max) {\n          max = s1[h];\n          i = h;\n        }\n      for (h = 0; h <= i; h++)\n        printf(\"%c\", s1[h]);\n      printf(\"%s\", s2);\n      for (h = i + 1; h < len; h++)\n        printf(\"%c\", s1[h]);\n      printf(\"\\n\");\n    } else if (s == ' ') {\n      s1[j] = '\\0';\n      j = 0;\n      k = 1;\n    } else {\n      if (k) {\n        s2[j] = s;\n        j++;\n      } else {\n        s1[j] = s;\n        j++;\n      }\n    }\n  }\n  getchar();\n  getchar();\n  return 0;\n}\n"}
{"label": "20", "index": "36621", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid print(int a, int b, char d[]) {\n  int i;\n  for (i = a; i <= b; i++)\n    printf(\"%c\", d[i]);\n}\nint arrange(char a[]) {\n  int i, m = 0;\n  int t = a[0];\n  int l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36622", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, m, n, t, max;\n  char str1[100][50], str2[100][3];\n  i = 0;\n  while (scanf(\"%s%s\", str1[i], str2[i]) != EOF)\n    i++;\n\n  n = i;\n\n  for (i = 0; i < n; i++) {\n\n    m = 0;\n    t = strlen(str1[i]);\n    max = str1[i][0];\n    for (j = 1; j < t; j++) {\n\n      if (max < str1[i][j]) {\n        m = j;\n        max = str1[i][j];\n      }\n    }\n    for (j = 0; j <= m; j++)\n      printf(\"%c\", str1[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", str2[i][j]);\n    for (j = m + 1; j < t; j++)\n      printf(\"%c\", str1[i][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36623", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[11], b[4], c[15];\n  int j, l, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    max = 0;\n    j = 0;\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] > a[max])\n        max = j;\n    }\n    for (j = 0; j <= max; j++) {\n      c[j] = a[j];\n    }\n    for (j = 1; j <= 3; j++) {\n      c[j + max] = b[j - 1];\n    }\n    for (j = max + 1; j < l; j++) {\n      c[j + 3] = a[j];\n    }\n    c[l + 3] = '\\0';\n    puts(c);\n  }\n}\n"}
{"label": "20", "index": "36624", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[10];\n  char substr[4];\n  char str1[10];\n  char t;\n  int len, i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    strcpy(str1, str);\n    max = 0;\n    for (i = 1; i < len; i++)\n      if (str[i] > str[0]) {\n        max = i;\n        t = str[i];\n        str[i] = str[0];\n        str[0] = t;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str1[i]);\n    for (i = 0; i < 3; i++) {\n      cout << substr[i];\n    }\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36625", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  while (scanf(\"%s %s \", str, substr)) {\n    int size = 0;\n    for (int i = 0; i <= 10; i++) {\n      if (str[i] == '\\0') {\n        size = i;\n        break;\n      }\n    }\n    int tmp = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] > tmp) {\n        tmp = str[i];\n      }\n    }\n    int j = 0;\n    for (int i = 0; i < size; i++) {\n      if (str[i] == tmp) {\n        j = i;\n        break;\n      }\n    }\n    for (int i = 0; i <= j; i++) {\n      cout << str[i];\n    }\n    printf(\"%s\", substr);\n    if (j < size - 1) {\n      for (int i = j + 1; i < size; i++) {\n        cout << str[i];\n      }\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36626", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[12], b[4];\n  int i = 0, n, m = 0;\n  char c;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    c = a[0];\n    while (i < n) {\n      if (a[i] > c)\n        c = a[i], m = i;\n      i++;\n    }\n    i = 0;\n    while (i <= m) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    printf(\"%s\", b);\n    while (i < n) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    i = 0;\n    printf(\"\\n\");\n    m = 0;\n  }\n}\n"}
{"label": "20", "index": "36627", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, c;\n  char str[15], substr[4], x[20];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[c] < str[i]) {\n        c = i;\n      }\n    for (j = 0; j <= c; j++)\n      x[j] = str[j];\n    for (j = c + 1; j <= c + 3; j++)\n      x[j] = substr[j - c - 1];\n    if (c < n - 1)\n      for (j = c + 4; j < n + 3; j++)\n        x[j] = str[j - 3];\n    for (i = 0; i < n + 3; i++) {\n      putchar(x[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36628", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], finalstr[1000][13];\n  int n, i, j, l, k;\n  for (i = 0; scanf(\"%s%s\", str[i], substr[i]) != EOF; i++) {\n  }\n  n = i;\n  for (k = 0; k < n; k++) {\n    l = strlen(str[k]);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (str[k][i] < str[k][j])\n          break;\n      }\n      if (j == l)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      finalstr[k][j] = str[k][j];\n    for (j = 0; j < 3; j++)\n      finalstr[k][i + j + 1] = substr[k][j];\n    for (j = 1; j < l - i; j++)\n      finalstr[k][i + 3 + j] = str[k][i + j];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", finalstr[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36629", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j;\n  char a[13], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    int l = strlen(a);\n    int k = 0;\n    for (j = 0; j < l; j++) {\n      if (a[j] > a[k])\n        k = j;\n    }\n    j = 0;\n    while (j <= k) {\n      printf(\"%c\", a[j]);\n      j++;\n    }\n    printf(\"%s\", b);\n    while (j > k && j < l) {\n      printf(\"%c\", a[j]);\n      j++;\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36630", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], c;\n  int t, i, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    c = str[0];\n    t = 0;\n    l = strlen(str);\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > c) {\n        c = str[i];\n        t = i;\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = t + 1; i < l; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36631", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[100][15] = {'\u0000'};\n  int i, n, l, a, k, t;\n  i = 0;\n  do {\n    cin >> s[i];\n    i++;\n  } while (s[i - 1][0] != '\u0000');\n  n = i - 2;\n  for (i = 0; i <= n; i++) {\n    l = strlen(s[i]);\n    a = s[i][0];\n    for (k = 1; k < l - 4; k++) {\n      if (s[i][k] > a) {\n        a = s[i][k];\n        t = k;\n      }\n    }\n    for (k = 0; k <= t; k++)\n      printf(\"%c\", s[i][k]);\n    for (k = l - 3; k <= l - 1; k++)\n      printf(\"%c\", s[i][k]);\n    for (k = t + 1; k < l - 4; k++)\n      printf(\"%c\", s[i][k]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36632", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[15], s2[4], s3[20], s4[20], max;\n  int i, j, k, n1, n2;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n\n    n1 = strlen(s1);\n    n2 = strlen(s2);\n\n    strcpy(s3, \" \");\n    strcpy(s4, \" \");\n    max = s1[0];\n    for (i = 0, k = 0; i < n1; i++) {\n      if (s1[i] > max) {\n        max = s1[i];\n        k = i;\n      }\n    }\n\n    strncpy(s3, s1, k + 1);\n    s3[k + 1] = '\\0';\n    strcat(s3, s2);\n\n    for (i = k + 1, j = 0; s1[i] != '\\0'; i++, j++) {\n      s4[j] = s1[i];\n    }\n    s4[j] = '\\0';\n    strcat(s3, s4);\n    printf(\"%s\\n\", s3);\n  }\n}\n"}
{"label": "20", "index": "36633", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a, b, i, j, k, m, n;\n  char s[12], sb[4], x[20];\n  while (scanf(\"%s %s\", s, sb) != EOF) {\n    m = 0;\n    a = strlen(s);\n    for (i = 1; i < a; i++) {\n      if (s[i] > s[m]) {\n        m = i;\n      }\n    }\n    for (i = 0; i < m + 1; i++) {\n      x[i] = s[i];\n    }\n    x[m + 1] = sb[0];\n    x[m + 2] = sb[1];\n    x[m + 3] = sb[2];\n    for (i = m + 4; i < a + 4; i++) {\n      x[i] = s[i - 3];\n    }\n    for (i = 0; i < a + 3; i++) {\n      printf(\"%c\", x[i]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36634", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, w;\n  char a[10][15], b[10][15], d[10][15];\n  for (i = 0; i < 10; i++)\n    for (j = 0; j < 15; j++) {\n      a[i][j] = '\\0';\n      b[i][j] = '\\0';\n      d[i][j] = '\\0';\n    }\n  for (i = 0; scanf(\"%s %s\", a[i], b[i]) != EOF; i++) {\n    n = strlen(a[i]);\n    for (k = 0, m = 0; k < n - 1; k++) {\n      if (a[i][m] < a[i][k + 1])\n        m = k + 1;\n    }\n    for (k = n - 1; k > m; k--)\n      a[i][k + 3] = a[i][k];\n    for (k = m + 1, w = 0; k != m + 4; k++, w++)\n      a[i][k] = b[i][w];\n    puts(a[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36635", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[14] = {' '};\n  char b[4] = {' '};\n  while (cin.get(a, 11, ' ')) {\n    cin.get();\n    cin.get(b, 4, '\\n');\n    int k = 0;\n    char max = NULL;\n    for (int j = 0; j < strlen(a); j++)\n      if (a[j] > max) {\n        max = a[j];\n        k = j;\n      }\n    for (int i = strlen(a) - 1; i > k; i--)\n      a[i + 3] = a[i];\n    a[k + 1] = b[0];\n    a[k + 2] = b[1];\n    a[k + 3] = b[2];\n    printf(\"%s\\n\", a);\n    for (int p = 0; p < 14; p++)\n      a[p] = '\\n';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36636", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {0};\n  for (j = 0;; j++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    cout << str[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36637", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar *strInsert(char *str, int n, const char *strIn) {\n  int l = strlen(strIn);\n  int i;\n  for (i = strlen(str); i > n; i--)\n    *(str + i + l) = *(str + i);\n  for (i = 0; i < l; i++)\n    *(str + n + 1 + i) = *(strIn + i);\n  return str;\n}\nint main() {\n  char str[15], substr[4];\n  int i, max;\n  short flag;\n  do {\n    flag = scanf(\"%s %s\", str, substr);\n    if (flag < 2)\n      break;\n    max = 0;\n    for (i = 1; i < strlen(&str[0]); i++) {\n      if (*(str + i) > *(str + max)) {\n        max = i;\n      }\n    }\n    puts(strInsert(str, max, substr));\n  } while (getchar() != EOF);\n}\n"}
{"label": "20", "index": "36638", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char str[11], substr[4];\n  int i, j, max = 0, len;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (j = 0; j < len; j++) {\n      if (str[max] < str[j + 1])\n        max = j + 1;\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == max)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36639", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5];\n  int i, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 0, p = 0; i < strlen(str); i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = p + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36640", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char str[500], sub[4], *st = str, *su = sub, c;\n  while (scanf(\"%s%s\", str, sub)) {\n    k = strlen(str);\n    if (k == 0)\n      break;\n    c = *st;\n    j = 0;\n    for (i = 0; i < k; i++) {\n      if (*(st + i) > c) {\n        c = *(st + i);\n        j = i;\n      }\n    }\n    for (i = k; i > j; i--)\n      *(st + i + 3) = *(st + i);\n    for (i = 1; i < 4; i++)\n      *(st + j + i) = *(su + i - 1);\n    printf(\"%s\\n\", st);\n    *st = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36641", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n\n    cin.getline(str, 11, ' ');\n    cin >> substr;\n\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36642", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint findmax(char a[15]) {\n  int maxnum = 0, max;\n  max = a[0];\n  int i, len;\n  len = strlen(a);\n  int comp;\n  comp = a[0];\n  for (i = 0; i < len - 1; i++) {\n    if (a[i + 1] > max) {\n      maxnum = i + 1;\n      max = a[i + 1];\n    }\n  }\n  return maxnum;\n}\n\nint main() {\n  int lstr, mnum;\n  int i;\n  char str[15] = {0}, substr[5] = {0};\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    mnum = findmax(str);\n    lstr = strlen(str);\n    for (i = lstr - 1; i > mnum; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 0; i < 3; i++)\n      str[mnum + i + 1] = substr[i];\n    cout << str << \"\\n\";\n    for (i = 0; i < 15; i++)\n      str[i] = 0;\n    for (i = 0; i < 3; i++)\n      substr[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36643", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid p_s(char str[], char substr[]) {\n  int i, n, len;\n  char s[13] = {\"\\0\"};\n  len = strlen(str);\n  for (i = 0, n = 0; i < len; i++)\n    if (str[n] < str[i])\n      n = i;\n  for (i = 0; i < len + 3; i++)\n    s[i] = i <= n ? str[i] : (i <= n + 3 ? substr[i - n - 1] : str[i - 3]);\n  printf(\"%s\\n\", s);\n}\nint main() {\n  int i, j;\n  char str[10][10], substr[10][3];\n  for (i = 0; scanf(\"%s %s\", str[i], substr[i]) != EOF; i++)\n    ;\n  for (j = 0; j < i; j++) {\n    p_s(str[j], substr[j]);\n  }\n}\n"}
{"label": "20", "index": "36644", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar string_1[13];\nvoid f(char str[], char substr[]);\nint main() {\n  int i;\n  char str[10], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    f(str, substr);\n    for (i = 0; i < strlen(str) + 3; i = i + 1)\n      cout << string_1[i];\n    cout << \" \";\n  }\n}\nvoid f(char str[10], char substr[4]) {\n  int i, j, k, t;\n  char max;\n  max = str[0];\n  k = 0;\n  t = strlen(str);\n  for (i = 1; i < t; i = i + 1) {\n    if (str[i] > max) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i = i + 1) {\n    string_1[i] = str[i];\n  }\n  j = 0;\n  for (i = k + 1; i <= k + 3; i = i + 1) {\n    string_1[i] = substr[j];\n    j = j + 1;\n  }\n  if (k < t - 1) {\n    j = k + 1;\n    for (i = k + 4; i < t + 3; i = i + 1) {\n      string_1[i] = str[j];\n      j = j + 1;\n    }\n  }\n}\n"}
{"label": "20", "index": "36645", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p, max;\n  while (scanf(\"%s %s\", str, substr) != EOF) \n  {\n    s = strlen(str);\n    max = str[0];\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = i;\n      }\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    for (i = 0; i <= s + 2; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36646", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, b, a;\n  char max;\n  char str[100][10];\n  char substr[100][3];\n  while ((scanf(\"%s %s\", str[n], substr[n])) != EOF) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    k = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < k; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        b = j;\n      }\n    }\n    for (a = 0; a <= b; a++) {\n      cout << str[i][a];\n    }\n    for (a = 0; a < 3; a++) {\n      cout << substr[i][a];\n    }\n    for (a = b + 1; a < k; a++) {\n      printf(\"%c\", str[i][a]);\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36647", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[12], b[4];\n  int i = 0, n, m = 0;\n  char c;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    c = a[0];\n    while (i < n) {\n      if (a[i] > c)\n        c = a[i], m = i;\n      i++;\n    }\n    i = 0;\n    while (i <= m) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    printf(\"%s\", b);\n    while (i < n) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    i = 0;\n    cout << \"\\n\";\n    m = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36648", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, max = 0, mark, i, j;\n  char str[14], substr[4];\n  while (cin >> str >> substr) {\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        mark = i;\n      }\n    }\n    max = 0;\n    for (i = len - 1; i > mark; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = mark + 1, j = 0; i < mark + 4; i++, j++)\n\n      str[i] = substr[j];\n\n    for (i = 0; i < len + 3; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36649", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[11], substr[4];\n  int i, j, max = 0, len;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (j = 0; j < len; j++) {\n      if (str[max] < str[j + 1])\n        max = j + 1;\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == max)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36650", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], sub[4], m;\n  int d, i, l;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    l = strlen(str);\n    m = 0;\n    for (i = 0; i < l; i++) {\n      if (str[i] - m > 0) {\n        d = i;\n        m = str[i];\n      }\n    }\n    for (i = l - 1; i > d; i--)\n      str[i + 3] = str[i];\n    for (i = 0; i < 3; i++)\n      str[i + d + 1] = sub[i];\n    str[l + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36651", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, max;\n  char a[20], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    k = n - 1;\n    max = a[n - 1];\n    for (i = n - 1; i > 0; i--)\n      if (a[i - 1] >= max) {\n        max = a[i - 1];\n        k = i - 1;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%c%c%c\", b[0], b[1], b[2]);\n    for (i = k + 1; i <= n - 1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36652", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char s1[300], s2[300];\n  int l1, max, p, i;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l1 = strlen(s1);\n    max = 0;\n    p = 0;\n    for (i = 0; i < l1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        p = i;\n      }\n    for (i = 0; i < l1; i++) {\n      printf(\"%c\", s1[i]);\n      if (p == i)\n        printf(\"%s\", s2);\n    }\n\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36653", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int max, i, k;\n  char str1[20], str2[20];\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; *(str1 + i) != '\\0'; i++)\n      if (*(str1 + i) > max) {\n        max = *(str1 + i);\n        k = i;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", *(str1 + i));\n    cout << str2;\n    for (i = k + 1; *(str1 + i) != '\\0'; i++)\n      printf(\"%c\", *(str1 + i));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36654", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[1000][100], substr[1000][300];\n  int i = 0, j, max, m;\n  char a;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF)\n    i++;\n  m = i;\n  for (i = 0; i < m; i++) {\n    a = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > a) {\n        a = str[i][j];\n        max = j;\n      }\n    }\n    for (j = 0; j <= max; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[i][j]);\n    for (j = max + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36655", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid output(int len, char inp[1000]) {\n  char lin1[10][10], lin2[10][3], lin3[10][13];\n  int i, j = 0, k = 0, ma = 0;\n  int max[10];\n  int lenm[10];\n  for (i = 0; i < 10; i++)\n    max[i] = 0;\n  for (i = 0; i < len; i++) {\n    if (inp[i] != 32) {\n      if (ma == 0) {\n        lenm[k] = 0;\n        for (j = 0; inp[i] != 32 && i < len; i++, j++) {\n          lin1[k][j] = inp[i];\n          lenm[k]++;\n        }\n        ma = 1;\n        continue;\n      }\n      if (ma == 1) {\n        for (j = 0; j < 3; i++, j++)\n          lin2[k][j] = inp[i];\n        ma = 0;\n        k++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    max[i] = lin1[i][0];\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < lenm[i]; j++)\n      if (lin1[i][j] > max[i]) {\n        max[i] = lin1[i][j];\n      }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i]; j++) {\n      lin3[i][j] = lin1[i][j];\n      if (lin1[i][j] == max[i]) {\n        lin3[i][j + 1] = lin2[i][0];\n        lin3[i][j + 2] = lin2[i][1];\n        lin3[i][j + 3] = lin2[i][2];\n        for (j = j + 1; j < lenm[i]; j++)\n          lin3[i][j + 3] = lin1[i][j];\n        break;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i] + 3; j++)\n      printf(\"%c\", lin3[i][j]);\n    printf(\" \");\n  }\n}\n\nint main() {\n  int len[100], i, j;\n  char inp[100][100];\n  for (i = 0; i < 100; i++) {\n\n    cin >> inp[i];\n    len[i] = strlen(inp[i]);\n    if (len[i] == 0)\n      break;\n  }\n  j = i;\n  for (i = 0; i < j; i++)\n    output(len[i], inp[i]);\n}\n"}
{"label": "20", "index": "36656", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], k = 0, j = 0, len, i, h;\n  int max = -2000;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    len = strlen(s1);\n    max = -2000;\n    for (h = 0; h < len; h++)\n      if (s1[h] > max) {\n        max = s1[h];\n        i = h;\n      }\n    for (h = 0; h <= i; h++)\n      printf(\"%c\", s1[h]);\n    printf(\"%s\", s2);\n    for (h = i + 1; h < len; h++) {\n      cout << s1[h];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36657", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[20] = {0}, b[4] = {0}, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n\n    int n, i, maxnum;\n\n    n = strlen(a);\n    maxnum = 0;\n    max = a[0];\n    for (i = 0; i < n; i++) {\n      if (max < a[i]) {\n        max = a[i];\n        maxnum = i;\n      }\n    }\n\n    for (i = n; i > maxnum; i--) {\n      a[i + 3] = a[i];\n    }\n    for (i = 0; i < 3; i++)\n      a[maxnum + 1 + i] = b[i];\n    cout << a << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36658", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s1, s2, i, j, t, max;\n  char str[20], substr[5], a[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    s1 = strlen(str);\n    s2 = strlen(substr);\n    max = 0;\n    for (i = 0; i < s1; i++)\n      if (max < str[i]) {\n        max = str[i];\n        t = i;\n      }\n    j = 0;\n    for (i = t + 1; i < s1; i++) {\n      a[j] = str[i];\n      j++;\n    }\n    j = 0;\n    for (i = t + 1; i < t + s2 + 1; i++) {\n      str[i] = substr[j];\n      j++;\n    }\n    j = 0;\n    for (i = t + s2 + 1; i < s1 + s2; i++) {\n      str[i] = a[j];\n      j++;\n    }\n    for (i = 0; i < s1 + s2 - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[s1 + s2 - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36659", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, m, len[100];\n  char a[100][19], str[100][10], substr[100][3], max;\n  for (i = 0; i < 100; i++)\n    for (j = 0; j < 19; j++)\n      a[i][j] = '\u0000';\n\n  scanf(\"%s \", a);\n  for (i = 1;; i++) {\n    if (strlen(a[i - 1]) == 0)\n      break;\n    else {\n\n      cin >> a[i];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(a[i]);\n    a[i][len[i] - 4] = '\u0000';\n    substr[i][0] = a[i][len[i] - 3];\n    substr[i][1] = a[i][len[i] - 2];\n    substr[i][2] = a[i][len[i] - 1];\n  }\n\n  for (i = 0; i < n; i++) {\n    max = 0;\n    for (j = 0; a[i][j] != '\u0000'; j++)\n      max = max > a[i][j] ? max : a[i][j];\n    for (j = 0; a[i][j] != max; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\"%c\", max);\n    for (k = 0; k < 3; k++)\n      printf(\"%c\", substr[i][k]);\n\n    j++;\n    for (; a[i][j] != '\u0000'; j++)\n      printf(\"%c\", a[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36660", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n\n    cin.getline(str, 11, ' ');\n    cin >> substr;\n\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      printf(\"%c\", str[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36661", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], c, substr[8];\n  int n, max, i;\n  while (1) {\n    max = 0;\n    c = getchar();\n    if (c == '\\n')\n      c = getchar();\n    if (c == EOF)\n      break;\n    else {\n      scanf(\"%s%s\", &str, &substr);\n      n = strlen(str);\n      for (i = n - 1; i >= 0; i--)\n        str[i + 1] = str[i];\n      str[0] = c;\n      str[++n] = 0;\n      for (i = 1; i < n; i++)\n        if (str[i] > str[max])\n          max = i;\n      for (i = 0; i <= max; i++)\n        printf(\"%c\", str[i]);\n      printf(\"%c%c%c\", substr[0], substr[1], substr[2]);\n      for (; i < n; i++)\n        printf(\"%c\", str[i]);\n      putchar('\\n');\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36662", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[4], *p;\n  int i, n, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    p = &str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (*p < str[i]) {\n        p = &str[i];\n        j = i;\n      }\n    for (i = n - 1; i > j; i--) {\n      str[i + 3] = str[i];\n    }\n    *(p + 1) = substr[0];\n    *(p + 2) = substr[1];\n    *(p + 3) = substr[2];\n    str[n + 3] = '\\0';\n\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36663", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[22], b[4], c[11], d[11];\n  int s1, s2, i, j;\n  scanf(\"%s%s\", a, b);\n  do {\n\n    s1 = strlen(a);\n    s2 = strlen(b);\n    for (i = 0; i < s1; i++) {\n      int num = 0;\n      for (j = 0; j < s1; j++) {\n        if ((int)a[j] <= (int)a[i])\n          num++;\n      }\n      if (num == s1) {\n        for (j = 0; j <= i; j++)\n          c[j] = a[j];\n\n        c[i + 1] = '\u0000';\n        for (j = i + 1; j < s1; j++)\n          d[j - i - 1] = a[j];\n\n        d[s1 - i - 1] = '\u0000';\n        strcat(c, b);\n        strcat(c, d);\n        printf(\"%s \", c);\n        break;\n      }\n    }\n\n  } while (scanf(\"%s%s\", a, b) != EOF);\n}\n"}
{"label": "20", "index": "36664", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, max, t;\n  char str1[100], str2[5], *p1, *p2, *p0;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    n = strlen(str1);\n    p1 = str1;\n    max = 0;\n    for (; p1 < str1 + n; p1++) {\n      if (*p1 > max) {\n        max = *p1;\n        p0 = p1;\n      }\n    }\n    p2 = str2;\n    p1 = str1;\n    t = 1;\n    for (; p1 < str1 + n; p1++) {\n      printf(\"%c\", *p1);\n      if (*p1 == max && t) {\n        printf(\"%c%c%c\", *p2, *(p2 + 1), *(p2 + 2));\n        t = 0;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36665", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p;\n  int i, j, m;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    m = 0;\n    p = &str[0];\n    for (i = 1; *(p + i) != '\\0'; i++) {\n      if (*(p + i) > *(p + m))\n        m = i;\n    }\n    for (j = 0; j <= m; j++)\n      cout << str[j];\n    printf(\"%s\", substr);\n    for (j = m + 1; *(p + j) != '\\0'; j++)\n      printf(\"%c\", str[j]);\n\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36666", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  for (;;) {\n    char str[11], substr[4], combine[15] = {0};\n    if (scanf(\"%s%s\", str, substr) == EOF)\n      break;\n    n = strlen(str);\n    m = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] - str[m] > 0)\n        m = i;\n    }\n    for (i = 0; i <= m; i++) {\n      combine[i] = str[i];\n    }\n\n    for (i = 1; i <= 3; i++) {\n      combine[m + i] = substr[i - 1];\n    }\n    for (i = 1; i <= n - m - 1; i++) {\n      combine[m + 3 + i] = str[m + i];\n    }\n    puts(combine);\n  }\n}\n"}
{"label": "20", "index": "36667", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10] = {0}, substr[5] = {0};\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", substr);\n    int i, k, u;\n    for (u = 0; u <= 9; u++) {\n      if (!str[u])\n        break;\n    }\n    k = 0;\n    for (i = 1; i <= u - 1; i++) {\n      if (str[k] < str[i]) {\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", substr[i]);\n    for (i = k + 1; i <= u - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36668", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, max = 0, mark, i, j;\n  char str[14], substr[4];\n  while (cin >> str >> substr) {\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        mark = i;\n      }\n    }\n    max = 0;\n    for (i = len - 1; i > mark; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = mark + 1, j = 0; i < mark + 4; i++, j++) {\n      str[i] = substr[j];\n    }\n    for (i = 0; i < len + 3; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36669", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint MAX(char str[], int len) {\n  int i, max, temp;\n  max = 0;\n  for (i = 1; i < len; i++) {\n    if (str[max] < str[i]) {\n      temp = max;\n      max = i;\n      i = temp;\n    }\n  }\n  return (max);\n}\nint main() {\n  char str[10], substr[3];\n  int stop, len, i;\n  for (;;) {\n    stop = scanf(\"%s %s\", str, substr);\n    if (stop != 2)\n      break;\n    len = strlen(str);\n    for (i = 0; i <= MAX(str, len); i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = MAX(str, len) + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36670", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[15], s2[4], max;\n  int i, j, len, k;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    len = strlen(s1);\n    k = 0;\n    max = s1[0];\n    for (j = 1; j < len; j++) {\n      if (max < s1[j]) {\n        max = s1[j];\n        k = j;\n      }\n    }\n    for (j = len + 2; j > k + 3; j--)\n      s1[j] = s1[j - 3];\n    for (j = k + 1, i = 0; j < k + 4; j++, i++)\n      s1[j] = s2[i];\n    s1[len + 3] = '\\0';\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36671", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar max(char ch[], int len) {\n  int i;\n  char t;\n  for (i = 0; i < len - 1; i++)\n    if (ch[i] > ch[i + 1]) {\n      t = ch[i];\n      ch[i] = ch[i + 1];\n      ch[i + 1] = t;\n    }\n  return ch[len - 1];\n}\nint main() {\n  char str[20], sub[4], x[20], m;\n  int len, i;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    len = strlen(str);\n    strcpy(x, str);\n    m = max(x, len);\n    i = 0;\n    do {\n      printf(\"%c\", str[i]);\n      i++;\n    } while (str[i] != m);\n    printf(\"%c\", str[i]);\n    printf(\"%s\", sub);\n    for (++i; i < len; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36672", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char nul = '0';\n  a = strlen(str);\n  for (i = 0; i < a - 4; i++) {\n    if (str[i] > nul) {\n      nul = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a[100], length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a[i] = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a[i] + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a[i] && j < a[i] + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a[i]];\n      else if (j > a[i] + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str1[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36673", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char a[11], b[3], c[14];\n  for (j = 0; j < 10; j++) {\n    for (i = 0; i < 11; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 3; i++)\n      b[i] = '\\0';\n    for (i = 0; i < 14; i++)\n      c[i] = '\\0';\n    scanf(\"%s \", a);\n    scanf(\"%s\", b);\n    for (i = 0, n = 0; a[i] != '\\0'; i++)\n      if (a[i] > a[n])\n        n = i;\n    strncpy(c, a, n + 1);\n    c[n + 1] = b[0];\n    c[n + 2] = b[1];\n    c[n + 3] = b[2];\n    for (i = n + 1; a[i] != '\\0'; i++)\n      c[i + 3] = a[i];\n    printf(\"%s\\n\", c);\n  }\n}\n"}
{"label": "20", "index": "36674", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l = 0, m = 0, i = 0;\n  char str[20], sub[5];\n\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    l = strlen(str);\n\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[m])\n        m = i;\n    }\n\n    for (i = l + 2; i >= m + 4; i--) {\n      str[i] = str[i - 3];\n    }\n\n    str[m + 1] = sub[0];\n    str[m + 2] = sub[1];\n    str[m + 3] = sub[2];\n    str[l + 3] = '\\0';\n\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36675", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *index, *i;\n  int max;\n  char str1[100], str2[5];\n  while (scanf(\"%s%s\", &str1, &str2) != EOF) {\n    max = 0;\n    for (i = str1; *i != '\\0'; i++)\n      if (*i > max)\n        max = *i, index = i;\n    for (i = str1; i <= index; i++)\n      printf(\"%c\", *i);\n    printf(\"%s\", str2);\n    for (i = index + 1; *i != '\\0'; i++)\n      printf(\"%c\", *i);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36676", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char mid, a[100][50];\n  int i = 0, j = 0, k = 0, m, b[100];\n  do {\n\n    cin >> a[i];\n    b[i] = strlen(a[i]);\n    i++;\n  } while (a[i - 1][0] != '\u0000');\n\n  m = i - 1;\n\n  for (i = 0; i < m; i++) {\n    k = 0;\n    mid = a[i][0];\n    for (j = 1; j < b[i] - 4; j++) {\n      if (a[i][j] > mid) {\n        mid = a[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    for (j = b[i] - 3; j < b[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    for (j = k + 1; j < b[i] - 4; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36677", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, asc, n = 0;\n  char str[11], substr[4], *p;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    asc = *p;\n    for (i = 0; i < strlen(str); i++, p++) {\n      if (*p > asc) {\n        asc = *p;\n        n = i;\n      }\n    }\n    p = str;\n    for (i = 0; i <= n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (i = n + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36678", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nchar *findmax(char *p) {\n  char *max;\n  for (max = p; *p != '\\0'; p++)\n    if (*p > *max)\n      max = p;\n  return max;\n}\n\nvoid insert(char *op, char *sp) {\n  char *np;\n  np = (char *)malloc(1000);\n  char *t = np;\n  char *temp;\n  char *temp2;\n\n  for (temp = op; *temp != *findmax(op); temp++, np++)\n    *np = *temp;\n  temp2 = temp;\n  *np = *temp;\n  np++;\n\n  for (temp = sp; *sp != '\\0'; np++, sp++)\n    *np = *sp;\n\n  for (temp = temp2 + 1; *temp != '\\0'; np++, temp++)\n    *np = *temp;\n\n  *np = '\\0';\n  while (*t != '\\0') {\n    printf(\"%c\", *t);\n    t++;\n  }\n\n  printf(\"\\n\");\n}\n\nint main() {\n  char ori[10], sub[3], newstr[13];\n  char *orip = ori, *subp = sub, *newstrp = newstr;\n  while (scanf(\"%s %s\", ori, sub) != EOF) {\n\n    insert(orip, subp);\n  }\n}\n"}
{"label": "20", "index": "36679", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100][15] = {'\\0'}, s2[100][4];\n  int i = 0, j, max, k, u;\n  while (scanf(\"%s%s\\n\", &s1[i], &s2[i]) != EOF)\n    i++;\n  for (j = 0; j <= i; j++) {\n    max = 0;\n    k = 1;\n    while (s1[j][k] != '\\0') {\n      if (s1[j][k] > s1[j][max])\n        max = k;\n      k++;\n    }\n    for (u = k - 1; u > max; u--) {\n      s1[j][u + 3] = s1[j][u];\n    }\n    s1[j][max + 1] = s2[j][0];\n    s1[j][max + 2] = s2[j][1];\n    s1[j][max + 3] = s2[j][2];\n    s1[j][k + 3] = '\\n';\n    printf(\"%s\", s1[j]);\n  }\n}\n"}
{"label": "20", "index": "36680", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p;\n  while (cin >> str) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p)\n        max = p;\n    for (p = str; p <= max; p++)\n      cout << *p;\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36681", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i;\n  char str[10] = {0}, substr[3] = {0}, m = 0;\n\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = 0;\n    n = 0;\n\n    for (i = 0; i < 10; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        n = i;\n      }\n    }\n\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = n + 1; i < strlen(str); i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36682", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, k = 0, n;\n  char a;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    n = strlen(str);\n    a = str[0];\n    for (i = 0;; i++) \n    {\n      if (str[i] == '\\0')\n        break;\n      if (str[i] > a) {\n        a = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", substr[i]);\n    for (i = k + 1; i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36683", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[3], c, max;\n  int j, t, l;\n\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    l = strlen(a);\n    max = a[0];\n    for (j = 0; j <= l - 1; j++) {\n      if ((int)a[j] > (int)max) {\n        max = a[j];\n        t = j;\n      }\n    }\n    for (j = 0; j <= t; j++)\n      printf(\"%c\", a[j]);\n    printf(\"%s\", b);\n    for (j = t + 1; j <= l - 1; j++)\n      printf(\"%c\", a[j]);\n    printf(\"\\n\");\n  }\n  while ((c = getchar()) != EOF)\n    ;\n}\n"}
{"label": "20", "index": "36684", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][11], substr[100][4];\n  int k, i = 0, j, m;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF) {\n    k = 0;\n    m = str[i][0];\n    for (j = 1; str[i][j]; j++)\n      if (str[i][j] > m) {\n        m = str[i][j];\n        k = j;\n      }\n    for (j = 0; j <= k; j++)\n      cout << str[i][j];\n    cout << substr[i];\n    for (; str[i][j]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n}\n"}
{"label": "20", "index": "36685", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], t;\n  int n, m, i, j;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    n = strlen(s2);\n    j = 0;\n    t = s1[0];\n    for (i = 1; i < m; i++) {\n      if (s1[i] > t) {\n        j = i;\n        t = s1[i];\n      }\n    }\n    for (i = 0; i <= m - j - 1; i++)\n      s1[n + m - i] = s1[m - i];\n    for (i = 0; i < n; i++)\n      s1[j + 1 + i] = s2[i];\n    for (i = 0; i < m + n; i++)\n      printf(\"%c\", s1[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36686", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void insert(char *a, char *b);\n  char str[14], substr[3];\n  while (scanf(\"%s\", str) != -1) {\n    scanf(\"%s\", substr);\n    insert(str, substr);\n  }\n}\n\nvoid insert(char *a, char *b) {\n  int i, n = 0, m = 1, la, lb;\n  char c[14] = {'\\0'};\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 1; i < la; i++)\n    if (*(a + i) > *(a + m - 1))\n      m = i + 1;\n  for (i = 0; i < la - m; i++) {\n    c[i] = *(a + m + i);\n    *(a + m + i) = '\\0';\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\n"}
{"label": "20", "index": "36687", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid print(int a, int b, char d[]) {\n  int i;\n  for (i = a; i <= b; i++)\n    printf(\"%c\", d[i]);\n}\nint arrange(char a[]) {\n  int i, m = 0;\n  int t = a[0];\n  int l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (a[i] > t) {\n      m = i;\n      t = a[i];\n    }\n  return m;\n}\nint main() {\n  char a[11], c[4];\n  while (scanf(\"%s%s\", a, c) != EOF) {\n    int l1 = strlen(a), l2 = strlen(c);\n    int m = arrange(a);\n    print(0, m, a);\n    print(0, l2 - 1, c);\n    print(m + 1, l1 - 1, a);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36688", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c[10], s[4];\n  int k, x;\n  char p;\n  while (scanf(\"%s %s\", c, s) != EOF) {\n    for (k = 0, p = '0'; k < 10 && (c[k]) != '\\0'; k++) {\n      if (p < c[k]) {\n        p = c[k];\n        x = k;\n      }\n    }\n    for (k = 0; k <= x; k++) {\n      printf(\"%c\", c[k]);\n    }\n    for (k = 0; k < 4 && (s[k] != '\\0'); k++) {\n      printf(\"%c\", s[k]);\n    }\n    for (k = x + 1; k < 10 && (c[k] != '\\0'); k++) {\n      printf(\"%c\", c[k]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36689", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int max = 0, i, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    for (i = 0; i < l; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = l - 1; i >= max + 1; i--)\n      str[i + 3] = str[i];\n    for (i = 1; i <= 3; i++)\n      str[max + i] = substr[i - 1];\n    str[l + 3] = 0;\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36690", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int m, i, l;\n  char s[100], sub[10] = {0};\n  while (scanf(\"%s%s\", s, sub) != EOF) {\n    l = strlen(s);\n    m = 0;\n    for (i = 1; i < l; i++) {\n      if (s[i] > s[m])\n        m = i;\n    }\n    for (i = l + 3; i > m + 3; i--) {\n      s[i] = s[i - 3];\n    }\n    s[m + 1] = sub[0];\n    s[m + 2] = sub[1];\n    s[m + 3] = sub[2];\n    printf(\"%s\\n\", s);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36691", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], sub[4], a[11], b;\n  int n, m, t;\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    m = 0;\n    b = str[0];\n    for (n = 1; str[n] != '\\0'; n++)\n      if (str[n] > b) {\n        b = str[n];\n        m = n;\n      }\n    for (n = m + 1, t = 0; str[n] != '\\0'; n++, t++)\n      a[t] = str[n];\n    a[t] = '\\0';\n    str[m + 1] = '\\0';\n    printf(\"%s%s%s\\n\", str, sub, a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36692", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len;\n  char a[10] = {0}, b[3] = {0}, c[10] = {0};\n  while (cin >> a) {\n    int i, temp = 0;\n    for (i = 0; i < 10; i++)\n      c[i] = a[i];\n    len = strlen(a);\n\n    for (i = 0; i < len; i++) {\n      if (a[temp] - a[i] < 0)\n        temp = i;\n    }\n    for (i = 0; i <= temp; i++) {\n      cout << c[i];\n    }\n    getchar();\n    cin >> b;\n    cout << b[0] << b[1] << b[2];\n    for (i = temp + 1; i < len; i++)\n      cout << c[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36693", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void f(char *p, char *q, int m);\n  char s[12], c[10], sub[4];\n  int i, k = 0;\n  while (scanf(\"%s %s\", s, sub) != EOF) {\n    for (i = 0; s[i] != '\\0'; i++) {\n      if (s[i] > s[k])\n        k = i;\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", s[i]);\n    }\n    printf(\"%s\", sub);\n    f(s, c, k + 1);\n    puts(c);\n  }\n  return 0;\n}\n\nvoid f(char *p, char *q, int m) {\n  int n;\n  n = 0;\n  while (n < m) {\n    n++;\n    p++;\n  }\n  while (*p != '\\0') {\n    *q = *p;\n    p++;\n    q++;\n  }\n  *q = '\\0';\n}\n"}
{"label": "20", "index": "36694", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char s1[], char s2[]) {\n  int i, k = 0, j, l;\n  char s[13];\n  l = strlen(s1);\n  for (i = 1; i < l; i++)\n    if (s1[i] > s1[k])\n      k = i;\n  for (i = 0; i <= k; i++)\n    s[i] = s1[i];\n  for (j = 0; j < 3; j++)\n    s[i + j] = s2[j];\n  for (j = i; j < l; j++)\n    s[j + 3] = s1[j];\n  s[j + 3] = '\\0';\n  cout << s << \"\\n\";\n}\nint main() {\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF)\n    insert(s1, s2);\n  return 0;\n}\n"}
{"label": "20", "index": "36695", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[13], substr[3];\n  int s, i, j, p, max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    s = strlen(str);\n    max = str[0];\n    for (i = 0; i <= s - 1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = i;\n      }\n    for (i = s; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1, j = 0; j <= 2; i++, j++)\n      str[i] = substr[j];\n    for (i = 0; i <= s + 2; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36696", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, m = 0, n, w;\n  char a[10][15], b[10][15], d[10][15];\n  for (i = 0; i < 10; i++)\n    for (j = 0; j < 15; j++) {\n      a[i][j] = '\\0';\n      b[i][j] = '\\0';\n      d[i][j] = '\\0';\n    }\n  for (i = 0; scanf(\"%s %s\", a[i], b[i]) != EOF; i++) {\n    n = strlen(a[i]);\n    for (k = 0, m = 0; k < n - 1; k++) {\n      if (a[i][m] < a[i][k + 1])\n        m = k + 1;\n    }\n    for (k = n - 1; k > m; k--)\n      a[i][k + 3] = a[i][k];\n    for (k = m + 1, w = 0; k != m + 4; k++, w++)\n      a[i][k] = b[i][w];\n    puts(a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36697", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[11], s2[4];\n  int i, j, n, b;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1) - 1;\n    j = 0;\n    b = s1[0];\n    for (i = 0; i <= n - 1; i++) {\n      if (b < s1[i]) {\n        j = i;\n        b = s1[i];\n      }\n    }\n\n    for (i = 0; i <= j; i++) {\n      cout << s1[i];\n    }\n    printf(\"%s\", s2);\n    while (j < n) {\n      printf(\"%c\", s1[j + 1]);\n      j++;\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36698", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11] = {0}, substr[4], str1[10][14] = {0};\n  int i, k, j, m = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    for (i = 1; i < strlen(str); i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = strlen(str) + 2; i > k + 3; i--)\n      str1[m][i] = str[i - 3];\n    for (i = 0; i <= k; i++)\n      str1[m][i] = str[i];\n    j = 0;\n    for (i = k + 1; i < k + 4; i++, j++)\n      str1[m][i] = substr[j];\n    m++;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", str1[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36699", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[14], substr[4];\n  int l, max, n, i;\n  while (scanf(\"%s %s \", str, substr)) {\n    l = strlen(str);\n    max = str[0];\n    n = 0;\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n\n        n = i;\n      }\n    }\n    for (i = l + 3; i >= n + 4; i--)\n      str[i] = str[i - 3];\n\n    str[n + 1] = substr[0];\n    str[n + 2] = substr[1];\n    str[n + 3] = substr[2];\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36700", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[22], b[4], c[11], d[11];\n  int s1, s2, i, j;\n  scanf(\"%s%s\", a, b);\n  do {\n\n    s1 = strlen(a);\n    s2 = strlen(b);\n    for (i = 0; i < s1; i++) {\n      int num = 0;\n      for (j = 0; j < s1; j++) {\n        if ((int)a[j] <= (int)a[i])\n          num++;\n      }\n      if (num == s1) {\n        for (j = 0; j <= i; j++) {\n          c[j] = a[j];\n        }\n        c[i + 1] = '\u0000';\n        for (j = i + 1; j < s1; j++) {\n          d[j - i - 1] = a[j];\n        }\n        d[s1 - i - 1] = '\u0000';\n        strcat(c, b);\n        strcat(c, d);\n        printf(\"%s \", c);\n        break;\n      }\n    }\n\n  } while (scanf(\"%s%s\", a, b) != EOF);\n}\n"}
{"label": "20", "index": "36701", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[30], newstr[30], max;\n  int l = 0, p = 0, i;\n  while (cin.getline(str, 30)) {\n    max = str[0];\n    l = strlen(str);\n    for (int i = 0; i <= l - 5; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        p = i;\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      newstr[i] = str[i];\n    }\n    for (i = 1; i <= 3; i++) {\n      newstr[p + i] = str[l - 4 + i];\n    }\n    for (i = p + 4; i <= l - 2; i++) {\n      newstr[i] = str[i - 3];\n    }\n    for (i = 0; i <= l - 2; i++) {\n      cout << newstr[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36702", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c1[11], c2[4];\n\n  while (scanf(\"%s%s\", c1, c2) != EOF) {\n    char ans[20] = {0};\n    int i, max, max_num, n, j, m;\n    max = 0;\n    n = strlen(c1);\n    for (i = 0; i <= n; i++) {\n      if (c1[i] > max) {\n        max = c1[i];\n        max_num = i;\n      }\n    }\n    for (i = 0; i <= max_num; i++)\n      ans[i] = c1[i];\n    strcat(ans, c2);\n    n = strlen(c1);\n    m = strlen(ans);\n    j = 0;\n    for (i = max_num + 1; i <= n; i++) {\n      ans[m + j] = c1[i];\n      j++;\n    }\n    printf(\"%s\\n\", ans);\n  }\n}\n"}
{"label": "20", "index": "36703", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[30], b[10], max;\n  scanf(\"%s%s\", a, b);\n  int la, lb, index, i;\n  do {\n    la = strlen(a);\n    lb = strlen(b);\n    max = a[0];\n    index = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] > max)\n        max = a[i];\n    }\n    for (i = 0; i < la; i++) {\n      if (a[i] == max) {\n        index = i;\n        break;\n      }\n    }\n    for (i = 0; i <= index; i++)\n      printf(\"%c\", a[i]);\n    for (i = index + 1; i <= index + lb; i++)\n      cout << b[i - index - 1];\n    for (i = index + lb + 1; i < la + lb; i++)\n      printf(\"%c\", a[i - lb]);\n    cout << \"\\n\";\n    scanf(\"%s\", a);\n  } while (scanf(\"%s\", b) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36704", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[20], t, last[20] = {0};\n  int i, k, l;\n  for (;;) {\n    if (scanf(\"%s%s\", str, substr) == EOF)\n      break;\n    t = str[0];\n    k = 0;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > t) {\n        t = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      last[i] = str[i];\n    for (i = k + 1; i <= k + 3; i++)\n      last[i] = substr[i - k - 1];\n    for (i = k + 4; i < l + 3; i++)\n      last[i] = str[i - 3];\n\n    last[l + 3] = 0;\n    puts(last);\n  }\n}\n"}
{"label": "20", "index": "36705", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[10], k;\n  int i, l, t = 0, m;\n  while ((scanf(\"%s%s\", a, b)) != EOF) {\n    l = strlen(a);\n    m = strlen(b);\n    k = a[0];\n    for (i = 1; i < l; i++)\n      if (a[i] > k) {\n        k = a[i];\n        t = i;\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < m; i++)\n      printf(\"%c\", b[i]);\n    for (i = t + 1; i < l; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36706", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, k[100], j, a[100];\n  char str[100][50], max;\n  do {\n    cin >> str[i];\n    a[i] = strlen(str[i]);\n    i++;\n  } while (str[i - 1][0] != '\u0000');\n\n  for (i = 0; str[i][0] != '\u0000'; i++) {\n    max = str[i][0];\n    for (j = 0; j < a[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k[i] = j;\n      }\n    }\n  }\n  for (i = 0; str[i][0] != '\u0000'; i++)\n\n  {\n    for (j = 0; j <= k[i]; j++)\n      cout << str[i][j];\n    for (j = a[i] - 3; j < a[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = k[i] + 1; j < a[i] - 4; j++)\n      cout << str[i][j];\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36707", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c, d[100];\n  int i, j = 0, k;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = strlen(a);\n    j = 0;\n    for (i = 1, c = a[0]; i < k; i++)\n      if (c < a[i]) {\n        c = a[i];\n        j = i;\n      }\n    for (i = 0; i <= j; i++)\n      d[i] = a[i];\n    for (i = j + 1; i < k; i++)\n      d[i + 3] = a[i];\n    for (i = 0; i < 3; i++, j++)\n      d[j + 1] = b[i];\n    d[k + 3] = 0;\n    printf(\"%s\\n\", d);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36708", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[20][13], str[3];\n  int i, j, k, n, max;\n  for (i = 1;; i++) {\n\n    cin >> s[i];\n    k = strlen(s[i]);\n    max = 0;\n    if (s[i][0] == '1' && s[i][1] == '2' && s[i][2] == '3' && s[i][3] == '4' &&\n        i == 2) {\n      n = i;\n      break;\n    } else if (s[i - 1][0] == '+' && s[i - 1][1] == '2' && s[i - 1][2] == '-' &&\n               s[i - 1][3] == '2' && i == 6 && s[i][0] != '#') {\n      n = i - 1;\n      break;\n    } else if (s[i][0] == '1' && s[i][1] == '2' && s[i][2] == '3' &&\n               s[i][3] == '4' && i == 10) {\n      n = i;\n      break;\n    } else {\n      for (j = 0; j <= 12; j++) {\n        if (s[i][j] == ' ')\n          max = 1;\n      }\n      if (max == 0) {\n        n = i - 1;\n        break;\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 1; s[i][j] != ' '; j++) {\n      if (s[i][j] > s[i][max])\n        max = j;\n    }\n\n    k = j - 1;\n    str[0] = s[i][k + 2];\n    str[1] = s[i][k + 3];\n    str[2] = s[i][k + 4];\n    for (j = k; j > max; j--)\n      s[i][j + 3] = s[i][j];\n    s[i][max + 1] = str[0];\n    s[i][max + 2] = str[1];\n    s[i][max + 3] = str[2];\n    for (j = 0; j <= k + 3; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36709", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[11], b[4], c[15];\n  int j, l, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    max = 0;\n    j = 0;\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] > a[max]) {\n        max = j;\n      }\n    }\n    for (j = 0; j <= max; j++)\n      c[j] = a[j];\n\n    for (j = 1; j <= 3; j++) {\n      c[j + max] = b[j - 1];\n    }\n    for (j = max + 1; j < l; j++) {\n      c[j + 3] = a[j];\n    }\n    c[l + 3] = '\\0';\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36710", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j, k, n, x, y, z = 0;\n  char str[100][12], substr[100][5];\n  while (scanf(\"%s%s\", &str[i], &substr[i]) != EOF) {\n    n = strlen(str[i]);\n    for (j = 0; j < n; j++) {\n      z = 0;\n      for (k = 0; k < n; k++) {\n        if (str[i][j] >= str[i][k])\n          z++;\n      }\n      if (z == n)\n        break;\n    }\n    for (y = 0; y <= j; y++)\n      printf(\"%c\", str[i][y]);\n    printf(\"%s\", substr[i]);\n    for (y = j + 1; y < n; y++)\n      cout << str[i][y];\n    printf(\"\\n\");\n\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36711", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str1[50], str2[50], ans[50];\nint main() {\n  char cutin();\n\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    cutin();\n    printf(\"%s\\n\", ans);\n  }\n}\n\nchar cutin() {\n  int i, max = 0, max_index = 0;\n  char temp[50];\n  char *p = str1;\n  for (i = 0; str1[i] != '\\0'; i++) {\n    if (*(p + i) > max) {\n      max = *(p + i);\n      max_index = i;\n    }\n  }\n  strcpy(ans, \"\");\n  strncat(ans, str1, max_index + 1);\n  strcat(ans, str2);\n  char *q1 = &str1[max_index + 1];\n  char *q2 = temp;\n  for (i = 0; str1[i] != '\\0'; i++)\n    *(q2 + i) = *(q1 + i);\n  *(q2 + i) = '\\0';\n  strcat(ans, temp);\n  return 0;\n}\n"}
{"label": "20", "index": "36712", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l = 0, m = 0, i = 0;\n  char str[20], sub[5];\n\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    l = strlen(str);\n\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[m])\n        m = i;\n    }\n\n    for (i = l + 2; i >= m + 4; i--) {\n      str[i] = str[i - 3];\n    }\n\n    str[m + 1] = sub[0];\n    str[m + 2] = sub[1];\n    str[m + 3] = sub[2];\n    str[l + 3] = '\\0';\n\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36713", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[20], *p, *max;\n  int i, l;\n  while (scanf(\"%s \", s)) {\n    p = s;\n    max = p;\n    l = strlen(s);\n    for (i = 0; i < l - 4; i++) {\n      if (*(p + i) > *max)\n        max = p + i;\n    }\n    for (p = s; p <= max; p++)\n      printf(\"%c\", *p);\n    printf(\"%c%c%c\", s[l - 3], s[l - 2], s[l - 1]);\n    for (p = max + 1; p < &s[l - 4]; p++)\n      printf(\"%c\", *p);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36714", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, l;\n  char g;\n  char str[15], substr[4] = {'1', '1', '1', '\\0'}, te[15];\n  scanf(\"%s\", str);\n  do {\n    strcpy(te, str);\n    g = getchar();\n    for (i = 0; i < 3; i++)\n      scanf(\"%c\", &substr[i]);\n    l = strlen(str);\n    for (i = 1, k = 0; i < l; i++) {\n      if (str[k] < str[i])\n        k = i;\n    }\n    for (i = k + 1; i < l; i++)\n      str[i + 3] = te[i];\n    str[l + 3] = '\\0';\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  } while (scanf(\"%s\", str) != EOF);\n}\n"}
{"label": "20", "index": "36715", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, r, s;\n  char a[100][14] = {'\u0000'}, b[100][10] = {'\u0000'}, c[100][3] = {'\u0000'}, m;\n  for (i = 0, n = 0; i < 100; i++, n++)\n\n    cin >> a[i];\n  for (i = 0; i < n; i++) {\n    l = strlen(a[i]);\n    m = a[i][0];\n    for (j = 0; j < l - 4; j++)\n      if (a[i][j] > m) {\n        m = a[i][j];\n        k = j;\n      }\n    for (j = k + 1, r = 0; j < l - 4; j++, r++) {\n      b[i][r] = a[i][j];\n      a[i][j] = '\u0000';\n    }\n    a[i][l - 4] = '\u0000';\n    for (j = l - 3, s = 0; j < l; j++, s++) {\n      c[i][s] = a[i][j];\n      a[i][j] = '\u0000';\n    }\n    cout << strcat(strcat(a[i], c[i]), b[i]) << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36716", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, n;\n  j = 0;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] > a[j])\n        j = i;\n    p = j;\n    for (i = n - 1; i > j; i--)\n      a[i + 3] = a[i];\n    a[p + 3] = b[2];\n    a[p + 2] = b[1];\n    a[p + 1] = b[0];\n    for (i = 0; i < n + 3; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36717", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, kong, max[100], hang;\n  char bi;\n  char a[100][50];\n  char b[100][50];\n  for (i = 0; i < 100; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n    max[i] = 0;\n    bi = a[i][0];\n    for (j = 1; a[i][j] != ' '; j++) {\n      if (a[i][j] > bi) {\n        bi = a[i][j];\n        max[i] = j;\n      }\n    }\n    for (j = 1; j < strlen(a[i]); j++) {\n      if (a[i][j] == ' ') {\n        kong = j;\n        break;\n      }\n    }\n    for (j = 0; j <= max[i]; j++)\n      printf(\"%c\", a[i][j]);\n\n    printf(\"%c%c%c\", a[i][kong + 1], a[i][kong + 2], a[i][kong + 3]);\n    for (j = max[i] + 4; j < strlen(a[i]) - 1; j++)\n      printf(\"%c\", a[i][j - 3]);\n\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36718", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, i, k, j;\n  char s1[11], s2[4], s3[15];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    k = 0;\n    for (j = 1; j < l; j++)\n      if (s1[k] < s1[j])\n        k = j;\n    for (i = 0; i <= k; i++)\n      s3[i] = s1[i];\n    for (i = 1; i < 4; i++)\n      s3[k + i] = s2[i - 1];\n    for (i = 0; i <= l - k; i++) {\n      s3[k + 4 + i] = s1[k + i + 1];\n    }\n    printf(\"%s \", s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36719", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid dd(char a[], char b[]) {\n  int i, j = 0, m, max;\n  m = strlen(a);\n  max = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  for (i = m; i > j; i--) {\n    a[i + 3] = a[i];\n  }\n  a[j + 1] = b[0];\n  a[j + 2] = b[1];\n  a[j + 3] = b[2];\n  for (i = 0; i < m + 3; i++) {\n    printf(\"%c\", a[i]);\n  }\n  cout << \"\\n\";\n}\nint main() {\n  char a[20], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    dd(a, b);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36720", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void in(char str[], char substr[]);\n  char str[100], substr[100];\n  while ((scanf(\"%s%s\", &str, &substr)) != EOF)\n    in(str, substr);\n  return 0;\n}\n\nvoid in(char str[], char substr[]) {\n  int i, k, max, l;\n  l = strlen(str);\n  max = str[0];\n  for (i = 1; i < l; i++) {\n    if (max < str[i]) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i++) {\n    printf(\"%c\", str[i]);\n  }\n  printf(\"%s\", substr);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "36721", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  int i, k, l;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    k = 0;\n    l = strlen(str);\n    max = str[0];\n    for (i = 1; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (i == k) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else\n        cout << str[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36722", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint count(char str[10], int len) {\n  int i;\n  int maxi = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] > str[maxi])\n      maxi = i;\n  }\n  return maxi;\n}\n\nint main() {\n  int n, len, j;\n  char sa[14], str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    n = count(str, len);\n    for (j = 0; j <= n; j++)\n      sa[j] = str[j];\n    for (j = n + 1; j <= n + 3; j++)\n      sa[j] = substr[j - n - 1];\n    for (j = n + 4; j <= len + 2; j++)\n      sa[j] = str[j - 3];\n    sa[len + 3] = '\\0';\n    printf(\"%s\\n\", sa);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36723", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[13], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    int l, i, j, k;\n    l = strlen(s1);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (s1[i] < s1[j])\n          break;\n      }\n      if (j == l) {\n        for (k = l + 3; k > i + 3; k--)\n          s1[k] = s1[k - 3];\n        s1[l + 3] = '\\0';\n        s1[i + 1] = s2[0];\n        s1[i + 2] = s2[1];\n        s1[i + 3] = s2[2];\n        break;\n      }\n    }\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36724", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF)\n    j++;\n\n  ceshi = j;\n  *dizhi = str[j];\n\n  for (j = 0; j < ceshi; j++) {\n\n    weizhi = 1;\n    max = *(*dizhi);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36725", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid cha(char str[100]) {\n  char substr[10], res[1000], giant, *p, *q, *t;\n  int i, max, n, m;\n  scanf(\"%s\", substr);\n  n = strlen(str);\n  max = 0;\n  p = str;\n  giant = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) > giant) {\n      giant = *(p + i);\n      max = i;\n    }\n  }\n  p = str;\n  q = res;\n  t = substr;\n  m = strlen(substr);\n  strncpy(q, p, max + 1);\n  strcpy(q + max + 1, t);\n  strcpy(q + max + m + 1, p + max + 1);\n  puts(res);\n}\nint main() {\n  char str[100];\n  while (scanf(\"%s\", str) != EOF)\n    cha(str);\n}\n"}
{"label": "20", "index": "36726", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char a[], int j) {\n  int i, k;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (a[i] > a[j]) {\n      return (0);\n    }\n  }\n  return (1);\n}\nvoid cha(char a[], char b[]) {\n  int i, k, j;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (max(a, i) == 1) {\n      for (j = 0; j < i + 1; j++)\n        printf(\"%c\", a[j]);\n      for (j = 0; j < 3; j++)\n        printf(\"%c\", b[j]);\n      for (j = i + 1; j < k; j++)\n        printf(\"%c\", a[j]);\n      printf(\"\\n\");\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][11], substr[100][4], d;\n  int n = 0, i;\n  do {\n    if (n) {\n      for (i = 1;; i++) {\n        if ((d = getchar()) != ' ')\n          str[n][i] = d;\n        else {\n          str[n][i] = '\\0';\n          break;\n        }\n      }\n    } else {\n      scanf(\"%s\", str[n]);\n    }\n    scanf(\"%s\", substr[n]);\n    n++;\n    d = getchar();\n    str[n][0] = getchar();\n  } while (str[n][0] != EOF);\n  for (i = 0; i < n; i++) {\n    cha(str[i], substr[i]);\n  }\n}\n"}
{"label": "20", "index": "36727", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint locate(char str[], int len) {\n  int i, a, b;\n  a = str[0];\n  b = 0;\n  for (i = 1; i < len; i++) {\n    if (a < str[i]) {\n      b = i;\n      a = str[i];\n    }\n  }\n  return (b + 1);\n}\nint main() {\n  int i, a, len, lena;\n  char str[11], substr[4], result[14];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(substr);\n    lena = strlen(str);\n    a = locate(str, lena);\n    for (i = 0; i < a; i++)\n      result[i] = str[i];\n    for (i = a; i < len + a; i++)\n      result[i] = substr[i - a];\n    for (i = len + a; i < len + lena; i++)\n      result[i] = str[i - len];\n    result[len + lena] = '\u0000';\n    puts(result);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36728", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    maxAsc = 0;\n    maxChar = 0;\n    lenth = strlen(str);\n    for (i = 0; i < lenth; i++) {\n      if (maxChar < *(str + i)) {\n        maxChar = *(str + i);\n        maxAsc = i;\n      }\n    }\n    str[lenth + 3] = 0;\n    for (i = lenth - 1; i > maxAsc; i--)\n      *(str + i + 3) = *(str + i);\n\n    for (i = 0; i < 3; i++) {\n      *(str + maxAsc + i + 1) = *(substr + i);\n    }\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36729", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, l;\n  char g;\n  char str[15], substr[4] = {'1', '1', '1', '\\0'}, te[15];\n  scanf(\"%s\", str);\n  do {\n    strcpy(te, str);\n    g = getchar();\n    for (i = 0; i < 3; i++)\n      cin >> substr[i];\n    l = strlen(str);\n    for (i = 1, k = 0; i < l; i++) {\n      if (str[k] < str[i])\n        k = i;\n    }\n    for (i = k + 1; i < l; i++) {\n      str[i + 3] = te[i];\n    }\n    str[l + 3] = '\\0';\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  } while (scanf(\"%s\", str) != EOF);\n}\n"}
{"label": "20", "index": "36730", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, kong, max[100];\n  char bi;\n  char a[100][50];\n  char b[100][50];\n  for (i = 0; i < 100; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n    max[i] = 0;\n    bi = a[i][0];\n    for (j = 1; a[i][j] != ' '; j++) {\n      if (a[i][j] > bi) {\n        bi = a[i][j];\n        max[i] = j;\n      }\n    }\n    for (j = 1; j < strlen(a[i]); j++) {\n      if (a[i][j] == ' ') {\n        kong = j;\n        break;\n      }\n    }\n    for (j = 0; j <= max[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\"%c%c%c\", a[i][kong + 1], a[i][kong + 2], a[i][kong + 3]);\n    for (j = max[i] + 4; j < strlen(a[i]) - 1; j++) {\n      printf(\"%c\", a[i][j - 3]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36731", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j, i, max = 0;\n  char str[11] = {0}, substr[4] = {0}, s[20] = {0}, *p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    j = 0;\n    p = &str[0];\n    for (i = 0; str[i] != 0; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = &str[i];\n        j = i;\n      }\n    strncat(s, str, j + 1);\n    strcat(s, substr);\n    strcat(s, p + 1);\n    printf(\"%s\\n\", s);\n    strcpy(s, \"\");\n    strcpy(str, \"\");\n    strcpy(substr, \"\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36732", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint getMaxCharIndex(char *str) {\n  int i = 0;\n  int maxIndex = 0;\n  char maxChar = str[0];\n\n  for (i = 0; i < 1000; i++) {\n    if (str[i] == 0)\n      break;\n\n    if (maxChar < str[i]) {\n      maxChar = str[i];\n      maxIndex = i;\n    }\n  }\n\n  return maxIndex;\n}\n\nvoid insertStr(char *str, int index, char *subStr) {\n  int i;\n  int strLength = strlen(str);\n\n  for (i = strLength; i > index; i--)\n    str[i + 1000 - 1] = str[i];\n\n  for (i = 0; i < 1000 - 1; i++)\n    str[i + index + 1] = subStr[i];\n}\n\nint main() {\n  char str[1000];\n  char subStr[1000];\n  int maxIndex;\n\n  while (scanf(\"%s%s\", str, subStr) != EOF) {\n    maxIndex = getMaxCharIndex(str);\n    insertStr(str, maxIndex, subStr);\n\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36733", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[13], *p, *h;\n  int l, i, m;\n  while (cin >> str) {\n    p = str;\n    h = str;\n    m = 0;\n    l = strlen(p);\n    for (i = 0; i < (l - 4); i++) {\n      if (*h < *(p + i)) {\n        h = p + i;\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", *(p + i));\n    printf(\"%c%c%c\", *(p + l - 3), *(p + l - 2), *(p + l - 1));\n    for (i = m + 1; *(p + i) != ' '; i++)\n      printf(\"%c\", *(p + i));\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36734", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], c, str[100], substr[100], x;\n  int i, j, k, s, t;\n  while (scanf(\"%s \", a)) {\n    for (i = 0; (c = a[i]) != ' '; i++)\n      str[i] = a[i];\n    s = i + 1;\n    k = 0;\n    for (j = s; (c = a[j]) != '\u0000'; j++) {\n      substr[k] = a[j];\n      k++;\n    }\n    x = str[0];\n    for (i = 0; i < s - 1; i++)\n      if (str[i] > x) {\n        t = i + 1;\n        x = str[i];\n      }\n    for (i = 0; i < t; i++)\n      cout << str[i];\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n    for (i = t; i < s - 1; i++)\n      printf(\"%c\", str[i]);\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36735", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int max, maxindex, i, j, k, m, n, l;\n  char str1[20], str2[10];\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; str1[i]; i++) {\n      if (str1[i] > max) {\n        max = str1[i];\n        maxindex = i;\n      }\n    }\n    m = strlen(str1);\n    n = strlen(str2);\n    for (j = 0; j <= maxindex; j++)\n      printf(\"%c\", str1[j]);\n    for (k = 0; k < n; k++)\n      printf(\"%c\", str2[k]);\n    for (l = maxindex + 1; l < m; l++)\n      cout << str1[l];\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36736", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char *str, *substr;\n  int max;\n  str = (char *)malloc(20 * sizeof(char));\n  substr = (char *)malloc(20 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (*(str + i) > max)\n        max = *(str + i);\n    }\n    for (i = 0; i < n; i++) {\n      if (*(str + i) == max) {\n        for (j = 0; j <= i; j++) {\n          printf(\"%c\", *(str + j));\n        }\n        printf(\"%s\", substr);\n        if (i == n - 1) {\n          printf(\"\\n\");\n          break;\n        }\n        for (j = i + 1; j < n - 1; j++)\n          printf(\"%c\", *(str + j));\n        printf(\"%c\\n\", *(str + n - 1));\n        break;\n      }\n    }\n  }\n}\n"}
{"label": "20", "index": "36737", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], s[15];\n  int i, j, max, l, num;\n  while (scanf(\"%s%s\", str, substr) + 1) {\n    max = 0;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++)\n      s[j] = str[j];\n\n    s[num + 1] = substr[0];\n    s[num + 2] = substr[1];\n    s[num + 3] = substr[2];\n    int n = num;\n    for (j = num + 4; j <= l + 3; j++) {\n      n++;\n      s[j] = str[n];\n    }\n    for (j = 0; j < l + 3; j++) {\n      printf(\"%c\", s[j]);\n    }\n\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36738", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], t;\n  int n, m, i, j, k;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    n = strlen(s2);\n    j = 0;\n    t = s1[0];\n    for (i = 1; i < m; i++) {\n      if (s1[i] > t) {\n        j = i;\n        t = s1[i];\n      }\n    }\n    for (i = 0; i <= m - j - 1; i++)\n      s1[n + m - i] = s1[m - i];\n    for (i = 0; i < n; i++)\n      s1[j + 1 + i] = s2[i];\n    for (i = 0; i < m + n; i++)\n      printf(\"%c\", s1[i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36739", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][11], substr[100][4];\n  int k, i = 0, j, m;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF) {\n    k = 0;\n    m = str[i][0];\n    for (j = 1; str[i][j]; j++)\n      if (str[i][j] > m) {\n        m = str[i][j];\n        k = j;\n      }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%s\", substr[i]);\n    for (; str[i][j]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36740", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[15], substr[4];\n  int i, j, max, c;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 1, max = str[0], c = 0; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        c = i;\n      }\n    }\n    for (j = i + 3; j > c + 3; j--)\n      str[j] = str[j - 3];\n\n    str[c + 1] = substr[0];\n    str[c + 2] = substr[1];\n    str[c + 3] = substr[2];\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36741", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int p, j, k, len, i;\n  char str[100][10] = {'\u0000'}, ch[100][3], sub[100][20], tol[100][30];\n  for (i = 0; i < 100; i++) {\n    cin >> tol[i];\n    len = strlen(tol[i]);\n    if (len == 0)\n      break;\n    for (j = 0;; j++) {\n      str[i][j] = tol[i][j];\n      if (str[i][j] == ' ') {\n        str[i][j] = '\u0000';\n        break;\n      }\n    }\n    for (k = 0; k < 3; k++) {\n      ch[i][k] = tol[i][j + 1];\n      j++;\n    }\n    for (j = 1, p = 0; j < len; j++) {\n      if (str[i][p] < str[i][j])\n        p = j;\n    }\n\n    strncpy(sub[i], str[i], p + 1);\n\n    sub[i][p + 1] = ch[i][0];\n    sub[i][p + 2] = ch[i][1];\n    sub[i][p + 3] = ch[i][2];\n    for (j = 0; j <= len - 1 - p; j++)\n      sub[i][p + 4 + j] = str[i][p + j + 1];\n  }\n  printf(\"%s\", sub[0]);\n  for (i = 1; strlen(tol[i]) != 0; i++)\n    printf(\" %s\", sub[i]);\n\n  return 0;\n}\n"}
{"label": "20", "index": "36742", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], c[14];\n  int i = 0, j = 0, a, m, n, p, q;\n  for (;;) {\n    a = scanf(\"%s %s\", str, substr);\n    if (a == EOF) {\n      break;\n    } else {\n      m = strlen(str);\n      n = strlen(substr);\n      p = 0;\n      for (i = 0; i < m; i++) {\n        if (str[i] <= str[p]) {\n          continue;\n        } else {\n          p = i;\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        if (q <= p) {\n          c[q] = str[q];\n        }\n        if (q > p && q < p + n + 1) {\n          c[q] = substr[q - p - 1];\n        }\n        if (q >= p + n + 1) {\n          c[q] = str[q - n];\n        }\n      }\n      for (q = 0; q < m + n; q++) {\n        printf(\"%c\", c[q]);\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36743", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char str[], char substr[]) {\n  int i, j, k, lenstr, lensubstr, lentemp, max;\n  char temp[10] = {0};\n  lenstr = strlen(str);\n  lensubstr = strlen(substr);\n  max = 0;\n  for (i = 0; i <= lenstr - 1; i++) {\n    if (str[i] > str[max])\n      max = i;\n  }\n  for (i = 0, j = max + 1; j <= lenstr - 1; i++, j++)\n    temp[i] = str[j];\n  lentemp = strlen(temp);\n  for (i = 0, j = max + 1; i <= lensubstr; i++, j++)\n    str[j] = substr[i];\n  for (i = 0, k = j - 1; i <= lentemp - 1; i++, k++)\n    str[k] = temp[i];\n}\nint main() {\n  char str[20] = {0}, substr[4] = {0};\n  int len, i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    insert(str, substr);\n    len = strlen(str);\n    for (i = 0; i <= len - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i <= 19; i++)\n      str[i] = 0;\n    for (i = 0; i <= 3; i++)\n      substr[i] = 0;\n  }\n}\n"}
{"label": "20", "index": "36744", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char substr[3] = {'\\0'};\n  char str[10] = {'\\0'};\n  char out[13] = {'\\0'};\n  int length = 0;\n  int i = 0;\n  int j = 0;\n  char temp = '\\0';\n  int num = 0;\n  while (cin >> str >> substr) {\n    length = strlen(str);\n    for (i = 0; i < length; i++) {\n      if (str[i] > temp) {\n        temp = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++) {\n      out[i] = str[i];\n    }\n    strcat(out, substr);\n    for (i = num + 4, j = num + 1; i < (length + 3) && j < length; i++, j++) {\n      out[i] = str[j];\n    }\n    num = 0;\n    temp = '\\0';\n    cout << out << endl;\n    for (i = 0; i < 13; i++)\n\n      out[i] = '\\0';\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36745", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint posi(char str[]) {\n  int i, k = 0;\n  for (i = 1; i < strlen(str); i++) {\n    if (str[i] > str[k])\n      k = i;\n  }\n  return k + 1;\n}\nint main() {\n  char str[20], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int k, i, j, l = strlen(str);\n    k = posi(str);\n    for (i = l; i >= k; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 0; i < 3; i++)\n      str[k + i] = substr[i];\n\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36746", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[20][13], str[3], S[20][13];\n  int i, j, k, n, max;\n  for (i = 1; (s[i][0] = getchar()) != EOF; i++) {\n    s[i][1] = '\u0000';\n\n    cin >> S[i];\n    strcat(s[i], S[i]);\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 1; s[i][j] != ' '; j++) {\n      if (s[i][j] > s[i][max])\n        max = j;\n    }\n\n    k = j - 1;\n    str[0] = s[i][k + 2];\n    str[1] = s[i][k + 3];\n    str[2] = s[i][k + 4];\n    for (j = k; j > max; j--)\n      s[i][j + 3] = s[i][j];\n    s[i][max + 1] = str[0];\n    s[i][max + 2] = str[1];\n    s[i][max + 3] = str[2];\n    for (j = 0; j <= k + 3; j++)\n      printf(\"%c\", s[i][j]);\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36747", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char str[10] = {0}, substr[3] = {0}, m = 0;\n\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = 0;\n    n = 0;\n\n    for (i = 0; i < 10; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        n = i;\n      }\n    }\n\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = n + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36748", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], sub[4], a;\n  int i, j, b;\n  for (i = 0;; i++) {\n    if (scanf(\"%s %s\", str, sub) == EOF)\n      break;\n    else {\n      a = 0;\n      b = 0;\n      for (j = 0; j < strlen(str); j++) {\n        if (str[j] > a) {\n          a = str[j];\n          b = j;\n        }\n      }\n      for (j = 0; j <= b; j++) {\n        printf(\"%c\", str[j]);\n      }\n      printf(\"%s\", sub);\n      for (j = b + 1; j < strlen(str); j++) {\n        printf(\"%c\", str[j]);\n      }\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36749", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int ceshi, i = 0, j, max, weizhi, chang, k;\n  char str[30][15] = {'\\0'}, substr[30][3] = {'\\0'}, a[30][18] = {'\\0'};\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    i++;\n  } \n\n  ceshi = i;\n\n  for (i = 0; i < ceshi; i++) {\n    max = str[i][0];\n    weizhi = 0;\n\n    for (j = 0; str[i][j] != '\\0'; j++) { \n      if (str[i][j] > max) {\n        weizhi = j;\n        max = str[i][j];\n      }\n    }\n\n    strncpy(a[i], str[i], weizhi + 1); \n\n    for (k = 0; k < 3; k++)\n      a[i][1 + k + weizhi] = substr[i][k]; \n\n    for (j = 1; str[i][j + weizhi] != '\\0'; j++) {\n      a[i][weizhi + 3 + j] = str[i][j + weizhi]; \n    }\n\n    chang = strlen(str[i]);\n\n    a[i][chang + 3] = '\\0'; \n\n    printf(\"%s\\n\", a[i]);\n  }\n}\n"}
{"label": "20", "index": "36750", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], s[10], p;\n  int i, t;\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", s);\n    p = str[0];\n    t = 0;\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] > p) {\n        p = str[i];\n        t = i;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", s);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36751", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, l, m = 0;\n  char str[20] = {'0'}, substr[4] = {'0'}, max = 0;\n  while (1) {\n    scanf(\"%s %s\", str, substr);\n    if (str[0] == 0)\n      break;\n\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    if (m == l - 1) {\n      for (i = l; i = l + 2; i++)\n        str[i] = substr[i - l];\n    } else {\n      for (i = l - 1; i > m; i--)\n        str[i + 3] = str[i];\n      for (i = m + 1; i < m + 4; i++)\n        str[i] = substr[i - m - 1];\n    }\n    printf(\"%s\\n\", str);\n    m = 0;\n    max = 0;\n    for (i = 0; i < 20; i++)\n      str[i] = 0;\n    for (i = 0; i < 3; i++)\n      substr[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36752", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[10], substr[3], a[13];\nvoid F(int);\nint main() {\n  int k, b;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = strlen(str);\n    F(k);\n    for (b = 0; b <= k + 2; b++)\n      printf(\"%c\", a[b]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\nvoid F(int k) {\n  int t, i, j, e = 0, f;\n  for (i = 0; i < k; i++) {\n    f = 0;\n    for (j = i + 1; j < k; j++) {\n      if (str[i] < str[j]) {\n        f++;\n      }\n    }\n    if (f == 0) {\n      t = i;\n      break;\n    }\n  }\n  for (i = 0; i <= t; i++) {\n    a[i] = str[i];\n  }\n  for (j = t + 4; j <= k + 2; j++) {\n    a[j] = str[j - 3];\n  }\n  for (i = t + 1; i <= t + 3; i++) {\n    a[i] = substr[e];\n    e++;\n  }\n}\n"}
{"label": "20", "index": "36753", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], finalstr[1000][13];\n  int n, i, j, l, k;\n  for (i = 0; scanf(\"%s%s\", str[i], substr[i]) != EOF; i++) {\n  }\n  n = i;\n  for (k = 0; k < n; k++) {\n    l = strlen(str[k]);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (str[k][i] < str[k][j])\n          break;\n      }\n      if (j == l)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      finalstr[k][j] = str[k][j];\n    for (j = 0; j < 3; j++)\n      finalstr[k][i + j + 1] = substr[k][j];\n    for (j = 1; j < l - i; j++)\n      finalstr[k][i + 3 + j] = str[k][i + j];\n    finalstr[k][i + 3 + j] = '\\0';\n  }\n  for (i = 0; i < n; i++)\n    cout << finalstr[i] << \"\\n\";\n}\n"}
{"label": "20", "index": "36754", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100];\n  int n, i, j;\n  char *p1;\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    p1 = &a[0];\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (a[i] > *p1) {\n        p1 = &a[i];\n      }\n    }\n    for (i = 0; a[i] != '\\0'; i++) {\n      if (&a[i] != p1)\n        printf(\"%c\", a[i]);\n      if (&a[i] == p1)\n        printf(\"%c%c%c%c\", *p1, b[0], b[1], b[2]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36755", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint posi(char str[]) {\n  int i, k = 0;\n  for (i = 1; i < strlen(str); i++) {\n    if (str[i] > str[k])\n      k = i;\n  }\n  return k + 1;\n}\nint main() {\n  char str[20], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int k, i, j, l = strlen(str);\n    k = posi(str);\n    for (i = l; i >= k; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 0; i < 3; i++) {\n      str[k + i] = substr[i];\n    }\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36756", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15] = {0};\n  char substr[3] = {0};\n  char string[500][15] = {0};\n  char max;\n  int i, x, d, j;\n  j = 0;\n\n  while (1) {\n\n    scanf(\"%s \", str);\n\n    d = strlen(str);\n    if (d == 0)\n      break;\n    for (i = 0; i < d; i++)\n      if (str[i] == ' ')\n        break;\n    for (x = i + 1; x <= i + 4; x++)\n      substr[x - i - 1] = str[x];\n    str[i] = '\u0000';\n    d = d - 3;\n    max = str[0];\n    x = 0;\n    for (i = 0; str[i] != '\u0000'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        x = i;\n      }\n    for (i = d - 1; i > x; i--)\n      str[i + 3] = str[i];\n    for (i = x + 1; i < x + 4; i++)\n      str[i] = substr[i - x - 1];\n    strcpy(string[j], str);\n    string[j][d + 3] = '\u0000';\n    j = j + 1;\n    for (i = 0; i < 13; i++) {\n      str[i] = 0;\n      substr[i] = 0;\n    }\n  }\n  d = j;\n  for (i = j; i < 500; i++)\n    string[i][0] = '\u0000';\n  for (i = 0; i < d; i++)\n    printf(\"%s \", string[i]);\n}\n"}
{"label": "20", "index": "36757", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, max;\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] > str[max]) {\n        max = i;\n      }\n    }\n    for (j = 0; j < max + 1; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (k = 0; k < 3; k++) {\n      printf(\"%c\", substr[k]);\n    }\n    for (j = max + 1; j < strlen(str); j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36758", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i;\n  char ch1[11], ch2[4];\n  while (scanf(\"%s%s\", ch1, ch2) != EOF) {\n    int k, m = 0;\n    char t = ch1[0];\n    k = strlen(ch1);\n    for (i = 0; i <= k - 1; i++) {\n      if (ch1[i] > t) {\n        t = ch1[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      cout << ch1[i];\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", ch2[i]);\n    if (m != k - 1) {\n      for (i = m + 1; i <= k - 1; i++)\n        printf(\"%c\", ch1[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36759", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char wo[50][50];\n  char in[50][50];\n  char out[50][50];\n  int i = 0, j, k = 0;\n  int temp = 0;\n  while (scanf(\"%s %s\", wo[i], in[i]) != EOF) {\n    i++;\n  }\n  for (j = 0; j <= i; j++) {\n    temp = 0;\n    for (k = 0; wo[j][k] != 0; k++)\n      if (wo[j][k] > wo[j][temp])\n        temp = k;\n    strcpy(out[j], wo[j]);\n    for (k = temp + 1; k < temp + 1 + strlen(in[j]); k++)\n      out[j][k] = in[j][k - temp - 1];\n    do {\n      temp++;\n      out[j][k] = wo[j][temp];\n      k++;\n    } while (wo[j][temp] != 0);\n    if (j != i)\n      cout << out[j] << \"\\n\";\n    else\n      printf(\"%s\", out[j]);\n  }\n}\n"}
{"label": "20", "index": "36760", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[16], substr[4];\n  char output[20];\n  char *string, *max;\n  int i, j;\n  while ((scanf(\"%s\", str)) != EOF) {\n\n    cin >> substr;\n    string = str;\n    max = str;\n    for (i = 0; i < (strlen(str)); i++) {\n      if (*string > *max) {\n        max = string;\n      }\n      string++;\n    }\n    string = str;\n    for (i = 0; (*string) != (*max); string++, i++)\n      output[i] = *string;\n    output[i] = *max;\n    max++;\n    for (j = i + 1; j <= (3 + i); j++)\n      output[j] = substr[j - i - 1];\n    for (; j < (strlen(str) + strlen(substr)); j++, i++)\n      output[j] = str[i + 1];\n    for (i = 0; i < (strlen(str) + strlen(substr)); i++)\n      printf(\"%c\", output[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36761", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char max(char a[10]);\n  char a[100][15] = {'\\0'}, b[100][3];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    if (a[i][0] == '\\0')\n      break;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int m = strlen(a[i]);\n    char c[13] = {0};\n    int k = 0;\n    for (j = 0; j < m; j++) {\n      if (k == 0)\n        c[j] = a[i][j];\n      else if (k > 0)\n        c[j + 3] = a[i][j];\n      if ((a[i][j] == max(a[i])) && (k == 0)) {\n        c[j] = a[i][j];\n        c[j + 1] = b[i][0];\n        c[j + 2] = b[i][1];\n        c[j + 3] = b[i][2];\n        k++;\n      }\n    }\n    if (i < count - 1)\n      printf(\"%s\\n\", c);\n    else if (i == count - 1)\n      printf(\"%s\\n\", c);\n  }\n}\nchar max(char a[10]) {\n  int i;\n  char t = a[0];\n  for (i = 0; i < 10; i++)\n    if (a[i] > t)\n      t = a[i];\n  return (t);\n}\n"}
{"label": "20", "index": "36762", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int b, num, i, j, l;\n  char str[11], substr[4], str1[15], c;\n  for (;;) {\n\n    for (i = 0; i < 11; i++) {\n      str[i] = '\u0000';\n    }\n    for (i = 0; i < 4; i++) {\n      substr[i] = '\u0000';\n    }\n    for (i = 0; i < 15; i++) {\n      str1[i] = '\u0000';\n    }\n    for (i = 0; i < 10; i++) {\n      if ((c = getchar()) == ' ')\n        break;\n      else\n        str[i] = c;\n    }\n    if (feof(stdin))\n      break;\n\n    cin >> substr;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      b = 0;\n      for (j = i; j < l; j++) {\n        if (str[i] < str[j]) {\n          b = 1;\n          break;\n        }\n      }\n      if (b == 0) {\n        num = i;\n        break;\n      }\n    }\n    for (i = 0; i <= num; i++)\n      str1[i] = str[i];\n\n    for (i = num + 1; i <= num + 3; i++) {\n      str1[i] = substr[i - 1 - num];\n    }\n    for (i = num + 4; i < l + 3; i++) {\n      str1[i] = str[i - 3];\n    }\n    puts(str1);\n  }\n}\n"}
{"label": "20", "index": "36763", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[15][10], b[15][3], c[10][13], s;\n  int i, j, t, r, m = 0;\n  while (scanf(\"%s%s\", a[m], b[m]) != EOF)\n    m++;\n  for (j = 0; j < m; j++) {\n    t = strlen(a[j]);\n    for (i = 0, s = a[j][0]; i < t; i++)\n      if (a[j][i] > s)\n        s = a[j][i];\n    for (r = 0; a[j][r] != s;)\n      r++;\n    for (i = 0; i <= r; i++)\n      c[j][i] = a[j][i];\n    for (i = 0; i < 3; i++)\n      c[j][i + r + 1] = b[j][i];\n    for (i = r + 1; i < t + 3; i++)\n      c[j][i + 3] = a[j][i];\n    for (i = 0; i < t + 3; i++)\n      printf(\"%c\", c[j][i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36764", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[3], s[20];\n  int i, j = 0, k, m;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = m - 1; i > j; i--)\n      str[i + 3] = str[i];\n    for (i = j + 1, k = 0; i < j + 4; i++, k++)\n      str[i] = substr[k];\n    str[m + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36765", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20][10] = {'\\0'}, substr[20][3];\n  int i = 0, j, max, k;\n  while (scanf(\"%s%s\", str[i], substr[i]) != EOF)\n    i++;\n  for (i = 0; str[i][0] != '\\0'; i++) {\n    k = 0;\n    max = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++)\n      cout << str[i][j];\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[i][j]);\n    for (j = k + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36766", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, b, a;\n  char max;\n  char str[100][10];\n  char substr[100][3];\n  while ((scanf(\"%s %s\", str[n], substr[n])) != EOF)\n    n++;\n\n  for (i = 0; i < n; i++) {\n    k = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < k; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        b = j;\n      }\n    }\n    for (a = 0; a <= b; a++) {\n      printf(\"%c\", str[i][a]);\n    }\n    for (a = 0; a < 3; a++)\n      printf(\"%c\", substr[i][a]);\n\n    for (a = b + 1; a < k; a++) {\n      printf(\"%c\", str[i][a]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36767", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], substr[3], res[15], max;\n  int i, j, l, k;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    l = strlen(str);\n    max = str[0];\n    for (i = 0; i < l; i++)\n      if (max < str[i])\n        max = str[i];\n    for (i = 0; i < l; i++) {\n      if (str[i] != max)\n        res[i] = str[i];\n      else {\n        res[i] = str[i];\n        i++;\n        break;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      res[i + j] = substr[j];\n    for (; i < l; i++)\n      res[i + j] = str[i];\n    for (k = 0; k < i + j; k++)\n      printf(\"%c\", res[k]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36768", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], substr[3], res[15], max;\n  int i, j, l, k;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    l = strlen(str);\n    max = str[0];\n    for (i = 0; i < l; i++)\n      if (max < str[i])\n        max = str[i];\n    for (i = 0; i < l; i++) {\n      if (str[i] != max)\n        res[i] = str[i];\n      else {\n        res[i] = str[i];\n        i++;\n        break;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      res[i + j] = substr[j];\n    for (; i < l; i++)\n      res[i + j] = str[i];\n    for (k = 0; k < i + j; k++)\n      printf(\"%c\", res[k]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36769", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint findmax(char a[15]) {\n  int maxnum = 0, max;\n  max = a[0];\n  int i, len;\n  len = strlen(a);\n  int comp;\n  comp = a[0];\n  for (i = 0; i < len - 1; i++) {\n    if (a[i + 1] > max) {\n      maxnum = i + 1;\n      max = a[i + 1];\n    }\n  }\n  return maxnum;\n}\n\nint main() {\n\n  int lstr, mnum;\n  int i;\n  char str[15] = {0}, substr[5] = {0};\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    mnum = findmax(str);\n    lstr = strlen(str);\n    for (i = lstr - 1; i > mnum; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = 0; i < 3; i++)\n      str[mnum + i + 1] = substr[i];\n    printf(\"%s\\n\", str);\n    for (i = 0; i < 15; i++)\n      str[i] = 0;\n    for (i = 0; i < 3; i++)\n      substr[i] = 0;\n  }\n}\n"}
{"label": "20", "index": "36770", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    int i, j, k = 0, len = strlen(str);\n    char max = 1;\n    for (i = 0; i < len; i++)\n      if (max < str[i])\n        max = str[i];\n    for (j = 0; j < len; j++)\n      if (max == str[j])\n        break;\n    for (i = len + 2; i > j + 3; i--)\n      str[i] = str[i - 3];\n    str[len + 3] = '\\0';\n    for (i = j + 1; i < j + 4; i++)\n      str[i] = substr[k++];\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36771", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, len, max, maxi;\n  char substr[4], str[11];\n  for (i = 0; i < 4; i++)\n    substr[i] = -1;\n  for (i = 0; i < 11; i++)\n    str[i] = -1;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = -1;\n    maxi = -1;\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      printf(\"%c\", str[i]);\n      if (i == maxi)\n        printf(\"%s\", substr);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36772", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], s, s3[14];\n  int n, m, t;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    for (n = 1, s = s1[0], m = 0; s1[n] != '\\0'; n++) {\n      if (s1[n] > s) {\n        m = n;\n        s = s1[n];\n      }\n    }\n    for (n = m + 1, t = 0; s1[n] != '\\0'; n++, t++)\n      s3[t] = s1[n];\n    s3[t] = '\\0';\n    for (n = 1; n <= 3; n++)\n      s1[m + n] = s2[n - 1];\n    s1[m + n] = '\\0';\n    printf(\"%s%s\\n\", s1, s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36773", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int ceshi, i = 0, j, max, weizhi, chang;\n  char str[30][15] = {'\\0'}, substr[30][3] = {'\\0'}, a[30][18] = {'\\0'};\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    i++;\n  }\n\n  ceshi = i;\n\n  for (i = 0; i < ceshi; i++) {\n    max = str[i][0];\n    weizhi = 0;\n\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        weizhi = j;\n        max = str[i][j];\n      }\n    }\n\n    strncpy(a[i], str[i], weizhi + 1);\n    a[i][weizhi + 1] = '\\0';\n\n    strcat(a[i], substr[i]);\n\n    for (j = 1; str[i][j + weizhi] != '\\0'; j++) {\n      a[i][weizhi + 3 + j] = str[i][j + weizhi];\n    }\n\n    chang = strlen(str[i]);\n\n    a[i][chang + 3] = '\\0';\n\n    cout << a[i] << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36774", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n  for (j = 0; j < ceshi; j++) {\n    dizhi[j] = str[j];\n    weizhi = 1;\n    max = *(dizhi[j]);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36775", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid cha(char str[100]) {\n  char substr[10], res[1000], giant, *p, *q, *t;\n  int i, max, n, m;\n  scanf(\"%s \", substr);\n  n = strlen(str);\n  max = 0;\n  p = str;\n  giant = *p;\n  for (i = 0; i < n; i++) {\n    if (*(p + i) > giant) {\n      giant = *(p + i);\n      max = i;\n    }\n  }\n  p = str;\n  q = res;\n  t = substr;\n  m = strlen(substr);\n  strncpy(q, p, max + 1);\n  strcpy(q + max + 1, t);\n  strcpy(q + max + m + 1, p + max + 1);\n  puts(res);\n}\nint main() {\n  char str[100];\n  while (scanf(\"%s\", str) != EOF)\n    cha(str);\n}\n"}
{"label": "20", "index": "36776", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[11];\n\n  int j, k, i, n, m;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    for (j = 0; j < n; j++)\n      a[j] = str[j];\n\n    for (k = 1; k < n; k++)\n      if (a[0] < a[k])\n        a[0] = a[k];\n    for (j = 0; j < n; j++) {\n      cout << str[j];\n      if (str[j] == a[0])\n        break;\n    }\n    for (k = 0; k < m; k++)\n      printf(\"%c\", substr[k]);\n    for (i = (j + 1); i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36777", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], str1[10], substr[4], letter, result[13],\n      b[10] = {'\u0000'}, string[13]; \n  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, m, l, i, j, time;\n  for (time = 1; time < 100; time++) {\n    for (i = 0; i < 10; i++) {\n      str[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      result[i] = '\u0000';\n    }\n    for (i = 0; i < 4; i++) {\n      substr[i] = '\u0000';\n    }\n    for (i = 0; i < 10; i++) {\n      a[i] = i;\n    }\n    for (i = 0; i < 10; i++) {\n      b[i] = '\u0000';\n    }\n    for (i = 0; i < 13; i++) {\n      string[i] = '\u0000';\n    }\n\n    cin >> string;\n    if (strlen(string) == 0)\n      break; \n    for (i = 0; string[i] != ' '; i++) {\n      str[i] = string[i];\n    }\n    \n    \n    \n    l = strlen(str);\n    for (i = l + 1, j = 0; i < l + 4, j < 3; i++, j++) {\n      substr[j] = string[i];\n    }\n    substr[3] = '\u0000'; \n    strcpy(str1, str);\n    for (i = 0; i < l - 1; i++) {\n      for (j = 0; j < l - i - 1; j++) {\n        if (str1[j] < str1[j + 1]) {\n          letter = str1[j], m = a[j];\n          str1[j] = str1[j + 1], a[j] = a[j + 1];\n          str1[j + 1] = letter, a[j + 1] = m;\n        } \n      }\n    }\n    m = a[0];\n    strncpy(result, str, m + 1);\n    strcat(result, substr); \n    for (i = 0; i < l - m - 1; i++) {\n      str1[i] = str[i + m + 1];\n    }\n    strncpy(b, str1, l - m - 1); \n    strcat(result, b);\n    printf(\"%s \", result);\n  }\n}\n"}
{"label": "20", "index": "36778", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], sub[10];\n  int max, i, j;\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    j = strlen(str);\n    max = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = j; i > max; i--)\n      str[i + 3] = str[i];\n    for (i = 0; i < 3; i++)\n      str[max + i + 1] = sub[i];\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36779", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  char str[11], substr[4];\n  while (scanf(\"%s \", str)) {\n    cin >> substr;\n    char *max = str, temp;\n    int i;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > *max) {\n        max = &str[i];\n        temp = *max;\n      }\n    *max = 0;\n    cout << str << temp << substr << max + 1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36780", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[11], cut[4], ans[20], *p, maxchar;\n  int i, l, maxnum;\n  while (scanf(\"%s%s\", str1, cut) != EOF) {\n    p = str1;\n    l = strlen(str1);\n    maxchar = *p;\n    maxnum = 0;\n    p++;\n    for (i = 1; i < l; i++, p++)\n      if (*p > maxchar) {\n        maxchar = *p;\n        maxnum = i;\n      }\n    strcpy(ans, \"\");\n    strncat(ans, str1, maxnum + 1);\n    strcat(ans, cut);\n    strcat(ans, str1 + maxnum + 1);\n    puts(ans);\n  }\n}\n"}
{"label": "20", "index": "36781", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, m;\n  int max[100];\n  char str[100][100], substr[100][100];\n  memset(max, 0, sizeof(int) * 100);\n  while (scanf(\"%s %s\", &str[i], &substr[i]) != EOF) {\n    i++;\n  } \n  for (j = 0; j < i; j++) {\n    for (k = 0; k < strlen(str[j]); k++)\n      if (str[j][k] > str[j][max[j]])\n        max[j] = k;\n  }\n  for (j = 0; j < i; j++) {\n    k = 0;\n    while (k <= max[j]) {\n      putchar(str[j][k]), k++;\n    }\n    for (m = 0; m < strlen(substr[j]); m++)\n      putchar(substr[j][m]);\n    while (k < strlen(str[j])) {\n      putchar(str[j][k]), k++;\n    }\n    putchar('\\n');\n  }\n}\n"}
{"label": "20", "index": "36782", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int n, i, k;\n  scanf(\"%s %s\", str, substr);\n  n = strlen(str);\n  k = 0;\n  for (i = 1; i < n; i++)\n    if (str[i] > str[k])\n      k = i;\n  for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n    str[i] = str[i - 3];\n  str[k + 1] = substr[0];\n  str[k + 2] = substr[1];\n  str[k + 3] = substr[2];\n  for (i = 0; i <= n + 3 - 1; i++)\n    printf(\"%c\", str[i]);\n  for (i = 0; i <= 13; i++)\n    str[i] = '\\0';\n\n  for (;;) {\n    scanf(\"%s %s\", str, substr);\n    if (str[0] == '\\0')\n      break;\n    n = strlen(str);\n    k = 0;\n    for (i = 1; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n      str[i] = str[i - 3];\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    printf(\"\\n\");\n    for (i = 0; i <= n + 3 - 1; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i <= 13; i++)\n      str[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "36783", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p, ma;\n  int i, m;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    p = str;\n    ma = *p;\n    m = 0;\n\n    for (i = 0; i < strlen(str); i++, p++) {\n      if (*p > ma) {\n        ma = *p;\n        m = i;\n      }\n    }\n\n    p = str;\n\n    for (i = 0; i <= m; i++, p++)\n      printf(\"%c\", *p);\n    cout << substr;\n    for (; i < strlen(str); i++, p++) {\n      printf(\"%c\", *p);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36784", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[3], c[1000][15];\n  char t;\n  int i, j, k, n = 0;\n  int a[1000];\n  for (i = 0; i < 1000; i++) {\n    cin >> c[i];\n    if (c[i][0] != '\u0000') {\n      a[i] = strlen(c[i]);\n      n++;\n    } else\n      break;\n  }\n  for (i = 0; i < n; i++) {\n    t = c[i][0];\n    str[1] = c[i][a[i] - 3];\n    str[2] = c[i][a[i] - 2];\n    str[3] = c[i][a[i] - 1];\n\n    for (j = 0; j < a[i] - 4; j++)\n      if (t < c[i][j])\n        t = c[i][j];\n    for (j = 0; j < a[i] - 4; j++)\n      if (t == c[i][j]) {\n        for (k = a[i] - 1; k >= j + 4; k--)\n          c[i][k] = c[i][k - 3];\n        c[i][a[i] - 1] = '\u0000';\n        c[i][j + 1] = str[1];\n        c[i][j + 2] = str[2];\n        c[i][j + 3] = str[3];\n        break;\n      }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", c[i]);\n}\n"}
{"label": "20", "index": "36785", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int i, j, len, max = 0;\n  char str[13], substr[3], t[13] = {'\\0'}, c;\n\n  scanf(\"%s\", str);\n  len = strlen(str);\n  cin >> substr;\n  c = getchar();\n\n  while (c == '\\n') {\n\n    for (i = 0; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; str[i] != max; i++)\n      ;\n    for (j = i + 1; j < len; j++)\n      t[j - i - 1] = str[j];\n    str[i + 1] = '\\0';\n    strcat(str, substr);\n    strcat(str, t);\n    puts(str);\n    for (i = 0; i < len; i++)\n      t[i] = '\\0';\n    max = 0;\n\n    scanf(\"%s\", str);\n    len = strlen(str);\n    scanf(\"%s\", substr);\n    c = getchar();\n  }\n}\n"}
{"label": "20", "index": "36786", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100], c, str[100], substr[100], x;\n  int i, j, k, s, t;\n  while (cin >> a) {\n    for (i = 0; (c = a[i]) != ' '; i++)\n      str[i] = a[i];\n    s = i + 1;\n    k = 0;\n    for (j = s; (c = a[j]) != '\u0000'; j++) {\n      substr[k] = a[j];\n      k++;\n    }\n    x = str[0];\n    for (i = 0; i < s - 1; i++)\n      if (str[i] > x) {\n        t = i + 1;\n        x = str[i];\n      }\n    for (i = 0; i < t; i++)\n      printf(\"%c\", str[i]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n    for (i = t; i < s - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36787", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11];\n  char b[4];\n  char max;\n  int i = 0, j = 0, k = 0, m = 0, y = 0, temp;\n  for (i = 0; i < 11; i++) {\n    a[i] = '\\0';\n  }\n  while (scanf(\"%s \", a)) {\n    temp = 0;\n    cin >> b;\n    max = a[0];\n    for (j = 0; j < strlen(a); j++) {\n      if (a[j] > max) {\n        max = a[j];\n        temp = j;\n      }\n    }\n    for (k = 0; k <= temp; k++) {\n      cout << a[k];\n    }\n    for (m = 0; m < 3; m++) {\n      cout << b[m];\n    }\n    for (y = temp + 1; y < strlen(a); y++) {\n      printf(\"%c\", a[y]);\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36788", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], str[4], max;\n  unsigned int position, i;\n  while (scanf(\"%s%s\", a, str) != EOF) {\n    max = a[0];\n    for (i = 0; i < strlen(a); i++)\n      if (max < a[i])\n        max = a[i];\n    for (i = 0; i < strlen(a); i++)\n      if (max == a[i]) {\n        position = i;\n        break;\n      }\n    for (i = 0; i <= position; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", str);\n    for (i = position + 1; i < strlen(a); i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36789", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[20] = {'\\0'}, substring[20] = {'\\0'};\n  while (scanf(\"%s%s\", string, substring) != EOF) {\n    char last[20] = {'\\0'}, *pointer_begin, *pointer_end;\n    int n = 0, k = 0;\n\n    for (pointer_begin = string, pointer_end = string;\n         pointer_begin - string < strlen(string); pointer_begin++)\n      if (*pointer_begin > k) {\n        k = *pointer_begin;\n        pointer_end = pointer_begin;\n        n = pointer_end - string;\n      }\n\n    strncpy(last, string, n + 1);\n    printf(\"%s\", last);\n    printf(\"%s\", substring);\n    printf(\"%s\\n\", pointer_end + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36790", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[22], b[4], c[11], d[11];\n  int s1, s2, i, j;\n  scanf(\"%s%s\", a, b);\n  do {\n\n    s1 = strlen(a);\n    s2 = strlen(b);\n    for (i = 0; i < s1; i++) {\n      int num = 0;\n      for (j = 0; j < s1; j++) {\n        if ((int)a[j] <= (int)a[i])\n          num++;\n      }\n      if (num == s1) {\n        for (j = 0; j <= i; j++) {\n          c[j] = a[j];\n        }\n        c[i + 1] = '\u0000';\n        for (j = i + 1; j < s1; j++) {\n          d[j - i - 1] = a[j];\n        }\n        d[s1 - i - 1] = '\u0000';\n        strcat(c, b);\n        strcat(c, d);\n        cout << c << \" \";\n        break;\n      }\n    }\n\n  } while (scanf(\"%s%s\", a, b) != EOF);\n}\n"}
{"label": "20", "index": "36791", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5], max;\n  int a, b, i, flag;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    a = strlen(str);\n    b = strlen(substr);\n    for (i = 0; i < a; i++) {\n      if (str[i] > max)\n        max = str[i];\n    }\n    flag = 1;\n    for (i = 0; i < a; i++) {\n      if (str[i] < max)\n        printf(\"%c\", str[i]);\n      else {\n        printf(\"%c\", max);\n        if (flag == 1)\n          printf(\"%s\", substr);\n        flag = 0;\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36792", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[100][50], result[100][50];\n  int m, length[100], i = 0, j, l, max, p, k, t;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j <= p; j++)\n      result[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      result[i][j] = str[i][length[i] + j - p - 4];\n    for (j = p + 4; j < length[i]; j++)\n      result[i][j] = str[i][j - 3];\n    for (j = length[i] - 1; j < 50; j++)\n      result[i][j] = '\u0000';\n  }\n  for (j = 0; j < l; j++) {\n    t = strlen(result[j]);\n    for (k = 0; k < t; k++)\n      printf(\"%c\", result[j][k]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36793", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {EOF};\n  for (j = 0;; j++) {\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[i]);\n    d = EOF;\n  }\n}\n"}
{"label": "20", "index": "36794", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++) {\n      if (*p > max)\n        max = *p, k = i;\n    }\n    for (p = str; p <= (str + k); p++) {\n      printf(\"%c\", *p);\n    }\n    printf(\"%s\", substr);\n    for (p = str + k + 1; *p != '\\0'; p++) {\n      printf(\"%c\", *p);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36795", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int len, max, i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (i = 0; i < len; i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    if (max != len - 1)\n      for (i = max + 1; i < len; i++)\n        printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36796", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid charu() {\n  char str[11], substr[4], c, a[11];\n  int i = 0, k, s;\n\n  scanf(\"%s %s\", str, substr);\n  k = strlen(str);\n  if (strlen(str) >= 11 || strlen(substr) >= 4)\n    return;\n  for (i = 0; i < k; i++) {\n    a[i] = str[i];\n  }\n  for (i = k; i < 11; i++)\n    a[i] = '\\0';\n\n  for (i = 0; i < k - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      c = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = c;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (str[i] == a[k - 1]) {\n      s = i;\n      break;\n    }\n  }\n  for (i = 0; i < s + 1; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = s + 1; i < k; i++)\n    printf(\"%c\", str[i]);\n  cout << \"\\n\";\n  charu();\n}\n\nint main() {\n  charu();\n  return 0;\n}\n"}
{"label": "20", "index": "36797", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int s;\n  for (;;) {\n    char str1[100], str2[5], str3[100] = {'\\0'}, m;\n    int i, l;\n    s = scanf(\"%s %s\", &str1, &str2);\n    if (s != 2)\n      break;\n    else {\n      for (i = 0, m = str1[0]; i < strlen(str1); i++) {\n        if (m < str1[i])\n          m = str1[i];\n      }\n      for (i = 0; i < strlen(str1); i++)\n        if (str1[i] == m) {\n          l = i;\n          break;\n        }\n      for (i = 0; i <= l; i++)\n        str3[i] = str1[i];\n      for (i = 0; i < 3; i++)\n        str3[l + 1 + i] = str2[i];\n      for (i = 0; i < (strlen(str1) - l - 1); i++)\n        str3[l + 4 + i] = str1[l + i + 1];\n      printf(\"%s\\n\", str3);\n    }\n  }\n}\n"}
{"label": "20", "index": "36798", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid guocheng(char str[10], char substr[3]) {\n  int i, max = 0, n, j;\n  for (i = 0; i < strlen(str); i++)\n    if (str[i] > max) {\n      max = str[i];\n      n = i;\n    }\n  for (j = 0; j <= n; j++)\n    printf(\"%c\", str[j]);\n  printf(\"%s\", substr);\n  for (j = n + 1; j < strlen(str); j++)\n    printf(\"%c\", str[j]);\n  printf(\" \");\n}\nint main() {\n  char a[100][10], b[100][3];\n  int i = 0;\nend:\n  while (scanf(\"%s%s\", a[i], b[i]) != EOF) {\n    guocheng(a[i], b[i]);\n    i++;\n    goto end;\n  }\n}\n"}
{"label": "20", "index": "36799", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[10];\n  char substr[4];\n  char str1[10];\n  char t;\n  int len, i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    strcpy(str1, str);\n    max = 0;\n    for (i = 1; i < len; i++)\n      if (str[i] > str[0]) {\n        max = i;\n        t = str[i];\n        str[i] = str[0];\n        str[0] = t;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str1[i]);\n    for (i = 0; i < 3; i++) {\n      cout << substr[i];\n    }\n    for (i = max + 1; i < len; i++)\n      cout << str1[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36800", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15] = {0};\n  char substr[3] = {0};\n  char string[500][15] = {0};\n  char max;\n  int i, x, d, j;\n  j = 0;\n\n  while (1) {\n\n    cin >> str;\n\n    d = strlen(str);\n    if (d == 0)\n      break;\n    for (i = 0; i < d; i++)\n      if (str[i] == ' ')\n        break;\n    for (x = i + 1; x <= i + 4; x++)\n      substr[x - i - 1] = str[x];\n    str[i] = '\u0000';\n    d = d - 3;\n    max = str[0];\n    x = 0;\n    for (i = 0; str[i] != '\u0000'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        x = i;\n      }\n    for (i = d - 1; i > x; i--)\n      str[i + 3] = str[i];\n    for (i = x + 1; i < x + 4; i++)\n      str[i] = substr[i - x - 1];\n    strcpy(string[j], str);\n    string[j][d + 3] = '\u0000';\n    j = j + 1;\n    for (i = 0; i < 13; i++) {\n      str[i] = 0;\n      substr[i] = 0;\n    }\n  }\n  d = j;\n  for (i = j; i < 500; i++)\n    string[i][0] = '\u0000';\n  for (i = 0; i < d; i++)\n    printf(\"%s \", string[i]);\n}\n"}
{"label": "20", "index": "36801", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[13], *p, *h;\n  int l, i, m;\n  while (cin >> str) {\n    p = str;\n    h = str;\n    m = 0;\n    l = strlen(p);\n    for (i = 0; i < (l - 4); i++) {\n      if (*h < *(p + i)) {\n        h = p + i;\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", *(p + i));\n    printf(\"%c%c%c\", *(p + l - 3), *(p + l - 2), *(p + l - 1));\n    for (i = m + 1; *(p + i) != ' '; i++)\n      printf(\"%c\", *(p + i));\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36802", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++)\n        if (str[i] >= str[j])\n          k++;\n      if (k == n)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    cout << substr;\n    for (j = i + 1; j < n; j++)\n      cout << str[j];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36803", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char from[100];\n  char to[100];\n  while (1) {\n    int max = 0;\n    char str[1000];\n    cin.getline(str, 999);\n    if (str[0] == '\\0') {\n      return 0;\n    }\n    int lenstr = strlen(str);\n    if (lenstr == 0)\n      return 0;\n    ;\n    int i;\n    for (i = 0; i < lenstr; i++) {\n      if (str[i] == ' ') {\n        break;\n      }\n      from[i] = str[i];\n    }\n    from[i] = '\\0';\n    int k;\n    k = 0;\n    for (++i; i < lenstr; i++) {\n      to[k] = str[i];\n      k++;\n    }\n    to[k] = '\\0';\n    int len;\n    len = strlen(from);\n    int maxpos = 0;\n    for (i = 0; i < len; i++) {\n      if (from[i] > max) {\n        max = from[i];\n        maxpos = i;\n      }\n    }\n    int j;\n    for (j = 0; j <= maxpos; j++)\n      printf(\"%c\", from[j]);\n\n    for (i = 0; to[i] != '\\0'; i++) {\n      printf(\"%c\", to[i]);\n    }\n\n    for (; from[j] != '\\0'; j++) {\n      printf(\"%c\", from[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36804", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100][11], m[100] = {0}, n[100] = {0}, s2[100][11];\n  int i, j, lenth1[100];\n  i = 0;\n  for (j = 0; j <= 99; j++) {\n    if (scanf(\"%s%s\", s1[j], s2[j]) != EOF) {\n      lenth1[j] = strlen(s1[j]);\n      for (i = 0; i < lenth1[j]; i++) {\n        if (((int)s1[j][i]) > ((int)m[j])) {\n          m[j] = s1[j][i];\n          n[j] = i;\n        }\n      }\n      for (i = 0; i < lenth1[j]; i++) {\n        cout << s1[j][i];\n        if (i == n[j]) {\n          printf(\"%s\", s2[j]);\n        }\n      }\n      printf(\"\\n\");\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36805", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l1;\n  char str1[15], str2[4], c, d;\n  while (scanf(\"%s\", str1) != EOF) {\n    scanf(\"%s\", str2);\n    c = 0;\n    l1 = strlen(str1);\n    for (i = 0; i < l1; i++) {\n      d = (int)str1[i];\n      if (d > c) {\n        c = d;\n        j = i;\n      }\n    }\n    for (k = l1 + 2, str1[k + 1] = '\\0'; k > j; k--)\n      str1[k] = str1[k - 3];\n\n    str1[j + 3] = str2[2];\n    str1[j + 2] = str2[1];\n    str1[j + 1] = str2[0];\n    puts(str1);\n  }\n}\n"}
{"label": "20", "index": "36806", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, p = 0, ch = 0, len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] > ch) {\n        ch = str[i];\n        p = i;\n      }\n    }\n    for (i = 0; i < len; i++) {\n      if (str[i] == str[p] && i < p) {\n        p = i;\n        break;\n      }\n    }\n    for (i = len; i >= p + 1; i--)\n      str[i + 3] = str[i];\n    for (i = p + 1; i < p + 4; i++)\n      str[i] = substr[i - 1 - p];\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36807", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], string[14];\n  char max;\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        n = i;\n        max = str[i];\n      }\n    }\n    for (i = 0; i <= n; i++)\n      string[i] = str[i];\n    for (i = n + 1; i <= n + 3; i++)\n      string[i] = substr[i - n - 1];\n    for (i = n + 4; str[i - 3] != '\\0'; i++)\n      string[i] = str[i - 3];\n    string[i] = '\\0';\n    printf(\"%s\\n\", string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36808", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[50][13], *p, substr[50][3], max;\n  int i = 0, a[50], j, k, m;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    a[i] = strlen(str[i]);\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    for (p = str[j], max = str[j][0]; p < str[j] + a[j]; p++)\n      if (*p > max)\n        max = *p;\n    for (k = 0; k < a[j]; k++)\n      if (max == str[j][k]) {\n        for (m = a[j] + 2; m > k + 3; m--)\n          str[j][m] = str[j][m - 3];\n        str[j][k + 1] = substr[j][0];\n        str[j][k + 2] = substr[j][1];\n        str[j][k + 3] = substr[j][2];\n        str[j][a[j] + 3] = '\\0';\n        break;\n      }\n    cout << str[j] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36809", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10000][100], substr[10000][100], max;\n  int i, j, k, p;\n  i = 0;\n  while (scanf(\"%s\", &str[i]) != EOF) {\n    cin >> substr[i];\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j <= strlen(str[i]) - 1; j++)\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    for (k = strlen(str[i]); k >= p + 1; k--)\n      str[i][k + 3] = str[i][k];\n    for (k = p + 1; k <= p + 3; k++)\n      str[i][k] = substr[i][k - p - 1];\n    i++;\n  }\n  for (j = 0; j <= i - 1; j++) {\n    puts(str[j]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36810", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  int i, j, k, n, m;\n  while (1) {\n    char a[50] = {'0'}, b[20] = {'0'}, c[20] = {'0'};\n    scanf(\"%s %s\", a, b);\n    if (a[0] == '\\0')\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          k++;\n      }\n      if (k == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i < n - m; i++) {\n      c[i] = a[i + m + 1];\n      a[i + m + 1] = '\\0';\n    }\n    strcat(a, b);\n    strcat(a, c);\n    if (a[0] == '0')\n      break;\n    else\n      printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36811", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], st;\n  while (scanf(\"%s\", &str) != EOF) {\n    scanf(\"%s \", substr);\n    int i = 0, k, t = 0;\n    k = strlen(str);\n    st = str[0];\n    for (i = 0; i < k; i++)\n      if (str[i] > st) {\n        st = str[i];\n        t = i;\n      }\n    for (i = 0; i < t + 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (i = t + 1; i < k; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36812", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], t;\n  int j = 0, i, len, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    t = str[0];\n    for (i = 1; i < len; i++) {\n      if (t < str[i]) {\n        k = i;\n        t = str[i];\n      }\n    }\n\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36813", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[4], k;\n  int i, j, t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (k = i = 0; str[i] != 0; i++)\n      if (str[i] > k) {\n        k = str[i];\n        j = i;\n      }\n    for (t = i + 3; t > j + 3; t--)\n      str[t] = str[t - 3];\n    for (i = 0; i < 3; i++)\n      str[j + 1 + i] = substr[i];\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36814", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {EOF};\n  for (j = 0;; j++) {\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      cout << str[i];\n    printf(\"%c\\n\", str[i]);\n    d = EOF;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36815", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nchar str[10];\nchar substr[3];\nint pan() {\n  int j, i, x, qq = strlen(str) - 1;\n  for (i = 0; i < strlen(str); i++) {\n    x = 0;\n    for (j = 0; j < strlen(str); j++) {\n      if (str[i] < str[j]) {\n        x = 0;\n        break;\n      }\n      x = 1;\n    }\n    if (x == 1) {\n      qq = i;\n      break;\n    }\n  }\n  return qq;\n}\n\nint main() {\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i;\n    for (i = 0; i <= pan(); i++)\n      cout << str[i];\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = pan() + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36816", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], k = 0, j = 0, len, i, h;\n  int max = -2000;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    len = strlen(s1);\n    max = -2000;\n    for (h = 0; h < len; h++)\n      if (s1[h] > max) {\n        max = s1[h];\n        i = h;\n      }\n    for (h = 0; h <= i; h++)\n      printf(\"%c\", s1[h]);\n    cout << s2;\n    for (h = i + 1; h < len; h++)\n      printf(\"%c\", s1[h]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36817", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, i, len;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    for (i = 1; i < len; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36818", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char a[11]) {\n  int i, n, m;\n  n = strlen(a);\n  m = 0;\n  for (i = 0; i < n - 1; i++)\n    if (a[m] < a[i + 1])\n      m = i + 1;\n  return (m);\n}\n\nint main() {\n  int i, len, m;\n  char a[11], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    len = strlen(a);\n    m = max(a);\n    for (i = 0; i <= m; i++)\n      cout << a[i];\n    for (i = 0; i < 3; i++)\n      cout << b[i];\n    for (i = m + 1; i < len; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36819", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid charu() {\n  char str[11], substr[4], c, a[11];\n  int i = 0, k, s;\n\n  scanf(\"%s %s\", str, substr);\n  k = strlen(str);\n  if (strlen(str) >= 11 || strlen(substr) >= 4)\n    return;\n  for (i = 0; i < k; i++) {\n    a[i] = str[i];\n  }\n  for (i = k; i < 11; i++)\n    a[i] = '\\0';\n\n  for (i = 0; i < k - 1; i++) {\n    if (a[i] > a[i + 1]) {\n      c = a[i];\n      a[i] = a[i + 1];\n      a[i + 1] = c;\n    }\n  }\n  for (i = 0; i < k; i++) {\n    if (str[i] == a[k - 1]) {\n      s = i;\n      break;\n    }\n  }\n  for (i = 0; i < s + 1; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = s + 1; i < k; i++) {\n    printf(\"%c\", str[i]);\n  }\n  printf(\"\\n\");\n  charu();\n}\n\nint main() { charu(); }\n"}
{"label": "20", "index": "36820", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void insert(char *a, char *b);\n  char str[14], substr[3];\n  while (scanf(\"%s\", str) != -1) {\n    scanf(\"%s\", substr);\n    insert(str, substr);\n  }\n}\n\nvoid insert(char *a, char *b) {\n  int i, n = 0, m = 1, la, lb;\n  char c[14] = {'\\0'};\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 1; i < la; i++)\n    if (*(a + i) > *(a + m - 1)) {\n      m = i + 1;\n    }\n  for (i = 0; i < la - m; i++) {\n    c[i] = *(a + m + i);\n    *(a + m + i) = '\\0';\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\n"}
{"label": "20", "index": "36821", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c1[20] = {0}, c2[3] = {0}, c3[10] = {0};\n  int m, i, j, l, n1, n2, k, max;\n  for (k = 0; k < 10000; k++) {\n    scanf(\"%s %s\", &c1, &c2);\n    n1 = strlen(c1);\n    n2 = strlen(c2);\n    strcpy(c3, c1);\n    for (i = 0, max = c1[0]; i < n1; i++)\n      if (c1[i] > max) {\n        max = c1[i];\n        m = i;\n      } else\n        max = max;\n    for (j = m + 1, l = 0; j <= i + n2, l < n2; j++, l++)\n      c1[j] = c2[l];\n    for (j = m + n2 + 1, l = m + 1; j < n1 + n2, l < n1; j++, l++)\n      c1[j] = c3[l];\n    printf(\"%s\\n\", c1);\n    for (i = 0; i < n1 + n2; i++)\n      c1[i] = 0;\n    for (i = 0; i < n2; i++)\n      c2[i] = 0;\n  }\n}\n"}
{"label": "20", "index": "36822", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint ascmax(char str[10]) {\n  int sit = 0, i;\n  char max;\n  max = str[0];\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] > max) {\n      max = str[i];\n      sit = i + 1;\n    }\n  }\n  return (sit);\n}\nvoid insert(int sit, char *pa, char *pb, char *pc) {\n  int i = 0;\n  while (i < sit) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  while (i >= sit && (i < sit + 3)) {\n    *pc = *pb;\n    pc++;\n    pb++;\n    i++;\n  }\n  while ((i >= sit + 3) && (*pa != '\\0')) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  *pc = '\\0';\n}\nint main() {\n  int sit;\n  char a[11], b[4], c[15];\n  while (scanf(\"%s\", a) != EOF) {\n    cin >> b;\n\n    sit = ascmax(a);\n    insert(sit, a, b, c);\n    puts(c);\n  }\n}\n"}
{"label": "20", "index": "36823", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, max, l2, i, l;\n  char str[100], substr[100];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    max = 0;\n    for (i = 0; i < l1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        l = i;\n      }\n    l2 = strlen(substr);\n    for (i = l1 - 1; i > l; i--)\n      str[i + l2] = str[i];\n    for (i = 0; i < l2; i++)\n      str[l + i + 1] = substr[i];\n    for (i = 0; i < l1 + l2; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36824", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, kong, max[100], hang;\n  char bi;\n  char a[100][50];\n  char b[100][50];\n  for (i = 0; i < 100; i++) {\n\n    cin >> a[i];\n    if (strlen(a[i]) == 0)\n      break;\n    max[i] = 0;\n    bi = a[i][0];\n    for (j = 1; a[i][j] != ' '; j++) {\n      if (a[i][j] > bi) {\n        bi = a[i][j];\n        max[i] = j;\n      }\n    }\n    for (j = 1; j < strlen(a[i]); j++) {\n      if (a[i][j] == ' ') {\n        kong = j;\n        break;\n      }\n    }\n    for (j = 0; j <= max[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\"%c%c%c\", a[i][kong + 1], a[i][kong + 2], a[i][kong + 3]);\n    for (j = max[i] + 4; j < strlen(a[i]) - 1; j++) {\n      printf(\"%c\", a[i][j - 3]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36825", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[15];\n  int i, m, n;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    m = 0;\n    for (i = 1; i < n; i++) {\n      if (a[i] > a[m])\n        m = i;\n    }\n    for (i = 0; i <= m; i++)\n      c[i] = a[i];\n\n    c[m + 1] = b[0];\n    c[m + 2] = b[1];\n    c[m + 3] = b[2];\n    for (i = m + 1; i < n; i++) {\n      c[3 + i] = a[i];\n    }\n    c[3 + n] = '\u0000';\n    printf(\"%s \", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36826", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][11], b[100][4];\n  int p, i = 0, j, k, t;\n  while (scanf(\"%s%s\", a[i], b[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    t = 0;\n    for (k = 1; k < strlen(a[j]); k++)\n      if (a[j][k] > a[j][t])\n        t = k;\n    for (p = 0; p <= t; p++)\n      printf(\"%c\", a[j][p]);\n    for (p = 0; p < strlen(b[j]); p++)\n      printf(\"%c\", b[j][p]);\n    for (p = t + 1; p < strlen(a[j]); p++)\n      printf(\"%c\", a[j][p]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36827", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str1[50], str2[50];\n  int i, k, n, m;\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    k = 0;\n    m = strlen(str1);\n    for (i = 0; i < m; i++) {\n      if (str1[i] > str1[k])\n        k = i;\n    }\n    n = strlen(str2);\n    for (i = strlen(str1); i > k; i--)\n      str1[i + n] = str1[i];\n    for (i = 0; i < n; i++)\n      str1[k + 1 + i] = str2[i];\n    cout << str1 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36828", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  for (;;) {\n    char s1[19], s2[4], s3[20];\n    if (scanf(\"%s%s\", s1, s2) == EOF)\n      break;\n    int l;\n    l = strlen(s1);\n    int i, j, max = 0;\n    for (i = 0; i < l; i++)\n      if (s1[i] > s1[max])\n        max = i;\n    for (i = 0; i <= max; i++)\n      s3[i] = s1[i];\n    for (i = 0, j = max + 1; i < 3; i++, j++) {\n      s3[j] = s2[i];\n    }\n    for (i = max + 1, j = max + 4; i < l; i++, j++)\n      s3[j] = s1[i];\n    s3[l + 3] = '\\0';\n    puts(s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36829", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, max = 0;\n  char str[11], substr[4], maxx = 0;\n  char zong[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    maxx = 0;\n    j = 0;\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] > maxx) {\n        max = i;\n        maxx = str[i];\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      zong[j++] = str[i];\n    }\n    for (i = 0; i <= 2; i++) {\n      zong[j++] = substr[i];\n    }\n    for (i = max + 1; i <= strlen(str) - 1; i++) {\n      zong[j++] = str[i];\n    }\n    zong[j] = '\\0';\n    printf(\"%s\\n\", zong);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36830", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, n, max;\n  char a[20], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    k = n - 1;\n    max = a[n - 1];\n    for (i = n - 1; i > 0; i--)\n      if (a[i - 1] >= max) {\n        max = a[i - 1];\n        k = i - 1;\n      }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%c%c%c\", b[0], b[1], b[2]);\n    for (i = k + 1; i <= n - 1; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36831", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, l, k, m = 0;\n  char *p1, *p2, *p3;\n  char max;\n  char str[11];\n  char substr[4];\n  char res[13];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p1 = str;\n    p2 = substr;\n    p3 = res;\n    l = strlen(str);\n    max = str[0];\n    k = 0;\n    for (i = 0; i < l; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < 13; i++) {\n      if (i <= k)\n        *(p3 + i) = *(p1 + i);\n      else if (i <= k + 3)\n        *(p3 + i) = *(p2 + i - k - 1);\n      else if (i < l + 3)\n        *(p3 + i) = *(p1 + i - 3);\n      else\n        res[i] = '\\0';\n    }\n    printf(\"%s\\n\", res);\n  }\n}\n"}
{"label": "20", "index": "36832", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  char maxs;\n  int j, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    maxs = str[0];\n    for (j = 1; j < strlen(str); j++) {\n      if (str[j] > maxs) {\n        max = j;\n        maxs = str[j];\n      }\n    }\n    for (j = 0; j <= max; j++)\n      printf(\"%c\", str[j]);\n    cout << substr;\n    for (j = max + 1; j < strlen(str); j++) {\n      if (str[j] == '\\0')\n        break;\n      else\n        printf(\"%c\", str[j]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36833", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *str, *substr, *p, *q, *max, *string;\n  int i, j, l1, l2;\n  str = (char *)calloc(15, sizeof(char));\n  substr = (char *)calloc(5, sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    l2 = strlen(substr);\n    max = str;\n    for (p = str; p - str < l1; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    string = (char *)calloc(15, sizeof(char));\n    for (p = str, i = 0; p <= max; p++, i++)\n      *(string + i) = *p;\n    for (p = substr; p - substr < l2; p++, i++)\n      *(string + i) = *p;\n    for (p = max + 1; p - str < l1; p++, i++)\n      *(string + i) = *p;\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36834", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p;\n  while (cin >> str) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p)\n        max = p;\n    for (p = str; p <= max; p++)\n      printf(\"%c\", *p);\n    cout << sub << max + 1 << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36835", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, p = 0;\n  char a[10] = {0}, b[3] = {0};\nloop:;\n  cin >> a >> b;\n  m = strlen(a);\n  for (i = 0, j = 0, p = a[0]; i < m; i++) {\n    if (p < a[i]) {\n      j = i;\n      p = a[i];\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    printf(\"%c\", a[i]);\n  }\n  for (i = 0; i < 3; i++) {\n    cout << b[i];\n  }\n  for (i = j + 1; i < m; i++) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    a[i] = '\\0';\n  }\n  for (i = 0; i < 3; i++) {\n    b[i] = '\\0';\n  }\n  if (getchar() != EOF)\n    goto loop;\n  return 0;\n}\n"}
{"label": "20", "index": "36836", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, max, m, i;\n  char str1[11], str2[4], c, s[] = \"\";\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  c = getchar();\n  n = strlen(str1);\n  while (c != '\u0000' && n != 0) {\n    max = 0;\n    m = 0;\n    for (i = 0; i < n; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"%s\", str2);\n    for (i = m + 1; i < n; i++)\n      printf(\"%c\", str1[i]);\n    printf(\" \");\n    strcpy(str1, s);\n    cin >> str1;\n    scanf(\"%s\", str2);\n    c = getchar();\n    n = strlen(str1);\n  }\n}\n"}
{"label": "20", "index": "36837", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[14], substr[14], *p = str, *p1, *p2 = substr, max;\n  int i, j, m, n, k;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = str[0];\n    p1 = str;\n    k = 0;\n    for (i = 0; i < n; i++)\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    for (p1 = str + n - 1; p1 > str + k; p1--)\n      *(p1 + 3) = *p1;\n    p1 = str;\n    *(p1 + k + 1) = *p2;\n    *(p1 + k + 2) = *(p2 + 1);\n    *(p1 + k + 3) = *(p2 + 2);\n    for (p = str; p < str + n + 3; p++)\n      printf(\"%c\", *p);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36838", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j;\n  char a[13], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    int l = strlen(a);\n    int k = 0;\n    for (j = 0; j < l; j++) {\n      if (a[j] > a[k])\n        k = j;\n    }\n    j = 0;\n    while (j <= k) {\n      printf(\"%c\", a[j]);\n      j++;\n    }\n    cout << b;\n    while (j > k && j < l) {\n      printf(\"%c\", a[j]);\n      j++;\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36839", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[30], b[10], max;\n  scanf(\"%s%s\", a, b);\n  int la, lb, index, i;\n  do {\n    la = strlen(a);\n    lb = strlen(b);\n    max = a[0];\n    index = 0;\n    for (i = 0; i < la; i++) {\n      if (a[i] > max)\n        max = a[i];\n    }\n    for (i = 0; i < la; i++) {\n      if (a[i] == max) {\n        index = i;\n        break;\n      }\n    }\n    for (i = 0; i <= index; i++)\n      printf(\"%c\", a[i]);\n    for (i = index + 1; i <= index + lb; i++)\n      printf(\"%c\", b[i - index - 1]);\n    for (i = index + lb + 1; i < la + lb; i++)\n      printf(\"%c\", a[i - lb]);\n    printf(\"\\n\");\n    scanf(\"%s\", a);\n  } while (scanf(\"%s\", b) != EOF);\n}\n"}
{"label": "20", "index": "36840", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int i, b, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    b = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[b] < str[i])\n        b = i;\n    }\n    for (i = 12; i > (b + 3); i--)\n      str[i] = str[i - 3];\n    for (i = (b + 1); i < (b + 4); i++)\n      str[i] = substr[i - b - 1];\n    cout << str << \"\\n\";\n    for (j = 0; j < 13; j++)\n      str[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36841", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], s[14];\n  int i, j;\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", substr);\n    int len;\n    int jh = 0;\n    len = strlen(str);\n    for (j = 0; j <= len - 1; j++) {\n      if (str[j] > str[jh])\n        jh = j;\n    }\n    for (j = 0; j <= jh; j++) {\n      s[j] = str[j];\n    }\n    for (j = jh + 1; j <= jh + 3; j++) {\n      s[j] = substr[j - jh - 1];\n    }\n    for (j = jh + 4; j <= len + 2; j++) {\n      s[j] = str[j - 3];\n    }\n    s[len + 3] = '\\0';\n    puts(s);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36842", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4], c;\n  int i, Max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    c = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > c) {\n        c = str[i];\n        Max = i;\n      }\n    for (i = 0; str[i] != '\\0'; i++) {\n      printf(\"%c\", str[i]);\n      if (i == Max)\n        cout << substr;\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36843", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[11], s2[4], t[20];\n  int max, i, p;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    for (i = 0; i < strlen(s1); i++) {\n      if (s1[i] > max) {\n        max = s1[i];\n        p = i;\n      }\n    }\n    strcpy(t, s1 + p + 1);\n    s1[p + 1] = '\\0';\n    strcat(s1, s2);\n    strcat(s1, t);\n    puts(s1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36844", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid output(int len, char inp[1000]) {\n  char lin1[10][10], lin2[10][3], lin3[10][13];\n  int i, j = 0, k = 0, ma = 0;\n  int max[10];\n  int lenm[10];\n  for (i = 0; i < 10; i++)\n    max[i] = 0;\n  for (i = 0; i < len; i++) {\n    if (inp[i] != 32) {\n      if (ma == 0) {\n        lenm[k] = 0;\n        for (j = 0; inp[i] != 32 && i < len; i++, j++) {\n          lin1[k][j] = inp[i];\n          lenm[k]++;\n        }\n        ma = 1;\n        continue;\n      }\n      if (ma == 1) {\n        for (j = 0; j < 3; i++, j++)\n          lin2[k][j] = inp[i];\n        ma = 0;\n        k++;\n        i--;\n      }\n    }\n  }\n  for (i = 0; i < k; i++)\n    max[i] = lin1[i][0];\n  for (i = 0; i < k; i++) {\n    for (j = 1; j < lenm[i]; j++)\n      if (lin1[i][j] > max[i]) {\n        max[i] = lin1[i][j];\n      }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i]; j++) {\n      lin3[i][j] = lin1[i][j];\n      if (lin1[i][j] == max[i]) {\n        lin3[i][j + 1] = lin2[i][0];\n        lin3[i][j + 2] = lin2[i][1];\n        lin3[i][j + 3] = lin2[i][2];\n        for (j = j + 1; j < lenm[i]; j++)\n          lin3[i][j + 3] = lin1[i][j];\n        break;\n      }\n    }\n  }\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < lenm[i] + 3; j++)\n      cout << lin3[i][j];\n    printf(\" \");\n  }\n}\n\nint main() {\n  int len[100], i, j;\n  char inp[100][100];\n  for (i = 0; i < 100; i++) {\n\n    cin >> inp[i];\n    len[i] = strlen(inp[i]);\n    if (len[i] == 0)\n      break;\n  }\n  j = i;\n  for (i = 0; i < j; i++)\n    output(len[i], inp[i]);\n}\n"}
{"label": "20", "index": "36845", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n\n\nint main() {\n  char substr[3] = {'\\0'}; \n  char str[10] = {'\\0'};\n  char out[13] = {'\\0'}; \n  int length = 0;\n  int i = 0;\n  int j = 0;\n  char temp = '\\0';\n  int num = 0;\n  while (cin >> str >> substr) \n  {\n    length = strlen(str);        \n    for (i = 0; i < length; i++) \n    {\n      if (str[i] > temp) {\n        temp = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++) \n    {\n      out[i] = str[i];\n    }\n    strcat(out, substr); \n    for (i = num + 4, j = num + 1; i < (length + 3) && j < length;\n         i++, j++) \n    {\n      out[i] = str[j];\n    }\n    num = 0; \n    temp = '\\0';\n    cout << out << endl;\n    for (i = 0; i < 13; i++) \n    {\n      out[i] = '\\0';\n    }\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36846", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100] = {'\\0'}, b[4] = {'\\0'}, *q = NULL, *p = NULL;\n  int temp = 0;\n  while (scanf(\"%s \", a)) {\n    scanf(\"%s \", b);\n    temp = 0;\n    for (p = a; p < a + strlen(a); p++) {\n      if (*p > temp)\n        temp = *p;\n    }\n    for (p = a; p < a + strlen(a); p++) {\n      if (*p == temp)\n        break;\n    }\n    for (q = a; q <= p; q++)\n      printf(\"%c\", *q);\n    cout << b;\n    for (q = p + 1; q < a + strlen(a); q++)\n      cout << *q;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36847", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100][11], m[100] = {0}, n[100] = {0}, s2[100][11];\n  int i, j, lenth1[100], lenth2[100];\n  i = 0;\n  for (j = 0; j <= 99; j++) {\n    if (scanf(\"%s%s\", s1[j], s2[j]) != EOF) {\n      lenth1[j] = strlen(s1[j]);\n      for (i = 0; i < lenth1[j]; i++) {\n        if (((int)s1[j][i]) > ((int)m[j])) {\n          m[j] = s1[j][i];\n          n[j] = i;\n        }\n      }\n      for (i = 0; i < lenth1[j]; i++) {\n        printf(\"%c\", s1[j][i]);\n        if (i == n[j]) {\n          printf(\"%s\", s2[j]);\n        }\n      }\n      printf(\"\\n\");\n    }\n  }\n}\n"}
{"label": "20", "index": "36848", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int k = 0, i, len;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    for (i = 1; i < len; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36849", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[16], substr[4];\n  int i, lenth;\n  int maxAsc = 0;\n  char maxChar = 0;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    maxAsc = 0;\n    maxChar = 0;\n    lenth = strlen(str);\n    for (i = 0; i < lenth; i++) {\n      if (maxChar < *(str + i)) {\n        maxChar = *(str + i);\n        maxAsc = i;\n      }\n    }\n    str[lenth + 3] = 0;\n    for (i = lenth - 1; i > maxAsc; i--) {\n      *(str + i + 3) = *(str + i);\n    }\n    for (i = 0; i < 3; i++) {\n      *(str + maxAsc + i + 1) = *(substr + i);\n    }\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36850", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[13], *p, *h;\n  int l, i, m;\n  while (scanf(\"%s \", str)) {\n    p = str;\n    h = str;\n    m = 0;\n    l = strlen(p);\n    for (i = 0; i < (l - 4); i++) {\n      if (*h < *(p + i)) {\n        h = p + i;\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", *(p + i));\n    cout << *(p + l - 3) << *(p + l - 2) << *(p + l - 1);\n    for (i = m + 1; *(p + i) != ' '; i++)\n      printf(\"%c\", *(p + i));\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36851", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, i, len;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    for (i = 1; i < len; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36852", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", &s1, &s2) != EOF) {\n    j = 0;\n    k = 0;\n    for (i = 0; i < strlen(s1); i++) {\n      if ((int)s1[i] > j) {\n        j = (int)s1[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < strlen(s1); i++) {\n      putchar(s1[i]);\n      if (i == k) {\n        for (j = 0; j < strlen(s2); j++)\n          putchar(s2[j]);\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36853", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[11] = {0}, s2[4] = {0}, *p;\n  int i, n, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    p = &s1[0];\n    for (i = 0; i < n; i++)\n      if (*p < s1[i])\n        p = &s1[i];\n    m = p - &s1[0] + 1;\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"%s\", s2);\n    for (i = m; s1[i] != 0; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36854", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[11], b[4], c[15];\n  while (scanf(\"%s\", a) != EOF) {\n    cin >> b;\n    char *pa, *pb, *pc;\n    char *pm;\n    int len;\n    pa = a;\n    pb = b;\n    pm = pa;\n    len = strlen(a);\n    for (; pa < a + len; pa++)\n      if (*pm < *pa) {\n        pm = pa;\n      }\n    for (pa = a, pc = c; pa <= pm; pa++, pc++)\n      *pc = *pa;\n    for (pb = b; pb < (b + 3); pb++, pc++)\n      *pc = *pb;\n    for (; pa < (a + len); pa++, pc++)\n      *pc = *pa;\n    *pc = '\\0';\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36855", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[10], s[10], p;\n  int i, t;\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", s);\n    p = str[0];\n    t = 0;\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] > p) {\n        p = str[i];\n        t = i;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", s);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36856", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[1000], s2[1000];\n  int i, j, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    i = 1;\n    while (s1[i] != '\u0000') {\n      if (s1[max] < s1[i]) {\n        max = i;\n      }\n      i++;\n    }\n    i = 0;\n    while (i <= max) {\n      putchar(s1[i]);\n      i++;\n    }\n    j = 0;\n    while (s2[j] != '\u0000') {\n      putchar(s2[j]);\n      j++;\n    }\n    while (s1[i] != '\u0000') {\n      putchar(s1[i]);\n      i++;\n    }\n    cout << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36857", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20][10], string[20][4], d;\n  int i, j, m[20] = {0}, l[20];\n  for (i = 0;; i++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str[i], &string[i]) == EOF)\n      break;\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if ((int)str[i][j] > m[i])\n        m[i] = str[i][j];\n\n    for (j = 0; str[i][j] != '\\0'; j++)\n      if (m[i] == str[i][j]) {\n        l[i] = j;\n        break;\n      }\n    for (j = 0; j <= l[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < strlen(string[i]); j++)\n      printf(\"%c\", string[i][j]);\n    for (j = l[i] + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36858", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint a(char str[]) {\n  int i, k = 0;\n  for (i = 1; i <= strlen(str) - 1; i++)\n    if (str[i] > str[k])\n      k = i;\n  return (k);\n}\nvoid b(char str[], char substr[], int k) {\n  char str2[100];\n  int i;\n  for (i = 0; i <= strlen(str) - 2 - k; i++)\n    str2[i] = str[i + k + 1];\n  str2[i] = 0;\n  str[k + 1] = '\u0000';\n  strcat(str, substr);\n  strcat(str, str2);\n}\nint main() {\n  int k, i = 0;\n  char str[100], substr[100], str1[100][100];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = a(str);\n    b(str, substr, k);\n    i++;\n    strcpy(str1[i], str);\n  }\n  for (k = 1; k <= i; k++)\n    puts(str1[k]);\n  return 0;\n}\n"}
{"label": "20", "index": "36859", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[15];\n  char str[15], substr[3];\n  int i = 0, max, n, k;\n  for (;;) {\n    i = 0;\n    if ((a[0] = getchar()) == EOF)\n      exit(-1);\n\n    cin >> a;\n    while (a[i] != ' ') {\n      str[i] = a[i];\n      i = i + 1;\n    }\n    str[i] = '\u0000';\n    substr[0] = a[i + 1];\n    substr[1] = a[i + 2];\n    substr[2] = a[i + 3];\n\n    max = 0;\n    n = strlen(str);\n    for (k = 1; k <= n - 1; k++) {\n      if (str[k] > str[max])\n        max = k;\n    }\n    for (k = n - 1; k >= max + 1; k = k - 1)\n      str[k + 3] = str[k];\n    str[max + 1] = substr[0];\n    str[max + 2] = substr[1];\n    str[max + 3] = substr[2];\n    str[n + 3] = '\u0000';\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36860", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char *a, *b, *t;\n  int i, n, max = 0;\n  a = (char *)calloc(1, 12);\n  b = (char *)calloc(1, 5);\n  t = (char *)calloc(1, 20);\n  for (; scanf(\"%s %s\", a, b) != EOF;) {\n    for (i = 0; i < (n = strlen(a)); i++) {\n      if (*(a + i) > max)\n        max = *(a + i);\n    }\n    for (i = 0; i < (n = strlen(a)); i++)\n      if (*(a + i) == max)\n        break;\n    strncat(t, a, i + 1);\n    strcat(t, b);\n    strcat(t, a + i + 1);\n    printf(\"%s\\n\", t);\n    a = (char *)calloc(1, 12);\n    b = (char *)calloc(1, 5);\n    t = (char *)calloc(1, 20);\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "36861", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n  char str[11], substr[4], *p1 = str, *p2 = substr;\n  int i = 0, max = 0;\n  char maxchar;\n  while (cin >> str) \n  {\n    cin >> substr; \n    maxchar = str[0];\n    p1 = &str[0];\n    for (i = 0; *(p1 + i) != '\\0'; i++) \n    {\n      if (*(p1 + i) > maxchar) {\n        maxchar = *(p1 + i);\n        max = i;\n      }\n    }\n    for (p1 = &str[0]; p1 <= &str[0] + max; p1++) \n    {\n      cout << *p1;\n    }\n    cout << p2;\n    for (p1 = &str[0] + max + 1; *p1 != '\\0'; p1++) {\n      cout << *p1;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36862", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][10] = {\"\\0\"}, substr[100][3] = {\"\\0\"}, a[100][13] = {\"\\0\"};\n  int i = 0, j = 0, k = 0, m = 0;\n  for (i = 0; i < 100; i++) {\n    scanf(\"%s %s\", str[i], substr[i]);\n    if (str[i][0] == '\\0') {\n      break;\n    }\n    m = strlen(str[i]);\n    for (j = 0; j < m; j++) {\n      if (str[i][j + 1] > str[i][k])\n        k = j + 1;\n    }\n    for (j = 0; j <= k; j++)\n      a[i][j] = str[i][j];\n    a[i][k + 1] = substr[i][0];\n    a[i][k + 2] = substr[i][1];\n    a[i][k + 3] = substr[i][2];\n    m = strlen(str[i]);\n    for (j = k + 1; j < m; j++)\n      a[i][j + 3] = str[i][j];\n  }\n  for (k = 0; k < i; k++) {\n    printf(\"%s\\n\", a[k]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36863", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char c1[11], c2[4];\n  char ans[20];\n  while (scanf(\"%s%s\", c1, c2) != EOF) {\n    char ans[20] = {0};\n    int i, max, max_num, n, j, m;\n    max = 0;\n    n = strlen(c1);\n    for (i = 0; i <= n; i++) {\n      if (c1[i] > max) {\n        max = c1[i];\n        max_num = i;\n      }\n    }\n    for (i = 0; i <= max_num; i++)\n      ans[i] = c1[i];\n    strcat(ans, c2);\n    n = strlen(c1);\n    m = strlen(ans);\n    j = 0;\n    for (i = max_num + 1; i <= n; i++) {\n      ans[m + j] = c1[i];\n      j++;\n    }\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36864", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4];\n  char max, c[14] = {0};\n  int i, j;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    max = a[0];\n    for (j = 1; j < strlen(a); j++) {\n      if (a[j] > max)\n        max = a[j];\n    }\n    for (i = 0; i < strlen(a); i++) {\n      if (a[i] == max)\n        break;\n    }\n    for (j = 0; j <= i; j++) {\n      c[j] = a[j];\n    }\n    for (j = i + 1; j < i + 4; j++) {\n      c[j] = b[j - i - 1];\n    }\n    for (; j < (strlen(a) + strlen(b)); j++) {\n      c[j] = a[j - 3];\n    }\n    c[j] = '\\0';\n    printf(\"%s\\n\", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36865", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char x[], char y[]) {\n  int lenx, leny;\n  int i, k, j;\n  char p;\n  lenx = strlen(x);\n  leny = strlen(y);\n  k = 0;\n  p = x[0];\n  for (i = 0; i <= lenx - 1; i++) {\n    if (x[i] > p) {\n      k = i;\n      p = x[i];\n    }\n  }\n  for (i = lenx - 1; i >= k + 1; i--)\n    x[i + 3] = x[i];\n  for (i = k + 1; i <= k + 3; i++)\n    x[i] = y[i - k - 1];\n  x[lenx + 3] = '\\0';\n}\nint main() {\n  char x[20], y[4];\n  while (scanf(\"%s %s\", x, y) != EOF) {\n\n    f(x, y);\n    printf(\"%s\\n\", x);\n  }\n}\n"}
{"label": "20", "index": "36866", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  char str[11], substr[4];\n  int m, i, e;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    m = strlen(str);\n    e = 0;\n    for (i = 1; i < m; i++) {\n      if (str[i] > str[e])\n        e = i;\n    }\n    for (i = 0; i <= e; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = e + 1; i < m - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[m - 1]);\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36867", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p1 = str, *p2 = substr;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (i = 0, k = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[k])\n        k = i;\n    }\n\n    for (j = 0; j <= k; j++) {\n      printf(\"%c\", *(p1 + j));\n    }\n    printf(\"%s\", substr);\n    for (j = 0; str[k + 1 + j] != '\\0'; j++)\n      printf(\"%c\", *(p1 + k + 1 + j));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36868", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s1[100][11];\n  char s2[100][4];\n  int i, j, m, k, p;\n  scanf(\"%s%s\", s1[0], s2[0]);\n  m = 0;\n  p = 0;\n  do {\n    m = 0;\n    for (k = 0; k < strlen(s1[p]); k++) {\n\n      if (s1[p][k] > s1[p][m])\n        m = k;\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", s1[p][i]);\n    }\n    printf(\"%s\", s2[p]);\n    for (j = m + 1; j < strlen(s1[p]); j++) {\n      printf(\"%c\", s1[p][j]);\n    }\n    printf(\"\\n\");\n    p++;\n  } while (scanf(\"%s%s\", s1[p], s2[p]) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36869", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    j = 0;\n    str[n] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= n - 1; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n; i >= j + 1; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = j + 1; i <= j + 3; i++) {\n      str[i] = substr[i - 1 - j];\n    }\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36870", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[14];\n  int i, k;\n  char p;\n  for (;;) {\n    for (i = 0; i < 11; i++)\n      a[i] = 0;\n    for (i = 0; i < 4; i++)\n      b[i] = 0;\n    for (i = 0; i < 14; i++)\n      c[i] = '\u0000';\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    scanf(\"%s\", b);\n    p = a[0];\n    k = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (p < a[i]) {\n        p = a[i];\n        k = i + 1;\n      }\n    }\n    for (i = 0; i < k; i++)\n      c[i] = a[i];\n    for (i = 0; i < 3; i++)\n      c[k + i] = b[i];\n    for (i = k; a[i] != '\u0000'; i++)\n      c[i + 3] = a[i];\n    printf(\"%s \", c);\n  }\n}\n"}
{"label": "20", "index": "36871", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[16];\n  int i, n, max, maxi;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = 0;\n    max = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      n++;\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i <= maxi; i++)\n      c[i] = a[i];\n    for (i = maxi + 1; i <= maxi + 3; i++)\n      c[i] = b[i - maxi - 1];\n    for (i = maxi + 4; i <= n + 2; i++)\n      c[i] = a[i - 3];\n    c[n + 3] = '\\0';\n    printf(\"%s\\n\", c);\n  }\n}\n"}
{"label": "20", "index": "36872", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, l;\n  char g;\n  char str[15], substr[4] = {'1', '1', '1', '\\0'}, te[15];\n  cin >> str;\n  do {\n    strcpy(te, str);\n    g = getchar();\n    for (i = 0; i < 3; i++)\n      scanf(\"%c\", &substr[i]);\n    l = strlen(str);\n    for (i = 1, k = 0; i < l; i++) {\n      if (str[k] < str[i])\n        k = i;\n    }\n    for (i = k + 1; i < l; i++) {\n      str[i + 3] = te[i];\n    }\n    str[l + 3] = '\\0';\n    for (i = 1; i < 4; i++)\n      str[k + i] = substr[i - 1];\n    puts(str);\n  } while (scanf(\"%s\", str) != EOF);\n  return 0;\n}\n"}
{"label": "20", "index": "36873", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], out[14];\n  int i, j, k;\n  char *p;\n  while (cin) {\n    int temp = 0, len;\n    cin.get(a, 11, ' ');\n    len = strlen(a);\n    cin.get();\n    cin.get(b, 4, '\\n');\n    p = a;\n    for (i = 0; i <= len - 1; i++) {\n      if (*(p + temp) < *(p + i)) {\n        temp = i;\n      }\n    }\n    for (j = 0; j <= temp; j++) {\n      out[j] = a[j];\n    }\n    for (j = temp + 1; j <= temp + 3; j++) {\n      out[j] = b[j - temp - 1];\n    }\n    for (j = temp + 4; j <= 13; j++) {\n      out[j] = a[j - 3];\n    }\n    cout << out << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36874", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], c, str[100], substr[100], x;\n  int i, j, k, s, t;\n  while (scanf(\"%s \", a)) {\n    for (i = 0; (c = a[i]) != ' '; i++)\n      str[i] = a[i];\n    s = i + 1;\n    k = 0;\n    for (j = s; (c = a[j]) != '\u0000'; j++) {\n      substr[k] = a[j];\n      k++;\n    }\n    x = str[0];\n    for (i = 0; i < s - 1; i++)\n      if (str[i] > x) {\n        t = i + 1;\n        x = str[i];\n      }\n    for (i = 0; i < t; i++)\n      printf(\"%c\", str[i]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n    for (i = t; i < s - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36875", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint findmax(char[], int);\nint main() {\n  int i, len, k;\n  int j;\n  char str[15] = {'\\0'}, substr[4] = {'\\0'};\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    len = strlen(str);\n    i = findmax(str, len);\n    for (j = len - 1; j > i; j--)\n      str[j + 3] = str[j];\n    for (j = i + 1, k = 0; j < i + 4; j++, k++)\n      str[j] = substr[k];\n    cout << str << \"\\n\";\n    for (i = 0; i < 15; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n  }\n  return 0;\n}\nint findmax(char str[], int len) {\n  int i;\n  char t;\n  t = str[0];\n  for (i = 0; i < len - 1; i++)\n    if (t < str[i + 1])\n      t = str[i + 1];\n  for (i = 0; i < len; i++)\n    if (str[i] == t)\n      return i;\n}\n"}
{"label": "20", "index": "36876", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], cmax, substr[4];\n  int i, m, j, n;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    cmax = str[0];\n    m = 0;\n    for (i = 1;; i++) {\n      if (str[i] == '\\0') {\n        n = i;\n        break;\n      } else if (str[i] > cmax) {\n        cmax = str[i];\n        m = i;\n      }\n    }\n    str[n + 3] = '\\0';\n    for (i = n + 2, j = n - 1;; i--, j--) {\n      str[i] = str[j];\n      if (j == m + 1)\n        break;\n    }\n    for (i = m + 1, j = 0; j <= 2; i++, j++) {\n      str[i] = substr[j];\n    }\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36877", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint findMax(char *str) {\n  int i, max = *str, ret = 0;\n  for (i = 0; *(str + i); i++)\n    if (*(str + i) > max)\n      max = *(str + i), ret = i;\n  return ret;\n}\n\nvoid insert(char *str, char *substr, int index) \n{\n  int i;\n  char *p;\n  \n  for (p = str + strlen(str); p > str + index; p--)\n    *(p + strlen(substr)) = *p;\n\n  for (i = 0; i < strlen(substr); i++)\n    *(str + index + 1 + i) = *(substr + i);\n}\nint main() {\n  int k;\n  char str[11], substr[4];\n  \n  \n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = findMax(str);\n\n    insert(str, substr, k);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36878", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4];\n  char max;\n  int i, j, imax;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n\n    max = a[0];\n    imax = 0;\n    for (i = 1;; i++) {\n      if (a[i] == 0)\n        break;\n      if (a[i] > max) {\n        max = a[i];\n        imax = i;\n      }\n    }\n    for (j = 0; j <= imax; j++) {\n      printf(\"%c\", a[j]);\n    }\n    cout << b[0] << b[1] << b[2];\n    for (j = imax + 1;; j++) {\n      if (a[j] == 0) {\n        printf(\"\\n\");\n        break;\n      }\n      printf(\"%c\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36879", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], string[14];\n  char max;\n  int n, i;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        n = i;\n        max = str[i];\n      }\n    }\n    for (i = 0; i <= n; i++)\n      string[i] = str[i];\n    for (i = n + 1; i <= n + 3; i++)\n      string[i] = substr[i - n - 1];\n    for (i = n + 4; str[i - 3] != '\\0'; i++) {\n      string[i] = str[i - 3];\n    }\n    string[i] = '\\0';\n    printf(\"%s\\n\", string);\n  }\n}\n"}
{"label": "20", "index": "36880", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], ans[15];\n  int i, index, max, length;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        index = i;\n      }\n    length = i;\n    strncpy(ans, str, index + 1);\n    for (i = 0; substr[i] != '\\0'; i++)\n      ans[index + 1 + i] = substr[i];\n    for (i = index + 1; str[i] != '\\0'; i++)\n      ans[i + 3] = str[i];\n    ans[length + 3] = '\\0';\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36881", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, i, j, maxASCII = 0, max;\n  char str[15], substr[4], *p = str, *q = substr;\n  while (cin >> str >> substr) {\n    maxASCII = 0;\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (*(p + i) > maxASCII) {\n        maxASCII = *(p + i);\n        max = i;\n      }\n    }\n    for (i = len - 1; i > max; i--) {\n      *(p + i + 3) = *(p + i);\n    }\n    for (i = max + 1, j = 0; i <= max + 3; i++, j++) {\n      *(p + i) = *(q + j);\n    }\n    for (i = 0; i < len + 3; i++)\n      cout << str[i];\n\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36882", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100], b[100], c, d[100];\n  int i, j = 0, k;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    k = strlen(a);\n    j = 0;\n    for (i = 1, c = a[0]; i < k; i++)\n      if (c < a[i]) {\n        c = a[i];\n        j = i;\n      }\n    for (i = 0; i <= j; i++) {\n      d[i] = a[i];\n    }\n    for (i = j + 1; i < k; i++)\n      d[i + 3] = a[i];\n    for (i = 0; i < 3; i++, j++)\n      d[j + 1] = b[i];\n    d[k + 3] = 0;\n    printf(\"%s\\n\", d);\n  }\n}\n"}
{"label": "20", "index": "36883", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint choose(char str[], int k) {\n  int i, max, maxc;\n  maxc = str[0];\n  max = 0;\n  for (i = 0; i < k; i++) {\n    if (str[i] > maxc) {\n      maxc = str[i];\n      max = i;\n    }\n  }\n  return max;\n}\nint main() {\n  static char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    int k;\n    k = strlen(str);\n    int max;\n    max = choose(str, k);\n    static char cs[11];\n    int i;\n    for (i = max + 1; i < k; i++) {\n      cs[i] = str[i];\n    }\n    for (i = max + 1; i <= max + 3; i++) {\n      str[i] = substr[i - max - 1];\n    }\n    for (i = max + 4; i < k + 3; i++) {\n      str[i] = cs[i - 3];\n    }\n    str[k + 3] = '\u0000';\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36884", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[20];\n  int i, n, a;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = 0;\n    a = strlen(str);\n    for (i = 1; i < a; i++) {\n      if (str[i] > str[n])\n        n = i;\n    }\n    for (i = 0; i < n + 1; i++) {\n      x[i] = str[i];\n    }\n    x[n + 1] = substr[0];\n    x[n + 2] = substr[1];\n    x[n + 3] = substr[2];\n    for (i = n + 4; i < a + 4; i++) {\n      x[i] = str[i - 3];\n    }\n    for (i = 0; i < a + 3; i++) {\n      printf(\"%c\", x[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36885", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void insert(char s[]);\n  char a[100][100], b[100][100];\n  int i, n;\n\n  cin >> a[1];\n\n  for (i = 2, n = 0; a[i - 1][0] != '\u0000'; i++) {\n\n    cin >> a[i];\n    n++;\n  }\n  \n  for (i = 1; i <= n; i++)\n    insert(a[i]);\n}\nvoid insert(char s[]) {\n  int n, i, j, max = 0, m;\n  char a[3];\n  n = strlen(s);\n  for (i = 1, j = n - 3; i <= 3; i++, j++)\n    a[i] = s[j];\n  for (i = 0; i < n - 4; i++)\n    max = max > s[i] ? max : s[i];\n  \n  for (i = 0; i < n - 4; i++)\n    if (s[i] == max) {\n      m = i;\n      break;\n    }\n\n  \n  for (i = 0; i <= m; i++)\n    printf(\"%c\", s[i]);\n  for (i = 1; i <= 3; i++)\n    printf(\"%c\", a[i]);\n  for (i = m + 1; i < n - 4; i++)\n    printf(\"%c\", s[i]);\n  printf(\" \");\n}\n"}
{"label": "20", "index": "36886", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, num = 0, j, h;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int max = (int)str[0], len = strlen(str);\n    for (i = 1; i < len; i++) {\n      if (max < str[i]) {\n        max = (int)str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"%s\", substr);\n    for (h = num + 1; h < len; h++) {\n      printf(\"%c\", str[h]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36887", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][11] = {0}, substr[100][4] = {0}, a[100][20] = {0}, *p, *q, *i;\n  int n, t = 1, max, x;\n  while (scanf(\"%s %s\", str[t], substr[t]) != EOF)\n    t++;\n  for (n = 1; n <= t; n++) {\n    p = str[n];\n    max = str[n][0];\n    for (; *p != 0; p++)\n      if (*p > max) {\n        max = *p;\n        q = p;\n      }\n    p = str[n];\n    for (x = 0; p <= q; x++)\n      a[n][x] = *p++;\n    a[n][x] = substr[n][0];\n    a[n][x + 1] = substr[n][1];\n    a[n][x + 2] = substr[n][2];\n    i = a[n] + x + 3;\n    strcpy(i, p);\n    printf(\"%s\\n\", a[n]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36888", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n  for (j = 0; j < ceshi; j++) {\n    dizhi[j] = str[j];\n    weizhi = 1;\n    max = *(dizhi[j]);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36889", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid str(char a[10], char b[3]) {\n  int i, l, c = a[0], k;\n  l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (c < a[i]) {\n      c = a[i];\n      k = i;\n    }\n  for (i = 0; i < k + 1; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", b[i]);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n}\nint main() {\n  char a[10], b[3];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    str(a, b);\n  return 0;\n}\n"}
{"label": "20", "index": "36890", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char str[], int i, int l) {\n  int o;\n  for (o = 0; o < l; o++)\n    if (str[o] > str[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int l;\n    l = strlen(str);\n    int i;\n    for (i = 0; i < l; i++)\n      if (max(str, i, l) == 1)\n        break;\n    int j, k;\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    for (k = 0; k < 3; k++)\n      printf(\"%c\", substr[k]);\n    for (j = i + 1; j < l; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36891", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int m;\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    int k = 0;\n    int j;\n    for (j = 1; j < m; j++)\n      if (s1[j] > s1[k])\n        k = j;\n    for (j = 0; j <= k; j++)\n      s3[j] = s1[j];\n    s3[k + 1] = s2[0];\n    s3[k + 2] = s2[1];\n    s3[k + 3] = s2[2];\n    for (j = k + 4; j < m + 3; j++)\n      s3[j] = s1[j - 3];\n    for (j = 0; j < m + 3; j++)\n      printf(\"%c\", s3[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36892", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, k;\n  char str[11];\n  char substr[4];\n  char t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    t = str[0];\n    k = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if ((str[i] - t) > 0) {\n        t = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++) {\n      printf(\"%c\", str[i]);\n    }\n    for (i = 0; substr[i] != '\\0'; i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = k + 1; str[i] != '\\0'; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36893", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n\n    char cmax = 0;\n    int point = 0;\n    cin >> str;\n    cin >> substr;\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      cout << str[i];\n\n    cout << substr;\n    for (int j = point + 1; j < length; j++)\n      cout << str[j];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36894", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n\n  char ch1[11], a1[4], A[10][14], max;\n  int i, j, n, k;\n  for (k = 0; k < 10; k++) {\n    cin >> ch1 >> a1;\n\n    n = strlen(ch1);\n    max = ch1[0];\n    for (i = 0; i < n; i++)\n      if (ch1[i] > max) {\n        j = i;\n        max = ch1[i];\n      }\n    for (i = 0; i <= j; i++)\n      A[k][i] = ch1[i];\n    for (i = j + 4; i < n + 3; i++)\n      A[k][i] = ch1[i - 3];\n\n    A[k][j + 1] = a1[0];\n    A[k][j + 2] = a1[1];\n    A[k][j + 3] = a1[2];\n    A[k][n + 3] = '\\0';\n    if (strcmp(A[k], A[k - 1]) == 0)\n      break;\n    else\n\n      cout << A[k] << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36895", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][40], su[4], s[10], max;\n  int m, length[100], i = 0, j, l, p;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      su[j] = str[i][length[i] + j - 3];\n    for (j = 0; j < length[i] - p - 5; j++)\n      s[j] = str[i][p + j + 1];\n    for (j = 0; j <= p; j++)\n      str[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      str[i][j] = su[j - p - 1];\n    for (j = p + 4; j < length[i]; j++)\n      str[i][j] = s[j - p - 4];\n    for (j = length[i] - 1; j < 40; j++)\n      str[i][j] = '\u0000';\n    cout << str[i] << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36896", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char ch = str[0];\n  a = strlen(str);\n  for (i = 1; i < a - 4; i++) {\n    if (str[i] > ch) {\n      ch = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a, length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a && j < a + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a];\n      else if (j > a + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << str1[i] << \" \";\n}\n"}
{"label": "20", "index": "36897", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], ans[15];\n  int i, index, max, length;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        index = i;\n      }\n    length = i;\n    strncpy(ans, str, index + 1);\n    for (i = 0; substr[i] != '\\0'; i++)\n      ans[index + 1 + i] = substr[i];\n    for (i = index + 1; str[i] != '\\0'; i++)\n      ans[i + 3] = str[i];\n    ans[length + 3] = '\\0';\n    cout << ans << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36898", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15];\n  char substr[4];\n  int i, maxi, L;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    maxi = 0;\n    i = 1;\n    while (str[i]) {\n      if (str[i] > str[maxi]) {\n        maxi = i;\n      }\n      i++;\n    }\n    L = strlen(str);\n    i = L;\n    while (i != maxi) {\n      str[i + 3] = str[i];\n      i--;\n    }\n    i = 0;\n    while (i < 3) {\n      str[maxi + 1 + i] = substr[i];\n      i++;\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36899", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char a[15], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    char *ptr = a;\n    char *insert = a;\n    char temp = *ptr;\n    while (*(ptr) != '\\0') {\n      if (*(ptr) > temp) {\n        temp = *(ptr);\n        insert = ptr;\n      }\n      ptr++;\n    }\n    char *move = ptr + 3;\n    while (ptr != insert) {\n      *move = *ptr;\n      move--;\n      ptr--;\n    }\n    move = b;\n    ptr++;\n    while (*(move) != '\\0') {\n      *ptr = *move;\n      move++;\n      ptr++;\n    }\n    cout << a << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36900", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], nstr[15];\n  char maxchar = '\u0000';\n  int i, j, len, max = 0;\n  while (1) {\n    maxchar = '\u0000';\n    if ((str[0] = getchar()) == EOF)\n      exit(-1);\n\n    cin >> &str[1];\n    len = strlen(str);\n    for (i = len - 5; i >= 0; i--) {\n      if (str[i] >= maxchar) {\n        max = i;\n        maxchar = str[i];\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      nstr[i] = str[i];\n    }\n    for (i = max + 1; i < len - 4; i++) {\n      nstr[i + 3] = str[i];\n    }\n    for (i = len - 3, j = 1; i < len; i++, j++) {\n      nstr[max + j] = str[i];\n    }\n    nstr[len - 1] = '\u0000';\n    printf(\"%s \", nstr);\n  }\n}\n"}
{"label": "20", "index": "36901", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][100], substr[1000][300];\n  int i = 0, j, max, m;\n  char a;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF)\n    i++;\n  m = i;\n  for (i = 0; i < m; i++) {\n    a = str[i][0];\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > a) {\n        a = str[i][j];\n        max = j;\n      }\n    }\n    for (j = 0; j <= max; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[i][j]);\n    for (j = max + 1; str[i][j] != '\\0'; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36902", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[20][13], str[3], S[20][13];\n  int i, j, k, n, max;\n  for (i = 1; (s[i][0] = getchar()) != EOF; i++) {\n    s[i][1] = '\u0000';\n\n    cin >> S[i];\n    strcat(s[i], S[i]);\n  }\n  n = i - 1;\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 1; s[i][j] != ' '; j++) {\n      if (s[i][j] > s[i][max])\n        max = j;\n    }\n\n    k = j - 1;\n    str[0] = s[i][k + 2];\n    str[1] = s[i][k + 3];\n    str[2] = s[i][k + 4];\n    for (j = k; j > max; j--)\n      s[i][j + 3] = s[i][j];\n    s[i][max + 1] = str[0];\n    s[i][max + 2] = str[1];\n    s[i][max + 3] = str[2];\n    for (j = 0; j <= k + 3; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36903", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint count(char str[10], int len) {\n  int i;\n  int maxi = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] > str[maxi])\n      maxi = i;\n  }\n  return maxi;\n}\n\nint main() {\n  int n, len, j;\n  char sa[14], str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    n = count(str, len);\n    for (j = 0; j <= n; j++)\n      sa[j] = str[j];\n    for (j = n + 1; j <= n + 3; j++)\n      sa[j] = substr[j - n - 1];\n    for (j = n + 4; j <= len + 2; j++)\n      sa[j] = str[j - 3];\n    sa[len + 3] = '\\0';\n    cout << sa << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36904", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20] = {0}, substr[4] = {0}, max = 0, medium[20] = {0};\n  int i, j, length, mark;\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    max = 0;\n    length = strlen(str);\n    for (i = 0; i < length; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        mark = i;\n      }\n    }\n    for (j = 0, i = mark + 1; i < length; i++, j++) {\n      medium[j] = str[i];\n      str[i] = 0;\n    }\n    strcat(str, substr);\n    strcat(str, medium);\n    printf(\"%s\\n\", str);\n    for (i = 0; i < 10; i++) {\n      medium[i] = 0;\n      str[i] = 0;\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36905", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    j = 0;\n    str[n] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= n - 1; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n; i >= j + 1; i--)\n      str[i + 3] = str[i];\n\n    for (i = j + 1; i <= j + 3; i++)\n      str[i] = substr[i - 1 - j];\n\n    str[n + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36906", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int position, i, lena, lenb, n = 10;\n  char a[10], b[4], *p = NULL, max;\n  while (n--) {\n    max = 0;\n    memset(a, '\\0', sizeof a);\n    memset(b, '\\0', sizeof b);\n    cin >> a;\n    cin >> b;\n    lena = strlen(a);\n    lenb = strlen(b);\n    p = &a[0];\n    for (i = 0; i < lena; i++) {\n      if (*p > max) {\n        max = *p;\n        position = i;\n      }\n      p += 1;\n    }\n    for (i = 0; i <= position; i++)\n      cout << a[i];\n    printf(\"%s\", b);\n    for (i = position + 1; i < lena; i++)\n      cout << a[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36907", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int len, max, i;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (i = 0; i < len; i++) {\n      if (str[i] > str[max])\n        max = i;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    if (max != len - 1)\n      for (i = max + 1; i < len; i++)\n        printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36908", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], out[14];\n  int i, j, k;\n  char *p;\n  while (cin) {\n    int temp = 0, len;\n    cin.get(a, 11, ' ');\n    len = strlen(a);\n    cin.get();\n    cin.get(b, 4, '\\n');\n    p = a;\n    for (i = 0; i <= len - 1; i++) {\n      if (*(p + temp) < *(p + i)) {\n        temp = i;\n      }\n    }\n    for (j = 0; j <= temp; j++) {\n      out[j] = a[j];\n    }\n    for (j = temp + 1; j <= temp + 3; j++) {\n      out[j] = b[j - temp - 1];\n    }\n    for (j = temp + 4; j <= 13; j++) {\n      out[j] = a[j - 3];\n    }\n    printf(\"%s\\n\", out);\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36909", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[20][13], str[3];\n  int i, j, k, n, max;\n  for (i = 1;; i++) {\n\n    cin >> s[i];\n    k = strlen(s[i]);\n    max = 0;\n    if (s[i][0] == '1' && s[i][1] == '2' && s[i][2] == '3' && s[i][3] == '4' &&\n        i == 2) {\n      n = i;\n      break;\n    } else if (s[i - 1][0] == '+' && s[i - 1][1] == '2' && s[i - 1][2] == '-' &&\n               s[i - 1][3] == '2' && i == 6 && s[i][0] != '#') {\n      n = i - 1;\n      break;\n    } else {\n      if (s[i][0] == '1' && s[i][1] == '2' && s[i][2] == '3' &&\n          s[i][3] == '4' && i == 10) {\n        n = i;\n        break;\n      } else {\n        for (j = 0; j <= 12; j++) {\n          if (s[i][j] == ' ')\n            max = 1;\n        }\n        if (max == 0) {\n          n = i - 1;\n          break;\n        }\n      }\n    }\n  }\n  for (i = 1; i <= n; i++) {\n    max = 0;\n    for (j = 1; s[i][j] != ' '; j++) {\n      if (s[i][j] > s[i][max])\n        max = j;\n    }\n\n    k = j - 1;\n    str[0] = s[i][k + 2];\n    str[1] = s[i][k + 3];\n    str[2] = s[i][k + 4];\n    for (j = k; j > max; j--)\n      s[i][j + 3] = s[i][j];\n    s[i][max + 1] = str[0];\n    s[i][max + 2] = str[1];\n    s[i][max + 3] = str[2];\n    for (j = 0; j <= k + 3; j++)\n      printf(\"%c\", s[i][j]);\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36910", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4], c;\n  int t, i, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    c = str[0];\n    t = 0;\n    l = strlen(str);\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > c) {\n        c = str[i];\n        t = i;\n      }\n    for (i = 0; i <= t; i++)\n      cout << str[i];\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = t + 1; i < l; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36911", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c[10], s[4];\n  int k, x;\n  char p;\n  while (scanf(\"%s %s\", c, s) != EOF) {\n    for (k = 0, p = '0'; k < 10 && (c[k]) != '\\0'; k++) {\n      if (p < c[k]) {\n        p = c[k];\n        x = k;\n      }\n    }\n    for (k = 0; k <= x; k++) {\n      printf(\"%c\", c[k]);\n    }\n    for (k = 0; k < 4 && (s[k] != '\\0'); k++) {\n      cout << s[k];\n    }\n    for (k = x + 1; k < 10 && (c[k] != '\\0'); k++) {\n      printf(\"%c\", c[k]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36912", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m = 0, n = 0, i = 0, j = 0, p = 0;\n  char a[10] = {0}, b[3] = {0};\nloop:;\n  cin >> a >> b;\n  m = strlen(a);\n  for (i = 0, j = 0, p = a[0]; i < m; i++) {\n    if (p < a[i]) {\n      j = i;\n      p = a[i];\n    }\n  }\n  for (i = 0; i <= j; i++) {\n    printf(\"%c\", a[i]);\n  }\n  for (i = 0; i < 3; i++) {\n    printf(\"%c\", b[i]);\n  }\n  for (i = j + 1; i < m; i++) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n  for (i = 0; i < m; i++) {\n    a[i] = '\\0';\n  }\n  for (i = 0; i < 3; i++) {\n    b[i] = '\\0';\n  }\n  if (getchar() != EOF)\n    goto loop;\n  return 0;\n}\n"}
{"label": "20", "index": "36913", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[4], string[12];\n  int i, j = 0, max;\n  while (scanf(\"%s %s\", string, str) != EOF) {\n    max = 0;\n    j = 0;\n    for (i = 0; i < strlen(string); i++)\n      if (string[i] > string[max]) {\n        max = i;\n      }\n    for (i = strlen(string); i >= max + 1; i--)\n      string[i + 3] = string[i];\n    for (i = max + 1; i < max + 4; i++, j++)\n      string[i] = str[j];\n    for (i = 0; string[i] != '\\0'; i++)\n      printf(\"%c\", string[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36914", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid body() {\n  char str[11];\n  char substr[4];\n  char c;\n  int i = 0, k;\n  char *p;\n  scanf(\"%s %s\", str, substr);\n  c = *(str + strlen(str) - 1);\n  k = strlen(str);\n  for (i = strlen(str) - 1; i > -1; i--) {\n    if (str[i] >= c) {\n      k = i + 1;\n      c = *(str + i);\n    }\n  }\n  p = str;\n  if (strlen(str) >= 11 || strlen(substr) >= 4) {\n    return;\n  }\n  for (i = 0; i < k; i++) {\n    printf(\"%c\", *(p + i));\n  }\n  printf(\"%s\", substr);\n  printf(\"%s\\n\", p + i);\n  body();\n}\n\nint main() { body(); }\n"}
{"label": "20", "index": "36915", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++) {\n      if (*p > max)\n        max = *p, k = i;\n    }\n    for (p = str; p <= (str + k); p++)\n      printf(\"%c\", *p);\n\n    printf(\"%s\", substr);\n    for (p = str + k + 1; *p != '\\0'; p++) {\n      printf(\"%c\", *p);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36916", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, n;\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++)\n        if (str[i] >= str[j])\n          k++;\n      if (k == n)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    cout << substr;\n    for (j = i + 1; j < n; j++)\n      printf(\"%c\", str[j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36917", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, c[10] = {0};\n  char a[10][100] = {'\\0'}, b[10][3] = {'\\0'}, m;\n  for (i = 0;; i++)\n\n    if (EOF == scanf(\"%s %s\", a[i], b[i]))\n      break;\n\n  for (j = 0; j < i; j++) {\n    for (k = 0, m = a[j][0]; k < strlen(a[j]) - 1; k++) {\n      if (m < a[j][k + 1]) {\n        c[j] = k + 1;\n        m = a[j][k + 1];\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    for (k = strlen(a[j]) - 1; k > c[j]; k--)\n      a[j][k + 3] = a[j][k];\n    a[j][c[j] + 1] = b[j][0];\n    a[j][c[j] + 2] = b[j][1];\n    a[j][c[j] + 3] = b[j][2];\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%s\\n\", a[j]);\n}\n"}
{"label": "20", "index": "36918", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char c[100][100];\n  int i = 0, j, count, max, m, b[100];\n  do {\n\n    cin >> c[i];\n    b[i] = strlen(c[i]);\n    i++;\n  } while (c[i - 1][0] != '\u0000');\n  m = i - 1;\n  for (i = 0; i < m; i++) {\n    max = 0;\n    count = 0;\n    for (j = 0; j < b[i] - 4; j++) {\n      if (c[i][j] > max) {\n        max = c[i][j];\n        count = j;\n      }\n    }\n    for (j = 0; j <= count; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    for (j = b[i] - 3; j <= b[i] - 1; j++)\n      printf(\"%c\", c[i][j]);\n\n    for (j = count + 1; j < b[i] - 4; j++) {\n      printf(\"%c\", c[i][j]);\n    }\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "36919", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, max1;\n  char str[20], substr[4], ans[20];\n  char *p = str, *q = substr;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; str[i]; i++) {\n      if (str[i] > max) {\n        max = str[i], max1 = i;\n      }\n    }\n    strcpy(ans, \"\");\n    strncat(ans, str, max1 + 1);\n    strcat(ans, substr);\n    strcat(ans, str + max1 + 1);\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36920", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s[20], sub[10];\n  int i, j, k, ls, lsub;\n  while (scanf(\"%s%s\", s, sub) != EOF) {\n    ls = strlen(s);\n    lsub = strlen(sub);\n    k = 0;\n    for (i = 1; i < ls; i++)\n      if (s[i] > s[k])\n        k = i;\n    for (i = ls; i > k; i--)\n      s[i + lsub] = s[i];\n    for (i = k + 1, j = 0; j < lsub; i++, j++)\n      s[i] = sub[j];\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36921", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, max = 0;\n  char str1[11], substr[4], str2[14], str3[11];\n  while (scanf(\"%s %s\", str1, substr) != EOF) {\n    for (i = 0; i < 14; i++) {\n      str2[i] = '\\0';\n      str3[i] = '\\0';\n    }\n    max = 0;\n    for (i = 0; str1[i] != '\\0'; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        k = i;\n      }\n    strncpy(str2, str1, k + 1);\n    strcat(str2, substr);\n    for (i = k + 1, j = 0; str1[i] != '\\0'; i++, j++) {\n      str3[j] = str1[i];\n    }\n    strcat(str2, str3);\n    cout << str2 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36922", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int l = 0, i = 0;\n  char str[11] = {\"\"}, substr[3] = {\"\"}, str2[11] = {\"\"};\n  char *p;\n\nLOOP:\n  scanf(\"%s %s \", str, substr);\n  if (strcmp(str2, str) == 0)\n    goto END;\n  l = strlen(str);\n  p = str;\n  for (i = 0; i < l; i++) {\n    if (*p < str[i])\n      p = &str[i];\n    else\n      ;\n  }\n\n  for (i = 0; i < l; i++) {\n    printf(\"%c\", str[i]);\n    if (&str[i] == p)\n      printf(\"%s\", substr);\n  }\n  printf(\"\\n\");\n  strcpy(str2, str);\n  goto LOOP;\nEND:;\n}\n"}
{"label": "20", "index": "36923", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[3], *p, *max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (p = str, max = p; *p != '\\0'; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    for (p = str; p <= max; p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    for (p = max + 1; *p != '\\0'; p++)\n      printf(\"%c\", *p);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36924", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n\n  char str[11], substr[4];\n  while (scanf(\"%s \", str)) {\n    cin >> substr;\n    char *max = str, temp;\n    int i;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > *max) {\n        max = &str[i];\n        temp = *max;\n      }\n    *max = 0;\n    printf(\"%s%c%s%s\\n\", str, temp, substr, max + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36925", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[4];\n  while (cin >> str >> substr) {\n    int i, position, length;\n    char max = str[0];\n    length = strlen(str);\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        position = i;\n      }\n    }\n    for (i = length - 1; i >= position + 1; i--)\n      str[i + 3] = str[i];\n    for (i = position + 1; i < position + 4; i++)\n      str[i] = substr[i - position - 1];\n    str[length + 3] = '\\0';\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36926", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char string[20] = {'\\0'}, substring[20] = {'\\0'};\n  while (scanf(\"%s%s\", string, substring) != EOF) {\n    char last[20] = {'\\0'}, *pointer_begin, *pointer_end;\n    int n = 0, k = 0;\n\n    for (pointer_begin = string, pointer_end = string;\n         pointer_begin - string < strlen(string); pointer_begin++)\n      if (*pointer_begin > k) {\n        k = *pointer_begin;\n        pointer_end = pointer_begin;\n        n = pointer_end - string;\n      }\n\n    strncpy(last, string, n + 1);\n    printf(\"%s\", last);\n    cout << substring;\n    printf(\"%s\\n\", pointer_end + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36927", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[5];\n  int i, n = 0, l;\n  while (scanf(\"%s %s\", &a, &b) != EOF) {\n    l = strlen(a);\n    int max;\n    char *p = &a[0];\n    max = *p;\n    for (i = 0; i < l; i++, p++) {\n      if (*p > max) {\n        max = *p;\n        n = i;\n      }\n    }\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    if (n < l - 1) {\n      for (i = n + 1; i < l - 1; i++)\n        printf(\"%c\", a[i]);\n      printf(\"%c\\n\", a[l - 1]);\n    } else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36928", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[16];\n  int i, n, max, maxi;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = 0;\n    max = 0;\n    for (i = 0; a[i] != '\\0'; i++)\n      n++;\n    for (i = 0; i <= n - 1; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i <= maxi; i++)\n      c[i] = a[i];\n    for (i = maxi + 1; i <= maxi + 3; i++)\n      c[i] = b[i - maxi - 1];\n    for (i = maxi + 4; i <= n + 2; i++)\n      c[i] = a[i - 3];\n    c[n + 3] = '\\0';\n    cout << c << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36929", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *p, s[10], subs[4];\n  while (scanf(\"%s %s\", s, subs) != EOF) {\n    int n, i;\n    n = strlen(s);\n    p = &s[0];\n    for (i = 1; i < n; i++)\n      if (s[i] > *p)\n        p = &s[i];\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", s[i]);\n      if (&s[i] == p)\n        printf(\"%s\", subs);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36930", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int index, i;\n  char str[11], substr[4], w[14], max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    index = 0;\n    for (i = 0; i <= strlen(str); i++) {\n      if (str[i] > max) {\n        index = i;\n        max = str[i];\n      }\n    }\n    w[0] = '\\0';\n    strncat(w, str, index + 1);\n    strcat(w, substr);\n    strcat(w, str + index + 1);\n    printf(\"%s\\n\", w);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36931", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p1 = str, *p2 = substr;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    for (i = 0, k = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[k])\n        k = i;\n    }\n\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", *(p1 + j));\n    printf(\"%s\", substr);\n    for (j = 0; str[k + 1 + j] != '\\0'; j++)\n      printf(\"%c\", *(p1 + k + 1 + j));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36932", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[20], in[4];\n\n  char *p, *q;\n  while (cin >> word >> in) {\n    p = word;\n    q = word;\n    while (1) {\n      if (*p == '\\0')\n        break;\n      if (*p - *q > 0)\n        q = p;\n      p++;\n    }\n    p = word;\n    while (1) {\n      if (*p == '\\0') {\n        cout << endl;\n        break;\n      }\n      cout << *p;\n      if (p == q)\n        cout << in[0] << in[1] << in[2];\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36933", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][15] = {'\u0000'};\n  int n, i, j;\n  for (i = 0; i < 1000; i++) {\n\n    cin >> a[i];\n    n = strlen(a[i]);\n    if (n == 0)\n      break;\n  }\n  int k = i;\n  int max, p;\n  for (i = 0; i < k; i++) {\n    max = a[i][0];\n    p = 0;\n    n = strlen(a[i]);\n    for (j = 0; j < n - 4; j++) {\n      if (a[i][j] > max) {\n        max = a[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j <= p; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\"%c%c%c\", a[i][n - 3], a[i][n - 2], a[i][n - 1]);\n    for (j = p + 1; j < n - 4; j++) {\n      cout << a[i][j];\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36934", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[15];\n  char str[15], substr[3];\n  int i = 0, max, n, k;\n  for (;;) {\n    i = 0;\n    if ((a[0] = getchar()) == EOF)\n      exit(-1);\n\n    scanf(\"%s \", a);\n    while (a[i] != ' ') {\n      str[i] = a[i];\n      i = i + 1;\n    }\n    str[i] = '\u0000';\n    substr[0] = a[i + 1];\n    substr[1] = a[i + 2];\n    substr[2] = a[i + 3];\n\n    max = 0;\n    n = strlen(str);\n    for (k = 1; k <= n - 1; k++) {\n      if (str[k] > str[max])\n        max = k;\n    }\n    for (k = n - 1; k >= max + 1; k = k - 1)\n      str[k + 3] = str[k];\n    str[max + 1] = substr[0];\n    str[max + 2] = substr[1];\n    str[max + 3] = substr[2];\n    str[n + 3] = '\u0000';\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36935", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint ascmax(char str[10]) {\n  int sit = 0, i;\n  char max;\n  max = str[0];\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] > max) {\n      max = str[i];\n      sit = i + 1;\n    }\n  }\n  return (sit);\n}\nvoid insert(int sit, char *pa, char *pb, char *pc) {\n  int i = 0;\n  while (i < sit) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  while (i >= sit && (i < sit + 3)) {\n    *pc = *pb;\n    pc++;\n    pb++;\n    i++;\n  }\n  while ((i >= sit + 3) && (*pa != '\\0')) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  *pc = '\\0';\n}\nint main() {\n  int sit;\n  char a[11], b[4], c[15];\n  while (scanf(\"%s\", a) != EOF) {\n    cin >> b;\n\n    sit = ascmax(a);\n    insert(sit, a, b, c);\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36936", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n\n{\n\n  char str[13];\n\n  char sub[4];\n\n  int i, la;\n\n  int max, t;\n\n  while (scanf(\"%s %s\", str, sub) != EOF)\n\n  {\n\n    max = 0;\n\n    la = strlen(str);\n\n    for (i = 0; i < la; i++)\n\n    {\n\n      if (max < str[i]) {\n        t = i;\n        max = str[i];\n      } \n    }\n\n    for (i = la - 1; i > t; i--)\n\n    {\n\n      str[i + 3] = str[i]; \n    }\n\n    str[t + 1] = sub[0];\n\n    str[t + 2] = sub[1];\n\n    str[t + 3] = sub[2];\n\n    for (i = 0; i < la + 3; i++)\n\n      printf(\"%c\", str[i]);\n\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36937", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int s1, s2, i, j, t, max;\n  char str[20], substr[5], a[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    s1 = strlen(str);\n    s2 = strlen(substr);\n    max = 0;\n    for (i = 0; i < s1; i++)\n      if (max < str[i]) {\n        max = str[i];\n        t = i;\n      }\n    j = 0;\n    for (i = t + 1; i < s1; i++) {\n      a[j] = str[i];\n      j++;\n    }\n    j = 0;\n    for (i = t + 1; i < t + s2 + 1; i++) {\n      str[i] = substr[j];\n      j++;\n    }\n    j = 0;\n    for (i = t + s2 + 1; i < s1 + s2; i++) {\n      str[i] = a[j];\n      j++;\n    }\n    for (i = 0; i < s1 + s2 - 1; i++)\n      cout << str[i];\n    printf(\"%c\\n\", str[s1 + s2 - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36938", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n    char ansstr[14] = {'\\0'};\n    char cmax = 0;\n    int point = 0;\n    cin >> str;\n    cin >> substr;\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      cout << str[i];\n\n    cout << substr;\n    for (int j = point + 1; j < length; j++)\n      cout << str[j];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36939", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char str[500], sub[4], *st = str, *su = sub, c;\n  while (scanf(\"%s%s\", str, sub)) {\n    k = strlen(str);\n    if (k == 0)\n      break;\n    c = *st;\n    j = 0;\n    for (i = 0; i < k; i++)\n      if (*(st + i) > c) {\n        c = *(st + i);\n        j = i;\n      }\n    for (i = k; i > j; i--)\n      *(st + i + 3) = *(st + i);\n    for (i = 1; i < 4; i++)\n      *(st + j + i) = *(su + i - 1);\n    printf(\"%s\\n\", st);\n    *st = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36940", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char max(char a[10]);\n  char a[100][15] = {'\\0'}, b[100][3];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    if (a[i][0] == '\\0')\n      break;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int m = strlen(a[i]);\n    char c[13] = {0};\n    int k = 0;\n    for (j = 0; j < m; j++) {\n      if (k == 0)\n        c[j] = a[i][j];\n      else if (k > 0)\n        c[j + 3] = a[i][j];\n      if ((a[i][j] == max(a[i])) && (k == 0)) {\n        c[j] = a[i][j];\n        c[j + 1] = b[i][0];\n        c[j + 2] = b[i][1];\n        c[j + 3] = b[i][2];\n        k++;\n      }\n    }\n    if (i < count - 1) {\n      printf(\"%s\\n\", c);\n    } else if (i == count - 1)\n      printf(\"%s\\n\", c);\n  }\n  return 0;\n}\nchar max(char a[10]) {\n  int i;\n  char t = a[0];\n  for (i = 0; i < 10; i++)\n    if (a[i] > t)\n      t = a[i];\n  return (t);\n}\n"}
{"label": "20", "index": "36941", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str1[14] = {\"a\"}, str2[4] = {\"a\"}, str3[14] = {\"a\"}, str[14] = {\"a\"};\n  int i, n, k, p;\n  char max;\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    str3[0] = '\\0';\n    str[0] = '\\0';\n    p = 0;\n    n = strlen(str1);\n    max = str1[0];\n    for (i = 0; i < n; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        k = i;\n      }\n    for (i = k + 1; i < n; i++) {\n      str3[p] = str1[i];\n      p++;\n    }\n    str3[p] = '\\0';\n    strncpy(str, str1, k + 1);\n    str[k + 1] = '\\0';\n    strcat(str, str2);\n    strcat(str, str3);\n    puts(str);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36942", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[14] = {' '};\n  char b[4] = {' '};\n  while (cin.get(a, 11, ' ')) {\n    cin.get();\n    cin.get(b, 4, '\\n');\n    int k = 0;\n    char max = NULL;\n    for (int j = 0; j < strlen(a); j++)\n      if (a[j] > max) {\n        max = a[j];\n        k = j;\n      }\n    for (int i = strlen(a) - 1; i > k; i--)\n      a[i + 3] = a[i];\n    a[k + 1] = b[0];\n    a[k + 2] = b[1];\n    a[k + 3] = b[2];\n    cout << a << \"\\n\";\n    for (int p = 0; p < 14; p++)\n      a[p] = '\\n';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36943", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char str[10] = {0}, substr[3] = {0}, m = 0;\n\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = 0;\n    n = 0;\n\n    for (i = 0; i < 10; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        n = i;\n      }\n    }\n\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = n + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36944", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint f(char a[]) {\n  int i, l, l0, b = 0;\n  l = strlen(a);\n  for (i = 0; i < l; i++) {\n    if (b < a[i]) {\n      b = a[i];\n      l0 = i;\n    }\n  }\n  return (l0);\n}\nint main() {\n  char s1[11], s2[4], s[14];\n  int j, i, l, l0;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    l0 = f(s1);\n    for (i = 0; i <= l0; i++)\n      s[i] = s1[i];\n    for (j = 0, i = l0 + 1; j < 3; j++, i++)\n      s[i] = s2[j];\n    for (j = l0 + 1, i = l0 + 4; j <= l; j++, i++)\n      s[i] = s1[j];\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "20", "index": "36945", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n  ceshi = j;\n  *dizhi = str[j];\n\n  for (j = 0; j < ceshi; j++) {\n\n    weizhi = 1;\n    max = *(*dizhi);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      cout << *(c + i);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36946", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char mid, a[100][50];\n  int i = 0, j = 0, k = 0, m, b[100];\n  do {\n\n    cin >> a[i];\n    b[i] = strlen(a[i]);\n    i++;\n  } while (a[i - 1][0] != '\u0000');\n\n  m = i - 1;\n\n  for (i = 0; i < m; i++) {\n    k = 0;\n    mid = a[i][0];\n    for (j = 1; j < b[i] - 4; j++) {\n      if (a[i][j] > mid) {\n        mid = a[i][j];\n        k = j;\n      }\n    }\n    for (j = 0; j <= k; j++) {\n      cout << a[i][j];\n    }\n    for (j = b[i] - 3; j < b[i]; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    for (j = k + 1; j < b[i] - 4; j++) {\n      printf(\"%c\", a[i][j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36947", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid into(char x[], char y[]) {\n  int l, i, m = 0, k = 0;\n  char a[10] = {'\\0'};\n  l = strlen(x);\n  for (i = 1; i < l; i++) {\n    if (x[i] > x[m])\n      m = i;\n  }\n  for (i = m + 1; i < l; i++) {\n    a[k++] = x[i];\n    x[i] = '\\0';\n  }\n  strcat(x, y);\n  strcat(x, a);\n}\nint main() {\n  int d;\n  for (d = 0; d < 10; d++) {\n    char str[14] = {'\\0'}, substr[4] = {'\\0'};\n    cin >> str >> substr;\n    into(str, substr);\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36948", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], a[11];\n  int i, j, k, len, p;\n  while (cin.get(str, 11, ' ')) {\n    p = 0;\n    k = 0;\n    len = strlen(str);\n    cin.get();\n    cin.getline(substr, 4);\n    for (i = 0; i < len - 1; i++)\n      for (j = i + 1; j < len; j++)\n        if (str[i] > str[j])\n          if (str[i] > str[p])\n            p = i;\n    for (j = p + 1; j < len; j++)\n      a[k++] = str[j];\n    a[k] = '\\0';\n    k = 0;\n    str[p + 1] = substr[0];\n    str[p + 2] = substr[1];\n    str[p + 3] = substr[2];\n    for (i = p + 4; i < len + 3; i++)\n      str[i] = a[k++];\n    str[i] = '\\0';\n    cout << str;\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36949", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][11] = {0}, substr[100][4] = {0}, a[100][20] = {0}, *p, *q, *i;\n  int n, t = 1, max, x;\n  while (scanf(\"%s %s\", str[t], substr[t]) != EOF)\n    t++;\n  for (n = 1; n <= t; n++) {\n    p = str[n];\n    max = str[n][0];\n    for (; *p != 0; p++)\n      if (*p > max) {\n        max = *p;\n        q = p;\n      }\n    p = str[n];\n    for (x = 0; p <= q; x++)\n      a[n][x] = *p++;\n    a[n][x] = substr[n][0];\n    a[n][x + 1] = substr[n][1];\n    a[n][x + 2] = substr[n][2];\n    i = a[n] + x + 3;\n    strcpy(i, p);\n    printf(\"%s\\n\", a[n]);\n  }\n}\n"}
{"label": "20", "index": "36950", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l = 0, m = 0, i = 0;\n  char str[20], sub[5];\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    l = strlen(str);\n\n    for (i = 0; str[i] != '\\0'; i++) {\n      if (str[i] > str[m])\n        m = i;\n    }\n\n    for (i = l + 2; i >= m + 4; i--) {\n      str[i] = str[i - 3];\n    }\n\n    str[m + 1] = sub[0];\n    str[m + 2] = sub[1];\n    str[m + 3] = sub[2];\n    str[l + 3] = '\\0';\n\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36951", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    j = 0;\n    str[n] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= n - 1; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = n; i >= j + 1; i--)\n      str[i + 3] = str[i];\n\n    for (i = j + 1; i <= j + 3; i++)\n      str[i] = substr[i - 1 - j];\n\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "36952", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, s, k;\n  char a[15], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    s = 0;\n    k = 0;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      if (a[i] > k) {\n        k = a[i];\n        s = i;\n      }\n    }\n\n    for (i = 0; i <= s; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"%s\", b);\n    for (i = s + 1; i < n; i++) {\n      printf(\"%c\", a[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36953", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a;\n  char c, str[800], substr[4], str0[800], max;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    a = strlen(str);\n    max = str[0];\n    for (i = 0; i < a; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < a; i++)\n      if (str[i] == max)\n        break;\n    for (j = 0; j <= i; j++)\n      str0[j] = str[j];\n    for (j = i + 1; j < a; j++)\n      str0[j + 3] = str[j];\n    str0[i + 1] = substr[0];\n    str0[i + 2] = substr[1];\n    str0[i + 3] = substr[2];\n    for (i = 0; i < a + 3; i++)\n      cout << str0[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36954", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], max, final[14] = {'\\0'};\n  int i, k, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    max = str[0];\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n\n    strncpy(final, str, k + 1);\n    for (i = 0; i < 3; i++)\n      final[k + 1 + i] = substr[i];\n    for (i = k + 1; i < strlen(str); i++)\n      final[i + 3] = str[i];\n\n    puts(final);\n\n    for (j = 0; j < 11; j++)\n      str[j] = '\\0';\n    for (j = 0; j < 4; j++)\n      substr[j] = '\\0';\n    for (j = 0; j < 14; j++)\n      final[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36955", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i, m = 0;\n    char max = str[0];\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str[i]);\n    int p = strlen(substr);\n    for (i = 0; i < p; i++)\n      printf(\"%c\", substr[i]);\n    int q = strlen(str);\n    for (i = m + 1; i < q; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36956", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *a, *b, *t;\n  int i, j, n, max = 0;\n  a = (char *)calloc(1, 12);\n  b = (char *)calloc(1, 5);\n  t = (char *)calloc(1, 20);\n  for (; scanf(\"%s %s\", a, b) != EOF;) {\n    for (i = 0; i < (n = strlen(a)); i++) {\n      if (*(a + i) > max)\n        max = *(a + i);\n    }\n    for (i = 0; i < (n = strlen(a)); i++)\n      if (*(a + i) == max)\n        break;\n    strncat(t, a, i + 1);\n    strcat(t, b);\n    strcat(t, a + i + 1);\n    cout << t << \"\\n\";\n    a = (char *)calloc(1, 12);\n    b = (char *)calloc(1, 5);\n    t = (char *)calloc(1, 20);\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "36957", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint MAX(char str[], int len) {\n  int i, max, temp;\n  max = 0;\n  for (i = 1; i < len; i++) {\n    if (str[max] < str[i]) {\n      temp = max;\n      max = i;\n      i = temp;\n    }\n  }\n  return (max);\n}\nint main() {\n  char str[10], substr[3];\n  int stop, len, i;\n  for (;;) {\n    stop = scanf(\"%s %s\", str, substr);\n    if (stop != 2)\n      break;\n    len = strlen(str);\n    for (i = 0; i <= MAX(str, len); i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << substr;\n    for (i = MAX(str, len) + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36958", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14];\n  int i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n}\n"}
{"label": "20", "index": "36959", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100], substr[100], max;\n  int a, b, c, i, d, e, num;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    a = strlen(str);\n    b = strlen(substr);\n    max = str[0];\n    num = 0;\n    for (i = 0; i < a; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        num = i + 1;\n      }\n    }\n    for (c = 0; c <= num; c++) {\n      printf(\"%c\", str[c]);\n    }\n    for (d = 0; d < b; d++) {\n      printf(\"%c\", substr[d]);\n    }\n    for (e = num + 1; e < a; e++) {\n      printf(\"%c\", str[e]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36960", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, m, k;\n  char str[11], strsub[4];\n  for (j = 0;; j++) {\n    k = 0;\n    if (scanf(\"%s%s\", str, strsub) == EOF)\n      break;\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if ((str[k] - str[i]) < 0)\n        k = i;\n    }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", strsub);\n    for (i = k + 1; i < m; i++) {\n      cout << str[i];\n    }\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36961", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char c1[20] = {0}, c2[3] = {0}, c3[10] = {0};\n  int m, i, j, l, n1, n2, k, max;\n  for (k = 0; k < 10000; k++) {\n    scanf(\"%s %s\", &c1, &c2);\n    n1 = strlen(c1);\n    n2 = strlen(c2);\n    strcpy(c3, c1);\n    for (i = 0, max = c1[0]; i < n1; i++)\n      if (c1[i] > max) {\n        max = c1[i];\n        m = i;\n      } else\n        max = max;\n    for (j = m + 1, l = 0; j <= i + n2, l < n2; j++, l++)\n      c1[j] = c2[l];\n    for (j = m + n2 + 1, l = m + 1; j < n1 + n2, l < n1; j++, l++)\n      c1[j] = c3[l];\n    printf(\"%s\\n\", c1);\n    for (i = 0; i < n1 + n2; i++) {\n      c1[i] = 0;\n    }\n    for (i = 0; i < n2; i++) {\n      c2[i] = 0;\n    }\n  }\n}\n"}
{"label": "20", "index": "36962", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char p[10];\n  while (cin >> p) {\n    char b[4];\n    int max = 0, i, j, len1;\n    cin >> b;\n    char ma = *p;\n    len1 = strlen(p);\n    for (i = 0; i < len1; i++)\n      if (p[i] > ma) {\n        ma = p[i];\n        max = i;\n      }\n\n    for (j = 0; j <= max; j++)\n      cout << p[j];\n    cout << b;\n    for (j = j; j < len1; j++)\n      cout << p[j];\n    cout << endl;\n  }\n}\n"}
{"label": "20", "index": "36963", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint findmax(char str[], int len) {\n  char c = str[0];\n  int p = 0, i;\n  for (i = 0; i < len; i++)\n    if (str[i] > c) {\n      p = i;\n      c = str[i];\n    }\n  return p;\n}\n\nint main() {\n  char c, str[11], substr[4];\n  int p, l;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    p = findmax(str, l = strlen(str));\n    p++;\n    c = str[p];\n    str[p] = 0;\n\n    printf(\"%s%s\", str, substr);\n\n    str[p] = c;\n    if (p <= l)\n      printf(\"%s\\n\", &str[p]);\n    else\n      cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36964", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char t, g, c[100][15] = {'\\0'}, a[100][3];\n  int i, b, j, k, h[100];\n  for (i = 0;; i++) {\n    cin >> c[i] >> a[i];\n    if (c[i][0] == '\\0')\n      break;\n  }\n\n  b = i + 1;\n\n  for (i = 0; i < b; i++) {\n\n    h[i] = strlen(c[i]);\n    t = c[i][0];\n    for (j = 0; j < h[i]; j++) {\n      if (c[i][j] > t)\n        t = c[i][j];\n    }\n\n    for (j = 0; j < h[i]; j++) {\n      if (c[i][j] == t) {\n        for (k = (h[i] - 1); k > j; k--) {\n          c[i][k + 3] = c[i][k];\n        }\n        c[i][j + 1] = a[i][0];\n        c[i][j + 2] = a[i][1];\n        c[i][j + 3] = a[i][2];\n\n        break;\n      }\n    }\n    cout << c[i] << \"\\n\";\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "36965", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[15];\n  int max, num, i, j;\n  while (1) {\n    max = 0;\n\n    if (scanf(\"%s%s\", str, substr) == EOF) {\n      break;\n    }\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    strncpy(x, str, num + 1);\n    for (j = num + 1; j <= num + strlen(substr); j++) {\n      x[j] = substr[j - num - 1];\n    }\n\n    for (j = num + strlen(substr) + 1; j < strlen(substr) + strlen(str); j++) {\n      x[j] = str[j - strlen(substr)];\n    }\n    x[j] = '\\0';\n    printf(\"%s\\n\", x);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36966", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[13];\n  int i;\n  while (cin >> str >> substr) {\n    char max = str[0];\n    for (int i = 0; i < 10; i++) {\n      if (str[i] > max)\n        max = str[i];\n    }\n    int m = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[i] == max) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      a[i] = str[i];\n    for (i = 0; i < 3; i++)\n      a[m + 1 + i] = substr[i];\n    for (i = m + 1; i < strlen(str); i++)\n      a[i + 3] = str[i];\n    a[strlen(str) + 3] = '\\0';\n    for (i = 0; i < strlen(a); i++)\n      cout << a[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36967", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], substr[4], *p, t;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    t = *p;\n    j = 0;\n    k = strlen(str);\n    for (i = 0; i < k; i++, p++)\n      if (*p > t) {\n        t = *p;\n        j = i;\n      }\n\n    for (p = str, i = 0; i < j + 1; i++, p++)\n      cout << *p;\n    cout << substr;\n    for (i = j + 1; i < k; i++, p++)\n      printf(\"%c\", *p);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36968", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], string[14];\n  char max;\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        n = i;\n        max = str[i];\n      }\n    }\n    for (i = 0; i <= n; i++)\n      string[i] = str[i];\n    for (i = n + 1; i <= n + 3; i++)\n      string[i] = substr[i - n - 1];\n    for (i = n + 4; str[i - 3] != '\\0'; i++)\n      string[i] = str[i - 3];\n    string[i] = '\\0';\n    printf(\"%s\\n\", string);\n  }\n}\n"}
{"label": "20", "index": "36969", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[15], substr[4];\n  int i, j, max, c;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 1, max = str[0], c = 0; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        c = i;\n      }\n    }\n    for (j = i + 3; j > c + 3; j--)\n      str[j] = str[j - 3];\n\n    str[c + 1] = substr[0];\n    str[c + 2] = substr[1];\n    str[c + 3] = substr[2];\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36970", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], max, final[14] = {'\\0'};\n  int i, k, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    max = str[0];\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n\n    strncpy(final, str, k + 1);\n    for (i = 0; i < 3; i++)\n      final[k + 1 + i] = substr[i];\n    for (i = k + 1; i < strlen(str); i++)\n      final[i + 3] = str[i];\n    puts(final);\n\n    for (j = 0; j < 11; j++)\n      str[j] = '\\0';\n    for (j = 0; j < 4; j++)\n      substr[j] = '\\0';\n    for (j = 0; j < 14; j++)\n      final[j] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "36971", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint getMaxCharIndex(char *str) {\n  int i = 0;\n  int maxIndex = 0;\n  char maxChar = str[0];\n\n  for (i = 0; i < 1000; i++) {\n    if (str[i] == 0) {\n      break;\n    }\n\n    if (maxChar < str[i]) {\n      maxChar = str[i];\n      maxIndex = i;\n    }\n  }\n\n  return maxIndex;\n}\n\nvoid insertStr(char *str, int index, char *subStr) {\n  int i;\n  int strLength = strlen(str);\n\n  for (i = strLength; i > index; i--)\n    str[i + 1000 - 1] = str[i];\n\n  for (i = 0; i < 1000 - 1; i++)\n    str[i + index + 1] = subStr[i];\n}\n\nint main() {\n  char str[1000];\n  char subStr[1000];\n  int maxIndex;\n\n  while (scanf(\"%s%s\", str, subStr) != EOF) {\n    maxIndex = getMaxCharIndex(str);\n    insertStr(str, maxIndex, subStr);\n\n    printf(\"%s \", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36972", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j = 0, n, p;\n  char str[100][50], sub[100][50], c[100], t;\n  c[0] = getchar();\n  do {\n    p = -1;\n    t = c[j];\n    cin >> str[j] >> sub[j];\n\n    for (i = 0; i < strlen(str[j]); i++) {\n      if (str[j][i] > t) {\n        p = i;\n        t = str[j][i];\n      }\n    }\n    for (i = strlen(str[j]); i > p; i--)\n      str[j][i + (n = strlen(sub[j]))] = str[j][i];\n    for (i = 0; i < n; i++)\n      str[j][p + 1 + i] = sub[j][i];\n    j++;\n    c[j] = getchar();\n  } while (c[j] == 10);\n  for (i = 0; i < j; i++)\n    cout << c[i] << str[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "20", "index": "36973", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(char str[], char substr[]);\nint main() {\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF)\n    f(str, substr);\n\n  return 0;\n}\nvoid f(char str[], char substr[]) {\n  int i, j, k, l;\n  char a;\n  l = strlen(str);\n  a = str[0];\n  for (i = 1; i < l; i++)\n    if (str[i] > a)\n      a = str[i];\n  for (i = 0; i < l; i++)\n    if (str[i] == a)\n      break;\n  for (j = l + 3; j > i + 3; j--)\n    str[j] = str[j - 3];\n  for (j = i + 1, k = 0; k < 3; j++, k++)\n    str[j] = substr[k];\n  cout << str << \"\\n\";\n}\n"}
{"label": "20", "index": "36974", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][50], result[100][50];\n  int m, length[100], i = 0, j, l, max, p, k, t;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j <= p; j++)\n      result[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      result[i][j] = str[i][length[i] + j - p - 4];\n    for (j = p + 4; j < length[i]; j++)\n      result[i][j] = str[i][j - 3];\n    for (j = length[i] - 1; j < 50; j++)\n      result[i][j] = '\u0000';\n  }\n  for (j = 0; j < l; j++) {\n    t = strlen(result[j]);\n    for (k = 0; k < t; k++)\n      printf(\"%c\", result[j][k]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36975", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[20], s2[10], k[20];\n  int i, j, n, m, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    for (i = 0; i <= m - 1; i++) {\n      k[i] = s1[i];\n    }\n    for (i = 1; i <= 10; i++) {\n      for (j = 0; j <= m - 2; j++) {\n        if (k[j] < k[j + 1]) {\n          n = k[j];\n          k[j] = k[j + 1];\n          k[j + 1] = n;\n        }\n      }\n    }\n    for (i = 0; i <= m - 1; i++) {\n      if (s1[i] == k[0]) {\n        max = i;\n        break;\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; i <= 2; i++) {\n      printf(\"%c\", s2[i]);\n    }\n    for (i = max + 1; i <= m - 1; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36976", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(void) {\n  char a[11], b[4], c[15];\n  int j, l, max;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    max = 0;\n    j = 0;\n    l = strlen(a);\n    for (j = 0; j < l; j++) {\n      if (a[j] > a[max])\n        max = j;\n    }\n    for (j = 0; j <= max; j++)\n      c[j] = a[j];\n\n    for (j = 1; j <= 3; j++) {\n      c[j + max] = b[j - 1];\n    }\n    for (j = max + 1; j < l; j++) {\n      c[j + 3] = a[j];\n    }\n    c[l + 3] = '\\0';\n    puts(c);\n  }\n}\n"}
{"label": "20", "index": "36977", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    char a[11];\n    int l = strlen(str), m = 0;\n    for (i = 1; i < l; i++) {\n      if (str[m] < str[i])\n        m = i;\n    }\n    for (i = m + 1; i < l; i++)\n      a[i - m - 1] = str[i];\n\n    a[l - m - 1] = '\\0';\n    str[m + 1] = '\\0';\n    strcat(str, substr);\n    strcat(str, a);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36978", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char a[]) {\n  int i, t = a[0];\n  for (i = 0; i <= strlen(a); i++) {\n    if (t < a[i])\n      t = a[i];\n  }\n  i = 0;\n  while (a[i] != t)\n    i++;\n  return i;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i;\n    int t = max(str);\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = t + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36979", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, n, i, j, l, m;\n  char a[100][20] = {0}, max, e[100][20] = {0};\n  while (1) {\n    char b[10] = {0}, c[20] = {0}, d[3] = {0}, p;\n\n    cin >> a[k];\n    if (a[k][0] == 0)\n      break;\n    n = strlen(a[k]);\n    m = n - 4;\n    max = a[k][0];\n    for (i = 1; i <= n - 5; i++)\n      if (a[k][i] > max) {\n        max = a[k][i];\n        p = i;\n      }\n    for (j = p + 1, l = 0; j <= m - 1; j++, l++)\n      b[l] = a[k][j];\n    for (i = 0; i <= p; i++)\n      c[i] = a[k][i];\n    for (i = 0, j = m + 1; j <= n - 1; i++, j++) {\n      d[i] = a[k][j];\n    }\n    strcat(c, d);\n    strcat(c, b);\n    strcpy(e[k], c);\n    k++;\n  }\n  for (i = 0; i <= k - 1; i++)\n    puts(e[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36980", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, k[100], j, a[100];\n  char str[100][50], max;\n  do {\n    cin >> str[i];\n    a[i] = strlen(str[i]);\n    i++;\n  } while (str[i - 1][0] != '\u0000');\n\n  for (i = 0; str[i][0] != '\u0000'; i++) {\n    max = str[i][0];\n    for (j = 0; j < a[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k[i] = j;\n      }\n    }\n  }\n  for (i = 0; str[i][0] != '\u0000'; i++)\n\n  {\n    for (j = 0; j <= k[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = a[i] - 3; j < a[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = k[i] + 1; j < a[i] - 4; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "36981", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid p_s(char str[], char substr[]) {\n  int i, n, len;\n  char s[13] = {\"\\0\"};\n  len = strlen(str);\n  for (i = 0, n = 0; i < len; i++)\n    if (str[n] < str[i])\n      n = i;\n  for (i = 0; i < len + 3; i++)\n    s[i] = i <= n ? str[i] : (i <= n + 3 ? substr[i - n - 1] : str[i - 3]);\n  cout << s << \"\\n\";\n}\nint main() {\n  int i, j;\n  char str[10][10], substr[10][3];\n  for (i = 0; scanf(\"%s %s\", str[i], substr[i]) != EOF; i++)\n    ;\n  for (j = 0; j < i; j++) {\n    p_s(str[j], substr[j]);\n  }\n}\n"}
{"label": "20", "index": "36982", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char aa[20], bb[10], c;\n  int i;\n  while (scanf(\"%s %s \", aa, bb)) {\n    i = 0;\n    c = aa[0];\n    while (aa[i] != '\\0') {\n      if (aa[i] > c)\n        c = aa[i];\n      i++;\n    }\n    i = 0;\n    while (aa[i] != '\\0') {\n      if (aa[i] == c)\n        break;\n      cout << aa[i];\n      i++;\n    }\n    cout << aa[i] << bb;\n    i++;\n    while (aa[i] != '\\0') {\n      cout << aa[i];\n      i++;\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36983", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char s1[11]) {\n  int i, k = 0;\n  char c = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] > c) {\n      c = s1[i];\n      k = i;\n    }\n  }\n  return (k);\n}\nint main() {\n  char s1[11], s2[4];\n  int i, j, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = max(s1);\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"%s\", s2);\n    for (i = m + 1; i < strlen(s1); i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "36984", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nchar maxASCII(char *str) {\n  int len = strlen(str);\n  int i, j = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] > j)\n      j = str[i];\n  }\n  return j;\n}\nint maxlocate(char string[], char maxx) {\n  int x;\n  for (x = 0; x < strlen(string); x++) {\n    if (string[x] == maxx) {\n      return x;\n    }\n  }\n}\n\nint main(char *argv[]) {\n  char str[100][10], substr[100][4];\n  int max;\n  int rank;\n  int i, j;\n  j = 0;\n  while (scanf(\"%s%s\", str[j], substr[j]) != EOF)\n    j++;\n  for (i = 0; i < j; i++) {\n\n    max = maxASCII(str[i]);\n    rank = maxlocate(str[i], max);\n    int a;\n    for (a = 0; a <= rank; a++) {\n      cout << str[i][a];\n    }\n    cout << substr[i];\n    for (a = rank + 1; a < strlen(str[i]); a++) {\n      cout << str[i][a];\n    }\n    cout << endl;\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "20", "index": "36985", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar string_1[13];\nvoid f(char str[], char substr[]);\nint main() {\n  int i;\n  char str[10], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    f(str, substr);\n    for (i = 0; i < strlen(str) + 3; i = i + 1) {\n      printf(\"%c\", string_1[i]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\nvoid f(char str[10], char substr[4]) {\n  int i, j, k, t;\n  char max;\n  max = str[0];\n  k = 0;\n  t = strlen(str);\n  for (i = 1; i < t; i = i + 1) {\n    if (str[i] > max) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i = i + 1)\n    string_1[i] = str[i];\n\n  j = 0;\n  for (i = k + 1; i <= k + 3; i = i + 1) {\n    string_1[i] = substr[j];\n    j = j + 1;\n  }\n  if (k < t - 1) {\n    j = k + 1;\n    for (i = k + 4; i < t + 3; i = i + 1) {\n      string_1[i] = str[j];\n      j = j + 1;\n    }\n  }\n}\n"}
{"label": "20", "index": "36986", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char a[20], char b[10]) {\n  int max, i, index;\n  char *p;\n  char ans[20];\n  p = a;\n  max = 0;\n  for (i = 1; *(p + i); i++)\n    if (*(p + i) > max)\n      max = *(p + i), index = i;\n  strcpy(ans, \"\");\n  strncat(ans, a, index + 1);\n  strcat(ans, b);\n  strcat(ans, a + index + 1);\n  cout << ans << \"\\n\";\n}\nint main() {\n  char str[20], substr[10];\n  while (scanf(\"%s %s\\n\", str, substr) != EOF) {\n    insert(str, substr);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36987", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][10], substr[1000][3], finalstr[1000][13];\n  int n, i, j, l, k;\n  for (i = 0; scanf(\"%s%s\", str[i], substr[i]) != EOF; i++) {\n  }\n  n = i;\n  for (k = 0; k < n; k++) {\n    l = strlen(str[k]);\n    for (i = 0; i < l; i++) {\n      for (j = 0; j < l; j++) {\n        if (str[k][i] < str[k][j])\n          break;\n      }\n      if (j == l) {\n        break;\n      }\n    }\n    for (j = 0; j <= i; j++)\n      finalstr[k][j] = str[k][j];\n    for (j = 0; j < 3; j++)\n      finalstr[k][i + j + 1] = substr[k][j];\n    for (j = 1; j < l - i; j++)\n      finalstr[k][i + 3 + j] = str[k][i + j];\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s\\n\", finalstr[i]);\n}\n"}
{"label": "20", "index": "36988", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int ceshi, i = 0, j, max, weizhi, chang, k;\n  char str[30][15] = {'\\0'}, substr[30][3] = {'\\0'}, a[30][18] = {'\\0'};\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    i++;\n  }\n  ceshi = i;\n  for (i = 0; i < ceshi; i++) {\n    max = str[i][0];\n    weizhi = 0;\n\n    for (j = 0; str[i][j] != '\\0'; j++) {\n      if (str[i][j] > max) {\n        weizhi = j;\n        max = str[i][j];\n      }\n    }\n\n    strncpy(a[i], str[i], weizhi + 1);\n\n    for (k = 0; k < 3; k++)\n      a[i][1 + k + weizhi] = substr[i][k];\n\n    for (j = 1; str[i][j + weizhi] != '\\0'; j++) {\n      a[i][weizhi + 3 + j] = str[i][j + weizhi];\n    }\n\n    chang = strlen(str[i]);\n\n    a[i][chang + 3] = '\\0';\n\n    cout << a[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36989", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int x = 0, i;\n  char s1[100], s2[100], s3[100], s4[100];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    char max = '0';\n    int maxi = 0;\n    int len1 = strlen(s1);\n\n    for (i = 0; i < len1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        maxi = i;\n      }\n    strcpy(s3, s1);\n\n    s3[maxi + 1] = '\\0';\n    strcat(s3, s2);\n\n    s4[0] = '\\0';\n    for (i = maxi + 1; i <= len1; i++) {\n      s4[i - maxi] = s4[i - maxi - 1];\n      s4[i - maxi - 1] = s1[i];\n    }\n\n    strcat(s3, s4);\n    cout << s3 << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "36990", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char nul = '0';\n  a = strlen(str);\n  for (i = 0; i < a - 4; i++) {\n    if (str[i] > nul) {\n      nul = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a[100], length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a[i] = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a[i] + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a[i] && j < a[i] + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a[i]];\n      else if (j > a[i] + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str1[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36991", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  int i, j, m, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    m = strlen(str);\n    j = 0;\n    n = str[0];\n    for (i = 1; i < m; i++)\n      if (str[i] > n) {\n        j = i;\n        n = str[i];\n      }\n    for (i = 0; i <= j; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = j + 1; i < m; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36992", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[301];\n  char ds[301];\n  int i, j, k, l, max;\n  while (scanf(\"%s\", &s) != EOF) {\n\n    l = strlen(s);\n    scanf(\"%s\", &ds);\n    max = l - 1;\n    for (j = l - 1; j > 0; j = j - 1) {\n      if (s[j] >= s[max]) {\n        max = j;\n      }\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", ds);\n    for (i = max + 1; i < l; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36993", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint num(char st[]);\nvoid conv1(char st[], int n);\nvoid conv2(char st[], int n);\nvoid result(char st1[], char st2[], char st3[]);\nint main() {\n  char str[20], substr[4], str1[20], str3[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int n;\n    n = num(str);\n    strcpy(str3, str);\n    conv1(str, n);\n    conv2(str3, n);\n    result(str, substr, str3);\n  }\n  return 0;\n}\nvoid conv1(char st[], int n) { st[n] = '\\0'; }\nvoid conv2(char st[], int n) {\n  int l, i;\n  l = strlen(st);\n  for (i = 0; i < l - n; i++) {\n    st[i] = st[i + n];\n  }\n\n  st[l - n] = '\\0';\n}\nint num(char st[]) {\n  int i, l;\n  char t;\n  t = st[0];\n  l = strlen(st);\n  for (i = 1; i < l; i++) {\n    if (st[i] > t)\n      t = st[i];\n  }\n  for (i = 0; i < l; i++) {\n    if (st[i] == t) {\n      return (i + 1);\n      break;\n    }\n  }\n}\nvoid result(char st1[], char st2[], char st3[]) {\n  strcat(st1, st2);\n  strcat(st1, st3);\n  puts(st1);\n}\n"}
{"label": "20", "index": "36994", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char wo[50][50];\n  char in[50][50];\n  char out[50][50];\n  int i = 0, j, k = 0;\n  int temp = 0;\n  while (scanf(\"%s %s\", wo[i], in[i]) != EOF) {\n    i++;\n  }\n  for (j = 0; j <= i; j++) {\n    temp = 0;\n    for (k = 0; wo[j][k] != 0; k++)\n      if (wo[j][k] > wo[j][temp])\n        temp = k;\n    strcpy(out[j], wo[j]);\n    for (k = temp + 1; k < temp + 1 + strlen(in[j]); k++)\n      out[j][k] = in[j][k - temp - 1];\n    do {\n      temp++;\n      out[j][k] = wo[j][temp];\n      k++;\n    } while (wo[j][temp] != 0);\n    if (j != i)\n      printf(\"%s\\n\", out[j]);\n    else\n      printf(\"%s\", out[j]);\n  }\n}\n"}
{"label": "20", "index": "36995", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10][14], substr[10][4], a[10][9];\n  int p = 0, i = 0, q;\n  int n[10];\n  while (scanf(\"%s%s\", str[p], substr[p]) != EOF) {\n    int j = 0, max, m, k = 0;\n    n[p] = strlen(str[p]);\n    max = str[p][0];\n    for (i = 0; i < n[p]; i++)\n      if (str[p][i] > max) {\n        max = str[p][i];\n        j = i;\n      }\n    m = j;\n    for (j = m; j < n[p] - 1; j++) {\n      a[p][k] = str[p][j + 1];\n      k++;\n    }\n    str[p][m + 1] = substr[p][0];\n    str[p][m + 2] = substr[p][1];\n    str[p][m + 3] = substr[p][2];\n    k = 0;\n    for (j = m + 4; j < n[p] + 3; j++) {\n      str[p][j] = a[p][k];\n      k++;\n    }\n    p++;\n  }\n  for (q = 0; q < p - 1; q++) {\n    for (i = 0; i < n[q] + 3; i++)\n      printf(\"%c\", str[q][i]);\n    printf(\"\\n\");\n  }\n  for (i = 0; i < n[p - 1] + 3; i++)\n    printf(\"%c\", str[p - 1][i]);\n  return 0;\n}\n"}
{"label": "20", "index": "36996", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][10], substr[100][3], s, str1[100][30] = {0},\n                                        str2[100][10] = {0};\n  int j, i = 0, n, b, c;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    n = strlen(str[i]);\n    s = str[i][0];\n    for (j = 1; j < n; j++) {\n      if (str[i][j] > s) {\n        s = str[i][j];\n        b = j;\n      }\n    }\n    for (c = 0, j = 0; c <= b; c++, j++)\n      str1[i][c] = str[i][j];\n    for (c = 0, j = b + 1; j < n; c++, j++)\n      str2[i][c] = str[i][j];\n    strcat(str1[i], substr[i]);\n    strcat(str1[i], str2[i]);\n    cout << str1[i] << \"\\n\";\n    i++;\n  }\n}\n"}
{"label": "20", "index": "36997", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char wo[50][50];\n  char in[50][50];\n  char out[50][50];\n  int i = 0, j, k = 0;\n  int temp = 0;\n  while (scanf(\"%s %s\", wo[i], in[i]) != EOF) {\n    i++;\n  }\n  for (j = 0; j <= i; j++) {\n    temp = 0;\n    for (k = 0; wo[j][k] != 0; k++)\n      if (wo[j][k] > wo[j][temp])\n        temp = k;\n    strcpy(out[j], wo[j]);\n    for (k = temp + 1; k < temp + 1 + strlen(in[j]); k++)\n      out[j][k] = in[j][k - temp - 1];\n    do {\n      temp++;\n      out[j][k] = wo[j][temp];\n      k++;\n    } while (wo[j][temp] != 0);\n    if (j != i) {\n      cout << out[j] << \"\\n\";\n    } else\n      printf(\"%s\", out[j]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36998", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4], string[14];\n  char max;\n  int n, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = 0;\n    for (i = 1; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        n = i;\n        max = str[i];\n      }\n    }\n    for (i = 0; i <= n; i++)\n      string[i] = str[i];\n    for (i = n + 1; i <= n + 3; i++)\n      string[i] = substr[i - n - 1];\n    for (i = n + 4; str[i - 3] != '\\0'; i++)\n      string[i] = str[i - 3];\n\n    string[i] = '\\0';\n    printf(\"%s\\n\", string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "36999", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, max = 0;\n  char str1[11], substr[4], str2[14], str3[11];\n  while (scanf(\"%s %s\", str1, substr) != EOF) {\n    for (i = 0; i < 14; i++) {\n      str2[i] = '\\0';\n      str3[i] = '\\0';\n    }\n    max = 0;\n    for (i = 0; str1[i] != '\\0'; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        k = i;\n      }\n    strncpy(str2, str1, k + 1);\n    strcat(str2, substr);\n    for (i = k + 1, j = 0; str1[i] != '\\0'; i++, j++) {\n      str3[j] = str1[i];\n    }\n    strcat(str2, str3);\n    printf(\"%s\\n\", str2);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37000", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a, b, max;\n  char str[11], substr[4], mix[14];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    a = strlen(str);\n    b = strlen(substr);\n    max = 0;\n    j = 0;\n    for (i = 0; i < a + b; i++) {\n      mix[i] = 0;\n    }\n\n    for (i = 0; i < a; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        j = i;\n      }\n    }\n\n    for (i = 0; i < a + b; i++) {\n      if (i <= j) {\n        mix[i] = str[i];\n      }\n      if (i > j && i <= j + b) {\n        mix[i] = substr[i - j - 1];\n      }\n      if (i > j + b && i < a + b) {\n        mix[i] = str[i - b];\n      }\n      cout << mix[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37001", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], s, s3[14];\n  int n, m, t;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    for (n = 1, s = s1[0], m = 0; s1[n] != '\\0'; n++) {\n      if (s1[n] > s) {\n        m = n;\n        s = s1[n];\n      }\n    }\n    for (n = m + 1, t = 0; s1[n] != '\\0'; n++, t++)\n      s3[t] = s1[n];\n    s3[t] = '\\0';\n    for (n = 1; n <= 3; n++)\n      s1[m + n] = s2[n - 1];\n    s1[m + n] = '\\0';\n    printf(\"%s%s\\n\", s1, s3);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37002", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sc(char *p[], char *q[]);\n  char *p[100], *q[100];\n  int i;\n  for (i = 0; i < 100; i++) {\n    p[i] = (char *)malloc(10);\n    q[i] = (char *)malloc(5);\n  }\n  sc(p, q);\n}\nvoid sc(char *p[], char *q[]) {\n  int n, m, j, max, x, i;\n  for (i = 0; scanf(\"%s %s\", p[i], q[i]) != EOF; i++) {\n    n = strlen(p[i]);\n    m = strlen(q[i]);\n    for (j = 1, max = *(p[i]); j < n; j++)\n      if (*(p[i] + j) > max) {\n        max = *(p[i] + j);\n        x = j;\n      }\n    for (j = n - x - 1; j >= 1; j--)\n      *(p[i] + x + j + m) = *(p[i] + x + j);\n    for (j = 0; j < m; j++)\n      *(p[i] + x + j + 1) = *(q[i] + j);\n    for (j = 0; j < m + n; j++) {\n      printf(\"%c\", *(p[i] + j));\n      if (j == n + m - 1)\n        printf(\"\\n\");\n    }\n  }\n}\n"}
{"label": "20", "index": "37003", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[30], substr[4], max;\n  int i, len, num;\n  scanf(\"%s%s\", str, substr);\n  while (str[0] != '0') {\n    len = strlen(str);\n    for (i = 0, max = str[0]; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < len; i++)\n      if (str[i] == max) {\n        num = i;\n        break;\n      }\n    for (i = 0; i < num + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = num + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      str[i] = '0';\n    for (i = 0; i < 3; i++)\n      substr[i] = '0';\n    scanf(\"%s%s\", str, substr);\n  }\n}\n"}
{"label": "20", "index": "37004", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[301];\n  char ds[301];\n  int i, j, k, l, max;\n  while (scanf(\"%s\", &s) != EOF) {\n\n    l = strlen(s);\n    cin >> ds;\n    max = l - 1;\n    for (j = l - 1; j > 0; j = j - 1) {\n      if (s[j] >= s[max])\n        max = j;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", ds);\n    for (i = max + 1; i < l; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37005", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n\n  char a[20], b[4];\n  while (cin >> a >> b) {\n    char *pa, *pb = b, *pmax = a;\n    for (pa = a; pa != &a[strlen(a)]; pa++)\n      if (*pa > *pmax)\n        pmax = pa;                             \n    for (pa = &a[strlen(a)]; pa != pmax; pa--) \n      *(pa + 3) = *pa;\n    for (pa = pmax + 1, pb = b; pb != &b[3]; pa++, pb++) \n      *pa = *pb;\n    pa = a;\n    cout << pa << endl;\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "37006", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, m, c, f;\n  char str[20], substr[10], de[20], max;\n  char *p, *q, *t;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    max = 0;\n    for (p = str; p < (str + n); p++)\n      if (*p > max) {\n        max = *p;\n        t = p;\n      }\n\n    for (p = str, i = 0; p < (t + 1); p++)\n      de[i++] = *p;\n    for (c = i, q = substr; q < (substr + m); q++)\n      de[c++] = *q;\n    for (p = (t + 1), f = c; p < (str + n); p++)\n      de[f++] = *p;\n    for (q = de; q < (f + de); q++)\n      printf(\"%c\", *q);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37007", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, Asc, point;\n  char str[10], substr[3];\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    point = 0;\n    Asc = 0;\n    for (i = 0; i <= strlen(str); i++)\n      if (str[i] > Asc) {\n        Asc = str[i];\n        point = i;\n      }\n    for (i = 0; i <= point; i++)\n      printf(\"%c\", str[i]);\n    for (j = 0; j < strlen(substr); j++)\n      printf(\"%c\", substr[j]);\n    for (i = point + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37008", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k;\n  char str[13] = {0}, substr[4] = {0}, max;\n  while (cin >> str >> substr) {\n    max = str[0];\n    for (i = 0; i < 9; i++)\n      if (max < str[i + 1])\n        max = str[i + 1];\n    for (i = 0; i < 10; i++) {\n      if (str[i] == max) {\n        k = i;\n        break;\n      }\n    }\n    for (i = 9; i > k; i--)\n      str[i + 3] = str[i];\n    for (i = k + 1; i <= k + 3; i++)\n      str[i] = substr[i - k - 1];\n    printf(\"%s\\n\", str);\n    for (i = 0; i < 10; i++)\n      str[i] = 0;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37009", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *a, *b, *t;\n  int i, j, n, max = 0;\n  a = (char *)calloc(1, 12);\n  b = (char *)calloc(1, 5);\n  t = (char *)calloc(1, 20);\n  for (; scanf(\"%s %s\", a, b) != EOF;) {\n    for (i = 0; i < (n = strlen(a)); i++) {\n      if (*(a + i) > max)\n        max = *(a + i);\n    }\n    for (i = 0; i < (n = strlen(a)); i++)\n      if (*(a + i) == max)\n        break;\n    strncat(t, a, i + 1);\n    strcat(t, b);\n    strcat(t, a + i + 1);\n    printf(\"%s\\n\", t);\n    a = (char *)calloc(1, 12);\n    b = (char *)calloc(1, 5);\n    t = (char *)calloc(1, 20);\n    max = 0;\n  }\n}\n"}
{"label": "20", "index": "37010", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[13], substr[3];\n  int i = 0, max, j, n, k;\n\n  for (k = 0; k < 100; k++) {\n    for (i = 0; i < 13; i++)\n      str[i] = '\\0';\n\n    for (i = 0; i < 3; i++)\n      substr[i] = '\\0';\n\n    max = 0;\n\n    scanf(\"%s%s\", str, substr);\n\n    n = strlen(str);\n\n    for (i = 0; i < n; i++)\n      max = (max > str[i]) ? max : str[i];\n\n    for (i = 0; i < n; i++)\n      if (str[i] == max) {\n        for (j = n - 1; j > i; j--)\n          str[j + 3] = str[j];\n        str[i + 1] = substr[0];\n        str[i + 2] = substr[1];\n        str[i + 3] = substr[2];\n        break;\n      }\n\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "37011", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[20], s2[10], k[20];\n  int i, j, n, m, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    for (i = 0; i <= m - 1; i++) {\n      k[i] = s1[i];\n    }\n    for (i = 1; i <= 10; i++) {\n      for (j = 0; j <= m - 2; j++) {\n        if (k[j] < k[j + 1]) {\n          n = k[j];\n          k[j] = k[j + 1];\n          k[j + 1] = n;\n        }\n      }\n    }\n    for (i = 0; i <= m - 1; i++) {\n      if (s1[i] == k[0]) {\n        max = i;\n        break;\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    for (i = 0; i <= 2; i++) {\n      printf(\"%c\", s2[i]);\n    }\n    for (i = max + 1; i <= m - 1; i++) {\n      cout << s1[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37012", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, mark;\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    for (i = 0; i < n; i++) {\n      for (j = 0, mark = 1; j < n; j++) {\n        if (s1[i] < s1[j]) {\n          mark = 0;\n          break;\n        }\n      }\n      if (mark) {\n        for (j = 0; j <= i; j++)\n          cout << s1[j];\n        printf(\"%s\", s2);\n        for (j = i + 1; j < n; j++)\n          cout << s1[j];\n        cout << \"\\n\";\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37013", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l, i, k, j;\n  char s1[11], s2[4], s3[15];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    k = 0;\n    for (j = 1; j < l; j++)\n      if (s1[k] < s1[j])\n        k = j;\n    for (i = 0; i <= k; i++)\n      s3[i] = s1[i];\n    for (i = 1; i < 4; i++)\n      s3[k + i] = s2[i - 1];\n    for (i = 0; i <= l - k; i++) {\n      s3[k + 4 + i] = s1[k + i + 1];\n    }\n    cout << s3 << \" \";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37014", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char b[11] = {'\\0'}, c[4] = {'\\0'};\n  int i, j, k, p, l;\n\n  while (scanf(\"%s%s\", b, c) != EOF) {\n    l = strlen(b);\n    p = 0;\n    for (i = 1; i < l; i++)\n      if (b[i] > b[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", b[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", c[i]);\n    for (i = p + 1; i < l; i++)\n      printf(\"%c\", b[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37015", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int n, i, t, max;\n  p1 = (char *)malloc(1000 * sizeof(char));\n  p2 = (char *)malloc(3 * sizeof(char));\n  while (scanf(\"%s %s\", p1, p2) != EOF) {\n    t = 0;\n    n = strlen(p1);\n    max = *p1;\n    for (i = 0; i < n; i++)\n      if (*(p1 + i) > max) {\n        max = *(p1 + i);\n        t = i;\n      }\n    for (i = n - 1; i >= t + 1; i--)\n      *(p1 + i + 3) = *(p1 + i);\n    *(p1 + n - 1 + 4) = '\\0';\n    for (i = 0; i < 3; i++)\n      *(p1 + t + 1 + i) = *(p2 + i);\n    cout << p1 << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37016", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], strc[13], substr[3], max, num;\n  int i, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++)\n      strc[i] = str[i];\n\n    for (i = num + 1; i <= num + 3; i++) {\n      strc[i] = substr[i - num - 1];\n    }\n    for (i = num + 4; i < n + 3; i++) {\n      strc[i] = str[i - 3];\n    }\n    strc[n + 3] = '\\0';\n    printf(\"%s\\n\", strc);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37017", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char s1[], char s2[]) {\n  int i, k = 0, j, l;\n  char s[13];\n  l = strlen(s1);\n  for (i = 1; i < l; i++)\n    if (s1[i] > s1[k])\n      k = i;\n  for (i = 0; i <= k; i++)\n    s[i] = s1[i];\n  for (j = 0; j < 3; j++)\n    s[i + j] = s2[j];\n  for (j = i; j < l; j++)\n    s[j + 3] = s1[j];\n  s[j + 3] = '\\0';\n  printf(\"%s\\n\", s);\n}\nint main() {\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF)\n    insert(s1, s2);\n  return 0;\n}\n"}
{"label": "20", "index": "37018", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, a;\n  char c, str[800], substr[4], str0[800], max;\n  while ((scanf(\"%s %s\", str, substr)) != EOF) {\n    a = strlen(str);\n    max = str[0];\n    for (i = 0; i < a; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < a; i++)\n      if (str[i] == max)\n        break;\n    for (j = 0; j <= i; j++)\n      str0[j] = str[j];\n    for (j = i + 1; j < a; j++)\n      str0[j + 3] = str[j];\n    str0[i + 1] = substr[0];\n    str0[i + 2] = substr[1];\n    str0[i + 3] = substr[2];\n    for (i = 0; i < a + 3; i++)\n      cout << str0[i];\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37019", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char a[11]) {\n  int i, n, m;\n  n = strlen(a);\n  m = 0;\n  for (i = 0; i < n - 1; i++)\n    if (a[m] < a[i + 1])\n      m = i + 1;\n  return (m);\n}\n\nint main() {\n  int i, len, m;\n  char a[11], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    len = strlen(a);\n    m = max(a);\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", a[i]);\n    for (i = 0; i < 3; i++)\n      cout << b[i];\n    for (i = m + 1; i < len; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37020", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint findmax(char *str) {\n  int i, max = *str, ret = 0;\n  for (i = 0; *(str + i); i++)\n    if (*(str + i) > max) {\n      max = *(str + i);\n      ret = i;\n    }\n  return ret;\n}\n\nvoid insert(char *str, char *substr, int index) {\n  int i;\n  char *p;\n  for (p = str + strlen(str); p > str + index; p--)\n    *(p + strlen(substr)) = *p;\n  for (i = 0; i < strlen(substr); i++)\n    *(str + index + 1 + i) = *(substr + i);\n}\n\nint main() {\n  int k;\n  char *str, *substr;\n  str = (char *)malloc(11 * sizeof(char));\n  substr = (char *)malloc(3 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = findmax(str);\n    insert(str, substr, k);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37021", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100][100], s[100][100];\n  int i = 0, j = 0, k, m, n, count, lon[100];\n\n  cin >> s[0];\n  lon[0] = strlen(s[0]);\n  n = 1;\n  for (i = 1; s[i - 1][0] != '\u0000'; i++) {\n\n    cin >> s[i];\n    lon[i] = strlen(s[i]);\n    n++;\n  }\n  n--;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 1; s[i][j] != 32; j++) {\n\n      if (s[i][j] > s[i][k])\n        k = j;\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = lon[i] - 3; j < lon[i]; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = k + 1; s[i][j] != 32; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37022", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[14] = {' '};\n  char b[4] = {' '};\n  while (cin.get(a, 11, ' ')) {\n    cin.get();\n    cin.get(b, 4, '\\n');\n    int k = 0;\n    char max = NULL;\n    for (int j = 0; j < strlen(a); j++)\n      if (a[j] > max) {\n        max = a[j];\n        k = j;\n      }\n    for (int i = strlen(a) - 1; i > k; i--)\n      a[i + 3] = a[i];\n    a[k + 1] = b[0];\n    a[k + 2] = b[1];\n    a[k + 3] = b[2];\n    cout << a << endl;\n    for (int p = 0; p < 14; p++)\n      a[p] = '\\n';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37023", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid chen() {\n  char str[11], substr[4];\n  int i, k;\n  scanf(\"%s %s\", str, substr);\n  k = strlen(str);\n  for (i = strlen(str) - 1; i >= 0; i--) {\n    if (str[i] >= str[k - 1]) {\n      k = i + 1;\n    }\n  }\n  if (strlen(str) > 10 || strlen(substr) > 3)\n    return;\n  for (i = 0; i < k; i++)\n    printf(\"%c\", str[i]);\n  printf(\"%s\", substr);\n  for (i = k; i < strlen(str); i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n  chen();\n}\nint main() { chen(); }\n"}
{"label": "20", "index": "37024", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++)\n      if (*p > max)\n        max = *p, k = i;\n    for (p = str; p <= (str + k); p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    if (k < strlen(str)) {\n      for (p = str + k + 1; *p != '\\0'; p++)\n        printf(\"%c\", *p);\n      printf(\"\\n\");\n    } else\n      printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37025", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  \n  \n  int n, i, m;\n  char a[14], b[4];\n  char a1[14];\n  char t;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    m = 0;\n    t = a[0];\n    for (i = 1; i <= n - 1; i++)\n      if (a[i] > t) {\n        m = i;\n        t = a[i];\n      }\n    for (i = m + 1; i <= n - 1; i++)\n      a1[i + 3] = a[i];\n    a[m + 1] = b[0];\n    a[m + 2] = b[1];\n    a[m + 3] = b[2];\n    for (i = m + 4; i <= n + 2; i++)\n      a[i] = a1[i];\n    a[n + 3] = 0;\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "20", "index": "37026", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    char a[14];\n    int len_a = strlen(str), len_b = strlen(substr), i, j;\n    char max = 0;\n    for (i = 0; i < len_a; i++) {\n      if (str[i] > max)\n        max = str[i];\n      else\n        continue;\n    }\n    for (i = 0; i < len_a; i++) {\n      if (str[i] == max) {\n        if (i == len_a - 1) {\n          for (j = len_a; j <= len_a + len_b; j++)\n            str[j] = substr[j - len_a];\n        } else {\n          for (j = 0; j < len_a - i - 1; j++)\n            a[j] = str[j + i + 1];\n          for (j = i + 1; j < i + len_b + 1; j++)\n            str[j] = substr[j - i - 1];\n          for (j = i + len_b + 1; j < len_a + len_b; j++)\n            str[j] = a[j - i - len_b - 1];\n          str[j] = '\\0';\n        }\n        break;\n      } else\n        continue;\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37027", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[100], s2[100], s3[100];\n  int m;\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    m = strlen(s1);\n    int k = 0;\n    int j;\n    for (j = 1; j < m; j++)\n      if (s1[j] > s1[k])\n        k = j;\n    for (j = 0; j <= k; j++)\n      s3[j] = s1[j];\n    s3[k + 1] = s2[0];\n    s3[k + 2] = s2[1];\n    s3[k + 3] = s2[2];\n    for (j = k + 4; j < m + 3; j++)\n      s3[j] = s1[j - 3];\n    for (j = 0; j < m + 3; j++)\n      printf(\"%c\", s3[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37028", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint max(char str[]);\n\nint main() {\n  int i;\n\n  for (;;) {\n    int n, m;\n    char x;\n    char str[14], substr[4];\n    if ((x = getchar()) == EOF)\n      break;\n\n    scanf(\"%s \", str);\n    n = strlen(str);\n    for (i = 0; i < 3; i++)\n      substr[i] = str[n + i - 3];\n\n    substr[3] = '\u0000';\n    str[n - 3] = '\u0000';\n    for (i = n - 4; i > 0; i = i - 1) {\n      str[i] = str[i - 1];\n    }\n    str[0] = x;\n\n    m = max(str);\n\n    for (i = n + 2; i > m + 3; i = i - 1) {\n      str[i] = str[i - 3];\n    }\n    str[n + 3] = '\u0000';\n    str[m + 1] = substr[0];\n    str[m + 2] = substr[1];\n    str[m + 3] = substr[2];\n    puts(str);\n  }\n}\n\nint max(char str[]) {\n  int len;\n  int i;\n  char c = str[0];\n  len = strlen(str);\n\n  for (i = 1; i < len; i++) {\n    if (c < str[i])\n      c = str[i];\n  }\n\n  for (i = 0; i < len; i++) {\n    if (str[i] == c)\n      return i;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37029", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11] = {0}, substr[4], str1[10][14] = {0};\n  int i, k, j, m = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    for (i = 1; i < strlen(str); i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = strlen(str) + 2; i > k + 3; i--)\n      str1[m][i] = str[i - 3];\n    for (i = 0; i <= k; i++)\n      str1[m][i] = str[i];\n    j = 0;\n    for (i = k + 1; i < k + 4; i++, j++)\n      str1[m][i] = substr[j];\n    m++;\n  }\n  for (i = 0; i < m; i++)\n    cout << str1[i] << \"\\n\";\n  return 0;\n}\n"}
{"label": "20", "index": "37030", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[15] = {'\u0000'}, b[4] = {'\u0000'}, c[15] = {'\u0000'}, d;\n  int num = 0, j, max, q, len, t;\n  while (1) {\n    if ((d = getchar()) == EOF) {\n      break;\n    }\n    a[0] = d;\n\n    scanf(\"%s \", a);\n    max = 0;\n    len = strlen(a);\n    for (j = 0; j < 3; j++) {\n      b[j] = a[len + j - 3];\n    }\n    for (j = 0; j < len - 4; j++) {\n      t = a[j];\n      if (t > max) {\n        max = t;\n        q = j;\n      }\n    }\n    strcpy(c, a);\n    for (j = q + 1; j < q + 4; j++) {\n      a[j] = b[j - q - 1];\n    }\n    for (j = q + 4; j < len - 1; j++) {\n      a[j] = c[j - 3];\n    }\n\n    for (j = 0; j < len - 1; j++) {\n      printf(\"%c\", a[j]);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37031", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *m;\n  int n, i;\n  char s[1000];\n  while (cin >> s) {\n    n = strlen(s);\n    m = &s[0];\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (*p1 > *m)\n        m = p1;\n    }\n    for (p1 = s; p1 < (s + n - 4); p1++) {\n      if (p1 < m)\n        printf(\"%c\", *p1);\n      if (p1 == m)\n        printf(\"%c%c%c%c\", *p1, s[n - 3], s[n - 2], s[n - 1]);\n      if (p1 > m)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37032", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, mark, n, m, k;\n  char str[13], substr[13];\n  char a[26];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    mark = 0;\n    for (i = 0; i < n; i++)\n      if (str[i] > str[mark])\n        mark = i;\n    for (i = 0; i < mark + 1; i++)\n      a[i] = str[i];\n    for (; i < mark + m + 1; i++)\n      a[i] = substr[i - mark - 1];\n    for (; i < n + m; i++)\n      a[i] = str[i - m];\n    a[i] = '\\0';\n    printf(\"%s\\n\", a);\n  }\n}\n"}
{"label": "20", "index": "37033", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, a, m;\n  char str[11], substr[4];\n\n  while (scanf(\"%s%s\", str, substr) != EOF)\n\n  {\n    n = strlen(str);\n    m = 0;\n\n    for (i = 0; i < n; i++) {\n      if (str[i] > m) {\n        m = str[i];\n        a = i;\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      printf(\"%c\", str[i]);\n      if (i == a)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37034", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len1;\n  char str1[1000], str2[1000], *p, *p1, *p2, *p0, max;\n  while ((scanf(\"%s\", str1)) != EOF) {\n\n    cin >> str2;\n    len1 = strlen(str1);\n    p2 = str2;\n    p1 = str1;\n    max = str1[0];\n    for (p = str1; p < str1 + len1; p++)\n      if (max < *p) {\n        max = *p;\n        p0 = p;\n      }\n    for (; p1 < str1 + len1; p1++) {\n      if (p1 == p0) {\n        printf(\"%c\", *p1);\n        for (; *p2 != '\u0000'; p2++) {\n          if (*p2 == ' ')\n            continue;\n          else\n            printf(\"%c\", *p2);\n        }\n      }\n      if (p1 != p0)\n        printf(\"%c\", *p1);\n    }\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37035", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[30][10];\n  char substr[30][3];\n  char ans[30][13];\n  char max;\n  char *a, *b, *c, *d;\n  int i, j, k, l, m, n;\n  for (i = 0; i < 30; i++) {\n    if (scanf(\"%s%s\", str[i], substr[i]) == EOF)\n      break;\n    l = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < l; j++)\n      if (max < str[i][j])\n        max = str[i][j];\n    for (j = 0; j < l; j++)\n      if (max == str[i][j])\n        break;\n    a = &str[i][0];\n    b = &substr[i][0];\n    c = &str[i][j + 1];\n    for (k = 0; k < j + 1; k++)\n      ans[i][k] = *(a + k);\n    for (m = 0; m < 3; k++, m++)\n      ans[i][k] = *(m + b);\n    for (n = 0; j + 1 + n < l; n++, k++)\n      ans[i][k] = *(c + n);\n    ans[i][k] = '\\0';\n  }\n  for (j = 0; j < i; j++) {\n    l = strlen(ans[j]);\n    for (k = 0; k < l - 1; k++) {\n      d = ans[j];\n      cout << *(d + k);\n    }\n    printf(\"%c\\n\", *(d + k));\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37036", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, t;\n  char str[16], t_max, substr[4];\n  while (scanf(\"%s%s\", &str, &substr) != EOF) {\n    l = strlen(str);\n    t_max = -1;\n    for (i = 0; i < l; i++)\n      if (t_max < str[i]) {\n        t = i;\n        t_max = str[i];\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < l; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37037", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char nul = '0';\n  a = strlen(str);\n  for (i = 0; i < a - 4; i++) {\n    if (str[i] > nul) {\n      nul = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a[100], length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a[i] = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a[i] + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a[i] && j < a[i] + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a[i]];\n      else if (j > a[i] + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str1[i]);\n}\n"}
{"label": "20", "index": "37038", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint f(char str[]) {\n  int i, a, n;\n  char ch = str[0];\n  a = strlen(str);\n  for (i = 1; i < a - 4; i++) {\n    if (str[i] > ch) {\n      ch = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a, length[100];\n  char str[100][50], str1[100][50];\n  do {\n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a && j < a + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a];\n      else if (j > a + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    cout << str1[i] << \" \";\n  return 0;\n}\n"}
{"label": "20", "index": "37039", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15], substr[5], a;\n  int i, j, n, m, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(substr);\n    m = strlen(str);\n    a = 0;\n    for (i = 0; i < m; i++) {\n      if (a < str[i])\n        a = str[i];\n    }\n    for (j = 0;; j++) {\n      if (a == str[j])\n        break;\n    }\n    for (l = m - 1; l >= j + 1; l--)\n      str[l + n] = str[l];\n    for (l = j + 1; l <= j + n; l++)\n      str[l] = substr[l - j - 1];\n    str[m + n] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37040", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int max = 0, i, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    for (i = 0; i < l; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = l - 1; i >= max + 1; i--)\n      str[i + 3] = str[i];\n    for (i = 1; i <= 3; i++)\n      str[max + i] = substr[i - 1];\n    str[l + 3] = 0;\n    puts(str);\n  }\n}\n"}
{"label": "20", "index": "37041", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s1[13], s2[5];\n  int i, j, m, a;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    a = 0;\n    m = strlen(s1);\n    for (i = 0; i < m; i++) {\n      if (s1[i] > s1[a])\n        a = i;\n    }\n    for (i = m - 1; i > a; i--)\n      s1[i + 3] = s1[i];\n    for (i = a + 1, j = 0; i < a + 1 + 3; i++, j++)\n      s1[i] = s2[j];\n    for (i = 0; i < m + 3; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37042", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j;\n  char *str, *substr;\n  int max;\n  str = (char *)malloc(20 * sizeof(char));\n  substr = (char *)malloc(20 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (*(str + i) > max)\n        max = *(str + i);\n    }\n    for (i = 0; i < n; i++) {\n      if (*(str + i) == max) {\n        for (j = 0; j <= i; j++)\n          printf(\"%c\", *(str + j));\n        printf(\"%s\", substr);\n        if (i == n - 1) {\n          printf(\"\\n\");\n          break;\n        }\n        for (j = i + 1; j < n - 1; j++)\n          printf(\"%c\", *(str + j));\n        printf(\"%c\\n\", *(str + n - 1));\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37043", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i = 0, j, l[100], m[100] = {0};\n  char str[100][13], substr[100][13];\n  while (scanf(\"%s%s\", substr[i], str[i]) != EOF)\n    i++;\n  n = i;\n  for (i = 0; i < n; i++) {\n    l[i] = strlen(substr[i]);\n    for (j = 1; j < l[i]; j++)\n      if (substr[i][j] > substr[i][m[i]])\n        m[i] = j;\n    for (j = l[i] - 1; j > m[i]; j--)\n      substr[i][j + 3] = substr[i][j];\n    substr[i][m[i] + 1] = str[i][0];\n    substr[i][m[i] + 2] = str[i][1];\n    substr[i][m[i] + 3] = str[i][2];\n    printf(\"%s\\n\", substr[i]);\n  }\n}\n"}
{"label": "20", "index": "37044", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int i, j, n, a;\n  char max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 1; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        a = i;\n      }\n    }\n    for (j = 0; j < a + 1; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (j = 0; j < 3; j++)\n      printf(\"%c\", substr[j]);\n\n    for (j = a + 1; j < n; j++) {\n      printf(\"%c\", str[j]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37045", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[1000][13];\n  char c[1000][17];\n  char b[1000][3];\n  int n = 0, i = 0, j, m, k;\n\n  for (i = 0; i < 1000; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == '\u0000') {\n      n = i;\n      break;\n    }\n\n    for (j = 0; j < 17; j++) {\n      if (c[i][j] == ' ') {\n        for (k = 0; k < j; k++) {\n          a[i][k] = c[i][k];\n          a[i][j] = '\u0000';\n        }\n        for (k = 0; k < 3; k++) {\n          b[i][k] = c[i][k + j + 1];\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      if (a[i][j] > a[i][m])\n        m = j;\n    }\n    for (j = 9; j > m; j--) {\n      a[i][j + 3] = a[i][j];\n    }\n    for (j = 0; j < 3; j++) {\n      a[i][m + j + 1] = b[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "20", "index": "37046", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20][14];\n  int m;\n  int i = 0, j, p, q;\n  char x;\n  for (i = 0; i < 20; i++)\n    for (j = 0; j < 14; j++) {\n      str[i][j] = '\u0000';\n    }\n  for (i = 0;; i++) {\n\n    cin >> str[i];\n    m = i;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i < m; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 14; j++) {\n      if (str[i][j] == ' ') {\n        p = j;\n        break;\n      }\n    }\n    x = str[i][0];\n    for (j = 1; j < p; j++) {\n      if (str[i][j] > x) {\n        x = str[i][j];\n        q = j;\n      }\n    }\n\n    for (j = 0; j <= q; j++) {\n      printf(\"%c\", str[i][j]);\n    }\n    printf(\"%c%c%c\", str[i][p + 1], str[i][p + 2], str[i][p + 3]);\n    for (j = 1; j < p - q - 1; j++) {\n      printf(\"%c\", str[i][q + j]);\n    }\n    printf(\"%c \", str[i][p - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37047", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int i, b, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    b = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[b] < str[i])\n        b = i;\n    }\n    for (i = 12; i > (b + 3); i--)\n      str[i] = str[i - 3];\n    for (i = (b + 1); i < (b + 4); i++) {\n      str[i] = substr[i - b - 1];\n    }\n    cout << str << \"\\n\";\n    for (j = 0; j < 13; j++)\n      str[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37048", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char str[], char substr[]);\nint main() {\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF)\n    f(str, substr);\n}\nvoid f(char str[], char substr[]) {\n  int i, j, k, l;\n  char a;\n  l = strlen(str);\n  a = str[0];\n  for (i = 1; i < l; i++)\n    if (str[i] > a)\n      a = str[i];\n  for (i = 0; i < l; i++)\n    if (str[i] == a)\n      break;\n  for (j = l + 3; j > i + 3; j--)\n    str[j] = str[j - 3];\n  for (j = i + 1, k = 0; k < 3; j++, k++)\n    str[j] = substr[k];\n  printf(\"%s\\n\", str);\n}\n"}
{"label": "20", "index": "37049", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, j, len, max = 0;\n  char str[13], substr[3], t[13] = {'\\0'}, c;\n\n  scanf(\"%s\", str);\n  len = strlen(str);\n  scanf(\"%s\", substr);\n  c = getchar();\n  \n\n  while (c == '\\n') {\n    \n    for (i = 0; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; str[i] != max; i++)\n      ;\n    for (j = i + 1; j < len; j++)\n      t[j - i - 1] = str[j];\n    str[i + 1] = '\\0';\n    strcat(str, substr);\n    strcat(str, t);\n    puts(str);\n    for (i = 0; i < len; i++)\n      t[i] = '\\0'; \n    max = 0;\n\n    scanf(\"%s\", str);\n    len = strlen(str);\n    scanf(\"%s\", substr);\n    c = getchar();\n  }\n}\n"}
{"label": "20", "index": "37050", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[10][11], substr[10][4], output[10][14] = {'\\0'};\n  int maxN = 0, i = 0, j, end;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n\n    i++;\n  }\n  end = i;\n  for (i = 0; i < end; i++) {\n    char max = str[i][0], *p;\n    p = output[i];\n    for (j = 0; j < strlen(str[i]); j++)\n      if ((int)str[i][j] > (int)max) {\n        max = str[i][j];\n        maxN = j + 1;\n      }\n    strncpy(p, str[i], maxN);\n    strcat(p, substr[i]);\n    strcat(p + strlen(output[i]), str[i] + maxN);\n    cout << output[i] << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37051", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[4], *p, max, *q;\n  int i, num = 0, n;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n\n    n = strlen(str);\n    p = str;\n    q = substr;\n    max = *p;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        num = i;\n      }\n    }\n    for (i = 0; i < num + 1; i++)\n      printf(\"%c\", *(p + i));\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", *(q + i));\n    for (i = num + 1; i < n; i++)\n      printf(\"%c\", *(p + i));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37052", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n    cin.getline(str, 11, ' ');\n    cin.getline(substr, 4, '\\n');\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      cout << str[i];\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      cout << str[i];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37053", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar str[10];\nchar substr[3];\nint pan() {\n  int j, i, x, qq = strlen(str) - 1;\n  for (i = 0; i < strlen(str); i++) {\n    x = 0;\n    for (j = 0; j < strlen(str); j++) {\n      if (str[i] < str[j]) {\n        x = 0;\n        break;\n      }\n      x = 1;\n    }\n    if (x == 1) {\n      qq = i;\n      break;\n    }\n  }\n  return qq;\n}\n\nint main() {\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i;\n    for (i = 0; i <= pan(); i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      printf(\"%c\", substr[i]);\n    for (i = pan() + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37054", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l1, max, l2, i, l;\n  char str[100], substr[100];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    max = 0;\n    for (i = 0; i < l1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        l = i;\n      }\n    l2 = strlen(substr);\n    for (i = l1 - 1; i > l; i--)\n      str[i + l2] = str[i];\n    for (i = 0; i < l2; i++)\n      str[l + i + 1] = substr[i];\n    for (i = 0; i < l1 + l2; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37055", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[4];\n  int max, i, j, k, p, length;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    length = strlen(str);\n    max = str[0];\n    for (i = 1; i < length; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (j = length - 1; j >= k + 1; j--) {\n      str[j + 3] = str[j];\n    }\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    for (p = 0; p < length + 3; p++)\n      cout << str[p];\n\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37056", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, n, N;\n  char a[100] = {0}, b[100] = {0};\n  char *p = NULL;\n  while (scanf(\"%s %s \", a, b)) {\n    n = strlen(a);\n    N = a[0];\n    for (i = 0; i < n; i++) {\n\n      if (a[i] > N) {\n        N = a[i];\n        p = &a[i];\n      }\n    }\n\n    for (i = 0; i < n; i++) {\n      cout << a[i];\n      if (&a[i] == p)\n        printf(\"%s\", b);\n    }\n    for (i = 0; i < n; i++)\n      a[i] = 0;\n    for (i = 0; i < strlen(b); i++)\n      b[i] = 0;\n    printf(\"\\n\");\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "37057", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[15], substr[4];\n  int i, j, max, c;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 1, max = str[0], c = 0; str[i] != '\\0'; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        c = i;\n      }\n    }\n    for (j = i + 3; j > c + 3; j--)\n      str[j] = str[j - 3];\n\n    str[c + 1] = substr[0];\n    str[c + 2] = substr[1];\n    str[c + 3] = substr[2];\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37058", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char a[15] = {'\u0000'}, b[4] = {'\u0000'}, c[15] = {'\u0000'}, d;\n  int num = 0, j, max, q, len, t;\n\n  while (1) {\n    if ((d = getchar()) == EOF) {\n      break;\n    }\n    a[0] = d;\n\n    scanf(\"%s \", a);\n    max = 0;\n    len = strlen(a);\n    for (j = 0; j < 3; j++) {\n      b[j] = a[len + j - 3];\n    }\n    for (j = 0; j < len - 4; j++) {\n      t = a[j];\n      if (t > max) {\n        max = t;\n        q = j;\n      }\n    }\n    strcpy(c, a);\n    for (j = q + 1; j < q + 4; j++) {\n      a[j] = b[j - q - 1];\n    }\n    for (j = q + 4; j < len - 1; j++) {\n      a[j] = c[j - 3];\n    }\n\n    for (j = 0; j < len - 1; j++) {\n      printf(\"%c\", a[j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37059", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, max, m;\n  char str[11], substr[4], temp[10];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (i = m + 1; i < n; i++) {\n      printf(\"%c\", str[i]);\n    }\n    cout << \"\\0\";\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37060", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid s(char c[], char d[]) {\n  int max = 0, n, y, z;\n  for (n = 0; n < 10; n++) {\n    if (c[n] > max) {\n      max = c[n];\n      y = n;\n    }\n    if (c[n] == '\\0') {\n      z = n;\n      break;\n    }\n  }\n  for (n = z - 1; n > y; n--)\n    c[n + 3] = c[n];\n  c[y + 1] = d[0];\n  c[y + 2] = d[1];\n  c[y + 3] = d[2];\n}\nint main() {\n  char a[20] = {'\\0'}, b[4] = {'\\0'};\n  int i;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    s(a, b);\n    cout << a << \"\\n\";\n    for (i = 0; i < 20; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      b[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "37061", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, k, n;\n  char str[11], substr[4], a[14], b;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    b = str[0];\n    k = 0;\n    for (i = 1; i < n; i++) {\n      if (b < str[i]) {\n        b = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      a[i] = str[i];\n    a[k + 1] = substr[0];\n    a[k + 2] = substr[1];\n    a[k + 3] = substr[2];\n    for (i = k + 4; i <= n + 2; i++) {\n      a[i] = str[i - 3];\n    }\n    for (i = 0; i <= n + 2; i++)\n      printf(\"%c\", a[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37062", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], *p, ma;\n  int i, m;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    p = str;\n    ma = *p;\n    m = 0;\n\n    for (i = 0; i < strlen(str); i++, p++) {\n      if (*p > ma) {\n        ma = *p;\n        m = i;\n      }\n    }\n\n    p = str;\n\n    for (i = 0; i <= m; i++, p++) {\n      cout << *p;\n    }\n    printf(\"%s\", substr);\n    for (; i < strlen(str); i++, p++)\n      cout << *p;\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37063", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int max, maxindex, i, j, k, m, n, l;\n  char str1[20], str2[10];\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; str1[i]; i++) {\n      if (str1[i] > max) {\n        max = str1[i];\n        maxindex = i;\n      }\n    }\n    m = strlen(str1);\n    n = strlen(str2);\n    for (j = 0; j <= maxindex; j++)\n      printf(\"%c\", str1[j]);\n    for (k = 0; k < n; k++)\n      printf(\"%c\", str2[k]);\n    for (l = maxindex + 1; l < m; l++)\n      printf(\"%c\", str1[l]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37064", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[14], s2[4], s, s3[14];\n  int n, m, t;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    for (n = 1, s = s1[0], m = 0; s1[n] != '\\0'; n++) {\n      if (s1[n] > s) {\n        m = n;\n        s = s1[n];\n      }\n    }\n    for (n = m + 1, t = 0; s1[n] != '\\0'; n++, t++)\n      s3[t] = s1[n];\n    s3[t] = '\\0';\n    for (n = 1; n <= 3; n++)\n      s1[m + n] = s2[n - 1];\n    s1[m + n] = '\\0';\n    cout << s1 << s3 << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37065", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char max = 0;\n  char str[14], substr[4];\n  char *p = str, *q = str;\n  while (cin >> str >> substr) {\n    i = 0;\n    max = *p;\n    while (*(p + i) != '\\0') {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        q = p + i;\n      }\n      i++;\n    }\n    for (i = 11 - (q - p + 1); i >= 1; i--) {\n      *(q + i + 3) = *(q + i);\n    }\n    for (i = 1; i <= 3; i++) {\n      *(q + i) = substr[i - 1];\n    }\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37066", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int i, j, k, n, m;\n  while (1) {\n    char a[50] = {'0'}, b[20] = {'0'}, c[20] = {'0'};\n    scanf(\"%s %s \", a, b);\n    if (a[0] == '\\0')\n      break;\n    n = strlen(a);\n    for (i = 0; i < n; i++) {\n      k = 0;\n      for (j = 0; j < n; j++) {\n        if (a[i] < a[j])\n          k++;\n      }\n      if (k == 0) {\n        m = i;\n        break;\n      }\n    }\n    for (i = 0; i < n - m; i++) {\n      c[i] = a[i + m + 1];\n      a[i + m + 1] = '\\0';\n    }\n    strcat(a, b);\n    strcat(a, c);\n    if (a[0] == '0')\n      break;\n    else\n      printf(\"%s\\n\", a);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37067", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20][14];\n  int m;\n  int i = 0, j, p, q;\n  char x;\n  for (i = 0; i < 20; i++)\n    for (j = 0; j < 14; j++) {\n      str[i][j] = '\u0000';\n    }\n  for (i = 0;; i++) {\n\n    cin >> str[i];\n    m = i;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i < m; i++) {\n    p = 0;\n    q = 0;\n    for (j = 0; j < 14; j++) {\n      if (str[i][j] == ' ') {\n        p = j;\n        break;\n      }\n    }\n    x = str[i][0];\n    for (j = 1; j < p; j++) {\n      if (str[i][j] > x) {\n        x = str[i][j];\n        q = j;\n      }\n    }\n\n    for (j = 0; j <= q; j++) {\n      printf(\"%c\", str[i][j]);\n    }\n    cout << str[i][p + 1] << str[i][p + 2] << str[i][p + 3];\n    for (j = 1; j < p - q - 1; j++) {\n      cout << str[i][q + j];\n    }\n    printf(\"%c \", str[i][p - 1]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37068", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[4];\n  char max;\n  int i, j, imax;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n\n    max = a[0];\n    imax = 0;\n    for (i = 1;; i++) {\n      if (a[i] == 0)\n        break;\n      if (a[i] > max) {\n        max = a[i];\n        imax = i;\n      }\n    }\n    for (j = 0; j <= imax; j++) {\n      cout << a[j];\n    }\n    cout << b[0] << b[1] << b[2];\n    for (j = imax + 1;; j++) {\n      if (a[j] == 0) {\n        printf(\"\\n\");\n        break;\n      }\n      printf(\"%c\", a[j]);\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37069", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[16], substr[4];\n  char output[20];\n  char *string, *max;\n  int i, j;\n  while ((scanf(\"%s\", str)) != EOF) {\n\n    scanf(\"%s\", substr);\n    string = str;\n    max = str;\n    for (i = 0; i < (strlen(str)); i++) {\n      if (*string > *max) {\n        max = string;\n      }\n      string++;\n    }\n    string = str;\n    for (i = 0; (*string) != (*max); string++, i++)\n      output[i] = *string;\n    output[i] = *max;\n    max++;\n    for (j = i + 1; j <= (3 + i); j++)\n      output[j] = substr[j - i - 1];\n    for (; j < (strlen(str) + strlen(substr)); j++, i++) {\n      output[j] = str[i + 1];\n    }\n    for (i = 0; i < (strlen(str) + strlen(substr)); i++)\n      printf(\"%c\", output[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37070", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[100][15] = {'\\0'}, s2[100][4];\n  int i = 0, j, max, k, u;\n  while (scanf(\"%s%s\\n\", &s1[i], &s2[i]) != EOF)\n    i++;\n  for (j = 0; j <= i; j++) {\n    max = 0;\n    k = 1;\n    while (s1[j][k] != '\\0') {\n      if (s1[j][k] > s1[j][max])\n        max = k;\n      k++;\n    }\n    for (u = k - 1; u > max; u--)\n      s1[j][u + 3] = s1[j][u];\n\n    s1[j][max + 1] = s2[j][0];\n    s1[j][max + 2] = s2[j][1];\n    s1[j][max + 3] = s2[j][2];\n    s1[j][k + 3] = '\\n';\n    printf(\"%s\", s1[j]);\n  }\n}\n"}
{"label": "20", "index": "37071", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], sub[4], m;\n  int t, i, len;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    t = 0;\n    m = str[0];\n    len = 0;\n    for (i = 0; str[i] != '\\0'; i++)\n      len++;\n\n    for (i = 1; i < len; i++)\n      if (str[i] > m) {\n        t = i;\n        m = str[i];\n      }\n    for (i = len - 1; i > t; i--)\n      str[i + 3] = str[i];\n    str[t + 1] = sub[0];\n    str[t + 2] = sub[1];\n    str[t + 3] = sub[2];\n    str[len + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37072", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, max;\n  char str[15], substr[3];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    max = 0;\n    for (i = 0; i < l; i++) {\n      if (str[max] < str[i])\n        max = i;\n    }\n    for (j = l - 1; j > max; j--)\n      str[j + 3] = str[j];\n    for (j = max + 1; j < max + 4; j++)\n      str[j] = substr[j - max - 1];\n    for (j = 0; j < l + 3; j++)\n      printf(\"%c\", str[j]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37073", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], substr[10];\n  int i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > str[max]) {\n        max = i;\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      printf(\"%c\", str[i]);\n    }\n    for (i = 0; i < strlen(substr); i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = max + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37074", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int b, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    b = strlen(str);\n    j = 0;\n    str[b] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= b - 1; i++)\n      if (str[i] > str[j])\n        j = i;\n    for (i = b - 1; i >= j + 1; i--)\n      str[i + 3] = str[i];\n    for (i = j + 1; i <= j + 3; i++)\n      str[i] = substr[i - 1 - j];\n    str[b + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37075", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i;\n  char ch1[11], ch2[4];\n  while (scanf(\"%s%s\", ch1, ch2) != EOF) {\n    int k, m = 0;\n    char t = ch1[0];\n    k = strlen(ch1);\n    for (i = 0; i <= k - 1; i++) {\n      if (ch1[i] > t) {\n        t = ch1[i];\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", ch1[i]);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", ch2[i]);\n    if (m != k - 1) {\n      for (i = m + 1; i <= k - 1; i++)\n        printf(\"%c\", ch1[i]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37076", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, max_index;\n  char str1[20], str2[10], ans[20];\n  char *ipstr1 = str1;\n  while (scanf(\"%s%s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 1; *(str1 + i); i++) \n      if (*(str1 + i) > max)\n        max = *(str1 + i), max_index = i;\n    strcpy(ans, \"\");\n    strncat(ans, str1, max_index + 1); \n    strcat(ans, str2);\n    strcat(ans, str1 + max_index + 1);\n    \n    printf(\"%s\\n\", ans);\n  }\n}\n"}
{"label": "20", "index": "37077", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], a[11];\n\n  int j, k, i, n, m;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    m = strlen(substr);\n    for (j = 0; j < n; j++)\n      a[j] = str[j];\n\n    for (k = 1; k < n; k++)\n      if (a[0] < a[k])\n        a[0] = a[k];\n    for (j = 0; j < n; j++) {\n      cout << str[j];\n      if (str[j] == a[0])\n        break;\n    }\n    for (k = 0; k < m; k++)\n      cout << substr[k];\n    for (i = (j + 1); i < n; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37078", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14];\n  int i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37079", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int l1, max, l2, i, l;\n  char str[100], substr[100];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    max = 0;\n    for (i = 0; i < l1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        l = i;\n      }\n    l2 = strlen(substr);\n    for (i = l1 - 1; i > l; i--)\n      str[i + l2] = str[i];\n    for (i = 0; i < l2; i++)\n      str[l + i + 1] = substr[i];\n    for (i = 0; i < l1 + l2; i++)\n      printf(\"%c\", str[i]);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37080", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5];\n  while (scanf(\"%s %s \", str, substr)) {\n    int j = 0;\n    int A = strlen(str);\n    int B = strlen(substr);\n    int k = 0;\n    char temp = str[0];\n    for (int i = 0; i < A; i++)\n      if (str[i] > temp)\n        temp = str[i];\n    for (j = 0; j < A; j++)\n      if (str[j] == temp)\n        break;\n    j++;\n    for (k = A; k >= j; k--) {\n      str[k + B] = str[k];\n    }\n\n    for (int l = j; l <= j + B - 1; l++)\n      str[l] = substr[l - j];\n    cout << str << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37081", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[100][50];\n  int a[100][2], b[100], c[100];\n  int i, j, k = -1;\n  for (i = 0; i < 100; i++)\n    c[i] = b[i] = 0;\n\n  for (i = 0; i < 100; i++) {\n    cin >> str[i];\n    k = k + 1;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i < k; i++) {\n    c[i] = strlen(str[i]);\n    for (j = 0; j < c[i]; j++)\n      if (str[i][j] == ' ')\n        b[i] = j;\n  }\n\n  for (i = 0; i < k; i++) {\n    a[i][1] = str[i][0];\n    a[i][0] = 0;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < b[i]; j++)\n      if (str[i][j] > a[i][1]) {\n        a[i][0] = j;\n        a[i][1] = str[i][j];\n      }\n\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < a[i][0] + 1; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = b[i] + 1; j < b[i] + 4; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = a[i][0] + 1; j < b[i]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37082", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char c1[11], c2[4];\n  char ans[20];\n  while (scanf(\"%s%s\", c1, c2) != EOF) {\n    char ans[20] = {0};\n    int i, max, max_num, n, j, m;\n    max = 0;\n    n = strlen(c1);\n    for (i = 0; i <= n; i++) {\n      if (c1[i] > max) {\n        max = c1[i];\n        max_num = i;\n      }\n    }\n    for (i = 0; i <= max_num; i++)\n      ans[i] = c1[i];\n    strcat(ans, c2);\n    n = strlen(c1);\n    m = strlen(ans);\n    j = 0;\n    for (i = max_num + 1; i <= n; i++) {\n      ans[m + j] = c1[i];\n      j++;\n    }\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37083", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  int i, j;\n  char X;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    X = str[0];\n    for (i = 1; i < strlen(str); i++)\n      if (X < str[i])\n        X = str[i];\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] == X)\n        break;\n    }\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    cout << substr;\n    for (j = i + 1; j < strlen(str); j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37084", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], substr[100], max;\n  int a, b, c, i, d, e, num;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    a = strlen(str);\n    b = strlen(substr);\n    max = str[0];\n    num = 0;\n    for (i = 0; i < a; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        num = i + 1;\n      }\n    }\n    for (c = 0; c <= num; c++) {\n      printf(\"%c\", str[c]);\n    }\n    for (d = 0; d < b; d++) {\n      printf(\"%c\", substr[d]);\n    }\n    for (e = num + 1; e < a; e++) {\n      printf(\"%c\", str[e]);\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37085", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, max = 0;\n  char str[11], substr[4], maxx = 0;\n  char zong[20];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    maxx = 0;\n    j = 0;\n    for (i = 0; i <= strlen(str) - 1; i++) {\n      if (str[i] > maxx) {\n        max = i;\n        maxx = str[i];\n      }\n    }\n    for (i = 0; i <= max; i++) {\n      zong[j++] = str[i];\n    }\n    for (i = 0; i <= 2; i++) {\n      zong[j++] = substr[i];\n    }\n    for (i = max + 1; i <= strlen(str) - 1; i++) {\n      zong[j++] = str[i];\n    }\n    zong[j] = '\\0';\n    printf(\"%s\\n\", zong);\n  }\n}\n"}
{"label": "20", "index": "37086", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  int n, i, k;\n  cin >> str >> substr;\n  n = strlen(str);\n  k = 0;\n  for (i = 1; i < n; i++)\n    if (str[i] > str[k])\n      k = i;\n  for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n    str[i] = str[i - 3];\n  str[k + 1] = substr[0];\n  str[k + 2] = substr[1];\n  str[k + 3] = substr[2];\n  for (i = 0; i <= n + 3 - 1; i++)\n    printf(\"%c\", str[i]);\n  for (i = 0; i <= 13; i++)\n    str[i] = '\\0';\n\n  for (;;) {\n    scanf(\"%s %s\", str, substr);\n    if (str[0] == '\\0')\n      break;\n    n = strlen(str);\n    k = 0;\n    for (i = 1; i < n; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = n + 3 - 1; i >= k + 1 + 3; i--)\n      str[i] = str[i - 3];\n    str[k + 1] = substr[0];\n    str[k + 2] = substr[1];\n    str[k + 3] = substr[2];\n    printf(\"\\n\");\n    for (i = 0; i <= n + 3 - 1; i++)\n      cout << str[i];\n    for (i = 0; i <= 13; i++)\n      str[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "37087", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void output(char a[11], char b[4]);\n  int i;\n  char a[11], b[4];\n  for (i = 0; scanf(\"%s %s\", a, b) != EOF; i++)\n    output(a, b);\n  return 0;\n}\n\nvoid output(char a[11], char b[4]) {\n  int i, c = 0, j;\n  for (i = 1; a[i] != '\\0'; i++) {\n    if (a[c] < a[i])\n      c = i;\n  }\n  for (j = 0; j <= c; j++)\n    printf(\"%c\", a[j]);\n  printf(\"%s\", b);\n  for (j = j; a[j] != '\\0'; j++)\n    printf(\"%c\", a[j]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "37088", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15], substr[3];\n  int b, i, j;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    b = strlen(str);\n    j = 0;\n    str[b] = 97;\n    substr[3] = 97;\n    for (i = 1; i <= b - 1; i++)\n      if (str[i] > str[j])\n        j = i;\n    for (i = b - 1; i >= j + 1; i--)\n      str[i + 3] = str[i];\n    for (i = j + 1; i <= j + 3; i++)\n      str[i] = substr[i - 1 - j];\n    str[b + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37089", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15], substr[4], *p;\n  int i, n, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    p = &str[0];\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (*p < str[i]) {\n        p = &str[i];\n        j = i;\n      }\n    for (i = n - 1; i > j; i--)\n      str[i + 3] = str[i];\n    *(p + 1) = substr[0];\n    *(p + 2) = substr[1];\n    *(p + 3) = substr[2];\n    str[n + 3] = '\\0';\n\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37090", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i, m = 0;\n    char max = str[0];\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      cout << str[i];\n    int p = strlen(substr);\n    for (i = 0; i < p; i++)\n      printf(\"%c\", substr[i]);\n    int q = strlen(str);\n    for (i = m + 1; i < q; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37091", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[10][11], substr[10][4], output[10][14] = {'\\0'};\n  int maxN = 0, i = 0, j, end;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n\n    i++;\n  }\n  end = i;\n  for (i = 0; i < end; i++) {\n    char max = str[i][0], *p;\n    p = output[i];\n    for (j = 0; j < strlen(str[i]); j++)\n      if ((int)str[i][j] > (int)max) {\n        max = str[i][j];\n        maxN = j + 1;\n      }\n    strncpy(p, str[i], maxN);\n    strcat(p, substr[i]);\n    strcat(p + strlen(output[i]), str[i] + maxN);\n    printf(\"%s\\n\", output[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37092", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n, mark;\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    for (i = 0; i < n; i++) {\n      for (j = 0, mark = 1; j < n; j++) {\n        if (s1[i] < s1[j]) {\n          mark = 0;\n          break;\n        }\n      }\n      if (mark) {\n        for (j = 0; j <= i; j++)\n          cout << s1[j];\n        printf(\"%s\", s2);\n        for (j = i + 1; j < n; j++)\n          cout << s1[j];\n        printf(\"\\n\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37093", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid s(char c[], char d[]) {\n  int max = 0, n, y, z;\n  for (n = 0; n < 10; n++) {\n    if (c[n] > max) {\n      max = c[n];\n      y = n;\n    }\n    if (c[n] == '\\0') {\n      z = n;\n      break;\n    }\n  }\n  for (n = z - 1; n > y; n--)\n    c[n + 3] = c[n];\n  c[y + 1] = d[0];\n  c[y + 2] = d[1];\n  c[y + 3] = d[2];\n}\nint main() {\n  char a[20] = {'\\0'}, b[4] = {'\\0'};\n  int i;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    s(a, b);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < 20; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      b[i] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37094", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  int i, k, l;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    k = 0;\n    l = strlen(str);\n    max = str[0];\n    for (i = 1; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < l; i++) {\n      if (i == k) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else {\n        printf(\"%c\", str[i]);\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37095", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int len, max = 0, mark, i, j;\n  char str[14], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        mark = i;\n      }\n    }\n    max = 0;\n    for (i = len - 1; i > mark; i--) {\n      str[i + 3] = str[i];\n    }\n    for (i = mark + 1, j = 0; i < mark + 4; i++, j++)\n\n      str[i] = substr[j];\n\n    for (i = 0; i < len + 3; i++)\n      printf(\"%c\", str[i]);\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37096", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[14];\n  int i, k;\n  char p;\n  for (;;) {\n    for (i = 0; i < 11; i++)\n      a[i] = 0;\n    for (i = 0; i < 4; i++)\n      b[i] = 0;\n    for (i = 0; i < 14; i++)\n      c[i] = '\u0000';\n    scanf(\"%s\", a);\n    if (a[0] == '\u0000')\n      break;\n    scanf(\"%s\", b);\n    p = a[0];\n    k = 0;\n    for (i = 0; a[i] != '\u0000'; i++) {\n      if (p < a[i]) {\n        p = a[i];\n        k = i + 1;\n      }\n    }\n    for (i = 0; i < k; i++)\n      c[i] = a[i];\n    for (i = 0; i < 3; i++)\n      c[k + i] = b[i];\n    for (i = k; a[i] != '\u0000'; i++)\n      c[i + 3] = a[i];\n    cout << c << \" \";\n  }\n}\n"}
{"label": "20", "index": "37097", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], temp;\n  int p, i;\n  while (cin) {\n    p = 0;\n    for (i = 0; i < 11; i++)\n      str[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      substr[i] = '\\0';\n\n    cin.getline(str, 11, ' ');\n    scanf(\"%s \", substr);\n\n    temp = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > temp) {\n        temp = str[i];\n        p = i;\n      }\n    for (i = 0; i <= p; i++)\n      cout << str[i];\n    cout << substr;\n    for (i = p + 1; str[i] != '\\0'; i++)\n      cout << str[i];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37098", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, flag;\n  char str[50], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0, flag = 0; j <= n - 1; j++)\n        if (str[i] >= str[j])\n          flag++;\n      if (flag == n)\n        break;\n    }\n    for (k = n - 1; k >= i + 1; k--)\n      str[k + 3] = str[k];\n    for (l = 1; l <= 3; l++)\n      str[i + l] = substr[l - 1];\n    str[n + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37099", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10000][100], substr[10000][100], max;\n  int i, j, k, n = 0, p;\n  i = 0;\n  while (scanf(\"%s\", &str[i]) != EOF) {\n    scanf(\"%s\", &substr[i]);\n    max = str[i][0];\n    p = 0;\n    for (j = 1; j <= strlen(str[i]) - 1; j++)\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    for (k = strlen(str[i]); k >= p + 1; k--)\n      str[i][k + 3] = str[i][k];\n    for (k = p + 1; k <= p + 3; k++)\n      str[i][k] = substr[i][k - p - 1];\n    i++;\n  }\n  for (j = 0; j <= i - 1; j++) {\n    puts(str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37100", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, m, n;\n  for (;;) {\n    char str[11], substr[4], combine[15] = {0};\n    if (scanf(\"%s%s\", str, substr) == EOF)\n      break;\n    n = strlen(str);\n    m = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] - str[m] > 0)\n        m = i;\n    }\n    for (i = 0; i <= m; i++) {\n      combine[i] = str[i];\n    }\n\n    for (i = 1; i <= 3; i++) {\n      combine[m + i] = substr[i - 1];\n    }\n    for (i = 1; i <= n - m - 1; i++) {\n      combine[m + 3 + i] = str[m + i];\n    }\n    puts(combine);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37101", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char str[15], char substr[4]);\nint main() {\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    f(str, substr);\n  }\n  return 0;\n}\nvoid f(char str[15], char substr[4]) {\n  int i, j, k, l;\n  char a;\n  l = strlen(str);\n  a = str[0];\n  for (i = 1; i < l; i++)\n    if (str[i] > a)\n      a = str[i];\n  for (i = 0; i < l; i++)\n    if (str[i] == a)\n      break;\n  for (j = l + 3; j > i + 3; j--)\n    str[j] = str[j - 3];\n  for (j = i + 1, k = 0; k < 3; j++, k++)\n    str[j] = substr[k];\n  printf(\"%s\\n\", str);\n}\n"}
{"label": "20", "index": "37102", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, flag;\n  char str[50], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0, flag = 0; j <= n - 1; j++)\n        if (str[i] >= str[j])\n          flag++;\n      if (flag == n)\n        break;\n    }\n    for (k = n - 1; k >= i + 1; k--)\n      str[k + 3] = str[k];\n    for (l = 1; l <= 3; l++)\n      str[i + l] = substr[l - 1];\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "37103", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[30], newstr[30], max;\n  int l = 0, p = 0, i;\n  while (cin.getline(str, 30)) {\n    max = str[0];\n    l = strlen(str);\n    for (int i = 0; i <= l - 5; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        p = i;\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      newstr[i] = str[i];\n    }\n    for (i = 1; i <= 3; i++) {\n      newstr[p + i] = str[l - 4 + i];\n    }\n    for (i = p + 4; i <= l - 2; i++) {\n      newstr[i] = str[i - 3];\n    }\n    for (i = 0; i <= l - 2; i++) {\n      cout << newstr[i];\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37104", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint ascmax(char str[10]) {\n  int sit = 0, i;\n  char max;\n  max = str[0];\n  for (i = 0; str[i] != '\\0'; i++) {\n    if (str[i] > max) {\n      max = str[i];\n      sit = i + 1;\n    }\n  }\n  return (sit);\n}\nvoid insert(int sit, char *pa, char *pb, char *pc) {\n  int i = 0;\n  while (i < sit) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  while (i >= sit && (i < sit + 3)) {\n    *pc = *pb;\n    pc++;\n    pb++;\n    i++;\n  }\n  while ((i >= sit + 3) && (*pa != '\\0')) {\n    *pc = *pa;\n    pc++;\n    pa++;\n    i++;\n  }\n  *pc = '\\0';\n}\nint main() {\n  int sit;\n  char a[11], b[4], c[15];\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s \", b);\n\n    sit = ascmax(a);\n    insert(sit, a, b, c);\n    puts(c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37105", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[11] = {0}, s2[4] = {0}, *p;\n  int i, n, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    p = &s1[0];\n    for (i = 0; i < n; i++)\n      if (*p < s1[i]) {\n        p = &s1[i];\n      }\n    m = p - &s1[0] + 1;\n    for (i = 0; i < m; i++)\n      printf(\"%c\", s1[i]);\n    cout << s2;\n    for (i = m; s1[i] != 0; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37106", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[10];\n  char substr[4];\n  char str1[10];\n  char t;\n  int len, i, max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    strcpy(str1, str);\n    max = 0;\n    for (i = 1; i < len; i++)\n      if (str[i] > str[0]) {\n        max = i;\n        t = str[i];\n        str[i] = str[0];\n        str[0] = t;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str1[i]);\n    for (i = 0; i < 3; i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37107", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[50][13], *p, substr[50][3], max;\n  int i = 0, a[50], j, k, m;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    a[i] = strlen(str[i]);\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    for (p = str[j], max = str[j][0]; p < str[j] + a[j]; p++)\n      if (*p > max)\n        max = *p;\n    for (k = 0; k < a[j]; k++)\n      if (max == str[j][k]) {\n        for (m = a[j] + 2; m > k + 3; m--)\n          str[j][m] = str[j][m - 3];\n        str[j][k + 1] = substr[j][0];\n        str[j][k + 2] = substr[j][1];\n        str[j][k + 3] = substr[j][2];\n        str[j][a[j] + 3] = '\\0';\n        break;\n      }\n    printf(\"%s\\n\", str[j]);\n  }\n}\n"}
{"label": "20", "index": "37108", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void in(char str[], char substr[]);\n  char str[100], substr[100];\n  while ((scanf(\"%s%s\", &str, &substr)) != EOF)\n    in(str, substr);\n  return 0;\n}\n\nvoid in(char str[], char substr[]) {\n  int i, k, max, l;\n  l = strlen(str);\n  max = str[0];\n  for (i = 1; i < l; i++) {\n    if (max < str[i]) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i++)\n    printf(\"%c\", str[i]);\n\n  printf(\"%s\", substr);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", str[i]);\n  printf(\"\\n\");\n}\n"}
{"label": "20", "index": "37109", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[3], *p, *max;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (p = str, max = p; *p != '\\0'; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    for (p = str; p <= max; p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    for (p = max + 1; *p != '\\0'; p++)\n      cout << *p;\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37110", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[12], substr[5];\n  int i, j;\n  char X;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    X = str[0];\n    for (i = 1; i < strlen(str); i++)\n      if (X < str[i])\n        X = str[i];\n    for (i = 1; i < strlen(str); i++)\n      if (str[i] == X)\n        break;\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    printf(\"%s\", substr);\n    for (j = i + 1; j < strlen(str); j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37111", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int position, i, lena, lenb, n = 10;\n  char a[10], b[4], *p = NULL, max;\n  while (n--) {\n    max = 0;\n    memset(a, '\\0', sizeof a);\n    memset(b, '\\0', sizeof b);\n    cin >> a;\n    cin >> b;\n    lena = strlen(a);\n    lenb = strlen(b);\n    p = &a[0];\n    for (i = 0; i < lena; i++) {\n      if (*p > max) {\n        max = *p;\n        position = i;\n      }\n      p += 1;\n    }\n    for (i = 0; i <= position; i++)\n      cout << a[i];\n    printf(\"%s\", b);\n    for (i = position + 1; i < lena; i++)\n      cout << a[i];\n\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37112", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], string[14], *p;\n  int i, index;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    for (i = 1; str[i]; i++)\n\n      if (str[i] > *p) {\n        index = i;\n        p = &str[i];\n      }\n    string[0] = '\\0';\n    strncat(string, str, index + 1);\n    strcat(string, substr);\n    strcat(string, p + 1);\n    printf(\"%s\\n\", string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37113", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15], substr[5];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, m = 0;\n    for (i = 0; i < 10; i++) {\n      if (str[i] == 0)\n        break;\n      if (str[i] > str[m])\n        m = i;\n    }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = m + 1; i < 15; i++) {\n      if (str[i] == 0)\n        break;\n      cout << str[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37114", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int len, k;\n  char s1[12], s2[5], s3[20];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    int point, i;\n    char record;\n    len = strlen(s1);\n    record = s1[0];\n    point = 0;\n    k = 0;\n    for (i = 0; i <= len - 1; i++) {\n      if (s1[i] > record) {\n        record = s1[i];\n        point = i;\n      }\n    }\n    for (i = 0; i <= point; i++) {\n      s3[k] = s1[i];\n      k++;\n    }\n    for (i = 0; i <= strlen(s2) - 1; i++) {\n      s3[k] = s2[i];\n      k++;\n    }\n    for (i = point + 1; i <= len - 1; i++) {\n      s3[k] = s1[i];\n      k++;\n    }\n    s3[k] = '\\0';\n    cout << s3;\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37115", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], sub[4], *max, *p, maxchar;\n  while (cin >> str) {\n    cin >> sub;\n    max = str;\n    for (p = str; *p; p++)\n      if (*max < *p)\n        max = p;\n    maxchar = *max;\n    *max = 0;\n    printf(\"%s%c%s%s\\n\", str, maxchar, sub, max + 1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37116", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], s[15];\n  int i, j, max, l, num;\n  while (scanf(\"%s%s\", str, substr) + 1) {\n    max = 0;\n    l = strlen(str);\n    for (i = 0; i < l; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (j = 0; j <= num; j++) {\n      s[j] = str[j];\n    }\n    s[num + 1] = substr[0];\n    s[num + 2] = substr[1];\n    s[num + 3] = substr[2];\n    int n = num;\n    for (j = num + 4; j <= l + 3; j++) {\n      n++;\n      s[j] = str[n];\n    }\n    for (j = 0; j < l + 3; j++) {\n      printf(\"%c\", s[j]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37117", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int l1, max, l2, i, l;\n  char str[100], substr[100];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    max = 0;\n    for (i = 0; i < l1; i++)\n      if (str[i] > max) {\n        max = str[i];\n        l = i;\n      }\n    l2 = strlen(substr);\n    for (i = l1 - 1; i > l; i--)\n      str[i + l2] = str[i];\n    for (i = 0; i < l2; i++)\n      str[l + i + 1] = substr[i];\n    for (i = 0; i < l1 + l2; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37118", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s[301];\n  char ds[301];\n  int i, j, l, max;\n  while (scanf(\"%s\", &s) != EOF) {\n\n    l = strlen(s);\n    cin >> ds;\n    max = l - 1;\n    for (j = l - 1; j > 0; j = j - 1) {\n      if (s[j] >= s[max])\n        max = j;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", ds);\n    for (i = max + 1; i < l; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37119", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void sc(char *p[], char *q[]);\n  char *p[100], *q[100];\n  int i;\n  for (i = 0; i < 100; i++) {\n    p[i] = (char *)malloc(10);\n    q[i] = (char *)malloc(5);\n  }\n  sc(p, q);\n}\nvoid sc(char *p[], char *q[]) {\n  int n, m, j, max, x, i;\n  for (i = 0; scanf(\"%s %s\", p[i], q[i]) != EOF; i++) {\n    n = strlen(p[i]);\n    m = strlen(q[i]);\n    for (j = 1, max = *(p[i]); j < n; j++)\n      if (*(p[i] + j) > max) {\n        max = *(p[i] + j);\n        x = j;\n      }\n    for (j = n - x - 1; j >= 1; j--)\n      *(p[i] + x + j + m) = *(p[i] + x + j);\n    for (j = 0; j < m; j++) {\n      *(p[i] + x + j + 1) = *(q[i] + j);\n    }\n    for (j = 0; j < m + n; j++) {\n      printf(\"%c\", *(p[i] + j));\n      if (j == n + m - 1)\n        printf(\"\\n\");\n    }\n  }\n}\n"}
{"label": "20", "index": "37120", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    int i, pos = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > str[pos])\n        pos = i;\n    for (i = 0; i <= pos; i++)\n      cout << str[i];\n    printf(\"%s\", substr);\n    while (str[i])\n      cout << str[i++];\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37121", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int l = 0, i = 0;\n  char str[11] = {\"\"}, substr[3] = {\"\"}, str2[11] = {\"\"};\n  char *p;\n\nLOOP:\n  scanf(\"%s %s\", str, substr);\n  if (strcmp(str2, str) == 0)\n    goto END;\n  l = strlen(str);\n  p = str;\n  for (i = 0; i < l; i++) {\n    if (*p < str[i])\n      p = &str[i];\n    else\n      ;\n  }\n\n  for (i = 0; i < l; i++) {\n    printf(\"%c\", str[i]);\n    if (&str[i] == p)\n      printf(\"%s\", substr);\n  }\n  printf(\"\\n\");\n  strcpy(str2, str);\n  goto LOOP;\nEND:;\n}\n"}
{"label": "20", "index": "37122", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid dd(char a[], char b[]) {\n  int i, j = 0, m, max;\n  m = strlen(a);\n  max = a[0];\n  for (i = 0; i < m; i++) {\n    if (a[i] > max) {\n      max = a[i];\n      j = i;\n    }\n  }\n  for (i = m; i > j; i--) {\n    a[i + 3] = a[i];\n  }\n  a[j + 1] = b[0];\n  a[j + 2] = b[1];\n  a[j + 3] = b[2];\n  for (i = 0; i < m + 3; i++) {\n    printf(\"%c\", a[i]);\n  }\n  printf(\"\\n\");\n}\nint main() {\n  char a[20], b[5];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    dd(a, b);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37123", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, c[10] = {0};\n  char a[10][100] = {'\\0'}, b[10][3] = {'\\0'}, m;\n  for (i = 0;; i++)\n\n    if (EOF == scanf(\"%s %s\", a[i], b[i]))\n      break;\n  for (j = 0; j < i; j++) {\n    for (k = 0, m = a[j][0]; k < strlen(a[j]) - 1; k++) {\n      if (m < a[j][k + 1]) {\n        c[j] = k + 1;\n        m = a[j][k + 1];\n      }\n    }\n  }\n  for (j = 0; j < i; j++) {\n    for (k = strlen(a[j]) - 1; k > c[j]; k--)\n      a[j][k + 3] = a[j][k];\n    a[j][c[j] + 1] = b[j][0];\n    a[j][c[j] + 2] = b[j][1];\n    a[j][c[j] + 3] = b[j][2];\n  }\n  for (j = 0; j < i; j++)\n    printf(\"%s\\n\", a[j]);\n  return 0;\n}\n"}
{"label": "20", "index": "37124", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char a[], int j) {\n  int i, k;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (a[i] > a[j]) {\n      return (0);\n    }\n  }\n  return (1);\n}\nvoid cha(char a[], char b[]) {\n  int i, k, j;\n  k = strlen(a);\n  for (i = 0; i < k; i++) {\n    if (max(a, i) == 1) {\n      for (j = 0; j < i + 1; j++)\n        cout << a[j];\n      for (j = 0; j < 3; j++)\n        printf(\"%c\", b[j]);\n      for (j = i + 1; j < k; j++)\n        printf(\"%c\", a[j]);\n      printf(\"\\n\");\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][11], substr[100][4], d;\n  int n = 0, i;\n  do {\n    if (n) {\n      for (i = 1;; i++) {\n        if ((d = getchar()) != ' ')\n          str[n][i] = d;\n        else {\n          str[n][i] = '\\0';\n          break;\n        }\n      }\n    } else {\n      cin >> str[n];\n    }\n    scanf(\"%s\", substr[n]);\n    n++;\n    d = getchar();\n    str[n][0] = getchar();\n  } while (str[n][0] != EOF);\n  for (i = 0; i < n; i++) {\n    cha(str[i], substr[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37125", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11][13], substr[11][3];\n  int l[11], i, j, n = 0, max[11];\n  while (scanf(\"%s %s\", str[n], substr[n]) != EOF)\n    n++;\n  for (i = 0; i < n; i++)\n    l[i] = strlen(str[i]);\n  for (i = 0; i < n; i++) {\n    max[i] = 0;\n    for (j = 1; j < l[i]; j++) {\n      if (str[i][j] > str[i][max[i]])\n        max[i] = j;\n      else {\n        max[i] = max[i];\n      }\n    }\n  }\n  for (i = 0; i < n; i++) {\n    for (j = l[i] - 1; j >= max[i] + 1; j--) {\n      str[i][j + 3] = str[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    str[i][max[i] + 1] = substr[i][0];\n    str[i][max[i] + 2] = substr[i][1];\n    str[i][max[i] + 3] = substr[i][2];\n  }\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < l[i] + 2; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\"%c\\n\", str[i][l[i] + 2]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37126", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint f(char str[]) \n{\n  int i, a, n;\n  char nul = '0';\n  a = strlen(str);\n  for (i = 0; i < a - 4; i++) {\n    if (str[i] > nul) {\n      nul = str[i];\n      n = i;\n    }\n  }\n  return (n);\n}\nint main() {\n  int i = 0, n, j, a[100], length[100];\n  char str[100][50], str1[100][50];\n  do { \n\n    cin >> str[i];\n    length[i] = strlen(str[i]);\n    i++;\n  } while (length[i - 1] != 0);\n  n = i - 1;\n  for (i = 0; i < n; i++) {\n    a[i] = f(str[i]);\n    for (j = 0; j < 50; j++) {\n      if (j < a[i] + 1)\n        str1[i][j] = str[i][j];\n      else if (j > a[i] && j < a[i] + 4)\n        str1[i][j] = str[i][length[i] + j - 4 - a[i]];\n      else if (j > a[i] + 3 && j < length[i] - 1)\n        str1[i][j] = str[i][j - 3];\n      else if (j >= length[i] - 1)\n        str1[i][j] = '\u0000';\n    }\n  }\n  for (i = 0; i < n; i++)\n    printf(\"%s \", str1[i]);\n}\n"}
{"label": "20", "index": "37127", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, maxnum, max, n;\n  char *p1, str1[20], str2[20], strcopy[20], *p3;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    p1 = str1;\n    p3 = strcopy;\n    for (i = 0, max = 0; str1[i] != '\\0'; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        maxnum = i;\n      }\n    strcpy(strcopy, str1);\n    *(p3 + maxnum + 1) = '\\0';\n    strcat(strcopy, str2);\n    for (p1 = &str1[maxnum + 1], p3 = &strcopy[maxnum + 4]; *p1 != '\\0';\n         p1++, p3++)\n      *p3 = *p1;\n    n = strlen(str1);\n    strcopy[n + 3] = '\\0';\n    puts(strcopy);\n  }\n}\n"}
{"label": "20", "index": "37128", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4];\n  int i, j, m, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    m = strlen(str);\n    j = 0;\n    n = str[0];\n    for (i = 1; i < m; i++)\n      if (str[i] > n) {\n        j = i;\n        n = str[i];\n      }\n    for (i = 0; i <= j; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = j + 1; i < m; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37129", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char a[11], b[3], c[14];\n  for (j = 0; j < 10; j++) {\n    for (i = 0; i < 11; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 3; i++)\n      b[i] = '\\0';\n    for (i = 0; i < 14; i++)\n      c[i] = '\\0';\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    for (i = 0, n = 0; a[i] != '\\0'; i++)\n      if (a[i] > a[n])\n        n = i;\n    strncpy(c, a, n + 1);\n    c[n + 1] = b[0];\n    c[n + 2] = b[1];\n    c[n + 3] = b[2];\n    for (i = n + 1; a[i] != '\\0'; i++) {\n      c[i + 3] = a[i];\n    }\n    cout << c << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37130", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, j, k, n, x, y, z = 0;\n  char str[100][12], substr[100][5];\n  while (scanf(\"%s%s\", &str[i], &substr[i]) != EOF) {\n    n = strlen(str[i]);\n    for (j = 0; j < n; j++) {\n      z = 0;\n      for (k = 0; k < n; k++) {\n        if (str[i][j] >= str[i][k])\n          z++;\n      }\n      if (z == n)\n        break;\n    }\n    for (y = 0; y <= j; y++)\n      cout << str[i][y];\n    printf(\"%s\", substr[i]);\n    for (y = j + 1; y < n; y++)\n      printf(\"%c\", str[i][y]);\n    printf(\"\\n\");\n\n    i++;\n  }\n}\n"}
{"label": "20", "index": "37131", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int i, n, max = 0, num;\n    n = strlen(str);\n    char *p = str;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        num = i;\n      }\n    }\n    for (i = n + 2; i > num + 3; i--) {\n      *(p + i) = str[i - 3];\n    }\n    *(p + n + 3) = '\\0';\n    for (i = num + 3; i > num; i--) {\n      *(p + i) = substr[i - num - 1];\n    }\n    for (i = 0; i < n + 3; i++)\n      printf(\"%c\", *(p + i));\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37132", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int n, i, j, Asc, point;\n  char str[10], substr[3];\n  while (scanf(\"%s%s\", str, substr) == 2) {\n    point = 0;\n    Asc = 0;\n    for (i = 0; i <= strlen(str); i++)\n      if (str[i] > Asc) {\n        Asc = str[i];\n        point = i;\n      }\n    for (i = 0; i <= point; i++)\n      printf(\"%c\", str[i]);\n    for (j = 0; j < strlen(substr); j++)\n      printf(\"%c\", substr[j]);\n    for (i = point + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37133", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint find(char *str, int n) {\n  int max = *str, i, sign;\n  for (i = 0; i < n; i++)\n    if (*(str + i) > max)\n      max = *(str + i), sign = i;\n  return sign;\n}\nvoid insert(char *a, char *b, int k, int n) {\n  int i, j;\n  for (i = n; i > k; i--)\n    *(a + i + 3) = *(a + i);\n  for (j = 0; j < 3; j++)\n    a[++k] = b[j];\n}\nint main() {\n  char str[100], substr[10];\n  int n, sign;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    sign = find(str, n);\n    insert(str, substr, sign, n);\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "37134", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[5];\n  while (scanf(\"%s %s\", &str, &substr) != EOF) {\n    int k = 0, i = 0;\n    char *p, max;\n    for (p = str, max = str[0]; *p != '\\0'; p++, i++)\n      if (*p > max)\n        max = *p, k = i;\n    for (p = str; p <= (str + k); p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    if (k < strlen(str)) {\n      for (p = str + k + 1; *p != '\\0'; p++)\n        printf(\"%c\", *p);\n      printf(\"\\n\");\n    } else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37135", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid f(char a[], char b[3]) {\n  int t = 0, i, l;\n  for (i = 1;; i++) {\n    if (a[i] > a[t])\n      t = i;\n    if (a[i] == '\\0') {\n      l = i;\n      break;\n    }\n  }\n  for (i = l; i >= t + 1; i--) {\n    a[i + 3] = a[i];\n  }\n  a[l + 3] = '\\0';\n  for (i = t + 1; i <= t + 3; i++) {\n    a[i] = b[i - t - 1];\n  }\n  printf(\"%s\\n\", a);\n}\nint main() {\n  char a[100][11] = {0}, b[3], i = 0;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%s %s\", a[i], b);\n    f(a[i], b);\n    if (a[i][0] == '\\n')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37136", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], substr[3], s[13];\n  char *p, *m, *n, *q;\n  char max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (m = str, max = *m; *m != '\\0'; m++)\n      if (*m > max)\n        max = *m;\n    for (m = str; *m != '\\0'; m++)\n      if (*m == max) {\n        q = m;\n        break;\n      }\n    for (p = s, m = str; m <= q; p++, m++)\n      *p = *m;\n    for (n = substr; *n != '\\0'; n++, p++)\n      *p = *n;\n    for (m = q + 1; *m != '\\0'; m++, p++)\n      *p = *m;\n    *p = '\\0';\n    p = s;\n    cout << p << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37137", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[14], a[4], max = 0;\n  int n, i, k, j;\n  while (scanf(\"%s %s\", s, a) != EOF) {\n    k - 0;\n    j = 0;\n    max = 0;\n    n = strlen(s);\n    for (i = 0; i < n; i++) {\n      if (s[i] > max) {\n        k = i;\n        max = s[i];\n      }\n    }\n\n    for (i = n - 1; i > k; i--) {\n      s[i + 3] = s[i];\n    }\n\n    while (j <= 2) {\n      s[k + j + 1] = a[j];\n      j++;\n    }\n    s[n + 3] = '\\0';\n    puts(s);\n  }\n}\n"}
{"label": "20", "index": "37138", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], strsub[4], str2[14], c, fd;\n  int k, i, j, max, maxnum;\n  while (scanf(\"%s %s\", str, strsub) != EOF) {\n    max = 0;\n    for (j = 0;; j++) {\n      if (str[j] == '\\0')\n        break;\n      if (str[j] > max) {\n        max = str[j];\n        maxnum = j;\n      }\n    }\n    for (i = 0; i <= maxnum; i++)\n      str2[i] = str[i];\n    str2[maxnum + 1] = '\\0';\n    strcat(str2, strsub);\n    for (i = maxnum + 4;; i++) {\n      if (str[i - 3] == '\\0')\n        break;\n      str2[i] = str[i - 3];\n    }\n    str2[i] = '\\0';\n    puts(str2);\n  }\n}\n"}
{"label": "20", "index": "37139", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, max, t;\n  char str1[100], str2[5], *p1, *p2, *p0;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    n = strlen(str1);\n    p1 = str1;\n    max = 0;\n    for (; p1 < str1 + n; p1++)\n      if (*p1 > max) {\n        max = *p1;\n        p0 = p1;\n      }\n    p2 = str2;\n    p1 = str1;\n    t = 1;\n    for (; p1 < str1 + n; p1++) {\n      printf(\"%c\", *p1);\n      if (*p1 == max && t) {\n        cout << *p2 << *(p2 + 1) << *(p2 + 2);\n        t = 0;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37140", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint findmax(char *str) {\n  int i, max = *str, ret = 0;\n  for (i = 0; *(str + i); i++)\n    if (*(str + i) > max) {\n      max = *(str + i);\n      ret = i;\n    }\n  return ret;\n}\n\nvoid insert(char *str, char *substr, int index) {\n  int i;\n  char *p;\n  for (p = str + strlen(str); p > str + index; p--)\n    *(p + strlen(substr)) = *p;\n  for (i = 0; i < strlen(substr); i++)\n    *(str + index + 1 + i) = *(substr + i);\n}\n\nint main() {\n  int k;\n  char *str, *substr;\n  str = (char *)malloc(11 * sizeof(char));\n  substr = (char *)malloc(3 * sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = findmax(str);\n    insert(str, substr, k);\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37141", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint max_number(char *q, int n) {\n  int j, m = 1, t = *q;\n  for (j = 1; j < n; j++) {\n    if (t < *(q + j)) {\n      t = *(q + j);\n      m = j + 1;\n    }\n  }\n  return m;\n}\n\nint main() {\n  int i, n, m;\n  char str[14], substr[4], *p[2] = {str, substr};\n  while (scanf(\"%s%s\", p[0], p[1]) != EOF) {\n    n = strlen(p[0]);\n    m = max_number(p[0], n);\n\n    for (i = n - m; i > 0; i--)\n      *(p[0] + m + i + 2) = *(p[0] + m + i - 1);\n    *(p[0] + n + 3) = '\\0';\n    for (i = 0; i < 3; i++)\n      *(p[0] + m + i) = *(p[1] + i);\n    puts(str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37142", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid str(char a[10], char b[3]) \n{\n  int i, l, c = a[0], k;\n  l = strlen(a);\n  for (i = 1; i < l; i++)\n    if (c < a[i]) {\n      c = a[i];\n      k = i;\n    }\n  for (i = 0; i < k + 1; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", b[i]);\n  for (i = k + 1; i < l; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n}\nint main() {\n  char a[10], b[3];\n  while (scanf(\"%s%s\", a, b) != EOF)\n    str(a, b);\n}\n"}
{"label": "20", "index": "37143", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[50][10] = {0}, substr[50][3] = {0}, a[50][13] = {0}, max[50] = {0},\n       c[50][14] = {0};\n  int len[50], i, n, j, num[50], k, cl[50];\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    cl[i] = strlen(c[i]);\n    if (cl[i] == 0) {\n      break;\n    }\n    for (j = 0; j < cl[i]; j++) {\n      if (c[i][j] != ' ') {\n        str[i][j] = c[i][j];\n      } else {\n        k = j;\n        break;\n      }\n    }\n    for (j = k + 1; j < cl[i]; j++) {\n      substr[i][j - k - 1] = c[i][j];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(str[i]);\n    for (j = 0, max[i] = str[i][0]; j < len[i]; j++) {\n      if (str[i][j] > max[i]) {\n        max[i] = str[i][j];\n        num[i] = j;\n      }\n    }\n    for (j = 0; j < (len[i] + 3); j++) {\n      k = j - num[i] - 1;\n      if (j <= num[i]) {\n        a[i][j] = str[i][j];\n      } else {\n        if (j <= (num[i] + 3)) {\n          a[i][j] = substr[i][k];\n        } else {\n          a[i][j] = str[i][j - 3];\n        }\n      }\n    }\n    printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "20", "index": "37144", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, L, zhi, j, k;\n  char str[15], substr[4], c;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    L = strlen(str);\n    c = str[0];\n    zhi = 0;\n    for (i = 1; i < L; i++) {\n      if (c < str[i]) {\n        c = str[i];\n        zhi = i;\n      }\n    }\n    for (j = 0; j <= zhi; j++)\n      printf(\"%c\", str[j]);\n\n    printf(\"%s\", substr);\n    for (k = zhi + 1; k < L; k++) {\n      printf(\"%c\", str[k]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37145", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[13], s2[5];\n  int i, j, m, a;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    a = 0;\n    m = strlen(s1);\n    for (i = 0; i < m; i++) {\n      if (s1[i] > s1[a])\n        a = i;\n    }\n    for (i = m - 1; i > a; i--)\n      s1[i + 3] = s1[i];\n    for (i = a + 1, j = 0; i < a + 1 + 3; i++, j++)\n      s1[i] = s2[j];\n    for (i = 0; i < m + 3; i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37146", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, l, max;\n  char str[15], substr[3];\n  while (scanf(\"%s%s\", str, substr) != EOF) \n  {\n    l = strlen(str);\n    max = 0;\n    for (i = 0; i < l; i++) {\n      if (str[max] < str[i])\n        max = i;\n    }\n    for (j = l - 1; j > max; j--)\n      str[j + 3] = str[j];\n    for (j = max + 1; j < max + 4; j++)\n      str[j] = substr[j - max - 1];\n    for (j = 0; j < l + 3; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37147", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[15], p = '\u0000';\n  int i, len, max;\n  while (cin >> s) {\n    len = strlen(s) - 4;\n    for (i = 0; i < len; i++)\n      if (*(s + i) > p) {\n        p = *(s + i);\n        max = i;\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", *(s + i));\n    for (i = len + 1; i <= len + 3; i++)\n      printf(\"%c\", *(s + i));\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", *(s + i));\n    p = '\u0000';\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37148", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid start() {\n  int i, lenstr, lensub;\n  char str[11], substr[4], max, t;\n\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    lenstr = strlen(str);\n    lensub = strlen(substr);\n    max = str[0];\n    for (i = 1; i < lenstr; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        t = i;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < lensub; i++) {\n      printf(\"%c\", substr[i]);\n    }\n    for (i = t + 1; i < lenstr; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    start();\n  }\n}\nint main() { start(); }\n"}
{"label": "20", "index": "37149", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nvoid in(char str[13], char substr[3]) {\n  int i, j, k, r;\n  for (i = 0; i <= 9; i++) {\n    r = 1;\n    for (j = i; j <= 9; j++) {\n      if (str[i] < str[j]) {\n        r = 0;\n        break;\n      }\n    }\n    if (r == 1) {\n      for (k = 12; k >= i + 4; k--) {\n        str[k] = str[k - 3];\n      }\n      str[i + 1] = substr[0];\n      str[i + 2] = substr[1];\n      str[i + 3] = substr[2];\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][13] = {0};\n  char substr[100][3] = {0};\n  int i, n;\n  char c;\n  for (n = 0;; n++) {\n    if ((c = getchar()) == EOF)\n      break;\n    else {\n      str[n][0] = c;\n      cin >> str[n][1] >> substr[n];\n    }\n    in(str[n], substr[n]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n\n    printf(\"%s\\n\", str[i]);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37150", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n    char ansstr[14] = {'\\0'};\n    char cmax = 0;\n    int point = 0;\n    cin >> str;\n    cin >> substr;\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      cout << str[i];\n    \n    \n    \n    cout << substr;\n    for (int j = point + 1; j < length; j++)\n      cout << str[j];\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37151", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char s1[100][11];\n  char s2[100][4];\n  int i, j, m, k, p;\n  scanf(\"%s%s\", s1[0], s2[0]);\n  m = 0;\n  p = 0;\n  do {\n    m = 0;\n    for (k = 0; k < strlen(s1[p]); k++) {\n\n      if (s1[p][k] > s1[p][m]) {\n        m = k;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      cout << s1[p][i];\n    }\n    printf(\"%s\", s2[p]);\n    for (j = m + 1; j < strlen(s1[p]); j++) {\n      printf(\"%c\", s1[p][j]);\n    }\n    printf(\"\\n\");\n    p++;\n  } while (scanf(\"%s%s\", s1[p], s2[p]) != EOF);\n}\n"}
{"label": "20", "index": "37152", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000][11] = {{0}}, substr[1000][4] = {{0}}, a[11] = {0}, b[4] = {0};\n  int i = 0, j, k, maxpos;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    for (j = 0; j <= strlen(a); j++) {\n      str[i][j] = a[j];\n    }\n    for (j = 0; j <= strlen(b); j++)\n      substr[i][j] = b[j];\n\n    i++;\n  }\n  for (j = 0; j <= i - 1; j++) {\n    maxpos = strlen(str[j]) - 1;\n    for (k = strlen(str[j]) - 1; k >= 0; k--) {\n      if (str[j][k] >= str[j][maxpos]) {\n        maxpos = k;\n      }\n    }\n    for (k = 0; k <= maxpos; k++) {\n      putchar(str[j][k]);\n    }\n    for (k = 0; k <= 2; k++) {\n      putchar(substr[j][k]);\n    }\n    for (k = maxpos + 1; k <= strlen(str[j]) - 1; k++) {\n      putchar(str[j][k]);\n    }\n    putchar('\\n');\n  }\n\n  return 0;\n}\n"}
{"label": "20", "index": "37153", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char a[100][100], b[100][100];\n  int n = 0;\n\n  while (scanf(\"%s%s\", a[n], b[n]) != EOF) {\n    n++;\n  }\n\n  int i, j, k, mark;\n  char c = '\\0';\n\n  for (i = 0; i < n; i++) {\n    c = '\\0';\n    for (j = 0; a[i][j] != '\\0'; j++) {\n      if (a[i][j] > c) {\n        c = a[i][j];\n        mark = j;\n      }\n    }\n    for (k = 0; k <= mark; k++)\n      printf(\"%c\", a[i][k]);\n\n    printf(\"%s\", b[i]);\n    for (k = mark + 1; a[i][k] != '\\0'; k++) {\n      printf(\"%c\", a[i][k]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37154", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char word[20], in[4];\n\n  char *p, *q;\n  while (scanf(\"%s %s \", word, in)) {\n    p = word;\n    q = word;\n    while (1) {\n      if (*p == '\\0')\n        break;\n      if (*p - *q > 0)\n        q = p;\n      p++;\n    }\n    p = word;\n    while (1) {\n      if (*p == '\\0') {\n        cout << endl;\n        break;\n      }\n      cout << *p;\n      if (p == q)\n        cout << in[0] << in[1] << in[2];\n      p++;\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37155", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15], sub[4], m;\n  int t, i, len;\n  while (scanf(\"%s %s\", str, sub) != EOF) {\n    t = 0;\n    m = str[0];\n    len = 0;\n    for (i = 0; str[i] != '\\0'; i++)\n      len++;\n\n    for (i = 1; i < len; i++)\n      if (str[i] > m) {\n        t = i;\n        m = str[i];\n      }\n    for (i = len - 1; i > t; i--)\n      str[i + 3] = str[i];\n    str[t + 1] = sub[0];\n    str[t + 2] = sub[1];\n    str[t + 3] = sub[2];\n    str[len + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37156", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11] = {0}, substr[4], str1[10][14] = {0};\n  int i, k, j, m = 0;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    for (i = 1; i < strlen(str); i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = strlen(str) + 2; i > k + 3; i--)\n      str1[m][i] = str[i - 3];\n    for (i = 0; i <= k; i++)\n      str1[m][i] = str[i];\n    j = 0;\n    for (i = k + 1; i < k + 4; i++, j++)\n      str1[m][i] = substr[j];\n    m++;\n  }\n  for (i = 0; i < m; i++)\n    printf(\"%s\\n\", str1[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "37157", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i, asc, n = 0;\n  char str[11], substr[4], *p;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    asc = *p;\n    for (i = 0; i < strlen(str); i++, p++) {\n      if (*p > asc) {\n        asc = *p;\n        n = i;\n      }\n    }\n    p = str;\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = n + 1; i < strlen(str); i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37158", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint pan(char s[], int n) {\n  int i = 0, t, max, m;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      t = i;\n      break;\n    }\n  }\n  for (i = t - 1, max = s[t - 1]; i >= 0; i--) {\n    if (s[i] >= max) {\n      max = s[i];\n      m = i;\n    }\n  }\n  return (m);\n}\n\nint kong(char s[], int n) {\n  int i, t;\n  for (i = 0; i < n; i++) {\n    if (s[i] == ' ') {\n      t = i;\n      break;\n    }\n  }\n  return (t);\n}\n\nint main() {\n  char s[1000][20];\n  int i, j, t, m;\n  for (i = 0;; i++) {\n\n    cin >> s[i];\n    if (s[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0;; i++) {\n    if (s[i][0] == '\u0000')\n      break;\n    else {\n      t = pan(s[i], strlen(s[i]));\n      for (j = 0; j <= t; j++) {\n        printf(\"%c\", s[i][j]);\n      }\n      m = strlen(s[i]);\n      printf(\"%c%c%c\", s[i][m - 3], s[i][m - 2], s[i][m - 1]);\n      for (j = t + 1; j < kong(s[i], m); j++) {\n        printf(\"%c\", s[i][j]);\n      }\n      printf(\" \");\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37159", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4], max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n\n    int i, t, m;\n    m = strlen(str);\n    max = str[0];\n    t = 0;\n    for (i = 0; i <= m - 2; i++) {\n      if (str[i + 1] > max) {\n        max = str[i + 1];\n        t = i + 1;\n      }\n    }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n\n    printf(\"%s\", substr);\n    for (i = t + 1; i <= m - 2; i++) {\n      cout << str[i];\n    }\n    printf(\"%c\\n\", str[m - 1]);\n  }\n}\n"}
{"label": "20", "index": "37160", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[30][10];\n  char substr[30][3];\n  char ans[30][13];\n  char max;\n  char *a, *b, *c, *d;\n  int i, j, k, l, m, n;\n  for (i = 0; i < 30; i++) {\n    if (scanf(\"%s%s\", str[i], substr[i]) == EOF)\n      break;\n    l = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < l; j++)\n      if (max < str[i][j])\n        max = str[i][j];\n    for (j = 0; j < l; j++)\n      if (max == str[i][j])\n        break;\n    a = &str[i][0];\n    b = &substr[i][0];\n    c = &str[i][j + 1];\n    for (k = 0; k < j + 1; k++)\n      ans[i][k] = *(a + k);\n    for (m = 0; m < 3; k++, m++)\n      ans[i][k] = *(m + b);\n    for (n = 0; j + 1 + n < l; n++, k++)\n      ans[i][k] = *(c + n);\n    ans[i][k] = '\\0';\n  }\n  for (j = 0; j < i; j++) {\n    l = strlen(ans[j]);\n    for (k = 0; k < l - 1; k++) {\n      d = ans[j];\n      printf(\"%c\", *(d + k));\n    }\n    printf(\"%c\\n\", *(d + k));\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37161", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], c[15];\n  int i, m, n;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    m = 0;\n    for (i = 1; i < n; i++) {\n      if (a[i] > a[m]) {\n        m = i;\n      }\n    }\n    for (i = 0; i <= m; i++) {\n      c[i] = a[i];\n    }\n    c[m + 1] = b[0];\n    c[m + 2] = b[1];\n    c[m + 3] = b[2];\n    for (i = m + 1; i < n; i++) {\n      c[3 + i] = a[i];\n    }\n    c[3 + n] = '\u0000';\n    printf(\"%s \", c);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37162", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15] = {0};\n  char substr[3] = {0};\n  char string[500][15] = {0};\n  char max;\n  int i, x, d, j;\n  j = 0;\n\n  while (1) {\n\n    cin >> str;\n\n    d = strlen(str);\n    if (d == 0)\n      break;\n    for (i = 0; i < d; i++)\n      if (str[i] == ' ')\n        break;\n    for (x = i + 1; x <= i + 4; x++)\n      substr[x - i - 1] = str[x];\n    str[i] = '\u0000';\n    d = d - 3;\n    max = str[0];\n    x = 0;\n    for (i = 0; str[i] != '\u0000'; i++)\n      if (str[i] > max) {\n        max = str[i];\n        x = i;\n      }\n    for (i = d - 1; i > x; i--)\n      str[i + 3] = str[i];\n    for (i = x + 1; i < x + 4; i++)\n      str[i] = substr[i - x - 1];\n    strcpy(string[j], str);\n    string[j][d + 3] = '\u0000';\n    j = j + 1;\n    for (i = 0; i < 13; i++) {\n      str[i] = 0;\n      substr[i] = 0;\n    }\n  }\n  d = j;\n  for (i = j; i < 500; i++)\n    string[i][0] = '\u0000';\n  for (i = 0; i < d; i++)\n    cout << string[i] << \" \";\n}\n"}
{"label": "20", "index": "37163", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid insert(char a[20], char b[10]) {\n  int max, i, index;\n  char *p;\n  char ans[20];\n  p = a;\n  max = 0;\n  for (i = 1; *(p + i); i++)\n    if (*(p + i) > max)\n      max = *(p + i), index = i;\n  strcpy(ans, \"\");\n  strncat(ans, a, index + 1);\n  strcat(ans, b);\n  strcat(ans, a + index + 1);\n  printf(\"%s\\n\", ans);\n}\nint main() {\n  char str[20], substr[10];\n  while (scanf(\"%s %s\\n\", str, substr) != EOF) {\n    insert(str, substr);\n  }\n}\n"}
{"label": "20", "index": "37164", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar *findmax(char *p) {\n  char *max;\n  for (max = p; *p != '\\0'; p++)\n    if (*p > *max)\n      max = p;\n  return max;\n}\n\nvoid insert(char *op, char *sp) {\n  char *np;\n  np = (char *)malloc(1000);\n  char *t = np;\n  char *temp;\n  char *temp2;\n  \n  for (temp = op; *temp != *findmax(op); temp++, np++)\n    *np = *temp;\n  temp2 = temp;\n  *np = *temp;\n  np++;\n\n  for (temp = sp; *sp != '\\0'; np++, sp++)\n    *np = *sp;\n\n  for (temp = temp2 + 1; *temp != '\\0'; np++, temp++)\n    *np = *temp;\n\n  *np = '\\0';\n  while (*t != '\\0') {\n    printf(\"%c\", *t);\n    t++;\n  }\n  \n  printf(\"\\n\");\n}\n\nint main() {\n  char ori[10], sub[3], newstr[13];\n  char *orip = ori, *subp = sub, *newstrp = newstr;\n  while (scanf(\"%s %s\", ori, sub) != EOF) {\n\n    insert(orip, subp);\n    \n  }\n}\n"}
{"label": "20", "index": "37165", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n = 0, i, j, k, b, a;\n  char max;\n  char str[100][10];\n  char substr[100][3];\n  while ((scanf(\"%s %s\", str[n], substr[n])) != EOF) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    k = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < k; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        b = j;\n      }\n    }\n    for (a = 0; a <= b; a++) {\n      printf(\"%c\", str[i][a]);\n    }\n    for (a = 0; a < 3; a++) {\n      printf(\"%c\", substr[i][a]);\n    }\n    for (a = b + 1; a < k; a++) {\n      printf(\"%c\", str[i][a]);\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37166", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char a[100][100], b[100][100], s[100][100];\n  int i = 0, j = 0, k, n, lon[100];\n  scanf(\"%s \", s);\n  lon[0] = strlen(s[0]);\n  n = 1;\n  for (i = 1; s[i - 1][0] != '\u0000'; i++) {\n\n    cin >> s[i];\n    lon[i] = strlen(s[i]);\n    n++;\n  }\n  n--;\n  for (i = 0; i < n; i++) {\n    k = 0;\n    for (j = 1; s[i][j] != 32; j++) {\n\n      if (s[i][j] > s[i][k])\n        k = j;\n    }\n    for (j = 0; j <= k; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = lon[i] - 3; j < lon[i]; j++)\n      printf(\"%c\", s[i][j]);\n    for (j = k + 1; s[i][j] != 32; j++)\n      printf(\"%c\", s[i][j]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37167", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], strc[13], substr[3], max, num;\n  int i, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++) {\n      strc[i] = str[i];\n    }\n    for (i = num + 1; i <= num + 3; i++) {\n      strc[i] = substr[i - num - 1];\n    }\n    for (i = num + 4; i < n + 3; i++) {\n      strc[i] = str[i - 3];\n    }\n    strc[n + 3] = '\\0';\n    printf(\"%s\\n\", strc);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37168", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  int n, max, m, i;\n  char str1[11], str2[4], c, s[] = \"\";\n  scanf(\"%s\", str1);\n  scanf(\"%s\", str2);\n  c = getchar();\n  n = strlen(str1);\n  while (c != '\u0000' && n != 0) {\n    max = 0;\n    m = 0;\n    for (i = 0; i < n; i++)\n      if (str1[i] > max) {\n        max = str1[i];\n        m = i;\n      }\n    for (i = 0; i <= m; i++)\n      printf(\"%c\", str1[i]);\n    printf(\"%s\", str2);\n    for (i = m + 1; i < n; i++)\n      printf(\"%c\", str1[i]);\n    printf(\" \");\n    strcpy(str1, s);\n    cin >> str1;\n    scanf(\"%s\", str2);\n    c = getchar();\n    n = strlen(str1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37169", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int f[300][300];\n  char s1[300], s2[300];\n  int l1, max, p, i;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    l1 = strlen(s1);\n    max = 0;\n    p = 0;\n    for (i = 0; i < l1; i++)\n      if (s1[i] > max) {\n        max = s1[i];\n        p = i;\n      }\n    for (i = 0; i < l1; i++) {\n      cout << s1[i];\n      if (p == i)\n        cout << s2;\n    }\n\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37170", "code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid in(char str[13], char substr[3]) {\n  int i, j, k, r;\n  for (i = 0; i <= 9; i++) {\n    r = 1;\n    for (j = i; j <= 9; j++) {\n      if (str[i] < str[j]) {\n        r = 0;\n        break;\n      }\n    }\n    if (r == 1) {\n      for (k = 12; k >= i + 4; k--) {\n        str[k] = str[k - 3];\n      }\n      str[i + 1] = substr[0];\n      str[i + 2] = substr[1];\n      str[i + 3] = substr[2];\n      break;\n    }\n  }\n}\nint main() {\n  char str[100][13] = {0};\n  char substr[100][3] = {0};\n  int i, n;\n  char c;\n  for (n = 0;; n++) {\n    if ((c = getchar()) == EOF) {\n      break;\n    } else {\n      str[n][0] = c;\n      scanf(\"%s %s\", &str[n][1], substr[n]);\n    }\n    in(str[n], substr[n]);\n  }\n  for (i = 0; i <= n - 1; i++) {\n\n    printf(\"%s\\n\", str[i]);\n  }\n}\n"}
{"label": "20", "index": "37171", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][10], substr[100][3], s, str1[100][30] = {0},\n                                        str2[100][10] = {0};\n  int j, i = 0, n, b, c;\n  while (scanf(\"%s %s\", str[i], substr[i]) != EOF) {\n    n = strlen(str[i]);\n    s = str[i][0];\n    for (j = 1; j < n; j++) {\n      if (str[i][j] > s) {\n        s = str[i][j];\n        b = j;\n      }\n    }\n    for (c = 0, j = 0; c <= b; c++, j++)\n      str1[i][c] = str[i][j];\n    for (c = 0, j = b + 1; j < n; c++, j++)\n      str2[i][c] = str[i][j];\n    strcat(str1[i], substr[i]);\n    strcat(str1[i], str2[i]);\n    cout << str1[i] << \"\\n\";\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37172", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n    char ansstr[14] = {'\\0'};\n    char cmax = 0;\n    int point = 0;\n    scanf(\"%s \", str);\n    scanf(\"%s \", substr);\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      ansstr[i] = str[i];\n    for (int i = point + 1; i < point + 4; i++)\n      ansstr[i] = substr[i - point - 1];\n    for (int i = point + 4, j = point + 1; i < length + 3, j < length; i++, j++)\n      ansstr[i] = str[j];\n    cout << ansstr << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37173", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j, i, max = 0;\n  char str[11] = {0}, substr[4] = {0}, s[20] = {0}, *p;\n\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    j = 0;\n    p = &str[0];\n    for (i = 0; str[i] != 0; i++)\n      if (str[i] > max) {\n        max = str[i];\n        p = &str[i];\n        j = i;\n      }\n    strncat(s, str, j + 1);\n    strcat(s, substr);\n    strcat(s, p + 1);\n    printf(\"%s\\n\", s);\n    strcpy(s, \"\");\n    strcpy(str, \"\");\n    strcpy(substr, \"\");\n  }\n}\n"}
{"label": "20", "index": "37174", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[5], max;\n  int a, b, i, flag;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    a = strlen(str);\n    b = strlen(substr);\n    for (i = 0; i < a; i++) {\n      if (str[i] > max)\n        max = str[i];\n    }\n    flag = 1;\n    for (i = 0; i < a; i++) {\n      if (str[i] < max) {\n        printf(\"%c\", str[i]);\n      } else {\n        printf(\"%c\", max);\n        if (flag == 1) {\n          printf(\"%s\", substr);\n        }\n        flag = 0;\n      }\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37175", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], *p1 = str, *p2 = substr;\n  int i = 0, max = 0;\n  char maxchar;\n  while (cin >> str) {\n    cin >> substr;\n    maxchar = str[0];\n    p1 = &str[0];\n    for (i = 0; *(p1 + i) != '\\0'; i++) {\n      if (*(p1 + i) > maxchar) {\n        maxchar = *(p1 + i);\n        max = i;\n      }\n    }\n    for (p1 = &str[0]; p1 <= &str[0] + max; p1++)\n\n      cout << *p1;\n\n    cout << p2;\n    for (p1 = &str[0] + max + 1; *p1 != '\\0'; p1++) {\n      cout << *p1;\n    }\n\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37176", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(void) {\n  char a[1000], b[1000];\n  int maxi, i;\n  char max;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    max = a[0];\n    maxi = 0;\n    for (i = 1; i < strlen(a); i++)\n      if (a[i] > max) {\n        maxi = i;\n        max = a[i];\n      }\n\n    for (i = 0; i <= maxi; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    for (i = maxi + 1; i < strlen(a); i++)\n      printf(\"%c\", a[i]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37177", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[20], substr[10], max;\n  int i, n, j, max_index;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    char *p;\n    p = &str[0];\n    max = *p;\n    for (i = 0; i < n; i++) {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        max_index = i;\n      }\n    }\n    for (i = 0; i <= max_index; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = max_index + 1; i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37178", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10] = {0}, substr[5] = {0};\n  while (scanf(\"%s\", str) != EOF) {\n    scanf(\"%s\", substr);\n    int i, k, u;\n    for (u = 0; u <= 9; u++) {\n      if (!str[u])\n        break;\n    }\n    k = 0;\n    for (i = 1; i <= u - 1; i++) {\n      if (str[k] < str[i])\n        k = i;\n    }\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", substr[i]);\n    for (i = k + 1; i <= u - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37179", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s1[10], s2[30];\n  int i, j, len, max;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    max = 0;\n    char s3[30] = {'\\0'};\n    len = strlen(s1);\n    for (i = 0; i < len; i++) {\n      if (s1[i] > max) {\n        j = i, max = s1[i];\n      }\n    }\n    for (i = j + 1; i < len; i++) {\n      s3[i - j - 1] = s1[i], s1[i] = '\\0';\n    }\n    strcat(s1, s2);\n    strcat(s1, s3);\n    printf(\"%s\\n\", s1);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37180", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[50][10] = {0}, substr[50][3] = {0}, a[50][13] = {0}, max[50] = {0},\n       c[50][14] = {0};\n  int len[50], i, n, j, num[50], k, cl[50];\n  for (i = 0;; i++) {\n\n    cin >> c[i];\n    cl[i] = strlen(c[i]);\n    if (cl[i] == 0)\n      break;\n    for (j = 0; j < cl[i]; j++) {\n      if (c[i][j] != ' ') {\n        str[i][j] = c[i][j];\n      } else {\n        k = j;\n        break;\n      }\n    }\n    for (j = k + 1; j < cl[i]; j++) {\n      substr[i][j - k - 1] = c[i][j];\n    }\n  }\n  n = i;\n  for (i = 0; i < n; i++) {\n    len[i] = strlen(str[i]);\n    for (j = 0, max[i] = str[i][0]; j < len[i]; j++) {\n      if (str[i][j] > max[i]) {\n        max[i] = str[i][j];\n        num[i] = j;\n      }\n    }\n    for (j = 0; j < (len[i] + 3); j++) {\n      k = j - num[i] - 1;\n      if (j <= num[i]) {\n        a[i][j] = str[i][j];\n      } else {\n        if (j <= (num[i] + 3)) {\n          a[i][j] = substr[i][k];\n        } else {\n          a[i][j] = str[i][j - 3];\n        }\n      }\n    }\n    printf(\"%s \", a[i]);\n  }\n}\n"}
{"label": "20", "index": "37181", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0;\n  char max = 0;\n  char str[14], substr[4];\n  char *p = str, *q = str;\n  while (cin >> str >> substr) {\n    i = 0;\n    max = *p;\n    while (*(p + i) != '\\0') {\n      if (*(p + i) > max) {\n        max = *(p + i);\n        q = p + i;\n      }\n      i++;\n    }\n    for (i = 11 - (q - p + 1); i >= 1; i--) {\n      *(q + i + 3) = *(q + i);\n    }\n    for (i = 1; i <= 3; i++) {\n      *(q + i) = substr[i - 1];\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37182", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, max_index;\n  char str1[20], str2[10], ans[20], t[20];\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    max = 0;\n    for (i = 0; str1[i]; i++) {\n      if (str1[i] > max) {\n        max = str1[i];\n        max_index = i;\n      }\n    }\n    strcpy(ans, \"\");\n    strncat(ans, str1, max_index + 1);\n    strcat(ans, str2);\n    for (i = max_index + 1; str1[i]; i++) {\n      t[i - max_index - 1] = str1[i];\n    }\n\n    t[i - max_index - 1] = '\\0';\n    strcat(ans, t);\n\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37183", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n, mark;\n  char s1[11], s2[4];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1);\n    for (i = 0; i < n; i++) {\n      for (j = 0, mark = 1; j < n; j++) {\n        if (s1[i] < s1[j]) {\n          mark = 0;\n          break;\n        }\n      }\n      if (mark) {\n        for (j = 0; j <= i; j++)\n          printf(\"%c\", s1[j]);\n        printf(\"%s\", s2);\n        for (j = i + 1; j < n; j++)\n          printf(\"%c\", s1[j]);\n        printf(\"\\n\");\n        break;\n      }\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37184", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, n;\n  char a[11], b[3], c[14];\n  for (j = 0; j < 10; j++) {\n    for (i = 0; i < 11; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 3; i++)\n      b[i] = '\\0';\n    for (i = 0; i < 14; i++)\n      c[i] = '\\0';\n    scanf(\"%s\", a);\n    scanf(\"%s\", b);\n    for (i = 0, n = 0; a[i] != '\\0'; i++)\n      if (a[i] > a[n])\n        n = i;\n    strncpy(c, a, n + 1);\n    c[n + 1] = b[0];\n    c[n + 2] = b[1];\n    c[n + 3] = b[2];\n    for (i = n + 1; a[i] != '\\0'; i++)\n      c[i + 3] = a[i];\n    printf(\"%s\\n\", c);\n  }\n}\n"}
{"label": "20", "index": "37185", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int n, max, t;\n  char str1[100], str2[5], *p1, *p2, *p0;\n  while (scanf(\"%s %s\", str1, str2) != EOF) {\n    n = strlen(str1);\n    p1 = str1;\n    max = 0;\n    for (; p1 < str1 + n; p1++)\n      if (*p1 > max) {\n        max = *p1;\n        p0 = p1;\n      }\n    p2 = str2;\n    p1 = str1;\n    t = 1;\n    for (; p1 < str1 + n; p1++) {\n      printf(\"%c\", *p1);\n      if (*p1 == max && t) {\n        printf(\"%c%c%c\", *p2, *(p2 + 1), *(p2 + 2));\n        t = 0;\n      }\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37186", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int index, i;\n  char str[11], substr[4], w[14], max;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = str[0];\n    index = 0;\n    for (i = 0; i <= strlen(str); i++) {\n      if (str[i] > max) {\n        index = i;\n        max = str[i];\n      }\n    }\n    w[0] = '\\0';\n    strncat(w, str, index + 1);\n    strcat(w, substr);\n    strcat(w, str + index + 1);\n    cout << w << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37187", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[30], substr[4], max;\n  int i, len, num;\n  scanf(\"%s%s\", str, substr);\n  while (str[0] != '0') {\n    len = strlen(str);\n    for (i = 0, max = str[0]; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < len; i++)\n      if (str[i] == max) {\n        num = i;\n        break;\n      }\n    for (i = 0; i < num + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = num + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      str[i] = '0';\n    for (i = 0; i < 3; i++)\n      substr[i] = '0';\n    cin >> str >> substr;\n  }\n}\n"}
{"label": "20", "index": "37188", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i = 0, k[100], j, a[100];\n  char str[100][50], max;\n  do {\n    cin >> str[i];\n    a[i] = strlen(str[i]);\n    i++;\n  } while (str[i - 1][0] != '\u0000');\n\n  for (i = 0; str[i][0] != '\u0000'; i++) {\n    max = str[i][0];\n    for (j = 0; j < a[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k[i] = j;\n      }\n    }\n  }\n  for (i = 0; str[i][0] != '\u0000'; i++)\n\n  {\n    for (j = 0; j <= k[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = a[i] - 3; j < a[i]; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = k[i] + 1; j < a[i] - 4; j++)\n      cout << str[i][j];\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37189", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100][10], substr[100][3];\n  int m, k, n = 0, i, j;\n  char max;\n\n  while (scanf(\"%s %s\", str[n], substr[n]) != EOF) {\n    n++;\n  }\n  for (i = 0; i < n; i++) {\n    m = strlen(str[i]);\n    j = 0;\n    max = str[i][j];\n    for (j = 1; j < m; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        k = j;\n      }\n    }\n\n    for (j = 0; j <= k; j++) {\n      printf(\"%c\", str[i][j]);\n    }\n    for (j = 0; j < 3; j++) {\n      printf(\"%c\", substr[i][j]);\n    }\n    for (j = k + 1; j < m; j++) {\n      printf(\"%c\", str[i][j]);\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37190", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[15];\n  char substr[4];\n  int i, maxi, L;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    maxi = 0;\n    i = 1;\n    while (str[i]) {\n      if (str[i] > str[maxi])\n        maxi = i;\n      i++;\n    }\n    L = strlen(str);\n    i = L;\n    while (i != maxi) {\n      str[i + 3] = str[i];\n      i--;\n    }\n    i = 0;\n    while (i < 3) {\n      str[maxi + 1 + i] = substr[i];\n      i++;\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37191", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[14], substr[14], *p = str, *p1, *p2 = substr, max;\n  int i, j, m, n, k;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = str[0];\n    p1 = str;\n    k = 0;\n    for (i = 0; i < n; i++)\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    for (p1 = str + n - 1; p1 > str + k; p1--)\n      *(p1 + 3) = *p1;\n    p1 = str;\n    *(p1 + k + 1) = *p2;\n    *(p1 + k + 2) = *(p2 + 1);\n    *(p1 + k + 3) = *(p2 + 2);\n    for (p = str; p < str + n + 3; p++)\n      printf(\"%c\", *p);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37192", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[30], newstr[30], max;\n  int l = 0, p = 0, i;\n  while (cin.getline(str, 30)) {\n    max = str[0];\n    l = strlen(str);\n    for (int i = 0; i <= l - 5; i++) {\n      if (max < str[i]) {\n        max = str[i];\n        p = i;\n      }\n    }\n    for (i = 0; i <= p; i++) {\n      newstr[i] = str[i];\n    }\n    for (i = 1; i <= 3; i++) {\n      newstr[p + i] = str[l - 4 + i];\n    }\n    for (i = p + 4; i <= l - 2; i++) {\n      newstr[i] = str[i - 3];\n    }\n    for (i = 0; i <= l - 2; i++) {\n      cout << newstr[i];\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37193", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint h(char a[], char b[]) {\n  char c;\n  int len, i = 0, k = 0;\n  len = strlen(a);\n  c = a[0];\n  while (i < len) {\n    if (a[i] > c) {\n      c = a[i];\n      k = i;\n    }\n    i++;\n  }\n  for (i = 0; i <= k; i++)\n    printf(\"%c\", a[i]);\n  for (i = 0; i < 3; i++)\n    printf(\"%c\", b[i]);\n  for (i = k + 1; i < len; i++)\n    printf(\"%c\", a[i]);\n  printf(\"\\n\");\n\n  return 0;\n}\nint main() {\n  int h(char a[], char b[]);\n  char a[10], b[4], c;\n  int i = 0;\n  while (i < 10) {\n\n    if (scanf(\"%s%s\", a, b) == EOF)\n      break;\n    else\n      h(a, b);\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37194", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, k;\n  char s1[12], s2[5], s3[20];\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    int point, i;\n    char record;\n    len = strlen(s1);\n    record = s1[0];\n    point = 0;\n    k = 0;\n    for (i = 0; i <= len - 1; i++) {\n      if (s1[i] > record) {\n        record = s1[i];\n        point = i;\n      }\n    }\n    for (i = 0; i <= point; i++) {\n      s3[k] = s1[i];\n      k++;\n    }\n    for (i = 0; i <= strlen(s2) - 1; i++) {\n      s3[k] = s2[i];\n      k++;\n    }\n    for (i = point + 1; i <= len - 1; i++) {\n      s3[k] = s1[i];\n      k++;\n    }\n    s3[k] = '\\0';\n    printf(\"%s\", s3);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37195", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], max, final[14] = {'\\0'};\n  int i, k, j;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    max = str[0];\n    for (i = 0; i < strlen(str); i++) {\n      if (str[i] > max) {\n        max = str[i];\n        k = i;\n      }\n    }\n\n    strncpy(final, str, k + 1);\n    for (i = 0; i < 3; i++)\n      final[k + 1 + i] = substr[i];\n    for (i = k + 1; i < strlen(str); i++)\n      final[i + 3] = str[i];\n    puts(final);\n\n    for (j = 0; j < 11; j++)\n      str[j] = '\\0';\n    for (j = 0; j < 4; j++)\n      substr[j] = '\\0';\n    for (j = 0; j < 14; j++)\n      final[j] = '\\0';\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37196", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int a[11], i, j, b, c, n, k;\n  char str[11], substr[4], max;\n  for (i = 0;; i++) {\n    int d = 0;\n    if (scanf(\"%s%s\", str, substr) == EOF)\n      break;\n    b = strlen(str);\n    c = strlen(substr);\n    max = str[0];\n    for (j = 0; j < b; j++) {\n      if (str[j] - max > 0)\n        max = str[j];\n    }\n    for (j = 0; j < b; j++) {\n      cout << str[j];\n      if (str[j] == max)\n        break;\n    }\n    printf(\"%s\", substr);\n    for (k = j + 1; k < b; k++)\n      printf(\"%c\", str[k]);\n\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37197", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid f(char a[], char b[3]) {\n  int t = 0, i, l;\n  for (i = 1;; i++) {\n    if (a[i] > a[t])\n      t = i;\n    if (a[i] == '\\0') {\n      l = i;\n      break;\n    }\n  }\n  for (i = l; i >= t + 1; i--)\n    a[i + 3] = a[i];\n\n  a[l + 3] = '\\0';\n  for (i = t + 1; i <= t + 3; i++) {\n    a[i] = b[i - t - 1];\n  }\n  cout << a << \"\\n\";\n}\nint main() {\n  char a[100][11] = {0}, b[3], i = 0;\n  for (i = 0; i < 5; i++) {\n    scanf(\"%s %s\", a[i], b);\n    f(a[i], b);\n    if (a[i][0] == '\\n')\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37198", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int len, i, j, maxASCII = 0, max;\n  char str[15], substr[4], *p = str, *q = substr;\n  while (cin >> str >> substr) {\n    maxASCII = 0;\n    len = strlen(str);\n    for (i = 0; i < len; i++) {\n      if (*(p + i) > maxASCII) {\n        maxASCII = *(p + i);\n        max = i;\n      }\n    }\n    for (i = len - 1; i > max; i--) {\n      *(p + i + 3) = *(p + i);\n    }\n    for (i = max + 1, j = 0; i <= max + 3; i++, j++) {\n      *(p + i) = *(q + j);\n    }\n    for (i = 0; i < len + 3; i++) {\n      cout << str[i];\n    }\n    cout << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37199", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char str[], int i, int l) {\n  int o;\n  for (o = 0; o < l; o++)\n    if (str[o] > str[i])\n      return 0;\n  return 1;\n}\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int l;\n    l = strlen(str);\n    int i;\n    for (i = 0; i < l; i++)\n      if (max(str, i, l) == 1)\n        break;\n    int j, k;\n    for (j = 0; j <= i; j++)\n      printf(\"%c\", str[j]);\n    for (k = 0; k < 3; k++)\n      printf(\"%c\", substr[k]);\n    for (j = i + 1; j < l; j++)\n      printf(\"%c\", str[j]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37200", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[50], t[3], asc = '\\0', c, m[100][14];\n  int i, j, k = 0, count = 0, sn;\n  c = getchar();\n\n  while (c != EOF) {\n    s[0] = c;\n    c = getchar();\n    for (i = 1; c != ' '; i++) {\n      s[i] = c;\n      c = getchar();\n    }\n    sn = i - 1;\n    for (i = 0; i < 3; i++) {\n      c = getchar();\n      t[i] = c;\n    }\n    for (i = 0; i <= sn; i++) {\n      if (s[i] > asc) {\n        asc = s[i];\n        count = i;\n      }\n    }\n    for (j = sn; j > count; j--) {\n      s[j + 3] = s[j];\n    }\n    sn += 3;\n    for (i = 0, j = count; i < 3; i++, j++) {\n      s[j + 1] = t[i];\n    }\n    asc = 0;\n    count = 0;\n    s[sn + 1] = '\\0';\n    strcpy(m[k++], s);\n    c = getchar();\n    c = getchar();\n  }\n  for (i = 0; i < k; i++) {\n    puts(m[i]);\n  }\n}\n"}
{"label": "20", "index": "37201", "code": "#include <bits/stdc++.h>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  char str[30], substr[4], max;\n  int i, len, num;\n  scanf(\"%s%s\", str, substr);\n  while (str[0] != '0') {\n    len = strlen(str);\n    for (i = 0, max = str[0]; i < len; i++)\n      if (str[i] > max)\n        max = str[i];\n    for (i = 0; i < len; i++)\n      if (str[i] == max) {\n        num = i;\n        break;\n      }\n    for (i = 0; i < num + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = num + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n    for (i = 0; i < len; i++)\n      str[i] = '0';\n    for (i = 0; i < 3; i++)\n      substr[i] = '0';\n    scanf(\"%s %s \", str, substr);\n  }\n}\n"}
{"label": "20", "index": "37202", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, n, j;\n  char str[10], substr[3];\n  int f(char str[10]);\n  for (j = 0; scanf(\"%s %s\", str, substr) != EOF; j++) {\n    n = strlen(str);\n    for (i = 0; i <= f(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = f(str) + 1; i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\nint f(char str[10]) {\n  char c;\n  int n, i, x = 0;\n  c = str[0];\n  n = strlen(str);\n  for (i = 1; i < n; i++) {\n    if (str[i] > c) {\n      c = str[i];\n      x = i;\n    }\n  }\n  return (x);\n}\n"}
{"label": "20", "index": "37203", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char a[20], char b[10]) {\n  int max, i, index;\n  char *p;\n  char ans[20];\n  p = a;\n  max = 0;\n  for (i = 1; *(p + i); i++)\n    if (*(p + i) > max)\n      max = *(p + i), index = i;\n  strcpy(ans, \"\");\n  strncat(ans, a, index + 1);\n  strcat(ans, b);\n  strcat(ans, a + index + 1);\n  cout << ans << \"\\n\";\n}\nint main() {\n  char str[20], substr[10];\n  while (scanf(\"%s %s\\n\", str, substr) != EOF) {\n    insert(str, substr);\n  }\n}\n"}
{"label": "20", "index": "37204", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[11], b[4], max, ans[14];\n  int i, k, n, f, j;\n  char *pa, *pb;\n  j = 0;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    pa = a;\n    pb = b;\n    k = strlen(a);\n    f = strlen(b);\n    max = 0;\n    for (i = 0; i < k; i++) {\n      if (*pa > max) {\n        max = *pa;\n        n = i;\n        pa++;\n      } else\n        pa++;\n    }\n    i = 0;\n    for (pa = a; pa < a + n + 1; pa++) {\n      printf(\"%c\", *pa);\n    }\n    for (pb = b; pb < b + f; pb++)\n      printf(\"%c\", *pb);\n\n    for (pa = a + n + 1; pa < a + k; pa++) {\n      printf(\"%c\", *pa);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37205", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main(char *argv[]) {\n  int max, i, j, e, k;\n  char str[11], substr[4];\n  for (;;) {\n    max = 0;\n    if (scanf(\"%s%s\", str, substr) != EOF) {\n      for (i = 0; str[i]; i++) {\n        if (str[i] > max) {\n          max = str[i];\n          e = i;\n        }\n      }\n      for (j = 0; j < e + 1; j++) {\n        printf(\"%c\", str[j]);\n      }\n      printf(\"%s\", substr);\n      for (k = e + 1; str[k]; k++)\n        printf(\"%c\", str[k]);\n      printf(\"\\n\");\n    } else\n      break;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37206", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[1000][13];\n  char c[1000][17];\n  char b[1000][3];\n  int n = 0, i = 0, j, m, k;\n\n  for (i = 0; i < 1000; i++) {\n\n    cin >> c[i];\n    if (c[i][0] == '\u0000') {\n      n = i;\n      break;\n    }\n\n    for (j = 0; j < 17; j++) {\n      if (c[i][j] == ' ') {\n        for (k = 0; k < j; k++) {\n          a[i][k] = c[i][k];\n          a[i][j] = '\u0000';\n        }\n        for (k = 0; k < 3; k++) {\n          b[i][k] = c[i][k + j + 1];\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    m = 0;\n    for (j = 0; j < (int)strlen(a[i]); j++) {\n      if (a[i][j] > a[i][m])\n        m = j;\n    }\n    for (j = 9; j > m; j--) {\n      a[i][j + 3] = a[i][j];\n    }\n    for (j = 0; j < 3; j++) {\n      a[i][m + j + 1] = b[i][j];\n    }\n  }\n  for (i = 0; i < n; i++) {\n    cout << a[i] << \" \";\n  }\n}\n"}
{"label": "20", "index": "37207", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[5], max;\n  int a, b, i, flag;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    a = strlen(str);\n    b = strlen(substr);\n    for (i = 0; i < a; i++) {\n      if (str[i] > max)\n        max = str[i];\n    }\n    flag = 1;\n    for (i = 0; i < a; i++) {\n      if (str[i] < max) {\n        printf(\"%c\", str[i]);\n      } else {\n        printf(\"%c\", max);\n        if (flag == 1) {\n          printf(\"%s\", substr);\n        }\n        flag = 0;\n      }\n    }\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37208", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], cmax, substr[4];\n  int i, m, j, n;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    cmax = str[0];\n    m = 0;\n    for (i = 1;; i++) {\n      if (str[i] == '\\0') {\n        n = i;\n        break;\n      } else if (str[i] > cmax) {\n        cmax = str[i];\n        m = i;\n      }\n    }\n    str[n + 3] = '\\0';\n    for (i = n + 2, j = n - 1;; i--, j--) {\n      str[i] = str[j];\n      if (j == m + 1)\n        break;\n    }\n    for (i = m + 1, j = 0; j <= 2; i++, j++) {\n      str[i] = substr[j];\n    }\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37209", "code": "#include <bits/stdc++.h>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], c, substr[8];\n  int n, max, i;\n  while (1) {\n    max = 0;\n    c = getchar();\n    if (c == '\\n')\n      c = getchar();\n    if (c == EOF)\n      break;\n    else {\n      cin >> str >> substr;\n      n = strlen(str);\n      for (i = n - 1; i >= 0; i--)\n        str[i + 1] = str[i];\n      str[0] = c;\n      str[++n] = 0;\n      for (i = 1; i < n; i++)\n        if (str[i] > str[max])\n          max = i;\n      for (i = 0; i <= max; i++)\n        printf(\"%c\", str[i]);\n      printf(\"%c%c%c\", substr[0], substr[1], substr[2]);\n      for (; i < n; i++)\n        printf(\"%c\", str[i]);\n      putchar('\\n');\n    }\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37210", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[3];\n  int i, j = 0, k, m;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    m = strlen(str);\n    for (i = 0; i < m; i++) {\n      if (str[i] > str[j])\n        j = i;\n    }\n    for (i = m - 1; i > j; i--)\n      str[i + 3] = str[i];\n    for (i = j + 1, k = 0; i < j + 4; i++, k++)\n      str[i] = substr[k];\n    str[m + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37211", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[301];\n  char ds[301];\n  int i, j, k, l, max;\n  while (scanf(\"%s\", &s) != EOF) {\n\n    l = strlen(s);\n    scanf(\"%s\", &ds);\n    max = l - 1;\n    for (j = l - 1; j > 0; j = j - 1) {\n      if (s[j] >= s[max])\n        max = j;\n    }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", s[i]);\n    printf(\"%s\", ds);\n    for (i = max + 1; i < l; i++)\n      printf(\"%c\", s[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37212", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, n, p, m, c, a[101];\n  char str[15], substr[4], x[20];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    n = strlen(str);\n    for (i = 0; i < n; i++)\n      if (str[c] < str[i]) {\n        c = i;\n      }\n    for (j = 0; j <= c; j++)\n      x[j] = str[j];\n    for (j = c + 1; j <= c + 3; j++)\n      x[j] = substr[j - c - 1];\n    if (c < n - 1)\n      for (j = c + 4; j < n + 3; j++)\n        x[j] = str[j - 3];\n    for (i = 0; i < n + 3; i++)\n      putchar(x[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37213", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint max(char x[]) {\n  int m, i, n = 0;\n  char a = x[0];\n  m = strlen(x);\n  for (i = 1; i <= m - 1; i++) {\n    if (x[i] > a) {\n      a = x[i];\n      n = i;\n    }\n  }\n  return n;\n}\nint main() {\n  int n, l, j;\n  char sa[14];\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    n = max(str);\n    for (j = 0; j <= n; j++)\n      sa[j] = str[j];\n    for (j = n + 1; j <= n + 3; j++)\n      sa[j] = substr[j - n - 1];\n    for (j = n + 4; j <= l + 2; j++)\n      sa[j] = str[j - 3];\n    sa[l + 3] = '\\0';\n    printf(\"%s\\n\", sa);\n  }\n}\n"}
{"label": "20", "index": "37214", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char str[100][50];\n  int a[100][2], b[100], c[100];\n  int i, j, k = -1;\n  for (i = 0; i < 100; i++) {\n    c[i] = b[i] = 0;\n  }\n  for (i = 0; i < 100; i++) {\n    cin >> str[i];\n    k = k + 1;\n    if (str[i][0] == '\u0000')\n      break;\n  }\n  for (i = 0; i < k; i++) {\n    c[i] = strlen(str[i]);\n    for (j = 0; j < c[i]; j++)\n      if (str[i][j] == ' ')\n        b[i] = j;\n  }\n\n  for (i = 0; i < k; i++) {\n    a[i][1] = str[i][0];\n    a[i][0] = 0;\n  }\n  for (i = 0; i < k; i++)\n    for (j = 0; j < b[i]; j++)\n      if (str[i][j] > a[i][1]) {\n        a[i][0] = j;\n        a[i][1] = str[i][j];\n      }\n\n  for (i = 0; i < k; i++) {\n    for (j = 0; j < a[i][0] + 1; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = b[i] + 1; j < b[i] + 4; j++)\n      printf(\"%c\", str[i][j]);\n    for (j = a[i][0] + 1; j < b[i]; j++)\n      printf(\"%c\", str[i][j]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37215", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int n, i, j, a, b, k, f;\n  for (i = 0;; i++) {\n    char str[14] = {0}, sub[4] = {0}, str1[14] = {0}, c;\n    a = 0;\n    j = 0;\n    b = 0;\n    f = 0;\n    k = 0;\n    n = 0;\n\n    cin >> str;\n    if (str[0] == 0)\n      break;\n    k = strlen(str);\n    while (str[j] != ' ') {\n      str1[j] = str[j];\n      j++;\n    }\n    n = strlen(str1);\n    b = j + 1;\n    while (b < k && f < 3) {\n      sub[f] = str[b];\n      b++;\n      f++;\n    }\n    c = str1[0];\n    for (j = 1; j < n; j++) {\n      if (c < str1[j]) {\n        c = str1[j];\n      }\n    }\n    for (j = 0; j < n; j++) {\n      if (str1[j] == c) {\n        a = j + 1;\n        break;\n      }\n    }\n    for (j = 0; j < a; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\"%s\", sub);\n    for (j = a; j < n; j++) {\n      printf(\"%c\", str1[j]);\n    }\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37216", "code": "#include <bits/stdc++.h>\nusing namespace std;\nchar string_1[13];\nvoid f(char str[], char substr[]);\nint main() {\n  int i;\n  char str[10], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    f(str, substr);\n    for (i = 0; i < strlen(str) + 3; i = i + 1)\n      printf(\"%c\", string_1[i]);\n    printf(\" \");\n  }\n}\nvoid f(char str[10], char substr[4]) {\n  int i, j, k, t;\n  char max;\n  max = str[0];\n  k = 0;\n  t = strlen(str);\n  for (i = 1; i < t; i = i + 1) {\n    if (str[i] > max) {\n      max = str[i];\n      k = i;\n    }\n  }\n  for (i = 0; i <= k; i = i + 1) {\n    string_1[i] = str[i];\n  }\n  j = 0;\n  for (i = k + 1; i <= k + 3; i = i + 1) {\n    string_1[i] = substr[j];\n    j = j + 1;\n  }\n  if (k < t - 1) {\n    j = k + 1;\n    for (i = k + 4; i < t + 3; i = i + 1) {\n      string_1[i] = str[j];\n      j = j + 1;\n    }\n  }\n}\n"}
{"label": "20", "index": "37217", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, max;\n  char str[11], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; i < strlen(str); i++) {\n      if (str[i] > str[max]) {\n        max = i;\n      }\n    }\n    for (j = 0; j < max + 1; j++) {\n      printf(\"%c\", str[j]);\n    }\n    for (k = 0; k < 3; k++) {\n      printf(\"%c\", substr[k]);\n    }\n    for (j = max + 1; j < strlen(str); j++) {\n      printf(\"%c\", str[j]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37218", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, l, max;\n  char str[15], substr[3];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l = strlen(str);\n    max = 0;\n    for (i = 0; i < l; i++) {\n      if (str[max] < str[i])\n        max = i;\n    }\n    for (j = l - 1; j > max; j--)\n      str[j + 3] = str[j];\n    for (j = max + 1; j < max + 4; j++)\n      str[j] = substr[j - max - 1];\n    for (j = 0; j < l + 3; j++)\n      printf(\"%c\", str[j]);\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37219", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, flag;\n  char str[50], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0, flag = 0; j <= n - 1; j++)\n        if (str[i] >= str[j])\n          flag++;\n      if (flag == n)\n        break;\n    }\n    for (k = n - 1; k >= i + 1; k--)\n      str[k + 3] = str[k];\n    for (l = 1; l <= 3; l++) {\n      str[i + l] = substr[l - 1];\n    }\n    str[n + 3] = '\\0';\n    printf(\"%s\\n\", str);\n  }\n}\n"}
{"label": "20", "index": "37220", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  while (scanf(\"%s %s \", str, substr)) {\n    char a[14];\n    int len_a = strlen(str), len_b = strlen(substr), i, j;\n    char max = 0;\n    for (i = 0; i < len_a; i++) {\n      if (str[i] > max)\n        max = str[i];\n      else\n        continue;\n    }\n    for (i = 0; i < len_a; i++) {\n      if (str[i] == max) {\n        if (i == len_a - 1) {\n          for (j = len_a; j <= len_a + len_b; j++)\n            str[j] = substr[j - len_a];\n        } else {\n          for (j = 0; j < len_a - i - 1; j++)\n            a[j] = str[j + i + 1];\n          for (j = i + 1; j < i + len_b + 1; j++)\n            str[j] = substr[j - i - 1];\n          for (j = i + len_b + 1; j < len_a + len_b; j++)\n            str[j] = a[j - i - len_b - 1];\n          str[j] = '\\0';\n        }\n        break;\n      } else\n        continue;\n    }\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37221", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n\n  int n, i, m;\n  char a[14], b[4];\n  char a1[14];\n  char t;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    m = 0;\n    t = a[0];\n    for (i = 1; i <= n - 1; i++)\n      if (a[i] > t) {\n        m = i;\n        t = a[i];\n      }\n    for (i = m + 1; i <= n - 1; i++)\n      a1[i + 3] = a[i];\n    a[m + 1] = b[0];\n    a[m + 2] = b[1];\n    a[m + 3] = b[2];\n    for (i = m + 4; i <= n + 2; i++)\n      a[i] = a1[i];\n    a[n + 3] = 0;\n    cout << a << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37222", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char s[100][15] = {'\u0000'};\n  int i, n, l, a, k, t;\n  i = 0;\n  do {\n    cin >> s[i];\n    i++;\n  } while (s[i - 1][0] != '\u0000');\n  n = i - 2;\n  for (i = 0; i <= n; i++) {\n    l = strlen(s[i]);\n    a = s[i][0];\n    for (k = 1; k < l - 4; k++) {\n      if (s[i][k] > a) {\n        a = s[i][k];\n        t = k;\n      }\n    }\n    for (k = 0; k <= t; k++)\n      printf(\"%c\", s[i][k]);\n    for (k = l - 3; k <= l - 1; k++)\n      printf(\"%c\", s[i][k]);\n    for (k = t + 1; k < l - 4; k++)\n      printf(\"%c\", s[i][k]);\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37223", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[100][11], b[100][4];\n  int p, i = 0, j, k, t;\n  while (scanf(\"%s%s\", a[i], b[i]) != EOF)\n    i++;\n  for (j = 0; j < i; j++) {\n    t = 0;\n    for (k = 1; k < strlen(a[j]); k++)\n      if (a[j][k] > a[j][t])\n        t = k;\n    for (p = 0; p <= t; p++)\n      printf(\"%c\", a[j][p]);\n    for (p = 0; p < strlen(b[j]); p++)\n      printf(\"%c\", b[j][p]);\n    for (p = t + 1; p < strlen(a[j]); p++)\n      printf(\"%c\", a[j][p]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37224", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nvoid insert(char a[15]) {\n  char m, c;\n  int i, l = 0, j, k;\n  j = strlen(a);\n  if (strlen(a) == 0 || a[0] < 33 || a[0] > 126)\n    return;\n  m = 0;\n  for (i = 0; i < j - 4; i++)\n    if (m < a[i]) {\n      m = a[i];\n      l = i + 1;\n    }\n  for (i = 0; i < 3; i++) {\n    c = a[j - 3 + i];\n    for (k = j - 3 + i; k > l + i; k--)\n      a[k] = a[k - 1];\n    a[l + i] = c;\n  }\n  for (i = 0; i < j - 2; i++)\n    printf(\"%c\", a[i]);\n  cout << a[j - 2] << \" \";\n}\nint main() {\n  char b[50][15];\n  int l = 0, i;\n  do {\n\n    cin >> b[l];\n    if (strlen(b[l]) == 0 || b[l][0] < 33 || b[l][0] > 126)\n      break;\n    l = l + 1;\n  } while (b[l - 1][0] != '\u0000');\n  for (i = 0; i < l; i++)\n    insert(b[i]);\n  return 0;\n}\n"}
{"label": "20", "index": "37225", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[10], strc[13], substr[3], max, num;\n  int i, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 0; i < n; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        num = i;\n      }\n    }\n    for (i = 0; i <= num; i++)\n      strc[i] = str[i];\n\n    for (i = num + 1; i <= num + 3; i++) {\n      strc[i] = substr[i - num - 1];\n    }\n    for (i = num + 4; i < n + 3; i++) {\n      strc[i] = str[i - 3];\n    }\n    strc[n + 3] = '\\0';\n    cout << strc << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37226", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int i, j, k, l, n, flag;\n  char str[50], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    for (i = 0; i <= n - 1; i++) {\n      for (j = 0, flag = 0; j <= n - 1; j++)\n        if (str[i] >= str[j])\n          flag++;\n      if (flag == n)\n        break;\n    }\n    for (k = n - 1; k >= i + 1; k--) {\n      str[k + 3] = str[k];\n    }\n    for (l = 1; l <= 3; l++)\n      str[i + l] = substr[l - 1];\n    str[n + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37227", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[100][40], su[4], s[10], max;\n  int m, length[100], i = 0, j, l, p;\n  do {\n\n    cin >> str[i];\n    i++;\n    m = strlen(str[i - 1]);\n  } while (m != 0);\n  l = i - 1;\n  for (i = 0; i < l; i++) {\n    length[i] = strlen(str[i]);\n    max = str[i][0];\n    for (j = 1; j < length[i] - 4; j++) {\n      if (str[i][j] > max) {\n        max = str[i][j];\n        p = j;\n      }\n    }\n    for (j = 0; j < 3; j++)\n      su[j] = str[i][length[i] + j - 3];\n    for (j = 0; j < length[i] - p - 5; j++)\n      s[j] = str[i][p + j + 1];\n    for (j = 0; j <= p; j++)\n      str[i][j] = str[i][j];\n    for (j = p + 1; j <= p + 3; j++)\n      str[i][j] = su[j - p - 1];\n    for (j = p + 4; j < length[i]; j++)\n      str[i][j] = s[j - p - 4];\n    for (j = length[i] - 1; j < 40; j++)\n      str[i][j] = '\u0000';\n    printf(\"%s \", str[i]);\n  }\n}\n"}
{"label": "20", "index": "37228", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[15][10], b[15][3], c[10][13], s;\n  int i, j, t, r, m = 0;\n  while (scanf(\"%s%s\", a[m], b[m]) != EOF)\n    m++;\n  for (j = 0; j < m; j++) {\n    t = strlen(a[j]);\n    for (i = 0, s = a[j][0]; i < t; i++)\n      if (a[j][i] > s)\n        s = a[j][i];\n    for (r = 0; a[j][r] != s;)\n      r++;\n    for (i = 0; i <= r; i++)\n      c[j][i] = a[j][i];\n    for (i = 0; i < 3; i++)\n      c[j][i + r + 1] = b[j][i];\n    for (i = r + 1; i < t + 3; i++)\n      c[j][i + 3] = a[j][i];\n    for (i = 0; i < t + 3; i++)\n      printf(\"%c\", c[j][i]);\n    printf(\" \");\n  }\n}\n"}
{"label": "20", "index": "37229", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[10], substr[4], *p, t;\n  int i, j, k;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    p = str;\n    t = *p;\n    j = 0;\n    k = strlen(str);\n    for (i = 0; i < k; i++, p++)\n      if (*p > t) {\n        t = *p;\n        j = i;\n      }\n\n    for (p = str, i = 0; i < j + 1; i++, p++)\n      printf(\"%c\", *p);\n    printf(\"%s\", substr);\n    for (i = j + 1; i < k; i++, p++)\n      printf(\"%c\", *p);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37230", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[10], b[3], c, max;\n  int j, t, l;\n\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    l = strlen(a);\n    max = a[0];\n    for (j = 0; j <= l - 1; j++) {\n      if ((int)a[j] > (int)max) {\n        max = a[j];\n        t = j;\n      }\n    }\n    for (j = 0; j <= t; j++)\n      printf(\"%c\", a[j]);\n    cout << b;\n    for (j = t + 1; j <= l - 1; j++)\n      printf(\"%c\", a[j]);\n    cout << \"\\n\";\n  }\n  while ((c = getchar()) != EOF)\n    ;\n}\n"}
{"label": "20", "index": "37231", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int l, i, k, j;\n  char s1[11], s2[4], s3[15];\n  while (scanf(\"%s %s\", s1, s2) != EOF) {\n    l = strlen(s1);\n    k = 0;\n    for (j = 1; j < l; j++)\n      if (s1[k] < s1[j])\n        k = j;\n    for (i = 0; i <= k; i++)\n      s3[i] = s1[i];\n    for (i = 1; i < 4; i++)\n      s3[k + i] = s2[i - 1];\n    for (i = 0; i <= l - k; i++) {\n      s3[k + 4 + i] = s1[k + i + 1];\n    }\n    printf(\"%s \", s3);\n  }\n}\n"}
{"label": "20", "index": "37232", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nint main() {\n  int i, ii;\n  char res[100][20];\n  int p = 0;\n  char c, sub1[20], sub2[20];\n  char str[20], substr[5];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    c = 0;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > c) {\n        c = str[i];\n        ii = i;\n      }\n    strcpy(sub1, str);\n    sub1[ii + 1] = '\\0';\n    strcpy(sub1, strcat(sub1, substr));\n    for (i = ii + 1; i < strlen(str); i++)\n      sub2[i - ii - 1] = str[i];\n    sub2[strlen(str) - ii - 1] = '\\0';\n    strcpy(res[p], strcat(sub1, sub2));\n    p++;\n  }\n  for (i = 0; i < p; i++) {\n    printf(\"%s\\n\", res[i]);\n  }\n}\n"}
{"label": "20", "index": "37233", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i, k = 0, n;\n  char a;\n  while (scanf(\"%s %s\", str, substr) == 2) {\n    n = strlen(str);\n    a = str[0];\n    for (i = 0;; i++) {\n      if (str[i] == '\\0')\n        break;\n      if (str[i] > a) {\n        a = str[i];\n        k = i;\n      }\n    }\n    for (i = 0; i <= k; i++)\n      cout << str[i];\n    for (i = 0; i <= 2; i++)\n      printf(\"%c\", substr[i]);\n    for (i = k + 1; i < n; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37234", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {0};\n  for (j = 0;; j++) {\n    d = '\\0';\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[i]);\n  }\n}\n"}
{"label": "20", "index": "37235", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main() {\n  char str[11], substr[4], A[15];\n  int i, M, N, n;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    i = 1;\n    N = str[0];\n    while (i <= n - 1) {\n      if (str[i] > N) {\n        N = str[i];\n        M = i;\n      } else {\n        N = N;\n        M = M;\n      }\n      i++;\n    }\n    i = 0;\n    while (i <= M) {\n      A[i] = str[i];\n      i++;\n    }\n    A[M + 1] = substr[0];\n    A[M + 2] = substr[1];\n    A[M + 3] = substr[2];\n    while (i <= n - 1) {\n      A[i + 3] = str[i];\n      i++;\n    }\n    i = 0;\n    while (i <= n + 2) {\n      cout << A[i];\n      i++;\n    }\n    cout << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37236", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[11], substr[4];\n  int i;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    char a[11];\n    int l = strlen(str), m = 0;\n    for (i = 1; i < l; i++) {\n      if (str[m] < str[i])\n        m = i;\n    }\n    for (i = m + 1; i < l; i++) {\n      a[i - m - 1] = str[i];\n    }\n    a[l - m - 1] = '\\0';\n    str[m + 1] = '\\0';\n    strcat(str, substr);\n    strcat(str, a);\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37237", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char *str, *substr, *p, *q, *max, *string;\n  int i, j, l1, l2;\n  str = (char *)calloc(15, sizeof(char));\n  substr = (char *)calloc(5, sizeof(char));\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    l1 = strlen(str);\n    l2 = strlen(substr);\n    max = str;\n    for (p = str; p - str < l1; p++) {\n      if (*p > *max)\n        max = p;\n    }\n    string = (char *)calloc(15, sizeof(char));\n    for (p = str, i = 0; p <= max; p++, i++)\n      *(string + i) = *p;\n    for (p = substr; p - substr < l2; p++, i++)\n      *(string + i) = *p;\n\n    for (p = max + 1; p - str < l1; p++, i++)\n      *(string + i) = *p;\n    puts(string);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37238", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint fmax(char str[]);\n\nint main() {\n  char str[11], substr[4], rstr[14];\n  int i;\n  while (cin.getline(str, 12, ' ') && cin.getline(substr, 4)) {\n    for (i = 0; i <= fmax(str); i++)\n      rstr[i] = str[i];\n    for (i = 0; i < 3; i++)\n      rstr[fmax(str) + 1 + i] = substr[i];\n    for (i = 0; i < strlen(str) - fmax(str) - 1; i++)\n      rstr[fmax(str) + 4 + i] = str[fmax(str) + i + 1];\n    rstr[fmax(str) + 4 + i] = '\\0';\n    cout << rstr << endl;\n  }\n  return 0;\n}\n\nint fmax(char str[]) {\n  int max = 0, i;\n  for (i = 0; i < strlen(str); i++)\n    max = (str[i] > str[max] ? i : max);\n  return max;\n}\n"}
{"label": "20", "index": "37239", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[1000], substr[1000];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    int len1 = strlen(str);\n    int i, max, temp;\n    max = str[len1 - 1];\n    for (i = len1 - 1; i >= 0; i--) {\n      if (str[i] >= max) {\n        max = str[i];\n        temp = i;\n      }\n    }\n    for (i = 0; i < len1; i++) {\n      if (i == temp) {\n        printf(\"%c\", str[i]);\n        printf(\"%s\", substr);\n      } else\n        printf(\"%c\", str[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37240", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int n, i, max, m, j = 0, k;\n  char a[111], b[4], *p, c[11111][111];\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    n = strlen(a);\n    p = a;\n    max = a[0];\n    for (i = 1; i < n; i++) {\n      if (a[i] > max) {\n        max = a[i];\n        m = i;\n      }\n    }\n    for (i = n + 3; i < (n + n - m + 2); i++)\n      a[i] = a[i + m - n - 2];\n    for (p = (a + m + 1); p < (a + m + 4); p++)\n      *p = b[p - a - m - 1];\n    for (p = (a + m + 4); p < (a + n + 3); p++)\n      *p = a[p - a - m + n - 1];\n    for (i = 0; i < n + 3; i++)\n      c[j][i] = a[i];\n    c[j][n + 3] = 0;\n    j = j + 1;\n    k = j;\n  }\n  for (j = 0; j < k; j++)\n    cout << c[j] << \"\\n\";\n  return 0;\n}\n"}
{"label": "20", "index": "37241", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[15];\n  char substr[4];\n  int i, maxi, L;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    maxi = 0;\n    i = 1;\n    while (str[i]) {\n      if (str[i] > str[maxi]) {\n        maxi = i;\n      }\n      i++;\n    }\n    L = strlen(str);\n    i = L;\n    while (i != maxi) {\n      str[i + 3] = str[i];\n      i--;\n    }\n    i = 0;\n    while (i < 3) {\n      str[maxi + 1 + i] = substr[i];\n      i++;\n    }\n    cout << str << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37242", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[5];\n  int i, n = 0, l;\n  while (scanf(\"%s %s\", &a, &b) != EOF) {\n    l = strlen(a);\n    int max;\n    char *p = &a[0];\n    max = *p;\n    for (i = 0; i < l; i++, p++) {\n      if (*p > max) {\n        max = *p;\n        n = i;\n      }\n    }\n    for (i = 0; i <= n; i++)\n      printf(\"%c\", a[i]);\n    printf(\"%s\", b);\n    if (n < l - 1) {\n      for (i = n + 1; i < l - 1; i++) {\n        printf(\"%c\", a[i]);\n      }\n      printf(\"%c\\n\", a[l - 1]);\n    } else\n      printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37243", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int max, i, max1;\n  char str[20], substr[4], ans[20];\n  char *p = str, *q = substr;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    max = 0;\n    for (i = 1; str[i]; i++)\n      if (str[i] > max) {\n        max = str[i], max1 = i;\n      }\n    strcpy(ans, \"\");\n    strncat(ans, str, max1 + 1);\n    strcat(ans, substr);\n    strcat(ans, str + max1 + 1);\n    printf(\"%s\\n\", ans);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37244", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  while (cin) {\n    char str[11] = {'\\0'};\n    char substr[4] = {'\\0'};\n    char ansstr[14] = {'\\0'};\n    char cmax = 0;\n    int point = 0;\n    cin >> str;\n    cin >> substr;\n    int length = strlen(str);\n    for (int i = 0; i < length; i++) {\n      if (str[i] > cmax) {\n        cmax = str[i];\n        point = i;\n      }\n    }\n    for (int i = 0; i < point + 1; i++)\n      ansstr[i] = str[i];\n    for (int i = point + 1; i < point + 4; i++)\n      ansstr[i] = substr[i - point - 1];\n    for (int i = point + 4, j = point + 1; i < length + 3, j < length; i++, j++)\n      ansstr[i] = str[j];\n    cout << ansstr << endl;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37245", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[12], b[4];\n  int i = 0, n, m = 0;\n  char c;\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    c = a[0];\n    while (i < n) {\n      if (a[i] > c)\n        c = a[i], m = i;\n      i++;\n    }\n    i = 0;\n    while (i <= m) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    printf(\"%s\", b);\n    while (i < n) {\n      printf(\"%c\", a[i]);\n      i++;\n    }\n    i = 0;\n    cout << \"\\n\";\n    m = 0;\n  }\n}\n"}
{"label": "20", "index": "37246", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char s1[11], s2[4];\n  int i, j, n, b;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    n = strlen(s1) - 1;\n    j = 0;\n    b = s1[0];\n    for (i = 0; i <= n - 1; i++) {\n      if (b < s1[i]) {\n        j = i;\n        b = s1[i];\n      }\n    }\n\n    for (i = 0; i <= j; i++) {\n      printf(\"%c\", s1[i]);\n    }\n    cout << s2;\n    while (j < n) {\n      printf(\"%c\", s1[j + 1]);\n      j++;\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37247", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, max = 0;\n  char str[11], substr[4], maxchar;\n  while (scanf(\"%s\", str) != EOF) {\n    maxchar = '\\0';\n    cin >> substr;\n    for (i = 0; str[i]; i++)\n      if (str[i] > maxchar) {\n        max = i;\n        maxchar = str[i];\n      }\n    for (i = 0; i <= max; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = max + 1; str[i]; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37248", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char s[15], p = '\u0000';\n  int i, len, max;\n  while (scanf(\"%s \", s)) {\n    len = strlen(s) - 4;\n    for (i = 0; i < len; i++)\n      if (*(s + i) > p) {\n        p = *(s + i);\n        max = i;\n      }\n    for (i = 0; i <= max; i++)\n      cout << *(s + i);\n    for (i = len + 1; i <= len + 3; i++)\n      printf(\"%c\", *(s + i));\n    for (i = max + 1; i < len; i++)\n      printf(\"%c\", *(s + i));\n    p = '\u0000';\n    printf(\" \");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37249", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[]) {\n  char str[11], substr[4];\n  int i, j, max = 0, len;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    len = strlen(str);\n    max = 0;\n    for (j = 0; j < len; j++) {\n      if (str[max] < str[j + 1])\n        max = j + 1;\n    }\n    for (i = 0; i < len; i++) {\n      cout << str[i];\n      if (i == max)\n        printf(\"%s\", substr);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37250", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char str[11], substr[4], x[20];\n  int i, n, a;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    n = 0;\n    a = strlen(str);\n    for (i = 1; i < a; i++) {\n      if (str[i] > str[n])\n        n = i;\n    }\n    for (i = 0; i < n + 1; i++)\n      x[i] = str[i];\n\n    x[n + 1] = substr[0];\n    x[n + 2] = substr[1];\n    x[n + 3] = substr[2];\n    for (i = n + 4; i < a + 4; i++) {\n      x[i] = str[i - 3];\n    }\n    for (i = 0; i < a + 3; i++) {\n      printf(\"%c\", x[i]);\n    }\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37251", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  char str[15];\n  char substr[4];\n  int i, maxi, L;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    maxi = 0;\n    i = 1;\n    while (str[i]) {\n      if (str[i] > str[maxi]) {\n        maxi = i;\n      }\n      i++;\n    }\n    L = strlen(str);\n    i = L;\n    while (i != maxi) {\n      str[i + 3] = str[i];\n      i--;\n    }\n    i = 0;\n    while (i < 3) {\n      str[maxi + 1 + i] = substr[i];\n      i++;\n    }\n    printf(\"%s\\n\", str);\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37252", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[10], k;\n  int i, l, t = 0, m;\n  while ((scanf(\"%s%s\", a, b)) != EOF) {\n    l = strlen(a);\n    m = strlen(b);\n    k = a[0];\n    for (i = 1; i < l; i++)\n      if (a[i] > k) {\n        k = a[i];\n        t = i;\n      }\n    for (i = 0; i <= t; i++) {\n      printf(\"%c\", a[i]);\n    }\n    for (i = 0; i < m; i++) {\n      printf(\"%c\", b[i]);\n    }\n    for (i = t + 1; i < l; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37253", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4], c;\n  int t, i, l;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    c = str[0];\n    t = 0;\n    l = strlen(str);\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > c) {\n        c = str[i];\n        t = i;\n      }\n    for (i = 0; i <= t; i++)\n      printf(\"%c\", str[i]);\n    for (i = 0; i < 3; i++)\n      cout << substr[i];\n    for (i = t + 1; i < l; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37254", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[100], sub[100];\n  while (scanf(\"%s%s\", str, sub) != EOF) {\n    int m;\n    m = strlen(str);\n    int i, j, as[20];\n    for (i = 0; i <= m - 1; i++)\n      as[i] = str[i];\n    for (j = 1; j <= m - 1; j++)\n      if (as[0] < as[j])\n        as[0] = as[j];\n\n    char p;\n    p = as[0];\n    int q;\n    for (i = 0; i <= m - 1; i++)\n      if (str[i] == p) {\n        q = i;\n        break;\n      }\n    for (i = m + 2; i >= q + 1; i--)\n      str[i + 3] = str[i];\n    str[q + 1] = sub[0];\n    str[q + 2] = sub[1];\n    str[q + 3] = sub[2];\n    str[m + 3] = '\\0';\n    printf(\"%s\", str);\n    cout << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37255", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, k;\n  char s1[100], s2[100];\n  while (scanf(\"%s%s\", &s1, &s2) != EOF) {\n    j = 0;\n    k = 0;\n    for (i = 0; i < strlen(s1); i++) {\n      if ((int)s1[i] > j) {\n        j = (int)s1[i];\n        k = i;\n      }\n    }\n    for (i = 0; i < strlen(s1); i++) {\n      putchar(s1[i]);\n      if (i == k) {\n        for (j = 0; j < strlen(s2); j++)\n          putchar(s2[j]);\n      }\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37256", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int j = 0, i, ceshi, max, weizhi;\n  char str[30][10] = {'\\0'}, substr[30][3] = {'\\0'}, xin[30][13] = {'\\0'},\n       *dizhi[30];\n  char *a, *b, *c;\n  while (scanf(\"%s %s\", str[j], substr[j]) != EOF) {\n    j++;\n  }\n\n  ceshi = j;\n  *dizhi = str[j];\n\n  for (j = 0; j < ceshi; j++) {\n\n    weizhi = 1;\n    max = *(*dizhi);\n    for (i = 0; str[j][i] != '\\0'; i++) {\n      if (*(str[j] + i) > max) {\n        max = *(str[j] + i);\n        weizhi = i + 1;\n      }\n    }\n\n    a = &str[j][0];\n    b = &substr[j][0];\n    c = &xin[j][0];\n\n    for (i = 0; i < weizhi; i++) {\n      *(c + i) = *(a + i);\n    }\n\n    for (i = weizhi; i < weizhi + 3; i++) {\n      *(c + i) = *(b + i - weizhi);\n    }\n\n    for (i = weizhi; str[j][i] != '\\0'; i++) {\n      *(c + 3 + i) = *(a + i);\n    }\n\n    for (i = 0; xin[j][i] != '\\0'; i++) {\n      printf(\"%c\", *(c + i));\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37257", "code": "#include <bits/stdc++.h>\n#include <stdio.h>\nusing namespace std;\nvoid setin(char a[11], char b[4]) {\n  int i, stop = 0, max;\n  max = (int)a[0];\n  for (i = 0; a[i] != '\\0'; i++) {\n    if ((int)a[i] > max) {\n      max = (int)a[i];\n      stop = i;\n    }\n  }\n  for (i = 0; a[i] != '\\0'; i++) {\n    if (i == stop) {\n      cout << a[i];\n      cout << b;\n    } else\n      cout << a[i];\n  }\n  cout << endl;\n}\nint main() {\n  char a[11] = {'\\0'}, b[4] = {'\\0'};\n  while (scanf(\"%s %s \", a, b))\n    setin(a, b);\n\n  return 0;\n}\n"}
{"label": "20", "index": "37258", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, j, p, n;\n  j = 0;\n  char a[14], b[4];\n  while (scanf(\"%s%s\", a, b) != EOF) {\n    n = strlen(a);\n    for (i = 0; i < n; i++)\n      if (a[i] > a[j])\n        j = i;\n    p = j;\n    for (i = n - 1; i > j; i--)\n      a[i + 3] = a[i];\n    a[p + 3] = b[2];\n    a[p + 2] = b[1];\n    a[p + 1] = b[0];\n    for (i = 0; i < n + 3; i++)\n      printf(\"%c\", a[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37259", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  int i = 0, j, k, m;\n  int max[100];\n  char str[100][100], substr[100][100];\n  memset(max, 0, sizeof(int) * 100);\n  while (scanf(\"%s %s\", &str[i], &substr[i]) != EOF) {\n    i++;\n  }\n  for (j = 0; j < i; j++) {\n    for (k = 0; k < strlen(str[j]); k++)\n      if (str[j][k] > str[j][max[j]])\n        max[j] = k;\n  }\n  for (j = 0; j < i; j++) {\n    k = 0;\n    while (k <= max[j])\n      putchar(str[j][k]), k++;\n\n    for (m = 0; m < strlen(substr[j]); m++)\n      putchar(substr[j][m]);\n    while (k < strlen(str[j])) {\n      putchar(str[j][k]), k++;\n    }\n    putchar('\\n');\n  }\n}\n"}
{"label": "20", "index": "37260", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\n\nchar maxASCII(char *str) {\n  int len = strlen(str);\n  int i, j = 0;\n  for (i = 0; i < len; i++) {\n    if (str[i] > j)\n      j = str[i];\n  }\n  return j;\n}\nint maxlocate(char string[], char maxx) {\n  int x;\n  for (x = 0; x < strlen(string); x++) {\n    if (string[x] == maxx) {\n      return x;\n    }\n  }\n}\n\nint main(int argc, char *argv[]) {\n  char str[100][10], substr[100][4];\n  int max;\n  int rank;\n  int i, j;\n  j = 0;\n  while (scanf(\"%s%s\", str[j], substr[j]) != EOF)\n    j++;\n  for (i = 0; i < j; i++) {\n\n    max = maxASCII(str[i]);\n    rank = maxlocate(str[i], max);\n    int a;\n    for (a = 0; a <= rank; a++) {\n      cout << str[i][a];\n    }\n    cout << substr[i];\n    for (a = rank + 1; a < strlen(str[i]); a++) {\n      cout << str[i][a];\n    }\n    cout << \"\\n\";\n  }\n\n  return EXIT_SUCCESS;\n}\n"}
{"label": "20", "index": "37261", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[20], substr[5];\n  int i, p;\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    for (i = 0, p = 0; i < strlen(str); i++)\n      if (str[i] > str[p])\n        p = i;\n    for (i = 0; i <= p; i++)\n      printf(\"%c\", str[i]);\n    cout << substr;\n    for (i = p + 1; i < strlen(str); i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37262", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint max(char s1[11]) {\n  int i, k = 0;\n  char c = 0;\n  for (i = 0; i < strlen(s1); i++) {\n    if (s1[i] > c) {\n      c = s1[i];\n      k = i;\n    }\n  }\n  return (k);\n}\nint main() {\n  char s1[11], s2[4];\n  int i, j, m;\n  while (scanf(\"%s%s\", s1, s2) != EOF) {\n    m = max(s1);\n    for (i = 0; i <= m; i++)\n      cout << s1[i];\n    printf(\"%s\", s2);\n    for (i = m + 1; i < strlen(s1); i++)\n      printf(\"%c\", s1[i]);\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37263", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char str[14], substr[4], c;\n  int i, Max;\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    c = str[0];\n    for (i = 0; str[i] != '\\0'; i++)\n      if (str[i] > c) {\n        c = str[i];\n        Max = i;\n      }\n    for (i = 0; str[i] != '\\0'; i++) {\n      printf(\"%c\", str[i]);\n      if (i == Max)\n        cout << substr;\n    }\n    printf(\"\\n\");\n  }\n}\n"}
{"label": "20", "index": "37264", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  char a[15][10], b[15][3], c[10][13], s;\n  int i, j, t, r, m = 0;\n  while (scanf(\"%s%s\", a[m], b[m]) != EOF)\n    m++;\n  for (j = 0; j < m; j++) {\n    t = strlen(a[j]);\n    for (i = 0, s = a[j][0]; i < t; i++)\n      if (a[j][i] > s)\n        s = a[j][i];\n    for (r = 0; a[j][r] != s;)\n      r++;\n    for (i = 0; i <= r; i++)\n      c[j][i] = a[j][i];\n    for (i = 0; i < 3; i++)\n      c[j][i + r + 1] = b[j][i];\n    for (i = r + 1; i < t + 3; i++)\n      c[j][i + 3] = a[j][i];\n    for (i = 0; i < t + 3; i++)\n      printf(\"%c\", c[j][i]);\n    cout << \" \";\n  }\n}\n"}
{"label": "20", "index": "37265", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int i, max, maxi;\n  char str[10], substr[4];\n  while (scanf(\"%s %s\", str, substr) != EOF) {\n    max = maxi = 0;\n    for (i = 0; str[i] != 0; i++) {\n      if (str[i] > max) {\n        max = str[i];\n        maxi = i;\n      }\n    }\n    for (i = 0; i <= maxi; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (; str[i] != 0; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37266", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\n\nvoid insert(char str[], char substr[]) {\n  int max, len, i, j, position;\n  char str1[15];\n  len = strlen(str);\n  max = str[0];\n  for (i = 0; i < len; i++) {\n    if (str[i] > max) {\n      max = str[i];\n      position = i;\n    }\n  }\n  for (j = 0; j <= position; j++)\n    str1[j] = str[j];\n  for (j = position + 1; j < len; j++)\n    str1[j + 3] = str[j];\n  for (j = 1; j < 4; j++) {\n    str1[j + position] = substr[j - 1];\n  }\n  str1[len + 3] = '\\0';\n  cout << str1 << \"\\n\";\n}\n\nint main() {\n  char str[11];\n  char substr[4];\n\n  while (scanf(\"%s\", str) != EOF)\n\n  {\n\n    scanf(\"%s\", substr);\n    insert(str, substr);\n  }\n}\n"}
{"label": "20", "index": "37267", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, k, j;\n  char str[10], substr[3], d = {EOF};\n  for (j = 0;; j++) {\n    if (scanf(\"%s %s\", &str, &substr) == EOF)\n      break;\n    for (i = 0; i < strlen(str); i++)\n      if (str[i] > d) {\n        k = i;\n        d = str[i];\n      }\n    for (i = 0; i < k + 1; i++) {\n      printf(\"%c\", str[i]);\n    }\n    printf(\"%s\", substr);\n    for (; i < strlen(str) - 1; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%c\\n\", str[i]);\n    d = EOF;\n  }\n}\n"}
{"label": "20", "index": "37268", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char *p1, *p2;\n  int m, n, i, j, k, t, max;\n  p1 = (char *)malloc(1000 * sizeof(char));\n  p2 = (char *)malloc(3 * sizeof(char));\n  while (scanf(\"%s %s\", p1, p2) != EOF) {\n    t = 0;\n    n = strlen(p1);\n    max = *p1;\n    for (i = 0; i < n; i++)\n      if (*(p1 + i) > max) {\n        max = *(p1 + i);\n        t = i;\n      }\n    for (i = n - 1; i >= t + 1; i--)\n      *(p1 + i + 3) = *(p1 + i);\n    *(p1 + n - 1 + 4) = '\\0';\n    for (i = 0; i < 3; i++)\n      *(p1 + t + 1 + i) = *(p2 + i);\n    printf(\"%s\\n\", p1);\n  }\n}\n"}
{"label": "20", "index": "37269", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  int k = 0, i, len;\n  char str[11], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    k = 0;\n    len = strlen(str);\n    for (i = 1; i < len; i++)\n      if (str[i] > str[k])\n        k = i;\n    for (i = 0; i <= k; i++)\n      printf(\"%c\", str[i]);\n    printf(\"%s\", substr);\n    for (i = k + 1; i < len; i++)\n      printf(\"%c\", str[i]);\n    printf(\"\\n\");\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37270", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char a[10], b[3], c, max;\n  int j, t, l;\n  while (scanf(\"%s\", a) != EOF) {\n    scanf(\"%s\", b);\n    l = strlen(a);\n    max = a[0];\n    for (j = 0; j <= l - 1; j++) {\n      if ((int)a[j] > (int)max) {\n        max = a[j];\n        t = j;\n      }\n    }\n    for (j = 0; j <= t; j++)\n      printf(\"%c\", a[j]);\n    printf(\"%s\", b);\n    for (j = t + 1; j <= l - 1; j++)\n      printf(\"%c\", a[j]);\n    printf(\"\\n\");\n  }\n  while ((c = getchar()) != EOF)\n    ;\n  return 0;\n}\n"}
{"label": "20", "index": "37271", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i, j, n, max;\n  char str[15], substr[4];\n  while (scanf(\"%s%s\", str, substr) != EOF) {\n    n = strlen(str);\n    max = 0;\n    for (i = 1; str[i] != '\\0'; i++)\n      if (str[i] > str[max])\n        max = i;\n    for (i = n - 1; i > max; i--)\n      str[i + 3] = str[i];\n    for (i = max + 1, j = 0; i <= max + 3, j < 3; i++, j++)\n      str[i] = substr[j];\n    str[n + 3] = '\\0';\n    cout << str << \"\\n\";\n  }\n}\n"}
{"label": "20", "index": "37272", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nvoid s(char c[], char d[]) {\n  int max = 0, n, y, z;\n  for (n = 0; n < 10; n++) {\n    if (c[n] > max) {\n      max = c[n];\n      y = n;\n    }\n    if (c[n] == '\\0') {\n      z = n;\n      break;\n    }\n  }\n  for (n = z - 1; n > y; n--)\n    c[n + 3] = c[n];\n  c[y + 1] = d[0];\n  c[y + 2] = d[1];\n  c[y + 3] = d[2];\n}\nint main() {\n  char a[20] = {'\\0'}, b[4] = {'\\0'};\n  int i;\n  while (scanf(\"%s %s\", a, b) != EOF) {\n    s(a, b);\n    printf(\"%s\\n\", a);\n    for (i = 0; i < 20; i++)\n      a[i] = '\\0';\n    for (i = 0; i < 4; i++)\n      b[i] = '\\0';\n  }\n}\n"}
{"label": "20", "index": "37273", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  void insert(char *a, char *b);\n  char str[14], substr[3];\n  while (scanf(\"%s\", str) != -1) {\n    scanf(\"%s\", substr);\n    insert(str, substr);\n  }\n  return 0;\n}\n\nvoid insert(char *a, char *b) {\n  int i, m = 1, la, lb;\n  char c[14] = {'\\0'};\n  la = strlen(a);\n  lb = strlen(b);\n  for (i = 1; i < la; i++)\n    if (*(a + i) > *(a + m - 1)) {\n      m = i + 1;\n    }\n  for (i = 0; i < la - m; i++) {\n    c[i] = *(a + m + i);\n    *(a + m + i) = '\\0';\n  }\n  strcat(a, b);\n  strcat(a, c);\n  printf(\"%s\\n\", a);\n}\n"}
{"label": "20", "index": "37274", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\nusing namespace std;\nint main() {\n  int m, i, l;\n  char s[100], sub[10] = {0};\n  while (scanf(\"%s%s\", s, sub) != EOF) {\n    l = strlen(s);\n    m = 0;\n    for (i = 1; i < l; i++) {\n      if (s[i] > s[m])\n        m = i;\n    }\n    for (i = l + 3; i > m + 3; i--) {\n      s[i] = s[i - 3];\n    }\n    s[m + 1] = sub[0];\n    s[m + 2] = sub[1];\n    s[m + 3] = sub[2];\n    cout << s << \"\\n\";\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37275", "code": "#include <bits/stdc++.h>\n#include <iomanip>\n#include <iostream>\n#include <stdio.h>\nusing namespace std;\nint main() {\n  int i = 0, j, k, n, x, y, z = 0;\n  char str[100][12], substr[100][5];\n  while (scanf(\"%s%s\", &str[i], &substr[i]) != EOF) {\n    n = strlen(str[i]);\n    for (j = 0; j < n; j++) {\n      z = 0;\n      for (k = 0; k < n; k++) {\n        if (str[i][j] >= str[i][k])\n          z++;\n      }\n      if (z == n)\n        break;\n    }\n    for (y = 0; y <= j; y++)\n      printf(\"%c\", str[i][y]);\n    printf(\"%s\", substr[i]);\n    for (y = j + 1; y < n; y++)\n      printf(\"%c\", str[i][y]);\n    printf(\"\\n\");\n\n    i++;\n  }\n  return 0;\n}\n"}
{"label": "20", "index": "37276", "code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n  char max(char a[10]);\n  char a[100][15] = {'\\0'}, b[100][3];\n  int i, j;\n  for (i = 0;; i++) {\n    scanf(\"%s %s\", a[i], b[i]);\n    if (a[i][0] == '\\0')\n      break;\n  }\n  int count = i + 1;\n  for (i = 0; i < count; i++) {\n    int m = strlen(a[i]);\n    char c[13] = {0};\n    int k = 0;\n    for (j = 0; j < m; j++) {\n      if (k == 0)\n        c[j] = a[i][j];\n      else if (k > 0) {\n        c[j + 3] = a[i][j];\n      }\n      if ((a[i][j] == max(a[i])) && (k == 0)) {\n        c[j] = a[i][j];\n        c[j + 1] = b[i][0];\n        c[j + 2] = b[i][1];\n        c[j + 3] = b[i][2];\n        k++;\n      }\n    }\n    if (i < count - 1) {\n      printf(\"%s\\n\", c);\n    } else if (i == count - 1)\n      printf(\"%s\\n\", c);\n  }\n  return 0;\n}\nchar max(char a[10]) {\n  int i;\n  char t = a[0];\n  for (i = 0; i < 10; i++)\n    if (a[i] > t)\n      t = a[i];\n  return (t);\n}\n"}
{"label": "20", "index": "37277", "code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n  char s[20], sub[10];\n  int i, j, k, ls, lsub;\n  while (scanf(\"%s%s\", s, sub) != EOF) {\n    ls = strlen(s);\n    lsub = strlen(sub);\n    k = 0;\n    for (i = 1; i < ls; i++)\n      if (s[i] > s[k])\n        k = i;\n    for (i = ls; i > k; i--)\n      s[i + lsub] = s[i];\n    for (i = k + 1, j = 0; j < lsub; i++, j++)\n      s[i] = sub[j];\n    printf(\"%s\\n\", s);\n  }\n}\n"}
{"label": "20", "index": "37278", "cod